diff --git a/amd/chart.js b/amd/chart.js index d0748e2..e118858 100644 --- a/amd/chart.js +++ b/amd/chart.js @@ -2,7 +2,7 @@ * echart图表库 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) */ define(function (/*require*/) { //chart var self = {}; diff --git a/amd/chart/bar.js b/amd/chart/bar.js index 60a1728..b26c03b 100644 --- a/amd/chart/bar.js +++ b/amd/chart/bar.js @@ -2,11 +2,10 @@ * echarts图表类:柱形图 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ define(function (require) { - var ComponentBase = require('../component/base'); var ChartBase = require('./base'); // 图形依赖 @@ -17,6 +16,49 @@ define(function (require) { require('../component/dataZoom'); var ecConfig = require('../config'); + // 柱形图默认参数 + ecConfig.bar = { + zlevel: 0, // 一级层叠 + z: 2, // 二级层叠 + clickable: true, + legendHoverLink: true, + // stack: null + xAxisIndex: 0, + yAxisIndex: 0, + barMinHeight: 0, // 最小高度改为0 + // barWidth: null, // 默认自适应 + barGap: '30%', // 柱间距离,默认为柱形宽度的30%,可设固定值 + barCategoryGap: '20%', // 类目间柱形距离,默认为类目间距的20%,可设固定值 + itemStyle: { + normal: { + // color: '各异', + barBorderColor: '#fff', // 柱条边线 + barBorderRadius: 0, // 柱条边线圆角,单位px,默认为0 + barBorderWidth: 0, // 柱条边线线宽,单位px,默认为1 + label: { + show: false + // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调 + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 + // 'inside'|'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + } + }, + emphasis: { + // color: '各异', + barBorderColor: '#fff', // 柱条边线 + barBorderRadius: 0, // 柱条边线圆角,单位px,默认为0 + barBorderWidth: 0, // 柱条边线线宽,单位px,默认为1 + label: { + show: false + // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调 + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 + // 'inside'|'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + } + } + } + }; + var ecData = require('../util/ecData'); var zrUtil = require('../zrender/tool/util'); var zrColor = require('../zrender/tool/color'); @@ -29,293 +71,175 @@ define(function (require) { * @param {Object} component 组件 */ function Bar(ecTheme, messageCenter, zr, option, myChart){ - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); // 图表基类 - ChartBase.call(this); + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); this.refresh(option); } Bar.prototype = { - type : ecConfig.CHART_TYPE_BAR, + type: ecConfig.CHART_TYPE_BAR, /** * 绘制图形 */ - _buildShape : function () { - var series = this.series; - this.selectedMap = {}; - this.xMarkMap = {}; - - // series默认颜色索引,seriesIndex索引到color - this._sIndex2colorMap = {}; - - // 水平垂直双向series索引 ,position索引到seriesIndex - var _position2sIndexMap = { - top : [], - bottom : [], - left : [], - right : [] - }; - var xAxisIndex; - var yAxisIndex; - var xAxis; - var yAxis; - for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type == ecConfig.CHART_TYPE_BAR) { - series[i] = this.reformOption(series[i]); - xAxisIndex = series[i].xAxisIndex; - yAxisIndex = series[i].yAxisIndex; - xAxis = this.component.xAxis.getAxis(xAxisIndex); - yAxis = this.component.yAxis.getAxis(yAxisIndex); - if (xAxis.type == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY - ) { - _position2sIndexMap[xAxis.getPosition()].push(i); - } - else if (yAxis.type == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY - ) { - _position2sIndexMap[yAxis.getPosition()].push(i); - } - } - } - // console.log(_position2sIndexMap) - for (var position in _position2sIndexMap) { - if (_position2sIndexMap[position].length > 0) { - this._buildSinglePosition( - position, _position2sIndexMap[position], this.xMarkMap - ); - } - } - - this.addShapeList(); + _buildShape: function () { + this._buildPosition(); }, - - /** - * 构建单个方向上的柱形图 - * - * @param {number} seriesIndex 系列索引 - */ - _buildSinglePosition : function (position, seriesArray, xMarkMap) { - var mapData = this._mapData(seriesArray); - var locationMap = mapData.locationMap; - var maxDataLength = mapData.maxDataLength; - - if (maxDataLength === 0 || locationMap.length === 0) { - return; - } - - switch (position) { - case 'bottom' : - case 'top' : - this._buildHorizontal(maxDataLength, locationMap, seriesArray, xMarkMap); - break; - case 'left' : - case 'right' : - this._buildVertical(maxDataLength, locationMap, seriesArray, xMarkMap); - break; - } - }, - - /** - * 数据整形 - * 数组位置映射到系列索引 - */ - _mapData : function (seriesArray) { - var series = this.series; - var serie; // 临时映射变量 - var dataIndex = 0; // 堆积数据所在位置映射 - var stackMap = {}; // 堆积数据位置映射,堆积组在二维中的第几项 - var magicStackKey = '__kener__stack__'; // 堆积命名,非堆积数据安单一堆积处理 - var stackKey; // 临时映射变量 - var serieName; // 临时映射变量 - var legend = this.component.legend; - var locationMap = []; // 需要返回的东西:数组位置映射到系列索引 - var maxDataLength = 0; // 需要返回的东西:最大数据长度 - var iconShape; - // 计算需要显示的个数和分配位置并记在下面这个结构里 - for (var i = 0, l = seriesArray.length; i < l; i++) { - serie = series[seriesArray[i]]; - serieName = serie.name; - if (legend){ - this.selectedMap[serieName] = legend.isSelected(serieName); - this._sIndex2colorMap[seriesArray[i]] = - legend.getColor(serieName); - - iconShape = legend.getItemShape(serieName); - if (iconShape) { - // 回调legend,换一个更形象的icon - if (serie.itemStyle.normal.borderWidth > 0) { - iconShape.style.x += 1; - iconShape.style.y += 1; - iconShape.style.width -= 2; - iconShape.style.height -= 2; - iconShape.style.strokeColor = - iconShape.highlightStyle.strokeColor = - serie.itemStyle.normal.borderColor; - iconShape.highlightStyle.lineWidth = 3; - iconShape.style.brushType = 'both'; - } - legend.setItemShape(serieName, iconShape); - } - } else { - this.selectedMap[serieName] = true; - this._sIndex2colorMap[seriesArray[i]] = - this.zr.getColor(seriesArray[i]); - } - - if (this.selectedMap[serieName]) { - stackKey = serie.stack || (magicStackKey + seriesArray[i]); - if (typeof stackMap[stackKey] == 'undefined') { - stackMap[stackKey] = dataIndex; - locationMap[dataIndex] = [seriesArray[i]]; - dataIndex++; - } - else { - // 已经分配了位置就推进去就行 - locationMap[stackMap[stackKey]].push(seriesArray[i]); - } - } - // 兼职帮算一下最大长度 - maxDataLength = Math.max(maxDataLength, serie.data.length); - } - - /* 调试输出 - var s = ''; - for (var i = 0, l = maxDataLength; i < l; i++) { - s = '['; - for (var j = 0, k = locationMap.length; j < k; j++) { - s +='[' - for (var m = 0, n = locationMap[j].length - 1; m < n; m++) { - s += series[locationMap[j][m]].data[i] + ',' - } - s += series[locationMap[j][locationMap[j].length - 1]] - .data[i]; - s += ']' - } - s += ']'; - console.log(s); - } - console.log(locationMap) - */ - - return { - locationMap : locationMap, - maxDataLength : maxDataLength - }; - }, - - /** - * 构建类目轴为水平方向的柱形图系列 - */ - _buildHorizontal : function (maxDataLength, locationMap, seriesArray, xMarkMap) { + + _buildNormal: function(seriesArray, maxDataLength, locationMap, xMarkMap, orient) { var series = this.series; // 确定类目轴和数值轴,同一方向随便找一个即可 var seriesIndex = locationMap[0][0]; var serie = series[seriesIndex]; - var xAxisIndex = serie.xAxisIndex; - var categoryAxis = this.component.xAxis.getAxis(xAxisIndex); - var yAxisIndex; // 数值轴各异 + var isHorizontal = orient == 'horizontal'; + var xAxis = this.component.xAxis; + var yAxis = this.component.yAxis; + var categoryAxis = isHorizontal + ? xAxis.getAxis(serie.xAxisIndex) + : yAxis.getAxis(serie.yAxisIndex); var valueAxis; // 数值轴各异 var size = this._mapSize(categoryAxis, locationMap); var gap = size.gap; var barGap = size.barGap; var barWidthMap = size.barWidthMap; + var barMaxWidthMap = size.barMaxWidthMap; var barWidth = size.barWidth; // 自适应宽度 var barMinHeightMap = size.barMinHeightMap; var barHeight; + var curBarWidth; var interval = size.interval; var x; var y; - var lastYP; // 正向堆积处理 - var baseYP; - var lastYN; // 负向堆积处理 - var baseYN; + var lastP; // 正向堆积处理 + var baseP; + var lastN; // 负向堆积处理 + var baseN; var barShape; var data; var value; + var islandR = this.deepQuery([this.ecTheme, ecConfig], 'island.r'); for (var i = 0, l = maxDataLength; i < l; i++) { - if (typeof categoryAxis.getNameByIndex(i) == 'undefined') { + if (categoryAxis.getNameByIndex(i) == null) { // 系列数据超出类目轴长度 break; } - x = categoryAxis.getCoordByIndex(i) - gap / 2; + isHorizontal + ? (x = categoryAxis.getCoordByIndex(i) - gap / 2) + : (y = categoryAxis.getCoordByIndex(i) + gap / 2); + for (var j = 0, k = locationMap.length; j < k; j++) { // 堆积数据用第一条valueAxis - yAxisIndex = series[locationMap[j][0]].yAxisIndex || 0; - valueAxis = this.component.yAxis.getAxis(yAxisIndex); - baseYP = lastYP = baseYN = lastYN = valueAxis.getCoord(0); + var yAxisIndex = series[locationMap[j][0]].yAxisIndex || 0; + var xAxisIndex = series[locationMap[j][0]].xAxisIndex || 0; + valueAxis = isHorizontal + ? yAxis.getAxis(yAxisIndex) + : xAxis.getAxis(xAxisIndex); + baseP = lastP = baseN = lastN = valueAxis.getCoord(0); for (var m = 0, n = locationMap[j].length; m < n; m++) { seriesIndex = locationMap[j][m]; serie = series[seriesIndex]; data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; + value = this.getDataFromOption(data, '-'); xMarkMap[seriesIndex] = xMarkMap[seriesIndex] || { - min : Number.POSITIVE_INFINITY, - max : Number.NEGATIVE_INFINITY, - sum : 0, - counter : 0, - average : 0 + min: Number.POSITIVE_INFINITY, + max: Number.NEGATIVE_INFINITY, + sum: 0, + counter: 0, + average: 0 }; - if (value == '-') { + curBarWidth = Math.min( + barMaxWidthMap[seriesIndex] || Number.MAX_VALUE, + barWidthMap[seriesIndex] || barWidth + ); + if (value === '-') { // 空数据在做完后补充拖拽提示框 continue; } - //y = valueAxis.getCoord(value); if (value > 0) { // 正向堆积 - //barHeight = baseYP - y; barHeight = m > 0 ? valueAxis.getCoordSize(value) - : (baseYP - valueAxis.getCoord(value)); + : ( + isHorizontal + ? (baseP - valueAxis.getCoord(value)) + : (valueAxis.getCoord(value) - baseP) + ); // 非堆积数据最小高度有效 - if (n == 1 - && barMinHeightMap[seriesIndex] > barHeight - ) { + if (n === 1 && barMinHeightMap[seriesIndex] > barHeight) { barHeight = barMinHeightMap[seriesIndex]; } - lastYP -= barHeight; - y = lastYP; + if (isHorizontal) { + lastP -= barHeight; + y = lastP; + } + else { + x = lastP; + lastP += barHeight; + } } else if (value < 0){ // 负向堆积 - //barHeight = y - baseYN; barHeight = m > 0 ? valueAxis.getCoordSize(value) - : (valueAxis.getCoord(value) - baseYN); + : ( + isHorizontal + ? (valueAxis.getCoord(value) - baseN) + : (baseN - valueAxis.getCoord(value)) + ); // 非堆积数据最小高度有效 - if (n == 1 - && barMinHeightMap[seriesIndex] > barHeight - ) { + if (n === 1 && barMinHeightMap[seriesIndex] > barHeight) { barHeight = barMinHeightMap[seriesIndex]; } - y = lastYN; - lastYN += barHeight; + if (isHorizontal) { + y = lastN; + lastN += barHeight; + } + else { + lastN -= barHeight; + x = lastN; + } } else { // 0值 - barHeight = 0;//baseYP - y; + barHeight = 0; // 最小高度无效 - lastYP -= barHeight; - y = lastYP; + if (isHorizontal) { + lastP -= barHeight; + y = lastP; + } + else { + x = lastP; + lastP += barHeight; + } } - xMarkMap[seriesIndex][i] = - x + (barWidthMap[seriesIndex] || barWidth) / 2; + xMarkMap[seriesIndex][i] = isHorizontal + ? (x + curBarWidth / 2) + : (y - curBarWidth / 2); if (xMarkMap[seriesIndex].min > value) { xMarkMap[seriesIndex].min = value; - xMarkMap[seriesIndex].minY = y; - xMarkMap[seriesIndex].minX = xMarkMap[seriesIndex][i]; + if (isHorizontal) { + xMarkMap[seriesIndex].minY = y; + xMarkMap[seriesIndex].minX = xMarkMap[seriesIndex][i]; + } + else { + xMarkMap[seriesIndex].minX = x + barHeight; + xMarkMap[seriesIndex].minY = xMarkMap[seriesIndex][i]; + } } if (xMarkMap[seriesIndex].max < value) { xMarkMap[seriesIndex].max = value; - xMarkMap[seriesIndex].maxY = y; - xMarkMap[seriesIndex].maxX = xMarkMap[seriesIndex][i]; + if (isHorizontal) { + xMarkMap[seriesIndex].maxY = y; + xMarkMap[seriesIndex].maxX = xMarkMap[seriesIndex][i]; + } + else { + xMarkMap[seriesIndex].maxX = x + barHeight; + xMarkMap[seriesIndex].maxY = xMarkMap[seriesIndex][i]; + } + } xMarkMap[seriesIndex].sum += value; xMarkMap[seriesIndex].counter++; @@ -324,10 +248,11 @@ define(function (require) { barShape = this._getBarItem( seriesIndex, i, categoryAxis.getNameByIndex(i), - x, y, - barWidthMap[seriesIndex] || barWidth, - barHeight, - 'vertical' + x, + y - (isHorizontal ? 0 : curBarWidth), + isHorizontal ? curBarWidth : barHeight, + isHorizontal ? barHeight : curBarWidth, + isHorizontal ? 'vertical' : 'horizontal' ); this.shapeList.push(new RectangleShape(barShape)); } @@ -338,284 +263,209 @@ define(function (require) { seriesIndex = locationMap[j][m]; serie = series[seriesIndex]; data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; + value = this.getDataFromOption(data, '-'); + curBarWidth = Math.min( + barMaxWidthMap[seriesIndex] || Number.MAX_VALUE, + barWidthMap[seriesIndex] || barWidth + ); if (value != '-') { // 只关心空数据 continue; } - if (this.deepQuery( - [data, serie, this.option], 'calculable' - ) - ) { - lastYP -= this.ecTheme.island.r; - y = lastYP; - + if (this.deepQuery([data, serie, this.option], 'calculable')) { + if (isHorizontal) { + lastP -= islandR; + y = lastP; + } + else { + x = lastP; + lastP += islandR; + } + barShape = this._getBarItem( seriesIndex, i, categoryAxis.getNameByIndex(i), - x + 0.5, y + 0.5, - (barWidthMap[seriesIndex] || barWidth) - 1, - this.ecTheme.island.r - 1, - 'vertical' + x, + y - (isHorizontal ? 0 : curBarWidth), + isHorizontal ? curBarWidth : islandR, + isHorizontal ? islandR : curBarWidth, + isHorizontal ? 'vertical' : 'horizontal' ); barShape.hoverable = false; barShape.draggable = false; barShape.style.lineWidth = 1; barShape.style.brushType = 'stroke'; - barShape.style.strokeColor = - serie.calculableHolderColor - || this.ecTheme.calculableHolderColor; + barShape.style.strokeColor = serie.calculableHolderColor + || this.ecTheme.calculableHolderColor + || ecConfig.calculableHolderColor; this.shapeList.push(new RectangleShape(barShape)); } } - - x += ((barWidthMap[seriesIndex] || barWidth) + barGap); + isHorizontal + ? (x += (curBarWidth + barGap)) + : (y -= (curBarWidth + barGap)); } } - for (var j = 0, k = locationMap.length; j < k; j++) { - for (var m = 0, n = locationMap[j].length; m < n; m++) { - seriesIndex = locationMap[j][m]; - if (xMarkMap[seriesIndex].counter > 0) { - xMarkMap[seriesIndex].average = - (xMarkMap[seriesIndex].sum / xMarkMap[seriesIndex].counter).toFixed(2) - - 0; - } - - y = this.component.yAxis.getAxis(series[seriesIndex].yAxisIndex || 0) - .getCoord(xMarkMap[seriesIndex].average); - - xMarkMap[seriesIndex].averageLine = [ - [this.component.grid.getX(), y], - [this.component.grid.getXend(), y] - ]; - xMarkMap[seriesIndex].minLine = [ - [this.component.grid.getX(), xMarkMap[seriesIndex].minY], - [this.component.grid.getXend(), xMarkMap[seriesIndex].minY] - ]; - xMarkMap[seriesIndex].maxLine = [ - [this.component.grid.getX(), xMarkMap[seriesIndex].maxY], - [this.component.grid.getXend(), xMarkMap[seriesIndex].maxY] - ]; - - xMarkMap[seriesIndex].isHorizontal = true; - this.buildMark(seriesIndex); - } - } + this._calculMarkMapXY(xMarkMap, locationMap, isHorizontal ? 'y' : 'x'); + }, + /** + * 构建类目轴为水平方向的柱形图系列 + */ + _buildHorizontal: function (seriesArray, maxDataLength, locationMap, xMarkMap) { + return this._buildNormal( + seriesArray, maxDataLength, locationMap, xMarkMap, 'horizontal' + ); }, /** * 构建类目轴为垂直方向的柱形图系列 */ - _buildVertical : function (maxDataLength, locationMap, seriesArray, xMarkMap) { + _buildVertical: function (seriesArray, maxDataLength, locationMap, xMarkMap) { + return this._buildNormal( + seriesArray, maxDataLength, locationMap, xMarkMap, 'vertical' + ); + }, + + /** + * 构建双数值轴柱形图 + */ + _buildOther: function (seriesArray, maxDataLength, locationMap, xMarkMap) { var series = this.series; - // 确定类目轴和数值轴,同一方向随便找一个即可 - var seriesIndex = locationMap[0][0]; - var serie = series[seriesIndex]; - var yAxisIndex = serie.yAxisIndex; - var categoryAxis = this.component.yAxis.getAxis(yAxisIndex); - var xAxisIndex; // 数值轴各异 - var valueAxis; // 数值轴各异 - - var size = this._mapSize(categoryAxis, locationMap); - var gap = size.gap; - var barGap = size.barGap; - var barWidthMap = size.barWidthMap; - var barWidth = size.barWidth; // 自适应宽度 - var barMinHeightMap = size.barMinHeightMap; - var barHeight; - var interval = size.interval; - - var x; - var y; - var lastXP; // 正向堆积处理 - var baseXP; - var lastXN; // 负向堆积处理 - var baseXN; - var barShape; - var data; - var value; - for (var i = 0, l = maxDataLength; i < l; i++) { - if (typeof categoryAxis.getNameByIndex(i) == 'undefined') { - // 系列数据超出类目轴长度 - break; - } - y = categoryAxis.getCoordByIndex(i) + gap / 2; - for (var j = 0, k = locationMap.length; j < k; j++) { - // 堆积数据用第一条valueAxis - xAxisIndex = series[locationMap[j][0]].xAxisIndex || 0; - valueAxis = this.component.xAxis.getAxis(xAxisIndex); - baseXP = lastXP = baseXN = lastXN = valueAxis.getCoord(0); - for (var m = 0, n = locationMap[j].length; m < n; m++) { - seriesIndex = locationMap[j][m]; - serie = series[seriesIndex]; - data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; - xMarkMap[seriesIndex] = xMarkMap[seriesIndex] - || { - min : Number.POSITIVE_INFINITY, - max : Number.NEGATIVE_INFINITY, - sum : 0, - counter : 0, - average : 0 - }; - if (value == '-') { - // 空数据在做完后补充拖拽提示框 + + for (var j = 0, k = locationMap.length; j < k; j++) { + for (var m = 0, n = locationMap[j].length; m < n; m++) { + var seriesIndex = locationMap[j][m]; + var serie = series[seriesIndex]; + var xAxisIndex = serie.xAxisIndex || 0; + var xAxis = this.component.xAxis.getAxis(xAxisIndex); + var baseX = xAxis.getCoord(0); + var yAxisIndex = serie.yAxisIndex || 0; + var yAxis = this.component.yAxis.getAxis(yAxisIndex); + var baseY = yAxis.getCoord(0); + + xMarkMap[seriesIndex] = xMarkMap[seriesIndex] + || { + min0: Number.POSITIVE_INFINITY, + min1: Number.POSITIVE_INFINITY, + max0: Number.NEGATIVE_INFINITY, + max1: Number.NEGATIVE_INFINITY, + sum0: 0, + sum1: 0, + counter0: 0, + counter1: 0, + average0: 0, + average1: 0 + }; + + for (var i = 0, l = serie.data.length; i < l; i++) { + var data = serie.data[i]; + var value = this.getDataFromOption(data, '-'); + if (!(value instanceof Array)) { continue; } - //x = valueAxis.getCoord(value); - if (value > 0) { - // 正向堆积 - //barHeight = x - baseXP; - barHeight = m > 0 - ? valueAxis.getCoordSize(value) - : (valueAxis.getCoord(value) - baseXP); - // 非堆积数据最小高度有效 - if (n == 1 - && barMinHeightMap[seriesIndex] > barHeight - ) { - barHeight = barMinHeightMap[seriesIndex]; + + var x = xAxis.getCoord(value[0]); + var y = yAxis.getCoord(value[1]); + + var queryTarget = [data, serie]; + var barWidth = this.deepQuery(queryTarget, 'barWidth') || 10; // 默认柱形 + var barHeight = this.deepQuery(queryTarget, 'barHeight'); + var orient; + var barShape; + + if (barHeight != null) { + // 条形图 + orient = 'horizontal'; + + if (value[0] > 0) { + // 正向 + barWidth = x - baseX; + x -= barWidth; } - x = lastXP; - lastXP += barHeight; - } - else if (value < 0){ - // 负向堆积 - //barHeight = baseXN - x; - barHeight = m > 0 - ? valueAxis.getCoordSize(value) - : (baseXN - valueAxis.getCoord(value)); - // 非堆积数据最小高度有效 - if (n == 1 - && barMinHeightMap[seriesIndex] > barHeight - ) { - barHeight = barMinHeightMap[seriesIndex]; + else if (value[0] < 0){ + // 负向 + barWidth = baseX - x; } - lastXN -= barHeight; - x = lastXN; + else { + // 0值 + barWidth = 0; + } + + barShape = this._getBarItem( + seriesIndex, i, + value[0], + x, + y - barHeight / 2, + barWidth, + barHeight, + orient + ); } else { - // 0值 - barHeight = 0;//x - baseXP; - // 最小高度无效 - x = lastXP; - lastXP += barHeight; - } - - xMarkMap[seriesIndex][i] = - y - (barWidthMap[seriesIndex] || barWidth) / 2; - if (xMarkMap[seriesIndex].min > value) { - xMarkMap[seriesIndex].min = value; - xMarkMap[seriesIndex].minX = x + barHeight; - xMarkMap[seriesIndex].minY = xMarkMap[seriesIndex][i]; - } - if (xMarkMap[seriesIndex].max < value) { - xMarkMap[seriesIndex].max = value; - xMarkMap[seriesIndex].maxX = x + barHeight; - xMarkMap[seriesIndex].maxY = xMarkMap[seriesIndex][i]; - } - xMarkMap[seriesIndex].sum += value; - xMarkMap[seriesIndex].counter++; - - if (i % interval === 0) { + // 柱形 + orient = 'vertical'; + + if (value[1] > 0) { + // 正向 + barHeight = baseY - y; + } + else if (value[1] < 0){ + // 负向 + barHeight = y - baseY; + y -= barHeight; + } + else { + // 0值 + barHeight = 0; + } barShape = this._getBarItem( seriesIndex, i, - categoryAxis.getNameByIndex(i), - x, y - (barWidthMap[seriesIndex] || barWidth), + value[0], + x - barWidth / 2, + y, + barWidth, barHeight, - barWidthMap[seriesIndex] || barWidth, - 'horizontal' + orient ); - this.shapeList.push(new RectangleShape(barShape)); } - } - - // 补充空数据的拖拽提示框 - for (var m = 0, n = locationMap[j].length; m < n; m++) { - seriesIndex = locationMap[j][m]; - serie = series[seriesIndex]; - data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; - if (value != '-') { - // 只关心空数据 - continue; + this.shapeList.push(new RectangleShape(barShape)); + + + x = xAxis.getCoord(value[0]); + y = yAxis.getCoord(value[1]); + if (xMarkMap[seriesIndex].min0 > value[0]) { + xMarkMap[seriesIndex].min0 = value[0]; + xMarkMap[seriesIndex].minY0 = y; + xMarkMap[seriesIndex].minX0 = x; } - - if (this.deepQuery( - [data, serie, this.option], 'calculable' - ) - ) { - x = lastXP; - lastXP += this.ecTheme.island.r; - - barShape = this._getBarItem( - seriesIndex, - i, - categoryAxis.getNameByIndex(i), - x + 0.5, y + 0.5 - (barWidthMap[seriesIndex] || barWidth), - this.ecTheme.island.r - 1, - (barWidthMap[seriesIndex] || barWidth) - 1, - 'horizontal' - ); - barShape.hoverable = false; - barShape.draggable = false; - barShape.style.lineWidth = 1; - barShape.style.brushType = 'stroke'; - barShape.style.strokeColor = - serie.calculableHolderColor - || this.ecTheme.calculableHolderColor; - - this.shapeList.push(new RectangleShape(barShape)); + if (xMarkMap[seriesIndex].max0 < value[0]) { + xMarkMap[seriesIndex].max0 = value[0]; + xMarkMap[seriesIndex].maxY0 = y; + xMarkMap[seriesIndex].maxX0 = x; + } + xMarkMap[seriesIndex].sum0 += value[0]; + xMarkMap[seriesIndex].counter0++; + + if (xMarkMap[seriesIndex].min1 > value[1]) { + xMarkMap[seriesIndex].min1 = value[1]; + xMarkMap[seriesIndex].minY1 = y; + xMarkMap[seriesIndex].minX1 = x; } + if (xMarkMap[seriesIndex].max1 < value[1]) { + xMarkMap[seriesIndex].max1 = value[1]; + xMarkMap[seriesIndex].maxY1 = y; + xMarkMap[seriesIndex].maxX1 = x; + } + xMarkMap[seriesIndex].sum1 += value[1]; + xMarkMap[seriesIndex].counter1++; } - - y -= ((barWidthMap[seriesIndex] || barWidth) + barGap); } } - for (var j = 0, k = locationMap.length; j < k; j++) { - for (var m = 0, n = locationMap[j].length; m < n; m++) { - seriesIndex = locationMap[j][m]; - if (xMarkMap[seriesIndex].counter > 0) { - xMarkMap[seriesIndex].average = - (xMarkMap[seriesIndex].sum / xMarkMap[seriesIndex].counter).toFixed(2) - - 0; - } - - x = this.component.xAxis.getAxis(series[seriesIndex].xAxisIndex || 0) - .getCoord(xMarkMap[seriesIndex].average); - - xMarkMap[seriesIndex].averageLine = [ - [x, this.component.grid.getYend()], - [x, this.component.grid.getY()] - ]; - xMarkMap[seriesIndex].minLine = [ - [xMarkMap[seriesIndex].minX, this.component.grid.getYend()], - [xMarkMap[seriesIndex].minX, this.component.grid.getY()] - ]; - xMarkMap[seriesIndex].maxLine = [ - [xMarkMap[seriesIndex].maxX, this.component.grid.getYend()], - [xMarkMap[seriesIndex].maxX, this.component.grid.getY()] - ]; - - xMarkMap[seriesIndex].isHorizontal = false; - this.buildMark(seriesIndex); - } - } + this._calculMarkMapXY(xMarkMap, locationMap, 'xy'); }, /** @@ -623,99 +473,43 @@ define(function (require) { * @param {CategoryAxis} categoryAxis 类目坐标轴,需要知道类目间隔大小 * @param {Array} locationMap 整形数据的系列索引 */ - _mapSize : function (categoryAxis, locationMap, ignoreUserDefined) { - var series = this.series; - var seriesIndex; - var barWidthMap = {}; - var barMinHeightMap = {}; - var sBarWidth; - var sBarWidthCounter = 0; - var sBarWidthTotal = 0; - var barGap; - var barCategoryGap; - var hasFound; - var queryTarget; - var interval = 1; - - for (var j = 0, k = locationMap.length; j < k; j++) { - hasFound = false; // 同一堆积第一个barWidth生效 - for (var m = 0, n = locationMap[j].length; m < n; m++) { - seriesIndex = locationMap[j][m]; - queryTarget = series[seriesIndex]; - if (!ignoreUserDefined) { - if (!hasFound) { - sBarWidth = this.query( - queryTarget, - 'barWidth' - ); - if (typeof sBarWidth != 'undefined') { - // 同一堆积第一个生效barWidth - barWidthMap[seriesIndex] = sBarWidth; - sBarWidthTotal += sBarWidth; - sBarWidthCounter++; - hasFound = true; - // 复位前面同一堆积但没被定义的 - for (var ii = 0, ll = m; ii < ll; ii++) { - var pSeriesIndex = locationMap[j][ii]; - barWidthMap[pSeriesIndex] = sBarWidth; - } - } - } else { - barWidthMap[seriesIndex] = sBarWidth; // 用找到的一个 - } - } - - barMinHeightMap[seriesIndex] = this.query( - queryTarget, - 'barMinHeight' - ); - barGap = typeof barGap != 'undefined' - ? barGap - : this.query( - queryTarget, - 'barGap' - ); - barCategoryGap = typeof barCategoryGap != 'undefined' - ? barCategoryGap - : this.query( - queryTarget, - 'barCategoryGap' - ); - } - } - + _mapSize: function (categoryAxis, locationMap, ignoreUserDefined) { + var res = this._findSpecialBarSzie(locationMap, ignoreUserDefined); + var barWidthMap = res.barWidthMap; + var barMaxWidthMap = res.barMaxWidthMap; + var barMinHeightMap = res.barMinHeightMap; + var sBarWidthCounter = res.sBarWidthCounter; // 用户指定 + var sBarWidthTotal = res.sBarWidthTotal; // 用户指定 + var barGap = res.barGap; + var barCategoryGap = res.barCategoryGap; + var gap; var barWidth; + var interval = 1; if (locationMap.length != sBarWidthCounter) { // 至少存在一个自适应宽度的柱形图 if (!ignoreUserDefined) { - gap = typeof barCategoryGap == 'string' - && barCategoryGap.match(/%$/) - // 百分比 - ? Math.floor( - categoryAxis.getGap() - * (100 - parseFloat(barCategoryGap)) - / 100 - ) - // 数值 - : (categoryAxis.getGap() - barCategoryGap); - if (typeof barGap == 'string' && barGap.match(/%$/)) { + gap = typeof barCategoryGap === 'string' && barCategoryGap.match(/%$/) + // 百分比 + ? ((categoryAxis.getGap() * (100 - parseFloat(barCategoryGap)) / 100).toFixed(2) - 0) + // 数值 + : (categoryAxis.getGap() - barCategoryGap); + if (typeof barGap === 'string' && barGap.match(/%$/)) { barGap = parseFloat(barGap) / 100; - barWidth = Math.floor( - (gap - sBarWidthTotal) - / ((locationMap.length - 1) * barGap - + locationMap.length - sBarWidthCounter) - ); - barGap = Math.floor(barWidth * barGap); + barWidth = +( + (gap - sBarWidthTotal) / ( + (locationMap.length - 1) * barGap + locationMap.length - sBarWidthCounter + ) + ).toFixed(2); + barGap = barWidth * barGap; } else { barGap = parseFloat(barGap); - barWidth = Math.floor( - (gap - sBarWidthTotal - - barGap * (locationMap.length - 1) + barWidth = +( + (gap - sBarWidthTotal - barGap * (locationMap.length - 1)) / ( + locationMap.length - sBarWidthCounter ) - / (locationMap.length - sBarWidthCounter) - ); + ).toFixed(2); } // 无法满足用户定义的宽度设计,忽略用户宽度,打回重做 if (barWidth <= 0) { @@ -726,7 +520,7 @@ define(function (require) { // 忽略用户定义的宽度设定 gap = categoryAxis.getGap(); barGap = 0; - barWidth = Math.floor(gap / locationMap.length); + barWidth = +(gap / locationMap.length).toFixed(2); // 已经忽略用户定义的宽度设定依然还无法满足显示,只能硬来了; if (barWidth <= 0) { interval = Math.floor(locationMap.length / gap); @@ -737,151 +531,251 @@ define(function (require) { else { // 全是自定义宽度,barGap无效,系列间隔决定barGap gap = sBarWidthCounter > 1 - ? (typeof barCategoryGap == 'string' - && barCategoryGap.match(/%$/) - ) + ? (typeof barCategoryGap === 'string' && barCategoryGap.match(/%$/)) // 百分比 - ? Math.floor( - categoryAxis.getGap() - * (100 - parseFloat(barCategoryGap)) - / 100 - ) + ? +(categoryAxis.getGap() * (100 - parseFloat(barCategoryGap)) / 100).toFixed(2) // 数值 : (categoryAxis.getGap() - barCategoryGap) // 只有一个 : sBarWidthTotal; barWidth = 0; barGap = sBarWidthCounter > 1 - ? Math.floor( - (gap - sBarWidthTotal) / (sBarWidthCounter - 1) - ) + ? +((gap - sBarWidthTotal) / (sBarWidthCounter - 1)).toFixed(2) : 0; if (barGap < 0) { // 无法满足用户定义的宽度设计,忽略用户宽度,打回重做 return this._mapSize(categoryAxis, locationMap, true); } } + + // 检查是否满足barMaxWidthMap + + return this._recheckBarMaxWidth( + locationMap, + barWidthMap, barMaxWidthMap, barMinHeightMap, + gap, // 总宽度 + barWidth, barGap, interval + ); + }, + + /** + * 计算堆积下用户特殊指定的各种size + */ + _findSpecialBarSzie: function(locationMap, ignoreUserDefined) { + var series = this.series; + var barWidthMap = {}; + var barMaxWidthMap = {}; + var barMinHeightMap = {}; + var sBarWidth; // 用户指定 + var sBarMaxWidth; // 用户指定 + var sBarWidthCounter = 0; // 用户指定 + var sBarWidthTotal = 0; // 用户指定 + var barGap; + var barCategoryGap; + for (var j = 0, k = locationMap.length; j < k; j++) { + var hasFound = { + barWidth: false, + barMaxWidth: false + }; + for (var m = 0, n = locationMap[j].length; m < n; m++) { + var seriesIndex = locationMap[j][m]; + var queryTarget = series[seriesIndex]; + if (!ignoreUserDefined) { + if (!hasFound.barWidth) { + sBarWidth = this.query(queryTarget, 'barWidth'); + if (sBarWidth != null) { + // 同一堆积第一个生效barWidth + barWidthMap[seriesIndex] = sBarWidth; + sBarWidthTotal += sBarWidth; + sBarWidthCounter++; + hasFound.barWidth = true; + // 复位前面同一堆积但没被定义的 + for (var ii = 0, ll = m; ii < ll; ii++) { + var pSeriesIndex = locationMap[j][ii]; + barWidthMap[pSeriesIndex] = sBarWidth; + } + } + } + else { + barWidthMap[seriesIndex] = sBarWidth; // 用找到的一个 + } + + if (!hasFound.barMaxWidth) { + sBarMaxWidth = this.query(queryTarget, 'barMaxWidth'); + if (sBarMaxWidth != null) { + // 同一堆积第一个生效barMaxWidth + barMaxWidthMap[seriesIndex] = sBarMaxWidth; + hasFound.barMaxWidth = true; + // 复位前面同一堆积但没被定义的 + for (var ii = 0, ll = m; ii < ll; ii++) { + var pSeriesIndex = locationMap[j][ii]; + barMaxWidthMap[pSeriesIndex] = sBarMaxWidth; + } + } + } + else { + barMaxWidthMap[seriesIndex] = sBarMaxWidth; // 用找到的一个 + } + } + barMinHeightMap[seriesIndex] = this.query(queryTarget, 'barMinHeight'); + barGap = barGap != null ? barGap : this.query(queryTarget, 'barGap'); + barCategoryGap = barCategoryGap != null + ? barCategoryGap : this.query(queryTarget, 'barCategoryGap'); + } + } + return { - barWidthMap : barWidthMap, - barMinHeightMap : barMinHeightMap , - gap : gap, - barWidth : barWidth, - barGap : barGap, - interval : interval + barWidthMap: barWidthMap, + barMaxWidthMap: barMaxWidthMap, + barMinHeightMap: barMinHeightMap, + sBarWidth: sBarWidth, + sBarMaxWidth: sBarMaxWidth, + sBarWidthCounter: sBarWidthCounter, + sBarWidthTotal: sBarWidthTotal, + barGap: barGap, + barCategoryGap: barCategoryGap }; }, - + + /** + * 检查是否满足barMaxWidthMap + */ + _recheckBarMaxWidth: function( + locationMap, + barWidthMap, barMaxWidthMap, barMinHeightMap, + gap, // 总宽度 + barWidth, barGap, interval + ) { + for (var j = 0, k = locationMap.length; j < k; j++) { + var seriesIndex = locationMap[j][0]; + if (barMaxWidthMap[seriesIndex] && barMaxWidthMap[seriesIndex] < barWidth) { + // 不满足最大宽度 + gap -= barWidth - barMaxWidthMap[seriesIndex]; // 总宽度减少 + } + } + + return { + barWidthMap: barWidthMap, + barMaxWidthMap: barMaxWidthMap, + barMinHeightMap: barMinHeightMap , + gap: gap, // 总宽度 + barWidth: barWidth, + barGap: barGap, + interval: interval + }; + }, + /** * 生成最终图形数据 */ - _getBarItem : function (seriesIndex, dataIndex, name, x, y, width, height, orient) { + _getBarItem: function (seriesIndex, dataIndex, name, x, y, width, height, orient) { var series = this.series; var barShape; var serie = series[seriesIndex]; var data = serie.data[dataIndex]; // 多级控制 - var defaultColor = this._sIndex2colorMap[seriesIndex]; + var defaultColor = this._sIndex2ColorMap[seriesIndex]; var queryTarget = [data, serie]; - var normalColor = this.deepQuery( - queryTarget, - 'itemStyle.normal.color' - ) || defaultColor; - var emphasisColor = this.deepQuery( - queryTarget, - 'itemStyle.emphasis.color' - ); - var normal = this.deepMerge( - queryTarget, - 'itemStyle.normal' - ); - var normalBorderWidth = normal.borderWidth; - var emphasis = this.deepMerge( - queryTarget, - 'itemStyle.emphasis' - ); + + var normal = this.deepMerge(queryTarget, 'itemStyle.normal'); + var emphasis = this.deepMerge(queryTarget, 'itemStyle.emphasis'); + var normalBorderWidth = normal.barBorderWidth; + barShape = { - zlevel : this._zlevelBase, - clickable: true, - style : { - x : x, - y : y, - width : width, - height : height, - brushType : 'both', - color : this.getItemStyleColor(normalColor, seriesIndex, dataIndex, data), - radius : normal.borderRadius, - lineWidth : normalBorderWidth, - strokeColor : normal.borderColor + zlevel: this.getZlevelBase(), + z: this.getZBase(), + clickable: this.deepQuery(queryTarget, 'clickable'), + style: { + x: x, + y: y, + width: width, + height: height, + brushType: 'both', + color: this.getItemStyleColor( + this.deepQuery(queryTarget, 'itemStyle.normal.color') || defaultColor, + seriesIndex, dataIndex, data + ), + radius: normal.barBorderRadius, + lineWidth: normalBorderWidth, + strokeColor: normal.barBorderColor }, - highlightStyle : { - color : this.getItemStyleColor(emphasisColor, seriesIndex, dataIndex, data), - radius : emphasis.borderRadius, - lineWidth : emphasis.borderWidth, - strokeColor : emphasis.borderColor + highlightStyle: { + color: this.getItemStyleColor( + this.deepQuery(queryTarget, 'itemStyle.emphasis.color'), + seriesIndex, dataIndex, data + ), + radius: emphasis.barBorderRadius, + lineWidth: emphasis.barBorderWidth, + strokeColor: emphasis.barBorderColor }, - _orient : orient + _orient: orient }; + var barShapeStyle = barShape.style; barShape.highlightStyle.color = barShape.highlightStyle.color - || (typeof barShape.style.color == 'string' - ? zrColor.lift(barShape.style.color, -0.3) - : barShape.style.color + || (typeof barShapeStyle.color === 'string' + ? zrColor.lift(barShapeStyle.color, -0.3) + : barShapeStyle.color ); + //亚像素优化 + barShapeStyle.x = Math.floor(barShapeStyle.x); + barShapeStyle.y = Math.floor(barShapeStyle.y); + barShapeStyle.height = Math.ceil(barShapeStyle.height); + barShapeStyle.width = Math.ceil(barShapeStyle.width); // 考虑线宽的显示优化 if (normalBorderWidth > 0 - && barShape.style.height > normalBorderWidth - && barShape.style.width > normalBorderWidth + && barShapeStyle.height > normalBorderWidth + && barShapeStyle.width > normalBorderWidth ) { - barShape.style.y += normalBorderWidth / 2; - barShape.style.height -= normalBorderWidth; - barShape.style.x += normalBorderWidth / 2; - barShape.style.width -= normalBorderWidth; + barShapeStyle.y += normalBorderWidth / 2; + barShapeStyle.height -= normalBorderWidth; + barShapeStyle.x += normalBorderWidth / 2; + barShapeStyle.width -= normalBorderWidth; } else { // 太小了或者线宽小于0,废了边线 - barShape.style.brushType = 'fill'; + barShapeStyle.brushType = 'fill'; } barShape.highlightStyle.textColor = barShape.highlightStyle.color; barShape = this.addLabel(barShape, serie, data, name, orient); - if (barShape.style.textPosition == 'insideLeft' - || barShape.style.textPosition == 'insideRight' - || barShape.style.textPosition == 'insideTop' - || barShape.style.textPosition == 'insideBottom' + var textPosition = barShapeStyle.textPosition; + if (textPosition === 'insideLeft' + || textPosition === 'insideRight' + || textPosition === 'insideTop' + || textPosition === 'insideBottom' ) { var gap = 5; - switch (barShape.style.textPosition) { - case 'insideLeft' : - barShape.style.textX = barShape.style.x + gap; - barShape.style.textY = barShape.style.y + barShape.style.height / 2; - barShape.style.textAlign = 'left'; - barShape.style.textBaseline = 'middle'; + switch (textPosition) { + case 'insideLeft': + barShapeStyle.textX = barShapeStyle.x + gap; + barShapeStyle.textY = barShapeStyle.y + barShapeStyle.height / 2; + barShapeStyle.textAlign = 'left'; + barShapeStyle.textBaseline = 'middle'; break; - case 'insideRight' : - barShape.style.textX = barShape.style.x + barShape.style.width - gap; - barShape.style.textY = barShape.style.y + barShape.style.height / 2; - barShape.style.textAlign = 'right'; - barShape.style.textBaseline = 'middle'; + case 'insideRight': + barShapeStyle.textX = barShapeStyle.x + barShapeStyle.width - gap; + barShapeStyle.textY = barShapeStyle.y + barShapeStyle.height / 2; + barShapeStyle.textAlign = 'right'; + barShapeStyle.textBaseline = 'middle'; break; - case 'insideTop' : - barShape.style.textX = barShape.style.x + barShape.style.width / 2; - barShape.style.textY = barShape.style.y + gap / 2; - barShape.style.textAlign = 'center'; - barShape.style.textBaseline = 'top'; + case 'insideTop': + barShapeStyle.textX = barShapeStyle.x + barShapeStyle.width / 2; + barShapeStyle.textY = barShapeStyle.y + gap / 2; + barShapeStyle.textAlign = 'center'; + barShapeStyle.textBaseline = 'top'; break; - case 'insideBottom' : - barShape.style.textX = barShape.style.x + barShape.style.width / 2; - barShape.style.textY = barShape.style.y + barShape.style.height - gap / 2; - barShape.style.textAlign = 'center'; - barShape.style.textBaseline = 'bottom'; + case 'insideBottom': + barShapeStyle.textX = barShapeStyle.x + barShapeStyle.width / 2; + barShapeStyle.textY = barShapeStyle.y + barShapeStyle.height - gap / 2; + barShapeStyle.textAlign = 'center'; + barShapeStyle.textBaseline = 'bottom'; break; } - barShape.style.textPosition = 'specific'; - barShape.style.textColor = barShape.style.textColor || '#fff'; + barShapeStyle.textPosition = 'specific'; + barShapeStyle.textColor = barShapeStyle.textColor || '#fff'; } - - if (this.deepQuery([data, serie, this.option],'calculable')) { this.setCalculable(barShape); @@ -899,7 +793,7 @@ define(function (require) { }, // 位置转换 - getMarkCoord : function (seriesIndex, mpData) { + getMarkCoord: function (seriesIndex, mpData) { var serie = this.series[seriesIndex]; var xMarkMap = this.xMarkMap[seriesIndex]; var xAxis = this.component.xAxis.getAxis(serie.xAxisIndex); @@ -907,24 +801,28 @@ define(function (require) { var dataIndex; var pos; if (mpData.type - && (mpData.type == 'max' || mpData.type == 'min' || mpData.type == 'average') + && (mpData.type === 'max' || mpData.type === 'min' || mpData.type === 'average') ) { // 特殊值内置支持 + var valueIndex = mpData.valueIndex != null + ? mpData.valueIndex + : xMarkMap.maxX0 != null + ? '1' : ''; pos = [ - xMarkMap[mpData.type + 'X'], - xMarkMap[mpData.type + 'Y'], - xMarkMap[mpData.type + 'Line'], - xMarkMap[mpData.type] + xMarkMap[mpData.type + 'X' + valueIndex], + xMarkMap[mpData.type + 'Y' + valueIndex], + xMarkMap[mpData.type + 'Line' + valueIndex], + xMarkMap[mpData.type + valueIndex] ]; } else if (xMarkMap.isHorizontal) { // 横向 - dataIndex = typeof mpData.xAxis == 'string' && xAxis.getIndexByName + dataIndex = typeof mpData.xAxis === 'string' && xAxis.getIndexByName ? xAxis.getIndexByName(mpData.xAxis) : (mpData.xAxis || 0); var x = xMarkMap[dataIndex]; - x = typeof x != 'undefined' + x = x != null ? x : typeof mpData.xAxis != 'string' && xAxis.getCoordByIndex ? xAxis.getCoordByIndex(mpData.xAxis || 0) @@ -934,12 +832,12 @@ define(function (require) { } else { // 纵向 - dataIndex = typeof mpData.yAxis == 'string' && yAxis.getIndexByName + dataIndex = typeof mpData.yAxis === 'string' && yAxis.getIndexByName ? yAxis.getIndexByName(mpData.yAxis) : (mpData.yAxis || 0); var y = xMarkMap[dataIndex]; - y = typeof y != 'undefined' + y = y != null ? y : typeof mpData.yAxis != 'string' && yAxis.getCoordByIndex ? yAxis.getCoordByIndex(mpData.yAxis || 0) @@ -954,7 +852,7 @@ define(function (require) { /** * 刷新 */ - refresh : function (newOption) { + refresh: function (newOption) { if (newOption) { this.option = newOption; this.series = newOption.series; @@ -967,7 +865,7 @@ define(function (require) { /** * 动态数据增加动画 */ - addDataAnimation : function (params) { + addDataAnimation: function (params) { var series = this.series; var aniMap = {}; // seriesIndex索引参数 for (var i = 0, l = params.length; i < l; i++) { @@ -984,13 +882,11 @@ define(function (require) { seriesIndex = ecData.get(this.shapeList[i], 'seriesIndex'); if (aniMap[seriesIndex] && !aniMap[seriesIndex][3]) { // 有数据删除才有移动的动画 - if (this.shapeList[i].type == 'rectangle') { + if (this.shapeList[i].type === 'rectangle') { // 主动画 dataIndex = ecData.get(this.shapeList[i], 'dataIndex'); serie = series[seriesIndex]; - if (aniMap[seriesIndex][2] - && dataIndex == serie.data.length - 1 - ) { + if (aniMap[seriesIndex][2] && dataIndex === serie.data.length - 1) { // 队头加入删除末尾 this.zr.delShape(this.shapeList[i].id); continue; @@ -1000,27 +896,23 @@ define(function (require) { this.zr.delShape(this.shapeList[i].id); continue; } - if (this.shapeList[i]._orient == 'horizontal') { + if (this.shapeList[i]._orient === 'horizontal') { // 条形图 - dy = this.component.yAxis.getAxis( - serie.yAxisIndex || 0 - ).getGap(); + dy = this.component.yAxis.getAxis(serie.yAxisIndex || 0).getGap(); y = aniMap[seriesIndex][2] ? -dy : dy; x = 0; } else { // 柱形图 - dx = this.component.xAxis.getAxis( - serie.xAxisIndex || 0 - ).getGap(); + dx = this.component.xAxis.getAxis(serie.xAxisIndex || 0).getGap(); x = aniMap[seriesIndex][2] ? dx : -dx; y = 0; } this.shapeList[i].position = [0, 0]; this.zr.animate(this.shapeList[i].id, '') .when( - 500, - {position : [x, y]} + this.query(this.option, 'animationDurationUpdate'), + { position: [x, y] } ) .start(); } @@ -1030,7 +922,6 @@ define(function (require) { }; zrUtil.inherits(Bar, ChartBase); - zrUtil.inherits(Bar, ComponentBase); // 图表注册 require('../chart').define('bar', Bar); diff --git a/amd/chart/base.js b/amd/chart/base.js index b1a3a36..270e709 100644 --- a/amd/chart/base.js +++ b/amd/chart/base.js @@ -2,7 +2,7 @@ * echarts图表基类 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ define(function (require) { @@ -17,19 +17,24 @@ define(function (require) { var ecAnimation = require('../util/ecAnimation'); var ecEffect = require('../util/ecEffect'); var accMath = require('../util/accMath'); + var ComponentBase = require('../component/base'); + var zrUtil = require('../zrender/tool/util'); var zrArea = require('../zrender/tool/area'); - function Base(){ + function Base(ecTheme, messageCenter, zr, option, myChart) { + + ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); + var self = this; this.selectedMap = {}; this.lastShapeList = []; this.shapeHandler = { - onclick : function () { + onclick: function () { self.isClick = true; }, - ondragover : function (param) { + ondragover: function (param) { // 返回触发可计算特性的图形提示 var calculableShape = param.target; calculableShape.highlightStyle = calculableShape.highlightStyle || {}; @@ -41,29 +46,30 @@ define(function (require) { var lineWidth = highlightStyle.lineWidth; highlightStyle.brushType = 'stroke'; - highlightStyle.strokeColor = self.ecTheme.calculableColor; - highlightStyle.lineWidth = calculableShape.type == 'icon' ? 30 : 10; + highlightStyle.strokeColor = self.ecTheme.calculableColor + || ecConfig.calculableColor; + highlightStyle.lineWidth = calculableShape.type === 'icon' ? 30 : 10; self.zr.addHoverShape(calculableShape); setTimeout(function (){ // 复位 - if (calculableShape.highlightStyle) { - calculableShape.highlightStyle.brushType = brushType; - calculableShape.highlightStyle.strokeColor = strokeColor; - calculableShape.highlightStyle.lineWidth = lineWidth; + if (highlightStyle) { + highlightStyle.brushType = brushType; + highlightStyle.strokeColor = strokeColor; + highlightStyle.lineWidth = lineWidth; } },20); }, - ondrop : function (param) { + ondrop: function (param) { // 排除一些非数据的拖拽进入 - if (typeof ecData.get(param.dragged, 'data') != 'undefined') { + if (ecData.get(param.dragged, 'data') != null) { self.isDrop = true; } }, - ondragend : function () { + ondragend: function () { self.isDragend = true; } }; @@ -76,8 +82,8 @@ define(function (require) { /** * 图形拖拽特性 */ - setCalculable : function (shape) { - shape.dragEnableTime = this.ecTheme.DRAG_ENABLE_TIME; + setCalculable: function (shape) { + shape.dragEnableTime = this.ecTheme.DRAG_ENABLE_TIME || ecConfig.DRAG_ENABLE_TIME; shape.ondragover = this.shapeHandler.ondragover; shape.ondragend = this.shapeHandler.ondragend; shape.ondrop = this.shapeHandler.ondrop; @@ -87,9 +93,9 @@ define(function (require) { /** * 数据项被拖拽进来 */ - ondrop : function (param, status) { - if (!this.isDrop || !param.target) { - // 没有在当前实例上发生拖拽行为则直接返回 + ondrop: function (param, status) { + if (!this.isDrop || !param.target || status.dragIn) { + // 没有在当前实例上发生拖拽行为或者已经被认领了则直接返回 return; } var target = param.target; // 拖拽安放目标 @@ -101,22 +107,29 @@ define(function (require) { var series = this.series; var data; var legend = this.component.legend; - if (dataIndex == -1) { + if (dataIndex === -1) { // 落到calculableCase上,数据被拖拽进某个饼图|雷达|漏斗,增加数据 + if (ecData.get(dragged, 'seriesIndex') == seriesIndex) { + // 自己拖拽到自己 + status.dragOut = status.dragIn = status.needRefresh = true; + this.isDrop = false; + return; + } + data = { - value : ecData.get(dragged, 'value'), - name : ecData.get(dragged, 'name') + value: ecData.get(dragged, 'value'), + name: ecData.get(dragged, 'name') }; // 修饼图数值不为负值 - if (this.type == ecConfig.CHART_TYPE_PIE && data.value < 0) { + if (this.type === ecConfig.CHART_TYPE_PIE && data.value < 0) { data.value = 0; } var hasFind = false; var sData = series[seriesIndex].data; for (var i = 0, l = sData.length; i < l; i++) { - if (sData[i].name == data.name && sData[i].value == '-') { + if (sData[i].name === data.name && sData[i].value === '-') { series[seriesIndex].data[i].value = data.value; hasFind = true; } @@ -130,24 +143,24 @@ define(function (require) { } else { // 落到数据item上,数据被拖拽到某个数据项上,数据修改 - data = this.option.series[seriesIndex].data[dataIndex] || '-'; - if (typeof data.value != 'undefined') { + data = series[seriesIndex].data[dataIndex] || '-'; + if (data.value != null) { if (data.value != '-') { - this.option.series[seriesIndex].data[dataIndex].value = + series[seriesIndex].data[dataIndex].value = accMath.accAdd( - this.option.series[seriesIndex].data[dataIndex].value, + series[seriesIndex].data[dataIndex].value, ecData.get(dragged, 'value') ); } else { - this.option.series[seriesIndex].data[dataIndex].value = + series[seriesIndex].data[dataIndex].value = ecData.get(dragged, 'value'); } - if (this.type == ecConfig.CHART_TYPE_FUNNEL - || this.type == ecConfig.CHART_TYPE_PIE + if (this.type === ecConfig.CHART_TYPE_FUNNEL + || this.type === ecConfig.CHART_TYPE_PIE ) { - legend && legend.getRelatedAmount(data.name) == 1 + legend && legend.getRelatedAmount(data.name) === 1 && this.component.legend.del(data.name); data.name += this.option.nameConnector + ecData.get(dragged, 'name'); legend && legend.add( @@ -158,14 +171,14 @@ define(function (require) { } else { if (data != '-') { - this.option.series[seriesIndex].data[dataIndex] = + series[seriesIndex].data[dataIndex] = accMath.accAdd( - this.option.series[seriesIndex].data[dataIndex], + series[seriesIndex].data[dataIndex], ecData.get(dragged, 'value') ); } else { - this.option.series[seriesIndex].data[dataIndex] = + series[seriesIndex].data[dataIndex] = ecData.get(dragged, 'value'); } } @@ -188,9 +201,9 @@ define(function (require) { /** * 数据项被拖拽出去 */ - ondragend : function (param, status) { - if (!this.isDragend || !param.target) { - // 没有在当前实例上发生拖拽行为则直接返回 + ondragend: function (param, status) { + if (!this.isDragend || !param.target || status.dragOut) { + // 没有在当前实例上发生拖拽行为或者已经被认领了则直接返回 return; } var target = param.target; // 被拖拽图形元素 @@ -201,14 +214,13 @@ define(function (require) { var series = this.series; // 删除被拖拽走的数据 - if (typeof series[seriesIndex].data[dataIndex].value != 'undefined') { + if (series[seriesIndex].data[dataIndex].value != null) { series[seriesIndex].data[dataIndex].value = '-'; // 清理可能有且唯一的legend data var name = series[seriesIndex].data[dataIndex].name; - if (this.component.legend - && this.component.legend.getRelatedAmount(name) === 0 - ) { - this.component.legend.del(name); + var legend = this.component.legend; + if (legend && legend.getRelatedAmount(name) === 0) { + legend.del(name); } } else { @@ -228,7 +240,7 @@ define(function (require) { /** * 图例选择 */ - onlegendSelected : function (param, status) { + onlegendSelected: function (param, status) { var legendSelected = param.selected; for (var itemName in this.selectedMap) { if (this.selectedMap[itemName] != legendSelected[itemName]) { @@ -240,10 +252,256 @@ define(function (require) { return; }, + /** + * 折线图、柱形图公用方法 + */ + _buildPosition: function() { + this._symbol = this.option.symbolList; + this._sIndex2ShapeMap = {}; // series拐点图形类型,seriesIndex索引到shape type + this._sIndex2ColorMap = {}; // series默认颜色索引,seriesIndex索引到color + + this.selectedMap = {}; + this.xMarkMap = {}; + + var series = this.series; + // 水平垂直双向series索引 ,position索引到seriesIndex + var _position2sIndexMap = { + top: [], + bottom: [], + left: [], + right: [], + other: [] + }; + var xAxisIndex; + var yAxisIndex; + var xAxis; + var yAxis; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type === this.type) { + series[i] = this.reformOption(series[i]); + this.legendHoverLink = series[i].legendHoverLink || this.legendHoverLink; + xAxisIndex = series[i].xAxisIndex; + yAxisIndex = series[i].yAxisIndex; + xAxis = this.component.xAxis.getAxis(xAxisIndex); + yAxis = this.component.yAxis.getAxis(yAxisIndex); + if (xAxis.type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY) { + _position2sIndexMap[xAxis.getPosition()].push(i); + } + else if (yAxis.type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY) { + _position2sIndexMap[yAxis.getPosition()].push(i); + } + else { + _position2sIndexMap.other.push(i); + } + } + } + // console.log(_position2sIndexMap); + for (var position in _position2sIndexMap) { + if (_position2sIndexMap[position].length > 0) { + this._buildSinglePosition( + position, _position2sIndexMap[position] + ); + } + } + + this.addShapeList(); + }, + + /** + * 构建单个方向上的折线图、柱形图公用方法 + * + * @param {number} seriesIndex 系列索引 + */ + _buildSinglePosition: function (position, seriesArray) { + var mapData = this._mapData(seriesArray); + var locationMap = mapData.locationMap; + var maxDataLength = mapData.maxDataLength; + + if (maxDataLength === 0 || locationMap.length === 0) { + return; + } + switch (position) { + case 'bottom' : + case 'top' : + this._buildHorizontal(seriesArray, maxDataLength, locationMap, this.xMarkMap); + break; + case 'left' : + case 'right' : + this._buildVertical(seriesArray, maxDataLength, locationMap, this.xMarkMap); + break; + case 'other' : + this._buildOther(seriesArray, maxDataLength, locationMap, this.xMarkMap); + break; + } + + for (var i = 0, l = seriesArray.length; i < l; i++) { + this.buildMark(seriesArray[i]); + } + }, + + /** + * 数据整形,折线图、柱形图公用方法 + * 数组位置映射到系列索引 + */ + _mapData: function (seriesArray) { + var series = this.series; + var serie; // 临时映射变量 + var dataIndex = 0; // 堆积数据所在位置映射 + var stackMap = {}; // 堆积数据位置映射,堆积组在二维中的第几项 + var magicStackKey = '__kener__stack__'; // 堆积命名,非堆积数据安单一堆积处理 + var stackKey; // 临时映射变量 + var serieName; // 临时映射变量 + var legend = this.component.legend; + var locationMap = []; // 需要返回的东西:数组位置映射到系列索引 + var maxDataLength = 0; // 需要返回的东西:最大数据长度 + var iconShape; + // 计算需要显示的个数和分配位置并记在下面这个结构里 + for (var i = 0, l = seriesArray.length; i < l; i++) { + serie = series[seriesArray[i]]; + serieName = serie.name; + + this._sIndex2ShapeMap[seriesArray[i]] = this._sIndex2ShapeMap[seriesArray[i]] + || this.query(serie,'symbol') + || this._symbol[i % this._symbol.length]; + + if (legend){ + this.selectedMap[serieName] = legend.isSelected(serieName); + + this._sIndex2ColorMap[seriesArray[i]] = legend.getColor(serieName); + + iconShape = legend.getItemShape(serieName); + if (iconShape) { + // 回调legend,换一个更形象的icon + var style = iconShape.style; + if (this.type == ecConfig.CHART_TYPE_LINE) { + style.iconType = 'legendLineIcon'; + style.symbol = this._sIndex2ShapeMap[seriesArray[i]]; + } + else if (serie.itemStyle.normal.barBorderWidth > 0) { + var highlightStyle = iconShape.highlightStyle; + style.brushType = 'both'; + style.x += 1; + style.y += 1; + style.width -= 2; + style.height -= 2; + style.strokeColor + = highlightStyle.strokeColor + = serie.itemStyle.normal.barBorderColor; + highlightStyle.lineWidth = 3; + } + + legend.setItemShape(serieName, iconShape); + } + } + else { + this.selectedMap[serieName] = true; + this._sIndex2ColorMap[seriesArray[i]] = this.zr.getColor(seriesArray[i]); + } + + if (this.selectedMap[serieName]) { + stackKey = serie.stack || (magicStackKey + seriesArray[i]); + if (stackMap[stackKey] == null) { + stackMap[stackKey] = dataIndex; + locationMap[dataIndex] = [seriesArray[i]]; + dataIndex++; + } + else { + // 已经分配了位置就推进去就行 + locationMap[stackMap[stackKey]].push(seriesArray[i]); + } + } + // 兼职帮算一下最大长度 + maxDataLength = Math.max(maxDataLength, serie.data.length); + } + /* 调试输出 + var s = ''; + for (var i = 0, l = maxDataLength; i < l; i++) { + s = '['; + for (var j = 0, k = locationMap.length; j < k; j++) { + s +='[' + for (var m = 0, n = locationMap[j].length - 1; m < n; m++) { + s += series[locationMap[j][m]].data[i] + ',' + } + s += series[locationMap[j][locationMap[j].length - 1]] + .data[i]; + s += ']' + } + s += ']'; + console.log(s); + } + console.log(locationMap) + */ + + return { + locationMap: locationMap, + maxDataLength: maxDataLength + }; + }, + + _calculMarkMapXY : function(xMarkMap, locationMap, xy) { + var series = this.series; + for (var j = 0, k = locationMap.length; j < k; j++) { + for (var m = 0, n = locationMap[j].length; m < n; m++) { + var seriesIndex = locationMap[j][m]; + var valueIndex = xy == 'xy' ? 0 : ''; + var grid = this.component.grid; + var tarMark = xMarkMap[seriesIndex]; + + if (xy.indexOf('x') != '-1') { + if (tarMark['counter' + valueIndex] > 0) { + tarMark['average' + valueIndex] = + tarMark['sum' + valueIndex] / tarMark['counter' + valueIndex]; + } + + var x = this.component.xAxis.getAxis(series[seriesIndex].xAxisIndex || 0) + .getCoord(tarMark['average' + valueIndex]); + tarMark['averageLine' + valueIndex] = [ + [x, grid.getYend()], + [x, grid.getY()] + ]; + tarMark['minLine' + valueIndex] = [ + [tarMark['minX' + valueIndex], grid.getYend()], + [tarMark['minX' + valueIndex], grid.getY()] + ]; + tarMark['maxLine' + valueIndex] = [ + [tarMark['maxX' + valueIndex], grid.getYend()], + [tarMark['maxX' + valueIndex], grid.getY()] + ]; + + tarMark.isHorizontal = false; + } + + valueIndex = xy == 'xy' ? 1 : ''; + if (xy.indexOf('y') != '-1') { + if (tarMark['counter' + valueIndex] > 0) { + tarMark['average' + valueIndex] = + tarMark['sum' + valueIndex] / tarMark['counter' + valueIndex]; + } + var y = this.component.yAxis.getAxis(series[seriesIndex].yAxisIndex || 0) + .getCoord(tarMark['average' + valueIndex]); + tarMark['averageLine' + valueIndex] = [ + [grid.getX(), y], + [grid.getXend(), y] + ]; + tarMark['minLine' + valueIndex] = [ + [grid.getX(), tarMark['minY' + valueIndex]], + [grid.getXend(), tarMark['minY' + valueIndex]] + ]; + tarMark['maxLine' + valueIndex] = [ + [grid.getX(), tarMark['maxY' + valueIndex]], + [grid.getXend(), tarMark['maxY' + valueIndex]] + ]; + + tarMark.isHorizontal = true; + } + } + } + }, + /** * 添加文本 */ - addLabel : function (tarShape, serie, data, name, orient) { + addLabel: function (tarShape, serie, data, name, orient) { // 多级控制 var queryTarget = [data, serie]; var nLabel = this.deepMerge(queryTarget, 'itemStyle.normal.label'); @@ -253,26 +511,32 @@ define(function (require) { var eTextStyle = eLabel.textStyle || {}; if (nLabel.show) { - tarShape.style.text = this._getLabelText( + var style = tarShape.style; + style.text = this._getLabelText( serie, data, name, 'normal' ); - tarShape.style.textPosition = typeof nLabel.position == 'undefined' - ? (orient == 'horizontal' ? 'right' : 'top') - : nLabel.position; - tarShape.style.textColor = nTextStyle.color; - tarShape.style.textFont = this.getFont(nTextStyle); + style.textPosition = nLabel.position == null + ? (orient === 'horizontal' ? 'right' : 'top') + : nLabel.position; + style.textColor = nTextStyle.color; + style.textFont = this.getFont(nTextStyle); + style.textAlign = nTextStyle.align; + style.textBaseline = nTextStyle.baseline; } if (eLabel.show) { - tarShape.highlightStyle.text = this._getLabelText( + var highlightStyle = tarShape.highlightStyle; + highlightStyle.text = this._getLabelText( serie, data, name, 'emphasis' ); - tarShape.highlightStyle.textPosition = nLabel.show - ? tarShape.style.textPosition - : (typeof eLabel.position == 'undefined' - ? (orient == 'horizontal' ? 'right' : 'top') - : eLabel.position); - tarShape.highlightStyle.textColor = eTextStyle.color; - tarShape.highlightStyle.textFont = this.getFont(eTextStyle); + highlightStyle.textPosition = nLabel.show + ? tarShape.style.textPosition + : (eLabel.position == null + ? (orient === 'horizontal' ? 'right' : 'top') + : eLabel.position); + highlightStyle.textColor = eTextStyle.color; + highlightStyle.textFont = this.getFont(eTextStyle); + highlightStyle.textAlign = eTextStyle.align; + highlightStyle.textBaseline = eTextStyle.baseline; } return tarShape; @@ -281,12 +545,12 @@ define(function (require) { /** * 根据lable.format计算label text */ - _getLabelText : function (serie, data, name, status) { + _getLabelText: function (serie, data, name, status) { var formatter = this.deepQuery( [data, serie], 'itemStyle.' + status + '.label.formatter' ); - if (!formatter && status == 'emphasis') { + if (!formatter && status === 'emphasis') { // emphasis时需要看看normal下是否有formatter formatter = this.deepQuery( [data, serie], @@ -294,72 +558,77 @@ define(function (require) { ); } - var value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; + var value = this.getDataFromOption(data, '-'); if (formatter) { - if (typeof formatter == 'function') { + if (typeof formatter === 'function') { return formatter.call( this.myChart, - serie.name, - name, - value + { + seriesName: serie.name, + series: serie, + name: name, + value: value, + data: data, + status: status + } ); } - else if (typeof formatter == 'string') { + else if (typeof formatter === 'string') { formatter = formatter.replace('{a}','{a0}') .replace('{b}','{b0}') - .replace('{c}','{c0}'); - formatter = formatter.replace('{a0}', serie.name) + .replace('{c}','{c0}') + .replace('{a0}', serie.name) .replace('{b0}', name) - .replace('{c0}', value); + .replace('{c0}', this.numAddCommas(value)); return formatter; } } else { - return value; + if (value instanceof Array) { + return value[2] != null + ? this.numAddCommas(value[2]) + : (value[0] + ' , ' + value[1]); + } + else { + return this.numAddCommas(value); + } } }, /** * 标线标注 */ - buildMark : function (seriesIndex) { + buildMark: function (seriesIndex) { var serie = this.series[seriesIndex]; if (this.selectedMap[serie.name]) { - serie.markPoint && this._buildMarkPoint(seriesIndex); serie.markLine && this._buildMarkLine(seriesIndex); + serie.markPoint && this._buildMarkPoint(seriesIndex); } }, /** * 标注逻辑 */ - _buildMarkPoint : function (seriesIndex) { + _buildMarkPoint: function (seriesIndex) { var attachStyle = (this.markAttachStyle || {})[seriesIndex]; var serie = this.series[seriesIndex]; - var _zlevelBase = this.getZlevelBase(); var mpData; var pos; var markPoint = zrUtil.clone(serie.markPoint); for (var i = 0, l = markPoint.data.length; i < l; i++) { mpData = markPoint.data[i]; pos = this.getMarkCoord(seriesIndex, mpData); - markPoint.data[i].x = typeof mpData.x != 'undefined' - ? mpData.x : pos[0]; - markPoint.data[i].y = typeof mpData.y != 'undefined' - ? mpData.y : pos[1]; + mpData.x = mpData.x != null ? mpData.x : pos[0]; + mpData.y = mpData.y != null ? mpData.y : pos[1]; if (mpData.type - && (mpData.type == 'max' || mpData.type == 'min') + && (mpData.type === 'max' || mpData.type === 'min') ) { // 特殊值内置支持 - markPoint.data[i].value = pos[3]; - markPoint.data[i].name = mpData.name || mpData.type; - markPoint.data[i].symbolSize = markPoint.data[i].symbolSize + mpData.value = pos[3]; + mpData.name = mpData.name || mpData.type; + mpData.symbolSize = mpData.symbolSize || (zrArea.getTextWidth(pos[3], this.getFont()) / 2 + 5); } } @@ -367,15 +636,17 @@ define(function (require) { var shapeList = this._markPoint(seriesIndex, markPoint); for (var i = 0, l = shapeList.length; i < l; i++) { - shapeList[i].zlevel = _zlevelBase + 1; + var tarShape = shapeList[i]; + tarShape.zlevel = this.getZlevelBase(); + tarShape.z = this.getZBase() + 1; for (var key in attachStyle) { - shapeList[i][key] = zrUtil.clone(attachStyle[key]); + tarShape[key] = zrUtil.clone(attachStyle[key]); } - this.shapeList.push(shapeList[i]); + this.shapeList.push(tarShape); } // 个别特殊图表需要自己addShape - if (this.type == ecConfig.CHART_TYPE_FORCE - || this.type == ecConfig.CHART_TYPE_CHORD + if (this.type === ecConfig.CHART_TYPE_FORCE + || this.type === ecConfig.CHART_TYPE_CHORD ) { for (var i = 0, l = shapeList.length; i < l; i++) { this.zr.addShape(shapeList[i]); @@ -386,23 +657,30 @@ define(function (require) { /** * 标线逻辑 */ - _buildMarkLine : function (seriesIndex) { + _buildMarkLine: function (seriesIndex) { var attachStyle = (this.markAttachStyle || {})[seriesIndex]; var serie = this.series[seriesIndex]; - var _zlevelBase = this.getZlevelBase(); - var mlData; var pos; var markLine = zrUtil.clone(serie.markLine); for (var i = 0, l = markLine.data.length; i < l; i++) { - mlData = markLine.data[i]; + var mlData = markLine.data[i]; if (mlData.type - && (mlData.type == 'max' || mlData.type == 'min' || mlData.type == 'average') + && (mlData.type === 'max' || mlData.type === 'min' || mlData.type === 'average') ) { // 特殊值内置支持 pos = this.getMarkCoord(seriesIndex, mlData); markLine.data[i] = [zrUtil.clone(mlData), {}]; markLine.data[i][0].name = mlData.name || mlData.type; - markLine.data[i][0].value = pos[3]; + markLine.data[i][0].value = mlData.type !== 'average' + ? pos[3] + : +pos[3].toFixed( + markLine.precision != null + ? markLine.precision + : this.deepQuery( + [this.ecTheme, ecConfig], + 'markLine.precision' + ) + ); pos = pos[2]; mlData = [{},{}]; } @@ -412,29 +690,30 @@ define(function (require) { this.getMarkCoord(seriesIndex, mlData[1]) ]; } - - markLine.data[i][0].x = typeof mlData[0].x != 'undefined' - ? mlData[0].x : pos[0][0]; - markLine.data[i][0].y = typeof mlData[0].y != 'undefined' - ? mlData[0].y : pos[0][1]; - markLine.data[i][1].x = typeof mlData[1].x != 'undefined' - ? mlData[1].x : pos[1][0]; - markLine.data[i][1].y = typeof mlData[1].y != 'undefined' - ? mlData[1].y : pos[1][1]; + if (pos == null || pos[0] == null || pos[1] == null) { + // 不在显示区域内 + continue; + } + markLine.data[i][0].x = mlData[0].x != null ? mlData[0].x : pos[0][0]; + markLine.data[i][0].y = mlData[0].y != null ? mlData[0].y : pos[0][1]; + markLine.data[i][1].x = mlData[1].x != null ? mlData[1].x : pos[1][0]; + markLine.data[i][1].y = mlData[1].y != null ? mlData[1].y : pos[1][1]; } var shapeList = this._markLine(seriesIndex, markLine); for (var i = 0, l = shapeList.length; i < l; i++) { - shapeList[i].zlevel = _zlevelBase + 1; + var tarShape = shapeList[i]; + tarShape.zlevel = this.getZlevelBase(); + tarShape.z = this.getZBase() + 1; for (var key in attachStyle) { - shapeList[i][key] = zrUtil.clone(attachStyle[key]); + tarShape[key] = zrUtil.clone(attachStyle[key]); } - this.shapeList.push(shapeList[i]); + this.shapeList.push(tarShape); } // 个别特殊图表需要自己addShape - if (this.type == ecConfig.CHART_TYPE_FORCE - || this.type == ecConfig.CHART_TYPE_CHORD + if (this.type === ecConfig.CHART_TYPE_FORCE + || this.type === ecConfig.CHART_TYPE_CHORD ) { for (var i = 0, l = shapeList.length; i < l; i++) { this.zr.addShape(shapeList[i]); @@ -445,13 +724,17 @@ define(function (require) { /** * 标注多级控制构造 */ - _markPoint : function (seriesIndex, mpOption) { + _markPoint: function (seriesIndex, mpOption) { var serie = this.series[seriesIndex]; var component = this.component; zrUtil.merge( - mpOption, - this.ecTheme.markPoint + zrUtil.merge( + mpOption, + zrUtil.clone(this.ecTheme.markPoint || {}) + ), + zrUtil.clone(ecConfig.markPoint) ); + mpOption.name = serie.name; var pList = []; @@ -471,9 +754,10 @@ define(function (require) { if (!mpOption.large) { for (var i = 0, l = data.length; i < l; i++) { - value = typeof data[i] != 'undefined' && typeof data[i].value != 'undefined' - ? data[i].value - : ''; + if (data[i].x == null || data[i].y == null) { + continue; + } + value = data[i].value != null ? data[i].value : ''; // 图例 if (legend) { color = legend.getColor(serie.name); @@ -483,23 +767,23 @@ define(function (require) { color = isNaN(value) ? color : dataRange.getColor(value); queryTarget = [data[i], mpOption]; - nColor = this.deepQuery( - queryTarget, 'itemStyle.normal.color' - ) || color; - eColor = this.deepQuery( - queryTarget, 'itemStyle.emphasis.color' - ) || nColor; + nColor = this.deepQuery(queryTarget, 'itemStyle.normal.color') + || color; + eColor = this.deepQuery(queryTarget, 'itemStyle.emphasis.color') + || nColor; // 有值域,并且值域返回null且用户没有自己定义颜色,则隐藏这个mark if (nColor == null && eColor == null) { continue; } } + color = color == null ? this.zr.getColor(seriesIndex) : color; + // 标准化一些参数 - data[i].tooltip = data[i].tooltip + data[i].tooltip = data[i].tooltip + || mpOption.tooltip || {trigger:'item'}; // tooltip.trigger指定为item - data[i].name = typeof data[i].name != 'undefined' - ? data[i].name : ''; + data[i].name = data[i].name != null ? data[i].name : ''; data[i].value = value; // 复用getSymbolShape @@ -522,7 +806,7 @@ define(function (require) { itemShape.effect = effect; } - if (serie.type == ecConfig.CHART_TYPE_MAP) { + if (serie.type === ecConfig.CHART_TYPE_MAP) { itemShape._geo = this.getMarkGeo(data[i]); } @@ -549,13 +833,17 @@ define(function (require) { /** * 标线多级控制构造 */ - _markLine : function (seriesIndex, mlOption) { + _markLine: function (seriesIndex, mlOption) { var serie = this.series[seriesIndex]; var component = this.component; zrUtil.merge( - mlOption, - this.ecTheme.markLine + zrUtil.merge( + mlOption, + zrUtil.clone(this.ecTheme.markLine || {}) + ), + zrUtil.clone(ecConfig.markLine) ); + // 标准化一些同时支持Array和String的参数 mlOption.symbol = mlOption.symbol instanceof Array ? mlOption.symbol.length > 1 @@ -591,26 +879,29 @@ define(function (require) { var zrHeight = this.zr.getHeight(); var mergeData; for (var i = 0, l = data.length; i < l; i++) { - // 图例 - if (legend) { - color = legend.getColor(serie.name); + var mlData = data[i]; + if (mlData[0].x == null + || mlData[0].y == null + || mlData[1].x == null + || mlData[1].y == null + ) { + continue; } + + color = legend ? legend.getColor(serie.name) : this.zr.getColor(seriesIndex); + // 组装一个mergeData - mergeData = this.deepMerge(data[i]); - value = typeof mergeData != 'undefined' && typeof mergeData.value != 'undefined' - ? mergeData.value - : ''; + mergeData = this.deepMerge(mlData); + value = mergeData.value != null ? mergeData.value : ''; // 值域 if (dataRange) { color = isNaN(value) ? color : dataRange.getColor(value); queryTarget = [mergeData, mlOption]; - nColor = this.deepQuery( - queryTarget, 'itemStyle.normal.color' - ) || color; - eColor = this.deepQuery( - queryTarget, 'itemStyle.emphasis.color' - ) || nColor; + nColor = this.deepQuery(queryTarget, 'itemStyle.normal.color') + || color; + eColor = this.deepQuery(queryTarget, 'itemStyle.emphasis.color') + || nColor; // 有值域,并且值域返回null且用户没有自己定义颜色,则隐藏这个mark if (nColor == null && eColor == null) { continue; @@ -618,24 +909,22 @@ define(function (require) { } // 标准化一些参数 - data[i][0].tooltip = mergeData.tooltip - || {trigger:'item'}; // tooltip.trigger指定为item - data[i][0].name = typeof data[i][0].name != 'undefined' - ? data[i][0].name : ''; - data[i][1].name = typeof data[i][1].name != 'undefined' - ? data[i][1].name : ''; - data[i][0].value = typeof data[i][0].value != 'undefined' - ? data[i][0].value : ''; + mlData[0].tooltip = mergeData.tooltip + || mlOption.tooltip + || {trigger:'item'}; // tooltip.trigger指定为item + mlData[0].name = mlData[0].name != null ? mlData[0].name : ''; + mlData[1].name = mlData[1].name != null ? mlData[1].name : ''; + mlData[0].value = value; itemShape = this.getLineMarkShape( mlOption, // markLine seriesIndex, - data[i], // 数据 + mlData, // 数据 i, - this.parsePercent(data[i][0].x, zrWidth), // 坐标 - this.parsePercent(data[i][0].y, zrHeight), // 坐标 - this.parsePercent(data[i][1].x, zrWidth), // 坐标 - this.parsePercent(data[i][1].y, zrHeight), // 坐标 + this.parsePercent(mlData[0].x, zrWidth), // 坐标 + this.parsePercent(mlData[0].y, zrHeight), // 坐标 + this.parsePercent(mlData[1].x, zrWidth), // 坐标 + this.parsePercent(mlData[1].y, zrHeight), // 坐标 color // 默认symbol和color ); itemShape._mark = 'line'; @@ -648,10 +937,10 @@ define(function (require) { itemShape.effect = effect; } - if (serie.type == ecConfig.CHART_TYPE_MAP) { + if (serie.type === ecConfig.CHART_TYPE_MAP) { itemShape._geo = [ - this.getMarkGeo(data[i][0]), - this.getMarkGeo(data[i][1]) + this.getMarkGeo(mlData[0]), + this.getMarkGeo(mlData[1]) ]; } @@ -659,10 +948,10 @@ define(function (require) { ecData.pack( itemShape, serie, seriesIndex, - data[i][0], i, - data[i][0].name + (data[i][1].name !== '' - ? (' > ' + data[i][1].name) - : ''), + mlData[0], i, + mlData[0].name + // 不要帮我代码规范 + + (mlData[1].name !== '' ? (' > ' + mlData[1].name) : ''), value ); pList.push(itemShape); @@ -671,7 +960,7 @@ define(function (require) { return pList; }, - getMarkCoord : function () { + getMarkCoord: function () { // 无转换位置 return [0, 0]; }, @@ -679,7 +968,7 @@ define(function (require) { /** * symbol构造器 */ - getSymbolShape : function ( + getSymbolShape: function ( serie, seriesIndex, // 系列 data, dataIndex, name, // 数据 x, y, // 坐标 @@ -688,15 +977,11 @@ define(function (require) { orient // 走向,用于默认文字定位 ) { var queryTarget = [data, serie]; - var value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; + var value = this.getDataFromOption(data, '-'); symbol = this.deepQuery(queryTarget, 'symbol') || symbol; var symbolSize = this.deepQuery(queryTarget, 'symbolSize'); - symbolSize = typeof symbolSize == 'function' + symbolSize = typeof symbolSize === 'function' ? symbolSize(value) : symbolSize; var symbolRotate = this.deepQuery(queryTarget, 'symbolRotate'); @@ -709,60 +994,59 @@ define(function (require) { queryTarget, 'itemStyle.emphasis' ); - var nBorderWidth = typeof normal.borderWidth != 'undefined' + var nBorderWidth = normal.borderWidth != null ? normal.borderWidth : (normal.lineStyle && normal.lineStyle.width); - if (typeof nBorderWidth == 'undefined') { + if (nBorderWidth == null) { nBorderWidth = symbol.match('empty') ? 2 : 0; } - var eBorderWidth = typeof emphasis.borderWidth != 'undefined' + var eBorderWidth = emphasis.borderWidth != null ? emphasis.borderWidth : (emphasis.lineStyle && emphasis.lineStyle.width); - if (typeof eBorderWidth == 'undefined') { + if (eBorderWidth == null) { eBorderWidth = nBorderWidth + 2; } var itemShape = new IconShape({ - style : { - iconType : symbol.replace('empty', '').toLowerCase(), - x : x - symbolSize, - y : y - symbolSize, - width : symbolSize * 2, - height : symbolSize * 2, - brushType : 'both', - color : symbol.match('empty') + style: { + iconType: symbol.replace('empty', '').toLowerCase(), + x: x - symbolSize, + y: y - symbolSize, + width: symbolSize * 2, + height: symbolSize * 2, + brushType: 'both', + color: symbol.match('empty') ? emptyColor : (this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) || color), - strokeColor : normal.borderColor + strokeColor: normal.borderColor || this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) || color, lineWidth: nBorderWidth }, - highlightStyle : { - color : symbol.match('empty') + highlightStyle: { + color: symbol.match('empty') ? emptyColor : this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data), - strokeColor : emphasis.borderColor + strokeColor: emphasis.borderColor || normal.borderColor || this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) || color, lineWidth: eBorderWidth }, - clickable : true + clickable: this.deepQuery(queryTarget, 'clickable') }); if (symbol.match('image')) { - itemShape.style.image = - symbol.replace(new RegExp('^image:\\/\\/'), ''); + itemShape.style.image = symbol.replace(new RegExp('^image:\\/\\/'), ''); itemShape = new ImageShape({ - style : itemShape.style, - highlightStyle : itemShape.highlightStyle, - clickable : true + style: itemShape.style, + highlightStyle: itemShape.highlightStyle, + clickable: this.deepQuery(queryTarget, 'clickable') }); } - if (typeof symbolRotate != 'undefined') { + if (symbolRotate != null) { itemShape.rotation = [ symbolRotate * Math.PI / 180, x, y ]; @@ -774,7 +1058,7 @@ define(function (require) { (symbol.replace('empty', '').replace('star','') - 0) || 5; } - if (symbol == 'none') { + if (symbol === 'none') { itemShape.invisible = true; itemShape.hoverable = false; } @@ -793,10 +1077,10 @@ define(function (require) { ); if (symbol.match('empty')) { - if (typeof itemShape.style.textColor == 'undefined') { + if (itemShape.style.textColor == null) { itemShape.style.textColor = itemShape.style.strokeColor; } - if (typeof itemShape.highlightStyle.textColor == 'undefined') { + if (itemShape.highlightStyle.textColor == null) { itemShape.highlightStyle.textColor = itemShape.highlightStyle.strokeColor; } @@ -821,7 +1105,7 @@ define(function (require) { /** * 标线构造器 */ - getLineMarkShape : function ( + getLineMarkShape: function ( mlOption, // 系列 seriesIndex, // 系列索引 data, // 数据 @@ -830,16 +1114,8 @@ define(function (require) { xEnd, yEnd, // 坐标 color // 默认color,来自legend或dataRange全局分配 ) { - var value0 = typeof data[0] != 'undefined' - ? (typeof data[0].value != 'undefined' - ? data[0].value - : data[0]) - : '-'; - var value1 = typeof data[1] != 'undefined' - ? (typeof data[1].value != 'undefined' - ? data[1].value - : data[1]) - : '-'; + var value0 = data[0].value != null ? data[0].value : '-'; + var value1 = data[1].value != null ? data[1].value : '-'; var symbol = [ this.query(data[0], 'symbol') || mlOption.symbol[0], this.query(data[1], 'symbol') || mlOption.symbol[1] @@ -848,10 +1124,10 @@ define(function (require) { this.query(data[0], 'symbolSize') || mlOption.symbolSize[0], this.query(data[1], 'symbolSize') || mlOption.symbolSize[1] ]; - symbolSize[0] = typeof symbolSize[0] == 'function' + symbolSize[0] = typeof symbolSize[0] === 'function' ? symbolSize[0](value0) : symbolSize[0]; - symbolSize[1] = typeof symbolSize[1] == 'function' + symbolSize[1] = typeof symbolSize[1] === 'function' ? symbolSize[1](value1) : symbolSize[1]; var symbolRotate = [ @@ -860,7 +1136,7 @@ define(function (require) { ]; //console.log(symbol, symbolSize, symbolRotate); - var queryTarget = [data[0], mlOption]; + var queryTarget = [data[0], data[1], mlOption]; var normal = this.deepMerge( queryTarget, 'itemStyle.normal' @@ -876,75 +1152,73 @@ define(function (require) { var elineStyle = emphasis.lineStyle; var nBorderWidth = nlineStyle.width; - if (typeof nBorderWidth == 'undefined') { + if (nBorderWidth == null) { nBorderWidth = normal.borderWidth; } var eBorderWidth = elineStyle.width; - if (typeof eBorderWidth == 'undefined') { - if (typeof emphasis.borderWidth != 'undefined') { - eBorderWidth = emphasis.borderWidth; - } - else { - eBorderWidth = nBorderWidth + 2; - } + if (eBorderWidth == null) { + eBorderWidth = emphasis.borderWidth != null + ? emphasis.borderWidth + : (nBorderWidth + 2); } var itemShape = new MarkLineShape({ - style : { - smooth : mlOption.smooth ? 'spline' : false, - symbol : symbol, - symbolSize : symbolSize, - symbolRotate : symbolRotate, - //data : [data[0].name,data[1].name], - xStart : xStart, - yStart : yStart, // 坐标 - xEnd : xEnd, - yEnd : yEnd, // 坐标 - brushType : 'both', - lineType : nlineStyle.type, - shadowColor : nlineStyle.shadowColor - || nlineStyle.color - || normal.borderColor - || normal.color - || color, + style: { + smooth: this.deepQuery([data[0], data[1], mlOption], 'smooth') ? 'spline' : false, + smoothRadian: this.deepQuery([data[0], data[1], mlOption], 'smoothRadian'), + symbol: symbol, + symbolSize: symbolSize, + symbolRotate: symbolRotate, + // data: [data[0].name,data[1].name], + xStart: xStart, + yStart: yStart, // 坐标 + xEnd: xEnd, + yEnd: yEnd, // 坐标 + brushType: 'both', + lineType: nlineStyle.type, + shadowColor: nlineStyle.shadowColor + || nlineStyle.color + || normal.borderColor + || normal.color + || color, shadowBlur: nlineStyle.shadowBlur, shadowOffsetX: nlineStyle.shadowOffsetX, shadowOffsetY: nlineStyle.shadowOffsetY, - color : normal.color || color, - strokeColor : nlineStyle.color - || normal.borderColor - || normal.color - || color, + color: normal.color || color, + strokeColor: nlineStyle.color + || normal.borderColor + || normal.color + || color, lineWidth: nBorderWidth, symbolBorderColor: normal.borderColor || normal.color || color, symbolBorder: normal.borderWidth }, - highlightStyle : { - shadowColor : elineStyle.shadowColor, + highlightStyle: { + shadowColor: elineStyle.shadowColor, shadowBlur: elineStyle.shadowBlur, shadowOffsetX: elineStyle.shadowOffsetX, shadowOffsetY: elineStyle.shadowOffsetY, - color : emphasis.color|| normal.color || color, - strokeColor : elineStyle.color - || nlineStyle.color - || emphasis.borderColor - || normal.borderColor - || emphasis.color - || normal.color - || color, + color: emphasis.color|| normal.color || color, + strokeColor: elineStyle.color + || nlineStyle.color + || emphasis.borderColor + || normal.borderColor + || emphasis.color + || normal.color + || color, lineWidth: eBorderWidth, symbolBorderColor: emphasis.borderColor || normal.borderColor || emphasis.color || normal.color || color, - symbolBorder: typeof emphasis.borderWidth == 'undefined' + symbolBorder: emphasis.borderWidth == null ? (normal.borderWidth + 2) : (emphasis.borderWidth) }, - clickable : true + clickable: this.deepQuery(queryTarget, 'clickable') }); itemShape = this.addLabel( @@ -963,7 +1237,7 @@ define(function (require) { /** * 大规模标注构造器 */ - getLargeMarkPoingShape : function(seriesIndex, mpOption) { + getLargeMarkPoingShape: function(seriesIndex, mpOption) { var serie = this.series[seriesIndex]; var component = this.component; var data = mpOption.data; @@ -984,19 +1258,13 @@ define(function (require) { } // 值域 if (dataRange) { - value = typeof data[0] != 'undefined' - ? (typeof data[0].value != 'undefined' - ? data[0].value - : data[0]) - : '-'; + value = data[0].value != null ? data[0].value : ''; color = isNaN(value) ? color : dataRange.getColor(value); - nColor = this.deepQuery( - queryTarget, 'itemStyle.normal.color' - ) || color; - eColor = this.deepQuery( - queryTarget, 'itemStyle.emphasis.color' - ) || nColor; + nColor = this.deepQuery(queryTarget, 'itemStyle.normal.color') + || color; + eColor = this.deepQuery(queryTarget, 'itemStyle.emphasis.color') + || nColor; // 有值域,并且值域返回null且用户没有自己定义颜色,则隐藏这个mark if (nColor == null && eColor == null) { return; @@ -1017,20 +1285,20 @@ define(function (require) { //console.log(data) itemShape = new SymbolShape({ - style : { - pointList : data, - color : color, + style: { + pointList: data, + color: color, strokeColor: color, - shadowColor : effect.shadowColor || color, - shadowBlur : (typeof effect.shadowBlur != 'undefined' ? effect.shadowBlur : 8) + shadowColor: effect.shadowColor || color, + shadowBlur: (effect.shadowBlur != null ? effect.shadowBlur : 8) * devicePixelRatio, - size : this.deepQuery(queryTarget, 'symbolSize'), - iconType : symbol, + size: this.deepQuery(queryTarget, 'symbolSize'), + iconType: symbol, brushType: 'fill', lineWidth:1 }, - draggable : false, - hoverable : false + draggable: false, + hoverable: false }); if (effect.show) { @@ -1040,7 +1308,7 @@ define(function (require) { return itemShape; }, - backupShapeList : function () { + backupShapeList: function () { if (this.shapeList && this.shapeList.length > 0) { this.lastShapeList = this.shapeList; this.shapeList = []; @@ -1050,13 +1318,16 @@ define(function (require) { } }, - addShapeList : function () { + addShapeList: function () { var maxLenth = this.option.animationThreshold / (this.canvasSupported ? 2 : 4); var lastShapeList = this.lastShapeList; var shapeList = this.shapeList; - var duration = lastShapeList.length > 0 - ? 500 : this.query(this.option, 'animationDuration'); + var isUpdate = lastShapeList.length > 0; + var duration = isUpdate + ? this.query(this.option, 'animationDurationUpdate') + : this.query(this.option, 'animationDuration'); var easing = this.query(this.option, 'animationEasing'); + var delay; var key; var oldMap = {}; var newMap = {}; @@ -1073,7 +1344,14 @@ define(function (require) { } else { key += lastShapeList[i].type; - oldMap[key] = lastShapeList[i]; + // https://github.com/ecomfe/echarts/issues/1219#issuecomment-71987602 + // 响应中断可能产生的重复元素 + if (oldMap[key]) { + this.zr.delShape(lastShapeList[i].id); + } + else { + oldMap[key] = lastShapeList[i]; + } } } for (var i = 0, l = shapeList.length; i < l; i++) { @@ -1097,12 +1375,21 @@ define(function (require) { if (oldMap[key]) { // 新旧都有 动画过渡 this.zr.delShape(oldMap[key].id); - this._animateMod(oldMap[key], newMap[key], duration, easing); + this._animateMod( + oldMap[key], newMap[key], duration, easing, 0, isUpdate + ); } else { // 新有旧没有 添加并动画过渡 //this._animateAdd(newMap[key], duration, easing); - this._animateMod(false, newMap[key], duration, easing); + delay = (this.type == ecConfig.CHART_TYPE_LINE + || this.type == ecConfig.CHART_TYPE_RADAR) + && key.indexOf('icon') !== 0 + ? duration / 2 + : 0; + this._animateMod( + false, newMap[key], duration, easing, delay, isUpdate + ); } } this.zr.refresh(); @@ -1119,12 +1406,12 @@ define(function (require) { } }, - _getAnimationKey : function(shape) { + _getAnimationKey: function(shape) { if (this.type != ecConfig.CHART_TYPE_MAP) { return ecData.get(shape, 'seriesIndex') + '_' + ecData.get(shape, 'dataIndex') + (shape._mark ? shape._mark : '') - + (this.type == ecConfig.CHART_TYPE_RADAR + + (this.type === ecConfig.CHART_TYPE_RADAR ? ecData.get(shape, 'special') : ''); } else { @@ -1137,20 +1424,21 @@ define(function (require) { /** * 动画过渡 */ - _animateMod : function (oldShape, newShape, duration, easing) { + _animateMod: function (oldShape, newShape, duration, easing, delay, isUpdate) { switch (newShape.type) { - case 'broken-line' : + case 'polyline' : case 'half-smooth-polygon' : ecAnimation.pointList(this.zr, oldShape, newShape, duration, easing); break; case 'rectangle' : ecAnimation.rectangle(this.zr, oldShape, newShape, duration, easing); break; + case 'image' : case 'icon' : - ecAnimation.icon(this.zr, oldShape, newShape, duration, easing); + ecAnimation.icon(this.zr, oldShape, newShape, duration, easing, delay); break; case 'candle' : - if (duration > 500) { + if (!isUpdate) { ecAnimation.candle(this.zr, oldShape, newShape, duration, easing); } else { @@ -1160,7 +1448,7 @@ define(function (require) { case 'ring' : case 'sector' : case 'circle' : - if (duration > 500) { + if (!isUpdate) { // 进入动画,加旋转 ecAnimation.ring( this.zr, @@ -1170,7 +1458,7 @@ define(function (require) { easing ); } - else if (newShape.type == 'sector') { + else if (newShape.type === 'sector') { ecAnimation.sector(this.zr, oldShape, newShape, duration, easing); } else { @@ -1181,15 +1469,15 @@ define(function (require) { ecAnimation.text(this.zr, oldShape, newShape, duration, easing); break; case 'polygon' : - if (duration > 500) { + if (!isUpdate) { ecAnimation.polygon(this.zr, oldShape, newShape, duration, easing); } else { ecAnimation.pointList(this.zr, oldShape, newShape, duration, easing); } break; - case 'chord' : - ecAnimation.chord(this.zr, oldShape, newShape, duration, easing); + case 'ribbon' : + ecAnimation.ribbon(this.zr, oldShape, newShape, duration, easing); break; case 'gauge-pointer' : ecAnimation.gaugePointer(this.zr, oldShape, newShape, duration, easing); @@ -1197,6 +1485,7 @@ define(function (require) { case 'mark-line' : ecAnimation.markline(this.zr, oldShape, newShape, duration, easing); break; + case 'bezier-curve' : case 'line' : ecAnimation.line(this.zr, oldShape, newShape, duration, easing); break; @@ -1210,15 +1499,15 @@ define(function (require) { * 标注动画 * @param {number} duration 时长 * @param {string=} easing 缓动效果 - * @param {Array=} addShapeList 指定特效对象,不知道默认使用this.shapeList + * @param {Array=} addShapeList 指定特效对象,不指定默认使用this.shapeList */ - animationMark : function (duration , easing, addShapeList) { + animationMark: function (duration , easing, addShapeList) { var shapeList = addShapeList || this.shapeList; for (var i = 0, l = shapeList.length; i < l; i++) { if (!shapeList[i]._mark) { continue; } - this._animateMod(false, shapeList[i], duration, easing); + this._animateMod(false, shapeList[i], duration, easing, 0, true); } this.animationEffect(addShapeList); }, @@ -1227,24 +1516,26 @@ define(function (require) { * 特效动画 * @param {Array=} addShapeList 指定特效对象,不知道默认使用this.shapeList */ - animationEffect : function (addShapeList) { + animationEffect: function (addShapeList) { !addShapeList && this.clearEffectShape(); var shapeList = addShapeList || this.shapeList; + if (shapeList == null) { + return; + } var zlevel = ecConfig.EFFECT_ZLEVEL; if (this.canvasSupported) { this.zr.modLayer( zlevel, { - motionBlur : true, - lastFrameAlpha : 0.95 + motionBlur: true, + lastFrameAlpha: 0.95 } ); } var shape; for (var i = 0, l = shapeList.length; i < l; i++) { shape = shapeList[i]; - if (!(shape._mark && shape.effect && shape.effect.show && ecEffect[shape._mark]) - ) { + if (!(shape._mark && shape.effect && shape.effect.show && ecEffect[shape._mark])) { continue; } ecEffect[shape._mark](this.zr, this.effectList, shape, zlevel); @@ -1252,11 +1543,11 @@ define(function (require) { } }, - clearEffectShape : function (clearMotionBlur) { + clearEffectShape: function (clearMotionBlur) { if (this.zr && this.effectList && this.effectList.length > 0) { clearMotionBlur && this.zr.modLayer( ecConfig.EFFECT_ZLEVEL, - { motionBlur : false} + { motionBlur: false } ); this.zr.delShape(this.effectList); } @@ -1269,10 +1560,10 @@ define(function (require) { * @param {Object} markData 标线标注对象,支持多个 * @param {string} markType 标线标注类型 */ - addMark : function (seriesIndex, markData, markType) { + addMark: function (seriesIndex, markData, markType) { var serie = this.series[seriesIndex]; if (this.selectedMap[serie.name]) { - var duration = 500; + var duration = this.query(this.option, 'animationDurationUpdate'); var easing = this.query(this.option, 'animationEasing'); // 备份,复用_buildMarkX var oriMarkData = serie[markType].data; @@ -1280,14 +1571,16 @@ define(function (require) { serie[markType].data = markData.data; this['_build' + markType.replace('m', 'M')](seriesIndex); - for (var i = lastLength, l = this.shapeList.length; i < l; i++) { - this.zr.addShape(this.shapeList[i]); - } - this.zr.refresh(); - if (this.option.animation && !this.option.renderAsImage) { + // animationMark就会addShape this.animationMark(duration, easing, this.shapeList.slice(lastLength)); } + else { + for (var i = lastLength, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + this.zr.refreshNextFrame(); + } // 还原,复用_buildMarkX serie[markType].data = oriMarkData; } @@ -1299,7 +1592,7 @@ define(function (require) { * @param {string} markName 标线标注名称 * @param {string} markType 标线标注类型 */ - delMark : function (seriesIndex, markName, markType) { + delMark: function (seriesIndex, markName, markType) { markType = markType.replace('mark', '').replace('large', '').toLowerCase(); var serie = this.series[seriesIndex]; if (this.selectedMap[serie.name]) { @@ -1320,10 +1613,12 @@ define(function (require) { } } - needRefresh && this.zr.refresh(); + needRefresh && this.zr.refreshNextFrame(); } } }; + zrUtil.inherits(Base, ComponentBase); + return Base; }); diff --git a/amd/chart/chord.js b/amd/chart/chord.js index 7e47cf1..aceb133 100644 --- a/amd/chart/chord.js +++ b/amd/chart/chord.js @@ -2,391 +2,583 @@ * echarts图表类:chord diagram * * @author pissang (https://github.com/pissang/) - * + * + * TODO 非Ribbon Type 支持 undirected graph ? */ define(function (require) { 'use strict'; - var ComponentBase = require('../component/base'); var ChartBase = require('./base'); // 图形依赖 var TextShape = require('../zrender/shape/Text'); var LineShape = require('../zrender/shape/Line'); var SectorShape = require('../zrender/shape/Sector'); - var ChordShape = require('../util/shape/Chord'); + var RibbonShape = require('../util/shape/Ribbon'); + var IconShape = require('../util/shape/Icon'); + var BezierCurveShape = require('../zrender/shape/BezierCurve'); var ecConfig = require('../config'); + // 和弦图默认参数 + ecConfig.chord = { + zlevel: 0, // 一级层叠 + z: 2, // 二级层叠 + clickable: true, + radius: ['65%', '75%'], + center: ['50%', '50%'], + padding: 2, + sort: 'none', // can be 'none', 'ascending', 'descending' + sortSub: 'none', // can be 'none', 'ascending', 'descending' + startAngle: 90, + clockWise: true, + ribbonType: true, + + /***************** 下面的配置项在 ribbonType 为 false 时有效 */ + // 同force类似 + minRadius: 10, + maxRadius: 20, + symbol: 'circle', + /***************** 上面的配置项在 ribbonType 为 false 时有效 */ + + /***************** 下面的配置项在 ribbonType 为 true 时有效 */ + showScale: false, + showScaleText: false, + /***************** 上面的配置项在 ribbonType 为 true 时有效 */ + + // 分类里如果有样式会覆盖节点默认样式 + // categories: [{ + // itemStyle + // symbol + // symbolSize + // name + // }], + + itemStyle: { + normal: { + borderWidth: 0, + borderColor: '#000', + label: { + show: true, + rotate: false, + distance: 5 + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + }, + chordStyle: { + /** ribbonType = false 时有效 */ + width: 1, + color: 'black', + /** ribbonType = true 时有效 */ + borderWidth: 1, + borderColor: '#999', + opacity: 0.5 + } + }, + emphasis: { + borderWidth: 0, + borderColor: '#000', + chordStyle: { + /** ribbonType = false 时有效 */ + width: 1, + color: 'black', + /** ribbonType = true 时有效 */ + borderWidth: 1, + borderColor: '#999' + } + } + } + /****** 使用 Data-matrix 表示数据 */ + // data: [], + // Source data matrix + /** + * target + * -1--2--3--4--5- + * 1| x x x x x + * 2| x x x x x + * 3| x x x x x source + * 4| x x x x x + * 5| x x x x x + * + * Relation ship from source to target + * https://github.com/mbostock/d3/wiki/Chord-Layout#wiki-chord + * + * Row based + */ + // matrix: [], + + /****** 使用 node-links 表示数据 */ + // 参考 force + // nodes: [], + // links: [] + }; + var ecData = require('../util/ecData'); var zrUtil = require('../zrender/tool/util'); var vec2 = require('../zrender/tool/vector'); - var NDArray = require('../util/ndarray'); - - var _devicePixelRatio = window.devicePixelRatio || 1; + var Graph = require('../data/Graph'); + var ChordLayout = require('../layout/Chord'); function Chord(ecTheme, messageCenter, zr, option, myChart) { - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); // 图表基类 - ChartBase.call(this); + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); + + this.scaleLineLength = 4; + + this.scaleUnitAngle = 4; this.refresh(option); } Chord.prototype = { - type : ecConfig.CHART_TYPE_CHORD, + type: ecConfig.CHART_TYPE_CHORD, /** * 绘制图形 */ - _buildShape : function () { + _init: function () { var series = this.series; this.selectedMap = {}; - this.chordSeries = []; - this.chordSerieSample = null; - var matrix = []; - var serieNumber = 0; + + var chordSeriesMap = {}; + + var chordSeriesGroups = {}; + for (var i = 0, l = series.length; i < l; i++) { if (series[i].type === this.type) { - // Use the config of first chord serie - if (!this.chordSerieSample) { - this.chordSerieSample = series[i]; - this.reformOption(this.chordSerieSample); - } - var _isSelected = this.isSelected(series[i].name); // Filter by selected serie this.selectedMap[series[i].name] = _isSelected; - if (!_isSelected) { - continue; + if (_isSelected) { + this.buildMark(i); } - this.chordSeries.push(series[i]); - this.buildMark(i); - matrix.push(series[i].matrix); - serieNumber++; + + this.reformOption(series[i]); + chordSeriesMap[series[i].name] = series[i]; } } - if (!this.chordSerieSample) { - return; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type === this.type) { + if (series[i].insertToSerie) { + var referenceSerie = chordSeriesMap[series[i].insertToSerie]; + series[i]._referenceSerie = referenceSerie; + } + else { + chordSeriesGroups[series[i].name] = [series[i]]; + } + } } - if (!this.chordSeries.length) { - this.addShapeList(); - return; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type === this.type) { + if (series[i].insertToSerie) { + // insertToSerie 可能会存在链式的使用,找到最原始的系列,分到一个 Group 里 + var mainSerie = series[i]._referenceSerie; + while (mainSerie && mainSerie._referenceSerie) { + mainSerie = mainSerie._referenceSerie; + } + if ( + chordSeriesGroups[mainSerie.name] + && this.selectedMap[series[i].name] + ) { + chordSeriesGroups[mainSerie.name].push(series[i]); + } + } + } } - var zrWidth = this.zr.getWidth(); - var zrHeight = this.zr.getHeight(); - var zrSize = Math.min(zrWidth, zrHeight); - - this.groups = this.chordSerieSample.data; - this.startAngle = this.chordSerieSample.startAngle; - // Constrain to [0, 360] - this.startAngle = this.startAngle % 360; - if (this.startAngle < 0) { - this.startAngle = this.startAngle + 360; + for (var name in chordSeriesGroups) { + this._buildChords(chordSeriesGroups[name]); } - this.clockWise = this.chordSerieSample.clockWise; - this.innerRadius = this.parsePercent( - this.chordSerieSample.radius[0], - zrSize / 2 - ); - this.outerRadius = this.parsePercent( - this.chordSerieSample.radius[1], - zrSize / 2 - ); - this.padding = this.chordSerieSample.padding; - this.sortGroups = this.chordSerieSample.sort; - this.sortSubGroups = this.chordSerieSample.sortSub; - this.showScale = this.chordSerieSample.showScale; - this.showScaleText = this.chordSerieSample.showScaleText; - this.center = [ - this.parsePercent(this.chordSerieSample.center[0], zrWidth), - this.parsePercent(this.chordSerieSample.center[1], zrHeight) + + this.addShapeList(); + }, + + _getNodeCategory: function (serie, group) { + return serie.categories && serie.categories[group.category || 0]; + }, + + _getNodeQueryTarget: function (serie, group) { + var category = this._getNodeCategory(serie, group); + return [group, category, serie]; + }, + + _getEdgeQueryTarget: function (serie, edge, type) { + type = type || 'normal'; + return [ + (edge.itemStyle && edge.itemStyle[type]), + serie.itemStyle[type].chordStyle ]; - var fixSize = - this.chordSerieSample.itemStyle.normal.chordStyle.lineStyle.width - - this.chordSerieSample.itemStyle.normal.lineStyle.width; - this.strokeFix = - (fixSize / _devicePixelRatio) / this.innerRadius / Math.PI * 180; + }, + _buildChords: function (series) { + var graphs = []; + var mainSerie = series[0]; - this.dataMat = new NDArray(matrix); - this.dataMat = this.dataMat._transposelike([1, 2, 0]); + var nodeFilter = function (n) { + return n.layout.size > 0; + }; + var createEdgeFilter = function (graph) { + return function (e) { + return graph.getEdge(e.node2, e.node1); + }; + }; + for (var i = 0; i < series.length; i++) { + var serie = series[i]; + + if (this.selectedMap[serie.name]) { + var graph; + if (serie.data && serie.matrix) { + graph = this._getSerieGraphFromDataMatrix( + serie, mainSerie + ); + } else if (serie.nodes && serie.links) { + graph = this._getSerieGraphFromNodeLinks( + serie, mainSerie + ); + } + // 过滤输出为0的节点 + graph.filterNode(nodeFilter, this); + if (serie.ribbonType) { + graph.filterEdge(createEdgeFilter(graph)); + } - // Filter the data by selected legend - var res = this._filterData(this.dataMat, this.groups); - this.dataMat = res[0]; - this.groups = res[1]; + graphs.push(graph); - // Check if data is valid - var shape = this.dataMat.shape(); - if (shape[0] !== shape[1] || shape[0] !== this.groups.length) { - throw new Error('Data not valid'); + graph.__serie = serie; + } } - if (shape[0] === 0 || shape[2] === 0) { - this.addShapeList(); + if (!graphs.length) { return; } - // Down to 2 dimension - // More convenient for angle calculating and sort - this.dataMat.reshape(shape[0], shape[1] * shape[2]); + var mainGraph = graphs[0]; - // Processing data - var sumOut = this.dataMat.sum(1); - var percents = sumOut.mul(1 / sumOut.sum()); + if (!mainSerie.ribbonType) { + var minRadius = mainSerie.minRadius; + var maxRadius = mainSerie.maxRadius; + // Map size to [minRadius, maxRadius] + var min = Infinity, max = -Infinity; + mainGraph.eachNode(function (node) { + max = Math.max(node.layout.size, max); + min = Math.min(node.layout.size, min); + }); + var multiplier = (maxRadius - minRadius) / (max - min); + mainGraph.eachNode(function (node) { + var queryTarget = this._getNodeQueryTarget(mainSerie, node); + var symbolSize = this.query(queryTarget, 'symbolSize'); + if (max === min) { + node.layout.size = symbolSize || min; + } + else { + node.layout.size = symbolSize + || (node.layout.size - min) * multiplier + minRadius; + } + }, this); + } - var groupNumber = shape[0]; - var subGroupNumber = shape[1] * shape[2]; + // Do layout + var layout = new ChordLayout(); + layout.clockWise = mainSerie.clockWise; + layout.startAngle = mainSerie.startAngle * Math.PI / 180; + if (!layout.clockWise) { + layout.startAngle = -layout.startAngle; + } + layout.padding = mainSerie.padding * Math.PI / 180; + layout.sort = mainSerie.sort; + layout.sortSub = mainSerie.sortSub; + layout.directed = mainSerie.ribbonType; + layout.run(graphs); - var groupAngles = percents.mul(360 - this.padding * groupNumber); - var subGroupAngles = this.dataMat.div( - this.dataMat.sum(1).reshape(groupNumber, 1) - ); - subGroupAngles = subGroupAngles.mul( - groupAngles.sub(this.strokeFix * 2).reshape(groupNumber, 1) + var showLabel = this.query( + mainSerie, 'itemStyle.normal.label.show' ); - switch (this.sortGroups) { - case 'ascending': - case 'descending': - var groupIndices = groupAngles - .argsort(0, this.sortGroups); - groupAngles['sort'](0, this.sortGroups); - sumOut['sort'](0, this.sortGroups); - break; - default: - var groupIndices = NDArray.range(shape[0]); - } + if (mainSerie.ribbonType) { + this._buildSectors(mainSerie, 0, mainGraph, mainSerie, graphs); + if (showLabel) { + this._buildLabels(mainSerie, 0, mainGraph, mainSerie, graphs); + } - switch (this.sortSubGroups) { - case 'ascending': - case 'descending': - var subGroupIndices = subGroupAngles - .argsort(1, this.sortSubGroups); - subGroupAngles['sort'](1, this.sortSubGroups); - break; - default: - var subGroupIndices = NDArray - .range(subGroupNumber) - .reshape(1, subGroupNumber) - .repeat(groupNumber, 0); - } + for (var i = 0, j = 0; i < series.length; i++) { + if (this.selectedMap[series[i].name]) { + this._buildRibbons(series, i, graphs[j++], mainSerie); + } + } - var groupIndicesArr = groupIndices.toArray(); - var groupAnglesArr = groupAngles.toArray(); - var subGroupIndicesArr = subGroupIndices.toArray(); - var subGroupAnglesArr = subGroupAngles.toArray(); - var sumOutArray = sumOut.toArray(); - - var sectorAngles = []; - var chordAngles = new NDArray( - groupNumber, subGroupNumber - ).toArray(); - var values = []; - var start = 0; - var end = 0; - for (var i = 0; i < groupNumber; i++) { - var sortedIdx = groupIndicesArr[i]; - values[sortedIdx] = sumOutArray[i]; - - end = start + groupAnglesArr[i]; - sectorAngles[sortedIdx] = [start, end]; - - // Sub Group - var subStart = start + this.strokeFix; - var subEnd = subStart; - for (var j = 0; j < subGroupNumber; j++) { - subEnd = subStart + subGroupAnglesArr[sortedIdx][j]; - var subSortedIndex = subGroupIndicesArr[sortedIdx][j]; - /*jshint maxlen : 200*/ - chordAngles[sortedIdx][subSortedIndex] - = [subStart, subEnd]; - subStart = subEnd; - } - - start = end + this.padding; + if (mainSerie.showScale) { + this._buildScales(mainSerie, 0, mainGraph); + } } - - // reset data - this.chordShapes = new NDArray(groupNumber, groupNumber, serieNumber) - .toArray(); - this.sectorShapes = []; - - this._buildSectors(sectorAngles, values); - - chordAngles = new NDArray(chordAngles).reshape( - groupNumber, groupNumber, serieNumber, 2 - ).toArray(); - this._buildChords(chordAngles, this.dataMat.reshape(shape).toArray()); - - var res = this.normalizeValue(values); - if (this.showScale) { - this._buildScales( - res[0], - res[1], - sectorAngles, - new NDArray(res[0]).sum() / (360 - this.padding * groupNumber) - ); + else { + this._buildNodeIcons(mainSerie, 0, mainGraph, mainSerie, graphs); + if (showLabel) { + this._buildLabels(mainSerie, 0, mainGraph, mainSerie, graphs); + } + for (var i = 0, j = 0; i < series.length; i++) { + if (this.selectedMap[series[i].name]) { + this._buildEdgeCurves(series, i, graphs[j++], mainSerie, mainGraph); + } + } } - - this.addShapeList(); + + this._initHoverHandler(series, graphs); }, - _filterData : function (dataMat, groups) { - var indices = []; - var groupsFilted = []; - // Filter by selected group - for (var i = 0; i < groups.length; i++) { - var name = groups[i].name; + _getSerieGraphFromDataMatrix: function (serie, mainSerie) { + var nodesData = []; + var count = 0; + var matrix = []; + // 复制一份新的matrix + for (var i = 0; i < serie.matrix.length; i++) { + matrix[i] = serie.matrix[i].slice(); + } + var data = serie.data || serie.nodes; + for (var i = 0; i < data.length; i++) { + var node = {}; + var group = data[i]; + group.rawIndex = i; + for (var key in group) { + // name改为id + if (key === 'name') { + node['id'] = group['name']; + } + else { + node[key] = group[key]; + } + } + // legends 选择优先级 category -> group + var category = this._getNodeCategory(mainSerie, group); + var name = category ? category.name : group.name; + this.selectedMap[name] = this.isSelected(name); - if (!this.selectedMap[name]) { - indices.push(i); - } else { - groupsFilted.push(groups[i]); + if (this.selectedMap[name]) { + nodesData.push(node); + count++; } - } - if (indices.length) { - dataMat = dataMat['delete'](indices, 0); - dataMat = dataMat['delete'](indices, 1); - } - if (!dataMat.size()) { - return [dataMat, groupsFilted]; - } - // Empty data also need to be removed - indices = []; - var groupsFilted2 = []; - var shape = dataMat.shape(); - dataMat.reshape(shape[0], shape[1] * shape[2]); - var sumOutArray = dataMat.sum(1).toArray(); - dataMat.reshape(shape); - for (var i = 0; i < groupsFilted.length; i++) { - if (sumOutArray[i] === 0) { - indices.push(i); - } else { - groupsFilted2.push(groupsFilted[i]); + else { + // 过滤legend未选中的数据 + matrix.splice(count, 1); + for (var j = 0; j < matrix.length; j++) { + matrix[j].splice(count, 1); + } } } - if (indices.length) { - dataMat = dataMat['delete'](indices, 0); - dataMat = dataMat['delete'](indices, 1); - } - return [dataMat, groupsFilted2]; + var graph = Graph.fromMatrix(nodesData, matrix, true); + + // Prepare layout parameters + graph.eachNode(function (n, idx) { + n.layout = { + size: n.data.outValue + }; + n.rawIndex = n.data.rawIndex; + }); + graph.eachEdge(function (e) { + e.layout = { + weight: e.data.weight + }; + }); + + return graph; }, - _buildSectors : function (angles, data) { - var len = this.groups.length; - var len2 = this.chordSeries.length; + _getSerieGraphFromNodeLinks: function (serie, mainSerie) { + var graph = new Graph(true); + var nodes = serie.data || serie.nodes; + for (var i = 0, len = nodes.length; i < len; i++) { + var n = nodes[i]; + if (!n || n.ignore) { + continue; + } + // legends 选择优先级 category -> group + var category = this._getNodeCategory(mainSerie, n); + var name = category ? category.name : n.name; - var timeout; + this.selectedMap[name] = this.isSelected(name); + if (this.selectedMap[name]) { + var node = graph.addNode(n.name, n); + node.rawIndex = i; + } + } - var showLabel = this.query( - this.chordSerieSample, 'itemStyle.normal.label.show' - ); - var labelColor = this.query( - this.chordSerieSample, 'itemStyle.normal.label.color' - ); - var rotateLabel = this.query( - this.chordSerieSample, 'itemStyle.normal.label.rotate' - ); - var labelDistance = this.query( - this.chordSerieSample, 'itemStyle.normal.label.distance' - ); + for (var i = 0, len = serie.links.length; i < len; i++) { + var e = serie.links[i]; + var n1 = e.source; + var n2 = e.target; + if (typeof(n1) === 'number') { + n1 = nodes[n1]; + if (n1) { + n1 = n1.name; + } + } + if (typeof(n2) === 'number') { + n2 = nodes[n2]; + if (n2) { + n2 = n2.name; + } + } + var edge = graph.addEdge(n1, n2, e); + if (edge) { + edge.rawIndex = i; + } + } + graph.eachNode(function (n) { + var value = n.data.value; + if (value == null) { // value 是 null 或者 undefined + value = 0; + if (mainSerie.ribbonType) { + // 默认使用所有出边值的和作为节点的大小, 不修改 data 里的数值 + for (var i = 0; i < n.outEdges.length; i++) { + value += n.outEdges[i].data.weight || 0; + } + } + else { + // 默认使用所有边值的和作为节点的大小, 不修改 data 里的数值 + for (var i = 0; i < n.edges.length; i++) { + value += n.edges[i].data.weight || 0; + } + } + } + n.layout = { + size: value + }; + }); + graph.eachEdge(function (e) { + e.layout = { + // 默认 weight 为1 + weight: e.data.weight == null ? 1 : e.data.weight + }; + }); + + return graph; + }, + + _initHoverHandler: function (series, graphs) { + var mainSerie = series[0]; + var mainGraph = graphs[0]; var self = this; - function createMouseOver(idx) { - return function () { - if (timeout) { - clearTimeout(timeout); - } - timeout = setTimeout(function (){ - for (var i = 0; i < len; i++) { - self.sectorShapes[i].style.opacity - = i === idx ? 1 : 0.1; - self.zr.modShape(self.sectorShapes[i].id); - - for (var j = 0; j < len; j++) { - for (var k = 0; k < len2; k++) { - var chordShape = self.chordShapes[i][j][k]; - if (chordShape) { - chordShape.style.opacity - = (i === idx || j === idx) - ? 0.5 : 0.03; - self.zr.modShape(chordShape.id); + mainGraph.eachNode(function (node) { + node.shape.onmouseover = function () { + mainGraph.eachNode(function (n) { + n.shape.style.opacity = 0.1; + if (n.labelShape) { + n.labelShape.style.opacity = 0.1; + n.labelShape.modSelf(); + } + n.shape.modSelf(); + }); + for (var i = 0; i < graphs.length; i++) { + for (var j = 0; j < graphs[i].edges.length; j++) { + var e = graphs[i].edges[j]; + var queryTarget = self._getEdgeQueryTarget( + graphs[i].__serie, e.data + ); + e.shape.style.opacity = self.deepQuery( + queryTarget, 'opacity' + ) * 0.1; + e.shape.modSelf(); + } + } + node.shape.style.opacity = 1; + if (node.labelShape) { + node.labelShape.style.opacity = 1; + } + for (var i = 0; i < graphs.length; i++) { + var n = graphs[i].getNodeById(node.id); + if (n) { // 节点有可能没数据被过滤掉了 + for (var j = 0; j < n.outEdges.length; j++) { + var e = n.outEdges[j]; + var queryTarget = self._getEdgeQueryTarget( + graphs[i].__serie, e.data + ); + e.shape.style.opacity = self.deepQuery( + queryTarget, 'opacity' + ); + var other = graphs[0].getNodeById(e.node2.id); + if (other) { + if (other.shape) { + other.shape.style.opacity = 1; + } + if (other.labelShape) { + other.labelShape.style.opacity = 1; } } } } - self.zr.refresh(); - }, 50); + } + self.zr.refreshNextFrame(); }; - } - - function createMouseOut() { - return function () { - if (timeout) { - clearTimeout(timeout); - } - timeout = setTimeout(function (){ - for (var i = 0; i < len; i++) { - self.sectorShapes[i].style.opacity = 1.0; - self.zr.modShape(self.sectorShapes[i].id); - - for (var j = 0; j < len; j++) { - for (var k = 0; k < len2; k++) { - var chordShape = self.chordShapes[i][j][k]; - if (chordShape) { - chordShape.style.opacity = 0.5; - self.zr.modShape(chordShape.id); - } - } - } + node.shape.onmouseout = function () { + mainGraph.eachNode(function (n) { + n.shape.style.opacity = 1; + if (n.labelShape) { + n.labelShape.style.opacity = 1; + n.labelShape.modSelf(); + } + n.shape.modSelf(); + }); + for (var i = 0; i < graphs.length; i++) { + for (var j = 0; j < graphs[i].edges.length; j++) { + var e = graphs[i].edges[j]; + var queryTarget = [e.data, mainSerie]; + e.shape.style.opacity = self.deepQuery( + queryTarget, 'itemStyle.normal.chordStyle.opacity' + ); + e.shape.modSelf(); } - self.zr.refresh(); - }, 50); + } + self.zr.refreshNextFrame(); }; - } + }); + }, - for (var i = 0; i < len; i++) { - var group = this.groups[i]; - var angle = angles[i]; - var _start = (this.clockWise ? (360 - angle[1]) : angle[0]) + this.startAngle; - var _end = (this.clockWise ? (360 - angle[0]) : angle[1]) + this.startAngle; - - var sector = { - zlevel : this._zlevelBase, - style : { - x : this.center[0], - y : this.center[1], - r0 : this.innerRadius, - r : this.outerRadius, - startAngle : _start, - endAngle : _end, - brushType : 'fill', + _buildSectors: function (serie, serieIdx, graph, mainSerie) { + var center = this.parseCenter(this.zr, mainSerie.center); + var radius = this.parseRadius(this.zr, mainSerie.radius); + var clockWise = mainSerie.clockWise; + var sign = clockWise ? 1 : -1; + + graph.eachNode(function (node) { + var category = this._getNodeCategory(mainSerie, node.data); + // 默认使用 category 分类颜色 + var color = category ? this.getColor(category.name) : this.getColor(node.id); + + var startAngle = node.layout.startAngle / Math.PI * 180 * sign; + var endAngle = node.layout.endAngle / Math.PI * 180 * sign; + var sector = new SectorShape({ + zlevel: this.getZlevelBase(), + z : this.getZBase(), + style: { + x: center[0], + y: center[1], + r0: radius[0], + r: radius[1], + startAngle: startAngle, + endAngle: endAngle, + brushType: 'fill', opacity: 1, - color : this.getColor(group.name) + color: color, + clockWise: clockWise }, - clickable: true, - highlightStyle : { - brushType : 'fill' + clickable: mainSerie.clickable, + highlightStyle: { + brushType: 'fill' } - }; + }); sector.style.lineWidth = this.deepQuery( - [group, this.chordSerieSample], - 'itemStyle.normal.lineStyle.width' + [node.data, mainSerie], + 'itemStyle.normal.borderWidth' ); sector.highlightStyle.lineWidth = this.deepQuery( - [group, this.chordSerieSample], - 'itemStyle.emphasis.lineStyle.width' + [node.data, mainSerie], + 'itemStyle.emphasis.borderWidth' ); sector.style.strokeColor = this.deepQuery( - [group, this.chordSerieSample], - 'itemStyle.normal.lineStyle.color' + [node.data, mainSerie], + 'itemStyle.normal.borderColor' ); sector.highlightStyle.strokeColor = this.deepQuery( - [group, this.chordSerieSample], - 'itemStyle.emphasis.lineStyle.color' + [node.data, mainSerie], + 'itemStyle.emphasis.borderColor' ); if (sector.style.lineWidth > 0) { sector.style.brushType = 'both'; @@ -396,257 +588,447 @@ define(function (require) { } ecData.pack( sector, - this.chordSeries[0], - 0, - data[i], i, - group.name + serie, + serieIdx, + node.data, + node.rawIndex, + node.id, + // special + node.category ); - if (showLabel) { - var halfAngle = [_start + _end] / 2; - halfAngle %= 360; // Constrain to [0,360] - var isRightSide = halfAngle <= 90 - || halfAngle >= 270; - halfAngle = halfAngle * Math.PI / 180; - var v = [Math.cos(halfAngle), -Math.sin(halfAngle)]; - - var distance = this.showScaleText ? 35 + labelDistance : labelDistance; - var start = vec2.scale([], v, this.outerRadius + distance); - vec2.add(start, start, this.center); - - var labelShape = { - zlevel : this._zlevelBase - 1, - hoverable : false, - style : { - text : group.name, - textAlign : isRightSide ? 'left' : 'right', - color : labelColor - } - }; - if (rotateLabel) { - labelShape.rotation = isRightSide ? halfAngle : Math.PI + halfAngle; - if (isRightSide) { - labelShape.style.x = this.outerRadius + distance; - } else { - labelShape.style.x = -this.outerRadius - distance; - } - labelShape.style.y = 0; - labelShape.position = this.center; - } else { - labelShape.style.x = start[0]; - labelShape.style.y = start[1]; - } - labelShape.style.textColor = this.deepQuery( - [group, this.chordSerieSample], - 'itemStyle.normal.label.textStyle.color' - ) || '#fff'; - labelShape.style.textFont = this.getFont(this.deepQuery( - [group, this.chordSerieSample], - 'itemStyle.normal.label.textStyle' - )); - labelShape = new TextShape(labelShape); - this.shapeList.push(labelShape); - } - - sector.onmouseover = createMouseOver(i); - sector.onmouseout = createMouseOut(); - - sector = new SectorShape(sector); + this.shapeList.push(sector); - this.sectorShapes.push(sector); - } + + node.shape = sector; + + }, this); }, - _buildChords : function (angles, dataArr) { - var len = angles.length; - if (!len) { - return; - } - var len2 = angles[0][0].length; - - var chordLineStyle - = this.chordSerieSample.itemStyle.normal.chordStyle.lineStyle; - var chordLineStyleEmphsis - = this.chordSerieSample.itemStyle.emphasis.chordStyle.lineStyle; - - for (var i = 0; i < len; i++) { - for (var j = 0; j < len; j++) { - for (var k = 0; k < len2; k++) { - if (this.chordShapes[j][i][k]) { - continue; - } + _buildNodeIcons: function (serie, serieIdx, graph, mainSerie) { + var center = this.parseCenter(this.zr, mainSerie.center); + var radius = this.parseRadius(this.zr, mainSerie.radius); + // PENDING + var r = radius[1]; + + graph.eachNode(function (node) { + var startAngle = node.layout.startAngle; + var endAngle = node.layout.endAngle; + var angle = (startAngle + endAngle) / 2; + var x = r * Math.cos(angle); + var y = r * Math.sin(angle); + var queryTarget = this._getNodeQueryTarget(mainSerie, node.data); + + var category = this._getNodeCategory(mainSerie, node.data); + var color = this.deepQuery(queryTarget, 'itemStyle.normal.color'); + if (!color) { + color = category ? this.getColor(category.name) : this.getColor(node.id); + } + var iconShape = new IconShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + style: { + x: - node.layout.size, + y: - node.layout.size, + width: node.layout.size * 2, + height: node.layout.size * 2, + iconType: this.deepQuery(queryTarget, 'symbol'), + color: color, + brushType: 'both', + lineWidth: this.deepQuery(queryTarget, 'itemStyle.normal.borderWidth'), + strokeColor: this.deepQuery(queryTarget, 'itemStyle.normal.borderColor') + }, + highlightStyle: { + color: this.deepQuery(queryTarget, 'itemStyle.emphasis.color'), + lineWidth: this.deepQuery(queryTarget, 'itemStyle.emphasis.borderWidth'), + strokeColor: this.deepQuery(queryTarget, 'itemStyle.emphasis.borderColor') + }, + clickable: mainSerie.clickable, + position: [x + center[0], y + center[1]] + }); - var angleIJ0 = angles[i][j][k][0]; - var angleJI0 = angles[j][i][k][0]; + ecData.pack( + iconShape, + serie, + serieIdx, + node.data, + node.rawIndex, + node.id, + // special + node.category + ); - var angleIJ1 = angles[i][j][k][1]; - var angleJI1 = angles[j][i][k][1]; + this.shapeList.push(iconShape); + node.shape = iconShape; + }, this); + }, - if (angleIJ0 - angleJI1 === 0 || - angleJI0 - angleJI1 === 0) { - this.chordShapes[i][j][k] = null; - continue; - } + _buildLabels: function (serie, serieIdx, graph, mainSerie) { + var labelColor = this.query( + mainSerie, 'itemStyle.normal.label.color' + ); + var rotateLabel = this.query( + mainSerie, 'itemStyle.normal.label.rotate' + ); + var labelDistance = this.query( + mainSerie, 'itemStyle.normal.label.distance' + ); + var center = this.parseCenter(this.zr, mainSerie.center); + var radius = this.parseRadius(this.zr, mainSerie.radius); + var clockWise = mainSerie.clockWise; + var sign = clockWise ? 1 : -1; - var color; - if (len2 === 1) { - if (angleIJ1 - angleIJ0 <= angleJI1 - angleJI0) { - color = this.getColor(this.groups[i].name); - } else { - color = this.getColor(this.groups[j].name); - } - } else { - color = this.getColor(this.chordSeries[k].name); - } - var s0 = !this.clockWise ? (360 - angleIJ1) : angleIJ0; - var s1 = !this.clockWise ? (360 - angleIJ0) : angleIJ1; - var t0 = !this.clockWise ? (360 - angleJI1) : angleJI0; - var t1 = !this.clockWise ? (360 - angleJI0) : angleJI1; - var chord = { - zlevel : this._zlevelBase, - style : { - center : this.center, - r : this.innerRadius, - source0 : s0 - this.startAngle, - source1 : s1 - this.startAngle, - target0 : t0 - this.startAngle, - target1 : t1 - this.startAngle, - brushType : 'both', - opacity : 0.5, - color : color, - lineWidth : chordLineStyle.width, - strokeColor : chordLineStyle.color - }, - clickable: true, - highlightStyle : { - brushType : 'both', - lineWidth : chordLineStyleEmphsis.width, - strokeColor : chordLineStyleEmphsis.color - } - }; - - ecData.pack( - chord, - this.chordSeries[k], - k, - dataArr[i][j][k], i + '-' +j, - this.groups[i].name, - this.groups[j].name, - dataArr[j][i][k] - ); + graph.eachNode(function (node) { + var startAngle = node.layout.startAngle / Math.PI * 180 * sign; + var endAngle = node.layout.endAngle / Math.PI * 180 * sign; + var angle = (startAngle * -sign + endAngle * -sign) / 2; + angle %= 360; + if (angle < 0) { // Constrain to [0,360] + angle += 360; + } + var isRightSide = angle <= 90 + || angle >= 270; + angle = angle * Math.PI / 180; + var v = [Math.cos(angle), -Math.sin(angle)]; + + var distance = 0; + if (mainSerie.ribbonType) { + distance = mainSerie.showScaleText ? 35 + labelDistance : labelDistance; + } + else { + distance = labelDistance + node.layout.size; + } + var start = vec2.scale([], v, radius[1] + distance); + vec2.add(start, start, center); - chord = new ChordShape(chord); - this.chordShapes[i][j][k] = chord; - this.shapeList.push(chord); + var labelShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + hoverable: false, + style: { + text: node.data.label == null ? node.id : node.data.label, + textAlign: isRightSide ? 'left' : 'right', + color: labelColor || '#000000' + } + }; + if (rotateLabel) { + labelShape.rotation = isRightSide ? angle : Math.PI + angle; + if (isRightSide) { + labelShape.style.x = radius[1] + distance; + } + else { + labelShape.style.x = -radius[1] - distance; } + labelShape.style.y = 0; + labelShape.position = center.slice(); } - } + else { + labelShape.style.x = start[0]; + labelShape.style.y = start[1]; + } + labelShape.style.textColor = this.deepQuery( + [node.data, mainSerie], + 'itemStyle.normal.label.textStyle.color' + ) || '#fff'; + labelShape.style.textFont = this.getFont(this.deepQuery( + [node.data, mainSerie], + 'itemStyle.normal.label.textStyle' + )); + labelShape = new TextShape(labelShape); + + this.shapeList.push(labelShape); + node.labelShape = labelShape; + }, this); + }, + + _buildRibbons : function (series, serieIdx, graph, mainSerie) { + var serie = series[serieIdx]; + + var center = this.parseCenter(this.zr, mainSerie.center); + var radius = this.parseRadius(this.zr, mainSerie.radius); + + // graph.edges.length = 1; + graph.eachEdge(function (edge, idx) { + var color; + // 反向边 + var other = graph.getEdge(edge.node2, edge.node1); + if (!other // 只有单边 + || edge.shape // 已经创建过Ribbon + ) { + return; + } + if (other.shape) { // 已经创建过Ribbon + edge.shape = other.shape; + return; + } + var s0 = edge.layout.startAngle / Math.PI * 180; + var s1 = edge.layout.endAngle / Math.PI * 180; + + var t0 = other.layout.startAngle / Math.PI * 180; + var t1 = other.layout.endAngle / Math.PI * 180; + + if (series.length === 1) { + // 取小端的颜色 + if (edge.layout.weight <= other.layout.weight) { + color = this.getColor(edge.node1.id); + } + else { + color = this.getColor(edge.node2.id); + } + } else { + // 使用系列颜色 + color = this.getColor(serie.name); + } + var queryTarget = this._getEdgeQueryTarget(serie, edge.data); + var queryTargetEmphasis = this._getEdgeQueryTarget( + serie, edge.data, 'emphasis' + ); + var ribbon = new RibbonShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: center[0], + y: center[1], + r: radius[0], + source0: s0, + source1: s1, + target0: t0, + target1: t1, + brushType: 'both', + opacity: this.deepQuery( + queryTarget, 'opacity' + ), + color: color, + lineWidth: this.deepQuery(queryTarget, 'borderWidth'), + strokeColor: this.deepQuery(queryTarget, 'borderColor'), + clockWise: mainSerie.clockWise + }, + clickable: mainSerie.clickable, + highlightStyle: { + brushType: 'both', + opacity: this.deepQuery( + queryTargetEmphasis, 'opacity' + ), + lineWidth: this.deepQuery(queryTargetEmphasis, 'borderWidth'), + strokeColor: this.deepQuery(queryTargetEmphasis, 'borderColor') + } + }); + var node1, node2; + // 从大端到小端 + if (edge.layout.weight <= other.layout.weight) { + node1 = other.node1; + node2 = other.node2; + } else { + node1 = edge.node1; + node2 = edge.node2; + } + ecData.pack( + ribbon, + serie, + serieIdx, + edge.data, + edge.rawIndex == null ? idx : edge.rawIndex, + edge.data.name || (node1.id + '-' + node2.id), + // special + node1.id, + // special2 + node2.id + ); + + this.shapeList.push(ribbon); + edge.shape = ribbon; + }, this); }, - _buildScales : function ( - values, - unitPostfix, - angles, - unitValue - ) { - for (var i = 0; i < angles.length; i++) { - var subStartAngle = angles[i][0]; - var subEndAngle = angles[i][1]; - - var scaleAngle = subStartAngle; - while (scaleAngle < subEndAngle) { - var thelta = ((this.clockWise ? (360 - scaleAngle) : scaleAngle) - + this.startAngle) / 180 * Math.PI; - var v = [ - Math.cos(thelta), - -Math.sin(thelta) - ]; - var start = vec2.scale([], v, this.outerRadius + 1); - vec2.add(start, start, this.center); - var end = vec2.scale([], v, this.outerRadius + this.scaleLineLength); - vec2.add(end, end, this.center); - var scaleShape = { - zlevel : this._zlevelBase - 1, - hoverable : false, - style : { - xStart : start[0], - yStart : start[1], - xEnd : end[0], - yEnd : end[1], - lineCap : 'round', - brushType : 'stroke', - strokeColor : '#666', + _buildEdgeCurves: function (series, serieIdx, graph, mainSerie, mainGraph) { + var serie = series[serieIdx]; + + var center = this.parseCenter(this.zr, mainSerie.center); + + graph.eachEdge(function (e, idx) { + var node1 = mainGraph.getNodeById(e.node1.id); + var node2 = mainGraph.getNodeById(e.node2.id); + var shape1 = node1.shape; + var shape2 = node2.shape; + var queryTarget = this._getEdgeQueryTarget(serie, e.data); + var queryTargetEmphasis = this._getEdgeQueryTarget( + serie, e.data, 'emphasis' + ); + + var curveShape = new BezierCurveShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + xStart: shape1.position[0], + yStart: shape1.position[1], + xEnd: shape2.position[0], + yEnd: shape2.position[1], + cpX1: center[0], + cpY1: center[1], + lineWidth: this.deepQuery( + queryTarget, 'width' + ), + strokeColor: this.deepQuery( + queryTarget, 'color' + ), + opacity: this.deepQuery( + queryTarget, 'opacity' + ) + }, + highlightStyle: { + lineWidth: this.deepQuery( + queryTargetEmphasis, 'width' + ), + strokeColor: this.deepQuery( + queryTargetEmphasis, 'color' + ), + opacity: this.deepQuery( + queryTargetEmphasis, 'opacity' + ) + } + }); + + ecData.pack( + curveShape, + serie, + serieIdx, + e.data, + e.rawIndex == null ? idx : e.rawIndex, + e.data.name || (e.node1.id + '-' + e.node2.id), + // special + e.node1.id, + // special2 + e.node2.id + ); + + this.shapeList.push(curveShape); + e.shape = curveShape; + }, this); + }, + + _buildScales: function (serie, serieIdx, graph) { + var clockWise = serie.clockWise; + var center = this.parseCenter(this.zr, serie.center); + var radius = this.parseRadius(this.zr, serie.radius); + var sign = clockWise ? 1 : -1; + + var sumValue = 0; + var maxValue = -Infinity; + var unitPostfix; + var unitScale; + + if (serie.showScaleText) { + graph.eachNode(function (node) { + var val = node.data.value; + if (val > maxValue) { + maxValue = val; + } + sumValue += val; + }); + if (maxValue > 1e10) { + unitPostfix = 'b'; + unitScale = 1e-9; + } + else if (maxValue > 1e7) { + unitPostfix = 'm'; + unitScale = 1e-6; + } + else if (maxValue > 1e4) { + unitPostfix = 'k'; + unitScale = 1e-3; + } + else { + unitPostfix = ''; + unitScale = 1; + } + } + + var unitValue = sumValue / (360 - serie.padding); + + graph.eachNode(function (node) { + var startAngle = node.layout.startAngle / Math.PI * 180; + var endAngle = node.layout.endAngle / Math.PI * 180; + var scaleAngle = startAngle; + while (true) { + if ((clockWise && scaleAngle > endAngle) + || (!clockWise && scaleAngle < endAngle) + ) { + break; + } + var theta = scaleAngle / 180 * Math.PI; + var v = [Math.cos(theta), Math.sin(theta)]; + var start = vec2.scale([], v, radius[1] + 1); + vec2.add(start, start, center); + var end = vec2.scale([], v, radius[1] + this.scaleLineLength); + vec2.add(end, end, center); + var scaleShape = new LineShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase() - 1, + hoverable: false, + style: { + xStart: start[0], + yStart: start[1], + xEnd: end[0], + yEnd: end[1], + lineCap: 'round', + brushType: 'stroke', + strokeColor: '#666', lineWidth: 1 } - }; + }); - scaleShape = new LineShape(scaleShape); this.shapeList.push(scaleShape); - scaleAngle += this.scaleUnitAngle; + scaleAngle += sign * this.scaleUnitAngle; } - if (!this.showScaleText) { - continue; + if (!serie.showScaleText) { + return; } - var scaleTextAngle = subStartAngle; + var scaleTextAngle = startAngle; var step = unitValue * 5 * this.scaleUnitAngle; - var scaleValues = NDArray.range(0, values[i], step).toArray(); - while (scaleTextAngle < subEndAngle) { - var thelta = this.clockWise - ? (360 - scaleTextAngle) : scaleTextAngle; - thelta = (thelta + this.startAngle) % 360; - var isRightSide = thelta <= 90 - || thelta >= 270; - var textShape = { - zlevel : this._zlevelBase - 1, - hoverable : false, - style : { - x : isRightSide - ? this.outerRadius + this.scaleLineLength + 4 - : -this.outerRadius - this.scaleLineLength - 4, - y : 0, - text : Math.round(scaleValues.shift()*10)/10 + var scaleValue = 0; + while (true) { + if ((clockWise && scaleTextAngle > endAngle) + || (!clockWise && scaleTextAngle < endAngle) + ) { + break; + } + var theta = scaleTextAngle; + theta = theta % 360; + if (theta < 0) { + theta += 360; + } + var isRightSide = theta <= 90 + || theta >= 270; + + var textShape = new TextShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase() - 1, + hoverable: false, + style: { + x: isRightSide + ? radius[1] + this.scaleLineLength + 4 + : -radius[1] - this.scaleLineLength - 4, + y: 0, + text: Math.round(scaleValue * 10) / 10 + unitPostfix, - textAlign : isRightSide ? 'left' : 'right' + textAlign: isRightSide ? 'left' : 'right' }, - position : this.center.slice(), - rotation : isRightSide - ? [thelta / 180 * Math.PI, 0, 0] + position: center.slice(), + rotation: isRightSide + ? [-theta / 180 * Math.PI, 0, 0] : [ - (thelta + 180) / 180 * Math.PI, + -(theta + 180) / 180 * Math.PI, 0, 0 ] - }; + }); - textShape = new TextShape(textShape); this.shapeList.push(textShape); - scaleTextAngle += this.scaleUnitAngle * 5; - } - } - }, - normalizeValue : function (values) { - var result = []; - var max = new NDArray(values).max(); - var unitPostfix, unitScale; - if (max > 10000) { - unitPostfix = 'k'; - unitScale = 1 / 1000; - } else if (max > 10000000) { - unitPostfix = 'm'; - unitScale = 1 / 1000000; - } else if (max > 10000000000) { - unitPostfix = 'b'; - unitScale = 1 / 1000000000; - } else { - unitPostfix = ''; - unitScale = 1; - } - - for (var i = 0; i < values.length; i++) { - result[i] = values[i] * unitScale; - } - return [result, unitPostfix]; + scaleValue += step * unitScale; + scaleTextAngle += sign * this.scaleUnitAngle * 5; + } + }, this); }, refresh : function (newOption) { @@ -655,36 +1037,6 @@ define(function (require) { this.series = newOption.series; } - /* - this.legend; - this.getColor; - this.isSelected; - this.chordSerieSample; - */ - // Config - this.chordSeries = []; - /* - this.groups; - this.startAngle; - this.clockWise; - this.innerRadius; - this.outerRadius; - this.padding; - this.sortGroups; - this.sortSubGroups; - this.center; - this.showScale; - this.showScaleText; - this.dataMat; - */ - this.strokeFix = 0; - // Adjacency matrix - this.sectorShapes = []; - this.chordShapes = []; - - this.scaleLineLength = 4; - this.scaleUnitAngle = 4; - this.legend = this.component.legend; if (this.legend) { this.getColor = function(param) { @@ -693,42 +1045,16 @@ define(function (require) { this.isSelected = function(param) { return this.legend.isSelected(param); }; - } else { - var colorIndices = {}; + } + else { var colorMap = {}; var count = 0; this.getColor = function (key) { if (colorMap[key]) { return colorMap[key]; } - if (colorIndices[key] === undefined) { - colorIndices[key] = count++; - } - // key is serie name - for (var i = 0; i < this.chordSeries.length; i++) { - if (this.chordSeries[i].name === key) { - colorMap[key] = this.query( - this.chordSeries[i], - 'itemStyle.normal.color' - ); - break; - } - } - if (!colorMap[key]) { - var len = this.groups.length; - // key is group name - for (var i = 0; i < len; i++) { - if (this.groups[i].name === key) { - colorMap[key] = this.query( - this.groups[i], - 'itemStyle.normal.color' - ); - break; - } - } - } if (!colorMap[key]) { - colorMap[key] = this.zr.getColor(colorIndices[key]); + colorMap[key] = this.zr.getColor(count++); } return colorMap[key]; @@ -739,24 +1065,25 @@ define(function (require) { } this.backupShapeList(); - this._buildShape(); + this._init(); }, reformOption : function (opt) { var _merge = zrUtil.merge; opt = _merge( - opt || {}, - this.ecTheme.chord + _merge( + opt || {}, + this.ecTheme.chord + ), + ecConfig.chord ); - opt.itemStyle.normal.label.textStyle = _merge( - opt.itemStyle.normal.label.textStyle || {}, - this.ecTheme.textStyle + opt.itemStyle.normal.label.textStyle = this.getTextStyle( + opt.itemStyle.normal.label.textStyle ); } }; zrUtil.inherits(Chord, ChartBase); - zrUtil.inherits(Chord, ComponentBase); // 图表注册 require('../chart').define('chord', Chord); diff --git a/amd/chart/eventRiver.js b/amd/chart/eventRiver.js new file mode 100644 index 0000000..6df8ead --- /dev/null +++ b/amd/chart/eventRiver.js @@ -0,0 +1,304 @@ +/** + * echarts图表类:事件河流图 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author clmtulip (车丽美, clmtulip@gmail.com) + * + */ +define(function (require) { + var ChartBase = require('./base'); + + var eventRiverLayout = require('../layout/eventRiver'); + + // 图形依赖 + var PolygonShape = require('../zrender/shape/Polygon'); + + // 组件依赖 + require('../component/axis'); + require('../component/grid'); + require('../component/dataZoom'); + + var ecConfig = require('../config'); + // 事件河流图默认参数 + ecConfig.eventRiver = { + zlevel: 0, // 一级层叠 + z: 2, // 二级层叠 + clickable: true, + legendHoverLink: true, + itemStyle: { + normal: { + // color: 各异, + borderColor: 'rgba(0,0,0,0)', + borderWidth: 1, + label: { + show: true, + position: 'inside', // 可选为'left'|'right'|'top'|'bottom' + formatter: '{b}' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + } + }, + emphasis: { + // color: 各异, + borderColor: 'rgba(0,0,0,0)', + borderWidth: 1, + label: { + show: true + } + } + } + }; + + var ecData = require('../util/ecData'); + var ecDate = require('../util/date'); + var zrUtil = require('../zrender/tool/util'); + var zrColor = require('../zrender/tool/color'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} option 数据 + * @param {Object} component 组件 + */ + function EventRiver(ecTheme, messageCenter, zr, option, myChart) { + // 图表基类 + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); + + var self = this; + self._ondragend = function () { + self.isDragend = true; + }; + this.refresh(option); + } + + EventRiver.prototype = { + type: ecConfig.CHART_TYPE_EVENTRIVER, + + _buildShape: function() { + var series = this.series; + this.selectedMap = {}; + + // 数据预处理 + this._dataPreprocessing(); + + var legend = this.component.legend; + // 调用布局算法计算事件在Y轴上的位置 + var eventRiverSeries = []; + for (var i = 0; i < series.length; i++) { + if (series[i].type === this.type) { + series[i] = this.reformOption(series[i]); + this.legendHoverLink = series[i].legendHoverLink || this.legendHoverLink; + var serieName = series[i].name || ''; + // 系列图例开关 + this.selectedMap[serieName] = legend ? legend.isSelected(serieName) : true; + if (!this.selectedMap[serieName]) { + continue; + } + this.buildMark(i); + eventRiverSeries.push(this.series[i]); + } + } + + eventRiverLayout( + eventRiverSeries, + this._intervalX, + this.component.grid.getArea() + ); + + // 绘制事件河 + this._drawEventRiver(); + + this.addShapeList(); + }, + + /** + * 处理数据 + */ + _dataPreprocessing: function() { + // 将年月日的时间转化为平面坐标 + var series = this.series; + var xAxis; + var evolutionList; + for (var i = 0, iLen = series.length; i < iLen; i++) { + if (series[i].type === this.type) { + xAxis = this.component.xAxis.getAxis(series[i].xAxisIndex || 0); + for (var j = 0, jLen = series[i].eventList.length; j < jLen; j++) { + evolutionList = series[i].eventList[j].evolution; + for (var k = 0, kLen = evolutionList.length; k < kLen; k++) { + evolutionList[k].timeScale = xAxis.getCoord( + ecDate.getNewDate(evolutionList[k].time) - 0 + ); + // evolutionList[k].valueScale = evolutionList[k].value; + // modified by limei.che, to normalize the value range + evolutionList[k].valueScale = Math.pow(evolutionList[k].value, 0.8); + } + } + } + } + // 尾迹长度 + this._intervalX = Math.round(this.component.grid.getWidth() / 40); + }, + + /** + * 绘制事件河流 + */ + _drawEventRiver: function(){ + var series = this.series; + for (var i = 0; i < series.length; i++) { + var serieName = series[i].name || ''; + if (series[i].type === this.type && this.selectedMap[serieName]) { + for (var j = 0; j < series[i].eventList.length; j++) { + this._drawEventBubble(series[i].eventList[j], i, j); + } + } + } + }, + + /** + * 绘制气泡图 + */ + _drawEventBubble: function(oneEvent, seriesIndex, dataIndex) { + var series = this.series; + var serie = series[seriesIndex]; + var serieName = serie.name || ''; + var data = serie.eventList[dataIndex]; + var queryTarget = [data, serie]; + + var legend = this.component.legend; + var defaultColor = legend ? legend.getColor(serieName) : this.zr.getColor(seriesIndex); + + // 多级控制 + var normal = this.deepMerge(queryTarget, 'itemStyle.normal') || {}; + var emphasis = this.deepMerge(queryTarget, 'itemStyle.emphasis') || {}; + var normalColor = this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) + || defaultColor; + + var emphasisColor = this.getItemStyleColor( + emphasis.color, seriesIndex, dataIndex, data + ) + || (typeof normalColor === 'string' + ? zrColor.lift(normalColor, -0.2) + : normalColor + ); + + var pts = this._calculateControlPoints(oneEvent); + + var eventBubbleShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + clickable: this.deepQuery(queryTarget, 'clickable'), + style: { + pointList: pts, + smooth: 'spline', + brushType: 'both', + lineJoin : 'round', + color: normalColor, + lineWidth: normal.borderWidth, + strokeColor: normal.borderColor + }, + highlightStyle:{ + color: emphasisColor, + lineWidth: emphasis.borderWidth, + strokeColor: emphasis.borderColor + }, + draggable: 'vertical', + ondragend : this._ondragend + }; + + eventBubbleShape = new PolygonShape(eventBubbleShape); + + this.addLabel(eventBubbleShape, serie, data, oneEvent.name); + ecData.pack( + eventBubbleShape, + series[seriesIndex], seriesIndex, + series[seriesIndex].eventList[dataIndex], dataIndex, + series[seriesIndex].eventList[dataIndex].name + ); + this.shapeList.push(eventBubbleShape); + }, + + /** + * 根据时间-热度,计算气泡形状的控制点 + */ + _calculateControlPoints: function(oneEvent) { + var intervalX = this._intervalX; + var posY = oneEvent.y; + + var evolution = oneEvent.evolution; + var n = evolution.length; + if (n < 1) { + return; + } + + var time = []; + var value = []; + for (var i = 0; i < n; i++) { + time.push(evolution[i].timeScale); + value.push(evolution[i].valueScale); + } + + var pts = []; + + // 从左向右绘制气泡的上半部分控制点 + // 第一个矩形的左端点 + pts.push([time[0], posY]); + // 从一个矩形 到 倒数第二个矩形 上半部分的中点 + var i = 0; + for (i = 0; i < n - 1; i++) { + pts.push([(time[i] + time[i + 1]) / 2.0, value[i] / -2.0 + posY]); + } + // 最后一个矩形上半部分的中点 + pts.push([(time[i] + (time[i] + intervalX)) / 2.0, value[i] / -2.0 + posY]); + // 最后一个矩形的右端点 + pts.push([time[i] + intervalX, posY]); + + // 从右向左绘制气泡的下半部分控制点 + // 最后一个矩形下半部分的中点 + pts.push([(time[i] + (time[i] + intervalX)) / 2.0, value[i] / 2.0 + posY]); + // 从倒数第二个矩形 到 一个矩形 下半部分的中点,由于polygon是闭合的,故不需要再加入左端点 + for (i = n - 1; i > 0; i--) { + pts.push([(time[i] + time[i - 1]) / 2.0, value[i - 1] / 2.0 + posY]); + } + + return pts; + }, + + /** + * 数据项被拖拽出去 + */ + ondragend : function (param, status) { + if (!this.isDragend || !param.target) { + // 没有在当前实例上发生拖拽行为则直接返回 + return; + } + + // 别status = {}赋值啊!! + status.dragOut = true; + status.dragIn = true; + status.needRefresh = false; // 会有消息触发fresh,不用再刷一遍 + // 处理完拖拽事件后复位 + this.isDragend = false; + }, + + /** + * 刷新 + */ + refresh: function(newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + + this.backupShapeList(); + this._buildShape(); + } + + }; + + zrUtil.inherits(EventRiver, ChartBase); + + // 图表注册 + require('../chart').define('eventRiver', EventRiver); + + return EventRiver; +}); \ No newline at end of file diff --git a/amd/chart/force.js b/amd/chart/force.js index cb199de..00ffe25 100644 --- a/amd/chart/force.js +++ b/amd/chart/force.js @@ -8,48 +8,133 @@ define(function (require) { 'use strict'; - var ComponentBase = require('../component/base'); var ChartBase = require('./base'); - var ForceLayout = require('./forceLayoutWorker'); + var Graph = require('../data/Graph'); + var ForceLayout = require('../layout/Force'); // 图形依赖 var LineShape = require('../zrender/shape/Line'); + var BezierCurveShape = require('../zrender/shape/BezierCurve'); + var ImageShape = require('../zrender/shape/Image'); var IconShape = require('../util/shape/Icon'); var ecConfig = require('../config'); + // 力导向布局图默认参数 + ecConfig.force = { + zlevel: 1, // 一级层叠 + z: 2, // 二级层叠 + // 布局中心 + center: ['50%', '50%'], + + // 布局大小 + size: '100%', + + // 防止节点和节点,节点和边之间的重叠 + preventOverlap: false, + + // 布局冷却因子,值越小结束时间越短,值越大时间越长但是结果也越收敛 + coolDown: 0.99, + + // 数据映射到圆的半径的最小值和最大值 + minRadius: 10, + maxRadius: 20, + + // 是否根据屏幕比例拉伸 + ratioScaling: false, + + // 在 500+ 顶点的图上建议设置 large 为 true, 会使用 Barnes-Hut simulation + // 同时开启 useWorker 并且把 steps 值调大 + // 关于Barnes-Hut simulation: http://en.wikipedia.org/wiki/Barnes–Hut_simulation + large: false, + + // 是否在浏览器支持 worker 的时候使用 web worker + useWorker: false, + // 每一帧 force 迭代的次数,仅在启用webworker的情况下有用 + steps: 1, + + // 布局缩放因子,并不完全精确, 效果跟布局大小类似 + scaling: 1.0, + + // 向心力因子,越大向心力越大( 所有顶点会往 center 的位置收拢 ) + gravity: 1, + + symbol: 'circle', + // symbolSize 为 0 的话使用映射到minRadius-maxRadius后的值 + symbolSize: 0, + + linkSymbol: null, + linkSymbolSize: [10, 15], + draggable: true, + clickable: true, + + roam: false, + + // 分类里如果有样式会覆盖节点默认样式 + // categories: [{ + // itemStyle + // symbol + // symbolSize + // name + // }], + itemStyle: { + normal: { + // color: 各异, + label: { + show: false, + position: 'inside' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + }, + nodeStyle: { + brushType : 'both', + borderColor : '#5182ab', + borderWidth: 1 + }, + linkStyle: { + color: '#5182ab', + width: 1, + type: 'line' + } + }, + emphasis: { + // color: 各异, + label: { + show: false + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + }, + nodeStyle: {}, + linkStyle: { + opacity: 0 + } + } + } + // nodes: [{ + // name: 'xxx', + // value: 1, + // itemStyle: {}, + // initial: [0, 0], + // fixX: false, + // fixY: false, + // ignore: false, + // symbol: 'circle', + // symbolSize: 0 + // }] + // links: [{ + // source: 1, + // target: 2, + // weight: 1, + // itemStyle: {} + // }, { + // source: 'xxx', + // target: 'ooo' + // }] + }; + var ecData = require('../util/ecData'); var zrUtil = require('../zrender/tool/util'); var zrConfig = require('../zrender/config'); var vec2 = require('../zrender/tool/vector'); - var NDArray = require('../util/ndarray'); - var ArrayCtor = typeof(Float32Array) == 'undefined' ? Array : Float32Array; - - var requestAnimationFrame = window.requestAnimationFrame - || window.msRequestAnimationFrame - || window.mozRequestAnimationFrame - || window.webkitRequestAnimationFrame - || function (func){setTimeout(func, 16);}; - - // Use inline web worker - var workerUrl; - if ( - typeof(Worker) !== 'undefined' && - typeof(Blob) !== 'undefined' - ) { - try { - var blob = new Blob([ForceLayout.getWorkerCode()]); - workerUrl = window.URL.createObjectURL(blob); - } catch(e) { - workerUrl = ''; - } - } - - function getToken() { - return Math.round(new Date().getTime() / 100) % 10000000; - } - /** * 构造函数 * @param {Object} messageCenter echart消息中心 @@ -59,27 +144,20 @@ define(function (require) { */ function Force(ecTheme, messageCenter, zr, option, myChart) { var self = this; - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); // 图表基类 - ChartBase.call(this); + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); // 保存节点的位置,改变数据时能够有更好的动画效果 - // TODO this.__nodePositionMap = {}; - this._nodeShapes = []; - this._linkShapes = []; + this._graph = new Graph(true); + this._layout = new ForceLayout(); - this._updating = true; - - this._filteredNodes = null; - this._filteredLinks = null; - this._rawNodes = null; - this._rawLinks = null; + this._layout.onupdate = function() { + self._step(); + }; this._steps = 1; - this._coolDown = 0.99; // 关闭可拖拽属性 this.ondragstart = function() { @@ -95,7 +173,8 @@ define(function (require) { this.onmousemove = function() { onmousemove.apply(self, arguments); }; - this._init(); + + this.refresh(option); } /** @@ -108,52 +187,12 @@ define(function (require) { type : ecConfig.CHART_TYPE_FORCE, _init: function() { - var self = this; - - this.clear(); - - this._updating = true; - - this._buildShape(); - - if (this._layoutWorker) { - this._layoutWorker.onmessage = function(e) { - if (self._temperature < 0.01) { - requestAnimationFrame(function() { - self._step.call(self, e); - }); - } else { - self._step.call(self, e); - } - }; - - this._layoutWorker.postMessage({ - cmd: 'update', - steps: this._steps, - temperature: this._temperature, - coolDown: this._coolDown - }); - } - else { - var cb = function() { - if (self._updating) { - self._step(); - requestAnimationFrame(cb); - } - }; - - requestAnimationFrame(cb); - } - }, - - _buildShape: function() { + // var self = this; var legend = this.component.legend; var series = this.series; var serieName; - this._temperature = 1; - - this.shapeList.length = 0; + this.clear(); for (var i = 0, l = series.length; i < l; i++) { var serie = series[i]; @@ -161,28 +200,6 @@ define(function (require) { series[i] = this.reformOption(series[i]); serieName = series[i].name || ''; - if (workerUrl && serie.useWorker) { - try { - if (!this._layoutWorker) { - this._layoutWorker = new Worker(workerUrl); - } - this._layout = null; - } catch(e) { // IE10-11 will throw security error when using blog url - this._layoutWorker = null; - if (!this._layout) { - this._layout = new ForceLayout(); - } - } - } else { - if (!this._layout) { - this._layout = new ForceLayout(); - } - if (this._layoutWorker) { - this._layoutWorker.terminate(); - this._layoutWorker = null; - } - } - // 系列图例开关 this.selectedMap[serieName] = legend ? legend.isSelected(serieName) : true; @@ -192,301 +209,375 @@ define(function (require) { this.buildMark(i); - // 同步selected状态 - var categories = serie.categories; - for (var j = 0, len = categories.length; j < len; j++) { - if (categories[j].name) { - if (legend){ - this.selectedMap[j] = - legend.isSelected(categories[j].name); - } else { - this.selectedMap[j] = true; - } - } - } + // TODO 多个 force + this._initSerie(serie, i); + break; + } + } - this._preProcessData(serie); + this.animationEffect(); + }, - this._nodeShapes.length = 0; - this._linkShapes.length = 0; + _getNodeCategory: function (serie, node) { + return serie.categories && serie.categories[node.category || 0]; + }, - this._buildLinkShapes(serie); - this._buildNodeShapes(serie); + _getNodeQueryTarget: function (serie, node, type) { + type = type || 'normal'; + var category = this._getNodeCategory(serie, node) || {}; + return [ + // Node + node.itemStyle && node.itemStyle[type], + // Category + category && category.itemStyle && category.itemStyle[type], + // Serie + serie.itemStyle[type].nodeStyle + ]; + }, - this._initLayout(serie); + _getEdgeQueryTarget: function (serie, edge, type) { + type = type || 'normal'; + return [ + (edge.itemStyle && edge.itemStyle[type]), + serie.itemStyle[type].linkStyle + ]; + }, - this._updateLinkShapes(); + _initSerie: function(serie, serieIdx) { + this._temperature = 1; - // TODO 多个 force - this._forceSerie = serie; - break; - } + // data-matrix 表示数据 + if (serie.data) { + this._graph = this._getSerieGraphFromDataMatrix(serie); + } + // node-links 表示数据 + else { + this._graph = this._getSerieGraphFromNodeLinks(serie); } - }, - _preProcessData: function(serie) { - this._rawNodes = this.query(serie, 'nodes'); - this._rawLinks = zrUtil.clone(this.query(serie, 'links')); + this._buildLinkShapes(serie, serieIdx); + this._buildNodeShapes(serie, serieIdx); - var filteredNodeList = []; - var filteredNodeMap = {}; - var cursor = 0; - var self = this; - this._filteredNodes = _filter(this._rawNodes, function (node, i) { - if (!node) { - return; - } - if (node.ignore) { - return; + var panable = serie.roam === true || serie.roam === 'move'; + var zoomable = serie.roam === true || serie.roam === 'scale'; + // Enable pan and zooom + this.zr.modLayer(this.getZlevelBase(), { + panable: panable, + zoomable: zoomable + }); + + if ( + this.query('markPoint.effect.show') + || this.query('markLine.effect.show') + ) { + // 斗胆修改 EFFECT 层配置项 + this.zr.modLayer(ecConfig.EFFECT_ZLEVEL, { + panable: panable, + zoomable: zoomable + }); + } + + this._initLayout(serie); + + this._step(); + }, + + _getSerieGraphFromDataMatrix: function (serie) { + var nodesData = []; + var count = 0; + var matrix = []; + // 复制一份新的matrix + for (var i = 0; i < serie.matrix.length; i++) { + matrix[i] = serie.matrix[i].slice(); + } + var data = serie.data || serie.nodes; + for (var i = 0; i < data.length; i++) { + var node = {}; + var group = data[i]; + for (var key in group) { + // name改为id + if (key === 'name') { + node['id'] = group['name']; + } + else { + node[key] = group[key]; + } } - var idx = -1; - if ( - typeof(node.category) == 'undefined' - || self.selectedMap[node.category] - ) { - idx = cursor++; + // legends 选择优先级 category -> group + var category = this._getNodeCategory(serie, group); + var name = category ? category.name : group.name; + + this.selectedMap[name] = this.isSelected(name); + if (this.selectedMap[name]) { + nodesData.push(node); + count++; } - if (node.name) { - filteredNodeMap[node.name] = idx; + else { + // 过滤legend未选中的数据 + matrix.splice(count, 1); + for (var j = 0; j < matrix.length; j++) { + matrix[j].splice(count, 1); + } } - filteredNodeList[i] = idx; + } + + var graph = Graph.fromMatrix(nodesData, matrix, true); - return idx >= 0; + // Prepare layout parameters + graph.eachNode(function (n, idx) { + n.layout = { + size: n.data.value, + mass: 0 + }; + n.rawIndex = idx; }); - var source; - var target; - this._filteredLinks = _filter(this._rawLinks, function (link, i){ - source = link.source; - target = link.target; - var ret = true; - var idx = typeof(source) === 'string' - ? filteredNodeMap[source] // source 用 node id 表示 - : filteredNodeList[source]; // source 用 node index 表示 - if (typeof(idx) == 'undefined') { - idx = -1; - } - - if (idx >= 0) { - link.source = idx; - } else { - ret = false; - } + graph.eachEdge(function (e) { + e.layout = { + weight: e.data.weight + }; + }); + + return graph; + }, - var idx = typeof(target) === 'string' - ? filteredNodeMap[target] // target 用 node id 表示 - : filteredNodeList[target]; // target 用 node index 表示 - if (typeof(idx) == 'undefined') { - idx = -1; + _getSerieGraphFromNodeLinks: function (serie) { + var graph = new Graph(true); + var nodes = serie.data || serie.nodes; + for (var i = 0, len = nodes.length; i < len; i++) { + var n = nodes[i]; + if (!n || n.ignore) { + continue; } + // legends 选择优先级 category -> group + var category = this._getNodeCategory(serie, n); + var name = category ? category.name : n.name; + + this.selectedMap[name] = this.isSelected(name); + if (this.selectedMap[name]) { + var node = graph.addNode(n.name, n); + node.rawIndex = i; + } + } - if (idx >= 0) { - link.target = idx; - } else { - ret = false; + for (var i = 0, len = serie.links.length; i < len; i++) { + var e = serie.links[i]; + var n1 = e.source; + var n2 = e.target; + if (typeof(n1) === 'number') { + n1 = nodes[n1]; + if (n1) { + n1 = n1.name; + } + } + if (typeof(n2) === 'number') { + n2 = nodes[n2]; + if (n2) { + n2 = n2.name; + } } - // 保存原始链接中的index - link.rawIndex = i; + var edge = graph.addEdge(n1, n2, e); + if (edge) { + edge.rawIndex = i; + } + } - return ret; + graph.eachNode(function (n) { + var value = n.data.value; + if (value == null) { // value 是 null 或者 undefined + value = 0; + // 默认使用所有边值的和作为节点的大小, 不修改 data 里的数值 + for (var i = 0; i < n.edges.length; i++) { + value += n.edges[i].data.weight || 0; + } + } + n.layout = { + size: value, + mass: 0 + }; + }); + graph.eachEdge(function (e) { + e.layout = { + // 默认 weight 为1 + weight: e.data.weight == null ? 1 : e.data.weight + }; }); + + return graph; }, _initLayout: function(serie) { - - var nodes = this._filteredNodes; - var links = this._filteredLinks; - var shapes = this._nodeShapes; - var len = nodes.length; + var graph = this._graph; + var len = graph.nodes.length; var minRadius = this.query(serie, 'minRadius'); var maxRadius = this.query(serie, 'maxRadius'); + this._steps = serie.steps || 1; - this._coolDown = serie.coolDown || 0.99; - var center = this.parseCenter(this.zr, serie.center); - var width = this.parsePercent(serie.size, this.zr.getWidth()); - var height = this.parsePercent(serie.size, this.zr.getHeight()); - var size = Math.min(width, height); + this._layout.center = this.parseCenter(this.zr, serie.center); + this._layout.width = this.parsePercent(serie.size, this.zr.getWidth()); + this._layout.height = this.parsePercent(serie.size, this.zr.getHeight()); + + this._layout.large = serie.large; + this._layout.scaling = serie.scaling; + this._layout.ratioScaling = serie.ratioScaling; + this._layout.gravity = serie.gravity; + this._layout.temperature = 1; + this._layout.coolDown = serie.coolDown; + this._layout.preventNodeEdgeOverlap = serie.preventOverlap; + this._layout.preventNodeOverlap = serie.preventOverlap; // 将值映射到minRadius-maxRadius的范围上 - var radius = []; + var min = Infinity; var max = -Infinity; for (var i = 0; i < len; i++) { - var node = nodes[i]; - radius.push(node.value || 1); + var gNode = graph.nodes[i]; + max = Math.max(gNode.layout.size, max); + min = Math.min(gNode.layout.size, min); } - - var arr = new NDArray(radius); - radius = arr.map(minRadius, maxRadius).toArray(); - var max = arr.max(); - if (max === 0) { - return; + var divider = max - min; + for (var i = 0; i < len; i++) { + var gNode = graph.nodes[i]; + if (divider > 0) { + gNode.layout.size = + (gNode.layout.size - min) * (maxRadius - minRadius) / divider + + minRadius; + // 节点质量是归一的 + gNode.layout.mass = gNode.layout.size / maxRadius; + } else { + gNode.layout.size = (maxRadius - minRadius) / 2; + gNode.layout.mass = 0.5; + } } - var massArr = arr.mul(1/max, arr).toArray(); - var positionArr = new ArrayCtor(len * 2); for (var i = 0; i < len; i++) { - var initPos; - var node = nodes[i]; - if (typeof(this.__nodePositionMap[node.name]) !== 'undefined') { - initPos = vec2.create(); - vec2.copy(initPos, this.__nodePositionMap[node.name]); - } else if (typeof(node.initial) !== 'undefined') { - initPos = Array.prototype.slice.call(node.initial); - } else { - initPos = _randomInSquare( + // var initPos; + var gNode = graph.nodes[i]; + if (typeof(this.__nodePositionMap[gNode.id]) !== 'undefined') { + gNode.layout.position = vec2.create(); + vec2.copy(gNode.layout.position, this.__nodePositionMap[gNode.id]); + } + else if (typeof(gNode.data.initial) !== 'undefined') { + gNode.layout.position = vec2.create(); + vec2.copy(gNode.layout.position, gNode.data.initial); + } + else { + var center = this._layout.center; + var size = Math.min(this._layout.width, this._layout.height); + gNode.layout.position = _randomInSquare( center[0], center[1], size * 0.8 ); } - var style = shapes[i].style; - style.width = style.width || (radius[i] * 2); - style.height = style.height || (radius[i] * 2); + var style = gNode.shape.style; + var radius = gNode.layout.size; + style.width = style.width || (radius * 2); + style.height = style.height || (radius * 2); style.x = -style.width / 2; style.y = -style.height / 2; - shapes[i].position = initPos; - - positionArr[i * 2] = initPos[0]; - positionArr[i * 2 + 1] = initPos[1]; + vec2.copy(gNode.shape.position, gNode.layout.position); } - len = links.length; - var edgeArr = new ArrayCtor(len * 2); - var edgeWeightArr = new ArrayCtor(len); + // 边 + len = graph.edges.length; + max = -Infinity; for (var i = 0; i < len; i++) { - var link = links[i]; - edgeArr[i * 2] = link.source; - edgeArr[i * 2 + 1] = link.target; - edgeWeightArr[i] = link.weight || 1; + var e = graph.edges[i]; + if (e.layout.weight > max) { + max = e.layout.weight; + } } - - arr = new NDArray(edgeWeightArr); - var max = arr.max(); - if (max === 0) { - return; + // 权重归一 + for (var i = 0; i < len; i++) { + var e = graph.edges[i]; + e.layout.weight /= max; } - var edgeWeightArr = arr.mul(1 / max, arr)._array; - - var config = { - center: center, - width: serie.ratioScaling ? width : size, - height: serie.ratioScaling ? height : size, - scaling: serie.scaling || 1.0, - gravity: serie.gravity || 1.0, - barnesHutOptimize: serie.large - }; - - if (this._layoutWorker) { - - this._token = getToken(); - - this._layoutWorker.postMessage({ - cmd: 'init', - nodesPosition: positionArr, - nodesMass: massArr, - nodesSize: radius, - edges: edgeArr, - edgesWeight: edgeWeightArr, - token: this._token - }); - - this._layoutWorker.postMessage({ - cmd: 'updateConfig', - config: config - }); - } else { - - zrUtil.merge(this._layout, config, true); - this._layout.initNodes(positionArr, massArr, radius); - this._layout.initEdges(edgeArr, edgeWeightArr); - } + this._layout.init(graph, serie.useWorker); }, - _buildNodeShapes: function(serie) { + _buildNodeShapes: function(serie, serieIdx) { + var graph = this._graph; + var categories = this.query(serie, 'categories'); - var nodes = this._filteredNodes; - var len = nodes.length; - var legend = this.component.legend; - for (var i = 0; i < len; i++) { - var node = nodes[i]; + graph.eachNode(function (node) { + var category = this._getNodeCategory(serie, node.data); + var queryTarget = [node.data, category, serie]; + var styleQueryTarget = this._getNodeQueryTarget(serie, node.data); + var emphasisStyleQueryTarget = this._getNodeQueryTarget( + serie, node.data, 'emphasis' + ); var shape = new IconShape({ - style : { - x : 0, - y : 0 + style: { + x: 0, + y: 0, + color: this.deepQuery(styleQueryTarget, 'color'), + brushType: 'both', + // 兼容原有写法 + strokeColor: this.deepQuery(styleQueryTarget, 'strokeColor') + || this.deepQuery(styleQueryTarget, 'borderColor'), + lineWidth: this.deepQuery(styleQueryTarget, 'lineWidth') + || this.deepQuery(styleQueryTarget, 'borderWidth') + }, + highlightStyle: { + color: this.deepQuery(emphasisStyleQueryTarget, 'color'), + // 兼容原有写法 + strokeColor: this.deepQuery(emphasisStyleQueryTarget, 'strokeColor') + || this.deepQuery(emphasisStyleQueryTarget, 'borderColor'), + lineWidth: this.deepQuery(emphasisStyleQueryTarget, 'lineWidth') + || this.deepQuery(emphasisStyleQueryTarget, 'borderWidth') }, - clickable : true, - highlightStyle : {} + clickable: serie.clickable, + zlevel: this.getZlevelBase(), + z: this.getZBase() }); - - var queryTarget = []; - var shapeNormalStyle = []; - var shapeEmphasisStyle = []; - - queryTarget.push(node); - if (node.itemStyle) { - shapeNormalStyle.push(node.itemStyle.normal); - shapeEmphasisStyle.push(node.itemStyle.emphasis); - } - if (typeof(node.category) !== 'undefined') { - var category = categories[node.category]; - if (category) { - // 使用 Legend.getColor 配置默认 category 的默认颜色 - category.itemStyle = category.itemStyle || {}; - category.itemStyle.normal = category.itemStyle.normal || {}; - category.itemStyle.normal.color = category.itemStyle.normal.color - || legend.getColor(category.name); - - queryTarget.push(category); - shapeNormalStyle.unshift(category.itemStyle.normal); - shapeEmphasisStyle.unshift(category.itemStyle.emphasis); - } + if (!shape.style.color) { + shape.style.color = category + ? this.getColor(category.name) : this.getColor(node.id); } - queryTarget.push(serie); - shapeNormalStyle.unshift(serie.itemStyle.normal.nodeStyle); - shapeEmphasisStyle.unshift(serie.itemStyle.emphasis.nodeStyle); shape.style.iconType = this.deepQuery(queryTarget, 'symbol'); // 强制设定节点大小,否则默认映射到 minRadius 到 maxRadius 后的值 shape.style.width = shape.style.height = (this.deepQuery(queryTarget, 'symbolSize') || 0) * 2; - // 节点样式 - for (var k = 0; k < shapeNormalStyle.length; k++) { - if (shapeNormalStyle[k]) { - zrUtil.merge(shape.style, shapeNormalStyle[k], true); - } - } - // 节点高亮样式 - for (var k = 0; k < shapeEmphasisStyle.length; k++) { - if (shapeEmphasisStyle[k]) { - zrUtil.merge(shape.highlightStyle, shapeEmphasisStyle[k], true); - } - } + if (shape.style.iconType.match('image')) { + shape.style.image = shape.style.iconType.replace( + new RegExp('^image:\\/\\/'), '' + ); + shape = new ImageShape({ + style: shape.style, + highlightStyle: shape.highlightStyle, + clickable: shape.clickable, + zlevel: this.getZlevelBase(), + z: this.getZBase() + }); + } // 节点标签样式 if (this.deepQuery(queryTarget, 'itemStyle.normal.label.show')) { - shape.style.text = node.name; - shape.style.textPosition = 'inside'; - var labelStyle = this.deepQuery( + shape.style.text = node.data.label == null ? node.id : node.data.label; + shape.style.textPosition = this.deepQuery( + queryTarget, 'itemStyle.normal.label.position' + ) ; + shape.style.textColor = this.deepQuery( + queryTarget, 'itemStyle.normal.label.textStyle.color' + ); + shape.style.textFont = this.getFont(this.deepQuery( queryTarget, 'itemStyle.normal.label.textStyle' - ) || {}; - shape.style.textColor = labelStyle.color || '#fff'; - shape.style.textAlign = labelStyle.align || 'center'; - shape.style.textBaseline = labelStyle.baseline || 'middle'; - shape.style.textFont = this.getFont(labelStyle); + ) || {}); } if (this.deepQuery(queryTarget, 'itemStyle.emphasis.label.show')) { - shape.highlightStyle.text = node.name; - shape.highlightStyle.textPosition = 'inside'; - var labelStyle = this.deepQuery( + shape.highlightStyle.textPosition = this.deepQuery( + queryTarget, 'itemStyle.emphasis.label.position' + ); + shape.highlightStyle.textColor = this.deepQuery( + queryTarget, 'itemStyle.emphasis.label.textStyle.color' + ); + shape.highlightStyle.textFont = this.getFont(this.deepQuery( queryTarget, 'itemStyle.emphasis.label.textStyle' - ) || {}; - shape.highlightStyle.textColor = labelStyle.color || '#fff'; - shape.highlightStyle.textAlign = labelStyle.align || 'center'; - shape.highlightStyle.textBaseline = labelStyle.baseline || 'middle'; - shape.highlightStyle.textFont = this.getFont(labelStyle); + ) || {}); } // 拖拽特性 @@ -506,49 +597,55 @@ define(function (require) { // !!Pack data before addShape ecData.pack( shape, - // category - { - name : categoryName - }, - // series index - 0, + serie, + serieIdx, // data - node, + node.data, // data index - zrUtil.indexOf(this._rawNodes, node), + node.rawIndex, // name - node.name || '', - // value - node.value + node.data.name || '', + // category + // special + node.category ); - this._nodeShapes.push(shape); this.shapeList.push(shape); this.zr.addShape(shape); - } - }, - _buildLinkShapes: function(serie) { + node.shape = shape; + }, this); + }, - var nodes = this._filteredNodes; - var links = this._filteredLinks; - var len = links.length; + _buildLinkShapes: function(serie, serieIdx) { + var graph = this._graph; + var len = graph.edges.length; for (var i = 0; i < len; i++) { - var link = links[i]; - var source = nodes[link.source]; - var target = nodes[link.target]; + var gEdge = graph.edges[i]; + var link = gEdge.data; + var source = gEdge.node1; + var target = gEdge.node2; + + var queryTarget = this._getEdgeQueryTarget(serie, link); + var linkType = this.deepQuery(queryTarget, 'type'); + // TODO 暂时只有线段支持箭头 + if (serie.linkSymbol && serie.linkSymbol !== 'none') { + linkType = 'line'; + } + var LinkShapeCtor = linkType === 'line' ? LineShape : BezierCurveShape; - var linkShape = new LineShape({ + var linkShape = new LinkShapeCtor({ style : { xStart : 0, yStart : 0, xEnd : 0, - yEnd : 0, - lineWidth : 1 + yEnd : 0 }, - clickable : true, - highlightStyle : {} + clickable: this.query(serie, 'clickable'), + highlightStyle : {}, + zlevel: this.getZlevelBase(), + z: this.getZBase() }); zrUtil.merge( @@ -574,33 +671,39 @@ define(function (require) { } } - var link = this._rawLinks[link.rawIndex]; + // 兼容原有写法 + linkShape.style.lineWidth + = linkShape.style.lineWidth || linkShape.style.width; + linkShape.style.strokeColor + = linkShape.style.strokeColor || linkShape.style.color; + linkShape.highlightStyle.lineWidth + = linkShape.highlightStyle.lineWidth || linkShape.highlightStyle.width; + linkShape.highlightStyle.strokeColor + = linkShape.highlightStyle.strokeColor || linkShape.highlightStyle.color; + ecData.pack( linkShape, // serie serie, // serie index - 0, + serieIdx, // link data - { - source : link.source, - target : link.target, - weight : link.weight || 0 - }, + gEdge.data, // link data index - link.rawIndex, + gEdge.rawIndex == null ? i : gEdge.rawIndex, // source name - target name - source.name + ' - ' + target.name, - // link weight - link.weight || 0, + gEdge.data.name || (source.id + ' - ' + target.id), + // link source id // special - // 这一项只是为了表明这是条边 - true + source.id, + // link target id + // special2 + target.id ); - this._linkShapes.push(linkShape); this.shapeList.push(linkShape); this.zr.addShape(linkShape); + gEdge.shape = linkShape; // Arrow shape if (serie.linkSymbol && serie.linkSymbol !== 'none') { @@ -613,12 +716,7 @@ define(function (require) { iconType: serie.linkSymbol, brushType: 'fill', // Use same style with link shape - color: linkShape.style.strokeColor, - opacity: linkShape.style.opacity, - shadowBlur: linkShape.style.shadowBlur, - shadowColor: linkShape.style.shadowColor, - shadowOffsetX: linkShape.style.shadowOffsetX, - shadowOffsetY: linkShape.style.shadowOffsetY + color: linkShape.style.strokeColor }, highlightStyle: { brushType: 'fill' @@ -635,22 +733,29 @@ define(function (require) { _updateLinkShapes: function() { var v = vec2.create(); - var links = this._filteredLinks; - for (var i = 0, len = links.length; i < len; i++) { - var link = links[i]; - var linkShape = this._linkShapes[i]; - var sourceShape = this._nodeShapes[link.source]; - var targetShape = this._nodeShapes[link.target]; - - linkShape.style.xStart = sourceShape.position[0]; - linkShape.style.yStart = sourceShape.position[1]; - linkShape.style.xEnd = targetShape.position[0]; - linkShape.style.yEnd = targetShape.position[1]; - - this.zr.modShape(linkShape.id); - - if (linkShape._symbolShape) { - var symbolShape = linkShape._symbolShape; + var edges = this._graph.edges; + for (var i = 0, len = edges.length; i < len; i++) { + var edge = edges[i]; + var sourceShape = edge.node1.shape; + var targetShape = edge.node2.shape; + + var p1 = sourceShape.position; + var p2 = targetShape.position; + + edge.shape.style.xStart = p1[0]; + edge.shape.style.yStart = p1[1]; + edge.shape.style.xEnd = p2[0]; + edge.shape.style.yEnd = p2[1]; + + if (edge.shape.type === 'bezier-curve') { + edge.shape.style.cpX1 = (p1[0] + p2[0]) / 2 - (p2[1] - p1[1]) / 4; + edge.shape.style.cpY1 = (p1[1] + p2[1]) / 2 - (p1[0] - p2[0]) / 4; + } + + edge.shape.modSelf(); + + if (edge.shape._symbolShape) { + var symbolShape = edge.shape._symbolShape; vec2.copy(symbolShape.position, targetShape.position); vec2.sub(v, sourceShape.position, targetShape.position); @@ -661,39 +766,37 @@ define(function (require) { v, targetShape.style.width / 2 + 2 ); - var angle; - if (v[1] < 0) { - angle = 2 * Math.PI - Math.acos(-v[0]); - } else { - angle = Math.acos(-v[0]); - } - symbolShape.rotation = angle - Math.PI / 2; + var angle = Math.atan2(v[1], v[0]); + symbolShape.rotation = Math.PI / 2 - angle; - this.zr.modShape(symbolShape.id); + symbolShape.modSelf(); } } }, - _update: function(e) { - - this._layout.temperature = this._temperature; - this._layout.update(); - - for (var i = 0; i < this._layout.nodes.length; i++) { - var position = this._layout.nodes[i].position; - var shape = this._nodeShapes[i]; - var node = this._filteredNodes[i]; - if (shape.fixed || (node.fixX && node.fixY)) { - vec2.copy(position, shape.position); - } else if (node.fixX) { - position[0] = shape.position[0]; - shape.position[1] = position[1]; - } else if (node.fixY) { - position[1] = shape.position[1]; - shape.position[0] = position[0]; - } else { - vec2.copy(shape.position, position); + _syncNodePositions: function() { + var graph = this._graph; + for (var i = 0; i < graph.nodes.length; i++) { + var gNode = graph.nodes[i]; + var position = gNode.layout.position; + var node = gNode.data; + var shape = gNode.shape; + var fixX = shape.fixed || node.fixX; + var fixY = shape.fixed || node.fixY; + if (fixX === true) { + fixX = 1; + } else if (isNaN(fixX)) { + fixX = 0; } + if (fixY === true) { + fixY = 1; + } else if (isNaN(fixY)) { + fixY = 0; + } + shape.position[0] += (position[0] - shape.position[0]) * (1 - fixX); + shape.position[1] += (position[1] - shape.position[1]) * (1 - fixY); + + vec2.copy(position, shape.position); var nodeName = node.name; if (nodeName) { @@ -703,92 +806,28 @@ define(function (require) { } vec2.copy(gPos, position); } - } - this._temperature *= this._coolDown; - }, - - _updateWorker: function(e) { - if (!this._updating) { - return; + shape.modSelf(); } - - var positionArr = new Float32Array(e.data); - var token = positionArr[0]; - var ret = token === this._token; - // If token is from current layout instance - if (ret) { - var nNodes = (positionArr.length - 1) / 2; - - for (var i = 0; i < nNodes; i++) { - var shape = this._nodeShapes[i]; - var node = this._filteredNodes[i]; - - var x = positionArr[i * 2 + 1]; - var y = positionArr[i * 2 + 2]; - - if (shape.fixed || (node.fixX && node.fixY)) { - positionArr[i * 2 + 1] = shape.position[0]; - positionArr[i * 2 + 2] = shape.position[1]; - } else if (node.fixX) { - positionArr[i * 2 + 1] = shape.position[0]; - shape.position[1] = y; - } else if (node.fixY) { - positionArr[i * 2 + 2] = shape.position[1]; - shape.position[0] = x; - } else { - shape.position[0] = x; - shape.position[1] = y; - } - - var nodeName = node.name; - if (nodeName) { - var gPos = this.__nodePositionMap[nodeName]; - if (!gPos) { - gPos = this.__nodePositionMap[nodeName] = vec2.create(); - } - vec2.copy(gPos, shape.position); - } - } - - this._layoutWorker.postMessage(positionArr.buffer, [positionArr.buffer]); - } - - var self = this; - self._layoutWorker.postMessage({ - cmd: 'update', - steps: this._steps, - temperature: this._temperature, - coolDown: this._coolDown - }); - - for (var i = 0; i < this._steps; i++) { - this._temperature *= this._coolDown; - } - - return ret; }, - _step: function(e){ - if (this._layoutWorker) { - var res = this._updateWorker(e); - if (!res) { - return; - } - } else { - if (this._temperature < 0.01) { - return; - } - this._update(); - } + _step: function(e) { + this._syncNodePositions(); this._updateLinkShapes(); - for (var i = 0; i < this._nodeShapes.length; i++) { - this.zr.modShape(this._nodeShapes[i].id); - } + this.zr.refreshNextFrame(); - this.zr.refresh(); + if (this._layout.temperature > 0.01) { + this._layout.step(this._steps); + } else { + this.messageCenter.dispatch( + ecConfig.EVENT.FORCE_LAYOUT_END, + {}, + {}, + this.myChart + ); + } }, refresh: function(newOption) { @@ -796,22 +835,59 @@ define(function (require) { this.option = newOption; this.series = this.option.series; } - this.clear(); - this._buildShape(); + + this.legend = this.component.legend; + if (this.legend) { + this.getColor = function(param) { + return this.legend.getColor(param); + }; + this.isSelected = function(param) { + return this.legend.isSelected(param); + }; + } + else { + var colorMap = {}; + var count = 0; + this.getColor = function (key) { + if (colorMap[key]) { + return colorMap[key]; + } + if (!colorMap[key]) { + colorMap[key] = this.zr.getColor(count++); + } + + return colorMap[key]; + }; + this.isSelected = function () { + return true; + }; + } + + this._init(); }, dispose: function(){ - this._updating = false; this.clear(); this.shapeList = null; this.effectList = null; - if (this._layoutWorker) { - this._layoutWorker.terminate(); - } - this._layoutWorker = null; + this._layout.dispose(); + this._layout = null; this.__nodePositionMap = {}; + }, + + getPosition: function () { + var position = []; + this._graph.eachNode(function (n) { + if (n.layout) { + position.push({ + name: n.data.name, + position: Array.prototype.slice.call(n.layout.position) + }); + } + }); + return position; } }; @@ -834,7 +910,8 @@ define(function (require) { } function onmousemove() { - this._temperature = 0.8; + this._layout.temperature = 0.8; + this._step(); } /** @@ -860,25 +937,13 @@ define(function (require) { } function _randomInSquare(x, y, size) { - return [ - (Math.random() - 0.5) * size + x, - (Math.random() - 0.5) * size + y - ]; - } - - function _filter(array, callback){ - var len = array.length; - var result = []; - for(var i = 0; i < len; i++){ - if(callback(array[i], i)){ - result.push(array[i]); - } - } - return result; + var v = vec2.create(); + v[0] = (Math.random() - 0.5) * size + x; + v[1] = (Math.random() - 0.5) * size + y; + return v; } zrUtil.inherits(Force, ChartBase); - zrUtil.inherits(Force, ComponentBase); // 图表注册 require('../chart').define('force', Force); diff --git a/amd/chart/funnel.js b/amd/chart/funnel.js index ffa96d2..a0e97bd 100644 --- a/amd/chart/funnel.js +++ b/amd/chart/funnel.js @@ -2,11 +2,10 @@ * echarts图表类:漏斗图 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ define(function (require) { - var ComponentBase = require('../component/base'); var ChartBase = require('./base'); // 图形依赖 @@ -15,6 +14,60 @@ define(function (require) { var PolygonShape = require('../zrender/shape/Polygon'); var ecConfig = require('../config'); + // 漏斗图默认参数 + ecConfig.funnel = { + zlevel: 0, // 一级层叠 + z: 2, // 二级层叠 + clickable: true, + legendHoverLink: true, + x: 80, + y: 60, + x2: 80, + y2: 60, + // width: {totalWidth} - x - x2, + // height: {totalHeight} - y - y2, + min: 0, + max: 100, + minSize: '0%', + maxSize: '100%', + sort: 'descending', // 'ascending', 'descending' + gap: 0, + funnelAlign: 'center', + itemStyle: { + normal: { + // color: 各异, + borderColor: '#fff', + borderWidth: 1, + label: { + show: true, + position: 'outer' + // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调 + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + }, + labelLine: { + show: true, + length: 10, + lineStyle: { + // color: 各异, + width: 1, + type: 'solid' + } + } + }, + emphasis: { + // color: 各异, + borderColor: 'rgba(0,0,0,0)', + borderWidth: 1, + label: { + show: true + }, + labelLine: { + show: true + } + } + } + }; + var ecData = require('../util/ecData'); var number = require('../util/number'); var zrUtil = require('../zrender/tool/util'); @@ -28,20 +81,18 @@ define(function (require) { * @param {Object} series 数据 * @param {Object} component 组件 */ - function Funnel(ecTheme, messageCenter, zr, option, myChart){ - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); + function Funnel(ecTheme, messageCenter, zr, option, myChart) { // 图表基类 - ChartBase.call(this); + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); this.refresh(option); } Funnel.prototype = { - type : ecConfig.CHART_TYPE_FUNNEL, + type: ecConfig.CHART_TYPE_FUNNEL, /** * 绘制图形 */ - _buildShape : function () { + _buildShape: function () { var series = this.series; var legend = this.component.legend; // 复用参数索引 @@ -51,12 +102,12 @@ define(function (require) { var serieName; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type == ecConfig.CHART_TYPE_FUNNEL) { + if (series[i].type === ecConfig.CHART_TYPE_FUNNEL) { series[i] = this.reformOption(series[i]); + this.legendHoverLink = series[i].legendHoverLink || this.legendHoverLink; serieName = series[i].name || ''; // 系列图例开关 - this.selectedMap[serieName] = - legend ? legend.isSelected(serieName) : true; + this.selectedMap[serieName] = legend ? legend.isSelected(serieName) : true; if (!this.selectedMap[serieName]) { continue; } @@ -73,14 +124,14 @@ define(function (require) { * * @param {number} seriesIndex 系列索引 */ - _buildSingleFunnel : function (seriesIndex) { + _buildSingleFunnel: function (seriesIndex) { var legend = this.component.legend; var serie = this.series[seriesIndex]; var data = this._mapData(seriesIndex); var location = this._getLocation(seriesIndex); this._paramsMap[seriesIndex] = { - location : location, - data : data + location: location, + data: data }; var itemName; @@ -89,11 +140,8 @@ define(function (require) { // 计算需要显示的个数和总值 for (var i = 0, l = data.length; i < l; i++) { itemName = data[i].name; - if (legend){ - this.selectedMap[itemName] = legend.isSelected(itemName); - } else { - this.selectedMap[itemName] = true; - } + this.selectedMap[itemName] = legend ? legend.isSelected(itemName) : true; + if (this.selectedMap[itemName] && !isNaN(data[i].value)) { selectedData.push(data[i]); total++; @@ -104,79 +152,106 @@ define(function (require) { } // 可计算箱子 var funnelCase = this._buildFunnelCase(seriesIndex); + var align = serie.funnelAlign; var gap = serie.gap; var height = total > 1 ? (location.height - (total - 1) * gap) / total : location.height; var width; var lastY = location.y; - var lastWidth = serie.sort == 'descending' + var lastWidth = serie.sort === 'descending' ? this._getItemWidth(seriesIndex, selectedData[0].value) : number.parsePercent(serie.minSize, location.width); - var next = serie.sort == 'descending' ? 1 : 0; + var next = serie.sort === 'descending' ? 1 : 0; var centerX = location.centerX; - var pointList = [ - [ - centerX - lastWidth / 2 - (lastWidth === 0 ? 0 : 10), - lastY - (lastWidth === 0 ? 10 : 5) - ], - [ - centerX + lastWidth / 2 + (lastWidth === 0 ? 0 : 10), - lastY - (lastWidth === 0 ? 10 : 5) - ] - ]; + var pointList= []; + var x; + var polygon; + var lastPolygon; for (var i = 0, l = selectedData.length; i < l; i++) { itemName = selectedData[i].name; if (this.selectedMap[itemName] && !isNaN(selectedData[i].value)) { width = i <= l - 2 ? this._getItemWidth(seriesIndex, selectedData[i + next].value) - : serie.sort == 'descending' + : serie.sort === 'descending' ? number.parsePercent(serie.minSize, location.width) : number.parsePercent(serie.maxSize, location.width); - this._buildItem( - seriesIndex, selectedData[i]._index, - legend - ? legend.getColor(itemName) : this.zr.getColor(selectedData[i]._index), - centerX - lastWidth / 2, lastY, - lastWidth, width, height + switch (align) { + case 'left': + x = location.x; + break; + case 'right': + x = location.x + location.width - lastWidth; + break; + default: + x = centerX - lastWidth / 2; + } + polygon = this._buildItem( + seriesIndex, selectedData[i]._index, + legend // color + ? legend.getColor(itemName) + : this.zr.getColor(selectedData[i]._index), + x, lastY, lastWidth, width, height, align ); lastY += height + gap; + lastPolygon = polygon.style.pointList; + + pointList.unshift([lastPolygon[0][0] - 10, lastPolygon[0][1]]); // 左 + pointList.push([lastPolygon[1][0] + 10, lastPolygon[1][1]]); // 右 + if (i === 0) { + if (lastWidth === 0) { + lastPolygon = pointList.pop(); + align == 'center' && (pointList[0][0] += 10); + align == 'right' && (pointList[0][0] = lastPolygon[0]); + pointList[0][1] -= align == 'center' ? 10 : 15; + if (l == 1) { + lastPolygon = polygon.style.pointList; + } + } + else { + pointList[pointList.length - 1][1] -= 5; + pointList[0][1] -=5; + } + } lastWidth = width; - pointList.unshift([centerX - lastWidth / 2 - 10, lastY]); - pointList.push([centerX + lastWidth / 2 + 10, lastY]); } } + if (funnelCase) { + pointList.unshift([lastPolygon[3][0] - 10, lastPolygon[3][1]]); // 左 + pointList.push([lastPolygon[2][0] + 10, lastPolygon[2][1]]); // 右 if (lastWidth === 0) { - pointList.pop(); - pointList[0][0] +=10; - pointList[0][1] +=10; + lastPolygon = pointList.pop(); + align == 'center' && (pointList[0][0] += 10); + align == 'right' && (pointList[0][0] = lastPolygon[0]); + pointList[0][1] += align == 'center' ? 10 : 15; } else { - pointList[pointList.length - 1][1] +=5; + pointList[pointList.length - 1][1] += 5; pointList[0][1] +=5; } funnelCase.style.pointList = pointList; } }, - _buildFunnelCase : function(seriesIndex) { + _buildFunnelCase: function(seriesIndex) { var serie = this.series[seriesIndex]; if (this.deepQuery([serie, this.option], 'calculable')) { var location = this._paramsMap[seriesIndex].location; var gap = 10; var funnelCase = { - hoverable : false, - style : { - pointListd : [ + hoverable: false, + style: { + pointListd: [ [location.x - gap, location.y - gap], [location.x + location.width + gap, location.y - gap], [location.x + location.width + gap, location.y + location.height + gap], [location.x - gap, location.y + location.height + gap] ], - brushType : 'stroke', - lineWidth : 1, - strokeColor : serie.calculableHolderColor - || this.ecTheme.calculableHolderColor + brushType: 'stroke', + lineWidth: 1, + strokeColor: serie.calculableHolderColor + || this.ecTheme.calculableHolderColor + || ecConfig.calculableHolderColor } }; ecData.pack(funnelCase, serie, seriesIndex, undefined, -1); @@ -193,43 +268,33 @@ define(function (require) { var zrHeight = this.zr.getHeight(); var x = this.parsePercent(gridOption.x, zrWidth); var y = this.parsePercent(gridOption.y, zrHeight); - - var width; - if (typeof gridOption.width == 'undefined') { - width = zrWidth - x - this.parsePercent(gridOption.x2, zrWidth); - } - else { - width = this.parsePercent(gridOption.width, zrWidth); - } - - var height; - if (typeof gridOption.height == 'undefined') { - height = zrHeight - y - this.parsePercent(gridOption.y2, zrHeight); - } - else { - height = this.parsePercent(gridOption.height, zrHeight); - } - + + var width = gridOption.width == null + ? (zrWidth - x - this.parsePercent(gridOption.x2, zrWidth)) + : this.parsePercent(gridOption.width, zrWidth); + return { - x : x, - y : y, - width : width, - height : height, - centerX : x + width / 2 + x: x, + y: y, + width: width, + height: gridOption.height == null + ? (zrHeight - y - this.parsePercent(gridOption.y2, zrHeight)) + : this.parsePercent(gridOption.height, zrHeight), + centerX: x + width / 2 }; }, - _mapData : function(seriesIndex) { + _mapData: function(seriesIndex) { var serie = this.series[seriesIndex]; var funnelData = zrUtil.clone(serie.data); for (var i = 0, l = funnelData.length; i < l; i++) { funnelData[i]._index = i; } function numDescending (a, b) { - if (a.value == '-') { + if (a.value === '-') { return 1; } - else if (b.value == '-') { + else if (b.value === '-') { return -1; } return b.value - a.value; @@ -238,7 +303,7 @@ define(function (require) { return -numDescending(a, b); } if (serie.sort != 'none') { - funnelData.sort(serie.sort == 'descending' ? numDescending : numAscending); + funnelData.sort(serie.sort === 'descending' ? numDescending : numAscending); } return funnelData; @@ -247,17 +312,18 @@ define(function (require) { /** * 构建单个扇形及指标 */ - _buildItem : function ( + _buildItem: function ( seriesIndex, dataIndex, defaultColor, - x, y, topWidth, bottomWidth, height + x, y, topWidth, bottomWidth, height, align ) { var series = this.series; var serie = series[seriesIndex]; var data = serie.data[dataIndex]; + // 漏斗 var polygon = this.getPolygon( seriesIndex, dataIndex, defaultColor, - x, y, topWidth, bottomWidth, height + x, y, topWidth, bottomWidth, height, align ); ecData.pack( polygon, @@ -270,7 +336,7 @@ define(function (require) { // 文本标签 var label = this.getLabel( seriesIndex, dataIndex, defaultColor, - x, y, topWidth, bottomWidth, height + x, y, topWidth, bottomWidth, height, align ); ecData.pack( label, @@ -287,7 +353,7 @@ define(function (require) { // 文本标签视觉引导线 var labelLine = this.getLabelLine( seriesIndex, dataIndex, defaultColor, - x, y, topWidth, bottomWidth, height + x, y, topWidth, bottomWidth, height, align ); this.shapeList.push(labelLine); // 特定状态下是否需要显示文本标签引导线 @@ -307,13 +373,14 @@ define(function (require) { } polygon.hoverConnect = polygonHoverConnect; label.hoverConnect = labelHoverConnect; - polygon.onmouseover = label.onmouseover = this.hoverConnect; + + return polygon; }, /** * 根据值计算宽度 */ - _getItemWidth : function (seriesIndex, value) { + _getItemWidth: function (seriesIndex, value) { var serie = this.series[seriesIndex]; var location = this._paramsMap[seriesIndex].location; var min = serie.min; @@ -326,51 +393,59 @@ define(function (require) { /** * 构建扇形 */ - getPolygon : function ( + getPolygon: function ( seriesIndex, dataIndex, defaultColor, - x, y, topWidth, bottomWidth, height + xLT, y, topWidth, bottomWidth, height, align ) { var serie = this.series[seriesIndex]; var data = serie.data[dataIndex]; var queryTarget = [data, serie]; // 多级控制 - var normal = this.deepMerge( - queryTarget, - 'itemStyle.normal' - ) || {}; - var emphasis = this.deepMerge( - queryTarget, - 'itemStyle.emphasis' - ) || {}; + var normal = this.deepMerge(queryTarget, 'itemStyle.normal') || {}; + var emphasis = this.deepMerge(queryTarget,'itemStyle.emphasis') || {}; + var normalColor = this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) || defaultColor; var emphasisColor = this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data) - || (typeof normalColor == 'string' + || (typeof normalColor === 'string' ? zrColor.lift(normalColor, -0.2) : normalColor ); - + + var xLB; + switch (align) { + case 'left': + xLB = xLT; + break; + case 'right': + xLB = xLT + (topWidth - bottomWidth); + break; + default: + xLB = xLT + (topWidth - bottomWidth) / 2; + break; + } var polygon = { - zlevel : this._zlevelBase, - clickable : true, - style : { - pointList : [ - [x, y], - [x + topWidth, y], - [x + topWidth - (topWidth - bottomWidth) / 2, y + height], - [x + (topWidth - bottomWidth) / 2, y + height] + zlevel: this.getZlevelBase(), + z: this.getZBase(), + clickable: this.deepQuery(queryTarget, 'clickable'), + style: { + pointList: [ + [xLT, y], + [xLT + topWidth, y], + [xLB + bottomWidth, y + height], + [xLB, y + height] ], - brushType : 'both', - color : normalColor, - lineWidth : normal.borderWidth, - strokeColor : normal.borderColor + brushType: 'both', + color: normalColor, + lineWidth: normal.borderWidth, + strokeColor: normal.borderColor }, - highlightStyle : { - color : emphasisColor, - lineWidth : emphasis.borderWidth, - strokeColor : emphasis.borderColor + highlightStyle: { + color: emphasisColor, + lineWidth: emphasis.borderWidth, + strokeColor: emphasis.borderColor } }; @@ -385,9 +460,9 @@ define(function (require) { /** * 需要显示则会有返回构建好的shape,否则返回undefined */ - getLabel : function ( + getLabel: function ( seriesIndex, dataIndex, defaultColor, - x, y, topWidth, bottomWidth, height + x, y, topWidth, bottomWidth, height, align ) { var serie = this.series[seriesIndex]; var data = serie.data[dataIndex]; @@ -406,46 +481,42 @@ define(function (require) { var text = this.getLabelText(seriesIndex, dataIndex, status); var textFont = this.getFont(textStyle); var textAlign; - var textX; var textColor = defaultColor; labelControl.position = labelControl.position || itemStyle.normal.label.position; - if (labelControl.position == 'inner' || labelControl.position == 'inside') { + if (labelControl.position === 'inner' + || labelControl.position === 'inside' + || labelControl.position === 'center' + ) { // 内部 - textAlign = 'center'; - textX = x + topWidth / 2; - if (Math.max(topWidth, bottomWidth) / 2 > zrArea.getTextWidth(text, textFont)) { - textColor = '#fff'; - } - else { - textColor = zrColor.reverse(defaultColor); - } + textAlign = align; + textColor = + Math.max(topWidth, bottomWidth) / 2 > zrArea.getTextWidth(text, textFont) + ? '#fff' : zrColor.reverse(defaultColor); } - else if (labelControl.position == 'left'){ + else if (labelControl.position === 'left'){ // 左侧显示 textAlign = 'right'; - textX = lineLength == 'auto' - ? (location.x - 10) - : (location.centerX - Math.max(topWidth, bottomWidth) / 2 - lineLength); } else { - // 右侧显示,默认 labelControl.position == 'outer' || 'right) + // 右侧显示,默认 labelControl.position === 'outer' || 'right) textAlign = 'left'; - textX = lineLength == 'auto' - ? (location.x + location.width + 10) - : (location.centerX + Math.max(topWidth, bottomWidth) / 2 + lineLength); } var textShape = { - zlevel : this._zlevelBase + 1, - style : { - x : textX, - y : y + height / 2, - color : textStyle.color || textColor, - text : text, - textAlign : textStyle.align || textAlign, - textBaseline : textStyle.baseline || 'middle', - textFont : textFont + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + style: { + x: this._getLabelPoint( + labelControl.position, x, location, + topWidth, bottomWidth,lineLength, align + ), + y: y + height / 2, + color: textStyle.color || textColor, + text: text, + textAlign: textStyle.align || textAlign, + textBaseline: textStyle.baseline || 'middle', + textFont: textFont } }; @@ -459,38 +530,35 @@ define(function (require) { text = this.getLabelText(seriesIndex, dataIndex, status); textFont = this.getFont(textStyle); textColor = defaultColor; - if (labelControl.position == 'inner' || labelControl.position == 'inside') { + if (labelControl.position === 'inner' + || labelControl.position === 'inside' + || labelControl.position === 'center' + ) { // 内部 - textAlign = 'center'; - textX = x + topWidth / 2; - if (Math.max(topWidth, bottomWidth) / 2 > zrArea.getTextWidth(text, textFont)) { - textColor = '#fff'; - } - else { - textColor = zrColor.reverse(defaultColor); - } + textAlign = align; + textColor = + Math.max(topWidth, bottomWidth) / 2 > zrArea.getTextWidth(text, textFont) + ? '#fff' : zrColor.reverse(defaultColor); } - else if (labelControl.position == 'left'){ + else if (labelControl.position === 'left'){ // 左侧显示 textAlign = 'right'; - textX = lineLength == 'auto' - ? (location.x - 10) - : (location.centerX - Math.max(topWidth, bottomWidth) / 2 - lineLength); } else { - // 右侧显示,默认 labelControl.position == 'outer' || 'right) + // 右侧显示,默认 labelControl.position === 'outer' || 'right) textAlign = 'left'; - textX = lineLength == 'auto' - ? (location.x + location.width + 10) - : (location.centerX + Math.max(topWidth, bottomWidth) / 2 + lineLength); } + textShape.highlightStyle = { - x : textX, - color : textStyle.color || textColor, - text : text, - textAlign : textStyle.align || textAlign, - textFont : textFont, - brushType : 'fill' + x: this._getLabelPoint( + labelControl.position, x, location, + topWidth, bottomWidth,lineLength, align + ), + color: textStyle.color || textColor, + text: text, + textAlign: textStyle.align || textAlign, + textFont: textFont, + brushType: 'fill' }; return new TextShape(textShape); @@ -499,7 +567,7 @@ define(function (require) { /** * 根据lable.format计算label text */ - getLabelText : function (seriesIndex, dataIndex, status) { + getLabelText: function (seriesIndex, dataIndex, status) { var series = this.series; var serie = series[seriesIndex]; var data = serie.data[dataIndex]; @@ -509,19 +577,25 @@ define(function (require) { ); if (formatter) { - if (typeof formatter == 'function') { + if (typeof formatter === 'function') { return formatter.call( this.myChart, - serie.name, - data.name, - data.value + { + seriesIndex: seriesIndex, + seriesName: serie.name || '', + series: serie, + dataIndex: dataIndex, + data: data, + name: data.name, + value: data.value + } ); } - else if (typeof formatter == 'string') { + else if (typeof formatter === 'string') { formatter = formatter.replace('{a}','{a0}') .replace('{b}','{b0}') - .replace('{c}','{c0}'); - formatter = formatter.replace('{a0}', serie.name) + .replace('{c}','{c0}') + .replace('{a0}', serie.name) .replace('{b0}', data.name) .replace('{c0}', data.value); @@ -536,9 +610,9 @@ define(function (require) { /** * 需要显示则会有返回构建好的shape,否则返回undefined */ - getLabelLine : function ( + getLabelLine: function ( seriesIndex, dataIndex, defaultColor, - x, y, topWidth, bottomWidth, height + x, y, topWidth, bottomWidth, height, align ) { var serie = this.series[seriesIndex]; var data = serie.data[dataIndex]; @@ -558,34 +632,22 @@ define(function (require) { var labelControl = itemStyle[status].label; labelControl.position = labelControl.position || itemStyle.normal.label.position; - var xEnd; - if (labelControl.position == 'inner' || labelControl.position == 'inside') { - // 内部 - xEnd = x + topWidth / 2; - } - else if (labelControl.position == 'left'){ - // 左侧显示 - xEnd = lineLength == 'auto' - ? (location.x - 10) - : (location.centerX - Math.max(topWidth, bottomWidth) / 2 - lineLength); - } - else { - // 右侧显示,默认 labelControl.position == 'outer' || 'right) - xEnd = lineLength == 'auto' - ? (location.x + location.width + 10) - : (location.centerX + Math.max(topWidth, bottomWidth) / 2 + lineLength); - } + var lineShape = { - zlevel : this._zlevelBase + 1, - hoverable : false, - style : { - xStart : location.centerX, - yStart : y + height / 2, - xEnd : xEnd, - yEnd : y + height / 2, - strokeColor : lineStyle.color || defaultColor, - lineType : lineStyle.type, - lineWidth : lineStyle.width + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + hoverable: false, + style: { + xStart: this._getLabelLineStartPoint(x, location, topWidth, bottomWidth, align), + yStart: y + height / 2, + xEnd: this._getLabelPoint( + labelControl.position, x, location, + topWidth, bottomWidth,lineLength, align + ), + yEnd: y + height / 2, + strokeColor: lineStyle.color || defaultColor, + lineType: lineStyle.type, + lineWidth: lineStyle.width } }; @@ -597,31 +659,71 @@ define(function (require) { labelControl = itemStyle[status].label || labelControl; labelControl.position = labelControl.position; - if (labelControl.position == 'inner' || labelControl.position == 'inside') { - // 内部 - xEnd = x + topWidth / 2; - } - else if (labelControl.position == 'left'){ - // 左侧显示 - xEnd = lineLength == 'auto' - ? (location.x - 10) - : (location.centerX - Math.max(topWidth, bottomWidth) / 2 - lineLength); - } - else { - // 右侧显示,默认 labelControl.position == 'outer' || 'right) - xEnd = lineLength == 'auto' - ? (location.x + location.width + 10) - : (location.centerX + Math.max(topWidth, bottomWidth) / 2 + lineLength); - } + lineShape.highlightStyle = { - xEnd : xEnd, - strokeColor : lineStyle.color || defaultColor, - lineType : lineStyle.type, - lineWidth : lineStyle.width + xEnd: this._getLabelPoint( + labelControl.position, x, location, + topWidth, bottomWidth,lineLength, align + ), + strokeColor: lineStyle.color || defaultColor, + lineType: lineStyle.type, + lineWidth: lineStyle.width }; return new LineShape(lineShape); }, + + _getLabelPoint: function(position, x, location, topWidth, bottomWidth, lineLength, align) { + position = (position === 'inner' || position === 'inside') ? 'center' : position; + switch (position) { + case 'center': + return align == 'center' + ? (x + topWidth / 2) + : align == 'left' ? (x + 10) : (x + topWidth - 10); + case 'left': + // 左侧文本 + if (lineLength === 'auto') { + return location.x - 10; + } + else { + return align == 'center' + // 居中布局 + ? (location.centerX - Math.max(topWidth, bottomWidth) / 2 - lineLength) + : align == 'right' + // 右对齐布局 + ? (x + - (topWidth < bottomWidth ? (bottomWidth - topWidth) : 0) + - lineLength + ) + // 左对齐布局 + : (location.x - lineLength); + } + break; + default: + // 右侧文本 + if (lineLength === 'auto') { + return location.x + location.width + 10; + } + else { + return align == 'center' + // 居中布局 + ? (location.centerX + Math.max(topWidth, bottomWidth) / 2 + lineLength) + : align == 'right' + // 右对齐布局 + ? (location.x + location.width + lineLength) + // 左对齐布局 + : (x + Math.max(topWidth, bottomWidth) + lineLength); + } + } + }, + + _getLabelLineStartPoint: function(x, location, topWidth, bottomWidth, align) { + return align == 'center' + ? location.centerX + : topWidth < bottomWidth + ? (x + Math.min(topWidth, bottomWidth) / 2) + : (x + Math.max(topWidth, bottomWidth) / 2); + }, /** * 返回特定状态(normal or emphasis)下是否需要显示label标签文本 @@ -629,7 +731,7 @@ define(function (require) { * @param {Object} data * @param {boolean} isEmphasis true is 'emphasis' and false is 'normal' */ - _needLabel : function (serie, data, isEmphasis) { + _needLabel: function (serie, data, isEmphasis) { return this.deepQuery( [data, serie], 'itemStyle.' @@ -644,7 +746,7 @@ define(function (require) { * @param {Object} data * @param {boolean} isEmphasis true is 'emphasis' and false is 'normal' */ - _needLabelLine : function (serie, data, isEmphasis) { + _needLabelLine: function (serie, data, isEmphasis) { return this.deepQuery( [data, serie], 'itemStyle.' @@ -656,7 +758,7 @@ define(function (require) { /** * 刷新 */ - refresh : function (newOption) { + refresh: function (newOption) { if (newOption) { this.option = newOption; this.series = newOption.series; @@ -668,7 +770,6 @@ define(function (require) { }; zrUtil.inherits(Funnel, ChartBase); - zrUtil.inherits(Funnel, ComponentBase); // 图表注册 require('../chart').define('funnel', Funnel); diff --git a/amd/chart/gauge.js b/amd/chart/gauge.js index da13786..a1642bc 100644 --- a/amd/chart/gauge.js +++ b/amd/chart/gauge.js @@ -2,11 +2,10 @@ * echarts图表类:仪表盘 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ define(function (require) { - var ComponentBase = require('../component/base'); var ChartBase = require('./base'); // 图形依赖 @@ -18,6 +17,83 @@ define(function (require) { var SectorShape = require('../zrender/shape/Sector'); var ecConfig = require('../config'); + // 仪表盘默认参数 + ecConfig.gauge = { + zlevel: 0, // 一级层叠 + z: 2, // 二级层叠 + center: ['50%', '50%'], // 默认全局居中 + clickable: true, + legendHoverLink: true, + radius: '75%', + startAngle: 225, + endAngle: -45, + min: 0, // 最小值 + max: 100, // 最大值 + precision: 0, // 小数精度,默认为0,无小数点 + splitNumber: 10, // 分割段数,默认为10 + axisLine: { // 坐标轴线 + show: true, // 默认显示,属性show控制显示与否 + lineStyle: { // 属性lineStyle控制线条样式 + color: [[0.2, '#228b22'],[0.8, '#48b'],[1, '#ff4500']], + width: 30 + } + }, + axisTick: { // 坐标轴小标记 + show: true, // 属性show控制显示与否,默认不显示 + splitNumber: 5, // 每份split细分多少段 + length :8, // 属性length控制线长 + lineStyle: { // 属性lineStyle控制线条样式 + color: '#eee', + width: 1, + type: 'solid' + } + }, + axisLabel: { // 坐标轴文本标签,详见axis.axisLabel + show: true, + // formatter: null, + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: 'auto' + } + }, + splitLine: { // 分隔线 + show: true, // 默认显示,属性show控制显示与否 + length :30, // 属性length控制线长 + lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 + color: '#eee', + width: 2, + type: 'solid' + } + }, + pointer: { + show: true, + length: '80%', + width: 8, + color: 'auto' + }, + title: { + show: true, + offsetCenter: [0, '-40%'], // x, y,单位px + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: '#333', + fontSize: 15 + } + }, + detail: { + show: true, + backgroundColor: 'rgba(0,0,0,0)', + borderWidth: 0, + borderColor: '#ccc', + width: 100, + height: 40, + offsetCenter: [0, '40%'], // x, y,单位px + // formatter: null, + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: 'auto', + fontSize: 30 + } + } + }; + var ecData = require('../util/ecData'); var accMath = require('../util/accMath'); var zrUtil = require('../zrender/tool/util'); @@ -29,26 +105,25 @@ define(function (require) { * @param {Object} series 数据 * @param {Object} component 组件 */ - function Gauge(ecTheme, messageCenter, zr, option, myChart){ - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); + function Gauge(ecTheme, messageCenter, zr, option, myChart) { // 图表基类 - ChartBase.call(this); + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); this.refresh(option); } Gauge.prototype = { - type : ecConfig.CHART_TYPE_GAUGE, + type: ecConfig.CHART_TYPE_GAUGE, /** * 绘制图形 */ - _buildShape : function () { + _buildShape: function () { var series = this.series; // 复用参数索引 this._paramsMap = {}; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type == ecConfig.CHART_TYPE_GAUGE) { + if (series[i].type === ecConfig.CHART_TYPE_GAUGE) { series[i] = this.reformOption(series[i]); + this.legendHoverLink = series[i].legendHoverLink || this.legendHoverLink; this._buildSingleGauge(i); this.buildMark(i); } @@ -62,14 +137,14 @@ define(function (require) { * * @param {number} seriesIndex 系列索引 */ - _buildSingleGauge : function (seriesIndex) { + _buildSingleGauge: function (seriesIndex) { var serie = this.series[seriesIndex]; this._paramsMap[seriesIndex] = { - center : this.parseCenter(this.zr, serie.center), - radius : this.parseRadius(this.zr, serie.radius), - startAngle : serie.startAngle.toFixed(2) - 0, - endAngle : serie.endAngle.toFixed(2) - 0 + center: this.parseCenter(this.zr, serie.center), + radius: this.parseRadius(this.zr, serie.radius), + startAngle: serie.startAngle.toFixed(2) - 0, + endAngle: serie.endAngle.toFixed(2) - 0 }; this._paramsMap[seriesIndex].totalAngle = this._paramsMap[seriesIndex].startAngle - this._paramsMap[seriesIndex].endAngle; @@ -92,22 +167,22 @@ define(function (require) { }, // 轴线 - _buildAxisLine : function (seriesIndex) { + _buildAxisLine: function (seriesIndex) { var serie = this.series[seriesIndex]; if (!serie.axisLine.show) { return; } - var min = serie.min; - var total = serie.max - min; - var params = this._paramsMap[seriesIndex]; - var center = params.center; - var startAngle = params.startAngle; - var totalAngle = params.totalAngle; - var colorArray = params.colorArray; - var lineStyle = serie.axisLine.lineStyle; - var lineWidth = this.parsePercent(lineStyle.width, params.radius[1]); - var r = params.radius[1]; - var r0 = r - lineWidth; + var min = serie.min; + var total = serie.max - min; + var params = this._paramsMap[seriesIndex]; + var center = params.center; + var startAngle = params.startAngle; + var totalAngle = params.totalAngle; + var colorArray = params.colorArray; + var lineStyle = serie.axisLine.lineStyle; + var lineWidth = this.parsePercent(lineStyle.width, params.radius[1]); + var r = params.radius[1]; + var r0 = r - lineWidth; var sectorShape; var lastAngle = startAngle; @@ -130,7 +205,7 @@ define(function (require) { }, // 坐标轴分割线 - _buildSplitLine : function (seriesIndex) { + _buildSplitLine: function (seriesIndex) { var serie = this.series[seriesIndex]; if (!serie.splitLine.show) { return; @@ -138,14 +213,12 @@ define(function (require) { var params = this._paramsMap[seriesIndex]; var splitNumber = serie.splitNumber; - var min = serie.min; - var total = serie.max - min; - var splitLine = serie.splitLine; - var length = this.parsePercent( - splitLine.length, params.radius[1] - ); - var lineStyle = splitLine.lineStyle; - var color = lineStyle.color; + var min = serie.min; + var total = serie.max - min; + var splitLine = serie.splitLine; + var length = this.parsePercent(splitLine.length, params.radius[1]); + var lineStyle = splitLine.lineStyle; + var color = lineStyle.color; var center = params.center; var startAngle = params.startAngle * Math.PI / 180; var totalAngle = params.totalAngle * Math.PI / 180; @@ -160,19 +233,20 @@ define(function (require) { sinAngle = Math.sin(angle); cosAngle = Math.cos(angle); this.shapeList.push(new LineShape({ - zlevel : this._zlevelBase + 1, - hoverable : false, - style : { - xStart : center[0] + cosAngle * r, - yStart : center[1] - sinAngle * r, - xEnd : center[0] + cosAngle * r0, - yEnd : center[1] - sinAngle * r0, - strokeColor : color == 'auto' - ? this._getColor(seriesIndex, min + total / splitNumber * i) - : color, - lineType : lineStyle.type, - lineWidth : lineStyle.width, - shadowColor : lineStyle.shadowColor, + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + hoverable: false, + style: { + xStart: center[0] + cosAngle * r, + yStart: center[1] - sinAngle * r, + xEnd: center[0] + cosAngle * r0, + yEnd: center[1] - sinAngle * r0, + strokeColor: color === 'auto' + ? this._getColor(seriesIndex, min + total / splitNumber * i) + : color, + lineType: lineStyle.type, + lineWidth: lineStyle.width, + shadowColor: lineStyle.shadowColor, shadowBlur: lineStyle.shadowBlur, shadowOffsetX: lineStyle.shadowOffsetX, shadowOffsetY: lineStyle.shadowOffsetY @@ -182,7 +256,7 @@ define(function (require) { }, // 小标记 - _buildAxisTick : function (seriesIndex) { + _buildAxisTick: function (seriesIndex) { var serie = this.series[seriesIndex]; if (!serie.axisTick.show) { return; @@ -190,15 +264,13 @@ define(function (require) { var params = this._paramsMap[seriesIndex]; var splitNumber = serie.splitNumber; - var min = serie.min; - var total = serie.max - min; - var axisTick = serie.axisTick; - var tickSplit = axisTick.splitNumber; - var length = this.parsePercent( - axisTick.length, params.radius[1] - ); - var lineStyle = axisTick.lineStyle; - var color = lineStyle.color; + var min = serie.min; + var total = serie.max - min; + var axisTick = serie.axisTick; + var tickSplit = axisTick.splitNumber; + var length = this.parsePercent(axisTick.length, params.radius[1]); + var lineStyle = axisTick.lineStyle; + var color = lineStyle.color; var center = params.center; var startAngle = params.startAngle * Math.PI / 180; @@ -217,19 +289,20 @@ define(function (require) { sinAngle = Math.sin(angle); cosAngle = Math.cos(angle); this.shapeList.push(new LineShape({ - zlevel : this._zlevelBase + 1, - hoverable : false, - style : { - xStart : center[0] + cosAngle * r, - yStart : center[1] - sinAngle * r, - xEnd : center[0] + cosAngle * r0, - yEnd : center[1] - sinAngle * r0, - strokeColor : color == 'auto' - ? this._getColor(seriesIndex, min + total / l * i) - : color, - lineType : lineStyle.type, - lineWidth : lineStyle.width, - shadowColor : lineStyle.shadowColor, + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + hoverable: false, + style: { + xStart: center[0] + cosAngle * r, + yStart: center[1] - sinAngle * r, + xEnd: center[0] + cosAngle * r0, + yEnd: center[1] - sinAngle * r0, + strokeColor: color === 'auto' + ? this._getColor(seriesIndex, min + total / l * i) + : color, + lineType: lineStyle.type, + lineWidth: lineStyle.width, + shadowColor: lineStyle.shadowColor, shadowBlur: lineStyle.shadowBlur, shadowOffsetX: lineStyle.shadowOffsetX, shadowOffsetY: lineStyle.shadowOffsetY @@ -239,58 +312,60 @@ define(function (require) { }, // 坐标轴文本 - _buildAxisLabel : function (seriesIndex) { + _buildAxisLabel: function (seriesIndex) { var serie = this.series[seriesIndex]; if (!serie.axisLabel.show) { return; } var splitNumber = serie.splitNumber; - var min = serie.min; - var total = serie.max - min; - var textStyle = serie.axisLabel.textStyle; - var textFont = this.getFont(textStyle); - var color = textStyle.color; + var min = serie.min; + var total = serie.max - min; + var textStyle = serie.axisLabel.textStyle; + var textFont = this.getFont(textStyle); + var color = textStyle.color; var params = this._paramsMap[seriesIndex]; var center = params.center; var startAngle = params.startAngle; var totalAngle = params.totalAngle; var r0 = params.radius[1] - - this.parsePercent( - serie.splitLine.length, params.radius[1] - ) - 10; + - this.parsePercent(serie.splitLine.length, params.radius[1]) + - 5; var angle; var sinAngle; var cosAngle; var value; for (var i = 0; i <= splitNumber; i++) { - value = min + accMath.accMul(accMath.accDiv(total , splitNumber) , i); + value = accMath.accAdd( + min , accMath.accMul(accMath.accDiv(total , splitNumber), i) + ); angle = startAngle - totalAngle / splitNumber * i; sinAngle = Math.sin(angle * Math.PI / 180); cosAngle = Math.cos(angle * Math.PI / 180); angle = (angle + 360) % 360; this.shapeList.push(new TextShape({ - zlevel : this._zlevelBase + 1, - hoverable : false, - style : { - x : center[0] + cosAngle * r0, - y : center[1] - sinAngle * r0, - color : color == 'auto' ? this._getColor(seriesIndex, value) : color, - text : this._getLabelText(serie.axisLabel.formatter, value), - textAlign : (angle >= 110 && angle <= 250) - ? 'left' - : (angle <= 70 || angle >= 290) - ? 'right' - : 'center', - textBaseline : (angle >= 10 && angle <= 170) - ? 'top' - : (angle >= 190 && angle <= 350) - ? 'bottom' - : 'middle', - textFont : textFont, - shadowColor : textStyle.shadowColor, + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + hoverable: false, + style: { + x: center[0] + cosAngle * r0, + y: center[1] - sinAngle * r0, + color: color === 'auto' ? this._getColor(seriesIndex, value) : color, + text: this._getLabelText(serie.axisLabel.formatter, value), + textAlign: (angle >= 110 && angle <= 250) + ? 'left' + : (angle <= 70 || angle >= 290) + ? 'right' + : 'center', + textBaseline: (angle >= 10 && angle <= 170) + ? 'top' + : (angle >= 190 && angle <= 350) + ? 'bottom' + : 'middle', + textFont: textFont, + shadowColor: textStyle.shadowColor, shadowBlur: textStyle.shadowBlur, shadowOffsetX: textStyle.shadowOffsetX, shadowOffsetY: textStyle.shadowOffsetY @@ -299,13 +374,13 @@ define(function (require) { } }, - _buildPointer : function (seriesIndex) { - var serie = this.series[seriesIndex]; + _buildPointer: function (seriesIndex) { + var serie = this.series[seriesIndex]; if (!serie.pointer.show) { return; } - var total = serie.max - serie.min; - var pointer = serie.pointer; + var total = serie.max - serie.min; + var pointer = serie.pointer; var params = this._paramsMap[seriesIndex]; var length = this.parsePercent(pointer.length, params.radius[1]); @@ -314,29 +389,33 @@ define(function (require) { var value = this._getValue(seriesIndex); value = value < serie.max ? value : serie.max; - var angle = (params.startAngle - params.totalAngle / total * (value - serie.min)) * Math.PI / 180; - var color = pointer.color == 'auto' - ? this._getColor(seriesIndex, value) : pointer.color; + var angle = (params.startAngle - params.totalAngle / total * (value - serie.min)) + * Math.PI / 180; + var color = pointer.color === 'auto' + ? this._getColor(seriesIndex, value) + : pointer.color; var pointShape = new GaugePointerShape({ - zlevel : this._zlevelBase + 1, - style : { - x : center[0], - y : center[1], - r : length, - startAngle : params.startAngle * Math.PI / 180, - angle : angle, - color : color, - width : width, - shadowColor : pointer.shadowColor, + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + clickable: this.query(serie, 'clickable'), + style: { + x: center[0], + y: center[1], + r: length, + startAngle: params.startAngle * Math.PI / 180, + angle: angle, + color: color, + width: width, + shadowColor: pointer.shadowColor, shadowBlur: pointer.shadowBlur, shadowOffsetX: pointer.shadowOffsetX, shadowOffsetY: pointer.shadowOffsetY }, - highlightStyle : { - brushType : 'fill', - width : width > 2 ? 2 : (width / 2), - color : '#fff' + highlightStyle: { + brushType: 'fill', + width: width > 2 ? 2 : (width / 2), + color: '#fff' } }); ecData.pack( @@ -349,46 +428,49 @@ define(function (require) { this.shapeList.push(pointShape); this.shapeList.push(new CircleShape({ - zlevel : this._zlevelBase + 2, - hoverable : false, - style : { - x : center[0], - y : center[1], - r : pointer.width / 2.5, - color : '#fff' + zlevel: this.getZlevelBase(), + z: this.getZBase() + 2, + hoverable: false, + style: { + x: center[0], + y: center[1], + r: pointer.width / 2.5, + color: '#fff' } })); }, - _buildTitle : function(seriesIndex) { + _buildTitle: function(seriesIndex) { var serie = this.series[seriesIndex]; if (!serie.title.show) { return; } var data = serie.data[0]; - var name = typeof data.name != 'undefined' ? data.name : ''; - if (name !== '') { - var title = serie.title; - var offsetCenter = title.offsetCenter; - var textStyle = title.textStyle; - var textColor = textStyle.color; - var params = this._paramsMap[seriesIndex]; + var name = data.name != null ? data.name : ''; + if (name !== '') { // 不要帮我代码规范 + var title = serie.title; + var offsetCenter = title.offsetCenter; + var textStyle = title.textStyle; + var textColor = textStyle.color; + var params = this._paramsMap[seriesIndex]; var x = params.center[0] + this.parsePercent(offsetCenter[0], params.radius[1]); var y = params.center[1] + this.parsePercent(offsetCenter[1], params.radius[1]); this.shapeList.push(new TextShape({ - zlevel : this._zlevelBase - + (Math.abs(x - params.center[0]) + Math.abs(y - params.center[1])) - < textStyle.fontSize * 2 ? 2 : 1, - hoverable : false, - style : { - x : x, - y : y, - color: textColor == 'auto' ? this._getColor(seriesIndex) : textColor, + zlevel: this.getZlevelBase(), + z: this.getZBase() + ( + (Math.abs(x - params.center[0]) + Math.abs(y - params.center[1])) + < textStyle.fontSize * 2 ? 2 : 1 + ), + hoverable: false, + style: { + x: x, + y: y, + color: textColor === 'auto' ? this._getColor(seriesIndex) : textColor, text: name, textAlign: 'center', - textFont : this.getFont(textStyle), - shadowColor : textStyle.shadowColor, + textFont: this.getFont(textStyle), + shadowColor: textStyle.shadowColor, shadowBlur: textStyle.shadowBlur, shadowOffsetX: textStyle.shadowOffsetX, shadowOffsetY: textStyle.shadowOffsetY @@ -397,17 +479,17 @@ define(function (require) { } }, - _buildDetail : function(seriesIndex) { + _buildDetail: function(seriesIndex) { var serie = this.series[seriesIndex]; if (!serie.detail.show) { return; } - var detail = serie.detail; - var offsetCenter = detail.offsetCenter; - var color = detail.backgroundColor; - var textStyle = detail.textStyle; - var textColor = textStyle.color; + var detail = serie.detail; + var offsetCenter = detail.offsetCenter; + var color = detail.backgroundColor; + var textStyle = detail.textStyle; + var textColor = textStyle.color; var params = this._paramsMap[seriesIndex]; var value = this._getValue(seriesIndex); @@ -416,22 +498,24 @@ define(function (require) { var y = params.center[1] + this.parsePercent(offsetCenter[1], params.radius[1]); this.shapeList.push(new RectangleShape({ - zlevel : this._zlevelBase - + (Math.abs(x+detail.width/2 - params.center[0]) - + Math.abs(y+detail.height/2 - params.center[1])) - < textStyle.fontSize ? 2 : 1, - hoverable : false, - style : { - x : x, - y : y, - width : detail.width, - height : detail.height, + zlevel: this.getZlevelBase(), + z: this.getZBase() + ( + (Math.abs(x + detail.width / 2 - params.center[0]) + + Math.abs(y + detail.height / 2 - params.center[1])) < textStyle.fontSize + ? 2 : 1 + ), + hoverable: false, + style: { + x: x, + y: y, + width: detail.width, + height: detail.height, brushType: 'both', - color: color == 'auto' ? this._getColor(seriesIndex, value) : color, - lineWidth : detail.borderWidth, - strokeColor : detail.borderColor, + color: color === 'auto' ? this._getColor(seriesIndex, value) : color, + lineWidth: detail.borderWidth, + strokeColor: detail.borderColor, - shadowColor : detail.shadowColor, + shadowColor: detail.shadowColor, shadowBlur: detail.shadowBlur, shadowOffsetX: detail.shadowOffsetX, shadowOffsetY: detail.shadowOffsetY, @@ -439,20 +523,19 @@ define(function (require) { text: this._getLabelText(detail.formatter, value), textFont: this.getFont(textStyle), textPosition: 'inside', - textColor : textColor == 'auto' ? this._getColor(seriesIndex, value) : textColor + textColor: textColor === 'auto' ? this._getColor(seriesIndex, value) : textColor } })); }, - _getValue : function(seriesIndex) { - var data = this.series[seriesIndex].data[0]; - return typeof data.value != 'undefined' ? data.value : data; + _getValue: function(seriesIndex) { + return this.getDataFromOption(this.series[seriesIndex].data[0]); }, /** * 颜色索引 */ - _colorMap : function (seriesIndex) { + _colorMap: function (seriesIndex) { var serie = this.series[seriesIndex]; var min = serie.min; var total = serie.max - min; @@ -470,8 +553,8 @@ define(function (require) { /** * 自动颜色 */ - _getColor : function (seriesIndex, value) { - if (typeof value == 'undefined') { + _getColor: function (seriesIndex, value) { + if (value == null) { value = this._getValue(seriesIndex); } @@ -487,20 +570,21 @@ define(function (require) { /** * 构建扇形 */ - _getSector : function (center, r0, r, startAngle, endAngle, color, lineStyle) { + _getSector: function (center, r0, r, startAngle, endAngle, color, lineStyle) { return new SectorShape ({ - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : center[0], // 圆心横坐标 - y : center[1], // 圆心纵坐标 - r0 : r0, // 圆环内半径 - r : r, // 圆环外半径 - startAngle : startAngle, - endAngle : endAngle, - brushType : 'fill', - color : color, - shadowColor : lineStyle.shadowColor, + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: center[0], // 圆心横坐标 + y: center[1], // 圆心纵坐标 + r0: r0, // 圆环内半径 + r: r, // 圆环外半径 + startAngle: startAngle, + endAngle: endAngle, + brushType: 'fill', + color: color, + shadowColor: lineStyle.shadowColor, shadowBlur: lineStyle.shadowBlur, shadowOffsetX: lineStyle.shadowOffsetX, shadowOffsetY: lineStyle.shadowOffsetY @@ -511,12 +595,12 @@ define(function (require) { /** * 根据lable.format计算label text */ - _getLabelText : function (formatter, value) { + _getLabelText: function (formatter, value) { if (formatter) { - if (typeof formatter == 'function') { + if (typeof formatter === 'function') { return formatter.call(this.myChart, value); } - else if (typeof formatter == 'string') { + else if (typeof formatter === 'string') { return formatter.replace('{value}', value); } } @@ -526,7 +610,7 @@ define(function (require) { /** * 刷新 */ - refresh : function (newOption) { + refresh: function (newOption) { if (newOption) { this.option = newOption; this.series = newOption.series; @@ -538,7 +622,6 @@ define(function (require) { }; zrUtil.inherits(Gauge, ChartBase); - zrUtil.inherits(Gauge, ComponentBase); // 图表注册 require('../chart').define('gauge', Gauge); diff --git a/amd/chart/island.js b/amd/chart/island.js index 9e44c3c..8102f16 100644 --- a/amd/chart/island.js +++ b/amd/chart/island.js @@ -2,17 +2,23 @@ * echarts组件:孤岛数据 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ define(function (require) { - var ComponentBase = require('../component/base'); var ChartBase = require('./base'); // 图形依赖 var CircleShape = require('../zrender/shape/Circle'); var ecConfig = require('../config'); + ecConfig.island = { + zlevel: 0, // 一级层叠 + z: 5, // 二级层叠 + r: 15, + calculateStep: 0.1 // 滚轮可计算步长 0.1 = 10% + }; + var ecData = require('../util/ecData'); var zrUtil = require('../zrender/tool/util'); var zrEvent = require('../zrender/tool/event'); @@ -24,10 +30,8 @@ define(function (require) { * @param {Object} option 图表选项 */ function Island(ecTheme, messageCenter, zr, option, myChart) { - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, {}, myChart); // 图表基类 - ChartBase.call(this); + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); this._nameConnector; this._valueConnector; @@ -49,12 +53,9 @@ define(function (require) { var value = ecData.get(shape, 'value'); var dvalue = value * self.option.island.calculateStep; - if (dvalue > 1) { - value = Math.round(value - dvalue * delta); - } - else { - value = (value - dvalue * delta).toFixed(2) - 0; - } + value = dvalue > 1 + ? (Math.round(value - dvalue * delta)) + : +(value - dvalue * delta).toFixed(2); var name = ecData.get(shape, 'name'); shape.style.text = name + ':' + value; @@ -63,20 +64,20 @@ define(function (require) { ecData.set(shape, 'name', name); self.zr.modShape(shape.id); - self.zr.refresh(); + self.zr.refreshNextFrame(); zrEvent.stop(event); }; } Island.prototype = { - type : ecConfig.CHART_TYPE_ISLAND, + type: ecConfig.CHART_TYPE_ISLAND, /** * 孤岛合并 * * @param {string} tarShapeIndex 目标索引 * @param {Object} srcShape 源目标,合入目标后删除 */ - _combine : function (tarShape, srcShape) { + _combine: function (tarShape, srcShape) { var zrColor = require('../zrender/tool/color'); var accMath = require('../util/accMath'); var value = accMath.accAdd( @@ -101,7 +102,7 @@ define(function (require) { /** * 刷新 */ - refresh : function (newOption) { + refresh: function (newOption) { if (newOption) { newOption.island = this.reformOption(newOption.island); this.option = newOption; @@ -111,16 +112,16 @@ define(function (require) { } }, - getOption : function () { + getOption: function () { return this.option; }, - resize : function () { + resize: function () { var newWidth = this.zr.getWidth(); var newHieght = this.zr.getHeight(); var xScale = newWidth / (this._zrWidth || newWidth); var yScale = newHieght / (this._zrHeight || newHieght); - if (xScale == 1 && yScale == 1) { + if (xScale === 1 && yScale === 1) { return; } this._zrWidth = newWidth; @@ -138,29 +139,30 @@ define(function (require) { } }, - add : function (shape) { + add: function (shape) { var name = ecData.get(shape, 'name'); var value = ecData.get(shape, 'value'); - var seriesName = typeof ecData.get(shape, 'series') != 'undefined' + var seriesName = ecData.get(shape, 'series') != null ? ecData.get(shape, 'series').name : ''; var font = this.getFont(this.option.island.textStyle); var islandShape = { - zlevel : this._zlevelBase, - style : { - x : shape.style.x, - y : shape.style.y, - r : this.option.island.r, - color : shape.style.color || shape.style.strokeColor, - text : name + this._valueConnector + value, - textFont : font + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: shape.style.x, + y: shape.style.y, + r: this.option.island.r, + color: shape.style.color || shape.style.strokeColor, + text: name + this._valueConnector + value, + textFont: font }, - draggable : true, - hoverable : true, - onmousewheel : this.shapeHandler.onmousewheel, - _type : 'island' + draggable: true, + hoverable: true, + onmousewheel: this.shapeHandler.onmousewheel, + _type: 'island' }; - if (islandShape.style.color == '#fff') { + if (islandShape.style.color === '#fff') { islandShape.style.color = shape.style.strokeColor; } this.setCalculable(islandShape); @@ -176,7 +178,7 @@ define(function (require) { this.zr.addShape(islandShape); }, - del : function (shape) { + del: function (shape) { this.zr.delShape(shape.id); var newShapeList = []; for (var i = 0, l = this.shapeList.length; i < l; i++) { @@ -190,7 +192,7 @@ define(function (require) { /** * 数据项被拖拽进来, 重载基类方法 */ - ondrop : function (param, status) { + ondrop: function (param, status) { if (!this.isDrop || !param.target) { // 没有在当前实例上发生拖拽行为则直接返回 return; @@ -213,7 +215,7 @@ define(function (require) { /** * 数据项被拖拽出去, 重载基类方法 */ - ondragend : function (param, status) { + ondragend: function (param, status) { var target = param.target; // 拖拽安放目标 if (!this.isDragend) { // 拖拽的不是孤岛数据,如果没有图表接受孤岛数据,需要新增孤岛数据 @@ -240,7 +242,6 @@ define(function (require) { }; zrUtil.inherits(Island, ChartBase); - zrUtil.inherits(Island, ComponentBase); // 图表注册 require('../chart').define('island', Island); diff --git a/amd/chart/k.js b/amd/chart/k.js index 3a4370b..172d0cb 100644 --- a/amd/chart/k.js +++ b/amd/chart/k.js @@ -2,11 +2,10 @@ * echarts图表类:K线图 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ define(function (require) { - var ComponentBase = require('../component/base'); var ChartBase = require('./base'); // 图形依赖 @@ -17,6 +16,34 @@ define(function (require) { require('../component/dataZoom'); var ecConfig = require('../config'); + // K线图默认参数 + ecConfig.k = { + zlevel: 0, // 一级层叠 + z: 2, // 二级层叠 + clickable: true, + hoverable: true, + legendHoverLink: false, + xAxisIndex: 0, + yAxisIndex: 0, + // barWidth: null // 默认自适应 + // barMaxWidth: null // 默认自适应 + itemStyle: { + normal: { + color: '#fff', // 阳线填充颜色 + color0: '#00aa11', // 阴线填充颜色 + lineStyle: { + width: 1, + color: '#ff3200', // 阳线边框颜色 + color0: '#00aa11' // 阴线边框颜色 + } + }, + emphasis: { + // color: 各异, + // color0: 各异 + } + } + }; + var ecData = require('../util/ecData'); var zrUtil = require('../zrender/tool/util'); @@ -27,35 +54,34 @@ define(function (require) { * @param {Object} series 数据 * @param {Object} component 组件 */ - function K(ecTheme, messageCenter, zr, option, myChart){ - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); + function K(ecTheme, messageCenter, zr, option, myChart) { // 图表基类 - ChartBase.call(this); + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); this.refresh(option); } K.prototype = { - type : ecConfig.CHART_TYPE_K, + type: ecConfig.CHART_TYPE_K, /** * 绘制图形 */ - _buildShape : function () { + _buildShape: function () { var series = this.series; this.selectedMap = {}; // 水平垂直双向series索引 ,position索引到seriesIndex var _position2sIndexMap = { - top : [], - bottom : [] + top: [], + bottom: [] }; var xAxis; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type == ecConfig.CHART_TYPE_K) { + if (series[i].type === ecConfig.CHART_TYPE_K) { series[i] = this.reformOption(series[i]); + this.legendHoverLink = series[i].legendHoverLink || this.legendHoverLink; xAxis = this.component.xAxis.getAxis(series[i].xAxisIndex); - if (xAxis.type == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + if (xAxis.type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY ) { _position2sIndexMap[xAxis.getPosition()].push(i); } @@ -78,7 +104,7 @@ define(function (require) { * * @param {number} seriesIndex 系列索引 */ - _buildSinglePosition : function (position, seriesArray) { + _buildSinglePosition: function (position, seriesArray) { var mapData = this._mapData(seriesArray); var locationMap = mapData.locationMap; var maxDataLength = mapData.maxDataLength; @@ -97,7 +123,7 @@ define(function (require) { * 数据整形 * 数组位置映射到系列索引 */ - _mapData : function (seriesArray) { + _mapData: function (seriesArray) { var series = this.series; var serie; // 临时映射变量 var serieName; // 临时映射变量 @@ -108,12 +134,10 @@ define(function (require) { for (var i = 0, l = seriesArray.length; i < l; i++) { serie = series[seriesArray[i]]; serieName = serie.name; - if (legend){ - this.selectedMap[serieName] = legend.isSelected(serieName); - } else { - this.selectedMap[serieName] = true; - } - + this.selectedMap[serieName] = legend + ? legend.isSelected(serieName) + : true; + if (this.selectedMap[serieName]) { locationMap.push(seriesArray[i]); } @@ -121,15 +145,15 @@ define(function (require) { maxDataLength = Math.max(maxDataLength, serie.data.length); } return { - locationMap : locationMap, - maxDataLength : maxDataLength + locationMap: locationMap, + maxDataLength: maxDataLength }; }, /** * 构建类目轴为水平方向的K线图系列 */ - _buildHorizontal : function (seriesArray, maxDataLength, locationMap) { + _buildHorizontal: function (seriesArray, maxDataLength, locationMap) { var series = this.series; // 确定类目轴和数值轴,同一方向随便找一个即可 var seriesIndex; @@ -161,18 +185,14 @@ define(function (require) { pointList[seriesIndex] = []; for (var i = 0, l = maxDataLength; i < l; i++) { - if (typeof categoryAxis.getNameByIndex(i) == 'undefined') { + if (categoryAxis.getNameByIndex(i) == null) { // 系列数据超出类目轴长度 break; } data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; - if (value == '-' || value.length != 4) { + value = this.getDataFromOption(data, '-'); + if (value === '-' || value.length != 4) { // 数据格式不符 continue; } @@ -195,7 +215,7 @@ define(function (require) { /** * 生成K线 */ - _buildKLine : function (seriesArray, pointList) { + _buildKLine: function (seriesArray, pointList) { var series = this.series; // normal: var nLineWidth; @@ -228,9 +248,7 @@ define(function (require) { seriesPL = this._getLargePointList(seriesPL); } - if (serie.type == ecConfig.CHART_TYPE_K - && typeof seriesPL != 'undefined' - ) { + if (serie.type === ecConfig.CHART_TYPE_K && seriesPL != null) { // 多级控制 queryTarget = serie; nLineWidth = this.query( @@ -352,14 +370,14 @@ define(function (require) { // console.log(this.shapeList) }, - _isLarge : function(singlePL) { + _isLarge: function(singlePL) { return singlePL[0][1] < 0.5; }, /** * 大规模pointList优化 */ - _getLargePointList : function(singlePL) { + _getLargePointList: function(singlePL) { var total = this.component.grid.getWidth(); var len = singlePL.length; var newList = []; @@ -372,7 +390,7 @@ define(function (require) { /** * 生成K线图上的图形 */ - _getCandle : function ( + _getCandle: function ( seriesIndex, dataIndex, name, x, width, y0, y1, y2, y3, nColor, nLinewidth, nLineColor, @@ -380,21 +398,27 @@ define(function (require) { ) { var series = this.series; var itemShape = { - zlevel : this._zlevelBase, - clickable: true, - style : { - x : x, - y : [y0, y1, y2, y3], - width : width, - color : nColor, - strokeColor : nLineColor, - lineWidth : nLinewidth, - brushType : 'both' + zlevel: this.getZlevelBase(), + z: this.getZBase(), + clickable: this.deepQuery( + [series[seriesIndex].data[dataIndex], series[seriesIndex]], 'clickable' + ), + hoverable: this.deepQuery( + [series[seriesIndex].data[dataIndex], series[seriesIndex]], 'hoverable' + ), + style: { + x: x, + y: [y0, y1, y2, y3], + width: width, + color: nColor, + strokeColor: nLineColor, + lineWidth: nLinewidth, + brushType: 'both' }, - highlightStyle : { - color : eColor, - strokeColor : eLineColor, - lineWidth : eLinewidth + highlightStyle: { + color: eColor, + strokeColor: eLineColor, + lineWidth: eLinewidth }, _seriesIndex: seriesIndex }; @@ -410,7 +434,7 @@ define(function (require) { }, // 位置转换 - getMarkCoord : function (seriesIndex, mpData) { + getMarkCoord: function (seriesIndex, mpData) { var serie = this.series[seriesIndex]; var xAxis = this.component.xAxis.getAxis(serie.xAxisIndex); var yAxis = this.component.yAxis.getAxis(serie.yAxisIndex); @@ -429,7 +453,7 @@ define(function (require) { /** * 刷新 */ - refresh : function (newOption) { + refresh: function (newOption) { if (newOption) { this.option = newOption; this.series = newOption.series; @@ -442,7 +466,7 @@ define(function (require) { /** * 动画设定 */ - addDataAnimation : function (params) { + addDataAnimation: function (params) { var series = this.series; var aniMap = {}; // seriesIndex索引参数 for (var i = 0, l = params.length; i < l; i++) { @@ -458,11 +482,11 @@ define(function (require) { seriesIndex = this.shapeList[i]._seriesIndex; if (aniMap[seriesIndex] && !aniMap[seriesIndex][3]) { // 有数据删除才有移动的动画 - if (this.shapeList[i].type == 'candle') { + if (this.shapeList[i].type === 'candle') { dataIndex = ecData.get(this.shapeList[i], 'dataIndex'); serie = series[seriesIndex]; if (aniMap[seriesIndex][2] - && dataIndex == serie.data.length - 1 + && dataIndex === serie.data.length - 1 ) { // 队头加入删除末尾 this.zr.delShape(this.shapeList[i].id); @@ -480,8 +504,8 @@ define(function (require) { y = 0; this.zr.animate(this.shapeList[i].id, '') .when( - 500, - {position : [x, y]} + this.query(this.option, 'animationDurationUpdate'), + { position: [ x, y ] } ) .start(); } @@ -491,7 +515,6 @@ define(function (require) { }; zrUtil.inherits(K, ChartBase); - zrUtil.inherits(K, ComponentBase); // 图表注册 require('../chart').define('k', K); diff --git a/amd/chart/line.js b/amd/chart/line.js index 7750a6c..90c080a 100644 --- a/amd/chart/line.js +++ b/amd/chart/line.js @@ -2,15 +2,14 @@ * echarts图表类:折线图 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ define(function (require) { - var ComponentBase = require('../component/base'); var ChartBase = require('./base'); // 图形依赖 - var BrokenLineShape = require('../zrender/shape/BrokenLine'); + var PolylineShape = require('../zrender/shape/Polyline'); var IconShape = require('../util/shape/Icon'); var HalfSmoothPolygonShape = require('../util/shape/HalfSmoothPolygon'); // 组件依赖 @@ -19,6 +18,52 @@ define(function (require) { require('../component/dataZoom'); var ecConfig = require('../config'); + // 折线图默认参数 + ecConfig.line = { + zlevel: 0, // 一级层叠 + z: 2, // 二级层叠 + clickable: true, + legendHoverLink: true, + // stack: null + xAxisIndex: 0, + yAxisIndex: 0, + itemStyle: { + normal: { + // color: 各异, + label: { + show: false + // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调 + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 + // 'inside'|'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + }, + lineStyle: { + width: 2, + type: 'solid', + shadowColor: 'rgba(0,0,0,0)', //默认透明 + shadowBlur: 0, + shadowOffsetX: 0, + shadowOffsetY: 0 + } + }, + emphasis: { + // color: 各异, + label: { + show: false + // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调 + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 + // 'inside'|'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + } + } + }, + // smooth: false, + // symbol: null, // 拐点图形类型 + symbolSize: 2, // 拐点图形大小 + // symbolRotate: null, // 拐点图形旋转控制 + showAllSymbol: false // 标志图形默认只有主轴显示(随主轴标签间隔隐藏策略) + }; + var ecData = require('../util/ecData'); var zrUtil = require('../zrender/tool/util'); var zrColor = require('../zrender/tool/color'); @@ -31,195 +76,31 @@ define(function (require) { * @param {Object} component 组件 */ function Line(ecTheme, messageCenter, zr, option, myChart){ - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); // 图表基类 - ChartBase.call(this); + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); this.refresh(option); } Line.prototype = { - type : ecConfig.CHART_TYPE_LINE, + type: ecConfig.CHART_TYPE_LINE, /** * 绘制图形 */ - _buildShape : function () { - var series = this.series; + _buildShape: function () { this.finalPLMap = {}; // 完成的point list(PL) - this._sIndex2ColorMap = {}; // series默认颜色索引,seriesIndex索引到color - this._symbol = this.option.symbolList; - this._sIndex2ShapeMap = {}; // series拐点图形类型,seriesIndex索引到shape type - - this.selectedMap = {}; - this.xMarkMap = {}; - - // 水平垂直双向series索引 ,position索引到seriesIndex - var _position2sIndexMap = { - top : [], - bottom : [], - left : [], - right : [] - }; - var xAxisIndex; - var yAxisIndex; - var xAxis; - var yAxis; - for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type == this.type) { - series[i] = this.reformOption(series[i]); - xAxisIndex = series[i].xAxisIndex; - yAxisIndex = series[i].yAxisIndex; - xAxis = this.component.xAxis.getAxis(xAxisIndex); - yAxis = this.component.yAxis.getAxis(yAxisIndex); - if (xAxis.type == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY - ) { - _position2sIndexMap[xAxis.getPosition()].push(i); - } - else if (yAxis.type == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY - ) { - _position2sIndexMap[yAxis.getPosition()].push(i); - } - } - } - // console.log(_position2sIndexMap); - for (var position in _position2sIndexMap) { - if (_position2sIndexMap[position].length > 0) { - this._buildSinglePosition( - position, _position2sIndexMap[position] - ); - } - } - this.addShapeList(); - }, - - /** - * 构建单个方向上的折线图 - * - * @param {number} seriesIndex 系列索引 - */ - _buildSinglePosition : function (position, seriesArray) { - var mapData = this._mapData(seriesArray); - var locationMap = mapData.locationMap; - var maxDataLength = mapData.maxDataLength; - - if (maxDataLength === 0 || locationMap.length === 0) { - return; - } - switch (position) { - case 'bottom' : - case 'top' : - this._buildHorizontal(seriesArray, maxDataLength, locationMap, this.xMarkMap); - break; - case 'left' : - case 'right' : - this._buildVertical(seriesArray, maxDataLength, locationMap, this.xMarkMap); - break; - } - - for (var i = 0, l = seriesArray.length; i < l; i++) { - this.buildMark(seriesArray[i]); - } - }, - - /** - * 数据整形 - * 数组位置映射到系列索引 - */ - _mapData : function (seriesArray) { - var series = this.series; - var serie; // 临时映射变量 - var dataIndex = 0; // 堆积数据所在位置映射 - var stackMap = {}; // 堆积数据位置映射,堆积组在二维中的第几项 - var magicStackKey = '__kener__stack__'; // 堆积命名,非堆积数据安单一堆积处理 - var stackKey; // 临时映射变量 - var serieName; // 临时映射变量 - var legend = this.component.legend; - var locationMap = []; // 需要返回的东西:数组位置映射到系列索引 - var maxDataLength = 0; // 需要返回的东西:最大数据长度 - var iconShape; - // 计算需要显示的个数和分配位置并记在下面这个结构里 - for (var i = 0, l = seriesArray.length; i < l; i++) { - serie = series[seriesArray[i]]; - serieName = serie.name; - - this._sIndex2ShapeMap[seriesArray[i]] - = this._sIndex2ShapeMap[seriesArray[i]] - || this.query(serie,'symbol') - || this._symbol[i % this._symbol.length]; - - if (legend){ - this.selectedMap[serieName] = legend.isSelected(serieName); - - this._sIndex2ColorMap[seriesArray[i]] - = legend.getColor(serieName); - - iconShape = legend.getItemShape(serieName); - if (iconShape) { - // 回调legend,换一个更形象的icon - iconShape.style.iconType = 'legendLineIcon'; - iconShape.style.symbol = - this._sIndex2ShapeMap[seriesArray[i]]; - - legend.setItemShape(serieName, iconShape); - } - } else { - this.selectedMap[serieName] = true; - this._sIndex2ColorMap[seriesArray[i]] - = this.zr.getColor(seriesArray[i]); - } - - if (this.selectedMap[serieName]) { - stackKey = serie.stack || (magicStackKey + seriesArray[i]); - if (typeof stackMap[stackKey] == 'undefined') { - stackMap[stackKey] = dataIndex; - locationMap[dataIndex] = [seriesArray[i]]; - dataIndex++; - } - else { - // 已经分配了位置就推进去就行 - locationMap[stackMap[stackKey]].push(seriesArray[i]); - } - } - // 兼职帮算一下最大长度 - maxDataLength = Math.max(maxDataLength, serie.data.length); - } - /* 调试输出 - var s = ''; - for (var i = 0, l = maxDataLength; i < l; i++) { - s = '['; - for (var j = 0, k = locationMap.length; j < k; j++) { - s +='[' - for (var m = 0, n = locationMap[j].length - 1; m < n; m++) { - s += series[locationMap[j][m]].data[i] + ',' - } - s += series[locationMap[j][locationMap[j].length - 1]] - .data[i]; - s += ']' - } - s += ']'; - console.log(s); - } - console.log(locationMap) - */ - - return { - locationMap : locationMap, - maxDataLength : maxDataLength - }; + this._buildPosition(); }, /** * 构建类目轴为水平方向的折线图系列 */ - _buildHorizontal : function (seriesArray, maxDataLength, locationMap, xMarkMap) { + _buildHorizontal: function (seriesArray, maxDataLength, locationMap, xMarkMap) { var series = this.series; // 确定类目轴和数值轴,同一方向随便找一个即可 var seriesIndex = locationMap[0][0]; var serie = series[seriesIndex]; - var xAxisIndex = serie.xAxisIndex; - var categoryAxis = this.component.xAxis.getAxis(xAxisIndex); - var yAxisIndex; // 数值轴各异 + var categoryAxis = this.component.xAxis.getAxis(serie.xAxisIndex || 0); var valueAxis; // 数值轴各异 var x; @@ -233,35 +114,32 @@ define(function (require) { var data; var value; for (var i = 0, l = maxDataLength; i < l; i++) { - if (typeof categoryAxis.getNameByIndex(i) == 'undefined') { + if (categoryAxis.getNameByIndex(i) == null) { // 系列数据超出类目轴长度 break; } x = categoryAxis.getCoordByIndex(i); for (var j = 0, k = locationMap.length; j < k; j++) { // 堆积数据用第一条valueAxis - yAxisIndex = series[locationMap[j][0]].yAxisIndex || 0; - valueAxis = this.component.yAxis.getAxis(yAxisIndex); + valueAxis = this.component.yAxis.getAxis( + series[locationMap[j][0]].yAxisIndex || 0 + ); baseYP = lastYP = baseYN = lastYN = valueAxis.getCoord(0); for (var m = 0, n = locationMap[j].length; m < n; m++) { seriesIndex = locationMap[j][m]; serie = series[seriesIndex]; data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; + value = this.getDataFromOption(data, '-'); curPLMap[seriesIndex] = curPLMap[seriesIndex] || []; xMarkMap[seriesIndex] = xMarkMap[seriesIndex] || { - min : Number.POSITIVE_INFINITY, - max : Number.NEGATIVE_INFINITY, - sum : 0, - counter : 0, - average : 0 + min: Number.POSITIVE_INFINITY, + max: Number.NEGATIVE_INFINITY, + sum: 0, + counter: 0, + average: 0 }; - if (value == '-') { + if (value === '-') { // 空数据则把正在记录的curPLMap添加到finalPLMap中 if (curPLMap[seriesIndex].length > 0) { this.finalPLMap[seriesIndex] = @@ -316,19 +194,12 @@ define(function (require) { seriesIndex = locationMap[j][m]; serie = series[seriesIndex]; data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; + value = this.getDataFromOption(data, '-'); if (value != '-') { // 只关心空数据 continue; } - if (this.deepQuery( - [data, serie, this.option], 'calculable' - ) - ) { + if (this.deepQuery([data, serie, this.option], 'calculable')) { symbolSize = this.deepQuery( [data, serie], 'symbolSize' @@ -353,31 +224,7 @@ define(function (require) { } } - for (var j = 0, k = locationMap.length; j < k; j++) { - for (var m = 0, n = locationMap[j].length; m < n; m++) { - seriesIndex = locationMap[j][m]; - if (xMarkMap[seriesIndex].counter > 0) { - xMarkMap[seriesIndex].average = - (xMarkMap[seriesIndex].sum / xMarkMap[seriesIndex].counter).toFixed(2) - - 0; - } - y = this.component.yAxis.getAxis(series[seriesIndex].yAxisIndex || 0) - .getCoord(xMarkMap[seriesIndex].average); - xMarkMap[seriesIndex].averageLine = [ - [this.component.grid.getX(), y], - [this.component.grid.getXend(), y] - ]; - - xMarkMap[seriesIndex].minLine = [ - [this.component.grid.getX(), xMarkMap[seriesIndex].minY], - [this.component.grid.getXend(), xMarkMap[seriesIndex].minY] - ]; - xMarkMap[seriesIndex].maxLine = [ - [this.component.grid.getX(), xMarkMap[seriesIndex].maxY], - [this.component.grid.getXend(), xMarkMap[seriesIndex].maxY] - ]; - } - } + this._calculMarkMapXY(xMarkMap, locationMap, 'y'); this._buildBorkenLine(seriesArray, this.finalPLMap, categoryAxis, 'horizontal'); }, @@ -385,14 +232,12 @@ define(function (require) { /** * 构建类目轴为垂直方向的折线图系列 */ - _buildVertical : function (seriesArray, maxDataLength, locationMap, xMarkMap) { + _buildVertical: function (seriesArray, maxDataLength, locationMap, xMarkMap) { var series = this.series; // 确定类目轴和数值轴,同一方向随便找一个即可 var seriesIndex = locationMap[0][0]; var serie = series[seriesIndex]; - var yAxisIndex = serie.yAxisIndex; - var categoryAxis = this.component.yAxis.getAxis(yAxisIndex); - var xAxisIndex; // 数值轴各异 + var categoryAxis = this.component.yAxis.getAxis(serie.yAxisIndex || 0); var valueAxis; // 数值轴各异 var x; @@ -406,35 +251,32 @@ define(function (require) { var data; var value; for (var i = 0, l = maxDataLength; i < l; i++) { - if (typeof categoryAxis.getNameByIndex(i) == 'undefined') { + if (categoryAxis.getNameByIndex(i) == null) { // 系列数据超出类目轴长度 break; } y = categoryAxis.getCoordByIndex(i); for (var j = 0, k = locationMap.length; j < k; j++) { // 堆积数据用第一条valueAxis - xAxisIndex = series[locationMap[j][0]].xAxisIndex || 0; - valueAxis = this.component.xAxis.getAxis(xAxisIndex); + valueAxis = this.component.xAxis.getAxis( + series[locationMap[j][0]].xAxisIndex || 0 + ); baseXP = lastXP = baseXN = lastXN = valueAxis.getCoord(0); for (var m = 0, n = locationMap[j].length; m < n; m++) { seriesIndex = locationMap[j][m]; serie = series[seriesIndex]; data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; + value = this.getDataFromOption(data, '-'); curPLMap[seriesIndex] = curPLMap[seriesIndex] || []; xMarkMap[seriesIndex] = xMarkMap[seriesIndex] || { - min : Number.POSITIVE_INFINITY, - max : Number.NEGATIVE_INFINITY, - sum : 0, - counter : 0, - average : 0 + min: Number.POSITIVE_INFINITY, + max: Number.NEGATIVE_INFINITY, + sum: 0, + counter: 0, + average: 0 }; - if (value == '-') { + if (value === '-') { // 空数据则把正在记录的curPLMap添加到finalPLMap中 if (curPLMap[seriesIndex].length > 0) { this.finalPLMap[seriesIndex] = @@ -489,19 +331,12 @@ define(function (require) { seriesIndex = locationMap[j][m]; serie = series[seriesIndex]; data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; + value = this.getDataFromOption(data, '-'); if (value != '-') { // 只关心空数据 continue; } - if (this.deepQuery( - [data, serie, this.option], 'calculable' - ) - ) { + if (this.deepQuery([data, serie, this.option], 'calculable')) { symbolSize = this.deepQuery( [data, serie], 'symbolSize' @@ -526,110 +361,147 @@ define(function (require) { } } + this._calculMarkMapXY(xMarkMap, locationMap, 'x'); + + this._buildBorkenLine(seriesArray, this.finalPLMap, categoryAxis, 'vertical'); + }, + + /** + * 构建双数值轴折线图 + */ + _buildOther: function(seriesArray, maxDataLength, locationMap, xMarkMap) { + var series = this.series; + var curPLMap = {}; // 正在记录的point list(PL) + var xAxis; + for (var j = 0, k = locationMap.length; j < k; j++) { for (var m = 0, n = locationMap[j].length; m < n; m++) { - seriesIndex = locationMap[j][m]; - if (xMarkMap[seriesIndex].counter > 0) { - xMarkMap[seriesIndex].average = - (xMarkMap[seriesIndex].sum / xMarkMap[seriesIndex].counter).toFixed(2) - - 0; - } + var seriesIndex = locationMap[j][m]; + var serie = series[seriesIndex]; + xAxis = this.component.xAxis.getAxis(serie.xAxisIndex || 0); + var yAxis = this.component.yAxis.getAxis(serie.yAxisIndex || 0); + var baseY = yAxis.getCoord(0); - x = this.component.xAxis.getAxis(series[seriesIndex].xAxisIndex || 0) - .getCoord(xMarkMap[seriesIndex].average); + curPLMap[seriesIndex] = curPLMap[seriesIndex] || []; + xMarkMap[seriesIndex] = xMarkMap[seriesIndex] + || { + min0: Number.POSITIVE_INFINITY, + min1: Number.POSITIVE_INFINITY, + max0: Number.NEGATIVE_INFINITY, + max1: Number.NEGATIVE_INFINITY, + sum0: 0, + sum1: 0, + counter0: 0, + counter1: 0, + average0: 0, + average1: 0 + }; + + for (var i = 0, l = serie.data.length; i < l; i++) { + var data = serie.data[i]; + var value = this.getDataFromOption(data, '-'); + if (!(value instanceof Array)) { + continue; + } + + var x = xAxis.getCoord(value[0]); + var y = yAxis.getCoord(value[1]); + curPLMap[seriesIndex].push( + // x, y, dataIndex, name, 填充用 + [x, y, i, value[0], x, baseY] + ); - xMarkMap[seriesIndex].averageLine = [ - [x, this.component.grid.getYend()], - [x, this.component.grid.getY()] - ]; - xMarkMap[seriesIndex].minLine = [ - [xMarkMap[seriesIndex].minX, this.component.grid.getYend()], - [xMarkMap[seriesIndex].minX, this.component.grid.getY()] - ]; - xMarkMap[seriesIndex].maxLine = [ - [xMarkMap[seriesIndex].maxX, this.component.grid.getYend()], - [xMarkMap[seriesIndex].maxX, this.component.grid.getY()] - ]; + if (xMarkMap[seriesIndex].min0 > value[0]) { + xMarkMap[seriesIndex].min0 = value[0]; + xMarkMap[seriesIndex].minY0 = y; + xMarkMap[seriesIndex].minX0 = x; + } + if (xMarkMap[seriesIndex].max0 < value[0]) { + xMarkMap[seriesIndex].max0 = value[0]; + xMarkMap[seriesIndex].maxY0 = y; + xMarkMap[seriesIndex].maxX0 = x; + } + xMarkMap[seriesIndex].sum0 += value[0]; + xMarkMap[seriesIndex].counter0++; + + if (xMarkMap[seriesIndex].min1 > value[1]) { + xMarkMap[seriesIndex].min1 = value[1]; + xMarkMap[seriesIndex].minY1 = y; + xMarkMap[seriesIndex].minX1 = x; + } + if (xMarkMap[seriesIndex].max1 < value[1]) { + xMarkMap[seriesIndex].max1 = value[1]; + xMarkMap[seriesIndex].maxY1 = y; + xMarkMap[seriesIndex].maxX1 = x; + } + xMarkMap[seriesIndex].sum1 += value[1]; + xMarkMap[seriesIndex].counter1++; + } } } - this._buildBorkenLine(seriesArray, this.finalPLMap, categoryAxis, 'vertical'); + // 把剩余未完成的curPLMap全部添加到finalPLMap中 + for (var sId in curPLMap) { + if (curPLMap[sId].length > 0) { + this.finalPLMap[sId] = this.finalPLMap[sId] || []; + this.finalPLMap[sId].push(curPLMap[sId]); + curPLMap[sId] = []; + } + } + + this._calculMarkMapXY(xMarkMap, locationMap, 'xy'); + + this._buildBorkenLine(seriesArray, this.finalPLMap, xAxis, 'other'); }, - + /** * 生成折线和折线上的拐点 */ - _buildBorkenLine : function (seriesArray, pointList, categoryAxis, orient) { + _buildBorkenLine: function (seriesArray, pointList, categoryAxis, curOrient) { + var orient = curOrient == 'other' ? 'horizontal' : curOrient; var series = this.series; - var defaultColor; - - // 折线相关 - var lineWidth; - var lineType; - var lineColor; - var normalColor; - - // 填充相关 - var isFill; - var fillNormalColor; - - var serie; var data; - var seriesPL; - var singlePL; - var brokenLineShape; - var halfSmoothPolygonShape; - - var isLarge; // 堆积层叠需求,反顺序构建 - var seriesIndex; for (var sIdx = seriesArray.length - 1; sIdx >= 0; sIdx--) { - seriesIndex = seriesArray[sIdx]; - serie = series[seriesIndex]; - seriesPL = pointList[seriesIndex]; - if (serie.type == this.type && typeof seriesPL != 'undefined') { - defaultColor = this._sIndex2ColorMap[seriesIndex]; - // 多级控制 - lineWidth = this.query( + var seriesIndex = seriesArray[sIdx]; + var serie = series[seriesIndex]; + var seriesPL = pointList[seriesIndex]; + if (serie.type === this.type && seriesPL != null) { + var bbox = this._getBbox(seriesIndex, orient); + var defaultColor = this._sIndex2ColorMap[seriesIndex]; + // 折线相关,多级控制 + var lineWidth = this.query( serie, 'itemStyle.normal.lineStyle.width' ); - lineType = this.query( + var lineType = this.query( serie, 'itemStyle.normal.lineStyle.type' ); - lineColor = this.query( + var lineColor = this.query( serie, 'itemStyle.normal.lineStyle.color' ); - normalColor = this.getItemStyleColor( + var normalColor = this.getItemStyleColor( this.query(serie, 'itemStyle.normal.color'), seriesIndex, -1 ); - isFill = typeof this.query( - serie, 'itemStyle.normal.areaStyle' - ) != 'undefined'; - - fillNormalColor = this.query( + // 填充相关 + var isFill = this.query(serie, 'itemStyle.normal.areaStyle') != null; + var fillNormalColor = this.query( serie, 'itemStyle.normal.areaStyle.color' ); for (var i = 0, l = seriesPL.length; i < l; i++) { - singlePL = seriesPL[i]; - isLarge = this._isLarge(orient, singlePL); + var singlePL = seriesPL[i]; + var isLarge = curOrient != 'other' && this._isLarge(orient, singlePL); if (!isLarge) { // 非大数据模式才显示拐点symbol for (var j = 0, k = singlePL.length; j < k; j++) { data = serie.data[singlePL[j][2]]; - if (this.deepQuery( - [data, serie], 'showAllSymbol' - ) // 全显示 - || (categoryAxis.isMainAxis(singlePL[j][2]) - && this.deepQuery( - [data, serie], 'symbol' - ) != 'none' - ) // 主轴非空 - || this.deepQuery( - [data, serie, this.option], - 'calculable' - ) // 可计算 + if (this.deepQuery([data, serie, this.option], 'calculable') // 可计算 + || this.deepQuery([data, serie], 'showAllSymbol') // 全显示 + || (categoryAxis.type === 'categoryAxis' // 主轴非空 + && categoryAxis.isMainAxis(singlePL[j][2]) + && this.deepQuery([data, serie], 'symbol') != 'none' + ) ) { this.shapeList.push(this._getSymbol( seriesIndex, @@ -648,18 +520,20 @@ define(function (require) { } // 折线图 - brokenLineShape = new BrokenLineShape({ - zlevel : this._zlevelBase, - style : { + var polylineShape = new PolylineShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { miterLimit: lineWidth, - pointList : singlePL, - strokeColor : lineColor - || normalColor - || defaultColor, - lineWidth : lineWidth, - lineType : lineType, - smooth : this._getSmooth(serie.smooth), - shadowColor : this.query( + pointList: singlePL, + strokeColor: lineColor + || normalColor + || defaultColor, + lineWidth: lineWidth, + lineType: lineType, + smooth: this._getSmooth(serie.smooth), + smoothConstraint: bbox, + shadowColor: this.query( serie, 'itemStyle.normal.lineStyle.shadowColor' ), @@ -676,26 +550,27 @@ define(function (require) { 'itemStyle.normal.lineStyle.shadowOffsetY' ) }, - hoverable : false, - _main : true, - _seriesIndex : seriesIndex, - _orient : orient + hoverable: false, + _main: true, + _seriesIndex: seriesIndex, + _orient: orient }); ecData.pack( - brokenLineShape, + polylineShape, series[seriesIndex], seriesIndex, 0, i, series[seriesIndex].name ); - this.shapeList.push(brokenLineShape); + this.shapeList.push(polylineShape); if (isFill) { - halfSmoothPolygonShape = new HalfSmoothPolygonShape({ - zlevel : this._zlevelBase, - style : { + var halfSmoothPolygonShape = new HalfSmoothPolygonShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { miterLimit: lineWidth, - pointList : zrUtil.clone(singlePL).concat([ + pointList: zrUtil.clone(singlePL).concat([ [ singlePL[singlePL.length - 1][4], singlePL[singlePL.length - 1][5] @@ -705,16 +580,20 @@ define(function (require) { singlePL[0][5] ] ]), - brushType : 'fill', - smooth : this._getSmooth(serie.smooth), - color : fillNormalColor - ? fillNormalColor - : zrColor.alpha(defaultColor,0.5) + brushType: 'fill', + smooth: this._getSmooth(serie.smooth), + smoothConstraint: bbox, + color: fillNormalColor + ? fillNormalColor + : zrColor.alpha(defaultColor,0.5) + }, + highlightStyle: { + brushType: 'fill' }, - hoverable : false, - _main : true, - _seriesIndex : seriesIndex, - _orient : orient + hoverable: false, + _main: true, + _seriesIndex: seriesIndex, + _orient: orient }); ecData.pack( halfSmoothPolygonShape, @@ -728,12 +607,38 @@ define(function (require) { } }, - _isLarge : function(orient, singlePL) { + _getBbox: function(seriesIndex, orient) { + var bbox = this.component.grid.getBbox(); + var xMarkMap = this.xMarkMap[seriesIndex]; + if (xMarkMap.minX0 != null) { + return [ + [ + Math.min(xMarkMap.minX0, xMarkMap.maxX0, xMarkMap.minX1, xMarkMap.maxX1), + Math.min(xMarkMap.minY0, xMarkMap.maxY0, xMarkMap.minY1, xMarkMap.maxY1) + ], + [ + Math.max(xMarkMap.minX0, xMarkMap.maxX0, xMarkMap.minX1, xMarkMap.maxX1), + Math.max(xMarkMap.minY0, xMarkMap.maxY0, xMarkMap.minY1, xMarkMap.maxY1) + ] + ]; + } + else if (orient === 'horizontal') { + bbox[0][1] = Math.min(xMarkMap.minY, xMarkMap.maxY); + bbox[1][1] = Math.max(xMarkMap.minY, xMarkMap.maxY); + } + else { + bbox[0][0] = Math.min(xMarkMap.minX, xMarkMap.maxX); + bbox[1][0] = Math.max(xMarkMap.minX, xMarkMap.maxX); + } + return bbox; + }, + + _isLarge: function(orient, singlePL) { if (singlePL.length < 2) { return false; } else { - return orient == 'horizontal' + return orient === 'horizontal' ? (Math.abs(singlePL[0][0] - singlePL[1][0]) < 0.5) : (Math.abs(singlePL[0][1] - singlePL[1][1]) < 0.5); } @@ -742,9 +647,9 @@ define(function (require) { /** * 大规模pointList优化 */ - _getLargePointList : function(orient, singlePL) { + _getLargePointList: function(orient, singlePL) { var total; - if (orient == 'horizontal') { + if (orient === 'horizontal') { total = this.component.grid.getWidth(); } else { @@ -759,11 +664,11 @@ define(function (require) { return newList; }, - _getSmooth : function (isSmooth/*, pointList, orient*/) { + _getSmooth: function (isSmooth/*, pointList, orient*/) { if (isSmooth) { /* 不科学啊,发现0.3通用了 var delta; - if (orient == 'horizontal') { + if (orient === 'horizontal') { delta = Math.abs(pointList[0][0] - pointList[1][0]); } else { @@ -780,10 +685,11 @@ define(function (require) { /** * 生成空数据所需的可计算提示图形 */ - _getCalculableItem : function (seriesIndex, dataIndex, name, x, y, orient) { + _getCalculableItem: function (seriesIndex, dataIndex, name, x, y, orient) { var series = this.series; var color = series[seriesIndex].calculableHolderColor - || this.ecTheme.calculableHolderColor; + || this.ecTheme.calculableHolderColor + || ecConfig.calculableHolderColor; var itemShape = this._getSymbol( seriesIndex, dataIndex, name, @@ -802,7 +708,7 @@ define(function (require) { /** * 生成折线图上的拐点图形 */ - _getSymbol : function (seriesIndex, dataIndex, name, x, y, orient) { + _getSymbol: function (seriesIndex, dataIndex, name, x, y, orient) { var series = this.series; var serie = series[seriesIndex]; var data = serie.data[dataIndex]; @@ -813,9 +719,10 @@ define(function (require) { this._sIndex2ShapeMap[seriesIndex], this._sIndex2ColorMap[seriesIndex], '#fff', - orient == 'vertical' ? 'horizontal' : 'vertical' // 翻转 + orient === 'vertical' ? 'horizontal' : 'vertical' // 翻转 ); - itemShape.zlevel = this._zlevelBase + 1; + itemShape.zlevel = this.getZlevelBase(); + itemShape.z = this.getZBase() + 1; if (this.deepQuery([data, serie, this.option], 'calculable')) { this.setCalculable(itemShape); @@ -826,21 +733,25 @@ define(function (require) { }, // 位置转换 - getMarkCoord : function (seriesIndex, mpData) { + getMarkCoord: function (seriesIndex, mpData) { var serie = this.series[seriesIndex]; var xMarkMap = this.xMarkMap[seriesIndex]; var xAxis = this.component.xAxis.getAxis(serie.xAxisIndex); var yAxis = this.component.yAxis.getAxis(serie.yAxisIndex); if (mpData.type - && (mpData.type == 'max' || mpData.type == 'min' || mpData.type == 'average') + && (mpData.type === 'max' || mpData.type === 'min' || mpData.type === 'average') ) { // 特殊值内置支持 + var valueIndex = mpData.valueIndex != null + ? mpData.valueIndex + : xMarkMap.maxX0 != null + ? '1' : ''; return [ - xMarkMap[mpData.type + 'X'], - xMarkMap[mpData.type + 'Y'], - xMarkMap[mpData.type + 'Line'], - xMarkMap[mpData.type] + xMarkMap[mpData.type + 'X' + valueIndex], + xMarkMap[mpData.type + 'Y' + valueIndex], + xMarkMap[mpData.type + 'Line' + valueIndex], + xMarkMap[mpData.type + valueIndex] ]; } @@ -858,7 +769,7 @@ define(function (require) { /** * 刷新 */ - refresh : function (newOption) { + refresh: function (newOption) { if (newOption) { this.option = newOption; this.series = newOption.series; @@ -868,7 +779,7 @@ define(function (require) { this._buildShape(); }, - ontooltipHover : function (param, tipShape) { + ontooltipHover: function (param, tipShape) { var seriesIndex = param.seriesIndex; var dataIndex = param.dataIndex; var seriesPL; @@ -880,7 +791,7 @@ define(function (require) { for (var i = 0, l = seriesPL.length; i < l; i++) { singlePL = seriesPL[i]; for (var j = 0, k = singlePL.length; j < k; j++) { - if (dataIndex == singlePL[j][2]) { + if (dataIndex === singlePL[j][2]) { tipShape.push(this._getSymbol( seriesIndex[len], // seriesIndex singlePL[j][2], // dataIndex @@ -899,7 +810,7 @@ define(function (require) { /** * 动态数据增加动画 */ - addDataAnimation : function (params) { + addDataAnimation: function (params) { var series = this.series; var aniMap = {}; // seriesIndex索引参数 for (var i = 0, l = params.length; i < l; i++) { @@ -921,43 +832,31 @@ define(function (require) { // 主线动画 dx = Math.abs(pointList[0][0] - pointList[1][0]); dy = Math.abs(pointList[0][1] - pointList[1][1]); - isHorizontal = - this.shapeList[i]._orient == 'horizontal'; + isHorizontal = this.shapeList[i]._orient === 'horizontal'; if (aniMap[seriesIndex][2]) { // 队头加入删除末尾 - if (this.shapeList[i].type == 'polygon') { + if (this.shapeList[i].type === 'half-smooth-polygon') { //区域图 var len = pointList.length; - this.shapeList[i].style.pointList[len - 3] - = pointList[len - 2]; - isHorizontal - ? (this.shapeList[i].style.pointList[len - 3][0] - = pointList[len - 4][0] - ) - : (this.shapeList[i].style.pointList[len - 3][1] - = pointList[len - 4][1] - ); - this.shapeList[i].style.pointList[len - 2] - = pointList[len - 1]; + this.shapeList[i].style.pointList[len - 3] = pointList[len - 2]; + this.shapeList[i].style.pointList[len - 3][isHorizontal ? 0 : 1] + = pointList[len - 4][isHorizontal ? 0 : 1]; + this.shapeList[i].style.pointList[len - 2] = pointList[len - 1]; } this.shapeList[i].style.pointList.pop(); - isHorizontal ? (x = dx, y = 0) : (x = 0, y = -dy); } else { // 队尾加入删除头部 this.shapeList[i].style.pointList.shift(); - if (this.shapeList[i].type == 'polygon') { + if (this.shapeList[i].type === 'half-smooth-polygon') { //区域图 - var targetPoint = - this.shapeList[i].style.pointList.pop(); + var targetPoint =this.shapeList[i].style.pointList.pop(); isHorizontal ? (targetPoint[0] = pointList[0][0]) : (targetPoint[1] = pointList[0][1]); - this.shapeList[i].style.pointList.push( - targetPoint - ); + this.shapeList[i].style.pointList.push(targetPoint); } isHorizontal ? (x = -dx, y = 0) : (x = 0, y = dy); } @@ -965,7 +864,7 @@ define(function (require) { this.zr.modShape( this.shapeList[i].id, { - style : { + style: { pointList: this.shapeList[i].style.pointList } }, @@ -976,7 +875,7 @@ define(function (require) { // 拐点动画 if (aniMap[seriesIndex][2] && this.shapeList[i]._dataIndex - == series[seriesIndex].data.length - 1 + === series[seriesIndex].data.length - 1 ) { // 队头加入删除末尾 this.zr.delShape(this.shapeList[i].id); @@ -993,8 +892,8 @@ define(function (require) { this.shapeList[i].position = [0, 0]; this.zr.animate(this.shapeList[i].id, '') .when( - 500, - {position : [x, y]} + this.query(this.option, 'animationDurationUpdate'), + { position: [ x, y ] } ) .start(); } @@ -1002,7 +901,7 @@ define(function (require) { } }; - function legendLineIcon(ctx, style) { + function legendLineIcon(ctx, style, refreshNextFrame) { var x = style.x; var y = style.y; var width = style.width; @@ -1021,7 +920,7 @@ define(function (require) { y -= 1; symbol = 'star'; } - else if (symbol == 'rectangle' || symbol == 'arrow') { + else if (symbol === 'rectangle' || symbol === 'arrow') { x += (width - height) / 2; width = height; } @@ -1044,16 +943,22 @@ define(function (require) { ctx.lineTo(x2 + 5, y2 + dy); ctx.moveTo(x2 + style.width - 5, y2 + dy); ctx.lineTo(x2 + style.width, y2 + dy); - - symbol(ctx, { - x : x + 4, - y : y + 4, - width : width - 8, - height : height - 8, - n : dy, - image : imageLocation - }); - + var self = this; + symbol( + ctx, + { + x: x + 4, + y: y + 4, + width: width - 8, + height: height - 8, + n: dy, + image: imageLocation + }, + function () { + self.modSelf(); + refreshNextFrame(); + } + ); } else { ctx.moveTo(x, y + dy); @@ -1063,7 +968,6 @@ define(function (require) { IconShape.prototype.iconLibrary['legendLineIcon'] = legendLineIcon; zrUtil.inherits(Line, ChartBase); - zrUtil.inherits(Line, ComponentBase); // 图表注册 require('../chart').define('line', Line); diff --git a/amd/chart/map.js b/amd/chart/map.js index 335ea6f..08d9b9a 100644 --- a/amd/chart/map.js +++ b/amd/chart/map.js @@ -2,11 +2,10 @@ * echarts图表类:地图 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ define(function (require) { - var ComponentBase = require('../component/base'); var ChartBase = require('./base'); // 图形依赖 @@ -19,8 +18,62 @@ define(function (require) { var EllipseShape = require('../zrender/shape/Ellipse'); // 组件依赖 require('../component/dataRange'); + require('../component/roamController'); var ecConfig = require('../config'); + // 地图默认参数 + ecConfig.map = { + zlevel: 0, // 一级层叠 + z: 2, // 二级层叠 + mapType: 'china', // 各省的mapType暂时都用中文 + //mapLocation: { + // x: 'center' | 'left' | 'right' | 'x%' | {number}, + // y: 'center' | 'top' | 'bottom' | 'x%' | {number} + // width // 自适应 + // height // 自适应 + //}, + // mapValueCalculation: 'sum', // 数值合并方式,默认加和,可选为: + // 'sum' | 'average' | 'max' | 'min' + mapValuePrecision: 0, // 地图数值计算结果小数精度 + showLegendSymbol: true, // 显示图例颜色标识(系列标识的小圆点),存在legend时生效 + // selectedMode: false, // 选择模式,默认关闭,可选single,multiple + dataRangeHoverLink: true, + hoverable: true, + clickable: true, + // roam: false, // 是否开启缩放及漫游模式 + // scaleLimit: null, + itemStyle: { + normal: { + // color: 各异, + borderColor: 'rgba(0,0,0,0)', + borderWidth: 1, + areaStyle: { + color: '#ccc' + }, + label: { + show: false, + textStyle: { + color: 'rgb(139,69,19)' + } + } + }, + emphasis: { // 也是选中样式 + // color: 各异, + borderColor: 'rgba(0,0,0,0)', + borderWidth: 1, + areaStyle: { + color: 'rgba(255,215,0,0.8)' + }, + label: { + show: false, + textStyle: { + color: 'rgb(100,0,0)' + } + } + } + } + }; + var ecData = require('../util/ecData'); var zrUtil = require('../zrender/tool/util'); var zrConfig = require('../zrender/config'); @@ -38,27 +91,33 @@ define(function (require) { * @param {Object} component 组件 */ function Map(ecTheme, messageCenter, zr, option, myChart){ - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); // 图表基类 - ChartBase.call(this); + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); var self = this; - self._onmousewheel = function(param){ - return self.__onmousewheel(param); + self._onmousewheel = function(params) { + return self.__onmousewheel(params); + }; + self._onmousedown = function(params) { + return self.__onmousedown(params); }; - self._onmousedown = function(param){ - return self.__onmousedown(param); + self._onmousemove = function(params) { + return self.__onmousemove(params); }; - self._onmousemove = function(param){ - return self.__onmousemove(param); + self._onmouseup = function(params) { + return self.__onmouseup(params); }; - self._onmouseup = function(param){ - return self.__onmouseup(param); + self._onroamcontroller = function(params) { + return self.__onroamcontroller(params); + }; + self._ondrhoverlink = function(params) { + return self.__ondrhoverlink(params); }; this._isAlive = true; // 活着标记 this._selectedMode = {}; // 选择模式 + this._activeMapType = {}; // 当前活跃的地图类型 + this._clickable = {}; // 悬浮高亮模式,索引到图表 this._hoverable = {}; // 悬浮高亮模式,索引到图表 this._showLegendSymbol = {}; // 显示图例颜色标识 this._selected = {}; // 地图选择状态 @@ -69,11 +128,11 @@ define(function (require) { this._refreshDelayTicket; // 滚轮缩放时让refresh飞一会 this._mapDataRequireCounter; // 异步回调计数器 this._markAnimation = false; + this._hoverLinkMap = {}; // 漫游相关信息 this._roamMap = {}; this._scaleLimitMap = {}; - this._needRoam; this._mx; this._my; this._mousedown; @@ -81,10 +140,11 @@ define(function (require) { this._curMapType; // 当前移动的地图类型 this.refresh(option); - if (this._needRoam) { - this.zr.on(zrConfig.EVENT.MOUSEWHEEL, this._onmousewheel); - this.zr.on(zrConfig.EVENT.MOUSEDOWN, this._onmousedown); - } + + this.zr.on(zrConfig.EVENT.MOUSEWHEEL, this._onmousewheel); + this.zr.on(zrConfig.EVENT.MOUSEDOWN, this._onmousedown); + messageCenter.bind(ecConfig.EVENT.ROAMCONTROLLER, this._onroamcontroller); + messageCenter.bind(ecConfig.EVENT.DATA_RANGE_HOVERLINK, this._ondrhoverlink); } Map.prototype = { @@ -106,7 +166,6 @@ define(function (require) { var mapSeries = {}; var mapValuePrecision = {}; var valueCalculation = {}; - this._needRoam = false; for (var i = 0, l = series.length; i < l; i++) { if (series[i].type == ecConfig.CHART_TYPE_MAP) { // map series[i] = this.reformOption(series[i]); @@ -117,14 +176,16 @@ define(function (require) { || series[i].mapValuePrecision; this._scaleLimitMap[mapType] = this._scaleLimitMap[mapType] || {}; series[i].scaleLimit - && zrUtil.merge(this._scaleLimitMap[mapType], series[i].scaleLimit, true); + && zrUtil.merge(this._scaleLimitMap[mapType], series[i].scaleLimit, true); this._roamMap[mapType] = series[i].roam || this._roamMap[mapType]; - this._needRoam = this._needRoam || this._roamMap[mapType]; + + this._hoverLinkMap[mapType] = series[i].dataRangeHoverLink + || this._hoverLinkMap[mapType]; this._nameMap[mapType] = this._nameMap[mapType] || {}; - series[i].nameMap - && zrUtil.merge(this._nameMap[mapType], series[i].nameMap, true); + series[i].nameMap + && zrUtil.merge(this._nameMap[mapType], series[i].nameMap, true); this._activeMapType[mapType] = true; if (series[i].textFixed) { @@ -140,14 +201,18 @@ define(function (require) { this._selectedMode[mapType] = this._selectedMode[mapType] || series[i].selectedMode; - if (typeof this._hoverable[mapType] == 'undefined' - || this._hoverable[mapType] // false 1票否决 - ) { + if (this._hoverable[mapType] == null || this._hoverable[mapType]) { + // false 1票否决 this._hoverable[mapType] = series[i].hoverable; } - if (typeof this._showLegendSymbol[mapType] == 'undefined' - || this._showLegendSymbol[mapType] // false 1票否决 + if (this._clickable[mapType] == null || this._clickable[mapType]) { + // false 1票否决 + this._clickable[mapType] = series[i].clickable; + } + if (this._showLegendSymbol[mapType] == null + || this._showLegendSymbol[mapType] ) { + // false 1票否决 this._showLegendSymbol[mapType] = series[i].showLegendSymbol; } @@ -171,12 +236,10 @@ define(function (require) { data[j][key]; } else if (!isNaN(data[j].value)) { - typeof valueData[mapType][name].value - == 'undefined' + valueData[mapType][name].value == null && (valueData[mapType][name].value = 0); - valueData[mapType][name].value += - data[j].value; + valueData[mapType][name].value += data[j].value; } } //索引有该区域的系列样式 @@ -236,7 +299,7 @@ define(function (require) { _mapDataCallback : function (mt, vd, ms) { var self = this; return function (md) { - if (!self._isAlive) { + if (!self._isAlive || self._activeMapType[mt] == null) { // 异步地图数据回调时有可能实例已经被释放 return; } @@ -265,7 +328,7 @@ define(function (require) { self._buildMark(mt, ms); if (--self._mapDataRequireCounter <= 0) { self.addShapeList(); - self.zr.refresh(); + self.zr.refreshNextFrame(); } }; }, @@ -553,19 +616,13 @@ define(function (require) { //y = isNaN(cusY) ? padding : cusY; y = this.parsePercent(cusY, zrHeight); y = isNaN(y) ? padding : y; - if (typeof width == 'undefined') { - width = zrWidth - x - 2 * padding; - } - else { - width = this.parsePercent(width, zrWidth); - } - - if (typeof height == 'undefined') { - height = zrHeight - y - 2 * padding; - } - else { - height = this.parsePercent(height, zrHeight); - } + + width = width == null + ? (zrWidth - x - 2 * padding) + : (this.parsePercent(width, zrWidth)); + height = height == null + ? (zrHeight - y - 2 * padding) + : (this.parsePercent(height, zrHeight)); var mapWidth = bbox.width; var mapHeight = bbox.height; @@ -644,7 +701,6 @@ define(function (require) { var data; var value; var queryTarget; - var defaultOption = this.ecTheme.map; var color; var font; @@ -674,7 +730,8 @@ define(function (require) { && legend.hasColor(series[data.seriesIndex[j]].name) ) { this.shapeList.push(new CircleShape({ - zlevel : this._zlevelBase + 1, + zlevel : this.getZlevelBase(), + z : this.getZBase() + 1, position : zrUtil.clone(style.position), _mapType : mapType, /* @@ -694,7 +751,6 @@ define(function (require) { })); } } - queryTarget.push(defaultOption); // level 1 value = data.value; } else { @@ -704,9 +760,10 @@ define(function (require) { for (var key in mapSeries) { queryTarget.push(series[key]); } - queryTarget.push(defaultOption); value = '-'; } + this.ecTheme.map && queryTarget.push(this.ecTheme.map); // level 1 + queryTarget.push(ecConfig); // level 1 // 值域控件控制 color = (dataRange && !isNaN(value)) @@ -753,8 +810,10 @@ define(function (require) { font = this.deepQuery(queryTarget, 'itemStyle.normal.label.textStyle'); // 文字标签避免覆盖单独一个shape textShape = { - zlevel : this._zlevelBase + 1, - hoverable: this._hoverable[mapType], + zlevel : this.getZlevelBase(), + z : this.getZBase() + 1, + //hoverable: this._hoverable[mapType], + //clickable: this._clickable[mapType], position : zrUtil.clone(style.position), _mapType : mapType, _geo : this.pos2geo( @@ -798,15 +857,17 @@ define(function (require) { } shape = { - zlevel : this._zlevelBase, - hoverable: this._hoverable[mapType], + zlevel : this.getZlevelBase(), + z : this.getZBase(), + //hoverable: this._hoverable[mapType], + //clickable: this._clickable[mapType], position : zrUtil.clone(style.position), style : style, highlightStyle : highlightStyle, _style: zrUtil.clone(style), _mapType: mapType }; - if (typeof style.scale != 'undefined') { + if (style.scale != null) { shape.scale = zrUtil.clone(style.scale); } @@ -829,7 +890,9 @@ define(function (require) { break; default : shape = new PathShape(shape); - shape.pathArray = shape._parsePathData(shape.style.path); + if (shape.buildPathArray) { + shape.style.pathArray = shape.buildPathArray(shape.style.path); + } break; } @@ -841,25 +904,28 @@ define(function (require) { shape.style = shape.highlightStyle; } + textShape.clickable = shape.clickable = + this._clickable[mapType] + && (data.clickable == null || data.clickable); + if (this._selectedMode[mapType]) { - this._selected[name] = typeof this._selected[name] != 'undefined' + this._selected[name] = this._selected[name] != null ? this._selected[name] : data.selected; this._mapTypeMap[name] = mapType; - if (typeof data.selectable == 'undefined' || data.selectable) { + if (data.selectable == null || data.selectable) { shape.clickable = textShape.clickable = true; shape.onclick = textShape.onclick = this.shapeHandler.onclick; } } if (this._hoverable[mapType] - && (typeof data.hoverable == 'undefined' || data.hoverable) + && (data.hoverable == null || data.hoverable) ) { textShape.hoverable = shape.hoverable = true; shape.hoverConnect = textShape.id; textShape.hoverConnect = shape.id; - shape.onmouseover = textShape.onmouseover = this.hoverConnect; } else { textShape.hoverable = shape.hoverable = false; @@ -901,6 +967,9 @@ define(function (require) { this._mapDataMap[mapType].transform.left, this._mapDataMap[mapType].transform.top ]; + if (mapType == 'none') { + position = [0, 0]; + } for (var sIdx in mapSeries) { this._seriesIndexToMapType[sIdx] = mapType; this.markAttachStyle[sIdx] = { @@ -966,9 +1035,10 @@ define(function (require) { var height; for (var mapType in this._mapDataMap) { transform = this._mapDataMap[mapType].transform; - if (!transform || !this._roamMap[mapType]) { + if (!transform || !this._roamMap[mapType] || !this._activeMapType[mapType]) { continue; } + left = transform.left; top = transform.top; width = transform.width; @@ -987,106 +1057,125 @@ define(function (require) { /** * 滚轮缩放 */ - __onmousewheel : function (param) { + __onmousewheel : function (params) { if (this.shapeList.length <= 0) { return; } - var event = param.event; + + var event = params.event; var mx = zrEvent.getX(event); var my = zrEvent.getY(event); - var delta = zrEvent.getDelta(event); - //delta = delta > 0 ? (-1) : 1; - var mapType = this._findMapTypeByPos(mx, my); - if (mapType) { - zrEvent.stop(event); - var transform = this._mapDataMap[mapType].transform; - var left = transform.left; - var top = transform.top; - var width = transform.width; - var height = transform.height; - // 位置转经纬度 - var geoAndPos = this.pos2geo(mapType, [mx - left, my - top]); - if (delta > 0) { - delta = 1.2; // 放大 - if (typeof this._scaleLimitMap[mapType].max != 'undefined' - && transform.baseScale >= this._scaleLimitMap[mapType].max - ) { - return; // 缩放限制 - } - } - else { - delta = 1 / 1.2; // 缩小 - if (typeof this._scaleLimitMap[mapType].min != 'undefined' - && transform.baseScale <= this._scaleLimitMap[mapType].min - ) { - return; // 缩放限制 - } + var delta; + var eventDelta = zrEvent.getDelta(event); + //eventDelta = eventDelta > 0 ? (-1) : 1; + var mapType; + var mapTypeControl = params.mapTypeControl; + if (!mapTypeControl) { + mapTypeControl = {}; + mapType = this._findMapTypeByPos(mx, my); + if (mapType && this._roamMap[mapType] && this._roamMap[mapType] != 'move') { + mapTypeControl[mapType] = true; } - transform.baseScale *= delta; - transform.scale.x *= delta; - transform.scale.y *= delta; - transform.width = width * delta; - transform.height = height * delta; - - this._mapDataMap[mapType].hasRoam = true; - this._mapDataMap[mapType].transform = transform; - // 经纬度转位置 - geoAndPos = this.geo2pos(mapType, geoAndPos); - // 保持视觉中心 - transform.left -= geoAndPos[0] - (mx - left); - transform.top -= geoAndPos[1] - (my - top); - this._mapDataMap[mapType].transform = transform; - - this.clearEffectShape(true); - for (var i = 0, l = this.shapeList.length; i < l; i++) { - if(this.shapeList[i]._mapType == mapType) { - this.shapeList[i].position[0] = transform.left; - this.shapeList[i].position[1] = transform.top; - if (this.shapeList[i].type == 'path' - || this.shapeList[i].type == 'symbol' - || this.shapeList[i].type == 'circle' - || this.shapeList[i].type == 'rectangle' - || this.shapeList[i].type == 'polygon' - || this.shapeList[i].type == 'line' - || this.shapeList[i].type == 'ellipse' + } + + var haveScale = false; + for (mapType in mapTypeControl) { + if (mapTypeControl[mapType]) { + haveScale = true; + var transform = this._mapDataMap[mapType].transform; + var left = transform.left; + var top = transform.top; + var width = transform.width; + var height = transform.height; + // 位置转经纬度 + var geoAndPos = this.pos2geo(mapType, [mx - left, my - top]); + if (eventDelta > 0) { + delta = 1.2; // 放大 + if (this._scaleLimitMap[mapType].max != null + && transform.baseScale >= this._scaleLimitMap[mapType].max ) { - this.shapeList[i].scale[0] *= delta; - this.shapeList[i].scale[1] *= delta; + continue; // 缩放限制 } - else if (this.shapeList[i].type == 'mark-line') { - this.shapeList[i].style.pointListLength = undefined; - this.shapeList[i].style.pointList = false; - geoAndPos = this.geo2pos(mapType, this.shapeList[i]._geo[0]); - this.shapeList[i].style.xStart = geoAndPos[0]; - this.shapeList[i].style.yStart = geoAndPos[1]; - geoAndPos = this.geo2pos(mapType, this.shapeList[i]._geo[1]); - this.shapeList[i]._x = this.shapeList[i].style.xEnd = geoAndPos[0]; - this.shapeList[i]._y = this.shapeList[i].style.yEnd = geoAndPos[1]; - } - else if (this.shapeList[i].type == 'icon') { - geoAndPos = this.geo2pos(mapType, this.shapeList[i]._geo); - this.shapeList[i].style.x = this.shapeList[i].style._x = - geoAndPos[0] - this.shapeList[i].style.width / 2; - this.shapeList[i].style.y = this.shapeList[i].style._y = - geoAndPos[1] - this.shapeList[i].style.height / 2; + } + else { + delta = 1 / 1.2; // 缩小 + if (this._scaleLimitMap[mapType].min != null + && transform.baseScale <= this._scaleLimitMap[mapType].min + ) { + continue; // 缩放限制 } - else { - geoAndPos = this.geo2pos(mapType, this.shapeList[i]._geo); - this.shapeList[i].style.x = geoAndPos[0]; - this.shapeList[i].style.y = geoAndPos[1]; - if (this.shapeList[i].type == 'text') { - this.shapeList[i]._style.x = this.shapeList[i].highlightStyle.x - = geoAndPos[0]; - this.shapeList[i]._style.y = this.shapeList[i].highlightStyle.y - = geoAndPos[1]; + } + + transform.baseScale *= delta; + transform.scale.x *= delta; + transform.scale.y *= delta; + transform.width = width * delta; + transform.height = height * delta; + + this._mapDataMap[mapType].hasRoam = true; + this._mapDataMap[mapType].transform = transform; + // 经纬度转位置 + geoAndPos = this.geo2pos(mapType, geoAndPos); + // 保持视觉中心 + transform.left -= geoAndPos[0] - (mx - left); + transform.top -= geoAndPos[1] - (my - top); + this._mapDataMap[mapType].transform = transform; + + this.clearEffectShape(true); + for (var i = 0, l = this.shapeList.length; i < l; i++) { + if(this.shapeList[i]._mapType == mapType) { + this.shapeList[i].position[0] = transform.left; + this.shapeList[i].position[1] = transform.top; + if (this.shapeList[i].type == 'path' + || this.shapeList[i].type == 'symbol' + || this.shapeList[i].type == 'circle' + || this.shapeList[i].type == 'rectangle' + || this.shapeList[i].type == 'polygon' + || this.shapeList[i].type == 'line' + || this.shapeList[i].type == 'ellipse' + ) { + this.shapeList[i].scale[0] *= delta; + this.shapeList[i].scale[1] *= delta; + } + else if (this.shapeList[i].type == 'mark-line') { + this.shapeList[i].style.pointListLength = undefined; + this.shapeList[i].style.pointList = false; + geoAndPos = this.geo2pos(mapType, this.shapeList[i]._geo[0]); + this.shapeList[i].style.xStart = geoAndPos[0]; + this.shapeList[i].style.yStart = geoAndPos[1]; + geoAndPos = this.geo2pos(mapType, this.shapeList[i]._geo[1]); + this.shapeList[i]._x = this.shapeList[i].style.xEnd = geoAndPos[0]; + this.shapeList[i]._y = this.shapeList[i].style.yEnd = geoAndPos[1]; } + else if (this.shapeList[i].type == 'icon' + || this.shapeList[i].type == 'image' + ) { + geoAndPos = this.geo2pos(mapType, this.shapeList[i]._geo); + this.shapeList[i].style.x = this.shapeList[i].style._x = + geoAndPos[0] - this.shapeList[i].style.width / 2; + this.shapeList[i].style.y = this.shapeList[i].style._y = + geoAndPos[1] - this.shapeList[i].style.height / 2; + } + else { + geoAndPos = this.geo2pos(mapType, this.shapeList[i]._geo); + this.shapeList[i].style.x = geoAndPos[0]; + this.shapeList[i].style.y = geoAndPos[1]; + if (this.shapeList[i].type == 'text') { + this.shapeList[i]._style.x = this.shapeList[i].highlightStyle.x + = geoAndPos[0]; + this.shapeList[i]._style.y = this.shapeList[i].highlightStyle.y + = geoAndPos[1]; + } + } + + this.zr.modShape(this.shapeList[i].id); } - - this.zr.modShape(this.shapeList[i].id); } } - - this.zr.refresh(); + } + if (haveScale) { + zrEvent.stop(event); + this.zr.refreshNextFrame(); var self = this; clearTimeout(this._refreshDelayTicket); @@ -1099,31 +1188,30 @@ define(function (require) { this.messageCenter.dispatch( ecConfig.EVENT.MAP_ROAM, - param.event, + params.event, {type : 'scale'}, this.myChart ); } }, - __onmousedown : function (param) { + __onmousedown : function (params) { if (this.shapeList.length <= 0) { return; } - var target = param.target; + var target = params.target; if (target && target.draggable) { return; } - var event = param.event; + var event = params.event; var mx = zrEvent.getX(event); var my = zrEvent.getY(event); var mapType = this._findMapTypeByPos(mx, my); - if (mapType) { + if (mapType && this._roamMap[mapType] && this._roamMap[mapType] != 'scale') { this._mousedown = true; this._mx = mx; this._my = my; this._curMapType = mapType; - this.zr.on(zrConfig.EVENT.MOUSEUP, this._onmouseup); var self = this; setTimeout(function (){ @@ -1133,11 +1221,11 @@ define(function (require) { }, - __onmousemove : function (param) { + __onmousemove : function (params) { if (!this._mousedown || !this._isAlive) { return; } - var event = param.event; + var event = params.event; var mx = zrEvent.getX(event); var my = zrEvent.getY(event); var transform = this._mapDataMap[this._curMapType].transform; @@ -1158,20 +1246,20 @@ define(function (require) { this.messageCenter.dispatch( ecConfig.EVENT.MAP_ROAM, - param.event, + params.event, {type : 'move'}, this.myChart ); this.clearEffectShape(true); - this.zr.refresh(); + this.zr.refreshNextFrame(); this._justMove = true; zrEvent.stop(event); }, - __onmouseup : function (param) { - var event = param.event; + __onmouseup : function (params) { + var event = params.event; this._mx = zrEvent.getX(event); this._my = zrEvent.getY(event); this._mousedown = false; @@ -1184,17 +1272,116 @@ define(function (require) { },120); }, + /** + * 漫游组件事件响应 + */ + __onroamcontroller: function(params) { + var event = params.event; + event.zrenderX = this.zr.getWidth() / 2; + event.zrenderY = this.zr.getHeight() / 2; + var mapTypeControl = params.mapTypeControl; + var top = 0; + var left = 0; + var step = params.step; + + switch(params.roamType) { + case 'scaleUp': + event.zrenderDelta = 1; + this.__onmousewheel({ + event: event, + mapTypeControl: mapTypeControl + }); + return; + case 'scaleDown': + event.zrenderDelta = -1; + this.__onmousewheel({ + event: event, + mapTypeControl: mapTypeControl + }); + return; + case 'up': + top = -step; + break; + case 'down': + top = step; + break; + case 'left': + left = -step; + break; + case 'right': + left = step; + break; + } + + var transform; + var curMapType; + for (curMapType in mapTypeControl) { + if (!this._mapDataMap[curMapType] || !this._activeMapType[curMapType]) { + continue; + } + transform = this._mapDataMap[curMapType].transform; + transform.hasRoam = true; + transform.left -= left; + transform.top -= top; + this._mapDataMap[curMapType].transform = transform; + } + for (var i = 0, l = this.shapeList.length; i < l; i++) { + curMapType = this.shapeList[i]._mapType; + if (!mapTypeControl[curMapType] || !this._activeMapType[curMapType]) { + continue; + } + transform = this._mapDataMap[curMapType].transform; + this.shapeList[i].position[0] = transform.left; + this.shapeList[i].position[1] = transform.top; + this.zr.modShape(this.shapeList[i].id); + } + + this.messageCenter.dispatch( + ecConfig.EVENT.MAP_ROAM, + params.event, + {type : 'move'}, + this.myChart + ); + + this.clearEffectShape(true); + this.zr.refreshNextFrame(); + + clearTimeout(this.dircetionTimer); + var self = this; + this.dircetionTimer = setTimeout(function() { + self.animationEffect(); + }, 150); + }, + + /** + * dataRange hoverlink 事件响应 + */ + __ondrhoverlink : function(param) { + var curMapType; + var value; + for (var i = 0, l = this.shapeList.length; i < l; i++) { + curMapType = this.shapeList[i]._mapType; + if (!this._hoverLinkMap[curMapType] || !this._activeMapType[curMapType]) { + continue; + } + value = ecData.get(this.shapeList[i], 'value'); + if (value != null && value >= param.valueMin && value <= param.valueMax) { + this.zr.addHoverShape(this.shapeList[i]); + } + } + }, + /** * 点击响应 */ - onclick : function (param) { - if (!this.isClick || !param.target || this._justMove || param.target.type == 'icon') { + onclick : function (params) { + if (!this.isClick || !params.target || this._justMove || params.target.type == 'icon') { // 没有在当前实例上发生点击直接返回 return; } this.isClick = false; - var target = param.target; + var target = params.target; var name = target.style._name; var len = this.shapeList.length; var mapType = target._mapType || ''; @@ -1235,20 +1422,20 @@ define(function (require) { } this.messageCenter.dispatch( ecConfig.EVENT.MAP_SELECTED, - param.event, + params.event, { selected : this._selected, target : name }, this.myChart ); - this.zr.refresh(); + this.zr.refreshNextFrame(); var self = this; setTimeout(function(){ self.zr.trigger( zrConfig.EVENT.MOUSEMOVE, - param.event + params.event ); },100); }, @@ -1364,7 +1551,8 @@ define(function (require) { ? shapeList : [shapeList]; for (var i = 0, l = shapeList.length; i < l; i++) { if (typeof shapeList[i].zlevel == 'undefined') { - shapeList[i].zlevel = this._zlevelBase + 1; + shapeList[i].zlevel = this.getZlevelBase(); + shapeList[i].z = this.getZBase() + 1; } shapeList[i]._mapType = mapType; this.shapeList.push(shapeList[i]); @@ -1377,20 +1565,20 @@ define(function (require) { /** * 释放后实例不可用 */ - dispose : function () { - this.clear(); - this.shapeList = null; - this.effectList = null; + onbeforDispose : function () { this._isAlive = false; - if (this._needRoam) { - this.zr.un(zrConfig.EVENT.MOUSEWHEEL, this._onmousewheel); - this.zr.un(zrConfig.EVENT.MOUSEDOWN, this._onmousedown); - } + this.zr.un(zrConfig.EVENT.MOUSEWHEEL, this._onmousewheel); + this.zr.un(zrConfig.EVENT.MOUSEDOWN, this._onmousedown); + this.messageCenter.unbind( + ecConfig.EVENT.ROAMCONTROLLER, this._onroamcontroller + ); + this.messageCenter.unbind( + ecConfig.EVENT.DATA_RANGE_HOVERLINK, this._ondrhoverlink + ); } }; zrUtil.inherits(Map, ChartBase); - zrUtil.inherits(Map, ComponentBase); // 图表注册 require('../chart').define('map', Map); diff --git a/amd/chart/pie.js b/amd/chart/pie.js index 0c5b7b1..2b32021 100644 --- a/amd/chart/pie.js +++ b/amd/chart/pie.js @@ -2,11 +2,10 @@ * echarts图表类:饼图 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ define(function (require) { - var ComponentBase = require('../component/base'); var ChartBase = require('./base'); // 图形依赖 @@ -14,9 +13,69 @@ define(function (require) { var RingShape = require('../zrender/shape/Ring'); var CircleShape = require('../zrender/shape/Circle'); var SectorShape = require('../zrender/shape/Sector'); - var BrokenLineShape = require('../zrender/shape/BrokenLine'); + var PolylineShape = require('../zrender/shape/Polyline'); var ecConfig = require('../config'); + // 饼图默认参数 + ecConfig.pie = { + zlevel: 0, // 一级层叠 + z: 2, // 二级层叠 + clickable: true, + legendHoverLink: true, + center: ['50%', '50%'], // 默认全局居中 + radius: [0, '75%'], + clockWise: true, // 默认顺时针 + startAngle: 90, + minAngle: 0, // 最小角度改为0 + selectedOffset: 10, // 选中是扇区偏移量 + // selectedMode: false, // 选择模式,默认关闭,可选single,multiple + // roseType: null, // 南丁格尔玫瑰图模式,'radius'(半径) | 'area'(面积) + itemStyle: { + normal: { + // color: 各异, + borderColor: 'rgba(0,0,0,0)', + borderWidth: 1, + label: { + show: true, + position: 'outer' + // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调 + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + // distance: 当position为inner时有效,为label位置到圆心的距离与圆半径(环状图为内外半径和)的比例系数 + }, + labelLine: { + show: true, + length: 20, + lineStyle: { + // color: 各异, + width: 1, + type: 'solid' + } + } + }, + emphasis: { + // color: 各异, + borderColor: 'rgba(0,0,0,0)', + borderWidth: 1, + label: { + show: false + // position: 'outer' + // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调 + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + // distance: 当position为inner时有效,为label位置到圆心的距离与圆半径(环状图为内外半径和)的比例系数 + }, + labelLine: { + show: false, + length: 20, + lineStyle: { + // color: 各异, + width: 1, + type: 'solid' + } + } + } + } + }; + var ecData = require('../util/ecData'); var zrUtil = require('../zrender/tool/util'); var zrMath = require('../zrender/tool/math'); @@ -30,10 +89,8 @@ define(function (require) { * @param {Object} component 组件 */ function Pie(ecTheme, messageCenter, zr, option, myChart){ - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); // 图表基类 - ChartBase.call(this); + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); var self = this; /** @@ -44,29 +101,32 @@ define(function (require) { var seriesIndex = ecData.get(shape, 'seriesIndex'); var dataIndex = ecData.get(shape, 'dataIndex'); var percent = ecData.get(shape, 'special'); - var lastAddRadius = shape._lastAddRadius; + var center = [shape.style.x, shape.style.y]; var startAngle = shape.style.startAngle; var endAngle = shape.style.endAngle; + var midAngle = ((endAngle + startAngle) / 2 + 360) % 360; // 中值 var defaultColor = shape.highlightStyle.color; // 文本标签,需要显示则会有返回 var label = self.getLabel( - seriesIndex, dataIndex, percent, lastAddRadius, - startAngle, endAngle, defaultColor, + seriesIndex, dataIndex, percent, + center, midAngle, defaultColor, true ); + if (label) { self.zr.addHoverShape(label); } // 文本标签视觉引导线,需要显示则会有返回 var labelLine = self.getLabelLine( - seriesIndex, dataIndex, lastAddRadius, - shape.style.r0, shape.style.r, - startAngle, endAngle, defaultColor, + seriesIndex, dataIndex, + center, shape.style.r0, shape.style.r, + midAngle, defaultColor, true ); + if (labelLine) { self.zr.addHoverShape(labelLine); } @@ -76,11 +136,11 @@ define(function (require) { } Pie.prototype = { - type : ecConfig.CHART_TYPE_PIE, + type: ecConfig.CHART_TYPE_PIE, /** * 绘制图形 */ - _buildShape : function () { + _buildShape: function () { var series = this.series; var legend = this.component.legend; this.selectedMap = {}; @@ -92,12 +152,12 @@ define(function (require) { this._selectedMode = false; var serieName; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type == ecConfig.CHART_TYPE_PIE) { + if (series[i].type === ecConfig.CHART_TYPE_PIE) { series[i] = this.reformOption(series[i]); + this.legendHoverLink = series[i].legendHoverLink || this.legendHoverLink; serieName = series[i].name || ''; // 系列图例开关 - this.selectedMap[serieName] = - legend ? legend.isSelected(serieName) : true; + this.selectedMap[serieName] = legend ? legend.isSelected(serieName) : true; if (!this.selectedMap[serieName]) { continue; } @@ -108,26 +168,28 @@ define(function (require) { this._selected[i] = []; if (this.deepQuery([series[i], this.option], 'calculable')) { pieCase = { - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : center[0], // 圆心横坐标 - y : center[1], // 圆心纵坐标 + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: center[0], // 圆心横坐标 + y: center[1], // 圆心纵坐标 // 圆环内外半径 - r0 : radius[0] <= 10 ? 0 : radius[0] - 10, - r : radius[1] + 10, - brushType : 'stroke', + r0: radius[0] <= 10 ? 0 : radius[0] - 10, + r: radius[1] + 10, + brushType: 'stroke', lineWidth: 1, - strokeColor : series[i].calculableHolderColor - || this.ecTheme.calculableHolderColor + strokeColor: series[i].calculableHolderColor + || this.ecTheme.calculableHolderColor + || ecConfig.calculableHolderColor } }; ecData.pack(pieCase, series[i], i, undefined, -1); this.setCalculable(pieCase); pieCase = radius[0] <= 10 - ? new CircleShape(pieCase) - : new RingShape(pieCase); + ? new CircleShape(pieCase) + : new RingShape(pieCase); this.shapeList.push(pieCase); } this._buildSinglePie(i); @@ -143,7 +205,7 @@ define(function (require) { * * @param {number} seriesIndex 系列索引 */ - _buildSinglePie : function (seriesIndex) { + _buildSinglePie: function (seriesIndex) { var series = this.series; var serie = series[seriesIndex]; var data = serie.data; @@ -154,14 +216,12 @@ define(function (require) { var totalValue = 0; // 迭代累计 var maxValue = Number.NEGATIVE_INFINITY; + var singleShapeList = []; // 计算需要显示的个数和总值 for (var i = 0, l = data.length; i < l; i++) { itemName = data[i].name; - if (legend){ - this.selectedMap[itemName] = legend.isSelected(itemName); - } else { - this.selectedMap[itemName] = true; - } + this.selectedMap[itemName] = legend ? legend.isSelected(itemName) : true; + if (this.selectedMap[itemName] && !isNaN(data[i].value)) { if (+data[i].value !== 0) { totalSelected++; @@ -173,18 +233,20 @@ define(function (require) { maxValue = Math.max(maxValue, +data[i].value); } } + + if (totalValue === 0) { + return; + } var percent = 100; - var lastPercent; // 相邻细角度优化 - var lastAddRadius = 0; var clockWise = serie.clockWise; - var startAngle = serie.startAngle.toFixed(2) - 0; + var startAngle = (serie.startAngle.toFixed(2) - 0 + 360) % 360; var endAngle; var minAngle = serie.minAngle || 0.01; // #bugfixed - var totalAngle = 360 - (minAngle * totalSelected) - - 0.01 * totalSelectedValue0; + var totalAngle = 360 - (minAngle * totalSelected) - 0.01 * totalSelectedValue0; var defaultColor; var roseType = serie.roseType; + var center; var radius; var r0; // 扇形内半径 var r1; // 扇形外半径 @@ -194,17 +256,9 @@ define(function (require) { if (!this.selectedMap[itemName] || isNaN(data[i].value)) { continue; } - // 默认颜色策略 - if (legend) { - // 有图例则从图例中获取颜色定义 - defaultColor = legend.getColor(itemName); - } - else { - // 全局颜色定义 - defaultColor = this.zr.getColor(i); - } + // 默认颜色策略,有图例则从图例中获取颜色定义,没有就全局颜色定义 + defaultColor = legend ? legend.getColor(itemName) : this.zr.getColor(i); - lastPercent = percent; percent = data[i].value / totalValue; if (roseType != 'area') { endAngle = clockWise @@ -219,16 +273,15 @@ define(function (require) { endAngle = endAngle.toFixed(2) - 0; percent = (percent * 100).toFixed(2); + center = this.parseCenter(this.zr, serie.center); radius = this.parseRadius(this.zr, serie.radius); r0 = +radius[0]; r1 = +radius[1]; - if (roseType == 'radius') { - r1 = data[i].value / maxValue * (r1 - r0) * 0.8 - + (r1 - r0) * 0.2 - + r0; + if (roseType === 'radius') { + r1 = data[i].value / maxValue * (r1 - r0) * 0.8 + (r1 - r0) * 0.2 + r0; } - else if (roseType == 'area') { + else if (roseType === 'area') { r1 = Math.sqrt(data[i].value / maxValue) * (r1 - r0) + r0; } @@ -239,48 +292,41 @@ define(function (require) { endAngle = temp; } - // 当前小角度需要检查前一个是否也是小角度,如果是得调整长度,不能完全避免,但能大大降低覆盖概率 - if (i > 0 - && Math.abs(startAngle - endAngle) < 15 // 约15度 - && lastPercent < 4 - && this._needLabel(serie, data[i], false) - && this.deepQuery( - [data[i], serie], 'itemStyle.normal.label.position' - ) != 'center' - ) { - // 都小就延长,前小后大就缩短 - lastAddRadius += (percent < 4 ? 20 : -20); - } - else { - lastAddRadius = 0; - } - this._buildItem( - seriesIndex, i, percent, lastAddRadius, // 相邻最小角度优化 + singleShapeList, + seriesIndex, i, percent, data[i].selected, - r0, r1, + center, r0, r1, startAngle, endAngle, defaultColor ); if (!clockWise) { startAngle = endAngle; } } + this._autoLabelLayout(singleShapeList, center, r1); + for (var i = 0, l = singleShapeList.length; i < l; i++) { + this.shapeList.push(singleShapeList[i]); + } + singleShapeList = null; }, /** * 构建单个扇形及指标 */ - _buildItem : function ( - seriesIndex, dataIndex, percent, lastAddRadius, + _buildItem: function ( + singleShapeList, + seriesIndex, dataIndex, percent, isSelected, - r0, r1, + center, r0, r1, startAngle, endAngle, defaultColor ) { var series = this.series; + var midAngle = ((endAngle + startAngle) / 2 + 360) % 360; // 中值 + // 扇形 var sector = this.getSector( seriesIndex, dataIndex, percent, isSelected, - r0, r1, + center, r0, r1, startAngle, endAngle, defaultColor ); // 图形需要附加的私有数据 @@ -291,60 +337,57 @@ define(function (require) { series[seriesIndex].data[dataIndex].name, percent ); - sector._lastAddRadius = lastAddRadius; - this.shapeList.push(sector); + singleShapeList.push(sector); // 文本标签,需要显示则会有返回 var label = this.getLabel( - seriesIndex, dataIndex, percent, lastAddRadius, - startAngle, endAngle, defaultColor, + seriesIndex, dataIndex, percent, + center, midAngle, defaultColor, false ); - if (label) { + // 文本标签视觉引导线,需要显示则会有返回 + var labelLine = this.getLabelLine( + seriesIndex, dataIndex, + center, r0, r1, + midAngle, defaultColor, + false + ); + + if (labelLine) { ecData.pack( - label, + labelLine, series[seriesIndex], seriesIndex, series[seriesIndex].data[dataIndex], dataIndex, series[seriesIndex].data[dataIndex].name, percent ); - label._dataIndex = dataIndex; - this.shapeList.push(label); + singleShapeList.push(labelLine); } - - // 文本标签视觉引导线,需要显示则会有返回 - var labelLine = this.getLabelLine( - seriesIndex, dataIndex, lastAddRadius, - r0, r1, - startAngle, endAngle, defaultColor, - false - ); - if (labelLine) { + if (label) { ecData.pack( - labelLine, + label, series[seriesIndex], seriesIndex, series[seriesIndex].data[dataIndex], dataIndex, series[seriesIndex].data[dataIndex].name, percent ); - labelLine._dataIndex = dataIndex; - this.shapeList.push(labelLine); + label._labelLine = labelLine; + singleShapeList.push(label); } }, /** * 构建扇形 */ - getSector : function ( + getSector: function ( seriesIndex, dataIndex, percent, isSelected, - r0, r1, + center, r0, r1, startAngle, endAngle, defaultColor ) { var series = this.series; var serie = series[seriesIndex]; var data = serie.data[dataIndex]; var queryTarget = [data, serie]; - var center = this.parseCenter(this.zr, serie.center); // 多级控制 var normal = this.deepMerge( @@ -359,35 +402,36 @@ define(function (require) { || defaultColor; var emphasisColor = this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data) - || (typeof normalColor == 'string' + || (typeof normalColor === 'string' ? zrColor.lift(normalColor, -0.2) : normalColor ); var sector = { - zlevel : this._zlevelBase, - clickable : true, - style : { - x : center[0], // 圆心横坐标 - y : center[1], // 圆心纵坐标 - r0 : r0, // 圆环内半径 - r : r1, // 圆环外半径 - startAngle : startAngle, - endAngle : endAngle, - brushType : 'both', - color : normalColor, - lineWidth : normal.borderWidth, - strokeColor : normal.borderColor, + zlevel: this.getZlevelBase(), + z: this.getZBase(), + clickable: this.deepQuery(queryTarget, 'clickable'), + style: { + x: center[0], // 圆心横坐标 + y: center[1], // 圆心纵坐标 + r0: r0, // 圆环内半径 + r: r1, // 圆环外半径 + startAngle: startAngle, + endAngle: endAngle, + brushType: 'both', + color: normalColor, + lineWidth: normal.borderWidth, + strokeColor: normal.borderColor, lineJoin: 'round' }, - highlightStyle : { - color : emphasisColor, - lineWidth : emphasis.borderWidth, - strokeColor : emphasis.borderColor, + highlightStyle: { + color: emphasisColor, + lineWidth: emphasis.borderWidth, + strokeColor: emphasis.borderColor, lineJoin: 'round' }, - _seriesIndex : seriesIndex, - _dataIndex : dataIndex + _seriesIndex: seriesIndex, + _dataIndex: dataIndex }; if (isSelected) { @@ -417,7 +461,7 @@ define(function (require) { sector.draggable = true; } - // “normal下不显示,emphasis显示”添加事件响应 + // “emphasis显示”添加事件响应 if (this._needLabel(serie, data, true) // emphasis下显示文本 || this._needLabelLine(serie, data, true) // emphasis下显示引导线 ) { @@ -431,9 +475,9 @@ define(function (require) { /** * 需要显示则会有返回构建好的shape,否则返回undefined */ - getLabel : function ( - seriesIndex, dataIndex, percent, lastAddRadius, - startAngle, endAngle, defaultColor, + getLabel: function ( + seriesIndex, dataIndex, percent, + center, midAngle, defaultColor, isEmphasis ) { var series = this.series; @@ -456,83 +500,76 @@ define(function (require) { var labelControl = itemStyle[status].label; var textStyle = labelControl.textStyle || {}; - var center = this.parseCenter(this.zr, serie.center); var centerX = center[0]; // 圆心横坐标 var centerY = center[1]; // 圆心纵坐标 var x; var y; - var midAngle = ((endAngle + startAngle) / 2 + 360) % 360; // 中值 var radius = this.parseRadius(this.zr, serie.radius); // 标签位置半径 var textAlign; var textBaseline = 'middle'; labelControl.position = labelControl.position || itemStyle.normal.label.position; - if (labelControl.position == 'center') { + if (labelControl.position === 'center') { // center显示 - radius = radius[1]; x = centerX; y = centerY; textAlign = 'center'; } - else if (labelControl.position == 'inner'){ - // 内部显示 - radius = (radius[0] + radius[1]) / 2 + lastAddRadius; - x = Math.round( - centerX + radius * zrMath.cos(midAngle, true) - ); - y = Math.round( - centerY - radius * zrMath.sin(midAngle, true) - ); + else if (labelControl.position === 'inner' || labelControl.position === 'inside') { + // 内部标签显示, 按外半径比例计算标签位置 + radius = (radius[0] + radius[1]) * (labelControl.distance || 0.5); + x = Math.round(centerX + radius * zrMath.cos(midAngle, true)); + y = Math.round(centerY - radius * zrMath.sin(midAngle, true)); defaultColor = '#fff'; textAlign = 'center'; - } else { - // 外部显示,默认 labelControl.position == 'outer') - radius = radius[1] - - (-itemStyle[status].labelLine.length) - //- (-textStyle.fontSize) - + lastAddRadius; - x = centerX + radius * zrMath.cos(midAngle, true); - y = centerY - radius * zrMath.sin(midAngle, true); - textAlign = (midAngle >= 90 && midAngle <= 270) - ? 'right' : 'left'; + // 外部显示,默认 labelControl.position === 'outer') + radius = radius[1] - (-itemStyle[status].labelLine.length); + x = Math.round(centerX + radius * zrMath.cos(midAngle, true)); + y = Math.round(centerY - radius * zrMath.sin(midAngle, true)); + textAlign = (midAngle >= 90 && midAngle <= 270) ? 'right' : 'left'; } - if (labelControl.position != 'center' + if (labelControl.position != 'center' && labelControl.position != 'inner' + && labelControl.position != 'inside' ) { - x += textAlign == 'left' ? 20 : -20; + x += textAlign === 'left' ? 20 : -20; } - data.__labelX = x - (textAlign == 'left' ? 5 : -5); + data.__labelX = x - (textAlign === 'left' ? 5 : -5); data.__labelY = y; - return new TextShape({ - zlevel : this._zlevelBase + 1, - hoverable : false, - style : { - x : x, - y : y, - color : textStyle.color || defaultColor, - text : this.getLabelText( - seriesIndex, dataIndex, percent, status - ), - textAlign : textStyle.align || textAlign, - textBaseline : textStyle.baseline || textBaseline, - textFont : this.getFont(textStyle) - }, - highlightStyle : { - brushType : 'fill' + var ts = new TextShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + hoverable: false, + style: { + x: x, + y: y, + color: textStyle.color || defaultColor, + text: this.getLabelText(seriesIndex, dataIndex, percent, status), + textAlign: textStyle.align || textAlign, + textBaseline: textStyle.baseline || textBaseline, + textFont: this.getFont(textStyle) }, - _seriesIndex : seriesIndex, - _dataIndex : dataIndex + highlightStyle: { + brushType: 'fill' + } }); + ts._radius = radius; + ts._labelPosition = labelControl.position || 'outer'; + ts._rect = ts.getRect(ts.style); + ts._seriesIndex = seriesIndex; + ts._dataIndex = dataIndex; + return ts; + }, /** * 根据lable.format计算label text */ - getLabelText : function (seriesIndex, dataIndex, percent, status) { + getLabelText: function (seriesIndex, dataIndex, percent, status) { var series = this.series; var serie = series[seriesIndex]; var data = serie.data[dataIndex]; @@ -542,16 +579,22 @@ define(function (require) { ); if (formatter) { - if (typeof formatter == 'function') { + if (typeof formatter === 'function') { return formatter.call( this.myChart, - serie.name, - data.name, - data.value, - percent + { + seriesIndex: seriesIndex, + seriesName: serie.name || '', + series: serie, + dataIndex: dataIndex, + data: data, + name: data.name, + value: data.value, + percent: percent + } ); } - else if (typeof formatter == 'string') { + else if (typeof formatter === 'string') { formatter = formatter.replace('{a}','{a0}') .replace('{b}','{b0}') .replace('{c}','{c0}') @@ -572,10 +615,10 @@ define(function (require) { /** * 需要显示则会有返回构建好的shape,否则返回undefined */ - getLabelLine : function ( - seriesIndex, dataIndex, lastAddRadius, - r0, r1, - startAngle, endAngle, defaultColor, + getLabelLine: function ( + seriesIndex, dataIndex, + center, r0, r1, + midAngle, defaultColor, isEmphasis ) { var series = this.series; @@ -595,28 +638,25 @@ define(function (require) { var labelLineControl = itemStyle[status].labelLine; var lineStyle = labelLineControl.lineStyle || {}; - var center = this.parseCenter(this.zr, serie.center); var centerX = center[0]; // 圆心横坐标 var centerY = center[1]; // 圆心纵坐标 // 视觉引导线起点半径 - var midRadius = r1; + var minRadius = r1; // 视觉引导线终点半径 var maxRadius = this.parseRadius(this.zr, serie.radius)[1] - - (-labelLineControl.length) - + lastAddRadius; - var midAngle = ((endAngle + startAngle) / 2) % 360; // 角度中值 + - (-labelLineControl.length); var cosValue = zrMath.cos(midAngle, true); var sinValue = zrMath.sin(midAngle, true); - // 三角函数缓存已在zrender/tool/math中做了 - return new BrokenLineShape({ - // shape : 'brokenLine', - zlevel : this._zlevelBase + 1, - hoverable : false, - style : { - pointList : [ + + return new PolylineShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + hoverable: false, + style: { + pointList: [ [ - centerX + midRadius * cosValue, - centerY - midRadius * sinValue + centerX + minRadius * cosValue, + centerY - minRadius * sinValue ], [ centerX + maxRadius * cosValue, @@ -627,16 +667,16 @@ define(function (require) { data.__labelY ] ], - //xStart : centerX + midRadius * cosValue, - //yStart : centerY - midRadius * sinValue, - //xEnd : centerX + maxRadius * cosValue, - //yEnd : centerY - maxRadius * sinValue, - strokeColor : lineStyle.color || defaultColor, - lineType : lineStyle.type, - lineWidth : lineStyle.width + //xStart: centerX + minRadius * cosValue, + //yStart: centerY - minRadius * sinValue, + //xEnd: centerX + maxRadius * cosValue, + //yEnd: centerY - maxRadius * sinValue, + strokeColor: lineStyle.color || defaultColor, + lineType: lineStyle.type, + lineWidth: lineStyle.width }, - _seriesIndex : seriesIndex, - _dataIndex : dataIndex + _seriesIndex: seriesIndex, + _dataIndex: dataIndex }); } else { @@ -650,7 +690,7 @@ define(function (require) { * @param {Object} data * @param {boolean} isEmphasis true is 'emphasis' and false is 'normal' */ - _needLabel : function (serie, data, isEmphasis) { + _needLabel: function (serie, data, isEmphasis) { return this.deepQuery( [data, serie], 'itemStyle.' @@ -665,7 +705,7 @@ define(function (require) { * @param {Object} data * @param {boolean} isEmphasis true is 'emphasis' and false is 'normal' */ - _needLabelLine : function (serie, data, isEmphasis) { + _needLabelLine: function (serie, data, isEmphasis) { return this.deepQuery( [data, serie], 'itemStyle.' @@ -674,26 +714,165 @@ define(function (require) { ); }, + /** + * @param {Array.} sList 单系列图形集合 + */ + _autoLabelLayout : function (sList, center, r) { + var leftList = []; + var rightList = []; + + for (var i = 0, l = sList.length; i < l; i++) { + if (sList[i]._labelPosition === 'outer' || sList[i]._labelPosition === 'outside') { + sList[i]._rect._y = sList[i]._rect.y; + if (sList[i]._rect.x < center[0]) { + leftList.push(sList[i]); + } + else { + rightList.push(sList[i]); + } + } + } + this._layoutCalculate(leftList, center, r, -1); + this._layoutCalculate(rightList, center, r, 1); + }, + + /** + * @param {Array.} tList 单系列文本图形集合 + * @param {number} direction 水平方向参数,left为-1,right为1 + */ + _layoutCalculate : function(tList, center, r, direction) { + tList.sort(function(a, b){ + return a._rect.y - b._rect.y; + }); + + // 压 + function _changeDown(start, end, delta, direction) { + for (var j = start; j < end; j++) { + tList[j]._rect.y += delta; + tList[j].style.y += delta; + if (tList[j]._labelLine) { + tList[j]._labelLine.style.pointList[1][1] += delta; + tList[j]._labelLine.style.pointList[2][1] += delta; + } + if (j > start + && j + 1 < end + && tList[j + 1]._rect.y > tList[j]._rect.y + tList[j]._rect.height + ) { + _changeUp(j, delta / 2); + return; + } + } + + _changeUp(end - 1, delta / 2); + } + + // 弹 + function _changeUp(end, delta) { + for (var j = end; j >= 0; j--) { + tList[j]._rect.y -= delta; + tList[j].style.y -= delta; + if (tList[j]._labelLine) { + tList[j]._labelLine.style.pointList[1][1] -= delta; + tList[j]._labelLine.style.pointList[2][1] -= delta; + } + if (j > 0 + && tList[j]._rect.y > tList[j - 1]._rect.y + tList[j - 1]._rect.height + ) { + break; + } + } + } + + function _changeX(sList, isDownList, center, r, direction) { + var x = center[0]; + var y = center[1]; + var deltaX; + var deltaY; + var length; + var lastDeltaX = direction > 0 + ? isDownList // 右侧 + ? Number.MAX_VALUE // 下 + : 0 // 上 + : isDownList // 左侧 + ? Number.MAX_VALUE // 下 + : 0; // 上 + + for (var i = 0, l = sList.length; i < l; i++) { + deltaY = Math.abs(sList[i]._rect.y - y); + length = sList[i]._radius - r; + deltaX = (deltaY < r + length) + ? Math.sqrt( + (r + length + 20) * (r + length + 20) + - Math.pow(sList[i]._rect.y - y, 2) + ) + : Math.abs( + sList[i]._rect.x + (direction > 0 ? 0 : sList[i]._rect.width) - x + ); + if (isDownList && deltaX >= lastDeltaX) { + // 右下,左下 + deltaX = lastDeltaX - 10; + } + if (!isDownList && deltaX <= lastDeltaX) { + // 右上,左上 + deltaX = lastDeltaX + 10; + } + + sList[i]._rect.x = sList[i].style.x = x + deltaX * direction; + if (sList[i]._labelLine) { + sList[i]._labelLine.style.pointList[2][0] = x + (deltaX - 5) * direction; + sList[i]._labelLine.style.pointList[1][0] = x + (deltaX - 20) *direction; + } + lastDeltaX = deltaX; + } + } + + var lastY = 0; + var delta; + var len = tList.length; + var upList = []; + var downList = []; + for (var i = 0; i < len; i++) { + delta = tList[i]._rect.y - lastY; + if (delta < 0) { + _changeDown(i, len, -delta, direction); + } + lastY = tList[i]._rect.y + tList[i]._rect.height; + } + if (this.zr.getHeight() - lastY < 0) { + _changeUp(len - 1, lastY - this.zr.getHeight()); + } + for (var i = 0; i < len; i++) { + if (tList[i]._rect.y >= center[1]) { + downList.push(tList[i]); + } + else { + upList.push(tList[i]); + } + } + _changeX(downList, true, center, r, direction); + _changeX(upList, false, center, r, direction); + }, + /** * 参数修正&默认值赋值,重载基类方法 * @param {Object} opt 参数 */ - reformOption : function (opt) { + reformOption: function (opt) { // 常用方法快捷方式 var _merge = zrUtil.merge; opt = _merge( - opt || {}, - this.ecTheme.pie + _merge( + opt || {}, zrUtil.clone(this.ecTheme.pie || {}) + ), + zrUtil.clone(ecConfig.pie) ); // 通用字体设置 - opt.itemStyle.normal.label.textStyle = _merge( - opt.itemStyle.normal.label.textStyle || {}, - this.ecTheme.textStyle + opt.itemStyle.normal.label.textStyle = this.getTextStyle( + opt.itemStyle.normal.label.textStyle ); - opt.itemStyle.emphasis.label.textStyle = _merge( - opt.itemStyle.emphasis.label.textStyle || {}, - this.ecTheme.textStyle + opt.itemStyle.emphasis.label.textStyle = this.getTextStyle( + opt.itemStyle.emphasis.label.textStyle ); return opt; @@ -702,7 +881,7 @@ define(function (require) { /** * 刷新 */ - refresh : function (newOption) { + refresh: function (newOption) { if (newOption) { this.option = newOption; this.series = newOption.series; @@ -715,7 +894,7 @@ define(function (require) { /** * 动态数据增加动画 */ - addDataAnimation : function (params) { + addDataAnimation: function (params) { var series = this.series; var aniMap = {}; // seriesIndex索引参数 for (var i = 0, l = params.length; i < l; i++) { @@ -738,7 +917,7 @@ define(function (require) { isHead = params[i][2]; dataGrow = params[i][3]; if (series[seriesIndex] - && series[seriesIndex].type == ecConfig.CHART_TYPE_PIE + && series[seriesIndex].type === ecConfig.CHART_TYPE_PIE ) { if (isHead) { if (!dataGrow) { @@ -776,7 +955,7 @@ define(function (require) { case 'text' : textMap[key] = this.shapeList[i]; break; - case 'broken-line' : + case 'polyline' : lineMap[key] = this.shapeList[i]; break; } @@ -793,17 +972,15 @@ define(function (require) { if (!targeSector) { continue; } - if (backupShapeList[i].type == 'sector') { + if (backupShapeList[i].type === 'sector') { if (targeSector != 'delete') { // 原有扇形 this.zr.animate(backupShapeList[i].id, 'style') .when( 400, { - startAngle : - targeSector.style.startAngle, - endAngle : - targeSector.style.endAngle + startAngle: targeSector.style.startAngle, + endAngle: targeSector.style.endAngle } ) .start(); @@ -814,22 +991,16 @@ define(function (require) { .when( 400, deltaIdxMap[seriesIndex] < 0 - ? { - startAngle : - backupShapeList[i].style.startAngle - } - : { - endAngle : - backupShapeList[i].style.endAngle - } + ? { startAngle: backupShapeList[i].style.startAngle } + : { endAngle: backupShapeList[i].style.endAngle } ) .start(); } } - else if (backupShapeList[i].type == 'text' - || backupShapeList[i].type == 'broken-line' + else if (backupShapeList[i].type === 'text' + || backupShapeList[i].type === 'polyline' ) { - if (targeSector == 'delete') { + if (targeSector === 'delete') { // 删除逻辑一样 this.zr.delShape(backupShapeList[i].id); } @@ -848,7 +1019,7 @@ define(function (require) { ) .start(); break; - case 'broken-line': + case 'polyline': targeSector = lineMap[key]; this.zr.animate(backupShapeList[i].id, 'style') .when( @@ -868,7 +1039,7 @@ define(function (require) { this.shapeList = backupShapeList; }, - onclick : function (param) { + onclick: function (param) { var series = this.series; if (!this.isClick || !param.target) { // 没有在当前实例上发生点击直接返回 @@ -882,7 +1053,7 @@ define(function (require) { var dataIndex = ecData.get(target, 'dataIndex'); for (var i = 0, len = this.shapeList.length; i < len; i++) { - if (this.shapeList[i].id == target.id) { + if (this.shapeList[i].id === target.id) { seriesIndex = ecData.get(target, 'seriesIndex'); dataIndex = ecData.get(target, 'dataIndex'); // 当前点击的 @@ -914,7 +1085,7 @@ define(function (require) { this.zr.modShape(target.id, target); } else if (this.shapeList[i].style._hasSelected - && this._selectedMode == 'single' + && this._selectedMode === 'single' ) { seriesIndex = ecData.get(this.shapeList[i], 'seriesIndex'); dataIndex = ecData.get(this.shapeList[i], 'dataIndex'); @@ -933,20 +1104,19 @@ define(function (require) { ecConfig.EVENT.PIE_SELECTED, param.event, { - selected : this._selected, - target : ecData.get(target, 'name') + selected: this._selected, + target: ecData.get(target, 'name') }, this.myChart ); - this.zr.refresh(); + this.zr.refreshNextFrame(); } }; zrUtil.inherits(Pie, ChartBase); - zrUtil.inherits(Pie, ComponentBase); // 图表注册 require('../chart').define('pie', Pie); return Pie; -}); \ No newline at end of file +}); diff --git a/amd/chart/radar.js b/amd/chart/radar.js index 9482905..af2faab 100644 --- a/amd/chart/radar.js +++ b/amd/chart/radar.js @@ -2,12 +2,10 @@ * echarts图表类:雷达图 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Neil (杨骥, yangji01@baidu.com) - * + * @author Neil (杨骥, 511415343@qq.com) */ define(function (require) { - var ComponentBase = require('../component/base'); var ChartBase = require('./base'); // 图形依赖 @@ -16,6 +14,36 @@ require('../component/polar'); var ecConfig = require('../config'); + // 雷达图默认参数 + ecConfig.radar = { + zlevel: 0, // 一级层叠 + z: 2, // 二级层叠 + clickable: true, + legendHoverLink: true, + polarIndex: 0, + itemStyle: { + normal: { + // color: 各异, + label: { + show: false + }, + lineStyle: { + width: 2, + type: 'solid' + } + }, + emphasis: { + // color: 各异, + label: { + show: false + } + } + }, + // symbol: null, // 拐点图形类型 + symbolSize: 2 // 可计算特性参数,空数据拖拽提示图形大小 + // symbolRotate: null, // 图形旋转控制 + }; + var ecData = require('../util/ecData'); var zrUtil = require('../zrender/tool/util'); var zrColor = require('../zrender/tool/color'); @@ -26,12 +54,12 @@ * @param {ZRender} zr zrender实例 * @param {Object} series 数据 * @param {Object} component 组件 + * @constructor + * @exports Radar */ function Radar(ecTheme, messageCenter, zr, option, myChart) { - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); // 图表基类 - ChartBase.call(this); + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); this.refresh(option); } @@ -51,9 +79,10 @@ var series = this.series; var legend = this.component.legend; var serieName; - for (var i = 0, l = series.length; i < l ; i ++) { - if (series[i].type == ecConfig.CHART_TYPE_RADAR) { + for (var i = 0, l = series.length; i < l ; i++) { + if (series[i].type === ecConfig.CHART_TYPE_RADAR) { this.serie = this.reformOption(series[i]); + this.legendHoverLink = series[i].legendHoverLink || this.legendHoverLink; serieName = this.serie.name || ''; // 系列图例开关 this.selectedMap[serieName] = @@ -88,13 +117,12 @@ var pointList; var calculable = this.deepQuery(this._queryTarget, 'calculable'); - for (var i = 0; i < data.length; i ++) { + for (var i = 0; i < data.length; i++) { name = data[i].name || ''; // 图例开关 this.selectedMap[name] = legend - ? legend.isSelected(name) - : true; + ? legend.isSelected(name) : true; if (!this.selectedMap[name]) { continue; } @@ -119,7 +147,8 @@ pointList = this._getPointList(this.serie.polarIndex, data[i]); // 添加拐点形状 - this._addSymbol(pointList, defaultColor, i, index, this.serie.polarIndex); + this._addSymbol( + pointList, defaultColor, i, index, this.serie.polarIndex); // 添加数据形状 this._addDataShape( pointList, defaultColor, data[i], @@ -140,13 +169,12 @@ var vector; var polar = this.component.polar; + var value; for (var i = 0, l = dataArr.value.length; i < l; i++) { - vector = polar.getVector( - polarIndex, - i, - typeof dataArr.value[i].value != 'undefined' - ? dataArr.value[i].value : dataArr.value[i] - ); + value = this.getDataFromOption(dataArr.value[i]); + vector = value != '-' + ? polar.getVector(polarIndex, i, value) + : false; if (vector) { pointList.push(vector); } @@ -161,7 +189,7 @@ * @param {object} data 数据 * @param {number} serieIndex */ - _addSymbol : function (pointList, defaultColor, dataIndex, seriesIndex, polarIndex) { + _addSymbol :function (pointList, defaultColor, dataIndex, seriesIndex, polarIndex) { var series = this.series; var itemShape; var polar = this.component.polar; @@ -181,7 +209,9 @@ '#fff', 'vertical' ); - itemShape.zlevel = this._zlevelBase + 1; + itemShape.zlevel = this.getZlevelBase(); + itemShape.z = this.getZBase() + 1; + ecData.set(itemShape, 'data', series[seriesIndex].data[dataIndex]); ecData.set(itemShape, 'value', series[seriesIndex].data[dataIndex].value); ecData.set(itemShape, 'dataIndex', dataIndex); @@ -227,13 +257,15 @@ queryTarget, 'itemStyle.normal.areaStyle' ); var shape = { - zlevel : this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), style : { pointList : pointList, brushType : nIsAreaFill ? 'both' : 'stroke', color : nAreaColor || nColor - || zrColor.alpha(defaultColor,0.5), + || (typeof defaultColor === 'string' + ? zrColor.alpha(defaultColor,0.5) : defaultColor), strokeColor : nColor || defaultColor, lineWidth : nLineWidth, lineType : nLineType @@ -250,7 +282,8 @@ ) || nAreaColor || nColor - || zrColor.alpha(defaultColor,0.5), + || (typeof defaultColor === 'string' + ? zrColor.alpha(defaultColor,0.5) : defaultColor), strokeColor : this.getItemStyleColor( this.deepQuery( queryTarget, 'itemStyle.emphasis.color' @@ -300,7 +333,9 @@ ); if (!this._dropBoxList[polarIndex]) { var shape = this.component.polar.getDropBox(polarIndex); - shape.zlevel = this._zlevelBase; + shape.zlevel = this.getZlevelBase(); + shape.z = this.getZBase(); + this.setCalculable(shape); ecData.pack(shape, series, index, undefined, -1); this.shapeList.push(shape); @@ -318,7 +353,8 @@ return; } - var target = param.target; // 被拖拽图形元素 + // 被拖拽图形元素 + var target = param.target; var seriesIndex = ecData.get(target, 'seriesIndex'); var dataIndex = ecData.get(target, 'dataIndex'); @@ -360,7 +396,7 @@ var legend = this.component.legend; var value; - if (dataIndex == -1) { + if (dataIndex === -1) { data = { value : ecData.get(dragged, 'value'), name : ecData.get(dragged, 'name') @@ -381,7 +417,7 @@ data.name += this.option.nameConnector + ecData.get(dragged, 'name'); value = ecData.get(dragged, 'value'); - for (var i = 0 ; i < value.length; i ++) { + for (var i = 0 ; i < value.length; i++) { data.value[i] = accMath.accAdd(data.value[i], value[i]); } @@ -415,7 +451,6 @@ }; zrUtil.inherits(Radar, ChartBase); - zrUtil.inherits(Radar, ComponentBase); // 图表注册 require('../chart').define('radar', Radar); diff --git a/amd/chart/scatter.js b/amd/chart/scatter.js index f17032c..4f88139 100644 --- a/amd/chart/scatter.js +++ b/amd/chart/scatter.js @@ -2,11 +2,10 @@ * echarts图表类:散点图 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ define(function (require) { - var ComponentBase = require('../component/base'); var ChartBase = require('./base'); // 图形依赖 @@ -18,6 +17,43 @@ define(function (require) { require('../component/dataRange'); var ecConfig = require('../config'); + // 散点图默认参数 + ecConfig.scatter = { + zlevel: 0, // 一级层叠 + z: 2, // 二级层叠 + clickable: true, + legendHoverLink: true, + xAxisIndex: 0, + yAxisIndex: 0, + // symbol: null, // 图形类型 + symbolSize: 4, // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 + // symbolRotate: null, // 图形旋转控制 + large: false, // 大规模散点图 + largeThreshold: 2000, // 大规模阀值,large为true且数据量>largeThreshold才启用大规模模式 + itemStyle: { + normal: { + // color: 各异, + label: { + show: false + // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调 + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 + // 'inside'|'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + } + }, + emphasis: { + // color: '各异' + label: { + show: false + // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调 + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 + // 'inside'|'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + } + } + } + }; + var zrUtil = require('../zrender/tool/util'); var zrColor = require('../zrender/tool/color'); @@ -29,20 +65,18 @@ define(function (require) { * @param {Object} component 组件 */ function Scatter(ecTheme, messageCenter, zr, option, myChart){ - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); // 图表基类 - ChartBase.call(this); + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); this.refresh(option); } Scatter.prototype = { - type : ecConfig.CHART_TYPE_SCATTER, + type: ecConfig.CHART_TYPE_SCATTER, /** * 绘制图形 */ - _buildShape : function () { + _buildShape: function () { var series = this.series; this._sIndex2ColorMap = {}; // series默认颜色索引,seriesIndex索引到color this._symbol = this.option.symbolList; @@ -60,13 +94,13 @@ define(function (require) { for (var i = 0, l = series.length; i < l; i++) { serie = series[i]; serieName = serie.name; - if (serie.type == ecConfig.CHART_TYPE_SCATTER) { + if (serie.type === ecConfig.CHART_TYPE_SCATTER) { series[i] = this.reformOption(series[i]); + this.legendHoverLink = series[i].legendHoverLink || this.legendHoverLink; this._sIndex2ShapeMap[i] = this.query(serie, 'symbol') || this._symbol[i % this._symbol.length]; if (legend){ this.selectedMap[serieName] = legend.isSelected(serieName); - this._sIndex2ColorMap[i] = zrColor.alpha(legend.getColor(serieName), 0.5); iconShape = legend.getItemShape(serieName); @@ -105,7 +139,7 @@ define(function (require) { } else { this.selectedMap[serieName] = true; - this._sIndex2ColorMap[i] = this.zr.getColor(i); + this._sIndex2ColorMap[i] = zrColor.alpha(this.zr.getColor(i), 0.5); } if (this.selectedMap[serieName]) { @@ -122,7 +156,7 @@ define(function (require) { /** * 构建类目轴为水平方向的散点图系列 */ - _buildSeries : function (seriesArray) { + _buildSeries: function (seriesArray) { if (seriesArray.length === 0) { return; } @@ -150,12 +184,8 @@ define(function (require) { pointList[seriesIndex] = []; for (var i = 0, l = serie.data.length; i < l; i++) { data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; - if (value == '-' || value.length < 2) { + value = this.getDataFromOption(data, '-'); + if (value === '-' || value.length < 2) { // 数据格式不符 continue; } @@ -179,18 +209,18 @@ define(function (require) { this._buildPointList(pointList); }, - _markMap : function (xAxis, yAxis, data, pointList) { + _markMap: function (xAxis, yAxis, data, pointList) { var xMarkMap = { - min0 : Number.POSITIVE_INFINITY, - max0 : Number.NEGATIVE_INFINITY, - sum0 : 0, - counter0 : 0, - average0 : 0, - min1 : Number.POSITIVE_INFINITY, - max1 : Number.NEGATIVE_INFINITY, - sum1 : 0, - counter1 : 0, - average1 : 0 + min0: Number.POSITIVE_INFINITY, + max0: Number.NEGATIVE_INFINITY, + sum0: 0, + counter0: 0, + average0: 0, + min1: Number.POSITIVE_INFINITY, + max1: Number.NEGATIVE_INFINITY, + sum1: 0, + counter1: 0, + average1: 0 }; var value; for (var i = 0, l = pointList.length; i < l; i++) { @@ -235,7 +265,7 @@ define(function (require) { var gridY = this.component.grid.getY(); var gridYend = this.component.grid.getYend(); - xMarkMap.average0 = (xMarkMap.sum0 / xMarkMap.counter0).toFixed(2) - 0; + xMarkMap.average0 = xMarkMap.sum0 / xMarkMap.counter0; var x = xAxis.getCoord(xMarkMap.average0); // 横轴平均纵向 xMarkMap.averageLine0 = [ @@ -251,7 +281,7 @@ define(function (require) { [xMarkMap.maxX0, gridY] ]; - xMarkMap.average1 = (xMarkMap.sum1 / xMarkMap.counter1).toFixed(2) - 0; + xMarkMap.average1 = xMarkMap.sum1 / xMarkMap.counter1; var y = yAxis.getCoord(xMarkMap.average1); // 纵轴平均横向 xMarkMap.averageLine1 = [ @@ -273,7 +303,7 @@ define(function (require) { /** * 生成折线和折线上的拐点 */ - _buildPointList : function (pointList) { + _buildPointList: function (pointList) { var series = this.series; var serie; var seriesPL; @@ -323,7 +353,7 @@ define(function (require) { /** * 生成折线图上的拐点图形 */ - _getSymbol : function (seriesIndex, dataIndex, name, x, y) { + _getSymbol: function (seriesIndex, dataIndex, name, x, y) { var series = this.series; var serie = series[seriesIndex]; var data = serie.data[dataIndex]; @@ -350,29 +380,32 @@ define(function (require) { 'rgba(0,0,0,0)', 'vertical' ); - itemShape.zlevel = this._zlevelBase; + itemShape.zlevel = this.getZlevelBase(); + itemShape.z = this.getZBase(); + itemShape._main = true; return itemShape; }, - _getLargeSymbol : function (pointList, nColor) { + _getLargeSymbol: function (pointList, nColor) { return new SymbolShape({ - zlevel : this._zlevelBase, - _main : true, + zlevel: this.getZlevelBase(), + z: this.getZBase(), + _main: true, hoverable: false, - style : { - pointList : pointList, - color : nColor, - strokeColor : nColor + style: { + pointList: pointList, + color: nColor, + strokeColor: nColor }, - highlightStyle : { - pointList : [] + highlightStyle: { + pointList: [] } }); }, // 位置转换 - getMarkCoord : function (seriesIndex, mpData) { + getMarkCoord: function (seriesIndex, mpData) { var serie = this.series[seriesIndex]; var xMarkMap = this.xMarkMap[seriesIndex]; var xAxis = this.component.xAxis.getAxis(serie.xAxisIndex); @@ -380,12 +413,11 @@ define(function (require) { var pos; if (mpData.type - && (mpData.type == 'max' || mpData.type == 'min' || mpData.type == 'average') + && (mpData.type === 'max' || mpData.type === 'min' || mpData.type === 'average') ) { // 特殊值内置支持 // 默认取纵值 - var valueIndex = typeof mpData.valueIndex != 'undefined' - ? mpData.valueIndex : 1; + var valueIndex = mpData.valueIndex != null ? mpData.valueIndex : 1; pos = [ xMarkMap[mpData.type + 'X' + valueIndex], xMarkMap[mpData.type + 'Y' + valueIndex], @@ -411,7 +443,7 @@ define(function (require) { /** * 刷新 */ - refresh : function (newOption) { + refresh: function (newOption) { if (newOption) { this.option = newOption; this.series = newOption.series; @@ -426,7 +458,7 @@ define(function (require) { * @param {Object} param * @param {Object} status */ - ondataRange : function (param, status) { + ondataRange: function (param, status) { if (this.component.dataRange) { this.refresh(); status.needRefresh = true; @@ -436,7 +468,6 @@ define(function (require) { }; zrUtil.inherits(Scatter, ChartBase); - zrUtil.inherits(Scatter, ComponentBase); // 图表注册 require('../chart').define('scatter', Scatter); diff --git a/amd/component.js b/amd/component.js index e2d87af..8d2c18a 100644 --- a/amd/component.js +++ b/amd/component.js @@ -2,7 +2,7 @@ * echart组件库 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ define(function (/*require*/) { // component diff --git a/amd/component/axis.js b/amd/component/axis.js index 13914cc..502d74b 100644 --- a/amd/component/axis.js +++ b/amd/component/axis.js @@ -2,7 +2,7 @@ * echarts组件类: 坐标轴 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * * 直角坐标系中坐标轴数组,数组中每一项代表一条横轴(纵轴)坐标轴。 * 标准(1.0)中规定最多同时存在2条横轴和2条纵轴 @@ -43,93 +43,96 @@ define(function (require) { } Axis.prototype = { - type : ecConfig.COMPONENT_TYPE_AXIS, - axisBase : { + type: ecConfig.COMPONENT_TYPE_AXIS, + axisBase: { // 轴线 - _buildAxisLine : function () { + _buildAxisLine: function () { var lineWidth = this.option.axisLine.lineStyle.width; var halfLineWidth = lineWidth / 2; var axShape = { - _axisShape : 'axisLine', - zlevel : this._zlevelBase + 1, - hoverable : false + _axisShape: 'axisLine', + zlevel: this.getZlevelBase(), + z: this.getZBase() + 3, + hoverable: false }; + var grid = this.grid; switch (this.option.position) { case 'left' : axShape.style = { - xStart : this.grid.getX() - halfLineWidth, - yStart : this.grid.getYend(), - xEnd : this.grid.getX() - halfLineWidth, - yEnd : this.grid.getY(), - lineCap : 'round' + xStart: grid.getX() - halfLineWidth, + yStart: grid.getYend(), + xEnd: grid.getX() - halfLineWidth, + yEnd: grid.getY(), + lineCap: 'round' }; break; case 'right' : axShape.style = { - xStart : this.grid.getXend() + halfLineWidth, - yStart : this.grid.getYend(), - xEnd : this.grid.getXend() + halfLineWidth, - yEnd : this.grid.getY(), - lineCap : 'round' + xStart: grid.getXend() + halfLineWidth, + yStart: grid.getYend(), + xEnd: grid.getXend() + halfLineWidth, + yEnd: grid.getY(), + lineCap: 'round' }; break; case 'bottom' : axShape.style = { - xStart : this.grid.getX(), - yStart : this.grid.getYend() + halfLineWidth, - xEnd : this.grid.getXend(), - yEnd : this.grid.getYend() + halfLineWidth, - lineCap : 'round' + xStart: grid.getX(), + yStart: grid.getYend() + halfLineWidth, + xEnd: grid.getXend(), + yEnd: grid.getYend() + halfLineWidth, + lineCap: 'round' }; break; case 'top' : axShape.style = { - xStart : this.grid.getX(), - yStart : this.grid.getY() - halfLineWidth, - xEnd : this.grid.getXend(), - yEnd : this.grid.getY() - halfLineWidth, - lineCap : 'round' + xStart: grid.getX(), + yStart: grid.getY() - halfLineWidth, + xEnd: grid.getXend(), + yEnd: grid.getY() - halfLineWidth, + lineCap: 'round' }; break; } - if (this.option.name !== '') { - axShape.style.text = this.option.name; - axShape.style.textPosition = this.option.nameLocation; - axShape.style.textFont = this.getFont(this.option.nameTextStyle); + var style = axShape.style; + if (this.option.name !== '') { // 别帮我代码规范 + style.text = this.option.name; + style.textPosition = this.option.nameLocation; + style.textFont = this.getFont(this.option.nameTextStyle); if (this.option.nameTextStyle.align) { - axShape.style.textAlign = this.option.nameTextStyle.align; + style.textAlign = this.option.nameTextStyle.align; } if (this.option.nameTextStyle.baseline) { - axShape.style.textBaseline = this.option.nameTextStyle.baseline; + style.textBaseline = this.option.nameTextStyle.baseline; } if (this.option.nameTextStyle.color) { - axShape.style.textColor = this.option.nameTextStyle.color; + style.textColor = this.option.nameTextStyle.color; } } - axShape.style.strokeColor = this.option.axisLine.lineStyle.color; + style.strokeColor = this.option.axisLine.lineStyle.color; - axShape.style.lineWidth = lineWidth; + style.lineWidth = lineWidth; // 亚像素优化 if (this.isHorizontal()) { // 横向布局,优化y - axShape.style.yStart - = axShape.style.yEnd - = this.subPixelOptimize(axShape.style.yEnd, lineWidth); + style.yStart + = style.yEnd + = this.subPixelOptimize(style.yEnd, lineWidth); } else { // 纵向布局,优化x - axShape.style.xStart - = axShape.style.xEnd - = this.subPixelOptimize(axShape.style.xEnd, lineWidth); + style.xStart + = style.xEnd + = this.subPixelOptimize(style.xEnd, lineWidth); } - axShape.style.lineType = this.option.axisLine.lineStyle.type; + style.lineType = this.option.axisLine.lineStyle.type; axShape = new LineShape(axShape); this.shapeList.push(axShape); }, - _axisLabelClickable : function(clickable, axShape) { + _axisLabelClickable: function(clickable, axShape) { if (clickable) { ecData.pack( axShape, undefined, -1, undefined, -1, axShape.style.text @@ -137,7 +140,7 @@ define(function (require) { axShape.hoverable = true; axShape.clickable = true; axShape.highlightStyle = { - color : zrColor.lift(axShape.style.color, 1), + color: zrColor.lift(axShape.style.color, 1), brushType: 'fill' }; return axShape; @@ -147,15 +150,15 @@ define(function (require) { } }, - refixAxisShape : function(zeroX, zeroY) { + refixAxisShape: function(zeroX, zeroY) { if (!this.option.axisLine.onZero) { return; } var tickLength; - if (this.isHorizontal() && typeof zeroY != 'undefined') { + if (this.isHorizontal() && zeroY != null) { // 横向布局调整纵向y for (var i = 0, l = this.shapeList.length; i < l; i++) { - if (this.shapeList[i]._axisShape == 'axisLine') { + if (this.shapeList[i]._axisShape === 'axisLine') { this.shapeList[i].style.yStart = this.shapeList[i].style.yEnd = this.subPixelOptimize( @@ -163,7 +166,7 @@ define(function (require) { ); this.zr.modShape(this.shapeList[i].id); } - else if (this.shapeList[i]._axisShape == 'axisTick') { + else if (this.shapeList[i]._axisShape === 'axisTick') { tickLength = this.shapeList[i].style.yEnd - this.shapeList[i].style.yStart; this.shapeList[i].style.yStart = zeroY - tickLength; @@ -172,10 +175,10 @@ define(function (require) { } } } - if (!this.isHorizontal() && typeof zeroX != 'undefined') { + if (!this.isHorizontal() && zeroX != null) { // 纵向布局调整横向x for (var i = 0, l = this.shapeList.length; i < l; i++) { - if (this.shapeList[i]._axisShape == 'axisLine') { + if (this.shapeList[i]._axisShape === 'axisLine') { this.shapeList[i].style.xStart = this.shapeList[i].style.xEnd = this.subPixelOptimize( @@ -183,7 +186,7 @@ define(function (require) { ); this.zr.modShape(this.shapeList[i].id); } - else if (this.shapeList[i]._axisShape == 'axisTick') { + else if (this.shapeList[i]._axisShape === 'axisTick') { tickLength = this.shapeList[i].style.xEnd - this.shapeList[i].style.xStart; this.shapeList[i].style.xStart = zeroX; @@ -194,22 +197,22 @@ define(function (require) { } }, - getPosition : function () { + getPosition: function () { return this.option.position; }, - isHorizontal : function() { - return this.option.position == 'bottom' || this.option.position == 'top'; + isHorizontal: function() { + return this.option.position === 'bottom' || this.option.position === 'top'; } }, /** * 参数修正&默认值赋值,重载基类方法 * @param {Object} opt 参数 */ - reformOption : function (opt) { + reformOption: function (opt) { // 不写或传了个空数值默认为数值轴 if (!opt || (opt instanceof Array && opt.length === 0)) { - opt = [{type : ecConfig.COMPONENT_TYPE_AXIS_VALUE}]; + opt = [ { type: ecConfig.COMPONENT_TYPE_AXIS_VALUE } ]; } else if (!(opt instanceof Array)){ opt = [opt]; @@ -217,20 +220,18 @@ define(function (require) { // 最多两条,其他参数忽略 if (opt.length > 2) { - opt = [opt[0],opt[1]]; + opt = [opt[0], opt[1]]; } - if (this.axisType == 'xAxis') { + if (this.axisType === 'xAxis') { // 横轴位置默认配置 if (!opt[0].position // 没配置或配置错 - || (opt[0].position != 'bottom' - && opt[0].position != 'top') + || (opt[0].position != 'bottom' && opt[0].position != 'top') ) { opt[0].position = 'bottom'; } if (opt.length > 1) { - opt[1].position = opt[0].position == 'bottom' - ? 'top' : 'bottom'; + opt[1].position = opt[0].position === 'bottom' ? 'top' : 'bottom'; } for (var i = 0, l = opt.length; i < l; i++) { @@ -244,15 +245,13 @@ define(function (require) { else { // 纵轴位置默认配置 if (!opt[0].position // 没配置或配置错 - || (opt[0].position != 'left' - && opt[0].position != 'right') + || (opt[0].position != 'left' && opt[0].position != 'right') ) { opt[0].position = 'left'; } if (opt.length > 1) { - opt[1].position = opt[0].position == 'left' - ? 'right' : 'left'; + opt[1].position = opt[0].position === 'left' ? 'right' : 'left'; } for (var i = 0, l = opt.length; i < l; i++) { @@ -270,11 +269,11 @@ define(function (require) { /** * 刷新 */ - refresh : function (newOption) { + refresh: function (newOption) { var axisOption; if (newOption) { this.option = newOption; - if (this.axisType == 'xAxis') { + if (this.axisType === 'xAxis') { this.option.xAxis = this.reformOption(newOption.xAxis); axisOption = this.option.xAxis; } @@ -304,7 +303,7 @@ define(function (require) { ); } else if (axisOption && axisOption[i]) { - this._axisList[i] = axisOption[i].type == 'category' + this._axisList[i] = axisOption[i].type === 'category' ? new CategoryAxis( this.ecTheme, this.messageCenter, this.zr, axisOption[i], this.myChart, this.axisBase @@ -323,11 +322,11 @@ define(function (require) { * 根据值换算位置 * @param {number} idx 坐标轴索引0~1 */ - getAxis : function (idx) { + getAxis: function (idx) { return this._axisList[idx]; }, - clear : function () { + clear: function () { for (var i = 0, l = this._axisList.length; i < l; i++) { this._axisList[i].dispose && this._axisList[i].dispose(); } diff --git a/amd/component/base.js b/amd/component/base.js index c005171..873b727 100644 --- a/amd/component/base.js +++ b/amd/component/base.js @@ -2,11 +2,12 @@ * echarts组件基类 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ define(function (require) { var ecConfig = require('../config'); + var ecData = require('../util/ecData'); var ecQuery = require('../util/ecQuery'); var number = require('../util/number'); var zrUtil = require('../zrender/tool/util'); @@ -19,90 +20,64 @@ define(function (require) { this.series = option.series; this.myChart = myChart; this.component = myChart.component; - - this._zlevelBase = this.getZlevelBase(); + this.shapeList = []; this.effectList = []; var self = this; - self.hoverConnect = function (param) { - var target = (param.target || {}).hoverConnect; - if (target) { - var zlevel = 10; - var shape; - if (!(target instanceof Array)) { - shape = self.getShapeById(target); - if (shape) { - self.zr.addHoverShape(shape); - zlevel = Math.min(zlevel, shape.zlevel); - } - } - else { - for (var i = 0, l = target.length; i < l; i++) { - shape = self.getShapeById(target[i]); - self.zr.addHoverShape(shape); - zlevel = Math.min(zlevel, shape.zlevel); + + self._onlegendhoverlink = function(param) { + if (self.legendHoverLink) { + var targetName = param.target; + var name; + for (var i = self.shapeList.length - 1; i >= 0; i--) { + name = self.type == ecConfig.CHART_TYPE_PIE + || self.type == ecConfig.CHART_TYPE_FUNNEL + ? ecData.get(self.shapeList[i], 'name') + : (ecData.get(self.shapeList[i], 'series') || {}).name; + if (name == targetName + && !self.shapeList[i].invisible + && !self.shapeList[i]._animating + ) { + self.zr.addHoverShape(self.shapeList[i]); } } - if (zlevel < param.target.zlevel) { - self.zr.addHoverShape(param.target); - } } }; + messageCenter && messageCenter.bind( + ecConfig.EVENT.LEGEND_HOVERLINK, this._onlegendhoverlink + ); } /** * 基类方法 */ Base.prototype = { - canvasSupported : require('../zrender/tool/env').canvasSupported, + canvasSupported: require('../zrender/tool/env').canvasSupported, + _getZ : function(zWhat) { + var opt = this.ecTheme[this.type]; + if (opt && opt[zWhat] != null) { + return opt[zWhat]; + } + opt = ecConfig[this.type]; + if (opt && opt[zWhat] != null) { + return opt[zWhat]; + } + return 0; + }, + /** * 获取zlevel基数配置 - * @param {Object} contentType */ - getZlevelBase : function (contentType) { - contentType = contentType || this.type + ''; - - switch (contentType) { - case ecConfig.COMPONENT_TYPE_GRID : - case ecConfig.COMPONENT_TYPE_AXIS_CATEGORY : - case ecConfig.COMPONENT_TYPE_AXIS_VALUE : - case ecConfig.COMPONENT_TYPE_POLAR : - return 0; - - case ecConfig.CHART_TYPE_LINE : - case ecConfig.CHART_TYPE_BAR : - case ecConfig.CHART_TYPE_SCATTER : - case ecConfig.CHART_TYPE_PIE : - case ecConfig.CHART_TYPE_RADAR : - case ecConfig.CHART_TYPE_MAP : - case ecConfig.CHART_TYPE_K : - case ecConfig.CHART_TYPE_CHORD: - case ecConfig.CHART_TYPE_GUAGE: - case ecConfig.CHART_TYPE_FUNNEL: - return 2; - - case ecConfig.COMPONENT_TYPE_LEGEND : - case ecConfig.COMPONENT_TYPE_DATARANGE: - case ecConfig.COMPONENT_TYPE_DATAZOOM : - case ecConfig.COMPONENT_TYPE_TIMELINE : - return 4; - - case ecConfig.CHART_TYPE_ISLAND : - return 5; - - case ecConfig.COMPONENT_TYPE_TOOLBOX : - case ecConfig.COMPONENT_TYPE_TITLE : - return 6; - - // ecConfig.EFFECT_ZLEVEL = 7; - - case ecConfig.COMPONENT_TYPE_TOOLTIP : - return 8; - - default : - return 0; - } + getZlevelBase: function () { + return this._getZ('zlevel'); + }, + + /** + * 获取z基数配置 + */ + getZBase: function() { + return this._getZ('z'); }, /** @@ -111,17 +86,21 @@ define(function (require) { * * @return {Object} 修正后的参数 */ - reformOption : function (opt) { + reformOption: function (opt) { + // 默认配置项动态多级合并,依赖加载的组件选项未被merge到ecTheme里,需要从config里取 return zrUtil.merge( - opt || {}, - zrUtil.clone(this.ecTheme[this.type] || {}) + zrUtil.merge( + opt || {}, + zrUtil.clone(this.ecTheme[this.type] || {}) + ), + zrUtil.clone(ecConfig[this.type] || {}) ); }, /** * css类属性数组补全,如padding,margin等~ */ - reformCssArray : function (p) { + reformCssArray: function (p) { if (p instanceof Array) { switch (p.length + '') { case '4': @@ -140,10 +119,10 @@ define(function (require) { return [p, p, p, p]; } }, - - getShapeById : function(id) { + + getShapeById: function(id) { for (var i = 0, l = this.shapeList.length; i < l; i++) { - if (this.shapeList[i].id == id) { + if (this.shapeList[i].id === id) { return this.shapeList[i]; } } @@ -153,27 +132,56 @@ define(function (require) { /** * 获取自定义和默认配置合并后的字体设置 */ - getFont : function (textStyle) { - var finalTextStyle = zrUtil.merge( - zrUtil.clone(textStyle) || {}, - this.ecTheme.textStyle + getFont: function (textStyle) { + var finalTextStyle = this.getTextStyle( + zrUtil.clone(textStyle) ); return finalTextStyle.fontStyle + ' ' + finalTextStyle.fontWeight + ' ' + finalTextStyle.fontSize + 'px ' + finalTextStyle.fontFamily; }, + + /** + * 获取统一主题字体样式 + */ + getTextStyle: function(targetStyle) { + return zrUtil.merge( + zrUtil.merge( + targetStyle || {}, + this.ecTheme.textStyle + ), + ecConfig.textStyle + ); + }, - getItemStyleColor : function (itemColor, seriesIndex, dataIndex, data) { - return typeof itemColor == 'function' - ? itemColor(seriesIndex, dataIndex, data) : itemColor; + getItemStyleColor: function (itemColor, seriesIndex, dataIndex, data) { + return typeof itemColor === 'function' + ? itemColor.call( + this.myChart, + { + seriesIndex: seriesIndex, + series: this.series[seriesIndex], + dataIndex: dataIndex, + data: data + } + ) + : itemColor; - }, + }, + + /** + * @parmas {object | number} data 目标data + * @params {string= | number=} defaultData 无数据时默认返回 + */ + getDataFromOption: function (data, defaultData) { + return data != null ? (data.value != null ? data.value : data) : defaultData; + }, // 亚像素优化 - subPixelOptimize : function (position, lineWidth) { - if (lineWidth % 2 == 1) { - //position += position == Math.ceil(position) ? 0.5 : 0; + subPixelOptimize: function (position, lineWidth) { + if (lineWidth % 2 === 1) { + //position += position === Math.ceil(position) ? 0.5 : 0; position = Math.floor(position) + 0.5; } else { @@ -182,8 +190,8 @@ define(function (require) { return position; }, - - resize : function () { + // 默认resize + resize: function () { this.refresh && this.refresh(); this.clearEffectShape && this.clearEffectShape(true); var self = this; @@ -204,20 +212,25 @@ define(function (require) { /** * 释放后实例不可用 */ - dispose : function () { + dispose: function () { + this.onbeforDispose && this.onbeforDispose(); this.clear(); this.shapeList = null; this.effectList = null; + this.messageCenter && this.messageCenter.unbind( + ecConfig.EVENT.LEGEND_HOVERLINK, this._onlegendhoverlink + ); + this.onafterDispose && this.onafterDispose(); }, - query : ecQuery.query, - deepQuery : ecQuery.deepQuery, - deepMerge : ecQuery.deepMerge, + query: ecQuery.query, + deepQuery: ecQuery.deepQuery, + deepMerge: ecQuery.deepMerge, - parsePercent : number.parsePercent, - parseCenter : number.parseCenter, - parseRadius : number.parseRadius, - numAddCommas : number.addCommas + parsePercent: number.parsePercent, + parseCenter: number.parseCenter, + parseRadius: number.parseRadius, + numAddCommas: number.addCommas }; return Base; diff --git a/amd/component/categoryAxis.js b/amd/component/categoryAxis.js index 6e16311..b801814 100644 --- a/amd/component/categoryAxis.js +++ b/amd/component/categoryAxis.js @@ -2,7 +2,7 @@ * echarts组件: 类目轴 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ define(function (require) { @@ -14,6 +14,65 @@ define(function (require) { var RectangleShape = require('../zrender/shape/Rectangle'); var ecConfig = require('../config'); + // 类目轴 + ecConfig.categoryAxis = { + zlevel: 0, // 一级层叠 + z: 0, // 二级层叠 + show: true, + position: 'bottom', // 位置 + name: '', // 坐标轴名字,默认为空 + nameLocation: 'end', // 坐标轴名字位置,支持'start' | 'end' + nameTextStyle: {}, // 坐标轴文字样式,默认取全局样式 + boundaryGap: true, // 类目起始和结束两端空白策略 + axisLine: { // 坐标轴线 + show: true, // 默认显示,属性show控制显示与否 + onZero: true, + lineStyle: { // 属性lineStyle控制线条样式 + color: '#48b', + width: 2, + type: 'solid' + } + }, + axisTick: { // 坐标轴小标记 + show: true, // 属性show控制显示与否,默认不显示 + interval: 'auto', + inside: false, // 控制小标记是否在grid里 + // onGap: null, + length :5, // 属性length控制线长 + lineStyle: { // 属性lineStyle控制线条样式 + color: '#333', + width: 1 + } + }, + axisLabel: { // 坐标轴文本标签,详见axis.axisLabel + show: true, + interval: 'auto', + rotate: 0, + margin: 8, + // clickable: false, + // formatter: null, + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: '#333' + } + }, + splitLine: { // 分隔线 + show: true, // 默认显示,属性show控制显示与否 + // onGap: null, + lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 + color: ['#ccc'], + width: 1, + type: 'solid' + } + }, + splitArea: { // 分隔区域 + show: false, // 默认不显示,属性show控制显示与否 + // onGap: null, + areaStyle: { // 属性areaStyle(详见areaStyle)控制区域样式 + color: ['rgba(250,250,250,0.3)','rgba(200,200,200,0.3)'] + } + } + }; + var zrUtil = require('../zrender/tool/util'); var zrArea = require('../zrender/tool/area'); @@ -44,9 +103,7 @@ define(function (require) { CategoryAxis.prototype = { type : ecConfig.COMPONENT_TYPE_AXIS_CATEGORY, _getReformedLabel : function (idx) { - var data = typeof this.option.data[idx].value != 'undefined' - ? this.option.data[idx].value - : this.option.data[idx]; + var data = this.getDataFromOption(this.option.data[idx]); var formatter = this.option.data[idx].formatter || this.option.axisLabel.formatter; if (formatter) { @@ -149,8 +206,8 @@ define(function (require) { } } else { - // 用户自定义间隔 - interval = interval - 0 + 1; + // 用户自定义间隔,支持funtion + interval = typeof interval == 'function' ? 1 : (interval - 0 + 1); } return interval; @@ -162,7 +219,9 @@ define(function (require) { _buildShape : function () { // 标签显示的挑选间隔 this._interval = this._getInterval(); - + if (!this.option.show) { + return; + } this.option.splitArea.show && this._buildSplitArea(); this.option.splitLine.show && this._buildSplitLine(); this.option.axisLine.show && this._buildAxisLine(); @@ -177,14 +236,23 @@ define(function (require) { // 小标记 _buildAxisTick : function () { var axShape; - //var data = this.option.data; + var data = this.option.data; var dataLength = this.option.data.length; var tickOption = this.option.axisTick; var length = tickOption.length; var color = tickOption.lineStyle.color; var lineWidth = tickOption.lineStyle.width; - var interval = tickOption.interval == 'auto' - ? this._interval : (tickOption.interval - 0 + 1); + var intervalFunction = typeof tickOption.interval == 'function' + ? tickOption.interval + : tickOption.interval == 'auto' + ? typeof this.option.axisLabel.interval == 'function' + ? this.option.axisLabel.interval : false + : false; + var interval = intervalFunction + ? 1 + : tickOption.interval == 'auto' + ? this._interval + : (tickOption.interval - 0 + 1); var onGap = tickOption.onGap; var optGap = onGap ? (this.getGap() / 2) @@ -201,13 +269,18 @@ define(function (require) { ? (this.grid.getY() + 1) : (this.grid.getY() - length - 1)); var x; for (var i = startIndex; i < dataLength; i += interval) { + if (intervalFunction && !intervalFunction(i, data[i])) { + // 回调并且回调返回false则跳过渲染 + continue; + } // 亚像素优化 x = this.subPixelOptimize( this.getCoordByIndex(i) + (i >= 0 ? optGap : 0), lineWidth ); axShape = { _axisShape : 'axisTick', - zlevel : this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), hoverable : false, style : { xStart : x, @@ -231,13 +304,18 @@ define(function (require) { var y; for (var i = startIndex; i < dataLength; i += interval) { + if (intervalFunction && !intervalFunction(i, data[i])) { + // 回调并且回调返回false则中断渲染 + continue; + } // 亚像素优化 y = this.subPixelOptimize( this.getCoordByIndex(i) - (i >= 0 ? optGap : 0), lineWidth ); axShape = { _axisShape : 'axisTick', - zlevel : this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), hoverable : false, style : { xStart : xPosition, @@ -258,10 +336,13 @@ define(function (require) { var axShape; var data = this.option.data; var dataLength = this.option.data.length; - var rotate = this.option.axisLabel.rotate; - var margin = this.option.axisLabel.margin; - var clickable = this.option.axisLabel.clickable; - var textStyle = this.option.axisLabel.textStyle; + var labelOption = this.option.axisLabel; + var rotate = labelOption.rotate; + var margin = labelOption.margin; + var clickable = labelOption.clickable; + var textStyle = labelOption.textStyle; + var intervalFunction = typeof labelOption.interval == 'function' + ? labelOption.interval : false; var dataTextStyle; if (this.isHorizontal()) { @@ -278,8 +359,10 @@ define(function (require) { } for (var i = 0; i < dataLength; i += this._interval) { - if (this._getReformedLabel(i) === '') { - // 空文本优化 + if ((intervalFunction && !intervalFunction(i, data[i])) + // 回调并且回调返回false则中断渲染 + || this._getReformedLabel(i) === '' // 空文本优化 + ) { continue; } dataTextStyle = zrUtil.merge( @@ -288,7 +371,8 @@ define(function (require) { ); axShape = { // shape : 'text', - zlevel : this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase() + 3, hoverable : false, style : { x : this.getCoordByIndex(i), @@ -331,8 +415,10 @@ define(function (require) { } for (var i = 0; i < dataLength; i += this._interval) { - if (this._getReformedLabel(i) === '') { - // 空文本优化 + if ((intervalFunction && !intervalFunction(i, data[i])) + // 回调并且回调返回false则中断渲染 + || this._getReformedLabel(i) === '' // 空文本优化 + ) { continue; } dataTextStyle = zrUtil.merge( @@ -341,7 +427,8 @@ define(function (require) { ); axShape = { // shape : 'text', - zlevel : this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase() + 3, hoverable : false, style : { x : xPosition, @@ -376,7 +463,7 @@ define(function (require) { _buildSplitLine : function () { var axShape; - //var data = this.option.data; + var data = this.option.data; var dataLength = this.option.data.length; var sLineOption = this.option.splitLine; var lineType = sLineOption.lineStyle.type; @@ -385,6 +472,10 @@ define(function (require) { color = color instanceof Array ? color : [color]; var colorLength = color.length; + // splitLine随axisLable + var intervalFunction = typeof this.option.axisLabel.interval == 'function' + ? this.option.axisLabel.interval : false; + var onGap = sLineOption.onGap; var optGap = onGap ? (this.getGap() / 2) @@ -400,13 +491,18 @@ define(function (require) { var x; for (var i = 0; i < dataLength; i += this._interval) { + if (intervalFunction && !intervalFunction(i, data[i])) { + // 回调并且回调返回false则跳过渲染 + continue; + } // 亚像素优化 x = this.subPixelOptimize( this.getCoordByIndex(i) + optGap, lineWidth ); axShape = { // shape : 'line', - zlevel : this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), hoverable : false, style : { xStart : x, @@ -429,13 +525,18 @@ define(function (require) { var y; for (var i = 0; i < dataLength; i += this._interval) { + if (intervalFunction && !intervalFunction(i, data[i])) { + // 回调并且回调返回false则跳过渲染 + continue; + } // 亚像素优化 y = this.subPixelOptimize( this.getCoordByIndex(i) - optGap, lineWidth ); axShape = { // shape : 'line', - zlevel : this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), hoverable : false, style : { xStart : sx, @@ -443,7 +544,7 @@ define(function (require) { xEnd : ex, yEnd : y, strokeColor : color[(i / this._interval) % colorLength], - linetype : lineType, + lineType : lineType, lineWidth : lineWidth } }; @@ -454,13 +555,15 @@ define(function (require) { _buildSplitArea : function () { var axShape; + var data = this.option.data; var sAreaOption = this.option.splitArea; var color = sAreaOption.areaStyle.color; if (!(color instanceof Array)) { // 非数组一律认为是单一颜色的字符串,单一颜色则用一个背景,颜色错误不负责啊!!! axShape = { // shape : 'rectangle', - zlevel : this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), hoverable : false, style : { x : this.grid.getX(), @@ -477,6 +580,10 @@ define(function (require) { // 多颜色 var colorLength = color.length; var dataLength = this.option.data.length; + + // splitArea随axisLable + var intervalFunction = typeof this.option.axisLabel.interval == 'function' + ? this.option.axisLabel.interval : false; var onGap = sAreaOption.onGap; var optGap = onGap @@ -492,12 +599,17 @@ define(function (require) { var curX; for (var i = 0; i <= dataLength; i += this._interval) { + if (intervalFunction && !intervalFunction(i, data[i]) && i < dataLength) { + // 回调并且回调返回false则跳过渲染 + continue; + } curX = i < dataLength ? (this.getCoordByIndex(i) + optGap) : this.grid.getXend(); axShape = { // shape : 'rectangle', - zlevel : this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), hoverable : false, style : { x : lastX, @@ -520,12 +632,17 @@ define(function (require) { var curY; for (var i = 0; i <= dataLength; i += this._interval) { + if (intervalFunction && !intervalFunction(i, data[i]) && i < dataLength) { + // 回调并且回调返回false则跳过渲染 + continue; + } curY = i < dataLength ? (this.getCoordByIndex(i) - optGap) : this.grid.getY(); axShape = { // shape : 'rectangle', - zlevel : this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), hoverable : false, style : { x : x, @@ -550,9 +667,8 @@ define(function (require) { if (newOption) { this.option = this.reformOption(newOption); // 通用字体设置 - this.option.axisLabel.textStyle = zrUtil.merge( - this.option.axisLabel.textStyle || {}, - this.ecTheme.textStyle + this.option.axisLabel.textStyle = this.getTextStyle( + this.option.axisLabel.textStyle ); } this.clear(); @@ -583,10 +699,7 @@ define(function (require) { var position = this.option.boundaryGap ? (gap / 2) : 0; for (var i = 0; i < dataLength; i++) { - if (data[i] == value - || (typeof data[i].value != 'undefined' - && data[i].value == value) - ) { + if (this.getDataFromOption(data[i]) == value) { if (this.isHorizontal()) { // 横向 position = this.grid.getX() + position; @@ -651,14 +764,7 @@ define(function (require) { // 根据类目轴数据索引换算类目轴名称 getNameByIndex : function (dataIndex) { - var data = this.option.data[dataIndex]; - if (typeof data != 'undefined' && typeof data.value != 'undefined') - { - return data.value; - } - else { - return data; - } + return this.getDataFromOption(this.option.data[dataIndex]); }, // 根据类目轴名称换算类目轴数据索引 @@ -667,10 +773,7 @@ define(function (require) { var dataLength = data.length; for (var i = 0; i < dataLength; i++) { - if (data[i] == name - || (typeof data[i].value != 'undefined' - && data[i].value == name) - ) { + if (this.getDataFromOption(data[i]) == name) { return i; } } diff --git a/amd/component/dataRange.js b/amd/component/dataRange.js index 6ceeac2..2c8253b 100644 --- a/amd/component/dataRange.js +++ b/amd/component/dataRange.js @@ -2,7 +2,7 @@ * echarts组件:值域 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ define(function (require) { @@ -14,7 +14,46 @@ define(function (require) { var HandlePolygonShape = require('../util/shape/HandlePolygon'); var ecConfig = require('../config'); + // 值域 + ecConfig.dataRange = { + zlevel: 0, // 一级层叠 + z: 4, // 二级层叠 + show: true, + orient: 'vertical', // 布局方式,默认为垂直布局,可选为: + // 'horizontal' ¦ 'vertical' + x: 'left', // 水平安放位置,默认为全图左对齐,可选为: + // 'center' ¦ 'left' ¦ 'right' + // ¦ {number}(x坐标,单位px) + y: 'bottom', // 垂直安放位置,默认为全图底部,可选为: + // 'top' ¦ 'bottom' ¦ 'center' + // ¦ {number}(y坐标,单位px) + backgroundColor: 'rgba(0,0,0,0)', + borderColor: '#ccc', // 值域边框颜色 + borderWidth: 0, // 值域边框线宽,单位px,默认为0(无边框) + padding: 5, // 值域内边距,单位px,默认各方向内边距为5, + // 接受数组分别设定上右下左边距,同css + itemGap: 10, // 各个item之间的间隔,单位px,默认为10, + // 横向布局时为水平间隔,纵向布局时为纵向间隔 + itemWidth: 20, // 值域图形宽度,线性渐变水平布局宽度为该值 * 10 + itemHeight: 14, // 值域图形高度,线性渐变垂直布局高度为该值 * 10 + // min: null, // 最小值 + // max: null, // 最大值 + precision: 0, // 小数精度,默认为0,无小数点 + splitNumber: 5, // 分割段数,默认为5,为0时为线性渐变 + calculable: false, // 是否值域漫游,启用后无视splitNumber,线性渐变 + selectedMode: true, // 选择模式,默认开启值域开关 + hoverLink: true, + realtime: true, + color:['#006edd','#e0ffff'],//颜色 + // formatter: null, + // text:['高','低'], // 文本,默认为数值文本 + textStyle: { + color: '#333' // 值域文字颜色 + } + }; + var zrUtil = require('../zrender/tool/util'); + var zrEvent = require('../zrender/tool/event'); var zrArea = require('../zrender/tool/area'); var zrColor = require('../zrender/tool/color'); @@ -45,10 +84,18 @@ define(function (require) { self._dataRangeSelected = function(param) { return self.__dataRangeSelected(param); }; + self._dispatchHoverLink = function(param) { + return self.__dispatchHoverLink(param); + }; + self._onhoverlink = function(params) { + return self.__onhoverlink(params); + }; this._selectedMap = {}; this._range = {}; this.refresh(option); + + messageCenter.bind(ecConfig.EVENT.HOVER, this._onhoverlink); } DataRange.prototype = { @@ -66,9 +113,11 @@ define(function (require) { else { this._buildItem(); } - - for (var i = 0, l = this.shapeList.length; i < l; i++) { - this.zr.addShape(this.shapeList[i]); + + if (this.dataRangeOption.show) { + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } } this._syncShapeFromRange(); @@ -126,7 +175,7 @@ define(function (require) { for (var i = 0; i < dataLength; i++) { itemName = data[i]; - color = this.getColor((dataLength - i) * this._gap + this.dataRangeOption.min); + color = this.getColorByIndex(i); // 图形 itemShape = this._getItemShape( lastX, lastY, @@ -134,13 +183,18 @@ define(function (require) { (this._selectedMap[i] ? color : '#ccc') ); itemShape._idx = i; - itemShape.onclick = this._dataRangeSelected; + itemShape.onmousemove = this._dispatchHoverLink; + if (this.dataRangeOption.selectedMode) { + itemShape.clickable = true; + itemShape.onclick = this._dataRangeSelected; + } this.shapeList.push(new RectangleShape(itemShape)); if (needValueText) { // 文字 textShape = { - zlevel : this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), style : { x : lastX + itemWidth + 5, y : lastY, @@ -153,8 +207,7 @@ define(function (require) { }, highlightStyle:{ brushType: 'fill' - }, - clickable : true + } }; if (this.dataRangeOption.orient == 'vertical' && this.dataRangeOption.x == 'right' @@ -163,7 +216,11 @@ define(function (require) { textShape.style.textAlign = 'right'; } textShape._idx = i; - textShape.onclick = this._dataRangeSelected; + textShape.onmousemove = this._dispatchHoverLink; + if (this.dataRangeOption.selectedMode) { + textShape.clickable = true; + textShape.onclick = this._dataRangeSelected; + } this.shapeList.push(new TextShape(textShape)); } @@ -214,6 +271,7 @@ define(function (require) { var itemWidth = this.dataRangeOption.itemWidth; var itemHeight = this.dataRangeOption.itemHeight; var textHeight = zrArea.getTextHeight('国', font); + var mSize = 10; var needValueText = true; @@ -248,46 +306,49 @@ define(function (require) { } if (this.dataRangeOption.orient == 'horizontal') { itemShape = { - zlevel : this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), style : { x : lastX, y : lastY, - width : itemWidth * 10, + width : itemWidth * mSize, height : itemHeight, color : zrColor.getLinearGradient( - lastX, lastY, lastX + itemWidth * 10, lastY, + lastX, lastY, lastX + itemWidth * mSize, lastY, colorList ) }, hoverable : false }; - lastX += itemWidth * 10 + this._textGap; + lastX += itemWidth * mSize + this._textGap; } else { itemShape = { - zlevel : this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), style : { x : lastX, y : lastY, width : itemWidth, - height : itemHeight * 10, + height : itemHeight * mSize, color : zrColor.getLinearGradient( - lastX, lastY, lastX, lastY + itemHeight * 10, + lastX, lastY, lastX, lastY + itemHeight * mSize, colorList ) }, hoverable : false }; - lastY += itemHeight * 10 + this._textGap; + lastY += itemHeight * mSize + this._textGap; } this.shapeList.push(new RectangleShape(itemShape)); + // 可计算元素的位置缓存 + this._calculableLocation = itemShape.style; if (this.dataRangeOption.calculable) { - // 可计算元素的位置缓存 - this._calculableLocation = itemShape.style; this._buildFiller(); this._bulidMask(); this._bulidHandle(); } + this._buildIndicator(); if (!needValueText && this.dataRangeOption.text[1]) { // 最后一个文字 @@ -299,12 +360,88 @@ define(function (require) { } }, + /** + * 构建指示器 + */ + _buildIndicator : function() { + var x = this._calculableLocation.x; + var y = this._calculableLocation.y; + var width = this._calculableLocation.width; + var height = this._calculableLocation.height; + + var size = 5; + var pointList; + var textPosition; + if (this.dataRangeOption.orient == 'horizontal') { + // 水平 + if (this.dataRangeOption.y != 'bottom') { + // 手柄统统在下方 + pointList = [ + [x, y + height], + [x - size, y + height + size], + [x + size, y + height + size] + ]; + textPosition = 'bottom'; + } + else { + // 手柄在上方 + pointList = [ + [x, y], + [x - size, y - size], + [x + size, y - size] + ]; + textPosition = 'top'; + } + } + else { + // 垂直 + if (this.dataRangeOption.x != 'right') { + // 手柄统统在右侧 + pointList = [ + [x + width, y], + [x + width + size, y - size], + [x + width + size, y + size] + ]; + textPosition = 'right'; + } + else { + // 手柄在左侧 + pointList = [ + [x, y], + [x - size, y - size], + [x - size, y + size] + ]; + textPosition = 'left'; + } + } + this._indicatorShape = { + style : { + pointList : pointList, + color : '#fff', + __rect : { + x : Math.min(pointList[0][0], pointList[1][0]), + y : Math.min(pointList[0][1], pointList[1][1]), + width : size * (this.dataRangeOption.orient == 'horizontal' ? 2 : 1), + height : size * (this.dataRangeOption.orient == 'horizontal' ? 1 : 2) + } + }, + highlightStyle : { + brushType : 'fill', + textPosition : textPosition, + textColor : this.dataRangeOption.textStyle.color + }, + hoverable: false + }; + this._indicatorShape = new HandlePolygonShape(this._indicatorShape); + }, + /** * 构建填充物 */ _buildFiller : function () { - this._fillerShae = { - zlevel : this._zlevelBase + 1, + this._fillerShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, style : { x : this._calculableLocation.x, y : this._calculableLocation.y, @@ -319,10 +456,11 @@ define(function (require) { draggable : true, ondrift : this._ondrift, ondragend : this._ondragend, + onmousemove : this._dispatchHoverLink, _type : 'filler' }; - this._fillerShae = new RectangleShape(this._fillerShae); - this.shapeList.push(this._fillerShae); + this._fillerShape = new RectangleShape(this._fillerShape); + this.shapeList.push(this._fillerShape); }, /** @@ -501,6 +639,7 @@ define(function (require) { text : this._textFormat(this.dataRangeOption.max), textX : textXStart, textY : textYStart, + textFont: font, color : this.getColor(this.dataRangeOption.max), rect : coverRectStart, x : pointListStart[0][0], @@ -520,6 +659,7 @@ define(function (require) { text : this._textFormat(this.dataRangeOption.min), textX : textXEnd, textY : textYEnd, + textFont: font, color : this.getColor(this.dataRangeOption.min), rect : coverRectEnd, x : pointListEnd[0][0], @@ -534,7 +674,8 @@ define(function (require) { }; // 统一参数 - this._startShape.zlevel = this._endShape.zlevel = this._zlevelBase + 1; + this._startShape.zlevel = this._endShape.zlevel = this.getZlevelBase(); + this._startShape.z = this._endShape.z = this.getZBase() + 1; this._startShape.draggable = this._endShape.draggable = true; this._startShape.ondrift = this._endShape.ondrift = this._ondrift; this._startShape.ondragend = this._endShape.ondragend = this._ondragend; @@ -561,7 +702,8 @@ define(function (require) { var width = this._calculableLocation.width; var height = this._calculableLocation.height; this._startMask = { - zlevel : this._zlevelBase + 1, + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, style : { x : x, y : y, @@ -574,7 +716,8 @@ define(function (require) { hoverable:false }; this._endMask = { - zlevel : this._zlevelBase + 1, + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, style : { x : this.dataRangeOption.orient == 'horizontal' ? x + width : x, @@ -595,19 +738,17 @@ define(function (require) { }, _buildBackground : function () { - var pTop = this.dataRangeOption.padding[0]; - var pRight = this.dataRangeOption.padding[1]; - var pBottom = this.dataRangeOption.padding[2]; - var pLeft = this.dataRangeOption.padding[3]; - + var padding = this.reformCssArray(this.dataRangeOption.padding); + this.shapeList.push(new RectangleShape({ - zlevel : this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), hoverable :false, style : { - x : this._itemGroupLocation.x - pLeft, - y : this._itemGroupLocation.y - pTop, - width : this._itemGroupLocation.width + pLeft + pRight, - height : this._itemGroupLocation.height + pTop + pBottom, + x : this._itemGroupLocation.x - padding[3], + y : this._itemGroupLocation.y - padding[0], + width : this._itemGroupLocation.width + padding[3] + padding[1], + height : this._itemGroupLocation.height + padding[0] + padding[2], brushType : this.dataRangeOption.borderWidth === 0 ? 'fill' : 'both', color : this.dataRangeOption.backgroundColor, @@ -630,6 +771,7 @@ define(function (require) { var totalHeight = 0; var font = this.getFont(this.dataRangeOption.textStyle); var textHeight = zrArea.getTextHeight('国', font); + var mSize = 10; if (this.dataRangeOption.orient == 'horizontal') { // 水平布局,计算总宽度 @@ -641,7 +783,7 @@ define(function (require) { totalWidth = ((this.dataRangeOption.splitNumber <= 0 || this.dataRangeOption.calculable) - ? (itemWidth * 10 + itemGap) + ? (itemWidth * mSize + itemGap) : dataLength * (itemWidth + itemGap)) + (this.dataRangeOption.text && typeof this.dataRangeOption.text[0] != 'undefined' @@ -684,7 +826,7 @@ define(function (require) { totalHeight = ((this.dataRangeOption.splitNumber <= 0 || this.dataRangeOption.calculable) - ? (itemHeight * 10 + itemGap) + ? (itemHeight * mSize + itemGap) : dataLength * (itemHeight + itemGap)) + (this.dataRangeOption.text && typeof this.dataRangeOption.text[0] != 'undefined' @@ -728,6 +870,7 @@ define(function (require) { totalHeight -= itemGap; // 减去最后一个的itemGap; } + var padding = this.reformCssArray(this.dataRangeOption.padding); var x; var zrWidth = this.zr.getWidth(); switch (this.dataRangeOption.x) { @@ -735,13 +878,12 @@ define(function (require) { x = Math.floor((zrWidth - totalWidth) / 2); break; case 'left' : - x = this.dataRangeOption.padding[3] - + this.dataRangeOption.borderWidth; + x = padding[3] + this.dataRangeOption.borderWidth; break; case 'right' : x = zrWidth - totalWidth - - this.dataRangeOption.padding[1] + - padding[1] - this.dataRangeOption.borderWidth; break; default : @@ -754,13 +896,12 @@ define(function (require) { var zrHeight = this.zr.getHeight(); switch (this.dataRangeOption.y) { case 'top' : - y = this.dataRangeOption.padding[0] - + this.dataRangeOption.borderWidth; + y = padding[0] + this.dataRangeOption.borderWidth; break; case 'bottom' : y = zrHeight - totalHeight - - this.dataRangeOption.padding[2] + - padding[2] - this.dataRangeOption.borderWidth; break; case 'center' : @@ -807,7 +948,8 @@ define(function (require) { // 指定文本 _getTextShape : function (x, y, text) { return { - zlevel : this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), style : { x : (this.dataRangeOption.orient == 'horizontal' ? x @@ -834,7 +976,8 @@ define(function (require) { // 色尺legend item shape _getItemShape : function (x, y, width, height, color) { return { - zlevel : this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), style : { x : x, y : y + 1, @@ -845,8 +988,7 @@ define(function (require) { highlightStyle: { strokeColor: color, lineWidth : 1 - }, - clickable : true + } }; }, @@ -890,7 +1032,7 @@ define(function (require) { } if (this.dataRangeOption.realtime) { - this._syncData(); + this._dispatchDataRange(); } return true; @@ -909,24 +1051,12 @@ define(function (require) { return; } - !this.dataRangeOption.realtime && this._syncData(); - // 别status = {}赋值啊!! status.dragOut = true; status.dragIn = true; - if (!this.dataRangeOption.realtime && false) { - this.messageCenter.dispatch( - ecConfig.EVENT.DATA_RANGE, - null, - { - range : { - start : this._range.end, - end : this._range.start - } - }, - this.myChart - ); + if (!this.dataRangeOption.realtime) { + this._dispatchDataRange(); } status.needRefresh = false; // 会有消息触发fresh,不用再刷一遍 @@ -951,21 +1081,21 @@ define(function (require) { // 非默认满值同步一下图形 if (this.dataRangeOption.orient == 'horizontal') { // 横向 - var width = this._fillerShae.style.width; - this._fillerShae.style.x += + var width = this._fillerShape.style.width; + this._fillerShape.style.x += width * (100 - this._range.start) / 100; - this._fillerShae.style.width = + this._fillerShape.style.width = width * (this._range.start - this._range.end) / 100; } else { // 纵向 - var height = this._fillerShae.style.height; - this._fillerShae.style.y += + var height = this._fillerShape.style.height; + this._fillerShape.style.y += height * (100 - this._range.start) / 100; - this._fillerShae.style.height = + this._fillerShape.style.height = height * (this._range.start - this._range.end) / 100; } - this.zr.modShape(this._fillerShae.id); + this.zr.modShape(this._fillerShape.id); this._syncHandleShape(); } }, @@ -977,11 +1107,11 @@ define(function (require) { var height = this._calculableLocation.height; if (this.dataRangeOption.orient == 'horizontal') { - this._startShape.style.x = this._fillerShae.style.x; + this._startShape.style.x = this._fillerShape.style.x; this._startMask.style.width = this._startShape.style.x - x; - this._endShape.style.x = this._fillerShae.style.x - + this._fillerShae.style.width; + this._endShape.style.x = this._fillerShape.style.x + + this._fillerShape.style.width; this._endMask.style.x = this._endShape.style.x; this._endMask.style.width = x + width - this._endShape.style.x; @@ -993,11 +1123,11 @@ define(function (require) { ); } else { - this._startShape.style.y = this._fillerShae.style.y; + this._startShape.style.y = this._fillerShape.style.y; this._startMask.style.height = this._startShape.style.y - y; - this._endShape.style.y = this._fillerShae.style.y - + this._fillerShae.style.height; + this._endShape.style.y = this._fillerShape.style.y + + this._fillerShape.style.height; this._endMask.style.y = this._endShape.style.y; this._endMask.style.height = y + height - this._endShape.style.y; @@ -1033,8 +1163,8 @@ define(function (require) { a = b; this._startShape.style.x = a; } - this._fillerShae.style.x = a; - this._fillerShae.style.width = b - a; + this._fillerShape.style.x = a; + this._fillerShape.style.width = b - a; this._startMask.style.width = a - x; this._endMask.style.x = b; this._endMask.style.width = x + width - b; @@ -1055,8 +1185,8 @@ define(function (require) { a = b; this._startShape.style.y = a; } - this._fillerShae.style.y = a; - this._fillerShae.style.height = b - a; + this._fillerShape.style.y = a; + this._fillerShape.style.height = b - a; this._startMask.style.height = a - y; this._endMask.style.y = b; this._endMask.style.height = y + height - b; @@ -1103,37 +1233,134 @@ define(function (require) { this.zr.modShape(this._endShape.id); this.zr.modShape(this._startMask.id); this.zr.modShape(this._endMask.id); - this.zr.modShape(this._fillerShae.id); - this.zr.refresh(); + this.zr.modShape(this._fillerShape.id); + this.zr.refreshNextFrame(); }, - _syncData : function () { - if (this.dataRangeOption.realtime) { - this.messageCenter.dispatch( - ecConfig.EVENT.DATA_RANGE, - null, - { - range : { - start : this._range.end, - end : this._range.start - } - }, - this.myChart - ); - } + _dispatchDataRange : function () { + this.messageCenter.dispatch( + ecConfig.EVENT.DATA_RANGE, + null, + { + range : { + start : this._range.end, + end : this._range.start + } + }, + this.myChart + ); }, __dataRangeSelected : function (param) { + if (this.dataRangeOption.selectedMode === 'single') { + for (var k in this._selectedMap) { + this._selectedMap[k] = false; + } + } var idx = param.target._idx; this._selectedMap[idx] = !this._selectedMap[idx]; + var valueMax = (this._colorList.length - idx) * this._gap + this.dataRangeOption.min; + this.messageCenter.dispatch( + ecConfig.EVENT.DATA_RANGE_SELECTED, + param.event, + { + selected: this._selectedMap, + target: idx, + valueMax: valueMax, + valueMin: valueMax - this._gap + }, + this.myChart + ); + this.messageCenter.dispatch(ecConfig.EVENT.REFRESH, null, null, this.myChart); }, + + /** + * 产生hover link事件 + */ + __dispatchHoverLink : function(param) { + var valueMin; + var valueMax; + if (this.dataRangeOption.calculable) { + var totalValue = this.dataRangeOption.max - this.dataRangeOption.min; + var curValue; + if (this.dataRangeOption.orient == 'horizontal') { + curValue = (1 - (zrEvent.getX(param.event) - this._calculableLocation.x) + / this._calculableLocation.width) + * totalValue; + } + else { + curValue = (1 - (zrEvent.getY(param.event) - this._calculableLocation.y) + / this._calculableLocation.height) + * totalValue; + } + valueMin = curValue - totalValue * 0.05; + valueMax = curValue + totalValue * 0.05; + } + else { + var idx = param.target._idx; + valueMax = (this._colorList.length - idx) * this._gap + this.dataRangeOption.min; + valueMin = valueMax - this._gap; + } + + this.messageCenter.dispatch( + ecConfig.EVENT.DATA_RANGE_HOVERLINK, + param.event, + { + valueMin : valueMin, + valueMax : valueMax + }, + this.myChart + ); + + // console.log(param,curValue); + return; + }, + + __onhoverlink: function(param) { + if (this.dataRangeOption.show + && this.dataRangeOption.hoverLink + && this._indicatorShape + && param + && param.seriesIndex != null && param.dataIndex != null + ) { + var curValue = param.value; + if (curValue === '' || isNaN(curValue)) { + return; + } + if (curValue < this.dataRangeOption.min) { + curValue = this.dataRangeOption.min; + } + else if (curValue > this.dataRangeOption.max) { + curValue = this.dataRangeOption.max; + } + + if (this.dataRangeOption.orient == 'horizontal') { + this._indicatorShape.position = [ + (this.dataRangeOption.max - curValue) + / (this.dataRangeOption.max - this.dataRangeOption.min) + * this._calculableLocation.width, + 0 + ]; + } + else { + this._indicatorShape.position = [ + 0, + (this.dataRangeOption.max - curValue) + / (this.dataRangeOption.max - this.dataRangeOption.min) + * this._calculableLocation.height + ]; + } + this._indicatorShape.style.text = this._textFormat(param.value); + this._indicatorShape.style.color = this.getColor(curValue); + this.zr.addHoverShape(this._indicatorShape); + } + }, _textFormat : function(valueStart, valueEnd) { valueStart = valueStart.toFixed(this.dataRangeOption.precision); - valueEnd = typeof valueEnd != 'undefined' - ? valueEnd.toFixed(this.dataRangeOption.precision) : ''; + valueEnd = valueEnd != null ? valueEnd.toFixed(this.dataRangeOption.precision) : ''; if (this.dataRangeOption.formatter) { if (typeof this.dataRangeOption.formatter == 'string') { return this.dataRangeOption.formatter.replace('{value}', valueStart) @@ -1160,11 +1387,11 @@ define(function (require) { if (newOption) { this.option = newOption; this.option.dataRange = this.reformOption(this.option.dataRange); - // 补全padding属性 - this.option.dataRange.padding = this.reformCssArray( - this.option.dataRange.padding - ); this.dataRangeOption = this.option.dataRange; + if (!this.myChart.canvasSupported) { + // 不支持Canvas的强制关闭实时动画 + this.dataRangeOption.realtime = false; + } var splitNumber = this.dataRangeOption.splitNumber <= 0 || this.dataRangeOption.calculable @@ -1224,6 +1451,10 @@ define(function (require) { return null; } + if (this.dataRangeOption.min == this.dataRangeOption.max) { + return this._colorList[0]; + } + if (value < this.dataRangeOption.min) { value = this.dataRangeOption.min; } @@ -1246,6 +1477,7 @@ define(function (require) { if (idx == this._colorList.length) { idx--; } + //console.log(value, idx,this._colorList[idx]) if (this._selectedMap[idx]) { return this._colorList[idx]; @@ -1253,6 +1485,24 @@ define(function (require) { else { return null; } + + }, + + getColorByIndex : function (idx) { + if (idx >= this._colorList.length) { + idx = this._colorList.length - 1; + } + else if (idx < 0) { + idx = 0; + } + return this._colorList[idx]; + }, + + /** + * 释放后实例不可用 + */ + onbeforDispose : function () { + this.messageCenter.unbind(ecConfig.EVENT.HOVER, this._onhoverlink); } }; diff --git a/amd/component/dataView.js b/amd/component/dataView.js index 568f75e..abef33d 100644 --- a/amd/component/dataView.js +++ b/amd/component/dataView.js @@ -2,7 +2,7 @@ * echarts组件:提示框 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ define(function (require) { @@ -34,7 +34,7 @@ define(function (require) { this._zrHeight = zr.getHeight(); this._zrWidth = zr.getWidth(); - this._tDom.className = 'echarts-dataview', + this._tDom.className = 'echarts-dataview'; this.hide(); this.dom.firstChild.appendChild(this._tDom); @@ -171,11 +171,7 @@ define(function (require) { if ((axisList[i].type || 'category') == 'category') { valueList = []; for (j = 0, k = axisList[i].data.length; j < k; j++) { - data = axisList[i].data[j]; - valueList.push( - typeof data.value != 'undefined' - ? data.value : data - ); + valueList.push(this.getDataFromOption(axisList[i].data[j])); } content += valueList.join(', ') + '\n\n'; } @@ -192,11 +188,7 @@ define(function (require) { if (axisList[i].type == 'category') { valueList = []; for (j = 0, k = axisList[i].data.length; j < k; j++) { - data = axisList[i].data[j]; - valueList.push( - typeof data.value != 'undefined' - ? data.value : data - ); + valueList.push(this.getDataFromOption(axisList[i].data[j])); } content += valueList.join(', ') + '\n\n'; } @@ -219,15 +211,9 @@ define(function (require) { } if (series[i].type == ecConfig.CHART_TYPE_SCATTER) { - data = typeof data.value != 'undefined' - ? data.value - : data; - data = data.join(', '); + data = this.getDataFromOption(data).join(', '); } - valueList.push( - itemName - + (typeof data.value != 'undefined' ? data.value : data) - ); + valueList.push(itemName + this.getDataFromOption(data)); } content += (series[i].name || '-') + ' : \n'; content += valueList.join( diff --git a/amd/component/dataZoom.js b/amd/component/dataZoom.js index 6950f4a..0186efc 100644 --- a/amd/component/dataZoom.js +++ b/amd/component/dataZoom.js @@ -2,7 +2,7 @@ * echarts组件:数据区域缩放 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ define(function (require) { @@ -14,6 +14,34 @@ define(function (require) { var IconShape = require('../util/shape/Icon'); var ecConfig = require('../config'); + // 区域缩放控制器 + ecConfig.dataZoom = { + zlevel: 0, // 一级层叠 + z: 4, // 二级层叠 + show: false, + orient: 'horizontal', // 布局方式,默认为水平布局,可选为: + // 'horizontal' ¦ 'vertical' + // x: {number}, // 水平安放位置,默认为根据grid参数适配,可选为: + // {number}(x坐标,单位px) + // y: {number}, // 垂直安放位置,默认为根据grid参数适配,可选为: + // {number}(y坐标,单位px) + // width: {number}, // 指定宽度,横向布局时默认为根据grid参数适配 + // height: {number}, // 指定高度,纵向布局时默认为根据grid参数适配 + backgroundColor: 'rgba(0,0,0,0)', // 背景颜色 + dataBackgroundColor: '#eee', // 数据背景颜色 + fillerColor: 'rgba(144,197,237,0.2)', // 填充颜色 + handleColor: 'rgba(70,130,180,0.8)', // 手柄颜色 + handleSize: 8, + showDetail: true, + // xAxisIndex: [], // 默认控制所有横向类目 + // yAxisIndex: [], // 默认控制所有横向类目 + // start: 0, // 默认为0 + // end: 100, // 默认为全部 100% + realtime: true + // zoomLock: false // 是否锁定选择区域大小 + }; + + var ecDate = require('../util/date'); var zrUtil = require('../zrender/tool/util'); /** @@ -34,8 +62,7 @@ define(function (require) { return self.__ondragend(); }; - this._fillerSize = 28; // 控件大小,水平布局为高,纵向布局为宽 - this._handleSize = 8; // 手柄大小 + this._fillerSize = 30; // 控件大小,水平布局为高,纵向布局为宽 // this._fillerShae; // 填充 // this._startShape; // 起始手柄 // this._endShape; // 结束手柄 @@ -48,6 +75,11 @@ define(function (require) { this.option.dataZoom = this.reformOption(this.option.dataZoom); this.zoomOption = this.option.dataZoom; + this._handleSize = this.zoomOption.handleSize; + if (!this.myChart.canvasSupported) { + // 不支持Canvas的强制关闭实时动画 + this.zoomOption.realtime = false; + } // 位置参数,通过计算所得x, y, width, height this._location = this._getLocation(); @@ -90,19 +122,15 @@ define(function (require) { // 水平布局 width = this.zoomOption.width || grid.getWidth(); height = this.zoomOption.height || this._fillerSize; - x = typeof this.zoomOption.x != 'undefined' - ? this.zoomOption.x : grid.getX(); - y = typeof this.zoomOption.y != 'undefined' - ? this.zoomOption.y : (this.zr.getHeight() - height - 2); + x = this.zoomOption.x != null ? this.zoomOption.x : grid.getX(); + y = this.zoomOption.y != null ? this.zoomOption.y : (this.zr.getHeight() - height - 2); } else { // 垂直布局 width = this.zoomOption.width || this._fillerSize; height = this.zoomOption.height || grid.getHeight(); - x = typeof this.zoomOption.x != 'undefined' - ? this.zoomOption.x : 2; - y = typeof this.zoomOption.y != 'undefined' - ? this.zoomOption.y : grid.getY(); + x = this.zoomOption.x != null ? this.zoomOption.x : 2; + y = this.zoomOption.y != null ? this.zoomOption.y : grid.getY(); } return { @@ -135,13 +163,11 @@ define(function (require) { var yAxisIndex; var zOptIdx = this.zoomOption.xAxisIndex; - if (xAxis && typeof zOptIdx == 'undefined') { + if (xAxis && zOptIdx == null) { xAxisIndex = []; for (var i = 0, l = xAxis.length; i < l; i++) { // 横纵默认为类目轴 - if (xAxis[i].type == 'category' - || typeof xAxis[i].type == 'undefined' - ) { + if (xAxis[i].type == 'category' || xAxis[i].type == null) { xAxisIndex.push(i); } } @@ -150,7 +176,7 @@ define(function (require) { if (zOptIdx instanceof Array) { xAxisIndex = zOptIdx; } - else if (typeof zOptIdx != 'undefined') { + else if (zOptIdx != null) { xAxisIndex = [zOptIdx]; } else { @@ -159,7 +185,7 @@ define(function (require) { } zOptIdx = this.zoomOption.yAxisIndex; - if (yAxis && typeof zOptIdx == 'undefined') { + if (yAxis && zOptIdx == null) { yAxisIndex = []; for (var i = 0, l = yAxis.length; i < l; i++) { if (yAxis[i].type == 'category') { @@ -171,7 +197,7 @@ define(function (require) { if (zOptIdx instanceof Array) { yAxisIndex = zOptIdx; } - else if (typeof zOptIdx != 'undefined') { + else if (zOptIdx != null) { yAxisIndex = [zOptIdx]; } else { @@ -180,51 +206,48 @@ define(function (require) { } // 找到缩放控制的所有series + var serie; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type != ecConfig.CHART_TYPE_LINE - && series[i].type != ecConfig.CHART_TYPE_BAR - && series[i].type != ecConfig.CHART_TYPE_SCATTER - && series[i].type != ecConfig.CHART_TYPE_K + serie = series[i]; + if (serie.type != ecConfig.CHART_TYPE_LINE + && serie.type != ecConfig.CHART_TYPE_BAR + && serie.type != ecConfig.CHART_TYPE_SCATTER + && serie.type != ecConfig.CHART_TYPE_K ) { continue; } for (var j = 0, k = xAxisIndex.length; j < k; j++) { - if (xAxisIndex[j] == (series[i].xAxisIndex || 0)) { + if (xAxisIndex[j] == (serie.xAxisIndex || 0)) { zoomSeriesIndex.push(i); break; } } for (var j = 0, k = yAxisIndex.length; j < k; j++) { - if (yAxisIndex[j] == (series[i].yAxisIndex || 0)) { + if (yAxisIndex[j] == (serie.yAxisIndex || 0)) { zoomSeriesIndex.push(i); break; } } - // 不指定接管坐标轴,则散点图被纳入接管范围 - if (series[i].type == ecConfig.CHART_TYPE_SCATTER - && typeof this.zoomOption.xAxisIndex == 'undefined' - && typeof this.zoomOption.yAxisIndex == 'undefined' + // 不指定接管坐标轴,则散点图、双数值轴折线图柱形图都被纳入接管范围 + if (this.zoomOption.xAxisIndex == null + && this.zoomOption.yAxisIndex == null + && serie.data + && this.getDataFromOption(serie.data[0]) instanceof Array + && (serie.type == ecConfig.CHART_TYPE_SCATTER + || serie.type == ecConfig.CHART_TYPE_LINE + || serie.type == ecConfig.CHART_TYPE_BAR) ) { zoomSeriesIndex.push(i); } } - var start = typeof this._zoom.start != 'undefined' + var start = this._zoom.start != null ? this._zoom.start - : (typeof this.zoomOption.start != 'undefined' ? this.zoomOption.start : 0); - var end = typeof this._zoom.end != 'undefined' + : (this.zoomOption.start != null ? this.zoomOption.start : 0); + var end = this._zoom.end != null ? this._zoom.end - : (typeof this.zoomOption.end != 'undefined' ? this.zoomOption.end : 100); - /* - var start = typeof this.zoomOption.start != 'undefined' - && this.zoomOption.start >= 0 - && this.zoomOption.start <= 100 - ? this.zoomOption.start : 0; - var end = typeof this.zoomOption.end != 'undefined' - && this.zoomOption.end >= 0 - && this.zoomOption.end <= 100 - ? this.zoomOption.end : 100; - */ + : (this.zoomOption.end != null ? this.zoomOption.end : 100); + if (start > end) { // 大小颠倒自动翻转 start = start + end; @@ -232,10 +255,12 @@ define(function (require) { start = start - end; } var size = Math.round( - (end - start) / 100 - * (this.zoomOption.orient == 'horizontal' - ? this._location.width : this._location.height) - ); + (end - start) / 100 + * ( + this.zoomOption.orient == 'horizontal' + ? this._location.width : this._location.height + ) + ); return { start : start, end : end, @@ -273,7 +298,13 @@ define(function (require) { for (var i = 0, l = seriesIndex.length; i < l; i++) { serie = series[seriesIndex[i]]; this._originalData.series[seriesIndex[i]] = serie.data; - if (serie.type == ecConfig.CHART_TYPE_SCATTER) { + if (serie.data + && this.getDataFromOption(serie.data[0]) instanceof Array + && (serie.type == ecConfig.CHART_TYPE_SCATTER + || serie.type == ecConfig.CHART_TYPE_LINE + || serie.type == ecConfig.CHART_TYPE_BAR) + ) { + this._backupScale(); this._calculScatterMap(seriesIndex[i]); } } @@ -286,15 +317,15 @@ define(function (require) { // x轴极值 var Axis = componentLibrary.get('axis'); var axisOption = zrUtil.clone(this.option.xAxis); - if (axisOption instanceof Array) { + if (axisOption[0].type == 'category') { axisOption[0].type = 'value'; - axisOption[0].boundary = [0, 0]; - axisOption[1] && (axisOption[1].type = 'value', axisOption[1].boundary = [0, 0]); } - else { - axisOption.type = 'value'; - axisOption.boundary = [0, 0]; + // axisOption[0].scale = true; + // axisOption[0].boundary = [0, 0]; + if (axisOption[1] && axisOption[1].type == 'category') { + axisOption[1].type = 'value'; } + var vAxis = new Axis( this.ecTheme, null, // messageCenter @@ -312,13 +343,13 @@ define(function (require) { // y轴极值 axisOption = zrUtil.clone(this.option.yAxis); - if (axisOption instanceof Array) { + if (axisOption[0].type == 'category') { axisOption[0].type = 'value'; - axisOption[1] && (axisOption[1].type = 'value', axisOption[1].boundary = [0, 0]); } - else { - axisOption.type = 'value'; - axisOption.boundary = [0, 0]; + // axisOption[0].scale = true; + // axisOption[1].boundary = [0, 0]; + if (axisOption[1] && axisOption[1].type == 'category') { + axisOption[1].type = 'value'; } vAxis = new Axis( this.ecTheme, @@ -343,7 +374,8 @@ define(function (require) { // 背景 this.shapeList.push(new RectangleShape({ - zlevel : this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), hoverable :false, style : { x : this._location.x, @@ -377,9 +409,7 @@ define(function (require) { var minValue = Number.MAX_VALUE; var value; for (var i = 0, l = data.length; i < l; i++) { - value = typeof data[i] != 'undefined' - ? (typeof data[i].value != 'undefined' ? data[i].value : data[i]) - : 0; + value = this.getDataFromOption(data[i], 0); if (this.option.series[seriesIndex].type == ecConfig.CHART_TYPE_K) { value = value[1]; // 收盘价 } @@ -403,10 +433,7 @@ define(function (require) { } for (var i = 0, l = maxLength; i < l; i += step) { - value = typeof data[i] != 'undefined' - ? (typeof data[i].value != 'undefined' - ? data[i].value : data[i]) - : 0; + value = this.getDataFromOption(data[i], 0); if (this.option.series[seriesIndex].type == ecConfig.CHART_TYPE_K) { value = value[1]; // 收盘价 } @@ -426,12 +453,12 @@ define(function (require) { this._location.x + 1 + Math.round( (value - minValue) / valueRange * (width - 10) ), - this._location.y + y * i + this._location.y + y * (l - i - 1) ]); } } if (this.zoomOption.orient == 'horizontal') { - pointList.push([ + pointList.push([ this._location.x + width, this._location.y + height ]); @@ -441,15 +468,16 @@ define(function (require) { } else { pointList.push([ - this._location.x, this._location.y + height + this._location.x, this._location.y ]); pointList.push([ - this._location.x, this._location.y + this._location.x, this._location.y + height ]); } this.shapeList.push(new PolygonShape({ - zlevel : this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), style : { pointList : pointList, color : this.zoomOption.dataBackgroundColor @@ -463,7 +491,8 @@ define(function (require) { */ _buildFiller : function () { this._fillerShae = { - zlevel : this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), draggable : true, ondrift : this._ondrift, ondragend : this._ondragend, @@ -520,24 +549,28 @@ define(function (require) { * 构建拖拽手柄 */ _buildHandle : function () { + var detail = this.zoomOption.showDetail ? this._getDetail() : {start: '',end: ''}; this._startShape = { - zlevel : this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), draggable : true, style : { iconType: 'rectangle', - x : this._location.x, - y : this._location.y, - width : this._handleSize, - height : this._handleSize, - color : this.zoomOption.handleColor, - text : '=', - textPosition : 'inside' + x: this._location.x, + y: this._location.y, + width: this._handleSize, + height: this._handleSize, + color: this.zoomOption.handleColor, + text: '=', + textPosition: 'inside' }, - highlightStyle : { - brushType: 'fill' + highlightStyle: { + text: detail.start, + brushType: 'fill', + textPosition: 'left' }, - ondrift : this._ondrift, - ondragend : this._ondragend + ondrift: this._ondrift, + ondragend: this._ondragend }; if (this.zoomOption.orient == 'horizontal') { @@ -545,16 +578,20 @@ define(function (require) { this._endShape = zrUtil.clone(this._startShape); this._startShape.style.x = this._fillerShae.style.x - this._handleSize, - this._endShape.style.x = this._fillerShae.style.x - + this._fillerShae.style.width; + this._endShape.style.x = this._fillerShae.style.x + this._fillerShae.style.width; + this._endShape.highlightStyle.text = detail.end; + this._endShape.highlightStyle.textPosition = 'right'; } else { this._startShape.style.width = this._location.width; this._endShape = zrUtil.clone(this._startShape); - this._startShape.style.y = this._fillerShae.style.y - this._handleSize; - this._endShape.style.y = this._fillerShae.style.y - + this._fillerShae.style.height; + this._startShape.style.y = this._fillerShae.style.y + this._fillerShae.style.height; + this._startShape.highlightStyle.textPosition = 'bottom'; + + this._endShape.style.y = this._fillerShae.style.y - this._handleSize; + this._endShape.highlightStyle.text = detail.end; + this._endShape.highlightStyle.textPosition = 'top'; } this._startShape = new IconShape(this._startShape); this._endShape = new IconShape(this._endShape); @@ -570,7 +607,8 @@ define(function (require) { var x = this.subPixelOptimize(this._location.x, 1); var y = this.subPixelOptimize(this._location.y, 1); this._startFrameShape = { - zlevel : this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), hoverable :false, style : { x : x, @@ -594,39 +632,35 @@ define(function (require) { _syncHandleShape : function () { if (this.zoomOption.orient == 'horizontal') { this._startShape.style.x = this._fillerShae.style.x - this._handleSize; - this._endShape.style.x = this._fillerShae.style.x - + this._fillerShae.style.width; + this._endShape.style.x = this._fillerShae.style.x + this._fillerShae.style.width; - this._zoom.start = Math.floor( - (this._startShape.style.x - this._location.x) - / this._location.width * 100 - ); - this._zoom.end = Math.ceil( - (this._endShape.style.x + this._handleSize - this._location.x) - / this._location.width * 100 - ); + this._zoom.start = ( + this._startShape.style.x - this._location.x + ) / this._location.width * 100; + this._zoom.end = ( + this._endShape.style.x + this._handleSize - this._location.x + ) / this._location.width * 100; } else { - this._startShape.style.y = this._fillerShae.style.y - this._handleSize; - this._endShape.style.y = this._fillerShae.style.y - + this._fillerShae.style.height; - this._zoom.start = Math.floor( - (this._startShape.style.y - this._location.y) - / this._location.height * 100 - ); - this._zoom.end = Math.ceil( - (this._endShape.style.y + this._handleSize - this._location.y) - / this._location.height * 100 - ); - } + this._startShape.style.y = this._fillerShae.style.y + this._fillerShae.style.height; + this._endShape.style.y = this._fillerShae.style.y - this._handleSize; + this._zoom.start = ( + this._location.y + this._location.height + - this._startShape.style.y + ) / this._location.height * 100; + this._zoom.end = ( + this._location.y + this._location.height + - this._endShape.style.y - this._handleSize + ) / this._location.height * 100; + } this.zr.modShape(this._startShape.id); this.zr.modShape(this._endShape.id); // 同步边框 this._syncFrameShape(); - this.zr.refresh(); + this.zr.refreshNextFrame(); }, _syncFillerShape : function () { @@ -637,28 +671,24 @@ define(function (require) { b = this._endShape.style.x; this._fillerShae.style.x = Math.min(a, b) + this._handleSize; this._fillerShae.style.width = Math.abs(a - b) - this._handleSize; - this._zoom.start = Math.floor( - (Math.min(a, b) - this._location.x) - / this._location.width * 100 - ); - this._zoom.end = Math.ceil( - (Math.max(a, b) + this._handleSize - this._location.x) - / this._location.width * 100 - ); + this._zoom.start = ( + Math.min(a, b) - this._location.x + ) / this._location.width * 100; + this._zoom.end = ( + Math.max(a, b) + this._handleSize - this._location.x + ) / this._location.width * 100; } else { a = this._startShape.style.y; b = this._endShape.style.y; this._fillerShae.style.y = Math.min(a, b) + this._handleSize; this._fillerShae.style.height = Math.abs(a - b) - this._handleSize; - this._zoom.start = Math.floor( - (Math.min(a, b) - this._location.y) - / this._location.height * 100 - ); - this._zoom.end = Math.ceil( - (Math.max(a, b) + this._handleSize - this._location.y) - / this._location.height * 100 - ); + this._zoom.start = ( + this._location.y + this._location.height - Math.max(a, b) + ) / this._location.height * 100; + this._zoom.end = ( + this._location.y + this._location.height - Math.min(a, b) - this._handleSize + ) / this._location.height * 100; } this.zr.modShape(this._fillerShae.id); @@ -666,7 +696,7 @@ define(function (require) { // 同步边框 this._syncFrameShape(); - this.zr.refresh(); + this.zr.refreshNextFrame(); }, _syncFrameShape : function () { @@ -679,12 +709,12 @@ define(function (require) { this._location.x + this._location.width - this._endFrameShape.style.x; } else { - this._startFrameShape.style.height = - this._fillerShae.style.y - this._location.y; - this._endFrameShape.style.y = + this._startFrameShape.style.y = this._fillerShae.style.y + this._fillerShae.style.height; + this._startFrameShape.style.height = + this._location.y + this._location.height - this._startFrameShape.style.y; this._endFrameShape.style.height = - this._location.y + this._location.height - this._endFrameShape.style.y; + this._fillerShae.style.y - this._location.y; } this.zr.modShape(this._startFrameShape.id); @@ -698,27 +728,27 @@ define(function (require) { } if (this.zoomOption.orient == 'horizontal') { this._startShape.style.x = this._location.x - + this._zoom.start / 100 * this._location.width; - this._endShape.style.x = this._location.x - + this._zoom.end / 100 * this._location.width - - this._handleSize; + + this._zoom.start / 100 * this._location.width; + this._endShape.style.x = this._location.x + + this._zoom.end / 100 * this._location.width + - this._handleSize; - this._fillerShae.style.x = this._startShape.style.x + this._handleSize; - this._fillerShae.style.width = this._endShape.style.x - - this._startShape.style.x - - this._handleSize; + this._fillerShae.style.x = this._startShape.style.x + this._handleSize; + this._fillerShae.style.width = this._endShape.style.x + - this._startShape.style.x + - this._handleSize; } else { - this._startShape.style.y = this._location.y - + this._zoom.start / 100 * this._location.height; - this._endShape.style.y = this._location.y - + this._zoom.end / 100 * this._location.height - - this._handleSize; + this._startShape.style.y = this._location.y + this._location.height + - this._zoom.start / 100 * this._location.height; + this._endShape.style.y = this._location.y + this._location.height + - this._zoom.end / 100 * this._location.height + - this._handleSize; - this._fillerShae.style.y = this._startShape.style.y + this._handleSize; - this._fillerShae.style.height = this._endShape.style.y - - this._startShape.style.y - - this._handleSize; + this._fillerShae.style.y = this._endShape.style.y + this._handleSize; + this._fillerShae.style.height = this._startShape.style.y + - this._endShape.style.y + - this._handleSize; } this.zr.modShape(this._startShape.id); @@ -740,17 +770,20 @@ define(function (require) { target = this._originalData[key]; for (var idx in target) { data = target[idx]; - if (typeof data == 'undefined') { + if (data == null) { continue; } length = data.length; start = Math.floor(this._zoom.start / 100 * length); end = Math.ceil(this._zoom.end / 100 * length); - if (this.option[key][idx].type != ecConfig.CHART_TYPE_SCATTER) { + if (!(this.getDataFromOption(data[0]) instanceof Array) + || this.option[key][idx].type == ecConfig.CHART_TYPE_K + ) { this.option[key][idx].data = data.slice(start, end); } else { - // 散点图特殊处理 + // 散点图,双数值轴折线图柱形图特殊处理 + this._setScale(); this.option[key][idx].data = this._synScatterData(idx, data); } } @@ -784,7 +817,7 @@ define(function (require) { var xEnd; var yStart; var yEnd; - + if (this.zoomOption.orient == 'horizontal') { total = scale.x.max - scale.x.min; xStart = this._zoom.start / 100 * total + scale.x.min; @@ -816,9 +849,94 @@ define(function (require) { newData.push(data[i]); } } - return newData; }, + + /** + * 发生缩放后修改axis的scale + */ + _setScale: function() { + var needScale = this._zoom.start !== 0 + || this._zoom.end !== 100 + || this._zoom.start2 !== 0 + || this._zoom.end2 !== 100; + var axis = { + xAxis : this.option.xAxis, + yAxis : this.option.yAxis + }; + for (var key in axis) { + for (var i = 0, l = axis[key].length; i < l; i++) { + axis[key][i].scale = needScale || axis[key][i]._scale; + } + } + }, + + /** + * 备份可能存在的scale设置 + */ + _backupScale: function() { + var axis = { + xAxis : this.option.xAxis, + yAxis : this.option.yAxis + }; + for (var key in axis) { + for (var i = 0, l = axis[key].length; i < l; i++) { + axis[key][i]._scale = axis[key][i].scale; + } + } + }, + + /** + * 获取当前定位 + */ + _getDetail : function () { + var key = this.zoomOption.orient == 'horizontal' ? 'xAxis' : 'yAxis'; + var target = this._originalData[key]; + for (var idx in target) { + var data = target[idx]; + if (data == null) { + continue; + } + var length = data.length; + var start = Math.floor(this._zoom.start / 100 * length); + var end = Math.ceil(this._zoom.end / 100 * length); + end -= end > 0 ? 1 : 0; + return { + start : this.getDataFromOption(data[start]), + end : this.getDataFromOption(data[end]) + }; + } + + var seriesIndex = this._zoom.seriesIndex[0]; + var axisIndex = this.option.series[seriesIndex][key + 'Index'] || 0; + var axisType = this.option[key][axisIndex].type; + var min = this._zoom.scatterMap[seriesIndex][key.charAt(0)].min; + var max = this._zoom.scatterMap[seriesIndex][key.charAt(0)].max; + var gap = max - min; + + if (axisType == 'value') { + return { + start : min + gap * this._zoom.start / 100, + end : min + gap * this._zoom.end / 100 + }; + } + else if (axisType == 'time') { + // 最优解 + max = min + gap * this._zoom.end / 100; + min = min + gap * this._zoom.start / 100; + var formatter = ecDate.getAutoFormatter(min, max).formatter; + return { + start : ecDate.format(formatter, min), + end : ecDate.format(formatter, max) + }; + } + + return { + start : '', + end : '' + }; + }, + /** * 拖拽范围控制 */ @@ -857,7 +975,7 @@ define(function (require) { shape.style.y += dy; } } - + if (shape._type == 'filler') { this._syncHandleShape(); } @@ -869,10 +987,24 @@ define(function (require) { this._syncData(); } + if (this.zoomOption.showDetail) { + var detail = this._getDetail(); + this._startShape.style.text = this._startShape.highlightStyle.text = detail.start; + this._endShape.style.text = this._endShape.highlightStyle.text = detail.end; + this._startShape.style.textPosition = this._startShape.highlightStyle.textPosition; + this._endShape.style.textPosition = this._endShape.highlightStyle.textPosition; + } return true; }, __ondragend : function () { + if (this.zoomOption.showDetail) { + this._startShape.style.text = this._endShape.style.text = '='; + this._startShape.style.textPosition = this._endShape.style.textPosition = 'inside'; + this.zr.modShape(this._startShape.id); + this.zr.modShape(this._endShape.id); + this.zr.refreshNextFrame(); + } this.isDragend = true; }, @@ -911,13 +1043,9 @@ define(function (require) { }, absoluteZoom : function (param) { - //this.zoomOption.start = this._zoom.start = param.start; - //this.zoomOption.end = this._zoom.end = param.end; - //this.zoomOption.start2 = this._zoom.start2 = param.start2; - //this.zoomOption.end2 = this._zoom.end2 = param.end2; this._syncShape(); this._syncData(true); @@ -929,13 +1057,11 @@ define(function (require) { // 重置拖拽 //this.zoomOption.start = //this.zoomOption.start2 = - this._zoom.start = - this._zoom.start2 = 0; + this._zoom.start = this._zoom.start2 = 0; //this.zoomOption.end = //this.zoomOption.end2 = - this._zoom.end = - this._zoom.end2 = 100; + this._zoom.end = this._zoom.end2 = 100; this._syncShape(); this._syncData(true); @@ -960,9 +1086,7 @@ define(function (require) { // console.log(rect,this._zoom); // 剔除无效缩放 - if (rect.x > gridArea.x + gridArea.width - || rect.y > gridArea.y + gridArea.height - ) { + if (rect.x > gridArea.x + gridArea.width || rect.y > gridArea.y + gridArea.height) { return false; // 无效缩放 } @@ -982,7 +1106,7 @@ define(function (require) { var edx = 1 - (rect.x + rect.width - gridArea.x) / gridArea.width; var sdy = 1 - (rect.y + rect.height - gridArea.y) / gridArea.height; var edy = (rect.y - gridArea.y) / gridArea.height; - //console.log('this',sdy,edy,this._zoom.start,this._zoom.end) + // console.log('this',sdy,edy,this._zoom.start,this._zoom.end) if (this.zoomOption.orient == 'horizontal') { total = this._zoom.end - this._zoom.start; this._zoom.start += total * sdx; @@ -1018,7 +1142,7 @@ define(function (require) { var curSeries = curOption.series; var curData; for (var i = 0, l = curSeries.length; i < l; i++) { - curData = curSeries[i].data; + curData = curSeries[i].data || curSeries[i].eventList; if (target[i]) { // dataZoom接管的 start = Math.floor(this._zoom.start / 100 * target[i].length); @@ -1040,6 +1164,12 @@ define(function (require) { syncOption : function(magicOption) { this.silence(true); this.option = magicOption; + this.option.dataZoom = this.reformOption(this.option.dataZoom); + this.zoomOption = this.option.dataZoom; + if (!this.myChart.canvasSupported) { + // 不支持Canvas的强制关闭实时动画 + this.zoomOption.realtime = false; + } this.clear(); // 位置参数,通过计算所得x, y, width, height diff --git a/amd/component/grid.js b/amd/component/grid.js index f5588d5..5ca3709 100644 --- a/amd/component/grid.js +++ b/amd/component/grid.js @@ -2,7 +2,7 @@ * echarts组件: 网格 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ define(function (require) { @@ -12,6 +12,21 @@ define(function (require) { var RectangleShape = require('../zrender/shape/Rectangle'); var ecConfig = require('../config'); + // 网格 + ecConfig.grid = { + zlevel: 0, // 一级层叠 + z: 0, // 二级层叠 + x: 80, + y: 60, + x2: 80, + y2: 60, + // width: {totalWidth} - x - x2, + // height: {totalHeight} - y - y2, + backgroundColor: 'rgba(0,0,0,0)', + borderWidth: 1, + borderColor: '#ccc' + }; + var zrUtil = require('../zrender/tool/util'); /** @@ -31,48 +46,57 @@ define(function (require) { } Grid.prototype = { - type : ecConfig.COMPONENT_TYPE_GRID, + type: ecConfig.COMPONENT_TYPE_GRID, - getX : function () { + getX: function () { return this._x; }, - getY : function () { + getY: function () { return this._y; }, - getWidth : function () { + getWidth: function () { return this._width; }, - getHeight : function () { + getHeight: function () { return this._height; }, - getXend : function () { + getXend: function () { return this._x + this._width; }, - getYend : function () { + getYend: function () { return this._y + this._height; }, - getArea : function () { + getArea: function () { return { - x : this._x, - y : this._y, - width : this._width, - height : this._height + x: this._x, + y: this._y, + width: this._width, + height: this._height }; }, + getBbox: function() { + return [ + [ this._x, this._y ], + [ this.getXend(), this.getYend() ] + ]; + }, + /** * 实在找不到合适的地方做了,各种粗暴的写法~ -_- */ - refixAxisShape : function(component) { + refixAxisShape: function(component) { var zeroX; var zeroY; - var axisList = component.xAxis._axisList.concat(component.yAxis._axisList); + var axisList = component.xAxis._axisList.concat( + component.yAxis ? component.yAxis._axisList : [] + ); var len = axisList.length; var axis; while (len--) { @@ -94,7 +118,7 @@ define(function (require) { } }, - refresh : function (newOption) { + refresh: function (newOption) { if (newOption || this._zrWidth != this.zr.getWidth() || this._zrHeight != this.zr.getHeight() @@ -118,6 +142,7 @@ define(function (require) { else { this._width = this.parsePercent(gridOption.width, this._zrWidth); } + this._width = this._width <= 0 ? 10 : this._width; if (typeof gridOption.height == 'undefined') { this._height = this._zrHeight - this._y - y2; @@ -125,23 +150,25 @@ define(function (require) { else { this._height = this.parsePercent(gridOption.height, this._zrHeight); } + this._height = this._height <= 0 ? 10 : this._height; this._x = this.subPixelOptimize(this._x, gridOption.borderWidth); this._y = this.subPixelOptimize(this._y, gridOption.borderWidth); this.shapeList.push(new RectangleShape({ - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : this._x, - y : this._y, - width : this._width, - height : this._height, - brushType : gridOption.borderWidth > 0 ? 'both' : 'fill', - color : gridOption.backgroundColor, + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: this._x, + y: this._y, + width: this._width, + height: this._height, + brushType: gridOption.borderWidth > 0 ? 'both' : 'fill', + color: gridOption.backgroundColor, strokeColor: gridOption.borderColor, - lineWidth : gridOption.borderWidth - // type : this.option.splitArea.areaStyle.type, + lineWidth: gridOption.borderWidth + // type: this.option.splitArea.areaStyle.type, } })); this.zr.addShape(this.shapeList[0]); diff --git a/amd/component/legend.js b/amd/component/legend.js index dc53d97..24095fb 100644 --- a/amd/component/legend.js +++ b/amd/component/legend.js @@ -2,7 +2,7 @@ * echarts组件:图例 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ define(function (require) { @@ -17,6 +17,36 @@ define(function (require) { var CandleShape = require('../util/shape/Candle'); var ecConfig = require('../config'); + // 图例 + ecConfig.legend = { + zlevel: 0, // 一级层叠 + z: 4, // 二级层叠 + show: true, + orient: 'horizontal', // 布局方式,默认为水平布局,可选为: + // 'horizontal' ¦ 'vertical' + x: 'center', // 水平安放位置,默认为全图居中,可选为: + // 'center' ¦ 'left' ¦ 'right' + // ¦ {number}(x坐标,单位px) + y: 'top', // 垂直安放位置,默认为全图顶端,可选为: + // 'top' ¦ 'bottom' ¦ 'center' + // ¦ {number}(y坐标,单位px) + backgroundColor: 'rgba(0,0,0,0)', + borderColor: '#ccc', // 图例边框颜色 + borderWidth: 0, // 图例边框线宽,单位px,默认为0(无边框) + padding: 5, // 图例内边距,单位px,默认各方向内边距为5, + // 接受数组分别设定上右下左边距,同css + itemGap: 10, // 各个item之间的间隔,单位px,默认为10, + // 横向布局时为水平间隔,纵向布局时为纵向间隔 + itemWidth: 20, // 图例图形宽度 + itemHeight: 14, // 图例图形高度 + textStyle: { + color: '#333' // 图例文字颜色 + }, + selectedMode: true // 选择模式,默认开启图例开关 + // selected: null, // 配置默认选中状态,可配合LEGEND.SELECTED事件做动态数据载入 + // data: [], // 图例内容(详见legend.data,数组中每一项代表一个item + }; + var zrUtil = require('../zrender/tool/util'); var zrArea = require('../zrender/tool/area'); @@ -38,17 +68,24 @@ define(function (require) { self._legendSelected = function (param) { self.__legendSelected(param); }; + self._dispatchHoverLink = function(param) { + return self.__dispatchHoverLink(param); + }; this._colorIndex = 0; this._colorMap = {}; this._selectedMap = {}; + this._hasDataMap = {}; this.refresh(option); } Legend.prototype = { - type : ecConfig.COMPONENT_TYPE_LEGEND, - _buildShape : function () { + type: ecConfig.COMPONENT_TYPE_LEGEND, + _buildShape: function () { + if (!this.legendOption.show) { + return; + } // 图例元素组的位置参数,通过计算所得x, y, width, height this._itemGroupLocation = this._getItemGroupLocation(); @@ -63,7 +100,7 @@ define(function (require) { /** * 构建所有图例元素 */ - _buildItem : function () { + _buildItem: function () { var data = this.legendOption.data; var dataLength = data.length; var itemName; @@ -84,7 +121,7 @@ define(function (require) { var itemGap = this.legendOption.itemGap; var color; - if (this.legendOption.orient == 'vertical' && this.legendOption.x == 'right') { + if (this.legendOption.orient === 'vertical' && this.legendOption.x === 'right') { lastX = this._itemGroupLocation.x + this._itemGroupLocation.width - itemWidth; @@ -99,13 +136,13 @@ define(function (require) { itemName = this._getName(data[i]); formattedName = this._getFormatterName(itemName); - if (itemName === '') { - if (this.legendOption.orient == 'horizontal') { + if (itemName === '') { // 别帮我代码优化 + if (this.legendOption.orient === 'horizontal') { lastX = this._itemGroupLocation.x; lastY += itemHeight + itemGap; } else { - this.legendOption.x == 'right' + this.legendOption.x === 'right' ? lastX -= this._itemGroupLocation.maxWidth + itemGap : lastX += this._itemGroupLocation.maxWidth + itemGap; lastY = this._itemGroupLocation.y; @@ -116,11 +153,11 @@ define(function (require) { color = this.getColor(itemName); - if (this.legendOption.orient == 'horizontal') { + if (this.legendOption.orient === 'horizontal') { if (zrWidth - lastX < 200 // 最后200px做分行预判 && (itemWidth + 5 + zrArea.getTextWidth(formattedName, dataFont) // 分行的最后一个不用算itemGap - + (i == dataLength - 1 || data[i+1] === '' ? 0 : itemGap) + + (i === dataLength - 1 || data[i + 1] === '' ? 0 : itemGap) ) >= zrWidth - lastX ) { lastX = this._itemGroupLocation.x; @@ -131,10 +168,11 @@ define(function (require) { if (zrHeight - lastY < 200 // 最后200px做分行预判 && (itemHeight // 分行的最后一个不用算itemGap - + (i == dataLength - 1 || data[i+1] === '' ? 0 : itemGap) - ) >= zrHeight - lastY + + (i === dataLength - 1 || data[i + 1] === '' ? 0 : itemGap) + ) + >= zrHeight - lastY ) { - this.legendOption.x == 'right' + this.legendOption.x === 'right' ? lastX -= this._itemGroupLocation.maxWidth + itemGap : lastX += this._itemGroupLocation.maxWidth + itemGap; lastY = this._itemGroupLocation.y; @@ -145,7 +183,7 @@ define(function (require) { itemShape = this._getItemShapeByType( lastX, lastY, itemWidth, itemHeight, - (this._selectedMap[itemName] ? color : '#ccc'), + (this._selectedMap[itemName] && this._hasDataMap[itemName] ? color : '#ccc'), itemType, color ); @@ -154,28 +192,29 @@ define(function (require) { // 文字 textShape = { - // shape : 'text', - zlevel : this._zlevelBase, - style : { - x : lastX + itemWidth + 5, - y : lastY + itemHeight / 2, - color : this._selectedMap[itemName] + // shape: 'text', + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: lastX + itemWidth + 5, + y: lastY + itemHeight / 2, + color: this._selectedMap[itemName] ? (dataTextStyle.color === 'auto' ? color : dataTextStyle.color) : '#ccc', text: formattedName, textFont: dataFont, textBaseline: 'middle' }, - highlightStyle : { - color : color, + highlightStyle: { + color: color, brushType: 'fill' }, - hoverable : !!this.legendOption.selectedMode, - clickable : !!this.legendOption.selectedMode + hoverable: !!this.legendOption.selectedMode, + clickable: !!this.legendOption.selectedMode }; - if (this.legendOption.orient == 'vertical' - && this.legendOption.x == 'right' + if (this.legendOption.orient === 'vertical' + && this.legendOption.x === 'right' ) { textShape.style.x -= (itemWidth + 10); textShape.style.textAlign = 'right'; @@ -186,14 +225,14 @@ define(function (require) { if (this.legendOption.selectedMode) { itemShape.onclick = textShape.onclick = this._legendSelected; - itemShape.onmouseover = textShape.onmouseover = this.hoverConnect; + itemShape.onmouseover = textShape.onmouseover = this._dispatchHoverLink; itemShape.hoverConnect = textShape.id; textShape.hoverConnect = itemShape.id; } this.shapeList.push(itemShape); this.shapeList.push(textShape); - if (this.legendOption.orient == 'horizontal') { + if (this.legendOption.orient === 'horizontal') { lastX += itemWidth + 5 + zrArea.getTextWidth(formattedName, dataFont) + itemGap; @@ -203,8 +242,8 @@ define(function (require) { } } - if (this.legendOption.orient == 'horizontal' - && this.legendOption.x == 'center' + if (this.legendOption.orient === 'horizontal' + && this.legendOption.x === 'center' && lastY != this._itemGroupLocation.y ) { // 多行橫排居中优化 @@ -212,17 +251,17 @@ define(function (require) { } }, - _getName : function(data) { + _getName: function(data) { return typeof data.name != 'undefined' ? data.name : data; }, _getFormatterName: function(itemName) { var formatter = this.legendOption.formatter; var formattedName; - if (typeof formatter == 'function') { + if (typeof formatter === 'function') { formattedName = formatter.call(this.myChart, itemName); } - else if (typeof formatter == 'string') { + else if (typeof formatter === 'string') { formattedName = formatter.replace('{name}', itemName); } else { @@ -237,11 +276,11 @@ define(function (require) { }, // 多行橫排居中优化 - _mLineOptimize : function () { + _mLineOptimize: function () { var lineOffsetArray = []; // 每行宽度 var lastX = this._itemGroupLocation.x; for (var i = 2, l = this.shapeList.length; i < l; i++) { - if (this.shapeList[i].style.x == lastX) { + if (this.shapeList[i].style.x === lastX) { lineOffsetArray.push( ( this._itemGroupLocation.width @@ -256,7 +295,7 @@ define(function (require) { ) / 2 ); } - else if (i == l - 1) { + else if (i === l - 1) { lineOffsetArray.push( ( this._itemGroupLocation.width @@ -274,7 +313,7 @@ define(function (require) { } var curLineIndex = -1; for (var i = 1, l = this.shapeList.length; i < l; i++) { - if (this.shapeList[i].style.x == lastX) { + if (this.shapeList[i].style.x === lastX) { curLineIndex++; } if (lineOffsetArray[curLineIndex] === 0) { @@ -286,24 +325,22 @@ define(function (require) { } }, - _buildBackground : function () { - var pTop = this.legendOption.padding[0]; - var pRight = this.legendOption.padding[1]; - var pBottom = this.legendOption.padding[2]; - var pLeft = this.legendOption.padding[3]; + _buildBackground: function () { + var padding = this.reformCssArray(this.legendOption.padding); this.shapeList.push(new RectangleShape({ - zlevel : this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), hoverable :false, - style : { - x : this._itemGroupLocation.x - pLeft, - y : this._itemGroupLocation.y - pTop, - width : this._itemGroupLocation.width + pLeft + pRight, - height : this._itemGroupLocation.height + pTop + pBottom, - brushType : this.legendOption.borderWidth === 0 ? 'fill' : 'both', - color : this.legendOption.backgroundColor, - strokeColor : this.legendOption.borderColor, - lineWidth : this.legendOption.borderWidth + style: { + x: this._itemGroupLocation.x - padding[3], + y: this._itemGroupLocation.y - padding[0], + width: this._itemGroupLocation.width + padding[3] + padding[1], + height: this._itemGroupLocation.height + padding[0] + padding[2], + brushType: this.legendOption.borderWidth === 0 ? 'fill' : 'both', + color: this.legendOption.backgroundColor, + strokeColor: this.legendOption.borderColor, + lineWidth: this.legendOption.borderWidth } })); }, @@ -311,7 +348,7 @@ define(function (require) { /** * 根据选项计算图例实体的位置坐标 */ - _getItemGroupLocation : function () { + _getItemGroupLocation: function () { var data = this.legendOption.data; var dataLength = data.length; var itemGap = this.legendOption.itemGap; @@ -321,48 +358,43 @@ define(function (require) { var font = this.getFont(textStyle); var totalWidth = 0; var totalHeight = 0; - var padding = this.legendOption.padding; + var padding = this.reformCssArray(this.legendOption.padding); var zrWidth = this.zr.getWidth() - padding[1] - padding[3]; var zrHeight = this.zr.getHeight() - padding[0] - padding[2]; var temp = 0; // 宽高计算,用于多行判断 var maxWidth = 0; // 垂直布局有用 - if (this.legendOption.orient == 'horizontal') { + if (this.legendOption.orient === 'horizontal') { // 水平布局,计算总宽度 totalHeight = itemHeight; for (var i = 0; i < dataLength; i++) { if (this._getName(data[i]) === '') { temp -= itemGap; - if (temp > zrWidth) { - totalWidth = zrWidth; - totalHeight += itemHeight + itemGap; - } - else { - totalWidth = Math.max(totalWidth, temp); - } + totalWidth = Math.max(totalWidth, temp); totalHeight += itemHeight + itemGap; temp = 0; continue; } - temp += itemWidth - + zrArea.getTextWidth( - this._getFormatterNameFromData(data[i]), - data[i].textStyle - ? this.getFont(zrUtil.merge( - data[i].textStyle || {}, - textStyle - )) - : font - ) - + itemGap; - } - totalHeight = Math.max(totalHeight, itemHeight); - temp -= itemGap; // 减去最后一个的itemGap - if (temp > zrWidth) { - totalWidth = zrWidth; - totalHeight += itemHeight + itemGap; - } else { - totalWidth = Math.max(totalWidth, temp); + var tempTextWidth = zrArea.getTextWidth( + this._getFormatterNameFromData(data[i]), + data[i].textStyle + ? this.getFont(zrUtil.merge( + data[i].textStyle || {}, + textStyle + )) + : font + ); + if (temp + itemWidth + tempTextWidth + itemGap > zrWidth) { + // new line + temp -= itemGap; // 减去最后一个的itemGap + totalWidth = Math.max(totalWidth, temp); + totalHeight += itemHeight + itemGap; + temp = 0; + } + else { + temp += itemWidth + tempTextWidth + itemGap; + totalWidth = Math.max(totalWidth, temp - itemGap); + } } } else { @@ -385,27 +417,23 @@ define(function (require) { totalWidth = maxWidth; for (var i = 0; i < dataLength; i++) { if (this._getName(data[i]) === '') { - temp -= itemGap; - if (temp > zrHeight) { - totalHeight = zrHeight; - totalWidth += maxWidth + itemGap; - } - else { - totalHeight = Math.max(totalHeight, temp); - } totalWidth += maxWidth + itemGap; + temp -= itemGap; // 减去最后一个的itemGap + totalHeight = Math.max(totalHeight, temp); temp = 0; continue; } - temp += itemHeight + itemGap; - } - totalWidth = Math.max(totalWidth, maxWidth); - temp -= itemGap; // 减去最后一个的itemGap - if (temp > zrHeight) { - totalHeight = zrHeight; - totalWidth += maxWidth + itemGap; - } else { - totalHeight = Math.max(totalHeight, temp); + if (temp + itemHeight + itemGap > zrHeight) { + // new line + totalWidth += maxWidth + itemGap; + temp -= itemGap; // 减去最后一个的itemGap + totalHeight = Math.max(totalHeight, temp); + temp = 0; + } + else { + temp += itemHeight + itemGap; + totalHeight = Math.max(totalHeight, temp - itemGap); + } } } @@ -417,13 +445,13 @@ define(function (require) { x = Math.floor((zrWidth - totalWidth) / 2); break; case 'left' : - x = this.legendOption.padding[3] + this.legendOption.borderWidth; + x = padding[3] + this.legendOption.borderWidth; break; case 'right' : x = zrWidth - totalWidth - - this.legendOption.padding[1] - - this.legendOption.padding[3] + - padding[1] + - padding[3] - this.legendOption.borderWidth * 2; break; default : @@ -434,13 +462,13 @@ define(function (require) { var y; switch (this.legendOption.y) { case 'top' : - y = this.legendOption.padding[0] + this.legendOption.borderWidth; + y = padding[0] + this.legendOption.borderWidth; break; case 'bottom' : y = zrHeight - totalHeight - - this.legendOption.padding[0] - - this.legendOption.padding[2] + - padding[0] + - padding[2] - this.legendOption.borderWidth * 2; break; case 'center' : @@ -452,85 +480,85 @@ define(function (require) { } return { - x : x, - y : y, - width : totalWidth, - height : totalHeight, - maxWidth : maxWidth + x: x, + y: y, + width: totalWidth, + height: totalHeight, + maxWidth: maxWidth }; }, /** * 根据名称返回series数据或data */ - _getSomethingByName : function (name) { + _getSomethingByName: function (name) { var series = this.option.series; var data; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].name == name) { + if (series[i].name === name) { // 系列名称优先 return { - type : series[i].type, - series : series[i], - seriesIndex : i, - data : null, - dataIndex : -1 + type: series[i].type, + series: series[i], + seriesIndex: i, + data: null, + dataIndex: -1 }; } if ( - series[i].type == ecConfig.CHART_TYPE_PIE - || series[i].type == ecConfig.CHART_TYPE_RADAR - || series[i].type == ecConfig.CHART_TYPE_CHORD - || series[i].type == ecConfig.CHART_TYPE_FORCE - || series[i].type == ecConfig.CHART_TYPE_FUNNEL + series[i].type === ecConfig.CHART_TYPE_PIE + || series[i].type === ecConfig.CHART_TYPE_RADAR + || series[i].type === ecConfig.CHART_TYPE_CHORD + || series[i].type === ecConfig.CHART_TYPE_FORCE + || series[i].type === ecConfig.CHART_TYPE_FUNNEL ) { - data = series[i].type != ecConfig.CHART_TYPE_FORCE - ? series[i].data // 饼图、雷达图、和弦图得查找里面的数据名字 - : series[i].categories; // 力导布局查找categories配置 + data = series[i].categories || series[i].data || series[i].nodes; + for (var j = 0, k = data.length; j < k; j++) { - if (data[j].name == name) { + if (data[j].name === name) { return { - type : series[i].type, - series : series[i], - seriesIndex : i, - data : data[j], - dataIndex : j + type: series[i].type, + series: series[i], + seriesIndex: i, + data: data[j], + dataIndex: j }; } } } } return { - type : 'bar', - series : null, - seriesIndex : -1, - data : null, - dataIndex : -1 + type: 'bar', + series: null, + seriesIndex: -1, + data: null, + dataIndex: -1 }; }, - _getItemShapeByType : function (x, y, width, height, color, itemType, defaultColor) { + _getItemShapeByType: function (x, y, width, height, color, itemType, defaultColor) { var highlightColor = color === '#ccc' ? defaultColor : color; var itemShape = { - zlevel : this._zlevelBase, - style : { - iconType : 'legendicon' + itemType, - x : x, - y : y, - width : width, - height : height, - color : color, - strokeColor : color, - lineWidth : 2 + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + iconType: 'legendicon' + itemType, + x: x, + y: y, + width: width, + height: height, + color: color, + strokeColor: color, + lineWidth: 2 }, highlightStyle: { - color : highlightColor, - strokeColor : highlightColor, - lineWidth : 1 + color: highlightColor, + strokeColor: highlightColor, + lineWidth: 1 }, - hoverable : this.legendOption.selectedMode, - clickable : this.legendOption.selectedMode + hoverable: this.legendOption.selectedMode, + clickable: this.legendOption.selectedMode }; var imageLocation; @@ -542,26 +570,30 @@ define(function (require) { } // 特殊设置 switch (itemType) { - case 'line' : + case 'line': itemShape.style.brushType = 'stroke'; itemShape.highlightStyle.lineWidth = 3; break; - case 'radar' : - case 'scatter' : + case 'radar': + case 'scatter': itemShape.highlightStyle.lineWidth = 3; break; - case 'k' : + case 'k': itemShape.style.brushType = 'both'; itemShape.highlightStyle.lineWidth = 3; itemShape.highlightStyle.color = - itemShape.style.color = this.query(this.ecTheme, 'k.itemStyle.normal.color') - || '#fff'; + itemShape.style.color = this.deepQuery( + [this.ecTheme, ecConfig], 'k.itemStyle.normal.color' + ) || '#fff'; itemShape.style.strokeColor = color != '#ccc' - ? (this.query(this.ecTheme, 'k.itemStyle.normal.lineStyle.color') - || '#ff3200') + ? ( + this.deepQuery( + [this.ecTheme, ecConfig], 'k.itemStyle.normal.lineStyle.color' + ) || '#ff3200' + ) : color; break; - case 'image' : + case 'image': itemShape.style.iconType = 'image'; itemShape.style.image = imageLocation; if (color === '#ccc') { @@ -572,7 +604,7 @@ define(function (require) { return itemShape; }, - __legendSelected : function (param) { + __legendSelected: function (param) { var itemName = param.target._name; if (this.legendOption.selectedMode === 'single') { for (var k in this._selectedMap) { @@ -584,24 +616,35 @@ define(function (require) { ecConfig.EVENT.LEGEND_SELECTED, param.event, { - selected : this._selectedMap, - target : itemName + selected: this._selectedMap, + target: itemName }, this.myChart ); }, - + + /** + * 产生hover link事件 + */ + __dispatchHoverLink : function(param) { + this.messageCenter.dispatch( + ecConfig.EVENT.LEGEND_HOVERLINK, + param.event, + { + target: param.target._name + }, + this.myChart + ); + return; + }, + /** * 刷新 */ - refresh : function (newOption) { + refresh: function (newOption) { if (newOption) { this.option = newOption || this.option; this.option.legend = this.reformOption(this.option.legend); - // 补全padding属性 - this.option.legend.padding = this.reformCssArray( - this.option.legend.padding - ); this.legendOption = this.option.legend; var data = this.legendOption.data || []; @@ -623,13 +666,14 @@ define(function (require) { } something = this._getSomethingByName(itemName); if (!something.series) { - this._selectedMap[itemName] = false; + this._hasDataMap[itemName] = false; } else { + this._hasDataMap[itemName] = true; if (something.data - && (something.type == ecConfig.CHART_TYPE_PIE - || something.type == ecConfig.CHART_TYPE_FORCE - || something.type == ecConfig.CHART_TYPE_FUNNEL) + && (something.type === ecConfig.CHART_TYPE_PIE + || something.type === ecConfig.CHART_TYPE_FORCE + || something.type === ecConfig.CHART_TYPE_FUNNEL) ) { queryTarget = [something.data, something.series]; } @@ -647,7 +691,7 @@ define(function (require) { this.setColor(itemName, color); } this._selectedMap[itemName] = - typeof this._selectedMap[itemName] != 'undefined' + this._selectedMap[itemName] != null ? this._selectedMap[itemName] : true; } } @@ -656,28 +700,28 @@ define(function (require) { this._buildShape(); }, - getRelatedAmount : function(name) { + getRelatedAmount: function(name) { var amount = 0; var series = this.option.series; var data; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].name == name) { + if (series[i].name === name) { // 系列名称优先 amount++; } if ( - series[i].type == ecConfig.CHART_TYPE_PIE - || series[i].type == ecConfig.CHART_TYPE_RADAR - || series[i].type == ecConfig.CHART_TYPE_CHORD - || series[i].type == ecConfig.CHART_TYPE_FORCE - || series[i].type == ecConfig.CHART_TYPE_FUNNEL + series[i].type === ecConfig.CHART_TYPE_PIE + || series[i].type === ecConfig.CHART_TYPE_RADAR + || series[i].type === ecConfig.CHART_TYPE_CHORD + || series[i].type === ecConfig.CHART_TYPE_FORCE + || series[i].type === ecConfig.CHART_TYPE_FUNNEL ) { data = series[i].type != ecConfig.CHART_TYPE_FORCE ? series[i].data // 饼图、雷达图、和弦图得查找里面的数据名字 : series[i].categories; // 力导布局查找categories配置 for (var j = 0, k = data.length; j < k; j++) { - if (data[j].name == name && data[j].value != '-') { + if (data[j].name === name && data[j].value != '-') { amount++; } } @@ -686,25 +730,25 @@ define(function (require) { return amount; }, - setColor : function (legendName, color) { + setColor: function (legendName, color) { this._colorMap[legendName] = color; }, - getColor : function (legendName) { + getColor: function (legendName) { if (!this._colorMap[legendName]) { this._colorMap[legendName] = this.zr.getColor(this._colorIndex++); } return this._colorMap[legendName]; }, - hasColor : function (legendName) { + hasColor: function (legendName) { return this._colorMap[legendName] ? this._colorMap[legendName] : false; }, - add : function (name, color){ + add: function (name, color){ var data = this.legendOption.data; for (var i = 0, dataLength = data.length; i < dataLength; i++) { - if (this._getName(data[i]) == name) { + if (this._getName(data[i]) === name) { // 已有就不重复加了 return; } @@ -712,12 +756,13 @@ define(function (require) { this.legendOption.data.push(name); this.setColor(name,color); this._selectedMap[name] = true; + this._hasDataMap[name] = true; }, - del : function (name){ + del: function (name){ var data = this.legendOption.data; for (var i = 0, dataLength = data.length; i < dataLength; i++) { - if (this._getName(data[i]) == name) { + if (this._getName(data[i]) === name) { return this.legendOption.data.splice(i, 1); } } @@ -728,14 +773,14 @@ define(function (require) { * @param {Object} name * @param {Object} itemShape */ - getItemShape : function (name) { - if (typeof name == 'undefined') { + getItemShape: function (name) { + if (name == null) { return; } var shape; for (var i = 0, l = this.shapeList.length; i < l; i++) { shape = this.shapeList[i]; - if (shape._name == name && shape.type != 'text') { + if (shape._name === name && shape.type != 'text') { return shape; } } @@ -746,11 +791,11 @@ define(function (require) { * @param {Object} name * @param {Object} itemShape */ - setItemShape : function (name, itemShape) { + setItemShape: function (name, itemShape) { var shape; for (var i = 0, l = this.shapeList.length; i < l; i++) { shape = this.shapeList[i]; - if (shape._name == name && shape.type != 'text') { + if (shape._name === name && shape.type != 'text') { if (!this._selectedMap[name]) { itemShape.style.color = '#ccc'; itemShape.style.strokeColor = '#ccc'; @@ -760,7 +805,7 @@ define(function (require) { } }, - isSelected : function (itemName) { + isSelected: function (itemName) { if (typeof this._selectedMap[itemName] != 'undefined') { return this._selectedMap[itemName]; } @@ -770,11 +815,11 @@ define(function (require) { } }, - getSelectedMap : function () { + getSelectedMap: function () { return this._selectedMap; }, - setSelected : function(itemName, selectStatus) { + setSelected: function(itemName, selectStatus) { if (this.legendOption.selectedMode === 'single') { for (var k in this._selectedMap) { this._selectedMap[k] = false; @@ -785,8 +830,8 @@ define(function (require) { ecConfig.EVENT.LEGEND_SELECTED, null, { - selected : this._selectedMap, - target : itemName + selected: this._selectedMap, + target: itemName }, this.myChart ); @@ -795,7 +840,7 @@ define(function (require) { /** * 图例选择 */ - onlegendSelected : function (param, status) { + onlegendSelected: function (param, status) { var legendSelected = param.selected; for (var itemName in legendSelected) { if (this._selectedMap[itemName] != legendSelected[itemName]) { @@ -809,70 +854,56 @@ define(function (require) { }; var legendIcon = { - line : function (ctx, style) { + line: function (ctx, style) { var dy = style.height / 2; ctx.moveTo(style.x, style.y + dy); ctx.lineTo(style.x + style.width,style.y + dy); }, - pie : function (ctx, style) { + pie: function (ctx, style) { var x = style.x; var y = style.y; var width = style.width; var height = style.height; SectorShape.prototype.buildPath(ctx, { - x : x + width / 2, - y : y + height + 2, - r : height + 2, - r0 : 6, - startAngle : 45, - endAngle : 135 + x: x + width / 2, + y: y + height + 2, + r: height, + r0: 6, + startAngle: 45, + endAngle: 135 }); }, - /* - chord : function (ctx, style) { + + eventRiver: function (ctx, style) { var x = style.x; var y = style.y; var width = style.width; var height = style.height; ctx.moveTo(x, y + height); - BeziercurveShape.prototype.buildPath(ctx, { - xStart : x, - yStart : y + height, - cpX1 : x + width, - cpY1 : y + height, - cpX2 : x, - cpY2 : y + 4, - xEnd : x + width, - yEnd : y + 4 - }); + ctx.bezierCurveTo( + x + width, y + height, x, y + 4, x + width, y + 4 + ); ctx.lineTo(x + width, y); - BeziercurveShape.prototype.buildPath(ctx, { - xStart : x + width, - yStart : y, - cpX1 : x, - cpY1 : y, - cpX2 : x + width, - cpY2 : y + height - 4, - xEnd : x, - yEnd : y + height - 4 - }); + ctx.bezierCurveTo( + x, y, x + width, y + height - 4, x, y + height - 4 + ); ctx.lineTo(x, y + height); }, - */ - k : function (ctx, style) { + + k: function (ctx, style) { var x = style.x; var y = style.y; var width = style.width; var height = style.height; CandleShape.prototype.buildPath(ctx, { - x : x + width / 2, - y : [y + 1, y + 1, y + height - 6, y + height], - width : width - 6 + x: x + width / 2, + y: [y + 1, y + 1, y + height - 6, y + height], + width: width - 6 }); }, - bar : function (ctx, style) { + bar: function (ctx, style) { var x = style.x; var y = style.y +1; var width = style.width; @@ -896,7 +927,7 @@ define(function (require) { ctx.quadraticCurveTo(x, y, x + r, y); }, - force : function (ctx, style) { + force: function (ctx, style) { IconShape.prototype.iconLibrary.circle(ctx, style); }, diff --git a/amd/component/polar.js b/amd/component/polar.js index 62a3434..2c531d3 100644 --- a/amd/component/polar.js +++ b/amd/component/polar.js @@ -2,12 +2,12 @@ * echarts组件类:极坐标 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Neil (杨骥, yangji01@baidu.com) + * @author Neil (杨骥, 511415343@qq.com) * */ define(function (require) { var Base = require('./base'); - + // 图形依赖 var TextShape = require('../zrender/shape/Text'); var LineShape = require('../zrender/shape/Line'); @@ -16,18 +16,65 @@ define(function (require) { var Ring = require('../zrender/shape/Ring'); var ecConfig = require('../config'); + ecConfig.polar = { + zlevel: 0, // 一级层叠 + z: 0, // 二级层叠 + center: ['50%', '50%'], // 默认全局居中 + radius: '75%', + startAngle: 90, + boundaryGap: [0, 0], // 数值起始和结束两端空白策略 + splitNumber: 5, + name: { + show: true, + // formatter: null, + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: '#333' + } + }, + axisLine: { // 坐标轴线 + show: true, // 默认显示,属性show控制显示与否 + lineStyle: { // 属性lineStyle控制线条样式 + color: '#ccc', + width: 1, + type: 'solid' + } + }, + axisLabel: { // 坐标轴文本标签,详见axis.axisLabel + show: false, + // formatter: null, + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: '#333' + } + }, + splitArea: { + show: true, + areaStyle: { + color: ['rgba(250,250,250,0.3)','rgba(200,200,200,0.3)'] + } + }, + splitLine: { + show: true, + lineStyle: { + width: 1, + color: '#ccc' + } + }, + type: 'polygon' + // indicator: [] + }; + var zrUtil = require('../zrender/tool/util'); var ecCoordinates = require('../util/coordinates'); function Polar(ecTheme, messageCenter, zr, option, myChart) { Base.call(this, ecTheme, messageCenter, zr, option, myChart); - + this.refresh(option); } - + Polar.prototype = { type : ecConfig.COMPONENT_TYPE_POLAR, - + /** * 绘制图形 */ @@ -109,10 +156,10 @@ define(function (require) { var axisLine = this.deepQuery(this._queryTarget, 'axisLine'); this._addArea( - __ecIndicator, splitNumber, center, + __ecIndicator, splitNumber, center, splitArea, strokeColor, lineWidth, show ); - + axisLine.show && this._addLine( __ecIndicator, center, axisLine ); @@ -122,6 +169,7 @@ define(function (require) { * 绘制axisLabel */ _addAxisLabel : function (index) { + var accMath = require('../util/accMath'); var item = this.polar[index]; var indicator = this.deepQuery(this._queryTarget, 'indicator'); var __ecIndicator = item.__ecIndicator; @@ -137,7 +185,6 @@ define(function (require) { var theta; // var startAngle = this.deepQuery(this._queryTarget, 'startAngle'); var offset; - var precision = this.deepQuery(this._queryTarget, 'precision'); var interval; for (var i = 0; i < indicator.length; i ++) { @@ -146,9 +193,11 @@ define(function (require) { ); if (axisLabel.show) { + var textStyle = this.deepQuery([axisLabel, item, this.option], 'textStyle'); style = {}; - style.textFont = this.getFont(); - //Todo: bug fix + style.textFont = this.getFont(textStyle); + style.color = textStyle.color; + style = zrUtil.merge(style, axisLabel); style.lineWidth = style.width; @@ -158,22 +207,22 @@ define(function (require) { offset = axisLabel.offset || 10; interval = axisLabel.interval || 0; + if (!value) { + return; + } + for (var j = 1 ; j <= splitNumber; j += interval + 1) { newStyle = zrUtil.merge({}, style); - text = - j * (value.max - value.min) / splitNumber - + value.min; - if (precision) { - text = text.toFixed(precision); - } + text = accMath.accAdd(value.min, accMath.accMul(value.step, j)); newStyle.text = this.numAddCommas(text); - newStyle.x = j * vector[0] / splitNumber + newStyle.x = j * vector[0] / splitNumber + Math.cos(theta) * offset + center[0]; newStyle.y = j * vector[1] / splitNumber + Math.sin(theta) * offset + center[1]; this.shapeList.push(new TextShape({ - zlevel : this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), style : newStyle, draggable : false, hoverable : false @@ -209,9 +258,9 @@ define(function (require) { if (!name.show) { continue; - } + } textStyle = this.deepQuery( - [name, item, this.option], + [name, item, this.option], 'textStyle' ); @@ -219,7 +268,7 @@ define(function (require) { style.textFont = this.getFont(textStyle); style.color = textStyle.color; - + if (typeof name.formatter == 'function') { style.text = name.formatter.call(this.myChart, indicator[i].text, i); } @@ -232,7 +281,7 @@ define(function (require) { style.text = indicator[i].text; } __ecIndicator[i].text = style.text; - + vector = __ecIndicator[i].vector; if (Math.round(vector[0]) > 0) { @@ -245,8 +294,8 @@ define(function (require) { textAlign = 'center'; } - if (!name.margin) { - vector = this._mapVector(vector, center, 1.2); + if (name.margin == null) { + vector = this._mapVector(vector, center, 1.1); } else { margin = name.margin; @@ -255,26 +304,27 @@ define(function (require) { x = vector[0] === 0 ? 0 : x; y = vector[1] === 0 ? 0 : y; - vector = this._mapVector(vector, center, 1); + vector = this._mapVector(vector, center, 1); } - - + + style.textAlign = textAlign; style.x = vector[0] + x; style.y = vector[1] + y; if (name.rotate) { rotation = [ - name.rotate / 180 * Math.PI, + name.rotate / 180 * Math.PI, vector[0], vector[1] ]; } else { rotation = [0, 0, 0]; } - + this.shapeList.push(new TextShape({ - zlevel : this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), style : style, draggable : false, hoverable : false, @@ -282,7 +332,7 @@ define(function (require) { })); } }, - + getIndicatorText : function(polarIndex, indicatorIndex) { return this.polar[polarIndex] && this.polar[polarIndex].__ecIndicator[indicatorIndex] @@ -292,7 +342,7 @@ define(function (require) { /** * 添加一个隐形的盒子 当做drop的容器 暴露给外部的图形类使用 * @param {number} polar的index - * @return {Object} 添加的盒子图形 + * @return {Object} 添加的盒子图形 */ getDropBox : function (index) { var index = index || 0; @@ -304,7 +354,7 @@ define(function (require) { var vector; var shape; var type = item.type; - + if (type == 'polygon') { for (var i = 0; i < len; i ++) { vector = __ecIndicator[i].vector; @@ -318,7 +368,7 @@ define(function (require) { '', 1, 1.2, center, 'fill', 'rgba(0,0,0,0)' ); } - + return shape; }, @@ -331,7 +381,7 @@ define(function (require) { * @param {Object} 分割区域对象 * @param {string} 线条颜色 * @param {number} 线条宽度 - */ + */ _addArea : function ( __ecIndicator, splitNumber, center, splitArea, strokeColor, lineWidth, show @@ -344,7 +394,7 @@ define(function (require) { for (var i = 0; i < splitNumber ; i ++ ) { scale = (splitNumber - i) / splitNumber; - + if (show) { if (type == 'polygon') { pointList = this._getPointList( @@ -357,7 +407,7 @@ define(function (require) { strokeColor, lineWidth, scale, center, 'stroke' ); } - + this.shapeList.push(shape); } @@ -365,8 +415,8 @@ define(function (require) { scale1 = (splitNumber - i - 1) / splitNumber; this._addSplitArea( __ecIndicator, splitArea, scale, scale1, center, i - ); - } + ); + } } }, @@ -386,7 +436,8 @@ define(function (require) { ) { var radius = this._getRadius(); return new Circle({ - zlevel : this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), style: { x: center[0], y: center[1], @@ -413,7 +464,8 @@ define(function (require) { _getRing : function (color, scale0, scale1, center) { var radius = this._getRadius(); return new Ring({ - zlevel : this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), style : { x : center[0], y : center[1], @@ -423,7 +475,7 @@ define(function (require) { brushType : 'fill' }, hoverable : false, - draggable : false + draggable : false }); }, @@ -442,7 +494,7 @@ define(function (require) { for (var i = 0 ; i < len ; i ++ ) { vector = __ecIndicator[i].vector; - + pointList.push(this._mapVector(vector, center, scale)); } return pointList; @@ -456,12 +508,13 @@ define(function (require) { * @param {string} 描边颜色 * @param {number} 线条宽度 * @return {Object} 绘制的图形对象 - */ + */ _getShape : function ( pointList, brushType, color, strokeColor, lineWidth ) { return new PolygonShape({ - zlevel : this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), style : { pointList : pointList, brushType : brushType, @@ -492,7 +545,7 @@ define(function (require) { var shape; var type = this.deepQuery(this._queryTarget, 'type'); - + if (typeof colorArr == 'string') { colorArr = [colorArr]; } @@ -548,12 +601,12 @@ define(function (require) { /** * 绘制从中点出发的线 - * + * * @param {Array} 指标对象 * @param {Array} 中点坐标 * @param {string} 线条颜色 * @param {number} 线条宽度 - * @param {string} 线条绘制类型 + * @param {string} 线条绘制类型 * solid | dotted | dashed 实线 | 点线 | 虚线 */ _addLine : function ( @@ -571,7 +624,7 @@ define(function (require) { vector = __ecIndicator[i].vector; line = this._getLine( center[0], center[1], - vector[0] + center[0], + vector[0] + center[0], vector[1] + center[1], strokeColor, lineWidth, lineType ); @@ -579,7 +632,7 @@ define(function (require) { } }, - /** + /** * 获取线条对象 * @param {number} 出发点横坐标 * @param {number} 出发点纵坐标 @@ -595,7 +648,8 @@ define(function (require) { xStart, yStart, xEnd, yEnd, strokeColor, lineWidth, lineType ) { return new LineShape({ - zlevel : this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), style : { xStart : xStart, yStart : yStart, @@ -618,34 +672,42 @@ define(function (require) { var indicator = this.deepQuery(this._queryTarget, 'indicator'); var len = indicator.length; var __ecIndicator = item.__ecIndicator; - var value; var max; var min; var data = this._getSeriesData(index); - var splitNumber = item.splitNumber; - var boundaryGap = this.deepQuery(this._queryTarget, 'boundaryGap'); - var precision = this.deepQuery(this._queryTarget, 'precision'); - var power = this.deepQuery(this._queryTarget, 'power'); - var scale = this.deepQuery(this._queryTarget, 'scale'); + var boundaryGap = item.boundaryGap; + var splitNumber = item.splitNumber; + var scale = item.scale; + var smartSteps = require('../util/smartSteps'); for (var i = 0; i < len ; i ++ ) { if (typeof indicator[i].max == 'number') { max = indicator[i].max; min = indicator[i].min || 0; - value = { - max : max, - min : min - }; } else { - value = this._findValue( - data, i, splitNumber, - boundaryGap, precision, power, scale + var value = this._findValue( + data, i, splitNumber, boundaryGap ); + min = value.min; + max = value.max; + } + // 非scale下双正,修正最小值为0 + if (!scale && min >= 0 && max >= 0) { + min = 0; } + // 非scale下双负,修正最大值为0 + if (!scale && min <= 0 && max <= 0) { + max = 0; + } + var stepOpt = smartSteps(min, max, splitNumber); - __ecIndicator[i].value = value; + __ecIndicator[i].value = { + min: stepOpt.min, + max: stepOpt.max, + step: stepOpt.step + }; } }, @@ -685,33 +747,23 @@ define(function (require) { * 查找指标合适的值 * * 如果只有一组数据以数据中的最大值作为最大值 0为最小值 - * 如果是多组,使用同一维度的进行比较 选出最大值最小值 - * 对它们进行处理 + * 如果是多组,使用同一维度的进行比较 选出最大值最小值 + * 对它们进行处理 * @param {Object} serie 的 data - * @param {number} 指标的序号 - * @param {boolean} boundaryGap 两端留白 - * @param {number} precision 小数精度 - * @param {number} power 整数精度 - * @return {Object} 指标的最大值最小值 - */ - _findValue : function ( - data, index, splitNumber, boundaryGap, precision, power, scale - ) { + * @param {number} index 指标的序号 + * @param {number} splitNumber 分段格式 + * * @param {boolean} boundaryGap 两端留白 + */ + _findValue : function (data, index, splitNumber, boundaryGap) { var max; var min; - var value; - var delta; - var str; - var len = 0; - var max0; - var min0; var one; if (!data || data.length === 0) { return; } - function _compare(item) { + function _compare(item) { (item > max || max === undefined) && (max = item); (item < min || min === undefined) && (min = item); } @@ -721,72 +773,31 @@ define(function (require) { } if (data.length != 1) { for (var i = 0; i < data.length; i ++) { - value = typeof data[i].value[index].value != 'undefined' - ? data[i].value[index].value : data[i].value[index]; - _compare(value); + _compare(this.getDataFromOption(data[i].value[index])); } } else { one = data[0]; for (var i = 0; i < one.value.length; i ++) { - _compare( - typeof one.value[i].value != 'undefined' - ? one.value[i].value : one.value[i] - ); + _compare(this.getDataFromOption(one.value[i])); } } - if (data.length != 1) { - if (scale) { - delta = this._getDelta( - max, min, splitNumber, precision, power - ); - - if (delta >= 1) { - min = Math.floor(min / delta) * delta - delta; - } - else if (delta === 0) { - if (max > 0) { - min0 = 0; - max0 = 2 * max; - } - else if (max === 0) { - min0 = 0; - max0 = 100; - } - else { - max0 = 0; - min0 = 2 * min; - } - - return { - max : max0, - min : min0 - }; - } - else { - str = (delta + '').split('.')[1]; - len = str.length; - min = Math.floor( - min * Math.pow(10, len)) / Math.pow(10, len - ) - delta; - } - - if (Math.abs(min) <= delta) { - min = 0; - } - - max = min + Math.floor(delta * Math.pow(10, len) - * (splitNumber + 1)) / Math.pow(10, len) ; + var gap = Math.abs(max - min); + min = min - Math.abs(gap * boundaryGap[0]); + max = max + Math.abs(gap * boundaryGap[1]); + if (min === max) { + if (max === 0) { + // 修复全0数据 + max = 1; } - else { - min = min > 0 ? 0 : min; + // 修复最大值==最小值时数据整形 + else if (max > 0) { + min = max / splitNumber; + } + else { // max < 0 + max = max / splitNumber; } - } - - if (boundaryGap) { - max = max > 0 ? max * 1.2 : max * 0.8; - min = min > 0 ? min * 0.8 : min * 1.2; } return { @@ -795,74 +806,10 @@ define(function (require) { }; }, - /** - * 获取最大值与最小值中间比较合适的差值 - * @param {number} max; - * @param {number} min - * @param {number} precision 小数精度 - * @param {number} power 整数精度 - * @return {number} delta - */ - _getDelta : function (max , min, splitNumber, precision, power) { - var delta = (max - min) / splitNumber; - var str; - var n; - - if (delta > 1) { - if (!power) { - str = (delta + '').split('.')[0]; - n = str.length; - if (str.charAt(0) >= 5) { - return Math.pow(10, n); - } - else { - return (str.charAt(0) - 0 + 1 ) * Math.pow(10, n - 1); - } - } - else { - delta = Math.ceil(delta); - if (delta % power > 0) { - return (Math.ceil(delta / power) + 1) * power; - } - else { - return delta; - } - } - } - else if (delta == 1) { - return 1; - } - else if (delta === 0) { - return 0; - } - else { - if (!precision) { - str = (delta + '').split('.')[1]; - n = 0; - while (str[n] == '0') { - n ++ ; - } - - if (str[n] >= 5) { - return '0.' + str.substring(0, n + 1) - 0 - + 1 / Math.pow(10, n); - } - else { - return '0.' + str.substring(0, n + 1) - 0 - + 1 / Math.pow(10, n + 1); - } - } - else { - return Math.ceil(delta * Math.pow(10, precision)) - / Math.pow(10, precision); - } - } - }, - /** * 获取每个指标上某个value对应的坐标 * @param {number} polarIndex - * @param {number} indicatorIndex + * @param {number} indicatorIndex * @param {number} value * @return {Array} 对应坐标 */ @@ -885,7 +832,7 @@ define(function (require) { if (typeof value == 'undefined') { return center; } - + switch (value) { case 'min' : value = min; @@ -897,14 +844,14 @@ define(function (require) { value = (max + min) / 2; break; } - + if (max != min) { alpha = (value - min) / (max - min); } else { alpha = 0.5; } - + return this._mapVector(vector, center, alpha); }, @@ -912,7 +859,7 @@ define(function (require) { * 判断一个点是否在网内 * @param {Array} 坐标 * @return {number} 返回polarindex 返回-1表示不在任何polar - */ + */ isInside : function (vector) { var polar = this.getNearestIndex(vector); @@ -926,7 +873,7 @@ define(function (require) { * 如果一个点在网内,返回离它最近的数据轴的index * @param {Array} 坐标 * @return {Object} | false - * polarIndex + * polarIndex * valueIndex */ getNearestIndex : function (vector) { @@ -952,10 +899,10 @@ define(function (require) { startAngle = item.startAngle; indicator = item.indicator; len = indicator.length; - angle = 2 * Math.PI / len; + angle = 2 * Math.PI / len; // 注意y轴的翻转 polarVector = ecCoordinates.cartesian2polar( - vector[0] - center[0], center[1] - vector[1] + vector[0] - center[0], center[1] - vector[1] ); if (vector[0] - center[0] < 0) { polarVector[1] += Math.PI; @@ -966,11 +913,11 @@ define(function (require) { // 减去startAngle的偏移量 再加2PI变成正数 - finalAngle = polarVector[1] - + finalAngle = polarVector[1] - startAngle / 180 * Math.PI + Math.PI * 2; if (Math.abs(Math.cos(finalAngle % (angle / 2))) * radius - > polarVector[0]) + > polarVector[0]) { return { polarIndex : i, @@ -983,7 +930,7 @@ define(function (require) { }, /** - * 获取指标信息 + * 获取指标信息 * @param {number} polarIndex * @return {Array} indicator */ @@ -1005,10 +952,10 @@ define(function (require) { this._buildShape(); } }; - + zrUtil.inherits(Polar, Base); - + require('../component').define('polar', Polar); - + return Polar; }); \ No newline at end of file diff --git a/amd/component/roamController.js b/amd/component/roamController.js new file mode 100644 index 0000000..164826d --- /dev/null +++ b/amd/component/roamController.js @@ -0,0 +1,356 @@ +/** + * echarts组件:漫游控制器 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + * + */ +define(function (require) { + var Base = require('./base'); + + // 图形依赖 + var RectangleShape = require('../zrender/shape/Rectangle'); + var SectorShape = require('../zrender/shape/Sector'); + var CircleShape = require('../zrender/shape/Circle'); + + var ecConfig = require('../config'); + ecConfig.roamController = { + zlevel: 0, // 一级层叠 + z: 4, // 二级层叠 + show: true, + x: 'left', // 水平安放位置,默认为全图左对齐,可选为: + // 'center' ¦ 'left' ¦ 'right' + // ¦ {number}(x坐标,单位px) + y: 'top', // 垂直安放位置,默认为全图顶端,可选为: + // 'top' ¦ 'bottom' ¦ 'center' + // ¦ {number}(y坐标,单位px) + width: 80, + height: 120, + backgroundColor: 'rgba(0,0,0,0)', + borderColor: '#ccc', // 图例边框颜色 + borderWidth: 0, // 图例边框线宽,单位px,默认为0(无边框) + padding: 5, // 图例内边距,单位px,默认各方向内边距为5, + // 接受数组分别设定上右下左边距,同css + handleColor: '#6495ed', + fillerColor: '#fff', + step: 15, // 移动幅度 + mapTypeControl: null + }; + + var zrUtil = require('../zrender/tool/util'); + var zrColor = require('../zrender/tool/color'); + var zrEvent = require('../zrender/tool/event'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} option 图表参数 + */ + function RoamController(ecTheme, messageCenter, zr, option, myChart) { + if (!option.roamController || !option.roamController.show) { + return; + } + if (!option.roamController.mapTypeControl) { + console.error('option.roamController.mapTypeControl has not been defined.'); + return; + } + + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + + this.rcOption = option.roamController; + + var self = this; + this._drictionMouseDown = function(params) { + return self.__drictionMouseDown(params); + }; + this._drictionMouseUp = function(params) { + return self.__drictionMouseUp(params); + }; + this._drictionMouseMove = function(params) { + return self.__drictionMouseMove(params); + }; + this._drictionMouseOut = function(params) { + return self.__drictionMouseOut(params); + }; + this._scaleHandler = function(params) { + return self.__scaleHandler(params); + }; + this.refresh(option); + } + + RoamController.prototype = { + type: ecConfig.COMPONENT_TYPE_ROAMCONTROLLER, + _buildShape: function () { + if (!this.rcOption.show) { + return; + } + // 元素组的位置参数,通过计算所得x, y, width, height + this._itemGroupLocation = this._getItemGroupLocation(); + + this._buildBackground(); + this._buildItem(); + + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + }, + + /** + * 构建所有漫游控制器元素 + */ + _buildItem: function () { + this.shapeList.push(this._getDirectionShape('up')); + this.shapeList.push(this._getDirectionShape('down')); + this.shapeList.push(this._getDirectionShape('left')); + this.shapeList.push(this._getDirectionShape('right')); + this.shapeList.push(this._getScaleShape('scaleUp')); + this.shapeList.push(this._getScaleShape('scaleDown')); + }, + + _getDirectionShape: function(direction) { + var r = this._itemGroupLocation.r; + var x = this._itemGroupLocation.x + r; + var y = this._itemGroupLocation.y + r; + + var sectorShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: x, // 圆心横坐标 + y: y, // 圆心纵坐标 + r: r, // 圆环外半径 + startAngle: -45, + endAngle: 45, + color: this.rcOption.handleColor, + text: '>', + textX: x + r / 2 + 4, + textY: y - 0.5, + textAlign: 'center', + textBaseline: 'middle', + textPosition: 'specific', + textColor: this.rcOption.fillerColor, + textFont: Math.floor(r / 2) + 'px arial' + }, + highlightStyle: { + color: zrColor.lift(this.rcOption.handleColor, -0.2), + brushType: 'fill' + }, + clickable: true + }; + switch (direction) { + case 'up': + sectorShape.rotation = [Math.PI / 2, x, y]; + break; + case 'left': + sectorShape.rotation = [Math.PI, x, y]; + break; + case 'down': + sectorShape.rotation = [-Math.PI / 2, x, y]; + break; + } + + sectorShape = new SectorShape(sectorShape); + sectorShape._roamType = direction; + sectorShape.onmousedown = this._drictionMouseDown; + sectorShape.onmouseup = this._drictionMouseUp; + sectorShape.onmousemove = this._drictionMouseMove; + sectorShape.onmouseout = this._drictionMouseOut; + + return sectorShape; + }, + + _getScaleShape: function(text) { + var width = this._itemGroupLocation.width; + var height = this._itemGroupLocation.height - width; + height = height < 0 ? 20 : height; // 确保height不为负 + + var r = Math.min(width / 2 - 5, height) / 2; + var x = this._itemGroupLocation.x + + (text === 'scaleDown' ? (width - r) : r); + var y = this._itemGroupLocation.y + this._itemGroupLocation.height - r; + + var scaleShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: x, + y: y, + r: r, + color: this.rcOption.handleColor, + text: text === 'scaleDown' ? '-' : '+', + textX: x, + textY: y - 2, + textAlign: 'center', + textBaseline: 'middle', + textPosition: 'specific', + textColor: this.rcOption.fillerColor, + textFont: Math.floor(r) + 'px verdana' + }, + highlightStyle: { + color: zrColor.lift(this.rcOption.handleColor, -0.2), + brushType: 'fill' + }, + clickable: true + }; + + scaleShape = new CircleShape(scaleShape); + scaleShape._roamType = text; + scaleShape.onmousedown = this._scaleHandler; + + return scaleShape; + }, + + _buildBackground: function () { + var padding = this.reformCssArray(this.rcOption.padding); + + this.shapeList.push(new RectangleShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable :false, + style: { + x: this._itemGroupLocation.x - padding[3], + y: this._itemGroupLocation.y - padding[0], + width: this._itemGroupLocation.width + padding[3] + padding[1], + height: this._itemGroupLocation.height + padding[0] + padding[2], + brushType: this.rcOption.borderWidth === 0 ? 'fill' : 'both', + color: this.rcOption.backgroundColor, + strokeColor: this.rcOption.borderColor, + lineWidth: this.rcOption.borderWidth + } + })); + }, + + /** + * 根据选项计算漫游控制器实体的位置坐标 + */ + _getItemGroupLocation: function () { + var padding = this.reformCssArray(this.rcOption.padding); + var width = this.rcOption.width; + var height = this.rcOption.height; + + var zrWidth = this.zr.getWidth(); + var zrHeight = this.zr.getHeight(); + var x; + switch (this.rcOption.x) { + case 'center' : + x = Math.floor((zrWidth - width) / 2); + break; + case 'left' : + x = padding[3] + this.rcOption.borderWidth; + break; + case 'right' : + x = zrWidth + - width + - padding[1] + - padding[3] + - this.rcOption.borderWidth * 2; + break; + default : + x = this.parsePercent(this.rcOption.x, zrWidth); + break; + } + + var y; + switch (this.rcOption.y) { + case 'top' : + y = padding[0] + this.rcOption.borderWidth; + break; + case 'bottom' : + y = zrHeight + - height + - padding[0] + - padding[2] + - this.rcOption.borderWidth * 2; + break; + case 'center' : + y = Math.floor((zrHeight - height) / 2); + break; + default : + y = this.parsePercent(this.rcOption.y, zrHeight); + break; + } + + return { + x: x, + y: y, + r: width / 2, + width: width, + height: height + }; + }, + + __drictionMouseDown: function(params) { + this.mousedown = true; + this._drictionHandlerOn(params); + }, + + __drictionMouseUp: function(params) { + this.mousedown = false; + this._drictionHandlerOff(params); + }, + + __drictionMouseMove: function(params) { + if (this.mousedown) { + this._drictionHandlerOn(params); + } + }, + + __drictionMouseOut: function(params) { + this._drictionHandlerOff(params); + }, + + _drictionHandlerOn: function(params) { + this._dispatchEvent(params.event, params.target._roamType); + clearInterval(this.dircetionTimer); + var self = this; + this.dircetionTimer = setInterval(function() { + self._dispatchEvent(params.event, params.target._roamType); + }, 100); + zrEvent.stop(params.event); + }, + + _drictionHandlerOff: function(params) { + clearInterval(this.dircetionTimer); + }, + + __scaleHandler: function(params) { + this._dispatchEvent(params.event, params.target._roamType); + zrEvent.stop(params.event); + }, + + _dispatchEvent: function(event, roamType){ + this.messageCenter.dispatch( + ecConfig.EVENT.ROAMCONTROLLER, + event, + { + roamType: roamType, + mapTypeControl: this.rcOption.mapTypeControl, + step: this.rcOption.step + }, + this.myChart + ); + }, + /** + * 刷新 + */ + refresh: function (newOption) { + if (newOption) { + this.option = newOption || this.option; + this.option.roamController = this.reformOption(this.option.roamController); + this.rcOption = this.option.roamController; + } + this.clear(); + this._buildShape(); + } + }; + + + zrUtil.inherits(RoamController, Base); + + require('../component').define('roamController', RoamController); + + return RoamController; +}); + + diff --git a/amd/component/timeline.js b/amd/component/timeline.js index 543ca20..5e6daf3 100644 --- a/amd/component/timeline.js +++ b/amd/component/timeline.js @@ -2,7 +2,7 @@ * echarts组件:时间轴组件 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ define(function (require) { @@ -14,6 +14,66 @@ define(function (require) { var ChainShape = require('../util/shape/Chain'); var ecConfig = require('../config'); + ecConfig.timeline = { + zlevel: 0, // 一级层叠 + z: 4, // 二级层叠 + show: true, + type: 'time', // 模式是时间类型,支持 number + notMerge: false, + realtime: true, + x: 80, + // y: {number}, + x2: 80, + y2: 0, + // width: {totalWidth} - x - x2, + height: 50, + backgroundColor: 'rgba(0,0,0,0)', // 时间轴背景颜色 + borderColor: '#ccc', // 时间轴边框颜色 + borderWidth: 0, // 时间轴边框线宽,单位px,默认为0(无边框) + padding: 5, // 时间轴内边距,单位px,默认各方向内边距为5, + controlPosition: 'left', // 'right' | 'none' + autoPlay: false, + loop: true, + playInterval: 2000, // 播放时间间隔,单位ms + lineStyle: { + width: 1, + color: '#666', + type: 'dashed' + }, + label: { // 文本标签 + show: true, + interval: 'auto', + rotate: 0, + // formatter: null, + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: '#333' + } + }, + checkpointStyle: { + symbol: 'auto', + symbolSize: 'auto', + color: 'auto', + borderColor: 'auto', + borderWidth: 'auto', + label: { // 文本标签 + show: false, + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: 'auto' + } + } + }, + controlStyle: { + itemSize: 15, + itemGap: 5, + normal: { color: '#333'}, + emphasis: { color: '#1e90ff'} + }, + symbol: 'emptyDiamond', + symbolSize: 4, + currentIndex: 0 + // data: [] + }; + var zrUtil = require('../zrender/tool/util'); var zrArea = require('../zrender/tool/area'); var zrEvent = require('../zrender/tool/event'); @@ -49,9 +109,9 @@ define(function (require) { null, { currentIndex: self.currentIndex, - data : typeof timelineOption.data[self.currentIndex].name != 'undefined' - ? timelineOption.data[self.currentIndex].name - : timelineOption.data[self.currentIndex] + data: timelineOption.data[self.currentIndex].name != null + ? timelineOption.data[self.currentIndex].name + : timelineOption.data[self.currentIndex] }, self.myChart ); @@ -108,14 +168,16 @@ define(function (require) { function() { self.play(); }, - this.ecTheme.animationDuration + this.ecTheme.animationDuration != null + ? this.ecTheme.animationDuration + : ecConfig.animationDuration ); } } Timeline.prototype = { - type : ecConfig.COMPONENT_TYPE_TIMELINE, - _buildShape : function () { + type: ecConfig.COMPONENT_TYPE_TIMELINE, + _buildShape: function () { // 位置参数,通过计算所得x, y, width, height this._location = this._getLocation(); this._buildBackground(); @@ -139,16 +201,16 @@ define(function (require) { /** * 根据选项计算实体的位置坐标 */ - _getLocation : function () { + _getLocation: function () { var timelineOption = this.timelineOption; - var padding = timelineOption.padding; + var padding = this.reformCssArray(this.timelineOption.padding); // 水平布局 var zrWidth = this.zr.getWidth(); var x = this.parsePercent(timelineOption.x, zrWidth); var x2 = this.parsePercent(timelineOption.x2, zrWidth); var width; - if (typeof timelineOption.width == 'undefined') { + if (timelineOption.width == null) { width = zrWidth - x - x2; x2 = zrWidth - x2; } @@ -161,7 +223,7 @@ define(function (require) { var height = this.parsePercent(timelineOption.height, zrHeight); var y; var y2; - if (typeof timelineOption.y != 'undefined') { + if (timelineOption.y != null) { y = this.parsePercent(timelineOption.y, zrHeight); y2 = y + height; } @@ -171,27 +233,27 @@ define(function (require) { } return { - x : x + padding[3], - y : y + padding[0], - x2 : x2 - padding[1], - y2 : y2 - padding[2], - width : width - padding[1] - padding[3], - height : height - padding[0] - padding[2] + x: x + padding[3], + y: y + padding[0], + x2: x2 - padding[1], + y2: y2 - padding[2], + width: width - padding[1] - padding[3], + height: height - padding[0] - padding[2] }; }, - _getReformedLabel : function (idx) { + _getReformedLabel: function (idx) { var timelineOption = this.timelineOption; - var data = typeof timelineOption.data[idx].name != 'undefined' + var data = timelineOption.data[idx].name != null ? timelineOption.data[idx].name : timelineOption.data[idx]; var formatter = timelineOption.data[idx].formatter || timelineOption.label.formatter; if (formatter) { - if (typeof formatter == 'function') { + if (typeof formatter === 'function') { data = formatter.call(this.myChart, data); } - else if (typeof formatter == 'string') { + else if (typeof formatter === 'string') { data = formatter.replace('{value}', data); } } @@ -201,11 +263,11 @@ define(function (require) { /** * 计算标签显示挑选间隔 */ - _getInterval : function () { + _getInterval: function () { var chainPoint = this._chainPoint; var timelineOption = this.timelineOption; var interval = timelineOption.label.interval; - if (interval == 'auto') { + if (interval === 'auto') { // 麻烦的自适应计算 var fontSize = timelineOption.label.textStyle.fontSize; var data = timelineOption.data; @@ -264,7 +326,7 @@ define(function (require) { /** * 根据选项计算时间链条上的坐标及symbolList */ - _getChainPoint : function() { + _getChainPoint: function() { var timelineOption = this.timelineOption; var symbol = timelineOption.symbol.toLowerCase(); var symbolSize = timelineOption.symbolSize; @@ -279,14 +341,14 @@ define(function (require) { var len = data.length; function _getName(i) { - return typeof data[i].name != 'undefined' ? data[i].name : data[i]; + return (data[i].name != null ? data[i].name : data[i] + ''); } var xList = []; if (len > 1) { var boundaryGap = width / len; boundaryGap = boundaryGap > 50 ? 50 : (boundaryGap < 20 ? 5 : boundaryGap); width -= boundaryGap * 2; - if (timelineOption.type == 'number') { + if (timelineOption.type === 'number') { // 平均分布 for (var i = 0; i < len; i++) { xList.push(x + boundaryGap + width / (len - 1) * i); @@ -345,32 +407,32 @@ define(function (require) { } list.push({ - x : x, - n : n, - isEmpty : isEmpty, - symbol : curSymbol, - symbolSize : data[i].symbolSize || symbolSize, - color : data[i].color, - borderColor : data[i].borderColor, - borderWidth : data[i].borderWidth, - name : this._getReformedLabel(i), - textColor : dataTextStyle.color, - textAlign : textAlign, - textBaseline : dataTextStyle.baseline || 'middle', - textX : x, - textY : y - (rotate ? 5 : 0), - textFont : data[i].textStyle ? this.getFont(dataTextStyle) : textFont, - rotation : rotation, - showLabel : false + x: x, + n: n, + isEmpty: isEmpty, + symbol: curSymbol, + symbolSize: data[i].symbolSize || symbolSize, + color: data[i].color, + borderColor: data[i].borderColor, + borderWidth: data[i].borderWidth, + name: this._getReformedLabel(i), + textColor: dataTextStyle.color, + textAlign: textAlign, + textBaseline: dataTextStyle.baseline || 'middle', + textX: x, + textY: y - (rotate ? 5 : 0), + textFont: data[i].textStyle ? this.getFont(dataTextStyle) : textFont, + rotation: rotation, + showLabel: false }); } return list; }, - _buildBackground : function () { + _buildBackground: function () { var timelineOption = this.timelineOption; - var padding = timelineOption.padding; + var padding = this.reformCssArray(this.timelineOption.padding); var width = this._location.width; var height = this._location.height; @@ -379,35 +441,35 @@ define(function (require) { ) { // 背景 this.shapeList.push(new RectangleShape({ - zlevel : this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), hoverable :false, - style : { - x : this._location.x - padding[3], - y : this._location.y - padding[0], - width : width + padding[1] + padding[3], - height : height + padding[0] + padding[2], - brushType : timelineOption.borderWidth === 0 - ? 'fill' : 'both', - color : timelineOption.backgroundColor, - strokeColor : timelineOption.borderColor, - lineWidth : timelineOption.borderWidth + style: { + x: this._location.x - padding[3], + y: this._location.y - padding[0], + width: width + padding[1] + padding[3], + height: height + padding[0] + padding[2], + brushType: timelineOption.borderWidth === 0 ? 'fill' : 'both', + color: timelineOption.backgroundColor, + strokeColor: timelineOption.borderColor, + lineWidth: timelineOption.borderWidth } })); } }, - _buildControl : function() { + _buildControl: function() { var self = this; var timelineOption = this.timelineOption; var lineStyle = timelineOption.lineStyle; var controlStyle = timelineOption.controlStyle; - if (timelineOption.controlPosition == 'none') { + if (timelineOption.controlPosition === 'none') { return; } - var iconSize = 15; - var iconGap = 5; + var iconSize = controlStyle.itemSize; + var iconGap = controlStyle.itemGap; var x; - if (timelineOption.controlPosition == 'left') { + if (timelineOption.controlPosition === 'left') { x = this._location.x; this._location.x += (iconSize + iconGap) * 3; } @@ -418,25 +480,26 @@ define(function (require) { var y = this._location.y; var iconStyle = { - zlevel : this._zlevelBase + 1, - style : { - iconType : 'timelineControl', - symbol : 'last', - x : x, - y : y, - width : iconSize, - height : iconSize, - brushType : 'stroke', + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + style: { + iconType: 'timelineControl', + symbol: 'last', + x: x, + y: y, + width: iconSize, + height: iconSize, + brushType: 'stroke', color: controlStyle.normal.color, - strokeColor : controlStyle.normal.color, - lineWidth : lineStyle.width + strokeColor: controlStyle.normal.color, + lineWidth: lineStyle.width }, - highlightStyle : { - color : controlStyle.emphasis.color, - strokeColor : controlStyle.emphasis.color, - lineWidth : lineStyle.width + 1 + highlightStyle: { + color: controlStyle.emphasis.color, + strokeColor: controlStyle.emphasis.color, + lineWidth: lineStyle.width + 1 }, - clickable : true + clickable: true }; this._ctrLastShape = new IconShape(iconStyle); @@ -452,7 +515,7 @@ define(function (require) { this._ctrPlayShape.style.status = this.timelineOption.autoPlay ? 'playing' : 'stop'; this._ctrPlayShape.style.x = x; this._ctrPlayShape.onclick = function() { - if (self._ctrPlayShape.style.status == 'stop') { + if (self._ctrPlayShape.style.status === 'stop') { self.play(); } else { @@ -474,25 +537,26 @@ define(function (require) { /** * 构建时间轴 */ - _buildChain : function () { + _buildChain: function () { var timelineOption = this.timelineOption; var lineStyle = timelineOption.lineStyle; this._timelineShae = { - zlevel : this._zlevelBase, - style : { - x : this._location.x, - y : this.subPixelOptimize(this._location.y, lineStyle.width), - width : this._location.x2 - this._location.x, - height : this._location.height, - chainPoint : this._chainPoint, + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: this._location.x, + y: this.subPixelOptimize(this._location.y, lineStyle.width), + width: this._location.x2 - this._location.x, + height: this._location.height, + chainPoint: this._chainPoint, brushType:'both', - strokeColor : lineStyle.color, - lineWidth : lineStyle.width, - lineType : lineStyle.type + strokeColor: lineStyle.color, + lineWidth: lineStyle.width, + lineType: lineStyle.type }, - hoverable : false, - clickable : true, - onclick : this._onclick + hoverable: false, + clickable: true, + onclick: this._onclick }; this._timelineShae = new ChainShape(this._timelineShae); @@ -502,32 +566,33 @@ define(function (require) { /** * 构建拖拽手柄 */ - _buildHandle : function () { + _buildHandle: function () { var curPoint = this._chainPoint[this.currentIndex]; var symbolSize = curPoint.symbolSize + 1; symbolSize = symbolSize < 5 ? 5 : symbolSize; this._handleShape = { - zlevel : this._zlevelBase + 1, - hoverable : false, - draggable : true, - style : { - iconType : 'diamond', - n : curPoint.n, - x : curPoint.x - symbolSize, - y : this._location.y + this._location.height / 4 - symbolSize, - width : symbolSize * 2, - height : symbolSize * 2, + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + hoverable: false, + draggable: true, + style: { + iconType: 'diamond', + n: curPoint.n, + x: curPoint.x - symbolSize, + y: this._location.y + this._location.height / 4 - symbolSize, + width: symbolSize * 2, + height: symbolSize * 2, brushType:'both', - textPosition : 'specific', - textX : curPoint.x, - textY : this._location.y - this._location.height / 4, - textAlign : 'center', - textBaseline : 'middle' + textPosition: 'specific', + textX: curPoint.x, + textY: this._location.y - this._location.height / 4, + textAlign: 'center', + textBaseline: 'middle' }, - highlightStyle : {}, - ondrift : this._ondrift, - ondragend : this._ondragend + highlightStyle: {}, + ondrift: this._ondrift, + ondragend: this._ondragend }; this._handleShape = new IconShape(this._handleShape); @@ -537,7 +602,7 @@ define(function (require) { /** * 同步拖拽图形样式 */ - _syncHandleShape : function() { + _syncHandleShape: function() { if (!this.timelineOption.show) { return; } @@ -550,7 +615,7 @@ define(function (require) { this._handleShape.style.textFont = curPoint.textFont; this._handleShape.style.n = curPoint.n; - if (cpStyle.symbol == 'auto') { + if (cpStyle.symbol === 'auto') { this._handleShape.style.iconType = curPoint.symbol != 'none' ? curPoint.symbol : 'diamond'; } @@ -563,7 +628,7 @@ define(function (require) { } var symbolSize; - if (cpStyle.symbolSize == 'auto') { + if (cpStyle.symbolSize === 'auto') { symbolSize = curPoint.symbolSize + 2; symbolSize = symbolSize < 5 ? 5 : symbolSize; } @@ -571,20 +636,20 @@ define(function (require) { symbolSize = cpStyle.symbolSize - 0; } - this._handleShape.style.color = cpStyle.color == 'auto' + this._handleShape.style.color = cpStyle.color === 'auto' ? (curPoint.color ? curPoint.color : timelineOption.controlStyle.emphasis.color ) : cpStyle.color; - this._handleShape.style.textColor = cpStyle.label.textStyle.color == 'auto' + this._handleShape.style.textColor = cpStyle.label.textStyle.color === 'auto' ? this._handleShape.style.color : cpStyle.label.textStyle.color; this._handleShape.highlightStyle.strokeColor = - this._handleShape.style.strokeColor = cpStyle.borderColor == 'auto' + this._handleShape.style.strokeColor = cpStyle.borderColor === 'auto' ? (curPoint.borderColor ? curPoint.borderColor : '#fff') : cpStyle.borderColor; - this._handleShape.style.lineWidth = cpStyle.borderWidth == 'auto' + this._handleShape.style.lineWidth = cpStyle.borderWidth === 'auto' ? (curPoint.borderWidth ? curPoint.borderWidth : 0) : (cpStyle.borderWidth - 0); this._handleShape.highlightStyle.lineWidth = this._handleShape.style.lineWidth + 1; @@ -593,17 +658,17 @@ define(function (require) { .when( 500, { - x : curPoint.x - symbolSize, - textX : curPoint.x, - y : this._location.y + this._location.height / 4 - symbolSize, - width : symbolSize * 2, - height : symbolSize * 2 + x: curPoint.x - symbolSize, + textX: curPoint.x, + y: this._location.y + this._location.height / 4 - symbolSize, + width: symbolSize * 2, + height: symbolSize * 2 } ) .start('ExponentialOut'); }, - _findChainIndex : function(x) { + _findChainIndex: function(x) { var chainPoint = this._chainPoint; var len = chainPoint.length; if (x <= chainPoint[0].x) { @@ -621,10 +686,10 @@ define(function (require) { } }, - __onclick : function(param) { + __onclick: function(param) { var x = zrEvent.getX(param.event); var newIndex = this._findChainIndex(x); - if (newIndex == this.currentIndex) { + if (newIndex === this.currentIndex) { return true; // 啥事都没发生 } @@ -637,7 +702,7 @@ define(function (require) { /** * 拖拽范围控制 */ - __ondrift : function (shape, dx) { + __ondrift: function (shape, dx) { this.timelineOption.autoPlay && this.stop(); // 停止自动播放 var chainPoint = this._chainPoint; @@ -666,7 +731,7 @@ define(function (require) { shape.style.text = curPoint.name; //console.log(newIndex) - if (newIndex == this.currentIndex) { + if (newIndex === this.currentIndex) { return true; // 啥事都没发生 } @@ -682,14 +747,14 @@ define(function (require) { return true; }, - __ondragend : function () { + __ondragend: function () { this.isDragend = true; }, /** * 数据项被拖拽出去 */ - ondragend : function (param, status) { + ondragend: function (param, status) { if (!this.isDragend || !param.target) { // 没有在当前实例上发生拖拽行为则直接返回 return; @@ -706,7 +771,7 @@ define(function (require) { return; }, - last : function () { + last: function () { this.timelineOption.autoPlay && this.stop(); // 停止自动播放 this.currentIndex -= 1; @@ -718,7 +783,7 @@ define(function (require) { return this.currentIndex; }, - next : function () { + next: function () { this.timelineOption.autoPlay && this.stop(); // 停止自动播放 this.currentIndex += 1; @@ -730,23 +795,21 @@ define(function (require) { return this.currentIndex; }, - play : function (targetIndex, autoPlay) { + play: function (targetIndex, autoPlay) { if (this._ctrPlayShape && this._ctrPlayShape.style.status != 'playing') { this._ctrPlayShape.style.status = 'playing'; this.zr.modShape(this._ctrPlayShape.id); - this.zr.refresh(); + this.zr.refreshNextFrame(); } - this.timelineOption.autoPlay = typeof autoPlay != 'undefined' - ? autoPlay : true; + this.timelineOption.autoPlay = autoPlay != null ? autoPlay : true; if (!this.timelineOption.autoPlay) { clearTimeout(this.playTicket); } - this.currentIndex = typeof targetIndex != 'undefined' - ? targetIndex : (this.currentIndex + 1); + this.currentIndex = targetIndex != null ? targetIndex : (this.currentIndex + 1); if (this.currentIndex >= this.timelineOption.data.length) { this.currentIndex = 0; } @@ -755,11 +818,11 @@ define(function (require) { return this.currentIndex; }, - stop : function () { + stop: function () { if (this._ctrPlayShape && this._ctrPlayShape.style.status != 'stop') { this._ctrPlayShape.style.status = 'stop'; this.zr.modShape(this._ctrPlayShape.id); - this.zr.refresh(); + this.zr.refreshNextFrame(); } this.timelineOption.autoPlay = false; @@ -772,7 +835,7 @@ define(function (require) { /** * 避免dataZoom带来两次refresh,不设refresh接口,resize重复一下buildshape逻辑 */ - resize : function () { + resize: function () { if (this.timelineOption.show) { this.clear(); this._buildShape(); @@ -780,21 +843,19 @@ define(function (require) { } }, - setTheme : function(needRefresh) { + setTheme: function(needRefresh) { this.timelineOption = this.reformOption(zrUtil.clone(this.option.timeline)); - // 补全padding属性 - this.timelineOption.padding = this.reformCssArray( - this.timelineOption.padding - ); // 通用字体设置 - this.timelineOption.label.textStyle = zrUtil.merge( - this.timelineOption.label.textStyle || {}, - this.ecTheme.textStyle + this.timelineOption.label.textStyle = this.getTextStyle( + this.timelineOption.label.textStyle ); - this.timelineOption.checkpointStyle.label.textStyle = zrUtil.merge( - this.timelineOption.checkpointStyle.label.textStyle || {}, - this.ecTheme.textStyle + this.timelineOption.checkpointStyle.label.textStyle = this.getTextStyle( + this.timelineOption.checkpointStyle.label.textStyle ); + if (!this.myChart.canvasSupported) { + // 不支持Canvas的强制关闭实时动画 + this.timelineOption.realtime = false; + } if (this.timelineOption.show && needRefresh) { this.clear(); @@ -806,10 +867,7 @@ define(function (require) { /** * 释放后实例不可用,重载基类方法 */ - dispose : function () { - this.clear(); - this.shapeList = null; - + onbeforDispose: function () { clearTimeout(this.playTicket); } }; @@ -823,7 +881,7 @@ define(function (require) { var symbol = style.symbol; - if (symbol == 'last') { + if (symbol === 'last') { ctx.moveTo(x + width - 2, y + height / 3); ctx.lineTo(x + width - 2, y); ctx.lineTo(x + 2, y + height / 2); @@ -832,7 +890,7 @@ define(function (require) { ctx.moveTo(x, y); ctx.lineTo(x, y); } - else if (symbol == 'next') { + else if (symbol === 'next') { ctx.moveTo(x + 2, y + height / 3); ctx.lineTo(x + 2, y); ctx.lineTo(x + width - 2, y + height / 2); @@ -841,15 +899,15 @@ define(function (require) { ctx.moveTo(x, y); ctx.lineTo(x, y); } - else if (symbol == 'play') { - if (style.status == 'stop') { + else if (symbol === 'play') { + if (style.status === 'stop') { ctx.moveTo(x + 2, y); ctx.lineTo(x + width - 2, y + height / 2); ctx.lineTo(x + 2, y + height); ctx.lineTo(x + 2, y); } else { - var delta = style.brushType == 'both' ? 2 : 3; + var delta = style.brushType === 'both' ? 2 : 3; ctx.rect(x + 2, y, delta, height); ctx.rect(x + width - delta - 2, y, delta, height); } @@ -861,11 +919,11 @@ define(function (require) { ); symbol = IconShape.prototype.iconLibrary.image; symbol(ctx, { - x : x, - y : y, - width : width, - height : height, - image : imageLocation + x: x, + y: y, + width: width, + height: height, + image: imageLocation }); } } diff --git a/amd/component/title.js b/amd/component/title.js index 8157d1f..71a75ff 100644 --- a/amd/component/title.js +++ b/amd/component/title.js @@ -2,7 +2,7 @@ * echarts组件:图表标题 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ define(function (require) { @@ -13,6 +13,40 @@ define(function (require) { var RectangleShape = require('../zrender/shape/Rectangle'); var ecConfig = require('../config'); + // 图表标题 + ecConfig.title = { + zlevel: 0, // 一级层叠 + z: 6, // 二级层叠 + show: true, + text: '', + // link: null, // 超链接跳转 + // target: null, // 仅支持self | blank + subtext: '', + // sublink: null, // 超链接跳转 + // subtarget: null, // 仅支持self | blank + x: 'left', // 水平安放位置,默认为左对齐,可选为: + // 'center' ¦ 'left' ¦ 'right' + // ¦ {number}(x坐标,单位px) + y: 'top', // 垂直安放位置,默认为全图顶端,可选为: + // 'top' ¦ 'bottom' ¦ 'center' + // ¦ {number}(y坐标,单位px) + //textAlign: null // 水平对齐方式,默认根据x设置自动调整 + backgroundColor: 'rgba(0,0,0,0)', + borderColor: '#ccc', // 标题边框颜色 + borderWidth: 0, // 标题边框线宽,单位px,默认为0(无边框) + padding: 5, // 标题内边距,单位px,默认各方向内边距为5, + // 接受数组分别设定上右下左边距,同css + itemGap: 5, // 主副标题纵向间隔,单位px,默认为10, + textStyle: { + fontSize: 18, + fontWeight: 'bolder', + color: '#333' // 主标题文字颜色 + }, + subtextStyle: { + color: '#aaa' // 副标题文字颜色 + } + }; + var zrUtil = require('../zrender/tool/util'); var zrArea = require('../zrender/tool/area'); var zrColor = require('../zrender/tool/color'); @@ -30,8 +64,11 @@ define(function (require) { } Title.prototype = { - type : ecConfig.COMPONENT_TYPE_TITLE, - _buildShape : function () { + type: ecConfig.COMPONENT_TYPE_TITLE, + _buildShape: function () { + if (!this.titleOption.show) { + return; + } // 标题元素组的位置参数,通过计算所得x, y, width, height this._itemGroupLocation = this._getItemGroupLocation(); @@ -46,7 +83,7 @@ define(function (require) { /** * 构建所有标题元素 */ - _buildItem : function () { + _buildItem: function () { var text = this.titleOption.text; var link = this.titleOption.link; var target = this.titleOption.target; @@ -62,16 +99,17 @@ define(function (require) { var height = this._itemGroupLocation.height; var textShape = { - zlevel : this._zlevelBase, - style : { - y : y, - color : this.titleOption.textStyle.color, + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + y: y, + color: this.titleOption.textStyle.color, text: text, textFont: font, textBaseline: 'top' }, highlightStyle: { - color : zrColor.lift(this.titleOption.textStyle.color, 1), + color: zrColor.lift(this.titleOption.textStyle.color, 1), brushType: 'fill' }, hoverable: false @@ -90,16 +128,17 @@ define(function (require) { } var subtextShape = { - zlevel : this._zlevelBase, - style : { - y : y + height, - color : this.titleOption.subtextStyle.color, + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + y: y + height, + color: this.titleOption.subtextStyle.color, text: subtext, textFont: subfont, textBaseline: 'bottom' }, highlightStyle: { - color : zrColor.lift(this.titleOption.subtextStyle.color, 1), + color: zrColor.lift(this.titleOption.subtextStyle.color, 1), brushType: 'fill' }, hoverable: false @@ -149,25 +188,22 @@ define(function (require) { subtext !== '' && this.shapeList.push(new TextShape(subtextShape)); }, - _buildBackground : function () { - var pTop = this.titleOption.padding[0]; - var pRight = this.titleOption.padding[1]; - var pBottom = this.titleOption.padding[2]; - var pLeft = this.titleOption.padding[3]; + _buildBackground: function () { + var padding = this.reformCssArray(this.titleOption.padding); this.shapeList.push(new RectangleShape({ - zlevel : this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), hoverable :false, - style : { - x : this._itemGroupLocation.x - pLeft, - y : this._itemGroupLocation.y - pTop, - width : this._itemGroupLocation.width + pLeft + pRight, - height : this._itemGroupLocation.height + pTop + pBottom, - brushType : this.titleOption.borderWidth === 0 - ? 'fill' : 'both', - color : this.titleOption.backgroundColor, - strokeColor : this.titleOption.borderColor, - lineWidth : this.titleOption.borderWidth + style: { + x: this._itemGroupLocation.x - padding[3], + y: this._itemGroupLocation.y - padding[0], + width: this._itemGroupLocation.width + padding[3] + padding[1], + height: this._itemGroupLocation.height + padding[0] + padding[2], + brushType: this.titleOption.borderWidth === 0 ? 'fill' : 'both', + color: this.titleOption.backgroundColor, + strokeColor: this.titleOption.borderColor, + lineWidth: this.titleOption.borderWidth } })); }, @@ -175,7 +211,8 @@ define(function (require) { /** * 根据选项计算标题实体的位置坐标 */ - _getItemGroupLocation : function () { + _getItemGroupLocation: function () { + var padding = this.reformCssArray(this.titleOption.padding); var text = this.titleOption.text; var subtext = this.titleOption.subtext; var font = this.getFont(this.titleOption.textStyle); @@ -199,12 +236,12 @@ define(function (require) { x = Math.floor((zrWidth - totalWidth) / 2); break; case 'left' : - x = this.titleOption.padding[3] + this.titleOption.borderWidth; + x = padding[3] + this.titleOption.borderWidth; break; case 'right' : x = zrWidth - totalWidth - - this.titleOption.padding[1] + - padding[1] - this.titleOption.borderWidth; break; default : @@ -217,12 +254,12 @@ define(function (require) { var zrHeight = this.zr.getHeight(); switch (this.titleOption.y) { case 'top' : - y = this.titleOption.padding[0] + this.titleOption.borderWidth; + y = padding[0] + this.titleOption.borderWidth; break; case 'bottom' : y = zrHeight - totalHeight - - this.titleOption.padding[2] + - padding[2] - this.titleOption.borderWidth; break; case 'center' : @@ -235,34 +272,27 @@ define(function (require) { } return { - x : x, - y : y, - width : totalWidth, - height : totalHeight + x: x, + y: y, + width: totalWidth, + height: totalHeight }; }, /** * 刷新 */ - refresh : function (newOption) { + refresh: function (newOption) { if (newOption) { this.option = newOption; this.option.title = this.reformOption(this.option.title); - // 补全padding属性 - this.option.title.padding = this.reformCssArray( - this.option.title.padding - ); - this.titleOption = this.option.title; - this.titleOption.textStyle = zrUtil.merge( - this.titleOption.textStyle, - this.ecTheme.textStyle + this.titleOption.textStyle = this.getTextStyle( + this.titleOption.textStyle ); - this.titleOption.subtextStyle = zrUtil.merge( - this.titleOption.subtextStyle, - this.ecTheme.textStyle + this.titleOption.subtextStyle = this.getTextStyle( + this.titleOption.subtextStyle ); } diff --git a/amd/component/toolbox.js b/amd/component/toolbox.js index e36691a..a34c411 100644 --- a/amd/component/toolbox.js +++ b/amd/component/toolbox.js @@ -2,7 +2,7 @@ * echarts组件:工具箱 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ define(function (require) { @@ -15,6 +15,97 @@ define(function (require) { var IconShape = require('../util/shape/Icon'); var ecConfig = require('../config'); + ecConfig.toolbox = { + zlevel: 0, // 一级层叠 + z: 6, // 二级层叠 + show: false, + orient: 'horizontal', // 布局方式,默认为水平布局,可选为: + // 'horizontal' ¦ 'vertical' + x: 'right', // 水平安放位置,默认为全图右对齐,可选为: + // 'center' ¦ 'left' ¦ 'right' + // ¦ {number}(x坐标,单位px) + y: 'top', // 垂直安放位置,默认为全图顶端,可选为: + // 'top' ¦ 'bottom' ¦ 'center' + // ¦ {number}(y坐标,单位px) + color: ['#1e90ff','#22bb22','#4b0082','#d2691e'], + disableColor: '#ddd', + effectiveColor: 'red', + backgroundColor: 'rgba(0,0,0,0)', // 工具箱背景颜色 + borderColor: '#ccc', // 工具箱边框颜色 + borderWidth: 0, // 工具箱边框线宽,单位px,默认为0(无边框) + padding: 5, // 工具箱内边距,单位px,默认各方向内边距为5, + // 接受数组分别设定上右下左边距,同css + itemGap: 10, // 各个item之间的间隔,单位px,默认为10, + // 横向布局时为水平间隔,纵向布局时为纵向间隔 + itemSize: 16, // 工具箱图形宽度 + showTitle: true, + // textStyle: {}, + feature: { + mark: { + show: false, + title: { + mark: '辅助线开关', + markUndo: '删除辅助线', + markClear: '清空辅助线' + }, + lineStyle: { + width: 1, + color: '#1e90ff', + type: 'dashed' + } + }, + dataZoom: { + show: false, + title: { + dataZoom: '区域缩放', + dataZoomReset: '区域缩放后退' + } + }, + dataView: { + show: false, + title: '数据视图', + readOnly: false, + lang: ['数据视图', '关闭', '刷新'] + }, + magicType: { + show: false, + title: { + line: '折线图切换', + bar: '柱形图切换', + stack: '堆积', + tiled: '平铺', + force: '力导向布局图切换', + chord: '和弦图切换', + pie: '饼图切换', + funnel: '漏斗图切换' + }, + /* + option: { + line: {}, + bar: {}, + stack: {}, + tiled: {}, + force: {}, + chord: {}, + pie: {}, + funnel: {} + }, + */ + type: [] // 'line', 'bar', 'stack', 'tiled', 'force', 'chord', 'pie', 'funnel' + }, + restore: { + show: false, + title: '还原' + }, + saveAsImage: { + show: false, + title: '保存为图片', + type: 'png', + lang: ['点击保存'] + } + } + }; + var zrUtil = require('../zrender/tool/util'); var zrConfig = require('../zrender/config'); var zrEvent = require('../zrender/tool/event'); @@ -35,7 +126,7 @@ define(function (require) { this.dom = myChart.dom; this._magicType = {}; - //this._magicMap; + this._magicMap = {}; this._isSilence = false; this._iconList; @@ -44,6 +135,7 @@ define(function (require) { this._featureTitle = {}; // 文字 this._featureIcon = {}; // 图标 this._featureColor = {}; // 颜色 + this._featureOption = {}; this._enableColor = 'red'; this._disableColor = '#ccc'; // this._markStart; @@ -104,8 +196,8 @@ define(function (require) { } Toolbox.prototype = { - type : ecConfig.COMPONENT_TYPE_TOOLBOX, - _buildShape : function () { + type: ecConfig.COMPONENT_TYPE_TOOLBOX, + _buildShape: function () { this._iconList = []; var toolboxOption = this.option.toolbox; this._enableColor = toolboxOption.effectiveColor; @@ -116,28 +208,32 @@ define(function (require) { if (feature[key].show) { switch (key) { case 'mark' : - iconName.push({key : key, name : 'mark'}); - iconName.push({key : key, name : 'markUndo'}); - iconName.push({key : key, name : 'markClear'}); + iconName.push({ key: key, name: 'mark' }); + iconName.push({ key: key, name: 'markUndo' }); + iconName.push({ key: key, name: 'markClear' }); break; case 'magicType' : for (var i = 0, l = feature[key].type.length; i < l; i++) { feature[key].title[feature[key].type[i] + 'Chart'] = feature[key].title[feature[key].type[i]]; - iconName.push({key : key, name : feature[key].type[i] + 'Chart'}); + if (feature[key].option) { + feature[key].option[feature[key].type[i] + 'Chart'] + = feature[key].option[feature[key].type[i]]; + } + iconName.push({ key: key, name: feature[key].type[i] + 'Chart' }); } break; case 'dataZoom' : - iconName.push({key : key, name : 'dataZoom'}); - iconName.push({key : key, name : 'dataZoomReset'}); + iconName.push({ key: key, name: 'dataZoom' }); + iconName.push({ key: key, name: 'dataZoomReset' }); break; case 'saveAsImage' : if (this.canvasSupported) { - iconName.push({key : key, name : 'saveAsImage'}); + iconName.push({ key: key, name: 'saveAsImage' }); } break; default : - iconName.push({key : key, name : key}); + iconName.push({ key: key, name: key }); break; } } @@ -156,6 +252,10 @@ define(function (require) { if (feature[key].color) { this._featureColor[name] = feature[key].color[name] || feature[key].color; } + if (feature[key].option) { + this._featureOption[name] = feature[key].option[name] + || feature[key].option; + } } this._itemGroupLocation = this._getItemGroupLocation(); @@ -178,7 +278,7 @@ define(function (require) { /** * 构建所有图例元素 */ - _buildItem : function () { + _buildItem: function () { var toolboxOption = this.option.toolbox; var iconLength = this._iconList.length; var lastX = this._itemGroupLocation.x; @@ -194,7 +294,7 @@ define(function (require) { var textPosition; var textAlign; var textBaseline; - if (toolboxOption.orient == 'horizontal') { + if (toolboxOption.orient === 'horizontal') { textPosition = this._itemGroupLocation.y / this.zr.getHeight() < 0.5 ? 'bottom' : 'top'; textAlign = this._itemGroupLocation.x / this.zr.getWidth() < 0.5 @@ -205,11 +305,6 @@ define(function (require) { else { textPosition = this._itemGroupLocation.x / this.zr.getWidth() < 0.5 ? 'right' : 'left'; - /* - textAlign = this._itemGroupLocation.x / this.zr.getWidth() < 0.5 - ? 'right' : 'left'; - textBaseline = 'top'; - */ } this._iconShapeMap = {}; @@ -218,31 +313,32 @@ define(function (require) { for (var i = 0; i < iconLength; i++) { // 图形 itemShape = { - type : 'icon', - zlevel : this._zlevelBase, - style : { - x : lastX, - y : lastY, - width : itemSize, - height : itemSize, - iconType : this._iconList[i], - lineWidth : 1, - strokeColor : this._featureColor[this._iconList[i]] - || color[i % color.length], + type: 'icon', + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: lastX, + y: lastY, + width: itemSize, + height: itemSize, + iconType: this._iconList[i], + lineWidth: 1, + strokeColor: this._featureColor[this._iconList[i]] + || color[i % color.length], brushType: 'stroke' }, - highlightStyle : { - lineWidth : 1, - text : toolboxOption.showTitle - ? this._featureTitle[this._iconList[i]] - : undefined, - textFont : textFont, - textPosition : textPosition, - strokeColor : this._featureColor[this._iconList[i]] - || color[i % color.length] + highlightStyle: { + lineWidth: 1, + text: toolboxOption.showTitle + ? this._featureTitle[this._iconList[i]] + : undefined, + textFont: textFont, + textPosition: textPosition, + strokeColor: this._featureColor[this._iconList[i]] + || color[i % color.length] }, - hoverable : true, - clickable : true + hoverable: true, + clickable: true }; if (this._featureIcon[this._iconList[i]]) { @@ -254,25 +350,25 @@ define(function (require) { itemShape.type = 'image'; } - if (toolboxOption.orient == 'horizontal') { + if (toolboxOption.orient === 'horizontal') { // 修正左对齐第一个或右对齐最后一个 - if (i === 0 && textAlign == 'left') { + if (i === 0 && textAlign === 'left') { itemShape.highlightStyle.textPosition = 'specific'; itemShape.highlightStyle.textAlign = textAlign; itemShape.highlightStyle.textBaseline = textBaseline; itemShape.highlightStyle.textX = lastX; - itemShape.highlightStyle.textY = textBaseline == 'top' + itemShape.highlightStyle.textY = textBaseline === 'top' ? lastY + itemSize + 10 : lastY - 10; } - if (i == iconLength - 1 && textAlign == 'right') { + if (i === iconLength - 1 && textAlign === 'right') { itemShape.highlightStyle.textPosition = 'specific'; itemShape.highlightStyle.textAlign = textAlign; itemShape.highlightStyle.textBaseline = textBaseline; itemShape.highlightStyle.textX = lastX + itemSize; - itemShape.highlightStyle.textY = textBaseline == 'top' - ? lastY + itemSize + 10 - : lastY - 10; + itemShape.highlightStyle.textY = textBaseline === 'top' + ? lastY + itemSize + 10 + : lastY - 10; } } @@ -310,11 +406,6 @@ define(function (require) { default: if (this._iconList[i].match('Chart')) { itemShape._name = this._iconList[i].replace('Chart', ''); - /* - if (this._magicType[itemShape._name]) { - itemShape.style.strokeColor = this._enableColor; - } - */ itemShape.onclick = self._onMagicType; } else { @@ -323,16 +414,16 @@ define(function (require) { break; } - if (itemShape.type == 'icon') { + if (itemShape.type === 'icon') { itemShape = new IconShape(itemShape); } - else if (itemShape.type == 'image') { + else if (itemShape.type === 'image') { itemShape = new ImageShape(itemShape); } this.shapeList.push(itemShape); this._iconShapeMap[this._iconList[i]] = itemShape; - if (toolboxOption.orient == 'horizontal') { + if (toolboxOption.orient === 'horizontal') { lastX += itemSize + itemGap; } else { @@ -341,26 +432,23 @@ define(function (require) { } }, - _buildBackground : function () { + _buildBackground: function () { var toolboxOption = this.option.toolbox; - var pTop = toolboxOption.padding[0]; - var pRight = toolboxOption.padding[1]; - var pBottom = toolboxOption.padding[2]; - var pLeft = toolboxOption.padding[3]; + var padding = this.reformCssArray(this.option.toolbox.padding); this.shapeList.push(new RectangleShape({ - zlevel : this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), hoverable :false, - style : { - x : this._itemGroupLocation.x - pLeft, - y : this._itemGroupLocation.y - pTop, - width : this._itemGroupLocation.width + pLeft + pRight, - height : this._itemGroupLocation.height + pTop + pBottom, - brushType : toolboxOption.borderWidth === 0 - ? 'fill' : 'both', - color : toolboxOption.backgroundColor, - strokeColor : toolboxOption.borderColor, - lineWidth : toolboxOption.borderWidth + style: { + x: this._itemGroupLocation.x - padding[3], + y: this._itemGroupLocation.y - padding[0], + width: this._itemGroupLocation.width + padding[3] + padding[1], + height: this._itemGroupLocation.height + padding[0] + padding[2], + brushType: toolboxOption.borderWidth === 0 ? 'fill' : 'both', + color: toolboxOption.backgroundColor, + strokeColor: toolboxOption.borderColor, + lineWidth: toolboxOption.borderWidth } })); }, @@ -368,15 +456,16 @@ define(function (require) { /** * 根据选项计算图例实体的位置坐标 */ - _getItemGroupLocation : function () { + _getItemGroupLocation: function () { var toolboxOption = this.option.toolbox; + var padding = this.reformCssArray(this.option.toolbox.padding); var iconLength = this._iconList.length; var itemGap = toolboxOption.itemGap; var itemSize = toolboxOption.itemSize; var totalWidth = 0; var totalHeight = 0; - if (toolboxOption.orient == 'horizontal') { + if (toolboxOption.orient === 'horizontal') { // 水平布局,计算总宽度,别忘减去最后一个的itemGap totalWidth = (itemSize + itemGap) * iconLength - itemGap; totalHeight = itemSize; @@ -394,12 +483,12 @@ define(function (require) { x = Math.floor((zrWidth - totalWidth) / 2); break; case 'left' : - x = toolboxOption.padding[3] + toolboxOption.borderWidth; + x = padding[3] + toolboxOption.borderWidth; break; case 'right' : x = zrWidth - totalWidth - - toolboxOption.padding[1] + - padding[1] - toolboxOption.borderWidth; break; default : @@ -412,12 +501,12 @@ define(function (require) { var zrHeight = this.zr.getHeight(); switch (toolboxOption.y) { case 'top' : - y = toolboxOption.padding[0] + toolboxOption.borderWidth; + y = padding[0] + toolboxOption.borderWidth; break; case 'bottom' : y = zrHeight - totalHeight - - toolboxOption.padding[2] + - padding[2] - toolboxOption.borderWidth; break; case 'center' : @@ -430,14 +519,14 @@ define(function (require) { } return { - x : x, - y : y, - width : totalWidth, - height : totalHeight + x: x, + y: y, + width: totalWidth, + height: totalHeight }; }, - __onmousemove : function (param) { + __onmousemove: function (param) { if (this._marking) { this._markShape.style.xEnd = zrEvent.getX(param.event); this._markShape.style.yEnd = zrEvent.getY(param.event); @@ -450,6 +539,7 @@ define(function (require) { zrEvent.getY(param.event) - this._zoomShape.style.y; this.zr.addHoverShape(this._zoomShape); this.dom.style.cursor = 'crosshair'; + zrEvent.stop(param.event); } if (this._zoomStart && (this.dom.style.cursor != 'pointer' && this.dom.style.cursor != 'move') @@ -458,7 +548,7 @@ define(function (require) { } }, - __onmousedown : function (param) { + __onmousedown: function (param) { if (param.target) { return; } @@ -467,19 +557,20 @@ define(function (require) { var y = zrEvent.getY(param.event); var zoomOption = this.option.dataZoom || {}; this._zoomShape = new RectangleShape({ - zlevel : this._zlevelBase, - style : { - x : x, - y : y, - width : 1, - height : 1, + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: x, + y: y, + width: 1, + height: 1, brushType: 'both' }, - highlightStyle : { - lineWidth : 2, + highlightStyle: { + lineWidth: 2, color: zoomOption.fillerColor || ecConfig.dataZoom.fillerColor, - strokeColor : zoomOption.handleColor + strokeColor: zoomOption.handleColor || ecConfig.dataZoom.handleColor, brushType: 'both' } @@ -488,7 +579,7 @@ define(function (require) { return true; // 阻塞全局事件 }, - __onmouseup : function (/*param*/) { + __onmouseup: function (/*param*/) { if (!this._zoomShape || Math.abs(this._zoomShape.style.width) < 10 || Math.abs(this._zoomShape.style.height) < 10 @@ -502,19 +593,19 @@ define(function (require) { var zoom = this.component.dataZoom.rectZoom(this._zoomShape.style); if (zoom) { this._zoomQueue.push({ - start : zoom.start, - end : zoom.end, - start2 : zoom.start2, - end2 : zoom.end2 + start: zoom.start, + end: zoom.end, + start2: zoom.start2, + end2: zoom.end2 }); this._iconEnable(this._iconShapeMap['dataZoomReset']); - this.zr.refresh(); + this.zr.refreshNextFrame(); } } return true; // 阻塞全局事件 }, - __onclick : function (param) { + __onclick: function (param) { if (param.target) { return; } @@ -524,50 +615,51 @@ define(function (require) { this._iconEnable(this._iconShapeMap['markUndo']); this._iconEnable(this._iconShapeMap['markClear']); this.zr.addShape(this._markShape); - this.zr.refresh(); + this.zr.refreshNextFrame(); } else if (this._markStart) { this._marking = true; var x = zrEvent.getX(param.event); var y = zrEvent.getY(param.event); this._markShape = new LineShape({ - zlevel : this._zlevelBase, - style : { - xStart : x, - yStart : y, - xEnd : x, - yEnd : y, - lineWidth : this.query( - this.option, - 'toolbox.feature.mark.lineStyle.width' - ), - strokeColor : this.query( - this.option, - 'toolbox.feature.mark.lineStyle.color' - ), - lineType : this.query( + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + xStart: x, + yStart: y, + xEnd: x, + yEnd: y, + lineWidth: this.query( this.option, - 'toolbox.feature.mark.lineStyle.type' - ) + 'toolbox.feature.mark.lineStyle.width' + ), + strokeColor: this.query( + this.option, + 'toolbox.feature.mark.lineStyle.color' + ), + lineType: this.query( + this.option, + 'toolbox.feature.mark.lineStyle.type' + ) } }); this.zr.addHoverShape(this._markShape); } }, - __onMark : function (param) { + __onMark: function (param) { var target = param.target; if (this._marking || this._markStart) { // 取消 this._resetMark(); - this.zr.refresh(); + this.zr.refreshNextFrame(); } else { // 启用Mark this._resetZoom(); // mark与dataZoom互斥 this.zr.modShape(target.id, {style: {strokeColor: this._enableColor}}); - this.zr.refresh(); + this.zr.refreshNextFrame(); this._markStart = true; var self = this; setTimeout(function (){ @@ -579,7 +671,7 @@ define(function (require) { return true; // 阻塞全局事件 }, - __onMarkUndo : function () { + __onMarkUndo: function () { if (this._marking) { this._marking = false; } else { @@ -587,9 +679,9 @@ define(function (require) { if (len >= 1) { var target = this._markShapeList[len - 1]; this.zr.delShape(target.id); - this.zr.refresh(); + this.zr.refreshNextFrame(); this._markShapeList.pop(); - if (len == 1) { + if (len === 1) { this._iconDisable(this._iconShapeMap['markUndo']); this._iconDisable(this._iconShapeMap['markClear']); } @@ -598,7 +690,7 @@ define(function (require) { return true; }, - __onMarkClear : function () { + __onMarkClear: function () { if (this._marking) { this._marking = false; } @@ -609,17 +701,17 @@ define(function (require) { } this._iconDisable(this._iconShapeMap['markUndo']); this._iconDisable(this._iconShapeMap['markClear']); - this.zr.refresh(); + this.zr.refreshNextFrame(); } return true; }, - __onDataZoom : function (param) { + __onDataZoom: function (param) { var target = param.target; if (this._zooming || this._zoomStart) { // 取消 this._resetZoom(); - this.zr.refresh(); + this.zr.refreshNextFrame(); this.dom.style.cursor = 'default'; } else { @@ -627,7 +719,7 @@ define(function (require) { this._resetMark(); // mark与dataZoom互斥 this.zr.modShape(target.id, {style: {strokeColor: this._enableColor}}); - this.zr.refresh(); + this.zr.refreshNextFrame(); this._zoomStart = true; var self = this; setTimeout(function (){ @@ -642,7 +734,7 @@ define(function (require) { return true; // 阻塞全局事件 }, - __onDataZoomReset : function () { + __onDataZoomReset: function () { if (this._zooming) { this._zooming = false; } @@ -656,13 +748,13 @@ define(function (require) { else { this.component.dataZoom.rectZoom(); this._iconDisable(this._iconShapeMap['dataZoomReset']); - this.zr.refresh(); + this.zr.refreshNextFrame(); } return true; }, - _resetMark : function () { + _resetMark: function () { this._marking = false; if (this._markStart) { this._markStart = false; @@ -685,7 +777,7 @@ define(function (require) { } }, - _resetZoom : function () { + _resetZoom: function () { this._zooming = false; if (this._zoomStart) { this._zoomStart = false; @@ -709,61 +801,61 @@ define(function (require) { } }, - _iconDisable : function (target) { + _iconDisable: function (target) { if (target.type != 'image') { this.zr.modShape(target.id, { - hoverable : false, - clickable : false, - style : { - strokeColor : this._disableColor + hoverable: false, + clickable: false, + style: { + strokeColor: this._disableColor } }); } else { this.zr.modShape(target.id, { - hoverable : false, - clickable : false, - style : { - opacity : 0.3 + hoverable: false, + clickable: false, + style: { + opacity: 0.3 } }); } }, - _iconEnable : function (target) { + _iconEnable: function (target) { if (target.type != 'image') { this.zr.modShape(target.id, { - hoverable : true, - clickable : true, - style : { - strokeColor : target.highlightStyle.strokeColor + hoverable: true, + clickable: true, + style: { + strokeColor: target.highlightStyle.strokeColor } }); } else { this.zr.modShape(target.id, { - hoverable : true, - clickable : true, - style : { - opacity : 0.8 + hoverable: true, + clickable: true, + style: { + opacity: 0.8 } }); } }, - __onDataView : function () { + __onDataView: function () { this._dataView.show(this.option); return true; }, - __onRestore : function (){ + __onRestore: function (){ this._resetMark(); this._resetZoom(); this.messageCenter.dispatch(ecConfig.EVENT.RESTORE, null, null, this.myChart); return true; }, - __onSaveAsImage : function () { + __onSaveAsImage: function () { var saveOption = this.option.toolbox.feature.saveAsImage; var imgType = saveOption.type || 'png'; if (imgType != 'png' && imgType != 'jpeg') { @@ -775,7 +867,7 @@ define(function (require) { image = this.zr.toDataURL( 'image/' + imgType, this.option.backgroundColor - && this.option.backgroundColor.replace(' ','') == 'rgba(0,0,0,0)' + && this.option.backgroundColor.replace(' ','') === 'rgba(0,0,0,0)' ? '#fff' : this.option.backgroundColor ); } @@ -810,8 +902,7 @@ define(function (require) { ); downloadLink.innerHTML = ''; @@ -847,30 +938,44 @@ define(function (require) { return; }, - __onMagicType : function (param) { + __onMagicType: function (param) { this._resetMark(); var itemName = param.target._name; if (!this._magicType[itemName]) { // 启用 this._magicType[itemName] = true; // 折柱互斥 - if (itemName == ecConfig.CHART_TYPE_LINE) { + if (itemName === ecConfig.CHART_TYPE_LINE) { this._magicType[ecConfig.CHART_TYPE_BAR] = false; } - else if (itemName == ecConfig.CHART_TYPE_BAR) { + else if (itemName === ecConfig.CHART_TYPE_BAR) { this._magicType[ecConfig.CHART_TYPE_LINE] = false; } + // 饼图漏斗互斥 + if (itemName === ecConfig.CHART_TYPE_PIE) { + this._magicType[ecConfig.CHART_TYPE_FUNNEL] = false; + } + else if (itemName === ecConfig.CHART_TYPE_FUNNEL) { + this._magicType[ecConfig.CHART_TYPE_PIE] = false; + } + // 力导和弦互斥 + if (itemName === ecConfig.CHART_TYPE_FORCE) { + this._magicType[ecConfig.CHART_TYPE_CHORD] = false; + } + else if (itemName === ecConfig.CHART_TYPE_CHORD) { + this._magicType[ecConfig.CHART_TYPE_FORCE] = false; + } // 堆积平铺互斥 - if (itemName == _MAGICTYPE_STACK) { + if (itemName === _MAGICTYPE_STACK) { this._magicType[_MAGICTYPE_TILED] = false; } - else if (itemName == _MAGICTYPE_TILED) { + else if (itemName === _MAGICTYPE_TILED) { this._magicType[_MAGICTYPE_STACK] = false; } this.messageCenter.dispatch( ecConfig.EVENT.MAGIC_TYPE_CHANGED, param.event, - {magicType : this._magicType}, + { magicType: this._magicType }, this.myChart ); } @@ -878,29 +983,29 @@ define(function (require) { return true; }, - setMagicType : function (magicType) { + setMagicType: function (magicType) { this._resetMark(); this._magicType = magicType; !this._isSilence && this.messageCenter.dispatch( ecConfig.EVENT.MAGIC_TYPE_CHANGED, null, - {magicType : this._magicType}, + { magicType: this._magicType }, this.myChart ); }, // 用户自定义扩展toolbox方法 - __onCustomHandler : function (param) { + __onCustomHandler: function (param) { var target = param.target.style.iconType; var featureHandler = this.option.toolbox.feature[target].onclick; if (typeof featureHandler === 'function') { - featureHandler(this.option); + featureHandler.call(this, this.option); } }, // 重置备份还原状态等 - reset : function (newOption, isRestore) { + reset: function (newOption, isRestore) { isRestore && this.clear(); if (this.query(newOption, 'toolbox.show') @@ -922,15 +1027,15 @@ define(function (require) { axis = newOption.xAxis instanceof Array ? newOption.xAxis[newOption.series[len].xAxisIndex || 0] : newOption.xAxis; - if (axis && (axis.type || 'category') == 'category') { - axis.__boundaryGap = typeof axis.boundaryGap != 'undefined' + if (axis && (axis.type || 'category') === 'category') { + axis.__boundaryGap = axis.boundaryGap != null ? axis.boundaryGap : true; } axis = newOption.yAxis instanceof Array ? newOption.yAxis[newOption.series[len].yAxisIndex || 0] : newOption.yAxis; - if (axis && axis.type == 'category') { - axis.__boundaryGap = typeof axis.boundaryGap != 'undefined' + if (axis && axis.type === 'category') { + axis.__boundaryGap = axis.boundaryGap != null ? axis.boundaryGap : true; } newOption.series[len].__type = oriType; @@ -958,11 +1063,11 @@ define(function (require) { // 框选缩放 var zoomOption = newOption.dataZoom; if (zoomOption && zoomOption.show) { - var start = typeof zoomOption.start != 'undefined' + var start = zoomOption.start != null && zoomOption.start >= 0 && zoomOption.start <= 100 ? zoomOption.start : 0; - var end = typeof zoomOption.end != 'undefined' + var end = zoomOption.end != null && zoomOption.end >= 0 && zoomOption.end <= 100 ? zoomOption.end : 100; @@ -973,10 +1078,10 @@ define(function (require) { start = start - end; } this._zoomQueue = [{ - start : start, - end : end, - start2 : 0, - end2 : 100 + start: start, + end: end, + start2: 0, + end2: 100 }]; } else { @@ -984,61 +1089,92 @@ define(function (require) { } }, - getMagicOption : function (){ + getMagicOption: function (){ var axis; + var chartType; if (this._magicType[ecConfig.CHART_TYPE_LINE] || this._magicType[ecConfig.CHART_TYPE_BAR] ) { - // 图表类型有切换 + // 图表类型有折柱切换 var boundaryGap = this._magicType[ecConfig.CHART_TYPE_LINE] ? false : true; for (var i = 0, l = this.option.series.length; i < l; i++) { - if (this._magicMap[this.option.series[i].type]) { - this.option.series[i].type = this._magicType[ecConfig.CHART_TYPE_LINE] - ? ecConfig.CHART_TYPE_LINE - : ecConfig.CHART_TYPE_BAR; - // 避免不同类型图表类型的样式污染 - this.option.series[i].itemStyle = zrUtil.clone( - this.option.series[i].__itemStyle - ); - + chartType = this.option.series[i].type; + if (chartType == ecConfig.CHART_TYPE_LINE + || chartType == ecConfig.CHART_TYPE_BAR + ) { axis = this.option.xAxis instanceof Array ? this.option.xAxis[this.option.series[i].xAxisIndex || 0] : this.option.xAxis; - if (axis && (axis.type || 'category') == 'category') { + if (axis && (axis.type || 'category') === 'category') { axis.boundaryGap = boundaryGap ? true : axis.__boundaryGap; } axis = this.option.yAxis instanceof Array ? this.option.yAxis[this.option.series[i].yAxisIndex || 0] : this.option.yAxis; - if (axis && axis.type == 'category') { + if (axis && axis.type === 'category') { axis.boundaryGap = boundaryGap ? true : axis.__boundaryGap; } } } + + this._defaultMagic(ecConfig.CHART_TYPE_LINE, ecConfig.CHART_TYPE_BAR); } - + this._defaultMagic(ecConfig.CHART_TYPE_CHORD, ecConfig.CHART_TYPE_FORCE); + this._defaultMagic(ecConfig.CHART_TYPE_PIE, ecConfig.CHART_TYPE_FUNNEL); + if (this._magicType[_MAGICTYPE_STACK] || this._magicType[_MAGICTYPE_TILED]) { // 有堆积平铺切换 for (var i = 0, l = this.option.series.length; i < l; i++) { if (this._magicType[_MAGICTYPE_STACK]) { // 启用堆积 this.option.series[i].stack = '_ECHARTS_STACK_KENER_2014_'; + chartType = _MAGICTYPE_STACK; } else if (this._magicType[_MAGICTYPE_TILED]) { // 启用平铺 this.option.series[i].stack = null; + chartType = _MAGICTYPE_TILED; + } + if (this._featureOption[chartType + 'Chart']) { + zrUtil.merge( + this.option.series[i], + this._featureOption[chartType + 'Chart'] || {}, + true + ); } } } - return this.option; }, + + _defaultMagic : function(cType1, cType2) { + if (this._magicType[cType1] || this._magicType[cType2]) { + for (var i = 0, l = this.option.series.length; i < l; i++) { + var chartType = this.option.series[i].type; + if (chartType == cType1 || chartType == cType2) { + this.option.series[i].type = this._magicType[cType1] ? cType1 : cType2; + // 避免不同类型图表类型的样式污染 + this.option.series[i].itemStyle = zrUtil.clone( + this.option.series[i].__itemStyle + ); + chartType = this.option.series[i].type; + if (this._featureOption[chartType + 'Chart']) { + zrUtil.merge( + this.option.series[i], + this._featureOption[chartType + 'Chart'] || {}, + true + ); + } + } + } + } + }, - silence : function (s) { + silence: function (s) { this._isSilence = s; }, - resize : function () { + resize: function () { this._resetMark(); this.clear(); if (this.option && this.option.toolbox && this.option.toolbox.show) { @@ -1049,13 +1185,13 @@ define(function (require) { } }, - hideDataView : function () { + hideDataView: function () { if (this._dataView) { this._dataView.hide(); } }, - clear : function(notMark) { + clear: function(notMark) { if (this.zr) { this.zr.delShape(this.shapeList); this.shapeList = []; @@ -1070,29 +1206,23 @@ define(function (require) { /** * 释放后实例不可用 */ - dispose : function () { + onbeforDispose: function () { if (this._dataView) { this._dataView.dispose(); this._dataView = null; } - this.clear(); - this.shapeList = null; this._markShapeList = null; }, /** * 刷新 */ - refresh : function (newOption) { + refresh: function (newOption) { if (newOption) { this._resetMark(); this._resetZoom(); newOption.toolbox = this.reformOption(newOption.toolbox); - // 补全padding属性 - newOption.toolbox.padding = this.reformCssArray( - newOption.toolbox.padding - ); this.option = newOption; this.clear(true); diff --git a/amd/component/tooltip.js b/amd/component/tooltip.js index 63d4fbd..56d8654 100644 --- a/amd/component/tooltip.js +++ b/amd/component/tooltip.js @@ -2,7 +2,7 @@ * echarts组件:提示框 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ define(function (require) { @@ -15,6 +15,49 @@ define(function (require) { var rectangleInstance = new RectangleShape({}); var ecConfig = require('../config'); + // 提示框 + ecConfig.tooltip = { + zlevel: 1, // 一级层叠,频繁变化的tooltip指示器在pc上独立一层 + z: 8, // 二级层叠 + show: true, + showContent: true, // tooltip主体内容 + trigger: 'item', // 触发类型,默认数据触发,见下图,可选为:'item' ¦ 'axis' + // position: null // 位置 {Array} | {Function} + // formatter: null // 内容格式器:{string}(Template) ¦ {Function} + islandFormatter: '{a}
{b} : {c}', // 数据孤岛内容格式器 + showDelay: 20, // 显示延迟,添加显示延迟可以避免频繁切换,单位ms + hideDelay: 100, // 隐藏延迟,单位ms + transitionDuration: 0.4, // 动画变换时间,单位s + enterable: false, + backgroundColor: 'rgba(0,0,0,0.7)', // 提示背景颜色,默认为透明度为0.7的黑色 + borderColor: '#333', // 提示边框颜色 + borderRadius: 4, // 提示边框圆角,单位px,默认为4 + borderWidth: 0, // 提示边框线宽,单位px,默认为0(无边框) + padding: 5, // 提示内边距,单位px,默认各方向内边距为5, + // 接受数组分别设定上右下左边距,同css + axisPointer: { // 坐标轴指示器,坐标轴触发有效 + type: 'line', // 默认为直线,可选为:'line' | 'shadow' | 'cross' + lineStyle: { // 直线指示器样式设置 + color: '#48b', + width: 2, + type: 'solid' + }, + crossStyle: { + color: '#1e90ff', + width: 1, + type: 'dashed' + }, + shadowStyle: { // 阴影指示器样式设置 + color: 'rgba(150,150,150,0.3)', // 阴影颜色 + width: 'auto', // 阴影大小 + type: 'default' + } + }, + textStyle: { + color: '#fff' + } + }; + var ecData = require('../util/ecData'); var zrConfig = require('../zrender/config'); var zrEvent = require('../zrender/tool/event'); @@ -66,13 +109,21 @@ define(function (require) { this._tDom.onselectstart = function() { return false; }; + this._tDom.onmouseover = function() { + self._mousein = true; + }; + this._tDom.onmouseout = function() { + self._mousein = false; + }; + this._tDom.className = 'echarts-tooltip'; this._tDom.style.position = 'absolute'; // 不是多余的,别删! this.hasAppend = false; this._axisLineShape && this.zr.delShape(this._axisLineShape.id); this._axisLineShape = new LineShape({ - zlevel: this._zlevelBase, - invisible : true, + zlevel: this.getZlevelBase(), + z: this.getZBase(), + invisible: true, hoverable: false }); this.shapeList.push(this._axisLineShape); @@ -80,8 +131,9 @@ define(function (require) { this._axisShadowShape && this.zr.delShape(this._axisShadowShape.id); this._axisShadowShape = new LineShape({ - zlevel: 1, // grid上,chart下 - invisible : true, + zlevel: this.getZlevelBase(), + z: 1, // grid上,chart下 + invisible: true, hoverable: false }); this.shapeList.push(this._axisShadowShape); @@ -89,8 +141,9 @@ define(function (require) { this._axisCrossShape && this.zr.delShape(this._axisCrossShape.id); this._axisCrossShape = new CrossShape({ - zlevel: this._zlevelBase, - invisible : true, + zlevel: this.getZlevelBase(), + z: this.getZBase(), + invisible: true, hoverable: false }); this.shapeList.push(this._axisCrossShape); @@ -101,16 +154,13 @@ define(function (require) { } Tooltip.prototype = { - type : ecConfig.COMPONENT_TYPE_TOOLTIP, + type: ecConfig.COMPONENT_TYPE_TOOLTIP, // 通用样式 - _gCssText : 'position:absolute;' - + 'display:block;' - + 'border-style:solid;' - + 'white-space:nowrap;', + _gCssText: 'position:absolute;display:block;border-style:solid;white-space:nowrap;', /** * 根据配置设置dom样式 */ - _style : function (opt) { + _style: function (opt) { if (!opt) { return ''; } @@ -143,15 +193,15 @@ define(function (require) { cssText.push('background-Color:' + opt.backgroundColor); } - if (typeof opt.borderWidth != 'undefined') { + if (opt.borderWidth != null) { cssText.push('border-width:' + opt.borderWidth + 'px'); } - if (typeof opt.borderColor != 'undefined') { + if (opt.borderColor != null) { cssText.push('border-color:' + opt.borderColor); } - if (typeof opt.borderRadius != 'undefined') { + if (opt.borderRadius != null) { cssText.push( 'border-radius:' + opt.borderRadius + 'px' ); @@ -194,7 +244,7 @@ define(function (require) { var padding = opt.padding; - if (typeof padding != 'undefined') { + if (padding != null) { padding = this.reformCssArray(padding); cssText.push( 'padding:' + padding[0] + 'px ' @@ -209,7 +259,10 @@ define(function (require) { return cssText; }, - __hide : function () { + __hide: function () { + this._lastDataIndex = -1; + this._lastSeriesIndex = -1; + this._lastItemTriggerId = -1; if (this._tDom) { this._tDom.style.display = 'none'; } @@ -234,15 +287,15 @@ define(function (require) { this._lastTipShape = false; this.shapeList.length = 2; } - needRefresh && this.zr.refresh(); + needRefresh && this.zr.refreshNextFrame(); this.showing = false; }, - _show : function (position, x, y, specialCssText) { + _show: function (position, x, y, specialCssText) { var domHeight = this._tDom.offsetHeight; var domWidth = this._tDom.offsetWidth; if (position) { - if (typeof position == 'function') { + if (typeof position === 'function') { position = position([x, y]); } if (position instanceof Array) { @@ -275,7 +328,7 @@ define(function (require) { this.showing = true; }, - __refixed : function () { + __refixed: function () { if (this._tDom) { var cssText = ''; var domHeight = this._tDom.offsetHeight; @@ -292,7 +345,7 @@ define(function (require) { } }, - __tryShow : function () { + __tryShow: function () { var needShow; var trigger; if (!this._curTarget) { @@ -301,7 +354,7 @@ define(function (require) { } else { // 数据项事件 - if (this._curTarget._type == 'island' && this.option.tooltip.show) { + if (this._curTarget._type === 'island' && this.option.tooltip.show) { this._showItemTrigger(); return; } @@ -311,10 +364,7 @@ define(function (require) { [data, serie, this.option], 'tooltip.show' ); - if (typeof serie == 'undefined' - || typeof data == 'undefined' - || needShow === false - ) { + if (serie == null || data == null || !needShow) { // 不响应tooltip的数据对象延时隐藏 clearTimeout(this._hidingTicket); clearTimeout(this._showingTicket); @@ -326,12 +376,12 @@ define(function (require) { 'tooltip.trigger' ); - trigger == 'axis' - ? this._showAxisTrigger( - serie.xAxisIndex, serie.yAxisIndex, - ecData.get(this._curTarget, 'dataIndex') - ) - : this._showItemTrigger(); + trigger === 'axis' + ? this._showAxisTrigger( + serie.xAxisIndex, serie.yAxisIndex, + ecData.get(this._curTarget, 'dataIndex') + ) + : this._showItemTrigger(); } } }, @@ -339,7 +389,7 @@ define(function (require) { /** * 直角系 */ - _findAxisTrigger : function () { + _findAxisTrigger: function () { if (!this.component.xAxis || !this.component.yAxis) { this._hidingTicket = setTimeout(this._hide, this._hideDelay); return; @@ -349,15 +399,12 @@ define(function (require) { var yAxisIndex; for (var i = 0, l = series.length; i < l; i++) { // 找到第一个axis触发tooltip的系列 - if (this.deepQuery( - [series[i], this.option], 'tooltip.trigger' - ) == 'axis' - ) { + if (this.deepQuery([series[i], this.option], 'tooltip.trigger') === 'axis') { xAxisIndex = series[i].xAxisIndex || 0; yAxisIndex = series[i].yAxisIndex || 0; if (this.component.xAxis.getAxis(xAxisIndex) && this.component.xAxis.getAxis(xAxisIndex).type - == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY ) { // 横轴为类目轴 this._showAxisTrigger(xAxisIndex, yAxisIndex, @@ -369,7 +416,7 @@ define(function (require) { } else if (this.component.yAxis.getAxis(yAxisIndex) && this.component.yAxis.getAxis(yAxisIndex).type - == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY ) { // 纵轴为类目轴 this._showAxisTrigger(xAxisIndex, yAxisIndex, @@ -386,7 +433,7 @@ define(function (require) { } } } - if (this.option.tooltip.axisPointer.type == 'cross') { + if (this.option.tooltip.axisPointer.type === 'cross') { this._showAxisTrigger(-1, -1, -1); } }, @@ -394,7 +441,7 @@ define(function (require) { /** * 极坐标 */ - _findPolarTrigger : function () { + _findPolarTrigger: function () { if (!this.component.polar) { return false; } @@ -420,34 +467,35 @@ define(function (require) { /** * 根据坐标轴事件带的属性获取最近的axisDataIndex */ - _getNearestDataIndex : function (direction, categoryAxis) { + _getNearestDataIndex: function (direction, categoryAxis) { var dataIndex = -1; var x = zrEvent.getX(this._event); var y = zrEvent.getY(this._event); - if (direction == 'x') { + if (direction === 'x') { // 横轴为类目轴 var left; var right; var xEnd = this.component.grid.getXend(); var curCoord = categoryAxis.getCoordByIndex(dataIndex); while (curCoord < xEnd) { + right = curCoord; if (curCoord <= x) { left = curCoord; } - if (curCoord >= x) { + else { break; } curCoord = categoryAxis.getCoordByIndex(++dataIndex); - right = curCoord; } - if (x - left < right - x) { - dataIndex -= dataIndex !== 0 ? 1 : 0; + if (dataIndex <= 0) { + dataIndex = 0; + } + else if (x - left <= right - x) { + dataIndex -= 1; } else { // 离右边近,看是否为最后一个 - if (typeof categoryAxis.getNameByIndex(dataIndex) - == 'undefined' - ) { + if (categoryAxis.getNameByIndex(dataIndex) == null) { dataIndex -= 1; } } @@ -460,24 +508,25 @@ define(function (require) { var yStart = this.component.grid.getY(); var curCoord = categoryAxis.getCoordByIndex(dataIndex); while (curCoord > yStart) { + top = curCoord; if (curCoord >= y) { bottom = curCoord; } - if (curCoord <= y) { + else { break; } curCoord = categoryAxis.getCoordByIndex(++dataIndex); - top = curCoord; } - if (y - top > bottom - y) { - dataIndex -= dataIndex !== 0 ? 1 : 0; + if (dataIndex <= 0) { + dataIndex = 0; + } + else if (y - top >= bottom - y) { + dataIndex -= 1; } else { // 离上方边近,看是否为最后一个 - if (typeof categoryAxis.getNameByIndex(dataIndex) - == 'undefined' - ) { + if (categoryAxis.getNameByIndex(dataIndex) == null) { dataIndex -= 1; } } @@ -489,17 +538,17 @@ define(function (require) { /** * 直角系 */ - _showAxisTrigger : function (xAxisIndex, yAxisIndex, dataIndex) { + _showAxisTrigger: function (xAxisIndex, yAxisIndex, dataIndex) { !this._event.connectTrigger && this.messageCenter.dispatch( ecConfig.EVENT.TOOLTIP_IN_GRID, this._event, null, this.myChart ); - if (typeof this.component.xAxis == 'undefined' - || typeof this.component.yAxis == 'undefined' - || typeof xAxisIndex == 'undefined' - || typeof yAxisIndex == 'undefined' + if (this.component.xAxis == null + || this.component.yAxis == null + || xAxisIndex == null + || yAxisIndex == null // || dataIndex < 0 ) { // 不响应tooltip的数据对象延时隐藏 @@ -512,33 +561,39 @@ define(function (require) { var seriesArray = []; var seriesIndex = []; var categoryAxis; - var x; - var y; var formatter; var position; var showContent; var specialCssText = ''; - if (this.option.tooltip.trigger == 'axis') { - if (this.option.tooltip.show === false) { + if (this.option.tooltip.trigger === 'axis') { + if (!this.option.tooltip.show) { return; } formatter = this.option.tooltip.formatter; position = this.option.tooltip.position; } - if (xAxisIndex != -1 - && this.component.xAxis.getAxis(xAxisIndex).type - == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY - ) { - // 横轴为类目轴,找到所有用这条横轴并且axis触发的系列数据 - categoryAxis = this.component.xAxis.getAxis(xAxisIndex); + var axisLayout = xAxisIndex != -1 + && this.component.xAxis.getAxis(xAxisIndex).type + === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + ? 'xAxis' // 横轴为类目轴,找到所有用这条横轴并且axis触发的系列数据 + : yAxisIndex != -1 + && this.component.yAxis.getAxis(yAxisIndex).type + === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + ? 'yAxis' // 纵轴为类目轴,找到所有用这条纵轴并且axis触发的系列数据 + : false; + var x; + var y; + if (axisLayout) { + var axisIndex = axisLayout == 'xAxis' ? xAxisIndex : yAxisIndex; + categoryAxis = this.component[axisLayout].getAxis(axisIndex); for (var i = 0, l = series.length; i < l; i++) { if (!this._isSelected(series[i].name)) { continue; } - if (series[i].xAxisIndex == xAxisIndex - && this.deepQuery([series[i], this.option], 'tooltip.trigger') == 'axis' + if (series[i][axisLayout + 'Index'] === axisIndex + && this.deepQuery([series[i], this.option], 'tooltip.trigger') === 'axis' ) { showContent = this.query(series[i], 'tooltip.showContent') || showContent; @@ -548,75 +603,54 @@ define(function (require) { || position; specialCssText += this._style(this.query(series[i], 'tooltip')); - seriesArray.push(series[i]); - seriesIndex.push(i); + if (series[i].stack != null && axisLayout == 'xAxis') { + seriesArray.unshift(series[i]); + seriesIndex.unshift(i); + } + else { + seriesArray.push(series[i]); + seriesIndex.push(i); + } } } + // 寻找高亮元素 this.messageCenter.dispatch( ecConfig.EVENT.TOOLTIP_HOVER, this._event, { - seriesIndex : seriesIndex, - dataIndex : dataIndex + seriesIndex: seriesIndex, + dataIndex: dataIndex }, this.myChart ); - y = zrEvent.getY(this._event); - x = this.subPixelOptimize( - categoryAxis.getCoordByIndex(dataIndex), - this._axisLineWidth - ); - this._styleAxisPointer( - seriesArray, - x, this.component.grid.getY(), - x, this.component.grid.getYend(), - categoryAxis.getGap(), x, y - ); - } - else if (yAxisIndex != -1 - && this.component.yAxis.getAxis(yAxisIndex).type - == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY - ) { - // 纵轴为类目轴,找到所有用这条纵轴并且axis触发的系列数据 - categoryAxis = this.component.yAxis.getAxis(yAxisIndex); - for (var i = 0, l = series.length; i < l; i++) { - if (!this._isSelected(series[i].name)) { - continue; - } - if (series[i].yAxisIndex == yAxisIndex - && this.deepQuery([series[i], this.option], 'tooltip.trigger') == 'axis' - ) { - showContent = this.query(series[i], 'tooltip.showContent') - || showContent; - formatter = this.query(series[i], 'tooltip.formatter') - || formatter; - position = this.query(series[i], 'tooltip.position') - || position; - specialCssText += this._style(this.query(series[i], 'tooltip')); - seriesArray.push(series[i]); - seriesIndex.push(i); - } + + var rect; + if (axisLayout == 'xAxis') { + x = this.subPixelOptimize( + categoryAxis.getCoordByIndex(dataIndex), + this._axisLineWidth + ); + y = zrEvent.getY(this._event); + rect = [ + x, this.component.grid.getY(), + x, this.component.grid.getYend() + ]; + } + else { + x = zrEvent.getX(this._event); + y = this.subPixelOptimize( + categoryAxis.getCoordByIndex(dataIndex), + this._axisLineWidth + ); + rect = [ + this.component.grid.getX(), y, + this.component.grid.getXend(), y + ]; } - // 寻找高亮元素 - this.messageCenter.dispatch( - ecConfig.EVENT.TOOLTIP_HOVER, - this._event, - { - seriesIndex : seriesIndex, - dataIndex : dataIndex - }, - this.myChart - ); - x = zrEvent.getX(this._event); - y = this.subPixelOptimize( - categoryAxis.getCoordByIndex(dataIndex), - this._axisLineWidth - ); this._styleAxisPointer( seriesArray, - this.component.grid.getX(), y, - this.component.grid.getXend(), y, + rect[0], rect[1], rect[2], rect[3], categoryAxis.getGap(), x, y ); } @@ -631,7 +665,7 @@ define(function (require) { 0, x, y ); if (dataIndex >= 0) { - this._showItemTrigger(); + this._showItemTrigger(true); } else { clearTimeout(this._hidingTicket); @@ -641,78 +675,84 @@ define(function (require) { } if (seriesArray.length > 0) { - var data; - if (typeof formatter == 'function') { - var params = []; - for (var i = 0, l = seriesArray.length; i < l; i++) { - data = seriesArray[i].data[dataIndex]; - data = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; - - params.push([ - seriesArray[i].name || '', - categoryAxis.getNameByIndex(dataIndex), - data - ]); - } - this._curTicket = 'axis:' + dataIndex; - this._tDom.innerHTML = formatter.call( - this.myChart, params, this._curTicket, this._setContent - ); - } - else if (typeof formatter == 'string') { - this._curTicket = NaN; - formatter = formatter.replace('{a}','{a0}') - .replace('{b}','{b0}') - .replace('{c}','{c0}'); - for (var i = 0, l = seriesArray.length; i < l; i++) { - formatter = formatter.replace( - '{a' + i + '}', - this._encodeHTML(seriesArray[i].name || '') - ); - formatter = formatter.replace( - '{b' + i + '}', - this._encodeHTML(categoryAxis.getNameByIndex(dataIndex)) - ); - data = seriesArray[i].data[dataIndex]; - data = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; - formatter = formatter.replace( - '{c' + i + '}', - data instanceof Array - ? data : this.numAddCommas(data) + // 复位item trigger和axis trigger间短距离来回变换时的不响应 + this._lastItemTriggerId = -1; + // 相同dataIndex seriesIndex时不再触发内容更新 + if (this._lastDataIndex != dataIndex || this._lastSeriesIndex != seriesIndex[0]) { + this._lastDataIndex = dataIndex; + this._lastSeriesIndex = seriesIndex[0]; + var data; + var value; + if (typeof formatter === 'function') { + var params = []; + for (var i = 0, l = seriesArray.length; i < l; i++) { + data = seriesArray[i].data[dataIndex]; + value = this.getDataFromOption(data, '-'); + + params.push({ + seriesIndex: seriesIndex[i], + seriesName: seriesArray[i].name || '', + series: seriesArray[i], + dataIndex: dataIndex, + data: data, + name: categoryAxis.getNameByIndex(dataIndex), + value: value, + // 向下兼容 + 0: seriesArray[i].name || '', + 1: categoryAxis.getNameByIndex(dataIndex), + 2: value, + 3: data + }); + } + this._curTicket = 'axis:' + dataIndex; + this._tDom.innerHTML = formatter.call( + this.myChart, params, this._curTicket, this._setContent ); } - this._tDom.innerHTML = formatter; - } - else { - this._curTicket = NaN; - formatter = this._encodeHTML( - categoryAxis.getNameByIndex(dataIndex) - ); - - for (var i = 0, l = seriesArray.length; i < l; i++) { - formatter += '
' - + this._encodeHTML(seriesArray[i].name || '') - + ' : '; - data = seriesArray[i].data[dataIndex]; - data = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; - formatter += data instanceof Array - ? data : this.numAddCommas(data); + else if (typeof formatter === 'string') { + this._curTicket = NaN; + formatter = formatter.replace('{a}','{a0}') + .replace('{b}','{b0}') + .replace('{c}','{c0}'); + for (var i = 0, l = seriesArray.length; i < l; i++) { + formatter = formatter.replace( + '{a' + i + '}', + this._encodeHTML(seriesArray[i].name || '') + ); + formatter = formatter.replace( + '{b' + i + '}', + this._encodeHTML(categoryAxis.getNameByIndex(dataIndex)) + ); + data = seriesArray[i].data[dataIndex]; + data = this.getDataFromOption(data, '-'); + formatter = formatter.replace( + '{c' + i + '}', + data instanceof Array + ? data : this.numAddCommas(data) + ); + } + this._tDom.innerHTML = formatter; + } + else { + this._curTicket = NaN; + formatter = this._encodeHTML( + categoryAxis.getNameByIndex(dataIndex) + ); + + for (var i = 0, l = seriesArray.length; i < l; i++) { + formatter += '
' + + this._encodeHTML(seriesArray[i].name || '') + + ' : '; + data = seriesArray[i].data[dataIndex]; + data = this.getDataFromOption(data, '-'); + formatter += data instanceof Array + ? data : this.numAddCommas(data); + } + this._tDom.innerHTML = formatter; } - this._tDom.innerHTML = formatter; } + // don't modify, just false, showContent == undefined == true if (showContent === false || !this.option.tooltip.showContent) { // 只用tooltip的行为,不显示主体 return; @@ -731,23 +771,24 @@ define(function (require) { /** * 极坐标 */ - _showPolarTrigger : function (polarIndex, dataIndex) { - if (typeof this.component.polar == 'undefined' - || typeof polarIndex == 'undefined' - || typeof dataIndex == 'undefined' + _showPolarTrigger: function (polarIndex, dataIndex) { + if (this.component.polar == null + || polarIndex == null + || dataIndex == null || dataIndex < 0 ) { return false; } var series = this.option.series; var seriesArray = []; + var seriesIndex = []; var formatter; var position; var showContent; var specialCssText = ''; - if (this.option.tooltip.trigger == 'axis') { - if (this.option.tooltip.show === false) { + if (this.option.tooltip.trigger === 'axis') { + if (!this.option.tooltip.show) { return false; } formatter = this.option.tooltip.formatter; @@ -760,8 +801,8 @@ define(function (require) { if (!this._isSelected(series[i].name)) { continue; } - if (series[i].polarIndex == polarIndex - && this.deepQuery([series[i], this.option], 'tooltip.trigger') == 'axis' + if (series[i].polarIndex === polarIndex + && this.deepQuery([series[i], this.option], 'tooltip.trigger') === 'axis' ) { showContent = this.query(series[i], 'tooltip.showContent') || showContent; @@ -771,11 +812,13 @@ define(function (require) { || position; specialCssText += this._style(this.query(series[i], 'tooltip')); seriesArray.push(series[i]); + seriesIndex.push(i); } } if (seriesArray.length > 0) { var polarData; var data; + var value; var params = []; for (var i = 0, l = seriesArray.length; i < l; i++) { @@ -785,66 +828,83 @@ define(function (require) { if (!this._isSelected(data.name)) { continue; } - data = typeof data != 'undefined' + data = data != null ? data : {name:'', value: {dataIndex:'-'}}; - - params.push([ - seriesArray[i].name || '', - data.name, - typeof data.value[dataIndex].value != 'undefined' - ? data.value[dataIndex].value : data.value[dataIndex], - indicatorName - ]); + value = this.getDataFromOption(data.value[dataIndex]); + params.push({ + seriesIndex: seriesIndex[i], + seriesName: seriesArray[i].name || '', + series: seriesArray[i], + dataIndex: dataIndex, + data: data, + name: data.name, + indicator: indicatorName, + value: value, + // 向下兼容 + 0: seriesArray[i].name || '', + 1: data.name, + 2: value, + 3: indicatorName + }); } } if (params.length <= 0) { return; } - if (typeof formatter == 'function') { - this._curTicket = 'axis:' + dataIndex; - this._tDom.innerHTML = formatter.call( - this.myChart, params, this._curTicket, this._setContent - ); - } - else if (typeof formatter == 'string') { - formatter = formatter.replace('{a}','{a0}') - .replace('{b}','{b0}') - .replace('{c}','{c0}') - .replace('{d}','{d0}'); - for (var i = 0, l = params.length; i < l; i++) { - formatter = formatter.replace( - '{a' + i + '}', - this._encodeHTML(params[i][0]) - ); - formatter = formatter.replace( - '{b' + i + '}', - this._encodeHTML(params[i][1]) - ); - formatter = formatter.replace( - '{c' + i + '}', - this.numAddCommas(params[i][2]) - ); - formatter = formatter.replace( - '{d' + i + '}', - this._encodeHTML(params[i][3]) + // 复位item trigger和axis trigger间短距离来回变换时的不响应 + this._lastItemTriggerId = -1; + + // 相同dataIndex seriesIndex时不再触发内容更新 + if (this._lastDataIndex != dataIndex || this._lastSeriesIndex != seriesIndex[0]) { + this._lastDataIndex = dataIndex; + this._lastSeriesIndex = seriesIndex[0]; + if (typeof formatter === 'function') { + this._curTicket = 'axis:' + dataIndex; + this._tDom.innerHTML = formatter.call( + this.myChart, params, this._curTicket, this._setContent ); } - this._tDom.innerHTML = formatter; - } - else { - formatter = this._encodeHTML(params[0][1]) + '
' - + this._encodeHTML(params[0][3]) + ' : ' - + this.numAddCommas(params[0][2]); - for (var i = 1, l = params.length; i < l; i++) { - formatter += '
' + this._encodeHTML(params[i][1]) - + '
'; - formatter += this._encodeHTML(params[i][3]) + ' : ' - + this.numAddCommas(params[i][2]); + else if (typeof formatter === 'string') { + formatter = formatter.replace('{a}','{a0}') + .replace('{b}','{b0}') + .replace('{c}','{c0}') + .replace('{d}','{d0}'); + for (var i = 0, l = params.length; i < l; i++) { + formatter = formatter.replace( + '{a' + i + '}', + this._encodeHTML(params[i].seriesName) + ); + formatter = formatter.replace( + '{b' + i + '}', + this._encodeHTML(params[i].name) + ); + formatter = formatter.replace( + '{c' + i + '}', + this.numAddCommas(params[i].value) + ); + formatter = formatter.replace( + '{d' + i + '}', + this._encodeHTML(params[i].indicator) + ); + } + this._tDom.innerHTML = formatter; + } + else { + formatter = this._encodeHTML(params[0].name) + '
' + + this._encodeHTML(params[0].indicator) + ' : ' + + this.numAddCommas(params[0].value); + for (var i = 1, l = params.length; i < l; i++) { + formatter += '
' + this._encodeHTML(params[i].name) + + '
'; + formatter += this._encodeHTML(params[i].indicator) + ' : ' + + this.numAddCommas(params[i].value); + } + this._tDom.innerHTML = formatter; } - this._tDom.innerHTML = formatter; } + // don't modify, just false, showContent == undefined == true if (showContent === false || !this.option.tooltip.showContent) { // 只用tooltip的行为,不显示主体 return; @@ -866,156 +926,154 @@ define(function (require) { } }, - _showItemTrigger : function () { + /** + * @parma {boolean} axisTrigger + */ + _showItemTrigger: function (axisTrigger) { if (!this._curTarget) { return; } var serie = ecData.get(this._curTarget, 'series'); + var seriesIndex = ecData.get(this._curTarget, 'seriesIndex'); var data = ecData.get(this._curTarget, 'data'); + var dataIndex = ecData.get(this._curTarget, 'dataIndex'); var name = ecData.get(this._curTarget, 'name'); var value = ecData.get(this._curTarget, 'value'); var special = ecData.get(this._curTarget, 'special'); var special2 = ecData.get(this._curTarget, 'special2'); + var queryTarget = [data, serie, this.option]; // 从低优先级往上找到trigger为item的formatter和样式 var formatter; var position; var showContent; var specialCssText = ''; - var indicator; - var html = ''; if (this._curTarget._type != 'island') { // 全局 - if (this.option.tooltip.trigger == 'item') { + var trigger = axisTrigger ? 'axis' : 'item'; + if (this.option.tooltip.trigger === trigger) { formatter = this.option.tooltip.formatter; position = this.option.tooltip.position; } // 系列 - if (this.query(serie, 'tooltip.trigger') == 'item') { - showContent = this.query(serie, 'tooltip.showContent') - || showContent; - formatter = this.query(serie, 'tooltip.formatter') - || formatter; - position = this.query(serie, 'tooltip.position') - || position; + if (this.query(serie, 'tooltip.trigger') === trigger) { + showContent = this.query(serie, 'tooltip.showContent') || showContent; + formatter = this.query(serie, 'tooltip.formatter') || formatter; + position = this.query(serie, 'tooltip.position') || position; specialCssText += this._style(this.query(serie, 'tooltip')); } // 数据项 - showContent = this.query(data, 'tooltip.showContent') - || showContent; - formatter = this.query(data, 'tooltip.formatter') - || formatter; - position = this.query(data, 'tooltip.position') - || position; + showContent = this.query(data, 'tooltip.showContent') || showContent; + formatter = this.query(data, 'tooltip.formatter') || formatter; + position = this.query(data, 'tooltip.position') || position; specialCssText += this._style(this.query(data, 'tooltip')); } else { - showContent = this.deepQuery([data, serie, this.option], 'tooltip.showContent'); - formatter = this.deepQuery([data, serie, this.option], 'tooltip.islandFormatter'); - position = this.deepQuery([data, serie, this.option], 'tooltip.islandPosition'); - } - - if (typeof formatter == 'function') { - this._curTicket = (serie.name || '') - + ':' - + ecData.get(this._curTarget, 'dataIndex'); - this._tDom.innerHTML = formatter.call( - this.myChart, - [ - serie.name || '', - name, - value, - special, - special2, - data - ], - this._curTicket, - this._setContent - ); + this._lastItemTriggerId = NaN; + showContent = this.deepQuery(queryTarget, 'tooltip.showContent'); + formatter = this.deepQuery(queryTarget, 'tooltip.islandFormatter'); + position = this.deepQuery(queryTarget, 'tooltip.islandPosition'); } - else if (typeof formatter == 'string') { - this._curTicket = NaN; - formatter = formatter.replace('{a}','{a0}') - .replace('{b}','{b0}') - .replace('{c}','{c0}'); - formatter = formatter.replace('{a0}', this._encodeHTML(serie.name || '')) - .replace('{b0}', this._encodeHTML(name)) - .replace( - '{c0}', - value instanceof Array ? value : this.numAddCommas(value) - ); - formatter = formatter.replace('{d}','{d0}') - .replace('{d0}', special || ''); - formatter = formatter.replace('{e}','{e0}') - .replace('{e0}', ecData.get(this._curTarget, 'special2') || ''); + // 复位item trigger和axis trigger间短距离来回变换时的不响应 + this._lastDataIndex = -1; + this._lastSeriesIndex = -1; - this._tDom.innerHTML = formatter; - } - else { - this._curTicket = NaN; - if (serie.type == ecConfig.CHART_TYPE_SCATTER) { - this._tDom.innerHTML = (typeof serie.name != 'undefined' - ? (this._encodeHTML(serie.name) + '
') - : '' - ) - + (name === '' ? '' : (this._encodeHTML(name) + ' : ')) - + value - + (typeof special == 'undefined' - ? '' : (' (' + special + ')') - ); + // 相同dataIndex seriesIndex时不再触发内容更新 + if (this._lastItemTriggerId !== this._curTarget.id) { + this._lastItemTriggerId = this._curTarget.id; + if (typeof formatter === 'function') { + this._curTicket = (serie.name || '') + ':' + dataIndex; + this._tDom.innerHTML = formatter.call( + this.myChart, + { + seriesIndex: seriesIndex, + seriesName: serie.name || '', + series: serie, + dataIndex: dataIndex, + data: data, + name: name, + value: value, + percent: special, // 饼图 + indicator: special, // 雷达图 + value2: special2, + indicator2: special2, + // 向下兼容 + 0: serie.name || '', + 1: name, + 2: value, + 3: special, + 4: special2, + 5: data, + 6: seriesIndex, + 7: dataIndex + }, + this._curTicket, + this._setContent + ); } - else if (serie.type == ecConfig.CHART_TYPE_RADAR && special) { - indicator = special; - html += this._encodeHTML(name === '' ? (serie.name || '') : name); - html += html === '' ? '' : '
'; - for (var i = 0 ; i < indicator.length; i ++) { - html += this._encodeHTML(indicator[i].text) + ' : ' - + this.numAddCommas(value[i]) + '
'; - } - this._tDom.innerHTML = html; + else if (typeof formatter === 'string') { + this._curTicket = NaN; + formatter = formatter.replace('{a}', '{a0}') + .replace('{b}', '{b0}') + .replace('{c}', '{c0}'); + formatter = formatter.replace('{a0}', this._encodeHTML(serie.name || '')) + .replace('{b0}', this._encodeHTML(name)) + .replace( + '{c0}', + value instanceof Array ? value : this.numAddCommas(value) + ); + + formatter = formatter.replace('{d}', '{d0}') + .replace('{d0}', special || ''); + formatter = formatter.replace('{e}', '{e0}') + .replace( + '{e0}', + ecData.get(this._curTarget, 'special2') || '' + ); + + this._tDom.innerHTML = formatter; } - else if (serie.type == ecConfig.CHART_TYPE_CHORD) { - if (typeof special2 == 'undefined') { - // 外环上 - this._tDom.innerHTML = this._encodeHTML(name) + ' (' - + this.numAddCommas(value) + ')'; + else { + this._curTicket = NaN; + if (serie.type === ecConfig.CHART_TYPE_RADAR && special) { + this._tDom.innerHTML = this._itemFormatter.radar.call( + this, serie, name, value, special + ); + } + // chord 处理暂时跟 force 一样 + // else if (serie.type === ecConfig.CHART_TYPE_CHORD) { + // this._tDom.innerHTML = this._itemFormatter.chord.call( + // this, serie, name, value, special, special2 + // ); + // } + else if (serie.type === ecConfig.CHART_TYPE_EVENTRIVER) { + this._tDom.innerHTML = this._itemFormatter.eventRiver.call( + this, serie, name, value, data + ); } else { - var name1 = this._encodeHTML(name); - var name2 = this._encodeHTML(special); - // 内部弦上 - this._tDom.innerHTML = (typeof serie.name != 'undefined' - ? (this._encodeHTML(serie.name) + '
') : '' - ) - + name1 + ' -> ' + name2 - + ' (' + this.numAddCommas(value) + ')' - + '
' - + name2 + ' -> ' + name1 - + ' (' + this.numAddCommas(special2) + ')'; + this._tDom.innerHTML = '' + + (serie.name != null ? (this._encodeHTML(serie.name) + '
') : '') + + (name === '' ? '' : (this._encodeHTML(name) + ' : ')) + + (value instanceof Array ? value : this.numAddCommas(value)); } } - else { - this._tDom.innerHTML = (typeof serie.name != 'undefined' - ? (this._encodeHTML(serie.name) + '
') : '' - ) - + this._encodeHTML(name) + ' : ' - + this.numAddCommas(value) + - (typeof special == 'undefined' - ? '' : (' ('+ this.numAddCommas(special) +')') - ); - } } - if (!this._axisLineShape.invisible - || !this._axisShadowShape.invisible + var x = zrEvent.getX(this._event); + var y = zrEvent.getY(this._event); + if (this.deepQuery(queryTarget, 'tooltip.axisPointer.show') + && this.component.grid ) { - this._axisLineShape.invisible = true; - this.zr.modShape(this._axisLineShape.id); - this._axisShadowShape.invisible = true; - this.zr.modShape(this._axisShadowShape.id); - this.zr.refresh(); + this._styleAxisPointer( + [serie], + this.component.grid.getX(), y, + this.component.grid.getXend(), y, + 0, x, y + ); } + // don't modify, just false, showContent == undefined == true if (showContent === false || !this.option.tooltip.showContent) { // 只用tooltip的行为,不显示主体 return; @@ -1028,27 +1086,75 @@ define(function (require) { this.hasAppend = true; } - this._show( - position, - zrEvent.getX(this._event) + 20, - zrEvent.getY(this._event) - 20, - specialCssText - ); + this._show(position, x + 20, y - 20, specialCssText); }, + _itemFormatter: { + radar: function(serie, name, value, indicator){ + var html = ''; + html += this._encodeHTML(name === '' ? (serie.name || '') : name); + html += html === '' ? '' : '
'; + for (var i = 0 ; i < indicator.length; i ++) { + html += this._encodeHTML(indicator[i].text) + ' : ' + + this.numAddCommas(value[i]) + '
'; + } + return html; + }, + chord: function(serie, name, value, special, special2) { + if (special2 == null) { + // 外环上 + return this._encodeHTML(name) + ' (' + this.numAddCommas(value) + ')'; + } + else { + var name1 = this._encodeHTML(name); + var name2 = this._encodeHTML(special); + // 内部弦上 + return '' + + (serie.name != null ? (this._encodeHTML(serie.name) + '
') : '') + + name1 + ' -> ' + name2 + + ' (' + this.numAddCommas(value) + ')' + + '
' + + name2 + ' -> ' + name1 + + ' (' + this.numAddCommas(special2) + ')'; + } + }, + eventRiver: function(serie, name, value, data) { + var html = ''; + html += this._encodeHTML(serie.name === '' ? '' : (serie.name + ' : ') ); + html += this._encodeHTML(name); + html += html === '' ? '' : '
'; + data = data.evolution; + for (var i = 0, l = data.length; i < l; i++) { + html += '
'; + if (!data[i].detail) { + continue; + } + if (data[i].detail.img) { + html += ''; + } + html += '
' + data[i].time + '
'; + html += ''; + html += data[i].detail.text + '
'; + html += '
'; + } + return html; + } + }, + /** * 设置坐标轴指示器样式 */ - _styleAxisPointer : function (seriesArray, xStart, yStart, xEnd, yEnd, gap, x, y) { + _styleAxisPointer: function (seriesArray, xStart, yStart, xEnd, yEnd, gap, x, y) { if (seriesArray.length > 0) { var queryTarget; var curType; var axisPointer = this.option.tooltip.axisPointer; var pointType = axisPointer.type; var style = { - line : {}, - cross : {}, - shadow : {} + line: {}, + cross: {}, + shadow: {} }; for (var pType in style) { style[pType].color = axisPointer[pType + 'Style'].color; @@ -1056,10 +1162,7 @@ define(function (require) { style[pType].type = axisPointer[pType + 'Style'].type; } for (var i = 0, l = seriesArray.length; i < l; i++) { - if (this.deepQuery( - [seriesArray[i], this.option], 'tooltip.trigger' - ) == 'axis' - ) { + //if (this.deepQuery([seriesArray[i], this.option], 'tooltip.trigger') === 'axis') { queryTarget = seriesArray[i]; curType = this.query(queryTarget, 'tooltip.axisPointer.type'); pointType = curType || pointType; @@ -1077,38 +1180,41 @@ define(function (require) { 'tooltip.axisPointer.' + curType + 'Style.type' ) || style[curType].type; } - } + //} } - if (pointType == 'line') { + if (pointType === 'line') { + var lineWidth = style.line.width; + var isVertical = xStart == xEnd; this._axisLineShape.style = { - xStart : xStart, - yStart : yStart, - xEnd : xEnd, - yEnd : yEnd, - strokeColor : style.line.color, - lineWidth : style.line.width, - lineType : style.line.type + xStart: isVertical ? this.subPixelOptimize(xStart, lineWidth) : xStart, + yStart: isVertical ? yStart : this.subPixelOptimize(yStart, lineWidth), + xEnd: isVertical ? this.subPixelOptimize(xEnd, lineWidth) : xEnd, + yEnd: isVertical ? yEnd : this.subPixelOptimize(yEnd, lineWidth), + strokeColor: style.line.color, + lineWidth: lineWidth, + lineType: style.line.type }; this._axisLineShape.invisible = false; this.zr.modShape(this._axisLineShape.id); } - else if (pointType == 'cross') { + else if (pointType === 'cross') { + var crossWidth = style.cross.width; this._axisCrossShape.style = { brushType: 'stroke', - rect : this.component.grid.getArea(), - x : x, - y : y, - text : ('( ' + rect: this.component.grid.getArea(), + x: this.subPixelOptimize(x, crossWidth), + y: this.subPixelOptimize(y, crossWidth), + text: ('( ' + this.component.xAxis.getAxis(0).getValueFromCoord(x) + ' , ' + this.component.yAxis.getAxis(0).getValueFromCoord(y) + ' )' - ).replace(' , ', ' ').replace(' , ', ' '), - textPosition : 'specific', - strokeColor : style.cross.color, - lineWidth : style.cross.width, - lineType : style.cross.type + ).replace(' , ', ' ').replace(' , ', ' '), + textPosition: 'specific', + strokeColor: style.cross.color, + lineWidth: crossWidth, + lineType: style.cross.type }; if (this.component.grid.getXend() - x > 100) { // 右侧有空间 this._axisCrossShape.style.textAlign = 'left'; @@ -1129,14 +1235,14 @@ define(function (require) { this._axisCrossShape.invisible = false; this.zr.modShape(this._axisCrossShape.id); } - else if (pointType == 'shadow') { - if (typeof style.shadow.width == 'undefined' - || style.shadow.width == 'auto' + else if (pointType === 'shadow') { + if (style.shadow.width == null + || style.shadow.width === 'auto' || isNaN(style.shadow.width) ) { style.shadow.width = gap; } - if (xStart == xEnd) { + if (xStart === xEnd) { // 纵向 if (Math.abs(this.component.grid.getX() - xStart) < 2) { // 最左边 @@ -1149,7 +1255,7 @@ define(function (require) { xStart = xEnd = xEnd - style.shadow.width / 2; } } - else if (yStart == yEnd) { + else if (yStart === yEnd) { // 横向 if (Math.abs(this.component.grid.getY() - yStart) < 2) { // 最上边 @@ -1163,23 +1269,26 @@ define(function (require) { } } this._axisShadowShape.style = { - xStart : xStart, - yStart : yStart, - xEnd : xEnd, - yEnd : yEnd, - strokeColor : style.shadow.color, - lineWidth : style.shadow.width + xStart: xStart, + yStart: yStart, + xEnd: xEnd, + yEnd: yEnd, + strokeColor: style.shadow.color, + lineWidth: style.shadow.width }; this._axisShadowShape.invisible = false; this.zr.modShape(this._axisShadowShape.id); } - this.zr.refresh(); + this.zr.refreshNextFrame(); } }, - __onmousemove : function (param) { + __onmousemove: function (param) { clearTimeout(this._hidingTicket); clearTimeout(this._showingTicket); + if (this._mousein && this._enterable) { + return; + } var target = param.target; var mx = zrEvent.getX(param.event); var my = zrEvent.getY(param.event); @@ -1226,10 +1335,10 @@ define(function (require) { // 看用这个polar的系列数据是否是axis触发,如果是设置_curTarget为nul var series = this.option.series; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].polarIndex == polarIndex + if (series[i].polarIndex === polarIndex && this.deepQuery( [series[i], this.option], 'tooltip.trigger' - ) == 'axis' + ) === 'axis' ) { this._curTarget = null; break; @@ -1244,7 +1353,7 @@ define(function (require) { /** * zrender事件响应:鼠标离开绘图区域 */ - __onglobalout : function () { + __onglobalout: function () { clearTimeout(this._hidingTicket); clearTimeout(this._showingTicket); this._hidingTicket = setTimeout(this._hide, this._hideDelay); @@ -1253,18 +1362,18 @@ define(function (require) { /** * 异步回调填充内容 */ - __setContent : function (ticket, content) { + __setContent: function (ticket, content) { if (!this._tDom) { return; } - if (ticket == this._curTicket) { + if (ticket === this._curTicket) { this._tDom.innerHTML = content; } setTimeout(this._refixed, 20); }, - ontooltipHover : function (param, tipShape) { + ontooltipHover: function (param, tipShape) { if (!this._lastTipShape // 不存在或者存在但dataIndex发生变化才需要重绘 || (this._lastTipShape && this._lastTipShape.dataIndex != param.dataIndex) ) { @@ -1273,7 +1382,9 @@ define(function (require) { this.shapeList.length = 2; } for (var i = 0, l = tipShape.length; i < l; i++) { - tipShape[i].zlevel = this._zlevelBase; + tipShape[i].zlevel = this.getZlevelBase(); + tipShape[i].z = this.getZBase(); + tipShape[i].style = zrShapeBase.prototype.getHighlightStyle( tipShape[i].style, tipShape[i].highlightStyle @@ -1288,24 +1399,24 @@ define(function (require) { this.zr.addShape(tipShape[i]); } this._lastTipShape = { - dataIndex : param.dataIndex, - tipShape : tipShape + dataIndex: param.dataIndex, + tipShape: tipShape }; } }, - ondragend : function () { + ondragend: function () { this._hide(); }, /** * 图例选择 */ - onlegendSelected : function (param) { + onlegendSelected: function (param) { this._selectedMap = param.selected; }, - _setSelectedMap : function () { + _setSelectedMap: function () { if (this.component.legend) { this._selectedMap = zrUtil.clone(this.component.legend.getSelectedMap()); } @@ -1314,8 +1425,8 @@ define(function (require) { } }, - _isSelected : function (itemName) { - if (typeof this._selectedMap[itemName] != 'undefined') { + _isSelected: function (itemName) { + if (this._selectedMap[itemName] != null) { return this._selectedMap[itemName]; } else { @@ -1329,20 +1440,20 @@ define(function (require) { * {seriesIndex: 0, seriesName:'', dataInex:0} line、bar、scatter、k、radar * {seriesIndex: 0, seriesName:'', name:''} map、pie、chord */ - showTip : function (params) { + showTip: function (params) { if (!params) { return; } var seriesIndex; var series = this.option.series; - if (typeof params.seriesIndex != 'undefined') { + if (params.seriesIndex != null) { seriesIndex = params.seriesIndex; } else { var seriesName = params.seriesName; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].name == seriesName) { + if (series[i].name === seriesName) { seriesIndex = i; break; } @@ -1350,13 +1461,13 @@ define(function (require) { } var serie = series[seriesIndex]; - if (typeof serie == 'undefined') { + if (serie == null) { return; } var chart = this.myChart.chart[serie.type]; var isAxisTrigger = this.deepQuery( [serie, this.option], 'tooltip.trigger' - ) == 'axis'; + ) === 'axis'; if (!chart) { return; @@ -1369,8 +1480,8 @@ define(function (require) { case ecConfig.CHART_TYPE_LINE : case ecConfig.CHART_TYPE_BAR : case ecConfig.CHART_TYPE_K : - if (typeof this.component.xAxis == 'undefined' - || typeof this.component.yAxis == 'undefined' + if (this.component.xAxis == null + || this.component.yAxis == null || serie.data.length <= dataIndex ) { return; @@ -1378,26 +1489,26 @@ define(function (require) { var xAxisIndex = serie.xAxisIndex || 0; var yAxisIndex = serie.yAxisIndex || 0; if (this.component.xAxis.getAxis(xAxisIndex).type - == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY ) { // 横轴是类目 this._event = { - zrenderX : this.component.xAxis.getAxis(xAxisIndex) - .getCoordByIndex(dataIndex), - zrenderY : this.component.grid.getY() - + (this.component.grid.getYend() - - this.component.grid.getY() - ) / 4 + zrenderX: this.component.xAxis.getAxis(xAxisIndex) + .getCoordByIndex(dataIndex), + zrenderY: this.component.grid.getY() + + (this.component.grid.getYend() + - this.component.grid.getY() + ) / 4 }; } else { // 纵轴是类目 this._event = { - zrenderX : this.component.grid.getX() - + (this.component.grid.getXend() + zrenderX: this.component.grid.getX() + + (this.component.grid.getXend() - this.component.grid.getX() - ) / 4, - zrenderY : this.component.yAxis.getAxis(yAxisIndex) + ) / 4, + zrenderY: this.component.yAxis.getAxis(yAxisIndex) .getCoordByIndex(dataIndex) }; } @@ -1408,7 +1519,7 @@ define(function (require) { ); break; case ecConfig.CHART_TYPE_RADAR : - if (typeof this.component.polar == 'undefined' + if (this.component.polar == null || serie.data[0].value.length <= dataIndex ) { return; @@ -1418,8 +1529,8 @@ define(function (require) { polarIndex, dataIndex, 'max' ); this._event = { - zrenderX : vector[0], - zrenderY : vector[1] + zrenderX: vector[0], + zrenderY: vector[1] }; this._showPolarTrigger( polarIndex, @@ -1440,7 +1551,8 @@ define(function (require) { case ecConfig.CHART_TYPE_SCATTER : var dataIndex = params.dataIndex; for (var i = 0, l = shapeList.length; i < l; i++) { - if (ecData.get(shapeList[i], 'seriesIndex') == seriesIndex + if (shapeList[i]._mark == null + && ecData.get(shapeList[i], 'seriesIndex') == seriesIndex && ecData.get(shapeList[i], 'dataIndex') == dataIndex ) { this._curTarget = shapeList[i]; @@ -1454,7 +1566,7 @@ define(function (require) { case ecConfig.CHART_TYPE_RADAR : var dataIndex = params.dataIndex; for (var i = 0, l = shapeList.length; i < l; i++) { - if (shapeList[i].type == 'polygon' + if (shapeList[i].type === 'polygon' && ecData.get(shapeList[i], 'seriesIndex') == seriesIndex && ecData.get(shapeList[i], 'dataIndex') == dataIndex ) { @@ -1471,7 +1583,7 @@ define(function (require) { case ecConfig.CHART_TYPE_PIE : var name = params.name; for (var i = 0, l = shapeList.length; i < l; i++) { - if (shapeList[i].type == 'sector' + if (shapeList[i].type === 'sector' && ecData.get(shapeList[i], 'seriesIndex') == seriesIndex && ecData.get(shapeList[i], 'name') == name ) { @@ -1489,9 +1601,9 @@ define(function (require) { var name = params.name; var mapType = serie.mapType; for (var i = 0, l = shapeList.length; i < l; i++) { - if (shapeList[i].type == 'text' - && shapeList[i]._mapType == mapType - && shapeList[i].style._name == name + if (shapeList[i].type === 'text' + && shapeList[i]._mapType === mapType + && shapeList[i].style._name === name ) { this._curTarget = shapeList[i]; x = this._curTarget.style.x + this._curTarget.position[0]; @@ -1503,7 +1615,7 @@ define(function (require) { case ecConfig.CHART_TYPE_CHORD: var name = params.name; for (var i = 0, l = shapeList.length; i < l; i++) { - if (shapeList[i].type == 'sector' + if (shapeList[i].type === 'sector' && ecData.get(shapeList[i], 'name') == name ) { this._curTarget = shapeList[i]; @@ -1515,8 +1627,8 @@ define(function (require) { this.zr.trigger( zrConfig.EVENT.MOUSEMOVE, { - zrenderX : x, - zrenderY : y + zrenderX: x, + zrenderY: y } ); return; @@ -1526,7 +1638,7 @@ define(function (require) { case ecConfig.CHART_TYPE_FORCE: var name = params.name; for (var i = 0, l = shapeList.length; i < l; i++) { - if (shapeList[i].type == 'circle' + if (shapeList[i].type === 'circle' && ecData.get(shapeList[i], 'name') == name ) { this._curTarget = shapeList[i]; @@ -1537,10 +1649,10 @@ define(function (require) { } break; } - if (typeof x != 'undefined' && typeof y != 'undefined') { + if (x != null && y != null) { this._event = { - zrenderX : x, - zrenderY : y + zrenderX: x, + zrenderY: y }; this.zr.addHoverShape(this._curTarget); this.zr.refreshHover(); @@ -1552,14 +1664,14 @@ define(function (require) { /** * 关闭,公开接口 */ - hideTip : function () { + hideTip: function () { this._hide(); }, /** * 刷新 */ - refresh : function (newOption) { + refresh: function (newOption) { // this._selectedMap; // this._defaultCssText; // css样式缓存 // this._needAxisTrigger; // 坐标轴触发 @@ -1577,26 +1689,26 @@ define(function (require) { this._lastTipShape = false; this.shapeList.length = 2; + this._lastDataIndex = -1; + this._lastSeriesIndex = -1; + this._lastItemTriggerId = -1; + if (newOption) { this.option = newOption; this.option.tooltip = this.reformOption(this.option.tooltip); + this.option.tooltip.textStyle = zrUtil.merge( this.option.tooltip.textStyle, this.ecTheme.textStyle ); - // 补全padding属性 - this.option.tooltip.padding = this.reformCssArray( - this.option.tooltip.padding - ); - this._needAxisTrigger = false; - if (this.option.tooltip.trigger == 'axis') { + if (this.option.tooltip.trigger === 'axis') { this._needAxisTrigger = true; } var series = this.option.series; for (var i = 0, l = series.length; i < l; i++) { - if (this.query(series[i], 'tooltip.trigger') == 'axis') { + if (this.query(series[i], 'tooltip.trigger') === 'axis') { this._needAxisTrigger = true; break; } @@ -1609,28 +1721,29 @@ define(function (require) { this._setSelectedMap(); this._axisLineWidth = this.option.tooltip.axisPointer.lineStyle.width; + this._enterable = this.option.tooltip.enterable; } if (this.showing) { - this._tryShow(); + var self = this; + setTimeout(function(){ + self.zr.trigger(zrConfig.EVENT.MOUSEMOVE, self.zr.handler._event); + },50); } }, /** * 释放后实例不可用,重载基类方法 */ - dispose : function () { + onbeforDispose: function () { if (this._lastTipShape && this._lastTipShape.tipShape.length > 0) { this.zr.delShape(this._lastTipShape.tipShape); } - this.clear(); - this.shapeList = null; - clearTimeout(this._hidingTicket); clearTimeout(this._showingTicket); this.zr.un(zrConfig.EVENT.MOUSEMOVE, this._onmousemove); this.zr.un(zrConfig.EVENT.GLOBALOUT, this._onglobalout); - if (this.hasAppend) { + if (this.hasAppend && !!this.dom.firstChild) { this.dom.firstChild.removeChild(this._tDom); } this._tDom = null; @@ -1639,7 +1752,7 @@ define(function (require) { /** * html转码的方法 */ - _encodeHTML : function (source) { + _encodeHTML: function (source) { return String(source) .replace(/&/g, '&') .replace(/ 0 - ? (this.option.position == 'bottom' + ? (this.option.position === 'bottom' ? 'right' : 'left') - : (this.option.position == 'bottom' + : (this.option.position === 'bottom' ? 'left' : 'right'); axShape.rotation = [ rotate * Math.PI / 180, @@ -187,7 +251,7 @@ define(function (require) { // 纵向 var xPosition; var align; - if (this.option.position == 'left') { + if (this.option.position === 'left') { xPosition = this.grid.getX() - margin; align = 'right'; } @@ -198,23 +262,23 @@ define(function (require) { for (var i = 0; i < dataLength; i++) { axShape = { - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : xPosition, - y : this.getCoord(data[i]), - color : typeof textStyle.color == 'function' - ? textStyle.color(data[i]) : textStyle.color, - text : this._valueLabel[i], - textFont : this.getFont(textStyle), - textAlign : textStyle.align || align, - textBaseline : textStyle.baseline - || (i === 0 && this.option.name !== '') - ? 'bottom' - : (i == (dataLength - 1) - && this.option.name !== '') - ? 'top' - : 'middle' + zlevel: this.getZlevelBase(), + z: this.getZBase() + 3, + hoverable: false, + style: { + x: xPosition, + y: this.getCoord(data[i]), + color: typeof textStyle.color === 'function' + ? textStyle.color(data[i]) : textStyle.color, + text: this._valueLabel[i], + textFont: this.getFont(textStyle), + textAlign: textStyle.align || align, + textBaseline: textStyle.baseline + || ( + (i === 0 && this.option.name !== '') + ? 'bottom' + : (i === dataLength - 1 && this.option.name !== '') ? 'top' : 'middle' + ) } }; @@ -232,7 +296,7 @@ define(function (require) { } }, - _buildSplitLine : function () { + _buildSplitLine: function () { var axShape; var data = this._valueList; var dataLength = this._valueList.length; @@ -253,16 +317,17 @@ define(function (require) { // 亚像素优化 x = this.subPixelOptimize(this.getCoord(data[i]), lineWidth); axShape = { - zlevel : this._zlevelBase, - hoverable : false, - style : { - xStart : x, - yStart : sy, - xEnd : x, - yEnd : ey, - strokeColor : color[i % colorLength], - lineType : lineType, - lineWidth : lineWidth + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + xStart: x, + yStart: sy, + xEnd: x, + yEnd: ey, + strokeColor: color[i % colorLength], + lineType: lineType, + lineWidth: lineWidth } }; this.shapeList.push(new LineShape(axShape)); @@ -279,16 +344,17 @@ define(function (require) { // 亚像素优化 y = this.subPixelOptimize(this.getCoord(data[i]), lineWidth); axShape = { - zlevel : this._zlevelBase, - hoverable : false, - style : { - xStart : sx, - yStart : y, - xEnd : ex, - yEnd : y, - strokeColor : color[i % colorLength], - lineType : lineType, - lineWidth : lineWidth + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + xStart: sx, + yStart: y, + xEnd: ex, + yEnd: y, + strokeColor: color[i % colorLength], + lineType: lineType, + lineWidth: lineWidth } }; this.shapeList.push(new LineShape(axShape)); @@ -296,22 +362,23 @@ define(function (require) { } }, - _buildSplitArea : function () { + _buildSplitArea: function () { var axShape; var color = this.option.splitArea.areaStyle.color; if (!(color instanceof Array)) { // 非数组一律认为是单一颜色的字符串,单一颜色则用一个背景,颜色错误不负责啊!!! axShape = { - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : this.grid.getX(), - y : this.grid.getY(), - width : this.grid.getWidth(), - height : this.grid.getHeight(), - color : color - // type : this.option.splitArea.areaStyle.type, + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: this.grid.getX(), + y: this.grid.getY(), + width: this.grid.getWidth(), + height: this.grid.getHeight(), + color: color + // type: this.option.splitArea.areaStyle.type, } }; this.shapeList.push(new RectangleShape(axShape)); @@ -334,15 +401,16 @@ define(function (require) { ? this.getCoord(data[i]) : this.grid.getXend(); axShape = { - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : lastX, - y : y, - width : curX - lastX, - height : height, - color : color[i % colorLength] - // type : this.option.splitArea.areaStyle.type, + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: lastX, + y: y, + width: curX - lastX, + height: height, + color: color[i % colorLength] + // type: this.option.splitArea.areaStyle.type, } }; this.shapeList.push(new RectangleShape(axShape)); @@ -361,15 +429,16 @@ define(function (require) { ? this.getCoord(data[i]) : this.grid.getY(); axShape = { - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : x, - y : curY, - width : width, - height : lastYend - curY, - color : color[i % colorLength] - // type : this.option.splitArea.areaStyle.type + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: x, + y: curY, + width: width, + height: lastYend - curY, + color: color[i % colorLength] + // type: this.option.splitArea.areaStyle.type } }; this.shapeList.push(new RectangleShape(axShape)); @@ -382,13 +451,11 @@ define(function (require) { /** * 极值计算 */ - _calculateValue : function () { + _calculateValue: function () { if (isNaN(this.option.min - 0) || isNaN(this.option.max - 0)) { // 有一个没指定都得算 // 数据整形 - var oriData; // 原始数据 var data = {}; // 整形后数据抽取 - var value; var xIdx; var yIdx; var legend = this.component.legend; @@ -397,6 +464,7 @@ define(function (require) { && this.series[i].type != ecConfig.CHART_TYPE_BAR && this.series[i].type != ecConfig.CHART_TYPE_SCATTER && this.series[i].type != ecConfig.CHART_TYPE_K + && this.series[i].type != ecConfig.CHART_TYPE_EVENTRIVER ) { // 非坐标轴支持的不算极值 continue; @@ -416,72 +484,11 @@ define(function (require) { continue; } - var key = this.series[i].name || 'kener'; - if (!this.series[i].stack) { - data[key] = data[key] || []; - oriData = this.series[i].data; - for (var j = 0, k = oriData.length; j < k; j++) { - value = typeof oriData[j].value != 'undefined' - ? oriData[j].value - : oriData[j]; - if (this.series[i].type == ecConfig.CHART_TYPE_SCATTER) { - if (this.option.xAxisIndex != -1) { - data[key].push(value[0]); - } - if (this.option.yAxisIndex != -1) { - data[key].push(value[1]); - } - } - else if (this.series[i].type == ecConfig.CHART_TYPE_K) { - data[key].push(value[0]); - data[key].push(value[1]); - data[key].push(value[2]); - data[key].push(value[3]); - } - else { - data[key].push(value); - } - } - } - else { - // 堆积数据,需要区分正负向堆积 - var keyP = '__Magic_Key_Positive__' + this.series[i].stack; - var keyN = '__Magic_Key_Negative__' + this.series[i].stack; - data[keyP] = data[keyP] || []; - data[keyN] = data[keyN] || []; - data[key] = data[key] || []; // scale下还需要记录每一个量 - oriData = this.series[i].data; - for (var j = 0, k = oriData.length; j < k; j++) { - value = typeof oriData[j].value != 'undefined' - ? oriData[j].value - : oriData[j]; - if (value == '-') { - continue; - } - value = value - 0; - if (value >= 0) { - if (typeof data[keyP][j] != 'undefined') { - data[keyP][j] += value; - } - else { - data[keyP][j] = value; - } - } - else { - if (typeof data[keyN][j] != 'undefined') { - data[keyN][j] += value; - } - else { - data[keyN][j] = value; - } - } - if (this.option.scale) { - data[key].push(value); - } - } - } + this._calculSum(data, i); } + // 找极值 + var oriData; // 原始数据 for (var i in data){ oriData = data[i]; for (var j = 0, k = oriData.length; j < k; j++) { @@ -506,260 +513,279 @@ define(function (require) { } } - //console.log(this._min,this._max,'vvvvv111111') + // console.log(this._min,this._max,'vvvvv111111',this.option.type) + var gap = Math.abs(this._max - this._min); this._min = isNaN(this.option.min - 0) - ? (this._min - Math.abs(this._min * this.option.boundaryGap[0])) + ? (this._min - Math.abs(gap * this.option.boundaryGap[0])) : (this.option.min - 0); // 指定min忽略boundaryGay[0] this._max = isNaN(this.option.max - 0) - ? (this._max + Math.abs(this._max * this.option.boundaryGap[1])) + ? (this._max + Math.abs(gap * this.option.boundaryGap[1])) : (this.option.max - 0); // 指定max忽略boundaryGay[1] - if (this._min == this._max) { + if (this._min === this._max) { if (this._max === 0) { // 修复全0数据 - this._max = this.option.power > 0 ? this.option.power : 1; + this._max = 1; } // 修复最大值==最小值时数据整形 else if (this._max > 0) { - this._min = this._max / this.option.splitNumber; + this._min = this._max / this.option.splitNumber != null ? this.option.splitNumber : 5; } else { // this._max < 0 - this._max = this._max / this.option.splitNumber; + this._max = this._max / this.option.splitNumber != null ? this.option.splitNumber : 5; } } - this._reformValue(this.option.scale); + this.option.type != 'time' + ? this._reformValue(this.option.scale) + : this._reformTimeValue(); } else { this._hasData = true; // 用户指定min max就不多管闲事了 this._min = this.option.min - 0; // 指定min忽略boundaryGay[0] this._max = this.option.max - 0; // 指定max忽略boundaryGay[1] - this._customerValue(); + this.option.type != 'time' + ? this._customerValue() + : this._reformTimeValue(); } }, /** - * 找到原始数据的极值后根据选项整形最终 this._min / this._max / this._valueList - * 如果你不知道这个“整形”的用义,请不要试图去理解和修改这个方法!找我也没用,我相信我已经记不起来! - * 如果你有更简洁的数学推导欢迎重写,后果自负~ - * 一旦你不得不遇到了需要修改或重写的厄运,希望下面的脚手架能帮助你 - * ps:其实我是想说别搞砸了!升级后至少得保证这些case通过!! - * - * by linzhifeng@baidu.com 2013-1-8 - * -------- - this._valueList = []; - this.option = {splitNumber:5,power:100,precision:0}; - this._min = 1; this._max = 123; console.log(this._min, this._max); this._reformValue(); - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : 0 150 [0, 30, 60, 90, 120, 150]', - (this._min == 0 && this._max == 150) ? 'success' : 'failed'); - - this._min = 10; this._max = 1923; console.log(this._min, this._max); this._reformValue(); - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : 0 2000 [0, 400, 800, 1200, 1600, 2000]', - (this._min == 0 && this._max == 2000) ? 'success' : 'failed'); - - this._min = 10; this._max = 78; console.log(this._min, this._max); this._reformValue(); - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : 0 100 [0, 20, 40, 60, 80, 100]', - (this._min == 0 && this._max == 100) ? 'success' : 'failed'); - - this._min = -31; this._max = -3; console.log(this._min, this._max); this._reformValue(); - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : -35 0 [-35, -28, -21, -14, -7, 0]', - (this._min == -35 && this._max == 0) ? 'success' : 'failed'); - - this._min = -51; this._max = 203; console.log(this._min, this._max); this._reformValue(); - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : -60 240 [-60, 0, 60, 120, 180, 240]', - (this._min == -60 && this._max == 240) ? 'success' : 'failed'); - - this._min = -251; this._max = 23; console.log(this._min, this._max); this._reformValue(); - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : -280 70 [-280, -210, -140, -70, 0, 70]', - (this._min == -280 && this._max == 70) ? 'success' : 'failed'); - - this.option.precision = 2; - this._min = 0.23; this._max = 0.78; console.log(this._min, this._max); this._reformValue(); - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : 0.00 1.00' - + '["0.00", "0.20", "0.40", "0.60", "0.80", "1.00"]', - (this._min == 0.00 && this._max == 1.00) ? 'success' : 'failed'); - - this._min = -12.23; this._max = -0.78; console.log(this._min, this._max); - this._reformValue(); - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : -15.00 0.00' - + '["-15.00", "-12.00", "-9.00", "-6.00", "-3.00", "0.00"]', - (this._min == -15.00 && this._max == 0.00) ? 'success' : 'failed'); - - this._min = -0.23; this._max = 0.78; console.log(this._min, this._max); this._reformValue() - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : -0.30 1.20' - + '["-0.30", "0.00", "0.30", "0.60", "0.90", "1.20"]', - (this._min == -0.30 && this._max == 1.20) ? 'success' : 'failed'); - - this._min = -1.23; this._max = 0.78; console.log(this._min, this._max); _reformValue(); - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : -1.50 1.00' - + '["-1.50", "-1.00", "-0.50", "0.00", "0.50", "1.00"]', - (this._min == -1.50 && this._max == 1.00) ? 'success' : 'failed'); - - this.option.precision = 1; - this._min = -2.3; this._max = 0.5; console.log(this._min, this._max); _reformValue(); - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : -2.4 0.6' - + '["-2.4", "-1.8", "-1.2", "-0.6", "0.0", "0.6"]', - (this._min == -2.4 && this._max == 0.6) ? 'success' : 'failed'); - * -------- + * 内部使用,计算某系列下的堆叠和 */ - _reformValue : function (scale) { - var splitNumber = this.option.splitNumber; - var precision = this.option.precision; - var splitGap; - var power; - if (precision === 0) { // 整数 - power = this.option.power > 1 ? this.option.power : 1; - } - else { // 小数 - // 放大倍数后复用整数逻辑,最后再缩小回去 - power = Math.pow(10, precision); - this._min *= power; - this._max *= power; - power = this.option.power; - } - // console.log(this._min,this._max) - var total; - if (this._min >= 0 && this._max >= 0) { - // 双正 - if (!scale) { - // power自动降级 - while ((this._max / power < splitNumber) && power != 1) { - power = power / 10; + _calculSum: function (data, i) { + var key = this.series[i].name || 'kener'; + var value; + var oriData; + if (!this.series[i].stack) { + data[key] = data[key] || []; + if (this.series[i].type != ecConfig.CHART_TYPE_EVENTRIVER) { + oriData = this.series[i].data; + for (var j = 0, k = oriData.length; j < k; j++) { + value = this.getDataFromOption(oriData[j]); + if (this.series[i].type === ecConfig.CHART_TYPE_K) { + data[key].push(value[0]); + data[key].push(value[1]); + data[key].push(value[2]); + data[key].push(value[3]); + } + else if (value instanceof Array) { + // scatter 、 不等距 line bar + if (this.option.xAxisIndex != -1) { + data[key].push( + this.option.type != 'time' + ? value[0] : ecDate.getNewDate(value[0]) + ); + } + if (this.option.yAxisIndex != -1) { + data[key].push( + this.option.type != 'time' + ? value[1] : ecDate.getNewDate(value[1]) + ); + } + } + else { + data[key].push(value); + } } - this._min = 0; } else { - // power自动降级 - while (this._min < power && power != 1) { - power = power / 10; - } - if (precision === 0) { // 整数 - // 满足power - this._min = Math.floor(this._min / power) * power; - this._max = Math.ceil(this._max / power) * power; + // eventRiver + oriData = this.series[i].eventList; + for (var j = 0, k = oriData.length; j < k; j++) { + var evolution = oriData[j].evolution; + for (var m = 0, n = evolution.length; m < n; m++) { + data[key].push(ecDate.getNewDate(evolution[m].time)); + } } } - power = power > 1 ? power / 10 : 1; - total = this._max - this._min; - splitGap = Math.ceil((total / splitNumber) / power) * power; - this._max = this._min + splitGap * splitNumber; - } - else if (this._min <= 0 && this._max <= 0) { - // 双负 - power = -power; - if (!scale) { - // power自动降级 - while ((this._min / power < splitNumber) && power != -1) { - power = power / 10; + } + else { + // 堆积数据,需要区分正负向堆积 + var keyP = '__Magic_Key_Positive__' + this.series[i].stack; + var keyN = '__Magic_Key_Negative__' + this.series[i].stack; + data[keyP] = data[keyP] || []; + data[keyN] = data[keyN] || []; + data[key] = data[key] || []; // scale下还需要记录每一个量 + oriData = this.series[i].data; + for (var j = 0, k = oriData.length; j < k; j++) { + value = this.getDataFromOption(oriData[j]); + if (value === '-') { + continue; } - this._max = 0; - } - else { - // power自动降级 - while (this._max > power && power != -1) { - power = power / 10; + value = value - 0; + if (value >= 0) { + if (data[keyP][j] != null) { + data[keyP][j] += value; + } + else { + data[keyP][j] = value; + } } - if (precision === 0) { // 整数 - // 满足power - this._min = Math.ceil(this._min / power) * power; - this._max = Math.floor(this._max / power) * power; + else { + if (data[keyN][j] != null) { + data[keyN][j] += value; + } + else { + data[keyN][j] = value; + } + } + if (this.option.scale) { + data[key].push(value); } } - power = power < -1 ? power / 10 : -1; - total = this._min - this._max; - splitGap = -Math.ceil((total / splitNumber) / power) * power; - this._min = -splitGap * splitNumber + this._max; } - else { - // 一正一负,确保0被选中 - total = this._max - this._min; - // power自动降级 - while ((total / power < splitNumber) && power != 1) { - power = power/10; - } - // 正数部分的分隔数 - var partSplitNumber = Math.round(this._max / total * splitNumber); - // 修正数据范围极度偏正向,留给负数一个 - partSplitNumber -= (partSplitNumber == splitNumber ? 1 : 0); - // 修正数据范围极度偏负向,留给正数一个 - partSplitNumber += partSplitNumber === 0 ? 1 : 0; - splitGap = (Math.ceil(Math.max( - this._max / partSplitNumber, - this._min / (partSplitNumber - splitNumber) - ) - / power)) - * power; - - this._max = splitGap * partSplitNumber; - this._min = splitGap * (partSplitNumber - splitNumber); - } - //console.log(this._min,this._max,'vvvvvrrrrrr') - this._valueList = []; - for (var i = 0; i <= splitNumber; i++) { - this._valueList.push(this._min + splitGap * i); + }, + + /** + * 找到原始数据的极值后根据选项整形最终 this._min / this._max / this._valueList + * 如果你不知道这个“整形”的用义,请不要试图去理解和修改这个方法!找我也没用,我相信我已经记不起来! + * 如果你有更简洁的数学推导欢迎重写,后果自负~ + * + * by kener.linfeng@gmail.com 2013-1-8 + * -------- + * 感谢谢世威(https://github.com/i6ma),终于有人改这个方法了 + * by Kener 2014-11-6 + */ + _reformValue: function (scale) { + var smartSteps = require('../util/smartSteps'); + var splitNumber = this.option.splitNumber; + + // 非scale下双正,修正最小值为0 + if (!scale && this._min >= 0 && this._max >= 0) { + this._min = 0; } - - if (precision !== 0) { // 小数 - // 放大倍数后复用整数逻辑,最后再缩小回去 - power = Math.pow(10, precision); - this._min = (this._min / power).toFixed(precision) - 0; - this._max = (this._max / power).toFixed(precision) - 0; - for (var i = 0; i <= splitNumber; i++) { - this._valueList[i] = - (this._valueList[i] / power).toFixed(precision) - 0; - } + // 非scale下双负,修正最大值为0 + if (!scale && this._min <= 0 && this._max <= 0) { + this._max = 0; } + + var stepOpt = smartSteps(this._min, this._max, splitNumber); + splitNumber = splitNumber != null ? splitNumber : stepOpt.secs; + //this.option.splitNumber = splitNumber; + this._min = stepOpt.min; + this._max = stepOpt.max; + this._valueList = stepOpt.pnts; this._reformLabelData(); }, - _customerValue : function () { - var splitNumber = this.option.splitNumber; - var precision = this.option.precision; + /** + * 格式化时间值 + */ + _reformTimeValue : function() { + var splitNumber = this.option.splitNumber != null ? this.option.splitNumber : 5; + + // 最优解 + var curValue = ecDate.getAutoFormatter(this._min, this._max, splitNumber); + // 目标 + var formatter = curValue.formatter; + var gapValue = curValue.gapValue; + + this._valueList = [ecDate.getNewDate(this._min)]; + var startGap; + switch (formatter) { + case 'week' : + startGap = ecDate.nextMonday(this._min); + break; + case 'month' : + startGap = ecDate.nextNthOnMonth(this._min, 1); + break; + case 'quarter' : + startGap = ecDate.nextNthOnQuarterYear(this._min, 1); + break; + case 'half-year' : + startGap = ecDate.nextNthOnHalfYear(this._min, 1); + break; + case 'year' : + startGap = ecDate.nextNthOnYear(this._min, 1); + break; + default : + // 大于2小时需要考虑时区不能直接取整 + if (gapValue <= 3600000 * 2) { + startGap = (Math.floor(this._min / gapValue) + 1) * gapValue; + } + else { + startGap = ecDate.getNewDate(this._min - (-gapValue)); + startGap.setHours(Math.round(startGap.getHours() / 6) * 6); + startGap.setMinutes(0); + startGap.setSeconds(0); + } + break; + } + + if (startGap - this._min < gapValue / 2) { + startGap -= -gapValue; + } + + // console.log(startGap,gapValue,this._min, this._max,formatter) + curValue = ecDate.getNewDate(startGap); + splitNumber *= 1.5; + while (splitNumber-- >= 0) { + if (formatter == 'month' + || formatter == 'quarter' + || formatter == 'half-year' + || formatter == 'year' + ) { + curValue.setDate(1); + } + if (this._max - curValue < gapValue / 2) { + break; + } + this._valueList.push(curValue); + curValue = ecDate.getNewDate(curValue - (-gapValue)); + } + this._valueList.push(ecDate.getNewDate(this._max)); + + this._reformLabelData(formatter); + }, + + _customerValue: function () { + var accMath = require('../util/accMath'); + var splitNumber = this.option.splitNumber != null ? this.option.splitNumber : 5; var splitGap = (this._max - this._min) / splitNumber; this._valueList = []; for (var i = 0; i <= splitNumber; i++) { - this._valueList.push((this._min + splitGap * i).toFixed(precision) - 0); + this._valueList.push(accMath.accAdd(this._min, accMath.accMul(splitGap, i))); } this._reformLabelData(); }, - _reformLabelData : function () { + _reformLabelData: function (timeFormatter) { this._valueLabel = []; var formatter = this.option.axisLabel.formatter; if (formatter) { for (var i = 0, l = this._valueList.length; i < l; i++) { - if (typeof formatter == 'function') { - this._valueLabel.push(formatter.call(this.myChart, this._valueList[i])); + if (typeof formatter === 'function') { + this._valueLabel.push( + timeFormatter + ? formatter.call(this.myChart, this._valueList[i], timeFormatter) + : formatter.call(this.myChart, this._valueList[i]) + ); } - else if (typeof formatter == 'string') { + else if (typeof formatter === 'string') { this._valueLabel.push( - formatter.replace('{value}',this._valueList[i]) + timeFormatter + ? ecDate.format(formatter, this._valueList[i]) + : formatter.replace('{value}',this._valueList[i]) ); } } } + else if (timeFormatter) { + for (var i = 0, l = this._valueList.length; i < l; i++) { + this._valueLabel.push(ecDate.format(timeFormatter, this._valueList[i])); + } + } else { // 每三位默认加,格式化 for (var i = 0, l = this._valueList.length; i < l; i++) { this._valueLabel.push(this.numAddCommas(this._valueList[i])); } } - }, - getExtremum : function () { + getExtremum: function () { this._calculateValue(); return { min: this._min, @@ -770,7 +796,7 @@ define(function (require) { /** * 刷新 */ - refresh : function (newOption, newSeries) { + refresh: function (newOption, newSeries) { if (newOption) { this.option = this.reformOption(newOption); // 通用字体设置 @@ -787,7 +813,7 @@ define(function (require) { }, // 根据值换算位置 - getCoord : function (value) { + getCoord: function (value) { value = value < this._min ? this._min : value; value = value > this._max ? this._max : value; @@ -810,14 +836,14 @@ define(function (require) { return result; // Math.floor可能引起一些偏差,但性能会更好 /* 准确更重要 - return (value == this._min || value == this._max) + return (value === this._min || value === this._max) ? result : Math.floor(result); */ }, // 根据值换算绝对大小 - getCoordSize : function (value) { + getCoordSize: function (value) { if (!this.isHorizontal()) { // 纵向 return Math.abs(value / (this._max - this._min) * this.grid.getHeight()); @@ -829,7 +855,7 @@ define(function (require) { }, // 根据位置换算值 - getValueFromCoord : function(coord) { + getValueFromCoord: function(coord) { var result; if (!this.isHorizontal()) { // 纵向 @@ -851,6 +877,15 @@ define(function (require) { } return result.toFixed(2) - 0; + }, + + isMaindAxis : function (value) { + for (var i = 0, l = this._valueList.length; i < l; i++) { + if (this._valueList[i] === value) { + return true; + } + } + return false; } }; diff --git a/amd/config.js b/amd/config.js index 6240dce..68cf54b 100644 --- a/amd/config.js +++ b/amd/config.js @@ -2,7 +2,7 @@ * echarts默认配置项 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ define(function() { @@ -17,10 +17,11 @@ define(function() { CHART_TYPE_MAP: 'map', CHART_TYPE_K: 'k', CHART_TYPE_ISLAND: 'island', - CHART_TYPE_FORCE : 'force', - CHART_TYPE_CHORD : 'chord', - CHART_TYPE_GAUGE : 'gauge', - CHART_TYPE_FUNNEL : 'funnel', + CHART_TYPE_FORCE: 'force', + CHART_TYPE_CHORD: 'chord', + CHART_TYPE_GAUGE: 'gauge', + CHART_TYPE_FUNNEL: 'funnel', + CHART_TYPE_EVENTRIVER: 'eventRiver', // 组件类型 COMPONENT_TYPE_TITLE: 'title', @@ -38,6 +39,7 @@ define(function() { COMPONENT_TYPE_AXIS_CATEGORY: 'categoryAxis', COMPONENT_TYPE_AXIS_VALUE: 'valueAxis', COMPONENT_TYPE_TIMELINE: 'timeline', + COMPONENT_TYPE_ROAMCONTROLLER: 'roamController', // 全图默认背景 backgroundColor: 'rgba(0,0,0,0)', @@ -48,1048 +50,33 @@ define(function() { '#1e90ff','#ff6347','#7b68ee','#00fa9a','#ffd700', '#6699FF','#ff6666','#3cb371','#b8860b','#30e0e0'], - // 图表标题 - title: { - text: '', - //link: null, // 超链接跳转 - //target: null, // 仅支持self | blank - subtext: '', - //sublink: null, // 超链接跳转 - //subtarget: null, // 仅支持self | blank - x: 'left', // 水平安放位置,默认为左对齐,可选为: - // 'center' ¦ 'left' ¦ 'right' - // ¦ {number}(x坐标,单位px) - y: 'top', // 垂直安放位置,默认为全图顶端,可选为: - // 'top' ¦ 'bottom' ¦ 'center' - // ¦ {number}(y坐标,单位px) - //textAlign: null // 水平对齐方式,默认根据x设置自动调整 - backgroundColor: 'rgba(0,0,0,0)', - borderColor: '#ccc', // 标题边框颜色 - borderWidth: 0, // 标题边框线宽,单位px,默认为0(无边框) - padding: 5, // 标题内边距,单位px,默认各方向内边距为5, - // 接受数组分别设定上右下左边距,同css - itemGap: 5, // 主副标题纵向间隔,单位px,默认为10, - textStyle: { - fontSize: 18, - fontWeight: 'bolder', - color: '#333' // 主标题文字颜色 - }, - subtextStyle: { - color: '#aaa' // 副标题文字颜色 - } - }, - - // 图例 - legend: { - orient: 'horizontal', // 布局方式,默认为水平布局,可选为: - // 'horizontal' ¦ 'vertical' - x: 'center', // 水平安放位置,默认为全图居中,可选为: - // 'center' ¦ 'left' ¦ 'right' - // ¦ {number}(x坐标,单位px) - y: 'top', // 垂直安放位置,默认为全图顶端,可选为: - // 'top' ¦ 'bottom' ¦ 'center' - // ¦ {number}(y坐标,单位px) - backgroundColor: 'rgba(0,0,0,0)', - borderColor: '#ccc', // 图例边框颜色 - borderWidth: 0, // 图例边框线宽,单位px,默认为0(无边框) - padding: 5, // 图例内边距,单位px,默认各方向内边距为5, - // 接受数组分别设定上右下左边距,同css - itemGap: 10, // 各个item之间的间隔,单位px,默认为10, - // 横向布局时为水平间隔,纵向布局时为纵向间隔 - itemWidth: 20, // 图例图形宽度 - itemHeight: 14, // 图例图形高度 - textStyle: { - color: '#333' // 图例文字颜色 - }, - selectedMode: true // 选择模式,默认开启图例开关 - // selected: null, // 配置默认选中状态,可配合LEGEND.SELECTED事件做动态数据载入 - // data: [], // 图例内容(详见legend.data,数组中每一项代表一个item - }, - - // 值域 - dataRange: { - orient: 'vertical', // 布局方式,默认为垂直布局,可选为: - // 'horizontal' ¦ 'vertical' - x: 'left', // 水平安放位置,默认为全图左对齐,可选为: - // 'center' ¦ 'left' ¦ 'right' - // ¦ {number}(x坐标,单位px) - y: 'bottom', // 垂直安放位置,默认为全图底部,可选为: - // 'top' ¦ 'bottom' ¦ 'center' - // ¦ {number}(y坐标,单位px) - backgroundColor: 'rgba(0,0,0,0)', - borderColor: '#ccc', // 值域边框颜色 - borderWidth: 0, // 值域边框线宽,单位px,默认为0(无边框) - padding: 5, // 值域内边距,单位px,默认各方向内边距为5, - // 接受数组分别设定上右下左边距,同css - itemGap: 10, // 各个item之间的间隔,单位px,默认为10, - // 横向布局时为水平间隔,纵向布局时为纵向间隔 - itemWidth: 20, // 值域图形宽度,线性渐变水平布局宽度为该值 * 10 - itemHeight: 14, // 值域图形高度,线性渐变垂直布局高度为该值 * 10 - // min: null, // 最小值 - // max: null, // 最大值 - precision: 0, // 小数精度,默认为0,无小数点 - splitNumber: 5, // 分割段数,默认为5,为0时为线性渐变 - calculable: false, // 是否值域漫游,启用后无视splitNumber,线性渐变 - realtime: true, - color:['#006edd','#e0ffff'],//颜色 - //formatter: null, - //text:['高','低'], // 文本,默认为数值文本 - textStyle: { - color: '#333' // 值域文字颜色 - } - }, - - toolbox: { - show : false, - orient: 'horizontal', // 布局方式,默认为水平布局,可选为: - // 'horizontal' ¦ 'vertical' - x: 'right', // 水平安放位置,默认为全图右对齐,可选为: - // 'center' ¦ 'left' ¦ 'right' - // ¦ {number}(x坐标,单位px) - y: 'top', // 垂直安放位置,默认为全图顶端,可选为: - // 'top' ¦ 'bottom' ¦ 'center' - // ¦ {number}(y坐标,单位px) - color : ['#1e90ff','#22bb22','#4b0082','#d2691e'], - disableColor : '#ddd', - effectiveColor : 'red', - backgroundColor: 'rgba(0,0,0,0)', // 工具箱背景颜色 - borderColor: '#ccc', // 工具箱边框颜色 - borderWidth: 0, // 工具箱边框线宽,单位px,默认为0(无边框) - padding: 5, // 工具箱内边距,单位px,默认各方向内边距为5, - // 接受数组分别设定上右下左边距,同css - itemGap: 10, // 各个item之间的间隔,单位px,默认为10, - // 横向布局时为水平间隔,纵向布局时为纵向间隔 - itemSize: 16, // 工具箱图形宽度 - showTitle : true, - //textStyle : {}, - feature : { - mark : { - show : false, - title : { - mark : '辅助线开关', - markUndo : '删除辅助线', - markClear : '清空辅助线' - }, - lineStyle : { - width : 1, - color : '#1e90ff', - type : 'dashed' - } - }, - dataZoom : { - show : false, - title : { - dataZoom : '区域缩放', - dataZoomReset : '区域缩放后退' - } - }, - dataView : { - show : false, - title : '数据视图', - readOnly: false, - lang : ['Data View', 'close', 'refresh'] - }, - magicType: { - show : false, - title : { - line : '折线图切换', - bar : '柱形图切换', - stack : '堆积', - tiled : '平铺' - }, - type : [] // 'line', 'bar', 'stack', 'tiled' - }, - restore : { - show : false, - title : '还原' - }, - saveAsImage : { - show : false, - title : '保存为图片', - type : 'png', - lang : ['点击保存'] - } - } - }, - - // 提示框 - tooltip: { - show: true, - showContent: true, // tooltip主体内容 - trigger: 'item', // 触发类型,默认数据触发,见下图,可选为:'item' ¦ 'axis' - // position : null // 位置 {Array} | {Function} - // formatter: null // 内容格式器:{string}(Template) ¦ {Function} - islandFormatter: '{a}
{b} : {c}', // 数据孤岛内容格式器 - showDelay: 20, // 显示延迟,添加显示延迟可以避免频繁切换,单位ms - hideDelay: 100, // 隐藏延迟,单位ms - transitionDuration : 0.4, // 动画变换时间,单位s - backgroundColor: 'rgba(0,0,0,0.7)', // 提示背景颜色,默认为透明度为0.7的黑色 - borderColor: '#333', // 提示边框颜色 - borderRadius: 4, // 提示边框圆角,单位px,默认为4 - borderWidth: 0, // 提示边框线宽,单位px,默认为0(无边框) - padding: 5, // 提示内边距,单位px,默认各方向内边距为5, - // 接受数组分别设定上右下左边距,同css - axisPointer : { // 坐标轴指示器,坐标轴触发有效 - type : 'line', // 默认为直线,可选为:'line' | 'shadow' | 'cross' - lineStyle : { // 直线指示器样式设置 - color: '#48b', - width: 2, - type: 'solid' - }, - crossStyle: { - color: '#1e90ff', - width: 1, - type: 'dashed' - }, - shadowStyle : { // 阴影指示器样式设置 - color: 'rgba(150,150,150,0.3)', // 阴影颜色 - width: 'auto', // 阴影大小 - type: 'default' - } - }, - textStyle: { - color: '#fff' - } - }, - - // 区域缩放控制器 - dataZoom: { - show: false, - orient: 'horizontal', // 布局方式,默认为水平布局,可选为: - // 'horizontal' ¦ 'vertical' - // x: {number}, // 水平安放位置,默认为根据grid参数适配,可选为: - // {number}(x坐标,单位px) - // y: {number}, // 垂直安放位置,默认为根据grid参数适配,可选为: - // {number}(y坐标,单位px) - // width: {number}, // 指定宽度,横向布局时默认为根据grid参数适配 - // height: {number}, // 指定高度,纵向布局时默认为根据grid参数适配 - backgroundColor: 'rgba(0,0,0,0)', // 背景颜色 - dataBackgroundColor: '#eee', // 数据背景颜色 - fillerColor: 'rgba(144,197,237,0.2)', // 填充颜色 - handleColor: 'rgba(70,130,180,0.8)', // 手柄颜色 - // xAxisIndex: [], // 默认控制所有横向类目 - // yAxisIndex: [], // 默认控制所有横向类目 - // start: 0, // 默认为0 - // end: 100, // 默认为全部 100% - realtime: true - // zoomLock: false // 是否锁定选择区域大小 - }, - - // 网格 - grid: { - x: 80, - y: 60, - x2: 80, - y2: 60, - // width: {totalWidth} - x - x2, - // height: {totalHeight} - y - y2, - backgroundColor: 'rgba(0,0,0,0)', - borderWidth: 1, - borderColor: '#ccc' - }, - - // 类目轴 - categoryAxis: { - position: 'bottom', // 位置 - name: '', // 坐标轴名字,默认为空 - nameLocation: 'end', // 坐标轴名字位置,支持'start' | 'end' - nameTextStyle: {}, // 坐标轴文字样式,默认取全局样式 - boundaryGap: true, // 类目起始和结束两端空白策略 - axisLine: { // 坐标轴线 - show: true, // 默认显示,属性show控制显示与否 - onZero: true, - lineStyle: { // 属性lineStyle控制线条样式 - color: '#48b', - width: 2, - type: 'solid' - } - }, - axisTick: { // 坐标轴小标记 - show: true, // 属性show控制显示与否,默认不显示 - interval: 'auto', - inside : false, // 控制小标记是否在grid里 - // onGap: null, - length :5, // 属性length控制线长 - lineStyle: { // 属性lineStyle控制线条样式 - color: '#333', - width: 1 - } - }, - axisLabel: { // 坐标轴文本标签,详见axis.axisLabel - show: true, - interval: 'auto', - rotate: 0, - margin: 8, - // clickable: false, - // formatter: null, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#333' - } - }, - splitLine: { // 分隔线 - show: true, // 默认显示,属性show控制显示与否 - // onGap: null, - lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 - color: ['#ccc'], - width: 1, - type: 'solid' - } - }, - splitArea: { // 分隔区域 - show: false, // 默认不显示,属性show控制显示与否 - // onGap: null, - areaStyle: { // 属性areaStyle(详见areaStyle)控制区域样式 - color: ['rgba(250,250,250,0.3)','rgba(200,200,200,0.3)'] - } - } - }, - - // 数值型坐标轴默认参数 - valueAxis: { - position: 'left', // 位置 - name: '', // 坐标轴名字,默认为空 - nameLocation: 'end', // 坐标轴名字位置,支持'start' | 'end' - nameTextStyle: {}, // 坐标轴文字样式,默认取全局样式 - boundaryGap: [0, 0], // 数值起始和结束两端空白策略 - // min: null, // 最小值 - // max: null, // 最大值 - // scale: false, // 脱离0值比例,放大聚焦到最终_min,_max区间 - precision: 0, // 小数精度,默认为0,无小数点 - power: 100, // 整数精度,默认为100,个位和百位为0 - splitNumber: 5, // 分割段数,默认为5 - axisLine: { // 坐标轴线 - show: true, // 默认显示,属性show控制显示与否 - onZero: true, - lineStyle: { // 属性lineStyle控制线条样式 - color: '#48b', - width: 2, - type: 'solid' - } - }, - axisTick: { // 坐标轴小标记 - show: false, // 属性show控制显示与否,默认不显示 - inside : false, // 控制小标记是否在grid里 - length :5, // 属性length控制线长 - lineStyle: { // 属性lineStyle控制线条样式 - color: '#333', - width: 1 - } - }, - axisLabel: { // 坐标轴文本标签,详见axis.axisLabel - show: true, - rotate: 0, - margin: 8, - // clickable: false, - // formatter: null, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#333' - } - }, - splitLine: { // 分隔线 - show: true, // 默认显示,属性show控制显示与否 - lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 - color: ['#ccc'], - width: 1, - type: 'solid' - } - }, - splitArea: { // 分隔区域 - show: false, // 默认不显示,属性show控制显示与否 - areaStyle: { // 属性areaStyle(详见areaStyle)控制区域样式 - color: ['rgba(250,250,250,0.3)','rgba(200,200,200,0.3)'] - } - } - }, - - polar : { - center : ['50%', '50%'], // 默认全局居中 - radius : '75%', - startAngle : 90, - splitNumber : 5, - name : { - show: true, - // formatter: null, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#333' - } - }, - axisLine: { // 坐标轴线 - show: true, // 默认显示,属性show控制显示与否 - lineStyle: { // 属性lineStyle控制线条样式 - color: '#ccc', - width: 1, - type: 'solid' - } - }, - axisLabel: { // 坐标轴文本标签,详见axis.axisLabel - show: false, - // formatter: null, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#333' - } - }, - splitArea : { - show : true, - areaStyle : { - color: ['rgba(250,250,250,0.3)','rgba(200,200,200,0.3)'] - } - }, - splitLine : { - show : true, - lineStyle : { - width : 1, - color : '#ccc' - } - }, - type: 'polygon' - //indicator : [] - }, - - timeline : { - show: true, - type : 'time', // 模式是时间类型,支持 number - notMerge : false, - realtime : true, - x: 80, - // y: {number}, - x2: 80, - y2: 0, - // width: {totalWidth} - x - x2, - height: 50, - backgroundColor: 'rgba(0,0,0,0)', // 时间轴背景颜色 - borderColor : '#ccc', // 时间轴边框颜色 - borderWidth : 0, // 时间轴边框线宽,单位px,默认为0(无边框) - padding : 5, // 时间轴内边距,单位px,默认各方向内边距为5, - controlPosition : 'left', // 'right' | 'none' - autoPlay : false, - loop : true, - playInterval : 2000, // 播放时间间隔,单位ms - lineStyle : { - width : 1, - color : '#666', - type : 'dashed' - }, - label: { // 文本标签 - show: true, - interval: 'auto', - rotate: 0, - // formatter: null, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#333' - } - }, - checkpointStyle : { - symbol : 'auto', - symbolSize : 'auto', - color : 'auto', - borderColor : 'auto', - borderWidth : 'auto', - label: { // 文本标签 - show: false, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: 'auto' - } - } - }, - controlStyle : { - normal : { color : '#333'}, - emphasis : { color : '#1e90ff'} - }, - symbol : 'emptyDiamond', - symbolSize : 4, - currentIndex : 0 - // data : [] - }, - - // 柱形图默认参数 - bar: { - // stack: null - xAxisIndex: 0, - yAxisIndex: 0, - barMinHeight: 0, // 最小高度改为0 - // barWidth: null, // 默认自适应 - barGap: '30%', // 柱间距离,默认为柱形宽度的30%,可设固定值 - barCategoryGap : '20%', // 类目间柱形距离,默认为类目间距的20%,可设固定值 - itemStyle: { - normal: { - // color: '各异', - borderColor: '#fff', // 柱条边线 - borderRadius: 0, // 柱条边线圆角,单位px,默认为0 - borderWidth: 0, // 柱条边线线宽,单位px,默认为1 - label: { - show: false - // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - }, - emphasis: { - // color: '各异', - borderColor: '#fff', // 柱条边线 - borderRadius: 0, // 柱条边线圆角,单位px,默认为0 - borderWidth: 0, // 柱条边线线宽,单位px,默认为1 - label: { - show: false - // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - } - } - }, - - // 折线图默认参数 - line: { - // stack: null - xAxisIndex: 0, - yAxisIndex: 0, - itemStyle: { - normal: { - // color: 各异, - label: { - show: false - // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - lineStyle: { - width: 2, - type: 'solid', - shadowColor : 'rgba(0,0,0,0)', //默认透明 - shadowBlur: 0, - shadowOffsetX: 0, - shadowOffsetY: 0 - } - }, - emphasis: { - // color: 各异, - label: { - show: false - // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - } - }, - //smooth : false, - //symbol: null, // 拐点图形类型 - symbolSize: 2, // 拐点图形大小 - //symbolRotate : null, // 拐点图形旋转控制 - showAllSymbol: false // 标志图形默认只有主轴显示(随主轴标签间隔隐藏策略) - }, - - // K线图默认参数 - k: { - xAxisIndex: 0, - yAxisIndex: 0, - // barWidth : null // 默认自适应 - // barMaxWidth : null // 默认自适应 - itemStyle: { - normal: { - color: '#fff', // 阳线填充颜色 - color0: '#00aa11', // 阴线填充颜色 - lineStyle: { - width: 1, - color: '#ff3200', // 阳线边框颜色 - color0: '#00aa11' // 阴线边框颜色 - } - }, - emphasis: { - // color: 各异, - // color0: 各异 - } - } - }, - - // 散点图默认参数 - scatter: { - xAxisIndex: 0, - yAxisIndex: 0, - //symbol: null, // 图形类型 - symbolSize: 4, // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 - //symbolRotate : null, // 图形旋转控制 - large: false, // 大规模散点图 - largeThreshold: 2000,// 大规模阀值,large为true且数据量>largeThreshold才启用大规模模式 - itemStyle: { - normal: { - // color: 各异, - label: { - show: false, - // 标签文本格式器,同Tooltip.formatter,不支持回调 - formatter : function (a, b, c) { - if (typeof c[2] != 'undefined') { - return c[2]; - } - else { - return c[0] + ' , ' + c[1]; - } - } - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - }, - emphasis: { - // color: '各异' - label: { - show: false, - // 标签文本格式器,同Tooltip.formatter,不支持回调 - formatter : function (a, b, c) { - if (typeof c[2] != 'undefined') { - return c[2]; - } - else { - return c[0] + ' , ' + c[1]; - } - } - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - } - } - }, - - // 雷达图默认参数 - radar : { - polarIndex: 0, - itemStyle: { - normal: { - // color: 各异, - label: { - show: false - }, - lineStyle: { - width: 2, - type: 'solid' - } - }, - emphasis: { - // color: 各异, - label: { - show: false - } - } - }, - //symbol: null, // 拐点图形类型 - symbolSize: 2 // 可计算特性参数,空数据拖拽提示图形大小 - //symbolRotate : null, // 图形旋转控制 - }, - - // 饼图默认参数 - pie: { - center : ['50%', '50%'], // 默认全局居中 - radius : [0, '75%'], - clockWise : true, // 默认顺时针 - startAngle: 90, - minAngle: 0, // 最小角度改为0 - selectedOffset: 10, // 选中是扇区偏移量 - // selectedMode: false, // 选择模式,默认关闭,可选single,multiple - // roseType : null, // 南丁格尔玫瑰图模式,'radius'(半径) | 'area'(面积) - itemStyle: { - normal: { - // color: 各异, - borderColor: 'rgba(0,0,0,0)', - borderWidth: 1, - label: { - show: true, - position: 'outer' - // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - labelLine: { - show: true, - length: 20, - lineStyle: { - // color: 各异, - width: 1, - type: 'solid' - } - } - }, - emphasis: { - // color: 各异, - borderColor: 'rgba(0,0,0,0)', - borderWidth: 1, - label: { - show: false - // position: 'outer' - // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - labelLine: { - show: false, - length: 20, - lineStyle: { - // color: 各异, - width: 1, - type: 'solid' - } - } - } - } - }, - - map: { - mapType: 'china', // 各省的mapType暂时都用中文 - //mapLocation: { - // x : 'center' | 'left' | 'right' | 'x%' | {number}, - // y : 'center' | 'top' | 'bottom' | 'x%' | {number} - // width // 自适应 - // height // 自适应 - //}, - // mapValueCalculation: 'sum', // 数值合并方式,默认加和,可选为: - // 'sum' | 'average' | 'max' | 'min' - mapValuePrecision : 0, // 地图数值计算结果小数精度 - showLegendSymbol : true, // 显示图例颜色标识(系列标识的小圆点),存在legend时生效 - // selectedMode: false, // 选择模式,默认关闭,可选single,multiple - hoverable: true, - // roam : false, // 是否开启缩放及漫游模式 - // scaleLimit : null, - itemStyle: { - normal: { - // color: 各异, - borderColor: 'rgba(0,0,0,0)', - borderWidth: 1, - areaStyle: { - color: '#ccc' - }, - label: { - show: false, - textStyle: { - color: 'rgb(139,69,19)' - } - } - }, - emphasis: { // 也是选中样式 - // color: 各异, - borderColor: 'rgba(0,0,0,0)', - borderWidth: 1, - areaStyle: { - color: 'rgba(255,215,0,0.8)' - }, - label: { - show: false, - textStyle: { - color: 'rgb(100,0,0)' - } - } - } - } - }, - - force : { - // 布局中心 - center: ['50%', '50%'], - - // 布局大小 - size: '100%', - - // 布局冷却因子,值越小结束时间越短,值越大时间越长但是结果也越收敛 - coolDown: 0.99, - - // 数据映射到圆的半径的最小值和最大值 - minRadius : 10, - maxRadius : 20, - - // 是否根据屏幕比例拉伸 - ratioScaling: false, - - // 在 500+ 顶点的图上建议设置 large 为 true, 会使用 Barnes-Hut simulation - // 同时开启 useWorker 并且把 steps 值调大 - // 关于Barnes-Hut simulation: http://en.wikipedia.org/wiki/Barnes–Hut_simulation - large: false, - - // 是否在浏览器支持 worker 的时候使用 web worker - useWorker: false, - // 每一帧 force 迭代的次数,仅在启用webworker的情况下有用 - steps: 1, - - // 布局缩放因子,并不完全精确, 效果跟布局大小类似 - scaling : 1.0, - - // 向心力因子,越大向心力越大( 所有顶点会往 center 的位置收拢 ) - gravity : 1, - - symbol: 'circle', - // symbolSize 为 0 的话使用映射到minRadius-maxRadius后的值 - symbolSize: 0, - - linkSymbol: null, - linkSymbolSize: [10, 15], - draggable: true, - - // 分类里如果有样式会覆盖节点默认样式 - categories : [{ - // itemStyle - // symbol - // symbolSize - // name - }], - itemStyle: { - normal: { - // color: 各异, - label: { - show: false - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - nodeStyle : { - brushType : 'both', - color : '#f08c2e', - strokeColor : '#5182ab', - lineWidth: 1 - }, - linkStyle : { - strokeColor : '#5182ab' - } - }, - emphasis: { - // color: 各异, - label: { - show: false - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - nodeStyle : {}, - linkStyle : { - opacity: 0 - } - } - } - // nodes: [{ - // name: 'xxx', - // value: 1, - // itemStyle: {}, - // initial: [0, 0], - // fixX: false, - // fixY: false, - // ignore: false, - // symbol: 'circle', - // symbolSize: 0 - // }] - // links: [{ - // source: 1, - // target: 2, - // weight: 1, - // itemStyle: {} - // }, { - // source: 'xxx', - // target: 'ooo' - // }] - }, - - chord : { - radius : ['65%', '75%'], - center : ['50%', '50%'], - padding : 2, - sort : 'none', // can be 'none', 'ascending', 'descending' - sortSub : 'none', // can be 'none', 'ascending', 'descending' - startAngle : 90, - clockWise : true, - showScale : false, - showScaleText : false, - itemStyle : { - normal : { - label : { - show : true, - rotate: false, - distance: 10 - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - lineStyle : { - width : 0, - color : '#000' - }, - chordStyle : { - lineStyle : { - width : 1, - color : '#999' - } - } - }, - emphasis : { - lineStyle : { - width : 0, - color : '#000' - }, - chordStyle : { - lineStyle : { - width : 1, - color : '#666' - } - } - } - }, - // Source data matrix - /** - * target - * -1--2--3--4--5- - * 1| x x x x x - * 2| x x x x x - * 3| x x x x x source - * 4| x x x x x - * 5| x x x x x - * - * Relation ship from source to target - * https://github.com/mbostock/d3/wiki/Chord-Layout#wiki-chord - * - * Row based - */ - matrix : [] - }, - - gauge : { - center : ['50%', '50%'], // 默认全局居中 - radius : '75%', - startAngle: 225, - endAngle : -45, - min: 0, // 最小值 - max: 100, // 最大值 - precision: 0, // 小数精度,默认为0,无小数点 - splitNumber: 10, // 分割段数,默认为10 - axisLine: { // 坐标轴线 - show: true, // 默认显示,属性show控制显示与否 - lineStyle: { // 属性lineStyle控制线条样式 - color: [[0.2, '#228b22'],[0.8, '#48b'],[1, '#ff4500']], - width: 30 - } - }, - axisTick: { // 坐标轴小标记 - show: true, // 属性show控制显示与否,默认不显示 - splitNumber: 5, // 每份split细分多少段 - length :8, // 属性length控制线长 - lineStyle: { // 属性lineStyle控制线条样式 - color: '#eee', - width: 1, - type: 'solid' - } - }, - axisLabel: { // 坐标轴文本标签,详见axis.axisLabel - show: true, - // formatter: null, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: 'auto' - } - }, - splitLine: { // 分隔线 - show: true, // 默认显示,属性show控制显示与否 - length :30, // 属性length控制线长 - lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 - color: '#eee', - width: 2, - type: 'solid' - } - }, - pointer : { - show : true, - length : '80%', - width : 8, - color : 'auto' - }, - title : { - show : true, - offsetCenter: [0, '-40%'], // x, y,单位px - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#333', - fontSize : 15 - } - }, - detail : { - show : true, - backgroundColor: 'rgba(0,0,0,0)', - borderWidth: 0, - borderColor: '#ccc', - width: 100, - height: 40, - offsetCenter: [0, '40%'], // x, y,单位px - // formatter: null, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: 'auto', - fontSize : 30 - } - } - }, - - funnel : { - x: 80, - y: 60, - x2: 80, - y2: 60, - // width: {totalWidth} - x - x2, - // height: {totalHeight} - y - y2, - min: 0, - max: 100, - minSize: '0%', - maxSize: '100%', - sort : 'descending', // 'ascending', 'descending' - gap : 0, - itemStyle: { - normal: { - // color: 各异, - borderColor: '#fff', - borderWidth: 1, - label: { - show: true, - position: 'outer' - // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - labelLine: { - show: true, - length: 10, - lineStyle: { - // color: 各异, - width: 1, - type: 'solid' - } - } - }, - emphasis: { - // color: 各异, - borderColor: 'rgba(0,0,0,0)', - borderWidth: 1, - label: { - show: true - }, - labelLine: { - show: true - } - } - } - }, - - island: { - r: 15, - calculateStep: 0.1 // 滚轮可计算步长 0.1 = 10% - }, - - markPoint : { + markPoint: { + clickable: true, symbol: 'pin', // 标注类型 symbolSize: 10, // 标注大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 - //symbolRotate : null, // 标注旋转控制 - large : false, - effect : { + // symbolRotate: null, // 标注旋转控制 + large: false, + effect: { show: false, loop: true, period: 15, // 运动周期,无单位,值越大越慢 - scaleSize : 2 // 放大倍数,以markPoint点size为基准 - // color : 'gold', - // shadowColor : 'rgba(255,215,0,0.8)', - // shadowBlur : 0 // 炫光模糊 + type: 'scale', // 可用为 scale | bounce + scaleSize: 2, // 放大倍数,以markPoint点size为基准 + bounceDistance: 10 // 跳动距离,单位px + // color: 'gold', + // shadowColor: 'rgba(255,215,0,0.8)', + // shadowBlur: 0 // 炫光模糊 }, itemStyle: { normal: { // color: 各异, - // borderColor: 各异, // 标注边线颜色,优先于color - borderWidth: 2, // 标注边线线宽,单位px,默认为1 + // borderColor: 各异, // 标注边线颜色,优先于color + borderWidth: 2, // 标注边线线宽,单位px,默认为1 label: { show: true, // 标签文本格式器,同Tooltip.formatter,不支持回调 - // formatter : null, - position: 'inside' // 可选为'left'|'right'|'top'|'bottom' + // formatter: null, + position: 'inside' // 可选为'left'|'right'|'top'|'bottom' // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE } }, @@ -1098,7 +85,7 @@ define(function() { label: { show: true // 标签文本格式器,同Tooltip.formatter,不支持回调 - // formatter : null, + // formatter: null, // position: 'inside' // 'left'|'right'|'top'|'bottom' // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE } @@ -1106,33 +93,35 @@ define(function() { } }, - markLine : { + markLine: { + clickable: true, // 标线起始和结束的symbol介绍类型,如果都一样,可以直接传string - symbol: ['circle', 'arrow'], + symbol: ['circle', 'arrow'], // 标线起始和结束的symbol大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 symbolSize: [2, 4], // 标线起始和结束的symbol旋转控制 - //symbolRotate : null, - //smooth : false, - large : false, - effect : { + //symbolRotate: null, + //smooth: false, + smoothRadian: 0.2, // 平滑弧度 + precision: 2, + effect: { show: false, loop: true, - period: 15, // 运动周期,无单位,值越大越慢 - scaleSize : 2 // 放大倍数,以markLine线lineWidth为基准 - // color : 'gold', - // shadowColor : 'rgba(255,215,0,0.8)', - // shadowBlur : lineWidth * 2 // 炫光模糊,默认等于scaleSize计算所得 + period: 15, // 运动周期,无单位,值越大越慢 + scaleSize: 2 // 放大倍数,以markLine线lineWidth为基准 + // color: 'gold', + // shadowColor: 'rgba(255,215,0,0.8)', + // shadowBlur: lineWidth * 2 // 炫光模糊,默认等于scaleSize计算所得 }, itemStyle: { normal: { - // color: 各异, // 标线主色,线色,symbol主色 + // color: 各异, // 标线主色,线色,symbol主色 // borderColor: 随color, // 标线symbol边框颜色,优先于color - borderWidth: 1.5, // 标线symbol边框线宽,单位px,默认为2 + borderWidth: 1.5, // 标线symbol边框线宽,单位px,默认为2 label: { show: true, // 标签文本格式器,同Tooltip.formatter,不支持回调 - // formatter : null, + // formatter: null, // 可选为 'start'|'end'|'left'|'right'|'top'|'bottom' position: 'end' // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE @@ -1141,7 +130,7 @@ define(function() { // color: 随borderColor, // 主色,线色,优先级高于borderColor和color // width: 随borderWidth, // 优先于borderWidth type: 'dashed' - // shadowColor : 'rgba(0,0,0,0)', //默认透明 + // shadowColor: 'rgba(0,0,0,0)', //默认透明 // shadowBlur: 0, // shadowOffsetX: 0, // shadowOffsetY: 0 @@ -1152,11 +141,11 @@ define(function() { label: { show: false // 标签文本格式器,同Tooltip.formatter,不支持回调 - // formatter : null, + // formatter: null, // position: 'inside' // 'left'|'right'|'top'|'bottom' // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE }, - lineStyle : {} + lineStyle: {} } } }, @@ -1177,44 +166,56 @@ define(function() { RESTORE: 'restore', RESIZE: 'resize', CLICK: 'click', + DBLCLICK: 'dblclick', HOVER: 'hover', + MOUSEOUT: 'mouseout', //MOUSEWHEEL: 'mousewheel', // -------业务交互逻辑 DATA_CHANGED: 'dataChanged', DATA_ZOOM: 'dataZoom', DATA_RANGE: 'dataRange', + DATA_RANGE_SELECTED: 'dataRangeSelected', + DATA_RANGE_HOVERLINK: 'dataRangeHoverLink', LEGEND_SELECTED: 'legendSelected', + LEGEND_HOVERLINK: 'legendHoverLink', MAP_SELECTED: 'mapSelected', PIE_SELECTED: 'pieSelected', MAGIC_TYPE_CHANGED: 'magicTypeChanged', DATA_VIEW_CHANGED: 'dataViewChanged', TIMELINE_CHANGED: 'timelineChanged', - MAP_ROAM : 'mapRoam', + MAP_ROAM: 'mapRoam', + FORCE_LAYOUT_END: 'forceLayoutEnd', // -------内部通信 TOOLTIP_HOVER: 'tooltipHover', TOOLTIP_IN_GRID: 'tooltipInGrid', - TOOLTIP_OUT_GRID: 'tooltipOutGrid' + TOOLTIP_OUT_GRID: 'tooltipOutGrid', + ROAMCONTROLLER: 'roamController' }, - DRAG_ENABLE_TIME : 120, // 降低图表内元素拖拽敏感度,单位ms,不建议外部干预 - EFFECT_ZLEVEL : 7, + DRAG_ENABLE_TIME: 120, // 降低图表内元素拖拽敏感度,单位ms,不建议外部干预 + EFFECT_ZLEVEL : 10, // 特效动画zlevel // 主题,默认标志图形类型列表 - symbolList : [ + symbolList: [ 'circle', 'rectangle', 'triangle', 'diamond', 'emptyCircle', 'emptyRectangle', 'emptyTriangle', 'emptyDiamond' ], - loadingText : 'Loading...', + loadingEffect: 'spin', + loadingText: '数据读取中...', + noDataEffect: 'bubble', + noDataText: '暂无数据', + // noDataLoadingOption: null, // 可计算特性配置,孤岛,提示颜色 - calculable: false, // 默认关闭可计算特性 - calculableColor: 'rgba(255,165,0,0.6)', // 拖拽提示边框颜色 - calculableHolderColor: '#ccc', // 可计算占位提示颜色 + calculable: false, // 默认关闭可计算特性 + calculableColor: 'rgba(255,165,0,0.6)', // 拖拽提示边框颜色 + calculableHolderColor: '#ccc', // 可计算占位提示颜色 nameConnector: ' & ', - valueConnector: ' : ', - animation: true, + valueConnector: ': ', + animation: true, // 过渡动画是否开启 addDataAnimation: true, // 动态数据接口是否开启动画效果 animationThreshold: 2000, // 动画元素阀值,产生的图形原素超过2000不出动画 - animationDuration: 2000, + animationDuration: 2000, // 过渡动画参数:进入 + animationDurationUpdate: 500, // 过渡动画参数:更新 animationEasing: 'ExponentialOut' //BounceOut }; return config; -}); \ No newline at end of file +}); diff --git a/amd/data/Graph.js b/amd/data/Graph.js new file mode 100644 index 0000000..dec33be --- /dev/null +++ b/amd/data/Graph.js @@ -0,0 +1,488 @@ +/** + * Graph data structure + * + * @module echarts/data/Graph + * @author Yi Shen(https://www.github.com/pissang) + */ +define(function(require) { + + var util = require('zrender/tool/util'); + + 'use strict'; + + /** + * @alias module:echarts/data/Graph + * @constructor + * @param {boolean} directed + */ + var Graph = function(directed) { + /** + * 是否是有向图 + * @type {boolean} + * @private + */ + this._directed = directed || false; + + /** + * @type {Array} + */ + this.nodes = []; + this.edges = []; + + this._nodesMap = {}; + this._edgesMap = {}; + }; + + /** + * 是否是有向图 + * @return {boolean} + */ + Graph.prototype.isDirected = function () { + return this._directed; + }; + + /** + * 添加一个新的节点 + * @param {string} id 节点名称 + * @param {*} [data] 存储的数据 + */ + Graph.prototype.addNode = function (id, data) { + if (this._nodesMap[id]) { + return this._nodesMap[id]; + } + + var node = new Graph.Node(id, data); + + this.nodes.push(node); + + this._nodesMap[id] = node; + return node; + }; + + /** + * 获取节点 + * @param {string} id + * @return {module:echarts/data/Graph~Node} + */ + Graph.prototype.getNodeById = function (id) { + return this._nodesMap[id]; + }; + + /** + * 添加边 + * @param {string|module:echarts/data/Graph~Node} n1 + * @param {string|module:echarts/data/Graph~Node} n2 + * @param {*} data + * @return {module:echarts/data/Graph~Edge} + */ + Graph.prototype.addEdge = function (n1, n2, data) { + if (typeof(n1) == 'string') { + n1 = this._nodesMap[n1]; + } + if (typeof(n2) == 'string') { + n2 = this._nodesMap[n2]; + } + if (!n1 || !n2) { + return; + } + + var key = n1.id + '-' + n2.id; + if (this._edgesMap[key]) { + return this._edgesMap[key]; + } + + var edge = new Graph.Edge(n1, n2, data); + + if (this._directed) { + n1.outEdges.push(edge); + n2.inEdges.push(edge); + } + n1.edges.push(edge); + if (n1 !== n2) { + n2.edges.push(edge); + } + + this.edges.push(edge); + this._edgesMap[key] = edge; + + return edge; + }; + + /** + * 移除边 + * @param {module:echarts/data/Graph~Edge} edge + */ + Graph.prototype.removeEdge = function (edge) { + var n1 = edge.node1; + var n2 = edge.node2; + var key = n1.id + '-' + n2.id; + if (this._directed) { + n1.outEdges.splice(util.indexOf(n1.outEdges, edge), 1); + n2.inEdges.splice(util.indexOf(n2.inEdges, edge), 1); + } + n1.edges.splice(util.indexOf(n1.edges, edge), 1); + if (n1 !== n2) { + n2.edges.splice(util.indexOf(n2.edges, edge), 1); + } + + delete this._edgesMap[key]; + this.edges.splice(util.indexOf(this.edges, edge), 1); + }; + + /** + * 获取边 + * @param {module:echarts/data/Graph~Node|string} n1 + * @param {module:echarts/data/Graph~Node|string} n2 + * @return {module:echarts/data/Graph~Edge} + */ + Graph.prototype.getEdge = function (n1, n2) { + if (typeof(n1) !== 'string') { + n1 = n1.id; + } + if (typeof(n2) !== 'string') { + n2 = n2.id; + } + + if (this._directed) { + return this._edgesMap[n1 + '-' + n2]; + } else { + return this._edgesMap[n1 + '-' + n2] + || this._edgesMap[n2 + '-' + n1]; + } + }; + + /** + * 移除节点(及其邻接边) + * @param {module:echarts/data/Graph~Node|string} node + */ + Graph.prototype.removeNode = function (node) { + if (typeof(node) === 'string') { + node = this._nodesMap[node]; + if (!node) { + return; + } + } + + delete this._nodesMap[node.id]; + this.nodes.splice(util.indexOf(this.nodes, node), 1); + + for (var i = 0; i < this.edges.length;) { + var edge = this.edges[i]; + if (edge.node1 === node || edge.node2 === node) { + this.removeEdge(edge); + } else { + i++; + } + } + }; + + /** + * 遍历并且过滤指定的节点 + * @param {Function} cb + * @param {*} [context] + */ + Graph.prototype.filterNode = function (cb, context) { + var len = this.nodes.length; + for (var i = 0; i < len;) { + if (cb.call(context, this.nodes[i], i)) { + i++; + } else { + this.removeNode(this.nodes[i]); + len--; + } + } + }; + + /** + * 遍历并且过滤指定的边 + * @param {Function} cb + * @param {*} [context] + */ + Graph.prototype.filterEdge = function (cb, context) { + var len = this.edges.length; + for (var i = 0; i < len;) { + if (cb.call(context, this.edges[i], i)) { + i++; + } else { + this.removeEdge(this.edges[i]); + len--; + } + } + }; + + /** + * 线性遍历所有节点 + * @param {Function} cb + * @param {*} [context] + */ + Graph.prototype.eachNode = function (cb, context) { + var len = this.nodes.length; + for (var i = 0; i < len; i++) { + if (this.nodes[i]) { // 可能在遍历过程中存在节点删除 + cb.call(context, this.nodes[i], i); + } + } + }; + + /** + * 线性遍历所有边 + * @param {Function} cb + * @param {*} [context] + */ + Graph.prototype.eachEdge = function (cb, context) { + var len = this.edges.length; + for (var i = 0; i < len; i++) { + if (this.edges[i]) { // 可能在遍历过程中存在边删除 + cb.call(context, this.edges[i], i); + } + } + }; + + /** + * 清空图 + */ + Graph.prototype.clear = function() { + this.nodes.length = 0; + this.edges.length = 0; + + this._nodesMap = {}; + this._edgesMap = {}; + }; + + /** + * 广度优先遍历 + * @param {Function} cb + * @param {module:echarts/data/Graph~Node} startNode 遍历起始节点 + * @param {string} [direction=none] none, in, out 指定遍历边 + * @param {*} [context] 回调函数调用context + */ + Graph.prototype.breadthFirstTraverse = function ( + cb, startNode, direction, context + ) { + if (typeof(startNode) === 'string') { + startNode = this._nodesMap[startNode]; + } + if (!startNode) { + return; + } + + var edgeType = 'edges'; + if (direction === 'out') { + edgeType = 'outEdges'; + } else if (direction === 'in') { + edgeType = 'inEdges'; + } + + for (var i = 0; i < this.nodes.length; i++) { + this.nodes[i].__visited = false; + } + + if (cb.call(context, startNode, null)) { + return; + } + + var queue = [startNode]; + while (queue.length) { + var currentNode = queue.shift(); + var edges = currentNode[edgeType]; + + for (var i = 0; i < edges.length; i++) { + var e = edges[i]; + var otherNode = e.node1 === currentNode + ? e.node2 : e.node1; + if (!otherNode.__visited) { + if (cb.call(otherNode, otherNode, currentNode)) { + // Stop traversing + return; + } + queue.push(otherNode); + otherNode.__visited = true; + } + } + } + }; + + /** + * 复制图 + */ + Graph.prototype.clone = function () { + var graph = new Graph(this._directed); + for (var i = 0; i < this.nodes.length; i++) { + graph.addNode(this.nodes[i].id, this.nodes[i].data); + } + for (var i = 0; i < this.edges.length; i++) { + var e = this.edges[i]; + graph.addEdge(e.node1.id, e.node2.id, e.data); + } + return graph; + }; + + /** + * 图节点 + * @alias module:echarts/data/Graph~Node + * @param {string} id + * @param {*} [data] + */ + var Node = function(id, data) { + /** + * 节点名称 + * @type {string} + */ + this.id = id; + /** + * 节点存储的数据 + * @type {*} + */ + this.data = data || null; + /** + * 入边,只在有向图上有效 + * @type {Array.} + */ + this.inEdges = []; + /** + * 出边,只在有向图上有效 + * @type {Array.} + */ + this.outEdges = []; + /** + * 邻接边 + * @type {Array.} + */ + this.edges = []; + }; + + /** + * 度 + * @return {number} + */ + Node.prototype.degree = function() { + return this.edges.length; + }; + + /** + * 入度,只在有向图上有效 + * @return {number} + */ + Node.prototype.inDegree = function() { + return this.inEdges.length; + }; + + /** + * 出度,只在有向图上有效 + * @return {number} + */ + Node.prototype.outDegree = function() { + return this.outEdges.length; + }; + + /** + * 图边 + * @alias module:echarts/data/Graph~Edge + * @param {module:echarts/data/Graph~Node} node1 + * @param {module:echarts/data/Graph~Node} node2 + * @param {extra} data + */ + var Edge = function(node1, node2, data) { + /** + * 节点1,如果是有向图则为源节点 + * @type {module:echarts/data/Graph~Node} + */ + this.node1 = node1; + /** + * 节点2,如果是有向图则为目标节点 + * @type {module:echarts/data/Graph~Node} + */ + this.node2 = node2; + + /** + * 边存储的数据 + * @type {*} + */ + this.data = data || null; + }; + + Graph.Node = Node; + Graph.Edge = Edge; + + /** + * 从邻接矩阵生成 + * ``` + * TARGET + * -1--2--3--4--5- + * 1| x x x x x + * 2| x x x x x + * 3| x x x x x SOURCE + * 4| x x x x x + * 5| x x x x x + * ``` + * 节点的行列总和会被写到`node.data.value` + * 对于有向图会计算每一行的和写到`node.data.outValue`, + * 计算每一列的和写到`node.data.inValue`。 + * 边的权重会被然后写到`edge.data.weight`。 + * + * @method module:echarts/data/Graph.fromMatrix + * @param {Array.} nodesData 节点信息,必须有`id`属性, 会保存到`node.data`中 + * @param {Array} matrix 邻接矩阵 + * @param {boolean} directed 是否是有向图 + * @return {module:echarts/data/Graph} + */ + Graph.fromMatrix = function(nodesData, matrix, directed) { + if ( + !matrix || !matrix.length + || (matrix[0].length !== matrix.length) + || (nodesData.length !== matrix.length) + ) { + // Not a valid data + return; + } + + var size = matrix.length; + var graph = new Graph(directed); + + for (var i = 0; i < size; i++) { + var node = graph.addNode(nodesData[i].id, nodesData[i]); + // TODO + // node.data已经有value的情况 + node.data.value = 0; + if (directed) { + node.data.outValue = node.data.inValue = 0; + } + } + for (var i = 0; i < size; i++) { + for (var j = 0; j < size; j++) { + var item = matrix[i][j]; + if (directed) { + graph.nodes[i].data.outValue += item; + graph.nodes[j].data.inValue += item; + } + graph.nodes[i].data.value += item; + graph.nodes[j].data.value += item; + } + } + + for (var i = 0; i < size; i++) { + for (var j = i; j < size; j++) { + var item = matrix[i][j]; + if (item === 0) { + continue; + } + var n1 = graph.nodes[i]; + var n2 = graph.nodes[j]; + var edge = graph.addEdge(n1, n2, {}); + edge.data.weight = item; + if (i !== j) { + if (directed && matrix[j][i]) { + var inEdge = graph.addEdge(n2, n1, {}); + inEdge.data.weight = matrix[j][i]; + } + } + } + } + + // console.log(graph.edges.map(function (e) {return e.node1.id + '-' + e.node2.id;})) + + return graph; + }; + + return Graph; +}); \ No newline at end of file diff --git a/amd/data/KDTree.js b/amd/data/KDTree.js new file mode 100644 index 0000000..59880b6 --- /dev/null +++ b/amd/data/KDTree.js @@ -0,0 +1,247 @@ +/** + * K-Dimension Tree + * + * @module echarts/data/KDTree + * @author Yi Shen(https://github.com/pissang) + */ +define(function (require) { + + var quickSelect = require('./quickSelect'); + + function Node(axis, data) { + this.left = null; + this.right = null; + this.axis = axis; + + this.data = data; + }; + + /** + * @constructor + * @alias module:echarts/data/KDTree + * @param {Array} points List of points. + * each point needs an array property to repesent the actual data + * @param {Number} [dimension] + * Point dimension. + * Default will use the first point's length as dimensiont + */ + var KDTree = function (points, dimension) { + if (!points.length) { + return; + } + + if (!dimension) { + dimension = points[0].array.length; + } + this.dimension = dimension; + this.root = this._buildTree(points, 0, points.length - 1, 0); + + // Use one stack to avoid allocation + // each time searching the nearest point + this._stack = []; + // Again avoid allocating a new array + // each time searching nearest N points + this._nearstNList = []; + }; + + /** + * Resursively build the tree + */ + KDTree.prototype._buildTree = function (points, left, right, axis) { + if (right < left) { + return null; + } + + var medianIndex = Math.floor((left + right) / 2); + medianIndex = quickSelect( + points, left, right, medianIndex, + function (a, b) { + return a.array[axis] - b.array[axis]; + } + ); + var median = points[medianIndex]; + + var node = new Node(axis, median); + + axis = (axis + 1) % this.dimension; + if (right > left) { + node.left = this._buildTree(points, left, medianIndex - 1, axis); + node.right = this._buildTree(points, medianIndex + 1, right, axis); + } + + return node; + }; + + /** + * Find nearest point + * @param {Array} target Target point + * @param {Function} squaredDistance Squared distance function + * @return {Array} Nearest point + */ + KDTree.prototype.nearest = function (target, squaredDistance) { + var curr = this.root; + var stack = this._stack; + var idx = 0; + var minDist = Infinity; + var nearestNode = null; + if (curr.data !== target) { + minDist = squaredDistance(curr.data, target); + nearestNode = curr; + } + + if (target.array[curr.axis] < curr.data.array[curr.axis]) { + // Left first + curr.right && (stack[idx++] = curr.right); + curr.left && (stack[idx++] = curr.left); + } + else { + // Right first + curr.left && (stack[idx++] = curr.left); + curr.right && (stack[idx++] = curr.right); + } + + while (idx--) { + curr = stack[idx]; + var currDist = target.array[curr.axis] - curr.data.array[curr.axis]; + var isLeft = currDist < 0; + var needsCheckOtherSide = false; + currDist = currDist * currDist; + // Intersecting right hyperplane with minDist hypersphere + if (currDist < minDist) { + currDist = squaredDistance(curr.data, target); + if (currDist < minDist && curr.data !== target) { + minDist = currDist; + nearestNode = curr; + } + needsCheckOtherSide = true; + } + if (isLeft) { + if (needsCheckOtherSide) { + curr.right && (stack[idx++] = curr.right); + } + // Search in the left area + curr.left && (stack[idx++] = curr.left); + } + else { + if (needsCheckOtherSide) { + curr.left && (stack[idx++] = curr.left); + } + // Search the right area + curr.right && (stack[idx++] = curr.right); + } + } + + return nearestNode.data; + }; + + KDTree.prototype._addNearest = function (found, dist, node) { + var nearestNList = this._nearstNList; + + // Insert to the right position + // Sort from small to large + for (var i = found - 1; i > 0; i--) { + if (dist >= nearestNList[i - 1].dist) { + break; + } + else { + nearestNList[i].dist = nearestNList[i - 1].dist; + nearestNList[i].node = nearestNList[i - 1].node; + } + } + + nearestNList[i].dist = dist; + nearestNList[i].node = node; + }; + + /** + * Find nearest N points + * @param {Array} target Target point + * @param {number} N + * @param {Function} squaredDistance Squared distance function + * @param {Array} [output] Output nearest N points + */ + KDTree.prototype.nearestN = function (target, N, squaredDistance, output) { + if (N <= 0) { + output.length = 0; + return output; + } + + var curr = this.root; + var stack = this._stack; + var idx = 0; + + var nearestNList = this._nearstNList; + for (var i = 0; i < N; i++) { + // Allocate + if (!nearestNList[i]) { + nearestNList[i] = {} + } + nearestNList[i].dist = 0; + nearestNList[i].node = null; + } + var currDist = squaredDistance(curr.data, target); + + var found = 0; + if (curr.data !== target) { + found++; + this._addNearest(found, currDist, curr); + } + + if (target.array[curr.axis] < curr.data.array[curr.axis]) { + // Left first + curr.right && (stack[idx++] = curr.right); + curr.left && (stack[idx++] = curr.left); + } + else { + // Right first + curr.left && (stack[idx++] = curr.left); + curr.right && (stack[idx++] = curr.right); + } + + while (idx--) { + curr = stack[idx]; + var currDist = target.array[curr.axis] - curr.data.array[curr.axis]; + var isLeft = currDist < 0; + var needsCheckOtherSide = false; + currDist = currDist * currDist; + // Intersecting right hyperplane with minDist hypersphere + if (found < N || currDist < nearestNList[found - 1].dist) { + currDist = squaredDistance(curr.data, target); + if ( + (found < N || currDist < nearestNList[found - 1].dist) + && curr.data !== target + ) { + if (found < N) { + found++; + } + this._addNearest(found, currDist, curr); + } + needsCheckOtherSide = true; + } + if (isLeft) { + if (needsCheckOtherSide) { + curr.right && (stack[idx++] = curr.right); + } + // Search in the left area + curr.left && (stack[idx++] = curr.left); + } + else { + if (needsCheckOtherSide) { + curr.left && (stack[idx++] = curr.left); + } + // Search the right area + curr.right && (stack[idx++] = curr.right); + } + } + + // Copy to output + for (var i = 0; i < found; i++) { + output[i] = nearestNList[i].node.data; + } + output.length = found; + + return output; + } + + return KDTree; +}); \ No newline at end of file diff --git a/amd/data/Tree.js b/amd/data/Tree.js new file mode 100644 index 0000000..0546abc --- /dev/null +++ b/amd/data/Tree.js @@ -0,0 +1,133 @@ +/** + * Tree data structure + * + * @module echarts/data/Tree + * @author Yi Shen(https://www.github.com/pissang) + */ +define(function(require) { + + /** + * @constructor module:echarts/data/Tree~TreeNode + * @param {string} id Node ID + */ + function TreeNode(id) { + /** + * @type {string} + */ + this.id = id; + /** + * @type {number} + */ + this.depth = 0; + /** + * @type {number} + */ + this.height = 0; + /** + * @type {Array.} + */ + this.children = []; + } + + TreeNode.prototype.traverse = function (cb, context) { + cb.call(context, this); + + for (var i = 0; i < this.children.length; i++) { + this.children[i].traverse(cb, context); + } + }; + + TreeNode.prototype.updateDepthAndHeight = function (depth) { + var height = 0; + this.depth = depth; + for (var i = 0; i < this.children.length; i++) { + var child = this.children[i]; + child.updateDepthAndHeight(depth + 1); + if (child.height > height) { + height = child.height; + } + } + this.height = height + 1; + }; + + TreeNode.prototype.getNodeById = function (id) { + if (this.id === id) { + return this; + } + for (var i = 0; i < this.children.length; i++) { + var res = this.children[i].getNodeById(id); + if (res) { + return res; + } + } + }; + + /** + * @constructor + * @alias module:echarts/data/Tree + * @param {string} id + */ + function Tree(id) { + /** + * @type {module:echarts/data/Tree~TreeNode} + */ + this.root = new TreeNode(id); + } + + Tree.prototype.traverse = function(cb, context) { + this.root.traverse(cb, context); + }; + + Tree.prototype.getSubTree = function(id) { + var root = this.getNodeById(id); + if (root) { + var tree = new Tree(root.id); + tree.root = root; + return tree; + } + }; + + Tree.prototype.getNodeById = function (id) { + return this.root.getNodeById(id); + }; + + // TODO + Tree.fromGraph = function (graph) { + + function buildHierarch(root) { + var graphNode = graph.getNodeById(root.id); + for (var i = 0; i < graphNode.outEdges.length; i++) { + var edge = graphNode.outEdges[i]; + var childTreeNode = treeNodesMap[edge.node2.id]; + root.children.push(childTreeNode); + buildHierarch(childTreeNode); + } + } + + var treeMap = {}; + var treeNodesMap = {}; + for (var i = 0; i < graph.nodes.length; i++) { + var node = graph.nodes[i]; + var treeNode; + if (node.inDegree() === 0) { + treeMap[node.id] = new Tree(node.id); + treeNode = treeMap[node.id].root; + } else { + treeNode = new TreeNode(node.id); + } + + treeNode.data = node.data; + + treeNodesMap[node.id] = treeNode; + } + var treeList = []; + for (var id in treeMap) { + buildHierarch(treeMap[id].root); + treeMap[id].root.updateDepthAndHeight(0); + treeList.push(treeMap[id]); + } + return treeList; + }; + + return Tree; +}); \ No newline at end of file diff --git a/amd/data/quickSelect.js b/amd/data/quickSelect.js new file mode 100644 index 0000000..a462d8b --- /dev/null +++ b/amd/data/quickSelect.js @@ -0,0 +1,79 @@ +/** + * Quick select n-th element in an array. + * + * Note: it will change the elements placement in array. + * + * @module echarts/data/quickSelect + * @author Yi Shen(https://github.com/pissang) + */ +define(function (require) { + + function defaultCompareFunc(a, b) { + return a - b; + } + + function swapElement(list, idx0, idx1) { + var tmp = list[idx0]; + list[idx0] = list[idx1]; + list[idx1] = tmp; + } + + function select(list, left, right, nth, compareFunc) { + var pivotIdx = left; + while (right > left) { + var pivotIdx = Math.round((right + left) / 2); + var pivotValue = list[pivotIdx]; + // Swap pivot to the end + swapElement(list, pivotIdx, right); + pivotIdx = left; + for (var i = left; i <= right - 1; i++) { + if (compareFunc(pivotValue, list[i]) >= 0) { + swapElement(list, i, pivotIdx); + pivotIdx++; + } + } + swapElement(list, right, pivotIdx); + + if (pivotIdx === nth) { + return pivotIdx; + } else if (pivotIdx < nth) { + left = pivotIdx + 1; + } else { + right = pivotIdx - 1; + } + } + // Left == right + return left; + } + + /** + * @alias module:echarts/data/quickSelect + * @param {Array} list + * @param {number} [left] + * @param {number} [right] + * @param {number} nth + * @param {Function} [compareFunc] + * @example + * var quickSelect = require('echarts/data/quickSelect'); + * var list = [5, 2, 1, 4, 3] + * quickSelect(list, 3); + * quickSelect(list, 0, 3, 1, function (a, b) {return a - b}); + * + * @return {number} + */ + function quickSelect(list, left, right, nth, compareFunc) { + if (arguments.length <= 3) { + nth = left; + if (arguments.length == 2) { + compareFunc = defaultCompareFunc; + } else { + compareFunc = right; + } + left = 0; + right = list.length - 1; + } + return select(list, left, right, nth, compareFunc); + } + + return quickSelect; +}); \ No newline at end of file diff --git a/amd/echarts.js b/amd/echarts.js index 6026c60..11bb8a5 100644 --- a/amd/echarts.js +++ b/amd/echarts.js @@ -1,7 +1,7 @@ /*! * ECharts, a javascript interactive chart library. * - * Copyright (c) 2014, Baidu Inc. + * Copyright (c) 2015, Baidu Inc. * All rights reserved. * * LICENSE @@ -12,7 +12,7 @@ * echarts * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ define(function (require) { @@ -27,20 +27,18 @@ define(function (require) { var _instances = {}; // ECharts实例map索引 var DOM_ATTRIBUTE_KEY = '_echarts_instance_'; - self.version = '2.0.2'; + self.version = '2.2.0'; self.dependencies = { - zrender : '2.0.2' + zrender: '2.0.7' }; /** * 入口方法 */ self.init = function (dom, theme) { var zrender = require('./zrender/zrender'); - if (((zrender.version || '1.0.3').replace('.', '') - 0) - < (self.dependencies.zrender.replace('.', '') - 0) - ) { + if ((zrender.version.replace('.', '') - 0) < (self.dependencies.zrender.replace('.', '') - 0)) { console.error( - 'ZRender ' + (zrender.version || '1.0.3-') + 'ZRender ' + zrender.version + ' is too old for ECharts ' + self.version + '. Current version need ZRender ' + self.dependencies.zrender + '+' @@ -62,6 +60,7 @@ define(function (require) { } _instances[key] = new Echarts(dom); _instances[key].id = key; + _instances[key].canvasSupported = _canvasSupported; _instances[key].setTheme(theme); return _instances[key]; @@ -87,7 +86,11 @@ define(function (require) { * @param {HtmlElement} dom 必要 */ function Echarts(dom) { - this._themeConfig = zrUtil.clone(ecConfig); + // Fxxk IE11 for breaking initialization without a warrant; + // Just set something to let it be! + // by kener 2015-01-09 + dom.innerHTML = ''; + this._themeConfig = {}; // zrUtil.clone(ecConfig); this.dom = dom; // this._zr; @@ -100,9 +103,9 @@ define(function (require) { this._connected = false; this._status = { // 用于图表间通信 - dragIn : false, - dragOut : false, - needRefresh : false + dragIn: false, + dragOut: false, + needRefresh: false }; this._curEventType = false; // 破循环信号灯 this._chartList = []; // 图表实例 @@ -135,7 +138,7 @@ define(function (require) { * @type {Array} */ var ZR_EVENT_LISTENS = [ - 'CLICK', 'MOUSEOVER', + 'CLICK', 'DBLCLICK', 'MOUSEOVER', 'MOUSEOUT', 'DRAGSTART', 'DRAGEND', 'DRAGENTER', 'DRAGOVER', 'DRAGLEAVE', 'DROP' ]; @@ -167,11 +170,11 @@ define(function (require) { /** * 初始化::构造函数 */ - _init : function () { + _init: function () { var self = this; var _zr = require('./zrender/zrender').init(this.dom); this._zr = _zr; - + // wrap: n,e,d,t for name event data this this._messageCenter.dispatch = function(type, event, eventPackage, that) { eventPackage = eventPackage || {}; @@ -179,7 +182,7 @@ define(function (require) { eventPackage.event = event; self._messageCenter.dispatchWithContext(type, eventPackage, that); - if (type != 'HOVER') { + if (type != 'HOVER' && type != 'MOUSEOUT') { // 频繁事件直接抛出 setTimeout(function(){ self._messageCenterOutSide.dispatchWithContext( type, eventPackage, that @@ -197,7 +200,9 @@ define(function (require) { return self.__onevent(param); }; for (var e in ecConfig.EVENT) { - if (e != 'CLICK' && e != 'HOVER' && e != 'MAP_ROAM') { + if (e != 'CLICK' && e != 'DBLCLICK' + && e != 'HOVER' && e != 'MOUSEOUT' && e != 'MAP_ROAM' + ) { this._messageCenter.bind(ecConfig.EVENT[e], this._onevent, this); } } @@ -224,27 +229,31 @@ define(function (require) { var Island = require('./chart/island'); this._island = new Island(this._themeConfig, this._messageCenter, _zr, {}, this); this.chart.island = this._island; - + // 内置通用组件 // 工具箱 var Toolbox = require('./component/toolbox'); this._toolbox = new Toolbox(this._themeConfig, this._messageCenter, _zr, {}, this); this.component.toolbox = this._toolbox; - + var componentLibrary = require('./component'); componentLibrary.define('title', require('./component/title')); componentLibrary.define('tooltip', require('./component/tooltip')); componentLibrary.define('legend', require('./component/legend')); + + if (_zr.getWidth() === 0 || _zr.getHeight() === 0) { + console.error('Dom’s width & height should be ready before init.'); + } }, /** * ECharts事件处理中心 */ - __onevent : function (param){ + __onevent: function (param){ param.__echartsId = param.__echartsId || this.id; // 来自其他联动图表的事件 - var fromMyself = (param.__echartsId == this.id); + var fromMyself = (param.__echartsId === this.id); if (!this._curEventType) { this._curEventType = param.type; @@ -301,9 +310,9 @@ define(function (require) { this._zr.trigger( 'mousemove', { - connectTrigger : true, - zrenderX : grid.getX() + param.x * grid.getWidth(), - zrenderY : grid.getY() + param.y * grid.getHeight() + connectTrigger: true, + zrenderX: grid.getX() + param.x * grid.getWidth(), + zrenderY: grid.getY() + param.y * grid.getHeight() } ); } @@ -327,7 +336,7 @@ define(function (require) { } // 多图联动,只做自己的一级事件分发,避免级联事件循环 - if (this._connected && fromMyself && this._curEventType == param.type) { + if (this._connected && fromMyself && this._curEventType === param.type) { for (var c in this._connected) { this._connected[c].connectedEventHandler(param); } @@ -343,7 +352,7 @@ define(function (require) { /** * 点击事件,响应zrender事件,包装后分发到Echarts层 */ - _onclick : function (param) { + _onclick: function (param) { callChartListMethodReverse(this, 'onclick', param); if (param.target) { @@ -358,11 +367,30 @@ define(function (require) { } } }, + + /** + * 双击事件,响应zrender事件,包装后分发到Echarts层 + */ + _ondblclick: function (param) { + callChartListMethodReverse(this, 'ondblclick', param); - /** - * 鼠标移入事件,响应zrender事件,包装后分发到Echarts层 - */ - _onmouseover : function (param) { + if (param.target) { + var ecData = this._eventPackage(param.target); + if (ecData && ecData.seriesIndex != null) { + this._messageCenter.dispatch( + ecConfig.EVENT.DBLCLICK, + param.event, + ecData, + this + ); + } + } + }, + + /** + * 鼠标移入事件,响应zrender事件,包装后分发到Echarts层 + */ + _onmouseover: function (param) { if (param.target) { var ecData = this._eventPackage(param.target); if (ecData && ecData.seriesIndex != null) { @@ -375,16 +403,33 @@ define(function (require) { } } }, + + /** + * 鼠标移出事件,响应zrender事件,包装后分发到Echarts层 + */ + _onmouseout: function (param) { + if (param.target) { + var ecData = this._eventPackage(param.target); + if (ecData && ecData.seriesIndex != null) { + this._messageCenter.dispatch( + ecConfig.EVENT.MOUSEOUT, + param.event, + ecData, + this + ); + } + } + }, /** * dragstart回调,可计算特性实现 */ - _ondragstart : function (param) { + _ondragstart: function (param) { // 复位用于图表间通信拖拽标识 this._status = { - dragIn : false, - dragOut : false, - needRefresh : false + dragIn: false, + dragOut: false, + needRefresh: false }; callChartListMethodReverse(this, 'ondragstart', param); @@ -393,28 +438,28 @@ define(function (require) { /** * dragging回调,可计算特性实现 */ - _ondragenter : function (param) { + _ondragenter: function (param) { callChartListMethodReverse(this, 'ondragenter', param); }, /** * dragstart回调,可计算特性实现 */ - _ondragover : function (param) { + _ondragover: function (param) { callChartListMethodReverse(this, 'ondragover', param); }, /** * dragstart回调,可计算特性实现 */ - _ondragleave : function (param) { + _ondragleave: function (param) { callChartListMethodReverse(this, 'ondragleave', param); }, /** * dragstart回调,可计算特性实现 */ - _ondrop : function (param) { + _ondrop: function (param) { callChartListMethodReverse(this, 'ondrop', param, this._status); this._island.ondrop(param, this._status); }, @@ -422,7 +467,7 @@ define(function (require) { /** * dragdone回调 ,可计算特性实现 */ - _ondragend : function (param) { + _ondragend: function (param) { callChartListMethodReverse(this, 'ondragend', param, this._status); this._timeline && this._timeline.ondragend(param, this._status); @@ -446,7 +491,7 @@ define(function (require) { /** * 图例选择响应 */ - _onlegendSelected : function (param) { + _onlegendSelected: function (param) { // 用于图表间通信 this._status.needRefresh = false; callChartListMethodReverse(this, 'onlegendSelected', param, this._status); @@ -459,7 +504,7 @@ define(function (require) { /** * 数据区域缩放响应 */ - _ondataZoom : function (param) { + _ondataZoom: function (param) { // 用于图表间通信 this._status.needRefresh = false; callChartListMethodReverse(this, 'ondataZoom', param, this._status); @@ -472,7 +517,7 @@ define(function (require) { /** * 值域漫游响应 */ - _ondataRange : function (param) { + _ondataRange: function (param) { this._clearEffect(); // 用于图表间通信 this._status.needRefresh = false; @@ -480,14 +525,14 @@ define(function (require) { // 没有相互影响,直接刷新即可 if (this._status.needRefresh) { - this._zr.refresh(); + this._zr.refreshNextFrame(); } }, /** * 动态类型切换响应 */ - _onmagicTypeChanged : function () { + _onmagicTypeChanged: function () { this._clearEffect(); this._render(this._toolbox.getMagicOption()); }, @@ -495,7 +540,7 @@ define(function (require) { /** * 数据视图修改响应 */ - _ondataViewChanged : function (param) { + _ondataViewChanged: function (param) { this._syncBackupData(param.option); this._messageCenter.dispatch( ecConfig.EVENT.DATA_CHANGED, @@ -509,7 +554,7 @@ define(function (require) { /** * tooltip与图表间通信 */ - _tooltipHover : function (param) { + _tooltipHover: function (param) { var tipShape = []; callChartListMethodReverse(this, 'ontooltipHover', param, tipShape); }, @@ -517,14 +562,14 @@ define(function (require) { /** * 还原 */ - _onrestore : function () { + _onrestore: function () { this.restore(); }, /** * 刷新 */ - _onrefresh : function (param) { + _onrefresh: function (param) { this._refreshInside = true; this.refresh(param); this._refreshInside = false; @@ -533,14 +578,14 @@ define(function (require) { /** * 数据修改后的反向同步dataZoom持有的备份数据 */ - _syncBackupData : function (curOption) { + _syncBackupData: function (curOption) { this.component.dataZoom && this.component.dataZoom.syncBackupData(curOption); }, /** * 打包Echarts层的事件附件 */ - _eventPackage : function (target) { + _eventPackage: function (target) { if (target) { var ecData = require('./util/ecData'); @@ -554,23 +599,60 @@ define(function (require) { ) : dataIndex; return { - seriesIndex : seriesIndex, - dataIndex : dataIndex, - data : ecData.get(target, 'data'), - name : ecData.get(target, 'name'), - value : ecData.get(target, 'value'), - special : ecData.get(target, 'special') + seriesIndex: seriesIndex, + seriesName: (ecData.get(target, 'series') || {}).name, + dataIndex: dataIndex, + data: ecData.get(target, 'data'), + name: ecData.get(target, 'name'), + value: ecData.get(target, 'value'), + special: ecData.get(target, 'special') }; } return; }, + _noDataCheck: function(magicOption) { + var series = magicOption.series; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type == ecConfig.CHART_TYPE_MAP + || (series[i].data && series[i].data.length > 0) + || (series[i].markPoint && series[i].markPoint.data && series[i].markPoint.data.length > 0) + || (series[i].markLine && series[i].markLine.data && series[i].markLine.data.length > 0) + || (series[i].nodes && series[i].nodes.length > 0) + || (series[i].links && series[i].links.length > 0) + || (series[i].matrix && series[i].matrix.length > 0) + || (series[i].eventList && series[i].eventList.length > 0) + ) { + return false; // 存在任意数据则为非空数据 + } + } + // 空数据 + this.clear(); + var loadOption = (this._option && this._option.noDataLoadingOption) + || this._themeConfig.noDataLoadingOption + || ecConfig.noDataLoadingOption + || { + text: (this._option && this._option.noDataText) + || this._themeConfig.noDataText + || ecConfig.noDataText, + effect: (this._option && this._option.noDataEffect) + || this._themeConfig.noDataEffect + || ecConfig.noDataEffect + }; + this.showLoading(loadOption); + return true; + }, + /** * 图表渲染 */ - _render : function (magicOption) { + _render: function (magicOption) { this._mergeGlobalConifg(magicOption); + if (this._noDataCheck(magicOption)) { + return; + } + var bgColor = magicOption.backgroundColor; if (bgColor) { if (!_canvasSupported @@ -602,7 +684,7 @@ define(function (require) { } var componentList = [ - 'title', 'legend', 'tooltip', 'dataRange', + 'title', 'legend', 'tooltip', 'dataRange', 'roamController', 'grid', 'dataZoom', 'xAxis', 'yAxis', 'polar' ]; @@ -722,7 +804,7 @@ define(function (require) { /** * 还原 */ - restore : function () { + restore: function () { this._clearEffect(); this._option = zrUtil.clone(this._optionRestore); this._disposeChartList(); @@ -735,7 +817,7 @@ define(function (require) { * 刷新 * @param {Object=} param,可选参数,用于附带option,内部同步用,外部不建议带入数据修改,无法同步 */ - refresh : function (param) { + refresh: function (param) { this._clearEffect(); param = param || {}; var magicOption = param.option; @@ -767,7 +849,7 @@ define(function (require) { /** * 释放图表实例 */ - _disposeChartList : function () { + _disposeChartList: function () { this._clearEffect(); // 停止动画 @@ -791,7 +873,7 @@ define(function (require) { /** * 非图表全局属性merge~~ */ - _mergeGlobalConifg : function (magicOption) { + _mergeGlobalConifg: function (magicOption) { var mergeList = [ // 背景颜色 'backgroundColor', @@ -803,7 +885,8 @@ define(function (require) { 'nameConnector', 'valueConnector', // 动画相关 - 'animation', 'animationThreshold', 'animationDuration', + 'animation', 'animationThreshold', + 'animationDuration', 'animationDurationUpdate', 'animationEasing', 'addDataAnimation', // 默认标志图形类型列表 @@ -817,20 +900,28 @@ define(function (require) { while (len--) { var mergeItem = mergeList[len]; if (magicOption[mergeItem] == null) { - magicOption[mergeItem] = this._themeConfig[mergeItem]; + magicOption[mergeItem] = this._themeConfig[mergeItem] != null + ? this._themeConfig[mergeItem] + : ecConfig[mergeItem]; } } // 数值系列的颜色列表,不传则采用内置颜色,可配数组,借用zrender实例注入,会有冲突风险,先这样 var themeColor = magicOption.color; if (!(themeColor && themeColor.length)) { - themeColor = this._themeConfig.color; + themeColor = this._themeConfig.color || ecConfig.color; } - + this._zr.getColor = function (idx) { var zrColor = require('./zrender/tool/color'); return zrColor.getColor(idx, themeColor); }; + + if (!_canvasSupported) { + // 不支持Canvas的强制关闭动画 + magicOption.animation = false; + magicOption.addDataAnimation = false; + } }, /** @@ -839,7 +930,7 @@ define(function (require) { * @param {boolean=} notMerge 多次调用时option选项是默认是合并(merge)的, * 如果不需求,可以通过notMerger参数为true阻止与上次option的合并 */ - setOption : function (option, notMerge) { + setOption: function (option, notMerge) { if (!option.timeline) { return this._setOption(option, notMerge); } @@ -854,7 +945,7 @@ define(function (require) { * @param {boolean=} notMerge 多次调用时option选项是默认是合并(merge)的, * 如果不需求,可以通过notMerger参数为true阻止与上次option的合并 */ - _setOption : function (option, notMerge) { + _setOption: function (option, notMerge) { if (!notMerge && this._option) { this._option = zrUtil.merge( this.getOption(), @@ -893,7 +984,7 @@ define(function (require) { /** * 返回内部持有的当前显示option克隆 */ - getOption : function () { + getOption: function () { var magicOption = zrUtil.clone(this._option); var self = this; @@ -933,7 +1024,7 @@ define(function (require) { * @param {boolean=} notMerge 多次调用时option选项是默认是合并(merge)的, * 如果不需求,可以通过notMerger参数为true阻止与上次option的合并。 */ - setSeries : function (series, notMerge) { + setSeries: function (series, notMerge) { if (!notMerge) { this.setOption({series: series}); } @@ -947,7 +1038,7 @@ define(function (require) { /** * 返回内部持有的当前显示series克隆 */ - getSeries : function () { + getSeries: function () { return this.getOption().series; }, @@ -955,7 +1046,7 @@ define(function (require) { * timelineOption接口,配置图表实例任何可配置选项 * @param {Object} option */ - _setTimelineOption : function(option) { + _setTimelineOption: function(option) { this._timeline && this._timeline.dispose(); var Timeline = require('./component/timeline'); var timeline = new Timeline( @@ -976,7 +1067,7 @@ define(function (require) { * @param {boolean=} dataGrow 是否增长数据队列长度,默认,不指定或false时移出目标数组对位数据 * @param {string=} additionData 是否增加类目轴(饼图为图例)数据,附加操作同isHead和dataGrow */ - addData : function (seriesIdx, data, isHead, dataGrow, additionData) { + addData: function (seriesIdx, data, isHead, dataGrow, additionData) { var params = seriesIdx instanceof Array ? seriesIdx : [[seriesIdx, data, isHead, dataGrow, additionData]]; @@ -991,7 +1082,6 @@ define(function (require) { dataGrow = params[i][3]; additionData = params[i][4]; - var seriesItem = optionRestore.series[seriesIdx]; var inMethod = isHead ? 'unshift' : 'push'; var outMethod = isHead ? 'pop' : 'shift'; @@ -1006,12 +1096,11 @@ define(function (require) { data = mSeriesItemData[outMethod](); } - if (additionData != null) { var legend; var legendData; - if (seriesItem.type == ecConfig.CHART_TYPE_PIE + if (seriesItem.type === ecConfig.CHART_TYPE_PIE && (legend = optionRestore.legend) && (legendData = legend.data) ) { @@ -1033,8 +1122,8 @@ define(function (require) { var mAxisData; var axisIdx = seriesItem.xAxisIndex || 0; - if (typeof optionRestore.xAxis[axisIdx].type == 'undefined' - || optionRestore.xAxis[axisIdx].type == 'category' + if (optionRestore.xAxis[axisIdx].type == null + || optionRestore.xAxis[axisIdx].type === 'category' ) { axisData = optionRestore.xAxis[axisIdx].data; mAxisData = magicOption.xAxis[axisIdx].data; @@ -1049,7 +1138,7 @@ define(function (require) { // y轴类目 axisIdx = seriesItem.yAxisIndex || 0; - if (optionRestore.yAxis[axisIdx].type == 'category') { + if (optionRestore.yAxis[axisIdx].type === 'category') { axisData = optionRestore.yAxis[axisIdx].data; mAxisData = magicOption.yAxis[axisIdx].data; @@ -1097,7 +1186,7 @@ define(function (require) { {option: magicOption}, self ); - }, magicOption.addDataAnimation ? 500 : 0); + }, magicOption.addDataAnimation ? magicOption.animationDurationUpdate : 0); return this; }, @@ -1106,15 +1195,15 @@ define(function (require) { * @param {number} seriesIdx 系列索引 * @param {Object} markData [标注 | 标线]对象,支持多个 */ - addMarkPoint : function (seriesIdx, markData) { + addMarkPoint: function (seriesIdx, markData) { return this._addMark(seriesIdx, markData, 'markPoint'); }, - addMarkLine : function (seriesIdx, markData) { + addMarkLine: function (seriesIdx, markData) { return this._addMark(seriesIdx, markData, 'markLine'); }, - _addMark : function (seriesIdx, markData, markType) { + _addMark: function (seriesIdx, markData, markType) { var series = this._option.series; var seriesItem; @@ -1128,14 +1217,12 @@ define(function (require) { markOptR = seriesRItem[markType] = markOptR || {data: []}; for (var key in markData) { - if (key == 'data') { + if (key === 'data') { // 数据concat markOpt.data = markOpt.data.concat(markData.data); markOptR.data = markOptR.data.concat(markData.data); } - else if (typeof markData[key] != 'object' - || typeof markOpt[key] == 'undefined' - ) { + else if (typeof markData[key] != 'object' || markOpt[key] == null) { // 简单类型或新值直接赋值 markOpt[key] = markOptR[key] = markData[key]; } @@ -1158,15 +1245,15 @@ define(function (require) { * @param {number} seriesIdx 系列索引 * @param {string} markName [标注 | 标线]名称 */ - delMarkPoint : function (seriesIdx, markName) { + delMarkPoint: function (seriesIdx, markName) { return this._delMark(seriesIdx, markName, 'markPoint'); }, - delMarkLine : function (seriesIdx, markName) { + delMarkLine: function (seriesIdx, markName) { return this._delMark(seriesIdx, markName, 'markLine'); }, - _delMark : function (seriesIdx, markName, markType) { + _delMark: function (seriesIdx, markName, markType) { var series = this._option.series; var seriesItem; var mark; @@ -1188,14 +1275,14 @@ define(function (require) { for (var i = 0, l = dataArray.length; i < l; i++) { var dataItem = dataArray[i]; if (dataItem instanceof Array) { - if (dataItem[0].name == markName[0] - && dataItem[1].name == markName[1] + if (dataItem[0].name === markName[0] + && dataItem[1].name === markName[1] ) { targetIndex = i; break; } } - else if (dataItem.name == markName[0]) { + else if (dataItem.name === markName[0]) { targetIndex = i; break; } @@ -1215,14 +1302,14 @@ define(function (require) { /** * 获取当前dom */ - getDom : function () { + getDom: function () { return this.dom; }, /** * 获取当前zrender实例,可用于添加额为的shape和深度控制 */ - getZrender : function () { + getZrender: function () { return this._zr; }, @@ -1231,7 +1318,7 @@ define(function (require) { * @param {string} imgType 图片类型,支持png|jpeg,默认为png * @return imgDataURL */ - getDataURL : function (imgType) { + getDataURL: function (imgType) { if (!_canvasSupported) { return ''; } @@ -1257,7 +1344,7 @@ define(function (require) { } var bgColor = this._option.backgroundColor; - if (bgColor && bgColor.replace(' ','') == 'rgba(0,0,0,0)') { + if (bgColor && bgColor.replace(' ','') === 'rgba(0,0,0,0)') { bgColor = '#fff'; } @@ -1269,7 +1356,7 @@ define(function (require) { * @param {string} imgType 图片类型,支持png|jpeg,默认为png * @return img dom */ - getImage : function (imgType) { + getImage: function (imgType) { var title = this._optionRestore.title; var imgDom = document.createElement('img'); imgDom.src = this.getDataURL(imgType); @@ -1282,19 +1369,19 @@ define(function (require) { * @param {string} imgType 图片类型,支持png|jpeg,默认为png * @return imgDataURL */ - getConnectedDataURL : function (imgType) { + getConnectedDataURL: function (imgType) { if (!this.isConnected()) { return this.getDataURL(imgType); } var tempDom = this.dom; var imgList = { - 'self' : { - img : this.getDataURL(imgType), - left : tempDom.offsetLeft, - top : tempDom.offsetTop, - right : tempDom.offsetLeft + tempDom.offsetWidth, - bottom : tempDom.offsetTop + tempDom.offsetHeight + 'self': { + img: this.getDataURL(imgType), + left: tempDom.offsetLeft, + top: tempDom.offsetTop, + right: tempDom.offsetLeft + tempDom.offsetWidth, + bottom: tempDom.offsetTop + tempDom.offsetHeight } }; @@ -1306,11 +1393,11 @@ define(function (require) { for (var c in this._connected) { tempDom = this._connected[c].getDom(); imgList[c] = { - img : this._connected[c].getDataURL(imgType), - left : tempDom.offsetLeft, - top : tempDom.offsetTop, - right : tempDom.offsetLeft + tempDom.offsetWidth, - bottom : tempDom.offsetTop + tempDom.offsetHeight + img: this._connected[c].getDataURL(imgType), + left: tempDom.offsetLeft, + top: tempDom.offsetTop, + right: tempDom.offsetLeft + tempDom.offsetWidth, + bottom: tempDom.offsetTop + tempDom.offsetHeight }; minLeft = Math.min(minLeft, imgList[c].left); @@ -1331,17 +1418,17 @@ define(function (require) { var ImageShape = require('./zrender/shape/Image'); for (var c in imgList) { zrImg.addShape(new ImageShape({ - style : { - x : imgList[c].left - minLeft, - y : imgList[c].top - minTop, - image : imgList[c].img + style: { + x: imgList[c].left - minLeft, + y: imgList[c].top - minTop, + image: imgList[c].img } })); } zrImg.render(); var bgColor = this._option.backgroundColor; - if (bgColor && bgColor.replace(/ /g, '') == 'rgba(0,0,0,0)') { + if (bgColor && bgColor.replace(/ /g, '') === 'rgba(0,0,0,0)') { bgColor = '#fff'; } @@ -1361,7 +1448,7 @@ define(function (require) { * @param {string} imgType 图片类型,支持png|jpeg,默认为png * @return img dom */ - getConnectedImage : function (imgType) { + getConnectedImage: function (imgType) { var title = this._optionRestore.title; var imgDom = document.createElement('img'); imgDom.src = this.getConnectedDataURL(imgType); @@ -1374,7 +1461,7 @@ define(function (require) { * @param {Object} eventName 事件名称 * @param {Object} eventListener 事件响应函数 */ - on : function (eventName, eventListener) { + on: function (eventName, eventListener) { this._messageCenterOutSide.bind(eventName, eventListener, this); return this; }, @@ -1384,7 +1471,7 @@ define(function (require) { * @param {Object} eventName 事件名称 * @param {Object} eventListener 事件响应函数 */ - un : function (eventName, eventListener) { + un: function (eventName, eventListener) { this._messageCenterOutSide.unbind(eventName, eventListener); return this; }, @@ -1393,7 +1480,7 @@ define(function (require) { * 多图联动 * @param connectTarget{ECharts | Array } connectTarget 联动目标 */ - connect : function (connectTarget) { + connect: function (connectTarget) { if (!connectTarget) { return this; } @@ -1418,7 +1505,7 @@ define(function (require) { * 解除多图联动 * @param connectTarget{ECharts | Array } connectTarget 解除联动目标 */ - disConnect : function (connectTarget) { + disConnect: function (connectTarget) { if (!connectTarget || !this._connected) { return this; } @@ -1444,7 +1531,7 @@ define(function (require) { /** * 联动事件响应 */ - connectedEventHandler : function (param) { + connectedEventHandler: function (param) { if (param.__echartsId != this.id) { // 来自其他联动图表的事件 this._onevent(param); @@ -1454,7 +1541,7 @@ define(function (require) { /** * 是否存在多图联动 */ - isConnected : function () { + isConnected: function () { return !!this._connected; }, @@ -1462,14 +1549,14 @@ define(function (require) { * 显示loading过渡 * @param {Object} loadingOption */ - showLoading : function (loadingOption) { + showLoading: function (loadingOption) { var effectList = { - bar : require('./zrender/loadingEffect/Bar'), - bubble : require('./zrender/loadingEffect/Bubble'), - dynamicLine : require('./zrender/loadingEffect/DynamicLine'), - ring : require('./zrender/loadingEffect/Ring'), - spin : require('./zrender/loadingEffect/Spin'), - whirling : require('./zrender/loadingEffect/Whirling') + bar: require('./zrender/loadingEffect/Bar'), + bubble: require('./zrender/loadingEffect/Bubble'), + dynamicLine: require('./zrender/loadingEffect/DynamicLine'), + ring: require('./zrender/loadingEffect/Ring'), + spin: require('./zrender/loadingEffect/Spin'), + whirling: require('./zrender/loadingEffect/Whirling') }; this._toolbox.hideDataView(); @@ -1479,15 +1566,22 @@ define(function (require) { loadingOption.textStyle = textStyle; var finalTextStyle = zrUtil.merge( - zrUtil.clone(textStyle), - this._themeConfig.textStyle + zrUtil.merge( + zrUtil.clone(textStyle), + this._themeConfig.textStyle + ), + ecConfig.textStyle ); + textStyle.textFont = finalTextStyle.fontStyle + ' ' + finalTextStyle.fontWeight + ' ' + finalTextStyle.fontSize + 'px ' + finalTextStyle.fontFamily; - textStyle.text = loadingOption.text || this._themeConfig.loadingText; + textStyle.text = loadingOption.text + || (this._option && this._option.loadingText) + || this._themeConfig.loadingText + || ecConfig.loadingText; if (loadingOption.x != null) { textStyle.x = loadingOption.x; @@ -1500,8 +1594,14 @@ define(function (require) { loadingOption.effectOption.textStyle = textStyle; var Effect = loadingOption.effect; - if (typeof Effect == 'string' || Effect == null) { - Effect = effectList[loadingOption.effect || 'spin']; + if (typeof Effect === 'string' || Effect == null) { + Effect = effectList[ + loadingOption.effect + || (this._option && this._option.loadingEffect) + || this._themeConfig.loadingEffect + || ecConfig.loadingEffect + ] + || effectList.spin; } this._zr.showLoading(new Effect(loadingOption.effectOption)); return this; @@ -1510,7 +1610,7 @@ define(function (require) { /** * 隐藏loading过渡 */ - hideLoading : function () { + hideLoading: function () { this._zr.hideLoading(); return this; }, @@ -1518,43 +1618,53 @@ define(function (require) { /** * 主题设置 */ - setTheme : function (theme) { + setTheme: function (theme) { if (theme) { if (typeof theme === 'string') { // 默认主题 switch (theme) { - // case 'themename': - // theme = require('./theme/themename'); + case 'macarons': + theme = require('./theme/macarons'); + break; + case 'infographic': + theme = require('./theme/infographic'); + break; default: - theme = require('./theme/default'); + theme = {}; // require('./theme/default'); } } else { theme = theme || {}; } - // 复位默认配置 - // this._themeConfig会被别的对象引用持有 - // 所以不能改成this._themeConfig = {}; - for (var key in this._themeConfig) { - delete this._themeConfig[key]; - } - for (var key in ecConfig) { - this._themeConfig[key] = zrUtil.clone(ecConfig[key]); - } + // // 复位默认配置 + // // this._themeConfig会被别的对象引用持有 + // // 所以不能改成this._themeConfig = {}; + // for (var key in this._themeConfig) { + // delete this._themeConfig[key]; + // } + // for (var key in ecConfig) { + // this._themeConfig[key] = zrUtil.clone(ecConfig[key]); + // } - // 颜色数组随theme,不merge - theme.color && (this._themeConfig.color = []); + // // 颜色数组随theme,不merge + // theme.color && (this._themeConfig.color = []); - // 默认标志图形类型列表,不merge - theme.symbolList && (this._themeConfig.symbolList = []); + // // 默认标志图形类型列表,不merge + // theme.symbolList && (this._themeConfig.symbolList = []); - // 应用新主题 - zrUtil.merge(this._themeConfig, zrUtil.clone(theme), true); + // // 应用新主题 + // zrUtil.merge(this._themeConfig, zrUtil.clone(theme), true); + this._themeConfig = theme; } if (!_canvasSupported) { // IE8- - this._themeConfig.textStyle.fontFamily = this._themeConfig.textStyle.fontFamily2; + var textStyle = this._themeConfig.textStyle; + textStyle && textStyle.fontFamily && textStyle.fontFamily2 + && (textStyle.fontFamily = textStyle.fontFamily2); + + textStyle = ecConfig.textStyle; + textStyle.fontFamily = textStyle.fontFamily2; } this._timeline && this._timeline.setTheme(true); @@ -1564,7 +1674,7 @@ define(function (require) { /** * 视图区域大小变化更新,不默认绑定,供使用方按需调用 */ - resize : function () { + resize: function () { var self = this; return function(){ self._clearEffect(); @@ -1591,26 +1701,27 @@ define(function (require) { }; }, - _clearEffect : function() { - this._zr.modLayer(ecConfig.EFFECT_ZLEVEL, {motionBlur : false}); + _clearEffect: function() { + this._zr.modLayer(ecConfig.EFFECT_ZLEVEL, { motionBlur: false }); this._zr.painter.clearLayer(ecConfig.EFFECT_ZLEVEL); }, /** * 清除已渲染内容 ,clear后echarts实例可用 */ - clear : function () { + clear: function () { this._disposeChartList(); this._zr.clear(); this._option = {}; this._optionRestore = {}; + this.dom.style.backgroundColor = null; return this; }, /** * 释放,dispose后echarts实例不可用 */ - dispose : function () { + dispose: function () { var key = this.dom.getAttribute(DOM_ATTRIBUTE_KEY); key && delete _instances[key]; diff --git a/amd/layout/Chord.js b/amd/layout/Chord.js new file mode 100644 index 0000000..85d48a4 --- /dev/null +++ b/amd/layout/Chord.js @@ -0,0 +1,145 @@ +/** + * Chord layout + * @module echarts/layout/Chord + * @author pissang(http://github.com/pissang) + */ +define(function (require) { + + var ChordLayout = function (opts) { + + opts = opts || {}; + + /** + * 是否排序组(即图的节点), 可以是`ascending`, `descending`, 或者为空不排序 + * @type {string} + */ + this.sort = opts.sort || null; + /** + * 是否排序子组(即图中每个节点的邻接边), 可以是`ascending`, `descending`, 或者为空不排序 + * @type {string} + */ + this.sortSub = opts.sortSub || null; + + this.padding = 0.05; + + this.startAngle = opts.startAngle || 0; + this.clockWise = opts.clockWise == null ? false : opts.clockWise; + + this.center = opts.center || [0, 0]; + + this.directed = true; + }; + + /** + * 对指定的一个或多个 Graph 运行 chord 布局 + * 可以有多个 Graph, 后面几个 Graph 的节点是第一个 Graph 的节点的子集(ID一一对应) + * + * 布局结果保存在第一个 Graph 的每个节点的 layout.startAngle 和 layout.endAngle. + * 以及每个图的边的 layout.startAngle 和 layout.endAngle + * + * @param {Array.|module:echarts/data/Graph} graphs + */ + ChordLayout.prototype.run = function (graphs) { + if (!(graphs instanceof Array)) { + graphs = [graphs]; + } + + var gl = graphs.length; + if (!gl) { + return; + } + var graph0 = graphs[0]; + var nl = graph0.nodes.length; + + var groups = []; + var sumSize = 0; + + // 使用第一个 graph 的节点 + for (var i = 0; i < nl; i++) { + var g0node = graph0.nodes[i]; + var group = { + size: 0, + subGroups: [], + node: g0node + }; + groups.push(group); + + var sumWeight = 0; + + // 合并所有 Graph 的 边 + for (var k = 0; k < graphs.length; k++) { + var graph = graphs[k]; + var node = graph.getNodeById(g0node.id); + // 节点可能没有值被过滤掉了 + if (!node) { + continue; + } + group.size += node.layout.size; + // PENDING + var edges = this.directed ? node.outEdges : node.edges; + for (var j = 0; j < edges.length; j++) { + var e = edges[j]; + var w = e.layout.weight; + group.subGroups.push({ + weight: w, + edge: e, + graph: graph + }); + sumWeight += w; + } + } + sumSize += group.size; + + // Sum sub group weights to group size + var multiplier = group.size / sumWeight; + for (var j = 0; j < group.subGroups.length; j++) { + group.subGroups[j].weight *= multiplier; + } + + if (this.sortSub === 'ascending') { + group.subGroups.sort(compareSubGroups); + } + else if (this.sort === 'descending') { + group.subGroups.sort(compareSubGroups); + group.subGroups.reverse(); + } + } + + if (this.sort === 'ascending') { + groups.sort(compareGroups); + } + else if (this.sort === 'descending') { + groups.sort(compareGroups); + groups.reverse(); + } + + var multiplier = (Math.PI * 2 - this.padding * nl) / sumSize; + var angle = this.startAngle; + var sign = this.clockWise ? 1 : -1; + // Calculate angles + for (var i = 0; i < nl; i++) { + var group = groups[i]; + group.node.layout.startAngle = angle; + group.node.layout.endAngle = angle + sign * group.size * multiplier; + + group.node.layout.subGroups = []; + for (var j = 0; j < group.subGroups.length; j++) { + var subGroup = group.subGroups[j]; + subGroup.edge.layout.startAngle = angle; + angle += sign * subGroup.weight * multiplier; + subGroup.edge.layout.endAngle = angle; + } + angle = group.node.layout.endAngle + sign * this.padding; + } + }; + + var compareSubGroups = function (a, b) { + return a.weight - b.weight; + }; + + var compareGroups = function (a, b) { + return a.size - b.size; + }; + + return ChordLayout; +}); \ No newline at end of file diff --git a/amd/layout/EdgeBundling.js b/amd/layout/EdgeBundling.js new file mode 100644 index 0000000..f7afe31 --- /dev/null +++ b/amd/layout/EdgeBundling.js @@ -0,0 +1,395 @@ +/** + * Edge bundling laytout + * + * Use MINGLE algorithm + * Multilevel agglomerative edge bundling for visualizing large graphs + * + * @module echarts/layout/EdgeBundling + */ +define(function (require) { + + var KDTree = require('../data/KDTree'); + var vec2 = require('zrender/tool/vector'); + var v2Create = vec2.create; + var v2DistSquare = vec2.distSquare; + var v2Dist = vec2.dist; + var v2Copy = vec2.copy; + + function sqaredDistance(a, b) { + a = a.array; + b = b.array; + + var x = b[0] - a[0]; + var y = b[1] - a[1]; + var z = b[2] - a[2]; + var w = b[3] - a[3]; + + return x * x + y * y + z * z + w * w; + } + + function CoarsenedEdge(group) { + this.points = [ + group.mp0, group.mp1 + ]; + + this.group = group; + }; + + function Edge(edge) { + var points = edge.points; + // Sort on y + if ( + points[0][1] < points[1][1] + // If coarsened edge is flipped, the final composition of meet point + // will be unordered + || edge instanceof CoarsenedEdge + ) { + this.array = [points[0][0], points[0][1], points[1][0], points[1][1]]; + this._startPoint = points[0]; + this._endPoint = points[1]; + } + else { + this.array = [points[1][0], points[1][1], points[0][0], points[0][1]]; + this._startPoint = points[1]; + this._endPoint = points[0]; + } + + this.ink = v2Dist(points[0], points[1]); + + this.edge = edge; + + this.group = null; + } + + Edge.prototype.getStartPoint = function () { + return this._startPoint; + }; + + Edge.prototype.getEndPoint = function () { + return this._endPoint; + }; + + function BundledEdgeGroup() { + + this.edgeList = []; + + this.mp0 = v2Create(); + this.mp1 = v2Create(); + + this.ink = 0; + } + + BundledEdgeGroup.prototype.addEdge = function (edge) { + edge.group = this; + this.edgeList.push(edge); + }; + + BundledEdgeGroup.prototype.removeEdge = function (edge) { + edge.group = null; + this.edgeList.splice(this.edgeList.indexOf(edge), 1); + }; + + /** + * @constructor + * @alias module:echarts/layout/EdgeBundling + */ + function EdgeBundling() { + this.maxNearestEdge = 6; + this.maxTurningAngle = Math.PI / 4; + this.maxIteration = 10; + } + + EdgeBundling.prototype = { + + constructor: EdgeBundling, + + run: function (rawEdges) { + var res = this._iterate(rawEdges); + var nIterate = 0; + while (nIterate++ < this.maxIteration) { + var coarsenedEdges = []; + for (var i = 0; i < res.groups.length; i++) { + coarsenedEdges.push(new CoarsenedEdge(res.groups[i])); + } + var newRes = this._iterate(coarsenedEdges); + if (newRes.savedInk <= 0) { + break; + } else { + res = newRes; + } + } + + // Get new edges + var newEdges = []; + + var buildNewEdges = function (groups, fromEdge) { + for (var i = 0; i < groups.length; i++) { + var group = groups[i]; + if ( + group.edgeList[0] + && (group.edgeList[0].edge instanceof CoarsenedEdge) + ) { + var newGroups = []; + for (var j = 0; j < group.edgeList.length; j++) { + newGroups.push(group.edgeList[j].edge.group); + } + if (! fromEdge) { + newEdge = []; + } else { + newEdge = fromEdge.slice(); + } + newEdge.unshift(group.mp0); + newEdge.push(group.mp1); + buildNewEdges(newGroups, newEdge); + } else { + // console.log(group.edgeList.length); + for (var j = 0; j < group.edgeList.length; j++) { + var edge = group.edgeList[j]; + if (! fromEdge) { + newEdge = []; + } else { + newEdge = fromEdge.slice(); + } + newEdge.unshift(group.mp0); + newEdge.push(group.mp1); + newEdge.unshift(edge.getStartPoint()); + newEdge.push(edge.getEndPoint()); + newEdges.push(newEdge); + } + } + } + }; + + buildNewEdges(res.groups); + + for (var i = 0; i < newEdges.length; i++) { + newEdges[i] = { + points: newEdges[i], + rawEdge: rawEdges[i] + } + } + + return newEdges; + }, + + _iterate: function (rawEdges) { + var edges = []; + var groups = []; + var totalSavedInk = 0; + for (var i = 0; i < rawEdges.length; i++) { + var edge = new Edge(rawEdges[i]); + edges.push(edge); + } + + var tree = new KDTree(edges, 4); + + var nearests = []; + + var _mp0 = v2Create(); + var _mp1 = v2Create(); + var _newGroupInk = 0; + var mp0 = v2Create(); + var mp1 = v2Create(); + var newGroupInk = 0; + for (var i = 0; i < edges.length; i++) { + var edge = edges[i]; + if (edge.group) { + // Edge have been groupped + continue; + } + tree.nearestN( + edge, this.maxNearestEdge, + sqaredDistance, nearests + ); + var maxSavedInk = 0; + var mostSavingInkEdge = null; + var lastCheckedGroup = null; + for (var j = 0; j < nearests.length; j++) { + var nearest = nearests[j]; + var savedInk = 0; + if (nearest.group) { + if (nearest.group !== lastCheckedGroup) { + lastCheckedGroup = nearest.group; + _newGroupInk = this._calculateGroupEdgeInk( + nearest.group, edge, _mp0, _mp1 + ); + savedInk = nearest.group.ink + edge.ink - _newGroupInk; + } + } + else { + _newGroupInk = this._calculateEdgeEdgeInk( + edge, nearest, _mp0, _mp1 + ); + savedInk = nearest.ink + edge.ink - _newGroupInk; + } + if (savedInk > maxSavedInk) { + maxSavedInk = savedInk; + mostSavingInkEdge = nearest; + v2Copy(mp1, _mp1); + v2Copy(mp0, _mp0); + newGroupInk = _newGroupInk; + } + } + if (mostSavingInkEdge) { + totalSavedInk += maxSavedInk; + if (! mostSavingInkEdge.group) { + var group = new BundledEdgeGroup(); + groups.push(group); + group.addEdge(mostSavingInkEdge); + } + group = mostSavingInkEdge.group; + // Use the meet point and group ink calculated before + v2Copy(group.mp0, mp0); + v2Copy(group.mp1, mp1); + group.ink = newGroupInk; + mostSavingInkEdge.group.addEdge(edge); + } + else { + var group = new BundledEdgeGroup(); + groups.push(group); + v2Copy(group.mp0, edge.getStartPoint()); + v2Copy(group.mp1, edge.getEndPoint()); + group.ink = edge.ink; + group.addEdge(edge); + } + } + + return { + groups: groups, + edges: edges, + savedInk: totalSavedInk + } + }, + + _calculateEdgeEdgeInk: (function () { + var startPointSet = []; + var endPointSet = []; + return function (e0, e1, mp0, mp1) { + startPointSet[0] = e0.getStartPoint(); + startPointSet[1] = e1.getStartPoint(); + endPointSet[0] = e0.getEndPoint(); + endPointSet[1] = e1.getEndPoint(); + + this._calculateMeetPoints( + startPointSet, endPointSet, mp0, mp1 + ); + var ink = v2Dist(startPointSet[0], mp0) + + v2Dist(mp0, mp1) + + v2Dist(mp1, endPointSet[0]) + + v2Dist(startPointSet[1], mp0) + + v2Dist(mp1, endPointSet[1]); + + return ink; + }; + })(), + + _calculateGroupEdgeInk: function (group, edgeTryAdd, mp0, mp1) { + var startPointSet = []; + var endPointSet = []; + for (var i = 0; i < group.edgeList.length; i++) { + var edge = group.edgeList[i]; + startPointSet.push(edge.getStartPoint()); + endPointSet.push(edge.getEndPoint()); + } + startPointSet.push(edgeTryAdd.getStartPoint()); + endPointSet.push(edgeTryAdd.getEndPoint()); + + this._calculateMeetPoints( + startPointSet, endPointSet, mp0, mp1 + ); + + var ink = v2Dist(mp0, mp1); + for (var i = 0; i < startPointSet.length; i++) { + ink += v2Dist(startPointSet[i], mp0) + + v2Dist(endPointSet[i], mp1); + } + + return ink; + }, + + /** + * Calculating the meet points + * @method + * @param {Array} startPointSet Start points set of bundled edges + * @param {Array} endPointSet End points set of bundled edges + * @param {Array.} mp0 Output meet point 0 + * @param {Array.} mp1 Output meet point 1 + */ + _calculateMeetPoints: (function () { + var cp0 = v2Create(); + var cp1 = v2Create(); + return function (startPointSet, endPointSet, mp0, mp1) { + vec2.set(cp0, 0, 0); + vec2.set(cp1, 0, 0); + var len = startPointSet.length; + // Calculate the centroid of start points set + for (var i = 0; i < len; i++) { + vec2.add(cp0, cp0, startPointSet[i]); + } + vec2.scale(cp0, cp0, 1 / len); + + // Calculate the centroid of end points set + len = endPointSet.length; + for (var i = 0; i < len; i++) { + vec2.add(cp1, cp1, endPointSet[i]); + } + vec2.scale(cp1, cp1, 1 / len); + + this._limitTurningAngle( + startPointSet, cp0, cp1, mp0 + ); + this._limitTurningAngle( + endPointSet, cp1, cp0, mp1 + ); + } + })(), + + _limitTurningAngle: (function () { + var v10 = v2Create(); + var vTmp = v2Create(); + var project = v2Create(); + var tmpOut = v2Create(); + return function (pointSet, p0, p1, out) { + // Limit the max turning angle + var maxTurningAngleCos = Math.cos(this.maxTurningAngle); + var maxTurningAngleTan = Math.tan(this.maxTurningAngle); + + vec2.sub(v10, p0, p1); + vec2.normalize(v10, v10); + + // Simply copy the centroid point if no need to turn the angle + vec2.copy(out, p0); + + var maxMovement = 0; + for (var i = 0; i < pointSet.length; i++) { + var p = pointSet[i]; + vec2.sub(vTmp, p, p0); + var len = vec2.len(vTmp); + vec2.scale(vTmp, vTmp, 1 / len); + var turningAngleCos = vec2.dot(vTmp, v10); + // Turning angle is to large + if (turningAngleCos < maxTurningAngleCos) { + // Calculat p's project point on vector p1-p0 + // and distance to the vector + vec2.scaleAndAdd( + project, p0, v10, len * turningAngleCos + ); + var distance = v2Dist(project, p); + + // Use the max turning angle to calculate the new meet point + var d = distance / maxTurningAngleTan; + vec2.scaleAndAdd(tmpOut, project, v10, -d); + + var movement = v2DistSquare(tmpOut, p0); + if (movement > maxMovement) { + maxMovement = movement; + vec2.copy(out, tmpOut); + } + } + } + }; + })() + } + + return EdgeBundling; +}); \ No newline at end of file diff --git a/amd/layout/Force.js b/amd/layout/Force.js new file mode 100644 index 0000000..62f1008 --- /dev/null +++ b/amd/layout/Force.js @@ -0,0 +1,248 @@ +/** + * 力导向布局 + * @module echarts/layout/Force + * @author pissang(http://github.com/pissang) + */ +define(function(require) { + + var ForceLayoutWorker = require('./forceLayoutWorker'); + var vec2 = require('zrender/tool/vector'); + + var requestAnimationFrame = window.requestAnimationFrame + || window.msRequestAnimationFrame + || window.mozRequestAnimationFrame + || window.webkitRequestAnimationFrame + || function (func) {setTimeout(func, 16);}; + var ArrayCtor = typeof(Float32Array) == 'undefined' ? Array : Float32Array; + + var workerUrl; + + // function getToken() { + // return Math.round((new Date()).getTime() / 100) % 10000000; + // } + + function createWorkerUrl() { + if ( + typeof(Worker) !== 'undefined' && + typeof(Blob) !== 'undefined' + ) { + try { + var blob = new Blob([ForceLayoutWorker.getWorkerCode()]); + workerUrl = window.URL.createObjectURL(blob); + } + catch (e) { + workerUrl = ''; + } + } + + return workerUrl; + } + + var ForceLayout = function(opts) { + + if (typeof(workerUrl) === 'undefined') { + createWorkerUrl(); + } + opts = opts || {}; + // 配置项 + this.width = opts.width || 500; + this.height = opts.height || 500; + this.center = opts.center || [this.width / 2, this.height / 2]; + this.ratioScaling = opts.ratioScaling || false; + this.scaling = opts.scaling || 1; + this.gravity = typeof(opts.gravity) !== 'undefined' + ? opts.gravity : 1; + this.large = opts.large || false; + this.preventNodeOverlap = opts.preventNodeOverlap || false; + this.preventNodeEdgeOverlap = opts.preventNodeEdgeOverlap || false; + this.maxSpeedIncrease = opts.maxSpeedIncrease || 1; + + this.onupdate = opts.onupdate || function () {}; + this.temperature = opts.temperature || 1; + this.coolDown = opts.coolDown || 0.99; + + this._layout = null; + this._layoutWorker = null; + + var self = this; + var _$onupdate = this._$onupdate; + this._$onupdate = function(e) { + _$onupdate.call(self, e); + }; + }; + + ForceLayout.prototype.updateConfig = function () { + var width = this.width; + var height = this.height; + var size = Math.min(width, height); + + var config = { + center: this.center, + width: this.ratioScaling ? width : size, + height: this.ratioScaling ? height : size, + scaling: this.scaling || 1.0, + gravity: this.gravity || 1.0, + barnesHutOptimize: this.large, + preventNodeOverlap: this.preventNodeOverlap, + preventNodeEdgeOverlap: this.preventNodeEdgeOverlap, + + maxSpeedIncrease: this.maxSpeedIncrease + }; + + if (this._layoutWorker) { + this._layoutWorker.postMessage({ + cmd: 'updateConfig', + config: config + }); + } + else { + for (var name in config) { + this._layout[name] = config[name]; + } + } + }; + + ForceLayout.prototype.init = function (graph, useWorker) { + if (workerUrl && useWorker) { + try { + if (!this._layoutWorker) { + this._layoutWorker = new Worker(workerUrl); + this._layoutWorker.onmessage = this._$onupdate; + } + this._layout = null; + } + catch (e) { // IE10-11 will throw security error when using blog url + this._layoutWorker = null; + if (!this._layout) { + this._layout = new ForceLayoutWorker(); + } + } + } + else { + if (!this._layout) { + this._layout = new ForceLayoutWorker(); + } + if (this._layoutWorker) { + this._layoutWorker.terminate(); + this._layoutWorker = null; + } + } + + this.temperature = 1; + + this.graph = graph; + + // 节点数据 + var len = graph.nodes.length; + var positionArr = new ArrayCtor(len * 2); + var massArr = new ArrayCtor(len); + var sizeArr = new ArrayCtor(len); + + for (var i = 0; i < len; i++) { + var n = graph.nodes[i]; + positionArr[i * 2] = n.layout.position[0]; + positionArr[i * 2 + 1] = n.layout.position[1]; + massArr[i] = typeof(n.layout.mass) === 'undefined' + ? 1 : n.layout.mass; + sizeArr[i] = typeof(n.layout.size) === 'undefined' + ? 1 : n.layout.size; + + n.layout.__index = i; + } + // 边数据 + len = graph.edges.length; + var edgeArr = new ArrayCtor(len * 2); + var edgeWeightArr = new ArrayCtor(len); + for (var i = 0; i < len; i++) { + var edge = graph.edges[i]; + edgeArr[i * 2] = edge.node1.layout.__index; + edgeArr[i * 2 + 1] = edge.node2.layout.__index; + edgeWeightArr[i] = edge.layout.weight || 1; + } + + if (this._layoutWorker) { + + this._layoutWorker.postMessage({ + cmd: 'init', + nodesPosition: positionArr, + nodesMass: massArr, + nodesSize: sizeArr, + edges: edgeArr, + edgesWeight: edgeWeightArr + }); + } + else { + this._layout.initNodes(positionArr, massArr, sizeArr); + this._layout.initEdges(edgeArr, edgeWeightArr); + } + + this.updateConfig(); + }; + + ForceLayout.prototype.step = function (steps) { + var nodes = this.graph.nodes; + if (this._layoutWorker) { + // Sync back + var positionArr = new ArrayCtor(nodes.length * 2); + for (var i = 0; i < nodes.length; i++) { + var n = nodes[i]; + positionArr[i * 2] = n.layout.position[0]; + positionArr[i * 2 + 1] = n.layout.position[1]; + } + this._layoutWorker.postMessage(positionArr.buffer, [positionArr.buffer]); + + this._layoutWorker.postMessage({ + cmd: 'update', + steps: steps, + temperature: this.temperature, + coolDown: this.coolDown + }); + for (var i = 0; i < steps; i++) { + this.temperature *= this.coolDown; + } + } + else { + + requestAnimationFrame(this._$onupdate); + + for (var i = 0; i < nodes.length; i++) { + var n = nodes[i]; + vec2.copy(this._layout.nodes[i].position, n.layout.position); + } + for (var i = 0; i < steps; i++) { + this._layout.temperature = this.temperature; + this._layout.update(); + this.temperature *= this.coolDown; + } + } + }; + + ForceLayout.prototype._$onupdate = function (e) { + if (this._layoutWorker) { + var positionArr = new Float32Array(e.data); + for (var i = 0; i < this.graph.nodes.length; i++) { + var n = this.graph.nodes[i]; + n.layout.position[0] = positionArr[i * 2]; + n.layout.position[1] = positionArr[i * 2 + 1]; + } + this.onupdate && this.onupdate(); + } + else if (this._layout) { + for (var i = 0; i < this.graph.nodes.length; i++) { + var n = this.graph.nodes[i]; + vec2.copy(n.layout.position, this._layout.nodes[i].position); + } + this.onupdate && this.onupdate(); + } + }; + + ForceLayout.prototype.dispose = function() { + if (this._layoutWorker) { + this._layoutWorker.terminate(); + } + this._layoutWorker = null; + this._layout = null; + }; + + return ForceLayout; +}); \ No newline at end of file diff --git a/amd/layout/Tree.js b/amd/layout/Tree.js new file mode 100644 index 0000000..3026085 --- /dev/null +++ b/amd/layout/Tree.js @@ -0,0 +1,90 @@ +/** + * Tree layout + * @module echarts/layout/Tree + * @author pissang(http://github.com/pissang) + */ +define(function (require) { + + var vec2 = require('zrender/tool/vector'); + + function TreeLayout(opts) { + + opts = opts || {}; + + this.nodePadding = opts.nodePadding || 30; + + this.layerPadding = opts.layerPadding || 100; + + this._layerOffsets = []; + + this._layers = []; + } + + TreeLayout.prototype.run = function (tree) { + this._layerOffsets.length = 0; + for (var i = 0; i < tree.root.height + 1; i++) { + this._layerOffsets[i] = 0; + this._layers[i] = []; + } + this._updateNodeXPosition(tree.root); + var root = tree.root; + this._updateNodeYPosition(root, 0, root.layout.height); + }; + + TreeLayout.prototype._updateNodeXPosition = function (node) { + var minX = Infinity; + var maxX = -Infinity; + node.layout.position = node.layout.position || vec2.create(); + for (var i = 0; i < node.children.length; i++) { + var child = node.children[i]; + this._updateNodeXPosition(child); + var x = child.layout.position[0]; + if (x < minX) { + minX = x; + } + if (x > maxX) { + maxX = x; + } + } + if (node.children.length > 0) { + node.layout.position[0] = (minX + maxX) / 2; + } else { + node.layout.position[0] = 0; + } + var off = this._layerOffsets[node.depth] || 0; + if (off > node.layout.position[0]) { + var shift = off - node.layout.position[0]; + this._shiftSubtree(node, shift); + for (var i = node.depth + 1; i < node.height + node.depth; i++) { + this._layerOffsets[i] += shift; + } + } + this._layerOffsets[node.depth] = node.layout.position[0] + node.layout.width + this.nodePadding; + + this._layers[node.depth].push(node); + }; + + TreeLayout.prototype._shiftSubtree = function (root, offset) { + root.layout.position[0] += offset; + for (var i = 0; i < root.children.length; i++) { + this._shiftSubtree(root.children[i], offset); + } + }; + + TreeLayout.prototype._updateNodeYPosition = function (node, y, prevLayerHeight) { + node.layout.position[1] = y; + var layerHeight = 0; + for (var i = 0; i < node.children.length; i++) { + layerHeight = Math.max(node.children[i].layout.height, layerHeight); + } + var layerPadding = this.layerPadding; + if (typeof(layerPadding) === 'function') { + layerPadding = layerPadding(node.depth); + } + for (var i = 0; i < node.children.length; i++) { + this._updateNodeYPosition(node.children[i], y + layerPadding + prevLayerHeight, layerHeight); + } + }; + + return TreeLayout; +}); \ No newline at end of file diff --git a/amd/layout/eventRiver.js b/amd/layout/eventRiver.js new file mode 100644 index 0000000..0f513dc --- /dev/null +++ b/amd/layout/eventRiver.js @@ -0,0 +1,219 @@ +/** + * eventRiver 布局算法 + * @module echarts/layout/eventRiver + * @author clmtulip (车丽美, clmtulip@gmail.com) + */ +define(function(require) { + function eventRiverLayout(series, intervalX, area) { + var space = 5; + var scale = intervalX; + + function importanceSort(a, b) { + var x = a.importance; + var y = b.importance; + return ((x > y) ? -1 : ((x < y) ? 1 : 0)); + } + + /** + * 查询数组中元素的index + */ + function indexOf(array, value) { + if (array.indexOf) { + return array.indexOf(value); + } + for (var i = 0, len = array.length; i < len; i++) { + if (array[i] === value) { + return i; + } + } + return -1; + } + + // step 0. calculate event importance and sort descending + for (var i = 0; i < series.length; i++) { + for (var j = 0; j < series[i].eventList.length; j++) { + if (series[i].eventList[j].weight == null) { + series[i].eventList[j].weight = 1; + } + var importance = 0; + for (var k = 0; k < series[i].eventList[j].evolution.length; k++) { + importance += series[i].eventList[j].evolution[k].valueScale; + } + series[i].eventList[j].importance = importance * series[i].eventList[j].weight; + } + series[i].eventList.sort(importanceSort); + } + + // step 1. 计算每个group的重要值importance,并按递减顺序排序 + for (var i = 0; i < series.length; i++) { + if (series[i].weight == null) { + series[i].weight = 1; + } + var importance = 0; + for (var j = 0; j < series[i].eventList.length; j++) { + importance += series[i].eventList[j].weight; + } + series[i].importance = importance * series[i].weight; + } + // 根据importance对groups进行递减排序 + series.sort(importanceSort); + + // step 3. set bubble positions in group order, then in event order + // 找到包含所有事件的时间段,即最小和最大时间点 + var minTime = Number.MAX_VALUE; + var maxTime = 0; + for (var i = 0; i < series.length; i++) { + for (var j = 0; j < series[i].eventList.length; j++) { + for (var k = 0; k < series[i].eventList[j].evolution.length; k++) { + var time = series[i].eventList[j].evolution[k].timeScale; + minTime = Math.min(minTime, time); + maxTime = Math.max(maxTime, time); + } + } + } + // console.log('minTime: ' + minTime); + // console.log('maxTime: ' + maxTime); + + // 建立线段树根节点 + var root = segmentTreeBuild(Math.floor(minTime), Math.ceil(maxTime)); + + var totalMaxY = 0; + for (var i = 0; i < series.length; i++) { + for (var j = 0; j < series[i].eventList.length; j++) { + var e = series[i].eventList[j]; + e.time = []; + e.value = []; + for (var k = 0; k < series[i].eventList[j].evolution.length; k++) { + e.time.push(series[i].eventList[j].evolution[k].timeScale); + e.value.push(series[i].eventList[j].evolution[k].valueScale); + } + + var mxIndex = indexOf(e.value, Math.max.apply(Math, e.value)); + var maxY = segmentTreeQuery(root, e.time[mxIndex], e.time[mxIndex + 1]); + var k = 0; + e.y = maxY + e.value[mxIndex] / 2 + space; + // 检测overlap,调整event.y + for (k = 0; k < e.time.length - 1; k++) { + var curMaxY = segmentTreeQuery(root, e.time[k], e.time[k + 1]); + if (e.y - e.value[k] / 2 - space < curMaxY) { + e.y = curMaxY + e.value[k] / 2 + space; + } + } + var curMaxY = segmentTreeQuery(root, e.time[k], e.time[k] + scale); + if (e.y - e.value[k] / 2 - space < curMaxY) { + e.y = curMaxY + e.value[k] / 2 + space; + } + series[i].y = e.y; + + totalMaxY = Math.max(totalMaxY, e.y + e.value[mxIndex] / 2); + + // 确定位置后更新线段树 + for (k = 0; k < e.time.length - 1; k++) { + segmentTreeInsert(root, e.time[k], e.time[k+1], e.y + e.value[k] / 2); + } + segmentTreeInsert(root, e.time[k], e.time[k] + scale, e.y + e.value[k] / 2); + } + } + + // 映射到显示区域内 + scaleY(series, area, totalMaxY, space); + } + + /** + * 映射到显示区域内 + * @param {Object} series + * @param {Object} area + */ + function scaleY(series, area, maxY, space) { + var yBase = area.y; + var yScale = (area.height - space) / maxY; + for (var i = 0; i < series.length; i++) { + series[i].y = series[i].y * yScale + yBase; + var eventList = series[i].eventList; + for (var j = 0; j < eventList.length; j++) { + eventList[j].y = eventList[j].y * yScale + yBase; + var evolutionList = eventList[j].evolution; + for (var k = 0; k < evolutionList.length; k++) { + evolutionList[k].valueScale *= yScale * 1; + } + } + + } + } + + function segmentTreeBuild(left, right) { + var root = { + 'left': left, + 'right': right, + 'leftChild': null, + 'rightChild': null, + 'maxValue': 0 + }; + + if (left + 1 < right) { + var mid = Math.round( (left + right) / 2); + root.leftChild = segmentTreeBuild(left, mid); + root.rightChild = segmentTreeBuild(mid, right); + } + + return root; + } + + function segmentTreeQuery(root, left, right) { + if (right - left < 1) { + return 0; + } + + var mid = Math.round( (root.left + root.right) / 2); + var result = 0; + + if (left == root.left && right == root.right) { + result = root.maxValue; + } + else if (right <= mid && root.leftChild != null) { + result = segmentTreeQuery(root.leftChild, left, right); + } + else if (left >= mid && root.rightChild != null) { + result = segmentTreeQuery(root.rightChild, left, right); + } + else { + var leftValue = 0; + var rightValue = 0; + if (root.leftChild != null) { + leftValue = segmentTreeQuery(root.leftChild, left, mid); + } + if (root.rightChild != null) { + rightValue = segmentTreeQuery(root.rightChild, mid, right); + } + result = leftValue > rightValue ? leftValue : rightValue; + } + return result; + } + + // 插入和更新线段树 + function segmentTreeInsert(root, left, right, value) { + if (root == null) { + return ; + } + var mid = Math.round( (root.left + root.right) / 2); + root.maxValue = root.maxValue > value ? root.maxValue : value; + + if (Math.floor(left * 10) == Math.floor(root.left * 10) + && Math.floor(right * 10) == Math.floor(root.right * 10) + ) { + return; + } + else if (right <= mid) { + segmentTreeInsert(root.leftChild, left, right, value); + } + else if (left >= mid) { + segmentTreeInsert(root.rightChild, left, right, value); + } + else { + segmentTreeInsert(root.leftChild, left, mid, value); + segmentTreeInsert(root.rightChild, mid, right, value); + } + } + + return eventRiverLayout; +}); \ No newline at end of file diff --git a/amd/chart/forceLayoutWorker.js b/amd/layout/forceLayoutWorker.js similarity index 76% rename from amd/chart/forceLayoutWorker.js rename to amd/layout/forceLayoutWorker.js index 57cabe9..2f4f282 100644 --- a/amd/chart/forceLayoutWorker.js +++ b/amd/layout/forceLayoutWorker.js @@ -45,6 +45,9 @@ define(function __echartsForceLayoutWorker(require) { out[1] = a[1] - b[1]; return out; }, + dot: function (v1, v2) { + return v1[0] * v2[0] + v1[1] * v2[1]; + }, normalize: function(out, a) { var x = a[0]; var y = a[1]; @@ -73,8 +76,9 @@ define(function __echartsForceLayoutWorker(require) { return out; } }; - } else { - vec2 = require('../zrender/tool/vector'); + } + else { + vec2 = require('zrender/tool/vector'); } var ArrayCtor = typeof(Float32Array) == 'undefined' ? Array : Float32Array; @@ -125,7 +129,8 @@ define(function __echartsForceLayoutWorker(require) { if (this.node == null) { this.node = node; return; - } else { + } + else { this._addNodeToSubRegion(this.node); this.node = null; } @@ -238,9 +243,9 @@ define(function __echartsForceLayoutWorker(require) { /**************************** * Class: Graph Edge ***************************/ - function GraphEdge(source, target) { - this.source = source; - this.target = target; + function GraphEdge(node1, node2) { + this.node1 = node1; + this.node2 = node2; this.weight = 1; } @@ -255,7 +260,9 @@ define(function __echartsForceLayoutWorker(require) { this.repulsionByDegree = false; - this.preventOverlap = false; + this.preventNodeOverlap = false; + this.preventNodeEdgeOverlap = false; + this.strongGravity = true; this.gravity = 1.0; @@ -267,7 +274,7 @@ define(function __echartsForceLayoutWorker(require) { this.width = 500; this.height = 500; - this.maxSpeedIncrease = 1.0; + this.maxSpeedIncrease = 1; this.nodes = []; this.edges = []; @@ -282,6 +289,18 @@ define(function __echartsForceLayoutWorker(require) { this._k = 0; } + ForceLayout.prototype.nodeToNodeRepulsionFactor = function (mass, d, k) { + return k * k * mass / d; + }; + + ForceLayout.prototype.edgeToNodeRepulsionFactor = function (mass, d, k) { + return k * mass / d; + }; + + ForceLayout.prototype.attractionFactor = function (w, d, k) { + return w * d / k; + }; + ForceLayout.prototype.initNodes = function(positionArr, massArr, sizeArr) { this.temperature = 1.0; @@ -351,7 +370,8 @@ define(function __echartsForceLayoutWorker(require) { this._rootRegion.addNode(this.nodes[i]); } this._rootRegion.afterUpdate(); - } else { + } + else { // Update center of mass of whole graph var mass = 0; var centerOfMass = this._rootRegion.centerOfMass; @@ -361,9 +381,18 @@ define(function __echartsForceLayoutWorker(require) { mass += node.mass; vec2.scaleAndAdd(centerOfMass, centerOfMass, node.position, node.mass); } - vec2.scale(centerOfMass, centerOfMass, 1 / mass); + if (mass > 0) { + vec2.scale(centerOfMass, centerOfMass, 1 / mass); + } } + this.updateForce(); + + this.updatePosition(); + }; + + ForceLayout.prototype.updateForce = function () { + var nNodes = this.nodes.length; // Reset forces for (var i = 0; i < nNodes; i++) { var node = this.nodes[i]; @@ -372,30 +401,21 @@ define(function __echartsForceLayoutWorker(require) { vec2.set(node.force, 0, 0); } - // Compute forces - // Repulsion - for (var i = 0; i < nNodes; i++) { - var na = this.nodes[i]; - if (this.barnesHutOptimize) { - this.applyRegionToNodeRepulsion(this._rootRegion, na); - } else { - for (var j = i + 1; j < nNodes; j++) { - var nb = this.nodes[j]; - this.applyNodeToNodeRepulsion(na, nb, false); - } - } + this.updateNodeNodeForce(); - // Gravity - if (this.gravity > 0) { - this.applyNodeGravity(na); - } + if (this.gravity > 0) { + this.updateGravityForce(); } - // Attraction - for (var i = 0; i < this.edges.length; i++) { - this.applyEdgeAttraction(this.edges[i]); + this.updateEdgeForce(); + + if (this.preventNodeEdgeOverlap) { + this.updateNodeEdgeForce(); } + }; + ForceLayout.prototype.updatePosition = function () { + var nNodes = this.nodes.length; // Apply forces // var speed = vec2.create(); var v = vec2.create(); @@ -414,12 +434,12 @@ define(function __echartsForceLayoutWorker(require) { vec2.scale(node.force, node.force, scale); vec2.add(speed, speed, node.force); - vec2.scale(speed, speed, this.temperature); // Prevent swinging // Limited the increase of speed up to 100% each step // TODO adjust by nodes number + // TODO First iterate speed control vec2.sub(v, speed, node.speedPrev); var swing = vec2.len(v); if (swing > 0) { @@ -440,18 +460,63 @@ define(function __echartsForceLayoutWorker(require) { } }; + ForceLayout.prototype.updateNodeNodeForce = function () { + var nNodes = this.nodes.length; + // Compute forces + // Repulsion + for (var i = 0; i < nNodes; i++) { + var na = this.nodes[i]; + if (this.barnesHutOptimize) { + this.applyRegionToNodeRepulsion(this._rootRegion, na); + } + else { + for (var j = i + 1; j < nNodes; j++) { + var nb = this.nodes[j]; + this.applyNodeToNodeRepulsion(na, nb, false); + } + } + } + }; + + ForceLayout.prototype.updateGravityForce = function () { + for (var i = 0; i < this.nodes.length; i++) { + this.applyNodeGravity(this.nodes[i]); + } + }; + + ForceLayout.prototype.updateEdgeForce = function () { + // Attraction + for (var i = 0; i < this.edges.length; i++) { + this.applyEdgeAttraction(this.edges[i]); + } + }; + + ForceLayout.prototype.updateNodeEdgeForce = function () { + for (var i = 0; i < this.nodes.length; i++) { + for (var j = 0; j < this.edges.length; j++) { + this.applyEdgeToNodeRepulsion(this.edges[j], this.nodes[i]); + } + } + }; + ForceLayout.prototype.applyRegionToNodeRepulsion = (function() { var v = vec2.create(); return function applyRegionToNodeRepulsion(region, node) { if (region.node) { // Region is a leaf this.applyNodeToNodeRepulsion(region.node, node, true); - } else { + } + else { + // Static region and node + if (region.mass === 0 && node.mass === 0) { + return; + } vec2.sub(v, node.position, region.centerOfMass); var d2 = v[0] * v[0] + v[1] * v[1]; if (d2 > this.barnesHutTheta * region.size * region.size) { var factor = this._k * this._k * (node.mass + region.mass) / (d2 + 1); vec2.scaleAndAdd(node.force, node.force, v, factor * 2); - } else { + } + else { for (var i = 0; i < region.nSubRegions; i++) { this.applyRegionToNodeRepulsion(region.subRegions[i], node); } @@ -463,9 +528,14 @@ define(function __echartsForceLayoutWorker(require) { ForceLayout.prototype.applyNodeToNodeRepulsion = (function() { var v = vec2.create(); return function applyNodeToNodeRepulsion(na, nb, oneWay) { - if (na == nb) { + if (na === nb) { + return; + } + // Two static node + if (na.mass === 0 && nb.mass === 0) { return; } + vec2.sub(v, na.position, nb.position); var d2 = v[0] * v[0] + v[1] * v[1]; @@ -475,21 +545,28 @@ define(function __echartsForceLayoutWorker(require) { } var factor; - var k2 = this._k * this._k; var mass = na.mass + nb.mass; + var d = Math.sqrt(d2); - if (this.preventOverlap) { - var d = Math.sqrt(d2); + // Normalize v + vec2.scale(v, v, 1 / d); + + if (this.preventNodeOverlap) { d = d - na.size - nb.size; if (d > 0) { - factor = k2 * mass / (d * d); - } else if (d <= 0) { + factor = this.nodeToNodeRepulsionFactor( + mass, d, this._k + ); + } + else if (d <= 0) { // A stronger repulsion if overlap - factor = k2 * 10 * mass; + factor = this._k * this._k * 10 * mass; } - } else { - // Divide factor by an extra `d` to normalize the `v` - factor = k2 * mass / d2; + } + else { + factor = this.nodeToNodeRepulsionFactor( + mass, d, this._k + ); } if (!oneWay) { @@ -502,8 +579,8 @@ define(function __echartsForceLayoutWorker(require) { ForceLayout.prototype.applyEdgeAttraction = (function() { var v = vec2.create(); return function applyEdgeAttraction(edge) { - var na = edge.source; - var nb = edge.target; + var na = edge.node1; + var nb = edge.node2; vec2.sub(v, na.position, nb.position); var d = vec2.len(v); @@ -511,9 +588,11 @@ define(function __echartsForceLayoutWorker(require) { var w; if (this.edgeWeightInfluence === 0) { w = 1; - } else if (this.edgeWeightInfluence == 1) { + } + else if (this.edgeWeightInfluence == 1) { w = edge.weight; - } else { + } + else { w = Math.pow(edge.weight, this.edgeWeightInfluence); } @@ -527,10 +606,10 @@ define(function __echartsForceLayoutWorker(require) { } } - var factor = -w * d / this._k; + var factor = this.attractionFactor(w, d, this._k); - vec2.scaleAndAdd(na.force, na.force, v, factor); - vec2.scaleAndAdd(nb.force, nb.force, v, -factor); + vec2.scaleAndAdd(na.force, na.force, v, -factor); + vec2.scaleAndAdd(nb.force, nb.force, v, factor); }; })(); @@ -544,7 +623,8 @@ define(function __echartsForceLayoutWorker(require) { if (this.width > this.height) { // Stronger gravity on y axis v[1] *= this.width / this.height; - } else { + } + else { // Stronger gravity on x axis v[0] *= this.height / this.width; } @@ -552,12 +632,56 @@ define(function __echartsForceLayoutWorker(require) { if (this.strongGravity) { vec2.scaleAndAdd(node.force, node.force, v, d * this.gravity * node.mass); - } else { + } + else { vec2.scaleAndAdd(node.force, node.force, v, this.gravity * node.mass / (d + 1)); } }; })(); + ForceLayout.prototype.applyEdgeToNodeRepulsion = (function () { + var v12 = vec2.create(); + var v13 = vec2.create(); + var p = vec2.create(); + return function (e, n3) { + var n1 = e.node1; + var n2 = e.node2; + + if (n1 === n3 || n2 === n3) { + return; + } + + vec2.sub(v12, n2.position, n1.position); + vec2.sub(v13, n3.position, n1.position); + + var len12 = vec2.len(v12); + vec2.scale(v12, v12, 1 / len12); + var len = vec2.dot(v12, v13); + + // n3 can't project on line n1-n2 + if (len < 0 || len > len12) { + return; + } + + // Project point + vec2.scaleAndAdd(p, n1.position, v12, len); + + // n3 distance to line n1-n2 + var dist = vec2.dist(p, n3.position) - n3.size; + var factor = this.edgeToNodeRepulsionFactor( + n3.mass, Math.max(dist, 0.1), 100 + ); + // Use v12 as normal vector + vec2.sub(v12, n3.position, p); + vec2.normalize(v12, v12); + vec2.scaleAndAdd(n3.force, n3.force, v12, factor); + + // PENDING + vec2.scaleAndAdd(n1.force, n1.force, v12, -factor); + vec2.scaleAndAdd(n2.force, n2.force, v12, -factor); + }; + })(); + ForceLayout.prototype.updateBBox = function() { var minX = Infinity; var minY = Infinity; @@ -585,21 +709,21 @@ define(function __echartsForceLayoutWorker(require) { * Main process ***************************/ + /* jshint ignore:start */ if (inWorker) { var forceLayout = null; - + self.onmessage = function(e) { // Position read back if (e.data instanceof ArrayBuffer) { - if (!forceLayout) { - return; - } + if (!forceLayout) return; + var positionArr = new Float32Array(e.data); - var nNodes = (positionArr.length - 1) / 2; + var nNodes = positionArr.length / 2; for (var i = 0; i < nNodes; i++) { var node = forceLayout.nodes[i]; - node.position[0] = positionArr[i * 2 + 1]; - node.position[1] = positionArr[i * 2 + 2]; + node.position[0] = positionArr[i * 2]; + node.position[1] = positionArr[i * 2 + 1]; } return; } @@ -611,7 +735,6 @@ define(function __echartsForceLayoutWorker(require) { } forceLayout.initNodes(e.data.nodesPosition, e.data.nodesMass, e.data.nodesSize); forceLayout.initEdges(e.data.edges, e.data.edgesWeight); - forceLayout._token = e.data.token; break; case 'updateConfig': if (forceLayout) { @@ -625,27 +748,24 @@ define(function __echartsForceLayoutWorker(require) { if (forceLayout) { var nNodes = forceLayout.nodes.length; - var positionArr = new Float32Array(nNodes * 2 + 1); + var positionArr = new Float32Array(nNodes * 2); forceLayout.temperature = e.data.temperature; - if (e.data.temperature > 0.01) { - for (var i = 0; i < steps; i++) { - forceLayout.update(); - forceLayout.temperature *= e.data.coolDown; - } - // Callback - for (var i = 0; i < nNodes; i++) { - var node = forceLayout.nodes[i]; - positionArr[i * 2 + 1] = node.position[0]; - positionArr[i * 2 + 2] = node.position[1]; - } - - positionArr[0] = forceLayout._token; + for (var i = 0; i < steps; i++) { + forceLayout.update(); + forceLayout.temperature *= e.data.coolDown; + } + // Callback + for (var i = 0; i < nNodes; i++) { + var node = forceLayout.nodes[i]; + positionArr[i * 2] = node.position[0]; + positionArr[i * 2 + 1] = node.position[1]; } self.postMessage(positionArr.buffer, [positionArr.buffer]); - } else { + } + else { // Not initialzied yet var emptyArr = new Float32Array(); // Post transfer object @@ -655,6 +775,7 @@ define(function __echartsForceLayoutWorker(require) { } }; } + /* jshint ignore:end */ return ForceLayout; }); \ No newline at end of file diff --git a/amd/theme/default.js b/amd/theme/default.js index b857ce9..3894bcc 100644 --- a/amd/theme/default.js +++ b/amd/theme/default.js @@ -2,7 +2,7 @@ * echarts默认主题,开发中 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ define(function() { diff --git a/amd/theme/infographic.js b/amd/theme/infographic.js new file mode 100644 index 0000000..f6c3a91 --- /dev/null +++ b/amd/theme/infographic.js @@ -0,0 +1,297 @@ +define(function() { + +var theme = { + // 默认色板 + color: [ + '#C1232B','#B5C334','#FCCE10','#E87C25','#27727B', + '#FE8463','#9BCA63','#FAD860','#F3A43B','#60C0DD', + '#D7504B','#C6E579','#F4E001','#F0805A','#26C0C0' + ], + + // 图表标题 + title: { + textStyle: { + fontWeight: 'normal', + color: '#27727B' // 主标题文字颜色 + } + }, + + // 值域 + dataRange: { + x:'right', + y:'center', + itemWidth: 5, + itemHeight:25, + color:['#C1232B','#FCCE10'] + }, + + toolbox: { + color : [ + '#C1232B','#B5C334','#FCCE10','#E87C25','#27727B', + '#FE8463','#9BCA63','#FAD860','#F3A43B','#60C0DD' + ], + effectiveColor : '#ff4500' + }, + + // 提示框 + tooltip: { + backgroundColor: 'rgba(50,50,50,0.5)', // 提示背景颜色,默认为透明度为0.7的黑色 + axisPointer : { // 坐标轴指示器,坐标轴触发有效 + type : 'line', // 默认为直线,可选为:'line' | 'shadow' + lineStyle : { // 直线指示器样式设置 + color: '#27727B', + type: 'dashed' + }, + crossStyle: { + color: '#27727B' + }, + shadowStyle : { // 阴影指示器样式设置 + color: 'rgba(200,200,200,0.3)' + } + } + }, + + // 区域缩放控制器 + dataZoom: { + dataBackgroundColor: 'rgba(181,195,52,0.3)', // 数据背景颜色 + fillerColor: 'rgba(181,195,52,0.2)', // 填充颜色 + handleColor: '#27727B' // 手柄颜色 + }, + + // 网格 + grid: { + borderWidth:0 + }, + + // 类目轴 + categoryAxis: { + axisLine: { // 坐标轴线 + lineStyle: { // 属性lineStyle控制线条样式 + color: '#27727B' + } + }, + splitLine: { // 分隔线 + show: false + } + }, + + // 数值型坐标轴默认参数 + valueAxis: { + axisLine: { // 坐标轴线 + show: false + }, + splitArea : { + show: false + }, + splitLine: { // 分隔线 + lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 + color: ['#ccc'], + type: 'dashed' + } + } + }, + + polar : { + axisLine: { // 坐标轴线 + lineStyle: { // 属性lineStyle控制线条样式 + color: '#ddd' + } + }, + splitArea : { + show : true, + areaStyle : { + color: ['rgba(250,250,250,0.2)','rgba(200,200,200,0.2)'] + } + }, + splitLine : { + lineStyle : { + color : '#ddd' + } + } + }, + + timeline : { + lineStyle : { + color : '#27727B' + }, + controlStyle : { + normal : { color : '#27727B'}, + emphasis : { color : '#27727B'} + }, + symbol : 'emptyCircle', + symbolSize : 3 + }, + + // 折线图默认参数 + line: { + itemStyle: { + normal: { + borderWidth:2, + borderColor:'#fff', + lineStyle: { + width: 3 + } + }, + emphasis: { + borderWidth:0 + } + }, + symbol: 'circle', // 拐点图形类型 + symbolSize: 3.5 // 拐点图形大小 + }, + + // K线图默认参数 + k: { + itemStyle: { + normal: { + color: '#C1232B', // 阳线填充颜色 + color0: '#B5C334', // 阴线填充颜色 + lineStyle: { + width: 1, + color: '#C1232B', // 阳线边框颜色 + color0: '#B5C334' // 阴线边框颜色 + } + } + } + }, + + // 散点图默认参数 + scatter: { + itemdStyle: { + normal: { + borderWidth:1, + borderColor:'rgba(200,200,200,0.5)' + }, + emphasis: { + borderWidth:0 + } + }, + symbol: 'star4', // 图形类型 + symbolSize: 4 // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 + }, + + // 雷达图默认参数 + radar : { + symbol: 'emptyCircle', // 图形类型 + symbolSize:3 + //symbol: null, // 拐点图形类型 + //symbolRotate : null, // 图形旋转控制 + }, + + map: { + itemStyle: { + normal: { + areaStyle: { + color: '#ddd' + }, + label: { + textStyle: { + color: '#C1232B' + } + } + }, + emphasis: { // 也是选中样式 + areaStyle: { + color: '#fe994e' + }, + label: { + textStyle: { + color: 'rgb(100,0,0)' + } + } + } + } + }, + + force : { + itemStyle: { + normal: { + linkStyle : { + color : '#27727B' + } + } + } + }, + + chord : { + itemStyle : { + normal : { + borderWidth: 1, + borderColor: 'rgba(128, 128, 128, 0.5)', + chordStyle : { + lineStyle : { + color : 'rgba(128, 128, 128, 0.5)' + } + } + }, + emphasis : { + borderWidth: 1, + borderColor: 'rgba(128, 128, 128, 0.5)', + chordStyle : { + lineStyle : { + color : 'rgba(128, 128, 128, 0.5)' + } + } + } + } + }, + + gauge : { + center:['50%','80%'], + radius:'100%', + startAngle: 180, + endAngle : 0, + axisLine: { // 坐标轴线 + show: true, // 默认显示,属性show控制显示与否 + lineStyle: { // 属性lineStyle控制线条样式 + color: [[0.2, '#B5C334'],[0.8, '#27727B'],[1, '#C1232B']], + width: '40%' + } + }, + axisTick: { // 坐标轴小标记 + splitNumber: 2, // 每份split细分多少段 + length: 5, // 属性length控制线长 + lineStyle: { // 属性lineStyle控制线条样式 + color: '#fff' + } + }, + axisLabel: { // 坐标轴文本标签,详见axis.axisLabel + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: '#fff', + fontWeight:'bolder' + } + }, + splitLine: { // 分隔线 + length: '5%', // 属性length控制线长 + lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 + color: '#fff' + } + }, + pointer : { + width : '40%', + length: '80%', + color: '#fff' + }, + title : { + offsetCenter: [0, -20], // x, y,单位px + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: 'auto', + fontSize: 20 + } + }, + detail : { + offsetCenter: [0, 0], // x, y,单位px + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: 'auto', + fontSize: 40 + } + } + }, + + textStyle: { + fontFamily: '微软雅黑, Arial, Verdana, sans-serif' + } +}; + + return theme; +}); \ No newline at end of file diff --git a/amd/theme/macarons.js b/amd/theme/macarons.js new file mode 100644 index 0000000..75c2898 --- /dev/null +++ b/amd/theme/macarons.js @@ -0,0 +1,257 @@ +define(function() { + +var theme = { + // 默认色板 + color: [ + '#2ec7c9','#b6a2de','#5ab1ef','#ffb980','#d87a80', + '#8d98b3','#e5cf0d','#97b552','#95706d','#dc69aa', + '#07a2a4','#9a7fd1','#588dd5','#f5994e','#c05050', + '#59678c','#c9ab00','#7eb00a','#6f5553','#c14089' + ], + + // 图表标题 + title: { + textStyle: { + fontWeight: 'normal', + color: '#008acd' // 主标题文字颜色 + } + }, + + // 值域 + dataRange: { + itemWidth: 15, + color: ['#5ab1ef','#e0ffff'] + }, + + // 工具箱 + toolbox: { + color : ['#1e90ff', '#1e90ff', '#1e90ff', '#1e90ff'], + effectiveColor : '#ff4500' + }, + + // 提示框 + tooltip: { + backgroundColor: 'rgba(50,50,50,0.5)', // 提示背景颜色,默认为透明度为0.7的黑色 + axisPointer : { // 坐标轴指示器,坐标轴触发有效 + type : 'line', // 默认为直线,可选为:'line' | 'shadow' + lineStyle : { // 直线指示器样式设置 + color: '#008acd' + }, + crossStyle: { + color: '#008acd' + }, + shadowStyle : { // 阴影指示器样式设置 + color: 'rgba(200,200,200,0.2)' + } + } + }, + + // 区域缩放控制器 + dataZoom: { + dataBackgroundColor: '#efefff', // 数据背景颜色 + fillerColor: 'rgba(182,162,222,0.2)', // 填充颜色 + handleColor: '#008acd' // 手柄颜色 + }, + + // 网格 + grid: { + borderColor: '#eee' + }, + + // 类目轴 + categoryAxis: { + axisLine: { // 坐标轴线 + lineStyle: { // 属性lineStyle控制线条样式 + color: '#008acd' + } + }, + splitLine: { // 分隔线 + lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 + color: ['#eee'] + } + } + }, + + // 数值型坐标轴默认参数 + valueAxis: { + axisLine: { // 坐标轴线 + lineStyle: { // 属性lineStyle控制线条样式 + color: '#008acd' + } + }, + splitArea : { + show : true, + areaStyle : { + color: ['rgba(250,250,250,0.1)','rgba(200,200,200,0.1)'] + } + }, + splitLine: { // 分隔线 + lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 + color: ['#eee'] + } + } + }, + + polar : { + axisLine: { // 坐标轴线 + lineStyle: { // 属性lineStyle控制线条样式 + color: '#ddd' + } + }, + splitArea : { + show : true, + areaStyle : { + color: ['rgba(250,250,250,0.2)','rgba(200,200,200,0.2)'] + } + }, + splitLine : { + lineStyle : { + color : '#ddd' + } + } + }, + + timeline : { + lineStyle : { + color : '#008acd' + }, + controlStyle : { + normal : { color : '#008acd'}, + emphasis : { color : '#008acd'} + }, + symbol : 'emptyCircle', + symbolSize : 3 + }, + + // 柱形图默认参数 + bar: { + itemStyle: { + normal: { + barBorderRadius: 5 + }, + emphasis: { + barBorderRadius: 5 + } + } + }, + + // 折线图默认参数 + line: { + smooth : true, + symbol: 'emptyCircle', // 拐点图形类型 + symbolSize: 3 // 拐点图形大小 + }, + + // K线图默认参数 + k: { + itemStyle: { + normal: { + color: '#d87a80', // 阳线填充颜色 + color0: '#2ec7c9', // 阴线填充颜色 + lineStyle: { + color: '#d87a80', // 阳线边框颜色 + color0: '#2ec7c9' // 阴线边框颜色 + } + } + } + }, + + // 散点图默认参数 + scatter: { + symbol: 'circle', // 图形类型 + symbolSize: 4 // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 + }, + + // 雷达图默认参数 + radar : { + symbol: 'emptyCircle', // 图形类型 + symbolSize:3 + //symbol: null, // 拐点图形类型 + //symbolRotate : null, // 图形旋转控制 + }, + + map: { + itemStyle: { + normal: { + areaStyle: { + color: '#ddd' + }, + label: { + textStyle: { + color: '#d87a80' + } + } + }, + emphasis: { // 也是选中样式 + areaStyle: { + color: '#fe994e' + } + } + } + }, + + force : { + itemStyle: { + normal: { + linkStyle : { + color : '#1e90ff' + } + } + } + }, + + chord : { + itemStyle : { + normal : { + borderWidth: 1, + borderColor: 'rgba(128, 128, 128, 0.5)', + chordStyle : { + lineStyle : { + color : 'rgba(128, 128, 128, 0.5)' + } + } + }, + emphasis : { + borderWidth: 1, + borderColor: 'rgba(128, 128, 128, 0.5)', + chordStyle : { + lineStyle : { + color : 'rgba(128, 128, 128, 0.5)' + } + } + } + } + }, + + gauge : { + axisLine: { // 坐标轴线 + lineStyle: { // 属性lineStyle控制线条样式 + color: [[0.2, '#2ec7c9'],[0.8, '#5ab1ef'],[1, '#d87a80']], + width: 10 + } + }, + axisTick: { // 坐标轴小标记 + splitNumber: 10, // 每份split细分多少段 + length :15, // 属性length控制线长 + lineStyle: { // 属性lineStyle控制线条样式 + color: 'auto' + } + }, + splitLine: { // 分隔线 + length :22, // 属性length控制线长 + lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 + color: 'auto' + } + }, + pointer : { + width : 5 + } + }, + + textStyle: { + fontFamily: '微软雅黑, Arial, Verdana, sans-serif' + } +}; + + return theme; +}); \ No newline at end of file diff --git a/amd/util/accMath.js b/amd/util/accMath.js index 8f7163c..de74d52 100644 --- a/amd/util/accMath.js +++ b/amd/util/accMath.js @@ -6,8 +6,20 @@ define(function() { // 说明:javascript的除法结果会有误差,在两个浮点数相除的时候会比较明显。这个函数返回较为精确的除法结果。 // 调用:accDiv(arg1,arg2) // 返回值:arg1除以arg2的精确结果 - function accDiv(arg1, arg2) { - return accMul(arg1, 1 / arg2); + function accDiv(arg1,arg2){ + var s1 = arg1.toString(); + var s2 = arg2.toString(); + var m = 0; + try { + m = s2.split('.')[1].length; + } + catch(e) {} + try { + m -= s1.split('.')[1].length; + } + catch(e) {} + + return (s1.replace('.', '') - 0) / (s2.replace('.', '') - 0) * Math.pow(10, m); } // 乘法函数,用来得到精确的乘法结果 @@ -15,18 +27,17 @@ define(function() { // 调用:accMul(arg1,arg2) // 返回值:arg1乘以arg2的精确结果 function accMul(arg1, arg2) { - var m = 0; var s1 = arg1.toString(); - var s2 = arg2.toString(); + var s2 = arg2.toString(); + var m = 0; try { m += s1.split('.')[1].length; } catch(e) {} - try { m += s2.split('.')[1].length; } - catch(e){} + catch(e) {} return (s1.replace('.', '') - 0) * (s2.replace('.', '') - 0) / Math.pow(10, m); } @@ -38,12 +49,10 @@ define(function() { function accAdd(arg1, arg2) { var r1 = 0; var r2 = 0; - try { r1 = arg1.toString().split('.')[1].length; } catch(e) {} - try { r2 = arg2.toString().split('.')[1].length; } diff --git a/amd/util/coordinates.js b/amd/util/coordinates.js index 8b165cc..96cb901 100644 --- a/amd/util/coordinates.js +++ b/amd/util/coordinates.js @@ -1,7 +1,7 @@ /** * echarts坐标处理方法 * - * @author Neil (杨骥, yangji01@baidu.com) + * @author Neil (杨骥, 511415343@qq.com) */ define( diff --git a/amd/util/date.js b/amd/util/date.js new file mode 100644 index 0000000..d2c7dac --- /dev/null +++ b/amd/util/date.js @@ -0,0 +1,162 @@ +/** + * echarts日期运算格式化相关 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + * + */ +define(function() { + var _timeGap = [ + {formatter: 'hh : mm : ss', value: 1000}, // 1s + {formatter: 'hh : mm : ss', value: 1000 * 5}, // 5s + {formatter: 'hh : mm : ss', value: 1000 * 10}, // 10s + {formatter: 'hh : mm : ss', value: 1000 * 15}, // 15s + {formatter: 'hh : mm : ss', value: 1000 * 30}, // 30s + {formatter: 'hh : mm\nMM - dd', value: 60000}, // 1m + {formatter: 'hh : mm\nMM - dd', value: 60000 * 5}, // 5m + {formatter: 'hh : mm\nMM - dd', value: 60000 * 10}, // 10m + {formatter: 'hh : mm\nMM - dd', value: 60000 * 15}, // 15m + {formatter: 'hh : mm\nMM - dd', value: 60000 * 30}, // 30m + {formatter: 'hh : mm\nMM - dd', value: 3600000}, // 1h + {formatter: 'hh : mm\nMM - dd', value: 3600000 * 2}, // 2h + {formatter: 'hh : mm\nMM - dd', value: 3600000 * 6}, // 6h + {formatter: 'hh : mm\nMM - dd', value: 3600000 * 12}, // 12h + {formatter: 'MM - dd\nyyyy', value: 3600000 * 24}, // 1d + {formatter: 'week', value: 3600000 * 24 * 7}, // 7d + {formatter: 'month', value: 3600000 * 24 * 31}, // 1M + {formatter: 'quarter', value: 3600000 * 24 * 380 / 4}, // 3M + {formatter: 'half-year', value: 3600000 * 24 * 380 / 2},// 6M + {formatter: 'year', value: 3600000 * 24 * 380} // 1Y + ]; + + /** + * 获取最佳formatter + * @params {number} min 最小值 + * @params {number} max 最大值 + * @params {=number} splitNumber 分隔段数 + */ + function getAutoFormatter(min, max, splitNumber) { + splitNumber = splitNumber > 1 ? splitNumber : 2; + // 最优解 + var curValue; + var totalGap; + // 目标 + var formatter; + var gapValue; + for (var i = 0, l = _timeGap.length; i < l; i++) { + curValue = _timeGap[i].value; + totalGap = Math.ceil(max / curValue) * curValue + - Math.floor(min / curValue) * curValue; + if (Math.round(totalGap / curValue) <= splitNumber * 1.2) { + formatter = _timeGap[i].formatter; + gapValue = _timeGap[i].value; + // console.log(formatter, gapValue,i); + break; + } + } + + if (formatter == null) { + formatter = 'year'; + curValue = 3600000 * 24 * 367; + totalGap = Math.ceil(max / curValue) * curValue + - Math.floor(min / curValue) * curValue; + gapValue = Math.round(totalGap / (splitNumber - 1) / curValue) * curValue; + } + + return { + formatter: formatter, + gapValue: gapValue + }; + } + + /** + * 一位数字补0 + */ + function s2d (v) { + return v < 10 ? ('0' + v) : v; + } + + /** + * 百分比计算 + */ + function format(formatter, value) { + if (formatter == 'week' + || formatter == 'month' + || formatter == 'quarter' + || formatter == 'half-year' + || formatter == 'year' + ) { + formatter = 'MM - dd\nyyyy'; + } + + var date = getNewDate(value); + var y = date.getFullYear(); + var M = date.getMonth() + 1; + var d = date.getDate(); + var h = date.getHours(); + var m = date.getMinutes(); + var s = date.getSeconds(); + + formatter = formatter.replace('MM', s2d(M)); + formatter = formatter.toLowerCase(); + formatter = formatter.replace('yyyy', y); + formatter = formatter.replace('yy', y % 100); + formatter = formatter.replace('dd', s2d(d)); + formatter = formatter.replace('d', d); + formatter = formatter.replace('hh', s2d(h)); + formatter = formatter.replace('h', h); + formatter = formatter.replace('mm', s2d(m)); + formatter = formatter.replace('m', m); + formatter = formatter.replace('ss', s2d(s)); + formatter = formatter.replace('s', s); + + return formatter; + } + + function nextMonday(value) { + value = getNewDate(value); + value.setDate(value.getDate() + 8 - value.getDay()); + return value; + } + + function nextNthPerNmonth(value, nth, nmon) { + value = getNewDate(value); + value.setMonth(Math.ceil((value.getMonth() + 1) / nmon) * nmon); + value.setDate(nth); + return value; + } + + function nextNthOnMonth(value, nth) { + return nextNthPerNmonth(value, nth, 1); + } + + function nextNthOnQuarterYear(value, nth) { + return nextNthPerNmonth(value, nth, 3); + } + + function nextNthOnHalfYear(value, nth) { + return nextNthPerNmonth(value, nth, 6); + } + + function nextNthOnYear(value, nth) { + return nextNthPerNmonth(value, nth, 12); + } + + function getNewDate(value) { + return value instanceof Date + ? value + : new Date(typeof value == 'string' ? value.replace(/-/g, '/') : value); + } + + return { + getAutoFormatter: getAutoFormatter, + getNewDate: getNewDate, + format: format, + nextMonday: nextMonday, + nextNthPerNmonth: nextNthPerNmonth, + nextNthOnMonth: nextNthOnMonth, + nextNthOnQuarterYear: nextNthOnQuarterYear, + nextNthOnHalfYear: nextNthOnHalfYear, + nextNthOnYear : nextNthOnYear + }; +}); \ No newline at end of file diff --git a/amd/util/ecAnimation.js b/amd/util/ecAnimation.js index 728412e..850cbb3 100644 --- a/amd/util/ecAnimation.js +++ b/amd/util/ecAnimation.js @@ -2,7 +2,7 @@ * echarts图表动画基类 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ define(function (require) { @@ -59,11 +59,15 @@ define(function (require) { } zr.addShape(newShape); + newShape._animating = true; zr.animate(newShape.id, 'style') .when( duration, { pointList: newPointList } ) + .done(function() { + newShape._animating = false; + }) .start(easing); } @@ -96,6 +100,7 @@ define(function (require) { var newShapeStyle = newShape.style; if (!oldShape) { // add oldShape = { + position : newShape.position, style : { x : newShapeStyle.x, y : newShape._orient == 'vertical' @@ -113,12 +118,26 @@ define(function (require) { var newY = newShapeStyle.y; var newWidth = newShapeStyle.width; var newHeight = newShapeStyle.height; + var newPosition = [newShape.position[0], newShape.position[1]]; cloneStyle( newShape, oldShape, 'x', 'y', 'width', 'height' ); + newShape.position = oldShape.position; zr.addShape(newShape); + if (newPosition[0] != oldShape.position[0] || newPosition[1] != oldShape.position[1]) { + zr.animate(newShape.id, '') + .when( + duration, + { + position: newPosition + } + ) + .start(easing); + } + + newShape._animating = true; zr.animate(newShape.id, 'style') .when( duration, @@ -129,6 +148,9 @@ define(function (require) { height: newHeight } ) + .done(function() { + newShape._animating = false; + }) .start(easing); } @@ -150,11 +172,15 @@ define(function (require) { var newY = newShape.style.y; newShape.style.y = oldShape.style.y; zr.addShape(newShape); + newShape._animating = true; zr.animate(newShape.id, 'style') .when( duration, { y: newY } ) + .done(function() { + newShape._animating = false; + }) .start(easing); } @@ -173,6 +199,8 @@ define(function (require) { var r0 = newShape.style.r0; var r = newShape.style.r; + newShape._animating = true; + if (newShape._animationAdd != 'r') { newShape.style.r0 = 0; newShape.style.r = 0; @@ -187,6 +215,9 @@ define(function (require) { r : r } ) + .done(function() { + newShape._animating = false; + }) .start(easing); zr.animate(newShape.id, '') .when( @@ -206,6 +237,9 @@ define(function (require) { r0 : r0 } ) + .done(function() { + newShape._animating = false; + }) .start(easing); } } @@ -243,6 +277,7 @@ define(function (require) { ); zr.addShape(newShape); + newShape._animating = true; zr.animate(newShape.id, 'style') .when( duration, @@ -251,6 +286,9 @@ define(function (require) { endAngle : endAngle } ) + .done(function() { + newShape._animating = false; + }) .start(easing); } @@ -284,6 +322,7 @@ define(function (require) { ); zr.addShape(newShape); + newShape._animating = true; zr.animate(newShape.id, 'style') .when( duration, @@ -292,6 +331,9 @@ define(function (require) { y : y } ) + .done(function() { + newShape._animating = false; + }) .start(easing); } @@ -311,6 +353,7 @@ define(function (require) { newShape.scale = [0.1, 0.1, x, y]; zr.addShape(newShape); + newShape._animating = true; zr.animate(newShape.id, '') .when( duration, @@ -318,6 +361,9 @@ define(function (require) { scale : [1, 1, x, y] } ) + .done(function() { + newShape._animating = false; + }) .start(easing); } @@ -330,14 +376,14 @@ define(function (require) { * @param {number} duration * @param {tring} easing */ - function chord(zr, oldShape, newShape, duration, easing) { + function ribbon(zr, oldShape, newShape, duration, easing) { if (!oldShape) { // add oldShape = { style : { source0 : 0, - source1 : 360, + source1 : newShape.style.source1 > 0 ? 360 : -360, target0 : 0, - target1 : 360 + target1 : newShape.style.target1 > 0 ? 360 : -360 } }; } @@ -355,6 +401,7 @@ define(function (require) { } zr.addShape(newShape); + newShape._animating = true; zr.animate(newShape.id, 'style') .when( duration, @@ -365,6 +412,9 @@ define(function (require) { target1 : target1 } ) + .done(function() { + newShape._animating = false; + }) .start(easing); } @@ -389,6 +439,7 @@ define(function (require) { var angle = newShape.style.angle; newShape.style.angle = oldShape.style.angle; zr.addShape(newShape); + newShape._animating = true; zr.animate(newShape.id, 'style') .when( duration, @@ -396,6 +447,9 @@ define(function (require) { angle : angle } ) + .done(function() { + newShape._animating = false; + }) .start(easing); } @@ -408,7 +462,7 @@ define(function (require) { * @param {number} duration * @param {tring} easing */ - function icon(zr, oldShape, newShape, duration, easing) { + function icon(zr, oldShape, newShape, duration, easing, delay) { // 避免markPoint特效取值在动画帧上 newShape.style._x = newShape.style.x; newShape.style._y = newShape.style.y; @@ -418,13 +472,18 @@ define(function (require) { if (!oldShape) { // add var x = newShape._x || 0; var y = newShape._y || 0; - newShape.scale = [0, 0, x, y]; + newShape.scale = [0.01, 0.01, x, y]; zr.addShape(newShape); + newShape._animating = true; zr.animate(newShape.id, '') + .delay(delay) .when( duration, {scale : [1, 1, x, y]} ) + .done(function() { + newShape._animating = false; + }) .start(easing || 'QuinticOut'); } else { // mod @@ -445,6 +504,8 @@ define(function (require) { if (!oldShape) { oldShape = { style : { + xStart : newShape.style.xStart, + yStart : newShape.style.yStart, xEnd : newShape.style.xStart, yEnd : newShape.style.yStart } @@ -462,6 +523,7 @@ define(function (require) { ); zr.addShape(newShape); + newShape._animating = true; zr.animate(newShape.id, 'style') .when( duration, @@ -472,6 +534,9 @@ define(function (require) { yEnd: yEnd } ) + .done(function() { + newShape._animating = false; + }) .start(easing); } @@ -486,13 +551,14 @@ define(function (require) { */ function markline(zr, oldShape, newShape, duration, easing) { if (!newShape.style.smooth) { - newShape.style.pointList = !oldShape + newShape.style.pointList = !oldShape ? [ [newShape.style.xStart, newShape.style.yStart], [newShape.style.xStart, newShape.style.yStart] ] : oldShape.style.pointList; zr.addShape(newShape); + newShape._animating = true; zr.animate(newShape.id, 'style') .when( duration, @@ -508,22 +574,36 @@ define(function (require) { ] } ) + .done(function() { + newShape._animating = false; + }) .start(easing || 'QuinticOut'); } else { // 曲线动画 - newShape.style.pointListLength = 1; - zr.addShape(newShape); - newShape.style.pointList = newShape.style.pointList - || newShape.getPointList(newShape.style); - zr.animate(newShape.id, 'style') - .when( - duration, - { - pointListLength : newShape.style.pointList.length - } - ) - .start(easing || 'QuinticOut'); + if (!oldShape) { + // 新增 + newShape.style.pointListLength = 1; + zr.addShape(newShape); + newShape._animating = true; + newShape.style.pointList = newShape.style.pointList + || newShape.getPointList(newShape.style); + zr.animate(newShape.id, 'style') + .when( + duration, + { + pointListLength : newShape.style.pointList.length + } + ) + .done(function() { + newShape._animating = false; + }) + .start(easing || 'QuinticOut'); + } + else { + // 过渡 + zr.addShape(newShape); + } } } @@ -535,7 +615,7 @@ define(function (require) { sector : sector, text : text, polygon : polygon, - chord : chord, + ribbon : ribbon, gaugePointer : gaugePointer, icon : icon, line : line, diff --git a/amd/util/ecData.js b/amd/util/ecData.js index d0336e9..16019ec 100644 --- a/amd/util/ecData.js +++ b/amd/util/ecData.js @@ -2,7 +2,7 @@ * echarts通用私有数据服务 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ define(function() { diff --git a/amd/util/ecEffect.js b/amd/util/ecEffect.js index 5139c75..bdb91b4 100644 --- a/amd/util/ecEffect.js +++ b/amd/util/ecEffect.js @@ -2,7 +2,7 @@ * echarts图表特效基类 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ define(function (require) { @@ -20,41 +20,55 @@ define(function (require) { var color = effect.color || shape.style.strokeColor || shape.style.color; var shadowColor = effect.shadowColor || color; var size = effect.scaleSize; + var distance = effect.bounceDistance; var shadowBlur = typeof effect.shadowBlur != 'undefined' ? effect.shadowBlur : size; - var effectShape = new IconShape({ - zlevel : zlevel, - style : { - brushType : 'stroke', - iconType : (shape.style.iconType != 'pin' - && shape.style.iconType != 'droplet') - ? shape.style.iconType - : 'circle', - x : shadowBlur + 1, // 线宽 - y : shadowBlur + 1, - n : shape.style.n, - width : shape.style.width * size, - height : shape.style.height * size, - lineWidth : 1, - strokeColor : color, - shadowColor : shadowColor, - shadowBlur : shadowBlur - }, - draggable : false, - hoverable : false - }); - - if (canvasSupported) { // 提高性能,换成image - effectShape.style.image = zr.shapeToImage( - effectShape, - effectShape.style.width + shadowBlur * 2 + 2, - effectShape.style.height + shadowBlur * 2 + 2 - ).style.image; - + var effectShape; + if (shape.type !== 'image') { + effectShape = new IconShape({ + zlevel : zlevel, + style : { + brushType : 'stroke', + iconType : shape.style.iconType != 'droplet' + ? shape.style.iconType + : 'circle', + x : shadowBlur + 1, // 线宽 + y : shadowBlur + 1, + n : shape.style.n, + width : shape.style._width * size, + height : shape.style._height * size, + lineWidth : 1, + strokeColor : color, + shadowColor : shadowColor, + shadowBlur : shadowBlur + }, + draggable : false, + hoverable : false + }); + if (shape.style.iconType == 'pin') { + effectShape.style.y += effectShape.style.height / 2 * 1.5; + } + + if (canvasSupported) { // 提高性能,换成image + effectShape.style.image = zr.shapeToImage( + effectShape, + effectShape.style.width + shadowBlur * 2 + 2, + effectShape.style.height + shadowBlur * 2 + 2 + ).style.image; + + effectShape = new ImageShape({ + zlevel : effectShape.zlevel, + style : effectShape.style, + draggable : false, + hoverable : false + }); + } + } + else { effectShape = new ImageShape({ - zlevel : effectShape.zlevel, - style : effectShape.style, + zlevel : zlevel, + style : shape.style, draggable : false, hoverable : false }); @@ -67,10 +81,15 @@ define(function (require) { effectList.push(effectShape); zr.addShape(effectShape); - var devicePixelRatio = window.devicePixelRatio || 1; - var offset = (effectShape.style.width / devicePixelRatio - shape.style.width) / 2; + var devicePixelRatio = shape.type !== 'image' ? (window.devicePixelRatio || 1) : 1; + var offset = (effectShape.style.width / devicePixelRatio - shape.style._width) / 2; effectShape.style.x = shape.style._x - offset; effectShape.style.y = shape.style._y - offset; + + if (shape.style.iconType == 'pin') { + effectShape.style.y -= shape.style.height / 2 * 1.5; + } + var duration = (effect.period + Math.random() * 10) * 100; zr.modShape( @@ -80,25 +99,50 @@ define(function (require) { var centerX = effectShape.style.x + (effectShape.style.width) / 2 / devicePixelRatio; var centerY = effectShape.style.y + (effectShape.style.height) / 2 / devicePixelRatio; - zr.modShape( - effectShape.id, - { - scale : [0.1, 0.1, centerX, centerY] - } - ); - - zr.animate(effectShape.id, '', effect.loop) - .when( - duration, + + if (effect.type === 'scale') { + // 放大效果 + zr.modShape( + effectShape.id, { - scale : [1, 1, centerX, centerY] + scale : [0.1, 0.1, centerX, centerY] } - ) - .done(function() { - shape.effect.show = false; - zr.delShape(effectShape.id); - }) - .start(); + ); + + zr.animate(effectShape.id, '', effect.loop) + .when( + duration, + { + scale : [1, 1, centerX, centerY] + } + ) + .done(function() { + shape.effect.show = false; + zr.delShape(effectShape.id); + }) + .start(); + } + else { + zr.animate(effectShape.id, 'style', effect.loop) + .when( + duration, + { + y : effectShape.style.y - distance + } + ) + .when( + duration * 2, + { + y : effectShape.style.y + } + ) + .done(function() { + shape.effect.show = false; + zr.delShape(effectShape.id); + }) + .start(); + } + } function largePoint(zr, effectList, shape, zlevel) { diff --git a/amd/util/ecQuery.js b/amd/util/ecQuery.js index 27ab978..06bae3c 100644 --- a/amd/util/ecQuery.js +++ b/amd/util/ecQuery.js @@ -2,10 +2,10 @@ * echarts层级查找方法 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ -define(function() { +define(function(require) { var zrUtil = require('../zrender/tool/util'); /** @@ -78,4 +78,4 @@ define(function() { deepQuery : deepQuery, deepMerge : deepMerge }; -}); \ No newline at end of file +}); diff --git a/amd/util/mapData/geoCoord.js b/amd/util/mapData/geoCoord.js index c98c276..b8d4bd6 100644 --- a/amd/util/mapData/geoCoord.js +++ b/amd/util/mapData/geoCoord.js @@ -3,7 +3,7 @@ */ define(function() { return { - 'Russia' : [100, 60], - 'United States of America' : [-99, 38] + 'Russia': [ 100, 60 ], + 'United States of America': [ -99, 38 ] }; }); \ No newline at end of file diff --git a/amd/util/mapData/params.js b/amd/util/mapData/params.js index cf36c77..cce76a6 100644 --- a/amd/util/mapData/params.js +++ b/amd/util/mapData/params.js @@ -65,6 +65,24 @@ define(function (require) { } var mapParams = { + 'none': { + getGeoJson: function(callback) { + callback({ + type: 'FeatureCollection', + features: [{ + type: 'Feature', + geometry: { + coordinates: [], + encodeOffsets: [], + type: 'Polygon' + }, + properties: { + + } + }] + }); + } + }, 'world': { getGeoJson: function (callback) { require(['./geoJson/world_geo'], function (md){ @@ -79,10 +97,10 @@ define(function (require) { }); } }, - '南海诸岛' : { - textCoord : [126, 25], - getPath : function (leftTop, scale) { - // scale.x : width = 10.51 : 64 + '南海诸岛': { + textCoord: [126, 25], + getPath: function (leftTop, scale) { + // scale.x: width = 10.51 : 64 var pList = [ [ [0,3.5],[7,11.2],[15,11.9],[30,7],[42,0.7],[52,0.7], @@ -384,7 +402,7 @@ define(function (require) { }; return { - decode : decode, - params : mapParams + decode: decode, + params: mapParams }; }); \ No newline at end of file diff --git a/amd/util/ndarray.js b/amd/util/ndarray.js index 208e955..f911ba5 100644 --- a/amd/util/ndarray.js +++ b/amd/util/ndarray.js @@ -249,7 +249,7 @@ NDArray.prototype = { /** * Get array dimension. - * @return {[type]} [description] + * @return {number} [description] */ dimension : function () { return this._shape.length; diff --git a/amd/util/number.js b/amd/util/number.js index 7609950..824a6ba 100644 --- a/amd/util/number.js +++ b/amd/util/number.js @@ -2,7 +2,7 @@ * echarts数字运算相关 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ define(function() { diff --git a/amd/util/projection/albers.js b/amd/util/projection/albers.js index 94c1396..38e3bd4 100644 --- a/amd/util/projection/albers.js +++ b/amd/util/projection/albers.js @@ -2,7 +2,7 @@ * echarts地图投射算法 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ define(function() { diff --git a/amd/util/projection/mercator.js b/amd/util/projection/mercator.js index 057e52d..bb26b5b 100644 --- a/amd/util/projection/mercator.js +++ b/amd/util/projection/mercator.js @@ -2,7 +2,7 @@ * echarts地图投射算法 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ define(function() { diff --git a/amd/util/projection/normal.js b/amd/util/projection/normal.js index 1c044d8..2cbfffb 100644 --- a/amd/util/projection/normal.js +++ b/amd/util/projection/normal.js @@ -3,7 +3,7 @@ * modify from GeoMap v0.5.3 https://github.com/x6doooo/GeoMap * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ define(function() { @@ -48,10 +48,10 @@ define(function() { } json.srcSize = { - left : convertorParse.xmin.toFixed(4)*1, - top : convertorParse.ymin.toFixed(4)*1, - width : (convertorParse.xmax - convertorParse.xmin).toFixed(4)*1, - height : (convertorParse.ymax - convertorParse.ymin).toFixed(4)*1 + left: convertorParse.xmin.toFixed(4)*1, + top: convertorParse.ymin.toFixed(4)*1, + width: (convertorParse.xmax - convertorParse.xmin).toFixed(4)*1, + height: (convertorParse.ymax - convertorParse.ymin).toFixed(4)*1 }; return json; @@ -59,13 +59,13 @@ define(function() { var convertor = { //调整俄罗斯东部到地图右侧与俄罗斯相连 - formatPoint : function (p) { + formatPoint: function (p) { return [ ((p[0] < -168.5 && p[1] > 63.8) ? p[0] + 360 : p[0]) + 168.5, 90 - p[1] ]; }, - makePoint : function (p) { + makePoint: function (p) { var self = this; var point = self.formatPoint(p); // for cp @@ -79,11 +79,11 @@ define(function() { + convertor.offset.top; return [x, y]; }, - Point : function (coordinates) { + Point: function (coordinates) { coordinates = this.makePoint(coordinates); return coordinates.join(','); }, - LineString : function (coordinates) { + LineString: function (coordinates) { var str = ''; var point; for (var i = 0, len = coordinates.length; i < len; i++) { @@ -96,28 +96,28 @@ define(function() { } return str; }, - Polygon : function (coordinates) { + Polygon: function (coordinates) { var str = ''; for (var i = 0, len = coordinates.length; i < len; i++) { str = str + convertor.LineString(coordinates[i]) + 'z'; } return str; }, - MultiPoint : function (coordinates) { + MultiPoint: function (coordinates) { var arr = []; for (var i = 0, len = coordinates.length; i < len; i++) { arr.push(convertor.Point(coordinates[i])); } return arr; }, - MultiLineString : function (coordinates) { + MultiLineString: function (coordinates) { var str = ''; for (var i = 0, len = coordinates.length; i < len; i++) { str += convertor.LineString(coordinates[i]); } return str; }, - MultiPolygon : function (coordinates) { + MultiPolygon: function (coordinates) { var str = ''; for (var i = 0, len = coordinates.length; i < len; i++) { str += convertor.Polygon(coordinates[i]); @@ -127,9 +127,9 @@ define(function() { }; var convertorParse = { - formatPoint : convertor.formatPoint, + formatPoint: convertor.formatPoint, - makePoint : function (p) { + makePoint: function (p) { var self = this; var point = self.formatPoint(p); var x = point[0]; @@ -139,30 +139,30 @@ define(function() { if (self.ymin > y) { self.ymin = y; } if (self.ymax < y) { self.ymax = y; } }, - Point : function (coordinates) { + Point: function (coordinates) { this.makePoint(coordinates); }, - LineString : function (coordinates) { + LineString: function (coordinates) { for (var i = 0, len = coordinates.length; i < len; i++) { this.makePoint(coordinates[i]); } }, - Polygon : function (coordinates) { + Polygon: function (coordinates) { for (var i = 0, len = coordinates.length; i < len; i++) { this.LineString(coordinates[i]); } }, - MultiPoint : function (coordinates) { + MultiPoint: function (coordinates) { for (var i = 0, len = coordinates.length; i < len; i++) { this.Point(coordinates[i]); } }, - MultiLineString : function (coordinates) { + MultiLineString: function (coordinates) { for (var i = 0, len = coordinates.length; i < len; i++) { this.LineString(coordinates[i]); } }, - MultiPolygon : function (coordinates) { + MultiPolygon: function (coordinates) { for (var i = 0, len = coordinates.length; i < len; i++) { this.Polygon(coordinates[i]); } @@ -179,10 +179,10 @@ define(function() { } transform.offset = { - x : json.srcSize.left, - y : json.srcSize.top, - left : transform.OffsetLeft || 0, - top : transform.OffsetTop || 0 + x: json.srcSize.left, + y: json.srcSize.top, + left: transform.OffsetLeft || 0, + top: transform.OffsetTop || 0 }; convertor.scale = transform.scale; @@ -218,23 +218,23 @@ define(function() { shapeType = gm.type; shapeCoordinates = gm.coordinates; convertor._bbox = { - xmin : 360, - xmax : -360, - ymin : 180, - ymax : -180 + xmin: 360, + xmax: -360, + ymin: 180, + ymax: -180 }; str = convertor[shapeType](shapeCoordinates); pathArray.push({ - //type : shapeType, - path : str, - cp : shape.properties.cp - ? convertor.makePoint(shape.properties.cp) - : convertor.makePoint([ - (convertor._bbox.xmin + convertor._bbox.xmax) / 2, - (convertor._bbox.ymin + convertor._bbox.ymax) / 2 - ]), - properties : shape.properties, - id : shape.id + // type: shapeType, + path: str, + cp: shape.properties.cp + ? convertor.makePoint(shape.properties.cp) + : convertor.makePoint([ + (convertor._bbox.xmin + convertor._bbox.xmax) / 2, + (convertor._bbox.ymin + convertor._bbox.ymax) / 2 + ]), + properties: shape.properties, + id: shape.id }); } @@ -276,9 +276,9 @@ define(function() { } return { - getBbox : getBbox, - geoJson2Path : geoJson2Path, - pos2geo : pos2geo, - geo2pos : geo2pos + getBbox: getBbox, + geoJson2Path: geoJson2Path, + pos2geo: pos2geo, + geo2pos: geo2pos }; }); \ No newline at end of file diff --git a/amd/util/projection/svg.js b/amd/util/projection/svg.js index 35ae05a..ff11486 100644 --- a/amd/util/projection/svg.js +++ b/amd/util/projection/svg.js @@ -3,7 +3,7 @@ * modify from GeoMap v0.5.3 https://github.com/x6doooo/GeoMap * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ define(function(require) { @@ -25,10 +25,10 @@ define(function(require) { var width = toFloat(svgNode.getAttribute('width')); var height = toFloat(svgNode.getAttribute('height')); return { - left : x, - top : y, - width : width, - height : height + left: x, + top: y, + width: width, + height: height }; } @@ -44,7 +44,7 @@ define(function(require) { // Common attributes obj.scale = scale; obj.properties = { - name : root.getAttribute('name') || '' + name: root.getAttribute('name') || '' }; obj.id = root.id; extendCommonAttributes(obj, root); @@ -126,11 +126,11 @@ define(function(require) { var shapeBuilders = { path: function(xmlNode, scale) { var path = xmlNode.getAttribute('d'); - var rect = PathShape.prototype.getRect({path : path}); + var rect = PathShape.prototype.getRect({ path : path }); return { shapeType: 'path', - path : path, - cp : [ + path: path, + cp: [ (rect.x + rect.width / 2) * scale[0], (rect.y + rect.height / 2) * scale[1] ] @@ -149,7 +149,7 @@ define(function(require) { y: y, width: width, height: height, - cp : [ + cp: [ (x + width / 2) * scale[0], (y + height / 2) * scale[1] ] @@ -168,7 +168,7 @@ define(function(require) { yStart: y1, xEnd: x2, yEnd: y2, - cp : [ + cp: [ (x1 + x2) * 0.5 * scale[0], (y1 + y2) * 0.5 * scale[1] ] @@ -231,7 +231,7 @@ define(function(require) { return { shapeType: 'polygon', pointList: points, - cp : [ + cp: [ (min[0] + max[0]) / 2 * scale[0], (min[1] + max[1]) / 2 * scale[0] ] @@ -246,9 +246,9 @@ define(function(require) { }; return { - getBbox : getBbox, - geoJson2Path : geoJson2Path, - pos2geo : pos2geo, - geo2pos : geo2pos + getBbox: getBbox, + geoJson2Path: geoJson2Path, + pos2geo: pos2geo, + geo2pos: geo2pos }; }); \ No newline at end of file diff --git a/amd/util/shape/Candle.js b/amd/util/shape/Candle.js index fd79bdb..7c45a7f 100644 --- a/amd/util/shape/Candle.js +++ b/amd/util/shape/Candle.js @@ -1,115 +1,115 @@ -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:蜡烛 - * 可配图形属性: - { - // 基础属性 - shape : 'candle', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,横坐标 - y : {Array}, // 必须,纵坐标数组 - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'candle', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : [100,123,90,125], - width : 150, - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function (eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define(function (require) { - var Base = require('../../zrender/shape/Base'); - var zrUtil = require('../../zrender/tool/util'); - - function Candle(options) { - Base.call(this, options); - } - - Candle.prototype = { - type: 'candle', - _numberOrder : function (a, b) { - return b - a; - }, - - /** - * 创建矩形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function (ctx, style) { - var yList = zrUtil.clone(style.y).sort(this._numberOrder); - - ctx.moveTo(style.x, yList[3]); - ctx.lineTo(style.x, yList[2]); - ctx.moveTo(style.x - style.width / 2, yList[2]); - ctx.rect( - style.x - style.width / 2, - yList[2], - style.width, - yList[1] - yList[2] - ); - ctx.moveTo(style.x, yList[1]); - ctx.lineTo(style.x, yList[0]); - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function (style) { - if (!style.__rect) { - var lineWidth = 0; - if (style.brushType == 'stroke' || style.brushType == 'fill') { - lineWidth = style.lineWidth || 1; - } - - var yList = zrUtil.clone(style.y).sort(this._numberOrder); - style.__rect = { - x : Math.round(style.x - style.width / 2 - lineWidth / 2), - y : Math.round(yList[3] - lineWidth / 2), - width : style.width + lineWidth, - height : yList[0] - yList[3] + lineWidth - }; - } - - return style.__rect; - }, - - - isCover : require('./normalIsCover') - }; - - zrUtil.inherits(Candle, Base); - - return Candle; -}); +/** + * zrender + * + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + * + * shape类:蜡烛 + * 可配图形属性: + { + // 基础属性 + shape : 'candle', // 必须,shape类标识,需要显式指定 + id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 + zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 + invisible : {boolean}, // 默认为false,是否可见 + + // 样式属性,默认状态样式样式属性 + style : { + x : {number}, // 必须,横坐标 + y : {Array}, // 必须,纵坐标数组 + }, + + // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 + highlightStyle : { + // 同style + } + + // 交互属性,详见shape.Base + + // 事件属性,详见shape.Base + } + 例子: + { + shape : 'candle', + id : '123456', + zlevel : 1, + style : { + x : 200, + y : [100,123,90,125], + width : 150, + color : '#eee', + text : 'Baidu' + }, + myName : 'kener', // 可自带任何有效自定义属性 + + clickable : true, + onClick : function (eventPacket) { + alert(eventPacket.target.myName); + } + } + */ +define(function (require) { + var Base = require('../../zrender/shape/Base'); + var zrUtil = require('../../zrender/tool/util'); + + function Candle(options) { + Base.call(this, options); + } + + Candle.prototype = { + type: 'candle', + _numberOrder : function (a, b) { + return b - a; + }, + + /** + * 创建矩形路径 + * @param {Context2D} ctx Canvas 2D上下文 + * @param {Object} style 样式 + */ + buildPath : function (ctx, style) { + var yList = zrUtil.clone(style.y).sort(this._numberOrder); + + ctx.moveTo(style.x, yList[3]); + ctx.lineTo(style.x, yList[2]); + ctx.moveTo(style.x - style.width / 2, yList[2]); + ctx.rect( + style.x - style.width / 2, + yList[2], + style.width, + yList[1] - yList[2] + ); + ctx.moveTo(style.x, yList[1]); + ctx.lineTo(style.x, yList[0]); + }, + + /** + * 返回矩形区域,用于局部刷新和文字定位 + * @param {Object} style + */ + getRect : function (style) { + if (!style.__rect) { + var lineWidth = 0; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } + + var yList = zrUtil.clone(style.y).sort(this._numberOrder); + style.__rect = { + x : Math.round(style.x - style.width / 2 - lineWidth / 2), + y : Math.round(yList[3] - lineWidth / 2), + width : style.width + lineWidth, + height : yList[0] - yList[3] + lineWidth + }; + } + + return style.__rect; + }, + + + isCover : require('./normalIsCover') + }; + + zrUtil.inherits(Candle, Base); + + return Candle; +}); diff --git a/amd/util/shape/Chain.js b/amd/util/shape/Chain.js index 7bf3fa4..98f9074 100644 --- a/amd/util/shape/Chain.js +++ b/amd/util/shape/Chain.js @@ -1,7 +1,7 @@ /** * zrender * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * * shape类:时间轴线 */ @@ -45,10 +45,12 @@ define(function (require) { // 设置transform this.setTransform(ctx); + ctx.save(); ctx.beginPath(); this.buildLinePath(ctx, style); ctx.stroke(); - + ctx.restore(); + this.brushSymbol(ctx, style); ctx.restore(); diff --git a/amd/util/shape/Chord.js b/amd/util/shape/Chord.js deleted file mode 100644 index 60223e3..0000000 --- a/amd/util/shape/Chord.js +++ /dev/null @@ -1,118 +0,0 @@ -/** - * zrender - * - * @author pissang (https://github.com/pissang) - * - * shape类:chord - * 可配图形属性: - { - // 基础属性 - shape : 'chord', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - center : {array}, - source0 : {number}, - source1 : {number}, - target0 : {number}, - target1 : {number}, - r : {number}, - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - */ -define(function (require) { - var Base = require('../../zrender/shape/Base'); - var zrUtil = require('../../zrender/tool/util'); - var _ctx = zrUtil.getContext(); - - function ChordShape(options) { - Base.call(this, options); - } - - ChordShape.prototype = { - type : 'chord', - - // center, source0, source1, target0, target1, r - buildPath : function (ctx, style) { - var PI2 = Math.PI * 2; - var cx = style.center[0]; - var cy = style.center[1]; - var r = style.r; - var s0 = style.source0 / 180 * Math.PI; - var s1 = style.source1 / 180 * Math.PI; - var t0 = style.target0 / 180 * Math.PI; - var t1 = style.target1 / 180 * Math.PI; - var sx0 = cx + Math.cos(PI2 - s0) * r; - var sy0 = cy - Math.sin(PI2 - s0) * r; - var sx1 = cx + Math.cos(PI2 - s1) * r; - var sy1 = cy - Math.sin(PI2 - s1) * r; - var tx0 = cx + Math.cos(PI2 - t0) * r; - var ty0 = cy - Math.sin(PI2 - t0) * r; - var tx1 = cx + Math.cos(PI2 - t1) * r; - var ty1 = cy - Math.sin(PI2 - t1) * r; - - ctx.moveTo(sx0, sy0); - ctx.arc(cx, cy, style.r, s0, s1, false); - ctx.bezierCurveTo( - (cx - sx1) * 0.70 + sx1, - (cy - sy1) * 0.70 + sy1, - (cx - tx0) * 0.70 + tx0, - (cy - ty0) * 0.70 + ty0, - tx0, ty0 - ); - // Chord to self - if (style.source0 === style.target0 && - style.source1 === style.target1) { - return; - } - ctx.arc(cx, cy, style.r, t0, t1, false); - ctx.bezierCurveTo( - (cx - tx1) * 0.70 + tx1, - (cy - ty1) * 0.70 + ty1, - (cx - sx0) * 0.70 + sx0, - (cy - sy0) * 0.70 + sy0, - sx0, sy0 - ); - }, - - getRect : function (){ - return { - x : 0, - y : 0, - width : 0, - height : 0 - }; - }, - - isCover : function (x, y) { - if (!_ctx.isPointInPath) { // In ie - return false; - } - var originPos = this.getTansform(x, y); - x = originPos[0]; - y = originPos[1]; - - _ctx.beginPath(); - ChordShape.prototype.buildPath.call(null, _ctx, this.style); - _ctx.closePath(); - - return _ctx.isPointInPath(x, y); - } - }; - - zrUtil.inherits(ChordShape, Base); - - return ChordShape; -}); \ No newline at end of file diff --git a/amd/util/shape/Cross.js b/amd/util/shape/Cross.js index acbf63e..d3b15fd 100644 --- a/amd/util/shape/Cross.js +++ b/amd/util/shape/Cross.js @@ -1,7 +1,7 @@ /** * zrender * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * * shape类:十字准星 * 可配图形属性: diff --git a/amd/util/shape/GaugePointer.js b/amd/util/shape/GaugePointer.js index 064cbeb..30e1268 100644 --- a/amd/util/shape/GaugePointer.js +++ b/amd/util/shape/GaugePointer.js @@ -1,7 +1,7 @@ /** * zrender * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * * shape类:仪表盘指针 * 可配图形属性: diff --git a/amd/util/shape/HalfSmoothPolygon.js b/amd/util/shape/HalfSmoothPolygon.js index 8cd7b79..b1235a9 100644 --- a/amd/util/shape/HalfSmoothPolygon.js +++ b/amd/util/shape/HalfSmoothPolygon.js @@ -1,103 +1,103 @@ -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:支持半平滑的polygon,折线面积图使用 - * 可配图形属性: - { - // 基础属性 - shape : 'halfSmoothPolygon', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - pointList : {Array}, // 必须,多边形各个顶角坐标 - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'halfSmoothPolygon', - id : '123456', - zlevel : 1, - style : { - pointList : [[10, 10], [300, 20], [298, 400], [50, 450]] - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function (eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define(function (require) { - var Base = require('../../zrender/shape/Base'); - var smoothBezier = require('../../zrender/shape/util/smoothBezier'); - var zrUtil = require('../../zrender/tool/util'); - - function HalfSmoothPolygon(options) { - Base.call(this, options); - } - - HalfSmoothPolygon.prototype = { - type : 'half-smooth-polygon', - /** - * 创建多边形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function (ctx, style) { - var pointList = style.pointList; - if (pointList.length < 2) { - // 少于2个点就不画了~ - return; - } - if (style.smooth) { - var controlPoints = smoothBezier( - pointList.slice(0, -2), style.smooth - ); - - ctx.moveTo(pointList[0][0], pointList[0][1]); - var cp1; - var cp2; - var p; - var l = pointList.length; - for (var i = 0; i < l - 3; i++) { - cp1 = controlPoints[i * 2]; - cp2 = controlPoints[i * 2 + 1]; - p = pointList[i + 1]; - ctx.bezierCurveTo( - cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1] - ); - } - ctx.lineTo(pointList[l - 2][0], pointList[l - 2][1]); - ctx.lineTo(pointList[l - 1][0], pointList[l - 1][1]); - ctx.lineTo(pointList[0][0], pointList[0][1]); - } - else { - require('../../zrender/shape/Polygon').prototype.buildPath( - ctx, style - ); - } - return; - } - }; - - zrUtil.inherits(HalfSmoothPolygon, Base); - - return HalfSmoothPolygon; +/** + * zrender + * + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + * + * shape类:支持半平滑的polygon,折线面积图使用 + * 可配图形属性: + { + // 基础属性 + shape : 'halfSmoothPolygon', // 必须,shape类标识,需要显式指定 + id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 + zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 + invisible : {boolean}, // 默认为false,是否可见 + + // 样式属性,默认状态样式样式属性 + style : { + pointList : {Array}, // 必须,多边形各个顶角坐标 + }, + + // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 + highlightStyle : { + // 同style + } + + // 交互属性,详见shape.Base + + // 事件属性,详见shape.Base + } + 例子: + { + shape : 'halfSmoothPolygon', + id : '123456', + zlevel : 1, + style : { + pointList : [[10, 10], [300, 20], [298, 400], [50, 450]] + color : '#eee', + text : 'Baidu' + }, + myName : 'kener', // 可自带任何有效自定义属性 + + clickable : true, + onClick : function (eventPacket) { + alert(eventPacket.target.myName); + } + } + */ +define(function (require) { + var Base = require('../../zrender/shape/Base'); + var smoothBezier = require('../../zrender/shape/util/smoothBezier'); + var zrUtil = require('../../zrender/tool/util'); + + function HalfSmoothPolygon(options) { + Base.call(this, options); + } + + HalfSmoothPolygon.prototype = { + type : 'half-smooth-polygon', + /** + * 创建多边形路径 + * @param {Context2D} ctx Canvas 2D上下文 + * @param {Object} style 样式 + */ + buildPath : function (ctx, style) { + var pointList = style.pointList; + if (pointList.length < 2) { + // 少于2个点就不画了~ + return; + } + if (style.smooth) { + var controlPoints = smoothBezier( + pointList.slice(0, -2), style.smooth, false, style.smoothConstraint + ); + + ctx.moveTo(pointList[0][0], pointList[0][1]); + var cp1; + var cp2; + var p; + var l = pointList.length; + for (var i = 0; i < l - 3; i++) { + cp1 = controlPoints[i * 2]; + cp2 = controlPoints[i * 2 + 1]; + p = pointList[i + 1]; + ctx.bezierCurveTo( + cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1] + ); + } + ctx.lineTo(pointList[l - 2][0], pointList[l - 2][1]); + ctx.lineTo(pointList[l - 1][0], pointList[l - 1][1]); + ctx.lineTo(pointList[0][0], pointList[0][1]); + } + else { + require('../../zrender/shape/Polygon').prototype.buildPath( + ctx, style + ); + } + return; + } + }; + + zrUtil.inherits(HalfSmoothPolygon, Base); + + return HalfSmoothPolygon; }); \ No newline at end of file diff --git a/amd/util/shape/HandlePolygon.js b/amd/util/shape/HandlePolygon.js index c3b4e02..f26b19d 100644 --- a/amd/util/shape/HandlePolygon.js +++ b/amd/util/shape/HandlePolygon.js @@ -1,7 +1,7 @@ /** * zrender * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * * shape类:handlePolygon,dataRange手柄 */ diff --git a/amd/util/shape/Icon.js b/amd/util/shape/Icon.js index f50ac39..14685c1 100644 --- a/amd/util/shape/Icon.js +++ b/amd/util/shape/Icon.js @@ -1,527 +1,647 @@ -/** - * echarts扩展zrender shape - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:icon - * 可配图形属性: - { - // 基础属性 - shape : 'icon', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,左上角横坐标 - y : {number}, // 必须,左上角纵坐标 - width : {number}, // 必须,宽度 - height : {number}, // 必须,高度 - iconType : {string}, // 必须,icon类型 - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - */ -define(function (require) { - var zrUtil = require('../../zrender/tool/util'); - - function _iconMark(ctx, style) { - var dx = style.width / 16; - var dy = style.height / 16; - ctx.moveTo(style.x, style.y + style.height); - ctx.lineTo(style.x + 5 * dx, style.y + 14 * dy); - ctx.lineTo(style.x + style.width, style.y + 3 * dy); - ctx.lineTo(style.x + 13 * dx, style.y); - ctx.lineTo(style.x + 2 * dx, style.y + 11 * dy); - ctx.lineTo(style.x, style.y + style.height); - - ctx.moveTo(style.x + 6 * dx, style.y + 10 * dy); - ctx.lineTo(style.x + 14 * dx, style.y + 2 * dy); - - ctx.moveTo(style.x + 10 * dx, style.y + 13 * dy); - ctx.lineTo(style.x + style.width, style.y + 13 * dy); - - ctx.moveTo(style.x + 13 * dx, style.y + 10 * dy); - ctx.lineTo(style.x + 13 * dx, style.y + style.height); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); - } - - function _iconMarkUndo(ctx, style) { - var dx = style.width / 16; - var dy = style.height / 16; - ctx.moveTo(style.x, style.y + style.height); - ctx.lineTo(style.x + 5 * dx, style.y + 14 * dy); - ctx.lineTo(style.x + style.width, style.y + 3 * dy); - ctx.lineTo(style.x + 13 * dx, style.y); - ctx.lineTo(style.x + 2 * dx, style.y + 11 * dy); - ctx.lineTo(style.x, style.y + style.height); - - ctx.moveTo(style.x + 6 * dx, style.y + 10 * dy); - ctx.lineTo(style.x + 14 * dx, style.y + 2 * dy); - - ctx.moveTo(style.x + 10 * dx, style.y + 13 * dy); - ctx.lineTo(style.x + style.width, style.y + 13 * dy); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); - } - - function _iconMarkClear(ctx, style) { - var dx = style.width / 16; - var dy = style.height / 16; - - ctx.moveTo(style.x + 4 * dx, style.y + 15 * dy); - ctx.lineTo(style.x + 9 * dx, style.y + 13 * dy); - ctx.lineTo(style.x + 14 * dx, style.y + 8 * dy); - ctx.lineTo(style.x + 11 * dx, style.y + 5 * dy); - ctx.lineTo(style.x + 6 * dx, style.y + 10 * dy); - ctx.lineTo(style.x + 4 * dx, style.y + 15 * dy); - - ctx.moveTo(style.x + 5 * dx, style.y); - ctx.lineTo(style.x + 11 * dx, style.y); - ctx.moveTo(style.x + 5 * dx, style.y + dy); - ctx.lineTo(style.x + 11 * dx, style.y + dy); - ctx.moveTo(style.x, style.y + 2 * dy); - ctx.lineTo(style.x + style.width, style.y + 2 * dy); - - ctx.moveTo(style.x, style.y + 5 * dy); - ctx.lineTo(style.x + 3 * dx, style.y + style.height); - ctx.lineTo(style.x + 13 * dx, style.y + style.height); - ctx.lineTo(style.x + style.width, style.y + 5 * dy); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); - } - - function _iconDataZoom(ctx, style) { - var dx = style.width / 16; - var dy = style.height / 16; - - ctx.moveTo(style.x, style.y + 3 * dy); - ctx.lineTo(style.x + 6 * dx, style.y + 3 * dy); - - ctx.moveTo(style.x + 3 * dx, style.y); - ctx.lineTo(style.x + 3 * dx, style.y + 6 * dy); - - ctx.moveTo(style.x + 3 * dx, style.y + 8 * dy); - ctx.lineTo(style.x + 3 * dx, style.y + style.height); - ctx.lineTo(style.x + style.width, style.y + style.height); - ctx.lineTo(style.x + style.width, style.y + 3 * dy); - ctx.lineTo(style.x + 8 * dx, style.y + 3 * dy); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); - } - - function _iconDataZoomReset(ctx, style) { - var dx = style.width / 16; - var dy = style.height / 16; - - ctx.moveTo(style.x + 6 * dx, style.y); - ctx.lineTo(style.x + 2 * dx, style.y + 3 * dy); - ctx.lineTo(style.x + 6 * dx, style.y + 6 * dy); - - ctx.moveTo(style.x + 2 * dx, style.y + 3 * dy); - ctx.lineTo(style.x + 14 * dx, style.y + 3 * dy); - ctx.lineTo(style.x + 14 * dx, style.y + 11 * dy); - - ctx.moveTo(style.x + 2 * dx, style.y + 5 * dy); - ctx.lineTo(style.x + 2 * dx, style.y + 13 * dy); - ctx.lineTo(style.x + 14 * dx, style.y + 13 * dy); - - ctx.moveTo(style.x + 10 * dx, style.y + 10 * dy); - ctx.lineTo(style.x + 14 * dx, style.y + 13 * dy); - ctx.lineTo(style.x + 10 * dx, style.y + style.height); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); - } - - function _iconRestore(ctx, style) { - var dx = style.width / 16; - var dy = style.height / 16; - var r = style.width / 2; - - ctx.lineWidth = 1.5; - - ctx.arc(style.x + r, style.y + r, r - dx, 0, Math.PI * 2 / 3); - ctx.moveTo(style.x + 3 * dx, style.y + style.height); - ctx.lineTo(style.x + 0 * dx, style.y + 12 * dy); - ctx.lineTo(style.x + 5 * dx, style.y + 11 * dy); - - ctx.moveTo(style.x, style.y + 8 * dy); - ctx.arc(style.x + r, style.y + r, r - dx, Math.PI, Math.PI * 5 / 3); - ctx.moveTo(style.x + 13 * dx, style.y); - ctx.lineTo(style.x + style.width, style.y + 4 * dy); - ctx.lineTo(style.x + 11 * dx, style.y + 5 * dy); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); - } - - function _iconLineChart(ctx, style) { - var dx = style.width / 16; - var dy = style.height / 16; - - ctx.moveTo(style.x, style.y); - ctx.lineTo(style.x, style.y + style.height); - ctx.lineTo(style.x + style.width, style.y + style.height); - - ctx.moveTo(style.x + 2 * dx, style.y + 14 * dy); - ctx.lineTo(style.x + 7 * dx, style.y + 6 * dy); - ctx.lineTo(style.x + 11 * dx, style.y + 11 * dy); - ctx.lineTo(style.x + 15 * dx, style.y + 2 * dy); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); - } - - function _iconBarChart(ctx, style) { - var dx = style.width / 16; - var dy = style.height / 16; - - ctx.moveTo(style.x, style.y); - ctx.lineTo(style.x, style.y + style.height); - ctx.lineTo(style.x + style.width, style.y + style.height); - - ctx.moveTo(style.x + 3 * dx, style.y + 14 * dy); - ctx.lineTo(style.x + 3 * dx, style.y + 6 * dy); - ctx.lineTo(style.x + 4 * dx, style.y + 6 * dy); - ctx.lineTo(style.x + 4 * dx, style.y + 14 * dy); - ctx.moveTo(style.x + 7 * dx, style.y + 14 * dy); - ctx.lineTo(style.x + 7 * dx, style.y + 2 * dy); - ctx.lineTo(style.x + 8 * dx, style.y + 2 * dy); - ctx.lineTo(style.x + 8 * dx, style.y + 14 * dy); - ctx.moveTo(style.x + 11 * dx, style.y + 14 * dy); - ctx.lineTo(style.x + 11 * dx, style.y + 9 * dy); - ctx.lineTo(style.x + 12 * dx, style.y + 9 * dy); - ctx.lineTo(style.x + 12 * dx, style.y + 14 * dy); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); - } - - function _iconStackChart(ctx, style) { - var x = style.x; - var y = style.y; - var width = style.width; - var height = style.height; - var dy = Math.round(height / 3); - var len = 3; - while (len--) { - ctx.rect(x, y + dy * len + 2, width, 2); - } - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); - } - - function _iconTiledChart(ctx, style) { - var x = style.x; - var y = style.y; - var width = style.width; - var height = style.height; - var dx = Math.round(width / 3); - var len = 3; - while (len--) { - ctx.rect(x + dx * len, y, 2, height); - } - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); - } - - function _iconDataView(ctx, style) { - var dx = style.width / 16; - - ctx.moveTo(style.x + dx, style.y); - ctx.lineTo(style.x + dx, style.y + style.height); - ctx.lineTo(style.x + 15 * dx, style.y + style.height); - ctx.lineTo(style.x + 15 * dx, style.y); - ctx.lineTo(style.x + dx, style.y); - - ctx.moveTo(style.x + 3 * dx, style.y + 3 * dx); - ctx.lineTo(style.x + 13 * dx, style.y + 3 * dx); - - ctx.moveTo(style.x + 3 * dx, style.y + 6 * dx); - ctx.lineTo(style.x + 13 * dx, style.y + 6 * dx); - - ctx.moveTo(style.x + 3 * dx, style.y + 9 * dx); - ctx.lineTo(style.x + 13 * dx, style.y + 9 * dx); - - ctx.moveTo(style.x + 3 * dx, style.y + 12 * dx); - ctx.lineTo(style.x + 9 * dx, style.y + 12 * dx); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); - } - - function _iconSave(ctx, style) { - var dx = style.width / 16; - var dy = style.height / 16; - - ctx.moveTo(style.x, style.y); - ctx.lineTo(style.x, style.y + style.height); - ctx.lineTo(style.x + style.width, style.y + style.height); - ctx.lineTo(style.x + style.width, style.y); - ctx.lineTo(style.x, style.y); - - ctx.moveTo(style.x + 4 * dx, style.y); - ctx.lineTo(style.x + 4 * dx, style.y + 8 * dy); - ctx.lineTo(style.x + 12 * dx, style.y + 8 * dy); - ctx.lineTo(style.x + 12 * dx, style.y); - - ctx.moveTo(style.x + 6 * dx, style.y + 11 * dy); - ctx.lineTo(style.x + 6 * dx, style.y + 13 * dy); - ctx.lineTo(style.x + 10 * dx, style.y + 13 * dy); - ctx.lineTo(style.x + 10 * dx, style.y + 11 * dy); - ctx.lineTo(style.x + 6 * dx, style.y + 11 * dy); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); - } - - function _iconCross(ctx, style) { - var x = style.x; - var y = style.y; - var width = style.width; - var height = style.height; - ctx.moveTo(x, y + height / 2); - ctx.lineTo(x + width, y + height / 2); - - ctx.moveTo(x + width / 2, y); - ctx.lineTo(x + width / 2, y + height); - } - - function _iconCircle(ctx, style) { - var width = style.width / 2; - var height = style.height / 2; - var r = Math.min(width, height); - ctx.moveTo( - style.x + width + r, - style.y + height - ); - ctx.arc( - style.x + width, - style.y + height, - r, - 0, - Math.PI * 2 - ); - } - - function _iconRectangle(ctx, style) { - ctx.rect(style.x, style.y, style.width, style.height); - } - - function _iconTriangle(ctx, style) { - var width = style.width / 2; - var height = style.height / 2; - var x = style.x + width; - var y = style.y + height; - var symbolSize = Math.min(width, height); - ctx.moveTo(x, y - symbolSize); - ctx.lineTo(x + symbolSize, y + symbolSize); - ctx.lineTo(x - symbolSize, y + symbolSize); - ctx.lineTo(x, y - symbolSize); - } - - function _iconDiamond(ctx, style) { - var width = style.width / 2; - var height = style.height / 2; - var x = style.x + width; - var y = style.y + height; - var symbolSize = Math.min(width, height); - ctx.moveTo(x, y - symbolSize); - ctx.lineTo(x + symbolSize, y); - ctx.lineTo(x, y + symbolSize); - ctx.lineTo(x - symbolSize, y); - ctx.lineTo(x, y - symbolSize); - } - - function _iconArrow(ctx, style) { - var x = style.x; - var y = style.y; - var dx = style.width / 16; - ctx.moveTo(x + 8 * dx, y); - ctx.lineTo(x + dx, y + style.height); - ctx.lineTo(x + 8 * dx, y + style.height / 4 * 3); - ctx.lineTo(x + 15 * dx, y + style.height); - ctx.lineTo(x + 8 * dx, y); - } - - function _iconStar(ctx, style) { - var StarShape = require('../../zrender/shape/Star'); - var width = style.width / 2; - var height = style.height / 2; - StarShape.prototype.buildPath(ctx, { - x : style.x + width, - y : style.y + height, - r : Math.min(width, height), - n : style.n || 5 - }); - } - - function _iconHeart(ctx, style) { - var HeartShape = require('../../zrender/shape/Heart'); - HeartShape.prototype.buildPath(ctx, { - x : style.x + style.width / 2, - y : style.y + style.height * 0.2, - a : style.width / 2, - b : style.height * 0.8 - }); - } - - function _iconDroplet(ctx, style) { - var DropletShape = require('../../zrender/shape/Droplet'); - DropletShape.prototype.buildPath(ctx, { - x : style.x + style.width * 0.5, - y : style.y + style.height * 0.5, - a : style.width * 0.5, - b : style.height * 0.8 - }); - } - - function _iconPin(ctx, style) { - var x = style.x; - var y = style.y - style.height / 2 * 1.5; - var width = style.width / 2; - var height = style.height / 2; - var r = Math.min(width, height); - ctx.arc( - x + width, - y + height, - r, - Math.PI / 5 * 4, - Math.PI / 5 - ); - ctx.lineTo(x + width, y + height + r * 1.5); - } - - function _iconImage(ctx, style) { - setTimeout(function (){ - var ImageShape = require('../../zrender/shape/Image'); - var itemShape = new ImageShape({ - style : style - }); - itemShape.brush(ctx); - },100); - } - - var Base = require('../../zrender/shape/Base'); - - function Icon(options) { - Base.call(this, options); - } - - Icon.prototype = { - type : 'icon', - iconLibrary : { - mark : _iconMark, - markUndo : _iconMarkUndo, - markClear : _iconMarkClear, - dataZoom : _iconDataZoom, - dataZoomReset : _iconDataZoomReset, - restore : _iconRestore, - lineChart : _iconLineChart, - barChart : _iconBarChart, - stackChart : _iconStackChart, - tiledChart : _iconTiledChart, - dataView : _iconDataView, - saveAsImage : _iconSave, - - cross : _iconCross, - circle : _iconCircle, - rectangle : _iconRectangle, - triangle : _iconTriangle, - diamond : _iconDiamond, - arrow : _iconArrow, - star : _iconStar, - heart : _iconHeart, - droplet : _iconDroplet, - pin : _iconPin, - image : _iconImage - }, - /** - * 创建矩形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function (ctx, style) { - if (this.iconLibrary[style.iconType]) { - this.iconLibrary[style.iconType](ctx, style); - } - else { - ctx.moveTo(style.x, style.y); - ctx.lineTo(style.x + style.width, style.y); - ctx.lineTo(style.x + style.width, style.y + style.height); - ctx.lineTo(style.x, style.y + style.height); - ctx.lineTo(style.x, style.y); - } - - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function (style) { - if (style.__rect) { - return style.__rect; - } - - // pin比较特殊,让尖端在目标x,y上 - style.__rect = { - x : Math.round(style.x), - y : Math.round(style.y - (style.iconType == 'pin' - ? (style.height / 2 * 1.5) : 0) - ), - width : style.width, - height : style.height - }; - - return style.__rect; - }, - - isCover : function (x, y) { - var originPos = this.getTansform(x, y); - x = originPos[0]; - y = originPos[1]; - - // 快速预判并保留判断矩形 - var rect = this.style.__rect; - if (!rect) { - rect = this.style.__rect = this.getRect(this.style); - } - // 提高交互体验,太小的图形包围盒四向扩大4px - var delta = (rect.height < 8 || rect.width < 8 ) ? 4 : 0; - if (x >= rect.x - delta - && x <= (rect.x + rect.width + delta) - && y >= rect.y - delta - && y <= (rect.y + rect.height + delta) - ) { - // 矩形内 - return true; - } - else { - return false; - } - } - }; - - zrUtil.inherits(Icon, Base); - - return Icon; +/** + * echarts扩展zrender shape + * + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + * + * shape类:icon + * 可配图形属性: + { + // 基础属性 + shape : 'icon', // 必须,shape类标识,需要显式指定 + id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 + zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 + invisible : {boolean}, // 默认为false,是否可见 + + // 样式属性,默认状态样式样式属性 + style : { + x : {number}, // 必须,左上角横坐标 + y : {number}, // 必须,左上角纵坐标 + width : {number}, // 必须,宽度 + height : {number}, // 必须,高度 + iconType : {string}, // 必须,icon类型 + }, + + // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 + highlightStyle : { + // 同style + } + + // 交互属性,详见shape.Base + + // 事件属性,详见shape.Base + } + */ +define(function (require) { + var zrUtil = require('../../zrender/tool/util'); + + function _iconMark(ctx, style) { + var x = style.x; + var y = style.y; + var dx = style.width / 16; + var dy = style.height / 16; + ctx.moveTo(x, y + style.height); + ctx.lineTo(x + 5 * dx, y + 14 * dy); + ctx.lineTo(x + style.width, y + 3 * dy); + ctx.lineTo(x + 13 * dx, y); + ctx.lineTo(x + 2 * dx, y + 11 * dy); + ctx.lineTo(x, y + style.height); + + ctx.moveTo(x + 6 * dx, y + 10 * dy); + ctx.lineTo(x + 14 * dx, y + 2 * dy); + + ctx.moveTo(x + 10 * dx, y + 13 * dy); + ctx.lineTo(x + style.width, y + 13 * dy); + + ctx.moveTo(x + 13 * dx, y + 10 * dy); + ctx.lineTo(x + 13 * dx, y + style.height); + } + + function _iconMarkUndo(ctx, style) { + var x = style.x; + var y = style.y; + var dx = style.width / 16; + var dy = style.height / 16; + ctx.moveTo(x, y + style.height); + ctx.lineTo(x + 5 * dx, y + 14 * dy); + ctx.lineTo(x + style.width, y + 3 * dy); + ctx.lineTo(x + 13 * dx, y); + ctx.lineTo(x + 2 * dx, y + 11 * dy); + ctx.lineTo(x, y + style.height); + + ctx.moveTo(x + 6 * dx, y + 10 * dy); + ctx.lineTo(x + 14 * dx, y + 2 * dy); + + ctx.moveTo(x + 10 * dx, y + 13 * dy); + ctx.lineTo(x + style.width, y + 13 * dy); + } + + function _iconMarkClear(ctx, style) { + var x = style.x; + var y = style.y; + var dx = style.width / 16; + var dy = style.height / 16; + + ctx.moveTo(x + 4 * dx, y + 15 * dy); + ctx.lineTo(x + 9 * dx, y + 13 * dy); + ctx.lineTo(x + 14 * dx, y + 8 * dy); + ctx.lineTo(x + 11 * dx, y + 5 * dy); + ctx.lineTo(x + 6 * dx, y + 10 * dy); + ctx.lineTo(x + 4 * dx, y + 15 * dy); + + ctx.moveTo(x + 5 * dx, y); + ctx.lineTo(x + 11 * dx, y); + ctx.moveTo(x + 5 * dx, y + dy); + ctx.lineTo(x + 11 * dx, y + dy); + ctx.moveTo(x, y + 2 * dy); + ctx.lineTo(x + style.width, y + 2 * dy); + + ctx.moveTo(x, y + 5 * dy); + ctx.lineTo(x + 3 * dx, y + style.height); + ctx.lineTo(x + 13 * dx, y + style.height); + ctx.lineTo(x + style.width, y + 5 * dy); + } + + function _iconDataZoom(ctx, style) { + var x = style.x; + var y = style.y; + var dx = style.width / 16; + var dy = style.height / 16; + + ctx.moveTo(x, y + 3 * dy); + ctx.lineTo(x + 6 * dx, y + 3 * dy); + + ctx.moveTo(x + 3 * dx, y); + ctx.lineTo(x + 3 * dx, y + 6 * dy); + + ctx.moveTo(x + 3 * dx, y + 8 * dy); + ctx.lineTo(x + 3 * dx, y + style.height); + ctx.lineTo(x + style.width, y + style.height); + ctx.lineTo(x + style.width, y + 3 * dy); + ctx.lineTo(x + 8 * dx, y + 3 * dy); + } + + function _iconDataZoomReset(ctx, style) { + var x = style.x; + var y = style.y; + var dx = style.width / 16; + var dy = style.height / 16; + + ctx.moveTo(x + 6 * dx, y); + ctx.lineTo(x + 2 * dx, y + 3 * dy); + ctx.lineTo(x + 6 * dx, y + 6 * dy); + + ctx.moveTo(x + 2 * dx, y + 3 * dy); + ctx.lineTo(x + 14 * dx, y + 3 * dy); + ctx.lineTo(x + 14 * dx, y + 11 * dy); + + ctx.moveTo(x + 2 * dx, y + 5 * dy); + ctx.lineTo(x + 2 * dx, y + 13 * dy); + ctx.lineTo(x + 14 * dx, y + 13 * dy); + + ctx.moveTo(x + 10 * dx, y + 10 * dy); + ctx.lineTo(x + 14 * dx, y + 13 * dy); + ctx.lineTo(x + 10 * dx, y + style.height); + } + + function _iconRestore(ctx, style) { + var x = style.x; + var y = style.y; + var dx = style.width / 16; + var dy = style.height / 16; + var r = style.width / 2; + + ctx.lineWidth = 1.5; + + ctx.arc(x + r, y + r, r - dx, 0, Math.PI * 2 / 3); + ctx.moveTo(x + 3 * dx, y + style.height); + ctx.lineTo(x + 0 * dx, y + 12 * dy); + ctx.lineTo(x + 5 * dx, y + 11 * dy); + + ctx.moveTo(x, y + 8 * dy); + ctx.arc(x + r, y + r, r - dx, Math.PI, Math.PI * 5 / 3); + ctx.moveTo(x + 13 * dx, y); + ctx.lineTo(x + style.width, y + 4 * dy); + ctx.lineTo(x + 11 * dx, y + 5 * dy); + } + + function _iconLineChart(ctx, style) { + var x = style.x; + var y = style.y; + var dx = style.width / 16; + var dy = style.height / 16; + + ctx.moveTo(x, y); + ctx.lineTo(x, y + style.height); + ctx.lineTo(x + style.width, y + style.height); + + ctx.moveTo(x + 2 * dx, y + 14 * dy); + ctx.lineTo(x + 7 * dx, y + 6 * dy); + ctx.lineTo(x + 11 * dx, y + 11 * dy); + ctx.lineTo(x + 15 * dx, y + 2 * dy); + } + + function _iconBarChart(ctx, style) { + var x = style.x; + var y = style.y; + var dx = style.width / 16; + var dy = style.height / 16; + + ctx.moveTo(x, y); + ctx.lineTo(x, y + style.height); + ctx.lineTo(x + style.width, y + style.height); + + ctx.moveTo(x + 3 * dx, y + 14 * dy); + ctx.lineTo(x + 3 * dx, y + 6 * dy); + ctx.lineTo(x + 4 * dx, y + 6 * dy); + ctx.lineTo(x + 4 * dx, y + 14 * dy); + ctx.moveTo(x + 7 * dx, y + 14 * dy); + ctx.lineTo(x + 7 * dx, y + 2 * dy); + ctx.lineTo(x + 8 * dx, y + 2 * dy); + ctx.lineTo(x + 8 * dx, y + 14 * dy); + ctx.moveTo(x + 11 * dx, y + 14 * dy); + ctx.lineTo(x + 11 * dx, y + 9 * dy); + ctx.lineTo(x + 12 * dx, y + 9 * dy); + ctx.lineTo(x + 12 * dx, y + 14 * dy); + } + + function _iconPieChart(ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width - 2; + var height = style.height - 2; + var r = Math.min(width, height) / 2; + y += 2; + ctx.moveTo(x + r + 3, y + r - 3); + ctx.arc(x + r + 3, y + r - 3, r - 1, 0, -Math.PI / 2, true); + ctx.lineTo(x + r + 3, y + r - 3); + + ctx.moveTo(x + r, y); + ctx.lineTo(x + r, y + r); + ctx.arc(x + r, y + r, r, -Math.PI / 2, Math.PI * 2, true); + ctx.lineTo(x + r, y + r); + ctx.lineWidth = 1.5; + } + + function _iconFunnelChart(ctx, style) { + var x = style.x; + var y = style.y; + var dx = style.width / 16; + var dy = style.height / 16; + y -= dy; + ctx.moveTo(x + 1 * dx, y + 2 * dy); + ctx.lineTo(x + 15 * dx, y + 2 * dy); + ctx.lineTo(x + 14 * dx, y + 3 * dy); + ctx.lineTo(x + 2 * dx, y + 3 * dy); + + ctx.moveTo(x + 3 * dx, y + 6 * dy); + ctx.lineTo(x + 13 * dx, y + 6 * dy); + ctx.lineTo(x + 12 * dx, y + 7 * dy); + ctx.lineTo(x + 4 * dx, y + 7 * dy); + + ctx.moveTo(x + 5 * dx, y + 10 * dy); + ctx.lineTo(x + 11 * dx, y + 10 * dy); + ctx.lineTo(x + 10 * dx, y + 11 * dy); + ctx.lineTo(x + 6 * dx, y + 11 * dy); + + ctx.moveTo(x + 7 * dx, y + 14 * dy); + ctx.lineTo(x + 9 * dx, y + 14 * dy); + ctx.lineTo(x + 8 * dx, y + 15 * dy); + ctx.lineTo(x + 7 * dx, y + 15 * dy); + } + + function _iconForceChart(ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + var dx = width / 16; + var dy = height / 16; + var r = Math.min(dx, dy) * 2; + + ctx.moveTo(x + dx + r, y + dy + r); + ctx.arc(x + dx, y + dy, r, Math.PI / 4, Math.PI * 3); + + ctx.lineTo(x + 7 * dx - r, y + 6 * dy - r); + ctx.arc(x + 7 * dx, y + 6 * dy, r, Math.PI / 4 * 5, Math.PI * 4); + ctx.arc(x + 7 * dx, y + 6 * dy, r / 2, Math.PI / 4 * 5, Math.PI * 4); + + ctx.moveTo(x + 7 * dx - r / 2, y + 6 * dy + r); + ctx.lineTo(x + dx + r, y + 14 * dy - r); + ctx.arc(x + dx, y + 14 * dy, r, -Math.PI / 4, Math.PI * 2); + + ctx.moveTo(x + 7 * dx + r / 2, y + 6 * dy); + ctx.lineTo(x + 14 * dx - r, y + 10 * dy - r / 2); + ctx.moveTo(x + 16 * dx, y + 10 * dy); + ctx.arc(x + 14 * dx, y + 10 * dy, r, 0, Math.PI * 3); + ctx.lineWidth = 1.5; + } + + function _iconChordChart(ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + var r = Math.min(width, height) / 2; + + ctx.moveTo(x + width, y + height / 2); + ctx.arc(x + r, y + r, r, 0, Math.PI * 2); + + ctx.arc(x + r, y, r, Math.PI / 4, Math.PI / 5 * 4); + ctx.arc(x, y + r, r, -Math.PI / 3, Math.PI / 3); + ctx.arc(x + width, y + height, r, Math.PI, Math.PI / 2 * 3); + ctx.lineWidth = 1.5; + } + + function _iconStackChart(ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + var dy = Math.round(height / 3); + var delta = Math.round((dy - 2) / 2); + var len = 3; + while (len--) { + ctx.rect(x, y + dy * len + delta, width, 2); + } + } + + function _iconTiledChart(ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + var dx = Math.round(width / 3); + var delta = Math.round((dx - 2) / 2); + var len = 3; + while (len--) { + ctx.rect(x + dx * len + delta, y, 2, height); + } + } + + function _iconDataView(ctx, style) { + var x = style.x; + var y = style.y; + var dx = style.width / 16; + + ctx.moveTo(x + dx, y); + ctx.lineTo(x + dx, y + style.height); + ctx.lineTo(x + 15 * dx, y + style.height); + ctx.lineTo(x + 15 * dx, y); + ctx.lineTo(x + dx, y); + + ctx.moveTo(x + 3 * dx, y + 3 * dx); + ctx.lineTo(x + 13 * dx, y + 3 * dx); + + ctx.moveTo(x + 3 * dx, y + 6 * dx); + ctx.lineTo(x + 13 * dx, y + 6 * dx); + + ctx.moveTo(x + 3 * dx, y + 9 * dx); + ctx.lineTo(x + 13 * dx, y + 9 * dx); + + ctx.moveTo(x + 3 * dx, y + 12 * dx); + ctx.lineTo(x + 9 * dx, y + 12 * dx); + } + + function _iconSave(ctx, style) { + var x = style.x; + var y = style.y; + var dx = style.width / 16; + var dy = style.height / 16; + + ctx.moveTo(x, y); + ctx.lineTo(x, y + style.height); + ctx.lineTo(x + style.width, y + style.height); + ctx.lineTo(x + style.width, y); + ctx.lineTo(x, y); + + ctx.moveTo(x + 4 * dx, y); + ctx.lineTo(x + 4 * dx, y + 8 * dy); + ctx.lineTo(x + 12 * dx, y + 8 * dy); + ctx.lineTo(x + 12 * dx, y); + + ctx.moveTo(x + 6 * dx, y + 11 * dy); + ctx.lineTo(x + 6 * dx, y + 13 * dy); + ctx.lineTo(x + 10 * dx, y + 13 * dy); + ctx.lineTo(x + 10 * dx, y + 11 * dy); + ctx.lineTo(x + 6 * dx, y + 11 * dy); + } + + function _iconCross(ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + ctx.moveTo(x, y + height / 2); + ctx.lineTo(x + width, y + height / 2); + + ctx.moveTo(x + width / 2, y); + ctx.lineTo(x + width / 2, y + height); + } + + function _iconCircle(ctx, style) { + var width = style.width / 2; + var height = style.height / 2; + var r = Math.min(width, height); + ctx.moveTo( + style.x + width + r, + style.y + height + ); + ctx.arc( + style.x + width, + style.y + height, + r, + 0, + Math.PI * 2 + ); + ctx.closePath(); + } + + function _iconRectangle(ctx, style) { + ctx.rect(style.x, style.y, style.width, style.height); + ctx.closePath(); + } + + function _iconTriangle(ctx, style) { + var width = style.width / 2; + var height = style.height / 2; + var x = style.x + width; + var y = style.y + height; + var symbolSize = Math.min(width, height); + ctx.moveTo(x, y - symbolSize); + ctx.lineTo(x + symbolSize, y + symbolSize); + ctx.lineTo(x - symbolSize, y + symbolSize); + ctx.lineTo(x, y - symbolSize); + ctx.closePath(); + } + + function _iconDiamond(ctx, style) { + var width = style.width / 2; + var height = style.height / 2; + var x = style.x + width; + var y = style.y + height; + var symbolSize = Math.min(width, height); + ctx.moveTo(x, y - symbolSize); + ctx.lineTo(x + symbolSize, y); + ctx.lineTo(x, y + symbolSize); + ctx.lineTo(x - symbolSize, y); + ctx.lineTo(x, y - symbolSize); + ctx.closePath(); + } + + function _iconArrow(ctx, style) { + var x = style.x; + var y = style.y; + var dx = style.width / 16; + ctx.moveTo(x + 8 * dx, y); + ctx.lineTo(x + dx, y + style.height); + ctx.lineTo(x + 8 * dx, y + style.height / 4 * 3); + ctx.lineTo(x + 15 * dx, y + style.height); + ctx.lineTo(x + 8 * dx, y); + ctx.closePath(); + } + + function _iconStar(ctx, style) { + var StarShape = require('../../zrender/shape/Star'); + var width = style.width / 2; + var height = style.height / 2; + StarShape.prototype.buildPath(ctx, { + x : style.x + width, + y : style.y + height, + r : Math.min(width, height), + n : style.n || 5 + }); + } + + function _iconHeart(ctx, style) { + var HeartShape = require('../../zrender/shape/Heart'); + HeartShape.prototype.buildPath(ctx, { + x : style.x + style.width / 2, + y : style.y + style.height * 0.2, + a : style.width / 2, + b : style.height * 0.8 + }); + } + + function _iconDroplet(ctx, style) { + var DropletShape = require('../../zrender/shape/Droplet'); + DropletShape.prototype.buildPath(ctx, { + x : style.x + style.width * 0.5, + y : style.y + style.height * 0.5, + a : style.width * 0.5, + b : style.height * 0.8 + }); + } + + function _iconPin(ctx, style) { + var x = style.x; + var y = style.y - style.height / 2 * 1.5; + var width = style.width / 2; + var height = style.height / 2; + var r = Math.min(width, height); + ctx.arc( + x + width, + y + height, + r, + Math.PI / 5 * 4, + Math.PI / 5 + ); + ctx.lineTo(x + width, y + height + r * 1.5); + ctx.closePath(); + } + + function _iconImage(ctx, style, refreshNextFrame) { + var ImageShape = require('../../zrender/shape/Image'); + this._imageShape = this._imageShape || new ImageShape({ + style: {} + }); + for (var name in style) { + this._imageShape.style[name] = style[name]; + } + this._imageShape.brush(ctx, false, refreshNextFrame); + } + + var Base = require('../../zrender/shape/Base'); + + function Icon(options) { + Base.call(this, options); + } + + Icon.prototype = { + type : 'icon', + iconLibrary : { + mark : _iconMark, + markUndo : _iconMarkUndo, + markClear : _iconMarkClear, + dataZoom : _iconDataZoom, + dataZoomReset : _iconDataZoomReset, + restore : _iconRestore, + lineChart : _iconLineChart, + barChart : _iconBarChart, + pieChart : _iconPieChart, + funnelChart : _iconFunnelChart, + forceChart : _iconForceChart, + chordChart : _iconChordChart, + stackChart : _iconStackChart, + tiledChart : _iconTiledChart, + dataView : _iconDataView, + saveAsImage : _iconSave, + + cross : _iconCross, + circle : _iconCircle, + rectangle : _iconRectangle, + triangle : _iconTriangle, + diamond : _iconDiamond, + arrow : _iconArrow, + star : _iconStar, + heart : _iconHeart, + droplet : _iconDroplet, + pin : _iconPin, + image : _iconImage + }, + brush: function (ctx, isHighlight, refreshNextFrame) { + var style = isHighlight ? this.highlightStyle : this.style; + style = style || {}; + var iconType = style.iconType || this.style.iconType; + if (iconType === 'image') { + var ImageShape = require('../../zrender/shape/Image'); + ImageShape.prototype.brush.call(this, ctx, isHighlight, refreshNextFrame); + + } else { + + var style = this.beforeBrush(ctx, isHighlight); + + ctx.beginPath(); + this.buildPath(ctx, style, refreshNextFrame); + + switch (style.brushType) { + /* jshint ignore:start */ + case 'both': + ctx.fill(); + case 'stroke': + style.lineWidth > 0 && ctx.stroke(); + break; + /* jshint ignore:end */ + default: + ctx.fill(); + } + + this.drawText(ctx, style, this.style); + + this.afterBrush(ctx); + } + }, + /** + * 创建矩形路径 + * @param {Context2D} ctx Canvas 2D上下文 + * @param {Object} style 样式 + */ + buildPath : function (ctx, style, refreshNextFrame) { + if (this.iconLibrary[style.iconType]) { + this.iconLibrary[style.iconType].call(this, ctx, style, refreshNextFrame); + } + else { + ctx.moveTo(style.x, style.y); + ctx.lineTo(style.x + style.width, style.y); + ctx.lineTo(style.x + style.width, style.y + style.height); + ctx.lineTo(style.x, style.y + style.height); + ctx.lineTo(style.x, style.y); + ctx.closePath(); + } + + return; + }, + + /** + * 返回矩形区域,用于局部刷新和文字定位 + * @param {Object} style + */ + getRect : function (style) { + if (style.__rect) { + return style.__rect; + } + + // pin比较特殊,让尖端在目标x,y上 + style.__rect = { + x : Math.round(style.x), + y : Math.round(style.y - (style.iconType == 'pin' + ? (style.height / 2 * 1.5) : 0) + ), + width : style.width, + height : style.height * ( + style.iconType === 'pin' ? 1.25 : 1 + ) + }; + + return style.__rect; + }, + + isCover : function (x, y) { + var originPos = this.getTansform(x, y); + x = originPos[0]; + y = originPos[1]; + + // 快速预判并保留判断矩形 + var rect = this.style.__rect; + if (!rect) { + rect = this.style.__rect = this.getRect(this.style); + } + // 提高交互体验,太小的图形包围盒四向扩大4px + var delta = (rect.height < 8 || rect.width < 8 ) ? 4 : 0; + if (x >= rect.x - delta + && x <= (rect.x + rect.width + delta) + && y >= rect.y - delta + && y <= (rect.y + rect.height + delta) + ) { + // 矩形内 + return true; + } + else { + return false; + } + } + }; + + zrUtil.inherits(Icon, Base); + + return Icon; }); \ No newline at end of file diff --git a/amd/util/shape/MarkLine.js b/amd/util/shape/MarkLine.js index 2451b57..b08e51e 100644 --- a/amd/util/shape/MarkLine.js +++ b/amd/util/shape/MarkLine.js @@ -1,7 +1,7 @@ /** * zrender * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * * shape类:标线 */ @@ -10,8 +10,8 @@ define(function (require) { var IconShape = require('./Icon'); var LineShape = require('../../zrender/shape/Line'); var lineInstance = new LineShape({}); - var BrokenLineShape = require('../../zrender/shape/BrokenLine'); - var brokenLineInstance = new BrokenLineShape({}); + var PolylineShape = require('../../zrender/shape/Polyline'); + var polylineInstance = new PolylineShape({}); var matrix = require('../../zrender/tool/matrix'); var area = require('../../zrender/tool/area'); @@ -51,9 +51,11 @@ define(function (require) { // 设置transform this.setTransform(ctx); + ctx.save(); ctx.beginPath(); - this.buildLinePath(ctx, style); + this.buildLinePath(ctx, style, this.style.lineWidth || 1); ctx.stroke(); + ctx.restore(); this.brushSymbol(ctx, style, 0); this.brushSymbol(ctx, style, 1); @@ -68,7 +70,7 @@ define(function (require) { * @param {Context2D} ctx Canvas 2D上下文 * @param {Object} style 样式 */ - buildLinePath : function (ctx, style) { + buildLinePath : function (ctx, style, lineWidth) { var pointList = style.pointList || this.getPointList(style); style.pointList = pointList; @@ -89,8 +91,7 @@ define(function (require) { ) { if (style.smooth !== 'spline') { // 直线 - var dashLength = (style.lineWidth || 1) - * (style.lineType == 'dashed' ? 5 : 1); + var dashLength = lineWidth * (style.lineType == 'dashed' ? 5 : 1); ctx.moveTo(pointList[0][0],pointList[0][1]); for (var i = 1; i < len; i++) { dashedLineTo( @@ -188,7 +189,7 @@ define(function (require) { var yEnd = style.pointList[len - 1][1]; var delta = 0; if (style.smooth === 'spline') { - delta = 0.2; // 偏移0.2弧度 + delta = style.smoothRadian * (xStart <= xEnd ? 1 : -1); // 偏移0.2弧度 } // 原谅我吧,这三角函数实在没想明白,只能这么笨了 var rotate = Math.atan( @@ -263,9 +264,19 @@ define(function (require) { if (style.smooth === 'spline') { var lastPointX = pointList[1][0]; var lastPointY = pointList[1][1]; - pointList[3] = [lastPointX, lastPointY]; - pointList[1] = this.getOffetPoint(pointList[0], pointList[3]); - pointList[2] = this.getOffetPoint(pointList[3], pointList[0]); + if (style.smoothRadian <= 0.8) { + pointList[3] = [lastPointX, lastPointY]; + var isReverse = pointList[0][0] <= pointList[3][0]; + pointList[1] = this.getOffetPoint(pointList[0], pointList[3], isReverse, style.smoothRadian); + pointList[2] = this.getOffetPoint(pointList[3], pointList[0], isReverse, style.smoothRadian); + } + else { + pointList[2] = [lastPointX, lastPointY]; + pointList[1] = this.getOffetPoint( + pointList[0], pointList[2], pointList[0][0] <= pointList[2][0], style.smoothRadian + ); + } + pointList = smoothSpline(pointList, false); // 修正最后一点在插值产生的偏移 pointList[pointList.length - 1] = [lastPointX, lastPointY]; @@ -277,14 +288,14 @@ define(function (require) { * {Array} start point * {Array} end point */ - getOffetPoint : function (sp, ep) { + getOffetPoint : function (sp, ep, isReverse, deltaAngle) { + var split = (2 - Math.abs(deltaAngle)) / 0.6; var distance = Math.sqrt(Math.round( (sp[0] - ep[0]) * (sp[0] - ep[0]) + (sp[1] - ep[1]) * (sp[1] - ep[1]) - )) / 3; + )) / split; //console.log(delta); var mp = [sp[0], sp[1]]; var angle; - var deltaAngle = 0.2; // 偏移0.2弧度 if (sp[0] != ep[0] && sp[1] != ep[1]) { // 斜率存在 var k = (ep[1] - sp[1]) / (ep[0] - sp[0]); @@ -301,14 +312,14 @@ define(function (require) { var dX; var dY; if (sp[0] <= ep[0]) { - angle -= deltaAngle; + angle -= deltaAngle * (isReverse ? 1 : -1); dX = Math.round(Math.cos(angle) * distance); dY = Math.round(Math.sin(angle) * distance); mp[0] += dX; mp[1] += dY; } else { - angle += deltaAngle; + angle += deltaAngle * (isReverse ? 1 : -1); dX = Math.round(Math.cos(angle) * distance); dY = Math.round(Math.sin(angle) * distance); mp[0] -= dX; @@ -357,7 +368,7 @@ define(function (require) { // 矩形内 return this.style.smooth !== 'spline' ? area.isInside(lineInstance, this.style, x, y) - : area.isInside(brokenLineInstance, this.style, x, y); + : area.isInside(polylineInstance, this.style, x, y); } return false; diff --git a/amd/util/shape/Ribbon.js b/amd/util/shape/Ribbon.js new file mode 100644 index 0000000..dbd006a --- /dev/null +++ b/amd/util/shape/Ribbon.js @@ -0,0 +1,127 @@ +/** + * @module echarts/util/shape/Ribbon + * @author pissang (https://github.com/pissang) + */ +/** + * @typedef {Object} IRibbonStyle + * @property {number} x + * @property {number} y + * @property {number} source0 + * @property {number} source1 + * @property {number} target0 + * @property {number} target1 + * @property {number} r + * @property {boolean} clockWise + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ +define(function (require) { + var Base = require('../../zrender/shape/Base'); + var PathProxy = require('../../zrender/shape/util/PathProxy'); + var zrUtil = require('../../zrender/tool/util'); + var area = require('../../zrender/tool/area'); + + // var _ctx = zrUtil.getContext(); + + function RibbonShape(options) { + Base.call(this, options); + + this._pathProxy = new PathProxy(); + } + + RibbonShape.prototype = { + + type : 'ribbon', + + buildPath : function (ctx, style) { + + var clockWise = style.clockWise || false; + + var path = this._pathProxy; + path.begin(ctx); + + var cx = style.x; + var cy = style.y; + var r = style.r; + var s0 = style.source0 / 180 * Math.PI; + var s1 = style.source1 / 180 * Math.PI; + var t0 = style.target0 / 180 * Math.PI; + var t1 = style.target1 / 180 * Math.PI; + var sx0 = cx + Math.cos(s0) * r; + var sy0 = cy + Math.sin(s0) * r; + var sx1 = cx + Math.cos(s1) * r; + var sy1 = cy + Math.sin(s1) * r; + var tx0 = cx + Math.cos(t0) * r; + var ty0 = cy + Math.sin(t0) * r; + var tx1 = cx + Math.cos(t1) * r; + var ty1 = cy + Math.sin(t1) * r; + + path.moveTo(sx0, sy0); + path.arc(cx, cy, style.r, s0, s1, !clockWise); + path.bezierCurveTo( + (cx - sx1) * 0.70 + sx1, + (cy - sy1) * 0.70 + sy1, + (cx - tx0) * 0.70 + tx0, + (cy - ty0) * 0.70 + ty0, + tx0, ty0 + ); + // Chord to self + if (style.source0 === style.target0 + && style.source1 === style.target1 + ) { + return; + } + path.arc(cx, cy, style.r, t0, t1, !clockWise); + path.bezierCurveTo( + (cx - tx1) * 0.70 + tx1, + (cy - ty1) * 0.70 + ty1, + (cx - sx0) * 0.70 + sx0, + (cy - sy0) * 0.70 + sy0, + sx0, sy0 + ); + }, + + getRect : function (style) { + if (style.__rect) { + return style.__rect; + } + if (!this._pathProxy.isEmpty()) { + this.buildPath(null, style); + } + return this._pathProxy.fastBoundingRect(); + }, + + isCover : function (x, y) { + var rect = this.getRect(this.style); + if (x >= rect.x + && x <= (rect.x + rect.width) + && y >= rect.y + && y <= (rect.y + rect.height) + ) { + return area.isInsidePath( + this._pathProxy.pathCommands, 0, 'fill', x, y + ); + } + } + }; + + zrUtil.inherits(RibbonShape, Base); + + return RibbonShape; +}); \ No newline at end of file diff --git a/amd/util/shape/Symbol.js b/amd/util/shape/Symbol.js index 7a28c63..ca72250 100644 --- a/amd/util/shape/Symbol.js +++ b/amd/util/shape/Symbol.js @@ -1,189 +1,189 @@ -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:大规模散点图图形 - * 可配图形属性: - { - // 基础属性 - shape : 'symbol', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - pointList : {Array}, // 必须,二维数组,二维内容如下 - x : {number}, // 必须,横坐标 - y : {number}, // 必须,纵坐标数组 - size : {number}, // 必须,半宽 - type : {string=}, // 默认为'circle',图形类型 - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - */ -define(function (require) { - var Base = require('../../zrender/shape/Base'); - var PolygonShape = require('../../zrender/shape/Polygon'); - var polygonInstance = new PolygonShape({}); - var zrUtil = require('../../zrender/tool/util'); - - function Symbol(options) { - Base.call(this, options); - } - - Symbol.prototype = { - type : 'symbol', - /** - * 创建矩形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function (ctx, style) { - var pointList = style.pointList; - var len = pointList.length; - if (len === 0) { - return; - } - - var subSize = 10000; - var subSetLength = Math.ceil(len / subSize); - var sub; - var subLen; - var isArray = pointList[0] instanceof Array; - var size = style.size ? style.size : 2; - var curSize = size; - var halfSize = size / 2; - var PI2 = Math.PI * 2; - var percent; - var x; - var y; - for (var j = 0; j < subSetLength; j++) { - ctx.beginPath(); - sub = j * subSize; - subLen = sub + subSize; - subLen = subLen > len ? len : subLen; - for (var i = sub; i < subLen; i++) { - if (style.random) { - percent = style['randomMap' + (i % 20)] / 100; - curSize = size * percent * percent; - halfSize = curSize / 2; - } - if (isArray) { - x = pointList[i][0]; - y = pointList[i][1]; - } - else { - x = pointList[i].x; - y = pointList[i].y; - } - if (curSize < 3) { - // 小于3像素视觉误差 - ctx.rect(x - halfSize, y - halfSize, curSize, curSize); - } - else { - // 大于3像素才考虑图形 - switch (style.iconType) { - case 'circle' : - ctx.moveTo(x, y); - ctx.arc(x, y, halfSize, 0, PI2, true); - break; - case 'diamond' : - ctx.moveTo(x, y - halfSize); - ctx.lineTo(x + halfSize / 3, y - halfSize / 3); - ctx.lineTo(x + halfSize, y); - ctx.lineTo(x + halfSize / 3, y + halfSize / 3); - ctx.lineTo(x, y + halfSize); - ctx.lineTo(x - halfSize / 3, y + halfSize / 3); - ctx.lineTo(x - halfSize, y); - ctx.lineTo(x - halfSize / 3, y - halfSize / 3); - ctx.lineTo(x, y - halfSize); - break; - default : - ctx.rect(x - halfSize, y - halfSize, curSize, curSize); - } - } - } - ctx.closePath(); - if (j < (subSetLength - 1)) { - switch (style.brushType) { - case 'both': - ctx.fill(); - style.lineWidth > 0 && ctx.stroke(); // js hint -_-" - break; - case 'stroke': - style.lineWidth > 0 && ctx.stroke(); - break; - default: - ctx.fill(); - } - } - } - }, - - /* 像素模式 - buildPath : function (ctx, style) { - var pointList = style.pointList; - var rect = this.getRect(style); - var ratio = window.devicePixelRatio || 1; - // console.log(rect) - // var ti = new Date(); - // bbox取整 - rect = { - x : Math.floor(rect.x), - y : Math.floor(rect.y), - width : Math.floor(rect.width), - height : Math.floor(rect.height) - }; - var pixels = ctx.getImageData( - rect.x * ratio, rect.y * ratio, - rect.width * ratio, rect.height * ratio - ); - var data = pixels.data; - var idx; - var zrColor = require('../../zrender/tool/color'); - var color = zrColor.toArray(style.color); - var r = color[0]; - var g = color[1]; - var b = color[2]; - var width = rect.width; - - for (var i = 1, l = pointList.length; i < l; i++) { - idx = ((Math.floor(pointList[i][0]) - rect.x) * ratio - + (Math.floor(pointList[i][1])- rect.y) * width * ratio * ratio - ) * 4; - data[idx] = r; - data[idx + 1] = g; - data[idx + 2] = b; - data[idx + 3] = 255; - } - ctx.putImageData(pixels, rect.x * ratio, rect.y * ratio); - // console.log(new Date() - ti); - return; - }, - */ - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function (style) { - return style.__rect || polygonInstance.getRect(style); - }, - - isCover : require('./normalIsCover') - }; - - zrUtil.inherits(Symbol, Base); - - return Symbol; -}); +/** + * zrender + * + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + * + * shape类:大规模散点图图形 + * 可配图形属性: + { + // 基础属性 + shape : 'symbol', // 必须,shape类标识,需要显式指定 + id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 + zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 + invisible : {boolean}, // 默认为false,是否可见 + + // 样式属性,默认状态样式样式属性 + style : { + pointList : {Array}, // 必须,二维数组,二维内容如下 + x : {number}, // 必须,横坐标 + y : {number}, // 必须,纵坐标数组 + size : {number}, // 必须,半宽 + type : {string=}, // 默认为'circle',图形类型 + }, + + // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 + highlightStyle : { + // 同style + } + + // 交互属性,详见shape.Base + + // 事件属性,详见shape.Base + } + */ +define(function (require) { + var Base = require('../../zrender/shape/Base'); + var PolygonShape = require('../../zrender/shape/Polygon'); + var polygonInstance = new PolygonShape({}); + var zrUtil = require('../../zrender/tool/util'); + + function Symbol(options) { + Base.call(this, options); + } + + Symbol.prototype = { + type : 'symbol', + /** + * 创建矩形路径 + * @param {Context2D} ctx Canvas 2D上下文 + * @param {Object} style 样式 + */ + buildPath : function (ctx, style) { + var pointList = style.pointList; + var len = pointList.length; + if (len === 0) { + return; + } + + var subSize = 10000; + var subSetLength = Math.ceil(len / subSize); + var sub; + var subLen; + var isArray = pointList[0] instanceof Array; + var size = style.size ? style.size : 2; + var curSize = size; + var halfSize = size / 2; + var PI2 = Math.PI * 2; + var percent; + var x; + var y; + for (var j = 0; j < subSetLength; j++) { + ctx.beginPath(); + sub = j * subSize; + subLen = sub + subSize; + subLen = subLen > len ? len : subLen; + for (var i = sub; i < subLen; i++) { + if (style.random) { + percent = style['randomMap' + (i % 20)] / 100; + curSize = size * percent * percent; + halfSize = curSize / 2; + } + if (isArray) { + x = pointList[i][0]; + y = pointList[i][1]; + } + else { + x = pointList[i].x; + y = pointList[i].y; + } + if (curSize < 3) { + // 小于3像素视觉误差 + ctx.rect(x - halfSize, y - halfSize, curSize, curSize); + } + else { + // 大于3像素才考虑图形 + switch (style.iconType) { + case 'circle' : + ctx.moveTo(x, y); + ctx.arc(x, y, halfSize, 0, PI2, true); + break; + case 'diamond' : + ctx.moveTo(x, y - halfSize); + ctx.lineTo(x + halfSize / 3, y - halfSize / 3); + ctx.lineTo(x + halfSize, y); + ctx.lineTo(x + halfSize / 3, y + halfSize / 3); + ctx.lineTo(x, y + halfSize); + ctx.lineTo(x - halfSize / 3, y + halfSize / 3); + ctx.lineTo(x - halfSize, y); + ctx.lineTo(x - halfSize / 3, y - halfSize / 3); + ctx.lineTo(x, y - halfSize); + break; + default : + ctx.rect(x - halfSize, y - halfSize, curSize, curSize); + } + } + } + ctx.closePath(); + if (j < (subSetLength - 1)) { + switch (style.brushType) { + case 'both': + ctx.fill(); + style.lineWidth > 0 && ctx.stroke(); // js hint -_-" + break; + case 'stroke': + style.lineWidth > 0 && ctx.stroke(); + break; + default: + ctx.fill(); + } + } + } + }, + + /* 像素模式 + buildPath : function (ctx, style) { + var pointList = style.pointList; + var rect = this.getRect(style); + var ratio = window.devicePixelRatio || 1; + // console.log(rect) + // var ti = new Date(); + // bbox取整 + rect = { + x : Math.floor(rect.x), + y : Math.floor(rect.y), + width : Math.floor(rect.width), + height : Math.floor(rect.height) + }; + var pixels = ctx.getImageData( + rect.x * ratio, rect.y * ratio, + rect.width * ratio, rect.height * ratio + ); + var data = pixels.data; + var idx; + var zrColor = require('../../zrender/tool/color'); + var color = zrColor.toArray(style.color); + var r = color[0]; + var g = color[1]; + var b = color[2]; + var width = rect.width; + + for (var i = 1, l = pointList.length; i < l; i++) { + idx = ((Math.floor(pointList[i][0]) - rect.x) * ratio + + (Math.floor(pointList[i][1])- rect.y) * width * ratio * ratio + ) * 4; + data[idx] = r; + data[idx + 1] = g; + data[idx + 2] = b; + data[idx + 3] = 255; + } + ctx.putImageData(pixels, rect.x * ratio, rect.y * ratio); + // console.log(new Date() - ti); + return; + }, + */ + + /** + * 返回矩形区域,用于局部刷新和文字定位 + * @param {Object} style + */ + getRect : function (style) { + return style.__rect || polygonInstance.getRect(style); + }, + + isCover : require('./normalIsCover') + }; + + zrUtil.inherits(Symbol, Base); + + return Symbol; +}); diff --git a/amd/util/smartSteps.js b/amd/util/smartSteps.js new file mode 100644 index 0000000..3a0fbff --- /dev/null +++ b/amd/util/smartSteps.js @@ -0,0 +1,544 @@ + +/** + * echarts 值轴分段刻度计算方法 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + * @author xieshiwei (谢世威, i6ma@i6ma.com) + * + */ + + +/** + * 最值、跨度、步长取近似值 + * 注意:不适用于高精度需求,或者很多位有效数字的情况!!! + * @function smartSteps + * @param {Number} min 最小值 + * @param {Number} max 最大值 + * @param {Number} [section] 段数只能是 [0, 99] 的整数,段数为 0 或者不指定段数时,将自动调整段数 + * @param {Object} [opts] 其它扩展参数 + * @param {Array} opts.steps 自定义步长备选值,如 [10, 12, 15, 20, 25, 30, 40, 50, 60, 80] ,但必须 => [10, 99] + * @return {Object} {min: 新最小值, max: 新最大值, secs: 分段数, step: 每段长, fix: 小数保留位数, pnts: [分段结果]} + */ +define(function() { + + + +var mySteps = [10, 20, 25, 50]; +var mySections = [4, 5, 6]; + +var custOpts; +var custSteps; +var custSecs; +var minLocked; +var maxLocked; + +var MT = Math; +var MATH_ROUND = MT.round; +var MATH_FLOOR = MT.floor; +var MATH_CEIL = MT.ceil; +var MATH_ABS = MT.abs; + + +function MATH_LOG(n) {return MT.log(MATH_ABS(n)) / MT.LN10;} +function MATH_POW(n) {return MT.pow(10, n);} +function MATH_ISINT(n) {return n === MATH_FLOOR(n);} + + +function smartSteps(min, max, section, opts) { + // 拿公共变量来接收 opts.steps 这个参数,就不用带着参数层层传递了,注意在函数的最终出口处释放这个值 + custOpts = opts || {}; + custSteps = custOpts.steps || mySteps; + custSecs = custOpts.secs || mySections; + section = MATH_ROUND(+section || 0) % 99; // 段数限定在 [0, 99] ,0 则自适应 + min = +min || 0; + max = +max || 0; + minLocked = maxLocked = 0; + if ('min' in custOpts) { + min = +custOpts.min || 0; + minLocked = 1; + } + if ('max' in custOpts) { + max = +custOpts.max || 0; + maxLocked = 1; + } + if (min > max) {max = [min, min = max][0];} // 最值交换 + var span = max - min; + if (minLocked && maxLocked) { + return bothLocked(min, max, section); // 两个最值同时被锁定,注意差值为 0 的情况 + } + if (span < (section || 5)) { // 跨度值小于要分的段数,步长将会小于 1 + if (MATH_ISINT(min) && MATH_ISINT(max)) { // 步长小于 1 同时两个最值都是整数,特别处理 + return forInteger(min, max, section); // 也要考虑差值为 0 的情况 + } + else if (span === 0) { // 非整数且跨度为 0 的情况 + return forSpan0(min, max, section); + } + } + return coreCalc(min, max, section); // 非特殊情况的计算,须确保 min < max +} + + + +/** + * 构造返回值,处理小数精度等问题 + * @param {Number} newMin 最小值 + * @param {Number} newMax 最大值 + * @param {Number} section 分段数 + * @param {Number} [expon] 计算量级 + * @return {Object} 同 smartSteps + */ +function makeResult(newMin, newMax, section, expon) { + expon = expon || 0; // 这是中间计算量级,受步长增长、特别是最值锁定的影响,可能会小于基准量级,因为整数部分被过度放大 + var expStep = expNum((newMax - newMin) / section, -1); + var expMin = expNum(newMin, -1, 1); // 锁定的最值有效数位可能很多,需要全精度保留 + var expMax = expNum(newMax, -1); + var minExp = MT.min(expStep.e, expMin.e, expMax.e); // 这个值实际上就是各值整数部分尾部多余的 0 的个数 + if (expMin.c === 0) { // 0 可以有任意多个尾0 + minExp = MT.min(expStep.e, expMax.e); + } else if (expMax.c === 0) { + minExp = MT.min(expStep.e, expMin.e); + } + expFixTo(expStep, {c: 0, e: minExp}); + expFixTo(expMin, expStep, 1); + expFixTo(expMax, expStep); + expon += minExp; // 最终的基准量级,在这个量级下,各值刚好能表示成整数 + newMin = expMin.c; + newMax = expMax.c; + var step = (newMax - newMin) / section; + var zoom = MATH_POW(expon); + var fixTo = 0; + var points = []; + for (var i = section + 1; i--;) { // 因为点数比段数多 1 + points[i] = (newMin + step * i) * zoom; // 如果不涉及小数问题,这里就直接使用数值型 + } + if (expon < 0) { + fixTo = decimals(zoom); // 前面已经去掉了各值尾部多余的 0 ,所以 zoom 的小数位就是最终的 fix 位数 + step = +(step * zoom).toFixed(fixTo); // toFixed 处理长尾小数问题,如:0.2 * 0.1 = 0.020000000000000004 + newMin = +(newMin * zoom).toFixed(fixTo); + newMax = +(newMax * zoom).toFixed(fixTo); + for (var i = points.length; i--;) { + points[i] = points[i].toFixed(fixTo); // 为保证小数点对齐,统一转为字符型 + +points[i] === 0 && (points[i] = '0'); // 0.000 不好看 + } + } + else { + newMin *= zoom; + newMax *= zoom; + step *= zoom; + } + custSecs = 0; + custSteps = 0; + custOpts = 0; + // 这些公共变量可能持用了对用户参数的引用,这里是函数的最终出口,释放引用 + + return { + min: newMin, // 新最小值 + max: newMax, // 新最大值 + secs: section, // 分段数 + step: step, // 每段长 + fix: fixTo, // 小数保留位数,0 则为整数 + exp: expon, // 基准量级,并非原值所在的量级,而是说在这个量级下,各值能表示成整数 + pnts: points // 分段结果,整数都是数值型,小数时为了对齐小数点,都是字符型,但其中 0 不带小数点,即没有 "0.000" + }; +} + + + +/** + * 量级计数法 表示数值,不适用于很大或者很小的数,0 更不行 + * @param {Number} num 原数 + * @param {Number} [digit = 2] 精度位数,必须 => [1, 9] + * @param {Boolean} [byFloor = 0] 默认为 0 表示近似值不小于原值,置 1 表示近似值不大于原值 + * @return {Object} {c: c, e: e} c e 都是整数,c * 10 ^ e 即为原值的近似数 + * @description 返回值应该更详细一点:{c: c, e: e, d: d, n: n} ,其中 d 是 c 的位数,n = c * 10 ^ e ,不过目前好像不太有用 + */ +function expNum(num, digit, byFloor) { + digit = MATH_ROUND(digit % 10) || 2; + if (digit < 0) { // 全精度位数 + if (MATH_ISINT(num)) { // 整数的全精度位数,要去掉尾 0 ,但 0 也是整数,要专门留一位精度 + digit = ('' + MATH_ABS(num)).replace(/0+$/, '').length || 1; + } + else { // 小数的全精度位数,要去掉首 0 + num = num.toFixed(15).replace(/0+$/, ''); // toFixed 处理长尾小数 + digit = num.replace('.', '').replace(/^[-0]+/, '').length; + num = +num; // '' + 0.0000001 会得到 '1e-7' + } + } + var expon = MATH_FLOOR(MATH_LOG(num)) - digit + 1; + var cNum = +(num * MATH_POW(-expon)).toFixed(15) || 0; // toFixed 处理长尾小数问题 + cNum = byFloor ? MATH_FLOOR(cNum) : MATH_CEIL(cNum); // 向上取整可能发生进位,使精度位数增加 1 + !cNum && (expon = 0); + if (('' + MATH_ABS(cNum)).length > digit) { // 整数位数判断,字符串法比对数法快近一倍 + expon += 1; + cNum /= 10; + } + return { + c: cNum, + e: expon + }; +} + + +/** + * 将前者的指数对齐到后者,如果前者量级较小,就是强制加大指数,值误差可能严重放大,甚至值变为 0 + */ +function expFixTo(expnum1, expnum2, byFloor) { + var deltaExp = expnum2.e - expnum1.e; + if (deltaExp) { + expnum1.e += deltaExp; // 指数减小时,只需将整数部分相应放大 + expnum1.c *= MATH_POW(-deltaExp); // 指数增加时,整数部分将缩小,就涉及 floor ceil 取整和变 0 问题 + expnum1.c = byFloor ? MATH_FLOOR(expnum1.c) : MATH_CEIL(expnum1.c); + } +} + + +/** + * 将两个量级数的指数对齐到较小者 + */ +function expFixMin(expnum1, expnum2, byFloor) { + if (expnum1.e < expnum2.e) { + expFixTo(expnum2, expnum1, byFloor); + } + else { + expFixTo(expnum1, expnum2, byFloor); + } +} + + +/** + * 基于量级计数法,对原值的整数部分取近似,不适用于负数和 0 + * @param {Number} num 原值 + * @param {Array} [rounds] 在取近似时,提供预置选项,近似到 rounds 中的某项 + * @return {Object} expNum 2 位精度的量级计数法对象,不小于原值 + */ +function getCeil(num, rounds) { + rounds = rounds || mySteps; + num = expNum(num); // 2 位精度量级计数法 + var cNum = num.c; + var i = 0; + while (cNum > rounds[i]) { // 在预置的近似数中,找到不小于目标 cNum 的项 + i++; + } + if (!rounds[i]) { // 如果没找到合适的预置项,一定是目标值大于全部的预置项 + cNum /= 10; // 将目标值缩小 10 倍,重找一次定能命中 + num.e += 1; + i = 0; + while (cNum > rounds[i]) { + i++; + } + } + num.c = rounds[i]; + return num; +} + + + + +/** + * 基于量级计数法的计算,必须 min < max + */ +function coreCalc(min, max, section) { + var step; + var secs = section || +custSecs.slice(-1); + var expStep = getCeil((max - min) / secs, custSteps); // 这是可能的最小步长,以它的量级作为后续计算的基准量级,以保证整数计算特性 + var expSpan = expNum(max - min); // 2 位精度的最值跨度,过高的精度意味着有效数位更多 + var expMin = expNum(min, -1, 1); // 最小值向下近似,以涵盖原最小值 + var expMax = expNum(max, -1); // 最大值向上近似,参数 -1 表示保留全精度,因为要注意 min = 10000001, max = 10000002 等情况 + expFixTo(expSpan, expStep); // 指数对齐 + expFixTo(expMin, expStep, 1); // 经过指数对齐,原最大值、最小值都有可能变为 0 + expFixTo(expMax, expStep); + if (!section) { + secs = look4sections(expMin, expMax); + } + else { + step = look4step(expMin, expMax, secs); + } + + // 如果原最值都是整数,尽量让输出值也保持整数,但原最值跨 0 的则不调整 + if (MATH_ISINT(min) && MATH_ISINT(max) && min * max >= 0) { + if (max - min < secs) { // 再次出现跨度小于段数 + return forInteger(min, max, secs); + } + secs = tryForInt(min, max, section, expMin, expMax, secs); + } + var arrMM = cross0(min, max, expMin.c, expMax.c); + expMin.c = arrMM[0]; + expMax.c = arrMM[1]; + if (minLocked || maxLocked) { + singleLocked(min, max, expMin, expMax); + } + return makeResult(expMin.c, expMax.c, secs, expMax.e); +} + + + +/** + * 在预置的可选段数中,找出一个合适的值,让跨度误差尽量小 + */ +function look4sections(expMin, expMax) { + var section; + var tmpStep, tmpMin, tmpMax; + var reference = []; + for (var i = custSecs.length; i--;) { // 逐步减小段数,步长就会渐大 + section = custSecs[i]; + tmpStep = getCeil((expMax.c - expMin.c) / section, custSteps); + tmpStep = tmpStep.c * MATH_POW(tmpStep.e); // 步长都用常规整数参与计算 + tmpMin = MATH_FLOOR(expMin.c / tmpStep) * tmpStep; + tmpMax = MATH_CEIL(expMax.c / tmpStep) * tmpStep; + reference[i] = { + min: tmpMin, + max: tmpMax, + step: tmpStep, + span: tmpMax - tmpMin // 步长的误差被 段数 成倍放大,可能会给跨度造成更大的误差,使最后的段数大于预置的最大值 + }; + } + reference.sort(function (a, b) { + var delta = a.span - b.span; // 分段调整之后的跨度,一定不小于原跨度,所以越小越好 + if (delta === 0) { + delta = a.step - b.step; // 跨度相同时,步长小者胜出 + } + return delta; + }); + reference = reference[0]; + section = reference.span / reference.step; + expMin.c = reference.min; + expMax.c = reference.max; + return section < 3 ? section * 2 : section; // 如果最终步长比最小步长大得多,段数就可能变得很小 +} + + +/** + * 指定段数,在预置的可选步长中,找出一个合适的值,让 步长 * 段数 积刚好涵盖原最大值与最小值 + */ +function look4step(expMin, expMax, secs) { + var span; + var tmpMax; + var tmpMin = expMax.c; + var tmpStep = (expMax.c - expMin.c) / secs - 1; + while (tmpMin > expMin.c) { + tmpStep = getCeil(tmpStep + 1, custSteps); + tmpStep = tmpStep.c * MATH_POW(tmpStep.e); + span = tmpStep * secs; + tmpMax = MATH_CEIL(expMax.c / tmpStep) * tmpStep; + tmpMin = tmpMax - span; // 优先保证 max 端的误差最小,试看原 min 值能否被覆盖到 + } + var deltaMin = expMin.c - tmpMin; // 上面的计算可能会让 min 端的误差更大,下面尝试均衡误差 + var deltaMax = tmpMax - expMax.c; + var deltaDelta = deltaMin - deltaMax; + if (deltaDelta > tmpStep * 1.1) { // 当 min 端的误差比 max 端大很多时,考虑将 tmpMin tmpMax 同时上移 + deltaDelta = MATH_ROUND(deltaDelta / tmpStep / 2) * tmpStep; + tmpMin += deltaDelta; + tmpMax += deltaDelta; + } + expMin.c = tmpMin; + expMax.c = tmpMax; + return tmpStep; +} + + +/** + * 原最值都是整数时,尝试让输出也保持整数 + */ +function tryForInt(min, max, section, expMin, expMax, secs) { + var span = expMax.c - expMin.c; + var step = span / secs * MATH_POW(expMax.e); + if (!MATH_ISINT(step)) { // 原最值都是整数,但计算步长可能出现小数,如 2.5 + step = MATH_FLOOR(step); // 步长总是要尽量小,以减小跨度误差,所以 2.5 可能被调整为 2 或者 3 + span = step * secs; + if (span < max - min) { + step += 1; + span = step * secs; + if (!section && (step * (secs - 1) >= (max - min))) { + secs -= 1; + span = step * secs; + } + } + if (span >= max - min) { + var delta = span - (max - min); // 误差均衡 + expMin.c = MATH_ROUND(min - delta / 2); + expMax.c = MATH_ROUND(max + delta / 2); + expMin.e = 0; + expMax.e = 0; + } + } + return secs; +} + + + + +/** + * 整数情况下,跨度小于段数的处理 + */ +function forInteger(min, max, section) { + section = section || 5; + if (minLocked) { + max = min + section; // min max 没有写错,因为 min locked 所以 max 在 min 上浮动 + } + else if (maxLocked) { + min = max - section; + } + else { + var delta = section - (max - min); // 没有端点锁定时,向上下延展跨度 + var newMin = MATH_ROUND(min - delta / 2); + var newMax = MATH_ROUND(max + delta / 2); + var arrMM = cross0(min, max, newMin, newMax); // 避免跨 0 + min = arrMM[0]; + max = arrMM[1]; + } + return makeResult(min, max, section); +} + + +/** + * 非整数情况下,跨度为 0 的处理 + */ +function forSpan0(min, max, section) { + section = section || 5; + // delta 一定不为 0 ,因为 min === max === 0 的情况会进入 forInteger 分支 + var delta = MT.min(MATH_ABS(max / section), section) / 2.1; + if (minLocked) { + max = min + delta; // min max 没有写错,因为 min locked 所以 max 在 min 上浮动 + } + else if (maxLocked) { + min = max - delta; + } + else { // 以最值为中心,上下各延展一小段 + min = min - delta; + max = max + delta; + } + return coreCalc(min, max, section); +} + + +/** + * 当原始最值都在 0 的同侧时,让输出也保持在 0 的同侧 + */ +function cross0(min, max, newMin, newMax) { + if (min >= 0 && newMin < 0) { + newMax -= newMin; + newMin = 0; + } + else if (max <= 0 && newMax > 0) { + newMin -= newMax; + newMax = 0; + } + return [newMin, newMax]; +} + + +/** + * 取一个数的小数位数 + * @param {Number} num 原数值 + * @return {Number} decimals 整数则返回 0 ,小数则返回小数点后的位数 + */ +function decimals(num) { + num = (+num).toFixed(15).split('.'); // String(0.0000001) 会得到 '1e-7' + return num.pop().replace(/0+$/, '').length; +} + + + + + + +/** + * 单个最值锁定处理,只是在原计算的基础上,锁定一个,平移另一个 + */ +function singleLocked(min, max, emin, emax) { + if (minLocked) { + var expMin = expNum(min, 4, 1); // 4 位精度向下近似 + if (emin.e - expMin.e > 6) { // 如果锁定值的量级远小于基准量级,认为锁定失败,强置为 0 + expMin = {c: 0, e: emin.e}; + } + expFixMin(emin, expMin); // 将指数与量级较小者对齐 + expFixMin(emax, expMin); + emax.c += expMin.c - emin.c; // 最大值平移 + emin.c = expMin.c; // 最小值锁定 + } + else if (maxLocked) { + var expMax = expNum(max, 4); // 4 位精度向上近似 + if (emax.e - expMax.e > 6) { // 如果锁定值的量级远小于基准量级,认为锁定失败,强置为 0 + expMax = {c: 0, e: emax.e}; + } + expFixMin(emin, expMax); // 将指数与量级较小者对齐 + expFixMin(emax, expMax); + emin.c += expMax.c - emax.c; // 最小值平移 + emax.c = expMax.c; // 最大值锁定 + } +} + + +/** + * 最小值和最大值同时被锁定的情况在这里,其它地方只考虑单边最值锁定 + * @param {Number} min 锁定的最小值 + * @param {Number} max 锁定的最大值 + * @param {Number} [section] 段数 + * @return {Object} 同 smartSteps + */ +function bothLocked(min, max, section) { + var trySecs = section ? [section] : custSecs; + var span = max - min; + if (span === 0) { // 最大最小值都锁定到同一个值上,认为锁定失败 + max = expNum(max, 3); // 3 位精度向上近似 + section = trySecs[0]; + max.c = MATH_ROUND(max.c + section / 2); + return makeResult(max.c - section, max.c, section, max.e); + } + if (MATH_ABS(max / span) < 1e-6) { // 如果锁定值远小于跨度,也认为锁定失败,强置为 0 + max = 0; + } + if (MATH_ABS(min / span) < 1e-6) { + min = 0; + } + var step, deltaSpan, score; + var scoreS = [[5, 10], [10, 2], [50, 10], [100, 2]]; + var reference = []; + var debugLog = []; + var expSpan = expNum((max - min), 3); // 3 位精度向上近似 + var expMin = expNum(min, -1, 1); + var expMax = expNum(max, -1); + expFixTo(expMin, expSpan, 1); + expFixTo(expMax, expSpan); + span = expMax.c - expMin.c; + expSpan.c = span; + + for (var i = trySecs.length; i--;) { + section = trySecs[i]; + step = MATH_CEIL(span / section); + deltaSpan = step * section - span; + score = (deltaSpan + 3) * 3; // 误差越大得分越高 + score += (section - trySecs[0] + 2) * 2; // 分段越多得分越高 + if (section % 5 === 0) { // 段数为 5 可以减分 + score -= 10; + } + for (var j = scoreS.length; j--;) { // 好的步长是最重要的减分项 + if (step % scoreS[j][0] === 0) { + score /= scoreS[j][1]; + } + } + debugLog[i] = [section, step, deltaSpan, score].join(); + reference[i] = { + secs: section, + step: step, + delta: deltaSpan, + score: score + }; + } + //console.log(debugLog); + reference.sort(function (a, b) {return a.score - b.score;}); + reference = reference[0]; + expMin.c = MATH_ROUND(expMin.c - reference.delta / 2); + expMax.c = MATH_ROUND(expMax.c + reference.delta / 2); + return makeResult(expMin.c, expMax.c, reference.secs, expSpan.e); +} + + + + +return smartSteps; +}); + + + diff --git a/amd/zrender/Group.js b/amd/zrender/Group.js new file mode 100644 index 0000000..b52485d --- /dev/null +++ b/amd/zrender/Group.js @@ -0,0 +1,229 @@ +/** + * Group是一个容器,可以插入子节点,Group的变换也会被应用到子节点上 + * @module zrender/Group + * @example + * var Group = require('zrender/Group'); + * var Circle = require('zrender/shape/Circle'); + * var g = new Group(); + * g.position[0] = 100; + * g.position[1] = 100; + * g.addChild(new Circle({ + * style: { + * x: 100, + * y: 100, + * r: 20, + * brushType: 'fill' + * } + * })); + * zr.addGroup(g); + */ +define(function(require) { + + var guid = require('./tool/guid'); + var util = require('./tool/util'); + + var Transformable = require('./mixin/Transformable'); + var Eventful = require('./mixin/Eventful'); + + /** + * @alias module:zrender/Group + * @constructor + * @extends module:zrender/mixin/Transformable + * @extends module:zrender/mixin/Eventful + */ + var Group = function(options) { + + options = options || {}; + + /** + * Group id + * @type {string} + */ + this.id = options.id || guid(); + + for (var key in options) { + this[key] = options[key]; + } + + /** + * @type {string} + */ + this.type = 'group'; + + /** + * 用于裁剪的图形(shape),所有 Group 内的图形在绘制时都会被这个图形裁剪 + * 该图形会继承Group的变换 + * @type {module:zrender/shape/Base} + * @see http://www.w3.org/TR/2dcontext/#clipping-region + */ + this.clipShape = null; + + this._children = []; + + this._storage = null; + + this.__dirty = true; + + // Mixin + Transformable.call(this); + Eventful.call(this); + }; + + /** + * 是否忽略该 Group 及其所有子节点 + * @type {boolean} + * @default false + */ + Group.prototype.ignore = false; + + /** + * 复制并返回一份新的包含所有儿子节点的数组 + * @return {Array.} + */ + Group.prototype.children = function() { + return this._children.slice(); + }; + + /** + * 获取指定 index 的儿子节点 + * @param {number} idx + * @return {module:zrender/Group|module:zrender/shape/Base} + */ + Group.prototype.childAt = function(idx) { + return this._children[idx]; + }; + + /** + * 添加子节点,可以是Shape或者Group + * @param {module:zrender/Group|module:zrender/shape/Base} child + */ + // TODO Type Check + Group.prototype.addChild = function(child) { + if (child == this) { + return; + } + + if (child.parent == this) { + return; + } + if (child.parent) { + child.parent.removeChild(child); + } + + this._children.push(child); + child.parent = this; + + if (this._storage && this._storage !== child._storage) { + + this._storage.addToMap(child); + + if (child instanceof Group) { + child.addChildrenToStorage(this._storage); + } + } + }; + + /** + * 移除子节点 + * @param {module:zrender/Group|module:zrender/shape/Base} child + */ + // TODO Type Check + Group.prototype.removeChild = function(child) { + var idx = util.indexOf(this._children, child); + + this._children.splice(idx, 1); + child.parent = null; + + if (this._storage) { + + this._storage.delFromMap(child.id); + + if (child instanceof Group) { + child.delChildrenFromStorage(this._storage); + } + } + }; + + /** + * 移除所有子节点 + */ + Group.prototype.clearChildren = function () { + for (var i = 0; i < this._children.length; i++) { + var child = this._children[i]; + if (this._storage) { + this._storage.delFromMap(child.id); + if (child instanceof Group) { + child.delChildrenFromStorage(this._storage); + } + } + } + this._children.length = 0; + }; + + /** + * 遍历所有子节点 + * @param {Function} cb + * @param {} context + */ + Group.prototype.eachChild = function(cb, context) { + var haveContext = !!context; + for (var i = 0; i < this._children.length; i++) { + var child = this._children[i]; + if (haveContext) { + cb.call(context, child); + } else { + cb(child); + } + } + }; + + /** + * 深度优先遍历所有子孙节点 + * @param {Function} cb + * @param {} context + */ + Group.prototype.traverse = function(cb, context) { + var haveContext = !!context; + for (var i = 0; i < this._children.length; i++) { + var child = this._children[i]; + if (haveContext) { + cb.call(context, child); + } else { + cb(child); + } + + if (child.type === 'group') { + child.traverse(cb, context); + } + } + }; + + Group.prototype.addChildrenToStorage = function(storage) { + for (var i = 0; i < this._children.length; i++) { + var child = this._children[i]; + storage.addToMap(child); + if (child instanceof Group) { + child.addChildrenToStorage(storage); + } + } + }; + + Group.prototype.delChildrenFromStorage = function(storage) { + for (var i = 0; i < this._children.length; i++) { + var child = this._children[i]; + storage.delFromMap(child.id); + if (child instanceof Group) { + child.delChildrenFromStorage(storage); + } + } + }; + + Group.prototype.modSelf = function() { + this.__dirty = true; + }; + + util.merge(Group.prototype, Transformable.prototype, true); + util.merge(Group.prototype, Eventful.prototype, true); + + return Group; +}); \ No newline at end of file diff --git a/amd/zrender/Handler.js b/amd/zrender/Handler.js index c8aa39a..d9a944e 100644 --- a/amd/zrender/Handler.js +++ b/amd/zrender/Handler.js @@ -1,10 +1,11 @@ /** * Handler控制模块 - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @module zrender/Handler + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * errorrik (errorrik@gmail.com) + * */ - +// TODO mouseover 只触发一次 define( function (require) { @@ -14,10 +15,14 @@ define( var env = require('./tool/env'); var eventTool = require('./tool/event'); var util = require('./tool/util'); + var vec2 = require('./tool/vector'); + var mat2d = require('./tool/matrix'); var EVENT = config.EVENT; + var Eventful = require('./mixin/Eventful'); + var domHandlerNames = [ - 'resize', 'click', + 'resize', 'click', 'dblclick', 'mousewheel', 'mousemove', 'mouseout', 'mouseup', 'mousedown', 'touchstart', 'touchend', 'touchmove' ]; @@ -25,8 +30,8 @@ define( var domHandlers = { /** * 窗口大小改变响应函数 - * - * @param {event} event dom事件对象 + * @inner + * @param {Event} event */ resize: function (event) { event = event || window.event; @@ -39,40 +44,107 @@ define( /** * 点击响应函数 - * - * @param {event} event dom事件对象 + * @inner + * @param {Event} event */ click: function (event) { event = this._zrenderEventFixed(event); - //分发config.EVENT.CLICK事件 + // 分发config.EVENT.CLICK事件 + var _lastHover = this._lastHover; + if ((_lastHover && _lastHover.clickable) + || !_lastHover + ) { + + // 判断没有发生拖拽才触发click事件 + if (this._clickThreshold < 5) { + this._dispatchAgency(_lastHover, EVENT.CLICK, event); + } + } + + this._mousemoveHandler(event); + }, + + /** + * 双击响应函数 + * @inner + * @param {Event} event + */ + dblclick: function (event) { + event = event || window.event; + event = this._zrenderEventFixed(event); + + // 分发config.EVENT.DBLCLICK事件 var _lastHover = this._lastHover; - if (( _lastHover && _lastHover.clickable ) + if ((_lastHover && _lastHover.clickable) || !_lastHover ) { - this._dispatchAgency(_lastHover, EVENT.CLICK, event); + + // 判断没有发生拖拽才触发dblclick事件 + if (this._clickThreshold < 5) { + this._dispatchAgency(_lastHover, EVENT.DBLCLICK, event); + } } this._mousemoveHandler(event); }, + /** * 鼠标滚轮响应函数 - * - * @param {event} event dom事件对象 + * @inner + * @param {Event} event */ mousewheel: function (event) { event = this._zrenderEventFixed(event); - //分发config.EVENT.MOUSEWHEEL事件 + // http://www.sitepoint.com/html5-javascript-mouse-wheel/ + // https://developer.mozilla.org/en-US/docs/DOM/DOM_event_reference/mousewheel + var delta = event.wheelDelta // Webkit + || -event.detail; // Firefox + var scale = delta > 0 ? 1.1 : 1 / 1.1; + + var needsRefresh = false; + + var mouseX = this._mouseX; + var mouseY = this._mouseY; + this.painter.eachBuildinLayer(function (layer) { + var pos = layer.position; + if (layer.zoomable) { + layer.__zoom = layer.__zoom || 1; + var newZoom = layer.__zoom; + newZoom *= scale; + newZoom = Math.max( + Math.min(layer.maxZoom, newZoom), + layer.minZoom + ); + scale = newZoom / layer.__zoom; + layer.__zoom = newZoom; + // Keep the mouse center when scaling + pos[0] -= (mouseX - pos[0]) * (scale - 1); + pos[1] -= (mouseY - pos[1]) * (scale - 1); + layer.scale[0] *= scale; + layer.scale[1] *= scale; + layer.dirty = true; + needsRefresh = true; + + // Prevent browser default scroll action + eventTool.stop(event); + } + }); + if (needsRefresh) { + this.painter.refresh(); + } + + // 分发config.EVENT.MOUSEWHEEL事件 this._dispatchAgency(this._lastHover, EVENT.MOUSEWHEEL, event); this._mousemoveHandler(event); }, /** * 鼠标(手指)移动响应函数 - * - * @param {event} event dom事件对象 + * @inner + * @param {Event} event */ mousemove: function (event) { if (this.painter.isLoading()) { @@ -84,15 +156,18 @@ define( this._lastY = this._mouseY; this._mouseX = eventTool.getX(event); this._mouseY = eventTool.getY(event); + var dx = this._mouseX - this._lastX; + var dy = this._mouseY - this._lastY; // 可能出现config.EVENT.DRAGSTART事件 // 避免手抖点击误认为拖拽 - //if (this._mouseX - this._lastX > 1 || this._mouseY - this._lastY > 1) { - this._processDragStart(event); - //} + // if (this._mouseX - this._lastX > 1 || this._mouseY - this._lastY > 1) { + this._processDragStart(event); + // } this._hasfound = 0; this._event = event; - this.storage.iterShape(this._findHover, { normal: 'down'}); + + this._iterateAndFindHover(); // 找到的在迭代函数里做了处理,没找到得在迭代完后处理 if (!this._hasfound) { @@ -111,18 +186,38 @@ define( this.storage.delHover(); this.painter.clearHover(); } - //如果存在拖拽中元素,被拖拽的图形元素最后addHover + + // set cursor for root element + var cursor = 'default'; + + // 如果存在拖拽中元素,被拖拽的图形元素最后addHover if (this._draggingTarget) { - this.storage.drift( - this._draggingTarget.id, - this._mouseX - this._lastX, - this._mouseY - this._lastY - ); + this.storage.drift(this._draggingTarget.id, dx, dy); + this._draggingTarget.modSelf(); this.storage.addHover(this._draggingTarget); + + // 拖拽不触发click事件 + this._clickThreshold++; + } + else if (this._isMouseDown) { + var needsRefresh = false; + // Layer dragging + this.painter.eachBuildinLayer(function (layer) { + if (layer.panable) { + // PENDING + cursor = 'move'; + // Keep the mouse center when scaling + layer.position[0] += dx; + layer.position[1] += dy; + needsRefresh = true; + layer.dirty = true; + } + }); + if (needsRefresh) { + this.painter.refresh(); + } } - // set cursor for root element - var cursor = 'default'; if (this._draggingTarget || (this._hasfound && this._lastHover.draggable)) { cursor = 'move'; } @@ -141,8 +236,8 @@ define( /** * 鼠标(手指)离开响应函数 - * - * @param {event} event dom事件对象 + * @inner + * @param {Event} event */ mouseout: function (event) { event = this._zrenderEventFixed(event); @@ -177,10 +272,13 @@ define( /** * 鼠标(手指)按下响应函数 - * - * @param {event} event dom事件对象 + * @inner + * @param {Event} event */ mousedown: function (event) { + // 重置 clickThreshold + this._clickThreshold = 0; + if (this._lastDownButton == 2) { this._lastDownButton = event.button; this._mouseDownTarget = null; @@ -192,7 +290,7 @@ define( event = this._zrenderEventFixed(event); this._isMouseDown = 1; - //分发config.EVENT.MOUSEDOWN事件 + // 分发config.EVENT.MOUSEDOWN事件 this._mouseDownTarget = this._lastHover; this._dispatchAgency(this._lastHover, EVENT.MOUSEDOWN, event); this._lastDownButton = event.button; @@ -200,16 +298,16 @@ define( /** * 鼠标(手指)抬起响应函数 - * - * @param {event} event dom事件对象 + * @inner + * @param {Event} event */ - mouseup:function (event) { + mouseup: function (event) { event = this._zrenderEventFixed(event); this.root.style.cursor = 'default'; this._isMouseDown = 0; this._mouseDownTarget = null; - //分发config.EVENT.MOUSEUP事件 + // 分发config.EVENT.MOUSEUP事件 this._dispatchAgency(this._lastHover, EVENT.MOUSEUP, event); this._processDrop(event); this._processDragEnd(event); @@ -217,23 +315,23 @@ define( /** * Touch开始响应函数 - * - * @param {event} event dom事件对象 + * @inner + * @param {Event} event */ touchstart: function (event) { - //eventTool.stop(event);// 阻止浏览器默认事件,重要 + // eventTool.stop(event);// 阻止浏览器默认事件,重要 event = this._zrenderEventFixed(event, true); this._lastTouchMoment = new Date(); - //平板补充一次findHover - this._mobildFindFixed(event); + // 平板补充一次findHover + this._mobileFindFixed(event); this._mousedownHandler(event); }, /** * Touch移动响应函数 - * - * @param {event} event dom事件对象 + * @inner + * @param {Event} event */ touchmove: function (event) { event = this._zrenderEventFixed(event, true); @@ -245,17 +343,25 @@ define( /** * Touch结束响应函数 - * - * @param {event} event dom事件对象 + * @inner + * @param {Event} event */ touchend: function (event) { - //eventTool.stop(event);// 阻止浏览器默认事件,重要 + // eventTool.stop(event);// 阻止浏览器默认事件,重要 event = this._zrenderEventFixed(event, true); this._mouseupHandler(event); - - if (new Date() - this._lastTouchMoment < EVENT.touchClickDelay) { - this._mobildFindFixed(event); + + var now = new Date(); + if (now - this._lastTouchMoment < EVENT.touchClickDelay) { + this._mobileFindFixed(event); this._clickHandler(event); + if (now - this._lastClickMoment < EVENT.touchClickDelay / 2) { + this._dblclickHandler(event); + if (this._lastHover && this._lastHover.clickable) { + eventTool.stop(event);// 阻止浏览器默认事件,重要 + } + } + this._lastClickMoment = now; } this.painter.clearHover(); } @@ -269,38 +375,47 @@ define( * @param {Object} context 运行时this环境 * @return {Function} */ - function bind1Arg( handler, context ) { - return function ( e ) { - return handler.call( context, e ); + function bind1Arg(handler, context) { + return function (e) { + return handler.call(context, e); }; } + /**function bind2Arg(handler, context) { + return function (arg1, arg2) { + return handler.call(context, arg1, arg2); + }; + }*/ + function bind3Arg(handler, context) { + return function (arg1, arg2, arg3) { + return handler.call(context, arg1, arg2, arg3); + }; + } /** * 为控制类实例初始化dom 事件处理函数 * * @inner - * @param {Handler} instance 控制类实例 + * @param {module:zrender/Handler} instance 控制类实例 */ - function initDomHandler( instance ) { + function initDomHandler(instance) { var len = domHandlerNames.length; - while ( len-- ) { - var name = domHandlerNames[ len ]; - instance[ '_' + name + 'Handler' ] = bind1Arg( domHandlers[ name ], instance ); + while (len--) { + var name = domHandlerNames[len]; + instance['_' + name + 'Handler'] = bind1Arg(domHandlers[name], instance); } } /** - * 控制类 (C) - * + * @alias module:zrender/Handler + * @constructor + * @extends module:zrender/mixin/Eventful * @param {HTMLElement} root 绘图区域 - * @param {storage} storage Storage实例 - * @param {painter} painter Painter实例 - * - * 分发事件支持详见config.EVENT + * @param {module:zrender/Storage} storage Storage实例 + * @param {module:zrender/Painter} painter Painter实例 */ - function Handler(root, storage, painter) { + var Handler = function(root, storage, painter) { // 添加事件分发器特性 - eventTool.Dispatcher.call(this); + Eventful.call(this); this.root = root; this.storage = storage; @@ -322,7 +437,7 @@ define( this._mouseX = this._mouseY = 0; - this._findHover = bind1Arg(findHover, this); + this._findHover = bind3Arg(findHover, this); this._domHover = painter.getDomHover(); initDomHandler(this); @@ -339,6 +454,7 @@ define( else { // mobile的click/move/up/down自己模拟 root.addEventListener('click', this._clickHandler); + root.addEventListener('dblclick', this._dblclickHandler); root.addEventListener('mousewheel', this._mousewheelHandler); root.addEventListener('mousemove', this._mousemoveHandler); root.addEventListener('mousedown', this._mousedownHandler); @@ -351,21 +467,24 @@ define( window.attachEvent('onresize', this._resizeHandler); root.attachEvent('onclick', this._clickHandler); + //root.attachEvent('ondblclick ', this._dblclickHandler); + root.ondblclick = this._dblclickHandler; root.attachEvent('onmousewheel', this._mousewheelHandler); root.attachEvent('onmousemove', this._mousemoveHandler); root.attachEvent('onmouseout', this._mouseoutHandler); root.attachEvent('onmousedown', this._mousedownHandler); root.attachEvent('onmouseup', this._mouseupHandler); } - } + }; /** * 自定义事件绑定 * @param {string} eventName 事件名称,resize,hover,drag,etc~ * @param {Function} handler 响应函数 + * @param {Object} [context] 响应函数 */ - Handler.prototype.on = function (eventName, handler) { - this.bind(eventName, handler); + Handler.prototype.on = function (eventName, handler, context) { + this.bind(eventName, handler, context); return this; }; @@ -388,6 +507,7 @@ define( switch (eventName) { case EVENT.RESIZE: case EVENT.CLICK: + case EVENT.DBLCLICK: case EVENT.MOUSEWHEEL: case EVENT.MOUSEMOVE: case EVENT.MOUSEDOWN: @@ -399,7 +519,7 @@ define( }; /** - * 释放 + * 释放,解绑所有事件 */ Handler.prototype.dispose = function () { var root = this.root; @@ -416,6 +536,7 @@ define( else { // mobile的click自己模拟 root.removeEventListener('click', this._clickHandler); + root.removeEventListener('dblclick', this._dblclickHandler); root.removeEventListener('mousewheel', this._mousewheelHandler); root.removeEventListener('mousemove', this._mousemoveHandler); root.removeEventListener('mousedown', this._mousedownHandler); @@ -428,6 +549,7 @@ define( window.detachEvent('onresize', this._resizeHandler); root.detachEvent('onclick', this._clickHandler); + root.detachEvent('dblclick', this._dblclickHandler); root.detachEvent('onmousewheel', this._mousewheelHandler); root.detachEvent('onmousemove', this._mousemoveHandler); root.detachEvent('onmouseout', this._mouseoutHandler); @@ -472,7 +594,7 @@ define( _draggingTarget.invisible = true; this.storage.mod(_draggingTarget.id); - //分发config.EVENT.DRAGSTART事件 + // 分发config.EVENT.DRAGSTART事件 this._dispatchAgency( _draggingTarget, EVENT.DRAGSTART, @@ -490,7 +612,7 @@ define( */ Handler.prototype._processDragEnter = function (event) { if (this._draggingTarget) { - //分发config.EVENT.DRAGENTER事件 + // 分发config.EVENT.DRAGENTER事件 this._dispatchAgency( this._lastHover, EVENT.DRAGENTER, @@ -508,7 +630,7 @@ define( */ Handler.prototype._processDragOver = function (event) { if (this._draggingTarget) { - //分发config.EVENT.DRAGOVER事件 + // 分发config.EVENT.DRAGOVER事件 this._dispatchAgency( this._lastHover, EVENT.DRAGOVER, @@ -526,7 +648,7 @@ define( */ Handler.prototype._processDragLeave = function (event) { if (this._draggingTarget) { - //分发config.EVENT.DRAGLEAVE事件 + // 分发config.EVENT.DRAGLEAVE事件 this._dispatchAgency( this._lastHover, EVENT.DRAGLEAVE, @@ -548,7 +670,7 @@ define( this.storage.mod(this._draggingTarget.id); this.painter.refresh(); - //分发config.EVENT.DROP事件 + // 分发config.EVENT.DROP事件 this._dispatchAgency( this._lastHover, EVENT.DROP, @@ -566,7 +688,7 @@ define( */ Handler.prototype._processDragEnd = function (event) { if (this._draggingTarget) { - //分发config.EVENT.DRAGEND事件 + // 分发config.EVENT.DRAGEND事件 this._dispatchAgency( this._draggingTarget, EVENT.DRAGEND, @@ -587,7 +709,7 @@ define( * @param {Object} event 事件对象 */ Handler.prototype._processOverShape = function (event) { - //分发config.EVENT.MOUSEOVER事件 + // 分发config.EVENT.MOUSEOVER事件 this._dispatchAgency(this._lastHover, EVENT.MOUSEOVER, event); }; @@ -598,7 +720,7 @@ define( * @param {Object} event 事件对象 */ Handler.prototype._processOutShape = function (event) { - //分发config.EVENT.MOUSEOUT事件 + // 分发config.EVENT.MOUSEOUT事件 this._dispatchAgency(this._lastHover, EVENT.MOUSEOUT, event); }; @@ -627,7 +749,8 @@ define( } while (el) { - el[eventHandler] && el[eventHandler](eventPacket); + el[eventHandler] + && (eventPacket.cancelBubble = el[eventHandler](eventPacket)); el.dispatch(eventName, eventPacket); el = el.parent; @@ -644,35 +767,80 @@ define( } } else if (!draggedShape) { - //无hover目标,无拖拽对象,原生事件分发 - this.dispatch(eventName, { + // 无hover目标,无拖拽对象,原生事件分发 + var eveObj = { type: eventName, event: event + }; + this.dispatch(eventName, eveObj); + // 分发事件到用户自定义层 + this.painter.eachOtherLayer(function (layer) { + if (typeof(layer[eventHandler]) == 'function') { + layer[eventHandler](eveObj); + } + if (layer.dispatch) { + layer.dispatch(eventName, eveObj); + } }); } }; + + /** + * 迭代寻找hover shape + * @private + * @method + */ + Handler.prototype._iterateAndFindHover = (function() { + var invTransform = mat2d.create(); + return function() { + var list = this.storage.getShapeList(); + var currentZLevel; + var currentLayer; + var tmp = [ 0, 0 ]; + for (var i = list.length - 1; i >= 0 ; i--) { + var shape = list[i]; + + if (currentZLevel !== shape.zlevel) { + currentLayer = this.painter.getLayer(shape.zlevel, currentLayer); + tmp[0] = this._mouseX; + tmp[1] = this._mouseY; + + if (currentLayer.needTransform) { + mat2d.invert(invTransform, currentLayer.transform); + vec2.applyTransform(tmp, tmp, invTransform); + } + } + + if (this._findHover(shape, tmp[0], tmp[1])) { + break; + } + } + }; + })(); // touch指尖错觉的尝试偏移量配置 var MOBILE_TOUCH_OFFSETS = [ { x: 10 }, { x: -20 }, - { x: 10, y: 10}, - { y: -20} + { x: 10, y: 10 }, + { y: -20 } ]; // touch有指尖错觉,四向尝试,让touch上的点击更好触发事件 - Handler.prototype._mobildFindFixed = function (event) { + Handler.prototype._mobileFindFixed = function (event) { this._lastHover = null; this._mouseX = event.zrenderX; this._mouseY = event.zrenderY; this._event = event; - this.storage.iterShape(this._findHover, { normal: 'down'}); - for ( var i = 0; !this._lastHover && i < MOBILE_TOUCH_OFFSETS.length ; i++ ) { + + this._iterateAndFindHover(); + for (var i = 0; !this._lastHover && i < MOBILE_TOUCH_OFFSETS.length ; i++) { var offset = MOBILE_TOUCH_OFFSETS[ i ]; - offset.x && ( this._mouseX += offset.x ); - offset.y && ( this._mouseX += offset.y ); - this.storage.iterShape(this._findHover, { normal: 'down'}); + offset.x && (this._mouseX += offset.x); + offset.y && (this._mouseY += offset.y); + + this._iterateAndFindHover(); } if (this._lastHover) { @@ -684,19 +852,21 @@ define( /** * 迭代函数,查找hover到的图形元素并即时做些事件分发 * - * @private - * @param {Object} e 图形元素 + * @inner + * @param {Object} shape 图形元素 + * @param {number} x + * @param {number} y */ - function findHover(shape) { + function findHover(shape, x, y) { if ( - ( this._draggingTarget && this._draggingTarget.id == shape.id ) //迭代到当前拖拽的图形上 + (this._draggingTarget && this._draggingTarget.id == shape.id) // 迭代到当前拖拽的图形上 || shape.isSilent() // 打酱油的路过,啥都不响应的shape~ ) { return false; } var event = this._event; - if (shape.isCover(this._mouseX, this._mouseY)) { + if (shape.isCover(x, y)) { if (shape.hoverable) { this.storage.addHover(shape); } @@ -713,23 +883,23 @@ define( if (this._lastHover != shape) { this._processOutShape(event); - //可能出现config.EVENT.DRAGLEAVE事件 + // 可能出现config.EVENT.DRAGLEAVE事件 this._processDragLeave(event); this._lastHover = shape; - //可能出现config.EVENT.DRAGENTER事件 + // 可能出现config.EVENT.DRAGENTER事件 this._processDragEnter(event); } this._processOverShape(event); - //可能出现config.EVENT.DRAGOVER + // 可能出现config.EVENT.DRAGOVER this._processDragOver(event); this._hasfound = 1; - return true; //找到则中断迭代查找 + return true; // 找到则中断迭代查找 } return false; @@ -741,7 +911,7 @@ define( * @private */ Handler.prototype._zrenderEventFixed = function (event, isTouch) { - if ( event.zrenderFixed ) { + if (event.zrenderFixed) { return event; } @@ -769,7 +939,7 @@ define( ? event.targetTouches[0] : event.changedTouches[0]; if (touch) { - var rBounding = this.root.getBoundingClientRect(); + var rBounding = this.painter._domRoot.getBoundingClientRect(); // touch事件坐标是全屏的~ event.zrenderX = touch.clientX - rBounding.left; event.zrenderY = touch.clientY - rBounding.top; @@ -780,7 +950,7 @@ define( return event; }; - util.merge(Handler.prototype, eventTool.Dispatcher.prototype, true); + util.merge(Handler.prototype, Eventful.prototype, true); return Handler; } diff --git a/amd/zrender/Layer.js b/amd/zrender/Layer.js new file mode 100644 index 0000000..1196321 --- /dev/null +++ b/amd/zrender/Layer.js @@ -0,0 +1,212 @@ +/** + * @module zrender/Layer + * @author pissang(https://www.github.com/pissang) + */ +define(function (require) { + + var Transformable = require('./mixin/Transformable'); + var util = require('./tool/util'); + var vmlCanvasManager = window['G_vmlCanvasManager']; + var config = require('./config'); + + function returnFalse() { + return false; + } + + /** + * 创建dom + * + * @inner + * @param {string} id dom id 待用 + * @param {string} type dom type,such as canvas, div etc. + * @param {Painter} painter painter instance + */ + function createDom(id, type, painter) { + var newDom = document.createElement(type); + var width = painter.getWidth(); + var height = painter.getHeight(); + + // 没append呢,请原谅我这样写,清晰~ + newDom.style.position = 'absolute'; + newDom.style.left = 0; + newDom.style.top = 0; + newDom.style.width = width + 'px'; + newDom.style.height = height + 'px'; + newDom.width = width * config.devicePixelRatio; + newDom.height = height * config.devicePixelRatio; + + // id不作为索引用,避免可能造成的重名,定义为私有属性 + newDom.setAttribute('data-zr-dom-id', id); + return newDom; + } + + /** + * @alias module:zrender/Layer + * @constructor + * @extends module:zrender/mixin/Transformable + * @param {string} id + * @param {module:zrender/Painter} painter + */ + var Layer = function(id, painter) { + + this.id = id; + + this.dom = createDom(id, 'canvas', painter); + this.dom.onselectstart = returnFalse; // 避免页面选中的尴尬 + this.dom.style['-webkit-user-select'] = 'none'; + this.dom.style['user-select'] = 'none'; + this.dom.style['-webkit-touch-callout'] = 'none'; + this.dom.style['-webkit-tap-highlight-color'] = 'rgba(0,0,0,0)'; + + vmlCanvasManager && vmlCanvasManager.initElement(this.dom); + + this.domBack = null; + this.ctxBack = null; + + this.painter = painter; + + this.unusedCount = 0; + + this.config = null; + + this.dirty = true; + + this.elCount = 0; + + // Configs + /** + * 每次清空画布的颜色 + * @type {string} + * @default 0 + */ + this.clearColor = 0; + /** + * 是否开启动态模糊 + * @type {boolean} + * @default false + */ + this.motionBlur = false; + /** + * 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显 + * @type {number} + * @default 0.7 + */ + this.lastFrameAlpha = 0.7; + /** + * 层是否支持鼠标平移操作 + * @type {boolean} + * @default false + */ + this.zoomable = false; + /** + * 层是否支持鼠标缩放操作 + * @type {boolean} + * @default false + */ + this.panable = false; + + this.maxZoom = Infinity; + this.minZoom = 0; + + Transformable.call(this); + }; + + Layer.prototype.initContext = function () { + this.ctx = this.dom.getContext('2d'); + + var dpr = config.devicePixelRatio; + if (dpr != 1) { + this.ctx.scale(dpr, dpr); + } + }; + + Layer.prototype.createBackBuffer = function () { + if (vmlCanvasManager) { // IE 8- should not support back buffer + return; + } + this.domBack = createDom('back-' + this.id, 'canvas', this.painter); + this.ctxBack = this.domBack.getContext('2d'); + + var dpr = config.devicePixelRatio; + + if (dpr != 1) { + this.ctxBack.scale(dpr, dpr); + } + }; + + /** + * @param {number} width + * @param {number} height + */ + Layer.prototype.resize = function (width, height) { + var dpr = config.devicePixelRatio; + + this.dom.style.width = width + 'px'; + this.dom.style.height = height + 'px'; + + this.dom.setAttribute('width', width * dpr); + this.dom.setAttribute('height', height * dpr); + + if (dpr != 1) { + this.ctx.scale(dpr, dpr); + } + + if (this.domBack) { + this.domBack.setAttribute('width', width * dpr); + this.domBack.setAttribute('height', height * dpr); + + if (dpr != 1) { + this.ctxBack.scale(dpr, dpr); + } + } + }; + + /** + * 清空该层画布 + */ + Layer.prototype.clear = function () { + var dom = this.dom; + var ctx = this.ctx; + var width = dom.width; + var height = dom.height; + + var haveClearColor = this.clearColor && !vmlCanvasManager; + var haveMotionBLur = this.motionBlur && !vmlCanvasManager; + var lastFrameAlpha = this.lastFrameAlpha; + + var dpr = config.devicePixelRatio; + + if (haveMotionBLur) { + if (!this.domBack) { + this.createBackBuffer(); + } + + this.ctxBack.globalCompositeOperation = 'copy'; + this.ctxBack.drawImage( + dom, 0, 0, + width / dpr, + height / dpr + ); + } + + ctx.clearRect(0, 0, width / dpr, height / dpr); + if (haveClearColor) { + ctx.save(); + ctx.fillStyle = this.clearColor; + ctx.fillRect(0, 0, width / dpr, height / dpr); + ctx.restore(); + } + + if (haveMotionBLur) { + var domBack = this.domBack; + ctx.save(); + ctx.globalAlpha = lastFrameAlpha; + ctx.drawImage(domBack, 0, 0, width / dpr, height / dpr); + ctx.restore(); + } + }; + + util.merge(Layer.prototype, Transformable.prototype); + + return Layer; +}); \ No newline at end of file diff --git a/amd/zrender/Painter.js b/amd/zrender/Painter.js index 28a0d75..7669dbd 100644 --- a/amd/zrender/Painter.js +++ b/amd/zrender/Painter.js @@ -1,52 +1,69 @@ /** * Painter绘图模块 - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @module zrender/Painter + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * errorrik (errorrik@gmail.com) + * pissang (https://www.github.com/pissang) */ - - - -define( + define( function (require) { - 'use strict'; var config = require('./config'); var util = require('./tool/util'); + // var vec2 = require('./tool/vector'); var log = require('./tool/log'); - var matrix = require('./tool/matrix'); + // var matrix = require('./tool/matrix'); var BaseLoadingEffect = require('./loadingEffect/Base'); - // retina 屏幕优化 - var devicePixelRatio = window.devicePixelRatio || 1; - devicePixelRatio = Math.max(devicePixelRatio, 1); - var vmlCanvasManager = window.G_vmlCanvasManager; + var Layer = require('./Layer'); - /** - * 返回false的方法,用于避免页面被选中 - * - * @inner - */ + // 返回false的方法,用于避免页面被选中 function returnFalse() { return false; } - /** - * 什么都不干的空方法 - * - * @inner - */ + // 什么都不干的空方法 function doNothing() {} + function isLayerValid(layer) { + if (!layer) { + return false; + } + + if (layer.isBuildin) { + return true; + } + + if (typeof(layer.resize) !== 'function' + || typeof(layer.refresh) !== 'function' + ) { + return false; + } + + return true; + } + /** - * 绘图类 (V) - * - * @param {HTMLElement} root 绘图区域 - * @param {storage} storage Storage实例 + * @alias module:zrender/Painter + * @constructor + * @param {HTMLElement} root 绘图容器 + * @param {module:zrender/Storage} storage */ - function Painter(root, storage) { + var Painter = function (root, storage) { + /** + * 绘图容器 + * @type {HTMLElement} + */ this.root = root; + root.style['-webkit-tap-highlight-color'] = 'transparent'; + root.style['-webkit-user-select'] = 'none'; + root.style['user-select'] = 'none'; + root.style['-webkit-touch-callout'] = 'none'; + + /** + * @type {module:zrender/Storage} + */ this.storage = storage; root.innerHTML = ''; @@ -56,7 +73,7 @@ define( var domRoot = document.createElement('div'); this._domRoot = domRoot; - //domRoot.onselectstart = returnFalse; // 避免页面选中的尴尬 + // domRoot.onselectstart = returnFalse; // 避免页面选中的尴尬 domRoot.style.position = 'relative'; domRoot.style.overflow = 'hidden'; domRoot.style.width = this._width + 'px'; @@ -65,6 +82,8 @@ define( this._layers = {}; + this._zlevelList = []; + this._layerConfig = {}; this._loadingEffect = new BaseLoadingEffect({}); @@ -72,8 +91,17 @@ define( // 创建各层canvas // 背景 - this._bgDom = createDom('bg', 'div', this); + this._bgDom = document.createElement('div'); + this._bgDom.style.cssText = [ + 'position:absolute;left:0px;top:0px;width:', + this._width, 'px;height:', this._height + 'px;', + '-webkit-user-select:none;user-select;none;', + '-webkit-touch-callout:none;' + ].join(''); + this._bgDom.setAttribute('data-zr-dom-id', 'bg'); + domRoot.appendChild(this._bgDom); + this._bgDom.onselectstart = returnFalse; // 高亮 var hoverLayer = new Layer('_zrender_hover_', this); @@ -81,18 +109,19 @@ define( domRoot.appendChild(hoverLayer.dom); hoverLayer.initContext(); - hoverLayer.onselectstart = returnFalse; + hoverLayer.dom.onselectstart = returnFalse; + hoverLayer.dom.style['-webkit-user-select'] = 'none'; + hoverLayer.dom.style['user-select'] = 'none'; + hoverLayer.dom.style['-webkit-touch-callout'] = 'none'; - var me = this; - this.updatePainter = function(shapeList, callback) { - me.update(shapeList, callback); - }; - } + // Will be injected by zrender instance + this.refreshNextFrame = null; + }; /** * 首次绘图,创建各种dom和context * - * @param {Function=} callback 绘画结束后的回调函数 + * @param {Function} callback 绘画结束后的回调函数 */ Painter.prototype.render = function (callback) { if (this.isLoading()) { @@ -106,14 +135,22 @@ define( /** * 刷新 - * - * @param {Function=} callback 刷新结束后的回调函数 - * @param {Boolean} paintAll 强制绘制所有shape + * @param {Function} callback 刷新结束后的回调函数 + * @param {boolean} paintAll 强制绘制所有shape */ Painter.prototype.refresh = function (callback, paintAll) { var list = this.storage.getShapeList(true); this._paintList(list, paintAll); + // Paint custum layers + for (var i = 0; i < this._zlevelList.length; i++) { + var z = this._zlevelList[i]; + var layer = this._layers[z]; + if (! layer.isBuildin && layer.refresh) { + layer.refresh(); + } + } + if (typeof callback == 'function') { callback(); } @@ -121,7 +158,24 @@ define( return this; }; - Painter.prototype._paintList = function(list, paintAll) { + Painter.prototype._preProcessLayer = function (layer) { + layer.unusedCount++; + layer.updateTransform(); + }; + + Painter.prototype._postProcessLayer = function (layer) { + layer.dirty = false; + // 删除过期的层 + // PENDING + // if (layer.unusedCount >= 500) { + // this.delLayer(z); + // } + if (layer.unusedCount == 1) { + layer.clear(); + } + }; + + Painter.prototype._paintList = function (list, paintAll) { if (typeof(paintAll) == 'undefined') { paintAll = false; @@ -133,21 +187,33 @@ define( var currentZLevel; var ctx; - for (var id in this._layers) { - if (id !== 'hover') { - this._layers[id].unusedCount++; - } - } + this.eachBuildinLayer(this._preProcessLayer); - var invTransform = []; + // var invTransform = []; for (var i = 0, l = list.length; i < l; i++) { var shape = list[i]; + // Change draw layer if (currentZLevel !== shape.zlevel) { - currentLayer = this.getLayer(shape.zlevel, currentLayer); - ctx = currentLayer.ctx; + if (currentLayer) { + if (currentLayer.needTransform) { + ctx.restore(); + } + ctx.flush && ctx.flush(); + } + currentZLevel = shape.zlevel; + currentLayer = this.getLayer(currentZLevel); + + if (!currentLayer.isBuildin) { + log( + 'ZLevel ' + currentZLevel + + ' has been used by unkown layer ' + currentLayer.id + ); + } + + ctx = currentLayer.ctx; // Reset the count currentLayer.unusedCount = 0; @@ -155,35 +221,10 @@ define( if (currentLayer.dirty || paintAll) { currentLayer.clear(); } - } - - // Start group clipping - if (shape.__startClip && !vmlCanvasManager) { - var clipShape = shape.__startClip; - ctx.save(); - // Set transform - if (clipShape.needTransform) { - var m = clipShape.transform; - matrix.invert(invTransform, m); - ctx.transform( - m[0], m[1], - m[2], m[3], - m[4], m[5] - ); - } - ctx.beginPath(); - clipShape.buildPath(ctx, clipShape.style); - ctx.clip(); - - // Transform back - if (clipShape.needTransform) { - var m = invTransform; - ctx.transform( - m[0], m[1], - m[2], m[3], - m[4], m[5] - ); + if (currentLayer.needTransform) { + ctx.save(); + currentLayer.setTransform(ctx); } } @@ -194,83 +235,152 @@ define( ) { if (config.catchBrushException) { try { - shape.brush(ctx, false, this.updatePainter); + shape.brush(ctx, false, this.refreshNextFrame); } - catch(error) { + catch (error) { log( error, 'brush error of ' + shape.type, shape ); } - } else { - shape.brush(ctx, false, this.updatePainter); + } + else { + shape.brush(ctx, false, this.refreshNextFrame); } } } - // Stop group clipping - if (shape.__stopClip && !vmlCanvasManager) { + shape.__dirty = false; + } + + if (currentLayer) { + if (currentLayer.needTransform) { ctx.restore(); } + ctx.flush && ctx.flush(); + } - shape.__dirty = false; + this.eachBuildinLayer(this._postProcessLayer); + }; + + /** + * 获取 zlevel 所在层,如果不存在则会创建一个新的层 + * @param {number} zlevel + * @return {module:zrender/Layer} + */ + Painter.prototype.getLayer = function (zlevel) { + var layer = this._layers[zlevel]; + if (!layer) { + // Create a new layer + layer = new Layer(zlevel, this); + layer.isBuildin = true; + + if (this._layerConfig[zlevel]) { + util.merge(layer, this._layerConfig[zlevel], true); + } + + layer.updateTransform(); + + this.insertLayer(zlevel, layer); + + // Context is created after dom inserted to document + // Or excanvas will get 0px clientWidth and clientHeight + layer.initContext(); } - for (var id in this._layers) { - if (id !== 'hover') { - var layer = this._layers[id]; - layer.dirty = false; - // 删除过期的层 - if (layer.unusedCount >= 500) { - delete this._layers[id]; - layer.dom.parentNode.removeChild(layer.dom); - } - else if (layer.unusedCount == 1) { - layer.clear(); + return layer; + }; + + Painter.prototype.insertLayer = function (zlevel, layer) { + if (this._layers[zlevel]) { + log('ZLevel ' + zlevel + ' has been used already'); + return; + } + // Check if is a valid layer + if (!isLayerValid(layer)) { + log('Layer of zlevel ' + zlevel + ' is not valid'); + return; + } + + var len = this._zlevelList.length; + var prevLayer = null; + var i = -1; + if (len > 0 && zlevel > this._zlevelList[0]) { + for (i = 0; i < len - 1; i++) { + if ( + this._zlevelList[i] < zlevel + && this._zlevelList[i + 1] > zlevel + ) { + break; } } + prevLayer = this._layers[this._zlevelList[i]]; + } + this._zlevelList.splice(i + 1, 0, zlevel); + + var prevDom = prevLayer ? prevLayer.dom : this._bgDom; + if (prevDom.nextSibling) { + prevDom.parentNode.insertBefore( + layer.dom, + prevDom.nextSibling + ); } + else { + prevDom.parentNode.appendChild(layer.dom); + } + + this._layers[zlevel] = layer; }; - Painter.prototype.getLayer = function(zlevel, prevLayer) { - // Change draw layer - var currentLayer = this._layers[zlevel]; - if (!currentLayer) { - // Create a new layer - currentLayer = new Layer(zlevel, this); - var prevDom = prevLayer ? prevLayer.dom : this._bgDom; - if (prevDom.nextSibling) { - prevDom.parentNode.insertBefore( - currentLayer.dom, - prevDom.nextSibling - ); - } else { - prevDom.parentNode.appendChild( - currentLayer.dom - ); + // Iterate each layer + Painter.prototype.eachLayer = function (cb, context) { + for (var i = 0; i < this._zlevelList.length; i++) { + var z = this._zlevelList[i]; + cb.call(context, this._layers[z], z); + } + }; + + // Iterate each buildin layer + Painter.prototype.eachBuildinLayer = function (cb, context) { + for (var i = 0; i < this._zlevelList.length; i++) { + var z = this._zlevelList[i]; + var layer = this._layers[z]; + if (layer.isBuildin) { + cb.call(context, layer, z); } - currentLayer.initContext(); - - this._layers[zlevel] = currentLayer; + } + }; - currentLayer.config = this._layerConfig[zlevel]; + // Iterate each other layer except buildin layer + Painter.prototype.eachOtherLayer = function (cb, context) { + for (var i = 0; i < this._zlevelList.length; i++) { + var z = this._zlevelList[i]; + var layer = this._layers[z]; + if (! layer.isBuildin) { + cb.call(context, layer, z); + } } + }; - return currentLayer; + /** + * 获取所有已创建的层 + * @param {Array.} [prevLayer] + */ + Painter.prototype.getLayers = function () { + return this._layers; }; - Painter.prototype._updateLayerStatus = function(list) { + Painter.prototype._updateLayerStatus = function (list) { var layers = this._layers; var elCounts = {}; - for (var z in layers) { - if (z !== 'hover') { - elCounts[z] = layers[z].elCount; - layers[z].elCount = 0; - } - } + + this.eachBuildinLayer(function (layer, z) { + elCounts[z] = layer.elCount; + layer.elCount = 0; + }); for (var i = 0, l = list.length; i < l; i++) { var shape = list[i]; @@ -287,25 +397,22 @@ define( } // 层中的元素数量有发生变化 - for (var z in layers) { - if (z !== 'hover') { - if (elCounts[z] !== layers[z].elCount) { - layers[z].dirty = true; - } + this.eachBuildinLayer(function (layer, z) { + if (elCounts[z] !== layer.elCount) { + layer.dirty = true; } - } + }); }; /** - * 视图更新 - * - * @param {Array} shapeList 需要更新的图形元素列表 - * @param {Function} callback 视图更新后回调函数 + * 指定的图形列表 + * @param {Array.} shapeList 需要更新的图形元素列表 + * @param {Function} [callback] 视图更新后回调函数 */ - Painter.prototype.update = function (shapeList, callback) { + Painter.prototype.refreshShapes = function (shapeList, callback) { for (var i = 0, l = shapeList.length; i < l; i++) { var shape = shapeList[i]; - this.storage.mod(shape.id); + shape.modSelf(); } this.refresh(callback); @@ -327,35 +434,67 @@ define( * 清除hover层外所有内容 */ Painter.prototype.clear = function () { - for (var k in this._layers) { - if (k == 'hover') { - continue; - } - this._layers[k].clear(); - } - + this.eachBuildinLayer(this._clearLayer); return this; }; + Painter.prototype._clearLayer = function (layer) { + layer.clear(); + }; + /** * 修改指定zlevel的绘制参数 + * + * @param {string} zlevel + * @param {Object} config 配置对象 + * @param {string} [config.clearColor=0] 每次清空画布的颜色 + * @param {string} [config.motionBlur=false] 是否开启动态模糊 + * @param {number} [config.lastFrameAlpha=0.7] + * 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显 + * @param {Array.} [position] 层的平移 + * @param {Array.} [rotation] 层的旋转 + * @param {Array.} [scale] 层的缩放 + * @param {boolean} [zoomable=false] 层是否支持鼠标缩放操作 + * @param {boolean} [panable=false] 层是否支持鼠标平移操作 */ Painter.prototype.modLayer = function (zlevel, config) { if (config) { if (!this._layerConfig[zlevel]) { this._layerConfig[zlevel] = config; - } else { + } + else { util.merge(this._layerConfig[zlevel], config, true); } var layer = this._layers[zlevel]; if (layer) { - layer.config = this._layerConfig[zlevel]; + util.merge(layer, this._layerConfig[zlevel], true); } } }; + /** + * 删除指定层 + * @param {number} zlevel 层所在的zlevel + */ + Painter.prototype.delLayer = function (zlevel) { + var layer = this._layers[zlevel]; + if (!layer) { + return; + } + // Save config + this.modLayer(zlevel, { + position: layer.position, + rotation: layer.rotation, + scale: layer.scale + }); + layer.dom.parentNode.removeChild(layer.dom); + delete this._layers[zlevel]; + + this._zlevelList.splice(util.indexOf(this._zlevelList, zlevel), 1); + }; + /** * 刷新hover层 */ @@ -365,6 +504,9 @@ define( for (var i = 0, l = list.length; i < l; i++) { this._brushHover(list[i]); } + var ctx = this._layers.hover.ctx; + ctx.flush && ctx.flush(); + this.storage.delHover(); return this; @@ -425,7 +567,7 @@ define( domRoot.style.display = ''; // 优化没有实际改变的resize - if (this._width != width || height != this._height){ + if (this._width != width || height != this._height) { this._width = width; this._height = height; @@ -445,9 +587,10 @@ define( /** * 清除单独的一个层 + * @param {number} zLevel */ - Painter.prototype.clearLayer = function (k) { - var layer = this._layers[k]; + Painter.prototype.clearLayer = function (zLevel) { + var layer = this._layers[zLevel]; if (layer) { layer.clear(); } @@ -474,39 +617,40 @@ define( return this._layers.hover.dom; }; + /** + * 图像导出 + * @param {string} type + * @param {string} [backgroundColor='#fff'] 背景色 + * @return {string} 图片的Base64 url + */ Painter.prototype.toDataURL = function (type, backgroundColor, args) { - if (vmlCanvasManager) { + if (window['G_vmlCanvasManager']) { return null; } - var imageDom = createDom('image', 'canvas', this); - this._bgDom.appendChild(imageDom); - var ctx = imageDom.getContext('2d'); - devicePixelRatio != 1 - && ctx.scale(devicePixelRatio, devicePixelRatio); - - ctx.fillStyle = backgroundColor || '#fff'; - ctx.rect( - 0, 0, - this._width * devicePixelRatio, - this._height * devicePixelRatio - ); - ctx.fill(); + var imageLayer = new Layer('image', this); + this._bgDom.appendChild(imageLayer.dom); + imageLayer.initContext(); - //升序遍历,shape上的zlevel指定绘画图层的z轴层叠 + var ctx = imageLayer.ctx; + imageLayer.clearColor = backgroundColor || '#fff'; + imageLayer.clear(); + var self = this; + // 升序遍历,shape上的zlevel指定绘画图层的z轴层叠 + this.storage.iterShape( function (shape) { if (!shape.invisible) { - if (!shape.onbrush //没有onbrush - //有onbrush并且调用执行返回false或undefined则继续粉刷 + if (!shape.onbrush // 没有onbrush + // 有onbrush并且调用执行返回false或undefined则继续粉刷 || (shape.onbrush && !shape.onbrush(ctx, false)) ) { if (config.catchBrushException) { try { - shape.brush(ctx, false, this.updatePainter); + shape.brush(ctx, false, self.refreshNextFrame); } - catch(error) { + catch (error) { log( error, 'brush error of ' + shape.type, @@ -515,16 +659,16 @@ define( } } else { - shape.brush(ctx, false, this.updatePainter); + shape.brush(ctx, false, self.refreshNextFrame); } } } }, { normal: 'up', update: true } ); - var image = imageDom.toDataURL(type, args); + var image = imageLayer.dom.toDataURL(type, args); ctx = null; - this._bgDom.removeChild(imageDom); + this._bgDom.removeChild(imageLayer.dom); return image; }; @@ -542,7 +686,7 @@ define( return this._height; }; - Painter.prototype._getWidth = function() { + Painter.prototype._getWidth = function () { var root = this.root; var stl = root.currentStyle || document.defaultView.getComputedStyle(root); @@ -562,29 +706,34 @@ define( - parseInt(stl.paddingBottom, 10)).toFixed(0) - 0; }; - /** - * 鼠标悬浮刷画 - */ Painter.prototype._brushHover = function (shape) { var ctx = this._layers.hover.ctx; - if (!shape.onbrush //没有onbrush - //有onbrush并且调用执行返回false或undefined则继续粉刷 + if (!shape.onbrush // 没有onbrush + // 有onbrush并且调用执行返回false或undefined则继续粉刷 || (shape.onbrush && !shape.onbrush(ctx, true)) ) { + var layer = this.getLayer(shape.zlevel); + if (layer.needTransform) { + ctx.save(); + layer.setTransform(ctx); + } // Retina 优化 if (config.catchBrushException) { try { - shape.brush(ctx, true, this.updatePainter); + shape.brush(ctx, true, this.refreshNextFrame); } - catch(error) { + catch (error) { log( error, 'hoverBrush error of ' + shape.type, shape ); } } else { - shape.brush(ctx, true, this.updatePainter); + shape.brush(ctx, true, this.refreshNextFrame); + } + if (layer.needTransform) { + ctx.restore(); } } }; @@ -594,7 +743,6 @@ define( ) { var canvas = document.createElement('canvas'); var ctx = canvas.getContext('2d'); - var devicePixelRatio = window.devicePixelRatio || 1; canvas.style.width = width + 'px'; canvas.style.height = height + 'px'; @@ -608,14 +756,14 @@ define( rotation : shape.rotation, scale : shape.scale }; - shape.position = [0, 0, 0]; + shape.position = [ 0, 0, 0 ]; shape.rotation = 0; - shape.scale = [1, 1]; + shape.scale = [ 1, 1 ]; if (shape) { shape.brush(ctx, false); } - var ImageShape = require( './shape/Image' ); + var ImageShape = require('./shape/Image'); var imgShape = new ImageShape({ id : id, style : { @@ -641,176 +789,19 @@ define( }; Painter.prototype._createShapeToImageProcessor = function () { - if (vmlCanvasManager) { + if (window['G_vmlCanvasManager']) { return doNothing; } - var painter = this; + var me = this; return function (id, e, width, height) { - return painter._shapeToImage( - id, e, width, height, devicePixelRatio + return me._shapeToImage( + id, e, width, height, config.devicePixelRatio ); }; }; - /** - * 创建dom - * - * @inner - * @param {string} id dom id 待用 - * @param {string} type dom type,such as canvas, div etc. - * @param {Painter} painter painter instance - */ - function createDom(id, type, painter) { - var newDom = document.createElement(type); - var width = painter._width; - var height = painter._height; - - // 没append呢,请原谅我这样写,清晰~ - newDom.style.position = 'absolute'; - newDom.style.left = 0; - newDom.style.top = 0; - newDom.style.width = width + 'px'; - newDom.style.height = height + 'px'; - newDom.setAttribute('width', width * devicePixelRatio); - newDom.setAttribute('height', height * devicePixelRatio); - - // id不作为索引用,避免可能造成的重名,定义为私有属性 - newDom.setAttribute('data-zr-dom-id', id); - return newDom; - } - - /***************************************** - * Layer - *****************************************/ - function Layer(id, painter) { - this.dom = createDom(id, 'canvas', painter); - vmlCanvasManager && vmlCanvasManager.initElement(this.dom); - - this.domBack = null; - this.ctxBack = null; - - this.painter = painter; - - this.unusedCount = 0; - - this.config = null; - - this.dirty = true; - - this.elCount = 0; - } - - Layer.prototype.initContext = function() { - this.ctx = this.dom.getContext('2d'); - if (devicePixelRatio != 1) { - this.ctx.scale(devicePixelRatio, devicePixelRatio); - } - } - - Layer.prototype.createBackBuffer = function() { - if (vmlCanvasManager) { // IE 8- should not support back buffer - return; - } - this.domBack = createDom('back-' + this.id, 'canvas', this.painter); - this.ctxBack = this.domBack.getContext('2d'); - - if (devicePixelRatio != 1) { - this.ctxBack.scale(devicePixelRatio, devicePixelRatio); - } - }; - - Layer.prototype.resize = function(width, height) { - this.dom.style.width = width + 'px'; - this.dom.style.height = height + 'px'; - - this.dom.setAttribute('width', width * devicePixelRatio); - this.dom.setAttribute('height', height * devicePixelRatio); - - if (devicePixelRatio != 1) { - this.ctx.scale(devicePixelRatio, devicePixelRatio); - } - - if (this.domBack) { - this.domBack.setAttribute('width', width * devicePixelRatio); - this.domBack.setAttribute('height', height * devicePixelRatio); - - if (devicePixelRatio != 1) { - this.ctxBack.scale(devicePixelRatio, devicePixelRatio); - } - } - }; - - Layer.prototype.clear = function() { - var config = this.config; - var dom = this.dom; - var ctx = this.ctx; - var width = dom.width; - var height = dom.height; - - if (config) { - var haveClearColor = - typeof(config.clearColor) !== 'undefined' - && !vmlCanvasManager; - var haveMotionBLur = config.motionBlur && !vmlCanvasManager; - var lastFrameAlpha = config.lastFrameAlpha; - if (typeof(lastFrameAlpha) == 'undefined') { - lastFrameAlpha = 0.7; - } - - if (haveMotionBLur) { - if (!this.domBack) { - this.createBackBuffer(); - } - - this.ctxBack.globalCompositeOperation = 'copy'; - this.ctxBack.drawImage( - dom, 0, 0, - width / devicePixelRatio, - height / devicePixelRatio - ); - } - - if (haveClearColor) { - ctx.save(); - ctx.fillStyle = this.config.clearColor; - ctx.fillRect( - 0, 0, - width / devicePixelRatio, - height / devicePixelRatio - ); - ctx.restore(); - } - else { - ctx.clearRect( - 0, 0, - width / devicePixelRatio, - height / devicePixelRatio - ); - } - - if (haveMotionBLur) { - var domBack = this.domBack; - ctx.save(); - ctx.globalAlpha = lastFrameAlpha; - ctx.drawImage( - domBack, 0, 0, - width / devicePixelRatio, - height / devicePixelRatio - ); - ctx.restore(); - } - } - else { - ctx.clearRect( - 0, 0, - width / devicePixelRatio, - height / devicePixelRatio - ); - } - }; - return Painter; } ); diff --git a/amd/zrender/Storage.js b/amd/zrender/Storage.js index b882f10..7ce3da7 100644 --- a/amd/zrender/Storage.js +++ b/amd/zrender/Storage.js @@ -1,11 +1,10 @@ /** * Storage内容仓库模块 - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * errorrik (errorrik@gmail.com) + * @module zrender/Storage + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + * @author errorrik (errorrik@gmail.com) + * @author pissang (https://github.com/pissang/) */ - - define( function (require) { @@ -13,7 +12,7 @@ define( var util = require('./tool/util'); - var Group = require('./shape/Group'); + var Group = require('./Group'); var defaultIterateOption = { hover: false, @@ -32,9 +31,10 @@ define( } /** * 内容仓库 (M) - * + * @alias module:zrender/Storage + * @constructor */ - function Storage() { + var Storage = function () { // 所有常规形状,id索引的map this._elements = {}; @@ -46,16 +46,17 @@ define( this._shapeList = []; this._shapeListOffset = 0; - } + }; /** * 遍历迭代器 * * @param {Function} fun 迭代回调函数,return true终止迭代 - * @param {Object=} option 迭代参数,缺省为仅降序遍历常规形状 - * hover : true 是否迭代高亮层数据 - * normal : 'down' | 'up' 是否迭代常规数据,迭代时是否指定及z轴顺序 - * update : false 是否更新shapeList + * @param {Object} [option] 迭代参数,缺省为仅降序遍历普通层图形 + * @param {boolean} [option.hover=true] 是否是高亮层图形 + * @param {string} [option.normal='up'] 是否是普通层图形,迭代时是否指定及z轴顺序 + * @param {boolean} [option.update=false] 是否在迭代前更新形状列表 + * */ Storage.prototype.iterShape = function (fun, option) { if (!option) { @@ -63,7 +64,7 @@ define( } if (option.hover) { - //高亮层数据遍历 + // 高亮层数据遍历 for (var i = 0, l = this._hoverElements.length; i < l; i++) { var el = this._hoverElements[i]; el.updateTransform(); @@ -77,7 +78,7 @@ define( this.updateShapeList(); } - //遍历: 'down' | 'up' + // 遍历: 'down' | 'up' switch (option.normal) { case 'down': // 降序遍历,高层优先 @@ -90,7 +91,7 @@ define( break; // case 'up': default: - //升序遍历,底层优先 + // 升序遍历,底层优先 for (var i = 0, l = this._shapeList.length; i < l; i++) { if (fun(this._shapeList[i])) { return this; @@ -102,24 +103,56 @@ define( return this; }; - Storage.prototype.getHoverShapes = function(update) { + /** + * 返回hover层的形状数组 + * @param {boolean} [update=false] 是否在返回前更新图形的变换 + * @return {Array.} + */ + Storage.prototype.getHoverShapes = function (update) { + // hoverConnect + var hoverElements = []; + for (var i = 0, l = this._hoverElements.length; i < l; i++) { + hoverElements.push(this._hoverElements[i]); + var target = this._hoverElements[i].hoverConnect; + if (target) { + var shape; + target = target instanceof Array ? target : [target]; + for (var j = 0, k = target.length; j < k; j++) { + shape = target[j].id ? target[j] : this.get(target[j]); + if (shape) { + hoverElements.push(shape); + } + } + } + } + hoverElements.sort(shapeCompareFunc); if (update) { - for (var i = 0, l = this._hoverElements.length; i < l; i++) { - this._hoverElements[i].updateTransform(); + for (var i = 0, l = hoverElements.length; i < l; i++) { + hoverElements[i].updateTransform(); } } - return this._hoverElements; + return hoverElements; }; - Storage.prototype.getShapeList = function(update) { + /** + * 返回所有图形的绘制队列 + * @param {boolean} [update=false] 是否在返回前更新该数组 + * 详见{@link module:zrender/shape/Base.prototype.updateShapeList} + * @return {Array.} + */ + Storage.prototype.getShapeList = function (update) { if (update) { this.updateShapeList(); } return this._shapeList; }; - - Storage.prototype.updateShapeList = function() { + /** + * 更新图形的绘制队列。 + * 每次绘制前都会调用,该方法会先深度优先遍历整个树,更新所有Group和Shape的变换并且把所有可见的Shape保存到数组中, + * 最后根据绘制的优先级(zlevel > z > 插入顺序)排序得到绘制队列 + */ + Storage.prototype.updateShapeList = function () { this._shapeListOffset = 0; for (var i = 0, len = this._roots.length; i < len; i++) { var root = this._roots[i]; @@ -134,7 +167,7 @@ define( this._shapeList.sort(shapeCompareFunc); }; - Storage.prototype._updateAndAddShape = function(el) { + Storage.prototype._updateAndAddShape = function (el, clipShapes) { if (el.ignore) { return; @@ -149,9 +182,12 @@ define( el.clipShape.parent = el; el.clipShape.updateTransform(); - var startClipShape = el._children[0]; - if (startClipShape) { - startClipShape.__startClip = el.clipShape; + // PENDING 效率影响 + if (clipShapes) { + clipShapes = clipShapes.slice(); + clipShapes.push(el.clipShape); + } else { + clipShapes = [el.clipShape]; } } @@ -161,49 +197,43 @@ define( // Force to mark as dirty if group is dirty child.__dirty = el.__dirty || child.__dirty; - this._updateAndAddShape(child); - } - - if (el.clipShape) { - var stopClipShape = this._shapeList[this._shapeListOffset - 1]; - if (stopClipShape) { - stopClipShape.__stopClip = true; - } + this._updateAndAddShape(child, clipShapes); } // Mark group clean here el.__dirty = false; - } else { + } + else { + el.__clipShapes = clipShapes; + this._shapeList[this._shapeListOffset++] = el; } }; /** - * 修改 + * 修改图形(Shape)或者组(Group) * - * @param {string} idx 唯一标识 + * @param {string} elId 唯一标识 * @param {Object} [params] 参数 */ Storage.prototype.mod = function (elId, params) { var el = this._elements[elId]; if (el) { - if (!(el instanceof Group)) { - el.style.__rect = null; - } - el.__dirty = true; + + el.modSelf(); if (params) { // 如果第二个参数直接使用 shape - // parent, _storage, __startClip 三个属性会有循环引用 + // parent, _storage, __clipShapes 三个属性会有循环引用 // 主要为了向 1.x 版本兼容,2.x 版本不建议使用第二个参数 - if (params.parent || params._storage || params.__startClip) { + if (params.parent || params._storage || params.__clipShapes) { var target = {}; for (var name in params) { if ( - name == 'parent' - || name == '_storage' - || name == '__startClip' + name === 'parent' + || name === '_storage' + || name === '__clipShapes' ) { continue; } @@ -212,7 +242,8 @@ define( } } util.merge(el, target, true); - } else { + } + else { util.merge(el, params, true); } } @@ -222,16 +253,23 @@ define( }; /** - * 常规形状位置漂移,形状自身定义漂移函数 - * - * @param {string} idx 形状唯一标识 + * 移动指定的图形(Shape)或者组(Group)的位置 + * @param {string} shapeId 形状唯一标识 + * @param {number} dx + * @param {number} dy */ Storage.prototype.drift = function (shapeId, dx, dy) { var shape = this._elements[shapeId]; if (shape) { shape.needTransform = true; - if (!shape.ondrift //ondrift - //有onbrush并且调用执行返回false或undefined则继续 + if (shape.draggable === 'horizontal') { + dy = 0; + } + else if (shape.draggable === 'vertical') { + dx = 0; + } + if (!shape.ondrift // ondrift + // 有onbrush并且调用执行返回false或undefined则继续 || (shape.ondrift && !shape.ondrift(dx, dy)) ) { shape.drift(dx, dy); @@ -244,7 +282,7 @@ define( /** * 添加高亮层数据 * - * @param {Object} params 参数 + * @param {module:zrender/shape/Base} shape */ Storage.prototype.addHover = function (shape) { shape.updateNeedTransform(); @@ -253,21 +291,24 @@ define( }; /** - * 删除高亮层数据 + * 清空高亮层数据 */ Storage.prototype.delHover = function () { this._hoverElements = []; return this; }; + /** + * 是否有图形在高亮层里 + * @return {boolean} + */ Storage.prototype.hasHoverShape = function () { return this._hoverElements.length > 0; }; /** - * 添加到根节点 - * - * @param {Shape|Group} el 参数 + * 添加图形(Shape)或者组(Group)到根节点 + * @param {module:zrender/shape/Shape|module:zrender/Group} el */ Storage.prototype.addRoot = function (el) { if (el instanceof Group) { @@ -278,6 +319,10 @@ define( this._roots.push(el); }; + /** + * 删除指定的图形(Shape)或者组(Group) + * @param {string|Array.} [elId] 如果为空清空整个Storage + */ Storage.prototype.delRoot = function (elId) { if (typeof(elId) == 'undefined') { // 不指定elId清空 @@ -291,6 +336,8 @@ define( this._elements = {}; this._hoverElements = []; this._roots = []; + this._shapeList = []; + this._shapeListOffset = 0; return; } @@ -305,7 +352,8 @@ define( var el; if (typeof(elId) == 'string') { el = this._elements[elId]; - } else { + } + else { el = elId; } @@ -319,37 +367,21 @@ define( } }; - /** - * 添加 - * - * @param {Shape|Group} el 参数 - */ Storage.prototype.addToMap = function (el) { if (el instanceof Group) { el._storage = this; - } else { - el.style.__rect = null; } + el.modSelf(); this._elements[el.id] = el; return this; }; - /** - * 根据指定的elId获取相应的shape属性 - * - * @param {string=} idx 唯一标识 - */ Storage.prototype.get = function (elId) { return this._elements[elId]; }; - /** - * 删除,elId不指定则全清空 - * - * @param {string} idx 唯一标识 - */ Storage.prototype.delFromMap = function (elId) { var el = this._elements[elId]; if (el) { @@ -365,7 +397,7 @@ define( /** - * 释放 + * 清空并且释放Storage */ Storage.prototype.dispose = function () { this._elements = diff --git a/amd/zrender/animation/Animation.js b/amd/zrender/animation/Animation.js index 005069f..ba31881 100644 --- a/amd/zrender/animation/Animation.js +++ b/amd/zrender/animation/Animation.js @@ -1,499 +1,606 @@ -/** - * 动画主类, 调度和管理所有动画控制器 - * - * @author pissang(https://github.com/pissang) - * - * @class : Animation - * @config : stage(optional) 绘制类, 需要提供update接口 - * @config : onframe(optional) - * @method : add - * @method : remove - * @method : update - * @method : start - * @method : stop - */ -define( - function(require) { - - 'use strict'; - - var Clip = require('./Clip'); - var color = require('../tool/color'); - var util = require('../tool/util'); - var Dispatcher = require('../tool/event').Dispatcher; - - var requestAnimationFrame = window.requestAnimationFrame - || window.msRequestAnimationFrame - || window.mozRequestAnimationFrame - || window.webkitRequestAnimationFrame - || function(func){setTimeout(func, 16);}; - - var arraySlice = Array.prototype.slice; - - function Animation(options) { - - options = options || {}; - - this.stage = options.stage || {}; - - this.onframe = options.onframe || function() {}; - - // private properties - this._clips = []; - - this._running = false; - - this._time = 0; - - Dispatcher.call(this); - } - - Animation.prototype = { - add : function(clip) { - this._clips.push(clip); - }, - remove : function(clip) { - var idx = util.indexOf(this._clips, clip); - if (idx >= 0) { - this._clips.splice(idx, 1); - } - }, - update : function() { - - var time = new Date().getTime(); - var delta = time - this._time; - var clips = this._clips; - var len = clips.length; - - var deferredEvents = []; - var deferredClips = []; - for (var i = 0; i < len; i++) { - var clip = clips[i]; - var e = clip.step(time); - // Throw out the events need to be called after - // stage.update, like destroy - if (e) { - deferredEvents.push(e); - deferredClips.push(clip); - } - } - if (this.stage.update) { - this.stage.update(); - } - - // Remove the finished clip - for (var i = 0; i < len;) { - if (clips[i]._needsRemove) { - clips[i] = clips[len-1]; - clips.pop(); - len--; - } else { - i++; - } - } - - len = deferredEvents.length; - for (var i = 0; i < len; i++) { - deferredClips[i].fire(deferredEvents[i]); - } - - this._time = time; - - this.onframe(delta); - - this.dispatch('frame', delta); - }, - start : function() { - var self = this; - - this._running = true; - - function step() { - if (self._running) { - self.update(); - requestAnimationFrame(step); - } - } - - this._time = new Date().getTime(); - requestAnimationFrame(step); - }, - stop : function() { - this._running = false; - }, - clear : function() { - this._clips = []; - }, - animate : function(target, options) { - options = options || {}; - var deferred = new Deferred( - target, - options.loop, - options.getter, - options.setter - ); - deferred.animation = this; - return deferred; - }, - constructor: Animation - }; - - util.merge(Animation.prototype, Dispatcher.prototype, true); - - function _defaultGetter(target, key) { - return target[key]; - } - - function _defaultSetter(target, key, value) { - target[key] = value; - } - - function _interpolateNumber(p0, p1, percent) { - return (p1 - p0) * percent + p0; - } - - function _interpolateArray(p0, p1, percent, out, arrDim) { - var len = p0.length; - if (arrDim == 1) { - for (var i = 0; i < len; i++) { - out[i] = _interpolateNumber(p0[i], p1[i], percent); - } - } else { - var len2 = p0[0].length; - for (var i = 0; i < len; i++) { - for (var j = 0; j < len2; j++) { - out[i][j] = _interpolateNumber( - p0[i][j], p1[i][j], percent - ); - } - } - } - } - - function _isArrayLike(data) { - switch (typeof data) { - case 'undefined': - case 'string': - return false; - } - - return typeof data.length !== 'undefined'; - } - - function _catmullRomInterpolateArray( - p0, p1, p2, p3, t, t2, t3, out, arrDim - ) { - var len = p0.length; - if (arrDim == 1) { - for (var i = 0; i < len; i++) { - out[i] = _catmullRomInterpolate( - p0[i], p1[i], p2[i], p3[i], t, t2, t3 - ); - } - } else { - var len2 = p0[0].length; - for (var i = 0; i < len; i++) { - for (var j = 0; j < len2; j++) { - out[i][j] = _catmullRomInterpolate( - p0[i][j], p1[i][j], p2[i][j], p3[i][j], - t, t2, t3 - ); - } - } - } - } - - function _catmullRomInterpolate(p0, p1, p2, p3, t, t2, t3) { - var v0 = (p2 - p0) * 0.5; - var v1 = (p3 - p1) * 0.5; - return (2 * (p1 - p2) + v0 + v1) * t3 - + (- 3 * (p1 - p2) - 2 * v0 - v1) * t2 - + v0 * t + p1; - } - - function _cloneValue(value) { - if (_isArrayLike(value)) { - var len = value.length; - if (_isArrayLike(value[0])) { - var ret = []; - for (var i = 0; i < len; i++) { - ret.push(arraySlice.call(value[i])); - } - return ret; - } else { - return arraySlice.call(value); - } - } else { - return value; - } - } - - function rgba2String(rgba) { - rgba[0] = Math.floor(rgba[0]); - rgba[1] = Math.floor(rgba[1]); - rgba[2] = Math.floor(rgba[2]); - - return 'rgba(' + rgba.join(',') + ')'; - } - - function Deferred(target, loop, getter, setter) { - this._tracks = {}; - this._target = target; - - this._loop = loop || false; - - this._getter = getter || _defaultGetter; - this._setter = setter || _defaultSetter; - - this._clipCount = 0; - - this._delay = 0; - - this._doneList = []; - - this._onframeList = []; - - this._clipList = []; - } - - Deferred.prototype = { - when : function(time /* ms */, props) { - for (var propName in props) { - if (! this._tracks[propName]) { - this._tracks[propName] = []; - // If time is 0 - // Then props is given initialize value - // Else - // Initialize value from current prop value - if (time !== 0) { - this._tracks[propName].push({ - time : 0, - value : _cloneValue( - this._getter(this._target, propName) - ) - }); - } - } - this._tracks[propName].push({ - time : parseInt(time, 10), - value : props[propName] - }); - } - return this; - }, - during : function(callback) { - this._onframeList.push(callback); - return this; - }, - start : function(easing) { - - var self = this; - var setter = this._setter; - var getter = this._getter; - var onFrameListLen = self._onframeList.length; - var useSpline = easing === 'spline'; - - var ondestroy = function() { - self._clipCount--; - if (self._clipCount === 0) { - // Clear all tracks - self._tracks = {}; - - var len = self._doneList.length; - for (var i = 0; i < len; i++) { - self._doneList[i].call(self); - } - } - }; - - var createTrackClip = function(keyframes, propName) { - var trackLen = keyframes.length; - if (!trackLen) { - return; - } - // Guess data type - var firstVal = keyframes[0].value; - var isValueArray = _isArrayLike(firstVal); - var isValueColor = false; - - // For vertices morphing - var arrDim = ( - isValueArray - && _isArrayLike(firstVal[0]) - ) - ? 2 : 1; - // Sort keyframe as ascending - keyframes.sort(function(a, b) { - return a.time - b.time; - }); - var trackMaxTime; - if (trackLen) { - trackMaxTime = keyframes[trackLen-1].time; - }else{ - return; - } - // Percents of each keyframe - var kfPercents = []; - // Value of each keyframe - var kfValues = []; - for (var i = 0; i < trackLen; i++) { - kfPercents.push(keyframes[i].time / trackMaxTime); - // Assume value is a color when it is a string - var value = keyframes[i].value; - if (typeof(value) == 'string') { - value = color.toArray(value); - if (value.length === 0) { // Invalid color - value[0] = value[1] = value[2] = 0; - value[3] = 1; - } - isValueColor = true; - } - kfValues.push(value); - } - - // Cache the key of last frame to speed up when - // animation playback is sequency - var cacheKey = 0; - var cachePercent = 0; - var start; - var i, w; - var p0, p1, p2, p3; - - - if (isValueColor) { - var rgba = [0, 0, 0, 0]; - } - - var onframe = function(target, percent) { - // Find the range keyframes - // kf1-----kf2---------current--------kf3 - // find kf2 and kf3 and do interpolation - if (percent < cachePercent) { - // Start from next key - start = Math.min(cacheKey + 1, trackLen - 1); - for (i = start; i >= 0; i--) { - if (kfPercents[i] <= percent) { - break; - } - } - i = Math.min(i, trackLen-2); - } else { - for (i = cacheKey; i < trackLen; i++) { - if (kfPercents[i] > percent) { - break; - } - } - i = Math.min(i-1, trackLen-2); - } - cacheKey = i; - cachePercent = percent; - - var range = (kfPercents[i+1] - kfPercents[i]); - if (range === 0) { - return; - } else { - w = (percent - kfPercents[i]) / range; - } - if (useSpline) { - p1 = kfValues[i]; - p0 = kfValues[i === 0 ? i : i - 1]; - p2 = kfValues[i > trackLen - 2 ? trackLen - 1 : i + 1]; - p3 = kfValues[i > trackLen - 3 ? trackLen - 1 : i + 2]; - if (isValueArray) { - _catmullRomInterpolateArray( - p0, p1, p2, p3, w, w*w, w*w*w, - getter(target, propName), - arrDim - ); - } else { - var value; - if (isValueColor) { - value = _catmullRomInterpolateArray( - p0, p1, p2, p3, w, w*w, w*w*w, - rgba, 1 - ); - value = rgba2String(rgba); - } else { - value = _catmullRomInterpolate( - p0, p1, p2, p3, w, w*w, w*w*w - ); - } - setter( - target, - propName, - value - ); - } - } else { - if (isValueArray) { - _interpolateArray( - kfValues[i], kfValues[i+1], w, - getter(target, propName), - arrDim - ); - } else { - var value; - if (isValueColor) { - _interpolateArray( - kfValues[i], kfValues[i+1], w, - rgba, 1 - ); - value = rgba2String(rgba); - } else { - value = _interpolateNumber(kfValues[i], kfValues[i+1], w); - } - setter( - target, - propName, - value - ); - } - } - - for (i = 0; i < onFrameListLen; i++) { - self._onframeList[i](target, percent); - } - }; - - var clip = new Clip({ - target : self._target, - life : trackMaxTime, - loop : self._loop, - delay : self._delay, - onframe : onframe, - ondestroy : ondestroy - }); - - if (easing && easing !== 'spline') { - clip.easing = easing; - } - self._clipList.push(clip); - self._clipCount++; - self.animation.add(clip); - }; - - for (var propName in this._tracks) { - createTrackClip(this._tracks[propName], propName); - } - return this; - }, - stop : function() { - for (var i = 0; i < this._clipList.length; i++) { - var clip = this._clipList[i]; - this.animation.remove(clip); - } - this._clipList = []; - }, - delay : function(time){ - this._delay = time; - return this; - }, - done : function(func) { - this._doneList.push(func); - return this; - } - }; - - return Animation; - } -); +/** + * 动画主类, 调度和管理所有动画控制器 + * + * @module zrender/animation/Animation + * @author pissang(https://github.com/pissang) + */ +define( + function(require) { + + 'use strict'; + + var Clip = require('./Clip'); + var color = require('../tool/color'); + var util = require('../tool/util'); + var Dispatcher = require('../tool/event').Dispatcher; + + var requestAnimationFrame = window.requestAnimationFrame + || window.msRequestAnimationFrame + || window.mozRequestAnimationFrame + || window.webkitRequestAnimationFrame + || function (func) { + setTimeout(func, 16); + }; + + var arraySlice = Array.prototype.slice; + + /** + * @typedef {Object} IZRenderStage + * @property {Function} update + */ + + /** + * @alias module:zrender/animation/Animation + * @constructor + * @param {Object} [options] + * @param {Function} [options.onframe] + * @param {IZRenderStage} [options.stage] + * @example + * var animation = new Animation(); + * var obj = { + * x: 100, + * y: 100 + * }; + * animation.animate(node.position) + * .when(1000, { + * x: 500, + * y: 500 + * }) + * .when(2000, { + * x: 100, + * y: 100 + * }) + * .start('spline'); + */ + var Animation = function (options) { + + options = options || {}; + + this.stage = options.stage || {}; + + this.onframe = options.onframe || function() {}; + + // private properties + this._clips = []; + + this._running = false; + + this._time = 0; + + Dispatcher.call(this); + }; + + Animation.prototype = { + /** + * 添加动画片段 + * @param {module:zrender/animation/Clip} clip + */ + add: function(clip) { + this._clips.push(clip); + }, + /** + * 删除动画片段 + * @param {module:zrender/animation/Clip} clip + */ + remove: function(clip) { + var idx = util.indexOf(this._clips, clip); + if (idx >= 0) { + this._clips.splice(idx, 1); + } + }, + _update: function() { + + var time = new Date().getTime(); + var delta = time - this._time; + var clips = this._clips; + var len = clips.length; + + var deferredEvents = []; + var deferredClips = []; + for (var i = 0; i < len; i++) { + var clip = clips[i]; + var e = clip.step(time); + // Throw out the events need to be called after + // stage.update, like destroy + if (e) { + deferredEvents.push(e); + deferredClips.push(clip); + } + } + + // Remove the finished clip + for (var i = 0; i < len;) { + if (clips[i]._needsRemove) { + clips[i] = clips[len - 1]; + clips.pop(); + len--; + } + else { + i++; + } + } + + len = deferredEvents.length; + for (var i = 0; i < len; i++) { + deferredClips[i].fire(deferredEvents[i]); + } + + this._time = time; + + this.onframe(delta); + + this.dispatch('frame', delta); + + if (this.stage.update) { + this.stage.update(); + } + }, + /** + * 开始运行动画 + */ + start: function () { + var self = this; + + this._running = true; + + function step() { + if (self._running) { + self._update(); + requestAnimationFrame(step); + } + } + + this._time = new Date().getTime(); + requestAnimationFrame(step); + }, + /** + * 停止运行动画 + */ + stop: function () { + this._running = false; + }, + /** + * 清除所有动画片段 + */ + clear : function () { + this._clips = []; + }, + /** + * 对一个目标创建一个animator对象,可以指定目标中的属性使用动画 + * @param {Object} target + * @param {Object} options + * @param {boolean} [options.loop=false] 是否循环播放动画 + * @param {Function} [options.getter=null] + * 如果指定getter函数,会通过getter函数取属性值 + * @param {Function} [options.setter=null] + * 如果指定setter函数,会通过setter函数设置属性值 + * @return {module:zrender/animation/Animation~Animator} + */ + animate : function (target, options) { + options = options || {}; + var deferred = new Animator( + target, + options.loop, + options.getter, + options.setter + ); + deferred.animation = this; + return deferred; + }, + constructor: Animation + }; + + util.merge(Animation.prototype, Dispatcher.prototype, true); + + function _defaultGetter(target, key) { + return target[key]; + } + + function _defaultSetter(target, key, value) { + target[key] = value; + } + + function _interpolateNumber(p0, p1, percent) { + return (p1 - p0) * percent + p0; + } + + function _interpolateArray(p0, p1, percent, out, arrDim) { + var len = p0.length; + if (arrDim == 1) { + for (var i = 0; i < len; i++) { + out[i] = _interpolateNumber(p0[i], p1[i], percent); + } + } + else { + var len2 = p0[0].length; + for (var i = 0; i < len; i++) { + for (var j = 0; j < len2; j++) { + out[i][j] = _interpolateNumber( + p0[i][j], p1[i][j], percent + ); + } + } + } + } + + function _isArrayLike(data) { + switch (typeof data) { + case 'undefined': + case 'string': + return false; + } + + return typeof data.length !== 'undefined'; + } + + function _catmullRomInterpolateArray( + p0, p1, p2, p3, t, t2, t3, out, arrDim + ) { + var len = p0.length; + if (arrDim == 1) { + for (var i = 0; i < len; i++) { + out[i] = _catmullRomInterpolate( + p0[i], p1[i], p2[i], p3[i], t, t2, t3 + ); + } + } + else { + var len2 = p0[0].length; + for (var i = 0; i < len; i++) { + for (var j = 0; j < len2; j++) { + out[i][j] = _catmullRomInterpolate( + p0[i][j], p1[i][j], p2[i][j], p3[i][j], + t, t2, t3 + ); + } + } + } + } + + function _catmullRomInterpolate(p0, p1, p2, p3, t, t2, t3) { + var v0 = (p2 - p0) * 0.5; + var v1 = (p3 - p1) * 0.5; + return (2 * (p1 - p2) + v0 + v1) * t3 + + (-3 * (p1 - p2) - 2 * v0 - v1) * t2 + + v0 * t + p1; + } + + function _cloneValue(value) { + if (_isArrayLike(value)) { + var len = value.length; + if (_isArrayLike(value[0])) { + var ret = []; + for (var i = 0; i < len; i++) { + ret.push(arraySlice.call(value[i])); + } + return ret; + } + else { + return arraySlice.call(value); + } + } + else { + return value; + } + } + + function rgba2String(rgba) { + rgba[0] = Math.floor(rgba[0]); + rgba[1] = Math.floor(rgba[1]); + rgba[2] = Math.floor(rgba[2]); + + return 'rgba(' + rgba.join(',') + ')'; + } + + /** + * @alias module:zrender/animation/Animation~Animator + * @constructor + * @param {Object} target + * @param {boolean} loop + * @param {Function} getter + * @param {Function} setter + */ + var Animator = function(target, loop, getter, setter) { + this._tracks = {}; + this._target = target; + + this._loop = loop || false; + + this._getter = getter || _defaultGetter; + this._setter = setter || _defaultSetter; + + this._clipCount = 0; + + this._delay = 0; + + this._doneList = []; + + this._onframeList = []; + + this._clipList = []; + }; + + Animator.prototype = { + /** + * 设置动画关键帧 + * @param {number} time 关键帧时间,单位是ms + * @param {Object} props 关键帧的属性值,key-value表示 + * @return {module:zrender/animation/Animation~Animator} + */ + when : function(time /* ms */, props) { + for (var propName in props) { + if (!this._tracks[propName]) { + this._tracks[propName] = []; + // If time is 0 + // Then props is given initialize value + // Else + // Initialize value from current prop value + if (time !== 0) { + this._tracks[propName].push({ + time : 0, + value : _cloneValue( + this._getter(this._target, propName) + ) + }); + } + } + this._tracks[propName].push({ + time : parseInt(time, 10), + value : props[propName] + }); + } + return this; + }, + /** + * 添加动画每一帧的回调函数 + * @param {Function} callback + * @return {module:zrender/animation/Animation~Animator} + */ + during: function (callback) { + this._onframeList.push(callback); + return this; + }, + /** + * 开始执行动画 + * @param {string|Function} easing + * 动画缓动函数,详见{@link module:zrender/animation/easing} + * @return {module:zrender/animation/Animation~Animator} + */ + start: function (easing) { + + var self = this; + var setter = this._setter; + var getter = this._getter; + var useSpline = easing === 'spline'; + + var ondestroy = function() { + self._clipCount--; + if (self._clipCount === 0) { + // Clear all tracks + self._tracks = {}; + + var len = self._doneList.length; + for (var i = 0; i < len; i++) { + self._doneList[i].call(self); + } + } + }; + + var createTrackClip = function (keyframes, propName) { + var trackLen = keyframes.length; + if (!trackLen) { + return; + } + // Guess data type + var firstVal = keyframes[0].value; + var isValueArray = _isArrayLike(firstVal); + var isValueColor = false; + + // For vertices morphing + var arrDim = ( + isValueArray + && _isArrayLike(firstVal[0]) + ) + ? 2 : 1; + // Sort keyframe as ascending + keyframes.sort(function(a, b) { + return a.time - b.time; + }); + var trackMaxTime; + if (trackLen) { + trackMaxTime = keyframes[trackLen - 1].time; + } + else { + return; + } + // Percents of each keyframe + var kfPercents = []; + // Value of each keyframe + var kfValues = []; + for (var i = 0; i < trackLen; i++) { + kfPercents.push(keyframes[i].time / trackMaxTime); + // Assume value is a color when it is a string + var value = keyframes[i].value; + if (typeof(value) == 'string') { + value = color.toArray(value); + if (value.length === 0) { // Invalid color + value[0] = value[1] = value[2] = 0; + value[3] = 1; + } + isValueColor = true; + } + kfValues.push(value); + } + + // Cache the key of last frame to speed up when + // animation playback is sequency + var cacheKey = 0; + var cachePercent = 0; + var start; + var i; + var w; + var p0; + var p1; + var p2; + var p3; + + + if (isValueColor) { + var rgba = [ 0, 0, 0, 0 ]; + } + + var onframe = function (target, percent) { + // Find the range keyframes + // kf1-----kf2---------current--------kf3 + // find kf2 and kf3 and do interpolation + if (percent < cachePercent) { + // Start from next key + start = Math.min(cacheKey + 1, trackLen - 1); + for (i = start; i >= 0; i--) { + if (kfPercents[i] <= percent) { + break; + } + } + i = Math.min(i, trackLen - 2); + } + else { + for (i = cacheKey; i < trackLen; i++) { + if (kfPercents[i] > percent) { + break; + } + } + i = Math.min(i - 1, trackLen - 2); + } + cacheKey = i; + cachePercent = percent; + + var range = (kfPercents[i + 1] - kfPercents[i]); + if (range === 0) { + return; + } + else { + w = (percent - kfPercents[i]) / range; + } + if (useSpline) { + p1 = kfValues[i]; + p0 = kfValues[i === 0 ? i : i - 1]; + p2 = kfValues[i > trackLen - 2 ? trackLen - 1 : i + 1]; + p3 = kfValues[i > trackLen - 3 ? trackLen - 1 : i + 2]; + if (isValueArray) { + _catmullRomInterpolateArray( + p0, p1, p2, p3, w, w * w, w * w * w, + getter(target, propName), + arrDim + ); + } + else { + var value; + if (isValueColor) { + value = _catmullRomInterpolateArray( + p0, p1, p2, p3, w, w * w, w * w * w, + rgba, 1 + ); + value = rgba2String(rgba); + } + else { + value = _catmullRomInterpolate( + p0, p1, p2, p3, w, w * w, w * w * w + ); + } + setter( + target, + propName, + value + ); + } + } + else { + if (isValueArray) { + _interpolateArray( + kfValues[i], kfValues[i + 1], w, + getter(target, propName), + arrDim + ); + } + else { + var value; + if (isValueColor) { + _interpolateArray( + kfValues[i], kfValues[i + 1], w, + rgba, 1 + ); + value = rgba2String(rgba); + } + else { + value = _interpolateNumber(kfValues[i], kfValues[i + 1], w); + } + setter( + target, + propName, + value + ); + } + } + + for (i = 0; i < self._onframeList.length; i++) { + self._onframeList[i](target, percent); + } + }; + + var clip = new Clip({ + target : self._target, + life : trackMaxTime, + loop : self._loop, + delay : self._delay, + onframe : onframe, + ondestroy : ondestroy + }); + + if (easing && easing !== 'spline') { + clip.easing = easing; + } + self._clipList.push(clip); + self._clipCount++; + self.animation.add(clip); + }; + + for (var propName in this._tracks) { + createTrackClip(this._tracks[propName], propName); + } + return this; + }, + /** + * 停止动画 + */ + stop : function() { + for (var i = 0; i < this._clipList.length; i++) { + var clip = this._clipList[i]; + this.animation.remove(clip); + } + this._clipList = []; + }, + /** + * 设置动画延迟开始的时间 + * @param {number} time 单位ms + * @return {module:zrender/animation/Animation~Animator} + */ + delay : function (time) { + this._delay = time; + return this; + }, + /** + * 添加动画结束的回调 + * @param {Function} cb + * @return {module:zrender/animation/Animation~Animator} + */ + done : function(cb) { + if (cb) { + this._doneList.push(cb); + } + return this; + } + }; + + return Animation; + } +); diff --git a/amd/zrender/animation/Clip.js b/amd/zrender/animation/Clip.js index 418288c..0cfc8f2 100644 --- a/amd/zrender/animation/Clip.js +++ b/amd/zrender/animation/Clip.js @@ -1,103 +1,104 @@ -/** - * 动画主控制器 - * @config target 动画对象,可以是数组,如果是数组的话会批量分发onframe等事件 - * @config life(1000) 动画时长 - * @config delay(0) 动画延迟时间 - * @config loop(true) - * @config gap(0) 循环的间隔时间 - * @config onframe - * @config easing(optional) - * @config ondestroy(optional) - * @config onrestart(optional) - */ -define( - function(require) { - - var Easing = require('./easing'); - - function Clip(options) { - - this._targetPool = options.target || {}; - if (!(this._targetPool instanceof Array)) { - this._targetPool = [this._targetPool]; - } - - //生命周期 - this._life = options.life || 1000; - //延时 - this._delay = options.delay || 0; - //开始时间 - this._startTime = new Date().getTime() + this._delay;//单位毫秒 - - //结束时间 - this._endTime = this._startTime + this._life * 1000; - - //是否循环 - this.loop = typeof options.loop == 'undefined' - ? false : options.loop; - - this.gap = options.gap || 0; - - this.easing = options.easing || 'Linear'; - - this.onframe = options.onframe; - this.ondestroy = options.ondestroy; - this.onrestart = options.onrestart; - } - - Clip.prototype = { - step : function (time) { - var percent = (time - this._startTime) / this._life; - - //还没开始 - if (percent < 0) { - return; - } - - percent = Math.min(percent, 1); - - var easingFunc = typeof this.easing == 'string' - ? Easing[this.easing] - : this.easing; - var schedule = typeof easingFunc === 'function' - ? easingFunc(percent) - : percent; - - this.fire('frame', schedule); - - // 结束 - if (percent == 1) { - if (this.loop) { - this.restart(); - // 重新开始周期 - // 抛出而不是直接调用事件直到 stage.update 后再统一调用这些事件 - return 'restart'; - - } - - // 动画完成将这个控制器标识为待删除 - // 在Animation.update中进行批量删除 - this._needsRemove = true; - return 'destroy'; - } - - return null; - }, - restart : function() { - var time = new Date().getTime(); - var remainder = (time - this._startTime) % this._life; - this._startTime = new Date().getTime() - remainder + this.gap; - }, - fire : function(eventType, arg) { - for (var i = 0, len = this._targetPool.length; i < len; i++) { - if (this['on' + eventType]) { - this['on' + eventType](this._targetPool[i], arg); - } - } - }, - constructor: Clip - }; - - return Clip; - } -); +/** + * 动画主控制器 + * @config target 动画对象,可以是数组,如果是数组的话会批量分发onframe等事件 + * @config life(1000) 动画时长 + * @config delay(0) 动画延迟时间 + * @config loop(true) + * @config gap(0) 循环的间隔时间 + * @config onframe + * @config easing(optional) + * @config ondestroy(optional) + * @config onrestart(optional) + */ +define( + function(require) { + + var Easing = require('./easing'); + + function Clip(options) { + + this._targetPool = options.target || {}; + if (!(this._targetPool instanceof Array)) { + this._targetPool = [ this._targetPool ]; + } + + // 生命周期 + this._life = options.life || 1000; + // 延时 + this._delay = options.delay || 0; + // 开始时间 + this._startTime = new Date().getTime() + this._delay;// 单位毫秒 + + // 结束时间 + this._endTime = this._startTime + this._life * 1000; + + // 是否循环 + this.loop = typeof options.loop == 'undefined' + ? false : options.loop; + + this.gap = options.gap || 0; + + this.easing = options.easing || 'Linear'; + + this.onframe = options.onframe; + this.ondestroy = options.ondestroy; + this.onrestart = options.onrestart; + } + + Clip.prototype = { + step : function (time) { + var percent = (time - this._startTime) / this._life; + + // 还没开始 + if (percent < 0) { + return; + } + + percent = Math.min(percent, 1); + + var easingFunc = typeof this.easing == 'string' + ? Easing[this.easing] + : this.easing; + var schedule = typeof easingFunc === 'function' + ? easingFunc(percent) + : percent; + + this.fire('frame', schedule); + + // 结束 + if (percent == 1) { + if (this.loop) { + this.restart(); + // 重新开始周期 + // 抛出而不是直接调用事件直到 stage.update 后再统一调用这些事件 + return 'restart'; + } + + // 动画完成将这个控制器标识为待删除 + // 在Animation.update中进行批量删除 + this._needsRemove = true; + return 'destroy'; + } + + return null; + }, + restart : function() { + var time = new Date().getTime(); + var remainder = (time - this._startTime) % this._life; + this._startTime = new Date().getTime() - remainder + this.gap; + + this._needsRemove = false; + }, + fire : function(eventType, arg) { + for (var i = 0, len = this._targetPool.length; i < len; i++) { + if (this['on' + eventType]) { + this['on' + eventType](this._targetPool[i], arg); + } + } + }, + constructor: Clip + }; + + return Clip; + } +); diff --git a/amd/zrender/animation/easing.js b/amd/zrender/animation/easing.js index fd2d88a..f794602 100644 --- a/amd/zrender/animation/easing.js +++ b/amd/zrender/animation/easing.js @@ -1,216 +1,349 @@ -/** - * 缓动代码来自 https://github.com/sole/tween.js/blob/master/src/Tween.js - * author: lang(shenyi01@baidu.com) - */ -define( - function() { - var Easing = { - // 线性 - Linear: function(k) { - return k; - }, - - // 二次方的缓动(t^2) - QuadraticIn: function(k) { - return k * k; - }, - QuadraticOut: function(k) { - return k * (2 - k); - }, - QuadraticInOut: function(k) { - if ((k *= 2) < 1) { - return 0.5 * k * k; - } - return - 0.5 * (--k * (k - 2) - 1); - }, - - // 三次方的缓动(t^3) - CubicIn: function(k) { - return k * k * k; - }, - CubicOut: function(k) { - return --k * k * k + 1; - }, - CubicInOut: function(k) { - if ((k *= 2) < 1) { - return 0.5 * k * k * k; - } - return 0.5 * ((k -= 2) * k * k + 2); - }, - - // 四次方的缓动(t^4) - QuarticIn: function(k) { - return k * k * k * k; - }, - QuarticOut: function(k) { - return 1 - (--k * k * k * k); - }, - QuarticInOut: function(k) { - if ((k *= 2) < 1) { - return 0.5 * k * k * k * k; - } - return - 0.5 * ((k -= 2) * k * k * k - 2); - }, - - // 五次方的缓动(t^5) - QuinticIn: function(k) { - return k * k * k * k * k; - }, - - QuinticOut: function(k) { - return --k * k * k * k * k + 1; - }, - QuinticInOut: function(k) { - if ((k *= 2) < 1) { - return 0.5 * k * k * k * k * k; - } - return 0.5 * ((k -= 2) * k * k * k * k + 2); - }, - - // 正弦曲线的缓动(sin(t)) - SinusoidalIn: function(k) { - return 1 - Math.cos(k * Math.PI / 2); - }, - SinusoidalOut: function(k) { - return Math.sin(k * Math.PI / 2); - }, - SinusoidalInOut: function(k) { - return 0.5 * (1 - Math.cos(Math.PI * k)); - }, - - // 指数曲线的缓动(2^t) - ExponentialIn: function(k) { - return k === 0 ? 0 : Math.pow(1024, k - 1); - }, - ExponentialOut: function(k) { - return k === 1 ? 1 : 1 - Math.pow(2, - 10 * k); - }, - ExponentialInOut: function(k) { - if (k === 0) { - return 0; - } - if (k === 1) { - return 1; - } - if ((k *= 2) < 1) { - return 0.5 * Math.pow(1024, k - 1); - } - return 0.5 * (- Math.pow(2, - 10 * (k - 1)) + 2); - }, - - // 圆形曲线的缓动(sqrt(1-t^2)) - CircularIn: function(k) { - return 1 - Math.sqrt(1 - k * k); - }, - CircularOut: function(k) { - return Math.sqrt(1 - (--k * k)); - }, - CircularInOut: function(k) { - if ((k *= 2) < 1) { - return - 0.5 * (Math.sqrt(1 - k * k) - 1); - } - return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1); - }, - - // 创建类似于弹簧在停止前来回振荡的动画 - ElasticIn: function(k) { - var s, a = 0.1, p = 0.4; - if (k === 0) { - return 0; - } - if (k === 1) { - return 1; - } - if (!a || a < 1) { - a = 1; s = p / 4; - }else{ - s = p * Math.asin(1 / a) / (2 * Math.PI); - } - return - (a * Math.pow(2, 10 * (k -= 1)) * - Math.sin((k - s) * (2 * Math.PI) / p)); - }, - ElasticOut: function(k) { - var s, a = 0.1, p = 0.4; - if (k === 0) { - return 0; - } - if (k === 1) { - return 1; - } - if (!a || a < 1) { - a = 1; s = p / 4; - } - else{ - s = p * Math.asin(1 / a) / (2 * Math.PI); - } - return (a * Math.pow(2, - 10 * k) * - Math.sin((k - s) * (2 * Math.PI) / p) + 1); - }, - ElasticInOut: function(k) { - var s, a = 0.1, p = 0.4; - if (k === 0) { - return 0; - } - if (k === 1) { - return 1; - } - if (!a || a < 1) { - a = 1; s = p / 4; - } - else{ - s = p * Math.asin(1 / a) / (2 * Math.PI); - } - if ((k *= 2) < 1) { - return - 0.5 * (a * Math.pow(2, 10 * (k -= 1)) - * Math.sin((k - s) * (2 * Math.PI) / p)); - } - return a * Math.pow(2, -10 * (k -= 1)) - * Math.sin((k - s) * (2 * Math.PI) / p) * 0.5 + 1; - - }, - - // 在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动 - BackIn: function(k) { - var s = 1.70158; - return k * k * ((s + 1) * k - s); - }, - BackOut: function(k) { - var s = 1.70158; - return --k * k * ((s + 1) * k + s) + 1; - }, - BackInOut: function(k) { - var s = 1.70158 * 1.525; - if ((k *= 2) < 1) { - return 0.5 * (k * k * ((s + 1) * k - s)); - } - return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2); - }, - - // 创建弹跳效果 - BounceIn: function(k) { - return 1 - Easing.BounceOut(1 - k); - }, - BounceOut: function(k) { - if (k < (1 / 2.75)) { - return 7.5625 * k * k; - } - else if (k < (2 / 2.75)) { - return 7.5625 * (k -= (1.5 / 2.75)) * k + 0.75; - } else if (k < (2.5 / 2.75)) { - return 7.5625 * (k -= (2.25 / 2.75)) * k + 0.9375; - } else { - return 7.5625 * (k -= (2.625 / 2.75)) * k + 0.984375; - } - }, - BounceInOut: function(k) { - if (k < 0.5) { - return Easing.BounceIn(k * 2) * 0.5; - } - return Easing.BounceOut(k * 2 - 1) * 0.5 + 0.5; - } - }; - - return Easing; - } -); - +define( + function() { + /** + * 缓动代码来自 https://github.com/sole/tween.js/blob/master/src/Tween.js + * @see http://sole.github.io/tween.js/examples/03_graphs.html + * @exports zrender/animation/easing + */ + var easing = { + // 线性 + /** + * @param {number} k + * @return {number} + */ + Linear: function (k) { + return k; + }, + + // 二次方的缓动(t^2) + /** + * @param {number} k + * @return {number} + */ + QuadraticIn: function (k) { + return k * k; + }, + /** + * @param {number} k + * @return {number} + */ + QuadraticOut: function (k) { + return k * (2 - k); + }, + /** + * @param {number} k + * @return {number} + */ + QuadraticInOut: function (k) { + if ((k *= 2) < 1) { + return 0.5 * k * k; + } + return -0.5 * (--k * (k - 2) - 1); + }, + + // 三次方的缓动(t^3) + /** + * @param {number} k + * @return {number} + */ + CubicIn: function (k) { + return k * k * k; + }, + /** + * @param {number} k + * @return {number} + */ + CubicOut: function (k) { + return --k * k * k + 1; + }, + /** + * @param {number} k + * @return {number} + */ + CubicInOut: function (k) { + if ((k *= 2) < 1) { + return 0.5 * k * k * k; + } + return 0.5 * ((k -= 2) * k * k + 2); + }, + + // 四次方的缓动(t^4) + /** + * @param {number} k + * @return {number} + */ + QuarticIn: function (k) { + return k * k * k * k; + }, + /** + * @param {number} k + * @return {number} + */ + QuarticOut: function (k) { + return 1 - (--k * k * k * k); + }, + /** + * @param {number} k + * @return {number} + */ + QuarticInOut: function (k) { + if ((k *= 2) < 1) { + return 0.5 * k * k * k * k; + } + return -0.5 * ((k -= 2) * k * k * k - 2); + }, + + // 五次方的缓动(t^5) + /** + * @param {number} k + * @return {number} + */ + QuinticIn: function (k) { + return k * k * k * k * k; + }, + /** + * @param {number} k + * @return {number} + */ + QuinticOut: function (k) { + return --k * k * k * k * k + 1; + }, + /** + * @param {number} k + * @return {number} + */ + QuinticInOut: function (k) { + if ((k *= 2) < 1) { + return 0.5 * k * k * k * k * k; + } + return 0.5 * ((k -= 2) * k * k * k * k + 2); + }, + + // 正弦曲线的缓动(sin(t)) + /** + * @param {number} k + * @return {number} + */ + SinusoidalIn: function (k) { + return 1 - Math.cos(k * Math.PI / 2); + }, + /** + * @param {number} k + * @return {number} + */ + SinusoidalOut: function (k) { + return Math.sin(k * Math.PI / 2); + }, + /** + * @param {number} k + * @return {number} + */ + SinusoidalInOut: function (k) { + return 0.5 * (1 - Math.cos(Math.PI * k)); + }, + + // 指数曲线的缓动(2^t) + /** + * @param {number} k + * @return {number} + */ + ExponentialIn: function (k) { + return k === 0 ? 0 : Math.pow(1024, k - 1); + }, + /** + * @param {number} k + * @return {number} + */ + ExponentialOut: function (k) { + return k === 1 ? 1 : 1 - Math.pow(2, -10 * k); + }, + /** + * @param {number} k + * @return {number} + */ + ExponentialInOut: function (k) { + if (k === 0) { + return 0; + } + if (k === 1) { + return 1; + } + if ((k *= 2) < 1) { + return 0.5 * Math.pow(1024, k - 1); + } + return 0.5 * (-Math.pow(2, -10 * (k - 1)) + 2); + }, + + // 圆形曲线的缓动(sqrt(1-t^2)) + /** + * @param {number} k + * @return {number} + */ + CircularIn: function (k) { + return 1 - Math.sqrt(1 - k * k); + }, + /** + * @param {number} k + * @return {number} + */ + CircularOut: function (k) { + return Math.sqrt(1 - (--k * k)); + }, + /** + * @param {number} k + * @return {number} + */ + CircularInOut: function (k) { + if ((k *= 2) < 1) { + return -0.5 * (Math.sqrt(1 - k * k) - 1); + } + return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1); + }, + + // 创建类似于弹簧在停止前来回振荡的动画 + /** + * @param {number} k + * @return {number} + */ + ElasticIn: function (k) { + var s; + var a = 0.1; + var p = 0.4; + if (k === 0) { + return 0; + } + if (k === 1) { + return 1; + } + if (!a || a < 1) { + a = 1; s = p / 4; + } + else { + s = p * Math.asin(1 / a) / (2 * Math.PI); + } + return -(a * Math.pow(2, 10 * (k -= 1)) * + Math.sin((k - s) * (2 * Math.PI) / p)); + }, + /** + * @param {number} k + * @return {number} + */ + ElasticOut: function (k) { + var s; + var a = 0.1; + var p = 0.4; + if (k === 0) { + return 0; + } + if (k === 1) { + return 1; + } + if (!a || a < 1) { + a = 1; s = p / 4; + } + else { + s = p * Math.asin(1 / a) / (2 * Math.PI); + } + return (a * Math.pow(2, -10 * k) * + Math.sin((k - s) * (2 * Math.PI) / p) + 1); + }, + /** + * @param {number} k + * @return {number} + */ + ElasticInOut: function (k) { + var s; + var a = 0.1; + var p = 0.4; + if (k === 0) { + return 0; + } + if (k === 1) { + return 1; + } + if (!a || a < 1) { + a = 1; s = p / 4; + } + else { + s = p * Math.asin(1 / a) / (2 * Math.PI); + } + if ((k *= 2) < 1) { + return -0.5 * (a * Math.pow(2, 10 * (k -= 1)) + * Math.sin((k - s) * (2 * Math.PI) / p)); + } + return a * Math.pow(2, -10 * (k -= 1)) + * Math.sin((k - s) * (2 * Math.PI) / p) * 0.5 + 1; + + }, + + // 在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动 + /** + * @param {number} k + * @return {number} + */ + BackIn: function (k) { + var s = 1.70158; + return k * k * ((s + 1) * k - s); + }, + /** + * @param {number} k + * @return {number} + */ + BackOut: function (k) { + var s = 1.70158; + return --k * k * ((s + 1) * k + s) + 1; + }, + /** + * @param {number} k + * @return {number} + */ + BackInOut: function (k) { + var s = 1.70158 * 1.525; + if ((k *= 2) < 1) { + return 0.5 * (k * k * ((s + 1) * k - s)); + } + return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2); + }, + + // 创建弹跳效果 + /** + * @param {number} k + * @return {number} + */ + BounceIn: function (k) { + return 1 - easing.BounceOut(1 - k); + }, + /** + * @param {number} k + * @return {number} + */ + BounceOut: function (k) { + if (k < (1 / 2.75)) { + return 7.5625 * k * k; + } + else if (k < (2 / 2.75)) { + return 7.5625 * (k -= (1.5 / 2.75)) * k + 0.75; + } + else if (k < (2.5 / 2.75)) { + return 7.5625 * (k -= (2.25 / 2.75)) * k + 0.9375; + } + else { + return 7.5625 * (k -= (2.625 / 2.75)) * k + 0.984375; + } + }, + /** + * @param {number} k + * @return {number} + */ + BounceInOut: function (k) { + if (k < 0.5) { + return easing.BounceIn(k * 2) * 0.5; + } + return easing.BounceOut(k * 2 - 1) * 0.5 + 0.5; + } + }; + + return easing; + } +); + diff --git a/amd/zrender/config.js b/amd/zrender/config.js index c8f2976..dbd5bee 100644 --- a/amd/zrender/config.js +++ b/amd/zrender/config.js @@ -1,47 +1,118 @@ -/** - * zrender: config默认配置项 - * - * @desc zrender是一个轻量级的Canvas类库,MVC封装,数据驱动,提供类Dom事件模型。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define( - { - EVENT : { // 支持事件列表 - RESIZE : 'resize', // 窗口大小变化 - CLICK : 'click', // 鼠标按钮被(手指)按下,事件对象是:目标图形元素或空 - - MOUSEWHEEL : 'mousewheel', // 鼠标滚轮变化,事件对象是:目标图形元素或空 - MOUSEMOVE : 'mousemove', // 鼠标(手指)被移动,事件对象是:目标图形元素或空 - MOUSEOVER : 'mouseover', // 鼠标移到某图形元素之上,事件对象是:目标图形元素 - MOUSEOUT : 'mouseout', // 鼠标从某图形元素移开,事件对象是:目标图形元素 - MOUSEDOWN : 'mousedown', // 鼠标按钮(手指)被按下,事件对象是:目标图形元素或空 - MOUSEUP : 'mouseup', // 鼠标按键(手指)被松开,事件对象是:目标图形元素或空 - - // - GLOBALOUT : 'globalout', // 全局离开,MOUSEOUT触发比较频繁,一次离开优化绑定 - - // 一次成功元素拖拽的行为事件过程是: - // dragstart > dragenter > dragover [> dragleave] > drop > dragend - DRAGSTART : 'dragstart', // 开始拖拽时触发,事件对象是:被拖拽图形元素 - DRAGEND : 'dragend', // 拖拽完毕时触发(在drop之后触发),事件对象是:被拖拽图形元素 - DRAGENTER : 'dragenter', // 拖拽图形元素进入目标图形元素时触发,事件对象是:目标图形元素 - DRAGOVER : 'dragover', // 拖拽图形元素在目标图形元素上移动时触发,事件对象是:目标图形元素 - DRAGLEAVE : 'dragleave', // 拖拽图形元素离开目标图形元素时触发,事件对象是:目标图形元素 - DROP : 'drop', // 拖拽图形元素放在目标图形元素内时触发,事件对象是:目标图形元素 - - touchClickDelay : 300 // touch end - start < delay is click - }, - - // 是否异常捕获 - catchBrushException: false, - - /** - * debug日志选项:catchBrushException为true下有效 - * 0 : 不生成debug数据,发布用 - * 1 : 异常抛出,调试用 - * 2 : 控制台输出,调试用 - */ - debugMode: 0 - } -); \ No newline at end of file +define(function () { + /** + * config默认配置项 + * @exports zrender/config + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + */ + var config = { + /** + * @namespace module:zrender/config.EVENT + */ + EVENT : { + /** + * 窗口大小变化 + * @type {string} + */ + RESIZE : 'resize', + /** + * 鼠标按钮被(手指)按下,事件对象是:目标图形元素或空 + * @type {string} + */ + CLICK : 'click', + /** + * 双击事件 + * @type {string} + */ + DBLCLICK : 'dblclick', + /** + * 鼠标滚轮变化,事件对象是:目标图形元素或空 + * @type {string} + */ + MOUSEWHEEL : 'mousewheel', + /** + * 鼠标(手指)被移动,事件对象是:目标图形元素或空 + * @type {string} + */ + MOUSEMOVE : 'mousemove', + /** + * 鼠标移到某图形元素之上,事件对象是:目标图形元素 + * @type {string} + */ + MOUSEOVER : 'mouseover', + /** + * 鼠标从某图形元素移开,事件对象是:目标图形元素 + * @type {string} + */ + MOUSEOUT : 'mouseout', + /** + * 鼠标按钮(手指)被按下,事件对象是:目标图形元素或空 + * @type {string} + */ + MOUSEDOWN : 'mousedown', + /** + * 鼠标按键(手指)被松开,事件对象是:目标图形元素或空 + * @type {string} + */ + MOUSEUP : 'mouseup', + /** + * 全局离开,MOUSEOUT触发比较频繁,一次离开优化绑定 + * @type {string} + */ + GLOBALOUT : 'globalout', // + + // 一次成功元素拖拽的行为事件过程是: + // dragstart > dragenter > dragover [> dragleave] > drop > dragend + /** + * 开始拖拽时触发,事件对象是:被拖拽图形元素 + * @type {string} + */ + DRAGSTART : 'dragstart', + /** + * 拖拽完毕时触发(在drop之后触发),事件对象是:被拖拽图形元素 + * @type {string} + */ + DRAGEND : 'dragend', + /** + * 拖拽图形元素进入目标图形元素时触发,事件对象是:目标图形元素 + * @type {string} + */ + DRAGENTER : 'dragenter', + /** + * 拖拽图形元素在目标图形元素上移动时触发,事件对象是:目标图形元素 + * @type {string} + */ + DRAGOVER : 'dragover', + /** + * 拖拽图形元素离开目标图形元素时触发,事件对象是:目标图形元素 + * @type {string} + */ + DRAGLEAVE : 'dragleave', + /** + * 拖拽图形元素放在目标图形元素内时触发,事件对象是:目标图形元素 + * @type {string} + */ + DROP : 'drop', + /** + * touch end - start < delay is click + * @type {number} + */ + touchClickDelay : 300 + }, + + // 是否异常捕获 + catchBrushException: false, + + /** + * debug日志选项:catchBrushException为true下有效 + * 0 : 不生成debug数据,发布用 + * 1 : 异常抛出,调试用 + * 2 : 控制台输出,调试用 + */ + debugMode: 0, + + // retina 屏幕优化 + devicePixelRatio: Math.max(window.devicePixelRatio || 1, 1) + }; + return config; +}); + diff --git a/amd/zrender/lib/excanvas.js b/amd/zrender/dep/excanvas.js similarity index 98% rename from amd/zrender/lib/excanvas.js rename to amd/zrender/dep/excanvas.js index b65ff03..4d16812 100644 --- a/amd/zrender/lib/excanvas.js +++ b/amd/zrender/dep/excanvas.js @@ -253,8 +253,8 @@ if (!document.createElement('canvas').getContext) { o2.font = o1.font; o2.textAlign = o1.textAlign; o2.textBaseline = o1.textBaseline; - o2.arcScaleX_ = o1.arcScaleX_; - o2.arcScaleY_ = o1.arcScaleY_; + o2.scaleX_ = o1.scaleX_; + o2.scaleY_ = o1.scaleY_; o2.lineScale_ = o1.lineScale_; } @@ -606,8 +606,8 @@ if (!document.createElement('canvas').getContext) { canvasElement.appendChild(overlayEl); this.element_ = el; - this.arcScaleX_ = 1; - this.arcScaleY_ = 1; + this.scaleX_ = 1; + this.scaleY_ = 1; this.lineScale_ = 1; } @@ -844,9 +844,8 @@ if (!document.createElement('canvas').getContext) { this.m_[1][1] != 1 || this.m_[1][0]) { var filter = []; - scaleX = Math.sqrt(this.m_[0][0] * this.m_[0][0] + this.m_[0][1] * this.m_[0][1]); - scaleY = Math.sqrt(this.m_[1][0] * this.m_[1][0] + this.m_[1][1] * this.m_[1][1]); - + var scaleX = this.scaleX_; + var scaleY = this.scaleY_; // Note the 12/21 reversal filter.push('M11=', this.m_[0][0] / scaleX, ',', 'M12=', this.m_[1][0] / scaleY, ',', @@ -867,7 +866,7 @@ if (!document.createElement('canvas').getContext) { vmlStr.push('padding:0 ', mr(max.x / Z), 'px ', mr(max.y / Z), 'px 0;filter:progid:DXImageTransform.Microsoft.Matrix(', - filter.join(''), ", sizingmethod='clip');"); + filter.join(''), ", SizingMethod='clip');"); } else { vmlStr.push('top:', mr(d.y / Z), 'px;left:', mr(d.x / Z), 'px;'); @@ -949,10 +948,10 @@ if (!document.createElement('canvas').getContext) { case 'at': case 'wa': lineStr.push(' ', p.type, ' ', - mr(p.x - this.arcScaleX_ * p.radius), ',', - mr(p.y - this.arcScaleY_ * p.radius), ' ', - mr(p.x + this.arcScaleX_ * p.radius), ',', - mr(p.y + this.arcScaleY_ * p.radius), ' ', + mr(p.x - this.scaleX_ * p.radius), ',', + mr(p.y - this.scaleY_ * p.radius), ' ', + mr(p.x + this.scaleX_ * p.radius), ',', + mr(p.y + this.scaleY_ * p.radius), ' ', mr(p.xStart), ',', mr(p.yStart), ' ', mr(p.xEnd), ',', mr(p.yEnd)); break; @@ -1017,8 +1016,8 @@ if (!document.createElement('canvas').getContext) { function appendFill(ctx, lineStr, min, max) { var fillStyle = ctx.fillStyle; - var arcScaleX = ctx.arcScaleX_; - var arcScaleY = ctx.arcScaleY_; + var arcScaleX = ctx.scaleX_; + var arcScaleY = ctx.scaleY_; var width = max.x - min.x; var height = max.y - min.y; if (fillStyle instanceof CanvasGradient_) { @@ -1161,6 +1160,9 @@ if (!document.createElement('canvas').getContext) { } ctx.m_ = m; + ctx.scaleX_ = Math.sqrt(m[0][0] * m[0][0] + m[0][1] * m[0][1]); + ctx.scaleY_ = Math.sqrt(m[1][0] * m[1][0] + m[1][1] * m[1][1]); + if (updateLineScale) { // Get the line scale. // Determinant of this.m_ means how much the area is enlarged by the @@ -1195,8 +1197,6 @@ if (!document.createElement('canvas').getContext) { }; contextPrototype.scale = function(aX, aY) { - this.arcScaleX_ *= aX; - this.arcScaleY_ *= aY; var m1 = [ [aX, 0, 0], [0, aY, 0], @@ -1214,6 +1214,7 @@ if (!document.createElement('canvas').getContext) { ]; setM(this, matrixMultiply(m1, this.m_), true); + }; contextPrototype.setTransform = function(m11, m12, m21, m22, dx, dy) { @@ -1338,7 +1339,12 @@ if (!document.createElement('canvas').getContext) { } var doc = this.element_.ownerDocument; this.textMeasureEl_.innerHTML = ''; - this.textMeasureEl_.style.font = this.font; + try { + this.textMeasureEl_.style.font = this.font; + } catch (ex) { + // Ignore failures to set to invalid font. + } + // Don't use innerHTML or innerText because they allow markup/whitespace. this.textMeasureEl_.appendChild(doc.createTextNode(text)); return {width: this.textMeasureEl_.offsetWidth}; @@ -1447,4 +1453,4 @@ else { // make the canvas test simple by kener.linfeng@gmail.com G_vmlCanvasManager = false; } return G_vmlCanvasManager; -}); // define \ No newline at end of file +}); // define diff --git a/amd/zrender/dep/excanvas2.js b/amd/zrender/dep/excanvas2.js new file mode 100644 index 0000000..c58afc4 --- /dev/null +++ b/amd/zrender/dep/excanvas2.js @@ -0,0 +1,2162 @@ +// Copyright 2006 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +// Known Issues: +// +// * Patterns only support repeat. +// * Radial gradient are not implemented. The VML version of these look very +// different from the canvas one. +// * Clipping paths are not implemented. +// * Coordsize. The width and height attribute have higher priority than the +// width and height style values which isn't correct. +// * Painting mode isn't implemented. +// * Canvas width/height should is using content-box by default. IE in +// Quirks mode will draw the canvas using border-box. Either change your +// doctype to HTML5 +// (http://www.whatwg.org/specs/web-apps/current-work/#the-doctype) +// or use Box Sizing Behavior from WebFX +// (http://webfx.eae.net/dhtml/boxsizing/boxsizing.html) +// * Non uniform scaling does not correctly scale strokes. +// * Optimize. There is always room for speed improvements. + +// AMD by kener.linfeng@gmail.com +// Optimized by https://github.com/pissang +// +// NOTES http://jsperf.com/dom-attr-read-perf/2 +// http://jsperf.com/arr-vs-obj-in-ie +define(function(require) { + +// Only add this code if we do not already have a canvas implementation +if (!document.createElement('canvas').getContext) { + +(function() { + + // alias some functions to make (compiled) code shorter + var m = Math; + var mr = m.round; + var ms = m.sin; + var mc = m.cos; + var abs = m.abs; + var sqrt = m.sqrt; + + // this is used for sub pixel precision + var Z = 10; + var Z2 = Z / 2; + + var IE_VERSION = +navigator.userAgent.match(/MSIE ([\d.]+)?/)[1]; + + var EPSILON = 1e-5; + var isAroundZero = function (val) { + return val > -EPSILON && val < EPSILON; + } + function isNotAroundZero(val) { + return val > EPSILON || val < -EPSILON; + } + + /** + * This funtion is assigned to the elements as element.getContext(). + * @this {HTMLElement} + * @return {CanvasRenderingContext2D_} + */ + function getContext() { + return this.context_ || + (this.context_ = new CanvasRenderingContext2D_(this)); + } + + var slice = Array.prototype.slice; + + /** + * Binds a function to an object. The returned function will always use the + * passed in {@code obj} as {@code this}. + * + * Example: + * + * g = bind(f, obj, a, b) + * g(c, d) // will do f.call(obj, a, b, c, d) + * + * @param {Function} f The function to bind the object to + * @param {Object} obj The object that should act as this when the function + * is called + * @param {*} var_args Rest arguments that will be used as the initial + * arguments when the function is called + * @return {Function} A new function that has bound this + */ + function bind(f, obj, var_args) { + var a = slice.call(arguments, 2); + return function() { + return f.apply(obj, a.concat(slice.call(arguments))); + }; + } + + function encodeHtmlAttribute(s) { + return String(s).replace(/&/g, '&').replace(/"/g, '"'); + } + + function addNamespace(doc, prefix, urn) { + if (!doc.namespaces[prefix]) { + // NOTES, It will not work proply if add '#default#VML' + // When using appendChild to add dom + // doc.namespaces.add(prefix, urn, '#default#VML'); + doc.namespaces.add(prefix, urn); + } + } + + function addNamespacesAndStylesheet(doc) { + addNamespace(doc, 'g_vml_', 'urn:schemas-microsoft-com:vml'); + addNamespace(doc, 'g_o_', 'urn:schemas-microsoft-com:office:office'); + + // Setup default CSS. Only add one style sheet per document + if (!doc.styleSheets['ex_canvas_']) { + var ss = doc.createStyleSheet(); + ss.owningElement.id = 'ex_canvas_'; + ss.cssText = 'canvas{display:inline-block;overflow:hidden;' + + // default size is 300x150 in Gecko and Opera + 'text-align:left;width:300px;height:150px} .g_vml_ {behavior:url(#default#VML);}'; + } + } + + function createVMLElement(tagName) { + // NOTES Why using createElement needs to add behavior:url(#default#VML) in style + var dom = document.createElement(''); + return dom; + + } + + // Add namespaces and stylesheet at startup. + addNamespacesAndStylesheet(document); + + var G_vmlCanvasManager_ = { + init: function(opt_doc) { + var doc = opt_doc || document; + // Create a dummy element so that IE will allow canvas elements to be + // recognized. + doc.createElement('canvas'); + doc.attachEvent('onreadystatechange', bind(this.init_, this, doc)); + }, + + init_: function(doc) { + // find all canvas elements + var els = doc.getElementsByTagName('canvas'); + for (var i = 0; i < els.length; i++) { + this.initElement(els[i]); + } + }, + + /** + * Public initializes a canvas element so that it can be used as canvas + * element from now on. This is called automatically before the page is + * loaded but if you are creating elements using createElement you need to + * make sure this is called on the element. + * @param {HTMLElement} el The canvas element to initialize. + * @return {HTMLElement} the element that was created. + */ + initElement: function(el) { + if (!el.getContext) { + el.getContext = getContext; + + // Add namespaces and stylesheet to document of the element. + addNamespacesAndStylesheet(el.ownerDocument); + + // Remove fallback content. There is no way to hide text nodes so we + // just remove all childNodes. We could hide all elements and remove + // text nodes but who really cares about the fallback content. + el.innerHTML = ''; + + // do not use inline function because that will leak memory + el.attachEvent('onpropertychange', onPropertyChange); + el.attachEvent('onresize', onResize); + + var attrs = el.attributes; + if (attrs.width && attrs.width.specified) { + // TODO: use runtimeStyle and coordsize + // el.getContext().setWidth_(attrs.width.nodeValue); + el.style.width = attrs.width.nodeValue + 'px'; + } else { + el.width = el.clientWidth; + } + if (attrs.height && attrs.height.specified) { + // TODO: use runtimeStyle and coordsize + // el.getContext().setHeight_(attrs.height.nodeValue); + el.style.height = attrs.height.nodeValue + 'px'; + } else { + el.height = el.clientHeight; + } + //el.getContext().setCoordsize_() + } + return el; + } + }; + + function onPropertyChange(e) { + var el = e.srcElement; + + switch (e.propertyName) { + case 'width': + el.getContext().clearRect(); + el.style.width = el.attributes.width.nodeValue + 'px'; + // In IE8 this does not trigger onresize. + el.firstChild.style.width = el.clientWidth + 'px'; + break; + case 'height': + el.getContext().clearRect(); + el.style.height = el.attributes.height.nodeValue + 'px'; + el.firstChild.style.height = el.clientHeight + 'px'; + break; + } + } + + function onResize(e) { + var el = e.srcElement; + if (el.firstChild) { + el.firstChild.style.width = el.clientWidth + 'px'; + el.firstChild.style.height = el.clientHeight + 'px'; + } + } + + G_vmlCanvasManager_.init(); + + // precompute "00" to "FF" + var decToHex = []; + for (var i = 0; i < 16; i++) { + for (var j = 0; j < 16; j++) { + decToHex[i * 16 + j] = i.toString(16) + j.toString(16); + } + } + + function createMatrixIdentity() { + return [ + [1, 0, 0], + [0, 1, 0], + [0, 0, 1] + ]; + } + + function matrixMultiply(m1, m2) { + var result = createMatrixIdentity(); + + for (var x = 0; x < 3; x++) { + for (var y = 0; y < 3; y++) { + var sum = 0; + + for (var z = 0; z < 3; z++) { + sum += m1[x][z] * m2[z][y]; + } + + result[x][y] = sum; + } + } + return result; + } + + + function copyState(o1, o2) { + o2.fillStyle = o1.fillStyle; + o2.lineCap = o1.lineCap; + o2.lineJoin = o1.lineJoin; + o2.lineWidth = o1.lineWidth; + o2.miterLimit = o1.miterLimit; + o2.strokeStyle = o1.strokeStyle; + o2.globalAlpha = o1.globalAlpha; + o2.font = o1.font; + o2.textAlign = o1.textAlign; + o2.textBaseline = o1.textBaseline; + o2.scaleX_ = o1.scaleX_; + o2.scaleY_ = o1.scaleY_; + o2.x_ = o1.x_; + o2.y_ = o1.y_; + o2.lineScale_ = o1.lineScale_; + } + + var colorData = { + aliceblue: '#F0F8FF', + antiquewhite: '#FAEBD7', + aquamarine: '#7FFFD4', + azure: '#F0FFFF', + beige: '#F5F5DC', + bisque: '#FFE4C4', + black: '#000000', + blanchedalmond: '#FFEBCD', + blueviolet: '#8A2BE2', + brown: '#A52A2A', + burlywood: '#DEB887', + cadetblue: '#5F9EA0', + chartreuse: '#7FFF00', + chocolate: '#D2691E', + coral: '#FF7F50', + cornflowerblue: '#6495ED', + cornsilk: '#FFF8DC', + crimson: '#DC143C', + cyan: '#00FFFF', + darkblue: '#00008B', + darkcyan: '#008B8B', + darkgoldenrod: '#B8860B', + darkgray: '#A9A9A9', + darkgreen: '#006400', + darkgrey: '#A9A9A9', + darkkhaki: '#BDB76B', + darkmagenta: '#8B008B', + darkolivegreen: '#556B2F', + darkorange: '#FF8C00', + darkorchid: '#9932CC', + darkred: '#8B0000', + darksalmon: '#E9967A', + darkseagreen: '#8FBC8F', + darkslateblue: '#483D8B', + darkslategray: '#2F4F4F', + darkslategrey: '#2F4F4F', + darkturquoise: '#00CED1', + darkviolet: '#9400D3', + deeppink: '#FF1493', + deepskyblue: '#00BFFF', + dimgray: '#696969', + dimgrey: '#696969', + dodgerblue: '#1E90FF', + firebrick: '#B22222', + floralwhite: '#FFFAF0', + forestgreen: '#228B22', + gainsboro: '#DCDCDC', + ghostwhite: '#F8F8FF', + gold: '#FFD700', + goldenrod: '#DAA520', + grey: '#808080', + greenyellow: '#ADFF2F', + honeydew: '#F0FFF0', + hotpink: '#FF69B4', + indianred: '#CD5C5C', + indigo: '#4B0082', + ivory: '#FFFFF0', + khaki: '#F0E68C', + lavender: '#E6E6FA', + lavenderblush: '#FFF0F5', + lawngreen: '#7CFC00', + lemonchiffon: '#FFFACD', + lightblue: '#ADD8E6', + lightcoral: '#F08080', + lightcyan: '#E0FFFF', + lightgoldenrodyellow: '#FAFAD2', + lightgreen: '#90EE90', + lightgrey: '#D3D3D3', + lightpink: '#FFB6C1', + lightsalmon: '#FFA07A', + lightseagreen: '#20B2AA', + lightskyblue: '#87CEFA', + lightslategray: '#778899', + lightslategrey: '#778899', + lightsteelblue: '#B0C4DE', + lightyellow: '#FFFFE0', + limegreen: '#32CD32', + linen: '#FAF0E6', + magenta: '#FF00FF', + mediumaquamarine: '#66CDAA', + mediumblue: '#0000CD', + mediumorchid: '#BA55D3', + mediumpurple: '#9370DB', + mediumseagreen: '#3CB371', + mediumslateblue: '#7B68EE', + mediumspringgreen: '#00FA9A', + mediumturquoise: '#48D1CC', + mediumvioletred: '#C71585', + midnightblue: '#191970', + mintcream: '#F5FFFA', + mistyrose: '#FFE4E1', + moccasin: '#FFE4B5', + navajowhite: '#FFDEAD', + oldlace: '#FDF5E6', + olivedrab: '#6B8E23', + orange: '#FFA500', + orangered: '#FF4500', + orchid: '#DA70D6', + palegoldenrod: '#EEE8AA', + palegreen: '#98FB98', + paleturquoise: '#AFEEEE', + palevioletred: '#DB7093', + papayawhip: '#FFEFD5', + peachpuff: '#FFDAB9', + peru: '#CD853F', + pink: '#FFC0CB', + plum: '#DDA0DD', + powderblue: '#B0E0E6', + rosybrown: '#BC8F8F', + royalblue: '#4169E1', + saddlebrown: '#8B4513', + salmon: '#FA8072', + sandybrown: '#F4A460', + seagreen: '#2E8B57', + seashell: '#FFF5EE', + sienna: '#A0522D', + skyblue: '#87CEEB', + slateblue: '#6A5ACD', + slategray: '#708090', + slategrey: '#708090', + snow: '#FFFAFA', + springgreen: '#00FF7F', + steelblue: '#4682B4', + tan: '#D2B48C', + thistle: '#D8BFD8', + tomato: '#FF6347', + turquoise: '#40E0D0', + violet: '#EE82EE', + wheat: '#F5DEB3', + whitesmoke: '#F5F5F5', + yellowgreen: '#9ACD32' + }; + + function getRgbHslContent(styleString) { + var start = styleString.indexOf('(', 3); + var end = styleString.indexOf(')', start + 1); + var parts = styleString.substring(start + 1, end).split(','); + // add alpha if needed + if (parts.length != 4 || styleString.charAt(3) != 'a') { + parts[3] = 1; + } + return parts; + } + + function percent(s) { + return parseFloat(s) / 100; + } + + function clamp(v, min, max) { + return Math.min(max, Math.max(min, v)); + } + + function hslToRgb(parts){ + var r, g, b, h, s, l; + h = parseFloat(parts[0]) / 360 % 360; + if (h < 0) + h++; + s = clamp(percent(parts[1]), 0, 1); + l = clamp(percent(parts[2]), 0, 1); + if (s == 0) { + r = g = b = l; // achromatic + } else { + var q = l < 0.5 ? l * (1 + s) : l + s - l * s; + var p = 2 * l - q; + r = hueToRgb(p, q, h + 1 / 3); + g = hueToRgb(p, q, h); + b = hueToRgb(p, q, h - 1 / 3); + } + + return '#' + decToHex[Math.floor(r * 255)] + + decToHex[Math.floor(g * 255)] + + decToHex[Math.floor(b * 255)]; + } + + function hueToRgb(m1, m2, h) { + if (h < 0) + h++; + if (h > 1) + h--; + + if (6 * h < 1) + return m1 + (m2 - m1) * 6 * h; + else if (2 * h < 1) + return m2; + else if (3 * h < 2) + return m1 + (m2 - m1) * (2 / 3 - h) * 6; + else + return m1; + } + + var processStyleCache = {}; + + function processStyle(styleString) { + if (styleString in processStyleCache) { + return processStyleCache[styleString]; + } + + var str, alpha = 1; + + styleString = String(styleString); + if (styleString.charAt(0) == '#') { + str = styleString; + } else if (/^rgb/.test(styleString)) { + var parts = getRgbHslContent(styleString); + var str = '#', n; + for (var i = 0; i < 3; i++) { + if (parts[i].indexOf('%') != -1) { + n = Math.floor(percent(parts[i]) * 255); + } else { + n = +parts[i]; + } + str += decToHex[clamp(n, 0, 255)]; + } + alpha = +parts[3]; + } else if (/^hsl/.test(styleString)) { + var parts = getRgbHslContent(styleString); + str = hslToRgb(parts); + alpha = parts[3]; + } else { + str = colorData[styleString] || styleString; + } + return processStyleCache[styleString] = {color: str, alpha: alpha}; + } + + var DEFAULT_STYLE = { + style: 'normal', + variant: 'normal', + weight: 'normal', + size: 12, //10 + family: '微软雅黑' //'sans-serif' + }; + + // Internal text style cache + var fontStyleCache = {}; + + function processFontStyle(styleString) { + if (fontStyleCache[styleString]) { + return fontStyleCache[styleString]; + } + + var el = document.createElement('div'); + var style = el.style; + var fontFamily; + try { + style.font = styleString; + fontFamily = style.fontFamily.split(',')[0]; + } catch (ex) { + // Ignore failures to set to invalid font. + } + + return fontStyleCache[styleString] = { + style: style.fontStyle || DEFAULT_STYLE.style, + variant: style.fontVariant || DEFAULT_STYLE.variant, + weight: style.fontWeight || DEFAULT_STYLE.weight, + size: style.fontSize || DEFAULT_STYLE.size, + family: fontFamily || DEFAULT_STYLE.family + }; + } + + function getComputedStyle(style, element) { + var computedStyle = {}; + + for (var p in style) { + computedStyle[p] = style[p]; + } + + // Compute the size + var canvasFontSize = parseFloat(element.currentStyle.fontSize), + fontSize = parseFloat(style.size); + + if (typeof style.size == 'number') { + computedStyle.size = style.size; + } else if (style.size.indexOf('px') != -1) { + computedStyle.size = fontSize; + } else if (style.size.indexOf('em') != -1) { + computedStyle.size = canvasFontSize * fontSize; + } else if(style.size.indexOf('%') != -1) { + computedStyle.size = (canvasFontSize / 100) * fontSize; + } else if (style.size.indexOf('pt') != -1) { + computedStyle.size = fontSize / .75; + } else { + computedStyle.size = canvasFontSize; + } + + // Different scaling between normal text and VML text. This was found using + // trial and error to get the same size as non VML text. + //computedStyle.size *= 0.981; + + return computedStyle; + } + + function buildStyle(style) { + return style.style + ' ' + style.variant + ' ' + style.weight + ' ' + + style.size + "px '" + style.family + "'"; + } + + var lineCapMap = { + 'butt': 'flat', + 'round': 'round' + }; + + function processLineCap(lineCap) { + return lineCapMap[lineCap] || 'square'; + } + + function createShapeAttr() { + return { + filled: false, + stroked: false, + + path: '', + fillStyle: null, + strokeStyle: null, + + globalAlpha: 1, + lineCap: 'butt', + lineJoin: 'miter', + lineWidth: 1, + miterlimit: Z * 1, + + x: 0, + y: 0 + }; + } + + function copyShapeAttr(o1, o2) { + o1.path = o2.path; + + o1.fillStyle = o2.fillStyle; + + o1.globalAlpha = o2.globalAlpha; + + // PENDING When shape changed from not stroked to stroked + if (o2.stroked) { + o1.strokeStyle = o2.strokeStyle; + o1.lineCap = o2.lineCap; + o1.lineJoin = o2.lineJoin; + o1.lineWidth = o2.lineWidth; + o1.miterlimit = o2.miterlimit; + } + + o1.x = o2.x; + o1.y = o2.y; + + o1.filled = o2.filled; + o1.stroked = o2.stroked; + } + + function createTextAttr() { + var attr = createShapeAttr(); + attr.text = ''; + attr.font = '12px 微软雅黑'; + attr.textAlign = 'left'; + attr.textBaseline = 'alphabetic'; + attr.offX = 0; + attr.offY = 0; + attr.maxWidth = 0; + + return attr; + } + + function copyTextAttr(o1, o2) { + copyShapeAttr(o1, o2); + + o1.text = o2.text; + o1.font = o2.font; + o1.textAlign = o2.textAlign; + o1.textBaseline = o2.textBaseline; + o1.offX = o2.offX; + o1.offY = o2.offY; + o1.maxWidth = o2.maxWidth; + } + + function createImageAttr() { + return { + image: '', + // position after tranformed + x: 0, + y: 0, + padding: '', + skewM: '', + cropped: false, + width: 0, + height: 0, + globalAlpha: 1 + }; + } + + function copyImageAttr(o1, o2) { + o1.image = o2.image; + o1.x = o2.x; + o1.y = o2.y; + o1.width = o2.width; + o1.height = o2.height; + o1.globalAlpha = o2.globalAlpha; + + if (o2.skewed) { + o1.skewM = o2.skewM; + o1.padding = o2.padding; + } + + if (o2.cropped) { + o1.cropWidth = o2.cropWidth; + o1.cropHeight = o2.cropHeight; + o1.cropFilter = o2.cropFilter; + } + + o1.cropped = o2.cropped; + o1.skewed = o2.skewed; + } + + /** + * Virtual shape dom is created by stroke and fill operation. + * It will be cached in Context2D object. And created only if needed when redrawing + * @author https://github.com/pissang/ + */ + function ShapeVirtualDom_() { + // this.rootEl_ = null; + // this.strokeEl_ = null; + // this.fillEl_ = null; + + this.attr_ = createShapeAttr(); + + this.attrPrev_ = {}; + } + + ShapeVirtualDom_.prototype.attachTo = function (el) { + if (!this.attached_) { + var p = this.rootEl_.parentNode; + if (p !== el) { + el.appendChild(this.rootEl_); + } + } + this.attached_ = true; + } + + ShapeVirtualDom_.prototype.detach = function () { + if (this.attached_) { + var p = this.rootEl_.parentNode; + if (p) { + p.removeChild(this.rootEl_); + } + } + this.attached_ = false; + } + + ShapeVirtualDom_.prototype.getElement = function (path) { + if (!this.rootEl_) { + this.createShapeEl_(path); + } + var attr_ = this.attr_; + attr_.path = path; + attr_.filled = false; + attr_.stroked = false; + + return this.rootEl_; + }; + + ShapeVirtualDom_.prototype.createShapeEl_ = function (path) { + + var W = 10; + var H = 10; + + var rootEl_ = createVMLElement('shape'); + rootEl_.style.cssText = ['position:absolute;width:', W, 'px;height:', H, 'px'].join(''); + rootEl_.coordorigin = '0 0'; + rootEl_.coordsize = Z * W + ' ' + Z * H; + + rootEl_.filled = 'false'; + rootEl_.stroked = 'false'; + + this.rootEl_ = rootEl_; + }; + + ShapeVirtualDom_.prototype.isFilled = function () { + return this.attr_.filled; + }; + + ShapeVirtualDom_.prototype.isStroked = function () { + return this.attr_.stroked; + }; + + ShapeVirtualDom_.prototype.fill = function(ctx, min, max) { + var attr_ = this.attr_; + + attr_.filled = true; + attr_.fillStyle = ctx.fillStyle; + attr_.globalAlpha = ctx.globalAlpha; + + attr_.x = ctx.x_; + attr_.y = ctx.y_; + + if (ctx.fillStyle instanceof CanvasGradient_) { + attr_.m_ = ctx.m_; + attr_.scaleX = ctx.scaleX_; + attr_.scaleY = ctx.scaleY_; + attr_.min = min; + attr_.max = max; + } else if (ctx.fillStyle instanceof CanvasPattern_) { + attr_.scaleX = ctx.scaleX_; + attr_.scaleY = ctx.scaleY_; + attr_.min = min; + attr_.max = max; + } + }; + + ShapeVirtualDom_.prototype.stroke = function (ctx) { + var attr_ = this.attr_; + + attr_.stroked = true; + attr_.globalAlpha = ctx.globalAlpha; + attr_.lineCap = ctx.lineCap; + attr_.lineJoin = ctx.lineJoin; + attr_.lineWidth = ctx.lineWidth * ctx.lineScale_; + attr_.miterlimit = ctx.miterlimit; + attr_.strokeStyle = ctx.strokeStyle; + + attr_.x = ctx.x_; + attr_.y = ctx.y_; + } + + ShapeVirtualDom_.prototype.doFill_ = function () { + var attr_ = this.attr_; + var attrPrev_ = this.attrPrev_; + if (attr_.filled !== attrPrev_.filled) { + var rootEl_ = this.rootEl_; + if (attr_.filled) { + rootEl_.filled = 'true'; + if (!this.fillEl_) { + this.fillEl_ = createVMLElement('fill'); + // PENDING + // Set default attribute ? + } + rootEl_.appendChild(this.fillEl_); + } else { + rootEl_.filled = 'false'; + if (this.fillEl_) { + rootEl_.removeChild(this.fillEl_); + } + } + } + if (!attr_.filled) { + return; + } + + var fillEl_ = this.fillEl_; + + var fillStyle = attr_.fillStyle; + + if ( + fillStyle !== attrPrev_.fillStyle || + attr_.globalAlpha !== attrPrev_.globalAlpha + ) { + // TODO Canvas gradient and pattern still not be optimized + // There problem when canvas gradient add color stop dynamically + // + // Text fill doesn't support Gradient or Pattern + if ((fillStyle instanceof CanvasGradient_) && attr_.min) { + // TODO: Gradients transformed with the transformation matrix. + var angle = 0; + var focus = {x: 0, y: 0}; + + // additional offset + var shift = 0; + // scale factor for offset + var expansion = 1; + + var scaleX = attr_.scaleX_; + var scaleY = attr_.scaleY_; + var min = attr_.min; + var max = attr_.max; + var width = max.x - min.x; + var height = max.y - min.y; + + if (fillStyle.type_ == 'gradient') { + var x0 = fillStyle.x0_ / scaleX; + var y0 = fillStyle.y0_ / scaleY; + var x1 = fillStyle.x1_ / scaleX; + var y1 = fillStyle.y1_ / scaleY; + var p0 = getCoords(ctx, x0, y0); + var p1 = getCoords(ctx, x1, y1); + var dx = p1.x - p0.x; + var dy = p1.y - p0.y; + angle = Math.atan2(dx, dy) * 180 / Math.PI; + + // The angle should be a non-negative number. + if (angle < 0) { + angle += 360; + } + + // Very small angles produce an unexpected result because they are + // converted to a scientific notation string. + if (angle < 1e-6) { + angle = 0; + } + } else { + var p0 = getCoords(ctx, fillStyle.x0_, fillStyle.y0_); + focus = { + x: (p0.x - min.x) / width, + y: (p0.y - min.y) / height + }; + + width /= scaleX * Z; + height /= scaleY * Z; + var dimension = m.max(width, height); + shift = 2 * fillStyle.r0_ / dimension; + expansion = 2 * fillStyle.r1_ / dimension - shift; + } + + // We need to sort the color stops in ascending order by offset, + // otherwise IE won't interpret it correctly. + var stops = fillStyle.colors_; + stops.sort(function(cs1, cs2) { + return cs1.offset - cs2.offset; + }); + + var length = stops.length; + var color1 = stops[0].color; + var color2 = stops[length - 1].color; + var opacity1 = stops[0].alpha * attr_.globalAlpha; + var opacity2 = stops[length - 1].alpha * attr_.globalAlpha; + + var colors = []; + for (var i = 0; i < length; i++) { + var stop = stops[i]; + colors.push(stop.offset * expansion + shift + ' ' + stop.color); + } + + fillEl_.type = fillStyle.type_; + fillEl_.method = 'none'; + fillEl_.focus = '100%'; + fillEl_.color = color1; + fillEl_.color2 = color2; + fillEl_.colors = colors.join(','); + fillEl_.opacity = opacity2; + fillEl_.setAttribute('g_o_:opacity2', opacity1); + fillEl_.angle = angle; + fillEl_.focusposition = focus.x + ',' + focus.y; + } + else if ((fillStyle instanceof CanvasPattern_) && attr_.min) { + if (width && height) { + var deltaLeft = -attr_.min.x; + var deltaTop = -attr_.min.y; + fillEl_.position = deltaLeft / width * scaleX * scaleX + ',' + + deltaTop / height * scaleY * scaleY; + fillEl_.type = 'tile'; + fillEl_.src = fillStyle.src_; + } + } + else { + var a = processStyle(fillStyle); + var color = a.color; + var opacity = a.alpha * attr_.globalAlpha; + fillEl_.color = color; + if (opacity < 1) { + fillEl_.opacity = opacity; + } + } + } + }; + + ShapeVirtualDom_.prototype.doStroke_ = function () { + var attr_ = this.attr_; + var attrPrev_ = this.attrPrev_; + if (attr_.stroked !== attrPrev_.stroked) { + var rootEl_ = this.rootEl_; + if (attr_.stroked) { + if (!this.strokeEl_) { + this.strokeEl_ = createVMLElement('stroke'); + // PENDING + // Set default attribute ? + } + rootEl_.stroked = 'true'; + rootEl_.appendChild(this.strokeEl_); + } else { + rootEl_.stroked = 'false'; + if (this.strokeEl_) { + rootEl_.removeChild(this.strokeEl_); + } + } + } + + if (!attr_.stroked) { + return; + } + + if ( + attr_.strokeStyle !== attrPrev_.strokeStyle || + attr_.globalAlpha !== attrPrev_.globalAlpha || + attr_.lineWidth !== attrPrev_.lineWidth + ) { + var a = processStyle(attr_.strokeStyle); + var opacity = a.alpha * attr_.globalAlpha; + var lineWidth = attr_.lineWidth; + // VML cannot correctly render a line if the width is less than 1px. + // In that case, we dilute the color to make the line look thinner. + if (lineWidth < 1) { + opacity *= lineWidth; + } + if (opacity < 1) { + this.strokeEl_.opacity = opacity; + } + this.strokeEl_.color = a.color; + } + if (attr_.lineJoin !== attrPrev_.lineJoin) { + this.strokeEl_.joinstyle = attr_.lineJoin; + } + if (attr_.miterLimit !== attrPrev_.miterLimit) { + this.strokeEl_.miterlimit = attr_.miterLimit; + } + if (attr_.lineCap !== attrPrev_.lineCap) { + this.strokeEl_.endcap = processLineCap(attr_.lineCap); + } + if (lineWidth !== attrPrev_.lineWidth) { + this.strokeEl_.weight = lineWidth + 'px'; + } + }; + + ShapeVirtualDom_.prototype.flush = function (ctx) { + var attr_ = this.attr_; + var attrPrev_ = this.attrPrev_; + if (attr_.x !== attrPrev_.x) { + this.rootEl_.style.left = attr_.x + 'px'; + } + if (attr_.y !== attrPrev_.y) { + this.rootEl_.style.top = attr_.y + 'px'; + } + if (attr_.path !== attrPrev_.path) { + this.rootEl_.path = attr_.path; + } + this.doFill_(); + this.doStroke_(); + + copyShapeAttr(attrPrev_, attr_); + } + + /** + * Virtual text dom is created by fillText and strokeText operation. + * It will be cached in Context2D object. And created only if needed when redrawing + * @author https://github.com/pissang/ + */ + function TextVirtualDom_() { + // this.rootEl_ = null; + // this.skewEl_ = null; + // this.textPathEl_ = null; + // this.simpleRootEl_ = null; + + this.attr_ = createTextAttr(); + this.attrPrev_ = {}; + } + + TextVirtualDom_.prototype.getElement = function (ctx, text, x, y, maxWidth, stroke) { + if (!this.rootEl_) { + this.createEl_(); + } + var m_ = ctx.m_; + + var attr_ = this.attr_; + attr_.text = text; + + attr_.sx = x; + attr_.sy = y; + attr_.maxWidth = maxWidth; + attr_.textAlign = ctx.textAlign; + attr_.textBaseline = ctx.textBaseline; + + attr_.stroked = !!stroke; + attr_.filled = !stroke; + + var fontStyle = getComputedStyle(processFontStyle(ctx.font), + ctx.element_); + var fontStyleString = buildStyle(fontStyle); + + attr_.font = fontStyleString; + + var offset = {x: 0, y: 0}; + // 1.75 is an arbitrary number, as there is no info about the text baseline + switch (ctx.textBaseline) { + case 'hanging': + case 'top': + offset.y = fontStyle.size / 1.75; + break; + case 'middle': + break; + default: + case null: + case 'alphabetic': + case 'ideographic': + case 'bottom': + offset.y = -fontStyle.size / 2.25; + break; + } + + var d = getCoords(ctx, x + offset.x, y + offset.y); + attr_.offX = d.x; + attr_.offY = d.y; + // attr_.skewed = isNotAroundZero(m_[0] - 1) || isNotAroundZero(m_[1]) || + // isNotAroundZero(m_[3] - 1) || isNotAroundZero(m_[2]) + attr_.skewM = m_[0][0].toFixed(3) + ',' + m_[1][0].toFixed(3) + ',' + + m_[0][1].toFixed(3) + ',' + m_[1][1].toFixed(3); + + if (stroke) { + attr_.globalAlpha = ctx.globalAlpha; + attr_.lineCap = ctx.lineCap; + attr_.lineJoin = ctx.lineJoin; + attr_.lineWidth = ctx.lineWidth * ctx.lineScale_; + attr_.miterlimit = ctx.miterlimit; + attr_.strokeStyle = ctx.strokeStyle; + } else { + attr_.fillStyle = ctx.fillStyle; + attr_.globalAlpha = ctx.globalAlpha; + } + // TODO It is strange that flush after the rootEl has been appended to document + // SkewOffset like '10, 10'(which one item is not zero) will cause the shape disappeared. + this.flush(ctx); + + return this.rootEl_; + }; + + TextVirtualDom_.prototype.createEl_ = function () { + var W = 10; + var H = 10; + this.rootEl_ = createVMLElement('line'); + var rootEl_ = this.rootEl_; + rootEl_.coordsize = Z * W + ' ' + Z * H; + rootEl_.coordorigin = '0 0'; + rootEl_.style.cssText = 'position:absolute;width:1px;height:1px'; + rootEl_.stroked = 'false'; + rootEl_.filled = 'false'; + }; + + TextVirtualDom_.prototype.flush = function (ctx) { + var m_ = ctx.m_; + var delta = 1000; + var left = 0; + var right = delta; + var attr_ = this.attr_; + var attrPrev_ = this.attrPrev_; + var rootEl_ = this.rootEl_; + + if (!this.skewEl_) { + this.skewEl_ = createVMLElement('skew'); + this.skewEl_.on = 't'; + this.textPathEl_ = createVMLElement('textpath'); + this.pathEl_ = createVMLElement('path'); + this.pathEl_.textpathok = 'true'; + this.textPathEl_.on = 'true'; + + rootEl_.appendChild(this.skewEl_); + rootEl_.appendChild(this.pathEl_); + rootEl_.appendChild(this.textPathEl_); + } + + var fontStyle = getComputedStyle(processFontStyle(this.attr_.font), + ctx.element_); + if ( + attr_.font !== attrPrev_.font || + attr_.text !== attrPrev_.text + ) { + this.textPathEl_.string = encodeHtmlAttribute(attr_.text); + this.textPathEl_.style.font = encodeHtmlAttribute(attr_.font); + } + + if (attr_.textAlign !== attrPrev_.textAlign) { + var elementStyle = ctx.element_.currentStyle; + var textAlign = attr_.textAlign.toLowerCase(); + switch (textAlign) { + case 'left': + case 'center': + case 'right': + break; + case 'end': + textAlign = elementStyle.direction == 'ltr' ? 'right' : 'left'; + break; + case 'start': + textAlign = elementStyle.direction == 'rtl' ? 'right' : 'left'; + break; + default: + textAlign = 'left'; + } + switch(textAlign) { + case 'right': + left = delta; + right = 0.05; + break; + case 'center': + left = right = delta / 2; + break; + } + rootEl_.from = -left + ' 0'; + rootEl_.to = right + ' 0.05'; + this.skewEl_.origin = left + ' 0'; + this.textPathEl_.style['v-text-align'] = textAlign; + } + + // if (attr_.skewed || stroke) { + if (attr_.skewM !== attrPrev_.skewM) { + this.skewEl_.matrix = attr_.skewM + ',0,0'; + } + + if (attr_.offX !== attrPrev_.offX || + attr_.offY !== attrPrev_.offY + ) { + var skewOffset = mr(attr_.offX / Z) + ',' + mr(attr_.offY / Z); + this.skewEl_.offset = skewOffset; + } + + if (attr_.stroked) { + this.doStroke_(); + } else { + this.doFill_(); + } + + copyTextAttr(attrPrev_, attr_); + + // } else { + // if (!this.simpleRootEl_) { + // this.simpleRootEl_ = document.createElement('div'); + // this.simpleRootEl_.style.position = 'absolute'; + // } + // this.simpleRootEl_.style.font = encodeHtmlAttribute(fontStyleString); + + // var a = processStyle(ctx.fillStyle); + // var color = a.color; + // var opacity = a.alpha * ctx.globalAlpha; + // this.simpleRootEl_.style.color = color; + // if (opacity < 1) { + // this.simpleRootEl_.style.filter = 'alpha(opacity=' + mr(opacity * 100) +')'; + // } + + // this.simpleRootEl_.innerHTML = text; + + // switch (ctx.textBaseline) { + // case 'hanging': + // case 'top': + // this.simpleRootEl_.style.top = m_[2][1] + y + 'px'; + // break; + // case 'middle': + // // TODO + // this.simpleRootEl_.style.top = m_[2][1] + y - fontStyle.size / 2.25 + 'px'; + // break; + // default: + // case null: + // case 'alphabetic': + // case 'ideographic': + // case 'bottom': + // // + // this.simpleRootEl_.style.bottom = ctx.element_.clientHeight - m_[2][1] - y + 'px'; + // break; + // } + + // switch(textAlign) { + // case 'right': + // this.simpleRootEl_.style.right = ctx.element_.clientWidth - m_[2][0] - x + 'px'; + // break; + // case 'center': + // // TODO + // this.simpleRootEl_.style.left = m_[2][0] + x - fontStyle.size / 4.5 * text.length + 'px'; + // break; + // case 'left': + // this.simpleRootEl_.style.left = m_[2][0] + x + 'px'; + // break; + // } + // return this.simpleRootEl_; + // } + } + + TextVirtualDom_.prototype.doFill_ = ShapeVirtualDom_.prototype.doFill_; + TextVirtualDom_.prototype.doStroke_ = ShapeVirtualDom_.prototype.doStroke_; + TextVirtualDom_.prototype.attachTo = ShapeVirtualDom_.prototype.attachTo; + TextVirtualDom_.prototype.detach = ShapeVirtualDom_.prototype.detach; + + /** + * Virtual image dom is created by drawImage operation. + * It will be cached in Context2D object. And created only if needed when redrawing + * @author https://github.com/pissang/ + * + * TODO Image cropping testing + */ + function ImageVirtualDom_() { + // this.rootEl_ = null; + // this.cropEl_ = null; + // this.imageEl_ = null; + // this.groupEl_ = null; + + this.attr_ = createImageAttr(); + + this.attrPrev_ = {}; + }; + + ImageVirtualDom_.prototype.getElement = function (ctx, image, var_args) { + var dx, dy, dw, dh, sx, sy, sw, sh; + + // to find the original width we overide the width and height + var oldRuntimeWidth = image.runtimeStyle.width; + var oldRuntimeHeight = image.runtimeStyle.height; + var m_ = ctx.m_; + image.runtimeStyle.width = 'auto'; + image.runtimeStyle.height = 'auto'; + + // get the original size + var w = image.width; + var h = image.height; + + // and remove overides + image.runtimeStyle.width = oldRuntimeWidth; + image.runtimeStyle.height = oldRuntimeHeight; + + var args = Array.prototype.slice.call(arguments, 1); + var attr_ = this.attr_; + attr_.globalAlpha = ctx.globalAlpha; + + var scaleX = ctx.scaleX_; + var scaleY = ctx.scaleY_; + if (args.length == 3) { + dx = args[1]; + dy = args[2]; + sx = sy = 0; + sw = dw = w; + sh = dh = h; + } else if (args.length == 5) { + dx = args[1]; + dy = args[2]; + dw = args[3]; + dh = args[4]; + sx = sy = 0; + sw = w; + sh = h; + } else if (args.length == 9) { + sx = args[1]; + sy = args[2]; + sw = args[3]; + sh = args[4]; + dx = args[5]; + dy = args[6]; + dw = args[7]; + dh = args[8]; + } else { + throw Error('Invalid number of arguments'); + } + + // Have rotation + attr_.skewed = m_[0][1] || m_[1][0]; + + if (attr_.skewed) { + var d = getCoords(ctx, dx, dy); + attr_.x = d.x; + attr_.y = d.y; + var filter = []; + filter.push('M11=', m_[0][0] / scaleX, ',', + 'M12=', m_[1][0] / scaleY, ',', + 'M21=', m_[0][1] / scaleX, ',', + 'M22=', m_[1][1] / scaleY, ',', + 'Dx=', d.x, ',', + 'Dy=', d.y, ''); + attr_.skewM = filter.join(''); + + // Bounding box calculation (need to minimize displayed area so that + // filters don't waste time on unused pixels. + var max = d; + var c2 = getCoords(ctx, dx + dw, dy); + var c3 = getCoords(ctx, dx, dy + dh); + var c4 = getCoords(ctx, dx + dw, dy + dh); + + max.x = m.max(max.x, c2.x, c3.x, c4.x); + max.y = m.max(max.y, c2.y, c3.y, c4.y); + + attr_.padding = [0, Math.max(mr(max.x / Z), 0) + 'px', Math.max(mr(max.y / Z), 0) + 'px', 0].join(' '); + } else { + attr_.x = dx * scaleX + ctx.x_; + attr_.y = dy * scaleY + ctx.y_; + } + + attr_.cropped = sx || sy; + if (attr_.cropped) { + attr_.cropWidth = Math.ceil((dw + sx * dw / sw) * scaleX); + attr_.cropHeight = Math.ceil((dh + sy * dh / sh) * scaleY); + attr_.cropFilter = 'progid:DxImageTransform.Microsoft.Matrix(Dx=' + + -dw / sw * scaleX * sx + ',Dy=' + -dh / sh * scaleY * sy + ')'; + } + + attr_.width = scaleX * dw / sw * w; + attr_.height = scaleY * dh / sh * h; + + attr_.image = image.src; + + if (!this.imageEl_) { + // NOTES + // Matrix of rootDom will not work if imageDom.style.position = 'absolute' + this.imageEl_ = document.createElement('img'); + } + + if (!(attr_.skewed || attr_.cropped)) { + this.rootEl_ = this.imageEl_; + } else if (attr_.skewed) { + if (!this.groupEl_) { + this.createGroupEl_(); + } + this.rootEl_ = this.groupEl_; + } else { + if (!this.cropEl_) { + this.cropEl_ = document.createElement('div'); + this.cropEl_.style.cssText = 'position:absolute; overflow:hidden;'; + } + this.rootEl_ = this.cropEl_; + } + + this.flush(ctx); + return this.rootEl_; + }; + + ImageVirtualDom_.prototype.createGroupEl_ = function () { + var W = 10; + var H = 10; + + // For some reason that I've now forgotten, using divs didn't work + this.groupEl_ = createVMLElement('group'); + this.groupEl_.coordsize = Z * W + ' ' + Z * H; + this.groupEl_.coordorigin = '0 0'; + + this.groupEl_.style.cssText = ['position:absolute;width:', W, 'px;height:', H, 'px'].join(''); + } + + ImageVirtualDom_.prototype.flush = function (ctx) { + var attr_ = this.attr_; + var attrPrev_ = this.attrPrev_; + var w2 = attr_.sw / 2; + var h2 = attr_.sh / 2; + + var imageEl_ = this.imageEl_; + + // If filters are necessary (rotation exists), create them + // filters are bog-slow, so only create them if abbsolutely necessary + // The following check doesn't account for skews (which don't exist + // in the canvas spec (yet) anyway. + if (!attr_.skewed && !attr_.cropped) { + if (attr_.x !== attrPrev_.x) { + imageEl_.style.left = attr_.x + 'px'; + } + if (attr_.y !== attrPrev_.y) { + imageEl_.style.top = attr_.y + 'px'; + } + if (!attrPrev_.skewed) { + imageEl_.style.position = 'absolute'; + } else { + imageEl_.style.position = 'static'; + } + } else if (attr_.skewed) { + var groupEl_ = this.groupEl_; + if (attr_.padding !== attrPrev_.padding) { + groupEl_.style.padding = attr_.padding; + } + + if (attr_.skewM !== attrPrev_.skewM) { + groupEl_.style.filter = 'progid:DXImageTransform.Microsoft.Matrix(' + + attr_.skewM + ", SizingMethod='clip')"; + } + + if (attr_.cropped) { + if (!attrPrev_.cropped) { + groupEl_.appendChild(this.cropEl_); + this.cropEl_.appendChild(imageEl_); + } + } else { + if (!attrPrev_.skewed) { + groupEl_.appendChild(imageEl_); + } + } + } else if (attr_.cropped) { + if (!attrPrev_.cropped) { + this.cropEl_.appendChild(imageEl_); + } + } + + // Draw a special cropping div if needed + if (attr_.cropped) { + var groupEl_ = this.groupEl_; + if (attr_.cropWidth !== attrPrev_.cropWidth) { + this.cropEl_.style.width = attr_.cropWidth + 'px'; + } + if (attr_.cropHeight !== attrPrev_.cropHeight) { + this.cropEl_.style.height = attr_.cropHeight + 'px'; + } + if (attr_.filter !== attrPrev_.filter) { + this.cropEl_.style.filter = attr_.filter; + } + } + + if (attr_.width !== attrPrev_.width) { + imageEl_.style.width = attr_.width + 'px'; + } + if (attr_.height !== attrPrev_.height) { + imageEl_.style.height = attr_.height + 'px'; + } + + if (attr_.image !== attrPrev_.image) { + imageEl_.src = attr_.image; + } + if (attr_.globalAlpha !== attrPrev_.globalAlpha) { + if (imageEl_.style.globalAlpha < 1) { + imageEl_.style.filter = 'alpha(opacity=' + mr(attr_.globalAlpha * 100) +')'; + } else { + imageEl_.style.filter = ''; + } + } + + copyImageAttr(this.attrPrev_, this.attr_); + } + + ImageVirtualDom_.prototype.attachTo = ShapeVirtualDom_.prototype.attachTo; + ImageVirtualDom_.prototype.detach = ShapeVirtualDom_.prototype.detach; + + /** + * This class implements CanvasRenderingContext2D interface as described by + * the WHATWG. + * @param {HTMLElement} canvasElement The element that the 2D context should + * be associated with + */ + function CanvasRenderingContext2D_(canvasElement) { + this.m_ = createMatrixIdentity(); + + this.mStack_ = []; + this.aStack_ = []; + this.currentPath_ = []; + + // NOTES + // http://louisremi.com/2009/03/30/changes-in-vml-for-ie8-or-what-feature-can-the-ie-dev-team-break-for-you-today/ + // It is no longer possible to create a VML element outside of the DOM + // this.fragment_ = document.createDocumentFragment(); + + // Keep current drawed dom. So we can merge fill and stroke in one shape dom + this.currentVirtualDom_ = null; + + // Cache the created dom + this.shapeVDomList_ = []; + this.textVDomList_ = []; + this.imageVDomList_ = []; + + this.nShapeVEl_ = 0; + this.nTextVEl_ = 0; + this.nImageVEl_ = 0; + + // Canvas context properties + this.strokeStyle = '#000'; + this.fillStyle = '#000'; + + this.lineWidth = 1; + this.lineJoin = 'miter'; + this.lineCap = 'butt'; + this.miterLimit = Z * 1; + this.globalAlpha = 1; + // this.font = '10px sans-serif'; + this.font = '12px 微软雅黑'; // 决定还是改这吧,影响代价最小 + this.textAlign = 'left'; + this.textBaseline = 'alphabetic'; + this.canvas = canvasElement; + + var cssText = 'width:' + canvasElement.clientWidth + 'px;height:' + + canvasElement.clientHeight + 'px;overflow:hidden;position:absolute'; + var el = canvasElement.ownerDocument.createElement('div'); + el.style.cssText = cssText; + canvasElement.appendChild(el); + + var overlayEl = el.cloneNode(false); + // Use a non transparent background. + overlayEl.style.backgroundColor = '#fff'; //red, I don't know why, it work! + overlayEl.style.filter = 'alpha(opacity=0)'; + canvasElement.appendChild(overlayEl); + + this.element_ = el; + this.scaleX_ = 1; + this.scaleY_ = 1; + this.lineScale_ = 1; + + this.ghost_ = document.createElement('div'); + var cssText = 'position:absolute; left:0px; right: 0px; top: 0px; bottom: 0px;'; + this.ghost_.style.cssText = cssText; + + this.element_.appendChild(this.ghost_); + + this.x_ = 0; + this.y_ = 0; + } + + var contextPrototype = CanvasRenderingContext2D_.prototype; + contextPrototype.clearRect = function() { + if (this.textMeasureEl_) { + this.textMeasureEl_.removeNode(true); + this.textMeasureEl_ = null; + } + // var ghost_ = this.ghost_; + // Hide everything + this.ghost_.style.display = 'none'; + // NOTES: Using innerHTML = '' will cause all descendant elements detached + // while (ghost_.firstChild) { + // ghost_.removeChild(ghost_.firstChild); + // } + // NOTES: removeChild in IE8 will not set the parentNode to null + // + // TODO Remove ghost element before change the attributes of children each frame is even more slow + // if (ghost_.parentNode === this.element_) { + // this.element_.removeChild(ghost_); + // } + this.currentVirtualDom_ = null; + + this.nShapeVEl_ = 0; + this.nTextVEl_ = 0; + this.nImageVEl_ = 0; + }; + + contextPrototype.flush = function () { + for (var i = 0; i < this.nShapeVEl_; i++) { + this.shapeVDomList_[i].flush(this); + } + // Show everything + this.ghost_.style.display = 'block'; + + for (var i = this.nShapeVEl_, len = this.shapeVDomList_.length; i < len; i++) { + this.shapeVDomList_[i].detach(); + } + for (var i = this.nImageVEl_, len = this.imageVDomList_.length; i < len; i++) { + this.imageVDomList_[i].detach(); + } + for (var i = this.nTextVEl_, len = this.textVDomList_.length; i < len; i++) { + this.textVDomList_[i].detach(); + } + this.shapeVDomList_.length = this.nShapeVEl_; + this.imageVDomList_.length = this.nImageVEl_; + this.textVDomList_.length = this.nTextVEl_; + + // this.element_.appendChild(this.ghost_); + } + + contextPrototype.beginPath = function() { + // TODO: Branch current matrix so that save/restore has no effect + // as per safari docs. + this.currentPath_ = []; + + this.currentVirtualDom_ = null; + }; + + contextPrototype.moveTo = function(aX, aY) { + var p = getSkewedCoords(this, aX, aY); + p.type = 'moveTo'; + this.currentPath_.push(p); + this.currentX_ = p.x; + this.currentY_ = p.y; + }; + + contextPrototype.lineTo = function(aX, aY) { + var p = getSkewedCoords(this, aX, aY); + p.type = 'lineTo'; + this.currentPath_.push(p); + + this.currentX_ = p.x; + this.currentY_ = p.y; + + this.currentVirtualDom_ = null; + }; + + contextPrototype.bezierCurveTo = function(aCP1x, aCP1y, + aCP2x, aCP2y, + aX, aY) { + var p = getSkewedCoords(this, aX, aY); + var cp1 = getSkewedCoords(this, aCP1x, aCP1y); + var cp2 = getSkewedCoords(this, aCP2x, aCP2y); + bezierCurveTo(this, cp1, cp2, p); + + this.currentVirtualDom_ = null; + }; + + // Helper function that takes the already fixed cordinates. + function bezierCurveTo(self, cp1, cp2, p) { + self.currentPath_.push({ + type: 'bezierCurveTo', + cp1x: cp1.x, + cp1y: cp1.y, + cp2x: cp2.x, + cp2y: cp2.y, + x: p.x, + y: p.y + }); + self.currentX_ = p.x; + self.currentY_ = p.y; + + this.currentVirtualDom_ = null; + } + + contextPrototype.quadraticCurveTo = function(aCPx, aCPy, aX, aY) { + // the following is lifted almost directly from + // http://developer.mozilla.org/en/docs/Canvas_tutorial:Drawing_shapes + + var cp = getSkewedCoords(this, aCPx, aCPy); + var p = getSkewedCoords(this, aX, aY); + + var cp1 = { + x: this.currentX_ + 2.0 / 3.0 * (cp.x - this.currentX_), + y: this.currentY_ + 2.0 / 3.0 * (cp.y - this.currentY_) + }; + var cp2 = { + x: cp1.x + (p.x - this.currentX_) / 3.0, + y: cp1.y + (p.y - this.currentY_) / 3.0 + }; + + bezierCurveTo(this, cp1, cp2, p); + + this.currentVirtualDom_ = null; + }; + + contextPrototype.arc = function(aX, aY, aRadius, + aStartAngle, aEndAngle, aClockwise) { + aRadius *= Z; + var arcType = aClockwise ? 'at' : 'wa'; + + var xStart = aX + mc(aStartAngle) * aRadius - Z2; + var yStart = aY + ms(aStartAngle) * aRadius - Z2; + + var xEnd = aX + mc(aEndAngle) * aRadius - Z2; + var yEnd = aY + ms(aEndAngle) * aRadius - Z2; + + // IE won't render arches drawn counter clockwise if xStart == xEnd. + if (xStart == xEnd && !aClockwise) { + xStart += 0.125; // Offset xStart by 1/80 of a pixel. Use something + // that can be represented in binary + } + + var p = getSkewedCoords(this, aX, aY); + var pStart = getSkewedCoords(this, xStart, yStart); + var pEnd = getSkewedCoords(this, xEnd, yEnd); + + this.currentPath_.push({type: arcType, + x: p.x, + y: p.y, + radius: aRadius, + xStart: pStart.x, + yStart: pStart.y, + xEnd: pEnd.x, + yEnd: pEnd.y}); + + + this.currentVirtualDom_ = null; + }; + + contextPrototype.rect = function(aX, aY, aWidth, aHeight) { + this.moveTo(aX, aY); + this.lineTo(aX + aWidth, aY); + this.lineTo(aX + aWidth, aY + aHeight); + this.lineTo(aX, aY + aHeight); + this.closePath(); + + this.currentVirtualDom_ = null; + }; + + contextPrototype.strokeRect = function(aX, aY, aWidth, aHeight) { + var oldPath = this.currentPath_; + this.beginPath(); + + this.moveTo(aX, aY); + this.lineTo(aX + aWidth, aY); + this.lineTo(aX + aWidth, aY + aHeight); + this.lineTo(aX, aY + aHeight); + this.closePath(); + this.stroke(); + + this.currentPath_ = oldPath; + }; + + contextPrototype.fillRect = function(aX, aY, aWidth, aHeight) { + var oldPath = this.currentPath_; + this.beginPath(); + + this.moveTo(aX, aY); + this.lineTo(aX + aWidth, aY); + this.lineTo(aX + aWidth, aY + aHeight); + this.lineTo(aX, aY + aHeight); + this.closePath(); + this.fill(); + + this.currentPath_ = oldPath; + }; + + contextPrototype.createLinearGradient = function(aX0, aY0, aX1, aY1) { + var gradient = new CanvasGradient_('gradient'); + gradient.x0_ = aX0; + gradient.y0_ = aY0; + gradient.x1_ = aX1; + gradient.y1_ = aY1; + return gradient; + }; + + contextPrototype.createRadialGradient = function(aX0, aY0, aR0, + aX1, aY1, aR1) { + var gradient = new CanvasGradient_('gradientradial'); + gradient.x0_ = aX0; + gradient.y0_ = aY0; + gradient.r0_ = aR0; + gradient.x1_ = aX1; + gradient.y1_ = aY1; + gradient.r1_ = aR1; + return gradient; + }; + contextPrototype.drawImage = function(image, var_args) { + + var vDom = this.imageVDomList_[this.nImageVEl_]; + if (!vDom) { + vDom = new ImageVirtualDom_(); + this.imageVDomList_[this.nImageVEl_] = vDom; + } + this.nImageVEl_++; + var args = Array.prototype.slice.call(arguments); + args.unshift(this); + var el = vDom.getElement.apply(vDom, args); + + vDom.attachTo(this.ghost_); + + this.currentVirtualDom_ = null; + }; + + contextPrototype.stroke = function(aFill) { + if (this.currentVirtualDom_) { + // Simply append fill or stroke dom + if (aFill && !this.currentVirtualDom_.isFilled()) { + this.currentVirtualDom_.fill(this); + } else if (!aFill && !this.currentVirtualDom_.isStroked()) { + this.currentVirtualDom_.stroke(this); + } + + return; + } + + var pathStr = []; + + var min = {x: null, y: null}; + var max = {x: null, y: null}; + + for (var i = 0; i < this.currentPath_.length; i++) { + var p = this.currentPath_[i]; + var c; + + switch (p.type) { + case 'moveTo': + c = p; + pathStr.push(' m ', mr(p.x), ',', mr(p.y)); + break; + case 'lineTo': + pathStr.push(' l ', mr(p.x), ',', mr(p.y)); + break; + case 'close': + pathStr.push(' x '); + p = null; + break; + case 'bezierCurveTo': + pathStr.push(' c ', + mr(p.cp1x), ',', mr(p.cp1y), ',', + mr(p.cp2x), ',', mr(p.cp2y), ',', + mr(p.x), ',', mr(p.y)); + break; + case 'at': + case 'wa': + pathStr.push(' ', p.type, ' ', + mr(p.x - this.scaleX_ * p.radius), ',', + mr(p.y - this.scaleY_ * p.radius), ' ', + mr(p.x + this.scaleX_ * p.radius), ',', + mr(p.y + this.scaleY_ * p.radius), ' ', + mr(p.xStart), ',', mr(p.yStart), ' ', + mr(p.xEnd), ',', mr(p.yEnd)); + break; + } + + // TODO: Following is broken for curves due to + // move to proper paths. + + // Figure out dimensions so we can do gradient fills + // properly + if (p) { + if (min.x == null || p.x < min.x) { + min.x = p.x; + } + if (max.x == null || p.x > max.x) { + max.x = p.x; + } + if (min.y == null || p.y < min.y) { + min.y = p.y; + } + if (max.y == null || p.y > max.y) { + max.y = p.y; + } + } + } + + pathStr = pathStr.join(''); + + var vDom = this.shapeVDomList_[this.nShapeVEl_]; + if (!vDom) { + vDom = new ShapeVirtualDom_(); + this.shapeVDomList_[this.nShapeVEl_] = vDom; + } + this.nShapeVEl_++; + + var shapeEl = vDom.getElement(pathStr, this.x_, this.y_); + aFill ? vDom.fill(this, min, max) : vDom.stroke(this); + + vDom.attachTo(this.ghost_); + + this.currentVirtualDom_ = vDom; + + return shapeEl; + }; + + contextPrototype.fill = function() { + return this.stroke(true); + }; + + contextPrototype.closePath = function() { + this.currentPath_.push({type: 'close'}); + }; + + function getCoords(ctx, aX, aY) { + var m = ctx.m_; + return { + x: Z * (aX * m[0][0] + aY * m[1][0] + m[2][0]) - Z2, + y: Z * (aX * m[0][1] + aY * m[1][1] + m[2][1]) - Z2 + }; + }; + + function getSkewedCoords(ctx, aX, aY) { + var m = ctx.m_; + return { + x: Z * (aX * m[0][0] + aY * m[1][0]) - Z2, + y: Z * (aX * m[0][1] + aY * m[1][1]) - Z2 + }; + } + + contextPrototype.save = function() { + var o = {}; + copyState(this, o); + this.aStack_.push(o); + this.mStack_.push(this.m_); + this.m_ = matrixMultiply(createMatrixIdentity(), this.m_); + }; + + contextPrototype.restore = function() { + if (this.aStack_.length) { + copyState(this.aStack_.pop(), this); + this.m_ = this.mStack_.pop(); + } + }; + + function matrixIsFinite(m) { + return isFinite(m[0][0]) && isFinite(m[0][1]) && + isFinite(m[1][0]) && isFinite(m[1][1]) && + isFinite(m[2][0]) && isFinite(m[2][1]); + } + + function setM(ctx, m, updateLineScale) { + if (!matrixIsFinite(m)) { + return; + } + ctx.m_ = m; + + ctx.scaleX_ = Math.sqrt(m[0][0] * m[0][0] + m[0][1] * m[0][1]); + ctx.scaleY_ = Math.sqrt(m[1][0] * m[1][0] + m[1][1] * m[1][1]); + ctx.x_ = m[2][0]; + ctx.y_ = m[2][1]; + + if (updateLineScale) { + // Get the line scale. + // Determinant of this.m_ means how much the area is enlarged by the + // transformation. So its square root can be used as a scale factor + // for width. + var det = m[0][0] * m[1][1] - m[0][1] * m[1][0]; + ctx.lineScale_ = sqrt(abs(det)); + } + } + + + contextPrototype.translate = function(aX, aY) { + var m1 = [ + [1, 0, 0], + [0, 1, 0], + [aX, aY, 1] + ]; + + setM(this, matrixMultiply(m1, this.m_), false); + }; + + contextPrototype.rotate = function(aRot) { + var c = mc(aRot); + var s = ms(aRot); + + var m1 = [ + [c, s, 0], + [-s, c, 0], + [0, 0, 1] + ]; + + setM(this, matrixMultiply(m1, this.m_), false); + }; + + contextPrototype.scale = function(aX, aY) { + var m1 = [ + [aX, 0, 0], + [0, aY, 0], + [0, 0, 1] + ]; + + setM(this, matrixMultiply(m1, this.m_), true); + }; + + contextPrototype.transform = function(m11, m12, m21, m22, dx, dy) { + var m1 = [ + [m11, m12, 0], + [m21, m22, 0], + [dx, dy, 1] + ]; + + setM(this, matrixMultiply(m1, this.m_), true); + + }; + + contextPrototype.setTransform = function(m11, m12, m21, m22, dx, dy) { + + var m = [ + [m11, m12, 0], + [m21, m22, 0], + [dx, dy, 1] + ]; + + setM(this, m, true); + }; + + /** + * The text drawing function. + * The maxWidth argument isn't taken in account, since no browser supports + * it yet. + */ + contextPrototype.drawText_ = function(text, x, y, maxWidth, stroke) { + + var vDom = this.textVDomList_[this.nTextVEl_]; + if (!vDom) { + vDom = new TextVirtualDom_(); + this.textVDomList_[this.nTextVEl_] = vDom; + } + this.nTextVEl_++; + + var el = vDom.getElement(this, text, x, y, maxWidth, stroke); + + vDom.attachTo(this.ghost_); + + this.currentVirtualDom_ = null; + }; + + contextPrototype.fillText = function(text, x, y, maxWidth) { + this.drawText_(text, x, y, maxWidth, false); + }; + + contextPrototype.strokeText = function(text, x, y, maxWidth) { + this.drawText_(text, x, y, maxWidth, true); + }; + + contextPrototype.measureText = function(text) { + if (!this.textMeasureEl_) { + var s = ''; + this.element_.insertAdjacentHTML('beforeEnd', s); + this.textMeasureEl_ = this.element_.lastChild; + } + var doc = this.element_.ownerDocument; + this.textMeasureEl_.innerHTML = ''; + this.textMeasureEl_.style.font = this.font; + // Don't use innerHTML or innerText because they allow markup/whitespace. + this.textMeasureEl_.appendChild(doc.createTextNode(text)); + return {width: this.textMeasureEl_.offsetWidth}; + }; + + /******** STUBS ********/ + contextPrototype.clip = function() { + // TODO: Implement + }; + + contextPrototype.arcTo = function() { + // TODO: Implement + }; + + contextPrototype.createPattern = function(image, repetition) { + return new CanvasPattern_(image, repetition); + }; + + // Gradient / Pattern Stubs + function CanvasGradient_(aType) { + this.type_ = aType; + this.x0_ = 0; + this.y0_ = 0; + this.r0_ = 0; + this.x1_ = 0; + this.y1_ = 0; + this.r1_ = 0; + this.colors_ = []; + } + + CanvasGradient_.prototype.addColorStop = function(aOffset, aColor) { + aColor = processStyle(aColor); + this.colors_.push({offset: aOffset, + color: aColor.color, + alpha: aColor.alpha}); + }; + + function CanvasPattern_(image, repetition) { + assertImageIsValid(image); + switch (repetition) { + case 'repeat': + case null: + case '': + this.repetition_ = 'repeat'; + break + case 'repeat-x': + case 'repeat-y': + case 'no-repeat': + this.repetition_ = repetition; + break; + default: + throwException('SYNTAX_ERR'); + } + + this.src_ = image.src; + this.width_ = image.width; + this.height_ = image.height; + } + + function throwException(s) { + throw new DOMException_(s); + } + + function assertImageIsValid(img) { + if (!img || img.nodeType != 1 || img.tagName != 'IMG') { + throwException('TYPE_MISMATCH_ERR'); + } + if (img.readyState != 'complete') { + throwException('INVALID_STATE_ERR'); + } + } + + function DOMException_(s) { + this.code = this[s]; + this.message = s +': DOM Exception ' + this.code; + } + var p = DOMException_.prototype = new Error; + p.INDEX_SIZE_ERR = 1; + p.DOMSTRING_SIZE_ERR = 2; + p.HIERARCHY_REQUEST_ERR = 3; + p.WRONG_DOCUMENT_ERR = 4; + p.INVALID_CHARACTER_ERR = 5; + p.NO_DATA_ALLOWED_ERR = 6; + p.NO_MODIFICATION_ALLOWED_ERR = 7; + p.NOT_FOUND_ERR = 8; + p.NOT_SUPPORTED_ERR = 9; + p.INUSE_ATTRIBUTE_ERR = 10; + p.INVALID_STATE_ERR = 11; + p.SYNTAX_ERR = 12; + p.INVALID_MODIFICATION_ERR = 13; + p.NAMESPACE_ERR = 14; + p.INVALID_ACCESS_ERR = 15; + p.VALIDATION_ERR = 16; + p.TYPE_MISMATCH_ERR = 17; + + // set up externs + G_vmlCanvasManager = G_vmlCanvasManager_; + CanvasRenderingContext2D = CanvasRenderingContext2D_; + CanvasGradient = CanvasGradient_; + CanvasPattern = CanvasPattern_; + DOMException = DOMException_; +})(); + +} // if +else { // make the canvas test simple by kener.linfeng@gmail.com + G_vmlCanvasManager = false; +} +return G_vmlCanvasManager; +}); // define \ No newline at end of file diff --git a/amd/zrender/dep/excanvas3.js b/amd/zrender/dep/excanvas3.js new file mode 100644 index 0000000..dd87e17 --- /dev/null +++ b/amd/zrender/dep/excanvas3.js @@ -0,0 +1,1489 @@ +// Copyright 2006 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +// Known Issues: +// +// * Patterns only support repeat. +// * Radial gradient are not implemented. The VML version of these look very +// different from the canvas one. +// * Clipping paths are not implemented. +// * Coordsize. The width and height attribute have higher priority than the +// width and height style values which isn't correct. +// * Painting mode isn't implemented. +// * Canvas width/height should is using content-box by default. IE in +// Quirks mode will draw the canvas using border-box. Either change your +// doctype to HTML5 +// (http://www.whatwg.org/specs/web-apps/current-work/#the-doctype) +// or use Box Sizing Behavior from WebFX +// (http://webfx.eae.net/dhtml/boxsizing/boxsizing.html) +// * Non uniform scaling does not correctly scale strokes. +// * Optimize. There is always room for speed improvements. + +// AMD by kener.linfeng@gmail.com +define(function(require) { + +// Only add this code if we do not already have a canvas implementation +if (!document.createElement('canvas').getContext) { + +(function() { + + // alias some functions to make (compiled) code shorter + var m = Math; + var mr = m.round; + var ms = m.sin; + var mc = m.cos; + var abs = m.abs; + var sqrt = m.sqrt; + + // this is used for sub pixel precision + var Z = 10; + var Z2 = Z / 2; + + var IE_VERSION = +navigator.userAgent.match(/MSIE ([\d.]+)?/)[1]; + + /** + * This funtion is assigned to the elements as element.getContext(). + * @this {HTMLElement} + * @return {CanvasRenderingContext2D_} + */ + function getContext() { + return this.context_ || + (this.context_ = new CanvasRenderingContext2D_(this)); + } + + var slice = Array.prototype.slice; + + /** + * Binds a function to an object. The returned function will always use the + * passed in {@code obj} as {@code this}. + * + * Example: + * + * g = bind(f, obj, a, b) + * g(c, d) // will do f.call(obj, a, b, c, d) + * + * @param {Function} f The function to bind the object to + * @param {Object} obj The object that should act as this when the function + * is called + * @param {*} var_args Rest arguments that will be used as the initial + * arguments when the function is called + * @return {Function} A new function that has bound this + */ + function bind(f, obj, var_args) { + var a = slice.call(arguments, 2); + return function() { + return f.apply(obj, a.concat(slice.call(arguments))); + }; + } + + function encodeHtmlAttribute(s) { + return String(s).replace(/&/g, '&').replace(/"/g, '"'); + } + + function addNamespace(doc, prefix, urn) { + if (!doc.namespaces[prefix]) { + doc.namespaces.add(prefix, urn, '#default#VML'); + } + } + + function addNamespacesAndStylesheet(doc) { + addNamespace(doc, 'g_vml_', 'urn:schemas-microsoft-com:vml'); + addNamespace(doc, 'g_o_', 'urn:schemas-microsoft-com:office:office'); + + // Setup default CSS. Only add one style sheet per document + if (!doc.styleSheets['ex_canvas_']) { + var ss = doc.createStyleSheet(); + ss.owningElement.id = 'ex_canvas_'; + ss.cssText = 'canvas{display:inline-block;overflow:hidden;' + + // default size is 300x150 in Gecko and Opera + 'text-align:left;width:300px;height:150px}'; + } + } + + // Add namespaces and stylesheet at startup. + addNamespacesAndStylesheet(document); + + var G_vmlCanvasManager_ = { + init: function(opt_doc) { + var doc = opt_doc || document; + // Create a dummy element so that IE will allow canvas elements to be + // recognized. + doc.createElement('canvas'); + doc.attachEvent('onreadystatechange', bind(this.init_, this, doc)); + }, + + init_: function(doc) { + // find all canvas elements + var els = doc.getElementsByTagName('canvas'); + for (var i = 0; i < els.length; i++) { + this.initElement(els[i]); + } + }, + + /** + * Public initializes a canvas element so that it can be used as canvas + * element from now on. This is called automatically before the page is + * loaded but if you are creating elements using createElement you need to + * make sure this is called on the element. + * @param {HTMLElement} el The canvas element to initialize. + * @return {HTMLElement} the element that was created. + */ + initElement: function(el) { + if (!el.getContext) { + el.getContext = getContext; + + // Add namespaces and stylesheet to document of the element. + addNamespacesAndStylesheet(el.ownerDocument); + + // Remove fallback content. There is no way to hide text nodes so we + // just remove all childNodes. We could hide all elements and remove + // text nodes but who really cares about the fallback content. + el.innerHTML = ''; + + // do not use inline function because that will leak memory + el.attachEvent('onpropertychange', onPropertyChange); + el.attachEvent('onresize', onResize); + + var attrs = el.attributes; + if (attrs.width && attrs.width.specified) { + // TODO: use runtimeStyle and coordsize + // el.getContext().setWidth_(attrs.width.nodeValue); + el.style.width = attrs.width.nodeValue + 'px'; + } else { + el.width = el.clientWidth; + } + if (attrs.height && attrs.height.specified) { + // TODO: use runtimeStyle and coordsize + // el.getContext().setHeight_(attrs.height.nodeValue); + el.style.height = attrs.height.nodeValue + 'px'; + } else { + el.height = el.clientHeight; + } + //el.getContext().setCoordsize_() + } + return el; + } + }; + + function onPropertyChange(e) { + var el = e.srcElement; + + switch (e.propertyName) { + case 'width': + el.getContext().clearRect(); + el.style.width = el.attributes.width.nodeValue + 'px'; + // In IE8 this does not trigger onresize. + el.firstChild.style.width = el.clientWidth + 'px'; + break; + case 'height': + el.getContext().clearRect(); + el.style.height = el.attributes.height.nodeValue + 'px'; + el.firstChild.style.height = el.clientHeight + 'px'; + break; + } + } + + function onResize(e) { + var el = e.srcElement; + if (el.firstChild) { + el.firstChild.style.width = el.clientWidth + 'px'; + el.firstChild.style.height = el.clientHeight + 'px'; + } + } + + G_vmlCanvasManager_.init(); + + // precompute "00" to "FF" + var decToHex = []; + for (var i = 0; i < 16; i++) { + for (var j = 0; j < 16; j++) { + decToHex[i * 16 + j] = i.toString(16) + j.toString(16); + } + } + + function createMatrixIdentity() { + return [ + [1, 0, 0], + [0, 1, 0], + [0, 0, 1] + ]; + } + + function matrixMultiply(m1, m2) { + var result = createMatrixIdentity(); + + for (var x = 0; x < 3; x++) { + for (var y = 0; y < 3; y++) { + var sum = 0; + + for (var z = 0; z < 3; z++) { + sum += m1[x][z] * m2[z][y]; + } + + result[x][y] = sum; + } + } + return result; + } + + function getCoords(ctx, aX, aY) { + var m = ctx.m_; + return { + x: Z * (aX * m[0][0] + aY * m[1][0] + m[2][0]) - Z2, + y: Z * (aX * m[0][1] + aY * m[1][1] + m[2][1]) - Z2 + }; + }; + + function getSkewedCoords(ctx, aX, aY) { + var m = ctx.m_; + return { + x: Z * (aX * m[0][0] + aY * m[1][0]) - Z2, + y: Z * (aX * m[0][1] + aY * m[1][1]) - Z2 + }; + } + + function copyState(o1, o2) { + o2.fillStyle = o1.fillStyle; + o2.lineCap = o1.lineCap; + o2.lineJoin = o1.lineJoin; + o2.lineWidth = o1.lineWidth; + o2.miterLimit = o1.miterLimit; + o2.shadowBlur = o1.shadowBlur; + o2.shadowColor = o1.shadowColor; + o2.shadowOffsetX = o1.shadowOffsetX; + o2.shadowOffsetY = o1.shadowOffsetY; + o2.strokeStyle = o1.strokeStyle; + o2.globalAlpha = o1.globalAlpha; + o2.font = o1.font; + o2.textAlign = o1.textAlign; + o2.textBaseline = o1.textBaseline; + o2.scaleX_ = o1.scaleX_; + o2.scaleY_ = o1.scaleY_; + o2.x_ = o1.x_; + o2.y_ = o1.y_; + o2.lineScale_ = o1.lineScale_; + } + + var colorData = { + aliceblue: '#F0F8FF', + antiquewhite: '#FAEBD7', + aquamarine: '#7FFFD4', + azure: '#F0FFFF', + beige: '#F5F5DC', + bisque: '#FFE4C4', + black: '#000000', + blanchedalmond: '#FFEBCD', + blueviolet: '#8A2BE2', + brown: '#A52A2A', + burlywood: '#DEB887', + cadetblue: '#5F9EA0', + chartreuse: '#7FFF00', + chocolate: '#D2691E', + coral: '#FF7F50', + cornflowerblue: '#6495ED', + cornsilk: '#FFF8DC', + crimson: '#DC143C', + cyan: '#00FFFF', + darkblue: '#00008B', + darkcyan: '#008B8B', + darkgoldenrod: '#B8860B', + darkgray: '#A9A9A9', + darkgreen: '#006400', + darkgrey: '#A9A9A9', + darkkhaki: '#BDB76B', + darkmagenta: '#8B008B', + darkolivegreen: '#556B2F', + darkorange: '#FF8C00', + darkorchid: '#9932CC', + darkred: '#8B0000', + darksalmon: '#E9967A', + darkseagreen: '#8FBC8F', + darkslateblue: '#483D8B', + darkslategray: '#2F4F4F', + darkslategrey: '#2F4F4F', + darkturquoise: '#00CED1', + darkviolet: '#9400D3', + deeppink: '#FF1493', + deepskyblue: '#00BFFF', + dimgray: '#696969', + dimgrey: '#696969', + dodgerblue: '#1E90FF', + firebrick: '#B22222', + floralwhite: '#FFFAF0', + forestgreen: '#228B22', + gainsboro: '#DCDCDC', + ghostwhite: '#F8F8FF', + gold: '#FFD700', + goldenrod: '#DAA520', + grey: '#808080', + greenyellow: '#ADFF2F', + honeydew: '#F0FFF0', + hotpink: '#FF69B4', + indianred: '#CD5C5C', + indigo: '#4B0082', + ivory: '#FFFFF0', + khaki: '#F0E68C', + lavender: '#E6E6FA', + lavenderblush: '#FFF0F5', + lawngreen: '#7CFC00', + lemonchiffon: '#FFFACD', + lightblue: '#ADD8E6', + lightcoral: '#F08080', + lightcyan: '#E0FFFF', + lightgoldenrodyellow: '#FAFAD2', + lightgreen: '#90EE90', + lightgrey: '#D3D3D3', + lightpink: '#FFB6C1', + lightsalmon: '#FFA07A', + lightseagreen: '#20B2AA', + lightskyblue: '#87CEFA', + lightslategray: '#778899', + lightslategrey: '#778899', + lightsteelblue: '#B0C4DE', + lightyellow: '#FFFFE0', + limegreen: '#32CD32', + linen: '#FAF0E6', + magenta: '#FF00FF', + mediumaquamarine: '#66CDAA', + mediumblue: '#0000CD', + mediumorchid: '#BA55D3', + mediumpurple: '#9370DB', + mediumseagreen: '#3CB371', + mediumslateblue: '#7B68EE', + mediumspringgreen: '#00FA9A', + mediumturquoise: '#48D1CC', + mediumvioletred: '#C71585', + midnightblue: '#191970', + mintcream: '#F5FFFA', + mistyrose: '#FFE4E1', + moccasin: '#FFE4B5', + navajowhite: '#FFDEAD', + oldlace: '#FDF5E6', + olivedrab: '#6B8E23', + orange: '#FFA500', + orangered: '#FF4500', + orchid: '#DA70D6', + palegoldenrod: '#EEE8AA', + palegreen: '#98FB98', + paleturquoise: '#AFEEEE', + palevioletred: '#DB7093', + papayawhip: '#FFEFD5', + peachpuff: '#FFDAB9', + peru: '#CD853F', + pink: '#FFC0CB', + plum: '#DDA0DD', + powderblue: '#B0E0E6', + rosybrown: '#BC8F8F', + royalblue: '#4169E1', + saddlebrown: '#8B4513', + salmon: '#FA8072', + sandybrown: '#F4A460', + seagreen: '#2E8B57', + seashell: '#FFF5EE', + sienna: '#A0522D', + skyblue: '#87CEEB', + slateblue: '#6A5ACD', + slategray: '#708090', + slategrey: '#708090', + snow: '#FFFAFA', + springgreen: '#00FF7F', + steelblue: '#4682B4', + tan: '#D2B48C', + thistle: '#D8BFD8', + tomato: '#FF6347', + turquoise: '#40E0D0', + violet: '#EE82EE', + wheat: '#F5DEB3', + whitesmoke: '#F5F5F5', + yellowgreen: '#9ACD32' + }; + + + function getRgbHslContent(styleString) { + var start = styleString.indexOf('(', 3); + var end = styleString.indexOf(')', start + 1); + var parts = styleString.substring(start + 1, end).split(','); + // add alpha if needed + if (parts.length != 4 || styleString.charAt(3) != 'a') { + parts[3] = 1; + } + return parts; + } + + function percent(s) { + return parseFloat(s) / 100; + } + + function clamp(v, min, max) { + return Math.min(max, Math.max(min, v)); + } + + function hslToRgb(parts){ + var r, g, b, h, s, l; + h = parseFloat(parts[0]) / 360 % 360; + if (h < 0) + h++; + s = clamp(percent(parts[1]), 0, 1); + l = clamp(percent(parts[2]), 0, 1); + if (s == 0) { + r = g = b = l; // achromatic + } else { + var q = l < 0.5 ? l * (1 + s) : l + s - l * s; + var p = 2 * l - q; + r = hueToRgb(p, q, h + 1 / 3); + g = hueToRgb(p, q, h); + b = hueToRgb(p, q, h - 1 / 3); + } + + return '#' + decToHex[Math.floor(r * 255)] + + decToHex[Math.floor(g * 255)] + + decToHex[Math.floor(b * 255)]; + } + + function hueToRgb(m1, m2, h) { + if (h < 0) + h++; + if (h > 1) + h--; + + if (6 * h < 1) + return m1 + (m2 - m1) * 6 * h; + else if (2 * h < 1) + return m2; + else if (3 * h < 2) + return m1 + (m2 - m1) * (2 / 3 - h) * 6; + else + return m1; + } + + var processStyleCache = {}; + + function processStyle(styleString) { + if (styleString in processStyleCache) { + return processStyleCache[styleString]; + } + + var str, alpha = 1; + + styleString = String(styleString); + if (styleString.charAt(0) == '#') { + str = styleString; + } else if (/^rgb/.test(styleString)) { + var parts = getRgbHslContent(styleString); + var str = '#', n; + for (var i = 0; i < 3; i++) { + if (parts[i].indexOf('%') != -1) { + n = Math.floor(percent(parts[i]) * 255); + } else { + n = +parts[i]; + } + str += decToHex[clamp(n, 0, 255)]; + } + alpha = +parts[3]; + } else if (/^hsl/.test(styleString)) { + var parts = getRgbHslContent(styleString); + str = hslToRgb(parts); + alpha = parts[3]; + } else { + str = colorData[styleString] || styleString; + } + return processStyleCache[styleString] = {color: str, alpha: alpha}; + } + + var DEFAULT_STYLE = { + style: 'normal', + variant: 'normal', + weight: 'normal', + size: 12, //10 + family: '微软雅黑' //'sans-serif' + }; + + // Internal text style cache + var fontStyleCache = {}; + + function processFontStyle(styleString) { + if (fontStyleCache[styleString]) { + return fontStyleCache[styleString]; + } + + var el = document.createElement('div'); + var style = el.style; + var fontFamily; + try { + style.font = styleString; + fontFamily = style.fontFamily.split(',')[0]; + } catch (ex) { + // Ignore failures to set to invalid font. + } + + return fontStyleCache[styleString] = { + style: style.fontStyle || DEFAULT_STYLE.style, + variant: style.fontVariant || DEFAULT_STYLE.variant, + weight: style.fontWeight || DEFAULT_STYLE.weight, + size: style.fontSize || DEFAULT_STYLE.size, + family: fontFamily || DEFAULT_STYLE.family + }; + } + + function getComputedStyle(style, element) { + var computedStyle = {}; + + for (var p in style) { + computedStyle[p] = style[p]; + } + + // Compute the size + var canvasFontSize = parseFloat(element.currentStyle.fontSize), + fontSize = parseFloat(style.size); + + if (typeof style.size == 'number') { + computedStyle.size = style.size; + } else if (style.size.indexOf('px') != -1) { + computedStyle.size = fontSize; + } else if (style.size.indexOf('em') != -1) { + computedStyle.size = canvasFontSize * fontSize; + } else if(style.size.indexOf('%') != -1) { + computedStyle.size = (canvasFontSize / 100) * fontSize; + } else if (style.size.indexOf('pt') != -1) { + computedStyle.size = fontSize / .75; + } else { + computedStyle.size = canvasFontSize; + } + + // Different scaling between normal text and VML text. This was found using + // trial and error to get the same size as non VML text. + //computedStyle.size *= 0.981; + + return computedStyle; + } + + function buildStyle(style) { + return style.style + ' ' + style.variant + ' ' + style.weight + ' ' + + style.size + "px '" + style.family + "'"; + } + + var lineCapMap = { + 'butt': 'flat', + 'round': 'round' + }; + + function processLineCap(lineCap) { + return lineCapMap[lineCap] || 'square'; + } + + /** + * This class implements CanvasRenderingContext2D interface as described by + * the WHATWG. + * @param {HTMLElement} canvasElement The element that the 2D context should + * be associated with + */ + function CanvasRenderingContext2D_(canvasElement) { + this.m_ = createMatrixIdentity(); + + this.mStack_ = []; + this.aStack_ = []; + this.currentPath_ = []; + + // Canvas context properties + this.strokeStyle = '#000'; + this.fillStyle = '#000'; + + this.lineWidth = 1; + this.lineJoin = 'miter'; + this.lineCap = 'butt'; + this.miterLimit = Z * 1; + this.globalAlpha = 1; + // this.font = '10px sans-serif'; + this.font = '12px 微软雅黑'; // 决定还是改这吧,影响代价最小 + this.textAlign = 'left'; + this.textBaseline = 'alphabetic'; + this.canvas = canvasElement; + + var cssText = 'width:' + canvasElement.clientWidth + 'px;height:' + + canvasElement.clientHeight + 'px;overflow:hidden;position:absolute'; + var el = canvasElement.ownerDocument.createElement('div'); + el.style.cssText = cssText; + canvasElement.appendChild(el); + + var overlayEl = el.cloneNode(false); + // Use a non transparent background. + overlayEl.style.backgroundColor = '#fff'; //red, I don't know why, it work! + overlayEl.style.filter = 'alpha(opacity=0)'; + canvasElement.appendChild(overlayEl); + + this.element_ = el; + this.scaleX_ = 1; + this.scaleY_ = 1; + this.x_ = 0; + this.y_ = 0; + this.lineScale_ = 1; + + this.html_ = ''; + } + + var contextPrototype = CanvasRenderingContext2D_.prototype; + contextPrototype.clearRect = function() { + if (this.textMeasureEl_) { + this.textMeasureEl_.removeNode(true); + this.textMeasureEl_ = null; + } + this.element_.innerHTML = ''; + }; + + contextPrototype.flush = function () { + this.element_.insertAdjacentHTML('beforeEnd', this.html_); + this.html_ = ''; + } + + contextPrototype.beginPath = function() { + // TODO: Branch current matrix so that save/restore has no effect + // as per safari docs. + this.currentPath_ = []; + }; + + contextPrototype.moveTo = function(aX, aY) { + var p = getSkewedCoords(this, aX, aY); + p.type = 'moveTo'; + this.currentPath_.push(p); + this.currentX_ = p.x; + this.currentY_ = p.y; + }; + + contextPrototype.lineTo = function(aX, aY) { + var p = getSkewedCoords(this, aX, aY); + p.type = 'lineTo'; + this.currentPath_.push(p); + + this.currentX_ = p.x; + this.currentY_ = p.y; + }; + + contextPrototype.bezierCurveTo = function(aCP1x, aCP1y, + aCP2x, aCP2y, + aX, aY) { + var p = getSkewedCoords(this, aX, aY); + var cp1 = getSkewedCoords(this, aCP1x, aCP1y); + var cp2 = getSkewedCoords(this, aCP2x, aCP2y); + bezierCurveTo(this, cp1, cp2, p); + }; + + // Helper function that takes the already fixed cordinates. + function bezierCurveTo(self, cp1, cp2, p) { + self.currentPath_.push({ + type: 'bezierCurveTo', + cp1x: cp1.x, + cp1y: cp1.y, + cp2x: cp2.x, + cp2y: cp2.y, + x: p.x, + y: p.y + }); + self.currentX_ = p.x; + self.currentY_ = p.y; + } + + contextPrototype.quadraticCurveTo = function(aCPx, aCPy, aX, aY) { + // the following is lifted almost directly from + // http://developer.mozilla.org/en/docs/Canvas_tutorial:Drawing_shapes + + var cp = getSkewedCoords(this, aCPx, aCPy); + var p = getSkewedCoords(this, aX, aY); + + var cp1 = { + x: this.currentX_ + 2.0 / 3.0 * (cp.x - this.currentX_), + y: this.currentY_ + 2.0 / 3.0 * (cp.y - this.currentY_) + }; + var cp2 = { + x: cp1.x + (p.x - this.currentX_) / 3.0, + y: cp1.y + (p.y - this.currentY_) / 3.0 + }; + + bezierCurveTo(this, cp1, cp2, p); + }; + + contextPrototype.arc = function(aX, aY, aRadius, + aStartAngle, aEndAngle, aClockwise) { + aRadius *= Z; + var arcType = aClockwise ? 'at' : 'wa'; + + var xStart = aX + mc(aStartAngle) * aRadius - Z2; + var yStart = aY + ms(aStartAngle) * aRadius - Z2; + + var xEnd = aX + mc(aEndAngle) * aRadius - Z2; + var yEnd = aY + ms(aEndAngle) * aRadius - Z2; + + // IE won't render arches drawn counter clockwise if xStart == xEnd. + if (xStart == xEnd && !aClockwise) { + xStart += 0.125; // Offset xStart by 1/80 of a pixel. Use something + // that can be represented in binary + } + + var p = getSkewedCoords(this, aX, aY); + var pStart = getSkewedCoords(this, xStart, yStart); + var pEnd = getSkewedCoords(this, xEnd, yEnd); + + this.currentPath_.push({type: arcType, + x: p.x, + y: p.y, + radius: aRadius, + xStart: pStart.x, + yStart: pStart.y, + xEnd: pEnd.x, + yEnd: pEnd.y}); + + }; + + contextPrototype.rect = function(aX, aY, aWidth, aHeight) { + this.moveTo(aX, aY); + this.lineTo(aX + aWidth, aY); + this.lineTo(aX + aWidth, aY + aHeight); + this.lineTo(aX, aY + aHeight); + this.closePath(); + }; + + contextPrototype.strokeRect = function(aX, aY, aWidth, aHeight) { + var oldPath = this.currentPath_; + this.beginPath(); + + this.moveTo(aX, aY); + this.lineTo(aX + aWidth, aY); + this.lineTo(aX + aWidth, aY + aHeight); + this.lineTo(aX, aY + aHeight); + this.closePath(); + this.stroke(); + + this.currentPath_ = oldPath; + }; + + contextPrototype.fillRect = function(aX, aY, aWidth, aHeight) { + var oldPath = this.currentPath_; + this.beginPath(); + + this.moveTo(aX, aY); + this.lineTo(aX + aWidth, aY); + this.lineTo(aX + aWidth, aY + aHeight); + this.lineTo(aX, aY + aHeight); + this.closePath(); + this.fill(); + + this.currentPath_ = oldPath; + }; + + contextPrototype.createLinearGradient = function(aX0, aY0, aX1, aY1) { + var gradient = new CanvasGradient_('gradient'); + gradient.x0_ = aX0; + gradient.y0_ = aY0; + gradient.x1_ = aX1; + gradient.y1_ = aY1; + return gradient; + }; + + contextPrototype.createRadialGradient = function(aX0, aY0, aR0, + aX1, aY1, aR1) { + var gradient = new CanvasGradient_('gradientradial'); + gradient.x0_ = aX0; + gradient.y0_ = aY0; + gradient.r0_ = aR0; + gradient.x1_ = aX1; + gradient.y1_ = aY1; + gradient.r1_ = aR1; + return gradient; + }; + + contextPrototype.drawImage = function(image, var_args) { + var dx, dy, dw, dh, sx, sy, sw, sh; + + // to find the original width we overide the width and height + var oldRuntimeWidth = image.runtimeStyle.width; + var oldRuntimeHeight = image.runtimeStyle.height; + image.runtimeStyle.width = 'auto'; + image.runtimeStyle.height = 'auto'; + + // get the original size + var w = image.width; + var h = image.height; + var m_ = this.m_; + + // and remove overides + image.runtimeStyle.width = oldRuntimeWidth; + image.runtimeStyle.height = oldRuntimeHeight; + + if (arguments.length == 3) { + dx = arguments[1]; + dy = arguments[2]; + sx = sy = 0; + sw = dw = w; + sh = dh = h; + } else if (arguments.length == 5) { + dx = arguments[1]; + dy = arguments[2]; + dw = arguments[3]; + dh = arguments[4]; + sx = sy = 0; + sw = w; + sh = h; + } else if (arguments.length == 9) { + sx = arguments[1]; + sy = arguments[2]; + sw = arguments[3]; + sh = arguments[4]; + dx = arguments[5]; + dy = arguments[6]; + dw = arguments[7]; + dh = arguments[8]; + } else { + throw Error('Invalid number of arguments'); + } + + var w2 = sw / 2; + var h2 = sh / 2; + + var vmlStr = []; + + var W = 10; + var H = 10; + + var skewed = m_[1] || m_[2]; + var cropped = sx || sy; + + var scaleX = this.scaleX_; + var scaleY = this.scaleY_; + + var x = this.x_ + dx * scaleX; + var y = this.y_ + dy * scaleY; + // If filters are necessary (rotation exists), create them + // filters are bog-slow, so only create them if abbsolutely necessary + // The following check doesn't account for skews (which don't exist + // in the canvas spec (yet) anyway. + if (!skewed || !cropped) { + vmlStr.push(''); + } else if (skewed) { + // For some reason that I've now forgotten, using divs didn't work + vmlStr.push(' "); + + if (cropped) { + vmlStr.push('
'); + } + + vmlStr.push(''); + if (cropped) { + vmlStr.push('
'); + } + vmlStr.push('') + } else { + // Apply scales to width and height + vmlStr.push('
'); + + vmlStr.push('
'); + } + + this.html_ += vmlStr.join(''); + }; + + contextPrototype.stroke = function(aFill) { + var lineStr = []; + var lineOpen = false; + + var W = 10; + var H = 10; + + var x_ = this.x_; + var y_ = this.y_; + + lineStr.push(''); + + if (!aFill) { + appendStroke(this, lineStr); + } else { + appendFill(this, lineStr, min, max); + } + + lineStr.push(''); + + this.html_ += lineStr.join(''); + }; + + function appendStroke(ctx, lineStr) { + var a = processStyle(ctx.strokeStyle); + var color = a.color; + var opacity = a.alpha * ctx.globalAlpha; + var lineWidth = ctx.lineScale_ * ctx.lineWidth; + + // VML cannot correctly render a line if the width is less than 1px. + // In that case, we dilute the color to make the line look thinner. + if (lineWidth < 1) { + opacity *= lineWidth; + } + + lineStr.push( + '' + ); + } + + function appendFill(ctx, lineStr, min, max) { + var fillStyle = ctx.fillStyle; + var arcScaleX = ctx.scaleX_; + var arcScaleY = ctx.scaleY_; + var width = max.x - min.x; + var height = max.y - min.y; + if (fillStyle instanceof CanvasGradient_) { + // TODO: Gradients transformed with the transformation matrix. + var angle = 0; + var focus = {x: 0, y: 0}; + + // additional offset + var shift = 0; + // scale factor for offset + var expansion = 1; + + if (fillStyle.type_ == 'gradient') { + var x0 = fillStyle.x0_ / arcScaleX; + var y0 = fillStyle.y0_ / arcScaleY; + var x1 = fillStyle.x1_ / arcScaleX; + var y1 = fillStyle.y1_ / arcScaleY; + var p0 = getCoords(ctx, x0, y0); + var p1 = getCoords(ctx, x1, y1); + var dx = p1.x - p0.x; + var dy = p1.y - p0.y; + angle = Math.atan2(dx, dy) * 180 / Math.PI; + + // The angle should be a non-negative number. + if (angle < 0) { + angle += 360; + } + + // Very small angles produce an unexpected result because they are + // converted to a scientific notation string. + if (angle < 1e-6) { + angle = 0; + } + } else { + var p0 = getCoords(ctx, fillStyle.x0_, fillStyle.y0_); + focus = { + x: (p0.x - min.x) / width, + y: (p0.y - min.y) / height + }; + + width /= arcScaleX * Z; + height /= arcScaleY * Z; + var dimension = m.max(width, height); + shift = 2 * fillStyle.r0_ / dimension; + expansion = 2 * fillStyle.r1_ / dimension - shift; + } + + // We need to sort the color stops in ascending order by offset, + // otherwise IE won't interpret it correctly. + var stops = fillStyle.colors_; + stops.sort(function(cs1, cs2) { + return cs1.offset - cs2.offset; + }); + + var length = stops.length; + var color1 = stops[0].color; + var color2 = stops[length - 1].color; + var opacity1 = stops[0].alpha * ctx.globalAlpha; + var opacity2 = stops[length - 1].alpha * ctx.globalAlpha; + + var colors = []; + for (var i = 0; i < length; i++) { + var stop = stops[i]; + colors.push(stop.offset * expansion + shift + ' ' + stop.color); + } + + // When colors attribute is used, the meanings of opacity and o:opacity2 + // are reversed. + lineStr.push(''); + } else if (fillStyle instanceof CanvasPattern_) { + if (width && height) { + var deltaLeft = -min.x; + var deltaTop = -min.y; + lineStr.push(''); + } + } else { + var a = processStyle(ctx.fillStyle); + var color = a.color; + var opacity = a.alpha * ctx.globalAlpha; + lineStr.push(''); + } + } + + contextPrototype.fill = function() { + this.stroke(true); + }; + + contextPrototype.closePath = function() { + this.currentPath_.push({type: 'close'}); + }; + + contextPrototype.save = function() { + var o = {}; + copyState(this, o); + this.aStack_.push(o); + this.mStack_.push(this.m_); + this.m_ = matrixMultiply(createMatrixIdentity(), this.m_); + }; + + contextPrototype.restore = function() { + if (this.aStack_.length) { + copyState(this.aStack_.pop(), this); + this.m_ = this.mStack_.pop(); + } + }; + + function matrixIsFinite(m) { + return isFinite(m[0][0]) && isFinite(m[0][1]) && + isFinite(m[1][0]) && isFinite(m[1][1]) && + isFinite(m[2][0]) && isFinite(m[2][1]); + } + + function setM(ctx, m, updateLineScale) { + if (!matrixIsFinite(m)) { + return; + } + ctx.m_ = m; + + ctx.scaleX_ = Math.sqrt(m[0][0] * m[0][0] + m[0][1] * m[0][1]); + ctx.scaleY_ = Math.sqrt(m[1][0] * m[1][0] + m[1][1] * m[1][1]); + ctx.x_ = m[2][0]; + ctx.y_ = m[2][1]; + + if (updateLineScale) { + // Get the line scale. + // Determinant of this.m_ means how much the area is enlarged by the + // transformation. So its square root can be used as a scale factor + // for width. + var det = m[0][0] * m[1][1] - m[0][1] * m[1][0]; + ctx.lineScale_ = sqrt(abs(det)); + } + } + + + contextPrototype.translate = function(aX, aY) { + var m1 = [ + [1, 0, 0], + [0, 1, 0], + [aX, aY, 1] + ]; + + setM(this, matrixMultiply(m1, this.m_), false); + }; + + contextPrototype.rotate = function(aRot) { + var c = mc(aRot); + var s = ms(aRot); + + var m1 = [ + [c, s, 0], + [-s, c, 0], + [0, 0, 1] + ]; + + setM(this, matrixMultiply(m1, this.m_), false); + }; + + + contextPrototype.scale = function(aX, aY) { + var m1 = [ + [aX, 0, 0], + [0, aY, 0], + [0, 0, 1] + ]; + + setM(this, matrixMultiply(m1, this.m_), true); + }; + + contextPrototype.transform = function(m11, m12, m21, m22, dx, dy) { + var m1 = [ + [m11, m12, 0], + [m21, m22, 0], + [dx, dy, 1] + ]; + + setM(this, matrixMultiply(m1, this.m_), true); + + }; + + contextPrototype.setTransform = function(m11, m12, m21, m22, dx, dy) { + + var m = [ + [m11, m12, 0], + [m21, m22, 0], + [dx, dy, 1] + ]; + + setM(this, m, true); + }; + /** + * The text drawing function. + * The maxWidth argument isn't taken in account, since no browser supports + * it yet. + */ + contextPrototype.drawText_ = function(text, x, y, maxWidth, stroke) { + var m = this.m_, + delta = 1000, + left = 0, + right = delta, + offset = {x: 0, y: 0}, + lineStr = []; + + var fontStyle = getComputedStyle(processFontStyle(this.font), + this.element_); + + var fontStyleString = buildStyle(fontStyle); + + var elementStyle = this.element_.currentStyle; + var textAlign = this.textAlign.toLowerCase(); + switch (textAlign) { + case 'left': + case 'center': + case 'right': + break; + case 'end': + textAlign = elementStyle.direction == 'ltr' ? 'right' : 'left'; + break; + case 'start': + textAlign = elementStyle.direction == 'rtl' ? 'right' : 'left'; + break; + default: + textAlign = 'left'; + } + + // 1.75 is an arbitrary number, as there is no info about the text baseline + switch (this.textBaseline) { + case 'hanging': + case 'top': + offset.y = fontStyle.size / 1.75; + break; + case 'middle': + break; + default: + case null: + case 'alphabetic': + case 'ideographic': + case 'bottom': + offset.y = -fontStyle.size / 2.25; + break; + } + + switch(textAlign) { + case 'right': + left = delta; + right = 0.05; + break; + case 'center': + left = right = delta / 2; + break; + } + + var d = getCoords(this, x + offset.x, y + offset.y); + + lineStr.push(''); + + if (stroke) { + appendStroke(this, lineStr); + } else { + // TODO: Fix the min and max params. + appendFill(this, lineStr, {x: -left, y: 0}, + {x: right, y: fontStyle.size}); + } + + var skewM = m[0][0].toFixed(3) + ',' + m[1][0].toFixed(3) + ',' + + m[0][1].toFixed(3) + ',' + m[1][1].toFixed(3) + ',0,0'; + + var skewOffset = mr(d.x / Z) + ',' + mr(d.y / Z); + + lineStr.push('', + '', + ''); + + this.html_ += lineStr.join(''); + }; + + contextPrototype.fillText = function(text, x, y, maxWidth) { + this.drawText_(text, x, y, maxWidth, false); + }; + + contextPrototype.strokeText = function(text, x, y, maxWidth) { + this.drawText_(text, x, y, maxWidth, true); + }; + + contextPrototype.measureText = function(text) { + if (!this.textMeasureEl_) { + var s = ''; + this.element_.insertAdjacentHTML('beforeEnd', s); + this.textMeasureEl_ = this.element_.lastChild; + } + var doc = this.element_.ownerDocument; + this.textMeasureEl_.innerHTML = ''; + this.textMeasureEl_.style.font = this.font; + // Don't use innerHTML or innerText because they allow markup/whitespace. + this.textMeasureEl_.appendChild(doc.createTextNode(text)); + return {width: this.textMeasureEl_.offsetWidth}; + }; + + /******** STUBS ********/ + contextPrototype.clip = function() { + // TODO: Implement + }; + + contextPrototype.arcTo = function() { + // TODO: Implement + }; + + contextPrototype.createPattern = function(image, repetition) { + return new CanvasPattern_(image, repetition); + }; + + // Gradient / Pattern Stubs + function CanvasGradient_(aType) { + this.type_ = aType; + this.x0_ = 0; + this.y0_ = 0; + this.r0_ = 0; + this.x1_ = 0; + this.y1_ = 0; + this.r1_ = 0; + this.colors_ = []; + } + + CanvasGradient_.prototype.addColorStop = function(aOffset, aColor) { + aColor = processStyle(aColor); + this.colors_.push({offset: aOffset, + color: aColor.color, + alpha: aColor.alpha}); + }; + + function CanvasPattern_(image, repetition) { + assertImageIsValid(image); + switch (repetition) { + case 'repeat': + case null: + case '': + this.repetition_ = 'repeat'; + break + case 'repeat-x': + case 'repeat-y': + case 'no-repeat': + this.repetition_ = repetition; + break; + default: + throwException('SYNTAX_ERR'); + } + + this.src_ = image.src; + this.width_ = image.width; + this.height_ = image.height; + } + + function throwException(s) { + throw new DOMException_(s); + } + + function assertImageIsValid(img) { + if (!img || img.nodeType != 1 || img.tagName != 'IMG') { + throwException('TYPE_MISMATCH_ERR'); + } + if (img.readyState != 'complete') { + throwException('INVALID_STATE_ERR'); + } + } + + function DOMException_(s) { + this.code = this[s]; + this.message = s +': DOM Exception ' + this.code; + } + var p = DOMException_.prototype = new Error; + p.INDEX_SIZE_ERR = 1; + p.DOMSTRING_SIZE_ERR = 2; + p.HIERARCHY_REQUEST_ERR = 3; + p.WRONG_DOCUMENT_ERR = 4; + p.INVALID_CHARACTER_ERR = 5; + p.NO_DATA_ALLOWED_ERR = 6; + p.NO_MODIFICATION_ALLOWED_ERR = 7; + p.NOT_FOUND_ERR = 8; + p.NOT_SUPPORTED_ERR = 9; + p.INUSE_ATTRIBUTE_ERR = 10; + p.INVALID_STATE_ERR = 11; + p.SYNTAX_ERR = 12; + p.INVALID_MODIFICATION_ERR = 13; + p.NAMESPACE_ERR = 14; + p.INVALID_ACCESS_ERR = 15; + p.VALIDATION_ERR = 16; + p.TYPE_MISMATCH_ERR = 17; + + // set up externs + G_vmlCanvasManager = G_vmlCanvasManager_; + CanvasRenderingContext2D = CanvasRenderingContext2D_; + CanvasGradient = CanvasGradient_; + CanvasPattern = CanvasPattern_; + DOMException = DOMException_; +})(); + +} // if +else { // make the canvas test simple by kener.linfeng@gmail.com + G_vmlCanvasManager = false; +} +return G_vmlCanvasManager; +}); // define \ No newline at end of file diff --git a/amd/zrender/loadingEffect/Bar.js b/amd/zrender/loadingEffect/Bar.js index 74e5289..07d8496 100644 --- a/amd/zrender/loadingEffect/Bar.js +++ b/amd/zrender/loadingEffect/Bar.js @@ -55,7 +55,7 @@ define( effectOption.y, effectOption.x + effectOption.width, effectOption.y + effectOption.height, - [[0, '#ff6400'], [0.5, '#ffe100'], [1, '#b1ff00']] + [ [ 0, '#ff6400' ], [ 0.5, '#ffe100' ], [ 1, '#b1ff00' ] ] ); if (options.progress != null) { @@ -63,7 +63,7 @@ define( addShapeHandle(background); barShape.highlightStyle.width = - this.adjust(options.progress, [0,1]) + this.adjust(options.progress, [ 0, 1 ]) * options.effectOption.width; addShapeHandle(barShape); @@ -76,7 +76,7 @@ define( // 循环显示 barShape.highlightStyle.width = 0; return setInterval( - function() { + function () { addShapeHandle(background); if (barShape.highlightStyle.width < effectOption.width) { diff --git a/amd/zrender/loadingEffect/Base.js b/amd/zrender/loadingEffect/Base.js index 9c61d65..2e4fdb9 100644 --- a/amd/zrender/loadingEffect/Base.js +++ b/amd/zrender/loadingEffect/Base.js @@ -1,7 +1,7 @@ /** * zrender: loading特效类 * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * errorrik (errorrik@gmail.com) */ @@ -99,7 +99,8 @@ define( }; Base.prototype._start = function (/*addShapeHandle, refreshHandle*/) { - return setInterval(function(){}, 10000); + return setInterval(function () { + }, 10000); }; Base.prototype.stop = function () { @@ -119,6 +120,39 @@ define( } return value; }; + + Base.prototype.getLocation = function(loc, totalWidth, totalHeight) { + var x = loc.x != null ? loc.x : 'center'; + switch (x) { + case 'center' : + x = Math.floor((this.canvasWidth - totalWidth) / 2); + break; + case 'left' : + x = 0; + break; + case 'right' : + x = this.canvasWidth - totalWidth; + break; + } + var y = loc.y != null ? loc.y : 'center'; + switch (y) { + case 'center' : + y = Math.floor((this.canvasHeight - totalHeight) / 2); + break; + case 'top' : + y = 0; + break; + case 'bottom' : + y = this.canvasHeight - totalHeight; + break; + } + return { + x : x, + y : y, + width : totalWidth, + height : totalHeight + }; + }; return Base; } diff --git a/amd/zrender/loadingEffect/Bubble.js b/amd/zrender/loadingEffect/Bubble.js index e421ab2..bf2d4aa 100644 --- a/amd/zrender/loadingEffect/Bubble.js +++ b/amd/zrender/loadingEffect/Bubble.js @@ -50,7 +50,7 @@ define( var canvasHeight = this.canvasHeight; // 初始化动画元素 - for(var i = 0; i < n; i++) { + for (var i = 0; i < n; i++) { var color = effectOption.color == 'random' ? zrColor.alpha(zrColor.random(), 0.3) : effectOption.color; @@ -73,10 +73,10 @@ define( function () { addShapeHandle(background); - for(var i = 0; i < n; i++) { + for (var i = 0; i < n; i++) { var style = shapeList[i].highlightStyle; - if (style.y - shapeList[i].animationY + style.r <= 0){ + if (style.y - shapeList[i].animationY + style.r <= 0) { shapeList[i].highlightStyle.y = canvasHeight + style.r; shapeList[i].highlightStyle.x = Math.ceil( Math.random() * canvasWidth diff --git a/amd/zrender/loadingEffect/DynamicLine.js b/amd/zrender/loadingEffect/DynamicLine.js index 4095299..8c9c8e6 100644 --- a/amd/zrender/loadingEffect/DynamicLine.js +++ b/amd/zrender/loadingEffect/DynamicLine.js @@ -48,7 +48,7 @@ define( var canvasHeight = this.canvasHeight; // 初始化动画元素 - for(var i = 0; i < n; i++) { + for (var i = 0; i < n; i++) { var xStart = -Math.ceil(Math.random() * 1000); var len = Math.ceil(Math.random() * 400); var pos = Math.ceil(Math.random() * canvasHeight); @@ -75,10 +75,10 @@ define( function() { addShapeHandle(background); - for(var i = 0; i < n; i++) { + for (var i = 0; i < n; i++) { var style = shapeList[i].highlightStyle; - if (style.xStart >= canvasWidth){ + if (style.xStart >= canvasWidth) { shapeList[i].len = Math.ceil(Math.random() * 400); style.xStart = -400; diff --git a/amd/zrender/loadingEffect/Ring.js b/amd/zrender/loadingEffect/Ring.js index 2ef6585..e4c2d2a 100644 --- a/amd/zrender/loadingEffect/Ring.js +++ b/amd/zrender/loadingEffect/Ring.js @@ -71,12 +71,12 @@ define( // 初始化动画元素 var shapeList = []; var clolrList = zrColor.getGradientColors( - ['#ff6400', '#ffe100', '#97ff00'], 25 + [ '#ff6400', '#ffe100', '#97ff00' ], 25 ); var preAngle = 15; var endAngle = 240; - for(var i = 0; i < 16; i++) { + for (var i = 0; i < 16; i++) { shapeList.push(new SectorShape({ highlightStyle : { x : x, @@ -94,15 +94,15 @@ define( x + r0 * Math.cos(endAngle - preAngle, true), y - r0 * Math.sin(endAngle - preAngle, true), [ - [0, clolrList[i * 2]], - [1, clolrList[i * 2 + 1]] + [ 0, clolrList[i * 2] ], + [ 1, clolrList[i * 2 + 1] ] ] ) })); endAngle -= preAngle; } endAngle = 360; - for(var i = 0; i < 4; i++) { + for (var i = 0; i < 4; i++) { shapeList.push(new SectorShape({ highlightStyle : { x : x, @@ -120,8 +120,8 @@ define( x + r0 * Math.cos(endAngle - preAngle, true), y - r0 * Math.sin(endAngle - preAngle, true), [ - [0, clolrList[i * 2 + 32]], - [1, clolrList[i * 2 + 33]] + [ 0, clolrList[i * 2 + 32] ], + [ 1, clolrList[i * 2 + 33] ] ] ) })); @@ -133,11 +133,11 @@ define( // 指定进度 addShapeHandle(background); - n = this.adjust(options.progress, [0,1]).toFixed(2) * 100 / 5; + n = this.adjust(options.progress, [ 0, 1 ]).toFixed(2) * 100 / 5; shapeRing.highlightStyle.text = n * 5 + '%'; addShapeHandle(shapeRing); - for(var i = 0; i < 20; i++) { + for (var i = 0; i < 20; i++) { shapeList[i].highlightStyle.color = i < n ? shapeList[i]._color : darkColor; addShapeHandle(shapeList[i]); @@ -155,10 +155,10 @@ define( n += n >= 20 ? -20 : 1; - //shapeRing.highlightStyle.text = n * 5 + '%'; + // shapeRing.highlightStyle.text = n * 5 + '%'; addShapeHandle(shapeRing); - for(var i = 0; i < 20; i++) { + for (var i = 0; i < 20; i++) { shapeList[i].highlightStyle.color = i < n ? shapeList[i]._color : darkColor; addShapeHandle(shapeList[i]); diff --git a/amd/zrender/loadingEffect/Spin.js b/amd/zrender/loadingEffect/Spin.js index f237290..8bc1af6 100644 --- a/amd/zrender/loadingEffect/Spin.js +++ b/amd/zrender/loadingEffect/Spin.js @@ -4,6 +4,7 @@ define( var Base = require('./Base'); var util = require('../tool/util'); var zrColor = require('../tool/color'); + var zrArea = require('../tool/area'); var SectorShape = require('../shape/Sector'); function Spin(options) { @@ -18,12 +19,30 @@ define( * @param {Object} refreshHandle */ Spin.prototype._start = function (addShapeHandle, refreshHandle) { + var options = util.merge( + this.options, + { + textStyle : { + color : '#fff', + textAlign : 'start' + }, + backgroundColor : 'rgba(0, 0, 0, 0.8)' + } + ); + var textShape = this.createTextShape(options.textStyle); + + var textGap = 10; + var textWidth = zrArea.getTextWidth( + textShape.highlightStyle.text, textShape.highlightStyle.textFont + ); + var textHeight = zrArea.getTextHeight( + textShape.highlightStyle.text, textShape.highlightStyle.textFont + ); + // 特效默认配置 var effectOption = util.merge( this.options.effect || {}, { - x : this.canvasWidth / 2 - 80, - y : this.canvasHeight / 2, r0 : 9, r : 15, n : 18, @@ -31,23 +50,17 @@ define( timeInterval : 100 } ); - - var options = util.merge( - this.options, - { - textStyle : { - color : '#fff', - x : effectOption.x + effectOption.r + 10, - y : effectOption.y, - textAlign : 'start' - }, - backgroundColor : 'rgba(0, 0, 0, 0.8)' - } + + var location = this.getLocation( + this.options.textStyle, + textWidth + textGap + effectOption.r * 2, + Math.max(effectOption.r * 2, textHeight) ); - - var textShape = this.createTextShape(options.textStyle); + effectOption.x = location.x + effectOption.r; + effectOption.y = textShape.highlightStyle.y = location.y + location.height / 2; + textShape.highlightStyle.x = effectOption.x + effectOption.r + textGap; + var background = this.createBackgroundShape(options.backgroundColor); - var n = effectOption.n; var x = effectOption.x; var y = effectOption.y; @@ -58,7 +71,7 @@ define( // 初始化动画元素 var shapeList = []; var preAngle = Math.round(180 / n); - for(var i = 0; i < n; i++) { + for (var i = 0; i < n; i++) { shapeList[i] = new SectorShape({ highlightStyle : { x : x, @@ -73,13 +86,13 @@ define( }); } - var pos = [0, x, y]; + var pos = [ 0, x, y ]; return setInterval( function() { addShapeHandle(background); pos[0] -= 0.3; - for(var i = 0; i < n; i++) { + for (var i = 0; i < n; i++) { shapeList[i].rotation = pos; addShapeHandle(shapeList[i]); } diff --git a/amd/zrender/loadingEffect/Whirling.js b/amd/zrender/loadingEffect/Whirling.js index 1bdbba9..9af7379 100644 --- a/amd/zrender/loadingEffect/Whirling.js +++ b/amd/zrender/loadingEffect/Whirling.js @@ -3,6 +3,7 @@ define( function (require) { var Base = require('./Base'); var util = require('../tool/util'); + var zrArea = require('../tool/area'); var RingShape = require('../shape/Ring'); var DropletShape = require('../shape/Droplet'); var CircleShape = require('../shape/Circle'); @@ -19,12 +20,30 @@ define( * @param {Object} refreshHandle */ Whirling.prototype._start = function (addShapeHandle, refreshHandle) { + var options = util.merge( + this.options, + { + textStyle : { + color : '#888', + textAlign : 'start' + }, + backgroundColor : 'rgba(250, 250, 250, 0.8)' + } + ); + var textShape = this.createTextShape(options.textStyle); + + var textGap = 10; + var textWidth = zrArea.getTextWidth( + textShape.highlightStyle.text, textShape.highlightStyle.textFont + ); + var textHeight = zrArea.getTextHeight( + textShape.highlightStyle.text, textShape.highlightStyle.textFont + ); + // 特效默认配置 var effectOption = util.merge( this.options.effect || {}, { - x : this.canvasWidth / 2 - 80, - y : this.canvasHeight / 2, r : 18, colorIn : '#fff', colorOut : '#555', @@ -32,23 +51,17 @@ define( timeInterval : 50 } ); - - var options = util.merge( - this.options, - { - textStyle : { - color : '#888', - x : effectOption.x + effectOption.r + 10, - y : effectOption.y, - textAlign : 'start' - }, - backgroundColor : 'rgba(250, 250, 250, 0.8)' - } + + var location = this.getLocation( + this.options.textStyle, + textWidth + textGap + effectOption.r * 2, + Math.max(effectOption.r * 2, textHeight) ); - - var textShape = this.createTextShape(options.textStyle); + effectOption.x = location.x + effectOption.r; + effectOption.y = textShape.highlightStyle.y = location.y + location.height / 2; + textShape.highlightStyle.x = effectOption.x + effectOption.r + textGap; + var background = this.createBackgroundShape(options.backgroundColor); - // 初始化动画元素 var droplet = new DropletShape({ highlightStyle : { @@ -74,7 +87,7 @@ define( } }); - var pos = [0, effectOption.x, effectOption.y]; + var pos = [ 0, effectOption.x, effectOption.y ]; droplet.highlightStyle.x = circleIn.highlightStyle.x diff --git a/amd/zrender/mixin/Eventful.js b/amd/zrender/mixin/Eventful.js new file mode 100644 index 0000000..80921a7 --- /dev/null +++ b/amd/zrender/mixin/Eventful.js @@ -0,0 +1,267 @@ +/** + * 事件扩展 + * @module zrender/mixin/Eventful + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + * pissang (https://www.github.com/pissang) + */ +define(function (require) { + + /** + * 事件分发器 + * @alias module:zrender/mixin/Eventful + * @constructor + */ + var Eventful = function () { + this._handlers = {}; + }; + /** + * 单次触发绑定,dispatch后销毁 + * + * @param {string} event 事件名 + * @param {Function} handler 响应函数 + * @param {Object} context + */ + Eventful.prototype.one = function (event, handler, context) { + var _h = this._handlers; + + if (!handler || !event) { + return this; + } + + if (!_h[event]) { + _h[event] = []; + } + + _h[event].push({ + h : handler, + one : true, + ctx: context || this + }); + + return this; + }; + + /** + * 绑定事件 + * @param {string} event 事件名 + * @param {Function} handler 事件处理函数 + * @param {Object} [context] + */ + Eventful.prototype.bind = function (event, handler, context) { + var _h = this._handlers; + + if (!handler || !event) { + return this; + } + + if (!_h[event]) { + _h[event] = []; + } + + _h[event].push({ + h : handler, + one : false, + ctx: context || this + }); + + return this; + }; + + /** + * 解绑事件 + * @param {string} event 事件名 + * @param {Function} [handler] 事件处理函数 + */ + Eventful.prototype.unbind = function (event, handler) { + var _h = this._handlers; + + if (!event) { + this._handlers = {}; + return this; + } + + if (handler) { + if (_h[event]) { + var newList = []; + for (var i = 0, l = _h[event].length; i < l; i++) { + if (_h[event][i]['h'] != handler) { + newList.push(_h[event][i]); + } + } + _h[event] = newList; + } + + if (_h[event] && _h[event].length === 0) { + delete _h[event]; + } + } + else { + delete _h[event]; + } + + return this; + }; + + /** + * 事件分发 + * + * @param {string} type 事件类型 + */ + Eventful.prototype.dispatch = function (type) { + if (this._handlers[type]) { + var args = arguments; + var argLen = args.length; + + if (argLen > 3) { + args = Array.prototype.slice.call(args, 1); + } + + var _h = this._handlers[type]; + var len = _h.length; + for (var i = 0; i < len;) { + // Optimize advise from backbone + switch (argLen) { + case 1: + _h[i]['h'].call(_h[i]['ctx']); + break; + case 2: + _h[i]['h'].call(_h[i]['ctx'], args[1]); + break; + case 3: + _h[i]['h'].call(_h[i]['ctx'], args[1], args[2]); + break; + default: + // have more than 2 given arguments + _h[i]['h'].apply(_h[i]['ctx'], args); + break; + } + + if (_h[i]['one']) { + _h.splice(i, 1); + len--; + } + else { + i++; + } + } + } + + return this; + }; + + /** + * 带有context的事件分发, 最后一个参数是事件回调的context + * @param {string} type 事件类型 + */ + Eventful.prototype.dispatchWithContext = function (type) { + if (this._handlers[type]) { + var args = arguments; + var argLen = args.length; + + if (argLen > 4) { + args = Array.prototype.slice.call(args, 1, args.length - 1); + } + var ctx = args[args.length - 1]; + + var _h = this._handlers[type]; + var len = _h.length; + for (var i = 0; i < len;) { + // Optimize advise from backbone + switch (argLen) { + case 1: + _h[i]['h'].call(ctx); + break; + case 2: + _h[i]['h'].call(ctx, args[1]); + break; + case 3: + _h[i]['h'].call(ctx, args[1], args[2]); + break; + default: + // have more than 2 given arguments + _h[i]['h'].apply(ctx, args); + break; + } + + if (_h[i]['one']) { + _h.splice(i, 1); + len--; + } + else { + i++; + } + } + } + + return this; + }; + + // 对象可以通过 onxxxx 绑定事件 + /** + * @event module:zrender/mixin/Eventful#onclick + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#onmouseover + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#onmouseout + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#onmousemove + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#onmousewheel + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#onmousedown + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#onmouseup + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#ondragstart + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#ondragend + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#ondragenter + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#ondragleave + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#ondragover + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#ondrop + * @type {Function} + * @default null + */ + + return Eventful; +}); diff --git a/amd/zrender/mixin/Transformable.js b/amd/zrender/mixin/Transformable.js new file mode 100644 index 0000000..e15bf3c --- /dev/null +++ b/amd/zrender/mixin/Transformable.js @@ -0,0 +1,244 @@ +/** + * 提供变换扩展 + * @module zrender/mixin/Transformable + * @author pissang (https://www.github.com/pissang) + */ +define(function (require) { + + 'use strict'; + + var matrix = require('../tool/matrix'); + var vector = require('../tool/vector'); + var origin = [ 0, 0 ]; + + var EPSILON = 5e-5; + + function isAroundZero(val) { + return val > -EPSILON && val < EPSILON; + } + function isNotAroundZero(val) { + return val > EPSILON || val < -EPSILON; + } + + /** + * @alias module:zrender/mixin/Transformable + * @constructor + */ + var Transformable = function () { + + if (!this.position) { + /** + * 平移 + * @type {Array.} + * @default [0, 0] + */ + this.position = [ 0, 0 ]; + } + if (typeof(this.rotation) == 'undefined') { + /** + * 旋转,可以通过数组二三项指定旋转的原点 + * @type {Array.} + * @default [0, 0, 0] + */ + this.rotation = [ 0, 0, 0 ]; + } + if (!this.scale) { + /** + * 缩放,可以通过数组三四项指定缩放的原点 + * @type {Array.} + * @default [1, 1, 0, 0] + */ + this.scale = [ 1, 1, 0, 0 ]; + } + + this.needLocalTransform = false; + + /** + * 是否有坐标变换 + * @type {boolean} + * @readOnly + */ + this.needTransform = false; + }; + + Transformable.prototype = { + + constructor: Transformable, + + updateNeedTransform: function () { + this.needLocalTransform = isNotAroundZero(this.rotation[0]) + || isNotAroundZero(this.position[0]) + || isNotAroundZero(this.position[1]) + || isNotAroundZero(this.scale[0] - 1) + || isNotAroundZero(this.scale[1] - 1); + }, + + /** + * 判断是否需要有坐标变换,更新needTransform属性。 + * 如果有坐标变换, 则从position, rotation, scale以及父节点的transform计算出自身的transform矩阵 + */ + updateTransform: function () { + + this.updateNeedTransform(); + + if (this.parent) { + this.needTransform = this.needLocalTransform || this.parent.needTransform; + } + else { + this.needTransform = this.needLocalTransform; + } + + if (!this.needTransform) { + return; + } + + var m = this.transform || matrix.create(); + matrix.identity(m); + + if (this.needLocalTransform) { + if ( + isNotAroundZero(this.scale[0]) + || isNotAroundZero(this.scale[1]) + ) { + origin[0] = -this.scale[2] || 0; + origin[1] = -this.scale[3] || 0; + var haveOrigin = isNotAroundZero(origin[0]) + || isNotAroundZero(origin[1]); + if (haveOrigin) { + matrix.translate( + m, m, origin + ); + } + matrix.scale(m, m, this.scale); + if (haveOrigin) { + origin[0] = -origin[0]; + origin[1] = -origin[1]; + matrix.translate( + m, m, origin + ); + } + } + + if (this.rotation instanceof Array) { + if (this.rotation[0] !== 0) { + origin[0] = -this.rotation[1] || 0; + origin[1] = -this.rotation[2] || 0; + var haveOrigin = isNotAroundZero(origin[0]) + || isNotAroundZero(origin[1]); + if (haveOrigin) { + matrix.translate( + m, m, origin + ); + } + matrix.rotate(m, m, this.rotation[0]); + if (haveOrigin) { + origin[0] = -origin[0]; + origin[1] = -origin[1]; + matrix.translate( + m, m, origin + ); + } + } + } + else { + if (this.rotation !== 0) { + matrix.rotate(m, m, this.rotation); + } + } + + if ( + isNotAroundZero(this.position[0]) || isNotAroundZero(this.position[1]) + ) { + matrix.translate(m, m, this.position); + } + } + + // 保存这个变换矩阵 + this.transform = m; + + // 应用父节点变换 + if (this.parent && this.parent.needTransform) { + if (this.needLocalTransform) { + matrix.mul(this.transform, this.parent.transform, this.transform); + } + else { + matrix.copy(this.transform, this.parent.transform); + } + } + }, + /** + * 将自己的transform应用到context上 + * @param {Context2D} ctx + */ + setTransform: function (ctx) { + if (this.needTransform) { + var m = this.transform; + ctx.transform( + m[0], m[1], + m[2], m[3], + m[4], m[5] + ); + } + }, + /** + * 设置图形的朝向 + * @param {Array.|Float32Array} target + * @method + */ + lookAt: (function () { + var v = vector.create(); + return function(target) { + if (!this.transform) { + this.transform = matrix.create(); + } + var m = this.transform; + vector.sub(v, target, this.position); + if (isAroundZero(v[0]) && isAroundZero(v[1])) { + return; + } + vector.normalize(v, v); + // Y Axis + // TODO Scale origin ? + m[2] = v[0] * this.scale[1]; + m[3] = v[1] * this.scale[1]; + // X Axis + m[0] = v[1] * this.scale[0]; + m[1] = -v[0] * this.scale[0]; + // Position + m[4] = this.position[0]; + m[5] = this.position[1]; + + this.decomposeTransform(); + }; + })(), + /** + * 分解`transform`矩阵到`position`, `rotation`, `scale` + */ + decomposeTransform: function () { + if (!this.transform) { + return; + } + var m = this.transform; + var sx = m[0] * m[0] + m[1] * m[1]; + var position = this.position; + var scale = this.scale; + var rotation = this.rotation; + if (isNotAroundZero(sx - 1)) { + sx = Math.sqrt(sx); + } + var sy = m[2] * m[2] + m[3] * m[3]; + if (isNotAroundZero(sy - 1)) { + sy = Math.sqrt(sy); + } + position[0] = m[4]; + position[1] = m[5]; + scale[0] = sx; + scale[1] = sy; + scale[2] = scale[3] = 0; + rotation[0] = Math.atan2(-m[1] / sy, m[0] / sx); + rotation[1] = rotation[2] = 0; + } + }; + + return Transformable; +}); diff --git a/amd/zrender/shape/Base.js b/amd/zrender/shape/Base.js index 27aa9c8..665cce4 100644 --- a/amd/zrender/shape/Base.js +++ b/amd/zrender/shape/Base.js @@ -1,624 +1,699 @@ -/** - * zrender : shape基类 - * - * desc: zrender是一个轻量级的Canvas类库,MVC封装,数据驱动,提供类Dom事件模型。 - * author: Kener (@Kener-林峰, linzhifeng@baidu.com) - * errorrik (errorrik@gmail.com) - * - * 可配图形属性: - { - // 基础属性,详见各shape - shape : {string}, // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 变换 - position : {array}, // 默认为[0, 0], shape的坐标 - rotation : {number|array}, // 默认为[0, 0, 0],shape绕自身旋转的角度,不被translate 影响 - // 后两个值为旋转的origin - scale : {array}, // 默认为[1, 1, 0, 0], shape纵横缩放比例,不被translate影响 - // 后两个值为缩放的origin - - // 样式属性,详见各shape,默认状态样式属性 - style : {Object}, - - // 样式属性,详见各shape,高亮样式属性,当不存在highlightStyle时使用默认样式扩展显示 - highlightStyle : {Object}, - - // 交互属性,zrender支持,非图形类实现 - hoverable : {boolean}, // 默认为true,可悬浮响应,默认悬浮响应为高亮显示 - // 可在onbrush中捕获并阻塞高亮绘画 - clickable : {boolean}, // 默认为false,可点击响应,影响鼠标hover时图标是否为可点击样式 - // 为false则阻断点击事件抛出,为true可在onclick中捕获 - draggable : {boolean}, // 默认为false,可拖拽响应,默认拖拽响应改变图形位置, - // 可在ondrift中捕获并阻塞默认拖拽行为 - - // 事件属性 - onbrush : {Function}, // 默认为null,当前图形被刷画时回调,可用于实现自定义绘画 - // 回传参数为: - // @param {2D Context} context 当前canvas context - // @param {Object} shape 当前shape - // @param {boolean} isHighlight 是否高亮 - // @return {boolean} 回调返回true则不执行默认绘画 - ondrift : {Function}, // 默认为null,当前图形被拖拽改变位置时回调,可用于限制拖拽范围 - // 回传参数为: - // @param {Object} shape 当前shape - // @param {number} dx x方向变化 - // @param {number} dy y方向变化 - onclick : {Function}, // 默认为null,当前图形点击响应,回传参数为: - // @param {Object} eventPacket 对象内容如下: - // @param {string} eventPacket.type 事件类型,EVENT.CLICK - // @param {event} eventPacket.event 原始dom事件对象 - // @param {Object} eventPacket.target 当前图形shape对象 - // @return {boolean} 回调返回true则阻止抛出全局事件 - - onmousewheel : {Function}, // 默认为null,当前图形上鼠标滚轮触发,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.MOUSEWHEEL - // @return {boolean} 回调返回true则阻止抛出全局事件 - - onmousemove : {Function}, // 默认为null,当前图上形鼠标(或手指)移动触发,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.MOUSEMOVE - // @return {boolean} 回调返回true则阻止抛出全局事件 - - onmouseover : {Function}, // 默认为null,鼠标(或手指)移动到当前图形上触发,回传参数格式同onclick: - // 事件类型为confit.EVENT.MOUSEOVER - // @return {boolean} 回调返回true则阻止抛出全局事件 - - onmouseout : {Function}, // 默认为null,鼠标(或手指)从当前图形移开,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.MOUSEOUT - // @return {boolean} 回调返回true则阻止抛出全局事件 - - onmousedown : {Function}, // 默认为null,鼠标按钮(或手指)按下,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.MOUSEDOWN - // @return {boolean} 回调返回true则阻止抛出全局事件 - - onmouseup : {Function}, // 默认为null,鼠标按钮(或手指)松开,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.MOUSEUP - // @return {boolean} 回调返回true则阻止抛出全局事件 - - ondragstart : {Function}, // 默认为null,开始拖拽时触发,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.DRAGSTART - // @return {boolean} 回调返回true则阻止抛出全局事件 - - ondragend : {Function}, // 默认为null,拖拽完毕时触发,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.DRAGEND - // @return {boolean} 回调返回true则阻止抛出全局事件 - - ondragenter : {Function}, // 默认为null,拖拽图形元素进入目标图形元素时触发 - // 回传参数格式同onclick,其中: - // @param {string} eventPacket.type 事件类型,EVENT.DRAGENTER - // @param {Object} eventPacket.target 目标图形元素shape对象 - // @param {Object} eventPacket.dragged 拖拽图形元素shape对象 - // @return {boolean} 回调返回true则阻止抛出全局事件 - - ondragover : {Function}, // 默认为null,拖拽图形元素在目标图形元素上移动时触发, - // 回传参数格式同onclick,其中: - // @param {string} eventPacket.type 事件类型,EVENT.DRAGOVER - // @param {Object} eventPacket.target 目标图形元素shape对象 - // @param {Object} eventPacket.dragged 拖拽图形元素shape对象 - // @return {boolean} 回调返回true则阻止抛出全局事件 - - ondragleave : {Function}, // 默认为null,拖拽图形元素离开目标图形元素时触发, - // 回传参数格式同onclick,其中: - // @param {string} eventPacket.type 事件类型,EVENT.DRAGLEAVE - // @param {Object} eventPacket.target 目标图形元素shape对象 - // @param {Object} eventPacket.dragged 拖拽图形元素shape对象 - // @return {boolean} 回调返回true则阻止抛出全局事件 - - ondrop : {Function}, // 默认为null,拖拽图形元素放在目标图形元素内时触发, - // 回传参数格式同onclick,其中: - // @param {string} eventPacket.type 事件类型,EVENT.DRAG - // @param {Object} eventPacket.target 目标图形元素shape对象 - // @param {Object} eventPacket.dragged 拖拽图形元素shape对象 - // @return {boolean} 回调返回true则阻止抛出全局事件 - } - */ -define( - function(require) { - var matrix = require('../tool/matrix'); - var guid = require('../tool/guid'); - var util = require('../tool/util'); - - var Transformable = require('./mixin/Transformable'); - var Dispatcher = require('../tool/event').Dispatcher; - - function _fillText(ctx, text, x, y, textFont, textAlign, textBaseline) { - if (textFont) { - ctx.font = textFont; - } - ctx.textAlign = textAlign; - ctx.textBaseline = textBaseline; - var rect = _getTextRect( - text, x, y, textFont, textAlign, textBaseline - ); - - text = (text + '').split('\n'); - var lineHeight = require('../tool/area').getTextHeight('国', textFont); - - switch (textBaseline) { - case 'top': - y = rect.y; - break; - case 'bottom': - y = rect.y + lineHeight; - break; - default: - y = rect.y + lineHeight / 2; - } - - for (var i = 0, l = text.length; i < l; i++) { - ctx.fillText(text[i], x, y); - y += lineHeight; - } - } - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * - * @inner - * @param {Object} style - */ - function _getTextRect(text, x, y, textFont, textAlign, textBaseline) { - var area = require('../tool/area'); - var width = area.getTextWidth(text, textFont); - var lineHeight = area.getTextHeight('国', textFont); - - text = (text + '').split('\n'); - - switch (textAlign) { - case 'end': - case 'right': - x -= width; - break; - case 'center': - x -= (width / 2); - break; - } - - switch (textBaseline) { - case 'top': - break; - case 'bottom': - y -= lineHeight * text.length; - break; - default: - y -= lineHeight * text.length / 2; - } - - return { - x : x, - y : y, - width : width, - height : lineHeight * text.length - }; - } - - function Base( options ) { - - options = options || {}; - - this.id = options.id || guid(); - - for ( var key in options ) { - this[ key ] = options[ key ]; - } - - this.style = this.style || {}; - - this.parent = null; - - this.__dirty = true; - - Transformable.call(this); - Dispatcher.call(this); - } - - Base.prototype.invisible = false; - - Base.prototype.ignore = false; - - Base.prototype.zlevel = 0; - - Base.prototype.draggable = false; - - Base.prototype.clickable = false; - - Base.prototype.hoverable = true; - - Base.prototype.z = 0; - - /** - * 画刷 - * - * @param ctx 画布句柄 - * @param isHighlight 是否为高亮状态 - * @param updateCallback 需要异步加载资源的shape可以通过这个callback(e) - * 让painter更新视图,base.brush没用,需要的话重载brush - */ - Base.prototype.brush = function (ctx, isHighlight) { - var style = this.style; - - if (this.brushTypeOnly) { - style.brushType = this.brushTypeOnly; - } - - if (isHighlight) { - // 根据style扩展默认高亮样式 - style = this.getHighlightStyle( - style, - this.highlightStyle || {}, - this.brushTypeOnly - ); - } - - if (this.brushTypeOnly == 'stroke') { - style.strokeColor = style.strokeColor || style.color; - } - - ctx.save(); - - this.setContext(ctx, style); - - // 设置transform - this.setTransform(ctx); - - ctx.beginPath(); - this.buildPath(ctx, style); - if (this.brushTypeOnly != 'stroke') { - ctx.closePath(); - } - - switch (style.brushType) { - case 'both': - ctx.fill(); - case 'stroke': - style.lineWidth > 0 && ctx.stroke(); - break; - default: - ctx.fill(); - } - - this.drawText(ctx, style, this.style); - - ctx.restore(); - }; - - var STYLE_CTX_MAP = [ - ['color', 'fillStyle'], - ['strokeColor', 'strokeStyle'], - ['opacity', 'globalAlpha'], - ['lineCap', 'lineCap'], - ['lineJoin', 'lineJoin'], - ['miterLimit', 'miterLimit'], - ['lineWidth', 'lineWidth'], - ['shadowBlur', 'shadowBlur'], - ['shadowColor', 'shadowColor'], - ['shadowOffsetX', 'shadowOffsetX'], - ['shadowOffsetY', 'shadowOffsetY'] - ]; - - /** - * 画布通用设置 - * - * TODO Performance - * - * @param ctx 画布句柄 - * @param style 通用样式 - */ - Base.prototype.setContext = function (ctx, style) { - for (var i = 0, len = STYLE_CTX_MAP.length; i < len; i++) { - var styleProp = STYLE_CTX_MAP[i][0]; - var styleValue = style[styleProp]; - var ctxProp = STYLE_CTX_MAP[i][1]; - - if (typeof styleValue != 'undefined') { - ctx[ctxProp] = styleValue; - } - } - }; - - /** - * 根据默认样式扩展高亮样式 - * - * @param ctx Canvas 2D上下文 - * @param {Object} style 默认样式 - * @param {Object} highlightStyle 高亮样式 - */ - Base.prototype.getHighlightStyle = function (style, highlightStyle, brushTypeOnly) { - var newStyle = {}; - for (var k in style) { - newStyle[k] = style[k]; - } - - var color = require('../tool/color'); - var highlightColor = color.getHighlightColor(); - // 根据highlightStyle扩展 - if (style.brushType != 'stroke') { - // 带填充则用高亮色加粗边线 - newStyle.strokeColor = highlightColor; - newStyle.lineWidth = (style.lineWidth || 1) - + this.getHighlightZoom(); - newStyle.brushType = 'both'; - } - else { - if (brushTypeOnly != 'stroke') { - // 描边型的则用原色加工高亮 - newStyle.strokeColor = highlightColor; - newStyle.lineWidth = (style.lineWidth || 1) - + this.getHighlightZoom(); - } - else { - // 线型的则用原色加工高亮 - newStyle.strokeColor = highlightStyle.strokeColor - || color.mix( - style.strokeColor, - color.toRGB(highlightColor) - ); - } - } - - // 可自定义覆盖默认值 - for (var k in highlightStyle) { - if (typeof highlightStyle[k] != 'undefined') { - newStyle[k] = highlightStyle[k]; - } - } - - return newStyle; - }; - - /** - * 高亮放大效果参数 - * 当前统一设置为6,如有需要差异设置,通过this.type判断实例类型 - */ - Base.prototype.getHighlightZoom = function () { - return this.type != 'text' ? 6 : 2; - }; - - /** - * 默认漂移 - * - * @param dx 横坐标变化 - * @param dy 纵坐标变化 - */ - Base.prototype.drift = function (dx, dy) { - this.position[0] += dx; - this.position[1] += dy; - }; - - /** - * 获取鼠标坐标变换 - * TODO Performance - */ - Base.prototype.getTansform = (function() { - - var invTransform = []; - - return function (x, y) { - var originPos = [x, y]; - // 对鼠标的坐标也做相同的变换 - if (this.needTransform && this.transform) { - matrix.invert(invTransform, this.transform); - - matrix.mulVector(originPos, invTransform, [x, y, 1]); - - if (x == originPos[0] && y == originPos[1]) { - // 避免外部修改导致的needTransform不准确 - this.updateNeedTransform(); - } - } - return originPos; - }; - })(); - - /** - * 默认区域包含判断 - * - * @param x 横坐标 - * @param y 纵坐标 - */ - Base.prototype.isCover = function (x, y) { - var originPos = this.getTansform(x, y); - x = originPos[0]; - y = originPos[1]; - - // 快速预判并保留判断矩形 - var rect = this.style.__rect; - if (!rect) { - rect = this.style.__rect = this.getRect(this.style); - } - - if (x >= rect.x - && x <= (rect.x + rect.width) - && y >= rect.y - && y <= (rect.y + rect.height) - ) { - // 矩形内 - return require('../tool/area').isInside(this, this.style, x, y); - } - - return false; - }; - - /** - * 附加文本 - * - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - * @param {Object} normalStyle 默认样式,用于定位文字显示 - */ - Base.prototype.drawText = function (ctx, style, normalStyle) { - if (typeof(style.text) == 'undefined' || style.text === false ) { - return; - } - // 字体颜色策略 - var textColor = style.textColor || style.color || style.strokeColor; - ctx.fillStyle = textColor; - - /* - if (style.textPosition == 'inside') { - ctx.shadowColor = 'rgba(0,0,0,0)'; // 内部文字不带shadowColor - } - */ - - // 文本与图形间空白间隙 - var dd = 10; - var al; // 文本水平对齐 - var bl; // 文本垂直对齐 - var tx; // 文本横坐标 - var ty; // 文本纵坐标 - - var textPosition = style.textPosition // 用户定义 - || this.textPosition // shape默认 - || 'top'; // 全局默认 - - switch (textPosition) { - case 'inside': - case 'top': - case 'bottom': - case 'left': - case 'right': - if (this.getRect) { - var rect = (normalStyle || style).__rect - || this.getRect(normalStyle || style); - - switch (textPosition) { - case 'inside': - tx = rect.x + rect.width / 2; - ty = rect.y + rect.height / 2; - al = 'center'; - bl = 'middle'; - if (style.brushType != 'stroke' - && textColor == style.color - ) { - ctx.fillStyle = '#fff'; - } - break; - case 'left': - tx = rect.x - dd; - ty = rect.y + rect.height / 2; - al = 'end'; - bl = 'middle'; - break; - case 'right': - tx = rect.x + rect.width + dd; - ty = rect.y + rect.height / 2; - al = 'start'; - bl = 'middle'; - break; - case 'top': - tx = rect.x + rect.width / 2; - ty = rect.y - dd; - al = 'center'; - bl = 'bottom'; - break; - case 'bottom': - tx = rect.x + rect.width / 2; - ty = rect.y + rect.height + dd; - al = 'center'; - bl = 'top'; - break; - } - } - break; - case 'start': - case 'end': - var xStart; - var xEnd; - var yStart; - var yEnd; - if (typeof style.pointList != 'undefined') { - var pointList = style.pointList; - if (pointList.length < 2) { - // 少于2个点就不画了~ - return; - } - var length = pointList.length; - switch (textPosition) { - case 'start': - xStart = pointList[0][0]; - xEnd = pointList[1][0]; - yStart = pointList[0][1]; - yEnd = pointList[1][1]; - break; - case 'end': - xStart = pointList[length - 2][0]; - xEnd = pointList[length - 1][0]; - yStart = pointList[length - 2][1]; - yEnd = pointList[length - 1][1]; - break; - } - } - else { - xStart = style.xStart || 0; - xEnd = style.xEnd || 0; - yStart = style.yStart || 0; - yEnd = style.yEnd || 0; - } - - switch (textPosition) { - case 'start': - al = xStart < xEnd ? 'end' : 'start'; - bl = yStart < yEnd ? 'bottom' : 'top'; - tx = xStart; - ty = yStart; - break; - case 'end': - al = xStart < xEnd ? 'start' : 'end'; - bl = yStart < yEnd ? 'top' : 'bottom'; - tx = xEnd; - ty = yEnd; - break; - } - dd -= 4; - if (xStart != xEnd) { - tx -= (al == 'end' ? dd : -dd); - } - else { - al = 'center'; - } - - if (yStart != yEnd) { - ty -= (bl == 'bottom' ? dd : -dd); - } - else { - bl = 'middle'; - } - break; - case 'specific': - tx = style.textX || 0; - ty = style.textY || 0; - al = 'start'; - bl = 'middle'; - break; - } - - if (tx != null && ty != null) { - _fillText( - ctx, - style.text, - tx, ty, - style.textFont, - style.textAlign || al, - style.textBaseline || bl - ); - } - }; - // TODO - Base.prototype.isSilent = function () { - return !( - this.hoverable || this.draggable - || this.onmousemove || this.onmouseover || this.onmouseout - || this.onmousedown || this.onmouseup || this.onclick - || this.ondragenter || this.ondragover || this.ondragleave - || this.ondrop - ); - }; - - util.merge(Base.prototype, Transformable.prototype, true); - util.merge(Base.prototype, Dispatcher.prototype, true); - - return Base; - } -); +/** + * shape基类 + * @module zrender/shape/Base + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + * errorrik (errorrik@gmail.com) + */ + +/** + * @typedef {Object} IBaseShapeStyle + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ + +/** + * @typedef {Object} module:zrender/shape/Base~IBoundingRect + * @property {number} x 左上角顶点x轴坐标 + * @property {number} y 左上角顶点y轴坐标 + * @property {number} width 包围盒矩形宽度 + * @property {number} height 包围盒矩形高度 + */ + +define( + function(require) { + var vmlCanvasManager = window['G_vmlCanvasManager']; + + var matrix = require('../tool/matrix'); + var guid = require('../tool/guid'); + var util = require('../tool/util'); + var log = require('../tool/log'); + + var Transformable = require('../mixin/Transformable'); + var Eventful = require('../mixin/Eventful'); + + function _fillText(ctx, text, x, y, textFont, textAlign, textBaseline) { + if (textFont) { + ctx.font = textFont; + } + ctx.textAlign = textAlign; + ctx.textBaseline = textBaseline; + var rect = _getTextRect( + text, x, y, textFont, textAlign, textBaseline + ); + + text = (text + '').split('\n'); + var lineHeight = require('../tool/area').getTextHeight('国', textFont); + + switch (textBaseline) { + case 'top': + y = rect.y; + break; + case 'bottom': + y = rect.y + lineHeight; + break; + default: + y = rect.y + lineHeight / 2; + } + + for (var i = 0, l = text.length; i < l; i++) { + ctx.fillText(text[i], x, y); + y += lineHeight; + } + } + + /** + * 返回矩形区域,用于局部刷新和文字定位 + * @inner + * @param {string} text + * @param {number} x + * @param {number} y + * @param {string} textFont + * @param {string} textAlign + * @param {string} textBaseline + */ + function _getTextRect(text, x, y, textFont, textAlign, textBaseline) { + var area = require('../tool/area'); + var width = area.getTextWidth(text, textFont); + var lineHeight = area.getTextHeight('国', textFont); + + text = (text + '').split('\n'); + + switch (textAlign) { + case 'end': + case 'right': + x -= width; + break; + case 'center': + x -= (width / 2); + break; + } + + switch (textBaseline) { + case 'top': + break; + case 'bottom': + y -= lineHeight * text.length; + break; + default: + y -= lineHeight * text.length / 2; + } + + return { + x : x, + y : y, + width : width, + height : lineHeight * text.length + }; + } + + /** + * @alias module:zrender/shape/Base + * @constructor + * @extends module:zrender/mixin/Transformable + * @extends module:zrender/mixin/Eventful + * @param {Object} options 关于shape的配置项,可以是shape的自有属性,也可以是自定义的属性。 + */ + var Base = function(options) { + + options = options || {}; + + /** + * Shape id, 全局唯一 + * @type {string} + */ + this.id = options.id || guid(); + + for (var key in options) { + this[key] = options[key]; + } + + /** + * 基础绘制样式 + * @type {module:zrender/shape/Base~IBaseShapeStyle} + */ + this.style = this.style || {}; + + /** + * 高亮样式 + * @type {module:zrender/shape/Base~IBaseShapeStyle} + */ + this.highlightStyle = this.highlightStyle || null; + + /** + * 父节点 + * @readonly + * @type {module:zrender/Group} + * @default null + */ + this.parent = null; + + this.__dirty = true; + + this.__clipShapes = []; + + Transformable.call(this); + Eventful.call(this); + }; + /** + * 图形是否可见,为true时不绘制图形,但是仍能触发鼠标事件 + * @name module:zrender/shape/Base#invisible + * @type {boolean} + * @default false + */ + Base.prototype.invisible = false; + + /** + * 图形是否忽略,为true时忽略图形的绘制以及事件触发 + * @name module:zrender/shape/Base#ignore + * @type {boolean} + * @default false + */ + Base.prototype.ignore = false; + + /** + * z层level,决定绘画在哪层canvas中 + * @name module:zrender/shape/Base#zlevel + * @type {number} + * @default 0 + */ + Base.prototype.zlevel = 0; + + /** + * 是否可拖拽 + * @name module:zrender/shape/Base#draggable + * @type {boolean} + * @default false + */ + Base.prototype.draggable = false; + + /** + * 是否可点击 + * @name module:zrender/shape/Base#clickable + * @type {boolean} + * @default false + */ + Base.prototype.clickable = false; + + /** + * 是否可以hover + * @name module:zrender/shape/Base#hoverable + * @type {boolean} + * @default true + */ + Base.prototype.hoverable = true; + + /** + * z值,跟zlevel一样影响shape绘制的前后顺序,z值大的shape会覆盖在z值小的上面, + * 但是并不会创建新的canvas,所以优先级低于zlevel,而且频繁改动的开销比zlevel小很多。 + * + * @name module:zrender/shape/Base#z + * @type {number} + * @default 0 + */ + Base.prototype.z = 0; + + /** + * 绘制图形 + * + * @param {CanvasRenderingContext2D} ctx + * @param {boolean} [isHighlight=false] 是否使用高亮属性 + * @param {Function} [updateCallback] + * 需要异步加载资源的shape可以通过这个callback(e), + * 让painter更新视图,base.brush没用,需要的话重载brush + */ + Base.prototype.brush = function (ctx, isHighlight) { + + var style = this.beforeBrush(ctx, isHighlight); + + ctx.beginPath(); + this.buildPath(ctx, style); + + switch (style.brushType) { + /* jshint ignore:start */ + case 'both': + ctx.fill(); + case 'stroke': + style.lineWidth > 0 && ctx.stroke(); + break; + /* jshint ignore:end */ + default: + ctx.fill(); + } + + this.drawText(ctx, style, this.style); + + this.afterBrush(ctx); + }; + + /** + * 具体绘制操作前的一些公共操作 + * @param {CanvasRenderingContext2D} ctx + * @param {boolean} [isHighlight=false] 是否使用高亮属性 + * @return {Object} 处理后的样式 + */ + Base.prototype.beforeBrush = function (ctx, isHighlight) { + var style = this.style; + + if (this.brushTypeOnly) { + style.brushType = this.brushTypeOnly; + } + + if (isHighlight) { + // 根据style扩展默认高亮样式 + style = this.getHighlightStyle( + style, + this.highlightStyle || {}, + this.brushTypeOnly + ); + } + + if (this.brushTypeOnly == 'stroke') { + style.strokeColor = style.strokeColor || style.color; + } + + ctx.save(); + + this.doClip(ctx); + + this.setContext(ctx, style); + + // 设置transform + this.setTransform(ctx); + + return style; + }; + + /** + * 绘制后的处理 + * @param {CanvasRenderingContext2D} ctx + */ + Base.prototype.afterBrush = function (ctx) { + ctx.restore(); + }; + + var STYLE_CTX_MAP = [ + [ 'color', 'fillStyle' ], + [ 'strokeColor', 'strokeStyle' ], + [ 'opacity', 'globalAlpha' ], + [ 'lineCap', 'lineCap' ], + [ 'lineJoin', 'lineJoin' ], + [ 'miterLimit', 'miterLimit' ], + [ 'lineWidth', 'lineWidth' ], + [ 'shadowBlur', 'shadowBlur' ], + [ 'shadowColor', 'shadowColor' ], + [ 'shadowOffsetX', 'shadowOffsetX' ], + [ 'shadowOffsetY', 'shadowOffsetY' ] + ]; + + /** + * 设置 fillStyle, strokeStyle, shadow 等通用绘制样式 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Base~IBaseShapeStyle} style + */ + Base.prototype.setContext = function (ctx, style) { + for (var i = 0, len = STYLE_CTX_MAP.length; i < len; i++) { + var styleProp = STYLE_CTX_MAP[i][0]; + var styleValue = style[styleProp]; + var ctxProp = STYLE_CTX_MAP[i][1]; + + if (typeof styleValue != 'undefined') { + ctx[ctxProp] = styleValue; + } + } + }; + + var clipShapeInvTransform = matrix.create(); + Base.prototype.doClip = function (ctx) { + if (this.__clipShapes && !vmlCanvasManager) { + for (var i = 0; i < this.__clipShapes.length; i++) { + var clipShape = this.__clipShapes[i]; + if (clipShape.needTransform) { + var m = clipShape.transform; + matrix.invert(clipShapeInvTransform, m); + ctx.transform( + m[0], m[1], + m[2], m[3], + m[4], m[5] + ); + } + ctx.beginPath(); + clipShape.buildPath(ctx, clipShape.style); + ctx.clip(); + // Transform back + if (clipShape.needTransform) { + var m = clipShapeInvTransform; + ctx.transform( + m[0], m[1], + m[2], m[3], + m[4], m[5] + ); + } + } + } + }; + + /** + * 根据默认样式扩展高亮样式 + * + * @param {module:zrender/shape/Base~IBaseShapeStyle} style 默认样式 + * @param {module:zrender/shape/Base~IBaseShapeStyle} highlightStyle 高亮样式 + * @param {string} brushTypeOnly + */ + Base.prototype.getHighlightStyle = function (style, highlightStyle, brushTypeOnly) { + var newStyle = {}; + for (var k in style) { + newStyle[k] = style[k]; + } + + var color = require('../tool/color'); + var highlightColor = color.getHighlightColor(); + // 根据highlightStyle扩展 + if (style.brushType != 'stroke') { + // 带填充则用高亮色加粗边线 + newStyle.strokeColor = highlightColor; + newStyle.lineWidth = (style.lineWidth || 1) + + this.getHighlightZoom(); + newStyle.brushType = 'both'; + } + else { + if (brushTypeOnly != 'stroke') { + // 描边型的则用原色加工高亮 + newStyle.strokeColor = highlightColor; + newStyle.lineWidth = (style.lineWidth || 1) + + this.getHighlightZoom(); + } + else { + // 线型的则用原色加工高亮 + newStyle.strokeColor = highlightStyle.strokeColor + || color.mix( + style.strokeColor, + color.toRGB(highlightColor) + ); + } + } + + // 可自定义覆盖默认值 + for (var k in highlightStyle) { + if (typeof highlightStyle[k] != 'undefined') { + newStyle[k] = highlightStyle[k]; + } + } + + return newStyle; + }; + + // 高亮放大效果参数 + // 当前统一设置为6,如有需要差异设置,通过this.type判断实例类型 + Base.prototype.getHighlightZoom = function () { + return this.type != 'text' ? 6 : 2; + }; + + /** + * 移动位置 + * @param {number} dx 横坐标变化 + * @param {number} dy 纵坐标变化 + */ + Base.prototype.drift = function (dx, dy) { + this.position[0] += dx; + this.position[1] += dy; + }; + + /** + * 变换鼠标位置到 shape 的局部坐标空间 + * @method + * @param {number} x + * @param {number} y + * @return {Array.} + */ + Base.prototype.getTansform = (function() { + + var invTransform = []; + + return function (x, y) { + var originPos = [ x, y ]; + // 对鼠标的坐标也做相同的变换 + if (this.needTransform && this.transform) { + matrix.invert(invTransform, this.transform); + + matrix.mulVector(originPos, invTransform, [ x, y, 1 ]); + + if (x == originPos[0] && y == originPos[1]) { + // 避免外部修改导致的needTransform不准确 + this.updateNeedTransform(); + } + } + return originPos; + }; + })(); + + /** + * 构建绘制的Path + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Base~IBaseShapeStyle} style + */ + Base.prototype.buildPath = function (ctx, style) { + log('buildPath not implemented in ' + this.type); + }; + + /** + * 计算返回包围盒矩形 + * @param {module:zrender/shape/Base~IBaseShapeStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + Base.prototype.getRect = function (style) { + log('getRect not implemented in ' + this.type); + }; + + /** + * 判断鼠标位置是否在图形内 + * @param {number} x + * @param {number} y + * @return {boolean} + */ + Base.prototype.isCover = function (x, y) { + var originPos = this.getTansform(x, y); + x = originPos[0]; + y = originPos[1]; + + // 快速预判并保留判断矩形 + var rect = this.style.__rect; + if (!rect) { + rect = this.style.__rect = this.getRect(this.style); + } + + if (x >= rect.x + && x <= (rect.x + rect.width) + && y >= rect.y + && y <= (rect.y + rect.height) + ) { + // 矩形内 + return require('../tool/area').isInside(this, this.style, x, y); + } + + return false; + }; + + /** + * 绘制附加文本 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Base~IBaseShapeStyle} style 样式 + * @param {module:zrender/shape/Base~IBaseShapeStyle} normalStyle 默认样式,用于定位文字显示 + */ + Base.prototype.drawText = function (ctx, style, normalStyle) { + if (typeof(style.text) == 'undefined' || style.text === false) { + return; + } + // 字体颜色策略 + var textColor = style.textColor || style.color || style.strokeColor; + ctx.fillStyle = textColor; + + // 文本与图形间空白间隙 + var dd = 10; + var al; // 文本水平对齐 + var bl; // 文本垂直对齐 + var tx; // 文本横坐标 + var ty; // 文本纵坐标 + + var textPosition = style.textPosition // 用户定义 + || this.textPosition // shape默认 + || 'top'; // 全局默认 + + switch (textPosition) { + case 'inside': + case 'top': + case 'bottom': + case 'left': + case 'right': + if (this.getRect) { + var rect = (normalStyle || style).__rect + || this.getRect(normalStyle || style); + + switch (textPosition) { + case 'inside': + tx = rect.x + rect.width / 2; + ty = rect.y + rect.height / 2; + al = 'center'; + bl = 'middle'; + if (style.brushType != 'stroke' + && textColor == style.color + ) { + ctx.fillStyle = '#fff'; + } + break; + case 'left': + tx = rect.x - dd; + ty = rect.y + rect.height / 2; + al = 'end'; + bl = 'middle'; + break; + case 'right': + tx = rect.x + rect.width + dd; + ty = rect.y + rect.height / 2; + al = 'start'; + bl = 'middle'; + break; + case 'top': + tx = rect.x + rect.width / 2; + ty = rect.y - dd; + al = 'center'; + bl = 'bottom'; + break; + case 'bottom': + tx = rect.x + rect.width / 2; + ty = rect.y + rect.height + dd; + al = 'center'; + bl = 'top'; + break; + } + } + break; + case 'start': + case 'end': + var pointList = style.pointList + || [ + [style.xStart || 0, style.yStart || 0], + [style.xEnd || 0, style.yEnd || 0] + ]; + var length = pointList.length; + if (length < 2) { + // 少于2个点就不画了~ + return; + } + var xStart; + var xEnd; + var yStart; + var yEnd; + switch (textPosition) { + case 'start': + xStart = pointList[1][0]; + xEnd = pointList[0][0]; + yStart = pointList[1][1]; + yEnd = pointList[0][1]; + break; + case 'end': + xStart = pointList[length - 2][0]; + xEnd = pointList[length - 1][0]; + yStart = pointList[length - 2][1]; + yEnd = pointList[length - 1][1]; + break; + } + tx = xEnd; + ty = yEnd; + + var angle = Math.atan((yStart - yEnd) / (xEnd - xStart)) / Math.PI * 180; + if ((xEnd - xStart) < 0) { + angle += 180; + } + else if ((yStart - yEnd) < 0) { + angle += 360; + } + + dd = 5; + if (angle >= 30 && angle <= 150) { + al = 'center'; + bl = 'bottom'; + ty -= dd; + } + else if (angle > 150 && angle < 210) { + al = 'right'; + bl = 'middle'; + tx -= dd; + } + else if (angle >= 210 && angle <= 330) { + al = 'center'; + bl = 'top'; + ty += dd; + } + else { + al = 'left'; + bl = 'middle'; + tx += dd; + } + break; + case 'specific': + tx = style.textX || 0; + ty = style.textY || 0; + al = 'start'; + bl = 'middle'; + break; + } + + if (tx != null && ty != null) { + _fillText( + ctx, + style.text, + tx, ty, + style.textFont, + style.textAlign || al, + style.textBaseline || bl + ); + } + }; + + Base.prototype.modSelf = function() { + this.__dirty = true; + if (this.style) { + this.style.__rect = null; + } + if (this.highlightStyle) { + this.highlightStyle.__rect = null; + } + }; + + /** + * 图形是否会触发事件 + * @return {boolean} + */ + // TODO, 通过 bind 绑定的事件 + Base.prototype.isSilent = function () { + return !( + this.hoverable || this.draggable || this.clickable + || this.onmousemove || this.onmouseover || this.onmouseout + || this.onmousedown || this.onmouseup || this.onclick + || this.ondragenter || this.ondragover || this.ondragleave + || this.ondrop + ); + }; + + util.merge(Base.prototype, Transformable.prototype, true); + util.merge(Base.prototype, Eventful.prototype, true); + + return Base; + } +); diff --git a/amd/zrender/shape/BezierCurve.js b/amd/zrender/shape/BezierCurve.js index 642b7af..d43b06c 100644 --- a/amd/zrender/shape/BezierCurve.js +++ b/amd/zrender/shape/BezierCurve.js @@ -1,158 +1,148 @@ -/** - * zrender - * - * @author Neil (杨骥, yangji01@baidu.com) - * - * shape类:贝塞尔曲线 - * 可配图形属性: - { - // 基础属性 - shape : 'beziercurve', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - xStart : {number}, // 必须,起点横坐标 - yStart : {number}, // 必须,起点纵坐标 - cpX1 : {number}, // 必须,第一个关联点横坐标 - cpY1 : {number}, // 必须,第一个关联点纵坐标 - cpX2 : {number}, // 可选,第二个关联点横坐标 缺省即为二次贝塞尔曲线 - cpY2 : {number}, // 可选,第二个关联点纵坐标 - xEnd : {number}, // 必须,终点横坐标 - yEnd : {number}, // 必须,终点纵坐标 - strokeColor : {color}, // 默认为'#000',线条颜色(轮廓),支持rgba - - lineWidth : {number}, // 默认为1,线条宽度 - lineCap : {string}, // 默认为butt,线帽样式。butt | round | square - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为end,附加文本位置。 - // inside | start | end - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#000' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'beziercurve', - id : '123456', - zlevel : 1, - style : { - xStart : 100, - yStart : 100, - xEnd : 200, - yEnd : 200, - strokeColor : '#eee', - lineWidth : 20, - text : 'Baidu' - }, - myName : 'kener', //可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - function (require) { - var Base = require('./Base'); - - function BezierCurve( options ) { - this.brushTypeOnly = 'stroke'; //线条只能描边,填充后果自负 - this.textPosition = 'end'; - Base.call(this, options); - } - - BezierCurve.prototype = { - type: 'bezier-curve', - - /** - * 创建线条路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - ctx.moveTo(style.xStart, style.yStart); - if (typeof style.cpX2 != 'undefined' - && typeof style.cpY2 != 'undefined' - ) { - ctx.bezierCurveTo( - style.cpX1, style.cpY1, - style.cpX2, style.cpY2, - style.xEnd, style.yEnd - ); - } - else { - ctx.quadraticCurveTo( - style.cpX1, style.cpY1, - style.xEnd, style.yEnd - ); - } - - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function(style) { - if (style.__rect) { - return style.__rect; - } - - var _minX = Math.min(style.xStart, style.xEnd, style.cpX1); - var _minY = Math.min(style.yStart, style.yEnd, style.cpY1); - var _maxX = Math.max(style.xStart, style.xEnd, style.cpX1); - var _maxY = Math.max(style.yStart, style.yEnd, style.cpY1); - var _x2 = style.cpX2; - var _y2 = style.cpY2; - - if (typeof _x2 != 'undefined' - && typeof _y2 != 'undefined' - ) { - _minX = Math.min(_minX, _x2); - _minY = Math.min(_minY, _y2); - _maxX = Math.max(_maxX, _x2); - _maxY = Math.max(_maxY, _y2); - } - - var lineWidth = style.lineWidth || 1; - style.__rect = { - x : _minX - lineWidth, - y : _minY - lineWidth, - width : _maxX - _minX + lineWidth, - height : _maxY - _minY + lineWidth - }; - - return style.__rect; - } - }; - - require('../tool/util').inherits(BezierCurve, Base); - return BezierCurve; - } -); \ No newline at end of file +/** + * 贝塞尔曲线 + * @module zrender/shape/BezierCurve + * @author Neil (杨骥, 511415343@qq.com) + * @example + * var BezierCurve = require('zrender/shape/BezierCurve'); + * var shape = new BezierCurve({ + * style: { + * xStart: 0, + * yStart: 0, + * cpX1: 100, + * cpY1: 0, + * cpX2: 0, + * cpY2: 100, + * xEnd: 100, + * yEnd: 100, + * strokeColor: 'red' + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} IBezierCurveStyle + * @property {number} xStart 起点x坐标 + * @property {number} yStart 起点y坐标 + * @property {number} cpX1 第一个控制点x坐标 + * @property {number} cpY1 第一个控制点y坐标 + * @property {number} [cpX2] 第二个控制点x坐标,如果不给则为二次贝塞尔曲线 + * @property {number} [cpY2] 第二个控制点y坐标,如果不给则为二次贝塞尔曲线 + * @property {number} xEnd 终止点x坐标 + * @property {number} yEnd 终止点y坐标 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ + +define( + function (require) { + 'use strict'; + + var Base = require('./Base'); + + /** + * @alias module:zrender/shape/BezierCurve + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var BezierCurve = function(options) { + this.brushTypeOnly = 'stroke'; // 线条只能描边,填充后果自负 + this.textPosition = 'end'; + Base.call(this, options); + /** + * 贝赛尔曲线绘制样式 + * @name module:zrender/shape/BezierCurve#style + * @type {module:zrender/shape/BezierCurve~IBezierCurveStyle} + */ + /** + * 贝赛尔曲线高亮绘制样式 + * @name module:zrender/shape/BezierCurve#highlightStyle + * @type {module:zrender/shape/BezierCurve~IBezierCurveStyle} + */ + }; + + BezierCurve.prototype = { + type: 'bezier-curve', + + /** + * 创建贝塞尔曲线路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/BezierCurve~IBezierCurveStyle} style + */ + buildPath : function(ctx, style) { + ctx.moveTo(style.xStart, style.yStart); + if (typeof style.cpX2 != 'undefined' + && typeof style.cpY2 != 'undefined' + ) { + ctx.bezierCurveTo( + style.cpX1, style.cpY1, + style.cpX2, style.cpY2, + style.xEnd, style.yEnd + ); + } + else { + ctx.quadraticCurveTo( + style.cpX1, style.cpY1, + style.xEnd, style.yEnd + ); + } + }, + + /** + * 计算返回贝赛尔曲线包围盒矩形。 + * 该包围盒是直接从四个控制点计算,并非最小包围盒。 + * @param {module:zrender/shape/BezierCurve~IBezierCurveStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function(style) { + if (style.__rect) { + return style.__rect; + } + + var _minX = Math.min(style.xStart, style.xEnd, style.cpX1); + var _minY = Math.min(style.yStart, style.yEnd, style.cpY1); + var _maxX = Math.max(style.xStart, style.xEnd, style.cpX1); + var _maxY = Math.max(style.yStart, style.yEnd, style.cpY1); + var _x2 = style.cpX2; + var _y2 = style.cpY2; + + if (typeof _x2 != 'undefined' + && typeof _y2 != 'undefined' + ) { + _minX = Math.min(_minX, _x2); + _minY = Math.min(_minY, _y2); + _maxX = Math.max(_maxX, _x2); + _maxY = Math.max(_maxY, _y2); + } + + var lineWidth = style.lineWidth || 1; + style.__rect = { + x : _minX - lineWidth, + y : _minY - lineWidth, + width : _maxX - _minX + lineWidth, + height : _maxY - _minY + lineWidth + }; + + return style.__rect; + } + }; + + require('../tool/util').inherits(BezierCurve, Base); + return BezierCurve; + } +); diff --git a/amd/zrender/shape/BrokenLine.js b/amd/zrender/shape/BrokenLine.js deleted file mode 100644 index e55e97c..0000000 --- a/amd/zrender/shape/BrokenLine.js +++ /dev/null @@ -1,167 +0,0 @@ -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:折线 - * 可配图形属性: - { - // 基础属性 - shape : 'brokenLine', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - pointList : {Array}, // 必须,各个顶角坐标 - smooth : {Number}, // 默认为0 - strokeColor : {color}, // 默认为'#000',线条颜色(轮廓),支持rgba - lineType : {string}, // 默认为solid,线条类型,solid | dashed | dotted - lineWidth : {number}, // 默认为1,线条宽度 - lineCap : {string}, // 默认为butt,线帽样式。butt | round | square - lineJoin : {string}, // 默认为miter,线段连接样式。miter | round | bevel - miterLimit : {number}, // 默认为10,最大斜接长度,仅当lineJoin为miter时生效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为end,附加文本位置。 - // start | end - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#000' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'brokenLine', - id : '123456', - zlevel : 1, - style : { - pointList : [[10, 10], [300, 20], [298, 400], [50, 450]], - strokeColor : '#eee', - lineWidth : 20, - text : 'Baidu' - }, - myName : 'kener', //可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - function (require) { - var Base = require('./Base'); - var smoothSpline = require('./util/smoothSpline'); - var smoothBezier = require('./util/smoothBezier'); - var dashedLineTo = require('./util/dashedLineTo'); - - function BrokenLine( options ) { - this.brushTypeOnly = 'stroke'; //线条只能描边,填充后果自负 - this.textPosition = 'end'; - Base.call(this, options); - } - - BrokenLine.prototype = { - type: 'broken-line', - - /** - * 创建多边形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - var pointList = style.pointList; - if (pointList.length < 2) { - // 少于2个点就不画了~ - return; - } - - var len = Math.min( - style.pointList.length, - Math.round(style.pointListLength || style.pointList.length) - ); - - if (style.smooth && style.smooth !== 'spline') { - var controlPoints = smoothBezier( - pointList, style.smooth - ); - - ctx.moveTo(pointList[0][0], pointList[0][1]); - var cp1; - var cp2; - var p; - for (var i = 0; i < len - 1; i++) { - cp1 = controlPoints[i * 2]; - cp2 = controlPoints[i * 2 + 1]; - p = pointList[i + 1]; - ctx.bezierCurveTo( - cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1] - ); - } - } - else { - if (style.smooth === 'spline') { - pointList = smoothSpline(pointList); - len = pointList.length; - } - if (!style.lineType || style.lineType == 'solid') { - //默认为实线 - ctx.moveTo(pointList[0][0],pointList[0][1]); - for (var i = 1; i < len; i++) { - ctx.lineTo(pointList[i][0],pointList[i][1]); - } - } - else if (style.lineType == 'dashed' - || style.lineType == 'dotted' - ) { - var dashLength = (style.lineWidth || 1) - * (style.lineType == 'dashed' ? 5 : 1); - ctx.moveTo(pointList[0][0],pointList[0][1]); - for (var i = 1; i < len; i++) { - dashedLineTo( - ctx, - pointList[i - 1][0], pointList[i - 1][1], - pointList[i][0], pointList[i][1], - dashLength - ); - } - } - } - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function(style) { - return require('./Polygon').prototype.getRect(style); - } - }; - - require('../tool/util').inherits(BrokenLine, Base); - return BrokenLine; - } -); diff --git a/amd/zrender/shape/Circle.js b/amd/zrender/shape/Circle.js index b54460f..4e97e5e 100644 --- a/amd/zrender/shape/Circle.js +++ b/amd/zrender/shape/Circle.js @@ -1,124 +1,115 @@ -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:圆 - * 可配图形属性: - { - // 基础属性 - shape : 'circle', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,圆心横坐标 - y : {number}, // 必须,圆心纵坐标 - r : {number}, // 必须,圆半径 - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为top,附加文本位置。 - // inside | left | right | top | bottom - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'circle', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - r : 50, - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - function (require) { - var Base = require('./Base'); - - function Circle(options) { - Base.call(this, options); - } - - Circle.prototype = { - type: 'circle', - /** - * 创建圆形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function (ctx, style) { - ctx.arc(style.x, style.y, style.r, 0, Math.PI * 2, true); - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function (style) { - if (style.__rect) { - return style.__rect; - } - - var lineWidth; - if (style.brushType == 'stroke' || style.brushType == 'fill') { - lineWidth = style.lineWidth || 1; - } - else { - lineWidth = 0; - } - style.__rect = { - x : Math.round(style.x - style.r - lineWidth / 2), - y : Math.round(style.y - style.r - lineWidth / 2), - width : style.r * 2 + lineWidth, - height : style.r * 2 + lineWidth - }; - - return style.__rect; - } - }; - - require('../tool/util').inherits(Circle, Base); - return Circle; - } -); \ No newline at end of file +/** + * 圆形 + * @module zrender/shape/Circle + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + * @example + * var Circle = require('zrender/shape/Circle'); + * var shape = new Circle({ + * style: { + * x: 100, + * y: 100, + * r: 40, + * brushType: 'both', + * color: 'blue', + * strokeColor: 'red', + * lineWidth: 3, + * text: 'Circle' + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} ICircleStyle + * @property {number} x 圆心x坐标 + * @property {number} y 圆心y坐标 + * @property {number} r 半径 + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ +define( + function (require) { + 'use strict'; + + var Base = require('./Base'); + + /** + * @alias module:zrender/shape/Circle + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var Circle = function(options) { + Base.call(this, options); + /** + * 圆形绘制样式 + * @name module:zrender/shape/Circle#style + * @type {module:zrender/shape/Circle~ICircleStyle} + */ + /** + * 圆形高亮绘制样式 + * @name module:zrender/shape/Circle#highlightStyle + * @type {module:zrender/shape/Circle~ICircleStyle} + */ + }; + + Circle.prototype = { + type: 'circle', + /** + * 创建圆形路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Circle~ICircleStyle} style + */ + buildPath : function (ctx, style) { + ctx.arc(style.x, style.y, style.r, 0, Math.PI * 2, true); + return; + }, + + /** + * 计算返回圆形的包围盒矩形 + * @param {module:zrender/shape/Circle~ICircleStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function (style) { + if (style.__rect) { + return style.__rect; + } + + var lineWidth; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } + else { + lineWidth = 0; + } + style.__rect = { + x : Math.round(style.x - style.r - lineWidth / 2), + y : Math.round(style.y - style.r - lineWidth / 2), + width : style.r * 2 + lineWidth, + height : style.r * 2 + lineWidth + }; + + return style.__rect; + } + }; + + require('../tool/util').inherits(Circle, Base); + return Circle; + } +); diff --git a/amd/zrender/shape/Droplet.js b/amd/zrender/shape/Droplet.js index 8743e92..d8c6d12 100644 --- a/amd/zrender/shape/Droplet.js +++ b/amd/zrender/shape/Droplet.js @@ -1,141 +1,145 @@ -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:水滴 - * 可配图形属性: - { - // 基础属性 - shape : 'heart', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,水滴中心横坐标 - y : {number}, // 必须,水滴中心纵坐标 - a : {number}, // 必须,水滴横宽(中心到水平边缘最宽处距离) - b : {number}, // 必须,水滴纵高(中心到尖端距离) - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为outside,附加文本位置。 - // outside | inside - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'droplet', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - a : 50, - b : 80, - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - function (require) { - var Base = require('./Base'); - - function Droplet(options) { - Base.call(this, options); - } - - Droplet.prototype = { - type: 'droplet', - - /** - * 创建扇形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - ctx.moveTo(style.x, style.y + style.a); - ctx.bezierCurveTo( - style.x + style.a, - style.y + style.a, - style.x + style.a * 3 / 2, - style.y - style.a / 3, - style.x, - style.y - style.b - ); - ctx.bezierCurveTo( - style.x - style.a * 3 / 2, - style.y - style.a / 3, - style.x - style.a, - style.y + style.a, - style.x, - style.y + style.a - ); - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function(style) { - if (style.__rect) { - return style.__rect; - } - - var lineWidth; - if (style.brushType == 'stroke' || style.brushType == 'fill') { - lineWidth = style.lineWidth || 1; - } - else { - lineWidth = 0; - } - style.__rect = { - x : Math.round(style.x - style.a - lineWidth / 2), - y : Math.round(style.y - style.b - lineWidth / 2), - width : style.a * 2 + lineWidth, - height : style.a + style.b + lineWidth - }; - - return style.__rect; - } - }; - - require('../tool/util').inherits(Droplet, Base); - return Droplet; - } -); \ No newline at end of file +/** + * 水滴形状 + * @module zrender/shape/Droplet + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + * @example + * var Droplet = require('zrender/shape/Droplet'); + * var shape = new Droplet({ + * style: { + * x: 100, + * y: 100, + * a: 40, + * b: 40, + * brushType: 'both', + * color: 'blue', + * strokeColor: 'red', + * lineWidth: 3, + * text: 'Droplet' + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} IDropletStyle + * @property {number} x 水滴中心x坐标 + * @property {number} y 水滴中心y坐标 + * @property {number} a 水滴横宽(中心到水平边缘最宽处距离) + * @property {number} b 水滴纵高(中心到尖端距离) + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ +define( + function (require) { + 'use strict'; + + var Base = require('./Base'); + var PathProxy = require('./util/PathProxy'); + var area = require('../tool/area'); + + /** + * @alias module:zrender/shape/Droplet + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var Droplet = function(options) { + Base.call(this, options); + this._pathProxy = new PathProxy(); + /** + * 水滴绘制样式 + * @name module:zrender/shape/Droplet#style + * @type {module:zrender/shape/Droplet~IDropletStyle} + */ + /** + * 水滴高亮绘制样式 + * @name module:zrender/shape/Droplet#highlightStyle + * @type {module:zrender/shape/Droplet~IDropletStyle} + */ + }; + + Droplet.prototype = { + type: 'droplet', + + /** + * 创建水滴路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Droplet~IDropletStyle} style + */ + buildPath : function(ctx, style) { + var path = this._pathProxy || new PathProxy(); + path.begin(ctx); + + path.moveTo(style.x, style.y + style.a); + path.bezierCurveTo( + style.x + style.a, + style.y + style.a, + style.x + style.a * 3 / 2, + style.y - style.a / 3, + style.x, + style.y - style.b + ); + path.bezierCurveTo( + style.x - style.a * 3 / 2, + style.y - style.a / 3, + style.x - style.a, + style.y + style.a, + style.x, + style.y + style.a + ); + path.closePath(); + }, + + /** + * 计算返回水滴的包围盒矩形 + * @param {module:zrender/shape/Droplet~IDropletStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function (style) { + if (style.__rect) { + return style.__rect; + } + if (!this._pathProxy.isEmpty()) { + this.buildPath(null, style); + } + return this._pathProxy.fastBoundingRect(); + }, + + isCover: function (x, y) { + var originPos = this.getTansform(x, y); + x = originPos[0]; + y = originPos[1]; + + var rect = this.getRect(this.style); + if (x >= rect.x + && x <= (rect.x + rect.width) + && y >= rect.y + && y <= (rect.y + rect.height) + ) { + return area.isInsidePath( + this._pathProxy.pathCommands, this.style.lineWidth, this.style.brushType, x, y + ); + } + } + }; + + require('../tool/util').inherits(Droplet, Base); + return Droplet; + } +); diff --git a/amd/zrender/shape/Ellipse.js b/amd/zrender/shape/Ellipse.js index e44a5ac..966c865 100644 --- a/amd/zrender/shape/Ellipse.js +++ b/amd/zrender/shape/Ellipse.js @@ -1,139 +1,128 @@ -/** - * zrender - * - * author: loutongbing@baidu.com - * - * shape类:椭圆 - * Todo:excanvas bug ~ 连续scale保持?? IE8下不建议使用 - * 可配图形属性: - { - // 基础属性 - shape : 'ellipse', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,椭圆心横坐标 - y : {number}, // 必须,椭圆心纵坐标 - a : {number}, // 必须,椭圆横轴半径 - b : {number}, // 必须,椭圆纵轴半径 - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为top,附加文本位置。 - // inside | left | right | top | bottom - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'ellipse', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - a : 100, - b : 50, - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - function (require) { - var Base = require('./Base'); - - function Ellipse(options) { - Base.call(this, options); - } - - Ellipse.prototype = { - type: 'ellipse', - - /** - * 创建圆形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - var k = 0.5522848; - var x = style.x; - var y = style.y; - var a =style.a; - var b = style.b; - var ox = a * k; // 水平控制点偏移量 - var oy = b * k; // 垂直控制点偏移量 - //从椭圆的左端点开始顺时针绘制四条三次贝塞尔曲线 - ctx.moveTo(x - a, y); - ctx.bezierCurveTo(x - a, y - oy, x - ox, y - b, x, y - b); - ctx.bezierCurveTo(x + ox, y - b, x + a, y - oy, x + a, y); - ctx.bezierCurveTo(x + a, y + oy, x + ox, y + b, x, y + b); - ctx.bezierCurveTo(x - ox, y + b, x - a, y + oy, x - a, y); - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function(style) { - if (style.__rect) { - return style.__rect; - } - - var lineWidth; - if (style.brushType == 'stroke' || style.brushType == 'fill') { - lineWidth = style.lineWidth || 1; - } - else { - lineWidth = 0; - } - style.__rect = { - x : Math.round(style.x - style.a - lineWidth / 2), - y : Math.round(style.y - style.b - lineWidth / 2), - width : style.a * 2 + lineWidth, - height : style.b * 2 + lineWidth - }; - - return style.__rect; - } - }; - - require('../tool/util').inherits(Ellipse, Base); - return Ellipse; - } -); \ No newline at end of file +/** + * 水滴形状 + * @module zrender/shape/Ellipse + * @example + * var Ellipse = require('zrender/shape/Ellipse'); + * var shape = new Ellipse({ + * style: { + * x: 100, + * y: 100, + * a: 40, + * b: 20, + * brushType: 'both', + * color: 'blue', + * strokeColor: 'red', + * lineWidth: 3, + * text: 'Ellipse' + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} IEllipseStyle + * @property {number} x 圆心x坐标 + * @property {number} y 圆心y坐标 + * @property {number} a 横轴半径 + * @property {number} b 纵轴半径 + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ +define( + function (require) { + var Base = require('./Base'); + + /** + * @alias module:zrender/shape/Ellipse + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var Ellipse = function(options) { + Base.call(this, options); + /** + * 椭圆绘制样式 + * @name module:zrender/shape/Ellipse#style + * @type {module:zrender/shape/Ellipse~IEllipseStyle} + */ + /** + * 椭圆高亮绘制样式 + * @name module:zrender/shape/Ellipse#highlightStyle + * @type {module:zrender/shape/Ellipse~IEllipseStyle} + */ + }; + + Ellipse.prototype = { + type: 'ellipse', + + /** + * 构建椭圆的Path + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Ellipse~IEllipseStyle} style + */ + buildPath : function(ctx, style) { + var k = 0.5522848; + var x = style.x; + var y = style.y; + var a = style.a; + var b = style.b; + var ox = a * k; // 水平控制点偏移量 + var oy = b * k; // 垂直控制点偏移量 + // 从椭圆的左端点开始顺时针绘制四条三次贝塞尔曲线 + ctx.moveTo(x - a, y); + ctx.bezierCurveTo(x - a, y - oy, x - ox, y - b, x, y - b); + ctx.bezierCurveTo(x + ox, y - b, x + a, y - oy, x + a, y); + ctx.bezierCurveTo(x + a, y + oy, x + ox, y + b, x, y + b); + ctx.bezierCurveTo(x - ox, y + b, x - a, y + oy, x - a, y); + ctx.closePath(); + }, + + /** + /** + * 计算返回椭圆包围盒矩形。 + * @param {module:zrender/shape/Ellipse~IEllipseStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function(style) { + if (style.__rect) { + return style.__rect; + } + + var lineWidth; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } + else { + lineWidth = 0; + } + style.__rect = { + x : Math.round(style.x - style.a - lineWidth / 2), + y : Math.round(style.y - style.b - lineWidth / 2), + width : style.a * 2 + lineWidth, + height : style.b * 2 + lineWidth + }; + + return style.__rect; + } + }; + + require('../tool/util').inherits(Ellipse, Base); + return Ellipse; + } +); diff --git a/amd/zrender/shape/Group.js b/amd/zrender/shape/Group.js deleted file mode 100644 index c65a445..0000000 --- a/amd/zrender/shape/Group.js +++ /dev/null @@ -1,141 +0,0 @@ -define(function(require) { - - var guid = require('../tool/guid'); - var util = require('../tool/util'); - - var Dispatcher = require('../tool/event').Dispatcher; - var Transformable = require('./mixin/Transformable'); - - /** - * @constructor zrender.shape.Group - */ - function Group(options) { - - options = options || {}; - - this.id = options.id || guid(); - - for (var key in options) { - this[key] = options[key]; - } - - this.type = 'group'; - - this.clipShape = null; - - this._children = []; - - this._storage = null; - - this.__dirty = true; - - // Mixin - Transformable.call(this); - Dispatcher.call(this); - } - - Group.prototype.ignore = false; - - Group.prototype.children = function() { - return this._children.slice(); - }; - - Group.prototype.childAt = function(idx) { - return this._children[idx]; - }; - - Group.prototype.addChild = function(child) { - if (child == this) { - return; - } - - if (child.parent == this) { - return; - } - if (child.parent) { - child.parent.removeChild(child); - } - - this._children.push(child); - child.parent = this; - - if (this._storage && this._storage !== child._storage) { - - this._storage.addToMap(child); - - if (child instanceof Group) { - child.addChildrenToStorage(this._storage); - } - } - }; - - Group.prototype.removeChild = function(child) { - var idx = util.indexOf(this._children, child); - - this._children.splice(idx, 1); - child.parent = null; - - if (child._storage) { - - this._storage.delFromMap(child.id); - - if (child instanceof Group) { - child.delChildrenFromStorage(child._storage); - } - } - }; - - Group.prototype.each = function(cb, context) { - var haveContext = !!context; - for (var i = 0; i < this._children.length; i++) { - var child = this._children[i]; - if (haveContext) { - cb.call(context, child); - } else { - cb(child); - } - } - }; - - Group.prototype.iterate = function(cb, context) { - var haveContext = !!context; - - for (var i = 0; i < this._children.length; i++) { - var child = this._children[i]; - if (haveContext) { - cb.call(context, child); - } else { - cb(child); - } - - if (child.type === 'group') { - child.iterate(cb, context); - } - } - }; - - Group.prototype.addChildrenToStorage = function(storage) { - for (var i = 0; i < this._children.length; i++) { - var child = this._children[i]; - storage.addToMap(child); - if (child.type === 'group') { - child.addChildrenToStorage(storage); - } - } - }; - - Group.prototype.delChildrenFromStorage = function(storage) { - for (var i = 0; i < this._children.length; i++) { - var child = this._children[i]; - storage.delFromMap(child); - if (child.type === 'group') { - child.delChildrenFromStorage(storage); - } - } - }; - - util.merge(Group.prototype, Transformable.prototype, true); - util.merge(Group.prototype, Dispatcher.prototype, true); - - return Group; -}); \ No newline at end of file diff --git a/amd/zrender/shape/Heart.js b/amd/zrender/shape/Heart.js index 5477da7..773a6ff 100644 --- a/amd/zrender/shape/Heart.js +++ b/amd/zrender/shape/Heart.js @@ -1,142 +1,146 @@ -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:心形 - * 可配图形属性: - { - // 基础属性 - shape : 'heart', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,心形内部尖端横坐标 - y : {number}, // 必须,心形内部尖端纵坐标 - a : {number}, // 必须,心形横宽(中轴线到水平边缘最宽处距离) - b : {number}, // 必须,心形纵高(内尖到外尖距离) - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为outside,附加文本位置。 - // outside | inside - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'heart', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - a : 50, - b : 80, - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - function (require) { - var Base = require('./Base'); - - function Heart(options) { - Base.call(this, options); - } - - Heart.prototype = { - type: 'heart', - - /** - * 创建扇形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - ctx.moveTo(style.x, style.y); - ctx.bezierCurveTo( - style.x + style.a / 2, - style.y - style.b * 2 / 3, - style.x + style.a * 2, - style.y + style.b / 3, - style.x, - style.y + style.b - ); - ctx.bezierCurveTo( - style.x - style.a * 2, - style.y + style.b / 3, - style.x - style.a / 2, - style.y - style.b * 2 / 3, - style.x, - style.y - ); - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function(style) { - if (style.__rect) { - return style.__rect; - } - - var lineWidth; - if (style.brushType == 'stroke' || style.brushType == 'fill') { - lineWidth = style.lineWidth || 1; - } - else { - lineWidth = 0; - } - style.__rect = { - x : Math.round(style.x - style.a - lineWidth / 2), - y : Math.round(style.y - style.b / 4 - lineWidth / 2), - width : style.a * 2 + lineWidth, - height : style.b * 5 / 4 + lineWidth - }; - - return style.__rect; - } - }; - - require('../tool/util').inherits(Heart, Base); - return Heart; - } -); \ No newline at end of file +/** + * @module zrender/shape/Heart + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + * @example + * var Heart = require('zrender/shape/Heart'); + * var shape = new Heart({ + * style: { + * x: 100, + * y: 100, + * a: 40, + * b: 40, + * brushType: 'both', + * color: 'blue', + * strokeColor: 'red', + * lineWidth: 3, + * text: 'Heart' + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} IHeartStyle + * @property {number} x 心形内部尖端横坐标 + * @property {number} y 心形内部尖端纵坐标 + * @property {number} a 心形横宽(中轴线到水平边缘最宽处距离) + * @property {number} b 心形纵高(内尖到外尖距离) + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ +define( + function (require) { + 'use strict'; + + var Base = require('./Base'); + var PathProxy = require('./util/PathProxy'); + var area = require('../tool/area'); + + /** + * @alias module:zrender/shape/Heart + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var Heart = function (options) { + Base.call(this, options); + + this._pathProxy = new PathProxy(); + /** + * 心形绘制样式 + * @name module:zrender/shape/Heart#style + * @type {module:zrender/shape/Heart~IHeartStyle} + */ + /** + * 心形高亮绘制样式 + * @name module:zrender/shape/Heart#highlightStyle + * @type {module:zrender/shape/Heart~IHeartStyle} + */ + }; + + Heart.prototype = { + type: 'heart', + + /** + * 创建扇形路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Heart~IHeartStyle} style + */ + buildPath : function (ctx, style) { + var path = this._pathProxy || new PathProxy(); + path.begin(ctx); + + path.moveTo(style.x, style.y); + path.bezierCurveTo( + style.x + style.a / 2, + style.y - style.b * 2 / 3, + style.x + style.a * 2, + style.y + style.b / 3, + style.x, + style.y + style.b + ); + path.bezierCurveTo( + style.x - style.a * 2, + style.y + style.b / 3, + style.x - style.a / 2, + style.y - style.b * 2 / 3, + style.x, + style.y + ); + path.closePath(); + return; + }, + + /** + * 计算返回心形的包围盒矩形 + * @param {module:zrender/shape/Heart~IHeartStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function (style) { + if (style.__rect) { + return style.__rect; + } + if (!this._pathProxy.isEmpty()) { + this.buildPath(null, style); + } + return this._pathProxy.fastBoundingRect(); + }, + + isCover: function (x, y) { + var originPos = this.getTansform(x, y); + x = originPos[0]; + y = originPos[1]; + + var rect = this.getRect(this.style); + if (x >= rect.x + && x <= (rect.x + rect.width) + && y >= rect.y + && y <= (rect.y + rect.height) + ) { + return area.isInsidePath( + this._pathProxy.pathCommands, this.style.lineWidth, this.style.brushType, x, y + ); + } + } + }; + + require('../tool/util').inherits(Heart, Base); + return Heart; + } +); diff --git a/amd/zrender/shape/Image.js b/amd/zrender/shape/Image.js index 010a279..76abdaa 100644 --- a/amd/zrender/shape/Image.js +++ b/amd/zrender/shape/Image.js @@ -1,222 +1,201 @@ -/** - * zrender - * - * @author lang( shenyi01@baidu.com ) - * - * shape类:图片 - * 可配图形属性: - { - // 基础属性 - shape : 'image', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,左上角横坐标 - y : {number}, // 必须,左上角纵坐标 - width : {number}, // 可选,宽度 - height : {number}, // 可选,高度 - sx : {number}, // 可选, 从图片中裁剪的x - sy : {number}, // 可选, 从图片中裁剪的y - sWidth : {number}, // 可选, 从图片中裁剪的宽度 - sHeight : {number}, // 可选, 从图片中裁剪的高度 - image : {string|Image} // 必须,图片url或者图片对象 - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为top,附加文本位置。 - // inside | left | right | top | bottom - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'image', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - width : 150, - height : 50, - image : 'tests.jpg', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - function (require) { - var _cache = {}; - var _needsRefresh = []; - var _refreshTimeout; - - var Base = require('./Base'); - - function ZImage(options) { - Base.call(this, options); - } - - ZImage.prototype = { - type: 'image', - brush : function(ctx, isHighlight, refresh) { - var style = this.style || {}; - - if (isHighlight) { - // 根据style扩展默认高亮样式 - style = this.getHighlightStyle( - style, this.highlightStyle || {} - ); - } - - var image = style.image; - var me = this; - - if (typeof(image) === 'string') { - var src = image; - if (_cache[src]) { - image = _cache[src]; - } - else { - image = new Image();//document.createElement('image'); - image.onload = function(){ - image.onload = null; - clearTimeout(_refreshTimeout); - _needsRefresh.push( me ); - // 防止因为缓存短时间内触发多次onload事件 - _refreshTimeout = setTimeout(function(){ - refresh && refresh( _needsRefresh ); - // 清空needsRefresh - _needsRefresh = []; - }, 10); - }; - _cache[src] = image; - - image.src = src; - } - } - if (image) { - //图片已经加载完成 - if (image.nodeName.toUpperCase() == 'IMG') { - if (window.ActiveXObject) { - if (image.readyState != 'complete') { - return; - } - } - else { - if (!image.complete) { - return; - } - } - } - // Else is canvas - - var width = style.width || image.width; - var height = style.height || image.height; - var x = style.x; - var y = style.y; - - // 图片加载失败 - if (!image.width || !image.height) { - return; - } - - ctx.save(); - this.setContext(ctx, style); - - // 设置transform - this.setTransform(ctx); - - if (style.sWidth && style.sHeight) { - var sx = style.sx || 0; - var sy = style.sy || 0; - ctx.drawImage( - image, - sx, sy, style.sWidth, style.sHeight, - x, y, width, height - ); - } - else if (style.sx && style.sy) { - var sx = style.sx; - var sy = style.sy; - var sWidth = width - sx; - var sHeight = height - sy; - ctx.drawImage( - image, - sx, sy, sWidth, sHeight, - x, y, width, height - ); - } - else { - ctx.drawImage(image, x, y, width, height); - } - // 如果没设置宽和高的话自动根据图片宽高设置 - style.width = width; - style.height = height; - this.style.width = width; - this.style.height = height; - - - this.drawText(ctx, style, this.style); - - ctx.restore(); - } - }, - - /** - * 创建路径,用于判断hover时调用isPointInPath~ - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - ctx.rect(style.x, style.y, style.width, style.height); - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function(style) { - return { - x : style.x, - y : style.y, - width : style.width, - height : style.height - }; - } - }; - - require('../tool/util').inherits(ZImage, Base); - return ZImage; - } -); \ No newline at end of file +/** + * 图片绘制 + * @module zrender/shape/Image + * @author pissang(https://www.github.com/pissang) + * @example + * var ImageShape = require('zrender/shape/Image'); + * var image = new ImageShape({ + * style: { + * image: 'test.jpg', + * x: 100, + * y: 100 + * } + * }); + * zr.addShape(image); + */ + +/** + * @typedef {Object} IImageStyle + * @property {string|HTMLImageElement|HTMLCanvasElement} image 图片url或者图片对象 + * @property {number} x 左上角横坐标 + * @property {number} y 左上角纵坐标 + * @property {number} [width] 绘制到画布上的宽度,默认为图片宽度 + * @property {number} [height] 绘制到画布上的高度,默认为图片高度 + * @property {number} [sx=0] 从图片中裁剪的左上角横坐标 + * @property {number} [sy=0] 从图片中裁剪的左上角纵坐标 + * @property {number} [sWidth] 从图片中裁剪的宽度,默认为图片高度 + * @property {number} [sHeight] 从图片中裁剪的高度,默认为图片高度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ +define( + function (require) { + + var Base = require('./Base'); + + /** + * @alias zrender/shape/Image + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var ZImage = function(options) { + Base.call(this, options); + /** + * 图片绘制样式 + * @name module:zrender/shape/Image#style + * @type {module:zrender/shape/Image~IImageStyle} + */ + /** + * 图片高亮绘制样式 + * @name module:zrender/shape/Image#highlightStyle + * @type {module:zrender/shape/Image~IImageStyle} + */ + }; + + ZImage.prototype = { + + type: 'image', + + brush : function(ctx, isHighlight, refreshNextFrame) { + var style = this.style || {}; + + if (isHighlight) { + // 根据style扩展默认高亮样式 + style = this.getHighlightStyle( + style, this.highlightStyle || {} + ); + } + + var image = style.image; + var self = this; + + if (!this._imageCache) { + this._imageCache = {}; + } + if (typeof(image) === 'string') { + var src = image; + if (this._imageCache[src]) { + image = this._imageCache[src]; + } else { + image = new Image(); + image.onload = function () { + image.onload = null; + self.modSelf(); + refreshNextFrame(); + }; + + image.src = src; + this._imageCache[src] = image; + } + } + if (image) { + // 图片已经加载完成 + if (image.nodeName.toUpperCase() == 'IMG') { + if (window.ActiveXObject) { + if (image.readyState != 'complete') { + return; + } + } + else { + if (!image.complete) { + return; + } + } + } + // Else is canvas + var width = style.width || image.width; + var height = style.height || image.height; + var x = style.x; + var y = style.y; + // 图片加载失败 + if (!image.width || !image.height) { + return; + } + + ctx.save(); + + this.doClip(ctx); + + this.setContext(ctx, style); + + // 设置transform + this.setTransform(ctx); + + if (style.sWidth && style.sHeight) { + var sx = style.sx || 0; + var sy = style.sy || 0; + ctx.drawImage( + image, + sx, sy, style.sWidth, style.sHeight, + x, y, width, height + ); + } + else if (style.sx && style.sy) { + var sx = style.sx; + var sy = style.sy; + var sWidth = width - sx; + var sHeight = height - sy; + ctx.drawImage( + image, + sx, sy, sWidth, sHeight, + x, y, width, height + ); + } + else { + ctx.drawImage(image, x, y, width, height); + } + // 如果没设置宽和高的话自动根据图片宽高设置 + if (!style.width) { + style.width = width; + } + if (!style.height) { + style.height = height; + } + if (!this.style.width) { + this.style.width = width; + } + if (!this.style.height) { + this.style.height = height; + } + + this.drawText(ctx, style, this.style); + + ctx.restore(); + } + }, + + /** + * 计算返回图片的包围盒矩形 + * @param {module:zrender/shape/Image~IImageStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect: function(style) { + return { + x : style.x, + y : style.y, + width : style.width, + height : style.height + }; + }, + + clearCache: function() { + this._imageCache = {}; + } + }; + + require('../tool/util').inherits(ZImage, Base); + return ZImage; + } +); diff --git a/amd/zrender/shape/Isogon.js b/amd/zrender/shape/Isogon.js index 4ffb1de..0c464f3 100644 --- a/amd/zrender/shape/Isogon.js +++ b/amd/zrender/shape/Isogon.js @@ -1,158 +1,134 @@ -/** - * zrender - * - * @author sushuang (宿爽, sushuang@baidu.com) - * - * shape类:正n边形(n>=3) - * 可配图形属性: - { - // 基础属性 - shape : 'isogon', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,正n边形外接圆心横坐标 - y : {number}, // 必须,正n边形外接圆心纵坐标 - r : {number}, // 必须,正n边形外接圆半径 - n : {number}, // 必须,指明正几边形 - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - lineJoin : {string}, // 默认为miter,线段连接样式。miter | round | bevel - - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为outside,附加文本位置。 - // outside | inside - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'isogon', - id : '123456', - zlevel : 1, - style : { - x : 400, - y : 100, - r : 150, - n : 7, - color : '#eee' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - function (require) { - var math = require('../tool/math'); - var sin = math.sin; - var cos = math.cos; - var PI = Math.PI; - - var Base = require('./Base'); - - function Isogon(options) { - Base.call(this, options); - } - - Isogon.prototype = { - type: 'isogon', - - /** - * 创建n角星(n>=3)路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - var n = style.n; - if (!n || n < 2) { return; } - - var x = style.x; - var y = style.y; - var r = style.r; - - var dStep = 2 * PI / n; - var deg = -PI / 2; - var xStart = x + r * cos(deg); - var yStart = y + r * sin(deg); - deg += dStep; - - // 记录边界点,用于判断insight - var pointList = style.pointList = []; - pointList.push([xStart, yStart]); - for (var i = 0, end = n - 1; i < end; i ++) { - pointList.push([x + r * cos(deg), y + r * sin(deg)]); - deg += dStep; - } - pointList.push([xStart, yStart]); - - // 绘制 - ctx.moveTo(pointList[0][0], pointList[0][1]); - for (var i = 0; i < pointList.length; i ++) { - ctx.lineTo(pointList[i][0], pointList[i][1]); - } - - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function(style) { - if (style.__rect) { - return style.__rect; - } - - var lineWidth; - if (style.brushType == 'stroke' || style.brushType == 'fill') { - lineWidth = style.lineWidth || 1; - } - else { - lineWidth = 0; - } - style.__rect = { - x : Math.round(style.x - style.r - lineWidth / 2), - y : Math.round(style.y - style.r - lineWidth / 2), - width : style.r * 2 + lineWidth, - height : style.r * 2 + lineWidth - }; - - return style.__rect; - } - }; - - require('../tool/util').inherits(Isogon, Base); - return Isogon; - } -); \ No newline at end of file +/** + * 正多边形 + * @module zrender/shape/Isogon + * @author sushuang (宿爽, sushuang0322@gmail.com) + */ + +/** + * @typedef {Object} IIsogonStyle + * @property {number} x 正n边形外接圆心x坐标 + * @property {number} y 正n边形外接圆心y坐标 + * @property {number} r 正n边形外接圆半径 + * @property {number} n 指明正几边形 + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ +define( + function (require) { + var math = require('../tool/math'); + var sin = math.sin; + var cos = math.cos; + var PI = Math.PI; + + var Base = require('./Base'); + + /** + * @constructor + * @alias module:zrender/shape/Isogon + * @param {Object} options + */ + function Isogon(options) { + Base.call(this, options); + /** + * 多边形绘制样式 + * @name module:zrender/shape/Isogon#style + * @type {module:zrender/shape/Isogon~IIsogonStyle} + */ + /** + * 多边形高亮绘制样式 + * @name module:zrender/shape/Isogon#highlightStyle + * @type {module:zrender/shape/Isogon~IIsogonStyle} + */ + } + + Isogon.prototype = { + type: 'isogon', + + /** + * 创建n角星(n>=3)路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Isogon~IIsogonStyle} style + */ + buildPath : function (ctx, style) { + var n = style.n; + if (!n || n < 2) { + return; + } + + var x = style.x; + var y = style.y; + var r = style.r; + + var dStep = 2 * PI / n; + var deg = -PI / 2; + var xStart = x + r * cos(deg); + var yStart = y + r * sin(deg); + deg += dStep; + + // 记录边界点,用于判断insight + var pointList = style.pointList = []; + pointList.push([ xStart, yStart ]); + for (var i = 0, end = n - 1; i < end; i++) { + pointList.push([ x + r * cos(deg), y + r * sin(deg) ]); + deg += dStep; + } + pointList.push([ xStart, yStart ]); + + // 绘制 + ctx.moveTo(pointList[0][0], pointList[0][1]); + for (var i = 0; i < pointList.length; i++) { + ctx.lineTo(pointList[i][0], pointList[i][1]); + } + ctx.closePath(); + + return; + }, + + /** + * 计算返回正多边形的包围盒矩形 + * @param {module:zrender/shape/Isogon~IIsogonStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function (style) { + if (style.__rect) { + return style.__rect; + } + + var lineWidth; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } + else { + lineWidth = 0; + } + style.__rect = { + x : Math.round(style.x - style.r - lineWidth / 2), + y : Math.round(style.y - style.r - lineWidth / 2), + width : style.r * 2 + lineWidth, + height : style.r * 2 + lineWidth + }; + + return style.__rect; + } + }; + + require('../tool/util').inherits(Isogon, Base); + return Isogon; + } +); diff --git a/amd/zrender/shape/Line.js b/amd/zrender/shape/Line.js index 2652a04..204f2f1 100644 --- a/amd/zrender/shape/Line.js +++ b/amd/zrender/shape/Line.js @@ -1,141 +1,125 @@ -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:直线 - * 可配图形属性: - { - // 基础属性 - shape : 'line', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - xStart : {number}, // 必须,起点横坐标 - yStart : {number}, // 必须,起点纵坐标 - xEnd : {number}, // 必须,终点横坐标 - yEnd : {number}, // 必须,终点纵坐标 - strokeColor : {color}, // 默认为'#000',线条颜色(轮廓),支持rgba - lineType : {string}, // 默认为solid,线条类型,solid | dashed | dotted - lineWidth : {number}, // 默认为1,线条宽度 - lineCap : {string}, // 默认为butt,线帽样式。butt | round | square - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为end,附加文本位置。 - // inside | start | end - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#000' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'line', - id : '123456', - zlevel : 1, - style : { - xStart : 100, - yStart : 100, - xEnd : 200, - yEnd : 200, - strokeColor : '#eee', - lineWidth : 20, - text : 'Baidu' - }, - myName : 'kener', //可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - function (require) { - var Base = require('./Base'); - var dashedLineTo = require('./util/dashedLineTo'); - - function Line(options) { - this.brushTypeOnly = 'stroke'; //线条只能描边,填充后果自负 - this.textPosition = 'end'; - Base.call(this, options); - } - - Line.prototype = { - type: 'line', - - /** - * 创建线条路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - if (!style.lineType || style.lineType == 'solid') { - //默认为实线 - ctx.moveTo(style.xStart, style.yStart); - ctx.lineTo(style.xEnd, style.yEnd); - } - else if (style.lineType == 'dashed' - || style.lineType == 'dotted' - ) { - var dashLength = (style.lineWidth || 1) - * (style.lineType == 'dashed' ? 5 : 1); - dashedLineTo( - ctx, - style.xStart, style.yStart, - style.xEnd, style.yEnd, - dashLength - ); - } - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function(style) { - if (style.__rect) { - return style.__rect; - } - - var lineWidth = style.lineWidth || 1; - style.__rect = { - x : Math.min(style.xStart, style.xEnd) - lineWidth, - y : Math.min(style.yStart, style.yEnd) - lineWidth, - width : Math.abs(style.xStart - style.xEnd) - + lineWidth, - height : Math.abs(style.yStart - style.yEnd) - + lineWidth - }; - - return style.__rect; - } - }; - - require('../tool/util').inherits(Line, Base); - return Line; - } -); \ No newline at end of file +/** + * 直线 + * @module zrender/shape/Line + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + * @example + * var Line = require('zrender/shape/Line'); + * var shape = new Line({ + * style: { + * xStart: 0, + * yStart: 0, + * xEnd: 100, + * yEnd: 100, + * strokeColor: '#000', + * lineWidth: 10 + * } + * }); + * zr.addShape(line); + */ +/** + * @typedef {Object} ILineStyle + * @property {number} xStart 起点x坐标 + * @property {number} yStart 起点y坐标 + * @property {number} xEnd 终止点x坐标 + * @property {number} yEnd 终止点y坐标 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ +define( + function (require) { + var Base = require('./Base'); + var dashedLineTo = require('./util/dashedLineTo'); + + /** + * @alias module:zrender/shape/Line + * @param {Object} options + * @constructor + * @extends module:zrender/shape/Base + */ + var Line = function (options) { + this.brushTypeOnly = 'stroke'; // 线条只能描边,填充后果自负 + this.textPosition = 'end'; + Base.call(this, options); + + /** + * 直线绘制样式 + * @name module:zrender/shape/Line#style + * @type {module:zrender/shape/Line~ILineStyle} + */ + /** + * 直线高亮绘制样式 + * @name module:zrender/shape/Line#highlightStyle + * @type {module:zrender/shape/Line~ILineStyle} + */ + }; + + Line.prototype = { + type: 'line', + + /** + * 创建线条路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Line~ILineStyle} style + */ + buildPath : function (ctx, style) { + if (!style.lineType || style.lineType == 'solid') { + // 默认为实线 + ctx.moveTo(style.xStart, style.yStart); + ctx.lineTo(style.xEnd, style.yEnd); + } + else if (style.lineType == 'dashed' + || style.lineType == 'dotted' + ) { + var dashLength = (style.lineWidth || 1) + * (style.lineType == 'dashed' ? 5 : 1); + dashedLineTo( + ctx, + style.xStart, style.yStart, + style.xEnd, style.yEnd, + dashLength + ); + } + }, + + /** + * 计算返回线条的包围盒矩形 + * @param {module:zrender/shape/Line~ILineStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function (style) { + if (style.__rect) { + return style.__rect; + } + + var lineWidth = style.lineWidth || 1; + style.__rect = { + x : Math.min(style.xStart, style.xEnd) - lineWidth, + y : Math.min(style.yStart, style.yEnd) - lineWidth, + width : Math.abs(style.xStart - style.xEnd) + + lineWidth, + height : Math.abs(style.yStart - style.yEnd) + + lineWidth + }; + + return style.__rect; + } + }; + + require('../tool/util').inherits(Line, Base); + return Line; + } +); diff --git a/amd/zrender/shape/Path.js b/amd/zrender/shape/Path.js index cea7cce..88a7e31 100644 --- a/amd/zrender/shape/Path.js +++ b/amd/zrender/shape/Path.js @@ -1,559 +1,533 @@ -/** - * zrender - * - * author: CrossDo (chenhuaimu@baidu.com) - * - * shape类:路径 - * 可配图形属性: - { - // 基础属性 - shape : 'path', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - path : {string},// 必须,路径。例如:M 0 0 L 0 10 L 10 10 Z (一个三角形) - //M = moveto - //L = lineto - //H = horizontal lineto - //V = vertical lineto - //C = curveto - //S = smooth curveto - //Q = quadratic Belzier curve - //T = smooth quadratic Belzier curveto - //Z = closepath - - - x : {number}, // 必须,x轴坐标 - y : {number}, // 必须,y轴坐标 - - - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为top,附加文本位置。 - // inside | left | right | top | bottom - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - - **/ - -define(function (require) { - var Base = require('./Base'); - - function Path(options) { - Base.call(this, options); - } - - Path.prototype = { - type: 'path', - - _parsePathData : function(data) { - if (!data) { - return []; - } - - // command string - var cs = data; - - // command chars - var cc = [ - 'm', 'M', 'l', 'L', 'v', 'V', 'h', 'H', 'z', 'Z', - 'c', 'C', 'q', 'Q', 't', 'T', 's', 'S', 'a', 'A' - ]; - - cs = cs.replace(/-/g, ' -'); - cs = cs.replace(/ /g, ' '); - cs = cs.replace(/ /g, ','); - cs = cs.replace(/,,/g, ','); - - - var n; - // create pipes so that we can split the data - for (n = 0; n < cc.length; n++) { - cs = cs.replace(new RegExp(cc[n], 'g'), '|' + cc[n]); - } - - // create array - var arr = cs.split('|'); - var ca = []; - // init context point - var cpx = 0; - var cpy = 0; - for (n = 1; n < arr.length; n++) { - var str = arr[n]; - var c = str.charAt(0); - str = str.slice(1); - str = str.replace(new RegExp('e,-', 'g'), 'e-'); - - var p = str.split(','); - if (p.length > 0 && p[0] === '') { - p.shift(); - } - - for (var i = 0; i < p.length; i++) { - p[i] = parseFloat(p[i]); - } - while (p.length > 0) { - if (isNaN(p[0])) { - break; - } - var cmd = null; - var points = []; - - var ctlPtx; - var ctlPty; - var prevCmd; - - var rx; - var ry; - var psi; - var fa; - var fs; - - var x1 = cpx; - var y1 = cpy; - - // convert l, H, h, V, and v to L - switch (c) { - case 'l': - cpx += p.shift(); - cpy += p.shift(); - cmd = 'L'; - points.push(cpx, cpy); - break; - case 'L': - cpx = p.shift(); - cpy = p.shift(); - points.push(cpx, cpy); - break; - case 'm': - cpx += p.shift(); - cpy += p.shift(); - cmd = 'M'; - points.push(cpx, cpy); - c = 'l'; - break; - case 'M': - cpx = p.shift(); - cpy = p.shift(); - cmd = 'M'; - points.push(cpx, cpy); - c = 'L'; - break; - - case 'h': - cpx += p.shift(); - cmd = 'L'; - points.push(cpx, cpy); - break; - case 'H': - cpx = p.shift(); - cmd = 'L'; - points.push(cpx, cpy); - break; - case 'v': - cpy += p.shift(); - cmd = 'L'; - points.push(cpx, cpy); - break; - case 'V': - cpy = p.shift(); - cmd = 'L'; - points.push(cpx, cpy); - break; - case 'C': - points.push(p.shift(), p.shift(), p.shift(), p.shift()); - cpx = p.shift(); - cpy = p.shift(); - points.push(cpx, cpy); - break; - case 'c': - points.push( - cpx + p.shift(), cpy + p.shift(), - cpx + p.shift(), cpy + p.shift() - ); - cpx += p.shift(); - cpy += p.shift(); - cmd = 'C'; - points.push(cpx, cpy); - break; - case 'S': - ctlPtx = cpx; - ctlPty = cpy; - prevCmd = ca[ca.length - 1]; - if (prevCmd.command === 'C') { - ctlPtx = cpx + (cpx - prevCmd.points[2]); - ctlPty = cpy + (cpy - prevCmd.points[3]); - } - points.push(ctlPtx, ctlPty, p.shift(), p.shift()); - cpx = p.shift(); - cpy = p.shift(); - cmd = 'C'; - points.push(cpx, cpy); - break; - case 's': - ctlPtx = cpx, ctlPty = cpy; - prevCmd = ca[ca.length - 1]; - if (prevCmd.command === 'C') { - ctlPtx = cpx + (cpx - prevCmd.points[2]); - ctlPty = cpy + (cpy - prevCmd.points[3]); - } - points.push( - ctlPtx, ctlPty, - cpx + p.shift(), cpy + p.shift() - ); - cpx += p.shift(); - cpy += p.shift(); - cmd = 'C'; - points.push(cpx, cpy); - break; - case 'Q': - points.push(p.shift(), p.shift()); - cpx = p.shift(); - cpy = p.shift(); - points.push(cpx, cpy); - break; - case 'q': - points.push(cpx + p.shift(), cpy + p.shift()); - cpx += p.shift(); - cpy += p.shift(); - cmd = 'Q'; - points.push(cpx, cpy); - break; - case 'T': - ctlPtx = cpx, ctlPty = cpy; - prevCmd = ca[ca.length - 1]; - if (prevCmd.command === 'Q') { - ctlPtx = cpx + (cpx - prevCmd.points[0]); - ctlPty = cpy + (cpy - prevCmd.points[1]); - } - cpx = p.shift(); - cpy = p.shift(); - cmd = 'Q'; - points.push(ctlPtx, ctlPty, cpx, cpy); - break; - case 't': - ctlPtx = cpx, ctlPty = cpy; - prevCmd = ca[ca.length - 1]; - if (prevCmd.command === 'Q') { - ctlPtx = cpx + (cpx - prevCmd.points[0]); - ctlPty = cpy + (cpy - prevCmd.points[1]); - } - cpx += p.shift(); - cpy += p.shift(); - cmd = 'Q'; - points.push(ctlPtx, ctlPty, cpx, cpy); - break; - case 'A': - rx = p.shift(); - ry = p.shift(); - psi = p.shift(); - fa = p.shift(); - fs = p.shift(); - - x1 = cpx, y1 = cpy; - cpx = p.shift(), cpy = p.shift(); - cmd = 'A'; - points = this._convertPoint( - x1, y1, cpx, cpy, fa, fs, rx, ry, psi - ); - break; - case 'a': - rx = p.shift(); - ry = p.shift(); - psi = p.shift(); - fa = p.shift(); - fs = p.shift(); - - x1 = cpx, y1 = cpy; - cpx += p.shift(); - cpy += p.shift(); - cmd = 'A'; - points = this._convertPoint( - x1, y1, cpx, cpy, fa, fs, rx, ry, psi - ); - break; - - } - - ca.push({ - command : cmd || c, - points : points - }); - } - - if (c === 'z' || c === 'Z') { - ca.push({ - command : 'z', - points : [] - }); - } - } - - return ca; - - }, - - _convertPoint : function(x1, y1, x2, y2, fa, fs, rx, ry, psiDeg) { - var psi = psiDeg * (Math.PI / 180.0); - var xp = Math.cos(psi) * (x1 - x2) / 2.0 - + Math.sin(psi) * (y1 - y2) / 2.0; - var yp = -1 * Math.sin(psi) * (x1 - x2) / 2.0 - + Math.cos(psi) * (y1 - y2) / 2.0; - - var lambda = (xp * xp) / (rx * rx) + (yp * yp) / (ry * ry); - - if (lambda > 1) { - rx *= Math.sqrt(lambda); - ry *= Math.sqrt(lambda); - } - - var f = Math.sqrt((((rx * rx) * (ry * ry)) - - ((rx * rx) * (yp * yp)) - - ((ry * ry) * (xp * xp))) / ((rx * rx) * (yp * yp) - + (ry * ry) * (xp * xp)) - ); - - if (fa === fs) { - f *= -1; - } - if (isNaN(f)) { - f = 0; - } - - var cxp = f * rx * yp / ry; - var cyp = f * -ry * xp / rx; - - var cx = (x1 + x2) / 2.0 - + Math.cos(psi) * cxp - - Math.sin(psi) * cyp; - var cy = (y1 + y2) / 2.0 - + Math.sin(psi) * cxp - + Math.cos(psi) * cyp; - - var vMag = function(v) { - return Math.sqrt(v[0] * v[0] + v[1] * v[1]); - }; - var vRatio = function(u, v) { - return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v)); - }; - var vAngle = function(u, v) { - return (u[0] * v[1] < u[1] * v[0] ? -1 : 1) - * Math.acos(vRatio(u, v)); - }; - var theta = vAngle([ 1, 0 ], [ (xp - cxp) / rx, (yp - cyp) / ry ]); - var u = [ (xp - cxp) / rx, (yp - cyp) / ry ]; - var v = [ (-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry ]; - var dTheta = vAngle(u, v); - - if (vRatio(u, v) <= -1) { - dTheta = Math.PI; - } - if (vRatio(u, v) >= 1) { - dTheta = 0; - } - if (fs === 0 && dTheta > 0) { - dTheta = dTheta - 2 * Math.PI; - } - if (fs === 1 && dTheta < 0) { - dTheta = dTheta + 2 * Math.PI; - } - return [ cx, cy, rx, ry, theta, dTheta, psi, fs ]; - }, - - /** - * 创建路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - var path = style.path; - - var pathArray = this.pathArray || this._parsePathData(path); - - // 平移坐标 - var x = style.x || 0; - var y = style.y || 0; - - var p; - // 记录边界点,用于判断inside - var pointList = style.pointList = []; - var singlePointList = []; - for (var i = 0, l = pathArray.length; i < l; i++) { - if (pathArray[i].command.toUpperCase() == 'M') { - singlePointList.length > 0 - && pointList.push(singlePointList); - singlePointList = []; - } - p = pathArray[i].points; - for (var j = 0, k = p.length; j < k; j += 2) { - singlePointList.push([p[j] + x, p[j+1] + y]); - } - } - singlePointList.length > 0 && pointList.push(singlePointList); - - var c; - for (var i = 0, l = pathArray.length; i < l; i++) { - c = pathArray[i].command; - p = pathArray[i].points; - // 平移变换 - for (var j = 0, k = p.length; j < k; j++) { - if (j % 2 === 0) { - p[j] += x; - } else { - p[j] += y; - } - } - switch (c) { - case 'L': - ctx.lineTo(p[0], p[1]); - break; - case 'M': - ctx.moveTo(p[0], p[1]); - break; - case 'C': - ctx.bezierCurveTo(p[0], p[1], p[2], p[3], p[4], p[5]); - break; - case 'Q': - ctx.quadraticCurveTo(p[0], p[1], p[2], p[3]); - break; - case 'A': - var cx = p[0]; - var cy = p[1]; - var rx = p[2]; - var ry = p[3]; - var theta = p[4]; - var dTheta = p[5]; - var psi = p[6]; - var fs = p[7]; - var r = (rx > ry) ? rx : ry; - var scaleX = (rx > ry) ? 1 : rx / ry; - var scaleY = (rx > ry) ? ry / rx : 1; - - ctx.translate(cx, cy); - ctx.rotate(psi); - ctx.scale(scaleX, scaleY); - ctx.arc(0, 0, r, theta, theta + dTheta, 1 - fs); - ctx.scale(1 / scaleX, 1 / scaleY); - ctx.rotate(-psi); - ctx.translate(-cx, -cy); - break; - case 'z': - ctx.closePath(); - break; - } - } - - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style 样式 - */ - getRect : function(style) { - if (style.__rect) { - return style.__rect; - } - - var lineWidth; - if (style.brushType == 'stroke' || style.brushType == 'fill') { - lineWidth = style.lineWidth || 1; - } - else { - lineWidth = 0; - } - - var minX = Number.MAX_VALUE; - var maxX = Number.MIN_VALUE; - - var minY = Number.MAX_VALUE; - var maxY = Number.MIN_VALUE; - - // 平移坐标 - var x = style.x || 0; - var y = style.y || 0; - - var pathArray = this.pathArray || this._parsePathData(style.path); - for (var i = 0; i < pathArray.length; i++) { - var p = pathArray[i].points; - - for (var j = 0; j < p.length; j++) { - if (j % 2 === 0) { - if (p[j] + x < minX) { - minX = p[j] + x; - } - if (p[j] + x > maxX) { - maxX = p[j] + x; - } - } - else { - if (p[j] + y < minY) { - minY = p[j] + y; - } - if (p[j] + y > maxY) { - maxY = p[j] + y; - } - } - } - } - - var rect; - if (minX === Number.MAX_VALUE - || maxX === Number.MIN_VALUE - || minY === Number.MAX_VALUE - || maxY === Number.MIN_VALUE - ) { - rect = { - x : 0, - y : 0, - width : 0, - height : 0 - }; - } - else { - rect = { - x : Math.round(minX - lineWidth / 2), - y : Math.round(minY - lineWidth / 2), - width : maxX - minX + lineWidth, - height : maxY - minY + lineWidth - }; - } - style.__rect = rect; - return rect; - } - }; - - require('../tool/util').inherits(Path, Base); - return Path; -}); \ No newline at end of file +/** + * SVG Path + * @module zrender/shape/Path + * @see http://www.w3.org/TR/2011/REC-SVG11-20110816/paths.html#PathData + * @author: Pissang (shenyi.914@gmail.com) + */ + +/** + * @typedef {Object} IPathStyle + * @property {string} path path描述数据, 详见 {@link http://www.w3.org/TR/2011/REC-SVG11-20110816/paths.html#PathData} + * @property {number} x x轴位移 + * @property {number} y y轴位移 + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ +define(function (require) { + + var Base = require('./Base'); + var PathProxy = require('./util/PathProxy'); + var PathSegment = PathProxy.PathSegment; + + var vMag = function(v) { + return Math.sqrt(v[0] * v[0] + v[1] * v[1]); + }; + var vRatio = function(u, v) { + return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v)); + }; + var vAngle = function(u, v) { + return (u[0] * v[1] < u[1] * v[0] ? -1 : 1) + * Math.acos(vRatio(u, v)); + }; + /** + * @alias module:zrender/shape/Path + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var Path = function (options) { + Base.call(this, options); + /** + * Path绘制样式 + * @name module:zrender/shape/Path#style + * @type {module:zrender/shape/Path~IPathStyle} + */ + /** + * Path高亮绘制样式 + * @name module:zrender/shape/Path#highlightStyle + * @type {module:zrender/shape/Path~IPathStyle} + */ + }; + + Path.prototype = { + type: 'path', + + buildPathArray : function (data, x, y) { + if (!data) { + return []; + } + + // 平移 + x = x || 0; + y = y || 0; + // command string + var cs = data; + + // command chars + var cc = [ + 'm', 'M', 'l', 'L', 'v', 'V', 'h', 'H', 'z', 'Z', + 'c', 'C', 'q', 'Q', 't', 'T', 's', 'S', 'a', 'A' + ]; + + cs = cs.replace(/-/g, ' -'); + cs = cs.replace(/ /g, ' '); + cs = cs.replace(/ /g, ','); + cs = cs.replace(/,,/g, ','); + + var n; + // create pipes so that we can split the data + for (n = 0; n < cc.length; n++) { + cs = cs.replace(new RegExp(cc[n], 'g'), '|' + cc[n]); + } + + // create array + var arr = cs.split('|'); + var ca = []; + // init context point + var cpx = 0; + var cpy = 0; + for (n = 1; n < arr.length; n++) { + var str = arr[n]; + var c = str.charAt(0); + str = str.slice(1); + str = str.replace(new RegExp('e,-', 'g'), 'e-'); + + var p = str.split(','); + if (p.length > 0 && p[0] === '') { + p.shift(); + } + + for (var i = 0; i < p.length; i++) { + p[i] = parseFloat(p[i]); + } + while (p.length > 0) { + if (isNaN(p[0])) { + break; + } + var cmd = null; + var points = []; + + var ctlPtx; + var ctlPty; + var prevCmd; + + var rx; + var ry; + var psi; + var fa; + var fs; + + var x1 = cpx; + var y1 = cpy; + + // convert l, H, h, V, and v to L + switch (c) { + case 'l': + cpx += p.shift(); + cpy += p.shift(); + cmd = 'L'; + points.push(cpx, cpy); + break; + case 'L': + cpx = p.shift(); + cpy = p.shift(); + points.push(cpx, cpy); + break; + case 'm': + cpx += p.shift(); + cpy += p.shift(); + cmd = 'M'; + points.push(cpx, cpy); + c = 'l'; + break; + case 'M': + cpx = p.shift(); + cpy = p.shift(); + cmd = 'M'; + points.push(cpx, cpy); + c = 'L'; + break; + + case 'h': + cpx += p.shift(); + cmd = 'L'; + points.push(cpx, cpy); + break; + case 'H': + cpx = p.shift(); + cmd = 'L'; + points.push(cpx, cpy); + break; + case 'v': + cpy += p.shift(); + cmd = 'L'; + points.push(cpx, cpy); + break; + case 'V': + cpy = p.shift(); + cmd = 'L'; + points.push(cpx, cpy); + break; + case 'C': + points.push(p.shift(), p.shift(), p.shift(), p.shift()); + cpx = p.shift(); + cpy = p.shift(); + points.push(cpx, cpy); + break; + case 'c': + points.push( + cpx + p.shift(), cpy + p.shift(), + cpx + p.shift(), cpy + p.shift() + ); + cpx += p.shift(); + cpy += p.shift(); + cmd = 'C'; + points.push(cpx, cpy); + break; + case 'S': + ctlPtx = cpx; + ctlPty = cpy; + prevCmd = ca[ca.length - 1]; + if (prevCmd.command === 'C') { + ctlPtx = cpx + (cpx - prevCmd.points[2]); + ctlPty = cpy + (cpy - prevCmd.points[3]); + } + points.push(ctlPtx, ctlPty, p.shift(), p.shift()); + cpx = p.shift(); + cpy = p.shift(); + cmd = 'C'; + points.push(cpx, cpy); + break; + case 's': + ctlPtx = cpx, ctlPty = cpy; + prevCmd = ca[ca.length - 1]; + if (prevCmd.command === 'C') { + ctlPtx = cpx + (cpx - prevCmd.points[2]); + ctlPty = cpy + (cpy - prevCmd.points[3]); + } + points.push( + ctlPtx, ctlPty, + cpx + p.shift(), cpy + p.shift() + ); + cpx += p.shift(); + cpy += p.shift(); + cmd = 'C'; + points.push(cpx, cpy); + break; + case 'Q': + points.push(p.shift(), p.shift()); + cpx = p.shift(); + cpy = p.shift(); + points.push(cpx, cpy); + break; + case 'q': + points.push(cpx + p.shift(), cpy + p.shift()); + cpx += p.shift(); + cpy += p.shift(); + cmd = 'Q'; + points.push(cpx, cpy); + break; + case 'T': + ctlPtx = cpx, ctlPty = cpy; + prevCmd = ca[ca.length - 1]; + if (prevCmd.command === 'Q') { + ctlPtx = cpx + (cpx - prevCmd.points[0]); + ctlPty = cpy + (cpy - prevCmd.points[1]); + } + cpx = p.shift(); + cpy = p.shift(); + cmd = 'Q'; + points.push(ctlPtx, ctlPty, cpx, cpy); + break; + case 't': + ctlPtx = cpx, ctlPty = cpy; + prevCmd = ca[ca.length - 1]; + if (prevCmd.command === 'Q') { + ctlPtx = cpx + (cpx - prevCmd.points[0]); + ctlPty = cpy + (cpy - prevCmd.points[1]); + } + cpx += p.shift(); + cpy += p.shift(); + cmd = 'Q'; + points.push(ctlPtx, ctlPty, cpx, cpy); + break; + case 'A': + rx = p.shift(); + ry = p.shift(); + psi = p.shift(); + fa = p.shift(); + fs = p.shift(); + + x1 = cpx, y1 = cpy; + cpx = p.shift(), cpy = p.shift(); + cmd = 'A'; + points = this._convertPoint( + x1, y1, cpx, cpy, fa, fs, rx, ry, psi + ); + break; + case 'a': + rx = p.shift(); + ry = p.shift(); + psi = p.shift(); + fa = p.shift(); + fs = p.shift(); + + x1 = cpx, y1 = cpy; + cpx += p.shift(); + cpy += p.shift(); + cmd = 'A'; + points = this._convertPoint( + x1, y1, cpx, cpy, fa, fs, rx, ry, psi + ); + break; + } + + // 平移变换 + for (var j = 0, l = points.length; j < l; j += 2) { + points[j] += x; + points[j + 1] += y; + } + ca.push(new PathSegment( + cmd || c, points + )); + } + + if (c === 'z' || c === 'Z') { + ca.push(new PathSegment('z', [])); + } + } + + return ca; + }, + + _convertPoint : function (x1, y1, x2, y2, fa, fs, rx, ry, psiDeg) { + var psi = psiDeg * (Math.PI / 180.0); + var xp = Math.cos(psi) * (x1 - x2) / 2.0 + + Math.sin(psi) * (y1 - y2) / 2.0; + var yp = -1 * Math.sin(psi) * (x1 - x2) / 2.0 + + Math.cos(psi) * (y1 - y2) / 2.0; + + var lambda = (xp * xp) / (rx * rx) + (yp * yp) / (ry * ry); + + if (lambda > 1) { + rx *= Math.sqrt(lambda); + ry *= Math.sqrt(lambda); + } + + var f = Math.sqrt((((rx * rx) * (ry * ry)) + - ((rx * rx) * (yp * yp)) + - ((ry * ry) * (xp * xp))) / ((rx * rx) * (yp * yp) + + (ry * ry) * (xp * xp)) + ); + + if (fa === fs) { + f *= -1; + } + if (isNaN(f)) { + f = 0; + } + + var cxp = f * rx * yp / ry; + var cyp = f * -ry * xp / rx; + + var cx = (x1 + x2) / 2.0 + + Math.cos(psi) * cxp + - Math.sin(psi) * cyp; + var cy = (y1 + y2) / 2.0 + + Math.sin(psi) * cxp + + Math.cos(psi) * cyp; + + var theta = vAngle([ 1, 0 ], [ (xp - cxp) / rx, (yp - cyp) / ry ]); + var u = [ (xp - cxp) / rx, (yp - cyp) / ry ]; + var v = [ (-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry ]; + var dTheta = vAngle(u, v); + + if (vRatio(u, v) <= -1) { + dTheta = Math.PI; + } + if (vRatio(u, v) >= 1) { + dTheta = 0; + } + if (fs === 0 && dTheta > 0) { + dTheta = dTheta - 2 * Math.PI; + } + if (fs === 1 && dTheta < 0) { + dTheta = dTheta + 2 * Math.PI; + } + return [ cx, cy, rx, ry, theta, dTheta, psi, fs ]; + }, + + /** + * 创建路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Path~IPathStyle} style + */ + buildPath : function (ctx, style) { + var path = style.path; + + // 平移坐标 + var x = style.x || 0; + var y = style.y || 0; + + style.pathArray = style.pathArray || this.buildPathArray(path, x, y); + var pathArray = style.pathArray; + + // 记录边界点,用于判断inside + var pointList = style.pointList = []; + var singlePointList = []; + for (var i = 0, l = pathArray.length; i < l; i++) { + if (pathArray[i].command.toUpperCase() == 'M') { + singlePointList.length > 0 + && pointList.push(singlePointList); + singlePointList = []; + } + var p = pathArray[i].points; + for (var j = 0, k = p.length; j < k; j += 2) { + singlePointList.push([p[j], p[j + 1]]); + } + } + singlePointList.length > 0 && pointList.push(singlePointList); + + for (var i = 0, l = pathArray.length; i < l; i++) { + var c = pathArray[i].command; + var p = pathArray[i].points; + switch (c) { + case 'L': + ctx.lineTo(p[0], p[1]); + break; + case 'M': + ctx.moveTo(p[0], p[1]); + break; + case 'C': + ctx.bezierCurveTo(p[0], p[1], p[2], p[3], p[4], p[5]); + break; + case 'Q': + ctx.quadraticCurveTo(p[0], p[1], p[2], p[3]); + break; + case 'A': + var cx = p[0]; + var cy = p[1]; + var rx = p[2]; + var ry = p[3]; + var theta = p[4]; + var dTheta = p[5]; + var psi = p[6]; + var fs = p[7]; + var r = (rx > ry) ? rx : ry; + var scaleX = (rx > ry) ? 1 : rx / ry; + var scaleY = (rx > ry) ? ry / rx : 1; + + ctx.translate(cx, cy); + ctx.rotate(psi); + ctx.scale(scaleX, scaleY); + ctx.arc(0, 0, r, theta, theta + dTheta, 1 - fs); + ctx.scale(1 / scaleX, 1 / scaleY); + ctx.rotate(-psi); + ctx.translate(-cx, -cy); + break; + case 'z': + ctx.closePath(); + break; + } + } + + return; + }, + + /** + * 计算返回Path包围盒矩形。 + * @param {module:zrender/shape/Path~IPathStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function (style) { + if (style.__rect) { + return style.__rect; + } + + var lineWidth; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } + else { + lineWidth = 0; + } + + var minX = Number.MAX_VALUE; + var maxX = Number.MIN_VALUE; + + var minY = Number.MAX_VALUE; + var maxY = Number.MIN_VALUE; + + // 平移坐标 + var x = style.x || 0; + var y = style.y || 0; + + var pathArray = style.pathArray || this.buildPathArray(style.path); + for (var i = 0; i < pathArray.length; i++) { + var p = pathArray[i].points; + + for (var j = 0; j < p.length; j++) { + if (j % 2 === 0) { + if (p[j] + x < minX) { + minX = p[j]; + } + if (p[j] + x > maxX) { + maxX = p[j]; + } + } + else { + if (p[j] + y < minY) { + minY = p[j]; + } + if (p[j] + y > maxY) { + maxY = p[j]; + } + } + } + } + + var rect; + if (minX === Number.MAX_VALUE + || maxX === Number.MIN_VALUE + || minY === Number.MAX_VALUE + || maxY === Number.MIN_VALUE + ) { + rect = { + x : 0, + y : 0, + width : 0, + height : 0 + }; + } + else { + rect = { + x : Math.round(minX - lineWidth / 2), + y : Math.round(minY - lineWidth / 2), + width : maxX - minX + lineWidth, + height : maxY - minY + lineWidth + }; + } + style.__rect = rect; + return rect; + } + }; + + require('../tool/util').inherits(Path, Base); + return Path; +}); diff --git a/amd/zrender/shape/Polygon.js b/amd/zrender/shape/Polygon.js index 58b751a..bf470c6 100644 --- a/amd/zrender/shape/Polygon.js +++ b/amd/zrender/shape/Polygon.js @@ -1,295 +1,215 @@ -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:多边形 - * 可配图形属性: - { - // 基础属性 - shape : 'polygon', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - pointList : {Array}, // 必须,多边形各个顶角坐标 - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为top,附加文本位置。 - // inside | left | right | top | bottom - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'polygon', - id : '123456', - zlevel : 1, - style : { - pointList : [[10, 10], [300, 20], [298, 400], [50, 450]] - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - function (require) { - var Base = require('./Base'); - var smoothSpline = require('./util/smoothSpline'); - var smoothBezier = require('./util/smoothBezier'); - var dashedLineTo = require('./util/dashedLineTo'); - - - function Polygon(options) { - Base.call(this, options); - } - - Polygon.prototype = { - type: 'polygon', - - /** - * 画刷 - * @param ctx 画布句柄 - * @param isHighlight 是否为高亮状态 - * @param updateCallback 需要异步加载资源的shape可以通过这个callback(e) - * 让painter更新视图,base.brush没用,需要的话重载brush - */ - brush : function (ctx, isHighlight) { - var style = this.style; - if (isHighlight) { - // 根据style扩展默认高亮样式 - style = this.getHighlightStyle( - style, - this.highlightStyle || {} - ); - } - - ctx.save(); - this.setContext(ctx, style); - - // 设置transform - this.setTransform(ctx); - - // 先fill再stroke - var hasPath = false; - if (style.brushType == 'fill' - || style.brushType == 'both' - || typeof style.brushType == 'undefined' // 默认为fill - ) { - ctx.beginPath(); - if (style.lineType == 'dashed' - || style.lineType == 'dotted' - ) { - // 特殊处理,虚线围不成path,实线再build一次 - this.buildPath( - ctx, - { - lineType: 'solid', - lineWidth: style.lineWidth, - pointList: style.pointList - } - ); - hasPath = false; // 这个path不能用 - } - else { - this.buildPath(ctx, style); - hasPath = true; // 这个path能用 - } - ctx.closePath(); - ctx.fill(); - } - - if (style.lineWidth > 0 - && (style.brushType == 'stroke' || style.brushType == 'both') - ) { - if (!hasPath) { - ctx.beginPath(); - this.buildPath(ctx, style); - ctx.closePath(); - } - ctx.stroke(); - } - - this.drawText(ctx, style, this.style); - - ctx.restore(); - - return; - }, - - /** - * 创建多边形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - // 虽然能重用brokenLine,但底层图形基于性能考虑,重复代码减少调用吧 - var pointList = style.pointList; - // 开始点和结束点重复 - /* - var start = pointList[0]; - var end = pointList[pointList.length-1]; - - if (start && end) { - if (start[0] == end[0] && - start[1] == end[1]) { - // 移除最后一个点 - pointList.pop(); - } - } - */ - - if (pointList.length < 2) { - // 少于2个点就不画了~ - return; - } - - if (style.smooth && style.smooth !== 'spline') { - var controlPoints = smoothBezier( - pointList, style.smooth, true - ); - - ctx.moveTo(pointList[0][0], pointList[0][1]); - var cp1; - var cp2; - var p; - var len = pointList.length; - for (var i = 0; i < len; i++) { - cp1 = controlPoints[i * 2]; - cp2 = controlPoints[i * 2 + 1]; - p = pointList[(i + 1) % len]; - ctx.bezierCurveTo( - cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1] - ); - } - } - else { - if (style.smooth === 'spline') { - pointList = smoothSpline(pointList, true); - } - - if (!style.lineType || style.lineType == 'solid') { - //默认为实线 - ctx.moveTo(pointList[0][0],pointList[0][1]); - for (var i = 1, l = pointList.length; i < l; i++) { - ctx.lineTo(pointList[i][0],pointList[i][1]); - } - ctx.lineTo(pointList[0][0], pointList[0][1]); - } - else if (style.lineType == 'dashed' - || style.lineType == 'dotted' - ) { - var dashLength = - style._dashLength - || (style.lineWidth || 1) - * (style.lineType == 'dashed' ? 5 : 1); - style._dashLength = dashLength; - ctx.moveTo(pointList[0][0],pointList[0][1]); - for (var i = 1, l = pointList.length; i < l; i++) { - dashedLineTo( - ctx, - pointList[i - 1][0], pointList[i - 1][1], - pointList[i][0], pointList[i][1], - dashLength - ); - } - dashedLineTo( - ctx, - pointList[pointList.length - 1][0], - pointList[pointList.length - 1][1], - pointList[0][0], - pointList[0][1], - dashLength - ); - } - } - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function(style) { - if (style.__rect) { - return style.__rect; - } - - var minX = Number.MAX_VALUE; - var maxX = Number.MIN_VALUE; - var minY = Number.MAX_VALUE; - var maxY = Number.MIN_VALUE; - - var pointList = style.pointList; - for(var i = 0, l = pointList.length; i < l; i++) { - if (pointList[i][0] < minX) { - minX = pointList[i][0]; - } - if (pointList[i][0] > maxX) { - maxX = pointList[i][0]; - } - if (pointList[i][1] < minY) { - minY = pointList[i][1]; - } - if (pointList[i][1] > maxY) { - maxY = pointList[i][1]; - } - } - - var lineWidth; - if (style.brushType == 'stroke' || style.brushType == 'fill') { - lineWidth = style.lineWidth || 1; - } - else { - lineWidth = 0; - } - - style.__rect = { - x : Math.round(minX - lineWidth / 2), - y : Math.round(minY - lineWidth / 2), - width : maxX - minX + lineWidth, - height : maxY - minY + lineWidth - }; - return style.__rect; - } - }; - - require('../tool/util').inherits(Polygon, Base); - return Polygon; - } -); \ No newline at end of file +/** + * 多边形 + * @module zrender/shape/Polygon + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + * @example + * var Polygon = require('zrender/shape/Polygon'); + * var shape = new Polygon({ + * style: { + * // 100x100的正方形 + * pointList: [[0, 0], [100, 0], [100, 100], [0, 100]], + * color: 'blue' + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} IPolygonStyle + * @property {string} pointList 多边形顶点数组 + * @property {string} [smooth=''] 是否做平滑插值, 平滑算法可以选择 bezier, spline + * @property {number} [smoothConstraint] 平滑约束 + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ +define( + function (require) { + var Base = require('./Base'); + var smoothSpline = require('./util/smoothSpline'); + var smoothBezier = require('./util/smoothBezier'); + var dashedLineTo = require('./util/dashedLineTo'); + + /** + * @alias module:zrender/shape/Polygon + * @param {Object} options + * @constructor + * @extends module:zrender/shape/Base + */ + var Polygon = function (options) { + Base.call(this, options); + /** + * 多边形绘制样式 + * @name module:zrender/shape/Polygon#style + * @type {module:zrender/shape/Polygon~IPolygonStyle} + */ + /** + * 多边形高亮绘制样式 + * @name module:zrender/shape/Polygon#highlightStyle + * @type {module:zrender/shape/Polygon~IPolygonStyle} + */ + }; + + Polygon.prototype = { + type: 'polygon', + + /** + * 创建多边形路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Polygon~IPolygonStyle} style + */ + buildPath : function (ctx, style) { + // 虽然能重用brokenLine,但底层图形基于性能考虑,重复代码减少调用吧 + var pointList = style.pointList; + // 开始点和结束点重复 + /* + var start = pointList[0]; + var end = pointList[pointList.length-1]; + + if (start && end) { + if (start[0] == end[0] && + start[1] == end[1]) { + // 移除最后一个点 + pointList.pop(); + } + } + */ + + if (pointList.length < 2) { + // 少于2个点就不画了~ + return; + } + + if (style.smooth && style.smooth !== 'spline') { + var controlPoints = smoothBezier( + pointList, style.smooth, true, style.smoothConstraint + ); + + ctx.moveTo(pointList[0][0], pointList[0][1]); + var cp1; + var cp2; + var p; + var len = pointList.length; + for (var i = 0; i < len; i++) { + cp1 = controlPoints[i * 2]; + cp2 = controlPoints[i * 2 + 1]; + p = pointList[(i + 1) % len]; + ctx.bezierCurveTo( + cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1] + ); + } + } + else { + if (style.smooth === 'spline') { + pointList = smoothSpline(pointList, true); + } + + if (!style.lineType || style.lineType == 'solid') { + // 默认为实线 + ctx.moveTo(pointList[0][0], pointList[0][1]); + for (var i = 1, l = pointList.length; i < l; i++) { + ctx.lineTo(pointList[i][0], pointList[i][1]); + } + ctx.lineTo(pointList[0][0], pointList[0][1]); + } + else if (style.lineType == 'dashed' + || style.lineType == 'dotted' + ) { + var dashLength = + style._dashLength + || (style.lineWidth || 1) + * (style.lineType == 'dashed' ? 5 : 1); + style._dashLength = dashLength; + ctx.moveTo(pointList[0][0], pointList[0][1]); + for (var i = 1, l = pointList.length; i < l; i++) { + dashedLineTo( + ctx, + pointList[i - 1][0], pointList[i - 1][1], + pointList[i][0], pointList[i][1], + dashLength + ); + } + dashedLineTo( + ctx, + pointList[pointList.length - 1][0], + pointList[pointList.length - 1][1], + pointList[0][0], + pointList[0][1], + dashLength + ); + } + } + + ctx.closePath(); + return; + }, + + /** + * 计算返回多边形包围盒矩阵 + * @param {module:zrender/shape/Polygon~IPolygonStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function (style) { + if (style.__rect) { + return style.__rect; + } + + var minX = Number.MAX_VALUE; + var maxX = Number.MIN_VALUE; + var minY = Number.MAX_VALUE; + var maxY = Number.MIN_VALUE; + + var pointList = style.pointList; + for (var i = 0, l = pointList.length; i < l; i++) { + if (pointList[i][0] < minX) { + minX = pointList[i][0]; + } + if (pointList[i][0] > maxX) { + maxX = pointList[i][0]; + } + if (pointList[i][1] < minY) { + minY = pointList[i][1]; + } + if (pointList[i][1] > maxY) { + maxY = pointList[i][1]; + } + } + + var lineWidth; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } + else { + lineWidth = 0; + } + + style.__rect = { + x : Math.round(minX - lineWidth / 2), + y : Math.round(minY - lineWidth / 2), + width : maxX - minX + lineWidth, + height : maxY - minY + lineWidth + }; + return style.__rect; + } + }; + + require('../tool/util').inherits(Polygon, Base); + return Polygon; + } +); + diff --git a/amd/zrender/shape/Polyline.js b/amd/zrender/shape/Polyline.js new file mode 100644 index 0000000..6f69f9e --- /dev/null +++ b/amd/zrender/shape/Polyline.js @@ -0,0 +1,151 @@ +/** + * 折线 + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + * @module zrender/shape/Polyline + * @example + * var Polyline = require('zrender/shape/Polyline'); + * var shape = new Polyline({ + * style: { + * pointList: [[0, 0], [100, 100], [100, 0]], + * smooth: 'bezier', + * strokeColor: 'purple' + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} IPolylineStyle + * @property {Array.} pointList 顶点坐标数组 + * @property {string} [smooth=''] 是否做平滑插值, 平滑算法可以选择 bezier, spline + * @property {number} [smoothConstraint] 平滑约束 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {string} [lineJoin='miter'] 线段连接样式,可以是 miter, round, bevel + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ +define( + function (require) { + var Base = require('./Base'); + var smoothSpline = require('./util/smoothSpline'); + var smoothBezier = require('./util/smoothBezier'); + var dashedLineTo = require('./util/dashedLineTo'); + + /** + * @alias module:zrender/shape/Polyline + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var Polyline = function(options) { + this.brushTypeOnly = 'stroke'; // 线条只能描边,填充后果自负 + this.textPosition = 'end'; + Base.call(this, options); + /** + * 贝赛尔曲线绘制样式 + * @name module:zrender/shape/Polyline#style + * @type {module:zrender/shape/Polyline~IPolylineStyle} + */ + /** + * 贝赛尔曲线高亮绘制样式 + * @name module:zrender/shape/Polyline#highlightStyle + * @type {module:zrender/shape/Polyline~IPolylineStyle} + */ + }; + + Polyline.prototype = { + type: 'polyline', + + /** + * 创建多边形路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Polyline~IPolylineStyle} style + */ + buildPath : function(ctx, style) { + var pointList = style.pointList; + if (pointList.length < 2) { + // 少于2个点就不画了~ + return; + } + + var len = Math.min( + style.pointList.length, + Math.round(style.pointListLength || style.pointList.length) + ); + + if (style.smooth && style.smooth !== 'spline') { + var controlPoints = smoothBezier( + pointList, style.smooth, false, style.smoothConstraint + ); + + ctx.moveTo(pointList[0][0], pointList[0][1]); + var cp1; + var cp2; + var p; + for (var i = 0; i < len - 1; i++) { + cp1 = controlPoints[i * 2]; + cp2 = controlPoints[i * 2 + 1]; + p = pointList[i + 1]; + ctx.bezierCurveTo( + cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1] + ); + } + } + else { + if (style.smooth === 'spline') { + pointList = smoothSpline(pointList); + len = pointList.length; + } + if (!style.lineType || style.lineType == 'solid') { + // 默认为实线 + ctx.moveTo(pointList[0][0], pointList[0][1]); + for (var i = 1; i < len; i++) { + ctx.lineTo(pointList[i][0], pointList[i][1]); + } + } + else if (style.lineType == 'dashed' + || style.lineType == 'dotted' + ) { + var dashLength = (style.lineWidth || 1) + * (style.lineType == 'dashed' ? 5 : 1); + ctx.moveTo(pointList[0][0], pointList[0][1]); + for (var i = 1; i < len; i++) { + dashedLineTo( + ctx, + pointList[i - 1][0], pointList[i - 1][1], + pointList[i][0], pointList[i][1], + dashLength + ); + } + } + } + return; + }, + + /** + * 计算返回折线包围盒矩形。 + * @param {IZRenderBezierCurveStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function(style) { + return require('./Polygon').prototype.getRect(style); + } + }; + + require('../tool/util').inherits(Polyline, Base); + return Polyline; + } +); diff --git a/amd/zrender/shape/Rectangle.js b/amd/zrender/shape/Rectangle.js index fa52d60..17aa87f 100644 --- a/amd/zrender/shape/Rectangle.js +++ b/amd/zrender/shape/Rectangle.js @@ -1,200 +1,206 @@ -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) , - * strwind (@劲风FEI, yaofeifei@baidu.com) - * - * shape类:矩形 - * 可配图形属性: - { - // 基础属性 - shape : 'rectangle', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,左上角横坐标 - y : {number}, // 必须,左上角纵坐标 - width : {number}, // 必须,宽度 - height : {number}, // 必须,高度 - radius : {array}, // 默认为[0],圆角 - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为top,附加文本位置。 - // inside | left | right | top | bottom - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'rectangle', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - width : 150, - height : 50, - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - function (require) { - var Base = require('./Base'); - - function Rectangle(options) { - Base.call(this, options); - } - - Rectangle.prototype = { - type: 'rectangle', - - /** - * 绘制圆角矩形 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - _buildRadiusPath: function(ctx, style) { - //左上、右上、右下、左下角的半径依次为r1、r2、r3、r4 - //r缩写为1 相当于 [1, 1, 1, 1] - //r缩写为[1] 相当于 [1, 1, 1, 1] - //r缩写为[1, 2] 相当于 [1, 2, 1, 2] - //r缩写为[1, 2, 3] 相当于 [1, 2, 3, 2] - var x = style.x; - var y = style.y; - var width = style.width; - var height = style.height; - var r = style.radius; - var r1; - var r2; - var r3; - var r4; - - if(typeof r === 'number') { - r1 = r2 = r3 = r4 = r; - } - else if(r instanceof Array) { - if (r.length === 1) { - r1 = r2 = r3 = r4 = r[0]; - } - else if(r.length === 2) { - r1 = r3 = r[0]; - r2 = r4 = r[1]; - } - else if(r.length === 3) { - r1 = r[0]; - r2 = r4 = r[1]; - r3 = r[2]; - } else { - r1 = r[0]; - r2 = r[1]; - r3 = r[2]; - r4 = r[3]; - } - } else { - r1 = r2 = r3 = r4 = 0; - } - ctx.moveTo(x + r1, y); - ctx.lineTo(x + width - r2, y); - r2 !== 0 && ctx.quadraticCurveTo( - x + width, y, x + width, y + r2 - ); - ctx.lineTo(x + width, y + height - r3); - r3 !== 0 && ctx.quadraticCurveTo( - x + width, y + height, x + width - r3, y + height - ); - ctx.lineTo(x + r4, y + height); - r4 !== 0 && ctx.quadraticCurveTo( - x, y + height, x, y + height - r4 - ); - ctx.lineTo(x, y + r1); - r1 !== 0 && ctx.quadraticCurveTo(x, y, x + r1, y); - }, - - /** - * 创建矩形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - if(!style.radius) { - ctx.moveTo(style.x, style.y); - ctx.lineTo(style.x + style.width, style.y); - ctx.lineTo(style.x + style.width, style.y + style.height); - ctx.lineTo(style.x, style.y + style.height); - ctx.lineTo(style.x, style.y); - //ctx.rect(style.x, style.y, style.width, style.height); - } else { - this._buildRadiusPath(ctx, style); - } - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function(style) { - if (style.__rect) { - return style.__rect; - } - - var lineWidth; - if (style.brushType == 'stroke' || style.brushType == 'fill') { - lineWidth = style.lineWidth || 1; - } - else { - lineWidth = 0; - } - style.__rect = { - x : Math.round(style.x - lineWidth / 2), - y : Math.round(style.y - lineWidth / 2), - width : style.width + lineWidth, - height : style.height + lineWidth - }; - - return style.__rect; - } - }; - - require('../tool/util').inherits(Rectangle, Base); - return Rectangle; - } -); \ No newline at end of file +/** + * 矩形 + * @module zrender/shape/Rectangle + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) , + * strwind (@劲风FEI) + * @example + * var Rectangle = require('zrender/shape/Rectangle'); + * var shape = new Rectangle({ + * style: { + * x: 0, + * y: 0, + * width: 100, + * height: 100, + * radius: 20 + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} IRectangleStyle + * @property {number} x 左上角x坐标 + * @property {number} y 左上角y坐标 + * @property {number} width 宽度 + * @property {number} height 高度 + * @property {number|Array.} radius 矩形圆角,可以用数组分别指定四个角的圆角 + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ +define( + function (require) { + var Base = require('./Base'); + + /** + * @alias module:zrender/shape/Rectangle + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var Rectangle = function (options) { + Base.call(this, options); + /** + * 矩形绘制样式 + * @name module:zrender/shape/Rectangle#style + * @type {module:zrender/shape/Rectangle~IRectangleStyle} + */ + /** + * 矩形高亮绘制样式 + * @name module:zrender/shape/Rectangle#highlightStyle + * @type {module:zrender/shape/Rectangle~IRectangleStyle} + */ + }; + + Rectangle.prototype = { + type: 'rectangle', + + _buildRadiusPath: function (ctx, style) { + // 左上、右上、右下、左下角的半径依次为r1、r2、r3、r4 + // r缩写为1 相当于 [1, 1, 1, 1] + // r缩写为[1] 相当于 [1, 1, 1, 1] + // r缩写为[1, 2] 相当于 [1, 2, 1, 2] + // r缩写为[1, 2, 3] 相当于 [1, 2, 3, 2] + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + var r = style.radius; + var r1; + var r2; + var r3; + var r4; + + if (typeof r === 'number') { + r1 = r2 = r3 = r4 = r; + } + else if (r instanceof Array) { + if (r.length === 1) { + r1 = r2 = r3 = r4 = r[0]; + } + else if (r.length === 2) { + r1 = r3 = r[0]; + r2 = r4 = r[1]; + } + else if (r.length === 3) { + r1 = r[0]; + r2 = r4 = r[1]; + r3 = r[2]; + } + else { + r1 = r[0]; + r2 = r[1]; + r3 = r[2]; + r4 = r[3]; + } + } + else { + r1 = r2 = r3 = r4 = 0; + } + + var total; + if (r1 + r2 > width) { + total = r1 + r2; + r1 *= width / total; + r2 *= width / total; + } + if (r3 + r4 > width) { + total = r3 + r4; + r3 *= width / total; + r4 *= width / total; + } + if (r2 + r3 > height) { + total = r2 + r3; + r2 *= height / total; + r3 *= height / total; + } + if (r1 + r4 > height) { + total = r1 + r4; + r1 *= height / total; + r4 *= height / total; + } + ctx.moveTo(x + r1, y); + ctx.lineTo(x + width - r2, y); + r2 !== 0 && ctx.quadraticCurveTo( + x + width, y, x + width, y + r2 + ); + ctx.lineTo(x + width, y + height - r3); + r3 !== 0 && ctx.quadraticCurveTo( + x + width, y + height, x + width - r3, y + height + ); + ctx.lineTo(x + r4, y + height); + r4 !== 0 && ctx.quadraticCurveTo( + x, y + height, x, y + height - r4 + ); + ctx.lineTo(x, y + r1); + r1 !== 0 && ctx.quadraticCurveTo(x, y, x + r1, y); + }, + + /** + * 创建矩形路径 + * @param {CanvasRenderingContext2D} ctx + * @param {Object} style + */ + buildPath : function (ctx, style) { + if (!style.radius) { + ctx.moveTo(style.x, style.y); + ctx.lineTo(style.x + style.width, style.y); + ctx.lineTo(style.x + style.width, style.y + style.height); + ctx.lineTo(style.x, style.y + style.height); + ctx.lineTo(style.x, style.y); + // ctx.rect(style.x, style.y, style.width, style.height); + } + else { + this._buildRadiusPath(ctx, style); + } + ctx.closePath(); + return; + }, + + /** + * 计算返回矩形包围盒矩阵 + * @param {module:zrender/shape/Rectangle~IRectangleStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function(style) { + if (style.__rect) { + return style.__rect; + } + + var lineWidth; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } + else { + lineWidth = 0; + } + style.__rect = { + x : Math.round(style.x - lineWidth / 2), + y : Math.round(style.y - lineWidth / 2), + width : style.width + lineWidth, + height : style.height + lineWidth + }; + + return style.__rect; + } + }; + + require('../tool/util').inherits(Rectangle, Base); + return Rectangle; + } +); diff --git a/amd/zrender/shape/Ring.js b/amd/zrender/shape/Ring.js index 7971bca..5c02d29 100644 --- a/amd/zrender/shape/Ring.js +++ b/amd/zrender/shape/Ring.js @@ -1,129 +1,114 @@ -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:圆环 - * 可配图形属性: - { - // 基础属性 - shape : 'ring', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,圆心横坐标 - y : {number}, // 必须,圆心纵坐标 - r0 : {number}, // 必须,内圆半径 - r : {number}, // 必须,外圆半径 - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为outside,附加文本位置。 - // outside | inside - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'ring', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - r : 50, - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - function (require) { - var Base = require('./Base'); - - function Ring(options) { - Base.call(this, options); - } - - Ring.prototype = { - type: 'ring', - - /** - * 创建圆环路径,依赖扇形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - // 非零环绕填充优化 - ctx.arc(style.x, style.y, style.r, 0, Math.PI * 2, false); - ctx.moveTo(style.x + style.r0, style.y); - ctx.arc(style.x, style.y, style.r0, 0, Math.PI * 2, true); - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function(style) { - if (style.__rect) { - return style.__rect; - } - - var lineWidth; - if (style.brushType == 'stroke' || style.brushType == 'fill') { - lineWidth = style.lineWidth || 1; - } - else { - lineWidth = 0; - } - style.__rect = { - x : Math.round(style.x - style.r - lineWidth / 2), - y : Math.round(style.y - style.r - lineWidth / 2), - width : style.r * 2 + lineWidth, - height : style.r * 2 + lineWidth - }; - - return style.__rect; - } - }; - - require('../tool/util').inherits(Ring, Base); - return Ring; - } -); \ No newline at end of file +/** + * 圆环 + * @module zrender/shape/Ring + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + * + * @example + * var Ring = require('zrender/shape/Ring'); + * var shape = new Ring({ + * style: { + * x: 100, + * y: 100, + * r0: 30, + * r: 50 + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} IRingStyle + * @property {number} x 圆心x坐标 + * @property {number} y 圆心y坐标 + * @property {number} r0 内圆半径 + * @property {number} r 外圆半径 + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ +define( + function (require) { + var Base = require('./Base'); + + /** + * @alias module:zrender/shape/Ring + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var Ring = function (options) { + Base.call(this, options); + /** + * 圆环绘制样式 + * @name module:zrender/shape/Ring#style + * @type {module:zrender/shape/Ring~IRingStyle} + */ + /** + * 圆环高亮绘制样式 + * @name module:zrender/shape/Ring#highlightStyle + * @type {module:zrender/shape/Ring~IRingStyle} + */ + }; + + Ring.prototype = { + type: 'ring', + + /** + * 创建圆环路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Ring~IRingStyle} style + */ + buildPath : function (ctx, style) { + // 非零环绕填充优化 + ctx.arc(style.x, style.y, style.r, 0, Math.PI * 2, false); + ctx.moveTo(style.x + style.r0, style.y); + ctx.arc(style.x, style.y, style.r0, 0, Math.PI * 2, true); + return; + }, + + /** + * 计算返回圆环包围盒矩阵 + * @param {module:zrender/shape/Ring~IRingStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function (style) { + if (style.__rect) { + return style.__rect; + } + + var lineWidth; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } + else { + lineWidth = 0; + } + style.__rect = { + x : Math.round(style.x - style.r - lineWidth / 2), + y : Math.round(style.y - style.r - lineWidth / 2), + width : style.r * 2 + lineWidth, + height : style.r * 2 + lineWidth + }; + + return style.__rect; + } + }; + + require('../tool/util').inherits(Ring, Base); + return Ring; + } +); diff --git a/amd/zrender/shape/Rose.js b/amd/zrender/shape/Rose.js index e484c69..ccac316 100644 --- a/amd/zrender/shape/Rose.js +++ b/amd/zrender/shape/Rose.js @@ -1,166 +1,152 @@ -/** - * zrender - * - * @author Neil (杨骥, yangji01@baidu.com) - * - * shape类:玫瑰线 - * 可配图形属性: - { - // 基础属性 - shape : 'rose', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 默认为0, 圆心的横坐标 - y : {number}, // 默认为0, 圆心的纵坐标 - r : {Array}, // 必须,每个线条的最大长度 - k : {number}, // 必须,决定花瓣数量,当n为1时,奇数即为花瓣数,偶数时花瓣数量翻倍 - n : {number=}, // 默认为1,必须为整数,与k共同决定花瓣的数量 - strokeColor : {color}, // 默认为'#000',线条颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度 - lineCap : {string}, // 默认为butt,线帽样式。butt | round | square - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为end,附加文本位置。 - // inside | start | end - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#000' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'rose', - id : '123456', - zlevel : 1, - style : { - x : 100, - y : 100, - r1 : 50, - r2 : 30, - d : 50, - strokeColor : '#eee', - lineWidth : 20, - text : 'Baidu' - }, - myName : 'kener', //可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - function (require) { - var Base = require('./Base'); - - function Rose(options) { - this.brushTypeOnly = 'stroke'; //线条只能描边,填充后果自负 - Base.call(this, options); - } - - Rose.prototype = { - type: 'rose', - - /** - * 创建线条路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - var _x; - var _y; - var _R = style.r; - var _r; - var _k = style.k; - var _n = style.n || 1; - - var _offsetX = style.x; - var _offsetY = style.y; - - var _math = require('../tool/math'); - ctx.moveTo(_offsetX, _offsetY); - - for (var i = 0, _len = _R.length; i < _len ; i ++) { - _r = _R[i]; - - for (var j = 0; j <= 360 * _n; j ++) { - _x = _r - * _math.sin(_k / _n * j % 360, true) - * _math.cos( j, true) - + _offsetX; - _y = _r - * _math.sin(_k / _n * j % 360, true) - * _math.sin( j, true) - + _offsetY; - ctx.lineTo( _x, _y ); - } - } - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function(style) { - if (style.__rect) { - return style.__rect; - } - - var _R = style.r; - var _offsetX = style.x; - var _offsetY = style.y; - var _max = 0; - - for (var i = 0, _len = _R.length; i < _len ; i ++) { - if (_R[i] > _max) { - _max = _R[i]; - } - } - style.maxr = _max; - - var lineWidth; - if (style.brushType == 'stroke' || style.brushType == 'fill') { - lineWidth = style.lineWidth || 1; - } - else { - lineWidth = 0; - } - style.__rect = { - x : - _max - lineWidth + _offsetX, - y : - _max - lineWidth + _offsetY, - width : 2 * _max + 3 * lineWidth, - height : 2 * _max + 3 * lineWidth - }; - return style.__rect; - } - }; - - require('../tool/util').inherits(Rose, Base); - return Rose; - } -); \ No newline at end of file +/** + * 玫瑰线 + * @module zrender/shape/Rose + * @author Neil (杨骥, 511415343@qq.com) + * @example + * var Rose = require('zrender/shape/Rose'); + * var shape = new Rose({ + * style: { + * x: 100, + * y: 100, + * r1: 50, + * r2: 30, + * d: 50, + * strokeColor: '#eee', + * lineWidth: 3 + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} IRoseStyle + * @property {number} x 中心x坐标 + * @property {number} y 中心y坐标 + * @property {number} r 每个线条的最大长度 + * @property {number} k 花瓣数量,当n为1时,奇数即为花瓣数,偶数时花瓣数量翻倍 + * @property {number} [n=1] 必须为整数,与k共同决定花瓣的数量 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ + +define( + function (require) { + var Base = require('./Base'); + + /** + * @alias module:zrender/shape/Rose + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var Rose = function (options) { + this.brushTypeOnly = 'stroke'; // 线条只能描边,填充后果自负 + Base.call(this, options); + /** + * 玫瑰线绘制样式 + * @name module:zrender/shape/Rose#style + * @type {module:zrender/shape/Rose~IRoseStyle} + */ + /** + * 玫瑰线高亮绘制样式 + * @name module:zrender/shape/Rose#highlightStyle + * @type {module:zrender/shape/Rose~IRoseStyle} + */ + }; + + Rose.prototype = { + type: 'rose', + + /** + * 创建玫瑰线路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Rose~IRoseStyle} style + */ + buildPath : function (ctx, style) { + var _x; + var _y; + var _R = style.r; + var _r; + var _k = style.k; + var _n = style.n || 1; + + var _offsetX = style.x; + var _offsetY = style.y; + + var _math = require('../tool/math'); + ctx.moveTo(_offsetX, _offsetY); + + for (var i = 0, _len = _R.length; i < _len ; i++) { + _r = _R[i]; + + for (var j = 0; j <= 360 * _n; j++) { + _x = _r + * _math.sin(_k / _n * j % 360, true) + * _math.cos(j, true) + + _offsetX; + _y = _r + * _math.sin(_k / _n * j % 360, true) + * _math.sin(j, true) + + _offsetY; + ctx.lineTo(_x, _y); + } + } + }, + + /** + * 返回玫瑰线包围盒矩形 + * @param {module:zrender/shape/Rose~IRoseStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function (style) { + if (style.__rect) { + return style.__rect; + } + + var _R = style.r; + var _offsetX = style.x; + var _offsetY = style.y; + var _max = 0; + + for (var i = 0, _len = _R.length; i < _len ; i++) { + if (_R[i] > _max) { + _max = _R[i]; + } + } + style.maxr = _max; + + var lineWidth; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } + else { + lineWidth = 0; + } + style.__rect = { + x : -_max - lineWidth + _offsetX, + y : -_max - lineWidth + _offsetY, + width : 2 * _max + 3 * lineWidth, + height : 2 * _max + 3 * lineWidth + }; + return style.__rect; + } + }; + + require('../tool/util').inherits(Rose, Base); + return Rose; + } +); diff --git a/amd/zrender/shape/Sector.js b/amd/zrender/shape/Sector.js index 63f5b64..5eb75c8 100644 --- a/amd/zrender/shape/Sector.js +++ b/amd/zrender/shape/Sector.js @@ -1,231 +1,187 @@ -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:扇形 - * 可配图形属性: - { - // 基础属性 - shape : 'sector', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,圆心横坐标 - y : {number}, // 必须,圆心纵坐标 - r0 : {number}, // 默认为0,内圆半径,指定后将出现内弧,同时扇边长度 = r - r0 - r : {number}, // 必须,外圆半径 - startAngle : {number}, // 必须,起始角度[0, 360) - endAngle : {number}, // 必须,结束角度(0, 360] - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为outside,附加文本位置。 - // outside | inside - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'sector', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - r : 50, - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - function (require) { - var math = require('../tool/math'); - var Base = require('./Base'); - - function Sector(options) { - Base.call(this, options); - } - - Sector.prototype = { - type: 'sector', - - /** - * 创建扇形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - var x = style.x; // 圆心x - var y = style.y; // 圆心y - var r0 = typeof style.r0 == 'undefined' // 形内半径[0,r) - ? 0 : style.r0; - var r = style.r; // 扇形外半径(0,r] - var startAngle = style.startAngle; // 起始角度[0,360) - var endAngle = style.endAngle; // 结束角度(0,360] - - if (Math.abs(endAngle - startAngle) >= 360) { - // 大于360度的扇形简化为圆环画法 - ctx.arc(x, y, r, 0, Math.PI * 2, false); - if (r0 !== 0) { - ctx.moveTo(x + r0, y); - ctx.arc(x, y, r0, 0, Math.PI * 2, true); - } - return; - } - - startAngle = math.degreeToRadian(startAngle); - endAngle = math.degreeToRadian(endAngle); - - var PI2 = Math.PI * 2; - var cosStartAngle = math.cos(startAngle); - var sinStartAngle = math.sin(startAngle); - ctx.moveTo( - cosStartAngle * r0 + x, - y - sinStartAngle * r0 - ); - - ctx.lineTo( - cosStartAngle * r + x, - y - sinStartAngle * r - ); - - ctx.arc(x, y, r, PI2 - startAngle, PI2 - endAngle, true); - - ctx.lineTo( - math.cos(endAngle) * r0 + x, - y - math.sin(endAngle) * r0 - ); - - if (r0 !== 0) { - ctx.arc(x, y, r0, PI2 - endAngle, PI2 - startAngle, false); - } - - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function(style) { - if (style.__rect) { - return style.__rect; - } - - var x = style.x; // 圆心x - var y = style.y; // 圆心y - var r0 = typeof style.r0 == 'undefined' // 形内半径[0,r) - ? 0 : style.r0; - var r = style.r; // 扇形外半径(0,r] - var startAngle = style.startAngle; // 起始角度[0,360) - var endAngle = style.endAngle; // 结束角度(0,360] - - if (Math.abs(endAngle - startAngle) >= 360) { - // 大于360度的扇形简化为圆环bbox - style.__rect = require('./Ring').prototype.getRect(style); - return style.__rect; - } - - startAngle = (720 + startAngle) % 360; - endAngle = (720 + endAngle) % 360; - if (endAngle <= startAngle) { - endAngle += 360; - } - var pointList = []; - if (startAngle <= 90 && endAngle >= 90) { - pointList.push([ - x, y - r - ]); - } - if (startAngle <= 180 && endAngle >= 180) { - pointList.push([ - x - r, y - ]); - } - if (startAngle <= 270 && endAngle >= 270) { - pointList.push([ - x, y + r - ]); - } - if (startAngle <= 360 && endAngle >= 360) { - pointList.push([ - x + r, y - ]); - } - - startAngle = math.degreeToRadian(startAngle); - endAngle = math.degreeToRadian(endAngle); - - - pointList.push([ - math.cos(startAngle) * r0 + x, - y - math.sin(startAngle) * r0 - ]); - - pointList.push([ - math.cos(startAngle) * r + x, - y - math.sin(startAngle) * r - ]); - - pointList.push([ - math.cos(endAngle) * r + x, - y - math.sin(endAngle) * r - ]); - - pointList.push([ - math.cos(endAngle) * r0 + x, - y - math.sin(endAngle) * r0 - ]); - - style.__rect = require('./Polygon').prototype.getRect({ - brushType : style.brushType, - lineWidth : style.lineWidth, - pointList : pointList - }); - - return style.__rect; - } - }; - - - require('../tool/util').inherits(Sector, Base); - return Sector; - } -); \ No newline at end of file +/** + * 扇形 + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + * @module zrender/shape/Sector + * @example + * var Sector = require('zrender/shape/Sector'); + * var shape = new Sector({ + * style: { + * x: 100, + * y: 100, + * r: 60, + * r0: 30, + * startAngle: 0, + * endEngle: 180 + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} ISectorStyle + * @property {number} x 圆心x坐标 + * @property {number} y 圆心y坐标 + * @property {number} r 外圆半径 + * @property {number} [r0=0] 内圆半径,指定后将出现内弧,同时扇边长度为`r - r0` + * @property {number} startAngle 起始角度,`[0, 360)` + * @property {number} endAngle 结束角度,`(0, 360]` + * @property {boolean} [clockWise=false] 是否是顺时针 + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ + +define( + function (require) { + + var math = require('../tool/math'); + var computeBoundingBox = require('../tool/computeBoundingBox'); + var vec2 = require('../tool/vector'); + var Base = require('./Base'); + + var min0 = vec2.create(); + var min1 = vec2.create(); + var max0 = vec2.create(); + var max1 = vec2.create(); + /** + * @alias module:zrender/shape/Sector + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var Sector = function (options) { + Base.call(this, options); + /** + * 扇形绘制样式 + * @name module:zrender/shape/Sector#style + * @type {module:zrender/shape/Sector~ISectorStyle} + */ + /** + * 扇形高亮绘制样式 + * @name module:zrender/shape/Sector#highlightStyle + * @type {module:zrender/shape/Sector~ISectorStyle} + */ + }; + + Sector.prototype = { + type: 'sector', + + /** + * 创建扇形路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Sector~ISectorStyle} style + */ + buildPath : function (ctx, style) { + var x = style.x; // 圆心x + var y = style.y; // 圆心y + var r0 = style.r0 || 0; // 形内半径[0,r) + var r = style.r; // 扇形外半径(0,r] + var startAngle = style.startAngle; // 起始角度[0,360) + var endAngle = style.endAngle; // 结束角度(0,360] + var clockWise = style.clockWise || false; + + startAngle = math.degreeToRadian(startAngle); + endAngle = math.degreeToRadian(endAngle); + + if (!clockWise) { + // 扇形默认是逆时针方向,Y轴向上 + // 这个跟arc的标准不一样,为了兼容echarts + startAngle = -startAngle; + endAngle = -endAngle; + } + + var unitX = math.cos(startAngle); + var unitY = math.sin(startAngle); + ctx.moveTo( + unitX * r0 + x, + unitY * r0 + y + ); + + ctx.lineTo( + unitX * r + x, + unitY * r + y + ); + + ctx.arc(x, y, r, startAngle, endAngle, !clockWise); + + ctx.lineTo( + math.cos(endAngle) * r0 + x, + math.sin(endAngle) * r0 + y + ); + + if (r0 !== 0) { + ctx.arc(x, y, r0, endAngle, startAngle, clockWise); + } + + ctx.closePath(); + + return; + }, + + /** + * 返回扇形包围盒矩形 + * @param {module:zrender/shape/Sector~ISectorStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function (style) { + if (style.__rect) { + return style.__rect; + } + + var x = style.x; // 圆心x + var y = style.y; // 圆心y + var r0 = style.r0 || 0; // 形内半径[0,r) + var r = style.r; // 扇形外半径(0,r] + var startAngle = math.degreeToRadian(style.startAngle); + var endAngle = math.degreeToRadian(style.endAngle); + var clockWise = style.clockWise; + + if (!clockWise) { + startAngle = -startAngle; + endAngle = -endAngle; + } + + if (r0 > 1) { + computeBoundingBox.arc( + x, y, r0, startAngle, endAngle, !clockWise, min0, max0 + ); + } else { + min0[0] = max0[0] = x; + min0[1] = max0[1] = y; + } + computeBoundingBox.arc( + x, y, r, startAngle, endAngle, !clockWise, min1, max1 + ); + + vec2.min(min0, min0, min1); + vec2.max(max0, max0, max1); + style.__rect = { + x: min0[0], + y: min0[1], + width: max0[0] - min0[0], + height: max0[1] - min0[1] + }; + return style.__rect; + } + }; + + + require('../tool/util').inherits(Sector, Base); + return Sector; + } +); diff --git a/amd/zrender/shape/ShapeBundle.js b/amd/zrender/shape/ShapeBundle.js new file mode 100644 index 0000000..71f1105 --- /dev/null +++ b/amd/zrender/shape/ShapeBundle.js @@ -0,0 +1,160 @@ +/** + * ShapeBundle 捆绑多个 shape 的 buildPath 方法,但是共用同一个样式 + * @author pissang (https://github.com/pissang) + * @module zrender/shape/ShapeBundle + * @example + * var poly1 = new PolygonShape(); + * var poly2 = new PolygonShape(); + * var poly3 = new PolygonShape(); + * var shapeBundle = new ShapeBundle({ + * style: { + * shapeList: [poly1, poly2, poly3], + * color: 'red' + * } + * }); + * zr.addShape(shapeBundle); + */ + +/** + * @typedef {Object} IShapeBundleStyle + * @property {string} shapeList shape列表 + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ +define(function (require) { + + var Base = require('./Base'); + + var ShapeBundle = function (options) { + Base.call(this, options); + /** + * ShapeBundle绘制样式 + * @name module:zrender/shape/ShapeBundle#style + * @type {module:zrender/shape/ShapeBundle~IShapeBundleStyle} + */ + /** + * ShapeBundle高亮绘制样式 + * @name module:zrender/shape/ShapeBundle#highlightStyle + * @type {module:zrender/shape/ShapeBundle~IShapeBundleStyle} + */ + }; + + ShapeBundle.prototype = { + + constructor: ShapeBundle, + + type: 'shape-bundle', + + brush: function (ctx, isHighlight) { + var style = this.beforeBrush(ctx, isHighlight); + + ctx.beginPath(); + for (var i = 0; i < style.shapeList.length; i++) { + var subShape = style.shapeList[i]; + var subShapeStyle = subShape.style; + if (isHighlight) { + subShapeStyle = subShape.getHighlightStyle( + subShapeStyle, + subShape.highlightStyle || {}, + subShape.brushTypeOnly + ); + } + subShape.buildPath(ctx, subShapeStyle); + } + switch (style.brushType) { + /* jshint ignore:start */ + case 'both': + ctx.fill(); + case 'stroke': + style.lineWidth > 0 && ctx.stroke(); + break; + /* jshint ignore:end */ + default: + ctx.fill(); + } + + this.drawText(ctx, style, this.style); + + this.afterBrush(ctx); + }, + + /** + * 计算返回多边形包围盒矩阵 + * @param {module:zrender/shape/Polygon~IShapeBundleStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect: function (style) { + if (style.__rect) { + return style.__rect; + } + var minX = Number.MAX_VALUE; + var maxX = Number.MIN_VALUE; + var minY = Number.MAX_VALUE; + var maxY = Number.MIN_VALUE; + for (var i = 0; i < style.shapeList.length; i++) { + var subShape = style.shapeList[i]; + // TODO Highlight style ? + var subRect = subShape.getRect(subShape.style); + + var minX = Math.min(subRect.x, minX); + var minY = Math.min(subRect.y, minY); + var maxX = Math.max(subRect.x + subRect.width, maxX); + var maxY = Math.max(subRect.y + subRect.height, maxY); + } + + style.__rect = { + x: minX, + y: minY, + width: maxX - minX, + height: maxY - minY + }; + + return style.__rect; + }, + + isCover: function (x, y) { + var originPos = this.getTansform(x, y); + x = originPos[0]; + y = originPos[1]; + + var rect = this.style.__rect; + if (!rect) { + rect = this.getRect(this.style); + } + + if (x >= rect.x + && x <= (rect.x + rect.width) + && y >= rect.y + && y <= (rect.y + rect.height) + ) { + for (var i = 0; i < this.style.shapeList.length; i++) { + var subShape = this.style.shapeList[i]; + if (subShape.isCover(x, y)) { + return true; + } + } + } + + return false; + } + }; + + require('../tool/util').inherits(ShapeBundle, Base); + return ShapeBundle; +}); \ No newline at end of file diff --git a/amd/zrender/shape/Star.js b/amd/zrender/shape/Star.js index a294feb..ef58939 100644 --- a/amd/zrender/shape/Star.js +++ b/amd/zrender/shape/Star.js @@ -1,173 +1,164 @@ -/** - * zrender - * - * @author sushuang (宿爽, sushuang@baidu.com) - * - * shape类:n角星(n>3) - * 可配图形属性: - { - // 基础属性 - shape : 'star', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,n角星外接圆心横坐标 - y : {number}, // 必须,n角星外接圆心纵坐标 - r : {number}, // 必须,n角星外接圆半径 - r0 : {number}, // n角星内部顶点(凹点)的外接圆半径, - // 如果不指定此参数,则自动计算:取相隔外部顶点连线的交点作内部顶点 - n : {number}, // 必须,指明几角星 - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - lineJoin : {string}, // 默认为miter,线段连接样式。miter | round | bevel - - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为outside,附加文本位置。 - // outside | inside - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'star', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - r : 150, - n : 5, - color : '#eee' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - function (require) { - - var math = require('../tool/math'); - var sin = math.sin; - var cos = math.cos; - var PI = Math.PI; - - var Base = require('./Base'); - - function Star(options) { - Base.call(this, options); - } - - Star.prototype = { - type: 'star', - - /** - * 创建n角星(n>3)路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - var n = style.n; - if (!n || n < 2) { return; } - - var x = style.x; - var y = style.y; - var r = style.r; - var r0 = style.r0; - - // 如果未指定内部顶点外接圆半径,则自动计算 - if (r0 == null) { - r0 = n > 4 - // 相隔的外部顶点的连线的交点, - // 被取为内部交点,以此计算r0 - ? r * cos(2 * PI / n) / cos(PI / n) - // 二三四角星的特殊处理 - : r / 3; - } - - var dStep = PI / n; - var deg = -PI / 2; - var xStart = x + r * cos(deg); - var yStart = y + r * sin(deg); - deg += dStep; - - // 记录边界点,用于判断inside - var pointList = style.pointList = []; - pointList.push([xStart, yStart]); - for (var i = 0, end = n * 2 - 1, ri; i < end; i ++) { - ri = i % 2 === 0 ? r0 : r; - pointList.push([x + ri * cos(deg), y + ri * sin(deg)]); - deg += dStep; - } - pointList.push([xStart, yStart]); - - // 绘制 - ctx.moveTo(pointList[0][0], pointList[0][1]); - for (var i = 0; i < pointList.length; i ++) { - ctx.lineTo(pointList[i][0], pointList[i][1]); - } - - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function(style) { - if (style.__rect) { - return style.__rect; - } - - var lineWidth; - if (style.brushType == 'stroke' || style.brushType == 'fill') { - lineWidth = style.lineWidth || 1; - } - else { - lineWidth = 0; - } - style.__rect = { - x : Math.round(style.x - style.r - lineWidth / 2), - y : Math.round(style.y - style.r - lineWidth / 2), - width : style.r * 2 + lineWidth, - height : style.r * 2 + lineWidth - }; - - return style.__rect; - } - }; - - require('../tool/util').inherits(Star, Base); - return Star; - } -); \ No newline at end of file +/** + * n角星(n>3) + * @module zrender/shape/Star + * @author sushuang (宿爽, sushuang0322@gmail.com) + * @example + * var Star = require('zrender/shape/Star'); + * var shape = new Star({ + * style: { + * x: 200, + * y: 100, + * r: 150, + * n: 5, + * text: '五角星' + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} IStarStyle + * @property {number} x n角星外接圆心x坐标 + * @property {number} y n角星外接圆心y坐标 + * @property {number} r n角星外接圆半径 + * @property {number} [r0] n角星内部顶点(凹点)的外接圆半径。 + * 如果不指定此参数,则自动计算:取相隔外部顶点连线的交点作内部顶点。 + * @property {number} n 指明几角星 + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ + +define( + function (require) { + + var math = require('../tool/math'); + var sin = math.sin; + var cos = math.cos; + var PI = Math.PI; + + var Base = require('./Base'); + + /** + * @alias module:zrender/shape/Star + * @param {Object} options + * @constructor + * @extends module:zrender/shape/Base + */ + var Star = function(options) { + Base.call(this, options); + /** + * n角星绘制样式 + * @name module:zrender/shape/Star#style + * @type {module:zrender/shape/Star~IStarStyle} + */ + /** + * n角星高亮绘制样式 + * @name module:zrender/shape/Star#highlightStyle + * @type {module:zrender/shape/Star~IStarStyle} + */ + }; + + Star.prototype = { + type: 'star', + + /** + * 创建n角星(n>3)路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Star~IStarStyle} style + */ + buildPath : function(ctx, style) { + var n = style.n; + if (!n || n < 2) { + return; + } + + var x = style.x; + var y = style.y; + var r = style.r; + var r0 = style.r0; + + // 如果未指定内部顶点外接圆半径,则自动计算 + if (r0 == null) { + r0 = n > 4 + // 相隔的外部顶点的连线的交点, + // 被取为内部交点,以此计算r0 + ? r * cos(2 * PI / n) / cos(PI / n) + // 二三四角星的特殊处理 + : r / 3; + } + + var dStep = PI / n; + var deg = -PI / 2; + var xStart = x + r * cos(deg); + var yStart = y + r * sin(deg); + deg += dStep; + + // 记录边界点,用于判断inside + var pointList = style.pointList = []; + pointList.push([ xStart, yStart ]); + for (var i = 0, end = n * 2 - 1, ri; i < end; i++) { + ri = i % 2 === 0 ? r0 : r; + pointList.push([ x + ri * cos(deg), y + ri * sin(deg) ]); + deg += dStep; + } + pointList.push([ xStart, yStart ]); + + // 绘制 + ctx.moveTo(pointList[0][0], pointList[0][1]); + for (var i = 0; i < pointList.length; i++) { + ctx.lineTo(pointList[i][0], pointList[i][1]); + } + + ctx.closePath(); + + return; + }, + + /** + * 返回n角星包围盒矩形 + * @param {module:zrender/shape/Star~IStarStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function(style) { + if (style.__rect) { + return style.__rect; + } + + var lineWidth; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } + else { + lineWidth = 0; + } + style.__rect = { + x : Math.round(style.x - style.r - lineWidth / 2), + y : Math.round(style.y - style.r - lineWidth / 2), + width : style.r * 2 + lineWidth, + height : style.r * 2 + lineWidth + }; + + return style.__rect; + } + }; + + require('../tool/util').inherits(Star, Base); + return Star; + } +); diff --git a/amd/zrender/shape/Text.js b/amd/zrender/shape/Text.js index 29b810e..a572233 100644 --- a/amd/zrender/shape/Text.js +++ b/amd/zrender/shape/Text.js @@ -1,227 +1,211 @@ -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:文字 - * 可配图形属性: - { - // 基础属性 - shape : 'text', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,横坐标 - y : {number}, // 必须,纵坐标 - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',线条颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 必须,文本内容 - textFont : {string}, // 默认为null,文本文字样式,eg:'bold 18px verdana' - textAlign : {string}, // 默认为start,文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认为middle,文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - maxWidth : {number} // 默认为null,最大宽度 - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'text', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - color : 'red', - text : 'Baidu' - }, - myName : 'kener', //可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - function (require) { - var area = require('../tool/area'); - var Base = require('./Base'); - - function Text(options) { - Base.call(this, options); - } - - Text.prototype = { - type: 'text', - - /** - * 画刷,重载基类方法 - * @param {Context2D} ctx Canvas 2D上下文 - * @param isHighlight 是否为高亮状态 - */ - brush : function(ctx, isHighlight) { - var style = this.style; - if (isHighlight) { - // 根据style扩展默认高亮样式 - style = this.getHighlightStyle( - style, this.highlightStyle || {} - ); - } - - if (typeof(style.text) == 'undefined' || style.text === false) { - return; - } - - ctx.save(); - this.setContext(ctx, style); - - // 设置transform - this.setTransform(ctx); - - if (style.textFont) { - ctx.font = style.textFont; - } - ctx.textAlign = style.textAlign || 'start'; - ctx.textBaseline = style.textBaseline || 'middle'; - - var text = (style.text + '').split('\n'); - var lineHeight = area.getTextHeight('国', style.textFont); - var rect = this.getRect(style); - var x = style.x; - var y; - if (style.textBaseline == 'top') { - y = rect.y; - } - else if (style.textBaseline == 'bottom') { - y = rect.y + lineHeight; - } - else { - y = rect.y + lineHeight / 2; - } - - for (var i = 0, l = text.length; i < l; i++) { - if (style.maxWidth) { - switch (style.brushType) { - case 'fill': - ctx.fillText( - text[i], - x, y, style.maxWidth - ); - break; - case 'stroke': - ctx.strokeText( - text[i], - x, y, style.maxWidth - ); - break; - case 'both': - ctx.fillText( - text[i], - x, y, style.maxWidth - ); - ctx.strokeText( - text[i], - x, y, style.maxWidth - ); - break; - default: - ctx.fillText( - text[i], - x, y, style.maxWidth - ); - } - } - else{ - switch (style.brushType) { - case 'fill': - ctx.fillText(text[i], x, y); - break; - case 'stroke': - ctx.strokeText(text[i], x, y); - break; - case 'both': - ctx.fillText(text[i], x, y); - ctx.strokeText(text[i], x, y); - break; - default: - ctx.fillText(text[i], x, y); - } - } - y += lineHeight; - } - - ctx.restore(); - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function(style) { - if (style.__rect) { - return style.__rect; - } - - var width = area.getTextWidth(style.text, style.textFont); - var height = area.getTextHeight(style.text, style.textFont); - - var textX = style.x; //默认start == left - if (style.textAlign == 'end' || style.textAlign == 'right') { - textX -= width; - } - else if (style.textAlign == 'center') { - textX -= (width / 2); - } - - var textY; - if (style.textBaseline == 'top') { - textY = style.y; - } - else if (style.textBaseline == 'bottom') { - textY = style.y - height; - } - else { - // middle - textY = style.y - height / 2; - } - - style.__rect = { - x : textX, - y : textY, - width : width, - height : height - }; - - return style.__rect; - } - }; - - require('../tool/util').inherits(Text, Base); - return Text; - } -); +/** + * @module zrender/shape/Text + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + * @example + * var Text = require('zrender/shape/Text'); + * var shape = new Text({ + * style: { + * text: 'Label', + * x: 100, + * y: 100, + * textFont: '14px Arial' + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} ITextStyle + * @property {number} x 横坐标 + * @property {number} y 纵坐标 + * @property {string} text 文本内容 + * @property {number} [maxWidth=null] 最大宽度限制 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textAlign] 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + */ + +define( + function (require) { + var area = require('../tool/area'); + var Base = require('./Base'); + + /** + * @alias module:zrender/shape/Text + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var Text = function (options) { + Base.call(this, options); + /** + * 文字绘制样式 + * @name module:zrender/shape/Text#style + * @type {module:zrender/shape/Text~ITextStyle} + */ + /** + * 文字高亮绘制样式 + * @name module:zrender/shape/Text#highlightStyle + * @type {module:zrender/shape/Text~ITextStyle} + */ + }; + + Text.prototype = { + type: 'text', + + brush : function (ctx, isHighlight) { + var style = this.style; + if (isHighlight) { + // 根据style扩展默认高亮样式 + style = this.getHighlightStyle( + style, this.highlightStyle || {} + ); + } + + if (typeof(style.text) == 'undefined' || style.text === false) { + return; + } + + ctx.save(); + this.doClip(ctx); + + this.setContext(ctx, style); + + // 设置transform + this.setTransform(ctx); + + if (style.textFont) { + ctx.font = style.textFont; + } + ctx.textAlign = style.textAlign || 'start'; + ctx.textBaseline = style.textBaseline || 'middle'; + + var text = (style.text + '').split('\n'); + var lineHeight = area.getTextHeight('国', style.textFont); + var rect = this.getRect(style); + var x = style.x; + var y; + if (style.textBaseline == 'top') { + y = rect.y; + } + else if (style.textBaseline == 'bottom') { + y = rect.y + lineHeight; + } + else { + y = rect.y + lineHeight / 2; + } + + for (var i = 0, l = text.length; i < l; i++) { + if (style.maxWidth) { + switch (style.brushType) { + case 'fill': + ctx.fillText( + text[i], + x, y, style.maxWidth + ); + break; + case 'stroke': + ctx.strokeText( + text[i], + x, y, style.maxWidth + ); + break; + case 'both': + ctx.fillText( + text[i], + x, y, style.maxWidth + ); + ctx.strokeText( + text[i], + x, y, style.maxWidth + ); + break; + default: + ctx.fillText( + text[i], + x, y, style.maxWidth + ); + } + } + else { + switch (style.brushType) { + case 'fill': + ctx.fillText(text[i], x, y); + break; + case 'stroke': + ctx.strokeText(text[i], x, y); + break; + case 'both': + ctx.fillText(text[i], x, y); + ctx.strokeText(text[i], x, y); + break; + default: + ctx.fillText(text[i], x, y); + } + } + y += lineHeight; + } + + ctx.restore(); + return; + }, + + /** + * 返回文字包围盒矩形 + * @param {module:zrender/shape/Text~ITextStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function (style) { + if (style.__rect) { + return style.__rect; + } + + var width = area.getTextWidth(style.text, style.textFont); + var height = area.getTextHeight(style.text, style.textFont); + + var textX = style.x; // 默认start == left + if (style.textAlign == 'end' || style.textAlign == 'right') { + textX -= width; + } + else if (style.textAlign == 'center') { + textX -= (width / 2); + } + + var textY; + if (style.textBaseline == 'top') { + textY = style.y; + } + else if (style.textBaseline == 'bottom') { + textY = style.y - height; + } + else { + // middle + textY = style.y - height / 2; + } + + style.__rect = { + x : textX, + y : textY, + width : width, + height : height + }; + + return style.__rect; + } + }; + + require('../tool/util').inherits(Text, Base); + return Text; + } +); + diff --git a/amd/zrender/shape/Trochoid.js b/amd/zrender/shape/Trochoid.js index fd3cd01..fd06d2e 100644 --- a/amd/zrender/shape/Trochoid.js +++ b/amd/zrender/shape/Trochoid.js @@ -1,184 +1,169 @@ -/** - * zrender - * - * @author Neil (杨骥, yangji01@baidu.com) - * - * shape类:内外旋轮曲线 - * 可配图形属性: - { - // 基础属性 - shape : 'trochoid', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 默认为0, 圆心的横坐标 - y : {number}, // 默认为0, 圆心的纵坐标 - r : {number}, // 必须,固定圆半径 内旋曲线时必须大于转动圆半径 - r0 : {number}, // 必须,转动圆半径 - d : {number}, // 必须,点到内部转动圆的距离,等于r时曲线为摆线 - location : {string}, // 默认为‘in’ 内旋 out 外旋 - strokeColor : {color}, // 默认为'#000',线条颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度 - lineCap : {string}, // 默认为butt,线帽样式。butt | round | square - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为end,附加文本位置。 - // inside | start | end - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#000' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'hypotrochoid', - id : '123456', - zlevel : 1, - style : { - x : 100, - y : 100, - r : 50, - r0 : 30, - d : 50, - strokeColor : '#eee', - lineWidth : 20, - text : 'Baidu' - }, - myName : 'kener', //可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - function (require) { - var Base = require('./Base'); - - function Trochoid(options) { - this.brushTypeOnly = 'stroke'; //线条只能描边,填充后果自负 - Base.call(this, options); - } - - Trochoid.prototype = { - type: 'trochoid', - - /** - * 创建线条路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - var _x1; - var _y1; - var _x2; - var _y2; - var _R = style.r; - var _r = style.r0; - var _d = style.d; - var _offsetX = style.x; - var _offsetY = style.y; - var _delta = style.location == 'out' ? 1 : -1; - - var _math = require('../tool/math'); - - if (style.location && _R <= _r) { - alert('参数错误'); - return; - } - - var _num = 0; - var i = 1; - var _theta; - - _x1 = (_R + _delta * _r) * _math.cos(0) - - _delta * _d * _math.cos(0) + _offsetX; - _y1 = (_R + _delta * _r) * _math.sin(0) - - _d * _math.sin(0) + _offsetY; - - ctx.moveTo(_x1, _y1); - - //计算结束时的i - do { - _num ++; - } - while ( ( _r * _num ) % ( _R + _delta * _r ) !== 0); - - do { - _theta = Math.PI / 180 * i; - _x2 = (_R + _delta * _r) * _math.cos(_theta) - - _delta * _d * _math.cos((_R / _r + _delta) * _theta) - + _offsetX; - _y2 = (_R + _delta * _r) * _math.sin(_theta) - - _d * _math.sin((_R / _r + _delta) * _theta) - + _offsetY; - ctx.lineTo( _x2, _y2 ); - i ++; - } - while (i <= ( _r * _num) / (_R + _delta * _r) * 360); - - - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function(style) { - if (style.__rect) { - return style.__rect; - } - - var _R = style.r; - var _r = style.r0; - var _d = style.d; - var _delta = style.location == 'out' ? 1 : -1; - var _s = _R + _d + _delta * _r; - var _offsetX = style.x; - var _offsetY = style.y; - - var lineWidth; - if (style.brushType == 'stroke' || style.brushType == 'fill') { - lineWidth = style.lineWidth || 1; - } - else { - lineWidth = 0; - } - style.__rect = { - x : - _s - lineWidth + _offsetX, - y : - _s - lineWidth + _offsetY, - width : 2 * _s + 2 * lineWidth, - height : 2 * _s + 2 * lineWidth - }; - return style.__rect; - } - }; - - require('../tool/util').inherits(Trochoid, Base); - return Trochoid; - } -); \ No newline at end of file +/** + * 内外旋轮曲线 + * @module zrender/shape/Trochold + * @author Neil (杨骥, 511415343@qq.com) + * @example + * var Trochold = require('zrender/shape/Trochold'); + * var shape = new Trochold({ + * style: { + * x: 100, + * y: 100, + * r: 50, + * r0: 30, + * d: 50, + * strokeColor: '#eee', + * text: 'trochold' + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} ITrocholdStyle + * @property {number} x 中心x坐标 + * @property {number} y 中心y坐标 + * @property {number} r 固定圆半径 内旋曲线时必须大于转动圆半径 + * @property {number} r0 转动圆半径 + * @property {number} d 点到内部转动圆的距离,等于r时曲线为摆线 + * @property {string} [location='in'] 内旋 out 外旋 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ +define( + function (require) { + var Base = require('./Base'); + + /** + * @alias module:zrender/shape/Trochold + * @param {Object} options + * @constructor + * @extends zrender/shape/Base + */ + var Trochoid = function (options) { + this.brushTypeOnly = 'stroke'; // 线条只能描边,填充后果自负 + Base.call(this, options); + /** + * 内外旋轮曲线绘制样式 + * @name module:zrender/shape/Trochold#style + * @type {module:zrender/shape/Trochold~ITrocholdStyle} + */ + /** + * 内外旋轮曲线高亮绘制样式 + * @name module:zrender/shape/Trochold#highlightStyle + * @type {module:zrender/shape/Trochold~ITrocholdStyle} + */ + }; + + Trochoid.prototype = { + type: 'trochoid', + + /** + * 创建内外旋轮曲线路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Trochold~ITrocholdStyle} style + */ + buildPath : function (ctx, style) { + var _x1; + var _y1; + var _x2; + var _y2; + var _R = style.r; + var _r = style.r0; + var _d = style.d; + var _offsetX = style.x; + var _offsetY = style.y; + var _delta = style.location == 'out' ? 1 : -1; + + var _math = require('../tool/math'); + + if (style.location && _R <= _r) { + alert('参数错误'); + return; + } + + var _num = 0; + var i = 1; + var _theta; + + _x1 = (_R + _delta * _r) * _math.cos(0) + - _delta * _d * _math.cos(0) + _offsetX; + _y1 = (_R + _delta * _r) * _math.sin(0) + - _d * _math.sin(0) + _offsetY; + + ctx.moveTo(_x1, _y1); + + // 计算结束时的i + do { + _num++; + } + while ((_r * _num) % (_R + _delta * _r) !== 0); + + do { + _theta = Math.PI / 180 * i; + _x2 = (_R + _delta * _r) * _math.cos(_theta) + - _delta * _d * _math.cos((_R / _r + _delta) * _theta) + + _offsetX; + _y2 = (_R + _delta * _r) * _math.sin(_theta) + - _d * _math.sin((_R / _r + _delta) * _theta) + + _offsetY; + ctx.lineTo(_x2, _y2); + i++; + } + while (i <= (_r * _num) / (_R + _delta * _r) * 360); + + + }, + + /** + * 返回内外旋轮曲线包围盒矩形 + * @param {module:zrender/shape/Trochold~ITrocholdStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function (style) { + if (style.__rect) { + return style.__rect; + } + + var _R = style.r; + var _r = style.r0; + var _d = style.d; + var _delta = style.location == 'out' ? 1 : -1; + var _s = _R + _d + _delta * _r; + var _offsetX = style.x; + var _offsetY = style.y; + + var lineWidth; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } + else { + lineWidth = 0; + } + style.__rect = { + x : -_s - lineWidth + _offsetX, + y : -_s - lineWidth + _offsetY, + width : 2 * _s + 2 * lineWidth, + height : 2 * _s + 2 * lineWidth + }; + return style.__rect; + } + }; + + require('../tool/util').inherits(Trochoid, Base); + return Trochoid; + } +); diff --git a/amd/zrender/shape/mixin/Transformable.js b/amd/zrender/shape/mixin/Transformable.js deleted file mode 100644 index e31a0cc..0000000 --- a/amd/zrender/shape/mixin/Transformable.js +++ /dev/null @@ -1,128 +0,0 @@ -define(function(require) { - - var matrix = require('../../tool/matrix'); - var origin = [0, 0]; - - var Transformable = function() { - - if (!this.position) { - this.position = [0, 0]; - } - if (typeof(this.rotation) == 'undefined') { - this.rotation = [0, 0, 0]; - } - if (!this.scale) { - this.scale = [1, 1, 0, 0]; - } - - this.needLocalTransform = false; - this.needTransform = false; - }; - - Transformable.prototype = { - - constructor: Transformable, - - updateNeedTransform: function() { - this.needLocalTransform = Math.abs(this.rotation[0]) > 0.0001 - || Math.abs(this.position[0]) > 0.0001 - || Math.abs(this.position[1]) > 0.0001 - || Math.abs(this.scale[0] - 1) > 0.0001 - || Math.abs(this.scale[1] - 1) > 0.0001; - }, - - updateTransform: function() { - - this.updateNeedTransform(); - - if (this.parent) { - this.needTransform = this.needLocalTransform || this.parent.needTransform; - } else { - this.needTransform = this.needLocalTransform; - } - - if (!this.needTransform) { - return; - } - - var m = this.transform || matrix.create(); - matrix.identity(m); - - if (this.needLocalTransform) { - if (this.scale && (this.scale[0] !== 1 || this.scale[1] !== 1)) { - origin[0] = -this.scale[2] || 0; - origin[1] = -this.scale[3] || 0; - if (origin[0] || origin[1]) { - matrix.translate( - m, m, origin - ); - } - matrix.scale(m, m, this.scale); - if (origin[0] || origin[1]) { - origin[0] = -origin[0]; - origin[1] = -origin[1]; - matrix.translate( - m, m, origin - ); - } - } - - if (this.rotation) { - if (this.rotation instanceof Array) { - if (this.rotation[0] !== 0) { - origin[0] = -this.rotation[1] || 0; - origin[1] = -this.rotation[2] || 0; - if (origin[0] || origin[1]) { - matrix.translate( - m, m, origin - ); - } - matrix.rotate(m, m, this.rotation[0]); - if (origin[0] || origin[1]) { - origin[0] = -origin[0]; - origin[1] = -origin[1]; - matrix.translate( - m, m, origin - ); - } - } - } - else { - if (this.rotation !== 0) { - matrix.rotate(m, m, this.rotation); - } - } - } - - if (this.position && (this.position[0] !==0 || this.position[1] !== 0)) { - matrix.translate(m, m, this.position); - } - } - - // 保存这个变换矩阵 - this.transform = m; - - // 应用父节点变换 - if (this.parent && this.parent.needTransform) { - if (this.needLocalTransform) { - matrix.mul(this.transform, this.parent.transform, this.transform); - } else { - matrix.copy(this.transform, this.parent.transform); - } - } - }, - - setTransform: function(ctx) { - if (this.needTransform) { - var m = this.transform; - ctx.transform( - m[0], m[1], - m[2], m[3], - m[4], m[5] - ); - } - } - }; - - return Transformable; -}); \ No newline at end of file diff --git a/amd/zrender/shape/util/PathProxy.js b/amd/zrender/shape/util/PathProxy.js new file mode 100644 index 0000000..877f00f --- /dev/null +++ b/amd/zrender/shape/util/PathProxy.js @@ -0,0 +1,253 @@ +/** + * Path 代理,可以在`buildPath`中用于替代`ctx`, 会保存每个path操作的命令到pathCommands属性中 + * 可以用于 isInsidePath 判断以及获取boundingRect + * + * @module zrender/shape/tool/PathProxy + * @author pissang (http://www.github.com/pissang) + * + * @example + * var SomeShape = function() { + * this._pathProxy = new PathProxy(); + * ... + * } + * SomeShape.prototype.buildPath = function(ctx, style) { + * this._pathProxy.begin(ctx); + * .moveTo(style.x, style.y); + * .lineTo(style.x1, style.y1); + * ... + * .closePath(); + * }, + * SomeShape.prototype.getRect = function(style) { + * if (!style._rect) { + * // 这里必须要在 buildPath 之后才能调用 + * style._rect = this._pathProxy.fastBoundingRect(); + * } + * return this.style._rect; + * }, + * SomeShape.prototype.isCover = function(x, y) { + * var rect = this.getRect(this.style); + * if (x >= rect.x + * && x <= (rect.x + rect.width) + * && y >= rect.y + * && y <= (rect.y + rect.height) + * ) { + * return area.isInsidePath( + * this._pathProxy.pathCommands, 0, 'fill', x, y + * ); + * } + * } + */ +define(function (require) { + + var vector = require('../../tool/vector'); + // var computeBoundingBox = require('../../tool/computeBoundingBox'); + + var PathSegment = function(command, points) { + this.command = command; + this.points = points || null; + }; + + /** + * @alias module:zrender/shape/tool/PathProxy + * @constructor + */ + var PathProxy = function () { + + /** + * Path描述的数组,用于`isInsidePath`的判断 + * @type {Array.} + */ + this.pathCommands = []; + + this._ctx = null; + + this._min = []; + this._max = []; + }; + + /** + * 快速计算Path包围盒(并不是最小包围盒) + * @return {Object} + */ + PathProxy.prototype.fastBoundingRect = function () { + var min = this._min; + var max = this._max; + min[0] = min[1] = Infinity; + max[0] = max[1] = -Infinity; + for (var i = 0; i < this.pathCommands.length; i++) { + var seg = this.pathCommands[i]; + var p = seg.points; + switch (seg.command) { + case 'M': + vector.min(min, min, p); + vector.max(max, max, p); + break; + case 'L': + vector.min(min, min, p); + vector.max(max, max, p); + break; + case 'C': + for (var j = 0; j < 6; j += 2) { + min[0] = Math.min(min[0], min[0], p[j]); + min[1] = Math.min(min[1], min[1], p[j + 1]); + max[0] = Math.max(max[0], max[0], p[j]); + max[1] = Math.max(max[1], max[1], p[j + 1]); + } + break; + case 'Q': + for (var j = 0; j < 4; j += 2) { + min[0] = Math.min(min[0], min[0], p[j]); + min[1] = Math.min(min[1], min[1], p[j + 1]); + max[0] = Math.max(max[0], max[0], p[j]); + max[1] = Math.max(max[1], max[1], p[j + 1]); + } + break; + case 'A': + var cx = p[0]; + var cy = p[1]; + var rx = p[2]; + var ry = p[3]; + min[0] = Math.min(min[0], min[0], cx - rx); + min[1] = Math.min(min[1], min[1], cy - ry); + max[0] = Math.max(max[0], max[0], cx + rx); + max[1] = Math.max(max[1], max[1], cy + ry); + break; + } + } + + return { + x: min[0], + y: min[1], + width: max[0] - min[0], + height: max[1] - min[1] + }; + }; + + /** + * @param {CanvasRenderingContext2D} ctx + * @return {module:zrender/shape/util/PathProxy} + */ + PathProxy.prototype.begin = function (ctx) { + this._ctx = ctx || null; + // 清空pathCommands + this.pathCommands.length = 0; + + return this; + }; + + /** + * @param {number} x + * @param {number} y + * @return {module:zrender/shape/util/PathProxy} + */ + PathProxy.prototype.moveTo = function (x, y) { + this.pathCommands.push(new PathSegment('M', [x, y])); + if (this._ctx) { + this._ctx.moveTo(x, y); + } + return this; + }; + + /** + * @param {number} x + * @param {number} y + * @return {module:zrender/shape/util/PathProxy} + */ + PathProxy.prototype.lineTo = function (x, y) { + this.pathCommands.push(new PathSegment('L', [x, y])); + if (this._ctx) { + this._ctx.lineTo(x, y); + } + return this; + }; + + /** + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @param {number} x3 + * @param {number} y3 + * @return {module:zrender/shape/util/PathProxy} + */ + PathProxy.prototype.bezierCurveTo = function (x1, y1, x2, y2, x3, y3) { + this.pathCommands.push(new PathSegment('C', [x1, y1, x2, y2, x3, y3])); + if (this._ctx) { + this._ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3); + } + return this; + }; + + /** + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @return {module:zrender/shape/util/PathProxy} + */ + PathProxy.prototype.quadraticCurveTo = function (x1, y1, x2, y2) { + this.pathCommands.push(new PathSegment('Q', [x1, y1, x2, y2])); + if (this._ctx) { + this._ctx.quadraticCurveTo(x1, y1, x2, y2); + } + return this; + }; + + /** + * @param {number} cx + * @param {number} cy + * @param {number} r + * @param {number} startAngle + * @param {number} endAngle + * @param {boolean} anticlockwise + * @return {module:zrender/shape/util/PathProxy} + */ + PathProxy.prototype.arc = function (cx, cy, r, startAngle, endAngle, anticlockwise) { + this.pathCommands.push(new PathSegment( + 'A', [cx, cy, r, r, startAngle, endAngle - startAngle, 0, anticlockwise ? 0 : 1] + )); + if (this._ctx) { + this._ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise); + } + return this; + }; + + // TODO + PathProxy.prototype.arcTo = function (x1, y1, x2, y2, radius) { + if (this._ctx) { + this._ctx.arcTo(x1, y1, x2, y2, radius); + } + return this; + }; + + // TODO + PathProxy.prototype.rect = function (x, y, w, h) { + if (this._ctx) { + this._ctx.rect(x, y, w, h); + } + return this; + }; + + /** + * @return {module:zrender/shape/util/PathProxy} + */ + PathProxy.prototype.closePath = function () { + this.pathCommands.push(new PathSegment('z')); + if (this._ctx) { + this._ctx.closePath(); + } + return this; + }; + + /** + * 是否没有Path命令 + * @return {boolean} + */ + PathProxy.prototype.isEmpty = function() { + return this.pathCommands.length === 0; + }; + + PathProxy.PathSegment = PathSegment; + + return PathProxy; +}); \ No newline at end of file diff --git a/amd/zrender/shape/util/dashedLineTo.js b/amd/zrender/shape/util/dashedLineTo.js index 0609778..6d27d46 100644 --- a/amd/zrender/shape/util/dashedLineTo.js +++ b/amd/zrender/shape/util/dashedLineTo.js @@ -1,14 +1,13 @@ /** * 虚线lineTo * - * author: Kener (@Kener-林峰, linzhifeng@baidu.com) + * author: Kener (@Kener-林峰, kener.linfeng@gmail.com) * errorrik (errorrik@gmail.com) */ - define( function (/* require */) { - var dashPattern = [5, 5]; + var dashPattern = [ 5, 5 ]; /** * 虚线lineTo */ @@ -37,7 +36,8 @@ define( for (var i = 0; i < numDashes; ++i) { if (flag) { ctx.moveTo(x1, y1); - } else { + } + else { ctx.lineTo(x1, y1); } flag = !flag; diff --git a/amd/zrender/shape/util/smoothBezier.js b/amd/zrender/shape/util/smoothBezier.js index 1093c51..418973e 100644 --- a/amd/zrender/shape/util/smoothBezier.js +++ b/amd/zrender/shape/util/smoothBezier.js @@ -1,18 +1,26 @@ /** * 贝塞尔平滑曲线 - * - * author: Kener (@Kener-林峰, linzhifeng@baidu.com) - * errorrik (errorrik@gmail.com) + * @module zrender/shape/util/smoothBezier + * @author pissang (https://www.github.com/pissang) + * Kener (@Kener-林峰, kener.linfeng@gmail.com) + * errorrik (errorrik@gmail.com) */ - define( - function ( require ) { + function (require) { var vector = require('../../tool/vector'); /** - * 贝塞尔平滑曲线 + * 贝塞尔平滑曲线 + * @alias module:zrender/shape/util/smoothBezier + * @param {Array} points 线段顶点数组 + * @param {number} smooth 平滑等级, 0-1 + * @param {boolean} isLoop + * @param {Array} constraint 将计算出来的控制点约束在一个包围盒内 + * 比如 [[0, 0], [100, 100]], 这个包围盒会与 + * 整个折线的包围盒做一个并集用来约束控制点。 + * @param {Array} 计算出来的控制点数组 */ - return function (points, smooth, isLoop) { + return function (points, smooth, isLoop, constraint) { var cps = []; var v = []; @@ -21,6 +29,20 @@ define( var prevPoint; var nextPoint; + var hasConstraint = !!constraint; + var min, max; + if (hasConstraint) { + min = [Infinity, Infinity]; + max = [-Infinity, -Infinity]; + for (var i = 0, len = points.length; i < len; i++) { + vector.min(min, min, points[i]); + vector.max(max, max, points[i]); + } + // 与指定的包围盒做并集 + vector.min(min, min, constraint[0]); + vector.max(max, max, constraint[1]); + } + for (var i = 0, len = points.length; i < len; i++) { var point = points[i]; var prevPoint; @@ -43,20 +65,29 @@ define( vector.sub(v, nextPoint, prevPoint); - //use degree to scale the handle length + // use degree to scale the handle length vector.scale(v, v, smooth); var d0 = vector.distance(point, prevPoint); var d1 = vector.distance(point, nextPoint); var sum = d0 + d1; - d0 /= sum; - d1 /= sum; + if (sum !== 0) { + d0 /= sum; + d1 /= sum; + } vector.scale(v1, v, -d0); vector.scale(v2, v, d1); - - cps.push(vector.add([], point, v1)); - cps.push(vector.add([], point, v2)); + var cp0 = vector.add([], point, v1); + var cp1 = vector.add([], point, v2); + if (hasConstraint) { + vector.max(cp0, cp0, min); + vector.min(cp0, cp0, max); + vector.max(cp1, cp1, min); + vector.min(cp1, cp1, max); + } + cps.push(cp0); + cps.push(cp1); } if (isLoop) { diff --git a/amd/zrender/shape/util/smoothSpline.js b/amd/zrender/shape/util/smoothSpline.js index 8737222..d51adec 100644 --- a/amd/zrender/shape/util/smoothSpline.js +++ b/amd/zrender/shape/util/smoothSpline.js @@ -1,13 +1,12 @@ /** - * 多线段平滑曲线 Catmull-Rom spline - * - * author: Kener (@Kener-林峰, linzhifeng@baidu.com) - * errorrik (errorrik@gmail.com) + * Catmull-Rom spline 插值折线 + * @module zrender/shape/util/smoothSpline + * @author pissang (https://www.github.com/pissang) + * Kener (@Kener-林峰, kener.linfeng@gmail.com) + * errorrik (errorrik@gmail.com) */ - - define( - function ( require ) { + function (require) { var vector = require('../../tool/vector'); /** @@ -17,26 +16,30 @@ define( var v0 = (p2 - p0) * 0.5; var v1 = (p3 - p1) * 0.5; return (2 * (p1 - p2) + v0 + v1) * t3 - + (- 3 * (p1 - p2) - 2 * v0 - v1) * t2 + + (-3 * (p1 - p2) - 2 * v0 - v1) * t2 + v0 * t + p1; } /** - * 多线段平滑曲线 Catmull-Rom spline + * @alias module:zrender/shape/util/smoothSpline + * @param {Array} points 线段顶点数组 + * @param {boolean} isLoop + * @param {Array} constraint + * @return {Array} */ - return function (points, isLoop) { + return function (points, isLoop, constraint) { var len = points.length; var ret = []; var distance = 0; for (var i = 1; i < len; i++) { - distance += vector.distance(points[i-1], points[i]); + distance += vector.distance(points[i - 1], points[i]); } var segs = distance / 5; segs = segs < len ? len : segs; for (var i = 0; i < segs; i++) { - var pos = i / (segs-1) * (isLoop ? len : len - 1); + var pos = i / (segs - 1) * (isLoop ? len : len - 1); var idx = Math.floor(pos); var w = pos - idx; @@ -49,8 +52,9 @@ define( p0 = points[idx === 0 ? idx : idx - 1]; p2 = points[idx > len - 2 ? len - 1 : idx + 1]; p3 = points[idx > len - 3 ? len - 1 : idx + 2]; - } else { - p0 = points[(idx -1 + len) % len]; + } + else { + p0 = points[(idx - 1 + len) % len]; p2 = points[(idx + 1) % len]; p3 = points[(idx + 2) % len]; } diff --git a/amd/zrender/tool/area.js b/amd/zrender/tool/area.js index 4b778dc..40b5367 100644 --- a/amd/zrender/tool/area.js +++ b/amd/zrender/tool/area.js @@ -1,507 +1,861 @@ -/** - * zrender: 图形空间辅助类 - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * isInside:是否在区域内部 - * isOutside:是否在区域外部 - * getTextWidth:测算单行文本宽度 - */ -define( - function(require) { - var util = require('../tool/util'); - - var _ctx; - - var _textWidthCache = {}; - var _textHeightCache = {}; - var _textWidthCacheCounter = 0; - var _textHeightCacheCounter = 0; - var TEXT_CACHE_MAX = 20000; - - /** - * 包含判断 - * - * @param {Object} shape : 图形 - * @param {Object} area : 目标区域 - * @param {number} x : 横坐标 - * @param {number} y : 纵坐标 - */ - function isInside(shape, area, x, y) { - if (!area || !shape) { - // 无参数或不支持类型 - return false; - } - var zoneType = shape.type; - - _ctx = _ctx || util.getContext(); - - if (!_isInsideRectangle(area.__rect || shape.getRect(area), x, y)) { - // 不在矩形区域内直接返回false - return false; - } - - // 未实现或不可用时(excanvas不支持)则数学运算,主要是line,brokenLine,ring - var _mathReturn = _mathMethod(zoneType, area, x, y); - if (typeof _mathReturn != 'undefined') { - return _mathReturn; - } - - if (zoneType != 'bezier-curve' - && shape.buildPath - && _ctx.isPointInPath - ) { - return _buildPathMethod(shape, _ctx, area, x, y); - } - else if (_ctx.getImageData) { - return _pixelMethod(shape, area, x, y); - } - - // 上面的方法都行不通时 - switch (zoneType) { - case 'heart': //心形---------10 // Todo,不精确 - case 'droplet':// 水滴----------11 // Todo,不精确 - case 'ellipse': // Todo,不精确 - return true; - // 旋轮曲线 不准确 - case 'trochoid': - var _r = area.location == 'out' - ? area.r1 + area.r2 + area.d - : area.r1 - area.r2 + area.d; - return _isInsideCircle(area, x, y, _r); - // 玫瑰线 不准确 - case 'rose' : - return _isInsideCircle(area, x, y, area.maxr); - //路径,椭圆,曲线等-----------------13 - default: - return false; // Todo,暂不支持 - } - } - - /** - * 用数学方法判断,三个方法中最快,但是支持的shape少 - * - * @param {string} zoneType : 图形类型 - * @param {Object} area :目标区域 - * @param {number} x : 横坐标 - * @param {number} y : 纵坐标 - * @return {boolean=} true表示坐标处在图形中 - */ - function _mathMethod(zoneType, area, x, y) { - // 在矩形内则部分图形需要进一步判断 - switch (zoneType) { - //线-----------------------1 - case 'line': - return _isInsideLine(area, x, y); - //折线----------------------2 - case 'broken-line': - return _isInsideBrokenLine(area, x, y); - //文本----------------------3 - case 'text': - return true; - //圆环----------------------4 - case 'ring': - return _isInsideRing(area, x, y); - //矩形----------------------5 - case 'rectangle': - return true; - //圆形----------------------6 - case 'circle': - return _isInsideCircle(area, x, y, area.r); - //扇形----------------------7 - case 'sector': - return _isInsideSector(area, x, y); - //多边形---------------------8 - case 'path': - return _isInsidePath(area, x, y); - case 'polygon': - case 'star': - case 'isogon': - return _isInsidePolygon(area, x, y); - //图片----------------------9 - case 'image': - return true; - } - } - - /** - * 通过buildPath方法来判断,三个方法中较快,但是不支持线条类型的shape, - * 而且excanvas不支持isPointInPath方法 - * - * @param {Object} shape : shape - * @param {Object} context : 上下文 - * @param {Object} area :目标区域 - * @param {number} x : 横坐标 - * @param {number} y : 纵坐标 - * @return {boolean} true表示坐标处在图形中 - */ - function _buildPathMethod(shape, context, area, x, y) { - // 图形类实现路径创建了则用类的path - context.beginPath(); - shape.buildPath(context, area); - context.closePath(); - return context.isPointInPath(x, y); - } - - /** - * 通过像素值来判断,三个方法中最慢,但是支持广,不足之处是excanvas不支持像素处理 - * - * @param {Object} shape shape类 - * @param {Object} area 目标区域 - * @param {number} x 横坐标 - * @param {number} y 纵坐标 - * @return {boolean} true表示坐标处在图形中 - */ - function _pixelMethod(shape, area, x, y) { - var _rect = area.__rect || shape.getRect(area); - var _context = util.getPixelContext(); - var _offset = util.getPixelOffset(); - - util.adjustCanvasSize(x, y); - _context.clearRect(_rect.x, _rect.y, _rect.width, _rect.height); - _context.beginPath(); - shape.brush(_context, {style : area}); - _context.closePath(); - - return _isPainted(_context, x + _offset.x, y + _offset.y); - } - - /** - * 坐标像素值,判断坐标是否被作色 - * - * @param {Object} context : 上下文 - * @param {number} x : 横坐标 - * @param {number} y : 纵坐标 - * @param {number=} unit : 触发的精度,越大越容易触发,可选,缺省是为1 - * @return {boolean} 已经被画过返回true - */ - function _isPainted(context, x, y, unit) { - var pixelsData; - - if (typeof unit != 'undefined') { - unit = (unit || 1 ) >> 1; - pixelsData = context.getImageData( - x - unit, - y - unit, - unit + unit, - unit + unit - ).data; - } - else { - pixelsData = context.getImageData(x, y, 1, 1).data; - } - - var len = pixelsData.length; - while (len--) { - if (pixelsData[len] !== 0) { - return true; - } - } - - return false; - } - - /** - * !isInside - */ - function isOutside(shape, area, x, y) { - return !isInside(shape, area, x, y); - } - - /** - * 线段包含判断 - */ - function _isInsideLine(area, x, y) { - var _x1 = area.xStart; - var _y1 = area.yStart; - var _x2 = area.xEnd; - var _y2 = area.yEnd; - var _l = Math.max(area.lineWidth, 5); - var _a = 0; - var _b = _x1; - - var minX, maxX; - if (_x1 < _x2) { - minX = _x1 - _l; maxX = _x2 + _l; - } else { - minX = _x2 - _l; maxX = _x1 + _l; - } - - var minY, maxY; - if (_y1 < _y2) { - minY = _y1 - _l; maxY = _y2 + _l; - } else { - minY = _y2 - _l; maxY = _y1 + _l; - } - - if (x < minX || x > maxX || y < minY || y > maxY) { - return false; - } - - if (_x1 !== _x2) { - _a = (_y1 - _y2) / (_x1 - _x2); - _b = (_x1 * _y2 - _x2 * _y1) / (_x1 - _x2) ; - } - else { - return Math.abs(x - _x1) <= _l / 2; - } - - var _s = (_a * x - y + _b) * (_a * x - y + _b) / (_a * _a + 1); - return _s <= _l / 2 * _l / 2; - } - - function _isInsideBrokenLine(area, x, y) { - var pointList = area.pointList; - var lineArea = { - xStart : 0, - yStart : 0, - xEnd : 0, - yEnd : 0, - lineWidth : 0 - }; - for (var i = 0, l = pointList.length - 1; i < l; i++) { - lineArea.xStart = pointList[i][0]; - lineArea.yStart = pointList[i][1]; - lineArea.xEnd = pointList[i + 1][0]; - lineArea.yEnd = pointList[i + 1][1]; - lineArea.lineWidth = Math.max(area.lineWidth, 10); - - if (_isInsideLine(lineArea, x, y)) { - return true; - } - } - - return false; - } - - function _isInsideRing(area, x, y) { - return _isInsideCircle(area, x, y, area.r) - && !_isInsideCircle({x: area.x, y: area.y}, x, y, area.r0 || 0); - } - - /** - * 矩形包含判断 - */ - function _isInsideRectangle(area, x, y) { - return x >= area.x - && x <= (area.x + area.width) - && y >= area.y - && y <= (area.y + area.height); - } - - /** - * 圆形包含判断 - */ - function _isInsideCircle(area, x, y, r) { - return (x - area.x) * (x - area.x) + (y - area.y) * (y - area.y) - < r * r; - } - - /** - * 扇形包含判断 - */ - function _isInsideSector(area, x, y) { - if (!_isInsideCircle(area, x, y, area.r) - || (area.r0 > 0 - && _isInsideCircle( - { - x : area.x, - y : area.y - }, - x, y, - area.r0 - ) - ) - ){ - // 大圆外或者小圆内直接false - return false; - } - - // 判断夹角 - if (Math.abs(area.endAngle - area.startAngle) >= 360) { - // 大于360度的扇形,在环内就为true - return true; - } - - var angle = (360 - - Math.atan2(y - area.y, x - area.x) / Math.PI - * 180) - % 360; - var endA = (360 + area.endAngle) % 360; - var startA = (360 + area.startAngle) % 360; - if (endA > startA) { - return (angle >= startA && angle <= endA); - } - - return !(angle >= endA && angle <= startA); - } - - /** - * 多边形包含判断 - * 警告:下面这段代码会很难看,建议跳过~ - */ - function _isInsidePolygon(area, x, y) { - /** - * 射线判别法 - * 如果一个点在多边形内部,任意角度做射线肯定会与多边形要么有一个交点,要么有与多边形边界线重叠 - * 如果一个点在多边形外部,任意角度做射线要么与多边形有一个交点, - * 要么有两个交点,要么没有交点,要么有与多边形边界线重叠。 - */ - var i; - var j; - var polygon = area.pointList; - var N = polygon.length; - var inside = false; - var redo = true; - var v; - - for (i = 0; i < N; ++i) { - // 是否在顶点上 - if (polygon[i][0] == x && polygon[i][1] == y ) { - redo = false; - inside = true; - break; - } - } - - if (redo) { - redo = false; - inside = false; - for (i = 0,j = N - 1; i < N; j = i++) { - if ((polygon[i][1] < y && y < polygon[j][1]) - || (polygon[j][1] < y && y < polygon[i][1]) - ) { - if (x <= polygon[i][0] || x <= polygon[j][0]) { - v = (y - polygon[i][1]) - * (polygon[j][0] - polygon[i][0]) - / (polygon[j][1] - polygon[i][1]) - + polygon[i][0]; - if (x < v) { // 在线的左侧 - inside = !inside; - } - else if (x == v) { // 在线上 - inside = true; - break; - } - } - } - else if (y == polygon[i][1]) { - if (x < polygon[i][0]) { // 交点在顶点上 - polygon[i][1] > polygon[j][1] ? --y : ++y; - //redo = true; - break; - } - } - else if (polygon[i][1] == polygon[j][1] // 在水平的边界线上 - && y == polygon[i][1] - && ((polygon[i][0] < x && x < polygon[j][0]) - || (polygon[j][0] < x && x < polygon[i][0])) - ) { - inside = true; - break; - } - } - } - return inside; - } - - /** - * 路径包含判断,依赖多边形判断 - */ - function _isInsidePath(area, x, y) { - if (!area.pointList) { - require('../shape/Path').prototype.buildPath(_ctx, area); - } - var pointList = area.pointList; - var insideCatch = false; - for (var i = 0, l = pointList.length; i < l; i++) { - insideCatch = _isInsidePolygon( - { pointList : pointList[i] }, x, y - ); - - if (insideCatch) { - break; - } - } - - return insideCatch; - } - - /** - * 测算多行文本宽度 - * @param {Object} text - * @param {Object} textFont - */ - function getTextWidth(text, textFont) { - var key = text+':'+textFont; - if (_textWidthCache[key]) { - return _textWidthCache[key]; - } - _ctx = _ctx || util.getContext(); - _ctx.save(); - - if (textFont) { - _ctx.font = textFont; - } - - text = (text + '').split('\n'); - var width = 0; - for (var i = 0, l = text.length; i < l; i++) { - width = Math.max( - _ctx.measureText(text[i]).width, - width - ); - } - _ctx.restore(); - - _textWidthCache[key] = width; - if (++_textWidthCacheCounter > TEXT_CACHE_MAX) { - // 内存释放 - _textWidthCacheCounter = 0; - _textWidthCache = {}; - } - - return width; - } - - /** - * 测算多行文本高度 - * @param {Object} text - * @param {Object} textFont - */ - function getTextHeight(text, textFont) { - var key = text+':'+textFont; - if (_textHeightCache[key]) { - return _textHeightCache[key]; - } - - _ctx = _ctx || util.getContext(); - - _ctx.save(); - if (textFont) { - _ctx.font = textFont; - } - - text = (text + '').split('\n'); - //比较粗暴 - var height = (_ctx.measureText('国').width + 2) * text.length; - - _ctx.restore(); - - _textHeightCache[key] = height; - if (++_textHeightCacheCounter > TEXT_CACHE_MAX) { - // 内存释放 - _textHeightCacheCounter = 0; - _textHeightCache = {}; - } - return height; - } - - return { - isInside : isInside, - isOutside : isOutside, - getTextWidth : getTextWidth, - getTextHeight : getTextHeight - }; - } -); +/** + * zrender: 图形空间辅助类 + * + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + * pissang (https://www.github.com/pissang) + * + * isInside:是否在区域内部 + * isOutside:是否在区域外部 + * getTextWidth:测算单行文本宽度 + */ +define( + function (require) { + + 'use strict'; + + var util = require('./util'); + var curve = require('./curve'); + + var _ctx; + + var _textWidthCache = {}; + var _textHeightCache = {}; + var _textWidthCacheCounter = 0; + var _textHeightCacheCounter = 0; + var TEXT_CACHE_MAX = 5000; + + var PI2 = Math.PI * 2; + + function normalizeRadian(angle) { + angle %= PI2; + if (angle < 0) { + angle += PI2; + } + return angle; + } + /** + * 包含判断 + * + * @param {Object} shape : 图形 + * @param {Object} area : 目标区域 + * @param {number} x : 横坐标 + * @param {number} y : 纵坐标 + */ + function isInside(shape, area, x, y) { + if (!area || !shape) { + // 无参数或不支持类型 + return false; + } + var zoneType = shape.type; + + _ctx = _ctx || util.getContext(); + + // 未实现或不可用时(excanvas不支持)则数学运算,主要是line,polyline,ring + var _mathReturn = _mathMethod(shape, area, x, y); + if (typeof _mathReturn != 'undefined') { + return _mathReturn; + } + + if (shape.buildPath && _ctx.isPointInPath) { + return _buildPathMethod(shape, _ctx, area, x, y); + } + + // 上面的方法都行不通时 + switch (zoneType) { + case 'ellipse': // Todo,不精确 + return true; + // 旋轮曲线 不准确 + case 'trochoid': + var _r = area.location == 'out' + ? area.r1 + area.r2 + area.d + : area.r1 - area.r2 + area.d; + return isInsideCircle(area, x, y, _r); + // 玫瑰线 不准确 + case 'rose' : + return isInsideCircle(area, x, y, area.maxr); + // 路径,椭圆,曲线等-----------------13 + default: + return false; // Todo,暂不支持 + } + } + + /** + * 用数学方法判断,三个方法中最快,但是支持的shape少 + * + * @param {Object} shape : 图形 + * @param {Object} area :目标区域 + * @param {number} x : 横坐标 + * @param {number} y : 纵坐标 + * @return {boolean=} true表示坐标处在图形中 + */ + function _mathMethod(shape, area, x, y) { + var zoneType = shape.type; + // 在矩形内则部分图形需要进一步判断 + switch (zoneType) { + // 贝塞尔曲线 + case 'bezier-curve': + if (typeof(area.cpX2) === 'undefined') { + return isInsideQuadraticStroke( + area.xStart, area.yStart, + area.cpX1, area.cpY1, + area.xEnd, area.yEnd, + area.lineWidth, x, y + ); + } + return isInsideCubicStroke( + area.xStart, area.yStart, + area.cpX1, area.cpY1, + area.cpX2, area.cpY2, + area.xEnd, area.yEnd, + area.lineWidth, x, y + ); + // 线 + case 'line': + return isInsideLine( + area.xStart, area.yStart, + area.xEnd, area.yEnd, + area.lineWidth, x, y + ); + // 折线 + case 'polyline': + return isInsidePolyline( + area.pointList, area.lineWidth, x, y + ); + // 圆环 + case 'ring': + return isInsideRing( + area.x, area.y, area.r0, area.r, x, y + ); + // 圆形 + case 'circle': + return isInsideCircle( + area.x, area.y, area.r, x, y + ); + // 扇形 + case 'sector': + var startAngle = area.startAngle * Math.PI / 180; + var endAngle = area.endAngle * Math.PI / 180; + if (!area.clockWise) { + startAngle = -startAngle; + endAngle = -endAngle; + } + return isInsideSector( + area.x, area.y, area.r0, area.r, + startAngle, endAngle, + !area.clockWise, + x, y + ); + // 多边形 + case 'path': + return area.pathArray && isInsidePath( + area.pathArray, Math.max(area.lineWidth, 5), + area.brushType, x, y + ); + case 'polygon': + case 'star': + case 'isogon': + return isInsidePolygon(area.pointList, x, y); + // 文本 + case 'text': + var rect = area.__rect || shape.getRect(area); + return isInsideRect( + rect.x, rect.y, rect.width, rect.height, x, y + ); + // 矩形 + case 'rectangle': + // 图片 + case 'image': + return isInsideRect( + area.x, area.y, area.width, area.height, x, y + ); + } + } + + /** + * 通过buildPath方法来判断,三个方法中较快,但是不支持线条类型的shape, + * 而且excanvas不支持isPointInPath方法 + * + * @param {Object} shape : shape + * @param {Object} context : 上下文 + * @param {Object} area :目标区域 + * @param {number} x : 横坐标 + * @param {number} y : 纵坐标 + * @return {boolean} true表示坐标处在图形中 + */ + function _buildPathMethod(shape, context, area, x, y) { + // 图形类实现路径创建了则用类的path + context.beginPath(); + shape.buildPath(context, area); + context.closePath(); + return context.isPointInPath(x, y); + } + + /** + * !isInside + */ + function isOutside(shape, area, x, y) { + return !isInside(shape, area, x, y); + } + + /** + * 线段包含判断 + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @param {number} lineWidth + * @param {number} x + * @param {number} y + * @return {boolean} + */ + function isInsideLine(x0, y0, x1, y1, lineWidth, x, y) { + if (lineWidth === 0) { + return false; + } + var _l = Math.max(lineWidth, 5); + var _a = 0; + var _b = x0; + // Quick reject + if ( + (y > y0 + _l && y > y1 + _l) + || (y < y0 - _l && y < y1 - _l) + || (x > x0 + _l && x > x1 + _l) + || (x < x0 - _l && x < x1 - _l) + ) { + return false; + } + + if (x0 !== x1) { + _a = (y0 - y1) / (x0 - x1); + _b = (x0 * y1 - x1 * y0) / (x0 - x1) ; + } + else { + return Math.abs(x - x0) <= _l / 2; + } + var tmp = _a * x - y + _b; + var _s = tmp * tmp / (_a * _a + 1); + return _s <= _l / 2 * _l / 2; + } + + /** + * 三次贝塞尔曲线描边包含判断 + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @param {number} x3 + * @param {number} y3 + * @param {number} lineWidth + * @param {number} x + * @param {number} y + * @return {boolean} + */ + function isInsideCubicStroke( + x0, y0, x1, y1, x2, y2, x3, y3, + lineWidth, x, y + ) { + if (lineWidth === 0) { + return false; + } + var _l = Math.max(lineWidth, 5); + // Quick reject + if ( + (y > y0 + _l && y > y1 + _l && y > y2 + _l && y > y3 + _l) + || (y < y0 - _l && y < y1 - _l && y < y2 - _l && y < y3 - _l) + || (x > x0 + _l && x > x1 + _l && x > x2 + _l && x > x3 + _l) + || (x < x0 - _l && x < x1 - _l && x < x2 - _l && x < x3 - _l) + ) { + return false; + } + var d = curve.cubicProjectPoint( + x0, y0, x1, y1, x2, y2, x3, y3, + x, y, null + ); + return d <= _l / 2; + } + + /** + * 二次贝塞尔曲线描边包含判断 + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @param {number} lineWidth + * @param {number} x + * @param {number} y + * @return {boolean} + */ + function isInsideQuadraticStroke( + x0, y0, x1, y1, x2, y2, + lineWidth, x, y + ) { + if (lineWidth === 0) { + return false; + } + var _l = Math.max(lineWidth, 5); + // Quick reject + if ( + (y > y0 + _l && y > y1 + _l && y > y2 + _l) + || (y < y0 - _l && y < y1 - _l && y < y2 - _l) + || (x > x0 + _l && x > x1 + _l && x > x2 + _l) + || (x < x0 - _l && x < x1 - _l && x < x2 - _l) + ) { + return false; + } + var d = curve.quadraticProjectPoint( + x0, y0, x1, y1, x2, y2, + x, y, null + ); + return d <= _l / 2; + } + + /** + * 圆弧描边包含判断 + * @param {number} cx + * @param {number} cy + * @param {number} r + * @param {number} startAngle + * @param {number} endAngle + * @param {boolean} anticlockwise + * @param {number} lineWidth + * @param {number} x + * @param {number} y + * @return {Boolean} + */ + function isInsideArcStroke( + cx, cy, r, startAngle, endAngle, anticlockwise, + lineWidth, x, y + ) { + if (lineWidth === 0) { + return false; + } + var _l = Math.max(lineWidth, 5); + + x -= cx; + y -= cy; + var d = Math.sqrt(x * x + y * y); + if ((d - _l > r) || (d + _l < r)) { + return false; + } + if (Math.abs(startAngle - endAngle) >= PI2) { + // Is a circle + return true; + } + if (anticlockwise) { + var tmp = startAngle; + startAngle = normalizeRadian(endAngle); + endAngle = normalizeRadian(tmp); + } else { + startAngle = normalizeRadian(startAngle); + endAngle = normalizeRadian(endAngle); + } + if (startAngle > endAngle) { + endAngle += PI2; + } + + var angle = Math.atan2(y, x); + if (angle < 0) { + angle += PI2; + } + return (angle >= startAngle && angle <= endAngle) + || (angle + PI2 >= startAngle && angle + PI2 <= endAngle); + } + + function isInsidePolyline(points, lineWidth, x, y) { + var lineWidth = Math.max(lineWidth, 10); + for (var i = 0, l = points.length - 1; i < l; i++) { + var x0 = points[i][0]; + var y0 = points[i][1]; + var x1 = points[i + 1][0]; + var y1 = points[i + 1][1]; + + if (isInsideLine(x0, y0, x1, y1, lineWidth, x, y)) { + return true; + } + } + + return false; + } + + function isInsideRing(cx, cy, r0, r, x, y) { + var d = (x - cx) * (x - cx) + (y - cy) * (y - cy); + return (d < r * r) && (d > r0 * r0); + } + + /** + * 矩形包含判断 + */ + function isInsideRect(x0, y0, width, height, x, y) { + return x >= x0 && x <= (x0 + width) + && y >= y0 && y <= (y0 + height); + } + + /** + * 圆形包含判断 + */ + function isInsideCircle(x0, y0, r, x, y) { + return (x - x0) * (x - x0) + (y - y0) * (y - y0) + < r * r; + } + + /** + * 扇形包含判断 + */ + function isInsideSector( + cx, cy, r0, r, startAngle, endAngle, anticlockwise, x, y + ) { + return isInsideArcStroke( + cx, cy, (r0 + r) / 2, startAngle, endAngle, anticlockwise, + r - r0, x, y + ); + } + + /** + * 多边形包含判断 + * 与 canvas 一样采用 non-zero winding rule + */ + function isInsidePolygon(points, x, y) { + var N = points.length; + var w = 0; + + for (var i = 0, j = N - 1; i < N; i++) { + var x0 = points[j][0]; + var y0 = points[j][1]; + var x1 = points[i][0]; + var y1 = points[i][1]; + w += windingLine(x0, y0, x1, y1, x, y); + j = i; + } + return w !== 0; + } + + function windingLine(x0, y0, x1, y1, x, y) { + if ((y > y0 && y > y1) || (y < y0 && y < y1)) { + return 0; + } + if (y1 == y0) { + return 0; + } + var dir = y1 < y0 ? 1 : -1; + var t = (y - y0) / (y1 - y0); + var x_ = t * (x1 - x0) + x0; + + return x_ > x ? dir : 0; + } + + // 临时数组 + var roots = [-1, -1, -1]; + var extrema = [-1, -1]; + + function swapExtrema() { + var tmp = extrema[0]; + extrema[0] = extrema[1]; + extrema[1] = tmp; + } + function windingCubic(x0, y0, x1, y1, x2, y2, x3, y3, x, y) { + // Quick reject + if ( + (y > y0 && y > y1 && y > y2 && y > y3) + || (y < y0 && y < y1 && y < y2 && y < y3) + ) { + return 0; + } + var nRoots = curve.cubicRootAt(y0, y1, y2, y3, y, roots); + if (nRoots === 0) { + return 0; + } + else { + var w = 0; + var nExtrema = -1; + var y0_, y1_; + for (var i = 0; i < nRoots; i++) { + var t = roots[i]; + var x_ = curve.cubicAt(x0, x1, x2, x3, t); + if (x_ < x) { // Quick reject + continue; + } + if (nExtrema < 0) { + nExtrema = curve.cubicExtrema(y0, y1, y2, y3, extrema); + if (extrema[1] < extrema[0] && nExtrema > 1) { + swapExtrema(); + } + y0_ = curve.cubicAt(y0, y1, y2, y3, extrema[0]); + if (nExtrema > 1) { + y1_ = curve.cubicAt(y0, y1, y2, y3, extrema[1]); + } + } + if (nExtrema == 2) { + // 分成三段单调函数 + if (t < extrema[0]) { + w += y0_ < y0 ? 1 : -1; + } + else if (t < extrema[1]) { + w += y1_ < y0_ ? 1 : -1; + } + else { + w += y3 < y1_ ? 1 : -1; + } + } + else { + // 分成两段单调函数 + if (t < extrema[0]) { + w += y0_ < y0 ? 1 : -1; + } + else { + w += y3 < y0_ ? 1 : -1; + } + } + } + return w; + } + } + + function windingQuadratic(x0, y0, x1, y1, x2, y2, x, y) { + // Quick reject + if ( + (y > y0 && y > y1 && y > y2) + || (y < y0 && y < y1 && y < y2) + ) { + return 0; + } + var nRoots = curve.quadraticRootAt(y0, y1, y2, y, roots); + if (nRoots === 0) { + return 0; + } + else { + var t = curve.quadraticExtremum(y0, y1, y2); + if (t >=0 && t <= 1) { + var w = 0; + var y_ = curve.quadraticAt(y0, y1, y2, t); + for (var i = 0; i < nRoots; i++) { + var x_ = curve.quadraticAt(x0, x1, x2, roots[i]); + if (x_ > x) { + continue; + } + if (roots[i] < t) { + w += y_ < y0 ? 1 : -1; + } + else { + w += y2 < y_ ? 1 : -1; + } + } + return w; + } + else { + var x_ = curve.quadraticAt(x0, x1, x2, roots[0]); + if (x_ > x) { + return 0; + } + return y2 < y0 ? 1 : -1; + } + } + } + + // TODO + // Arc 旋转 + function windingArc( + cx, cy, r, startAngle, endAngle, anticlockwise, x, y + ) { + y -= cy; + if (y > r || y < -r) { + return 0; + } + var tmp = Math.sqrt(r * r - y * y); + roots[0] = -tmp; + roots[1] = tmp; + + if (Math.abs(startAngle - endAngle) >= PI2) { + // Is a circle + startAngle = 0; + endAngle = PI2; + var dir = anticlockwise ? 1 : -1; + if (x >= roots[0] + cx && x <= roots[1] + cx) { + return dir; + } else { + return 0; + } + } + + if (anticlockwise) { + var tmp = startAngle; + startAngle = normalizeRadian(endAngle); + endAngle = normalizeRadian(tmp); + } else { + startAngle = normalizeRadian(startAngle); + endAngle = normalizeRadian(endAngle); + } + if (startAngle > endAngle) { + endAngle += PI2; + } + + var w = 0; + for (var i = 0; i < 2; i++) { + var x_ = roots[i]; + if (x_ + cx > x) { + var angle = Math.atan2(y, x_); + var dir = anticlockwise ? 1 : -1; + if (angle < 0) { + angle = PI2 + angle; + } + if ( + (angle >= startAngle && angle <= endAngle) + || (angle + PI2 >= startAngle && angle + PI2 <= endAngle) + ) { + if (angle > Math.PI / 2 && angle < Math.PI * 1.5) { + dir = -dir; + } + w += dir; + } + } + } + return w; + } + + /** + * 路径包含判断 + * 与 canvas 一样采用 non-zero winding rule + */ + function isInsidePath(pathArray, lineWidth, brushType, x, y) { + var w = 0; + var xi = 0; + var yi = 0; + var x0 = 0; + var y0 = 0; + var beginSubpath = true; + var firstCmd = true; + + brushType = brushType || 'fill'; + + var hasStroke = brushType === 'stroke' || brushType === 'both'; + var hasFill = brushType === 'fill' || brushType === 'both'; + + // var roots = [-1, -1, -1]; + for (var i = 0; i < pathArray.length; i++) { + var seg = pathArray[i]; + var p = seg.points; + // Begin a new subpath + if (beginSubpath || seg.command === 'M') { + if (i > 0) { + // Close previous subpath + if (hasFill) { + w += windingLine(xi, yi, x0, y0, x, y); + } + if (w !== 0) { + return true; + } + } + x0 = p[p.length - 2]; + y0 = p[p.length - 1]; + beginSubpath = false; + if (firstCmd && seg.command !== 'A') { + // 如果第一个命令不是M, 是lineTo, bezierCurveTo + // 等绘制命令的话,是会从该绘制的起点开始算的 + // Arc 会在之后做单独处理所以这里忽略 + firstCmd = false; + xi = x0; + yi = y0; + } + } + switch (seg.command) { + case 'M': + xi = p[0]; + yi = p[1]; + break; + case 'L': + if (hasStroke) { + if (isInsideLine( + xi, yi, p[0], p[1], lineWidth, x, y + )) { + return true; + } + } + if (hasFill) { + w += windingLine(xi, yi, p[0], p[1], x, y); + } + xi = p[0]; + yi = p[1]; + break; + case 'C': + if (hasStroke) { + if (isInsideCubicStroke( + xi, yi, p[0], p[1], p[2], p[3], p[4], p[5], + lineWidth, x, y + )) { + return true; + } + } + if (hasFill) { + w += windingCubic( + xi, yi, p[0], p[1], p[2], p[3], p[4], p[5], x, y + ); + } + xi = p[4]; + yi = p[5]; + break; + case 'Q': + if (hasStroke) { + if (isInsideQuadraticStroke( + xi, yi, p[0], p[1], p[2], p[3], + lineWidth, x, y + )) { + return true; + } + } + if (hasFill) { + w += windingQuadratic( + xi, yi, p[0], p[1], p[2], p[3], x, y + ); + } + xi = p[2]; + yi = p[3]; + break; + case 'A': + // TODO Arc 旋转 + // TODO Arc 判断的开销比较大 + var cx = p[0]; + var cy = p[1]; + var rx = p[2]; + var ry = p[3]; + var theta = p[4]; + var dTheta = p[5]; + var x1 = Math.cos(theta) * rx + cx; + var y1 = Math.sin(theta) * ry + cy; + // 不是直接使用 arc 命令 + if (!firstCmd) { + w += windingLine(xi, yi, x1, y1); + } else { + firstCmd = false; + // 第一个命令起点还未定义 + x0 = x1; + y0 = y1; + } + // zr 使用scale来模拟椭圆, 这里也对x做一定的缩放 + var _x = (x - cx) * ry / rx + cx; + if (hasStroke) { + if (isInsideArcStroke( + cx, cy, ry, theta, theta + dTheta, 1 - p[7], + lineWidth, _x, y + )) { + return true; + } + } + if (hasFill) { + w += windingArc( + cx, cy, ry, theta, theta + dTheta, 1 - p[7], + _x, y + ); + } + xi = Math.cos(theta + dTheta) * rx + cx; + yi = Math.sin(theta + dTheta) * ry + cy; + break; + case 'z': + if (hasStroke) { + if (isInsideLine( + xi, yi, x0, y0, lineWidth, x, y + )) { + return true; + } + } + beginSubpath = true; + break; + } + } + if (hasFill) { + w += windingLine(xi, yi, x0, y0, x, y); + } + return w !== 0; + } + + /** + * 测算多行文本宽度 + * @param {Object} text + * @param {Object} textFont + */ + function getTextWidth(text, textFont) { + var key = text + ':' + textFont; + if (_textWidthCache[key]) { + return _textWidthCache[key]; + } + _ctx = _ctx || util.getContext(); + _ctx.save(); + + if (textFont) { + _ctx.font = textFont; + } + + text = (text + '').split('\n'); + var width = 0; + for (var i = 0, l = text.length; i < l; i++) { + width = Math.max( + _ctx.measureText(text[i]).width, + width + ); + } + _ctx.restore(); + + _textWidthCache[key] = width; + if (++_textWidthCacheCounter > TEXT_CACHE_MAX) { + // 内存释放 + _textWidthCacheCounter = 0; + _textWidthCache = {}; + } + + return width; + } + + /** + * 测算多行文本高度 + * @param {Object} text + * @param {Object} textFont + */ + function getTextHeight(text, textFont) { + var key = text + ':' + textFont; + if (_textHeightCache[key]) { + return _textHeightCache[key]; + } + + _ctx = _ctx || util.getContext(); + + _ctx.save(); + if (textFont) { + _ctx.font = textFont; + } + + text = (text + '').split('\n'); + // 比较粗暴 + var height = (_ctx.measureText('国').width + 2) * text.length; + + _ctx.restore(); + + _textHeightCache[key] = height; + if (++_textHeightCacheCounter > TEXT_CACHE_MAX) { + // 内存释放 + _textHeightCacheCounter = 0; + _textHeightCache = {}; + } + return height; + } + + return { + isInside : isInside, + isOutside : isOutside, + getTextWidth : getTextWidth, + getTextHeight : getTextHeight, + + isInsidePath: isInsidePath, + isInsidePolygon: isInsidePolygon, + isInsideSector: isInsideSector, + isInsideCircle: isInsideCircle, + isInsideLine: isInsideLine, + isInsideRect: isInsideRect, + isInsidePolyline: isInsidePolyline, + + isInsideCubicStroke: isInsideCubicStroke, + isInsideQuadraticStroke: isInsideQuadraticStroke + }; + } +); diff --git a/amd/zrender/tool/color.js b/amd/zrender/tool/color.js index d5e8a93..498631d 100644 --- a/amd/zrender/tool/color.js +++ b/amd/zrender/tool/color.js @@ -1,1051 +1,1074 @@ -/** - * zrender : 颜色辅助类 - * - * author: CrossDo (chenhuaimu@baidu.com) - * - * getColor:获取色板颜色 - * customPalette : 自定义调色板 - * resetPalette : 重置调色板 - * - * getHighlightColor : 获取默认高亮颜色 - * customHighlight : 自定义默认高亮颜色 - * resetHighlight : 重置默认高亮颜色 - * - * getRadialGradient : 径向渐变 - * getLinearGradient : 线性渐变 - * getGradientColors : 获取颜色之间渐变颜色数组 - * getStepColors : 获取两种颜色之间渐变颜色数组 - * reverse : 颜色翻转 - * mix : 颜色混合 - * lift : 颜色升降 - * trim : 清除空格 - * random : 随机颜色 - * toRGB : 转为RGB格式 - * toRGBA : 转为RGBA格式 - * toHex : 转为#RRGGBB格式 - * toHSL : 转为HSL格式 - * toHSLA : 转为HSLA格式 - * toHSB : 转为HSB格式 - * toHSBA : 转为HSBA格式 - * toHSV : 转为HSV格式 - * toHSVA : 转为HSVA格式 - * toName : 转为颜色名字 - * toColor: 颜色值数组转为指定格式颜色 - * toArray: 返回颜色值数组 - * alpha : 设置颜色的透明度 - **/ -define( function(require) { - var util = require('../tool/util'); - - var _ctx; - - // Color palette is an array containing the default colors for the chart's - // series. - // When all colors are used, new colors are selected from the start again. - // Defaults to: - // 默认色板 - var palette = [ - '#ff9277', ' #dddd00', ' #ffc877', ' #bbe3ff', ' #d5ffbb', - '#bbbbff', ' #ddb000', ' #b0dd00', ' #e2bbff', ' #ffbbe3', - '#ff7777', ' #ff9900', ' #83dd00', ' #77e3ff', ' #778fff', - '#c877ff', ' #ff77ab', ' #ff6600', ' #aa8800', ' #77c7ff', - '#ad77ff', ' #ff77ff', ' #dd0083', ' #777700', ' #00aa00', - '#0088aa', ' #8400dd', ' #aa0088', ' #dd0000', ' #772e00' - ]; - var _palette = palette; - - var highlightColor = 'rgba(255,255,0,0.5)'; - var _highlightColor = highlightColor; - - // 颜色格式 - /*jshint maxlen: 330 */ - var colorRegExp = /^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i; - - var _nameColors = { - aliceblue : '#f0f8ff', - antiquewhite : '#faebd7', - aqua : '#0ff', - aquamarine : '#7fffd4', - azure : '#f0ffff', - beige : '#f5f5dc', - bisque : '#ffe4c4', - black : '#000', - blanchedalmond : '#ffebcd', - blue : '#00f', - blueviolet : '#8a2be2', - brown : '#a52a2a', - burlywood : '#deb887', - cadetblue : '#5f9ea0', - chartreuse : '#7fff00', - chocolate : '#d2691e', - coral : '#ff7f50', - cornflowerblue : '#6495ed', - cornsilk : '#fff8dc', - crimson : '#dc143c', - cyan : '#0ff', - darkblue : '#00008b', - darkcyan : '#008b8b', - darkgoldenrod : '#b8860b', - darkgray : '#a9a9a9', - darkgrey : '#a9a9a9', - darkgreen : '#006400', - darkkhaki : '#bdb76b', - darkmagenta : '#8b008b', - darkolivegreen : '#556b2f', - darkorange : '#ff8c00', - darkorchid : '#9932cc', - darkred : '#8b0000', - darksalmon : '#e9967a', - darkseagreen : '#8fbc8f', - darkslateblue : '#483d8b', - darkslategray : '#2f4f4f', - darkslategrey : '#2f4f4f', - darkturquoise : '#00ced1', - darkviolet : '#9400d3', - deeppink : '#ff1493', - deepskyblue : '#00bfff', - dimgray : '#696969', - dimgrey : '#696969', - dodgerblue : '#1e90ff', - firebrick : '#b22222', - floralwhite : '#fffaf0', - forestgreen : '#228b22', - fuchsia : '#f0f', - gainsboro : '#dcdcdc', - ghostwhite : '#f8f8ff', - gold : '#ffd700', - goldenrod : '#daa520', - gray : '#808080', - grey : '#808080', - green : '#008000', - greenyellow : '#adff2f', - honeydew : '#f0fff0', - hotpink : '#ff69b4', - indianred : '#cd5c5c', - indigo : '#4b0082', - ivory : '#fffff0', - khaki : '#f0e68c', - lavender : '#e6e6fa', - lavenderblush : '#fff0f5', - lawngreen : '#7cfc00', - lemonchiffon : '#fffacd', - lightblue : '#add8e6', - lightcoral : '#f08080', - lightcyan : '#e0ffff', - lightgoldenrodyellow : '#fafad2', - lightgray : '#d3d3d3', - lightgrey : '#d3d3d3', - lightgreen : '#90ee90', - lightpink : '#ffb6c1', - lightsalmon : '#ffa07a', - lightseagreen : '#20b2aa', - lightskyblue : '#87cefa', - lightslategray : '#789', - lightslategrey : '#789', - lightsteelblue : '#b0c4de', - lightyellow : '#ffffe0', - lime : '#0f0', - limegreen : '#32cd32', - linen : '#faf0e6', - magenta : '#f0f', - maroon : '#800000', - mediumaquamarine : '#66cdaa', - mediumblue : '#0000cd', - mediumorchid : '#ba55d3', - mediumpurple : '#9370d8', - mediumseagreen : '#3cb371', - mediumslateblue : '#7b68ee', - mediumspringgreen : '#00fa9a', - mediumturquoise : '#48d1cc', - mediumvioletred : '#c71585', - midnightblue : '#191970', - mintcream : '#f5fffa', - mistyrose : '#ffe4e1', - moccasin : '#ffe4b5', - navajowhite : '#ffdead', - navy : '#000080', - oldlace : '#fdf5e6', - olive : '#808000', - olivedrab : '#6b8e23', - orange : '#ffa500', - orangered : '#ff4500', - orchid : '#da70d6', - palegoldenrod : '#eee8aa', - palegreen : '#98fb98', - paleturquoise : '#afeeee', - palevioletred : '#d87093', - papayawhip : '#ffefd5', - peachpuff : '#ffdab9', - peru : '#cd853f', - pink : '#ffc0cb', - plum : '#dda0dd', - powderblue : '#b0e0e6', - purple : '#800080', - red : '#f00', - rosybrown : '#bc8f8f', - royalblue : '#4169e1', - saddlebrown : '#8b4513', - salmon : '#fa8072', - sandybrown : '#f4a460', - seagreen : '#2e8b57', - seashell : '#fff5ee', - sienna : '#a0522d', - silver : '#c0c0c0', - skyblue : '#87ceeb', - slateblue : '#6a5acd', - slategray : '#708090', - slategrey : '#708090', - snow : '#fffafa', - springgreen : '#00ff7f', - steelblue : '#4682b4', - tan : '#d2b48c', - teal : '#008080', - thistle : '#d8bfd8', - tomato : '#ff6347', - turquoise : '#40e0d0', - violet : '#ee82ee', - wheat : '#f5deb3', - white : '#fff', - whitesmoke : '#f5f5f5', - yellow : '#ff0', - yellowgreen : '#9acd32' - }; - - /** - * 自定义调色板 - */ - function customPalette(userPalete) { - palette = userPalete; - } - - /** - * 复位默认色板 - */ - function resetPalette() { - palette = _palette; - } - - /** - * 获取色板颜色 - * - * @param {number} idx : 色板位置 - * @param {array} [userPalete] : 自定义色板 - * - * @return {color} 颜色#000000~#ffffff - */ - function getColor(idx, userPalete) { - idx = idx | 0; - userPalete = userPalete || palette; - return userPalete[idx % userPalete.length]; - } - - /** - * 自定义默认高亮颜色 - */ - function customHighlight(userHighlightColor) { - highlightColor = userHighlightColor; - } - - /** - * 重置默认高亮颜色 - */ - function resetHighlight() { - _highlightColor = highlightColor; - } - - /** - * 获取默认高亮颜色 - */ - function getHighlightColor() { - return highlightColor; - } - - /** - * 径向渐变 - * - * @param {number} x0 渐变起点 - * @param {number} y0 - * @param {number} r0 - * @param {number} x1 渐变终点 - * @param {number} y1 - * @param {number} r1 - * @param {Array} colorList 颜色列表 - */ - function getRadialGradient(x0, y0, r0, x1, y1, r1, colorList) { - if (!_ctx) { - _ctx = util.getContext(); - } - var gradient = _ctx.createRadialGradient(x0, y0, r0, x1, y1, r1); - for ( var i = 0, l = colorList.length; i < l; i++) { - gradient.addColorStop(colorList[i][0], colorList[i][1]); - } - gradient.__nonRecursion = true; - return gradient; - } - - /** - * 线性渐变 - * @param {Object} x0 渐变起点 - * @param {Object} y0 - * @param {Object} x1 渐变终点 - * @param {Object} y1 - * @param {Array} colorList 颜色列表 - */ - function getLinearGradient(x0, y0, x1, y1, colorList) { - if (!_ctx) { - _ctx = util.getContext(); - } - var gradient = _ctx.createLinearGradient(x0, y0, x1, y1); - for ( var i = 0, l = colorList.length; i < l; i++) { - gradient.addColorStop(colorList[i][0], colorList[i][1]); - } - gradient.__nonRecursion = true; - return gradient; - } - - /** - * 获取两种颜色之间渐变颜色数组 - * @param {color} start 起始颜色 - * @param {color} end 结束颜色 - * @param {number} step 渐变级数 - * @return {Array} 颜色数组 - */ - function getStepColors(start, end, step) { - start = toRGBA(start); - end = toRGBA(end); - start = getData(start); - end = getData(end); - - var colors = []; - var stepR = (end[0] - start[0]) / step; - var stepG = (end[1] - start[1]) / step; - var stepB = (end[2] - start[2]) / step; - // 生成颜色集合 - // fix by linfeng 颜色堆积 - for (var i = 0, r = start[0], g = start[1], b = start[2]; i < step; i++ - ) { - colors[i] = toColor([ - adjust(Math.floor(r), [0, 255]), - adjust(Math.floor(g), [0, 255]), - adjust(Math.floor(b), [0, 255]) - ]); - r += stepR; - g += stepG; - b += stepB; - } - r = end[0]; - g = end[1]; - b = end[2]; - colors[i] = toColor([r, g, b]); - return colors; - } - - /** - * 获取指定级数的渐变颜色数组 - * @param {Array} colors 颜色组 - * @param {number=20} step 渐变级数 - * @return {Array} 颜色数组 - */ - function getGradientColors(colors, step) { - var ret = []; - var len = colors.length; - if (step === undefined) { - step = 20; - } - if (len === 1) { - ret = getStepColors(colors[0], colors[0], step); - } else if (len > 1) { - for ( var i = 0, n = len - 1; i < n; i++) { - var steps = getStepColors(colors[i], colors[i + 1], step); - if (i < n - 1) { - steps.pop(); - } - ret = ret.concat(steps); - } - } - return ret; - } - - /** - * 颜色值数组转为指定格式颜色,例如:
- * data = [60,20,20,0.1] format = 'rgba' - * 返回:rgba(60,20,20,0.1) - * @param {Array} data 颜色值数组 - * @param {string} format 格式,默认rgb - * @return {string} 颜色 - */ - function toColor(data, format) { - format = format || 'rgb'; - if (data && (data.length === 3 || data.length === 4)) { - data = map(data, - function(c) { - return c > 1 ? Math.ceil(c) : c; - }); - - if (format.indexOf('hex') > -1) { - return '#' + ((1 << 24) + (data[0] << 16) + (data[1] << 8) + (+data[2])).toString(16).slice(1); - } else if (format.indexOf('hs') > -1) { - var sx = map(data.slice(1, 3), - function(c) { - return c + '%'; - }); - data[1] = sx[0]; - data[2] = sx[1]; - } - - if (format.indexOf('a') > -1) { - if (data.length === 3) { - data.push(1); - } - data[3] = adjust(data[3], [0, 1]); - return format + '(' + data.slice(0, 4).join(',') + ')'; - } - - return format + '(' + data.slice(0, 3).join(',') + ')'; - } - } - - /** - * 返回颜色值数组 - * - * @param {color} color 颜色 - * @return {Array} 颜色值数组 - */ - function toArray(color) { - color = trim(color); - if (color.indexOf('rgba') < 0) { - color = toRGBA(color); - } - - var data = []; - var i = 0; - color.replace(/[\d.]+/g, function (n) { - if (i < 3) { - n = n | 0; - } else { - // Alpha - n = +n; - } - data[i++] = n; - }); - return data; - } - - /** - * 颜色格式转化 - * - * @param {Array} data 颜色值数组 - * @param {string} format 格式,默认rgb - * @return {string} 颜色 - */ - function convert(color, format) { - var data = getData(color); - var alpha = data[3]; - if(typeof alpha === 'undefined') { - alpha = 1; - } - - if (color.indexOf('hsb') > -1) { - data = _HSV_2_RGB(data); - } else if (color.indexOf('hsl') > -1) { - data = _HSL_2_RGB(data); - } - - if (format.indexOf('hsb') > -1 || format.indexOf('hsv') > -1) { - data = _RGB_2_HSB(data); - } else if (format.indexOf('hsl') > -1) { - data = _RGB_2_HSL(data); - } - - data[3] = alpha; - - return toColor(data, format); - } - - /** - * 转换为rgba格式的颜色 - * - * @param {string} color 颜色 - * @return {string} rgba颜色,rgba(r,g,b,a) - */ - function toRGBA(color) { - return convert(color, 'rgba'); - } - - /** - * 转换为rgb数字格式的颜色 - * - * @param {string} color 颜色 - * @return {string} rgb颜色,rgb(0,0,0)格式 - */ - function toRGB(color) { - return convert(color, 'rgb'); - } - - /** - * 转换为16进制颜色 - * - * @param {string} color 颜色 - * @return {string} 16进制颜色,#rrggbb格式 - */ - function toHex(color) { - return convert(color, 'hex'); - } - - /** - * 转换为HSV颜色 - * - * @param {string} color 颜色 - * @return {string} HSVA颜色,hsva(h,s,v,a) - */ - function toHSVA(color) { - return convert(color, 'hsva'); - } - - /** - * 转换为HSV颜色 - * - * @param {string} color 颜色 - * @return {string} HSV颜色,hsv(h,s,v) - */ - function toHSV(color) { - return convert(color, 'hsv'); - } - - /** - * 转换为HSBA颜色 - * - * @param {string} color 颜色 - * @return {string} HSBA颜色,hsba(h,s,b,a) - */ - function toHSBA(color) { - return convert(color, 'hsba'); - } - - /** - * 转换为HSB颜色 - * - * @param {string} color 颜色 - * @return {string} HSB颜色,hsb(h,s,b) - */ - function toHSB(color) { - return convert(color, 'hsb'); - } - - /** - * 转换为HSLA颜色 - * - * @param {string} color 颜色 - * @return {string} HSLA颜色,hsla(h,s,l,a) - */ - function toHSLA(color) { - return convert(color, 'hsla'); - } - - /** - * 转换为HSL颜色 - * - * @param {string} color 颜色 - * @return {string} HSL颜色,hsl(h,s,l) - */ - function toHSL(color) { - return convert(color, 'hsl'); - } - - /** - * 转换颜色名 - * - * @param {string} color 颜色 - * @return {string} 颜色名 - */ - function toName(color) { - for ( var key in _nameColors) { - if (toHex(_nameColors[key]) === toHex(color)) { - return key; - } - } - return null; - } - - /** - * 移除颜色中多余空格 - * - * @param {string} color 颜色 - * @return {string} 无空格颜色 - */ - function trim(color) { - return String(color).replace(/\s+/g, ''); - } - - /** - * 颜色规范化 - * - * @param {string} color 颜色 - * @return {string} 规范化后的颜色 - */ - function normalize(color) { - // 颜色名 - if (_nameColors[color]) { - color = _nameColors[color]; - } - // 去掉空格 - color = trim(color); - // hsv与hsb等价 - color = color.replace(/hsv/i, 'hsb'); - // rgb转为rrggbb - if (/^#[\da-f]{3}$/i.test(color)) { - color = parseInt(color.slice(1), 16); - var r = (color & 0xf00) << 8; - var g = (color & 0xf0) << 4; - var b = color & 0xf; - - color = '#'+ ((1 << 24) + (r << 4) + r + (g << 4) + g + (b << 4) + b).toString(16).slice(1); - } - // 或者使用以下正则替换,不过 chrome 下性能相对差点 - // color = color.replace(/^#([\da-f])([\da-f])([\da-f])$/i, '#$1$1$2$2$3$3'); - return color; - } - - /** - * 颜色加深或减淡,当level>0加深,当level<0减淡 - * - * @param {string} color 颜色 - * @param {number} level 升降程度,取值区间[-1,1] - * @return {string} 加深或减淡后颜色值 - */ - function lift(color, level) { - var direct = level > 0 ? 1 : -1; - if (typeof level === 'undefined') { - level = 0; - } - level = Math.abs(level) > 1 ? 1 : Math.abs(level); - color = toRGB(color); - var data = getData(color); - for ( var i = 0; i < 3; i++) { - if (direct === 1) { - data[i] = data[i] * (1 - level) | 0; - } else { - data[i] = ((255 - data[i]) * level + data[i]) | 0; - } - } - return 'rgb(' + data.join(',') + ')'; - } - - /** - * 颜色翻转,[255-r,255-g,255-b,1-a] - * - * @param {string} color 颜色 - * @return {string} 翻转颜色 - */ - function reverse(color) { - var data = getData(toRGBA(color)); - data = map(data, - function(c) { - return 255 - c; - }); - return toColor(data, 'rgb'); - } - - /** - * 简单两种颜色混合 - * - * @param {string} color1 第一种颜色 - * @param {string} color2 第二种颜色 - * @param {string} weight 混合权重[0-1] - * @return {string} 结果色,rgb(r,g,b)或rgba(r,g,b,a) - */ - function mix(color1, color2, weight) { - if(typeof weight === 'undefined') { - weight = 0.5; - } - weight = 1 - adjust(weight, [0, 1]); - - var w = weight * 2 - 1; - var data1 = getData(toRGBA(color1)); - var data2 = getData(toRGBA(color2)); - - var d = data1[3] - data2[3]; - - var weight1 = (((w * d === -1) ? w : (w + d) / (1 + w * d)) + 1) / 2; - var weight2 = 1 - weight1; - - var data = []; - - for ( var i = 0; i < 3; i++) { - data[i] = data1[i] * weight1 + data2[i] * weight2; - } - - var alpha = data1[3] * weight + data2[3] * (1 - weight); - alpha = Math.max(0, Math.min(1, alpha)); - - if (data1[3] === 1 && data2[3] === 1) {// 不考虑透明度 - return toColor(data, 'rgb'); - } - data[3] = alpha; - return toColor(data, 'rgba'); - } - - /** - * 随机颜色 - * - * @return {string} 颜色值,#rrggbb格式 - */ - function random() { - return '#' + Math.random().toString(16).slice(2, 8); - } - - /** - * 获取颜色值数组,返回值范围:
- * RGB 范围[0-255]
- * HSL/HSV/HSB 范围[0-1]
- * A透明度范围[0-1] - * 支持格式: - * #rgb - * #rrggbb - * rgb(r,g,b) - * rgb(r%,g%,b%) - * rgba(r,g,b,a) - * hsb(h,s,b) // hsv与hsb等价 - * hsb(h%,s%,b%) - * hsba(h,s,b,a) - * hsl(h,s,l) - * hsl(h%,s%,l%) - * hsla(h,s,l,a) - * - * @param {string} color 颜色 - * @return {Array} 颜色值数组或null - */ - function getData(color) { - color = normalize(color); - var r = color.match(colorRegExp); - if (r === null) { - throw new Error('The color format error'); // 颜色格式错误 - } - var d; - var a; - var data = []; - var rgb; - - if (r[2]) { - // #rrggbb - d = r[2].replace('#', '').split(''); - rgb = [d[0] + d[1], d[2] + d[3], d[4] + d[5]]; - data = map(rgb, - function(c) { - return adjust(parseInt(c, 16), [0, 255]); - }); - - } - else if (r[4]) { - // rgb rgba - var rgba = (r[4]).split(','); - a = rgba[3]; - rgb = rgba.slice(0, 3); - data = map( - rgb, - function(c) { - c = Math.floor( - c.indexOf('%') > 0 ? parseInt(c, 0) * 2.55 : c - ); - return adjust(c, [0, 255]); - } - ); - - if(typeof a !== 'undefined') { - data.push(adjust(parseFloat(a), [0, 1])); - } - } - else if (r[5] || r[6]) { - // hsb hsba hsl hsla - var hsxa = (r[5] || r[6]).split(','); - var h = parseInt(hsxa[0], 0) / 360; - var s = hsxa[1]; - var x = hsxa[2]; - a = hsxa[3]; - data = map([s, x], - function(c) { - return adjust(parseFloat(c) / 100, [0, 1]); - }); - data.unshift(h); - if( typeof a !== 'undefined') { - data.push(adjust(parseFloat(a), [0, 1])); - } - } - return data; - } - - /** - * 设置颜色透明度 - * @param {string} color 颜色 - * @param {number} alpha 透明度,区间[0,1] - * @return {string} rgba颜色值 - */ - function alpha(color, a) { - if (a === null) { - a = 1; - } - var data = getData(toRGBA(color)); - data[3] = adjust(Number(a).toFixed(4), [0, 1]); - - return toColor(data, 'rgba'); - } - - // 数组映射 - function map(array, fun) { - if (typeof fun !== 'function') { - throw new TypeError(); - } - var len = array ? array.length : 0; - for ( var i = 0; i < len; i++) { - array[i] = fun(array[i]); - } - return array; - } - - // 调整值区间 - function adjust(value, region) { - // < to <= & > to >= - // modify by linzhifeng 2014-05-25 because -0 == 0 - if (value <= region[0]) { - value = region[0]; - } - else if (value >= region[1]) { - value = region[1]; - } - return value; - } - - // 参见 http:// www.easyrgb.com/index.php?X=MATH - function _HSV_2_RGB(data) { - var H = data[0]; - var S = data[1]; - var V = data[2]; - // HSV from 0 to 1 - var R, G, B; - if (S === 0) { - R = V * 255; - G = V * 255; - B = V * 255; - } else { - var h = H * 6; - if (h === 6) { - h = 0; - } - var i = h | 0; - var v1 = V * (1 - S); - var v2 = V * (1 - S * (h - i)); - var v3 = V * (1 - S * (1 - (h - i))); - var r = 0; - var g = 0; - var b = 0; - - if (i === 0) { - r = V; - g = v3; - b = v1; - } else if (i === 1) { - r = v2; - g = V; - b = v1; - } else if (i === 2) { - r = v1; - g = V; - b = v3; - } else if (i === 3) { - r = v1; - g = v2; - b = V; - } else if (i === 4) { - r = v3; - g = v1; - b = V; - } else { - r = V; - g = v1; - b = v2; - } - - // RGB results from 0 to 255 - R = r * 255; - G = g * 255; - B = b * 255; - } - return [ R, G, B ]; - } - - function _HSL_2_RGB(data) { - var H = data[0]; - var S = data[1]; - var L = data[2]; - // HSL from 0 to 1 - var R, G, B; - if (S === 0) { - R = L * 255; - G = L * 255; - B = L * 255; - } else { - var v2; - if (L < 0.5) { - v2 = L * (1 + S); - } else { - v2 = (L + S) - (S * L); - } - - var v1 = 2 * L - v2; - - R = 255 * _HUE_2_RGB(v1, v2, H + (1 / 3)); - G = 255 * _HUE_2_RGB(v1, v2, H); - B = 255 * _HUE_2_RGB(v1, v2, H - (1 / 3)); - } - return [ R, G, B ]; - } - - function _HUE_2_RGB(v1, v2, vH) { - if (vH < 0) { - vH += 1; - } - if (vH > 1) { - vH -= 1; - } - if ((6 * vH) < 1) { - return (v1 + (v2 - v1) * 6 * vH); - } - if ((2 * vH) < 1) { - return (v2); - } - if ((3 * vH) < 2) { - return (v1 + (v2 - v1) * ((2 / 3) - vH) * 6); - } - return v1; - } - - function _RGB_2_HSB(data) { - // RGB from 0 to 255 - var R = (data[0] / 255); - var G = (data[1] / 255); - var B = (data[2] / 255); - - var vMin = Math.min(R, G, B); // Min. value of RGB - var vMax = Math.max(R, G, B); // Max. value of RGB - var delta = vMax - vMin; // Delta RGB value - var V = vMax; - var H; - var S; - - // HSV results from 0 to 1 - if (delta === 0) { - H = 0; - S = 0; - } else { - S = delta / vMax; - - var deltaR = (((vMax - R) / 6) + (delta / 2)) / delta; - var deltaG = (((vMax - G) / 6) + (delta / 2)) / delta; - var deltaB = (((vMax - B) / 6) + (delta / 2)) / delta; - - if (R === vMax) { - H = deltaB - deltaG; - } else if (G === vMax) { - H = (1 / 3) + deltaR - deltaB; - } else if (B === vMax) { - H = (2 / 3) + deltaG - deltaR; - } - - if (H < 0) { - H += 1; - } - if (H > 1) { - H -= 1; - } - } - H = H * 360; - S = S * 100; - V = V * 100; - return [ H, S, V ]; - } - - function _RGB_2_HSL(data) { - // RGB from 0 to 255 - var R = (data[0] / 255); - var G = (data[1] / 255); - var B = (data[2] / 255); - - var vMin = Math.min(R, G, B); // Min. value of RGB - var vMax = Math.max(R, G, B); // Max. value of RGB - var delta = vMax - vMin; // Delta RGB value - - var L = (vMax + vMin) / 2; - var H; - var S; - // HSL results from 0 to 1 - if (delta === 0) { - H = 0; - S = 0; - } else { - if (L < 0.5) { - S = delta / (vMax + vMin); - } else { - S = delta / (2 - vMax - vMin); - } - - var deltaR = (((vMax - R) / 6) + (delta / 2)) / delta; - var deltaG = (((vMax - G) / 6) + (delta / 2)) / delta; - var deltaB = (((vMax - B) / 6) + (delta / 2)) / delta; - - if (R === vMax) { - H = deltaB - deltaG; - } else if (G === vMax) { - H = (1 / 3) + deltaR - deltaB; - } else if (B === vMax) { - H = (2 / 3) + deltaG - deltaR; - } - - if (H < 0) { - H += 1; - } - - if (H > 1) { - H -= 1; - } - } - - H = H * 360; - S = S * 100; - L = L * 100; - - return [ H, S, L ]; - } - - return { - customPalette : customPalette, - resetPalette : resetPalette, - getColor : getColor, - getHighlightColor : getHighlightColor, - customHighlight : customHighlight, - resetHighlight : resetHighlight, - getRadialGradient : getRadialGradient, - getLinearGradient : getLinearGradient, - getGradientColors : getGradientColors, - getStepColors : getStepColors, - reverse : reverse, - mix : mix, - lift : lift, - trim : trim, - random : random, - toRGB : toRGB, - toRGBA : toRGBA, - toHex : toHex, - toHSL : toHSL, - toHSLA : toHSLA, - toHSB : toHSB, - toHSBA : toHSBA, - toHSV : toHSV, - toHSVA : toHSVA, - toName : toName, - toColor : toColor, - toArray : toArray, - alpha : alpha, - getData : getData - }; -}); - +/** + * 颜色辅助模块 + * @module zrender/tool/color + */ +define(function(require) { + var util = require('../tool/util'); + + var _ctx; + + // Color palette is an array containing the default colors for the chart's + // series. + // When all colors are used, new colors are selected from the start again. + // Defaults to: + // 默认色板 + var palette = [ + '#ff9277', ' #dddd00', ' #ffc877', ' #bbe3ff', ' #d5ffbb', + '#bbbbff', ' #ddb000', ' #b0dd00', ' #e2bbff', ' #ffbbe3', + '#ff7777', ' #ff9900', ' #83dd00', ' #77e3ff', ' #778fff', + '#c877ff', ' #ff77ab', ' #ff6600', ' #aa8800', ' #77c7ff', + '#ad77ff', ' #ff77ff', ' #dd0083', ' #777700', ' #00aa00', + '#0088aa', ' #8400dd', ' #aa0088', ' #dd0000', ' #772e00' + ]; + var _palette = palette; + + var highlightColor = 'rgba(255,255,0,0.5)'; + var _highlightColor = highlightColor; + + // 颜色格式 + /*jshint maxlen: 330 */ + var colorRegExp = /^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i; + + var _nameColors = { + aliceblue : '#f0f8ff', + antiquewhite : '#faebd7', + aqua : '#0ff', + aquamarine : '#7fffd4', + azure : '#f0ffff', + beige : '#f5f5dc', + bisque : '#ffe4c4', + black : '#000', + blanchedalmond : '#ffebcd', + blue : '#00f', + blueviolet : '#8a2be2', + brown : '#a52a2a', + burlywood : '#deb887', + cadetblue : '#5f9ea0', + chartreuse : '#7fff00', + chocolate : '#d2691e', + coral : '#ff7f50', + cornflowerblue : '#6495ed', + cornsilk : '#fff8dc', + crimson : '#dc143c', + cyan : '#0ff', + darkblue : '#00008b', + darkcyan : '#008b8b', + darkgoldenrod : '#b8860b', + darkgray : '#a9a9a9', + darkgrey : '#a9a9a9', + darkgreen : '#006400', + darkkhaki : '#bdb76b', + darkmagenta : '#8b008b', + darkolivegreen : '#556b2f', + darkorange : '#ff8c00', + darkorchid : '#9932cc', + darkred : '#8b0000', + darksalmon : '#e9967a', + darkseagreen : '#8fbc8f', + darkslateblue : '#483d8b', + darkslategray : '#2f4f4f', + darkslategrey : '#2f4f4f', + darkturquoise : '#00ced1', + darkviolet : '#9400d3', + deeppink : '#ff1493', + deepskyblue : '#00bfff', + dimgray : '#696969', + dimgrey : '#696969', + dodgerblue : '#1e90ff', + firebrick : '#b22222', + floralwhite : '#fffaf0', + forestgreen : '#228b22', + fuchsia : '#f0f', + gainsboro : '#dcdcdc', + ghostwhite : '#f8f8ff', + gold : '#ffd700', + goldenrod : '#daa520', + gray : '#808080', + grey : '#808080', + green : '#008000', + greenyellow : '#adff2f', + honeydew : '#f0fff0', + hotpink : '#ff69b4', + indianred : '#cd5c5c', + indigo : '#4b0082', + ivory : '#fffff0', + khaki : '#f0e68c', + lavender : '#e6e6fa', + lavenderblush : '#fff0f5', + lawngreen : '#7cfc00', + lemonchiffon : '#fffacd', + lightblue : '#add8e6', + lightcoral : '#f08080', + lightcyan : '#e0ffff', + lightgoldenrodyellow : '#fafad2', + lightgray : '#d3d3d3', + lightgrey : '#d3d3d3', + lightgreen : '#90ee90', + lightpink : '#ffb6c1', + lightsalmon : '#ffa07a', + lightseagreen : '#20b2aa', + lightskyblue : '#87cefa', + lightslategray : '#789', + lightslategrey : '#789', + lightsteelblue : '#b0c4de', + lightyellow : '#ffffe0', + lime : '#0f0', + limegreen : '#32cd32', + linen : '#faf0e6', + magenta : '#f0f', + maroon : '#800000', + mediumaquamarine : '#66cdaa', + mediumblue : '#0000cd', + mediumorchid : '#ba55d3', + mediumpurple : '#9370d8', + mediumseagreen : '#3cb371', + mediumslateblue : '#7b68ee', + mediumspringgreen : '#00fa9a', + mediumturquoise : '#48d1cc', + mediumvioletred : '#c71585', + midnightblue : '#191970', + mintcream : '#f5fffa', + mistyrose : '#ffe4e1', + moccasin : '#ffe4b5', + navajowhite : '#ffdead', + navy : '#000080', + oldlace : '#fdf5e6', + olive : '#808000', + olivedrab : '#6b8e23', + orange : '#ffa500', + orangered : '#ff4500', + orchid : '#da70d6', + palegoldenrod : '#eee8aa', + palegreen : '#98fb98', + paleturquoise : '#afeeee', + palevioletred : '#d87093', + papayawhip : '#ffefd5', + peachpuff : '#ffdab9', + peru : '#cd853f', + pink : '#ffc0cb', + plum : '#dda0dd', + powderblue : '#b0e0e6', + purple : '#800080', + red : '#f00', + rosybrown : '#bc8f8f', + royalblue : '#4169e1', + saddlebrown : '#8b4513', + salmon : '#fa8072', + sandybrown : '#f4a460', + seagreen : '#2e8b57', + seashell : '#fff5ee', + sienna : '#a0522d', + silver : '#c0c0c0', + skyblue : '#87ceeb', + slateblue : '#6a5acd', + slategray : '#708090', + slategrey : '#708090', + snow : '#fffafa', + springgreen : '#00ff7f', + steelblue : '#4682b4', + tan : '#d2b48c', + teal : '#008080', + thistle : '#d8bfd8', + tomato : '#ff6347', + turquoise : '#40e0d0', + violet : '#ee82ee', + wheat : '#f5deb3', + white : '#fff', + whitesmoke : '#f5f5f5', + yellow : '#ff0', + yellowgreen : '#9acd32' + }; + + /** + * 自定义调色板 + */ + function customPalette(userPalete) { + palette = userPalete; + } + + /** + * 复位默认色板 + */ + function resetPalette() { + palette = _palette; + } + + /** + * 获取色板颜色 + * @memberOf module:zrender/tool/color + * @param {number} idx 色板位置 + * @param {Array.} [userPalete] 自定义色板 + * @return {string} 颜色 + */ + function getColor(idx, userPalete) { + idx = idx | 0; + userPalete = userPalete || palette; + return userPalete[idx % userPalete.length]; + } + + /** + * 自定义默认高亮颜色 + */ + function customHighlight(userHighlightColor) { + highlightColor = userHighlightColor; + } + + /** + * 重置默认高亮颜色 + */ + function resetHighlight() { + _highlightColor = highlightColor; + } + + /** + * 获取默认高亮颜色 + */ + function getHighlightColor() { + return highlightColor; + } + + /** + * 径向渐变 + * @memberOf module:zrender/tool/color + * @param {number} x0 渐变起点 + * @param {number} y0 + * @param {number} r0 + * @param {number} x1 渐变终点 + * @param {number} y1 + * @param {number} r1 + * @param {Array} colorList 颜色列表 + * @return {CanvasGradient} + */ + function getRadialGradient(x0, y0, r0, x1, y1, r1, colorList) { + if (!_ctx) { + _ctx = util.getContext(); + } + var gradient = _ctx.createRadialGradient(x0, y0, r0, x1, y1, r1); + for (var i = 0, l = colorList.length; i < l; i++) { + gradient.addColorStop(colorList[i][0], colorList[i][1]); + } + gradient.__nonRecursion = true; + return gradient; + } + + /** + * 线性渐变 + * @param {Object} x0 渐变起点 + * @param {Object} y0 + * @param {Object} x1 渐变终点 + * @param {Object} y1 + * @param {Array} colorList 颜色列表 + */ + function getLinearGradient(x0, y0, x1, y1, colorList) { + if (!_ctx) { + _ctx = util.getContext(); + } + var gradient = _ctx.createLinearGradient(x0, y0, x1, y1); + for (var i = 0, l = colorList.length; i < l; i++) { + gradient.addColorStop(colorList[i][0], colorList[i][1]); + } + gradient.__nonRecursion = true; + return gradient; + } + + /** + * 获取两种颜色之间渐变颜色数组 + * @param {color} start 起始颜色 + * @param {color} end 结束颜色 + * @param {number} step 渐变级数 + * @return {Array} 颜色数组 + */ + function getStepColors(start, end, step) { + start = toRGBA(start); + end = toRGBA(end); + start = getData(start); + end = getData(end); + + var colors = []; + var stepR = (end[0] - start[0]) / step; + var stepG = (end[1] - start[1]) / step; + var stepB = (end[2] - start[2]) / step; + var stepA = (end[3] - start[3]) / step; + // 生成颜色集合 + // fix by linfeng 颜色堆积 + for (var i = 0, r = start[0], g = start[1], b = start[2], a = start[3]; i < step; i++) { + colors[i] = toColor([ + adjust(Math.floor(r), [ 0, 255 ]), + adjust(Math.floor(g), [ 0, 255 ]), + adjust(Math.floor(b), [ 0, 255 ]), + a.toFixed(4) - 0 + ],'rgba'); + r += stepR; + g += stepG; + b += stepB; + a += stepA; + } + r = end[0]; + g = end[1]; + b = end[2]; + a = end[3]; + colors[i] = toColor([r, g, b, a], 'rgba'); + return colors; + } + + /** + * 获取指定级数的渐变颜色数组 + * @memberOf module:zrender/tool/color + * @param {Array.} colors 颜色组 + * @param {number} [step=20] 渐变级数 + * @return {Array.} 颜色数组 + */ + function getGradientColors(colors, step) { + var ret = []; + var len = colors.length; + if (step === undefined) { + step = 20; + } + if (len === 1) { + ret = getStepColors(colors[0], colors[0], step); + } + else if (len > 1) { + for (var i = 0, n = len - 1; i < n; i++) { + var steps = getStepColors(colors[i], colors[i + 1], step); + if (i < n - 1) { + steps.pop(); + } + ret = ret.concat(steps); + } + } + return ret; + } + + /** + * 颜色值数组转为指定格式颜色,例如:
+ * data = [60,20,20,0.1] format = 'rgba' + * 返回:rgba(60,20,20,0.1) + * @param {Array} data 颜色值数组 + * @param {string} format 格式,默认rgb + * @return {string} 颜色 + */ + function toColor(data, format) { + format = format || 'rgb'; + if (data && (data.length === 3 || data.length === 4)) { + data = map(data, + function(c) { + return c > 1 ? Math.ceil(c) : c; + } + ); + + if (format.indexOf('hex') > -1) { + return '#' + ((1 << 24) + (data[0] << 16) + (data[1] << 8) + (+data[2])).toString(16).slice(1); + } + else if (format.indexOf('hs') > -1) { + var sx = map(data.slice(1, 3), + function(c) { + return c + '%'; + } + ); + data[1] = sx[0]; + data[2] = sx[1]; + } + + if (format.indexOf('a') > -1) { + if (data.length === 3) { + data.push(1); + } + data[3] = adjust(data[3], [ 0, 1 ]); + return format + '(' + data.slice(0, 4).join(',') + ')'; + } + + return format + '(' + data.slice(0, 3).join(',') + ')'; + } + } + + /** + * 颜色字符串转换为rgba数组 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {Array.} 颜色值数组 + */ + function toArray(color) { + color = trim(color); + if (color.indexOf('rgba') < 0) { + color = toRGBA(color); + } + + var data = []; + var i = 0; + color.replace(/[\d.]+/g, function (n) { + if (i < 3) { + n = n | 0; + } + else { + // Alpha + n = +n; + } + data[i++] = n; + }); + return data; + } + + /** + * 颜色格式转化 + * + * @param {string} color 颜色值数组 + * @param {string} format 格式,默认rgb + * @return {string} 颜色 + */ + function convert(color, format) { + if (!isCalculableColor(color)) { + return color; + } + var data = getData(color); + var alpha = data[3]; + if (typeof alpha === 'undefined') { + alpha = 1; + } + + if (color.indexOf('hsb') > -1) { + data = _HSV_2_RGB(data); + } + else if (color.indexOf('hsl') > -1) { + data = _HSL_2_RGB(data); + } + + if (format.indexOf('hsb') > -1 || format.indexOf('hsv') > -1) { + data = _RGB_2_HSB(data); + } + else if (format.indexOf('hsl') > -1) { + data = _RGB_2_HSL(data); + } + + data[3] = alpha; + + return toColor(data, format); + } + + /** + * 转换为rgba格式的颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} rgba颜色,rgba(r,g,b,a) + */ + function toRGBA(color) { + return convert(color, 'rgba'); + } + + /** + * 转换为rgb数字格式的颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} rgb颜色,rgb(0,0,0)格式 + */ + function toRGB(color) { + return convert(color, 'rgb'); + } + + /** + * 转换为16进制颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} 16进制颜色,#rrggbb格式 + */ + function toHex(color) { + return convert(color, 'hex'); + } + + /** + * 转换为HSV颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} HSVA颜色,hsva(h,s,v,a) + */ + function toHSVA(color) { + return convert(color, 'hsva'); + } + + /** + * 转换为HSV颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} HSV颜色,hsv(h,s,v) + */ + function toHSV(color) { + return convert(color, 'hsv'); + } + + /** + * 转换为HSBA颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} HSBA颜色,hsba(h,s,b,a) + */ + function toHSBA(color) { + return convert(color, 'hsba'); + } + + /** + * 转换为HSB颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} HSB颜色,hsb(h,s,b) + */ + function toHSB(color) { + return convert(color, 'hsb'); + } + + /** + * 转换为HSLA颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} HSLA颜色,hsla(h,s,l,a) + */ + function toHSLA(color) { + return convert(color, 'hsla'); + } + + /** + * 转换为HSL颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} HSL颜色,hsl(h,s,l) + */ + function toHSL(color) { + return convert(color, 'hsl'); + } + + /** + * 转换颜色名 + * + * @param {string} color 颜色 + * @return {string} 颜色名 + */ + function toName(color) { + for (var key in _nameColors) { + if (toHex(_nameColors[key]) === toHex(color)) { + return key; + } + } + return null; + } + + /** + * 移除颜色中多余空格 + * + * @param {string} color 颜色 + * @return {string} 无空格颜色 + */ + function trim(color) { + return String(color).replace(/\s+/g, ''); + } + + /** + * 颜色规范化 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} 规范化后的颜色 + */ + function normalize(color) { + // 颜色名 + if (_nameColors[color]) { + color = _nameColors[color]; + } + // 去掉空格 + color = trim(color); + // hsv与hsb等价 + color = color.replace(/hsv/i, 'hsb'); + // rgb转为rrggbb + if (/^#[\da-f]{3}$/i.test(color)) { + color = parseInt(color.slice(1), 16); + var r = (color & 0xf00) << 8; + var g = (color & 0xf0) << 4; + var b = color & 0xf; + + color = '#' + ((1 << 24) + (r << 4) + r + (g << 4) + g + (b << 4) + b).toString(16).slice(1); + } + // 或者使用以下正则替换,不过 chrome 下性能相对差点 + // color = color.replace(/^#([\da-f])([\da-f])([\da-f])$/i, '#$1$1$2$2$3$3'); + return color; + } + + /** + * 颜色加深或减淡,当level>0加深,当level<0减淡 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @param {number} level 升降程度,取值区间[-1,1] + * @return {string} 加深或减淡后颜色值 + */ + function lift(color, level) { + if (!isCalculableColor(color)) { + return color; + } + var direct = level > 0 ? 1 : -1; + if (typeof level === 'undefined') { + level = 0; + } + level = Math.abs(level) > 1 ? 1 : Math.abs(level); + color = toRGB(color); + var data = getData(color); + for (var i = 0; i < 3; i++) { + if (direct === 1) { + data[i] = data[i] * (1 - level) | 0; + } + else { + data[i] = ((255 - data[i]) * level + data[i]) | 0; + } + } + return 'rgb(' + data.join(',') + ')'; + } + + /** + * 颜色翻转,[255-r,255-g,255-b,1-a] + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} 翻转颜色 + */ + function reverse(color) { + if (!isCalculableColor(color)) { + return color; + } + var data = getData(toRGBA(color)); + data = map(data, + function(c) { + return 255 - c; + } + ); + return toColor(data, 'rgb'); + } + + /** + * 简单两种颜色混合 + * @memberOf module:zrender/tool/color + * @param {string} color1 第一种颜色 + * @param {string} color2 第二种颜色 + * @param {number} weight 混合权重[0-1] + * @return {string} 结果色,rgb(r,g,b)或rgba(r,g,b,a) + */ + function mix(color1, color2, weight) { + if (!isCalculableColor(color1) || !isCalculableColor(color2)) { + return color1; + } + + if (typeof weight === 'undefined') { + weight = 0.5; + } + weight = 1 - adjust(weight, [ 0, 1 ]); + + var w = weight * 2 - 1; + var data1 = getData(toRGBA(color1)); + var data2 = getData(toRGBA(color2)); + + var d = data1[3] - data2[3]; + + var weight1 = (((w * d === -1) ? w : (w + d) / (1 + w * d)) + 1) / 2; + var weight2 = 1 - weight1; + + var data = []; + + for (var i = 0; i < 3; i++) { + data[i] = data1[i] * weight1 + data2[i] * weight2; + } + + var alpha = data1[3] * weight + data2[3] * (1 - weight); + alpha = Math.max(0, Math.min(1, alpha)); + + if (data1[3] === 1 && data2[3] === 1) {// 不考虑透明度 + return toColor(data, 'rgb'); + } + data[3] = alpha; + return toColor(data, 'rgba'); + } + + /** + * 随机颜色 + * + * @return {string} 颜色值,#rrggbb格式 + */ + function random() { + return '#' + (Math.random().toString(16) + '0000').slice(2, 8); + } + + /** + * 获取颜色值数组,返回值范围:
+ * RGB 范围[0-255]
+ * HSL/HSV/HSB 范围[0-1]
+ * A透明度范围[0-1] + * 支持格式: + * #rgb + * #rrggbb + * rgb(r,g,b) + * rgb(r%,g%,b%) + * rgba(r,g,b,a) + * hsb(h,s,b) // hsv与hsb等价 + * hsb(h%,s%,b%) + * hsba(h,s,b,a) + * hsl(h,s,l) + * hsl(h%,s%,l%) + * hsla(h,s,l,a) + * + * @param {string} color 颜色 + * @return {Array.} 颜色值数组或null + */ + function getData(color) { + color = normalize(color); + var r = color.match(colorRegExp); + if (r === null) { + throw new Error('The color format error'); // 颜色格式错误 + } + var d; + var a; + var data = []; + var rgb; + + if (r[2]) { + // #rrggbb + d = r[2].replace('#', '').split(''); + rgb = [ d[0] + d[1], d[2] + d[3], d[4] + d[5] ]; + data = map(rgb, + function(c) { + return adjust(parseInt(c, 16), [ 0, 255 ]); + } + ); + + } + else if (r[4]) { + // rgb rgba + var rgba = (r[4]).split(','); + a = rgba[3]; + rgb = rgba.slice(0, 3); + data = map( + rgb, + function(c) { + c = Math.floor( + c.indexOf('%') > 0 ? parseInt(c, 0) * 2.55 : c + ); + return adjust(c, [ 0, 255 ]); + } + ); + + if (typeof a !== 'undefined') { + data.push(adjust(parseFloat(a), [ 0, 1 ])); + } + } + else if (r[5] || r[6]) { + // hsb hsba hsl hsla + var hsxa = (r[5] || r[6]).split(','); + var h = parseInt(hsxa[0], 0) / 360; + var s = hsxa[1]; + var x = hsxa[2]; + a = hsxa[3]; + data = map([ s, x ], + function(c) { + return adjust(parseFloat(c) / 100, [ 0, 1 ]); + } + ); + data.unshift(h); + if (typeof a !== 'undefined') { + data.push(adjust(parseFloat(a), [ 0, 1 ])); + } + } + return data; + } + + /** + * 设置颜色透明度 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @param {number} a 透明度,区间[0,1] + * @return {string} rgba颜色值 + */ + function alpha(color, a) { + if (!isCalculableColor(color)) { + return color; + } + if (a === null) { + a = 1; + } + var data = getData(toRGBA(color)); + data[3] = adjust(Number(a).toFixed(4), [ 0, 1 ]); + + return toColor(data, 'rgba'); + } + + // 数组映射 + function map(array, fun) { + if (typeof fun !== 'function') { + throw new TypeError(); + } + var len = array ? array.length : 0; + for (var i = 0; i < len; i++) { + array[i] = fun(array[i]); + } + return array; + } + + // 调整值区间 + function adjust(value, region) { + // < to <= & > to >= + // modify by linzhifeng 2014-05-25 because -0 == 0 + if (value <= region[0]) { + value = region[0]; + } + else if (value >= region[1]) { + value = region[1]; + } + return value; + } + + function isCalculableColor(color) { + return color instanceof Array || typeof color === 'string'; + } + + // 参见 http:// www.easyrgb.com/index.php?X=MATH + function _HSV_2_RGB(data) { + var H = data[0]; + var S = data[1]; + var V = data[2]; + // HSV from 0 to 1 + var R; + var G; + var B; + if (S === 0) { + R = V * 255; + G = V * 255; + B = V * 255; + } + else { + var h = H * 6; + if (h === 6) { + h = 0; + } + var i = h | 0; + var v1 = V * (1 - S); + var v2 = V * (1 - S * (h - i)); + var v3 = V * (1 - S * (1 - (h - i))); + var r = 0; + var g = 0; + var b = 0; + + if (i === 0) { + r = V; + g = v3; + b = v1; + } + else if (i === 1) { + r = v2; + g = V; + b = v1; + } + else if (i === 2) { + r = v1; + g = V; + b = v3; + } + else if (i === 3) { + r = v1; + g = v2; + b = V; + } + else if (i === 4) { + r = v3; + g = v1; + b = V; + } + else { + r = V; + g = v1; + b = v2; + } + + // RGB results from 0 to 255 + R = r * 255; + G = g * 255; + B = b * 255; + } + return [ R, G, B ]; + } + + function _HSL_2_RGB(data) { + var H = data[0]; + var S = data[1]; + var L = data[2]; + // HSL from 0 to 1 + var R; + var G; + var B; + if (S === 0) { + R = L * 255; + G = L * 255; + B = L * 255; + } + else { + var v2; + if (L < 0.5) { + v2 = L * (1 + S); + } + else { + v2 = (L + S) - (S * L); + } + + var v1 = 2 * L - v2; + + R = 255 * _HUE_2_RGB(v1, v2, H + (1 / 3)); + G = 255 * _HUE_2_RGB(v1, v2, H); + B = 255 * _HUE_2_RGB(v1, v2, H - (1 / 3)); + } + return [ R, G, B ]; + } + + function _HUE_2_RGB(v1, v2, vH) { + if (vH < 0) { + vH += 1; + } + if (vH > 1) { + vH -= 1; + } + if ((6 * vH) < 1) { + return (v1 + (v2 - v1) * 6 * vH); + } + if ((2 * vH) < 1) { + return (v2); + } + if ((3 * vH) < 2) { + return (v1 + (v2 - v1) * ((2 / 3) - vH) * 6); + } + return v1; + } + + function _RGB_2_HSB(data) { + // RGB from 0 to 255 + var R = (data[0] / 255); + var G = (data[1] / 255); + var B = (data[2] / 255); + + var vMin = Math.min(R, G, B); // Min. value of RGB + var vMax = Math.max(R, G, B); // Max. value of RGB + var delta = vMax - vMin; // Delta RGB value + var V = vMax; + var H; + var S; + + // HSV results from 0 to 1 + if (delta === 0) { + H = 0; + S = 0; + } + else { + S = delta / vMax; + + var deltaR = (((vMax - R) / 6) + (delta / 2)) / delta; + var deltaG = (((vMax - G) / 6) + (delta / 2)) / delta; + var deltaB = (((vMax - B) / 6) + (delta / 2)) / delta; + + if (R === vMax) { + H = deltaB - deltaG; + } + else if (G === vMax) { + H = (1 / 3) + deltaR - deltaB; + } + else if (B === vMax) { + H = (2 / 3) + deltaG - deltaR; + } + + if (H < 0) { + H += 1; + } + if (H > 1) { + H -= 1; + } + } + H = H * 360; + S = S * 100; + V = V * 100; + return [ H, S, V ]; + } + + function _RGB_2_HSL(data) { + // RGB from 0 to 255 + var R = (data[0] / 255); + var G = (data[1] / 255); + var B = (data[2] / 255); + + var vMin = Math.min(R, G, B); // Min. value of RGB + var vMax = Math.max(R, G, B); // Max. value of RGB + var delta = vMax - vMin; // Delta RGB value + + var L = (vMax + vMin) / 2; + var H; + var S; + // HSL results from 0 to 1 + if (delta === 0) { + H = 0; + S = 0; + } + else { + if (L < 0.5) { + S = delta / (vMax + vMin); + } + else { + S = delta / (2 - vMax - vMin); + } + + var deltaR = (((vMax - R) / 6) + (delta / 2)) / delta; + var deltaG = (((vMax - G) / 6) + (delta / 2)) / delta; + var deltaB = (((vMax - B) / 6) + (delta / 2)) / delta; + + if (R === vMax) { + H = deltaB - deltaG; + } + else if (G === vMax) { + H = (1 / 3) + deltaR - deltaB; + } + else if (B === vMax) { + H = (2 / 3) + deltaG - deltaR; + } + + if (H < 0) { + H += 1; + } + + if (H > 1) { + H -= 1; + } + } + + H = H * 360; + S = S * 100; + L = L * 100; + + return [ H, S, L ]; + } + + return { + customPalette : customPalette, + resetPalette : resetPalette, + getColor : getColor, + getHighlightColor : getHighlightColor, + customHighlight : customHighlight, + resetHighlight : resetHighlight, + getRadialGradient : getRadialGradient, + getLinearGradient : getLinearGradient, + getGradientColors : getGradientColors, + getStepColors : getStepColors, + reverse : reverse, + mix : mix, + lift : lift, + trim : trim, + random : random, + toRGB : toRGB, + toRGBA : toRGBA, + toHex : toHex, + toHSL : toHSL, + toHSLA : toHSLA, + toHSB : toHSB, + toHSBA : toHSBA, + toHSV : toHSV, + toHSVA : toHSVA, + toName : toName, + toColor : toColor, + toArray : toArray, + alpha : alpha, + getData : getData + }; +}); + diff --git a/amd/zrender/tool/computeBoundingBox.js b/amd/zrender/tool/computeBoundingBox.js index be80271..b5925f4 100644 --- a/amd/zrender/tool/computeBoundingBox.js +++ b/amd/zrender/tool/computeBoundingBox.js @@ -1,17 +1,19 @@ /** - * zrender: 计算包围盒 - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * pissang(https://github.com/pissang) * errorrik (errorrik@gmail.com) */ - define( function (require) { var vec2 = require('./vector'); + var curve = require('./curve'); /** - * 计算包围盒 + * 从顶点数组中计算出最小包围盒,写入`min`和`max`中 + * @module zrender/tool/computeBoundingBox + * @param {Array} points 顶点数组 + * @param {number} min + * @param {number} max */ function computeBoundingBox(points, min, max) { if (points.length === 0) { @@ -45,16 +47,26 @@ define( } /** - * 计算三阶贝塞尔曲线的包围盒 - * http://pissang.net/blog/?p=91 + * 从三阶贝塞尔曲线(p0, p1, p2, p3)中计算出最小包围盒,写入`min`和`max`中 + * @memberOf module:zrender/tool/computeBoundingBox + * @param {Array.} p0 + * @param {Array.} p1 + * @param {Array.} p2 + * @param {Array.} p3 + * @param {Array.} min + * @param {Array.} max */ function computeCubeBezierBoundingBox(p0, p1, p2, p3, min, max) { - var xDim = _computeCubeBezierExtremitiesDim( - p0[0], p1[0], p2[0], p3[0] - ); - var yDim = _computeCubeBezierExtremitiesDim( - p0[1], p1[1], p2[1], p3[1] - ); + var xDim = []; + curve.cubicExtrema(p0[0], p1[0], p2[0], p3[0], xDim); + for (var i = 0; i < xDim.length; i++) { + xDim[i] = curve.cubicAt(p0[0], p1[0], p2[0], p3[0], xDim[i]); + } + var yDim = []; + curve.cubicExtrema(p0[1], p1[1], p2[1], p3[1], yDim); + for (var i = 0; i < yDim.length; i++) { + yDim[i] = curve.cubicAt(p0[1], p1[1], p2[1], p3[1], yDim[i]); + } xDim.push(p0[0], p3[0]); yDim.push(p0[1], p3[1]); @@ -70,70 +82,25 @@ define( max[1] = bottom; } - function _computeCubeBezierExtremitiesDim(p0, p1, p2, p3) { - var extremities = []; - - var b = 6 * p2 - 12 * p1 + 6 * p0; - var a = 9 * p1 + 3 * p3 - 3 * p0 - 9 * p2; - var c = 3 * p1 - 3 * p0; - - var tmp = b * b - 4 * a * c; - if (tmp > 0){ - var tmpSqrt = Math.sqrt(tmp); - var t1 = (-b + tmpSqrt) / (2 * a); - var t2 = (-b - tmpSqrt) / (2 * a); - extremities.push(t1, t2); - } - else if (tmp === 0) { - extremities.push(-b / (2 * a)); - } - - var result = []; - for (var i = 0; i < extremities.length; i++) { - var t = extremities[i]; - if (Math.abs(2 * a * t + b) > 0.0001 && t < 1 && t > 0) { - var ct = 1 - t; - var val = ct * ct * ct * p0 - + 3 * ct * ct * t * p1 - + 3 * ct * t * t * p2 - + t * t *t * p3; - - result.push(val); - } - } - - return result; - } - /** - * 计算二阶贝塞尔曲线的包围盒 - * http://pissang.net/blog/?p=91 + * 从二阶贝塞尔曲线(p0, p1, p2)中计算出最小包围盒,写入`min`和`max`中 + * @memberOf module:zrender/tool/computeBoundingBox + * @param {Array.} p0 + * @param {Array.} p1 + * @param {Array.} p2 + * @param {Array.} min + * @param {Array.} max */ function computeQuadraticBezierBoundingBox(p0, p1, p2, min, max) { // Find extremities, where derivative in x dim or y dim is zero - var tmp = (p0[0] + p2[0] - 2 * p1[0]); - // p1 is center of p0 and p2 in x dim - var t1; - if (tmp === 0) { - t1 = 0.5; - } else { - t1 = (p0[0] - p1[0]) / tmp; - } - - tmp = (p0[1] + p2[1] - 2 * p1[1]); - // p1 is center of p0 and p2 in y dim - var t2; - if (tmp === 0) { - t2 = 0.5; - } else { - t2 = (p0[1] - p1[1]) / tmp; - } + var t1 = curve.quadraticExtremum(p0[0], p1[0], p2[0]); + var t2 = curve.quadraticExtremum(p0[1], p1[1], p2[1]); t1 = Math.max(Math.min(t1, 1), 0); t2 = Math.max(Math.min(t2, 1), 0); - var ct1 = 1-t1; - var ct2 = 1-t2; + var ct1 = 1 - t1; + var ct2 = 1 - t2; var x1 = ct1 * ct1 * p0[0] + 2 * ct1 * t1 * p1[0] @@ -148,63 +115,81 @@ define( var y2 = ct2 * ct2 * p0[1] + 2 * ct2 * t2 * p1[1] + t2 * t2 * p2[1]; - - return computeBoundingBox( - [p0.slice(), p2.slice(), [x1, y1], [x2, y2]], - min, max - ); + min[0] = Math.min(p0[0], p2[0], x1, x2); + min[1] = Math.min(p0[1], p2[1], y1, y2); + max[0] = Math.max(p0[0], p2[0], x1, x2); + max[1] = Math.max(p0[1], p2[1], y1, y2); } + var start = vec2.create(); + var end = vec2.create(); + var extremity = vec2.create(); /** - * 计算圆弧的包围盒 - * http://pissang.net/blog/?p=91 + * 从圆弧中计算出最小包围盒,写入`min`和`max`中 + * @method + * @memberOf module:zrender/tool/computeBoundingBox + * @param {Array.} center 圆弧中心点 + * @param {number} radius 圆弧半径 + * @param {number} startAngle 圆弧开始角度 + * @param {number} endAngle 圆弧结束角度 + * @param {number} anticlockwise 是否是顺时针 + * @param {Array.} min + * @param {Array.} max */ - var computeArcBoundingBox = (function(){ - var start = []; - var end = []; - // At most 4 extremities - var extremities = [[], [], [], []]; - return function( - center, radius, startAngle, endAngle, clockwise, min, max - ) { - clockwise = clockwise ? 1 : -1; - start[0] = Math.cos(startAngle); - start[1] = Math.sin(startAngle) * clockwise; - vec2.scale(start, start, radius); - vec2.add(start, start, center); - - end[0] = Math.cos(endAngle); - end[1] = Math.sin(endAngle) * clockwise; - vec2.scale(end, end, radius); - vec2.add(end, end, center); - - startAngle = startAngle % (Math.PI * 2); - if (startAngle < 0) { - startAngle = startAngle + Math.PI * 2; - } - endAngle = endAngle % (Math.PI * 2); - if (endAngle < 0) { - endAngle = endAngle + Math.PI * 2; - } + var computeArcBoundingBox = function ( + x, y, r, startAngle, endAngle, anticlockwise, min, max + ) { + if (Math.abs(startAngle - endAngle) >= Math.PI * 2) { + // Is a circle + min[0] = x - r; + min[1] = y - r; + max[0] = x + r; + max[1] = y + r; + return; + } - if (startAngle > endAngle) { - endAngle += Math.PI * 2; - } - var number = 0; - for (var angle = 0; angle < endAngle; angle += Math.PI / 2) { - if (angle > startAngle) { - var extremity = extremities[number++]; - extremity[0] = Math.cos(angle); - extremity[1] = Math.sin(angle) * clockwise; - vec2.scale(extremity, extremity, radius); - vec2.add(extremity, extremity, center); - } + start[0] = Math.cos(startAngle) * r + x; + start[1] = Math.sin(startAngle) * r + y; + + end[0] = Math.cos(endAngle) * r + x; + end[1] = Math.sin(endAngle) * r + y; + + vec2.min(min, start, end); + vec2.max(max, start, end); + + // Thresh to [0, Math.PI * 2] + startAngle = startAngle % (Math.PI * 2); + if (startAngle < 0) { + startAngle = startAngle + Math.PI * 2; + } + endAngle = endAngle % (Math.PI * 2); + if (endAngle < 0) { + endAngle = endAngle + Math.PI * 2; + } + + if (startAngle > endAngle && !anticlockwise) { + endAngle += Math.PI * 2; + } else if (startAngle < endAngle && anticlockwise) { + startAngle += Math.PI * 2; + } + if (anticlockwise) { + var tmp = endAngle; + endAngle = startAngle; + startAngle = tmp; + } + + // var number = 0; + // var step = (anticlockwise ? -Math.PI : Math.PI) / 2; + for (var angle = 0; angle < endAngle; angle += Math.PI / 2) { + if (angle > startAngle) { + extremity[0] = Math.cos(angle) * r + x; + extremity[1] = Math.sin(angle) * r + y; + + vec2.min(min, extremity, min); + vec2.max(max, extremity, max); } - var points = extremities.slice(0, number); - points.push(start, end); - computeBoundingBox(points, min, max); - }; - })(); + } + }; computeBoundingBox.cubeBezier = computeCubeBezierBoundingBox; computeBoundingBox.quadraticBezier = computeQuadraticBezierBoundingBox; diff --git a/amd/zrender/tool/curve.js b/amd/zrender/tool/curve.js new file mode 100644 index 0000000..9c07297 --- /dev/null +++ b/amd/zrender/tool/curve.js @@ -0,0 +1,512 @@ +/** + * 曲线辅助模块 + * @module zrender/tool/curve + * @author pissang(https://www.github.com/pissang) + */ +define(function(require) { + + var vector = require('./vector'); + + 'use strict'; + + var EPSILON = 1e-4; + + var THREE_SQRT = Math.sqrt(3); + var ONE_THIRD = 1 / 3; + + // 临时变量 + var _v0 = vector.create(); + var _v1 = vector.create(); + var _v2 = vector.create(); + // var _v3 = vector.create(); + + function isAroundZero(val) { + return val > -EPSILON && val < EPSILON; + } + function isNotAroundZero(val) { + return val > EPSILON || val < -EPSILON; + } + /* + function evalCubicCoeff(a, b, c, d, t) { + return ((a * t + b) * t + c) * t + d; + } + */ + + /** + * 计算三次贝塞尔值 + * @memberOf module:zrender/tool/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} p3 + * @param {number} t + * @return {number} + */ + function cubicAt(p0, p1, p2, p3, t) { + var onet = 1 - t; + return onet * onet * (onet * p0 + 3 * t * p1) + + t * t * (t * p3 + 3 * onet * p2); + } + + /** + * 计算三次贝塞尔导数值 + * @memberOf module:zrender/tool/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} p3 + * @param {number} t + * @return {number} + */ + function cubicDerivativeAt(p0, p1, p2, p3, t) { + var onet = 1 - t; + return 3 * ( + ((p1 - p0) * onet + 2 * (p2 - p1) * t) * onet + + (p3 - p2) * t * t + ); + } + + /** + * 计算三次贝塞尔方程根,使用盛金公式 + * @memberOf module:zrender/tool/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} p3 + * @param {number} val + * @param {Array.} roots + * @return {number} 有效根数目 + */ + function cubicRootAt(p0, p1, p2, p3, val, roots) { + // Evaluate roots of cubic functions + var a = p3 + 3 * (p1 - p2) - p0; + var b = 3 * (p2 - p1 * 2 + p0); + var c = 3 * (p1 - p0); + var d = p0 - val; + + var A = b * b - 3 * a * c; + var B = b * c - 9 * a * d; + var C = c * c - 3 * b * d; + + var n = 0; + + if (isAroundZero(A) && isAroundZero(B)) { + if (isAroundZero(b)) { + roots[0] = 0; + } + else { + var t1 = -c / b; //t1, t2, t3, b is not zero + if (t1 >=0 && t1 <= 1) { + roots[n++] = t1; + } + } + } + else { + var disc = B * B - 4 * A * C; + + if (isAroundZero(disc)) { + var K = B / A; + var t1 = -b / a + K; // t1, a is not zero + var t2 = -K / 2; // t2, t3 + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + if (t2 >= 0 && t2 <= 1) { + roots[n++] = t2; + } + } + else if (disc > 0) { + var discSqrt = Math.sqrt(disc); + var Y1 = A * b + 1.5 * a * (-B + discSqrt); + var Y2 = A * b + 1.5 * a * (-B - discSqrt); + if (Y1 < 0) { + Y1 = -Math.pow(-Y1, ONE_THIRD); + } + else { + Y1 = Math.pow(Y1, ONE_THIRD); + } + if (Y2 < 0) { + Y2 = -Math.pow(-Y2, ONE_THIRD); + } + else { + Y2 = Math.pow(Y2, ONE_THIRD); + } + var t1 = (-b - (Y1 + Y2)) / (3 * a); + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + } + else { + var T = (2 * A * b - 3 * a * B) / (2 * Math.sqrt(A * A * A)); + var theta = Math.acos(T) / 3; + var ASqrt = Math.sqrt(A); + var tmp = Math.cos(theta); + + var t1 = (-b - 2 * ASqrt * tmp) / (3 * a); + var t2 = (-b + ASqrt * (tmp + THREE_SQRT * Math.sin(theta))) / (3 * a); + var t3 = (-b + ASqrt * (tmp - THREE_SQRT * Math.sin(theta))) / (3 * a); + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + if (t2 >= 0 && t2 <= 1) { + roots[n++] = t2; + } + if (t3 >= 0 && t3 <= 1) { + roots[n++] = t3; + } + } + } + return n; + } + + /** + * 计算三次贝塞尔方程极限值的位置 + * @memberOf module:zrender/tool/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} p3 + * @param {Array.} extrema + * @return {number} 有效数目 + */ + function cubicExtrema(p0, p1, p2, p3, extrema) { + var b = 6 * p2 - 12 * p1 + 6 * p0; + var a = 9 * p1 + 3 * p3 - 3 * p0 - 9 * p2; + var c = 3 * p1 - 3 * p0; + + var n = 0; + if (isAroundZero(a)) { + if (isNotAroundZero(b)) { + var t1 = -c / b; + if (t1 >= 0 && t1 <=1) { + extrema[n++] = t1; + } + } + } + else { + var disc = b * b - 4 * a * c; + if (isAroundZero(disc)) { + extrema[0] = -b / (2 * a); + } + else if (disc > 0) { + var discSqrt = Math.sqrt(disc); + var t1 = (-b + discSqrt) / (2 * a); + var t2 = (-b - discSqrt) / (2 * a); + if (t1 >= 0 && t1 <= 1) { + extrema[n++] = t1; + } + if (t2 >= 0 && t2 <= 1) { + extrema[n++] = t2; + } + } + } + return n; + } + + /** + * 细分三次贝塞尔曲线 + * @memberOf module:zrender/tool/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} p3 + * @param {number} t + * @param {Array.} out + */ + function cubicSubdivide(p0, p1, p2, p3, t, out) { + var p01 = (p1 - p0) * t + p0; + var p12 = (p2 - p1) * t + p1; + var p23 = (p3 - p2) * t + p2; + + var p012 = (p12 - p01) * t + p01; + var p123 = (p23 - p12) * t + p12; + + var p0123 = (p123 - p012) * t + p012; + // Seg0 + out[0] = p0; + out[1] = p01; + out[2] = p012; + out[3] = p0123; + // Seg1 + out[4] = p0123; + out[5] = p123; + out[6] = p23; + out[7] = p3; + } + + /** + * 投射点到三次贝塞尔曲线上,返回投射距离。 + * 投射点有可能会有一个或者多个,这里只返回其中距离最短的一个。 + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @param {number} x3 + * @param {number} y3 + * @param {number} x + * @param {number} y + * @param {Array.} [out] 投射点 + * @return {number} + */ + function cubicProjectPoint( + x0, y0, x1, y1, x2, y2, x3, y3, + x, y, out + ) { + // http://pomax.github.io/bezierinfo/#projections + var t; + var interval = 0.005; + var d = Infinity; + + _v0[0] = x; + _v0[1] = y; + + // 先粗略估计一下可能的最小距离的 t 值 + // PENDING + for (var _t = 0; _t < 1; _t += 0.05) { + _v1[0] = cubicAt(x0, x1, x2, x3, _t); + _v1[1] = cubicAt(y0, y1, y2, y3, _t); + var d1 = vector.distSquare(_v0, _v1); + if (d1 < d) { + t = _t; + d = d1; + } + } + d = Infinity; + + // At most 32 iteration + for (var i = 0; i < 32; i++) { + if (interval < EPSILON) { + break; + } + var prev = t - interval; + var next = t + interval; + // t - interval + _v1[0] = cubicAt(x0, x1, x2, x3, prev); + _v1[1] = cubicAt(y0, y1, y2, y3, prev); + + var d1 = vector.distSquare(_v1, _v0); + + if (prev >= 0 && d1 < d) { + t = prev; + d = d1; + } + else { + // t + interval + _v2[0] = cubicAt(x0, x1, x2, x3, next); + _v2[1] = cubicAt(y0, y1, y2, y3, next); + var d2 = vector.distSquare(_v2, _v0); + + if (next <= 1 && d2 < d) { + t = next; + d = d2; + } + else { + interval *= 0.5; + } + } + } + // t + if (out) { + out[0] = cubicAt(x0, x1, x2, x3, t); + out[1] = cubicAt(y0, y1, y2, y3, t); + } + // console.log(interval, i); + return Math.sqrt(d); + } + + /** + * 计算二次方贝塞尔值 + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} t + * @return {number} + */ + function quadraticAt(p0, p1, p2, t) { + var onet = 1 - t; + return onet * (onet * p0 + 2 * t * p1) + t * t * p2; + } + + /** + * 计算二次方贝塞尔导数值 + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} t + * @return {number} + */ + function quadraticDerivativeAt(p0, p1, p2, t) { + return 2 * ((1 - t) * (p1 - p0) + t * (p2 - p1)); + } + + /** + * 计算二次方贝塞尔方程根 + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} t + * @param {Array.} roots + * @return {number} 有效根数目 + */ + function quadraticRootAt(p0, p1, p2, val, roots) { + var a = p0 - 2 * p1 + p2; + var b = 2 * (p1 - p0); + var c = p0 - val; + + var n = 0; + if (isAroundZero(a)) { + if (isNotAroundZero(b)) { + var t1 = -c / b; + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + } + } + else { + var disc = b * b - 4 * a * c; + if (isAroundZero(disc)) { + var t1 = -b / (2 * a); + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + } + else if (disc > 0) { + var discSqrt = Math.sqrt(disc); + var t1 = (-b + discSqrt) / (2 * a); + var t2 = (-b - discSqrt) / (2 * a); + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + if (t2 >= 0 && t2 <= 1) { + roots[n++] = t2; + } + } + } + return n; + } + + /** + * 计算二次贝塞尔方程极限值 + * @memberOf module:zrender/tool/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @return {number} + */ + function quadraticExtremum(p0, p1, p2) { + var divider = p0 + p2 - 2 * p1; + if (divider === 0) { + // p1 is center of p0 and p2 + return 0.5; + } + else { + return (p0 - p1) / divider; + } + } + + /** + * 投射点到二次贝塞尔曲线上,返回投射距离。 + * 投射点有可能会有一个或者多个,这里只返回其中距离最短的一个。 + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @param {number} x + * @param {number} y + * @param {Array.} out 投射点 + * @return {number} + */ + function quadraticProjectPoint( + x0, y0, x1, y1, x2, y2, + x, y, out + ) { + // http://pomax.github.io/bezierinfo/#projections + var t; + var interval = 0.005; + var d = Infinity; + + _v0[0] = x; + _v0[1] = y; + + // 先粗略估计一下可能的最小距离的 t 值 + // PENDING + for (var _t = 0; _t < 1; _t += 0.05) { + _v1[0] = quadraticAt(x0, x1, x2, _t); + _v1[1] = quadraticAt(y0, y1, y2, _t); + var d1 = vector.distSquare(_v0, _v1); + if (d1 < d) { + t = _t; + d = d1; + } + } + d = Infinity; + + // At most 32 iteration + for (var i = 0; i < 32; i++) { + if (interval < EPSILON) { + break; + } + var prev = t - interval; + var next = t + interval; + // t - interval + _v1[0] = quadraticAt(x0, x1, x2, prev); + _v1[1] = quadraticAt(y0, y1, y2, prev); + + var d1 = vector.distSquare(_v1, _v0); + + if (prev >= 0 && d1 < d) { + t = prev; + d = d1; + } + else { + // t + interval + _v2[0] = quadraticAt(x0, x1, x2, next); + _v2[1] = quadraticAt(y0, y1, y2, next); + var d2 = vector.distSquare(_v2, _v0); + if (next <= 1 && d2 < d) { + t = next; + d = d2; + } + else { + interval *= 0.5; + } + } + } + // t + if (out) { + out[0] = quadraticAt(x0, x1, x2, t); + out[1] = quadraticAt(y0, y1, y2, t); + } + // console.log(interval, i); + return Math.sqrt(d); + } + + return { + + cubicAt: cubicAt, + + cubicDerivativeAt: cubicDerivativeAt, + + cubicRootAt: cubicRootAt, + + cubicExtrema: cubicExtrema, + + cubicSubdivide: cubicSubdivide, + + cubicProjectPoint: cubicProjectPoint, + + quadraticAt: quadraticAt, + + quadraticDerivativeAt: quadraticDerivativeAt, + + quadraticRootAt: quadraticRootAt, + + quadraticExtremum: quadraticExtremum, + + quadraticProjectPoint: quadraticProjectPoint + }; +}); \ No newline at end of file diff --git a/amd/zrender/tool/env.js b/amd/zrender/tool/env.js index d6b2531..a53015c 100644 --- a/amd/zrender/tool/env.js +++ b/amd/zrender/tool/env.js @@ -10,7 +10,7 @@ define(function() { // (c) 2010-2013 Thomas Fuchs // Zepto.js may be freely distributed under the MIT license. - function detect( ua ) { + function detect(ua) { var os = this.os = {}; var browser = this.browser = {}; var webkit = ua.match(/Web[kK]it[\/]{0,1}([\d.]+)/); @@ -70,11 +70,11 @@ define(function() { return { browser: browser, os: os, - // 原生canvas支持 - canvasSupported : document.createElement('canvas').getContext - ? true : false - } + // 原生canvas支持,改极端点了 + // canvasSupported : !(browser.ie && parseFloat(browser.version) < 9) + canvasSupported : document.createElement('canvas').getContext ? true : false + }; } - return detect( navigator.userAgent ); + return detect(navigator.userAgent); }); \ No newline at end of file diff --git a/amd/zrender/tool/event.js b/amd/zrender/tool/event.js index e47fb3d..c3b9c73 100644 --- a/amd/zrender/tool/event.js +++ b/amd/zrender/tool/event.js @@ -1,270 +1,77 @@ -/** - * zrender: 事件辅助类 - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * getX:获取事件横坐标 - * getY:或者事件纵坐标 - * getDelta:或者鼠标滚轮变化 - * stop:停止事件传播 - * Dispatcher:事件分发器 - */ -define( - function() { - - 'use strict'; - - /** - * 提取鼠标(手指)x坐标 - * - * @param {Event} e 事件. - * @return {number} 鼠标(手指)x坐标. - */ - function getX(e) { - return typeof e.zrenderX != 'undefined' && e.zrenderX - || typeof e.offsetX != 'undefined' && e.offsetX - || typeof e.layerX != 'undefined' && e.layerX - || typeof e.clientX != 'undefined' && e.clientX; - } - - /** - * 提取鼠标y坐标 - * - * @param {Event} e 事件. - * @return {number} 鼠标(手指)y坐标. - */ - function getY(e) { - return typeof e.zrenderY != 'undefined' && e.zrenderY - || typeof e.offsetY != 'undefined' && e.offsetY - || typeof e.layerY != 'undefined' && e.layerY - || typeof e.clientY != 'undefined' && e.clientY; - } - - /** - * 提取鼠标滚轮变化 - * - * @param {Event} e 事件. - * @return {number} 滚轮变化,正值说明滚轮是向上滚动,如果是负值说明滚轮是向下滚动 - */ - function getDelta(e) { - return typeof e.wheelDelta != 'undefined' && e.wheelDelta - || typeof e.detail != 'undefined' && -e.detail; - } - - /** - * 停止冒泡和阻止默认行为 - * - * @type {Function} - * @param {Event} e : event对象 - */ - var stop = typeof window.addEventListener === 'function' - ? function (e) { - e.preventDefault(); - e.stopPropagation(); - } - : function (e) { - e.returnValue = false; - e.cancelBubble = true; - }; - - /** - * 事件分发器 - */ - function Dispatcher() { - this._handlers = {}; - } - /** - * 单次触发绑定,dispatch后销毁 - * - * @param {string} event 事件字符串 - * @param {Function} handler 响应函数 - * @param {Object} [context] - */ - Dispatcher.prototype.one = function(event, handler, context) { - - var _h = this._handlers; - - if(!handler || !event) { - return this; - } - - if(!_h[event]) { - _h[event] = []; - } - - _h[event].push({ - h : handler, - one : true, - ctx: context || this - }); - - return this; - }; - - /** - * 事件绑定 - * - * @param {string} event 事件字符串 - * @param {Function} handler : 响应函数 - * @param {Object} [context] - */ - Dispatcher.prototype.bind = function(event, handler, context) { - - var _h = this._handlers; - - if(!handler || !event) { - return this; - } - - if(!_h[event]) { - _h[event] = []; - } - - _h[event].push({ - h : handler, - one : false, - ctx: context || this - }); - - return this; - }; - - /** - * 事件解绑定 - * - * @param {string} event 事件字符串 - * @param {Function} handler : 响应函数 - */ - Dispatcher.prototype.unbind = function(event, handler) { - - var _h = this._handlers; - - if(!event) { - this._handlers = {}; - return this; - } - - if(handler) { - if(_h[event]) { - var newList = []; - for (var i = 0, l = _h[event].length; i < l; i++) { - if (_h[event][i]['h'] != handler) { - newList.push(_h[event][i]); - } - } - _h[event] = newList; - } - - if(_h[event] && _h[event].length === 0) { - delete _h[event]; - } - } - else { - delete _h[event]; - } - - return this; - }; - - /** - * 事件分发 - * - * @param {string} type : 事件类型 - */ - Dispatcher.prototype.dispatch = function(type) { - var args = arguments; - var argLen = args.length; - - if (argLen > 3) { - args = Array.prototype.slice.call(args, 1); - } - - if(this._handlers[type]) { - var _h = this._handlers[type]; - var len = _h.length; - for (var i = 0; i < len;) { - // Optimize advise from backbone - switch (argLen) { - case 1: - _h[i]['h'].call(_h[i]['ctx']); - break; - case 2: - _h[i]['h'].call(_h[i]['ctx'], args[1]); - break; - case 3: - _h[i]['h'].call(_h[i]['ctx'], args[1], args[2]); - break; - default: - // have more than 2 given arguments - _h[i]['h'].apply(_h[i]['ctx'], args); - break; - } - - if (_h[i]['one']) { - _h.splice(i, 1); - len--; - } else { - i++; - } - } - } - - return this; - }; - - /** - * 带有context的事件分发, 最后一个参数是事件回调的context - * - * @param {string} type : 事件类型 - */ - Dispatcher.prototype.dispatchWithContext = function(type) { - var args = arguments; - var argLen = args.length; - - if (argLen > 4) { - args = Array.prototype.slice.call(args, 1, args.length - 1); - } - var ctx = args[args.length - 1]; - - if(this._handlers[type]) { - var _h = this._handlers[type]; - var len = _h.length; - for (var i = 0; i < len;) { - // Optimize advise from backbone - switch (argLen) { - case 1: - _h[i]['h'].call(ctx); - break; - case 2: - _h[i]['h'].call(ctx, args[1]); - break; - case 3: - _h[i]['h'].call(ctx, args[1], args[2]); - break; - default: - // have more than 2 given arguments - _h[i]['h'].apply(ctx, args); - break; - } - - if (_h[i]['one']) { - _h.splice(i, 1); - len--; - } else { - i++; - } - } - } - - return this; - }; - - return { - getX : getX, - getY : getY, - getDelta : getDelta, - stop : stop, - Dispatcher : Dispatcher - }; - } -); +/** + * 事件辅助类 + * @module zrender/tool/event + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + */ +define( + function(require) { + + 'use strict'; + + var Eventful = require('../mixin/Eventful'); + + /** + * 提取鼠标(手指)x坐标 + * @memberOf module:zrender/tool/event + * @param {Event} e 事件. + * @return {number} 鼠标(手指)x坐标. + */ + function getX(e) { + return typeof e.zrenderX != 'undefined' && e.zrenderX + || typeof e.offsetX != 'undefined' && e.offsetX + || typeof e.layerX != 'undefined' && e.layerX + || typeof e.clientX != 'undefined' && e.clientX; + } + + /** + * 提取鼠标y坐标 + * @memberOf module:zrender/tool/event + * @param {Event} e 事件. + * @return {number} 鼠标(手指)y坐标. + */ + function getY(e) { + return typeof e.zrenderY != 'undefined' && e.zrenderY + || typeof e.offsetY != 'undefined' && e.offsetY + || typeof e.layerY != 'undefined' && e.layerY + || typeof e.clientY != 'undefined' && e.clientY; + } + + /** + * 提取鼠标滚轮变化 + * @memberOf module:zrender/tool/event + * @param {Event} e 事件. + * @return {number} 滚轮变化,正值说明滚轮是向上滚动,如果是负值说明滚轮是向下滚动 + */ + function getDelta(e) { + return typeof e.zrenderDelta != 'undefined' && e.zrenderDelta + || typeof e.wheelDelta != 'undefined' && e.wheelDelta + || typeof e.detail != 'undefined' && -e.detail; + } + + /** + * 停止冒泡和阻止默认行为 + * @memberOf module:zrender/tool/event + * @method + * @param {Event} e : event对象 + */ + var stop = typeof window.addEventListener === 'function' + ? function (e) { + e.preventDefault(); + e.stopPropagation(); + e.cancelBubble = true; + } + : function (e) { + e.returnValue = false; + e.cancelBubble = true; + }; + + return { + getX : getX, + getY : getY, + getDelta : getDelta, + stop : stop, + // 做向上兼容 + Dispatcher : Eventful + }; + } +); diff --git a/amd/zrender/tool/http.js b/amd/zrender/tool/http.js new file mode 100644 index 0000000..baa0c62 --- /dev/null +++ b/amd/zrender/tool/http.js @@ -0,0 +1,55 @@ +/** + * @module zrender/tool/http + */ +define(function(require) { + /** + * @typedef {Object} IHTTPGetOption + * @property {string} url + * @property {Function} onsuccess + * @property {Function} [onerror] + */ + + /** + * HTTP Get + * @param {string|IHTTPGetOption} url + * @param {Function} onsuccess + * @param {Function} [onerror] + * @param {Object} [opts] 额外参数 + */ + function get(url, onsuccess, onerror, opts) { + if (typeof(url) === 'object') { + var obj = url; + url = obj.url; + onsuccess = obj.onsuccess; + onerror = obj.onerror; + opts = obj; + } else { + if (typeof(onerror) === 'object') { + opts = onerror; + } + } + /* jshint ignore:start */ + var xhr = window.XMLHttpRequest + ? new XMLHttpRequest() + : new ActiveXObject('Microsoft.XMLHTTP'); + xhr.open('GET', url, true); + xhr.onreadystatechange = function() { + if (xhr.readyState == 4) { + if (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) { + onsuccess && onsuccess(xhr.responseText); + } else { + onerror && onerror(); + } + xhr.onreadystatechange = new Function(); + xhr = null; + } + }; + + xhr.send(null); + /* jshint ignore:end */ + } + + return { + get: get + }; +}); \ No newline at end of file diff --git a/amd/zrender/tool/log.js b/amd/zrender/tool/log.js index 5b982db..3417ebb 100644 --- a/amd/zrender/tool/log.js +++ b/amd/zrender/tool/log.js @@ -1,13 +1,11 @@ -/** - * zrender: 日志记录 - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - */ - define( function (require) { var config = require('../config'); + /** + * @exports zrender/tool/log + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + */ return function() { if (config.debugMode === 0) { return; diff --git a/amd/zrender/tool/math.js b/amd/zrender/tool/math.js index aaf9ff3..4f32274 100644 --- a/amd/zrender/tool/math.js +++ b/amd/zrender/tool/math.js @@ -1,73 +1,55 @@ -/** - * zrender: 数学辅助类 - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * sin:正弦函数,自动缓存 - * cos:余弦函数,自动缓存 - * degreeToRadian:角度转弧度 - * radianToDegree:弧度转角度 - */ -define( - function() { - /* - var _cache = { - sin : {}, //sin缓存 - cos : {} //cos缓存 - }; - */ - var _radians = Math.PI / 180; - - /** - * @param angle 弧度(角度)参数 - * @param isDegrees angle参数是否为角度计算,默认为false,angle为以弧度计量的角度 - */ - function sin(angle, isDegrees) { - return Math.sin(isDegrees ? angle * _radians : angle); - /* - angle = (isDegrees ? angle * _radians : angle).toFixed(4); - if(typeof _cache.sin[angle] == 'undefined') { - _cache.sin[angle] = Math.sin(angle); - } - return _cache.sin[angle]; - */ - } - - /** - * @param radians 弧度参数 - */ - function cos(angle, isDegrees) { - return Math.cos(isDegrees ? angle * _radians : angle); - /* - angle = (isDegrees ? angle * _radians : angle).toFixed(4); - if(typeof _cache.cos[angle] == 'undefined') { - _cache.cos[angle] = Math.cos(angle); - } - return _cache.cos[angle]; - */ - } - - /** - * 角度转弧度 - * @param {Object} angle - */ - function degreeToRadian(angle) { - return angle * _radians; - } - - /** - * 弧度转角度 - * @param {Object} angle - */ - function radianToDegree(angle) { - return angle / _radians; - } - - return { - sin : sin, - cos : cos, - degreeToRadian : degreeToRadian, - radianToDegree : radianToDegree - }; - } -); \ No newline at end of file +/** + * zrender: 数学辅助类 + * + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + * + * sin:正弦函数 + * cos:余弦函数 + * degreeToRadian:角度转弧度 + * radianToDegree:弧度转角度 + */ +define( + function () { + + var _radians = Math.PI / 180; + + /** + * @param {number} angle 弧度(角度)参数 + * @param {boolean} isDegrees angle参数是否为角度计算,默认为false,angle为以弧度计量的角度 + */ + function sin(angle, isDegrees) { + return Math.sin(isDegrees ? angle * _radians : angle); + } + + /** + * @param {number} angle 弧度(角度)参数 + * @param {boolean} isDegrees angle参数是否为角度计算,默认为false,angle为以弧度计量的角度 + */ + function cos(angle, isDegrees) { + return Math.cos(isDegrees ? angle * _radians : angle); + } + + /** + * 角度转弧度 + * @param {Object} angle + */ + function degreeToRadian(angle) { + return angle * _radians; + } + + /** + * 弧度转角度 + * @param {Object} angle + */ + function radianToDegree(angle) { + return angle / _radians; + } + + return { + sin : sin, + cos : cos, + degreeToRadian : degreeToRadian, + radianToDegree : radianToDegree + }; + } +); diff --git a/amd/zrender/tool/matrix.js b/amd/zrender/tool/matrix.js index 53d1db2..edcf888 100644 --- a/amd/zrender/tool/matrix.js +++ b/amd/zrender/tool/matrix.js @@ -1,23 +1,28 @@ -/** - * zrender: 3x2矩阵操作类 - * - * author: https://github.com/pissang - */ - define( - function() { + function () { var ArrayCtor = typeof Float32Array === 'undefined' ? Array : Float32Array; - + /** + * 3x2矩阵操作类 + * @exports zrender/tool/matrix + */ var matrix = { + /** + * 创建一个单位矩阵 + * @return {Float32Array|Array.} + */ create : function() { var out = new ArrayCtor(6); matrix.identity(out); return out; }, + /** + * 设置矩阵为单位矩阵 + * @param {Float32Array|Array.} out + */ identity : function(out) { out[0] = 1; out[1] = 0; @@ -25,7 +30,13 @@ define( out[3] = 1; out[4] = 0; out[5] = 0; + return out; }, + /** + * 复制矩阵 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} m + */ copy: function(out, m) { out[0] = m[0]; out[1] = m[1]; @@ -33,16 +44,29 @@ define( out[3] = m[3]; out[4] = m[4]; out[5] = m[5]; + return out; }, - mul : function(out, m1, m2) { - out[0] = m1[0] * m2[0] + m1[2] * m2[1]; - out[1] = m1[1] * m2[0] + m1[3] * m2[1]; - out[2] = m1[0] * m2[2] + m1[2] * m2[3]; - out[3] = m1[1] * m2[2] + m1[3] * m2[3]; - out[4] = m1[0] * m2[4] + m1[2] * m2[5] + m1[4]; - out[5] = m1[1] * m2[4] + m1[3] * m2[5] + m1[5]; - return out; + /** + * 矩阵相乘 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} m1 + * @param {Float32Array|Array.} m2 + */ + mul : function (out, m1, m2) { + out[0] = m1[0] * m2[0] + m1[2] * m2[1]; + out[1] = m1[1] * m2[0] + m1[3] * m2[1]; + out[2] = m1[0] * m2[2] + m1[2] * m2[3]; + out[3] = m1[1] * m2[2] + m1[3] * m2[3]; + out[4] = m1[0] * m2[4] + m1[2] * m2[5] + m1[4]; + out[5] = m1[1] * m2[4] + m1[3] * m2[5] + m1[5]; + return out; }, + /** + * 平移变换 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} a + * @param {Float32Array|Array.} v + */ translate : function(out, a, v) { out[0] = a[0]; out[1] = a[1]; @@ -52,22 +76,39 @@ define( out[5] = a[5] + v[1]; return out; }, + /** + * 旋转变换 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} a + * @param {number} rad + */ rotate : function(out, a, rad) { - var aa = a[0], ac = a[2], atx = a[4]; - var ab = a[1], ad = a[3], aty = a[5]; + var aa = a[0]; + var ac = a[2]; + var atx = a[4]; + var ab = a[1]; + var ad = a[3]; + var aty = a[5]; var st = Math.sin(rad); var ct = Math.cos(rad); - out[0] = aa*ct + ab*st; - out[1] = -aa*st + ab*ct; - out[2] = ac*ct + ad*st; - out[3] = -ac*st + ct*ad; - out[4] = ct*atx + st*aty; - out[5] = ct*aty - st*atx; + out[0] = aa * ct + ab * st; + out[1] = -aa * st + ab * ct; + out[2] = ac * ct + ad * st; + out[3] = -ac * st + ct * ad; + out[4] = ct * atx + st * aty; + out[5] = ct * aty - st * atx; return out; }, + /** + * 缩放变换 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} a + * @param {Float32Array|Array.} v + */ scale : function(out, a, v) { - var vx = v[0], vy = v[1]; + var vx = v[0]; + var vy = v[1]; out[0] = a[0] * vx; out[1] = a[1] * vy; out[2] = a[2] * vx; @@ -78,14 +119,20 @@ define( }, /** * 求逆矩阵 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} a */ invert : function(out, a) { - var aa = a[0], ac = a[2], atx = a[4]; - var ab = a[1], ad = a[3], aty = a[5]; + var aa = a[0]; + var ac = a[2]; + var atx = a[4]; + var ab = a[1]; + var ad = a[3]; + var aty = a[5]; var det = aa * ad - ab * ac; - if(!det){ + if (!det) { return null; } det = 1.0 / det; @@ -101,10 +148,17 @@ define( /** * 矩阵左乘向量 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} a + * @param {Float32Array|Array.} v */ mulVector : function(out, a, v) { - var aa = a[0], ac = a[2], atx = a[4]; - var ab = a[1], ad = a[3], aty = a[5]; + var aa = a[0]; + var ac = a[2]; + var atx = a[4]; + var ab = a[1]; + var ad = a[3]; + var aty = a[5]; out[0] = v[0] * aa + v[1] * ac + atx; out[1] = v[0] * ab + v[1] * ad + aty; @@ -115,4 +169,4 @@ define( return matrix; } -); \ No newline at end of file +); diff --git a/amd/zrender/tool/util.js b/amd/zrender/tool/util.js index ac3cbb3..9cf5b79 100644 --- a/amd/zrender/tool/util.js +++ b/amd/zrender/tool/util.js @@ -1,224 +1,240 @@ -/** - * zrender: 公共辅助函数 - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * clone:深度克隆 - * merge:合并源对象的属性到目标对象 - * getContext:获取一个自由使用的canvas 2D context,使用原生方法,如isPointInPath,measureText等 - */ -define( - function(require) { - // 用于处理merge时无法遍历Date等对象的问题 - var BUILTIN_OBJECT = { - '[object Function]': 1, - '[object RegExp]': 1, - '[object Date]': 1, - '[object Error]': 1, - '[object CanvasGradient]': 1 - }; - - /** - * 对一个object进行深度拷贝 - * - * @param {Any} source 需要进行拷贝的对象 - * @return {Any} 拷贝后的新对象 - */ - function clone(source) { - if (typeof source == 'object' && source !== null) { - var result = source; - if (source instanceof Array) { - result = []; - for (var i = 0, len = source.length; i < len; i++) { - result[i] = clone(source[i]); - } - } - else if (!BUILTIN_OBJECT[Object.prototype.toString.call(source)]) { - result = {}; - for (var key in source) { - if (source.hasOwnProperty(key)) { - result[key] = clone(source[key]); - } - } - } - - return result; - } - - return source; - } - - function mergeItem(target, source, key, overwrite) { - if (source.hasOwnProperty(key)) { - if (typeof target[key] == 'object' - && !BUILTIN_OBJECT[ Object.prototype.toString.call(target[key]) ] - ) { - // 如果需要递归覆盖,就递归调用merge - merge( - target[key], - source[key], - overwrite - ); - } - else if (overwrite || !(key in target)) { - // 否则只处理overwrite为true,或者在目标对象中没有此属性的情况 - target[key] = source[key]; - } - } - } - - /** - * 合并源对象的属性到目标对象 - * modify from Tangram - * @param {*} target 目标对象 - * @param {*} source 源对象 - * @param {boolean} overwrite 是否覆盖 - */ - function merge(target, source, overwrite) { - for (var i in source) { - mergeItem(target, source, i, overwrite); - } - - return target; - } - - var _ctx; - - function getContext() { - if (!_ctx) { - require('../lib/excanvas'); - if (G_vmlCanvasManager) { - var _div = document.createElement('div'); - _div.style.position = 'absolute'; - _div.style.top = '-1000px'; - document.body.appendChild(_div); - - _ctx = G_vmlCanvasManager.initElement(_div) - .getContext('2d'); - } - else { - _ctx = document.createElement('canvas').getContext('2d'); - } - } - return _ctx; - } - - var _canvas; - var _pixelCtx; - var _width; - var _height; - var _offsetX = 0; - var _offsetY = 0; - - /** - * 获取像素拾取专用的上下文 - * @return {Object} 上下文 - */ - function getPixelContext() { - if (!_pixelCtx) { - _canvas = document.createElement('canvas'); - _width = _canvas.width; - _height = _canvas.height; - _pixelCtx = _canvas.getContext('2d'); - } - return _pixelCtx; - } - - /** - * 如果坐标处在_canvas外部,改变_canvas的大小 - * @param {number} x : 横坐标 - * @param {number} y : 纵坐标 - * 注意 修改canvas的大小 需要重新设置translate - */ - function adjustCanvasSize(x, y) { - // 每次加的长度 - var _v = 100; - var _flag; - - if (x + _offsetX > _width) { - _width = x + _offsetX + _v; - _canvas.width = _width; - _flag = true; - } - - if (y + _offsetY > _height) { - _height = y + _offsetY + _v; - _canvas.height = _height; - _flag = true; - } - - if (x < -_offsetX) { - _offsetX = Math.ceil(-x / _v) * _v; - _width += _offsetX; - _canvas.width = _width; - _flag = true; - } - - if (y < -_offsetY) { - _offsetY = Math.ceil(-y / _v) * _v; - _height += _offsetY; - _canvas.height = _height; - _flag = true; - } - - if (_flag) { - _pixelCtx.translate(_offsetX, _offsetY); - } - } - - /** - * 获取像素canvas的偏移量 - * @return {Object} 偏移量 - */ - function getPixelOffset() { - return { - x : _offsetX, - y : _offsetY - }; - } - - /** - * 查询数组中元素的index - */ - function indexOf(array, value){ - if (array.indexOf) { - return array.indexOf(value); - } - for(var i = 0, len=array.length; i _width) { + _width = x + _offsetX + _v; + _canvas.width = _width; + _flag = true; + } + + if (y + _offsetY > _height) { + _height = y + _offsetY + _v; + _canvas.height = _height; + _flag = true; + } + + if (x < -_offsetX) { + _offsetX = Math.ceil(-x / _v) * _v; + _width += _offsetX; + _canvas.width = _width; + _flag = true; + } + + if (y < -_offsetY) { + _offsetY = Math.ceil(-y / _v) * _v; + _height += _offsetY; + _canvas.height = _height; + _flag = true; + } + + if (_flag) { + _pixelCtx.translate(_offsetX, _offsetY); + } + } + + /** + * 获取像素canvas的偏移量 + * @return {Object} 偏移量 + */ + function getPixelOffset() { + return { + x : _offsetX, + y : _offsetY + }; + } + + /** + * 查询数组中元素的index + */ + function indexOf(array, value) { + if (array.indexOf) { + return array.indexOf(value); + } + for (var i = 0, len = array.length; i < len; i++) { + if (array[i] === value) { + return i; + } + } + return -1; + } + + /** + * 构造类继承关系 + * + * @param {Function} clazz 源类 + * @param {Function} baseClazz 基类 + */ + function inherits(clazz, baseClazz) { + var clazzPrototype = clazz.prototype; + function F() {} + F.prototype = baseClazz.prototype; + clazz.prototype = new F(); + + for (var prop in clazzPrototype) { + clazz.prototype[prop] = clazzPrototype[prop]; + } + clazz.constructor = clazz; + } + + return { + inherits: inherits, + clone : clone, + merge : merge, + getContext : getContext, + getPixelContext : getPixelContext, + getPixelOffset : getPixelOffset, + adjustCanvasSize : adjustCanvasSize, + indexOf : indexOf + }; + } +); diff --git a/amd/zrender/tool/vector.js b/amd/zrender/tool/vector.js index 284300f..5a34f94 100644 --- a/amd/zrender/tool/vector.js +++ b/amd/zrender/tool/vector.js @@ -1,101 +1,265 @@ -/** - * zrender: 向量操作类 - * - * author : https://github.com/pissang - */ define( - function() { + function () { var ArrayCtor = typeof Float32Array === 'undefined' ? Array : Float32Array; - + + /** + * @typedef {Float32Array|Array.} Vector2 + */ + /** + * 二维向量类 + * @exports zrender/tool/vector + */ var vector = { - create : function(x, y) { + /** + * 创建一个向量 + * @param {number} [x=0] + * @param {number} [y=0] + * @return {Vector2} + */ + create: function (x, y) { var out = new ArrayCtor(2); out[0] = x || 0; out[1] = y || 0; return out; }, - copy : function(out, v) { + + /** + * 复制一个向量 + * @return {Vector2} out + * @return {Vector2} v + */ + copy: function (out, v) { out[0] = v[0]; out[1] = v[1]; + return out; }, - set : function(out, a, b) { + + /** + * 设置向量的两个项 + * @param {Vector2} out + * @param {number} a + * @param {number} b + * @return {Vector2} 结果 + */ + set: function (out, a, b) { out[0] = a; out[1] = b; + return out; }, - add : function(out, v1, v2) { + + /** + * 向量相加 + * @param {Vector2} out + * @param {Vector2} v1 + * @param {Vector2} v2 + */ + add: function (out, v1, v2) { out[0] = v1[0] + v2[0]; out[1] = v1[1] + v2[1]; return out; }, - scaleAndAdd : function(out, v1, v2, a) { + + /** + * 向量缩放后相加 + * @param {Vector2} out + * @param {Vector2} v1 + * @param {Vector2} v2 + * @param {number} a + */ + scaleAndAdd: function (out, v1, v2, a) { out[0] = v1[0] + v2[0] * a; out[1] = v1[1] + v2[1] * a; return out; }, - sub : function(out, v1, v2) { + + /** + * 向量相减 + * @param {Vector2} out + * @param {Vector2} v1 + * @param {Vector2} v2 + */ + sub: function (out, v1, v2) { out[0] = v1[0] - v2[0]; out[1] = v1[1] - v2[1]; return out; }, - length : function(v) { - return Math.sqrt(this.lengthSquare(v)); + + /** + * 向量长度 + * @param {Vector2} v + * @return {number} + */ + len: function (v) { + return Math.sqrt(this.lenSquare(v)); }, - lengthSquare : function(v) { + + /** + * 向量长度平方 + * @param {Vector2} v + * @return {number} + */ + lenSquare: function (v) { return v[0] * v[0] + v[1] * v[1]; }, - mul : function(out, v1, v2) { + + /** + * 向量乘法 + * @param {Vector2} out + * @param {Vector2} v1 + * @param {Vector2} v2 + */ + mul: function (out, v1, v2) { out[0] = v1[0] * v2[0]; out[1] = v1[1] * v2[1]; return out; }, - dot : function(v1, v2) { + + /** + * 向量除法 + * @param {Vector2} out + * @param {Vector2} v1 + * @param {Vector2} v2 + */ + div: function (out, v1, v2) { + out[0] = v1[0] / v2[0]; + out[1] = v1[1] / v2[1]; + return out; + }, + + /** + * 向量点乘 + * @param {Vector2} v1 + * @param {Vector2} v2 + * @return {number} + */ + dot: function (v1, v2) { return v1[0] * v2[0] + v1[1] * v2[1]; }, - scale : function(out, v, s) { + + /** + * 向量缩放 + * @param {Vector2} out + * @param {Vector2} v + * @param {number} s + */ + scale: function (out, v, s) { out[0] = v[0] * s; out[1] = v[1] * s; return out; }, - normalize : function(out, v) { - var d = vector.length(v); - if(d === 0){ + + /** + * 向量归一化 + * @param {Vector2} out + * @param {Vector2} v + */ + normalize: function (out, v) { + var d = vector.len(v); + if (d === 0) { out[0] = 0; out[1] = 0; - }else{ - out[0] = v[0]/d; - out[1] = v[1]/d; + } + else { + out[0] = v[0] / d; + out[1] = v[1] / d; } return out; }, - distance : function(v1, v2) { + + /** + * 计算向量间距离 + * @param {Vector2} v1 + * @param {Vector2} v2 + * @return {number} + */ + distance: function (v1, v2) { return Math.sqrt( - (v1[0] - v2[0]) * (v1[0] - v2[0]) + - (v1[1] - v2[1]) * (v1[1] - v2[1]) + (v1[0] - v2[0]) * (v1[0] - v2[0]) + + (v1[1] - v2[1]) * (v1[1] - v2[1]) ); }, - negate : function(out, v) { + + /** + * 向量距离平方 + * @param {Vector2} v1 + * @param {Vector2} v2 + * @return {number} + */ + distanceSquare: function (v1, v2) { + return (v1[0] - v2[0]) * (v1[0] - v2[0]) + + (v1[1] - v2[1]) * (v1[1] - v2[1]); + }, + + /** + * 求负向量 + * @param {Vector2} out + * @param {Vector2} v + */ + negate: function (out, v) { out[0] = -v[0]; out[1] = -v[1]; + return out; }, - middle : function(out, v1, v2) { - out[0] = (v1[0] + v2[0])/2; - out[1] = (v1[1] + v2[1])/2; + + /** + * 插值两个点 + * @param {Vector2} out + * @param {Vector2} v1 + * @param {Vector2} v2 + * @param {number} t + */ + lerp: function (out, v1, v2, t) { + // var ax = v1[0]; + // var ay = v1[1]; + out[0] = v1[0] + t * (v2[0] - v1[0]); + out[1] = v1[1] + t * (v2[1] - v1[1]); return out; }, - applyTransform: function(out, v, m) { + + /** + * 矩阵左乘向量 + * @param {Vector2} out + * @param {Vector2} v + * @param {Vector2} m + */ + applyTransform: function (out, v, m) { var x = v[0]; var y = v[1]; out[0] = m[0] * x + m[2] * y + m[4]; out[1] = m[1] * x + m[3] * y + m[5]; return out; + }, + /** + * 求两个向量最小值 + * @param {Vector2} out + * @param {Vector2} v1 + * @param {Vector2} v2 + */ + min: function (out, v1, v2) { + out[0] = Math.min(v1[0], v2[0]); + out[1] = Math.min(v1[1], v2[1]); + return out; + }, + /** + * 求两个向量最大值 + * @param {Vector2} out + * @param {Vector2} v1 + * @param {Vector2} v2 + */ + max: function (out, v1, v2) { + out[0] = Math.max(v1[0], v2[0]); + out[1] = Math.max(v1[1], v2[1]); + return out; } }; - vector.len = vector.length; + vector.length = vector.len; + vector.lengthSquare = vector.lenSquare; vector.dist = vector.distance; - + vector.distSquare = vector.distanceSquare; + return vector; } -); \ No newline at end of file +); diff --git a/amd/zrender/zrender.js b/amd/zrender/zrender.js index c14121a..7663e6f 100644 --- a/amd/zrender/zrender.js +++ b/amd/zrender/zrender.js @@ -1,487 +1,517 @@ -/*! - * ZRender, a lightweight canvas library with a MVC architecture, data-driven - * and provides an event model like DOM. - * - * Copyright (c) 2013, Baidu Inc. - * All rights reserved. - * - * LICENSE - * https://github.com/ecomfe/zrender/blob/master/LICENSE.txt - */ - -/** - * zrender: core核心类 - * - * @desc zrender是一个轻量级的Canvas类库,MVC封装,数据驱动,提供类Dom事件模型。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define( - function(require) { - /* - * HTML5 Canvas for Internet Explorer! - * Modern browsers like Firefox, Safari, Chrome and Opera support - * the HTML5 canvas tag to allow 2D command-based drawing. - * ExplorerCanvas brings the same functionality to Internet Explorer. - * To use, web developers only need to include a single script tag - * in their existing web pages. - * - * https://code.google.com/p/explorercanvas/ - * http://explorercanvas.googlecode.com/svn/trunk/excanvas.js - */ - // 核心代码会生成一个全局变量 G_vmlCanvasManager,模块改造后借用于快速判断canvas支持 - require('./lib/excanvas'); - - var util = require('./tool/util'); - var log = require('./tool/log'); - var guid = require('./tool/guid'); - - var Handler = require('./Handler'); - var Painter = require('./Painter'); - var Storage = require('./Storage'); - var Animation = require('./animation/Animation'); - - var _instances = {}; //ZRender实例map索引 - - var zrender = {}; - zrender.version = '2.0.2'; - - /** - * zrender初始化 - * 不让外部直接new ZRender实例,为啥? - * 不为啥,提供全局可控同时减少全局污染和降低命名冲突的风险! - * - * @param {HTMLElement} dom dom对象,不帮你做document.getElementById了 - * @param {Object=} params 个性化参数,如自定义shape集合,带进来就好 - * - * @return {ZRender} ZRender实例 - */ - zrender.init = function(dom, params) { - var zi = new ZRender(guid(), dom, params || {}); - _instances[zi.id] = zi; - return zi; - }; - - /** - * zrender实例销毁,记在_instances里的索引也会删除了 - * 管生就得管死,可以通过zrender.dispose(zi)销毁指定ZRender实例 - * 当然也可以直接zi.dispose()自己销毁 - * - * @param {ZRender=} zi ZRender对象,不传则销毁全部 - */ - zrender.dispose = function (zi) { - if (zi) { - zi.dispose(); - } - else { - for (var key in _instances) { - _instances[key].dispose(); - } - _instances = {}; - } - - return zrender; - }; - - /** - * 获取zrender实例 - * - * @param {string} id ZRender对象索引 - */ - zrender.getInstance = function (id) { - return _instances[id]; - }; - - /** - * 删除zrender实例,ZRender实例dispose时会调用, - * 删除后getInstance则返回undefined - * ps: 仅是删除,删除的实例不代表已经dispose了~~ - * 这是一个摆脱全局zrender.dispose()自动销毁的后门, - * take care of yourself~ - * - * @param {string} id ZRender对象索引 - */ - zrender.delInstance = function (id) { - delete _instances[id]; - return zrender; - }; - - function getFrameCallback(zrInstance) { - return function(){ - var animatingShapes = zrInstance.animatingShapes; - for (var i = 0, l = animatingShapes.length; i < l; i++) { - zrInstance.storage.mod(animatingShapes[i].id); - } - - if (animatingShapes.length || zrInstance._needsRefreshNextFrame) { - zrInstance.refresh(); - } - }; - } - - /** - * ZRender接口类,对外可用的所有接口都在这里!! - * storage(M)、painter(V)、handler(C)为内部私有类,外部接口不可见 - * 非get接口统一返回支持链式调用~ - * - * @param {string} id 唯一标识 - * @param {HTMLElement} dom dom对象,不帮你做document.getElementById - * - * @return {ZRender} ZRender实例 - */ - function ZRender(id, dom) { - this.id = id; - this.env = require('./tool/env'); - - this.storage = new Storage(); - this.painter = new Painter(dom, this.storage); - this.handler = new Handler(dom, this.storage, this.painter); - - // 动画控制 - this.animatingShapes = []; - this.animation = new Animation({ - stage : { - update : getFrameCallback(this) - } - }); - this.animation.start(); - - this._needsRefreshNextFrame = false; - } - - /** - * 获取实例唯一标识 - */ - ZRender.prototype.getId = function () { - return this.id; - }; - - /** - * 添加图形形状到根节点 - * - * @param {zrender.shape.Base} shape 形状对象,可用属性全集,详见各shape - */ - ZRender.prototype.addShape = function (shape) { - this.storage.addRoot(shape); - return this; - }; - - /** - * 添加组到根节点 - * - * @param {zrender.shape.Group} group - */ - ZRender.prototype.addGroup = function(group) { - this.storage.addRoot(group); - return this; - }; - - /** - * 从根节点删除图形形状 - * - * @param {string} shapeId 形状对象唯一标识 - */ - ZRender.prototype.delShape = function (shapeId) { - this.storage.delRoot(shapeId); - return this; - }; - - /** - * 从根节点删除组 - * - * @param {string} groupId - */ - ZRender.prototype.delGroup = function (groupId) { - this.storage.delRoot(groupId); - return this; - }; - - /** - * 修改图形形状 - * - * @param {string} shapeId 形状对象唯一标识 - * @param {Object} shape 形状对象 - */ - ZRender.prototype.modShape = function (shapeId, shape) { - this.storage.mod(shapeId, shape); - return this; - }; - - /** - * 修改组 - * - * @param {string} shapeId - * @param {Object} group - */ - ZRender.prototype.modGroup = function (groupId, group) { - this.storage.mod(groupId, group); - return this; - }; - - /** - * 修改指定zlevel的绘制配置项,例如clearColor - * - * @param {string} zLevel - * @param {Object} config 配置对象, 目前支持clearColor - */ - ZRender.prototype.modLayer = function (zLevel, config) { - this.painter.modLayer(zLevel, config); - return this; - }; - - /** - * 添加额外高亮层显示,仅提供添加方法,每次刷新后高亮层图形均被清空 - * - * @param {Object} shape 形状对象 - */ - ZRender.prototype.addHoverShape = function (shape) { - this.storage.addHover(shape); - return this; - }; - - /** - * 渲染 - * - * @param {Function} callback 渲染结束后回调函数 - * todo:增加缓动函数 - */ - ZRender.prototype.render = function (callback) { - this.painter.render(callback); - this._needsRefreshNextFrame = false; - return this; - }; - - /** - * 视图更新 - * - * @param {Function} callback 视图更新后回调函数 - */ - ZRender.prototype.refresh = function (callback) { - this.painter.refresh(callback); - this._needsRefreshNextFrame = false; - return this; - }; - - // TODO - // 好像会有奇怪的问题 - ZRender.prototype.refreshNextFrame = function() { - this._needsRefreshNextFrame = true; - return this; - }; - - /** - * 高亮层更新 - * - * @param {Function} callback 视图更新后回调函数 - */ - ZRender.prototype.refreshHover = function (callback) { - this.painter.refreshHover(callback); - return this; - }; - - /** - * 视图更新 - * - * @param {Array} shapeList 需要更新的图形元素列表 - * @param {Function} callback 视图更新后回调函数 - */ - ZRender.prototype.update = function (shapeList, callback) { - this.painter.update(shapeList, callback); - return this; - }; - - ZRender.prototype.resize = function() { - this.painter.resize(); - return this; - }; - - /** - * 动画 - * - * @param {string} shapeId 形状对象唯一标识 - * @param {string} path 需要添加动画的属性获取路径,可以通过a.b.c来获取深层的属性 - * @param {boolean} loop 动画是否循环 - * @return {Object} 动画的Deferred对象 - * Example: - * zr.animate(circleId, 'style', false) - * .when(1000, { x: 10} ) - * .done(function(){ console.log('Animation done')}) - * .start() - */ - ZRender.prototype.animate = function (shapeId, path, loop) { - var shape = this.storage.get(shapeId); - if (shape) { - var target; - if (path) { - var pathSplitted = path.split('.'); - var prop = shape; - for (var i = 0, l = pathSplitted.length; i < l; i++) { - if (!prop) { - continue; - } - prop = prop[pathSplitted[i]]; - } - if (prop) { - target = prop; - } - } - else { - target = shape; - } - - if (!target) { - log( - 'Property "' - + path - + '" is not existed in shape ' - + shapeId - ); - return; - } - - var animatingShapes = this.animatingShapes; - if (typeof shape.__aniCount === 'undefined') { - // 正在进行的动画记数 - shape.__aniCount = 0; - } - if (shape.__aniCount === 0) { - animatingShapes.push(shape); - } - shape.__aniCount++; - - return this.animation.animate(target, {loop : loop}) - .done(function() { - shape.__aniCount --; - if (shape.__aniCount === 0) { - // 从animatingShapes里移除 - var idx = util.indexOf(animatingShapes, shape); - animatingShapes.splice(idx, 1); - } - }); - } - else { - log('Shape "'+ shapeId + '" not existed'); - } - }; - - /** - * 停止所有动画 - */ - ZRender.prototype.clearAnimation = function () { - this.animation.clear(); - }; - - /** - * loading显示 - * - * @param {Object=} loadingEffect loading效果对象 - */ - ZRender.prototype.showLoading = function (loadingEffect) { - this.painter.showLoading(loadingEffect); - return this; - }; - - /** - * loading结束 - */ - ZRender.prototype.hideLoading = function () { - this.painter.hideLoading(); - return this; - }; - - /** - * 获取视图宽度 - */ - ZRender.prototype.getWidth = function() { - return this.painter.getWidth(); - }; - - /** - * 获取视图高度 - */ - ZRender.prototype.getHeight = function() { - return this.painter.getHeight(); - }; - - /** - * 图像导出 - */ - ZRender.prototype.toDataURL = function(type, backgroundColor, args) { - return this.painter.toDataURL(type, backgroundColor, args); - }; - - /** - * 将常规shape转成image shape - */ - ZRender.prototype.shapeToImage = function(e, width, height) { - var id = guid(); - return this.painter.shapeToImage(id, e, width, height); - }; - - /** - * 事件绑定 - * - * @param {string} eventName 事件名称 - * @param {Function} eventHandler 响应函数 - */ - ZRender.prototype.on = function(eventName, eventHandler) { - this.handler.on(eventName, eventHandler); - return this; - }; - - /** - * 事件解绑定,参数为空则解绑所有自定义事件 - * - * @param {string} eventName 事件名称 - * @param {Function} eventHandler 响应函数 - */ - ZRender.prototype.un = function(eventName, eventHandler) { - this.handler.un(eventName, eventHandler); - return this; - }; - - /** - * 事件触发 - * - * @param {string} event 事件名称,resize,hover,drag,etc~ - * @param {event=} event event dom事件对象 - */ - ZRender.prototype.trigger = function (eventName, event) { - this.handler.trigger(eventName, event); - return this; - }; - - - /** - * 清除当前ZRender下所有类图的数据和显示,clear后MVC和已绑定事件均还存在在,ZRender可用 - */ - ZRender.prototype.clear = function () { - this.storage.delRoot(); - this.painter.clear(); - return this; - }; - - /** - * 释放当前ZR实例(删除包括dom,数据、显示和事件绑定),dispose后ZR不可用 - */ - ZRender.prototype.dispose = function () { - this.animation.stop(); - - this.clear(); - this.storage.dispose(); - this.painter.dispose(); - this.handler.dispose(); - - this.animation = - this.animatingShapes = - this.storage = - this.painter = - this.handler = null; - - //释放后告诉全局删除对自己的索引,没想到啥好方法 - zrender.delInstance(this.id); - }; - - return zrender; - } -); +/*! + * ZRender, a high performance canvas library. + * + * Copyright (c) 2013, Baidu Inc. + * All rights reserved. + * + * LICENSE + * https://github.com/ecomfe/zrender/blob/master/LICENSE.txt + */ +define( + function(require) { + /* + * HTML5 Canvas for Internet Explorer! + * Modern browsers like Firefox, Safari, Chrome and Opera support + * the HTML5 canvas tag to allow 2D command-based drawing. + * ExplorerCanvas brings the same functionality to Internet Explorer. + * To use, web developers only need to include a single script tag + * in their existing web pages. + * + * https://code.google.com/p/explorercanvas/ + * http://explorercanvas.googlecode.com/svn/trunk/excanvas.js + */ + // 核心代码会生成一个全局变量 G_vmlCanvasManager,模块改造后借用于快速判断canvas支持 + require('./dep/excanvas'); + + var util = require('./tool/util'); + var log = require('./tool/log'); + var guid = require('./tool/guid'); + + var Handler = require('./Handler'); + var Painter = require('./Painter'); + var Storage = require('./Storage'); + var Animation = require('./animation/Animation'); + + var _instances = {}; // ZRender实例map索引 + + /** + * @exports zrender + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + * pissang (https://www.github.com/pissang) + */ + var zrender = {}; + /** + * @type {string} + */ + zrender.version = '2.0.7'; + + /** + * 创建zrender实例 + * + * @param {HTMLElement} dom 绘图容器 + * @return {module:zrender~ZRender} ZRender实例 + */ + // 不让外部直接new ZRender实例,为啥? + // 不为啥,提供全局可控同时减少全局污染和降低命名冲突的风险! + zrender.init = function(dom) { + var zr = new ZRender(guid(), dom); + _instances[zr.id] = zr; + return zr; + }; + + /** + * zrender实例销毁 + * @param {module:zrender~ZRender} zr ZRender对象,不传则销毁全部 + */ + // 在_instances里的索引也会删除了 + // 管生就得管死,可以通过zrender.dispose(zr)销毁指定ZRender实例 + // 当然也可以直接zr.dispose()自己销毁 + zrender.dispose = function (zr) { + if (zr) { + zr.dispose(); + } + else { + for (var key in _instances) { + _instances[key].dispose(); + } + _instances = {}; + } + + return zrender; + }; + + /** + * 获取zrender实例 + * @param {string} id ZRender对象索引 + * @return {module:zrender~ZRender} + */ + zrender.getInstance = function (id) { + return _instances[id]; + }; + + /** + * 删除zrender实例,ZRender实例dispose时会调用, + * 删除后getInstance则返回undefined + * ps: 仅是删除,删除的实例不代表已经dispose了~~ + * 这是一个摆脱全局zrender.dispose()自动销毁的后门, + * take care of yourself~ + * + * @param {string} id ZRender对象索引 + */ + zrender.delInstance = function (id) { + delete _instances[id]; + return zrender; + }; + + function getFrameCallback(zrInstance) { + return function () { + var animatingElements = zrInstance.animatingElements; + for (var i = 0, l = animatingElements.length; i < l; i++) { + zrInstance.storage.mod(animatingElements[i].id); + } + + if (animatingElements.length || zrInstance._needsRefreshNextFrame) { + zrInstance.refresh(); + } + }; + } + + /** + * ZRender接口类,对外可用的所有接口都在这里 + * 非get接口统一返回支持链式调用 + * + * @constructor + * @alias module:zrender~ZRender + * @param {string} id 唯一标识 + * @param {HTMLElement} dom dom对象,不帮你做document.getElementById + * @return {ZRender} ZRender实例 + */ + var ZRender = function(id, dom) { + /** + * 实例 id + * @type {string} + */ + this.id = id; + this.env = require('./tool/env'); + + this.storage = new Storage(); + this.painter = new Painter(dom, this.storage); + this.handler = new Handler(dom, this.storage, this.painter); + + // 动画控制 + this.animatingElements = []; + /** + * @type {module:zrender/animation/Animation} + */ + this.animation = new Animation({ + stage: { + update: getFrameCallback(this) + } + }); + this.animation.start(); + + var self = this; + this.painter.refreshNextFrame = function () { + self.refreshNextFrame(); + }; + + this._needsRefreshNextFrame = false; + }; + + /** + * 获取实例唯一标识 + * @return {string} + */ + ZRender.prototype.getId = function () { + return this.id; + }; + + /** + * 添加图形形状到根节点 + * + * @param {module:zrender/shape/Base} shape 形状对象,可用属性全集,详见各shape + */ + ZRender.prototype.addShape = function (shape) { + this.storage.addRoot(shape); + return this; + }; + + /** + * 添加组到根节点 + * + * @param {module:zrender/Group} group + */ + ZRender.prototype.addGroup = function(group) { + this.storage.addRoot(group); + return this; + }; + + /** + * 从根节点删除图形形状 + * + * @param {string} shapeId 形状对象唯一标识 + */ + ZRender.prototype.delShape = function (shapeId) { + this.storage.delRoot(shapeId); + return this; + }; + + /** + * 从根节点删除组 + * + * @param {string} groupId + */ + ZRender.prototype.delGroup = function (groupId) { + this.storage.delRoot(groupId); + return this; + }; + + /** + * 修改图形形状 + * + * @param {string} shapeId 形状对象唯一标识 + * @param {Object} shape 形状对象 + */ + ZRender.prototype.modShape = function (shapeId, shape) { + this.storage.mod(shapeId, shape); + return this; + }; + + /** + * 修改组 + * + * @param {string} groupId + * @param {Object} group + */ + ZRender.prototype.modGroup = function (groupId, group) { + this.storage.mod(groupId, group); + return this; + }; + + /** + * 修改指定zlevel的绘制配置项 + * + * @param {string} zLevel + * @param {Object} config 配置对象 + * @param {string} [config.clearColor=0] 每次清空画布的颜色 + * @param {string} [config.motionBlur=false] 是否开启动态模糊 + * @param {number} [config.lastFrameAlpha=0.7] + * 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显 + * @param {Array.} [config.position] 层的平移 + * @param {Array.} [config.rotation] 层的旋转 + * @param {Array.} [config.scale] 层的缩放 + * @param {boolean} [config.zoomable=false] 层是否支持鼠标缩放操作 + * @param {boolean} [config.panable=false] 层是否支持鼠标平移操作 + */ + ZRender.prototype.modLayer = function (zLevel, config) { + this.painter.modLayer(zLevel, config); + return this; + }; + + /** + * 添加额外高亮层显示,仅提供添加方法,每次刷新后高亮层图形均被清空 + * + * @param {Object} shape 形状对象 + */ + ZRender.prototype.addHoverShape = function (shape) { + this.storage.addHover(shape); + return this; + }; + + /** + * 渲染 + * + * @param {Function} callback 渲染结束后回调函数 + */ + ZRender.prototype.render = function (callback) { + this.painter.render(callback); + this._needsRefreshNextFrame = false; + return this; + }; + + /** + * 视图更新 + * + * @param {Function} callback 视图更新后回调函数 + */ + ZRender.prototype.refresh = function (callback) { + this.painter.refresh(callback); + this._needsRefreshNextFrame = false; + return this; + }; + + /** + * 标记视图在浏览器下一帧需要绘制 + */ + ZRender.prototype.refreshNextFrame = function() { + this._needsRefreshNextFrame = true; + return this; + }; + + /** + * 绘制高亮层 + * @param {Function} callback 视图更新后回调函数 + */ + ZRender.prototype.refreshHover = function (callback) { + this.painter.refreshHover(callback); + return this; + }; + + /** + * 视图更新 + * + * @param {Array.} shapeList 需要更新的图形列表 + * @param {Function} callback 视图更新后回调函数 + */ + ZRender.prototype.refreshShapes = function (shapeList, callback) { + this.painter.refreshShapes(shapeList, callback); + return this; + }; + + /** + * 调整视图大小 + */ + ZRender.prototype.resize = function() { + this.painter.resize(); + return this; + }; + + /** + * 动画 + * + * @param {string|module:zrender/Group|module:zrender/shape/Base} el 动画对象 + * @param {string} path 需要添加动画的属性获取路径,可以通过a.b.c来获取深层的属性 + * @param {boolean} [loop] 动画是否循环 + * @return {module:zrender/animation/Animation~Animator} + * @example: + * zr.animate(circle.id, 'style', false) + * .when(1000, {x: 10} ) + * .done(function(){ // Animation done }) + * .start() + */ + ZRender.prototype.animate = function (el, path, loop) { + if (typeof(el) === 'string') { + el = this.storage.get(el); + } + if (el) { + var target; + if (path) { + var pathSplitted = path.split('.'); + var prop = el; + for (var i = 0, l = pathSplitted.length; i < l; i++) { + if (!prop) { + continue; + } + prop = prop[pathSplitted[i]]; + } + if (prop) { + target = prop; + } + } + else { + target = el; + } + + if (!target) { + log( + 'Property "' + + path + + '" is not existed in element ' + + el.id + ); + return; + } + + var animatingElements = this.animatingElements; + if (typeof el.__aniCount === 'undefined') { + // 正在进行的动画记数 + el.__aniCount = 0; + } + if (el.__aniCount === 0) { + animatingElements.push(el); + } + el.__aniCount++; + + return this.animation.animate(target, { loop: loop }) + .done(function () { + el.__aniCount--; + if (el.__aniCount === 0) { + // 从animatingElements里移除 + var idx = util.indexOf(animatingElements, el); + animatingElements.splice(idx, 1); + } + }); + } + else { + log('Element not existed'); + } + }; + + /** + * 停止所有动画 + */ + ZRender.prototype.clearAnimation = function () { + this.animation.clear(); + }; + + /** + * loading显示 + * + * @param {Object=} loadingEffect loading效果对象 + */ + ZRender.prototype.showLoading = function (loadingEffect) { + this.painter.showLoading(loadingEffect); + return this; + }; + + /** + * loading结束 + */ + ZRender.prototype.hideLoading = function () { + this.painter.hideLoading(); + return this; + }; + + /** + * 获取视图宽度 + */ + ZRender.prototype.getWidth = function() { + return this.painter.getWidth(); + }; + + /** + * 获取视图高度 + */ + ZRender.prototype.getHeight = function() { + return this.painter.getHeight(); + }; + + /** + * 图像导出 + * @param {string} type + * @param {string} [backgroundColor='#fff'] 背景色 + * @return {string} 图片的Base64 url + */ + ZRender.prototype.toDataURL = function(type, backgroundColor, args) { + return this.painter.toDataURL(type, backgroundColor, args); + }; + + /** + * 将常规shape转成image shape + * @param {module:zrender/shape/Base} e + * @param {number} width + * @param {number} height + */ + ZRender.prototype.shapeToImage = function(e, width, height) { + var id = guid(); + return this.painter.shapeToImage(id, e, width, height); + }; + + /** + * 事件绑定 + * + * @param {string} eventName 事件名称 + * @param {Function} eventHandler 响应函数 + * @param {Object} [context] 响应函数 + */ + ZRender.prototype.on = function(eventName, eventHandler, context) { + this.handler.on(eventName, eventHandler, context); + return this; + }; + + /** + * 事件解绑定,参数为空则解绑所有自定义事件 + * + * @param {string} eventName 事件名称 + * @param {Function} eventHandler 响应函数 + */ + ZRender.prototype.un = function(eventName, eventHandler) { + this.handler.un(eventName, eventHandler); + return this; + }; + + /** + * 事件触发 + * + * @param {string} eventName 事件名称,resize,hover,drag,etc + * @param {event=} event event dom事件对象 + */ + ZRender.prototype.trigger = function (eventName, event) { + this.handler.trigger(eventName, event); + return this; + }; + + + /** + * 清除当前ZRender下所有类图的数据和显示,clear后MVC和已绑定事件均还存在在,ZRender可用 + */ + ZRender.prototype.clear = function () { + this.storage.delRoot(); + this.painter.clear(); + return this; + }; + + /** + * 释放当前ZR实例(删除包括dom,数据、显示和事件绑定),dispose后ZR不可用 + */ + ZRender.prototype.dispose = function () { + this.animation.stop(); + + this.clear(); + this.storage.dispose(); + this.painter.dispose(); + this.handler.dispose(); + + this.animation = + this.animatingElements = + this.storage = + this.painter = + this.handler = null; + + // 释放后告诉全局删除对自己的索引,没想到啥好方法 + zrender.delInstance(this.id); + }; + + return zrender; + } +); diff --git a/build/build.bat b/build/build.bat deleted file mode 100644 index 758a8e1..0000000 --- a/build/build.bat +++ /dev/null @@ -1,11 +0,0 @@ -node build.js optimize=true plain=false exclude=map output=echarts.js -node build.js optimize=false plain=false exclude=map output=echarts-original.js -node build.js optimize=true plain=false output=echarts-map.js -node build.js optimize=false plain=false output=echarts-original-map.js -node build.js optimize=true plain=true exclude=map output=echarts-plain.js -node build.js optimize=true plain=true output=echarts-plain-map.js -node build.js optimize=false plain=true exclude=map output=echarts-plain-original.js -node build.js optimize=false plain=true output=echarts-plain-original-map.js -del _config_tmp.js -cd ../src -del _chart.js \ No newline at end of file diff --git a/build/build.js b/build/build.js deleted file mode 100644 index 2c4c6f2..0000000 --- a/build/build.js +++ /dev/null @@ -1,80 +0,0 @@ -/** - * Example : - * node build.js optimize=true exclude=map,force,line output=echarts.js plain=true - * @param optimize 是否压缩, 默认false - * @param exclude 不打包的图表,多个图表使用逗号分割, 默认使用所有图表 - * @param output 输出打包地址,默认为echarts.js - * @param plain 是否打包esl, 打包的话可以直接使用scripts标签引入, 默认false - */ -var fs = require('fs'); -var spawn = require('child_process').spawn; - -var args = {}; -process.argv.slice(2).forEach(function (val) { - var keyVal = val.split('='); - args[keyVal[0]] = keyVal[1]; -}); - -var outputFile = args['output'] || 'echarts.js'; -var exclude = args['exclude'] ? args['exclude'].split(',') : []; -var plain = args['plain'] === 'true' ? true : false; -var optimize = args['optimize'] === 'true' ? true : false; - -var configTplStr = fs.readFileSync('./config-tpl.js', 'utf-8'); -var configTpl = eval('(' + configTplStr + ')'); - -if (!optimize) { - configTpl.optimize = 'none'; -} -if (plain) { - if (exclude.indexOf('map') >= 0) { - configTpl.wrap = { - startFile : ['wrap/start.js', "wrap/almond.js"], - endFile : 'wrap/end.js' - } - } else { - configTpl.wrap = { - startFile : ['wrap/start.js', "wrap/almond.js"], - endFile : 'wrap/end-map.js' - } - } -} - -configTpl.out = outputFile; - -if (exclude) { - exclude.forEach(function (chartName) { - if (chartName === 'map') { - configTpl.include = configTpl.include.filter(function (path) { - return path.indexOf('map') < 0; - }); - } else { - configTpl.include = configTpl.include.filter(function (path) { - return path !== 'echarts/chart/' + chartName; - }); - } - }); - var chartsRequire = ['define(function (require) {']; - configTpl.include.forEach(function (chartPath) { - chartsRequire.push(' require("' + chartPath + '");'); - }); - chartsRequire.push('});') - fs.writeFileSync('../src/_chart.js', chartsRequire.join('\n'), 'utf-8'); - - configTpl.include.push('_chart'); -} -fs.writeFileSync('_config_tmp.js', JSON.stringify(configTpl), 'utf-8'); - -var buildProcess = spawn('node', ['r.js', '-o', '_config_tmp.js']); -buildProcess.on('close', function () { - fs.unlink('_config_tmp.js'); - fs.unlink('../src/_chart.js'); -}); -buildProcess.stdout.setEncoding('utf-8'); -buildProcess.stdout.on('data', function (data) { - console.log(data); -}); -buildProcess.stderr.setEncoding('utf-8'); -buildProcess.stderr.on('data', function (data) { - throw new Error(data); -}); diff --git a/build/build.sh b/build/build.sh deleted file mode 100755 index e8434d1..0000000 --- a/build/build.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -node build.js optimize=true plain=false exclude=map output=echarts.js -node build.js optimize=false plain=false exclude=map output=echarts-original.js -node build.js optimize=true plain=false output=echarts-map.js -node build.js optimize=false plain=false output=echarts-original-map.js -node build.js optimize=true plain=true exclude=map output=echarts-plain.js -node build.js optimize=true plain=true output=echarts-plain-map.js -node build.js optimize=false plain=true exclude=map output=echarts-plain-original.js -node build.js optimize=false plain=true output=echarts-plain-original-map.js \ No newline at end of file diff --git a/build/config-tpl.js b/build/config-tpl.js deleted file mode 100644 index 7ae614a..0000000 --- a/build/config-tpl.js +++ /dev/null @@ -1,67 +0,0 @@ -{ - // appDir: './', - baseUrl: '../src', - name: 'echarts', - packages: [ - { - name: 'zrender', - location: '../../zrender/src', - main: 'zrender' - }, - { - name: 'echarts', - location: '.', - main: 'echarts' - } - ], - include:[ - 'echarts/chart/gauge', - 'echarts/chart/funnel', - 'echarts/chart/scatter', - 'echarts/chart/k', - 'echarts/chart/radar', - 'echarts/chart/chord', - 'echarts/chart/force', - 'echarts/chart/map', - 'echarts/util/mapData/geoJson/an_hui_geo', - 'echarts/util/mapData/geoJson/ao_men_geo', - 'echarts/util/mapData/geoJson/bei_jing_geo', - 'echarts/util/mapData/geoJson/china_geo', - 'echarts/util/mapData/geoJson/chong_qing_geo', - 'echarts/util/mapData/geoJson/fu_jian_geo', - 'echarts/util/mapData/geoJson/gan_su_geo', - 'echarts/util/mapData/geoJson/guang_dong_geo', - 'echarts/util/mapData/geoJson/guang_xi_geo', - 'echarts/util/mapData/geoJson/gui_zhou_geo', - 'echarts/util/mapData/geoJson/hai_nan_geo', - 'echarts/util/mapData/geoJson/hei_long_jiang_geo', - 'echarts/util/mapData/geoJson/he_bei_geo', - 'echarts/util/mapData/geoJson/he_nan_geo', - 'echarts/util/mapData/geoJson/hu_bei_geo', - 'echarts/util/mapData/geoJson/hu_nan_geo', - 'echarts/util/mapData/geoJson/jiang_su_geo', - 'echarts/util/mapData/geoJson/jiang_xi_geo', - 'echarts/util/mapData/geoJson/ji_lin_geo', - 'echarts/util/mapData/geoJson/liao_ning_geo', - 'echarts/util/mapData/geoJson/nei_meng_gu_geo', - 'echarts/util/mapData/geoJson/ning_xia_geo', - 'echarts/util/mapData/geoJson/qing_hai_geo', - 'echarts/util/mapData/geoJson/shang_hai_geo', - 'echarts/util/mapData/geoJson/shan_dong_geo', - 'echarts/util/mapData/geoJson/shan_xi_1_geo', - 'echarts/util/mapData/geoJson/shan_xi_2_geo', - 'echarts/util/mapData/geoJson/si_chuan_geo', - 'echarts/util/mapData/geoJson/tai_wan_geo', - 'echarts/util/mapData/geoJson/tian_jin_geo', - 'echarts/util/mapData/geoJson/world_geo', - 'echarts/util/mapData/geoJson/xiang_gang_geo', - 'echarts/util/mapData/geoJson/xin_jiang_geo', - 'echarts/util/mapData/geoJson/xi_zang_geo', - 'echarts/util/mapData/geoJson/yun_nan_geo', - 'echarts/util/mapData/geoJson/zhe_jiang_geo', - 'echarts/chart/line', - 'echarts/chart/bar', - 'echarts/chart/pie' - ], - out: 'echarts.js' -} \ No newline at end of file diff --git a/build/dist/chart/bar.js b/build/dist/chart/bar.js new file mode 100644 index 0000000..5dfcbd9 --- /dev/null +++ b/build/dist/chart/bar.js @@ -0,0 +1 @@ +define("echarts/chart/bar",["require","./base","zrender/shape/Rectangle","../component/axis","../component/grid","../component/dataZoom","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../chart"],function(e){function t(e,t,n,a,o){i.call(this,e,t,n,a,o),this.refresh(a)}var i=e("./base"),n=e("zrender/shape/Rectangle");e("../component/axis"),e("../component/grid"),e("../component/dataZoom");var a=e("../config");a.bar={zlevel:0,z:2,clickable:!0,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,barMinHeight:0,barGap:"30%",barCategoryGap:"20%",itemStyle:{normal:{barBorderColor:"#fff",barBorderRadius:0,barBorderWidth:0,label:{show:!1}},emphasis:{barBorderColor:"#fff",barBorderRadius:0,barBorderWidth:0,label:{show:!1}}}};var o=e("../util/ecData"),r=e("zrender/tool/util"),s=e("zrender/tool/color");return t.prototype={type:a.CHART_TYPE_BAR,_buildShape:function(){this._buildPosition()},_buildNormal:function(e,t,i,o,r){for(var s,l,h,d,m,c,p,u,V,U,g,y,f=this.series,b=i[0][0],_=f[b],x="horizontal"==r,k=this.component.xAxis,L=this.component.yAxis,v=x?k.getAxis(_.xAxisIndex):L.getAxis(_.yAxisIndex),W=this._mapSize(v,i),w=W.gap,X=W.barGap,I=W.barWidthMap,K=W.barMaxWidthMap,S=W.barWidth,C=W.barMinHeightMap,T=W.interval,E=this.deepQuery([this.ecTheme,a],"island.r"),z=0,A=t;A>z&&null!=v.getNameByIndex(z);z++){x?d=v.getCoordByIndex(z)-w/2:m=v.getCoordByIndex(z)+w/2;for(var M=0,J=i.length;J>M;M++){var F=f[i[M][0]].yAxisIndex||0,O=f[i[M][0]].xAxisIndex||0;s=x?L.getAxis(F):k.getAxis(O),p=c=V=u=s.getCoord(0);for(var P=0,D=i[M].length;D>P;P++)b=i[M][P],_=f[b],g=_.data[z],y=this.getDataFromOption(g,"-"),o[b]=o[b]||{min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY,sum:0,counter:0,average:0},h=Math.min(K[b]||Number.MAX_VALUE,I[b]||S),"-"!==y&&(y>0?(l=P>0?s.getCoordSize(y):x?p-s.getCoord(y):s.getCoord(y)-p,1===D&&C[b]>l&&(l=C[b]),x?(c-=l,m=c):(d=c,c+=l)):0>y?(l=P>0?s.getCoordSize(y):x?s.getCoord(y)-V:V-s.getCoord(y),1===D&&C[b]>l&&(l=C[b]),x?(m=u,u+=l):(u-=l,d=u)):(l=0,x?(c-=l,m=c):(d=c,c+=l)),o[b][z]=x?d+h/2:m-h/2,o[b].min>y&&(o[b].min=y,x?(o[b].minY=m,o[b].minX=o[b][z]):(o[b].minX=d+l,o[b].minY=o[b][z])),o[b].maxP;P++)b=i[M][P],_=f[b],g=_.data[z],y=this.getDataFromOption(g,"-"),h=Math.min(K[b]||Number.MAX_VALUE,I[b]||S),"-"==y&&this.deepQuery([g,_,this.option],"calculable")&&(x?(c-=E,m=c):(d=c,c+=E),U=this._getBarItem(b,z,v.getNameByIndex(z),d,m-(x?0:h),x?h:E,x?E:h,x?"vertical":"horizontal"),U.hoverable=!1,U.draggable=!1,U.style.lineWidth=1,U.style.brushType="stroke",U.style.strokeColor=_.calculableHolderColor||this.ecTheme.calculableHolderColor||a.calculableHolderColor,this.shapeList.push(new n(U)));x?d+=h+X:m-=h+X}}this._calculMarkMapXY(o,i,x?"y":"x")},_buildHorizontal:function(e,t,i,n){return this._buildNormal(e,t,i,n,"horizontal")},_buildVertical:function(e,t,i,n){return this._buildNormal(e,t,i,n,"vertical")},_buildOther:function(e,t,i,a){for(var o=this.series,r=0,s=i.length;s>r;r++)for(var l=0,h=i[r].length;h>l;l++){var d=i[r][l],m=o[d],c=m.xAxisIndex||0,p=this.component.xAxis.getAxis(c),u=p.getCoord(0),V=m.yAxisIndex||0,U=this.component.yAxis.getAxis(V),g=U.getCoord(0);a[d]=a[d]||{min0:Number.POSITIVE_INFINITY,min1:Number.POSITIVE_INFINITY,max0:Number.NEGATIVE_INFINITY,max1:Number.NEGATIVE_INFINITY,sum0:0,sum1:0,counter0:0,counter1:0,average0:0,average1:0};for(var y=0,f=m.data.length;f>y;y++){var b=m.data[y],_=this.getDataFromOption(b,"-");if(_ instanceof Array){var x,k,L=p.getCoord(_[0]),v=U.getCoord(_[1]),W=[b,m],w=this.deepQuery(W,"barWidth")||10,X=this.deepQuery(W,"barHeight");null!=X?(x="horizontal",_[0]>0?(w=L-u,L-=w):w=_[0]<0?u-L:0,k=this._getBarItem(d,y,_[0],L,v-X/2,w,X,x)):(x="vertical",_[1]>0?X=g-v:_[1]<0?(X=v-g,v-=X):X=0,k=this._getBarItem(d,y,_[0],L-w/2,v,w,X,x)),this.shapeList.push(new n(k)),L=p.getCoord(_[0]),v=U.getCoord(_[1]),a[d].min0>_[0]&&(a[d].min0=_[0],a[d].minY0=v,a[d].minX0=L),a[d].max0<_[0]&&(a[d].max0=_[0],a[d].maxY0=v,a[d].maxX0=L),a[d].sum0+=_[0],a[d].counter0++,a[d].min1>_[1]&&(a[d].min1=_[1],a[d].minY1=v,a[d].minX1=L),a[d].max1<_[1]&&(a[d].max1=_[1],a[d].maxY1=v,a[d].maxX1=L),a[d].sum1+=_[1],a[d].counter1++}}}this._calculMarkMapXY(a,i,"xy")},_mapSize:function(e,t,i){var n,a,o=this._findSpecialBarSzie(t,i),r=o.barWidthMap,s=o.barMaxWidthMap,l=o.barMinHeightMap,h=o.sBarWidthCounter,d=o.sBarWidthTotal,m=o.barGap,c=o.barCategoryGap,p=1;if(t.length!=h){if(i)n=e.getGap(),m=0,a=+(n/t.length).toFixed(2),0>=a&&(p=Math.floor(t.length/n),a=1);else if(n="string"==typeof c&&c.match(/%$/)?(e.getGap()*(100-parseFloat(c))/100).toFixed(2)-0:e.getGap()-c,"string"==typeof m&&m.match(/%$/)?(m=parseFloat(m)/100,a=+((n-d)/((t.length-1)*m+t.length-h)).toFixed(2),m=a*m):(m=parseFloat(m),a=+((n-d-m*(t.length-1))/(t.length-h)).toFixed(2)),0>=a)return this._mapSize(e,t,!0)}else if(n=h>1?"string"==typeof c&&c.match(/%$/)?+(e.getGap()*(100-parseFloat(c))/100).toFixed(2):e.getGap()-c:d,a=0,m=h>1?+((n-d)/(h-1)).toFixed(2):0,0>m)return this._mapSize(e,t,!0);return this._recheckBarMaxWidth(t,r,s,l,n,a,m,p)},_findSpecialBarSzie:function(e,t){for(var i,n,a,o,r=this.series,s={},l={},h={},d=0,m=0,c=0,p=e.length;p>c;c++)for(var u={barWidth:!1,barMaxWidth:!1},V=0,U=e[c].length;U>V;V++){var g=e[c][V],y=r[g];if(!t){if(u.barWidth)s[g]=i;else if(i=this.query(y,"barWidth"),null!=i){s[g]=i,m+=i,d++,u.barWidth=!0;for(var f=0,b=V;b>f;f++){var _=e[c][f];s[_]=i}}if(u.barMaxWidth)l[g]=n;else if(n=this.query(y,"barMaxWidth"),null!=n){l[g]=n,u.barMaxWidth=!0;for(var f=0,b=V;b>f;f++){var _=e[c][f];l[_]=n}}}h[g]=this.query(y,"barMinHeight"),a=null!=a?a:this.query(y,"barGap"),o=null!=o?o:this.query(y,"barCategoryGap")}return{barWidthMap:s,barMaxWidthMap:l,barMinHeightMap:h,sBarWidth:i,sBarMaxWidth:n,sBarWidthCounter:d,sBarWidthTotal:m,barGap:a,barCategoryGap:o}},_recheckBarMaxWidth:function(e,t,i,n,a,o,r,s){for(var l=0,h=e.length;h>l;l++){var d=e[l][0];i[d]&&i[d]0&&f.height>y&&f.width>y?(f.y+=y/2,f.height-=y,f.x+=y/2,f.width-=y):f.brushType="fill",d.highlightStyle.textColor=d.highlightStyle.color,d=this.addLabel(d,c,p,i,h);var b=f.textPosition;if("insideLeft"===b||"insideRight"===b||"insideTop"===b||"insideBottom"===b){var _=5;switch(b){case"insideLeft":f.textX=f.x+_,f.textY=f.y+f.height/2,f.textAlign="left",f.textBaseline="middle";break;case"insideRight":f.textX=f.x+f.width-_,f.textY=f.y+f.height/2,f.textAlign="right",f.textBaseline="middle";break;case"insideTop":f.textX=f.x+f.width/2,f.textY=f.y+_/2,f.textAlign="center",f.textBaseline="top";break;case"insideBottom":f.textX=f.x+f.width/2,f.textY=f.y+f.height-_/2,f.textAlign="center",f.textBaseline="bottom"}f.textPosition="specific",f.textColor=f.textColor||"#fff"}return this.deepQuery([p,c,this.option],"calculable")&&(this.setCalculable(d),d.draggable=!0),o.pack(d,m[e],e,m[e].data[t],t,i),d},getMarkCoord:function(e,t){var i,n,a=this.series[e],o=this.xMarkMap[e],r=this.component.xAxis.getAxis(a.xAxisIndex),s=this.component.yAxis.getAxis(a.yAxisIndex);if(!t.type||"max"!==t.type&&"min"!==t.type&&"average"!==t.type)if(o.isHorizontal){i="string"==typeof t.xAxis&&r.getIndexByName?r.getIndexByName(t.xAxis):t.xAxis||0;var l=o[i];l=null!=l?l:"string"!=typeof t.xAxis&&r.getCoordByIndex?r.getCoordByIndex(t.xAxis||0):r.getCoord(t.xAxis||0),n=[l,s.getCoord(t.yAxis||0)]}else{i="string"==typeof t.yAxis&&s.getIndexByName?s.getIndexByName(t.yAxis):t.yAxis||0;var h=o[i];h=null!=h?h:"string"!=typeof t.yAxis&&s.getCoordByIndex?s.getCoordByIndex(t.yAxis||0):s.getCoord(t.yAxis||0),n=[r.getCoord(t.xAxis||0),h]}else{var d=null!=t.valueIndex?t.valueIndex:null!=o.maxX0?"1":"";n=[o[t.type+"X"+d],o[t.type+"Y"+d],o[t.type+"Line"+d],o[t.type+d]]}return n},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},addDataAnimation:function(e){for(var t=this.series,i={},n=0,a=e.length;a>n;n++)i[e[n][0]]=e[n];for(var r,s,l,h,d,m,c,n=this.shapeList.length-1;n>=0;n--)if(m=o.get(this.shapeList[n],"seriesIndex"),i[m]&&!i[m][3]&&"rectangle"===this.shapeList[n].type){if(c=o.get(this.shapeList[n],"dataIndex"),d=t[m],i[m][2]&&c===d.data.length-1){this.zr.delShape(this.shapeList[n].id);continue}if(!i[m][2]&&0===c){this.zr.delShape(this.shapeList[n].id);continue}"horizontal"===this.shapeList[n]._orient?(h=this.component.yAxis.getAxis(d.yAxisIndex||0).getGap(),l=i[m][2]?-h:h,r=0):(s=this.component.xAxis.getAxis(d.xAxisIndex||0).getGap(),r=i[m][2]?s:-s,l=0),this.shapeList[n].position=[0,0],this.zr.animate(this.shapeList[n].id,"").when(this.query(this.option,"animationDurationUpdate"),{position:[r,l]}).start()}}},r.inherits(t,i),e("../chart").define("bar",t),t}); \ No newline at end of file diff --git a/build/dist/chart/chord.js b/build/dist/chart/chord.js new file mode 100644 index 0000000..5a6d54a --- /dev/null +++ b/build/dist/chart/chord.js @@ -0,0 +1 @@ +define("echarts/chart/chord",["require","./base","zrender/shape/Text","zrender/shape/Line","zrender/shape/Sector","../util/shape/Ribbon","../util/shape/Icon","zrender/shape/BezierCurve","../config","../util/ecData","zrender/tool/util","zrender/tool/vector","../data/Graph","../layout/Chord","../chart"],function(e){"use strict";function t(e,t,n,a,o){i.call(this,e,t,n,a,o),this.scaleLineLength=4,this.scaleUnitAngle=4,this.refresh(a)}var i=e("./base"),n=e("zrender/shape/Text"),a=e("zrender/shape/Line"),o=e("zrender/shape/Sector"),s=e("../util/shape/Ribbon"),r=e("../util/shape/Icon"),l=e("zrender/shape/BezierCurve"),h=e("../config");h.chord={zlevel:0,z:2,clickable:!0,radius:["65%","75%"],center:["50%","50%"],padding:2,sort:"none",sortSub:"none",startAngle:90,clockWise:!0,ribbonType:!0,minRadius:10,maxRadius:20,symbol:"circle",showScale:!1,showScaleText:!1,itemStyle:{normal:{borderWidth:0,borderColor:"#000",label:{show:!0,rotate:!1,distance:5},chordStyle:{width:1,color:"black",borderWidth:1,borderColor:"#999",opacity:.5}},emphasis:{borderWidth:0,borderColor:"#000",chordStyle:{width:1,color:"black",borderWidth:1,borderColor:"#999"}}}};var d=e("../util/ecData"),c=e("zrender/tool/util"),m=e("zrender/tool/vector"),p=e("../data/Graph"),u=e("../layout/Chord");return t.prototype={type:h.CHART_TYPE_CHORD,_init:function(){var e=this.series;this.selectedMap={};for(var t={},i={},n=0,a=e.length;a>n;n++)if(e[n].type===this.type){var o=this.isSelected(e[n].name);this.selectedMap[e[n].name]=o,o&&this.buildMark(n),this.reformOption(e[n]),t[e[n].name]=e[n]}for(var n=0,a=e.length;a>n;n++)if(e[n].type===this.type)if(e[n].insertToSerie){var s=t[e[n].insertToSerie];e[n]._referenceSerie=s}else i[e[n].name]=[e[n]];for(var n=0,a=e.length;a>n;n++)if(e[n].type===this.type&&e[n].insertToSerie){for(var r=e[n]._referenceSerie;r&&r._referenceSerie;)r=r._referenceSerie;i[r.name]&&this.selectedMap[e[n].name]&&i[r.name].push(e[n])}for(var l in i)this._buildChords(i[l]);this.addShapeList()},_getNodeCategory:function(e,t){return e.categories&&e.categories[t.category||0]},_getNodeQueryTarget:function(e,t){var i=this._getNodeCategory(e,t);return[t,i,e]},_getEdgeQueryTarget:function(e,t,i){return i=i||"normal",[t.itemStyle&&t.itemStyle[i],e.itemStyle[i].chordStyle]},_buildChords:function(e){for(var t=[],i=e[0],n=function(e){return e.layout.size>0},a=function(e){return function(t){return e.getEdge(t.node2,t.node1)}},o=0;oa;a++){var s=n[a];if(s&&!s.ignore){var r=this._getNodeCategory(t,s),l=r?r.name:s.name;if(this.selectedMap[l]=this.isSelected(l),this.selectedMap[l]){var h=i.addNode(s.name,s);h.rawIndex=a}}}for(var a=0,o=e.links.length;o>a;a++){var d=e.links[a],c=d.source,m=d.target;"number"==typeof c&&(c=n[c],c&&(c=c.name)),"number"==typeof m&&(m=n[m],m&&(m=m.name));var u=i.addEdge(c,m,d);u&&(u.rawIndex=a)}return i.eachNode(function(e){var i=e.data.value;if(null==i)if(i=0,t.ribbonType)for(var n=0;n0&&(u.style.brushType="both"),u.highlightStyle.lineWidth>0&&(u.highlightStyle.brushType="both"),d.pack(u,e,t,i.data,i.rawIndex,i.id,i.category),this.shapeList.push(u),i.shape=u},this)},_buildNodeIcons:function(e,t,i,n){var a=this.parseCenter(this.zr,n.center),o=this.parseRadius(this.zr,n.radius),s=o[1];i.eachNode(function(i){var o=i.layout.startAngle,l=i.layout.endAngle,h=(o+l)/2,c=s*Math.cos(h),m=s*Math.sin(h),p=this._getNodeQueryTarget(n,i.data),u=this._getNodeCategory(n,i.data),g=this.deepQuery(p,"itemStyle.normal.color");g||(g=this.getColor(u?u.name:i.id));var V=new r({zlevel:this.getZlevelBase(),z:this.getZBase()+1,style:{x:-i.layout.size,y:-i.layout.size,width:2*i.layout.size,height:2*i.layout.size,iconType:this.deepQuery(p,"symbol"),color:g,brushType:"both",lineWidth:this.deepQuery(p,"itemStyle.normal.borderWidth"),strokeColor:this.deepQuery(p,"itemStyle.normal.borderColor")},highlightStyle:{color:this.deepQuery(p,"itemStyle.emphasis.color"),lineWidth:this.deepQuery(p,"itemStyle.emphasis.borderWidth"),strokeColor:this.deepQuery(p,"itemStyle.emphasis.borderColor")},clickable:n.clickable,position:[c+a[0],m+a[1]]});d.pack(V,e,t,i.data,i.rawIndex,i.id,i.category),this.shapeList.push(V),i.shape=V},this)},_buildLabels:function(e,t,i,a){var o=this.query(a,"itemStyle.normal.label.color"),s=this.query(a,"itemStyle.normal.label.rotate"),r=this.query(a,"itemStyle.normal.label.distance"),l=this.parseCenter(this.zr,a.center),h=this.parseRadius(this.zr,a.radius),d=a.clockWise,c=d?1:-1;i.eachNode(function(e){var t=e.layout.startAngle/Math.PI*180*c,i=e.layout.endAngle/Math.PI*180*c,d=(t*-c+i*-c)/2;d%=360,0>d&&(d+=360);var p=90>=d||d>=270;d=d*Math.PI/180;var u=[Math.cos(d),-Math.sin(d)],g=0;g=a.ribbonType?a.showScaleText?35+r:r:r+e.layout.size;var V=m.scale([],u,h[1]+g);m.add(V,V,l);var U={zlevel:this.getZlevelBase(),z:this.getZBase()+1,hoverable:!1,style:{text:null==e.data.label?e.id:e.data.label,textAlign:p?"left":"right",color:o||"#000000"}};s?(U.rotation=p?d:Math.PI+d,U.style.x=p?h[1]+g:-h[1]-g,U.style.y=0,U.position=l.slice()):(U.style.x=V[0],U.style.y=V[1]),U.style.textColor=this.deepQuery([e.data,a],"itemStyle.normal.label.textStyle.color")||"#fff",U.style.textFont=this.getFont(this.deepQuery([e.data,a],"itemStyle.normal.label.textStyle")),U=new n(U),this.shapeList.push(U),e.labelShape=U},this)},_buildRibbons:function(e,t,i,n){var a=e[t],o=this.parseCenter(this.zr,n.center),r=this.parseRadius(this.zr,n.radius);i.eachEdge(function(l,h){var c,m=i.getEdge(l.node2,l.node1);if(m&&!l.shape){if(m.shape)return void(l.shape=m.shape);var p=l.layout.startAngle/Math.PI*180,u=l.layout.endAngle/Math.PI*180,g=m.layout.startAngle/Math.PI*180,V=m.layout.endAngle/Math.PI*180;c=this.getColor(1===e.length?l.layout.weight<=m.layout.weight?l.node1.id:l.node2.id:a.name);var U,y,f=this._getEdgeQueryTarget(a,l.data),b=this._getEdgeQueryTarget(a,l.data,"emphasis"),_=new s({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:o[0],y:o[1],r:r[0],source0:p,source1:u,target0:g,target1:V,brushType:"both",opacity:this.deepQuery(f,"opacity"),color:c,lineWidth:this.deepQuery(f,"borderWidth"),strokeColor:this.deepQuery(f,"borderColor"),clockWise:n.clockWise},clickable:n.clickable,highlightStyle:{brushType:"both",opacity:this.deepQuery(b,"opacity"),lineWidth:this.deepQuery(b,"borderWidth"),strokeColor:this.deepQuery(b,"borderColor")}});l.layout.weight<=m.layout.weight?(U=m.node1,y=m.node2):(U=l.node1,y=l.node2),d.pack(_,a,t,l.data,null==l.rawIndex?h:l.rawIndex,l.data.name||U.id+"-"+y.id,U.id,y.id),this.shapeList.push(_),l.shape=_}},this)},_buildEdgeCurves:function(e,t,i,n,a){var o=e[t],s=this.parseCenter(this.zr,n.center);i.eachEdge(function(e,i){var n=a.getNodeById(e.node1.id),r=a.getNodeById(e.node2.id),h=n.shape,c=r.shape,m=this._getEdgeQueryTarget(o,e.data),p=this._getEdgeQueryTarget(o,e.data,"emphasis"),u=new l({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{xStart:h.position[0],yStart:h.position[1],xEnd:c.position[0],yEnd:c.position[1],cpX1:s[0],cpY1:s[1],lineWidth:this.deepQuery(m,"width"),strokeColor:this.deepQuery(m,"color"),opacity:this.deepQuery(m,"opacity")},highlightStyle:{lineWidth:this.deepQuery(p,"width"),strokeColor:this.deepQuery(p,"color"),opacity:this.deepQuery(p,"opacity")}});d.pack(u,o,t,e.data,null==e.rawIndex?i:e.rawIndex,e.data.name||e.node1.id+"-"+e.node2.id,e.node1.id,e.node2.id),this.shapeList.push(u),e.shape=u},this)},_buildScales:function(e,t,i){var o,s,r=e.clockWise,l=this.parseCenter(this.zr,e.center),h=this.parseRadius(this.zr,e.radius),d=r?1:-1,c=0,p=-1/0;e.showScaleText&&(i.eachNode(function(e){var t=e.data.value;t>p&&(p=t),c+=t}),p>1e10?(o="b",s=1e-9):p>1e7?(o="m",s=1e-6):p>1e4?(o="k",s=.001):(o="",s=1));var u=c/(360-e.padding);i.eachNode(function(t){for(var i=t.layout.startAngle/Math.PI*180,c=t.layout.endAngle/Math.PI*180,p=i;;){if(r&&p>c||!r&&c>p)break;var g=p/180*Math.PI,V=[Math.cos(g),Math.sin(g)],U=m.scale([],V,h[1]+1);m.add(U,U,l);var y=m.scale([],V,h[1]+this.scaleLineLength);m.add(y,y,l);var f=new a({zlevel:this.getZlevelBase(),z:this.getZBase()-1,hoverable:!1,style:{xStart:U[0],yStart:U[1],xEnd:y[0],yEnd:y[1],lineCap:"round",brushType:"stroke",strokeColor:"#666",lineWidth:1}});this.shapeList.push(f),p+=d*this.scaleUnitAngle}if(e.showScaleText)for(var b=i,_=5*u*this.scaleUnitAngle,x=0;;){if(r&&b>c||!r&&c>b)break;var g=b;g%=360,0>g&&(g+=360);var k=90>=g||g>=270,L=new n({zlevel:this.getZlevelBase(),z:this.getZBase()-1,hoverable:!1,style:{x:k?h[1]+this.scaleLineLength+4:-h[1]-this.scaleLineLength-4,y:0,text:Math.round(10*x)/10+o,textAlign:k?"left":"right"},position:l.slice(),rotation:k?[-g/180*Math.PI,0,0]:[-(g+180)/180*Math.PI,0,0]});this.shapeList.push(L),x+=_*s,b+=d*this.scaleUnitAngle*5}},this)},refresh:function(e){if(e&&(this.option=e,this.series=e.series),this.legend=this.component.legend,this.legend)this.getColor=function(e){return this.legend.getColor(e)},this.isSelected=function(e){return this.legend.isSelected(e)};else{var t={},i=0;this.getColor=function(e){return t[e]?t[e]:(t[e]||(t[e]=this.zr.getColor(i++)),t[e])},this.isSelected=function(){return!0}}this.backupShapeList(),this._init()},reformOption:function(e){var t=c.merge;e=t(t(e||{},this.ecTheme.chord),h.chord),e.itemStyle.normal.label.textStyle=this.getTextStyle(e.itemStyle.normal.label.textStyle)}},c.inherits(t,i),e("../chart").define("chord",t),t}),define("echarts/util/shape/Ribbon",["require","zrender/shape/Base","zrender/shape/util/PathProxy","zrender/tool/util","zrender/tool/area"],function(e){function t(e){i.call(this,e),this._pathProxy=new n}var i=e("zrender/shape/Base"),n=e("zrender/shape/util/PathProxy"),a=e("zrender/tool/util"),o=e("zrender/tool/area");return t.prototype={type:"ribbon",buildPath:function(e,t){var i=t.clockWise||!1,n=this._pathProxy;n.begin(e);var a=t.x,o=t.y,s=t.r,r=t.source0/180*Math.PI,l=t.source1/180*Math.PI,h=t.target0/180*Math.PI,d=t.target1/180*Math.PI,c=a+Math.cos(r)*s,m=o+Math.sin(r)*s,p=a+Math.cos(l)*s,u=o+Math.sin(l)*s,g=a+Math.cos(h)*s,V=o+Math.sin(h)*s,U=a+Math.cos(d)*s,y=o+Math.sin(d)*s;n.moveTo(c,m),n.arc(a,o,t.r,r,l,!i),n.bezierCurveTo(.7*(a-p)+p,.7*(o-u)+u,.7*(a-g)+g,.7*(o-V)+V,g,V),(t.source0!==t.target0||t.source1!==t.target1)&&(n.arc(a,o,t.r,h,d,!i),n.bezierCurveTo(.7*(a-U)+U,.7*(o-y)+y,.7*(a-c)+c,.7*(o-m)+m,c,m))},getRect:function(e){return e.__rect?e.__rect:(this._pathProxy.isEmpty()||this.buildPath(null,e),this._pathProxy.fastBoundingRect())},isCover:function(e,t){var i=this.getRect(this.style);return e>=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height?o.isInsidePath(this._pathProxy.pathCommands,0,"fill",e,t):void 0}},a.inherits(t,i),t}),define("zrender/shape/BezierCurve",["require","./Base","../tool/util"],function(e){"use strict";var t=e("./Base"),i=function(e){this.brushTypeOnly="stroke",this.textPosition="end",t.call(this,e)};return i.prototype={type:"bezier-curve",buildPath:function(e,t){e.moveTo(t.xStart,t.yStart),"undefined"!=typeof t.cpX2&&"undefined"!=typeof t.cpY2?e.bezierCurveTo(t.cpX1,t.cpY1,t.cpX2,t.cpY2,t.xEnd,t.yEnd):e.quadraticCurveTo(t.cpX1,t.cpY1,t.xEnd,t.yEnd)},getRect:function(e){if(e.__rect)return e.__rect;var t=Math.min(e.xStart,e.xEnd,e.cpX1),i=Math.min(e.yStart,e.yEnd,e.cpY1),n=Math.max(e.xStart,e.xEnd,e.cpX1),a=Math.max(e.yStart,e.yEnd,e.cpY1),o=e.cpX2,s=e.cpY2;"undefined"!=typeof o&&"undefined"!=typeof s&&(t=Math.min(t,o),i=Math.min(i,s),n=Math.max(n,o),a=Math.max(a,s));var r=e.lineWidth||1;return e.__rect={x:t-r,y:i-r,width:n-t+r,height:a-i+r},e.__rect}},e("../tool/util").inherits(i,t),i}),define("echarts/data/Graph",["require","zrender/tool/util"],function(e){var t=e("zrender/tool/util"),i=function(e){this._directed=e||!1,this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={}};i.prototype.isDirected=function(){return this._directed},i.prototype.addNode=function(e,t){if(this._nodesMap[e])return this._nodesMap[e];var n=new i.Node(e,t);return this.nodes.push(n),this._nodesMap[e]=n,n},i.prototype.getNodeById=function(e){return this._nodesMap[e]},i.prototype.addEdge=function(e,t,n){if("string"==typeof e&&(e=this._nodesMap[e]),"string"==typeof t&&(t=this._nodesMap[t]),e&&t){var a=e.id+"-"+t.id;if(this._edgesMap[a])return this._edgesMap[a];var o=new i.Edge(e,t,n);return this._directed&&(e.outEdges.push(o),t.inEdges.push(o)),e.edges.push(o),e!==t&&t.edges.push(o),this.edges.push(o),this._edgesMap[a]=o,o}},i.prototype.removeEdge=function(e){var i=e.node1,n=e.node2,a=i.id+"-"+n.id;this._directed&&(i.outEdges.splice(t.indexOf(i.outEdges,e),1),n.inEdges.splice(t.indexOf(n.inEdges,e),1)),i.edges.splice(t.indexOf(i.edges,e),1),i!==n&&n.edges.splice(t.indexOf(n.edges,e),1),delete this._edgesMap[a],this.edges.splice(t.indexOf(this.edges,e),1)},i.prototype.getEdge=function(e,t){return"string"!=typeof e&&(e=e.id),"string"!=typeof t&&(t=t.id),this._directed?this._edgesMap[e+"-"+t]:this._edgesMap[e+"-"+t]||this._edgesMap[t+"-"+e]},i.prototype.removeNode=function(e){if("string"!=typeof e||(e=this._nodesMap[e])){delete this._nodesMap[e.id],this.nodes.splice(t.indexOf(this.nodes,e),1);for(var i=0;in;)e.call(t,this.nodes[n],n)?n++:(this.removeNode(this.nodes[n]),i--)},i.prototype.filterEdge=function(e,t){for(var i=this.edges.length,n=0;i>n;)e.call(t,this.edges[n],n)?n++:(this.removeEdge(this.edges[n]),i--)},i.prototype.eachNode=function(e,t){for(var i=this.nodes.length,n=0;i>n;n++)this.nodes[n]&&e.call(t,this.nodes[n],n)},i.prototype.eachEdge=function(e,t){for(var i=this.edges.length,n=0;i>n;n++)this.edges[n]&&e.call(t,this.edges[n],n)},i.prototype.clear=function(){this.nodes.length=0,this.edges.length=0,this._nodesMap={},this._edgesMap={}},i.prototype.breadthFirstTraverse=function(e,t,i,n){if("string"==typeof t&&(t=this._nodesMap[t]),t){var a="edges";"out"===i?a="outEdges":"in"===i&&(a="inEdges");for(var o=0;os;s++){var r=o.addNode(e[s].id,e[s]);r.data.value=0,n&&(r.data.outValue=r.data.inValue=0)}for(var s=0;a>s;s++)for(var l=0;a>l;l++){var h=t[s][l];n&&(o.nodes[s].data.outValue+=h,o.nodes[l].data.inValue+=h),o.nodes[s].data.value+=h,o.nodes[l].data.value+=h}for(var s=0;a>s;s++)for(var l=s;a>l;l++){var h=t[s][l];if(0!==h){var d=o.nodes[s],c=o.nodes[l],m=o.addEdge(d,c,{});if(m.data.weight=h,s!==l&&n&&t[l][s]){var p=o.addEdge(c,d,{});p.data.weight=t[l][s]}}}return o}},i}),define("echarts/layout/Chord",["require"],function(){var e=function(e){e=e||{},this.sort=e.sort||null,this.sortSub=e.sortSub||null,this.padding=.05,this.startAngle=e.startAngle||0,this.clockWise=null==e.clockWise?!1:e.clockWise,this.center=e.center||[0,0],this.directed=!0};e.prototype.run=function(e){e instanceof Array||(e=[e]);var n=e.length;if(n){for(var a=e[0],o=a.nodes.length,s=[],r=0,l=0;o>l;l++){var h=a.nodes[l],d={size:0,subGroups:[],node:h};s.push(d);for(var c=0,m=0;ml;l++){var d=s[l];d.node.layout.startAngle=b,d.node.layout.endAngle=b+_*d.size*f,d.node.layout.subGroups=[];for(var V=0;Vn;n++)if(i[n].type===this.type){e=this.component.xAxis.getAxis(i[n].xAxisIndex||0);for(var o=0,r=i[n].eventList.length;r>o;o++){t=i[n].eventList[o].evolution;for(var l=0,h=t.length;h>l;l++)t[l].timeScale=e.getCoord(s.getNewDate(t[l].time)-0),t[l].valueScale=Math.pow(t[l].value,.8)}}this._intervalX=Math.round(this.component.grid.getWidth()/40)},_drawEventRiver:function(){for(var e=this.series,t=0;ta)){for(var o=[],r=[],s=0;a>s;s++)o.push(n[s].timeScale),r.push(n[s].valueScale);var l=[];l.push([o[0],i]);var s=0;for(s=0;a-1>s;s++)l.push([(o[s]+o[s+1])/2,r[s]/-2+i]);for(l.push([(o[s]+(o[s]+t))/2,r[s]/-2+i]),l.push([o[s]+t,i]),l.push([(o[s]+(o[s]+t))/2,r[s]/2+i]),s=a-1;s>0;s--)l.push([(o[s]+o[s-1])/2,r[s-1]/2+i]);return l}},ondragend:function(e,t){this.isDragend&&e.target&&(t.dragOut=!0,t.dragIn=!0,t.needRefresh=!1,this.isDragend=!1)},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()}},l.inherits(t,i),e("../chart").define("eventRiver",t),t}),define("echarts/layout/eventRiver",["require"],function(){function e(e,o,r){function s(e,t){var i=e.importance,n=t.importance;return i>n?-1:n>i?1:0}function l(e,t){if(e.indexOf)return e.indexOf(t);for(var i=0,n=e.length;n>i;i++)if(e[i]===t)return i;return-1}for(var h=5,m=o,V=0;Ve+1){var a=Math.round((e+t)/2);n.leftChild=i(e,a),n.rightChild=i(a,t)}return n}function n(e,t,i){if(1>i-t)return 0;var a=Math.round((e.left+e.right)/2),o=0;if(t==e.left&&i==e.right)o=e.maxValue;else if(a>=i&&null!=e.leftChild)o=n(e.leftChild,t,i);else if(t>=a&&null!=e.rightChild)o=n(e.rightChild,t,i);else{var r=0,s=0;null!=e.leftChild&&(r=n(e.leftChild,t,a)),null!=e.rightChild&&(s=n(e.rightChild,a,i)),o=r>s?r:s}return o}function a(e,t,i,n){if(null!=e){var o=Math.round((e.left+e.right)/2);e.maxValue=e.maxValue>n?e.maxValue:n,(Math.floor(10*t)!=Math.floor(10*e.left)||Math.floor(10*i)!=Math.floor(10*e.right))&&(o>=i?a(e.leftChild,t,i,n):t>=o?a(e.rightChild,t,i,n):(a(e.leftChild,t,o,n),a(e.rightChild,o,i,n)))}}return e}); \ No newline at end of file diff --git a/build/dist/chart/force.js b/build/dist/chart/force.js new file mode 100644 index 0000000..a4f4eb1 --- /dev/null +++ b/build/dist/chart/force.js @@ -0,0 +1 @@ +define("echarts/chart/force",["require","./base","../data/Graph","../layout/Force","zrender/shape/Line","zrender/shape/BezierCurve","zrender/shape/Image","../util/shape/Icon","../config","../util/ecData","zrender/tool/util","zrender/config","zrender/tool/vector","../chart"],function(e){"use strict";function t(e,t,o,h,d){var c=this;s.call(this,e,t,o,h,d),this.__nodePositionMap={},this._graph=new r(!0),this._layout=new l,this._layout.onupdate=function(){c._step()},this._steps=1,this.ondragstart=function(){i.apply(c,arguments)},this.ondragend=function(){a.apply(c,arguments)},this.ondrop=function(){},this.shapeHandler.ondragstart=function(){c.isDragstart=!0},this.onmousemove=function(){n.apply(c,arguments)},this.refresh(h)}function i(e){if(this.isDragstart&&e.target){var t=e.target;t.fixed=!0,this.isDragstart=!1,this.zr.on(V.EVENT.MOUSEMOVE,this.onmousemove)}}function n(){this._layout.temperature=.8,this._step()}function a(e,t){if(this.isDragend&&e.target){var i=e.target;i.fixed=!1,t.dragIn=!0,t.needRefresh=!1,this.isDragend=!1,this.zr.un(V.EVENT.MOUSEMOVE,this.onmousemove)}}function o(e,t,i){var n=y.create();return n[0]=(Math.random()-.5)*i+e,n[1]=(Math.random()-.5)*i+t,n}var s=e("./base"),r=e("../data/Graph"),l=e("../layout/Force"),h=e("zrender/shape/Line"),d=e("zrender/shape/BezierCurve"),c=e("zrender/shape/Image"),p=e("../util/shape/Icon"),m=e("../config");m.force={zlevel:1,z:2,center:["50%","50%"],size:"100%",preventOverlap:!1,coolDown:.99,minRadius:10,maxRadius:20,ratioScaling:!1,large:!1,useWorker:!1,steps:1,scaling:1,gravity:1,symbol:"circle",symbolSize:0,linkSymbol:null,linkSymbolSize:[10,15],draggable:!0,clickable:!0,roam:!1,itemStyle:{normal:{label:{show:!1,position:"inside"},nodeStyle:{brushType:"both",borderColor:"#5182ab",borderWidth:1},linkStyle:{color:"#5182ab",width:1,type:"line"}},emphasis:{label:{show:!1},nodeStyle:{},linkStyle:{opacity:0}}}};var u=e("../util/ecData"),g=e("zrender/tool/util"),V=e("zrender/config"),y=e("zrender/tool/vector");return t.prototype={constructor:t,type:m.CHART_TYPE_FORCE,_init:function(){var e,t=this.component.legend,i=this.series;this.clear();for(var n=0,a=i.length;a>n;n++){var o=i[n];if(o.type===m.CHART_TYPE_FORCE){if(i[n]=this.reformOption(i[n]),e=i[n].name||"",this.selectedMap[e]=t?t.isSelected(e):!0,!this.selectedMap[e])continue;this.buildMark(n),this._initSerie(o,n);break}}this.animationEffect()},_getNodeCategory:function(e,t){return e.categories&&e.categories[t.category||0]},_getNodeQueryTarget:function(e,t,i){i=i||"normal";var n=this._getNodeCategory(e,t)||{};return[t.itemStyle&&t.itemStyle[i],n&&n.itemStyle&&n.itemStyle[i],e.itemStyle[i].nodeStyle]},_getEdgeQueryTarget:function(e,t,i){return i=i||"normal",[t.itemStyle&&t.itemStyle[i],e.itemStyle[i].linkStyle]},_initSerie:function(e,t){this._temperature=1,this._graph=e.data?this._getSerieGraphFromDataMatrix(e):this._getSerieGraphFromNodeLinks(e),this._buildLinkShapes(e,t),this._buildNodeShapes(e,t);var i=e.roam===!0||"move"===e.roam,n=e.roam===!0||"scale"===e.roam;this.zr.modLayer(this.getZlevelBase(),{panable:i,zoomable:n}),(this.query("markPoint.effect.show")||this.query("markLine.effect.show"))&&this.zr.modLayer(m.EFFECT_ZLEVEL,{panable:i,zoomable:n}),this._initLayout(e),this._step()},_getSerieGraphFromDataMatrix:function(e){for(var t=[],i=0,n=[],a=0;an;n++){var o=i[n];if(o&&!o.ignore){var s=this._getNodeCategory(e,o),l=s?s.name:o.name;if(this.selectedMap[l]=this.isSelected(l),this.selectedMap[l]){var h=t.addNode(o.name,o);h.rawIndex=n}}}for(var n=0,a=e.links.length;a>n;n++){var d=e.links[n],c=d.source,p=d.target;"number"==typeof c&&(c=i[c],c&&(c=c.name)),"number"==typeof p&&(p=i[p],p&&(p=p.name));var m=t.addEdge(c,p,d);m&&(m.rawIndex=n)}return t.eachNode(function(e){var t=e.data.value;if(null==t){t=0;for(var i=0;il;l++){var h=t.nodes[l];r=Math.max(h.layout.size,r),s=Math.min(h.layout.size,s)}for(var d=r-s,l=0;i>l;l++){var h=t.nodes[l];d>0?(h.layout.size=(h.layout.size-s)*(a-n)/d+n,h.layout.mass=h.layout.size/a):(h.layout.size=(a-n)/2,h.layout.mass=.5)}for(var l=0;i>l;l++){var h=t.nodes[l];if("undefined"!=typeof this.__nodePositionMap[h.id])h.layout.position=y.create(),y.copy(h.layout.position,this.__nodePositionMap[h.id]);else if("undefined"!=typeof h.data.initial)h.layout.position=y.create(),y.copy(h.layout.position,h.data.initial);else{var c=this._layout.center,p=Math.min(this._layout.width,this._layout.height);h.layout.position=o(c[0],c[1],.8*p)}var m=h.shape.style,u=h.layout.size;m.width=m.width||2*u,m.height=m.height||2*u,m.x=-m.width/2,m.y=-m.height/2,y.copy(h.shape.position,h.layout.position)}i=t.edges.length,r=-1/0;for(var l=0;i>l;l++){var g=t.edges[l];g.layout.weight>r&&(r=g.layout.weight)}for(var l=0;i>l;l++){var g=t.edges[l];g.layout.weight/=r}this._layout.init(t,e.useWorker)},_buildNodeShapes:function(e,t){var i=this._graph,n=this.query(e,"categories");i.eachNode(function(i){var a=this._getNodeCategory(e,i.data),o=[i.data,a,e],s=this._getNodeQueryTarget(e,i.data),r=this._getNodeQueryTarget(e,i.data,"emphasis"),l=new p({style:{x:0,y:0,color:this.deepQuery(s,"color"),brushType:"both",strokeColor:this.deepQuery(s,"strokeColor")||this.deepQuery(s,"borderColor"),lineWidth:this.deepQuery(s,"lineWidth")||this.deepQuery(s,"borderWidth")},highlightStyle:{color:this.deepQuery(r,"color"),strokeColor:this.deepQuery(r,"strokeColor")||this.deepQuery(r,"borderColor"),lineWidth:this.deepQuery(r,"lineWidth")||this.deepQuery(r,"borderWidth")},clickable:e.clickable,zlevel:this.getZlevelBase(),z:this.getZBase()});l.style.color||(l.style.color=this.getColor(a?a.name:i.id)),l.style.iconType=this.deepQuery(o,"symbol"),l.style.width=l.style.height=2*(this.deepQuery(o,"symbolSize")||0),l.style.iconType.match("image")&&(l.style.image=l.style.iconType.replace(new RegExp("^image:\\/\\/"),""),l=new c({style:l.style,highlightStyle:l.highlightStyle,clickable:l.clickable,zlevel:this.getZlevelBase(),z:this.getZBase()})),this.deepQuery(o,"itemStyle.normal.label.show")&&(l.style.text=null==i.data.label?i.id:i.data.label,l.style.textPosition=this.deepQuery(o,"itemStyle.normal.label.position"),l.style.textColor=this.deepQuery(o,"itemStyle.normal.label.textStyle.color"),l.style.textFont=this.getFont(this.deepQuery(o,"itemStyle.normal.label.textStyle")||{})),this.deepQuery(o,"itemStyle.emphasis.label.show")&&(l.highlightStyle.textPosition=this.deepQuery(o,"itemStyle.emphasis.label.position"),l.highlightStyle.textColor=this.deepQuery(o,"itemStyle.emphasis.label.textStyle.color"),l.highlightStyle.textFont=this.getFont(this.deepQuery(o,"itemStyle.emphasis.label.textStyle")||{})),this.deepQuery(o,"draggable")&&(this.setCalculable(l),l.dragEnableTime=0,l.draggable=!0,l.ondragstart=this.shapeHandler.ondragstart,l.ondragover=null);var h="";if("undefined"!=typeof i.category){var a=n[i.category];h=a&&a.name||""}u.pack(l,e,t,i.data,i.rawIndex,i.data.name||"",i.category),this.shapeList.push(l),this.zr.addShape(l),i.shape=l},this)},_buildLinkShapes:function(e,t){for(var i=this._graph,n=i.edges.length,a=0;n>a;a++){var o=i.edges[a],s=o.data,r=o.node1,l=o.node2,c=this._getEdgeQueryTarget(e,s),m=this.deepQuery(c,"type");e.linkSymbol&&"none"!==e.linkSymbol&&(m="line");var V="line"===m?h:d,y=new V({style:{xStart:0,yStart:0,xEnd:0,yEnd:0},clickable:this.query(e,"clickable"),highlightStyle:{},zlevel:this.getZlevelBase(),z:this.getZBase()});if(g.merge(y.style,this.query(e,"itemStyle.normal.linkStyle"),!0),g.merge(y.highlightStyle,this.query(e,"itemStyle.emphasis.linkStyle"),!0),"undefined"!=typeof s.itemStyle&&(s.itemStyle.normal&&g.merge(y.style,s.itemStyle.normal,!0),s.itemStyle.emphasis&&g.merge(y.highlightStyle,s.itemStyle.emphasis,!0)),y.style.lineWidth=y.style.lineWidth||y.style.width,y.style.strokeColor=y.style.strokeColor||y.style.color,y.highlightStyle.lineWidth=y.highlightStyle.lineWidth||y.highlightStyle.width,y.highlightStyle.strokeColor=y.highlightStyle.strokeColor||y.highlightStyle.color,u.pack(y,e,t,o.data,null==o.rawIndex?a:o.rawIndex,o.data.name||r.id+" - "+l.id,r.id,l.id),this.shapeList.push(y),this.zr.addShape(y),o.shape=y,e.linkSymbol&&"none"!==e.linkSymbol){var U=new p({style:{x:-5,y:0,width:e.linkSymbolSize[0],height:e.linkSymbolSize[1],iconType:e.linkSymbol,brushType:"fill",color:y.style.strokeColor},highlightStyle:{brushType:"fill"},position:[0,0],rotation:0});y._symbolShape=U,this.shapeList.push(U),this.zr.addShape(U)}}},_updateLinkShapes:function(){for(var e=y.create(),t=this._graph.edges,i=0,n=t.length;n>i;i++){var a=t[i],o=a.node1.shape,s=a.node2.shape,r=o.position,l=s.position;if(a.shape.style.xStart=r[0],a.shape.style.yStart=r[1],a.shape.style.xEnd=l[0],a.shape.style.yEnd=l[1],"bezier-curve"===a.shape.type&&(a.shape.style.cpX1=(r[0]+l[0])/2-(l[1]-r[1])/4,a.shape.style.cpY1=(r[1]+l[1])/2-(r[0]-l[0])/4),a.shape.modSelf(),a.shape._symbolShape){var h=a.shape._symbolShape;y.copy(h.position,s.position),y.sub(e,o.position,s.position),y.normalize(e,e),y.scaleAndAdd(h.position,h.position,e,s.style.width/2+2);var d=Math.atan2(e[1],e[0]);h.rotation=Math.PI/2-d,h.modSelf()}}},_syncNodePositions:function(){for(var e=this._graph,t=0;t.01?this._layout.step(this._steps):this.messageCenter.dispatch(m.EVENT.FORCE_LAYOUT_END,{},{},this.myChart)},refresh:function(e){if(e&&(this.option=e,this.series=this.option.series),this.legend=this.component.legend,this.legend)this.getColor=function(e){return this.legend.getColor(e)},this.isSelected=function(e){return this.legend.isSelected(e)};else{var t={},i=0;this.getColor=function(e){return t[e]?t[e]:(t[e]||(t[e]=this.zr.getColor(i++)),t[e])},this.isSelected=function(){return!0}}this._init()},dispose:function(){this.clear(),this.shapeList=null,this.effectList=null,this._layout.dispose(),this._layout=null,this.__nodePositionMap={}},getPosition:function(){var e=[];return this._graph.eachNode(function(t){t.layout&&e.push({name:t.data.name,position:Array.prototype.slice.call(t.layout.position)})}),e}},g.inherits(t,s),e("../chart").define("force",t),t}),define("echarts/data/Graph",["require","zrender/tool/util"],function(e){var t=e("zrender/tool/util"),i=function(e){this._directed=e||!1,this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={}};i.prototype.isDirected=function(){return this._directed},i.prototype.addNode=function(e,t){if(this._nodesMap[e])return this._nodesMap[e];var n=new i.Node(e,t);return this.nodes.push(n),this._nodesMap[e]=n,n},i.prototype.getNodeById=function(e){return this._nodesMap[e]},i.prototype.addEdge=function(e,t,n){if("string"==typeof e&&(e=this._nodesMap[e]),"string"==typeof t&&(t=this._nodesMap[t]),e&&t){var a=e.id+"-"+t.id;if(this._edgesMap[a])return this._edgesMap[a];var o=new i.Edge(e,t,n);return this._directed&&(e.outEdges.push(o),t.inEdges.push(o)),e.edges.push(o),e!==t&&t.edges.push(o),this.edges.push(o),this._edgesMap[a]=o,o}},i.prototype.removeEdge=function(e){var i=e.node1,n=e.node2,a=i.id+"-"+n.id;this._directed&&(i.outEdges.splice(t.indexOf(i.outEdges,e),1),n.inEdges.splice(t.indexOf(n.inEdges,e),1)),i.edges.splice(t.indexOf(i.edges,e),1),i!==n&&n.edges.splice(t.indexOf(n.edges,e),1),delete this._edgesMap[a],this.edges.splice(t.indexOf(this.edges,e),1)},i.prototype.getEdge=function(e,t){return"string"!=typeof e&&(e=e.id),"string"!=typeof t&&(t=t.id),this._directed?this._edgesMap[e+"-"+t]:this._edgesMap[e+"-"+t]||this._edgesMap[t+"-"+e]},i.prototype.removeNode=function(e){if("string"!=typeof e||(e=this._nodesMap[e])){delete this._nodesMap[e.id],this.nodes.splice(t.indexOf(this.nodes,e),1);for(var i=0;in;)e.call(t,this.nodes[n],n)?n++:(this.removeNode(this.nodes[n]),i--)},i.prototype.filterEdge=function(e,t){for(var i=this.edges.length,n=0;i>n;)e.call(t,this.edges[n],n)?n++:(this.removeEdge(this.edges[n]),i--)},i.prototype.eachNode=function(e,t){for(var i=this.nodes.length,n=0;i>n;n++)this.nodes[n]&&e.call(t,this.nodes[n],n)},i.prototype.eachEdge=function(e,t){for(var i=this.edges.length,n=0;i>n;n++)this.edges[n]&&e.call(t,this.edges[n],n)},i.prototype.clear=function(){this.nodes.length=0,this.edges.length=0,this._nodesMap={},this._edgesMap={}},i.prototype.breadthFirstTraverse=function(e,t,i,n){if("string"==typeof t&&(t=this._nodesMap[t]),t){var a="edges";"out"===i?a="outEdges":"in"===i&&(a="inEdges");for(var o=0;os;s++){var r=o.addNode(e[s].id,e[s]);r.data.value=0,n&&(r.data.outValue=r.data.inValue=0)}for(var s=0;a>s;s++)for(var l=0;a>l;l++){var h=t[s][l];n&&(o.nodes[s].data.outValue+=h,o.nodes[l].data.inValue+=h),o.nodes[s].data.value+=h,o.nodes[l].data.value+=h}for(var s=0;a>s;s++)for(var l=s;a>l;l++){var h=t[s][l];if(0!==h){var d=o.nodes[s],c=o.nodes[l],p=o.addEdge(d,c,{});if(p.data.weight=h,s!==l&&n&&t[l][s]){var m=o.addEdge(c,d,{});m.data.weight=t[l][s]}}}return o}},i}),define("echarts/layout/Force",["require","./forceLayoutWorker","zrender/tool/vector"],function(e){function t(){if("undefined"!=typeof Worker&&"undefined"!=typeof Blob)try{var e=new Blob([n.getWorkerCode()]);i=window.URL.createObjectURL(e)}catch(t){i=""}return i}var i,n=e("./forceLayoutWorker"),a=e("zrender/tool/vector"),o=window.requestAnimationFrame||window.msRequestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(e){setTimeout(e,16)},s="undefined"==typeof Float32Array?Array:Float32Array,r=function(e){"undefined"==typeof i&&t(),e=e||{},this.width=e.width||500,this.height=e.height||500,this.center=e.center||[this.width/2,this.height/2],this.ratioScaling=e.ratioScaling||!1,this.scaling=e.scaling||1,this.gravity="undefined"!=typeof e.gravity?e.gravity:1,this.large=e.large||!1,this.preventNodeOverlap=e.preventNodeOverlap||!1,this.preventNodeEdgeOverlap=e.preventNodeEdgeOverlap||!1,this.maxSpeedIncrease=e.maxSpeedIncrease||1,this.onupdate=e.onupdate||function(){},this.temperature=e.temperature||1,this.coolDown=e.coolDown||.99,this._layout=null,this._layoutWorker=null;var n=this,a=this._$onupdate;this._$onupdate=function(e){a.call(n,e)}};return r.prototype.updateConfig=function(){var e=this.width,t=this.height,i=Math.min(e,t),n={center:this.center,width:this.ratioScaling?e:i,height:this.ratioScaling?t:i,scaling:this.scaling||1,gravity:this.gravity||1,barnesHutOptimize:this.large,preventNodeOverlap:this.preventNodeOverlap,preventNodeEdgeOverlap:this.preventNodeEdgeOverlap,maxSpeedIncrease:this.maxSpeedIncrease};if(this._layoutWorker)this._layoutWorker.postMessage({cmd:"updateConfig",config:n});else for(var a in n)this._layout[a]=n[a]},r.prototype.init=function(e,t){if(i&&t)try{this._layoutWorker||(this._layoutWorker=new Worker(i),this._layoutWorker.onmessage=this._$onupdate),this._layout=null}catch(a){this._layoutWorker=null,this._layout||(this._layout=new n)}else this._layout||(this._layout=new n),this._layoutWorker&&(this._layoutWorker.terminate(),this._layoutWorker=null);this.temperature=1,this.graph=e;for(var o=e.nodes.length,r=new s(2*o),l=new s(o),h=new s(o),d=0;o>d;d++){var c=e.nodes[d];r[2*d]=c.layout.position[0],r[2*d+1]=c.layout.position[1],l[d]="undefined"==typeof c.layout.mass?1:c.layout.mass,h[d]="undefined"==typeof c.layout.size?1:c.layout.size,c.layout.__index=d}o=e.edges.length;for(var p=new s(2*o),m=new s(o),d=0;o>d;d++){var u=e.edges[d];p[2*d]=u.node1.layout.__index,p[2*d+1]=u.node2.layout.__index,m[d]=u.layout.weight||1}this._layoutWorker?this._layoutWorker.postMessage({cmd:"init",nodesPosition:r,nodesMass:l,nodesSize:h,edges:p,edgesWeight:m}):(this._layout.initNodes(r,l,h),this._layout.initEdges(p,m)),this.updateConfig()},r.prototype.step=function(e){var t=this.graph.nodes;if(this._layoutWorker){for(var i=new s(2*t.length),n=0;nn;n++)this.temperature*=this.coolDown}else{o(this._$onupdate);for(var n=0;nn;n++)this._layout.temperature=this.temperature,this._layout.update(),this.temperature*=this.coolDown}},r.prototype._$onupdate=function(e){if(this._layoutWorker){for(var t=new Float32Array(e.data),i=0;i0&&(a=1/Math.sqrt(a),e[0]=t[0]*a,e[1]=t[1]*a),e},negate:function(e,t){return e[0]=-t[0],e[1]=-t[1],e},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e},set:function(e,t,i){return e[0]=t,e[1]=i,e}}:t("zrender/tool/vector");var l="undefined"==typeof Float32Array?Array:Float32Array;if(i.prototype.beforeUpdate=function(){for(var e=0;e=e&&this.bbox[1]<=t&&this.bbox[3]>=t},i.prototype.setBBox=function(e,t,i,n){this.bbox[0]=e,this.bbox[1]=t,this.bbox[2]=i,this.bbox[3]=n,this.size=(i-e+n-t)/2},i.prototype._newSubRegion=function(){var e=this.subRegions[this.nSubRegions];return e||(e=new i,this.subRegions[this.nSubRegions]=e),this.nSubRegions++,e},i.prototype._addNodeToSubRegion=function(e){var t=this.findSubRegion(e.position[0],e.position[1]),i=this.bbox;if(!t){var n=(i[0]+i[2])/2,a=(i[1]+i[3])/2,o=(i[2]-i[0])/2,s=(i[3]-i[1])/2,r=e.position[0]>=n?1:0,l=e.position[1]>=a?1:0,t=this._newSubRegion();t.setBBox(r*o+i[0],l*s+i[1],(r+1)*o+i[0],(l+1)*s+i[1])}t.addNode(e)},i.prototype._updateCenterOfMass=function(e){null==this.centerOfMass&&(this.centerOfMass=s.create());var t=this.centerOfMass[0]*this.mass,i=this.centerOfMass[1]*this.mass;t+=e.position[0]*e.mass,i+=e.position[1]*e.mass,this.mass+=e.mass,this.centerOfMass[0]=t/this.mass,this.centerOfMass[1]=i/this.mass},o.prototype.nodeToNodeRepulsionFactor=function(e,t,i){return i*i*e/t},o.prototype.edgeToNodeRepulsionFactor=function(e,t,i){return i*e/t},o.prototype.attractionFactor=function(e,t,i){return e*t/i},o.prototype.initNodes=function(e,t,i){this.temperature=1;var a=e.length/2;this.nodes.length=0;for(var o="undefined"!=typeof i,s=0;a>s;s++){var r=new n;r.position[0]=e[2*s],r.position[1]=e[2*s+1],r.mass=t[s],o&&(r.size=i[s]),this.nodes.push(r)}this._massArr=t,o&&(this._sizeArr=i)},o.prototype.initEdges=function(e,t){var i=e.length/2;this.edges.length=0;for(var n="undefined"!=typeof t,o=0;i>o;o++){var s=e[2*o],r=e[2*o+1],l=this.nodes[s],h=this.nodes[r];if(l&&h){l.outDegree++,h.inDegree++;var d=new a(l,h);n&&(d.weight=t[o]),this.edges.push(d)}}},o.prototype.update=function(){var e=this.nodes.length;if(this.updateBBox(),this._k=.4*this.scaling*Math.sqrt(this.width*this.height/e),this.barnesHutOptimize){this._rootRegion.setBBox(this.bbox[0],this.bbox[1],this.bbox[2],this.bbox[3]),this._rootRegion.beforeUpdate();for(var t=0;e>t;t++)this._rootRegion.addNode(this.nodes[t]);this._rootRegion.afterUpdate()}else{var i=0,n=this._rootRegion.centerOfMass;s.set(n,0,0);for(var t=0;e>t;t++){var a=this.nodes[t];i+=a.mass,s.scaleAndAdd(n,n,a.position,a.mass)}i>0&&s.scale(n,n,1/i)}this.updateForce(),this.updatePosition()},o.prototype.updateForce=function(){for(var e=this.nodes.length,t=0;e>t;t++){var i=this.nodes[t];s.copy(i.forcePrev,i.force),s.copy(i.speedPrev,i.speed),s.set(i.force,0,0)}this.updateNodeNodeForce(),this.gravity>0&&this.updateGravityForce(),this.updateEdgeForce(),this.preventNodeEdgeOverlap&&this.updateNodeEdgeForce()},o.prototype.updatePosition=function(){for(var e=this.nodes.length,t=s.create(),i=0;e>i;i++){var n=this.nodes[i],a=n.speed;s.scale(n.force,n.force,1/30);var o=s.len(n.force)+.1,r=Math.min(o,500)/o;s.scale(n.force,n.force,r),s.add(a,a,n.force),s.scale(a,a,this.temperature),s.sub(t,a,n.speedPrev);var l=s.len(t);if(l>0){s.scale(t,t,1/l);var h=s.len(n.speedPrev);h>0&&(l=Math.min(l/h,this.maxSpeedIncrease)*h,s.scaleAndAdd(a,n.speedPrev,t,l))}var d=s.len(a),r=Math.min(d,100)/(d+.1);s.scale(a,a,r),s.add(n.position,n.position,a)}},o.prototype.updateNodeNodeForce=function(){for(var e=this.nodes.length,t=0;e>t;t++){var i=this.nodes[t];if(this.barnesHutOptimize)this.applyRegionToNodeRepulsion(this._rootRegion,i);else for(var n=t+1;e>n;n++){var a=this.nodes[n];this.applyNodeToNodeRepulsion(i,a,!1)}}},o.prototype.updateGravityForce=function(){for(var e=0;ethis.barnesHutTheta*t.size*t.size){var a=this._k*this._k*(i.mass+t.mass)/(n+1);s.scaleAndAdd(i.force,i.force,e,2*a)}else for(var o=0;o0?o=this.nodeToNodeRepulsionFactor(r,l,this._k):0>=l&&(o=this._k*this._k*10*r)):o=this.nodeToNodeRepulsionFactor(r,l,this._k),n||s.scaleAndAdd(t.force,t.force,e,2*o),s.scaleAndAdd(i.force,i.force,e,2*-o)}}}}(),o.prototype.applyEdgeAttraction=function(){var e=s.create();return function(t){var i=t.node1,n=t.node2;s.sub(e,i.position,n.position);var a,o=s.len(e);a=0===this.edgeWeightInfluence?1:1==this.edgeWeightInfluence?t.weight:Math.pow(t.weight,this.edgeWeightInfluence);var r;if(!(this.preventOverlap&&(o=o-i.size-n.size,0>=o))){var r=this.attractionFactor(a,o,this._k);s.scaleAndAdd(i.force,i.force,e,-r),s.scaleAndAdd(n.force,n.force,e,r)}}}(),o.prototype.applyNodeGravity=function(){var e=s.create();return function(t){s.sub(e,this.center,t.position),this.width>this.height?e[1]*=this.width/this.height:e[0]*=this.height/this.width;var i=s.len(e)/100;this.strongGravity?s.scaleAndAdd(t.force,t.force,e,i*this.gravity*t.mass):s.scaleAndAdd(t.force,t.force,e,this.gravity*t.mass/(i+1))}}(),o.prototype.applyEdgeToNodeRepulsion=function(){var e=s.create(),t=s.create(),i=s.create();return function(n,a){var o=n.node1,r=n.node2;if(o!==a&&r!==a){s.sub(e,r.position,o.position),s.sub(t,a.position,o.position);var l=s.len(e);s.scale(e,e,1/l);var h=s.dot(e,t);if(!(0>h||h>l)){s.scaleAndAdd(i,o.position,e,h);var d=s.dist(i,a.position)-a.size,c=this.edgeToNodeRepulsionFactor(a.mass,Math.max(d,.1),100);s.sub(e,a.position,i),s.normalize(e,e),s.scaleAndAdd(a.force,a.force,e,c),s.scaleAndAdd(o.force,o.force,e,-c),s.scaleAndAdd(r.force,r.force,e,-c)}}}}(),o.prototype.updateBBox=function(){for(var e=1/0,t=1/0,i=-1/0,n=-1/0,a=0;an;n++){var a=h.nodes[n];a.position[0]=t[2*n],a.position[1]=t[2*n+1]}}else switch(e.data.cmd){case"init":h||(h=new o),h.initNodes(e.data.nodesPosition,e.data.nodesMass,e.data.nodesSize),h.initEdges(e.data.edges,e.data.edgesWeight);break;case"updateConfig":if(h)for(var s in e.data.config)h[s]=e.data.config[s];break;case"update":var r=e.data.steps;if(h){var i=h.nodes.length,t=new Float32Array(2*i);h.temperature=e.data.temperature;for(var n=0;r>n;n++)h.update(),h.temperature*=e.data.coolDown;for(var n=0;i>n;n++){var a=h.nodes[n];t[2*n]=a.position[0],t[2*n+1]=a.position[1]}self.postMessage(t.buffer,[t.buffer])}else{var l=new Float32Array;self.postMessage(l.buffer,[l.buffer])}}}}return o}); \ No newline at end of file diff --git a/build/dist/chart/funnel.js b/build/dist/chart/funnel.js new file mode 100644 index 0000000..4b04117 --- /dev/null +++ b/build/dist/chart/funnel.js @@ -0,0 +1 @@ +define("echarts/chart/funnel",["require","./base","zrender/shape/Text","zrender/shape/Line","zrender/shape/Polygon","../config","../util/ecData","../util/number","zrender/tool/util","zrender/tool/color","zrender/tool/area","../chart"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o),this.refresh(a)}var n=e("./base"),i=e("zrender/shape/Text"),a=e("zrender/shape/Line"),o=e("zrender/shape/Polygon"),s=e("../config");s.funnel={zlevel:0,z:2,clickable:!0,legendHoverLink:!0,x:80,y:60,x2:80,y2:60,min:0,max:100,minSize:"0%",maxSize:"100%",sort:"descending",gap:0,funnelAlign:"center",itemStyle:{normal:{borderColor:"#fff",borderWidth:1,label:{show:!0,position:"outer"},labelLine:{show:!0,length:10,lineStyle:{width:1,type:"solid"}}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!0},labelLine:{show:!0}}}};var r=e("../util/ecData"),l=e("../util/number"),h=e("zrender/tool/util"),m=e("zrender/tool/color"),V=e("zrender/tool/area");return t.prototype={type:s.CHART_TYPE_FUNNEL,_buildShape:function(){var e=this.series,t=this.component.legend;this._paramsMap={},this._selected={},this.selectedMap={};for(var n,i=0,a=e.length;a>i;i++)if(e[i].type===s.CHART_TYPE_FUNNEL){if(e[i]=this.reformOption(e[i]),this.legendHoverLink=e[i].legendHoverLink||this.legendHoverLink,n=e[i].name||"",this.selectedMap[n]=t?t.isSelected(n):!0,!this.selectedMap[n])continue;this._buildSingleFunnel(i),this.buildMark(i)}this.addShapeList()},_buildSingleFunnel:function(e){var t=this.component.legend,n=this.series[e],i=this._mapData(e),a=this._getLocation(e);this._paramsMap[e]={location:a,data:i};for(var o,s=0,r=[],h=0,m=i.length;m>h;h++)o=i[h].name,this.selectedMap[o]=t?t.isSelected(o):!0,this.selectedMap[o]&&!isNaN(i[h].value)&&(r.push(i[h]),s++);if(0!==s){for(var V,U,d,p,c=this._buildFunnelCase(e),u=n.funnelAlign,y=n.gap,g=s>1?(a.height-(s-1)*y)/s:a.height,b=a.y,f="descending"===n.sort?this._getItemWidth(e,r[0].value):l.parsePercent(n.minSize,a.width),k="descending"===n.sort?1:0,x=a.centerX,_=[],h=0,m=r.length;m>h;h++)if(o=r[h].name,this.selectedMap[o]&&!isNaN(r[h].value)){switch(V=m-2>=h?this._getItemWidth(e,r[h+k].value):"descending"===n.sort?l.parsePercent(n.minSize,a.width):l.parsePercent(n.maxSize,a.width),u){case"left":U=a.x;break;case"right":U=a.x+a.width-f;break;default:U=x-f/2}d=this._buildItem(e,r[h]._index,t?t.getColor(o):this.zr.getColor(r[h]._index),U,b,f,V,g,u),b+=g+y,p=d.style.pointList,_.unshift([p[0][0]-10,p[0][1]]),_.push([p[1][0]+10,p[1][1]]),0===h&&(0===f?(p=_.pop(),"center"==u&&(_[0][0]+=10),"right"==u&&(_[0][0]=p[0]),_[0][1]-="center"==u?10:15,1==m&&(p=d.style.pointList)):(_[_.length-1][1]-=5,_[0][1]-=5)),f=V}c&&(_.unshift([p[3][0]-10,p[3][1]]),_.push([p[2][0]+10,p[2][1]]),0===f?(p=_.pop(),"center"==u&&(_[0][0]+=10),"right"==u&&(_[0][0]=p[0]),_[0][1]+="center"==u?10:15):(_[_.length-1][1]+=5,_[0][1]+=5),c.style.pointList=_)}},_buildFunnelCase:function(e){var t=this.series[e];if(this.deepQuery([t,this.option],"calculable")){var n=this._paramsMap[e].location,i=10,a={hoverable:!1,style:{pointListd:[[n.x-i,n.y-i],[n.x+n.width+i,n.y-i],[n.x+n.width+i,n.y+n.height+i],[n.x-i,n.y+n.height+i]],brushType:"stroke",lineWidth:1,strokeColor:t.calculableHolderColor||this.ecTheme.calculableHolderColor||s.calculableHolderColor}};return r.pack(a,t,e,void 0,-1),this.setCalculable(a),a=new o(a),this.shapeList.push(a),a}},_getLocation:function(e){var t=this.series[e],n=this.zr.getWidth(),i=this.zr.getHeight(),a=this.parsePercent(t.x,n),o=this.parsePercent(t.y,i),s=null==t.width?n-a-this.parsePercent(t.x2,n):this.parsePercent(t.width,n);return{x:a,y:o,width:s,height:null==t.height?i-o-this.parsePercent(t.y2,i):this.parsePercent(t.height,i),centerX:a+s/2}},_mapData:function(e){function t(e,t){return"-"===e.value?1:"-"===t.value?-1:t.value-e.value}function n(e,n){return-t(e,n)}for(var i=this.series[e],a=h.clone(i.data),o=0,s=a.length;s>o;o++)a[o]._index=o;return"none"!=i.sort&&a.sort("descending"===i.sort?t:n),a},_buildItem:function(e,t,n,i,a,o,s,l,h){var m=this.series,V=m[e],U=V.data[t],d=this.getPolygon(e,t,n,i,a,o,s,l,h);r.pack(d,m[e],e,m[e].data[t],t,m[e].data[t].name),this.shapeList.push(d);var p=this.getLabel(e,t,n,i,a,o,s,l,h);r.pack(p,m[e],e,m[e].data[t],t,m[e].data[t].name),this.shapeList.push(p),this._needLabel(V,U,!1)||(p.invisible=!0);var c=this.getLabelLine(e,t,n,i,a,o,s,l,h);this.shapeList.push(c),this._needLabelLine(V,U,!1)||(c.invisible=!0);var u=[],y=[];return this._needLabelLine(V,U,!0)&&(u.push(c.id),y.push(c.id)),this._needLabel(V,U,!0)&&(u.push(p.id),y.push(d.id)),d.hoverConnect=u,p.hoverConnect=y,d},_getItemWidth:function(e,t){var n=this.series[e],i=this._paramsMap[e].location,a=n.min,o=n.max,s=l.parsePercent(n.minSize,i.width),r=l.parsePercent(n.maxSize,i.width);return t*(r-s)/(o-a)},getPolygon:function(e,t,n,i,a,s,r,l,h){var V,U=this.series[e],d=U.data[t],p=[d,U],c=this.deepMerge(p,"itemStyle.normal")||{},u=this.deepMerge(p,"itemStyle.emphasis")||{},y=this.getItemStyleColor(c.color,e,t,d)||n,g=this.getItemStyleColor(u.color,e,t,d)||("string"==typeof y?m.lift(y,-.2):y);switch(h){case"left":V=i;break;case"right":V=i+(s-r);break;default:V=i+(s-r)/2}var b={zlevel:this.getZlevelBase(),z:this.getZBase(),clickable:this.deepQuery(p,"clickable"),style:{pointList:[[i,a],[i+s,a],[V+r,a+l],[V,a+l]],brushType:"both",color:y,lineWidth:c.borderWidth,strokeColor:c.borderColor},highlightStyle:{color:g,lineWidth:u.borderWidth,strokeColor:u.borderColor}};return this.deepQuery([d,U,this.option],"calculable")&&(this.setCalculable(b),b.draggable=!0),new o(b)},getLabel:function(e,t,n,a,o,s,r,l,U){var d,p=this.series[e],c=p.data[t],u=this._paramsMap[e].location,y=h.merge(h.clone(c.itemStyle)||{},p.itemStyle),g="normal",b=y[g].label,f=b.textStyle||{},k=y[g].labelLine.length,x=this.getLabelText(e,t,g),_=this.getFont(f),L=n;b.position=b.position||y.normal.label.position,"inner"===b.position||"inside"===b.position||"center"===b.position?(d=U,L=Math.max(s,r)/2>V.getTextWidth(x,_)?"#fff":m.reverse(n)):d="left"===b.position?"right":"left";var W={zlevel:this.getZlevelBase(),z:this.getZBase()+1,style:{x:this._getLabelPoint(b.position,a,u,s,r,k,U),y:o+l/2,color:f.color||L,text:x,textAlign:f.align||d,textBaseline:f.baseline||"middle",textFont:_}};return g="emphasis",b=y[g].label||b,f=b.textStyle||f,k=y[g].labelLine.length||k,b.position=b.position||y.normal.label.position,x=this.getLabelText(e,t,g),_=this.getFont(f),L=n,"inner"===b.position||"inside"===b.position||"center"===b.position?(d=U,L=Math.max(s,r)/2>V.getTextWidth(x,_)?"#fff":m.reverse(n)):d="left"===b.position?"right":"left",W.highlightStyle={x:this._getLabelPoint(b.position,a,u,s,r,k,U),color:f.color||L,text:x,textAlign:f.align||d,textFont:_,brushType:"fill"},new i(W)},getLabelText:function(e,t,n){var i=this.series,a=i[e],o=a.data[t],s=this.deepQuery([o,a],"itemStyle."+n+".label.formatter");return s?"function"==typeof s?s.call(this.myChart,{seriesIndex:e,seriesName:a.name||"",series:a,dataIndex:t,data:o,name:o.name,value:o.value}):"string"==typeof s?s=s.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}").replace("{a0}",a.name).replace("{b0}",o.name).replace("{c0}",o.value):void 0:o.name},getLabelLine:function(e,t,n,i,o,s,r,l,m){var V=this.series[e],U=V.data[t],d=this._paramsMap[e].location,p=h.merge(h.clone(U.itemStyle)||{},V.itemStyle),c="normal",u=p[c].labelLine,y=p[c].labelLine.length,g=u.lineStyle||{},b=p[c].label;b.position=b.position||p.normal.label.position;var f={zlevel:this.getZlevelBase(),z:this.getZBase()+1,hoverable:!1,style:{xStart:this._getLabelLineStartPoint(i,d,s,r,m),yStart:o+l/2,xEnd:this._getLabelPoint(b.position,i,d,s,r,y,m),yEnd:o+l/2,strokeColor:g.color||n,lineType:g.type,lineWidth:g.width}};return c="emphasis",u=p[c].labelLine||u,y=p[c].labelLine.length||y,g=u.lineStyle||g,b=p[c].label||b,b.position=b.position,f.highlightStyle={xEnd:this._getLabelPoint(b.position,i,d,s,r,y,m),strokeColor:g.color||n,lineType:g.type,lineWidth:g.width},new a(f)},_getLabelPoint:function(e,t,n,i,a,o,s){switch(e="inner"===e||"inside"===e?"center":e){case"center":return"center"==s?t+i/2:"left"==s?t+10:t+i-10;case"left":return"auto"===o?n.x-10:"center"==s?n.centerX-Math.max(i,a)/2-o:"right"==s?t-(a>i?a-i:0)-o:n.x-o;default:return"auto"===o?n.x+n.width+10:"center"==s?n.centerX+Math.max(i,a)/2+o:"right"==s?n.x+n.width+o:t+Math.max(i,a)+o}},_getLabelLineStartPoint:function(e,t,n,i,a){return"center"==a?t.centerX:i>n?e+Math.min(n,i)/2:e+Math.max(n,i)/2},_needLabel:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".label.show")},_needLabelLine:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".labelLine.show")},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()}},h.inherits(t,n),e("../chart").define("funnel",t),t}); \ No newline at end of file diff --git a/build/dist/chart/gauge.js b/build/dist/chart/gauge.js new file mode 100644 index 0000000..9f4f98c --- /dev/null +++ b/build/dist/chart/gauge.js @@ -0,0 +1 @@ +define("echarts/chart/gauge",["require","./base","../util/shape/GaugePointer","zrender/shape/Text","zrender/shape/Line","zrender/shape/Rectangle","zrender/shape/Circle","zrender/shape/Sector","../config","../util/ecData","../util/accMath","zrender/tool/util","../chart"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o),this.refresh(a)}var n=e("./base"),i=e("../util/shape/GaugePointer"),a=e("zrender/shape/Text"),o=e("zrender/shape/Line"),s=e("zrender/shape/Rectangle"),r=e("zrender/shape/Circle"),l=e("zrender/shape/Sector"),h=e("../config");h.gauge={zlevel:0,z:2,center:["50%","50%"],clickable:!0,legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,min:0,max:100,precision:0,splitNumber:10,axisLine:{show:!0,lineStyle:{color:[[.2,"#228b22"],[.8,"#48b"],[1,"#ff4500"]],width:30}},axisTick:{show:!0,splitNumber:5,length:8,lineStyle:{color:"#eee",width:1,type:"solid"}},axisLabel:{show:!0,textStyle:{color:"auto"}},splitLine:{show:!0,length:30,lineStyle:{color:"#eee",width:2,type:"solid"}},pointer:{show:!0,length:"80%",width:8,color:"auto"},title:{show:!0,offsetCenter:[0,"-40%"],textStyle:{color:"#333",fontSize:15}},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:40,offsetCenter:[0,"40%"],textStyle:{color:"auto",fontSize:30}}};var m=e("../util/ecData"),V=e("../util/accMath"),U=e("zrender/tool/util");return t.prototype={type:h.CHART_TYPE_GAUGE,_buildShape:function(){var e=this.series;this._paramsMap={};for(var t=0,n=e.length;n>t;t++)e[t].type===h.CHART_TYPE_GAUGE&&(e[t]=this.reformOption(e[t]),this.legendHoverLink=e[t].legendHoverLink||this.legendHoverLink,this._buildSingleGauge(t),this.buildMark(t));this.addShapeList()},_buildSingleGauge:function(e){var t=this.series[e];this._paramsMap[e]={center:this.parseCenter(this.zr,t.center),radius:this.parseRadius(this.zr,t.radius),startAngle:t.startAngle.toFixed(2)-0,endAngle:t.endAngle.toFixed(2)-0},this._paramsMap[e].totalAngle=this._paramsMap[e].startAngle-this._paramsMap[e].endAngle,this._colorMap(e),this._buildAxisLine(e),this._buildSplitLine(e),this._buildAxisTick(e),this._buildAxisLabel(e),this._buildPointer(e),this._buildTitle(e),this._buildDetail(e)},_buildAxisLine:function(e){var t=this.series[e];if(t.axisLine.show)for(var n,i,a=t.min,o=t.max-a,s=this._paramsMap[e],r=s.center,l=s.startAngle,h=s.totalAngle,V=s.colorArray,U=t.axisLine.lineStyle,d=this.parsePercent(U.width,s.radius[1]),p=s.radius[1],c=p-d,u=l,y=0,g=V.length;g>y;y++)i=l-h*(V[y][0]-a)/o,n=this._getSector(r,c,p,i,u,V[y][1],U),u=i,n._animationAdd="r",m.set(n,"seriesIndex",e),m.set(n,"dataIndex",y),this.shapeList.push(n)},_buildSplitLine:function(e){var t=this.series[e];if(t.splitLine.show)for(var n,i,a,s=this._paramsMap[e],r=t.splitNumber,l=t.min,h=t.max-l,m=t.splitLine,V=this.parsePercent(m.length,s.radius[1]),U=m.lineStyle,d=U.color,p=s.center,c=s.startAngle*Math.PI/180,u=s.totalAngle*Math.PI/180,y=s.radius[1],g=y-V,b=0;r>=b;b++)n=c-u/r*b,i=Math.sin(n),a=Math.cos(n),this.shapeList.push(new o({zlevel:this.getZlevelBase(),z:this.getZBase()+1,hoverable:!1,style:{xStart:p[0]+a*y,yStart:p[1]-i*y,xEnd:p[0]+a*g,yEnd:p[1]-i*g,strokeColor:"auto"===d?this._getColor(e,l+h/r*b):d,lineType:U.type,lineWidth:U.width,shadowColor:U.shadowColor,shadowBlur:U.shadowBlur,shadowOffsetX:U.shadowOffsetX,shadowOffsetY:U.shadowOffsetY}}))},_buildAxisTick:function(e){var t=this.series[e];if(t.axisTick.show)for(var n,i,a,s=this._paramsMap[e],r=t.splitNumber,l=t.min,h=t.max-l,m=t.axisTick,V=m.splitNumber,U=this.parsePercent(m.length,s.radius[1]),d=m.lineStyle,p=d.color,c=s.center,u=s.startAngle*Math.PI/180,y=s.totalAngle*Math.PI/180,g=s.radius[1],b=g-U,f=0,k=r*V;k>=f;f++)f%V!==0&&(n=u-y/k*f,i=Math.sin(n),a=Math.cos(n),this.shapeList.push(new o({zlevel:this.getZlevelBase(),z:this.getZBase()+1,hoverable:!1,style:{xStart:c[0]+a*g,yStart:c[1]-i*g,xEnd:c[0]+a*b,yEnd:c[1]-i*b,strokeColor:"auto"===p?this._getColor(e,l+h/k*f):p,lineType:d.type,lineWidth:d.width,shadowColor:d.shadowColor,shadowBlur:d.shadowBlur,shadowOffsetX:d.shadowOffsetX,shadowOffsetY:d.shadowOffsetY}})))},_buildAxisLabel:function(e){var t=this.series[e];if(t.axisLabel.show)for(var n,i,o,s,r=t.splitNumber,l=t.min,h=t.max-l,m=t.axisLabel.textStyle,U=this.getFont(m),d=m.color,p=this._paramsMap[e],c=p.center,u=p.startAngle,y=p.totalAngle,g=p.radius[1]-this.parsePercent(t.splitLine.length,p.radius[1])-5,b=0;r>=b;b++)s=V.accAdd(l,V.accMul(V.accDiv(h,r),b)),n=u-y/r*b,i=Math.sin(n*Math.PI/180),o=Math.cos(n*Math.PI/180),n=(n+360)%360,this.shapeList.push(new a({zlevel:this.getZlevelBase(),z:this.getZBase()+1,hoverable:!1,style:{x:c[0]+o*g,y:c[1]-i*g,color:"auto"===d?this._getColor(e,s):d,text:this._getLabelText(t.axisLabel.formatter,s),textAlign:n>=110&&250>=n?"left":70>=n||n>=290?"right":"center",textBaseline:n>=10&&170>=n?"top":n>=190&&350>=n?"bottom":"middle",textFont:U,shadowColor:m.shadowColor,shadowBlur:m.shadowBlur,shadowOffsetX:m.shadowOffsetX,shadowOffsetY:m.shadowOffsetY}}))},_buildPointer:function(e){var t=this.series[e];if(t.pointer.show){var n=t.max-t.min,a=t.pointer,o=this._paramsMap[e],s=this.parsePercent(a.length,o.radius[1]),l=this.parsePercent(a.width,o.radius[1]),h=o.center,V=this._getValue(e);V=V2?2:l/2,color:"#fff"}});m.pack(p,this.series[e],e,this.series[e].data[0],0,this.series[e].data[0].name,V),this.shapeList.push(p),this.shapeList.push(new r({zlevel:this.getZlevelBase(),z:this.getZBase()+2,hoverable:!1,style:{x:h[0],y:h[1],r:a.width/2.5,color:"#fff"}}))}},_buildTitle:function(e){var t=this.series[e];if(t.title.show){var n=t.data[0],i=null!=n.name?n.name:"";if(""!==i){var o=t.title,s=o.offsetCenter,r=o.textStyle,l=r.color,h=this._paramsMap[e],m=h.center[0]+this.parsePercent(s[0],h.radius[1]),V=h.center[1]+this.parsePercent(s[1],h.radius[1]);this.shapeList.push(new a({zlevel:this.getZlevelBase(),z:this.getZBase()+(Math.abs(m-h.center[0])+Math.abs(V-h.center[1])<2*r.fontSize?2:1),hoverable:!1,style:{x:m,y:V,color:"auto"===l?this._getColor(e):l,text:i,textAlign:"center",textFont:this.getFont(r),shadowColor:r.shadowColor,shadowBlur:r.shadowBlur,shadowOffsetX:r.shadowOffsetX,shadowOffsetY:r.shadowOffsetY}}))}}},_buildDetail:function(e){var t=this.series[e];if(t.detail.show){var n=t.detail,i=n.offsetCenter,a=n.backgroundColor,o=n.textStyle,r=o.color,l=this._paramsMap[e],h=this._getValue(e),m=l.center[0]-n.width/2+this.parsePercent(i[0],l.radius[1]),V=l.center[1]+this.parsePercent(i[1],l.radius[1]);this.shapeList.push(new s({zlevel:this.getZlevelBase(),z:this.getZBase()+(Math.abs(m+n.width/2-l.center[0])+Math.abs(V+n.height/2-l.center[1])s;s++)o.push([a[s][0]*i+n,a[s][1]]);this._paramsMap[e].colorArray=o},_getColor:function(e,t){null==t&&(t=this._getValue(e));for(var n=this._paramsMap[e].colorArray,i=0,a=n.length;a>i;i++)if(n[i][0]>=t)return n[i][1];return n[n.length-1][1]},_getSector:function(e,t,n,i,a,o,s){return new l({zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:e[0],y:e[1],r0:t,r:n,startAngle:i,endAngle:a,brushType:"fill",color:o,shadowColor:s.shadowColor,shadowBlur:s.shadowBlur,shadowOffsetX:s.shadowOffsetX,shadowOffsetY:s.shadowOffsetY}})},_getLabelText:function(e,t){if(e){if("function"==typeof e)return e.call(this.myChart,t);if("string"==typeof e)return e.replace("{value}",t)}return t},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()}},U.inherits(t,n),e("../chart").define("gauge",t),t}),define("echarts/util/shape/GaugePointer",["require","zrender/shape/Base","zrender/tool/util","./normalIsCover"],function(e){function t(e){n.call(this,e)}var n=e("zrender/shape/Base"),i=e("zrender/tool/util");return t.prototype={type:"gauge-pointer",buildPath:function(e,t){var n=t.r,i=t.width,a=t.angle,o=t.x-Math.cos(a)*i*(i>=n/3?1:2),s=t.y+Math.sin(a)*i*(i>=n/3?1:2);a=t.angle-Math.PI/2,e.moveTo(o,s),e.lineTo(t.x+Math.cos(a)*i,t.y-Math.sin(a)*i),e.lineTo(t.x+Math.cos(t.angle)*n,t.y-Math.sin(t.angle)*n),e.lineTo(t.x-Math.cos(a)*i,t.y+Math.sin(a)*i),e.lineTo(o,s)},getRect:function(e){if(e.__rect)return e.__rect;var t=2*e.width,n=e.x,i=e.y,a=n+Math.cos(e.angle)*e.r,o=i-Math.sin(e.angle)*e.r;return e.__rect={x:Math.min(n,a)-t,y:Math.min(i,o)-t,width:Math.abs(n-a)+t,height:Math.abs(i-o)+t},e.__rect},isCover:e("./normalIsCover")},i.inherits(t,n),t}); \ No newline at end of file diff --git a/build/dist/chart/k.js b/build/dist/chart/k.js new file mode 100644 index 0000000..a2e4173 --- /dev/null +++ b/build/dist/chart/k.js @@ -0,0 +1 @@ +define("echarts/chart/k",["require","./base","../util/shape/Candle","../component/axis","../component/grid","../component/dataZoom","../config","../util/ecData","zrender/tool/util","../chart"],function(e){function t(e,t,n,a,o){i.call(this,e,t,n,a,o),this.refresh(a)}var i=e("./base"),n=e("../util/shape/Candle");e("../component/axis"),e("../component/grid"),e("../component/dataZoom");var a=e("../config");a.k={zlevel:0,z:2,clickable:!0,hoverable:!0,legendHoverLink:!1,xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{color:"#fff",color0:"#00aa11",lineStyle:{width:1,color:"#ff3200",color0:"#00aa11"}},emphasis:{}}};var o=e("../util/ecData"),s=e("zrender/tool/util");return t.prototype={type:a.CHART_TYPE_K,_buildShape:function(){var e=this.series;this.selectedMap={};for(var t,i={top:[],bottom:[]},n=0,o=e.length;o>n;n++)e[n].type===a.CHART_TYPE_K&&(e[n]=this.reformOption(e[n]),this.legendHoverLink=e[n].legendHoverLink||this.legendHoverLink,t=this.component.xAxis.getAxis(e[n].xAxisIndex),t.type===a.COMPONENT_TYPE_AXIS_CATEGORY&&i[t.getPosition()].push(n));for(var s in i)i[s].length>0&&this._buildSinglePosition(s,i[s]);this.addShapeList()},_buildSinglePosition:function(e,t){var i=this._mapData(t),n=i.locationMap,a=i.maxDataLength;if(0!==a&&0!==n.length){this._buildHorizontal(t,a,n);for(var o=0,s=t.length;s>o;o++)this.buildMark(t[o])}},_mapData:function(e){for(var t,i,n=this.series,a=this.component.legend,o=[],s=0,r=0,l=e.length;l>r;r++)t=n[e[r]],i=t.name,this.selectedMap[i]=a?a.isSelected(i):!0,this.selectedMap[i]&&o.push(e[r]),s=Math.max(s,t.data.length);return{locationMap:o,maxDataLength:s}},_buildHorizontal:function(e,t,i){for(var n,a,o,s,r,l,h,d,m,c,p=this.series,u={},V=0,U=i.length;U>V;V++){n=i[V],a=p[n],o=a.xAxisIndex||0,s=this.component.xAxis.getAxis(o),h=a.barWidth||Math.floor(s.getGap()/2),c=a.barMaxWidth,c&&h>c&&(h=c),r=a.yAxisIndex||0,l=this.component.yAxis.getAxis(r),u[n]=[];for(var g=0,y=t;y>g&&null!=s.getNameByIndex(g);g++)d=a.data[g],m=this.getDataFromOption(d,"-"),"-"!==m&&4==m.length&&u[n].push([s.getCoordByIndex(g),h,l.getCoord(m[0]),l.getCoord(m[1]),l.getCoord(m[2]),l.getCoord(m[3]),g,s.getNameByIndex(g)])}this._buildKLine(e,u)},_buildKLine:function(e,t){for(var i,n,o,s,r,l,h,d,m,c,p,u,V,U,g,y,f,b=this.series,_=0,x=e.length;x>_;_++)if(f=e[_],p=b[f],U=t[f],this._isLarge(U)&&(U=this._getLargePointList(U)),p.type===a.CHART_TYPE_K&&null!=U){u=p,i=this.query(u,"itemStyle.normal.lineStyle.width"),n=this.query(u,"itemStyle.normal.lineStyle.color"),o=this.query(u,"itemStyle.normal.lineStyle.color0"),s=this.query(u,"itemStyle.normal.color"),r=this.query(u,"itemStyle.normal.color0"),l=this.query(u,"itemStyle.emphasis.lineStyle.width"),h=this.query(u,"itemStyle.emphasis.lineStyle.color"),d=this.query(u,"itemStyle.emphasis.lineStyle.color0"),m=this.query(u,"itemStyle.emphasis.color"),c=this.query(u,"itemStyle.emphasis.color0");for(var k=0,L=U.length;L>k;k++)g=U[k],V=p.data[g[6]],u=V,y=g[3]a;a++)n[a]=e[Math.floor(i/t*a)];return n},_getCandle:function(e,t,i,a,s,r,l,h,d,m,c,p,u,V,U){var g=this.series,y={zlevel:this.getZlevelBase(),z:this.getZBase(),clickable:this.deepQuery([g[e].data[t],g[e]],"clickable"),hoverable:this.deepQuery([g[e].data[t],g[e]],"hoverable"),style:{x:a,y:[r,l,h,d],width:s,color:m,strokeColor:p,lineWidth:c,brushType:"both"},highlightStyle:{color:u,strokeColor:U,lineWidth:V},_seriesIndex:e};return o.pack(y,g[e],e,g[e].data[t],t,i),y=new n(y)},getMarkCoord:function(e,t){var i=this.series[e],n=this.component.xAxis.getAxis(i.xAxisIndex),a=this.component.yAxis.getAxis(i.yAxisIndex);return["string"!=typeof t.xAxis&&n.getCoordByIndex?n.getCoordByIndex(t.xAxis||0):n.getCoord(t.xAxis||0),"string"!=typeof t.yAxis&&a.getCoordByIndex?a.getCoordByIndex(t.yAxis||0):a.getCoord(t.yAxis||0)]},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},addDataAnimation:function(e){for(var t=this.series,i={},n=0,a=e.length;a>n;n++)i[e[n][0]]=e[n];for(var s,r,l,h,d,m,n=0,a=this.shapeList.length;a>n;n++)if(d=this.shapeList[n]._seriesIndex,i[d]&&!i[d][3]&&"candle"===this.shapeList[n].type){if(m=o.get(this.shapeList[n],"dataIndex"),h=t[d],i[d][2]&&m===h.data.length-1){this.zr.delShape(this.shapeList[n].id);continue}if(!i[d][2]&&0===m){this.zr.delShape(this.shapeList[n].id);continue}r=this.component.xAxis.getAxis(h.xAxisIndex||0).getGap(),s=i[d][2]?r:-r,l=0,this.zr.animate(this.shapeList[n].id,"").when(this.query(this.option,"animationDurationUpdate"),{position:[s,l]}).start()}}},s.inherits(t,i),e("../chart").define("k",t),t}); \ No newline at end of file diff --git a/build/dist/chart/line.js b/build/dist/chart/line.js new file mode 100644 index 0000000..db8c75a --- /dev/null +++ b/build/dist/chart/line.js @@ -0,0 +1 @@ +define("echarts/chart/line",["require","./base","zrender/shape/Polyline","../util/shape/Icon","../util/shape/HalfSmoothPolygon","../component/axis","../component/grid","../component/dataZoom","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../chart"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o),this.refresh(a)}function i(e,t,i){var n=t.x,a=t.y,r=t.width,s=t.height,l=s/2;t.symbol.match("empty")&&(e.fillStyle="#fff"),t.brushType="both";var h=t.symbol.replace("empty","").toLowerCase();h.match("star")?(l=h.replace("star","")-0||5,a-=1,h="star"):("rectangle"===h||"arrow"===h)&&(n+=(r-s)/2,r=s);var m="";if(h.match("image")&&(m=h.replace(new RegExp("^image:\\/\\/"),""),h="image",n+=Math.round((r-s)/2)-1,r=s+=2),h=o.prototype.iconLibrary[h]){var d=t.x,c=t.y;e.moveTo(d,c+l),e.lineTo(d+5,c+l),e.moveTo(d+t.width-5,c+l),e.lineTo(d+t.width,c+l);var p=this;h(e,{x:n+4,y:a+4,width:r-8,height:s-8,n:l,image:m},function(){p.modSelf(),i()})}else e.moveTo(n,a+l),e.lineTo(n+r,a+l)}var n=e("./base"),a=e("zrender/shape/Polyline"),o=e("../util/shape/Icon"),r=e("../util/shape/HalfSmoothPolygon");e("../component/axis"),e("../component/grid"),e("../component/dataZoom");var s=e("../config");s.line={zlevel:0,z:2,clickable:!0,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid",shadowColor:"rgba(0,0,0,0)",shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0}},emphasis:{label:{show:!1}}},symbolSize:2,showAllSymbol:!1};var l=e("../util/ecData"),h=e("zrender/tool/util"),m=e("zrender/tool/color");return t.prototype={type:s.CHART_TYPE_LINE,_buildShape:function(){this.finalPLMap={},this._buildPosition()},_buildHorizontal:function(e,t,i,n){for(var a,o,r,s,l,h,m,d,c,p=this.series,u=i[0][0],V=p[u],U=this.component.xAxis.getAxis(V.xAxisIndex||0),g={},y=0,f=t;f>y&&null!=U.getNameByIndex(y);y++){o=U.getCoordByIndex(y);for(var b=0,_=i.length;_>b;b++){a=this.component.yAxis.getAxis(p[i[b][0]].yAxisIndex||0),l=s=m=h=a.getCoord(0);for(var x=0,k=i[b].length;k>x;x++)u=i[b][x],V=p[u],d=V.data[y],c=this.getDataFromOption(d,"-"),g[u]=g[u]||[],n[u]=n[u]||{min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY,sum:0,counter:0,average:0},"-"!==c?(c>=0?(s-=x>0?a.getCoordSize(c):l-a.getCoord(c),r=s):0>c&&(h+=x>0?a.getCoordSize(c):a.getCoord(c)-m,r=h),g[u].push([o,r,y,U.getNameByIndex(y),o,l]),n[u].min>c&&(n[u].min=c,n[u].minY=r,n[u].minX=o),n[u].max0&&(this.finalPLMap[u]=this.finalPLMap[u]||[],this.finalPLMap[u].push(g[u]),g[u]=[])}s=this.component.grid.getY();for(var L,b=0,_=i.length;_>b;b++)for(var x=0,k=i[b].length;k>x;x++)u=i[b][x],V=p[u],d=V.data[y],c=this.getDataFromOption(d,"-"),"-"==c&&this.deepQuery([d,V,this.option],"calculable")&&(L=this.deepQuery([d,V],"symbolSize"),s+=2*L+5,r=s,this.shapeList.push(this._getCalculableItem(u,y,U.getNameByIndex(y),o,r,"horizontal")))}for(var v in g)g[v].length>0&&(this.finalPLMap[v]=this.finalPLMap[v]||[],this.finalPLMap[v].push(g[v]),g[v]=[]);this._calculMarkMapXY(n,i,"y"),this._buildBorkenLine(e,this.finalPLMap,U,"horizontal")},_buildVertical:function(e,t,i,n){for(var a,o,r,s,l,h,m,d,c,p=this.series,u=i[0][0],V=p[u],U=this.component.yAxis.getAxis(V.yAxisIndex||0),g={},y=0,f=t;f>y&&null!=U.getNameByIndex(y);y++){r=U.getCoordByIndex(y);for(var b=0,_=i.length;_>b;b++){a=this.component.xAxis.getAxis(p[i[b][0]].xAxisIndex||0),l=s=m=h=a.getCoord(0);for(var x=0,k=i[b].length;k>x;x++)u=i[b][x],V=p[u],d=V.data[y],c=this.getDataFromOption(d,"-"),g[u]=g[u]||[],n[u]=n[u]||{min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY,sum:0,counter:0,average:0},"-"!==c?(c>=0?(s+=x>0?a.getCoordSize(c):a.getCoord(c)-l,o=s):0>c&&(h-=x>0?a.getCoordSize(c):m-a.getCoord(c),o=h),g[u].push([o,r,y,U.getNameByIndex(y),l,r]),n[u].min>c&&(n[u].min=c,n[u].minX=o,n[u].minY=r),n[u].max0&&(this.finalPLMap[u]=this.finalPLMap[u]||[],this.finalPLMap[u].push(g[u]),g[u]=[])}s=this.component.grid.getXend();for(var L,b=0,_=i.length;_>b;b++)for(var x=0,k=i[b].length;k>x;x++)u=i[b][x],V=p[u],d=V.data[y],c=this.getDataFromOption(d,"-"),"-"==c&&this.deepQuery([d,V,this.option],"calculable")&&(L=this.deepQuery([d,V],"symbolSize"),s-=2*L+5,o=s,this.shapeList.push(this._getCalculableItem(u,y,U.getNameByIndex(y),o,r,"vertical")))}for(var v in g)g[v].length>0&&(this.finalPLMap[v]=this.finalPLMap[v]||[],this.finalPLMap[v].push(g[v]),g[v]=[]);this._calculMarkMapXY(n,i,"x"),this._buildBorkenLine(e,this.finalPLMap,U,"vertical")},_buildOther:function(e,t,i,n){for(var a,o=this.series,r={},s=0,l=i.length;l>s;s++)for(var h=0,m=i[s].length;m>h;h++){var d=i[s][h],c=o[d];a=this.component.xAxis.getAxis(c.xAxisIndex||0);var p=this.component.yAxis.getAxis(c.yAxisIndex||0),u=p.getCoord(0);r[d]=r[d]||[],n[d]=n[d]||{min0:Number.POSITIVE_INFINITY,min1:Number.POSITIVE_INFINITY,max0:Number.NEGATIVE_INFINITY,max1:Number.NEGATIVE_INFINITY,sum0:0,sum1:0,counter0:0,counter1:0,average0:0,average1:0};for(var V=0,U=c.data.length;U>V;V++){var g=c.data[V],y=this.getDataFromOption(g,"-");if(y instanceof Array){var f=a.getCoord(y[0]),b=p.getCoord(y[1]);r[d].push([f,b,V,y[0],f,u]),n[d].min0>y[0]&&(n[d].min0=y[0],n[d].minY0=b,n[d].minX0=f),n[d].max0y[1]&&(n[d].min1=y[1],n[d].minY1=b,n[d].minX1=f),n[d].max10&&(this.finalPLMap[_]=this.finalPLMap[_]||[],this.finalPLMap[_].push(r[_]),r[_]=[]);this._calculMarkMapXY(n,i,"xy"),this._buildBorkenLine(e,this.finalPLMap,a,"other")},_buildBorkenLine:function(e,t,i,n){for(var o,s="other"==n?"horizontal":n,d=this.series,c=e.length-1;c>=0;c--){var p=e[c],u=d[p],V=t[p];if(u.type===this.type&&null!=V)for(var U=this._getBbox(p,s),g=this._sIndex2ColorMap[p],y=this.query(u,"itemStyle.normal.lineStyle.width"),f=this.query(u,"itemStyle.normal.lineStyle.type"),b=this.query(u,"itemStyle.normal.lineStyle.color"),_=this.getItemStyleColor(this.query(u,"itemStyle.normal.color"),p,-1),x=null!=this.query(u,"itemStyle.normal.areaStyle"),k=this.query(u,"itemStyle.normal.areaStyle.color"),L=0,v=V.length;v>L;L++){var W=V[L],w="other"!=n&&this._isLarge(s,W);if(w)W=this._getLargePointList(s,W);else for(var X=0,I=W.length;I>X;X++)o=u.data[W[X][2]],(this.deepQuery([o,u,this.option],"calculable")||this.deepQuery([o,u],"showAllSymbol")||"categoryAxis"===i.type&&i.isMainAxis(W[X][2])&&"none"!=this.deepQuery([o,u],"symbol"))&&this.shapeList.push(this._getSymbol(p,W[X][2],W[X][3],W[X][0],W[X][1],s));var K=new a({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{miterLimit:y,pointList:W,strokeColor:b||_||g,lineWidth:y,lineType:f,smooth:this._getSmooth(u.smooth),smoothConstraint:U,shadowColor:this.query(u,"itemStyle.normal.lineStyle.shadowColor"),shadowBlur:this.query(u,"itemStyle.normal.lineStyle.shadowBlur"),shadowOffsetX:this.query(u,"itemStyle.normal.lineStyle.shadowOffsetX"),shadowOffsetY:this.query(u,"itemStyle.normal.lineStyle.shadowOffsetY")},hoverable:!1,_main:!0,_seriesIndex:p,_orient:s});if(l.pack(K,d[p],p,0,L,d[p].name),this.shapeList.push(K),x){var S=new r({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{miterLimit:y,pointList:h.clone(W).concat([[W[W.length-1][4],W[W.length-1][5]],[W[0][4],W[0][5]]]),brushType:"fill",smooth:this._getSmooth(u.smooth),smoothConstraint:U,color:k?k:m.alpha(g,.5)},highlightStyle:{brushType:"fill"},hoverable:!1,_main:!0,_seriesIndex:p,_orient:s});l.pack(S,d[p],p,0,L,d[p].name),this.shapeList.push(S)}}}},_getBbox:function(e,t){var i=this.component.grid.getBbox(),n=this.xMarkMap[e];return null!=n.minX0?[[Math.min(n.minX0,n.maxX0,n.minX1,n.maxX1),Math.min(n.minY0,n.maxY0,n.minY1,n.maxY1)],[Math.max(n.minX0,n.maxX0,n.minX1,n.maxX1),Math.max(n.minY0,n.maxY0,n.minY1,n.maxY1)]]:("horizontal"===t?(i[0][1]=Math.min(n.minY,n.maxY),i[1][1]=Math.max(n.minY,n.maxY)):(i[0][0]=Math.min(n.minX,n.maxX),i[1][0]=Math.max(n.minX,n.maxX)),i)},_isLarge:function(e,t){return t.length<2?!1:"horizontal"===e?Math.abs(t[0][0]-t[1][0])<.5:Math.abs(t[0][1]-t[1][1])<.5},_getLargePointList:function(e,t){var i;i="horizontal"===e?this.component.grid.getWidth():this.component.grid.getHeight();for(var n=t.length,a=[],o=0;i>o;o++)a[o]=t[Math.floor(n/i*o)];return a},_getSmooth:function(e){return e?.3:0},_getCalculableItem:function(e,t,i,n,a,o){var r=this.series,l=r[e].calculableHolderColor||this.ecTheme.calculableHolderColor||s.calculableHolderColor,h=this._getSymbol(e,t,i,n,a,o);return h.style.color=l,h.style.strokeColor=l,h.rotation=[0,0],h.hoverable=!1,h.draggable=!1,h.style.text=void 0,h},_getSymbol:function(e,t,i,n,a,o){var r=this.series,s=r[e],l=s.data[t],h=this.getSymbolShape(s,e,l,t,i,n,a,this._sIndex2ShapeMap[e],this._sIndex2ColorMap[e],"#fff","vertical"===o?"horizontal":"vertical");return h.zlevel=this.getZlevelBase(),h.z=this.getZBase()+1,this.deepQuery([l,s,this.option],"calculable")&&(this.setCalculable(h),h.draggable=!0),h},getMarkCoord:function(e,t){var i=this.series[e],n=this.xMarkMap[e],a=this.component.xAxis.getAxis(i.xAxisIndex),o=this.component.yAxis.getAxis(i.yAxisIndex);if(t.type&&("max"===t.type||"min"===t.type||"average"===t.type)){var r=null!=t.valueIndex?t.valueIndex:null!=n.maxX0?"1":"";return[n[t.type+"X"+r],n[t.type+"Y"+r],n[t.type+"Line"+r],n[t.type+r]]}return["string"!=typeof t.xAxis&&a.getCoordByIndex?a.getCoordByIndex(t.xAxis||0):a.getCoord(t.xAxis||0),"string"!=typeof t.yAxis&&o.getCoordByIndex?o.getCoordByIndex(t.yAxis||0):o.getCoord(t.yAxis||0)]},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},ontooltipHover:function(e,t){for(var i,n,a=e.seriesIndex,o=e.dataIndex,r=a.length;r--;)if(i=this.finalPLMap[a[r]])for(var s=0,l=i.length;l>s;s++){n=i[s];for(var h=0,m=n.length;m>h;h++)o===n[h][2]&&t.push(this._getSymbol(a[r],n[h][2],n[h][3],n[h][0],n[h][1],"horizontal"))}},addDataAnimation:function(e){for(var t=this.series,i={},n=0,a=e.length;a>n;n++)i[e[n][0]]=e[n];for(var o,r,s,l,h,m,d,n=this.shapeList.length-1;n>=0;n--)if(h=this.shapeList[n]._seriesIndex,i[h]&&!i[h][3]){if(this.shapeList[n]._main&&this.shapeList[n].style.pointList.length>1){if(m=this.shapeList[n].style.pointList,r=Math.abs(m[0][0]-m[1][0]),l=Math.abs(m[0][1]-m[1][1]),d="horizontal"===this.shapeList[n]._orient,i[h][2]){if("half-smooth-polygon"===this.shapeList[n].type){var c=m.length;this.shapeList[n].style.pointList[c-3]=m[c-2],this.shapeList[n].style.pointList[c-3][d?0:1]=m[c-4][d?0:1],this.shapeList[n].style.pointList[c-2]=m[c-1]}this.shapeList[n].style.pointList.pop(),d?(o=r,s=0):(o=0,s=-l)}else{if(this.shapeList[n].style.pointList.shift(),"half-smooth-polygon"===this.shapeList[n].type){var p=this.shapeList[n].style.pointList.pop();d?p[0]=m[0][0]:p[1]=m[0][1],this.shapeList[n].style.pointList.push(p)}d?(o=-r,s=0):(o=0,s=l)}this.zr.modShape(this.shapeList[n].id,{style:{pointList:this.shapeList[n].style.pointList}},!0)}else{if(i[h][2]&&this.shapeList[n]._dataIndex===t[h].data.length-1){this.zr.delShape(this.shapeList[n].id);continue}if(!i[h][2]&&0===this.shapeList[n]._dataIndex){this.zr.delShape(this.shapeList[n].id);continue}}this.shapeList[n].position=[0,0],this.zr.animate(this.shapeList[n].id,"").when(this.query(this.option,"animationDurationUpdate"),{position:[o,s]}).start()}}},o.prototype.iconLibrary.legendLineIcon=i,h.inherits(t,n),e("../chart").define("line",t),t}),define("echarts/util/shape/HalfSmoothPolygon",["require","zrender/shape/Base","zrender/shape/util/smoothBezier","zrender/tool/util","zrender/shape/Polygon"],function(e){function t(e){i.call(this,e)}var i=e("zrender/shape/Base"),n=e("zrender/shape/util/smoothBezier"),a=e("zrender/tool/util");return t.prototype={type:"half-smooth-polygon",buildPath:function(t,i){var a=i.pointList;if(!(a.length<2))if(i.smooth){var o=n(a.slice(0,-2),i.smooth,!1,i.smoothConstraint);t.moveTo(a[0][0],a[0][1]);for(var r,s,l,h=a.length,m=0;h-3>m;m++)r=o[2*m],s=o[2*m+1],l=a[m+1],t.bezierCurveTo(r[0],r[1],s[0],s[1],l[0],l[1]);t.lineTo(a[h-2][0],a[h-2][1]),t.lineTo(a[h-1][0],a[h-1][1]),t.lineTo(a[0][0],a[0][1])}else e("zrender/shape/Polygon").prototype.buildPath(t,i)}},a.inherits(t,i),t}); \ No newline at end of file diff --git a/build/dist/chart/map.js b/build/dist/chart/map.js new file mode 100644 index 0000000..620c5dc --- /dev/null +++ b/build/dist/chart/map.js @@ -0,0 +1,10 @@ +define("echarts/chart/map",["require","./base","zrender/shape/Text","zrender/shape/Path","zrender/shape/Circle","zrender/shape/Rectangle","zrender/shape/Line","zrender/shape/Polygon","zrender/shape/Ellipse","../component/dataRange","../component/roamController","../config","../util/ecData","zrender/tool/util","zrender/config","zrender/tool/event","../util/mapData/params","../util/mapData/textFixed","../util/mapData/geoCoord","../util/projection/svg","../util/projection/normal","../chart"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o);var s=this;s._onmousewheel=function(e){return s.__onmousewheel(e)},s._onmousedown=function(e){return s.__onmousedown(e)},s._onmousemove=function(e){return s.__onmousemove(e)},s._onmouseup=function(e){return s.__onmouseup(e)},s._onroamcontroller=function(e){return s.__onroamcontroller(e)},s._ondrhoverlink=function(e){return s.__ondrhoverlink(e)},this._isAlive=!0,this._selectedMode={},this._activeMapType={},this._clickable={},this._hoverable={},this._showLegendSymbol={},this._selected={},this._mapTypeMap={},this._mapDataMap={},this._nameMap={},this._specialArea={},this._refreshDelayTicket,this._mapDataRequireCounter,this._markAnimation=!1,this._hoverLinkMap={},this._roamMap={},this._scaleLimitMap={},this._mx,this._my,this._mousedown,this._justMove,this._curMapType,this.refresh(a),this.zr.on(d.EVENT.MOUSEWHEEL,this._onmousewheel),this.zr.on(d.EVENT.MOUSEDOWN,this._onmousedown),t.bind(m.EVENT.ROAMCONTROLLER,this._onroamcontroller),t.bind(m.EVENT.DATA_RANGE_HOVERLINK,this._ondrhoverlink)}var n=e("./base"),i=e("zrender/shape/Text"),a=e("zrender/shape/Path"),o=e("zrender/shape/Circle"),s=e("zrender/shape/Rectangle"),r=e("zrender/shape/Line"),l=e("zrender/shape/Polygon"),h=e("zrender/shape/Ellipse");e("../component/dataRange"),e("../component/roamController");var m=e("../config");m.map={zlevel:0,z:2,mapType:"china",mapValuePrecision:0,showLegendSymbol:!0,dataRangeHoverLink:!0,hoverable:!0,clickable:!0,itemStyle:{normal:{borderColor:"rgba(0,0,0,0)",borderWidth:1,areaStyle:{color:"#ccc"},label:{show:!1,textStyle:{color:"rgb(139,69,19)"}}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,areaStyle:{color:"rgba(255,215,0,0.8)"},label:{show:!1,textStyle:{color:"rgb(100,0,0)"}}}}};var V=e("../util/ecData"),U=e("zrender/tool/util"),d=e("zrender/config"),p=e("zrender/tool/event"),c=e("../util/mapData/params").params,u=e("../util/mapData/textFixed"),y=e("../util/mapData/geoCoord");return t.prototype={type:m.CHART_TYPE_MAP,_buildShape:function(){var e=this.series;this.selectedMap={},this._activeMapType={};for(var t,n,i,a,o=this.component.legend,s={},r={},l={},h={},V=0,d=e.length;d>V;V++)if(e[V].type==m.CHART_TYPE_MAP&&(e[V]=this.reformOption(e[V]),n=e[V].mapType,r[n]=r[n]||{},r[n][V]=!0,l[n]=l[n]||e[V].mapValuePrecision,this._scaleLimitMap[n]=this._scaleLimitMap[n]||{},e[V].scaleLimit&&U.merge(this._scaleLimitMap[n],e[V].scaleLimit,!0),this._roamMap[n]=e[V].roam||this._roamMap[n],this._hoverLinkMap[n]=e[V].dataRangeHoverLink||this._hoverLinkMap[n],this._nameMap[n]=this._nameMap[n]||{},e[V].nameMap&&U.merge(this._nameMap[n],e[V].nameMap,!0),this._activeMapType[n]=!0,e[V].textFixed&&U.merge(u,e[V].textFixed,!0),e[V].geoCoord&&U.merge(y,e[V].geoCoord,!0),this._selectedMode[n]=this._selectedMode[n]||e[V].selectedMode,(null==this._hoverable[n]||this._hoverable[n])&&(this._hoverable[n]=e[V].hoverable),(null==this._clickable[n]||this._clickable[n])&&(this._clickable[n]=e[V].clickable),(null==this._showLegendSymbol[n]||this._showLegendSymbol[n])&&(this._showLegendSymbol[n]=e[V].showLegendSymbol),h[n]=h[n]||e[V].mapValueCalculation,t=e[V].name,this.selectedMap[t]=o?o.isSelected(t):!0,this.selectedMap[t])){s[n]=s[n]||{},i=e[V].data;for(var p=0,g=i.length;g>p;p++){a=this._nameChange(n,i[p].name),s[n][a]=s[n][a]||{seriesIndex:[]};for(var b in i[p])"value"!=b?s[n][a][b]=i[p][b]:isNaN(i[p].value)||(null==s[n][a].value&&(s[n][a].value=0),s[n][a].value+=i[p].value);s[n][a].seriesIndex.push(V)}}this._mapDataRequireCounter=0;for(var f in s)this._mapDataRequireCounter++;this._clearSelected(),0===this._mapDataRequireCounter&&(this.clear(),this.zr&&this.zr.delShape(this.lastShapeList),this.lastShapeList=[]);for(var f in s){if(h[f]&&"average"==h[f])for(var g in s[f])s[f][g].value=(s[f][g].value/s[f][g].seriesIndex.length).toFixed(l[f])-0;this._mapDataMap[f]=this._mapDataMap[f]||{},this._mapDataMap[f].mapData?this._mapDataCallback(f,s[f],r[f])(this._mapDataMap[f].mapData):c[f.replace(/\|.*/,"")].getGeoJson&&(this._specialArea[f]=c[f.replace(/\|.*/,"")].specialArea||this._specialArea[f],c[f.replace(/\|.*/,"")].getGeoJson(this._mapDataCallback(f,s[f],r[f])))}},_mapDataCallback:function(t,n,i){var a=this;return function(o){a._isAlive&&null!=a._activeMapType[t]&&(-1!=t.indexOf("|")&&(o=a._getSubMapData(t,o)),a._mapDataMap[t].mapData=o,o.firstChild?(a._mapDataMap[t].rate=1,a._mapDataMap[t].projection=e("../util/projection/svg")):(a._mapDataMap[t].rate=.75,a._mapDataMap[t].projection=e("../util/projection/normal")),a._buildMap(t,a._getProjectionData(t,o,i),n,i),a._buildMark(t,i),--a._mapDataRequireCounter<=0&&(a.addShapeList(),a.zr.refreshNextFrame()))}},_clearSelected:function(){for(var e in this._selected)this._activeMapType[this._mapTypeMap[e]]||(delete this._selected[e],delete this._mapTypeMap[e])},_getSubMapData:function(e,t){for(var n=e.replace(/^.*\|/,""),i=t.features,a=0,o=i.length;o>a;a++)if(i[a].properties&&i[a].properties.name==n){i=i[a],"United States of America"==n&&i.geometry.coordinates.length>1&&(i={geometry:{coordinates:i.geometry.coordinates.slice(5,6),type:i.geometry.type},id:i.id,properties:i.properties,type:i.type});break}return{type:"FeatureCollection",features:[i]}},_getProjectionData:function(e,t,n){var i,a=this._mapDataMap[e].projection,o=[],s=this._mapDataMap[e].bbox||a.getBbox(t,this._specialArea[e]);i=this._mapDataMap[e].hasRoam?this._mapDataMap[e].transform:this._getTransform(s,n,this._mapDataMap[e].rate);var r,l=this._mapDataMap[e].lastTransform||{scale:{}};i.left!=l.left||i.top!=l.top||i.scale.x!=l.scale.x||i.scale.y!=l.scale.y?(r=a.geoJson2Path(t,i,this._specialArea[e]),l=U.clone(i)):(i=this._mapDataMap[e].transform,r=this._mapDataMap[e].pathArray),this._mapDataMap[e].bbox=s,this._mapDataMap[e].transform=i,this._mapDataMap[e].lastTransform=l,this._mapDataMap[e].pathArray=r;for(var h=[i.left,i.top],m=0,V=r.length;V>m;m++)o.push(this._getSingleProvince(e,r[m],h));if(this._specialArea[e])for(var d in this._specialArea[e])o.push(this._getSpecialProjectionData(e,t,d,this._specialArea[e][d],h));if("china"==e){var p=this.geo2pos(e,y["南海诸岛"]||c["南海诸岛"].textCoord),g=i.scale.x/10.5,b=[32*g+p[0],83*g+p[1]];u["南海诸岛"]&&(b[0]+=u["南海诸岛"][0],b[1]+=u["南海诸岛"][1]),o.push({name:this._nameChange(e,"南海诸岛"),path:c["南海诸岛"].getPath(p,g),position:h,textX:b[0],textY:b[1]})}return o},_getSpecialProjectionData:function(t,n,i,a,o){n=this._getSubMapData("x|"+i,n);var s=e("../util/projection/normal"),r=s.getBbox(n),l=this.geo2pos(t,[a.left,a.top]),h=this.geo2pos(t,[a.left+a.width,a.top+a.height]),m=Math.abs(h[0]-l[0]),V=Math.abs(h[1]-l[1]),U=r.width,d=r.height,p=m/.75/U,c=V/d;p>c?(p=.75*c,m=U*p):(c=p,p=.75*c,V=d*c);var u={OffsetLeft:l[0],OffsetTop:l[1],scale:{x:p,y:c}},y=s.geoJson2Path(n,u);return this._getSingleProvince(t,y[0],o)},_getSingleProvince:function(e,t,n){var i,a=t.properties.name,o=u[a]||[0,0];if(y[a])i=this.geo2pos(e,y[a]);else if(t.cp)i=[t.cp[0]+o[0],t.cp[1]+o[1]];else{var s=this._mapDataMap[e].bbox;i=this.geo2pos(e,[s.left+s.width/2,s.top+s.height/2]),i[0]+=o[0],i[1]+=o[1]}return t.name=this._nameChange(e,a),t.position=n,t.textX=i[0],t.textY=i[1],t},_getTransform:function(e,t,n){var i,a,o,s,r,l,h,m=this.series,V=this.zr.getWidth(),U=this.zr.getHeight(),d=Math.round(.02*Math.min(V,U));for(var p in t)i=m[p].mapLocation||{},o=i.x||o,r=i.y||r,l=i.width||l,h=i.height||h;a=this.parsePercent(o,V),a=isNaN(a)?d:a,s=this.parsePercent(r,U),s=isNaN(s)?d:s,l=null==l?V-a-2*d:this.parsePercent(l,V),h=null==h?U-s-2*d:this.parsePercent(h,U);var c=e.width,u=e.height,y=l/n/c,g=h/u;if(y>g?(y=g*n,l=c*y):(g=y,y=g*n,h=u*g),isNaN(o))switch(o=o||"center",o+""){case"center":a=Math.floor((V-l)/2);break;case"right":a=V-l}if(isNaN(r))switch(r=r||"center",r+""){case"center":s=Math.floor((U-h)/2);break;case"bottom":s=U-h}return{left:a,top:s,width:l,height:h,baseScale:1,scale:{x:y,y:g}}},_buildMap:function(e,t,n,d){for(var p,c,u,y,g,b,f,k,x,_,L,W=this.series,X=this.component.legend,K=this.component.dataRange,w=0,I=t.length;I>w;w++){if(k=U.clone(t[w]),x={name:k.name,path:k.path,position:U.clone(k.position)},c=k.name,u=n[c]){g=[u],p="";for(var v=0,J=u.seriesIndex.length;J>v;v++)g.push(W[u.seriesIndex[v]]),p+=W[u.seriesIndex[v]].name+" ",X&&this._showLegendSymbol[e]&&X.hasColor(W[u.seriesIndex[v]].name)&&this.shapeList.push(new o({zlevel:this.getZlevelBase(),z:this.getZBase()+1,position:U.clone(k.position),_mapType:e,style:{x:k.textX+3+7*v,y:k.textY-10,r:3,color:X.getColor(W[u.seriesIndex[v]].name)},hoverable:!1}));y=u.value}else{u="-",p="",g=[];for(var C in d)g.push(W[C]);y="-"}switch(this.ecTheme.map&&g.push(this.ecTheme.map),g.push(m),b=K&&!isNaN(y)?K.getColor(y):null,k.color=k.color||b||this.getItemStyleColor(this.deepQuery(g,"itemStyle.normal.color"),u.seriesIndex,-1,u)||this.deepQuery(g,"itemStyle.normal.areaStyle.color"),k.strokeColor=k.strokeColor||this.deepQuery(g,"itemStyle.normal.borderColor"),k.lineWidth=k.lineWidth||this.deepQuery(g,"itemStyle.normal.borderWidth"),x.color=this.getItemStyleColor(this.deepQuery(g,"itemStyle.emphasis.color"),u.seriesIndex,-1,u)||this.deepQuery(g,"itemStyle.emphasis.areaStyle.color")||k.color,x.strokeColor=this.deepQuery(g,"itemStyle.emphasis.borderColor")||k.strokeColor,x.lineWidth=this.deepQuery(g,"itemStyle.emphasis.borderWidth")||k.lineWidth,k.brushType=x.brushType=k.brushType||"both",k.lineJoin=x.lineJoin="round",k._name=x._name=c,f=this.deepQuery(g,"itemStyle.normal.label.textStyle"),L={zlevel:this.getZlevelBase(),z:this.getZBase()+1,position:U.clone(k.position),_mapType:e,_geo:this.pos2geo(e,[k.textX,k.textY]),style:{brushType:"fill",x:k.textX,y:k.textY,text:this.getLabelText(c,y,g,"normal"),_name:c,textAlign:"center",color:this.deepQuery(g,"itemStyle.normal.label.show")?this.deepQuery(g,"itemStyle.normal.label.textStyle.color"):"rgba(0,0,0,0)",textFont:this.getFont(f)}},L._style=U.clone(L.style),L.highlightStyle=U.clone(L.style),this.deepQuery(g,"itemStyle.emphasis.label.show")?(L.highlightStyle.text=this.getLabelText(c,y,g,"emphasis"),L.highlightStyle.color=this.deepQuery(g,"itemStyle.emphasis.label.textStyle.color")||L.style.color,f=this.deepQuery(g,"itemStyle.emphasis.label.textStyle")||f,L.highlightStyle.textFont=this.getFont(f)):L.highlightStyle.color="rgba(0,0,0,0)",_={zlevel:this.getZlevelBase(),z:this.getZBase(),position:U.clone(k.position),style:k,highlightStyle:x,_style:U.clone(k),_mapType:e},null!=k.scale&&(_.scale=U.clone(k.scale)),L=new i(L),_.style.shapeType){case"rectangle":_=new s(_);break;case"line":_=new r(_);break;case"circle":_=new o(_);break;case"polygon":_=new l(_);break;case"ellipse":_=new h(_);break;default:_=new a(_),_.buildPathArray&&(_.style.pathArray=_.buildPathArray(_.style.path))}(this._selectedMode[e]&&this._selected[c]||u.selected&&this._selected[c]!==!1)&&(L.style=L.highlightStyle,_.style=_.highlightStyle),L.clickable=_.clickable=this._clickable[e]&&(null==u.clickable||u.clickable),this._selectedMode[e]&&(this._selected[c]=null!=this._selected[c]?this._selected[c]:u.selected,this._mapTypeMap[c]=e,(null==u.selectable||u.selectable)&&(_.clickable=L.clickable=!0,_.onclick=L.onclick=this.shapeHandler.onclick)),this._hoverable[e]&&(null==u.hoverable||u.hoverable)?(L.hoverable=_.hoverable=!0,_.hoverConnect=L.id,L.hoverConnect=_.id):L.hoverable=_.hoverable=!1,V.pack(L,{name:p,tooltip:this.deepQuery(g,"tooltip")},0,u,0,c),this.shapeList.push(L),V.pack(_,{name:p,tooltip:this.deepQuery(g,"tooltip")},0,u,0,c),this.shapeList.push(_)}},_buildMark:function(e,t){this._seriesIndexToMapType=this._seriesIndexToMapType||{},this.markAttachStyle=this.markAttachStyle||{};var n=[this._mapDataMap[e].transform.left,this._mapDataMap[e].transform.top];"none"==e&&(n=[0,0]);for(var i in t)this._seriesIndexToMapType[i]=e,this.markAttachStyle[i]={position:n,_mapType:e},this.buildMark(i)},getMarkCoord:function(e,t){return t.geoCoord||y[t.name]?this.geo2pos(this._seriesIndexToMapType[e],t.geoCoord||y[t.name]):[0,0]},getMarkGeo:function(e){return e.geoCoord||y[e.name]},_nameChange:function(e,t){return this._nameMap[e][t]||t},getLabelText:function(e,t,n,i){var a=this.deepQuery(n,"itemStyle."+i+".label.formatter");return a?"function"==typeof a?a.call(this.myChart,e,t):"string"==typeof a?(a=a.replace("{a}","{a0}").replace("{b}","{b0}"),a=a.replace("{a0}",e).replace("{b0}",t)):void 0:e},_findMapTypeByPos:function(e,t){var n,i,a,o,s;for(var r in this._mapDataMap)if(n=this._mapDataMap[r].transform,n&&this._roamMap[r]&&this._activeMapType[r]&&(i=n.left,a=n.top,o=n.width,s=n.height,e>=i&&i+o>=e&&t>=a&&a+s>=t))return r},__onmousewheel:function(e){if(!(this.shapeList.length<=0)){var t,n,i=e.event,a=p.getX(i),o=p.getY(i),s=p.getDelta(i),r=e.mapTypeControl;r||(r={},n=this._findMapTypeByPos(a,o),n&&this._roamMap[n]&&"move"!=this._roamMap[n]&&(r[n]=!0));var l=!1;for(n in r)if(r[n]){l=!0;var h=this._mapDataMap[n].transform,V=h.left,U=h.top,d=h.width,c=h.height,u=this.pos2geo(n,[a-V,o-U]);if(s>0){if(t=1.2,null!=this._scaleLimitMap[n].max&&h.baseScale>=this._scaleLimitMap[n].max)continue}else if(t=1/1.2,null!=this._scaleLimitMap[n].min&&h.baseScale<=this._scaleLimitMap[n].min)continue;h.baseScale*=t,h.scale.x*=t,h.scale.y*=t,h.width=d*t,h.height=c*t,this._mapDataMap[n].hasRoam=!0,this._mapDataMap[n].transform=h,u=this.geo2pos(n,u),h.left-=u[0]-(a-V),h.top-=u[1]-(o-U),this._mapDataMap[n].transform=h,this.clearEffectShape(!0);for(var y=0,g=this.shapeList.length;g>y;y++)this.shapeList[y]._mapType==n&&(this.shapeList[y].position[0]=h.left,this.shapeList[y].position[1]=h.top,"path"==this.shapeList[y].type||"symbol"==this.shapeList[y].type||"circle"==this.shapeList[y].type||"rectangle"==this.shapeList[y].type||"polygon"==this.shapeList[y].type||"line"==this.shapeList[y].type||"ellipse"==this.shapeList[y].type?(this.shapeList[y].scale[0]*=t,this.shapeList[y].scale[1]*=t):"mark-line"==this.shapeList[y].type?(this.shapeList[y].style.pointListLength=void 0,this.shapeList[y].style.pointList=!1,u=this.geo2pos(n,this.shapeList[y]._geo[0]),this.shapeList[y].style.xStart=u[0],this.shapeList[y].style.yStart=u[1],u=this.geo2pos(n,this.shapeList[y]._geo[1]),this.shapeList[y]._x=this.shapeList[y].style.xEnd=u[0],this.shapeList[y]._y=this.shapeList[y].style.yEnd=u[1]):"icon"==this.shapeList[y].type||"image"==this.shapeList[y].type?(u=this.geo2pos(n,this.shapeList[y]._geo),this.shapeList[y].style.x=this.shapeList[y].style._x=u[0]-this.shapeList[y].style.width/2,this.shapeList[y].style.y=this.shapeList[y].style._y=u[1]-this.shapeList[y].style.height/2):(u=this.geo2pos(n,this.shapeList[y]._geo),this.shapeList[y].style.x=u[0],this.shapeList[y].style.y=u[1],"text"==this.shapeList[y].type&&(this.shapeList[y]._style.x=this.shapeList[y].highlightStyle.x=u[0],this.shapeList[y]._style.y=this.shapeList[y].highlightStyle.y=u[1])),this.zr.modShape(this.shapeList[y].id))}if(l){p.stop(i),this.zr.refreshNextFrame();var b=this;clearTimeout(this._refreshDelayTicket),this._refreshDelayTicket=setTimeout(function(){b&&b.shapeList&&b.animationEffect()},100),this.messageCenter.dispatch(m.EVENT.MAP_ROAM,e.event,{type:"scale"},this.myChart)}}},__onmousedown:function(e){if(!(this.shapeList.length<=0)){var t=e.target;if(!t||!t.draggable){var n=e.event,i=p.getX(n),a=p.getY(n),o=this._findMapTypeByPos(i,a);if(o&&this._roamMap[o]&&"scale"!=this._roamMap[o]){this._mousedown=!0,this._mx=i,this._my=a,this._curMapType=o,this.zr.on(d.EVENT.MOUSEUP,this._onmouseup);var s=this;setTimeout(function(){s.zr.on(d.EVENT.MOUSEMOVE,s._onmousemove)},100)}}}},__onmousemove:function(e){if(this._mousedown&&this._isAlive){var t=e.event,n=p.getX(t),i=p.getY(t),a=this._mapDataMap[this._curMapType].transform;a.hasRoam=!0,a.left-=this._mx-n,a.top-=this._my-i,this._mx=n,this._my=i,this._mapDataMap[this._curMapType].transform=a;for(var o=0,s=this.shapeList.length;s>o;o++)this.shapeList[o]._mapType==this._curMapType&&(this.shapeList[o].position[0]=a.left,this.shapeList[o].position[1]=a.top,this.zr.modShape(this.shapeList[o].id));this.messageCenter.dispatch(m.EVENT.MAP_ROAM,e.event,{type:"move"},this.myChart),this.clearEffectShape(!0),this.zr.refreshNextFrame(),this._justMove=!0,p.stop(t)}},__onmouseup:function(e){var t=e.event;this._mx=p.getX(t),this._my=p.getY(t),this._mousedown=!1;var n=this;setTimeout(function(){n._justMove&&n.animationEffect(),n._justMove=!1,n.zr.un(d.EVENT.MOUSEMOVE,n._onmousemove),n.zr.un(d.EVENT.MOUSEUP,n._onmouseup)},120)},__onroamcontroller:function(e){var t=e.event;t.zrenderX=this.zr.getWidth()/2,t.zrenderY=this.zr.getHeight()/2;var n=e.mapTypeControl,i=0,a=0,o=e.step;switch(e.roamType){case"scaleUp":return t.zrenderDelta=1,void this.__onmousewheel({event:t,mapTypeControl:n});case"scaleDown":return t.zrenderDelta=-1,void this.__onmousewheel({event:t,mapTypeControl:n});case"up":i=-o;break;case"down":i=o;break;case"left":a=-o;break;case"right":a=o}var s,r;for(r in n)this._mapDataMap[r]&&this._activeMapType[r]&&(s=this._mapDataMap[r].transform,s.hasRoam=!0,s.left-=a,s.top-=i,this._mapDataMap[r].transform=s);for(var l=0,h=this.shapeList.length;h>l;l++)r=this.shapeList[l]._mapType,n[r]&&this._activeMapType[r]&&(s=this._mapDataMap[r].transform,this.shapeList[l].position[0]=s.left,this.shapeList[l].position[1]=s.top,this.zr.modShape(this.shapeList[l].id));this.messageCenter.dispatch(m.EVENT.MAP_ROAM,e.event,{type:"move"},this.myChart),this.clearEffectShape(!0),this.zr.refreshNextFrame(),clearTimeout(this.dircetionTimer);var V=this;this.dircetionTimer=setTimeout(function(){V.animationEffect()},150)},__ondrhoverlink:function(e){for(var t,n,i=0,a=this.shapeList.length;a>i;i++)t=this.shapeList[i]._mapType,this._hoverLinkMap[t]&&this._activeMapType[t]&&(n=V.get(this.shapeList[i],"value"),null!=n&&n>=e.valueMin&&n<=e.valueMax&&this.zr.addHoverShape(this.shapeList[i]))},onclick:function(e){if(this.isClick&&e.target&&!this._justMove&&"icon"!=e.target.type){this.isClick=!1;var t=e.target,n=t.style._name,i=this.shapeList.length,a=t._mapType||"";if("single"==this._selectedMode[a])for(var o in this._selected)if(this._selected[o]&&this._mapTypeMap[o]==a){for(var s=0;i>s;s++)this.shapeList[s].style._name==o&&this.shapeList[s]._mapType==a&&(this.shapeList[s].style=this.shapeList[s]._style,this.zr.modShape(this.shapeList[s].id));o!=n&&(this._selected[o]=!1)}this._selected[n]=!this._selected[n];for(var s=0;i>s;s++)this.shapeList[s].style._name==n&&this.shapeList[s]._mapType==a&&(this.shapeList[s].style=this._selected[n]?this.shapeList[s].highlightStyle:this.shapeList[s]._style,this.zr.modShape(this.shapeList[s].id));this.messageCenter.dispatch(m.EVENT.MAP_SELECTED,e.event,{selected:this._selected,target:n},this.myChart),this.zr.refreshNextFrame();var r=this;setTimeout(function(){r.zr.trigger(d.EVENT.MOUSEMOVE,e.event)},100)}},refresh:function(e){e&&(this.option=e,this.series=e.series),this._mapDataRequireCounter>0?this.clear():this.backupShapeList(),this._buildShape(),this.zr.refreshHover()},ondataRange:function(e,t){this.component.dataRange&&(this.refresh(),t.needRefresh=!0)},pos2geo:function(e,t){return this._mapDataMap[e].transform?this._mapDataMap[e].projection.pos2geo(this._mapDataMap[e].transform,t):null},getGeoByPos:function(e,t){if(!this._mapDataMap[e].transform)return null;var n=[this._mapDataMap[e].transform.left,this._mapDataMap[e].transform.top];return t instanceof Array?(t[0]-=n[0],t[1]-=n[1]):(t.x-=n[0],t.y-=n[1]),this.pos2geo(e,t)},geo2pos:function(e,t){return this._mapDataMap[e].transform?this._mapDataMap[e].projection.geo2pos(this._mapDataMap[e].transform,t):null},getPosByGeo:function(e,t){if(!this._mapDataMap[e].transform)return null;var n=this.geo2pos(e,t);return n[0]+=this._mapDataMap[e].transform.left,n[1]+=this._mapDataMap[e].transform.top,n},getMapPosition:function(e){return this._mapDataMap[e].transform?[this._mapDataMap[e].transform.left,this._mapDataMap[e].transform.top]:null},onbeforDispose:function(){this._isAlive=!1,this.zr.un(d.EVENT.MOUSEWHEEL,this._onmousewheel),this.zr.un(d.EVENT.MOUSEDOWN,this._onmousedown),this.messageCenter.unbind(m.EVENT.ROAMCONTROLLER,this._onroamcontroller),this.messageCenter.unbind(m.EVENT.DATA_RANGE_HOVERLINK,this._ondrhoverlink)}},U.inherits(t,n),e("../chart").define("map",t),t}),define("zrender/shape/Path",["require","./Base","./util/PathProxy","../tool/util"],function(e){var t=e("./Base"),n=e("./util/PathProxy"),i=n.PathSegment,a=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},o=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(a(e)*a(t))},s=function(e,t){return(e[0]*t[1]0&&""===d[0]&&d.shift();for(var p=0;p0&&!isNaN(d[0]);){var c,u,y,g,b,f,k,x,_=null,L=[],W=h,X=m;switch(U){case"l":h+=d.shift(),m+=d.shift(),_="L",L.push(h,m);break;case"L":h=d.shift(),m=d.shift(),L.push(h,m);break;case"m":h+=d.shift(),m+=d.shift(),_="M",L.push(h,m),U="l";break;case"M":h=d.shift(),m=d.shift(),_="M",L.push(h,m),U="L";break;case"h":h+=d.shift(),_="L",L.push(h,m);break;case"H":h=d.shift(),_="L",L.push(h,m);break;case"v":m+=d.shift(),_="L",L.push(h,m);break;case"V":m=d.shift(),_="L",L.push(h,m);break;case"C":L.push(d.shift(),d.shift(),d.shift(),d.shift()),h=d.shift(),m=d.shift(),L.push(h,m);break;case"c":L.push(h+d.shift(),m+d.shift(),h+d.shift(),m+d.shift()),h+=d.shift(),m+=d.shift(),_="C",L.push(h,m);break;case"S":c=h,u=m,y=l[l.length-1],"C"===y.command&&(c=h+(h-y.points[2]),u=m+(m-y.points[3])),L.push(c,u,d.shift(),d.shift()),h=d.shift(),m=d.shift(),_="C",L.push(h,m);break;case"s":c=h,u=m,y=l[l.length-1],"C"===y.command&&(c=h+(h-y.points[2]),u=m+(m-y.points[3])),L.push(c,u,h+d.shift(),m+d.shift()),h+=d.shift(),m+=d.shift(),_="C",L.push(h,m);break;case"Q":L.push(d.shift(),d.shift()),h=d.shift(),m=d.shift(),L.push(h,m);break;case"q":L.push(h+d.shift(),m+d.shift()),h+=d.shift(),m+=d.shift(),_="Q",L.push(h,m);break;case"T":c=h,u=m,y=l[l.length-1],"Q"===y.command&&(c=h+(h-y.points[0]),u=m+(m-y.points[1])),h=d.shift(),m=d.shift(),_="Q",L.push(c,u,h,m);break;case"t":c=h,u=m,y=l[l.length-1],"Q"===y.command&&(c=h+(h-y.points[0]),u=m+(m-y.points[1])),h+=d.shift(),m+=d.shift(),_="Q",L.push(c,u,h,m);break;case"A":g=d.shift(),b=d.shift(),f=d.shift(),k=d.shift(),x=d.shift(),W=h,X=m,h=d.shift(),m=d.shift(),_="A",L=this._convertPoint(W,X,h,m,k,x,g,b,f);break;case"a":g=d.shift(),b=d.shift(),f=d.shift(),k=d.shift(),x=d.shift(),W=h,X=m,h+=d.shift(),m+=d.shift(),_="A",L=this._convertPoint(W,X,h,m,k,x,g,b,f)}for(var K=0,w=L.length;w>K;K+=2)L[K]+=t,L[K+1]+=n;l.push(new i(_||U,L))}("z"===U||"Z"===U)&&l.push(new i("z",[]))}return l},_convertPoint:function(e,t,n,i,a,r,l,h,m){var V=m*(Math.PI/180),U=Math.cos(V)*(e-n)/2+Math.sin(V)*(t-i)/2,d=-1*Math.sin(V)*(e-n)/2+Math.cos(V)*(t-i)/2,p=U*U/(l*l)+d*d/(h*h);p>1&&(l*=Math.sqrt(p),h*=Math.sqrt(p));var c=Math.sqrt((l*l*h*h-l*l*d*d-h*h*U*U)/(l*l*d*d+h*h*U*U));a===r&&(c*=-1),isNaN(c)&&(c=0);var u=c*l*d/h,y=c*-h*U/l,g=(e+n)/2+Math.cos(V)*u-Math.sin(V)*y,b=(t+i)/2+Math.sin(V)*u+Math.cos(V)*y,f=s([1,0],[(U-u)/l,(d-y)/h]),k=[(U-u)/l,(d-y)/h],x=[(-1*U-u)/l,(-1*d-y)/h],_=s(k,x);return o(k,x)<=-1&&(_=Math.PI),o(k,x)>=1&&(_=0),0===r&&_>0&&(_-=2*Math.PI),1===r&&0>_&&(_+=2*Math.PI),[g,b,l,h,f,_,V,r]},buildPath:function(e,t){var n=t.path,i=t.x||0,a=t.y||0;t.pathArray=t.pathArray||this.buildPathArray(n,i,a);for(var o=t.pathArray,s=t.pointList=[],r=[],l=0,h=o.length;h>l;l++){"M"==o[l].command.toUpperCase()&&(r.length>0&&s.push(r),r=[]);for(var m=o[l].points,V=0,U=m.length;U>V;V+=2)r.push([m[V],m[V+1]])}r.length>0&&s.push(r);for(var l=0,h=o.length;h>l;l++){var d=o[l].command,m=o[l].points;switch(d){case"L":e.lineTo(m[0],m[1]);break;case"M":e.moveTo(m[0],m[1]);break;case"C":e.bezierCurveTo(m[0],m[1],m[2],m[3],m[4],m[5]);break;case"Q":e.quadraticCurveTo(m[0],m[1],m[2],m[3]);break;case"A":var p=m[0],c=m[1],u=m[2],y=m[3],g=m[4],b=m[5],f=m[6],k=m[7],x=u>y?u:y,_=u>y?1:u/y,L=u>y?y/u:1;e.translate(p,c),e.rotate(f),e.scale(_,L),e.arc(0,0,x,g,g+b,1-k),e.scale(1/_,1/L),e.rotate(-f),e.translate(-p,-c);break;case"z":e.closePath()}}},getRect:function(e){if(e.__rect)return e.__rect;var t;t="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0;for(var n=Number.MAX_VALUE,i=Number.MIN_VALUE,a=Number.MAX_VALUE,o=Number.MIN_VALUE,s=e.x||0,r=e.y||0,l=e.pathArray||this.buildPathArray(e.path),h=0;hi&&(i=m[V])):(m[V]+ro&&(o=m[V]));var U;return U=n===Number.MAX_VALUE||i===Number.MIN_VALUE||a===Number.MAX_VALUE||o===Number.MIN_VALUE?{x:0,y:0,width:0,height:0}:{x:Math.round(n-t/2),y:Math.round(a-t/2),width:i-n+t,height:o-a+t},e.__rect=U,U}},e("../tool/util").inherits(r,t),r}),define("zrender/shape/Ellipse",["require","./Base","../tool/util"],function(e){var t=e("./Base"),n=function(e){t.call(this,e)};return n.prototype={type:"ellipse",buildPath:function(e,t){var n=.5522848,i=t.x,a=t.y,o=t.a,s=t.b,r=o*n,l=s*n;e.moveTo(i-o,a),e.bezierCurveTo(i-o,a-l,i-r,a-s,i,a-s),e.bezierCurveTo(i+r,a-s,i+o,a-l,i+o,a),e.bezierCurveTo(i+o,a+l,i+r,a+s,i,a+s),e.bezierCurveTo(i-r,a+s,i-o,a+l,i-o,a),e.closePath()},getRect:function(e){if(e.__rect)return e.__rect;var t;return t="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0,e.__rect={x:Math.round(e.x-e.a-t/2),y:Math.round(e.y-e.b-t/2),width:2*e.a+t,height:2*e.b+t},e.__rect}},e("../tool/util").inherits(n,t),n}),define("echarts/component/dataRange",["require","./base","zrender/shape/Text","zrender/shape/Rectangle","../util/shape/HandlePolygon","../config","zrender/tool/util","zrender/tool/event","zrender/tool/area","zrender/tool/color","../component"],function(e){function t(e,t,i,a,o){if("undefined"==typeof this.query(a,"dataRange.min")||"undefined"==typeof this.query(a,"dataRange.max"))return void console.error("option.dataRange.min or option.dataRange.max has not been defined.");n.call(this,e,t,i,a,o);var r=this;r._ondrift=function(e,t){return r.__ondrift(this,e,t)},r._ondragend=function(){return r.__ondragend()},r._dataRangeSelected=function(e){return r.__dataRangeSelected(e)},r._dispatchHoverLink=function(e){return r.__dispatchHoverLink(e)},r._onhoverlink=function(e){return r.__onhoverlink(e)},this._selectedMap={},this._range={},this.refresh(a),t.bind(s.EVENT.HOVER,this._onhoverlink)}var n=e("./base"),i=e("zrender/shape/Text"),a=e("zrender/shape/Rectangle"),o=e("../util/shape/HandlePolygon"),s=e("../config");s.dataRange={zlevel:0,z:4,show:!0,orient:"vertical",x:"left",y:"bottom",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,itemWidth:20,itemHeight:14,precision:0,splitNumber:5,calculable:!1,selectedMode:!0,hoverLink:!0,realtime:!0,color:["#006edd","#e0ffff"],textStyle:{color:"#333"}};var r=e("zrender/tool/util"),l=e("zrender/tool/event"),h=e("zrender/tool/area"),m=e("zrender/tool/color");return t.prototype={type:s.COMPONENT_TYPE_DATARANGE,_textGap:10,_buildShape:function(){if(this._itemGroupLocation=this._getItemGroupLocation(),this._buildBackground(),this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable?this._buildGradient():this._buildItem(),this.dataRangeOption.show)for(var e=0,t=this.shapeList.length;t>e;e++)this.zr.addShape(this.shapeList[e]);this._syncShapeFromRange()},_buildItem:function(){var e,t,n,o,s=this._valueTextList,r=s.length,l=this.getFont(this.dataRangeOption.textStyle),m=this._itemGroupLocation.x,V=this._itemGroupLocation.y,U=this.dataRangeOption.itemWidth,d=this.dataRangeOption.itemHeight,p=this.dataRangeOption.itemGap,c=h.getTextHeight("国",l);"vertical"==this.dataRangeOption.orient&&"right"==this.dataRangeOption.x&&(m=this._itemGroupLocation.x+this._itemGroupLocation.width-U);var u=!0;this.dataRangeOption.text&&(u=!1,this.dataRangeOption.text[0]&&(n=this._getTextShape(m,V,this.dataRangeOption.text[0]),"horizontal"==this.dataRangeOption.orient?m+=h.getTextWidth(this.dataRangeOption.text[0],l)+this._textGap:(V+=c+this._textGap,n.style.y+=c/2+this._textGap,n.style.textBaseline="bottom"),this.shapeList.push(new i(n))));for(var y=0;r>y;y++)e=s[y],o=this.getColorByIndex(y),t=this._getItemShape(m,V,U,d,this._selectedMap[y]?o:"#ccc"),t._idx=y,t.onmousemove=this._dispatchHoverLink,this.dataRangeOption.selectedMode&&(t.clickable=!0,t.onclick=this._dataRangeSelected),this.shapeList.push(new a(t)),u&&(n={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:m+U+5,y:V,color:this._selectedMap[y]?this.dataRangeOption.textStyle.color:"#ccc",text:s[y],textFont:l,textBaseline:"top"},highlightStyle:{brushType:"fill"}},"vertical"==this.dataRangeOption.orient&&"right"==this.dataRangeOption.x&&(n.style.x-=U+10,n.style.textAlign="right"),n._idx=y,n.onmousemove=this._dispatchHoverLink,this.dataRangeOption.selectedMode&&(n.clickable=!0,n.onclick=this._dataRangeSelected),this.shapeList.push(new i(n))),"horizontal"==this.dataRangeOption.orient?m+=U+(u?5:0)+(u?h.getTextWidth(e,l):0)+p:V+=d+p;!u&&this.dataRangeOption.text[1]&&("horizontal"==this.dataRangeOption.orient?m=m-p+this._textGap:V=V-p+this._textGap,n=this._getTextShape(m,V,this.dataRangeOption.text[1]),"horizontal"!=this.dataRangeOption.orient&&(n.style.y-=5,n.style.textBaseline="top"),this.shapeList.push(new i(n)))},_buildGradient:function(){var t,n,o=this.getFont(this.dataRangeOption.textStyle),s=this._itemGroupLocation.x,r=this._itemGroupLocation.y,l=this.dataRangeOption.itemWidth,m=this.dataRangeOption.itemHeight,V=h.getTextHeight("国",o),U=10,d=!0;this.dataRangeOption.text&&(d=!1,this.dataRangeOption.text[0]&&(n=this._getTextShape(s,r,this.dataRangeOption.text[0]),"horizontal"==this.dataRangeOption.orient?s+=h.getTextWidth(this.dataRangeOption.text[0],o)+this._textGap:(r+=V+this._textGap,n.style.y+=V/2+this._textGap,n.style.textBaseline="bottom"),this.shapeList.push(new i(n))));for(var p=e("zrender/tool/color"),c=1/(this.dataRangeOption.color.length-1),u=[],y=0,g=this.dataRangeOption.color.length;g>y;y++)u.push([y*c,this.dataRangeOption.color[y]]);"horizontal"==this.dataRangeOption.orient?(t={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:s,y:r,width:l*U,height:m,color:p.getLinearGradient(s,r,s+l*U,r,u)},hoverable:!1},s+=l*U+this._textGap):(t={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:s,y:r,width:l,height:m*U,color:p.getLinearGradient(s,r,s,r+m*U,u)},hoverable:!1},r+=m*U+this._textGap),this.shapeList.push(new a(t)),this._calculableLocation=t.style,this.dataRangeOption.calculable&&(this._buildFiller(),this._bulidMask(),this._bulidHandle()),this._buildIndicator(),!d&&this.dataRangeOption.text[1]&&(n=this._getTextShape(s,r,this.dataRangeOption.text[1]),this.shapeList.push(new i(n)))},_buildIndicator:function(){var e,t,n=this._calculableLocation.x,i=this._calculableLocation.y,a=this._calculableLocation.width,s=this._calculableLocation.height,r=5;"horizontal"==this.dataRangeOption.orient?"bottom"!=this.dataRangeOption.y?(e=[[n,i+s],[n-r,i+s+r],[n+r,i+s+r]],t="bottom"):(e=[[n,i],[n-r,i-r],[n+r,i-r]],t="top"):"right"!=this.dataRangeOption.x?(e=[[n+a,i],[n+a+r,i-r],[n+a+r,i+r]],t="right"):(e=[[n,i],[n-r,i-r],[n-r,i+r]],t="left"),this._indicatorShape={style:{pointList:e,color:"#fff",__rect:{x:Math.min(e[0][0],e[1][0]),y:Math.min(e[0][1],e[1][1]),width:r*("horizontal"==this.dataRangeOption.orient?2:1),height:r*("horizontal"==this.dataRangeOption.orient?1:2)}},highlightStyle:{brushType:"fill",textPosition:t,textColor:this.dataRangeOption.textStyle.color},hoverable:!1},this._indicatorShape=new o(this._indicatorShape) +},_buildFiller:function(){this._fillerShape={zlevel:this.getZlevelBase(),z:this.getZBase()+1,style:{x:this._calculableLocation.x,y:this._calculableLocation.y,width:this._calculableLocation.width,height:this._calculableLocation.height,color:"rgba(255,255,255,0)"},highlightStyle:{strokeColor:"rgba(255,255,255,0.5)",lineWidth:1},draggable:!0,ondrift:this._ondrift,ondragend:this._ondragend,onmousemove:this._dispatchHoverLink,_type:"filler"},this._fillerShape=new a(this._fillerShape),this.shapeList.push(this._fillerShape)},_bulidHandle:function(){var e,t,n,i,a,s,r,l,m=this._calculableLocation.x,V=this._calculableLocation.y,U=this._calculableLocation.width,d=this._calculableLocation.height,p=this.getFont(this.dataRangeOption.textStyle),c=h.getTextHeight("国",p),u=Math.max(h.getTextWidth(this._textFormat(this.dataRangeOption.max),p),h.getTextWidth(this._textFormat(this.dataRangeOption.min),p))+2;"horizontal"==this.dataRangeOption.orient?"bottom"!=this.dataRangeOption.y?(e=[[m,V],[m,V+d+c],[m-c,V+d+c],[m-1,V+d],[m-1,V]],t=m-u/2-c,n=V+d+c/2+2,i={x:m-u-c,y:V+d,width:u+c,height:c},a=[[m+U,V],[m+U,V+d+c],[m+U+c,V+d+c],[m+U+1,V+d],[m+U+1,V]],s=m+U+u/2+c,r=n,l={x:m+U,y:V+d,width:u+c,height:c}):(e=[[m,V+d],[m,V-c],[m-c,V-c],[m-1,V],[m-1,V+d]],t=m-u/2-c,n=V-c/2-2,i={x:m-u-c,y:V-c,width:u+c,height:c},a=[[m+U,V+d],[m+U,V-c],[m+U+c,V-c],[m+U+1,V],[m+U+1,V+d]],s=m+U+u/2+c,r=n,l={x:m+U,y:V-c,width:u+c,height:c}):(u+=c,"right"!=this.dataRangeOption.x?(e=[[m,V],[m+U+c,V],[m+U+c,V-c],[m+U,V-1],[m,V-1]],t=m+U+u/2+c/2,n=V-c/2,i={x:m+U,y:V-c,width:u+c,height:c},a=[[m,V+d],[m+U+c,V+d],[m+U+c,V+c+d],[m+U,V+1+d],[m,V+d+1]],s=t,r=V+d+c/2,l={x:m+U,y:V+d,width:u+c,height:c}):(e=[[m+U,V],[m-c,V],[m-c,V-c],[m,V-1],[m+U,V-1]],t=m-u/2-c/2,n=V-c/2,i={x:m-u-c,y:V-c,width:u+c,height:c},a=[[m+U,V+d],[m-c,V+d],[m-c,V+c+d],[m,V+1+d],[m+U,V+d+1]],s=t,r=V+d+c/2,l={x:m-u-c,y:V+d,width:u+c,height:c})),this._startShape={style:{pointList:e,text:this._textFormat(this.dataRangeOption.max),textX:t,textY:n,textFont:p,color:this.getColor(this.dataRangeOption.max),rect:i,x:e[0][0],y:e[0][1],_x:e[0][0],_y:e[0][1]}},this._startShape.highlightStyle={strokeColor:this._startShape.style.color,lineWidth:1},this._endShape={style:{pointList:a,text:this._textFormat(this.dataRangeOption.min),textX:s,textY:r,textFont:p,color:this.getColor(this.dataRangeOption.min),rect:l,x:a[0][0],y:a[0][1],_x:a[0][0],_y:a[0][1]}},this._endShape.highlightStyle={strokeColor:this._endShape.style.color,lineWidth:1},this._startShape.zlevel=this._endShape.zlevel=this.getZlevelBase(),this._startShape.z=this._endShape.z=this.getZBase()+1,this._startShape.draggable=this._endShape.draggable=!0,this._startShape.ondrift=this._endShape.ondrift=this._ondrift,this._startShape.ondragend=this._endShape.ondragend=this._ondragend,this._startShape.style.textColor=this._endShape.style.textColor=this.dataRangeOption.textStyle.color,this._startShape.style.textAlign=this._endShape.style.textAlign="center",this._startShape.style.textPosition=this._endShape.style.textPosition="specific",this._startShape.style.textBaseline=this._endShape.style.textBaseline="middle",this._startShape.style.width=this._endShape.style.width=0,this._startShape.style.height=this._endShape.style.height=0,this._startShape.style.textPosition=this._endShape.style.textPosition="specific",this._startShape=new o(this._startShape),this._endShape=new o(this._endShape),this.shapeList.push(this._startShape),this.shapeList.push(this._endShape)},_bulidMask:function(){var e=this._calculableLocation.x,t=this._calculableLocation.y,n=this._calculableLocation.width,i=this._calculableLocation.height;this._startMask={zlevel:this.getZlevelBase(),z:this.getZBase()+1,style:{x:e,y:t,width:"horizontal"==this.dataRangeOption.orient?0:n,height:"horizontal"==this.dataRangeOption.orient?i:0,color:"#ccc"},hoverable:!1},this._endMask={zlevel:this.getZlevelBase(),z:this.getZBase()+1,style:{x:"horizontal"==this.dataRangeOption.orient?e+n:e,y:"horizontal"==this.dataRangeOption.orient?t:t+i,width:"horizontal"==this.dataRangeOption.orient?0:n,height:"horizontal"==this.dataRangeOption.orient?i:0,color:"#ccc"},hoverable:!1},this._startMask=new a(this._startMask),this._endMask=new a(this._endMask),this.shapeList.push(this._startMask),this.shapeList.push(this._endMask)},_buildBackground:function(){var e=this.reformCssArray(this.dataRangeOption.padding);this.shapeList.push(new a({zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this._itemGroupLocation.x-e[3],y:this._itemGroupLocation.y-e[0],width:this._itemGroupLocation.width+e[3]+e[1],height:this._itemGroupLocation.height+e[0]+e[2],brushType:0===this.dataRangeOption.borderWidth?"fill":"both",color:this.dataRangeOption.backgroundColor,strokeColor:this.dataRangeOption.borderColor,lineWidth:this.dataRangeOption.borderWidth}}))},_getItemGroupLocation:function(){var e=this._valueTextList,t=e.length,n=this.dataRangeOption.itemGap,i=this.dataRangeOption.itemWidth,a=this.dataRangeOption.itemHeight,o=0,s=0,r=this.getFont(this.dataRangeOption.textStyle),l=h.getTextHeight("国",r),m=10;if("horizontal"==this.dataRangeOption.orient){if(this.dataRangeOption.text||this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable)o=(this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable?i*m+n:t*(i+n))+(this.dataRangeOption.text&&"undefined"!=typeof this.dataRangeOption.text[0]?h.getTextWidth(this.dataRangeOption.text[0],r)+this._textGap:0)+(this.dataRangeOption.text&&"undefined"!=typeof this.dataRangeOption.text[1]?h.getTextWidth(this.dataRangeOption.text[1],r)+this._textGap:0);else{i+=5;for(var V=0;t>V;V++)o+=i+h.getTextWidth(e[V],r)+n}o-=n,s=Math.max(l,a)}else{var U;if(this.dataRangeOption.text||this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable)s=(this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable?a*m+n:t*(a+n))+(this.dataRangeOption.text&&"undefined"!=typeof this.dataRangeOption.text[0]?this._textGap+l:0)+(this.dataRangeOption.text&&"undefined"!=typeof this.dataRangeOption.text[1]?this._textGap+l:0),U=Math.max(h.getTextWidth(this.dataRangeOption.text&&this.dataRangeOption.text[0]||"",r),h.getTextWidth(this.dataRangeOption.text&&this.dataRangeOption.text[1]||"",r)),o=Math.max(i,U);else{s=(a+n)*t,i+=5,U=0;for(var V=0;t>V;V++)U=Math.max(U,h.getTextWidth(e[V],r));o=i+U}s-=n}var d,p=this.reformCssArray(this.dataRangeOption.padding),c=this.zr.getWidth();switch(this.dataRangeOption.x){case"center":d=Math.floor((c-o)/2);break;case"left":d=p[3]+this.dataRangeOption.borderWidth;break;case"right":d=c-o-p[1]-this.dataRangeOption.borderWidth;break;default:d=this.parsePercent(this.dataRangeOption.x,c),d=isNaN(d)?0:d}var u,y=this.zr.getHeight();switch(this.dataRangeOption.y){case"top":u=p[0]+this.dataRangeOption.borderWidth;break;case"bottom":u=y-s-p[2]-this.dataRangeOption.borderWidth;break;case"center":u=Math.floor((y-s)/2);break;default:u=this.parsePercent(this.dataRangeOption.y,y),u=isNaN(u)?0:u}if(this.dataRangeOption.calculable){var g=Math.max(h.getTextWidth(this.dataRangeOption.max,r),h.getTextWidth(this.dataRangeOption.min,r))+l;"horizontal"==this.dataRangeOption.orient?(g>d&&(d=g),d+o+g>c&&(d-=g)):(l>u&&(u=l),u+s+l>y&&(u-=l))}return{x:d,y:u,width:o,height:s}},_getTextShape:function(e,t,n){return{zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:"horizontal"==this.dataRangeOption.orient?e:this._itemGroupLocation.x+this._itemGroupLocation.width/2,y:"horizontal"==this.dataRangeOption.orient?this._itemGroupLocation.y+this._itemGroupLocation.height/2:t,color:this.dataRangeOption.textStyle.color,text:n,textFont:this.getFont(this.dataRangeOption.textStyle),textBaseline:"horizontal"==this.dataRangeOption.orient?"middle":"top",textAlign:"horizontal"==this.dataRangeOption.orient?"left":"center"},hoverable:!1}},_getItemShape:function(e,t,n,i,a){return{zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:e,y:t+1,width:n,height:i-2,color:a},highlightStyle:{strokeColor:a,lineWidth:1}}},__ondrift:function(e,t,n){var i=this._calculableLocation.x,a=this._calculableLocation.y,o=this._calculableLocation.width,s=this._calculableLocation.height;return"horizontal"==this.dataRangeOption.orient?e.style.x+t<=i?e.style.x=i:e.style.x+t+e.style.width>=i+o?e.style.x=i+o-e.style.width:e.style.x+=t:e.style.y+n<=a?e.style.y=a:e.style.y+n+e.style.height>=a+s?e.style.y=a+s-e.style.height:e.style.y+=n,"filler"==e._type?this._syncHandleShape():this._syncFillerShape(e),this.dataRangeOption.realtime&&this._dispatchDataRange(),!0},__ondragend:function(){this.isDragend=!0},ondragend:function(e,t){this.isDragend&&e.target&&(t.dragOut=!0,t.dragIn=!0,this.dataRangeOption.realtime||this._dispatchDataRange(),t.needRefresh=!1,this.isDragend=!1)},_syncShapeFromRange:function(){var e=this.dataRangeOption.range||{};if(this._range.end="undefined"!=typeof this._range.end?this._range.end:"undefined"!=typeof e.start?e.start:0,this._range.start="undefined"!=typeof this._range.start?this._range.start:"undefined"!=typeof e.end?e.end:100,100!=this._range.start||0!==this._range.end){if("horizontal"==this.dataRangeOption.orient){var t=this._fillerShape.style.width;this._fillerShape.style.x+=t*(100-this._range.start)/100,this._fillerShape.style.width=t*(this._range.start-this._range.end)/100}else{var n=this._fillerShape.style.height;this._fillerShape.style.y+=n*(100-this._range.start)/100,this._fillerShape.style.height=n*(this._range.start-this._range.end)/100}this.zr.modShape(this._fillerShape.id),this._syncHandleShape()}},_syncHandleShape:function(){var e=this._calculableLocation.x,t=this._calculableLocation.y,n=this._calculableLocation.width,i=this._calculableLocation.height;"horizontal"==this.dataRangeOption.orient?(this._startShape.style.x=this._fillerShape.style.x,this._startMask.style.width=this._startShape.style.x-e,this._endShape.style.x=this._fillerShape.style.x+this._fillerShape.style.width,this._endMask.style.x=this._endShape.style.x,this._endMask.style.width=e+n-this._endShape.style.x,this._range.start=Math.ceil(100-(this._startShape.style.x-e)/n*100),this._range.end=Math.floor(100-(this._endShape.style.x-e)/n*100)):(this._startShape.style.y=this._fillerShape.style.y,this._startMask.style.height=this._startShape.style.y-t,this._endShape.style.y=this._fillerShape.style.y+this._fillerShape.style.height,this._endMask.style.y=this._endShape.style.y,this._endMask.style.height=t+i-this._endShape.style.y,this._range.start=Math.ceil(100-(this._startShape.style.y-t)/i*100),this._range.end=Math.floor(100-(this._endShape.style.y-t)/i*100)),this._syncShape()},_syncFillerShape:function(e){var t,n,i=this._calculableLocation.x,a=this._calculableLocation.y,o=this._calculableLocation.width,s=this._calculableLocation.height;"horizontal"==this.dataRangeOption.orient?(t=this._startShape.style.x,n=this._endShape.style.x,e.id==this._startShape.id&&t>=n?(n=t,this._endShape.style.x=t):e.id==this._endShape.id&&t>=n&&(t=n,this._startShape.style.x=t),this._fillerShape.style.x=t,this._fillerShape.style.width=n-t,this._startMask.style.width=t-i,this._endMask.style.x=n,this._endMask.style.width=i+o-n,this._range.start=Math.ceil(100-(t-i)/o*100),this._range.end=Math.floor(100-(n-i)/o*100)):(t=this._startShape.style.y,n=this._endShape.style.y,e.id==this._startShape.id&&t>=n?(n=t,this._endShape.style.y=t):e.id==this._endShape.id&&t>=n&&(t=n,this._startShape.style.y=t),this._fillerShape.style.y=t,this._fillerShape.style.height=n-t,this._startMask.style.height=t-a,this._endMask.style.y=n,this._endMask.style.height=a+s-n,this._range.start=Math.ceil(100-(t-a)/s*100),this._range.end=Math.floor(100-(n-a)/s*100)),this._syncShape()},_syncShape:function(){this._startShape.position=[this._startShape.style.x-this._startShape.style._x,this._startShape.style.y-this._startShape.style._y],this._startShape.style.text=this._textFormat(this._gap*this._range.start+this.dataRangeOption.min),this._startShape.style.color=this._startShape.highlightStyle.strokeColor=this.getColor(this._gap*this._range.start+this.dataRangeOption.min),this._endShape.position=[this._endShape.style.x-this._endShape.style._x,this._endShape.style.y-this._endShape.style._y],this._endShape.style.text=this._textFormat(this._gap*this._range.end+this.dataRangeOption.min),this._endShape.style.color=this._endShape.highlightStyle.strokeColor=this.getColor(this._gap*this._range.end+this.dataRangeOption.min),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this.zr.modShape(this._startMask.id),this.zr.modShape(this._endMask.id),this.zr.modShape(this._fillerShape.id),this.zr.refreshNextFrame()},_dispatchDataRange:function(){this.messageCenter.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:this._range.end,end:this._range.start}},this.myChart)},__dataRangeSelected:function(e){if("single"===this.dataRangeOption.selectedMode)for(var t in this._selectedMap)this._selectedMap[t]=!1;var n=e.target._idx;this._selectedMap[n]=!this._selectedMap[n];var i=(this._colorList.length-n)*this._gap+this.dataRangeOption.min;this.messageCenter.dispatch(s.EVENT.DATA_RANGE_SELECTED,e.event,{selected:this._selectedMap,target:n,valueMax:i,valueMin:i-this._gap},this.myChart),this.messageCenter.dispatch(s.EVENT.REFRESH,null,null,this.myChart)},__dispatchHoverLink:function(e){var t,n;if(this.dataRangeOption.calculable){var i,a=this.dataRangeOption.max-this.dataRangeOption.min;i="horizontal"==this.dataRangeOption.orient?(1-(l.getX(e.event)-this._calculableLocation.x)/this._calculableLocation.width)*a:(1-(l.getY(e.event)-this._calculableLocation.y)/this._calculableLocation.height)*a,t=i-.05*a,n=i+.05*a}else{var o=e.target._idx;n=(this._colorList.length-o)*this._gap+this.dataRangeOption.min,t=n-this._gap}this.messageCenter.dispatch(s.EVENT.DATA_RANGE_HOVERLINK,e.event,{valueMin:t,valueMax:n},this.myChart)},__onhoverlink:function(e){if(this.dataRangeOption.show&&this.dataRangeOption.hoverLink&&this._indicatorShape&&e&&null!=e.seriesIndex&&null!=e.dataIndex){var t=e.value;if(""===t||isNaN(t))return;tthis.dataRangeOption.max&&(t=this.dataRangeOption.max),this._indicatorShape.position="horizontal"==this.dataRangeOption.orient?[(this.dataRangeOption.max-t)/(this.dataRangeOption.max-this.dataRangeOption.min)*this._calculableLocation.width,0]:[0,(this.dataRangeOption.max-t)/(this.dataRangeOption.max-this.dataRangeOption.min)*this._calculableLocation.height],this._indicatorShape.style.text=this._textFormat(e.value),this._indicatorShape.style.color=this.getColor(t),this.zr.addHoverShape(this._indicatorShape)}},_textFormat:function(e,t){if(e=e.toFixed(this.dataRangeOption.precision),t=null!=t?t.toFixed(this.dataRangeOption.precision):"",this.dataRangeOption.formatter){if("string"==typeof this.dataRangeOption.formatter)return this.dataRangeOption.formatter.replace("{value}",e).replace("{value2}",t);if("function"==typeof this.dataRangeOption.formatter)return this.dataRangeOption.formatter.call(this.myChart,e,t)}return""!==t?e+" - "+t:e},refresh:function(e){if(e){this.option=e,this.option.dataRange=this.reformOption(this.option.dataRange),this.dataRangeOption=this.option.dataRange,this.myChart.canvasSupported||(this.dataRangeOption.realtime=!1);var t=this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable?100:this.dataRangeOption.splitNumber;if(this._colorList=m.getGradientColors(this.dataRangeOption.color,Math.max((t-this.dataRangeOption.color.length)/(this.dataRangeOption.color.length-1),0)+1),this._colorList.length>t){for(var n=this._colorList.length,i=[this._colorList[0]],a=n/(t-1),o=1;t-1>o;o++)i.push(this._colorList[Math.floor(o*a)]);i.push(this._colorList[n-1]),this._colorList=i}var s=this.dataRangeOption.precision;for(this._gap=(this.dataRangeOption.max-this.dataRangeOption.min)/t;this._gap.toFixed(s)-0!=this._gap&&5>s;)s++;this.dataRangeOption.precision=s,this._gap=((this.dataRangeOption.max-this.dataRangeOption.min)/t).toFixed(s)-0,this._valueTextList=[];for(var o=0;t>o;o++)this._selectedMap[o]=!0,this._valueTextList.unshift(this._textFormat(o*this._gap+this.dataRangeOption.min,(o+1)*this._gap+this.dataRangeOption.min))}this.clear(),this._buildShape()},getColor:function(e){if(isNaN(e))return null;if(this.dataRangeOption.min==this.dataRangeOption.max)return this._colorList[0];if(ethis.dataRangeOption.max&&(e=this.dataRangeOption.max),this.dataRangeOption.calculable&&(e-(this._gap*this._range.start+this.dataRangeOption.min)>5e-5||e-(this._gap*this._range.end+this.dataRangeOption.min)<-5e-5))return null;var t=this._colorList.length-Math.ceil((e-this.dataRangeOption.min)/(this.dataRangeOption.max-this.dataRangeOption.min)*this._colorList.length);return t==this._colorList.length&&t--,this._selectedMap[t]?this._colorList[t]:null},getColorByIndex:function(e){return e>=this._colorList.length?e=this._colorList.length-1:0>e&&(e=0),this._colorList[e]},onbeforDispose:function(){this.messageCenter.unbind(s.EVENT.HOVER,this._onhoverlink)}},r.inherits(t,n),e("../component").define("dataRange",t),t}),define("echarts/component/roamController",["require","./base","zrender/shape/Rectangle","zrender/shape/Sector","zrender/shape/Circle","../config","zrender/tool/util","zrender/tool/color","zrender/tool/event","../component"],function(e){function t(e,t,i,a,o){if(a.roamController&&a.roamController.show){if(!a.roamController.mapTypeControl)return void console.error("option.roamController.mapTypeControl has not been defined.");n.call(this,e,t,i,a,o),this.rcOption=a.roamController;var s=this;this._drictionMouseDown=function(e){return s.__drictionMouseDown(e)},this._drictionMouseUp=function(e){return s.__drictionMouseUp(e)},this._drictionMouseMove=function(e){return s.__drictionMouseMove(e)},this._drictionMouseOut=function(e){return s.__drictionMouseOut(e)},this._scaleHandler=function(e){return s.__scaleHandler(e)},this.refresh(a)}}var n=e("./base"),i=e("zrender/shape/Rectangle"),a=e("zrender/shape/Sector"),o=e("zrender/shape/Circle"),s=e("../config");s.roamController={zlevel:0,z:4,show:!0,x:"left",y:"top",width:80,height:120,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,handleColor:"#6495ed",fillerColor:"#fff",step:15,mapTypeControl:null};var r=e("zrender/tool/util"),l=e("zrender/tool/color"),h=e("zrender/tool/event");return t.prototype={type:s.COMPONENT_TYPE_ROAMCONTROLLER,_buildShape:function(){if(this.rcOption.show){this._itemGroupLocation=this._getItemGroupLocation(),this._buildBackground(),this._buildItem();for(var e=0,t=this.shapeList.length;t>e;e++)this.zr.addShape(this.shapeList[e])}},_buildItem:function(){this.shapeList.push(this._getDirectionShape("up")),this.shapeList.push(this._getDirectionShape("down")),this.shapeList.push(this._getDirectionShape("left")),this.shapeList.push(this._getDirectionShape("right")),this.shapeList.push(this._getScaleShape("scaleUp")),this.shapeList.push(this._getScaleShape("scaleDown"))},_getDirectionShape:function(e){var t=this._itemGroupLocation.r,n=this._itemGroupLocation.x+t,i=this._itemGroupLocation.y+t,o={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:n,y:i,r:t,startAngle:-45,endAngle:45,color:this.rcOption.handleColor,text:">",textX:n+t/2+4,textY:i-.5,textAlign:"center",textBaseline:"middle",textPosition:"specific",textColor:this.rcOption.fillerColor,textFont:Math.floor(t/2)+"px arial"},highlightStyle:{color:l.lift(this.rcOption.handleColor,-.2),brushType:"fill"},clickable:!0};switch(e){case"up":o.rotation=[Math.PI/2,n,i];break;case"left":o.rotation=[Math.PI,n,i];break;case"down":o.rotation=[-Math.PI/2,n,i]}return o=new a(o),o._roamType=e,o.onmousedown=this._drictionMouseDown,o.onmouseup=this._drictionMouseUp,o.onmousemove=this._drictionMouseMove,o.onmouseout=this._drictionMouseOut,o},_getScaleShape:function(e){var t=this._itemGroupLocation.width,n=this._itemGroupLocation.height-t;n=0>n?20:n;var i=Math.min(t/2-5,n)/2,a=this._itemGroupLocation.x+("scaleDown"===e?t-i:i),s=this._itemGroupLocation.y+this._itemGroupLocation.height-i,r={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:a,y:s,r:i,color:this.rcOption.handleColor,text:"scaleDown"===e?"-":"+",textX:a,textY:s-2,textAlign:"center",textBaseline:"middle",textPosition:"specific",textColor:this.rcOption.fillerColor,textFont:Math.floor(i)+"px verdana"},highlightStyle:{color:l.lift(this.rcOption.handleColor,-.2),brushType:"fill"},clickable:!0};return r=new o(r),r._roamType=e,r.onmousedown=this._scaleHandler,r},_buildBackground:function(){var e=this.reformCssArray(this.rcOption.padding);this.shapeList.push(new i({zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this._itemGroupLocation.x-e[3],y:this._itemGroupLocation.y-e[0],width:this._itemGroupLocation.width+e[3]+e[1],height:this._itemGroupLocation.height+e[0]+e[2],brushType:0===this.rcOption.borderWidth?"fill":"both",color:this.rcOption.backgroundColor,strokeColor:this.rcOption.borderColor,lineWidth:this.rcOption.borderWidth}}))},_getItemGroupLocation:function(){var e,t=this.reformCssArray(this.rcOption.padding),n=this.rcOption.width,i=this.rcOption.height,a=this.zr.getWidth(),o=this.zr.getHeight();switch(this.rcOption.x){case"center":e=Math.floor((a-n)/2);break;case"left":e=t[3]+this.rcOption.borderWidth;break;case"right":e=a-n-t[1]-t[3]-2*this.rcOption.borderWidth;break;default:e=this.parsePercent(this.rcOption.x,a)}var s;switch(this.rcOption.y){case"top":s=t[0]+this.rcOption.borderWidth;break;case"bottom":s=o-i-t[0]-t[2]-2*this.rcOption.borderWidth;break;case"center":s=Math.floor((o-i)/2);break;default:s=this.parsePercent(this.rcOption.y,o)}return{x:e,y:s,r:n/2,width:n,height:i}},__drictionMouseDown:function(e){this.mousedown=!0,this._drictionHandlerOn(e)},__drictionMouseUp:function(e){this.mousedown=!1,this._drictionHandlerOff(e)},__drictionMouseMove:function(e){this.mousedown&&this._drictionHandlerOn(e)},__drictionMouseOut:function(e){this._drictionHandlerOff(e)},_drictionHandlerOn:function(e){this._dispatchEvent(e.event,e.target._roamType),clearInterval(this.dircetionTimer);var t=this;this.dircetionTimer=setInterval(function(){t._dispatchEvent(e.event,e.target._roamType)},100),h.stop(e.event)},_drictionHandlerOff:function(){clearInterval(this.dircetionTimer)},__scaleHandler:function(e){this._dispatchEvent(e.event,e.target._roamType),h.stop(e.event)},_dispatchEvent:function(e,t){this.messageCenter.dispatch(s.EVENT.ROAMCONTROLLER,e,{roamType:t,mapTypeControl:this.rcOption.mapTypeControl,step:this.rcOption.step},this.myChart)},refresh:function(e){e&&(this.option=e||this.option,this.option.roamController=this.reformOption(this.option.roamController),this.rcOption=this.option.roamController),this.clear(),this._buildShape()}},r.inherits(t,n),e("../component").define("roamController",t),t}),define("echarts/util/mapData/params",["require"],function(e){function t(e){if(!e.UTF8Encoding)return e;for(var t=e.features,i=0;i>1^-(1&s),r=r>>1^-(1&r),s+=i,r+=a,i=s,a=r,n.push([s/1024,r/1024])}return n}var i={none:{getGeoJson:function(e){e({type:"FeatureCollection",features:[{type:"Feature",geometry:{coordinates:[],encodeOffsets:[],type:"Polygon"},properties:{}}]})}},world:{getGeoJson:function(n){e(["./geoJson/world_geo"],function(e){n(t(e))})}},china:{getGeoJson:function(n){e(["./geoJson/china_geo"],function(e){n(t(e))})}},"南海诸岛":{textCoord:[126,25],getPath:function(e,t){for(var n=[[[0,3.5],[7,11.2],[15,11.9],[30,7],[42,.7],[52,.7],[56,7.7],[59,.7],[64,.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]]],i="",a=e[0],o=e[1],s=0,r=n.length;r>s;s++){i+="M "+((n[s][0][0]*t+a).toFixed(2)-0)+" "+((n[s][0][1]*t+o).toFixed(2)-0)+" ";for(var l=1,h=n[s].length;h>l;l++)i+="L "+((n[s][l][0]*t+a).toFixed(2)-0)+" "+((n[s][l][1]*t+o).toFixed(2)-0)+" "}return i+" Z"}},"新疆":{getGeoJson:function(n){e(["./geoJson/xin_jiang_geo"],function(e){n(t(e))})}},"西藏":{getGeoJson:function(n){e(["./geoJson/xi_zang_geo"],function(e){n(t(e))})}},"内蒙古":{getGeoJson:function(n){e(["./geoJson/nei_meng_gu_geo"],function(e){n(t(e))})}},"青海":{getGeoJson:function(n){e(["./geoJson/qing_hai_geo"],function(e){n(t(e))})}},"四川":{getGeoJson:function(n){e(["./geoJson/si_chuan_geo"],function(e){n(t(e))})}},"黑龙江":{getGeoJson:function(n){e(["./geoJson/hei_long_jiang_geo"],function(e){n(t(e))})}},"甘肃":{getGeoJson:function(n){e(["./geoJson/gan_su_geo"],function(e){n(t(e))})}},"云南":{getGeoJson:function(n){e(["./geoJson/yun_nan_geo"],function(e){n(t(e))})}},"广西":{getGeoJson:function(n){e(["./geoJson/guang_xi_geo"],function(e){n(t(e))})}},"湖南":{getGeoJson:function(n){e(["./geoJson/hu_nan_geo"],function(e){n(t(e))})}},"陕西":{getGeoJson:function(n){e(["./geoJson/shan_xi_1_geo"],function(e){n(t(e))})}},"广东":{getGeoJson:function(n){e(["./geoJson/guang_dong_geo"],function(e){n(t(e))})}},"吉林":{getGeoJson:function(n){e(["./geoJson/ji_lin_geo"],function(e){n(t(e))})}},"河北":{getGeoJson:function(n){e(["./geoJson/he_bei_geo"],function(e){n(t(e))})}},"湖北":{getGeoJson:function(n){e(["./geoJson/hu_bei_geo"],function(e){n(t(e))})}},"贵州":{getGeoJson:function(n){e(["./geoJson/gui_zhou_geo"],function(e){n(t(e))})}},"山东":{getGeoJson:function(n){e(["./geoJson/shan_dong_geo"],function(e){n(t(e))})}},"江西":{getGeoJson:function(n){e(["./geoJson/jiang_xi_geo"],function(e){n(t(e))})}},"河南":{getGeoJson:function(n){e(["./geoJson/he_nan_geo"],function(e){n(t(e))})}},"辽宁":{getGeoJson:function(n){e(["./geoJson/liao_ning_geo"],function(e){n(t(e))})}},"山西":{getGeoJson:function(n){e(["./geoJson/shan_xi_2_geo"],function(e){n(t(e))})}},"安徽":{getGeoJson:function(n){e(["./geoJson/an_hui_geo"],function(e){n(t(e))})}},"福建":{getGeoJson:function(n){e(["./geoJson/fu_jian_geo"],function(e){n(t(e))})}},"浙江":{getGeoJson:function(n){e(["./geoJson/zhe_jiang_geo"],function(e){n(t(e))})}},"江苏":{getGeoJson:function(n){e(["./geoJson/jiang_su_geo"],function(e){n(t(e))})}},"重庆":{getGeoJson:function(n){e(["./geoJson/chong_qing_geo"],function(e){n(t(e))})}},"宁夏":{getGeoJson:function(n){e(["./geoJson/ning_xia_geo"],function(e){n(t(e))})}},"海南":{getGeoJson:function(n){e(["./geoJson/hai_nan_geo"],function(e){n(t(e))})}},"台湾":{getGeoJson:function(n){e(["./geoJson/tai_wan_geo"],function(e){n(t(e))})}},"北京":{getGeoJson:function(n){e(["./geoJson/bei_jing_geo"],function(e){n(t(e))})}},"天津":{getGeoJson:function(n){e(["./geoJson/tian_jin_geo"],function(e){n(t(e))})}},"上海":{getGeoJson:function(n){e(["./geoJson/shang_hai_geo"],function(e){n(t(e))})}},"香港":{getGeoJson:function(n){e(["./geoJson/xiang_gang_geo"],function(e){n(t(e))})}},"澳门":{getGeoJson:function(n){e(["./geoJson/ao_men_geo"],function(e){n(t(e))})}}};return{decode:t,params:i}}),define("echarts/util/mapData/textFixed",[],function(){return{"广东":[0,-10],"香港":[10,10],"澳门":[-10,18],"黑龙江":[0,20],"天津":[5,5],"深圳市":[-35,0],"红河哈尼族彝族自治州":[0,20],"楚雄彝族自治州":[-5,15],"石河子市":[-5,5],"五家渠市":[0,-10],"昌吉回族自治州":[10,10],"昌江黎族自治县":[0,20],"陵水黎族自治县":[0,20],"东方市":[0,20],"渭南市":[0,20]}}),define("echarts/util/mapData/geoCoord",[],function(){return{Russia:[100,60],"United States of America":[-99,38]}}),define("echarts/util/projection/svg",["require","zrender/shape/Path"],function(e){function t(e){return parseFloat(e||0)}function n(e){for(var n=e.firstChild;"svg"!=n.nodeName.toLowerCase()||1!=n.nodeType;)n=n.nextSibling;var i=t(n.getAttribute("x")),a=t(n.getAttribute("y")),o=t(n.getAttribute("width")),s=t(n.getAttribute("height"));return{left:i,top:a,width:o,height:s}}function i(e,t){function n(e){var t=e.tagName;if(m[t]){var o=m[t](e,i);o&&(o.scale=i,o.properties={name:e.getAttribute("name")||""},o.id=e.id,r(o,e),a.push(o))}for(var s=e.childNodes,l=0,h=s.length;h>l;l++)n(s[l])}var i=[t.scale.x,t.scale.y],a=[];return n(e),a}function a(e,t){var n=t instanceof Array?[1*t[0],1*t[1]]:[1*t.x,1*t.y];return[n[0]/e.scale.x,n[1]/e.scale.y]}function o(e,t){var n=t instanceof Array?[1*t[0],1*t[1]]:[1*t.x,1*t.y];return[n[0]*e.scale.x,n[1]*e.scale.y]}function s(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function r(e,t){var n=t.getAttribute("fill"),i=t.getAttribute("stroke"),a=t.getAttribute("stroke-width"),o=t.getAttribute("opacity");n&&"none"!=n?(e.color=n,i?(e.brushType="both",e.strokeColor=i):e.brushType="fill"):i&&"none"!=i&&(e.strokeColor=i,e.brushType="stroke"),a&&"none"!=a&&(e.lineWidth=parseFloat(a)),o&&"none"!=o&&(e.opacity=parseFloat(o))}function l(e){for(var t=s(e).replace(/,/g," ").split(/\s+/),n=[],i=0;io;o++)if(i=a[o],!i.properties.name||!t[i.properties.name])switch(i.type){case"Feature":s[i.geometry.type](i.geometry.coordinates);break;case"GeometryCollection":n=i.geometries;for(var l=0,h=n.length;h>l;l++)s[n[l].type](n[l].coordinates)}return e.srcSize={left:1*s.xmin.toFixed(4),top:1*s.ymin.toFixed(4),width:1*(s.xmax-s.xmin).toFixed(4),height:1*(s.ymax-s.ymin).toFixed(4)},e}function n(e,n,i){function a(e,t){c=e.type,u=e.coordinates,o._bbox={xmin:360,xmax:-360,ymin:180,ymax:-180},y=o[c](u),m.push({path:y,cp:o.makePoint(t.properties.cp?t.properties.cp:[(o._bbox.xmin+o._bbox.xmax)/2,(o._bbox.ymin+o._bbox.ymax)/2]),properties:t.properties,id:t.id})}i=i||{},o.scale=null,o.offset=null,e.srcSize||t(e,i),n.offset={x:e.srcSize.left,y:e.srcSize.top,left:n.OffsetLeft||0,top:n.OffsetTop||0},o.scale=n.scale,o.offset=n.offset;for(var s,r,l,h=e.features,m=[],V=0,U=h.length;U>V;V++)if(l=h[V],!l.properties.name||!i[l.properties.name])if("Feature"==l.type)a(l.geometry,l);else if("GeometryCollection"==l.type){s=l.geometries;for(var d=0,p=s.length;p>d;d++)r=s[d],a(r,r) +}var c,u,y;return m}function i(e,t){var n,i;return t instanceof Array?(n=1*t[0],i=1*t[1]):(n=1*t.x,i=1*t.y),n=n/e.scale.x+e.offset.x-168.5,n=n>180?n-360:n,i=90-(i/e.scale.y+e.offset.y),[n,i]}function a(e,t){return o.offset=e.offset,o.scale=e.scale,o.makePoint(t instanceof Array?[1*t[0],1*t[1]]:[1*t.x,1*t.y])}var o={formatPoint:function(e){return[(e[0]<-168.5&&e[1]>63.8?e[0]+360:e[0])+168.5,90-e[1]]},makePoint:function(e){var t=this,n=t.formatPoint(e);t._bbox.xmin>e[0]&&(t._bbox.xmin=e[0]),t._bbox.xmaxe[1]&&(t._bbox.ymin=e[1]),t._bbox.ymaxi;i++)t=o.makePoint(e[i]),n=0===i?"M"+t.join(","):n+"L"+t.join(",");return n},Polygon:function(e){for(var t="",n=0,i=e.length;i>n;n++)t=t+o.LineString(e[n])+"z";return t},MultiPoint:function(e){for(var t=[],n=0,i=e.length;i>n;n++)t.push(o.Point(e[n]));return t},MultiLineString:function(e){for(var t="",n=0,i=e.length;i>n;n++)t+=o.LineString(e[n]);return t},MultiPolygon:function(e){for(var t="",n=0,i=e.length;i>n;n++)t+=o.Polygon(e[n]);return t}},s={formatPoint:o.formatPoint,makePoint:function(e){var t=this,n=t.formatPoint(e),i=n[0],a=n[1];t.xmin>i&&(t.xmin=i),t.xmaxa&&(t.ymin=a),t.ymaxt;t++)this.makePoint(e[t])},Polygon:function(e){for(var t=0,n=e.length;n>t;t++)this.LineString(e[t])},MultiPoint:function(e){for(var t=0,n=e.length;n>t;t++)this.Point(e[t])},MultiLineString:function(e){for(var t=0,n=e.length;n>t;t++)this.LineString(e[t])},MultiPolygon:function(e){for(var t=0,n=e.length;n>t;t++)this.Polygon(e[t])}};return{getBbox:e,geoJson2Path:n,pos2geo:i,geo2pos:a}}),define("echarts/util/shape/HandlePolygon",["require","zrender/shape/Base","zrender/shape/Polygon","zrender/tool/util"],function(e){function t(e){n.call(this,e)}var n=e("zrender/shape/Base"),i=e("zrender/shape/Polygon"),a=e("zrender/tool/util");return t.prototype={type:"handle-polygon",buildPath:function(e,t){i.prototype.buildPath(e,t)},isCover:function(e,t){var n=this.getTansform(e,t);e=n[0],t=n[1];var i=this.style.rect;return e>=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height?!0:!1}},a.inherits(t,n),t}),define("echarts/util/mapData/geoJson/an_hui_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3415",properties:{name:"六安市",cp:[116.3123,31.8329],childNum:6},geometry:{type:"Polygon",coordinates:["@@„„nJ‚UXUVƒ°U„ÑnU@mlLVaVln@@bn@VU@xlb@lšLnKlšƒVI„JšUVxnI@lVL@b„Ž°VX@˜b„x„nVVUnVVnU‚›@kX@VwV@„al¥UUnUWa@ƒ@wĸU„LU¥lKUa@aUI@alLVaUƒ¯anƒWkUKm@XV@VaXlW@aU_UWVUƒI¯@ma¯W¯™™I@UU@WWU@U@@UU@VkV@@WUUm@UaU@„lK@IUK„L@KWmXUWaXI@ƒ@a@a@U@U@KV¥lw„k°b²JVIVKlV@UX„la„Ul`œUVLVVVUšJ„U@Lnm@_VK@KUIW@™J@Xk@WW@U—ƒmm™XmWk@kK@aUUƒVmmkUwUmWL™@WmU@™UJmUULkKWakLWVkIƒlƒwULƒW@X°lUJ@°ULƒWV—wmJ@bmb¯Vkm@@WkWm¯wƒL@lkXƒWmXym¯UImJUbkV™@Vn¯„@V@lUbƒ@mk@maUxmlUbULWn@J—LmKUkWKkwUKƒbm„X„WxkVUKmLkVV@JUUWL@xkJUUƒV@X@VVlUbVX@xk¤šx‚¼œxWxn„‚nn@Þ¼„JVb°aVn„@šmlnXU„JlbVlkz@‚lUŽlXJmxVxXnWxXÈWlUŽ@šUxU@VX@xUL@šUÆmLnV@lWXk@@JlbXblnlJ"],encodeOffsets:[[118710,33351]]}},{type:"Feature",id:"3408",properties:{name:"安庆市",cp:[116.7517,30.5255],childNum:9},geometry:{type:"Polygon",coordinates:["@@n°‚znW„XlW@k„K°xXn‚l@Xn@l‚°Una@anI˜xXU„ŽVK@¯VIkW¯X@‚„VK„x„klJXUlKXblLVKnVVIšŽV@Xn‚@šŽXKVnVxlŽnn„UlmV@²óUkV™lW„b„lƒšƒn@VVVIn@lw@WVIXblV„@Èx‚aUaVIVVnKVLšK„ƒln@b²K@»U£ƒÑķƒġÝÅb™K™a@Im@ۍ„@kWÓkkmKÅnóJƒUÅ£›W@w„ĕ@wĉţ¯¯ƒUkK±l¯Uƒ¥UÑkÝUķ»Ý¥¯™JƒIUŽVbUl¯ÈV¼VJU¼Vb@bkLUl@„VJ@bUXǚ@lkVmXmKkLVxš‚Ž„VƒL@VkVVVlzW˜kbmLUUUbVbUV™šlÒnJlUnLllUL@bU„Vx„l‚LXVƦÈVU¦WJ"],encodeOffsets:[[118834,31759]]}},{type:"Feature",id:"3411",properties:{name:"滁州市",cp:[118.1909,32.536],childNum:7},geometry:{type:"Polygon",coordinates:["@@š„@`nnl@„xšK@X°KXV˜IXVlbXVWnX‚lL@šÈ»‚LVan@VJ„êVVn@‚X@laÞbVaƒyn@„_‚xnWVXnWl@VnUVkI@l‚nXKVLVV@V@kW@LlVô„@J@bVnnKnkVa@»lç@ƒnwšKma™UUUVњ@n™mWXalI@alVn@VwUaVU„@„nlaôJnU„VVXlJšaXXVK@UšV@VWx@nXVWšXVšUlLUbV‚ULVVnUVbUbVbš@@a„KÆnnKVK@U@UU@@a„@Vƒ°¯ÈJVIlķ@aa˜UaVKU_@mkxUI@aƒUlyU@@™wkKWmUbUnUVWbkJW_J@bƒn@Vm@@KULk@V@@bVbÅm@LW@UVVbkK@UkKWL@VULUKWIUJUbkK@_WVXU›Jka@XƒVa@kšy@aVIUUW@@m„UlLœKWÑUKVan@UkVmmIXKƒaVaUwVU@UmykU¯@±UUL@WUIVUU@KkIWaƒaU@kUUaǃUó»mKƒk¯@y@kWK@bkI¯`mn™l¯XWlkVUzUJlbUbVJl@nnm„@VULV`XnWƗbmUUn™JmUknƒJ¯km@ƒyk@kU›xL@VUbmnn¤lX@`™z@JmaULUVl@Xn@xllkXWa—aW@UVmUbƒ@mVXšWxXbWbUŽƒÒnVVnVVUL"],encodeOffsets:[[120004,33520]]}},{type:"Feature",id:"3418",properties:{name:"宣城市",cp:[118.8062,30.6244],childNum:7},geometry:{type:"Polygon",coordinates:["@@Vb@„XL˜JXxlIXxlVlV@I²¤šnlUnVšU@VULWVUJ@Lnb@lV@UnV@@VVVlLnbnJ‚UVkUUVWn@@anUVnVJVIV‚@@nUJVbUb‚„@VUbVK@bn@VbnIlxkllXVlXKWUXUlL°¤UVVb@bš„UlkXW‚ƒxXz@‚„Ila„UlƒnUlJVInVÆJ„U„LVUnV„K°@VnlVnxV@XLlK@wVL@KnUlJXU˜bnKVLX„lUw@VWlLXKm@@a„@VLnmlIVVnKn@škVašVlwk@@a@k@ƒVIUa™@maUa@wna@kmWƒ™UUmVUIVǗ@aƒKm™aƒ™kU™J@InmUUaVa„k‚lX@Vk@m@VU@wnK@alKVUkUkKƒbmUkmƒ@U£WVk@@UÝbbƒaÇx@b@WVUa¯ƒ@wVwUUV@VwnK@KWaŁ@KšIUyUI@WmXó™UbWaKm™@km@IUyƒIUaWKƒx@zUKUL@llVUnkLVVkJWX@VUKUVƒIkVWakb@VWb@n@JkXUlmL@xkL@`VxšLUÈUJ@Vm@@bmIUlUL@VUVVbknm@mKUw™KVÈ@J@LV±kkJUIƒl"],encodeOffsets:[[120803,31247]]}},{type:"Feature",id:"3412",properties:{name:"阜阳市",cp:[115.7629,32.9919],childNum:6},geometry:{type:"Polygon",coordinates:["@@V™nƒš@ša„k°aš±@‚¥@UUI@aUmlwUUx›b@¥XU@mmI@a@Kn@@_W@@W„I@mšUVVXUl@XaV@‚K@I@a„LX@aVI°K@KVL„UUw‚yXkšK@kšKÆbXnlK@k@a„JlU@w@U@»@aXKWƒn_‚JXkVKnƒ@°LlKXƒW@¯Uƒ@aUK@kmJUw™VƒIUJ™„kŽmL™K@kka@wUVm@@am@UkUbkK@nmVƒÒ¯VU„WVVmIƒƒULk@ƒƒma@kkKƒƒ@nUbUamU™`UUVUkKVkkƒW@@bkmƒnƒmUXVKXVƒL@VƒbU„m‚™bVXJ@nmKÅI@KWKUXVJUL@VUKUX@KUKWL@LUJmaXXm@kVVV@L@VUL@VlK@L@V@LUK@VUb@UUU@°@nVxU`‚Lkn@`@XVJ@X™Vm„k@UKmV¯LVVn±Wm@Ub@JlLUl„@VLk„@lmVVn@bnV@V°IV™šaVJXI°K°V@XXVlVVU„nšKVlUš„bWXnV@bV`U„„@@m@@‚ƒ@nxmn@bXVlL@¤nb„Ul¦šVVUnJVU„Vl@@bÞL"],encodeOffsets:[[118418,34392]]}},{type:"Feature",id:"3413",properties:{name:"宿州市",cp:[117.5208,33.6841],childNum:5},geometry:{type:"Polygon",coordinates:["@@@UWU@bkW@aWU@aUIkWV™lLXb„lVIUVV@‚mn@V_n@VaUK@I‚@UašanJVU„@lV„UVnnKVVlaUa„I@wnK‚Lnll@nVlk@wVKXkl@@b„bUJ@V‚U@U„UUyVk@aVUXwlWXX‚WU¹@aU™@WUI@mlUšn„J@Il@šaXbV@VKl@XxVL@W„IšJlb„@„al@„IUUm@@aVK@¥¯—@mUķ¯bWƒk£Vm@akm@VaÅ@UVWaƒ@UJWkƒJ—UƒbWbU@UlƒXk@ƒamV@K¯nk@ƒlU@Uxmz@bU`ÇbUbÅVm£U@Ww™x@akLUK@UlakwUJWVkLmaUal@n_ƒmVUnKVUUmÅXWa™@kJmx@XUJ@bVLXxl@VVUVV„UbkLWbU@@lUVV„VVX„›K@XkJ@nU@@bV@VxUVlb„U@xXLWŽn@UxVbVĊ„V@b@XV`mnkJ@kUKmbƒaU@VbnbÆx@XU@@`k@@bl„™@@bkL@WƒakXWaU@Vmkx@XWW@@wUUUbƒJ™U¯V™@¯ÞU@WxXŽlL@bkb@ŽlVlnb™JW@kkU@mbkaWJ—IVlmz¯`UnU@mb™@@„ƒ`@bkVlœnV@b@šV@„aVxn@Vx‚KXnl@nbVK„bVK@a„_V@Vƒ„w@W„LlwnK@UmIU@VWš@šUÈ@lKnal„wš@@V°@šaUmlUUw@„ƒV@@UXK"],encodeOffsets:[[119836,35061]]}},{type:"Feature",id:"3410",properties:{name:"黄山市",cp:[118.0481,29.9542],childNum:5},geometry:{type:"Polygon",coordinates:["@@lXnlWX@VUJVnUJVzXJVx„kVJlI²l‚U@K@IUǚLVxnLn@lmUaVU@UVKVknJ@an@@UVIVǙKUw@_lK@wnKVklW@I@mXa@UlaXblU„JVUVL@UXWlIUUlKVmkU@kVKVL@y„wXLVb„JVz@Jlnš@nŽ‚LXbVaôšnW@la@UVWUa@@a@mk@WIk@VwUa¯¥m@UUVK@ImK@aX£ƒkK›ÅV™a™™ƒ_@±ƒakXWW—LƒƒƒnU@@a@¯mK@L™JUWwUV™VmbXX@lWLn`mzUJUb™Lƒ„k@makVWmkX™ambkKknƒaƒ@ƒaƒb@‚U@Unm@—ƒWVƒ@VbUbUJWIk@@lmL@°UVUVm„nš™@@kmWkb@xƒ_m@@aU@b@JlŽUz™lWxXn„@‚b²@l`„IVl„UlL@VšK„nVbUl@VlIn@@b„bVWUk‚@@bX@Valb@bnb°Vn@„xVKlbVnV@V‚x„L@ln@UXVV‚L˜"],encodeOffsets:[[120747,31095]]}},{type:"Feature",id:"3414",properties:{name:"巢湖市",cp:[117.7734,31.4978],childNum:5},geometry:{type:"Polygon",coordinates:["@@VV@blL@ŽXlWnnšnŽ˜„@VXXl@@WšIX@VJ@LšxŎxlnšŽ@bXJVblX@VVbUVn@VbUVlb@LnJVbVLV‚XLšÒVL„ÒšV„bVIVylUXk°Wšknm°_lJ@aXL@l‚z°@„lnLô¼V‚È„VUUaVKU@WW@@UUa@knmVLlaV@„a@kšak±@UmwkKmk™lj™ÝUUkL@mlIVmnÝWkkUÝ@KƑĉ™a@»ƒmma@mX™¤¯Uƒw@ƒ@UU@bU±±L@akmƒ„™LUKmLUUUJVbbÇwƒ@kUWaUJ@Xkxm@UJUUm@™„k„ƒ‚ƒakXUšVl±ôU@kn"],encodeOffsets:[[119847,32007]]}},{type:"Feature",id:"3416",properties:{name:"亳州市",cp:[116.1914,33.4698],childNum:4},geometry:{type:"Polygon",coordinates:["@@lU@Un@@anUlw@KVmUwlaX_lKna@KU@@kWKUU@ankW™XK˜@@V²VVIÈU@al@VaÈamK@wU™@klaUƒV@XƒVUU»WUUbkmUkVmk@aÈw@mWU@VkIkVWKUÑķXȭºU¯lƒ@kkLWmÅa™L@l™LWlzVxƒVUK@L¯LUJ@bWƒK@b@JLU@Wbk@WVUU™V@nƒJ@XX@@`m@@L@bnJ@nWV@¦œa‚wVVkxVn@bVJ@V¦@Ž™²¯bƒl™b™@m„UšUŽƒŽ@¼ƒ¦Xb‚UV`@nnxUxWLkUkVWKkV@XV@@VVL@VX„@lVV@L@blL@`šL@xXKVL‚@„VnUš@lwnU@ml@XnV@@UVW°LnalƒUI@aUK@a‚a@U„kXW@I@mWL@UXK@UVW@U‚@@k„Wn‚@@V„@XblaVxšL@bVKXb„IlJ"],encodeOffsets:[[119183,34594]]}},{type:"Feature",id:"3417",properties:{name:"池州市",cp:[117.3889,30.2014],childNum:4},geometry:{type:"Polygon",coordinates:["@@„V°°ĊŤ@xƒĖ@xœXƤ„VôIÆmnLllXÔ@lƒÜŽn@@JšbšLÆaĢÞĸ„°VVUUKVanK@UV@VL„VVn„ln@‚xnklxXamk@WV@Xa˜@naVk„Klk™@mkUWwkJWw—IWK@ƒUaUwWIUyVIUmVI@UXWmkkW‚—KUUVWm@@kƒKw@U‚UUmkaULƒwm@¯Uma@akaUbW@@a@VlUXƒa@am@kJ@UVkUaƒm™L@UkKƒVUkƒJk_±@aƒ@WmXwÇkkaVaUa±ƒœwV@VkƒwnyUaW@UU¯amLk@m™@kmmU™™¯K@L@lUX¯ƒWlkXƒŽVb„bƒVUL@J@LVKnlJXnlb@`nXlalV@bnL@Vnb˜¼@lXbWlkL™K@zUJmIUxUVUVmX","@@llUL@VlxšL@a@UƒwXa¯@"],encodeOffsets:[[119543,30781],[120061,31152]]}},{type:"Feature",id:"3401",properties:{name:"合肥市",cp:[117.29,32.0581],childNum:4},geometry:{type:"Polygon",coordinates:["@@„L„xV‚ĊLÞkšVlVVXaWaXwW™nU„@‚anVVUX@˜bXblWkk@wWmk@VUVKnb@Išy@_kWm£nmVa@U‚KœwlVl@„zn@°l„IlmnVšIVmnV˜aXÅWmU_VK@Unƒmmk@UIVakaƒa™UƒÑUK™ÑWKUUKUamI@KkaVUUam@VUUa@UkWUaWI@a™kmōw™wUL@`mn@KƒV™IUVUUUK›Vk_ƒVkbWƒ@VkUULUJ±I¯aƒlkxU¦@L@V@V@b@b@„WJXbWVXn@LƒKVL@JkLƒŽV@Vbn@VV@XU@UlV@@VV@V@XXV@@VšJ°š°Xnb°@„JUVVXV`@bkXWŽUbU@WŽn@VLXlm„°bV„UbkK@bVJ@bVbkLV¦ƒKķV@x@„XbmVVVk¦"],encodeOffsets:[[119678,33323]]}},{type:"Feature",id:"3403",properties:{name:"蚌埠市",cp:[117.4109,33.1073],childNum:4},geometry:{type:"Polygon",coordinates:["@@VÒXLlUlJ@UXV@nÇx@bnlUVllnVaXVV¼UVW„U@V„²wVV@Vl@„VnwlIš@XbÆWVnUVmLUV„nm`k@VbnblKXUVIlxkb@VVLlK@bšwXxV@n¤ÆUVaÈaV_@anyVwV@„kl@°m@LnU„bl@„WVkV@Xa„a˜V„IXl‚IV‚„@XbVUÆ@XKWwUkmW@_UmnIlJXkWKXmV@‚w@_XV@Kl@kU@KlX@@UUUUKWLm@klJVUUmk@mXUWmXwƒ`m@„zUbÝakbW@m@UUƒéUIm@UbKǼ@™kKWXmWUkaWU—JWU¯L@W™Lƒwk@mm@_™ƒÅl™UVkmWUnV@VWLUb™bƑĬ¯l"],encodeOffsets:[[119543,33722]]}},{type:"Feature",id:"3402",properties:{name:"芜湖市",cp:[118.3557,31.0858],childNum:4},geometry:{type:"Polygon",coordinates:["@@„bVaV@XllLXU°ŽlL@V@VUnVl¯Ikš›VUVU@@b@lUXUWmb„n@¼šbƒĊ‚LÞ@lVXlmÞUnkJ@nlKVVšÞXklWVaVI@aUKn»lL@Kn@‚XXwlm@mn°@„V@Wy„wXlWVk™ƒ@aUaVU¯£kKWVXVWLUkkWlkkwmJUam@@aULVa@UƒVaUaVI@m‚@UUJUIUmmV@bm@UXVVUlVmImakKUU@UU@VmU@@kma@KVIXUVK@U™VmUkV™m±£@JkU@nlšk‚ƒLUlmb—@WbU@@XnlWb"],encodeOffsets:[[120814,31585]]}},{type:"Feature",id:"3406",properties:{name:"淮北市",cp:[116.6968,33.6896],childNum:3},geometry:{type:"MultiPolygon",coordinates:[["@@lnnK@¦n@@V‚V„@@VV@nIV„V@VW²a@b@bVnUVVV@V™z@lš@°UšV„IVaVV@x@ŽXX@WlwUnV@XblW„b@XlK@aš@kƒ@al@@_V@@WÅwmaUaV@„bnaVL@llInmU_@W@aƒUUĉUaVwm@XWK@wƒVkaVUUwU@@aV@@mlI@WœLWƒUUUƒVU@kV@XalKVaUƒVUUUk@WwUK@aVI@WƒUk@@UUU±xkb@lVš@xnLÇbUbk@@bÇVUJ±U@U—@WLXšml@bVVXL@lV@@LmbkLW`kbVxUn@LkxmV@bm@@VkV"],["@@VVVkV@¥@UV@U@VUUJƒkWakKUšlXVJ@bXV@blX@aXV@V"]],encodeOffsets:[[[119183,34594]],[[119836,35061]]]}},{type:"Feature",id:"3404",properties:{name:"淮南市",cp:[116.7847,32.7722],childNum:2},geometry:{type:"Polygon",coordinates:["@@°kƒīšaVaXK@U‚UVmnXUlšVÆkVKUUUmmU„ÑkU™UÝlĉKUƒwƒKƒbU@UxW@@lœmVUUVmUUƒmƒw—aW„kL¯K@Žm„ULWlIm`X„WL@b@¼@V@xkVƒI@b@l@lk„V°Ȯ¹ĸW"],encodeOffsets:[[119543,33722]]}},{type:"Feature",id:"3405",properties:{name:"马鞍山市",cp:[118.6304,31.5363],childNum:2},geometry:{type:"Polygon",coordinates:["@@šNJnllLnxV@laXLVKma„aXbVI„bVKVVVIVyn@n_ƒƒW@@ƒ„UnJlUVVXlLnaUWlV@VV„IXW@_W@XK@K@UVUUwVamÑXmmwƒw™KUnUK™çU@ƒJƒU¯@mŽ@nknWxWm@@LkKm¼VL@bUJUbkXWl"],encodeOffsets:[[121219,32288]]}},{type:"Feature",id:"3407",properties:{name:"铜陵市",cp:[117.9382,30.9375],childNum:3},geometry:{type:"MultiPolygon",coordinates:[["@@„ÒV¤@¼V²@aVV@Ž@„„x°Vš£nW‚@nbnaVXVW@k@aV@VUœUl™°JUkVm@U@UkK¯WVkKWkU@Ubƒakwmlwm@ƒkUmƒUUKU@@VmLUbVLUV¯U"],["@@LllUL@VlxšL@a@UƒwXamK"]],encodeOffsets:[[[120522,31529]],[[120094,31146]]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/ao_men_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"8200",properties:{name:"澳门",cp:[113.5715,22.1583],childNum:1},geometry:{type:"Polygon",coordinates:["@@HQFMDIDGBI@E@EEKEGCEIGGEKEMGSEU@CBEDAJAP@F@LBT@JCHMPOdADCFADAB@LFLDFFP@DAB@@AF@D@B@@FBD@FADHBBHAD@FAJ@JEDCJI`gFIJW"],encodeOffsets:[[116325,22699]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/bei_jing_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"110228",properties:{name:"密云县",cp:[117.0923,40.5121],childNum:1},geometry:{type:"Polygon",coordinates:["@@vIHZDZQtDLNMXIbHRCXXITbJ@H`LGPRDDJNCLHTOCWFGvGBUJMKGFO^IHWXITQCI’Y^AXGfRˆDXF`DJOLB~G\\DZIHHpErUVMhHb]\\M†BVF@FTP`@zTbD\\@~M\\K`H^EVODWICAakAQXoIcCOCIgGYNWFWNGGKKGaJEGMEIKYJUT_J_Go@_SyQaSFMEGTcYOQLIIi@EKAUPCV[EEXQCW|aMUMAaYCYNIDGGACIMGGSKDQGaF_C[GaB@GOIiOKAYL“mI@CN]F[SWWAcKKI@HMUimEKbeYQYISNUOcBKPIFBNgvDPGZYFSf]CMSIWGEUFgDIQ[MeDMJS@RR@LphFPCHaBAJKF@J]IBJO@HlO@@RKAMPJHCNDJTHFP@ZGNANBRFH@J_fM^ONJNF\\VTDJHDON@XRND\\XRCPVETCLBVKDFJINHRGPRV@\\CLJN@VbXbLVT"],encodeOffsets:[[119561,41684]]}},{type:"Feature",id:"110116",properties:{name:"怀柔区",cp:[116.6377,40.6219],childNum:1},geometry:{type:"Polygon",coordinates:["@@JHTVHXCHPfnDJGHNDJSB[JSBGVSAOH@PMPuDEHHXZN@PHF@ZLJ@LHVYJA\\OFWP]BMtMBSRGV[JeVAPQVIFENMD¡–@^NV\\JH@NNL@NM\\kTQ\\I^FNIpBHGTBFFAZQfKDIXQTLXFXNNVMVHRGpCFLlRLEVBBH`IVO\\G`RDPAXLXBXORHZEHTDLLN@VGTMrQNFPeASKG@GMOAKBYMK@GTUHUXSHMVDNMOUEOZMJML@^KRACMZEZMRQLUHE@OFENPR@DI\\ChMHIDG\\GJMDWHCKGMDCIQCHO_K@GaIJSWWQDaGWJMNCKRsCYGYuJUSaKaW@UIMDK@[QUHOGQJMEILCAUDKFSOUQD[WMC‚Q@WPMGCCIUSE[IMPMN]`e@IEGAQBMHM@YEOSGCIDMIGNOLB@QP@GkP@AI^J@ILEBIbADGEOog@KQQWSekWQQUOFKZLF@PUNmIaHIUeBCTSHENcJa@_IWSaGu`GLSBKJQFOXGDXVQVOBIHcDSJWBEFGTMH[^mLaXcHiKElTRKtFXZ`MHMPCNRDxZˆB\\ICIHK@KŽHbIVFZ@BPnGTGbDXRDJaZKRiGEFSFEJhjFNZFjn"],encodeOffsets:[[119314,41552]]}},{type:"Feature",id:"110111",properties:{name:"房山区",cp:[115.8453,39.7163],childNum:1},geometry:{type:"Polygon",coordinates:["@@h@bl@HRJDZ``TA\\VVD^H`\\pF\\JŒ`JGv@ZO\\GPSTEjPTR`FnEbDTDHEhLFMTK@ETSPULKEI@OVISKSJACEQNQbV˜IXGDIN@dMB[IIBcN]ZHNLP@XOWCFWŠCNRHTpATD@^NVNLED@Rh@jCEF}E[OOHUEW]W@QGGDIQSH_MmFmCUT_K]i@MHCMW—FCF‹E{BMHMPOHKS]CFNGBELDH_@BcAKOACESAOBELaXAROB@FODMEDWJAG[aE@UM@DImEWJMC@OeCA{aE[@{L@MINUCQXKfUJORCHqJBF@TCXWNQX]M[EAJO@@KMBQJIC]EWMCCUBEBFHKDOTMBGNGF]MWDBRDdMDQVyE@LPVHDCP@JVVMTG~HNSH[CmRUvHPHBbA\\PTNRC\\YNJ€PRARPJDDR"],encodeOffsets:[[118343,40770]]}},{type:"Feature",id:"110229",properties:{name:"延庆县",cp:[116.1543,40.5286],childNum:1},geometry:{type:"Polygon",coordinates:["@@^AXOPEB[ZIGU@KKI@YGE@OYMGWFGvCNO@OPGTBHUTA\\ITACIGMIHmCOeDGGWSUIGimYEEMgiFITEFEjHLQbYCIWQaCSHmHAOY@UEaJG@LGLDJ[J‡AwYQCDMNONGY_EWLsSQFkMO[NWAIGaIYL@HMBOKiOQDWEUDMQSF_QIUBWdg@[NaAKQ@M]OQ@WhgLUMMFYQDIRCEUZOOCIOJ[KIUMKL@HIDKVEBM`HJAJSJUdBLGNEdMBMO[BYEWJSNKNaD]PE\\SjOT_RQVEZPpƒNQXfŠNA~lNG`@PNLp¼RFLfbdKbATUh@FSNWjGFZVLFHVA~X¨PPROfFJbNJPLFbENJPrEFNPFRHDDJdENJLVEPBJTVTHGHFRFH@PXP\\ORQHW\\BjWFDERLPPBbB\\E`B\\D\\L`@F]FCnJ^AZL"],encodeOffsets:[[119262,41751]]}},{type:"Feature",id:"110109",properties:{name:"门头沟区",cp:[115.8,39.9957],childNum:1},geometry:{type:"Polygon",coordinates:["@@V@XMnGPY²‰JQNEhH\\AZMPDVTTDZCPiJkHSHCjIdFtEHITCNITQEKUAMCEIKCECABYESKFWAKBEIIHABGDCKCAIHMHALKEI\\CFIBILIJQZS]BBEECS@E@@C]COKI@CABAAEEDMGƒCH]A[M@CJWH—JaUMRFRBDTITLUJ@PFJKLOVST@FSLENgKGFSCaCmF_ESQiOSFOT[HYPu@IH‹_[IoE_[]GUC[USB__CYQI@Gakg@qZeHQNMNV\\FVLPgJAFJPRLCH[XcPELUT[JiV_EELFTADBXRTRLJC@fHXHHbPd`fR@NfT`@TLplHMpCEJHJBVLFŽ@JT‚VnG^KXDXHNVGRLRXFJVdDHSNWLGfEzA"],encodeOffsets:[[118635,41113]]}},{type:"Feature",id:"110114",properties:{name:"昌平区",cp:[116.1777,40.2134],childNum:1},geometry:{type:"Polygon",coordinates:["@@VNLJI\\JPPDYPFVQDCJZRNEVNhKXgR@^P@NLRbB\\Mh@XcVARJE`RTCNFV€XRCjPPLNA@GZKbJJHXB\\MNPjLdGbWnK\\]NGHSFEXATIdCJGPARUWUHCPWRELITAHKv_E@iYCaW_BQ\\Y@QIO@QDCIGZCEMWGFMFAFgHEDOCSqKCCFGAMKEAC@ODGCGs@WH@KQA@EE@CE@GEA@EH@GGUEEJEAYD@JM@@DAA@FHD@FTJEHUC@JUBKCKG@G[CIIQReAYhO@OXGDO@@FF@IHJFCPEBACBIAAKDOABXARHPNEHGbQAAKQFGIAM[C@WHKaGiCEGOA‹HUKCIokSCUSOCYN[BgGMFIR±ŠOZmHWNU@ShbbXDHVXXGJ^lZ@PZ\\Nb@\\FHJAD"],encodeOffsets:[[118750,41232]]}},{type:"Feature",id:"110115",properties:{name:"大兴区",cp:[116.4716,39.6352],childNum:1},geometry:{type:"Polygon",coordinates:["@@F\\E~DFN@BDFEpHFCHBBEGCDCJBHUDSBB@ELCPbF@B\\J@BJVAFJ\\ADKTCBGECFMT@BMN@@FH@DaNBEnvB@FPBATK@FHEFIAKFBFL@@PKBFJHC@FXBRAFCDMPDTOL@JIVFDHH@DDH@BGRFCDLD@N^@@CNA@KNOAEBCECFEGCFGMGFIPMOEJOLBADBBHGG@GCHIECY@INC@DMGS\\AIOZAAEYA@GT@KKMBEETCGMVINFxA@MJADB@FlA@HJA@NND@DFA@DVAZBBOFKH_JA@K^GBC@EFE„G@gAENMXKJigC@IbSJMqGOP£RGSMGE@kbQFDPEFiBSGGSBK]I{CDWCIDOic[C_G@SuSO@EWKCO@MNY@\\uZOPENQD[LKESSKGBKEG@EJGAGHoH¥CqhifeJkX_XFFGHFNEDFPENKHM^IFIVL^S`DVEnNnG`RTCJHH@R^XFXGVPP"],encodeOffsets:[[119042,40704]]}},{type:"Feature",id:"110113",properties:{name:"顺义区",cp:[116.7242,40.1619],childNum:1},geometry:{type:"Polygon",coordinates:["@@EhEBENXHFNYDJHCD@RJP@R[ZARX`DbjZF@bHXT`Jb@dIFMTGDSfAJVbGnJVM@OKELYPERVXRflXTT@NIfC\\NJRhCVEHFJXNT^DTeZEHYCOhuAMJELOdAVPTMOWBWNMNEJgl]@WGUFIC[T{EEDEHGCIGMI@SECUQI[D{A{GQESPUH]CsiMCmHUeoHENcAaDGCMDGMQCACCBaCGLMAHB@DIEQLOAAEEJ@CW@CDINGAAGKQOCgV@LG@BEGDKNeREFBNCFIDOPKD[@YRW@GFWDAFE@EHDDrLDTCPGF","@@KrJEH[\\B@FF@CHFBHUN‹AJKADGECBCMAG^E@EbI@BEGP"],encodeOffsets:[[119283,41084],[119377,41046]]}},{type:"Feature",id:"110117",properties:{name:"平谷区",cp:[117.1706,40.2052],childNum:1},geometry:{type:"Polygon",coordinates:["@@ZJZRafFLjn€VGNJ@LLBdXX\\T^EDMJ@”nZKLBjPPJ@HbA\\H`DbERHLCFK^BZaFWXQLAGMHa\\OLO@SBIpBdCLƒVQfElO@GSAKEDQTC@GEBKG@ORIJBDAPDFA@CaOq@GGQAAEJK@KMUGAAGEAa@MGMBGCGSIIW@WSUCMDOJeWOM@IUF{WMWaDIMgIoRoCOKeEOEAG_I[cg@wLIFENQFDVTFJ@HNDJGHCFFFS|D\\EJHV@Xk^IhMFMNAXPX"],encodeOffsets:[[119748,41190]]}},{type:"Feature",id:"110112",properties:{name:"通州区",cp:[116.7297,39.8131],childNum:1},geometry:{type:"Polygon",coordinates:["@@FDAJTGDNDCTDDEDBBE@DT@@EHCDGJ@EIZ@@FDBR@ATFBBVFFE@@HNA\\VE@CLIFNJFNJBCP]A@LJFA@HJEDD\\C@DBCHLAEPF@@DH@APHAERDF\\GIxDTM@CFLBBFJ@CNUPMHECGDBF]BMFPDLRBHHBJMDCX@@DFIBFPBRKJF@CGANBHKbDDABDRDHNNCHDbCdBFMpGHiOYMefKJMC}HWAUNW\\NNBNA„kNU|]HMTMN@MZBLFFF@RIRUT‘BMFIEGaAGGAOIIUGTSFcYKS@MSLYPKRUBU]EWDOI]CKGASgW@MTWKIMCS@uMAKKADMECGAKVUTSDy@IjWLMNBF@hƒHEF@FAD]H@LIBG`ELAPYAUB@CEB@CMC@MIB@GkB@ECAIB@NwBMEUJHNSDFFNALLS@@HZBBFYBJP[BHTCND@JMZ@FDGJHDH@GHAABCKAIPPFONEJNHEHHDEFFDADBFMP@L"],encodeOffsets:[[119329,40782]]}},{type:"Feature",id:"110105",properties:{name:"朝阳区",cp:[116.4977,39.949],childNum:2},geometry:{type:"MultiPolygon",coordinates:[["@@bFGHBHFBFIVFHHG@@FFB@HDFF@@FRB@LXGt@DHCH@PBDLFBNF@BEXCHEX@ZQ\\@LCPOJCDEAMFEfQLMHCAFH@@KhUNE^AAEHCFDNGVODMI@AEKADEN@CSJw[HCEFQGBBOG@@CE@FOKBDGCAD@C[FCGIB@IE@K^BDOIAEMMIJEDKF@[UMB@GF@EEAUEABSQ@CA@EY@FJI@CHGD@FS@@CAFCACFSCCDCMSHBIECMB@D]@@MKCDCQEAHG@CCG@CGUEIJK@SPOCCNEDQBDNDB@DJCDLFCBBALJB@BVGPBKVO@KHCCCD@FE@BNA@FNCTDDJA@FGB@NBDW@CL@hT@@ZHHQDDDAFSAANBC@HG@EFS@@DE@@PCB@Ue@CADNJB@FCBWA@LI^ix@FIHrH"],["@@HUN‹AJKADGECBCMAG^E@EbI@BEGPKrJEH[\\B@FF@CHFB"]],encodeOffsets:[[[119169,40992]],[[119398,41063]]]}},{type:"Feature",id:"110108",properties:{name:"海淀区",cp:[116.2202,40.0239],childNum:1},geometry:{type:"Polygon",coordinates:["@@plDJVLŒGPBFHjDbHGL@X\\DBNHJREBLRBHaFGŽMGOBQAWPBLCBBAJBDFADOIEJGE@@EP@HCPWP@ZgfBRQJJ\\D@HLHLDVA@IVDFGSI@EGC@EBB@CN@@IZCAGHGaEqGJG@EjwJ]@K@GSA@e_I@NE@CA@Kg@KC@ENCFƒAKQAW@WIMK@V‹@I@@F@^EDFB@HcIaDYCBRRDCHD@EFLN@FE@CJUPEJOJMTBPEDIFCMIAKNOGMRFJNDVBFLSRMJSDGJsFcEiJGDGTIlOjYD"],encodeOffsets:[[118834,41050]]}},{type:"Feature",id:"110106",properties:{name:"丰台区",cp:[116.2683,39.8309],childNum:1},geometry:{type:"Polygon",coordinates:["@@hMN@NFTQCFRCBJFA@HJ@@HJ@HJ\\FTACDŒ@@UNLXJX@@MA@@IECAQlDFEHBDI~D@GXCFMVDFCH@@NF@ANJC@FnAB@AMF@@EDCDDLGP@LUOAUH@AIABKAAEDCKID@CCACMWA@EGDEILA@OK@AELEJBFEEGL@BSOA@EuAFmMACbG@@EM@ANS@ENFDAHSDCL[BEIUBAII@A[E@OaKD@FAACTGVIACDHDAFGAEDoGEFACM@i€g@@QFCMKMU@]SCoBGSMQ‰DEXXDWPO@MKYGM^AdJJA\\cNB\\G^„DNHFCBFABDBJ@PL^D@DF@T@FDAF^A"],encodeOffsets:[[118958,40846]]}},{type:"Feature",id:"110107",properties:{name:"石景山区",cp:[116.1887,39.9346],childNum:1},geometry:{type:"Polygon",coordinates:["@@NQPHLMJBDNJEFCAONSPIFIVODIF@@EKMFEC@DGQCAQZDbCdJ@GEAFC@]@EJ@DCSB[EGII@@GI@@GEBAIQDDESRMEM@gNYTIRKJAJEJ[DFJKLGBGNBJLDCDAHGBJJAFBLEXTLZFBAFDLD"],encodeOffsets:[[118940,40953]]}},{type:"Feature",id:"110102",properties:{name:"西城区",cp:[116.3631,39.9353],childNum:1},geometry:{type:"Polygon",coordinates:["@@XBDA@EIACM@IJAD]BC@SFABISAD]H@@OAEDQEW@BLE„MD@FLDh@@LDBF@@M`J@fTB@H"],encodeOffsets:[[119175,40932]]}},{type:"Feature",id:"110101",properties:{name:"东城区",cp:[116.418,39.9367],childNum:1},geometry:{type:"Polygon",coordinates:["@@DBf@@VDA@OF@@CT@FEH@@GADBMTBBECCRCGG@YS@@gDK@A‘C@PG@C^TBAJEB@TADC^IB@J"],encodeOffsets:[[119182,40921]]}},{type:"Feature",id:"110104",properties:{name:"宣武区",cp:[116.3603,39.8852],childNum:1},geometry:{type:"Polygon",coordinates:["@@RBX@RFFCŽBFU@aK@WA}CCJGAEFkCBRFD@JB@@N"],encodeOffsets:[[119118,40855]]}},{type:"Feature",id:"110103",properties:{name:"崇文区",cp:[116.4166,39.8811],childNum:1},geometry:{type:"Polygon",coordinates:["@@XBL@@bEV’D@BX@AC@MHA@EIBCCDSEMmB@EIDBME@@MG@EDUCENWD@H"],encodeOffsets:[[119175,40829]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/china_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"xin_jiang",properties:{name:"新疆",cp:[84.9023,41.748],childNum:18},geometry:{type:"Polygon",coordinates:["@@@›ρȁôƧƦóəʵסʵóƪԫʵѵͩƧͩړ›υࡓɛʵ@ȃ@óᇑѵƨɝɚôóНѺͩɜ̏ԭʵôƧɞñ@υƩ—݇ȂóƩƧ@ѵȂυœƥŌਗ—॥ɛóʵѵƧѹ˜݇̍ࢯ˜əɞυ˜ρͩ̏óਙƨƧŋôōóš̍ͩóʵן›óŋړͪƧѶ@ɜԭ—ԫƦɛȄ̍›ɝȄöςƩȂ̏œñȀ̏œƩóóŎə˜@Ő̎@ɞȀɝŎôƨóנѵȄƧ@óŏɝœóɜôŎ̍ͨςŎ@ƨóôƨɞ݈ʶóƨφó̎Ȁƨ̍ԮòѸԮמ@ѺȀ@ƪၬֆòȂñ̐òȂɜ˜óƨ̒Ŏ̑߼@φρȀ@Ő๐ς̎Ƨφ@ɝφڔ೦Ԯǿࢰ@ƦŏԮƨƨȄƧ۬ɜʶڔŐɚɚóŐôƨ߼˜ôƧƧó̐ƥóŏѺǿƦȁφƧς˜ƨƧ̒@ɜƥƦυ̐ɛƪͩƩəƪʷ̑ə@ȃƨʵנŋྸōਚԭԪ—@ɝƨŋ̒օςʵôƧ"],encodeOffsets:[[98730,43786]]}},{type:"Feature",id:"xi_zang",properties:{name:"西藏",cp:[88.7695,31.6846],childNum:7},geometry:{type:"Polygon",coordinates:["@@ôŌנœôʶ̎ͪô™óŎƨŌਚƧ̐ôςͪφ—ɚɝࢰ—݈̎Ѻ—Ѷƨôʶ०ɜਘ˜Ʀŋφ›Ѷȁ̍—ôŏɚŋ@̑ə—@ŏò̍ɜ›óƥôʷƧ̍φѹԪ̍ע@Ѹʷɜ@ôñנ@Ѷɛɞô̐ŏѶƨѸƧƥōƦœôŏô—@ƧôƩ̒ŋƨŌƦǿô̎ɜȁ̒—óʶѶôôО̒›ςƥɜНφσɛȁ̎υƨఱƧŏ@ʵƥœ@ŌóóóͩƨƧóŋ̑õóɞóɝԩͪɝρôƧ̍ƧѹͨڑŎ̑ōóƧࢭͩ̏ѵɝóఱóóԪυô@̒ƥŌ̏Ƨ̑Ȅ݇ŎƧ›ѵӏ@ɛõŏɛȄôӒƧŌѵǿɝ˜Ƨŋԫ@̏ʴƥ@óǿ̑Ȁóǿ̍ςóóυô@ʶɛñρƦƩŐó̎óœѵó̑ͪࢯОóɜן˜Ƨ̏ƥȄ߻̎̏̐ןŎɝɜöɞƩȀôöɛȀóͪ̐ƨƪ̍̎ȂƥԪυО@φɞ˜ôƪ"],encodeOffsets:[[80911,35146]]}},{type:"Feature",id:"nei_meng_gu",properties:{name:"内蒙古",cp:[117.5977,44.3408],childNum:12},geometry:{type:"Polygon",coordinates:["@@ኊȁ૊ö߼ƩɜɛנñԮɛѶóԮô@ȁѸóמ̎ගѺၬ@߼ʶԮӒ߼̎@ŐѹӒ̒Ԫƨöග̑ѶȄ̒ς।œѶɚöɞɜʴڔôôȂ̎—ѺȀς—ƨ˜ƪóԪ—ɜôɛОਕڔԭ˜ѵ̍ѹȂԫ›ɛƥ̍Ȃóɜ̎ô@ʶ݊ੲࢮʵږͪנƨôȂƧ˜̐ͪ@ŐƦƨφԬѶɜôƦ@ŐƧôôƦəŐ̏›@ŐڒѶԬô̐ʳԩНςōôŏɞ@ƨȂѶəóƧ̒ػ̎ó̐Őנóƨô̒@ƨɚɚ@עԫɛɛ@ȁυͩƥʳòևρ—̑ࡗƧͪ༃ॣԮփ̎Ʀ@ôô@ôō@š@ȁѵóƨ̍υȃóʵɛƨƥóυȂóəƪ›̐ρƧͩɜԭڔȄ̎عƧȁ̐ŏó̍ɛ›ƥƧ̑óρŐ@Ƨ̏˜ɝəɛ˜߻ͩ̍ͩɝО̍ƪƧóóӓƨóƧʳ݇@ɝςƪœ@ʴƩ—ƧƦôƨɛȄə›Ƨŋυ›óͩѵ@ɝǿóŌן̍ɛ˜óО̍œ̑̏ôȁ̍ŏòȁñóƦͩ@ǿə@ɛƧ̑˜ρȁυô̍օѹœóȃə™@ȂσʵѷƪòƩ̍—ôó߻ۯôʳƧ™óšõʵѵóѹɜ̍ȂѹôɛŌφֈƩͨρóυӑóޟఱ̑݇ͪóƪƨŌóȄڔԬƩςםñ̑ȃѵŐԭŏƨȁɛǿρôõɚɛóƧОə@ѹ̐ѵöԪͨôͪɛ̒ןŏƧƥóôƥƧɛŌôóɝó@̒݇Ӓ̒Ō@Ŏԭࢰ"],encodeOffsets:[[99540,43830]]}},{type:"Feature",id:"qing_hai",properties:{name:"青海",cp:[96.2402,35.4199],childNum:8},geometry:{type:"Polygon",coordinates:["@@ƨ@ôƪ݈ȁƪ˜@φɝòóƨԮʶɛ̐ѹͪôОəóƧɞᇒѶ@ôږô@ǿѶ›ƪȁςœɜͩφ˜ςŋɞôѶɛƨŌɞ—@ɚςŐñԪॢͩƨȂɞóƨŐ̎ŏעӏ̎óƧƦôœ̒ȁɜ›ςͩ̒œɚɛƨôƨɝφɛóȁƨŋóóɚͩƨóóƩ@ƧəŋƦƩ̍@ƧƧôǿυ̑@ȁɞǿõŏρƥסɚƧóτԫɞœôƧƦ@ñȃòñƥóυôôѹѵ—@ŏ̏Ȅɝó@ȂəŌóəѹƦ@Ő̍Ōυ݈ԩŐƧóôƧ̑›ôʵɞƧ̑ѵôƩɞƧ̑œóНѵóôʵ̑˜ɛȂó̍ƥȀƧŋ̑Ōóƪ@ƨó˜óŐƥ›ƦŎѷƨѵƧ̏Őɝóѵɜן@óòɛ@ѷʸס@ԩ̎υѺƨ̎óʸôƦɛœñ̎@Őɚ˜@̒əŌóŐ̎˜"],encodeOffsets:[[91890,36945]]}},{type:"Feature",id:"si_chuan",properties:{name:"四川",cp:[102.9199,30.1904],childNum:21},geometry:{type:"Polygon",coordinates:["@@ô˜ôŋó̑Ԯ̒ɛОמͪƨōöͫ߼ƥôȃƨóóñôƧóƧôōڔŏƨŐ@Ŏô˜òƥѺŎ@ōɜóנ˜ôǿô›ƦôԮ̍ɜôɚ›Ƨ—ñɛɚȁ̍Ƨɛևυ@óóôŋρԭɝ@Ƨʸ̍ŏυɜƧƧóƧƨȁρ̍ƨȃɚ—ôʵφóô̑̏Ȃ̑ʵɜʵɞ@ƨʳסƩóŎə—óɜƧôƩƧρ˜óôôô@ŎƧƨƨƪѹ˜ó̍̍Ʃ@̏ѹНôޟ̍Ʃóƪυɝɛ—əƨôŎɛȀ@Ȃ@ñɝʶ@Ōρנ̏—õóɛͨƨȂѵОɛʵ@̏ƩŐó߼Ƨల̍φɜȂυτɛОρƦɝƨóƪ̒Ѷɝƨóʶ̒œóƨƨôԪŏφ݇̎ŋ@ŏѺƥôɚɚŋ@ȁɞô̐ȃ@ŐѶ˜óѺφóƦôñòòȄ"],encodeOffsets:[[104220,34336]]}},{type:"Feature",id:"hei_long_jiang",properties:{name:"黑龙江",cp:[128.1445,48.5156],childNum:13},geometry:{type:"Polygon",coordinates:["@@ᇔȂਚНƨŐѶŏöƥςŏñƧƦóƨȁ@óƨ—óȁφӑóóƨ˜óǿ̎̑ôНɞ—ó̑ɜə߼›̎ǿ̒ôڒӑφ@Ƨȁ̎̏ƥƩ̎ρశ˜ôȂςƨφ@נɞ݈˜̑ƥƧɛƨʵƧȃƥ@Ƨƥ@ŏ̑ԩôɝρρóɛƧ›ƩͩƧó߻ʸ̍ʷѹƥɞڕõ̍öɝυ—̍ȂƧ̐̑ŏóƨñŋѹóóȁ̍›̏Ԭõʸ̏ŏ@ǿ̍@ƧОυ@ñƨòȀƥŎ̑ŐѵóɛŌóȂԫōƧŎѹñ̍ʶóОן@Ƨ̎Ѷô@Ȃ@™óŎó@@ó̍ƥԭք༄।ƨͩ̒ࡘς˜ñֈƦʴφͪ@ȂɜɜסԬə@Ƨə̑@Ƨóןô̏ŏ̍ô̑ؼôƨѵɚƧȁɝ@óŐρŎԪО̏ʴ"],encodeOffsets:[[124380,54630]]}},{type:"Feature",id:"gan_su",properties:{name:"甘肃",cp:[95.7129,40.166],childNum:14},geometry:{type:"Polygon",coordinates:["@@ڔôԮࢯ@ō̑ŋ݈ӑ@̑ɞôóôɜŋƦƨôóƨƦנŐɜ̑óͩԩͧѶõѺ̏ɚ@ƨНɜôöəςóɜȀƧȂԮŐѶŏ̒ȄמòƪρړԫôȃƧŋôƩ݈ͩɚ@@ǿɜ@φͩóŏɜӑƧōôǿ̎›ôƥƪóõ›ö@ô—ƨ˜ôƧƦôó̒ɜ@ɞŌõʶ̏Ő@ȀóôƨȂ@ʶע@@ƥ୾ӑó̑óŋôʵóɛړ@@ƩöóƩóρ—ɛƨ̑@óʷƥƥ̎ɛƧ›ôōƧǿôͩѵôɝȃɞȁõƧρóó—@ōƧŏړŐóŎôƨóƨôòƧôóȄ߻ƦõͬƧŎםͩɜНԭ̑ô̒óŌó—ƥ@óƨɝ›σԬƨôעəςƦöŐɝȀ@Ȃφ̒óȀƨƨ̎@ƥƪɚŌ@ƨôƪƧôəͪôôƧŌôȂυɜƧɞƧóəɜ̑›ρͪɛœ̑Ȃó›ƨƥ̍ôסӐ̍ŐƧŏɝôƧȁॡͪòԩρŏ@əɝ˜ƧŋѵɜɝóρŌυ—ɛͪρ›ƩȂѵœ@Ȁڕó@ȄɜʶφࡔڔœƨͪѶͪԬʶôƩעʶɚʶƥôóƨςȂ"],encodeOffsets:[[98730,43740]]}},{type:"Feature",id:"yun_nan",properties:{name:"云南",cp:[101.8652,25.1807],childNum:16},geometry:{type:"Polygon",coordinates:["@@ôɞôɝ̒öôŌƧƨôͪôô@ŋƦ›@ʶƨŐô߻ƪŏ@̐ɜʶѶНƧȁɜͧöô̐˜ςן@ŋɞʵ@ò@ȁɜǿóōɚƧɜ˜φɞôƩ̎ƪóޠѺО@̐̎ƪô̎Ѻ—ƧƩƨƧ@ōóóôóς—ƪƨƨóôɛó̑ԭ—ƥŌɛǿɝƨɛͩô›@ǿƨȁѺŌɚɛ̍ןѶНɛƧôóƥȁƦͩôŎɞ—ƨ̑ɜ—òôφ@ƨʵ@ɛѹōóȃəƨυǿóʵρƧƧŌƩɛ̏ȄñƧƧȀɝ̍ԩʶƧ̑υ—óŌƥʳɚӑóНƥô̑›óӒѵʵѹœƧӐןôƪφõŌƪ̒ԫŌƧؼƨƨס›ρȁƧœƨȂóʶó@@ʴƨôôφ̎Ŏ@Ȁƨ—ƪɚƨœóƨôôôςóޤƧŌƩŋƧԪ"],encodeOffsets:[[100530,28800]]}},{type:"Feature",id:"guang_xi",properties:{name:"广西",cp:[108.2813,23.6426],childNum:14},geometry:{type:"Polygon",coordinates:["@@ƦŋѺ̎ڔʵƨŐ@ƦמȄƪôóȂɜŌɚͩɜ@öóɜôôȂƦôɜȁ@ɞφ›óȄ̎›ƨʶɞŋƨʴɚǿ̐̎Ԭ@ôñ@̏ƨ›ρ۫ô›ɚƨƨНƪŐ̎›ƥóƦʵƥŋ@ȃóƥƧ@@ŏɝǿôυƧȁѵɛ@əóŏ̑@@ə̍›óƧó—@ȁƩ˜ρóòНƥô@Ӓ̑@óŎ̍ƥσŎυ@̍ƨ@Ō̑ôóͪƨ̒óŌړœ̏Ŏ@ŌôȄѺŎ@ɜƧʶυ@ñóɛ˜Ƨ̒ɝ˜óōƥͪ"],encodeOffsets:[[107011,25335]]}},{type:"Feature",id:"hu_nan",properties:{name:"湖南",cp:[111.5332,27.3779],childNum:14},geometry:{type:"Polygon",coordinates:["@@@քɜОƨ@öŐמóƪôƩɚ̒Ő߼ȁςͩɜòƪ—ɜȀò—ñɝò—Ѻͪ@ŏƨŋóɝôǿƨ™ɚȃóəƨȃѵͩó̍@ȃƨóóƥƨƧ@ʵƦ›óͩɜ—ɛóñԭɛōυȂ̍ƧƦō@ɛƥ—ɛȀ̑œóʷóō̍œƩŏƧОəƧóœς۬Ƨœ@̐óòԫ@̏̍əȀƧʳɝŌóɞƧ˜ƨɜóŐƨò@ȄƧŌρŋóôԪОóʶ@̎óȄ"],encodeOffsets:[[111870,29161]]}},{type:"Feature",id:"shan_xi_1",properties:{name:"陕西",cp:[109.5996,35.6396],childNum:10},geometry:{type:"Polygon",coordinates:["@@ςôöƨɝȂɞȄѶóóͪƨȀóŎƨœ̍ɜƦƦôʸ̒@ɜƧς˜ƪôõô@ƪڔ@ôɜóʶôŌô̒୽Ӓ@Ʀ@Ѻ̎ɜѺɛѶôöʶô™ƨšóʴ߼۰óô̎˜ñƪѸƩτʶ@ȁòŋəѹóǿ̑ʵ@ȁ̒ʷυփô݉ôН̏ط@ȁƨóô̏ƪõ@ʳ̐ʵ@ɝɛŋƩŌɛóןôƧŋ̒ó@ŏ̐ƥ@ŏυ@ƧƧôן̏@ƥȂѹɜəœɛóԭ̎ƥóóœóȀן—ɛô@ŎѹōñƦ"],encodeOffsets:[[108001,33705]]}},{type:"Feature",id:"guang_dong",properties:{name:"广东",cp:[113.4668,22.8076],childNum:21},geometry:{type:"Polygon",coordinates:["@@@Ȃô˜ôƨ̎œ@ɚ̒@ôŐ@ɚѶɜƨȂóφɞȀ@Őƨ@ôƦ@ȄƦŌƥʶƦôôŎôʸ̒›ɜǿƦ˜@ɜƥŎ̎ƨφȁɜŎòƥԮŎƨōóŏɛƧɝəɞƧ߼ɜςȃñȄƦŎ̒ōôòƨəƨ˜ɚН@əƨ̏ƪʵυŌəɛóəԭŏəœóŏѹœρʵɝƦ̏™ƥʳѶ›öō̑óóŋρȀυƧƥɛѹōƧôן—ɛŏѵ@óŋôʵɝ›ƪԩõ@Ƨō̍@Ƨ@@ƦɝԮƪО@@","@@X¯aWĀ„@l"],encodeOffsets:[[112411,21916],[116325,22697]]}},{type:"Feature",id:"ji_lin",properties:{name:"吉林",cp:[126.4746,43.5938],childNum:9},geometry:{type:"Polygon",coordinates:["@@נ@ôН̎ʵѺòƨōԬŎôȁɜŋѶô̒ŏƦōñǿòƧφ@ƨН̎@@Ȁ̐Őöʷ̐ԫ̎œôȂѺôòŌôƧ̒Őƨ̏̎ȁφ˜@ŋƩͩםȃƨ—@ȁ̑ʶ@Ōóôɛœƥѹ̑—συ݇@ɜρƧȃࢯƨôœəȂɛōƩɛ̏υρóõœƪʴυφ@ʶôŌóœρք@ɜƧ@ɝǿƧͪρȀƩó̏ŐƨȂ̍غړȃɛԮƨͪ̏ςƩœôɚφȁƦôɜƧôʶφȄ"],encodeOffsets:[[126181,47341]]}},{type:"Feature",id:"he_bei",properties:{name:"河北",cp:[115.4004,37.9688],childNum:11},geometry:{type:"MultiPolygon",coordinates:[["@@Ʃ̒̏ŌѺ̒Ʃ˜óȄƧŌƥͪòôñȂ̎ŐóȂ̒̐̎›ôНɜ—נ̎ôŋɞȀѶ@ôͪφœƨŌɚœɜȃóƧƨƥƪ˜@ʳƩ›ɞρ݈@υНφʵɜ˜ƦρƨƧ̍ɝóɛѹ̍ρŏ̑ôóƨ@œƧƦôƨɛ@ƥƨ@ȂƦ@@ôəŐƧʶƨŌυœ̍̎ɛŋôōɝ@óƧ̍›ƦʵѵʳôʵɜŏςôƪŋƨŌɚ@ôНƥƧ@ōѸɛ̐ô̎ʵѵНԭ@̍̍Ƨò@ȁɝ@əρυͩƪ̏ƩõƧŎƧōóšॡȄɛʶɜȀ@ɞςѶƧœƥςɛŐ@ɚɜɜ@Ŏôôςœƪς"],["@@õə@Ƨɛ˜@ŐóƦφô"]],encodeOffsets:[[[117271,40455]],[[120061,41040]]]}},{type:"Feature",id:"hu_bei",properties:{name:"湖北",cp:[112.2363,31.1572],childNum:17},geometry:{type:"Polygon",coordinates:["@@ñȄυƦöŐƩ˜óנƨƨφ@@Ő̏Ʀ@Ő̑ôƨŌנóɜôƪŋɜŌѶօڔə݈òɞōɜŎôӏƦóƨô̒óôȃƨó̎ŐôƧƪ@ƨȁςƧə̑̎Н@̍Ƨŏρôԭͩԫ—̍ʵƧšóȀôɞƧŌ@Őѹͩñ˜òɞñ˜ɛǿƩ˜ɛñρͪ߻Ȃ̑ŏƪəƩóםôõŏƧ@ɛНƥȄó›̑ѺƧ›ôφóƨƨƦƪóɜŐôóòôƨóφ̐ƨóƦ̎"],encodeOffsets:[[112860,31905]]}},{type:"Feature",id:"gui_zhou",properties:{name:"贵州",cp:[106.6113,26.9385],childNum:9},geometry:{type:"Polygon",coordinates:["@@ɜȀƦŋԮ˜ô̒ɚ˜ôōעƪƧʴɝ@ɛʶ̒ʶ̐ȁƦœóȂô@ôŏ@ōô—ƨʶѸô@ʶƨ˜ɞó@ōτöòυƨ@@əƨô@ɛ̒@Ʀɜôȃ@̍ôʵԩНôóςŌƨŋ@ȃƧñôŏƧɛƨ—ôɝƧʵ̍œôȃυœ@ɝɛȂƥóóȁɛóõôɛ@əͪɛŋôȁƩóםȃ@ƥƧŏړʶѹ̍ƥŌƦȂóôɜƨѵО̎נəɜѹŋƧȂ@ȀóœɜͪɞƧ"],encodeOffsets:[[106651,27901]]}},{type:"Feature",id:"shan_dong",properties:{name:"山东",cp:[118.7402,36.4307],childNum:17},geometry:{type:"Polygon",coordinates:["@@Ʃ̐φͪɚςɞ@@Ȃƨñ̎̎Ԯ@ѶОƨƧڔ@φН̑ŋ@Ʃ̒ǿ̎@ƨɜԬςôʶ̐ʶöԫƨƧנƥɜŎôō̎@ôŏóρƧŏԫôóƧԩó@ƥɜƧԭóƨʵɛƨ߻ӑɜНԩ˜óô̑óƧʳə™óɛƧ@õȀƧœ̍ȃɛŐóŏυО̍—óɝƩ—ԩ@ƧɚԫȄɚʶƨ˜ɞʶԪ̐ړɛƪ̒"],encodeOffsets:[[118261,37036]]}},{type:"Feature",id:"jiang_xi",properties:{name:"江西",cp:[116.0156,27.29],childNum:11},geometry:{type:"Polygon",coordinates:["@@ƧȄôɚəȄ̎ʶԬ˜ԮͪςóƨŐƪ›τɞƦōƥƧ@ŏςôóŐôô̒ʷѶ—ƪƩƩǿ@ō̒ɛôυ@—Ƨȁѹɛəƨѹ̑ƨ̏óƥѵʷô̍ɛȁôŏɝǿƧԫƧ›ôʳƥōòȃρȄ߻ɛɝƨɞɚɜƨôŐƧŎԭōñƦòԮɜôɛ˜ôͪƥœ@ʶƧƨôƦƧô@Ȅô̎Ѷͪ"],encodeOffsets:[[117e3,29025]]}},{type:"Feature",id:"he_nan",properties:{name:"河南",cp:[113.4668,33.8818],childNum:17},geometry:{type:"Polygon",coordinates:["@@φ˜̎ƪ̐˜ɞȄɚ@@Ȃעó̎ŌѺ̒ôֆॢȃô™ƨŎƨōƪöƩ̑ڔɜԩ̏ɝʵƧ—əʵԬȃƨəԪ@@Ƨ̒ŏô̍υȁƧɚ̍ôóŋ@ɝƧŋõ̑σ—@ŏɜŋôɝ̒ƧɚôôطρóóɛƩ@óƨ̍ŏƧôóȄ̑ôƧóƥôóӐɛōɝŎ݇ñړɚѵֆ@ɞ̏ʶ@ʴƩöó̐"],encodeOffsets:[[113040,35416]]}},{type:"Feature",id:"liao_ning",properties:{name:"辽宁",cp:[122.3438,41.0889],childNum:14},geometry:{type:"Polygon",coordinates:["@@ƨʴƧôôӔƨô̎ƩɞН̎ͪ߼ͪɜ—ɞɚ̐—@ƨςŏ̒ôƦƨɜœô̎ƪôςǿƨͩɞȀƨ@@ɛςփô›óŋ@ʵφυƩʳö›॥փρѹס@əɛ@ͩࢯ@ѹʵρ—ƩʶφȀƧ݈̒۬óʸɝŎѵ@ԭԫןɛƧƨƥςɛ—υʶφО"],encodeOffsets:[[122131,42301]]}},{type:"Feature",id:"shan_xi_2",properties:{name:"山西",cp:[112.4121,37.6611],childNum:11},geometry:{type:"Polygon",coordinates:["@@ɚѺñŌɚšôȄѺ›̎ֆφóςȂ̒—ɜƨɚ@@Ȁƨŋôȃƪ—ѹ̑̐ŋƪ̑Ʃρρ›óó@ōɛɛ@əɜŏƦρƨ›ρѵ@ɝɛǿɜʵóօѹ̑̍ŋסô@ȁə@ɝȃ̏—̍Ʃυ—Ƨô@Ȃ̐ظóОó݊φք̑ʸ@Ȃ̒ʶôȀ"],encodeOffsets:[[113581,39645]]}},{type:"Feature",id:"an_hui",properties:{name:"安徽",cp:[117.2461,32.0361],childNum:17},geometry:{type:"Polygon",coordinates:["@@ó̎̑Ő@ƨƪ˜Ѷǿɜ̑φ—Ʀʵ̐˜Ƨѵôóƪôôυς—ƨȂɞŏ@̍ԫôò̑ƥ—óȃѶͩƧƥôŏѺœôŏƦ—@›ƥͩƧ—ôȁυó@̑ƧɛѵʵƩƪѵ˜̑ʸóóôŏρó@ŐƦƨƥŎσɝƩœ@̎̍Оɚ̒ρƨƧȂôɜςôóظəó̑ƨóɞɛŌ@Őτ˜ö̒ƨŌ@ɞôŌ̎óƨəφȂ"],encodeOffsets:[[119431,34741]]}},{type:"Feature",id:"fu_jian",properties:{name:"福建",cp:[118.3008,25.9277],childNum:9},geometry:{type:"Polygon",coordinates:["@@̎›óȁƨӑ̒—̎ɚƨͩφŐƨɝ̎ŋóŏρ—@ōƨ›òʳəóƨō̏˜õɛƧ@ƨѵƧōəŏóŋƧô̑ɝɛʳƥ@@óɛõ@Ƨ̑ƧóȁəƧ̑—Ƨ̐@ɚəОƧ—Ƨɚóñ̑ŎóʴƨœƨԬɞȀóŐɜȂó̎ѶʸôƦƧ̐Ѻ̒ɚƧѺɜƨȂ"],encodeOffsets:[[121321,28981]]}},{type:"Feature",id:"zhe_jiang",properties:{name:"浙江",cp:[120.498,29.0918],childNum:11},geometry:{type:"Polygon",coordinates:["@@Ѷʶƨɜ@̒φôóȂƨ˜Ʀͪ@œ̐˜Ѹ̍τȂ̒̑נŐמôƪƧôӑ̑›@ƥρͩƨօ̏@@υɝó@ŋɛ@ôƩəóƧѵυó@ƩɜŋƧ@̍ŌƧɞυŏƧͪ̍ə̑˜ƧӒôȂ̍œ@˜óφ̑ɜ@ŎƪȀ"],encodeOffsets:[[121051,30105]]}},{type:"Feature",id:"jiang_su",properties:{name:"江苏",cp:[120.0586,32.915],childNum:13},geometry:{type:"Polygon",coordinates:["@@ôɞ̎˜φНôŐɜŏ̎Ȅƨ›öǿƨ@ôɜɚšƨʴ̒ôôó@Ƨ̎əԮȃԪૉöͩ̐ƧòʵφƧôʵ@óړɜóŏɜǿƧ›ɝρσȁѷ̎̏—ƥ˜óŐѹ›óŐƨƦѵͪôȄƦ˜ñ̒Ԭó@̎ɝŐƧȁρ˜óφƩóóôƨѶ̏—ƥʶυ˜ɛ̒ѵȀ"],encodeOffsets:[[119161,35460]]}},{type:"Feature",id:"chong_qing",properties:{name:"重庆",cp:[107.7539,30.1904],childNum:40},geometry:{type:"Polygon",coordinates:["@@əȂòɜƨ˜ѺɛƦȁ̐@ƪ—õŏφƥòȃƥ̍Ƨôυ̏ƧôñóóôɛŏƩôƧƥôƧóυƨœ̒ѹôœƦȃ@փƥɛ̑@@ɜƧó@ɚƧ@ñφσõ@ŎɝôƧ—@ʵѷóƧʵó˜@ŎóŐó@ôȁƥ›ó̒υôóʶə˜ƧȄς̎ƧȂôƨƨƨφɛ̎Őƨʷɞ@ςԮóŌôôφ@ɜֈ̎ƨ"],encodeOffsets:[[111150,32446]]}},{type:"Feature",id:"ning_xia",properties:{name:"宁夏",cp:[105.9961,37.3096],childNum:5},geometry:{type:"Polygon",coordinates:["@@ల̒ôޠφӒςôƪͧυևɜŋѺó̎ȁ̍ɛ@ѹס@@ʵƧȁôó@ǿ̐ŏöʵɝŋɛ@ô̑ƥóóƨƧ—ó˜ôœó@ƩôóƦ̍œóȀƨŎɛӒôŐυͪɛ@@Ȁə@"],encodeOffsets:[[106831,38340]]}},{type:"Feature",id:"hai_nan",properties:{name:"海南",cp:[109.9512,19.2041],childNum:18},geometry:{type:"Polygon",coordinates:["@@φɜƦʶ̐ôφô̎@ƨŎö@τʵƦ˜ԩ۫õН̏óƥȃƧ@Ʃəםƨ̑Ʀ@ޤ"],encodeOffsets:[[111240,19846]]}},{type:"Feature",id:"tai_wan",properties:{name:"台湾",cp:[121.0254,23.5986],childNum:1},geometry:{type:"Polygon",coordinates:["@@ô—ƩɝöƧɝѵəޣ̏ρƩԭóōóͪρɞƧОôԪ݈ଦѶɜ̒ɛ"],encodeOffsets:[[124831,25650]]}},{type:"Feature",id:"bei_jing",properties:{name:"北京",cp:[116.4551,40.2539],childNum:19},geometry:{type:"Polygon",coordinates:["@@óóó›υóôƥ@ŏóóə@ƧŋƩŌρóɛŐóʶѶʴƥʶ̎œôƨɞ@óŎɜŌ̎̍φ›Ƨŋƨʵ"],encodeOffsets:[[120241,41176]]}},{type:"Feature",id:"tian_jin",properties:{name:"天津",cp:[117.4219,39.4189],childNum:18},geometry:{type:"Polygon",coordinates:["@@ôôɜ—@ƨöɚôœôôɚŏ@óƥ@@ȁƦƧɜ@óƧƨƥ@›ƧóəН̏óѷɜ@ŎƦƨóО"],encodeOffsets:[[119610,40545]]}},{type:"Feature",id:"shang_hai",properties:{name:"上海",cp:[121.4648,31.2891],childNum:19},geometry:{type:"Polygon",coordinates:["@@ɞςƨœɛȀôŐڔɛóυô̍ןŏ̑̒"],encodeOffsets:[[123840,31771]]}},{type:"Feature",id:"xiang_gang",properties:{name:"香港",cp:[114.2578,22.3242],childNum:1},geometry:{type:"Polygon",coordinates:["@@óɛƩ@ρ@óœôȀɚŎƨ@ö@@ōƨ@"],encodeOffsets:[[117361,22950]]}},{type:"Feature",id:"ao_men",properties:{name:"澳门",cp:[113.5547,22.1484],childNum:1},geometry:{type:"Polygon",coordinates:["@@X¯aWĀ„@l"],encodeOffsets:[[116325,22697]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/chong_qing_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"500242",properties:{name:"酉阳土家族苗族自治县",cp:[108.8196,28.8666],childNum:1},geometry:{type:"Polygon",coordinates:["@@XJ°œlJX@lbl@XbV@VLnJlxnbšƒUU@IVK@lVIVwnJlU@n@J@L@Jn@l_nWVLVln@@blLšmV@@xœÔ‚`nœ™xV‚ÈLlx„LVxVVšƒV_U»VWn_m¥XwVmnX°ƒlmUUVwÞaVƒk@a@mmIUa@™mwk@™ƒm@@U¯a@UV@@K™@ykkmwkV@kU@ƒÑƒVkKWLÅamaUm@kyU@WkU@Ua™IUašVaUUmUUa@aVLXKWa¯UUbmJXnWnX`l@@xkzWÆ@V„LU¦‚x@b@JkIkJ@LmbUamJwm@óxƒnk@V„@x„ŽVnUVmVUVŽUbVlUbkXWŽ"],encodeOffsets:[[110914,29695]]}},{type:"Feature",id:"500236",properties:{name:"奉节县",cp:[109.3909,30.9265],childNum:1},geometry:{type:"Polygon",coordinates:["@@WVXb‚UnK@x@b‚²kxmKkl¯_ƒVV°™VU@bnKVVV@@nkŽ@n›bn‚@š°@VLČUš@°WV@V™nU@InKVl@nU„b˜KnX„WlknLlKUwnalLša„VlUXmWk@UU@UWWIUyķ¹XaWW@X™ƒKUIVm„U@W@UVU@KV@n»VkUkÇmUmVIUmULUbm@ƒwUaƒKkkm¯ÑUL@bWVnx@VmxUI@„klmkkK@aƒK@IlJ@I¯ƒk@mak@mnkJVL@bV@Ub„„W`UUUV™I@VƒU@VVbUJVLUVVbUX„VVxk¦VJUnVxnVVUšJV@Ubl@@bXV@L"],encodeOffsets:[[111781,31658]]}},{type:"Feature",id:"500238",properties:{name:"巫溪县",cp:[109.3359,31.4813],childNum:1},geometry:{type:"Polygon",coordinates:["@@nLWbX‚VLVU„V@KšIVl@b„@lbšU„VnU@JÆU@V@n°KĢUl@VbÞKšVš@„_„V‚KXU‚U@KXƒ@wlkkU@mWKUU@UôJ@XV@œaVmÞIVaVLƒƒ@»kmƒ@ƒUkL™U@aU@WWƒLUUU™™KkbƒwWa@KU@kaƒXmW—LƒamVk@UmL@JmVUšU@¯X™@ċVUK¯@ÅnWK™LkKULWK@UXK@wW@™LkV@bVLƒlXn›`¯xU„°LnŽlV@n°Lnl"],encodeOffsets:[[111488,32361]]}},{type:"Feature",id:"500234",properties:{name:"开县",cp:[108.4131,31.2561],childNum:1},geometry:{type:"Polygon",coordinates:["@@n@na‚I„wš@@VVK„LVbVxnVÆUnanKWXamKmk¯K@mkUm¯KVƒ°w@Wm@UIUUlKUU@a¯KWanwmUXamKkUWUnU@KƒkUwWKXaWLUWkImaUUUƒƒKka±k@lƒ¯w™wmbUƒ™ƒkXm@UJkIW‚XXƒbƒmƒ„UJ™XUV@°šKlšlVXV@xmbnV@blV@VšœU`UL@V™a@bULlb°VXbܚ@V@bƒL@J„xnLVb@lVb@V@@z˜bXWšX„KVLV‚š@@bUVVL@b„„lVna@ll@„zl@@J"],encodeOffsets:[[111150,32434]]}},{type:"Feature",id:"500243",properties:{name:"彭水苗族土家族自治县",cp:[108.2043,29.3994],childNum:1},geometry:{type:"Polygon",coordinates:["@@„Jlb@nVV@bXb@ÆlL„Ul`nVKU¼VxkbW„nlUxlXX‚@°°WnnJ@VUn@J„k°L@VlV@nUJ„x@bVVVz@VnLla„KnalVlIUŽ„¼@nV@@anKUwVal@UlJœƒlI@akU@UWXKVI‚¯Uak@@KmkXWÜkXWykIWwXw@laXamkVUUym_XmlkkmmakwmIUKU@Wak@kaW@kI¯›WIk¦VŽƒUUƒmaUV@XkVUV±aUb¯b¯¥m@@ImJ—@mƒmL@kUKUkkJƒbV¦"],encodeOffsets:[[110408,29729]]}},{type:"Feature",id:"500235",properties:{name:"云阳县",cp:[108.8306,31.0089],childNum:1},geometry:{type:"Polygon",coordinates:["@@lb„LV„VVnblJVXXKWbXLVx„l@LmVXVVl‚nLWbnVmxXb°L@bVVkLVVVJn@@X‚‚œ_Wm„kUK@alUšKX@@xWL@VXLVKlLšKXLÆm@™mœa@ml@mU@UUmL@aVšUU¯„U°`lknLlw±@a@wmLVWaXU@KWU@ak@VaU@™IUVmUUwVmUIl¥UwƒUVWUaVUUKVIUa@UUUUJƒUUm™kƒ„nl@„@VWV@L¯aUb™Ulxƒ@@b@VULUx@VUxVV™U@bU@mxU„U@mUVŽklkkƒ@WxknlxK@amLƒKU„K"],encodeOffsets:[[111016,31742]]}},{type:"Feature",id:"500101",properties:{name:"万州区",cp:[108.3911,30.6958],childNum:1},geometry:{type:"Polygon",coordinates:["@@ĸĊVI„ƒ„n„aWWXlJVIn@lWš„V„našx°xk„l@²Ž‚LVƒ„LnK@b‚LkwlmXw„@lllkUnVV@VƒnwV@@ašVUUVw@UVwVK@U@a„@kwšVVa°b@KXU@U@ƒmk„ƒÇсaml™kUVmn@VULU˜m@kUVkUaƒwUWm@Uw¯„mKUUmVUUULUKU„W@XbWVkaWwkUU™ƒ™k@maUbmbVlk¦ƒxUVUIWVU„kJVVkL@UmJ™UUVU@lLUVU„lx„@@VbƒJ™U™L¯¤@Vƒ„"],encodeOffsets:[[110464,31551]]}},{type:"Feature",id:"500229",properties:{name:"城口县",cp:[108.7756,31.9098],childNum:1},geometry:{type:"Polygon",coordinates:["@@VK@w¯L@m@UÅV@ImVƒU™Vkaƒ@@aUk™J@LƒUUVUKmLmbÅVmUUwUaƒKUL@U™@ƒxJmbm@nVJ@X@VkV‚n™lƒLXx™@ƒb@bUVƒLU`UnƒbU@@ŽmVVX@JX@VLVVšklV—„‚`@bUL@V„LVKn@‚U@„UJkn@lmLmK@X@Jn@mb„nÞWVXnJ‚k„KČÑÆ@VK@knaÜmXlUČW°kôÇƁ@a@yÞ_VmƒUnU@K"],encodeOffsets:[[111893,32513]]}},{type:"Feature",id:"500116",properties:{name:"江津区",cp:[106.2158,28.9874],childNum:1},geometry:{type:"Polygon",coordinates:["@@„InWUUlU@LVašlX@°²lÒXxlK@Ul@@Un@UaVJ@I@W@UƒUUVUwVIUKUa‚UUVwn@Üx@XUlnn‚bœJ@¥VklKUUlk@ynU@kVƒUUVWnI@¥V£VWVIUKU@UVƒa@n@Vm@@nlUaVkUwƒJ@blLkLW@XWmXkmmLn™@m@U@UVm@™„UVUUlakUVa„ƒVkV@@wnaWUk@VwkƒlmVIkUUxmJ@U„™@KƒIkx±V@IUm@K@IUKkbWKUbn„m„@bmVnbmb@xkxUJ@ULW`@bX@WVXL@Vƒš¯„mk¯@UJ@VmLUaWnX@WJ@nkKkxW@UIV@@KkImmkK@UW@XaWIU@U‚ƒIkbWb„xXŽlLVbnV@bWlX@VxVLnl@nÆÞVÜ"],encodeOffsets:[[108585,30032]]}},{type:"Feature",id:"500240",properties:{name:"石柱土家族自治县",cp:[108.2813,30.1025],childNum:1},geometry:{type:"Polygon",coordinates:["@@„š@kl@š¼UbmVXJ@bV@nxVIVJULVVk@@LWbnJVU@bVbUJ@blLXnWV—@mbnV‚@V„„bn@VJVLnaVanbl@„šVšlVXxlbXUWaX@VƒUUVwUUVm@I@WmI@a„mlLœ™lK@alwnUV@kóVaƒÝk@UlbVK@™VU»VUUVWUƒ@U`ULkwm@@KmU@knKƒ»VkJkUmbƒLkbmK@UUyUU@aƒwm@@XXJ@VVLVVUbVnUJVX@K„„k`WXXJWXUbmW@bkL™Um`Xnƒb@JVL@LU@™°VVXKVnUxVLUbmJ"],encodeOffsets:[[110588,30769]]}},{type:"Feature",id:"500237",properties:{name:"巫山县",cp:[109.8853,31.1188],childNum:1},geometry:{type:"Polygon",coordinates:["@@kVƒU™bkKmbVxkLmKkllbV@@LXb„xlašLVšVV„KXXV@@bšVlK„V„@ln@¼°KXa„U@Ulw°JXalIUa„ÝWXW@kVU@ƒVUVWUUUamUw@aVamwn@VUUƒlLXWm£@wÇĉkKklmLUÒ¯ƒWn™@ğ±kwmaWm¼U@@LUV@V@XƒVUnVJ„LWš@‚XXWbĸºVzXJVXV@@VXlWn"],encodeOffsets:[[112399,31917]]}},{type:"Feature",id:"500102",properties:{name:"涪陵区",cp:[107.3364,29.6796],childNum:1},geometry:{type:"Polygon",coordinates:["@@nèVblĖVVnLšŽ„@šx‚V„n@nšJ@L„UVVX@lbUJV@@nn@VVVK@z„˜V@nzVJVUlmX@@_VVVbnaVal@@knW@wnaƒVK@aVI„J@£kUVW@‚wXUVJ„amƒ@Ikƒƒƒƒ_X¥ƒ@WwkKkwmŽ™šƒkUxƒnÅmm¥™WV@Um@UlVL@JU@@Xƒ@UVkKVk™KVk™Kkb@bmJVXU„VVUbU@@`W_UV¯b"],encodeOffsets:[[109508,30207]]}},{type:"Feature",id:"500230",properties:{name:"丰都县",cp:[107.8418,29.9048],childNum:1},geometry:{type:"Polygon",coordinates:["@@Þè@XUK@LlV@blbUJ@„„V@bnV‚@VVVXU@ƒlbXal@VXnKV@maXUރ@amk@aVKXV‚anbš£°mnIVaUKVwUmWLUUš¯V@@KUK@I„aWmn_šVlK@anXVaXWWIXWl_ƒƒ@LUWVIUmVaUUUK@UWI@Wn@VI@mkU@U¯Kƒl@ImVÅLƒwU¤óbUU@wWXkmm@LU@@VUIWVUL@JUnƒaƒx@Jn„ƒbUIWVx@ŽUXlV@¤ƒIUJ@bUL„Žmb@xmX@lk@UbmbUaUU@`W@kn"],encodeOffsets:[[110048,30713]]}},{type:"Feature",id:"500232",properties:{name:"武隆县",cp:[107.655,29.35],childNum:1},geometry:{type:"Polygon",coordinates:["@@l„„w„bVm@IVKXUVJ@UV@@KnnWlX@xVVôaV£„xÆKnUVm@UmIXm¯¯@WkWVwmkXƒlaUwV»ULmk_ƒVkK@ÅWa@aUU@mkaƒIƒb@‚n¼ƒnm‚_@mmK@UƒLUVVmI@aUJ@XWJ@U`UIkm±kk@@lULmUmKUnVšnlUVmI@VkVlx™bkIƒVmLUxkKUŽ‚Xš‚n¦Æn„mVw„lš™nlxlLXx„@W¦„`„„"],encodeOffsets:[[110262,30291]]}},{type:"Feature",id:"500119",properties:{name:"南川区",cp:[107.1716,29.1302],childNum:1},geometry:{type:"Polygon",coordinates:["@@VšUbVJVUn@VLX@WVXVVI@VUVWxU@mš@ĊX@@¼V°aVUX`@_V@VaUUVƒUWnI@alašLUlšLUllLVU„@@WV@@IUKVkn@@VlLVwnK„UlJšakwlU@UnJVUmkU™VmXa@wVK@UUw™@VƒVI@akƒ@alInwlKXUmaUW@wWLk™™KVak_ÇaUƒƒV@šXbƒLVxUlWIk@UK@V™@ƒkU@VbUVUlVnƒLUV@lVXmxkV@L@V@Vk@WbUwmL@JUI@xVxkx"],encodeOffsets:[[109463,29830]]}},{type:"Feature",id:"500241",properties:{name:"秀山土家族苗族自治县",cp:[109.0173,28.5205],childNum:1},geometry:{type:"Polygon",coordinates:["@@XlV@lzn@VŽnbÆbXKlL„U„ÒV@@llUnxll@zšŽ@LU@@V°b@Vn@š„l@VÑUƒnK@UšU@aUaƒkVm@K¯wƒklmnn„Ul`nI@almkIUwmWVkUaƒkkJmUUa@K@aU@@_m@@wUyVUUa@Umƒ@awl@Wka±„UkUykIWV™b@bUVk@›aU@UXU‚UIWakUWmUxUV@nUVWbšŽ@XXVVŽmXXŽ@VƒbVLkVWx"],encodeOffsets:[[111330,29183]]}},{type:"Feature",id:"500114",properties:{name:"黔江区",cp:[108.7207,29.4708],childNum:1},geometry:{type:"Polygon",coordinates:["@@VX@V@LV@VJUL@lVnnxlb@VXV‚XV@@W„@UIVK@kUKna@£VWUaVUUalIVJVIUW„_lm@bXKV@mn@J„UUw@KnIVll@VanLVmUkVKXLVKUIVamw@UaU_lw„KlwUWV_Ua@aUa@KUšwm›_›Ó@wU@™nkK@am@UkUKmXk`m@@I@K@I@mkVmIUxUJ@kUL@JVV™„lnklWnn`VzUVnlWbkb@WxXxlJXzWŽÛlWXnl@Ll@Vb°UJWLX@VlV@bkJ"],encodeOffsets:[[111106,30420]]}},{type:"Feature",id:"500117",properties:{name:"合川区",cp:[106.3257,30.108],childNum:1},geometry:{type:"Polygon",coordinates:["@@XKVXlK„ƒVL@UnV@aValXXK„U@WVwUaVU@IV@@aVW„L@U@anVV@@bVK@UVL@bnJWL@VnUnb˜@@JnIlVl‚@@bXIWbn@UKVLVKXLlaV@VVnK@bVL„m„IVƒ@KmknUUWVI@aVJ@_„WU_VmUwƒU@K™ƒVak@am¯mJU_UJUkU@WkIV`UI@JV@LmmU@@mƒbUzś™@„VK@nUKƒ„ƒb™akb@UWK@bkVVbV„Û@@`ƒXk@WŽ@n@lXL@bmb@VVJUn@JnUlnUlmX@`XLlbkJW@kzlb@`@b@b"],encodeOffsets:[[108529,31101]]}},{type:"Feature",id:"500222",properties:{name:"綦江县",cp:[106.6553,28.8171],childNum:1},geometry:{type:"Polygon",coordinates:["@@@¦‚@X„lVX@@UVKl„VUX@lanVlUVbXWVXVƒ„VVUnKVUlwUwU@UJ@nmVkUV™lwXam@VaUUUw@W@kk»mV@UmKkwVKVUU@@LUKVI@mV@XVWxnXVKUUUK@wWU@UUWnUlLXa‚mUI„am@wI@K@amIm‚UUkI@m‚akUkKWUUanƒ@wƒamLVxk@UVmUUL@Vm@kV@I@ak@@bWVXJlLVbVL@š@bn@@`Un„@WbUKULWVXbƒ@UVmbX„WVƒb@bVmxUKUƒV@šUn@V@V@nmšnKlnnWWXX@lKkK@a„IVxUlVb‚k@mn@@U@m„bVUV@VLUJUXU¤"],encodeOffsets:[[109137,29779]]}},{type:"Feature",id:"500233",properties:{name:"忠县",cp:[107.8967,30.3223],childNum:1},geometry:{type:"Polygon",coordinates:["@@VLÞĊ„U@Wš@¼V‚„@lk@w²mlšVUœ„llšVnI@VlKUUlIVƒXUVJVU„wl¥UkUKUIm@ƒaUƒ@mUna˜@XUWmkK@aVIUa@aUVmIXa@Kl@UUVKUIUJmwU@@aWInUVa™»k@@lƒ™¯n™¤mabWUUL@bnl@b݄WVnbU@mLUWk@Wbka@„WVUU@UmUmVkUULV„lVUx„l@L@VƒbÈÒlb"],encodeOffsets:[[110239,31146]]}},{type:"Feature",id:"500228",properties:{name:"梁平县",cp:[107.7429,30.6519],childNum:1},geometry:{type:"Polygon",coordinates:["@@XLV@VV@b°°nšƒnkb@bƒšnJWVXblIUVšxWnUJnVVLVU„JlUnLVK@UnUVJš²nKVbVKla@aXlJ„k„Klb„ƒ@U°£šKšV„IUa@ƒ@kwVƒVUkKV@VUkk›ƒUVk™±n@xklƒ@U@»™‚@XƒVÝĉUJnxWb@UX›KkVUbUKWUkVmkkLU`›b"],encodeOffsets:[[109980,31247]]}},{type:"Feature",id:"500113",properties:{name:"巴南区",cp:[106.7322,29.4214],childNum:1},geometry:{type:"Polygon",coordinates:["@@nxnVlJlUXLƒ¦@x@Vl@nKVVX@V_V@@KlVXU„@lKlxXIl@ÈĊ@Vl@n_VJlŽnVlnb„²VVVJVVmUUkĕUamçU@»W@@ĉn™V@XwVU@UUJWUXUW@UKm@UVUIVaU™UVmLUVƒUU„UWWXUakVmUkbW@UVkƒUL@VW@kUWƒ@mJUXVVU„@lmV@zklVVkLUl@¦›I"],encodeOffsets:[[108990,30061]]}},{type:"Feature",id:"500223",properties:{name:"潼南县",cp:[105.7764,30.1135],childNum:1},geometry:{type:"Polygon",coordinates:["@@@a@a@_kalyX@lIkaWK@_nWVkkmmV@IVmUI@Una@aWK@k@mkbWaknmJUk@mk@@kUal@Uaš@Wa@aXLlwUKlkkƒ@KmI@VUJ@Lk@@VUUmL@amJU£kKUaWakLmU@bVVUbnbWV@xkL@bUb‚xUxVbXJVbUVWIUVU@kLWxkKWV@n¯VUbU@@VVX@VmaUL@VUK@VVbn@lVnI‚@@lnLULm@Ub@Žl@na„@lK@XVVkJ@b@zl@@VnV@bVb@J@bnXV`lXXmVI@W@InbV@@aVKUblKVLUanLlmnLlK"],encodeOffsets:[[108529,31101]]}},{type:"Feature",id:"500118",properties:{name:"永川区",cp:[105.8643,29.2566],childNum:1},geometry:{type:"Polygon",coordinates:["@@@b܄nWVLX„lxV„VxXxlVn@@bVblK@a@UnLVJV@@UnLVU@VXaVKVXš@n`WUÿ@IUKlaUUUkWyUÛÅÝ@mmkUKUwW@Xk@amUUakKWƒwXaƒK@VVLklƒXVlkxV„UL@bm@Vxn`ƒIVxUVkLVšUšl@@lkXmmƒVUn@VV@Xb"],encodeOffsets:[[108192,30038]]}},{type:"Feature",id:"500231",properties:{name:"垫江县",cp:[107.4573,30.2454],childNum:1},geometry:{type:"Polygon",coordinates:["@@šĊ°¤nҘ¼œaV_lKnllUXVVLValUœLVW‚@XamwVIUKkaÇфa@U@KƒkVwkUUƒVKlVnU@aƒU@ƒVIka@akU@KVL@WÝçUV@Vmbů@L™KƒnnJW„ƒVkxlL@VX@VxmnXVWxUb@bkn"],encodeOffsets:[[109812,30961]]}},{type:"Feature",id:"500112",properties:{name:"渝北区",cp:[106.7212,29.8499],childNum:1},geometry:{type:"Polygon",coordinates:["@@@bVVXL‚a@lnbWn@L„@XVlK@VVLUVlbkLUKVVVL@VšnX‚VL@VV@UbVb@x@¦UxVb@bUJƒL@L„VVxlK@™nk@U@W„UVLlKXV„@VblU@UUKVU@wn@VJVanLlkX@VaVK™¯@a@U@U@ƒVaUK„kUUƒ±maUkm@UUkbm@@Vk@@JƒwU@Ub@I@JmwUL@aƒ@@KkVÇLkƒWkƒ@kUU@@xUVmKUnllUb"],encodeOffsets:[[109013,30381]]}},{type:"Feature",id:"500115",properties:{name:"长寿区",cp:[107.1606,29.9762],childNum:1},geometry:{type:"Polygon",coordinates:["@@VVšU„bX‚lX„¥l@XnVmlxUx„@@blVnnôĀlm@aVaXwWUnmUwW@@UkKlw„UXƒmI„mšL@KÆ°na@UUImyU@ƒ—@yULUUm@@mU@VIkaW@UUƒV@K™I@mƒmU™wƒ@™mKUnU‚UIƒlVLUb@„@V@V@bš°ULUbW@klmKUbUIm@@xUVVL"],encodeOffsets:[[109429,30747]]}},{type:"Feature",id:"500225",properties:{name:"大足县",cp:[105.7544,29.6136],childNum:1},geometry:{type:"Polygon",coordinates:["@@XUmaVaUU@anVlKXbValU@aV@@IXKš@@bV@VxVK@UXLlUšJXa@_‚@@aVK—ÅWVkwWaƒƒwUa@am@kUWLU@kWmX@ykI@W@UV@na@LlLV@UƒkwWƒUKmXX`mIVl@bXLWVkbkkƒx@`VXm@@J@U@UUKUxk@WbUIVl@VXLW„ƒJUkUlUImxXlmb@X@VUJUnVbšW@UV@@VVX@bnW@LVxUnlJUV@n„@VxVIn@l`„UVVVL"],encodeOffsets:[[108270,30578]]}},{type:"Feature",id:"500224",properties:{name:"铜梁县",cp:[106.0291,29.8059],childNum:1},geometry:{type:"Polygon",coordinates:["@@VblLV¤nI@bnKVV@Ul@@KVI@UnJ@Ll„klVLkxWK@bXb™@Vbk@Vb@ll@@nVlnIlmXblaXl@„W@_Ü@UƒUalU@aXL@Vlašb„a„ƒVL@mUL@ƒUUƒƒÇXUW›X_WaƒƒUƒ»m_™@UWULWb@UUVmK@VU@UImK@V@bkL„x‚„XblxXU˜ÆUL@b@@`Wb™IkVWK@VULUwU@@a™@WL@JU@@bkVUb"],encodeOffsets:[[108316,30527]]}},{type:"Feature",id:"500226",properties:{name:"荣昌县",cp:[105.5127,29.4708],childNum:1},geometry:{type:"Polygon",coordinates:["@@VI@U@WnaWknwVJVkVl„IXƒWK@UUkVJXal@VwVL@V@V@In@UW@_„wlllaXUWK@aUknJW_ۃ@aWaU@@UVm„UUaUImJVnÅUmVUm`kUUVWLnVU@VVmXƒK@„nxmŽULkx™ImJ@nU`@X@Vkn@`@nlV@nVJVaX„VLnK@bVV@nV@lbXWš@"],encodeOffsets:[[108012,30392]]}},{type:"Feature",id:"500227",properties:{name:"璧山县",cp:[106.2048,29.5807],childNum:1},geometry:{type:"Polygon",coordinates:["@@XzVlVVkbVL@JVĀXŽ‚¼V„„„XbW`XœWVȎ„„VVšŽVkV@@UXa@alK@IƒƒU@UKWUyUI@wVUUWVak@VUkƒW¹@WXI@yVIUK@kWwkѯ±W@™kUb@KkVVVmXƒJ"],encodeOffsets:[[108585,30032]]}},{type:"Feature",id:"500109",properties:{name:"北碚区",cp:[106.5674,29.8883],childNum:1},geometry:{type:"Polygon",coordinates:["@@X‚VLV@„„@JkL@bWb@VU@UlƜVy„a@nV@nn@KU@IVJU_lJXV@VlVIV`nIn°@b‚lUbš„„KVI@aUaVw@¥@wUaVaU@@UUKW™m@UUKUUVLlKkaVUUK@UkLWUƒ@@KXmma@kbWKUU@aUamLnÞ@VWLk@@Wm@ULU@@U™KUVWI"],encodeOffsets:[[108855,30449]]}},{type:"Feature",id:"500110",properties:{name:"万盛区",cp:[106.908,28.9325],childNum:1},geometry:{type:"Polygon",coordinates:["@@VIV@@wVJ@InKVxXal@@U@U@KlUnwUW@kVU„KUmVkUa@I@KW@@bk@@mƒU@m@k@a@aƒIUxmJk@ƒwULƒwkKmVVX@VXV@xVLVVULmWXwWUU@@nUJVL@KV@UVULlxnL@VnUl¼@l@XVxVVUbn@WbkxUšlVnU@m"],encodeOffsets:[[109452,29779]]}},{type:"Feature",id:"500107",properties:{name:"九龙坡区",cp:[106.3586,29.4049],childNum:1},geometry:{type:"Polygon",coordinates:["@@XK‚L@Vš@XbV@lW@UV@@VXIV@U™VKlL@KnnJ@VV@VU@I„@@mVUVWUUmL@V¯LUK@UV@UU@a@U@yU@WLUK@X@KUVmL@ƒ@aXI@w@ammVk@WÛwm@UxVVVbVLUJVxVU„V@V@X@JUIVbm@@Vk@@VkL@lVLUJ@zWJ@X"],encodeOffsets:[[108799,30241]]}},{type:"Feature",id:"500106",properties:{name:"沙坪坝区",cp:[106.3696,29.6191],childNum:1},geometry:{type:"Polygon",coordinates:["@@Xºl„UVl@UbVXUV@xVJVzXJVUšL@VV@VKn@@Xl@XK@UmÝnKVbVakkVm@k„ƒUK@UmIm@LkKULVšU@WJ@UU@@VkXU@Wa™@@UKWL"],encodeOffsets:[[108799,30241]]}},{type:"Feature",id:"500108",properties:{name:"南岸区",cp:[106.6663,29.5367],childNum:1},geometry:{type:"Polygon",coordinates:["@@VV„JVL@bUVVnl`XIlwXJlw°nnl‚IXW@UÇĉk@WJkwkLƒ@WVkU@LU@U`W@UXUV@n"],encodeOffsets:[[109092,30241]]}},{type:"Feature",id:"500105",properties:{name:"江北区",cp:[106.8311,29.6191],childNum:1},geometry:{type:"Polygon",coordinates:["@@nLVU@wV@lV„@Xll„ÈKlU@L„@@bVKnx@I@JVaV@„x@Il@@Un@laVVn@mkUIm`k@WXJmk¯mkxWIkxWJk_UmVUUKƒ@UU™@ƒ„@l"],encodeOffsets:[[109013,30319]]}},{type:"Feature",id:"500104",properties:{name:"大渡口区",cp:[106.4905,29.4214],childNum:1},geometry:{type:"Polygon",coordinates:["@@k@@U@w„¥WKkVkImUmwa@b@xWJ@b@„nKVU@L@WVLXKV@@z@V@bVVU@@VVL°K@U"],encodeOffsets:[[109080,30190]]}},{type:"Feature",id:"500111",properties:{name:"双桥区",cp:[105.7874,29.4928],childNum:1},geometry:{type:"Polygon",coordinates:["@@WwUwU@kK@KmbU@@V@XlJ@znWlXV@XK"],encodeOffsets:[[108372,30235]]}},{type:"Feature",id:"500103",properties:{name:"渝中区",cp:[106.5344,29.5477],childNum:1},geometry:{type:"Polygon",coordinates:["@@VLš@VV„@VL@aUKƒIUUƒ@@JUVU@"],encodeOffsets:[[109036,30257]]}}],UTF8Encoding:!0} +}),define("echarts/util/mapData/geoJson/fu_jian_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3507",properties:{name:"南平市",cp:[118.136,27.2845],childNum:10},geometry:{type:"Polygon",coordinates:["@@@knyƒk@ƒKU¥šwV@nkƒWƒzUmk@@lKUa@aVI@UƒKUamKUUVaUI‚@Xƒ@UV@K±IUVVlUbUbUL@KWUXmWk@KkXmmkŃKUƒ™a@amUƒbkUkKWUnwUƒÇwV™UUƒÝUKV£U™@ƒnKWwXLVKm¥@wUXkmWk@ƒ@wX@lU„@šyVImaXwVƒƒ@kŽƒnU@mbk@mlUXƒmU@mV@n@bnW@bUIWJ—ImVUKWbUK@nkKƒaU@W_VUUmWmL@UU@™bUWUL@V@bmVUz@`mUUVVbXL@V™L@lmLUxmVamXkW@xWbU„VbUxkU±@ÅUmmkLUbW@@`kLknVlV@lbXxlVUXVV™ŽU„U@UbWŽkIWVUUUJkI@llbUxVL@V™VƒUU°ULUmWXUV@VULWb@™xm@UaVLVKUa@ƒw@V›bkmVambUUm@@VkK@„@b„xlxX@‚„n¤@Xƒ@@lkLWV@Žn„V„kb@bWJXLWx@nkxmm™bXn@VWVUn@VnJ@bVXl@„™VJXnWbX`lL„UlJVI@Žœ@VXV@Vl@bn@@Æmn@VšxXU@mVIlxšVššnI„l@nVJ‚aXI@mlU@aXkVm°klmnVV_naš°@V@xܦXK„V‚nnUlVXbVK‚LXKV@naV@@VVl@@lXblXšWnLlbVK²nš@@‚VLUnlV@lƒXxô°‚V@UnaUUlKXLVUVVUbVVlUnJVX„@VW@an@lb„@nl@VU@anƒšUVW@kƒaUm@InVVKVU@kUW@Uam@km@kVa@a@™nwšU@WlI@mVI@WXaW_nƒ@™nƒlkkW@U‚¥@kV@Uw@wUƒ@@IXK‚¥VIn@nU@`@Xl@VV„LnašW‚bVaUwnU„@VIšKlV"],encodeOffsets:[[122119,28086]]}},{type:"Feature",id:"3504",properties:{name:"三明市",cp:[117.5317,26.3013],childNum:11},geometry:{type:"Polygon",coordinates:["@@lL@Un@VVna‚bnUlœa@U‚x@„VbULUKVbn@šw‚@XaVK@UVUXWVnVKV¯„VšU@UUKVwka@klJVIVVXUlJXVaV@VƒšUUVWkUWwkaU@UklmlK@_X@ValKnnÆV²@lVVwUaVƒXa@wlXnW‚bnUVwnK@kšK@UWKUaVUnV@_VynU@a@UVKVXšaV@@VnKnXVV‚UX`V@„blL@mVLXaVLnU˜JXIVJ@amX@a@mnUV@„nVWnkl@naV@„ml„@@KmKUam@UU@ƒ@UlKU™Vk™U™K@aVaUwV™U¥UIkJ@wmI@‚mbkwkVW@UXƒKULU`™IVKUa@LƒkkVmUU@WlULUWÅU@I@ƒWW™nU@@w@a@ƒUam_XyVIVWkkƒ@mwVKXUV@nw˜VXkWƒÅ™U@ƒaƒU¯KUnƒK@ƒ¯šmUƒLXŽVLnWVbVbUVm@Ub¯¼W@amƒ`kb™amLUUUƒ™aUXV`@x@XmJ@n@L@xkJUU@kU@mWm@kUUwUUVWl@VUkIƒy@kkaVUUm™IWVXbWxU@k„mVkK@nWVX¦WxU@@bkx@VU@WŽk@™kUbmJUUmkUW@_kKWKƒ@knV¤kIUKWLUbV‚@Wbk@@VWL@VkI@lUXVxUVU@@mWIƒV@a¯nUaƒaUV@„ƒJ™b@bÞ°VbUš@X™aUVmL@‚VXblŽnV„°˜n@Vnx„@VUUUlK@InJVb@„Vlnn@V™L@VWJU„x@XlJUVVVl@LUUUJ@Lƒ„@lUL°¦k˜V„VnV@„xV„„l@blLnlšLVaXll@šnVUn@‚xn@nml°‚X@lb"],encodeOffsets:[[119858,27754]]}},{type:"Feature",id:"3508",properties:{name:"龙岩市",cp:[116.8066,25.2026],childNum:7},geometry:{type:"Polygon",coordinates:["@@ša„I@ƒVU„bVb°m@b„UXJ@nV@VUUwVW@klJ@UXK@Ul@Xa‚@UVaXKVLlJU£lm„@XLlL@`VXnlVVnIVašll@XV@@Ulw@aV@XwW¥XU@mlLnUlƒV@XwWaXUšJVnUVlb@l„zlJUVk@UXVVVxlVn@nXV@@lVVlI@w@K@mnI@W@wU_VWšbV„VVnKšbla„_n‚bX@°»Van@VUUaUamXUKW„K@a@Ukƒ@wWkXƒWW@wUU™Kw@_lyƒwUkU@@Uƒ@kamVmƒXašUVUka@Wk@»UUUVƒKkbWU™VUbk@mkƒxkƒƒKnIVUmW@kUKmXUmVaU@kU@m@KUWVkIWJ@ŽU@UI@wUUUa@KW»nU@mVkUmm@XwWU@ƒUUmL@ƒw@mnƒVUU@aWak@@amxU@UxULWVXbVLU`mbUImVU„ƒbn‚V@@bVn@bnVWxLmyUbƒIUKƒ@aƒVm™akbV‚UXW„UlKWbkV@„WLUlk@@nšbƒb@lkKmU@ƒUIWJkw¯UUVVxm@@XkbWx—›XKƒlUzWJkUUL@bmKkVƒ@@VUIUlWV@X„K@VkbWx°xUb@LUbk@@VWb@LXJ@VWXU@@bUVV„VVn@VVlLn„@l„@‚xk¦Vx@bVJXbƒn@JlnXxV@@„nJ@X@V@lmx„bUn@xVL@VVKlL@l„„nLVaVL@xkl@LƒxVl°š„X„WVX„Vl„œJWnxlJ"],encodeOffsets:[[119194,26657]]}},{type:"Feature",id:"3509",properties:{name:"宁德市",cp:[119.6521,26.9824],childNum:9},geometry:{type:"Polygon",coordinates:["@@@LVKVaVaUkVU²J@LVU„@@W‚VJUbVVnLVb„L@VUJ@bVbkL@Žl@Vn„y„XmlU@™xV¦„L@Ž„lmz@lnL@bVVšbVb@l„nšKVk„Vl¤@zXV@šl@XJVLVKnXVK‚VnU@wUm@šKUƒ@UlVlw@U@U@ƒUaUKlU@kXKlmXIWKXaVIVUVK@KU@@k„JVUnLVJUL@V‚IVa@VnLšKUnl`Vb„V„V@š‚Vbn@Vzn@lKnVlI„VVKUalkXJl@XXVWVLVUUmVU@Unm„£lK@Uk@WUXK@U@WVwVkšƒĠkĢÇ°aUÅUwmaţƒɱUÇa™w„±V¹XalKôx„@„UVaÜʓͿVóbÅLƒJm„¯Vk¦ƒŽk@mamXkKUƒUL›akbk@mV@LkJWb@Vk„mXk@UVmaUV@amLUKUamI@KUaU@WbU@UUUƒUIWJUkm@šƒw™Kk„VJm@kxǁVƒUK@mUVUkmlkkVm@amwƒLVWU@UbVLkšUbƒ@VƒmK@XaVWU_VJnwV@@kUmWakxƒ@kwWakIWxnbUJ™zƒ@kVW@@x@„XllnVW@xn¦ULWKXxmL@„VšU¤VL„ÞVVUšÈxV„mxXVlLlV„anV@bšbV„„LlÆnnlW@LXlWnXV"],encodeOffsets:[[121816,27816]]}},{type:"Feature",id:"3501",properties:{name:"福州市",cp:[119.4543,25.9222],childNum:9},geometry:{type:"Polygon",coordinates:["@@lxna@nJ@xlIVJV¦UšVxUb@bšLšVUlVškL@V@„VVn@Vb‚Ln‚@LU„lJXblx„@lwXbVn@lU@mxUIV`UXWb@‚nLU„„@Val™UKVaV@UX„Knx‚bn@lUkllnUVnV‚@VLU„È‚lwn@UIlƒšL„x‚™n@VlXIVJV„VVV@XaV@Vb@LnJVbVLnK@bVUnbVUl@nWlƒ@UXalI@KnUl@laœbVKV„lLnWnbl@„l¥°Unƒ„IÆKôa΀U„a@UUwÇWǓIUWUÅVkƨm@ƒ@£@KmLU¤ULˣJ™kUƒVǟUUķ@ĉVƒKUk@Ñ°wôǚç@īšé@Åţ¥mīÛkm¼Å@ƒVķVó°ō¦U°ƒn@bVJXVVL@bUŽƒakLmx@xmxXzW`XbWnXV@bWLÛ@™aƒ@ƒaXbWVkaÝwU@mlWKkLWWkLUKULW@kVmVUU݁UamV—¤›n@xUVUzkJV¦lJU„"],encodeOffsets:[[121253,26511]]}},{type:"Feature",id:"3506",properties:{name:"漳州市",cp:[117.5757,24.3732],childNum:10},geometry:{type:"Polygon",coordinates:["@@@bl@Xb@bVVUŽm„@n„x‚@nKVV@„XVWxn@VnUl@nmVX¼@LVbVV@xVJV@@XIlJXU‚V@Ln‚@lVV@UbVnnWVL@lnXUVmJ„Ll„„wnll@VašUXVla„LVUVV@¼Xl@lbUV™VWbn„nUlb„@@VV@„aVUšmlUašUny@kU@Wkk@WaUVk@@ammk@@U@UlU@aUa@wl@šmXLllnL‚U@anVnU@L@VVV@KlXnWVnVanUšw@w@wm›nÅ@wƒaUam@Uk„mUl@@a„a@U@¥škôK‚wȯ°w@ŻkwǕaK›ÑÛk@ĕōřċ£ĵƒUKW»kÅŻLU@Ulġw@¤Vz™VUbkKUbmLmlULU¼UxmbXl@bWVƒb@bUnV‚UšVbULU@@VkbVL@`U@WX@ŽXV@b°„@b¯š@¤@Xm@@b@`U„VVUL"],encodeOffsets:[[119712,24953]]}},{type:"Feature",id:"3505",properties:{name:"泉州市",cp:[118.3228,25.1147],childNum:9},geometry:{type:"Polygon",coordinates:["@@Vl„xkz@`‚xšLVV@xXXW„Xl@xl„@V@bnV°™@„„LVm°L„V„bV@ƚX„Wl—UmxU@WVULnx„@llUXUJWzn`Vb@„@b@xV@šmXX@„@JÆVVXVKXkV@nVlU„l@KVbULšJV_VK„LVWX@lUVƒkIU¥lIVyVU@wœm˜£nUVWU@aƒm@UmWw@UX@@am™VUn@@aUUlUVanaWUXWmUnkšK@VšUlVVUUwš@XLWWX™ma@knm‚bVb„VXbVL‚@XJlInlšL„w˜mXóšw@çV»ÇçŋaķƧóƅóKġ°nÅUķƑUÇW@—¯xÇ°öÆlV„n@llšaš@„Lšbƒ`™@™„VšXVƒVx@V@bULVJUk‚Ç@ƒ¼ƒXUKk@mmULkaWbk@ƒx@UkL@a@K@U@UmKmbU@kV@UmVUbUmmXkW@LUU@U@KmVmU@bVmKkkWK™nk@@xVb@bkV@V@Vl@nn@bl@VUXbl@XlV@@lmz™VVbkŽ™nUVƒb"],encodeOffsets:[[120398,25797]]}},{type:"Feature",id:"3503",properties:{name:"莆田市",cp:[119.0918,25.3455],childNum:2},geometry:{type:"Polygon",coordinates:["@@VbނVVnUlUX@VKVLlKXXlKXL‚‚nkV@ÞxlbXUWa„b„@šbÜ@XK@aWUXmWaX_Wynw@wnwlK„bV@aUKWUUI@a„mV¯Ŏ¥ô¯ĸU„UÆ@n»¯aƿé@ţ¯nĉĬÝK™óó@™ÑU¼@è™xWô—nƒx™KmkkJWI@UKWaƒUUaamn@lnbWšXXWK™@VxUVkU™V@U™LmlnVWXXVmbUbkVVV@bm@UVnš@bW@@VXx‚n@V„n@bV‚UX"],encodeOffsets:[[121388,26264]]}},{type:"Feature",id:"3502",properties:{name:"厦门市",cp:[118.1689,24.6478],childNum:1},geometry:{type:"Polygon",coordinates:["@@@VlUV@nanL@V@V@L@blK@V„wl@XalbVKnnl@VL„W„»È@lVUIVK@a@UUw„WUU™šƒš@„_™aƒK™@™bkkm@UƒkõŁxóL™l@¦@Vƒb@bk@VŽƒnVln@Vb„b@xmÆnœ@x@x™x"],encodeOffsets:[[120747,25465]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/gan_su_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"6209",properties:{name:"酒泉市",cp:[96.2622,40.4517],childNum:8},geometry:{type:"Polygon",coordinates:["@@ÇnÅaĉ@ƒU¯¥›UŹ‚ƒ£™WUýUU±JkkUw‚yÞIČxĊĕĊ¯š¥ÆUkţ™UÅÓ±¼™IUx¯UƒÒƑ‚ݐŰƒKÝnğ°ÅU@Žƒ@Vn@þš¼¯šWnŎ°XLWlnVnbWnƒVXxmbƒa—bóUƒlǕUUa™IUmlU™ƒš¥™kƒ¥ĉwkkƒÝɛa@¯™™U¯°mVƒkVnKlƒōÑÇÑU@kl™UġŽkUŻnUW™@š¯ƒk»šmWV£UKnUƒmUw‚w@ƒUIVaX™šwm»Èmmwn¯ċ™¯LĉŽUƒJUalka±Va@U‚k@ƒÛф¯WmnUaɝ¤Ûmƒn¯m±x@wóxÛLġÒUx¯VƒÈ™JUbóz݃ÇKĉ¯ōlÝUŎWl¯nťbÝ@¯ǩLġmV@ƯĢkÆm™ĊkVťLɃmÝXó°@„ĢbVŽóVݦɱ@Ƨaġ„UV„ĠÇÈV¼UVţwmbJÇwˋa™XmǯKkkmŽƒbXšm¼V¼ǬŚ²¤ôŰÆƴô̐ŤǪnɆӨ¼ɆLÆłUĊšxŎƞȘǔˎǬǪnƨŮǬö°»šġ„„ÞÜÆĸÒĊ„ǀbƾèôÈ@¼¯þŤĸƧ°VĀ¯b@lÈĊ‚šʠń̐„ȘKǀŽֲॗţÿǕý@ʊǓƨóÆÑǖŃôw@΋ʈƆÅÈVVĊV„óĊÅ@ÞƒĬV@Þīš@°Ž„V@ĸĢƒ°XτƜĠ@ÈaÜ¥Őƅ‚™nğóĕVġUůƿŋ—ĕƒa±V—UťÇğÑ"],encodeOffsets:[[101892,40821]]}},{type:"Feature",id:"6207",properties:{name:"张掖市",cp:[99.7998,38.7433],childNum:9},geometry:{type:"Polygon",coordinates:["@@ÈÒŎÒk„mLUŽlŽU„¯nV°šš@°ɜb„ÞĠaÈ»ĸl‚š„LVUÈ@Ċ@ýUm„@@ÆVĠ¯Þm„LƯޏƒ„Ñ°VVwšJ²»ÆԚVlŤÅV™¦ĉ°ĉĖċwÝJzVxll²IVVVþšX„¤źœV°¦„VĊ@ÆbÈmǔLĸĠ¯Ģaô¯ĸmÆÛUƒlÇĸk°XyĊUǔV„ǩnmV»ƒa@ýnK°n@l¥@»ż„Ċ¤m皃@£ČU@mƒmVkÞUƐ±²¹°‚ĠwÅƑŃU¯™›V¯aÈŁšƒÇ»™ġn_°xŎKlxœklx„@Þw‚„„@Æm²b‚DzLlkšWXať¯ĊaœÑšK±w@wƒUÅçV±Uk™@@„¯š¯xƒU™±±UU°ōxVxÅÔō°ó¯UÝ¦óbÝþƒ@ĉÈóUV‚Ux„„@VŽUVÝwÅÈǎóVkk¯JǐkmmL@„™KÇx@bkš™@U°ķ²ó`ƒš™šmn¯°ƒUwlÅkUƒ`™¦ɛô™Žķz@ŽÅnÇ°U¼¯KmVk²ƒJƒ¼ƏÞķôš¤ULƒ@mnğ`™šÇnUxÇ@Ûÿ™U@ƒƒkŻŽ@x@móJkŃ¥VŹĉóÒĉlċ°ķ„Uƽ܃@›x"],encodeOffsets:[[99720,40090]]}},{type:"Feature",id:"6230",properties:{name:"甘南藏族自治州",cp:[102.9199,34.6893],childNum:9},geometry:{type:"Polygon",coordinates:["@@ލš™nKlnšwX¥WÝXk˜xÞUnƒ°aĊVnUUKlÞĶWXnĠ¥ô»„™@nmVL@¤°™Vz„JšanU@aÆwna@k›ƒU¯šyX_›aĉb™ƒ„wƒéXkWwÅaš¯V¥mƒ¯UƒƒI@ƒš@„mšb°aÈçšUš¥@»‚knwɜƇ°I°ÑÈmVU™¯Xa@w‚W@wšV¯Č¥l¯Uwnm@k˜aUaóKkk@™Ça™b@ŽÒWa¯IÇxÛam¼™VUƒxÒl‚@zÝÒ¯bÝaĉVĉwDŽW›zJ™mJn²mܯUƒ¯ĉ@ġ¤Åb@²nšmlƒ@@Ž„„U„ƒLVxšV™„U¼Ålma™b@ƒ°™l@WIUƒ¯@mƒ™@™™ó„™„@U›zţyƒXÇU™ÇVUUVLkbWakVWmUbkkƒKUÆ»nƒ°Knk@aƒUVmšnk»l¯Ģ›lw@_kKVU@ƒnaƒ@lUk@¯¥mV@kmbW™b¯Åõa@mkU@kƒÇŽkU@›`@™óó—bl¼Uxƒn„¼šlVȄx@blVkVVnƒ`XÈġÈ@ǃK£ÝJmUUnUĖmlU„mKUn™VÅaUw›Uĉ`¯n¯wW¼nxVŽ™š@bĉnƒ‚kIċŘkXUŽ±Ò™xšÈ@ŽX°`l„œV˜IȯĊV„ƒšVVan@VašUVażVmšblkÈW„ƒWIXa„alL@wVb„„V„¦lL@lĠ™n҄U‚nk‚šL@ÆÞkšÞšK‚bñþW¦Û„ċVƒ„ULUºkÈlŎUxÆxÞUUxšÒ‚x„@XbšL@lÆ@„ÒlXVln@„bm¼ƒJ@„Ån„šƒx@bnšĠm„xVXmbÈè@ŽĊ£ČW˜w"],encodeOffsets:[[105210,36349]]}},{type:"Feature",id:"6206",properties:{name:"武威市",cp:[103.0188,38.1061],childNum:4},geometry:{type:"Polygon",coordinates:["@@±¯¥@klwU»ƒƒÞÝmwKm¯™™ç@™kVÇUL¯lVUKġ„ġm@a@U„@X£°l°LŎÇ@aōVÝw™ÔƒKUŽÅš„WJ¯lm@ÛVWa™@klĉUmaƒLUanaƒ™ƒk¯J„™™±KkXóÜÅxƒ²Ç‚@„„nUÒĊb°@™ÆkL™Ž™XÇÆ@xÝn—xWxţ„¯¤ƒI@Æn„ƒVV„VlU²Æè„V@x²x™L›ÒĉbŦ°Wb™Xklބš@l¤šXĊ`„wl@ĢÈŎm@bšnV‚Ubƒ„@șÆÛLƒèǚUÒŦlĸ™`°ĮʟÆǓbĉôϚĊƚĢnŤé΀ÑĸĀĊ¦„@@l°lœ¦Ȯ¦ɆÞĊKŤ™ĵĸů„»mŁyġ™ķŭ@Çɱȭ¯mƧUĊķnŁŻ»UaU™˜ƛɞÝƨů"],encodeOffsets:[[106336,38543]]}},{type:"Feature",id:"6212",properties:{name:"陇南市",cp:[105.304,33.5632],childNum:9},geometry:{type:"Polygon",coordinates:["@@šÈÞ@l`UmVƒ¼œŽ‚@nnÆwVlnVVa„LVƒÈ_‚ÿރ@n„a„xÆ@„lš_š@VxnK@llLnxmÈŎJnbUxšI°Žl@n¦‚lÈIlmX¥„k°@šk‚J„k²é˜@klaUaVaU@@ÝnIWnmnx‚k„ºÞ„„aV™°„V@nw‚KšxôbÞ£šVšU„bšþšLn»mƒVw„IšJ°Ž@„nb@°°I„ġUkÇKVƒ™™@ů»lƒ„Lnmƒ£@anK@Ñ܍n@»mL@£™yk„UUmbUÞÝ@kyÇbó»™XUxƒWVzb±mÝbXaƒwUamL¯»@wUKVwm¯ĵJ°ÅUWVk„KVk°wÈVšVуlUšƒ¥škmVamknƒUw¯¯ƒbċ¥ÅKƒk™Kk„™VċVk£kKVw‚Ñ„a@kóyÛ¯ÇVk™ów›š—Xō¥Ç¼ów™Ž¯U±‚k„ƒ@x›IĉÒÅVmÈnšÜ@n°„bUbÝV‚ŽUnnJ¯Į@‚m¦nV܃@„„L°JXb‚Ñ@šaÈb@šllôLVb—b@lmnVxk°ċ¦U°™Ž@xX@xWbš°UVÇn¯Ò¯Jɛƈmxl@¼"],encodeOffsets:[[106527,34943]]}},{type:"Feature",id:"6210",properties:{name:"庆阳市",cp:[107.5342,36.2],childNum:8},geometry:{type:"Polygon",coordinates:["@@kw‚ĉ—»VamƒƒV¯wƒIóVkl¯™Km™Vō¯ÝWkL@bÝKō¦@Ž™„@š™Lx›@b@l™a@km@@l¯nm@UaÅ@ƒ„óWUXm¥™nƒw`@UUxķôÇ°ğ¦@„VJš_n‚‚IVŽnalxkX„JWn¯šnVƒLšxl¤nnVbklVX@xnxmV@bUK@nm@@xƒV—°±aÅnƒŽkUWnUaƒx@m™n@ƒ¯LƒššmUĀlU@lV@blLUblxklkIÇx¯°‚UXbšaVŽUnšV@°‚LUlnbšX@`°nVmbnÆmV‚kLmK™¦UŽ@X„y@kl@U„°K@¼XbW„ƒš@b„WnLVa„VšƒVz@xlVČ¥lbUxލlV„U@nÆWôn²™VJlU„Ƨ„LnmÜLXa˜n@mœw@wlUlV²mšblwšVȃlLލ„±@lVnUlxnkma@mškšJ@kXV‚U@mn@š¼VXUƒVƒlLnmVbôaVnWV»ÈUl°È¯ÆIn›ÆU@kk»mKkÆġk¯@»mƒk—¯@óÇlÇ@—Vykkl™Uml¯Þ™@w"],encodeOffsets:[[111229,36383]]}},{type:"Feature",id:"6204",properties:{name:"白银市",cp:[104.8645,36.5076],childNum:6},geometry:{type:"Polygon",coordinates:["@@VKUȚl@šè°šnŽ‚LnxÝބ„V¼kx@l‚¦²°ĊóĠ„™Ċ»š@ÈxšaĊxlwÈVŤa@¯²aÇ£ƒJk£lƒnUÞ@°šô™@y„wl»lIX¥Ǫnw@ÑÞWla„ÅlL@ƒUwĉakƒl@ƒš¯mwna°J„V¯nUVÓÞÑm£²óWaUƒÇ@óÝUçV»ÈkkW@¯‚xV@XlK@wX@Vmm_@wÈݙKU¯ÇwVwÅK¯VƒkƒJ™™™XkWVaƒImŽ¯Uk„ÇlVšœĀV°mxóšk„@¼ó„WxĉÜU@Ub‚zÛJÇk@‚ÆnVlԙ@kŽ„x™ô@ĬWL¯ƒƒK@aÛImm™@ƒIUaƒ@™™UŽÇêU¤VÒÇx¯ÒV„šš™lk@Wbĉ¦UbkWV_‚y¯Lƒaó„kŽ@b@nmbkx„°"],encodeOffsets:[[106077,37885]]}},{type:"Feature",id:"6211",properties:{name:"定西市",cp:[104.5569,35.0848],childNum:7},geometry:{type:"Polygon",coordinates:["@@„a‚V²wVJV_@„LlanÅllŦçÜӚ_šlnƒWaôk„xUš„bmV@È°lèšnk°l¦„`@nnL‚@ÈlÜIyVaV@ĊÛXwôƒ@»lƒô™nwU¯›ÿU™Èklƒ°Vn„JUblXšWšš„I„l°U„ƒVƒš—@aVVVmnL@„lƒ„UUw‚mkƒš£„bV¥VUVwۂƒlaÇÝރmk£ƒLUy¯L@WlkKW_XaWƒ—mƒ„ġU@a™k™‚ƒakXkmVwmŹVƒU™b™WƒónmwnWW£„KÈnV¥ƒ¥„ƒÆ_k™lW„bU¯„V°aôbnaVwmaōInÇmwkK@kmLUw™@™`ƒkÅ@ƒwƒb@m݄ĀÇ`U„ƒKUbmUUkÅxmm@›„»nUVk_Ý@™Ç™¦™VÇè¯b™aƒn™@@„„JV„°Žn„U¦™°ÆbXxWl„êƒxš„ĊaœbW`™zV°œ„@lmbÅx@bmV™bƒI™`™¦@ÒUVUI@ƃL@bš¼@ššŽ@„šlmxnL„°ULƒŽƒÞğޛ°kLUŽƒL™°™xVŽ„n„KVƒl@šzX@"],encodeOffsets:[[106122,36794]]}},{type:"Feature",id:"6205",properties:{name:"天水市",cp:[105.6445,34.6289],childNum:6},geometry:{type:"Polygon",coordinates:["@@UyȍVƒVUnn@ƒVU„`UblzšJnk‚@Vb„KU„°l„wš„„W°„nkVŽ‚UÈlš£°V@n¥šV„kl™kU˜±U„ƒn™ƒlw¯UkwmKUlmkUmnkym@ō@U„mWÈU°l°anlJškUKlU„¯Èm@kmWV»kkÝLUWUx±b™@¯ma@ƒ¯™IƒJUxn„m¼™K™ýƒa™V™Uݤóa™wLmxU@¯ƒUšƒb݃ƒ¹lmwmnXŽmJ@ÞV@UbVbkblŽ—@±êƒlI™l¯@ƒlW¦knÇJkm¥k@¯™Jmbóa¯bƒUV°ƒakXlšÅ`ƒ„„¦U¦ÇmƒLX¤mXnxm‚„ôšXša„VźUnŽUxlnlW„bššl@bĢV„ƒ˜nX„WbX`lLXk@Ž°KVz„Kl¤„nÞ݂Èkb„‚܁"],encodeOffsets:[[108180,35984]]}},{type:"Feature",id:"6201",properties:{name:"兰州市",cp:[103.5901,36.3043],childNum:5},geometry:{type:"MultiPolygon",coordinates:[["@@lW²LššƒŽ°I„l„šmbVb„KnbĊVlkš@XbÜU@Žkn°‚XIƒÆ™V„LšÓÞxŎUlôƒ„b°KzU`lXVaĊ¥Xal@šk™™Uƒ°ÑÈwUтV£ÈéVšš„@Vb„Jš@nnÜJ@b„L°„XK@īšóƒwlš@kÓmUÅmK@mƒ_k¥l¯™mkçǯ@nUƒaV™ƒwólXbm„™k™`ÛÔťèkkmÆkbƒK@U`UI±xUƒbWlX„mbVbÅÒólkƒƒIWJkšƒ@ƒz—KŻ¼™@™xUx󎃄¯LWb@ŽÅ҄„±¦U`nbťĀUšVb„LšŽ„U"],["@@ƒ¯lwna@mōȯK¯kW¤ƒ@@V@bĢnĢƒVLU‚°k"]],encodeOffsets:[[[105188,37649]],[[106077,37885]]]}},{type:"Feature",id:"6208",properties:{name:"平凉市",cp:[107.0728,35.321],childNum:7},geometry:{type:"Polygon",coordinates:["@@ÆLUxÈxV°šLÇÞ@xn`Ü@X@nĊŽÆwnJmwUx‚aUkšw@V@w„aVmlLXÝl@X‚VĢmV°@nl@UUUWK@w„ÿVI²Òlmš@nÝĊýVV@nšJ°„„šUłm@kV¼nK›ĢȤôK„blnKllVk²aĠ¥È¯ĸóVw@V‚_„xšmn¦VWôX„ƒÆ@Vbn@°m@kn@@lšb@k‚aœ@‚wšK@™šƒ@UlKVaƒWX™W²¹lӄw@_°›n@@_lKōķW™@ŽmLUWƒn™»Û@›l_Ç`ƒÛmm°ÅbWb@š—VWbƒUUKDŽÅaġlmkUġlƒ»—Lƒl™Um¦@Ž¯U™¤ÇkVUml¯ƒƒX™ƒƒx¯kVƒƒLUa@ml™IkyVaƒ_UV@„mmUVU„ÇŽVzUxUVU¦ƒa™¤l„nVxƒVk„@ƒmKUnUU@b™˜U„ƒ„","@@@Žż@™mlkƒġk"],encodeOffsets:[[107877,36338],[108439,36265]]}},{type:"Feature",id:"6229",properties:{name:"临夏回族自治州",cp:[103.2715,35.5737],childNum:8},geometry:{type:"Polygon",coordinates:["@@š@ż»˜L„y„@l™XI„Jl„ôkÆÑUanaWƒXkW@™yk@U„ƒLƒmUšwš¯„KVlKœ¯Ġ݄݄VKƒ¯mKnw™k@ƒ™@™™»@a„K@ÅVJVU@њ¥š_Uy¯š@£UKmn@‚ƒšó¼ğ¦WmĵXݎkŽVLmVĉU¯bm„ÝV—wWlXÞW¦™xkmmL™šÝŽœ„±U@Vގ™š@„ÅÈW°X„ܼƨyUĮnŽWŽnXÝxUx°lVXJlôV"],encodeOffsets:[[105548,37075]]}},{type:"Feature",id:"6203",properties:{name:"金昌市",cp:[102.074,38.5126],childNum:2},geometry:{type:"Polygon",coordinates:["@@šĢȼ™„Çł°bœU°šV‚ƒń‚ÆǖŰnšÆ„ōĬǔaʠůĭš_kķÆ¥VÑș„çÜKšÅ@DŽƒVaU™m@aōnġÇk@ƒxĉ_™Wk£™@݃±KÈ±aÅnƒ@ƒÝxƒ@kw›lkwōL¯wm`"],encodeOffsets:[[103849,38970]]}},{type:"Feature",id:"6202",properties:{name:"嘉峪关市",cp:[98.1738,39.8035],childNum:1},geometry:{type:"Polygon",coordinates:["@@llĊx„¦šl™¦š„kVVnšJVbǖV„kôV˜a„bnaWw„UXmmamUXkWKō¯Xm°™™»ĉÇ@UVƒK™ķkǼğb"],encodeOffsets:[[100182,40664]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/guang_dong_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"4418",properties:{name:"清远市",cp:[112.9175,24.3292],childNum:8},geometry:{type:"Polygon",coordinates:["@@lǯkÿƒaV¯™VaÈU„¥ÆDŽIlxšmnb‚Uœxl™„Uôl°kš„„Wl„š@ô™VwUanUl@„xVkšaX¥‚kU»„aš¯±@kka@ƒUwmUkwƒJk™˜„±k@ƒ™™L@ÝWUwV݃—xÇU¯ŽÇX@m™Åƒ@@yĉ£VmUwȗ»ÇšUn„lUnWU¯`Ukƒ@@„™x„Ž@bÇxX¼ƒVVš¯LšĀk‚ÝLƒ„¯@VŽƒĀ¯lnĊW¦kVÇôkUDŽUK@ţ™U@a™™ó܃UU»ƒ@™¦k@Vx„KVb„n‚š@„Æ™„l„@xšƒbWšnlU„lxÈlV„È°Æ„@¼™„@x„šWxœŎ‚V„šK°„š¥ššnƒÆkŎ@ÈÑm™„K@¥šk@™ô@„nôV"],encodeOffsets:[[115707,25527]]}},{type:"Feature",id:"4402",properties:{name:"韶关市",cp:[113.7964,24.7028],childNum:8},geometry:{type:"Polygon",coordinates:["@@W™Xk±Ñ@ƒUw™mUwĉwlmn@Æwn£mkIš¥ÇÅ@¥šaƒón£nWWwš£V`Þ@šnVml@xô¼„IV¥ƒkUmkamUkVWwÛ»móƒ£UVÅKmn@x™@kbmm¯a™Xka›VĉaUb݃ƒ²—‚lš„IlxnVVx@„lb@l²™°ƒbV¼lW¦™bUlƒwk@mVVbUxóš™@kƒƒX™ƒ¯lókƒVkš›wVma™nkwƒJÅȃ¦ÇVUbšŽU°„blĀ°ŽkÈ@x™¦Æܙ°@„°„¦óa™VUôlUlbXl@nÜV„„nKlŽnIVÞ°Wš„°U@bnm@¥šIVƒ²Ulƒ°VnalzXyl_Vyƒ¦lƒœLlxš„@ŽÞbšKm„knVWanwƒÑVwČº˜@n_ÞV„aVŽÜIœl@„˜KȚ„VJ@aš£È@˜™@km™„aV¯W@_ƒa¯KmbkÇkLmwƒ@Å¥"],encodeOffsets:[[117147,25549]]}},{type:"Feature",id:"4408",properties:{name:"湛江市",cp:[110.3577,20.9894],childNum:6},geometry:{type:"Polygon",coordinates:["@@@ƒkXƒ™@a„UUċlk„Jƒk„™@wVJXUWk°W@nKnwlUlš²ƒ„blU@‚lI„l@„XbW„šxnm@lW@w„wU‚JX¯VU°`ŎóˋkÝÝkÅ@ÇmğÈřmw™aĵV›xUہ»°™ĠǷnýmóX¥ɅĵҏÇ@°²ĊUĖ±ĮU¤Ç°™Ā¯ɐnżUĊĊĬV@脎@ԃÒU¼l¤nƒĠb„êVĠ°Èy„zVaV‚nUÆL„ašbVl„wÆ@"],encodeOffsets:[[113040,22416]]}},{type:"Feature",id:"4414",properties:{name:"梅州市",cp:[116.1255,24.1534],childNum:8},geometry:{type:"Polygon",coordinates:["@@„‚nԚlW¼x‚¦@lœVl™lLkè„a@zš¤ƒĖ„¼UxlnUKUbÝlU¼lb@„Vx„V„klJÈwV¯š@ĠlÛĖšnƒbkšÆźÞƒUÈôklmšL„¥‚LœW˜„„™nKUkVa°V„x@IVV@x°bUk„a™a@mV@„@y„w‚L„ÑUwVUšV„‚„U‚bÞVVann‚@XwÇÿš¯²aVamkXaÆ»@»nw@¥›UXaƒkbWa¯KUw@¥m@kwmLU»UU™J@kmU@UUWUƒ@ƒyƒanwmçÛl¯ƒŽ¯UƒmKUmƒwVkmÝXbW@XWÝbƒk¯@±‚w@»U@W¯Å@ƒÇ¥UƒU@ƒƒ™IU™ƒakJƒĀ„ꃰšþƒXkamŽ@Žƒ_J°m‚@X"],encodeOffsets:[[118125,24419]]}},{type:"Feature",id:"4416",properties:{name:"河源市",cp:[114.917,23.9722],childNum:6},geometry:{type:"Polygon",coordinates:["@@°VlmX¹laĢÒlm„@„„šVš£‚‚@¦Ģklynn¼lW°z„W„„°VbÈV@lÆbnn‚JškX„šVÆašÅ„W@™ƒUUw@ƒkaV»ÞkVaVLkmVwƒ»„ĕ™£@yƒblçkKkš›U@k¥‚wX»™kmӃ@Wn¯‚I„`@nlb„W™ý„¯ƒé„ÿlI@™XUmWUwƒ@@UJU„Ç„mKUV@x™„ţk¯¯LWƒƒnUxK@ű»Vwa¯š@¤WX@ŽÛ¦@¤ÇIȼWxXŽƒ@Wx—w›ŽUnVbÅèmVa±²UWl@Žk„lȄ¤nôܼXxlUnVlbVn„lU¦ƒJó»@wnkmU™‚Ý@U_™¤XxmXm¤„ô™b@¦Èƙ¦lJn"],encodeOffsets:[[117057,25167]]}},{type:"Feature",id:"4412",properties:{name:"肇庆市",cp:[112.1265,23.5822],childNum:7},geometry:{type:"Polygon",coordinates:["@@l@š¥„@V¼„Vôۚš@bšV@ŤVLȃlVÈólUX¥mĉ°k„ÿU°@„ƒÞKl™ÿ°KU™„UW»Èw@aƒšw@ƒ„@nm@w›£kÓVUVn„Kš™k¥™£Vamƒ@nkKkbÆǫma—kmLU¥™UmƒÛwmVU™mUƒJ—ÇaUxÇIn`mb@Þ¯b@„nJ@nl„U‚V„lVU„L›W¯—Û`Ç_¯`mš¯I™bĉWċzx±J™xš¯ÆUƒƒ_k@™šƒJ@Umb„šXôlLš˜n¦@¼ĊxlUXŽ˜xUbL‚Ġ„UnVĊwlšUš„b@lW„X„‚m²˜@ÞWxXš‚Unb"],encodeOffsets:[[114627,24818]]}},{type:"Feature",id:"4413",properties:{name:"惠州市",cp:[114.6204,23.1647],childNum:4},geometry:{type:"Polygon",coordinates:["@@lbšW°bnnlaš@@wnmÆLVUkÇlƒ@Xk‚V²±‚bnUÆçUaVmœ˜xXw„@WXwÇ»ÈJ@£Ü¥@XW@£°™‚bUx²¼@ƂLVw„mX„°K°Ťlšƒ@wVUnLȃVƒVIky±wkƒKU¯ƒÅkƒ™XġÑۃlwUwlm@m„nKWašÅm›¯óÇmğb¯alĉUwķbmb@lÞÒVn—šmĀŹ@VŽƒbVŽUnmakLm`@xĉkklVÔVJVn—lV„UnmJmaLUbl‚™zmŽkL™a™‚ō@@zš‚V¦UŽV²kJ„nÜU@˜VXUŽL@„lJƒL@bݤUnVŽ—b@xVnlK²„Vx°V„xlI„lkVl²k¤@n"],encodeOffsets:[[116776,24492]]}},{type:"Feature",id:"4409",properties:{name:"茂名市",cp:[111.0059,22.0221],childNum:5},geometry:{type:"Polygon",coordinates:["@@‚LnÇlk„KnkÆL„ƒUm™ÈxlUœJló°n@ššanŽš„„a@ƒ˜@X_@mÝóóU@a™aU¯mL¯ƒƒkV¯™ÇVwkw@V±Ŏ£@™™@šalw±Vk@m„Åm¯™ÿŃƧIÇ`ōô¯_UVW°IV‚ƒx@xkX@Žmn™wXƒWa@ƒƒkkJ@kVƒa±„k™kVmxmL@‚¯XXlWVUI@xƒš„lƒIklVȃV@b„šlW@„@nUxVblVxkôlx™n„‚y„šnIƻư„aXwlK„bVnƒŽXb‚L„¤„k‚L—èƒVV¼ƒŽ²IlĠVX„ynz°KVx°@VlœLlblKœš"],encodeOffsets:[[113761,23237]]}},{type:"Feature",id:"4407",properties:{name:"江门市",cp:[112.6318,22.1484],childNum:5},geometry:{type:"Polygon",coordinates:["@@lUXx°JWnnƚXVš„W„X@„šºVLV¯nU‚Vnb™ô„x‚aXmW™XIšŽUb°xlK„l¯œK˜xXÞ°ŽšXÈ¥Ü@„ĉޏU™‚çš»nóƒVma—x‚¯UÅU¥Ý¯@ƒƒç@ș@çĉÅUmU籃ĉKÝxÝ_ÅJƒk¯»ó¯nmèkǀšŽWxœ¼mnUÜġ°@¦@ƒxƒLkŽÇaVnUxV„™šVlnIlbnÆÆKX¦"],encodeOffsets:[[114852,22928]]}},{type:"Feature",id:"4417",properties:{name:"阳江市",cp:[111.8298,22.0715],childNum:4},geometry:{type:"Polygon",coordinates:["@@°„nKV°šb@bôVÞô@n„VlÒôÆUnlnn@lmkmVkƒaÈkÆƄ™k¥‚ÅÞ»ÆKXkW¥ÅLmÅkamJUkš™UƒVwUmÈbl„K„w‚@@¥Ģ¯VÛnm›»Xw™lƿ™@kbW™—aʵ@óL›l¯ƽ@™ƒƒLn°ƒÆ@nUl‚²kx™b@‚š@šō¤U²@ŽlxUxšÈU°lŽ„"],encodeOffsets:[[114053,22782]]}},{type:"Feature",id:"4453",properties:{name:"云浮市",cp:[111.7859,22.8516],childNum:5},geometry:{type:"Polygon",coordinates:["@@@V„Iš™l@„`V„°Å™šw²I‚wČyĊXša°Jn™°_È`Ü_°˜œX‚KVƒkUUƒVkƒ@mmI@ƒ°a@Ýnam_ÈJVwlĉX@„šlUšómaUmVU°UK™¹@ƒƒWƒXU™™WmÅXm¯IWwkVWlÅLݼÆl¦ƒšÅÅÇl„bUllnknm@kmVmóÅkуUW`—@@„ƒb™ƒm™b@™¯mkô›IkVÇwnš„VƒÅKmlƒLklmȁKƒšVĊK°²„`n˜¤n„U„bWl„xVx™LUx@°nXm`VklVxmnnx"],encodeOffsets:[[114053,23873]]}},{type:"Feature",id:"4401",properties:{name:"广州市",cp:[113.5107,23.2196],childNum:13},geometry:{type:"Polygon",coordinates:["@@Ș¼VxUnĊ¤@z„@šÆ@nÈW°ÈV˜w„ŽUÞVxÞX@ŽšK„šl@ބVaĊbœU@ml£k±lUƒkkJƒw¯UUw±ƒkLUm@w˜aUVmÞ£@a„KkI@ƒ‚KVUW@—ÛVƒmlIU±VU¥™@yğzƧǃƒšƽĠřšÅnī±m@ƒ²¯lƒ°@nÝÆóUll@XnÝVU¦mVV°—„V¼™Jƒn„b@°mbn„ƒ‚@²¯‚¯wVwƒ@@nmxX¤¯L@ŽVLU„m@@l"],encodeOffsets:[[115673,24019]]}},{type:"Feature",id:"4415",properties:{name:"汕尾市",cp:[115.5762,23.0438],childNum:4},geometry:{type:"Polygon",coordinates:["@@@‚„@VxnXWV@š„bVššJ„„V@ÞÅU¥Ċxš£UWU‚wÅUU¥WVUkĊÇnkV`°LV™„wƒƒnU@™„ƒlbĊ¯„Vnalšš@@çkUÝ¥ġaó¯ÅaÅLŻÆUýmy¯ó@ĉÆó„ȯw™ÆXbmLƒ‚@nknVxkx܄ĢҚW„Æl„V°„Ll‚²xlz"],encodeOffsets:[[118193,23806]]}},{type:"Feature",id:"4452",properties:{name:"揭阳市",cp:[116.1255,23.313],childNum:5},geometry:{type:"Polygon",coordinates:["@@V„Ȧ„Æ@X°V@@¼‚x²°@„lÞaWXX@‚aÞWlnUŽ„xVnnL„‚°V„@k‚mĢl@„ak™@mlk°aXƒ±„nwm±™²¯JV²@ƒwW˜—_mƒa„V»ƒU@m¯ĉUф™šJl™„ašbVn„lĸLlƅÛDZwÝ@ĉxó@è™@k™mbƒUĉ°kaƒ„@šmV„„ƒxUš¯KU_mlĉÈVlXUV¦ÆVxVŽVX™¤ĉwV¦ÝÆ"],encodeOffsets:[[118384,24036]]}},{type:"Feature",id:"4404",properties:{name:"珠海市",cp:[113.7305,22.1155],childNum:1},geometry:{type:"Polygon",coordinates:["@@„è@„Þ°V¦VƁ°˜wnb„UÆ»nçƏ@nxܤ²llU°VnÈJސ°UôéšķUklƒô£VVˌKÞV°£n¥ƒ£ȗ™Ýy¯¯mÅkw¯bÇĔğ@Ýn¯ĊƒVğōŁŻƒķJ@Ț","@@X¯kmèVbnJ‚™"],encodeOffsets:[[115774,22602],[116325,22697]]}},{type:"Feature",id:"4406",properties:{name:"佛山市",cp:[112.8955,23.1097],childNum:1},geometry:{type:"Polygon",coordinates:["@@Èb˜Ž„InVVšnUÜxn„šVV¦nK˜lnbÅǬlalL@mn„Ubš¤l¦™šƒLUmUVlԜ¤@xmnVl°_XVVmƒkVmș@kn@VƒUK@°KW£nw@m„@Ux°x°@±„mƒna@¯ƒa„mšIU»˜ƒU¯nUV¥ÞUWmk@Vk¯™Ukn›ÑWݐƒĊÛ@Ǧ™W¯Wݗw›Lk°ƒkL¯wVa™WJXšWnbƒwkVƒ™W@kĊ"],encodeOffsets:[[115088,23316]]}},{type:"Feature",id:"4451",properties:{name:"潮州市",cp:[116.7847,23.8293],childNum:3},geometry:{type:"Polygon",coordinates:["@@°ŽÜknèmx„b„z„@V‚VX@VnV@lšIVVV¼nKlxn@@¦Vx°LXbla„ŽWbœV°£¯™W@nW@™‚aUñVœwWš»@¥ŤÅUÝǓÝóV@ńǎkUVmƒIUwÅVWÇX¹›—@W„¯bkl@nlšƒb@‚kġŽn@l"],encodeOffsets:[[119161,24306]]}},{type:"Feature",id:"4405",properties:{name:"汕头市",cp:[117.1692,23.3405],childNum:2},geometry:{type:"Polygon",coordinates:["@@‚@U±°Iš±n²mx²ƒ˜@œWºXÈÆUVx„JUnlVȍ@ŃôUǔÞVçn»VyĢÛVm@»kaÝUǼóšÛÈķKċ¥X„¥Wwğk™ƒ¯@ƒwķKƒkUm™aƒbkš™IƒšVÒ°Ċ@n„VU¼ƒ‚„bn˜`X—„x"],encodeOffsets:[[119251,24059]]}},{type:"Feature",id:"4403",properties:{name:"深圳市",cp:[114.5435,22.5439],childNum:1},geometry:{type:"Polygon",coordinates:["@@ÞLš„@xšbV„šVšK°™X°Kô¥Vw@anU„胐š‚lkĊl@wn_lKnbVmU„aUź@nÿ˜™UmÝѯUƒbk„@ÆkxŻ@™aÇX—wƒJƒƒ¯LķÝUĕ™ó™ĸóêWº@b²nmĬ™Æ"],encodeOffsets:[[116404,23265]]}},{type:"Feature",id:"4419",properties:{name:"东莞市",cp:[113.8953,22.901],childNum:1},geometry:{type:"Polygon",coordinates:["@@Ŏ@ššblKnšykVa‚KnbnIVmUƒ˜kUmUIUә„ƒçmV@bUxó¦¯LW‚¯š™L™UUƒ™a@w™ƒÝKğŚ™ƾ„„ƨÈĠy"],encodeOffsets:[[116573,23670]]}},{type:"Feature",id:"4420",properties:{name:"中山市",cp:[113.4229,22.478],childNum:1},geometry:{type:"Polygon",coordinates:["@@‚XœÒlmšV°ôÞÅ@m„¯°k„±‚@@aX¹¯VݏÇIUmV¯kk‚±Û£mw@‚Őmèżmô™¼èVš"],encodeOffsets:[[115887,23209]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/guang_xi_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"4510",properties:{name:"百色市",cp:[106.6003,23.9227],childNum:12},geometry:{type:"Polygon",coordinates:["@@lklWXL@VšI‚l@XnJn@VUUalk@mK@kny@UlU@a°™„ƒUU@VmaU@Ua@UWw@ƒn@KmLm@alkšmnI‚m@an@VIUamWÅImwU@@a@K„X@JVL„UVmUaVkUa@m„@@Ulmkk°ƒUaVUlKXbVwVIkaVmUk@KVk@a„aW¯m@w„¥laœX@KmaškVmnUl@nxVKšInU@yVaVIV@na°KlxX@@_lmXšUV`VIV™V@„n@lšbn@@WUkValK@²yl@„„VUV@@K°L@KU@@UVaXIVVV@naVkVa@K@UUK@UUa™LWa—w@m@K@UVVƒ@mVUUVKnL„mVL„K‚bVK@UUIk›mI@mUIVK@IUK@VkLƒ@WU@mU@WmUk@ƒI@VƒJk@WwX_@amK@UUWkIƒ„ƒK@LVb@mVmakL@J@bU@Ux@xƒbmI@`ƒIwm@UbmKUaUWa¯UkJWV@XƒJUU¯LUmV@ma@kkamKwƒLUUmWVkkm@aVUUkVKnVVUmXK@UW@km@Ukkm@@W@U™kUy@I@aUUmbƒ¤U@kUmL@bmJU@Ua@wkLWWkL@Uƒ@VaU@ƒLUakKWbkUWVkKkLVLUV@JVbƒz@Vƒ„@ƒVmUU@kVmK¯@VƒU_™VWakVmIUKUaU@@bml@XU@@V@LmKUV„mVUKƒƒKƒbkaUXƒKUL@x@V@l@„mxU¦„V@ŽlL@V@Ln@@VV@„nlKUaV@nLUbmJnL@VWLkbmV„@@L„W‚„XLlx„VVIVV@x@V²blUVm„LVUœK@kWWXUlV@Xl`„LX„l@@VšŽƒn@VnbVš@lVUVUÈVbš@@`UXU`l@@XUVm@kš@xmVknUJVXUbmKULmbx@VlJ@LVbkKUbVLÇUUVƒUVmU@VaUkUKƒVUwmLkUUVVlƒbka™XmwƒKUšVVU@@V±Uk@VWUUm»XamU™bƒKk™`ƒ„™U@UnWW_kKmbUVUVmnUV@„nJVUlšUbU@UV@n@JmI@VmbnVUXlx¯ŽkKmnVV@L@V™bkV™Umm™@Ub¯LmlUƒL@VWLkmkLmmn£WmnKU_mW™š™bnbmxƒ@U¦UJU„@Xmlk¦@‚mnUUm@@Jn@lV„ÔVJnIVW„I@a„ƒÆK@I@aVK„IlŽÞnnl@nl`nbÆX²l@xV„@llbVn²ŽVVl@nn„V@IlW@Un@@kVa°KšnÈmVaVXUlaVƒÈU„VlwôUlynIVašan@lVXb‚Iš@n¥la@Kš_n‚@bÆx@XnJV„nKVz@`VXVšU`@bƒ¦UV@VšIlx„UnV‚K„XÈbšVllšbVbnVn@"],encodeOffsets:[[109126,25684]]}},{type:"Feature",id:"4512",properties:{name:"河池市",cp:[107.8638,24.5819],childNum:11},geometry:{type:"Polygon",coordinates:["@@lLVl„bVV@nXVlI@JVX„mšn„W°b„IVV@‚ln„@nalVUb„nW‚@kVkÒlbVKn²°bUŽlV²@˜X@`nb„aUI@ƒ°wlU@aXJVI@aVK@wUamIXm‚@XUV@@bV@Vm„ImnUUwVaVKXU‚nVK@akƒVwV@nL@UV`n@@X‚lnIUJl@X¦˜V@aUIVm@anƒV@UwnL@VlbVL@KVVXUWƒ„wUUVUka@UVJnUlbnalbVVn@°„„LV`Þ@šXVxV@@bVlUVVbXnWlXnmlš@XXWVXJmbUI@V„llUVkn@@VWV@Vnb„@VXUJVnn`lLVk„a„»lVšLnw@WV@lInw@WnU@U@m‚knUVó„K‚wUmUXUƒU@@wVJVIl@XKVVVbVI„J@Un@lŽVLnm„b@U@Ul@nUš°VUVJnnVJV@„@mVU@ƒ@wkUVwkKWk™yUUkU@alkÈ@lJ@x„Ilƒ@UUWVkUw@Kn@@kmaƒVUl™UUL™ÇƒUUKl@UUmL@aXU@mlUUwmKkUUVKVUƒaƒKUnK@U@Vl@XUWU„KlwX@šb@K‚@XkV@UwWJka@aUwmV@U™@@U@wUm@»kLWVkIWŽXnmV@VkbmKƒLUbk™Va@aƒa@@aVU@aVak£@ƒ±UkVU¯V™UUƒJVƒUIƒ@kxmUmWUbL›w@K@aU@@aVU@Kma@aka@_VWkk@UWVUKULWKULUš@KUnƒwVaUKƒxU@UmaƒL—m@kVmVa@UkƒmI@ƒ@KmIkxU@@K™U@mmakI@VƒLkmWkkJ™_U‚@V@L@n˜xXbšKVb@VVL@V@LUbUlmbU@UUWJUb@VV@@L¯K@LU@UVƒƒk@±z@‚kLUbVl@Xm@™akm@ƒU@UšUJU_™VWŽkn@`W@kw¯LmbU@UJUb@zmV™JULmwk@mVUn™lnb@L›Wkbƒ¦@x°nXŽƒb@bUl@LVlUnlbUJUxWakLUVVb¯„llkn@Vƒ@@nVbUlVbUnƒVUK@IƒW@L@bV@nxÆJnXVbUJm@@bnmJ™nkl@b‚nnK@L„m‚@Xx@VVbV@nb@UVVƒ„¯š@bkV@Vmz@lnLl@kŽVbUVm@mI@Wk™J@UWKkXkl"],encodeOffsets:[[109126,25684]]}},{type:"Feature",id:"4503",properties:{name:"桂林市",cp:[110.5554,25.318],childNum:13},geometry:{type:"Polygon",coordinates:["@@nU@J‚X@`XLm¦Vb`lšVXXWš@VblČnVšŽlanLnmVLšK@_Vaƒ¥@kUa„@VmVb„aV@XVVzlVVK@knKVmX£VKšLlbnš@b@llL@xĊôXaV@°È@¤„bn„V@@Wl_„V„U@W„nVamw„wVbn@„K‚VšLX@VmVUxlV@šnVV_nK@m‚I@Wn@@IšUĊ@@wVWX@@I°VVm@wmU@m@IUƒV™kƒlkUmmkÅV@@aV@@Wn_UKla@kšaV„šlVanb@k„@@KlVn@@aV@nIWW™UUaVU@™kKmwU@UImKk@UU@w@W@‚™k@™UkWƒ@mk_W@Ua@a™ƒƒ@—¯ƒmV£@mƒUUam@—kWakƒVama@UUm@nw@alaUmnUlVlIœV‚™šLVyk£Vm@k@UUJkƒK@kmKUw™KkWK@UXImyVwnI@m‚ƒkUlkUKkUVmƒw@kkJWUÈm@_k@@aƒaW@U„UJUwU@@IWKkƒmUUV@nVl@bVb@bU‚UXƒakw@ƒWUkbkKƒbm@™xUlkLm@@wmKUX@‚™UaVW™XVmU@@UUUƒxkmWXkKkUWaUaUb™L@`UL@LV`UXmK@VmakLVbkL‚xUJUIVbUVVb¯KƒV@Xnl@lVXbmÒnV@L@VWKkVUIWJkIƒŽUamUUbm@U„kU@JUbW@X„WxUam@kbVVUnUJmUUV@bƒU@UUV™@ƒVk@ƒbƒmULV¦U@V„U`VLUL@xVbn@UJ@nWJXXVŽVV@bkxVbUx‚Lšš@x„¦@šU‚lXUVVlULV@@šnŽU„ƒb@xl„nJVnlVknUlVUbmŽU@ƒbVš„x"],encodeOffsets:[[112399,26500]]}},{type:"Feature",id:"4501",properties:{name:"南宁市",cp:[108.479,23.1152],childNum:7},geometry:{type:"Polygon",coordinates:["@@lKnbnU‚@Ua@K„L„ƒlJVX@VnL@bW`Xxl@„I@U„Jl@nV@X‚V@nXV„@lK@UVL@JULVJ@nnJlœVJ@VULaƒLUKƒnmKULVVUŽ@nU„š`lIXlln„K@UlJnb@nšV@LV@lwnJ@L@„nJl„@VUbUn@l˜n„KnbVŽV@„wVLUb„xVm@LV™VKXLVKVLXU@VllUX@`lb@bnb‚L@ŽUV@bV@@b@Lœx‚KVanXVƒUUmVUUUaVUky‚UUa„ImK@mUUVUkKU_@W@UVVVIUW„UVaVU@UUKnƒ@k@al@ll@bnL@b„VUV˜X@Vœ@@b‚Knblmn@V_@aUalL@a@akK@kVKUKlwUUnV¥VmU_VWVIVaX@Va„alńK@LVJnalL@LnK„wlVUw‚mX@VXšƒlLUVnblaUmVUVwXU@Wm¯Va@ÞKnw@w™mšk„»‚UVW²a@_mW@U@I„y„LVUUKW@@™„LX@VUV@@yVU@UV@nwUUmJka@IU@ƒmƒVkaW@UwUX@`ƒ@kLWUk@mƒkUUm@k‚UUWkUƒkWxk@@VƒK@nV@UVaƒUUJmIkVƒ@UamLUbkVmamLka™@ƒ‚kmL¯WI@wJmwƒx@akU@aUKmbkaW_nW@_U@Wm@a@wkwUKmƒk@ƒbkb›w@mKUkkU@J@bW@kVWz@bVUa›VUx@„ULkJWbXVVXƒ`@œmJUVU@@Lk@WbU@UJlnXlm„Vx@Ln@‚b@K„LX„WJUUW@kƒaUVUbmV@nnV@n@lVLƒVmLX‚mXkV±@kxÅL›šUbJWIÅJ@I‚mXalkUamKkškL±aVwKƒUU@mÞnbWJX„m„@lbmKULWUUVkaƒbnn@Vl@VVV@VƒbVbnLWLXJWxXLV@@VV"],encodeOffsets:[[109958,23806]]}},{type:"Feature",id:"4502",properties:{name:"柳州市",cp:[109.3799,24.9774],childNum:7},geometry:{type:"Polygon",coordinates:["@@ƒwU™„aV@nVaUVklmkUUmmIkƒ@w„aVƒm@™U@VKUkVUkWV@™ƒ¥@w™™KVwUalw@aUUUWWXI@mVIm@Ua@wVKUKV_UƒV@U¥VK„n„al@„Uš@VU@V„V@aVUnVVIVmUUlan@VbXwWƒX@Va@IlVVƒn@VanVVb„lJXIVJlUXL@U@KmUnÑWakU@mkƒJUI@mk™@wUmmUV@JXaWIXWmaUIƒJƒkk@W„nJ@„ƒaUak@›kkJ@kUKU_ƒ@myUóWUkm¥kUmL@KUKm@k_UmVa@ƒk@@UmU@mm_—JWIUVUŽWLUlbVUJÇVUIVwƒKUVk@mU@n@lUL@Km@@l@L™VƒzJmUU¤m@UbV²U`U@@¼Vn@x@Vš@@VnUVx@blbXIVxU@Wl@@L™aW@kxƒLXVWVk@@U@VmLVŽ„L„bUVULVV‚lnLVxkV@nWV@bnKVVk@VL„VšÈVKšVVk„Unb@lm@@LVxUlVX@Vk„ƒJ@wkIÇ@kl@blVVVšzXllLUxlV@x@„UV@nƒ‚U@UImmUIUV™¯mVk@@V@VƒamnUKkm@@VƒIUJUaUUWLk@UJUI@xV@V„VWVnxƒLUômVV„@VkVVVUnV@UVkL@VVV@bVxla@bkXVJVn„`nU@bƒb@bVL@VnJ@„l@šV„aU@@_lW@UUU@Unƒlll@XLl@@UX@°bVWVanLlknVV@VVX@VVƒnUŽVLmbXJ@nllXX@`VXƒlmaXVWk@Wkƒw—J@„VL@J‚bnU@bn@@bVKUnVJVIVVVL²a@bV@@Vl@nUVakalmš„UL@VUL@V‚a@mXl@nK@UlK„L@Vl@@nkllb@š„Vnn@‚šnV„™V°l„šVInwlKXxlU°Žn@@ƒ‚I@UnVlakUJWkUK@anUWK@_ÞJ@U"],encodeOffsets:[[112399,26500]]}},{type:"Feature",id:"4514",properties:{name:"崇左市",cp:[107.3364,22.4725],childNum:7},geometry:{type:"Polygon",coordinates:["@@@JVzšl@V@Xn@ll@VlnX@@VWLnŽUVmUULVlUV@blnUlnXVV„K‚xnLlb@lnbU@Vn°KVV„I@WXUlI°VXb‚VVbnLVan@‚x„J@_nJ„a@wVwV@@a@IU@UU@WKXwWIXKmKUa„a@U‚UUUk@@Umm„albVUXVVKnL‚a@knƒWƒXImanÝV@„V‚LUx²blKl™nLVbklWbn@JÆIXJ‚IVaœ™ÆKlw²@lUnWWnK„UUK@k@mmU@mnUVaVU„b@lVXVXIWƒƒK@Lam@@KUwnƒWkkmVIV@Xal@@KV@VUnI@›„_UWWUkam@kkm@ka@mƒk@wkJWIUU@WXkW™XkWWLUUƒ@UakLƒW™XV±VIVWUU@anUWaUK@IU@Vak@@UUKWaƒ@m@ak@@wUkla@mUaUklakwVƒ¯¯@WWUkLkKmaƒ™kLUnV`UxWX@Jkn@bmlƒakkk@ƒb@l¯bm„ƒbJ›b@VXn„bVV@„ƒbƒJUkkKWVU@mœÛVUUW@UVUJWXkVkKmUL@WW@U„Vl@XXKW„XJ@XVlmbUxnnm@UlVnV@XVm¦VJb@šmLkKÇbXblVkn@l@bWnX`V@@IVV@ŽV„V°n@@_naÆVVbUVVbUJnzlVUl‚XkV@Vlx@X„VnxƒbƒKUK@b¯VVUV™L"],encodeOffsets:[[109227,23440]]}},{type:"Feature",id:"4513",properties:{name:"来宾市",cp:[109.7095,23.8403],childNum:6},geometry:{type:"Polygon",coordinates:["@@nVlw„@VJU„„IVVUšV°lU²V@„l¤Ub@bUV@b‚@„b@bUblšVa„KnLla@UnUWmXlJXUlKV@V_U±Van@V£nV‚I„yšU@K@kn@@LVK@k@mnVl@VU„LUxVJÈUVIU‚aVkXKVVUXJ˜In`@nnV@Vl@@„UbVnl`n@VL@LnKlVn¦VlôXV‚nz„@V`VL@llIœll@Vb„b@ƒmIXƒl@„l„IVJnbWXXJWb@IU‚nVVn@xlš@nVJ„I@W„U°LUaVUUaVJVIwlKUalKnb@UnLVWU_@KVK@_šKVa„@VKU¯VLVKn@la„aUkU@maVU„J@k™@Um@XmbkyVaUIUU@KV@laVn@KXKWUkUk@ƒaW™UUVw@aXKmƒVaUUkšmIƒlUU@wUa™xUmmU™¯™U@WƒLUmVIUym@UVmUa@wmw@çm@aWLU„™JUIUamKmL@™aƒx¯¥ƒkU¥U@±„k„UVmKU_mJUbkKm„ƒLÅǙ_@WWUXUmaVUkK™„UWW@nVxkUƒxmL@KkKmbUI@KƒLkƃbUbW@UbUJUXV`UnU¦mŽVVkxVLUL@llL@b@bkKVb@bU`m@knmaL@a›@@U—WVUƒU@amK@akkk@@b@lm„VL@VUVUbƒVVXUJUU@V@XV`lLUVVV@nnLƒJVbVlzUVVbVVnUVVU„"],encodeOffsets:[[111083,24599]]}},{type:"Feature",id:"4509",properties:{name:"玉林市",cp:[110.2148,22.3792],childNum:6},geometry:{type:"Polygon",coordinates:["@@VJUXVVXlWX@V™xVnX@@`ššULWŽUXÅbWK@mULUUmJ@n¯b@l@VULVx„x‚XU`VXXJVI„V@nm`@nUŽVXn@lWVn@b@Jn@nU@Lm`@Xn@WJƒ¦U@@VnL„lV@@Xl`nIlJnkVL„w@KVK@UšaVL@bVKX™lUUKVK@I„VšL„a@U@WšLUlVL@bU@@blb@VlbUxVbXUVJ@xVL„U„lV@VU„bVLnKl„XJ@L‚b@an@VanL@`VLšKV_UWl@U_„a@WVInlVUUUVm@I@W@wVakIWm@U@ƒXwlaVbnI@ƒm»Va@aXaVLšU„»@aVa@k™KkL@KmU@WƒzUK@wU@VWUUVUUKUa@mKmbUK@_nWVaUkVaUaVUVLXKVƒVUVmVI@UkKkLm`UkW@UwWW_„UaU@WakXmK@xUXƒJkƒUUWUk@Wl—mJ@km@@aUKzmyVk„a@kkWVUU¯lmU@@w‚kkmV@Vk@mÅIƒ‚Ukƒaƒ@Ub@m@UUU`mUbWaWmb™X™XKWIXUWm@љ@y@UkIUJUUWLUWƒL@UkVUxW@kaWbKWnXxW¦n„m`XLVlUbVbUx™I@JmLUKUb@VW@@bkL@b@VlU@xkš@L@lƒxXxWXX°V@VVVbUVV@UVVbULVnVJUb²b‚aUb@VVVVInlV@VnXaVUšlI„VUb"],encodeOffsets:[[112478,22872]]}},{type:"Feature",id:"4504",properties:{name:"梧州市",cp:[110.9949,23.5052],childNum:6},geometry:{type:"Polygon",coordinates:["@@VbXblVlLXWln„wVV@VV@UnšWUXVbš‚@VWXa@kVK„UaVaVkšUlyX@Vaƒ—VmUwUaVU@UÈymI@aU°@š™nWV@VaVaw@IV@VmnLVK@kmmna@™„™VbVI@aV@XbW`U„„LUVVx„@VbUV@bl@VLXblJn¦lL„°°@n™@K@UlLnK„a°LWbnJ„¦UÒV„UllLlVnKnbWnn„V`„w‚@@Xa±™n™l@XKV_„WVkVa@kVyUa@wU£UW@UIVW‚@@a—wWaX_WKkVmUULmak@UJUI@±m»™—k@m»VyUIm™nmmwnkUmVaVIUn_mW@»Vk„@VwkmmUXa@IƒaVm—mƒ@Wm_U@mIUWóLmUk@laXmmkUK@UmKULUUmWULƒ@VakU™@Ub@bƒ¼™VUKWb@bUbn¼@„mJUakbWx@„@VXnlJUb@x@X@JUnVVUVmkUJ@XƒbV`k@VXU`™LUK@_mKUbm@@b@„U`@nlV@b„UnbVbn@@`VbUbVV¯bm@@mJXb@bVnUllVXUlbUl@LU¦VVmŽkLVb@b™l@V@XlK@V@nUJUz„°mŽwmLmlXbWVU@UUUlƒIU@VVmV@@¦‚bXbWxX„WlXVWL@LUmkbU@@LVVVJUblzna@WVnš@@lƒIUVnbV@Vlƒbkbm@ULUKV°ULƒ@"],encodeOffsets:[[112973,24863]]}},{type:"Feature",id:"4511",properties:{name:"贺州市",cp:[111.3135,24.4006],childNum:4},geometry:{type:"Polygon",coordinates:["@@nL@xn@lKVkšwn@„alLlaXV@„lx„bVWV@aUa@aUk@mVUnVl„XL@JV@VxVIVƒX@„b@bl@@`ÇnXVlI@l„xUnlVVLkllV„@nmJUxnzWJ@VXLlŽšLVxnL@l„LlŽVI@V@lUnl¤Uz™Kš@„Vl@š„L‚l„Lnš‚b@VnVVU@k„a‚Knxn@VkVJ@ńUlakmWIUaVanm@_UK@UVWUa@klXam™U@Vmƒ™VIXW„@lUVknVlKVLXŽVXšW@b@VlšnnVL@KXL‚Kn@lb@UnW°@Va„X„WVb°aVa@I¯aUkUaVKVwƒaXk@a„a‚™@wkm@alanUVw@alK@Umkw@UƒaUmU@WXUaUK@UW@UaVWI@¥Xa@w@WWšVƒXwƒU@mKUXUWVU@a¯kl@akU@UULmK¯VUVW@U_m`U@@xVbUz@lUbUlƒXU`WLk@mš²šWb@Ž@ƒxU_mƒXmmamLkUkKVkUƒVу¥mIXa¯KƒbmLkK@V@Lmš¯@ƒ¯kKm¥kIWaUKk@@aVUUaƒ@UwVUƒKVƒX_WaU@@bUJUaƒš@šmbnn@lULmKUnU@@J‚xUbUbU@mX™š¯@VŽ@bnJÇz@VUVVbVxUn„˜UbW@kz™VUlUbVbƒŽUL@lWb"],encodeOffsets:[[113220,24947]]}},{type:"Feature",id:"4507",properties:{name:"钦州市",cp:[109.0283,22.0935],childNum:3},geometry:{type:"Polygon",coordinates:["@@@IlVVlnL‚@œxla„al@n„VLlx@x@bXnV@@`mXX`lbnaVL@blV@b„wnx‚I@xXJ°nK‚l„š@lbnKnblUVanKVb„@lUnJVI„VUb@V‚U@m„L@Ul@Xw„llVVXV@lVnlVn„l@XVlK„@@_VWVxX@lb„U„nV@@JlbnIlmnVV@UwVK@U@k°a@mnIVVVK@nXLÆaVWXVK™™@_W@Umšw@UXWWkUUVWUIVaƒUkJ™UVWbUmU@mkUJUU@UVab±aVaUIUmVKUaVUU@VUUaUUU@W¯XWWw„w@k@Kl™@wkV@U@alK@aX@@UmIUWUIƒ@mmkXU`U_WJUnUJmUk@@amLU@UVW@UkU@@VƒbUWVUk@@wmKkUWLUWX@JmIƒlUkkKWKkLWU@UKWa@bU@@a@_UKWƒUUUmJmw@nV_@ġğKóLmbU¼VÆ@xUXƒ@Um@wklVnUn›lkaUV@„lV²WVklWXXbWlkVkIm`UUƒLƒUU@UWƒx@XU@@lWLU@kbUbV`UXllUV@bmb@LnKVbULm‚šnVVIV`X@"],encodeOffsets:[[110881,22742]]}},{type:"Feature",id:"4508",properties:{name:"贵港市",cp:[109.9402,23.3459],childNum:3},geometry:{type:"Polygon",coordinates:["@@n@VzUJ‚nVŽ„K@XšVš°nVVnšwVb@xVV„knJl™VVUbn„WL@bUxVVXš„bl@lVXkWƒXwWaa@¥‚@nUUUV@„JVkVVV@XUWanknK‚xnƒ¯VyVI@m@UkL@W@Ušk@aUalKnUUV¥@KVkkaWVkUVkUm@aWanI@n@°aUUVaUa@_m@UamaƒV@akU@mV_@ƒa@KWIkƒmLUKƒaUVU@ƒkƒVUK@wUIWVUaVwka@Uka@aV@@aUKVk™K@X@Vƒb™KƒU@JULVLkVWšUL@aUK™b@VUL@LƒxUKmlkImJk_@WU@ƒkmK@UV@„¥XIm@@Wn_@KmVm@@I@aUmkXm@UWV@mn_@mƒUUJWIUWV_WƒwU@mUknVVmxU@@VUV@zU@UVW@ƒK@šX@VLUVƒKƒz@J@VnX@`±bUXVƒ¼™lšn@xmxÝL@‚Ubn°@XWVUxUVVnkbWVXV@Xš`ÆȄKnƒlLVanIV`nLVUlƒ²ƒV@V¦„l°¦„w‚b@šnKnLVbVJšIVƒXK@b‚n@ènx@xVbUnV‚"],encodeOffsets:[[112568,24255]]}},{type:"Feature",id:"4506",properties:{name:"防城港市",cp:[108.0505,21.9287],childNum:3},geometry:{type:"Polygon",coordinates:["@@XV@X°°U„lxkbVlVb@nkbVl@xl@@b@n„‚XbVL@Vl@UbV@@JVLXbmV@bVVUXUJU²šW„XlKVb„@VVXKlXšWlXXWV@VXJlI@x„l@nlbn@lln@lbXalIVK@ƒVwœUVb‚U@aXylUX@@aW@U_UJmU™nVKUamL@Kna@aVUkkVWU_ValaV@XK@kV@@W„wVXV@„V„KVVn_lJlUXkWaXWlkXU‚±kU@ƒVUlbœkVmUmlk™¯Ý™™W@mb@¦VxULm™kJUU@ma¯wƒmkX@VóJ±bUVUXÝWk™lWXXlƒxUaƒbƒIğ™Ç@U@mVUKkkm@UJm@XnWV@x"],encodeOffsets:[[110070,22174]]}},{type:"Feature",id:"4505",properties:{name:"北海市",cp:[109.314,21.6211],childNum:2},geometry:{type:"Polygon",coordinates:["@@VaVLnK@IšJVwUaVaUkWKn_mƒX¥WwXm‚LXalbU£UyV„Å@ݙwm@™°l›LÅUƒmk™mwÛaƑLÝUUm@ȣƃV_„Ó@£UƒƒUVƒ„™¼U°W̄™ÞVbXbôx@b@bmV@ǃ™UÝ@@ĢU`m@ŽnxnIVV‚VX„VL@`@bV@@aXbVL‚@XVlKXLlLVl„knJ@I‚WVXXKlVnL@xl@UVVX„a@UV@VlX@VUV@nK@bl@nVVIVmXIV`V_lWnn„@VJVXnJ"],encodeOffsets:[[112242,22444]]}}],UTF8Encoding:!0} +}),define("echarts/util/mapData/geoJson/gui_zhou_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"5203",properties:{name:"遵义市",cp:[106.908,28.1744],childNum:14},geometry:{type:"MultiPolygon",coordinates:[["@@@UnUlJn„w‚JU°VL@bnVšU„wlJ@XƒŽXVlU@klVUJknl„UllL@bUJ@xULUlƒ„UblVkblbnw‚UXmla@„wV@VK@L@UXaVKVLXWƒUVa@U@Im@@W@£UKUakKWIXU@al@@llUnL@W@Un@@VlUV@VIUanKl@Xb@lmxVb@b°bb@nlJVVnnJ@b@L‚V@ln„@LmV@Vx@blnVK„nlJXIlw„J@҄b@nlK@Un@UL@VVVVUUUVK„l„@VUVL„J@UVUUw„@Wm@™„UV„ÈVlbUb@JšLlŽX@@x„„ƒLmŽk@@nlx@bUJUzVJ„@@LVxUV@bWxnLnVVK@_‚K²xVbV@n¥@aVI@b„@l@Va„Knb@n‚`n„mmý„W@ƒU_šwV@VlVV@Vn@n„˜@nI@Jn@°¦VaUU@™„mVVWVaUńU@aVKnƒVbVUmmU@a@kUw™m@aUUmUUJ¯lakU‚aXaWUUaVƒkk„amkmUnVlULƒVlJ@XU@UJWUUw„k@aU@WbkWƒL@U@WU@@XUKmV@aUVwUĕUJUamUUVUÑm™nIVJ@kl@XalJVn@KVLœ¥@UWIXWmU@mVUKnUWLUKUaWUUKVU@U@anUny@UlUkK@w@a@aVUƒ»UkVw@Wmk—JƒÅmUUVmwXalLXWWUnam@XkƒJ@UVU@U@W„@@U@I@Wl@Ènlw@KXLWb„lVUkalKUU„VVaV@@wnIlaUmkUƒKWU@KkUkLWaƒKUUWUn@VƒK@LnnWJUIƒVkUWVnV@V™@@XƒK@VUIUJ@IWJkX@VVJ™IƒVkK@I@UVaUWk@m„@wnUWKk@mxk@@„lV@b„xmb@x@VUmLkUƒJ@nVV@b@VkLVbU`¯I›l@™U_UW@UU@™™ƒK¯wm@™xƒL¯¥kIƒ™ƒ‚@bkbƒ@Ua@ƒm@kkW@XVbmV@ŽkV@bWbUbV@„¦ƒxXlmVk@ƒ¦™bkaWL@KUImK@wUK@VUI™b@bmK@LÅy@akXW@kbWlXblL@ŽULUbƒ`@U™kUymX¯@mšUJUUJƒL@Lm@@WX@lU„VlšXll„@l@Èk°V°Ž„X@VU@UVll@XUJVXUVm@@VXLWlnV@Xƒšk@mVULnxV@@bm‚kL@VWLUbU@UVm@ƒb@ķ¥UnmJ@UUVƒkkJUšlÔU`UIW@ƒ°kLUlUI@WVI™U@mWKkXk@ƒ‚WU@bXšW„@J@xX@l@LVl@xšLVxXX@x‚KnxVknb‚KVV@U„L„WlXU`@nUlšX@llVXšVU„KlkUKlI@anKVLXKVaUIVWV_VK@VnLlU„»VKVL„m"],["@@@KlKkUUVVX"]],encodeOffsets:[[[108799,29239]],[[110532,27822]]]}},{type:"Feature",id:"5226",properties:{name:"黔东南苗族侗族自治州",cp:[108.4241,26.4166],childNum:17},geometry:{type:"MultiPolygon",coordinates:[["@@VV@XkV@bUbWJU¼Vb@Vnb@bš„@J@bƒL@LV@UVƒlUI@a™KULVb@bkJmx„šlLVxknVJk„‚xnKmnnL@bn`WIXlWLU@UxVbUVmKV„XI@JVIVJ@U„L@Wš@@UmUXUlV„UVJXImm@K„L@UVmVXV‚„LXblKlV@LXV„LlVVnkbmJ@xnXl@šbXa‚@Vana„ÒšL„m‚VnIl‚Þ¦°k@b„@@lV„nJlUnš‚VX_„@lVlK„šV„UUxVLVWVIXJšUlnnWlI@KUaUUVKn@VaVXV@na@ƒmw¯@mUkJUamI@lk@@am@@I„ƒUmVImUUw˜™@anUVaUU@LU@WaWUXWW„wV@VwnU@L@ynbl@@X@a„J@nW@@Vn@„lVLlxnI„lš@@UWKUƒnIlJXIVllIVVš¼XK@aVI„V‚@@bn@VKXLVKVVVInw„J@UWI@mX@WKnI@KmU„UVJUL@V„KW@@k„@aU@@W@InJWUXwWI@Wƒ@¯wkaVaUIl@nŽValIXWWI@UUm@anwWkXWWIUbk@UJmIUamKVUUUVVama¯VkIVVUlKnXVwX@@WVaUUVa@IlƒaVmƒkna›wk™UU@ƒU@mUVƒšUVwœl°LVbnJVU™¯la@mX@@UWKXU@aV_V@@JlkUƒ¯@V™nK@km¯k„U@ƒWUW@mmƒU@™kmlU@wkL@WƒUkL@VmLƒJ@b@V@bknUUVK@UVKUK@Uk@Wa@LUVVnUbmVk@@UU@@aƒV¯K@U@UU@WmUL@aU@WV—w@ƒ˜I„xXll@UX‚K@KXXVJna@wWaƒ£naUKV„m@UU@mUmalm@@XkVm@U@VƒLmWU@kkWxU@@bVV@VkXVlƒVƒ@UUk@@ƒmI@KUw„m@UmVƒUUwU@lwkV@IUa@mUaVIVKVa@w@U@™UJkb@n@bmJ@XmlVUxWXkJmUkUUVW™xUlU@ƒaULUšmbU@@‚WXkmƒL@xUV@nUxÇm@„XLWbnlƒnV‚nnUV˜U‚nVVz„@lbUVVlULVb@V@nUJkwm@Ux@bWbUK@UULka›JbƒU™U@U@lUK@XUJmn™J@bU@UwWa™x@zkJWnUJUUVšVV@bXn@xVb@J™L™m@X™w@`@bkb@VmXUV¯L@mW@@n@V@‚ƒL@K—IW@@aƒaUx¯@U„m@XbW@@L„V@bnVWVkKUzlV@bÆa@lnI@VV@@LnVVKUaV_VJVbnU@bn@‚‚nX@yVIVxXKVLlUVaXU°J","@@@KlKkUUVVX"],["@@UUVUkUmV@ln@VXVK@K"]],encodeOffsets:[[[110318,27214],[110532,27822]],[[112219,27394]]]}},{type:"Feature",id:"5224",properties:{name:"毕节地区",cp:[105.1611,27.0648],childNum:8},geometry:{type:"Polygon",coordinates:["@@UkVƒ@k‚W@Xn@@K„KVIVVIn™°@nWVzšl@V„_VaVK@kKWaXklaX@lW@bÆz@KnL@ašaVJ@UVL@xnLVJ@LXKlbša„¥l@nUWk„wƒ¥U@VaXa@amLkUƒKmƒ¯kƒmkIUaƒKUIWƒkKm@anw@mlwXIƒmƒUk¯@a@amUƒ`kkKWVkxmUUak_mJmw@w„mXUW¯X›_@WnI@aVwkWWýŃU@WLkU™aUbVV@lUVVnm@kUmV¯™kK™LƒwmVUUaWV™aaWw¯wƒÈ@VULUVUUƒK@nWJkI™l@Umxnbm@kbUJƒa¯bUbVxmLUV™aU@VUUWxkVVV@bUV@XWbnlUbƒbUJlbUV¯b@z„`WbXnmbƒaƒwUwVWUƒbUxmbU@Uam™@Vƒk™VaƒwVaUƒWI@mUKóz@lUlÅ@WIƒb@xXxml@XklULWKUmwUa¯KUXWJkaULmKkLWbkKUVƒImƒƒWa@kUaULƒW¯LƒK¯@kbƒL@b™x@J@bmnnlUšlzU`U@@Uƒb@„m‚n¦°bU„Vx@bkVm¼mx@mk™mVV@bkxVn„aVV@bU@mL@b²`lIVV@lXLlš„bVxn@@bl@XllIVšnbVšn°°wlbXw@mVa°lVnU@mš™VLVbn@@b„@@WVnUV@Xlxn`VznJVb@L@bV`V@šUnwšU„@WUXKV@UUlmUUlaXalLšm„bšIVbnJVIlVVaUUnWVXn‚VL‚k@ƒnWnblnlb²x„xVKVXlVXLVW„LlUVJna@wVL„¼@JVX@`@nnx@nWJU@Vx@XXKšŽUblxUš°„LVKVVlL@KnbVUnJ„IlUšƒnKl£VW„x„IlJ@nšVÞUVVnb‚VX@V_°lnK","@@@UmWUwkU@Um@@VkL@V@„„‚V„VkV@nbVa@ƒ"],encodeOffsets:[[108552,28412],[107213,27445]]}},{type:"Feature",id:"5227",properties:{name:"黔南布依族苗族自治州",cp:[107.2485,25.8398],childNum:12},geometry:{type:"Polygon",coordinates:["@@‚V@IöalK@UV@@KUaVIVVœLlaVbVWnX@‚@LnUlxl@naVLXVVaVU„J@lUUanWWI„@VlV@Xbƒb@V„n@VmVVbk@kU@V›V@X„J@zn`ULW@kK@_WVUK@LUb@Jlxn@nnWlU@@b„x@XVVU@UbVb‚@n`VI@VVLUlUIUV@KmL@VV@XIV@@lVLVmXV„@WLXLW@U`šnkb@Vl@UL@VVV„L„llX@`lIXb„J˜IXW„L‚aVL@ŽXXW‚Ģ™b@bmK@L@°@Vnxmxšn„K@xVn@VkL@V™Lƒakbl`VnnxVnUlššV@@VVXV`@šœk°JV_UalK@U@aUU@m„IlVnK‚V@U@wnaƒw@akU@ƒl@nwl@XLmV@xnƒl@VXUb@V@JlL„UšJUI@UlWUƒnLVUUaVwV@XKWkXJm_@amKnmmLwlƒUIlmUwkKƒ™nwlI@aUaVKšL@bVJ„kVUU@@K„K@a@I™ƒ@ama@UUaV»XIVa@alU@WUU¯IWVUbkVUKWLUwUJ@zmWm@@amVUaUIU`VbULmU@KU@@UmJ@kÅb@akUVylLXUmU@aƒU@KX@Wan@Vƒ°@Vw„b@bX@˜J@L„K@@U@mX@@n°KVUnW@Ula@a@_šx@WšnšK@IUa@wWm@aUUU™VVVIXmlI@yšwXbVxV@@ašInmVI@WVL@k@VšV„V‚aœIlbVK@VVLXa@aVwn@lxVI@m@UUaVKUkVUkaƒ@UymUV—VUmmU„mmkXaWK@ƒÈnVw@mVU@w„KlnXW@V@naV™VKUk@KVIUWƒ@mk@KXU@Um@@lVƒk@UVJna@UWaƒL@a@ƒXa@kmmVUUk@mkkƒamJ—ImJUUmIm±aUUkambkamVUU@VlbUbVVƒxX„WVUU@VUakU@UmUV‚U@mnUVVnUbVJ@b—UW¥kLVamVkUaWJU_UVWKk@@nl„UVVJUXm@Vm@UnVlmbnmJUbULU@@UUKWVIWxnJVb@xUL@bUJWIkxƒbkb@xVJƒbmU@kW±LkKUkVa@a¯am¥ULkalÑlKXUWƒXƒaVakImVƒ@ka@UUƒJ¯aƒX™mmb—KWU@wUUƒaUa™KmU@UXlWb—¼WLUKUb°„UlVbkbVL@VƒšƒJ@nVlUbUXmJ@VX@lbUbU@@bWb@VnLVJ@bVVUz„ŽVL@lnL@b™VVVULmKUk™Jkbm@ƒxVb@V—kƒKVnnV@b@ŽWXU‚„nV„l‚VVXVJUXlVXbWV@VU@Ubk@@KWbUUmL@JnXV°XJ@_‚`UbkXVVlÆkbƒ@VLXVV@‚V@k„KXX@`V@@n"],encodeOffsets:[[108912,26905]]}},{type:"Feature",id:"5222",properties:{name:"铜仁地区",cp:[108.6218,28.0096],childNum:10},geometry:{type:"Polygon",coordinates:["@@°a@aÈbVUlU@aVKnVV„VUlyX¹lWVa@U™VƒnUVU@m™@mUl@„mÞw„@‚xnIVbna@KVI‚J@kwV¥ƒUXÇVkVW@kkKWU@aXUWmnIVa°VXbmL@VVbnVVVUb™VbšJVbVKXkVKVanU@aWnWUWa@U™nk@mVIVK@wXxlLXbVJVlKœbl@VI@mšaXalVV„VbX@@ašalnkx@b@V‚b@Vnx@bVVUXn¤WXn@Vl@Vlzn@š`@I@KUU@ƒV£namVkXa@aVK‚nnU@anVlKƒa@UUU@amk@»kƒU¯@aš„VWnkWmkImU@akaVm@»VUV@UKnkW¯XWlkUKnIWaš@nmlIXmWUnwUwWm@wULmaUJkIUaƒaWa—klwkwmJmU@bkJ@XUJ¯W@XbWbUKUkWJUUVKnn@UmmXUWa@mU@@UI@WmXVykwm@kaULWwU@¯ƒlKUUVU@mU@UkmaUbmV@b—š‚xVnVUJVnƒ„@Jn@@bl@@knJVblInV°@nx@„mbU@UWUbm@ULVVVb@LkJmXkm™VWIUJUXUKVwƒV™UƒŽkLkUƒ@W`Um™kVmIUƒ@kƒ@@a¯lÝ¥kmJUƒn™KƒÑmbUb@Wb™ak@mWU@UbƒUVVkLlbUVƒkXaWK@LkxÇmk@@X@J@Vƒ@@X@VUV@V„IWln@mbXVWXkKWbnxVUnV„ƘInl@XUxVl„¼UV@b@b@xlLkV@VmzmV@b@VUVVLXVVbVLXKmVVLU‚@nnVWXXJ@V›¦UK@LUmkIWbk@@lUImJnšVÒVUnVVbVIVĖUxV‚@bnUVL@WV@@X@V„KlXXaV@@bƒlVxXVVIV@@WkI„UVKUkVmlnnŽƒbllU„VbXVWbblVkb°ŽVInVVV@bšnVx@l@bnVVnUŽUam„UL@bƒVVÆUbUXU‚ƒn@šVVUb"],encodeOffsets:[[110667,29785]]}},{type:"Feature",id:"5223",properties:{name:"黔西南布依族苗族自治州",cp:[105.5347,25.3949],childNum:8},geometry:{type:"Polygon",coordinates:["@@VL@Vl@@IXW@kVUVbnW@XlKVVnU„VlL@b„aVbƒb@xX‚°ÔUxV@kbm@VxkxWJœ„V¦ƒŽ@ÈnšVKšxWXJmV@n„Ò@xVbn@@blLk`VX@bššla²JVUlnn@U±lw@wnw@mlwVIX@@m@klKnk‚a„KnwmmXkƍVm„Uš¥l@nb°n@„aVwVmVIVnI@a„¯@mšU°ƒl@@VnI@JV@UV@b@IUbVJmXöºƒzllUbVa@aXUl@„U@llLnKVaUa@UmK@UšwV„bnKV@VwVK@UXƒV@Vbn@‚w@U„WnX‚@„a@m„I„™@UUKlaUaVk¯ƒVaVLXK˜»XaWk¯mƒkğwmW@mIƒVkwƒJUIšÇVwU™UkVKkƒm@UkmU@WÅwm£Vƒ„m¤¯IkJWa™_™lUbmJzÝJk„ƒUÇVU„ƒ‚@bU„Ýn™m¯LUb@`mL@VkL@VƒUmmk@UU±Umka@kUƒ@ķymUkk@mmkÝmUaUakImV@V@VÅLƒ¦ƒJUXmJXšWb@n°Æœx‚¼nV@LlbUŽUbmL¯@ÞbV¤nbVx@bUVlblIœ™@KVVUnVJUn@VlLUlmLUUUxmK@I@@VW@@bU@UJmUkLVVUl@b@V"],encodeOffsets:[[107157,25965]]}},{type:"Feature",id:"5202",properties:{name:"六盘水市",cp:[104.7546,26.0925],childNum:5},geometry:{type:"MultiPolygon",coordinates:[["@@ôyVL@nXJV„Ub„x‚bUŽlšU„@ŽšnŽVbV@naVw„a‚VUXVx„x„bnaWmXaƒ_@y°aVUkaVI„aVamkXa@WVU@aUUlUXwVV@UVšbVUnKUwVa°a„bVIlan@manw@VšklJXI@m„LVVVUVK@U„ǃk@KUa@UkaVU@UVWV_XWVXVWlLXKlLXaÆKšwVL@akKm@Uwƒ@@XUVk@VUI@wWK@aUV™I@UkK@ƒmL™Wƒ@kImJƒUÅVmkXUW@UJkx@nmx@xkxV²m@kmUV±Ikb™™@aUWl_kK@am@Ua@wƒÑ@mnUWIX™wULm™@DŽU¥›ƒXIlwUwn@laU@Vw¯ÓW@w„aUaƒb@akKƒUmVUUkL@WmXUaUV@lWX@Jk@@UUKULmLUJmzkKmVX°VšUnWKUL™ƒƒL@mU@UnVJ@b@„UV@Xƒ`m_@l@@bmbXJmnnš@°˜wnn@ŽVLX@V‚@nVl@nk@@b‚l@nn°WlXzW`XXVKnUlxVbUb@‚V„Xb@Ž‚VxÈbVlnbmn@ŽkVUL@„ƒŽmLUVVL"],["@@@ƒ@UmWUwkU@Um@@VkL@V@„„‚@„V@VkV@nbVa"]],encodeOffsets:[[[107089,27181]],[[107213,27479]]]}},{type:"Feature",id:"5204",properties:{name:"安顺市",cp:[105.9082,25.9882],childNum:6},geometry:{type:"Polygon",coordinates:["@@lL@bUK™xÅLWbkKWLkKUXUWWXU`UX@VUVlb@VVb@L„l°xXx‚bšbXUVb‚VnU„xšKlL°šnUlVn@UmVU@kUUVašblVXKV@ƄXþlXUxnU@mVK@_@ml@UU„@šblU@KnLVyUw„@@UmkšWVw@UVK@VXzVK@n„VVUUW@kVJnlaš@nKW™kaWL@U—™õb@JU@mU@@_WWƒL@lUU@WUUK„@lakÅUUlWVa_@`WIU¯mW@InKVVXa@Ll@VaV@@UXUWakUVWUIUW‚UkUƒƒmVXW@@amUUm„L˜l@UUa„wn@lašIVlnLVKUUšU@amK@kUKƒVyUU@aUImK@UXa@aV@VakaW@@UnIVWVaUkƒb@mWƒX@Vxm@UaU@W„@VULUxU@mLƒaUŽ™x@VnL@VVbUbmLkK@kƒVk@WV@bUbVakk„yõ¹nWUIVa@J@aVUU@@ImJ@Uk@¯„™V@nƒ°@bmJUUJUnUxƒbm@¯Žmak@™¦ƒVUnŎWlnnmxƒLbmlkL@l@nWVnlÆU„VnIlJ„@šXnK@„lL@VšJVU@bXL@xVJUl@VU@W„@Vxn@"],encodeOffsets:[[108237,26792]]}},{type:"Feature",id:"5201",properties:{name:"贵阳市",cp:[106.6992,26.7682],childNum:5},geometry:{type:"Polygon",coordinates:["@@nŽlLX„VJ„LVblJ„n°ln„„LlVnKlU@nUUa@WlX@l„n@‚Vb„@la@a„„šlJ°¦„Kšwn@°x„LVkUmmwUmk_la„bšK@UlK@UUm@wƒL™mnwmw@U@¯@KnL@aša‚ġXWW@UKbƒKWX—JƒIWakJ@_kWƒkƒKUU@UVKk@@Ula™mV_X@WKXKƒ@WUUnUK@kU@WJU@@UnK@LVUVJVkUK@UUJm_@UaVaV@UU@Wƒw@aV@Xkmmm@kw@IVa@KVLXU@`lLX@VKm_@yƒI@WœU@UlVl@UanU@Uƒm@U„aWaU@Ukƒ@XJmXVbkV@ŽƒIUVUbWUUKmbk@kwmV@K@mWUXUakb›KUUUJVb@LU@@VkL˜š@VXKlbXšmL™@kbm‚UI@lVXUVƒU@mULWy@UUL@VUx™Xnl@Vƒ@VxUzmK@LkV™aƒ@VVk@@n@`UL@nmV@bmJ@Xœ`WX°WVƒn@xnxnIl`VbnVlwXUlLl‚„_nV@b@bl°„V„nWJkx@nmx@b"],encodeOffsets:[[108945,27760]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/hai_nan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"469003",properties:{name:"儋州市",cp:[109.3291,19.5653],childNum:1},geometry:{type:"Polygon",coordinates:["@@஼jpnr’``ŽpRVHʘ̤žZt^JÖA˜[†CâlTébQhRPOhMBcRSQiROE[FYdGNOEIH]MgEAMLLIAG_WMCSL@ED]PCLYC[ZIHgjSxJTMbHNEFCMEE_HSDFHSLECRNSFDRICHNADGPI\\RZGIJTIAHLDQOHG`GTNCOIC@eIGDWHIS[kiE[FMbECZS@KKS[FDWsCeRuU_DUQNOE[LKGUBM¨EDQP@HWHGDImXƒCog_~‹I_fGDG|QDUWKBC\\ore|}[KLsISBHVXHCN`lNdQLOnFJSXcUEJMCKSHOUMDIm_‹DI`kNDIGEYFM\\YPEEIPMSGLIKOVAU_EBGQ@CIk`WGGDUM_XcIOLCJphHT_NCISG_R@V]\\OjSGAQSAKF]@q^mGFKSW^cQUC[]T}SGD@^_ˆaRUTO@OHATŸ”"],encodeOffsets:[[111506,20018]]}},{type:"Feature",id:"469005",properties:{name:"文昌市",cp:[110.8905,19.7823],childNum:1},geometry:{type:"Polygon",coordinates:["@@€hIJ¤Ī¯LQDaFßL[VQìw€G‚F~Z^Ab[€¹ZYöpFº lN®D´INQQk]U‘[GSU©S_­c‹}aoSiA£cŁ¡©EiQeU­qWoESKSSOmwŸćõWkàmJMAAMMCWHGoM]gA[FGZLZCTURFNBncVOXCdGB@TSbk\\gDOKMNKWQHIvXDJ\\VDTXPERHJMFNj@OwX@LOTGzL^GHN^@RPHPE^KTDhhtBjZL[Pg@MNGLEdHV[HbRb@JHEV_NKLBRTPZhERHJcH^HDRlZJOPGdDJPOpXTETaV[GOZXTARQTRLBLWDa^QAF`ENUPBP…\\Eji`yºEvåà"],encodeOffsets:[[113115,20665]]}},{type:"Feature",id:"469033",properties:{name:"乐东黎族自治县",cp:[109.0283,18.6301],childNum:1},geometry:{type:"Polygon",coordinates:["@@ªVLP`@PEdNRAHOPEAKHEVL`GZBJfvdTAXNNTZJFPrHHNpKTD\\ILHbEVd^J‚OHLh@NNBnHP`\\xH@NBRLJTlŽNv_^CTLd@bNDVFbxdFV€UPBTKOGEOUO@OEBXQP[H_EI\\EbeYa@UO_J‹MEJ_IEDKJUGMDcNUd_FMTEJSGoZ]EIYGO[YW‘gEQ]a@WHEDQKUSDUGAbYBUpSCYNiWqOSQEoF[UcQISWWNMSDe_cLQ_UBiKQOOASQAWgS­ā]ZaŽSPÝZ]XMXSŒ[^oVËNgNKlE RôEø"],encodeOffsets:[[111263,19164]]}},{type:"Feature",id:"4602",properties:{name:"三亚市",cp:[109.3716,18.3698],childNum:1},geometry:{type:"Polygon",coordinates:["@@®ĂhTBXTRPBRPjLVAR`dKf`TC‚NXMTXRJVdE\\FpTRrPjXZMTDVoZABaVHTCLVCRGF@X^bFR’hZXP\\ZHHMA[^wBWXJlW¤EJ[bCTOF‹WWMm@ILMGWQ@DQ^QNWFSHEbF`OXNbO„VNKTEPDTLTCCVTREfvfEHNbRAENH^RJXCFHNFRpVGHWISDOTMVCZeGamaLoLÛD¹¹ėgsia{OųE—Tt‰lɂwr}jŸR±E{L}j]HąKÃT[P"],encodeOffsets:[[111547,18737]]}},{type:"Feature",id:"469036",properties:{name:"琼中黎族苗族自治县",cp:[109.8413,19.0736],childNum:1},geometry:{type:"Polygon",coordinates:["@@bRFnHNbHŒgN@NPEnbXP@bND`NT\\@\\QZb@`@J]V@XhžDpW„nCJGHGXO@CR§FANHVKLF\\MPVR`CvVfQtDPKpGHG@S`WJP~^dSTHWX\\RHTFACQTIAUPOU@MG__IaYSFQK‘NSbORHXCZeTFJg„B`YBMNMFi~IVDV[tGJWXGDQRGF]ˆJrALgESLSAYDGIaFeXQLS\\MKSLSQYJY}eKO[EHiGSaK[Yw[bmdURgEK^_kcSGEOHKIAS]aFSU@Y]IWFUTYlkP_CUOUEkmYbSQK@EMWUuAU\\M@EpK^_ZMDQ^OXwC_ZODBrERURGVVZ\\DTXcFWNIAWJWAYUUFYEWLQQaCIZeDM`cLKRGpanJZQd"],encodeOffsets:[[112153,19488]]}},{type:"Feature",id:"469007",properties:{name:"东方市",cp:[108.8498,19.0414],childNum:1},geometry:{type:"Polygon",coordinates:["@@ºŸx‹JYZQ”IŠYXLl@dR\\WZEn]bA\\S~F`KXaDeTiNO^EEKWEDQXITBXaWaDQMUJOIaTWf@NJV@dSxGZ‰Fu_@WMKAUˆ}AQ@MwG_[GOAmMMg@GKP]IUcaFKG[JSCoLGMqGEOYIMSWMSBucIeYA_HUKGFBLOFGPQBcMOF_@KO©UAtERadwZQ\\@ÊJÒgòUĪRlR°KĮVŽLJ"],encodeOffsets:[[111208,19833]]}},{type:"Feature",id:"4601",properties:{name:"海口市",cp:[110.3893,19.8516],childNum:1},geometry:{type:"Polygon",coordinates:["@@ńZƂtĢ¬æßFuz¹j_Fi†[AOVOFME_RBb]XCAKQKRSBQWSPY\\HbUFSWSPoIOcCOHIPkYCQ]GdGGIFQYgSOAQLK`MFUIGa@aQ\\GGUFcHKNMh@\\OYKAigsCgLSF]GOQO]@GM]HyKSHKPW@Pxi@EMINYREXWRQ@MQcFGWIAwXGRH\\yDI`KJIdOCGRNPNtd\\UTMbQYi@]JeYOWaL[EcICMUJqWGDNZEXGJWFEXNbZRELFV]XQbAZFrYVUBCLNFCHmJaMIDDHXHEhQNXZ_TARFHVB@DTQIRR@YHAJVnAbKFUEMLd\\c^ÍÞ"],encodeOffsets:[[112711,20572]]}},{type:"Feature",id:"469006",properties:{name:"万宁市",cp:[110.3137,18.8388],childNum:1},geometry:{type:"Polygon",coordinates:["@@^J@ZTVbET^JBGLFPTHld]`FLQhcVanx\\\\ZbLHTGj\\FLP~fIZRZPVTQFSVAFJE^NDLEE[~LjsxVTG\\NZZNGlLRRGLJTV@hPZANN^@T\\NEPPbDZXO`d^HSvcJDIV\\XZAJUFCLNP@PQ¤@[ïKLÑIÏ]ÇE±I{uƒ­YśUćFcYUmsVeBSVgB[RO@aYYPO^]@UVaNeDShMLG\\EfFVE\\F`"],encodeOffsets:[[112657,19182]]}},{type:"Feature",id:"469027",properties:{name:"澄迈县",cp:[109.9937,19.7314],childNum:1},geometry:{type:"Polygon",coordinates:["@@T\\GJCXJH@fJDDPNCNJENN^NLHBNSx@DDYbBLLDRbjZTj@`XXTlG^Xr@PJLW\\WLTlWR@HDJTD@X_PO@STMDNTMVV@NLDM`M\\XM\\JNBH[PYZ‡úYzŸ`Ċ\\ÎÝd]c[NKVFLEBaUmBIZGQ@JQSR@CUAEGBQ`SWYRMFgWGCGJCbNnIDGMEDKVAZUEqBYRa^WEUFKYQMaFWXEHIFWMYHCrXVIIiaK@aMCUYNSIISTwXALKH@XWXIEIJQCG[IEQDE_XSBaa[AIPW@]RS[FWS[CD]PEBYNGFSaSyJG]@ugEUDQlGHiBKHUIoNSKqHFaPMICK]UUHIPDJMuCA[SCPIDIOILGAEmU[POPBVSJDREBGS[QXWSGcT}]IO_X@TGHoHOLCX\\ELT@LYTD‚aFENF\\lj"],encodeOffsets:[[112385,19987]]}},{type:"Feature",id:"469030",properties:{name:"白沙黎族自治县",cp:[109.3703,19.211],childNum:1},geometry:{type:"Polygon",coordinates:["@@D\\RV]dTXELnHr]^@LETBBRTHPi^[@U`QTHDJ`MGSogDIPKdJ`WVNHCXHl_DJR@AH`FBVPUJLHKNTJOFFZON[ZEHFCJlMJ_ŒCn`CJVNGPLTNDFIdVTWEIPmRKMc_kDMWGGUTAtJLK~\\f{pqD[LAVXRCH{HC`eŒJ`}@W^U@I@_Ya[R[@MSC_aMO@aWFmMOM@‹haGGMEmaQ[@MESHaIQJQ……MckBIw[AOSKKAMPSDSLOAV_@@`KJRbKRDfMdHZERgAWVsDMTUHqOUr@VQXTT@Tƒfg‚L^NH\\@heTCZaESNObHPƒHeZF\\X^ElM^F^"],encodeOffsets:[[111665,19890]]}},{type:"Feature",id:"469002",properties:{name:"琼海市",cp:[110.4208,19.224],childNum:1},geometry:{type:"Polygon",coordinates:["@@TP\\pATHTGlZDJGAQjE\\Rb@jVBDCN`JZ[NCNHNXbULPrP\\KNbMTLjJJRFP`“pNLZz^FLRHjVPZ@hxVKbHBHMNNJFRlLzGPnNHhIrHHADcPWdUAmEMVQDSKYHY\\EhBN^HpXGNDBNNBnIß‹Å_g{³So]ã@ORO@KMEDIVYB[WJUICudGTc]P_YWaCOOMFS[]@MMYBgOU@ISHKQQkKMHYY[MSHwUit}KF\\KFMCF]EIUBETSROUKTLT[NKTWREfJbCHBZKTFTKh"],encodeOffsets:[[112763,19595]]}},{type:"Feature",id:"469031",properties:{name:"昌江黎族自治县",cp:[109.0407,19.2137],childNum:1},geometry:{type:"Polygon",coordinates:["@@`ZĤd–`òüˆ˜ “BSPGP@VSbQ`‡@]HC~T^SE]N]FkW]E[fY„GGOPaTMbFDYfS@g[MGK]h„e@SSSRW@UVqrPVGNStCXUhBFQGYNcCeLQQaLI@_`@EUwcEaCUaMc@SK]Du`MSkKI‡~BVNL@X`‚EvYŠwHcTU@MIe@SXJbIPNVCRXbWbSAWJCRXFFL]FMPSjCfWb_L}E[TaBm^YF[XcQk@WK‰Z“JYRIZwŒ¹ "],encodeOffsets:[[111208,19833]]}},{type:"Feature",id:"469028",properties:{name:"临高县",cp:[109.6957,19.8063],childNum:1},geometry:{type:"Polygon",coordinates:["@@jD`hNd\\^dZädĒH´Op@ˆùZY\\OAGIMN[[W_NCNMKU@NUMSNCTSP@`O@WSCCI@GXQSkXKX[IK@OWqH]SkWW@_SiiYQaKCAKZaCCw@MTGAMKM]FMMIMDSM_HGHRPKCBGSJJIYH[QOJCHMBDGQJECMTDQKFGTCEGTF`NFEDMFaGSNwIiTGhYJD\\KZODC^@FTKND`XBHKJNKFBNhG^FJMPcHEZF\\QPRjQTAdgNOPgQaRSê"],encodeOffsets:[[112122,20431]]}},{type:"Feature",id:"469034",properties:{name:"陵水黎族自治县",cp:[109.9924,18.5415],childNum:1},geometry:{type:"Polygon",coordinates:["@@R]NC`YL]FoN@V[vBXVFNL@TRZalnVFVP`DlOZkVSXEE_F[EUFeH[NKTgfCbMVU^@P]ZObZP@\\QhATUfAtUasñiāEoI]eYǯ@aKmaeƒWuCºKÜKpnbHbYfUDSNCPJTRAHJTDJSfDNLHXC``VBNGTYCQDIXMDSP@xLNEFRNXBIpVNLXah@RgF@`qOML@LJNSPLbaHAh@Jdj"],encodeOffsets:[[112409,19261]]}},{type:"Feature",id:"469026",properties:{name:"屯昌县",cp:[110.0377,19.362],childNum:1},geometry:{type:"Polygon",coordinates:["@@\\OnVBFKHPJCJOJTDB\\vDINOCGJVVL^JDONEbrGTLpMVJLGjAHGRkVChF@vH^zIbTETMHAZOFC^\\DXT\\EffAP\\PdAV@UIYfS|S@YPICMeM@sC[_A]VQEwyHSMuNcAUlQJMVGMS@mVBZPFO\\CSFQK[LqDMACiUa@[QiFBRIHYCHkGSBS[oSOqB‡IE^QHCRWHIXsHU\\UC}JEjMNAN_ZƒAIhSEYfWDQGaPMTL’ERZTJb``NHV@"],encodeOffsets:[[112513,19852]]}},{type:"Feature",id:"469025",properties:{name:"定安县",cp:[110.3384,19.4698],childNum:1},geometry:{type:"Polygon",coordinates:["@@JjDNdJ\\FbKPXfZ^Ij@RZNaVSc[MsMOHQPDJcLIJ_zCG[HQxWJBHXdENRR@XQFWZQQGOFSWUCI[WCJuRGLXNMPLhCl[Ta@SqGgJMGOmyHkKEQMINMAGaGULgwY@UOGiKQ]EYyMK”oO_QEIIKiNSMa[LqOKOaVMWMGMDY\\_IKrL\\ERT[DEPYOUA@nNTUHINkRBVMdNvGTxzRF^U`BD\\@tfNDNOJ@Z{TeTJZ@VU€cB[OBOeeQT@^OXBJb\\AbWTF`RCJFH\\RDJIJFXW@WLGBKxWTSJJMTVZND@bbL"],encodeOffsets:[[112903,20139]]}},{type:"Feature",id:"469035",properties:{name:"保亭黎族苗族自治县",cp:[109.6284,18.6108],childNum:1},geometry:{type:"Polygon",coordinates:["@@FJp@fxpQ\\ApN\\GNPNBM`HLMrXLXj\\PEHnI@WUCEM\\GTc\\GZYHTPBHRCPTd€H\\K\\@HXi–BJILJJAVNTOZJNtFPC`YxDPWci@IBgbGKaTOIM@KNKrP@_hE@QbgKWUMJoWAQMFEKM@wTONCJWRCZDHSAM_UD_GWMKeCITSCGIQBGXUHQoMEEGWDQIG]FMQBMaFGueFeSQDUSDSKOCSFMLƒUaPWM_PaEGFETMX]RCRR@HXKN@JNnXXEŒSPaDI\\£FkXWIAX]xB\\GN"],encodeOffsets:[[112031,19071]]}},{type:"Feature",id:"469001",properties:{name:"五指山市",cp:[109.5282,18.8299],childNum:1},geometry:{type:"Polygon",coordinates:["@@TCNOLBTLBPx\\AJdl†NR†RIbJTGNF\\@RcIYbmHoLQdKN_fCJYbDRRXKZFVEZVXBXIJBXMdESW[CUYHUVQFQAqsEIMPYMSBUIIJKAIj•GW[@[LGScDOGQOAGSYZ[HSd[HFNVD@XmJFG[OWiWKNqGKN_MAMO[HoM[BoRewo@Y^HpITSFENc`MVCdHNIVCLJFI`NFIŒP`@VZbaf[FFJG`O\\WRFA@PVPFPPH"],encodeOffsets:[[111973,19401]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/hei_long_jiang_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"2311",properties:{name:"黑河市",cp:[127.1448,49.2957],childNum:6},geometry:{type:"Polygon",coordinates:["@@VÈÞ@Žkx˜nXŽ°VÈa°V@kôw„b‚š„JVškXlVUx„„@ŽlL@xkVV°ƒ„VbxlVUnVxk@ƒ„ƒKkŽVb„Il„@°kVl„@„™lÆnkll@@V„VXƒŽš@V„²bUlƒVlV„U„VÇn@nkJšŽlkVbœ@›x²V@n°VUnlKU„n`@n°bWLnVUblVUVVbknV`°kkŽl@@V°@nz„J@XšxlWXb°n@bƒĠlbXb™bVbƒJ@Všb„a@„„@lbUbšVmnœ@lšVmnIW‚œ@WbÞ@„n@x°@š„ĢaƐéϚnœ„‚lČ¯ĠŻÈwm@ôçU™mm£Xy°UV™›@wÈ£Ǫ¯kõÝçUњ™Uķ‚ƒĢkVфÆšÞU°nŎ¥ČUĊx°m°¦żVƐœx°ƒÇ£@y„UônރÆ@Èĉ°Kô¦šW„kWU—bÇ»@™ÈĕWÇÈ£ŤU@›n£ÆUUKVamanwŃmÝJ¯k@JƒIkaVaUUÇbkaÆÑkWmÝUۙ™Ý@™ƒwnU±ƒ@kkV¯KUkƒJƒ¼U¦ƒšÅ@ówķaķůV¥Uaó@Åwmƒƒ_kVƒwĉ‚ĉmmn_V»™a@U™ƒVwķóƒ‚U¦LǫéóXÇmōLǓÇķxÝkƒƒĉ™kmakbUĶ°@W¼„@bƒšÈÆ@Ė™L„l@„°J¯„mkl¯L݃±L—amJ@¼ƒ„™VƧUó„™UX˜ċb¯ńVbkÆÝI@llx„k°V²šV@Uxގ˜L@b„@b™`ƒšÇzkókݤ@ğ¯Wƒ™LĉǙLmmnċVkbUaƒL@Ž¯„‚bU°ğL݂Ý@"],encodeOffsets:[[127744,50102]]}},{type:"Feature",id:"2327",properties:{name:"大兴安岭地区",cp:[124.1016,52.2345],childNum:3},geometry:{type:"Polygon",coordinates:["@@k›ƒϙmƏêġb™ƒ¯@@wƒmÝ@XV@IlŽl@bUxl¯VlV™bV@ULVlUV™_kx™VVV™ÈÝJ@„¯šU„™lm¯x@xóÒĉ¼m„¯Wƒxţ@Uz¯ƒWwnUwťƒ@knƒWƒ£óVƒUUwğyó¦WI—Vmm™I@±kwÇ@@bƒ@ĉ¼ó@¯wó@¯aó¼›KՃaUwmWUwÅI@aƒKó@Ua™LƒaƒVÅwō¼UUÝl±I—¤VxÇx@zkJmnn‚mbnz™xlŽƒl¯ČkJl™°@„kb„Žmx@x™@kêmVnŽWxôXšxU°„bWLóJnÇWĵ„V¦™ŽƒUUb™b™ÆġK™šk¯™VU±aXmċÑUwĉKġ„k„™ŽVxk„ÇKkbƒIƒ‚ÛXWl¯bƒŽ™X¯K™bĊš„„ÞVƚnŽĸ²lxUŽ°n°òÈb‚¦—xVbƒŽƒ@¯„Vx@¯VķÞČlĊ°KĸŽȘI°¤ČIôŽò»ƨnȰKǬ¦ôWŎÈƨwlƒnKVXmbX`lbšwkVW‚XXŽ„L°a„ƾaĊ£nƒ°@°¥ŎzÞ¥‚»œalwôkƒJ„a@ĶK„£„bU°ĊxźVÈUĠ¥ƨ™VI@XU°x°Ln¥šw°UmwXm݁V¥ĢŽ°@nU@mÆ£š¯lKœšÜw@aÅU‚¥UaÝIkmV²‚nn@Ķ»@Uk¥VKÞ@ÞÛ@ƒkVmĢa@_ƒJómƒǖ¯Æw—óÇa@alƒUwšwĢřšk@wÆWXUWXƒWa™m@_ƒ»ÇéXaĸwVa@ÝKkUWkX‚kšKXxƒn@lĊV@¯m¯nřÆwš¥"],encodeOffsets:[[130084,52206]]}},{type:"Feature",id:"2301",properties:{name:"哈尔滨市",cp:[127.9688,45.368],childNum:11},geometry:{type:"Polygon",coordinates:["@@°`„_šJlUšŽ@„„@V¦°JUšŽnLôlnŤ@@šÈaUÒVbkbl¤ƒzk°ÇVÛô°IlVUVôU„xÆU„Ž@bźĀ„º@¦šb@l²‚UVlœ@°ÒĠxšnXxÆVô¼Þ@Üx²KލlƒVÑ°UȰôlwô@²ƒĸ°„lanV@„šVŎUll@bÈnÜm„wĢ@la@ÝÞb°UXb˜lŎ²ÆškšV‚I@ŽnJnĠŽ°knƒÜbĢwna@a˜kÞKƒĀ„a‚™œ‚‚IVbU¥wĠwkô˜xnLƒċVçkaUƒ±IUmnġW„°WôĉšalƒÞÅĵ¯@W¹XÝaƒb¯a±X¯ºLƒaVƒmkLóƒƒbkaƒVUKVkkKV_@aÝykk±L@ƒÅU@yV_™aU¥ówÇx™@UkVƒn@lƒkÅlwšWVwUkĉmkklW@šašbVwnWWƒ—wWL™™@Ušƒ™UƒÇLšÇmƒ„@wƒJĉƒL¥@ƒÝ_@a¯y„UWw¯ƒ¯Uġx¯aÝXVmaU£ó±›¯nwƒa¯óÅVƒXman™„Uƒ›lUXkWa@mkI„›ğaƒm™IklÇU™„kĊƒƒzkKƒš„lU„ōĬlš™„@ŽnX°@llUxŹ²mKĉVWwk@UbUK@bmVmI—ƒVmwaWxXlWȁšmºšÞÆbUxV@ĵńWÆĉLkWUbƒaWzkbĉ`U„±LklōwUVÝ£™UW`Uwk@mk¯VkaõVX@WbL™K@XƧºWzxƒK@lmX@bkVVÆk¼Vbk@Vn"],encodeOffsets:[[128712,46604]]}},{type:"Feature",id:"2302",properties:{name:"齐齐哈尔市",cp:[124.541,47.5818],childNum:11},geometry:{type:"Polygon",coordinates:["@@Þ@ށĠKV¯a°ƒ@„KVblaČU‚mnnšKĊȚKX„°ŽĠ@Þ£ôllÈy„™š_@a‚ƒ@a—KݍVwU@±™¯Uƒlkw@kÞJlÅUa°ŃČaW—šVôƒƨVšU„ƒ@»nI˜b²Kބ°Klkn°ƒ¯I@ƒƒkšK@ĕÇń™@aƒX»¯@VĵlaÿVamI@aÅÝउýƒĊȗJƒôȁÅkmƑۃ@kxġ@@l™aVk¯»ƒīŹaƒkƒ¥Å¯™JUaWU@@w™aƒ»„KUkÆkUm„UmwÛ±±UUbUŽUXƒwWwÆÝk™lkUanaWwnKl™kal¯ka™ƽa›kÅx™a¯@™amb¯V™lÇwÛĀ™V@x™šmêVƜVV‚aôV„wÈx@šˌx„¦VÞ¯VšlmX@‚ƒL@¯Ua¯LmV@„„°X„ċK™V™ƒ@UƒÈ@‚¥@w—ƒġIU™km¥Źwƒ¦¯lmn@°kxVV@¦óam„n¦l@nx™lĉVóšmx™n™ÒĉĀĊ¼„þ„šǔêÞ°ˌĠÞÒ°ĀɲĀƨźˤȤƨĊ°w@£nymwnkUUV¥ôÑVmkÆmUUVa™mVIkmô„lxkXÞþƒbl„ƒl@kV„ƆƒV„xV@š¼VÒ@šŽUŽšnnނJ"],encodeOffsets:[[127744,50102]]}},{type:"Feature",id:"2310",properties:{name:"牡丹江市",cp:[129.7815,44.7089],childNum:7},geometry:{type:"Polygon",coordinates:["@@U`lLUlVL„Ulb„aô„lKnŽU„„b‚K°¹²W°b„aÞb˜knyUlUkamř²L@m°@lšmš²n`ôÅlK„x„ÜKnxV@„l@œƒ›ÅXyW_k@™wm™ŹĕmƒX™»‚ƒÛ™l°ƒôšÈ„»š—ô˜ô_WW@Uœal»šwU@@wšUVƒš@VƒXI@w‚Ģ͑ÞȻ›aU_@mUkly@¯óV»XmWUXUWmnm¥nUUaWLk»Æ²IÇa™wÅaÝ°¯nUa±a™ƒ™@¦õÆğ„@„™@Åb›xU܁nÇłlb¯¦„ôó»mƒ—@±ƒUk@Wwƒa¯xU„V°ƒxXbǎŁUV™™ƒK@¹ƒKUaȯ@ōݙXƒal™ƒlÛkalÇUǫÇńÇakbÝƆ¯nlš¯Ž@¼™VUx@x¯W¼™Æ¯šmĖ„Ĭ¯ČƒVk‚ķÅmxœ°ô²V¤‚bUnÞW°bĢw°V°„XxƒV°z@bÞ`@„‚¦„KĊŽ„I@xƒŽn„™ÈÈK‚„šV™„@VššXK˜xX„mXUx™a™b@‚kXllĊnVlUx™XkxlÆk„m@U„Vlš@ÈwôxV¦šbU`@zÆV@„²KllÞz@b"],encodeOffsets:[[132672,46936]]}},{type:"Feature",id:"2312",properties:{name:"绥化市",cp:[126.7163,46.8018],childNum:10},geometry:{type:"Polygon",coordinates:["@@ऊþÆÞ@bnJUb‚ĀnblŽĊš„„ÞlĸwǔÈŎKÈnôWǬê‚KV¥„ĸôUxš„@VšbU¼m`nnĊŽĊ„xlUšmkaVÿšLšwš@°»UmbKmݙUšwUmVknKUUl¯ƒKU™ƒUȃ‚™nK@ĠkX±lX„°„L@¯¥@wV_m›ĵ¯Ww™L¯ƒUkōƒÇVU™l›w—V󁱃¯aƒVka°wVk°mÞ¯Ŧřƙl™²™Ŏk™U@ƒmUkb¯ƒķŽ±„ó@kxȯó¯VUÒk„ÝŽ±LÛwÝ@ó»ÅUWw™mğw¯Ñ›@UkV±@k™a@¥ƒ¹Źÿ@aƒÅVƒwóVVUkU¯JÜóÈUl¯„yk£laUaVÑÇb@™ţ@kmómK™V¯IU¥ƒ@@ƒ™kV™Iƒ`@ô™¼„blU„lƒ™bÈb@xÇKkĢɳaÅɆō@ƒŽVƒK@z™@@¥ÆKnÜ@@aۏUw›wnU‚ķ@ƒ_ƒV°Ž@„klVššnULVVÞbVl@°™@nx™n°LŚÆlV„ȃmU²@VmĠLƒx„n¯xkWƒzšJ‚wnLmbXbW°šÆ‚™²™@™Žšx@JVx„L‚Ā²Æ°I¯º‚È@ÒnÈ"],encodeOffsets:[[128352,48421]]}},{type:"Feature",id:"2307",properties:{name:"伊春市",cp:[129.1992,47.9608],childNum:3},geometry:{type:"Polygon",coordinates:["@@ƒKƒ¯kWW²ğl@ŽmLšÇ„„VVš„Lk°VVmLUlVn™xšVnނLnaVŽ¯¼™@™x™KUĀlb™n„`n„Æxô@VbU¦ĸŰĸbôxÆ@„™V¥„»„IVl°LUŽll@²„mV„x@ššÞܚÞVnŽlXÅÒlbÈaVVUblb„J@I°lÞIn‚Æ„mxnbUbVLÅVm¤@œţVǤXÈÇĖ@šÈ¼˜aXVÜaXbWŽnzŎašř„KôbšUlw@¯naÆKnUU¯Üa@mkkVUĊm„™żÝ‚ǖŽ‚K„™°L²lÆI@ƒ¯¥ĉƛVaÞk@ÝVaĠlnUVwƒœómaƒ@™wĉ@™a™VƒxamX@aƒ@UaÅLƒaVWƒ_nWm£nWm_ÅV¯ƒm@m„󤁚ݦƒ¯ÅalmX£ƒ™VWUŚw™mÇ@@IV™„WUw@ašI@„k@wŎ»Wƒ„ƒ™ÅVaœK›Ika@¥lUkUlwÅwVyÈwWU@a¯U°m—Ç@UçƒaVa¯mV»ÅwÝUlƒUk™V@k„mUk‚X£šw°@@ǃaÝIƒƒam™Ûam„¯lğmmI@J™U™l±ÅōŽ—kWa¯VÝa@Þkbġ@ƒxÛnÇm@akkōVōl±škšÅšťŚÝ°¯nUl¯xlb„U°b²„ô‚˜Uœxšk‚VÈUŎ„Vl°„šKXxĶ°nœU`@x°¦@"],encodeOffsets:[[131637,48556]]}},{type:"Feature",id:"2308",properties:{name:"佳木斯市",cp:[133.0005,47.5763],childNum:7},geometry:{type:"Polygon",coordinates:["@@nš„b‚„ÞJ„b@ȯ@™xW¤Vlƒn@lšUVlk„ÞVÆxU¼°nUb„bVèÈ@˜ŽnIn‚@šĢmlUw°™żƒ‚VUn@lnL@VôbšwĊ‚lœ„JķĸĢl„wôwƨxVVUƒŦšxšLź™Èš°`nnĠwŎJސĶwôJ„@¤Xn܄ĸlšn°¼È°lŽ„„Uš‚b„xš@„l@ÞÞÈm°„lôwšL°¼ĸ‚°Þ²nĠ@ôwÞ`ŤI„V„ÒĠU„„@„VJĸbƄ²@°ŽĊKšœ„JĶaĢȰ@ô¥°nš¤‚bČUš@Vx„mUw@a݁ţƒÇ™ķƒ@ĕķīU¯²@ÆmVÑô¯X¥ċç@™ĉ»U¥ÝţKWVÅkUVÝŎUmǍÝx¯aķxÛUóL¯a±óōb¯™ƒÑŃVÿƒ_Åķ„a@UƒK@wm@Van@UmmLVa—@VImmXUWƒÝUřƒKUwÝUUƒkVƒk@l¯X›‚Å_ƒJ¯k™Jm„ÅLƒa@¥U@¯Vƒz¯@ƒ`@¼šmxƥšŏKÛk@±laÛ@@Xm@™ƒ@xƽ@WŎnšˣĕÅ@@aÅ@@nÝbǏ¯@ƒ_U›kUWƒkb™wÝU@ç„Wlw@anIƒ¯lyœX°m°VšašÛšm@„mVwÞK°ƒšXlaXmm_ƒ@UƒkwÝK@ƒVI™ƒXmV»ƒI@aƒ¯ğW™bġaU_¯JU¯ġŽƒ„ĉ„k„ō`±nÝÆk„™bóĊ¯Xƒ‚ĢX‚mVn²JV„lbUè„ČmK—wlóğx‚xV¦UaJ›šƒbƑÿÝL—l@bmbġx"],encodeOffsets:[[132615,47740]]}},{type:"Feature",id:"2303",properties:{name:"鸡西市",cp:[132.7917,45.7361],childNum:4},geometry:{type:"Polygon",coordinates:["@@‚LšKVVnkšbVšÈb‚²U°VnklVlaÈL@anU°ÜmXV`œnôLƒèšxlŽšLX„˜L²ašVVmÈX@ķ˜lnU„Èl`ȹš@ŤŽ°U@x„KnnV„mlnnUl‚lVnnaŎwlVÞ҄@n¦šLVŽ°lšwVk„Lšaގl„n҄š@xmLÞ¤Wnœ¼‚WÈLVVUxlÈô„„WVaU_VKšKXUÆbn™‚nôK„bÞw°bÆWXamVwœK˜™Uw¯WUk„UlJUwVUa™@@kmyzm›ĉw@kVwškƒW¯ÅKU_Vmƒƒ™xU@aW@@kK@w„a@Kƒ@@kVUƒaky°_Vm™kna¯K@™ƒL™wġk@@IÇóX™ƒwVakmV@mwXUWanƒlĉ@ǙUw™KƒƒóšܛNJۄm°@›w—Å@ƒ±b¯Wƒ¹„WVwŹĕ¯kVmōb¯w@aƒwmV™UUb™V™IkaVwķ™xk¼›b@VXXó`󗙘ƒ¼Çó™¯„kŽÜš„š¼WŽn„źĖnššxl@X`WzœÆ"],encodeOffsets:[[133921,46716]]}},{type:"Feature",id:"2305",properties:{name:"双鸭山市",cp:[133.5938,46.7523],childNum:5},geometry:{type:"Polygon",coordinates:["@@™UƒƒUwó™mÑÞÑUÝÝUkmmŃyV¯ī„¥ƒUÿĉ¯mÇkaWbÅX¯aÝxƒaóLmmšÅaWV™LULV`UbƒXóƒkÇVwUUÇKX›»XmÝ£nK@wƒ™mÑkƒÝ™bƒKUl™x¯kU™Km¥ƒ@ÝÑkUōxmbUmkVkmmnkUƒmmƒL@w¯Vţ™@Ǻk_ƒÇmV—k@ĸVx‚VÈ°lLkllšUbōwƒnVW¼nlUx¯XmWUnÝ@™xÝUó¼¯J@LVbkJWnkb™W¯„ÝLUxƒn@‚™n™Ü™b¯U¯n›Wkz„°mJ@bkxƒX@èÞVšxlaX„lVVœ„`°@ȐÞa@mÆ@@bÆ@ˤĖm™Xōƾ@@wš„n@@WÜ@kb@²ÜlŐLƦ™nw™@»„_°@„y°UV@@¦„bÆKnƒšI°l„IÆ`œ°W@k„llUV„ÞVVx„LƚÞVX„WVnnUJ˜@UbnKVnm@Ubn@@x„L@VƒbÆĸ„`UĀƄ„Ò°šŎa²ô°bôKÜVĸw°bÞwȎVnÞōVUÆlXU"],encodeOffsets:[[137577,48578]]}},{type:"Feature",id:"2306",properties:{name:"大庆市",cp:[124.7717,46.4282],childNum:5},geometry:{type:"Polygon",coordinates:["@@mÇ@сǰ¹¯J±ÅÿƒKUw‚I@™wšš@š±Å‚™X¯WanamKx™I„ylX°wƒm„wğKUn±@nVDŽUƒÅkƙ¯Kšmmwš@@¯UkÝaUUVK™mU™lk@ƒ¯„U„`ĸ@V‚mœxVxܐ@bÛ@m‚ÅL@¦š@@y„L‚U„Ŏ@ÆɅɴblġÈL@wÇaša„ƒkkVƒaš»@ó¯_ÝJ™wÇaÅXny›U¯¥Å„@w™bÝa™Lmm@@ƒVUŽlbğVmš™¯Xƒm_ƒ`¯_Ux™m™L™a¯b@mƒaó¦Çk™¤V„@bóJknVx™VXx±aƒLUbVxkLVlLWlƒ@nX@VÅbWlÈnƒx„bWšÅbmŽ@xœbml°b™„XbW„XVmnn`ƒLmšnbmb@šk@mwU@@š¯Jlbk°lbkšmLXxmbVbkllšÅނxX„xVWVVa²VܲnxƒVVnÅlVlƒL„¼šb@xV@XŽVbšIÆ°„¦„lźb„Ĭ°¼Ulšb@kĢ@lw„@ƒÜlnȂƄóȘI„ĉ"],encodeOffsets:[[128352,48421]]}},{type:"Feature",id:"2304",properties:{name:"鹤岗市",cp:[130.4407,47.7081],childNum:3},geometry:{type:"Polygon",coordinates:["@@Þ¥‚™ô£nƒn@°„ÆUn`mXn¤mX„`UX„bÆKVb„@@bnW‚b„wšUšbĊ@šx„@nbšWVmƒ_mm@ó»Um„ŘWXkĠ»²¯‚¯nķšwŎ@ĊšŎK°bĸUnјKȦĠÈbÆknJššÆUĢV°IšŽšVƾƒwaV™ƒƒkÇ¯¯»™mķkۃWm@£ƒóIĵxݏōIğxmm¯_ǙŹš™K™wťŽ„UVUŽƧwóxƒxġkĸķƒIk›ĉ™xóa@UmK@kVmUŻ„¯šVxkŽġn™‚@mmJ¯n°V@bXVÇxUzÆxkxlVkV@¦lbœJ›LUbšÆƒ„X„ō¼@xƒl@™J@bVxƒXUš@JÈ@šn™xVÆUXš‚„W¤knÆb„°"],encodeOffsets:[[132998,49478]]}},{type:"Feature",id:"2309",properties:{name:"七台河市",cp:[131.2756,45.9558],childNum:2},geometry:{type:"Polygon",coordinates:["@@²mŎ_lƒĊƒ„ƒĢV°°IV`ĢbšaĠX„°@b„JU¼Wnš„UJ@„ÞLlxV„„@n`lIUa@K°Iô»ÞVšwÞ@VmnX°WVwmkX»‚U„mŎxVak™lkkKǯUUwÇWUn™U±b—KWƒ™Kk™w„çóK›mU_nW¯ÛmV@bÇKkbkUml¯U±VÇaU™™amlUU™LK›„k@ƒU@mwÛLƒŽƒwkLóÆm_™±™nkŽ¯@@n±KnŚlbkVV‚mz—lWXº@Ķ°"],encodeOffsets:[[133369,47228]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/he_bei_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"1308",properties:{name:"承德市",cp:[117.5757,41.4075],childNum:11},geometry:{type:"Polygon",coordinates:["@@lLnlmxn„„IVVlUnb@VVxXJWL@LގVnnV„J˜_@wkmšK„b‚x„wXk˜WXXšKlb²K@nVVVb„L@WlU²„lKVnUJVz@VVb@lżmVUVnbôaVX@°Ub@lWbXš@b@bVb°x„@VxÈLVlšaÆ@Þb²k°@lVUŽ@Xn@VW‚LXb@¤VXšKVVVLnm°_ƨ¤@aUIVa„alkX›°k„™V@„alwUVy„U@k󙰃na°UVUUmUÆw@mkLVUƒWVI„WšLnn@xlVnK„myU@ƒU°UXaV@U¥ƒU@Uƙ@aVUkWU¯ƒaU@WLUV@bkbmKULmKkUVUkmVIUwlWV²™Uml°U@W„LUwVm@UUK@_ƒKUUÜaXw@ƒVKUU@mVIUUlmnIVVVbÈVlKnbVKš@nI˜@nVnwVLVK„K„„˜Vnb@aUIVW@In™°@lVnIš@lWĢ@°UVL@b„@VyUUƒa@w@WUnU@Wǯ™K@UkkJWaÛbmk@mVaÞU@amkWƒ@mXUKkÿƒ£@a„kl@Um°UXwla„al@nmlXnW°znW@aƒwV™@ƒakbĉ¥VmU@ƒIƒVƒUƒJkUmWU™KbmkUaƒKkUVU@KV@@klw—™WaU@kmƒXVènbmlUUƒKƒX¯JkbƒI@JmIUWU@ƒLml@XkJ@U™kƒK@aVKwWa—IWwƒmUƒ@mU@J@UaċU™aUUƒVkI±ƒk@UUƒ@UbVVm@UVKƒLƒlkIWaULUWƒXUJU„ƒ@WbUb@lkXUxm@@JVn@J@b„nƒb@Vkx@bšLU‚Æn„JšaVXnKVVmzX‚°V@_lJXxWXƒK¯bÅamUƒ@lUI›bñJ@LÇKkIÇ`kxWL@„ƒ@@bUVUb¯xWKk„Å„VlULW@ƒŽn¦Ul@I™lmUUUVm@kWƒnkKma¯XUKWmnwVwÝL„mŽ™VUbUVWb@Lnxm„xVŽmbXx›¦@„nb@`™„ƒVƒ@kbƒLU„mVUlkbVXkºmnm@@xk¦šbĢÜlš"],encodeOffsets:[[118868,42784]]}},{type:"Feature",id:"1307",properties:{name:"张家口市",cp:[115.1477,40.8527],childNum:15},geometry:{type:"Polygon",coordinates:["@@k™ġۙal¥@wn@nml¹UWlaVknUVƒ„Kla„@„Ušƒ@_ma@ƒœ¥WwnaU‚wnƒmw@KXaVUVašUnmWUk°™lƒnUVUXWVw™IWVóKUI@WXƒxUU@mma@kUKWLkw@yk@ƒaVkUUċaUU@Wk@Unm@UVmLm±IUƒkJ™kWƒ@a„I@m@U„ƒVƒ„Ula„@VXVƒXmVwnkWKƒKU_k@m¥ƒmX_™JmnU@km@U@KmU™VƒU@U™@Umk@@LƒmW@Û£Wƒka@wk™@aƒI@mmk@mUa@UmUƒIƒwW@aWUƒbU@kbÇ@kwƒ@makVUk™U@aƒm@aU@mxkUƒbƒKUXUƒ±KXVWLUK@wkU@V™@WXUa@WbUxƒJIƒŽ@¦VèVVX@±ê¯KUIƒ`¯UULVx@Vƒ@UKƒIƒVkLmVkKmš@nUJÝbkIUJVXšVVxVbU„VJ„Un™°bV„mlU°„XnK@Ul@lVÈVUXšx@W„@VXšV‚KÞb„n@VnbV„m`ƒUx™kW@UVkL™Km¼@lUnUJVnV„XV@Vm@@LV„klƒIkl@VƒWlŽULWKUL@mJ„@blbUVUlmzUJUxm@UUbċÜk@Ub@VšLVV„¦ôbVŽmšUKUkU@m„„@VlVn¼WbUJ¯@@„°šnIllÈl˜@nXšWlLœk‚J@bkxlxkxlXUlklJƒšXL@bW„n`@nƎXxlL@xl@Xb‚LœKlVlIXblVUbUJW@lX@VL@VVŽšXšJšw„n@WnL°K„bVbl@VI@K„@U@nmVmV@XUWI@aXm@™VUUkWmn@lmUUk@mUmK@UnwVĉ@ƒƒmU_V@XJôVVUšLVUn@šllUnJl_n@šml@XŽlLlw²LVJUL@VmbVblVXmVnlš@Ť¦„nn@܎@bšl„@@XV`„Unb@VlLVb²J‚Xn¥ÆÑ@¥Þ@"],encodeOffsets:[[118868,42784]]}},{type:"Feature",id:"1306",properties:{name:"保定市",cp:[115.0488,39.0948],childNum:23},geometry:{type:"Polygon",coordinates:["@@VbXWš@@UlV@xVLXKWU²LV„VW„L„alVnwV@@b„n@bšVVllUnb„@lxÈ@laV@„aXV@b‚X„x„J‚nV@VVb@nnl@n„J@blšl@„ašƒU_VWUwVUškUm™Ukb±mVwœU@VIUW@UWk„@VU@ynL„m@IV@‚bnK„LVaVmnIlaXwV@@WVL°@@xnX„@V`V@VbUVVLVKnwnL@ll@@_V@VVnaÆ@œKVXÆ@nƒ@wƒKmU—™Wm@km@kÜKXU@ÑW±nIUwVƒ„Kla@I°wU±kškmm¯mƒ_ƒJnƒaƒwW@IVaUama@wƒUƒmU@mVw@aXk@mWa@£km@aƒ_kVmUnWW@¯bƒkUmk@ƒVÇm@@kUU™KUU™@UVUamVUaWIkb@xU@@amUkKƒVkam@@kVUkUWmKmUkLUb@xmJƒ™U@UImVÛVmnUwƒJƒU@VƒX@UWm@Ub°¦UšmxklmX@`ULU@@UW@@xkn¯@makV™UmxUb™°ƒlUšƒbUbƒnUJƒUUVƒa™LkbUU›JUU@mUUUƒJkaƒ@™xUIWJƒUnƒJ@V™zƒ@kb@`@bln@l™bƒŽ@X@š@š„@Xl‚bnbVb„@„„VJlInlšbVw@U„K„l@lbnan@Vb‚JôLn‚UzlV@lÈLVbVK@LVx—VWXX`WxXz‚bV`UXV¤nx@„bVlVnVlUL"],encodeOffsets:[[117304,40512]]}},{type:"Feature",id:"1302",properties:{name:"唐山市",cp:[118.4766,39.6826],childNum:11},geometry:{type:"Polygon",coordinates:["@@„@VVl@²„lJ„UVVšbČVVb‚@@InV„@‚V„nXx˜JXb‚xUL@b„Lšl@VlI@Wnk„KV@VXnJ@I„Jla°I„W„LVVnkmaUç„WVkôaܯ„@nV°wnJlaV@VUnUUaW¯wXWWwna@£UaWKU¯ƒ¯@aVUkKUamUUƒn»‚an™„IVwUWlkš@„LlWVakU@K„_lƒšbÞU°@šy°n„@„KÈkWW™ţ¥ĉōƒkġWUw¯£¯ƒÇwţwƒ@kK@kƒ¥ÝwÅbǤېťV™lW°@ĸ™x@VVVULVLkl@V@Xƒ`Ub@Xm@UWbƒk@ÆVbnLWV@lnXUbl‚@X¯lmU™VkKWLkK@_UK@U@UmmUxmVXLWVULkU@`W@ULUK@XlJXzV@@xml@VU@UX@Kk@WbUK@Xn`ƒXmJnšmškxUVbUVlVVxUbV@nKlL„kVKÞbVKXI°KVšmVUIUKULVxVJVLkV@Vƒ@UbU@WUU@UbUK@b@nƒV@VkLmb@b"],encodeOffsets:[[120398,41159]]}},{type:"Feature",id:"1309",properties:{name:"沧州市",cp:[116.8286,38.2104],childNum:15},geometry:{type:"Polygon",coordinates:["@@@ln@UȄŽl@Vn„l°aX@mXnVlU„`@bln@¤Xb@nWl@bUx@nnV‚„„V@xnbVbUb@J‚X„x„b‚mXa@k„UVwlW„k„KôVm@w™kkK@kl»Èƒm™VKXkla°@XVV@VI@ml@@Vn@VX@V@J„@VxUzVVšš²blVk¦@šĠ@@»š@VK@VÈLlK@XnJ@alIUl„a„VVbš@„n@a„U@WUIV@mUn@mKXml@lL@LnWšb@XV@@a„VVb„V„@VV„IVWÈb˜IÈ»ƒǟlWšaVUÅUƒƒ™Um@kVU™WVkaUwmaóUƒJUU¯ÑU¥mk™¯UaƒKÅnÇyóXmWÛX¯aċbÛa›J—W™ÝU¯»ƒaóóUm@IƒšVVl@bƒLUJWLX@@xšXUxl¤V@V„nVUV„XVbVš@Ž„@@VVn„°VŽ@ţU¯VƒUmƒUWV@mUXƒaƒbUKUwUaÇKn„ƒVk¦Wb@VnLmV@bkV@n„xW`Å_UVƒV@bƒUklVX@VmlUƒx@VVL@x—VWVL@VW@UUm@"],encodeOffsets:[[118485,39280]]}},{type:"Feature",id:"1301",properties:{name:"石家庄市",cp:[114.4995,38.1006],childNum:19},geometry:{type:"Polygon",coordinates:["@@la„@šy@U„I‚m„VXIVJšw„@lb„IVVnV‚@VVœIVVlašK„bVU„VVI„mVa„aV™„kš¯VanwšVlUnb°@lm@wX@@VV@VK@_nWlknwV™¯¥Van@VX‚@„W@U„V„IVxnmÜUnUVJV@„šnI@wValKnV@k‚mU£na@mVk°K„LVa@UU@UƒmknWWkXU@aWW@@km@UaU@@klK@UkaWaUnamm@U„a¯wWU@UkƒL@ŽUn@x™V™lUXVJUb™LmU@aUWUkmKkLUUm@mW—XƒaƒmmkkWUm@@U¯JUUm™kU¯@mKĉxÝwÝ¥LƒUóŽmwkUUUWVkKm™kKmLX„lxVLVxXJ@nVJnz@VWL@`nX@šƒxƒ@kVUUmJmIXx„JV„ƒnUVƒ@UVV„@LUšƒ`UXVVƒ„ƒlXL@l@b@VmX@b™xn°™UƒbkKWLXlW@@bƒK„mKULmakLUlmb@šXb@xmXU`V„b@`lLx@nWVXL@‚°WlXnlb„KVK„XVb@˜X@l_lJ@V@XnŽ„I"],encodeOffsets:[[116562,39691]]}},{type:"Feature",id:"1305",properties:{name:"邢台市",cp:[114.8071,37.2821],childNum:18},geometry:{type:"Polygon",coordinates:["@@nKlLnšlLXUVVlVnxô„V‚KÞ¦ÞxĊwnL°@lVnšVV°I@Vn@V‚lXnl„n„b˜WnXn@VVlKnLVlVX@bnVšKVaUIVWškšU@wVm@¯@U¥VmU_°lšK„k‚w@LX‚Va„U@wšUƒUUKlUóW@UVUœUlƒ°K„wlKU_na„KVnlKkkšWWa@IœJVa@IlJnU@„KVUUmVlaXUl@lm@kXWÝÑnkƒ™±™k@wğ›@@U@mKĉLmVJ@zmlnŽWLUÝJU_ƒ@@šmJkXUVlbklÝ@Ýa™b¯@¯±JÅwġaUU@ƒkU™@mVI±bUKƒL™WUXƒJkaƒLóKULWbUVkKmnk@@bmLUŽƒl@b@mnmJkUULƒaƒbnŽmn@lVV@¦n@„l@b‚znx@`Vz@b„xnV@xl„lbnKVx"],encodeOffsets:[[116764,38346]]}},{type:"Feature",id:"1304",properties:{name:"邯郸市",cp:[114.4775,36.535],childNum:18},geometry:{type:"Polygon",coordinates:["@@„bVKlVnInm‚@@a„kVnK@al@nmlLVUXaVKôL„Klb„IVWšX„KVL²a‚JnUš@lV@„VVĢbÆx²I°Ž°@šaÞbÞ@lkkaVUlWnI@™„@V`ÞI‚VXKmnk@y‚InUĊKƒÇkUUamUUkƒƒ@aU@U™ƒk@WUwVkVJVkkw°a@„mK@UX@VV„LVW@wšwVa@¯Xm@@lUIWaU@UWkXWmU@UwmUkKmn@lkVƒ²™VƒaULUVmJUUUwƒLma@™UmkIUm›L—mVšmx@b™LUamKÅL@VmbkU¯KÝamzkJUb±Vkb™L@lU@WIkJƒzkKmKƒnUalWkkKW@@nkbk@WW¯XUVUJ@XlJ@Xƒ@XlWLkUƒ`VUnaWa„UV@UVIƒaUxUUmVƒK@I@W@DŽU@@U@bƒ‚@nmKXmx™@UxkVWUX„@`VLlL@`™zX‚Ýb@b‚„@VUVkIUJVz°KVlnLlKnL„xlLVVUVlXUJ@nn‚„I@mVUlbn@@Žm„@bV„nV"],encodeOffsets:[[116528,37885]]}},{type:"Feature",id:"1303",properties:{name:"秦皇岛市",cp:[119.2126,40.0232],childNum:5},geometry:{type:"Polygon",coordinates:["@@lnV@Xb˜škx@lU@@LUVlV„LVbnl‚ašLXVVn‚l„I„V„U„JV@UnĊ¦la„bš@nJ°UmƒV@„wn@VU„JVI°bnWlXnWVLVK²b‚akk„lI@aUaVƒUwVUUalaVwnUVak¥šX@W‚kœLVÓm„mUK@_lWš@n_UK@alÅ@ğÅƑŃݍmƒ@їţÇlƒLƒ@¯m™z¯@ÝV™ak„ƒ`@LlVUbkXƒK™@klVXUxƒJmšbm¼V„nVVblLUV@b„°V°XLVb@¤mbXxWX°xXŽVbmVUVU@kbmI¯xmUƒ@Û°óbUl"],encodeOffsets:[[121411,41254]]}},{type:"Feature",id:"1311",properties:{name:"衡水市",cp:[115.8838,37.7161],childNum:11},geometry:{type:"Polygon",coordinates:["@@„KVlV@X°xƒb@VnnmbVŽXblb@VkL@lV@Vbn@@l‚@XX@bWVXlmXnlV„V@@VUbƒK¯LUl@nmbV¤n@l‚LXnlVUV@ln@lb„UlLnV@bV@@wlaXJVbnUVbVUš@VVšLVVn@VVX@@U‚KXU˜U@wUK@U„wVnk@UUWlk„V@a„UVUÆ`X_ƒw@mlU@anUmK@UXal¥„UmƒÈLVbVxVL„a„bVW@nXU‚Vn„„V°UŤV@Uƒ¯Um@Uƒ@@U™UaƒWVUmUUƒU@k£Vw™W@wW@XKƒIUa@wU@@al@UK@_mKXKƒbUU@aVKmš@Xmƒƒ±@kbÇakLğVaUw@a@ƒmkUJƒk@ykw@£ƒWX@lknk@WVkbUŽVnUVƒL@‚mVkI@JUb›I@JXb™XllkLUmƒLmbV`kLƒx¯Lk„›VUV@VôXkVVL„V™V@xƒVUbW@Kxƒl™L¯kV`UnV¦°@"],encodeOffsets:[[118024,38549]]}},{type:"Feature",id:"1310",properties:{name:"廊坊市",cp:[116.521,39.0509],childNum:9},geometry:{type:"MultiPolygon",coordinates:[["@@la„Ušš@šUnL@VWbklWxnIVV„V@X„JlbUlšXVbn@@K„mV@@X°WVInJmn²@lmVbnL@amKV_kwlmX@@LVamaXaƒaVU@UnJVanLlUkaW@UaVakK@IlKUU@an@ln@alKUƒkIVa@a@klaUKUV@UkUV¯šKVƒV@kUmƒU@@a¯ImJUU@VV@UL@Uƒ@@WXUWa@Ukwm™@ƒX@@w@al@@aVIUmVUUUVWUknK@I@™l¥kU±a™™UUVyUwƒ@@I@UUWm@@Uk@@nUJU@WU¯@kbWlULnšÇ„k¼@llLšl@xUnóŽƒLƒlkXUxƒV@lWb„I„`°nnn™llŽV²¯x@JkbƒLU„VxmJX²@ÒWVÛL@lln@‚Xn˜šnV„L"],["@@@kX@Valaa@KWI@UXW@WanaUIW@UaUKķŽk_W@UVUKUš@bƒ@UamxVXnJUbWVXLVbn@W°kb@U@Wó¼mIU¼k`V„@bVbl@„lX@lUôVlUœIV`lX„Vn@lUlVn@„l@UVaƒIUWl£Um™VWU@@UUKlUUUnƒVL@KšUnLVWUa›@™U"]],encodeOffsets:[[[119037,40467]],[[119970,40776]]]}}],UTF8Encoding:!0} +}),define("echarts/util/mapData/geoJson/he_nan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"4113",properties:{name:"南阳市",cp:[112.4011,33.0359],childNum:12},geometry:{type:"Polygon",coordinates:["@@lKl@nVV@„bn„@VVnm‚nL‚LXx@š„‚VLlKVU„IXWÜ@șlbl@XUĊUlwnW„LÞw‚m@ÞUVmnVl@nX‚JXLm@VnnJla„I@VkxVb„@VŽln„J@knKVn„@°aVanal@XK°b„‚@š¯VJXIš„VK@al@nV„k‚@nK„a‚b„@XL@blVVKVLXK„@VaVI°mVaX@V_@a@yUkVw„VšIVašJ°™@anIlaV@nKnXÆm@wUUV±UUWUKnaWwXUWmŁ¯Vƒam@kakImƒUKƒ»lan@VXXa˜W@@UlUUa@a@UlwUƒV@Xal@@anIVaUK@V™XmwVmUmV„LXl‚@nalLnal@„šnKlkV@@UnJ‚UXnl@nVl¦V@@VnJ@nUVVVVIn@Va„JƗn@@K@m„kƒa@kmWVaUI@a@™k@@aUL@mmaVIUKUVƒ@@IU@mƒUmmL@K@UUUU@mW@@nU@ğ»mVmbk@klW@UXnV@LƒJm„™lUnUJ™UUUWƒƒ@UnkKƒxmLa@ƒ@@lUU™bmUVWk@@nkUmam@UakJU_ƒVm@ÅlÇLUVmVUwULƒKU@ƒk@UƒVUlU@@Uƒ@UaUUWaŎƒzJƒaWLkl™b@bmL@„kKƒabWŽUVƒ_@mV@b¯JmXUbUK™¤ÇLUU@b@JkLWmkUWIkJ@VmX@JUbVXU`¯VV¯blK@LXKl„UV@Um@@Uk@kxWŽkbƒL@KkbmL@‚UXmaU@@l@x@blX@xUJ@bULUlULÇ@@VšnU`W@@nÛ¼U@@VmKUkm@VVX@@xǚ@bUbVb@VX@@x‚LUb@lƒ¼XLlbUlVVU„Ub@n"],encodeOffsets:[[113671,34364]]}},{type:"Feature",id:"4115",properties:{name:"信阳市",cp:[114.8291,32.0197],childNum:9},geometry:{type:"Polygon",coordinates:["@@VllInJlknJVkVU@mXlUÞ`VnV™VU@U@y„@nXlKV„nJVkXKWaXI‚b@yVk„VUkVwn@‚K@nW@k„KlUXVVUlbnUV`n@V_V@llX@@V„b@bV@@nlVUb¯‚WLnbmb@ŽnLnK˜b„U„bVWnLlaX@VVUX@Vln@`kL@ll@VXVJÈIVl@XÞJ°Una„LlylU@UXKlnn@lanLWWnbVI@KXKVL@LVWVL@UVKUIVWX@@XÆJ@In`@lJVI@a„WšÛnK@UlK@UU@VK„nlm„nXal„UllLUbVVšknJ@nV@Vm@a„l@@xnV„„lJVUU@™w@aƒk„@XW@_mWnUlŁUmVKV@VXwW»XƒWaUwnkWUkVUƒU@@@WlaUkkaƒIWVkm¯xmIUmƒLUVƒaUIó»m@mmwXk@a›mk¯¯l™@wƒmkLmmU@UbkUWJ@XUbƒJ@b@l@znÆmK@Xk@Ub@lm@ƒI@akmVKUUVUkU@U±JUbkƒ@IWmkxƒa@UUV™UWVkIUaW@UlLWn@VkJƒI@VkK@L@bmKƒkJmUUaUKWXk¼VxnJ@„V@@VULV¼ƒ@@UkaUlWL@U@W@IkKmL@KULUWULWKUXUJmIƒb—KƒŽƒ²UW™nWKUUkLUƒmUUam@UU™@ƒmUL@xkV@„VV@bmV@Vk@mwkUƒVUx@mbX‚ÇnVb„‚UL¯šWŽnUVLVb@xnlWnU@UVUVVUbVVlVkn@llVUXUWUXVbUJ@bmLUJnb@nVK@bl@@š@bVJUbnX@l„b"],encodeOffsets:[[116551,33385]]}},{type:"Feature",id:"4103",properties:{name:"洛阳市",cp:[112.0605,34.3158],childNum:11},geometry:{type:"Polygon",coordinates:["@@VVUllLXl@LWn@J„@bƒKUVmnL@`VblLnbV@„b@JmL@LnV@VV@¯„VJVnXL˜@nm@aÞ@‚a„k@m„IšmVbXL‚ynLšk°@°aVJnUV@UVVXk@WJ@VXLlUnJVnnƒ°U@»°U„wl@šb„WmUXƒÆ@VLXU@m@U„a@I›mkb™a@naWW@_@WXUV@@U‚ƒ²@„K@I±U@¥kKWLóLlƒa@£Um@kWKXU@mlLXUVKUU±J¯_@`UL¯Wmk@Wa„kkƒlUnƒVUVaU@KUU@mmK@_ƒa@KX@VaUIm±™k„aVKVUkw™@kaƒƒW@kbkL±UUaƒK@UUKVak£ƒ@UmmL@lƒIkmUƒ@Ualw@UƒJkbmIUmn@WKImWk@mUUnÝV@ŽnÝxƒKmXkxĉVWVk@kaċšÛ@WXƒJUV@zŽm„VWnbUbVbšLlUnŽ‚lUÒnWV—VWnk@@Vm@kxm@Un™l@Ll@@V@šXnƒškJV„šV@nlVXx˜U@l„n@aš@VLnWĊ¦nxš@lbVKXLl@ރVLƒ„XJl@XXl`lIXVl@Xl‚XUVšK„wV@lanx„zUbVJ@VVX@b"],encodeOffsets:[[114683,35551]]}},{type:"Feature",id:"4117",properties:{name:"驻马店市",cp:[114.1589,32.9041],childNum:10},geometry:{type:"Polygon",coordinates:["@@n@„b°UƂXnVlnLÜ@VLœm@n˜@na@J„„m@k„@lVšVxXX@„V`lLV„XVV@VVÞLVV°„²@lašbnxV@@b„Lšmlm„_VWnIWUna@lšLšbnV°ƒVL@KšV„LVUVaVLXK@mÆXna@wVm„a‚@Xw@KlL@a„@Va@wUkaWnIVƒla@Kn@Vn@VUl@nKVn„J@LnK@aVkVUUWƒ@VakUVanI‚²X‚W@UUU°KnUVLl@XaVK@ašU@KUI@W@_lm@KkLUKV_Uƒ@»@UVJ@XV@@mVL@K@U@Kk@VwUUm@kmWL@VkVkzƒKmb¯VÝI@WUkÇJUIUWk@@klK@_km@UVWUUW@kbmKUXƒaƒV—amLmK@namaXK°VakU@mU@@aƒa@UW@kkU@U`m@U_mVkaUVWUkVƒL@lmX@ŽLm@UxVlƒUUl@zaWJXbWLUlmIUƒkLmWƒ@@z@VUVUšUmÝ_kVWŽ@nUVUlmIklmIkJUkƒl@n@Lm@؃IUbm@UJUUVU@mmI@UU@k¥mUk@WmVmI@VU@klmLƒ™k@mbkKmb@WkƒKUŽVnUnnxšW@UVLUbmJ@bk@WbU@V„kx@V@bVbkV@V‚@‚—XWbUWm@kb„¼VLn„lJlb"],encodeOffsets:[[115920,33863]]}},{type:"Feature",id:"4116",properties:{name:"周口市",cp:[114.873,33.6951],childNum:10},geometry:{type:"Polygon",coordinates:["@@lšnb@xlJ@UnLlKXUlJl_„KnV@xVL@bkbVVUè@šWb@„Ubmš„ŽkšVšmbX„VJnUl@„a°@@b„LVbƒlXx˜InmnLVw‚anJÆw²IlmnXVl°VVbÈaVb„@lkn@VWnLlUVmÞUUklƒkƒVkUaVaVaUw™K@kkaVWmw„_„‚l@nU„VVb@b„aV@VV@zXJl@@kl@šlœk°WVnÆbnbUšVJ„Iš@VKVm@k™K@_kK@a@aU@@wW@@k@aUW@IUWVUnLlUlVXKVwmk@W@—VWa„¥@k@lnƒUIÇKUaU@ƒUUVmIUV™Uk¥ƒVma@¯k@Wanwmƒ„@@n@@m@UIVƒkUVamUXWƒaV™U_™@ƒmUVUImW@aUIĉK@VmI™b@lU@@n™JƒkU™@KƒIUmmLk@UVm@UŽm@@LkbU„mJXlbV‚@xUbƒ@@bkK@LWx@ƒbUn@xmbÅW@nWLUKUbUVƒK™U@LUK¯„mU@šVV@xULUŽVL@bU`WšUz¯aUamKUaƒ@@xkX@x"],encodeOffsets:[[116832,34527]]}},{type:"Feature",id:"4114",properties:{name:"商丘市",cp:[115.741,34.2828],childNum:8},geometry:{type:"Polygon",coordinates:["@@XVl@lLȃ„@VkV@V»UanƒWX@VaÆÇô@ÈaVX@xVJXUÞU‚aVLĸbXKl„V@šm°Vn_ny˜XX»mUk¥lK@a„_@yšInaVKVa°_@WXI@ƒ@K‚VnIlbnaV@„l„@‚a@_w@ƒlwUKm™Xa@UV@š»Vƒšw@kUKVUUm@w±VUXUKUwmJUUƒ@km@@±mXkmUI™@mm™KUwkbWakLWaUIkJmŽƒX@l@@VUX@JWbX@VbULWbƒlUVULknlV@bVJk„mb¯KknWmk@@nmVkx™@ƒVmU¯KUnUL™@ƒJUIV™maÅaUm¯X›l™kk@@lk@WI@yUUU@ƒb@aUaƒUmVk@ƒƒ`nxUXlb@lšLVxUbUbVbUll„k„VlÝVUnkVmKUXm@klƒ@ƒnUx@xnxƒn@`VX@V²x@V@b@„Wl@zU`VUVVb„L@Vƒb™W@bkXllkLWV@V„@VVÈwlVœ@@X˜K²Llb„WnnÆL@VnJWn"],encodeOffsets:[[118024,35680]]}},{type:"Feature",id:"4112",properties:{name:"三门峡市",cp:[110.8301,34.3158],childNum:6},geometry:{type:"Polygon",coordinates:["@@WKUmUI°ƒU@@UmU@KnK@IƒaU@makKUa@_‚KnmVU„L@a‚ƒ@IXm@KWkkKVkUU@aUW@UUIVaƒymwkbU@ƒx™LVUWWkk@WUkJk_WWk@WI„ƒUK݄k@WKULka™@mwĉ¥mXUK™@@bƒm@k—VWwkU@m™UUƒlI„™Wm@™@Uk@@KškVmn@lwn@@Ul@Xm˜UXUmVсkmkV™KUaVamaUXnƒ‚@ykLUKƒ@™WwKmKnUm@UmƒƒaU@mUk@kL@lƒxċxUnkVmnXxWb@`kzWJ@V—LmVUn™lmUL@lW@Ub@VšXUbš`VLUbUJ@nmnUlUUm@@bUJlnU„š‚U@lxkbƒ@@XƒJUnƒ@kb¯VVVmlXXlJlzn@VlkVW@bkK™bmškŽUbVb„lƒXVxšKÈnšwÞlĊKlšVnKlwX@lL@xlUnVn„@šl@lmX@ƄÈb°¼ÈwVJlx„_°xšašlšUÈxlUnbVxnL@lllšbm„n@nb‚@@V„L@V„@@„VLšJnIVVlKnV„_"],encodeOffsets:[[114661,35911]]}},{type:"Feature",id:"4107",properties:{name:"新乡市",cp:[114.2029,35.3595],childNum:9},geometry:{type:"Polygon",coordinates:["@@XVlL„K°bUblbUbšl@nX@W„XVVKVkš@@Žmb@„Ubn„W`kL„LƒV@VVLnKlVXIlVš@@a„@l£nWlƒkVa„@°bnUlLVlna‚bnUVUXKlU@ƒ@lk@a„I°y„@ôkUU@wšmôšnkWakml™UkVmkUlmUUm@nkUKWanamU„LXW@U‚VnUln„`l„œblL°KXV@ĠJ@L°„šJšUVw„anK@UUImmƒkK@¯±Um@IVmUmmÅnWaUK¯aUk„w@W±kVƒx™U™VƒwƒnÅJUIWaÝJóI—bm`ÝbÅImJUI¯¥¯@mU¯UƒJmnUVóUkl±V@zXl„bWVXL@bm„mº@@XmJUXU°llk„@nWJk@U„@¦U`m¯ŽWx"],encodeOffsets:[[116100,36349]]}},{type:"Feature",id:"4104",properties:{name:"平顶山市",cp:[112.9724,33.739],childNum:8},geometry:{type:"Polygon",coordinates:["@@l¤UbVL@V„LVb²VlKlaX@„„lbš@lxUVULƒbšln²VJUbW@@L„b@`nL@nVV@LVŽUbUVm„kVl„ƒlXbl@Xn°ŽVK@_°`²IVVV@VUVJnInaWK@Uš@„K„LÆ@nmlXXWVUUw@klKVa@knyVkVanI‚JXUl@XbVUl@@aša@mXk‚bnK@UlK@UUUVaXaWmkUm¥n—WmXaWaœkl@VmÞb„KVL@aVI@mUwVm„@KōméUL™KVaUk@kUK@U˜WXI@VlKXU‚@VVnInVV@VLlK@UUƒkKU_@ƒWWUwU™@klƒn@ƒƒ@Imb—@@m›nUKÛ@mKUkWVXxmbVLXŽVVU²VV@xÅnmWmLU@kbmJ@b¯š™IUb™JƒUUxVl@z@bU`W@Ub¯nUJUbƒ@WLUKULkU@aWKƒ@aƒbmL@ƒlmUk@@bUL™ƒWJUI™°@ƒŽ¯aWLk@mbUb¯b"],encodeOffsets:[[114942,34527]]}},{type:"Feature",id:"4101",properties:{name:"郑州市",cp:[113.4668,34.6234],childNum:8},geometry:{type:"Polygon",coordinates:["@@@nWVUKÅ@W„nVnI‚ŽV@œkƂšwV@šnn@lxÞlnôJ˜zXJl@nalUČVlƒl@²UlkôVVUnm„I°VnV°@°¦VJnIÆJÞan_VmU@ama™@kU˜¥kaUklw@UIV¥kVUI@ƒmmUÅmUlƒwVU@amU—JWbUakVƒ—Vé¯Im`ƒk—@ƒwVWmLkU¯ŽƒXkWmLmx@UUƒbm@@x™J@LbW@UUVWUkVKƒ@ka™IUamKUkkmmLƒUkJUVWXkWmnÅ@ƒKƒL™@@VXLmbmJUIUVU@ULWVkK@nWVXL@lVn@¤„b‚kôKXKlL@¦²V@JƒL±@„@VU@WV@X@`XXmb@Žšblaœn@Jƒb@V"],encodeOffsets:[[115617,35584]]}},{type:"Feature",id:"4105",properties:{name:"安阳市",cp:[114.5325,36.0022],childNum:6},geometry:{type:"Polygon",coordinates:["@@°kVaV¥kVmUkWkWVkVKUwkkmKUU@a„wWWXWakKWkXmlašIVmX¥ƒU@a„@WnK@kƒƒ™V™I¯ƒ@KğI@WU¯LkK›akƒƒ_kmmVU@VWXƒKnVmbXbVLmln@VVknlVUnVlkšlnXbmlmlXblnÈlWbn@@nšK@V„L„bVV°VVzšlnš@V™xƒI™b™ŽU@WLUa¯V™UkWõ@¯kkmxk¼l‚„XUlVbVLnlULmU@lƒLkVUlƒX@xW@¯mUƒ@UmIUW™L@aXa˜kU™¯anƒWk°@k™kKmmUIWaambUkkKmV¯aƒ@UblŽk„mXk¤ƒ@@b™@UbULWVnb@lUVVnmšnVVU„J@bWXX@WJkL@blVU°UV@XlWnXUbW@UVkVšVWbnLUJWLUK@Lnn@blVU‚„nUblxVUVJXU„a˜@Ub„LnUVV@mVIVVn@UbV@‚XbmbUV„_lVXUWanJVI@WkI@WVIVU°WXXl@la@mX@lLXl‚kVbœm‚X„ylIXJV@@kšKla²UVa„IVyÞb°LlVna@UÆKnLVbšK@anwU™"],encodeOffsets:[[117676,36917]]}},{type:"Feature",id:"4102",properties:{name:"开封市",cp:[114.5764,34.6124],childNum:6},geometry:{type:"Polygon",coordinates:["@@lUVbXa˜InV@bUV„x‚knVVÆnn@„VJlUU¦VJ@kxVllb—¦lVš@nb@bVŽUn˜aôJÞIXbVJÆI„m„xšUšV„w‚U²l@XƒxVl°bVLXb‚`XklUnmVblLœ@lmšx°LVK@UXIVašWlL@Ukƒ°KkVaVUXmmI@UÅKmmƒXka±K—L@W›@kUÇxUUƒ@@UXUlKkklW@ašX„a@UƒKUaVUUV_@yXk@ƒ@a@U±w@UUW@_„mmw@wVw„mUaÇbUa¯UUkmWkn±JÅxmIbUxmKmn—JWw„kUaƒK@a¯@ƒbk@mVUIWƒ—Lmwm@Ua@WJUb@LUl™@UUmLUbWJ@VL@VmXWWzUJUꄘ"],encodeOffsets:[[116641,35280]]}},{type:"Feature",id:"4108",properties:{name:"焦作市",cp:[112.8406,35.1508],childNum:8},geometry:{type:"Polygon",coordinates:["@@V@VL@x@bXŽWV@XkššlUŽWX@J„@nI@KlL„KšUVaV@œJlL@KUk@KÞL‚l²_‚@nWlL„UVVš@nLWVUJVn@anV@a„wÞUVLVx„b„@lW„@lbXn‚Vn@@¼šL°mšKVn@bnl@nVK@blb„L„W„U@VWLXV@nlKn@lVVbXw°nV_@¥Vƒl@XI@mlƒkkV¯VWnI@W‚@n¹nƒ@aWKXUƒaWk@yk@k„ċUkVmbk@WI—yóImÝkkwm@™mU@™xŁ›lU@mJƒX™ak@ƒx¯V@¼¯Vm„UmmIkVWK@UXIl@UWVUU@mVUI¯b¯@™lmKzWKUa™nƒJ@nƒlbÝ@@b"],encodeOffsets:[[114728,35888]]}},{type:"Feature",id:"4110",properties:{name:"许昌市",cp:[113.6975,34.0466],childNum:6},geometry:{type:"Polygon",coordinates:["@@lI„VnKlnVlnLVbšJlb„@ULVlUXVVX@‚a@KšI@wn@„aVV‚@nwnKlX„W°lVnKUX„x˜@„ln_°JVIXy‚XnW@U‚K@UXIVanKVVš@Vk@KVaXI‚@Vbn@nx˜KnaU™l™ƒn™Va@ƒXa@™VçUUla@aUK@wmUƒLk`kIWVkLmK@V@XUlƒn@JXV@nm„™bU‚óIƒmUa±@@ÑóVUUk@UlKVU@akWVUUlUUaUK@UUKWbUkÅJ@XWaƒ@XbmJ@nUJ@bUKƒLÝaUnk@›lXbWbXnm˜n¦lVXnWbUbVV@VkL@VmLaWl@n™b@bk@UVWak@WVImJUbUlmz@lUbkL@lVx"],encodeOffsets:[[115797,35089]]}},{type:"Feature",id:"4109",properties:{name:"濮阳市",cp:[115.1917,35.799],childNum:6},geometry:{type:"Polygon",coordinates:["@@lLXbW‚XXƒx@bVVnLllVxULUl‚XXlVlUnlŽU¦Ub¯l˜nœK@V‚bVb@šXbVL„KVxVVnIlašb„a„¥lU@wnalLnVVlVLXnlWVXn@@lVI@WnU@mƒÅW¥—aW_k@WwXy@kmƒ@wU„mš„š¦šlUxVLV@UwšJ°xš@VX„@Vb„@š`VX@VX@llšIVbnJlI„bšV„l„˜J@ƒmѯLóa@ƒƒKUa„k™ƒ™Xƒ@UK@wU@ƒlWUUݯImW¯aƒLUKU@ƒkƒ»k@mƒwƒa@UnKWI@ƒUU@akVWK—k@a±ƒbóUWKXUmk™KUmLƒbUx„„@lmLXŽƒ@@b„VW¦Un™JkbWnXl"],encodeOffsets:[[117642,36501]]}},{type:"Feature",id:"4111",properties:{name:"漯河市",cp:[113.8733,33.6951],childNum:3},geometry:{type:"Polygon",coordinates:["@@@Lƒ‚UnVxnIWa„@Xb@WÆIVlXaVL@VVLVbkVVŽUVlX@bUVkLV‚l@VVôU@Ò²@Vb„nôJVšanƒ@mWU@I„mVk@WkI@wmak™@wlW@w„@VbnLVb°bVyX™V_@aUKVVK@wUU@™™a™K@kmbXVmJUXƒ`kn™nƒK@aU@mw™akb±@¯ƒUUÝKUUU@WU@VkLUKU@mUmJUU@WVkL@UWJ—X@VVL@lVlUbšLVKnêƎ"],encodeOffsets:[[116348,34431]]}},{type:"Feature",id:"4106",properties:{name:"鹤壁市",cp:[114.3787,35.744],childNum:3},geometry:{type:"Polygon",coordinates:["@@ó™™n@xVVólƒ@¯zƒJ@bkl@@„kVWLUVmVXbVJnnlLlš¯@Xlm„°bVš—lWb@bšKVXnJ@VV„°nX@@w„WVklU„K@knVVKmkUKUaVkƒWkl»nwlŽ°lö@lXšV°UVbXKV@šša„Jšw@Um™™kUy¯UUUƒaƒK@U™L@mm@XaÇkkmWank"],encodeOffsets:[[117158,36338]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/hu_bei_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"4228",properties:{name:"恩施土家族苗族自治州",cp:[109.5007,30.2563],childNum:8},geometry:{type:"Polygon",coordinates:["@@VK‚bX@lbUVnL°„@VlVnUl@VUX@„aVƒmaXƒlašUUU@wmaVUn@Vƒnmmk@m™U@kna™aU¥Vam™X_@WƒU™mW@_kƒVaVKnL‚lœ@VVal@k¥@kUW@kUKVUlUVсW@kÇaU»ValmkUVUVak™@aƒV¯_@W‚UkmVUlU@aœƒƒalI@akkVWUaWXUWwœWVbÆ@„„l„alIVK@U™m@UU„W@al²a‚¯UağÇm@ƒbkk@wƒ@@W™aULmxƒIU‚™ƒb¯@U`UX™JmL¯aƒKX›WUL@aknmK™@aWUXaWm@I@UÅmVU@™™aUV@b™VƒI@WkU›bXkm@VakwUKULWKXmJ@XUK@ƒmL@KUwVaUI@KU@mmn™mXka@»V@@UUaƒw¯yVk@ƒUUVmmkÛÈU@mWUnmx„šmlUbV¦UlbWVUL@UUƒ™IUmÇKV„VbUVVxkn™LUxV`VX@š„„kJVVUXWaUVVlUnmKUbkI@WULmK@L@LVlƒLnmUIWV@aknƒ`VXUJIVlUVVbUX@¤mbnLm‚m@UXk@mm@Ukaƒ¥@kV@@KkU@aUKWbkLWVkIVŽk@UbVlmX@bU@@mmL@bn`@Ln@llVLVk„@XVVU@`VXUš‚¼k`VULka@VllVIn¤VU@@bl܃bkx@bkL›škKƒn@bn@@b@JUnV`UnVbVKlVXUlbn@°ƒVx„@@b„nVbUllVn@V—VK@UnW@UVUšlnk‚VÈޚxVb„VVI„xVaÆ@@aka@UVaU@@a„k@Wl@nbVIƎ@Jk@„L@VlXnlla@VJnw@UmwXU@aVK°ÒnllnLlb„xnKVaV@l¦²nVl@llL„x@XVVœ‚Ķš@našx@U@al™XUVa‚LÈþV°XxWXkK@šmLnlUb@b‚xnLVlVVkb@UJ@xWXXš"],encodeOffsets:[[112816,32052]]}},{type:"Feature",id:"4203",properties:{name:"十堰市",cp:[110.5115,32.3877],childNum:9},geometry:{type:"MultiPolygon",coordinates:[["@@@a@w@kV@nbVK@ƒnUla„@la„Ål@nlVakwWX@WkLšaVmšwV@anK@UlIXmWkk@@mmLkWlwk@U_mKXwWK@U¯K@UU@ƒVUa™kmƒkI™yUUVUmanU@mlwkƒ@_mWXaƒUWU@ǃ@U@aUaVwUKUIƒVkK@UWIXƒmaV@k@Vm@UnwlƒUamk@V@„ULUamxUJkU@Iƒ`WkkK¯XWak@@W@IUV™LWJkXkaÇVUKƒ@kUmbmUUƒUKƒbkKWUkI@ƒkKÝ@@aƒUm»nI@mƒU@UnWV_@aUmWbkLUl¯b@a›kkk@WkkJm_k@UV±@J@b›nU@@WÝIUJVbXL@nlJkx@„Wn@VkJmb—LmUƒ`VbUL@xVn„@XVƒŽ@„mVVnnJVbU„ƒx@„V„nVUbVVƒx@šn„™bUK@bƒ„@bƒJ„šm²„VU‚lbXzVJV„„JVbn@@Xmb@V@bVJÈ@‚Vnkn@°aVVV@šX„KnalLVmšUnnVKVlnLWlXX„Klk°š™šXŽWškLUVVV@nU@ml¯nmbk@W`Å@mb—LWm¯UƒxnêVèk@mbƒVƒnUK™@kKmXk@@JUI›lÛLllnbVnlJ@LULnlÆaVLnŽV@nkVJ„@lkô@²bÆm°w„L„WV@VXšKšVXI@W°ÆVšK„b°U„JVIVV„¦XKVL@l‚InaVÝnUl@@bX@‚™nmVL@lVL„lVLVUnbVW@xXn˜bœU°¤V@š™„a@kWKUUn@VlnL@UV@Ü»@mX@V_ƒakaÞ@VK‚¯@kkW"],["@@mUkUUm@nllVKXXVK"]],encodeOffsets:[[[113918,33739]],[[113817,32811]]]}},{type:"Feature",id:"4205",properties:{name:"宜昌市",cp:[111.1707,30.7617],childNum:9},geometry:{type:"Polygon",coordinates:["@@°`„U@blšUbUVlVkn‚ŽUbV¼Èb@l‚XUÒkVUVVL@lVX@ll¦k@UbU‚›@kmKULUbl„@`nXšŽ„V@XW`nšUbV¦šbmb@lšV@nnlmnU„m@UVnb@xVV™VkbW„nb‚VnVa@an@UaVU‚JXnWlXX@l„¦@ŽlKÆX„bX‚V@VV„@°¯°xXx‚XV@nV°UVWU_VWXkmaVnWVkn@lln@lb@UVLXWlnX@˜aXUmaVK@UXU„U@WVI‚W„XXV‚U@¥VKœ@‚Uގ„„‚a²LlV@kV@UanKma@UVUnK@UVLXyVL‚knJ@UV@@UXKWUXaV@Vb@mVLnKW„m@aUUm@@UkK@Ula„LXKWaXI@alKlmUk@wVKXL@m@WWn@UVa@K@wna@aW_XWWkXbVW@k@U¯WWwka@UUaVIVƒkU@m±@U@@wVKkaš_@VV@XUVwU¥‚šyUkm@V±ÈUKk»ÇL„m˜mLk@ó£kmWwƒm@U„IkWKXwWU@ƒkLƒwkbmaƒbkK@VƒLkmWIUKkUUƒÇIǫJ™XÅJULVŽÇLUVƒ@UK™@kI@WVI@UaƒWmXVVUL`±kÅLmKkƒƒkƒÅ@Ua›XXxWVXŽVbUXll@bkJ„b›„@bkVUVlnV@X"],encodeOffsets:[[112906,30961]]}},{type:"Feature",id:"4206",properties:{name:"襄樊市",cp:[111.9397,31.9263],childNum:7},geometry:{type:"Polygon",coordinates:["@@@Xl@Xb°WlLXl„_@JlVVInwVbVK@ƒ@UnlVbk„mx@VUnl@U@nbW„XJ@VlL„UVJVLUxVb@b@VȄ‚@XV„VWbnX@`l„kx@nmVnbUVVVšzlJn„šlVb„UV@@V°L@VXLWxnLV`l@kxlXnK@nl@XlWn„`Xnl@@UVa@VÈKš£VLVanW°U@UVU„@„`VIn‚mV@„nV@Xa@aVW@UšalkXKšblI„yƍXnlJXbl@@VV@nklU@`„nVK„LVKVb@V„U@UÈK„UVKšIlUX@V`lIVbn@nblVVmV@@XXJšUVV@knKVn@`@X‚VnK„wlLVmUUU@ƒU@aXL@WlU@UUW@UmU@KkLWaXkWmXUWm@U@ƒnk@UmK@U@UaUVUUKV_@al@namWUI@KUƒK@aV@WUIƒbƒ¥ULUJkIm™ƒK@U@K™V@U@a@UkU@K@wVaUwlU@mUƒULmKUkV@@anIWmUK@I¯„mKkl@LUb±lUakLmk@WwUKÝVUIm`¯n@Uk@makJU_@ƒƒJma¯ImwUVkKƒb™aUÅ@wWaU@VU@mXIVmmUkJkwm@mIlUKWzUK@VmLUV@VnbmLVbU@@lkU±KbƒƒÝV›@UL@¦VWUƒWXUJ@XƒVWV@VULnbWV—bW@kmWXUK@Vkam@kkm@UlmXUŽnbWlUXV`UX¯VmUU@Ul@Lll@nnJ@LƒnWmbmš@b™`ƒš","@@kUUm@nllVKXXVKmU"],encodeOffsets:[[113423,32597],[113794,32800]]}},{type:"Feature",id:"4211",properties:{name:"黄冈市",cp:[115.2686,30.6628],childNum:10},geometry:{type:"Polygon",coordinates:["@@VVUnWVXnVJ@„‚U@V@VXŽV@@IVJUnŽ@V@L@KlIVlVanLVbnVlI„ƒn@@a@Kl@@I„JlI@aXU@KlK„kVblJXU„VlU@V„bVkVKXn@VlxVa²I@VlVUxln@bšJXklaVWnLmÅ@y@k@ašI@W@aXIlVVaV@nnlKnLVW@IUa@a@K„UVVlI@wXKVV@IUƒla„@lUXwWƒnƒnalLlxXLll°@XwVKVaXIl™nb˜@nln@Va@U@k°ƒUmÆUVaXI„JV¯ÇUmmkU@WaKmakVm@U@aVKkkmKkVmIkÇ°£@aUUVaVVnKlkX‚mkƒ@ƒlUVaX@@Um@‚™UmlUXV„UVU@w‚K²¥Ua@I@UV™l@U™V±UIUÇ°»VkUmVI@a@U™m™ĉ™¯V±bŹĖğaÇL¯lmŽkX@‚óĀ@ŽmšÝêb±WkLƒn@xXx@Ž@b@V@LW@UbƒlţXƒ`kxWnXô¯¦ÆV@L@JVLƒxkK@V@bkz°l‚lXz@J„UlVla@XUV„bVKXnW`XXV@laVV@V„X@V¯xƒx@xULVbUJ@n@LU@VmmakbUK@b™IWWUUVkUmkLm@VJkb@nUJƒ@`V@kX™aUaVmmLkUmJ@Uk@U„±lkzmJUb@b„VUxVXU¤ƒL@JƒX@VlL@JkLUVU@mnUl„¦@V"],encodeOffsets:[[117181,32063]]}},{type:"Feature",id:"4210",properties:{name:"荆州市",cp:[113.291,30.0092],childNum:7},geometry:{type:"Polygon",coordinates:["@@ÈJV„lVVLXJln„K@UlL„anbla„xlK@„XVWxXLlƒJ@V„nXxlnô¤l@nKn—‚ƒÈKl¼VL²Ç‚Un@Vl™zŽV¦UxWVU@@U™`lbUL@xV@²@@nlVU„UJVb@VlbXx°XVWX_VKUwVKVa@UVKUUVk@KnblaUU@wnWl@UX@lÆ@@a„IVmUk„™šxVJ„U„bܙ@Uk@WWnk@Vƒ„™Vm@I@m@Un@m™XUlVlUnJ@knJVU°@@aÆLX@ƒllL@¦nJV@XblLVa²U@UlWš@VX@`@LV@@bXJlIXml_lJœU°b„KÆLnVVl‚@ö—Vƒ‚mXaVIĢllUlVnLVlX@@b‚ašnnxšV„L‚bn@°ÆXmmkĉƒ¯w±™™™Uċ@KÝÅƧŃÝ癙Uw¯ƒm™¯k@W‚kV@¯UIUJW¼kb™Uƒwk@W`@¦Uônb@VƚlÈ@VU@ƒƒ£UWWnUÆUnmJkUÇ£VWUI@aUU@WkI@Uƒa@JW@k£kaWVUKmnkKƒb™kkVWb—VmUUmwU@kk›@UakUUa@V@nlx@lUb±lUbnnWLUyk@UamœUK™@mlk@Wb@VXL@x@xWI@a¯Ž¯V@bVn@LkKmL@`XmKmVU@@bkL@V±bk@Uaƒa™L™KUVƒIƒ„™W™XamVVbUK@b@Lm@UWkxULWVUnm@UlUX"],encodeOffsets:[[113918,30764]]}},{type:"Feature",id:"4208",properties:{name:"荆门市",cp:[112.6758,30.9979],childNum:4},geometry:{type:"Polygon",coordinates:["@@n@lxlInVUnWJ@nUVV@Xb@xVƚb„alLVUnx°Jnb„I@„V`lInbl@@V°mn_VJÞUVLXx‚@nllKVb²kVa@KlknL°ƒ@JVLXnmJ@bU@VlnLVKV„@nX@lUšKVaXal@VKn@¥°L@Unw˜bnašV@KV@VUX@lVXI@KW@@IXWV@laVL„„KlaXUVVnkVWV@lwXblIXWVkVmšaU£VaUmVIkU@y@WakKUamU@UUK@kmK@w@@mK@LƒV¯™U@WwkmULƒamVVUU@ƒƒIƒbUKUa™kmƒm@UakLmxU@UÒWlULţÿmwkIUm@a‚kÈblW@UVƒUUk@JW@XkWWUkUKUIlw@aUWknWUUmnIWƒ™aUwVaۚƒaƒVUI™wƒšVlUnƒJ@bÅ@@kVWk@mX@xVVkbma@LUlVVUL@VUbULVxULW`UX@V@lUXWaXlWXX`@bmb@x@LUb@VmŽXX@‚@nWKUL@xVlknkL@bWJXbWLƒKkb@VlL@Vn@VV@bƒnX‚mLUK@nUaU@WbXVWL@VU@@V"],encodeOffsets:[[114548,31984]]}},{type:"Feature",id:"4212",properties:{name:"咸宁市",cp:[114.2578,29.6631],childNum:6},geometry:{type:"Polygon",coordinates:["@@ÞƂLČ@šV‚š²š°xĊ„nlWnŎ¯m@aƒK@„„°‚n„Jšwn™VIUaÆJšÅ@wšwV™XW@aV_l@²V°lĊwlaXLšwlUkalVVaX@lVXI@a˜UXJ@U°UU¥VIVKVklanLVa@VÈIVV@nk@aVa@mV_@a„K@klKUa@UnKWk@@lU@@UW@@nUWUwmaVIXƒ„lV@mLXblJ@kV@kk@KU@WƒkUWVÅwkLmW@UmL@lUL™KULƒak@maUUÝwUJƒIb›KUUƒ@š™aWK@kUWVkUwVw@™mÝ@™I@wkW@a›ww@LU¥™kƒJ@nVJƒIkVVnkV›UkyUIUl@xWUkaW@@°kz„ŽWxkLUWmzk@@bVVVš„b@‚@XlVœ@Vl@bVbUn™`Wn—@Wb„VVI@`„LVbXLV`mnU@@lƒL@LUŽƒak@ƒLk@WbUJn¦@lVb@xVb@n"],encodeOffsets:[[116303,30567]]}},{type:"Feature",id:"4213",properties:{name:"随州市",cp:[113.4338,31.8768],childNum:2},geometry:{type:"Polygon",coordinates:["@@„@nš`lw„k„ƒ„UmUVWX@lk„@VanUĠ¼V@@mX@@nVV‚VXLmJVLnK@b„V@@J„@VUn@VaVUUUVWVLV@@Kk_@almaVkUU@WVƒVUVLXmmk@wUaUKUV@°™@kmaUaÈmW„mUƒVklaX@lVnxl@@UnaUk@ƒVUVwVK„nš@VVn@VbVJUknUmmVmk_Vw„KUUm™Vak¥@UVKVIkW@UmIVWkIVƒkmmLkwmVUƒ@LƒUU@VVXL@JmLUbmK@UUKmkKUUmVUaUnÇlk¯™mJUnmLUaUJUaWL@UkJ™ƒUƒ@ƒaklkU@¯@KWLUmUUWVkbƒLƒŽUKkbU@WX@JX@@LWJkUW@UVU@@L™Umb—amx@V¯K@¦mŽULk@WbUb™LkVW@kVVxUb@x@LlV@V@b@VšU@L@V„LnšlJVIVK„¦„aVJ@XUŽ@b„LV‚@LVJnXmbk@@bU`VLUVV‚b@V@VnL@Vml@„@VXnWVXnWlXblK@LnV@VVX@VkV@XWK@b„VV@VV"],encodeOffsets:[[115830,33154]]}},{type:"Feature",id:"4209",properties:{name:"孝感市",cp:[113.9502,31.1188],childNum:7},geometry:{type:"Polygon",coordinates:["@@VnXK@L@°lVlk„b„@„VšlI@VXKVbVIVbnKVmnI°šlŽÈkVmVbnUVVlLnVL@VnLVanK@IWKUUV@„V@KV„nUlxnKlnU„lJUXnJ@VlXUJUL@Vl¦UbnšVVƒLUxl`UnnnmVVlnVK„bšmVX@a°Ý°LšaXJV@VUnKVXVK@LnKlLUbVVX@VwVJVn„@@UU¥V@@UUK@ƒmaUVUkkJ@L@K@UmVUI@JU@W@U@UV@ƒUIWmXUVmUUÇ@UVmIlmnmakK@akaW@UwVUkKVnUlKVwk™ƒVU_WKUkVW@UXaWkUa@w@VU@XaW±@IkbƒKƒb¯L@WƒXkWƒ@UakL@UV@UmVUmL@UXWVL@ašUƒVUUUVU@yUUƒIUa@wUKWVU@kƒ™™Wk¯UkwVKƒLUx™K@nVxUlUUWVUmw@wƒUUyXWlX¦WbUV@„U‚@blbUVVbXXƒl@lVL@bk@lxkVVnVx™¦ƒ`UnkL@V@L@Ž‚@@xnL@lVL@VnVVblLXb@‚@zlVUJVnUbV¤™bUnUlWXkJWakxU@UXml"],encodeOffsets:[[116033,32091]]}},{type:"Feature",id:"4201",properties:{name:"武汉市",cp:[114.3896,30.6628],childNum:1},geometry:{type:"Polygon",coordinates:["@@nbnm‚knJVUÈ@@Uƒ¥VknmV@VUlK@IkK@U„W@I„KV£UWVwƒU@aVanIly²kVƒl@@VnIlVnKUnVbšblWU@@_„‚VI@mlaUIn@lKVnUlVVXXšJ@aVLlanbUnV@@K@mVIUaVK@w„w°w@UƒW@UUUkbU@WWX_WmULƒaVU@WkbkUƒV@IWyk¯kly@a@UlL„wUK@I@KÅUW@ѱUm@wl¥kaƒ@@_Vw@ķƒa@akw@ƒkKW£XVUVwVwUaU@VUU™™xWKkbĉx¯k±Uk@U`@bWXUš™x@x™ÆÅIVbUJmš™xƒImƒ¯@ƒ™Umx™nUVVbnJV„@Lƒ@@ŽkV@bVnƒ@UVULlx°VXlššl„V@XUVL@xVb„JVV@zUVVVUV„™V@bUKWX@VnKUVVnU@@VlKVb„@lX„W@X°K„a„Lla@JX²Wb@ŽUV@@xVbXlWb@VUXVlXLV`Uš„lŽUxkLmVUŽlLUVVxX@lb@blL"],encodeOffsets:[[117e3,32097]]}},{type:"Feature",id:"4202",properties:{name:"黄石市",cp:[115.0159,29.9213],childNum:3},geometry:{type:"Polygon",coordinates:["@@VšUVV@VbUx„aWUœblUVmnKlX@bXJVIlVUxVVVIU‚zlx¯š@‚VbnL@x‚x@UVaXK„b˜@Xk‚WU_Vm²klW„XVK„Žl@nXV@@w„mlK²X‚aÞén™@ôÿ@lWn°kUKmmUљUmm@ƒwkImWU@UakL@bVLUVċ@™bUK@alIXKWK@™nXnKmkUVwƒ@¯b@L„lUL±W™n@KULUaW@kL@lƒL@bU`@nUb@bmlU@UÇJ@UUbmKkblŽUULUJV¦¯V@VWI—V@bWJkUW@UbkUlbkV"],encodeOffsets:[[117282,30685]]}},{type:"Feature",id:"429021",properties:{name:"神农架林区",cp:[110.4565,31.5802],childNum:1},geometry:{type:"Polygon",coordinates:["@@n`lIXll@lœl@b°aVklKXaVn@bU`mX@V„V@nmJn¼„V@bÞ@lL@„lJXVlL„aVLV„nVnalV„@VLÈUlblWXIšKVU@J„™š_‚@an™na‚X„m@KmI@mkk@KVkWWw¯w¯°ƒ@UUU@WƒaÅWkL@ƒ¥@kWWXkWmIUVVbm@@bUbmUU„ƒbW@UVk@mVkU@U¯ƒmKVUkaW@aULƒÆVbƒb@VÅ@Un@VƒLWl¯Lš„"],encodeOffsets:[[112624,32266]]}},{type:"Feature",id:"429006",properties:{name:"天门市",cp:[113.0273,30.6409],childNum:1},geometry:{type:"Polygon",coordinates:["@@@K@UlKVm„_š¥UwUmlUkwl@@aUK@k„kWWUaVUka@aV@ƒVUXaW¥Xk@WWIklm@ÅxmI™VÝUkxkaƒ„@bWJaUL@„W@™l¯UULU‚ƒbƒkV™Ua¯bm¤UnÇUkmUšUx˜b@VkXÇal@bVnlJnxŤĀVKXkVÑV@nwlKVbn@n„šlVbVL„a„J@„VV‚UnU„bVKlnXxV@°š„U@KnL"],encodeOffsets:[[116056,31636]]}},{type:"Feature",id:"429004",properties:{name:"仙桃市",cp:[113.3789,30.3003],childNum:1},geometry:{type:"Polygon",coordinates:["@@VK°VškX@@ƒVK‚bXI@a„ƒlblwÞVšUnJÆwn@lkXJ@X‚WVz„V@xnx‚VXUVVVkUw@mšLVw„KVU„@Um@alU@„@@KUƒmIUaVUšmnwmw™mb@aW@UkmKkUkVġkUJWbnU„õ˜@UkmUÅKƒL¯a›VkIk`WnkJƒ@xVLUVVbUbk@WlXbm„VxnxUblbUV™@@VUV@nVL"],encodeOffsets:[[115662,31259]]}},{type:"Feature",id:"429005",properties:{name:"潜江市",cp:[112.7637,30.3607],childNum:1},geometry:{type:"Polygon",coordinates:["@@UbVxšbX„mJVnXVlmVX@bkxVJVLVlXXWlX@@IVl„V‚U—aVwV™lnÈVVmn£°aVbUš„l„aVUK@mVU@Uš@VUkaVamwUwnƒWaXkl@VaUaVUUK@w„WI@aU@@K@_UW™@kX@V±VUbkKWaU@mI@¥kK„kW@ÅK@b¯@UVmI@lmIkVkUWVnšm@@V@n@JUnƒšU„@ŽmlXXl@@V"],encodeOffsets:[[115234,31118]]}},{type:"Feature",id:"4207",properties:{name:"鄂州市",cp:[114.7302,30.4102],childNum:1},geometry:{type:"Polygon",coordinates:["@@°¥WóXmlw„_ŤW„kVaX@@K@U@a@WwU@mWk@ƒULƒWkX±lUnV`XWl—@ƒaWLUb@Vw@wmKUa@°™kw‚yVUJUUVwkUUJWI@akWmLUnkV›aXVƒbUxUVWX¤lL@„lx@b„b@ĸUx@`„@lbk¦@x‚n²VƄX@"],encodeOffsets:[[117541,31349]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/hu_nan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"4312",properties:{name:"怀化市",cp:[109.9512,27.4438],childNum:12},geometry:{type:"Polygon",coordinates:["@@@n„‚@b@XnJ@k°x@aVUnl‚UXnV@@VnJWUJV„nIVV°ŽUbVVVL@Ž²LUVa°V@aV@nm‚UXblLXWVXVmVLVK@an_„`@X@l°„VlXXW`nX@Jmn@b„@nV@Lm`„bUb‚n@VUVl@nIVbUlƒV@LkJUnVV@xVblVUbU@ƒzUKU@mx@xUnn@@WV@lbUb@šnVWXX‚V@VIV@VUnJ@VUz@JWbXllI@VXVVL@ŽVn@„„Wlb@„Žl„XVlL„aV@VJ@XX`„kVwVl@bk„‚bUŽlVXIlƒnLVa„mVwV@@nV@XaVJVbX@lwV@n„@nV@VWnIVVUŽÆ@Xx‚a@I„UUKmk@mVƒ„IXmWUš™VJnUVU@anaVwk™›U@UXa@W™@m_@a¯@@K@UVƒ„bnK@blIlbXa@WW_n@VƒU@¯bmyƒUkUJÇÅ@WU@kWKÅwƒnm°KVkmankVWnXVWV@UƒƒwXkV@mƒ„UlLnaƒVaX@VUn@VnVK@xlnXWšU@a™@@klak™Vw™mUaV@™wmIÛ`m—@mVUXmlIXƒV‚I@K@aU@UaV_UK@wkUmmUKWXŽmVkUƒL@mƒƒU_nK‚™@aVU@Ukak»@U™™@ymUƒ„¯™ƒUUƒVKkam@™nka@ƒmwkLWb¯mkaƒ_VaVKUƒ™IUw@kKmU@WK@UnƒmaULkU@wUalWV¹U@@WUI@WU@‚_@W@U@mƒU@WbbUK@Um@@UmbUwWWkk@WU„a@anUUwlWUwUU@wlJVUnnV@@mnI@m‚K@U@w„a@wUm@_mƒVUUaVUkƒƒƒ_kċUk™VWLƒ@mlU@kn¥W@UwUWV@VÝU@lXLWVUbVLXlVIl‚knmU@VUJk@@„ƒ@™kVmwmVkxU@@XmVUb@xnKVLl@VxUxkIU`@bWVXX@JWL@bkb„¤@bmUUU¯Kƒkmb@V™VU„VVn@@„Vb@`lnœxmb„lUn‚bk„@xU„mV@bmWbUV@VJ„Il@nVUb‚K@nn@VbnJVIlJVkXJ@X@lmx@bnnWVXJWXU@UlU@mk@@llb°x„IUbnJ@VWbXVmI@JVX@bk‚@bWL@JUXUK@U@Uƒ`n@@Xm@XVW@@nX@@`ƒImxU@@JUI@KƒLmK@UÅUUV@VW@™¯kUU@UamVUUmJ@n„xmLKƒkmJkwkKm_mKXU@aƒU@b@Wk@ma@zUJVUmbUlU@™xnXlWlXXblK„¤V@@nUVVLkVš„l@Xb@VVK‚nXKVx@znW@X‚@@lVK@X@JXbWbnn@JUamLVVXIVxnK@aWUX@˜x@VnI@WlI@anV„IVxk‚l@lbXXšxVVVJVInbV@@ln¦ml@XXVWbkJWb","@@XLVKVXVKUa@UUUmV@l"],encodeOffsets:[[112050,28384],[112174,27394]]}},{type:"Feature",id:"4311",properties:{name:"永州市",cp:[111.709,25.752],childNum:10},geometry:{type:"Polygon",coordinates:["@@lxUXV‚lXUVnlVĢ„JVbUXVJV@XUW¯„VIUK@klW@Un@„nl@V`XUVL@l@šVx@„XXW`UnUbšxUlVnUšV„lb@VnJšUVVVInJlUšVnwVklKnw„LVJVšV@nIV@nbVa@KVVVUUa„KV_nVVJ@_VW„nV@n¥lI@anƒl¥X_VKlwVlULUVVVš@šU@VXL˜ƒ@IUmn@VU@wmKXUWU@m²šl@VIXWWkWUkWlkIVamUXamUnmWUU@@Un™lK@XJl@kVUk@mWKXkl@@aVU@UVWUUVa„In`VUVLnw@U@K@Uƒƒ@w@UVmUUƒ™°K@UnV@bV@Xk@KVm@amk„aU£VWUUmUUwm`UbULka›KXU@kVmU™@aV_UWVIn@˜y„XXK@klmV„V_kWVUn@WUU@UƒmaU@™wnwWanUmmXkƒam@UakLmK@b™xUUUU@Km¥Vaƒ¯@ƒkUaVUlm„UU@mUUÇmUk™Uyƒb™bUa™XUWWbÅLmL@V™aL@WWXUKmmk@a@UUK™XW¥kU@VƒUkxmVkUWbUJnVJ@nVJXzWxkŽ@lVbUX@VVL@`mbUnšŽUn™VV¼k@Ulm@mwLƒb@lmLUK@UamƒWkƒK@£Ua@ƒ›UkJkUmbVlkX@bWbUŽVŽnnUVl„@bšbVK@VX@lb„V@nU¤šx‚²„Knblb@x„V„ô@šlŽ@b@l@XWxnVl@„VV@XLVl‚LUŽUXV`šbXXmJU@@bm@UUkLW@UlUKWUUb™wUm™L@nklVVmVXXm@@bUKlÆn„‚XkllVUVVL@nUbV‚@V@nnV@xUn¯U@JW@UX@xĉ@™`m@@LV@b"],encodeOffsets:[[113671,26989]]}},{type:"Feature",id:"4305",properties:{name:"邵阳市",cp:[110.9619,26.8121],childNum:10},geometry:{type:"Polygon",coordinates:["@@XIlJšI„VVK@n@VVVKnLVwVmnLVK@U„@šw„J@wVIƚ°X@ÜȄUÈxll@kn@VwVaXJWXn@@WVL@UUKVKV_U@@aVK„x@U„aV@lk„@XylbUaV_šVnal@W„U@a„I@aV@@aVUl@Xm‚UXWaXml@@kk@ma@V_UnUV™UUWJUa@kkaWLUmk@@LUVWUkJWkK@¼UnWJƒIkV@b@JUIm@Ul™V™m@Uw@a@kWƒXWKUknW@ƒWUU@k™mx™UkVmIUJUU™VmI@UkaUƒV™UmVk™wVaVmX_WW@ƒUw@™@kUKWVU_k@ƒmm@@VkX@lVLUJƒX°WVU@UIVWUaƒIUġmkVUkWUVWkwWXk`mI@¥kUVƒUƒUn±@m›XkWknV„UVmmU@@XƒVƒUk`@Xƒƒƒk@¥¯»mbĉó@mkU@kU™ƒƒ™KmX@˜UnmL@lULkKUƒWUU@ƒbUaUnƒ@Vb@l„¦Ub@l™@UKmnƒKUnl„UVVbUVn„@`Vn@xƒb@x@VL@nmJ@nU@mmUVkI@xVVVxkXVxmV@bƒbXVl@Xl‚XVxna@Vn@@VVL‚aXaV@n„‚@@V@X`V@@XVJ@XV@UºkXVb@xlVVKnbm„@VXLV@n‚lL@VxšJV„ULUb„`lb°nXalKnx@„lbšmn@lbULV„„V°š„ƒnV@zšš@Vl¼lb@VUV@bšmLV`„„@n„KlVnU‚XWVLnnlV@xVLU`VbV@"],encodeOffsets:[[113535,28322]]}},{type:"Feature",id:"4310",properties:{name:"郴州市",cp:[113.2361,25.8673],childNum:10},geometry:{type:"Polygon",coordinates:["@@²zVaVlnVl@nšVk„Jl_XJlIVmnL@mV@VXn@lV@‚XzV@lyV¯²U@UlJ@XVKnVVIXl@UVLV`@n@J„I@mlI„KVLnUlVUVVLXašKVLl@nb@ŽW„XV°KUnVV„L@xVJ„L@b@LUVVVU„˜VXbmbVbn@@lUbm@x@XVVVŽ@@˜@bkImx@Vm@Xbƒb@l°XU¤„a‚L„mnL@bl@@™VUX@VxnV˜anLnƒWƒ¥XKVwnUWXmVIUWÆLVx„L„w@wVmlU@¥XƒWUkwlÇn_Uw„WV@VU°wnU—ƒy@aVškVlnL@lVn„w@VlJ@b„X„x@bVKnb@U@WVUl@@Vnbl@XLlK@aVLVKnxÞn@a„LlmUaVU™ƒm@ÅknUmaUKmVk@m™kk@UlWUkVm@w@kUU@W™U¯™¥@w„Ç@aVIlUV@kUWU@UUm»@k@mKVkUKUwƒaUaUa›@k„kUWJkImaU@UK™@maUzk`@zƒy@XmJkL@UUJmUkV@z›@kŽkVmK@¦UbWL@a@UbmKmwUK™Xk›VUUkmVkw@UUKmL@WUIWa—JW_k@@WmI@mk@WkWULUUVKUUVm@šU„bš@‚nUǃ@U@w„™V@Ua@aƒL@ak„›l@k™UƒJƒwó@@L@V@„™`@œƒJ@xnn™šmV@bkJmUó@ƒn—JW„UUmƒU@UV@Lk„WlnnmVXbmxšxV@nbV„V@XVm@UVlXU`ƒUŽkn@lWLƒW—zm@UJVXU`@bVšUn@lWVœLlbVKVan_VxnVVVUXV¤ƒbnl@bUn@LWlU@@amU@V¯L„šVVUn@V@x„„@V@L@VmxUKUVm_ƒJUbVV"],encodeOffsets:[[114930,26747]]}},{type:"Feature",id:"4307",properties:{name:"常德市",cp:[111.4014,29.2676],childNum:8},geometry:{type:"Polygon",coordinates:["@@l™U™mkUwUyV™@VW@¯Va—VmUU@KVUVUVLnaWƒnkUÓV_@mVU@݄w@ƒka@kVmƒUmK@IkaUamKkXWaUW@WUk„™@@KVU@aU@™L@J@XÇVUKVak_mWkLWakVUbmLUUmlUVKUU@kUWW@UImJ@xkLkKm@@Xƒ@ó݃@UUk@UKƒV™ƒULƒKƒXkWWbkaƒIUƒWU@mUk@WLaUJġ™ƒ@@XÈÆVIl‚„Vnz°aV@U„m@X`@XWbkakJ@amLƒaU„@V@L°@@bn`š@@XWb@VœVlšUxmb@bUVmVUI™šXVWnƒJU„@nnlVLƒV@JbWzk`m@UVK²V‚x„k„LVl„@Vn@V„„°xVKVkœVVlUblx@bU„‚Æœ@@nVnUll„kx@VW@@VkLWxUL@bÝ@kKkVõV@bkXVVUVƒ@ƒVkUkV›LkV™a™@@™ƒ¯xUxmX@JVb°WXkK@Vm@k„Vb™bn¤‚xUXkJƒblxnXÆK²l‚_@Wnašn@ŽUL@b‚JnIlV„@lUœ@@¯ô@lWȂIVKVm„U@aXaV@lwVXn@@K@UVKUUnU‚bn@lWšX„ƒlJnUšLšKV@„„l@²a@UlK@aV@naVX„WV_nKlL@KUm@a°U°@VXL@a@wWmXal@„k„@VLn›V@@bl@VnX@mwVa²aVU@mk@"],encodeOffsets:[[114976,30201]]}},{type:"Feature",id:"4331",properties:{name:"湘西土家族苗族自治州",cp:[109.7864,28.6743],childNum:8},geometry:{type:"Polygon",coordinates:["@@@KšL@wnK±nƒnm‚—@WUk„ƒÜÈn@n»@mVamk„mšU„„l@V™nmmU@wUan¯VKšLn„VWlInyWUœI@WWk@KXU˜n@mnUmU@WœƒmkV@ƒkXašaVaUm‚Ikƒƒ@kaƒX@ƒUm@UKWU@UkJWkXa@IVy@UmIUVU@UJU@WXWmU@™VakaU@@Xm@Vm@wnwV@VL„yV@VakUUa@wUUVmlI@K„UVkUamJk@VU@UmVaƒan_@KmUƒ@@anm@ImWX_WWUk¯ƒ@k@Wƒ_m`@bULUKUnUWWXkKWaVmnU@@b¯UUbVŽ±K@UKUUVa¯UUmJUƒVIXmI@UU@WmVmkUV@b¯w@lmI@W@aƒ@m¯LXbmJVLklWL@V@XXŽmbVVU@@VU²Ul@VlX@bš`Xx›zUmkUVÒlŽ@bXLWxXVlš@V„bkLma@nmVmULVbmVUb@lnzmbUÒVl@°nLV„lJkn@bmJk_ƒVmmkblxÈx@LUb„xVb@V™n@JmLVŽUš@„nV@¦VbnJ@lVVbkx™bm@UxVLV@n`UnVVV„kl°z„xVb@VU@@ÆlXnWm¦nbVK@XVVUVVl@X„KUV@nVL@WnIWŽXLVKVLlxUbVKXVWbn@@UnKVLVb„JšU@aVU°b"],encodeOffsets:[[112354,30325]]}},{type:"Feature",id:"4304",properties:{name:"衡阳市",cp:[112.4121,26.7902],childNum:9},geometry:{type:"Polygon",coordinates:["@@lšV@XV@„mXVlXL„W‚X@l@bVxn@šŽšUVkn@VJ@I@alU„JXIVm@»‚LXllIXVVU@Kl@VnXKlb@lVbXIVVUšmVVU`@nbl@@lXLVVVKVbnXWJ@VXbWxXb„Ul™VK„¦nLVVUVVbšb„K@U˜LnK@Un@VxlUV`UnnL@VVL@JV@VUnxnKVbV@@VšIVUnJUVUl@nW„XllIUa„KVbÞLV¼²`V@VIUwlaVmXa@IWanK@U@m„kVƒVUVaX@lšnaVLÈ@‚¥@kkJUWJUaƒXkaUm‚wVXJ@_lWUU@¥n_‚KkamUK„™@amKƒnKƒbV£¯W@k„aWan@@UnwlJ@a@—@UUU@W‚wn@Va@km@UanaWa—UVƒUUVU@K@aƒKUI@wƒKUUVm¯LWUXƒ@mak@UK™LWbUKVUkUmVUKƒLkJ@nƒJ@I@mU_UK@VWkUJmUUL@WkI@V±VU°kzU@Wy@kUm@UWU@@nmKUnkJWIk`ƒIUlm™k@mUUkUb±yUX@VUV@bk@WlXL@nVlUl‚k@WI@ŽkLmš@VV@XVmnnVWbnVUblJXkVl‚XXlWXUJk@±™@nXVWVnL@xUVm@Vn@J—„WK@U™V™@UUVUVKUkkxULW`k¦m„@bkJm¦U@ƒmUX@`UImUU`ƒLVbUVUU@LUbmaU@mJU@U™UIƒKmxkLUl"],encodeOffsets:[[114222,27484]]}},{type:"Feature",id:"4306",properties:{name:"岳阳市",cp:[113.2361,29.1357],childNum:7},geometry:{type:"Polygon",coordinates:["@@@wUklmUUmU@@UVm@wUaV_mmUKmwkIkJmUUnm@™™@UUƒbUKUƒmÛamm¯xVLkbÇƃUƒVUzkVUlƒUUKWLX¦W@ƒVUUUaƒKUbmLKm„@akU@aƒmVaUUVIVWkk@wkƒƒ@@xmLlmÅwmbVlXlÝIWVkK@kkVƒL@VWKU@Ublnaƒƒm@b@bšnW`@XUJk@UUWKƒk@UKƒnn‚@xmLUVm@kbVbV„nV@V„b‚@KnV„LWšXŽÆVĢ¦VblŽš„n„UJWz@ƙVóUVbkV™aÅx@¦lVUbVVknWKƒ„k@ƒwƒK™VU„Å„ƒl@zkb@`m_mJ@xX„mbVbœ@llV@n„@llbXL˜UXalUšl„alVnwnLVKlšVbX@@I„V@blJ@bVL@VVVUXȤ‚VnkVÑXmlbnš‚„VKkÑř@UmaVç@±XUlI„xlV„@VaX¯lUVVUšVJn—V@°°nŽ°„Vxĸł°¦šb²¦lJ@U@aUK@kUm@_m±VIXal@„Kl@„bV@K„K@k„m@UmUUaƒK@_UJƒaXU˜@Xmš_VmUk@WUk›@kU@a@m@UƒaUUU@al@ny‚XXWWwkly@¯n@@bnV@k@mVI‚„œVlUUmlU„JUw„I‚bXƒVaUal@K„b@ƒVKVkXVl@VkUU@ylUœVVaVL"],encodeOffsets:[[116888,29526]]}},{type:"Feature",id:"4309",properties:{name:"益阳市",cp:[111.731,28.3832],childNum:5},geometry:{type:"Polygon",coordinates:["@@„ŽÆxXL@l‚V„@ĢšVI‚bXKl@nVV@„XVŽ„JlbXalX„W„LVKš„„UVLl@VV„@ôބ@@Wn@lLlK@wnIVJX@VX@lVVUL‚VnkVVnKValUXblKnXl`UbVLÈU@W@IšKV@@bUV@Lš@lƒXV‚@VXXblWnLVblb@JnL„VUn@llb@„ƒx@ÞUV@nU`VÔmlX„mbUKUVUV@LVVUn˜ŽUb@°UXš@U‚VzVxnlVškšVnlVnaWƒ@wnIn`@_la@y„kƃVƒšU„L„xl@„ƒXLlmUUVakU@¥ÆwšblUUaôVšU@ÅXyVImƒ™ƒkUaġ¥ÅUWX™ƒKmU@Lƒa@UmUUƒUalan@VUnK@wm„m‚L@V„lXLVVl@VI@WX_™m@a™¯mKUkwW¥UK@_UWWLUVkUWL@WUIkVƒU@JƒwkLUUmJVI@WkXm@VmkKUIU@mmm_@VUV™@™„kJċwUU@KUWkkW@IWW@km@klwkWVkkU™V¯m@kWLU`mIkmkXm@@`@L@xUKWkU@VL@JUU@mbUKVa¯WVnL@`lXUVkU@xW@UbUWVU@UJ@„lnU@m‚nÈmVƒa@bUL™wUb™@@VkxmUUƒ™UV›K@IƒUƒmk@akm@wmIƒŽkK@b™VWXkm@wULUmm@UVW@Ub„mbkKƒVn„U@Wl„xV„U@UXmWUXmlnbUl¯Lmn"],encodeOffsets:[[113378,28981]]}},{type:"Feature",id:"4301",properties:{name:"长沙市",cp:[113.0823,28.2568],childNum:5},geometry:{type:"Polygon",coordinates:["@@lVUllXkx@lln@‚XX@JlXXl‚V@LVVČxlIšƒš@VU@Un`nnV@VJlLUnn@lW@XUJnIVVlK„x@I„VlUVJ@XXKlVVUXKVX@`VLX¦lxVŽnLš°‚an@„„‚bkmVaV@XL@U„KlU@llLXUÞJWkUknaÆxnŽ‚knK@w„@l„@xllUXUJVVUb„n@blV@bnƒ‚LnKVa„LVbVV„UX@W¥XKVL„VVklUVy„U„VÈÅlaUK°wnnÜbn‚V„VL„aVVš@šn@VmnVlIlJna„@Valkn@na@amwm@„UXw˜K@aUUVUUaVa—wWK@kU@UaW@kKUUƒƒ@k™W¯XWan@k„™mmÅ@@I@U@KmLkaVUƒKkLWVUƒk@UVmU@am@kkk¥ƒUƒVUK™„maUb@ŽUb™I@aƒKkkWm@W¯K¯b@VmaULVxUXlVk@UxVJVbUb@xULƒ@ULWW—LƒĕmxVVL@šVb™KUwƒaŲWwX@@WƒUWLU@VbkV@aU@@VUnmJ@VUn@VƒLUK@U‚mUIk@UÇmU@@UW@J@LƒbUmVI@aUmW@@bkXUx@lmLUbm@UbkJ@V@XmlUbkKm@ma@kUaVU@aUK@mImJUIkVƒUƒVUakbWwka@UWKkLUamKUXm`Å_U˜ƒULmaU@@lUV@X"],encodeOffsets:[[114582,28694]]}},{type:"Feature",id:"4302",properties:{name:"株洲市",cp:[113.5327,27.0319],childNum:6},geometry:{type:"Polygon",coordinates:["@@X‚‚Unw„Ė˜KXXVK„@VK@wVaUaUIVwl@kUVWUwVKnb@U°a°LXŽ‚@Xnll„L@bšJVa@VanbšƒVL„U„V@al@@UV¯ÅÇ@Ummk™w@¯ƒyVwnUVVVUkmWV—nKVUƒa@WXkVKn@lUVU„VVVXIlV°VnI@VlKnV@mwVm@LXKWkU¥wWwƒƒ@k@m„X@KX¯V@VUVa@VnKWkœƒV@VUkm@aWa@wkUWwkmV£VÿXUVL@mVIXaò@nW@ašUš@@am™@aUU„UmXmWUk@ƒƒnUW@_maVm™wUkamaUL@aƒwƒW@akI@UƒxUm@kmKUk™lUŽ@b„zV˜m¯xUVU@ƒXVxm`kÈlxXVW„@¦kVUn@xƒxƒKUwÅKVXUJWnXŽmVUxWL„¦XŽm„mK—bmUUwW@UV@šk@ƒšVLnŽlbLm`@¦VVkX@`WIUŽxVnlb„WVbXIV‚lI@l¦Ç@UKmbk™W@UbUVU„ƒl@n@VmLXb@JWbUnkbVxUJUxWXXlWL@V@V@XXJWx„zUVVVVKnXW`@bkIUl‚„nLVJUbUIWVXlWV@XklVbnn@xlš"],encodeOffsets:[[115774,28587]]}},{type:"Feature",id:"4308",properties:{name:"张家界市",cp:[110.5115,29.328],childNum:3},geometry:{type:"Polygon",coordinates:["@@@InWVw°wš„@š@šblUœKlUlV„U„@VUUUlW@aöUlUlLÞ@@aVKXwlK@UX@@UlwkƒVkUm@m›@ÅVƒ@akwVaUk›UUlUL¯wƒƒ@UUmƒ@UkƒKƒlw±UULVn@l_XyWwÅ@VUUmJUXU@@mmƒU@kxW@UaUIWbU@@mU@UxƒnUbmKk„WJkUValƒ@aUkUxƒlW_@WUIU@ƒbkKWUJVnUb™bWb„lU@nl›„@XnVmV@n—mWV@LXl@X›JXVmzkJUXmƒ™KULm°Vb@xnVmnUšk@ƒƒ™VƒnnlUb@nm¼m@Ûǃ„Vl@X˜mnm„²ŽmL@x™K@LUl@nULÆx@V@VXVWbXX˜l„@nLlm@bVKœX‚W„L°bnUš@VaVUš@šmšVw„JnwVK°zn@V‚Vb„a„@Ċ¼"],encodeOffsets:[[113288,30471]]}},{type:"Feature",id:"4313",properties:{name:"娄底市",cp:[111.6431,27.7185],childNum:5},geometry:{type:"Polygon",coordinates:["@@lL„nJ@xln@bnlV„‚„@JœLVUšŽV„nVlw@Uš@VašxVK@a„bnUmÇnV@km@ƒ‚I@VUVVXVaX@@wlVVUkW@_mKXU°‚UbVLnaV@‚V@IUKV@XlVL@w@K@_n@lWlnnJV_XK@l°nšU@WVU@kV@nbVK„V—lƒ@nLlƒ„LXU@ƒlmkw@nW@UKVa¯IVn@@aVUUKl@nXVKVn²a˜ŽXblKnLlmVI@KUU@akLUaVa‚UXm@aƒ@wVUVKnLnWlXl‚n@@U@anUVm@U‚Inm@IUK@UmKVmU_kVUwm@@VmL—K@VƒL™aUaVUUUmKƒ¥ULkšƒVWaXwWa@UXImWUaULUUWKk@WnXbWŽVWnk@UV@bU@@bƒJ@bƒV@XkŽmb™UU`VbkaWzƒ@klU@ƒb@VƒwUL@bV@U`ULVL@VUK@Xm@XWWIUbUxm@@lkkÇwƒVÛÇW@¯Å™UJ@xƒI™xƒ@@VULmKUnUxmKULUUm@@‚ULƒU™JkIWJ@b@LJUW„kJWnUV@nn˜Ü_nJšxU@VbšnUxlškb@lš@"],encodeOffsets:[[113682,28699]]}},{type:"Feature",id:"4303",properties:{name:"湘潭市",cp:[112.5439,27.7075],childNum:4},geometry:{type:"Polygon",coordinates:["@@Æ`n_VWnLVblKXL@VlbXxlaVb„U„VlUVJnInJ‚@VL@bUVVb@lnbn@lLVank@W@UlIVan@VanK@kVwlW@aX@Vn@bUJVn„a@K‚IX@@VV@nŽVÈl@VJn@VVL„K@UVm@UnIVm@UV@@blUUaV@XK„V@XW@XxƱ„bVxšLUa@™UKWk™@wmmUalk@WXUWkXUVJVaUImKƒVklJ@aX_mWULUUVUƒyXwWI@W@U@UXKWkXWVwU@±_U»ÝKUaƒLVbkJkƒWmXk@UVVŽmIUV™J@UU@UamLmwUVU@mnJ@VUnmV@b@Vm@kkWmXmKULUV@x„Ž@bWnVUbVblK@bVV@LUJknmKkLWa—±bUmULmWk@VLUV@bm@U°JUbVLX@@mlxkn@„WVƒKk„mK@k„"],encodeOffsets:[[114683,28576]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/jiang_su_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3209",properties:{name:"盐城市",cp:[120.2234,33.5577],childNum:8},geometry:{type:"Polygon",coordinates:["@@„n@‚°ĀÞ°@¦ULWKkx@bkLWb@lUlVXXJVbƒnUKmxXV@bm@@Xš‚„LޚܦXlVnš‚mzVJ@n@‚²ÞôkƃÞaȰĉ‚wnljÜó„éVÛnĊīČlj‚ĉ@ō@KÞUlU@ƒkklÇÈњÑlġXɛ@UġƒƒaU@U_ƒW@n™@kaUL@VW@kKmkUV@bkbWW@bkzma@ƒJWI@KUKULƒ@U¦™`@XUJ™U@KmXƒw¯KXkmy@aUIWJXXmV@K¯UU@@bVL@¤VLXbV@@JVXVK@„„JVn@bkKmakVVXUVVVlI@`U@nzVVƒb@¤n@@UlKXLVVšI@V@nV@V‚@ÈUx@šóVōšƒkÅWó@mU@bk@Ýwk@WbXxm@@J@zV@kVƒbV‚nLWVUX™WUXUŽWLUŽ@Wl°z@VkxU@UVWIxWJkbƒĬ„nW@@bUl"],encodeOffsets:[[122344,34504]]}},{type:"Feature",id:"3203",properties:{name:"徐州市",cp:[117.5208,34.3268],childNum:7},geometry:{type:"Polygon",coordinates:["@@XKVX@WnIVx@K°Lnll@@I°K„nVašU°x²mlxš@VanU@aƒk@akmV@@w™@Ua@aUwVwUw@w›@UK@£kaĉlóIÇVkŽ±@@kUKmVkIkxW@Ua¯UUm@UVI@WVI„JV@ƒ@Um@Uana„U@m‚I@J@XV@XaVlkXƒVaUUWLUyVIXmWak@ƒXkJókƒJUL@KWkk@ULU@Wa™lUIkJmI™mk„VbVš@lV°kXUKWKULU„mb@VUlVnƒb@VV@IVKUUmU@ak@@bmV@xklƒUƒU@UKmV@nƒJVbkXƒKUamLUJ¯UUVmI™bVV—Ll`@LƒLU`m@kXUVU@V„lxUK@xkIWbUKƒx@V‚kVVn™b¯@@U™@ƒxk‚mbkLÇK™b™@@XnJ@LmVklƒ@@XƒlUƒVkxƒakVVb@bVnUbU@@x˜VUšVb@š„ŽnIĊ`šXVVôJš_„K@xlU²Klk„U„@VaVVÈm@kVUVmnamUUaVƒXIVJ„@‚ç@¥nkVLn›„@@XVK@VUX@JVUV@UnVJVLUJVLUVlšnI„b‚KnU@m°™VanI@anV‚KVL„an„lK„blš„KÞk@¦@¤@„VKnLVK„L„KVzlWšLX@VmV@VbnU°@Ualk™˜WXLVU„KWkUUWšƒ@£Wa"],encodeOffsets:[[121005,35213]]}},{type:"Feature",id:"3206",properties:{name:"南通市",cp:[121.1023,32.1625],childNum:7},geometry:{type:"Polygon",coordinates:["@@VJ@bnzWl°L„xnW@LšVVI@Wš_V¥„@VKVL@LXJ„I‚@nbly@aXXla@aVUnllLX@@UVKlbš@@m„XV`V@„bĢ„lkČÇƃȘ¯šwnĕVĉVÿšUƒUĠƒŦğlXÑVǵ@±ōLʵĖ¯lÇbÝÞ¯xk@Çkķé™n¯@ğŽġƴǫ@kVVlUbƒL@xULǂóLUl¤@nkVV°VLkxVb@l™aUXUKWĖklVX@¤UšƒUkb"],encodeOffsets:[[123087,33385]]}},{type:"Feature",id:"3208",properties:{name:"淮安市",cp:[118.927,33.4039],childNum:5},geometry:{type:"Polygon",coordinates:["@@šnźUôÒɴ胚l¦nĖV‚kbmš„X@xVlVL@xUb@bUJVnUx‚šœ„lKVLÈx‚m„zXV@lW@XV‚b@bȚVxnb‚ƒVIXa°L„aÆVVaXUlK@aXIƄVlXKVUlIXalK@alwXLVK@¥Ý¯¯ÿ@ƒmVk@aX@ƒm„īlaXI‚wXJVUV@lw@U¯yb›UaƒUġUÅaUKVknaġm@kUm@wÆIV±nLÆw„ÇnUUkƒ@ƅÝU¯JÝI¯¦Ul@bƒ@@VVL@l@LƒLÅmƒL@b™@UaVaUWmLUKV¹KƒLWKX¥WI@mXk@UmaUVUU@VmL@W™bkIUWƒUmVóIkbmm™@UbVLUxmJkU@bkJWbnXU`Wz™KUÞÈlVb™Lmx@„kè@Æ"],encodeOffsets:[[121062,33975]]}},{type:"Feature",id:"3205",properties:{name:"苏州市",cp:[120.6519,31.3989],childNum:6},geometry:{type:"Polygon",coordinates:["@@ôèĊVnX°¤²„lxƒÈÜ@²x@J@b@X‚`nIUƙUUV@bl@VVnL@L@xƒJ@X@blJXnW@@`XbW„kVƒ@UbVxƒXUxkV@LóxVbUVWš²šVJĸklUǬ@ĢƳĠ°@šmƒī°»ÈÇ¥ULUU±a@bU@¯ƒU@KnImUVWUk™mXUVU@lIVaUUVWKUbUkWKU¥n£WakJUkUL›K¯L™KkƒVIn@VaUƒVUUƒ›UkVk@ƒU@amUkJƒ@UUlwX¥W@@UkVmk@JUakL›@kk¯ÝmJUn@nmVXlmbVVkn@„UJ@±WUxV¯a¯KōbżÇxUxƒšUUlWL"],encodeOffsets:[[122794,31917]]}},{type:"Feature",id:"3213",properties:{name:"宿迁市",cp:[118.5535,33.7775],childNum:4},geometry:{type:"Polygon",coordinates:["@@XbWnUJVzXKVVUbW„klUWbU@@W@IJ@nƒVmbVbn@@V@„UŽƒIUJ@XUJ@VVn°VVbX@lwlJnUVL@l²@lÈUôJĊklb@¤VLœ@@xVxUxVx@bVbš@@xU@ln„mnX˜mXLVmV@X@lxVnVJôL„LXa‚x@b„@@KVL@bn@@m@™@alLUUVaU¥nIV±‚I@mXI@aWWXU@LlUXWW_XWmaUwǙ@aaWUX@@kWUƒynÇwUKkL›ƒ™VwUmVI@aVa@wUKUk@wƒWn™laUmĕk¥„™ɳçóÑŹV™mmzkVmm@a@Ióƒk@@LWU@`—„WbXLWlkImJVn@`nXVbXŽmL@Vn@‚l@nUVl°Xx°U@LVĠ@z°˜@¦UV@Xn@VJmV"],encodeOffsets:[[121005,34560]]}},{type:"Feature",id:"3207",properties:{name:"连云港市",cp:[119.1248,34.552],childNum:5},geometry:{type:"Polygon",coordinates:["@@@‚lzXxmÆV„„@@¦„@l`XnlKšXXm‚KnLla„b„@„xmbm@kL@V@Vl@@VUXšJX„mbš@@„°Æ@èÈzlW°XĢJlÈ`lInbšWV_@mš™@UUķnƒôw°ÆmnaVƒVÛVmĸ»Ģw±Ý@@mUIny™UmWkۥݙƒK™@Wn@@aWUnwVL„mUaWIUWVk@kkJUVWLUkŃWJ@bkLWVUbÅUƒb¯KWbUJ„WXX`WXkV@KWVXX@bWJ@nJU²mJV¦UbVVkK@b@š@nm@@aUK@Lƒ@@awWbƒKóKUIUmkwW@U@UnWK—nmWƒn@b„l@bmVUb™@kw±n¯w™VUb"],encodeOffsets:[[121253,35264]]}},{type:"Feature",id:"3210",properties:{name:"扬州市",cp:[119.4653,32.8162],childNum:5},geometry:{type:"Polygon",coordinates:["@@VUXblVVV„b@xV@kz„V@l‚wVLUbVV@VU@VbUbl‚b@nkĶ°IÞV@Ɔ„VlmVƒÈÅxmKU²ÅJ@xVn@lĢnmbUlVLÆbĢV„V‚bœV‚aXk‚@VXKVVWšXVWXUmKU„aWaU@™¥@£XW‚UUV@@ynam_VWkUVUna@ÆV@mnkWmXkWU„W@k„@@akklƒlWUI@UnKl¥™I@VVma@a@I@U@a@anK@UmK@ÅVUnJl™kI@aVwka@mVIUW@UWL@WÅbmIƒƒULka™UWƒUxkLUKWlXL@VƒImƒÅVƒU™mĉL™Uól¯I±l@ÒUbVbUVVXUJUnVV@lnbl@"],encodeOffsets:[[121928,33244]]}},{type:"Feature",id:"3201",properties:{name:"南京市",cp:[118.8062,31.9208],childNum:3},geometry:{type:"Polygon",coordinates:["@@k@ma@kUUVmVIUWVUUaVa@Ѳk°Jôk@Wmk¯KmX¯aUakKƒƒWU„@XU‚LXaV@@mUaVUUl@VmkaUXm@ƒWUUna°IlmV™m™IUW‚@Uk@@aV@VVX@„V‚I°»nm„U@VKVan@m»UaU@U_@WlIUa™aVaUala@¯n@‚ƒkaUkUUWKU@mwkUUmmL@K@ƒLmUUVƒKƒVÅImU—JƒƒVkVVLšèVLVU@W„L„V„š@nVÜULVŽUL@bW@XbWbkJƒUUVUxVXmVk@WUUkVmIƒV@„nbnVWbƒJU„kUULƒa@Jma@XkK@VVL@L@JƒLUVU@V¼ƒnXlƒbm@kbUKmn@lVb@VXXV‚UV@b@LVbÆxXbl@@lV@U„VV@XVK²VlIš`„UbVbUlVVn@WXn@@VUV@„@KmbVLXқLkKƒV@nX@VVUV@b™nVllbšmnb„IWVXU@`lLlknVnmlLlbUmVInK°nUƒU@l@VU@Vn@„ƒ@alI„`VIXaVaVa"],encodeOffsets:[[121928,33244]]}},{type:"Feature",id:"3212",properties:{name:"泰州市",cp:[120.0586,32.5525],childNum:5},geometry:{type:"Polygon",coordinates:["@@lUU@@y@In@WwXal@Þxl@@anVô@ÆX„lŎ™ôU@™Vw@ÇUU@@m@U™JUUWKkL@Vm@@£„aUUmyV@@_kJUUVUUWlUnblL@aUmƒI@ƒULUW@IU@WaUK@£UK@aV@°V@LnUWWXIla„VV™@£UWlkXĕVLVWšb@kUalwUKU¯lU@mk£VôKȁVK@w„KVaUkķlUI±™ğ¥ÝUŹš™Ž¯ôm¦ƒĸ™‚@XXK@VVXUJ@nlbUx@blJkšmIUV@ÆnL@VmL@b@b@V@J@bnb‚U@UšJk¦mL@VVJkXk„ll@bƒ@@lƒXXVWlXnml@nÅU@ŽmbUVlVUXn`mb@zU@V‚VWX@¤š¦V@Xb"],encodeOffsets:[[122592,34015]]}},{type:"Feature",id:"3202",properties:{name:"无锡市",cp:[120.3442,31.5527],childNum:3},geometry:{type:"Polygon",coordinates:["@@nLƒÒlxUVkL™am@™ƒkVWUULUxVVVbUV@bVLU‚nnź™ÞVĠ¦X™VUUaôw@KlUVw„WUwVa„@lUXƒWa@_X@WmkI@a@W„I@w@KmKUUk@@aVUšVVÅmJ_@W@a@I±wÛ@ƑÇkw±ƒ¯£mWĉUóçƒK¯VkUWK@XkV¯UWabƒmUa™UUb™lln@b@xƒbXŽWX`@„VxUblL@bn@Vb@`m@XbWnn@l¤„n@xnVlU„™VLÆWœkV@VbÞJ‚_nƒl@nKVU@aU™U@mVk°WVLUV¯bVXŽ˜bXlVn@VmL@x—V@bl„š‚@œnW@X@VVJ@²VJVU"],encodeOffsets:[[123064,32513]]}},{type:"Feature",id:"3204",properties:{name:"常州市",cp:[119.4543,31.5582],childNum:3},geometry:{type:"Polygon",coordinates:["@@„L˜ŽnxUbVVƒL@xnnW‚nn@VVXn@‚yœImx„„°ƒšL„a‚¥n@VkšKVw„W@nX„VJ@b‚@UVn„ƒ@UnUV@L‚b@`VLklVÞn„Æ@VaXLl™ÈJšmmVUK@aVUUaUUVwVKXVlUš„n@šblKVUkw„ÑmKUVUI@±UI@U@WmX@›™kƒ@a˜U@wnK@UUmWk—aWU°aVUUK¯XUl@nVŽVš@bUVmLk@m„`ÝIUaU@›lÅXUKƒškVmU@wƒmk£m@XmWan@@_Uam@@akKVaUw@ƒW_XW„a@w@akmm@mL@UJmnUKƒ@@XnJWLkKUb@„Vxk„WƒL—aWVUImVULUK@L@lkLVVVllb„m@@°kbVbUbšbVbkJ@XV`V@Vbn¼"],encodeOffsets:[[122097,32389]]}},{type:"Feature",id:"3211",properties:{name:"镇江市",cp:[119.4763,31.9702],childNum:4},geometry:{type:"Polygon",coordinates:["@@šVĊKšn„VÆUn„„J@UWKXkVLlKVwX„šVlbVK„„nJÆaš„ķn¥°óÇIkšWKUbÅ@mƒUÝlkUK@_a@KVUVm„@mƒVU@@aUIWƒ@mƒXUx™LUlm@¦ƒb™K¯„ƒƒnw›Jzm@UW@UmmXmm@w„KUUVamw—ƒKm@UbUL@ŽƒVmn¯¼JƒUW@UUU@@bl@@VŽVXšJšnnU‚‚k¯JmbVV„Xn@VWlbUnk@VVUŽVb@nU@WbKWVƒ@XV„„lLVb°bnW°Lnl@X"],encodeOffsets:[[122097,32997]]}}],UTF8Encoding:!0} +}),define("echarts/util/mapData/geoJson/jiang_xi_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3607",properties:{name:"赣州市",cp:[115.2795,25.8124],childNum:18},geometry:{type:"Polygon",coordinates:["@@„`l@Èbln„@„KVLl@„V@bȎlnšKXkVlVL@„lJnb„¦VKVVnX„W@w°@VU„mln„UV`šU„bVUV@„xnKVI°KXKVkVL@al@Xa„LVlULWV™VVL@b„x@VXVmb@x@V™VV@nn¤„šlb°b°KXXWbX`lbXx‚z@x„`VIVUnK„L‚x„WXLVKVbVLVU@wnW°b„@nalX„‚mXVJn@U²mKkVl„U@@xlnœaVmlKnœ@JVLlŽnVššl@XXÆèVlUX@xVLXVšb°W@wnUWmXk@K‚LVwUmUkUKUw@wVaVK@kƒ@WnkUKWkwlmXL@KVUlLVKXmWU„L@ašL@malaVk@aa‚ašƒnXš@VVUblb„Jn˜ƒXa„V‚wn£„K@UWmUk@ƒUaWIV@b™JW@KmmU@aUUUkmKkVKlUU™nKVU„lVaV£Å¥WUUK@UkUUw@m@mIkƒƒUUWƒLƒK¯Uw°¯@wUKUbƒKmƒ@kkKUL@UUKV¥U@manw@k@U@Wm@@U@Wwkm„wWaUU@UUmV¯kwƒ@@kmƒkKkUW@UK@ÅV@XWWkXa@Ul@Va@KVaUUU@ƒaXwla@UkVWaXk@K@lmkUmV@Vmbk@ƒ»XIƒ¥VUkƒVUVU@anKVUƒKUalU@wX@˜™@a@K—@ÝwƒL@ŽUnÇlUIkJmn@ŽƒbVVb@VmnkLƒV¯U@ƒ±l—IWmƒ@kaUI@aÇU@K@KUIkbWbƒJUIUyƒX¯ƒUbU@méUUmUk„WK—xWIkJm@V¥U_UJUwmVkšƒUU@ƒƒƒ@knƒwm@UmkWJkL@n@VW@@‚U@knm@kUml@xÅxƒ@@XUJlb„@VX„JVxn@lbV„@lULnV@VlnV@bWV@bXL@lVLVb„V@blLn@Vl„K@xln@bX@lašLVbnKUVVb„KlXVVkxƒV@nnVUb‚lV@@z—°WWkbƒIk‚WL@LUJ@bUI@b™`@UmI@mkK¯XW™™mUV¯@UUVUUam@@VULWUJƒIm`IUJ›KUkW@Uxn‚WbnnmlXbmIUVmV@Vnb@V™LUKWLnÒVVV@V„UL@„kJUV@bƒÈ@ŽšV°šŽ@XVV@l@xUz"],encodeOffsets:[[116753,26596]]}},{type:"Feature",id:"3608",properties:{name:"吉安市",cp:[114.884,26.9659],childNum:12},geometry:{type:"Polygon",coordinates:["@@lxnb@V@bV@ln@‚n„‚lInš@blVXK‚nk¼@VUKWL@b™L@`UXU`ƒ@V¦XLĠ@lJ„¦@„nV@l°nn@‚mVXnaš@nb‚K„n@l„IVƒš@VanJ@_lKVVnš„L@L‚K@Vn@VbšUVanKlLnbnJVbšnWVnVVanI@‚Vb@L„bVKVanXVbVJVU@aXLll„bôlƼXxVLVK@Xn@ƒxnVVVmb@LnVVKVXV@@mnaVXUVnV˜K@_UaUmšwnKV_‚anKVLš»„K@¯ÝU@›™U@kWlUn™lknK‚VnaUkma@ƒUIUwl»Åw@ƒVwV@n™‚n@ÈXlKVmna@kVw@anm‚@n_WWk@™™mUkUK@Im›kLUn›bkm@wV@kƒlUnLV±m@UInWƒkWmbƒ@¯amX@xUVUKUaULWKƒXwƒKmLUVUJƒ_@wyWwkaW_XaWW¯L¯akaƒ™m£@mUUš@U@wnaWU@Uƒw@aUKšUXUVKUkƒKWbk@@bUKUlWL¯LUJmLƒwU@UVƒa™VU_ƒVkmƒnUV¯@@xƒXmWUUULƒ¥makI@ƒUKUkWl™LkmǍ@aƒUk@UKƒLƒ@kmÇak@ƒ_VlkL@`lbnšlLVanLnbmVÆln@škJlbknmKUbÝmmwULUK@bkLWKULUUma@Kk@UV@L@llbVzšxUxnl@bVLmŽšŽ@IVJXœVlƒLV`@bn²@J™@™V@Xmbñ@WbUJ@bm@@LUĬU‚„¦lV@xXb@blnUV"],encodeOffsets:[[116652,27608]]}},{type:"Feature",id:"3611",properties:{name:"上饶市",cp:[117.8613,28.7292],childNum:12},geometry:{type:"Polygon",coordinates:["@@„„@„V‚š„„I°`nm¤²@bVJUVVXUl@Vmb@xV@XbmVVœ@lkLmbn`VbnU‚@Va„UnbVllUXV„a@w°VW@_VWšLššnVlbšLVbnl„KšnVK@IUW@_@am@™‚ÑUólK@U@WU@VwU@UI@aUU‚aXƒƒ@kwmJV@yX@k‚anƒƒ@mkwVmmI@aUU@aUUW@kVkV@@anKš»„XVWnIVUl`@_„W@wlUœV@UWKnU‚bnŽ°InJl„UV@VnI‚b„Wn@VklL@l@Vn²m@U`kI@bWJƒnV@°VXnJm„XVmx@VVL@bkLmWULUmU@ƒbWXb@llnX@‚xkxVV„nVV@¤nL‚nVxnJVXX@˜ššbn`VI„b„@„blmlLnaV@„blWXnlUnbl@„ƒšKVanUVmm_XK@kWWnašU@UnaWUXa›ƒXamUkKmXUWƒLX¯WakKm™nUWwXa@KW_„aXWW_@WnIVl@XU‚LnWVknK@ImyUUÆbXK„Û@W@IÆUnƒVÝlkVK@mUIVwkUVaUm@aVIVyXIƒaÈwmmk@UnanVUmÅaó»lwšW@kkUVmUK@WKLƒUmWULkamK™Lk@Wa@wk@UU@U@mbUIWVKUXWmkUmVm›U@LkakKƒw@w@U™¯ƒ‚ƒUUn¯l@bmn@xkJWxkL@VkI@mƒkmJUI@V@b@VVxnbWlkÈkVƒLƒbkKmVƒL@V@²nxW‚kLUL@xlKVx„bXmVnšWJ@ޙ°@n™xUKUw±`UImVmnU@kalm@akwƒU@UUJmxU@@Uƒ@kU@Um@@Kn™ƒVm@k™KmkU@@WUnkLWxkVUwmKmLkU™bmKUbVŽ@xUnkJ@n±ŽšUxVXUšWJ@LUb™lUnm@ƒW@nknUJUVm@kXllknVbÆK„VVbš¼V„@šUl"],encodeOffsets:[[119194,29751]]}},{type:"Feature",id:"3604",properties:{name:"九江市",cp:[115.4224,29.3774],childNum:12},geometry:{type:"Polygon",coordinates:["@@WUkVUkmaƒVUb@mVUam_nalK@kU›nUWaU@@wna@UVkUWVUUI@a‚±n£m¯_ƒJ™ƒU@ƒƒƒĉ¦Ul@UV™Km™mLlm@ğ¹m`Uk¯@@UVK¯™@UUK@amkmKkVVUa@UkUƒKƒŽUa™L@VVXUJ™@ƒnƒ@™š™WUbƒnVb¯V@LÅlÝIƒJÅkݙm@Ua™WUU@UmUXmmwVUUKWUX±mUam@kWƒzUaVmÇw@aÅLmKXƒ‚UWKkL@W¯IƒwVw™lkUƒJ@Um@ÛÈWŽKUxWkƒaUU@KkLVl@„UKUX±KUb@nVVUbUVmaUlUL@„ƒaUL@‚@nUlWzX`@„V@lx²„@Vlb@bšVÞ@°nl@UxVL@lUbVV@n²xVUVmnUÞb‚a„J@IšV°xnbl@nbÆ@VwnK@VnXlK°xnUlVX„V@Vl@L@lk@W_XK@KƒkWxUL@J„nVx@aX@VVUa˜IXlmL@bVVX@VbnK‚a²XVWƒk°a„@UnV¤nbmLmW@XbmJUbVL„aÞK„L@K@U@aVKlbV@nXlJœxV@VnšŽVȚ„ÞKôbźĕČmV@ĊšŽ²xÆIšV@Þ¦ĸ¼ÞVlŽVÞnxln°Jœk‚LXWVUVUVwnJVI@yn@lXlaXmWI@w—»ma@UmK@akKkXmW@_kaWakKWk@@K@IšWƒkUa„ƒ"],encodeOffsets:[[119487,30319]]}},{type:"Feature",id:"3610",properties:{name:"抚州市",cp:[116.4441,27.4933],childNum:11},geometry:{type:"Polygon",coordinates:["@@°V°UnÜ@n@lnLlV@bšV°L„lnLllVzVVXlV„V@@L@xX@WlX„m@UVƒL@V@n„°škVmVUnKlaXxVbšnlU@lVVnaVI@aX@V„šJš@V„@b„b@šVbš‚@X@lUL@Ž@VlIVm@wUVanLšalVnKnLVxlUXwlKVm@k@Una@mWIXKWUÛVƒk@a@UVWn@@kl@@W„XlW@_Um@UVK@a„LnalInWV@@xnI@¥‚K„—šm@kKmƒnk@mlI„¤laXbVblknV@U‚KXVlUXa‚@@Unw@±mU@ak_±a@ƒUJUIƒVKW_Xa@aWU™šK@mmUVa@IXa@UWmšannlmX¯WKXwVUVwƒ@XUlK@klJXa@kƒkmm@Uwƒw@¯ƒW¯kw@WmbULƒaUUU@mVUU™WmkUb™KmkkK@aƒkUƒ¯¥Uƒl—ƒm@akU@mš@KVIVV@KUkUVUkaƒUWb—„mƒIkaVaUU™@mW™„b‚b@bUlkb‚b@n™K@bƒKXVWnULkKUV@LWKknlxXŽVLml@X„Ž@lULUb@xVxVLVlVnUxK@LWlXnmV@x¯X™aWUUK@wVWUkÅçm`@mn@bUx@lmbUnkLÇWm@mšU@Ux@„Æxk¼VxVJ@„nbVlmbUmLklmškVlX@‚VœšV@°Þ"],encodeOffsets:[[118508,28396]]}},{type:"Feature",id:"3609",properties:{name:"宜春市",cp:[115.0159,28.3228],childNum:10},geometry:{type:"Polygon",coordinates:["@@@VlbnK@b@JšLlUnx±ĀXxÆW„X@lš@V„@@blJ@nX@˜xUbVVUbVV@b—VmnmJœ„@bmbm@klUbƒLmbœš@lVb@xUX@bVVVbV¤@LVV„bXlVw‚LXÜÇn@@V„IlVškUx„x°J@XlKXLV„‚WnLÆK@bÈxUnVb„ylXn@Vbn‚W²XV‚LVVUŽnxWnnV@VVVšXVbn@ޚÆl„IÞJÆk@K°UUa„mVa@UUUš»@wV@VƒkkUKUVW£U@UmW@@aXkVUnVlKVV„UUkVmU™@kWaUanU„VVamIX¥W@@aUaUVW@_mW@UnIVVn@VbVm@bVL@anKVUkƒWK„UXV‚Ikx‚@na„bVK„b@nVJ„_V›@Vw„‚VUVVXUlUUaV@X@VblašbnKlkVaXaƒ¯@m@U„KVUn@WƒXkW@@w@KU@UƒWkUUUykkmKƒk¯K™U@akUmK@k@mmÛ¯V¯U@‚ƒL™¼UKmLbU`mL™xVnVb@`—LmUVUUWmb@nU@UWULmU@KnaUUmU„wmJ¯IUJWIkVkaWVUIUlWaUIUVkKmbUIƒÒlVUnnŽ@VlLUJ@bUX¯@ƒaWVUKUXƒKUbm@UwKWa@a@VkUWn™@Uak@mbX„WJXbm@mL—aWVk@™wƒL@WmanU@knwWmkaWL—KWUXaƒU@¥l„UVVVbnwƒ¥nKV™»@aUk@a@UƒJ@kƒmLma™@mbUWnm@ULǺ@LXnmxUŽm@UbkbW@@akLmWk@UXmJmUkV@VUXVlULmKUxkL@lmXnJ@X‚l°Vnb@bU@WbKUX@VmKUX"],encodeOffsets:[[116652,28666]]}},{type:"Feature",id:"3601",properties:{name:"南昌市",cp:[116.0046,28.6633],childNum:6},geometry:{type:"Polygon",coordinates:["@@šXš™„@„mš@VIUW@UšKVb„„LlV@VVbUŽlUnLnl@bVL@V°šUL@V°@Vln_Ġºn@‚knKnššLVU@VkĊ¥Vk@™Uƒ™»UaƒUÅLUalmkklWn@VUVIlm@m„Xn@VmškVa@KXIV™UWVw‚™²@m@U@VK@k@W™Ua@™ƒa@aUƒ™@™IUƒW@@bUJmbUU@kkV™mUaWwkbmLUVUn™lWbUbklmL™akbUaW@U@VbkVWVUUUVƒUx@‚Uœƒ`UI@mƒaULƒamb@lwJWUƒVXLl„UVmL@bUK@aUnUam@UUmJ@VnX@`UXVŽVb@bX@W¦nJUbƒUmVVbXb@lVšUnVlƒVUUkLmUUVWl@bX@VnV@X¤VUVLllU„U@@x™¼VV@V"],encodeOffsets:[[118249,29700]]}},{type:"Feature",id:"3602",properties:{name:"景德镇市",cp:[117.334,29.3225],childNum:3},geometry:{type:"Polygon",coordinates:["@@VVX@Vbmz„xUlU@mbmL@V²xVbUVVblbX@šVškVykValKVI@bn@n`lVWnX@l„L@™WKnƒVIVa@¯nK@alIXJVIVWUw‚ƒn@nU˜„nK@alI@a@anKm_™a—™W@UWmIUwmmK@£UUƒmUUlwwW@km@kWaX„aV@VnVKnXlK@aUK@UnwWUnƒmIUW@¯mU„XI@alJV_n@m±@U@kkKUlm@ƒXamJ@UVUkƒmI¯JmamVXL@V›UkV@xƒX@`k_UVmJUXƒW™¼mL@bU@UllX@VV@bVV@bnJUnlx@n„Žm„b@lWŽ@zU‚nIlx„@W„bVV@bVJV@UxV@@X@VkLVôÒ‚šn@@b@`VX@J"],encodeOffsets:[[119903,30409]]}},{type:"Feature",id:"3603",properties:{name:"萍乡市",cp:[113.9282,27.4823],childNum:4},geometry:{type:"Polygon",coordinates:["@@VWnL@UVW‚LXaV@@ama¯Uk@WmInW@klKVwnLVKUkVW@UlUnVnIVWl@nXlK@bX@laVan@VnwWm@KȹVK¯m@kmU@ƒƒ¥kIğ@WKU¥„@V_VW@_šK@aXKVL@Ul»mWLkU@am™kJƒm@kmU@@a@UmakwU@›„Xlƒ@VXk`UIW¼kWWX@‚œ@l‚xV¦XlW@Ubn„@ŽmUkL@UmJ¯UkUWVUaƒUlm@UXWl„nUJ@LmLU˜nXll@bUVUUmVUn„Ž@¦šxlŽnn@VÆÈU°kbV„VxllnL@VnVVUl@V„„anL"],encodeOffsets:[[116652,28666]]}},{type:"Feature",id:"3606",properties:{name:"鹰潭市",cp:[117.0813,28.2349],childNum:3},geometry:{type:"Polygon",coordinates:["@@@XV@nlšL@lUnš„mŽ@Ln@@VlV„@@VV@nwVI@V„Vlx@bknlbV@nmnUVJ‚_²‚VxVLšw@mš¯@ÝXIm™nUWƒaUwkL@wVKlKXmw@±@U„KnUlL„a„KlUlÇXkmaUw@U@a@Uƒ™UkwUJ@zWJ™w@WbkVWUL@VmUklUaWakbƒ£kJ@nmln„lL@Ž™nƒ˜L@¦mJ@wU@mXkJmbƒK@bUL@VVn@`kXƒW@Xk@@lm@UX@V@b„lÜUXVWLXJ@nmb@V@l"],encodeOffsets:[[119599,29025]]}},{type:"Feature",id:"3605",properties:{name:"新余市",cp:[114.95,27.8174],childNum:2},geometry:{type:"Polygon",coordinates:["@@m@@WULUKWwÅ»ókƒakkWK@bUVUIUamWUbULƒa@KUa@mJUbmUXU™mUamImakKmLUb™VUam@@UL@KƒKm™UUkL@`mIUb™@U„@V@bVl@bš¼UŽmL„¦mxUaUUƒVkŽ@¦„VWbXV˜LXKlbXnmx@lmVnb@X„Kšxl@XU˜bnKn@WaXIWƒnal@Vbš@XmlV@U@bXb‚LVxn@Va„LVWVLXU„b°@VW@aVIkK@UmVmkU„ÑVJnalLVUVJXbVkVJXUlblUXJVI°JnI"],encodeOffsets:[[118182,28542]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/ji_lin_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"2224",properties:{name:"延边朝鲜族自治州",cp:[129.397,43.2587],childNum:8},geometry:{type:"Polygon",coordinates:["@@Wxĵ„mš@„ó¤VX@@xܼƨš²xWxƒV„V@„XVƒ„„„ƒbWšXllaÞU°Ċ„@ô¼„LôÝWanV¥ƒÑnĉ°¥šÅX¥°¯@w°w@»°k£°mÈŹ‚mÈbƃŎ¦„K°z@Žkxl¦UbU¤šššklV„KŤÞȰ@@bšV@nVVUlÞ¦lUllœVlU°ÑU¯Vƒ°w„bXxl@VŽ²„˜@n„ô¼ƒó°™kmVk²ĕ‚w@wV™ÞÞ@@Ġƒö»˜¯œ@‚„šbnb°mÞ¯°V°„ÈJmX¥mam™UřƒUƒlaU¯™ƒ@w™Kk—l±n@@wƒkÝVUUl±¯I¯b™a™lƒ@™kLmakbƒ@ġƒŹé°™Þb°šékƒƒLm™„wX™‚aÅb@bVlƒbVb—ÒVbUb›UUanwƒakbVŽUV›ak„¯„UŽƒLmxV°UxnôŻX@J„Xkl‚bkbĉaƒbƒWU„ƒ@ƒk„WUU¯@@klmƒ@@™Å@aƒwWXlKkI@WbUaVIUanUƒƒ@ĕƒ¯K™„mUnWUwm@£ċèkUmbUmm@@nkJUalwk@@nmWUan_óaWmnw±KœIƒwl@UmƒI@an@@mlUÅmV_™KUkƒ@U`@_ƒKUmU™@U¯™mmb¯@kb™ImV¯ƒƒLkbƒKƒƒÛ@ÇnɱJóaÝĢkb@„›x—ÒÇllœ@‚Ž²V‚„ÆUVV„UÇ°X„óxlV¯„lV@bƒV@n—x›@—¤@„șŎnxV¼knšJ‚nšKX°˜¦UlnVbUbÆVnÞWVX¦llšb@l°œVJôÒnLVbšbXŽ"],encodeOffsets:[[131086,44798]]}},{type:"Feature",id:"2202",properties:{name:"吉林市",cp:[126.8372,43.6047],childNum:6},geometry:{type:"Polygon",coordinates:["@@ôl‚zšaÈV°„šK@„mŽ—LWl™nšVxUV‚È@ŽÝĬUÈn‚ôLša‚„²VmĀkV@„ĠĊnU@b„V@b˜@nl°UVnÞaôJ@bš™V„¦mlkššbmVXx¯@Vxm„nbƒ„šbÈK‚V@bÈL„wĠyônšmnbÜ@nn„V˜x@n²K‚„„J@k„al@nxÞU„Lź±Vwkw¯LWWUš™kŎīVwƒw„°y„Vĕ°wÈVlkÛ»@wW@Uô£@ƒn™ĶƒXwW™aUamKóÑUI¯›@k™akkW¥XUmÝÅUVaUa‚mVk—¥W¯™Lm™IlmU»mwȚō@ƒ˜£kJUÇk@am¯y¯UVwƒa@wġx¦ƒKƒƒ¯X°Ċ¯¦U°ċWULÅa±b¯@UkÅWmVƒ™ƒkIUlóŽċ¹™`óIƒlX„WŽXxmbUƒLݏƒbƧ@ƒx¯bƒÈ—l@xƒš¯zƒaݤ@nšm„VWb²bmn¯J¯Ò@n„š"],encodeOffsets:[[128701,44303]]}},{type:"Feature",id:"2208",properties:{name:"白城市",cp:[123.0029,45.2637],childNum:5},geometry:{type:"Polygon",coordinates:["@@ó™ǩŁ@WlwUaƑwÛÅÇéĉamKƒōÇ@Iƒ™ôġVƒȁÑŹçƒ™ÝUƧċĉwóóÝ@Ƒ»ğL¯ll²@ƆÅV@¦m‚Åb@nmlU²VxšlUn™@VbnW„bÇbk҃š„n@èlnlšU҄Ž°Lšx@¼ĉb@҄šUŽċxՃènLVxƒÒƒbÅJ±a@_ÅJÅnƒŽVb„Kl„nUÜĊ@„Uš™xXVÆn„mšVššJÞ¯V™ĠwšƒXw°xWL„x„KV¦ôU„wVÝǬóÞޙ¼‚‚„ÞkŽVôȘxބU„lVn¦ÞšĊa°w„b°@šbÆw„lŤL²`„z°@V@@™nJVnl@@¥nUmmn„@mwnmmUnk@mlwUaƒLnƒ›wn¯°anƒWakI„ƒÇmXwÆamUXUlJXa‚UUklKUknmÞV@‚K@VWÞ@VkUwVƒ"],encodeOffsets:[[127350,46553]]}},{type:"Feature",id:"2207",properties:{name:"松原市",cp:[124.0906,44.7198],childNum:5},geometry:{type:"Polygon",coordinates:["@@„šźèȂÒU„óĢ„š@JŎȄ‚‚LnŽĊbÈêÜƃxVbkx@XǪłôš„kÞ`„šW„b@n°ašbšKšnVw°`š_X`W„š¦„ĊIkmVšakw‚K„x°UÞb„U@lšƒl@°¦œVW„šaÞbšxÞI@mVI@ƒVkŚUWK„¥nL‚a@ƒ„@ȍ„@°ƒÆ@nU@KÞalkUwVékUWw„™kU›VkkƒJk¯@»ókƒV¯ÆÇI@bĉô¯@™ķw¯nmmÅL¯wƒVƒUÞy@UówÇLkmm@@UóxkkĉmL¯wVwkWWX™mLõm@kűV_ƒƒô»ÛƒÆ¯@™Va™VšaĠVlmğwķUóÝƽ£ÇJkbǫaƽLW@nxݤkzƒy¯XɅm@VšôÇX¯Ė¯ºÝnUŽnLVlUÔmV"],encodeOffsets:[[126068,45580]]}},{type:"Feature",id:"2201",properties:{name:"长春市",cp:[125.8154,44.2584],childNum:5},geometry:{type:"Polygon",coordinates:["@@„U°xÆKnn°mĸxš°@Ċó@aÈJ°Å„Uôl@¼l°„IllœUlVƒšXxlVUêVxkllnÈUVll@Vx²IÞ¤VUlVnIôlރlwô_„›„bVaĶLXÅÞÇ@K˜¯@wÛaƒçn¥š¯WXyW¯XwƒUmmÛ@ma™nómğzƒxÇK@aUÇL™a„ƒmanƒUw°@WwnU™al™nkƒ¥šU™@aóIÝbUm¯Vmk—@@aƒU@amVğĉ@ƒlUnÿ±Uƒ™bóKmVÇÞī@ÇVUUw‚™šmXk˜Kn@ƒ™L¯ƒÇU™byókōè@b‚n@lÝX@x¯ô@ƙUV_maXm@aóƒJWxnX@ŽVVnĖVnUJ@nōÆǼV¼kxƒLklÝw@xƒx@zV`ÅbmxU±xU„nnm‚kn‚ŽğU™bUŽ‚šUb@šÅ°Ü„󼄄U`Ʋ@lön‚KšnXWlXUx°xnKĊllôw@Vn@lnÈKôx@VÝz„V"],encodeOffsets:[[128262,45940]]}},{type:"Feature",id:"2206",properties:{name:"白山市",cp:[127.2217,42.0941],childNum:5},geometry:{type:"Polygon",coordinates:["@@Ušl¦kÒÆ°„IlÒU¤ôz„¼lJš„U„n‚ÆXVl°@²aÆbVKČXV¯°¥¯ĉ°W„„„L‚¥Ģw@x„bUx°V°zn‚‚b@ÈlVŽlIœ@˜w@m„U@akU°ƒkUôwWƒÈ¯VUƒVUƒÅ±U›@kÈk˜Ñœw@ƒlaÞġƒUÞ£@ƅ‚KnÑĢ¯@W‚aUaVUVkkw@a¯@¯™Ý™ƒVXnW@@WkXmK@xkKUb@bW@Uw¯„mmb@WKUbmUbUaWbƒJĉIVW@I—l±LkšmU™bUm™@ƒnkKWa¯n™@„`Ubma™„ĉL@bƚ—@W`ƒL@n¯‚Xb‚@kb@x™Lƒ„™@V‚kL±™™mlUIU¥mL@lÅx@_laƒƒ@U—aƒV@kmmƒK„£ƒƒLƒƒmKUnÅKVbmXVlèĉUUbml„ĢŤƒIlŽ¯bǦœl‚@ô¼Ģ„@x°„l¤„n„a„l@x™b"],encodeOffsets:[[129567,43262]]}},{type:"Feature",id:"2205",properties:{name:"通化市",cp:[125.9583,41.8579],childNum:7},geometry:{type:"Polygon",coordinates:["@@ÆlXnĠxĢ°lÈ°š„K„°kXm‚@¦Vbk„ŤJšnݤk„VÞVVkȄb°y„™@w˜k„Ç°a„wƨ@„aސ„K‚VnaWwXWƒ„kôJš_ČºôVkƒ»óyV£kуJůlÑk¥V™ša@wƒkƒbƒmk£¯ƒ@wġƒó»@›kÈ¥°ak„JÆ£ƒġnkVaĊVkçWUnUaÆLVmnL„„‚KU™±@—„m@a¯U„bmV¯m@_ƒK™™U™ƒaƒÅ™Wó¹ƒ@UanmWak@@wmI@y™@mk„JVa™@UaƒIkJ@n™@Um±kkxƒm™Ik„ƒbÇm@Ž°bXn„V@Ž°ÈmlÞ¼¯XVº¯Lm„kWWXLmVVlknƒ@@lnWƙ„Vxbmšnšm„¯lÝaVȁè@¼V„„b™„ÆŽ°ÞUVšJ„„kx›I—xƒƒƒIV¤™ÒXxmn"],encodeOffsets:[[128273,43330]]}},{type:"Feature",id:"2203",properties:{name:"四平市",cp:[124.541,43.4894],childNum:5},geometry:{type:"Polygon",coordinates:["@@Ɇn°W„zlyÞ£mwX@ƾKǬblaÈIƾ¤ôÞĸVĠxnmmVƒ²w‚VnwÆaU_@y„w@wÞxlk„KlwU»È»ŎÅ@mVIUmmĕUU@mWXw„Iô‚@bWnnbU`‚šV@Å°ó@wÞW@km@aŎ烙@m°Ñ°Inm±aXaƒU™n@mƑšU¦@šÇŽ¯aU£šaU™ġ¦ÅҙJōUŻókUÇ@™¥¯ak¯mUVak@@aċçÅaUƒm¦Ý`XbƄ@n`ƒI™xĊÞōÞml@šUb@Wl™_¯JkšÇUÝÆÅb@n™„llUb¯„±a@ƒ—ƒWĉJġĀ¯™Unóšm¤œxôaVnƒxôI@x„V@bmƙ„@lnLmޯޙxVb¯þ"],encodeOffsets:[[126293,45124]]}},{type:"Feature",id:"2204",properties:{name:"辽源市",cp:[125.343,42.7643],childNum:3},geometry:{type:"Polygon",coordinates:["@@żôŎVšIÆÑĢ¥Vš™bV¤°bȍ@™V¥ƒ™Þ£lÇUUUÝlƒÞ£™mţIlƒUa@¥nlWƒ¯ƒL¯™kÇġ¯ğwWmÅk¯UƒVU„„bWlXlmnƒbUx¯xVVknlŽUbV„ÇKUb@„™VnbmlnzUº±bmJUbWÈnèm҄š@X`WL"],encodeOffsets:[[127879,44168]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/liao_ning_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"2102",properties:{name:"大连市",cp:[122.2229,39.4409],childNum:5},geometry:{type:"Polygon",coordinates:["@@‚IÞmVk@wXWÜbnwlLnU„@‚nLlbXW@a‚wnbl@XL‚aš@Ċ¥@LULnJ@xVnmV@VXXV@VJkn@VÜKXXôJlb„xl@„IVbnJVLUbn‚lnVw„JVU@ƒXU‚aUUlwn@°ƒn„VKnV°_VJšwl@nwlV„IXWlIVVnK@IWmkIVaVU@WÈUlmU@U„WUalkXġŻ@kIƒ»mm™akUm›ĉUŁV»²ġVĕ@aUU؍IɃ`ȃ@kƒw@ƒUƒmwĉ™@ƒWķсIĉÇbÝLkymbIƒwÇmÛbmbU„¯ÜõÈkÆVbŎxnXVÆnšǪ¦„bš¤Uš™xÝnĉÒmĊVȄ¤Èš„bƼ„Ā„„ÆÆބźb„VVbX„‚°²¤"],encodeOffsets:[[124786,41102]]}},{type:"Feature",id:"2113",properties:{name:"朝阳市",cp:[120.0696,41.4899],childNum:6},geometry:{type:"Polygon",coordinates:["@@na@UVI@m„ÑW™kaV¥UI@wl@„aÈbšm@wVašk„@@K@kƒ™@a@UUmƒUUalmU@KÇUű¯@±kUKVkUaƒaU@¥m@@¯k@WLUmkn@mmIkm@amU@wVmkU@Klk@U—m˜aXIWWUL™aULVbƒmk@UUmUk±™_Uym@mbkImaX¯WW™xWKzU@WƒkJWwkV™@Um@UbVVVVXb@VWX—@WŽ@Vkb@V™nUK±aUUlwX™ÇWKknU@mmUkƒLUVƒVUUVƒUaƒw™bkKmwnIƒ™kJ@nmbƒ`kmVkLWwUm@UUU™K@UmaUa@UUaWK@mUƒ¯Wkk¯VmUUŽ„xVXUVmL¯ymXkWUbmXUKƒVknWx¯JVnkLƒl@VVxnxlĀVL²WlX„l@bÝVUn@bnlÜaXblIVl@šš@Ȧ@VmbXV‚@@x„VVnUn@`°@VnXU@K@„VV@VmbnVn@ln@b„xƒ°Ub@bšLV`Ånƒ„W@@lUšnnWVU@Vbkl@Xl`XxV„UblŽkX@Ž°¦V„UVVbUlkV›@UbVbkLUxmJkXšš@b‚bœxVKÆlXX˜bnŽnala@ƒUk@U„VVklKVUXKVU°KVan@VUnLšKVL„WVaU_@mmUXa@m˜wXwVkVWXk‚k@›„k@klm@wXKl@U@KVUUUVaUƒV@„alL„xUx@b°°VnnVšxlIXJmx„LUVlV@bnX@Všb„aVx‚@XJ@b‚n@VŽVXȄl@llX@lU„Vô°°@ބVbn@‚V„k„@VW"],encodeOffsets:[[123919,43262]]}},{type:"Feature",id:"2106",properties:{name:"丹东市",cp:[124.541,40.4242],childNum:4},geometry:{type:"Polygon",coordinates:["@@lzXJ‚U@š²x‚@@Vš„@bUVmKUn„°n@lnVK„„nV@n@VlV„°WbXn@‚VzƒJ@¦@bkb‚bUl@bkbƒJ¯zƒWULWbklV„nb™¦VJ@„„K°U„kl@@W„bVn°@„Všm²U˜nX`„UÜLXmVXlKVbUVVnUbn˜ƒX@VUL@lUbWxš@²kl`n@Vlb„@nUVWVLVU@aV@²bl@ÈmšxWX„VÈU„JV„l@„„la„WnX‚KÈkÈ@Va°bÆm„@XV°IVV°UnalƒVUn@UwVU„@@VVJ„I@bl@XK@wWmXU‚UVbkJVXnJVI@mƒknwlKXL@`l@VI@UUaVKÞn„aVm@aÇ£XW„U@aÇUU@mbkKm£™@WW™ƒL@@Kk@kl›U—bWKUkUU¯UõÛƒmUUaVU„U@WU_W@kVkJƒ_WKkV@bUL™¯¯ƒ±mk¯ġƒğÑ@UmwƒKUakƒ™ƒa@a„m¥ÝƒIUWmk@w™mţ—L›KʝbȗKWĢklVbƒX@VV‚knÇV@XUVUblJXn@J"],encodeOffsets:[[126372,40967]]}},{type:"Feature",id:"2112",properties:{name:"铁岭市",cp:[124.2773,42.7423],childNum:7},geometry:{type:"Polygon",coordinates:["@@XJm@¯šmXUlnVbUJƒU@bV@UJWL@VXLmJVbkXlJXxVL@b@V@n@b@`Vbk@lxknV@VV™V@bUL@bV@@bVK@VXLWLXJ@LV@nbWJ@IUV„x@LVJUXVxVx@VV@@LXJWL@VU@@L@VnL@bVVmVX@@VVInJmbnLWVnVULVVU@VVmX@@JVz‚l@„nVVKVXރ@mk_lm„UUWV_nJlUÞÑÞVVUVƒVL„UVJ@I„Vna‚@@KV@XwWknwnKlalU„w„aĉݚwšJl_@aUaƒKUUU@WU@WXUÆ@@UVK@n@UnVVšblK@bœllb@b„bW@Xbl@UlnLl°°bš¦nKlVnI„V@UWU@WXkƒw@am@nm@aVw@I@KUaVIm±XÑlknJVnVJšaX_VaUaVKmwnkmmn@lU@U@mnašXlKUmUIVmklaUK@UlUVUW@U™kVm™a@UUU@JmUU@@bmb—KWV¯XUKm@ka@UVKVk@aUKmLkKUUÝUmbXbÇJ@k@WU_@m™™@klm@UXKVaUI@KWUXaƒÇWk™aWUkWUL±U@lUU@ƒUJƒI@V¯JmIm@@aU@Uwƒa™@UV@VkI›V¯aUkƒWkb@bVL„@@VVVUXW@Uaƒ@@b—‚ÝbUV݄@ŽƒLmUkVUbVllLUV@LššXŽWbUXm@U`@„kxlnnJlbnIllšLX„lVlUXmVK„n‚V@L"],encodeOffsets:[[126720,43572]]}},{type:"Feature",id:"2101",properties:{name:"沈阳市",cp:[123.1238,42.1216],childNum:5},geometry:{type:"Polygon",coordinates:["@@ȚĊÜ°„b„L‚lÞxUbUn±‚@ÈnVÆL@xnLšlUVƒbƒxkImJkn@V±LUxkV@bšbšKVKnzVl@L°@Va„xÞUlbôxVVœ@@V±bnŽ@llXL˜ŽöXĶŽnal@nkVJVI@aU@@aVK@ašUUUU@lmkwl@Ua@_@a@m@U@aUKWwkIlWUanIWK@UXKVIU@@a„VVIUa‚mVknW°™n@WI@KUƒmULWnkVkUWƒ™KkkmJkamIkmlw@ƒV_n@VWXaW™™@KVUkKUkValUnV„K@ÞƒVUÞa˜@a„@VbX@VWUU@Uƒ@UK@ala@IkKmUUa@U@ƒVƒkk™WVwU_@KÜUXbl@V¥XUVmƒƒƒXa‚kŃlUUkIm`UIUJW@UIKmkm@UUJƒImmU@ƒVUXU`mIUbUK@LƒJUU™l@Xƒ@UbƒJ™kU@ƒŽn„m@Uam@@ƒ™aUmLKƒwƒ™mWXUK@kUaÇa@JUIUa@aƒKVUƒUXmƒUy™_@lmbkLUKWLX`‚n@bVL@JXL„‚WX@Vnb@Vm@UbnVmL@V@x@LUbVV@V@LƒUVl@mb¯U@xU@UVVV@X@VVblJ@bn„VKUn„x@llnL±¤™b@k`VXÆK@„kV@¼kl@bWIUl@VmLnbm@@JXXmb"],encodeOffsets:[[125359,43139]]}},{type:"Feature",id:"2104",properties:{name:"抚顺市",cp:[124.585,41.8579],childNum:4},geometry:{type:"Polygon",coordinates:["@@„XVl°bœUlJ@UVUš@„bVxV@@bn@nJ°I@U„J‚I„VV@V@k²VVKlXXVšb‚lÈX„ŽWbXV@LVJUbWL@Vkn@lšš@nV`@X@lÈIWanaÞVVVlLnKVL@bUlUL@Vlbn@VL°WXU˜Lna@aV@nV@IVV@VšbUnšl@V‚XnKVa@U„UnyWkXaƒaVk@ašašbnm@_WKXmWanU@alaU—l@XJVLVxX@˜wnKnVlwƒƒ™@V_@a¯¥@UkKWUaUU‚anK@IƒaU@WUaVw@klUVyUUVUUÇ@Iôbša@mnUma@kXa@UWak@Wa—l@a›@WUƒLmU@U`mIUU™`mUk@@UUK±nkJƒbUam@kwm@@a@UU@Ua@@K@ƒVK@kmKU_UKƒUUaĉWmkkL@`™LƒnmlkLkbmK@k™@Ulmb@b™„@Ž„xUVƒIUlmVXXƒxm@™JUUk@WUk@ƒakx±@¯x¯Umb™KUUVmUU¯UmVVn™WkÆ„lWb„„„ŽUnWVU¦k@WaÛV@LV`UxšXllU„@„@VVbnVlL@J"],encodeOffsets:[[126754,42992]]}},{type:"Feature",id:"2114",properties:{name:"葫芦岛市",cp:[120.1575,40.578],childNum:4},geometry:{type:"Polygon",coordinates:["@@ll°X„ŽnV‚@XLVb@VVbnb@VšLVV@VVnXxlKnU‚l„_na@mlI„šmJnxlLša„xVbU„VV„UVU„KVlnnV@lmXLšÈWŽkxVV²bVLšm@Ula@UX˜@XW@UWaUUUUVan@V‚š@lUXxlIX„V@‚yXLšw‚ŽXXW°nblJnan@Vzš`l²nVVVl@„nUaVKšbVKnXVaUaVUšyšnXK@kVK‚@X@m@m‚LXa„LWƒU¯„w@™ƒa@UVw„¥°™ó¯¯y¯ƒUǯ»›w¯Iƒm—¯Ç™UUl™¯»ţKċÑţķm¯w@mU_ómk¼VnU`±IkbVlƒnnŽU¼±Lk`@X™Wl¦UbmVUxkXVlkbllU„Vb@bkVmx@XVV@Jb±aULkKWXkWmX¯aUJmIkVm@ƒxU@n„"],encodeOffsets:[[122097,41575]]}},{type:"Feature",id:"2109",properties:{name:"阜新市",cp:[122.0032,42.2699],childNum:4},geometry:{type:"Polygon",coordinates:["@@šXnb°lš„VlnXVJ„LlVnl@zÆxnK@b„blKVLn@@V„aVLVK@L@Vl@XVVInVVKVwlUXwlKšL„ššVVb@aV@X„lUXbVW@n„lWnXKV@@V@XUVVLUVV@@bVVV@@ln@VbVUXV‚I„xVanJ@UšIVWšL@UV@@¤V@nInw˜W„k„lnIVx‚lnzUVÇJ¦VVÜLĸUnW@aV_šWĊXXa‚Knkl@nm™L™a@alUVw²K@UlmnIlJ„w„aVU™kmK@wÅKmU@DzVmVaÝwkƒKƒaÛ¯șĉķ¥ğ¥ƒ@kUWkƏī݃ƒ@@akU„K@KWIUm¯nƒU¯JmwUVmIkJÇLm@™UImJUU@aW@U@@nUb™JƒaƒbXVWn@UVmX@V@b„š@l@Lƒ@™lUb@x™nÇaƒbk@@xVJU¦lbXšƒÒ@nUJ@Vmb"],encodeOffsets:[[123919,43262]]}},{type:"Feature",id:"2107",properties:{name:"锦州市",cp:[121.6626,41.4294],childNum:5},geometry:{type:"Polygon",coordinates:["@@nJ@nlmVnXKl@@°n@@¦‚V„bVbUlVL²l°@ƲÈV@LV‚knVb„VVnnWVU‚@XmWU„a„bšIVa@mV@X@@bVVnIVJ@š‚nÈKlInJVUnx°I„V°mVnXJ@LƒLlV@b„@ބƐĬXllV„@Ġ¦ĸ¦naWW@In@manK@UVkXJ@alk@»lU@ƒÅLUWl_@ša²£‚Kkm@kƒwVmULmƒ@akIUa@U@WUUVU™aÝ@ğ›wkƒƒmĉ£UWƒ@@bÇL@m—a@_mKƒlƒXUwKƒLţÓ@UWw@K@U„I@m™U@UV¥„@°UnJ°@@_™KUwƒW@UnaWUmmI@m™ķwUaÇLóVĵwݙUUW™¯šƒ¦Ux@V„b@šƒxV°X„ƒKWbK@n@nW‚@UL@lWL™m™zUVVbUbmWXXWJ—b˜n@Vkl@LlVUn@xnV@bln"],encodeOffsets:[[123694,42391]]}},{type:"Feature",id:"2103",properties:{name:"鞍山市",cp:[123.0798,40.6055],childNum:4},geometry:{type:"Polygon",coordinates:["@@l„œxĠŽÞ@šbV@@w°Vna‚@Uk„V@K@UUUVa@K@w@UnKmUVan@@Uma@UXWƒWK@IUK@amW_XKVLlKna@kmKVak@VU„@VmšU@anIÆan@‚a„šUVnb@blLV`ÞLlU„bna‚Kn@naVU@¥°IVK@anUUKVaƒUVak™@mJƒkXƒ™UVwkƒVUUa°U@Wƒ@WlkXWlIXUlJlaœx‚IVVXLšll@nLV@lLXl„KĊzš¥maUƒlkXaVK„X°y„Ila@aVkala@a@¥„IUy@WmXaƒ¯kU@U@mmUƒƒULkmm@ƒ¯VmnLVU@a™ƒ@U@±w@™VWIkymLUUkJWXƒJkUmxk@™xUI¯`mUULmƒ¯„m@kxVVbWV@„UVƒIUx@bkšVšVVšxUbVV@V@zšJVXU‚lnk@@lkLƒlƒLUU±Jkšm@UIUVƒLUVU@™K@UƒnnV@l@Ll„ƒaUJ@zn`@nWlƒIUVUUUV±Ln‚@nmL@VUVkLVlUxVLVlÅXma™@@akLmWUX@JUnVJVkXJ@X@`WX„VUVUIlb„W@bVUVL@`Un@¦U`@bUV@z@Jm@@XV`„LUL¯J@IVKmKÅI@J™nWVnLnšVxV¤™z@bmV@VUV@bUL"],encodeOffsets:[[125123,42447]]}},{type:"Feature",id:"2105",properties:{name:"本溪市",cp:[124.1455,41.1987],childNum:3},geometry:{type:"Polygon",coordinates:["@@lb@Vn„lnVVUb@šVJ@nnJ@bmXUx@xVbkbkŽWLUxnl@Ul@„xWx@nUV@¼Ull„knkK@bmbnl‚LVJX@VIVJn_lJVVšXUmnU°VVVUnVVšLna°V°w²@lw„bl@XVl@VVšIn@„wWWnUVk„JVUƒw@šƒ@anaVkš@@lnLlalKnk„mšK@_lKnlĊXVb„VVLV`nL@lUL@„@L@‚VbV@@V@bn@lxn@Vb„alI²mVL@Vl@nVš_VVnJV_‚@nV„K‚V@Xœ‚@b˜kXbl@XblylUUkš™@Xa@UVIlK@UUWVU„Llm@UUUnKWU@K@UXm„XVa@U°KVUUWUk@ašUVKkaWkƒKUknaWa@U—@m@mk@ƒaUJk@@_WKkLmx„l@nUJmIUWlIUaVWVXn@xWLk@@aƒJUI@Uƒ@UVVxm@UVk„mb¯VUU¯JWUƒ@Ån¯aUbÇ@ÇlLmWƒXkbƒƒk@UƒƒIÇVƒUXW™wÇnk@±aU@@bUVUKUXmVƒ@kaUm@k_±l™@XwVa@kVK@U„Wm—VaUmVUUakLUWWnÛKƒVW_—m±V™nƒU¯@Umƒa@Xk@ƒl¯V"],encodeOffsets:[[126552,41839]]}},{type:"Feature",id:"2108",properties:{name:"营口市",cp:[122.4316,40.4297],childNum:4},geometry:{type:"Polygon",coordinates:["@@ĊĖƐn¤„„°Ċ¯ŎWšô„@xXb‚wnKl@nX@VUVƒKmL@VU@Ux݄@Vlb„x„U@VUb@b‚kœ`‚IUlVUn„V@@UV@@JnXlK@bš@nbÆWUkUKVwUklKVU@UnK@mm²KVUVVVU„JXk@mm_@yVI„bkƒ@K@kmU„m@VšLV@VU„KVUVJn@l™²IVV„K„klK@kl@kmVUW™I@y@UUUVa™wUUU™l™@akmmVaUKmIUaƒJk@ƒwkaóIWWÛL@UlmUIU@WW@UnUUm@wmIVK@Kĉ¦™@bWKk@max@bWXkamKƒ@mVkKmxÛaWX@xUlÝnJ"],encodeOffsets:[[124786,41102]]}},{type:"Feature",id:"2110",properties:{name:"辽阳市",cp:[123.4094,41.1383],childNum:5},geometry:{type:"Polygon",coordinates:["@@š`Vz„‚Wn„VUV„L@bVbVJ@IÈbVb@lVLXW‚n„š„x‚LnKVŽšb@„n@Vbn@mƒ„V@šl„IVa„@@WškVV„I@KVLVanJV_VW„UV@nn„JVI‚Vn@na@alLlmkƒVk@»VU@mXwƒwk@@VmkVwXKllaUa@wVwnW@amI@mUI@™VaUUkmmƒ@UkaƒL@ƒUIĉyƒLWkkKU@mKk@™kWKUUJ›wkbkIWVkJWXkl@X„‚@X¯VVbUVl„UxšVW„„lnIš@l‚Ub„VUbVLmV@bUL¯J@¦UVmbm@LmbƒakVÝKU_kK@amaVUƒ™bm@ÅbmJ@b™VUnƒ@UVl@UbnL"],encodeOffsets:[[125562,42194]]}},{type:"Feature",id:"2111",properties:{name:"盘锦市",cp:[121.9482,41.0449],childNum:3},geometry:{type:"Polygon",coordinates:["@@Vbĸx‚š@nnJVnXŽmb@V„XVxšL@`¯@mI¯Vƒ@U¦@VšV@nƒJ@V@LXx@VŤÔ„K‚LVx„W„knL@`˜b@nÈK@a„@VXĊ¤„nVK@aVU@UnU@ašyU£Uwm™mKXUšm@IÆJnLUL@J°IVKƒKU_@Wn@@I@yVU@aV_@¥Vm@_UKUV@aƒXkaVJVUƒUXW@_@WWIUlUIVm@IVW@IU@@VU@mƒUVVkJ›_l@aVa@UƒVƒwka@UރVwV@@UnK„LVU@UmWk@mLxWa@wóƒUVUIÇÆĉ¦¯¦¯xʟJ"],encodeOffsets:[[124392,41822]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/nei_meng_gu_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"1507",properties:{name:"呼伦贝尔市",cp:[120.8057,50.2185],childNum:13},geometry:{type:"Polygon",coordinates:["@@„m@Łkƒ™Žƒklƒôƒ@£kJ°ý™ɅķÑó¤ğLĉÅlÇğŁW¯¯›™ƥóÿlwkţÈéÝƛó™°ÞÅxV¤ĉĖWƒ¯lȭţυ̃ɱÿķƅˋğɱřÝţϙȍƧĊţ@¯kWKUKm¹Å@ķJU@ƧÑƧ„ō¥˹Ɔ@L@„Þ‚VLnš@VōČWJX¦@JŻbU@ţÞmVU@ȁýóbkWWLƒƒÅ™¯UWġkmóƒ±UŹôV¼ƽ¼ƒł̥ĖƽǬʉxĉŽŻȗKΕ̛ʵƨʟÞ˹»Ƨţ»Ǖō˷Ȍ±ȚʊĠUɾɜɨmÜ֞߼˸ƅȂ¯ǖKˢğÈÒǔnƾŎՂ@šĊbôô̐¼ƒ@ĊôĊŽÞĀ™xšĖƧL±ŽœŽ‚Uš°U„°ĬƒČ°ÜƒêɴȂVł°@ƒ„nxŎèƒbȄÞȌ΀ǸlŽ²IlxĊl²ÒmšôĖ™Èl„ĵºm„ÈêVþ„xɛČʉÇĵVmš„ÒƒÈɆôƐŰǀĊ°ÆǬĮƾb„yĊ@ĠšƒXǀċm»ôw°Ûk¥Çm¯ç™kkÇǫţǕéX_ĶWǖīŎaÆĵĸĊ@ȚȘ‚™ĊLĢĉ„VÆĉʊÇĕóaU¥šĉ°mkÅ°ġUĠřk°mƒÑČÿ˜ÛƒWĸ£ʠšÆxÈÞŎÞ»ʈ²ĊÇČalÒ°Ť±ĸz„ŽĊKȲm¤Ŏ@Ò°¼nyȂUźīǖƳÈē°@šÝĶƒ@ƒÈkl¥Ççkxk™›JXÇƒUÅ@˜£k»„óƿīÛ@lÅJl¥óý@¯ƽġƍÅan™ċ™°é¯¹"],encodeOffsets:[[128194,51014]]}},{type:"Feature",id:"1529",properties:{name:"阿拉善盟",cp:[102.019,40.1001],childNum:3},geometry:{type:"Polygon",coordinates:["@@™ƏnǟƨʫšŹɆÿ°¯ÆV²ˢ™żÿ@ÝÆŁȰ¯ȀƳĉó™™@ğkyš¹@īš›ƒwl£Źƒƒ¯Ŧé@™ÇÇxŋĉƩUUŃōL™Ç™ĵóÝnƒóç@™™ó@ġƒƱ„¥ƒç™WUçÆōƒ@é—çťK™çȭVһƽ̻aW¥ȁ£ʵNJǓƲɳޗǔlżÞmĠóĬȂɲȮ@ÈĢŮźÔnĶŻǠšŎȭœгŃċóȭţΗÆƑÞƧÅΫóȘǫɱȁġlÛkÇ°ȁÈnšõl¯ô„ÞɛÝkĢóWĊ„zÇɼʝ@ÇÈķlUČÅÜķnέƒǓKȮŎŎb°ĢǀŌ@ȼôĬmĠğŰōĖƧbЇƧōx@ķó£Ål±ĀƧīXÝġƃêĉK°Ýʇƅ@ΌʉżÅÒϱʈ@˺ƾ֛।࡬ţશóЈèʞUš¤Ґ_޸Ƒʠɽ̦ÝɜL׈ɛϜóȂJϚÈ@ǟͪaÞ»Ȯź"],encodeOffsets:[[107764,42750]]}},{type:"Feature",id:"1525",properties:{name:"锡林郭勒盟",cp:[115.6421,44.176],childNum:12},geometry:{type:"Polygon",coordinates:["@@ʶĬĊIȘƨƨŽ@ĬÛĢșŤĉĬƒĀóšU‚ÈŚÜènŦƐȤȄłϰUƨťƾÑ܆ğɲƜǔÈèʈƲĊƞƒšɆ¯̼V˺Ò˺ȂŤVĢêU܃x„Āˌ˘ƨ„Æ°ѢmÞżU¼ÆlŎ@ĊçŎnÈÒͪŎźƒĸU°lżwUb°°°Vš£ÞlĠĉĊLޏɆnźÞ„n¦ĊaȂīġŃ¯Iĉůl»kƒ„™Çý„¥Ŏ¯ƒén£ġљÝȭxƒÇ™@Åçķ»óƱŎ¥™çWÿmlóa£Çb™yVÅČÇV»ÝU¯™KĉýǕċţnġ¯»ÇōUm»ğƒÑ™wƏbċÇŎċwˋÈÛÿʉÑ°Łkw@óÇ»ĉw™¥VÑŹU™mW»ğğljVÿŤÅźī@ř¯ğnõƐ@ÞÅnŁVljóJƒwĊÑkĕÝw¯nk¥ŏaó¦ĉƒV¦Å`ğуÑÝ@mwn¯m±@óƒÛKˍƏǓ±UšÝ™a¯lƒōšșk„èƒĬގn@ŤġŰk°ċx@œĉ`Ƨĕ°@ţÒĉwmĉ@ƒƒnƒƒa„™¥ķnƒÞĉVóÆókĉŽķ@ÝkƧƧÛaƒ°Ç@ÝÈU˜óbݼ@„ÛÒV°™@V¼ˋL™ÞɅŤŹǠVÞȗŤÇĖŚōbȁƜ"],encodeOffsets:[[113817,44421]]}},{type:"Feature",id:"1506",properties:{name:"鄂尔多斯市",cp:[108.9734,39.2487],childNum:8},geometry:{type:"Polygon",coordinates:["@@ĶL²ĬVłƑkkl@Ȏ™ŘWńÈĬȗ¯™ºlz@ĠššĊôŦô„ÒĠ°kÞܚ™n@¤„UĸèĸbŌÈXŽĸLlÒĢxɲÆ¤ÈÛƾJÈÝ°UšÅĶ»²VW¯ĸJôšbk‚V@ôlbnĊyÈzVôašb@ĸ‚ÞUl°yǬ²Ǭm°ššk„±lbn°@È»˜JX„VŎÑÆJ@k„LšƒÆl²™Ġ²ʊůĊġ‚řóƛÞÅ@m„ƒmLUÿóĉƧ@™»L@„›`ČĸmšȗÑţů±ĉğl¯Ā™wǎƒçƧŤÛI@±ÜĉǓçō°Uwô™ǫůķƳř±bÅ£™ÓÇwnÑó@ȁƽ@™ƒÇƧĢón»ŏĕóĊ¯b„Å™™VȯÅImƒōKU„™LǓ±Ýxċ—ŋ˜V±Āȗ°™„Źl±šÛ@WÒȁŚŹНŚÅèŌô„¼°ȰɞȂVĊ"],encodeOffsets:[[109542,39983]]}},{type:"Feature",id:"1504",properties:{name:"赤峰市",cp:[118.6743,43.2642],childNum:10},geometry:{type:"Polygon",coordinates:["@@ɲŁĢljĊwƾōÞĭ°_ŎŃźȹƒUČÿl»¯ôķVÿǬƽ™ɅġÅÑǫ»̐ʟȣU™¯wVWݍÈġW»Þ¹m݃ɛŎÿŎōͩůV¹›ō™éċ™óŹÅVVĢǩʈ@Ėċ@ķšÛšV°¯xÇÅţ¥™»°Ûô™ĉʟ„¥WýČ¥™w‚灻±mnÅķ¥ˋVƒbUÒġ»ÅxğLƧ™ƒbWĖÅxš¦U°ÝVóŰlô²@š¥ÜÞÛô„V@²±`š¦™„™¯Ý@„ŽÅ„VÒō¼ôš™¤V²ŹĬÇĊƑƒţxƒç¯Lk»ʟlƽýmłÝÆƏ@mö°Ġ@ŚŹĬţÆUĀĠNJĠŽX¼šnźVUҚ¦Ċxȼ@ôlx¯łʊÒÜĀˌÇČxƍČÈƐašx„ÒĠŽn¼ŎVȐ‚¼Ģ°ŤmǖČĊþšLV°ÞŽU¼ċÈUƚzÈa‚¤ôbkŽ‚nXĀšè"],encodeOffsets:[[122232,46328]]}},{type:"Feature",id:"1508",properties:{name:"巴彦淖尔市",cp:[107.5562,41.3196],childNum:7},geometry:{type:"Polygon",coordinates:["@@²@Ζǀݴʶհĸ„˜ƒ¦Ķ™̒Uˌ¼ӾÇƾ¼̨UÞĉ˜Ƨ—éÝ»ƒĕĉ—ƐȍœōǪakó‚ó¯a@™ôţ™aV¯Þ¯°@²él¥ĵğťwōxó¯k±š—Vó@™aóbUÇyĉzmŽkaóŽU@l™aó‚ķIX°±Uĵ¼™Æ¯VÇÞƽIÇÜÅ£ɱŽġwkÑķKWŋÇķaķçƒV@£šmۙlÝğ¯ƒÑťóǿƴȯ°Åł@ÞŻĀˡš±ŽÅU¯°ɅĀ™źƧʬmǠšƐ"],encodeOffsets:[[107764,42750]]}},{type:"Feature",id:"1505",properties:{name:"通辽市",cp:[121.4758,43.9673],childNum:8},geometry:{type:"Polygon",coordinates:["@@ôƲĸ¼Æèš@„ÈȮwƾ»ʠĢ¥VÆ@²¥@»Ŏњ¯ĊJŤ£k»ÆÇX¯̼ōšī°aX£ôƒƾȁź¥„ƒ™aôŤ™ĢL°ƒĸ@Ȯ¼ÈÒʈŚôVXůÆaĠƛÈKƒķšĉôÿ@ğÈĉ™»ÇVn™ĉV›wXĠÝ°šČÿĸwVƒ™¯¯ǵ±™ĉ‚ǫ™ÅÅm»²Ż±ƽIm¥ţÈķ@¯šƧJV»ÞUÝç¯UġºU£ţŽóaÅÅlƒƒ™Ƨī¯K¯Þ݃ğL̑ȍƽ@ōŎōĀƑɜnÞݺX¼ÇĢގUX°xVšʠȤ̏Ǭ¼ÆÒɆĢšŽǫƾUĀóĸ°‚k¼ċĀƑVŹȺōń¯`ÝĮƽŎĉxġNJɱłō¦"],encodeOffsets:[[122097,46379]]}},{type:"Feature",id:"1509",properties:{name:"乌兰察布市",cp:[112.5769,41.77],childNum:11},geometry:{type:"Polygon",coordinates:["@@ʠǠÞĸɲȺƒÒȂƛŎaƙÈĕȘţUÝźǟɆţšÝˌKU»š@U¯ÜÑ@ƒÞ»ôaV—ÞÇÈ@„¯ÜbƨƨÞlĸ@ĊôlôÅĊU„Ýĸmš¦ƒŽ„bm„„„Ċ@n‚ĊxŤÑ@¯‚ƨĖĊ_@›Čwl¯™ƒȭL›Ý„»ƽ¯ķů„Ǔ@ÇǓbċ™ÅÅÆwÿĠÇU£óaƒ¥¯aŎğĠţkw°»¯ůlÝĵkǻݰɱƧǫaóôɱ»Çk¯ŃóƒʇŐŻ›ĉNJŻĢ„Ž¯ÒÈUl°ƒx°n„Ò™Ĭón™Ċğ°ÇŚĉ¦ʵVƒ°°ĬÛżÇJȁńʇʹó˂ƽŎ›Æţ¦"],encodeOffsets:[[112984,43763]]}},{type:"Feature",id:"1522",properties:{name:"兴安盟",cp:[121.3879,46.1426],childNum:6},geometry:{type:"Polygon",coordinates:["@@ÆXnlŎ°@LVLĠþœxĊUȮĊnU„ĠV@żaW¯XIŎġƒ¥Ý@K@w@K@I˺ŻŎ¦ƨƒƨÒŎIÆ@X@VºnX°lŎ@ƾĉˤƒȘǷȘÑÝݚÞbVţĸÿŤxÈĖƐŽêÇKnĸ¥ô@›ķÞUnÒl@UŚaƒīˋƒ¯ÑƧx@±kXřƐƏÛéV™ˋ»lō¯ĉ„ÅÇÓǫޗĖġV@ğ»›°ĵ„ÇÞǓ¼¯m˜ÛÅŃĉĠÇƾb²çƒ™šéż¯VƒƒğÞml»ōÑV痻V¯™¯šĕÆU¯y°k¯¯V»ôDŽѰa@Źk™ġKţšóŽšbƒ„Ź¦ƽȂó„W¤¯b™Ĭ̻ŎW°ÅÈl¼ţ¤ĉI™°ōÒ@¼±¦Å@UŽġ¦ʟŽƽ¼šÞĢÒm¤„êō°ƒ¦Èþƒšl„k¼ĊŰ°JĢńȁĬ„°ƒżn‚ÇbV„ݼ@¼óĸţ¤@°Ånšl"],encodeOffsets:[[122412,48482]]}},{type:"Feature",id:"1502",properties:{name:"包头市",cp:[110.3467,41.4899],childNum:5},geometry:{type:"Polygon",coordinates:["@@źxżĀǔÆǬVȘĀŤ¥œÅƾōôˁʈͳȂŃÈIÜŻ¯ī„¯ōm™¯ɱĖ¯ƒķÒÝIÝ»ÅV™ƒlÅôфġ™ğVmÞnnƒWçkW܁XƝÆwU»Șĕš£ĉÑ𱱚Åk™„ƒK@lÅIō҃UW‚—IǼ¯@m‚kaƒ²™l¯™ǫnǫ±¯zkŽÝVķUô™˜l²ô°ŎwŦxĶĠk¦±ê¯@Ý°U°šbóŤ@š°bôlôǩb›ŎƏȎĊ˜„ĖÞ¼˜ê—ƨÝĊ"],encodeOffsets:[[112017,43465]]}},{type:"Feature",id:"1501",properties:{name:"呼和浩特市",cp:[111.4124,40.4901],childNum:6},geometry:{type:"Polygon",coordinates:["@@ʶUĊ¥ÈřĠ¯šĉômšīƒÑ¯m„wk¯ÇV°ÑƒżġĊljǓɱţǓ›ƝóX¯ƒɛÒóa@nÝÆôƜŚĉĢʉŰĊҙ¤ȗĖV¼ÅxWƞۂlXXèm„ÝmUnšĠƒĢóÒkƚ„ÆUÞ¼ÞJĸÑ°„ɲĕš°Ŏn"],encodeOffsets:[[114098,42312]]}},{type:"Feature",id:"1503",properties:{name:"乌海市",cp:[106.886,39.4739],childNum:1},geometry:{type:"Polygon",coordinates:["@@Ș°ÇīXњŗ@ȍlkƒlUŁ±īĵKō¼VŽÇôXĸ¯Ž@šťê„°ź„k¤„x™œ@Ĭ"],encodeOffsets:[[109317,40799]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/ning_xia_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"6403",properties:{name:"吴忠市",cp:[106.853,37.3755],childNum:4},geometry:{type:"Polygon",coordinates:["@@nLV‚@šVLšaÞbn@@l˜š@bUVlUV„zVx™¤kÞVèšXnš‚@nm°a@UƒÑ„@VŽXnV@Va„UšŽVKUUU@@U‚@@KVa@U²@‚wXkWnk„±lLnU@UmmVKnIVWnI@UK›@UK@@UVKXkmWLWUXmlkVwUyVa@w„w@aVI„K@aVÈw„KlLVV@LnV„VVnU‚ܲ°WÈIUÆ@nÞ¼‚‚@¦™@UÞUVW@UxUxVn„b„K‚b¯ÞU`VbǬ™V@XXÆVVl°InmnUôƒ°¯‚anam£œWVX‚KXmškôaVU@ƒVak@@wmaƒn@K@UÛUWKXUƒÇƒ@UI™b@alW@akLUKV@@Ukw±Iš›nL@kmwkWmk@JUIƒůVmnnU@m@UƒK„VKlkUwkƒƒnVUKmbkI±š—KƒkmVkKƒb@U@aƒVkUmn™`kIlaUK@UUKmbUIݚUa@mUa@aƒ„m@UUULUK@bmKkbWI@WXwlkXƒWa@k@kKƒLVkkK@L@JUVmzUKlwUUnW˜£XVlKUwVU@aXI@aWaUw@W@_nam@¯‚UkWVkUWaU@nwmJkUVkWVUmUkJ@ImbUaƒ@@WÅ_mJknmak@@mƒXƒaUV@„ƒxUšƒ„@‚ƒ„@VUnkVƒ@Vn@`ULUbWLXVW@kbUJ@XW`@ƒnÅĖWJƒ@—m°@xƒxšbnUa‚w²lƒÞ°xŤIVVULۂWbšbkVVXÆ`UbVL„@kx°LlV@Vœ„WbƒJn@bl¤ULV„°@lmL@ƒƒ£U@@aUwmKULVxUVVx@„™@kU™@mK¯LÇa¯@"],encodeOffsets:[[108124,38605]]}},{type:"Feature",id:"6405",properties:{name:"中卫市",cp:[105.4028,36.9525],childNum:3},geometry:{type:"Polygon",coordinates:["@@°@Èb°KnLš@lVš@@ƒUwVUUwVKnLVx@bV@„¤@„nK@k‚¯UƒVKk£@a‚m„IXa›ƒ@UkU¯Klwƒ@UKVaÅ_UWlU™aXa܁VKUUţJ¯w„ݱkxVbmŽ™a„w@wn¯˜„@XIÆĕ„m‚@X_@WVIlaX@WUXKVaVK@_Um„@lUVm@U„ƒ@„ƒV™„w@ƒVUÛwm@@W@ImKUkU@Ua‚aXƒ@wWaUKkw@UVaUamLU™nk@»±`¯@k—W@Ua™ykbƒI„„@VWJkLWUkJƒwU@ƒn¤mL¯wm@Umƒ²XVWbnV@bmxƒVkxUblLUV@kVWKU¼ƒŽkUƒ@mn@JnV@bUnmJUn@„k‚@XlxšLVVnKlLVV@š@LkKULVbk`WL@lkXW@kVƒ@UÞUlÇX™lkaUbmV¯@@L@šƒV@bkb@xƒlW„—bƒbW@—±@UJ@IU@mVk„VxV@@l„Illœn@Vm@ƒVUbl„@JLmKÛXmVkU›KULU`@LĉwƒKUX„lVUl@Vb„JX¦̼bÞxŎxɜĖĠ„Ŏaô@"],encodeOffsets:[[108124,38605]]}},{type:"Feature",id:"6404",properties:{name:"固原市",cp:[106.1389,35.9363],childNum:6},geometry:{type:"MultiPolygon",coordinates:[["@@Vnn@°xnK‚£„mV@„xlIXVlKXI@Uƒƒ„JlašzVbX@l˜°@²_@¼mlVšnKVbUb@VlxVLXb@xW„bVbV@VlnL@J@Xn@Üx„b„W@nl@nblmnIÆ`@X„@Vbna@aVUUWVkƒ@kbWakbU@VwšW@_l@nmn@@alVlk@UkmVak@@a‚UXaƒL@¯@KVa@axWI@KnkVaVJn_lJ@„X@‚m@nVanUVb@mXLlJ„VWnLla„VVaVX@KXVVkVKlknKVa@aVU@KXb@klJUknUmƒ@K@_UW@alIUamaU¯kJma@IUK@U„@@UW@@aXLVƒVJVaXIƒKlaUkUV@ambUUJkIWJ@wUI™V@JU@UwV@@Um@™nU`@UkUmVUxWUUV@aÅb@aWXkKUUƒUUaWK@wnm@IVU@aXwm@UmVaUalk@anKUwlƒUwlkK@wmaƒUkmmIk@VmkUUbW@UVUnW@kV@xkVmbVnU‚™@UbUV@a›k@kkW@„kLW¤@„nV@VU@W_UV™UU`VLUV@IUVõVULU@UUUJ@wmkUJ@šWI@l@bkKkbVVƒbVbUL@UUJ@Vm@@L@xbVVVLVlVwX@Vb@bmUkbk@@JWIUVÅw@Km@UkWKXxWLÅ@UVUnWK@xkVW„@KULwWVXVWzXVVKVXkV›V@VUbV@U„VV@š@LXxVL@V„b‚Ž„LnKVLVxXVmb@l"],["@@@J@aƒU@LWK¯UUxVVn@Ġ„„LUW@UbUUUa@KUX"]],encodeOffsets:[[[108023,37052]],[[108541,36299]]]}},{type:"Feature",id:"6401",properties:{name:"银川市",cp:[106.3586,38.1775],childNum:4},geometry:{type:"Polygon",coordinates:["@@šUšwVK@UVWÞUšbšw„V@knV˜@@KU_VK@K„ƒn@W_XWlL@Vn@Ċw@Ulaœ@Wanamī@aƒ»ŋó@aÆÅɲÿUaV_°ÝaƒLƒaUmVwVwX@VUVݚ@@¥Ý»@mVÅÇJ¯XÛ±VUmƒUmU@KUUkKƒLÇxUŽ@bƒLUJ@bƒx@xUbVzUxklWnXV‚KnXWlUL@V@ŽVLœ@VL@ŽmJUXmJULnn@VmVkKƒ²mlXWlx±@@VUb@L@@VV@VVUL™ƒVUbU@WmUƒ@„Ò@V¯bmn@VŽƒ„@lVnUšnVWŽXVl@¦VVUn@x‚š@‚XL@¦‚lXxš„Vb"],encodeOffsets:[[108563,39803]]}},{type:"Feature",id:"6402",properties:{name:"石嘴山市",cp:[106.4795,39.0015],childNum:2},geometry:{type:"Polygon",coordinates:["@@U¯ķó±ÇÛ¯™ķmbXb›@kb@Vĉxm@@UkKWXX`m@ƒ„@LULV`@L—@mU@lƒU™x™aÝVUX@VUL™x™VkLWVšš@J„nVLXVlŽUV@zl‚VL@V@b„„n@lU²WVLlLVbUŽVxUx@xǀL˜xôҜk‚K²ŽVa‚U@wXa@W™ÈĉUa@‚bÈk„m@¯"],encodeOffsets:[[109542,39938]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/qing_hai_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"6328",properties:{name:"海西蒙古族藏族自治州",cp:[94.9768,37.1118],childNum:7},geometry:{type:"MultiPolygon",coordinates:[["@@„V£°š@laœXô±źwš™ô@„Ulƒża܍n™Kƒw@U„aƒ™ša²L‚mÈLƚÈxlaUa„wÞmÜbÞUšnJ°a„kôƒ‚ÑkwÝVğwÇ@ÝkkV¯¥@ò„»„nŤ¥XImw@mVwša@Åw™mLkaW—wƒ¥l»kçƒó„»@ƒWÑĉŽğ@ĉ„™‚Ń„UwóřVómĵ»™™Ý@VǕ¯kšÝĊÅk™°ÓUklkU±šI„ÇÞkƒ±@šƽJƒ™@UġIk@W¦™VÑșÓÅnťKULnŽ¯X›ƒ@¯mUÛ@WřmóKknōbƒxÝ@ƒŽU@kw@ÿÇLţšÝUkšmwƒŽk™lċVŚU¦™ŽƒLkUWlÅÑ@aƒ@ÅѱUóġŹ¼ƒÈĉmŻ@@wkw™Kl¯U™ġ@—„lÇU™Ó¯_ƒ‚Waĉ²Åló¼VbknƒKǎÅ@ƧĢō°Ý@ğ„W™ÅxUUm@™‚ÝXۂW„ULUè¯@mbUaƒLƒbUWġxIUJWz™a¯b™y™@ōÈóLU`ÇXUl™UĉV¯n›mÛbǕLklƒUĉVƒšóaġ„ƏbġKţnkbÝmmnÝWȭȃŽÝXţWókUÇl¯U¯‚ġUɅĀ@°¯„„š¯„VÆnmJ@ĊķnóJUbÝXUlVškL@lVxnnmb@¤Vzš`ÞÞŤ@„VnÆJV„°b„UôJkzlŽkl@²óš@ÆÇ°kĖƒšÇbÛU@lmb™XV˜kzƒV™ŽɅĀXˢlń„ĬŹ@›éÅ@ĉńÆ°ğbUšlŽɜ_°‚@xŦ˜škbVbƒKĢ„ŤVŎŽ°@żÈźlĊ„ôKôb@nôxŦ„Æ@ôŽŎL@þÆb@šnnšWˌbÈx‚InaŎxlU@Ѳ±ƒğVUĢƒƨbɲ@Þ¥ôUUķWVô¯ĊWʶnôaŤˁ@£nmnIôŽǪK°xUXô@Ŧa°m‚kXÆÞVŎkĊ°ÞLȄôyVašIlwX°UVwĢÑÜKôw@nV@œm°nmŽn„Ü‚ɞ£VbmŽXnƒ°ÜÒ@xx@V‚b²UlbkxVnšJUnVVĊ°KȚm°nxÇnn¤±¦@ŽUXVV@„lV„„bmVVȁŽVxšÒ™°šIšbźaȃšbVwš@šƒVL„™ƾÑ@ƒŦô¯ĊkôÑ"],["@@„@šƒ„@n„òVœa‚w²bVxšxÜaČVô_ĊJšIVmšL„a°@Ŏ¥XlK@ƒšk„l„KVbUb˜@nUĢn‚aÈ@lmǬ»Ġ¯œn‚mnƒƨVy™Ñǖ™Ġ»ɲInŽ‚@@ÅĢƳ@¯°™ôV„KÈbVIÇ¥¯@Ýó„™@ÑnīWKšƒk™‚k@¥š™¯™Åa™Xƒ±VÅw@±Ġ¯@»™š™n™Wmw@ƒ™@¯ƒVƒUUWçƒKĉ„a±VkkƒV¯w™x@šUJ‚x@bknÇb™mÅ@Uw±U¯¦UŽ™Kmš¯I¯Žť¼ğĊ™@ǃŹÈ¯@Ý»ÇnˡJƒbÛèÇnƒ„ÅK¯„ġĠŹW¼Ålm„@¤n²ƒŽÝb@b„š¯lƒ¯@ƒšÅ¤W„™¼nV@x„„°@Vx„@lbUblbX¼W‚œšÇ²lšUŽ@¼ŽV¦@bÇlVxUbVxÞbVšœbm¦ƒVV„"]],encodeOffsets:[[[100452,39719]],[[91980,35742]]]}},{type:"Feature",id:"6327",properties:{name:"玉树藏族自治州",cp:[93.5925,33.9368],childNum:6},geometry:{type:"Polygon",coordinates:["@@ɆÿĢV°°VÈklVôŤXÞW„ȮÇÞXnmÞnlaŤmĢLƐaĢƒôb„™ĊU„VlkǖKÜaœn°mĊUšVVkÈWV_ôKŎǚ@šz°ašbXyVI‚JĢwVX„a„KVbna°@VçVKXƒÜÞWšn@VVÆwXšĠƒÞ@Ŏ¯ƨġÆ@ȍ„LlmUaô»ÆkĊ±Xb„°`šÔV‚kȘƒĢ@Všk°šLlx@xż@Ċn„Çź»ôĢ²VÆ҄@@bÆÒXklV„KšV¥Æ™ČUšk‚l„nxl™çƒ¥ċç@±m¥ƒwÅJƒ@™™™Vƒ„mÈIléÈa°U¥™™@kÞV‚K²ÑWƒ°w²Ñ‚K²ñšyƐ„ÝšVmw„»kkWĉ—JWUƒVÅwƒL™mÅ@@ƒmw„kn¥Vу»°™°@@»„¯„Lla„JônV‚UůƒU@W¯Umѯ¯k@WykU@¯„wV¥ƒkVwţƒk»šwWǜĉĶçšK„ƒÞ™ÇaĉbƒI™lUƒ@kwƒWƒXUƒ°w™±@UšKn£Wĉ—KWxƒkĕVƒšamwXw™@™„Wmnk@aƒVkƒ™bĉLƒl™Imm„wUÇ‚Wx™nÝJn@¥Æ™kwƒaXƒÜĉ™¯ÅV¯¤mkƒx¯kķܙ²VWôŹVUƒƒ@V£™¥@ƒ°wn@™m@¯@UbUôķŽmn@ÆÛ@ÇýVaUÇĊVƒ@Çlğ—¯xÝŤ™lVÈÈVƒx„ƒ¤Vx™„kK@™@ƒx@„kVƒĖġ¥kIWbXŽŎx@nƒxÅUW`ƒ_—@±ŽUa™LUxƒK¯„WbkVlb—bmŽƒLÛÆWIUwƒWkwÝV@kI›ŽéUb›UUk™V¯Km¯k@Umݐ¯m¯›m—L›Þĉ‚ÛUm™ġ£UxkKm°™Lw›šk@kšƒVm„ƒKVUk›@¯a¯Ģ™móKUU™x™ImlÅn™™ÇbXèVVU„°„@ŽšŽ@„‚xXnmš™ššŽ@¼ğ°@²ÆxU‚„²šWÆb°š™š@¦llš™„XLmĬ@҃šÞô°@ȦUJÇaƒLóU¯š@°ġƴ@Ɓ@mɱJğ¼ǕššÒUzƧ‚m„n›mğ°ǫ¼knÇ@bġmmV—@VaUaƒLƒk™l@„kLW‚ō¦¯@ƒb™KUn™JĉIó`ċUÛb™wUw±ax›bñUmƒƒ@™„ƒ@—bƒaƒbǏÅXm˜„ƒÝ„ÅôVbގ™bl„UšÞVޚ„U‚°„VUxƒ@U„V„@l`™¼nL@Ċ„LW„„¤kXķWġXUVVVķ„UbVb@°kVVxÈa‚@ȦĊbšaźJ„U@Ț„„˜Vœƒlš@XkôaWƒĢ™Þ@laĸUÆb²mÞLĠ™ÞÑôbšÒĊa„JVbm¦"],encodeOffsets:[[93285,37030]]}},{type:"Feature",id:"6326",properties:{name:"果洛藏族自治州",cp:[99.3823,34.0466],childNum:6},geometry:{type:"Polygon",coordinates:["@@ÞVŤ™ÈK@ĀlxV@„Þ@„wŎalmôLšnXÆÜ@nV‚°@œ„°WmVKŦLÆmȚԂҚUX¥l@ĢJVš@„ŽƾI@w™W°™™Ån¥›kÅÝVwôƒÈç„@lÑĊĕša„JnaÆLVw°kny°UnkÆVȍĊll¦„Vƾ@@™nUźƒÈǂIn°X„wÞKô¦VWV£„@£°ókċ±I™™am¯Va™»ČĉV¥°™@m„k„¥l@„Ċm@ašU™mwXƒ@wÆxšmĢ_„`VnÆbšKVw„@@ƒnUVğVmVVöIlŽl@@çÛmƒ£UDŽw°@VUƒ¯»m¯ƒJōĖÅLƒa@»ĉĢ±`U_k`ÇçšóƒkX™lK@ƒakÝރš£WċkÝ™kxƒJݯÅw™xķxmIÅx„@k±J@ýŋš›¤UœkŽmV™°ÅÝxkwmġƒnÝVU„š¦ƒŤlmšóXk¤™UKƒç™@mVkK@klīƒ£mš¯VUbƒW¯¼ċb¯ĵam¼mVX„m@k¤ÇX‚ÇbƒUƒ„¯J¯„¯È@˜™bVXVҙ¤V¼kxݚV„@l‚V—„WxÛ¦Wš¯šmKnlŽkŽ‚šU‚@nƑUĉ„Ý@ǺۄċUĉ¥™UƒÞŏ™z±òL±Ò¯xX„±ÒLÝU@lššV¦¯‚ÇbkêÇJƒnU„šš@š„‚ÆI„xn¦‚‚@²Č脦‚è"],encodeOffsets:[[99709,36130]]}},{type:"Feature",id:"6325",properties:{name:"海南藏族自治州",cp:[100.3711,35.9418],childNum:5},geometry:{type:"Polygon",coordinates:["@@VxƒŽńƒš@ĊĠŽĊXÒ°UƾĕÞm°£nb@‚@LUUW„Ûº@nlÆǬšĠ£ÞV°UXb‚VȂǵ„éƒ@kWanm°@™x„z„K°¯ĠVšƒVƒkw™Lnm°kÞxÆa„¥@‚wnĉƏ@™œ_l›š_VwšmĸèŤÅČU@™˜Wn@ÑmKU™nğƒK@ƒ°¯UÿV£nmšLl™„UƒUÛé±óókkmƒnƒakV@Ç°óÝXƒWəÞťIţxmm™VÛUVȂÓnWyȁĉkƒVš°WnkĊa„¥‚_œK°ÿWna@ƒmU¯wƒlÝIU¤UXó¥ÝLƒx¯WmJÇÈŹ„mV@šƽ@ƒUk¥ĉkċŽÅUml¯Vmz¯lUxÅKmbƒI™bĉĖk҃@Çèó„UxÆޜlm¦šÆ¯ššX@x™Ž@Ž„²ÝlƒÈ™JV²klVl¯ÔlšĉƙްlUǖÞ@ššĶ¼nŽUôôŚ"],encodeOffsets:[[101712,37632]]}},{type:"Feature",id:"6322",properties:{name:"海北藏族自治州",cp:[100.3711,37.9138],childNum:4},geometry:{type:"Polygon",coordinates:["@@ōmġxƽUm±Lǿþġԙ@kxmWƒb¯I¯‚mIUx@bƒbŹVǎƒkĵbƒlĉI¯¥ƒUšm@ƒÆ¯È@šašóšUlƒČ»@w›œ»›wXaƒƒó°ţç݄kUƒaV¥ÅbÝw¯lmnšKlxU„™„ğU¯°ƒLƒyšw¯@mnXb‚l„@ƒêȁǶUWa¯VÝUğ¤ǫ™kÅ@mܹXƒVV@K@ma¯¤ÝnƽĖ¯V@„ƒ¼„ôlèk¼„¦˜xXŽlbnKšÆx@Ž™bUx@nnxWJţ¦ƒmƒ¼ñ@Ž°¦lUÞlÈ@ĠxÞUlxÒó„ƒl¯bmI™ŽÝVÛaÝnƒxVbkbÇwřÇKn±K™b„šƒb@V„xšLmŽÛŽŻbk„ƒVó@™šŹxó²›Wkb™@¯U¤ƒźĊ@lUX„°lÆôU„ƒlLX‚aœV°wšxUb°xÜôÈKVkÈmlwškÈKšwšK™™VUŤĉŎ»„»„Il¥na°LV»²¯Üy@wĢƒ°ĸwlwĢw°±„_lVkš@°ƒbƒÆ¯zƒ‚„š„@l_„@Ģ±lŚVlUaރ„LVƒnKlnȏ°IllČa˜wÞÑ°x„UU™@wƒVkmĠLô»„KÞýôaÞ¥ôĀÞmƁ„™‚mUƒŎV¥Èl°²°a²¥V„@@w„amm@Ñn@Æ£żƒVƒĠ£@W„¯Þƒšl@š»@Uk@"],encodeOffsets:[[105087,37992]]}},{type:"Feature",id:"6323",properties:{name:"黄南藏族自治州",cp:[101.5686,35.1178],childNum:4},geometry:{type:"Polygon",coordinates:["@@ôl²ôÜê„VƒVkš™KmnU¤VĀ¯°@„„LmĠVšnLÈL@alb@al@n°Vš_XmWUÈamaVIn@n‚aV£œóVWƒ™U£°ašxÈ¥@™‚aĊwȹ@óša™ƒğbm@k„w@mƒaÆw@ƒ„In¯mmƒ@UkkWƒÑÅ@@kċÅçVkÝJÅkVykŹl¥@¯š™ĢU܃X¥òý—mmX™ÝÅlmU@£™Wly™XW»Åbƒl@aI›»k@klm@UxUUƒVƒ¼¯Xƒl™aUnķ‚ƒI@x™@¯„ƒK™„ĉUU`óšlČ¯ô@¤ƒÞJ„k°xVŽ„n@ŽmbXŽ¯Ā›L`ƒ¦ĉbml¯X™ŽUŽl„ȂĊXzm‚ȁÔU‚ÜVšUnnŤwŦJɚ݄XÞW¯ô@ÈlU„b„mln"],encodeOffsets:[[103984,36344]]}},{type:"Feature",id:"6321",properties:{name:"海东地区",cp:[102.3706,36.2988],childNum:6},geometry:{type:"Polygon",coordinates:["@@@҄bš¤ÆI°ôU¼š°UŽnnWx™š@b¯L@lUUWbXxWl„ƨnxVUllš„XVŽUŽnL@lȀý²KVnƾ‚ĢwV»ƒ@mÞ£nÆƒÞÑmL™ƒKUaVżĕƒWVk²ƒƒÆÝ@ƒXw°@„ô™@a°wóUUmIk™™aVmÞwmknyƒ¹VÿƧnŏm£X»˜™naV±„Ýw@ašb@aƒm¯„ĉVó¦kÝWKUU@WanU™b@ôǺĉxb@šÇ¦™w¯bV¤„šUX›ôU¤bmm@UJnbÇbXVWn™`¯Umk@@bka@bÇK"],encodeOffsets:[[104108,37030]]}},{type:"Feature",id:"6301",properties:{name:"西宁市",cp:[101.4038,36.8207],childNum:4},geometry:{type:"Polygon",coordinates:["@@@kmKVUƒWk™VkUmwƒƧXkWwXaVV@k°K@aš™XwmmV™¯V»¯óÅJ™£ƒamŽ—X@šċVţÆķç™nUx™`kœ›`@šÅmĊx@Žƒ¦U¦„blVރŤèô¯„„Wbœx›¼œŽ@xċ¼k„™V™ô™bÇ@Å°@„™n„V°¦ĊJ„kĶa„lȍźU„a@aVwnJ°°J„anXlwš@ĢÓ"],encodeOffsets:[[104356,38042]]}}],UTF8Encoding:!0} +}),define("echarts/util/mapData/geoJson/shang_hai_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"310230",properties:{name:"崇明县",cp:[121.5637,31.5383],childNum:1},geometry:{type:"Polygon",coordinates:["@@uŏu»GPIV±ÐɃŜ{\\qJmC[W\\t„¾ÕjÕp‡nα|ěÔe`²„ †nZzZ~V|B^IpUbU†{bs\\a\\OvQ’Kªs†Mň£RAhQĤ‹lA`GĂA@ĥWĝO“"],encodeOffsets:[[124908,32105]]}},{type:"Feature",id:"310119",properties:{name:"南汇区",cp:[121.8755,30.954],childNum:1},geometry:{type:"Polygon",coordinates:["@@`y”ĉNǕDwǏ»ƒÖLxCdJ`HB@LBTD@CPFXANC@@PGBKNECCBB@EBFHEDDDSNKAUNBDMNqf[HcDCCcF…@EFGLEBa@ACoCCDDD@LGHD@DJFBBJED@BGAEGGFKIGDBDLBAD@FHBEF@RFDMLE@SGANFFJBANPH@@E@FJjRIACDMDOEKLFD@DbDAJI@AP@BGHFBCBGDCC@DCA@CECGH@FKCEHFJGBFDIHACEDNJDCVFBDCRKRLDLITB@CjNJI^DBCfNVDHDFKHAFGDIICDWBIF@@CFAjFJNJBBHD@CJ@AEFJ@@DH@BFBCPDBMFEQGDIFCNDHIP@HDABFACBJFHEBSZC@DP@@JDBƤ~"],encodeOffsets:[[124854,31907]]}},{type:"Feature",id:"310120",properties:{name:"奉贤区",cp:[121.5747,30.8475],childNum:1},geometry:{type:"Polygon",coordinates:["@@~T~JjZdDbLXDLCB_J@@FHFZJJIAGH@HGR@BENBLID@@LFCDF\\FpDBDb@FAHKFE†@dEDDdC\\GreNMACVMLBTMCCFCEGFAA@DAFDLMHA@OD@BMEWDOC@AS@KGAI_DcKw„ÕísƝ‘åĆctKbMBQ@EGEBEJ@@MBKL@BJB@FIBGKE@ABG@@FMFCPL@AjCD@ZOFCJIDICIlKJHNGJALH@@FPDCTJDGDBNCn"],encodeOffsets:[[124274,31722]]}},{type:"Feature",id:"310115",properties:{name:"浦东新区",cp:[121.6928,31.2561],childNum:1},geometry:{type:"Polygon",coordinates:["@@EN@JJLNHjLJNR^GRYVBNZJRBV@PDvbLNDN@LGNER@nCNQNuT_TIVFV\\Z\\XnDrI|[Ʉś²ÏJUHOƣ}CA@IO@@CYDATGFIEDAEBBAGCO@GJMCEDCJRHEFANOCADAEG@@CI@FE@BDIC@AGIAIMiEEB@DE@AJCXJDCJEHGBELGCUCeMAD]CIJiM@DSAKJKCLQDQACUECDMIFCBDJGECHAEIWCK@GLMCCGEACNKCEJG@MMBMC@@CIJUINT@JAJSTEPZZCP"],encodeOffsets:[[124383,31915]]}},{type:"Feature",id:"310116",properties:{name:"金山区",cp:[121.2657,30.8112],childNum:1},geometry:{type:"Polygon",coordinates:["@@L@BIHFN@@EE@@EFBDGDAADVDD@@EF@CA@IIsRE@GDAF@BF@CV@|FBCHBLCNHAFCADBMDCFZXHILBVEEQA@MWFARJJ@DCX@@TEFBLHAAERE@AJABRPBNK\\BrJ\\VHGND@CNADKDADQjGAGNC@GJ@FCFFHC@JF@@dLBDSFADHVG\\DTEPDDHJALIJkJDJCDIPE@YDCBiK@DONE@EH@BAF@HLJA@EIA@ALKNA@@FIFAFHR@NALadsæąyQY@ƒA±DʼnXUVI^BF@FFF@HBJEDFFGFEBSRkVEXGHFBMFIVW@GAEEFOIAIPKABGWEKFSCQLQBSEIBC\\FdBLRR@JGACFDDEF@AWB@LJJYNABBA@CUEGPaO_AIE@MYMFIGAEFECHSAAKAO\\[JEDB@E@MMA@@AGBKMGDFFCDDFEDFJF@NPBAFLHFH@EDDHBADDC@DDCDHHCDDFDABDAD@FEFOBCJ[D@HEDDNJBDDHABJIBBvGLBJAH"],encodeOffsets:[[123901,31695]]}},{type:"Feature",id:"310118",properties:{name:"青浦区",cp:[121.1751,31.1909],childNum:1},geometry:{type:"Polygon",coordinates:["@@RUNKdOFDJCbRFMLAHPLDN@JGL@@APBWYCKN@TU@SHGCEJIDIJKVIZVNM`iNY@CIE@CA@KBOEGEUFCCSADEIEFCDDDIDDHC@CKIeDCG@IG@DHWFEEGCH@@GO@@O]CNpeEQDBFME[JC]DGF@CKOA@QSB@GB@@GW@@ED@AQIJIAAFE@@DO@CFI@KNG@CDACAFEGKGBEGBDCCAIFCCLIECFI@MBCLDHGNAHSF@DMB@EEKBA@@C]DEICFG@ADBHGFKCDAKKHKD@@FHGAANGEEFCHKCECBCKG@ADKCNE\\[A[I@@mGBDQQEO@BCE@AI[AML@JGACLOAFKEMM@EQKC@CUCBCCBCHEA@FF@@FM@GEAJK@GNF@EXPH@FD@M^@HIADJCFDBER@DK@@DE@CAKFOCCBDHIBCNSB@GFC@GQEEOWFICGDUAEJIDBTAHJHEB@DIF@NE@H|HBDBEH@DKBAHEF@HEEUB@FGFGCCCE@AHOB@NH@PRLVNNFBX@RC€PbAvMtBfH@DJF@ELBFA@EH@HNED@FFB@HLC@CJ@@DJ@PIRf@HE@CFF@GPHD@DKE@FFBEFFD@DEFCA@DD@IjCRFBAHFDKD@HF@@PM@H@BlbDJDBFEF@DLXB@HCD@@IFCBIFEJD@FDC@FBALLF@PAACJERACAJCBD@EL@JD"],encodeOffsets:[[124061,32028]]}},{type:"Feature",id:"310117",properties:{name:"松江区",cp:[121.1984,31.0268],childNum:1},geometry:{type:"Polygon",coordinates:["@@@DLDFRN@FNELPBDKHB@INK\\BBJF@ADP@RFCRHA@nJ@B\\[\\MFLDBCH@DLDADFGLEDFFMHBBGH@EC@GLLLCBLDHEAGBCH@DEFJ^C@DB@LAFFA@CNE@GTMBGHKCAD@NEJFDKJDDJEDBCDHAAFLHFHBEBDDCH@LMJ@DEP@@CF@BEJBJIBRC@@FX@@HA@@HTA@RPBDLE@CHD^\\INFAERCfFMo^D@PP@@HG@HDFFXECGH@@JDHfCLJ@DGDCCCJCCEDJFCFTBDDVEHFPFLAB@NBFCFKFC@CHIACNOHWHCAAFIDD@CDAGEI@ACFMF@R@R_@GQED@EGFEQEDE_IAHKAEXCQUOQCUDEN@ZI\\DDmAMHCICDSOC@EG@BKHIGMIBCGOCSF[CUHCGEBCTKA@cE@@IGDEEEDI@@HMDBHiHCRCBCLMB@DMCGH[UqI[AMLOAAQIB@BQFBFGBAKFE@SW@CDI@QIEBNXB@FRUFKAGJYWDENCCADBBEMGKDGAAD{EU@@DAEE@CB@HQFJt@JDBE@@FC@"],encodeOffsets:[[123933,31687]]}},{type:"Feature",id:"310114",properties:{name:"嘉定区",cp:[121.2437,31.3625],childNum:1},geometry:{type:"Polygon",coordinates:["@@F@LI@IDKJADKIEJICADGACFECCJ@HKCAFOHAJI@aCBEE@ICAEB[GFGCKL@FGEIFADMLCAEJM@ELQECEIG@BE^QKKLQCA@EHBIGQ[GEHOMGGDHKH@JOECFCjCBEFDNCACMBCILGTABDLEEOEIG@GFIMM@CGKFBFCDE@@GEAGEEACIcGaHMFITIHDN[AKF@FS@OA@BK@IHM@KCGOKBENaQIDECcPMLQVFHFB@BFBKLGD@FAJOVGIACQ@A`LPCB@JEF@RU@ANS@@RCL\\HIFpRBFRBBDKLLDADJDGBFDABHBEDNF@DGBBBADKDAHC@\\JJFBDEH[DEFDH\\LX@XLBLbT@DNJLDCEL@VJABJNDHB@HBHYFBAA@GNFB@@AFB@AFABFLFBHFCL@HJBAFBLC@DN@HN"],encodeOffsets:[[124213,32254]]}},{type:"Feature",id:"310113",properties:{name:"宝山区",cp:[121.4346,31.4051],childNum:1},geometry:{type:"Polygon",coordinates:["@@ˆmÖoÖiƒ½[s[YEUJU`SCIEBCCWJY_LIICDWU@@FaBCJIB[ICH[@@CDKEE@MK@@IMCAEBCH@AMFI@SMGEFGB@FK@BHCAIFJNQD@FEBDFMBKGACG@ECWH@@CDDTOEEBGEK@GC@EE@GPHFR\\JHGA@FDBKRLL]RAFH@FJFDKR@FINBFKDCNEBFJEHK@DLEH\\HFADB@JFFDA@bIJGBEPDBGLI@DDEFBDCHDBIJJFCLIBCL@JKJE@ADHDBHJ@HIBBDFHBBAEIJ@BJFAVL¢ˆ"],encodeOffsets:[[124300,32302]]}},{type:"Feature",id:"310112",properties:{name:"闵行区",cp:[121.4992,31.0838],childNum:1},geometry:{type:"Polygon",coordinates:["@@T@@ELE\\BCMJGJSNEbGdHDJFBJAFIEIFCEWG@@gMENSFCVJFAxR~B@IH@AIiI@GE@FGEAFQPDRiV[\\DFSGMHAXHDOMCJCDETBBNVJJI@DD@ANNNH@FILDDMFBDHNDHKL@XDFGLD@EHGFD@DDB@CDDHCDAEAHG@ABOJ@BIaC@CECLKPFNCDCJBiQEIF@@@OGBMIAEEBMTHF@NKEC@QFEGA@EBCKAACHCLJHEFHHB@AFCAIEACIC@HG@KCCDC[ECEED@KC@KJMAAFQ@GHG@BHIJYIGE@EI@A`KDWCaKcCiY}I}S[CYJM@CFDVPRRVWDFžLBBG`JCFRFEFFHC@RF@HQ`Q@E@ENBDJ@HFCB@DCCEJBBGDGXMPBDGJ@DEDELEDMA@DJF@DMZ_jMNYUUJILCJIJDFGH@TSVM@DLXZ"],encodeOffsets:[[124165,32010]]}},{type:"Feature",id:"310110",properties:{name:"杨浦区",cp:[121.528,31.2966],childNum:1},geometry:{type:"Polygon",coordinates:["@@V@CXJDKJZ`XIDDFADJvSRMDM@mFQHM@KCMKMuaOCU@BDAJSX@HKJGD@PNJCJWAGT@R"],encodeOffsets:[[124402,32064]]}},{type:"Feature",id:"310107",properties:{name:"普陀区",cp:[121.3879,31.2602],childNum:1},geometry:{type:"Polygon",coordinates:["@@F@@FHDL@HFFAPFCSDC@@XGFDH@BDLHNACEFA@ERCIMJEDBAGL@@EHAFENHHJ\\ONQBQCIBC[MKACKI@GGGH@I_G@CW@[DMHCDIBMTDHN@JNHEH@FJFPKFACSBKHDJNABDMDECAFiDEDFDIPG@GLHCNH"],encodeOffsets:[[124248,32045]]}},{type:"Feature",id:"310104",properties:{name:"徐汇区",cp:[121.4333,31.1607],childNum:1},geometry:{type:"Polygon",coordinates:["@@RADL\\NCPHFfLJaJ@FWLGMGIK@IFMDOYYFOTSBI@IMSAMSACFIDNDCPWGGBHNET[CU\\QjOCERFBEHF@@HjJBJG@@J"],encodeOffsets:[[124327,31941]]}},{type:"Feature",id:"310105",properties:{name:"长宁区",cp:[121.3852,31.2115],childNum:1},geometry:{type:"Polygon",coordinates:["@@HFFB@HF@DCAELENSJADCNG\\CX@@D`H@JHGHHJ@BINBFUGEDO[MCKQB}AwQEBUIEDMTNF@hH@FXEDFJEJIB"],encodeOffsets:[[124250,31987]]}},{type:"Feature",id:"310108",properties:{name:"闸北区",cp:[121.4511,31.2794],childNum:1},geometry:{type:"Polygon",coordinates:["@@CSG@BQGODUPWTOBQAAFMECKBGEMFKEOHADDJARMR[PGI@TEJBNG@ADBFND@JL@@NFFCL@D\\@DG\\JJADI"],encodeOffsets:[[124385,32068]]}},{type:"Feature",id:"310109",properties:{name:"虹口区",cp:[121.4882,31.2788],childNum:1},geometry:{type:"Polygon",coordinates:["@@bA@E@QHSXBDIMI@OHCLI@GTWBIACQAYIOFGCENBBARSPOXCVHPARH@DT"],encodeOffsets:[[124385,32068]]}},{type:"Feature",id:"310101",properties:{name:"黄浦区",cp:[121.4868,31.219],childNum:1},geometry:{type:"Polygon",coordinates:["@@NEHFLAFDHDPEAMZUHQQ]IMKJG@EPERABHBGRUCCNGV"],encodeOffsets:[[124379,31992]]}},{type:"Feature",id:"310103",properties:{name:"卢湾区",cp:[121.4758,31.2074],childNum:1},geometry:{type:"Polygon",coordinates:["@@VDHQGABAFQFOH@LIiKKHEXI@IbAFZB"],encodeOffsets:[[124385,31974]]}},{type:"Feature",id:"310106",properties:{name:"静安区",cp:[121.4484,31.2286],childNum:1},geometry:{type:"Polygon",coordinates:["@@DLLB\\NPGLFHUDMYABEeKEVMAAJ"],encodeOffsets:[[124343,31979]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/shan_dong_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3706",properties:{name:"烟台市",cp:[120.7397,37.5128],childNum:9},geometry:{type:"Polygon",coordinates:["@@ŤLšLllVń²è°xżĢĠÆl҄šŤbœ„V¤ĊXnŽlĢVĊ„Òš„È°ĊŰÞè˜L„±@џn»VUźċ²»ÆkôVɆkĊŃ²kŤVVwUUVmUaƒ@KkU@ƒmUmmk@UwUkmW@UVIXa@ƒmw@a™KULƒaƒx@Uk@UbWU@yULmK¯@kXƒVUwm@@JUUknWKUVƒLUbU@™wWykIƒa@w@mUI@ašUVynIWa„k„@@W„bl@@knmƒK@wnIl™°Kna@V¥ğ@ġUķ»™¥@UōJƒX¯¤k@™wmI¯‚k@mwƒak@@šlX@bUJ@VƒbknWxkLkxlŽšLVlkLmŽšb@bU@ƒbU@VbU`Vb@n„L@Žmb—U@˜VnUVmnU@mm™@kIUWVIUK›VkkUJUnmL@VmLUaVWaXamU@™™U@KUUmVƒU—JƒU™VÇwğn™mƒ@mXĉV@l¯xnô"],encodeOffsets:[[122446,38042]]}},{type:"Feature",id:"3713",properties:{name:"临沂市",cp:[118.3118,35.2936],childNum:10},geometry:{type:"Polygon",coordinates:["@@˜bXlƒl@zlV@lXXmŽkbVVlš„U@Vn@@Vmb@XšKšVX„WJ@XXl@„‚ŽÈbVLšUl`„@XXV@VVUxVbUxVbš¦„@‚WnXVJ@bnVUzl@„°Æx„U„KlU@mUUnUlUVWVUnVV@XX°V@Všll@Vk„aXVl@Ux@bmbXLlKlb@b@bUJn@@„„b@n°x°K@an@@UlLVKVbXb@bVVnK°LVa@UVa@™Xw‚KVxnLšU°@naV@UWUkWƒULmV—wÝKUUla@aó_@mƒK@aUU@ƒWUkwVm@aVI°W„@@IUw@a±¯@¥kUVUm@a‚wkw™@ƒK@kVKk@maXalI@alL„WXblaVLVU„V@LnKš@„l@w˜aXašLlnUl„LšmV@n°J@_VmnIVym£UKmI@WnIVm@anUVmÇ_kġIÅWUXÇm@U@ݯÅ@ƒ™@naWƒ™IVW@IkK@klKn@naWIƒmk@ƒaƒbkKkLWn™WkLWmk_ƒ@UaVƒUKmLUw@mn£WwUmU™ƒaóV@UkUm@UKULUwmJUX@WW@XҙzVblJXŽWXk@UVWK—X‚¤UL@xU@ƒ@ƒVUaU@@XmVkLmWkXUyÝLmKXnVŽ@n@l™x@bWLnVVn™`knULmxUl„„WLXŽVb@VƒK@z¯x¯¼Wx™KUn@bk@ƒlƒVVVz"],encodeOffsets:[[120241,36119]]}},{type:"Feature",id:"3707",properties:{name:"潍坊市",cp:[119.0918,36.524],childNum:9},geometry:{type:"Polygon",coordinates:["@@l@@UšK@Ž@L@bX@@VlL@JƒLUVnX@`ÜXn`V²mJ@bU@@n„b@l°xnnĸVƚ°@„ƒĊ£Þ@lWnÑnkʶJmó°w@kk»V@»ƒ¥k@V@kw@wVm„a˜Å„mšaô£ŎƒXI@mln„Kla@mV_UKƒ@kUkw@alW™IU»™mƒ—@WUIl±UUÅU›bkJƒ@a@wUKUaVIÆmXIWaka@m@Ul£XKVw@ƒUIƒJUkmJ™ƒVkU@a„ƒWK—ImVƒ@UxmL@bX`WXU@U`ÇkUak@@°UblXk‚mLUKmL@VULóƒƒVk@@Vlbn@Ub@ċaUJUbƒIUlVLUVVbVKX„VlVXU@mb¯@™VmKUwLWx@šUb@VUb¯KmLUU@aWaUaULkK@Vm@@b¯L¯w@mƒa@ƒm@UUU@U¦lJUXƒVƒmkb@nm„XVWŽkb™IVxUV@VUbWLXVƒLW`Ux@nk@Vn@x@VkJ@œV`mXkŽ@V„xV@lVššI@VULš˜VU„IV`°bVXXx„V@VWVnL@xV„Ub"],encodeOffsets:[[121332,37840]]}},{type:"Feature",id:"3702",properties:{name:"青岛市",cp:[120.4651,36.3373],childNum:6},geometry:{type:"Polygon",coordinates:["@@„@nU˜JXLƒ„@blVU‚š„nIVl„IVJ@„UxWLk¤@V@nlbXbWJÅnUJVbVL@x@b„ŽlIœaÆVVVk²VJ@X„˜šnV¼šJkX@blxlV„@VLU`@nkbƒLkm@nWJō„ó¤™bƒn—ƃbUn@xlxU@l@„¦@¼UŽl¼ĊUnW„@šnĠmÈxšU„V˜I„VnUVV@LšV@šnVWbXb‚UVbnK@UnKVmVIllœUVLUJVXlJš@nnV@nmVUUm@—˜Vna@ƒK@mUaV_UaV@„aV@@a™anlKUk™KklwlKXwlm„a@UVI@akW@™l@„bnxl@°nJšxl@°£„WŎIUÑn»lašmô¹Ŏ¥VaUUkƒmkġWɱIUUŹ`›@kk@ĉƨřV¥_Ç@™Ĭƒ¤ÝL¯m¯£ƽóķwUW±ī¯kōaĉĕ™kğmó°ƒbW@UKkLUaƒVmz@V@ŽUxVn"],encodeOffsets:[[122389,36580]]}},{type:"Feature",id:"3717",properties:{name:"菏泽市",cp:[115.6201,35.2057],childNum:9},geometry:{type:"Polygon",coordinates:["@@@¥šIVUÈmÞ»@UlU@Un@VW@UVmkk@aVUUKVÝ@UVknK@UV@VVnIVƒ@wnƒmwmKXaWaXI@UV@Vy²blkVKkam™U@kb@Um@VmUkmƒKmkXKWwkU@Ulƒ@UnK@UVUUm‚KXwšUVL„w‚K„U„@@Wl@@wUkV¥—@@I@W@_V@VWUw@UUa@aƒaWa—@@_mKUw™l¯amzmV—@WK™nU@kƒWLķaUKbÝVmV@UWÇbÛ@ƒX™°UbW@XŽm„Vlk²UJUbmLÇxÅWUzl‚¯Ll„@VkK™XUbWJ@bU@¯@™ƒkbƒLmKka™„@l™_WšXºVbUz@J‚n²V@¤lX„Ž„nV°šLn`WbXLôVlKVUšxXn˜lXLlU@bVV@„XJWLUVnVV@„„@n‚l„°nn‚V„KÈbVXÆJU°VnXV„kV@@xVL„@šWlb"],encodeOffsets:[[118654,36726]]}},{type:"Feature",id:"3708",properties:{name:"济宁市",cp:[116.8286,35.3375],childNum:11},geometry:{type:"Polygon",coordinates:["@@nam_nKlVLXa„Il`š_@KVVXI@m@w‚ƒ„@@k@Kšnô@n`VbV@@L„L@KVVn@VX@‚VL„Jl„š@VUUƒU@Uam@Uk„wšKWaXamkJmIUVUÈblašUnV@kVKl@@lXL°kVJ@VÈnVJUX@V‚LXl@xVLnU‚@VK„V@a„IUaV@„bĊU„x„K‚kVJXUlV„ƒ„UVašI@WUI@KlUnw„mWk@WXIWƒ™U™L@Wna@Um@@UƒVk™UUlanWW@kkU@y„kWk—aWVUlÝbUU@kƒJUIU@@ƒ™JmaókƒLKǃUUkKWLk@WbkUUaƒbmKn¯°¥V@XwV@VanaVaU_@Wlk@WÈ@VUÈVVۂm„aklKȯlLVUX@lK@aX@@kV@VmV@VwnJV_UWUwƒX™am@kW@wVUkKVIUUVmU@UV@IVK@aUL@aƒV@Lm„UKmx@ŽômLkUWJ@šnXmlUxUL@Vkn›VUšU„@V™L™`Ub±LkV@kUKÇbÛ@ƒU™Wó_mJƒ@Wk@@Xƒ@ƒVLƒxUK™VWxLVnUV@VmL@Vk„@VlVXxWLnl‚Ln„VlUnn@@VlaV@nšlbULkl±aUzU@@VWJXbWbnLnxm„@xU„mJUUU@@VmLUl@VUÞVLUV@bllUn@VUXm@@VkV@VݼÇnUV™J@¦nnƒlnVlL@„Þb°KVV"],encodeOffsets:[[118834,36844]]}},{type:"Feature",id:"3714",properties:{name:"德州市",cp:[116.6858,37.2107],childNum:11},geometry:{type:"Polygon",coordinates:["@@„¤@VmbVXnVVbVJššX@Žll@z„lVInl@„@bVxUbĠ‚l@Èbla„IšxXVWb@L™@n‚ULWVXXšWWLnL@`@LUVVL@lVn„JšU@UUk‚a„™nš‚Vôô„b°¼V‚ސXš˜‚œIÜbČa˜bôW„XÞWÈzÆmnLVJ°ÈnlV²lbnW@™@UƒUV™šmnwmkkKWƒkla@mVIUKUa™aUwmn™JU@@amIk@@bVlkX@mmUklUUƒƒa@_UaUUƒV@wƒw™WkXmW@I@WUaÝU@UXaWUU@UUVW@UUUWUn¥nUVa@m@k@alU@wk™LWa@UUm@@wnmU™wla@anKn_@alK@ݙ_ƒ@@WUUUmlkaƒIƒyU@UwU_Wa¯yU_mWUwkImm@InWWUk@@UVWV—kW¯U@VƒL@b¯b@l±¦@šVV@lUbV„@škxVnUšl¼XV@b@lV@nIWxnbƒ‚™@UU™LƒxÅxm¯ƒaUƒ™wU@mUÅVÝKULm@bmKUXó@"],encodeOffsets:[[118542,37801]]}},{type:"Feature",id:"3716",properties:{name:"滨州市",cp:[117.8174,37.4963],childNum:7},geometry:{type:"Polygon",coordinates:["@@Vb@`„bV„kVlnV@nlWUk@al@nJ@bV@šInmVxšbVbVLUJ@nkb‚lX„lLnlmx™nUš„V@V@šmXn˜lbĸ@nnVx‚b@lnXV@UJ@nVxšxnxVbÆVn¯ƒĕ‚@@wÈçUÇlķVIœb‚@„Çmk@¥k@UkUK@aWakUóJW_UW@wkkWK@U@Kš@XUƒƒUkmUUalKXala@U@kkWlkÈl@kšV„mVIVmU_‚a„ƒƒwnwVW@wƒwUƒ@wU£ƒwkJWIyUI±bk‚VUJ@nmV™Ukl„Xmx@lnbW„kVƒUkLWŽƒxkKUUmUkb™J±—LÇxUKmkUmkkW™™a„mUaVkšJÆ_²KĠ@U„W@w„U‚¥nUWwK@aÝUkÅVaVK@akLWƒƒƒ¯I@bnbVx¯JW„ñšWbUL@šƒŽnV@VmbkUUV@IÇak@@bWak@WJUœJWL@bXV@„‚@„V„Jlb@zUlUŽUImšnbV‚mz@°UV@V™bV@@V@L@xLmKUnmJVX„J@VkLW@UVUL@b"],encodeOffsets:[[120083,38442]]}},{type:"Feature",id:"3715",properties:{name:"聊城市",cp:[115.9167,36.4032],childNum:8},geometry:{type:"Polygon",coordinates:["@@ô@VWnL‚an@VKÞLÆUnVV@šxV„„bn°Æw„wšKVVš@„maXwmJU@@k@aWUk»V™Umlw@™UƒVa@kUU@™²¥@k°a@a„K@U›ƒU@mmm@ów—ѱ¥¯@@w™Kmw—I›¥kU¯UmakJmIUaƒVkKUkm@VUUa™Uƒ@UaƒKUK¯@™w™UVŽUIUKVw™k™¥™wƒbVŽ@xn„@lWnXxlL@`„XlJX¦l°XxW¦@¦Ul™n@Ž™@@Um@@VXVmx@¯bllUnUJ@VULVn@b„xV‚VL@b„„VlnVVblV„ÈnVlIVJœLô„lJ@xl²„"],encodeOffsets:[[118542,37801]]}},{type:"Feature",id:"3705",properties:{name:"东营市",cp:[118.7073,37.5513],childNum:5},geometry:{type:"Polygon",coordinates:["@@ͬUǪlô@°Uœw°ōĠ¯š»Ģ炻XÇ@w™wƑa™ÇƒkwVƑ¯@řķUmm¯w@kƒa@mV@@anIU±m_ÛW@_mWVU„K@IkK@UW@@a@K@™L@Vk@±U@UV@lm@mUU@kLm„„xV¤@xV„„x@xUXmx„xƒ„bV`UnUJƒn™U@lÇkkllX@l@VkbWbkLVbnVVl„„WV™@@L@VXLll@xVXX`ôIlVXb@bVLVll@@¦nlƒÈ@›aUJkĸVÈÇè@x"],encodeOffsets:[[121005,39066]]}},{type:"Feature",id:"3701",properties:{name:"济南市",cp:[117.1582,36.8701],childNum:5},geometry:{type:"Polygon",coordinates:["@@²¦˜Òôxn@nn‚@V‚œ„°VlXU˜UX@Vl@XVmX@JnnlJVxnXV`°zXbV`VxV@„z„JlbkŽVnVV@X„@š`@ÞkL@bm`mL@bkbšxnVm@xn@VV‚@XbšKl@xkV@b@l@nUbmVm¦XVVV@VUXVVV@XVWb@VÞVVb@X@JnXlWšX„x@x„UVV@aVKVUX@lK@UƒIUWnIVmnL‚K@w@K@UU@ša@UVU@¯nyUman™VJVVk@ykaƒIƒU@@ƒWU@aXK‚IV›XIl@Xb@al@Èb@JVUlVna@UmU„@™VKXaò™Xƒ°IUwma@aU@UU@wVW@фw@a™I±`kbƒUkw™UmJ@UkmÇUUkmKknUVƒ@mJUkaWkƒa@KmKkUƒLmyXa¯_@WmImmbƒLmUkVUbUVƒJ™bƒUkkWJkUƒl™IUm™k™Lƒ›„lK@knaVmkI@mWaƒLUK™UU@@VmLUVLWK@UUUƒWUkkVmx@„Vl™¦"],encodeOffsets:[[119014,37041]]}},{type:"Feature",id:"3709",properties:{name:"泰安市",cp:[117.0264,36.0516],childNum:5},geometry:{type:"Polygon",coordinates:["@@n¼šŽW„nxšL@x°@š¥Uk@ƒnwlUVl„XVV@VXL‚KVUnK@UV@šVVL„KXb@nlJUnmb@lkLƒ‚„œšKšlVnšJ„klVXIll„Vša„IVUValUnV„K‚annnJ@X°`Wbnz„KlVnL‚Ž@L„bXl‚bVlnI„@VUU@UmVƒ@U@Uš¥@VmV@@_Ua@m°@@ƒ„kmUUm@UVmn@nX‚@@a„anJVUVL„mlIVJn@nkVLVa@KVmVLXVVLš@@U°bn@VaV@@K@aVkœbWaXUVymU@aUImWXƒ@™¥UaVwUaVwUUU@WWƒ@k_™VUKÇa@ƒƒnmxkV@LVJ@X™JUbƒVƒ„kUWVUIlƒLƒwĉVƒaU@VbƒJ@bƒUUL@mVUK@wWkK@UVWUIÇm@UUI¯lWK@kk@UL@lmU™VkbÇaUVVnJlIn‚WbXb™LƒxVln@VbV@V„UV™@kƒƒIUK@UWm@UU@LƒK@KU@Uam_ó@™m@L@lƒ@„@x@nWJUU@L™`k_ƒJWbUKkmLn`mb"],encodeOffsets:[[118834,36844]]}},{type:"Feature",id:"3710",properties:{name:"威海市",cp:[121.9482,37.1393],childNum:4},geometry:{type:"Polygon",coordinates:["@@VbUnVVUxĊ¼š¼ô@Þф¯‚WǬLŎUÆW„¹Uǃō¯ÑƒÝkţ™™ţóġ™óL™ł̥U™wm¥kÝmkkKóbÝ@U¦@‚mb¯LkšmJ@x„Lmn@lk@ƒa@Xƒ@ƒlXbmJUz™V@bVJ@n@x„blJXzšxV@Va„KVUXLlmVV@In@Vx„UlW°@nLVK@zXVVal@@V„w„bVKšL@bnx@„WbUJ@VnXVlVxl@nnnV@„lV@L„‚"],encodeOffsets:[[124842,38312]]}},{type:"Feature",id:"3711",properties:{name:"日照市",cp:[119.2786,35.5023],childNum:3},geometry:{type:"Polygon",coordinates:["@@UaVUUKVk„JVaVIČb@Vam@ka@Ul@„Uô„VK@UnKVLnKlkWVa@¯l@VbÈlV_V@XWW_@anKVwUmVw@@Uny„UVblKVLX@„aô¯ó¥mÛĊÿÈ¥š™Þ¹lUīƒ¯Kĉ¼ʟbÇV™U™ŽUŽ™XmakJUnmV@bUnmJ@XnJVLn¤UzmJUn@`¯ImŽU@™nƒKVkkm™KWb—b@xƒk™@mL@KƒUUVUKkbWaƒXkK@bkJWbnbl@UL@l„Lš@lxx@b‚nUVlV@¦²°@bVx@Jƒ@¯XUJ@bUnlxVŽ„X@‚VV@b„L@nô`@bkbVVÞL˜xnU"],encodeOffsets:[[121883,36895]]}},{type:"Feature",id:"3703",properties:{name:"淄博市",cp:[118.0371,36.6064],childNum:4},geometry:{type:"Polygon",coordinates:["@@nƒlKV@nVn@@kVU‚@²VVaUƒ@wmKXU@UƒUWwUW¯aU_ƒJUV™—VK@U™JU™@kUƒw@UlnWU_@›lI@U@wUml@@mVwX_„KWUXKVa@UVUUwšJlaXWUnƒ@mla„n„UVWkIV¥V@VVVI@a@akakLWKna@aVwk@WUƒbUlk@™k@U¯UWWU@mUUVUXkVmVVV@nkVƒLƒVÅwƒ¯k@WVXb›aUl@bV@@b@xkVVXVxkJ@nk@@ŽVLUlVb‚VXUVVUzV‚™LVbUbV„VWVkLmškJ@n±@UxU„VVkV@bƒx@ÒUX@xVVV@°J„„X„lK@bULUblÆÞV@b‚LXxmV¦ƒV@xƒXVŽğ@±LÅ`™IUlVbƒnšbXšllVnnlVLÈw˜K²ŽšIlanVVVlL„wXlK„VlUXƒma@knwƒWlkšVnU@mVIUl²aVJ‚zXJlI"],encodeOffsets:[[121129,37891]]}},{type:"Feature",id:"3704",properties:{name:"枣庄市",cp:[117.323,34.8926],childNum:2},geometry:{type:"Polygon",coordinates:["@@‚yUU„U„kl@@aVmšLXw°»°w@y„L@UUaWXKƒƒVknwVKlmš_UmmUXK@ašw@k@mUWmUL@ƒ@™@£@KƒbÝV@akw™aULmƒƒbUK™LUU@lm@—°mL@nUJVxVXU`mIUxU@UnU@@lW@@bkLW@UVkKÇ°kLlŽƒbnUÜÇUUVÇ@@Xkl@XV`UbmbUbU@WxU@¯¦m°nL„aVblVXal@XKlLVVȄ‚L„KôlnbšI@„V@VJ„I@lVVÞaVkXU"],encodeOffsets:[[120241,36119]]}},{type:"Feature",id:"3712",properties:{name:"莱芜市",cp:[117.6526,36.2714],childNum:1},geometry:{type:"Polygon",coordinates:["@@lmnLVlÈVln@VnIšVlx„Vla²_šJlUUUVƒVw²@@mlIn™lKXU‚UUƒVaUašKUVyUUWVUUaVkUK@l@@mlIUwUWlU@w@aU@@LU@Ubm@¯a@V™@UKWUUKUn@LUbUKmlm@UIkJƒnUKUVmIƒb@b@mWm@Un@VVnnVƒl@„¯@@nVb@`U@Un@Ž™¦@V@VU„VnV@"],encodeOffsets:[[120173,37334]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/shan_xi_1_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"6108",properties:{name:"榆林市",cp:[109.8743,38.205],childNum:12},geometry:{type:"Polygon",coordinates:["@@™ýVƒnIW»ƒW@»kUÇL—݃U¯¥ÇIUWWїUWwX¯mƒ@»n@ÜÈķô™@a±kȱƒw„ÑmwçċmU»ÆkkVyIm™ĉÿ@ƒÝ¹ƒWnwÇVš™Åaƒzmmĉ¦ó™kVmx™xU¼VškVm_UlVlk„°IV‚kmJa›¦k™™LmmV@XmKnšlUô›VXbƒbƒ@UaÇLğܙ™Åwƒ£mKnmċwÅ@UkƒbmaVƒƒƒn@m¯aU™Jm_k˜@kWXyl@@kÅamw™LU™Þ™ƒ™mWÅzUKƒš™Uk±@™b@nnK‚bX¤mzVšŽVxÇn„‚¯„@ÒknWƒƒVUbkķÈÑWkk@Va™™U@„mUkbƒÝÅ@Ý¥ÇbkĬ™XV`kLǍVmalUUa™nV±nwmkƒJ@Inƒ°KVw¯UnÅ@¥™ƒ™U±bUU˜±œmWbÛKWnUm`UƒVK@bmnœm‚Èż@V„L@xƒxmš„Ť°nŽ@VmK™²VlšlKk„ô@„êÜV@VXLlmš¦UššV°Ș¯²ÿ@¥š@ƁĊ˜²IšmĶnnb°b„KVƒĸLl„Þ@UȮš™Ü°IVƒÞÝސlŽœx@ŽķĀWŽ„Ux„èƐ@š°ŽXnšlĊĖ°m„nƒšV„²V°ÒƦ„aބ„˜@zll@bÞĀšlš¼nKĊ¼óȂb²±šIǪÒ¯ĖV@„lxnVlk„JlaXwŌĉ„„@VnŽššlÆĕ„UÆLœèŌŤôxȚlUœ@šxlaUċĕXm„IWmnkšVVƒ„VW_@aÈWUUmk@ƒ¯çVm»™±W¯n¥V™mkXw±ÇVwƒ"],encodeOffsets:[[113592,39645]]}},{type:"Feature",id:"6106",properties:{name:"延安市",cp:[109.1052,36.4252],childNum:13},geometry:{type:"Polygon",coordinates:["@@@kkÇmIšmUwVkUƒƒU²WmšVkm@m`mIĢĕUƒVa@™mXƒƒÿVVkyUýšĕ@l_UmnƒW„KVkţ™™¥™aƒwğ@™@aôƒ„ƒWa„kUmƒa¯¯™a±£kx™mmxUwÝ@xmU™b¯K™wó„Ý@kmm¹Ub@lklVbmnnVUV@x›UknƧJUX@ŽƒLÇWkw™LķƧÅwWJk„ƒLkþĉxWz™JUnǚkš@Ɛk¼ÜÔÈKšè@°lșÆk¦l„n@l¼@l¯L™°UU™VÇ°ƒ¹—`m¼mXk‚™bUaƒV@U¯x@¦™Ç™„UUmlmUVm„nnmlkw™@@šƒ¦Å‚ÇLmx¯Iklš„@¦mÆ°VUx¯Lm„@J„InlmxU²šmVbkV‚bUnȎlKU_šWlīÈaÞ¦Æ@„ÞlanV@ƒšVšUbl@XlÇÒĸlŽVa„UX„lm@Ñ°ƒƒÈmUw‚U™nyW£amL@mša²@lšV„™VLÆynX„šÝšVššKnxÆb@lk@WzXŽ@ll—n`šIV‚°b@n„m„„‚Unb„aVlÆ@ČxmnnL„¤ÆxššĠÛÈKVb„@„aWaœU‚ókVm™nL@W‚UnnšKlšœ¥‚bnIlU¯JlƒUkVkn`lUU™V»šwnwlUôšĊ¥nn„yÆb"],encodeOffsets:[[113074,37862]]}},{type:"Feature",id:"6107",properties:{name:"汉中市",cp:[106.886,33.0139],childNum:11},geometry:{type:"Polygon",coordinates:["@@lKnb@n„lWb°bkxĸwVb@ł„nlŽ„ƒĊ¥šL@XŽl™ÈƒVblÈK‚b„akVwôml²`‚nœ@‚nVKœl˜k²xŎƒ°¦VU„JĊw@çnWçރVkUóÛ@¥kwš™šUmƒX¯WšÑkƒ@UymIUwlUn¥‚mUk²a°¯V»@™ÝVș„ÝċÅÅVl»@l@a°±@_kammÅb™a@ƒƒm@ż™KknõĠ—@mšƒ„¯LÅw›‚—LVxmb@¼kV™@mw¯wVakKW»X±¼¯Vkxƒb„¼WŽ@nx@x±bóakbƒ@ÝmU™@ķÓÛL™kƒVUm™k¯¤ÝLUlÝ@Ýz™š„x@x™°™™™bƒmƒX¯aUJW¯—k@bÇWƒwÛwWxƒ@XWlb@Žƒ„VŽÈUlwšLnl°VlUô¦œU°¤VšUxVXUxlbkVVlƒI„°„ÅVlU°m@k„ÇU¯xUlƒLUlVL@b™°ĠInĠ°ÈnK‚„@xÞa²n‚aUyšXUKVkšWô¼Èa‚z°JXUVÇV_„JVƒšz@Žnb"],encodeOffsets:[[109137,34392]]}},{type:"Feature",id:"6109",properties:{name:"安康市",cp:[109.1162,32.7722],childNum:10},geometry:{type:"Polygon",coordinates:["@@„bĊaƨèšwôô„¼šb°ašXVƒÞVUÞ@‚aXƒm¥kImx¯¯ƒV@anU@UÇéğL@ƒ¯¥V£mƒ@ÝÈb„K‚™„X°wČÿ˜ƒ„b@xÈblxȯĊ„„mÆUVƒ„nÈ@ƨÜLĢ¥ƒŹnƒ°Vnn˜K„aô_ȃšwU‚aXmnW‚¯kl›LXƒÇ™ō¦ÝaÅVmbğUn¥±wÅéVƒan¥ƒ„U„»°am¥„£ƒÝ@ƒ„wVw™¥nU„уUmmVwmķIÅaóVWxkblb@ból@œğÒĉ¤ċXƒ˜¯X™xk„Ç@óÆÅx@š™xķ_kmݎǣkblb@`¯²@bk‚‚@k¼ÆUČƃÞǚÞU@šU¼¯°±bVlnm¦kVVxnJVz@‚l„™ÒXW°n„™V™šlx@¦ôÜVUl݄Xèm@è"],encodeOffsets:[[110644,34521]]}},{type:"Feature",id:"6110",properties:{name:"商洛市",cp:[109.8083,33.761],childNum:7},geometry:{type:"Polygon",coordinates:["@@²nl‚ôbš„°aVwnKÞIš`°wšXôw°VĊ°@ŽÅš„ÞÆV„zÞK@xšŽ@a‚LŚ@b@ŽnLlƒ@šln„mnLVw„a„bVƒ‚VnbU¼„Vƒ°„bl„šbÈ@ĶŦb˜@nÇ@amIyUI@ĠVmôƒU™ƒVwkwlanJ„¯lwó¥@an°Jš_„‚@š™nóƒó@£l¥UwmašÑ@ƒUm±V_ƒJ—£›J—UW¥¯@ƒ_k¯¼mUƒVUè¯b@wmL™»ğVmağI¯¤ċIUW™XƒKĵ¦ķaƒJUb™IƒlUóVmk@WÅÅÇ@ƒmU„ÅVƒnĉƒÇ°kwÇa@wƒa—„ċĀ¯xƒWšƒLÇa@Þn„U¤°¦@„ĠKÈê@VmV@b„U°°nwlJn¦W„bÝ@VŽ"],encodeOffsets:[[111454,34628]]}},{type:"Feature",id:"6103",properties:{name:"宝鸡市",cp:[107.1826,34.3433],childNum:10},geometry:{type:"Polygon",coordinates:["@@@ƒ„£@›°Išb@¯°ynŹƒaUƒlƒU£„Umšĵĉ@@ylUÞ@@£kWU¯WaU£¯ÇV¥ƒ@kb¯wƒn™¥ÇkUÇnUƒ@¯±›kULm›@m±_kŽónUxlŽƒbaÇLkŽUaDŽkšW@™Kĉ¦ƒ„kƒm@ŁUaķxlw¯aXaƒk@mmakL@šmšÛŽ@¼m„@l„XV`ƒn™KUš°°@²š¤UÈ@VxmôƒxKl„VV²aVw„Xla„Vlx@UVnŽÇnk°ƒVVL™lkI™šƒJÇk¯V@šknƘn@lznmlVkzVŽ„VVxš@Ux„z@x±¼VxxU„l‚kb˜@„¼Čk˜VXlĠkôV²w‚LUKlwœJ@a‚IV¥Þƒn¯Ün„‚„@nk˜l²kÆ@š°„aVbnI@™š‚Ťn"],encodeOffsets:[[110408,35815]]}},{type:"Feature",id:"6105",properties:{name:"渭南市",cp:[109.7864,35.0299],childNum:11},geometry:{type:"Polygon",coordinates:["@@@ÈôL„xUŽ°„Þ@mŽÈnl¤nUôL‚wX`@ÞÝL™ŽUšmLô„„ŽôbVbnºlnÞ@ôƒšx°LšanV‚wÞ@Vxnwšnlw²¤šb°°„bVnƒlXbƒ„ó„@bš‚Ġ@„xšbš¦ŤšV™Xġ„£W¥ƽɽƒó@ýóƝÝ»„£X™mƅšĊkUƒ„@™™šó„kťaĵŽÇ@™akƒƒa„¯ƒUV»maUU„ƒaƒbUxmKƒnkm@™k„mK@ƒxó@¯n¯KǦ@ôÅèlxkx°nƒƾ¯KU¯WķL@VÝIUb™yWbX¼Ç°"],encodeOffsets:[[111589,35657]]}},{type:"Feature",id:"6104",properties:{name:"咸阳市",cp:[108.4131,34.8706],childNum:14},geometry:{type:"Polygon",coordinates:["@@šIXyĊwlý„KlƒXIVaķƒ™»a›£„¯aVU@a™‚wÈō‚ašL²»‚VœUln°WȯW»XašzVaÞJ@Uƒ»@¯Ýbğwly@£kÑţ±Wу@ka™IUƒƒnƒ@¯ƒómţU™b™U¯lÇIÝb@¤Ý@kV@zĊ@™ĶnƒVV¤k„V„„bmź¯z@°™a¯J@œƒ¤@„„bUx™bƒ„@`™xUÔ±ºVXœW‚„UnUJ‚LĢ¯ÈKlblmÈXŎ°šU„°LšŽlkÞKš@Èxl_°ĶUÒkblš"],encodeOffsets:[[111229,36394]]}},{type:"Feature",id:"6101",properties:{name:"西安市",cp:[109.1162,34.2004],childNum:5},geometry:{type:"Polygon",coordinates:["@@°²@‚„mVVÈÈlš¦„m°xla„@U¦°ÈV¤XbV°lXÞaÈJ°kšVšaŤVôn°„„@„mV„šJlb„@XÒŤ²lÒ@¤kzĠxÞa@°„¼ĸK°XV‚°L„ƽ¯mlwkwÆç@óÈ¥°L°mô@„w@aƙK@b™@wÝLƒyÅUƒÝƙ@ĉ¯¯Uóx™W¯x™_ÝJmLUx¯b™ƒóak±mÝUU„™W¯b™aƒ»óó™xƧçĉbƒaĉxƒIUV¯¥ō„±w—l"],encodeOffsets:[[110206,34532]]}},{type:"Feature",id:"6102",properties:{name:"铜川市",cp:[109.0393,35.1947],childNum:2},geometry:{type:"Polygon",coordinates:["@@ÆxĸƨšKlxÈX„K@VWƨIlmœV@wVUmUnmUalk@kVaUaóaƒóƒnKV™šÞK@ÝW_xóKmVk£ÇmnÝ@¯ƒVƒwóK@ǯXkm›VU±¼™KbÇŎx‚š@bUV°bƒœ¤‚bš¼ĸ„Ub"],encodeOffsets:[[111477,36192]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/shan_xi_2_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"1409",properties:{name:"忻州市",cp:[112.4561,38.8971],childNum:14},geometry:{type:"Polygon",coordinates:["@@Vx@lnbn¦WlnnUšmš°š²VšV‚VVVnUn„ºlz@l„„@Jƒ@kXWVXl@Lƒa@„ƒKUL„ŽlbnKlLnK‚LnKÆXn°šbVV@bUVl°Un@LnaVJUbW@UX²l‚@ČwlVVIšWnkÆa°„„anV‚Kn°™UW¯@™aVUVk@Un@„aV@ValwUanmWU„k@WVUUanaVwnLVl°@nk@mVU@UVK@w„LVKVU@ƒ„K@UUKVUV@@bnL„a‚V„aôšlIXmlKX_°KVV@bVV„@šzV`kblI„V„Ul‚šL@bnV@V„Ċll„„VlIXW@k„a‚U²blKšVnIlJ„albXXlWVn°JnšnL@l@XlJlaX@„X˜W²@l_VmnKšU„blU@mnkVK„¯@U@ƒma@kX¥VƒmakkƒLƒa@aƒ@WIUUVXWWnk@a°a@kkm@kUUmJm@WUUUIk`m@V—kaWWkX™KmƒXk¯ƒ@WKƒLkak@±bƒw@ƒaƒa@akaƒ@ma¯@ƒL—KÇÅkKWbkmġ™±ÅUƒLUK™VVkƒm¯LUVVbƒ„UwUW¯bm„ƒULƒxWJ—@ƒklmkUm@@KnwVkVK@akwƒ@@a¯bƒKkn›VUI™b¯mmbk@UbmKUL@xUUƒ@klmLUŽlVXI‚VVVUVUœU`mLXVWbXnW`Ų°xmŽxU@mĉƒƒwU@mbU@UƒmbkVW¦kJ™@ƒX@`¯Im@UlUVVnb@bWJXnmbƒJUU™UUaƒ@UamIkaƒxƒ@@x@b"],encodeOffsets:[[113614,39657]]}},{type:"Feature",id:"1411",properties:{name:"吕梁市",cp:[111.3574,37.7325],childNum:13},geometry:{type:"Polygon",coordinates:["@@@a@w„@„wlbnJVb„@VbšVVV„InaWmXI@a‚aUmVUVkn@°J@_„Wš@lIX¥lUnaV„V@naV@„xĊ„n‚V@‚wn¯wƱX_WmXaWUnKV_V›VUUUUWJkUVnKlk¯™@@kmKUaŁ±KkU@WmI@WUIlUUmVwXƒ‚w@ƒUlUVwœV‚@„Lnb‚W@anU@UšaVkô@l»n@na˜JnUÈLVaƃUUVm„VKVƒ²L@mU_lK@UVWkU‚a@a@U¯aUaƒÑóÑUb™„ƒKk@@aƒk¯mVaUwVƒÑkWUmK@UUKmXUWÝwUa™LUU@aWJUUU@Ua݄U@WL@VKVaVI@WnU@alIVKƒƒ@kIƒmIkJ@™m@ƒ™@@_™K@xƒ@kaW@U„@Vmn@ŽUK@mIƒJUXV¤XXWlkKƒkkK@XmJVakImJU@ó™¯LWKUV@nUVƒLkxmKkLma@kXKmmƒLƒab™LmK@V@mXVÆUxƒX@`nL„aV@@VmLUVnLlLš˜„b@„šŽ°²nx@b‚VUxlb@V¯bUV@zV‚XVĊXVx@lVn@VnnmŽUš@LlJXVƒz¯VWVXbšV@bmn™VUVk„Çþń@XVxmbUlV„Uln„W„@„Xl‚@VLXÒ@bÞJ°¦„L˜ò„@nU‚b@°„X@ŽXbmVU„V„nb@x‚x"],encodeOffsets:[[113614,39657]]}},{type:"Feature",id:"1410",properties:{name:"临汾市",cp:[111.4783,36.1615],childNum:17},geometry:{type:"Polygon",coordinates:["@@nW‚@@UnLšK‚a„b„KnnWL@lnblKnLlw„KVU@mVUXL°KôšV@nIlJUbnI@WlL„llLXkWWU£VW„InJ‚@VL@nm@UVƒX@lb„@@wšL@`‚@„šn@V@lw„@n„VmVX„WmwnUlƒœa@_lK„wVlUn°xVKVXXWlUšVVI@K@K„n°KœwlVlU@kna@V_„Wn‚m„UVm@kXml_@m„LlKXw°m@_ôJVUV@X™l@UaV@Va°I„lk»VwUkVmwUmmVn@V¯@KƒU—wmK@U¯wUVÝ@mJƒU—nWK™@@UnKVa„_lykUmKÛnm@™x@ƒUUlwVk™ƒXW@ƒa@Uƒ@@K@ƒkIV™nammVakUlƒ@wX@@kƒ™¯@ƒVVbml@„„°UbULmlVbnbÅK±VƒKVXUJWa@ULWaUU@@U@aWK@UkxUKƒLUUUJ±UkL@V±kk@kam@UV@l@LWl@n@VVUx„LlUUx@VUV™U@aƒIUl™L@°mLU‚ƒbkUUaWUUaUU@aWK—LWJ@bUL@VUVVbU@m@a@kmKmnĉlUK™XƒWUblb—xmIkƒƒU@xWb@lkšVx™LXŽmzVV@bklVVUzm˜@bk„@Vx@xlŽU„@lUbVnl@„Wxnl@n@ŽUbV„mL‚mƒb@`X@lUX@@xlnkLWaUJnnWV™Vn@l„@bULVV@l™V@XnJVX"],encodeOffsets:[[113063,37784]]}},{type:"Feature",id:"1407",properties:{name:"晋中市",cp:[112.7747,37.37],childNum:11},geometry:{type:"Polygon",coordinates:["@@@šlInJ„lJ„@‚„ULkJ@bmV@XUJUb‚L@UXKV@ރVbV@VVXI@bVVšKVbÞxVXnWVL@VnLV‚lX„ÒUŽVxUb°n„l@bl@„LšƒVaô҄ÒVb°b@VnLnnV@lmn@lb„U„V@„‚JœUVV‚Xkl@lUzmJ@xšXkl‚bUn„JVšUb„nU‚lb„V@nlLX@lakšV`Ub°š@XVJnU‚L²KlxnI@KV@lbUbVV„KnVl@„zlm@Uš@nŽšI@WUaVl@@mVU„@XkW@ƒnkVKVƒ„_Vw„y@knwVa‚@XalU„@šVnml@„X@V„L‚KVaÞbnnlJšI„mVKn„VVVInVlU„@„m@™mXK@UmyUI@mWUUakamw@wUwmLkakwVƒmK™w@wUam£y@am_ƒW@™UU@knmm„amU@WUa@knw@ƒUUUUV@nƒJm@mVUkKVUUUkKmwƒKULƒKUImV@lUn™nŽm@mbUK@°™bUnmbUmkkƒWUb@am@UXkK@a±@™V™@ĉř„V‚UXVxUVkLWl¯@@bULUlm@@nm`—XƒlWakIkm›VUbUL@Vm@kIƒ@@Kšm@—VaX‚I@W@aU@kUƒVU_™KƒbƒJkkǎ™b@nkKmL™wÅW@kVUUƒVU@WUIƒJmIXmma@_kyVaUUlkUm@ƒkU›x¯Lƒm@L@LUJ™UkVWXUWUL¯wVmUkƒxkL@`›bk„mVnxƒXUWUnmƒƒ@kxU@"],encodeOffsets:[[114087,37682]]}},{type:"Feature",id:"1408",properties:{name:"运城市",cp:[111.1487,35.2002],childNum:13},geometry:{type:"Polygon",coordinates:["@@„Vl„nJ˜wkaVa„XšWVLĊknmnL‚l@@bn‚V@UaVU@UVK@aXI˜KXL@bVVVbXVVblV„aVnK@¯šKVk„J@bšVVU@UVwkVƒKVwUUm@@Xk@K@kVUn@lbl@²l@UlK²VVIVV„KVLlw@VXL@b@VV@VŽXbVK‚@XbVIUW„L‚U²ÆLmaUankVKVaƒ¯@ƒnkUa„U°@„š‚n@@kWa„UVaXUW@IXKVw@U™ƒ„™WU@W@@UUƒU@mn@ƒ`m@UUULkUmJ™IUƒ@@UƒK@U@›anƒ™ak_@wmKUwmakV™kmK™V™k¯b™wƒ`kwUIÇx¯»ÇaŃmn@@™mƒmUkV@wkKW@kxmL™UkĉLÝk™xÝw¯lóVU„mV@ĀVVX¦W¤kz@`Vx°„²ĸ‚š@„Ul@x„êĸNJ°¤V„VlXLWnXxmV@nUl@„"],encodeOffsets:[[113232,36597]]}},{type:"Feature",id:"1402",properties:{name:"大同市",cp:[113.7854,39.8035],childNum:8},geometry:{type:"Polygon",coordinates:["@@²£šyl@Ȑ˜Ė@bĸŽĢbĸ„˜X„a‚KŤnn@ŎôllÈx„nVnÞDŽV@b‚nXllL°KšbVb@J@b—„‚„@ŽU„„xlKXLlKlXk„@Ulk„JlkUƒVKXUƒÇVIVm@_nǚLšašl‚w„VnU@UUwma@aƒaÝaLmUk@@Wƒ@U@@X™wVWÝUUUk@@VmLƒKV»nwUw™aUL@`mzƒJUIVƒUaUw™KUaVIlJôanÑlLVUn@ša„@VV„@@UUwVK°Vn_lJÆLœéW@UUUÅ@»lm@aÞIVwXW˜UUkkm@U@aƒU@mwU£VWU_kWmƒXwW_°yUkkK@UÇK@kkUVymóK—U@KWIƒbUak@mJ@bkbmLkŽ™UmƒkVU„W¦@lnb@„@Vƒ°ULml@nkVƒa™VmLUnk`±@—XƒWW@kbǦXŽ¯„WxI@xmbmxXlWV„„@bŎUz@J‚b@bÞb™ŽU@Wbk@ƒxk@WX¯VۙƒWÝbÝUkVUU@alI@a@akLWa™m@U¯UUmÇL@K@aU@¯VUkƒKmX@`@œkJ@nV‚Ub@lbVÆXVW„ULU`VbkLUV@XWl@bXJ˜@VbV@Vl"],encodeOffsets:[[115335,41209]]}},{type:"Feature",id:"1404",properties:{name:"长治市",cp:[112.8625,36.4746],childNum:12},geometry:{type:"Polygon",coordinates:["@@Uk™Lky@I‚JVa@mÞaWšy@_W@_WƒXVlUVwš@nw°K@m„UƒVaƒmVkU@mmmnLVUmKXa™U@IlKVUnK@UmWkX@WV_Vƒ@akU@a„KWIXyƒIUVmUn™Ua@WaXUVKVmkUWVkUƒLU@@VƒbƒKbƒIUmƒ@mbVL—x›WUUkn±V¯wƒbÅJUbmLkbmKÅKƒbVnUbƒV™KUb™KUbmLKmƒb™aƒKkUm@UŽnn‚VnxUVlUxl¼ƒk¯JUbU@Vbk@WšU@UVóI@`¯nWxkLƒK@nk`Wn@lUnƒVnm‚ƒXU`@mb@lkV@„VnklVVUblz@`nbWnnJ„IVJ@XUVV„UV@lÆXšxnKlL@mšaȍll„I„ašLV`„UlVV@@b@XJWUb@˜™n@L„@lJn@@UVKVaœUlnlJXb„k˜Wn_@mn@VkVK@a°@XklKVUUwVWUšƒĊƚ@šU²@@blLVWn@@bVa„XllVnnaVmša@¯VLnan@‚šmVm@knUVJ"],encodeOffsets:[[116269,37637]]}},{type:"Feature",id:"1406",properties:{name:"朔州市",cp:[113.0713,39.6991],childNum:5},geometry:{type:"Polygon",coordinates:["@@XXWVXVWnnlnn@èƼ@„„xlš„ŽV„nblšššVŽÈUVl‚š@„blnœL܃ĊmUkU@Ua‚—@WI@aXk@WVUlKUaV_VKXƒWUUÅka@VaU@mlI@›@_nW„LVl°UV@@b@LÈKVn°V@VšnXblK@b@bkJ@bVVlUÞVÞa„Xܚ°UXWl@„wl@XaV@šÝa@aa@IVyƍ@aƒƒXUWknwna@w‚JXw°ƒWÈ¥kI@W@kmKm™¯IUmkXWWkaƒbkImJ™UkL±aVƒb@lWXkJƒUkƒĉkƒ@UmU@a™KkƒVƒUkJlaU_™yƒ@UU@aUU¯LW`kLWnkJó™ƒbUƒbmK@aU@UVVL@VƒL@„UVULƒK@xUL@VUV@nml¯@UkmKUxmbVbUV@XƒlXVmnVbkxUbU@ƒbm@@VUlUVšb°@VX¯šm‚"],encodeOffsets:[[114615,40562]]}},{type:"Feature",id:"1405",properties:{name:"晋城市",cp:[112.7856,35.6342],childNum:6},geometry:{type:"Polygon",coordinates:["@@lV„Lšb„an‚LnKVašLVašL„UVaUm„aÆLnLlanKVaÆI„a°x²UlmVVœX˜wUKna„@Vn„J‚a„L„a@UV@@alUkKVKnkmmVwUk„w@ƒ™@kxWUXƒW@@mƒk@aUa@a¯aƒLkKmwkUm@kL@K@aWIXmƒVƒXƒWkUVakL@UVKƒw@aUK@UUKmLU@¯n™KUwVƒUIWJUWmka™@UXƒJƒk@UkmW@kLWKVƒx@bmI@VUaVU@a¯@UUmVKmX@±`kÝKVxUL±akL@V™bƒLkKmVƒ@XWVUbƒVXb@lm@@lW@@xk„lVUbnnmbUšlJ@„@L„@@V„b@‚WXš„UlkxVV@„šwn@ÜmnLlVkzƒ`UbmL@Vš@XL˜m„VnIÞ@VU°x@VnL˜x„V@LU°"],encodeOffsets:[[115223,36895]]}},{type:"Feature",id:"1401",properties:{name:"太原市",cp:[112.3352,37.9413],childNum:5},geometry:{type:"Polygon",coordinates:["@@„@VV@wVKnLVal@na°nšaVJœUlm„L°a@b„@lx@bULUlmx@Ln@lVkn„l˜@XI„w‚K„Vnƒ°aVXVx„ƒUaVU°K„nUlšUVL„KÆVš²Ģ‚lnXalLÈƘL„KUaVkUanmWU™a@WwkUWU¯y¯Ñ@anIl@@aVU„m„I„ymUƒLUUVakaU@@LmJkw±LKmVUI@W¯™VaU_l™kbW@kK@mƒUkaVƒmVaU™ƒIVmalk™W@wnIVy@klkWUU›VI@ƒƒUƒVkam@knU@mmmK@bblVUX@VkLV`@n±KU„ULƒ‚UnVVńUbÇKmV—Imbm@k¼ó@Ul™b@VmV@bXmaƒK@›UUxkV‚V@„xW„UxVnkVVJ@XnJ@XlV²LƂVbnL@lš@°"],encodeOffsets:[[114503,39134]]}},{type:"Feature",id:"1403",properties:{name:"阳泉市",cp:[113.4778,38.0951],childNum:3},geometry:{type:"Polygon",coordinates:["@@°@nb„@lb@b„b„b‚@„x²al@lb„KXU@m‚kUWkkmUUƒVwV@XUW@™naVklKXblKnL‚ƒnLVanImaXKlL„ašV@U@KUKW„alƒXK@£WKXUV@VU„ƒUUVW„_V™@W@@K„@šƒUƒƒIWmXUmƒULƒn™JkImmÝaUbLƒK@UƒWk@mn™Uƒ@kVWb@Ubmx@lƒzUxƒ`U„ULml@„XWlƒ@UV@nk@U‚Vb@X™Jm™@@Vknƒyk@ƒzƒJƒnUV@bk@mJ@b°Ò°zXVlVXx‚@šbXVmnVbUlVb"],encodeOffsets:[[115864,39336]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/si_chuan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"5133",properties:{name:"甘孜藏族自治州",cp:[99.9207,31.0803],childNum:18},geometry:{type:"Polygon",coordinates:["@@ƒaXamƒ¯wm@±°wUwV@UaVw²Kš™„U@UƒU„¥‚a„ƒ@£Þ™ôx‚Knkm™X¥™IUƒÝUwlk°V„@ƒÈ™‚KUwlkUyV¹„mšx²Xll„ÑW»š„l„w°UŎ„nƒ„„˜Jœƒl¯°V@wôIVÇn™nUllšLšVǚLô¼XW£@±„@¥k_ÇJƒkUéƒkšƒƒwXa@ƒšLlw²™Vx„b‚mš¼ÈxlLȃ„VWÞn¯mǙÑUÝlÛkwlĉmƒULmwUJ™ç@wkm@ÑlUX™ƒÑôġƒVa™ƒUф¯@wķÓkbV„mnU@@y¯IķKƒV@¹šaƒé@k„mÞU°¥@a¯@anKlblU„¥@óğç@Çw@wkla„çݱk¯±@ğÝUÛmݯwƒ@kb±¯akXWÜkXUÆÇUš¤X_Ɛw„V@¤ƒXU‚ƒbUƒŽƒIUlÇUkŽġ@™aXČmlUlèUV@„mVk¦Vxš@¦±š¯ƒƒ¯¯anlWš¯nƒƒÅw@w°KVak£m@klƒKknÇU™»óKšīlaUaV£@™™¯@ƙU™VƒÛÝÇXƒÇl—ÓlŹ„»WUğJ¯£mx™Lĵô›ºX„VlUll²bl„„lŽƒxónn°ÝšU¼mJUš¯nƒƒƒV@êĉ°Uĸ™w™@mƒ@¯kmXamѯaUwÝKU¥„mÅn¥Wmn™ƒ¹n±ƑƆÇôXê±NJnšƒ‚UôlĖkȂVÒ¯¼VnƒȮ¯ĀnƆ˜Ģ@Žk°V°¯ĢVlkšVxm¼X²™Ŏ@ŽVxknWÜ°U‚¯n™Æݜ@`„ôݲÒƒ‚Çzn‚mX@x„è°K°Å„UČĬóĖ݄ƒ˜ó¼ÅêƒÒƒbmšk@V„Ž˜„@ҁl@nĉܛê—x@Ėml՛J¯¦óxȭ°ÝmŽ¯Lĵè›Ā@Ɓ„l°żƒ‚šX@xmŽkV@z@‚„°blŽnÞ°J@bn@ƼUVƒUóŽóLƒ°X°ÝLƒxUn„°ƒĬƒn@lnL@ŽÆ@šn„KÆxnUnV˜InĬmÆnxŎ¼ĊIĢóÞ@ĊƒƨbUƒ‚mV¥lkƒ‚wnL„mšÅÆ¥Xƒ˜wU@w‚wUÞ™@alUUŚU™Vkkm°aU—°Ó°w°U„ƒ„b°aš²K˜¯œĕ˜@ÈbޏĊaš»„XVm°In„‚Ĭk¼Vb„ašJšôš£VĊan™‚k„ů™™nƒÜU@anKnĮ‚bÈmƎš»nI‚霣Ġ™"],encodeOffsets:[[103073,33295]]}},{type:"Feature",id:"5132",properties:{name:"阿坝藏族羌族自治州",cp:[102.4805,32.4536],childNum:13},geometry:{type:"Polygon",coordinates:["@@l@@þ²I@lƒ„VL°wnJ°Uĸ™Ŏè„Ilw„V°¤nĮ™¤Ý„lè„L@„ƒ„@x„l™è²ôĊ_ĊġVÈôJżīlbXšÆÈVŽkxÇVƒ„n°„¦Üb@è@nn@@°šUÈ¥WDŽ_Uala¯¯UǙkƒ»„mVwk»˜k²°VxlL@¤œ_@x‚`ȍ‚Ėöb˜š@l²alX„a@bnK°¦VK@nnWmx@nUnl@@lƒlĉk°l°UXkmW@Unš`k„ÇL„ŽW„ÛÈVxšVVlVk@l„IXb@ylXÈW˜Į„WŤzœy@šmIƒŽ²šJ‚š@nŽ°@V„„J°a„Å@ƒŎkVǚk™aUw„KVw™™Vƒ„@nkm™@±ôkô™ĊJš¼šInÑm±nIššÞ‚XȃĊxĊUÈbÜyÈ£Vkw@kVUV™„m@ša„»ÜbÈmƒUXwÝxƒUn¥@°ġ™Å‚aœJVk™aW¯Û@W¥—UŏĶ™@¯kUƒŃ@ašI@mmanwސ‚W@œ™mw°»Uřk¹±W„xVx¯¦U°ƒzţW™w@°ÇVÑk¯@„y°aš£š@šmšnl¼„ašÝÝakwUƒ±aĉImlĵn@ƒm@kkVƒ¯Ñm™ĸ™°x„l™œ@˜ƒXVÞmlÛݙĉUÅ¥mwÅ¥VaUw›™XġċaVůÛŹlwU¯U™ó±™xÛV±¯¯n¯mċƒLmnĊm‚™@™_kJWaXmwUƒĉK™»™@mwX݃UDŽkKÇw™»nƒaUw±škx™K@„Wb„x™„„lVê„lÈIl`@¦ƒŽ@²X¤Wó»™KUșŽ™KkkmVmšUÈóJ@x¯Uk°›„—Iƒƒm„ōƒ¯Vƒxƒk™ŽX¼ƒÒkk±W™wƒnUºVzklVxLǚ@„ƒŽ¯UklVxސV„šJW¦nšmlLówݚ@¤ƒ„bƒ¦„V@VƒV™š±LUxVbU@Vx¯x@²n‚°xn„Wb„b"],encodeOffsets:[[103073,33295]]}},{type:"Feature",id:"5134",properties:{name:"凉山彝族自治州",cp:[101.9641,27.6746],childNum:17},geometry:{type:"Polygon",coordinates:["@@ĶóšKnw°¤ĠIXVƒ¼kź˜Ôk‚„ÈWŽÞȄÜUVšÅš°@šš‚@U¤Vbkb™ĬôLš¼ÈVlm„Llkn@l¤Ub¯L@xÆx„„°mX™mk°b„°°„²™@¥‚™Uwl¥nU@ƒVUkçVnkWċšbĢ@lÈVVk„J„‚V„aV„W@£ƒUƏxW`™£ÈVVÅlWXÛlW°b²la„@°xnÞVÜĠÞ²@l°Þ²ƒèkblŽ@xÈx@Ġènal£nU‚Dz@‚ÞK„nn¤@¼˜°U¼„nV‚šXU‚šbn™ĠUVbUlVš°LX„@lV„èÜUnK@_ƒyXVyUwmIU»Vƒ„kÇ¥šÿkkV¯m±n@ƒn¯ÜanVVƄz@Ž‚bœwÜb„m@wša@kƒmk»@™a@VUUó„w˜@nb°mš„XŽmnVbގVôanwšJ‚ak£lw„˜šLšÅnÝ@wl¥IÇӃ@U™™Lƒ¼kVǃÅó¯kVmmw@ƒn_‚Vn»°LÅ»@éÇçŹīVÇÝ@ÝğU™ƒaVݙ™š¯ķlŭġlƒ@óÞۂċ@¯nkUӄ—m±™IVġUwóKUn±¯—K›w»ƒKݐV„nl@„óxUwţ›£ĉƒUmŗÇ݃K™„ÝUlmKƒ£UVŽ@ÞȎW¦„Ò@Ĭšnny‚@nÒmœVŽ—¼@°Vbl@VlnUUwl™°a@„œ„@llnk°lbnKWĀnŽU„VxUŽ‚²Å‚m¦Û›ÇŚƒaU„Vbš@¦m`móX™Umm™xÅ@±Þn虲™U¯»m™ƒV—m@wƒU@wݚÝmLƒa@„™VÇUk„l°¯„VlkVƒ¦UšmxƒaULUèVx@„kIUxmWV¼¯VmȯšU„nl›È—@m»Å™ƒVWxÅbÅğW@kƒm@kVV¦mlnn@‚ō„l¦Åƙxkœ"],encodeOffsets:[[102466,28756]]}},{type:"Feature",id:"5107",properties:{name:"绵阳市",cp:[104.7327,31.8713],childNum:8},geometry:{type:"Polygon",coordinates:["@@„ńlV°š@Őĵ˜VX»ÆUĊќJ‚w„@È»m»š£°Kšk@ÇnÑƍš@„w°JUwnw@wšbVbš@VlźLUw„aƒ»„aUklyUUVakwWXwWƒUxkLƒmn¥mšwk™˜UX™lJ„w@aƒIk°X„¥Wƒ²l¥šaU™„IlmkklƒÈL@m°nlWU™aW—š@Vƒ„@UaV¥@ašk@Çk¹ƒK@a™K@kƒKkšÇX@VU@kx±V™èkIWwUVUkkKÇ@ƒa@wkml¯@kUWn£Wa„aVwnaV݃w¯@UaWx—n›JńUxUšma@L@„mbUŽU±VVnkxUƙ„VŽm@kkKW°„X@¤ÇUkÆÇnU¦¯ŽkƒmLVwÅK@UóbÇƁVƒ¦™L@‚±êX¦mVޚkÜÝnWU—„›@kšƒŽ¯wķšnš°ÒU„lln@@„ĶmnkĊJ²bV„lxÞb™Þƒbk»™m™n™@™¤¯bƒz@Žl°UÒ¯È@ŽšxŤX„yV¯°¥Uwƒw²XlºVŚ¯¼nx›š@ŽXݏmxnb@n™J@b"],encodeOffsets:[[106448,33694]]}},{type:"Feature",id:"5117",properties:{name:"达州市",cp:[107.6111,31.333],childNum:7},geometry:{type:"Polygon",coordinates:["@@Uxn°‚bnŽlUnÒƃnn@n‚¤„LnxlU„ššV@„Æl„x°XXxl`XœƒVW‚œL˜è—„±nÈbƒŽ°b@š²x°Kܼ°ĉ„V¦lJnU@¦šÞ‚JÞğ„mšLÞ»šxU„lb„VÆann„alŽ„VƍX@lnŎV„mU™maÅXƒa@aWmœ@‚£@wĉJVƒkk‚kkmƒnk@ƒmna@šal„Kš™‚J@Þwm‚ÅŃ@ambkUƒƒ@™™KUġKU@m‚ak¯±ƒ„a@aĉÑÅaVwšXlwƒ±—V¥l@@a™kƒ›@@£šmƒĉÝónWV@ŽnÝÇÇx—UmbƒaVkkk@m„@m°ƒÝýXm›akÅīƒ@@ƒmb@@xmšnbƒ@mxšŽkWL@ƒ¯b@WUXmWœWKkbm@kx™Xmm@LUl„xlêóK™nUš„all™LƒlLó°m¯JVšU„K„„@x˜K²Āô¦l°"],encodeOffsets:[[109519,31917]]}},{type:"Feature",id:"5108",properties:{name:"广元市",cp:[105.6885,32.2284],childNum:5},geometry:{type:"Polygon",coordinates:["@@ÆL„Ċx°»Ŧ¦˜W„™šLȄ@xÞKÜ°ÞnVxÅĀlÒnJ°a@w„V¯l@XWknKnw˜VȚ°XXa˜lX°VI°b„W„nšaššš¥@ƒw°™n@šyÆ@nkÞ@°¯lJn„°IÈl‚UšlXÅ@ķlUV¥VUUÝޙUUƒ@UwƒJUkĉm@ýƒƒlk™WUwVwWJk@VUK™lUkaVƒUƒmLk„m@ƒƒ@Uƒ›Ik`@„™UmlUkV¯ÇXKÝ_mm¯@Uƒ`kwmƒl¼±KV¯—¯Vk±Vk±kzma™KUnDZ™bk¦±ŽX„ƒ¦¯Wl„J@bƒxkIWš—Vlš™xnŽm¦„nlKVwX„WxXŽlxUbVVkzVlƒb„¼ƒbVxŹKUk™@Ua™a@xmxVx¯Iƒx™@ŎmÒ@șl¯L™¤n¼"],encodeOffsets:[[107146,33452]]}},{type:"Feature",id:"5118",properties:{name:"雅安市",cp:[102.6672,29.8938],childNum:8},geometry:{type:"Polygon",coordinates:["@@ln@xšèVInxVKn„‚ĊklxkÜVޚÒnÈm°nxš@š¼ĊLV„nx‚WXblIš`š@nmĉn‚KȄôÅlUÑmU„K²¹@ÇÅVÓůVýÞW„‚UVmX„ÆbnwšKUÿ‚™@UmmIUb¯¥Uwƒ™¯™Çmš™„çmanUm»UUƒl—kƒ¤ƒa¯bV™U_WĕmÇŚ±ĢUlƒUl™ÛVƒçkUƒ@WŽ¯KU™VkUağVmš™aV™WUƒmV»—¯@»m£ƒmÝLŽ±@ÈmVk¤mb@ôƒ¦kVkamL@b°‚@b¯¦ÝVƒn@l„ê™b@º„UĸL°J@zV@nmUƒlaĸÔ@xƒ°VҚ„Ub„‚óĢ„ÒWškV@Ò"],encodeOffsets:[[104727,30797]]}},{type:"Feature",id:"5115",properties:{name:"宜宾市",cp:[104.6558,28.548],childNum:10},geometry:{type:"Polygon",coordinates:["@@VlÈnl‚XnWLX`m„²nV‚@b°xĢçlnšVm‚nn„@@„°‚UzšlV°nޘÒkxl„w„`UnVb„mšL@albÞKÈۚmܼ°@Xǚ@wmW@ńKĊL„lV„šLVŎçÞL²±‚ğkw@Uƒy@¹lKX™lKVa@w™™Č@‚w@a˜ÇU¯n™@@wġak—™aō‚ƒƒK@Å»VakUWmķwkbğ¥mL™akš™@ġރ°¯xVVÞ@VšxVš—VWx„XlxU‚™@k²WVŃULmèULVĊklĠ„VœJVx±nŃ¯¦mwğ@mƒƒlğkkl±@kšUk@¯±Ç™Kƒ—kxl¤b™Imx"],encodeOffsets:[[106099,29279]]}},{type:"Feature",id:"5111",properties:{name:"乐山市",cp:[103.5791,29.1742],childNum:9},geometry:{type:"Polygon",coordinates:["@@kšVŽk„ššÆkšV²UlºÈIlxƒLXèÜlU„„XU‚mkƒbVè„x°@„@¼°Knnn@m˜ÆIUbnJ@bVI°b°±@nK@mVakkƒKl¯nbšmĸ„èl@VnÈl‚UUw„wmwnm°¥„L„™lLnU@Va™ImbkƒmK„ƒƒnk@mƒb™ƒƒLV„JVUUƒ„VnkVmb@a¯JUaÆkk¥„IW¥„Klw—ÑmÝU¯™kVy¯@ƒƒ@mmn™Ukmġè¯w@aU±mnƒW_XKWmkÇmUkóbUÝUanmW™ƒ¯nma—@ƒxVôUV@šb@‚l¼„n@l™b@xƒnÛa›xa@ƒyUÅmUÛbm°@„m‚n²U°ll™ĀȦƒlU„V¼nJVxUz‚W„z@`mL"],encodeOffsets:[[105480,29993]]}},{type:"Feature",id:"5113",properties:{name:"南充市",cp:[106.2048,31.1517],childNum:7},geometry:{type:"Polygon",coordinates:["@@ȲVmšLnblyl²²UUl˜°U°²L‚»„knlx„_VŽ°@nnÞ`WL°ÈUŽVlnkšV@ƒl_œJV„‚@„„n@lƒnKV£™Çšƒ„UV¯šm„@laX˜U„‚UbVx„@VkôJU°Jn™@™‚wUk°wnUƒV_nJmknmm¯Vwk¯ó¥±ÿ—L@wƒƒƒLVU™kU›bX¯mykI@a±Kk¦ULmaXƒƒVm¯ƒK—z±ƒklUIVbÇJšƒkL¯™l™ƒU™ÿ™UƒlUkJƒUmŽUUkVVklKk@@a™U@„™J„²ƒxƒ¦kĬ@¼±ºXnWb—xƒU@xƒx@lšL@b„Llº@șl@bU¦Vbƒ@U„™@X˜‚bVškX¯m@nÇKk„llknƒJVš"],encodeOffsets:[[107989,32282]]}},{type:"Feature",id:"5119",properties:{name:"巴中市",cp:[107.0618,31.9977],childNum:4},geometry:{type:"Polygon",coordinates:["@@V„U„lbkVšŽVLUŽl@XI‚ŽUxVxšXkl„„@þĊnVl„IVx„@VVݚVÞUVU¦kV@ĸWÆô²š@VÞnš@Vaôb²W@‚K@XUmÑUW°¯°Ina@y„_lWn¼lLUbô¼„Kla@™nkUyô—Æx°@šn£™Ý@¥mVkIU¥Ċƒ‚¯Û»¯L±w@™¯a„Ça²m˜ƒ—ç›KX„UW›k_Ww¯WƒwÅk@ƒ™Uƒ™kVmwƒK£@mmmńmÑkVmamnnlmIU`V„m¯xVlx@šmš¯IV‚óIUlƒ@UwVaƒ—VW‚kbƒ@™nU°ƒV™„šÈU¤"],encodeOffsets:[[108957,32569]]}},{type:"Feature",id:"5105",properties:{name:"泸州市",cp:[105.4578,28.493],childNum:5},geometry:{type:"Polygon",coordinates:["@@VVXwVKn„˜wnVƒn„l@b¯xmKUbVn°°X°@blLšènV„@Vn‚l@U„LnmmUna„VV_ĶV@wnJ„„l@@kkKVólaUwnJm„wUlm@ašUaôKVnJWbޚ@VšwVLX¥VVš_Þ`šw„WƒÞŹmmnIn¥Wƒ@k„WV¯@ƒ°kI™ŽƒLk¼Ç@k¤±Xk˜™nmݯUlÅÛKWV¯kƒlUwkLƒÓ™@U—@ƒ‚w@ġXV„˜WX„š@UbVbšV›š_kÇV™lU°lnwŎ¦ÞaƯnmm¯šU„™m¥nkVmkƒl_ó¥¯UÇl¯@™ƒ™L™kƒ`¯ķLUy¯@mw—¼ķ°ġ_řU°mlšnÇVUޚ„@‚ƒš_ƒJUnV‚UXšbl˜Ģb@x@mšV°—È‚b@‚xċ@šš@xUbkLWškL@º„zV‚@lxĠ±²"],encodeOffsets:[[107674,29639]]}},{type:"Feature",id:"5101",properties:{name:"成都市",cp:[103.9526,30.7617],childNum:11},geometry:{type:"Polygon",coordinates:["@@°n°m²°ÜUšw²ŽôVš°ŽVkxÜźUŰČb‚ŽĢlaÈL„»ƒ@k„wVǂ@„ƒnÛƻșUÝ°Kl_„V°Uš`Vbn@VbÈLšaVU@ƨ»V™nIl™šUUa„±lIk±š@VnKmÅ@WaƒK¦™lVōškK™Ý@maXÇmw¯IU‚@kƒVƒwUmVIƒƒƒç—ÿƒU±ŽÅ@¯È@xƒK@wƒLUbÇKō@mÝ£@yóUóóUxkI@WlIUaƒbƒaŽVĀ™LmxÅaWƒUnVƒÝXUþÆ°UÔÈÆ@±ºƒLnVVÒkóÆ"],encodeOffsets:[[105492,31534]]}},{type:"Feature",id:"5120",properties:{name:"资阳市",cp:[104.9744,30.1575],childNum:4},geometry:{type:"Polygon",coordinates:["@@„è„„UJVn„x„U@lV°JnxWÈnbÞ@šŽlLŎ™Ušk‚¥„LXbÆ@nŽmLU‚@zlbXmlnVynL„çšJVb‚UnómUnamU„an¥lKV_²aValWô„n@nƒ‚bVœK°¯VblW@kkƒlUnlV£°W@w„UXk°KVwƒmVkwVyVI@wkmƒVÅ_Umm@Uÿmbk£™xUaVw±V¼V¤kLWxU@Uk™bƒyƒXšómƒ°V@@zÝÒkKƒn™±U@@_VVkƒÇaVwnLWalm@@kkVVl™¦kIV`±n@w„Kƒƒk²™aƒVUUV¤™nkxmUkVWVnLUbVbƒ`kUU„mLU‚mX@`ÅbǚXbWLXŽ›n"],encodeOffsets:[[106695,31062]]}},{type:"Feature",id:"5104",properties:{name:"攀枝花市",cp:[101.6895,26.7133],childNum:3},geometry:{type:"Polygon",coordinates:["@@„b‚KÞnޙ@x„V@x˜n„Unš°¼šVš±mç²ÝÆ@šwnnšVWŽnôn_@¥‚™UaVƒ„bƙœÈ܎n¥Æ±VUwVƒmXÿmLkal¯km@k›ƒ@ƒ¯bkšVxmVUkk@Ua@¯˜»Un›mс@mz™m@īƒÑX¥Ç@ݙxU¦ƒšÅŽÇUkx@šlb„UWVX„mV@xĵĖ±@@Ž¯xUšÆLnÆm„šx@nXL±lUUVwKWak@WxkbšÞƒŽĉbUn@‚ƒ@@xó¦„Ŏ"],encodeOffsets:[[103602,27816]]}},{type:"Feature",id:"5114",properties:{name:"眉山市",cp:[103.8098,30.0146],childNum:6},geometry:{type:"Polygon",coordinates:["@@„šVx°¦VanJVnš@„b„aVbkJ@XlJVwôôôV@zÞ¤@nƎÈLVa„K@x„L@w°ÇÆ@²„V˜ĀœmWXKWașÆa@_nWVnKVƒlV„_UaVamKXUWwnmmwœÑm£@ynUƒkWƒĉUkWVkkV±çkJmkKƒšƒK¯¦mnnxƒxVxVÇkUmk@ƒçķ™nmak°„LllUb@nmL@‚¯²¯aUJ@amIVaÅJn—m@mm¯L@»ƒŽ¯@ƒwUç„anlVƒWVƒÛkWç„KkwÇJk¹±V™UÅl™™ġV™²ÈƂnXĖV`Uš°a„b„£˜l„kVVn¼mVnbƒè™šÈn°š"],encodeOffsets:[[105683,30685]]}},{type:"Feature",id:"5116",properties:{name:"广安市",cp:[106.6333,30.4376],childNum:5},geometry:{type:"Polygon",coordinates:["@@„VlIV‚„kšVšĀ„Vkš°šlK™„ÈIUaVJlk²„˜y„Ln°„UW„nbVKl¥²L@blJnzW°œalV°Inô¯‚K„kšKkkƒbV™šmôLkéƒwVk@KnnšWlwn@laXL›ŽnXVW@X°a@„XKl™nw„@man™@w‚@na@„„@ƒw™ĕġġ™wUkUWb@mk@™¦ƒ¥mUÛb±yÅn@bml@kV@„ƒlknVbmVnlmš—bÇk¯bWyk@V_UamJ@I—@WaƒVXamIVWkUkbVaƒUUxƒ@VnkVU¼›bkKUxmK™„@WšƒxnV@n"],encodeOffsets:[[108518,31208]]}},{type:"Feature",id:"5106",properties:{name:"德阳市",cp:[104.48,31.1133],childNum:6},geometry:{type:"Polygon",coordinates:["@@nUW¥²é@šK„¥‚UÈÅôa@VÆLUxnKl„°V¥ÈmlÅÈV@£ƒWX¯lLln@UšƒVÅlwUm²U‚VVna@ƒ@KnbV™VwƃœI˜mXwWƒkIVwÝĕVUa™IƒèmKUzkmWnka@y™@l²kJƒ²Vb™VkšmJUšƧ¼@UV™bÇKUam@Ua™_¯VƒUk`¯LVÞǚżm܃„@Uȃx@l„ƒ¼ÇKkbWŽœšVxUbƦnxƦĊV"],encodeOffsets:[[106594,32457]]}},{type:"Feature",id:"5110",properties:{name:"内江市",cp:[104.8535,29.6136],childNum:4},geometry:{type:"Polygon",coordinates:["@@²èlUUllXĊVX„„lmV@zn¤›ÒnxmnXxlUnVlwšmU£VV„Ušbl±„„ƒL@x²mU_lJš¥UklU@ln@‚kXbmKUxÈbl„UU@`V@š²„mlLÞÑ@yU@„¯ôn‚™„W„zšaVlV@XwlKU£‚»—aVaUwm@mwUVUwkƒlVDzLlƒ„KV™m_@ykUmƒ@mU™çkKmxkIU‚Ý„@LUJ@n±„kº‚LXb™¼@mmIXa™@mamnkW™ƒKUƒƒxƒ_U`UklwUw™mUbƒV™²ƒakbƒmkn@`„UmҙšVxUb™I™`UƒaÝÈ"],encodeOffsets:[[106774,30342]]}},{type:"Feature",id:"5109",properties:{name:"遂宁市",cp:[105.5347,30.6683],childNum:4},geometry:{type:"Polygon",coordinates:["@@ÞĖUxlJX„Vb°@„xUÞmbUxƒbXbm¤VX@lk°ln@x„bÈ@lLVlVUXxlJšç²UlwV@@UÈWl™„L„w@w„V˜wXaWm²¹@»lī„¥„wƒ±šI@ƒšV@bl@kLUllUVVn@mmU„wX™ċbVb@VUkbmamšW@kƒa@™™k@ƒlaUa™@¯b@šmmwó@@lkXUa¯°›LU‚am„m@óƒkXUb±bU`kLm¦ƒbnVmbnVmô"],encodeOffsets:[[107595,31270]]}},{type:"Feature",id:"5103",properties:{name:"自贡市",cp:[104.6667,29.2786],childNum:3},geometry:{type:"Polygon",coordinates:["@@lIÞDŽbVŽš_šJVaUwš™nуV@_lm„nla„bš±„UVašnVxkxVlV_„`„wV„„LšlXnmnbš@WbnJ@nš»WaKl¹²ƒ@mVI@KރVlJnw@aW¯¯¯UmVanL°w@aƒk„mmU—xmƒULWxUUÝKōèU™KUƒƒkĉKƒL@ÆnX@x™‚Wȯ@Û»™nÇÜÝLka@b™KƒnUaVmƒ_ƒxkƒLX¦ƒJl¦ÅlVb°I@bnaUŽmlƒUV„UVƒIUŽ„Kš„„a@nml„„ƒŽnLl„našJUbV@"],encodeOffsets:[[106752,30347]]}}],UTF8Encoding:!0} +}),define("echarts/util/mapData/geoJson/tai_wan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"7100",properties:{name:"台湾",cp:[121.0295,23.6082],childNum:1},geometry:{type:"Polygon",coordinates:["@@\\sŽ@pS}aekgKSu™SsMß`¡CqZ·be@Q^o@‹gieMp‹‰]}•}Ľc_Kk…{™ù“A¡r‰[uom@эĥJiq©mʼnq¯Bq]ÙYgSåk_gwU­isTE…“‘ĕiqiUEkue_‰OSsZ‹aWKo¡­q“ycY£w}‹ĩ™ĕS§Z©S™N¥SyLÑ¡±Ks^IY‰PdƒY[Uo†Fp}´\\¬\\j]ˆe܍ò‹¤¡–ā a\\bn™U㺹Ìs¼j®[cíȈEŽĝĆ`ļf¶Š®K|VØDdKGpVnU‚FjpH—F`†B’[pMºxÖjbpÎxp€¬‚|ΟÜÒCŠ²®‚ÜAp„ZG~€Šd˜ÞàV¨|¸€`|Œ²tx~\\~|dFf^zG€ĄŚhœdL\\hĸž¼†ŠOªP®lV`p\\]Xpll˜æ¤œCpQ|oF}fMRi†NSon_²qämœM„NM‹\\•"],encodeOffsets:[[124853,25650]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/tian_jin_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"120225",properties:{name:"蓟县",cp:[117.4672,40.004],childNum:1},geometry:{type:"Polygon",coordinates:["@@EUDAEI@WNMNCBFAHFFNACDJDPBD@@GD@DIFFHEFGDBDEQOFG@EI_KG@OcJQM]RMEKBGPG@[LaCIICBWKCEEG@WBQHCDFD@HSLEJI@IHWECFGAAEKCGDBFCBSBIDCKKHEADMJMFABKOKEQAA@IEEG@GIQAEK@OZEESMOL“lu@SLUTYFQCMG@@SQUAYKAACA@IB@BDB@B@DC@@BGAEFAA@BEGKJCC@AGAIHA@@JC@QEIP@@A@EGIDC@O@C@@@@CJCWKABFLBBEBSQGBAAMIEM@AKBcJEN@BEBCFMAEFEF@J@BG@BFABECKFG@AFQ@@F@BEB@@A@@AAAKAE@GFGDECEFEECBKIKDELDFEDYH@EIACDCHKBEB@BAAC@ADBHABKJIAIJICEDGDCD@@A@A@DHCHJHDFEFGBKRKBGIK@GIMHSBCH_BOJECCJCFKKMD@DNJEDEGC@OJCJHRUL@HRJ@H[DCNKDZHCTFDHCFFKR`TANVDFZRDLFARB@HPAPG`ILAR@TERNDFNHDLCLDDCXDYbHF@FEB@LDDVE@JPNfXPINCVDJJD@NJPAJHLXHDNANHhB@DPNLRMTBFRBHHr@`NBFEBOCCBIAQJDHCHLHFA@HSDCRLFTB@HEFLNF@PELBDJALFLTC@EPFLLP@tUHQJDfIHGTB^JTCPDLKAIBATFPADIEGECEMJ@JIAIHGECFEAGDI\\SPOXAFCL@BQTQBBTMZECYGAHA@GJAE@HCAEME@IECFKJADDBABLTHHG@ILEAMNDJCDHEBF@@JNFJELDFKTOT@JETBFFHBHEHKI@@IJEJ@XKEOUMS@AF@CEB"],encodeOffsets:[[120575,41009]]}},{type:"Feature",id:"120114",properties:{name:"武清区",cp:[117.0621,39.4121],childNum:1},geometry:{type:"Polygon",coordinates:["@@FWôµ@IFCLIB@EHNBp]AGEAKAEDMGZKFGBGME@ILGP@HEFB@BXMEAHUGC@IHCLOD@X[NWHWPKAEF[@EKIOL@EKGBNMJ@EIEHKBIC@BAKMIACCFQZCF]DB@ERAKADIHGEIBCGIIECFaGLZO@EFCNGAGDGAKL@BMG@IE@ADSDEH[JGC@CGA@BMDeK@EIACFE@@GG@FIAMM@CCGC@EM@ADE@CFMAAGHBDKIEAJG@DOGCDEKAGIS@KFCHKAEHIE]BeKNO[IFIOELC@A]GMBKVYCDDgGAICARc@MW@AQE@DGI@@AQ@@BKBAIQQYEFW@CEADIGGBCEIiMEMF_LGEKMBBDWEBGRC@E_CHYGCH_IAED@FFBQh@FGJaJ}AHRAREF@bE\\C@CT`FHC@\\BBF@BID@HGDDJ@@FAHKBARECKDAZBJIVNHCTA@EREAMLHDAFFBVFFC@RNRETHD@FOJMACH@CAB@P@DF@@FGDWE@FFSIEMKQDYCCHKb^JADOCIDGNDBdBCFJB@EC\\A@BJEA@JAAAD@HHD@LFBCFF@BERDHNhZQHMBGHOACCEBWEGD@PSJKCGEUD@CINLFGHE@AJK@HDABBHTB@F`DBFLBBHEDARCFG@ABJBAPVFE^FBGLGCFG_BMLEXGAAFE@@JNRVJHFALFBEHQJCTbNDHCF@PlFLJSXCHFHfVBTNJ\\BPJXC^FAVNFCHFB@FFH@JF@\\ABCFD\\BDMCAAJKQBGAILOEGHILECQLWFENJHADC@QxNHFJNLDFA@CBA@D˜UÂmR@FBL@BD"],encodeOffsets:[[119959,40574]]}},{type:"Feature",id:"120115",properties:{name:"宝坻区",cp:[117.4274,39.5913],childNum:1},geometry:{type:"Polygon",coordinates:["@@TZbB@JHD@DODCLM@AP@LL@BNH@ETFN@`E@DNG@CHLBCJA@AICFKDDBKA@\\N@AFNAGRBFjFFFL@DHLBLFQPcXAZMJ]GAVHAIZJFNE@JpDRRDCLFDGXA@EFF@CFFPDfEBDB@DCHCFCJDJIJBLI@I@CB@@ADBB@FALADGDC@@H@BB@FZGFCCE@@FMLALJDAFFFEFDFCB@@AHCF@L@@BBB@BB@FC@E@@R@BEL@HEFD@G@AH@AIB@@@FEFEBALDDEFAFO^IF@JCBBFPNJJ@D@PRDCEKBAXL@BIFD@T@JE@BHHJORFDI@@B@JGH@@B@BDDLIFFHCD@D@DEE@BAAAB@DAF@B@H@NGLJLMRDNMfGIEPMI@GDAKK@KIDIJ@GE@CFDN@FE@GFEPGV@TCDFKHBBF@RW@DD@@ID@TJFKIKLI@EP@IGBCLAEKLEN@KSHIGYACSD@SEAMBBMGEBMQBCMIGKFB[D@HDLPHDBC@IFITDLG@IIIFGVBNJDLN@VIRI@YIAIHIC@CLKZCBEE@JECEIHEAKGDGECBGEEM@@DA@CCCBBEGA[GEDBBoNAAH]MKiIAWKQoIIPMFQAEEDMH@FMSUYIeF@EK@BIOEKJEBICFKaKPFAFSE@LWCCFMHDDEKESBOGBKIEIODLG@CCDEQCEDWEMDIEIB@EHGEEDAEAa@@HqDEJGF[AECCFa@WCEIKAAEQB@FCAE^YDERDDJBLNABD@AJGLJF@FNIAMLH@FPKLJ@FE\\BFOLGXMXW\\C@KPGD@JHDGVFBWN@AEAGFO@KH@JNFAHEHYLNHFCLBFBBHo^MAFGA@KJED@Jó¶EX"],encodeOffsets:[[119959,40574]]}},{type:"Feature",id:"120223",properties:{name:"静海县",cp:[116.9824,38.8312],childNum:1},geometry:{type:"Polygon",coordinates:["@@NGFMDATCNDR@CCbINEHNJA@C\\EEGVE@IhE–[˜w”epc¢·²›^QEKIEKIgiQDkehY£uSDBMkUDOJDHC@GF@CAFBFEN@C‹Q@BeP@@G@HD@@MHQKi@[IGCOCESE@GMA_OcCGDu`aˆ@VZzKDkJBLNXGDqKEWE@cFEFA@ƒISIi@@KMABJGBcMuFEzGVH\\ATSEUBeALCEMG@CEBUHUCGXaBPtUBBFIBFTDFF@DDKBFNGBJPHXDDMDCLJ^mBIHIL@LR\\@LCR[@@z@NFD@LLBNb@RHDBNTPT\\F@BJF@BXCFBHHBDLFB@HODADE@@JHVXCPDHCFTLBBFNCDCCCU@@GAABEHHZHBCAEdEjFDD@GfD@DXFCHF@ERFDLBH@"],encodeOffsets:[[119688,40010]]}},{type:"Feature",id:"120221",properties:{name:"宁河县",cp:[117.6801,39.3853],childNum:1},geometry:{type:"Polygon",coordinates:["@@BFLBFJXDb@DEFD\\BHEFIrC@Gb@FBCBFFGH@FJAJFNCXFFCRDCFDDH@CKJPJFALPHTALFCFGCENDDKXF@ETEBO‚bLELJDFALIPFAJL@@FfEZJTVENG@CNFFRBNEJOpJLRBXjJNLG^BBpMAAFC\\HHBAFDADDB@@CN@FFAHFDCHLHFBJGFCFUNKJJTD\\XUXF\\^F@DDDQXXBRLRCBDFEVCDLVDpUl@LEDJHAPRFGL@CETGPBTCDDVI@CFF@GFDCCVGLKEK[Y@MECISG@BKNSCGCKWEAaEBEKNGFSECO@GGM@GYI@DÅCMLHPTF@DJHAVVNKEGDETJ^[TJNNd@NOAMFYJ@@GFANDPEJB^aOadSTQSI@MHBDIEOKCG@EEFCKCqXO@@DMFENCDDHCCGJ]AKFoDaGGHYFDHKJiCMFGC@EQ@AEHGAC@IEAATKOHGIC@IXIFEoƒGE[JCFCDHNmRADFZMF[EEBMO{GU@AOW@@]ZeHBDEHBKEfQkuIWBs‡@EC@d[@[^EDMTKCEEcI@cDAB@FCBCACmOCG{PYHeBgPwPFDDALFFFCHQGSD@BHFAR[TaFYXMASUiGFL@DQNCJI@@D@PLDN`ETEFIGMCGBCE‘~CAIFDPEHGEQPHJADFJGHCJLB"],encodeOffsets:[[120145,40295]]}},{type:"Feature",id:"120109",properties:{name:"大港区",cp:[117.3875,38.757],childNum:1},geometry:{type:"Polygon",coordinates:["@@JFFL°_`ONJKDDFIFZN xlb~yFVNRŒrdJGzDPVFBCTNND\\UR@E`F@@Ip@IWGUoawOEE@ÏDgK{İEEMFëC—b…™@—KwOCDHHKBDJCDEEEAGHOABFABMCgDLSQ@CFEB‰MgYIDQINE@AUSwSAdYEHQMEyK[KI@GRMLE@@OqOoBOnpJ@BmEAFHL^FDB[C@BBDVFAHFJENB@sNEjQAMYsUgCSBGDJH@\\LjGR@NC@@G@HO@AfR@DŒM@EFEADBE@@HGDICCPlVANTC¤vgZlfRChjLJ"],encodeOffsets:[[120065,39771]]}},{type:"Feature",id:"120107",properties:{name:"塘沽区",cp:[117.6801,38.9987],childNum:1},geometry:{type:"Polygon",coordinates:["@@|ODHnPBDADEDA@CB@ddJFFLDNSFC\\]\\@@cFDˆ@nACOMW@M@ITURBRZNHNWRQšoO•j½f‡cqŸAqeiDÿÍyÓįFL|Ch@ÐFFxPpbHVJXo@@JCTR^BPABQA]^MB@bE@@FQBFVJRH@FXtPNZSBAja@@NƒDTŽLJrQTHFXZFB`"],encodeOffsets:[[120391,40118]]}},{type:"Feature",id:"120111",properties:{name:"西青区",cp:[117.1829,39.0022],childNum:1},geometry:{type:"Polygon",coordinates:["@@@LHAHRHATh`LHNHDG`HDGZ`D@FQDAHXFACNAFLVRTBFOfHDCVBFQH@HSXHEPFB@LDBF[bDbLFKJBFLADBDjLvCPEI]FGEIGCBEUSjcFiBIVWfaHCjN^HtwBBFGPBJGjFBEGECGDONMFAP]TDHQOWCMGAMHKIJEIGQ]aDlUG]VGEGDC„{PEbBZmE@@GH@BCA@FMQCFMYMJECELCMI_P¯`]R±œ¡¸od“f—x•\\gF@JUFFH[F@DIBGMMFaJDDQ@MCSDCBENMH"],encodeOffsets:[[119688,40010]]}},{type:"Feature",id:"120113",properties:{name:"北辰区",cp:[117.1761,39.2548],childNum:1},geometry:{type:"Polygon",coordinates:["@@ROHFFGCOJEDB’}DFHANDJHFEFSM_KC@O@CJ@DIRM@CEKKA…L…FKACHoLSJSIBETDJaEIIE]E]K[MYUYQILC@GF[MGNKEK@A@BCWECAIFEFYAGFOMI[OFuDiKACBCEKIAELaKaCE\\CA@KEAFOWGGTG@ERUACDeGEPSAUQKHE`FNjNFJADHHCJFB@DEXZFRRBJLA@AR@@BJ@CHF@BRX@@NQdDBBJhHCCZDLUNA^H@BKDPFEJ\\JMPfL^AJFFGLBDGLET@HJLBCFHDCPH@BIJFCLGABHNBDEF@BCN@@FHDDDN@BNEJH@@HF@DEJB@FfLNC@AHB@DHD\\IFGTCBCF@@JNH@ALKHBHCHBDMFEP@KYbHDEJF"],encodeOffsets:[[120139,40273]]}},{type:"Feature",id:"120110",properties:{name:"东丽区",cp:[117.4013,39.1223],childNum:1},geometry:{type:"Polygon",coordinates:["@@ZV\\N^L^FJFFJIbSCAFTJTIpKDGLB†E†KLBjHTVNBZWbE\\SBQGE@ATCRHDGEEKECBECxOhOfAZGA_YEEWSGqRKIS„C@Mb@BiTAMYsOEWG@IQEURA@EF@@acUOXQRYCUDCHDTEF[SUEgAYDcVGJM`iAWDWLQRMHUHgDsDBLHJFCFDFGHBFFVEAGHCJN@RJF‡PIhBD\\FENCPWA@LFBAFHBEJUEARCDIAEDQBRNa^"],encodeOffsets:[[120048,40134]]}},{type:"Feature",id:"120108",properties:{name:"汉沽区",cp:[117.8888,39.2191],childNum:1},geometry:{type:"Polygon",coordinates:["@@LMEI\\MTABKN@FCDMH@COAcH[AoēA™M¡Wa[Meq™pQRMXMGQYQASV@J@NNXDPmBAtJXlveRLFGACFGAYf@^X@BPV@|HNPFA\\FNEEYBCnQGMDCDE\\IHFp„EFWJ@JJDGHLPBSFB@JBDGHBFR@@FHDNEjDLICGZEHGbHpCLE^BHIDDCGDCFMNE@CP@rWLDEDFFH@"],encodeOffsets:[[120859,40235]]}},{type:"Feature",id:"120112",properties:{name:"津南区",cp:[117.3958,38.9603],childNum:1},geometry:{type:"Polygon",coordinates:["@@TLv@CNHFFBHGZFETNPhCVGNGRQXKXCjBN_HIdUZChBVF\\TFECSDGVCZDRQPWdVNA^]RBBAAOQ]DSE@F_Q@[VMCSMADUECOHycI‹qMQEU}zkaŸwENRDENB@ADG@@HF@YnaAOFƒ|CDFHUHH^kVbCR^JHIFLJNGHBDNPXGRSCO^EBMNCPDHHFAFiEIHOAEH"],encodeOffsets:[[120045,39982]]}},{type:"Feature",id:"120103",properties:{name:"河西区",cp:[117.2365,39.0804],childNum:1},geometry:{type:"Polygon",coordinates:["@@d@hZNFdcLYXKRCtCMOFSYEGHEAGEDMu@SKAAsx]GMTGt"],encodeOffsets:[[119992,40041]]}},{type:"Feature",id:"120102",properties:{name:"河东区",cp:[117.2571,39.1209],childNum:1},geometry:{type:"Polygon",coordinates:["@@ZBVFFIGABEEA@KXBDOFM[EACJgˆOIE@QIMGDBHUFEEGAEHECEDGIAKQDWLKZcdQPEP@FOFBJTJ@HNORJf@DBCN"],encodeOffsets:[[120063,40098]]}},{type:"Feature",id:"120104",properties:{name:"南开区",cp:[117.1527,39.1065],childNum:1},geometry:{type:"Polygon",coordinates:["@@NMVDCG\\E^B@HlB@YEDS@C…HsNSiMGDebUXAJEjidVTAFHDFJ"],encodeOffsets:[[119940,40093]]}},{type:"Feature",id:"120105",properties:{name:"河北区",cp:[117.2145,39.1615],childNum:1},geometry:{type:"Polygon",coordinates:["@@DBXFADB@L@LFHM\\NHED@JKZRb]QMRAFCJBDCBQYADMCAe@QIMP@GSIAIPE@E[EGH@ZEF]^HJAXK@KF"],encodeOffsets:[[119980,40125]]}},{type:"Feature",id:"120106",properties:{name:"红桥区",cp:[117.1596,39.1663],childNum:1},geometry:{type:"Polygon",coordinates:["@@J\\PNHEZBFEJELEL@BWGI^]FEkA@G]A[FDHUCMNEHJ^"],encodeOffsets:[[119942,40112]]}},{type:"Feature",id:"120101",properties:{name:"和平区",cp:[117.2008,39.1189],childNum:1},geometry:{type:"Polygon",coordinates:["@@D†T@FCHG\\FFOROMEgYc@"],encodeOffsets:[[119992,40041]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/world_geo",[],function(){return{type:"FeatureCollection",offset:{x:170,y:90},features:[{type:"Feature",id:"AFG",properties:{name:"Afghanistan"},geometry:{type:"Polygon",coordinates:["@@ࡪ͇وŐǬϠڐŶӂʮǚڦ۾njƀ̚ІɣʪҴMوǯʲĹ،˒˰Nj˖ϪԈiżŬĘͺβ̈Ҕȏĝʱʪ¡ý۷ͪ˟̊ǰώĊԼϖׂ×ࢀAƬʋӧĥяƹ७ĭࣗǭӫλȤΣĪллΛ–͑ɳ̡ߛ€ͦ։՗ɅΥԕ²ԋ͡ɿ̳þٝŋğɻسDҵӇ‡܍થΓבôǝȁԇņ࠿űටіހހåզُƚßՔ˟ڢάҢιŮɲؒ΂ਸ"],encodeOffsets:[[62680,36506]]}},{type:"Feature",id:"AGO",properties:{name:"Angola"},geometry:{type:"MultiPolygon",coordinates:[["@@ȸصʌԋȘ˕͐ѯ֊æˤŠҬşŲɀɂӨԶ®ƤіHñ̡৴RfՉǞ͕ūԑÖԫ˪̷­ৃȼüκsԴŴϦ¹ĘʹĩСƨϿů̿î́ყZᦵ֤ۋպԽ໳΁᎝Š׋Ж₭—ŵÏԃϞկ~ԉƝЙDžÿՈŜ݊̂ޒªΰ˚ݶȨΆӘռːϐĘج«ӊʣ̜ɡԚȵԎ®Ǩʶͬʭ߼ǣ֚сՐĄǎΌŔʒg̎ĸៜ["],["@@ɉėɣلͼδʪƘ̀˽̩ǯƍɍλ"]],encodeOffsets:[[[16719,-6018]],[[12736,-5820]]]}},{type:"Feature",id:"ALB",properties:{name:"Albania"},geometry:{type:"Polygon",coordinates:["@@Ń˷ŢέΒȳiə˗ŧ»˙ϷСƛÐgȂү˰ñАîֶŖʼƗƂÉˌθаÂƿɨôǴɥȪďȨ̂"],encodeOffsets:[[21085,42860]]}},{type:"Feature",id:"ARE",properties:{name:"United Arab Emirates"},geometry:{type:"Polygon",coordinates:["@@Ƭ¤ŒɱڂƂ۞uԖ{ֺ֪ظՠՎԮdž˹ŖڑѕGçճƪŝϝǑE΅ʓΏuͷǝDZᡋъ͏࡚Ț"],encodeOffsets:[[52818,24828]]}},{type:"Feature",id:"ARG",properties:{name:"Argentina"},geometry:{type:"MultiPolygon",coordinates:[["@@ߗ§ѓ̔ԑx࣑@Aሞ͒ϵрؿનԋ୲ȿϙп"],["@@Ӵ؇͠ڰॠ“ƊǷ໶ോۊŷਆاࡾ͡Ŧχࠡ౧ࡒɭ़ŷڔƈނ٢ƎݐжLjфӝiڣۻҩ֟΁ॅࠃ૭ଧȽڥɣࡹT࠷ǽȇÝիËѫ੨ܙŗ׃Հν§Ч߯ઁఛ҉။ǩउĎǰԅǣػƺщԋ̏ࡱř̪͕߱ɗŜ࠳֨ʧҠˆʢѧޛʻڭԹūࡋȣ҇ߏEڃљʋؿؙࠞߦǝ˿ݭ঳Ӄձটލͧ΅Ͽ˔ࢍ֔ӡΟ¨ީƀ᎓ŒΑӪhؾ֓Ą̃̏óࢺ٤φˈՒĭьѾܔ̬૘ěӲξDŽę̈́ϵǚˢΜϛ͈ȝॺ͸Ǣƙ਀ȠࡲɤݢԊ̨ʭࠐEޚَոo۰ӒࠎDޜɓƶϭฐԬࡺÿࠀ̜ބռ߂צԺʥ͢Ǭ˔ඔࣶд̀ࢎĹɂ۬ݺશȱ"]],encodeOffsets:[[[-67072,-56524]],[[-66524,-22605]]]}},{type:"Feature",id:"ARM",properties:{name:"Armenia"},geometry:{type:"Polygon",coordinates:["@@୞ƀǨə͌ƣǛɁ҄˽ʁˋΦɫϘƏl׋̣}΃ӢHżχCʝɤǩuͧʖرȼĄФƛ̒"],encodeOffsets:[[44629,42079]]}},{type:"Feature",id:"ATF",properties:{name:"French Southern and Antarctic Lands"},geometry:{type:"Polygon",coordinates:["@@ը˃ߐĿˆDžɽϣಇÃq҂ŮΎÊǢ"],encodeOffsets:[[70590,-49792]]}},{type:"Feature",id:"AUS",properties:{name:"Australia"},geometry:{type:"MultiPolygon",coordinates:[["@@ߺ́ҜŘپNJԎÉÐঽ˽́ēگ̉ɰ׍בǧ®ԫ€ԭܘŗֈӝܸtϬռõ"],["@@̢ڇբ̈́˦ΡЖ͟đϋǴܛŸнɄĹɬܕąѥ˖֭࣬ѭצЋ֞λŋȯӔՃࣧ͜ͲȂ;ηȴźƢࢹ׬ԩϸ͋ڀڹʀڭtӏËԳА܋µݓơϵɩݡjӕǕ׻χއثЭ̫ٱ˫гʝܧ͕нɅػʼnׁªˇӕ̇व‰ޡ·ϫ͙ԕέ۟ψԥƪżѬҝǃ݁؉ܩɪӉƄӑÔ߿ʐիԮƻْțьЭ;߱ĸˢРȯزЧ׉ݝƷѮҬŶӞ͘ЬãجہܑԿ˽͏ڛٽΊ~ҀԿ،ѹ̀ǂȘઃԚןz߯Цຓāછ̝ख़˫ߡÈࢻљܯȗljѱ̳Ϳ܉qՅõݑƶ׿ğֽԁ҃ʕœуʁЗˋؕ֛Bࢽ՜ҋDŽlӖкŘƚȒ‡̠ĺאģӼѻࡖƏӒ˜ӎͭնsʚϋͰĽڄӓڔřΪτε˳ެиʑʞ͗aјеڎă˄țʦĠӠǢȸŘрęӮΎ؀Úٕ΢׀ۀˬЦΪٜ̰ϤàɴĻڎ̺ԚĤŶȀɞüҬoࢨʖҚώɊ҆ӲѐœͲvҘט܎ΠܩΦǚ̗Ј˂ТψǻĸٖҠаȮͨцƜ`ɼτĭdɂτŦОŔبϫҲӽՂMՖÿDZҦДڪϜɘſȾκӒԘ̒јıۺǂeі؛ˢ҂Ū֎ȻҀ·ۼɋʈĐԶʵӬʊ͂ñȠNJϬеɡ͉҇ͻ˿ƒĮͱʙп̗ЭÔʁڜҫ٨ˏѠ́؈ӻʂBѰɍŶʷߤ˵ֈ˼ǐҊǠόľҤʰڞŝОÔʔīӔŌنLjǠŽˬȮѾdžҦtʈ̸̾ʂЩÎՃȾķ˜Λ̨ёÚӇ‡̥"]],encodeOffsets:[[[148888,-41771]],[[147008,-14093]]]}},{type:"Feature",id:"AUT",properties:{name:"Austria"},geometry:{type:"Polygon",coordinates:["@@Û΃ӁCǎǻ˧էLJƗܽsщȏۛÞயɐȉ̊ࠧƣĭDžԗŢѕxϝƶźȴƬʪ²ьɹŤɜݎ•׸ƮЖ}ˀǣþƜšո̠ń̒ϰز˓ӀΆ̐ÚٶʱЂªϰǁãŃČ̅"],encodeOffsets:[[17388,49279]]}},{type:"Feature",id:"AZE",properties:{name:"Azerbaijan"},geometry:{type:"MultiPolygon",coordinates:[["@@ʞɣψDGŻ΄ӡֽŒщϰƃ͆Ǫv"],["@@ϊËƞɈԈͺѴѵђ׭ϺŸʸɧۗãƣٵƟ̭̍ȝvзȽ¥ԻѲ̂дʝʚ̿×যإk׌ϗƐΥɬʂˌ҃˾ǜɂ͋ƤǧɚȶƎضʍҐ¹ŘIJбҔɔŚʀ…׀ԙ"]],encodeOffsets:[[[46083,40694]],[[48511,42210]]]}},{type:"Feature",id:"BDI",properties:{name:"Burundi"},geometry:{type:"Polygon",coordinates:["@@Á০ɃϢԜßʲӎҀŸͧǸȏT˗ȹǭ͛ѫ̧̥΍Ÿ"],encodeOffsets:[[30045,-4607]]}},{type:"Feature",id:"BEL",properties:{name:"Belgium"},geometry:{type:"Polygon",coordinates:["@@؜áުǪՐοҦȝħ֧ɕĝһܿϦћßדІϷͶϷ`ũ̒ڪǔ"],encodeOffsets:[[3395,52579]]}},{type:"Feature",id:"BEN",properties:{name:"Benin"},geometry:{type:"Polygon",coordinates:["@@ۛįȹ׆žኞǛǦЮ̇̌ʱʞņѶ̀ĨǠξЪĀȀʤˮʘ̠F٘ә˩ȎӽǓͷĘɧСԳʵʳǁՉt՗µണ"],encodeOffsets:[[2757,6410]]}},{type:"Feature",id:"BFA",properties:{name:"Burkina Faso"},geometry:{type:"Polygon",coordinates:["@@ֹɐϽ‹̍Ƀϗǰƥ˦ϙǾÅӦɮΤo˴ښۢŬּɲȴОœΚǢŘɎٴϖdžˀ޼ΒҦŢɀLJՠJáСŔϣӀչ€НॺȏmֻǿʣЩÿǟν˿ħ݁lϳâ˓ƉωÖร¡qӉŘم"],encodeOffsets:[[-2895,9874]]}},{type:"Feature",id:"BGD",properties:{name:"Bangladesh"},geometry:{type:"Polygon",coordinates:["@@i׽̉ŶÆگʉѬµєDžКΕӨޟ’ü΋˃ҳΧǠũƵʃĠ͗øŽۖ̅لƜԒԫɤȆ̪Հ̼؅Ѽ֮̔ږεВ£ô׏ߞřު^Ӟƛϯ܅ϕµʷӍҢѥƎ՞ɶFѶ೯"],encodeOffsets:[[94897,22571]]}},{type:"Feature",id:"BGR",properties:{name:"Bulgaria"},geometry:{type:"Polygon",coordinates:["@@ʎΉ͚Ö٦ſ௾«иɌবȜ̩ؒӴĕѥΏ̫׹˔ӏܣŒࡥ˃Uлޅÿס̊ڧɱة|Ñ֊сːƒŢĝĴƘˌ͌ˀСδ÷̬ȸȐ"],encodeOffsets:[[23201,45297]]}},{type:"Feature",id:"BHS",properties:{name:"The Bahamas"},geometry:{type:"MultiPolygon",coordinates:[["@@ȵ£ɇӜ̿ʐǾՔʨ‘ۣ̎Jӥ"],["@@ࣷƅÏ̴Ђäֈ{~ɕ"],["@@ƟׯƷņ`ѮϓͪCĪڐϗ"]],encodeOffsets:[[[-79395,24330]],[[-79687,27218]],[[-78848,27229]]]}},{type:"Feature",id:"BIH",properties:{name:"Bosnia and Herzegovina"},geometry:{type:"Polygon",coordinates:["@@̦FȿσМ͓ūЃȡ™ƽû˙țūҥݓ͈ͅΘ͋Ȅϭ̾ǻʺЩϾǬΒ̞ȕǼǨϾnܠƓ׈\\Ϟȅ"],encodeOffsets:[[19462,45937]]}},{type:"Feature",id:"BLR",properties:{name:"Belarus"},geometry:{type:"Polygon",coordinates:["@@߼Mࣰ̈́ȚӄېːÿϔԜƚ͖ࣘࢮɁŢȻѲĴࠒȧĊЁǷɧՄս΂Ƴ»Ʊ֦Ʃʎɡ͝ǿڳˆljÿȠ˧ȸ՝ܝ¹ʵȁÃхͭĆݷ¡əȞ̿ƥ́ŨڍjफȬࡕàٱmҡɩГeϐʷϴԌǢLͰɷ͌™ϊ"],encodeOffsets:[[24048,55207]]}},{type:"Feature",id:"BLZ",properties:{name:"Belize"},geometry:{type:"Polygon",coordinates:["@@OŮĸžƴı̞ԔDŽZHūDŽGaɭƋεôŻĕ̝ÀăīщǓɟƱǓ̅ʣ@àॆPژ"],encodeOffsets:[[-91282,18236]]}},{type:"Feature",id:"BMU",properties:{name:"Bermuda"},geometry:{type:"Polygon",coordinates:["@@OEMA]NOGNG\\Q^McMOI_OK@CQSGa@WNLVWHFLJXVFGJ`ZRTDLeeWKIHGIK@@[MQNi`]VDTBHCJAPBJLVFjT^LV\\RJZRn^RH`TfJjZHHOTTFJP_NOX[EYQQKMEJOLANJH@HQHAARF@ZEPS[U_IcRQXE@EEKKOCGGCQCOGISKYGUC"],encodeOffsets:[[-66334,33083]]}},{type:"Feature",id:"BOL",properties:{name:"Bolivia"},geometry:{type:"Polygon",coordinates:["@@य़”͟گӳ؈વȲ۫ݹ؅ŗ͡୆ҋऺˆ߾ѳ΢ŏ؆ЫֲՌ࣢αۺȖ˰ƭ̶͠рh܎¤נǸ˶ܩഠزíѠnȈʪ݀;Ѷ͂સƚęؽļ͓ãࣰ֛ݫऴƑ̻ͦ֨ǕΐʑՈTӦʟšӟǐʕZγʓa͒এྖ“ūӟĜͧҞɽȤԹƫڋɯρĄӏʿǥaʶ޳јޭ^ัʓЕ݋sҋͥ৕ƉǸ"],encodeOffsets:[[-64354,-22563]]}},{type:"Feature",id:"BRA",properties:{name:"Brazil"},geometry:{type:"Polygon",coordinates:["@@૮ନॆࠄ֠΂ۼҪjڤуӞеLJǒӜŖӼBҦ̡ƴ̿Ƌ̻œį͔ýޔƿʤ֥ɪ΃ǏࢱLjÈଜʝҴˀǦăӐɰςƬڌȣԺҝɾěͨŬӠྕ”͑ঐʔbYδǏʖ™ӠӥʠՇSΏʒ֧ǖ̼ͥळƒ࣯ݬä֜Ļ͔Ěؾષƙѵ́ܿͽȇʩџmرîӃƟϡĪÈ౨ۏӷݏv҄ͅ֏¶DzΰұԞΓݴɜƶA΢ԖʎċҔɊ̈Ôϼ०ֲێNJŔŴݴŸϚᘰpθſӔύ̬LؐӀƒǚē†͐ӯĔYՀ࿖k˦̂ɸˉǐӷǂļҨѻٸÆnjʲشȞΊƐĮΤ׸ʆ¯Ǯ܅ðśՊ’֞ϓɒǀþجŅڜȿʐȤ؀žल̮͎̾ŏʂѪšȜȗʼnσ̀ŵȖϷɷ̏ƅ܏ɌыÔϳԬϿЮ¥Ģǒˆ˜ϠƦ˚ɢҬíȲŠҚçøǢƗǘĎʐͺõЈĒӔDZξǥʺɪȊ•ŘɿДÒ͒͊ʴؤӼޒ˺¢ȺҫҼ฽҈Ƒxׅمەʾʩ๤ƁŠࡃٔր੐̟ඊԡШӱƏҫ঎ʶ࿐ѹఴŽఔ۝੸व٪ʏܖ‘̦˅˸੭Ɣԗͯ൹ёշஅୡՙोثܯȿgɻءÒ༽ɹಓęօˇͧƫ૱࡛઱ƛࢁڹηȟԋ࣯Fೕ͓סύवʗ঩ڝ܅࠯ũطƔҫƽࡓȏЧחҥट๕݉ڗ֯Ͻϥߛ։ӑɷӈψЊӟֲڇҬࡹՠ̹{ࡅٰձę"],encodeOffsets:[[-59008,-30941]]}},{type:"Feature",id:"BRN",properties:{name:"Brunei"},geometry:{type:"Polygon",coordinates:["@@ͬ̾܎Ң›Я·՛Б€ǭ˹ϥѦ"],encodeOffsets:[[116945,4635]]}},{type:"Feature",id:"BTN",properties:{name:"Bhutan"},geometry:{type:"Polygon",coordinates:["@@΂ˍÏԩۇ{ۿÈՇſޅ͊kǚ֌زҒɈ׸șѺqπɥ"],encodeOffsets:[[93898,28439]]}},{type:"Feature",id:"BWA",properties:{name:"Botswana"},geometry:{type:"Polygon",coordinates:["@@ǜƭ˄ӡॎइήĝD̑ʚՑٰŹ՚ϝ஑أݭع˩֓ʧ́ҙãƧГďʽ՝țہ¤БɾΟĸХșȵГЉʧпϑ׻đȇ̐üԠӽߚɧŲAរࠤˆ|Ჾش„ಖ͎̎΍՜ͤʮDӂȎưÙ͔ڣ"],encodeOffsets:[[26265,-18980]]}},{type:"Feature",id:"CAF",properties:{name:"Central African Republic"},geometry:{type:"Polygon",coordinates:["@@ۜÚƺɎƔgȾȏ੔͐Τ͠Ѭ̌ĉ̐ʂüߺ½߆ϴ؊ࣺю;ՐƜĪΫӜԿF΃ƋΓÄʻ̆ʍٖοҢͻT˗֠ѫΖεɆԋغͩƊˉˣęաpكĘ̹ïųȱ˕}ͧDzधнϥĎŗÝʥԕطǐؙĊ՗̴ۓ˸҉˓͛яùדգ²֩Ƙԅѻѯޱėʐ›Ϧϧ˔̳Ѡï̠ЇѮæʢċΞÞٴȬƴц࡜"],encodeOffsets:[[15647,7601]]}},{type:"Feature",id:"CAN",properties:{name:"Canada"},geometry:{type:"MultiPolygon",coordinates:[["@@؎œުxЯ΅̵Å੥Φȿˬ͆ʸ̎С"],["@@Хcઝ˂ޯІ̄î૆Ɂ࡮Η|Ʒ"],["@@хŝൡϢʥ̘ݩ̌Ưʈࡻư͕ҜðȚࢨǿԨŵ߄ė˺̃дЋ࠼΍Όҩ"],["@@։ܿո˴֠ǵ̏̉ݚɱϰȴ࠼ʵʹ؛טƞņѿʼԷΝ݉ϝ‹փǂǾیɻńইܯԅ†צЂ߫Ȳࣙ¹࿅~ŹʠԼ̐λɬ۸Ԓࢄ೾Զӎܲ̂϶™Njɫ҅Չ"],["@@@@@@@@߰äʥ॓ܶگͯDԑϪ̵ϮчʾƻτºˎЂŋ"],["@@͡ѳχîəʢ Î͖ʦΆkɈǣ"],["@@ঝҧץnǿɪزϲ଼SiǍ"],["@@ƼυјżӨɗं˽४ʽöЍؤÞ׶˥ݙ˃ಳȬҽϚ࠭ҁ஡ѣ˿Ӯଗăܴдņڌ˺ޔ؈å"],["@@ष¥ȿЪΦҼޖŜپɷXέħřձʛ"],["@@Է̍ଉʬۃğଫϘ݊ʼטζࢼʃԎƯʦDžԠ͍"],["@@G࡭૰ڄ৐եʡح߾֥࢚؈ؖܨ°ईஞÝఔūૼй¼зس҃פ҇ŃУ࿩חୡŻࢃʨʣуߵ۽ʓοই֩ளÇڏΡÇձ঍Ŀਉڻ࣭ु͙ڏ±উంƕϜ޻ϼّ୲ǔ༞εࡀ͋׺Ѕ੆ɳࢸΟ൶µࣴąƍܫʼࡋ،ळనߗ٨˚ҔࡺѭೢףѶഎЀ॒לҮהç֭֘܌৷لলࢤνݾ˫ಾגȘ෸ɫࡸć۠ɚ޴˵ਚӣʮ͙ຄÛ}۷˪ਜ਼ގſ،ӵ௖Ұߦऔ֌ϸٺݣબੳघ৙͵Յ૤Ӂݰӓംɏբˍͬ܃ټŏͶͅÖऻ؍́׽̏൯̗੏ۑ෇ƋᅛǮుPࢇÍ۱׽ੳω௉૗ॵޡ܌Ɛഘૄᄈ۪సČݔЫߍ֟ˊࣟ˜هતп൸ŨࡆीÎ؍ժ̥ਣսᇷԁ࠯ͽय؁ٓ֍܆ฤ۞഍ƒणĹջӆBନύʐ֛ƛ˧ɚٙىʱٹ̕ϡΥŽˏ¥čȹ໽A౥MϛƷࢵ؃Ŀßˍ͝ޗBࠛGϛƅƊǑøʯeďષлࡽſউ҅Ɂ@˷ƂĥŦnĔȂ̎ЂҦʘӺǙܴǵނ࢕ЂľƬūĺɳ@ǛƆ¥ȤǍēɥ€¾ĊȡĊćɚٵːڹ˪ࠑ͘߁̨ݧʃ˝Sਕɔڻʼnࠁʺ࡫Ɔו¾ʻƜƫҤ˳IE͓჏BᮝA᭯@ᡃ@ᠿ@៙@ᢡ@ࠛ@᠁@ᛷ@őF྽ࠜ׵δຽΐҳݖŤԨ੻ΨƧڴ৭؎iѠҲКwՌෙ՘࡭ॠՁ׾ޑϚ֣ΈѿѢࡇ˕ࠇҹݛւדπࠋɸࠟ|JⷎNᷲ༬ȭ೘Й࢘û݆ΖৰˀఢĹ఼τ൘Ⱦ־ΑظȠȊЄ׈ęෆݫ૦֬ŖّਔƐ͆ʖৰ·౼Λዸ̭ୄƛࠖÄଊэ஁зຶǷᗘIJܒƦࣆԋࣴьࡩΦժ˼৾žڦĎڴȩࡊҗरä๢ϛಬƄ௬oĭԺݞƦದ˵KߑՖڠڰuϞࡊ࣑԰কͺäघশ؎ૌƇࡘχଞॅݗЭ༠ǝ"],["@@нϿሎʬୠщॊіސ˟یࠛфΒ׭ࡰ݊Ŭ࠲Ƈश͹ՆࠉʼץථеະЉĝσൡã՚͓˱ູ̯Ƃฃɪঋ»ཅ˷ᒃű๻āҕІଫɮݙģਛږ֔ĚಘƜஈ›રƦྷȞᅗã஗jѷ̴ዎͲಗ[ืɚ۶ـגͮᖬԠ࡬Nj"],["@@݉ևಹך˸Ş૸’ٔȁ"],["@@öɵࢿ|ࣟjࣿőʑ¼ऍѾ˜̠ИÈነěชң"],["@@ڎԽޤڴᒆΈ෺ࢅůջဒʒߒͮሀыୄЏŊν༚Ȑ࢘՗᎐ܸͩ͹ߐ޻໯ϹጘչೲȁீޙೖÇʽכ้ঋਗά೓߲ઙĿŁӕࢪӥଜϯΌɟմࠩ́׿੕ɪᑏڨஎܣ࢔ԕƎ̉ᗱͲᅩӤ৳Ц̌ʂయќ௥Т`ʑᝡƅ܃˾ֆؤ཈dႸņ˫̜̊оચࠊɳϊ͕˾౿Рၳ˺՞ɆࢷԺ݋´ڏ˸҇ʛ຿ŅᵝȈᄫʚഹŴۥ̐࢞Ϧ஝Hˉ࡚٦ݨࡺ΄ᓪɢأի"],["@@৊ǯຄńɖʑ޷Е౜αƱݳ൝͗߳ê׉͎ᐡٮjˎ႖ĽएռসР"],["@@࣓عय़ŒԽ݆`кѮΨ࠰ɮც‡ྈȱళݟ৉Ǎ"],["@@ᕍЙѷςኹѺήΤ׌ؘܰւࠑԦᭊƀ஬ǧᒰ±ࠄʑࣖΝ੍ɃᏝןਫי@ν"],["@@ҙ͙௝Øৱɖ҂Ϛீɨܼ̬̍ˇ"],["@@ٞϵ€љϣس൱đࣗƈjӬ൝ÝÁٮࣜౌ˺ஂµÜŎ"],["@@̙͢ݠƘࢢ™ƪЩԝЋ᭗Žᑯη౩mŅ˜პϊ④ij୯Ʈପࠐ߈ɾᛄ˳๶ӻฺÛறߨޔ̪ࢄĭ˲Џ"],["@@ढ˓ကFܨˡȑ́८ȍՔȧଊ™௬ë೸ǼႊðീÏ࣒ͅȊ΍ԽɟభǷ੽ĸᜱŻႫcഫļᖁ˔̃ҦĹжࡇξ჋ĺঅʼ͂ΈႾÁ"],["@@ŗ٣٩̇޹£༝Ϋ഍ŹଗǼ@@ුؼႮծಆ[ସŬ"],["@@ϣy༽Âɡɼၜ]מƻĵĩ"],["@@༩ʋఝ˔ڼˎ௮Đஈſ˩ʥ"],["@@৽ǏඉBbŤࡴʦҌદǝ"],["@@కǥۃȚέ͂áΎજ‘ӪÅ৐̇ɫ̣"],["@@͜Ε൏Ĥ൩˘ሏŒߺʠ৫ȮÕ͐࿶ŕᗢ̫ٞЍ"],["@@০˕ଽʟ༇ك๥Óდņࣗ΄^̦ڔɢ໡Oए˨ՑϠ׌ώ׊ʲࡴÎοȖዜ¨੶҅මǵ൞ǃڒև"],["@@ᖢßᅮŅ໤ɫ™ɡᏅη᎙ǟݻȉᆬJጡԙേʃ෯ۇႿƓՙǡᡷěୈĿׇƭ۞бߙ˽ಛʃЋ͡୫ʣŞȏ෬lȳᖟԋᔧɴឿŻధĸཟªĿЖ༊Ȑб؆ԢÐᖤγ଩բഹLjڼ͘๰Ȩʄ̊஋͠ΥѠᘞ—ڒĝ಼̪ቃĬ᰽Á๣˸۩ͼগʘȁ˺దLjঘ‚࿲ƌం̺ਬ©ࣤɽٔҒૐƈບĢᢲ–Ҁĝ᝚ƚᆔÁᆒÁ"]],encodeOffsets:[[[-65192,47668]],[[-63289,50284]],[[-126474,49675]],[[-57481,51904]],[[-135895,55337]],[[-81168,63651]],[[-83863,64216]],[[-87205,67234]],[[-77686,68761]],[[-97943,70767]],[[-92720,71166]],[[-116907,74877]],[[-107008,75183]],[[-78172,74858]],[[-88639,74914]],[[-102764,75617]],[[-95433,74519]],[[-123351,73097]],[[-95859,76780]],[[-100864,78562]],[[-110808,78031]],[[-96956,78949]],[[-118987,79509]],[[-96092,79381]],[[-112831,79562]],[[-112295,80489]],[[-98130,79931]],[[-102461,80205]],[[-89108,81572]],[[-70144,85101]]]}},{type:"Feature",id:"CHE",properties:{name:"Switzerland"},geometry:{type:"Polygon",coordinates:["@@ƫŹȳϞƵіwá΅χƙةŀǻ͹ЏơƄһ˵Л¡αǶ˽ςБſ^ϠؚҾɈϤûɲƞ܎MǦǼ࣒ʱ"],encodeOffsets:[[9825,48666]]}},{type:"Feature",id:"CHL",properties:{name:"Chile"},geometry:{type:"MultiPolygon",coordinates:[["@@Bም࣒@Ԓw˧ͻܛʻЭ‚ӻä؏ʨ࢟ŨੑҸ࡫Ҏୃशۘǭ୼֗૜̟ѢϬ˘ֺޠΎװı"],["@@͢୅؆ŘĺɁ˿ࢍࣵг€ඓǫ˓ʦ͡ץԹջ߁̛ރĀ߿ԫࡹϮฏɔƵCޛӑࠍpۯٍշFޙʮࠏԉ̧ɣݡȟࡱƚ৿ͷǡȞॹϜ͇ˡΛ϶ǙĚ̓νǃĜӱ̫૗ѽܓĮыˇՑ٣υôࢹ̧̐֔ÄgؽΒө᎔őުſݝPЙȷݷ̣Ɖ޹Σoॅ˚१ג@@ਲ਼ӔˁՒʄӰх֒Ņ෤Φ߰ࢴٰౣʔߞݒ˸ඊत̏Ѯგ֝ɠʿ਻ՉŠ˂ல˺༒ϮָʍࠎéूΠ„Ԩപ׈എΤబȗ఼ʤۚĵਞӮਆưྺ˒ნˀሤÕ൘ǩ஄ќɌɦњЬֱŐ؅ѴΡ˅߽Ҍह"]],encodeOffsets:[[[-70281,-53899]],[[-69857,-22010]]]}},{type:"Feature",id:"CHN",properties:{name:"China"},geometry:{type:"MultiPolygon",coordinates:[["@@ԑഓΫۏѷ܂ĩخӶࠜڦَϨʡƣԓ","@@ܩЗۏʺyܢаϠࣾɾӚoȊ͍σσșӟ"],["@@ฬˍ঺ׯͼ߃౨Cܰͨ൸ʜѳݱ͙̭˽ः֡ࠇ৵ƪܝ̑ɜܙť঳ѕwLяթӺͯһಙαƀѹܩŒЍ˂ֽ׭ऑҋۃա୭ʑأϽࣝɭ҂ϴǭ͞ږ֠ѹѲܷ̓ॉ׏ԫթ࠙¡ѓϻѸ֩یƏ„ϕڔʕस׶ݚ͝լuƌѱஓɻϻҏࠇућיࣜҥͦࠝԞޓ֮٥_دՅɯȪ҃ӶʻŻۃɇڗҷ÷ؗࣧڹિޭোିޡୟۻृĩԣύ̃˘Ӈй୭сࢵŹ˻ࢱҭ·ə؎Ȧ͘ૻːЇƍࡍɔЏ΀ƄӜޏƶЙܑ̀҃ࠇīڡJ҉ȳѥūŶ॥҃x÷Ȣ}Ύ؝ʓεƸر͂ʔۤՏǎȧޜࢱƓĴাߔۮ”ۚ{٠νȨ˭ӶӭÙࣟŲ˴ΜϿԺ׳Ν۵ȸॷ՗އسڳĿοɦѹr׷Țґɇ֋رëڌԟǭওĈोȖڿτٵǔ˯ЖҽŦࡓոکʴΑȩଢ଼טࠛՒɽऐ׾ő‚іͭјĐۆࣙঠ൧ͼʝ٦ةϼƫʌųӎˆ͜ԛȔ˟ďɇިʈȔśȠߤЈ׈ǐࢸő͆՜ંIJͮ̚೜ҔŠȐãӐּɔݱฦဘͲјȈ؆ຒဠˡҲϞ¢ࡆۦĀٖ֔͢èɚו۸ѽப̿׆ڱ͕ঙ̢ηূƝଆŝ৪ԻԲġϤޟӲӿऒnჄȉ૤Ŝࠦůఔԛ৮BόʽঐҌബ̈ాŒঘ̒׾҈ך˰Ƌˤˍ͔ѴըӀùࡺǝ࠸Ѿ౲͚؞֊נʆ௠ŐڐĥĠ̘ݿזګː٥̳ࠣžӇŃɏΆר࠾Цو৚̓ஆՎQτݸࢾҲːWҪңȦۜмਰƲ૜vసʡ݈̱԰ࡏ̀α̊ԩ̶ࠕ"]],encodeOffsets:[[[124701,24980],[112988,19127]],[[130722,50955]]]}},{type:"Feature",id:"CIV",properties:{name:"Ivory Coast"},geometry:{type:"Polygon",coordinates:["@@ϣUוǒ՟Wহƥ׍ʍ̯ࠫNjvÞۖĄŀ}ͨΣΚˉÈʕɲǾώčО ʔƄB¸ξÝnjĄŜ̸ĶȹڨȗΎæ˸ǘÞŊúɸųٮOƸʖƢgʎĦžΫȞłΌŰϚǽƦ˥Ϙǯ̎ɄϾŒֺɏɠ஡Ο۷ɕेθܣ›ͧ"],encodeOffsets:[[-2924,5115]]}},{type:"Feature",id:"CMR",properties:{name:"Cameroon"},geometry:{type:"Polygon",coordinates:["@@Ľ°ӻŇԝŒЋÅ൅nŬڒ͟֊ϧƚǟϖɋŦXɶɎתЎ߸ʒRԄӮ͈bҾΉ־˲ĀΔȌͺžь҆ΊǞךDzȊŢѨɜ՚۾ٲ¬˨ĠƲͫͰ‚ˌʂ¶ͮ՟Ê֏‹֏ҜޅҷTʁÏϥČǻЅӸөμƛŠΏˆ׃ſɩх࡛ȫƳÝٳČΝåʡЈѭð̴̟џϨ˓œϥĘʏÓґڛȤڷɜ੗"],encodeOffsets:[[13390,2322]]}},{type:"Feature",id:"COD",properties:{name:"Democratic Republic of the Congo"},geometry:{type:"Polygon",coordinates:["@@»ঙͶŕˑ̗͓ɟ͍ѫǯϷ±ګț͍Oهʍɹ‹ԃŗÝýҟɄϡÂ৥ưޝċѧǘӣӤҹҒ੕ͥĒ૿ƙɣĵʇՙȊχƫষĻࡇɨƫט͝ɲƴìٟࣟR·Ҧ̳ΨٟŠȋѰԣ˅ڧŞ˫ϢՕüϽqµʾ́rϥºԳųιtȻû®ৄ˩̸ÕԬŬԒǝ͖eՊ৳Qò̢ѕG­ƣԵɁӧűȿҫŠˣş։å͏Ѱȗ˖ʋԌȷض៛\\̍ķʑh΋œşʼɊʀμƎɎ̪ǰɚđ˼͐ҜSÄʃ̼ƩӶՄӨШɆːƒ۔θࠆϬўքМĪˌt̰Ǝ̆«ӊŀݖǐԾʦ҈¸Ԕúה͜ѐҊ˔۔˷՘ؚ̳ĉظǏʦԖŘÞϦčनоͨDZ˖~ŴȲ̺ðلėբoˤĚԘۙϘķɤƖϲÅҶDzȦΫ݊֏"],encodeOffsets:[[31574,3594]]}},{type:"Feature",id:"COG",properties:{name:"Republic of the Congo"},geometry:{type:"Polygon",coordinates:["@@̿˾ʩƗͻγۏࢸٖҪ̓֌˾ɂ֦ĺäό҆Зݐ•ʴЈł֒ĝڀЉӺζ঄ȽǘسçɻѢÔξ੘ڸɛڜȣÔҒѰ޲ԆѼ֪Ɨդ±·ԓʥ҇ǏԽĿݕ¬Ӊƍ̅s̯ĩˋփЛϫѝηࠅ„ۓɅˏӧЧӵՃ̻ƪÃʄқT˻͏əĒ"],encodeOffsets:[[13308,-4895]]}},{type:"Feature",id:"COL",properties:{name:"Colombia"},geometry:{type:"Polygon",coordinates:["@@ΫȤЭ˨ʅƅ܉Ŝȱΰƽ_࠿Ӓŕʺ̼ڛтȢ̦иÊΞՆ͐Ѵ̳ȦDŽӦȏސǸɚƃ܄ͻ҄ņТ˔ÑǂʠțӶĺŬѢـהΌĚT˦ƺ܂ӖϸՊfäǪڂéڌъ͞ȊОК̖»ɚɛǍ˱գƕɇп͗ʋʓ̷Ĺ׵ɷӭѢÇņϭȄȁâ͹ij̵ˆǫȸéȨ̉ઊĄӦŃעܡͼĚ؂­ӐĪ̔ƟƱҍȇ˯ß׻ǜ֑ʆʟ†ȉэл̨ȃɠ̋ʰ࠹ǁĻǏӸɷˊ˥́࿕lZԿӰē…͏ǙĔҿƑK؏ώ̫ƀӓoηϙᘯп҂ʣpժࡤٟϾԍị̈ƤҧɝصŀӵࢤϳɐˍІ֑Њɡā"],encodeOffsets:[[-77182,-155]]}},{type:"Feature",id:"CRI",properties:{name:"Costa Rica"},geometry:{type:"Polygon",coordinates:["@@җȆǟǮĬƤ‰ȄɷȪͥǔ́ņÅʖəƮÄʑǗȩȓɸˑĊŗǞLʮŎˆʁŠȖnjŴňֆɝȖŊˊéƔǥʜÇȪDzɈҙ͖ͷЂΩ͗õLͷǪűűıƱëǟ©Ǖ"],encodeOffsets:[[-84956,8423]]}},{type:"Feature",id:"CUB",properties:{name:"Cuba"},geometry:{type:"Polygon",coordinates:["@@ܨÑڊW߄˹̭ͮ޺Ĩ̔ȡ܈ԳԺϛˢ\\ԆǟÕʁئ“ٌ΅ıȟ֑Ń֡¥׃âளą֜Ҷ΁ɔէÈ̃ʐȥӎӃ޵ɦʥǬભž̋ǐ̀ɀࠗ¨׿ѧΏ[ťȳеğΫĂѺʸǼ̤ϞȈіǎَĄȰĢ"],encodeOffsets:[[-84242,23746]]}},{type:"Feature",id:"-99",properties:{name:"Northern Cyprus"},geometry:{type:"Polygon",coordinates:["@@ÐJŨȮ؄Yކʢ֧ΧÔƿęˆLJÙűj¥iĎѾNjVɫïƿ¬"],encodeOffsets:[[33518,35984]]}},{type:"Feature",id:"CYP",properties:{name:"Cyprus"},geometry:{type:"Polygon",coordinates:["@@€ãࡱͿЩŊȟͶЎŒǀ«ɬðnjUÒ½j覎ŲiLjÚ̇"],encodeOffsets:[[34789,35900]]}},{type:"Feature",id:"CZE",properties:{name:"Czech Republic"},geometry:{type:"Polygon",coordinates:["@@ϯǂЁ©ٵʲ̏Ùҿ΅ر˔ӃΰѕȬėΠƧʠؒǾ̸Ⱦ׾ǎɂdžɜīϒĖЊ˓ؼñ¿ɳҘǧŲɒּĥĄʿز»ϮЯʡCŽƯȕ—ÅȑLJ¡wý˹ēϋbšȁ"],encodeOffsets:[[17368,49764]]}},{type:"Feature",id:"DEU",properties:{name:"Germany"},geometry:{type:"Polygon",coordinates:["@@d͗ࡔțS̗ࡢǂҾɰॊͧІˋȞёɹɣ̨̙Ⱥ҅ß́Έ՛ϑĕɛĬɁDž׽Ǎ̷ȽؑǽƨʟĘΟіȫӄί̑ϯ̟ŃŢշýƛʿǤЕ~׷ƭݍ–ţɛыɺʩ±࣑ʲǥǻ܍Nń״ьֺ௅ƸЇɘ´ςǗȐĨ֨ƗࢢԎ@Ɉ͂Ⱦޔƿ˴ǐDz۰°Ƽȃ֮вȓ̀ӈٌōՠŸ"],encodeOffsets:[[10161,56303]]}},{type:"Feature",id:"DJI",properties:{name:"Djibouti"},geometry:{type:"Polygon",coordinates:["@@ȤʹΑӏȩήɯ̱҇ȅƬȭÏҷb_ʮßɶ˴Ѐ̐ϊήñʪȴ"],encodeOffsets:[[44116,13005]]}},{type:"Feature",id:"DNK",properties:{name:"Denmark"},geometry:{type:"MultiPolygon",coordinates:[["@@ԋڹ࢟ӄŝΒ௼˨ˎу"],["@@ȵ̓ʡĞ؁؁ɮХ՟ŷًŎͽҲ}࡬Ɣɪʌʦ݌À̐ɴڮʂƒѝʟ˙ĶɽҘŵ"]],encodeOffsets:[[[12995,56945]],[[11175,57814]]]}},{type:"Feature",id:"DOM",properties:{name:"Dominican Republic"},geometry:{type:"Polygon",coordinates:["@@ŀƞپIӾɏɜtƴ̕Ҡhʡϐ‰Ю̷̯ͿЍǼϫ•ˡ¢ƱƵ͑½ŷȲˣťͳֻɏƆ§ʎjɬɍʦȲƚÞ͒óҜ"],encodeOffsets:[[-73433,20188]]}},{type:"Feature",id:"DZA",properties:{name:"Algeria"},geometry:{type:"Polygon",coordinates:["@@ᮩཽᝩ࿷இϑटćU՘ϵƌԹʊȧЀᬻᆴᬻᆴṕᎠfnj@ÊQ঺ബب࠼Ÿێɦ͎тচͪ˜جӢòϞ̶સƚƸ͜ɛDz̃ࢲ¹Ԟ́ՠ߰ҠࣦƢՌΎ߶ʰ෎Ƭർæшůߊͨ࣌P΀ȝֺ¾ǟћƄߟȡۙԭҵôمۊԃRȯԮ͹Ϊຝ˖ݏ°ϵƧۇÔϥŃҟòՇͫΗӺؓŽέ̘ҵϼƸڒϷςՃ"],encodeOffsets:[[12288,24035]]}},{type:"Feature",id:"ECU",properties:{name:"Ecuador"},geometry:{type:"Polygon",coordinates:["@@҂غǻξ͍ϵԉςǞʀƙބ̎ŴƺԼ͆զÍ΄ҢǸ׀Ͱࡀӑƾ`Ȳί܊śʆƆЮ˧άȣŞٓʽճࣷ࢟য়ͧԥܵǃ֣Ӆ΋ΙъͻĞ΍áw̮ʈȨıΔ"],encodeOffsets:[[-82229,-3486]]}},{type:"Feature",id:"EGY",properties:{name:"Egypt"},geometry:{type:"Polygon",coordinates:["@@ɽͷǹىɫѩȝƥ˩˔ϛϒ׵ஸđùΐࢯԪࡋٌವ̴ҙ˒ӃݮछǗƣ‚ճ঒ݭƨǣΏ@Ὁ@⁩@@ᶶ@Ჴʥڲɐ԰Żά̤Ж૦b߲ɝ࠲ʛϴſ٨ˊΌʊݎêװŃɮеȜ˜ڨȣټ³аɄւ෽"],encodeOffsets:[[35761,30210]]}},{type:"Feature",id:"ERI",properties:{name:"Eritrea"},geometry:{type:"Polygon",coordinates:["@@˻˖ΉӰϋ˒ɏܷ̄ͶֻXȭǬӯȡԛϢʽط঑ǬęʹβఀĊ֒ˆʴؤƐьӒӦঃɴޗҢУବߏҲӍҖӝˀ˿аʧʩȳέò"],encodeOffsets:[[43368,12844]]}},{type:"Feature",id:"ESP",properties:{name:"Spain"},geometry:{type:"Polygon",coordinates:["@@¦״΃θஒ؆ਊƱ૾NࣂƝۦªമƒͰ͛໺ϡ̨ǺीϝআŊ®ӥߓ֓ઁǯõ˱ԩү͕ہ͞ӑӟϑǹճىǗש٥੧_ߟhՃ͍̓ͅЩê̵˴ʃӚ޷žé˦̶̀Śɬ̃ʢɶրͳԌδè’ЈƎŬZپϲɪɻфөˆƝŁӹCɁЬ΃ū̥ɇ"],encodeOffsets:[[-9251,42886]]}},{type:"Feature",id:"EST",properties:{name:"Estonia"},geometry:{type:"Polygon",coordinates:["@@ĮӸ̱ŁՓ̘ñӘਫ਼ɼ੔Ũ࣮Ƒࢂ|Ŵƣׯӝʞ޵ΫˉۙDܡ̸ρļ܏Ʃ"],encodeOffsets:[[24897,59181]]}},{type:"Feature",id:"ETH",properties:{name:"Ethiopia"},geometry:{type:"Polygon",coordinates:["@@ԜϡӰȢȮǫּWܸ͵ɐ̃όˑΊӯ˼˕̏ω˳Ͽàɵ`ʭҸaȮÐȆƫǽ̴̕ҧ̴Й̛͎ᩨঽۺNᛛᡃફ™ݟףաeɯ˅ַB͹˴ލΙʝΓ֕àȃĬȟwˇT੟܌ב@˹ˢ@ҾѧƘӻࣴϥȚƧʹэЦԧÒ˸ӐҀrŲʰ[ݲʞࢠЊɾĎ΄ήٜԔи΀ࠠƆܠ঒ǫʾظ"],encodeOffsets:[[38816,15319]]}},{type:"Feature",id:"FIN",properties:{name:"Finland"},geometry:{type:"Polygon",coordinates:["@@ūיಀ֓ޡى঎ख़֡ܛݴس΅յఘֻ́ѓޭӟᅡੵໃá๑̯ൃǯӡҞ߿ˠȈࠢСݶАӪނՆ኎࣮֖Ǭē΢ୟЈ˳͜uಒ಻ֲ૩ЪԊɞतѻલ¦ࣘȭߠϊЬ؞ಬ˶઄ͯΡכ"],encodeOffsets:[[29279,70723]]}},{type:"Feature",id:"FJI",properties:{name:"Fiji"},geometry:{type:"MultiPolygon",coordinates:[["@@̂ʍƓѭԳŗҩļąτ͖̀ϤĻȼƐ"],["@@՛ǯŅ̼оǤˊ°Ӱˀ@ЧՕȷ"],["@@é­@ШǨžĽЗ"]],encodeOffsets:[[[182655,-17756]],[[183669,-17204]],[[-184235,-16897]]]}},{type:"Feature",id:"FLK",properties:{name:"Falkland Islands"},geometry:{type:"Polygon",coordinates:["@@৘Ԍ܎ȿԌʹڦϙʥ̋ଋʥϙ̌܋ϙпϚ"],encodeOffsets:[[-62668,-53094]]}},{type:"Feature",id:"FRA",properties:{name:"France"},geometry:{type:"MultiPolygon",coordinates:[["@@ˣ٭ϡǠș֢ǜ̺ը͎Ɯܛ"],["@@הЅќà݀ϥȊñʎjЈɗெƷыֹŃ׳ɱƝϣü‚ɇؙҽ]ϟВƀ˾ρ“ʁʚ̿̅ʯɐٱҖŃĩηݿӅစɬ௧˗ĩԑঅʼnिϞ̧ǹ໹Ϣͯ͜ѢԎdžူࢁࢤإю౹͒čؖઠǾථɏˇॎߌέዠپʨێܾǞŪ̑ϸ_ϸ͵"]],encodeOffsets:[[[9790,43165]],[[3675,51589]]]}},{type:"Feature",id:"GAB",properties:{name:"Gabon"},geometry:{type:"Polygon",coordinates:["@@ࡹࡔ։ۚԙࢄ‚˨ǾˎȲؔǜخ˴¶௢SOৠЌÆԞőӼňľ¯ÓνɼѡشèȾǗεঃЊӹĞٿŁ֑ʳЇݏ–҅Иãϋ֥Ĺ˽Ɂ̈́֋ٕҩ"],encodeOffsets:[[11361,-4074]]}},{type:"Feature",id:"GBR",properties:{name:"United Kingdom"},geometry:{type:"MultiPolygon",coordinates:[["@@҉ֽًǦԱ[ǦҊǥ҈۴–ࣔԳ"],["@@࣋ࣧࡦŘऄIɕۅݯݩࢄÃäĕݠ঱ֺƇԬढ़ʈͧৰDžķ՝ѓʗͲѣݱѯ૳Rෝɱϻǒ։ϿޥĪם͍ҁǘ௼ࢨݪǺOBಽƔʃͰ࢜ʺҡҐdžռఢ÷D@ŮӤ֛Ԯ_\\৵ƨȧɬ̨ϒˡɴҍЇ·߶щє̨ࢆٶھڤá০ì"]],encodeOffsets:[[[-5797,55864]],[[-3077,60043]]]}},{type:"Feature",id:"GEO",properties:{name:"Georgia"},geometry:{type:"Polygon",coordinates:["@@Ųάȿִӟ̲ҭĬ̯ʴĺIJ܄ƝఆƋଦЕƦƻԚƂ޶ǭʴ·Նșɓřвғŗıҏºصʎȵƍଢ଼ſ߳Юࣅ¡"],encodeOffsets:[[42552,42533]]}},{type:"Feature",id:"GHA",properties:{name:"Ghana"},geometry:{type:"Polygon",coordinates:["@@೉ӯҳ˽ݳʑݡʆœͨηܤɖैΠ۸ɟ஢ŗنrӊฤ¢ϊÕ˔ƊϴáÕʿΖџC؍Ąڍɂ̫ȅݳäйɢՓȈ̍"],encodeOffsets:[[1086,6072]]}},{type:"Feature",id:"GIN",properties:{name:"Guinea"},geometry:{type:"Polygon",coordinates:["@@ʃtǡͷʁJǏǴÈͶΗԨɕħǵmɳ³V̮Ƈɘ‚ʔǻΜɹ̜ڥDțǁɵoƝǷīɹ҅σρӼ͛͢ɋŊȿǖħϊūȂʓƐώЦʮeɖƘȄDƄŎï˨ĢĖd˶МU؀ȱȄlÚĤҜáŨ´¶̭ƆBɖŒƔƒɸɇάãɲǺ˖ŒȬŠǚuȈȁĴɳΆΙǣɏ˙ǴĊŀį«ʡʲʍǗÝå˷Ș΍Ⱥڧ̷ĵăśÞNj·νƃA"],encodeOffsets:[[-8641,7871]]}},{type:"Feature",id:"GMB",properties:{name:"Gambia"},geometry:{type:"Polygon",coordinates:["@@ņόࣶzȎȦˊ`ͨȷʼIˢƚǞʏεȋιdέǰ̷ȗƭQȫŝއl"],encodeOffsets:[[-17245,13468]]}},{type:"Feature",id:"GNB",properties:{name:"Guinea Bissau"},geometry:{type:"Polygon",coordinates:["@@҅ΘΝÈȕʀLŸʯǴÁǶѼƌ˦ɦĨ༈•c˵ġĕð˧ƃōȃCɕƗʭfύХ"],encodeOffsets:[[-15493,11306]]}},{type:"Feature",id:"GNQ",properties:{name:"Equatorial Guinea"},geometry:{type:"Polygon",coordinates:["@@ƿŴ़̀െmPয়௡T˳µ"],encodeOffsets:[[9721,1035]]}},{type:"Feature",id:"GRC",properties:{name:"Greece"},geometry:{type:"MultiPolygon",coordinates:[["@@Ҡ˱ٺ¶شÑqƣҜĶĿʛ௃íTƒਁǎƺΦ"],["@@ʹՁȥĥԟ|ѫĀৱɓ׌ҿяƋҳAѻўƿȁȊԅрЁ̓ǿҴϯжʑ^ӅޥɠʜѕՓĕ͈ݏ֏Yۍμ̿ڦƧ֒͝ϮљӐÉʆϸТ¼˚˘Ũjɚռö͌ȀҖgƒƦdž„ت{ڨɲע̉ކĀVмЦɝ"]],encodeOffsets:[[[24269,36562]],[[27243,42560]]]}},{type:"Feature",id:"GRL",properties:{name:"Greenland"},geometry:{type:"Polygon",coordinates:["@@ᬜԆ᱒›ੴ̴ᲈĄ䀦Ŀ㉊ڗ༅͕ộ™⭏ćшƫᲐĠᡚ́࿈ʴۦ̝इӧᒞ̺✘͚ᠼNjҾΫ⃝ױӃȕ᧑ơወ¡ছؕگկ€ध৚շಽ“൧ˇ༂ѽȢ܋࣍ýઞܡህÑঈ΁˟̑இŽ୥E੆֩\\Ϗပΐћɣଌȿ઼ԣ͈ڱກlj٫͖ਣӘ˼֭উѵᕖ•୆¯ᖯܵᗿڏឧ́ओIࢅ͓ୟࢱᅵכׅ“૧ȷ஽ȝܛԱ[כыտോڧͺٿϗ۝љࠍஅ½఍ۈဿLࠁҢ֕ࠐฝਲэոŗݮ୓ޢ̢ئ֗̒ࠪচొ̺ͨΘǬڀॡ̕қůݯţਏ˜Éְ͢҂ެ\\႔ɟ෿Քݩ˾࠷ş۫ȼम޴ԝ̺ڗ׈ৡࢼ੯͚XΚᖷӮᄻÖᖟ‘Ꮕ×ইˌวՈᕂ˄ၚ¬≹ɖ቉΄Ś͜ẊИᶎИ̪͘ᗗ̠ܺͰ᯲ז௢ĚΓϘጲɜᣚƂᣖRࣺʽᕺҨፘ̽୺áპ˙ፅҐŘή"],encodeOffsets:[[-47886,84612]]}},{type:"Feature",id:"GTM",properties:{name:"Guatemala"},geometry:{type:"Polygon",coordinates:["@@ћƦԻfϩǖҍΌrʖĮȠšƾКۆ઄Ft˸Ƌ¾ġǺ̵Ț̹ˬϜDBӂ޸BަUOڗßॅʤ@˚ƱòŰʘŃϥ͍ЉɻÏljâǑǧɇȟ½¬ıƿġ˽Ƀ}ŭ"],encodeOffsets:[[-92257,14065]]}},{type:"Feature",id:"GUF",properties:{name:"French Guiana"},geometry:{type:"Polygon",coordinates:["@@͉͑ГÑŗʀȉ–ʹɩνǦɈΪòϤƢή͛ӸáֺѪܠ˸ğؤȥࢸۿƔ·ӻޑʳأ"],encodeOffsets:[[-53817,2565]]}},{type:"Feature",id:"GUY",properties:{name:"Guyana"},geometry:{type:"Polygon",coordinates:["@@ր̯Դյzџ̈́o҈Чͪ̇Ƈݱԛɕ°ȣƹџϊ؏ːAŎӃԢܳȱ‰ҫî˙ɡϟƥ˅—ġǑЭ¦ԫЀÓϴɋьƆܐɸ̐ȕϸ˿ŶŊτțȘѩ™ْ֩ɬɲiϲԬƊȾƾ˽̸ô̬ږӲ"],encodeOffsets:[[-61192,8568]]}},{type:"Feature",id:"HND",properties:{name:"Honduras"},geometry:{type:"Polygon",coordinates:["@@ơˀʭòÐʹŗĞǣÒσij‹ŔʩƈǷǚʛìǨɈáǒÐNJЊɼϦ͎ĔȂƨʊ\\þ垦ϸùϲv˒ĢİĦˎ©ȪÉɘnǖòϨśƄkʲƿʐį̏Źɜɳ˽jśŕ̇ŋɃAȅŃǙœƛźĕ{ŇȩăRaǥ̉ɳƹıđĽʛǞǹɣǫPȟqlЭūQĿȓʽ“"],encodeOffsets:[[-89412,13297]]}},{type:"Feature",id:"HRV",properties:{name:"Croatia"},geometry:{type:"Polygon",coordinates:["@@Ȳ͗ˊʇ͓̓ϝȆׇ[ܟƔϽmǻǧ̝ȖǫΑЪϽǼʹϮ̽͌ȃ͆Ηݔ͇ġƛ߃̶ӣ̢ޑʠ۹ؤǞØϥΞe˲եƄʱγʝˮn̆Šbג…Ƹƚ˸ƍͤgGɼ̈ĒĈͺڞɠˊĻؼέۜlj̼Ų"],encodeOffsets:[[19282,47011]]}},{type:"Feature",id:"HTI",properties:{name:"Haiti"},geometry:{type:"Polygon",coordinates:["@@Ԣ™ܰƁôқÝ͑ȱƙɎʥiɫ֏ƜЅÍԡÔϽƿ҉ʾö˔ޜśيã̢ȈϧθP͎ՋžȌɶ"],encodeOffsets:[[-74946,20394]]}},{type:"Feature",id:"HUN",properties:{name:"Hungary"},geometry:{type:"Polygon",coordinates:["@@˨ըǍǼӂDÜ΄ђɋ̲ğ۸ļäǚͮ~ЦžĜÃЂŀȠȢˠ¼࣒ʭǴĒҲɭÎɣԡǭЉ֫ԕ֭کǁԽš١ə̻űۛNJػήˉļǍ˴ƗV"],encodeOffsets:[[16592,47977]]}},{type:"Feature",id:"IDN",properties:{name:"Indonesia"},geometry:{type:"MultiPolygon",coordinates:[["@@Λe૝ך޴ǒѴʭ̎ʭ»ɩ"],["@@ܙȁijĶø˸ΰԢࠨͬĐǓfʫշع"],["@@̢ɣԲèȼΥॿǛ׉őҍP̀ӚҤPɤ̖"],["@@ūұ౅ʅૣľE̬ښǪՂʥ֔Üݬ̮"],["@@ྔċȂΌ༘З̪կీƵਐӿय़͋ऍ͸ݻwࢍØ޻ưঅ͎؝ČΓŁ໕ΌƣΰޑØּߤ৶·ڴ͡ΒÛŘ̗"],["@@ѝֱćنƬ̠Ǭ˴ȒʗCЏ"],["@@̿˥ׅƸǏΰࡘ¢Ⱦˣ"],["@@̨ٝۿΌۯìӃÅׇˆȦҦਠ”ऎʕ"],["@@ɼയ࢈ԉ۰ࢼ८ԔݜBܘ̉خ̛ࣘLJbᩑbᩑݟې࡟ǜȷʇ੡}ΦۂՈɺɕࣲЕ۸࿃܆ۗêృަʛУ͑óȏ̮GκٛЮ̢ࣞ״gëɠ௵DͩԄݥƺΡдଈȰњ˜ഘ·Ƃ̹"],["@@ڭ࠭كlj߱ǐඓ¥ܽŧţٍݪݛҒϠ༪˸çϯλŪιӯ͙݉ߒ੿Ƶ˿ݲॻQտ҅ʙ̐͡Мی࠙͗ȻɶŊ͖؅ӲØࠌ֕ʭîও”றՓũίʚʌޜŽ߸ΛPʻֺΎվŤښф౎ǮΎ܎ذپʛ੖śॴ–ࠨ؎Ʀȉ"],["@@©ܽџĈŷԝΌѷɽĵ͹Ւʟ੺ǚڤ˨̨ÔҝӸóĀ΃"],["@@सާহį˫ֵšݿַ߱u࠷͕౻ŭ̚ॕϙͫԤ׳´лːৃ̟̩Оս¯ۗĬŹૺнɺЕܘŝ݀ĮުԂ֐Ɩָ֗ӅըǠ՜ÑӪъЖôߒɽۆǶњୠ͔̈̆क़ॲ@ܰƙӍݷآߓơϭ"],["@@छkۻ۰અۊέԚٍۄзؾٕ୴۪݅ʙܠ̳ڀݵՊѭܘمҺࢗऒóђզ‘ಢNjݔࠓٮ֫ҪΓߔࣙࡢ_ۺֹӠ۳٘ϥͳۉӖ̞̅sƜו̊ҵؠõФՏɁ਱‘ಟ"]],encodeOffsets:[[[123613,-10485]],[[127423,-10383]],[[120730,-8289]],[[125854,-8288]],[[111231,-6940]],[[137959,-6363]],[[130304,-3542]],[[133603,-3168]],[[137363,-1179]],[[128247,1454]],[[131777,1160]],[[120705,1872]],[[108358,-5992]]]}},{type:"Feature",id:"IND",properties:{name:"India"},geometry:{type:"Polygon",coordinates:["@@ࣚটďۅͮїѕ׽ŒɾएࠜՑ୞חՑϟ͛޻ࠀͅߊЭરһସʼnӜёٮāৠȝ۪bĪͪŋՖÞβԠǮìڋlǙކ͉Ոƀ܀Çۈ|ÐԪ΁ˎڴŀވشॸ՘۶ȷ״ΞЀԹ˳Λ࣠űÜ͇̍Ʒèԫ׷Ʋછׅ~ӓҩ۵§ХϏۗځȒࢇȏ˹ĚΣгȥѵ೰ɵEƍ՝ҡѦʸӎϖ¶ϰ܆ӝƜީ]ߝŚóאБ¤ڕζ֭̓؆ѻԿ̻ȅ̩Ԭɣƛԑ̆كžەţֱ̫Zਛǩ´ك҃ӻ௃֡ळ঩كՋ࠷ջCϭлȹݳ̝Ͻ«ʥٙǪધ®ۡΣߙI෗ѣ¡ϣٙʰˣދʃ˱֯͵ʍߑ޸ϳ୴͑ࡒ̍Јѿ߰ȻੂơՀޅ଼Α࿀ʣ੾HৰǍ޾௣ԉףĶ઱৲И̤ʝͤড܊֖֔ᇜCǗܞҽюĩ٨ջϘऒࢢঊÙ࢞ࢢՄ࡞ࠄࡈ_״ܒӠڳд֪݂̇̕Ьβ౤ȱपŰߺ۸"],encodeOffsets:[[79706,36346]]}},{type:"Feature",id:"IRL",properties:{name:"Ireland"},geometry:{type:"Polygon",coordinates:["@@ƒ׷ًݣ๯ӹ஑Ŷڼ࢚ѭࡢତڄٌϼǦ҇ǥ҉Բ\\ٌǥ"],encodeOffsets:[[-6346,55161]]}},{type:"Feature",id:"IRN",properties:{name:"Iran"},geometry:{type:"Polygon",coordinates:["@@݈njװӔ֚{τƾװýघэڤğ।ݓظ‰òۻ΁਷ɱؑκŭΫҡˠڡàՓِƙæեݿݿжѵ͸ԓߦυx݉ДƋêϯ௉ѡ̓উཌྷʪࣷȖेŊΧਐЕƪ٣ƭࡑНਇ˦ࡑ٦߳ʈ֗ߘا૪ҍƋՕ˦̻͝ҭѴS҂ˍ@Ɛ،ѝٔ਍Ң׉ߜȜپц̂ÙӬտʨխ৊ҟڨǐʼʿ६ּʈƄͅъϯ־ő̤~রئ̀Øʞʙ́гԼѱȾ¦ˈإߖǩ׎у஠ƟಾɞĄȞ"],encodeOffsets:[[55216,38092]]}},{type:"Feature",id:"IRQ",properties:{name:"Iraq"},geometry:{type:"Polygon",coordinates:["@@րʧÚӫх́țٽ׊ߛ਎ҡўٓƏ؋ˎ@TҁҮѳӿ¤֟ê؝߭༟äᛍၖఫךৡɪ͹৾ᇶ࢔͆৬āؘҢȺјԾΰž঎Ň̐ɉЖƚծ৉"],encodeOffsets:[[46511,36842]]}},{type:"Feature",id:"ISL",properties:{name:"Iceland"},geometry:{type:"Polygon",coordinates:["@@șիॊֵથٙᝓֹܣƵૉŮᚑˈࠠψᆧЪ๪ǎ—ʘᄋȜ֨նౠŰಸ֭౨Ҝ੒ʃൌ҄ආÑ"],encodeOffsets:[[-14856,68051]]}},{type:"Feature",id:"ISR",properties:{name:"Israel"},geometry:{type:"Polygon",coordinates:["@@ƥ˅̣Ŝǫ֓ɂĥɋř—ɛЄŖp͛нഉց෾ʔˢ˶ɞϼǠيŤɆzVˬCþƦɤ\\`·ŕŵhM"],encodeOffsets:[[36578,33495]]}},{type:"Feature",id:"ITA",properties:{name:"Italy"},geometry:{type:"MultiPolygon",coordinates:[["@@̟ڋŲʹǭѝٝ̈́ёĞ୩ѐŞќজûࡪĠْò"],["@@Ԍ׭ş૕ϣÂ΁˫͇ɞ‘২ȓӒҨ¥рʼ"],["@@ரɏĝЯȬΧڝŪہ̗²зĻʇˠё߀чцۛदڱچLȲȃɽǗݪ̥ؠʩܜѫĔƿƽ̛үϼܳƐΝի؈̷ıѫΗ¹҅ܛΕÝHʲǢҊǼǶ͝ӤʱшΑŀʛδգƴεͶثÆٿϜޑմ֯ӜʿࠪйĮہˤϯŕӝϵΓÕĪθҕńɏٲ̆ʰʙ̀”ʂβǵМ¢Ҽ˶ƢƃА€ǼͺتĿψƚâΆԘšĮdžࠨƤȊ̉"]],encodeOffsets:[[[15893,39149]],[[9432,42200]],[[12674,47890]]]}},{type:"Feature",id:"JAM",properties:{name:"Jamaica"},geometry:{type:"Polygon",coordinates:["@@֢÷ҀȫƔɯןeʭƗҹƊӑ̪ĶȔΜÎȒƒ"],encodeOffsets:[[-79431,18935]]}},{type:"Feature",id:"JOR",properties:{name:"Jordan"},geometry:{type:"Polygon",coordinates:["@@Ʀˆपͫ࿪ࣆͺ৽Džų၅у࠸࠿ˣƛƑ˭ٙřȩ̡εʵधƆƒŨоഊo͜Ůʚ@Ԥ"],encodeOffsets:[[36399,33172]]}},{type:"Feature",id:"JPN",properties:{name:"Japan"},geometry:{type:"MultiPolygon",coordinates:[["@@ņ˽ҿԕΉːљțɝӭշʈRЊҬԆӌīΊΜؠǹ"],["@@́ڡƤсѩף੹Ѓ๏½ணॡ͔֡“غษȃষЃঝe࡞أ֗෗իΝН͜ȶݶՏʒͿ־ߐʶѲՈࡌѢ؞ָာʤ࣎ǣࢠ๺֔Б௾ࡀӌ͜ՈਈƟा΢ՎࣀƸҞୗ}ڻޥࡍbࢁ"],["@@נǵרΤȈहఝɯ݁࠱೓ָқँण]ř࠴д٨࣌²ʖ୐ʜټন࢓٤˯"]],encodeOffsets:[[[137870,34969]],[[144360,38034]],[[147365,45235]]]}},{type:"Feature",id:"KAZ",properties:{name:"Kazakhstan"},geometry:{type:"Polygon",coordinates:["@@ӕƹ્דο׹̹KɱЊ੫‚ǡێХNÚࡆ৓ؘ෷ßডũߣݶۋ͆ಥ׼ƽðᓗӹᶽљ£יچ֧ɼॕǩχ˧±ȲȶΖDž̊অ˺ϛݮҩɆ…˜ࠊāŽؘ܎ƎܼűƲࠎƭԲ࠿£܍ȴঃσ޵ǭяƌĐўՙ֘دw܉֬ӞِʕǢڢऊࡺӣŀؘჄࣴಾtᇢ׉঺ͻࢼΠ೰j੺ѥʔʠ୼—ɂЊഷ׀߮Цƿɮ߮ɔ؅ֺϬ˼Ḯ̈ШȺᑆ̴ݰΒຢǹ˄ࢉ࢚Ȳઆ˹éҝ߮´ᑌߎ̭ˁ੶٭ሠᒑ҄ѰୄӛீɎҪƯКӟטNjΨΥ઎ŒѾԣٕ֓ۥÿ¡ࡅұϝဟˢ؅ຑїȇဗͱݲลֻɓäӏԭŬу̠ఝĖඃx̧ġ஥ΞӉǧŽӹ൩̂փşȉρ"],encodeOffsets:[[72666,43281]]}},{type:"Feature",id:"KEN",properties:{name:"Kenya"},geometry:{type:"Polygon",coordinates:["@@ӾۙיͱȹΕ̿Õšףˑ͹Ǐ֑ͷ˥஻ࡀËӤᵁႌƙĢSࢺʊ;а֌̨ؔσ॰įтЉ׎ԬԈ֬ֆѨƗ@ҽ˺ˡג@੠܋ˈSȠxȄī֖ßʞΔގΚͺ˳ָAܽ॑Xᵣ"],encodeOffsets:[[41977,-878]]}},{type:"Feature",id:"KGZ",properties:{name:"Kyrgyzstan"},geometry:{type:"Polygon",coordinates:["@@ȊςքŠ൪́žӺӊǨ஦Ν̨Ģ඄wఞĕф̟Ԯūşȏ೛ғ̙ͭઁıͅ՛ࢷŒׇǏߣЇŜȟʇȓཟŵਡ˘࣫ÝĂӜࣴƕ̮ʸٖĉ੾؂঻ѸױȽإ͂۶ծʟĊ"],encodeOffsets:[[72666,43281]]}},{type:"Feature",id:"KHM",properties:{name:"Cambodia"},geometry:{type:"Polygon",coordinates:["@@΁Ѭыࢄȣ২ՠۨઘdž߀ťۚ͡Ϟׄݖ̱Ȝ֕Ļ৕ඳ٧τԙࢥÓܫͷ۱Ū"],encodeOffsets:[[105982,10888]]}},{type:"Feature",id:"KOR",properties:{name:"South Korea"},geometry:{type:"Polygon",coordinates:["@@ܨযȺխPॷ̓ҥݽljڥΏݳïĥҚƼـχ࢔ذƚֻܘÂúϒ‡͞Ϝצ¢ΨÈŨȮ"],encodeOffsets:[[131431,39539]]}},{type:"Feature",id:"CS-KM",properties:{name:"Kosovo"},geometry:{type:"Polygon",coordinates:["@@›ǣŃPĘ́ȩĐdzɦƾȌȪÒŜ˨ư²Ţşƾ¿ŌƅƒŸǎƻŢLĥȳijij„×ȉӹŻ"],encodeOffsets:[[21261,43062]]}},{type:"Feature",id:"KWT",properties:{name:"Kuwait"},geometry:{type:"Polygon",coordinates:["@@Ǭχõȓ˔هשuȽАݟĆ؞߮֠é"],encodeOffsets:[[49126,30696]]}},{type:"Feature",id:"LAO",properties:{name:"Laos"},geometry:{type:"Polygon",coordinates:["@@˚Ϝœ܆ڹܸ¿ٕࠦھٍÎǛ̉ӯyʣƨࢯԅoݬȸࢮ֧ž³ԎηʸǴ̲ܐնøȡ҄wŵ०ѦŬӮڏϖޅਚO͚ܹ՝ɗʉ̟৔ԉۦ঳Ռ݋َ׏ɄץƵ࠿ݕ̲ϝ׃ۙ͢"],encodeOffsets:[[107745,14616]]}},{type:"Feature",id:"LBN",properties:{name:"Lebanon"},geometry:{type:"Polygon",coordinates:["@@ɣ[ýƥ˫D̘ۄмעfˆϘ§Ɛͣқ̓ȷҟ"],encodeOffsets:[[36681,34077]]}},{type:"Feature",id:"LBR",properties:{name:"Liberia"},geometry:{type:"Polygon",coordinates:["@@ɗQࡽАޅٖ܏Ң֣ըȪː¬ʔϜҘϺϺǶnɖĨΘԧÇ͵ǐdzʂIǢ͸ʄsŸʓĎНǽύʖɱˊÇΤΙ~ͧăĿÝە"],encodeOffsets:[[-7897,4470]]}},{type:"Feature",id:"LBY",properties:{name:"Libya"},geometry:{type:"Polygon",coordinates:["@@ק̷ҿҤ೧βρՄڑϸϻƷ̗ҶήӹؔͬΘñՈńҠÓϦƨۈ¯϶˕ݐШȜðΠėΒ־͔ʶːЦʌ´٦দ́ΜðۮƓ૞ϓЀݛݮǍஆΙࣆйЦɔЖϮț٠˂Ф؄ЀׂŘ଒ǣ˺ϑ̺Iˌƛ࠴ıȲˣ̣ЕżΫɏԯʦڱ@Ჳ@ᶵ@့ॱGYΙ‧ྐ‧ྒࡓҟ"],encodeOffsets:[[15208,23412]]}},{type:"Feature",id:"LKA",properties:{name:"Sri Lanka"},geometry:{type:"Polygon",coordinates:["@@ų࢓ΙʇܵȓЍڜƫீϠ഼׆ұϺסО࢓"],encodeOffsets:[[83751,7704]]}},{type:"Feature",id:"LSO",properties:{name:"Lesotho"},geometry:{type:"Polygon",coordinates:["@@̆ʩʳУƛ˛ҳſƹˍ̛ċؿ٨҄ՐҖ͢ϼǠξʵ"],encodeOffsets:[[29674,-29650]]}},{type:"Feature",id:"LTU",properties:{name:"Lithuania"},geometry:{type:"Polygon",coordinates:["@@ãɊĚɲχƄࢡƨDZ۸२ʴඬÁࠜĊŞǩ҂Ã߲СĀϓۏˏșӃ࣯̓߻NȫʶљĜ"],encodeOffsets:[[23277,55632]]}},{type:"Feature",id:"LUX",properties:{name:"Luxembourg"},geometry:{type:"Polygon",coordinates:["@@ǘȏ³ρʍiȉòĞҼɖŽ"],encodeOffsets:[[6189,51332]]}},{type:"Feature",id:"LVA",properties:{name:"Latvia"},geometry:{type:"Polygon",coordinates:["@@†نЮՆߊ˼ڜعڪhNJ٤ܐƪςĻܢ̷ۚCКȕîС˒ӷ͕ࣗԛƙ߱ТҁÄŝǪࠛĉණÂ१ʳ"],encodeOffsets:[[21562,57376]]}},{type:"Feature",id:"MAR",properties:{name:"Morocco"},geometry:{type:"Polygon",coordinates:["@@ԒΥߜÎࢊȃκU͂՟ºԝ̄ࢱɜDZƷ͛ષƙϝ̵ӡñ—ثঙ͍ͩсۍɥ࠻ŷഫاRহŷ@@@p҉Ա˓ȑϡ@̥Ŋ۹ě˛ٻʿÕЁ੕ୟ࣡ˣୋ΅ϗĵ̡ቅãaD ϶͒ɮ˞ѪÃ˶̀פҴՖ˲ƊɞӬp҂̤Բ̪֔Ւ࡬f\\ц͔ްĢڎָтɠۮۮȿਸ਼͊ܢŔѶդ֨ࡈϦخΐ֘࢈˄ԪؤI"],encodeOffsets:[[-5318,36614]]}},{type:"Feature",id:"MDA",properties:{name:"Moldova"},geometry:{type:"Polygon",coordinates:["@@ȨŮ֒ĊؤʽΊϞɥÑ˵̪ƏŨΗ̊ɇÏűƾčɝ×ӷ|ĉŜǫãÒƭɱˍƥ˽ɁĝƯϦĘΪςӝԂˉΠʹʠʯĈ"],encodeOffsets:[[27259,49379]]}},{type:"Feature",id:"MDG",properties:{name:"Madagascar"},geometry:{type:"Polygon",coordinates:["@@ɠΥȺ։Ɗঢ়ɒϽĉЗƩʙ˷ӰǁʝLjثõΥɵȗ¿܅ͧওб୅ԯཧ͑ୟϛইہȣܻΡӛɊڙ̜ɳѺÇݘ̑ڠù؂Ʈ؄ϰƢD˪Дِø՚șЈǃՌãޠ̊ҺŔՒмŒҶǤ̶Ʋτ\\ӐӎۖԮʦцŗάΦĵҪ׎fԐ˦ϔ̊ί"],encodeOffsets:[[50733,-12769]]}},{type:"Feature",id:"MEX",properties:{name:"Mexico"},geometry:{type:"Polygon",coordinates:["@@͙݅ƥ؁Õ૷ąЧƤқʺЧǚٳ֎سȞӏ͢бࢾɝΐΙ݄ɾٚĎؼưՊƠՖ΂ȨӬè۸Ƣʖ֬ɚࢶȚݔ‡ԚîȬDZ…ЙҋԁȥԝƸƥűγɁٽɅɎǭcǃY̝ԓƳIJķPŭޥV޷AAӁϛC̺˫̶șĢǹƌ½s˷ઃEЙۅŢƽĭȟqʕ्ࣞџ˘ۇɖҷÓګ́чĉץɜؿDŽ޹ϬؿŠ्ϸ۱ВɃɤҹº࡯ˈΓϦࣗӊсՌȧЦ˪ĈđʈȖɔJ̄˱Ϙùͮ˭ъ݋࠴ࡋڀУԼܝ΄ƷȴŸԲѓȞӹФȽהҍæӣѸϿФ™ˀҍو̓٠^͔؇ͬ˫™ӑɴƇͿƔЕĆف̀΋خׁƒȡŸÓŎ˽Ƭ\\ǜթʮɇǴ̕Նё˨ޯʠρɸϿ²ѷКƒͶϡ̨ϑqƭΝ̱ƫJɛԞջӎ؃РїɈ„ؚŵҖЏʺֿϒŏŇɃɖԭȰӷӦÖÚΊ³̸̼ŽϜ٩׶ӱɶ̱Հ̷վϳڦͿݲॖÞ੪ĞÿǑ౔СኀףဪPژ@DΌผ@̪̕јˇԀσ˨ѭȾҥѢʩۤʥՊڒۊhפͱфֹ̄ӯӸӏȂחɾЃپʹ׮ȁ͞|"],encodeOffsets:[[-99471,26491]]}},{type:"Feature",id:"MKD",properties:{name:"Macedonia"},geometry:{type:"Polygon",coordinates:["@@ńOœǤӺżȊ˺¶ϴbтˏÒ։DžƒƑƥҕh͋ǿջõΑȴšήń˸"],encodeOffsets:[[21085,42860]]}},{type:"Feature",id:"MLI",properties:{name:"Mali"},geometry:{type:"Polygon",coordinates:["@@˰ƶƘӶˊpזɻӄǖ͖ÇŴȈ⁚^ȈךƣļЛ⋈Л⋆౾dᬼᆳᬼᆳȨϿԺʉ϶ƋV՗ठĈFካҟ֗íԭݛƃ଩ï̳̗ա՟IȿLjҥš޻ΑDžʿٳϕŗɍΙǡНŔɱȳūֻڙۡp˳ɭΣÆӥ΋ůȝŁŽάʍĥơhƷʕ٭PɷŴʼnùʱʎ¬ʢĿİdzĉ˚Ǥɐ΅ΚijɴȇȂǙvȫş˕őɱǹΫäɷɈƓ„ɕőƅAµ̮žʾí̽͘ʀǓӔԺ"],encodeOffsets:[[-12462,14968]]}},{type:"Feature",id:"MMR",properties:{name:"Myanmar"},geometry:{type:"Polygon",coordinates:["@@ӫηץ›ϥࣥΟƳО݅ՔؗΈօ̭ܵ̃ƹȪу֖ڙĪҷ_ϵ͠ދң޵Сࡷăذʴ٠˯ӼæࣸͽѤ˛৔Ʊਗ਼εۢօуॕ׳ҽöԳȠ̂ਪǫ޾څॺļ̢ӭņ׭ۆÅڰ̊ŵj׾дȦęΤȐ˺Ž࢈ڂȑϐۘ¨ЦҪ۶}Ӕજ׆׸ƱçԬ̎ƸÛ͈ӮÚˮӵξȧ|ٟ“ۙߓۭijঽࢲƔȨޛՐǍʓۣز́ζƷ؞ʔ~΍܏յdẕӓȗ"],encodeOffsets:[[101933,20672]]}},{type:"Feature",id:"MNE",properties:{name:"Montenegro"},geometry:{type:"Polygon",coordinates:["@@ÁǀηЯÊˋǫÞɽ˞εǖĢƜŬҦ˚ȜƾüɠƟŬśˠě͌ǧçïƽȋɧó"],encodeOffsets:[[20277,43521]]}},{type:"Feature",id:"MNG",properties:{name:"Mongolia"},geometry:{type:"Polygon",coordinates:["@@ࢮƢ྄ܤ౬Єܴʳ࢚]֘Ͻ࠼‰ௐɁࠈגͿӶࢊࢊश΍ނįনɍLjؿஜΛߐƺਫ਼ŌࡆōࠖЗԚѕެT੒Ƌޜȼૈƒ௸פԌĝѰ˭ৌêХهק࠽ɐ΅ӈńࠤŽ٦̴ڬˏހוğ̗ڏĦ௟ŏןʅ؝։౱͙࠷ѽࡹǞҿúѳէˎ͓ƌˣי˯׽҇গ̑ఽ‹ഫ̇এҋϋʾ৭AఓԜࠥŰૣśჃȊऑmӱԀϣޠԱĢ৩ԼଅŞুƞ̡θ͖চׅڲன̀۷Ѿəז"],encodeOffsets:[[89858,50481]]}},{type:"Feature",id:"MOZ",properties:{name:"Mozambique"},geometry:{type:"Polygon",coordinates:["@@لæ৞ʁɖńגt̚ʦԌaऀ͜ڞӤƊϕ“࠷ľ݅ಿƨЫʣ׷͙׍՗Եޏ͉ृСॉ͓ࣕƵוׯ΋ȗí׳ЌُǔӱZʣƪ¦{ࠗƋϷȤƝűΓΗ̗ۗ˳য়ҕρ̳ðΟɊÉíѵّRïϊůϖí̠ƬपɓװГஂࢬ॔ɜ؆ŶúĨӶƉʞ˜غǐ׌E੠ѥ˒ЏÔǹȼϳǰ۫gÅ̼āװᢈۘӚЕɴüͨɅ¸͵ǯϷØסոԱʲ׌ζǰíઊΙ؈̣˖̅]ɽદɾٔ"],encodeOffsets:[[35390,-11796]]}},{type:"Feature",id:"MRT",properties:{name:"Mauritania"},geometry:{type:"Polygon",coordinates:["@@և־ԗؤ֍ɞГʚҵUЧǽйð˽ˏïҐɺаŀߊģࠨĵкČмɑЎѵδǾˬᾔMǃ௎ȴќ߀øᒸ᪂©F౞Ṗ᎟౽cМ⋅М⋇ƤĻȇי⁙]ųȇ͕ÈӃǕוɼˉoƗӵ˯Ƶ"],encodeOffsets:[[-12462,14968]]}},{type:"Feature",id:"MWI",properties:{name:"Malawi"},geometry:{type:"Polygon",coordinates:["@@ɽٓɾથ̆^̤˕Κ؇îઉεǯʱ׋շԲ×עǰϸ·ͶͧɆɳûәЖѵɔʮޮ˄̈LJۢǚڼƞɪɉ܌Ѕϐ࠘ƽǜɵ˶Ϲɾଡ"],encodeOffsets:[[35390,-11796]]}},{type:"Feature",id:"MYS",properties:{name:"Malaysia"},geometry:{type:"MultiPolygon",coordinates:[["@@àћֈĶ˞ΈȘýӸԓΜ֛¶֣ęϡĆ˿Öӻ̒ɵͤݑe˳׫Éߑخ঵ښįђӟ֚ś̡۠ҜĠؔȃΤƤƮۈρ"],["@@أ˹ܯƚॱ@̅ॗ͓̇љୟۅǵߑɾЕóөщ՛Òէǟַӆƕ֘؜˽ٮǀǜ܆άǂ৖Ǻ׾ڔЬՐϦѥǮ˺В¸՜œа٪אшڀͼHќыžιֆɻ۬ʧÑ֝͡¥ƮЧ"]],encodeOffsets:[[[103502,6354]],[[121466,4586]]]}},{type:"Feature",id:"NAM",properties:{name:"Namibia"},geometry:{type:"Polygon",coordinates:["@@رٌؖ͡ȃࠊȷ،˯ಒm৒ŅҞ͛Όѡۜѳ৘ǽՆۃࠐ»٢КdžԊƞհ}ԄϝŶÐ₮˜׌Е᎞ş໴΂یȒհµͨȍPéӁȍʭC՛͍ͣΎಕ̍سƒ{Ჽࠣ‡BយA᷋ݣѕҋÕՇDŽϗÔƗάͩɰГг"],encodeOffsets:[[16738,-29262]]}},{type:"Feature",id:"NCL",properties:{name:"New Caledonia"},geometry:{type:"Polygon",coordinates:["@@ېԵѨϭ͉ȫҥɪ׹ϚէѼ։פś˶β[Һ˹φ˷ˎɻ"],encodeOffsets:[[169759,-21585]]}},{type:"Feature",id:"NER",properties:{name:"Niger"},geometry:{type:"Polygon",coordinates:["@@nּॹȐОҿպœϤâТբ̴̘ପðݜƄîԮҠ֘Eኬஈϒᝪ࿸᮪ཾ೨αӀңר̸ȸಯ̾ɓ`ˋΔ˽ǻί͕ၻ«ધੳߋγૉΔ̵CեբmčЃʁµˋƻm֩ंȟ’ځҷٱʔҍ¸ʏşӯ~ӷΧѓq৯ѢЉȵѓb̿͆ࡅ̼ࣗıɕǻşӗʋ͹ÍݣٗӚ̟E˭ʗ"],encodeOffsets:[[2207,12227]]}},{type:"Feature",id:"NGA",properties:{name:"Nigeria"},geometry:{type:"Polygon",coordinates:["@@ࢍ̡͉¬͓ȉڥl҇Ղˡ؊שֆكYݍB¶തs՘ǂՊʶʴТԴėɨǔ͸ȍӾ˪ÎݤʌͺŠӘɖǼࣘIJࡆ̻̀ͅєaЊȶৰѡєrӸΨӰ}ʐŠҎ·ٲʓڂҸȠ‘֪ँƼnͬͯğƱ«˧۽ٱɛՙšѧDZȉǝי҅ΉŽыȋ͹ÿΓֽ˱ҽΊ͇aԃӭʑQЍ߷ɍש"],encodeOffsets:[[8705,4887]]}},{type:"Feature",id:"NIC",properties:{name:"Nicaragua"},geometry:{type:"Polygon",coordinates:["@@̃ˆϽͺȁ˲Ο˄сϜĤžƒŵÚÒʾ”ŀȔŬRkЮȠrǬOǺɤʜǝĒľƺIJ̊ɴbǦĄQňȪĖ|ƜŹǚ›ȆńɄB̈ŌŜŖ˾iïă§ȉĐ̫ȗ˹ěͷυ®ɏtϙŹĉýΫÌɛǣɋ ɩźƏȩDZʛÈƓǦˉêȕʼnօɞųŇ"],encodeOffsets:[[-87769,11355]]}},{type:"Feature",id:"NLD",properties:{name:"Netherlands"},geometry:{type:"Polygon",coordinates:["@@ۦyǀ˳Ƚޓɇ́ԍ@ƘࢡҥȞՏπީǩ؛âѠɲ݀ఆଲΘ"],encodeOffsets:[[6220,54795]]}},{type:"Feature",id:"NOR",properties:{name:"Norway"},geometry:{type:"MultiPolygon",coordinates:[["@@᥆ؙઍɣऄՅෛ͵ڵû΢לઃͰಫ˵Ы؝ߟωࣗȮ઱¥णѼԉɝԷ“ūփནƊɝҵ߭Hևױ࠿झಫ஁̨˹̇ͫ࠯bձ޿¾૟՞э˥ধֻۧυӛ֝Ԫဋঁ૫ȟ୏є̛ࣚˇ኶ޞզᕠ۶ဌࢂ໤୦፺ྴඦلᘼ੊ᇎπ൪­౮ۢ໖›ພǘ"],["@@ም΅๝Ȝ׆ɐԕˎეǚͮ̿ொȍ"],["@@᪖صᑟͥұأ݅ǁЍۡৣᅵԢނ̘ఽʐ࿕܂ٷڄᘎ̜Ң̋஦\\͊˼௾ˆ੖̋"],["@@࿮̏ఝҍ᝱ı៙ƖƫɴஹdँϬᣴɼ௞ȫࡘʤᑺȽ"]],encodeOffsets:[[[28842,72894]],[[25318,79723]],[[18690,81615]],[[26059,82338]]]}},{type:"Feature",id:"NPL",properties:{name:"Nepal"},geometry:{type:"Polygon",coordinates:["@@ÝαŌՕĩͩ۩aয়Ȟ٭ĂӛђଷŊયҼ߉Ю߿͆͜޼ՒϠΒȪڪʳࡔշҾť˰ЕٶǓۀσौȕঔć"],encodeOffsets:[[90236,28546]]}},{type:"Feature",id:"NZL",properties:{name:"New Zealand"},geometry:{type:"MultiPolygon",coordinates:[["@@Ȓ΋װ;ʐΡBΝ̹ϳչإїͷ̴З٭Yܗ̓ɣջӋࡗڇϓнʇޝlխˢࣱÐƗ̰Ҍذ੐ࠦժǀ׾͌ܜѰԎѦώظ͈ɆŰҶלϴȆΧ"],["@@،ࢫlָϜɯŲًڰ˛֨ãӒ͎юĭȯݗʯӫٛjɡʭþαūƻͅҏзֹ٭ͯƟɘΕŨӞ۔˟ҨࣛͲz̦؈̌ƚ٨Ÿլͻ֜vƪБΎڋݔΗת̸àҚұٺɑʂݡ"]],encodeOffsets:[[[177173,-41901]],[[178803,-37024]]]}},{type:"Feature",id:"OMN",properties:{name:"Oman"},geometry:{type:"MultiPolygon",coordinates:[["@@ֹ̻ϟªǩȧƉэļ֗ÿĻϯFԽ̻ćХȓǯԹP͡ɃJͻПɷҩĂ֗˳ϱ³˝טٿ൴ᠾ࠾֖၂ϩתv͸ʔΐFΆϞǒƩŞèմіHϖֵҸ̧؞ŋӼƳϜӕɨ˧̞ŃCȉ̩ԃƅɽΟˏ"],["@@ʼnƳDž˺ʔ˺ľñā΍"]],encodeOffsets:[[[60274,21621]],[[57745,26518]]]}},{type:"Feature",id:"PAK",properties:{name:"Pakistan"},geometry:{type:"Polygon",coordinates:["@@تϻʞ٥൨ͻ߹۷ऩůౣȲЫα̖݁̈֩ڴгܑӟ`׳ࠃࡇՃ࡝࢝ࢡউÚऑࢡռϗĪ٧ҾэǘܝᇛD֓֕؛Ɇʣ؀٭٘໻ǁിeஃŝ̈́ঊொѢéϰГƌw݊ߥφͷԔеѶඨѕࡀŲԈŅǞȂגóદĈ܎ҶӈشCĠɼٞŌ̴ý͢ʀ±ԌΦԖ՘Ɇͥ֊ߜɴ̢•͒мΜĩмȣΤӬμࣘǮ८ĮѐƺӨĦ"],encodeOffsets:[[76962,38025]]}},{type:"Feature",id:"PAN",properties:{name:"Panama"},geometry:{type:"Polygon",coordinates:["@@˫ʎǵҒȺɢɅÎƿˤлɸοÁǝ̇ͻɁǽ‡ĉǩВҗɯŅŧŭϷ©ơԈŋƛˡ¸ǝ͸·ÈɓİέCǻĩŶªǖìǠƲŲIJǩŲK͸͘ö̠̝iDZͲ›ĀæɴȵЮÔΨɄԜǞ˺ʤҬ·‹ĉҶ…ώơ˜ʧ̈́ɵĹūȜӵǁʟ˓ÒŅС"],encodeOffsets:[[-79750,7398]]}},{type:"Feature",id:"PER",properties:{name:"Peru"},geometry:{type:"Polygon",coordinates:["@@ɥљћɋࡅӘñΈရࡊທࣾ٫԰ΏۜƐʎ܅ાࠣ༄ߍီ΅Ϥ˃ؤٷպױͼ˖ϒПߢʼךڢՎIJΓʇȧx̭ΎâͼĝΚщӆΌDŽ֤ԦܶৠͨࣸࢠʾմŝٔɢĂ֒ЉˎЅϴɏӶࢣضĿҨɞ̤ƣԎð٠Ͻթࡣʤoрҁݳ œųۍlj॥ֱÓϻɉ̇ČғԕʍBΡɛƵΔݳҲԝDZί֐µ͆҃ݐuېӸÇ౧ϢĩӄƠܪടǷ˵£ןg܍͟пƮ̵ȕ˯β۹Ջ࣡"],encodeOffsets:[[-71260,-18001]]}},{type:"Feature",id:"PHL",properties:{name:"Philippines"},geometry:{type:"MultiPolygon",coordinates:[["@@Đ֏ºҽ˹ޑ̫ࡨϽэˎإʉϿ঩Ӧɿ؊ʰЎՑЈˁΑЃثҵƑʖ͢۾ՌʀҜ̈́̔ϝٔɰƎϒרv·ٰڼЋêхÐ̱"],["@@̟ˡˁՍ˃ʝԫ׈ǦɤɂɾĢԸҨ¸Ɖ֣جߺāߡ"],["@@ૣߕЬט؈԰Ԏ׊Ѱ࠲Ʈۅևҧѳֿ"],["@@Ԏʹ՘BgΗϳΣՕʧ‡ϸÒєŽА"],["@@ʀभ٫ɞj˭ȶԯЍȋ•עʧªƁԘӶãY͈ԣٜ߮mɴ̻"],["@@ɟܩέоѓ٘ܚ‰̡̈"],["@@ԮʉʶɖüɇƍΑ˼׻ɛۥӷ˥ƁڳȊڝѾġϊIJਾүăҙ˜ȫēϯٻЮ̵Ѵɍ̯՗ԊރůлȆ¨ΎˀɊʣȘŇ̡бӚűμߨͺˡĔೄ˜ހԘA"]],encodeOffsets:[[[129410,8617]],[[126959,10526]],[[121349,9540]],[[124809,12178]],[[128515,12455]],[[124445,13384]],[[124234,18949]]]}},{type:"Feature",id:"PNG",properties:{name:"Papua New Guinea"},geometry:{type:"MultiPolygon",coordinates:[["@@ɽčε͔ρՔǷ٘ŜĆĜʡʬȏРՑЈ˵ŝɽ"],["@@ѯçƃɽҟȱћȟѽBۏʔӑɺêʺݬũҠàŶЖŦrĆѽӐÜʂ˼Ҹ̚ġӸԌfǜƏgү˯ԡ"],["@@ݤտղࢻӖ„‘ω٬ƛʥǁࣀΝġʏ֋ÏȷɔܟĦࡕŴٷ՚ӉҦѧ݀ભπ܇ʇԡˣńإڇ˿һƖࢅ–aᩒaᩒภ׃༊ӓׄїҴхŸӵඔԱȲѽޛěȄ֕"],["@@ʿɡǁӸȝ͘ϝ˞ӍΪ؇ʚɺȮҒɻ˸ȁΜȫʹΛ͊ˏĶѧ"]],encodeOffsets:[[[159622,-6983]],[[155631,-5609]],[[150725,-7565]],[[156816,-4607]]]}},{type:"Feature",id:"POL",properties:{name:"Poland"},geometry:{type:"Polygon",coordinates:["@@·՜à̂ȹ̧҆̚ɺɤȝђָʘ಼ϴ੒˴࠼ƙÚȱ߸Yਚħ໶^њěȬʵšωɸ͋KͯԋǡʸϳfϏцܻěɽзįރۥɒϗǿ¶ߙ͔؁šЇĒӹǵч̖Ήŕ³¼ϭаر¼ăˀֻĦűɑҗǨÀɴػòЉ˔"],encodeOffsets:[[15378,52334]]}},{type:"Feature",id:"PRI",properties:{name:"Puerto Rico"},geometry:{type:"Polygon",coordinates:["@@јõưǕɋɃمLӫ‡·άŢŬیK"],encodeOffsets:[[-67873,18960]]}},{type:"Feature",id:"PRK",properties:{name:"North Korea"},geometry:{type:"Polygon",coordinates:["@@Şƥ͉ºη˵ʣ˷Ž׽ѣȅƫƧ̓ʝ֓ƏηɥηįġͰƋӈσŧȭΧÇץ¡͝ϛϑˆÁùСdžĵƿʙé‡ǀɑüɥƆɰφȤİõƶɆҒÅƎөĠЇɤۄբऒҌ־׮Ўˁܪ‹ſѺಚβͰҼժӹ"],encodeOffsets:[[133776,43413]]}},{type:"Feature",id:"PRT",properties:{name:"Portugal"},geometry:{type:"Polygon",coordinates:["@@̦Ɉ΄ŬɂЫӺDƞłӪ‡ɼуϱɩYٽƍū‘Їγçʹԋɵտ̄ʡřɫ̵̿ê˥ͷɓѷŠџġŸڂÿԬϓþȩ͈äռͰ̨ÒͼǪԎkΤǙ̠™˲"],encodeOffsets:[[-9251,42886]]}},{type:"Feature",id:"PRY",properties:{name:"Paraguay"},geometry:{type:"Polygon",coordinates:["@@ͦ৖tҌЖ݌าʔޮ]޴їbʵʞҳÇଛࢲLJ΄ǐ֦ɩǀʣþޓİ͓̼›̀ƌ̢ƳAҥŕӻǑӛƍݏށ١ړƇऻŸࡑɮࠢ౨ťψࡽ͢ਅبۉŸ໵ൌ"],encodeOffsets:[[-64189,-22783]]}},{type:"Feature",id:"QAT",properties:{name:"Qatar"},geometry:{type:"Polygon",coordinates:["@@ÇؔɨѲɰĜʬˁdӯǽӳɵÑʫǖ"],encodeOffsets:[[52030,25349]]}},{type:"Feature",id:"ROU",properties:{name:"Romania"},geometry:{type:"Polygon",coordinates:["@@δǶԴġՠGϸȳ˺źبĄɄȠΠ@ʰćʺʟˊΟӞԁ€ρėΩưϥϒƹЂƊϠƟpɏПǹʯĀɻ৥ӳĖ̪ؑফțзɋ௽¬٥ƀ͙ÕʍΊƵƦȚƘȷŀ˃ȋөʔßΌԟȢĥˌҕͤڪǂԖ֮Њ֬ԢǮ"],encodeOffsets:[[23256,49032]]}},{type:"Feature",id:"RUS",properties:{name:"Russia"},geometry:{type:"MultiPolygon",coordinates:[["@@ࡌ๫కˤԫ்ࠌࡳyוُԒսٱƻ۸Ĥࠊħ࣢Țٌš૴ӯࠜôରަϮͭϴϐŠɔ։̆ߵuࠟΎࡑ"],["@@໵]ਙĨȒτ୊˚ࢢƧψƃęɱäɉ"],["@@֦Ƚțؐᗸű࿨޻࠭λ൛ēsࠑͳǩ޽~ٗ̊ૣʖȉθ࡟Ǝॗʼnҗ̎Ǽ̸৓ȥϚЃӉΣ@„Ꮪٛᔺ࠳ïԷ"],["@@ः©ƭˌੲΖ@ַ"],["@@ળ»@ָň–܈E௒ʉïŗࡽȩ"],["@@ౡMႣĤƧ¬ߘͪੀþஞ͏ĸə"],["@@ॿͩഉø༛ͨȪ˖༨ųᑔɗ"],["@@ډرᶽzඃȣမղҎ׀૎ǂᕞ™ᴬѽ"],["@@ӹóᩣŊɟώູɦūҒ࡮Ƕ…Ҟသܒޙĺ፨݆ɩϢሤѺ᪪բ᫠ǀ෴̸࿐Ŋאͩ֟ʻᲗз᢭Џᤙߝఫࠍ೉߱Ǡۥྎۏ"],["@@ɨгސȲឤYቈЧڬ̿ȽѧङʝᕅүفʟਬşఖɃݴDŽєաτɔഊƂ᧪ƑȴϽ↲ů´ٜᄼƥഄLബѷϮ՝ӹΙੌڋ೔Ϳ߸ࢦഖϙ෢ɦྼʵؤʀൖş؅ޮૐζ䢀ձܐӿᔲٛ₎DŽာƑ۪΍Ĺؙਜʇ૴Ǥ๰vཚǑཪĢะݛਪˎڷ՞ϐώᧆɻფºᝂБ୲ν@”MKઇσઝÖݶҁԄەϲɧĮΏɑɝ༧Ǿ᚝مݛĭ౽ן௛ԧ̱ϣய׊ᔗڇϣ̸ߵΫ૱Ř˓ց৙߽Šͻड़ȋő௣ޭ‹Ϋ۱Δα฽ѕ̅ॡభȳʥ࡟ே޳ׂ̳έ௬ҵለИ୘܀ԆªϾರȊຊ੒คࡺຢڢڮஆ৷ëԍۗᒉइۍਖᓧ˷ᑃටۚԧሙɕಝēÔ؊ಯŶ਩ЭᢵƠ᪏ʟᨩ࿛ủጝ೚ŁаՃࠄȅ՞оईÃௌऍ†܍ځ࠽ë্ϛഉ్௓˯ׇଙ঑ଇॻթӹ૩ӱՉYՇФૻؙſ˩ŝƦKѐіxŦ঴ɛܚܞ̒৶Ʃ֢ࠈ˾ऄ͚̮Ѵݲ൷ʛܯͧ౧Dͻ߄হװหˎ̵ࠖ̉Ԫ̿βԯࡐ̲݇షʢ૛uਯƱۛлҤȥXҩұˑݷࢻRσஅՍ৙̈́োéѯˮԋĞ௷ףેƑޛȻੑƌޫSԙіࠕИࡅŎ੝ŋߏƹ஛ΜLJـধɎށİवΎࢉࢉ΀ӵࠇב௏ɂ࠻Š֗Ͼ࢙^ܳʴ౫Ѓྃܣࢭơ͡çѽԤઍőΧΦחnjЙӠҩưிɍୃӜ҃ѯሟᒒੵٮ̮˂ᑋߍ߭³êҞઅ˺࢙ȱ˃ࢊມǺݯΑᑅ̳Чȹḭ̇ϫ˻؆ֹ߭ɓǀɭ߭ХസֿɁЉ୻˜ʓʟ੹Ѧ೯iࢻΟহͼᇡ׊ಽsჃࣳĿؗࡹӤڡउʖǡӝُ܊֫ذx՚֗ďѝѐƋϥӽ߿Ƒ࠳ࢁކߕĉ֣ࣼফԇ͹ƝɇωÌֿԚɿ†ՅȚʳΈ޵ǮԙƁƥƼଥЖఅƌ܃ƞĹıੱ܂य़̈́ܩӴؒƈۤ۰ҹͪఌ΄uȀݯƉ‚ώѠɼ߼ÖƄ˪ȅҪ΀ѰWʚఉ˚ӭUԯЀ١ƃ੩̐lǒ̗θڟ¤éʼɀǞ՝ӈࢋąʭ¦Ƀȑ̽”ȷ՞ȟ˨NJĀڴ‡͞Ȁʍɢ֥ƪ¼Ʋ΁ƴՃվǸɨĉЂࠑȨѱijšȼࢭɂˑӸíТЙȖάˊʝ޶װӞųƤक़ҬࢡЎᅢ੶ޮӠ͂єగּΆնݳش֢ܜ঍ग़ޢي౿֔ŬךڶüොͶࢀ̈൦ԕᘨȧṺो٤ЋÆ֓टѳ൏ɡ⏷ٔ؟Ńൌ؛ÂϵÆ࡫ઌʯڂɓňРԑΰ՘͈᎖Թ۾Ȳ֣؜ዦࠖޢµ޸̋Ӫ׀۫ԄЪԊءԶᚠˑӔҹ੡ĻNҳڌ˽ಜǼȶ՚ჶАᰪܞي£ࠣԙਬĕ׼˼༾xఢΐफ़ԏॖ֌ࢡӢѪˤ២ʫ୒ʿᴾॣ֚ѰࡡѺ{ǴৣĈˢЌ҅ټ}ː༄ݾրކزǒᕮɛǬұߕڽԺˋ˒חȏଵऒԧέ֕࿫஝०ŭ̢ͮऎɎɞжܮЎөӌϼֈࣿêȫҲڢࡈણۆຒ֦șװмnѴүͧ߷࣐Ƶϥ؄ඤͦლ¬༈ӏݛ۪ċࣆศǞ፾™ᆘŌہѮংւॲx࿎иᕠŐ˪ɲᕂþیȋሴҀ໲aɶδߤΨጤΈ෸˗ଥȷበŹ"],["@@ⵙ͕ໞીےĦقÃᒈӋʟͿ"],["@@૽ōݱÛśƏঙƑ࣫ȦӐʾል~࿞ƶ౨XǢɧӘȬߊƐఞǿ͗ŷ"],["@@ᆳĿᚉʎඅ͎٣׾଩ǔᔆָᆎȎ࿌чኬ߻ȹݯ"]],encodeOffsets:[[[147096,51966]],[[23277,55632]],[[-179214,68183]],[[184320,72533]],[[-182982,72595]],[[147051,74970]],[[154350,76887]],[[148569,77377]],[[58917,72418]],[[109538,78822]],[[107598,80187]],[[52364,82481]],[[102339,80775]]]}},{type:"Feature",id:"RWA",properties:{name:"Rwanda"},geometry:{type:"Polygon",coordinates:["@@ͬӃµӵʏŁѿÆʱӍԛàþҠŘތԄʎɺȰďԈʸ"],encodeOffsets:[[31150,-1161]]}},{type:"Feature",id:"ESH",properties:{name:"Western Sahara"},geometry:{type:"Polygon",coordinates:["@@oҊŸ@@ÉeNjEౝ᪁ª‚ᒷ޿÷ȳћDŽ்ᾓNǽ˫˜΢bCቆäĶ̢ΆϘˤୌୠ࣢Ђ੖ˀÖ˜ټۺĜ̦ʼnϢ@˔ȒԲ‚"],encodeOffsets:[[-9005,27772]]}},{type:"Feature",id:"SAU",properties:{name:"Saudi Arabia"},geometry:{type:"Polygon",coordinates:["@@ʼnΪʩʨÝͲѡ̞҃۴ʁۆׇ׀ϑƐ֋ߠīא–ӾӕञϿ͠ґǨˡӖ°ȎɹѦʕȊ͝زԟڴѓ־лIžҦœ̌ļͲनƅζʶȪ̢ٚŚƒˮˤƜ࠷ࡀ၆фdžŴৢɩబיᛎၕ༠ãݠąȾЏתv͠ܥаȓƠִ̏Λ¼΍ċ˩ł˯ʎɽŐ˟ŲȵʬǕɶÒdž͍Žș࡙͐ᡌщǞDzϪש֕၁ᠽ࠽ᝑ͑޷ϙ׻ࢥϹƕɁˬ͏§߻ĎƷČॹmɫùΉɔɝЭĒΟρˋ"],encodeOffsets:[[43807,16741]]}},{type:"Feature",id:"SDN",properties:{name:"Sudan"},geometry:{type:"Polygon",coordinates:["@@śhdмĵ̀џͨĵ؄ĶبϳÌÍȇԍ©Ȭʕðԍңңл؅џđ۹Ӫͅǥđʓџǃ…ǥ࠵@řǦ؃†̡ƝɳîѝӬƟɲ؃ŗɱϵɏݣ˿ǁʳğå ̅ʎÃʼƌΔE΄ӛՀĩάZȰ̱ʜUӦǭ͖̍µĎ̰ɒΖħΐˢʴǫȞɞ԰ϨئܦÏ¥ ZΚॲH@း@Ὂ@ῼ@˔ࠗȁƳŪࡻ্̰͌ȷҠ̳ыӑأƏ˅ʳĉ֑α௿ĚͳƅܟͿࠟԓзέٛč΃Љɽʝ࢟Dij"],encodeOffsets:[[34779,9692]]}},{type:"Feature",id:"SDS",properties:{name:"South Sudan"},geometry:{type:"Polygon",coordinates:["@@Xٽűʯѿq˷ӏԨÑюХƨͳϦșӼࣳ֫օԫԇԫϭסFگȟՕȊ΋ɭ݉֐ȥάҵDZϱÆɣƕϗĸԗۚƉˊعͪɅԌΕζ֟ѬS˘ҡͼ֯͠ʴĠ̀ǂɐݤɲ϶؄ŘƠɱўӫɴí̢ƞ؄…Śǥ࠶@†ǦѠDŽĒʔ͆ǦۺөѠĒм؆ҤҤïԎȫʖԎªÎȈϴËĵاĶ؃ѠͧĶ˿cлŜg"],encodeOffsets:[[34779,9692]]}},{type:"Feature",id:"SEN",properties:{name:"Senegal"},geometry:{type:"Polygon",coordinates:["@@΍ٺн̚φDŽРמȦќ˾ːкïШǾҶVДʙ֎ɝԘأֈֽžԹǔӓ̾ɿî͗ʽŧ³қâÙģȃk׿ȲЛV༇–ɥħ˥‚ѻƋƏ٢ވkȬŞƮR̸ȘήǯκcζȌǝʐˡƙʻJͧȸˉ_ȍȥࣵy"],encodeOffsets:[[-17114,13922]]}},{type:"Feature",id:"SLB",properties:{name:"Solomon Islands"},geometry:{type:"MultiPolygon",coordinates:[["@@ɾ˿חN͉ԬԈȯǜ‰"],["@@͝mԧĎǫżÀͮֈƁ˜ǭƎə"],["@@ųƹحܰǫԈ˺@̠ڥʹЗ"],["@@–ǛڅΦҟ̠̿˪ŰĐϮȫېϭȢˉ"],["@@Ǘ³οȒ·Ί¨ƖԈΡͰ˛"]],encodeOffsets:[[[166010,-10734]],[[164713,-10109]],[[165561,-9830]],[[163713,-8537]],[[161320,-7524]]]}},{type:"Feature",id:"SLE",properties:{name:"Sierra Leone"},geometry:{type:"Polygon",coordinates:["@@ɧØ؁ͺѩ҈Ƨ̬Ĺت҆τĬɺƞǸɶpȜǂڦCɺ̛ǼˁʓƈɗṶɴ´ϹϹϛҗ«ʓȩˏ"],encodeOffsets:[[-11713,6949]]}},{type:"Feature",id:"SLV",properties:{name:"El Salvador"},geometry:{type:"Polygon",coordinates:["@@ġȡӡ^̡Ą΍ǘұÀʃǶ~Ů˾ɄǀĢ«IJȠ¾ʜëǸǙʪƇŒœτĴǤÑŘĝÏͳ"],encodeOffsets:[[-89900,13706]]}},{type:"Feature",id:"-99",properties:{name:"Somaliland"},geometry:{type:"Polygon",coordinates:["@@ϛԩד۫۹Mᩧা͍̜̳К̳ҨǾ̖̲҈˚ƹǒΏϜΗкGߊɌࣴĴ݌ʼиÆ̚ƶӎˆKaE΋Aࡑ@ѫ"],encodeOffsets:[[50113,9679]]}},{type:"Feature",id:"SOM",properties:{name:"Somalia"},geometry:{type:"Polygon",coordinates:["@@ѼĎЊ˾͈FpɵýӧHѳǯ̣ʁࣥЙयԱ੷ܝ௷ܓवধ଩ࡁڹష࠯޳ٕँৱȗѷȍȣӽۚWᵤܾ॒ɰˆբfݠפબšᛜᡄה۬ϜԪ@ѬBࡒFΌLbːhϰŰ"],encodeOffsets:[[50923,11857]]}},{type:"Feature",id:"SRB",properties:{name:"Republic of Serbia"},geometry:{type:"Polygon",coordinates:["@@Ԡȡà΋Ӫʓ˄ȌȸĿșƗƶƥȷȏø̫Тγ͋ʿƗˋĞijƑšϳa˹µƒØĴĴĦȴšKǍƼƑ ŋƆƽÀšŠƯ±ś˧ȩÑèð͋Ǩ˟ĜūŜɟƠȢšŬЄЛ͔ɀτ̥Ë͔́ˉʈȱ͘٢ɚԾ™ҖͣĦˋ"],encodeOffsets:[[21376,46507]]}},{type:"Feature",id:"SUR",properties:{name:"Suriname"},geometry:{type:"Polygon",coordinates:["@@৔ǙĞưڶÔࣚɥѩܟâֹͤӽƥίóϩɉΛӓDzЇđ͹öčʏƘǗ÷ǡҙèԡܴōӄˏBωؐƺѠ¯ȤԜɖƈݲ"],encodeOffsets:[[-58518,6117]]}},{type:"Feature",id:"SVK",properties:{name:"Slovakia"},geometry:{type:"Polygon",coordinates:["@@´»ΊŖш̕ӺǶЈđ؂Ţߚ͓ɷɓǏ͹dzđ࣑ʮ˟»ȟȡЁĿěÄХŽͭ}ãǙ۷Ļ̱ĠёɌċ̆äńŢȂόa˺ĔxþLj¢ÆȒȖ˜žưʢD"],encodeOffsets:[[19306,50685]]}},{type:"Feature",id:"SVN",properties:{name:"Slovenia"},geometry:{type:"Polygon",coordinates:["@@ۜÝъȐܾtLjƘƘUǎ˳ڝɟć͹̇đHɻͣh˷ƎƷƙב†ȈúȫΨĞа"],encodeOffsets:[[14138,47626]]}},{type:"Feature",id:"SWE",properties:{name:"Sweden"},geometry:{type:"Polygon",coordinates:["@@ࠁוƀԥ೹ڭྱܡؓஃײףߦүޗॅ࢑ȝ͍තӋ޿৳ĆӅڗঃˉߐ۳॔ٓஐφӜּۨ˦ন՝ю½ૠղ߀࠰ä̧ͬ˺ಬஂࡀञֈײ߮GɞҶཔƉŬքԸ”૪Щ಼ֱv಑˴͛ฃʃ"],encodeOffsets:[[22716,67302]]}},{type:"Feature",id:"SWZ",properties:{name:"Swaziland"},geometry:{type:"Polygon",coordinates:["@@ǡύӭěԅҖS̄ɰ̀ĂʔʐÒшƵŰϕðω"],encodeOffsets:[[32842,-27375]]}},{type:"Feature",id:"SYR",properties:{name:"Syria"},geometry:{type:"Polygon",coordinates:["@@࿩ࣅऩͬgNŖŶ_ΈȸҠҜ̈́Əͤϗ¨ÿٞȶΌɤȀɤȀ°Ҹ˞Ǐऎɺ҂ƿۖFॴ̀Ґaक़žїԽҡȹĂؗͅ৫ᇵ࢓"],encodeOffsets:[[39724,34180]]}},{type:"Feature",id:"TCD",properties:{name:"Chad"},geometry:{type:"Polygon",coordinates:["@@ĎЄաnDզΓ̶δ૊ੴߌ¬ન͖ၼǼΰΓ˾_ˌ̽ɔȷರࡔҠ…ྑ…ྏ¦ ܥÐϧإɝԯǬȝˡʳĨΏɑΕč̯̎¶Ǯ͕Vӥ̲ʛYȯՏƛэͽ؉ࣹ߅ϳ߹¾ʁûĊ̏ѫ̋Σ͟੓͏ȽȐƓhƹɍۛÙƀɪ˅ׄşΐλƜӷӪǼІϦċʂÐҸSқކŒ֐É֐ͭՠ"],encodeOffsets:[[14844,13169]]}},{type:"Feature",id:"TGO",properties:{name:"Togo"},geometry:{type:"Polygon",coordinates:["@@ڱdzȇ̎ɡՔãкȆݴɁ̬ăڎD؎ΕѠÖˀ݂kŅѵʲʝ̈̋ŽЭǜǥኝȺׅ"],encodeOffsets:[[1911,6290]]}},{type:"Feature",id:"THA",properties:{name:"Thailand"},geometry:{type:"Polygon",coordinates:["@@ݭϬܗeŬڈ݉Káऋґ௯˙ݏÌ؋ն΀ދưܭҶӓԚĭѤѧ˝·ևĵßќۇςƣƭͧ͒ƝжҁӄПЌƏӳǃҲĠԾʚ߬ТࡸҤ޶͟ތ`϶ĩҸ֕ښȩф̄ƺ̮ܶ·ֆՓؘН݆ΠƴϦࣦצœӬθӔȘθʷ´ԍ֨ȷࢭpݫࢰԆʤƧӰzǜَ̊ÍٖڽÀࠥںܷ›܅˙ϛ޿ŦગDž՟ۧȤ১"],encodeOffsets:[[105047,12480]]}},{type:"Feature",id:"TJK",properties:{name:"Tajikistan"},geometry:{type:"Polygon",coordinates:["@@̭ʷࣳƖāӛ࣬Þਢ˗འŶɈާˠĐԜȓ‡͛ŴӍࡿBׁØԻϕύĉ̉ǯͩˠþ۸ʩ¢ĞʲғȐα̇ė͹Żūԇj˕ϩ˯nj؋ˑʱĺӀࡘǹض؟ȨɔφۮŸЌҬˌբ૲ȜǩϵŤɹΎv"],encodeOffsets:[[72719,41211]]}},{type:"Feature",id:"TKM",properties:{name:"Turkmenistan"},geometry:{type:"Polygon",coordinates:["@@ñۼطŠॣݔڣĠगюׯþσƽ֙|ׯӓ݇NjƻרŪ࢞ٽ˶Ɏֺ֏¸Ȇ۾ߊȵ݈ˎؓԎʉӔڱɋď؛ʿհψ˨ॖǪ֨ɻךڅњ¤ॆ\\Əцܖ̂۾ӦଆѹĜڡ͐ǣࣦžˮƳаࡽ०ׇոЃ࢞Щ૤Ϋwԥʩ€Ѕɤſ̙۽NjǙڥӁʭڏŵǫϟهŏࡩ͈"],encodeOffsets:[[62680,36506]]}},{type:"Feature",id:"TLS",properties:{name:"East Timor"},geometry:{type:"Polygon",coordinates:["@@IJȤܢȌז†ˀŀ͆Ľ̯ɫ࢕ο۳ʋeʬďǔ"],encodeOffsets:[[127968,-9106]]}},{type:"Feature",id:"TTO",properties:{name:"Trinidad and Tobago"},geometry:{type:"Polygon",coordinates:["@@ӚŊǮ‡‘صۭġƯúʒɲiͪ"],encodeOffsets:[[-63160,11019]]}},{type:"Feature",id:"TUN",properties:{name:"Tunisia"},geometry:{type:"Polygon",coordinates:["@@ΩພԭͺQȰۉԄóنԮҶȢۚƃߠǠќࣶͺךĵ}ы܊̲ÒljпЫMϱ̆ȽōܫփхDŽқѤaɄЍ͊ſ³٥Хʋʵˏֽ͓ĘΑïΟЧț"],encodeOffsets:[[9710,31035]]}},{type:"Feature",id:"TUR",properties:{name:"Turkey"},geometry:{type:"MultiPolygon",coordinates:[["@@஺͗ঐżܤõলѬࣆ¢ߴЭƜ̑ăУزȻͨʕֻʇˀ५ǏʻҠڧЕƙ̏Ɋ঍ňίŽॗŽҏbॳ̿ەEҁǀऍɹ˝ǐ¯ҷɣǿɣǿ̱Ϡ͈͂ԟí۱ȖֿәౣĥڹҊࣟ†ȗΑׇij߻҄ࣻeӽ࠶ؗҰЦٸՓВठߨಒ’Μྀٔŏ৞հ঒ʄർlุף"],["@@۫ҏ˃Ϻ\\ǦȦĦʺՂХɞࡦ˄ܤőĴ͓ܼ˓Ƶȵি±Ωʷ"]],encodeOffsets:[[[37800,42328]],[[27845,41668]]]}},{type:"Feature",id:"TZA",properties:{name:"United Republic of Tanzania"},geometry:{type:"Polygon",coordinates:["@@ƚġᵂႋÌӣ஼࠿ϱਙ¸Ӊՠ̩~ɓɳԓ¶ʭÇГ̌Ճΐ̰ࠡǿڝӣࣿ͛ԋb̙ʥבsɕŃঢ়ʂكåɽଢ˵ϺǛɶࠗƾӉʨՕƘͯƘΗɈґ੖ӣҺǗӤČѨƯޞΎ ̨̦͜ѬȺǮS˘ǷȐ·ͨʐł¶Ӷͫӄ̎Ķऄ[ႎà"],encodeOffsets:[[34718,-972]]}},{type:"Feature",id:"UGA",properties:{name:"Uganda"},geometry:{type:"Polygon",coordinates:["@@ः\\̍ĵԇʷȯĐPوȜ͎²ڬǰϸ͎Ѭ͔ɠ˒̘͵Ŗ¼চΌɮՖȉڰȠעEԬϮЊ׍İсτ९̧ؓЯ֋ʉͽTࢹႍß"],encodeOffsets:[[32631,-1052]]}},{type:"Feature",id:"UKR",properties:{name:"Ukraine"},geometry:{type:"Polygon",coordinates:["@@̾“ɄȒʮ¥ࢌĆ՞Ӈȿǝêʻڠ£̘ηkǑ੪̏٢Ƅ԰ϿӮVఊ˙XʙͿѯȆҩƃ˩߻Õџɻύڡã֑˕޽«ܣ̻¸ԹЪȭࡨ¼Ǐ̛ँơଛӟұǠȄЂࣽʘƨLjߪ˪ʑȔಯɆË̼ީĻ̷ҧٱةϟƠЁƉϑƺɂĞƦ˾ɲˎÑƮǬäĊśӸ{ɞØƽĎÐŲ̉ɈŧΘ̩ƐÒ˶ϝɦΉŽأʾ֑ĉȧŭΟ@Ƀȟاă˹ŹϷȴ՟HԳĢγǵÍɤұɮǐͺɸɔȀµɑϘބۦиİĜɾхܼДҢɪٲnࡖßबȫڎi͂ŧ̀Ʀɚȝݸ¢ͮąÄцʶȂܞº"],encodeOffsets:[[32549,53353]]}},{type:"Feature",id:"URY",properties:{name:"Uruguay"},geometry:{type:"Polygon",coordinates:["@@ղĚࡆٯ̺|ࡺ՟ڈҫӠֱχЉɸӇεՇॉұاǚғěޥΰ֫ԟҬÞլǾȈS࠸ɤࡺȾڦ"],encodeOffsets:[[-59008,-30941]]}},{type:"Feature",id:"USA",properties:{name:"United States of America"},geometry:{type:"MultiPolygon",coordinates:[["@@ũƕȽŤ|ɾƓ̨¦ĤƤƎÍǔ¸þÜe͐ƙƬñƌőɊ̍q¯͟ǵˏſ"],["@@˭ÑƟǮīèQÀĈî̘āɘŹëĵ"],["@@ĝ҉|Úĸа•"],["@@­µÓŻˆŃȒ’ɤŚêÃʐ˥"],["@@ıĉ˱ƴªÖŸĈȘijȝ"],["@@Ƭңʼƛז½࡬ƅࠂʹڼŊਖɓ˞Tݨʄ߂̧ࠒ͗ں˩ٶˏĈəȢĉ½ĉɦǎĔ¦ȣǜƅɴ@ŬĹĽƫ࢖ЁǶށǚܳʗӹЁҥȁ̍mēĦť˸Ɓɂ@ঊ҆ࡾƀસмfĐ÷ʰƉǒϜƆࠜHޘAˎ͞ŀàࢶ؄ϜƸ౦N໾BĎȺː¦Φž̖Ϣʲٺٚي˨ə֜ƜώʏAଧռӅƢ˝࣋Пࡷ̃ࢱʝѻӿƛȋSѽˤѽΒsė̬ʦȇãʇ֥ƋЗhةƥλ¥ӥ¥۫ʏఀǂʠǃ୳ʥ՗C|ĺʭɷʚǹ׽ؑ٧×Ɏȁª˟ɀǪҍȼƭ^ͅˏ͛ҿڡûʺֲѕ͎įۦljεǴՑևƀׂ˓˜ߛʊÍĖ̃ŠࡁՕدࢇʝցӱнÁэ̱ţ˭इձӁЍЅӽŻׯƪ׍ˬܗώשLεЊঅ֥—͛ȿԡʣŃЯĺƁς͋ȖѻܢϹٞű͢Ǥ֐ɽҦٻ۲͟źࡑϡƭ¦СϼՃȺोŁݗĤٙÍΏſƲɟaͽǴǓLJō̵Ů́ǃ؍€طѺܻĿ؏ȚԹÏۻȝއح࠳γҝБȕϗUׅ¨ЕDŽ˹͝{׭ȂٽʺɽЄȁטӷӐ̃ӰуֺףͲۉgՉڑۣʦѡʪȽҦ˧Ѯӿτїˈ̩̖ป@C΋ڗ@ဩOቿפ౓ТĀǒ੩ĝॕÝƙіխӚϻĴğʌһ¦̝ɪޭĊɉƌĹҢࠁࡊ۩ୠˆȚχˤٯ۴řۆ҃ҞȀۢ…ܜˍ٢͠ߊĸނĺނƱૼˇܘʓ϶ĸǐ௒˷҂ߋȺɜƇې˷ێᛸ@᠂@ࠜ@ᢢ@៚@ᡀ@ᡄ@᭰@ᮞBაAF͔˴J"],["@@࠽͋ѕɐŽЀބ̘҆Ÿ֐ÉΤʻܫЍ"],["@@ԧŽսƾԛɮࠦƞښùĂ͑"],["@@԰DžԾĒڸɛ࠲őéĝُDZٕǾ͋Ʋݍµȧôº̈́"],["@@؊ϛώnjහ»¹ȕ౾ƛࡨČᄚ˅ྤā٨ʼn૦Ǝౢʧࣲŝ@@MᷱIⷍࠠ{ࠌɵהρݜցࠈҺࡈ˖Ҁѡ֤·ޒϙՂ׽࡮य़ේ՗xՋұЙҥ͂ݍˌʃܺએںҍߎ߯Ä೷rটʌ჉ࢎߩDŽ฽̜୑í࿻ϬৃΨटǯǦ׏ҫÁঁǫ݉˱झdzťӶϚࠚࣀʶɱɂੱҵֵ֑௅ױؚСߏ׿ࣗΗࡁʱȻωಽѡ˅ϿছΫֽÞ޷ɻ࡝˹ۧ˫෹ʉſƘऀϾࠔʸࣆҠਬĨвΈ୘ԊȈǚب̒ƢْђӸॹʫ˓Ơҕ̧շюɧ̝̽м࠿ͳԩBïԄƲ̮ե̚થLJ܁ЀַȬIӈ٩Ϊ͘ӘۆҸ̚њںÖ־ƇڴМ؎ï٘ʼƻϨҹưج͖ԩWࢻǽʯȃڏȄஏĥ௷ȬΛ͸੟Ӧ୾ΘመШ۔@ŕнᄢŽڽԶਕ͌ױр߫ΨଽˈҺѲ๰‚ਗ਼ϦȨФ࡬ЎࠊĪཪώޜÉಐ҄ౚǭ"]],encodeOffsets:[[[-159275,19542]],[[-159825,21140]],[[-160520,21686]],[[-161436,21834]],[[-163169,22510]],[[-97093,50575]],[[-156678,58487]],[[-169553,61348]],[[-175853,65314]],[[-158789,72856]]]}},{type:"Feature",id:"UZB",properties:{name:"Uzbekistan"},geometry:{type:"Polygon",coordinates:["@@xԦૣά࢝ЪշЄ॥׈Яࡾ˭ƴࣥ͏ǤěڢଅѺ۽ӥܕ́Ɛхॅ[ᶾᓘӺƾïದ׻یͅߤݵঢŪ෸à৔ؗÙࡅЦMǢۍ੬ɲЉ̺Lπ׺૎הӖƺʠĉ۵խئ́ײȾ়ѷ੽؁ٕĊ΍uţɺǪ϶૱țˋաЋҫۭ ɓυؠȧǺصҿࡗهǰҳN"],encodeOffsets:[[68116,38260]]}},{type:"Feature",id:"VEN",properties:{name:"Venezuela"},geometry:{type:"Polygon",coordinates:["@@yȣӱĭ˜ϡYѭυӥ͆ڙδÆȌ؈ʻ̒§َਸ਼΀řІ̎ˆ̞ןל_մҵ˧ݮQ࣌ĔӖϕٞĻҼʾXɄਨ¼৖\\܉ʛ˼Їڦ×ِЯƆڧѬn͢ȣڕӱó̫˾̷ȽƽԫƉjϱɫɱّ֪Őʁ̭͍ऱ̽׿Žʏȣڛɀثņƿýϔɑ‘֝ŜՉ܆ï°ǭ׷ʅĭΣΉƏسȝNjʱٷÅҧѼʯ࠺ɟ̧̌Ȅюм…ȊʅʠǛ֒à׼Ȉ˰ƲҎ̓Ơӏĩ؁®ͻęסܢӥńઉăȧ̊ȷê‡ǬĴ̶áͺȃȂŅϮѡÈɸӮĺ׶ʔ̸͘ʌɈрդƖ"],encodeOffsets:[[-73043,12059]]}},{type:"Feature",id:"VNM",properties:{name:"Vietnam"},geometry:{type:"Polygon",coordinates:["@@૭ܗ۫ߍȁ׍٠ࢭ޺ળނԱԞګϪ།ŕ๓۫փ१եۇ۫਷ޱ̧ՠʀ֬دӌܬ͸ࢦÔσԚප٨ļ৖ț֖ƶࡀɃצٍאՋ݌ۥ঴৓Ԋʊ̠՞ɘ͙ܺਙPϕކӭڐҊȴڢIࠈĬܒ҄К̿ސƵƃӛАͿࡎɓ"],encodeOffsets:[[110644,22070]]}},{type:"Feature",id:"VUT",properties:{name:"Vanuatu"},geometry:{type:"MultiPolygon",coordinates:[["@@ˣō˭ςŒɤՆӗ"],["@@ƌڱɥŀǩ­ťɴi٢Дʵ"]],encodeOffsets:[[[171874,-16861]],[[171119,-15292]]]}},{type:"Feature",id:"PSE",properties:{name:"West Bank"},geometry:{type:"Polygon",coordinates:["@@@ԣŭʙЃŕ˜ɜɌŚɁĦǬ̤֔ś"],encodeOffsets:[[36399,33172]]}},{type:"Feature",id:"YEM",properties:{name:"Yemen"},geometry:{type:"Polygon",coordinates:["@@؉ɥNjύo˹࠷Οഇϻݩףυ±ʥºӭΑ՗lj۷©ɃµǿɛəÕŻɇеlˍœ׉¨ɓӬzҠƍʜǑتʋΊǚ¤đϨĸNJ™ξςˌđΠɞЮΊɓɬúॺnƸċ߼č͐¨ɂ˫ϺƖ׼ࢦ޸Ϛᝒ͒ڀ൳˞ח"],encodeOffsets:[[54384,17051]]}},{type:"Feature",id:"ZAF",properties:{name:"South Africa"},geometry:{type:"Polygon",coordinates:["@@ǏŧΣяɻћӇ׻ोࢁףԋًϣ࢛͙ѓ«ŇɷԛŰеDž࣫NJԙĹΏ¬ࡿͩܓƃԱͅϡoΣ̚˳fαϒŸśŏɦLӰ˙֞˔ƴs٤ս޼х܈AF׽તДдͪɯƘΫϘÓՈǃҌÖݤіB᷌ɨűӾߙûԟȈ̏׼ĒрϒЊʨȶДЦȚΠķВɽۂ£՞ȜĐʾƨДҚäʨ͂˪֔ݮغஒؤ΂UОƛ˲Ķ҂ċД஁ɔׯƫऩî̟чƶʏÑāʓɯ̿T̃ԆҕӮĜǢώْQȿؑıۥɑϛֵщ","@@νʶϻǟҕ҃͡Տـ٧̜ČƺˎҴƀƜ˜ʴФ̅ʪ"],encodeOffsets:[[32278,-29959],[29674,-29650]]}},{type:"Feature",id:"ZMB",properties:{name:"Zambia"},geometry:{type:"Polygon",coordinates:["@@ІϏɊ܋ƝɩǙڻLjۡ˃̇ʭޭѶɓᢇۗĂׯٍřӍͯĹ̛̅ßܵۓҭխ˳o˗ĬऱĠƯÚOêͧȎկ¶ۋȑչԾ֣یžᦶშYí̂Ű̀ƧЀĪТėʺ̂q¶ʽϾrՖûˬϡڨŝԤˆȌѯ٠ş̴ΧΈҥ٠Që࣠ɱƳח͞ɧƬļࡈƬসȉψʈ՚ɤĶ଀ƚͦđΘɇͰƗՖƗӊʧ"],encodeOffsets:[[33546,-9452]]}},{type:"Feature",id:"ZWE",properties:{name:"Zimbabwe"},geometry:{type:"Polygon",coordinates:["@@ҁČ˱ĵНƜ΁VՙϞٯźʙՒC̒έĞ्ई˃ӢǛƮ͓ڤलğ˘ī˴pҮծܶ۔̜àĺ̆ӎͰَŚÆ̻۬hϴǯǺȻАÓѦˑF੟Ǐ׋—عƊʝħӵŵùɛ؅ࢫ॓"],encodeOffsets:[[31941,-22785]]}}],UTF8Encoding:!0} +}),define("echarts/util/mapData/geoJson/xiang_gang_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"8100",properties:{name:"香港",cp:[114.2784,22.3057],childNum:1},geometry:{type:"Polygon",coordinates:["@@™@}ScTʟ@cWuJÁ–]„l¦RLj¼BĄà˜ ŽH@TOHCTDDDHDNAT@PEHDDNJLX@BABALHFF@DKHADBBLDHHFBLEJB@GDBBFBADDB@@KFAFBBJJA@BB@@FFDDADFF@FADDDBJC@AFBD@@DDD@DAA@D@DB@DHHBFJBBFEHDFAN@DGDC@DLCBDDCFDlAFBFCBEF@BC@GDAB@FD@DZJ‚X´HĐMja@Ý`p_PCZ@lLnRGSDMFK|a\\Y}­ƒ§™Mën"],encodeOffsets:[[117078,22678]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/xin_jiang_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"6528",properties:{name:"巴音郭楞蒙古自治州",cp:[88.1653,39.6002],childNum:9},geometry:{type:"Polygon",coordinates:["@@˜@ÈÒĊanwŎV„™Ȯ¦ͪŃĢ„ÜōȂçČéƐżLɆóĊ‚ĊaʊŁ±¯²Um»ˌmÈ»V™ʠţWÑůǓ郙ôƑƒğÆīŎī@Ƿ™wô™˺LÞ¯ƨVǪуšĢ™ȘV°wĢŽôk°¯ƒ»΀@Ȃ»ĸŽǔ@΀ƒ͔ôôLɆó̐ÝɜLɲōͪƒƨóŤK@ī@IU܃ÛmȻţǩÝ˹ÛljťǓǫō@Ɲ²¯VçōKͿŁΗÇţ»ƽ™ɅƑLÓŏÅÅɱV@ÝĊU¯ÑĊĭÞLšÞŎJ±̃XȣˌōlƒUÈ¯ŎKÆƅ°™XÑܱnŗġV¯™óaUƒƧUōŁ„Ñ™±„çɲ¥lĉkğ°ƒk¥˜ƒnğţL¯ÝÝUƽĬ΁lķ°@„ō„XÿݯV»ŹLʉÞɱŤĉó°ÝJ™¦ÝKÝ£ţܙÈĉ@ƒxǩUċƑ@ky͓¹™`U²ĉVġ»ğa¯¥ť@ĉ™‚ó@ŻÛÛJƒw¯nó¯ġWƽʩķÝɛwĉĕݼȭÞķō@ó£Å΀ƑŽ¯ôȯÞ¯Ȱ™ÆōèĉXǼó@ݚnºƒĸ„ÞVƜĸȚUʶõˀĵĖɱŎÝĖVࢰӒѢ°˘nϚVˌ™ÈmɼĵŦW¤öʊõʔ@°ÈXVŽ™ènŎȁb¯ǫĉ„±Èğ`ġwōÔğ»mVVŽ„Ý¥ó@™ĸķô@ššbX„ĶmV²²`Þ_˜˜ɴbͪÈ°„ÞWĸÈŌmބškɲŽÈUÆ»n¼ǬVķĸźô¯°n¦ɄǜÈ"],encodeOffsets:[[86986,44534]]}},{type:"Feature",id:"6532",properties:{name:"和田地区",cp:[81.167,36.9855],childNum:8},geometry:{type:"Polygon",coordinates:["@@ƨ¥šèź٨ΘƑᩄbUࢯÞĕɲōĶĕöʿVʵķșUƛƒÝ„ķm¹Þ™ô@È»ĊWŎçšÅ°ȯȰÝ°óƒÆͿĉ»̽çnƒmɱĵƧºóU™™ƽ@±wóL¯°̻L±Æ¯Vƴķb¯VÇ¥ğ²Ǖbk¥ÇKlÅɱġ@у™óK@™ÇaÝXğţxĉČǫķê¯K@уaŹ„ƑKƒ¼¯Vóaónġw™óÞéU™ġbóĉğÇl¹™aUóğKW„Vůn›ÇŋƑ›ķnʇ»óxĉw™çÇ°Åw™°ċ„XŽ™„ób±ƒkÈÇJ—ƒm²ţx@ÒݎšŦǺn„ó¼n°ÇbUÒ±¼XĸĠłƽXmwĉºƒzÈÜmnxmx²ĖmҚbnŽƧêUºĊêÆVóĖóUĉ¼ÅĬƑ°ɆƆŻŚlłÞLš¼nĠƒ¼@ޙšÞź@ŎÞ°VšɄɴжϼِ͈Ŏ„"],encodeOffsets:[[81293,39764]]}},{type:"Feature",id:"6522",properties:{name:"哈密地区",cp:[93.7793,42.9236],childNum:3},geometry:{type:"Polygon",coordinates:["@@WnŐÆĶLĢ¦ţºź„lxÅĸƽŚ‚Ʉ—Į˜è@ô²ÞUĔƐńV°¯ĸX¦Ɛm̐bƒ»Ɇa΀šĢ™ƐLˤ™ȘÑnƒІljĸÿn¯ĶaŎ¯ĢĕȘ¯°΂œla¯¥™ǕǔwˤӱlťО̻nŻmɃĕċţUw°WUóƨÅţķ°ýV±óÅǓéʉ¯ƽŁƒéōǖȁÝƏůǕw˹ǫȗǓƧǕVý™é@ĬţLƧôͩ„ɱŎɛK̏ÞɅôóK@²@°ōؚ¼lŦ¯ŰóƜÛlV¼ķ¼ƒ°kȰ™Ű„ĠƒǬ™ŚÝŎmĖ`@ÇÜn„"],encodeOffsets:[[93387,44539]]}},{type:"Feature",id:"6529",properties:{name:"阿克苏地区",cp:[82.9797,41.0229],childNum:10},geometry:{type:"Polygon",coordinates:["@@VƚxˌŎÞŎƒ°n„ȂÒ°²VĊ¯VğƾˍǬƨÞÞKÈÞĊVźôɆÞĢèŌôWČ²ŤVÞĸʶbl‚¯ôn_VÆĸlmÞnVź_ĸ¼Ȯmǖ„šéĸW°°„ĸJ„kʠ¼Æw°¤ÈƒlxɆzČºĶI²ÆǔUš°ô@Þ¦‚ƒUnUĠ¼ŎÓĢxĠ_²ÇĊƒǬ°ŽȂamōšçUÇW@¯öʓõʉX£ĶťnɻšÇUˋmϙ¯˗ӑѡᩃaΗƒœɜ°xWƴUxɃÒˣ¤Ʌwğ„ʉōóÝŹ±°ȗ@¯„ƃ²¼","@@ō™гwȁ¥Ƨ°ŹÑķV™¼ÞêĊ»‚lĵšm¦ÅW@ĀôÈźaɜxÈbÞÆĶIОŘnIÇŃÛÝĊÑĠƏ"],encodeOffsets:[[80022,41294],[83914,41474]]}},{type:"Feature",id:"6543",properties:{name:"阿勒泰地区",cp:[88.2971,47.0929],childNum:7},geometry:{type:"Polygon",coordinates:["@@ɲˣĊIÈ¥‚ÅU±Ċýkō°ƒĉƽó»ĶƽXóʵʵ™ȯƑÅȁɅ¯ĉ@ÇሗK֛@@ˤV֜ʵрƒǬVĸƑŎ@ƆϯÑóŽķ@ʇ»ķ¦έmlÈĸĊX¼WźÛÞÝѸ‚ĢČþ„ĀĊôάVö¼ĊUƨ°°èŎČUÜƐóôVôôŽ²êȘlˌç°`n²ǬŽĊaš™ƒÛ°±kğmm»š@°ÝɆÛÅÇVaݍVm͔ğôÝÈb‚„@„ƒ™n¯š™ÜUĢÑĊ@źīżWŤÈǖWôŁÆI²ÓƨL@ŽĊX„mmÑÆ»ȰÑkƒĶō@ý°m—¯"],encodeOffsets:[[92656,48460]]}},{type:"Feature",id:"6531",properties:{name:"喀什地区",cp:[77.168,37.8534],childNum:13},geometry:{type:"Polygon",coordinates:["@@Č@°ƒĠ„ôÓô@Ŏĉ@Ƴĸ@Ť£ĢlVôWVóřXĉŤêÞ@ƐÒĢÑlèÈV@šĠIk°ÆŘ@ÈÈĀ@ǶťÒğ@š„@ÒĉlŻ_@šƧĖÅĬōÆ@bźÞnƒƒlVœÝĬšWƼʇ„ƒÝÅ@ÇÅÈwWóĉ±ğz‚ĬČƨƂÝIĉݯbÇÑĉƒ¯ʈV°xUŰĊ¤ƪ_ôÓɚI@lȚXȮ™ŎlɴȘ՘š„¦ɲÆʈ_ɴŽźŽôÞʊŎĠƒɆxˤ£ɄÑVwXƳ¯w›ɛŹ٧™çƧ¦ōƒُ͇еϻɃɳU™Ý¯@ōÝŹš™@݄»mğ™»ÝKkŁżřɅƅƒ¯ÆīĊ»ôVôĕÅUĉéV¹ƨém™anѱĕnwmwnÇۄyĉ¹ŹlŏkĵèķmōÞġKñÔċKÅèĉzƒŽ„ômxȗÿƿI@þÅČÝKÝ°@¼ÈVºš@ÅĢšÆUċłn„ÝÆǕČĵJm£ÝJ¦@ĊƒxV°ƏLċ¼ǩ™@™m@ÅĢómÇÆğ¹Çš™ÆšĖÞKšx„wô¦ÆÑÆL²ÆƾŽU„Ž±ŚÅŻĖ@ĬŤÈñ„@ǔÇx„Èǃ","@@VÇ™ţ°ğUĠ¯mk¯ó¥ķIġÿƏbƒ„ĉa±ÒĸĀlKU„_m»nwšŽ„m@ÈŤ¦ĉbÞ°±Þżł̦°ĢŁVé"],encodeOffsets:[[76624,39196],[81507,40877]]}},{type:"Feature",id:"6542",properties:{name:"塔城地区",cp:[86.6272,45.8514],childNum:7},geometry:{type:"Polygon",coordinates:["@@ήnĸ¥ʈ¼ĸ@ôϰÒ@ƅƒōUķƑǫʶпU֛܃LګK@΋ĸ@Æ£ÞġÅĠċšLV݄»™@Å»Ýnm¯š»nŻĊ@nķŃ@¯ómóÛÝǟ¯aÝóȭ¥ƒšōUmxĉbÇї@›bUº¯X¯ÆƧbVÒĉnǕw¯°ƑŽV„—ŽÇ@kx±Uƒšɱn™ŽÅKƒ„¯ƒĠǠU°ɜL@°ƒxnĬ‚ĀŋŎÇLƒŽğšϱÞέƜkôÅĀǕłƒĸĊŤUŰĢ°„¦ȂϰÜɨ°x@°żǠÆƈČVĠ»ČL°ÇšbĊÑ̐óÞlĶwބɆVÞwǬxǪţȼÜLŐĶˢ@","@@óKĵĀV͈ĉłƾNJÆŤƒzXl°ƒÆL²¼źŽôÈĢǔ™¦l„ô°ɜÞʊĠğŃm»ʵƳƑʝȗīV¥¯ĉ°Ñ@ŃÅI™»ĉmğn™ƒašƒċƨbš™Vğ—w›ġ¯@Uōa™ĉÝJğÑÆŎkŎÞĀlźƒ¦"],encodeOffsets:[[87593,48184],[86884,45760]]}},{type:"Feature",id:"6523",properties:{name:"昌吉回族自治州",cp:[89.6814,44.4507],childNum:7},geometry:{type:"MultiPolygon",coordinates:[["@@መL@È°ĊȂɆƒÆĊ£„ťôWÓɆbĢÅŎƒÆ¦ČÑW¥°ķU¯ƏŃVē±Ý@ó—ç˜ĭɃƾřÆķkwŹƒŤ¹ġ¥ĵKŏÅXmˍщwǓ¤Ƒ@wóōVķ£ɱšġôÛa±Òȁ„óèţIVŽƽ¼k¤ó¹ġJmx—»ÝUƒ²™@ÅƃĸǫŎ„ĊmŎǬ՘"],["@@Þô°bÞǠôÜôn@°ĸń˜Ƕkłƒ¼UޙKğȂÆÝĢŤķ@@ΌڬL܄K@ˣȂ˭lĉńW¥ĵVÆý@ŃÞēUŃȗƅ@ŹƩǕĉ»k»Ç™VğóřX™ŻKƏŽċêȁèÛŎġƒͩń"]],encodeOffsets:[[[90113,46080]],[[87638,44579]]]}},{type:"Feature",id:"6530",properties:{name:"克孜勒苏柯尔克孜自治州",cp:[74.6301,39.5233],childNum:4},geometry:{type:"Polygon",coordinates:["@@ˎǫĠƽ°UUĉ¯±ȁÑmƒ„¯Ýōˋō™wUű»ÅƑ°ƒȘ@²¯ɳʇ`ɱŃ¥՗™ɳȗōkȭšșW@kəJóÔƩ`ĉ£Vů¯wU°ʇĊ„ÈÒ°aĊÞÞJŁċƧīĠyĊ²XôÇxÈÆÆ@„ÞʈƒÅ»™XÞīU›Ƒkm„ŹÝ@aŎÅÆīƨĕ@™ż`Ċk@љƒĠ@ŦÑ@ǵÇÿ@ÇÅŗl¯ğJ@™ÇUkçġÒƏÑÝ@ţéWĊôŚUŽóXUġkţ¤ķ@@ƴōĊó@óÔğƒ¯„ċ@@Қ¤kôˣŰ͓„k»ƒKX¯ċwƧôğɐšÒôIVƙš¯UķǬķšnŽ™¼ôb°ÒȰVVÈÞ°ƒĸó¤V¼°„V°²êƒlĢ҂Uƨ¦ôȰƴĊVV¼ǖIċĊ„ÞɜéšnČW˸Ǹša„řÈw±īšçĸ¤ĊšôšwšŽĸUĢ¦˜éǖĬ„Āô¼lÞkÒ°x°ƆÞx„šÆV²ǔ»„b°wގȘ¥°n„šŎV@°„„ʠè‚ŰȂb"],encodeOffsets:[[80269,42396]]}},{type:"Feature",id:"6521",properties:{name:"吐鲁番地区",cp:[89.6375,42.4127],childNum:3},geometry:{type:"Polygon",coordinates:["@@ôK„ĉǪa²¼lÜô@ʠê°Ĭ™ôȂƒ²ÑÜbĢóɲ™ĸ¤ŎUô@xƒŽǔ£ъxˎmƒÈÛ@‚_nĕÞōšř„ǫƒğšůlȯ„¯ĸ»U»Ükôƛ°ůkť™»Ŏŗ@¯@±͓óͿ„Ǔ@ķȁ¼Ϳ@Ƒ¼¯°ólġ¯xȗUġšƑ™ǩÒƧUÝ°˹Kóššx@ǸōĬÅĬƑĠ󃄚ǔêÆ°XÒʟŤUšÇ¼ˋnn¼±V²°ȂUŌݜbʟǔɅô@żǬaҎÈ"],encodeOffsets:[[90248,44371]]}},{type:"Feature",id:"6540",properties:{name:"伊犁哈萨克自治州",cp:[82.5513,43.5498],childNum:10},geometry:{type:"MultiPolygon",coordinates:[["@@ĉ„ÆŘȁ̐mÞ¯ĀX°±¼@ƾ¯ƴ°ŎÝþŋ¦WÜÞbȂĉźUœÇmwVUȂóô@ȰÝ΀nÆJn™ƾ™ʠ™ŌLČóǪ¯œ¥ǔaǖšŌaôÝĢLšx„ƒÆLšɲm„™²VlwÈ@˜Uƒƒ°¯ǖxĊmUÑƨa°Å°WV¹œa›ÇɃÈm¥°¯ŹóĸķǫUm»Å¼ÇVɱ™l݃ŋnķÇÝX¯ƒͩÇɳa——Ý`±_U±ĵnWƒ™a@™ĸóšķ™¯ǓV±ÅĵJċ¹ɅykwDŽ¯£Åxʟ»ƒlķI¯ƒX¯ķ‚™êǕƒȭnķ»Ź`±„kÞ@Žš„Ýô@Þ°xšŤŎIƨÆUxōš¯²ǔĬǬlUŚ"],["@@ÞĀlźƒ¦¯ĸŤKޙšƒċƨbš™Vğ—w›ġ¯@ţƽJ"]],encodeOffsets:[[[82722,44337]],[[86817,45456]]]}},{type:"Feature",id:"6527",properties:{name:"博尔塔拉蒙古自治州",cp:[81.8481,44.6979],childNum:3},geometry:{type:"Polygon",coordinates:["@@ήƛϲÝĠ™„ÈKŌōÿmī„w@¯ɛKV¯ğǟ°Ƒ™wġKóÞŋbǕ™Ǔb›¦ǩ°ċôŋKʟšƽšmšÅImŽͿŽȯÞó@ȁôUVnx›ÈŹVȁĊÝabŻ£¯°l„óxȂŤĸkĊšÞyĊêĊmĢxV„ƨÈŽĠX„ŽΘÆĠÔź‚Ɇţ°LXƾŤŤb"],encodeOffsets:[[84555,46311]]}},{type:"Feature",id:"6501",properties:{name:"乌鲁木齐市",cp:[87.9236,43.5883],childNum:4},geometry:{type:"Polygon",coordinates:["@@šŽWŽôŚUĠȚl¼Ċ¼ƪǖ@źȘƆ@ýlܚXVŘޙš¦V¼kĖó҃èkĊȁˮ֜@ǫ՗nōƒĉǬō„ķÆŚ@„±ÞV˜¼nwĢIôºl£ƾ»UŤJôçšó¯īʟéó@kÛ±»ǩbƒĊóLҍÇǫb@ŻɆóʠǓ›aŋÞȁVʉłĉbĉɅô"],encodeOffsets:[[88887,44146]]}},{type:"Feature",id:"6502",properties:{name:"克拉玛依市",cp:[85.2869,45.5054],childNum:2},geometry:{type:"MultiPolygon",coordinates:[["@@ɜÞʊĊýVaŃm»ʵƳƑʝȗīV¥¯ĉ°Ñ@ŃÅI™»ĉmğn™ƒaݚţL°ķóKĵĀV͈ĉłƾNJÆŤƒzXl°ƒÆL²¼źŽôÈĢǔ™¦l„ô°"],["@@ƾIŤ@UUwōa™ĉÝJğÑÆŎkŎ"]],encodeOffsets:[[[87424,47245]],[[86817,45456]]]}},{type:"Feature",id:"659002",properties:{name:"阿拉尔市",cp:[81.2769,40.6549],childNum:1},geometry:{type:"Polygon",coordinates:["@@nIÇŃÛÝĊÑĠƏō™гwȁ¥Ƨ°ŹÑķV™¼ÞêĊ»‚lĵšm¦ÅW@ĀôÈźaɜxÈbÞÆĶIОŘ"],encodeOffsets:[[83824,41929]]}},{type:"Feature",id:"659003",properties:{name:"图木舒克市",cp:[79.1345,39.8749],childNum:1},geometry:{type:"Polygon",coordinates:["@@VéVÇ™ţ°ğUĠ¯mk¯ó¥ķIġÿƏbƒ„ĉa±ÒĸĀlKU„_m»nwšŽ„m@ÈŤ¦ĉbÞ°±Þżł̦°ĢŁ"],encodeOffsets:[[81496,40962]]}},{type:"Feature",id:"659004",properties:{name:"五家渠市",cp:[87.5391,44.3024],childNum:1},geometry:{type:"Polygon",coordinates:["@@„çôÑlĕU»™¥ÝšUŗ™WkÛ@þVńÝĔ@ńÅþĶUX¦Æƒ"],encodeOffsets:[[89674,45636]]}},{type:"Feature",id:"659001",properties:{name:"石河子市",cp:[86.0229,44.2914],childNum:1},geometry:{type:"Polygon",coordinates:["@@lŁ—ǵm‚ĉ@mż™¼n°ÞmƼš@"],encodeOffsets:[[88178,45529]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/xi_zang_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"5424",properties:{name:"那曲地区",cp:[88.1982,33.3215],childNum:10},geometry:{type:"Polygon",coordinates:["@@ƨʔĸbܺÞwnxźbÞ°ô@„ĶŽĸIȼĊJŎÈôUšÝƒ¤ǔLސŎ@ĢŽȘblƒôL„ÇźçȤôLš¥ÞIÞ¯Ķxʊťƨ™ƿÑĉXVķŦ¯ȂKÇǕšÑ¯IUš£¯Óƿ£VĕōÞÿÆwƒƑ„£ǖxÞĕ±ÇÝaUÑȃU¯‚UōÈ݃wWŁĵ™±Ý„óĢÿ°IÞ±mÅĢ¯mÿ„¥°UnÑŤĢĕĶwǬŻͪwŎ¼źÇĢ„ĠĕˎŁ°óƨ¼Èa‚m@¥°wǔ„ǖ°ŽƨÇŤœšġƨ„ŎŃôbÈÛŎĊ°@Ġw²ÑÞJƃÆb²ƒ°êĊUނlȲƒV„ÈKĊÒĸĉ›»ÅôťUÅǃk¯@ǂÑklǁÅl™Ģ™VÑóƒ@°@„ÛĸƒV¯ƒÇĊ™n¯Uĕšƽ¯m›¯b™È@Ò°Ĭƒbĵ›¼„‚kxķýÇJk£ÝaUÑÅóĶǟkÓʉnĉƒÝ¼Ƒ„ó»Þmn£m™Č¯@ƒȮÿV¯ĸƒ™k@Ýówƒ»ğ„ġ±ǓLō„ƒšV¼Əèķĉ™è±b@Òţ„UÑóakƒl£™Ó@¯L@™ÇlUóȁš¯aġÈÅĕÝLķ¯Ė¯@WĬ—x‚ÒÈnW°ţôU²ǓÓġ²V°¯ôƒǔÝL—ċšk™š»Ý»Ýš¯ÞƒVƒwۄÝÇōͩÈĉċ»ĉm¯£W¥ţKkóġƏW@¯±kōŽÈ›b@җšÇaƒÆ¯a™„ƒkóŽÛƒÇ¦Ýa¯šÝ™ĉ@ǻۄmƒǓxķƛ¯lVĀÅÞġb™™ÇJUÅV™ĖƑW™zō»ōšƒW™n@è¯ÞóVkwƩnkźÇބҙޯƒƒýğÇUxÆÈnè±bĉÝ»ÈуwšwÞ@m»ÈV@ýÇ°ķ™xƒa„ݯXċ¥ƒÈóW@ôkxlnxVÈóĊkŤġ¼@°¯ŰƑL̻۱ŎÝV—Þ›VƒÇÞŎÇakƞ‚š@èğŎĸżšƾ°ÒšLÞôĠKȰĖźVÈÒĠ„¤™VôšŽU„ÈþťL@ôǬÞlÜÈnÇÒUŚ™@šĊƨW°™°Xƒ‚@ČÇþ„ƴĉÒķ¦@ŽĢôWĀôłUÞĢǬ™ź°¼š@ƒôV°„bUÆnzm¤ƽĸƒÈ"],encodeOffsets:[[88133,36721]]}},{type:"Feature",id:"5425",properties:{name:"阿里地区",cp:[82.3645,32.7667],childNum:7},geometry:{type:"Polygon",coordinates:["@@„Çƾķn£myVŃaU¯„ó™@¯»šŹġǫVÝóŁXÿġó@ĸ¥ĊуƳÈý@ċ„Wš¯X¯ĉƧ‚™š@VřÈÑÇmkÛǫÝ@óŦKÇýVƒ™U󚏃£ğÇÑŹUȯĕğLÝó™K¯Ñ™ƽķŻĠō@灙lƝÈbƍÈ݂„œU˜ÝÞU²ō̼ůƒK°ů@¯UK±—ĊƧbōÇmçÈġƒóšÅób™™źóš¥kīƯól™ç™KôĵUƒÅ„VŃķ¥nÅŏm¯¹Å‚™»@ÑǍóxÝkʇȤU¤ķb@ƒ¯ĊÇx¯ĸĉKm°šĀk¦l„„KnĬȀƾÛ¦WÆŐmNJĉ°ōUţ¤UšŎ°šŎKÞłÆ„Ǔ¦ƒÞ™‚™„ř¯bmUÝl¯Um™ğl¯£șwŎǫaÝnĉĶƒk@¯™K™šō»ĉn™aÞ»ťnkml™ĸ¥UŚŻkÑťƒĉV™ôó°LôīĠU„ÿĉǕÅz±Kƒ¤„²ō¤¯Ė¯UÝ¥Vĵ™óÈťÝwķșÑk¤ó„™ƒWýĵĕ™„VĠƒV󍃎Ǔ„ķ°k±VU±ţ¦UǟÝřJVљ¥XUċUŎlÛƆǕÆȗƆ¯wŏÞÅ@™šĉl݁óŽƒÒ™nUôńlxólÝôێ±™™LÛôÝL@‚ġ¯X¯ÇUżóa󤛼XÒġŎóLk¦‚ôżĸĠ™¼™KġƆô¦„ÆƑÔĉĶ¯ImÒ°¦n°¯Þl˜ÝČn„ƒÒšKĠޚĕkƒlýƾťœšôI‚ĖŤÒnƜm¼¯lnżóÞ@Ůó¦™ôƽĖċŚn°Ý°ôÈUƜƒblÞóŽ@Žǖô°UÈƆ°X„þôŽô‚lѢšŽ²Ėm¦°š@¤™XŽĊblܚzkºƒĖmX„šŎWVšóÞn°lĠxȚa°»żLźƒ„b@Æ°XĠÝȚxĊĕŤaȚ‚°È@„„@èŤ¦Ü¼œW˜ÞkŽÈ@V°lŤkŎ±²¦ƐUšlj°aÈÑŎbĢƒŎbÆ¥ÞIȘlššôVÈU‚™šb„kɲĶn„mnXb̼òƾĖŎ@ĢȂÑôÓĠĖʊšĊÔ"],encodeOffsets:[[88133,36721]]}},{type:"Feature",id:"5423",properties:{name:"日喀则地区",cp:[86.2427,29.5093],childNum:18},geometry:{type:"Polygon",coordinates:["@@ĶĖXþš„ôƒl£šÒĸÇÞxÇŦšôUĶÞ¦°V°ĕŎ£ƒ±„£²LÆyĊǖƒĀğVóĬ¯KóôUš‚ĊŦ„lҙżVÆķ¦kšlnŦmݼšbĊmŎ¼š™šL@°„lĊĵÞmǬbƍȚx°¤Ġknš°VÞkVn°aƒŚš‚š„Ýǔ¥ÅƒÝŁōL¯™ōV™Ť£ŎVĊ¯nljƏXÅÜ¥ǿƽmīƒLkƒl¥™ÿn¯ĊL°ķÈw°ĉ@ƑĸaV£ʈȣÞlôwȎ@Қ¼Æ°ºŐnmÆĸ¦UńƃV„óĶšLšèôkÅ°lĬ™¦Źôššôa™Æ„ôÇĢnèŎÈƨa˜ĉ²‚VLĢ»lţôĉUǂwkmlw@óôX„ÇȦ°WƒÞ„b‚wĸšÈ¯@þÇUn¼Ý@™x„xÇńÞ¼ĊŽ²amçÅÇVwĠȄþ°„šÝƒÑÈÝlŹƪmlxôU°Ý@çšm„XŎ™Ŏ¼šyƒXšĕÆUVÈIššĢaÆÝUÿ°kĸƜǔwn„܃ȼĊ@ޚ°™Þbȥ܄ô„lšƒ°b„ÅÈb˜™@ќa‚ǯUU¯Vġš»ƒ™¯aV¯Ç°Å™mnÑŤçǬVǬ™±ĉ¯¥Vĕ¯Ýk£˜ō—w@±ġÛ°ÇVїƒ@ۘa@ČL™Ƴ™„ƒÇa¯¤ÝIĵ¼U¥ƿōķÅţŻókÝóĕ‚¥¯™U»Æ£X¯ġŃÛkÝ°V°ó¼¯èWôÞĖ„ȎƒŽkĀƧĀówm¥¯JŹÝJݙōVVŁaݐƑ@ƒ˜ğŭǂ¯_ƒ˜ĵ—›VnxŃón›ƒĵxÇĖĉVÝÈğV™Ò󃯐±Żĉ£ķÆÅL™Ljĉý˜ţۃ¯VƒnV¤ÝÈ@°ÅÞݤ™ŰğŁm¦ÝxóKƒ¥ɱÈUĠôêVôÛ¼ÇWÝçĵaō¦óĖƧlÇĢƑŽnŎDŽV¼¼‚ºÛ@m¦ƽ„ĉmm¯ÝKÛç¯bŏłĬ™bƒ¼ÅLmŽ„xť°ÅU™šÝXkŽÝmĉ¦W„¯K„ÒknÝaV„Ýè¯KɅńÝKnÞ¯¼"],encodeOffsets:[[84117,30927]]}},{type:"Feature",id:"5426",properties:{name:"林芝地区",cp:[95.4602,29.1138],childNum:7},geometry:{type:"Polygon",coordinates:["@@‚VÈłVôÈk@š°K@ŽšÔk¤l„ôbVÒŤƒ@ѲašçĸĊƐçU»„™ŎƒǔKĢ²Ġƒ„¼ôx@ޚlƨĬ„Ul¯ÈLV‚šÞJ„°Ünʊ„wÜbXê‚VÞ¯°ššanaU°wƼɴÑWÑ°mÈýÈam¥Þ£Ť@„¥ôblÞĢ„ź¥ôxÈÅmݚ™ƒĕŃV»ĉōŤōnóƒ»ÈīķIUƒĠÑ°ġĸLÞ¯VÒƂ@Ābš¼WôÈ@V¼ôóŤKÈÑU»šwVǫżnWÒÈx™¼‚lŦ£ĊōŤx²¯@ƒÆƒU¯šçÆ@„¤°£„é°k°lšůÈó@¯ŤÇÈĉƒkkÿó¥ÝXķљÜ@ÒóŚÝ¯°ĉówÇ±¦ÅJUÒĉĀķw¯°mĖ¯„±akxÝÅnƒ™»lуK@¯lU™¯UVѯóĊ¯mōğVǓƅƒÞƒWÝÈÛ@ƿô¯ÜġzÅþ¯ólmôʇġĊÅUͿřŏȁˋŁóÇˡōƧƒÇb™w°Ķôk¦šÒƒnUþġҙÔkǔķèó@ƒ²@ŘōńĵyƒzġaݤÅIƒ¤Ƀť¦ğѯ¤ķbóš¯ó±ŽU²°¤ČÜVnÈƂ„ŚŎ°ôĢ„þÆzèVĀǎĀǘƒXŹÑ¯¤ówċķk¦šłUÒġzÇ@ƒ™ÆÝx@²Þ@Ƥ„Uô¦Uš°x„U"],encodeOffsets:[[94737,30809]]}},{type:"Feature",id:"5421",properties:{name:"昌都地区",cp:[97.0203,30.7068],childNum:11},geometry:{type:"Polygon",coordinates:["@@™ŽVĖm°ĉš„ÈU°ķ„ƒÜ¯@@ô„UÒġškš‚ÆkÈlŽÒ@Èl°È„VÆóŦƂœ¼‚a„ÅĢ™Ʉwnōw@¥Ŏ¦°ŹÞmVš°wnÿƒw„wÝw@¯šmÞŗ°wĠ˜ĸkÞğlĔ²¦°@„ĕĸwVóšal@nĢÇĊn°@¦šŽźUXçǔůĸVš™ÆK„ÈÝĠš²ÅĔô@lšŽÈ_m˜„zǖl„šaU¼ôwV°¯¦‚ĬÈa„l@Čǎ„¼™„nŽ˜I„xô»ɜ@ƨ¥ɆŁ„ŃǪȁkƛƨȍʊȡóĭ›@—ÈÇVƒůރĸƅmēƨť™ÅÈʉVǵ°ġVŭÅɧ°ÿnɛš£mƒķ²ŃóÑUĉ°mÇ»¯@mxUĀ¯èţ°ȁÝç„ġU¯ÆÇţÈ@°Çô™Ű¯k¯lƒê¯¤ƒ£Å@™èV°Å„@„±°ţwĉŎť¤kš»ÇwXÑŻmUǬ™xV¼ÇÒţLóôU»Ç@X󙻂a@ÿŁUÑÝ°ķK¯ĢğÒV„ĸJÇĬ„¼môţŎĊŎU¼Æ„„Ė™šnÞÇÆówŹ¦ġƒkÝóaƒ¦ţ@ݤn¦ÇbÇþ¯nXÒɳÒÅ»¯xVmb™b¯™Ý°UWéÛaƒxʉÛmƒ¯ÝI™‚UÇKk°ƒVƧīķ„U°ȭĀ@„ċ°nšm¤Ýnô¼ƒƒÞ»Ċ„ʊmlÔĵǠÆôVÒÞbl¤ÈIĸþlwƒœ»ĶŽ„a¯ī@њǰanœƾ°"],encodeOffsets:[[97302,31917]]}},{type:"Feature",id:"5422",properties:{name:"山南地区",cp:[92.2083,28.3392],childNum:12},geometry:{type:"Polygon",coordinates:["@@°ÞUĖ°¦²ĊôÇÜLǖĀɜŽȘŰÞLĸźêÞ@UÜUŤ°ɞ¯Ü„°WŦĀmŎ„¦ĢyVљŁl¥Čĸôx°£źÒ„Wȗ‚ÿȍUÿ‚çÅyƒýóġō¯ƒřŁmÇÛUċŽ¯£V±²°ôô™ĸa°£ĠÒŦ¥ɄŽ„£ÆJÞ£Ģb„yĶzŎŃ@ŗ„±ô@ĸçlǓšÓĢÑVý„m™Ñl¥ĵó‚¯̻̥™ƛǫÝһÇƧĉyţ¼ҍēVĶĉŎ°ĸmšÞVÝĸ™ÒÛaċ„ó™ŹĖƒèÈÈl¼k¤ÝX@`ސŏ¼Æō¼ÇçĉKUÝÝ£ğ¤@¦ġl¯Òġĉ¯óš™móxÝÞğVšƴċK@—b@ܘ„UÒ¯ÈĢÜ@²˜x—Ŏl¤"],encodeOffsets:[[92363,29672]]}},{type:"Feature",id:"5401",properties:{name:"拉萨市",cp:[91.1865,30.1465],childNum:8},geometry:{type:"Polygon",coordinates:["@@Ŏ²l@°‚XĢƐlôŤLX¦°¤ĊnČ¼ÇĊŎͪÞÈ܃„x„U°Ýޙ޼™¼lšČ™˜ŽÞK„Ǔ°óU¯Ģ±ǔÔV±ŤóX¯ÇmÑ˜wXī°@°ĕĸÞKÆĖĢÇ°bȂ™ÇŁUƒV¯wV™ó¥ƒVÅ£Ý@@±ÞwšÅ‚„È@ƒ¥nōťÿ¯Xۃɝ°ţ¯ÛVVÝ@ŹéķÝKȗůɛǕÿÛKóÈǫšǫUţèmҚn¯Æ°ÈU‚°b„š™¼UĢV°°V"],encodeOffsets:[[92059,30696]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/yun_nan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"5308",properties:{name:"普洱市",cp:[100.7446,23.4229],childNum:10},geometry:{type:"Polygon",coordinates:["@@U‚ô²‚a@Ž²²Ķ¥œV°šĶ²bl¤kVxl‚@œ°‚Ś²@˜„„y„@ô¦¯„@xƒxVxU„VššbVšÜm¼Ŏ„„ĢmºXXWÆ@ĀœšmŽmXU°ÅÒm¼Þx°w„@°‚XêĠ°»nV°U„l@k„@V±ôī@£‚ƒČŃÆ£„KÞý@¥‚k@y„a@—nWV„UVƒšwƒmƒ£Jƒknm@wmkn‚X„˜šX„¥mUUlUnbš¯°ŽnkƒVInlIUw°n™mk@@mlanXlanmšk@wVWUw™_@éĠašnmUaÜ£ƒmXƒ¥¯@@„óUmݯ¯ÞÝlKnxô£š»„»Ġ„J°aV„UÝÿV¥ÛbƒI@wmŽón¯yÛL@ƒWkŎmș`IWa¯K@¯mUnmaXm™bmak„¯ŽƒĢ™ÒÝm¯mV¯KÇb¯KۜWW™X@a™V™knċLUWV™kXóW@k™a@ƒób¯Uƒwmb¥UUlaU¥U£maķšƒKXkƒmÝ@kwmѯk±ċbUUVakaġ¦ƒƒkL@`ƒœ™a¯xƒm™Åƒ™LUWƒ@ċnŎUV°LkL@b°°@¤š²ƒ‚šnôôk„l°kè›ÒÈzV¤È„WôôƒnV@„ƒ¦@¼Ux"],encodeOffsets:[[101903,23637]]}},{type:"Feature",id:"5325",properties:{name:"红河哈尼族彝族自治州",cp:[103.0408,23.6041],childNum:13},geometry:{type:"Polygon",coordinates:["@@°°nÞôV@ƒ°@„¦WŽ„nÛ¤Vbmn™ğb@êš`VxUX@xš„ƏÞUnn˜WÞĸĢƒšÈ@ŽÇè@zÛÜWšÅêlš²„˜KnV¯ĖĊx@bk@@„°JÆ£Èbl„nnm°nlUkVUUwVm„Kn„‚nVŽÞxVLX¥laX@@xl@VzȎVmšk@b°šÈĸmŽV¦`W„XšƒbUb‚bX¼°x@ašVVkn@lþnXUlVxŤÅ„y‚IUƒka‚IŎĊ@lXx@b„z@‚ô„ƒ¥„_V@l‚n@„ôy@al_l`nmƒÈ»@kƒmXwWK™U¯»™a™Å@wƒmUÝKUa™UUƒ™wWƒ@w²»@kƃV£—mm£VKkÑV@@»nwƒ¥™ƒ@kƙnllIVlnLVakalknJšWmnaUaVÑVVލn¥m@ƒ„¯Uÿl™@™™™VçƒaXaV¯UyVLVkš@nJlšXLlŽkxlbla²Òl@nVJVkšx„KlkUaVķÝÑU@Åm¯@±™Uó°ğńķĠmU™Ñ@ǯ¯Å¼@nml@°¯¯`@w™£@¯Çƒk@ƒ»nmċ¯U»™I™Ž¯LÇĶÛn@bó°™U›šwmŽ¯„™Umǯa„™ƒ™ƒI@ykIƒVUŽ¯bƒIğŽƒ¼™¼ó¤mwkLÝÞ"],encodeOffsets:[[104243,23429]]}},{type:"Feature",id:"5326",properties:{name:"文山壮族苗族自治州",cp:[104.8865,23.5712],childNum:8},geometry:{type:"Polygon",coordinates:["@@šwô„š@²¯maUmôUÆxš@Xš˜bÞInlVUVw„JVaU„K°¥„xmÞXnlKlnna°@ĊČ„ÆwUmnkl@°ƒƒ£nyn@VV@Vak™ƒ@@kÞ݄bmx°Vnw°klÞInĖÞVlKl™@Xa°„„KlV„U@šJnx‚U@ÈĢbUKlm@ak_‚wšanWUk°ƒl»„k@Wk@lwU_ƒ@UalóU¥ƒÇnƒ™kJWƒ@mVXx±bƒK@nV±a@™Åa™£ÝK²ƒWknamKknǏk¯ƒaV™™V¯ĀƒU™„™Ò¥ƒI@mm¯¯xōW@@`k@ó»ƒUU¯lm£ÅWlĵ„w@mmwÅmWU@y±U—xmwU„¯Uƒ¥Ý¥¯£m@kŽÇVUV°VbklƒL™wUlUIm‚k@±ÑkbkalwkWKk™mI™@UlUKVzU°Wb„bU蚚@škšVĀƒ°@„n‚m¦ÝŽUUUÒVbmbXn™‚mIkllbUbmKUkkJmkŚ@lš„„¦mx@¼U@lÒULn¤˜nU¤Å„@l±¼@xX„šxV„šVVbÞLVŽ„n@xšÆšb°¼šV"],encodeOffsets:[[106504,25037]]}},{type:"Feature",id:"5303",properties:{name:"曲靖市",cp:[103.9417,25.7025],childNum:9},geometry:{type:"Polygon",coordinates:["@@ȦlKÞĕUV¯Um¯„ÇVUnVVUƒĉn™ĊÇƾLn°°È„JÆw„@lbÞa„¦V„XJ°¯W¯„aÞJVkUša„ƒ@lKnÅmWUk¯a¯»@m±@уkkbWWX_WÓU»_l™kÑm@U»m@l@IWċn¯l@VanV„UV™UVwVx„KȄVmUē‚@„ƒn@VÝÆL„w„VVwnVlmkUVÑÇ°ka@k™ÿÝaÞUl£™›—ċĕX±±ĉƒa@UnVnalónk@wl™UVmkÝJ—aW™™@ÅwóVVnnb±°™@óƒ™xXLWx„n@lǼn„m‚k_k`@bózƒ‚m@kU@ƒ`„¦óƒ@nWš@ÜÅXWw@ƒyƒb¦@ÒlnUb@x™lܐk‚@²Ç@Uƒ¯bmy@kV@bƒb„¦U`lLVx@b—Ll¼Þ¤@„°VVބU@WސUb›J@nnš@lnnm„šxUŽƒUUbƒK@šÇwklkUƒVWakn@ŽlbU@@„ULVxkKUn‚°¯Ò@¼™„kmƒ¦m@kl™Ȱ@lU„l¦„@Vl°wšnnþĊUÆbUx™b„ŽV„šĖU°„a‚nnašV„al@@b"],encodeOffsets:[[106099,27653]]}},{type:"Feature",id:"5323",properties:{name:"楚雄彝族自治州",cp:[101.6016,25.3619],childNum:10},geometry:{type:"Polygon",coordinates:["@@mҁXU`Wnšš™@Xl±¦š„Uxnbl°knmKUx„„ƒxVôUx°¼ôÒȄ°JlnÞKĠœW°¦ƒ„Vx²JVwš_°¥@UV@@wnymknK¯I@‚™²b°ƒš£V¥šwU‚V„¤nLškÆJÈwôô°„l»Č¯ƒġVƒUU@@ƒ°ƒƒÝXl@U»°Å„@U„¯@w±¯VmUUlm@m™„ÑnIVyUwmak£Vwm±—@Çw@nƒ@UxkwlÇnL‚mkř@±Žk™ka@kóJV¯Ç»U£lw¯™Xalbl¥¯UXƒ@a˜™UaÈL@ÇVIVƒkaU¯mm™akLWkUJ¯Umxnšƒ@ƒkUx¯xƒ„mWÅīÝkkbƒŤƒbkxWmXwWk¯wƒKkƒƒLŤċń„@¤óĬU²ƒ@@lƒk¯VmU¯¼@xV@k°l°kbUš°nm‚VnUš@°„š„UVèރÆbUÒÞnU¦›V—¼lô„@Vl"],encodeOffsets:[[103433,26196]]}},{type:"Feature",id:"5329",properties:{name:"大理白族自治州",cp:[99.9536,25.6805],childNum:12},geometry:{type:"Polygon",coordinates:["@@lbœKVIUa˜@²m@b™xôÒÜxXLmbnšl@š„„K°šš¼k„Uô‚xôlV¦nJ„Uš™Ænšm„@šx„ÆwšbXšÆôô„LUVwôK@wlmšaVwœ@WknmƒIUmlnJla@_™@kÝmKUašÑm¯Xw°aUaVl»²JV„bÆJkôĶĀ²VVk„mšbVwUó„wƒƒVwnLlmk¯maVw™ƒ²¥Wkš@™™XmV_‚WnÑUkƒ@k󘻜UV¥ÝmVÑÅa݄UçƒVƒ™@¯V™Umn¯mV™lak¯l¯U@@wğŽW鯁ƒ@¯xÝw¯š¯Jċa¯U¥mLU¤„bÞȤƒbÇLWUwmIUVW¼kbš`U„Vb¯L±ĊÛkƒÿÝKkwƒKţê™UĉþƒÈƒV¯ÞVbUŽ°KVšk²Ý‚mI—ƒmV@kƒm™UkšVxm„¯KXÈķJU¦V°ULWxšL@môƒšb@bkx±LnVUŽVLnkÜWnwlLŃmW@kkJU_ƒV„šWĊ„Þ"],encodeOffsets:[[101408,26770]]}},{type:"Feature",id:"5309",properties:{name:"临沧市",cp:[99.613,24.0546],childNum:8},geometry:{type:"Polygon",coordinates:["@@‚xĢ„l`²X°ŽV„šx@x°Þ°KXašğUњW‚bnIl`X²°b„xl°„„šV@xVxk¦mb„l@xšXV‚ÆzX¤™Æ˜k°„kx@lźêlaX»VUnJVx‚XÈK„aÝȣƒaV£nKV¦°‚Čb°I°™n»ÆÑV¯nWn›™@ÿXÅWWn¹ƒġōƒn»‚ÛU™™aU™VƒUw„w@w°ƒó¥ƒ@ƒz—ƒ±@ř›¯@kUwlk£±aĵŽ¯™›Uĵ¦±±@bó±VÝ@ó¤ƒw¯I@mńóm±XŽ¯IólƒK@š°Ullb™zkKlln@@ԙºƒUmVk²ôҙx™ŎUVóLƒb„ŽmÈnŽmbnl‚a„x@z„@Ǝ„¦kš"],encodeOffsets:[[101251,24734]]}},{type:"Feature",id:"5334",properties:{name:"迪庆藏族自治州",cp:[99.4592,27.9327],childNum:3},geometry:{type:"Polygon",coordinates:["@@W™Xwƒ™@akk@y›—k°īX¥›Uóķ¯w@n»UaVaUۃ¯ƒmV¼k‚™Þċô@n¯xÛÒm„V‚¯Ô@xƒ‚@šk™wm™Åa@ƒUa‚݁¯VŃyV„a@ÿšn»ÝVmank™mmÞÅôƒ@n£±›ğzÇmU¦™Vm„nÜmbn@°nV@xmzÅ@mºV¦k°ln¤š¼õô„n@xkƃIUxUš@Ťƒ¦VšmVkmkXW¤XzVx@ƚx™¼ƒÞ¯b@lVš™ĸގV„m¼XŽm¦V„ŽÞ@Ǝš¹Vón¥ÆKn„‚KX¯x@èĊȱłXšaÆxnlV@UÛlȻkğV¥„m²ljmÅÞĕƒƛm°„ÆmX¤mznƃŽV¦ÞVVb°bnÞWbnŽ°l@V„È@„‚VĵĊ±@ó„InxÆw„¥@£Þ›W¯ĸ£UƒUK‚ƒk±akkkbmWmÈķ„aÆÇU—ȃÆW@wmknmU¯"],encodeOffsets:[[102702,28401]]}},{type:"Feature",id:"5306",properties:{name:"昭通市",cp:[104.0955,27.6031],childNum:11},geometry:{type:"Polygon",coordinates:["@@mƒnK@wmƒUř¥mšóXǓŏmX@Ž—VƒmL@xţ™nk@mlUšŻÒğŋ@ƒL@mmLkm™š@b™XŎW¼ka¯lÇŹ¯aÇ»™ÝÝ_@m„@@a™@UklwUm@ak@ƒb™UmbmƒbV¯™ĕUƒƒšaVwÅaĉVmý™m¯xUkƒ@k¥VƒUXƒ¤VÈm`@„—ńÇÜ@Ākn‚ĔkƞÆĠ„™Þš‚U„VôƆÞI@ŽUxƦn„l@ĊĊnxUÒ°¦Vb¯WUnWŽIml@xn„Ubô¤‚¼ÈxlI„»šKVš„@ÈԂJkšUĖ±ÆVb@nœ„VÜVUVƒšL„wĠl„kn„Ġ@nx°¥Æ„²mUwƒ@m™mÅUl¯UњÑUm„Lll„Il±š@VkwƒW@w°@U»™kUóI°ƒ„»ĢтL„™š`nUĠ²lm„bôV@n„JUxƦX¦l@š‚ŎUƒV„@lV„KVřV£UaÞU™ƒnW@¯VU@ó™"],encodeOffsets:[[107787,28244]]}},{type:"Feature",id:"5301",properties:{name:"昆明市",cp:[102.9199,25.4663],childNum:11},geometry:{type:"Polygon",coordinates:["@@n@Vk‚VUn²°@xƒ°Vƒ@¯ÆV¼k@WŽ„Þ¯„@„@‚VVU„„Ģċ°k¼V„Ċxœ¤Ōœx°mVkƒÑȏšL‚°„x°Xœ°VmĊLVxUĖ°bX¦VW@kšȯlkn@„¥lnšƒ@»°Ñ¯VmlLUwVK@ƒV@ka@lmXb„UlVlkÈx@™„LVa„VV™wnƒmm@km™@mœIVaݏ@XƒVUݯU@ƒÝ£k»˜K@aUwkKV_ƒ¥„a@alU@nz°aV„È@@±lÛšk@wVakm@т¥„a„z‚@XxÆW@ÛX™@m@ƒy@aWw@kōĉJlbV„JƒzţÆUwVkmWkým@Ul™U@b¯wVºƒU™VUêšĠƒXUaUbVĊUŽWXUmkK™™WnUUU™V™ƒƒVV™Ý@kk±‚™¯ƒƒLkƒš±WkXlVklƒ@ƒwXbmLƒ›VUIVmk@Ubma@kkaVKUƒ™kmlXLWn™J¯ÒĊ°@zkºlLUŤn@@n›ô@lƁnmKkÈlxVw„@@mÈx˜@n²Uxl¤nbVxUzmJƒÒnš"],encodeOffsets:[[104828,25999]]}},{type:"Feature",id:"5307",properties:{name:"丽江市",cp:[100.448,26.955],childNum:5},geometry:{type:"Polygon",coordinates:["@@l@™„@w°ÓUnƒÜÑ°w@mČóšÝlU»n°„„VÜUbVbm¼@Ž°xôĸœVW¦¯Ĭlœ˜@zll@b„šWxXš‚a„X@ÆĠÆaXwl@XaƦn¼˜Jn@mnKW¯È»V¯°ak™VanXVwl@VyUĕVU„bÈīlaUk°ƒk¯lƒ²V˜Ukƛô@ƒ„I@mVwĊa„™ƒVaka„™ÆbUŽVLšaXIWKUw™ƒ„aWÑÅKUaVk°ƒ@Uw„ƒ¯¥›XğÝLkm¯Iǃóѯ»™aƒnUl±UĵÿlóÅIƒaU‚±Ik¼UŽVb¯bWxn°™ÒVbnLlޚ@@`kbmIkŽVn„JmnXl›@Ux™bkn@xóLUxVŽƒKóóŐW™™aÅxƒŽ™wƒ@™nÅm™šƒV™„ƒôX„ƒLlVU¤ƒb¦m¼™Ž@ĀƒbU‚„zUƂ°ÞVb@„Æbnššx"],encodeOffsets:[[101937,28227]]}},{type:"Feature",id:"5328",properties:{name:"西双版纳傣族自治州",cp:[100.8984,21.8628],childNum:3},geometry:{type:"Polygon",coordinates:["@@l²°ŽnÒlxÞ@„nWl„Lĸ™nbV¤V¦kbVV‚¦na„x°Vôa@„šb@lôXlWUšVXČKlmššU@bšWXXܛ°LÈa°LnU°‚ÞnšÑ„ġ°lƒnbšaƒ¯¯KWƒœó@kmK@UšĉV@k°„VV¹„a@y‚_ċl_nÓlL@anI@ƒóWl£VU—ƒl™kĕl™šKVw„U@™kVƒam¯ÅL@bƒ‚Ýk@Vn„UbÇbÝwÅ@ċ¥¯lk‚¼ÅŽ™Ò°b@¦nlUn@ŽÇV„mƁbWôU@ÝÅōm™¯ƒaU™™mk™WWw—@±ƒ™n¯U™è™a™Lƒ¯mƒL™škwƒl@°mnÈÒ¯šów@V™xƒĀU¤°Įƒ°Xl"],encodeOffsets:[[102376,22579]]}},{type:"Feature",id:"5305",properties:{name:"保山市",cp:[99.0637,24.9884],childNum:5},geometry:{type:"Polygon",coordinates:["@@X°„Il‚@¦ƒŽÈ¼m¼ÞaÞÅl„ÈxV¼šlVôÈÆlLޣȺlkUƒ‚ƒUw„¯UĕVwĊ@n¦mlnVĸIWÇ°LnƒUwl™šV„n@lnU˜„nJށl±U™¯LVUa°Ý„U„ÇĊýšVŤé„LlxÞL„ĀÜl²ĉ°KUaVƒ™_Źé@klw¯ƒlÅ—šW£ÅyU™W@wƒknal¥Uw@w™Uƒƒk¯ƒw¯aW±k_mJa™XVҙĠWb¯L¯Ý@w™wUƒ¯±Wk_ġƒwƒwōKmb@¤„bk°lĖƒô„UJƒšVnÅlťUš¯°VbnbWxX„m„ÞššWUĀ™L™yWzÛKmbUxVKkn݃kŽVšĀċ¤Ux„@Ž¯Žm@ƒ¦"],encodeOffsets:[[100440,25943]]}},{type:"Feature",id:"5304",properties:{name:"玉溪市",cp:[101.9312,23.8898],childNum:9},geometry:{type:"Polygon",coordinates:["@@l„„L°xXlWxXnlw„a„ţlaÞlÆĬnX„ƒ°wVw„l„@m™nw°VVIXllKšbnnV°lbU„UJ@ÈÇKVb—š@bW„°Vk¦kaWb°škxV¤È¼U°ôI@llblš²š@‚@œó@mm@VţkKl¹@yĉ¯°ÑšIXmWKnkšlV„ULlb@lnbVal@UnVJœU‚„nKWa„x„@lkkUlW²X„™‚l„K°„šl²@lšÞUŽ„U‚„UšVšVVXmššlLVnXWVUĉVaVb„W™ğVéšU„VU¹W»aVa„aW™Xƒ‚_U¥nÇķ¯™@a™lUnǍUyk@@wW@kbW¦UKÝwUmmƒƒLUnVxUVVlk¯mmnƒmkÇaŤ¯I@ƒl@@aĉw°ĕmU—L±ƒk™ÆéX™ÜÛ@yÈç@™Çġ„Ýķ—XmmÝVՙƒ™lmnkbmWkb@nl@nŽmš¯VxkJmUJ„ml¯™°makVVnVƒ¦™Wƒ—Wmnl@xmn„l‚I„¤„n™xU„ƒVUŽmX@˜ƒb@zl@¦Ýþ"],encodeOffsets:[[103703,24874]]}},{type:"Feature",id:"5333",properties:{name:"怒江傈僳族自治州",cp:[99.1516,26.5594],childNum:4},geometry:{type:"Polygon",coordinates:["@@WyX£lWlnnUU™„¥@ţV™Vw„JlÅ@wƒmö󙻂£kml¯U¥n¹Æ@ny@wmU@¯mnamÛnƒšUV¥ÈnĠy²œm¤„@ÆónݚnmlnbÞU‚¥„aV£kU„KWƒ„óšƒmIU¥ókwVólƒ™»¯™ƒL™ƒk@m™naWKÛwóњw@a±n—@VbUJ›LkaƒÝXĉƒ™„UV`lI@lnXÆƑkKmxÛXmlUKVmU²Klw@a™aó„@n™KXwVKU¯V¥mUnkm¥ĉ@UxVĖƒ°Vx„V„klmޙkKWĀkVWšnl°Lnm@°ŽUxlV@nk¦™JVÈ°ŽVÒ@nX°@ÆlUômlnôƒ²nxmłnVV„¯x@Èm°XblVUšl°@xkXU¤WXX‚W„Xƃ„mkÅJmށw±bƒxUīkKmÅVUĖÝèV„kx@š›lX„lnk¤ƒLkŽ‚Ėk¦‚xUššL°‚¯Ė@LnK@b°xVI„¥Ua°Ñ@»nm@¹‚KŎÞÈWln²n"],encodeOffsets:[[101071,28891]]}},{type:"Feature",id:"5331",properties:{name:"德宏傣族景颇族自治州",cp:[98.1299,24.5874],childNum:5},geometry:{type:"Polygon",coordinates:["@@„¥n@°@ƒVwČ£™ÿUlÞ„lmULVwnaÜLXyšzšKVÿ™XݙnƒWƒXwmaUa°¯V™ŦŽÆkUm„™VIƒ„ókĕl¯ƒa@£nama™@¯m¯œó@óyţbġkÅm±ÛammVkƒLwU`Wk@VƒkUmŃlUUKmbkkUVUwƒ¦óŽ°¼šbn°ô¦lºƒz@xšŽ¯„™@UŽ°nƒšU¤ţU„°VƆ@ÈmlnzÞl°¦Æa„xUxƒLkxWƒn@‚š²ŰšW„™‚@°ÈXl°Llx"],encodeOffsets:[[100440,25943]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/zhe_jiang_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3311",properties:{name:"丽水市",cp:[119.5642,28.1854],childNum:9},geometry:{type:"Polygon",coordinates:["@@@V‚bVl@Xn‚UXƒKVŽ@¦nxlUXV‚n„KVmnL‚UV@bn¤lLXK˜²„`nnlJXIVJ‚I„Vnn°KnnVll@VLXWV@UkVaVK„zV@„ƒšVVaUK@U»VUl@@WnUUƒ@wVLn@Vwl@XW°LVbn@VU‚@X„l`@XnKVbkl@XVJlUnlV„„xlL@lnXl„@VšUnV°°„@a„UVLXblWVXn@VVUV@Lš¤VLV„U‚VbnalLUUVX_laVa„WVzXKV@@a@KUmImmXama@kU@yVIUK‚aVa@kXK@aWU@VIUmW@kkVm„Uš@VwUa@K@k@Uƒ`@kUKVk@UV@VaUm²Vy@klUUWUkVmUa@_ƒKVaXa›XmƒU@mUlWkaUXƒ@mmkL@w™JƒnVVÅbWKXa™@@I@aƒJUUÇ@V„UL™W@akLmb@K@a™XXw@mƒVmUVkUy@£@aU@@VkUWm@kUKƒXUWU_mW@wkkmJUUkLWWUXƒW@IkJ@k@mW_kӃ_Ul™Lƒm@I@aUa¯m@kƒa¯LUJƒ@mVVxUb™a@LUKkXƒbm@Uak@@a@Um`ƒIUbUJ@nUVW@@LnVV@lšUbVlUX@`š@blXklW„Ušm„Xlm¦U@@V¯bml@š@nUb@llnn@VbX@lV@ŽUVULmU@JVn„bVbkb™VWxU@@nUVk@"],encodeOffsets:[[121546,28992]]}},{type:"Feature",id:"3301",properties:{name:"杭州市",cp:[119.5313,29.8773],childNum:6},geometry:{type:"Polygon",coordinates:["@@X@l„°KXXlW„b@²„`šššb‚I„šX`l@„@bWl@n@VnLUV@V„@°¦@šl@XVlU@š@xVbUb@Vkb@‚@XVJVz™J@Lޚ@VmLUxUJ@LU„Vx‚b„xXUl@VaÈw„b‚aÞa@Vl@XUVx@V@V„LlbnV„al@lb„Vnn‚LnKnL@VlbVJXalIšb@KUU@mVInJ˜„U„Vl@xUšVLnUš@UÞaV@lkV@UanK„L@UlKVUnbÆmn@@nUlVnVJl@@UXU„L@WVIVJVxVLXV@IÜKnbn@V¥V@@I@ƒƒ„y°b@UUwnk°ÆƨVlUšçXm›£aƒÇ™IkVƒ@WV@@aWIUWUIkb@WW@UnƒK@UU@kaWVkƒVIVVnU@UWVUV@VmVkKkWIkVWaULU`UImJUImm—U@ƒƒwmwUV™IUWVkUamaU@mV—kƒb@KVU@aVU@anKULVJ‚U@kÛU™JUV›kkƒVakU@ƒaVwkW@UWkXmWaULUaUK@XƒJUUmƒVU@UVƒUkJ@ImwmKU@k„@lU„W@@akKm„kamIkWl_UwVm@UkaVUUaƒ@UamakbWlkL@aUalU@mkL@U@U™lmK@XkKm@Ýakb@xƒnXbƒ`ƒnUUU@›™U@™wU@@ƒmKkkƒV¯U@lULUbVbUb@V‚a@L™ºÝb@bLmK™x@VUL@bk@mxULWl"],encodeOffsets:[[121185,30184]]}},{type:"Feature",id:"3303",properties:{name:"温州市",cp:[120.498,27.8119],childNum:9},geometry:{type:"Polygon",coordinates:["@@ll@xnXV`VX„WVL@lXnlV@UV@@b@¤VzUlnV„U@nWxšW@b@LnalK@bšXVKUƒÈ@VV„I@b@Jš@WbXLÆaUU„mšI@xlKnn„@VWlbkXV‚@n„VWnœ‚WbUb„L@`VbUnVlVXkV@lUz±‚VnUbU@@VUlVL@l„_@V@l@LVbV@XLV`VÈlxn@lU@aœaVV‚k„@XJ@nl@@LU`°LVb„L°a@a„UVy@anI@a„a‚nV@²wÜJX@VšVV°k„na@WVk„aWwU@m@™ƒkƒaUĕ™ÝšÝŤnÈa„aóI›»@±X™WkUķ@kV±kw™ƒUkWw„™UƒÝ»ÛkɳlImaUaWóXÿǬk‚UnWVmmk™KţnŏÞğl™„UlUx@XWb„V@JkXƒ°mb@VULVxUVk@@LWWk@WIkšƒUkJmUkVmI@yƒ@Ua™kLm‚U@mUUUkaVk™@mK@UlUU@UmKmbUUUJ@n@KVLUL@VkJWXX`mnULWlkL@JVLVb@°kxkU@LVŽ™V@„VLV`UL@VUX"],encodeOffsets:[[122502,28334]]}},{type:"Feature",id:"3302",properties:{name:"宁波市",cp:[121.5967,29.6466],childNum:6},geometry:{type:"Polygon",coordinates:["@@Ċ¦ĸĀ°‚nXÞVšKškƨƑźÿ°»n„@wô¥ÜbœU°ÆXÞWóçĉݱIUƒÈ¥@U°wÆ»²mm_@aXƒVKÞVlk@akk›̅@£X»VwƏXWa¯aȗb™KƽۃĊ™xƒLóŽk@ƒƒƒ@¯nƒKUL@xkL›ÑkWULUUmJUXVŽU@mŽUX¯@V`mbXbV@@nn¤WXšx@škJ@nVVUVl²UbÝVUVk@Wx@V@„ƒVXzmlaƒL@VlLU`„XUVVVUnl@VbnJlnUVVnƒlUKkbmnn„VxlJnxmbU@UL@KUV™X@xmb@lk@mnVVUš™è"],encodeOffsets:[[123784,30977]]}},{type:"Feature",id:"3309",properties:{name:"舟山市",cp:[122.2559,30.2234],childNum:3},geometry:{type:"Polygon",coordinates:["@@l΢ƒʠþÆVĢLĊƒǬXĊ܄XôV„ÑÆw„ƒlšƏÈóVĭVǓ@ƒĉwɛkmK@ĉXīWaĉUĵÝmƒ¯ĉƒwĉ±±nż¯x@VǦV„²JĊÞôèÝXÅW¯›VÛaó¦@xƒŽmŽ¯¼ŹĀ"],encodeOffsets:[[124437,30983]]}},{type:"Feature",id:"3310",properties:{name:"台州市",cp:[121.1353,28.6688],childNum:7},geometry:{type:"Polygon",coordinates:["@@lV„IVWVz@bXJl@Xal@°„nLll@nVxnV„K@UJVbƒ¦°„k`UIWJXnƚ@bUJ„Xl@lb„Wn@UzVV@bVVšmVnnJVXna‚bšKUKnUVVUnVLlKVLXa„Jm£@mU@WanaU_°@VWnV@UVWnIVVVKlXœÒlK@wVK„L°m„@„„l@ô„Kšw„ĉƾůUƒl£@»UƒVk„m@ƅUƒƒaÛIŏmUk@m„w@a™£ƒWk@ţšƒIm±@ankôUlaU™Uw¯ƒōaƒbÇbţm™ÞšÞVĖ„b„l@š@n‚VXxƒbUl@XmbƒŽ¯lUUU™W@ÛI±xU@mƒb@bmJ@bUzƒV@b¯bƒKUa¯KV_@Kk@@mWIƒ@lUU›b@bkVm@kwUÇU_WKU@Ux™@ƒVUnllX@Vn‚J@UXV@bWL@lUbbVLUJ@z‚V@lnbWbnnnJVŽ@L"],encodeOffsets:[[123312,29526]]}},{type:"Feature",id:"3307",properties:{name:"金华市",cp:[120.0037,29.1028],childNum:8},geometry:{type:"Polygon",coordinates:["@@nbVb„@VbUVlb@VUnVxk`lXnJlbnƒlL@bX@Vƒ@klƒV@nLnx@JlI„V‚U@VUVn„VV„I@WVLVbVKXbWnXl@VlXUx„b@ŽlVUbl„œlVUšIÜVnalKX@@bV@@aUUlUƒwUw„@naWW„UVaUUšaVb„LlxXJVk°ƒUƒlkU¥@k„a@LVlXLVlšVWznVn@lxšJl_@WX_@mVa„a@alU@kVVna„KVLlK„b@UUaVašbnUWmXU@k@yVI@ařWmXIVJl_¯ƒ„¥UaVI@ƒLmUUw@mkkmK¯ƒk@Wbk@WI@aUyUXƒJkU@bU@WLUyƒXUbkbW`UVVkKmbUaVUƒUK™£@KVUUUm@UWkXWaUKƒV@b¯ƒ¯mU™V@UkƒmW@kkKƒwUƒmkkVUI@WlkUamL@Wk_Wƒ@UVm@Ua¯KWXk@Uxm@UK@xV„mV@Xk@UVV¼@‚VLUb™Uƒ„U@ƒyULUbVlU@@XlVUVVbƒU@lXXVW@XUVl@@VUVƒÈn@VVU„@lVa@„U„mL@`X@`WL@VUX@lUL@xlx"],encodeOffsets:[[122119,29948]]}},{type:"Feature",id:"3308",properties:{name:"衢州市",cp:[118.6853,28.8666],childNum:5},geometry:{type:"Polygon",coordinates:["@@XkVKnwl@@aVK@UšwnL‚K@aÞaš¹@Kb@UVaUaVaVK@k°V„UllnL@„V@šxV@œšV@VV„m„_Wa„m@wlaÞbn@lL@WnLšk@V@VlK@nkVVb@blKXklakw@wVK@kVW@UXK@_‚W@_nKVƒ@ƒUb@kVƒUUm@„ÇVU@Uk@VU@WUXWW@k„VUaVUkU@WWXUKk@Ukmm¯LmmƒUJUIWJkImmƒ_—±WLkKm£@aVUmKUnƒLmWUkVmw@¥U„LVWm@WUka@UmmLmm@@bUX™@@WUIm@UVUK@UVUUU™VVJmb@b„Xn‚mVƒ¼nnn¦mJUVƒL„V@VW@UzUlVnUbl`UnVl@XU@kl@bmÈUx™Vk@@J@„ƒ¼W@ÅaVVnzmVƒ„@WJk@kWJ@ƒlXbWbXxmVnšlLXb@°lKVXnWšbWV„„X„mbV@Xl‚bšI@Kn@@x@šVLlm"],encodeOffsets:[[121185,30184]]}},{type:"Feature",id:"3306",properties:{name:"绍兴市",cp:[120.564,29.7565],childNum:6},geometry:{type:"Polygon",coordinates:["@@„x@„˜VnnVJnIVJV_VKXblUXJlŽlLUŽUnU@UVVX@ŽmVUUUJl„XUlbV@@V„LVmX@@XlaVJVXXJ@b‚@XU„@lUšJ„È‚bœ¤Ō„JšçV™UUnml@@kna@wšWVU@LVKV@namwkIUwmƒnmlaVL„kUmVUkmmIUak@VmUUVUƒWV_kK@U„K‚bnkWy„U@ƒ@UXwl@VUÞUVak±VUUU@mlI@™™wXWƒIWbUKkLUKVmUUmVVL™LambUWmIUm™nUU@aUUVym@ƒXkak@ƒW@z@lWVXnmV™aUbVb@VƒakLUKƒLmbUU@lkV@bƒbUb@nW`@Xk`™Ikwm@mUXy™UUkWKUk@Kƒb@lV¦klV„¯„UlWIkwƒKUa™bVVUbƒVXXmbƒ@Vx„xkVVV@bU@@aW@kLmb@lVUIVKmL@bUV@bUV@L„a˜lnUV@nbVbUlVXšJVUnx"],encodeOffsets:[[122997,30561]]}},{type:"Feature",id:"3304",properties:{name:"嘉兴市",cp:[120.9155,30.6354],childNum:6},geometry:{type:"Polygon",coordinates:["@@@blIX@@VÜVUnn@l‚k„lKnI°Þl`²LVKVbnbVaVLUVn@W¦@VkVVb„@VI„`@blLnL‚aX@„VVb@U‚@XlVa„@@kVaUKV»U_lWXUƒƒ@alb„k@VllnLVKn@@UVIUw@y°IVVXU@VV@lw„m@wVkƾaœJ‚LkΡƧƒ™l™LÝUmW¯ķÿĉ¥ƒIŋŽWn™èkVƧU¯ÅmlVx@V¯aƒz„Ž@„@JU@U¦m@@šnVmn@V„LV‚"],encodeOffsets:[[123233,31382]]}},{type:"Feature",id:"3305",properties:{name:"湖州市",cp:[119.8608,30.7782],childNum:4},geometry:{type:"Polygon",coordinates:["@@kLlƒkm@VmÛU@UW@kJ@aUƒK@UnmmU@™maÛL@JWUUKUwUIUJ@XƒKWV@Vk@UIUmVk@mm@ÅnmaUVkL@VƒKmLVbU@klU@ÝbV™@mVUKV™@wUkVƒ—ƒmIUJ@nVV@L™akJWbUIka@UmKmLKmmƒUUVk@@nmLX`WXUV@Ž@nUl™kmlU@Ub„„ƒxVVšIlV„Žšnn„@@n˜„UҚ@„°n@@xmb@„VbnV@šš„@b@`@L@L@x@blVklVbnnV@‚aXb°VlU@W„b°U„LXWVUV™„™VwÈwÜ»ĸaĠnUVw²X@V@lVU@wlaUUVm@knUV›"],encodeOffsets:[[123379,31500]]}}],UTF8Encoding:!0}}); \ No newline at end of file diff --git a/build/dist/chart/pie.js b/build/dist/chart/pie.js new file mode 100644 index 0000000..5e30dfa --- /dev/null +++ b/build/dist/chart/pie.js @@ -0,0 +1 @@ +define("echarts/chart/pie",["require","./base","zrender/shape/Text","zrender/shape/Ring","zrender/shape/Circle","zrender/shape/Sector","zrender/shape/Polyline","../config","../util/ecData","zrender/tool/util","zrender/tool/math","zrender/tool/color","../chart"],function(e){function t(e,t,n,a,o){i.call(this,e,t,n,a,o);var s=this;s.shapeHandler.onmouseover=function(e){var t=e.target,i=h.get(t,"seriesIndex"),n=h.get(t,"dataIndex"),a=h.get(t,"special"),o=[t.style.x,t.style.y],r=t.style.startAngle,l=t.style.endAngle,d=((l+r)/2+360)%360,m=t.highlightStyle.color,c=s.getLabel(i,n,a,o,d,m,!0);c&&s.zr.addHoverShape(c);var p=s.getLabelLine(i,n,o,t.style.r0,t.style.r,d,m,!0);p&&s.zr.addHoverShape(p)},this.refresh(a)}var i=e("./base"),n=e("zrender/shape/Text"),a=e("zrender/shape/Ring"),o=e("zrender/shape/Circle"),s=e("zrender/shape/Sector"),r=e("zrender/shape/Polyline"),l=e("../config");l.pie={zlevel:0,z:2,clickable:!0,legendHoverLink:!0,center:["50%","50%"],radius:[0,"75%"],clockWise:!0,startAngle:90,minAngle:0,selectedOffset:10,itemStyle:{normal:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1,type:"solid"}}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!1},labelLine:{show:!1,length:20,lineStyle:{width:1,type:"solid"}}}}};var h=e("../util/ecData"),d=e("zrender/tool/util"),m=e("zrender/tool/math"),c=e("zrender/tool/color");return t.prototype={type:l.CHART_TYPE_PIE,_buildShape:function(){var e=this.series,t=this.component.legend;this.selectedMap={},this._selected={};var i,n,s;this._selectedMode=!1;for(var r,d=0,m=e.length;m>d;d++)if(e[d].type===l.CHART_TYPE_PIE){if(e[d]=this.reformOption(e[d]),this.legendHoverLink=e[d].legendHoverLink||this.legendHoverLink,r=e[d].name||"",this.selectedMap[r]=t?t.isSelected(r):!0,!this.selectedMap[r])continue;i=this.parseCenter(this.zr,e[d].center),n=this.parseRadius(this.zr,e[d].radius),this._selectedMode=this._selectedMode||e[d].selectedMode,this._selected[d]=[],this.deepQuery([e[d],this.option],"calculable")&&(s={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:i[0],y:i[1],r0:n[0]<=10?0:n[0]-10,r:n[1]+10,brushType:"stroke",lineWidth:1,strokeColor:e[d].calculableHolderColor||this.ecTheme.calculableHolderColor||l.calculableHolderColor}},h.pack(s,e[d],d,void 0,-1),this.setCalculable(s),s=n[0]<=10?new o(s):new a(s),this.shapeList.push(s)),this._buildSinglePie(d),this.buildMark(d)}this.addShapeList()},_buildSinglePie:function(e){for(var t,i=this.series,n=i[e],a=n.data,o=this.component.legend,s=0,r=0,l=0,h=Number.NEGATIVE_INFINITY,d=[],m=0,c=a.length;c>m;m++)t=a[m].name,this.selectedMap[t]=o?o.isSelected(t):!0,this.selectedMap[t]&&!isNaN(a[m].value)&&(0!==+a[m].value?s++:r++,l+=+a[m].value,h=Math.max(h,+a[m].value));if(0!==l){for(var p,u,V,g,U,y,f=100,b=n.clockWise,_=(n.startAngle.toFixed(2)-0+360)%360,x=n.minAngle||.01,k=360-x*s-.01*r,L=n.roseType,m=0,c=a.length;c>m;m++)if(t=a[m].name,this.selectedMap[t]&&!isNaN(a[m].value)){if(u=o?o.getColor(t):this.zr.getColor(m),f=a[m].value/l,p="area"!=L?b?_-f*k-(0!==f?x:.01):f*k+_+(0!==f?x:.01):b?_-360/c:360/c+_,p=p.toFixed(2)-0,f=(100*f).toFixed(2),V=this.parseCenter(this.zr,n.center),g=this.parseRadius(this.zr,n.radius),U=+g[0],y=+g[1],"radius"===L?y=a[m].value/h*(y-U)*.8+.2*(y-U)+U:"area"===L&&(y=Math.sqrt(a[m].value/h)*(y-U)+U),b){var v;v=_,_=p,p=v}this._buildItem(d,e,m,f,a[m].selected,V,U,y,_,p,u),b||(_=p)}this._autoLabelLayout(d,V,y);for(var m=0,c=d.length;c>m;m++)this.shapeList.push(d[m]);d=null}},_buildItem:function(e,t,i,n,a,o,s,r,l,d,m){var c=this.series,p=((d+l)/2+360)%360,u=this.getSector(t,i,n,a,o,s,r,l,d,m);h.pack(u,c[t],t,c[t].data[i],i,c[t].data[i].name,n),e.push(u);var V=this.getLabel(t,i,n,o,p,m,!1),g=this.getLabelLine(t,i,o,s,r,p,m,!1);g&&(h.pack(g,c[t],t,c[t].data[i],i,c[t].data[i].name,n),e.push(g)),V&&(h.pack(V,c[t],t,c[t].data[i],i,c[t].data[i].name,n),V._labelLine=g,e.push(V))},getSector:function(e,t,i,n,a,o,r,l,h,d){var p=this.series,u=p[e],V=u.data[t],g=[V,u],U=this.deepMerge(g,"itemStyle.normal")||{},y=this.deepMerge(g,"itemStyle.emphasis")||{},f=this.getItemStyleColor(U.color,e,t,V)||d,b=this.getItemStyleColor(y.color,e,t,V)||("string"==typeof f?c.lift(f,-.2):f),_={zlevel:this.getZlevelBase(),z:this.getZBase(),clickable:this.deepQuery(g,"clickable"),style:{x:a[0],y:a[1],r0:o,r:r,startAngle:l,endAngle:h,brushType:"both",color:f,lineWidth:U.borderWidth,strokeColor:U.borderColor,lineJoin:"round"},highlightStyle:{color:b,lineWidth:y.borderWidth,strokeColor:y.borderColor,lineJoin:"round"},_seriesIndex:e,_dataIndex:t};if(n){var x=((_.style.startAngle+_.style.endAngle)/2).toFixed(2)-0;_.style._hasSelected=!0,_.style._x=_.style.x,_.style._y=_.style.y;var k=this.query(u,"selectedOffset");_.style.x+=m.cos(x,!0)*k,_.style.y-=m.sin(x,!0)*k,this._selected[e][t]=!0}else this._selected[e][t]=!1;return this._selectedMode&&(_.onclick=this.shapeHandler.onclick),this.deepQuery([V,u,this.option],"calculable")&&(this.setCalculable(_),_.draggable=!0),(this._needLabel(u,V,!0)||this._needLabelLine(u,V,!0))&&(_.onmouseover=this.shapeHandler.onmouseover),_=new s(_)},getLabel:function(e,t,i,a,o,s,r){var l=this.series,h=l[e],c=h.data[t];if(this._needLabel(h,c,r)){var p,u,V,g=r?"emphasis":"normal",U=d.merge(d.clone(c.itemStyle)||{},h.itemStyle),y=U[g].label,f=y.textStyle||{},b=a[0],_=a[1],x=this.parseRadius(this.zr,h.radius),k="middle";y.position=y.position||U.normal.label.position,"center"===y.position?(p=b,u=_,V="center"):"inner"===y.position||"inside"===y.position?(x=(x[0]+x[1])*(y.distance||.5),p=Math.round(b+x*m.cos(o,!0)),u=Math.round(_-x*m.sin(o,!0)),s="#fff",V="center"):(x=x[1]- -U[g].labelLine.length,p=Math.round(b+x*m.cos(o,!0)),u=Math.round(_-x*m.sin(o,!0)),V=o>=90&&270>=o?"right":"left"),"center"!=y.position&&"inner"!=y.position&&"inside"!=y.position&&(p+="left"===V?20:-20),c.__labelX=p-("left"===V?5:-5),c.__labelY=u;var L=new n({zlevel:this.getZlevelBase(),z:this.getZBase()+1,hoverable:!1,style:{x:p,y:u,color:f.color||s,text:this.getLabelText(e,t,i,g),textAlign:f.align||V,textBaseline:f.baseline||k,textFont:this.getFont(f)},highlightStyle:{brushType:"fill"}});return L._radius=x,L._labelPosition=y.position||"outer",L._rect=L.getRect(L.style),L._seriesIndex=e,L._dataIndex=t,L}},getLabelText:function(e,t,i,n){var a=this.series,o=a[e],s=o.data[t],r=this.deepQuery([s,o],"itemStyle."+n+".label.formatter");return r?"function"==typeof r?r.call(this.myChart,{seriesIndex:e,seriesName:o.name||"",series:o,dataIndex:t,data:s,name:s.name,value:s.value,percent:i}):"string"==typeof r?(r=r.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}").replace("{d}","{d0}"),r=r.replace("{a0}",o.name).replace("{b0}",s.name).replace("{c0}",s.value).replace("{d0}",i)):void 0:s.name},getLabelLine:function(e,t,i,n,a,o,s,l){var h=this.series,c=h[e],p=c.data[t];if(this._needLabelLine(c,p,l)){var u=l?"emphasis":"normal",V=d.merge(d.clone(p.itemStyle)||{},c.itemStyle),g=V[u].labelLine,U=g.lineStyle||{},y=i[0],f=i[1],b=a,_=this.parseRadius(this.zr,c.radius)[1]- -g.length,x=m.cos(o,!0),k=m.sin(o,!0);return new r({zlevel:this.getZlevelBase(),z:this.getZBase()+1,hoverable:!1,style:{pointList:[[y+b*x,f-b*k],[y+_*x,f-_*k],[p.__labelX,p.__labelY]],strokeColor:U.color||s,lineType:U.type,lineWidth:U.width},_seriesIndex:e,_dataIndex:t})}},_needLabel:function(e,t,i){return this.deepQuery([t,e],"itemStyle."+(i?"emphasis":"normal")+".label.show")},_needLabelLine:function(e,t,i){return this.deepQuery([t,e],"itemStyle."+(i?"emphasis":"normal")+".labelLine.show")},_autoLabelLayout:function(e,t,i){for(var n=[],a=[],o=0,s=e.length;s>o;o++)("outer"===e[o]._labelPosition||"outside"===e[o]._labelPosition)&&(e[o]._rect._y=e[o]._rect.y,e[o]._rect.xa;a++)if(e[a]._rect.y+=n,e[a].style.y+=n,e[a]._labelLine&&(e[a]._labelLine.style.pointList[1][1]+=n,e[a]._labelLine.style.pointList[2][1]+=n),a>t&&i>a+1&&e[a+1]._rect.y>e[a]._rect.y+e[a]._rect.height)return void o(a,n/2);o(i-1,n/2)}function o(t,i){for(var n=t;n>=0&&(e[n]._rect.y-=i,e[n].style.y-=i,e[n]._labelLine&&(e[n]._labelLine.style.pointList[1][1]-=i,e[n]._labelLine.style.pointList[2][1]-=i),!(n>0&&e[n]._rect.y>e[n-1]._rect.y+e[n-1]._rect.height));n--);}function s(e,t,i,n,a){for(var o,s,r,l=i[0],h=i[1],d=a>0?t?Number.MAX_VALUE:0:t?Number.MAX_VALUE:0,m=0,c=e.length;c>m;m++)s=Math.abs(e[m]._rect.y-h),r=e[m]._radius-n,o=n+r>s?Math.sqrt((n+r+20)*(n+r+20)-Math.pow(e[m]._rect.y-h,2)):Math.abs(e[m]._rect.x+(a>0?0:e[m]._rect.width)-l),t&&o>=d&&(o=d-10),!t&&d>=o&&(o=d+10),e[m]._rect.x=e[m].style.x=l+o*a,e[m]._labelLine&&(e[m]._labelLine.style.pointList[2][0]=l+(o-5)*a,e[m]._labelLine.style.pointList[1][0]=l+(o-20)*a),d=o}e.sort(function(e,t){return e._rect.y-t._rect.y});for(var r,l=0,h=e.length,d=[],m=[],c=0;h>c;c++)r=e[c]._rect.y-l,0>r&&a(c,h,-r,n),l=e[c]._rect.y+e[c]._rect.height;this.zr.getHeight()-l<0&&o(h-1,l-this.zr.getHeight());for(var c=0;h>c;c++)e[c]._rect.y>=t[1]?m.push(e[c]):d.push(e[c]);s(m,!0,t,i,n),s(d,!1,t,i,n)},reformOption:function(e){var t=d.merge;return e=t(t(e||{},d.clone(this.ecTheme.pie||{})),d.clone(l.pie)),e.itemStyle.normal.label.textStyle=this.getTextStyle(e.itemStyle.normal.label.textStyle),e.itemStyle.emphasis.label.textStyle=this.getTextStyle(e.itemStyle.emphasis.label.textStyle),e},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},addDataAnimation:function(e){for(var t=this.series,i={},n=0,a=e.length;a>n;n++)i[e[n][0]]=e[n];var o={},s={},r={},h=this.shapeList;this.shapeList=[];for(var d,m,c,p={},n=0,a=e.length;a>n;n++)d=e[n][0],m=e[n][2],c=e[n][3],t[d]&&t[d].type===l.CHART_TYPE_PIE&&(m?(c||(o[d+"_"+t[d].data.length]="delete"),p[d]=1):c?p[d]=0:(o[d+"_-1"]="delete",p[d]=-1),this._buildSinglePie(d));for(var u,V,n=0,a=this.shapeList.length;a>n;n++)switch(d=this.shapeList[n]._seriesIndex,u=this.shapeList[n]._dataIndex,V=d+"_"+u,this.shapeList[n].type){case"sector":o[V]=this.shapeList[n];break;case"text":s[V]=this.shapeList[n];break;case"polyline":r[V]=this.shapeList[n]}this.shapeList=[];for(var g,n=0,a=h.length;a>n;n++)if(d=h[n]._seriesIndex,i[d]){if(u=h[n]._dataIndex+p[d],V=d+"_"+u,g=o[V],!g)continue;if("sector"===h[n].type)"delete"!=g?this.zr.animate(h[n].id,"style").when(400,{startAngle:g.style.startAngle,endAngle:g.style.endAngle}).start():this.zr.animate(h[n].id,"style").when(400,p[d]<0?{startAngle:h[n].style.startAngle}:{endAngle:h[n].style.endAngle}).start();else if("text"===h[n].type||"polyline"===h[n].type)if("delete"===g)this.zr.delShape(h[n].id);else switch(h[n].type){case"text":g=s[V],this.zr.animate(h[n].id,"style").when(400,{x:g.style.x,y:g.style.y}).start();break;case"polyline":g=r[V],this.zr.animate(h[n].id,"style").when(400,{pointList:g.style.pointList}).start()}}this.shapeList=h},onclick:function(e){var t=this.series;if(this.isClick&&e.target){this.isClick=!1;for(var i,n=e.target,a=n.style,o=h.get(n,"seriesIndex"),s=h.get(n,"dataIndex"),r=0,d=this.shapeList.length;d>r;r++)if(this.shapeList[r].id===n.id){if(o=h.get(n,"seriesIndex"),s=h.get(n,"dataIndex"),a._hasSelected)n.style.x=n.style._x,n.style.y=n.style._y,n.style._hasSelected=!1,this._selected[o][s]=!1;else{var c=((a.startAngle+a.endAngle)/2).toFixed(2)-0;n.style._hasSelected=!0,this._selected[o][s]=!0,n.style._x=n.style.x,n.style._y=n.style.y,i=this.query(t[o],"selectedOffset"),n.style.x+=m.cos(c,!0)*i,n.style.y-=m.sin(c,!0)*i}this.zr.modShape(n.id,n)}else this.shapeList[r].style._hasSelected&&"single"===this._selectedMode&&(o=h.get(this.shapeList[r],"seriesIndex"),s=h.get(this.shapeList[r],"dataIndex"),this.shapeList[r].style.x=this.shapeList[r].style._x,this.shapeList[r].style.y=this.shapeList[r].style._y,this.shapeList[r].style._hasSelected=!1,this._selected[o][s]=!1,this.zr.modShape(this.shapeList[r].id,this.shapeList[r]));this.messageCenter.dispatch(l.EVENT.PIE_SELECTED,e.event,{selected:this._selected,target:h.get(n,"name")},this.myChart),this.zr.refreshNextFrame()}}},d.inherits(t,i),e("../chart").define("pie",t),t}); \ No newline at end of file diff --git a/build/dist/chart/radar.js b/build/dist/chart/radar.js new file mode 100644 index 0000000..37f1cff --- /dev/null +++ b/build/dist/chart/radar.js @@ -0,0 +1 @@ +define("echarts/chart/radar",["require","./base","zrender/shape/Polygon","../component/polar","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../util/accMath","../chart"],function(e){function t(e,t,n,a,o){i.call(this,e,t,n,a,o),this.refresh(a)}var i=e("./base"),n=e("zrender/shape/Polygon");e("../component/polar");var a=e("../config");a.radar={zlevel:0,z:2,clickable:!0,legendHoverLink:!0,polarIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid"}},emphasis:{label:{show:!1}}},symbolSize:2};var o=e("../util/ecData"),s=e("zrender/tool/util"),r=e("zrender/tool/color");return t.prototype={type:a.CHART_TYPE_RADAR,_buildShape:function(){this.selectedMap={},this._symbol=this.option.symbolList,this._queryTarget,this._dropBoxList=[],this._radarDataCounter=0;for(var e,t=this.series,i=this.component.legend,n=0,o=t.length;o>n;n++)t[n].type===a.CHART_TYPE_RADAR&&(this.serie=this.reformOption(t[n]),this.legendHoverLink=t[n].legendHoverLink||this.legendHoverLink,e=this.serie.name||"",this.selectedMap[e]=i?i.isSelected(e):!0,this.selectedMap[e]&&(this._queryTarget=[this.serie,this.option],this.deepQuery(this._queryTarget,"calculable")&&this._addDropBox(n),this._buildSingleRadar(n),this.buildMark(n)));this.addShapeList()},_buildSingleRadar:function(e){for(var t,i,n,a,o=this.component.legend,s=this.serie.data,r=this.deepQuery(this._queryTarget,"calculable"),l=0;ls;s++)n=this.getDataFromOption(t.value[s]),i="-"!=n?o.getVector(e,s,n):!1,i&&a.push(i);return a},_addSymbol:function(e,t,i,n,a){for(var s,r=this.series,l=this.component.polar,h=0,d=e.length;d>h;h++)s=this.getSymbolShape(this.deepMerge([r[n].data[i],r[n]]),n,r[n].data[i].value[h],h,l.getIndicatorText(a,h),e[h][0],e[h][1],this._symbol[this._radarDataCounter%this._symbol.length],t,"#fff","vertical"),s.zlevel=this.getZlevelBase(),s.z=this.getZBase()+1,o.set(s,"data",r[n].data[i]),o.set(s,"value",r[n].data[i].value),o.set(s,"dataIndex",i),o.set(s,"special",h),this.shapeList.push(s)},_addDataShape:function(e,t,i,a,s,l){var h=this.series,d=[i,this.serie],m=this.getItemStyleColor(this.deepQuery(d,"itemStyle.normal.color"),a,s,i),c=this.deepQuery(d,"itemStyle.normal.lineStyle.width"),p=this.deepQuery(d,"itemStyle.normal.lineStyle.type"),u=this.deepQuery(d,"itemStyle.normal.areaStyle.color"),V=this.deepQuery(d,"itemStyle.normal.areaStyle"),g={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{pointList:e,brushType:V?"both":"stroke",color:u||m||("string"==typeof t?r.alpha(t,.5):t),strokeColor:m||t,lineWidth:c,lineType:p},highlightStyle:{brushType:this.deepQuery(d,"itemStyle.emphasis.areaStyle")||V?"both":"stroke",color:this.deepQuery(d,"itemStyle.emphasis.areaStyle.color")||u||m||("string"==typeof t?r.alpha(t,.5):t),strokeColor:this.getItemStyleColor(this.deepQuery(d,"itemStyle.emphasis.color"),a,s,i)||m||t,lineWidth:this.deepQuery(d,"itemStyle.emphasis.lineStyle.width")||c,lineType:this.deepQuery(d,"itemStyle.emphasis.lineStyle.type")||p}};o.pack(g,h[a],a,i,s,i.name,this.component.polar.getIndicator(h[a].polarIndex)),l&&(g.draggable=!0,this.setCalculable(g)),g=new n(g),this.shapeList.push(g)},_addDropBox:function(e){var t=this.series,i=this.deepQuery(this._queryTarget,"polarIndex");if(!this._dropBoxList[i]){var n=this.component.polar.getDropBox(i);n.zlevel=this.getZlevelBase(),n.z=this.getZBase(),this.setCalculable(n),o.pack(n,t,e,void 0,-1),this.shapeList.push(n),this._dropBoxList[i]=!0}},ondragend:function(e,t){var i=this.series;if(this.isDragend&&e.target){var n=e.target,a=o.get(n,"seriesIndex"),s=o.get(n,"dataIndex");this.component.legend&&this.component.legend.del(i[a].data[s].name),i[a].data.splice(s,1),t.dragOut=!0,t.needRefresh=!0,this.isDragend=!1}},ondrop:function(t,i){var n=this.series;if(this.isDrop&&t.target){var a,s,r=t.target,l=t.dragged,h=o.get(r,"seriesIndex"),d=o.get(r,"dataIndex"),m=this.component.legend;if(-1===d)a={value:o.get(l,"value"),name:o.get(l,"name")},n[h].data.push(a),m&&m.add(a.name,l.style.color||l.style.strokeColor);else{var c=e("../util/accMath");a=n[h].data[d],m&&m.del(a.name),a.name+=this.option.nameConnector+o.get(l,"name"),s=o.get(l,"value");for(var p=0;ph;h++)t=d.polar2cartesian(r,o*Math.PI/180+s*h),l.push({vector:[t[1],-t[0]]})},_getRadius:function(){var e=this.polar[this._index];return this.parsePercent(e.radius,Math.min(this.zr.getWidth(),this.zr.getHeight())/2)},_buildSpiderWeb:function(e){var t=this.polar[e],i=t.__ecIndicator,n=t.splitArea,a=t.splitLine,o=this.getCenter(e),s=t.splitNumber,r=a.lineStyle.color,l=a.lineStyle.width,h=a.show,d=this.deepQuery(this._queryTarget,"axisLine");this._addArea(i,s,o,n,r,l,h),d.show&&this._addLine(i,o,d)},_addAxisLabel:function(t){for(var i,a,o,s,a,r,l,d,m,c,p=e("../util/accMath"),u=this.polar[t],V=this.deepQuery(this._queryTarget,"indicator"),g=u.__ecIndicator,U=this.deepQuery(this._queryTarget,"splitNumber"),y=this.getCenter(t),f=0;f=b;b+=c+1)s=h.merge({},o),l=p.accAdd(r.min,p.accMul(r.step,b)),s.text=this.numAddCommas(l),s.x=b*a[0]/U+Math.cos(d)*m+y[0],s.y=b*a[1]/U+Math.sin(d)*m+y[1],this.shapeList.push(new n({zlevel:this.getZlevelBase(),z:this.getZBase(),style:s,draggable:!1,hoverable:!1}))}},_buildText:function(e){for(var t,i,a,o,s,r,l,h=this.polar[e],d=h.__ecIndicator,m=this.deepQuery(this._queryTarget,"indicator"),c=this.getCenter(e),p=0,u=0,V=0;V0?"left":Math.round(t[0])<0?"right":"center",null==o.margin?t=this._mapVector(t,c,1.1):(r=o.margin,p=t[0]>0?r:-r,u=t[1]>0?r:-r,p=0===t[0]?0:p,u=0===t[1]?0:u,t=this._mapVector(t,c,1)),i.textAlign=a,i.x=t[0]+p,i.y=t[1]+u,s=o.rotate?[o.rotate/180*Math.PI,t[0],t[1]]:[0,0,0],this.shapeList.push(new n({zlevel:this.getZlevelBase(),z:this.getZBase(),style:i,draggable:!1,hoverable:!1,rotation:s})))},getIndicatorText:function(e,t){return this.polar[e]&&this.polar[e].__ecIndicator[t]&&this.polar[e].__ecIndicator[t].text},getDropBox:function(e){var t,i,e=e||0,n=this.polar[e],a=this.getCenter(e),o=n.__ecIndicator,s=o.length,r=[],l=n.type;if("polygon"==l){for(var h=0;s>h;h++)t=o[h].vector,r.push(this._mapVector(t,a,1.2));i=this._getShape(r,"fill","rgba(0,0,0,0)","",1)}else"circle"==l&&(i=this._getCircle("",1,1.2,a,"fill","rgba(0,0,0,0)"));return i},_addArea:function(e,t,i,n,a,o,s){for(var r,l,h,d,m=this.deepQuery(this._queryTarget,"type"),c=0;t>c;c++)l=(t-c)/t,s&&("polygon"==m?(d=this._getPointList(e,l,i),r=this._getShape(d,"stroke","",a,o)):"circle"==m&&(r=this._getCircle(a,o,l,i,"stroke")),this.shapeList.push(r)),n.show&&(h=(t-c-1)/t,this._addSplitArea(e,n,l,h,i,c))},_getCircle:function(e,t,i,n,a,o){var r=this._getRadius();return new s({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:n[0],y:n[1],r:r*i,brushType:a,strokeColor:e,lineWidth:t,color:o},hoverable:!1,draggable:!1})},_getRing:function(e,t,i,n){var a=this._getRadius();return new r({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:n[0],y:n[1],r:t*a,r0:i*a,color:e,brushType:"fill"},hoverable:!1,draggable:!1})},_getPointList:function(e,t,i){for(var n,a=[],o=e.length,s=0;o>s;s++)n=e[s].vector,a.push(this._mapVector(n,i,t));return a},_getShape:function(e,t,i,n,a){return new o({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{pointList:e,brushType:t,color:i,strokeColor:n,lineWidth:a},hoverable:!1,draggable:!1})},_addSplitArea:function(e,t,i,n,a,o){var s,r,l,h,d,m=e.length,c=t.areaStyle.color,p=[],m=e.length,u=this.deepQuery(this._queryTarget,"type");if("string"==typeof c&&(c=[c]),r=c.length,s=c[o%r],"polygon"==u)for(var V=0;m>V;V++)p=[],l=e[V].vector,h=e[(V+1)%m].vector,p.push(this._mapVector(l,a,i)),p.push(this._mapVector(l,a,n)),p.push(this._mapVector(h,a,n)),p.push(this._mapVector(h,a,i)),d=this._getShape(p,"fill",s,"",1),this.shapeList.push(d);else"circle"==u&&(d=this._getRing(s,i,n,a),this.shapeList.push(d))},_mapVector:function(e,t,i){return[e[0]*i+t[0],e[1]*i+t[1]]},getCenter:function(e){var e=e||0;return this.parseCenter(this.zr,this.polar[e].center)},_addLine:function(e,t,i){for(var n,a,o=e.length,s=i.lineStyle,r=s.color,l=s.width,h=s.type,d=0;o>d;d++)a=e[d].vector,n=this._getLine(t[0],t[1],a[0]+t[0],a[1]+t[1],r,l,h),this.shapeList.push(n)},_getLine:function(e,t,i,n,o,s,r){return new a({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{xStart:e,yStart:t,xEnd:i,yEnd:n,strokeColor:o,lineWidth:s,lineType:r},hoverable:!1})},_adjustIndicatorValue:function(t){for(var i,n,a=this.polar[t],o=this.deepQuery(this._queryTarget,"indicator"),s=o.length,r=a.__ecIndicator,l=this._getSeriesData(t),h=a.boundaryGap,d=a.splitNumber,m=a.scale,c=e("../util/smartSteps"),p=0;s>p;p++){if("number"==typeof o[p].max)i=o[p].max,n=o[p].min||0;else{var u=this._findValue(l,p,d,h);n=u.min,i=u.max}!m&&n>=0&&i>=0&&(n=0),!m&&0>=n&&0>=i&&(i=0);var V=c(n,i,d);r[p].value={min:V.min,max:V.max,step:V.step}}},_getSeriesData:function(e){for(var t,i,n,a=[],o=this.component.legend,s=0;so||void 0===o)&&(o=e),(s>e||void 0===s)&&(s=e)}var o,s,r;if(e&&0!==e.length){if(1==e.length&&(s=0),1!=e.length)for(var l=0;l0?s=o/i:o/=i),{max:o,min:s}}},getVector:function(e,t,i){e=e||0,t=t||0;var n=this.polar[e].__ecIndicator;if(!(t>=n.length)){var a,o=this.polar[e].__ecIndicator[t],s=this.getCenter(e),r=o.vector,l=o.value.max,h=o.value.min;if("undefined"==typeof i)return s;switch(i){case"min":i=h;break;case"max":i=l;break;case"center":i=(l+h)/2}return a=l!=h?(i-h)/(l-h):.5,this._mapVector(r,s,a)}},isInside:function(e){var t=this.getNearestIndex(e);return t?t.polarIndex:-1},getNearestIndex:function(e){for(var t,i,n,a,o,s,r,l,h,m=0;ma[0])return{polarIndex:m,valueIndex:Math.floor((h+l/2)/l)%r}}},getIndicator:function(e){var e=e||0;return this.polar[e].indicator},refresh:function(e){e&&(this.option=e,this.polar=this.option.polar,this.series=this.option.series),this.clear(),this._buildShape()}},h.inherits(t,i),e("../component").define("polar",t),t}),define("echarts/util/coordinates",["require","zrender/tool/math"],function(e){function t(e,t){return[e*n.sin(t),e*n.cos(t)]}function i(e,t){return[Math.sqrt(e*e+t*t),Math.atan(t/e)]}var n=e("zrender/tool/math");return{polar2cartesian:t,cartesian2polar:i}}); \ No newline at end of file diff --git a/build/dist/chart/scatter.js b/build/dist/chart/scatter.js new file mode 100644 index 0000000..f978d8e --- /dev/null +++ b/build/dist/chart/scatter.js @@ -0,0 +1 @@ +define("echarts/chart/scatter",["require","./base","../util/shape/Symbol","../component/axis","../component/grid","../component/dataZoom","../component/dataRange","../config","zrender/tool/util","zrender/tool/color","../chart"],function(e){function t(e,t,n,a,o){i.call(this,e,t,n,a,o),this.refresh(a)}var i=e("./base"),n=e("../util/shape/Symbol");e("../component/axis"),e("../component/grid"),e("../component/dataZoom"),e("../component/dataRange");var a=e("../config");a.scatter={zlevel:0,z:2,clickable:!0,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,symbolSize:4,large:!1,largeThreshold:2e3,itemStyle:{normal:{label:{show:!1}},emphasis:{label:{show:!1}}}};var o=e("zrender/tool/util"),s=e("zrender/tool/color");return t.prototype={type:a.CHART_TYPE_SCATTER,_buildShape:function(){var e=this.series;this._sIndex2ColorMap={},this._symbol=this.option.symbolList,this._sIndex2ShapeMap={},this.selectedMap={},this.xMarkMap={};for(var t,i,n,o,r=this.component.legend,l=[],h=0,d=e.length;d>h;h++)if(t=e[h],i=t.name,t.type===a.CHART_TYPE_SCATTER){if(e[h]=this.reformOption(e[h]),this.legendHoverLink=e[h].legendHoverLink||this.legendHoverLink,this._sIndex2ShapeMap[h]=this.query(t,"symbol")||this._symbol[h%this._symbol.length],r){if(this.selectedMap[i]=r.isSelected(i),this._sIndex2ColorMap[h]=s.alpha(r.getColor(i),.5),n=r.getItemShape(i)){var o=this._sIndex2ShapeMap[h];n.style.brushType=o.match("empty")?"stroke":"both",o=o.replace("empty","").toLowerCase(),o.match("rectangle")&&(n.style.x+=Math.round((n.style.width-n.style.height)/2),n.style.width=n.style.height),o.match("star")&&(n.style.n=o.replace("star","")-0||5,o="star"),o.match("image")&&(n.style.image=o.replace(new RegExp("^image:\\/\\/"),""),n.style.x+=Math.round((n.style.width-n.style.height)/2),n.style.width=n.style.height,o="image"),n.style.iconType=o,r.setItemShape(i,n)}}else this.selectedMap[i]=!0,this._sIndex2ColorMap[h]=s.alpha(this.zr.getColor(h),.5);this.selectedMap[i]&&l.push(h)}this._buildSeries(l),this.addShapeList()},_buildSeries:function(e){if(0!==e.length){for(var t,i,n,a,o,s,r,l,h=this.series,d={},m=0,c=e.length;c>m;m++)if(t=e[m],i=h[t],0!==i.data.length){o=this.component.xAxis.getAxis(i.xAxisIndex||0),s=this.component.yAxis.getAxis(i.yAxisIndex||0),d[t]=[];for(var p=0,u=i.data.length;u>p;p++)n=i.data[p],a=this.getDataFromOption(n,"-"),"-"===a||a.length<2||(r=o.getCoord(a[0]),l=s.getCoord(a[1]),d[t].push([r,l,p,n.name||""]));this.xMarkMap[t]=this._markMap(o,s,i.data,d[t]),this.buildMark(t)}this._buildPointList(d)}},_markMap:function(e,t,i,n){for(var a,o={min0:Number.POSITIVE_INFINITY,max0:Number.NEGATIVE_INFINITY,sum0:0,counter0:0,average0:0,min1:Number.POSITIVE_INFINITY,max1:Number.NEGATIVE_INFINITY,sum1:0,counter1:0,average1:0},s=0,r=n.length;r>s;s++)a=i[n[s][2]].value||i[n[s][2]],o.min0>a[0]&&(o.min0=a[0],o.minY0=n[s][1],o.minX0=n[s][0]),o.max0a[1]&&(o.min1=a[1],o.minY1=n[s][1],o.minX1=n[s][0]),o.max1t.largeThreshold)this.shapeList.push(this._getLargeSymbol(i,this.getItemStyleColor(this.query(t,"itemStyle.normal.color"),s,-1)||this._sIndex2ColorMap[s]));else for(var r=0,l=i.length;l>r;r++)n=i[r],a=this._getSymbol(s,n[2],n[3],n[0],n[1]),a&&this.shapeList.push(a)},_getSymbol:function(e,t,i,n,a){var o,s=this.series,r=s[e],l=r.data[t],h=this.component.dataRange;if(h){if(o=isNaN(l[2])?this._sIndex2ColorMap[e]:h.getColor(l[2]),!o)return null}else o=this._sIndex2ColorMap[e];var d=this.getSymbolShape(r,e,l,t,i,n,a,this._sIndex2ShapeMap[e],o,"rgba(0,0,0,0)","vertical");return d.zlevel=this.getZlevelBase(),d.z=this.getZBase(),d._main=!0,d},_getLargeSymbol:function(e,t){return new n({zlevel:this.getZlevelBase(),z:this.getZBase(),_main:!0,hoverable:!1,style:{pointList:e,color:t,strokeColor:t},highlightStyle:{pointList:[]}})},getMarkCoord:function(e,t){var i,n=this.series[e],a=this.xMarkMap[e],o=this.component.xAxis.getAxis(n.xAxisIndex),s=this.component.yAxis.getAxis(n.yAxisIndex);if(!t.type||"max"!==t.type&&"min"!==t.type&&"average"!==t.type)i=["string"!=typeof t.xAxis&&o.getCoordByIndex?o.getCoordByIndex(t.xAxis||0):o.getCoord(t.xAxis||0),"string"!=typeof t.yAxis&&s.getCoordByIndex?s.getCoordByIndex(t.yAxis||0):s.getCoord(t.yAxis||0)];else{var r=null!=t.valueIndex?t.valueIndex:1;i=[a[t.type+"X"+r],a[t.type+"Y"+r],a[t.type+"Line"+r],a[t.type+r]]}return i},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},ondataRange:function(e,t){this.component.dataRange&&(this.refresh(),t.needRefresh=!0)}},o.inherits(t,i),e("../chart").define("scatter",t),t}),define("echarts/component/dataRange",["require","./base","zrender/shape/Text","zrender/shape/Rectangle","../util/shape/HandlePolygon","../config","zrender/tool/util","zrender/tool/event","zrender/tool/area","zrender/tool/color","../component"],function(e){function t(e,t,n,a,o){if("undefined"==typeof this.query(a,"dataRange.min")||"undefined"==typeof this.query(a,"dataRange.max"))return void console.error("option.dataRange.min or option.dataRange.max has not been defined.");i.call(this,e,t,n,a,o);var r=this;r._ondrift=function(e,t){return r.__ondrift(this,e,t)},r._ondragend=function(){return r.__ondragend()},r._dataRangeSelected=function(e){return r.__dataRangeSelected(e)},r._dispatchHoverLink=function(e){return r.__dispatchHoverLink(e)},r._onhoverlink=function(e){return r.__onhoverlink(e)},this._selectedMap={},this._range={},this.refresh(a),t.bind(s.EVENT.HOVER,this._onhoverlink)}var i=e("./base"),n=e("zrender/shape/Text"),a=e("zrender/shape/Rectangle"),o=e("../util/shape/HandlePolygon"),s=e("../config");s.dataRange={zlevel:0,z:4,show:!0,orient:"vertical",x:"left",y:"bottom",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,itemWidth:20,itemHeight:14,precision:0,splitNumber:5,calculable:!1,selectedMode:!0,hoverLink:!0,realtime:!0,color:["#006edd","#e0ffff"],textStyle:{color:"#333"}};var r=e("zrender/tool/util"),l=e("zrender/tool/event"),h=e("zrender/tool/area"),d=e("zrender/tool/color");return t.prototype={type:s.COMPONENT_TYPE_DATARANGE,_textGap:10,_buildShape:function(){if(this._itemGroupLocation=this._getItemGroupLocation(),this._buildBackground(),this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable?this._buildGradient():this._buildItem(),this.dataRangeOption.show)for(var e=0,t=this.shapeList.length;t>e;e++)this.zr.addShape(this.shapeList[e]);this._syncShapeFromRange()},_buildItem:function(){var e,t,i,o,s=this._valueTextList,r=s.length,l=this.getFont(this.dataRangeOption.textStyle),d=this._itemGroupLocation.x,m=this._itemGroupLocation.y,c=this.dataRangeOption.itemWidth,p=this.dataRangeOption.itemHeight,u=this.dataRangeOption.itemGap,V=h.getTextHeight("国",l);"vertical"==this.dataRangeOption.orient&&"right"==this.dataRangeOption.x&&(d=this._itemGroupLocation.x+this._itemGroupLocation.width-c);var U=!0;this.dataRangeOption.text&&(U=!1,this.dataRangeOption.text[0]&&(i=this._getTextShape(d,m,this.dataRangeOption.text[0]),"horizontal"==this.dataRangeOption.orient?d+=h.getTextWidth(this.dataRangeOption.text[0],l)+this._textGap:(m+=V+this._textGap,i.style.y+=V/2+this._textGap,i.style.textBaseline="bottom"),this.shapeList.push(new n(i))));for(var g=0;r>g;g++)e=s[g],o=this.getColorByIndex(g),t=this._getItemShape(d,m,c,p,this._selectedMap[g]?o:"#ccc"),t._idx=g,t.onmousemove=this._dispatchHoverLink,this.dataRangeOption.selectedMode&&(t.clickable=!0,t.onclick=this._dataRangeSelected),this.shapeList.push(new a(t)),U&&(i={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:d+c+5,y:m,color:this._selectedMap[g]?this.dataRangeOption.textStyle.color:"#ccc",text:s[g],textFont:l,textBaseline:"top"},highlightStyle:{brushType:"fill"}},"vertical"==this.dataRangeOption.orient&&"right"==this.dataRangeOption.x&&(i.style.x-=c+10,i.style.textAlign="right"),i._idx=g,i.onmousemove=this._dispatchHoverLink,this.dataRangeOption.selectedMode&&(i.clickable=!0,i.onclick=this._dataRangeSelected),this.shapeList.push(new n(i))),"horizontal"==this.dataRangeOption.orient?d+=c+(U?5:0)+(U?h.getTextWidth(e,l):0)+u:m+=p+u;!U&&this.dataRangeOption.text[1]&&("horizontal"==this.dataRangeOption.orient?d=d-u+this._textGap:m=m-u+this._textGap,i=this._getTextShape(d,m,this.dataRangeOption.text[1]),"horizontal"!=this.dataRangeOption.orient&&(i.style.y-=5,i.style.textBaseline="top"),this.shapeList.push(new n(i)))},_buildGradient:function(){var t,i,o=this.getFont(this.dataRangeOption.textStyle),s=this._itemGroupLocation.x,r=this._itemGroupLocation.y,l=this.dataRangeOption.itemWidth,d=this.dataRangeOption.itemHeight,m=h.getTextHeight("国",o),c=10,p=!0;this.dataRangeOption.text&&(p=!1,this.dataRangeOption.text[0]&&(i=this._getTextShape(s,r,this.dataRangeOption.text[0]),"horizontal"==this.dataRangeOption.orient?s+=h.getTextWidth(this.dataRangeOption.text[0],o)+this._textGap:(r+=m+this._textGap,i.style.y+=m/2+this._textGap,i.style.textBaseline="bottom"),this.shapeList.push(new n(i))));for(var u=e("zrender/tool/color"),V=1/(this.dataRangeOption.color.length-1),U=[],g=0,y=this.dataRangeOption.color.length;y>g;g++)U.push([g*V,this.dataRangeOption.color[g]]);"horizontal"==this.dataRangeOption.orient?(t={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:s,y:r,width:l*c,height:d,color:u.getLinearGradient(s,r,s+l*c,r,U)},hoverable:!1},s+=l*c+this._textGap):(t={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:s,y:r,width:l,height:d*c,color:u.getLinearGradient(s,r,s,r+d*c,U)},hoverable:!1},r+=d*c+this._textGap),this.shapeList.push(new a(t)),this._calculableLocation=t.style,this.dataRangeOption.calculable&&(this._buildFiller(),this._bulidMask(),this._bulidHandle()),this._buildIndicator(),!p&&this.dataRangeOption.text[1]&&(i=this._getTextShape(s,r,this.dataRangeOption.text[1]),this.shapeList.push(new n(i)))},_buildIndicator:function(){var e,t,i=this._calculableLocation.x,n=this._calculableLocation.y,a=this._calculableLocation.width,s=this._calculableLocation.height,r=5;"horizontal"==this.dataRangeOption.orient?"bottom"!=this.dataRangeOption.y?(e=[[i,n+s],[i-r,n+s+r],[i+r,n+s+r]],t="bottom"):(e=[[i,n],[i-r,n-r],[i+r,n-r]],t="top"):"right"!=this.dataRangeOption.x?(e=[[i+a,n],[i+a+r,n-r],[i+a+r,n+r]],t="right"):(e=[[i,n],[i-r,n-r],[i-r,n+r]],t="left"),this._indicatorShape={style:{pointList:e,color:"#fff",__rect:{x:Math.min(e[0][0],e[1][0]),y:Math.min(e[0][1],e[1][1]),width:r*("horizontal"==this.dataRangeOption.orient?2:1),height:r*("horizontal"==this.dataRangeOption.orient?1:2)}},highlightStyle:{brushType:"fill",textPosition:t,textColor:this.dataRangeOption.textStyle.color},hoverable:!1},this._indicatorShape=new o(this._indicatorShape)},_buildFiller:function(){this._fillerShape={zlevel:this.getZlevelBase(),z:this.getZBase()+1,style:{x:this._calculableLocation.x,y:this._calculableLocation.y,width:this._calculableLocation.width,height:this._calculableLocation.height,color:"rgba(255,255,255,0)"},highlightStyle:{strokeColor:"rgba(255,255,255,0.5)",lineWidth:1},draggable:!0,ondrift:this._ondrift,ondragend:this._ondragend,onmousemove:this._dispatchHoverLink,_type:"filler"},this._fillerShape=new a(this._fillerShape),this.shapeList.push(this._fillerShape)},_bulidHandle:function(){var e,t,i,n,a,s,r,l,d=this._calculableLocation.x,m=this._calculableLocation.y,c=this._calculableLocation.width,p=this._calculableLocation.height,u=this.getFont(this.dataRangeOption.textStyle),V=h.getTextHeight("国",u),U=Math.max(h.getTextWidth(this._textFormat(this.dataRangeOption.max),u),h.getTextWidth(this._textFormat(this.dataRangeOption.min),u))+2;"horizontal"==this.dataRangeOption.orient?"bottom"!=this.dataRangeOption.y?(e=[[d,m],[d,m+p+V],[d-V,m+p+V],[d-1,m+p],[d-1,m]],t=d-U/2-V,i=m+p+V/2+2,n={x:d-U-V,y:m+p,width:U+V,height:V},a=[[d+c,m],[d+c,m+p+V],[d+c+V,m+p+V],[d+c+1,m+p],[d+c+1,m]],s=d+c+U/2+V,r=i,l={x:d+c,y:m+p,width:U+V,height:V}):(e=[[d,m+p],[d,m-V],[d-V,m-V],[d-1,m],[d-1,m+p]],t=d-U/2-V,i=m-V/2-2,n={x:d-U-V,y:m-V,width:U+V,height:V},a=[[d+c,m+p],[d+c,m-V],[d+c+V,m-V],[d+c+1,m],[d+c+1,m+p]],s=d+c+U/2+V,r=i,l={x:d+c,y:m-V,width:U+V,height:V}):(U+=V,"right"!=this.dataRangeOption.x?(e=[[d,m],[d+c+V,m],[d+c+V,m-V],[d+c,m-1],[d,m-1]],t=d+c+U/2+V/2,i=m-V/2,n={x:d+c,y:m-V,width:U+V,height:V},a=[[d,m+p],[d+c+V,m+p],[d+c+V,m+V+p],[d+c,m+1+p],[d,m+p+1]],s=t,r=m+p+V/2,l={x:d+c,y:m+p,width:U+V,height:V}):(e=[[d+c,m],[d-V,m],[d-V,m-V],[d,m-1],[d+c,m-1]],t=d-U/2-V/2,i=m-V/2,n={x:d-U-V,y:m-V,width:U+V,height:V},a=[[d+c,m+p],[d-V,m+p],[d-V,m+V+p],[d,m+1+p],[d+c,m+p+1]],s=t,r=m+p+V/2,l={x:d-U-V,y:m+p,width:U+V,height:V})),this._startShape={style:{pointList:e,text:this._textFormat(this.dataRangeOption.max),textX:t,textY:i,textFont:u,color:this.getColor(this.dataRangeOption.max),rect:n,x:e[0][0],y:e[0][1],_x:e[0][0],_y:e[0][1]}},this._startShape.highlightStyle={strokeColor:this._startShape.style.color,lineWidth:1},this._endShape={style:{pointList:a,text:this._textFormat(this.dataRangeOption.min),textX:s,textY:r,textFont:u,color:this.getColor(this.dataRangeOption.min),rect:l,x:a[0][0],y:a[0][1],_x:a[0][0],_y:a[0][1]}},this._endShape.highlightStyle={strokeColor:this._endShape.style.color,lineWidth:1},this._startShape.zlevel=this._endShape.zlevel=this.getZlevelBase(),this._startShape.z=this._endShape.z=this.getZBase()+1,this._startShape.draggable=this._endShape.draggable=!0,this._startShape.ondrift=this._endShape.ondrift=this._ondrift,this._startShape.ondragend=this._endShape.ondragend=this._ondragend,this._startShape.style.textColor=this._endShape.style.textColor=this.dataRangeOption.textStyle.color,this._startShape.style.textAlign=this._endShape.style.textAlign="center",this._startShape.style.textPosition=this._endShape.style.textPosition="specific",this._startShape.style.textBaseline=this._endShape.style.textBaseline="middle",this._startShape.style.width=this._endShape.style.width=0,this._startShape.style.height=this._endShape.style.height=0,this._startShape.style.textPosition=this._endShape.style.textPosition="specific",this._startShape=new o(this._startShape),this._endShape=new o(this._endShape),this.shapeList.push(this._startShape),this.shapeList.push(this._endShape)},_bulidMask:function(){var e=this._calculableLocation.x,t=this._calculableLocation.y,i=this._calculableLocation.width,n=this._calculableLocation.height;this._startMask={zlevel:this.getZlevelBase(),z:this.getZBase()+1,style:{x:e,y:t,width:"horizontal"==this.dataRangeOption.orient?0:i,height:"horizontal"==this.dataRangeOption.orient?n:0,color:"#ccc"},hoverable:!1},this._endMask={zlevel:this.getZlevelBase(),z:this.getZBase()+1,style:{x:"horizontal"==this.dataRangeOption.orient?e+i:e,y:"horizontal"==this.dataRangeOption.orient?t:t+n,width:"horizontal"==this.dataRangeOption.orient?0:i,height:"horizontal"==this.dataRangeOption.orient?n:0,color:"#ccc"},hoverable:!1},this._startMask=new a(this._startMask),this._endMask=new a(this._endMask),this.shapeList.push(this._startMask),this.shapeList.push(this._endMask)},_buildBackground:function(){var e=this.reformCssArray(this.dataRangeOption.padding);this.shapeList.push(new a({zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this._itemGroupLocation.x-e[3],y:this._itemGroupLocation.y-e[0],width:this._itemGroupLocation.width+e[3]+e[1],height:this._itemGroupLocation.height+e[0]+e[2],brushType:0===this.dataRangeOption.borderWidth?"fill":"both",color:this.dataRangeOption.backgroundColor,strokeColor:this.dataRangeOption.borderColor,lineWidth:this.dataRangeOption.borderWidth}}))},_getItemGroupLocation:function(){var e=this._valueTextList,t=e.length,i=this.dataRangeOption.itemGap,n=this.dataRangeOption.itemWidth,a=this.dataRangeOption.itemHeight,o=0,s=0,r=this.getFont(this.dataRangeOption.textStyle),l=h.getTextHeight("国",r),d=10;if("horizontal"==this.dataRangeOption.orient){if(this.dataRangeOption.text||this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable)o=(this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable?n*d+i:t*(n+i))+(this.dataRangeOption.text&&"undefined"!=typeof this.dataRangeOption.text[0]?h.getTextWidth(this.dataRangeOption.text[0],r)+this._textGap:0)+(this.dataRangeOption.text&&"undefined"!=typeof this.dataRangeOption.text[1]?h.getTextWidth(this.dataRangeOption.text[1],r)+this._textGap:0);else{n+=5;for(var m=0;t>m;m++)o+=n+h.getTextWidth(e[m],r)+i}o-=i,s=Math.max(l,a)}else{var c;if(this.dataRangeOption.text||this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable)s=(this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable?a*d+i:t*(a+i))+(this.dataRangeOption.text&&"undefined"!=typeof this.dataRangeOption.text[0]?this._textGap+l:0)+(this.dataRangeOption.text&&"undefined"!=typeof this.dataRangeOption.text[1]?this._textGap+l:0),c=Math.max(h.getTextWidth(this.dataRangeOption.text&&this.dataRangeOption.text[0]||"",r),h.getTextWidth(this.dataRangeOption.text&&this.dataRangeOption.text[1]||"",r)),o=Math.max(n,c);else{s=(a+i)*t,n+=5,c=0;for(var m=0;t>m;m++)c=Math.max(c,h.getTextWidth(e[m],r));o=n+c}s-=i}var p,u=this.reformCssArray(this.dataRangeOption.padding),V=this.zr.getWidth();switch(this.dataRangeOption.x){case"center":p=Math.floor((V-o)/2);break;case"left":p=u[3]+this.dataRangeOption.borderWidth;break;case"right":p=V-o-u[1]-this.dataRangeOption.borderWidth;break;default:p=this.parsePercent(this.dataRangeOption.x,V),p=isNaN(p)?0:p}var U,g=this.zr.getHeight();switch(this.dataRangeOption.y){case"top":U=u[0]+this.dataRangeOption.borderWidth;break;case"bottom":U=g-s-u[2]-this.dataRangeOption.borderWidth;break;case"center":U=Math.floor((g-s)/2);break;default:U=this.parsePercent(this.dataRangeOption.y,g),U=isNaN(U)?0:U}if(this.dataRangeOption.calculable){var y=Math.max(h.getTextWidth(this.dataRangeOption.max,r),h.getTextWidth(this.dataRangeOption.min,r))+l;"horizontal"==this.dataRangeOption.orient?(y>p&&(p=y),p+o+y>V&&(p-=y)):(l>U&&(U=l),U+s+l>g&&(U-=l))}return{x:p,y:U,width:o,height:s}},_getTextShape:function(e,t,i){return{zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:"horizontal"==this.dataRangeOption.orient?e:this._itemGroupLocation.x+this._itemGroupLocation.width/2,y:"horizontal"==this.dataRangeOption.orient?this._itemGroupLocation.y+this._itemGroupLocation.height/2:t,color:this.dataRangeOption.textStyle.color,text:i,textFont:this.getFont(this.dataRangeOption.textStyle),textBaseline:"horizontal"==this.dataRangeOption.orient?"middle":"top",textAlign:"horizontal"==this.dataRangeOption.orient?"left":"center"},hoverable:!1}},_getItemShape:function(e,t,i,n,a){return{zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:e,y:t+1,width:i,height:n-2,color:a},highlightStyle:{strokeColor:a,lineWidth:1}}},__ondrift:function(e,t,i){var n=this._calculableLocation.x,a=this._calculableLocation.y,o=this._calculableLocation.width,s=this._calculableLocation.height;return"horizontal"==this.dataRangeOption.orient?e.style.x+t<=n?e.style.x=n:e.style.x+t+e.style.width>=n+o?e.style.x=n+o-e.style.width:e.style.x+=t:e.style.y+i<=a?e.style.y=a:e.style.y+i+e.style.height>=a+s?e.style.y=a+s-e.style.height:e.style.y+=i,"filler"==e._type?this._syncHandleShape():this._syncFillerShape(e),this.dataRangeOption.realtime&&this._dispatchDataRange(),!0},__ondragend:function(){this.isDragend=!0},ondragend:function(e,t){this.isDragend&&e.target&&(t.dragOut=!0,t.dragIn=!0,this.dataRangeOption.realtime||this._dispatchDataRange(),t.needRefresh=!1,this.isDragend=!1)},_syncShapeFromRange:function(){var e=this.dataRangeOption.range||{};if(this._range.end="undefined"!=typeof this._range.end?this._range.end:"undefined"!=typeof e.start?e.start:0,this._range.start="undefined"!=typeof this._range.start?this._range.start:"undefined"!=typeof e.end?e.end:100,100!=this._range.start||0!==this._range.end){if("horizontal"==this.dataRangeOption.orient){var t=this._fillerShape.style.width;this._fillerShape.style.x+=t*(100-this._range.start)/100,this._fillerShape.style.width=t*(this._range.start-this._range.end)/100}else{var i=this._fillerShape.style.height;this._fillerShape.style.y+=i*(100-this._range.start)/100,this._fillerShape.style.height=i*(this._range.start-this._range.end)/100}this.zr.modShape(this._fillerShape.id),this._syncHandleShape()}},_syncHandleShape:function(){var e=this._calculableLocation.x,t=this._calculableLocation.y,i=this._calculableLocation.width,n=this._calculableLocation.height;"horizontal"==this.dataRangeOption.orient?(this._startShape.style.x=this._fillerShape.style.x,this._startMask.style.width=this._startShape.style.x-e,this._endShape.style.x=this._fillerShape.style.x+this._fillerShape.style.width,this._endMask.style.x=this._endShape.style.x,this._endMask.style.width=e+i-this._endShape.style.x,this._range.start=Math.ceil(100-(this._startShape.style.x-e)/i*100),this._range.end=Math.floor(100-(this._endShape.style.x-e)/i*100)):(this._startShape.style.y=this._fillerShape.style.y,this._startMask.style.height=this._startShape.style.y-t,this._endShape.style.y=this._fillerShape.style.y+this._fillerShape.style.height,this._endMask.style.y=this._endShape.style.y,this._endMask.style.height=t+n-this._endShape.style.y,this._range.start=Math.ceil(100-(this._startShape.style.y-t)/n*100),this._range.end=Math.floor(100-(this._endShape.style.y-t)/n*100)),this._syncShape()},_syncFillerShape:function(e){var t,i,n=this._calculableLocation.x,a=this._calculableLocation.y,o=this._calculableLocation.width,s=this._calculableLocation.height;"horizontal"==this.dataRangeOption.orient?(t=this._startShape.style.x,i=this._endShape.style.x,e.id==this._startShape.id&&t>=i?(i=t,this._endShape.style.x=t):e.id==this._endShape.id&&t>=i&&(t=i,this._startShape.style.x=t),this._fillerShape.style.x=t,this._fillerShape.style.width=i-t,this._startMask.style.width=t-n,this._endMask.style.x=i,this._endMask.style.width=n+o-i,this._range.start=Math.ceil(100-(t-n)/o*100),this._range.end=Math.floor(100-(i-n)/o*100)):(t=this._startShape.style.y,i=this._endShape.style.y,e.id==this._startShape.id&&t>=i?(i=t,this._endShape.style.y=t):e.id==this._endShape.id&&t>=i&&(t=i,this._startShape.style.y=t),this._fillerShape.style.y=t,this._fillerShape.style.height=i-t,this._startMask.style.height=t-a,this._endMask.style.y=i,this._endMask.style.height=a+s-i,this._range.start=Math.ceil(100-(t-a)/s*100),this._range.end=Math.floor(100-(i-a)/s*100)),this._syncShape()},_syncShape:function(){this._startShape.position=[this._startShape.style.x-this._startShape.style._x,this._startShape.style.y-this._startShape.style._y],this._startShape.style.text=this._textFormat(this._gap*this._range.start+this.dataRangeOption.min),this._startShape.style.color=this._startShape.highlightStyle.strokeColor=this.getColor(this._gap*this._range.start+this.dataRangeOption.min),this._endShape.position=[this._endShape.style.x-this._endShape.style._x,this._endShape.style.y-this._endShape.style._y],this._endShape.style.text=this._textFormat(this._gap*this._range.end+this.dataRangeOption.min),this._endShape.style.color=this._endShape.highlightStyle.strokeColor=this.getColor(this._gap*this._range.end+this.dataRangeOption.min),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this.zr.modShape(this._startMask.id),this.zr.modShape(this._endMask.id),this.zr.modShape(this._fillerShape.id),this.zr.refreshNextFrame()},_dispatchDataRange:function(){this.messageCenter.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:this._range.end,end:this._range.start}},this.myChart)},__dataRangeSelected:function(e){if("single"===this.dataRangeOption.selectedMode)for(var t in this._selectedMap)this._selectedMap[t]=!1;var i=e.target._idx;this._selectedMap[i]=!this._selectedMap[i];var n=(this._colorList.length-i)*this._gap+this.dataRangeOption.min;this.messageCenter.dispatch(s.EVENT.DATA_RANGE_SELECTED,e.event,{selected:this._selectedMap,target:i,valueMax:n,valueMin:n-this._gap},this.myChart),this.messageCenter.dispatch(s.EVENT.REFRESH,null,null,this.myChart)},__dispatchHoverLink:function(e){var t,i;if(this.dataRangeOption.calculable){var n,a=this.dataRangeOption.max-this.dataRangeOption.min;n="horizontal"==this.dataRangeOption.orient?(1-(l.getX(e.event)-this._calculableLocation.x)/this._calculableLocation.width)*a:(1-(l.getY(e.event)-this._calculableLocation.y)/this._calculableLocation.height)*a,t=n-.05*a,i=n+.05*a}else{var o=e.target._idx;i=(this._colorList.length-o)*this._gap+this.dataRangeOption.min,t=i-this._gap}this.messageCenter.dispatch(s.EVENT.DATA_RANGE_HOVERLINK,e.event,{valueMin:t,valueMax:i},this.myChart)},__onhoverlink:function(e){if(this.dataRangeOption.show&&this.dataRangeOption.hoverLink&&this._indicatorShape&&e&&null!=e.seriesIndex&&null!=e.dataIndex){var t=e.value;if(""===t||isNaN(t))return;tthis.dataRangeOption.max&&(t=this.dataRangeOption.max),this._indicatorShape.position="horizontal"==this.dataRangeOption.orient?[(this.dataRangeOption.max-t)/(this.dataRangeOption.max-this.dataRangeOption.min)*this._calculableLocation.width,0]:[0,(this.dataRangeOption.max-t)/(this.dataRangeOption.max-this.dataRangeOption.min)*this._calculableLocation.height],this._indicatorShape.style.text=this._textFormat(e.value),this._indicatorShape.style.color=this.getColor(t),this.zr.addHoverShape(this._indicatorShape)}},_textFormat:function(e,t){if(e=e.toFixed(this.dataRangeOption.precision),t=null!=t?t.toFixed(this.dataRangeOption.precision):"",this.dataRangeOption.formatter){if("string"==typeof this.dataRangeOption.formatter)return this.dataRangeOption.formatter.replace("{value}",e).replace("{value2}",t);if("function"==typeof this.dataRangeOption.formatter)return this.dataRangeOption.formatter.call(this.myChart,e,t)}return""!==t?e+" - "+t:e},refresh:function(e){if(e){this.option=e,this.option.dataRange=this.reformOption(this.option.dataRange),this.dataRangeOption=this.option.dataRange,this.myChart.canvasSupported||(this.dataRangeOption.realtime=!1);var t=this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable?100:this.dataRangeOption.splitNumber;if(this._colorList=d.getGradientColors(this.dataRangeOption.color,Math.max((t-this.dataRangeOption.color.length)/(this.dataRangeOption.color.length-1),0)+1),this._colorList.length>t){for(var i=this._colorList.length,n=[this._colorList[0]],a=i/(t-1),o=1;t-1>o;o++)n.push(this._colorList[Math.floor(o*a)]);n.push(this._colorList[i-1]),this._colorList=n}var s=this.dataRangeOption.precision;for(this._gap=(this.dataRangeOption.max-this.dataRangeOption.min)/t;this._gap.toFixed(s)-0!=this._gap&&5>s;)s++;this.dataRangeOption.precision=s,this._gap=((this.dataRangeOption.max-this.dataRangeOption.min)/t).toFixed(s)-0,this._valueTextList=[];for(var o=0;t>o;o++)this._selectedMap[o]=!0,this._valueTextList.unshift(this._textFormat(o*this._gap+this.dataRangeOption.min,(o+1)*this._gap+this.dataRangeOption.min))}this.clear(),this._buildShape()},getColor:function(e){if(isNaN(e))return null;if(this.dataRangeOption.min==this.dataRangeOption.max)return this._colorList[0];if(ethis.dataRangeOption.max&&(e=this.dataRangeOption.max),this.dataRangeOption.calculable&&(e-(this._gap*this._range.start+this.dataRangeOption.min)>5e-5||e-(this._gap*this._range.end+this.dataRangeOption.min)<-5e-5))return null;var t=this._colorList.length-Math.ceil((e-this.dataRangeOption.min)/(this.dataRangeOption.max-this.dataRangeOption.min)*this._colorList.length);return t==this._colorList.length&&t--,this._selectedMap[t]?this._colorList[t]:null},getColorByIndex:function(e){return e>=this._colorList.length?e=this._colorList.length-1:0>e&&(e=0),this._colorList[e]},onbeforDispose:function(){this.messageCenter.unbind(s.EVENT.HOVER,this._onhoverlink)}},r.inherits(t,i),e("../component").define("dataRange",t),t}),define("echarts/util/shape/HandlePolygon",["require","zrender/shape/Base","zrender/shape/Polygon","zrender/tool/util"],function(e){function t(e){i.call(this,e)}var i=e("zrender/shape/Base"),n=e("zrender/shape/Polygon"),a=e("zrender/tool/util");return t.prototype={type:"handle-polygon",buildPath:function(e,t){n.prototype.buildPath(e,t)},isCover:function(e,t){var i=this.getTansform(e,t);e=i[0],t=i[1];var n=this.style.rect;return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height?!0:!1}},a.inherits(t,i),t}); \ No newline at end of file diff --git a/build/dist/echarts-all.js b/build/dist/echarts-all.js new file mode 100644 index 0000000..3621ca8 --- /dev/null +++ b/build/dist/echarts-all.js @@ -0,0 +1,25 @@ +!function(e){var t,n;!function(){function e(e,t){if(!t)return e;if(0===e.indexOf(".")){var n=t.split("/"),i=e.split("/"),a=n.length-1,o=i.length,r=0,s=0;e:for(var l=0;o>l;l++)switch(i[l]){case"..":if(!(a>r))break e;r++,s++;break;case".":s++;break;default:break e}return n.length=a-r,i=i.slice(s),n.concat(i).join("/")}return e}function i(t){function n(n,r){if("string"==typeof n){var s=i[n];return s||(s=o(e(n,t)),i[n]=s),s}n instanceof Array&&(r=r||function(){},r.apply(this,a(n,r,t)))}var i={};return n}function a(n,i,a){for(var s=[],l=r[a],h=0,m=Math.min(n.length,i.length);m>h;h++){var V,U=e(n[h],a);switch(U){case"require":V=l&&l.require||t;break;case"exports":V=l.exports;break;case"module":V=l;break;default:V=o(U)}s.push(V)}return s}function o(e){var t=r[e];if(!t)throw new Error("No "+e);if(!t.defined){var n=t.factory,i=n.apply(this,a(t.deps||[],n,e));"undefined"!=typeof i&&(t.exports=i),t.defined=1}return t.exports}var r={};n=function(e,t,n){r[e]={id:e,deps:t,factory:n,defined:0,exports:{},require:i(e)}},t=i("")}(),n("echarts",["echarts/echarts"],function(e){return e}),n("echarts/echarts",["require","./config","zrender/tool/util","zrender/tool/event","zrender/tool/env","zrender","zrender/config","./chart/island","./component/toolbox","./component","./component/title","./component/tooltip","./component/legend","./util/ecData","./chart","zrender/tool/color","./component/timeline","zrender/shape/Image","zrender/loadingEffect/Bar","zrender/loadingEffect/Bubble","zrender/loadingEffect/DynamicLine","zrender/loadingEffect/Ring","zrender/loadingEffect/Spin","zrender/loadingEffect/Whirling","./theme/macarons","./theme/infographic"],function(e){function t(){r.Dispatcher.call(this)}function n(e){e.innerHTML="",this._themeConfig={},this.dom=e,this._connected=!1,this._status={dragIn:!1,dragOut:!1,needRefresh:!1},this._curEventType=!1,this._chartList=[],this._messageCenter=new t,this._messageCenterOutSide=new t,this.resize=this.resize(),this._init()}function i(e,t,n,i,a){for(var o=e._chartList,r=o.length;r--;){var s=o[r];"function"==typeof s[t]&&s[t](n,i,a)}}var a=e("./config"),o=e("zrender/tool/util"),r=e("zrender/tool/event"),s={},l=e("zrender/tool/env").canvasSupported,h=new Date-0,m={},V="_echarts_instance_";s.version="2.2.0",s.dependencies={zrender:"2.0.7"},s.init=function(t,i){var a=e("zrender");a.version.replace(".","")-0r;r++){var l=d[r],h=U[l];o[h]="_on"+l.toLowerCase(),n.on(h,this._onzrevent)}this.chart={},this.component={};var m=e("./chart/island");this._island=new m(this._themeConfig,this._messageCenter,n,{},this),this.chart.island=this._island;var V=e("./component/toolbox");this._toolbox=new V(this._themeConfig,this._messageCenter,n,{},this),this.component.toolbox=this._toolbox;var p=e("./component");p.define("title",e("./component/title")),p.define("tooltip",e("./component/tooltip")),p.define("legend",e("./component/legend")),(0===n.getWidth()||0===n.getHeight())&&console.error("Dom’s width & height should be ready before init.")},__onevent:function(e){e.__echartsId=e.__echartsId||this.id;var t=e.__echartsId===this.id;switch(this._curEventType||(this._curEventType=e.type),e.type){case a.EVENT.LEGEND_SELECTED:this._onlegendSelected(e);break;case a.EVENT.DATA_ZOOM:if(!t){var n=this.component.dataZoom;n&&(n.silence(!0),n.absoluteZoom(e.zoom),n.silence(!1))}this._ondataZoom(e);break;case a.EVENT.DATA_RANGE:t&&this._ondataRange(e);break;case a.EVENT.MAGIC_TYPE_CHANGED:if(!t){var i=this.component.toolbox;i&&(i.silence(!0),i.setMagicType(e.magicType),i.silence(!1))}this._onmagicTypeChanged(e);break;case a.EVENT.DATA_VIEW_CHANGED:t&&this._ondataViewChanged(e);break;case a.EVENT.TOOLTIP_HOVER:t&&this._tooltipHover(e);break;case a.EVENT.RESTORE:this._onrestore();break;case a.EVENT.REFRESH:t&&this._onrefresh(e);break;case a.EVENT.TOOLTIP_IN_GRID:case a.EVENT.TOOLTIP_OUT_GRID:if(t){if(this._connected){var o=this.component.grid;o&&(e.x=(e.event.zrenderX-o.getX())/o.getWidth(),e.y=(e.event.zrenderY-o.getY())/o.getHeight())}}else{var o=this.component.grid;o&&this._zr.trigger("mousemove",{connectTrigger:!0,zrenderX:o.getX()+e.x*o.getWidth(),zrenderY:o.getY()+e.y*o.getHeight()})}}if(this._connected&&t&&this._curEventType===e.type){for(var r in this._connected)this._connected[r].connectedEventHandler(e);this._curEventType=null}(!t||!this._connected&&t)&&(this._curEventType=null)},_onclick:function(e){if(i(this,"onclick",e),e.target){var t=this._eventPackage(e.target);t&&null!=t.seriesIndex&&this._messageCenter.dispatch(a.EVENT.CLICK,e.event,t,this)}},_ondblclick:function(e){if(i(this,"ondblclick",e),e.target){var t=this._eventPackage(e.target);t&&null!=t.seriesIndex&&this._messageCenter.dispatch(a.EVENT.DBLCLICK,e.event,t,this)}},_onmouseover:function(e){if(e.target){var t=this._eventPackage(e.target);t&&null!=t.seriesIndex&&this._messageCenter.dispatch(a.EVENT.HOVER,e.event,t,this)}},_onmouseout:function(e){if(e.target){var t=this._eventPackage(e.target);t&&null!=t.seriesIndex&&this._messageCenter.dispatch(a.EVENT.MOUSEOUT,e.event,t,this)}},_ondragstart:function(e){this._status={dragIn:!1,dragOut:!1,needRefresh:!1},i(this,"ondragstart",e)},_ondragenter:function(e){i(this,"ondragenter",e)},_ondragover:function(e){i(this,"ondragover",e)},_ondragleave:function(e){i(this,"ondragleave",e)},_ondrop:function(e){i(this,"ondrop",e,this._status),this._island.ondrop(e,this._status)},_ondragend:function(e){if(i(this,"ondragend",e,this._status),this._timeline&&this._timeline.ondragend(e,this._status),this._island.ondragend(e,this._status),this._status.needRefresh){this._syncBackupData(this._option);var t=this._messageCenter;t.dispatch(a.EVENT.DATA_CHANGED,e.event,this._eventPackage(e.target),this),t.dispatch(a.EVENT.REFRESH,null,null,this)}},_onlegendSelected:function(e){this._status.needRefresh=!1,i(this,"onlegendSelected",e,this._status),this._status.needRefresh&&this._messageCenter.dispatch(a.EVENT.REFRESH,null,null,this)},_ondataZoom:function(e){this._status.needRefresh=!1,i(this,"ondataZoom",e,this._status),this._status.needRefresh&&this._messageCenter.dispatch(a.EVENT.REFRESH,null,null,this)},_ondataRange:function(e){this._clearEffect(),this._status.needRefresh=!1,i(this,"ondataRange",e,this._status),this._status.needRefresh&&this._zr.refreshNextFrame()},_onmagicTypeChanged:function(){this._clearEffect(),this._render(this._toolbox.getMagicOption())},_ondataViewChanged:function(e){this._syncBackupData(e.option),this._messageCenter.dispatch(a.EVENT.DATA_CHANGED,null,e,this),this._messageCenter.dispatch(a.EVENT.REFRESH,null,null,this)},_tooltipHover:function(e){var t=[];i(this,"ontooltipHover",e,t)},_onrestore:function(){this.restore()},_onrefresh:function(e){this._refreshInside=!0,this.refresh(e),this._refreshInside=!1},_syncBackupData:function(e){this.component.dataZoom&&this.component.dataZoom.syncBackupData(e)},_eventPackage:function(t){if(t){var n=e("./util/ecData"),i=n.get(t,"seriesIndex"),a=n.get(t,"dataIndex");return a=-1!=i&&this.component.dataZoom?this.component.dataZoom.getRealDataIndex(i,a):a,{seriesIndex:i,seriesName:(n.get(t,"series")||{}).name,dataIndex:a,data:n.get(t,"data"),name:n.get(t,"name"),value:n.get(t,"value"),special:n.get(t,"special")}}},_noDataCheck:function(e){for(var t=e.series,n=0,i=t.length;i>n;n++)if(t[n].type==a.CHART_TYPE_MAP||t[n].data&&t[n].data.length>0||t[n].markPoint&&t[n].markPoint.data&&t[n].markPoint.data.length>0||t[n].markLine&&t[n].markLine.data&&t[n].markLine.data.length>0||t[n].nodes&&t[n].nodes.length>0||t[n].links&&t[n].links.length>0||t[n].matrix&&t[n].matrix.length>0||t[n].eventList&&t[n].eventList.length>0)return!1;this.clear();var o=this._option&&this._option.noDataLoadingOption||this._themeConfig.noDataLoadingOption||a.noDataLoadingOption||{text:this._option&&this._option.noDataText||this._themeConfig.noDataText||a.noDataText,effect:this._option&&this._option.noDataEffect||this._themeConfig.noDataEffect||a.noDataEffect};return this.showLoading(o),!0},_render:function(t){if(this._mergeGlobalConifg(t),!this._noDataCheck(t)){var n=t.backgroundColor;if(n)if(l||-1==n.indexOf("rgba"))this.dom.style.backgroundColor=n;else{var i=n.split(",");this.dom.style.filter="alpha(opacity="+100*i[3].substring(0,i[3].lastIndexOf(")"))+")",i.length=3,i[0]=i[0].replace("a",""),this.dom.style.backgroundColor=i.join(",")+")"}this._zr.clearAnimation(),this._chartList=[];var o=e("./chart"),r=e("./component");(t.xAxis||t.yAxis)&&(t.grid=t.grid||{},t.dataZoom=t.dataZoom||{});for(var s,h,m,V=["title","legend","tooltip","dataRange","roamController","grid","dataZoom","xAxis","yAxis","polar"],U=0,d=V.length;d>U;U++)h=V[U],m=this.component[h],t[h]?(m?m.refresh&&m.refresh(t):(s=r.get(/^[xy]Axis$/.test(h)?"axis":h),m=new s(this._themeConfig,this._messageCenter,this._zr,t,this,h),this.component[h]=m),this._chartList.push(m)):m&&(m.dispose(),this.component[h]=null,delete this.component[h]);for(var p,c,u,y={},U=0,d=t.series.length;d>U;U++)c=t.series[U].type,c?y[c]||(y[c]=!0,p=o.get(c),p?(this.chart[c]?(u=this.chart[c],u.refresh(t)):u=new p(this._themeConfig,this._messageCenter,this._zr,t,this),this._chartList.push(u),this.chart[c]=u):console.error(c+" has not been required.")):console.error("series["+U+"] chart type has not been defined.");for(c in this.chart)c==a.CHART_TYPE_ISLAND||y[c]||(this.chart[c].dispose(),this.chart[c]=null,delete this.chart[c]);this.component.grid&&this.component.grid.refixAxisShape(this.component),this._island.refresh(t),this._toolbox.refresh(t),t.animation&&!t.renderAsImage?this._zr.refresh():this._zr.render();var g="IMG"+this.id,b=document.getElementById(g);t.renderAsImage&&l?(b?b.src=this.getDataURL(t.renderAsImage):(b=this.getImage(t.renderAsImage),b.id=g,b.style.position="absolute",b.style.left=0,b.style.top=0,this.dom.firstChild.appendChild(b)),this.un(),this._zr.un(),this._disposeChartList(),this._zr.clear()):b&&b.parentNode.removeChild(b),b=null,this._option=t}},restore:function(){this._clearEffect(),this._option=o.clone(this._optionRestore),this._disposeChartList(),this._island.clear(),this._toolbox.reset(this._option,!0),this._render(this._option)},refresh:function(e){this._clearEffect(),e=e||{};var t=e.option;!this._refreshInside&&t&&(t=this.getOption(),o.merge(t,e.option,!0),o.merge(this._optionRestore,e.option,!0),this._toolbox.reset(t)),this._island.refresh(t),this._toolbox.refresh(t),this._zr.clearAnimation();for(var n=0,i=this._chartList.length;i>n;n++)this._chartList[n].refresh&&this._chartList[n].refresh(t);this.component.grid&&this.component.grid.refixAxisShape(this.component),this._zr.refresh()},_disposeChartList:function(){this._clearEffect(),this._zr.clearAnimation();for(var e=this._chartList.length;e--;){var t=this._chartList[e];if(t){var n=t.type;this.chart[n]&&delete this.chart[n],this.component[n]&&delete this.component[n],t.dispose&&t.dispose()}}this._chartList=[]},_mergeGlobalConifg:function(t){for(var n=["backgroundColor","calculable","calculableColor","calculableHolderColor","nameConnector","valueConnector","animation","animationThreshold","animationDuration","animationDurationUpdate","animationEasing","addDataAnimation","symbolList","DRAG_ENABLE_TIME"],i=n.length;i--;){var o=n[i];null==t[o]&&(t[o]=null!=this._themeConfig[o]?this._themeConfig[o]:a[o])}var r=t.color;r&&r.length||(r=this._themeConfig.color||a.color),this._zr.getColor=function(t){var n=e("zrender/tool/color");return n.getColor(t,r)},l||(t.animation=!1,t.addDataAnimation=!1)},setOption:function(e,t){return e.timeline?this._setTimelineOption(e):this._setOption(e,t)},_setOption:function(e,t){return this._option=!t&&this._option?o.merge(this.getOption(),o.clone(e),!0):o.clone(e),this._optionRestore=o.clone(this._option),this._option.series&&0!==this._option.series.length?(this.component.dataZoom&&(this._option.dataZoom||this._option.toolbox&&this._option.toolbox.feature&&this._option.toolbox.feature.dataZoom&&this._option.toolbox.feature.dataZoom.show)&&this.component.dataZoom.syncOption(this._option),this._toolbox.reset(this._option),this._render(this._option),this):void this._zr.clear()},getOption:function(){function e(e){var i=n._optionRestore[e];if(i)if(i instanceof Array)for(var a=i.length;a--;)t[e][a].data=o.clone(i[a].data);else t[e].data=o.clone(i.data)}var t=o.clone(this._option),n=this;return e("xAxis"),e("yAxis"),e("series"),t},setSeries:function(e,t){return t?(this._option.series=e,this.setOption(this._option,t)):this.setOption({series:e}),this},getSeries:function(){return this.getOption().series},_setTimelineOption:function(t){this._timeline&&this._timeline.dispose();var n=e("./component/timeline"),i=new n(this._themeConfig,this._messageCenter,this._zr,t,this);return this._timeline=i,this.component.timeline=this._timeline,this},addData:function(e,t,n,i,r){for(var s=e instanceof Array?e:[[e,t,n,i,r]],l=this.getOption(),h=this._optionRestore,m=0,V=s.length;V>m;m++){e=s[m][0],t=s[m][1],n=s[m][2],i=s[m][3],r=s[m][4];var U=h.series[e],d=n?"unshift":"push",p=n?"pop":"shift";if(U){var c=U.data,u=l.series[e].data;if(c[d](t),u[d](t),i||(c[p](),t=u[p]()),null!=r){var y,g;if(U.type===a.CHART_TYPE_PIE&&(y=h.legend)&&(g=y.data)){var b=l.legend.data;if(g[d](r),b[d](r),!i){var f=o.indexOf(g,t.name);-1!=f&&g.splice(f,1),f=o.indexOf(b,t.name),-1!=f&&b.splice(f,1)}}else if(null!=h.xAxis&&null!=h.yAxis){var k,x,_=U.xAxisIndex||0;(null==h.xAxis[_].type||"category"===h.xAxis[_].type)&&(k=h.xAxis[_].data,x=l.xAxis[_].data,k[d](r),x[d](r),i||(k[p](),x[p]())),_=U.yAxisIndex||0,"category"===h.yAxis[_].type&&(k=h.yAxis[_].data,x=l.yAxis[_].data,k[d](r),x[d](r),i||(k[p](),x[p]()))}}this._option.series[e].data=l.series[e].data}}this._zr.clearAnimation();for(var L=this._chartList,m=0,V=L.length;V>m;m++)l.addDataAnimation&&L[m].addDataAnimation&&L[m].addDataAnimation(s);this.component.dataZoom&&this.component.dataZoom.syncOption(l),this._option=l;var W=this;return setTimeout(function(){if(W._zr){W._zr.clearAnimation();for(var e=0,t=L.length;t>e;e++)L[e].motionlessOnce=l.addDataAnimation&&L[e].addDataAnimation;W._messageCenter.dispatch(a.EVENT.REFRESH,null,{option:l},W)}},l.addDataAnimation?l.animationDurationUpdate:0),this},addMarkPoint:function(e,t){return this._addMark(e,t,"markPoint")},addMarkLine:function(e,t){return this._addMark(e,t,"markLine")},_addMark:function(e,t,n){var i,a=this._option.series;if(a&&(i=a[e])){var r=this._optionRestore.series,s=r[e],l=i[n],h=s[n];l=i[n]=l||{data:[]},h=s[n]=h||{data:[]};for(var m in t)"data"===m?(l.data=l.data.concat(t.data),h.data=h.data.concat(t.data)):"object"!=typeof t[m]||null==l[m]?l[m]=h[m]=t[m]:(o.merge(l[m],t[m],!0),o.merge(h[m],t[m],!0));var V=this.chart[i.type];V&&V.addMark(e,t,n)}return this},delMarkPoint:function(e,t){return this._delMark(e,t,"markPoint")},delMarkLine:function(e,t){return this._delMark(e,t,"markLine")},_delMark:function(e,t,n){var i,a,o,r=this._option.series;if(!(r&&(i=r[e])&&(a=i[n])&&(o=a.data)))return this;t=t.split(" > ");for(var s=-1,l=0,h=o.length;h>l;l++){var m=o[l];if(m instanceof Array){if(m[0].name===t[0]&&m[1].name===t[1]){s=l;break}}else if(m.name===t[0]){s=l;break}}if(s>-1){o.splice(s,1),this._optionRestore.series[e][n].data.splice(s,1);var V=this.chart[i.type];V&&V.delMark(e,t.join(" > "),n)}return this},getDom:function(){return this.dom},getZrender:function(){return this._zr},getDataURL:function(e){if(!l)return"";if(0===this._chartList.length){var t="IMG"+this.id,n=document.getElementById(t);if(n)return n.src}var i=this.component.tooltip;switch(i&&i.hideTip(),e){case"jpeg":break;default:e="png"}var a=this._option.backgroundColor;return a&&"rgba(0,0,0,0)"===a.replace(" ","")&&(a="#fff"),this._zr.toDataURL("image/"+e,a)},getImage:function(e){var t=this._optionRestore.title,n=document.createElement("img");return n.src=this.getDataURL(e),n.title=t&&t.text||"ECharts",n},getConnectedDataURL:function(t){if(!this.isConnected())return this.getDataURL(t);var n=this.dom,i={self:{img:this.getDataURL(t),left:n.offsetLeft,top:n.offsetTop,right:n.offsetLeft+n.offsetWidth,bottom:n.offsetTop+n.offsetHeight}},a=i.self.left,o=i.self.top,r=i.self.right,s=i.self.bottom;for(var l in this._connected)n=this._connected[l].getDom(),i[l]={img:this._connected[l].getDataURL(t),left:n.offsetLeft,top:n.offsetTop,right:n.offsetLeft+n.offsetWidth,bottom:n.offsetTop+n.offsetHeight},a=Math.min(a,i[l].left),o=Math.min(o,i[l].top),r=Math.max(r,i[l].right),s=Math.max(s,i[l].bottom);var h=document.createElement("div");h.style.position="absolute",h.style.left="-4000px",h.style.width=r-a+"px",h.style.height=s-o+"px",document.body.appendChild(h);var m=e("zrender").init(h),V=e("zrender/shape/Image");for(var l in i)m.addShape(new V({style:{x:i[l].left-a,y:i[l].top-o,image:i[l].img}}));m.render();var U=this._option.backgroundColor;U&&"rgba(0,0,0,0)"===U.replace(/ /g,"")&&(U="#fff");var d=m.toDataURL("image/png",U);return setTimeout(function(){m.dispose(),h.parentNode.removeChild(h),h=null},100),d},getConnectedImage:function(e){var t=this._optionRestore.title,n=document.createElement("img");return n.src=this.getConnectedDataURL(e),n.title=t&&t.text||"ECharts",n},on:function(e,t){return this._messageCenterOutSide.bind(e,t,this),this},un:function(e,t){return this._messageCenterOutSide.unbind(e,t),this},connect:function(e){if(!e)return this;if(this._connected||(this._connected={}),e instanceof Array)for(var t=0,n=e.length;n>t;t++)this._connected[e[t].id]=e[t];else this._connected[e.id]=e;return this},disConnect:function(e){if(!e||!this._connected)return this;if(e instanceof Array)for(var t=0,n=e.length;n>t;t++)delete this._connected[e[t].id];else delete this._connected[e.id];for(var i in this._connected)return this;return this._connected=!1,this},connectedEventHandler:function(e){e.__echartsId!=this.id&&this._onevent(e)},isConnected:function(){return!!this._connected},showLoading:function(t){var n={bar:e("zrender/loadingEffect/Bar"),bubble:e("zrender/loadingEffect/Bubble"),dynamicLine:e("zrender/loadingEffect/DynamicLine"),ring:e("zrender/loadingEffect/Ring"),spin:e("zrender/loadingEffect/Spin"),whirling:e("zrender/loadingEffect/Whirling")};this._toolbox.hideDataView(),t=t||{};var i=t.textStyle||{};t.textStyle=i;var r=o.merge(o.merge(o.clone(i),this._themeConfig.textStyle),a.textStyle);i.textFont=r.fontStyle+" "+r.fontWeight+" "+r.fontSize+"px "+r.fontFamily,i.text=t.text||this._option&&this._option.loadingText||this._themeConfig.loadingText||a.loadingText,null!=t.x&&(i.x=t.x),null!=t.y&&(i.y=t.y),t.effectOption=t.effectOption||{},t.effectOption.textStyle=i;var s=t.effect;return("string"==typeof s||null==s)&&(s=n[t.effect||this._option&&this._option.loadingEffect||this._themeConfig.loadingEffect||a.loadingEffect]||n.spin),this._zr.showLoading(new s(t.effectOption)),this},hideLoading:function(){return this._zr.hideLoading(),this},setTheme:function(t){if(t){if("string"==typeof t)switch(t){case"macarons":t=e("./theme/macarons");break;case"infographic":t=e("./theme/infographic");break;default:t={}}else t=t||{};this._themeConfig=t}if(!l){var n=this._themeConfig.textStyle;n&&n.fontFamily&&n.fontFamily2&&(n.fontFamily=n.fontFamily2),n=a.textStyle,n.fontFamily=n.fontFamily2}this._timeline&&this._timeline.setTheme(!0),this._optionRestore&&this.restore()},resize:function(){var e=this;return function(){if(e._clearEffect(),e._zr.resize(),e._option&&e._option.renderAsImage&&l)return e._render(e._option),e;e._zr.clearAnimation(),e._island.resize(),e._toolbox.resize(),e._timeline&&e._timeline.resize();for(var t=0,n=e._chartList.length;n>t;t++)e._chartList[t].resize&&e._chartList[t].resize();return e.component.grid&&e.component.grid.refixAxisShape(e.component),e._zr.refresh(),e._messageCenter.dispatch(a.EVENT.RESIZE,null,null,e),e}},_clearEffect:function(){this._zr.modLayer(a.EFFECT_ZLEVEL,{motionBlur:!1}),this._zr.painter.clearLayer(a.EFFECT_ZLEVEL)},clear:function(){return this._disposeChartList(),this._zr.clear(),this._option={},this._optionRestore={},this.dom.style.backgroundColor=null,this},dispose:function(){var e=this.dom.getAttribute(V);e&&delete m[e],this._island.dispose(),this._toolbox.dispose(),this._timeline&&this._timeline.dispose(),this._messageCenter.unbind(),this.clear(),this._zr.dispose(),this._zr=null}},s}),n("echarts/config",[],function(){var e={CHART_TYPE_LINE:"line",CHART_TYPE_BAR:"bar",CHART_TYPE_SCATTER:"scatter",CHART_TYPE_PIE:"pie",CHART_TYPE_RADAR:"radar",CHART_TYPE_MAP:"map",CHART_TYPE_K:"k",CHART_TYPE_ISLAND:"island",CHART_TYPE_FORCE:"force",CHART_TYPE_CHORD:"chord",CHART_TYPE_GAUGE:"gauge",CHART_TYPE_FUNNEL:"funnel",CHART_TYPE_EVENTRIVER:"eventRiver",COMPONENT_TYPE_TITLE:"title",COMPONENT_TYPE_LEGEND:"legend",COMPONENT_TYPE_DATARANGE:"dataRange",COMPONENT_TYPE_DATAVIEW:"dataView",COMPONENT_TYPE_DATAZOOM:"dataZoom",COMPONENT_TYPE_TOOLBOX:"toolbox",COMPONENT_TYPE_TOOLTIP:"tooltip",COMPONENT_TYPE_GRID:"grid",COMPONENT_TYPE_AXIS:"axis",COMPONENT_TYPE_POLAR:"polar",COMPONENT_TYPE_X_AXIS:"xAxis",COMPONENT_TYPE_Y_AXIS:"yAxis",COMPONENT_TYPE_AXIS_CATEGORY:"categoryAxis",COMPONENT_TYPE_AXIS_VALUE:"valueAxis",COMPONENT_TYPE_TIMELINE:"timeline",COMPONENT_TYPE_ROAMCONTROLLER:"roamController",backgroundColor:"rgba(0,0,0,0)",color:["#ff7f50","#87cefa","#da70d6","#32cd32","#6495ed","#ff69b4","#ba55d3","#cd5c5c","#ffa500","#40e0d0","#1e90ff","#ff6347","#7b68ee","#00fa9a","#ffd700","#6699FF","#ff6666","#3cb371","#b8860b","#30e0e0"],markPoint:{clickable:!0,symbol:"pin",symbolSize:10,large:!1,effect:{show:!1,loop:!0,period:15,type:"scale",scaleSize:2,bounceDistance:10},itemStyle:{normal:{borderWidth:2,label:{show:!0,position:"inside"}},emphasis:{label:{show:!0}}}},markLine:{clickable:!0,symbol:["circle","arrow"],symbolSize:[2,4],smoothRadian:.2,precision:2,effect:{show:!1,loop:!0,period:15,scaleSize:2},itemStyle:{normal:{borderWidth:1.5,label:{show:!0,position:"end"},lineStyle:{type:"dashed"}},emphasis:{label:{show:!1},lineStyle:{}}}},textStyle:{decoration:"none",fontFamily:"Arial, Verdana, sans-serif",fontFamily2:"微软雅黑",fontSize:12,fontStyle:"normal",fontWeight:"normal"},EVENT:{REFRESH:"refresh",RESTORE:"restore",RESIZE:"resize",CLICK:"click",DBLCLICK:"dblclick",HOVER:"hover",MOUSEOUT:"mouseout",DATA_CHANGED:"dataChanged",DATA_ZOOM:"dataZoom",DATA_RANGE:"dataRange",DATA_RANGE_SELECTED:"dataRangeSelected",DATA_RANGE_HOVERLINK:"dataRangeHoverLink",LEGEND_SELECTED:"legendSelected",LEGEND_HOVERLINK:"legendHoverLink",MAP_SELECTED:"mapSelected",PIE_SELECTED:"pieSelected",MAGIC_TYPE_CHANGED:"magicTypeChanged",DATA_VIEW_CHANGED:"dataViewChanged",TIMELINE_CHANGED:"timelineChanged",MAP_ROAM:"mapRoam",FORCE_LAYOUT_END:"forceLayoutEnd",TOOLTIP_HOVER:"tooltipHover",TOOLTIP_IN_GRID:"tooltipInGrid",TOOLTIP_OUT_GRID:"tooltipOutGrid",ROAMCONTROLLER:"roamController"},DRAG_ENABLE_TIME:120,EFFECT_ZLEVEL:10,symbolList:["circle","rectangle","triangle","diamond","emptyCircle","emptyRectangle","emptyTriangle","emptyDiamond"],loadingEffect:"spin",loadingText:"数据读取中...",noDataEffect:"bubble",noDataText:"暂无数据",calculable:!1,calculableColor:"rgba(255,165,0,0.6)",calculableHolderColor:"#ccc",nameConnector:" & ",valueConnector:": ",animation:!0,addDataAnimation:!0,animationThreshold:2e3,animationDuration:2e3,animationDurationUpdate:500,animationEasing:"ExponentialOut"};return e}),n("zrender/tool/util",["require","../dep/excanvas"],function(e){function t(e){return e&&1===e.nodeType&&"string"==typeof e.nodeName}function n(e){if("object"==typeof e&&null!==e){var i=e;if(e instanceof Array){i=[];for(var a=0,o=e.length;o>a;a++)i[a]=n(e[a])}else if(!u[y.call(e)]&&!t(e)){i={};for(var r in e)e.hasOwnProperty(r)&&(i[r]=n(e[r]))}return i}return e}function i(e,n,i,o){if(n.hasOwnProperty(i)){var r=e[i];"object"!=typeof r||u[y.call(r)]||t(r)?!o&&i in e||(e[i]=n[i]):a(e[i],n[i],o)}}function a(e,t,n){for(var a in t)i(e,t,a,n);return e}function o(){if(!V)if(e("../dep/excanvas"),window.G_vmlCanvasManager){var t=document.createElement("div");t.style.position="absolute",t.style.top="-1000px",document.body.appendChild(t),V=G_vmlCanvasManager.initElement(t).getContext("2d")}else V=document.createElement("canvas").getContext("2d");return V}function r(){return d||(U=document.createElement("canvas"),p=U.width,c=U.height,d=U.getContext("2d")),d}function s(e,t){var n,i=100;e+g>p&&(p=e+g+i,U.width=p,n=!0),t+b>c&&(c=t+b+i,U.height=c,n=!0),-g>e&&(g=Math.ceil(-e/i)*i,p+=g,U.width=p,n=!0),-b>t&&(b=Math.ceil(-t/i)*i,c+=b,U.height=c,n=!0),n&&d.translate(g,b)}function l(){return{x:g,y:b}}function h(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,i=e.length;i>n;n++)if(e[n]===t)return n;return-1}function m(e,t){function n(){}var i=e.prototype;n.prototype=t.prototype,e.prototype=new n;for(var a in i)e.prototype[a]=i[a];e.constructor=e}var V,U,d,p,c,u={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1},y=Object.prototype.toString,g=0,b=0;return{inherits:m,clone:n,merge:a,getContext:o,getPixelContext:r,getPixelOffset:l,adjustCanvasSize:s,indexOf:h}}),n("zrender/tool/event",["require","../mixin/Eventful"],function(e){"use strict";function t(e){return"undefined"!=typeof e.zrenderX&&e.zrenderX||"undefined"!=typeof e.offsetX&&e.offsetX||"undefined"!=typeof e.layerX&&e.layerX||"undefined"!=typeof e.clientX&&e.clientX}function n(e){return"undefined"!=typeof e.zrenderY&&e.zrenderY||"undefined"!=typeof e.offsetY&&e.offsetY||"undefined"!=typeof e.layerY&&e.layerY||"undefined"!=typeof e.clientY&&e.clientY}function i(e){return"undefined"!=typeof e.zrenderDelta&&e.zrenderDelta||"undefined"!=typeof e.wheelDelta&&e.wheelDelta||"undefined"!=typeof e.detail&&-e.detail}var a=e("../mixin/Eventful"),o="function"==typeof window.addEventListener?function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0}:function(e){e.returnValue=!1,e.cancelBubble=!0};return{getX:t,getY:n,getDelta:i,stop:o,Dispatcher:a}}),n("zrender/tool/env",[],function(){function e(e){var t=this.os={},n=this.browser={},i=e.match(/Web[kK]it[\/]{0,1}([\d.]+)/),a=e.match(/(Android);?[\s\/]+([\d.]+)?/),o=e.match(/(iPad).*OS\s([\d_]+)/),r=e.match(/(iPod)(.*OS\s([\d_]+))?/),s=!o&&e.match(/(iPhone\sOS)\s([\d_]+)/),l=e.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),h=l&&e.match(/TouchPad/),m=e.match(/Kindle\/([\d.]+)/),V=e.match(/Silk\/([\d._]+)/),U=e.match(/(BlackBerry).*Version\/([\d.]+)/),d=e.match(/(BB10).*Version\/([\d.]+)/),p=e.match(/(RIM\sTablet\sOS)\s([\d.]+)/),c=e.match(/PlayBook/),u=e.match(/Chrome\/([\d.]+)/)||e.match(/CriOS\/([\d.]+)/),y=e.match(/Firefox\/([\d.]+)/),g=e.match(/MSIE ([\d.]+)/),b=i&&e.match(/Mobile\//)&&!u,f=e.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/)&&!u,g=e.match(/MSIE\s([\d.]+)/);return(n.webkit=!!i)&&(n.version=i[1]),a&&(t.android=!0,t.version=a[2]),s&&!r&&(t.ios=t.iphone=!0,t.version=s[2].replace(/_/g,".")),o&&(t.ios=t.ipad=!0,t.version=o[2].replace(/_/g,".")),r&&(t.ios=t.ipod=!0,t.version=r[3]?r[3].replace(/_/g,"."):null),l&&(t.webos=!0,t.version=l[2]),h&&(t.touchpad=!0),U&&(t.blackberry=!0,t.version=U[2]),d&&(t.bb10=!0,t.version=d[2]),p&&(t.rimtabletos=!0,t.version=p[2]),c&&(n.playbook=!0),m&&(t.kindle=!0,t.version=m[1]),V&&(n.silk=!0,n.version=V[1]),!V&&t.android&&e.match(/Kindle Fire/)&&(n.silk=!0),u&&(n.chrome=!0,n.version=u[1]),y&&(n.firefox=!0,n.version=y[1]),g&&(n.ie=!0,n.version=g[1]),b&&(e.match(/Safari/)||t.ios)&&(n.safari=!0),f&&(n.webview=!0),g&&(n.ie=!0,n.version=g[1]),t.tablet=!!(o||c||a&&!e.match(/Mobile/)||y&&e.match(/Tablet/)||g&&!e.match(/Phone/)&&e.match(/Touch/)),t.phone=!(t.tablet||t.ipod||!(a||s||l||U||d||u&&e.match(/Android/)||u&&e.match(/CriOS\/([\d.]+)/)||y&&e.match(/Mobile/)||g&&e.match(/Touch/))),{browser:n,os:t,canvasSupported:document.createElement("canvas").getContext?!0:!1}}return e(navigator.userAgent)}),n("zrender",["zrender/zrender"],function(e){return e}),n("zrender/zrender",["require","./dep/excanvas","./tool/util","./tool/log","./tool/guid","./Handler","./Painter","./Storage","./animation/Animation","./tool/env"],function(e){function t(e){return function(){for(var t=e.animatingElements,n=0,i=t.length;i>n;n++)e.storage.mod(t[n].id);(t.length||e._needsRefreshNextFrame)&&e.refresh()}}e("./dep/excanvas");var n=e("./tool/util"),i=e("./tool/log"),a=e("./tool/guid"),o=e("./Handler"),r=e("./Painter"),s=e("./Storage"),l=e("./animation/Animation"),h={},m={};m.version="2.0.7",m.init=function(e){var t=new V(a(),e);return h[t.id]=t,t},m.dispose=function(e){if(e)e.dispose();else{for(var t in h)h[t].dispose();h={}}return m},m.getInstance=function(e){return h[e]},m.delInstance=function(e){return delete h[e],m};var V=function(n,i){this.id=n,this.env=e("./tool/env"),this.storage=new s,this.painter=new r(i,this.storage),this.handler=new o(i,this.storage,this.painter),this.animatingElements=[],this.animation=new l({stage:{update:t(this)}}),this.animation.start();var a=this;this.painter.refreshNextFrame=function(){a.refreshNextFrame()},this._needsRefreshNextFrame=!1};return V.prototype.getId=function(){return this.id},V.prototype.addShape=function(e){return this.storage.addRoot(e),this},V.prototype.addGroup=function(e){return this.storage.addRoot(e),this},V.prototype.delShape=function(e){return this.storage.delRoot(e),this},V.prototype.delGroup=function(e){return this.storage.delRoot(e),this},V.prototype.modShape=function(e,t){return this.storage.mod(e,t),this},V.prototype.modGroup=function(e,t){return this.storage.mod(e,t),this},V.prototype.modLayer=function(e,t){return this.painter.modLayer(e,t),this},V.prototype.addHoverShape=function(e){return this.storage.addHover(e),this},V.prototype.render=function(e){return this.painter.render(e),this._needsRefreshNextFrame=!1,this},V.prototype.refresh=function(e){return this.painter.refresh(e),this._needsRefreshNextFrame=!1,this},V.prototype.refreshNextFrame=function(){return this._needsRefreshNextFrame=!0,this},V.prototype.refreshHover=function(e){return this.painter.refreshHover(e),this},V.prototype.refreshShapes=function(e,t){return this.painter.refreshShapes(e,t),this},V.prototype.resize=function(){return this.painter.resize(),this},V.prototype.animate=function(e,t,a){if("string"==typeof e&&(e=this.storage.get(e)),e){var o;if(t){for(var r=t.split("."),s=e,l=0,h=r.length;h>l;l++)s&&(s=s[r[l]]);s&&(o=s)}else o=e;if(!o)return void i('Property "'+t+'" is not existed in element '+e.id);var m=this.animatingElements;return"undefined"==typeof e.__aniCount&&(e.__aniCount=0),0===e.__aniCount&&m.push(e),e.__aniCount++,this.animation.animate(o,{loop:a}).done(function(){if(e.__aniCount--,0===e.__aniCount){var t=n.indexOf(m,e);m.splice(t,1)}})}i("Element not existed")},V.prototype.clearAnimation=function(){this.animation.clear()},V.prototype.showLoading=function(e){return this.painter.showLoading(e),this},V.prototype.hideLoading=function(){return this.painter.hideLoading(),this},V.prototype.getWidth=function(){return this.painter.getWidth()},V.prototype.getHeight=function(){return this.painter.getHeight()},V.prototype.toDataURL=function(e,t,n){return this.painter.toDataURL(e,t,n) +},V.prototype.shapeToImage=function(e,t,n){var i=a();return this.painter.shapeToImage(i,e,t,n)},V.prototype.on=function(e,t,n){return this.handler.on(e,t,n),this},V.prototype.un=function(e,t){return this.handler.un(e,t),this},V.prototype.trigger=function(e,t){return this.handler.trigger(e,t),this},V.prototype.clear=function(){return this.storage.delRoot(),this.painter.clear(),this},V.prototype.dispose=function(){this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.animatingElements=this.storage=this.painter=this.handler=null,m.delInstance(this.id)},m}),n("zrender/config",[],function(){var e={EVENT:{RESIZE:"resize",CLICK:"click",DBLCLICK:"dblclick",MOUSEWHEEL:"mousewheel",MOUSEMOVE:"mousemove",MOUSEOVER:"mouseover",MOUSEOUT:"mouseout",MOUSEDOWN:"mousedown",MOUSEUP:"mouseup",GLOBALOUT:"globalout",DRAGSTART:"dragstart",DRAGEND:"dragend",DRAGENTER:"dragenter",DRAGOVER:"dragover",DRAGLEAVE:"dragleave",DROP:"drop",touchClickDelay:300},catchBrushException:!1,debugMode:0,devicePixelRatio:Math.max(window.devicePixelRatio||1,1)};return e}),n("echarts/chart/island",["require","./base","zrender/shape/Circle","../config","../util/ecData","zrender/tool/util","zrender/tool/event","zrender/tool/color","../util/accMath","../chart"],function(e){function t(e,t,i,a,r){n.call(this,e,t,i,a,r),this._nameConnector,this._valueConnector,this._zrHeight=this.zr.getHeight(),this._zrWidth=this.zr.getWidth();var l=this;l.shapeHandler.onmousewheel=function(e){var t=e.target,n=e.event,i=s.getDelta(n);i=i>0?-1:1,t.style.r-=i,t.style.r=t.style.r<5?5:t.style.r;var a=o.get(t,"value"),r=a*l.option.island.calculateStep;a=r>1?Math.round(a-r*i):+(a-r*i).toFixed(2);var h=o.get(t,"name");t.style.text=h+":"+a,o.set(t,"value",a),o.set(t,"name",h),l.zr.modShape(t.id),l.zr.refreshNextFrame(),s.stop(n)}}var n=e("./base"),i=e("zrender/shape/Circle"),a=e("../config");a.island={zlevel:0,z:5,r:15,calculateStep:.1};var o=e("../util/ecData"),r=e("zrender/tool/util"),s=e("zrender/tool/event");return t.prototype={type:a.CHART_TYPE_ISLAND,_combine:function(t,n){var i=e("zrender/tool/color"),a=e("../util/accMath"),r=a.accAdd(o.get(t,"value"),o.get(n,"value")),s=o.get(t,"name")+this._nameConnector+o.get(n,"name");t.style.text=s+this._valueConnector+r,o.set(t,"value",r),o.set(t,"name",s),t.style.r=this.option.island.r,t.style.color=i.mix(t.style.color,n.style.color)},refresh:function(e){e&&(e.island=this.reformOption(e.island),this.option=e,this._nameConnector=this.option.nameConnector,this._valueConnector=this.option.valueConnector)},getOption:function(){return this.option},resize:function(){var e=this.zr.getWidth(),t=this.zr.getHeight(),n=e/(this._zrWidth||e),i=t/(this._zrHeight||t);if(1!==n||1!==i){this._zrWidth=e,this._zrHeight=t;for(var a=0,o=this.shapeList.length;o>a;a++)this.zr.modShape(this.shapeList[a].id,{style:{x:Math.round(this.shapeList[a].style.x*n),y:Math.round(this.shapeList[a].style.y*i)}})}},add:function(e){var t=o.get(e,"name"),n=o.get(e,"value"),a=null!=o.get(e,"series")?o.get(e,"series").name:"",r=this.getFont(this.option.island.textStyle),s={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:e.style.x,y:e.style.y,r:this.option.island.r,color:e.style.color||e.style.strokeColor,text:t+this._valueConnector+n,textFont:r},draggable:!0,hoverable:!0,onmousewheel:this.shapeHandler.onmousewheel,_type:"island"};"#fff"===s.style.color&&(s.style.color=e.style.strokeColor),this.setCalculable(s),s.dragEnableTime=0,o.pack(s,{name:a},-1,n,-1,t),s=new i(s),this.shapeList.push(s),this.zr.addShape(s)},del:function(e){this.zr.delShape(e.id);for(var t=[],n=0,i=this.shapeList.length;i>n;n++)this.shapeList[n].id!=e.id&&t.push(this.shapeList[n]);this.shapeList=t},ondrop:function(e,t){if(this.isDrop&&e.target){var n=e.target,i=e.dragged;this._combine(n,i),this.zr.modShape(n.id),t.dragIn=!0,this.isDrop=!1}},ondragend:function(e,t){var n=e.target;this.isDragend?t.dragIn&&(this.del(n),t.needRefresh=!0):t.dragIn||(n.style.x=s.getX(e.event),n.style.y=s.getY(e.event),this.add(n),t.needRefresh=!0),this.isDragend=!1}},r.inherits(t,n),e("../chart").define("island",t),t}),n("echarts/component/toolbox",["require","./base","zrender/shape/Line","zrender/shape/Image","zrender/shape/Rectangle","../util/shape/Icon","../config","zrender/tool/util","zrender/config","zrender/tool/event","./dataView","../component"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o),this.dom=o.dom,this._magicType={},this._magicMap={},this._isSilence=!1,this._iconList,this._iconShapeMap={},this._featureTitle={},this._featureIcon={},this._featureColor={},this._featureOption={},this._enableColor="red",this._disableColor="#ccc",this._markShapeList=[];var r=this;r._onMark=function(e){r.__onMark(e)},r._onMarkUndo=function(e){r.__onMarkUndo(e)},r._onMarkClear=function(e){r.__onMarkClear(e)},r._onDataZoom=function(e){r.__onDataZoom(e)},r._onDataZoomReset=function(e){r.__onDataZoomReset(e)},r._onDataView=function(e){r.__onDataView(e)},r._onRestore=function(e){r.__onRestore(e)},r._onSaveAsImage=function(e){r.__onSaveAsImage(e)},r._onMagicType=function(e){r.__onMagicType(e)},r._onCustomHandler=function(e){r.__onCustomHandler(e)},r._onmousemove=function(e){return r.__onmousemove(e)},r._onmousedown=function(e){return r.__onmousedown(e)},r._onmouseup=function(e){return r.__onmouseup(e)},r._onclick=function(e){return r.__onclick(e)}}var n=e("./base"),i=e("zrender/shape/Line"),a=e("zrender/shape/Image"),o=e("zrender/shape/Rectangle"),r=e("../util/shape/Icon"),s=e("../config");s.toolbox={zlevel:0,z:6,show:!1,orient:"horizontal",x:"right",y:"top",color:["#1e90ff","#22bb22","#4b0082","#d2691e"],disableColor:"#ddd",effectiveColor:"red",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,itemSize:16,showTitle:!0,feature:{mark:{show:!1,title:{mark:"辅助线开关",markUndo:"删除辅助线",markClear:"清空辅助线"},lineStyle:{width:1,color:"#1e90ff",type:"dashed"}},dataZoom:{show:!1,title:{dataZoom:"区域缩放",dataZoomReset:"区域缩放后退"}},dataView:{show:!1,title:"数据视图",readOnly:!1,lang:["数据视图","关闭","刷新"]},magicType:{show:!1,title:{line:"折线图切换",bar:"柱形图切换",stack:"堆积",tiled:"平铺",force:"力导向布局图切换",chord:"和弦图切换",pie:"饼图切换",funnel:"漏斗图切换"},type:[]},restore:{show:!1,title:"还原"},saveAsImage:{show:!1,title:"保存为图片",type:"png",lang:["点击保存"]}}};var l=e("zrender/tool/util"),h=e("zrender/config"),m=e("zrender/tool/event"),V="stack",U="tiled";return t.prototype={type:s.COMPONENT_TYPE_TOOLBOX,_buildShape:function(){this._iconList=[];var e=this.option.toolbox;this._enableColor=e.effectiveColor,this._disableColor=e.disableColor;var t=e.feature,n=[];for(var i in t)if(t[i].show)switch(i){case"mark":n.push({key:i,name:"mark"}),n.push({key:i,name:"markUndo"}),n.push({key:i,name:"markClear"});break;case"magicType":for(var a=0,o=t[i].type.length;o>a;a++)t[i].title[t[i].type[a]+"Chart"]=t[i].title[t[i].type[a]],t[i].option&&(t[i].option[t[i].type[a]+"Chart"]=t[i].option[t[i].type[a]]),n.push({key:i,name:t[i].type[a]+"Chart"});break;case"dataZoom":n.push({key:i,name:"dataZoom"}),n.push({key:i,name:"dataZoomReset"});break;case"saveAsImage":this.canvasSupported&&n.push({key:i,name:"saveAsImage"});break;default:n.push({key:i,name:i})}if(n.length>0){for(var r,i,a=0,o=n.length;o>a;a++)r=n[a].name,i=n[a].key,this._iconList.push(r),this._featureTitle[r]=t[i].title[r]||t[i].title,t[i].icon&&(this._featureIcon[r]=t[i].icon[r]||t[i].icon),t[i].color&&(this._featureColor[r]=t[i].color[r]||t[i].color),t[i].option&&(this._featureOption[r]=t[i].option[r]||t[i].option);this._itemGroupLocation=this._getItemGroupLocation(),this._buildBackground(),this._buildItem();for(var a=0,o=this.shapeList.length;o>a;a++)this.zr.addShape(this.shapeList[a]);this._iconShapeMap.mark&&(this._iconDisable(this._iconShapeMap.markUndo),this._iconDisable(this._iconShapeMap.markClear)),this._iconShapeMap.dataZoomReset&&0===this._zoomQueue.length&&this._iconDisable(this._iconShapeMap.dataZoomReset)}},_buildItem:function(){var t,n,i,o,s=this.option.toolbox,l=this._iconList.length,h=this._itemGroupLocation.x,m=this._itemGroupLocation.y,V=s.itemSize,U=s.itemGap,d=s.color instanceof Array?s.color:[s.color],p=this.getFont(s.textStyle);"horizontal"===s.orient?(n=this._itemGroupLocation.y/this.zr.getHeight()<.5?"bottom":"top",i=this._itemGroupLocation.x/this.zr.getWidth()<.5?"left":"right",o=this._itemGroupLocation.y/this.zr.getHeight()<.5?"top":"bottom"):n=this._itemGroupLocation.x/this.zr.getWidth()<.5?"right":"left",this._iconShapeMap={};for(var c=this,u=0;l>u;u++){switch(t={type:"icon",zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:h,y:m,width:V,height:V,iconType:this._iconList[u],lineWidth:1,strokeColor:this._featureColor[this._iconList[u]]||d[u%d.length],brushType:"stroke"},highlightStyle:{lineWidth:1,text:s.showTitle?this._featureTitle[this._iconList[u]]:void 0,textFont:p,textPosition:n,strokeColor:this._featureColor[this._iconList[u]]||d[u%d.length]},hoverable:!0,clickable:!0},this._featureIcon[this._iconList[u]]&&(t.style.image=this._featureIcon[this._iconList[u]].replace(new RegExp("^image:\\/\\/"),""),t.style.opacity=.8,t.highlightStyle.opacity=1,t.type="image"),"horizontal"===s.orient&&(0===u&&"left"===i&&(t.highlightStyle.textPosition="specific",t.highlightStyle.textAlign=i,t.highlightStyle.textBaseline=o,t.highlightStyle.textX=h,t.highlightStyle.textY="top"===o?m+V+10:m-10),u===l-1&&"right"===i&&(t.highlightStyle.textPosition="specific",t.highlightStyle.textAlign=i,t.highlightStyle.textBaseline=o,t.highlightStyle.textX=h+V,t.highlightStyle.textY="top"===o?m+V+10:m-10)),this._iconList[u]){case"mark":t.onclick=c._onMark;break;case"markUndo":t.onclick=c._onMarkUndo;break;case"markClear":t.onclick=c._onMarkClear;break;case"dataZoom":t.onclick=c._onDataZoom;break;case"dataZoomReset":t.onclick=c._onDataZoomReset;break;case"dataView":if(!this._dataView){var y=e("./dataView");this._dataView=new y(this.ecTheme,this.messageCenter,this.zr,this.option,this.myChart)}t.onclick=c._onDataView;break;case"restore":t.onclick=c._onRestore;break;case"saveAsImage":t.onclick=c._onSaveAsImage;break;default:this._iconList[u].match("Chart")?(t._name=this._iconList[u].replace("Chart",""),t.onclick=c._onMagicType):t.onclick=c._onCustomHandler}"icon"===t.type?t=new r(t):"image"===t.type&&(t=new a(t)),this.shapeList.push(t),this._iconShapeMap[this._iconList[u]]=t,"horizontal"===s.orient?h+=V+U:m+=V+U}},_buildBackground:function(){var e=this.option.toolbox,t=this.reformCssArray(this.option.toolbox.padding);this.shapeList.push(new o({zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this._itemGroupLocation.x-t[3],y:this._itemGroupLocation.y-t[0],width:this._itemGroupLocation.width+t[3]+t[1],height:this._itemGroupLocation.height+t[0]+t[2],brushType:0===e.borderWidth?"fill":"both",color:e.backgroundColor,strokeColor:e.borderColor,lineWidth:e.borderWidth}}))},_getItemGroupLocation:function(){var e=this.option.toolbox,t=this.reformCssArray(this.option.toolbox.padding),n=this._iconList.length,i=e.itemGap,a=e.itemSize,o=0,r=0;"horizontal"===e.orient?(o=(a+i)*n-i,r=a):(r=(a+i)*n-i,o=a);var s,l=this.zr.getWidth();switch(e.x){case"center":s=Math.floor((l-o)/2);break;case"left":s=t[3]+e.borderWidth;break;case"right":s=l-o-t[1]-e.borderWidth;break;default:s=e.x-0,s=isNaN(s)?0:s}var h,m=this.zr.getHeight();switch(e.y){case"top":h=t[0]+e.borderWidth;break;case"bottom":h=m-r-t[2]-e.borderWidth;break;case"center":h=Math.floor((m-r)/2);break;default:h=e.y-0,h=isNaN(h)?0:h}return{x:s,y:h,width:o,height:r}},__onmousemove:function(e){this._marking&&(this._markShape.style.xEnd=m.getX(e.event),this._markShape.style.yEnd=m.getY(e.event),this.zr.addHoverShape(this._markShape)),this._zooming&&(this._zoomShape.style.width=m.getX(e.event)-this._zoomShape.style.x,this._zoomShape.style.height=m.getY(e.event)-this._zoomShape.style.y,this.zr.addHoverShape(this._zoomShape),this.dom.style.cursor="crosshair",m.stop(e.event)),this._zoomStart&&"pointer"!=this.dom.style.cursor&&"move"!=this.dom.style.cursor&&(this.dom.style.cursor="crosshair")},__onmousedown:function(e){if(!e.target){this._zooming=!0;var t=m.getX(e.event),n=m.getY(e.event),i=this.option.dataZoom||{};return this._zoomShape=new o({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:t,y:n,width:1,height:1,brushType:"both"},highlightStyle:{lineWidth:2,color:i.fillerColor||s.dataZoom.fillerColor,strokeColor:i.handleColor||s.dataZoom.handleColor,brushType:"both"}}),this.zr.addHoverShape(this._zoomShape),!0}},__onmouseup:function(){if(!this._zoomShape||Math.abs(this._zoomShape.style.width)<10||Math.abs(this._zoomShape.style.height)<10)return this._zooming=!1,!0;if(this._zooming&&this.component.dataZoom){this._zooming=!1;var e=this.component.dataZoom.rectZoom(this._zoomShape.style);e&&(this._zoomQueue.push({start:e.start,end:e.end,start2:e.start2,end2:e.end2}),this._iconEnable(this._iconShapeMap.dataZoomReset),this.zr.refreshNextFrame())}return!0},__onclick:function(e){if(!e.target)if(this._marking)this._marking=!1,this._markShapeList.push(this._markShape),this._iconEnable(this._iconShapeMap.markUndo),this._iconEnable(this._iconShapeMap.markClear),this.zr.addShape(this._markShape),this.zr.refreshNextFrame();else if(this._markStart){this._marking=!0;var t=m.getX(e.event),n=m.getY(e.event);this._markShape=new i({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{xStart:t,yStart:n,xEnd:t,yEnd:n,lineWidth:this.query(this.option,"toolbox.feature.mark.lineStyle.width"),strokeColor:this.query(this.option,"toolbox.feature.mark.lineStyle.color"),lineType:this.query(this.option,"toolbox.feature.mark.lineStyle.type")}}),this.zr.addHoverShape(this._markShape)}},__onMark:function(e){var t=e.target;if(this._marking||this._markStart)this._resetMark(),this.zr.refreshNextFrame();else{this._resetZoom(),this.zr.modShape(t.id,{style:{strokeColor:this._enableColor}}),this.zr.refreshNextFrame(),this._markStart=!0;var n=this;setTimeout(function(){n.zr&&n.zr.on(h.EVENT.CLICK,n._onclick)&&n.zr.on(h.EVENT.MOUSEMOVE,n._onmousemove)},10)}return!0},__onMarkUndo:function(){if(this._marking)this._marking=!1;else{var e=this._markShapeList.length;if(e>=1){var t=this._markShapeList[e-1];this.zr.delShape(t.id),this.zr.refreshNextFrame(),this._markShapeList.pop(),1===e&&(this._iconDisable(this._iconShapeMap.markUndo),this._iconDisable(this._iconShapeMap.markClear))}}return!0},__onMarkClear:function(){this._marking&&(this._marking=!1);var e=this._markShapeList.length;if(e>0){for(;e--;)this.zr.delShape(this._markShapeList.pop().id);this._iconDisable(this._iconShapeMap.markUndo),this._iconDisable(this._iconShapeMap.markClear),this.zr.refreshNextFrame()}return!0},__onDataZoom:function(e){var t=e.target;if(this._zooming||this._zoomStart)this._resetZoom(),this.zr.refreshNextFrame(),this.dom.style.cursor="default";else{this._resetMark(),this.zr.modShape(t.id,{style:{strokeColor:this._enableColor}}),this.zr.refreshNextFrame(),this._zoomStart=!0;var n=this;setTimeout(function(){n.zr&&n.zr.on(h.EVENT.MOUSEDOWN,n._onmousedown)&&n.zr.on(h.EVENT.MOUSEUP,n._onmouseup)&&n.zr.on(h.EVENT.MOUSEMOVE,n._onmousemove)},10),this.dom.style.cursor="crosshair"}return!0},__onDataZoomReset:function(){return this._zooming&&(this._zooming=!1),this._zoomQueue.pop(),this._zoomQueue.length>0?this.component.dataZoom.absoluteZoom(this._zoomQueue[this._zoomQueue.length-1]):(this.component.dataZoom.rectZoom(),this._iconDisable(this._iconShapeMap.dataZoomReset),this.zr.refreshNextFrame()),!0},_resetMark:function(){this._marking=!1,this._markStart&&(this._markStart=!1,this._iconShapeMap.mark&&this.zr.modShape(this._iconShapeMap.mark.id,{style:{strokeColor:this._iconShapeMap.mark.highlightStyle.strokeColor}}),this.zr.un(h.EVENT.CLICK,this._onclick),this.zr.un(h.EVENT.MOUSEMOVE,this._onmousemove))},_resetZoom:function(){this._zooming=!1,this._zoomStart&&(this._zoomStart=!1,this._iconShapeMap.dataZoom&&this.zr.modShape(this._iconShapeMap.dataZoom.id,{style:{strokeColor:this._iconShapeMap.dataZoom.highlightStyle.strokeColor}}),this.zr.un(h.EVENT.MOUSEDOWN,this._onmousedown),this.zr.un(h.EVENT.MOUSEUP,this._onmouseup),this.zr.un(h.EVENT.MOUSEMOVE,this._onmousemove))},_iconDisable:function(e){"image"!=e.type?this.zr.modShape(e.id,{hoverable:!1,clickable:!1,style:{strokeColor:this._disableColor}}):this.zr.modShape(e.id,{hoverable:!1,clickable:!1,style:{opacity:.3}})},_iconEnable:function(e){"image"!=e.type?this.zr.modShape(e.id,{hoverable:!0,clickable:!0,style:{strokeColor:e.highlightStyle.strokeColor}}):this.zr.modShape(e.id,{hoverable:!0,clickable:!0,style:{opacity:.8}})},__onDataView:function(){return this._dataView.show(this.option),!0},__onRestore:function(){return this._resetMark(),this._resetZoom(),this.messageCenter.dispatch(s.EVENT.RESTORE,null,null,this.myChart),!0},__onSaveAsImage:function(){var e=this.option.toolbox.feature.saveAsImage,t=e.type||"png";"png"!=t&&"jpeg"!=t&&(t="png");var n;n=this.myChart.isConnected()?this.myChart.getConnectedDataURL(t):this.zr.toDataURL("image/"+t,this.option.backgroundColor&&"rgba(0,0,0,0)"===this.option.backgroundColor.replace(" ","")?"#fff":this.option.backgroundColor);var i=document.createElement("div");i.id="__echarts_download_wrap__",i.style.cssText="position:fixed;z-index:99999;display:block;top:0;left:0;background-color:rgba(33,33,33,0.5);text-align:center;width:100%;height:100%;line-height:"+document.documentElement.clientHeight+"px;";var a=document.createElement("a");a.href=n,a.setAttribute("download",(e.name?e.name:this.option.title&&(this.option.title.text||this.option.title.subtext)?this.option.title.text||this.option.title.subtext:"ECharts")+"."+t),a.innerHTML='图片另存为":e.lang?e.lang[0]:"点击保存")+'"/>',i.appendChild(a),document.body.appendChild(i),a=null,i=null,setTimeout(function(){var e=document.getElementById("__echarts_download_wrap__");e&&(e.onclick=function(){var e=document.getElementById("__echarts_download_wrap__");e.onclick=null,e.innerHTML="",document.body.removeChild(e),e=null},e=null)},500)},__onMagicType:function(e){this._resetMark();var t=e.target._name;return this._magicType[t]||(this._magicType[t]=!0,t===s.CHART_TYPE_LINE?this._magicType[s.CHART_TYPE_BAR]=!1:t===s.CHART_TYPE_BAR&&(this._magicType[s.CHART_TYPE_LINE]=!1),t===s.CHART_TYPE_PIE?this._magicType[s.CHART_TYPE_FUNNEL]=!1:t===s.CHART_TYPE_FUNNEL&&(this._magicType[s.CHART_TYPE_PIE]=!1),t===s.CHART_TYPE_FORCE?this._magicType[s.CHART_TYPE_CHORD]=!1:t===s.CHART_TYPE_CHORD&&(this._magicType[s.CHART_TYPE_FORCE]=!1),t===V?this._magicType[U]=!1:t===U&&(this._magicType[V]=!1),this.messageCenter.dispatch(s.EVENT.MAGIC_TYPE_CHANGED,e.event,{magicType:this._magicType},this.myChart)),!0},setMagicType:function(e){this._resetMark(),this._magicType=e,!this._isSilence&&this.messageCenter.dispatch(s.EVENT.MAGIC_TYPE_CHANGED,null,{magicType:this._magicType},this.myChart)},__onCustomHandler:function(e){var t=e.target.style.iconType,n=this.option.toolbox.feature[t].onclick;"function"==typeof n&&n.call(this,this.option)},reset:function(e,t){if(t&&this.clear(),this.query(e,"toolbox.show")&&this.query(e,"toolbox.feature.magicType.show")){var n=e.toolbox.feature.magicType.type,i=n.length;for(this._magicMap={};i--;)this._magicMap[n[i]]=!0;i=e.series.length;for(var a,o;i--;)a=e.series[i].type,this._magicMap[a]&&(o=e.xAxis instanceof Array?e.xAxis[e.series[i].xAxisIndex||0]:e.xAxis,o&&"category"===(o.type||"category")&&(o.__boundaryGap=null!=o.boundaryGap?o.boundaryGap:!0),o=e.yAxis instanceof Array?e.yAxis[e.series[i].yAxisIndex||0]:e.yAxis,o&&"category"===o.type&&(o.__boundaryGap=null!=o.boundaryGap?o.boundaryGap:!0),e.series[i].__type=a,e.series[i].__itemStyle=l.clone(e.series[i].itemStyle||{})),(this._magicMap[V]||this._magicMap[U])&&(e.series[i].__stack=e.series[i].stack)}this._magicType=t?{}:this._magicType||{};for(var r in this._magicType)if(this._magicType[r]){this.option=e,this.getMagicOption();break}var s=e.dataZoom;if(s&&s.show){var h=null!=s.start&&s.start>=0&&s.start<=100?s.start:0,m=null!=s.end&&s.end>=0&&s.end<=100?s.end:100;h>m&&(h+=m,m=h-m,h-=m),this._zoomQueue=[{start:h,end:m,start2:0,end2:100}]}else this._zoomQueue=[]},getMagicOption:function(){var e,t;if(this._magicType[s.CHART_TYPE_LINE]||this._magicType[s.CHART_TYPE_BAR]){for(var n=this._magicType[s.CHART_TYPE_LINE]?!1:!0,i=0,a=this.option.series.length;a>i;i++)t=this.option.series[i].type,(t==s.CHART_TYPE_LINE||t==s.CHART_TYPE_BAR)&&(e=this.option.xAxis instanceof Array?this.option.xAxis[this.option.series[i].xAxisIndex||0]:this.option.xAxis,e&&"category"===(e.type||"category")&&(e.boundaryGap=n?!0:e.__boundaryGap),e=this.option.yAxis instanceof Array?this.option.yAxis[this.option.series[i].yAxisIndex||0]:this.option.yAxis,e&&"category"===e.type&&(e.boundaryGap=n?!0:e.__boundaryGap));this._defaultMagic(s.CHART_TYPE_LINE,s.CHART_TYPE_BAR)}if(this._defaultMagic(s.CHART_TYPE_CHORD,s.CHART_TYPE_FORCE),this._defaultMagic(s.CHART_TYPE_PIE,s.CHART_TYPE_FUNNEL),this._magicType[V]||this._magicType[U])for(var i=0,a=this.option.series.length;a>i;i++)this._magicType[V]?(this.option.series[i].stack="_ECHARTS_STACK_KENER_2014_",t=V):this._magicType[U]&&(this.option.series[i].stack=null,t=U),this._featureOption[t+"Chart"]&&l.merge(this.option.series[i],this._featureOption[t+"Chart"]||{},!0);return this.option},_defaultMagic:function(e,t){if(this._magicType[e]||this._magicType[t])for(var n=0,i=this.option.series.length;i>n;n++){var a=this.option.series[n].type;(a==e||a==t)&&(this.option.series[n].type=this._magicType[e]?e:t,this.option.series[n].itemStyle=l.clone(this.option.series[n].__itemStyle),a=this.option.series[n].type,this._featureOption[a+"Chart"]&&l.merge(this.option.series[n],this._featureOption[a+"Chart"]||{},!0))}},silence:function(e){this._isSilence=e},resize:function(){this._resetMark(),this.clear(),this.option&&this.option.toolbox&&this.option.toolbox.show&&this._buildShape(),this._dataView&&this._dataView.resize()},hideDataView:function(){this._dataView&&this._dataView.hide()},clear:function(e){this.zr&&(this.zr.delShape(this.shapeList),this.shapeList=[],e||(this.zr.delShape(this._markShapeList),this._markShapeList=[]))},onbeforDispose:function(){this._dataView&&(this._dataView.dispose(),this._dataView=null),this._markShapeList=null},refresh:function(e){e&&(this._resetMark(),this._resetZoom(),e.toolbox=this.reformOption(e.toolbox),this.option=e,this.clear(!0),e.toolbox.show&&this._buildShape(),this.hideDataView())}},l.inherits(t,n),e("../component").define("toolbox",t),t}),n("echarts/component",[],function(){var e={},t={};return e.define=function(n,i){return t[n]=i,e},e.get=function(e){return t[e]},e}),n("echarts/component/title",["require","./base","zrender/shape/Text","zrender/shape/Rectangle","../config","zrender/tool/util","zrender/tool/area","zrender/tool/color","../component"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o),this.refresh(a)}var n=e("./base"),i=e("zrender/shape/Text"),a=e("zrender/shape/Rectangle"),o=e("../config");o.title={zlevel:0,z:6,show:!0,text:"",subtext:"",x:"left",y:"top",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:5,textStyle:{fontSize:18,fontWeight:"bolder",color:"#333"},subtextStyle:{color:"#aaa"}};var r=e("zrender/tool/util"),s=e("zrender/tool/area"),l=e("zrender/tool/color");return t.prototype={type:o.COMPONENT_TYPE_TITLE,_buildShape:function(){if(this.titleOption.show){this._itemGroupLocation=this._getItemGroupLocation(),this._buildBackground(),this._buildItem();for(var e=0,t=this.shapeList.length;t>e;e++)this.zr.addShape(this.shapeList[e])}},_buildItem:function(){var e=this.titleOption.text,t=this.titleOption.link,n=this.titleOption.target,a=this.titleOption.subtext,o=this.titleOption.sublink,r=this.titleOption.subtarget,s=this.getFont(this.titleOption.textStyle),h=this.getFont(this.titleOption.subtextStyle),m=this._itemGroupLocation.x,V=this._itemGroupLocation.y,U=this._itemGroupLocation.width,d=this._itemGroupLocation.height,p={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{y:V,color:this.titleOption.textStyle.color,text:e,textFont:s,textBaseline:"top"},highlightStyle:{color:l.lift(this.titleOption.textStyle.color,1),brushType:"fill"},hoverable:!1};t&&(p.hoverable=!0,p.clickable=!0,p.onclick=function(){n&&"self"==n?window.location=t:window.open(t)});var c={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{y:V+d,color:this.titleOption.subtextStyle.color,text:a,textFont:h,textBaseline:"bottom"},highlightStyle:{color:l.lift(this.titleOption.subtextStyle.color,1),brushType:"fill"},hoverable:!1};switch(o&&(c.hoverable=!0,c.clickable=!0,c.onclick=function(){r&&"self"==r?window.location=o:window.open(o)}),this.titleOption.x){case"center":p.style.x=c.style.x=m+U/2,p.style.textAlign=c.style.textAlign="center";break;case"left":p.style.x=c.style.x=m,p.style.textAlign=c.style.textAlign="left";break;case"right":p.style.x=c.style.x=m+U,p.style.textAlign=c.style.textAlign="right";break;default:m=this.titleOption.x-0,m=isNaN(m)?0:m,p.style.x=c.style.x=m}this.titleOption.textAlign&&(p.style.textAlign=c.style.textAlign=this.titleOption.textAlign),this.shapeList.push(new i(p)),""!==a&&this.shapeList.push(new i(c))},_buildBackground:function(){var e=this.reformCssArray(this.titleOption.padding);this.shapeList.push(new a({zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this._itemGroupLocation.x-e[3],y:this._itemGroupLocation.y-e[0],width:this._itemGroupLocation.width+e[3]+e[1],height:this._itemGroupLocation.height+e[0]+e[2],brushType:0===this.titleOption.borderWidth?"fill":"both",color:this.titleOption.backgroundColor,strokeColor:this.titleOption.borderColor,lineWidth:this.titleOption.borderWidth}}))},_getItemGroupLocation:function(){var e,t=this.reformCssArray(this.titleOption.padding),n=this.titleOption.text,i=this.titleOption.subtext,a=this.getFont(this.titleOption.textStyle),o=this.getFont(this.titleOption.subtextStyle),r=Math.max(s.getTextWidth(n,a),s.getTextWidth(i,o)),l=s.getTextHeight(n,a)+(""===i?0:this.titleOption.itemGap+s.getTextHeight(i,o)),h=this.zr.getWidth();switch(this.titleOption.x){case"center":e=Math.floor((h-r)/2);break;case"left":e=t[3]+this.titleOption.borderWidth;break;case"right":e=h-r-t[1]-this.titleOption.borderWidth;break;default:e=this.titleOption.x-0,e=isNaN(e)?0:e}var m,V=this.zr.getHeight();switch(this.titleOption.y){case"top":m=t[0]+this.titleOption.borderWidth;break;case"bottom":m=V-l-t[2]-this.titleOption.borderWidth;break;case"center":m=Math.floor((V-l)/2);break;default:m=this.titleOption.y-0,m=isNaN(m)?0:m}return{x:e,y:m,width:r,height:l}},refresh:function(e){e&&(this.option=e,this.option.title=this.reformOption(this.option.title),this.titleOption=this.option.title,this.titleOption.textStyle=this.getTextStyle(this.titleOption.textStyle),this.titleOption.subtextStyle=this.getTextStyle(this.titleOption.subtextStyle)),this.clear(),this._buildShape()}},r.inherits(t,n),e("../component").define("title",t),t}),n("echarts/component/tooltip",["require","./base","../util/shape/Cross","zrender/shape/Line","zrender/shape/Rectangle","../config","../util/ecData","zrender/config","zrender/tool/event","zrender/tool/area","zrender/tool/color","zrender/tool/util","zrender/shape/Base","../component"],function(e){function t(e,t,o,r,s){n.call(this,e,t,o,r,s),this.dom=s.dom;var l=this;l._onmousemove=function(e){return l.__onmousemove(e)},l._onglobalout=function(e){return l.__onglobalout(e)},this.zr.on(h.EVENT.MOUSEMOVE,l._onmousemove),this.zr.on(h.EVENT.GLOBALOUT,l._onglobalout),l._hide=function(e){return l.__hide(e)},l._tryShow=function(e){return l.__tryShow(e)},l._refixed=function(e){return l.__refixed(e)},l._setContent=function(e,t){return l.__setContent(e,t)},this._tDom=this._tDom||document.createElement("div"),this._tDom.onselectstart=function(){return!1},this._tDom.onmouseover=function(){l._mousein=!0},this._tDom.onmouseout=function(){l._mousein=!1},this._tDom.className="echarts-tooltip",this._tDom.style.position="absolute",this.hasAppend=!1,this._axisLineShape&&this.zr.delShape(this._axisLineShape.id),this._axisLineShape=new a({zlevel:this.getZlevelBase(),z:this.getZBase(),invisible:!0,hoverable:!1}),this.shapeList.push(this._axisLineShape),this.zr.addShape(this._axisLineShape),this._axisShadowShape&&this.zr.delShape(this._axisShadowShape.id),this._axisShadowShape=new a({zlevel:this.getZlevelBase(),z:1,invisible:!0,hoverable:!1}),this.shapeList.push(this._axisShadowShape),this.zr.addShape(this._axisShadowShape),this._axisCrossShape&&this.zr.delShape(this._axisCrossShape.id),this._axisCrossShape=new i({zlevel:this.getZlevelBase(),z:this.getZBase(),invisible:!0,hoverable:!1}),this.shapeList.push(this._axisCrossShape),this.zr.addShape(this._axisCrossShape),this.showing=!1,this.refresh(r)}var n=e("./base"),i=e("../util/shape/Cross"),a=e("zrender/shape/Line"),o=e("zrender/shape/Rectangle"),r=new o({}),s=e("../config");s.tooltip={zlevel:1,z:8,show:!0,showContent:!0,trigger:"item",islandFormatter:"{a}
{b} : {c}",showDelay:20,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"rgba(0,0,0,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,axisPointer:{type:"line",lineStyle:{color:"#48b",width:2,type:"solid"},crossStyle:{color:"#1e90ff",width:1,type:"dashed"},shadowStyle:{color:"rgba(150,150,150,0.3)",width:"auto",type:"default"}},textStyle:{color:"#fff"}};var l=e("../util/ecData"),h=e("zrender/config"),m=e("zrender/tool/event"),V=e("zrender/tool/area"),U=e("zrender/tool/color"),d=e("zrender/tool/util"),p=e("zrender/shape/Base");return t.prototype={type:s.COMPONENT_TYPE_TOOLTIP,_gCssText:"position:absolute;display:block;border-style:solid;white-space:nowrap;",_style:function(e){if(!e)return"";var t=[];if(e.transitionDuration){var n="left "+e.transitionDuration+"s,top "+e.transitionDuration+"s";t.push("transition:"+n),t.push("-moz-transition:"+n),t.push("-webkit-transition:"+n),t.push("-o-transition:"+n)}e.backgroundColor&&(t.push("background-Color:"+U.toHex(e.backgroundColor)),t.push("filter:alpha(opacity=70)"),t.push("background-Color:"+e.backgroundColor)),null!=e.borderWidth&&t.push("border-width:"+e.borderWidth+"px"),null!=e.borderColor&&t.push("border-color:"+e.borderColor),null!=e.borderRadius&&(t.push("border-radius:"+e.borderRadius+"px"),t.push("-moz-border-radius:"+e.borderRadius+"px"),t.push("-webkit-border-radius:"+e.borderRadius+"px"),t.push("-o-border-radius:"+e.borderRadius+"px"));var i=e.textStyle;i&&(i.color&&t.push("color:"+i.color),i.decoration&&t.push("text-decoration:"+i.decoration),i.align&&t.push("text-align:"+i.align),i.fontFamily&&t.push("font-family:"+i.fontFamily),i.fontSize&&t.push("font-size:"+i.fontSize+"px"),i.fontSize&&t.push("line-height:"+Math.round(3*i.fontSize/2)+"px"),i.fontStyle&&t.push("font-style:"+i.fontStyle),i.fontWeight&&t.push("font-weight:"+i.fontWeight));var a=e.padding;return null!=a&&(a=this.reformCssArray(a),t.push("padding:"+a[0]+"px "+a[1]+"px "+a[2]+"px "+a[3]+"px")),t=t.join(";")+";"},__hide:function(){this._lastDataIndex=-1,this._lastSeriesIndex=-1,this._lastItemTriggerId=-1,this._tDom&&(this._tDom.style.display="none");var e=!1;this._axisLineShape.invisible||(this._axisLineShape.invisible=!0,this.zr.modShape(this._axisLineShape.id),e=!0),this._axisShadowShape.invisible||(this._axisShadowShape.invisible=!0,this.zr.modShape(this._axisShadowShape.id),e=!0),this._axisCrossShape.invisible||(this._axisCrossShape.invisible=!0,this.zr.modShape(this._axisCrossShape.id),e=!0),this._lastTipShape&&this._lastTipShape.tipShape.length>0&&(this.zr.delShape(this._lastTipShape.tipShape),this._lastTipShape=!1,this.shapeList.length=2),e&&this.zr.refreshNextFrame(),this.showing=!1},_show:function(e,t,n,i){var a=this._tDom.offsetHeight,o=this._tDom.offsetWidth;e&&("function"==typeof e&&(e=e([t,n])),e instanceof Array&&(t=e[0],n=e[1])),t+o>this._zrWidth&&(t-=o+40),n+a>this._zrHeight&&(n-=a-20),20>n&&(n=0),this._tDom.style.cssText=this._gCssText+this._defaultCssText+(i?i:"")+"left:"+t+"px;top:"+n+"px;",(10>a||10>o)&&setTimeout(this._refixed,20),this.showing=!0 +},__refixed:function(){if(this._tDom){var e="",t=this._tDom.offsetHeight,n=this._tDom.offsetWidth;this._tDom.offsetLeft+n>this._zrWidth&&(e+="left:"+(this._zrWidth-n-20)+"px;"),this._tDom.offsetTop+t>this._zrHeight&&(e+="top:"+(this._zrHeight-t-10)+"px;"),""!==e&&(this._tDom.style.cssText+=e)}},__tryShow:function(){var e,t;if(this._curTarget){if("island"===this._curTarget._type&&this.option.tooltip.show)return void this._showItemTrigger();var n=l.get(this._curTarget,"series"),i=l.get(this._curTarget,"data");e=this.deepQuery([i,n,this.option],"tooltip.show"),null!=n&&null!=i&&e?(t=this.deepQuery([i,n,this.option],"tooltip.trigger"),"axis"===t?this._showAxisTrigger(n.xAxisIndex,n.yAxisIndex,l.get(this._curTarget,"dataIndex")):this._showItemTrigger()):(clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this._hidingTicket=setTimeout(this._hide,this._hideDelay))}else this._findPolarTrigger()||this._findAxisTrigger()},_findAxisTrigger:function(){if(!this.component.xAxis||!this.component.yAxis)return void(this._hidingTicket=setTimeout(this._hide,this._hideDelay));for(var e,t,n=this.option.series,i=0,a=n.length;a>i;i++)if("axis"===this.deepQuery([n[i],this.option],"tooltip.trigger"))return e=n[i].xAxisIndex||0,t=n[i].yAxisIndex||0,this.component.xAxis.getAxis(e)&&this.component.xAxis.getAxis(e).type===s.COMPONENT_TYPE_AXIS_CATEGORY?void this._showAxisTrigger(e,t,this._getNearestDataIndex("x",this.component.xAxis.getAxis(e))):this.component.yAxis.getAxis(t)&&this.component.yAxis.getAxis(t).type===s.COMPONENT_TYPE_AXIS_CATEGORY?void this._showAxisTrigger(e,t,this._getNearestDataIndex("y",this.component.yAxis.getAxis(t))):void this._showAxisTrigger(e,t,-1);"cross"===this.option.tooltip.axisPointer.type&&this._showAxisTrigger(-1,-1,-1)},_findPolarTrigger:function(){if(!this.component.polar)return!1;var e,t=m.getX(this._event),n=m.getY(this._event),i=this.component.polar.getNearestIndex([t,n]);return i?(e=i.valueIndex,i=i.polarIndex):i=-1,-1!=i?this._showPolarTrigger(i,e):!1},_getNearestDataIndex:function(e,t){var n=-1,i=m.getX(this._event),a=m.getY(this._event);if("x"===e){for(var o,r,s=this.component.grid.getXend(),l=t.getCoordByIndex(n);s>l&&(r=l,i>=l);)o=l,l=t.getCoordByIndex(++n);return 0>=n?n=0:r-i>=i-o?n-=1:null==t.getNameByIndex(n)&&(n-=1),n}for(var h,V,U=this.component.grid.getY(),l=t.getCoordByIndex(n);l>U&&(h=l,l>=a);)V=l,l=t.getCoordByIndex(++n);return 0>=n?n=0:a-h>=V-a?n-=1:null==t.getNameByIndex(n)&&(n-=1),n},_showAxisTrigger:function(e,t,n){if(!this._event.connectTrigger&&this.messageCenter.dispatch(s.EVENT.TOOLTIP_IN_GRID,this._event,null,this.myChart),null==this.component.xAxis||null==this.component.yAxis||null==e||null==t)return clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),void(this._hidingTicket=setTimeout(this._hide,this._hideDelay));var i,a,o,r,l=this.option.series,h=[],V=[],U="";if("axis"===this.option.tooltip.trigger){if(!this.option.tooltip.show)return;a=this.option.tooltip.formatter,o=this.option.tooltip.position}var d,p,c=-1!=e&&this.component.xAxis.getAxis(e).type===s.COMPONENT_TYPE_AXIS_CATEGORY?"xAxis":-1!=t&&this.component.yAxis.getAxis(t).type===s.COMPONENT_TYPE_AXIS_CATEGORY?"yAxis":!1;if(c){var u="xAxis"==c?e:t;i=this.component[c].getAxis(u);for(var y=0,g=l.length;g>y;y++)this._isSelected(l[y].name)&&l[y][c+"Index"]===u&&"axis"===this.deepQuery([l[y],this.option],"tooltip.trigger")&&(r=this.query(l[y],"tooltip.showContent")||r,a=this.query(l[y],"tooltip.formatter")||a,o=this.query(l[y],"tooltip.position")||o,U+=this._style(this.query(l[y],"tooltip")),null!=l[y].stack&&"xAxis"==c?(h.unshift(l[y]),V.unshift(y)):(h.push(l[y]),V.push(y)));this.messageCenter.dispatch(s.EVENT.TOOLTIP_HOVER,this._event,{seriesIndex:V,dataIndex:n},this.myChart);var b;"xAxis"==c?(d=this.subPixelOptimize(i.getCoordByIndex(n),this._axisLineWidth),p=m.getY(this._event),b=[d,this.component.grid.getY(),d,this.component.grid.getYend()]):(d=m.getX(this._event),p=this.subPixelOptimize(i.getCoordByIndex(n),this._axisLineWidth),b=[this.component.grid.getX(),p,this.component.grid.getXend(),p]),this._styleAxisPointer(h,b[0],b[1],b[2],b[3],i.getGap(),d,p)}else d=m.getX(this._event),p=m.getY(this._event),this._styleAxisPointer(l,this.component.grid.getX(),p,this.component.grid.getXend(),p,0,d,p),n>=0?this._showItemTrigger(!0):(clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this._tDom.style.display="none");if(h.length>0){if(this._lastItemTriggerId=-1,this._lastDataIndex!=n||this._lastSeriesIndex!=V[0]){this._lastDataIndex=n,this._lastSeriesIndex=V[0];var f,k;if("function"==typeof a){for(var x=[],y=0,g=h.length;g>y;y++)f=h[y].data[n],k=this.getDataFromOption(f,"-"),x.push({seriesIndex:V[y],seriesName:h[y].name||"",series:h[y],dataIndex:n,data:f,name:i.getNameByIndex(n),value:k,0:h[y].name||"",1:i.getNameByIndex(n),2:k,3:f});this._curTicket="axis:"+n,this._tDom.innerHTML=a.call(this.myChart,x,this._curTicket,this._setContent)}else if("string"==typeof a){this._curTicket=0/0,a=a.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}");for(var y=0,g=h.length;g>y;y++)a=a.replace("{a"+y+"}",this._encodeHTML(h[y].name||"")),a=a.replace("{b"+y+"}",this._encodeHTML(i.getNameByIndex(n))),f=h[y].data[n],f=this.getDataFromOption(f,"-"),a=a.replace("{c"+y+"}",f instanceof Array?f:this.numAddCommas(f));this._tDom.innerHTML=a}else{this._curTicket=0/0,a=this._encodeHTML(i.getNameByIndex(n));for(var y=0,g=h.length;g>y;y++)a+="
"+this._encodeHTML(h[y].name||"")+" : ",f=h[y].data[n],f=this.getDataFromOption(f,"-"),a+=f instanceof Array?f:this.numAddCommas(f);this._tDom.innerHTML=a}}if(r===!1||!this.option.tooltip.showContent)return;this.hasAppend||(this._tDom.style.left=this._zrWidth/2+"px",this._tDom.style.top=this._zrHeight/2+"px",this.dom.firstChild.appendChild(this._tDom),this.hasAppend=!0),this._show(o,d+10,p+10,U)}},_showPolarTrigger:function(e,t){if(null==this.component.polar||null==e||null==t||0>t)return!1;var n,i,a,o=this.option.series,r=[],s=[],l="";if("axis"===this.option.tooltip.trigger){if(!this.option.tooltip.show)return!1;n=this.option.tooltip.formatter,i=this.option.tooltip.position}for(var h=this.option.polar[e].indicator[t].text,V=0,U=o.length;U>V;V++)this._isSelected(o[V].name)&&o[V].polarIndex===e&&"axis"===this.deepQuery([o[V],this.option],"tooltip.trigger")&&(a=this.query(o[V],"tooltip.showContent")||a,n=this.query(o[V],"tooltip.formatter")||n,i=this.query(o[V],"tooltip.position")||i,l+=this._style(this.query(o[V],"tooltip")),r.push(o[V]),s.push(V));if(r.length>0){for(var d,p,c,u=[],V=0,U=r.length;U>V;V++){d=r[V].data;for(var y=0,g=d.length;g>y;y++)p=d[y],this._isSelected(p.name)&&(p=null!=p?p:{name:"",value:{dataIndex:"-"}},c=this.getDataFromOption(p.value[t]),u.push({seriesIndex:s[V],seriesName:r[V].name||"",series:r[V],dataIndex:t,data:p,name:p.name,indicator:h,value:c,0:r[V].name||"",1:p.name,2:c,3:h}))}if(u.length<=0)return;if(this._lastItemTriggerId=-1,this._lastDataIndex!=t||this._lastSeriesIndex!=s[0])if(this._lastDataIndex=t,this._lastSeriesIndex=s[0],"function"==typeof n)this._curTicket="axis:"+t,this._tDom.innerHTML=n.call(this.myChart,u,this._curTicket,this._setContent);else if("string"==typeof n){n=n.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}").replace("{d}","{d0}");for(var V=0,U=u.length;U>V;V++)n=n.replace("{a"+V+"}",this._encodeHTML(u[V].seriesName)),n=n.replace("{b"+V+"}",this._encodeHTML(u[V].name)),n=n.replace("{c"+V+"}",this.numAddCommas(u[V].value)),n=n.replace("{d"+V+"}",this._encodeHTML(u[V].indicator));this._tDom.innerHTML=n}else{n=this._encodeHTML(u[0].name)+"
"+this._encodeHTML(u[0].indicator)+" : "+this.numAddCommas(u[0].value);for(var V=1,U=u.length;U>V;V++)n+="
"+this._encodeHTML(u[V].name)+"
",n+=this._encodeHTML(u[V].indicator)+" : "+this.numAddCommas(u[V].value);this._tDom.innerHTML=n}if(a===!1||!this.option.tooltip.showContent)return;return this.hasAppend||(this._tDom.style.left=this._zrWidth/2+"px",this._tDom.style.top=this._zrHeight/2+"px",this.dom.firstChild.appendChild(this._tDom),this.hasAppend=!0),this._show(i,m.getX(this._event),m.getY(this._event),l),!0}},_showItemTrigger:function(e){if(this._curTarget){var t,n,i,a=l.get(this._curTarget,"series"),o=l.get(this._curTarget,"seriesIndex"),r=l.get(this._curTarget,"data"),h=l.get(this._curTarget,"dataIndex"),V=l.get(this._curTarget,"name"),U=l.get(this._curTarget,"value"),d=l.get(this._curTarget,"special"),p=l.get(this._curTarget,"special2"),c=[r,a,this.option],u="";if("island"!=this._curTarget._type){var y=e?"axis":"item";this.option.tooltip.trigger===y&&(t=this.option.tooltip.formatter,n=this.option.tooltip.position),this.query(a,"tooltip.trigger")===y&&(i=this.query(a,"tooltip.showContent")||i,t=this.query(a,"tooltip.formatter")||t,n=this.query(a,"tooltip.position")||n,u+=this._style(this.query(a,"tooltip"))),i=this.query(r,"tooltip.showContent")||i,t=this.query(r,"tooltip.formatter")||t,n=this.query(r,"tooltip.position")||n,u+=this._style(this.query(r,"tooltip"))}else this._lastItemTriggerId=0/0,i=this.deepQuery(c,"tooltip.showContent"),t=this.deepQuery(c,"tooltip.islandFormatter"),n=this.deepQuery(c,"tooltip.islandPosition");this._lastDataIndex=-1,this._lastSeriesIndex=-1,this._lastItemTriggerId!==this._curTarget.id&&(this._lastItemTriggerId=this._curTarget.id,"function"==typeof t?(this._curTicket=(a.name||"")+":"+h,this._tDom.innerHTML=t.call(this.myChart,{seriesIndex:o,seriesName:a.name||"",series:a,dataIndex:h,data:r,name:V,value:U,percent:d,indicator:d,value2:p,indicator2:p,0:a.name||"",1:V,2:U,3:d,4:p,5:r,6:o,7:h},this._curTicket,this._setContent)):"string"==typeof t?(this._curTicket=0/0,t=t.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}"),t=t.replace("{a0}",this._encodeHTML(a.name||"")).replace("{b0}",this._encodeHTML(V)).replace("{c0}",U instanceof Array?U:this.numAddCommas(U)),t=t.replace("{d}","{d0}").replace("{d0}",d||""),t=t.replace("{e}","{e0}").replace("{e0}",l.get(this._curTarget,"special2")||""),this._tDom.innerHTML=t):(this._curTicket=0/0,this._tDom.innerHTML=a.type===s.CHART_TYPE_RADAR&&d?this._itemFormatter.radar.call(this,a,V,U,d):a.type===s.CHART_TYPE_EVENTRIVER?this._itemFormatter.eventRiver.call(this,a,V,U,r):""+(null!=a.name?this._encodeHTML(a.name)+"
":"")+(""===V?"":this._encodeHTML(V)+" : ")+(U instanceof Array?U:this.numAddCommas(U))));var g=m.getX(this._event),b=m.getY(this._event);this.deepQuery(c,"tooltip.axisPointer.show")&&this.component.grid&&this._styleAxisPointer([a],this.component.grid.getX(),b,this.component.grid.getXend(),b,0,g,b),i!==!1&&this.option.tooltip.showContent&&(this.hasAppend||(this._tDom.style.left=this._zrWidth/2+"px",this._tDom.style.top=this._zrHeight/2+"px",this.dom.firstChild.appendChild(this._tDom),this.hasAppend=!0),this._show(n,g+20,b-20,u))}},_itemFormatter:{radar:function(e,t,n,i){var a="";a+=this._encodeHTML(""===t?e.name||"":t),a+=""===a?"":"
";for(var o=0;o";return a},chord:function(e,t,n,i,a){if(null==a)return this._encodeHTML(t)+" ("+this.numAddCommas(n)+")";var o=this._encodeHTML(t),r=this._encodeHTML(i);return""+(null!=e.name?this._encodeHTML(e.name)+"
":"")+o+" -> "+r+" ("+this.numAddCommas(n)+")
"+r+" -> "+o+" ("+this.numAddCommas(a)+")"},eventRiver:function(e,t,n,i){var a="";a+=this._encodeHTML(""===e.name?"":e.name+" : "),a+=this._encodeHTML(t),a+=""===a?"":"
",i=i.evolution;for(var o=0,r=i.length;r>o;o++)a+='
',i[o].detail&&(i[o].detail.img&&(a+=''),a+='
'+i[o].time+"
",a+='',a+=i[o].detail.text+"
",a+="
");return a}},_styleAxisPointer:function(e,t,n,i,a,o,r,s){if(e.length>0){var l,h,m=this.option.tooltip.axisPointer,V=m.type,U={line:{},cross:{},shadow:{}};for(var d in U)U[d].color=m[d+"Style"].color,U[d].width=m[d+"Style"].width,U[d].type=m[d+"Style"].type;for(var p=0,c=e.length;c>p;p++)l=e[p],h=this.query(l,"tooltip.axisPointer.type"),V=h||V,h&&(U[h].color=this.query(l,"tooltip.axisPointer."+h+"Style.color")||U[h].color,U[h].width=this.query(l,"tooltip.axisPointer."+h+"Style.width")||U[h].width,U[h].type=this.query(l,"tooltip.axisPointer."+h+"Style.type")||U[h].type);if("line"===V){var u=U.line.width,y=t==i;this._axisLineShape.style={xStart:y?this.subPixelOptimize(t,u):t,yStart:y?n:this.subPixelOptimize(n,u),xEnd:y?this.subPixelOptimize(i,u):i,yEnd:y?a:this.subPixelOptimize(a,u),strokeColor:U.line.color,lineWidth:u,lineType:U.line.type},this._axisLineShape.invisible=!1,this.zr.modShape(this._axisLineShape.id)}else if("cross"===V){var g=U.cross.width;this._axisCrossShape.style={brushType:"stroke",rect:this.component.grid.getArea(),x:this.subPixelOptimize(r,g),y:this.subPixelOptimize(s,g),text:("( "+this.component.xAxis.getAxis(0).getValueFromCoord(r)+" , "+this.component.yAxis.getAxis(0).getValueFromCoord(s)+" )").replace(" , "," ").replace(" , "," "),textPosition:"specific",strokeColor:U.cross.color,lineWidth:g,lineType:U.cross.type},this.component.grid.getXend()-r>100?(this._axisCrossShape.style.textAlign="left",this._axisCrossShape.style.textX=r+10):(this._axisCrossShape.style.textAlign="right",this._axisCrossShape.style.textX=r-10),s-this.component.grid.getY()>50?(this._axisCrossShape.style.textBaseline="bottom",this._axisCrossShape.style.textY=s-10):(this._axisCrossShape.style.textBaseline="top",this._axisCrossShape.style.textY=s+10),this._axisCrossShape.invisible=!1,this.zr.modShape(this._axisCrossShape.id)}else"shadow"===V&&((null==U.shadow.width||"auto"===U.shadow.width||isNaN(U.shadow.width))&&(U.shadow.width=o),t===i?Math.abs(this.component.grid.getX()-t)<2?(U.shadow.width/=2,t=i+=U.shadow.width/2):Math.abs(this.component.grid.getXend()-t)<2&&(U.shadow.width/=2,t=i-=U.shadow.width/2):n===a&&(Math.abs(this.component.grid.getY()-n)<2?(U.shadow.width/=2,n=a+=U.shadow.width/2):Math.abs(this.component.grid.getYend()-n)<2&&(U.shadow.width/=2,n=a-=U.shadow.width/2)),this._axisShadowShape.style={xStart:t,yStart:n,xEnd:i,yEnd:a,strokeColor:U.shadow.color,lineWidth:U.shadow.width},this._axisShadowShape.invisible=!1,this.zr.modShape(this._axisShadowShape.id));this.zr.refreshNextFrame()}},__onmousemove:function(e){if(clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),!this._mousein||!this._enterable){var t=e.target,n=m.getX(e.event),i=m.getY(e.event);if(t){this._curTarget=t,this._event=e.event,this._event.zrenderX=n,this._event.zrenderY=i;var a;if(this._needAxisTrigger&&this.component.polar&&-1!=(a=this.component.polar.isInside([n,i])))for(var o=this.option.series,l=0,h=o.length;h>l;l++)if(o[l].polarIndex===a&&"axis"===this.deepQuery([o[l],this.option],"tooltip.trigger")){this._curTarget=null;break}this._showingTicket=setTimeout(this._tryShow,this._showDelay)}else this._curTarget=!1,this._event=e.event,this._event.zrenderX=n,this._event.zrenderY=i,this._needAxisTrigger&&this.component.grid&&V.isInside(r,this.component.grid.getArea(),n,i)?this._showingTicket=setTimeout(this._tryShow,this._showDelay):this._needAxisTrigger&&this.component.polar&&-1!=this.component.polar.isInside([n,i])?this._showingTicket=setTimeout(this._tryShow,this._showDelay):(!this._event.connectTrigger&&this.messageCenter.dispatch(s.EVENT.TOOLTIP_OUT_GRID,this._event,null,this.myChart),this._hidingTicket=setTimeout(this._hide,this._hideDelay))}},__onglobalout:function(){clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this._hidingTicket=setTimeout(this._hide,this._hideDelay)},__setContent:function(e,t){this._tDom&&(e===this._curTicket&&(this._tDom.innerHTML=t),setTimeout(this._refixed,20))},ontooltipHover:function(e,t){if(!this._lastTipShape||this._lastTipShape&&this._lastTipShape.dataIndex!=e.dataIndex){this._lastTipShape&&this._lastTipShape.tipShape.length>0&&(this.zr.delShape(this._lastTipShape.tipShape),this.shapeList.length=2);for(var n=0,i=t.length;i>n;n++)t[n].zlevel=this.getZlevelBase(),t[n].z=this.getZBase(),t[n].style=p.prototype.getHighlightStyle(t[n].style,t[n].highlightStyle),t[n].draggable=!1,t[n].hoverable=!1,t[n].clickable=!1,t[n].ondragend=null,t[n].ondragover=null,t[n].ondrop=null,this.shapeList.push(t[n]),this.zr.addShape(t[n]);this._lastTipShape={dataIndex:e.dataIndex,tipShape:t}}},ondragend:function(){this._hide()},onlegendSelected:function(e){this._selectedMap=e.selected},_setSelectedMap:function(){this._selectedMap=this.component.legend?d.clone(this.component.legend.getSelectedMap()):{}},_isSelected:function(e){return null!=this._selectedMap[e]?this._selectedMap[e]:!0},showTip:function(e){if(e){var t,n=this.option.series;if(null!=e.seriesIndex)t=e.seriesIndex;else for(var i=e.seriesName,a=0,o=n.length;o>a;a++)if(n[a].name===i){t=a;break}var r=n[t];if(null!=r){var m=this.myChart.chart[r.type],V="axis"===this.deepQuery([r,this.option],"tooltip.trigger");if(m)if(V){var U=e.dataIndex;switch(m.type){case s.CHART_TYPE_LINE:case s.CHART_TYPE_BAR:case s.CHART_TYPE_K:if(null==this.component.xAxis||null==this.component.yAxis||r.data.length<=U)return;var d=r.xAxisIndex||0,p=r.yAxisIndex||0;this._event=this.component.xAxis.getAxis(d).type===s.COMPONENT_TYPE_AXIS_CATEGORY?{zrenderX:this.component.xAxis.getAxis(d).getCoordByIndex(U),zrenderY:this.component.grid.getY()+(this.component.grid.getYend()-this.component.grid.getY())/4}:{zrenderX:this.component.grid.getX()+(this.component.grid.getXend()-this.component.grid.getX())/4,zrenderY:this.component.yAxis.getAxis(p).getCoordByIndex(U)},this._showAxisTrigger(d,p,U);break;case s.CHART_TYPE_RADAR:if(null==this.component.polar||r.data[0].value.length<=U)return;var c=r.polarIndex||0,u=this.component.polar.getVector(c,U,"max");this._event={zrenderX:u[0],zrenderY:u[1]},this._showPolarTrigger(c,U)}}else{var y,g,b=m.shapeList;switch(m.type){case s.CHART_TYPE_LINE:case s.CHART_TYPE_BAR:case s.CHART_TYPE_K:case s.CHART_TYPE_SCATTER:for(var U=e.dataIndex,a=0,o=b.length;o>a;a++)if(null==b[a]._mark&&l.get(b[a],"seriesIndex")==t&&l.get(b[a],"dataIndex")==U){this._curTarget=b[a],y=b[a].style.x,g=m.type!=s.CHART_TYPE_K?b[a].style.y:b[a].style.y[0];break}break;case s.CHART_TYPE_RADAR:for(var U=e.dataIndex,a=0,o=b.length;o>a;a++)if("polygon"===b[a].type&&l.get(b[a],"seriesIndex")==t&&l.get(b[a],"dataIndex")==U){this._curTarget=b[a];var u=this.component.polar.getCenter(r.polarIndex||0);y=u[0],g=u[1];break}break;case s.CHART_TYPE_PIE:for(var f=e.name,a=0,o=b.length;o>a;a++)if("sector"===b[a].type&&l.get(b[a],"seriesIndex")==t&&l.get(b[a],"name")==f){this._curTarget=b[a];var k=this._curTarget.style,x=(k.startAngle+k.endAngle)/2*Math.PI/180;y=this._curTarget.style.x+Math.cos(x)*k.r/1.5,g=this._curTarget.style.y-Math.sin(x)*k.r/1.5;break}break;case s.CHART_TYPE_MAP:for(var f=e.name,_=r.mapType,a=0,o=b.length;o>a;a++)if("text"===b[a].type&&b[a]._mapType===_&&b[a].style._name===f){this._curTarget=b[a],y=this._curTarget.style.x+this._curTarget.position[0],g=this._curTarget.style.y+this._curTarget.position[1];break}break;case s.CHART_TYPE_CHORD:for(var f=e.name,a=0,o=b.length;o>a;a++)if("sector"===b[a].type&&l.get(b[a],"name")==f){this._curTarget=b[a];var k=this._curTarget.style,x=(k.startAngle+k.endAngle)/2*Math.PI/180;return y=this._curTarget.style.x+Math.cos(x)*(k.r-2),g=this._curTarget.style.y-Math.sin(x)*(k.r-2),void this.zr.trigger(h.EVENT.MOUSEMOVE,{zrenderX:y,zrenderY:g})}break;case s.CHART_TYPE_FORCE:for(var f=e.name,a=0,o=b.length;o>a;a++)if("circle"===b[a].type&&l.get(b[a],"name")==f){this._curTarget=b[a],y=this._curTarget.position[0],g=this._curTarget.position[1];break}}null!=y&&null!=g&&(this._event={zrenderX:y,zrenderY:g},this.zr.addHoverShape(this._curTarget),this.zr.refreshHover(),this._showItemTrigger())}}}},hideTip:function(){this._hide()},refresh:function(e){if(this._zrHeight=this.zr.getHeight(),this._zrWidth=this.zr.getWidth(),this._lastTipShape&&this._lastTipShape.tipShape.length>0&&this.zr.delShape(this._lastTipShape.tipShape),this._lastTipShape=!1,this.shapeList.length=2,this._lastDataIndex=-1,this._lastSeriesIndex=-1,this._lastItemTriggerId=-1,e){this.option=e,this.option.tooltip=this.reformOption(this.option.tooltip),this.option.tooltip.textStyle=d.merge(this.option.tooltip.textStyle,this.ecTheme.textStyle),this._needAxisTrigger=!1,"axis"===this.option.tooltip.trigger&&(this._needAxisTrigger=!0);for(var t=this.option.series,n=0,i=t.length;i>n;n++)if("axis"===this.query(t[n],"tooltip.trigger")){this._needAxisTrigger=!0;break}this._showDelay=this.option.tooltip.showDelay,this._hideDelay=this.option.tooltip.hideDelay,this._defaultCssText=this._style(this.option.tooltip),this._setSelectedMap(),this._axisLineWidth=this.option.tooltip.axisPointer.lineStyle.width,this._enterable=this.option.tooltip.enterable}if(this.showing){var a=this;setTimeout(function(){a.zr.trigger(h.EVENT.MOUSEMOVE,a.zr.handler._event)},50)}},onbeforDispose:function(){this._lastTipShape&&this._lastTipShape.tipShape.length>0&&this.zr.delShape(this._lastTipShape.tipShape),clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this.zr.un(h.EVENT.MOUSEMOVE,this._onmousemove),this.zr.un(h.EVENT.GLOBALOUT,this._onglobalout),this.hasAppend&&this.dom.firstChild&&this.dom.firstChild.removeChild(this._tDom),this._tDom=null},_encodeHTML:function(e){return String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}},d.inherits(t,n),e("../component").define("tooltip",t),t}),n("echarts/component/legend",["require","./base","zrender/shape/Text","zrender/shape/Rectangle","zrender/shape/Sector","../util/shape/Icon","../util/shape/Candle","../config","zrender/tool/util","zrender/tool/area","../component"],function(e){function t(e,t,i,a,o){if(!this.query(a,"legend.data"))return void console.error("option.legend.data has not been defined.");n.call(this,e,t,i,a,o);var r=this;r._legendSelected=function(e){r.__legendSelected(e)},r._dispatchHoverLink=function(e){return r.__dispatchHoverLink(e)},this._colorIndex=0,this._colorMap={},this._selectedMap={},this._hasDataMap={},this.refresh(a)}var n=e("./base"),i=e("zrender/shape/Text"),a=e("zrender/shape/Rectangle"),o=e("zrender/shape/Sector"),r=e("../util/shape/Icon"),s=e("../util/shape/Candle"),l=e("../config");l.legend={zlevel:0,z:4,show:!0,orient:"horizontal",x:"center",y:"top",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,itemWidth:20,itemHeight:14,textStyle:{color:"#333"},selectedMode:!0};var h=e("zrender/tool/util"),m=e("zrender/tool/area");t.prototype={type:l.COMPONENT_TYPE_LEGEND,_buildShape:function(){if(this.legendOption.show){this._itemGroupLocation=this._getItemGroupLocation(),this._buildBackground(),this._buildItem();for(var e=0,t=this.shapeList.length;t>e;e++)this.zr.addShape(this.shapeList[e])}},_buildItem:function(){var e,t,n,a,o,s,l,V,U=this.legendOption.data,d=U.length,p=this.legendOption.textStyle,c=this.zr.getWidth(),u=this.zr.getHeight(),y=this._itemGroupLocation.x,g=this._itemGroupLocation.y,b=this.legendOption.itemWidth,f=this.legendOption.itemHeight,k=this.legendOption.itemGap;"vertical"===this.legendOption.orient&&"right"===this.legendOption.x&&(y=this._itemGroupLocation.x+this._itemGroupLocation.width-b);for(var x=0;d>x;x++)o=h.merge(U[x].textStyle||{},p),s=this.getFont(o),e=this._getName(U[x]),l=this._getFormatterName(e),""!==e?(t=U[x].icon||this._getSomethingByName(e).type,V=this.getColor(e),"horizontal"===this.legendOption.orient?200>c-y&&b+5+m.getTextWidth(l,s)+(x===d-1||""===U[x+1]?0:k)>=c-y&&(y=this._itemGroupLocation.x,g+=f+k):200>u-g&&f+(x===d-1||""===U[x+1]?0:k)>=u-g&&("right"===this.legendOption.x?y-=this._itemGroupLocation.maxWidth+k:y+=this._itemGroupLocation.maxWidth+k,g=this._itemGroupLocation.y),n=this._getItemShapeByType(y,g,b,f,this._selectedMap[e]&&this._hasDataMap[e]?V:"#ccc",t,V),n._name=e,n=new r(n),a={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:y+b+5,y:g+f/2,color:this._selectedMap[e]?"auto"===o.color?V:o.color:"#ccc",text:l,textFont:s,textBaseline:"middle"},highlightStyle:{color:V,brushType:"fill"},hoverable:!!this.legendOption.selectedMode,clickable:!!this.legendOption.selectedMode},"vertical"===this.legendOption.orient&&"right"===this.legendOption.x&&(a.style.x-=b+10,a.style.textAlign="right"),a._name=e,a=new i(a),this.legendOption.selectedMode&&(n.onclick=a.onclick=this._legendSelected,n.onmouseover=a.onmouseover=this._dispatchHoverLink,n.hoverConnect=a.id,a.hoverConnect=n.id),this.shapeList.push(n),this.shapeList.push(a),"horizontal"===this.legendOption.orient?y+=b+5+m.getTextWidth(l,s)+k:g+=f+k):"horizontal"===this.legendOption.orient?(y=this._itemGroupLocation.x,g+=f+k):("right"===this.legendOption.x?y-=this._itemGroupLocation.maxWidth+k:y+=this._itemGroupLocation.maxWidth+k,g=this._itemGroupLocation.y);"horizontal"===this.legendOption.orient&&"center"===this.legendOption.x&&g!=this._itemGroupLocation.y&&this._mLineOptimize()},_getName:function(e){return"undefined"!=typeof e.name?e.name:e},_getFormatterName:function(e){var t,n=this.legendOption.formatter;return t="function"==typeof n?n.call(this.myChart,e):"string"==typeof n?n.replace("{name}",e):e},_getFormatterNameFromData:function(e){var t=this._getName(e);return this._getFormatterName(t)},_mLineOptimize:function(){for(var e=[],t=this._itemGroupLocation.x,n=2,i=this.shapeList.length;i>n;n++)this.shapeList[n].style.x===t?e.push((this._itemGroupLocation.width-(this.shapeList[n-1].style.x+m.getTextWidth(this.shapeList[n-1].style.text,this.shapeList[n-1].style.textFont)-t))/2):n===i-1&&e.push((this._itemGroupLocation.width-(this.shapeList[n].style.x+m.getTextWidth(this.shapeList[n].style.text,this.shapeList[n].style.textFont)-t))/2);for(var a=-1,n=1,i=this.shapeList.length;i>n;n++)this.shapeList[n].style.x===t&&a++,0!==e[a]&&(this.shapeList[n].style.x+=e[a])},_buildBackground:function(){var e=this.reformCssArray(this.legendOption.padding);this.shapeList.push(new a({zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this._itemGroupLocation.x-e[3],y:this._itemGroupLocation.y-e[0],width:this._itemGroupLocation.width+e[3]+e[1],height:this._itemGroupLocation.height+e[0]+e[2],brushType:0===this.legendOption.borderWidth?"fill":"both",color:this.legendOption.backgroundColor,strokeColor:this.legendOption.borderColor,lineWidth:this.legendOption.borderWidth}}))},_getItemGroupLocation:function(){var e=this.legendOption.data,t=e.length,n=this.legendOption.itemGap,i=this.legendOption.itemWidth+5,a=this.legendOption.itemHeight,o=this.legendOption.textStyle,r=this.getFont(o),s=0,l=0,V=this.reformCssArray(this.legendOption.padding),U=this.zr.getWidth()-V[1]-V[3],d=this.zr.getHeight()-V[0]-V[2],p=0,c=0;if("horizontal"===this.legendOption.orient){l=a;for(var u=0;t>u;u++)if(""!==this._getName(e[u])){var y=m.getTextWidth(this._getFormatterNameFromData(e[u]),e[u].textStyle?this.getFont(h.merge(e[u].textStyle||{},o)):r);p+i+y+n>U?(p-=n,s=Math.max(s,p),l+=a+n,p=0):(p+=i+y+n,s=Math.max(s,p-n))}else p-=n,s=Math.max(s,p),l+=a+n,p=0}else{for(var u=0;t>u;u++)c=Math.max(c,m.getTextWidth(this._getFormatterNameFromData(e[u]),e[u].textStyle?this.getFont(h.merge(e[u].textStyle||{},o)):r));c+=i,s=c;for(var u=0;t>u;u++)""!==this._getName(e[u])?p+a+n>d?(s+=c+n,p-=n,l=Math.max(l,p),p=0):(p+=a+n,l=Math.max(l,p-n)):(s+=c+n,p-=n,l=Math.max(l,p),p=0)}U=this.zr.getWidth(),d=this.zr.getHeight();var g;switch(this.legendOption.x){case"center":g=Math.floor((U-s)/2);break;case"left":g=V[3]+this.legendOption.borderWidth;break;case"right":g=U-s-V[1]-V[3]-2*this.legendOption.borderWidth;break;default:g=this.parsePercent(this.legendOption.x,U)}var b;switch(this.legendOption.y){case"top":b=V[0]+this.legendOption.borderWidth;break;case"bottom":b=d-l-V[0]-V[2]-2*this.legendOption.borderWidth;break;case"center":b=Math.floor((d-l)/2);break;default:b=this.parsePercent(this.legendOption.y,d)}return{x:g,y:b,width:s,height:l,maxWidth:c}},_getSomethingByName:function(e){for(var t,n=this.option.series,i=0,a=n.length;a>i;i++){if(n[i].name===e)return{type:n[i].type,series:n[i],seriesIndex:i,data:null,dataIndex:-1};if(n[i].type===l.CHART_TYPE_PIE||n[i].type===l.CHART_TYPE_RADAR||n[i].type===l.CHART_TYPE_CHORD||n[i].type===l.CHART_TYPE_FORCE||n[i].type===l.CHART_TYPE_FUNNEL){t=n[i].categories||n[i].data||n[i].nodes;for(var o=0,r=t.length;r>o;o++)if(t[o].name===e)return{type:n[i].type,series:n[i],seriesIndex:i,data:t[o],dataIndex:o}}}return{type:"bar",series:null,seriesIndex:-1,data:null,dataIndex:-1}},_getItemShapeByType:function(e,t,n,i,a,o,r){var s,h="#ccc"===a?r:a,m={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{iconType:"legendicon"+o,x:e,y:t,width:n,height:i,color:a,strokeColor:a,lineWidth:2},highlightStyle:{color:h,strokeColor:h,lineWidth:1},hoverable:this.legendOption.selectedMode,clickable:this.legendOption.selectedMode};if(o.match("image")){var s=o.replace(new RegExp("^image:\\/\\/"),"");o="image"}switch(o){case"line":m.style.brushType="stroke",m.highlightStyle.lineWidth=3;break;case"radar":case"scatter":m.highlightStyle.lineWidth=3;break;case"k":m.style.brushType="both",m.highlightStyle.lineWidth=3,m.highlightStyle.color=m.style.color=this.deepQuery([this.ecTheme,l],"k.itemStyle.normal.color")||"#fff",m.style.strokeColor="#ccc"!=a?this.deepQuery([this.ecTheme,l],"k.itemStyle.normal.lineStyle.color")||"#ff3200":a;break;case"image":m.style.iconType="image",m.style.image=s,"#ccc"===a&&(m.style.opacity=.5)}return m},__legendSelected:function(e){var t=e.target._name;if("single"===this.legendOption.selectedMode)for(var n in this._selectedMap)this._selectedMap[n]=!1;this._selectedMap[t]=!this._selectedMap[t],this.messageCenter.dispatch(l.EVENT.LEGEND_SELECTED,e.event,{selected:this._selectedMap,target:t},this.myChart)},__dispatchHoverLink:function(e){this.messageCenter.dispatch(l.EVENT.LEGEND_HOVERLINK,e.event,{target:e.target._name},this.myChart)},refresh:function(e){if(e){this.option=e||this.option,this.option.legend=this.reformOption(this.option.legend),this.legendOption=this.option.legend;var t,n,i,a,o=this.legendOption.data||[];if(this.legendOption.selected)for(var r in this.legendOption.selected)this._selectedMap[r]="undefined"!=typeof this._selectedMap[r]?this._selectedMap[r]:this.legendOption.selected[r];for(var s=0,h=o.length;h>s;s++)t=this._getName(o[s]),""!==t&&(n=this._getSomethingByName(t),n.series?(this._hasDataMap[t]=!0,a=!n.data||n.type!==l.CHART_TYPE_PIE&&n.type!==l.CHART_TYPE_FORCE&&n.type!==l.CHART_TYPE_FUNNEL?[n.series]:[n.data,n.series],i=this.getItemStyleColor(this.deepQuery(a,"itemStyle.normal.color"),n.seriesIndex,n.dataIndex,n.data),i&&n.type!=l.CHART_TYPE_K&&this.setColor(t,i),this._selectedMap[t]=null!=this._selectedMap[t]?this._selectedMap[t]:!0):this._hasDataMap[t]=!1)}this.clear(),this._buildShape()},getRelatedAmount:function(e){for(var t,n=0,i=this.option.series,a=0,o=i.length;o>a;a++)if(i[a].name===e&&n++,i[a].type===l.CHART_TYPE_PIE||i[a].type===l.CHART_TYPE_RADAR||i[a].type===l.CHART_TYPE_CHORD||i[a].type===l.CHART_TYPE_FORCE||i[a].type===l.CHART_TYPE_FUNNEL){t=i[a].type!=l.CHART_TYPE_FORCE?i[a].data:i[a].categories;for(var r=0,s=t.length;s>r;r++)t[r].name===e&&"-"!=t[r].value&&n++}return n},setColor:function(e,t){this._colorMap[e]=t},getColor:function(e){return this._colorMap[e]||(this._colorMap[e]=this.zr.getColor(this._colorIndex++)),this._colorMap[e]},hasColor:function(e){return this._colorMap[e]?this._colorMap[e]:!1},add:function(e,t){for(var n=this.legendOption.data,i=0,a=n.length;a>i;i++)if(this._getName(n[i])===e)return;this.legendOption.data.push(e),this.setColor(e,t),this._selectedMap[e]=!0,this._hasDataMap[e]=!0},del:function(e){for(var t=this.legendOption.data,n=0,i=t.length;i>n;n++)if(this._getName(t[n])===e)return this.legendOption.data.splice(n,1)},getItemShape:function(e){if(null!=e)for(var t,n=0,i=this.shapeList.length;i>n;n++)if(t=this.shapeList[n],t._name===e&&"text"!=t.type)return t},setItemShape:function(e,t){for(var n,i=0,a=this.shapeList.length;a>i;i++)n=this.shapeList[i],n._name===e&&"text"!=n.type&&(this._selectedMap[e]||(t.style.color="#ccc",t.style.strokeColor="#ccc"),this.zr.modShape(n.id,t)) +},isSelected:function(e){return"undefined"!=typeof this._selectedMap[e]?this._selectedMap[e]:!0},getSelectedMap:function(){return this._selectedMap},setSelected:function(e,t){if("single"===this.legendOption.selectedMode)for(var n in this._selectedMap)this._selectedMap[n]=!1;this._selectedMap[e]=t,this.messageCenter.dispatch(l.EVENT.LEGEND_SELECTED,null,{selected:this._selectedMap,target:e},this.myChart)},onlegendSelected:function(e,t){var n=e.selected;for(var i in n)this._selectedMap[i]!=n[i]&&(t.needRefresh=!0),this._selectedMap[i]=n[i]}};var V={line:function(e,t){var n=t.height/2;e.moveTo(t.x,t.y+n),e.lineTo(t.x+t.width,t.y+n)},pie:function(e,t){var n=t.x,i=t.y,a=t.width,r=t.height;o.prototype.buildPath(e,{x:n+a/2,y:i+r+2,r:r,r0:6,startAngle:45,endAngle:135})},eventRiver:function(e,t){var n=t.x,i=t.y,a=t.width,o=t.height;e.moveTo(n,i+o),e.bezierCurveTo(n+a,i+o,n,i+4,n+a,i+4),e.lineTo(n+a,i),e.bezierCurveTo(n,i,n+a,i+o-4,n,i+o-4),e.lineTo(n,i+o)},k:function(e,t){var n=t.x,i=t.y,a=t.width,o=t.height;s.prototype.buildPath(e,{x:n+a/2,y:[i+1,i+1,i+o-6,i+o],width:a-6})},bar:function(e,t){var n=t.x,i=t.y+1,a=t.width,o=t.height-2,r=3;e.moveTo(n+r,i),e.lineTo(n+a-r,i),e.quadraticCurveTo(n+a,i,n+a,i+r),e.lineTo(n+a,i+o-r),e.quadraticCurveTo(n+a,i+o,n+a-r,i+o),e.lineTo(n+r,i+o),e.quadraticCurveTo(n,i+o,n,i+o-r),e.lineTo(n,i+r),e.quadraticCurveTo(n,i,n+r,i)},force:function(e,t){r.prototype.iconLibrary.circle(e,t)},radar:function(e,t){var n=6,i=t.x+t.width/2,a=t.y+t.height/2,o=t.height/2,r=2*Math.PI/n,s=-Math.PI/2,l=i+o*Math.cos(s),h=a+o*Math.sin(s);e.moveTo(l,h),s+=r;for(var m=0,V=n-1;V>m;m++)e.lineTo(i+o*Math.cos(s),a+o*Math.sin(s)),s+=r;e.lineTo(l,h)}};V.chord=V.pie,V.map=V.bar;for(var U in V)r.prototype.iconLibrary["legendicon"+U]=V[U];return h.inherits(t,n),e("../component").define("legend",t),t}),n("echarts/util/ecData",[],function(){function e(e,t,n,i,a,o,r,s){var l;return"undefined"!=typeof i&&(l=null==i.value?i:i.value),e._echartsData={_series:t,_seriesIndex:n,_data:i,_dataIndex:a,_name:o,_value:l,_special:r,_special2:s},e._echartsData}function t(e,t){var n=e._echartsData;if(!t)return n;switch(t){case"series":case"seriesIndex":case"data":case"dataIndex":case"name":case"value":case"special":case"special2":return n&&n["_"+t]}return null}function n(e,t,n){switch(e._echartsData=e._echartsData||{},t){case"series":case"seriesIndex":case"data":case"dataIndex":case"name":case"value":case"special":case"special2":e._echartsData["_"+t]=n}}function i(e,t){t._echartsData={_series:e._echartsData._series,_seriesIndex:e._echartsData._seriesIndex,_data:e._echartsData._data,_dataIndex:e._echartsData._dataIndex,_name:e._echartsData._name,_value:e._echartsData._value,_special:e._echartsData._special,_special2:e._echartsData._special2}}return{pack:e,set:n,get:t,clone:i}}),n("echarts/chart",[],function(){var e={},t={};return e.define=function(n,i){return t[n]=i,e},e.get=function(e){return t[e]},e}),n("zrender/tool/color",["require","../tool/util"],function(e){function t(e){P=e}function n(){P=N}function i(e,t){return e=0|e,t=t||P,t[e%t.length]}function a(e){B=e}function o(){H=B}function r(){return B}function s(e,t,n,i,a,o,r){O||(O=D.getContext());for(var s=O.createRadialGradient(e,t,n,i,a,o),l=0,h=r.length;h>l;l++)s.addColorStop(r[l][0],r[l][1]);return s.__nonRecursion=!0,s}function l(e,t,n,i,a){O||(O=D.getContext());for(var o=O.createLinearGradient(e,t,n,i),r=0,s=a.length;s>r;r++)o.addColorStop(a[r][0],a[r][1]);return o.__nonRecursion=!0,o}function h(e,t,n){e=p(e),t=p(t),e=v(e),t=v(t);for(var i=[],a=(t[0]-e[0])/n,o=(t[1]-e[1])/n,r=(t[2]-e[2])/n,s=(t[3]-e[3])/n,l=0,h=e[0],m=e[1],U=e[2],d=e[3];n>l;l++)i[l]=V([S(Math.floor(h),[0,255]),S(Math.floor(m),[0,255]),S(Math.floor(U),[0,255]),d.toFixed(4)-0],"rgba"),h+=a,m+=o,U+=r,d+=s;return h=t[0],m=t[1],U=t[2],d=t[3],i[l]=V([h,m,U,d],"rgba"),i}function m(e,t){var n=[],i=e.length;if(void 0===t&&(t=20),1===i)n=h(e[0],e[0],t);else if(i>1)for(var a=0,o=i-1;o>a;a++){var r=h(e[a],e[a+1],t);o-1>a&&r.pop(),n=n.concat(r)}return n}function V(e,t){if(t=t||"rgb",e&&(3===e.length||4===e.length)){if(e=C(e,function(e){return e>1?Math.ceil(e):e}),t.indexOf("hex")>-1)return"#"+((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1);if(t.indexOf("hs")>-1){var n=C(e.slice(1,3),function(e){return e+"%"});e[1]=n[0],e[2]=n[1]}return t.indexOf("a")>-1?(3===e.length&&e.push(1),e[3]=S(e[3],[0,1]),t+"("+e.slice(0,4).join(",")+")"):t+"("+e.slice(0,3).join(",")+")"}}function U(e){e=L(e),e.indexOf("rgba")<0&&(e=p(e));var t=[],n=0;return e.replace(/[\d.]+/g,function(e){e=3>n?0|e:+e,t[n++]=e}),t}function d(e,t){if(!E(e))return e;var n=v(e),i=n[3];return"undefined"==typeof i&&(i=1),e.indexOf("hsb")>-1?n=F(n):e.indexOf("hsl")>-1&&(n=T(n)),t.indexOf("hsb")>-1||t.indexOf("hsv")>-1?n=M(n):t.indexOf("hsl")>-1&&(n=z(n)),n[3]=i,V(n,t)}function p(e){return d(e,"rgba")}function c(e){return d(e,"rgb")}function u(e){return d(e,"hex")}function y(e){return d(e,"hsva")}function g(e){return d(e,"hsv")}function b(e){return d(e,"hsba")}function f(e){return d(e,"hsb")}function k(e){return d(e,"hsla")}function x(e){return d(e,"hsl")}function _(e){for(var t in G)if(u(G[t])===u(e))return t;return null}function L(e){return String(e).replace(/\s+/g,"")}function W(e){if(G[e]&&(e=G[e]),e=L(e),e=e.replace(/hsv/i,"hsb"),/^#[\da-f]{3}$/i.test(e)){e=parseInt(e.slice(1),16);var t=(3840&e)<<8,n=(240&e)<<4,i=15&e;e="#"+((1<<24)+(t<<4)+t+(n<<4)+n+(i<<4)+i).toString(16).slice(1)}return e}function X(e,t){if(!E(e))return e;var n=t>0?1:-1;"undefined"==typeof t&&(t=0),t=Math.abs(t)>1?1:Math.abs(t),e=c(e);for(var i=v(e),a=0;3>a;a++)i[a]=1===n?i[a]*(1-t)|0:(255-i[a])*t+i[a]|0;return"rgb("+i.join(",")+")"}function K(e){if(!E(e))return e;var t=v(p(e));return t=C(t,function(e){return 255-e}),V(t,"rgb")}function w(e,t,n){if(!E(e)||!E(t))return e;"undefined"==typeof n&&(n=.5),n=1-S(n,[0,1]);for(var i=2*n-1,a=v(p(e)),o=v(p(t)),r=a[3]-o[3],s=((i*r===-1?i:(i+r)/(1+i*r))+1)/2,l=1-s,h=[],m=0;3>m;m++)h[m]=a[m]*s+o[m]*l;var U=a[3]*n+o[3]*(1-n);return U=Math.max(0,Math.min(1,U)),1===a[3]&&1===o[3]?V(h,"rgb"):(h[3]=U,V(h,"rgba"))}function I(){return"#"+(Math.random().toString(16)+"0000").slice(2,8)}function v(e){e=W(e);var t=e.match(R);if(null===t)throw new Error("The color format error");var n,i,a,o=[];if(t[2])n=t[2].replace("#","").split(""),a=[n[0]+n[1],n[2]+n[3],n[4]+n[5]],o=C(a,function(e){return S(parseInt(e,16),[0,255])});else if(t[4]){var r=t[4].split(",");i=r[3],a=r.slice(0,3),o=C(a,function(e){return e=Math.floor(e.indexOf("%")>0?2.55*parseInt(e,0):e),S(e,[0,255])}),"undefined"!=typeof i&&o.push(S(parseFloat(i),[0,1]))}else if(t[5]||t[6]){var s=(t[5]||t[6]).split(","),l=parseInt(s[0],0)/360,h=s[1],m=s[2];i=s[3],o=C([h,m],function(e){return S(parseFloat(e)/100,[0,1])}),o.unshift(l),"undefined"!=typeof i&&o.push(S(parseFloat(i),[0,1]))}return o}function J(e,t){if(!E(e))return e;null===t&&(t=1);var n=v(p(e));return n[3]=S(Number(t).toFixed(4),[0,1]),V(n,"rgba")}function C(e,t){if("function"!=typeof t)throw new TypeError;for(var n=e?e.length:0,i=0;n>i;i++)e[i]=t(e[i]);return e}function S(e,t){return e<=t[0]?e=t[0]:e>=t[1]&&(e=t[1]),e}function E(e){return e instanceof Array||"string"==typeof e}function F(e){var t,n,i,a=e[0],o=e[1],r=e[2];if(0===o)t=255*r,n=255*r,i=255*r;else{var s=6*a;6===s&&(s=0);var l=0|s,h=r*(1-o),m=r*(1-o*(s-l)),V=r*(1-o*(1-(s-l))),U=0,d=0,p=0;0===l?(U=r,d=V,p=h):1===l?(U=m,d=r,p=h):2===l?(U=h,d=r,p=V):3===l?(U=h,d=m,p=r):4===l?(U=V,d=h,p=r):(U=r,d=h,p=m),t=255*U,n=255*d,i=255*p}return[t,n,i]}function T(e){var t,n,i,a=e[0],o=e[1],r=e[2];if(0===o)t=255*r,n=255*r,i=255*r;else{var s;s=.5>r?r*(1+o):r+o-o*r;var l=2*r-s;t=255*A(l,s,a+1/3),n=255*A(l,s,a),i=255*A(l,s,a-1/3)}return[t,n,i]}function A(e,t,n){return 0>n&&(n+=1),n>1&&(n-=1),1>6*n?e+6*(t-e)*n:1>2*n?t:2>3*n?e+(t-e)*(2/3-n)*6:e}function M(e){var t,n,i=e[0]/255,a=e[1]/255,o=e[2]/255,r=Math.min(i,a,o),s=Math.max(i,a,o),l=s-r,h=s;if(0===l)t=0,n=0;else{n=l/s;var m=((s-i)/6+l/2)/l,V=((s-a)/6+l/2)/l,U=((s-o)/6+l/2)/l;i===s?t=U-V:a===s?t=1/3+m-U:o===s&&(t=2/3+V-m),0>t&&(t+=1),t>1&&(t-=1)}return t=360*t,n=100*n,h=100*h,[t,n,h]}function z(e){var t,n,i=e[0]/255,a=e[1]/255,o=e[2]/255,r=Math.min(i,a,o),s=Math.max(i,a,o),l=s-r,h=(s+r)/2;if(0===l)t=0,n=0;else{n=.5>h?l/(s+r):l/(2-s-r);var m=((s-i)/6+l/2)/l,V=((s-a)/6+l/2)/l,U=((s-o)/6+l/2)/l;i===s?t=U-V:a===s?t=1/3+m-U:o===s&&(t=2/3+V-m),0>t&&(t+=1),t>1&&(t-=1)}return t=360*t,n=100*n,h=100*h,[t,n,h]}var O,D=e("../tool/util"),P=["#ff9277"," #dddd00"," #ffc877"," #bbe3ff"," #d5ffbb","#bbbbff"," #ddb000"," #b0dd00"," #e2bbff"," #ffbbe3","#ff7777"," #ff9900"," #83dd00"," #77e3ff"," #778fff","#c877ff"," #ff77ab"," #ff6600"," #aa8800"," #77c7ff","#ad77ff"," #ff77ff"," #dd0083"," #777700"," #00aa00","#0088aa"," #8400dd"," #aa0088"," #dd0000"," #772e00"],N=P,B="rgba(255,255,0,0.5)",H=B,R=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,G={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#789",lightslategrey:"#789",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#f0f",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"};return{customPalette:t,resetPalette:n,getColor:i,getHighlightColor:r,customHighlight:a,resetHighlight:o,getRadialGradient:s,getLinearGradient:l,getGradientColors:m,getStepColors:h,reverse:K,mix:w,lift:X,trim:L,random:I,toRGB:c,toRGBA:p,toHex:u,toHSL:x,toHSLA:k,toHSB:f,toHSBA:b,toHSV:g,toHSVA:y,toName:_,toColor:V,toArray:U,alpha:J,getData:v}}),n("echarts/component/timeline",["require","./base","zrender/shape/Rectangle","../util/shape/Icon","../util/shape/Chain","../config","zrender/tool/util","zrender/tool/area","zrender/tool/event","../component"],function(e){function t(e,t,n,a,o){i.call(this,e,t,n,a,o);var r=this;if(r._onclick=function(e){return r.__onclick(e)},r._ondrift=function(e,t){return r.__ondrift(this,e,t)},r._ondragend=function(){return r.__ondragend()},r._setCurrentOption=function(){var e=r.timelineOption;r.currentIndex%=e.data.length;var t=r.options[r.currentIndex]||{};r.myChart.setOption(t,e.notMerge),r.messageCenter.dispatch(s.EVENT.TIMELINE_CHANGED,null,{currentIndex:r.currentIndex,data:null!=e.data[r.currentIndex].name?e.data[r.currentIndex].name:e.data[r.currentIndex]},r.myChart)},r._onFrame=function(){r._setCurrentOption(),r._syncHandleShape(),r.timelineOption.autoPlay&&(r.playTicket=setTimeout(function(){return r.currentIndex+=1,!r.timelineOption.loop&&r.currentIndex>=r.timelineOption.data.length?(r.currentIndex=r.timelineOption.data.length-1,void r.stop()):void r._onFrame()},r.timelineOption.playInterval))},this.setTheme(!1),this.options=this.option.options,this.currentIndex=this.timelineOption.currentIndex%this.timelineOption.data.length,this.timelineOption.notMerge||0===this.currentIndex||(this.options[this.currentIndex]=l.merge(this.options[this.currentIndex],this.options[0])),this.timelineOption.show&&(this._buildShape(),this._syncHandleShape()),this._setCurrentOption(),this.timelineOption.autoPlay){var r=this;this.playTicket=setTimeout(function(){r.play()},null!=this.ecTheme.animationDuration?this.ecTheme.animationDuration:s.animationDuration)}}function n(e,t){var n=2,i=t.x+n,a=t.y+n+2,r=t.width-n,s=t.height-n,l=t.symbol;if("last"===l)e.moveTo(i+r-2,a+s/3),e.lineTo(i+r-2,a),e.lineTo(i+2,a+s/2),e.lineTo(i+r-2,a+s),e.lineTo(i+r-2,a+s/3*2),e.moveTo(i,a),e.lineTo(i,a);else if("next"===l)e.moveTo(i+2,a+s/3),e.lineTo(i+2,a),e.lineTo(i+r-2,a+s/2),e.lineTo(i+2,a+s),e.lineTo(i+2,a+s/3*2),e.moveTo(i,a),e.lineTo(i,a);else if("play"===l)if("stop"===t.status)e.moveTo(i+2,a),e.lineTo(i+r-2,a+s/2),e.lineTo(i+2,a+s),e.lineTo(i+2,a);else{var h="both"===t.brushType?2:3;e.rect(i+2,a,h,s),e.rect(i+r-h-2,a,h,s)}else if(l.match("image")){var m="";m=l.replace(new RegExp("^image:\\/\\/"),""),l=o.prototype.iconLibrary.image,l(e,{x:i,y:a,width:r,height:s,image:m})}}var i=e("./base"),a=e("zrender/shape/Rectangle"),o=e("../util/shape/Icon"),r=e("../util/shape/Chain"),s=e("../config");s.timeline={zlevel:0,z:4,show:!0,type:"time",notMerge:!1,realtime:!0,x:80,x2:80,y2:0,height:50,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,controlPosition:"left",autoPlay:!1,loop:!0,playInterval:2e3,lineStyle:{width:1,color:"#666",type:"dashed"},label:{show:!0,interval:"auto",rotate:0,textStyle:{color:"#333"}},checkpointStyle:{symbol:"auto",symbolSize:"auto",color:"auto",borderColor:"auto",borderWidth:"auto",label:{show:!1,textStyle:{color:"auto"}}},controlStyle:{itemSize:15,itemGap:5,normal:{color:"#333"},emphasis:{color:"#1e90ff"}},symbol:"emptyDiamond",symbolSize:4,currentIndex:0};var l=e("zrender/tool/util"),h=e("zrender/tool/area"),m=e("zrender/tool/event");return t.prototype={type:s.COMPONENT_TYPE_TIMELINE,_buildShape:function(){if(this._location=this._getLocation(),this._buildBackground(),this._buildControl(),this._chainPoint=this._getChainPoint(),this.timelineOption.label.show)for(var e=this._getInterval(),t=0,n=this._chainPoint.length;n>t;t+=e)this._chainPoint[t].showLabel=!0;this._buildChain(),this._buildHandle();for(var t=0,i=this.shapeList.length;i>t;t++)this.zr.addShape(this.shapeList[t])},_getLocation:function(){var e,t=this.timelineOption,n=this.reformCssArray(this.timelineOption.padding),i=this.zr.getWidth(),a=this.parsePercent(t.x,i),o=this.parsePercent(t.x2,i);null==t.width?(e=i-a-o,o=i-o):(e=this.parsePercent(t.width,i),o=a+e);var r,s,l=this.zr.getHeight(),h=this.parsePercent(t.height,l);return null!=t.y?(r=this.parsePercent(t.y,l),s=r+h):(s=l-this.parsePercent(t.y2,l),r=s-h),{x:a+n[3],y:r+n[0],x2:o-n[1],y2:s-n[2],width:e-n[1]-n[3],height:h-n[0]-n[2]}},_getReformedLabel:function(e){var t=this.timelineOption,n=null!=t.data[e].name?t.data[e].name:t.data[e],i=t.data[e].formatter||t.label.formatter;return i&&("function"==typeof i?n=i.call(this.myChart,n):"string"==typeof i&&(n=i.replace("{value}",n))),n},_getInterval:function(){var e=this._chainPoint,t=this.timelineOption,n=t.label.interval;if("auto"===n){var i=t.label.textStyle.fontSize,a=t.data,o=t.data.length;if(o>3){var r,s,l=!1;for(n=0;!l&&o>n;){n++,l=!0;for(var m=n;o>m;m+=n){if(r=e[m].x-e[m-n].x,0!==t.label.rotate)s=i;else if(a[m].textStyle)s=h.getTextWidth(e[m].name,e[m].textFont);else{var V=e[m].name+"",U=(V.match(/\w/g)||"").length,d=V.length-U;s=U*i*2/3+d*i}if(s>r){l=!1;break}}}}else n=1}else n=n-0+1;return n},_getChainPoint:function(){function e(e){return null!=h[e].name?h[e].name:h[e]+""}var t,n=this.timelineOption,i=n.symbol.toLowerCase(),a=n.symbolSize,o=n.label.rotate,r=n.label.textStyle,s=this.getFont(r),h=n.data,m=this._location.x,V=this._location.y+this._location.height/4*3,U=this._location.x2-this._location.x,d=h.length,p=[];if(d>1){var c=U/d;if(c=c>50?50:20>c?5:c,U-=2*c,"number"===n.type)for(var u=0;d>u;u++)p.push(m+c+U/(d-1)*u);else{p[0]=new Date(e(0).replace(/-/g,"/")),p[d-1]=new Date(e(d-1).replace(/-/g,"/"))-p[0];for(var u=1;d>u;u++)p[u]=m+c+U*(new Date(e(u).replace(/-/g,"/"))-p[0])/p[d-1];p[0]=m+c}}else p.push(m+U/2);for(var y,g,b,f,k,x=[],u=0;d>u;u++)m=p[u],y=h[u].symbol&&h[u].symbol.toLowerCase()||i,y.match("empty")?(y=y.replace("empty",""),b=!0):b=!1,y.match("star")&&(g=y.replace("star","")-0||5,y="star"),t=h[u].textStyle?l.merge(h[u].textStyle||{},r):r,f=t.align||"center",o?(f=o>0?"right":"left",k=[o*Math.PI/180,m,V-5]):k=!1,x.push({x:m,n:g,isEmpty:b,symbol:y,symbolSize:h[u].symbolSize||a,color:h[u].color,borderColor:h[u].borderColor,borderWidth:h[u].borderWidth,name:this._getReformedLabel(u),textColor:t.color,textAlign:f,textBaseline:t.baseline||"middle",textX:m,textY:V-(o?5:0),textFont:h[u].textStyle?this.getFont(t):s,rotation:k,showLabel:!1});return x},_buildBackground:function(){var e=this.timelineOption,t=this.reformCssArray(this.timelineOption.padding),n=this._location.width,i=this._location.height;(0!==e.borderWidth||"rgba(0,0,0,0)"!=e.backgroundColor.replace(/\s/g,""))&&this.shapeList.push(new a({zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this._location.x-t[3],y:this._location.y-t[0],width:n+t[1]+t[3],height:i+t[0]+t[2],brushType:0===e.borderWidth?"fill":"both",color:e.backgroundColor,strokeColor:e.borderColor,lineWidth:e.borderWidth}}))},_buildControl:function(){var e=this,t=this.timelineOption,n=t.lineStyle,i=t.controlStyle;if("none"!==t.controlPosition){var a,r=i.itemSize,s=i.itemGap;"left"===t.controlPosition?(a=this._location.x,this._location.x+=3*(r+s)):(a=this._location.x2-(3*(r+s)-s),this._location.x2-=3*(r+s));var h=this._location.y,m={zlevel:this.getZlevelBase(),z:this.getZBase()+1,style:{iconType:"timelineControl",symbol:"last",x:a,y:h,width:r,height:r,brushType:"stroke",color:i.normal.color,strokeColor:i.normal.color,lineWidth:n.width},highlightStyle:{color:i.emphasis.color,strokeColor:i.emphasis.color,lineWidth:n.width+1},clickable:!0};this._ctrLastShape=new o(m),this._ctrLastShape.onclick=function(){e.last()},this.shapeList.push(this._ctrLastShape),a+=r+s,this._ctrPlayShape=new o(l.clone(m)),this._ctrPlayShape.style.brushType="fill",this._ctrPlayShape.style.symbol="play",this._ctrPlayShape.style.status=this.timelineOption.autoPlay?"playing":"stop",this._ctrPlayShape.style.x=a,this._ctrPlayShape.onclick=function(){"stop"===e._ctrPlayShape.style.status?e.play():e.stop()},this.shapeList.push(this._ctrPlayShape),a+=r+s,this._ctrNextShape=new o(l.clone(m)),this._ctrNextShape.style.symbol="next",this._ctrNextShape.style.x=a,this._ctrNextShape.onclick=function(){e.next()},this.shapeList.push(this._ctrNextShape)}},_buildChain:function(){var e=this.timelineOption,t=e.lineStyle;this._timelineShae={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:this._location.x,y:this.subPixelOptimize(this._location.y,t.width),width:this._location.x2-this._location.x,height:this._location.height,chainPoint:this._chainPoint,brushType:"both",strokeColor:t.color,lineWidth:t.width,lineType:t.type},hoverable:!1,clickable:!0,onclick:this._onclick},this._timelineShae=new r(this._timelineShae),this.shapeList.push(this._timelineShae)},_buildHandle:function(){var e=this._chainPoint[this.currentIndex],t=e.symbolSize+1;t=5>t?5:t,this._handleShape={zlevel:this.getZlevelBase(),z:this.getZBase()+1,hoverable:!1,draggable:!0,style:{iconType:"diamond",n:e.n,x:e.x-t,y:this._location.y+this._location.height/4-t,width:2*t,height:2*t,brushType:"both",textPosition:"specific",textX:e.x,textY:this._location.y-this._location.height/4,textAlign:"center",textBaseline:"middle"},highlightStyle:{},ondrift:this._ondrift,ondragend:this._ondragend},this._handleShape=new o(this._handleShape),this.shapeList.push(this._handleShape)},_syncHandleShape:function(){if(this.timelineOption.show){var e=this.timelineOption,t=e.checkpointStyle,n=this._chainPoint[this.currentIndex];this._handleShape.style.text=t.label.show?n.name:"",this._handleShape.style.textFont=n.textFont,this._handleShape.style.n=n.n,"auto"===t.symbol?this._handleShape.style.iconType="none"!=n.symbol?n.symbol:"diamond":(this._handleShape.style.iconType=t.symbol,t.symbol.match("star")&&(this._handleShape.style.n=t.symbol.replace("star","")-0||5,this._handleShape.style.iconType="star"));var i;"auto"===t.symbolSize?(i=n.symbolSize+2,i=5>i?5:i):i=t.symbolSize-0,this._handleShape.style.color="auto"===t.color?n.color?n.color:e.controlStyle.emphasis.color:t.color,this._handleShape.style.textColor="auto"===t.label.textStyle.color?this._handleShape.style.color:t.label.textStyle.color,this._handleShape.highlightStyle.strokeColor=this._handleShape.style.strokeColor="auto"===t.borderColor?n.borderColor?n.borderColor:"#fff":t.borderColor,this._handleShape.style.lineWidth="auto"===t.borderWidth?n.borderWidth?n.borderWidth:0:t.borderWidth-0,this._handleShape.highlightStyle.lineWidth=this._handleShape.style.lineWidth+1,this.zr.animate(this._handleShape.id,"style").when(500,{x:n.x-i,textX:n.x,y:this._location.y+this._location.height/4-i,width:2*i,height:2*i}).start("ExponentialOut")}},_findChainIndex:function(e){var t=this._chainPoint,n=t.length;if(e<=t[0].x)return 0;if(e>=t[n-1].x)return n-1;for(var i=0;n-1>i;i++)if(e>=t[i].x&&e<=t[i+1].x)return Math.abs(e-t[i].x)=i[a-1].x-i[a-1].symbolSize?(e.style.x=i[a-1].x-i[a-1].symbolSize,n=a-1):(e.style.x+=t,n=this._findChainIndex(e.style.x));var o=i[n],r=o.symbolSize+2;if(e.style.iconType=o.symbol,e.style.n=o.n,e.style.textX=e.style.x+r/2,e.style.y=this._location.y+this._location.height/4-r,e.style.width=2*r,e.style.height=2*r,e.style.text=o.name,n===this.currentIndex)return!0;if(this.currentIndex=n,this.timelineOption.realtime){clearTimeout(this.playTicket);var s=this;this.playTicket=setTimeout(function(){s._setCurrentOption()},200)}return!0},__ondragend:function(){this.isDragend=!0},ondragend:function(e,t){this.isDragend&&e.target&&(!this.timelineOption.realtime&&this._setCurrentOption(),t.dragOut=!0,t.dragIn=!0,t.needRefresh=!1,this.isDragend=!1,this._syncHandleShape())},last:function(){return this.timelineOption.autoPlay&&this.stop(),this.currentIndex-=1,this.currentIndex<0&&(this.currentIndex=this.timelineOption.data.length-1),this._onFrame(),this.currentIndex},next:function(){return this.timelineOption.autoPlay&&this.stop(),this.currentIndex+=1,this.currentIndex>=this.timelineOption.data.length&&(this.currentIndex=0),this._onFrame(),this.currentIndex},play:function(e,t){return this._ctrPlayShape&&"playing"!=this._ctrPlayShape.style.status&&(this._ctrPlayShape.style.status="playing",this.zr.modShape(this._ctrPlayShape.id),this.zr.refreshNextFrame()),this.timelineOption.autoPlay=null!=t?t:!0,this.timelineOption.autoPlay||clearTimeout(this.playTicket),this.currentIndex=null!=e?e:this.currentIndex+1,this.currentIndex>=this.timelineOption.data.length&&(this.currentIndex=0),this._onFrame(),this.currentIndex},stop:function(){return this._ctrPlayShape&&"stop"!=this._ctrPlayShape.style.status&&(this._ctrPlayShape.style.status="stop",this.zr.modShape(this._ctrPlayShape.id),this.zr.refreshNextFrame()),this.timelineOption.autoPlay=!1,clearTimeout(this.playTicket),this.currentIndex},resize:function(){this.timelineOption.show&&(this.clear(),this._buildShape(),this._syncHandleShape())},setTheme:function(e){this.timelineOption=this.reformOption(l.clone(this.option.timeline)),this.timelineOption.label.textStyle=this.getTextStyle(this.timelineOption.label.textStyle),this.timelineOption.checkpointStyle.label.textStyle=this.getTextStyle(this.timelineOption.checkpointStyle.label.textStyle),this.myChart.canvasSupported||(this.timelineOption.realtime=!1),this.timelineOption.show&&e&&(this.clear(),this._buildShape(),this._syncHandleShape())},onbeforDispose:function(){clearTimeout(this.playTicket)}},o.prototype.iconLibrary.timelineControl=n,l.inherits(t,i),e("../component").define("timeline",t),t}),n("zrender/shape/Image",["require","./Base","../tool/util"],function(e){var t=e("./Base"),n=function(e){t.call(this,e)};return n.prototype={type:"image",brush:function(e,t,n){var i=this.style||{};t&&(i=this.getHighlightStyle(i,this.highlightStyle||{}));var a=i.image,o=this;if(this._imageCache||(this._imageCache={}),"string"==typeof a){var r=a;this._imageCache[r]?a=this._imageCache[r]:(a=new Image,a.onload=function(){a.onload=null,o.modSelf(),n()},a.src=r,this._imageCache[r]=a)}if(a){if("IMG"==a.nodeName.toUpperCase())if(window.ActiveXObject){if("complete"!=a.readyState)return}else if(!a.complete)return;var s=i.width||a.width,l=i.height||a.height,h=i.x,m=i.y;if(!a.width||!a.height)return;if(e.save(),this.doClip(e),this.setContext(e,i),this.setTransform(e),i.sWidth&&i.sHeight){var V=i.sx||0,U=i.sy||0;e.drawImage(a,V,U,i.sWidth,i.sHeight,h,m,s,l)}else if(i.sx&&i.sy){var V=i.sx,U=i.sy,d=s-V,p=l-U;e.drawImage(a,V,U,d,p,h,m,s,l)}else e.drawImage(a,h,m,s,l);i.width||(i.width=s),i.height||(i.height=l),this.style.width||(this.style.width=s),this.style.height||(this.style.height=l),this.drawText(e,i,this.style),e.restore()}},getRect:function(e){return{x:e.x,y:e.y,width:e.width,height:e.height}},clearCache:function(){this._imageCache={}}},e("../tool/util").inherits(n,t),n}),n("zrender/loadingEffect/Bar",["require","./Base","../tool/util","../tool/color","../shape/Rectangle"],function(e){function t(e){n.call(this,e)}var n=e("./Base"),i=e("../tool/util"),a=e("../tool/color"),o=e("../shape/Rectangle");return i.inherits(t,n),t.prototype._start=function(e,t){var n=i.merge(this.options,{textStyle:{color:"#888"},backgroundColor:"rgba(250, 250, 250, 0.8)",effectOption:{x:0,y:this.canvasHeight/2-30,width:this.canvasWidth,height:5,brushType:"fill",timeInterval:100}}),r=this.createTextShape(n.textStyle),s=this.createBackgroundShape(n.backgroundColor),l=n.effectOption,h=new o({highlightStyle:i.clone(l)});return h.highlightStyle.color=l.color||a.getLinearGradient(l.x,l.y,l.x+l.width,l.y+l.height,[[0,"#ff6400"],[.5,"#ffe100"],[1,"#b1ff00"]]),null!=n.progress?(e(s),h.highlightStyle.width=this.adjust(n.progress,[0,1])*n.effectOption.width,e(h),e(r),void t()):(h.highlightStyle.width=0,setInterval(function(){e(s),h.highlightStyle.widthc;c++){var u="random"==l.color?a.alpha(a.random(),.3):l.color;U[c]=new o({highlightStyle:{x:Math.ceil(Math.random()*d),y:Math.ceil(Math.random()*p),r:Math.ceil(40*Math.random()),brushType:m,color:u,strokeColor:u,lineWidth:V},animationY:Math.ceil(20*Math.random())})}return setInterval(function(){e(s);for(var n=0;h>n;n++){var i=U[n].highlightStyle;i.y-U[n].animationY+i.r<=0&&(U[n].highlightStyle.y=p+i.r,U[n].highlightStyle.x=Math.ceil(Math.random()*d)),U[n].highlightStyle.y-=U[n].animationY,e(U[n])}e(r),t()},l.timeInterval)},t}),n("zrender/loadingEffect/DynamicLine",["require","./Base","../tool/util","../tool/color","../shape/Line"],function(e){function t(e){n.call(this,e)}var n=e("./Base"),i=e("../tool/util"),a=e("../tool/color"),o=e("../shape/Line");return i.inherits(t,n),t.prototype._start=function(e,t){for(var n=i.merge(this.options,{textStyle:{color:"#fff"},backgroundColor:"rgba(0, 0, 0, 0.8)",effectOption:{n:30,lineWidth:1,color:"random",timeInterval:100}}),r=this.createTextShape(n.textStyle),s=this.createBackgroundShape(n.backgroundColor),l=n.effectOption,h=l.n,m=l.lineWidth,V=[],U=this.canvasWidth,d=this.canvasHeight,p=0;h>p;p++){var c=-Math.ceil(1e3*Math.random()),u=Math.ceil(400*Math.random()),y=Math.ceil(Math.random()*d),g="random"==l.color?a.random():l.color;V[p]=new o({highlightStyle:{xStart:c,yStart:y,xEnd:c+u,yEnd:y,strokeColor:g,lineWidth:m},animationX:Math.ceil(100*Math.random()),len:u})}return setInterval(function(){e(s);for(var n=0;h>n;n++){var i=V[n].highlightStyle;i.xStart>=U&&(V[n].len=Math.ceil(400*Math.random()),i.xStart=-400,i.xEnd=-400+V[n].len,i.yStart=Math.ceil(Math.random()*d),i.yEnd=i.yStart),i.xStart+=V[n].animationX,i.xEnd+=V[n].animationX,e(V[n])}e(r),t()},l.timeInterval)},t}),n("zrender/loadingEffect/Ring",["require","./Base","../tool/util","../tool/color","../shape/Ring","../shape/Sector"],function(e){function t(e){n.call(this,e)}var n=e("./Base"),i=e("../tool/util"),a=e("../tool/color"),o=e("../shape/Ring"),r=e("../shape/Sector");return i.inherits(t,n),t.prototype._start=function(e,t){var n=i.merge(this.options,{textStyle:{color:"#07a"},backgroundColor:"rgba(250, 250, 250, 0.8)",effect:{x:this.canvasWidth/2,y:this.canvasHeight/2,r0:60,r:100,color:"#bbdcff",brushType:"fill",textPosition:"inside",textFont:"normal 30px verdana",textColor:"rgba(30, 144, 255, 0.6)",timeInterval:100}}),s=n.effect,l=n.textStyle;null==l.x&&(l.x=s.x),null==l.y&&(l.y=s.y+(s.r0+s.r)/2-5);for(var h=this.createTextShape(n.textStyle),m=this.createBackgroundShape(n.backgroundColor),V=s.x,U=s.y,d=s.r0+6,p=s.r-6,c=s.color,u=a.lift(c,.1),y=new o({highlightStyle:i.clone(s)}),g=[],b=a.getGradientColors(["#ff6400","#ffe100","#97ff00"],25),f=15,k=240,x=0;16>x;x++)g.push(new r({highlightStyle:{x:V,y:U,r0:d,r:p,startAngle:k-f,endAngle:k,brushType:"fill",color:u},_color:a.getLinearGradient(V+d*Math.cos(k,!0),U-d*Math.sin(k,!0),V+d*Math.cos(k-f,!0),U-d*Math.sin(k-f,!0),[[0,b[2*x]],[1,b[2*x+1]]])})),k-=f;k=360;for(var x=0;4>x;x++)g.push(new r({highlightStyle:{x:V,y:U,r0:d,r:p,startAngle:k-f,endAngle:k,brushType:"fill",color:u},_color:a.getLinearGradient(V+d*Math.cos(k,!0),U-d*Math.sin(k,!0),V+d*Math.cos(k-f,!0),U-d*Math.sin(k-f,!0),[[0,b[2*x+32]],[1,b[2*x+33]]])})),k-=f; +var _=0;if(null!=n.progress){e(m),_=100*this.adjust(n.progress,[0,1]).toFixed(2)/5,y.highlightStyle.text=5*_+"%",e(y);for(var x=0;20>x;x++)g[x].highlightStyle.color=_>x?g[x]._color:u,e(g[x]);return e(h),void t()}return setInterval(function(){e(m),_+=_>=20?-20:1,e(y);for(var n=0;20>n;n++)g[n].highlightStyle.color=_>n?g[n]._color:u,e(g[n]);e(h),t()},s.timeInterval)},t}),n("zrender/loadingEffect/Spin",["require","./Base","../tool/util","../tool/color","../tool/area","../shape/Sector"],function(e){function t(e){n.call(this,e)}var n=e("./Base"),i=e("../tool/util"),a=e("../tool/color"),o=e("../tool/area"),r=e("../shape/Sector");return i.inherits(t,n),t.prototype._start=function(e,t){var n=i.merge(this.options,{textStyle:{color:"#fff",textAlign:"start"},backgroundColor:"rgba(0, 0, 0, 0.8)"}),s=this.createTextShape(n.textStyle),l=10,h=o.getTextWidth(s.highlightStyle.text,s.highlightStyle.textFont),m=o.getTextHeight(s.highlightStyle.text,s.highlightStyle.textFont),V=i.merge(this.options.effect||{},{r0:9,r:15,n:18,color:"#fff",timeInterval:100}),U=this.getLocation(this.options.textStyle,h+l+2*V.r,Math.max(2*V.r,m));V.x=U.x+V.r,V.y=s.highlightStyle.y=U.y+U.height/2,s.highlightStyle.x=V.x+V.r+l;for(var d=this.createBackgroundShape(n.backgroundColor),p=V.n,c=V.x,u=V.y,y=V.r0,g=V.r,b=V.color,f=[],k=Math.round(180/p),x=0;p>x;x++)f[x]=new r({highlightStyle:{x:c,y:u,r0:y,r:g,startAngle:k*x*2,endAngle:k*x*2+k,color:a.alpha(b,(x+1)/p),brushType:"fill"}});var _=[0,c,u];return setInterval(function(){e(d),_[0]-=.3;for(var n=0;p>n;n++)f[n].rotation=_,e(f[n]);e(s),t()},V.timeInterval)},t}),n("zrender/loadingEffect/Whirling",["require","./Base","../tool/util","../tool/area","../shape/Ring","../shape/Droplet","../shape/Circle"],function(e){function t(e){n.call(this,e)}var n=e("./Base"),i=e("../tool/util"),a=e("../tool/area"),o=e("../shape/Ring"),r=e("../shape/Droplet"),s=e("../shape/Circle");return i.inherits(t,n),t.prototype._start=function(e,t){var n=i.merge(this.options,{textStyle:{color:"#888",textAlign:"start"},backgroundColor:"rgba(250, 250, 250, 0.8)"}),l=this.createTextShape(n.textStyle),h=10,m=a.getTextWidth(l.highlightStyle.text,l.highlightStyle.textFont),V=a.getTextHeight(l.highlightStyle.text,l.highlightStyle.textFont),U=i.merge(this.options.effect||{},{r:18,colorIn:"#fff",colorOut:"#555",colorWhirl:"#6cf",timeInterval:50}),d=this.getLocation(this.options.textStyle,m+h+2*U.r,Math.max(2*U.r,V));U.x=d.x+U.r,U.y=l.highlightStyle.y=d.y+d.height/2,l.highlightStyle.x=U.x+U.r+h;var p=this.createBackgroundShape(n.backgroundColor),c=new r({highlightStyle:{a:Math.round(U.r/2),b:Math.round(U.r-U.r/6),brushType:"fill",color:U.colorWhirl}}),u=new s({highlightStyle:{r:Math.round(U.r/6),brushType:"fill",color:U.colorIn}}),y=new o({highlightStyle:{r0:Math.round(U.r-U.r/3),r:U.r,brushType:"fill",color:U.colorOut}}),g=[0,U.x,U.y];return c.highlightStyle.x=u.highlightStyle.x=y.highlightStyle.x=g[1],c.highlightStyle.y=u.highlightStyle.y=y.highlightStyle.y=g[2],setInterval(function(){e(p),e(y),g[0]-=.3,c.rotation=g,e(c),e(u),e(l),t()},U.timeInterval)},t}),n("echarts/theme/macarons",[],function(){var e={color:["#2ec7c9","#b6a2de","#5ab1ef","#ffb980","#d87a80","#8d98b3","#e5cf0d","#97b552","#95706d","#dc69aa","#07a2a4","#9a7fd1","#588dd5","#f5994e","#c05050","#59678c","#c9ab00","#7eb00a","#6f5553","#c14089"],title:{textStyle:{fontWeight:"normal",color:"#008acd"}},dataRange:{itemWidth:15,color:["#5ab1ef","#e0ffff"]},toolbox:{color:["#1e90ff","#1e90ff","#1e90ff","#1e90ff"],effectiveColor:"#ff4500"},tooltip:{backgroundColor:"rgba(50,50,50,0.5)",axisPointer:{type:"line",lineStyle:{color:"#008acd"},crossStyle:{color:"#008acd"},shadowStyle:{color:"rgba(200,200,200,0.2)"}}},dataZoom:{dataBackgroundColor:"#efefff",fillerColor:"rgba(182,162,222,0.2)",handleColor:"#008acd"},grid:{borderColor:"#eee"},categoryAxis:{axisLine:{lineStyle:{color:"#008acd"}},splitLine:{lineStyle:{color:["#eee"]}}},valueAxis:{axisLine:{lineStyle:{color:"#008acd"}},splitArea:{show:!0,areaStyle:{color:["rgba(250,250,250,0.1)","rgba(200,200,200,0.1)"]}},splitLine:{lineStyle:{color:["#eee"]}}},polar:{axisLine:{lineStyle:{color:"#ddd"}},splitArea:{show:!0,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(200,200,200,0.2)"]}},splitLine:{lineStyle:{color:"#ddd"}}},timeline:{lineStyle:{color:"#008acd"},controlStyle:{normal:{color:"#008acd"},emphasis:{color:"#008acd"}},symbol:"emptyCircle",symbolSize:3},bar:{itemStyle:{normal:{barBorderRadius:5},emphasis:{barBorderRadius:5}}},line:{smooth:!0,symbol:"emptyCircle",symbolSize:3},k:{itemStyle:{normal:{color:"#d87a80",color0:"#2ec7c9",lineStyle:{color:"#d87a80",color0:"#2ec7c9"}}}},scatter:{symbol:"circle",symbolSize:4},radar:{symbol:"emptyCircle",symbolSize:3},map:{itemStyle:{normal:{areaStyle:{color:"#ddd"},label:{textStyle:{color:"#d87a80"}}},emphasis:{areaStyle:{color:"#fe994e"}}}},force:{itemStyle:{normal:{linkStyle:{color:"#1e90ff"}}}},chord:{itemStyle:{normal:{borderWidth:1,borderColor:"rgba(128, 128, 128, 0.5)",chordStyle:{lineStyle:{color:"rgba(128, 128, 128, 0.5)"}}},emphasis:{borderWidth:1,borderColor:"rgba(128, 128, 128, 0.5)",chordStyle:{lineStyle:{color:"rgba(128, 128, 128, 0.5)"}}}}},gauge:{axisLine:{lineStyle:{color:[[.2,"#2ec7c9"],[.8,"#5ab1ef"],[1,"#d87a80"]],width:10}},axisTick:{splitNumber:10,length:15,lineStyle:{color:"auto"}},splitLine:{length:22,lineStyle:{color:"auto"}},pointer:{width:5}},textStyle:{fontFamily:"微软雅黑, Arial, Verdana, sans-serif"}};return e}),n("echarts/theme/infographic",[],function(){var e={color:["#C1232B","#B5C334","#FCCE10","#E87C25","#27727B","#FE8463","#9BCA63","#FAD860","#F3A43B","#60C0DD","#D7504B","#C6E579","#F4E001","#F0805A","#26C0C0"],title:{textStyle:{fontWeight:"normal",color:"#27727B"}},dataRange:{x:"right",y:"center",itemWidth:5,itemHeight:25,color:["#C1232B","#FCCE10"]},toolbox:{color:["#C1232B","#B5C334","#FCCE10","#E87C25","#27727B","#FE8463","#9BCA63","#FAD860","#F3A43B","#60C0DD"],effectiveColor:"#ff4500"},tooltip:{backgroundColor:"rgba(50,50,50,0.5)",axisPointer:{type:"line",lineStyle:{color:"#27727B",type:"dashed"},crossStyle:{color:"#27727B"},shadowStyle:{color:"rgba(200,200,200,0.3)"}}},dataZoom:{dataBackgroundColor:"rgba(181,195,52,0.3)",fillerColor:"rgba(181,195,52,0.2)",handleColor:"#27727B"},grid:{borderWidth:0},categoryAxis:{axisLine:{lineStyle:{color:"#27727B"}},splitLine:{show:!1}},valueAxis:{axisLine:{show:!1},splitArea:{show:!1},splitLine:{lineStyle:{color:["#ccc"],type:"dashed"}}},polar:{axisLine:{lineStyle:{color:"#ddd"}},splitArea:{show:!0,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(200,200,200,0.2)"]}},splitLine:{lineStyle:{color:"#ddd"}}},timeline:{lineStyle:{color:"#27727B"},controlStyle:{normal:{color:"#27727B"},emphasis:{color:"#27727B"}},symbol:"emptyCircle",symbolSize:3},line:{itemStyle:{normal:{borderWidth:2,borderColor:"#fff",lineStyle:{width:3}},emphasis:{borderWidth:0}},symbol:"circle",symbolSize:3.5},k:{itemStyle:{normal:{color:"#C1232B",color0:"#B5C334",lineStyle:{width:1,color:"#C1232B",color0:"#B5C334"}}}},scatter:{itemdStyle:{normal:{borderWidth:1,borderColor:"rgba(200,200,200,0.5)"},emphasis:{borderWidth:0}},symbol:"star4",symbolSize:4},radar:{symbol:"emptyCircle",symbolSize:3},map:{itemStyle:{normal:{areaStyle:{color:"#ddd"},label:{textStyle:{color:"#C1232B"}}},emphasis:{areaStyle:{color:"#fe994e"},label:{textStyle:{color:"rgb(100,0,0)"}}}}},force:{itemStyle:{normal:{linkStyle:{color:"#27727B"}}}},chord:{itemStyle:{normal:{borderWidth:1,borderColor:"rgba(128, 128, 128, 0.5)",chordStyle:{lineStyle:{color:"rgba(128, 128, 128, 0.5)"}}},emphasis:{borderWidth:1,borderColor:"rgba(128, 128, 128, 0.5)",chordStyle:{lineStyle:{color:"rgba(128, 128, 128, 0.5)"}}}}},gauge:{center:["50%","80%"],radius:"100%",startAngle:180,endAngle:0,axisLine:{show:!0,lineStyle:{color:[[.2,"#B5C334"],[.8,"#27727B"],[1,"#C1232B"]],width:"40%"}},axisTick:{splitNumber:2,length:5,lineStyle:{color:"#fff"}},axisLabel:{textStyle:{color:"#fff",fontWeight:"bolder"}},splitLine:{length:"5%",lineStyle:{color:"#fff"}},pointer:{width:"40%",length:"80%",color:"#fff"},title:{offsetCenter:[0,-20],textStyle:{color:"auto",fontSize:20}},detail:{offsetCenter:[0,0],textStyle:{color:"auto",fontSize:40}}},textStyle:{fontFamily:"微软雅黑, Arial, Verdana, sans-serif"}};return e}),n("zrender/dep/excanvas",["require"],function(){return document.createElement("canvas").getContext?G_vmlCanvasManager=!1:!function(){function e(){return this.context_||(this.context_=new f(this))}function t(e,t){var n=O.call(arguments,2);return function(){return e.apply(t,n.concat(O.call(arguments)))}}function n(e){return String(e).replace(/&/g,"&").replace(/"/g,""")}function i(e,t,n){e.namespaces[t]||e.namespaces.add(t,n,"#default#VML")}function a(e){if(i(e,"g_vml_","urn:schemas-microsoft-com:vml"),i(e,"g_o_","urn:schemas-microsoft-com:office:office"),!e.styleSheets.ex_canvas_){var t=e.createStyleSheet();t.owningElement.id="ex_canvas_",t.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}function o(e){var t=e.srcElement;switch(e.propertyName){case"width":t.getContext().clearRect(),t.style.width=t.attributes.width.nodeValue+"px",t.firstChild.style.width=t.clientWidth+"px";break;case"height":t.getContext().clearRect(),t.style.height=t.attributes.height.nodeValue+"px",t.firstChild.style.height=t.clientHeight+"px"}}function r(e){var t=e.srcElement;t.firstChild&&(t.firstChild.style.width=t.clientWidth+"px",t.firstChild.style.height=t.clientHeight+"px")}function s(){return[[1,0,0],[0,1,0],[0,0,1]]}function l(e,t){for(var n=s(),i=0;3>i;i++)for(var a=0;3>a;a++){for(var o=0,r=0;3>r;r++)o+=e[i][r]*t[r][a];n[i][a]=o}return n}function h(e,t){t.fillStyle=e.fillStyle,t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY,t.strokeStyle=e.strokeStyle,t.globalAlpha=e.globalAlpha,t.font=e.font,t.textAlign=e.textAlign,t.textBaseline=e.textBaseline,t.scaleX_=e.scaleX_,t.scaleY_=e.scaleY_,t.lineScale_=e.lineScale_}function m(e){var t=e.indexOf("(",3),n=e.indexOf(")",t+1),i=e.substring(t+1,n).split(",");return(4!=i.length||"a"!=e.charAt(3))&&(i[3]=1),i}function V(e){return parseFloat(e)/100}function U(e,t,n){return Math.min(n,Math.max(t,e))}function d(e){var t,n,i,a,o,r;if(a=parseFloat(e[0])/360%360,0>a&&a++,o=U(V(e[1]),0,1),r=U(V(e[2]),0,1),0==o)t=n=i=r;else{var s=.5>r?r*(1+o):r+o-r*o,l=2*r-s;t=p(l,s,a+1/3),n=p(l,s,a),i=p(l,s,a-1/3)}return"#"+P[Math.floor(255*t)]+P[Math.floor(255*n)]+P[Math.floor(255*i)]}function p(e,t,n){return 0>n&&n++,n>1&&n--,1>6*n?e+6*(t-e)*n:1>2*n?t:2>3*n?e+(t-e)*(2/3-n)*6:e}function c(e){if(e in R)return R[e];var t,n=1;if(e=String(e),"#"==e.charAt(0))t=e;else if(/^rgb/.test(e)){for(var i,a=m(e),t="#",o=0;3>o;o++)i=-1!=a[o].indexOf("%")?Math.floor(255*V(a[o])):+a[o],t+=P[U(i,0,255)];n=+a[3]}else if(/^hsl/.test(e)){var a=m(e);t=d(a),n=a[3]}else t=H[e]||e;return R[e]={color:t,alpha:n}}function u(e){if(Y[e])return Y[e];var t,n=document.createElement("div"),i=n.style;try{i.font=e,t=i.fontFamily.split(",")[0]}catch(a){}return Y[e]={style:i.fontStyle||G.style,variant:i.fontVariant||G.variant,weight:i.fontWeight||G.weight,size:i.fontSize||G.size,family:t||G.family}}function y(e,t){var n={};for(var i in e)n[i]=e[i];var a=parseFloat(t.currentStyle.fontSize),o=parseFloat(e.size);return n.size="number"==typeof e.size?e.size:-1!=e.size.indexOf("px")?o:-1!=e.size.indexOf("em")?a*o:-1!=e.size.indexOf("%")?a/100*o:-1!=e.size.indexOf("pt")?o/.75:a,n}function g(e){return e.style+" "+e.variant+" "+e.weight+" "+e.size+"px '"+e.family+"'"}function b(e){return Q[e]||"square"}function f(e){this.m_=s(),this.mStack_=[],this.aStack_=[],this.currentPath_=[],this.strokeStyle="#000",this.fillStyle="#000",this.lineWidth=1,this.lineJoin="miter",this.lineCap="butt",this.miterLimit=1*M,this.globalAlpha=1,this.font="12px 微软雅黑",this.textAlign="left",this.textBaseline="alphabetic",this.canvas=e;var t="width:"+e.clientWidth+"px;height:"+e.clientHeight+"px;overflow:hidden;position:absolute",n=e.ownerDocument.createElement("div");n.style.cssText=t,e.appendChild(n);var i=n.cloneNode(!1);i.style.backgroundColor="#fff",i.style.filter="alpha(opacity=0)",e.appendChild(i),this.element_=n,this.scaleX_=1,this.scaleY_=1,this.lineScale_=1}function k(e,t,n,i){e.currentPath_.push({type:"bezierCurveTo",cp1x:t.x,cp1y:t.y,cp2x:n.x,cp2y:n.y,x:i.x,y:i.y}),e.currentX_=i.x,e.currentY_=i.y}function x(e,t){var n=c(e.strokeStyle),i=n.color,a=n.alpha*e.globalAlpha,o=e.lineScale_*e.lineWidth;1>o&&(a*=o),t.push("')}function _(e,t,n,i){var a=e.fillStyle,o=e.scaleX_,r=e.scaleY_,s=i.x-n.x,l=i.y-n.y;if(a instanceof K){var h=0,m={x:0,y:0},V=0,U=1;if("gradient"==a.type_){var d=a.x0_/o,p=a.y0_/r,u=a.x1_/o,y=a.y1_/r,g=L(e,d,p),b=L(e,u,y),f=b.x-g.x,k=b.y-g.y;h=180*Math.atan2(f,k)/Math.PI,0>h&&(h+=360),1e-6>h&&(h=0)}else{var g=L(e,a.x0_,a.y0_);m={x:(g.x-n.x)/s,y:(g.y-n.y)/l},s/=o*M,l/=r*M;var x=C.max(s,l);V=2*a.r0_/x,U=2*a.r1_/x-V}var _=a.colors_;_.sort(function(e,t){return e.offset-t.offset});for(var W=_.length,X=_[0].color,I=_[W-1].color,v=_[0].alpha*e.globalAlpha,J=_[W-1].alpha*e.globalAlpha,S=[],E=0;W>E;E++){var F=_[E];S.push(F.offset*U+V+" "+F.color)}t.push('')}else if(a instanceof w){if(s&&l){var T=-n.x,A=-n.y;t.push("')}}else{var z=c(e.fillStyle),O=z.color,D=z.alpha*e.globalAlpha;t.push('')}}function L(e,t,n){var i=e.m_;return{x:M*(t*i[0][0]+n*i[1][0]+i[2][0])-z,y:M*(t*i[0][1]+n*i[1][1]+i[2][1])-z}}function W(e){return isFinite(e[0][0])&&isFinite(e[0][1])&&isFinite(e[1][0])&&isFinite(e[1][1])&&isFinite(e[2][0])&&isFinite(e[2][1])}function X(e,t,n){if(W(t)&&(e.m_=t,e.scaleX_=Math.sqrt(t[0][0]*t[0][0]+t[0][1]*t[0][1]),e.scaleY_=Math.sqrt(t[1][0]*t[1][0]+t[1][1]*t[1][1]),n)){var i=t[0][0]*t[1][1]-t[0][1]*t[1][0];e.lineScale_=A(T(i))}}function K(e){this.type_=e,this.x0_=0,this.y0_=0,this.r0_=0,this.x1_=0,this.y1_=0,this.r1_=0,this.colors_=[]}function w(e,t){switch(v(e),t){case"repeat":case null:case"":this.repetition_="repeat";break;case"repeat-x":case"repeat-y":case"no-repeat":this.repetition_=t;break;default:I("SYNTAX_ERR")}this.src_=e.src,this.width_=e.width,this.height_=e.height}function I(e){throw new J(e)}function v(e){e&&1==e.nodeType&&"IMG"==e.tagName||I("TYPE_MISMATCH_ERR"),"complete"!=e.readyState&&I("INVALID_STATE_ERR")}function J(e){this.code=this[e],this.message=e+": DOM Exception "+this.code}var C=Math,S=C.round,E=C.sin,F=C.cos,T=C.abs,A=C.sqrt,M=10,z=M/2,O=(+navigator.userAgent.match(/MSIE ([\d.]+)?/)[1],Array.prototype.slice);a(document);var D={init:function(e){var n=e||document;n.createElement("canvas"),n.attachEvent("onreadystatechange",t(this.init_,this,n))},init_:function(e){for(var t=e.getElementsByTagName("canvas"),n=0;nN;N++)for(var B=0;16>B;B++)P[16*N+B]=N.toString(16)+B.toString(16);var H={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgreen:"#006400",darkgrey:"#A9A9A9",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",grey:"#808080",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgreen:"#90EE90",lightgrey:"#D3D3D3",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",oldlace:"#FDF5E6",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",whitesmoke:"#F5F5F5",yellowgreen:"#9ACD32"},R={},G={style:"normal",variant:"normal",weight:"normal",size:12,family:"微软雅黑"},Y={},Q={butt:"flat",round:"round"},Z=f.prototype;Z.clearRect=function(){this.textMeasureEl_&&(this.textMeasureEl_.removeNode(!0),this.textMeasureEl_=null),this.element_.innerHTML=""},Z.beginPath=function(){this.currentPath_=[]},Z.moveTo=function(e,t){var n=L(this,e,t);this.currentPath_.push({type:"moveTo",x:n.x,y:n.y}),this.currentX_=n.x,this.currentY_=n.y},Z.lineTo=function(e,t){var n=L(this,e,t);this.currentPath_.push({type:"lineTo",x:n.x,y:n.y}),this.currentX_=n.x,this.currentY_=n.y},Z.bezierCurveTo=function(e,t,n,i,a,o){var r=L(this,a,o),s=L(this,e,t),l=L(this,n,i);k(this,s,l,r)},Z.quadraticCurveTo=function(e,t,n,i){var a=L(this,e,t),o=L(this,n,i),r={x:this.currentX_+2/3*(a.x-this.currentX_),y:this.currentY_+2/3*(a.y-this.currentY_)},s={x:r.x+(o.x-this.currentX_)/3,y:r.y+(o.y-this.currentY_)/3};k(this,r,s,o)},Z.arc=function(e,t,n,i,a,o){n*=M;var r=o?"at":"wa",s=e+F(i)*n-z,l=t+E(i)*n-z,h=e+F(a)*n-z,m=t+E(a)*n-z;s!=h||o||(s+=.125);var V=L(this,e,t),U=L(this,s,l),d=L(this,h,m);this.currentPath_.push({type:r,x:V.x,y:V.y,radius:n,xStart:U.x,yStart:U.y,xEnd:d.x,yEnd:d.y})},Z.rect=function(e,t,n,i){this.moveTo(e,t),this.lineTo(e+n,t),this.lineTo(e+n,t+i),this.lineTo(e,t+i),this.closePath()},Z.strokeRect=function(e,t,n,i){var a=this.currentPath_;this.beginPath(),this.moveTo(e,t),this.lineTo(e+n,t),this.lineTo(e+n,t+i),this.lineTo(e,t+i),this.closePath(),this.stroke(),this.currentPath_=a},Z.fillRect=function(e,t,n,i){var a=this.currentPath_;this.beginPath(),this.moveTo(e,t),this.lineTo(e+n,t),this.lineTo(e+n,t+i),this.lineTo(e,t+i),this.closePath(),this.fill(),this.currentPath_=a},Z.createLinearGradient=function(e,t,n,i){var a=new K("gradient");return a.x0_=e,a.y0_=t,a.x1_=n,a.y1_=i,a},Z.createRadialGradient=function(e,t,n,i,a,o){var r=new K("gradientradial");return r.x0_=e,r.y0_=t,r.r0_=n,r.x1_=i,r.y1_=a,r.r1_=o,r},Z.drawImage=function(e){var t,n,i,a,o,r,s,l,h=e.runtimeStyle.width,m=e.runtimeStyle.height;e.runtimeStyle.width="auto",e.runtimeStyle.height="auto";var V=e.width,U=e.height;if(e.runtimeStyle.width=h,e.runtimeStyle.height=m,3==arguments.length)t=arguments[1],n=arguments[2],o=r=0,s=i=V,l=a=U;else if(5==arguments.length)t=arguments[1],n=arguments[2],i=arguments[3],a=arguments[4],o=r=0,s=V,l=U;else{if(9!=arguments.length)throw Error("Invalid number of arguments");o=arguments[1],r=arguments[2],s=arguments[3],l=arguments[4],t=arguments[5],n=arguments[6],i=arguments[7],a=arguments[8]}var d=L(this,t,n),p=[],c=10,u=10,y=b=1;if(p.push(" '),(o||r)&&p.push('
'),p.push('
'),(o||r)&&p.push("
"),p.push("
"),this.element_.insertAdjacentHTML("BeforeEnd",p.join(""))},Z.stroke=function(e){var t=[],n=10,i=10;t.push("o.x)&&(o.x=l.x),(null==a.y||l.yo.y)&&(o.y=l.y))}t.push(' ">'),e?_(this,t,a,o):x(this,t),t.push(""),this.element_.insertAdjacentHTML("beforeEnd",t.join(""))},Z.fill=function(){this.stroke(!0)},Z.closePath=function(){this.currentPath_.push({type:"close"})},Z.save=function(){var e={};h(this,e),this.aStack_.push(e),this.mStack_.push(this.m_),this.m_=l(s(),this.m_)},Z.restore=function(){this.aStack_.length&&(h(this.aStack_.pop(),this),this.m_=this.mStack_.pop())},Z.translate=function(e,t){var n=[[1,0,0],[0,1,0],[e,t,1]];X(this,l(n,this.m_),!1)},Z.rotate=function(e){var t=F(e),n=E(e),i=[[t,n,0],[-n,t,0],[0,0,1]];X(this,l(i,this.m_),!1)},Z.scale=function(e,t){var n=[[e,0,0],[0,t,0],[0,0,1]];X(this,l(n,this.m_),!0)},Z.transform=function(e,t,n,i,a,o){var r=[[e,t,0],[n,i,0],[a,o,1]];X(this,l(r,this.m_),!0)},Z.setTransform=function(e,t,n,i,a,o){var r=[[e,t,0],[n,i,0],[a,o,1]];X(this,r,!0)},Z.drawText_=function(e,t,i,a,o){var r=this.m_,s=1e3,l=0,h=s,m={x:0,y:0},V=[],U=y(u(this.font),this.element_),d=g(U),p=this.element_.currentStyle,c=this.textAlign.toLowerCase();switch(c){case"left":case"center":case"right":break;case"end":c="ltr"==p.direction?"right":"left";break;case"start":c="rtl"==p.direction?"right":"left";break;default:c="left"}switch(this.textBaseline){case"hanging":case"top":m.y=U.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":m.y=-U.size/2.25}switch(c){case"right":l=s,h=.05;break;case"center":l=h=s/2}var b=L(this,t+m.x,i+m.y);V.push(''),o?x(this,V):_(this,V,{x:-l,y:0},{x:h,y:U.size});var f=r[0][0].toFixed(3)+","+r[1][0].toFixed(3)+","+r[0][1].toFixed(3)+","+r[1][1].toFixed(3)+",0,0",k=S(b.x/M)+","+S(b.y/M);V.push('','',''),this.element_.insertAdjacentHTML("beforeEnd",V.join(""))},Z.fillText=function(e,t,n,i){this.drawText_(e,t,n,i,!1)},Z.strokeText=function(e,t,n,i){this.drawText_(e,t,n,i,!0)},Z.measureText=function(e){if(!this.textMeasureEl_){var t='';this.element_.insertAdjacentHTML("beforeEnd",t),this.textMeasureEl_=this.element_.lastChild}var n=this.element_.ownerDocument;this.textMeasureEl_.innerHTML="";try{this.textMeasureEl_.style.font=this.font}catch(i){}return this.textMeasureEl_.appendChild(n.createTextNode(e)),{width:this.textMeasureEl_.offsetWidth}},Z.clip=function(){},Z.arcTo=function(){},Z.createPattern=function(e,t){return new w(e,t)},K.prototype.addColorStop=function(e,t){t=c(t),this.colors_.push({offset:e,color:t.color,alpha:t.alpha})};var q=J.prototype=new Error;q.INDEX_SIZE_ERR=1,q.DOMSTRING_SIZE_ERR=2,q.HIERARCHY_REQUEST_ERR=3,q.WRONG_DOCUMENT_ERR=4,q.INVALID_CHARACTER_ERR=5,q.NO_DATA_ALLOWED_ERR=6,q.NO_MODIFICATION_ALLOWED_ERR=7,q.NOT_FOUND_ERR=8,q.NOT_SUPPORTED_ERR=9,q.INUSE_ATTRIBUTE_ERR=10,q.INVALID_STATE_ERR=11,q.SYNTAX_ERR=12,q.INVALID_MODIFICATION_ERR=13,q.NAMESPACE_ERR=14,q.INVALID_ACCESS_ERR=15,q.VALIDATION_ERR=16,q.TYPE_MISMATCH_ERR=17,G_vmlCanvasManager=D,CanvasRenderingContext2D=f,CanvasGradient=K,CanvasPattern=w,DOMException=J}(),G_vmlCanvasManager}),n("zrender/mixin/Eventful",["require"],function(){var e=function(){this._handlers={}};return e.prototype.one=function(e,t,n){var i=this._handlers;return t&&e?(i[e]||(i[e]=[]),i[e].push({h:t,one:!0,ctx:n||this}),this):this},e.prototype.bind=function(e,t,n){var i=this._handlers;return t&&e?(i[e]||(i[e]=[]),i[e].push({h:t,one:!1,ctx:n||this}),this):this},e.prototype.unbind=function(e,t){var n=this._handlers;if(!e)return this._handlers={},this;if(t){if(n[e]){for(var i=[],a=0,o=n[e].length;o>a;a++)n[e][a].h!=t&&i.push(n[e][a]);n[e]=i}n[e]&&0===n[e].length&&delete n[e]}else delete n[e];return this},e.prototype.dispatch=function(e){if(this._handlers[e]){var t=arguments,n=t.length;n>3&&(t=Array.prototype.slice.call(t,1));for(var i=this._handlers[e],a=i.length,o=0;a>o;){switch(n){case 1:i[o].h.call(i[o].ctx);break;case 2:i[o].h.call(i[o].ctx,t[1]);break;case 3:i[o].h.call(i[o].ctx,t[1],t[2]);break;default:i[o].h.apply(i[o].ctx,t)}i[o].one?(i.splice(o,1),a--):o++}}return this},e.prototype.dispatchWithContext=function(e){if(this._handlers[e]){var t=arguments,n=t.length;n>4&&(t=Array.prototype.slice.call(t,1,t.length-1));for(var i=t[t.length-1],a=this._handlers[e],o=a.length,r=0;o>r;){switch(n){case 1:a[r].h.call(i);break;case 2:a[r].h.call(i,t[1]);break;case 3:a[r].h.call(i,t[1],t[2]);break;default:a[r].h.apply(i,t)}a[r].one?(a.splice(r,1),o--):r++}}return this},e}),n("zrender/tool/log",["require","../config"],function(e){var t=e("../config");return function(){if(0!==t.debugMode)if(1==t.debugMode)for(var e in arguments)throw new Error(arguments[e]);else if(t.debugMode>1)for(var e in arguments)console.log(arguments[e])}}),n("zrender/tool/guid",[],function(){var e=2311;return function(){return"zrender__"+e++}}),n("zrender/Handler",["require","./config","./tool/env","./tool/event","./tool/util","./tool/vector","./tool/matrix","./mixin/Eventful"],function(e){"use strict";function t(e,t){return function(n){return e.call(t,n)}}function n(e,t){return function(n,i,a){return e.call(t,n,i,a)}}function i(e){for(var n=d.length;n--;){var i=d[n];e["_"+i+"Handler"]=t(p[i],e)}}function a(e,t,n){if(this._draggingTarget&&this._draggingTarget.id==e.id||e.isSilent())return!1;var i=this._event;if(e.isCover(t,n)){e.hoverable&&this.storage.addHover(e);for(var a=e.parent;a;){if(a.clipShape&&!a.clipShape.isCover(this._mouseX,this._mouseY))return!1;a=a.parent}return this._lastHover!=e&&(this._processOutShape(i),this._processDragLeave(i),this._lastHover=e,this._processDragEnter(i)),this._processOverShape(i),this._processDragOver(i),this._hasfound=1,!0}return!1}var o=e("./config"),r=e("./tool/env"),s=e("./tool/event"),l=e("./tool/util"),h=e("./tool/vector"),m=e("./tool/matrix"),V=o.EVENT,U=e("./mixin/Eventful"),d=["resize","click","dblclick","mousewheel","mousemove","mouseout","mouseup","mousedown","touchstart","touchend","touchmove"],p={resize:function(e){e=e||window.event,this._lastHover=null,this._isMouseDown=0,this.dispatch(V.RESIZE,e)},click:function(e){e=this._zrenderEventFixed(e);var t=this._lastHover;(t&&t.clickable||!t)&&this._clickThreshold<5&&this._dispatchAgency(t,V.CLICK,e),this._mousemoveHandler(e)},dblclick:function(e){e=e||window.event,e=this._zrenderEventFixed(e);var t=this._lastHover;(t&&t.clickable||!t)&&this._clickThreshold<5&&this._dispatchAgency(t,V.DBLCLICK,e),this._mousemoveHandler(e)},mousewheel:function(e){e=this._zrenderEventFixed(e);var t=e.wheelDelta||-e.detail,n=t>0?1.1:1/1.1,i=!1,a=this._mouseX,o=this._mouseY;this.painter.eachBuildinLayer(function(t){var r=t.position;if(t.zoomable){t.__zoom=t.__zoom||1;var l=t.__zoom;l*=n,l=Math.max(Math.min(t.maxZoom,l),t.minZoom),n=l/t.__zoom,t.__zoom=l,r[0]-=(a-r[0])*(n-1),r[1]-=(o-r[1])*(n-1),t.scale[0]*=n,t.scale[1]*=n,t.dirty=!0,i=!0,s.stop(e)}}),i&&this.painter.refresh(),this._dispatchAgency(this._lastHover,V.MOUSEWHEEL,e),this._mousemoveHandler(e)},mousemove:function(e){if(!this.painter.isLoading()){e=this._zrenderEventFixed(e),this._lastX=this._mouseX,this._lastY=this._mouseY,this._mouseX=s.getX(e),this._mouseY=s.getY(e);var t=this._mouseX-this._lastX,n=this._mouseY-this._lastY;this._processDragStart(e),this._hasfound=0,this._event=e,this._iterateAndFindHover(),this._hasfound||((!this._draggingTarget||this._lastHover&&this._lastHover!=this._draggingTarget)&&(this._processOutShape(e),this._processDragLeave(e)),this._lastHover=null,this.storage.delHover(),this.painter.clearHover());var i="default";if(this._draggingTarget)this.storage.drift(this._draggingTarget.id,t,n),this._draggingTarget.modSelf(),this.storage.addHover(this._draggingTarget),this._clickThreshold++;else if(this._isMouseDown){var a=!1;this.painter.eachBuildinLayer(function(e){e.panable&&(i="move",e.position[0]+=t,e.position[1]+=n,a=!0,e.dirty=!0)}),a&&this.painter.refresh()}this._draggingTarget||this._hasfound&&this._lastHover.draggable?i="move":this._hasfound&&this._lastHover.clickable&&(i="pointer"),this.root.style.cursor=i,this._dispatchAgency(this._lastHover,V.MOUSEMOVE,e),(this._draggingTarget||this._hasfound||this.storage.hasHoverShape())&&this.painter.refreshHover()}},mouseout:function(e){e=this._zrenderEventFixed(e);var t=e.toElement||e.relatedTarget;if(t!=this.root)for(;t&&9!=t.nodeType;){if(t==this.root)return void this._mousemoveHandler(e);t=t.parentNode}e.zrenderX=this._lastX,e.zrenderY=this._lastY,this.root.style.cursor="default",this._isMouseDown=0,this._processOutShape(e),this._processDrop(e),this._processDragEnd(e),this.painter.isLoading()||this.painter.refreshHover(),this.dispatch(V.GLOBALOUT,e) +},mousedown:function(e){return this._clickThreshold=0,2==this._lastDownButton?(this._lastDownButton=e.button,void(this._mouseDownTarget=null)):(this._lastMouseDownMoment=new Date,e=this._zrenderEventFixed(e),this._isMouseDown=1,this._mouseDownTarget=this._lastHover,this._dispatchAgency(this._lastHover,V.MOUSEDOWN,e),void(this._lastDownButton=e.button))},mouseup:function(e){e=this._zrenderEventFixed(e),this.root.style.cursor="default",this._isMouseDown=0,this._mouseDownTarget=null,this._dispatchAgency(this._lastHover,V.MOUSEUP,e),this._processDrop(e),this._processDragEnd(e)},touchstart:function(e){e=this._zrenderEventFixed(e,!0),this._lastTouchMoment=new Date,this._mobileFindFixed(e),this._mousedownHandler(e)},touchmove:function(e){e=this._zrenderEventFixed(e,!0),this._mousemoveHandler(e),this._isDragging&&s.stop(e)},touchend:function(e){e=this._zrenderEventFixed(e,!0),this._mouseupHandler(e);var t=new Date;t-this._lastTouchMoment=0;o--){var r=i[o];if(t!==r.zlevel&&(n=this.painter.getLayer(r.zlevel,n),a[0]=this._mouseX,a[1]=this._mouseY,n.needTransform&&(m.invert(e,n.transform),h.applyTransform(a,a,e))),this._findHover(r,a[0],a[1]))break}}}();var u=[{x:10},{x:-20},{x:10,y:10},{y:-20}];return c.prototype._mobileFindFixed=function(e){this._lastHover=null,this._mouseX=e.zrenderX,this._mouseY=e.zrenderY,this._event=e,this._iterateAndFindHover();for(var t=0;!this._lastHover&&ts;s++){var h=e[s];if(i!==h.zlevel&&(n&&(n.needTransform&&o.restore(),o.flush&&o.flush()),i=h.zlevel,n=this.getLayer(i),n.isBuildin||r("ZLevel "+i+" has been used by unkown layer "+n.id),o=n.ctx,n.unusedCount=0,(n.dirty||t)&&n.clear(),n.needTransform&&(o.save(),n.setTransform(o))),(n.dirty||t)&&!h.invisible&&(!h.onbrush||h.onbrush&&!h.onbrush(o,!1)))if(a.catchBrushException)try{h.brush(o,!1,this.refreshNextFrame)}catch(m){r(m,"brush error of "+h.type,h)}else h.brush(o,!1,this.refreshNextFrame);h.__dirty=!1}n&&(n.needTransform&&o.restore(),o.flush&&o.flush()),this.eachBuildinLayer(this._postProcessLayer)},h.prototype.getLayer=function(e){var t=this._layers[e];return t||(t=new l(e,this),t.isBuildin=!0,this._layerConfig[e]&&o.merge(t,this._layerConfig[e],!0),t.updateTransform(),this.insertLayer(e,t),t.initContext()),t},h.prototype.insertLayer=function(e,t){if(this._layers[e])return void r("ZLevel "+e+" has been used already");if(!i(t))return void r("Layer of zlevel "+e+" is not valid");var n=this._zlevelList.length,a=null,o=-1;if(n>0&&e>this._zlevelList[0]){for(o=0;n-1>o&&!(this._zlevelList[o]e);o++);a=this._layers[this._zlevelList[o]]}this._zlevelList.splice(o+1,0,e);var s=a?a.dom:this._bgDom;s.nextSibling?s.parentNode.insertBefore(t.dom,s.nextSibling):s.parentNode.appendChild(t.dom),this._layers[e]=t},h.prototype.eachLayer=function(e,t){for(var n=0;ni;i++){var o=e[i],r=o.zlevel,s=t[r];if(s){if(s.elCount++,s.dirty)continue;s.dirty=o.__dirty}}this.eachBuildinLayer(function(e,t){n[t]!==e.elCount&&(e.dirty=!0)})},h.prototype.refreshShapes=function(e,t){for(var n=0,i=e.length;i>n;n++){var a=e[n];a.modSelf()}return this.refresh(t),this},h.prototype.setLoadingEffect=function(e){return this._loadingEffect=e,this},h.prototype.clear=function(){return this.eachBuildinLayer(this._clearLayer),this},h.prototype._clearLayer=function(e){e.clear()},h.prototype.modLayer=function(e,t){if(t){this._layerConfig[e]?o.merge(this._layerConfig[e],t,!0):this._layerConfig[e]=t;var n=this._layers[e];n&&o.merge(n,this._layerConfig[e],!0)}},h.prototype.delLayer=function(e){var t=this._layers[e];t&&(this.modLayer(e,{position:t.position,rotation:t.rotation,scale:t.scale}),t.dom.parentNode.removeChild(t.dom),delete this._layers[e],this._zlevelList.splice(o.indexOf(this._zlevelList,e),1))},h.prototype.refreshHover=function(){this.clearHover();for(var e=this.storage.getHoverShapes(!0),t=0,n=e.length;n>t;t++)this._brushHover(e[t]);var i=this._layers.hover.ctx;return i.flush&&i.flush(),this.storage.delHover(),this},h.prototype.clearHover=function(){var e=this._layers.hover;return e&&e.clear(),this},h.prototype.showLoading=function(e){return this._loadingEffect&&this._loadingEffect.stop(),e&&this.setLoadingEffect(e),this._loadingEffect.start(this),this.loading=!0,this},h.prototype.hideLoading=function(){return this._loadingEffect.stop(),this.clearHover(),this.loading=!1,this},h.prototype.isLoading=function(){return this.loading},h.prototype.resize=function(){var e=this._domRoot;e.style.display="none";var t=this._getWidth(),n=this._getHeight();if(e.style.display="",this._width!=t||n!=this._height){this._width=t,this._height=n,e.style.width=t+"px",e.style.height=n+"px";for(var i in this._layers)this._layers[i].resize(t,n);this.refresh(null,!0)}return this},h.prototype.clearLayer=function(e){var t=this._layers[e];t&&t.clear()},h.prototype.dispose=function(){this.isLoading()&&this.hideLoading(),this.root.innerHTML="",this.root=this.storage=this._domRoot=this._layers=null},h.prototype.getDomHover=function(){return this._layers.hover.dom},h.prototype.toDataURL=function(e,t,n){if(window.G_vmlCanvasManager)return null;var i=new l("image",this);this._bgDom.appendChild(i.dom),i.initContext();var o=i.ctx;i.clearColor=t||"#fff",i.clear();var s=this;this.storage.iterShape(function(e){if(!e.invisible&&(!e.onbrush||e.onbrush&&!e.onbrush(o,!1)))if(a.catchBrushException)try{e.brush(o,!1,s.refreshNextFrame)}catch(t){r(t,"brush error of "+e.type,e)}else e.brush(o,!1,s.refreshNextFrame)},{normal:"up",update:!0});var h=i.dom.toDataURL(e,n);return o=null,this._bgDom.removeChild(i.dom),h},h.prototype.getWidth=function(){return this._width},h.prototype.getHeight=function(){return this._height},h.prototype._getWidth=function(){var e=this.root,t=e.currentStyle||document.defaultView.getComputedStyle(e);return((e.clientWidth||parseInt(t.width,10))-parseInt(t.paddingLeft,10)-parseInt(t.paddingRight,10)).toFixed(0)-0},h.prototype._getHeight=function(){var e=this.root,t=e.currentStyle||document.defaultView.getComputedStyle(e);return((e.clientHeight||parseInt(t.height,10))-parseInt(t.paddingTop,10)-parseInt(t.paddingBottom,10)).toFixed(0)-0},h.prototype._brushHover=function(e){var t=this._layers.hover.ctx;if(!e.onbrush||e.onbrush&&!e.onbrush(t,!0)){var n=this.getLayer(e.zlevel);if(n.needTransform&&(t.save(),n.setTransform(t)),a.catchBrushException)try{e.brush(t,!0,this.refreshNextFrame)}catch(i){r(i,"hoverBrush error of "+e.type,e)}else e.brush(t,!0,this.refreshNextFrame);n.needTransform&&t.restore()}},h.prototype._shapeToImage=function(t,n,i,a,o){var r=document.createElement("canvas"),s=r.getContext("2d");r.style.width=i+"px",r.style.height=a+"px",r.setAttribute("width",i*o),r.setAttribute("height",a*o),s.clearRect(0,0,i*o,a*o);var l={position:n.position,rotation:n.rotation,scale:n.scale};n.position=[0,0,0],n.rotation=0,n.scale=[1,1],n&&n.brush(s,!1);var h=e("./shape/Image"),m=new h({id:t,style:{x:0,y:0,image:r}});return null!=l.position&&(m.position=n.position=l.position),null!=l.rotation&&(m.rotation=n.rotation=l.rotation),null!=l.scale&&(m.scale=n.scale=l.scale),m},h.prototype._createShapeToImageProcessor=function(){if(window.G_vmlCanvasManager)return n;var e=this;return function(t,n,i,o){return e._shapeToImage(t,n,i,o,a.devicePixelRatio)}},h}),n("zrender/Storage",["require","./tool/util","./Group"],function(e){"use strict";function t(e,t){return e.zlevel==t.zlevel?e.z==t.z?e.__renderidx-t.__renderidx:e.z-t.z:e.zlevel-t.zlevel}var n=e("./tool/util"),i=e("./Group"),a={hover:!1,normal:"down",update:!1},o=function(){this._elements={},this._hoverElements=[],this._roots=[],this._shapeList=[],this._shapeListOffset=0};return o.prototype.iterShape=function(e,t){if(t||(t=a),t.hover)for(var n=0,i=this._hoverElements.length;i>n;n++){var o=this._hoverElements[n];if(o.updateTransform(),e(o))return this}switch(t.update&&this.updateShapeList(),t.normal){case"down":for(var i=this._shapeList.length;i--;)if(e(this._shapeList[i]))return this;break;default:for(var n=0,i=this._shapeList.length;i>n;n++)if(e(this._shapeList[n]))return this}return this},o.prototype.getHoverShapes=function(e){for(var n=[],i=0,a=this._hoverElements.length;a>i;i++){n.push(this._hoverElements[i]);var o=this._hoverElements[i].hoverConnect;if(o){var r;o=o instanceof Array?o:[o];for(var s=0,l=o.length;l>s;s++)r=o[s].id?o[s]:this.get(o[s]),r&&n.push(r)}}if(n.sort(t),e)for(var i=0,a=n.length;a>i;i++)n[i].updateTransform();return n},o.prototype.getShapeList=function(e){return e&&this.updateShapeList(),this._shapeList},o.prototype.updateShapeList=function(){this._shapeListOffset=0;for(var e=0,n=this._roots.length;n>e;e++){var i=this._roots[e];this._updateAndAddShape(i)}this._shapeList.length=this._shapeListOffset;for(var e=0,n=this._shapeList.length;n>e;e++)this._shapeList[e].__renderidx=e;this._shapeList.sort(t)},o.prototype._updateAndAddShape=function(e,t){if(!e.ignore)if(e.updateTransform(),"group"==e.type){e.clipShape&&(e.clipShape.parent=e,e.clipShape.updateTransform(),t?(t=t.slice(),t.push(e.clipShape)):t=[e.clipShape]);for(var n=0;n0},o.prototype.addRoot=function(e){e instanceof i&&e.addChildrenToStorage(this),this.addToMap(e),this._roots.push(e)},o.prototype.delRoot=function(e){if("undefined"==typeof e){for(var t=0;tt;t++)this.delRoot(e[t]);else{var r;r="string"==typeof e?this._elements[e]:e;var s=n.indexOf(this._roots,r);s>=0&&(this.delFromMap(r.id),this._roots.splice(s,1),r instanceof i&&r.delChildrenFromStorage(this))}},o.prototype.addToMap=function(e){return e instanceof i&&(e._storage=this),e.modSelf(),this._elements[e.id]=e,this},o.prototype.get=function(e){return this._elements[e]},o.prototype.delFromMap=function(e){var t=this._elements[e];return t&&(delete this._elements[e],t instanceof i&&(t._storage=null)),this},o.prototype.dispose=function(){this._elements=this._renderList=this._roots=this._hoverElements=null},o}),n("zrender/animation/Animation",["require","./Clip","../tool/color","../tool/util","../tool/event"],function(e){"use strict";function t(e,t){return e[t]}function n(e,t,n){e[t]=n}function i(e,t,n){return(t-e)*n+e}function a(e,t,n,a,o){var r=e.length;if(1==o)for(var s=0;r>s;s++)a[s]=i(e[s],t[s],n);else for(var l=e[0].length,s=0;r>s;s++)for(var h=0;l>h;h++)a[s][h]=i(e[s][h],t[s][h],n)}function o(e){switch(typeof e){case"undefined":case"string":return!1}return"undefined"!=typeof e.length}function r(e,t,n,i,a,o,r,l,h){var m=e.length;if(1==h)for(var V=0;m>V;V++)l[V]=s(e[V],t[V],n[V],i[V],a,o,r);else for(var U=e[0].length,V=0;m>V;V++)for(var d=0;U>d;d++)l[V][d]=s(e[V][d],t[V][d],n[V][d],i[V][d],a,o,r)}function s(e,t,n,i,a,o,r){var s=.5*(n-e),l=.5*(i-t);return(2*(t-n)+s+l)*r+(-3*(t-n)-2*s-l)*o+s*a+t}function l(e){if(o(e)){var t=e.length;if(o(e[0])){for(var n=[],i=0;t>i;i++)n.push(c.call(e[i]));return n}return c.call(e)}return e}function h(e){return e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.floor(e[2]),"rgba("+e.join(",")+")"}var m=e("./Clip"),V=e("../tool/color"),U=e("../tool/util"),d=e("../tool/event").Dispatcher,p=window.requestAnimationFrame||window.msRequestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(e){setTimeout(e,16)},c=Array.prototype.slice,u=function(e){e=e||{},this.stage=e.stage||{},this.onframe=e.onframe||function(){},this._clips=[],this._running=!1,this._time=0,d.call(this)};u.prototype={add:function(e){this._clips.push(e)},remove:function(e){var t=U.indexOf(this._clips,e);t>=0&&this._clips.splice(t,1)},_update:function(){for(var e=(new Date).getTime(),t=e-this._time,n=this._clips,i=n.length,a=[],o=[],r=0;i>r;r++){var s=n[r],l=s.step(e);l&&(a.push(l),o.push(s))}for(var r=0;i>r;)n[r]._needsRemove?(n[r]=n[i-1],n.pop(),i--):r++;i=a.length;for(var r=0;i>r;r++)o[r].fire(a[r]);this._time=e,this.onframe(t),this.dispatch("frame",t),this.stage.update&&this.stage.update()},start:function(){function e(){t._running&&(t._update(),p(e))}var t=this;this._running=!0,this._time=(new Date).getTime(),p(e)},stop:function(){this._running=!1},clear:function(){this._clips=[]},animate:function(e,t){t=t||{};var n=new y(e,t.loop,t.getter,t.setter);return n.animation=this,n},constructor:u},U.merge(u.prototype,d.prototype,!0);var y=function(e,i,a,o){this._tracks={},this._target=e,this._loop=i||!1,this._getter=a||t,this._setter=o||n,this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[]};return y.prototype={when:function(e,t){for(var n in t)this._tracks[n]||(this._tracks[n]=[],0!==e&&this._tracks[n].push({time:0,value:l(this._getter(this._target,n))})),this._tracks[n].push({time:parseInt(e,10),value:t[n]});return this},during:function(e){return this._onframeList.push(e),this},start:function(e){var t=this,n=this._setter,l=this._getter,U="spline"===e,d=function(){if(t._clipCount--,0===t._clipCount){t._tracks={};for(var e=t._doneList.length,n=0;e>n;n++)t._doneList[n].call(t)}},p=function(p,c){var u=p.length;if(u){var y=p[0].value,g=o(y),b=!1,f=g&&o(y[0])?2:1;p.sort(function(e,t){return e.time-t.time});var k;if(u){k=p[u-1].time;for(var x=[],_=[],L=0;u>L;L++){x.push(p[L].time/k);var W=p[L].value;"string"==typeof W&&(W=V.toArray(W),0===W.length&&(W[0]=W[1]=W[2]=0,W[3]=1),b=!0),_.push(W)}var X,L,K,w,I,v,J,C=0,S=0;if(b)var E=[0,0,0,0];var F=function(e,o){if(S>o){for(X=Math.min(C+1,u-1),L=X;L>=0&&!(x[L]<=o);L--);L=Math.min(L,u-2)}else{for(L=C;u>L&&!(x[L]>o);L++);L=Math.min(L-1,u-2)}C=L,S=o;var m=x[L+1]-x[L];if(0!==m){if(K=(o-x[L])/m,U)if(I=_[L],w=_[0===L?L:L-1],v=_[L>u-2?u-1:L+1],J=_[L>u-3?u-1:L+2],g)r(w,I,v,J,K,K*K,K*K*K,l(e,c),f);else{var V;b?(V=r(w,I,v,J,K,K*K,K*K*K,E,1),V=h(E)):V=s(w,I,v,J,K,K*K,K*K*K),n(e,c,V)}else if(g)a(_[L],_[L+1],K,l(e,c),f);else{var V;b?(a(_[L],_[L+1],K,E,1),V=h(E)):V=i(_[L],_[L+1],K),n(e,c,V)}for(L=0;L=t[1]&&(e=t[1]),e},t.prototype.getLocation=function(e,t,n){var i=null!=e.x?e.x:"center";switch(i){case"center":i=Math.floor((this.canvasWidth-t)/2);break;case"left":i=0;break;case"right":i=this.canvasWidth-t}var a=null!=e.y?e.y:"center";switch(a){case"center":a=Math.floor((this.canvasHeight-n)/2);break;case"top":a=0;break;case"bottom":a=this.canvasHeight-n}return{x:i,y:a,width:t,height:n}},t}),n("zrender/Layer",["require","./mixin/Transformable","./tool/util","./config"],function(e){function t(){return!1}function n(e,t,n){var i=document.createElement(t),a=n.getWidth(),o=n.getHeight();return i.style.position="absolute",i.style.left=0,i.style.top=0,i.style.width=a+"px",i.style.height=o+"px",i.width=a*r.devicePixelRatio,i.height=o*r.devicePixelRatio,i.setAttribute("data-zr-dom-id",e),i}var i=e("./mixin/Transformable"),a=e("./tool/util"),o=window.G_vmlCanvasManager,r=e("./config"),s=function(e,a){this.id=e,this.dom=n(e,"canvas",a),this.dom.onselectstart=t,this.dom.style["-webkit-user-select"]="none",this.dom.style["user-select"]="none",this.dom.style["-webkit-touch-callout"]="none",this.dom.style["-webkit-tap-highlight-color"]="rgba(0,0,0,0)",o&&o.initElement(this.dom),this.domBack=null,this.ctxBack=null,this.painter=a,this.unusedCount=0,this.config=null,this.dirty=!0,this.elCount=0,this.clearColor=0,this.motionBlur=!1,this.lastFrameAlpha=.7,this.zoomable=!1,this.panable=!1,this.maxZoom=1/0,this.minZoom=0,i.call(this)};return s.prototype.initContext=function(){this.ctx=this.dom.getContext("2d");var e=r.devicePixelRatio;1!=e&&this.ctx.scale(e,e)},s.prototype.createBackBuffer=function(){if(!o){this.domBack=n("back-"+this.id,"canvas",this.painter),this.ctxBack=this.domBack.getContext("2d");var e=r.devicePixelRatio;1!=e&&this.ctxBack.scale(e,e)}},s.prototype.resize=function(e,t){var n=r.devicePixelRatio;this.dom.style.width=e+"px",this.dom.style.height=t+"px",this.dom.setAttribute("width",e*n),this.dom.setAttribute("height",t*n),1!=n&&this.ctx.scale(n,n),this.domBack&&(this.domBack.setAttribute("width",e*n),this.domBack.setAttribute("height",t*n),1!=n&&this.ctxBack.scale(n,n))},s.prototype.clear=function(){var e=this.dom,t=this.ctx,n=e.width,i=e.height,a=this.clearColor&&!o,s=this.motionBlur&&!o,l=this.lastFrameAlpha,h=r.devicePixelRatio;if(s&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(e,0,0,n/h,i/h)),t.clearRect(0,0,n/h,i/h),a&&(t.save(),t.fillStyle=this.clearColor,t.fillRect(0,0,n/h,i/h),t.restore()),s){var m=this.domBack;t.save(),t.globalAlpha=l,t.drawImage(m,0,0,n/h,i/h),t.restore()}},a.merge(s.prototype,i.prototype),s}),n("zrender/shape/Text",["require","../tool/area","./Base","../tool/util"],function(e){var t=e("../tool/area"),n=e("./Base"),i=function(e){n.call(this,e)};return i.prototype={type:"text",brush:function(e,n){var i=this.style;if(n&&(i=this.getHighlightStyle(i,this.highlightStyle||{})),"undefined"!=typeof i.text&&i.text!==!1){e.save(),this.doClip(e),this.setContext(e,i),this.setTransform(e),i.textFont&&(e.font=i.textFont),e.textAlign=i.textAlign||"start",e.textBaseline=i.textBaseline||"middle";var a,o=(i.text+"").split("\n"),r=t.getTextHeight("国",i.textFont),s=this.getRect(i),l=i.x;a="top"==i.textBaseline?s.y:"bottom"==i.textBaseline?s.y+r:s.y+r/2;for(var h=0,m=o.length;m>h;h++){if(i.maxWidth)switch(i.brushType){case"fill":e.fillText(o[h],l,a,i.maxWidth);break;case"stroke":e.strokeText(o[h],l,a,i.maxWidth);break;case"both":e.fillText(o[h],l,a,i.maxWidth),e.strokeText(o[h],l,a,i.maxWidth);break;default:e.fillText(o[h],l,a,i.maxWidth)}else switch(i.brushType){case"fill":e.fillText(o[h],l,a);break;case"stroke":e.strokeText(o[h],l,a);break;case"both":e.fillText(o[h],l,a),e.strokeText(o[h],l,a);break;default:e.fillText(o[h],l,a)}a+=r}e.restore()}},getRect:function(e){if(e.__rect)return e.__rect;var n=t.getTextWidth(e.text,e.textFont),i=t.getTextHeight(e.text,e.textFont),a=e.x;"end"==e.textAlign||"right"==e.textAlign?a-=n:"center"==e.textAlign&&(a-=n/2);var o;return o="top"==e.textBaseline?e.y:"bottom"==e.textBaseline?e.y-i:e.y-i/2,e.__rect={x:a,y:o,width:n,height:i},e.__rect +}},e("../tool/util").inherits(i,n),i}),n("zrender/shape/Rectangle",["require","./Base","../tool/util"],function(e){var t=e("./Base"),n=function(e){t.call(this,e)};return n.prototype={type:"rectangle",_buildRadiusPath:function(e,t){var n,i,a,o,r=t.x,s=t.y,l=t.width,h=t.height,m=t.radius;"number"==typeof m?n=i=a=o=m:m instanceof Array?1===m.length?n=i=a=o=m[0]:2===m.length?(n=a=m[0],i=o=m[1]):3===m.length?(n=m[0],i=o=m[1],a=m[2]):(n=m[0],i=m[1],a=m[2],o=m[3]):n=i=a=o=0;var V;n+i>l&&(V=n+i,n*=l/V,i*=l/V),a+o>l&&(V=a+o,a*=l/V,o*=l/V),i+a>h&&(V=i+a,i*=h/V,a*=h/V),n+o>h&&(V=n+o,n*=h/V,o*=h/V),e.moveTo(r+n,s),e.lineTo(r+l-i,s),0!==i&&e.quadraticCurveTo(r+l,s,r+l,s+i),e.lineTo(r+l,s+h-a),0!==a&&e.quadraticCurveTo(r+l,s+h,r+l-a,s+h),e.lineTo(r+o,s+h),0!==o&&e.quadraticCurveTo(r,s+h,r,s+h-o),e.lineTo(r,s+n),0!==n&&e.quadraticCurveTo(r,s,r+n,s)},buildPath:function(e,t){t.radius?this._buildRadiusPath(e,t):(e.moveTo(t.x,t.y),e.lineTo(t.x+t.width,t.y),e.lineTo(t.x+t.width,t.y+t.height),e.lineTo(t.x,t.y+t.height),e.lineTo(t.x,t.y)),e.closePath()},getRect:function(e){if(e.__rect)return e.__rect;var t;return t="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0,e.__rect={x:Math.round(e.x-t/2),y:Math.round(e.y-t/2),width:e.width+t,height:e.height+t},e.__rect}},e("../tool/util").inherits(n,t),n}),n("zrender/tool/area",["require","./util","./curve"],function(e){"use strict";function t(e){return e%=C,0>e&&(e+=C),e}function n(e,t,n,o){if(!t||!e)return!1;var r=e.type;L=L||W.getContext();var s=i(e,t,n,o);if("undefined"!=typeof s)return s;if(e.buildPath&&L.isPointInPath)return a(e,L,t,n,o);switch(r){case"ellipse":return!0;case"trochoid":var l="out"==t.location?t.r1+t.r2+t.d:t.r1-t.r2+t.d;return d(t,n,o,l);case"rose":return d(t,n,o,t.maxr);default:return!1}}function i(e,t,n,i){var a=e.type;switch(a){case"bezier-curve":return"undefined"==typeof t.cpX2?l(t.xStart,t.yStart,t.cpX1,t.cpY1,t.xEnd,t.yEnd,t.lineWidth,n,i):s(t.xStart,t.yStart,t.cpX1,t.cpY1,t.cpX2,t.cpY2,t.xEnd,t.yEnd,t.lineWidth,n,i);case"line":return r(t.xStart,t.yStart,t.xEnd,t.yEnd,t.lineWidth,n,i);case"polyline":return m(t.pointList,t.lineWidth,n,i);case"ring":return V(t.x,t.y,t.r0,t.r,n,i);case"circle":return d(t.x,t.y,t.r,n,i);case"sector":var o=t.startAngle*Math.PI/180,h=t.endAngle*Math.PI/180;return t.clockWise||(o=-o,h=-h),p(t.x,t.y,t.r0,t.r,o,h,!t.clockWise,n,i);case"path":return t.pathArray&&k(t.pathArray,Math.max(t.lineWidth,5),t.brushType,n,i);case"polygon":case"star":case"isogon":return c(t.pointList,n,i);case"text":var u=t.__rect||e.getRect(t);return U(u.x,u.y,u.width,u.height,n,i);case"rectangle":case"image":return U(t.x,t.y,t.width,t.height,n,i)}}function a(e,t,n,i,a){return t.beginPath(),e.buildPath(t,n),t.closePath(),t.isPointInPath(i,a)}function o(e,t,i,a){return!n(e,t,i,a)}function r(e,t,n,i,a,o,r){if(0===a)return!1;var s=Math.max(a,5),l=0,h=e;if(r>t+s&&r>i+s||t-s>r&&i-s>r||o>e+s&&o>n+s||e-s>o&&n-s>o)return!1;if(e===n)return Math.abs(o-e)<=s/2;l=(t-i)/(e-n),h=(e*i-n*t)/(e-n);var m=l*o-r+h,V=m*m/(l*l+1);return s/2*s/2>=V}function s(e,t,n,i,a,o,r,s,l,h,m){if(0===l)return!1;var V=Math.max(l,5);if(m>t+V&&m>i+V&&m>o+V&&m>s+V||t-V>m&&i-V>m&&o-V>m&&s-V>m||h>e+V&&h>n+V&&h>a+V&&h>r+V||e-V>h&&n-V>h&&a-V>h&&r-V>h)return!1;var U=X.cubicProjectPoint(e,t,n,i,a,o,r,s,h,m,null);return V/2>=U}function l(e,t,n,i,a,o,r,s,l){if(0===r)return!1;var h=Math.max(r,5);if(l>t+h&&l>i+h&&l>o+h||t-h>l&&i-h>l&&o-h>l||s>e+h&&s>n+h&&s>a+h||e-h>s&&n-h>s&&a-h>s)return!1;var m=X.quadraticProjectPoint(e,t,n,i,a,o,s,l,null);return h/2>=m}function h(e,n,i,a,o,r,s,l,h){if(0===s)return!1;var m=Math.max(s,5);l-=e,h-=n;var V=Math.sqrt(l*l+h*h);if(V-m>i||i>V+m)return!1;if(Math.abs(a-o)>=C)return!0;if(r){var U=a;a=t(o),o=t(U)}else a=t(a),o=t(o);a>o&&(o+=C);var d=Math.atan2(h,l);return 0>d&&(d+=C),d>=a&&o>=d||d+C>=a&&o>=d+C}function m(e,t,n,i){for(var t=Math.max(t,10),a=0,o=e.length-1;o>a;a++){var s=e[a][0],l=e[a][1],h=e[a+1][0],m=e[a+1][1];if(r(s,l,h,m,t,n,i))return!0}return!1}function V(e,t,n,i,a,o){var r=(a-e)*(a-e)+(o-t)*(o-t);return i*i>r&&r>n*n}function U(e,t,n,i,a,o){return a>=e&&e+n>=a&&o>=t&&t+i>=o}function d(e,t,n,i,a){return n*n>(i-e)*(i-e)+(a-t)*(a-t)}function p(e,t,n,i,a,o,r,s,l){return h(e,t,(n+i)/2,a,o,r,i-n,s,l)}function c(e,t,n){for(var i=e.length,a=0,o=0,r=i-1;i>o;o++){var s=e[r][0],l=e[r][1],h=e[o][0],m=e[o][1];a+=u(s,l,h,m,t,n),r=o}return 0!==a}function u(e,t,n,i,a,o){if(o>t&&o>i||t>o&&i>o)return 0;if(i==t)return 0;var r=t>i?1:-1,s=(o-t)/(i-t),l=s*(n-e)+e;return l>a?r:0}function y(){var e=E[0];E[0]=E[1],E[1]=e}function g(e,t,n,i,a,o,r,s,l,h){if(h>t&&h>i&&h>o&&h>s||t>h&&i>h&&o>h&&s>h)return 0;var m=X.cubicRootAt(t,i,o,s,h,S);if(0===m)return 0;for(var V,U,d=0,p=-1,c=0;m>c;c++){var u=S[c],g=X.cubicAt(e,n,a,r,u);l>g||(0>p&&(p=X.cubicExtrema(t,i,o,s,E),E[1]1&&y(),V=X.cubicAt(t,i,o,s,E[0]),p>1&&(U=X.cubicAt(t,i,o,s,E[1]))),d+=2==p?uV?1:-1:uU?1:-1:U>s?1:-1:uV?1:-1:V>s?1:-1)}return d}function b(e,t,n,i,a,o,r,s){if(s>t&&s>i&&s>o||t>s&&i>s&&o>s)return 0;var l=X.quadraticRootAt(t,i,o,s,S);if(0===l)return 0;var h=X.quadraticExtremum(t,i,o);if(h>=0&&1>=h){for(var m=0,V=X.quadraticAt(t,i,o,h),U=0;l>U;U++){var d=X.quadraticAt(e,n,a,S[U]);d>r||(m+=S[U]V?1:-1:V>o?1:-1)}return m}var d=X.quadraticAt(e,n,a,S[0]);return d>r?0:t>o?1:-1}function f(e,n,i,a,o,r,s,l){if(l-=n,l>i||-i>l)return 0;var h=Math.sqrt(i*i-l*l);if(S[0]=-h,S[1]=h,Math.abs(a-o)>=C){a=0,o=C;var m=r?1:-1;return s>=S[0]+e&&s<=S[1]+e?m:0}if(r){var h=a;a=t(o),o=t(h)}else a=t(a),o=t(o);a>o&&(o+=C);for(var V=0,U=0;2>U;U++){var d=S[U];if(d+e>s){var p=Math.atan2(l,d),m=r?1:-1;0>p&&(p=C+p),(p>=a&&o>=p||p+C>=a&&o>=p+C)&&(p>Math.PI/2&&p<1.5*Math.PI&&(m=-m),V+=m)}}return V}function k(e,t,n,i,a){var o=0,m=0,V=0,U=0,d=0,p=!0,c=!0;n=n||"fill";for(var y="stroke"===n||"both"===n,k="fill"===n||"both"===n,x=0;x0&&(k&&(o+=u(m,V,U,d,i,a)),0!==o))return!0;U=L[L.length-2],d=L[L.length-1],p=!1,c&&"A"!==_.command&&(c=!1,m=U,V=d)}switch(_.command){case"M":m=L[0],V=L[1];break;case"L":if(y&&r(m,V,L[0],L[1],t,i,a))return!0;k&&(o+=u(m,V,L[0],L[1],i,a)),m=L[0],V=L[1];break;case"C":if(y&&s(m,V,L[0],L[1],L[2],L[3],L[4],L[5],t,i,a))return!0;k&&(o+=g(m,V,L[0],L[1],L[2],L[3],L[4],L[5],i,a)),m=L[4],V=L[5];break;case"Q":if(y&&l(m,V,L[0],L[1],L[2],L[3],t,i,a))return!0;k&&(o+=b(m,V,L[0],L[1],L[2],L[3],i,a)),m=L[2],V=L[3];break;case"A":var W=L[0],X=L[1],K=L[2],w=L[3],I=L[4],v=L[5],J=Math.cos(I)*K+W,C=Math.sin(I)*w+X;c?(c=!1,U=J,d=C):o+=u(m,V,J,C);var S=(i-W)*w/K+W;if(y&&h(W,X,w,I,I+v,1-L[7],t,S,a))return!0;k&&(o+=f(W,X,w,I,I+v,1-L[7],S,a)),m=Math.cos(I+v)*K+W,V=Math.sin(I+v)*w+X;break;case"z":if(y&&r(m,V,U,d,t,i,a))return!0;p=!0}}return k&&(o+=u(m,V,U,d,i,a)),0!==o}function x(e,t){var n=e+":"+t;if(K[n])return K[n];L=L||W.getContext(),L.save(),t&&(L.font=t),e=(e+"").split("\n");for(var i=0,a=0,o=e.length;o>a;a++)i=Math.max(L.measureText(e[a]).width,i);return L.restore(),K[n]=i,++I>J&&(I=0,K={}),i}function _(e,t){var n=e+":"+t;if(w[n])return w[n];L=L||W.getContext(),L.save(),t&&(L.font=t),e=(e+"").split("\n");var i=(L.measureText("国").width+2)*e.length;return L.restore(),w[n]=i,++v>J&&(v=0,w={}),i}var L,W=e("./util"),X=e("./curve"),K={},w={},I=0,v=0,J=5e3,C=2*Math.PI,S=[-1,-1,-1],E=[-1,-1];return{isInside:n,isOutside:o,getTextWidth:x,getTextHeight:_,isInsidePath:k,isInsidePolygon:c,isInsideSector:p,isInsideCircle:d,isInsideLine:r,isInsideRect:U,isInsidePolyline:m,isInsideCubicStroke:s,isInsideQuadraticStroke:l}}),n("zrender/shape/Base",["require","../tool/matrix","../tool/guid","../tool/util","../tool/log","../mixin/Transformable","../mixin/Eventful","../tool/area","../tool/color"],function(e){function t(t,i,a,o,r,s,l){r&&(t.font=r),t.textAlign=s,t.textBaseline=l;var h=n(i,a,o,r,s,l);i=(i+"").split("\n");var m=e("../tool/area").getTextHeight("国",r);switch(l){case"top":o=h.y;break;case"bottom":o=h.y+m;break;default:o=h.y+m/2}for(var V=0,U=i.length;U>V;V++)t.fillText(i[V],a,o),o+=m}function n(t,n,i,a,o,r){var s=e("../tool/area"),l=s.getTextWidth(t,a),h=s.getTextHeight("国",a);switch(t=(t+"").split("\n"),o){case"end":case"right":n-=l;break;case"center":n-=l/2}switch(r){case"top":break;case"bottom":i-=h*t.length;break;default:i-=h*t.length/2}return{x:n,y:i,width:l,height:h*t.length}}var i=window.G_vmlCanvasManager,a=e("../tool/matrix"),o=e("../tool/guid"),r=e("../tool/util"),s=e("../tool/log"),l=e("../mixin/Transformable"),h=e("../mixin/Eventful"),m=function(e){e=e||{},this.id=e.id||o();for(var t in e)this[t]=e[t];this.style=this.style||{},this.highlightStyle=this.highlightStyle||null,this.parent=null,this.__dirty=!0,this.__clipShapes=[],l.call(this),h.call(this)};m.prototype.invisible=!1,m.prototype.ignore=!1,m.prototype.zlevel=0,m.prototype.draggable=!1,m.prototype.clickable=!1,m.prototype.hoverable=!0,m.prototype.z=0,m.prototype.brush=function(e,t){var n=this.beforeBrush(e,t);switch(e.beginPath(),this.buildPath(e,n),n.brushType){case"both":e.fill();case"stroke":n.lineWidth>0&&e.stroke();break;default:e.fill()}this.drawText(e,n,this.style),this.afterBrush(e)},m.prototype.beforeBrush=function(e,t){var n=this.style;return this.brushTypeOnly&&(n.brushType=this.brushTypeOnly),t&&(n=this.getHighlightStyle(n,this.highlightStyle||{},this.brushTypeOnly)),"stroke"==this.brushTypeOnly&&(n.strokeColor=n.strokeColor||n.color),e.save(),this.doClip(e),this.setContext(e,n),this.setTransform(e),n},m.prototype.afterBrush=function(e){e.restore()};var V=[["color","fillStyle"],["strokeColor","strokeStyle"],["opacity","globalAlpha"],["lineCap","lineCap"],["lineJoin","lineJoin"],["miterLimit","miterLimit"],["lineWidth","lineWidth"],["shadowBlur","shadowBlur"],["shadowColor","shadowColor"],["shadowOffsetX","shadowOffsetX"],["shadowOffsetY","shadowOffsetY"]];m.prototype.setContext=function(e,t){for(var n=0,i=V.length;i>n;n++){var a=V[n][0],o=t[a],r=V[n][1];"undefined"!=typeof o&&(e[r]=o)}};var U=a.create();return m.prototype.doClip=function(e){if(this.__clipShapes&&!i)for(var t=0;t=a.x&&t<=a.x+a.width&&n>=a.y&&n<=a.y+a.height?e("../tool/area").isInside(this,this.style,t,n):!1},m.prototype.drawText=function(e,n,i){if("undefined"!=typeof n.text&&n.text!==!1){var a=n.textColor||n.color||n.strokeColor;e.fillStyle=a;var o,r,s,l,h=10,m=n.textPosition||this.textPosition||"top";switch(m){case"inside":case"top":case"bottom":case"left":case"right":if(this.getRect){var V=(i||n).__rect||this.getRect(i||n);switch(m){case"inside":s=V.x+V.width/2,l=V.y+V.height/2,o="center",r="middle","stroke"!=n.brushType&&a==n.color&&(e.fillStyle="#fff");break;case"left":s=V.x-h,l=V.y+V.height/2,o="end",r="middle";break;case"right":s=V.x+V.width+h,l=V.y+V.height/2,o="start",r="middle";break;case"top":s=V.x+V.width/2,l=V.y-h,o="center",r="bottom";break;case"bottom":s=V.x+V.width/2,l=V.y+V.height+h,o="center",r="top"}}break;case"start":case"end":var U=n.pointList||[[n.xStart||0,n.yStart||0],[n.xEnd||0,n.yEnd||0]],d=U.length;if(2>d)return;var p,c,u,y;switch(m){case"start":p=U[1][0],c=U[0][0],u=U[1][1],y=U[0][1];break;case"end":p=U[d-2][0],c=U[d-1][0],u=U[d-2][1],y=U[d-1][1]}s=c,l=y;var g=Math.atan((u-y)/(c-p))/Math.PI*180;0>c-p?g+=180:0>u-y&&(g+=360),h=5,g>=30&&150>=g?(o="center",r="bottom",l-=h):g>150&&210>g?(o="right",r="middle",s-=h):g>=210&&330>=g?(o="center",r="top",l+=h):(o="left",r="middle",s+=h);break;case"specific":s=n.textX||0,l=n.textY||0,o="start",r="middle"}null!=s&&null!=l&&t(e,n.text,s,l,n.textFont,n.textAlign||o,n.textBaseline||r)}},m.prototype.modSelf=function(){this.__dirty=!0,this.style&&(this.style.__rect=null),this.highlightStyle&&(this.highlightStyle.__rect=null)},m.prototype.isSilent=function(){return!(this.hoverable||this.draggable||this.clickable||this.onmousemove||this.onmouseover||this.onmouseout||this.onmousedown||this.onmouseup||this.onclick||this.ondragenter||this.ondragover||this.ondragleave||this.ondrop)},r.merge(m.prototype,l.prototype,!0),r.merge(m.prototype,h.prototype,!0),m}),n("zrender/tool/curve",["require","./vector"],function(e){function t(e){return e>-c&&c>e}function n(e){return e>c||-c>e}function i(e,t,n,i,a){var o=1-a;return o*o*(o*e+3*a*t)+a*a*(a*i+3*o*n)}function a(e,t,n,i,a){var o=1-a;return 3*(((t-e)*o+2*(n-t)*a)*o+(i-n)*a*a)}function o(e,n,i,a,o,r){var s=a+3*(n-i)-e,l=3*(i-2*n+e),h=3*(n-e),m=e-o,V=l*l-3*s*h,U=l*h-9*s*m,d=h*h-3*l*m,p=0;if(t(V)&&t(U))if(t(l))r[0]=0;else{var c=-h/l;c>=0&&1>=c&&(r[p++]=c)}else{var g=U*U-4*V*d;if(t(g)){var b=U/V,c=-l/s+b,f=-b/2;c>=0&&1>=c&&(r[p++]=c),f>=0&&1>=f&&(r[p++]=f)}else if(g>0){var k=Math.sqrt(g),x=V*l+1.5*s*(-U+k),_=V*l+1.5*s*(-U-k);x=0>x?-Math.pow(-x,y):Math.pow(x,y),_=0>_?-Math.pow(-_,y):Math.pow(_,y);var c=(-l-(x+_))/(3*s);c>=0&&1>=c&&(r[p++]=c)}else{var L=(2*V*l-3*s*U)/(2*Math.sqrt(V*V*V)),W=Math.acos(L)/3,X=Math.sqrt(V),K=Math.cos(W),c=(-l-2*X*K)/(3*s),f=(-l+X*(K+u*Math.sin(W)))/(3*s),w=(-l+X*(K-u*Math.sin(W)))/(3*s);c>=0&&1>=c&&(r[p++]=c),f>=0&&1>=f&&(r[p++]=f),w>=0&&1>=w&&(r[p++]=w)}}return p}function r(e,i,a,o,r){var s=6*a-12*i+6*e,l=9*i+3*o-3*e-9*a,h=3*i-3*e,m=0;if(t(l)){if(n(s)){var V=-h/s;V>=0&&1>=V&&(r[m++]=V)}}else{var U=s*s-4*l*h;if(t(U))r[0]=-s/(2*l);else if(U>0){var d=Math.sqrt(U),V=(-s+d)/(2*l),p=(-s-d)/(2*l);V>=0&&1>=V&&(r[m++]=V),p>=0&&1>=p&&(r[m++]=p)}}return m}function s(e,t,n,i,a,o){var r=(t-e)*a+e,s=(n-t)*a+t,l=(i-n)*a+n,h=(s-r)*a+r,m=(l-s)*a+s,V=(m-h)*a+h;o[0]=e,o[1]=r,o[2]=h,o[3]=V,o[4]=V,o[5]=m,o[6]=l,o[7]=i}function l(e,t,n,a,o,r,s,l,h,m,V){var U,d=.005,u=1/0;g[0]=h,g[1]=m;for(var y=0;1>y;y+=.05){b[0]=i(e,n,o,s,y),b[1]=i(t,a,r,l,y);var k=p.distSquare(g,b);u>k&&(U=y,u=k)}u=1/0;for(var x=0;32>x&&!(c>d);x++){var _=U-d,L=U+d;b[0]=i(e,n,o,s,_),b[1]=i(t,a,r,l,_);var k=p.distSquare(b,g);if(_>=0&&u>k)U=_,u=k;else{f[0]=i(e,n,o,s,L),f[1]=i(t,a,r,l,L);var W=p.distSquare(f,g);1>=L&&u>W?(U=L,u=W):d*=.5}}return V&&(V[0]=i(e,n,o,s,U),V[1]=i(t,a,r,l,U)),Math.sqrt(u)}function h(e,t,n,i){var a=1-i;return a*(a*e+2*i*t)+i*i*n}function m(e,t,n,i){return 2*((1-i)*(t-e)+i*(n-t))}function V(e,i,a,o,r){var s=e-2*i+a,l=2*(i-e),h=e-o,m=0;if(t(s)){if(n(l)){var V=-h/l;V>=0&&1>=V&&(r[m++]=V)}}else{var U=l*l-4*s*h;if(t(U)){var V=-l/(2*s);V>=0&&1>=V&&(r[m++]=V)}else if(U>0){var d=Math.sqrt(U),V=(-l+d)/(2*s),p=(-l-d)/(2*s);V>=0&&1>=V&&(r[m++]=V),p>=0&&1>=p&&(r[m++]=p)}}return m}function U(e,t,n){var i=e+n-2*t;return 0===i?.5:(e-t)/i}function d(e,t,n,i,a,o,r,s,l){var m,V=.005,U=1/0;g[0]=r,g[1]=s;for(var d=0;1>d;d+=.05){b[0]=h(e,n,a,d),b[1]=h(t,i,o,d);var u=p.distSquare(g,b);U>u&&(m=d,U=u)}U=1/0;for(var y=0;32>y&&!(c>V);y++){var k=m-V,x=m+V;b[0]=h(e,n,a,k),b[1]=h(t,i,o,k);var u=p.distSquare(b,g);if(k>=0&&U>u)m=k,U=u;else{f[0]=h(e,n,a,x),f[1]=h(t,i,o,x);var _=p.distSquare(f,g);1>=x&&U>_?(m=x,U=_):V*=.5}}return l&&(l[0]=h(e,n,a,m),l[1]=h(t,i,o,m)),Math.sqrt(U)}var p=e("./vector"),c=1e-4,u=Math.sqrt(3),y=1/3,g=p.create(),b=p.create(),f=p.create();return{cubicAt:i,cubicDerivativeAt:a,cubicRootAt:o,cubicExtrema:r,cubicSubdivide:s,cubicProjectPoint:l,quadraticAt:h,quadraticDerivativeAt:m,quadraticRootAt:V,quadraticExtremum:U,quadraticProjectPoint:d}}),n("zrender/mixin/Transformable",["require","../tool/matrix","../tool/vector"],function(e){"use strict";function t(e){return e>-r&&r>e}function n(e){return e>r||-r>e}var i=e("../tool/matrix"),a=e("../tool/vector"),o=[0,0],r=5e-5,s=function(){this.position||(this.position=[0,0]),"undefined"==typeof this.rotation&&(this.rotation=[0,0,0]),this.scale||(this.scale=[1,1,0,0]),this.needLocalTransform=!1,this.needTransform=!1};return s.prototype={constructor:s,updateNeedTransform:function(){this.needLocalTransform=n(this.rotation[0])||n(this.position[0])||n(this.position[1])||n(this.scale[0]-1)||n(this.scale[1]-1)},updateTransform:function(){if(this.updateNeedTransform(),this.needTransform=this.parent?this.needLocalTransform||this.parent.needTransform:this.needLocalTransform,this.needTransform){var e=this.transform||i.create();if(i.identity(e),this.needLocalTransform){if(n(this.scale[0])||n(this.scale[1])){o[0]=-this.scale[2]||0,o[1]=-this.scale[3]||0;var t=n(o[0])||n(o[1]);t&&i.translate(e,e,o),i.scale(e,e,this.scale),t&&(o[0]=-o[0],o[1]=-o[1],i.translate(e,e,o))}if(this.rotation instanceof Array){if(0!==this.rotation[0]){o[0]=-this.rotation[1]||0,o[1]=-this.rotation[2]||0;var t=n(o[0])||n(o[1]);t&&i.translate(e,e,o),i.rotate(e,e,this.rotation[0]),t&&(o[0]=-o[0],o[1]=-o[1],i.translate(e,e,o))}}else 0!==this.rotation&&i.rotate(e,e,this.rotation);(n(this.position[0])||n(this.position[1]))&&i.translate(e,e,this.position)}this.transform=e,this.parent&&this.parent.needTransform&&(this.needLocalTransform?i.mul(this.transform,this.parent.transform,this.transform):i.copy(this.transform,this.parent.transform))}},setTransform:function(e){if(this.needTransform){var t=this.transform;e.transform(t[0],t[1],t[2],t[3],t[4],t[5])}},lookAt:function(){var e=a.create();return function(n){this.transform||(this.transform=i.create());var o=this.transform;a.sub(e,n,this.position),t(e[0])&&t(e[1])||(a.normalize(e,e),o[2]=e[0]*this.scale[1],o[3]=e[1]*this.scale[1],o[0]=e[1]*this.scale[0],o[1]=-e[0]*this.scale[0],o[4]=this.position[0],o[5]=this.position[1],this.decomposeTransform())}}(),decomposeTransform:function(){if(this.transform){var e=this.transform,t=e[0]*e[0]+e[1]*e[1],i=this.position,a=this.scale,o=this.rotation;n(t-1)&&(t=Math.sqrt(t));var r=e[2]*e[2]+e[3]*e[3];n(r-1)&&(r=Math.sqrt(r)),i[0]=e[4],i[1]=e[5],a[0]=t,a[1]=r,a[2]=a[3]=0,o[0]=Math.atan2(-e[1]/r,e[0]/t),o[1]=o[2]=0}}},s}),n("zrender/Group",["require","./tool/guid","./tool/util","./mixin/Transformable","./mixin/Eventful"],function(e){var t=e("./tool/guid"),n=e("./tool/util"),i=e("./mixin/Transformable"),a=e("./mixin/Eventful"),o=function(e){e=e||{},this.id=e.id||t();for(var n in e)this[n]=e[n];this.type="group",this.clipShape=null,this._children=[],this._storage=null,this.__dirty=!0,i.call(this),a.call(this)};return o.prototype.ignore=!1,o.prototype.children=function(){return this._children.slice()},o.prototype.childAt=function(e){return this._children[e]},o.prototype.addChild=function(e){e!=this&&e.parent!=this&&(e.parent&&e.parent.removeChild(e),this._children.push(e),e.parent=this,this._storage&&this._storage!==e._storage&&(this._storage.addToMap(e),e instanceof o&&e.addChildrenToStorage(this._storage)))},o.prototype.removeChild=function(e){var t=n.indexOf(this._children,e);this._children.splice(t,1),e.parent=null,this._storage&&(this._storage.delFromMap(e.id),e instanceof o&&e.delChildrenFromStorage(this._storage))},o.prototype.clearChildren=function(){for(var e=0;et)){t=Math.min(t,1);var i="string"==typeof this.easing?n[this.easing]:this.easing,a="function"==typeof i?i(t):t;return this.fire("frame",a),1==t?this.loop?(this.restart(),"restart"):(this._needsRemove=!0,"destroy"):null}},restart:function(){var e=(new Date).getTime(),t=(e-this._startTime)%this._life;this._startTime=(new Date).getTime()-t+this.gap,this._needsRemove=!1},fire:function(e,t){for(var n=0,i=this._targetPool.length;i>n;n++)this["on"+e]&&this["on"+e](this._targetPool[n],t)},constructor:t},t}),n("zrender/animation/easing",[],function(){var e={Linear:function(e){return e},QuadraticIn:function(e){return e*e},QuadraticOut:function(e){return e*(2-e)},QuadraticInOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},CubicIn:function(e){return e*e*e},CubicOut:function(e){return--e*e*e+1},CubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},QuarticIn:function(e){return e*e*e*e},QuarticOut:function(e){return 1- --e*e*e*e},QuarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},QuinticIn:function(e){return e*e*e*e*e},QuinticOut:function(e){return--e*e*e*e*e+1},QuinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},SinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},SinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},SinusoidalInOut:function(e){return.5*(1-Math.cos(Math.PI*e))},ExponentialIn:function(e){return 0===e?0:Math.pow(1024,e-1)},ExponentialOut:function(e){return 1===e?1:1-Math.pow(2,-10*e)},ExponentialInOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)},CircularIn:function(e){return 1-Math.sqrt(1-e*e)},CircularOut:function(e){return Math.sqrt(1- --e*e)},CircularInOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},ElasticIn:function(e){var t,n=.1,i=.4;return 0===e?0:1===e?1:(!n||1>n?(n=1,t=i/4):t=i*Math.asin(1/n)/(2*Math.PI),-(n*Math.pow(2,10*(e-=1))*Math.sin(2*(e-t)*Math.PI/i)))},ElasticOut:function(e){var t,n=.1,i=.4;return 0===e?0:1===e?1:(!n||1>n?(n=1,t=i/4):t=i*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*e)*Math.sin(2*(e-t)*Math.PI/i)+1)},ElasticInOut:function(e){var t,n=.1,i=.4;return 0===e?0:1===e?1:(!n||1>n?(n=1,t=i/4):t=i*Math.asin(1/n)/(2*Math.PI),(e*=2)<1?-.5*n*Math.pow(2,10*(e-=1))*Math.sin(2*(e-t)*Math.PI/i):n*Math.pow(2,-10*(e-=1))*Math.sin(2*(e-t)*Math.PI/i)*.5+1)},BackIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},BackOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},BackInOut:function(e){var t=2.5949095;return(e*=2)<1?.5*e*e*((t+1)*e-t):.5*((e-=2)*e*((t+1)*e+t)+2)},BounceIn:function(t){return 1-e.BounceOut(1-t)},BounceOut:function(e){return 1/2.75>e?7.5625*e*e:2/2.75>e?7.5625*(e-=1.5/2.75)*e+.75:2.5/2.75>e?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},BounceInOut:function(t){return.5>t?.5*e.BounceIn(2*t):.5*e.BounceOut(2*t-1)+.5}};return e}),n("echarts/chart/base",["require","zrender/shape/Image","../util/shape/Icon","../util/shape/MarkLine","../util/shape/Symbol","../config","../util/ecData","../util/ecAnimation","../util/ecEffect","../util/accMath","../component/base","zrender/tool/util","zrender/tool/area"],function(e){function t(e,t,n,i,a){V.call(this,e,t,n,i,a);var o=this;this.selectedMap={},this.lastShapeList=[],this.shapeHandler={onclick:function(){o.isClick=!0},ondragover:function(e){var t=e.target;t.highlightStyle=t.highlightStyle||{};var n=t.highlightStyle,i=n.brushTyep,a=n.strokeColor,s=n.lineWidth;n.brushType="stroke",n.strokeColor=o.ecTheme.calculableColor||r.calculableColor,n.lineWidth="icon"===t.type?30:10,o.zr.addHoverShape(t),setTimeout(function(){n&&(n.brushType=i,n.strokeColor=a,n.lineWidth=s)},20)},ondrop:function(e){null!=s.get(e.dragged,"data")&&(o.isDrop=!0)},ondragend:function(){o.isDragend=!0}}}var n=e("zrender/shape/Image"),i=e("../util/shape/Icon"),a=e("../util/shape/MarkLine"),o=e("../util/shape/Symbol"),r=e("../config"),s=e("../util/ecData"),l=e("../util/ecAnimation"),h=e("../util/ecEffect"),m=e("../util/accMath"),V=e("../component/base"),U=e("zrender/tool/util"),d=e("zrender/tool/area");return t.prototype={setCalculable:function(e){return e.dragEnableTime=this.ecTheme.DRAG_ENABLE_TIME||r.DRAG_ENABLE_TIME,e.ondragover=this.shapeHandler.ondragover,e.ondragend=this.shapeHandler.ondragend,e.ondrop=this.shapeHandler.ondrop,e},ondrop:function(e,t){if(this.isDrop&&e.target&&!t.dragIn){var n,i=e.target,a=e.dragged,o=s.get(i,"seriesIndex"),l=s.get(i,"dataIndex"),h=this.series,V=this.component.legend;if(-1===l){if(s.get(a,"seriesIndex")==o)return t.dragOut=t.dragIn=t.needRefresh=!0,void(this.isDrop=!1);n={value:s.get(a,"value"),name:s.get(a,"name")},this.type===r.CHART_TYPE_PIE&&n.value<0&&(n.value=0);for(var U=!1,d=h[o].data,p=0,c=d.length;c>p;p++)d[p].name===n.name&&"-"===d[p].value&&(h[o].data[p].value=n.value,U=!0);!U&&h[o].data.push(n),V&&V.add(n.name,a.style.color||a.style.strokeColor)}else n=h[o].data[l]||"-",null!=n.value?(h[o].data[l].value="-"!=n.value?m.accAdd(h[o].data[l].value,s.get(a,"value")):s.get(a,"value"),(this.type===r.CHART_TYPE_FUNNEL||this.type===r.CHART_TYPE_PIE)&&(V&&1===V.getRelatedAmount(n.name)&&this.component.legend.del(n.name),n.name+=this.option.nameConnector+s.get(a,"name"),V&&V.add(n.name,a.style.color||a.style.strokeColor))):h[o].data[l]="-"!=n?m.accAdd(h[o].data[l],s.get(a,"value")):s.get(a,"value");t.dragIn=t.dragIn||!0,this.isDrop=!1;var u=this;setTimeout(function(){u.zr.trigger("mousemove",e.event)},300)}},ondragend:function(e,t){if(this.isDragend&&e.target&&!t.dragOut){var n=e.target,i=s.get(n,"seriesIndex"),a=s.get(n,"dataIndex"),o=this.series;if(null!=o[i].data[a].value){o[i].data[a].value="-";var r=o[i].data[a].name,l=this.component.legend;l&&0===l.getRelatedAmount(r)&&l.del(r)}else o[i].data[a]="-";t.dragOut=!0,t.needRefresh=!0,this.isDragend=!1}},onlegendSelected:function(e,t){var n=e.selected;for(var i in this.selectedMap)this.selectedMap[i]!=n[i]&&(t.needRefresh=!0),this.selectedMap[i]=n[i]},_buildPosition:function(){this._symbol=this.option.symbolList,this._sIndex2ShapeMap={},this._sIndex2ColorMap={},this.selectedMap={},this.xMarkMap={};for(var e,t,n,i,a=this.series,o={top:[],bottom:[],left:[],right:[],other:[]},s=0,l=a.length;l>s;s++)a[s].type===this.type&&(a[s]=this.reformOption(a[s]),this.legendHoverLink=a[s].legendHoverLink||this.legendHoverLink,e=a[s].xAxisIndex,t=a[s].yAxisIndex,n=this.component.xAxis.getAxis(e),i=this.component.yAxis.getAxis(t),n.type===r.COMPONENT_TYPE_AXIS_CATEGORY?o[n.getPosition()].push(s):i.type===r.COMPONENT_TYPE_AXIS_CATEGORY?o[i.getPosition()].push(s):o.other.push(s));for(var h in o)o[h].length>0&&this._buildSinglePosition(h,o[h]);this.addShapeList()},_buildSinglePosition:function(e,t){var n=this._mapData(t),i=n.locationMap,a=n.maxDataLength;if(0!==a&&0!==i.length){switch(e){case"bottom":case"top":this._buildHorizontal(t,a,i,this.xMarkMap);break;case"left":case"right":this._buildVertical(t,a,i,this.xMarkMap);break;case"other":this._buildOther(t,a,i,this.xMarkMap)}for(var o=0,r=t.length;r>o;o++)this.buildMark(t[o])}},_mapData:function(e){for(var t,n,i,a,o=this.series,s=0,l={},h="__kener__stack__",m=this.component.legend,V=[],U=0,d=0,p=e.length;p>d;d++){if(t=o[e[d]],i=t.name,this._sIndex2ShapeMap[e[d]]=this._sIndex2ShapeMap[e[d]]||this.query(t,"symbol")||this._symbol[d%this._symbol.length],m){if(this.selectedMap[i]=m.isSelected(i),this._sIndex2ColorMap[e[d]]=m.getColor(i),a=m.getItemShape(i)){var c=a.style;if(this.type==r.CHART_TYPE_LINE)c.iconType="legendLineIcon",c.symbol=this._sIndex2ShapeMap[e[d]];else if(t.itemStyle.normal.barBorderWidth>0){var u=a.highlightStyle;c.brushType="both",c.x+=1,c.y+=1,c.width-=2,c.height-=2,c.strokeColor=u.strokeColor=t.itemStyle.normal.barBorderColor,u.lineWidth=3}m.setItemShape(i,a)}}else this.selectedMap[i]=!0,this._sIndex2ColorMap[e[d]]=this.zr.getColor(e[d]);this.selectedMap[i]&&(n=t.stack||h+e[d],null==l[n]?(l[n]=s,V[s]=[e[d]],s++):V[l[n]].push(e[d])),U=Math.max(U,t.data.length)}return{locationMap:V,maxDataLength:U}},_calculMarkMapXY:function(e,t,n){for(var i=this.series,a=0,o=t.length;o>a;a++)for(var r=0,s=t[a].length;s>r;r++){var l=t[a][r],h="xy"==n?0:"",m=this.component.grid,V=e[l];if("-1"!=n.indexOf("x")){V["counter"+h]>0&&(V["average"+h]=V["sum"+h]/V["counter"+h]);var U=this.component.xAxis.getAxis(i[l].xAxisIndex||0).getCoord(V["average"+h]);V["averageLine"+h]=[[U,m.getYend()],[U,m.getY()]],V["minLine"+h]=[[V["minX"+h],m.getYend()],[V["minX"+h],m.getY()]],V["maxLine"+h]=[[V["maxX"+h],m.getYend()],[V["maxX"+h],m.getY()]],V.isHorizontal=!1}if(h="xy"==n?1:"","-1"!=n.indexOf("y")){V["counter"+h]>0&&(V["average"+h]=V["sum"+h]/V["counter"+h]);var d=this.component.yAxis.getAxis(i[l].yAxisIndex||0).getCoord(V["average"+h]);V["averageLine"+h]=[[m.getX(),d],[m.getXend(),d]],V["minLine"+h]=[[m.getX(),V["minY"+h]],[m.getXend(),V["minY"+h]]],V["maxLine"+h]=[[m.getX(),V["maxY"+h]],[m.getXend(),V["maxY"+h]]],V.isHorizontal=!0}}},addLabel:function(e,t,n,i,a){var o=[n,t],r=this.deepMerge(o,"itemStyle.normal.label"),s=this.deepMerge(o,"itemStyle.emphasis.label"),l=r.textStyle||{},h=s.textStyle||{};if(r.show){var m=e.style;m.text=this._getLabelText(t,n,i,"normal"),m.textPosition=null==r.position?"horizontal"===a?"right":"top":r.position,m.textColor=l.color,m.textFont=this.getFont(l),m.textAlign=l.align,m.textBaseline=l.baseline}if(s.show){var V=e.highlightStyle;V.text=this._getLabelText(t,n,i,"emphasis"),V.textPosition=r.show?e.style.textPosition:null==s.position?"horizontal"===a?"right":"top":s.position,V.textColor=h.color,V.textFont=this.getFont(h),V.textAlign=h.align,V.textBaseline=h.baseline}return e},_getLabelText:function(e,t,n,i){var a=this.deepQuery([t,e],"itemStyle."+i+".label.formatter");a||"emphasis"!==i||(a=this.deepQuery([t,e],"itemStyle.normal.label.formatter"));var o=this.getDataFromOption(t,"-");return a?"function"==typeof a?a.call(this.myChart,{seriesName:e.name,series:e,name:n,value:o,data:t,status:i}):"string"==typeof a?a=a.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}").replace("{a0}",e.name).replace("{b0}",n).replace("{c0}",this.numAddCommas(o)):void 0:o instanceof Array?null!=o[2]?this.numAddCommas(o[2]):o[0]+" , "+o[1]:this.numAddCommas(o)},buildMark:function(e){var t=this.series[e];this.selectedMap[t.name]&&(t.markLine&&this._buildMarkLine(e),t.markPoint&&this._buildMarkPoint(e))},_buildMarkPoint:function(e){for(var t,n,i=(this.markAttachStyle||{})[e],a=this.series[e],o=U.clone(a.markPoint),s=0,l=o.data.length;l>s;s++)t=o.data[s],n=this.getMarkCoord(e,t),t.x=null!=t.x?t.x:n[0],t.y=null!=t.y?t.y:n[1],!t.type||"max"!==t.type&&"min"!==t.type||(t.value=n[3],t.name=t.name||t.type,t.symbolSize=t.symbolSize||d.getTextWidth(n[3],this.getFont())/2+5); +for(var h=this._markPoint(e,o),s=0,l=h.length;l>s;s++){var m=h[s];m.zlevel=this.getZlevelBase(),m.z=this.getZBase()+1;for(var V in i)m[V]=U.clone(i[V]);this.shapeList.push(m)}if(this.type===r.CHART_TYPE_FORCE||this.type===r.CHART_TYPE_CHORD)for(var s=0,l=h.length;l>s;s++)this.zr.addShape(h[s])},_buildMarkLine:function(e){for(var t,n=(this.markAttachStyle||{})[e],i=this.series[e],a=U.clone(i.markLine),o=0,s=a.data.length;s>o;o++){var l=a.data[o];!l.type||"max"!==l.type&&"min"!==l.type&&"average"!==l.type?t=[this.getMarkCoord(e,l[0]),this.getMarkCoord(e,l[1])]:(t=this.getMarkCoord(e,l),a.data[o]=[U.clone(l),{}],a.data[o][0].name=l.name||l.type,a.data[o][0].value="average"!==l.type?t[3]:+t[3].toFixed(null!=a.precision?a.precision:this.deepQuery([this.ecTheme,r],"markLine.precision")),t=t[2],l=[{},{}]),null!=t&&null!=t[0]&&null!=t[1]&&(a.data[o][0].x=null!=l[0].x?l[0].x:t[0][0],a.data[o][0].y=null!=l[0].y?l[0].y:t[0][1],a.data[o][1].x=null!=l[1].x?l[1].x:t[1][0],a.data[o][1].y=null!=l[1].y?l[1].y:t[1][1])}for(var h=this._markLine(e,a),o=0,s=h.length;s>o;o++){var m=h[o];m.zlevel=this.getZlevelBase(),m.z=this.getZBase()+1;for(var V in n)m[V]=U.clone(n[V]);this.shapeList.push(m)}if(this.type===r.CHART_TYPE_FORCE||this.type===r.CHART_TYPE_CHORD)for(var o=0,s=h.length;s>o;o++)this.zr.addShape(h[o])},_markPoint:function(e,t){var n=this.series[e],i=this.component;U.merge(U.merge(t,U.clone(this.ecTheme.markPoint||{})),U.clone(r.markPoint)),t.name=n.name;var a,o,l,h,m,V,d,p=[],c=t.data,u=i.dataRange,y=i.legend,g=this.zr.getWidth(),b=this.zr.getHeight();if(t.large)a=this.getLargeMarkPoingShape(e,t),a._mark="largePoint",a&&p.push(a);else for(var f=0,k=c.length;k>f;f++)null!=c[f].x&&null!=c[f].y&&(l=null!=c[f].value?c[f].value:"",y&&(o=y.getColor(n.name)),u&&(o=isNaN(l)?o:u.getColor(l),h=[c[f],t],m=this.deepQuery(h,"itemStyle.normal.color")||o,V=this.deepQuery(h,"itemStyle.emphasis.color")||m,null==m&&null==V)||(o=null==o?this.zr.getColor(e):o,c[f].tooltip=c[f].tooltip||t.tooltip||{trigger:"item"},c[f].name=null!=c[f].name?c[f].name:"",c[f].value=l,a=this.getSymbolShape(t,e,c[f],f,c[f].name,this.parsePercent(c[f].x,g),this.parsePercent(c[f].y,b),"pin",o,"rgba(0,0,0,0)","horizontal"),a._mark="point",d=this.deepMerge([c[f],t],"effect"),d.show&&(a.effect=d),n.type===r.CHART_TYPE_MAP&&(a._geo=this.getMarkGeo(c[f])),s.pack(a,n,e,c[f],f,c[f].name,l),p.push(a)));return p},_markLine:function(e,t){var n=this.series[e],i=this.component;U.merge(U.merge(t,U.clone(this.ecTheme.markLine||{})),U.clone(r.markLine)),t.symbol=t.symbol instanceof Array?t.symbol.length>1?t.symbol:[t.symbol[0],t.symbol[0]]:[t.symbol,t.symbol],t.symbolSize=t.symbolSize instanceof Array?t.symbolSize.length>1?t.symbolSize:[t.symbolSize[0],t.symbolSize[0]]:[t.symbolSize,t.symbolSize],t.symbolRotate=t.symbolRotate instanceof Array?t.symbolRotate.length>1?t.symbolRotate:[t.symbolRotate[0],t.symbolRotate[0]]:[t.symbolRotate,t.symbolRotate],t.name=n.name;for(var a,o,l,h,m,V,d,p,c=[],u=t.data,y=i.dataRange,g=i.legend,b=this.zr.getWidth(),f=this.zr.getHeight(),k=0,x=u.length;x>k;k++){var _=u[k];null!=_[0].x&&null!=_[0].y&&null!=_[1].x&&null!=_[1].y&&(o=g?g.getColor(n.name):this.zr.getColor(e),p=this.deepMerge(_),l=null!=p.value?p.value:"",y&&(o=isNaN(l)?o:y.getColor(l),h=[p,t],m=this.deepQuery(h,"itemStyle.normal.color")||o,V=this.deepQuery(h,"itemStyle.emphasis.color")||m,null==m&&null==V)||(_[0].tooltip=p.tooltip||t.tooltip||{trigger:"item"},_[0].name=null!=_[0].name?_[0].name:"",_[1].name=null!=_[1].name?_[1].name:"",_[0].value=l,a=this.getLineMarkShape(t,e,_,k,this.parsePercent(_[0].x,b),this.parsePercent(_[0].y,f),this.parsePercent(_[1].x,b),this.parsePercent(_[1].y,f),o),a._mark="line",d=this.deepMerge([p,t],"effect"),d.show&&(a.effect=d),n.type===r.CHART_TYPE_MAP&&(a._geo=[this.getMarkGeo(_[0]),this.getMarkGeo(_[1])]),s.pack(a,n,e,_[0],k,_[0].name+(""!==_[1].name?" > "+_[1].name:""),l),c.push(a)))}return c},getMarkCoord:function(){return[0,0]},getSymbolShape:function(e,t,a,o,r,l,h,m,V,U,d){var p=[a,e],c=this.getDataFromOption(a,"-");m=this.deepQuery(p,"symbol")||m;var u=this.deepQuery(p,"symbolSize");u="function"==typeof u?u(c):u;var y=this.deepQuery(p,"symbolRotate"),g=this.deepMerge(p,"itemStyle.normal"),b=this.deepMerge(p,"itemStyle.emphasis"),f=null!=g.borderWidth?g.borderWidth:g.lineStyle&&g.lineStyle.width;null==f&&(f=m.match("empty")?2:0);var k=null!=b.borderWidth?b.borderWidth:b.lineStyle&&b.lineStyle.width;null==k&&(k=f+2);var x=new i({style:{iconType:m.replace("empty","").toLowerCase(),x:l-u,y:h-u,width:2*u,height:2*u,brushType:"both",color:m.match("empty")?U:this.getItemStyleColor(g.color,t,o,a)||V,strokeColor:g.borderColor||this.getItemStyleColor(g.color,t,o,a)||V,lineWidth:f},highlightStyle:{color:m.match("empty")?U:this.getItemStyleColor(b.color,t,o,a),strokeColor:b.borderColor||g.borderColor||this.getItemStyleColor(g.color,t,o,a)||V,lineWidth:k},clickable:this.deepQuery(p,"clickable")});return m.match("image")&&(x.style.image=m.replace(new RegExp("^image:\\/\\/"),""),x=new n({style:x.style,highlightStyle:x.highlightStyle,clickable:this.deepQuery(p,"clickable")})),null!=y&&(x.rotation=[y*Math.PI/180,l,h]),m.match("star")&&(x.style.iconType="star",x.style.n=m.replace("empty","").replace("star","")-0||5),"none"===m&&(x.invisible=!0,x.hoverable=!1),x=this.addLabel(x,e,a,r,d),m.match("empty")&&(null==x.style.textColor&&(x.style.textColor=x.style.strokeColor),null==x.highlightStyle.textColor&&(x.highlightStyle.textColor=x.highlightStyle.strokeColor)),s.pack(x,e,t,a,o,r),x._x=l,x._y=h,x._dataIndex=o,x._seriesIndex=t,x},getLineMarkShape:function(e,t,n,i,o,r,s,l,h){var m=null!=n[0].value?n[0].value:"-",V=null!=n[1].value?n[1].value:"-",U=[this.query(n[0],"symbol")||e.symbol[0],this.query(n[1],"symbol")||e.symbol[1]],d=[this.query(n[0],"symbolSize")||e.symbolSize[0],this.query(n[1],"symbolSize")||e.symbolSize[1]];d[0]="function"==typeof d[0]?d[0](m):d[0],d[1]="function"==typeof d[1]?d[1](V):d[1];var p=[this.query(n[0],"symbolRotate")||e.symbolRotate[0],this.query(n[1],"symbolRotate")||e.symbolRotate[1]],c=[n[0],n[1],e],u=this.deepMerge(c,"itemStyle.normal");u.color=this.getItemStyleColor(u.color,t,i,n);var y=this.deepMerge(c,"itemStyle.emphasis");y.color=this.getItemStyleColor(y.color,t,i,n);var g=u.lineStyle,b=y.lineStyle,f=g.width;null==f&&(f=u.borderWidth);var k=b.width;null==k&&(k=null!=y.borderWidth?y.borderWidth:f+2);var x=new a({style:{smooth:this.deepQuery([n[0],n[1],e],"smooth")?"spline":!1,smoothRadian:this.deepQuery([n[0],n[1],e],"smoothRadian"),symbol:U,symbolSize:d,symbolRotate:p,xStart:o,yStart:r,xEnd:s,yEnd:l,brushType:"both",lineType:g.type,shadowColor:g.shadowColor||g.color||u.borderColor||u.color||h,shadowBlur:g.shadowBlur,shadowOffsetX:g.shadowOffsetX,shadowOffsetY:g.shadowOffsetY,color:u.color||h,strokeColor:g.color||u.borderColor||u.color||h,lineWidth:f,symbolBorderColor:u.borderColor||u.color||h,symbolBorder:u.borderWidth},highlightStyle:{shadowColor:b.shadowColor,shadowBlur:b.shadowBlur,shadowOffsetX:b.shadowOffsetX,shadowOffsetY:b.shadowOffsetY,color:y.color||u.color||h,strokeColor:b.color||g.color||y.borderColor||u.borderColor||y.color||u.color||h,lineWidth:k,symbolBorderColor:y.borderColor||u.borderColor||y.color||u.color||h,symbolBorder:null==y.borderWidth?u.borderWidth+2:y.borderWidth},clickable:this.deepQuery(c,"clickable")});return x=this.addLabel(x,e,n[0],n[0].name+" : "+n[1].name),x._x=s,x._y=l,x},getLargeMarkPoingShape:function(e,t){var n,i,a,r,s,l,h=this.series[e],m=this.component,V=t.data,U=m.dataRange,d=m.legend,p=[V[0],t];if(d&&(i=d.getColor(h.name)),!U||(a=null!=V[0].value?V[0].value:"",i=isNaN(a)?i:U.getColor(a),r=this.deepQuery(p,"itemStyle.normal.color")||i,s=this.deepQuery(p,"itemStyle.emphasis.color")||r,null!=r||null!=s)){i=this.deepMerge(p,"itemStyle.normal").color||i;var c=this.deepQuery(p,"symbol")||"circle";c=c.replace("empty","").replace(/\d/g,""),l=this.deepMerge([V[0],t],"effect");var u=window.devicePixelRatio||1;return n=new o({style:{pointList:V,color:i,strokeColor:i,shadowColor:l.shadowColor||i,shadowBlur:(null!=l.shadowBlur?l.shadowBlur:8)*u,size:this.deepQuery(p,"symbolSize"),iconType:c,brushType:"fill",lineWidth:1},draggable:!1,hoverable:!1}),l.show&&(n.effect=l),n}},backupShapeList:function(){this.shapeList&&this.shapeList.length>0?(this.lastShapeList=this.shapeList,this.shapeList=[]):this.lastShapeList=[]},addShapeList:function(){var e,t,n=this.option.animationThreshold/(this.canvasSupported?2:4),i=this.lastShapeList,a=this.shapeList,o=i.length>0,s=o?this.query(this.option,"animationDurationUpdate"):this.query(this.option,"animationDuration"),l=this.query(this.option,"animationEasing"),h={},m={};if(this.option.animation&&!this.option.renderAsImage&&a.lengthV;V++)t=this._getAnimationKey(i[V]),t.match("undefined")?this.zr.delShape(i[V].id):(t+=i[V].type,h[t]?this.zr.delShape(i[V].id):h[t]=i[V]);for(var V=0,U=a.length;U>V;V++)t=this._getAnimationKey(a[V]),t.match("undefined")?this.zr.addShape(a[V]):(t+=a[V].type,m[t]=a[V]);for(t in h)m[t]||this.zr.delShape(h[t].id);for(t in m)h[t]?(this.zr.delShape(h[t].id),this._animateMod(h[t],m[t],s,l,0,o)):(e=this.type!=r.CHART_TYPE_LINE&&this.type!=r.CHART_TYPE_RADAR||0===t.indexOf("icon")?0:s/2,this._animateMod(!1,m[t],s,l,e,o));this.zr.refresh(),this.animationEffect()}else{this.motionlessOnce=!1,this.zr.delShape(i);for(var V=0,U=a.length;U>V;V++)this.zr.addShape(a[V])}},_getAnimationKey:function(e){return this.type!=r.CHART_TYPE_MAP?s.get(e,"seriesIndex")+"_"+s.get(e,"dataIndex")+(e._mark?e._mark:"")+(this.type===r.CHART_TYPE_RADAR?s.get(e,"special"):""):s.get(e,"seriesIndex")+"_"+s.get(e,"dataIndex")+(e._mark?e._mark:"undefined")},_animateMod:function(e,t,n,i,a,o){switch(t.type){case"polyline":case"half-smooth-polygon":l.pointList(this.zr,e,t,n,i);break;case"rectangle":l.rectangle(this.zr,e,t,n,i);break;case"image":case"icon":l.icon(this.zr,e,t,n,i,a);break;case"candle":o?this.zr.addShape(t):l.candle(this.zr,e,t,n,i);break;case"ring":case"sector":case"circle":o?"sector"===t.type?l.sector(this.zr,e,t,n,i):this.zr.addShape(t):l.ring(this.zr,e,t,n+(s.get(t,"dataIndex")||0)%20*100,i);break;case"text":l.text(this.zr,e,t,n,i);break;case"polygon":o?l.pointList(this.zr,e,t,n,i):l.polygon(this.zr,e,t,n,i);break;case"ribbon":l.ribbon(this.zr,e,t,n,i);break;case"gauge-pointer":l.gaugePointer(this.zr,e,t,n,i);break;case"mark-line":l.markline(this.zr,e,t,n,i);break;case"bezier-curve":case"line":l.line(this.zr,e,t,n,i);break;default:this.zr.addShape(t)}},animationMark:function(e,t,n){for(var i=n||this.shapeList,a=0,o=i.length;o>a;a++)i[a]._mark&&this._animateMod(!1,i[a],e,t,0,!0);this.animationEffect(n)},animationEffect:function(e){!e&&this.clearEffectShape();var t=e||this.shapeList;if(null!=t){var n=r.EFFECT_ZLEVEL;this.canvasSupported&&this.zr.modLayer(n,{motionBlur:!0,lastFrameAlpha:.95});for(var i,a=0,o=t.length;o>a;a++)i=t[a],i._mark&&i.effect&&i.effect.show&&h[i._mark]&&(h[i._mark](this.zr,this.effectList,i,n),this.effectList[this.effectList.length-1]._mark=i._mark)}},clearEffectShape:function(e){this.zr&&this.effectList&&this.effectList.length>0&&(e&&this.zr.modLayer(r.EFFECT_ZLEVEL,{motionBlur:!1}),this.zr.delShape(this.effectList)),this.effectList=[]},addMark:function(e,t,n){var i=this.series[e];if(this.selectedMap[i.name]){var a=this.query(this.option,"animationDurationUpdate"),o=this.query(this.option,"animationEasing"),r=i[n].data,s=this.shapeList.length;if(i[n].data=t.data,this["_build"+n.replace("m","M")](e),this.option.animation&&!this.option.renderAsImage)this.animationMark(a,o,this.shapeList.slice(s));else{for(var l=s,h=this.shapeList.length;h>l;l++)this.zr.addShape(this.shapeList[l]);this.zr.refreshNextFrame()}i[n].data=r}},delMark:function(e,t,n){n=n.replace("mark","").replace("large","").toLowerCase();var i=this.series[e];if(this.selectedMap[i.name]){for(var a=!1,o=[this.shapeList,this.effectList],r=2;r--;)for(var l=0,h=o[r].length;h>l;l++)if(o[r][l]._mark==n&&s.get(o[r][l],"seriesIndex")==e&&s.get(o[r][l],"name")==t){this.zr.delShape(o[r][l].id),o[r].splice(l,1),a=!0;break}a&&this.zr.refreshNextFrame()}}},U.inherits(t,V),t}),n("zrender/shape/Circle",["require","./Base","../tool/util"],function(e){"use strict";var t=e("./Base"),n=function(e){t.call(this,e)};return n.prototype={type:"circle",buildPath:function(e,t){e.arc(t.x,t.y,t.r,0,2*Math.PI,!0)},getRect:function(e){if(e.__rect)return e.__rect;var t;return t="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0,e.__rect={x:Math.round(e.x-e.r-t/2),y:Math.round(e.y-e.r-t/2),width:2*e.r+t,height:2*e.r+t},e.__rect}},e("../tool/util").inherits(n,t),n}),n("echarts/util/accMath",[],function(){function e(e,t){var n=e.toString(),i=t.toString(),a=0;try{a=i.split(".")[1].length}catch(o){}try{a-=n.split(".")[1].length}catch(o){}return(n.replace(".","")-0)/(i.replace(".","")-0)*Math.pow(10,a)}function t(e,t){var n=e.toString(),i=t.toString(),a=0;try{a+=n.split(".")[1].length}catch(o){}try{a+=i.split(".")[1].length}catch(o){}return(n.replace(".","")-0)*(i.replace(".","")-0)/Math.pow(10,a)}function n(e,t){var n=0,i=0;try{n=e.toString().split(".")[1].length}catch(a){}try{i=t.toString().split(".")[1].length}catch(a){}var o=Math.pow(10,Math.max(n,i));return(Math.round(e*o)+Math.round(t*o))/o}function i(e,t){return n(e,-t)}return{accDiv:e,accMul:t,accAdd:n,accSub:i}}),n("echarts/util/shape/Icon",["require","zrender/tool/util","zrender/shape/Star","zrender/shape/Heart","zrender/shape/Droplet","zrender/shape/Image","zrender/shape/Base"],function(e){function t(e,t){var n=t.x,i=t.y,a=t.width/16,o=t.height/16;e.moveTo(n,i+t.height),e.lineTo(n+5*a,i+14*o),e.lineTo(n+t.width,i+3*o),e.lineTo(n+13*a,i),e.lineTo(n+2*a,i+11*o),e.lineTo(n,i+t.height),e.moveTo(n+6*a,i+10*o),e.lineTo(n+14*a,i+2*o),e.moveTo(n+10*a,i+13*o),e.lineTo(n+t.width,i+13*o),e.moveTo(n+13*a,i+10*o),e.lineTo(n+13*a,i+t.height)}function n(e,t){var n=t.x,i=t.y,a=t.width/16,o=t.height/16;e.moveTo(n,i+t.height),e.lineTo(n+5*a,i+14*o),e.lineTo(n+t.width,i+3*o),e.lineTo(n+13*a,i),e.lineTo(n+2*a,i+11*o),e.lineTo(n,i+t.height),e.moveTo(n+6*a,i+10*o),e.lineTo(n+14*a,i+2*o),e.moveTo(n+10*a,i+13*o),e.lineTo(n+t.width,i+13*o)}function i(e,t){var n=t.x,i=t.y,a=t.width/16,o=t.height/16;e.moveTo(n+4*a,i+15*o),e.lineTo(n+9*a,i+13*o),e.lineTo(n+14*a,i+8*o),e.lineTo(n+11*a,i+5*o),e.lineTo(n+6*a,i+10*o),e.lineTo(n+4*a,i+15*o),e.moveTo(n+5*a,i),e.lineTo(n+11*a,i),e.moveTo(n+5*a,i+o),e.lineTo(n+11*a,i+o),e.moveTo(n,i+2*o),e.lineTo(n+t.width,i+2*o),e.moveTo(n,i+5*o),e.lineTo(n+3*a,i+t.height),e.lineTo(n+13*a,i+t.height),e.lineTo(n+t.width,i+5*o)}function a(e,t){var n=t.x,i=t.y,a=t.width/16,o=t.height/16;e.moveTo(n,i+3*o),e.lineTo(n+6*a,i+3*o),e.moveTo(n+3*a,i),e.lineTo(n+3*a,i+6*o),e.moveTo(n+3*a,i+8*o),e.lineTo(n+3*a,i+t.height),e.lineTo(n+t.width,i+t.height),e.lineTo(n+t.width,i+3*o),e.lineTo(n+8*a,i+3*o)}function o(e,t){var n=t.x,i=t.y,a=t.width/16,o=t.height/16;e.moveTo(n+6*a,i),e.lineTo(n+2*a,i+3*o),e.lineTo(n+6*a,i+6*o),e.moveTo(n+2*a,i+3*o),e.lineTo(n+14*a,i+3*o),e.lineTo(n+14*a,i+11*o),e.moveTo(n+2*a,i+5*o),e.lineTo(n+2*a,i+13*o),e.lineTo(n+14*a,i+13*o),e.moveTo(n+10*a,i+10*o),e.lineTo(n+14*a,i+13*o),e.lineTo(n+10*a,i+t.height)}function r(e,t){var n=t.x,i=t.y,a=t.width/16,o=t.height/16,r=t.width/2;e.lineWidth=1.5,e.arc(n+r,i+r,r-a,0,2*Math.PI/3),e.moveTo(n+3*a,i+t.height),e.lineTo(n+0*a,i+12*o),e.lineTo(n+5*a,i+11*o),e.moveTo(n,i+8*o),e.arc(n+r,i+r,r-a,Math.PI,5*Math.PI/3),e.moveTo(n+13*a,i),e.lineTo(n+t.width,i+4*o),e.lineTo(n+11*a,i+5*o)}function s(e,t){var n=t.x,i=t.y,a=t.width/16,o=t.height/16;e.moveTo(n,i),e.lineTo(n,i+t.height),e.lineTo(n+t.width,i+t.height),e.moveTo(n+2*a,i+14*o),e.lineTo(n+7*a,i+6*o),e.lineTo(n+11*a,i+11*o),e.lineTo(n+15*a,i+2*o)}function l(e,t){var n=t.x,i=t.y,a=t.width/16,o=t.height/16;e.moveTo(n,i),e.lineTo(n,i+t.height),e.lineTo(n+t.width,i+t.height),e.moveTo(n+3*a,i+14*o),e.lineTo(n+3*a,i+6*o),e.lineTo(n+4*a,i+6*o),e.lineTo(n+4*a,i+14*o),e.moveTo(n+7*a,i+14*o),e.lineTo(n+7*a,i+2*o),e.lineTo(n+8*a,i+2*o),e.lineTo(n+8*a,i+14*o),e.moveTo(n+11*a,i+14*o),e.lineTo(n+11*a,i+9*o),e.lineTo(n+12*a,i+9*o),e.lineTo(n+12*a,i+14*o)}function h(e,t){var n=t.x,i=t.y,a=t.width-2,o=t.height-2,r=Math.min(a,o)/2;i+=2,e.moveTo(n+r+3,i+r-3),e.arc(n+r+3,i+r-3,r-1,0,-Math.PI/2,!0),e.lineTo(n+r+3,i+r-3),e.moveTo(n+r,i),e.lineTo(n+r,i+r),e.arc(n+r,i+r,r,-Math.PI/2,2*Math.PI,!0),e.lineTo(n+r,i+r),e.lineWidth=1.5}function m(e,t){var n=t.x,i=t.y,a=t.width/16,o=t.height/16;i-=o,e.moveTo(n+1*a,i+2*o),e.lineTo(n+15*a,i+2*o),e.lineTo(n+14*a,i+3*o),e.lineTo(n+2*a,i+3*o),e.moveTo(n+3*a,i+6*o),e.lineTo(n+13*a,i+6*o),e.lineTo(n+12*a,i+7*o),e.lineTo(n+4*a,i+7*o),e.moveTo(n+5*a,i+10*o),e.lineTo(n+11*a,i+10*o),e.lineTo(n+10*a,i+11*o),e.lineTo(n+6*a,i+11*o),e.moveTo(n+7*a,i+14*o),e.lineTo(n+9*a,i+14*o),e.lineTo(n+8*a,i+15*o),e.lineTo(n+7*a,i+15*o)}function V(e,t){var n=t.x,i=t.y,a=t.width,o=t.height,r=a/16,s=o/16,l=2*Math.min(r,s);e.moveTo(n+r+l,i+s+l),e.arc(n+r,i+s,l,Math.PI/4,3*Math.PI),e.lineTo(n+7*r-l,i+6*s-l),e.arc(n+7*r,i+6*s,l,Math.PI/4*5,4*Math.PI),e.arc(n+7*r,i+6*s,l/2,Math.PI/4*5,4*Math.PI),e.moveTo(n+7*r-l/2,i+6*s+l),e.lineTo(n+r+l,i+14*s-l),e.arc(n+r,i+14*s,l,-Math.PI/4,2*Math.PI),e.moveTo(n+7*r+l/2,i+6*s),e.lineTo(n+14*r-l,i+10*s-l/2),e.moveTo(n+16*r,i+10*s),e.arc(n+14*r,i+10*s,l,0,3*Math.PI),e.lineWidth=1.5}function U(e,t){var n=t.x,i=t.y,a=t.width,o=t.height,r=Math.min(a,o)/2;e.moveTo(n+a,i+o/2),e.arc(n+r,i+r,r,0,2*Math.PI),e.arc(n+r,i,r,Math.PI/4,Math.PI/5*4),e.arc(n,i+r,r,-Math.PI/3,Math.PI/3),e.arc(n+a,i+o,r,Math.PI,Math.PI/2*3),e.lineWidth=1.5}function d(e,t){for(var n=t.x,i=t.y,a=t.width,o=t.height,r=Math.round(o/3),s=Math.round((r-2)/2),l=3;l--;)e.rect(n,i+r*l+s,a,2)}function p(e,t){for(var n=t.x,i=t.y,a=t.width,o=t.height,r=Math.round(a/3),s=Math.round((r-2)/2),l=3;l--;)e.rect(n+r*l+s,i,2,o)}function c(e,t){var n=t.x,i=t.y,a=t.width/16;e.moveTo(n+a,i),e.lineTo(n+a,i+t.height),e.lineTo(n+15*a,i+t.height),e.lineTo(n+15*a,i),e.lineTo(n+a,i),e.moveTo(n+3*a,i+3*a),e.lineTo(n+13*a,i+3*a),e.moveTo(n+3*a,i+6*a),e.lineTo(n+13*a,i+6*a),e.moveTo(n+3*a,i+9*a),e.lineTo(n+13*a,i+9*a),e.moveTo(n+3*a,i+12*a),e.lineTo(n+9*a,i+12*a)}function u(e,t){var n=t.x,i=t.y,a=t.width/16,o=t.height/16;e.moveTo(n,i),e.lineTo(n,i+t.height),e.lineTo(n+t.width,i+t.height),e.lineTo(n+t.width,i),e.lineTo(n,i),e.moveTo(n+4*a,i),e.lineTo(n+4*a,i+8*o),e.lineTo(n+12*a,i+8*o),e.lineTo(n+12*a,i),e.moveTo(n+6*a,i+11*o),e.lineTo(n+6*a,i+13*o),e.lineTo(n+10*a,i+13*o),e.lineTo(n+10*a,i+11*o),e.lineTo(n+6*a,i+11*o)}function y(e,t){var n=t.x,i=t.y,a=t.width,o=t.height;e.moveTo(n,i+o/2),e.lineTo(n+a,i+o/2),e.moveTo(n+a/2,i),e.lineTo(n+a/2,i+o)}function g(e,t){var n=t.width/2,i=t.height/2,a=Math.min(n,i);e.moveTo(t.x+n+a,t.y+i),e.arc(t.x+n,t.y+i,a,0,2*Math.PI),e.closePath()}function b(e,t){e.rect(t.x,t.y,t.width,t.height),e.closePath()}function f(e,t){var n=t.width/2,i=t.height/2,a=t.x+n,o=t.y+i,r=Math.min(n,i);e.moveTo(a,o-r),e.lineTo(a+r,o+r),e.lineTo(a-r,o+r),e.lineTo(a,o-r),e.closePath()}function k(e,t){var n=t.width/2,i=t.height/2,a=t.x+n,o=t.y+i,r=Math.min(n,i);e.moveTo(a,o-r),e.lineTo(a+r,o),e.lineTo(a,o+r),e.lineTo(a-r,o),e.lineTo(a,o-r),e.closePath()}function x(e,t){var n=t.x,i=t.y,a=t.width/16;e.moveTo(n+8*a,i),e.lineTo(n+a,i+t.height),e.lineTo(n+8*a,i+t.height/4*3),e.lineTo(n+15*a,i+t.height),e.lineTo(n+8*a,i),e.closePath()}function _(t,n){var i=e("zrender/shape/Star"),a=n.width/2,o=n.height/2;i.prototype.buildPath(t,{x:n.x+a,y:n.y+o,r:Math.min(a,o),n:n.n||5})}function L(t,n){var i=e("zrender/shape/Heart");i.prototype.buildPath(t,{x:n.x+n.width/2,y:n.y+.2*n.height,a:n.width/2,b:.8*n.height})}function W(t,n){var i=e("zrender/shape/Droplet");i.prototype.buildPath(t,{x:n.x+.5*n.width,y:n.y+.5*n.height,a:.5*n.width,b:.8*n.height})}function X(e,t){var n=t.x,i=t.y-t.height/2*1.5,a=t.width/2,o=t.height/2,r=Math.min(a,o);e.arc(n+a,i+o,r,Math.PI/5*4,Math.PI/5),e.lineTo(n+a,i+o+1.5*r),e.closePath()}function K(t,n,i){var a=e("zrender/shape/Image");this._imageShape=this._imageShape||new a({style:{}});for(var o in n)this._imageShape.style[o]=n[o];this._imageShape.brush(t,!1,i)}function w(e){v.call(this,e)}var I=e("zrender/tool/util"),v=e("zrender/shape/Base");return w.prototype={type:"icon",iconLibrary:{mark:t,markUndo:n,markClear:i,dataZoom:a,dataZoomReset:o,restore:r,lineChart:s,barChart:l,pieChart:h,funnelChart:m,forceChart:V,chordChart:U,stackChart:d,tiledChart:p,dataView:c,saveAsImage:u,cross:y,circle:g,rectangle:b,triangle:f,diamond:k,arrow:x,star:_,heart:L,droplet:W,pin:X,image:K},brush:function(t,n,i){var a=n?this.highlightStyle:this.style;a=a||{};var o=a.iconType||this.style.iconType;if("image"===o){var r=e("zrender/shape/Image");r.prototype.brush.call(this,t,n,i)}else{var a=this.beforeBrush(t,n);switch(t.beginPath(),this.buildPath(t,a,i),a.brushType){case"both":t.fill();case"stroke":a.lineWidth>0&&t.stroke();break;default:t.fill()}this.drawText(t,a,this.style),this.afterBrush(t)}},buildPath:function(e,t,n){this.iconLibrary[t.iconType]?this.iconLibrary[t.iconType].call(this,e,t,n):(e.moveTo(t.x,t.y),e.lineTo(t.x+t.width,t.y),e.lineTo(t.x+t.width,t.y+t.height),e.lineTo(t.x,t.y+t.height),e.lineTo(t.x,t.y),e.closePath())},getRect:function(e){return e.__rect?e.__rect:(e.__rect={x:Math.round(e.x),y:Math.round(e.y-("pin"==e.iconType?e.height/2*1.5:0)),width:e.width,height:e.height*("pin"===e.iconType?1.25:1)},e.__rect)},isCover:function(e,t){var n=this.getTansform(e,t);e=n[0],t=n[1];var i=this.style.__rect;i||(i=this.style.__rect=this.getRect(this.style));var a=i.height<8||i.width<8?4:0;return e>=i.x-a&&e<=i.x+i.width+a&&t>=i.y-a&&t<=i.y+i.height+a?!0:!1}},I.inherits(w,v),w}),n("echarts/util/shape/MarkLine",["require","zrender/shape/Base","./Icon","zrender/shape/Line","zrender/shape/Polyline","zrender/tool/matrix","zrender/tool/area","zrender/shape/util/dashedLineTo","zrender/shape/util/smoothSpline","zrender/tool/util"],function(e){function t(e){n.call(this,e)}var n=e("zrender/shape/Base"),i=e("./Icon"),a=e("zrender/shape/Line"),o=new a({}),r=e("zrender/shape/Polyline"),s=new r({}),l=e("zrender/tool/matrix"),h=e("zrender/tool/area"),m=e("zrender/shape/util/dashedLineTo"),V=e("zrender/shape/util/smoothSpline"),U=e("zrender/tool/util");return t.prototype={type:"mark-line",brush:function(e,t){var n=this.style;t&&(n=this.getHighlightStyle(n,this.highlightStyle||{})),e.save(),this.setContext(e,n),this.setTransform(e),e.save(),e.beginPath(),this.buildLinePath(e,n,this.style.lineWidth||1),e.stroke(),e.restore(),this.brushSymbol(e,n,0),this.brushSymbol(e,n,1),this.drawText(e,n,this.style),e.restore()},buildLinePath:function(e,t,n){var i=t.pointList||this.getPointList(t);t.pointList=i;var a=Math.min(t.pointList.length,Math.round(t.pointListLength||t.pointList.length));if(t.lineType&&"solid"!=t.lineType){if("dashed"==t.lineType||"dotted"==t.lineType)if("spline"!==t.smooth){var o=n*("dashed"==t.lineType?5:1);e.moveTo(i[0][0],i[0][1]);for(var r=1;a>r;r++)m(e,i[r-1][0],i[r-1][1],i[r][0],i[r][1],o)}else for(var r=1;a>r;r+=2)e.moveTo(i[r-1][0],i[r-1][1]),e.lineTo(i[r][0],i[r][1])}else{e.moveTo(i[0][0],i[0][1]);for(var r=1;a>r;r++)e.lineTo(i[r][0],i[r][1])}},brushSymbol:function(e,t,n){if("none"!=t.symbol[n]){e.save(),e.beginPath(),e.lineWidth=t.symbolBorder,e.strokeStyle=t.symbolBorderColor,t.iconType=t.symbol[n].replace("empty","").toLowerCase(),t.symbol[n].match("empty")&&(e.fillStyle="#fff");var a,o=Math.min(t.pointList.length,Math.round(t.pointListLength||t.pointList.length)),r=0===n?t.pointList[0][0]:t.pointList[o-1][0],s=0===n?t.pointList[0][1]:t.pointList[o-1][1],h="undefined"!=typeof t.symbolRotate[n]?t.symbolRotate[n]-0:0;if(0!==h&&(a=l.create(),l.identity(a),(r||s)&&l.translate(a,a,[-r,-s]),l.rotate(a,a,h*Math.PI/180),(r||s)&&l.translate(a,a,[r,s]),e.transform.apply(e,a)),"arrow"==t.iconType&&0===h)this.buildArrawPath(e,t,n);else{var m=t.symbolSize[n];t.x=r-m,t.y=s-m,t.width=2*m,t.height=2*m,i.prototype.buildPath(e,t)}e.closePath(),e.fill(),e.stroke(),e.restore()}},buildArrawPath:function(e,t,n){var i=Math.min(t.pointList.length,Math.round(t.pointListLength||t.pointList.length)),a=2*t.symbolSize[n],o=t.pointList[0][0],r=t.pointList[i-1][0],s=t.pointList[0][1],l=t.pointList[i-1][1],h=0;"spline"===t.smooth&&(h=t.smoothRadian*(r>=o?1:-1));var m=Math.atan(Math.abs((l-s)/(o-r)));0===n?r>o?l>s?m=2*Math.PI-m+h:m+=h:l>s?m+=Math.PI-h:m=Math.PI-m-h:o>r?s>l?m=2*Math.PI-m+h:m+=h:s>l?m+=Math.PI-h:m=Math.PI-m-h;var V=Math.PI/8,U=0===n?o:r,d=0===n?s:l,p=[[U+a*Math.cos(m-V),d-a*Math.sin(m-V)],[U+.6*a*Math.cos(m),d-.6*a*Math.sin(m)],[U+a*Math.cos(m+V),d-a*Math.sin(m+V)]];e.moveTo(U,d);for(var c=0,u=p.length;u>c;c++)e.lineTo(p[c][0],p[c][1]);e.lineTo(U,d)},getPointList:function(e){var t=[[e.xStart,e.yStart],[e.xEnd,e.yEnd]];if("spline"===e.smooth){var n=t[1][0],i=t[1][1];if(e.smoothRadian<=.8){t[3]=[n,i];var a=t[0][0]<=t[3][0];t[1]=this.getOffetPoint(t[0],t[3],a,e.smoothRadian),t[2]=this.getOffetPoint(t[3],t[0],a,e.smoothRadian)}else t[2]=[n,i],t[1]=this.getOffetPoint(t[0],t[2],t[0][0]<=t[2][0],e.smoothRadian);t=V(t,!1),t[t.length-1]=[n,i]}return t},getOffetPoint:function(e,t,n,i){var a,o=(2-Math.abs(i))/.6,r=Math.sqrt(Math.round((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])))/o,s=[e[0],e[1]];if(e[0]!=t[0]&&e[1]!=t[1]){var l=(t[1]-e[1])/(t[0]-e[0]);a=Math.atan(l)}else a=e[0]==t[0]?(e[1]<=t[1]?1:-1)*Math.PI/2:0;var h,m;return e[0]<=t[0]?(a-=i*(n?1:-1),h=Math.round(Math.cos(a)*r),m=Math.round(Math.sin(a)*r),s[0]+=h,s[1]+=m):(a+=i*(n?1:-1),h=Math.round(Math.cos(a)*r),m=Math.round(Math.sin(a)*r),s[0]-=h,s[1]-=m),s},getRect:function(e){if(e.__rect)return e.__rect;var t=e.lineWidth||1;return e.__rect={x:Math.min(e.xStart,e.xEnd)-t,y:Math.min(e.yStart,e.yEnd)-t,width:Math.abs(e.xStart-e.xEnd)+t,height:Math.abs(e.yStart-e.yEnd)+t},e.__rect},isCover:function(e,t){var n=this.getTansform(e,t);e=n[0],t=n[1];var i=this.style.__rect;return i||(i=this.style.__rect=this.getRect(this.style)),e>=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height?"spline"!==this.style.smooth?h.isInside(o,this.style,e,t):h.isInside(s,this.style,e,t):!1}},U.inherits(t,n),t}),n("echarts/util/shape/Symbol",["require","zrender/shape/Base","zrender/shape/Polygon","zrender/tool/util","./normalIsCover"],function(e){function t(e){n.call(this,e)}var n=e("zrender/shape/Base"),i=e("zrender/shape/Polygon"),a=new i({}),o=e("zrender/tool/util");return t.prototype={type:"symbol",buildPath:function(e,t){var n=t.pointList,i=n.length;if(0!==i)for(var a,o,r,s,l,h=1e4,m=Math.ceil(i/h),V=n[0]instanceof Array,U=t.size?t.size:2,d=U,p=U/2,c=2*Math.PI,u=0;m>u;u++){e.beginPath(),a=u*h,o=a+h,o=o>i?i:o;for(var y=a;o>y;y++)if(t.random&&(r=t["randomMap"+y%20]/100,d=U*r*r,p=d/2),V?(s=n[y][0],l=n[y][1]):(s=n[y].x,l=n[y].y),3>d)e.rect(s-p,l-p,d,d);else switch(t.iconType){case"circle":e.moveTo(s,l),e.arc(s,l,p,0,c,!0);break;case"diamond":e.moveTo(s,l-p),e.lineTo(s+p/3,l-p/3),e.lineTo(s+p,l),e.lineTo(s+p/3,l+p/3),e.lineTo(s,l+p),e.lineTo(s-p/3,l+p/3),e.lineTo(s-p,l),e.lineTo(s-p/3,l-p/3),e.lineTo(s,l-p);break;default:e.rect(s-p,l-p,d,d)}if(e.closePath(),m-1>u)switch(t.brushType){case"both":e.fill(),t.lineWidth>0&&e.stroke();break;case"stroke":t.lineWidth>0&&e.stroke();break;default:e.fill()}}},getRect:function(e){return e.__rect||a.getRect(e)},isCover:e("./normalIsCover")},o.inherits(t,n),t}),n("echarts/util/ecAnimation",["require","zrender/tool/util","zrender/shape/Polygon"],function(e){function t(e,t,n,i,a){var o,r=n.style.pointList,s=r.length;if(!t){if(o=[],"vertical"!=n._orient)for(var l=r[0][1],h=0;s>h;h++)o[h]=[r[h][0],l];else for(var m=r[0][0],h=0;s>h;h++)o[h]=[m,r[h][1]];"half-smooth-polygon"==n.type&&(o[s-1]=p.clone(r[s-1]),o[s-2]=p.clone(r[s-2])),t={style:{pointList:o}}}o=t.style.pointList;var V=o.length;n.style.pointList=V==s?o:s>V?o.concat(r.slice(V)):o.slice(0,s),e.addShape(n),n._animating=!0,e.animate(n.id,"style").when(i,{pointList:r}).done(function(){n._animating=!1}).start(a)}function n(e,t){for(var n=arguments.length,i=2;n>i;i++){var a=arguments[i];e.style[a]=t.style[a]}}function i(e,t,i,a,o){var r=i.style;t||(t={position:i.position,style:{x:r.x,y:"vertical"==i._orient?r.y+r.height:r.y,width:"vertical"==i._orient?r.width:0,height:"vertical"!=i._orient?r.height:0}});var s=r.x,l=r.y,h=r.width,m=r.height,V=[i.position[0],i.position[1]];n(i,t,"x","y","width","height"),i.position=t.position,e.addShape(i),(V[0]!=t.position[0]||V[1]!=t.position[1])&&e.animate(i.id,"").when(a,{position:V}).start(o),i._animating=!0,e.animate(i.id,"style").when(a,{x:s,y:l,width:h,height:m}).done(function(){i._animating=!1}).start(o)}function a(e,t,n,i,a){if(!t){var o=n.style.y;t={style:{y:[o[0],o[0],o[0],o[0]]}}}var r=n.style.y;n.style.y=t.style.y,e.addShape(n),n._animating=!0,e.animate(n.id,"style").when(i,{y:r}).done(function(){n._animating=!1}).start(a)}function o(e,t,n,i,a){var o=n.style.x,r=n.style.y,s=n.style.r0,l=n.style.r;n._animating=!0,"r"!=n._animationAdd?(n.style.r0=0,n.style.r=0,n.rotation=[2*Math.PI,o,r],e.addShape(n),e.animate(n.id,"style").when(i,{r0:s,r:l}).done(function(){n._animating=!1}).start(a),e.animate(n.id,"").when(Math.round(i/3*2),{rotation:[0,o,r]}).start(a)):(n.style.r0=n.style.r,e.addShape(n),e.animate(n.id,"style").when(i,{r0:s}).done(function(){n._animating=!1}).start(a))}function r(e,t,i,a,o){t||(t="r"!=i._animationAdd?{style:{startAngle:i.style.startAngle,endAngle:i.style.startAngle}}:{style:{r0:i.style.r}});var r=i.style.startAngle,s=i.style.endAngle;n(i,t,"startAngle","endAngle"),e.addShape(i),i._animating=!0,e.animate(i.id,"style").when(a,{startAngle:r,endAngle:s}).done(function(){i._animating=!1}).start(o)}function s(e,t,i,a,o){t||(t={style:{x:"left"==i.style.textAlign?i.style.x+100:i.style.x-100,y:i.style.y}});var r=i.style.x,s=i.style.y;n(i,t,"x","y"),e.addShape(i),i._animating=!0,e.animate(i.id,"style").when(a,{x:r,y:s}).done(function(){i._animating=!1}).start(o)}function l(t,n,i,a,o){var r=e("zrender/shape/Polygon").prototype.getRect(i.style),s=r.x+r.width/2,l=r.y+r.height/2;i.scale=[.1,.1,s,l],t.addShape(i),i._animating=!0,t.animate(i.id,"").when(a,{scale:[1,1,s,l]}).done(function(){i._animating=!1}).start(o)}function h(e,t,i,a,o){t||(t={style:{source0:0,source1:i.style.source1>0?360:-360,target0:0,target1:i.style.target1>0?360:-360}});var r=i.style.source0,s=i.style.source1,l=i.style.target0,h=i.style.target1;t.style&&n(i,t,"source0","source1","target0","target1"),e.addShape(i),i._animating=!0,e.animate(i.id,"style").when(a,{source0:r,source1:s,target0:l,target1:h}).done(function(){i._animating=!1}).start(o)}function m(e,t,n,i,a){t||(t={style:{angle:n.style.startAngle}});var o=n.style.angle;n.style.angle=t.style.angle,e.addShape(n),n._animating=!0,e.animate(n.id,"style").when(i,{angle:o}).done(function(){n._animating=!1}).start(a)}function V(e,t,n,a,o,r){if(n.style._x=n.style.x,n.style._y=n.style.y,n.style._width=n.style.width,n.style._height=n.style.height,t)i(e,t,n,a,o);else{var s=n._x||0,l=n._y||0;n.scale=[.01,.01,s,l],e.addShape(n),n._animating=!0,e.animate(n.id,"").delay(r).when(a,{scale:[1,1,s,l]}).done(function(){n._animating=!1}).start(o||"QuinticOut")}}function U(e,t,i,a,o){t||(t={style:{xStart:i.style.xStart,yStart:i.style.yStart,xEnd:i.style.xStart,yEnd:i.style.yStart}});var r=i.style.xStart,s=i.style.xEnd,l=i.style.yStart,h=i.style.yEnd;n(i,t,"xStart","xEnd","yStart","yEnd"),e.addShape(i),i._animating=!0,e.animate(i.id,"style").when(a,{xStart:r,xEnd:s,yStart:l,yEnd:h}).done(function(){i._animating=!1}).start(o)}function d(e,t,n,i,a){n.style.smooth?t?e.addShape(n):(n.style.pointListLength=1,e.addShape(n),n._animating=!0,n.style.pointList=n.style.pointList||n.getPointList(n.style),e.animate(n.id,"style").when(i,{pointListLength:n.style.pointList.length}).done(function(){n._animating=!1}).start(a||"QuinticOut")):(n.style.pointList=t?t.style.pointList:[[n.style.xStart,n.style.yStart],[n.style.xStart,n.style.yStart]],e.addShape(n),n._animating=!0,e.animate(n.id,"style").when(i,{pointList:[[n.style.xStart,n.style.yStart],[n._x||0,n._y||0]]}).done(function(){n._animating=!1}).start(a||"QuinticOut")) +}var p=e("zrender/tool/util");return{pointList:t,rectangle:i,candle:a,ring:o,sector:r,text:s,polygon:l,ribbon:h,gaugePointer:m,icon:V,line:U,markline:d}}),n("echarts/util/ecEffect",["require","../util/ecData","zrender/shape/Circle","zrender/shape/Image","../util/shape/Icon","../util/shape/Symbol","zrender/tool/env"],function(e){function t(e,t,n,i){var o,l=n.effect,m=l.color||n.style.strokeColor||n.style.color,V=l.shadowColor||m,U=l.scaleSize,d=l.bounceDistance,p="undefined"!=typeof l.shadowBlur?l.shadowBlur:U;"image"!==n.type?(o=new s({zlevel:i,style:{brushType:"stroke",iconType:"droplet"!=n.style.iconType?n.style.iconType:"circle",x:p+1,y:p+1,n:n.style.n,width:n.style._width*U,height:n.style._height*U,lineWidth:1,strokeColor:m,shadowColor:V,shadowBlur:p},draggable:!1,hoverable:!1}),"pin"==n.style.iconType&&(o.style.y+=o.style.height/2*1.5),h&&(o.style.image=e.shapeToImage(o,o.style.width+2*p+2,o.style.height+2*p+2).style.image,o=new r({zlevel:o.zlevel,style:o.style,draggable:!1,hoverable:!1}))):o=new r({zlevel:i,style:n.style,draggable:!1,hoverable:!1}),a.clone(n,o),o.position=n.position,t.push(o),e.addShape(o);var c="image"!==n.type?window.devicePixelRatio||1:1,u=(o.style.width/c-n.style._width)/2;o.style.x=n.style._x-u,o.style.y=n.style._y-u,"pin"==n.style.iconType&&(o.style.y-=n.style.height/2*1.5);var y=100*(l.period+10*Math.random());e.modShape(n.id,{invisible:!0});var g=o.style.x+o.style.width/2/c,b=o.style.y+o.style.height/2/c;"scale"===l.type?(e.modShape(o.id,{scale:[.1,.1,g,b]}),e.animate(o.id,"",l.loop).when(y,{scale:[1,1,g,b]}).done(function(){n.effect.show=!1,e.delShape(o.id)}).start()):e.animate(o.id,"style",l.loop).when(y,{y:o.style.y-d}).when(2*y,{y:o.style.y}).done(function(){n.effect.show=!1,e.delShape(o.id)}).start()}function n(e,t,n,i){var a=n.effect,o=a.color||n.style.strokeColor||n.style.color,r=a.scaleSize,s=a.shadowColor||o,h="undefined"!=typeof a.shadowBlur?a.shadowBlur:2*r,m=window.devicePixelRatio||1,V=new l({zlevel:i,position:n.position,scale:n.scale,style:{pointList:n.style.pointList,iconType:n.style.iconType,color:o,strokeColor:o,shadowColor:s,shadowBlur:h*m,random:!0,brushType:"fill",lineWidth:1,size:n.style.size},draggable:!1,hoverable:!1});t.push(V),e.addShape(V),e.modShape(n.id,{invisible:!0});for(var U=Math.round(100*a.period),d={},p={},c=0;20>c;c++)V.style["randomMap"+c]=0,d={},d["randomMap"+c]=100,p={},p["randomMap"+c]=0,V.style["randomMap"+c]=100*Math.random(),e.animate(V.id,"style",!0).when(U,d).when(2*U,p).when(3*U,d).when(4*U,d).delay(Math.random()*U*c).start()}function i(e,t,n,i){var s,l=n.effect,m=l.color||n.style.strokeColor||n.style.color,V=l.shadowColor||n.style.strokeColor||m,U=n.style.lineWidth*l.scaleSize,d="undefined"!=typeof l.shadowBlur?l.shadowBlur:U,p=new o({zlevel:i,style:{x:d,y:d,r:U,color:m,shadowColor:V,shadowBlur:d},draggable:!1,hoverable:!1});h?(p.style.image=e.shapeToImage(p,2*(U+d),2*(U+d)).style.image,p=new r({zlevel:p.zlevel,style:p.style,draggable:!1,hoverable:!1}),s=d):s=0,a.clone(n,p),p.position=n.position,t.push(p),e.addShape(p),p.style.x=n.style.xStart-s,p.style.y=n.style.yStart-s;var c=(n.style.xStart-n.style.xEnd)*(n.style.xStart-n.style.xEnd)+(n.style.yStart-n.style.yEnd)*(n.style.yStart-n.style.yEnd),u=Math.round(Math.sqrt(Math.round(c*l.period*l.period)));if(n.style.smooth){var y=n.style.pointList||n.getPointList(n.style),g=y.length;u=Math.round(u/g);for(var b=e.animate(p.id,"style",l.loop),f=Math.ceil(g/8),k=0;g-f>k;k+=f)b.when(u*(k+1),{x:y[k][0]-s,y:y[k][1]-s});b.when(u*g,{x:y[g-1][0]-s,y:y[g-1][1]-s}),b.done(function(){n.effect.show=!1,e.delShape(p.id)}),b.start("spline")}else e.animate(p.id,"style",l.loop).when(u,{x:n._x-s,y:n._y-s}).done(function(){n.effect.show=!1,e.delShape(p.id)}).start()}var a=e("../util/ecData"),o=e("zrender/shape/Circle"),r=e("zrender/shape/Image"),s=e("../util/shape/Icon"),l=e("../util/shape/Symbol"),h=e("zrender/tool/env").canvasSupported;return{point:t,largePoint:n,line:i}}),n("echarts/component/base",["require","../config","../util/ecData","../util/ecQuery","../util/number","zrender/tool/util","zrender/tool/env"],function(e){function t(e,t,a,o,r){this.ecTheme=e,this.messageCenter=t,this.zr=a,this.option=o,this.series=o.series,this.myChart=r,this.component=r.component,this.shapeList=[],this.effectList=[];var s=this;s._onlegendhoverlink=function(e){if(s.legendHoverLink)for(var t,a=e.target,o=s.shapeList.length-1;o>=0;o--)t=s.type==n.CHART_TYPE_PIE||s.type==n.CHART_TYPE_FUNNEL?i.get(s.shapeList[o],"name"):(i.get(s.shapeList[o],"series")||{}).name,t!=a||s.shapeList[o].invisible||s.shapeList[o]._animating||s.zr.addHoverShape(s.shapeList[o])},t&&t.bind(n.EVENT.LEGEND_HOVERLINK,this._onlegendhoverlink)}var n=e("../config"),i=e("../util/ecData"),a=e("../util/ecQuery"),o=e("../util/number"),r=e("zrender/tool/util");return t.prototype={canvasSupported:e("zrender/tool/env").canvasSupported,_getZ:function(e){var t=this.ecTheme[this.type];return t&&null!=t[e]?t[e]:(t=n[this.type],t&&null!=t[e]?t[e]:0)},getZlevelBase:function(){return this._getZ("zlevel")},getZBase:function(){return this._getZ("z")},reformOption:function(e){return r.merge(r.merge(e||{},r.clone(this.ecTheme[this.type]||{})),r.clone(n[this.type]||{}))},reformCssArray:function(e){if(!(e instanceof Array))return[e,e,e,e];switch(e.length+""){case"4":return e;case"3":return[e[0],e[1],e[2],e[1]];case"2":return[e[0],e[1],e[0],e[1]];case"1":return[e[0],e[0],e[0],e[0]];case"0":return[0,0,0,0]}},getShapeById:function(e){for(var t=0,n=this.shapeList.length;n>t;t++)if(this.shapeList[t].id===e)return this.shapeList[t];return null},getFont:function(e){var t=this.getTextStyle(r.clone(e));return t.fontStyle+" "+t.fontWeight+" "+t.fontSize+"px "+t.fontFamily},getTextStyle:function(e){return r.merge(r.merge(e||{},this.ecTheme.textStyle),n.textStyle)},getItemStyleColor:function(e,t,n,i){return"function"==typeof e?e.call(this.myChart,{seriesIndex:t,series:this.series[t],dataIndex:n,data:i}):e},getDataFromOption:function(e,t){return null!=e?null!=e.value?e.value:e:t},subPixelOptimize:function(e,t){return e=t%2===1?Math.floor(e)+.5:Math.round(e)},resize:function(){this.refresh&&this.refresh(),this.clearEffectShape&&this.clearEffectShape(!0);var e=this;setTimeout(function(){e.animationEffect&&e.animationEffect()},200)},clear:function(){this.clearEffectShape&&this.clearEffectShape(),this.zr&&this.zr.delShape(this.shapeList),this.shapeList=[]},dispose:function(){this.onbeforDispose&&this.onbeforDispose(),this.clear(),this.shapeList=null,this.effectList=null,this.messageCenter&&this.messageCenter.unbind(n.EVENT.LEGEND_HOVERLINK,this._onlegendhoverlink),this.onafterDispose&&this.onafterDispose()},query:a.query,deepQuery:a.deepQuery,deepMerge:a.deepMerge,parsePercent:o.parsePercent,parseCenter:o.parseCenter,parseRadius:o.parseRadius,numAddCommas:o.addCommas},t}),n("zrender/shape/Star",["require","../tool/math","./Base","../tool/util"],function(e){var t=e("../tool/math"),n=t.sin,i=t.cos,a=Math.PI,o=e("./Base"),r=function(e){o.call(this,e)};return r.prototype={type:"star",buildPath:function(e,t){var o=t.n;if(o&&!(2>o)){var r=t.x,s=t.y,l=t.r,h=t.r0;null==h&&(h=o>4?l*i(2*a/o)/i(a/o):l/3);var m=a/o,V=-a/2,U=r+l*i(V),d=s+l*n(V);V+=m;var p=t.pointList=[];p.push([U,d]);for(var c,u=0,y=2*o-1;y>u;u++)c=u%2===0?h:l,p.push([r+c*i(V),s+c*n(V)]),V+=m;p.push([U,d]),e.moveTo(p[0][0],p[0][1]);for(var u=0;u=a.x&&e<=a.x+a.width&&t>=a.y&&t<=a.y+a.height?i.isInsidePath(this._pathProxy.pathCommands,this.style.lineWidth,this.style.brushType,e,t):void 0}},e("../tool/util").inherits(a,t),a}),n("zrender/shape/Droplet",["require","./Base","./util/PathProxy","../tool/area","../tool/util"],function(e){"use strict";var t=e("./Base"),n=e("./util/PathProxy"),i=e("../tool/area"),a=function(e){t.call(this,e),this._pathProxy=new n};return a.prototype={type:"droplet",buildPath:function(e,t){var i=this._pathProxy||new n;i.begin(e),i.moveTo(t.x,t.y+t.a),i.bezierCurveTo(t.x+t.a,t.y+t.a,t.x+3*t.a/2,t.y-t.a/3,t.x,t.y-t.b),i.bezierCurveTo(t.x-3*t.a/2,t.y-t.a/3,t.x-t.a,t.y+t.a,t.x,t.y+t.a),i.closePath()},getRect:function(e){return e.__rect?e.__rect:(this._pathProxy.isEmpty()||this.buildPath(null,e),this._pathProxy.fastBoundingRect())},isCover:function(e,t){var n=this.getTansform(e,t);e=n[0],t=n[1];var a=this.getRect(this.style);return e>=a.x&&e<=a.x+a.width&&t>=a.y&&t<=a.y+a.height?i.isInsidePath(this._pathProxy.pathCommands,this.style.lineWidth,this.style.brushType,e,t):void 0}},e("../tool/util").inherits(a,t),a}),n("zrender/tool/math",[],function(){function e(e,t){return Math.sin(t?e*a:e)}function t(e,t){return Math.cos(t?e*a:e)}function n(e){return e*a}function i(e){return e/a}var a=Math.PI/180;return{sin:e,cos:t,degreeToRadian:n,radianToDegree:i}}),n("zrender/shape/util/PathProxy",["require","../../tool/vector"],function(e){var t=e("../../tool/vector"),n=function(e,t){this.command=e,this.points=t||null},i=function(){this.pathCommands=[],this._ctx=null,this._min=[],this._max=[]};return i.prototype.fastBoundingRect=function(){var e=this._min,n=this._max;e[0]=e[1]=1/0,n[0]=n[1]=-1/0;for(var i=0;ir;r+=2)e[0]=Math.min(e[0],e[0],o[r]),e[1]=Math.min(e[1],e[1],o[r+1]),n[0]=Math.max(n[0],n[0],o[r]),n[1]=Math.max(n[1],n[1],o[r+1]);break;case"Q":for(var r=0;4>r;r+=2)e[0]=Math.min(e[0],e[0],o[r]),e[1]=Math.min(e[1],e[1],o[r+1]),n[0]=Math.max(n[0],n[0],o[r]),n[1]=Math.max(n[1],n[1],o[r+1]);break;case"A":var s=o[0],l=o[1],h=o[2],m=o[3];e[0]=Math.min(e[0],e[0],s-h),e[1]=Math.min(e[1],e[1],l-m),n[0]=Math.max(n[0],n[0],s+h),n[1]=Math.max(n[1],n[1],l+m)}}return{x:e[0],y:e[1],width:n[0]-e[0],height:n[1]-e[1]}},i.prototype.begin=function(e){return this._ctx=e||null,this.pathCommands.length=0,this},i.prototype.moveTo=function(e,t){return this.pathCommands.push(new n("M",[e,t])),this._ctx&&this._ctx.moveTo(e,t),this},i.prototype.lineTo=function(e,t){return this.pathCommands.push(new n("L",[e,t])),this._ctx&&this._ctx.lineTo(e,t),this},i.prototype.bezierCurveTo=function(e,t,i,a,o,r){return this.pathCommands.push(new n("C",[e,t,i,a,o,r])),this._ctx&&this._ctx.bezierCurveTo(e,t,i,a,o,r),this},i.prototype.quadraticCurveTo=function(e,t,i,a){return this.pathCommands.push(new n("Q",[e,t,i,a])),this._ctx&&this._ctx.quadraticCurveTo(e,t,i,a),this},i.prototype.arc=function(e,t,i,a,o,r){return this.pathCommands.push(new n("A",[e,t,i,i,a,o-a,0,r?0:1])),this._ctx&&this._ctx.arc(e,t,i,a,o,r),this},i.prototype.arcTo=function(e,t,n,i,a){return this._ctx&&this._ctx.arcTo(e,t,n,i,a),this},i.prototype.rect=function(e,t,n,i){return this._ctx&&this._ctx.rect(e,t,n,i),this},i.prototype.closePath=function(){return this.pathCommands.push(new n("z")),this._ctx&&this._ctx.closePath(),this},i.prototype.isEmpty=function(){return 0===this.pathCommands.length},i.PathSegment=n,i}),n("zrender/shape/Line",["require","./Base","./util/dashedLineTo","../tool/util"],function(e){var t=e("./Base"),n=e("./util/dashedLineTo"),i=function(e){this.brushTypeOnly="stroke",this.textPosition="end",t.call(this,e)};return i.prototype={type:"line",buildPath:function(e,t){if(t.lineType&&"solid"!=t.lineType){if("dashed"==t.lineType||"dotted"==t.lineType){var i=(t.lineWidth||1)*("dashed"==t.lineType?5:1);n(e,t.xStart,t.yStart,t.xEnd,t.yEnd,i)}}else e.moveTo(t.xStart,t.yStart),e.lineTo(t.xEnd,t.yEnd)},getRect:function(e){if(e.__rect)return e.__rect;var t=e.lineWidth||1;return e.__rect={x:Math.min(e.xStart,e.xEnd)-t,y:Math.min(e.yStart,e.yEnd)-t,width:Math.abs(e.xStart-e.xEnd)+t,height:Math.abs(e.yStart-e.yEnd)+t},e.__rect}},e("../tool/util").inherits(i,t),i}),n("zrender/shape/Polyline",["require","./Base","./util/smoothSpline","./util/smoothBezier","./util/dashedLineTo","./Polygon","../tool/util"],function(e){var t=e("./Base"),n=e("./util/smoothSpline"),i=e("./util/smoothBezier"),a=e("./util/dashedLineTo"),o=function(e){this.brushTypeOnly="stroke",this.textPosition="end",t.call(this,e)};return o.prototype={type:"polyline",buildPath:function(e,t){var o=t.pointList;if(!(o.length<2)){var r=Math.min(t.pointList.length,Math.round(t.pointListLength||t.pointList.length));if(t.smooth&&"spline"!==t.smooth){var s=i(o,t.smooth,!1,t.smoothConstraint);e.moveTo(o[0][0],o[0][1]);for(var l,h,m,V=0;r-1>V;V++)l=s[2*V],h=s[2*V+1],m=o[V+1],e.bezierCurveTo(l[0],l[1],h[0],h[1],m[0],m[1])}else if("spline"===t.smooth&&(o=n(o),r=o.length),t.lineType&&"solid"!=t.lineType){if("dashed"==t.lineType||"dotted"==t.lineType){var U=(t.lineWidth||1)*("dashed"==t.lineType?5:1);e.moveTo(o[0][0],o[0][1]);for(var V=1;r>V;V++)a(e,o[V-1][0],o[V-1][1],o[V][0],o[V][1],U)}}else{e.moveTo(o[0][0],o[0][1]);for(var V=1;r>V;V++)e.lineTo(o[V][0],o[V][1])}}},getRect:function(t){return e("./Polygon").prototype.getRect(t)}},e("../tool/util").inherits(o,t),o}),n("zrender/shape/util/dashedLineTo",[],function(){var e=[5,5];return function(t,n,i,a,o,r){if(t.setLineDash)return e[0]=e[1]=r,t.setLineDash(e),t.moveTo(n,i),void t.lineTo(a,o);r="number"!=typeof r?5:r;var s=a-n,l=o-i,h=Math.floor(Math.sqrt(s*s+l*l)/r);s/=h,l/=h;for(var m=!0,V=0;h>V;++V)m?t.moveTo(n,i):t.lineTo(n,i),m=!m,n+=s,i+=l;t.lineTo(a,o)}}),n("zrender/shape/util/smoothSpline",["require","../../tool/vector"],function(e){function t(e,t,n,i,a,o,r){var s=.5*(n-e),l=.5*(i-t);return(2*(t-n)+s+l)*r+(-3*(t-n)-2*s-l)*o+s*a+t}var n=e("../../tool/vector");return function(e,i){for(var a=e.length,o=[],r=0,s=1;a>s;s++)r+=n.distance(e[s-1],e[s]);var l=r/5;l=a>l?a:l;for(var s=0;l>s;s++){var h,m,V,U=s/(l-1)*(i?a:a-1),d=Math.floor(U),p=U-d,c=e[d%a];i?(h=e[(d-1+a)%a],m=e[(d+1)%a],V=e[(d+2)%a]):(h=e[0===d?d:d-1],m=e[d>a-2?a-1:d+1],V=e[d>a-3?a-1:d+2]);var u=p*p,y=p*u;o.push([t(h[0],c[0],m[0],V[0],p,u,y),t(h[1],c[1],m[1],V[1],p,u,y)])}return o}}),n("zrender/shape/util/smoothBezier",["require","../../tool/vector"],function(e){var t=e("../../tool/vector");return function(e,n,i,a){var o,r,s,l,h=[],m=[],V=[],U=[],d=!!a;if(d){s=[1/0,1/0],l=[-1/0,-1/0];for(var p=0,c=e.length;c>p;p++)t.min(s,s,e[p]),t.max(l,l,e[p]);t.min(s,s,a[0]),t.max(l,l,a[1])}for(var p=0,c=e.length;c>p;p++){var o,r,u=e[p];if(i)o=e[p?p-1:c-1],r=e[(p+1)%c];else{if(0===p||p===c-1){h.push(e[p]);continue}o=e[p-1],r=e[p+1]}t.sub(m,r,o),t.scale(m,m,n);var y=t.distance(u,o),g=t.distance(u,r),b=y+g;0!==b&&(y/=b,g/=b),t.scale(V,m,-y),t.scale(U,m,g);var f=t.add([],u,V),k=t.add([],u,U);d&&(t.max(f,f,s),t.min(f,f,l),t.max(k,k,s),t.min(k,k,l)),h.push(f),h.push(k)}return i&&h.push(h.shift()),h}}),n("zrender/shape/Polygon",["require","./Base","./util/smoothSpline","./util/smoothBezier","./util/dashedLineTo","../tool/util"],function(e){var t=e("./Base"),n=e("./util/smoothSpline"),i=e("./util/smoothBezier"),a=e("./util/dashedLineTo"),o=function(e){t.call(this,e)};return o.prototype={type:"polygon",buildPath:function(e,t){var o=t.pointList;if(!(o.length<2)){if(t.smooth&&"spline"!==t.smooth){var r=i(o,t.smooth,!0,t.smoothConstraint);e.moveTo(o[0][0],o[0][1]);for(var s,l,h,m=o.length,V=0;m>V;V++)s=r[2*V],l=r[2*V+1],h=o[(V+1)%m],e.bezierCurveTo(s[0],s[1],l[0],l[1],h[0],h[1])}else if("spline"===t.smooth&&(o=n(o,!0)),t.lineType&&"solid"!=t.lineType){if("dashed"==t.lineType||"dotted"==t.lineType){var U=t._dashLength||(t.lineWidth||1)*("dashed"==t.lineType?5:1);t._dashLength=U,e.moveTo(o[0][0],o[0][1]);for(var V=1,d=o.length;d>V;V++)a(e,o[V-1][0],o[V-1][1],o[V][0],o[V][1],U);a(e,o[o.length-1][0],o[o.length-1][1],o[0][0],o[0][1],U)}}else{e.moveTo(o[0][0],o[0][1]);for(var V=1,d=o.length;d>V;V++)e.lineTo(o[V][0],o[V][1]);e.lineTo(o[0][0],o[0][1])}e.closePath()}},getRect:function(e){if(e.__rect)return e.__rect;for(var t=Number.MAX_VALUE,n=Number.MIN_VALUE,i=Number.MAX_VALUE,a=Number.MIN_VALUE,o=e.pointList,r=0,s=o.length;s>r;r++)o[r][0]n&&(n=o[r][0]),o[r][1]a&&(a=o[r][1]);var l;return l="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0,e.__rect={x:Math.round(t-l/2),y:Math.round(i-l/2),width:n-t+l,height:a-i+l},e.__rect}},e("../tool/util").inherits(o,t),o}),n("echarts/util/shape/normalIsCover",[],function(){return function(e,t){var n=this.getTansform(e,t);e=n[0],t=n[1];var i=this.style.__rect;return i||(i=this.style.__rect=this.getRect(this.style)),e>=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height}}),n("echarts/util/ecQuery",["require","zrender/tool/util"],function(e){function t(e,t){if("undefined"!=typeof e){if(!t)return e;t=t.split(".");for(var n=t.length,i=0;n>i;){if(e=e[t[i]],"undefined"==typeof e)return;i++}return e}}function n(e,n){for(var i,a=0,o=e.length;o>a;a++)if(i=t(e[a],n),"undefined"!=typeof i)return i}function i(e,n){for(var i,o=e.length;o--;){var r=t(e[o],n);"undefined"!=typeof r&&("undefined"==typeof i?i=a.clone(r):a.merge(i,r,!0))}return i}var a=e("zrender/tool/util");return{query:t,deepQuery:n,deepMerge:i}}),n("echarts/util/number",[],function(){function e(e){return e.replace(/^\s+/,"").replace(/\s+$/,"")}function t(t,n){return"string"==typeof t?e(t).match(/%$/)?parseFloat(t)/100*n:parseFloat(t):t}function n(e,n){return[t(n[0],e.getWidth()),t(n[1],e.getHeight())]}function i(e,n){n instanceof Array||(n=[0,n]);var i=Math.min(e.getWidth(),e.getHeight())/2;return[t(n[0],i),t(n[1],i)]}function a(e){return isNaN(e)?"-":(e=(e+"").split("."),e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:""))}return{parsePercent:t,parseCenter:n,parseRadius:i,addCommas:a}}),n("echarts/component/dataView",["require","./base","../config","zrender/tool/util","../component"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o),this.dom=o.dom,this._tDom=document.createElement("div"),this._textArea=document.createElement("textArea"),this._buttonRefresh=document.createElement("button"),this._buttonClose=document.createElement("button"),this._hasShow=!1,this._zrHeight=i.getHeight(),this._zrWidth=i.getWidth(),this._tDom.className="echarts-dataview",this.hide(),this.dom.firstChild.appendChild(this._tDom),window.addEventListener?(this._tDom.addEventListener("click",this._stop),this._tDom.addEventListener("mousewheel",this._stop),this._tDom.addEventListener("mousemove",this._stop),this._tDom.addEventListener("mousedown",this._stop),this._tDom.addEventListener("mouseup",this._stop),this._tDom.addEventListener("touchstart",this._stop),this._tDom.addEventListener("touchmove",this._stop),this._tDom.addEventListener("touchend",this._stop)):(this._tDom.attachEvent("onclick",this._stop),this._tDom.attachEvent("onmousewheel",this._stop),this._tDom.attachEvent("onmousemove",this._stop),this._tDom.attachEvent("onmousedown",this._stop),this._tDom.attachEvent("onmouseup",this._stop))}var n=e("./base"),i=e("../config"),a=e("zrender/tool/util");return t.prototype={type:i.COMPONENT_TYPE_DATAVIEW,_lang:["Data View","close","refresh"],_gCssText:"position:absolute;display:block;overflow:hidden;transition:height 0.8s,background-color 1s;-moz-transition:height 0.8s,background-color 1s;-webkit-transition:height 0.8s,background-color 1s;-o-transition:height 0.8s,background-color 1s;z-index:1;left:0;top:0;",hide:function(){this._sizeCssText="width:"+this._zrWidth+"px;height:0px;background-color:#f0ffff;",this._tDom.style.cssText=this._gCssText+this._sizeCssText},show:function(e){this._hasShow=!0;var t=this.query(this.option,"toolbox.feature.dataView.lang")||this._lang;this.option=e,this._tDom.innerHTML='

'+(t[0]||this._lang[0])+"

",this._textArea.style.cssText="display:block;margin:0 0 8px 0;padding:4px 6px;overflow:auto;width:"+(this._zrWidth-15)+"px;height:"+(this._zrHeight-100)+"px;";var n=this.query(this.option,"toolbox.feature.dataView.optionToContent");this._textArea.value="function"!=typeof n?this._optionToContent():n(this.option),this._tDom.appendChild(this._textArea),this._buttonClose.style.cssText="float:right;padding:1px 6px;",this._buttonClose.innerHTML=t[1]||this._lang[1];var i=this;this._buttonClose.onclick=function(){i.hide()},this._tDom.appendChild(this._buttonClose),this.query(this.option,"toolbox.feature.dataView.readOnly")===!1?(this._buttonRefresh.style.cssText="float:right;margin-right:10px;padding:1px 6px;",this._buttonRefresh.innerHTML=t[2]||this._lang[2],this._buttonRefresh.onclick=function(){i._save()},this._tDom.appendChild(this._buttonRefresh),this._textArea.readOnly=!1,this._textArea.style.cursor="default"):(this._textArea.readOnly=!0,this._textArea.style.cursor="text"),this._sizeCssText="width:"+this._zrWidth+"px;height:"+this._zrHeight+"px;background-color:#fff;",this._tDom.style.cssText=this._gCssText+this._sizeCssText},_optionToContent:function(){var e,t,n,a,o,r,s=[],l="";if(this.option.xAxis)for(s=this.option.xAxis instanceof Array?this.option.xAxis:[this.option.xAxis],e=0,a=s.length;a>e;e++)if("category"==(s[e].type||"category")){for(r=[],t=0,n=s[e].data.length;n>t;t++)r.push(this.getDataFromOption(s[e].data[t]));l+=r.join(", ")+"\n\n"}if(this.option.yAxis)for(s=this.option.yAxis instanceof Array?this.option.yAxis:[this.option.yAxis],e=0,a=s.length;a>e;e++)if("category"==s[e].type){for(r=[],t=0,n=s[e].data.length;n>t;t++)r.push(this.getDataFromOption(s[e].data[t]));l+=r.join(", ")+"\n\n"}var h,m=this.option.series;for(e=0,a=m.length;a>e;e++){for(r=[],t=0,n=m[e].data.length;n>t;t++)o=m[e].data[t],h=m[e].type==i.CHART_TYPE_PIE||m[e].type==i.CHART_TYPE_MAP?(o.name||"-")+":":"",m[e].type==i.CHART_TYPE_SCATTER&&(o=this.getDataFromOption(o).join(", ")),r.push(h+this.getDataFromOption(o));l+=(m[e].name||"-")+" : \n",l+=r.join(m[e].type==i.CHART_TYPE_SCATTER?"\n":", "),l+="\n\n"}return l},_save:function(){var e=this._textArea.value,t=this.query(this.option,"toolbox.feature.dataView.contentToOption");if("function"!=typeof t){e=e.split("\n");for(var n=[],a=0,o=e.length;o>a;a++)e[a]=this._trim(e[a]),""!==e[a]&&n.push(e[a]);this._contentToOption(n)}else t(e,this.option);this.hide();var r=this;setTimeout(function(){r.messageCenter&&r.messageCenter.dispatch(i.EVENT.DATA_VIEW_CHANGED,null,{option:r.option},r.myChart)},r.canvasSupported?800:100)},_contentToOption:function(e){var t,n,a,o,r,s,l,h=[],m=0;if(this.option.xAxis)for(h=this.option.xAxis instanceof Array?this.option.xAxis:[this.option.xAxis],t=0,o=h.length;o>t;t++)if("category"==(h[t].type||"category")){for(s=e[m].split(","),n=0,a=h[t].data.length;a>n;n++)l=this._trim(s[n]||""),r=h[t].data[n],"undefined"!=typeof h[t].data[n].value?h[t].data[n].value=l:h[t].data[n]=l;m++}if(this.option.yAxis)for(h=this.option.yAxis instanceof Array?this.option.yAxis:[this.option.yAxis],t=0,o=h.length;o>t;t++)if("category"==h[t].type){for(s=e[m].split(","),n=0,a=h[t].data.length;a>n;n++)l=this._trim(s[n]||""),r=h[t].data[n],"undefined"!=typeof h[t].data[n].value?h[t].data[n].value=l:h[t].data[n]=l;m++}var V=this.option.series;for(t=0,o=V.length;o>t;t++)if(m++,V[t].type==i.CHART_TYPE_SCATTER)for(var n=0,a=V[t].data.length;a>n;n++)s=e[m],l=s.replace(" ","").split(","),"undefined"!=typeof V[t].data[n].value?V[t].data[n].value=l:V[t].data[n]=l,m++;else{s=e[m].split(",");for(var n=0,a=V[t].data.length;a>n;n++)l=(s[n]||"").replace(/.*:/,""),l=this._trim(l),l="-"!=l&&""!==l?l-0:"-","undefined"!=typeof V[t].data[n].value?V[t].data[n].value=l:V[t].data[n]=l;m++}},_trim:function(e){var t=new RegExp("(^[\\s\\t\\xa0\\u3000]+)|([\\u3000\\xa0\\s\\t]+$)","g");return e.replace(t,"")},_stop:function(e){e=e||window.event,e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},resize:function(){this._zrHeight=this.zr.getHeight(),this._zrWidth=this.zr.getWidth(),this._tDom.offsetHeight>10&&(this._sizeCssText="width:"+this._zrWidth+"px;height:"+this._zrHeight+"px;background-color:#fff;",this._tDom.style.cssText=this._gCssText+this._sizeCssText,this._textArea.style.cssText="display:block;margin:0 0 8px 0;padding:4px 6px;overflow:auto;width:"+(this._zrWidth-15)+"px;height:"+(this._zrHeight-100)+"px;")},dispose:function(){window.removeEventListener?(this._tDom.removeEventListener("click",this._stop),this._tDom.removeEventListener("mousewheel",this._stop),this._tDom.removeEventListener("mousemove",this._stop),this._tDom.removeEventListener("mousedown",this._stop),this._tDom.removeEventListener("mouseup",this._stop),this._tDom.removeEventListener("touchstart",this._stop),this._tDom.removeEventListener("touchmove",this._stop),this._tDom.removeEventListener("touchend",this._stop)):(this._tDom.detachEvent("onclick",this._stop),this._tDom.detachEvent("onmousewheel",this._stop),this._tDom.detachEvent("onmousemove",this._stop),this._tDom.detachEvent("onmousedown",this._stop),this._tDom.detachEvent("onmouseup",this._stop)),this._buttonRefresh.onclick=null,this._buttonClose.onclick=null,this._hasShow&&(this._tDom.removeChild(this._textArea),this._tDom.removeChild(this._buttonRefresh),this._tDom.removeChild(this._buttonClose)),this._textArea=null,this._buttonRefresh=null,this._buttonClose=null,this.dom.firstChild.removeChild(this._tDom),this._tDom=null}},a.inherits(t,n),e("../component").define("dataView",t),t}),n("echarts/util/shape/Cross",["require","zrender/shape/Base","zrender/shape/Line","zrender/tool/util","./normalIsCover"],function(e){function t(e){n.call(this,e)}var n=e("zrender/shape/Base"),i=e("zrender/shape/Line"),a=e("zrender/tool/util");return t.prototype={type:"cross",buildPath:function(e,t){var n=t.rect;t.xStart=n.x,t.xEnd=n.x+n.width,t.yStart=t.yEnd=t.y,i.prototype.buildPath(e,t),t.xStart=t.xEnd=t.x,t.yStart=n.y,t.yEnd=n.y+n.height,i.prototype.buildPath(e,t)},getRect:function(e){return e.rect},isCover:e("./normalIsCover")},a.inherits(t,n),t}),n("zrender/shape/Sector",["require","../tool/math","../tool/computeBoundingBox","../tool/vector","./Base","../tool/util"],function(e){var t=e("../tool/math"),n=e("../tool/computeBoundingBox"),i=e("../tool/vector"),a=e("./Base"),o=i.create(),r=i.create(),s=i.create(),l=i.create(),h=function(e){a.call(this,e)};return h.prototype={type:"sector",buildPath:function(e,n){var i=n.x,a=n.y,o=n.r0||0,r=n.r,s=n.startAngle,l=n.endAngle,h=n.clockWise||!1;s=t.degreeToRadian(s),l=t.degreeToRadian(l),h||(s=-s,l=-l);var m=t.cos(s),V=t.sin(s);e.moveTo(m*o+i,V*o+a),e.lineTo(m*r+i,V*r+a),e.arc(i,a,r,s,l,!h),e.lineTo(t.cos(l)*o+i,t.sin(l)*o+a),0!==o&&e.arc(i,a,o,l,s,h),e.closePath()},getRect:function(e){if(e.__rect)return e.__rect;var a=e.x,h=e.y,m=e.r0||0,V=e.r,U=t.degreeToRadian(e.startAngle),d=t.degreeToRadian(e.endAngle),p=e.clockWise;return p||(U=-U,d=-d),m>1?n.arc(a,h,m,U,d,!p,o,s):(o[0]=s[0]=a,o[1]=s[1]=h),n.arc(a,h,V,U,d,!p,r,l),i.min(o,o,r),i.max(s,s,l),e.__rect={x:o[0],y:o[1],width:s[0]-o[0],height:s[1]-o[1]},e.__rect}},e("../tool/util").inherits(h,a),h}),n("echarts/util/shape/Candle",["require","zrender/shape/Base","zrender/tool/util","./normalIsCover"],function(e){function t(e){n.call(this,e)}var n=e("zrender/shape/Base"),i=e("zrender/tool/util");return t.prototype={type:"candle",_numberOrder:function(e,t){return t-e},buildPath:function(e,t){var n=i.clone(t.y).sort(this._numberOrder);e.moveTo(t.x,n[3]),e.lineTo(t.x,n[2]),e.moveTo(t.x-t.width/2,n[2]),e.rect(t.x-t.width/2,n[2],t.width,n[1]-n[2]),e.moveTo(t.x,n[1]),e.lineTo(t.x,n[0])},getRect:function(e){if(!e.__rect){var t=0;("stroke"==e.brushType||"fill"==e.brushType)&&(t=e.lineWidth||1);var n=i.clone(e.y).sort(this._numberOrder);e.__rect={x:Math.round(e.x-e.width/2-t/2),y:Math.round(n[3]-t/2),width:e.width+t,height:n[0]-n[3]+t}}return e.__rect},isCover:e("./normalIsCover")},i.inherits(t,n),t}),n("zrender/tool/computeBoundingBox",["require","./vector","./curve"],function(e){function t(e,t,n){if(0!==e.length){for(var i=e[0][0],a=e[0][0],o=e[0][1],r=e[0][1],s=1;sa&&(a=l[0]),l[1]r&&(r=l[1])}t[0]=i,t[1]=o,n[0]=a,n[1]=r}}function n(e,t,n,i,a,r){var s=[];o.cubicExtrema(e[0],t[0],n[0],i[0],s);for(var l=0;l=2*Math.PI)return m[0]=e-n,m[1]=t-n,V[0]=e+n,void(V[1]=t+n);if(r[0]=Math.cos(i)*n+e,r[1]=Math.sin(i)*n+t,s[0]=Math.cos(o)*n+e,s[1]=Math.sin(o)*n+t,a.min(m,r,s),a.max(V,r,s),i%=2*Math.PI,0>i&&(i+=2*Math.PI),o%=2*Math.PI,0>o&&(o+=2*Math.PI),i>o&&!h?o+=2*Math.PI:o>i&&h&&(i+=2*Math.PI),h){var U=o;o=i,i=U}for(var d=0;o>d;d+=Math.PI/2)d>i&&(l[0]=Math.cos(d)*n+e,l[1]=Math.sin(d)*n+t,a.min(m,l,m),a.max(V,l,V))};return t.cubeBezier=n,t.quadraticBezier=i,t.arc=h,t}),n("echarts/util/shape/Chain",["require","zrender/shape/Base","./Icon","zrender/shape/util/dashedLineTo","zrender/tool/util","zrender/tool/matrix"],function(e){function t(e){n.call(this,e)}var n=e("zrender/shape/Base"),i=e("./Icon"),a=e("zrender/shape/util/dashedLineTo"),o=e("zrender/tool/util"),r=e("zrender/tool/matrix");return t.prototype={type:"chain",brush:function(e,t){var n=this.style;t&&(n=this.getHighlightStyle(n,this.highlightStyle||{})),e.save(),this.setContext(e,n),this.setTransform(e),e.save(),e.beginPath(),this.buildLinePath(e,n),e.stroke(),e.restore(),this.brushSymbol(e,n),e.restore()},buildLinePath:function(e,t){var n=t.x,i=t.y+5,o=t.width,r=t.height/2-10;if(e.moveTo(n,i),e.lineTo(n,i+r),e.moveTo(n+o,i),e.lineTo(n+o,i+r),e.moveTo(n,i+r/2),t.lineType&&"solid"!=t.lineType){if("dashed"==t.lineType||"dotted"==t.lineType){var s=(t.lineWidth||1)*("dashed"==t.lineType?5:1);a(e,n,i+r/2,n+o,i+r/2,s)}}else e.lineTo(n+o,i+r/2)},brushSymbol:function(e,t){var n=t.y+t.height/4;e.save();for(var a,o=t.chainPoint,r=0,s=o.length;s>r;r++){if(a=o[r],"none"!=a.symbol){e.beginPath();var l=a.symbolSize;i.prototype.buildPath(e,{iconType:a.symbol,x:a.x-l,y:n-l,width:2*l,height:2*l,n:a.n}),e.fillStyle=a.isEmpty?"#fff":t.strokeColor,e.closePath(),e.fill(),e.stroke()}a.showLabel&&(e.font=a.textFont,e.fillStyle=a.textColor,e.textAlign=a.textAlign,e.textBaseline=a.textBaseline,a.rotation?(e.save(),this._updateTextTransform(e,a.rotation),e.fillText(a.name,a.textX,a.textY),e.restore()):e.fillText(a.name,a.textX,a.textY))}e.restore()},_updateTextTransform:function(e,t){var n=r.create();if(r.identity(n),0!==t[0]){var i=t[1]||0,a=t[2]||0;(i||a)&&r.translate(n,n,[-i,-a]),r.rotate(n,n,t[0]),(i||a)&&r.translate(n,n,[i,a])}e.transform.apply(e,n)},isCover:function(e,t){var n=this.style;return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height?!0:!1}},o.inherits(t,n),t +}),n("zrender/shape/Ring",["require","./Base","../tool/util"],function(e){var t=e("./Base"),n=function(e){t.call(this,e)};return n.prototype={type:"ring",buildPath:function(e,t){e.arc(t.x,t.y,t.r,0,2*Math.PI,!1),e.moveTo(t.x+t.r0,t.y),e.arc(t.x,t.y,t.r0,0,2*Math.PI,!0)},getRect:function(e){if(e.__rect)return e.__rect;var t;return t="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0,e.__rect={x:Math.round(e.x-e.r-t/2),y:Math.round(e.y-e.r-t/2),width:2*e.r+t,height:2*e.r+t},e.__rect}},e("../tool/util").inherits(n,t),n}),n("echarts/component/axis",["require","./base","zrender/shape/Line","../config","../util/ecData","zrender/tool/util","zrender/tool/color","./categoryAxis","./valueAxis","../component"],function(e){function t(e,t,i,a,o,r){n.call(this,e,t,i,a,o),this.axisType=r,this._axisList=[],this.refresh(a)}var n=e("./base"),i=e("zrender/shape/Line"),a=e("../config"),o=e("../util/ecData"),r=e("zrender/tool/util"),s=e("zrender/tool/color");return t.prototype={type:a.COMPONENT_TYPE_AXIS,axisBase:{_buildAxisLine:function(){var e=this.option.axisLine.lineStyle.width,t=e/2,n={_axisShape:"axisLine",zlevel:this.getZlevelBase(),z:this.getZBase()+3,hoverable:!1},a=this.grid;switch(this.option.position){case"left":n.style={xStart:a.getX()-t,yStart:a.getYend(),xEnd:a.getX()-t,yEnd:a.getY(),lineCap:"round"};break;case"right":n.style={xStart:a.getXend()+t,yStart:a.getYend(),xEnd:a.getXend()+t,yEnd:a.getY(),lineCap:"round"};break;case"bottom":n.style={xStart:a.getX(),yStart:a.getYend()+t,xEnd:a.getXend(),yEnd:a.getYend()+t,lineCap:"round"};break;case"top":n.style={xStart:a.getX(),yStart:a.getY()-t,xEnd:a.getXend(),yEnd:a.getY()-t,lineCap:"round"}}var o=n.style;""!==this.option.name&&(o.text=this.option.name,o.textPosition=this.option.nameLocation,o.textFont=this.getFont(this.option.nameTextStyle),this.option.nameTextStyle.align&&(o.textAlign=this.option.nameTextStyle.align),this.option.nameTextStyle.baseline&&(o.textBaseline=this.option.nameTextStyle.baseline),this.option.nameTextStyle.color&&(o.textColor=this.option.nameTextStyle.color)),o.strokeColor=this.option.axisLine.lineStyle.color,o.lineWidth=e,this.isHorizontal()?o.yStart=o.yEnd=this.subPixelOptimize(o.yEnd,e):o.xStart=o.xEnd=this.subPixelOptimize(o.xEnd,e),o.lineType=this.option.axisLine.lineStyle.type,n=new i(n),this.shapeList.push(n)},_axisLabelClickable:function(e,t){return e?(o.pack(t,void 0,-1,void 0,-1,t.style.text),t.hoverable=!0,t.clickable=!0,t.highlightStyle={color:s.lift(t.style.color,1),brushType:"fill"},t):t},refixAxisShape:function(e,t){if(this.option.axisLine.onZero){var n;if(this.isHorizontal()&&null!=t)for(var i=0,a=this.shapeList.length;a>i;i++)"axisLine"===this.shapeList[i]._axisShape?(this.shapeList[i].style.yStart=this.shapeList[i].style.yEnd=this.subPixelOptimize(t,this.shapeList[i].stylelineWidth),this.zr.modShape(this.shapeList[i].id)):"axisTick"===this.shapeList[i]._axisShape&&(n=this.shapeList[i].style.yEnd-this.shapeList[i].style.yStart,this.shapeList[i].style.yStart=t-n,this.shapeList[i].style.yEnd=t,this.zr.modShape(this.shapeList[i].id));if(!this.isHorizontal()&&null!=e)for(var i=0,a=this.shapeList.length;a>i;i++)"axisLine"===this.shapeList[i]._axisShape?(this.shapeList[i].style.xStart=this.shapeList[i].style.xEnd=this.subPixelOptimize(e,this.shapeList[i].stylelineWidth),this.zr.modShape(this.shapeList[i].id)):"axisTick"===this.shapeList[i]._axisShape&&(n=this.shapeList[i].style.xEnd-this.shapeList[i].style.xStart,this.shapeList[i].style.xStart=e,this.shapeList[i].style.xEnd=e+n,this.zr.modShape(this.shapeList[i].id))}},getPosition:function(){return this.option.position},isHorizontal:function(){return"bottom"===this.option.position||"top"===this.option.position}},reformOption:function(e){if(!e||e instanceof Array&&0===e.length?e=[{type:a.COMPONENT_TYPE_AXIS_VALUE}]:e instanceof Array||(e=[e]),e.length>2&&(e=[e[0],e[1]]),"xAxis"===this.axisType){(!e[0].position||"bottom"!=e[0].position&&"top"!=e[0].position)&&(e[0].position="bottom"),e.length>1&&(e[1].position="bottom"===e[0].position?"top":"bottom");for(var t=0,n=e.length;n>t;t++)e[t].type=e[t].type||"category",e[t].xAxisIndex=t,e[t].yAxisIndex=-1}else{(!e[0].position||"left"!=e[0].position&&"right"!=e[0].position)&&(e[0].position="left"),e.length>1&&(e[1].position="left"===e[0].position?"right":"left");for(var t=0,n=e.length;n>t;t++)e[t].type=e[t].type||"value",e[t].xAxisIndex=-1,e[t].yAxisIndex=t}return e},refresh:function(t){var n;t&&(this.option=t,"xAxis"===this.axisType?(this.option.xAxis=this.reformOption(t.xAxis),n=this.option.xAxis):(this.option.yAxis=this.reformOption(t.yAxis),n=this.option.yAxis),this.series=t.series);for(var i=e("./categoryAxis"),a=e("./valueAxis"),o=Math.max(n&&n.length||0,this._axisList.length),r=0;o>r;r++)!this._axisList[r]||!t||n[r]&&this._axisList[r].type==n[r].type||(this._axisList[r].dispose&&this._axisList[r].dispose(),this._axisList[r]=!1),this._axisList[r]?this._axisList[r].refresh&&this._axisList[r].refresh(n?n[r]:!1,this.series):n&&n[r]&&(this._axisList[r]="category"===n[r].type?new i(this.ecTheme,this.messageCenter,this.zr,n[r],this.myChart,this.axisBase):new a(this.ecTheme,this.messageCenter,this.zr,n[r],this.myChart,this.axisBase,this.series))},getAxis:function(e){return this._axisList[e]},clear:function(){for(var e=0,t=this._axisList.length;t>e;e++)this._axisList[e].dispose&&this._axisList[e].dispose();this._axisList=[]}},r.inherits(t,n),e("../component").define("axis",t),t}),n("echarts/component/grid",["require","./base","zrender/shape/Rectangle","../config","zrender/tool/util","../component"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o),this.refresh(a)}var n=e("./base"),i=e("zrender/shape/Rectangle"),a=e("../config");a.grid={zlevel:0,z:0,x:80,y:60,x2:80,y2:60,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"};var o=e("zrender/tool/util");return t.prototype={type:a.COMPONENT_TYPE_GRID,getX:function(){return this._x},getY:function(){return this._y},getWidth:function(){return this._width},getHeight:function(){return this._height},getXend:function(){return this._x+this._width},getYend:function(){return this._y+this._height},getArea:function(){return{x:this._x,y:this._y,width:this._width,height:this._height}},getBbox:function(){return[[this._x,this._y],[this.getXend(),this.getYend()]]},refixAxisShape:function(e){for(var t,n,i,o=e.xAxis._axisList.concat(e.yAxis?e.yAxis._axisList:[]),r=o.length;r--;)i=o[r],i.type==a.COMPONENT_TYPE_AXIS_VALUE&&i._min<0&&i._max>=0&&(i.isHorizontal()?t=i.getCoord(0):n=i.getCoord(0));if("undefined"!=typeof t||"undefined"!=typeof n)for(r=o.length;r--;)o[r].refixAxisShape(t,n)},refresh:function(e){if(e||this._zrWidth!=this.zr.getWidth()||this._zrHeight!=this.zr.getHeight()){this.clear(),this.option=e||this.option,this.option.grid=this.reformOption(this.option.grid);var t=this.option.grid;this._zrWidth=this.zr.getWidth(),this._zrHeight=this.zr.getHeight(),this._x=this.parsePercent(t.x,this._zrWidth),this._y=this.parsePercent(t.y,this._zrHeight);var n=this.parsePercent(t.x2,this._zrWidth),a=this.parsePercent(t.y2,this._zrHeight);this._width="undefined"==typeof t.width?this._zrWidth-this._x-n:this.parsePercent(t.width,this._zrWidth),this._width=this._width<=0?10:this._width,this._height="undefined"==typeof t.height?this._zrHeight-this._y-a:this.parsePercent(t.height,this._zrHeight),this._height=this._height<=0?10:this._height,this._x=this.subPixelOptimize(this._x,t.borderWidth),this._y=this.subPixelOptimize(this._y,t.borderWidth),this.shapeList.push(new i({zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this._x,y:this._y,width:this._width,height:this._height,brushType:t.borderWidth>0?"both":"fill",color:t.backgroundColor,strokeColor:t.borderColor,lineWidth:t.borderWidth}})),this.zr.addShape(this.shapeList[0])}}},o.inherits(t,n),e("../component").define("grid",t),t}),n("echarts/component/dataZoom",["require","./base","zrender/shape/Rectangle","zrender/shape/Polygon","../util/shape/Icon","../config","../util/date","zrender/tool/util","../component"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o);var r=this;r._ondrift=function(e,t){return r.__ondrift(this,e,t)},r._ondragend=function(){return r.__ondragend()},this._fillerSize=30,this._isSilence=!1,this._zoom={},this.option.dataZoom=this.reformOption(this.option.dataZoom),this.zoomOption=this.option.dataZoom,this._handleSize=this.zoomOption.handleSize,this.myChart.canvasSupported||(this.zoomOption.realtime=!1),this._location=this._getLocation(),this._zoom=this._getZoom(),this._backupData(),this.option.dataZoom.show&&this._buildShape(),this._syncData()}var n=e("./base"),i=e("zrender/shape/Rectangle"),a=e("zrender/shape/Polygon"),o=e("../util/shape/Icon"),r=e("../config");r.dataZoom={zlevel:0,z:4,show:!1,orient:"horizontal",backgroundColor:"rgba(0,0,0,0)",dataBackgroundColor:"#eee",fillerColor:"rgba(144,197,237,0.2)",handleColor:"rgba(70,130,180,0.8)",handleSize:8,showDetail:!0,realtime:!0};var s=e("../util/date"),l=e("zrender/tool/util");return t.prototype={type:r.COMPONENT_TYPE_DATAZOOM,_buildShape:function(){this._buildBackground(),this._buildFiller(),this._buildHandle(),this._buildFrame();for(var e=0,t=this.shapeList.length;t>e;e++)this.zr.addShape(this.shapeList[e]);this._syncFrameShape()},_getLocation:function(){var e,t,n,i,a=this.component.grid;return"horizontal"==this.zoomOption.orient?(n=this.zoomOption.width||a.getWidth(),i=this.zoomOption.height||this._fillerSize,e=null!=this.zoomOption.x?this.zoomOption.x:a.getX(),t=null!=this.zoomOption.y?this.zoomOption.y:this.zr.getHeight()-i-2):(n=this.zoomOption.width||this._fillerSize,i=this.zoomOption.height||a.getHeight(),e=null!=this.zoomOption.x?this.zoomOption.x:2,t=null!=this.zoomOption.y?this.zoomOption.y:a.getY()),{x:e,y:t,width:n,height:i}},_getZoom:function(){var e=this.option.series,t=this.option.xAxis;!t||t instanceof Array||(t=[t],this.option.xAxis=t);var n=this.option.yAxis;!n||n instanceof Array||(n=[n],this.option.yAxis=n);var i,a,o=[],s=this.zoomOption.xAxisIndex;if(t&&null==s){i=[];for(var l=0,h=t.length;h>l;l++)("category"==t[l].type||null==t[l].type)&&i.push(l)}else i=s instanceof Array?s:null!=s?[s]:[];if(s=this.zoomOption.yAxisIndex,n&&null==s){a=[];for(var l=0,h=n.length;h>l;l++)"category"==n[l].type&&a.push(l)}else a=s instanceof Array?s:null!=s?[s]:[];for(var m,l=0,h=e.length;h>l;l++)if(m=e[l],m.type==r.CHART_TYPE_LINE||m.type==r.CHART_TYPE_BAR||m.type==r.CHART_TYPE_SCATTER||m.type==r.CHART_TYPE_K){for(var V=0,U=i.length;U>V;V++)if(i[V]==(m.xAxisIndex||0)){o.push(l);break}for(var V=0,U=a.length;U>V;V++)if(a[V]==(m.yAxisIndex||0)){o.push(l);break}null==this.zoomOption.xAxisIndex&&null==this.zoomOption.yAxisIndex&&m.data&&this.getDataFromOption(m.data[0])instanceof Array&&(m.type==r.CHART_TYPE_SCATTER||m.type==r.CHART_TYPE_LINE||m.type==r.CHART_TYPE_BAR)&&o.push(l)}var d=null!=this._zoom.start?this._zoom.start:null!=this.zoomOption.start?this.zoomOption.start:0,p=null!=this._zoom.end?this._zoom.end:null!=this.zoomOption.end?this.zoomOption.end:100;d>p&&(d+=p,p=d-p,d-=p);var c=Math.round((p-d)/100*("horizontal"==this.zoomOption.orient?this._location.width:this._location.height));return{start:d,end:p,start2:0,end2:100,size:c,xAxisIndex:i,yAxisIndex:a,seriesIndex:o,scatterMap:this._zoom.scatterMap||{}}},_backupData:function(){this._originalData={xAxis:{},yAxis:{},series:{}};for(var e=this.option.xAxis,t=this._zoom.xAxisIndex,n=0,i=t.length;i>n;n++)this._originalData.xAxis[t[n]]=e[t[n]].data;for(var a=this.option.yAxis,o=this._zoom.yAxisIndex,n=0,i=o.length;i>n;n++)this._originalData.yAxis[o[n]]=a[o[n]].data;for(var s,l=this.option.series,h=this._zoom.seriesIndex,n=0,i=h.length;i>n;n++)s=l[h[n]],this._originalData.series[h[n]]=s.data,s.data&&this.getDataFromOption(s.data[0])instanceof Array&&(s.type==r.CHART_TYPE_SCATTER||s.type==r.CHART_TYPE_LINE||s.type==r.CHART_TYPE_BAR)&&(this._backupScale(),this._calculScatterMap(h[n]))},_calculScatterMap:function(t){this._zoom.scatterMap=this._zoom.scatterMap||{},this._zoom.scatterMap[t]=this._zoom.scatterMap[t]||{};var n=e("../component"),i=n.get("axis"),a=l.clone(this.option.xAxis);"category"==a[0].type&&(a[0].type="value"),a[1]&&"category"==a[1].type&&(a[1].type="value");var o=new i(this.ecTheme,null,!1,{xAxis:a,series:this.option.series},this,"xAxis"),r=this.option.series[t].xAxisIndex||0;this._zoom.scatterMap[t].x=o.getAxis(r).getExtremum(),o.dispose(),a=l.clone(this.option.yAxis),"category"==a[0].type&&(a[0].type="value"),a[1]&&"category"==a[1].type&&(a[1].type="value"),o=new i(this.ecTheme,null,!1,{yAxis:a,series:this.option.series},this,"yAxis"),r=this.option.series[t].yAxisIndex||0,this._zoom.scatterMap[t].y=o.getAxis(r).getExtremum(),o.dispose()},_buildBackground:function(){var e=this._location.width,t=this._location.height;this.shapeList.push(new i({zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this._location.x,y:this._location.y,width:e,height:t,color:this.zoomOption.backgroundColor}}));for(var n=0,o=this._originalData.xAxis,s=this._zoom.xAxisIndex,l=0,h=s.length;h>l;l++)n=Math.max(n,o[s[l]].length);for(var m=this._originalData.yAxis,V=this._zoom.yAxisIndex,l=0,h=V.length;h>l;l++)n=Math.max(n,m[V[l]].length);for(var U,d=this._zoom.seriesIndex[0],p=this._originalData.series[d],c=Number.MIN_VALUE,u=Number.MAX_VALUE,l=0,h=p.length;h>l;l++)U=this.getDataFromOption(p[l],0),this.option.series[d].type==r.CHART_TYPE_K&&(U=U[1]),isNaN(U)&&(U=0),c=Math.max(c,U),u=Math.min(u,U);var y=c-u,g=[],b=e/(n-(n>1?1:0)),f=t/(n-(n>1?1:0)),k=1;"horizontal"==this.zoomOption.orient&&1>b?k=Math.floor(3*n/e):"vertical"==this.zoomOption.orient&&1>f&&(k=Math.floor(3*n/t));for(var l=0,h=n;h>l;l+=k)U=this.getDataFromOption(p[l],0),this.option.series[d].type==r.CHART_TYPE_K&&(U=U[1]),isNaN(U)&&(U=0),g.push("horizontal"==this.zoomOption.orient?[this._location.x+b*l,this._location.y+t-1-Math.round((U-u)/y*(t-10))]:[this._location.x+1+Math.round((U-u)/y*(e-10)),this._location.y+f*(h-l-1)]);"horizontal"==this.zoomOption.orient?(g.push([this._location.x+e,this._location.y+t]),g.push([this._location.x,this._location.y+t])):(g.push([this._location.x,this._location.y]),g.push([this._location.x,this._location.y+t])),this.shapeList.push(new a({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{pointList:g,color:this.zoomOption.dataBackgroundColor},hoverable:!1}))},_buildFiller:function(){this._fillerShae={zlevel:this.getZlevelBase(),z:this.getZBase(),draggable:!0,ondrift:this._ondrift,ondragend:this._ondragend,_type:"filler"},this._fillerShae.style="horizontal"==this.zoomOption.orient?{x:this._location.x+Math.round(this._zoom.start/100*this._location.width)+this._handleSize,y:this._location.y,width:this._zoom.size-2*this._handleSize,height:this._location.height,color:this.zoomOption.fillerColor,text:":::",textPosition:"inside"}:{x:this._location.x,y:this._location.y+Math.round(this._zoom.start/100*this._location.height)+this._handleSize,width:this._location.width,height:this._zoom.size-2*this._handleSize,color:this.zoomOption.fillerColor,text:"::",textPosition:"inside"},this._fillerShae.highlightStyle={brushType:"fill",color:"rgba(0,0,0,0)"},this._fillerShae=new i(this._fillerShae),this.shapeList.push(this._fillerShae)},_buildHandle:function(){var e=this.zoomOption.showDetail?this._getDetail():{start:"",end:""};this._startShape={zlevel:this.getZlevelBase(),z:this.getZBase(),draggable:!0,style:{iconType:"rectangle",x:this._location.x,y:this._location.y,width:this._handleSize,height:this._handleSize,color:this.zoomOption.handleColor,text:"=",textPosition:"inside"},highlightStyle:{text:e.start,brushType:"fill",textPosition:"left"},ondrift:this._ondrift,ondragend:this._ondragend},"horizontal"==this.zoomOption.orient?(this._startShape.style.height=this._location.height,this._endShape=l.clone(this._startShape),this._startShape.style.x=this._fillerShae.style.x-this._handleSize,this._endShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._endShape.highlightStyle.text=e.end,this._endShape.highlightStyle.textPosition="right"):(this._startShape.style.width=this._location.width,this._endShape=l.clone(this._startShape),this._startShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._startShape.highlightStyle.textPosition="bottom",this._endShape.style.y=this._fillerShae.style.y-this._handleSize,this._endShape.highlightStyle.text=e.end,this._endShape.highlightStyle.textPosition="top"),this._startShape=new o(this._startShape),this._endShape=new o(this._endShape),this.shapeList.push(this._startShape),this.shapeList.push(this._endShape)},_buildFrame:function(){var e=this.subPixelOptimize(this._location.x,1),t=this.subPixelOptimize(this._location.y,1);this._startFrameShape={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:e,y:t,width:this._location.width-(e>this._location.x?1:0),height:this._location.height-(t>this._location.y?1:0),lineWidth:1,brushType:"stroke",strokeColor:this.zoomOption.handleColor}},this._endFrameShape=l.clone(this._startFrameShape),this._startFrameShape=new i(this._startFrameShape),this._endFrameShape=new i(this._endFrameShape),this.shapeList.push(this._startFrameShape),this.shapeList.push(this._endFrameShape)},_syncHandleShape:function(){"horizontal"==this.zoomOption.orient?(this._startShape.style.x=this._fillerShae.style.x-this._handleSize,this._endShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._zoom.start=(this._startShape.style.x-this._location.x)/this._location.width*100,this._zoom.end=(this._endShape.style.x+this._handleSize-this._location.x)/this._location.width*100):(this._startShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._endShape.style.y=this._fillerShae.style.y-this._handleSize,this._zoom.start=(this._location.y+this._location.height-this._startShape.style.y)/this._location.height*100,this._zoom.end=(this._location.y+this._location.height-this._endShape.style.y-this._handleSize)/this._location.height*100),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this._syncFrameShape(),this.zr.refreshNextFrame()},_syncFillerShape:function(){var e,t;"horizontal"==this.zoomOption.orient?(e=this._startShape.style.x,t=this._endShape.style.x,this._fillerShae.style.x=Math.min(e,t)+this._handleSize,this._fillerShae.style.width=Math.abs(e-t)-this._handleSize,this._zoom.start=(Math.min(e,t)-this._location.x)/this._location.width*100,this._zoom.end=(Math.max(e,t)+this._handleSize-this._location.x)/this._location.width*100):(e=this._startShape.style.y,t=this._endShape.style.y,this._fillerShae.style.y=Math.min(e,t)+this._handleSize,this._fillerShae.style.height=Math.abs(e-t)-this._handleSize,this._zoom.start=(this._location.y+this._location.height-Math.max(e,t))/this._location.height*100,this._zoom.end=(this._location.y+this._location.height-Math.min(e,t)-this._handleSize)/this._location.height*100),this.zr.modShape(this._fillerShae.id),this._syncFrameShape(),this.zr.refreshNextFrame()},_syncFrameShape:function(){"horizontal"==this.zoomOption.orient?(this._startFrameShape.style.width=this._fillerShae.style.x-this._location.x,this._endFrameShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._endFrameShape.style.width=this._location.x+this._location.width-this._endFrameShape.style.x):(this._startFrameShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._startFrameShape.style.height=this._location.y+this._location.height-this._startFrameShape.style.y,this._endFrameShape.style.height=this._fillerShae.style.y-this._location.y),this.zr.modShape(this._startFrameShape.id),this.zr.modShape(this._endFrameShape.id)},_syncShape:function(){this.zoomOption.show&&("horizontal"==this.zoomOption.orient?(this._startShape.style.x=this._location.x+this._zoom.start/100*this._location.width,this._endShape.style.x=this._location.x+this._zoom.end/100*this._location.width-this._handleSize,this._fillerShae.style.x=this._startShape.style.x+this._handleSize,this._fillerShae.style.width=this._endShape.style.x-this._startShape.style.x-this._handleSize):(this._startShape.style.y=this._location.y+this._location.height-this._zoom.start/100*this._location.height,this._endShape.style.y=this._location.y+this._location.height-this._zoom.end/100*this._location.height-this._handleSize,this._fillerShae.style.y=this._endShape.style.y+this._handleSize,this._fillerShae.style.height=this._startShape.style.y-this._endShape.style.y-this._handleSize),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this.zr.modShape(this._fillerShae.id),this._syncFrameShape(),this.zr.refresh())},_syncData:function(e){var t,n,i,a,o;for(var s in this._originalData){t=this._originalData[s];for(var l in t)o=t[l],null!=o&&(a=o.length,n=Math.floor(this._zoom.start/100*a),i=Math.ceil(this._zoom.end/100*a),this.getDataFromOption(o[0])instanceof Array&&this.option[s][l].type!=r.CHART_TYPE_K?(this._setScale(),this.option[s][l].data=this._synScatterData(l,o)):this.option[s][l].data=o.slice(n,i))}this._isSilence||!this.zoomOption.realtime&&!e||this.messageCenter.dispatch(r.EVENT.DATA_ZOOM,null,{zoom:this._zoom},this.myChart)},_synScatterData:function(e,t){if(0===this._zoom.start&&100==this._zoom.end&&0===this._zoom.start2&&100==this._zoom.end2)return t;var n,i,a,o,r,s=[],l=this._zoom.scatterMap[e];"horizontal"==this.zoomOption.orient?(n=l.x.max-l.x.min,i=this._zoom.start/100*n+l.x.min,a=this._zoom.end/100*n+l.x.min,n=l.y.max-l.y.min,o=this._zoom.start2/100*n+l.y.min,r=this._zoom.end2/100*n+l.y.min):(n=l.x.max-l.x.min,i=this._zoom.start2/100*n+l.x.min,a=this._zoom.end2/100*n+l.x.min,n=l.y.max-l.y.min,o=this._zoom.start/100*n+l.y.min,r=this._zoom.end/100*n+l.y.min);for(var h,m=0,V=t.length;V>m;m++)h=t[m].value||t[m],h[0]>=i&&h[0]<=a&&h[1]>=o&&h[1]<=r&&s.push(t[m]);return s},_setScale:function(){var e=0!==this._zoom.start||100!==this._zoom.end||0!==this._zoom.start2||100!==this._zoom.end2,t={xAxis:this.option.xAxis,yAxis:this.option.yAxis};for(var n in t)for(var i=0,a=t[n].length;a>i;i++)t[n][i].scale=e||t[n][i]._scale},_backupScale:function(){var e={xAxis:this.option.xAxis,yAxis:this.option.yAxis};for(var t in e)for(var n=0,i=e[t].length;i>n;n++)e[t][n]._scale=e[t][n].scale},_getDetail:function(){var e="horizontal"==this.zoomOption.orient?"xAxis":"yAxis",t=this._originalData[e];for(var n in t){var i=t[n];if(null!=i){var a=i.length,o=Math.floor(this._zoom.start/100*a),r=Math.ceil(this._zoom.end/100*a);return r-=r>0?1:0,{start:this.getDataFromOption(i[o]),end:this.getDataFromOption(i[r])}}}var l=this._zoom.seriesIndex[0],h=this.option.series[l][e+"Index"]||0,m=this.option[e][h].type,V=this._zoom.scatterMap[l][e.charAt(0)].min,U=this._zoom.scatterMap[l][e.charAt(0)].max,d=U-V;if("value"==m)return{start:V+d*this._zoom.start/100,end:V+d*this._zoom.end/100};if("time"==m){U=V+d*this._zoom.end/100,V+=d*this._zoom.start/100;var p=s.getAutoFormatter(V,U).formatter;return{start:s.format(p,V),end:s.format(p,U)}}return{start:"",end:""}},__ondrift:function(e,t,n){this.zoomOption.zoomLock&&(e=this._fillerShae);var i="filler"==e._type?this._handleSize:0;if("horizontal"==this.zoomOption.orient?e.style.x+t-i<=this._location.x?e.style.x=this._location.x+i:e.style.x+t+e.style.width+i>=this._location.x+this._location.width?e.style.x=this._location.x+this._location.width-e.style.width-i:e.style.x+=t:e.style.y+n-i<=this._location.y?e.style.y=this._location.y+i:e.style.y+n+e.style.height+i>=this._location.y+this._location.height?e.style.y=this._location.y+this._location.height-e.style.height-i:e.style.y+=n,"filler"==e._type?this._syncHandleShape():this._syncFillerShape(),this.zoomOption.realtime&&this._syncData(),this.zoomOption.showDetail){var a=this._getDetail();this._startShape.style.text=this._startShape.highlightStyle.text=a.start,this._endShape.style.text=this._endShape.highlightStyle.text=a.end,this._startShape.style.textPosition=this._startShape.highlightStyle.textPosition,this._endShape.style.textPosition=this._endShape.highlightStyle.textPosition}return!0},__ondragend:function(){this.zoomOption.showDetail&&(this._startShape.style.text=this._endShape.style.text="=",this._startShape.style.textPosition=this._endShape.style.textPosition="inside",this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this.zr.refreshNextFrame()),this.isDragend=!0},ondragend:function(e,t){this.isDragend&&e.target&&(!this.zoomOption.realtime&&this._syncData(),t.dragOut=!0,t.dragIn=!0,this._isSilence||this.zoomOption.realtime||this.messageCenter.dispatch(r.EVENT.DATA_ZOOM,null,{zoom:this._zoom},this.myChart),t.needRefresh=!1,this.isDragend=!1)},ondataZoom:function(e,t){t.needRefresh=!0},absoluteZoom:function(e){this._zoom.start=e.start,this._zoom.end=e.end,this._zoom.start2=e.start2,this._zoom.end2=e.end2,this._syncShape(),this._syncData(!0)},rectZoom:function(e){if(!e)return this._zoom.start=this._zoom.start2=0,this._zoom.end=this._zoom.end2=100,this._syncShape(),this._syncData(!0),this._zoom;var t=this.component.grid.getArea(),n={x:e.x,y:e.y,width:e.width,height:e.height};if(n.width<0&&(n.x+=n.width,n.width=-n.width),n.height<0&&(n.y+=n.height,n.height=-n.height),n.x>t.x+t.width||n.y>t.y+t.height)return!1;n.xt.x+t.width&&(n.width=t.x+t.width-n.x),n.y+n.height>t.y+t.height&&(n.height=t.y+t.height-n.y);var i,a=(n.x-t.x)/t.width,o=1-(n.x+n.width-t.x)/t.width,r=1-(n.y+n.height-t.y)/t.height,s=(n.y-t.y)/t.height;return"horizontal"==this.zoomOption.orient?(i=this._zoom.end-this._zoom.start,this._zoom.start+=i*a,this._zoom.end-=i*o,i=this._zoom.end2-this._zoom.start2,this._zoom.start2+=i*r,this._zoom.end2-=i*s):(i=this._zoom.end-this._zoom.start,this._zoom.start+=i*r,this._zoom.end-=i*s,i=this._zoom.end2-this._zoom.start2,this._zoom.start2+=i*a,this._zoom.end2-=i*o),this._syncShape(),this._syncData(!0),this._zoom},syncBackupData:function(e){for(var t,n,i=this._originalData.series,a=e.series,o=0,r=a.length;r>o;o++){n=a[o].data||a[o].eventList,t=i[o]?Math.floor(this._zoom.start/100*i[o].length):0;for(var s=0,l=n.length;l>s;s++)i[o]&&(i[o][s+t]=n[s])}},syncOption:function(e){this.silence(!0),this.option=e,this.option.dataZoom=this.reformOption(this.option.dataZoom),this.zoomOption=this.option.dataZoom,this.myChart.canvasSupported||(this.zoomOption.realtime=!1),this.clear(),this._location=this._getLocation(),this._zoom=this._getZoom(),this._backupData(),this.option.dataZoom&&this.option.dataZoom.show&&this._buildShape(),this._syncData(),this.silence(!1)},silence:function(e){this._isSilence=e},getRealDataIndex:function(e,t){if(!this._originalData||0===this._zoom.start&&100==this._zoom.end)return t;var n=this._originalData.series;return n[e]?Math.floor(this._zoom.start/100*n[e].length)+t:-1},resize:function(){this.clear(),this._location=this._getLocation(),this._zoom=this._getZoom(),this.option.dataZoom.show&&this._buildShape()}},l.inherits(t,n),e("../component").define("dataZoom",t),t}),n("echarts/component/categoryAxis",["require","./base","zrender/shape/Text","zrender/shape/Line","zrender/shape/Rectangle","../config","zrender/tool/util","zrender/tool/area","../component"],function(e){function t(e,t,i,a,o,r){if(a.data.length<1)return void console.error("option.data.length < 1.");n.call(this,e,t,i,a,o),this.grid=this.component.grid;for(var s in r)this[s]=r[s];this.refresh(a)}var n=e("./base"),i=e("zrender/shape/Text"),a=e("zrender/shape/Line"),o=e("zrender/shape/Rectangle"),r=e("../config");r.categoryAxis={zlevel:0,z:0,show:!0,position:"bottom",name:"",nameLocation:"end",nameTextStyle:{},boundaryGap:!0,axisLine:{show:!0,onZero:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!0,interval:"auto",inside:!1,length:5,lineStyle:{color:"#333",width:1}},axisLabel:{show:!0,interval:"auto",rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}}};var s=e("zrender/tool/util"),l=e("zrender/tool/area");return t.prototype={type:r.COMPONENT_TYPE_AXIS_CATEGORY,_getReformedLabel:function(e){var t=this.getDataFromOption(this.option.data[e]),n=this.option.data[e].formatter||this.option.axisLabel.formatter;return n&&("function"==typeof n?t=n.call(this.myChart,t):"string"==typeof n&&(t=n.replace("{value}",t))),t},_getInterval:function(){var e=this.option.axisLabel.interval;if("auto"==e){var t=this.option.axisLabel.textStyle.fontSize,n=this.option.data,i=this.option.data.length;if(this.isHorizontal())if(i>3){var a,o,r=this.getGap(),h=!1,m=Math.floor(.5/r);for(m=1>m?1:m,e=Math.floor(15/r);!h&&i>e;){e+=m,h=!0,a=Math.floor(r*e);for(var V=Math.floor((i-1)/e)*e;V>=0;V-=e){if(0!==this.option.axisLabel.rotate)o=t;else if(n[V].textStyle)o=l.getTextWidth(this._getReformedLabel(V),this.getFont(s.merge(n[V].textStyle,this.option.axisLabel.textStyle)));else{var U=this._getReformedLabel(V)+"",d=(U.match(/\w/g)||"").length,p=U.length-d;o=d*t*2/3+p*t}if(o>a){h=!1;break}}}}else e=1;else if(i>3){var r=this.getGap();for(e=Math.floor(11/r);t>r*e-6&&i>e;)e++}else e=1}else e="function"==typeof e?1:e-0+1;return e},_buildShape:function(){if(this._interval=this._getInterval(),this.option.show){this.option.splitArea.show&&this._buildSplitArea(),this.option.splitLine.show&&this._buildSplitLine(),this.option.axisLine.show&&this._buildAxisLine(),this.option.axisTick.show&&this._buildAxisTick(),this.option.axisLabel.show&&this._buildAxisLabel();for(var e=0,t=this.shapeList.length;t>e;e++)this.zr.addShape(this.shapeList[e])}},_buildAxisTick:function(){var e,t=this.option.data,n=this.option.data.length,i=this.option.axisTick,o=i.length,r=i.lineStyle.color,s=i.lineStyle.width,l="function"==typeof i.interval?i.interval:"auto"==i.interval&&"function"==typeof this.option.axisLabel.interval?this.option.axisLabel.interval:!1,h=l?1:"auto"==i.interval?this._interval:i.interval-0+1,m=i.onGap,V=m?this.getGap()/2:"undefined"==typeof m&&this.option.boundaryGap?this.getGap()/2:0,U=V>0?-h:0;if(this.isHorizontal())for(var d,p="bottom"==this.option.position?i.inside?this.grid.getYend()-o-1:this.grid.getYend()+1:i.inside?this.grid.getY()+1:this.grid.getY()-o-1,c=U;n>c;c+=h)(!l||l(c,t[c]))&&(d=this.subPixelOptimize(this.getCoordByIndex(c)+(c>=0?V:0),s),e={_axisShape:"axisTick",zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:d,yStart:p,xEnd:d,yEnd:p+o,strokeColor:r,lineWidth:s}},this.shapeList.push(new a(e)));else for(var u,y="left"==this.option.position?i.inside?this.grid.getX()+1:this.grid.getX()-o-1:i.inside?this.grid.getXend()-o-1:this.grid.getXend()+1,c=U;n>c;c+=h)(!l||l(c,t[c]))&&(u=this.subPixelOptimize(this.getCoordByIndex(c)-(c>=0?V:0),s),e={_axisShape:"axisTick",zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:y,yStart:u,xEnd:y+o,yEnd:u,strokeColor:r,lineWidth:s}},this.shapeList.push(new a(e)))},_buildAxisLabel:function(){var e,t,n=this.option.data,a=this.option.data.length,o=this.option.axisLabel,r=o.rotate,l=o.margin,h=o.clickable,m=o.textStyle,V="function"==typeof o.interval?o.interval:!1;if(this.isHorizontal()){var U,d;"bottom"==this.option.position?(U=this.grid.getYend()+l,d="top"):(U=this.grid.getY()-l,d="bottom");for(var p=0;a>p;p+=this._interval)V&&!V(p,n[p])||""===this._getReformedLabel(p)||(t=s.merge(n[p].textStyle||{},m),e={zlevel:this.getZlevelBase(),z:this.getZBase()+3,hoverable:!1,style:{x:this.getCoordByIndex(p),y:U,color:t.color,text:this._getReformedLabel(p),textFont:this.getFont(t),textAlign:t.align||"center",textBaseline:t.baseline||d}},r&&(e.style.textAlign=r>0?"bottom"==this.option.position?"right":"left":"bottom"==this.option.position?"left":"right",e.rotation=[r*Math.PI/180,e.style.x,e.style.y]),this.shapeList.push(new i(this._axisLabelClickable(h,e))))}else{var c,u;"left"==this.option.position?(c=this.grid.getX()-l,u="right"):(c=this.grid.getXend()+l,u="left");for(var p=0;a>p;p+=this._interval)V&&!V(p,n[p])||""===this._getReformedLabel(p)||(t=s.merge(n[p].textStyle||{},m),e={zlevel:this.getZlevelBase(),z:this.getZBase()+3,hoverable:!1,style:{x:c,y:this.getCoordByIndex(p),color:t.color,text:this._getReformedLabel(p),textFont:this.getFont(t),textAlign:t.align||u,textBaseline:t.baseline||0===p&&""!==this.option.name?"bottom":p==a-1&&""!==this.option.name?"top":"middle"}},r&&(e.rotation=[r*Math.PI/180,e.style.x,e.style.y]),this.shapeList.push(new i(this._axisLabelClickable(h,e)))) +}},_buildSplitLine:function(){var e,t=this.option.data,n=this.option.data.length,i=this.option.splitLine,o=i.lineStyle.type,r=i.lineStyle.width,s=i.lineStyle.color;s=s instanceof Array?s:[s];var l=s.length,h="function"==typeof this.option.axisLabel.interval?this.option.axisLabel.interval:!1,m=i.onGap,V=m?this.getGap()/2:"undefined"==typeof m&&this.option.boundaryGap?this.getGap()/2:0;if(n-=m||"undefined"==typeof m&&this.option.boundaryGap?1:0,this.isHorizontal())for(var U,d=this.grid.getY(),p=this.grid.getYend(),c=0;n>c;c+=this._interval)(!h||h(c,t[c]))&&(U=this.subPixelOptimize(this.getCoordByIndex(c)+V,r),e={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:U,yStart:d,xEnd:U,yEnd:p,strokeColor:s[c/this._interval%l],lineType:o,lineWidth:r}},this.shapeList.push(new a(e)));else for(var u,y=this.grid.getX(),g=this.grid.getXend(),c=0;n>c;c+=this._interval)(!h||h(c,t[c]))&&(u=this.subPixelOptimize(this.getCoordByIndex(c)-V,r),e={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:y,yStart:u,xEnd:g,yEnd:u,strokeColor:s[c/this._interval%l],lineType:o,lineWidth:r}},this.shapeList.push(new a(e)))},_buildSplitArea:function(){var e,t=this.option.data,n=this.option.splitArea,i=n.areaStyle.color;if(i instanceof Array){var a=i.length,r=this.option.data.length,s="function"==typeof this.option.axisLabel.interval?this.option.axisLabel.interval:!1,l=n.onGap,h=l?this.getGap()/2:"undefined"==typeof l&&this.option.boundaryGap?this.getGap()/2:0;if(this.isHorizontal())for(var m,V=this.grid.getY(),U=this.grid.getHeight(),d=this.grid.getX(),p=0;r>=p;p+=this._interval)s&&!s(p,t[p])&&r>p||(m=r>p?this.getCoordByIndex(p)+h:this.grid.getXend(),e={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:d,y:V,width:m-d,height:U,color:i[p/this._interval%a]}},this.shapeList.push(new o(e)),d=m);else for(var c,u=this.grid.getX(),y=this.grid.getWidth(),g=this.grid.getYend(),p=0;r>=p;p+=this._interval)s&&!s(p,t[p])&&r>p||(c=r>p?this.getCoordByIndex(p)-h:this.grid.getY(),e={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:u,y:c,width:y,height:g-c,color:i[p/this._interval%a]}},this.shapeList.push(new o(e)),g=c)}else e={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this.grid.getX(),y:this.grid.getY(),width:this.grid.getWidth(),height:this.grid.getHeight(),color:i}},this.shapeList.push(new o(e))},refresh:function(e){e&&(this.option=this.reformOption(e),this.option.axisLabel.textStyle=this.getTextStyle(this.option.axisLabel.textStyle)),this.clear(),this._buildShape()},getGap:function(){var e=this.option.data.length,t=this.isHorizontal()?this.grid.getWidth():this.grid.getHeight();return this.option.boundaryGap?t/e:t/(e>1?e-1:1)},getCoord:function(e){for(var t=this.option.data,n=t.length,i=this.getGap(),a=this.option.boundaryGap?i/2:0,o=0;n>o;o++){if(this.getDataFromOption(t[o])==e)return a=this.isHorizontal()?this.grid.getX()+a:this.grid.getYend()-a;a+=i}},getCoordByIndex:function(e){if(0>e)return this.isHorizontal()?this.grid.getX():this.grid.getYend();if(e>this.option.data.length-1)return this.isHorizontal()?this.grid.getXend():this.grid.getY();var t=this.getGap(),n=this.option.boundaryGap?t/2:0;return n+=e*t,n=this.isHorizontal()?this.grid.getX()+n:this.grid.getYend()-n},getNameByIndex:function(e){return this.getDataFromOption(this.option.data[e])},getIndexByName:function(e){for(var t=this.option.data,n=t.length,i=0;n>i;i++)if(this.getDataFromOption(t[i])==e)return i;return-1},getValueFromCoord:function(){return""},isMainAxis:function(e){return e%this._interval===0}},s.inherits(t,n),e("../component").define("categoryAxis",t),t}),n("echarts/component/valueAxis",["require","./base","zrender/shape/Text","zrender/shape/Line","zrender/shape/Rectangle","../config","../util/date","zrender/tool/util","../util/smartSteps","../util/accMath","../component"],function(e){function t(e,t,i,a,o,r,s){if(!s||0===s.length)return void console.err("option.series.length == 0.");n.call(this,e,t,i,a,o),this.series=s,this.grid=this.component.grid;for(var l in r)this[l]=r[l];this.refresh(a,s)}var n=e("./base"),i=e("zrender/shape/Text"),a=e("zrender/shape/Line"),o=e("zrender/shape/Rectangle"),r=e("../config");r.valueAxis={zlevel:0,z:0,show:!0,position:"left",name:"",nameLocation:"end",nameTextStyle:{},boundaryGap:[0,0],axisLine:{show:!0,onZero:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,inside:!1,length:5,lineStyle:{color:"#333",width:1}},axisLabel:{show:!0,rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}}};var s=e("../util/date"),l=e("zrender/tool/util");return t.prototype={type:r.COMPONENT_TYPE_AXIS_VALUE,_buildShape:function(){if(this._hasData=!1,this._calculateValue(),this._hasData&&this.option.show){this.option.splitArea.show&&this._buildSplitArea(),this.option.splitLine.show&&this._buildSplitLine(),this.option.axisLine.show&&this._buildAxisLine(),this.option.axisTick.show&&this._buildAxisTick(),this.option.axisLabel.show&&this._buildAxisLabel();for(var e=0,t=this.shapeList.length;t>e;e++)this.zr.addShape(this.shapeList[e])}},_buildAxisTick:function(){var e,t=this._valueList,n=this._valueList.length,i=this.option.axisTick,o=i.length,r=i.lineStyle.color,s=i.lineStyle.width;if(this.isHorizontal())for(var l,h="bottom"===this.option.position?i.inside?this.grid.getYend()-o-1:this.grid.getYend()+1:i.inside?this.grid.getY()+1:this.grid.getY()-o-1,m=0;n>m;m++)l=this.subPixelOptimize(this.getCoord(t[m]),s),e={_axisShape:"axisTick",zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:l,yStart:h,xEnd:l,yEnd:h+o,strokeColor:r,lineWidth:s}},this.shapeList.push(new a(e));else for(var V,U="left"===this.option.position?i.inside?this.grid.getX()+1:this.grid.getX()-o-1:i.inside?this.grid.getXend()-o-1:this.grid.getXend()+1,m=0;n>m;m++)V=this.subPixelOptimize(this.getCoord(t[m]),s),e={_axisShape:"axisTick",zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:U,yStart:V,xEnd:U+o,yEnd:V,strokeColor:r,lineWidth:s}},this.shapeList.push(new a(e))},_buildAxisLabel:function(){var e,t=this._valueList,n=this._valueList.length,a=this.option.axisLabel.rotate,o=this.option.axisLabel.margin,r=this.option.axisLabel.clickable,s=this.option.axisLabel.textStyle;if(this.isHorizontal()){var l,h;"bottom"===this.option.position?(l=this.grid.getYend()+o,h="top"):(l=this.grid.getY()-o,h="bottom");for(var m=0;n>m;m++)e={zlevel:this.getZlevelBase(),z:this.getZBase()+3,hoverable:!1,style:{x:this.getCoord(t[m]),y:l,color:"function"==typeof s.color?s.color(t[m]):s.color,text:this._valueLabel[m],textFont:this.getFont(s),textAlign:s.align||"center",textBaseline:s.baseline||h}},a&&(e.style.textAlign=a>0?"bottom"===this.option.position?"right":"left":"bottom"===this.option.position?"left":"right",e.rotation=[a*Math.PI/180,e.style.x,e.style.y]),this.shapeList.push(new i(this._axisLabelClickable(r,e)))}else{var V,U;"left"===this.option.position?(V=this.grid.getX()-o,U="right"):(V=this.grid.getXend()+o,U="left");for(var m=0;n>m;m++)e={zlevel:this.getZlevelBase(),z:this.getZBase()+3,hoverable:!1,style:{x:V,y:this.getCoord(t[m]),color:"function"==typeof s.color?s.color(t[m]):s.color,text:this._valueLabel[m],textFont:this.getFont(s),textAlign:s.align||U,textBaseline:s.baseline||(0===m&&""!==this.option.name?"bottom":m===n-1&&""!==this.option.name?"top":"middle")}},a&&(e.rotation=[a*Math.PI/180,e.style.x,e.style.y]),this.shapeList.push(new i(this._axisLabelClickable(r,e)))}},_buildSplitLine:function(){var e,t=this._valueList,n=this._valueList.length,i=this.option.splitLine,o=i.lineStyle.type,r=i.lineStyle.width,s=i.lineStyle.color;s=s instanceof Array?s:[s];var l=s.length;if(this.isHorizontal())for(var h,m=this.grid.getY(),V=this.grid.getYend(),U=0;n>U;U++)h=this.subPixelOptimize(this.getCoord(t[U]),r),e={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:h,yStart:m,xEnd:h,yEnd:V,strokeColor:s[U%l],lineType:o,lineWidth:r}},this.shapeList.push(new a(e));else for(var d,p=this.grid.getX(),c=this.grid.getXend(),U=0;n>U;U++)d=this.subPixelOptimize(this.getCoord(t[U]),r),e={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:p,yStart:d,xEnd:c,yEnd:d,strokeColor:s[U%l],lineType:o,lineWidth:r}},this.shapeList.push(new a(e))},_buildSplitArea:function(){var e,t=this.option.splitArea.areaStyle.color;if(t instanceof Array){var n=t.length,i=this._valueList,a=this._valueList.length;if(this.isHorizontal())for(var r,s=this.grid.getY(),l=this.grid.getHeight(),h=this.grid.getX(),m=0;a>=m;m++)r=a>m?this.getCoord(i[m]):this.grid.getXend(),e={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:h,y:s,width:r-h,height:l,color:t[m%n]}},this.shapeList.push(new o(e)),h=r;else for(var V,U=this.grid.getX(),d=this.grid.getWidth(),p=this.grid.getYend(),m=0;a>=m;m++)V=a>m?this.getCoord(i[m]):this.grid.getY(),e={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:U,y:V,width:d,height:p-V,color:t[m%n]}},this.shapeList.push(new o(e)),p=V}else e={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this.grid.getX(),y:this.grid.getY(),width:this.grid.getWidth(),height:this.grid.getHeight(),color:t}},this.shapeList.push(new o(e))},_calculateValue:function(){if(isNaN(this.option.min-0)||isNaN(this.option.max-0)){for(var e,t,n={},i=this.component.legend,a=0,o=this.series.length;o>a;a++)!(this.series[a].type!=r.CHART_TYPE_LINE&&this.series[a].type!=r.CHART_TYPE_BAR&&this.series[a].type!=r.CHART_TYPE_SCATTER&&this.series[a].type!=r.CHART_TYPE_K&&this.series[a].type!=r.CHART_TYPE_EVENTRIVER||i&&!i.isSelected(this.series[a].name)||(e=this.series[a].xAxisIndex||0,t=this.series[a].yAxisIndex||0,this.option.xAxisIndex!=e&&this.option.yAxisIndex!=t||!this._calculSum(n,a)));var s;for(var a in n){s=n[a];for(var l=0,h=s.length;h>l;l++)if(!isNaN(s[l])){this._hasData=!0,this._min=s[l],this._max=s[l];break}if(this._hasData)break}for(var a in n){s=n[a];for(var l=0,h=s.length;h>l;l++)isNaN(s[l])||(this._min=Math.min(this._min,s[l]),this._max=Math.max(this._max,s[l]))}var m=Math.abs(this._max-this._min);this._min=isNaN(this.option.min-0)?this._min-Math.abs(m*this.option.boundaryGap[0]):this.option.min-0,this._max=isNaN(this.option.max-0)?this._max+Math.abs(m*this.option.boundaryGap[1]):this.option.max-0,this._min===this._max&&(0===this._max?this._max=1:this._max>0?this._min=this._max/this.option.splitNumber!=null?this.option.splitNumber:5:this._max=this._max/this.option.splitNumber!=null?this.option.splitNumber:5),"time"!=this.option.type?this._reformValue(this.option.scale):this._reformTimeValue()}else this._hasData=!0,this._min=this.option.min-0,this._max=this.option.max-0,"time"!=this.option.type?this._customerValue():this._reformTimeValue()},_calculSum:function(e,t){var n,i,a=this.series[t].name||"kener";if(this.series[t].stack){var o="__Magic_Key_Positive__"+this.series[t].stack,l="__Magic_Key_Negative__"+this.series[t].stack;e[o]=e[o]||[],e[l]=e[l]||[],e[a]=e[a]||[],i=this.series[t].data;for(var h=0,m=i.length;m>h;h++)n=this.getDataFromOption(i[h]),"-"!==n&&(n-=0,n>=0?null!=e[o][h]?e[o][h]+=n:e[o][h]=n:null!=e[l][h]?e[l][h]+=n:e[l][h]=n,this.option.scale&&e[a].push(n))}else if(e[a]=e[a]||[],this.series[t].type!=r.CHART_TYPE_EVENTRIVER){i=this.series[t].data;for(var h=0,m=i.length;m>h;h++)n=this.getDataFromOption(i[h]),this.series[t].type===r.CHART_TYPE_K?(e[a].push(n[0]),e[a].push(n[1]),e[a].push(n[2]),e[a].push(n[3])):n instanceof Array?(-1!=this.option.xAxisIndex&&e[a].push("time"!=this.option.type?n[0]:s.getNewDate(n[0])),-1!=this.option.yAxisIndex&&e[a].push("time"!=this.option.type?n[1]:s.getNewDate(n[1]))):e[a].push(n)}else{i=this.series[t].eventList;for(var h=0,m=i.length;m>h;h++)for(var V=i[h].evolution,U=0,d=V.length;d>U;U++)e[a].push(s.getNewDate(V[U].time))}},_reformValue:function(t){var n=e("../util/smartSteps"),i=this.option.splitNumber;!t&&this._min>=0&&this._max>=0&&(this._min=0),!t&&this._min<=0&&this._max<=0&&(this._max=0);var a=n(this._min,this._max,i);i=null!=i?i:a.secs,this._min=a.min,this._max=a.max,this._valueList=a.pnts,this._reformLabelData()},_reformTimeValue:function(){var e=null!=this.option.splitNumber?this.option.splitNumber:5,t=s.getAutoFormatter(this._min,this._max,e),n=t.formatter,i=t.gapValue;this._valueList=[s.getNewDate(this._min)];var a;switch(n){case"week":a=s.nextMonday(this._min);break;case"month":a=s.nextNthOnMonth(this._min,1);break;case"quarter":a=s.nextNthOnQuarterYear(this._min,1);break;case"half-year":a=s.nextNthOnHalfYear(this._min,1);break;case"year":a=s.nextNthOnYear(this._min,1);break;default:72e5>=i?a=(Math.floor(this._min/i)+1)*i:(a=s.getNewDate(this._min- -i),a.setHours(6*Math.round(a.getHours()/6)),a.setMinutes(0),a.setSeconds(0))}for(a-this._min=0&&(("month"==n||"quarter"==n||"half-year"==n||"year"==n)&&t.setDate(1),!(this._max-t=a;a++)this._valueList.push(t.accAdd(this._min,t.accMul(i,a)));this._reformLabelData()},_reformLabelData:function(e){this._valueLabel=[];var t=this.option.axisLabel.formatter;if(t)for(var n=0,i=this._valueList.length;i>n;n++)"function"==typeof t?this._valueLabel.push(e?t.call(this.myChart,this._valueList[n],e):t.call(this.myChart,this._valueList[n])):"string"==typeof t&&this._valueLabel.push(e?s.format(t,this._valueList[n]):t.replace("{value}",this._valueList[n]));else if(e)for(var n=0,i=this._valueList.length;i>n;n++)this._valueLabel.push(s.format(e,this._valueList[n]));else for(var n=0,i=this._valueList.length;i>n;n++)this._valueLabel.push(this.numAddCommas(this._valueList[n]))},getExtremum:function(){return this._calculateValue(),{min:this._min,max:this._max}},refresh:function(e,t){e&&(this.option=this.reformOption(e),this.option.axisLabel.textStyle=l.merge(this.option.axisLabel.textStyle||{},this.ecTheme.textStyle),this.series=t),this.zr&&(this.clear(),this._buildShape())},getCoord:function(e){e=ethis._max?this._max:e;var t;return t=this.isHorizontal()?this.grid.getX()+(e-this._min)/(this._max-this._min)*this.grid.getWidth():this.grid.getYend()-(e-this._min)/(this._max-this._min)*this.grid.getHeight()},getCoordSize:function(e){return Math.abs(this.isHorizontal()?e/(this._max-this._min)*this.grid.getWidth():e/(this._max-this._min)*this.grid.getHeight())},getValueFromCoord:function(e){var t;return this.isHorizontal()?(e=ethis.grid.getXend()?this.grid.getXend():e,t=this._min+(e-this.grid.getX())/this.grid.getWidth()*(this._max-this._min)):(e=ethis.grid.getYend()?this.grid.getYend():e,t=this._max-(e-this.grid.getY())/this.grid.getHeight()*(this._max-this._min)),t.toFixed(2)-0},isMaindAxis:function(e){for(var t=0,n=this._valueList.length;n>t;t++)if(this._valueList[t]===e)return!0;return!1}},l.inherits(t,n),e("../component").define("valueAxis",t),t}),n("echarts/util/date",[],function(){function e(e,t,n){n=n>1?n:2;for(var i,a,o,r,s=0,l=m.length;l>s;s++)if(i=m[s].value,a=Math.ceil(t/i)*i-Math.floor(e/i)*i,Math.round(a/i)<=1.2*n){o=m[s].formatter,r=m[s].value;break}return null==o&&(o="year",i=317088e5,a=Math.ceil(t/i)*i-Math.floor(e/i)*i,r=Math.round(a/(n-1)/i)*i),{formatter:o,gapValue:r}}function t(e){return 10>e?"0"+e:e}function n(e,n){("week"==e||"month"==e||"quarter"==e||"half-year"==e||"year"==e)&&(e="MM - dd\nyyyy");var i=h(n),a=i.getFullYear(),o=i.getMonth()+1,r=i.getDate(),s=i.getHours(),l=i.getMinutes(),m=i.getSeconds();return e=e.replace("MM",t(o)),e=e.toLowerCase(),e=e.replace("yyyy",a),e=e.replace("yy",a%100),e=e.replace("dd",t(r)),e=e.replace("d",r),e=e.replace("hh",t(s)),e=e.replace("h",s),e=e.replace("mm",t(l)),e=e.replace("m",l),e=e.replace("ss",t(m)),e=e.replace("s",m)}function i(e){return e=h(e),e.setDate(e.getDate()+8-e.getDay()),e}function a(e,t,n){return e=h(e),e.setMonth(Math.ceil((e.getMonth()+1)/n)*n),e.setDate(t),e}function o(e,t){return a(e,t,1)}function r(e,t){return a(e,t,3)}function s(e,t){return a(e,t,6)}function l(e,t){return a(e,t,12)}function h(e){return e instanceof Date?e:new Date("string"==typeof e?e.replace(/-/g,"/"):e)}var m=[{formatter:"hh : mm : ss",value:1e3},{formatter:"hh : mm : ss",value:5e3},{formatter:"hh : mm : ss",value:1e4},{formatter:"hh : mm : ss",value:15e3},{formatter:"hh : mm : ss",value:3e4},{formatter:"hh : mm\nMM - dd",value:6e4},{formatter:"hh : mm\nMM - dd",value:3e5},{formatter:"hh : mm\nMM - dd",value:6e5},{formatter:"hh : mm\nMM - dd",value:9e5},{formatter:"hh : mm\nMM - dd",value:18e5},{formatter:"hh : mm\nMM - dd",value:36e5},{formatter:"hh : mm\nMM - dd",value:72e5},{formatter:"hh : mm\nMM - dd",value:216e5},{formatter:"hh : mm\nMM - dd",value:432e5},{formatter:"MM - dd\nyyyy",value:864e5},{formatter:"week",value:6048e5},{formatter:"month",value:26784e5},{formatter:"quarter",value:8208e6},{formatter:"half-year",value:16416e6},{formatter:"year",value:32832e6}];return{getAutoFormatter:e,getNewDate:h,format:n,nextMonday:i,nextNthPerNmonth:a,nextNthOnMonth:o,nextNthOnQuarterYear:r,nextNthOnHalfYear:s,nextNthOnYear:l}}),n("echarts/util/smartSteps",[],function(){function e(e){return X.log(v(e))/X.LN10}function t(e){return X.pow(10,e)}function n(e){return e===w(e)}function i(e,t,i,a){b=a||{},f=b.steps||L,k=b.secs||W,i=K(+i||0)%99,e=+e||0,t=+t||0,x=_=0,"min"in b&&(e=+b.min||0,x=1),"max"in b&&(t=+b.max||0,_=1),e>t&&(t=[e,e=t][0]);var o=t-e;if(x&&_)return g(e,t,i);if((i||5)>o){if(n(e)&&n(t))return d(e,t,i);if(0===o)return p(e,t,i)}return h(e,t,i)}function a(e,n,i,a){a=a||0;var s=o((n-e)/i,-1),l=o(e,-1,1),h=o(n,-1),m=X.min(s.e,l.e,h.e);0===l.c?m=X.min(s.e,h.e):0===h.c&&(m=X.min(s.e,l.e)),r(s,{c:0,e:m}),r(l,s,1),r(h,s),a+=m,e=l.c,n=h.c;for(var V=(n-e)/i,U=t(a),d=0,p=[],c=i+1;c--;)p[c]=(e+V*c)*U;if(0>a){d=u(U),V=+(V*U).toFixed(d),e=+(e*U).toFixed(d),n=+(n*U).toFixed(d);for(var c=p.length;c--;)p[c]=p[c].toFixed(d),0===+p[c]&&(p[c]="0")}else e*=U,n*=U,V*=U;return k=0,f=0,b=0,{min:e,max:n,secs:i,step:V,fix:d,exp:a,pnts:p}}function o(i,a,o){a=K(a%10)||2,0>a&&(n(i)?a=(""+v(i)).replace(/0+$/,"").length||1:(i=i.toFixed(15).replace(/0+$/,""),a=i.replace(".","").replace(/^[-0]+/,"").length,i=+i));var r=w(e(i))-a+1,s=+(i*t(-r)).toFixed(15)||0;return s=o?w(s):I(s),!s&&(r=0),(""+v(s)).length>a&&(r+=1,s/=10),{c:s,e:r}}function r(e,n,i){var a=n.e-e.e;a&&(e.e+=a,e.c*=t(-a),e.c=i?w(e.c):I(e.c))}function s(e,t,n){e.et[i];)i++;if(!t[i])for(n/=10,e.e+=1,i=0;n>t[i];)i++;return e.c=t[i],e}function h(e,t,i){var s,h=i||+k.slice(-1),p=l((t-e)/h,f),u=o(t-e),g=o(e,-1,1),b=o(t,-1);if(r(u,p),r(g,p,1),r(b,p),i?s=V(g,b,h):h=m(g,b),n(e)&&n(t)&&e*t>=0){if(h>t-e)return d(e,t,h);h=U(e,t,i,g,b,h)}var L=c(e,t,g.c,b.c);return g.c=L[0],b.c=L[1],(x||_)&&y(e,t,g,b),a(g.c,b.c,h,b.e)}function m(e,n){for(var i,a,o,r,s=[],h=k.length;h--;)i=k[h],a=l((n.c-e.c)/i,f),a=a.c*t(a.e),o=w(e.c/a)*a,r=I(n.c/a)*a,s[h]={min:o,max:r,step:a,span:r-o};return s.sort(function(e,t){var n=e.span-t.span;return 0===n&&(n=e.step-t.step),n}),s=s[0],i=s.span/s.step,e.c=s.min,n.c=s.max,3>i?2*i:i}function V(e,n,i){for(var a,o,r=n.c,s=(n.c-e.c)/i-1;r>e.c;)s=l(s+1,f),s=s.c*t(s.e),a=s*i,o=I(n.c/s)*s,r=o-a;var h=e.c-r,m=o-n.c,V=h-m;return V>1.1*s&&(V=K(V/s/2)*s,r+=V,o+=V),e.c=r,n.c=o,s}function U(e,i,a,o,r,s){var l=r.c-o.c,h=l/s*t(r.e);if(!n(h)&&(h=w(h),l=h*s,i-e>l&&(h+=1,l=h*s,!a&&h*(s-1)>=i-e&&(s-=1,l=h*s)),l>=i-e)){var m=l-(i-e);o.c=K(e-m/2),r.c=K(i+m/2),o.e=0,r.e=0}return s}function d(e,t,n){if(n=n||5,x)t=e+n;else if(_)e=t-n;else{var i=n-(t-e),o=K(e-i/2),r=K(t+i/2),s=c(e,t,o,r);e=s[0],t=s[1]}return a(e,t,n)}function p(e,t,n){n=n||5;var i=X.min(v(t/n),n)/2.1;return x?t=e+i:_?e=t-i:(e-=i,t+=i),h(e,t,n)}function c(e,t,n,i){return e>=0&&0>n?(i-=n,n=0):0>=t&&i>0&&(n-=i,i=0),[n,i]}function u(e){return e=(+e).toFixed(15).split("."),e.pop().replace(/0+$/,"").length}function y(e,t,n,i){if(x){var a=o(e,4,1);n.e-a.e>6&&(a={c:0,e:n.e}),s(n,a),s(i,a),i.c+=a.c-n.c,n.c=a.c}else if(_){var r=o(t,4);i.e-r.e>6&&(r={c:0,e:i.e}),s(n,r),s(i,r),n.c+=r.c-i.c,i.c=r.c}}function g(e,t,n){var i=n?[n]:k,s=t-e;if(0===s)return t=o(t,3),n=i[0],t.c=K(t.c+n/2),a(t.c-n,t.c,n,t.e);v(t/s)<1e-6&&(t=0),v(e/s)<1e-6&&(e=0);var l,h,m,V=[[5,10],[10,2],[50,10],[100,2]],U=[],d=[],p=o(t-e,3),c=o(e,-1,1),u=o(t,-1);r(c,p,1),r(u,p),s=u.c-c.c,p.c=s;for(var y=i.length;y--;){n=i[y],l=I(s/n),h=l*n-s,m=3*(h+3),m+=2*(n-i[0]+2),n%5===0&&(m-=10);for(var g=V.length;g--;)l%V[g][0]===0&&(m/=V[g][1]);d[y]=[n,l,h,m].join(),U[y]={secs:n,step:l,delta:h,score:m}}return U.sort(function(e,t){return e.score-t.score}),U=U[0],c.c=K(c.c-U.delta/2),u.c=K(u.c+U.delta/2),a(c.c,u.c,U.secs,p.e)}var b,f,k,x,_,L=[10,20,25,50],W=[4,5,6],X=Math,K=X.round,w=X.floor,I=X.ceil,v=X.abs;return i}),n("echarts/chart/line",["require","./base","zrender/shape/Polyline","../util/shape/Icon","../util/shape/HalfSmoothPolygon","../component/axis","../component/grid","../component/dataZoom","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../chart"],function(e){function t(e,t,n,a,o){i.call(this,e,t,n,a,o),this.refresh(a)}function n(e,t,n){var i=t.x,a=t.y,r=t.width,s=t.height,l=s/2;t.symbol.match("empty")&&(e.fillStyle="#fff"),t.brushType="both";var h=t.symbol.replace("empty","").toLowerCase();h.match("star")?(l=h.replace("star","")-0||5,a-=1,h="star"):("rectangle"===h||"arrow"===h)&&(i+=(r-s)/2,r=s);var m="";if(h.match("image")&&(m=h.replace(new RegExp("^image:\\/\\/"),""),h="image",i+=Math.round((r-s)/2)-1,r=s+=2),h=o.prototype.iconLibrary[h]){var V=t.x,U=t.y;e.moveTo(V,U+l),e.lineTo(V+5,U+l),e.moveTo(V+t.width-5,U+l),e.lineTo(V+t.width,U+l);var d=this;h(e,{x:i+4,y:a+4,width:r-8,height:s-8,n:l,image:m},function(){d.modSelf(),n()})}else e.moveTo(i,a+l),e.lineTo(i+r,a+l)}var i=e("./base"),a=e("zrender/shape/Polyline"),o=e("../util/shape/Icon"),r=e("../util/shape/HalfSmoothPolygon");e("../component/axis"),e("../component/grid"),e("../component/dataZoom");var s=e("../config");s.line={zlevel:0,z:2,clickable:!0,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid",shadowColor:"rgba(0,0,0,0)",shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0}},emphasis:{label:{show:!1}}},symbolSize:2,showAllSymbol:!1};var l=e("../util/ecData"),h=e("zrender/tool/util"),m=e("zrender/tool/color");return t.prototype={type:s.CHART_TYPE_LINE,_buildShape:function(){this.finalPLMap={},this._buildPosition()},_buildHorizontal:function(e,t,n,i){for(var a,o,r,s,l,h,m,V,U,d=this.series,p=n[0][0],c=d[p],u=this.component.xAxis.getAxis(c.xAxisIndex||0),y={},g=0,b=t;b>g&&null!=u.getNameByIndex(g);g++){o=u.getCoordByIndex(g);for(var f=0,k=n.length;k>f;f++){a=this.component.yAxis.getAxis(d[n[f][0]].yAxisIndex||0),l=s=m=h=a.getCoord(0);for(var x=0,_=n[f].length;_>x;x++)p=n[f][x],c=d[p],V=c.data[g],U=this.getDataFromOption(V,"-"),y[p]=y[p]||[],i[p]=i[p]||{min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY,sum:0,counter:0,average:0},"-"!==U?(U>=0?(s-=x>0?a.getCoordSize(U):l-a.getCoord(U),r=s):0>U&&(h+=x>0?a.getCoordSize(U):a.getCoord(U)-m,r=h),y[p].push([o,r,g,u.getNameByIndex(g),o,l]),i[p].min>U&&(i[p].min=U,i[p].minY=r,i[p].minX=o),i[p].max0&&(this.finalPLMap[p]=this.finalPLMap[p]||[],this.finalPLMap[p].push(y[p]),y[p]=[])}s=this.component.grid.getY();for(var L,f=0,k=n.length;k>f;f++)for(var x=0,_=n[f].length;_>x;x++)p=n[f][x],c=d[p],V=c.data[g],U=this.getDataFromOption(V,"-"),"-"==U&&this.deepQuery([V,c,this.option],"calculable")&&(L=this.deepQuery([V,c],"symbolSize"),s+=2*L+5,r=s,this.shapeList.push(this._getCalculableItem(p,g,u.getNameByIndex(g),o,r,"horizontal")))}for(var W in y)y[W].length>0&&(this.finalPLMap[W]=this.finalPLMap[W]||[],this.finalPLMap[W].push(y[W]),y[W]=[]);this._calculMarkMapXY(i,n,"y"),this._buildBorkenLine(e,this.finalPLMap,u,"horizontal")},_buildVertical:function(e,t,n,i){for(var a,o,r,s,l,h,m,V,U,d=this.series,p=n[0][0],c=d[p],u=this.component.yAxis.getAxis(c.yAxisIndex||0),y={},g=0,b=t;b>g&&null!=u.getNameByIndex(g);g++){r=u.getCoordByIndex(g);for(var f=0,k=n.length;k>f;f++){a=this.component.xAxis.getAxis(d[n[f][0]].xAxisIndex||0),l=s=m=h=a.getCoord(0);for(var x=0,_=n[f].length;_>x;x++)p=n[f][x],c=d[p],V=c.data[g],U=this.getDataFromOption(V,"-"),y[p]=y[p]||[],i[p]=i[p]||{min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY,sum:0,counter:0,average:0},"-"!==U?(U>=0?(s+=x>0?a.getCoordSize(U):a.getCoord(U)-l,o=s):0>U&&(h-=x>0?a.getCoordSize(U):m-a.getCoord(U),o=h),y[p].push([o,r,g,u.getNameByIndex(g),l,r]),i[p].min>U&&(i[p].min=U,i[p].minX=o,i[p].minY=r),i[p].max0&&(this.finalPLMap[p]=this.finalPLMap[p]||[],this.finalPLMap[p].push(y[p]),y[p]=[])}s=this.component.grid.getXend();for(var L,f=0,k=n.length;k>f;f++)for(var x=0,_=n[f].length;_>x;x++)p=n[f][x],c=d[p],V=c.data[g],U=this.getDataFromOption(V,"-"),"-"==U&&this.deepQuery([V,c,this.option],"calculable")&&(L=this.deepQuery([V,c],"symbolSize"),s-=2*L+5,o=s,this.shapeList.push(this._getCalculableItem(p,g,u.getNameByIndex(g),o,r,"vertical")))}for(var W in y)y[W].length>0&&(this.finalPLMap[W]=this.finalPLMap[W]||[],this.finalPLMap[W].push(y[W]),y[W]=[]);this._calculMarkMapXY(i,n,"x"),this._buildBorkenLine(e,this.finalPLMap,u,"vertical")},_buildOther:function(e,t,n,i){for(var a,o=this.series,r={},s=0,l=n.length;l>s;s++)for(var h=0,m=n[s].length;m>h;h++){var V=n[s][h],U=o[V];a=this.component.xAxis.getAxis(U.xAxisIndex||0);var d=this.component.yAxis.getAxis(U.yAxisIndex||0),p=d.getCoord(0);r[V]=r[V]||[],i[V]=i[V]||{min0:Number.POSITIVE_INFINITY,min1:Number.POSITIVE_INFINITY,max0:Number.NEGATIVE_INFINITY,max1:Number.NEGATIVE_INFINITY,sum0:0,sum1:0,counter0:0,counter1:0,average0:0,average1:0};for(var c=0,u=U.data.length;u>c;c++){var y=U.data[c],g=this.getDataFromOption(y,"-");if(g instanceof Array){var b=a.getCoord(g[0]),f=d.getCoord(g[1]);r[V].push([b,f,c,g[0],b,p]),i[V].min0>g[0]&&(i[V].min0=g[0],i[V].minY0=f,i[V].minX0=b),i[V].max0g[1]&&(i[V].min1=g[1],i[V].minY1=f,i[V].minX1=b),i[V].max10&&(this.finalPLMap[k]=this.finalPLMap[k]||[],this.finalPLMap[k].push(r[k]),r[k]=[]);this._calculMarkMapXY(i,n,"xy"),this._buildBorkenLine(e,this.finalPLMap,a,"other")},_buildBorkenLine:function(e,t,n,i){for(var o,s="other"==i?"horizontal":i,V=this.series,U=e.length-1;U>=0;U--){var d=e[U],p=V[d],c=t[d];if(p.type===this.type&&null!=c)for(var u=this._getBbox(d,s),y=this._sIndex2ColorMap[d],g=this.query(p,"itemStyle.normal.lineStyle.width"),b=this.query(p,"itemStyle.normal.lineStyle.type"),f=this.query(p,"itemStyle.normal.lineStyle.color"),k=this.getItemStyleColor(this.query(p,"itemStyle.normal.color"),d,-1),x=null!=this.query(p,"itemStyle.normal.areaStyle"),_=this.query(p,"itemStyle.normal.areaStyle.color"),L=0,W=c.length;W>L;L++){var X=c[L],K="other"!=i&&this._isLarge(s,X);if(K)X=this._getLargePointList(s,X);else for(var w=0,I=X.length;I>w;w++)o=p.data[X[w][2]],(this.deepQuery([o,p,this.option],"calculable")||this.deepQuery([o,p],"showAllSymbol")||"categoryAxis"===n.type&&n.isMainAxis(X[w][2])&&"none"!=this.deepQuery([o,p],"symbol"))&&this.shapeList.push(this._getSymbol(d,X[w][2],X[w][3],X[w][0],X[w][1],s));var v=new a({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{miterLimit:g,pointList:X,strokeColor:f||k||y,lineWidth:g,lineType:b,smooth:this._getSmooth(p.smooth),smoothConstraint:u,shadowColor:this.query(p,"itemStyle.normal.lineStyle.shadowColor"),shadowBlur:this.query(p,"itemStyle.normal.lineStyle.shadowBlur"),shadowOffsetX:this.query(p,"itemStyle.normal.lineStyle.shadowOffsetX"),shadowOffsetY:this.query(p,"itemStyle.normal.lineStyle.shadowOffsetY")},hoverable:!1,_main:!0,_seriesIndex:d,_orient:s});if(l.pack(v,V[d],d,0,L,V[d].name),this.shapeList.push(v),x){var J=new r({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{miterLimit:g,pointList:h.clone(X).concat([[X[X.length-1][4],X[X.length-1][5]],[X[0][4],X[0][5]]]),brushType:"fill",smooth:this._getSmooth(p.smooth),smoothConstraint:u,color:_?_:m.alpha(y,.5)},highlightStyle:{brushType:"fill"},hoverable:!1,_main:!0,_seriesIndex:d,_orient:s});l.pack(J,V[d],d,0,L,V[d].name),this.shapeList.push(J)}}}},_getBbox:function(e,t){var n=this.component.grid.getBbox(),i=this.xMarkMap[e];return null!=i.minX0?[[Math.min(i.minX0,i.maxX0,i.minX1,i.maxX1),Math.min(i.minY0,i.maxY0,i.minY1,i.maxY1)],[Math.max(i.minX0,i.maxX0,i.minX1,i.maxX1),Math.max(i.minY0,i.maxY0,i.minY1,i.maxY1)]]:("horizontal"===t?(n[0][1]=Math.min(i.minY,i.maxY),n[1][1]=Math.max(i.minY,i.maxY)):(n[0][0]=Math.min(i.minX,i.maxX),n[1][0]=Math.max(i.minX,i.maxX)),n)},_isLarge:function(e,t){return t.length<2?!1:"horizontal"===e?Math.abs(t[0][0]-t[1][0])<.5:Math.abs(t[0][1]-t[1][1])<.5},_getLargePointList:function(e,t){var n;n="horizontal"===e?this.component.grid.getWidth():this.component.grid.getHeight();for(var i=t.length,a=[],o=0;n>o;o++)a[o]=t[Math.floor(i/n*o)];return a},_getSmooth:function(e){return e?.3:0},_getCalculableItem:function(e,t,n,i,a,o){var r=this.series,l=r[e].calculableHolderColor||this.ecTheme.calculableHolderColor||s.calculableHolderColor,h=this._getSymbol(e,t,n,i,a,o);return h.style.color=l,h.style.strokeColor=l,h.rotation=[0,0],h.hoverable=!1,h.draggable=!1,h.style.text=void 0,h},_getSymbol:function(e,t,n,i,a,o){var r=this.series,s=r[e],l=s.data[t],h=this.getSymbolShape(s,e,l,t,n,i,a,this._sIndex2ShapeMap[e],this._sIndex2ColorMap[e],"#fff","vertical"===o?"horizontal":"vertical");return h.zlevel=this.getZlevelBase(),h.z=this.getZBase()+1,this.deepQuery([l,s,this.option],"calculable")&&(this.setCalculable(h),h.draggable=!0),h},getMarkCoord:function(e,t){var n=this.series[e],i=this.xMarkMap[e],a=this.component.xAxis.getAxis(n.xAxisIndex),o=this.component.yAxis.getAxis(n.yAxisIndex);if(t.type&&("max"===t.type||"min"===t.type||"average"===t.type)){var r=null!=t.valueIndex?t.valueIndex:null!=i.maxX0?"1":"";return[i[t.type+"X"+r],i[t.type+"Y"+r],i[t.type+"Line"+r],i[t.type+r]]}return["string"!=typeof t.xAxis&&a.getCoordByIndex?a.getCoordByIndex(t.xAxis||0):a.getCoord(t.xAxis||0),"string"!=typeof t.yAxis&&o.getCoordByIndex?o.getCoordByIndex(t.yAxis||0):o.getCoord(t.yAxis||0)]},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},ontooltipHover:function(e,t){for(var n,i,a=e.seriesIndex,o=e.dataIndex,r=a.length;r--;)if(n=this.finalPLMap[a[r]])for(var s=0,l=n.length;l>s;s++){i=n[s];for(var h=0,m=i.length;m>h;h++)o===i[h][2]&&t.push(this._getSymbol(a[r],i[h][2],i[h][3],i[h][0],i[h][1],"horizontal"))}},addDataAnimation:function(e){for(var t=this.series,n={},i=0,a=e.length;a>i;i++)n[e[i][0]]=e[i];for(var o,r,s,l,h,m,V,i=this.shapeList.length-1;i>=0;i--)if(h=this.shapeList[i]._seriesIndex,n[h]&&!n[h][3]){if(this.shapeList[i]._main&&this.shapeList[i].style.pointList.length>1){if(m=this.shapeList[i].style.pointList,r=Math.abs(m[0][0]-m[1][0]),l=Math.abs(m[0][1]-m[1][1]),V="horizontal"===this.shapeList[i]._orient,n[h][2]){if("half-smooth-polygon"===this.shapeList[i].type){var U=m.length;this.shapeList[i].style.pointList[U-3]=m[U-2],this.shapeList[i].style.pointList[U-3][V?0:1]=m[U-4][V?0:1],this.shapeList[i].style.pointList[U-2]=m[U-1]}this.shapeList[i].style.pointList.pop(),V?(o=r,s=0):(o=0,s=-l)}else{if(this.shapeList[i].style.pointList.shift(),"half-smooth-polygon"===this.shapeList[i].type){var d=this.shapeList[i].style.pointList.pop();V?d[0]=m[0][0]:d[1]=m[0][1],this.shapeList[i].style.pointList.push(d) +}V?(o=-r,s=0):(o=0,s=l)}this.zr.modShape(this.shapeList[i].id,{style:{pointList:this.shapeList[i].style.pointList}},!0)}else{if(n[h][2]&&this.shapeList[i]._dataIndex===t[h].data.length-1){this.zr.delShape(this.shapeList[i].id);continue}if(!n[h][2]&&0===this.shapeList[i]._dataIndex){this.zr.delShape(this.shapeList[i].id);continue}}this.shapeList[i].position=[0,0],this.zr.animate(this.shapeList[i].id,"").when(this.query(this.option,"animationDurationUpdate"),{position:[o,s]}).start()}}},o.prototype.iconLibrary.legendLineIcon=n,h.inherits(t,i),e("../chart").define("line",t),t}),n("echarts/util/shape/HalfSmoothPolygon",["require","zrender/shape/Base","zrender/shape/util/smoothBezier","zrender/tool/util","zrender/shape/Polygon"],function(e){function t(e){n.call(this,e)}var n=e("zrender/shape/Base"),i=e("zrender/shape/util/smoothBezier"),a=e("zrender/tool/util");return t.prototype={type:"half-smooth-polygon",buildPath:function(t,n){var a=n.pointList;if(!(a.length<2))if(n.smooth){var o=i(a.slice(0,-2),n.smooth,!1,n.smoothConstraint);t.moveTo(a[0][0],a[0][1]);for(var r,s,l,h=a.length,m=0;h-3>m;m++)r=o[2*m],s=o[2*m+1],l=a[m+1],t.bezierCurveTo(r[0],r[1],s[0],s[1],l[0],l[1]);t.lineTo(a[h-2][0],a[h-2][1]),t.lineTo(a[h-1][0],a[h-1][1]),t.lineTo(a[0][0],a[0][1])}else e("zrender/shape/Polygon").prototype.buildPath(t,n)}},a.inherits(t,n),t}),n("echarts/chart/bar",["require","./base","zrender/shape/Rectangle","../component/axis","../component/grid","../component/dataZoom","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../chart"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o),this.refresh(a)}var n=e("./base"),i=e("zrender/shape/Rectangle");e("../component/axis"),e("../component/grid"),e("../component/dataZoom");var a=e("../config");a.bar={zlevel:0,z:2,clickable:!0,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,barMinHeight:0,barGap:"30%",barCategoryGap:"20%",itemStyle:{normal:{barBorderColor:"#fff",barBorderRadius:0,barBorderWidth:0,label:{show:!1}},emphasis:{barBorderColor:"#fff",barBorderRadius:0,barBorderWidth:0,label:{show:!1}}}};var o=e("../util/ecData"),r=e("zrender/tool/util"),s=e("zrender/tool/color");return t.prototype={type:a.CHART_TYPE_BAR,_buildShape:function(){this._buildPosition()},_buildNormal:function(e,t,n,o,r){for(var s,l,h,m,V,U,d,p,c,u,y,g,b=this.series,f=n[0][0],k=b[f],x="horizontal"==r,_=this.component.xAxis,L=this.component.yAxis,W=x?_.getAxis(k.xAxisIndex):L.getAxis(k.yAxisIndex),X=this._mapSize(W,n),K=X.gap,w=X.barGap,I=X.barWidthMap,v=X.barMaxWidthMap,J=X.barWidth,C=X.barMinHeightMap,S=X.interval,E=this.deepQuery([this.ecTheme,a],"island.r"),F=0,T=t;T>F&&null!=W.getNameByIndex(F);F++){x?m=W.getCoordByIndex(F)-K/2:V=W.getCoordByIndex(F)+K/2;for(var A=0,M=n.length;M>A;A++){var z=b[n[A][0]].yAxisIndex||0,O=b[n[A][0]].xAxisIndex||0;s=x?L.getAxis(z):_.getAxis(O),d=U=c=p=s.getCoord(0);for(var D=0,P=n[A].length;P>D;D++)f=n[A][D],k=b[f],y=k.data[F],g=this.getDataFromOption(y,"-"),o[f]=o[f]||{min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY,sum:0,counter:0,average:0},h=Math.min(v[f]||Number.MAX_VALUE,I[f]||J),"-"!==g&&(g>0?(l=D>0?s.getCoordSize(g):x?d-s.getCoord(g):s.getCoord(g)-d,1===P&&C[f]>l&&(l=C[f]),x?(U-=l,V=U):(m=U,U+=l)):0>g?(l=D>0?s.getCoordSize(g):x?s.getCoord(g)-c:c-s.getCoord(g),1===P&&C[f]>l&&(l=C[f]),x?(V=p,p+=l):(p-=l,m=p)):(l=0,x?(U-=l,V=U):(m=U,U+=l)),o[f][F]=x?m+h/2:V-h/2,o[f].min>g&&(o[f].min=g,x?(o[f].minY=V,o[f].minX=o[f][F]):(o[f].minX=m+l,o[f].minY=o[f][F])),o[f].maxD;D++)f=n[A][D],k=b[f],y=k.data[F],g=this.getDataFromOption(y,"-"),h=Math.min(v[f]||Number.MAX_VALUE,I[f]||J),"-"==g&&this.deepQuery([y,k,this.option],"calculable")&&(x?(U-=E,V=U):(m=U,U+=E),u=this._getBarItem(f,F,W.getNameByIndex(F),m,V-(x?0:h),x?h:E,x?E:h,x?"vertical":"horizontal"),u.hoverable=!1,u.draggable=!1,u.style.lineWidth=1,u.style.brushType="stroke",u.style.strokeColor=k.calculableHolderColor||this.ecTheme.calculableHolderColor||a.calculableHolderColor,this.shapeList.push(new i(u)));x?m+=h+w:V-=h+w}}this._calculMarkMapXY(o,n,x?"y":"x")},_buildHorizontal:function(e,t,n,i){return this._buildNormal(e,t,n,i,"horizontal")},_buildVertical:function(e,t,n,i){return this._buildNormal(e,t,n,i,"vertical")},_buildOther:function(e,t,n,a){for(var o=this.series,r=0,s=n.length;s>r;r++)for(var l=0,h=n[r].length;h>l;l++){var m=n[r][l],V=o[m],U=V.xAxisIndex||0,d=this.component.xAxis.getAxis(U),p=d.getCoord(0),c=V.yAxisIndex||0,u=this.component.yAxis.getAxis(c),y=u.getCoord(0);a[m]=a[m]||{min0:Number.POSITIVE_INFINITY,min1:Number.POSITIVE_INFINITY,max0:Number.NEGATIVE_INFINITY,max1:Number.NEGATIVE_INFINITY,sum0:0,sum1:0,counter0:0,counter1:0,average0:0,average1:0};for(var g=0,b=V.data.length;b>g;g++){var f=V.data[g],k=this.getDataFromOption(f,"-");if(k instanceof Array){var x,_,L=d.getCoord(k[0]),W=u.getCoord(k[1]),X=[f,V],K=this.deepQuery(X,"barWidth")||10,w=this.deepQuery(X,"barHeight");null!=w?(x="horizontal",k[0]>0?(K=L-p,L-=K):K=k[0]<0?p-L:0,_=this._getBarItem(m,g,k[0],L,W-w/2,K,w,x)):(x="vertical",k[1]>0?w=y-W:k[1]<0?(w=W-y,W-=w):w=0,_=this._getBarItem(m,g,k[0],L-K/2,W,K,w,x)),this.shapeList.push(new i(_)),L=d.getCoord(k[0]),W=u.getCoord(k[1]),a[m].min0>k[0]&&(a[m].min0=k[0],a[m].minY0=W,a[m].minX0=L),a[m].max0k[1]&&(a[m].min1=k[1],a[m].minY1=W,a[m].minX1=L),a[m].max1=a&&(d=Math.floor(t.length/i),a=1);else if(i="string"==typeof U&&U.match(/%$/)?(e.getGap()*(100-parseFloat(U))/100).toFixed(2)-0:e.getGap()-U,"string"==typeof V&&V.match(/%$/)?(V=parseFloat(V)/100,a=+((i-m)/((t.length-1)*V+t.length-h)).toFixed(2),V=a*V):(V=parseFloat(V),a=+((i-m-V*(t.length-1))/(t.length-h)).toFixed(2)),0>=a)return this._mapSize(e,t,!0)}else if(i=h>1?"string"==typeof U&&U.match(/%$/)?+(e.getGap()*(100-parseFloat(U))/100).toFixed(2):e.getGap()-U:m,a=0,V=h>1?+((i-m)/(h-1)).toFixed(2):0,0>V)return this._mapSize(e,t,!0);return this._recheckBarMaxWidth(t,r,s,l,i,a,V,d)},_findSpecialBarSzie:function(e,t){for(var n,i,a,o,r=this.series,s={},l={},h={},m=0,V=0,U=0,d=e.length;d>U;U++)for(var p={barWidth:!1,barMaxWidth:!1},c=0,u=e[U].length;u>c;c++){var y=e[U][c],g=r[y];if(!t){if(p.barWidth)s[y]=n;else if(n=this.query(g,"barWidth"),null!=n){s[y]=n,V+=n,m++,p.barWidth=!0;for(var b=0,f=c;f>b;b++){var k=e[U][b];s[k]=n}}if(p.barMaxWidth)l[y]=i;else if(i=this.query(g,"barMaxWidth"),null!=i){l[y]=i,p.barMaxWidth=!0;for(var b=0,f=c;f>b;b++){var k=e[U][b];l[k]=i}}}h[y]=this.query(g,"barMinHeight"),a=null!=a?a:this.query(g,"barGap"),o=null!=o?o:this.query(g,"barCategoryGap")}return{barWidthMap:s,barMaxWidthMap:l,barMinHeightMap:h,sBarWidth:n,sBarMaxWidth:i,sBarWidthCounter:m,sBarWidthTotal:V,barGap:a,barCategoryGap:o}},_recheckBarMaxWidth:function(e,t,n,i,a,o,r,s){for(var l=0,h=e.length;h>l;l++){var m=e[l][0];n[m]&&n[m]0&&b.height>g&&b.width>g?(b.y+=g/2,b.height-=g,b.x+=g/2,b.width-=g):b.brushType="fill",m.highlightStyle.textColor=m.highlightStyle.color,m=this.addLabel(m,U,d,n,h);var f=b.textPosition;if("insideLeft"===f||"insideRight"===f||"insideTop"===f||"insideBottom"===f){var k=5;switch(f){case"insideLeft":b.textX=b.x+k,b.textY=b.y+b.height/2,b.textAlign="left",b.textBaseline="middle";break;case"insideRight":b.textX=b.x+b.width-k,b.textY=b.y+b.height/2,b.textAlign="right",b.textBaseline="middle";break;case"insideTop":b.textX=b.x+b.width/2,b.textY=b.y+k/2,b.textAlign="center",b.textBaseline="top";break;case"insideBottom":b.textX=b.x+b.width/2,b.textY=b.y+b.height-k/2,b.textAlign="center",b.textBaseline="bottom"}b.textPosition="specific",b.textColor=b.textColor||"#fff"}return this.deepQuery([d,U,this.option],"calculable")&&(this.setCalculable(m),m.draggable=!0),o.pack(m,V[e],e,V[e].data[t],t,n),m},getMarkCoord:function(e,t){var n,i,a=this.series[e],o=this.xMarkMap[e],r=this.component.xAxis.getAxis(a.xAxisIndex),s=this.component.yAxis.getAxis(a.yAxisIndex);if(!t.type||"max"!==t.type&&"min"!==t.type&&"average"!==t.type)if(o.isHorizontal){n="string"==typeof t.xAxis&&r.getIndexByName?r.getIndexByName(t.xAxis):t.xAxis||0;var l=o[n];l=null!=l?l:"string"!=typeof t.xAxis&&r.getCoordByIndex?r.getCoordByIndex(t.xAxis||0):r.getCoord(t.xAxis||0),i=[l,s.getCoord(t.yAxis||0)]}else{n="string"==typeof t.yAxis&&s.getIndexByName?s.getIndexByName(t.yAxis):t.yAxis||0;var h=o[n];h=null!=h?h:"string"!=typeof t.yAxis&&s.getCoordByIndex?s.getCoordByIndex(t.yAxis||0):s.getCoord(t.yAxis||0),i=[r.getCoord(t.xAxis||0),h]}else{var m=null!=t.valueIndex?t.valueIndex:null!=o.maxX0?"1":"";i=[o[t.type+"X"+m],o[t.type+"Y"+m],o[t.type+"Line"+m],o[t.type+m]]}return i},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},addDataAnimation:function(e){for(var t=this.series,n={},i=0,a=e.length;a>i;i++)n[e[i][0]]=e[i];for(var r,s,l,h,m,V,U,i=this.shapeList.length-1;i>=0;i--)if(V=o.get(this.shapeList[i],"seriesIndex"),n[V]&&!n[V][3]&&"rectangle"===this.shapeList[i].type){if(U=o.get(this.shapeList[i],"dataIndex"),m=t[V],n[V][2]&&U===m.data.length-1){this.zr.delShape(this.shapeList[i].id);continue}if(!n[V][2]&&0===U){this.zr.delShape(this.shapeList[i].id);continue}"horizontal"===this.shapeList[i]._orient?(h=this.component.yAxis.getAxis(m.yAxisIndex||0).getGap(),l=n[V][2]?-h:h,r=0):(s=this.component.xAxis.getAxis(m.xAxisIndex||0).getGap(),r=n[V][2]?s:-s,l=0),this.shapeList[i].position=[0,0],this.zr.animate(this.shapeList[i].id,"").when(this.query(this.option,"animationDurationUpdate"),{position:[r,l]}).start()}}},r.inherits(t,n),e("../chart").define("bar",t),t}),n("echarts/chart/scatter",["require","./base","../util/shape/Symbol","../component/axis","../component/grid","../component/dataZoom","../component/dataRange","../config","zrender/tool/util","zrender/tool/color","../chart"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o),this.refresh(a)}var n=e("./base"),i=e("../util/shape/Symbol");e("../component/axis"),e("../component/grid"),e("../component/dataZoom"),e("../component/dataRange");var a=e("../config");a.scatter={zlevel:0,z:2,clickable:!0,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,symbolSize:4,large:!1,largeThreshold:2e3,itemStyle:{normal:{label:{show:!1}},emphasis:{label:{show:!1}}}};var o=e("zrender/tool/util"),r=e("zrender/tool/color");return t.prototype={type:a.CHART_TYPE_SCATTER,_buildShape:function(){var e=this.series;this._sIndex2ColorMap={},this._symbol=this.option.symbolList,this._sIndex2ShapeMap={},this.selectedMap={},this.xMarkMap={};for(var t,n,i,o,s=this.component.legend,l=[],h=0,m=e.length;m>h;h++)if(t=e[h],n=t.name,t.type===a.CHART_TYPE_SCATTER){if(e[h]=this.reformOption(e[h]),this.legendHoverLink=e[h].legendHoverLink||this.legendHoverLink,this._sIndex2ShapeMap[h]=this.query(t,"symbol")||this._symbol[h%this._symbol.length],s){if(this.selectedMap[n]=s.isSelected(n),this._sIndex2ColorMap[h]=r.alpha(s.getColor(n),.5),i=s.getItemShape(n)){var o=this._sIndex2ShapeMap[h];i.style.brushType=o.match("empty")?"stroke":"both",o=o.replace("empty","").toLowerCase(),o.match("rectangle")&&(i.style.x+=Math.round((i.style.width-i.style.height)/2),i.style.width=i.style.height),o.match("star")&&(i.style.n=o.replace("star","")-0||5,o="star"),o.match("image")&&(i.style.image=o.replace(new RegExp("^image:\\/\\/"),""),i.style.x+=Math.round((i.style.width-i.style.height)/2),i.style.width=i.style.height,o="image"),i.style.iconType=o,s.setItemShape(n,i)}}else this.selectedMap[n]=!0,this._sIndex2ColorMap[h]=r.alpha(this.zr.getColor(h),.5);this.selectedMap[n]&&l.push(h)}this._buildSeries(l),this.addShapeList()},_buildSeries:function(e){if(0!==e.length){for(var t,n,i,a,o,r,s,l,h=this.series,m={},V=0,U=e.length;U>V;V++)if(t=e[V],n=h[t],0!==n.data.length){o=this.component.xAxis.getAxis(n.xAxisIndex||0),r=this.component.yAxis.getAxis(n.yAxisIndex||0),m[t]=[];for(var d=0,p=n.data.length;p>d;d++)i=n.data[d],a=this.getDataFromOption(i,"-"),"-"===a||a.length<2||(s=o.getCoord(a[0]),l=r.getCoord(a[1]),m[t].push([s,l,d,i.name||""]));this.xMarkMap[t]=this._markMap(o,r,n.data,m[t]),this.buildMark(t)}this._buildPointList(m)}},_markMap:function(e,t,n,i){for(var a,o={min0:Number.POSITIVE_INFINITY,max0:Number.NEGATIVE_INFINITY,sum0:0,counter0:0,average0:0,min1:Number.POSITIVE_INFINITY,max1:Number.NEGATIVE_INFINITY,sum1:0,counter1:0,average1:0},r=0,s=i.length;s>r;r++)a=n[i[r][2]].value||n[i[r][2]],o.min0>a[0]&&(o.min0=a[0],o.minY0=i[r][1],o.minX0=i[r][0]),o.max0a[1]&&(o.min1=a[1],o.minY1=i[r][1],o.minX1=i[r][0]),o.max1t.largeThreshold)this.shapeList.push(this._getLargeSymbol(n,this.getItemStyleColor(this.query(t,"itemStyle.normal.color"),r,-1)||this._sIndex2ColorMap[r]));else for(var s=0,l=n.length;l>s;s++)i=n[s],a=this._getSymbol(r,i[2],i[3],i[0],i[1]),a&&this.shapeList.push(a)},_getSymbol:function(e,t,n,i,a){var o,r=this.series,s=r[e],l=s.data[t],h=this.component.dataRange;if(h){if(o=isNaN(l[2])?this._sIndex2ColorMap[e]:h.getColor(l[2]),!o)return null}else o=this._sIndex2ColorMap[e];var m=this.getSymbolShape(s,e,l,t,n,i,a,this._sIndex2ShapeMap[e],o,"rgba(0,0,0,0)","vertical");return m.zlevel=this.getZlevelBase(),m.z=this.getZBase(),m._main=!0,m},_getLargeSymbol:function(e,t){return new i({zlevel:this.getZlevelBase(),z:this.getZBase(),_main:!0,hoverable:!1,style:{pointList:e,color:t,strokeColor:t},highlightStyle:{pointList:[]}})},getMarkCoord:function(e,t){var n,i=this.series[e],a=this.xMarkMap[e],o=this.component.xAxis.getAxis(i.xAxisIndex),r=this.component.yAxis.getAxis(i.yAxisIndex);if(!t.type||"max"!==t.type&&"min"!==t.type&&"average"!==t.type)n=["string"!=typeof t.xAxis&&o.getCoordByIndex?o.getCoordByIndex(t.xAxis||0):o.getCoord(t.xAxis||0),"string"!=typeof t.yAxis&&r.getCoordByIndex?r.getCoordByIndex(t.yAxis||0):r.getCoord(t.yAxis||0)];else{var s=null!=t.valueIndex?t.valueIndex:1;n=[a[t.type+"X"+s],a[t.type+"Y"+s],a[t.type+"Line"+s],a[t.type+s]]}return n},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},ondataRange:function(e,t){this.component.dataRange&&(this.refresh(),t.needRefresh=!0)}},o.inherits(t,n),e("../chart").define("scatter",t),t}),n("echarts/component/dataRange",["require","./base","zrender/shape/Text","zrender/shape/Rectangle","../util/shape/HandlePolygon","../config","zrender/tool/util","zrender/tool/event","zrender/tool/area","zrender/tool/color","../component"],function(e){function t(e,t,i,a,o){if("undefined"==typeof this.query(a,"dataRange.min")||"undefined"==typeof this.query(a,"dataRange.max"))return void console.error("option.dataRange.min or option.dataRange.max has not been defined.");n.call(this,e,t,i,a,o);var s=this;s._ondrift=function(e,t){return s.__ondrift(this,e,t)},s._ondragend=function(){return s.__ondragend()},s._dataRangeSelected=function(e){return s.__dataRangeSelected(e)},s._dispatchHoverLink=function(e){return s.__dispatchHoverLink(e)},s._onhoverlink=function(e){return s.__onhoverlink(e)},this._selectedMap={},this._range={},this.refresh(a),t.bind(r.EVENT.HOVER,this._onhoverlink)}var n=e("./base"),i=e("zrender/shape/Text"),a=e("zrender/shape/Rectangle"),o=e("../util/shape/HandlePolygon"),r=e("../config");r.dataRange={zlevel:0,z:4,show:!0,orient:"vertical",x:"left",y:"bottom",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,itemWidth:20,itemHeight:14,precision:0,splitNumber:5,calculable:!1,selectedMode:!0,hoverLink:!0,realtime:!0,color:["#006edd","#e0ffff"],textStyle:{color:"#333"}};var s=e("zrender/tool/util"),l=e("zrender/tool/event"),h=e("zrender/tool/area"),m=e("zrender/tool/color");return t.prototype={type:r.COMPONENT_TYPE_DATARANGE,_textGap:10,_buildShape:function(){if(this._itemGroupLocation=this._getItemGroupLocation(),this._buildBackground(),this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable?this._buildGradient():this._buildItem(),this.dataRangeOption.show)for(var e=0,t=this.shapeList.length;t>e;e++)this.zr.addShape(this.shapeList[e]);this._syncShapeFromRange()},_buildItem:function(){var e,t,n,o,r=this._valueTextList,s=r.length,l=this.getFont(this.dataRangeOption.textStyle),m=this._itemGroupLocation.x,V=this._itemGroupLocation.y,U=this.dataRangeOption.itemWidth,d=this.dataRangeOption.itemHeight,p=this.dataRangeOption.itemGap,c=h.getTextHeight("国",l);"vertical"==this.dataRangeOption.orient&&"right"==this.dataRangeOption.x&&(m=this._itemGroupLocation.x+this._itemGroupLocation.width-U);var u=!0;this.dataRangeOption.text&&(u=!1,this.dataRangeOption.text[0]&&(n=this._getTextShape(m,V,this.dataRangeOption.text[0]),"horizontal"==this.dataRangeOption.orient?m+=h.getTextWidth(this.dataRangeOption.text[0],l)+this._textGap:(V+=c+this._textGap,n.style.y+=c/2+this._textGap,n.style.textBaseline="bottom"),this.shapeList.push(new i(n))));for(var y=0;s>y;y++)e=r[y],o=this.getColorByIndex(y),t=this._getItemShape(m,V,U,d,this._selectedMap[y]?o:"#ccc"),t._idx=y,t.onmousemove=this._dispatchHoverLink,this.dataRangeOption.selectedMode&&(t.clickable=!0,t.onclick=this._dataRangeSelected),this.shapeList.push(new a(t)),u&&(n={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:m+U+5,y:V,color:this._selectedMap[y]?this.dataRangeOption.textStyle.color:"#ccc",text:r[y],textFont:l,textBaseline:"top"},highlightStyle:{brushType:"fill"}},"vertical"==this.dataRangeOption.orient&&"right"==this.dataRangeOption.x&&(n.style.x-=U+10,n.style.textAlign="right"),n._idx=y,n.onmousemove=this._dispatchHoverLink,this.dataRangeOption.selectedMode&&(n.clickable=!0,n.onclick=this._dataRangeSelected),this.shapeList.push(new i(n))),"horizontal"==this.dataRangeOption.orient?m+=U+(u?5:0)+(u?h.getTextWidth(e,l):0)+p:V+=d+p;!u&&this.dataRangeOption.text[1]&&("horizontal"==this.dataRangeOption.orient?m=m-p+this._textGap:V=V-p+this._textGap,n=this._getTextShape(m,V,this.dataRangeOption.text[1]),"horizontal"!=this.dataRangeOption.orient&&(n.style.y-=5,n.style.textBaseline="top"),this.shapeList.push(new i(n)))},_buildGradient:function(){var t,n,o=this.getFont(this.dataRangeOption.textStyle),r=this._itemGroupLocation.x,s=this._itemGroupLocation.y,l=this.dataRangeOption.itemWidth,m=this.dataRangeOption.itemHeight,V=h.getTextHeight("国",o),U=10,d=!0;this.dataRangeOption.text&&(d=!1,this.dataRangeOption.text[0]&&(n=this._getTextShape(r,s,this.dataRangeOption.text[0]),"horizontal"==this.dataRangeOption.orient?r+=h.getTextWidth(this.dataRangeOption.text[0],o)+this._textGap:(s+=V+this._textGap,n.style.y+=V/2+this._textGap,n.style.textBaseline="bottom"),this.shapeList.push(new i(n))));for(var p=e("zrender/tool/color"),c=1/(this.dataRangeOption.color.length-1),u=[],y=0,g=this.dataRangeOption.color.length;g>y;y++)u.push([y*c,this.dataRangeOption.color[y]]);"horizontal"==this.dataRangeOption.orient?(t={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:r,y:s,width:l*U,height:m,color:p.getLinearGradient(r,s,r+l*U,s,u)},hoverable:!1},r+=l*U+this._textGap):(t={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:r,y:s,width:l,height:m*U,color:p.getLinearGradient(r,s,r,s+m*U,u)},hoverable:!1},s+=m*U+this._textGap),this.shapeList.push(new a(t)),this._calculableLocation=t.style,this.dataRangeOption.calculable&&(this._buildFiller(),this._bulidMask(),this._bulidHandle()),this._buildIndicator(),!d&&this.dataRangeOption.text[1]&&(n=this._getTextShape(r,s,this.dataRangeOption.text[1]),this.shapeList.push(new i(n)))},_buildIndicator:function(){var e,t,n=this._calculableLocation.x,i=this._calculableLocation.y,a=this._calculableLocation.width,r=this._calculableLocation.height,s=5;"horizontal"==this.dataRangeOption.orient?"bottom"!=this.dataRangeOption.y?(e=[[n,i+r],[n-s,i+r+s],[n+s,i+r+s]],t="bottom"):(e=[[n,i],[n-s,i-s],[n+s,i-s]],t="top"):"right"!=this.dataRangeOption.x?(e=[[n+a,i],[n+a+s,i-s],[n+a+s,i+s]],t="right"):(e=[[n,i],[n-s,i-s],[n-s,i+s]],t="left"),this._indicatorShape={style:{pointList:e,color:"#fff",__rect:{x:Math.min(e[0][0],e[1][0]),y:Math.min(e[0][1],e[1][1]),width:s*("horizontal"==this.dataRangeOption.orient?2:1),height:s*("horizontal"==this.dataRangeOption.orient?1:2)}},highlightStyle:{brushType:"fill",textPosition:t,textColor:this.dataRangeOption.textStyle.color},hoverable:!1},this._indicatorShape=new o(this._indicatorShape)},_buildFiller:function(){this._fillerShape={zlevel:this.getZlevelBase(),z:this.getZBase()+1,style:{x:this._calculableLocation.x,y:this._calculableLocation.y,width:this._calculableLocation.width,height:this._calculableLocation.height,color:"rgba(255,255,255,0)"},highlightStyle:{strokeColor:"rgba(255,255,255,0.5)",lineWidth:1},draggable:!0,ondrift:this._ondrift,ondragend:this._ondragend,onmousemove:this._dispatchHoverLink,_type:"filler"},this._fillerShape=new a(this._fillerShape),this.shapeList.push(this._fillerShape)},_bulidHandle:function(){var e,t,n,i,a,r,s,l,m=this._calculableLocation.x,V=this._calculableLocation.y,U=this._calculableLocation.width,d=this._calculableLocation.height,p=this.getFont(this.dataRangeOption.textStyle),c=h.getTextHeight("国",p),u=Math.max(h.getTextWidth(this._textFormat(this.dataRangeOption.max),p),h.getTextWidth(this._textFormat(this.dataRangeOption.min),p))+2;"horizontal"==this.dataRangeOption.orient?"bottom"!=this.dataRangeOption.y?(e=[[m,V],[m,V+d+c],[m-c,V+d+c],[m-1,V+d],[m-1,V]],t=m-u/2-c,n=V+d+c/2+2,i={x:m-u-c,y:V+d,width:u+c,height:c},a=[[m+U,V],[m+U,V+d+c],[m+U+c,V+d+c],[m+U+1,V+d],[m+U+1,V]],r=m+U+u/2+c,s=n,l={x:m+U,y:V+d,width:u+c,height:c}):(e=[[m,V+d],[m,V-c],[m-c,V-c],[m-1,V],[m-1,V+d]],t=m-u/2-c,n=V-c/2-2,i={x:m-u-c,y:V-c,width:u+c,height:c},a=[[m+U,V+d],[m+U,V-c],[m+U+c,V-c],[m+U+1,V],[m+U+1,V+d]],r=m+U+u/2+c,s=n,l={x:m+U,y:V-c,width:u+c,height:c}):(u+=c,"right"!=this.dataRangeOption.x?(e=[[m,V],[m+U+c,V],[m+U+c,V-c],[m+U,V-1],[m,V-1]],t=m+U+u/2+c/2,n=V-c/2,i={x:m+U,y:V-c,width:u+c,height:c},a=[[m,V+d],[m+U+c,V+d],[m+U+c,V+c+d],[m+U,V+1+d],[m,V+d+1]],r=t,s=V+d+c/2,l={x:m+U,y:V+d,width:u+c,height:c}):(e=[[m+U,V],[m-c,V],[m-c,V-c],[m,V-1],[m+U,V-1]],t=m-u/2-c/2,n=V-c/2,i={x:m-u-c,y:V-c,width:u+c,height:c},a=[[m+U,V+d],[m-c,V+d],[m-c,V+c+d],[m,V+1+d],[m+U,V+d+1]],r=t,s=V+d+c/2,l={x:m-u-c,y:V+d,width:u+c,height:c})),this._startShape={style:{pointList:e,text:this._textFormat(this.dataRangeOption.max),textX:t,textY:n,textFont:p,color:this.getColor(this.dataRangeOption.max),rect:i,x:e[0][0],y:e[0][1],_x:e[0][0],_y:e[0][1]}},this._startShape.highlightStyle={strokeColor:this._startShape.style.color,lineWidth:1},this._endShape={style:{pointList:a,text:this._textFormat(this.dataRangeOption.min),textX:r,textY:s,textFont:p,color:this.getColor(this.dataRangeOption.min),rect:l,x:a[0][0],y:a[0][1],_x:a[0][0],_y:a[0][1]}},this._endShape.highlightStyle={strokeColor:this._endShape.style.color,lineWidth:1},this._startShape.zlevel=this._endShape.zlevel=this.getZlevelBase(),this._startShape.z=this._endShape.z=this.getZBase()+1,this._startShape.draggable=this._endShape.draggable=!0,this._startShape.ondrift=this._endShape.ondrift=this._ondrift,this._startShape.ondragend=this._endShape.ondragend=this._ondragend,this._startShape.style.textColor=this._endShape.style.textColor=this.dataRangeOption.textStyle.color,this._startShape.style.textAlign=this._endShape.style.textAlign="center",this._startShape.style.textPosition=this._endShape.style.textPosition="specific",this._startShape.style.textBaseline=this._endShape.style.textBaseline="middle",this._startShape.style.width=this._endShape.style.width=0,this._startShape.style.height=this._endShape.style.height=0,this._startShape.style.textPosition=this._endShape.style.textPosition="specific",this._startShape=new o(this._startShape),this._endShape=new o(this._endShape),this.shapeList.push(this._startShape),this.shapeList.push(this._endShape)},_bulidMask:function(){var e=this._calculableLocation.x,t=this._calculableLocation.y,n=this._calculableLocation.width,i=this._calculableLocation.height;this._startMask={zlevel:this.getZlevelBase(),z:this.getZBase()+1,style:{x:e,y:t,width:"horizontal"==this.dataRangeOption.orient?0:n,height:"horizontal"==this.dataRangeOption.orient?i:0,color:"#ccc"},hoverable:!1},this._endMask={zlevel:this.getZlevelBase(),z:this.getZBase()+1,style:{x:"horizontal"==this.dataRangeOption.orient?e+n:e,y:"horizontal"==this.dataRangeOption.orient?t:t+i,width:"horizontal"==this.dataRangeOption.orient?0:n,height:"horizontal"==this.dataRangeOption.orient?i:0,color:"#ccc"},hoverable:!1},this._startMask=new a(this._startMask),this._endMask=new a(this._endMask),this.shapeList.push(this._startMask),this.shapeList.push(this._endMask)},_buildBackground:function(){var e=this.reformCssArray(this.dataRangeOption.padding);this.shapeList.push(new a({zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this._itemGroupLocation.x-e[3],y:this._itemGroupLocation.y-e[0],width:this._itemGroupLocation.width+e[3]+e[1],height:this._itemGroupLocation.height+e[0]+e[2],brushType:0===this.dataRangeOption.borderWidth?"fill":"both",color:this.dataRangeOption.backgroundColor,strokeColor:this.dataRangeOption.borderColor,lineWidth:this.dataRangeOption.borderWidth}}))},_getItemGroupLocation:function(){var e=this._valueTextList,t=e.length,n=this.dataRangeOption.itemGap,i=this.dataRangeOption.itemWidth,a=this.dataRangeOption.itemHeight,o=0,r=0,s=this.getFont(this.dataRangeOption.textStyle),l=h.getTextHeight("国",s),m=10;if("horizontal"==this.dataRangeOption.orient){if(this.dataRangeOption.text||this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable)o=(this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable?i*m+n:t*(i+n))+(this.dataRangeOption.text&&"undefined"!=typeof this.dataRangeOption.text[0]?h.getTextWidth(this.dataRangeOption.text[0],s)+this._textGap:0)+(this.dataRangeOption.text&&"undefined"!=typeof this.dataRangeOption.text[1]?h.getTextWidth(this.dataRangeOption.text[1],s)+this._textGap:0);else{i+=5;for(var V=0;t>V;V++)o+=i+h.getTextWidth(e[V],s)+n}o-=n,r=Math.max(l,a)}else{var U;if(this.dataRangeOption.text||this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable)r=(this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable?a*m+n:t*(a+n))+(this.dataRangeOption.text&&"undefined"!=typeof this.dataRangeOption.text[0]?this._textGap+l:0)+(this.dataRangeOption.text&&"undefined"!=typeof this.dataRangeOption.text[1]?this._textGap+l:0),U=Math.max(h.getTextWidth(this.dataRangeOption.text&&this.dataRangeOption.text[0]||"",s),h.getTextWidth(this.dataRangeOption.text&&this.dataRangeOption.text[1]||"",s)),o=Math.max(i,U);else{r=(a+n)*t,i+=5,U=0;for(var V=0;t>V;V++)U=Math.max(U,h.getTextWidth(e[V],s));o=i+U}r-=n}var d,p=this.reformCssArray(this.dataRangeOption.padding),c=this.zr.getWidth();switch(this.dataRangeOption.x){case"center":d=Math.floor((c-o)/2);break;case"left":d=p[3]+this.dataRangeOption.borderWidth;break;case"right":d=c-o-p[1]-this.dataRangeOption.borderWidth;break;default:d=this.parsePercent(this.dataRangeOption.x,c),d=isNaN(d)?0:d}var u,y=this.zr.getHeight();switch(this.dataRangeOption.y){case"top":u=p[0]+this.dataRangeOption.borderWidth;break;case"bottom":u=y-r-p[2]-this.dataRangeOption.borderWidth;break;case"center":u=Math.floor((y-r)/2);break;default:u=this.parsePercent(this.dataRangeOption.y,y),u=isNaN(u)?0:u}if(this.dataRangeOption.calculable){var g=Math.max(h.getTextWidth(this.dataRangeOption.max,s),h.getTextWidth(this.dataRangeOption.min,s))+l;"horizontal"==this.dataRangeOption.orient?(g>d&&(d=g),d+o+g>c&&(d-=g)):(l>u&&(u=l),u+r+l>y&&(u-=l))}return{x:d,y:u,width:o,height:r}},_getTextShape:function(e,t,n){return{zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:"horizontal"==this.dataRangeOption.orient?e:this._itemGroupLocation.x+this._itemGroupLocation.width/2,y:"horizontal"==this.dataRangeOption.orient?this._itemGroupLocation.y+this._itemGroupLocation.height/2:t,color:this.dataRangeOption.textStyle.color,text:n,textFont:this.getFont(this.dataRangeOption.textStyle),textBaseline:"horizontal"==this.dataRangeOption.orient?"middle":"top",textAlign:"horizontal"==this.dataRangeOption.orient?"left":"center"},hoverable:!1}},_getItemShape:function(e,t,n,i,a){return{zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:e,y:t+1,width:n,height:i-2,color:a},highlightStyle:{strokeColor:a,lineWidth:1}}},__ondrift:function(e,t,n){var i=this._calculableLocation.x,a=this._calculableLocation.y,o=this._calculableLocation.width,r=this._calculableLocation.height;return"horizontal"==this.dataRangeOption.orient?e.style.x+t<=i?e.style.x=i:e.style.x+t+e.style.width>=i+o?e.style.x=i+o-e.style.width:e.style.x+=t:e.style.y+n<=a?e.style.y=a:e.style.y+n+e.style.height>=a+r?e.style.y=a+r-e.style.height:e.style.y+=n,"filler"==e._type?this._syncHandleShape():this._syncFillerShape(e),this.dataRangeOption.realtime&&this._dispatchDataRange(),!0},__ondragend:function(){this.isDragend=!0},ondragend:function(e,t){this.isDragend&&e.target&&(t.dragOut=!0,t.dragIn=!0,this.dataRangeOption.realtime||this._dispatchDataRange(),t.needRefresh=!1,this.isDragend=!1)},_syncShapeFromRange:function(){var e=this.dataRangeOption.range||{};if(this._range.end="undefined"!=typeof this._range.end?this._range.end:"undefined"!=typeof e.start?e.start:0,this._range.start="undefined"!=typeof this._range.start?this._range.start:"undefined"!=typeof e.end?e.end:100,100!=this._range.start||0!==this._range.end){if("horizontal"==this.dataRangeOption.orient){var t=this._fillerShape.style.width;this._fillerShape.style.x+=t*(100-this._range.start)/100,this._fillerShape.style.width=t*(this._range.start-this._range.end)/100}else{var n=this._fillerShape.style.height;this._fillerShape.style.y+=n*(100-this._range.start)/100,this._fillerShape.style.height=n*(this._range.start-this._range.end)/100}this.zr.modShape(this._fillerShape.id),this._syncHandleShape()}},_syncHandleShape:function(){var e=this._calculableLocation.x,t=this._calculableLocation.y,n=this._calculableLocation.width,i=this._calculableLocation.height; +"horizontal"==this.dataRangeOption.orient?(this._startShape.style.x=this._fillerShape.style.x,this._startMask.style.width=this._startShape.style.x-e,this._endShape.style.x=this._fillerShape.style.x+this._fillerShape.style.width,this._endMask.style.x=this._endShape.style.x,this._endMask.style.width=e+n-this._endShape.style.x,this._range.start=Math.ceil(100-(this._startShape.style.x-e)/n*100),this._range.end=Math.floor(100-(this._endShape.style.x-e)/n*100)):(this._startShape.style.y=this._fillerShape.style.y,this._startMask.style.height=this._startShape.style.y-t,this._endShape.style.y=this._fillerShape.style.y+this._fillerShape.style.height,this._endMask.style.y=this._endShape.style.y,this._endMask.style.height=t+i-this._endShape.style.y,this._range.start=Math.ceil(100-(this._startShape.style.y-t)/i*100),this._range.end=Math.floor(100-(this._endShape.style.y-t)/i*100)),this._syncShape()},_syncFillerShape:function(e){var t,n,i=this._calculableLocation.x,a=this._calculableLocation.y,o=this._calculableLocation.width,r=this._calculableLocation.height;"horizontal"==this.dataRangeOption.orient?(t=this._startShape.style.x,n=this._endShape.style.x,e.id==this._startShape.id&&t>=n?(n=t,this._endShape.style.x=t):e.id==this._endShape.id&&t>=n&&(t=n,this._startShape.style.x=t),this._fillerShape.style.x=t,this._fillerShape.style.width=n-t,this._startMask.style.width=t-i,this._endMask.style.x=n,this._endMask.style.width=i+o-n,this._range.start=Math.ceil(100-(t-i)/o*100),this._range.end=Math.floor(100-(n-i)/o*100)):(t=this._startShape.style.y,n=this._endShape.style.y,e.id==this._startShape.id&&t>=n?(n=t,this._endShape.style.y=t):e.id==this._endShape.id&&t>=n&&(t=n,this._startShape.style.y=t),this._fillerShape.style.y=t,this._fillerShape.style.height=n-t,this._startMask.style.height=t-a,this._endMask.style.y=n,this._endMask.style.height=a+r-n,this._range.start=Math.ceil(100-(t-a)/r*100),this._range.end=Math.floor(100-(n-a)/r*100)),this._syncShape()},_syncShape:function(){this._startShape.position=[this._startShape.style.x-this._startShape.style._x,this._startShape.style.y-this._startShape.style._y],this._startShape.style.text=this._textFormat(this._gap*this._range.start+this.dataRangeOption.min),this._startShape.style.color=this._startShape.highlightStyle.strokeColor=this.getColor(this._gap*this._range.start+this.dataRangeOption.min),this._endShape.position=[this._endShape.style.x-this._endShape.style._x,this._endShape.style.y-this._endShape.style._y],this._endShape.style.text=this._textFormat(this._gap*this._range.end+this.dataRangeOption.min),this._endShape.style.color=this._endShape.highlightStyle.strokeColor=this.getColor(this._gap*this._range.end+this.dataRangeOption.min),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this.zr.modShape(this._startMask.id),this.zr.modShape(this._endMask.id),this.zr.modShape(this._fillerShape.id),this.zr.refreshNextFrame()},_dispatchDataRange:function(){this.messageCenter.dispatch(r.EVENT.DATA_RANGE,null,{range:{start:this._range.end,end:this._range.start}},this.myChart)},__dataRangeSelected:function(e){if("single"===this.dataRangeOption.selectedMode)for(var t in this._selectedMap)this._selectedMap[t]=!1;var n=e.target._idx;this._selectedMap[n]=!this._selectedMap[n];var i=(this._colorList.length-n)*this._gap+this.dataRangeOption.min;this.messageCenter.dispatch(r.EVENT.DATA_RANGE_SELECTED,e.event,{selected:this._selectedMap,target:n,valueMax:i,valueMin:i-this._gap},this.myChart),this.messageCenter.dispatch(r.EVENT.REFRESH,null,null,this.myChart)},__dispatchHoverLink:function(e){var t,n;if(this.dataRangeOption.calculable){var i,a=this.dataRangeOption.max-this.dataRangeOption.min;i="horizontal"==this.dataRangeOption.orient?(1-(l.getX(e.event)-this._calculableLocation.x)/this._calculableLocation.width)*a:(1-(l.getY(e.event)-this._calculableLocation.y)/this._calculableLocation.height)*a,t=i-.05*a,n=i+.05*a}else{var o=e.target._idx;n=(this._colorList.length-o)*this._gap+this.dataRangeOption.min,t=n-this._gap}this.messageCenter.dispatch(r.EVENT.DATA_RANGE_HOVERLINK,e.event,{valueMin:t,valueMax:n},this.myChart)},__onhoverlink:function(e){if(this.dataRangeOption.show&&this.dataRangeOption.hoverLink&&this._indicatorShape&&e&&null!=e.seriesIndex&&null!=e.dataIndex){var t=e.value;if(""===t||isNaN(t))return;tthis.dataRangeOption.max&&(t=this.dataRangeOption.max),this._indicatorShape.position="horizontal"==this.dataRangeOption.orient?[(this.dataRangeOption.max-t)/(this.dataRangeOption.max-this.dataRangeOption.min)*this._calculableLocation.width,0]:[0,(this.dataRangeOption.max-t)/(this.dataRangeOption.max-this.dataRangeOption.min)*this._calculableLocation.height],this._indicatorShape.style.text=this._textFormat(e.value),this._indicatorShape.style.color=this.getColor(t),this.zr.addHoverShape(this._indicatorShape)}},_textFormat:function(e,t){if(e=e.toFixed(this.dataRangeOption.precision),t=null!=t?t.toFixed(this.dataRangeOption.precision):"",this.dataRangeOption.formatter){if("string"==typeof this.dataRangeOption.formatter)return this.dataRangeOption.formatter.replace("{value}",e).replace("{value2}",t);if("function"==typeof this.dataRangeOption.formatter)return this.dataRangeOption.formatter.call(this.myChart,e,t)}return""!==t?e+" - "+t:e},refresh:function(e){if(e){this.option=e,this.option.dataRange=this.reformOption(this.option.dataRange),this.dataRangeOption=this.option.dataRange,this.myChart.canvasSupported||(this.dataRangeOption.realtime=!1);var t=this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable?100:this.dataRangeOption.splitNumber;if(this._colorList=m.getGradientColors(this.dataRangeOption.color,Math.max((t-this.dataRangeOption.color.length)/(this.dataRangeOption.color.length-1),0)+1),this._colorList.length>t){for(var n=this._colorList.length,i=[this._colorList[0]],a=n/(t-1),o=1;t-1>o;o++)i.push(this._colorList[Math.floor(o*a)]);i.push(this._colorList[n-1]),this._colorList=i}var r=this.dataRangeOption.precision;for(this._gap=(this.dataRangeOption.max-this.dataRangeOption.min)/t;this._gap.toFixed(r)-0!=this._gap&&5>r;)r++;this.dataRangeOption.precision=r,this._gap=((this.dataRangeOption.max-this.dataRangeOption.min)/t).toFixed(r)-0,this._valueTextList=[];for(var o=0;t>o;o++)this._selectedMap[o]=!0,this._valueTextList.unshift(this._textFormat(o*this._gap+this.dataRangeOption.min,(o+1)*this._gap+this.dataRangeOption.min))}this.clear(),this._buildShape()},getColor:function(e){if(isNaN(e))return null;if(this.dataRangeOption.min==this.dataRangeOption.max)return this._colorList[0];if(ethis.dataRangeOption.max&&(e=this.dataRangeOption.max),this.dataRangeOption.calculable&&(e-(this._gap*this._range.start+this.dataRangeOption.min)>5e-5||e-(this._gap*this._range.end+this.dataRangeOption.min)<-5e-5))return null;var t=this._colorList.length-Math.ceil((e-this.dataRangeOption.min)/(this.dataRangeOption.max-this.dataRangeOption.min)*this._colorList.length);return t==this._colorList.length&&t--,this._selectedMap[t]?this._colorList[t]:null},getColorByIndex:function(e){return e>=this._colorList.length?e=this._colorList.length-1:0>e&&(e=0),this._colorList[e]},onbeforDispose:function(){this.messageCenter.unbind(r.EVENT.HOVER,this._onhoverlink)}},s.inherits(t,n),e("../component").define("dataRange",t),t}),n("echarts/util/shape/HandlePolygon",["require","zrender/shape/Base","zrender/shape/Polygon","zrender/tool/util"],function(e){function t(e){n.call(this,e)}var n=e("zrender/shape/Base"),i=e("zrender/shape/Polygon"),a=e("zrender/tool/util");return t.prototype={type:"handle-polygon",buildPath:function(e,t){i.prototype.buildPath(e,t)},isCover:function(e,t){var n=this.getTansform(e,t);e=n[0],t=n[1];var i=this.style.rect;return e>=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height?!0:!1}},a.inherits(t,n),t}),n("echarts/chart/k",["require","./base","../util/shape/Candle","../component/axis","../component/grid","../component/dataZoom","../config","../util/ecData","zrender/tool/util","../chart"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o),this.refresh(a)}var n=e("./base"),i=e("../util/shape/Candle");e("../component/axis"),e("../component/grid"),e("../component/dataZoom");var a=e("../config");a.k={zlevel:0,z:2,clickable:!0,hoverable:!0,legendHoverLink:!1,xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{color:"#fff",color0:"#00aa11",lineStyle:{width:1,color:"#ff3200",color0:"#00aa11"}},emphasis:{}}};var o=e("../util/ecData"),r=e("zrender/tool/util");return t.prototype={type:a.CHART_TYPE_K,_buildShape:function(){var e=this.series;this.selectedMap={};for(var t,n={top:[],bottom:[]},i=0,o=e.length;o>i;i++)e[i].type===a.CHART_TYPE_K&&(e[i]=this.reformOption(e[i]),this.legendHoverLink=e[i].legendHoverLink||this.legendHoverLink,t=this.component.xAxis.getAxis(e[i].xAxisIndex),t.type===a.COMPONENT_TYPE_AXIS_CATEGORY&&n[t.getPosition()].push(i));for(var r in n)n[r].length>0&&this._buildSinglePosition(r,n[r]);this.addShapeList()},_buildSinglePosition:function(e,t){var n=this._mapData(t),i=n.locationMap,a=n.maxDataLength;if(0!==a&&0!==i.length){this._buildHorizontal(t,a,i);for(var o=0,r=t.length;r>o;o++)this.buildMark(t[o])}},_mapData:function(e){for(var t,n,i=this.series,a=this.component.legend,o=[],r=0,s=0,l=e.length;l>s;s++)t=i[e[s]],n=t.name,this.selectedMap[n]=a?a.isSelected(n):!0,this.selectedMap[n]&&o.push(e[s]),r=Math.max(r,t.data.length);return{locationMap:o,maxDataLength:r}},_buildHorizontal:function(e,t,n){for(var i,a,o,r,s,l,h,m,V,U,d=this.series,p={},c=0,u=n.length;u>c;c++){i=n[c],a=d[i],o=a.xAxisIndex||0,r=this.component.xAxis.getAxis(o),h=a.barWidth||Math.floor(r.getGap()/2),U=a.barMaxWidth,U&&h>U&&(h=U),s=a.yAxisIndex||0,l=this.component.yAxis.getAxis(s),p[i]=[];for(var y=0,g=t;g>y&&null!=r.getNameByIndex(y);y++)m=a.data[y],V=this.getDataFromOption(m,"-"),"-"!==V&&4==V.length&&p[i].push([r.getCoordByIndex(y),h,l.getCoord(V[0]),l.getCoord(V[1]),l.getCoord(V[2]),l.getCoord(V[3]),y,r.getNameByIndex(y)])}this._buildKLine(e,p)},_buildKLine:function(e,t){for(var n,i,o,r,s,l,h,m,V,U,d,p,c,u,y,g,b,f=this.series,k=0,x=e.length;x>k;k++)if(b=e[k],d=f[b],u=t[b],this._isLarge(u)&&(u=this._getLargePointList(u)),d.type===a.CHART_TYPE_K&&null!=u){p=d,n=this.query(p,"itemStyle.normal.lineStyle.width"),i=this.query(p,"itemStyle.normal.lineStyle.color"),o=this.query(p,"itemStyle.normal.lineStyle.color0"),r=this.query(p,"itemStyle.normal.color"),s=this.query(p,"itemStyle.normal.color0"),l=this.query(p,"itemStyle.emphasis.lineStyle.width"),h=this.query(p,"itemStyle.emphasis.lineStyle.color"),m=this.query(p,"itemStyle.emphasis.lineStyle.color0"),V=this.query(p,"itemStyle.emphasis.color"),U=this.query(p,"itemStyle.emphasis.color0");for(var _=0,L=u.length;L>_;_++)y=u[_],c=d.data[y[6]],p=c,g=y[3]a;a++)i[a]=e[Math.floor(n/t*a)];return i},_getCandle:function(e,t,n,a,r,s,l,h,m,V,U,d,p,c,u){var y=this.series,g={zlevel:this.getZlevelBase(),z:this.getZBase(),clickable:this.deepQuery([y[e].data[t],y[e]],"clickable"),hoverable:this.deepQuery([y[e].data[t],y[e]],"hoverable"),style:{x:a,y:[s,l,h,m],width:r,color:V,strokeColor:d,lineWidth:U,brushType:"both"},highlightStyle:{color:p,strokeColor:u,lineWidth:c},_seriesIndex:e};return o.pack(g,y[e],e,y[e].data[t],t,n),g=new i(g)},getMarkCoord:function(e,t){var n=this.series[e],i=this.component.xAxis.getAxis(n.xAxisIndex),a=this.component.yAxis.getAxis(n.yAxisIndex);return["string"!=typeof t.xAxis&&i.getCoordByIndex?i.getCoordByIndex(t.xAxis||0):i.getCoord(t.xAxis||0),"string"!=typeof t.yAxis&&a.getCoordByIndex?a.getCoordByIndex(t.yAxis||0):a.getCoord(t.yAxis||0)]},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},addDataAnimation:function(e){for(var t=this.series,n={},i=0,a=e.length;a>i;i++)n[e[i][0]]=e[i];for(var r,s,l,h,m,V,i=0,a=this.shapeList.length;a>i;i++)if(m=this.shapeList[i]._seriesIndex,n[m]&&!n[m][3]&&"candle"===this.shapeList[i].type){if(V=o.get(this.shapeList[i],"dataIndex"),h=t[m],n[m][2]&&V===h.data.length-1){this.zr.delShape(this.shapeList[i].id);continue}if(!n[m][2]&&0===V){this.zr.delShape(this.shapeList[i].id);continue}s=this.component.xAxis.getAxis(h.xAxisIndex||0).getGap(),r=n[m][2]?s:-s,l=0,this.zr.animate(this.shapeList[i].id,"").when(this.query(this.option,"animationDurationUpdate"),{position:[r,l]}).start()}}},r.inherits(t,n),e("../chart").define("k",t),t}),n("echarts/chart/pie",["require","./base","zrender/shape/Text","zrender/shape/Ring","zrender/shape/Circle","zrender/shape/Sector","zrender/shape/Polyline","../config","../util/ecData","zrender/tool/util","zrender/tool/math","zrender/tool/color","../chart"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o);var r=this;r.shapeHandler.onmouseover=function(e){var t=e.target,n=h.get(t,"seriesIndex"),i=h.get(t,"dataIndex"),a=h.get(t,"special"),o=[t.style.x,t.style.y],s=t.style.startAngle,l=t.style.endAngle,m=((l+s)/2+360)%360,V=t.highlightStyle.color,U=r.getLabel(n,i,a,o,m,V,!0);U&&r.zr.addHoverShape(U);var d=r.getLabelLine(n,i,o,t.style.r0,t.style.r,m,V,!0);d&&r.zr.addHoverShape(d)},this.refresh(a)}var n=e("./base"),i=e("zrender/shape/Text"),a=e("zrender/shape/Ring"),o=e("zrender/shape/Circle"),r=e("zrender/shape/Sector"),s=e("zrender/shape/Polyline"),l=e("../config");l.pie={zlevel:0,z:2,clickable:!0,legendHoverLink:!0,center:["50%","50%"],radius:[0,"75%"],clockWise:!0,startAngle:90,minAngle:0,selectedOffset:10,itemStyle:{normal:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1,type:"solid"}}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!1},labelLine:{show:!1,length:20,lineStyle:{width:1,type:"solid"}}}}};var h=e("../util/ecData"),m=e("zrender/tool/util"),V=e("zrender/tool/math"),U=e("zrender/tool/color");return t.prototype={type:l.CHART_TYPE_PIE,_buildShape:function(){var e=this.series,t=this.component.legend;this.selectedMap={},this._selected={};var n,i,r;this._selectedMode=!1;for(var s,m=0,V=e.length;V>m;m++)if(e[m].type===l.CHART_TYPE_PIE){if(e[m]=this.reformOption(e[m]),this.legendHoverLink=e[m].legendHoverLink||this.legendHoverLink,s=e[m].name||"",this.selectedMap[s]=t?t.isSelected(s):!0,!this.selectedMap[s])continue;n=this.parseCenter(this.zr,e[m].center),i=this.parseRadius(this.zr,e[m].radius),this._selectedMode=this._selectedMode||e[m].selectedMode,this._selected[m]=[],this.deepQuery([e[m],this.option],"calculable")&&(r={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:n[0],y:n[1],r0:i[0]<=10?0:i[0]-10,r:i[1]+10,brushType:"stroke",lineWidth:1,strokeColor:e[m].calculableHolderColor||this.ecTheme.calculableHolderColor||l.calculableHolderColor}},h.pack(r,e[m],m,void 0,-1),this.setCalculable(r),r=i[0]<=10?new o(r):new a(r),this.shapeList.push(r)),this._buildSinglePie(m),this.buildMark(m)}this.addShapeList()},_buildSinglePie:function(e){for(var t,n=this.series,i=n[e],a=i.data,o=this.component.legend,r=0,s=0,l=0,h=Number.NEGATIVE_INFINITY,m=[],V=0,U=a.length;U>V;V++)t=a[V].name,this.selectedMap[t]=o?o.isSelected(t):!0,this.selectedMap[t]&&!isNaN(a[V].value)&&(0!==+a[V].value?r++:s++,l+=+a[V].value,h=Math.max(h,+a[V].value));if(0!==l){for(var d,p,c,u,y,g,b=100,f=i.clockWise,k=(i.startAngle.toFixed(2)-0+360)%360,x=i.minAngle||.01,_=360-x*r-.01*s,L=i.roseType,V=0,U=a.length;U>V;V++)if(t=a[V].name,this.selectedMap[t]&&!isNaN(a[V].value)){if(p=o?o.getColor(t):this.zr.getColor(V),b=a[V].value/l,d="area"!=L?f?k-b*_-(0!==b?x:.01):b*_+k+(0!==b?x:.01):f?k-360/U:360/U+k,d=d.toFixed(2)-0,b=(100*b).toFixed(2),c=this.parseCenter(this.zr,i.center),u=this.parseRadius(this.zr,i.radius),y=+u[0],g=+u[1],"radius"===L?g=a[V].value/h*(g-y)*.8+.2*(g-y)+y:"area"===L&&(g=Math.sqrt(a[V].value/h)*(g-y)+y),f){var W;W=k,k=d,d=W}this._buildItem(m,e,V,b,a[V].selected,c,y,g,k,d,p),f||(k=d)}this._autoLabelLayout(m,c,g);for(var V=0,U=m.length;U>V;V++)this.shapeList.push(m[V]);m=null}},_buildItem:function(e,t,n,i,a,o,r,s,l,m,V){var U=this.series,d=((m+l)/2+360)%360,p=this.getSector(t,n,i,a,o,r,s,l,m,V);h.pack(p,U[t],t,U[t].data[n],n,U[t].data[n].name,i),e.push(p);var c=this.getLabel(t,n,i,o,d,V,!1),u=this.getLabelLine(t,n,o,r,s,d,V,!1);u&&(h.pack(u,U[t],t,U[t].data[n],n,U[t].data[n].name,i),e.push(u)),c&&(h.pack(c,U[t],t,U[t].data[n],n,U[t].data[n].name,i),c._labelLine=u,e.push(c))},getSector:function(e,t,n,i,a,o,s,l,h,m){var d=this.series,p=d[e],c=p.data[t],u=[c,p],y=this.deepMerge(u,"itemStyle.normal")||{},g=this.deepMerge(u,"itemStyle.emphasis")||{},b=this.getItemStyleColor(y.color,e,t,c)||m,f=this.getItemStyleColor(g.color,e,t,c)||("string"==typeof b?U.lift(b,-.2):b),k={zlevel:this.getZlevelBase(),z:this.getZBase(),clickable:this.deepQuery(u,"clickable"),style:{x:a[0],y:a[1],r0:o,r:s,startAngle:l,endAngle:h,brushType:"both",color:b,lineWidth:y.borderWidth,strokeColor:y.borderColor,lineJoin:"round"},highlightStyle:{color:f,lineWidth:g.borderWidth,strokeColor:g.borderColor,lineJoin:"round"},_seriesIndex:e,_dataIndex:t};if(i){var x=((k.style.startAngle+k.style.endAngle)/2).toFixed(2)-0;k.style._hasSelected=!0,k.style._x=k.style.x,k.style._y=k.style.y;var _=this.query(p,"selectedOffset");k.style.x+=V.cos(x,!0)*_,k.style.y-=V.sin(x,!0)*_,this._selected[e][t]=!0}else this._selected[e][t]=!1;return this._selectedMode&&(k.onclick=this.shapeHandler.onclick),this.deepQuery([c,p,this.option],"calculable")&&(this.setCalculable(k),k.draggable=!0),(this._needLabel(p,c,!0)||this._needLabelLine(p,c,!0))&&(k.onmouseover=this.shapeHandler.onmouseover),k=new r(k)},getLabel:function(e,t,n,a,o,r,s){var l=this.series,h=l[e],U=h.data[t];if(this._needLabel(h,U,s)){var d,p,c,u=s?"emphasis":"normal",y=m.merge(m.clone(U.itemStyle)||{},h.itemStyle),g=y[u].label,b=g.textStyle||{},f=a[0],k=a[1],x=this.parseRadius(this.zr,h.radius),_="middle";g.position=g.position||y.normal.label.position,"center"===g.position?(d=f,p=k,c="center"):"inner"===g.position||"inside"===g.position?(x=(x[0]+x[1])*(g.distance||.5),d=Math.round(f+x*V.cos(o,!0)),p=Math.round(k-x*V.sin(o,!0)),r="#fff",c="center"):(x=x[1]- -y[u].labelLine.length,d=Math.round(f+x*V.cos(o,!0)),p=Math.round(k-x*V.sin(o,!0)),c=o>=90&&270>=o?"right":"left"),"center"!=g.position&&"inner"!=g.position&&"inside"!=g.position&&(d+="left"===c?20:-20),U.__labelX=d-("left"===c?5:-5),U.__labelY=p;var L=new i({zlevel:this.getZlevelBase(),z:this.getZBase()+1,hoverable:!1,style:{x:d,y:p,color:b.color||r,text:this.getLabelText(e,t,n,u),textAlign:b.align||c,textBaseline:b.baseline||_,textFont:this.getFont(b)},highlightStyle:{brushType:"fill"}});return L._radius=x,L._labelPosition=g.position||"outer",L._rect=L.getRect(L.style),L._seriesIndex=e,L._dataIndex=t,L}},getLabelText:function(e,t,n,i){var a=this.series,o=a[e],r=o.data[t],s=this.deepQuery([r,o],"itemStyle."+i+".label.formatter");return s?"function"==typeof s?s.call(this.myChart,{seriesIndex:e,seriesName:o.name||"",series:o,dataIndex:t,data:r,name:r.name,value:r.value,percent:n}):"string"==typeof s?(s=s.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}").replace("{d}","{d0}"),s=s.replace("{a0}",o.name).replace("{b0}",r.name).replace("{c0}",r.value).replace("{d0}",n)):void 0:r.name},getLabelLine:function(e,t,n,i,a,o,r,l){var h=this.series,U=h[e],d=U.data[t];if(this._needLabelLine(U,d,l)){var p=l?"emphasis":"normal",c=m.merge(m.clone(d.itemStyle)||{},U.itemStyle),u=c[p].labelLine,y=u.lineStyle||{},g=n[0],b=n[1],f=a,k=this.parseRadius(this.zr,U.radius)[1]- -u.length,x=V.cos(o,!0),_=V.sin(o,!0);return new s({zlevel:this.getZlevelBase(),z:this.getZBase()+1,hoverable:!1,style:{pointList:[[g+f*x,b-f*_],[g+k*x,b-k*_],[d.__labelX,d.__labelY]],strokeColor:y.color||r,lineType:y.type,lineWidth:y.width},_seriesIndex:e,_dataIndex:t})}},_needLabel:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".label.show")},_needLabelLine:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".labelLine.show")},_autoLabelLayout:function(e,t,n){for(var i=[],a=[],o=0,r=e.length;r>o;o++)("outer"===e[o]._labelPosition||"outside"===e[o]._labelPosition)&&(e[o]._rect._y=e[o]._rect.y,e[o]._rect.xa;a++)if(e[a]._rect.y+=i,e[a].style.y+=i,e[a]._labelLine&&(e[a]._labelLine.style.pointList[1][1]+=i,e[a]._labelLine.style.pointList[2][1]+=i),a>t&&n>a+1&&e[a+1]._rect.y>e[a]._rect.y+e[a]._rect.height)return void o(a,i/2);o(n-1,i/2)}function o(t,n){for(var i=t;i>=0&&(e[i]._rect.y-=n,e[i].style.y-=n,e[i]._labelLine&&(e[i]._labelLine.style.pointList[1][1]-=n,e[i]._labelLine.style.pointList[2][1]-=n),!(i>0&&e[i]._rect.y>e[i-1]._rect.y+e[i-1]._rect.height));i--);}function r(e,t,n,i,a){for(var o,r,s,l=n[0],h=n[1],m=a>0?t?Number.MAX_VALUE:0:t?Number.MAX_VALUE:0,V=0,U=e.length;U>V;V++)r=Math.abs(e[V]._rect.y-h),s=e[V]._radius-i,o=i+s>r?Math.sqrt((i+s+20)*(i+s+20)-Math.pow(e[V]._rect.y-h,2)):Math.abs(e[V]._rect.x+(a>0?0:e[V]._rect.width)-l),t&&o>=m&&(o=m-10),!t&&m>=o&&(o=m+10),e[V]._rect.x=e[V].style.x=l+o*a,e[V]._labelLine&&(e[V]._labelLine.style.pointList[2][0]=l+(o-5)*a,e[V]._labelLine.style.pointList[1][0]=l+(o-20)*a),m=o}e.sort(function(e,t){return e._rect.y-t._rect.y});for(var s,l=0,h=e.length,m=[],V=[],U=0;h>U;U++)s=e[U]._rect.y-l,0>s&&a(U,h,-s,i),l=e[U]._rect.y+e[U]._rect.height;this.zr.getHeight()-l<0&&o(h-1,l-this.zr.getHeight());for(var U=0;h>U;U++)e[U]._rect.y>=t[1]?V.push(e[U]):m.push(e[U]);r(V,!0,t,n,i),r(m,!1,t,n,i)},reformOption:function(e){var t=m.merge;return e=t(t(e||{},m.clone(this.ecTheme.pie||{})),m.clone(l.pie)),e.itemStyle.normal.label.textStyle=this.getTextStyle(e.itemStyle.normal.label.textStyle),e.itemStyle.emphasis.label.textStyle=this.getTextStyle(e.itemStyle.emphasis.label.textStyle),e},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},addDataAnimation:function(e){for(var t=this.series,n={},i=0,a=e.length;a>i;i++)n[e[i][0]]=e[i];var o={},r={},s={},h=this.shapeList;this.shapeList=[];for(var m,V,U,d={},i=0,a=e.length;a>i;i++)m=e[i][0],V=e[i][2],U=e[i][3],t[m]&&t[m].type===l.CHART_TYPE_PIE&&(V?(U||(o[m+"_"+t[m].data.length]="delete"),d[m]=1):U?d[m]=0:(o[m+"_-1"]="delete",d[m]=-1),this._buildSinglePie(m));for(var p,c,i=0,a=this.shapeList.length;a>i;i++)switch(m=this.shapeList[i]._seriesIndex,p=this.shapeList[i]._dataIndex,c=m+"_"+p,this.shapeList[i].type){case"sector":o[c]=this.shapeList[i];break;case"text":r[c]=this.shapeList[i];break;case"polyline":s[c]=this.shapeList[i]}this.shapeList=[];for(var u,i=0,a=h.length;a>i;i++)if(m=h[i]._seriesIndex,n[m]){if(p=h[i]._dataIndex+d[m],c=m+"_"+p,u=o[c],!u)continue;if("sector"===h[i].type)"delete"!=u?this.zr.animate(h[i].id,"style").when(400,{startAngle:u.style.startAngle,endAngle:u.style.endAngle}).start():this.zr.animate(h[i].id,"style").when(400,d[m]<0?{startAngle:h[i].style.startAngle}:{endAngle:h[i].style.endAngle}).start();else if("text"===h[i].type||"polyline"===h[i].type)if("delete"===u)this.zr.delShape(h[i].id);else switch(h[i].type){case"text":u=r[c],this.zr.animate(h[i].id,"style").when(400,{x:u.style.x,y:u.style.y}).start();break;case"polyline":u=s[c],this.zr.animate(h[i].id,"style").when(400,{pointList:u.style.pointList}).start()}}this.shapeList=h},onclick:function(e){var t=this.series;if(this.isClick&&e.target){this.isClick=!1;for(var n,i=e.target,a=i.style,o=h.get(i,"seriesIndex"),r=h.get(i,"dataIndex"),s=0,m=this.shapeList.length;m>s;s++)if(this.shapeList[s].id===i.id){if(o=h.get(i,"seriesIndex"),r=h.get(i,"dataIndex"),a._hasSelected)i.style.x=i.style._x,i.style.y=i.style._y,i.style._hasSelected=!1,this._selected[o][r]=!1;else{var U=((a.startAngle+a.endAngle)/2).toFixed(2)-0;i.style._hasSelected=!0,this._selected[o][r]=!0,i.style._x=i.style.x,i.style._y=i.style.y,n=this.query(t[o],"selectedOffset"),i.style.x+=V.cos(U,!0)*n,i.style.y-=V.sin(U,!0)*n}this.zr.modShape(i.id,i)}else this.shapeList[s].style._hasSelected&&"single"===this._selectedMode&&(o=h.get(this.shapeList[s],"seriesIndex"),r=h.get(this.shapeList[s],"dataIndex"),this.shapeList[s].style.x=this.shapeList[s].style._x,this.shapeList[s].style.y=this.shapeList[s].style._y,this.shapeList[s].style._hasSelected=!1,this._selected[o][r]=!1,this.zr.modShape(this.shapeList[s].id,this.shapeList[s]));this.messageCenter.dispatch(l.EVENT.PIE_SELECTED,e.event,{selected:this._selected,target:h.get(i,"name")},this.myChart),this.zr.refreshNextFrame()}}},m.inherits(t,n),e("../chart").define("pie",t),t}),n("echarts/chart/radar",["require","./base","zrender/shape/Polygon","../component/polar","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../util/accMath","../chart"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o),this.refresh(a)}var n=e("./base"),i=e("zrender/shape/Polygon");e("../component/polar");var a=e("../config");a.radar={zlevel:0,z:2,clickable:!0,legendHoverLink:!0,polarIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid"}},emphasis:{label:{show:!1}}},symbolSize:2};var o=e("../util/ecData"),r=e("zrender/tool/util"),s=e("zrender/tool/color");return t.prototype={type:a.CHART_TYPE_RADAR,_buildShape:function(){this.selectedMap={},this._symbol=this.option.symbolList,this._queryTarget,this._dropBoxList=[],this._radarDataCounter=0;for(var e,t=this.series,n=this.component.legend,i=0,o=t.length;o>i;i++)t[i].type===a.CHART_TYPE_RADAR&&(this.serie=this.reformOption(t[i]),this.legendHoverLink=t[i].legendHoverLink||this.legendHoverLink,e=this.serie.name||"",this.selectedMap[e]=n?n.isSelected(e):!0,this.selectedMap[e]&&(this._queryTarget=[this.serie,this.option],this.deepQuery(this._queryTarget,"calculable")&&this._addDropBox(i),this._buildSingleRadar(i),this.buildMark(i)));this.addShapeList()},_buildSingleRadar:function(e){for(var t,n,i,a,o=this.component.legend,r=this.serie.data,s=this.deepQuery(this._queryTarget,"calculable"),l=0;lr;r++)i=this.getDataFromOption(t.value[r]),n="-"!=i?o.getVector(e,r,i):!1,n&&a.push(n);return a},_addSymbol:function(e,t,n,i,a){for(var r,s=this.series,l=this.component.polar,h=0,m=e.length;m>h;h++)r=this.getSymbolShape(this.deepMerge([s[i].data[n],s[i]]),i,s[i].data[n].value[h],h,l.getIndicatorText(a,h),e[h][0],e[h][1],this._symbol[this._radarDataCounter%this._symbol.length],t,"#fff","vertical"),r.zlevel=this.getZlevelBase(),r.z=this.getZBase()+1,o.set(r,"data",s[i].data[n]),o.set(r,"value",s[i].data[n].value),o.set(r,"dataIndex",n),o.set(r,"special",h),this.shapeList.push(r)},_addDataShape:function(e,t,n,a,r,l){var h=this.series,m=[n,this.serie],V=this.getItemStyleColor(this.deepQuery(m,"itemStyle.normal.color"),a,r,n),U=this.deepQuery(m,"itemStyle.normal.lineStyle.width"),d=this.deepQuery(m,"itemStyle.normal.lineStyle.type"),p=this.deepQuery(m,"itemStyle.normal.areaStyle.color"),c=this.deepQuery(m,"itemStyle.normal.areaStyle"),u={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{pointList:e,brushType:c?"both":"stroke",color:p||V||("string"==typeof t?s.alpha(t,.5):t),strokeColor:V||t,lineWidth:U,lineType:d},highlightStyle:{brushType:this.deepQuery(m,"itemStyle.emphasis.areaStyle")||c?"both":"stroke",color:this.deepQuery(m,"itemStyle.emphasis.areaStyle.color")||p||V||("string"==typeof t?s.alpha(t,.5):t),strokeColor:this.getItemStyleColor(this.deepQuery(m,"itemStyle.emphasis.color"),a,r,n)||V||t,lineWidth:this.deepQuery(m,"itemStyle.emphasis.lineStyle.width")||U,lineType:this.deepQuery(m,"itemStyle.emphasis.lineStyle.type")||d}};o.pack(u,h[a],a,n,r,n.name,this.component.polar.getIndicator(h[a].polarIndex)),l&&(u.draggable=!0,this.setCalculable(u)),u=new i(u),this.shapeList.push(u)},_addDropBox:function(e){var t=this.series,n=this.deepQuery(this._queryTarget,"polarIndex");if(!this._dropBoxList[n]){var i=this.component.polar.getDropBox(n);i.zlevel=this.getZlevelBase(),i.z=this.getZBase(),this.setCalculable(i),o.pack(i,t,e,void 0,-1),this.shapeList.push(i),this._dropBoxList[n]=!0}},ondragend:function(e,t){var n=this.series;if(this.isDragend&&e.target){var i=e.target,a=o.get(i,"seriesIndex"),r=o.get(i,"dataIndex");this.component.legend&&this.component.legend.del(n[a].data[r].name),n[a].data.splice(r,1),t.dragOut=!0,t.needRefresh=!0,this.isDragend=!1}},ondrop:function(t,n){var i=this.series;if(this.isDrop&&t.target){var a,r,s=t.target,l=t.dragged,h=o.get(s,"seriesIndex"),m=o.get(s,"dataIndex"),V=this.component.legend;if(-1===m)a={value:o.get(l,"value"),name:o.get(l,"name")},i[h].data.push(a),V&&V.add(a.name,l.style.color||l.style.strokeColor);else{var U=e("../util/accMath");a=i[h].data[m],V&&V.del(a.name),a.name+=this.option.nameConnector+o.get(l,"name"),r=o.get(l,"value");for(var d=0;dh;h++)t=m.polar2cartesian(s,o*Math.PI/180+r*h),l.push({vector:[t[1],-t[0]]})},_getRadius:function(){var e=this.polar[this._index];return this.parsePercent(e.radius,Math.min(this.zr.getWidth(),this.zr.getHeight())/2) +},_buildSpiderWeb:function(e){var t=this.polar[e],n=t.__ecIndicator,i=t.splitArea,a=t.splitLine,o=this.getCenter(e),r=t.splitNumber,s=a.lineStyle.color,l=a.lineStyle.width,h=a.show,m=this.deepQuery(this._queryTarget,"axisLine");this._addArea(n,r,o,i,s,l,h),m.show&&this._addLine(n,o,m)},_addAxisLabel:function(t){for(var n,a,o,r,a,s,l,m,V,U,d=e("../util/accMath"),p=this.polar[t],c=this.deepQuery(this._queryTarget,"indicator"),u=p.__ecIndicator,y=this.deepQuery(this._queryTarget,"splitNumber"),g=this.getCenter(t),b=0;b=k;k+=U+1)r=h.merge({},o),l=d.accAdd(s.min,d.accMul(s.step,k)),r.text=this.numAddCommas(l),r.x=k*a[0]/y+Math.cos(m)*V+g[0],r.y=k*a[1]/y+Math.sin(m)*V+g[1],this.shapeList.push(new i({zlevel:this.getZlevelBase(),z:this.getZBase(),style:r,draggable:!1,hoverable:!1}))}},_buildText:function(e){for(var t,n,a,o,r,s,l,h=this.polar[e],m=h.__ecIndicator,V=this.deepQuery(this._queryTarget,"indicator"),U=this.getCenter(e),d=0,p=0,c=0;c0?"left":Math.round(t[0])<0?"right":"center",null==o.margin?t=this._mapVector(t,U,1.1):(s=o.margin,d=t[0]>0?s:-s,p=t[1]>0?s:-s,d=0===t[0]?0:d,p=0===t[1]?0:p,t=this._mapVector(t,U,1)),n.textAlign=a,n.x=t[0]+d,n.y=t[1]+p,r=o.rotate?[o.rotate/180*Math.PI,t[0],t[1]]:[0,0,0],this.shapeList.push(new i({zlevel:this.getZlevelBase(),z:this.getZBase(),style:n,draggable:!1,hoverable:!1,rotation:r})))},getIndicatorText:function(e,t){return this.polar[e]&&this.polar[e].__ecIndicator[t]&&this.polar[e].__ecIndicator[t].text},getDropBox:function(e){var t,n,e=e||0,i=this.polar[e],a=this.getCenter(e),o=i.__ecIndicator,r=o.length,s=[],l=i.type;if("polygon"==l){for(var h=0;r>h;h++)t=o[h].vector,s.push(this._mapVector(t,a,1.2));n=this._getShape(s,"fill","rgba(0,0,0,0)","",1)}else"circle"==l&&(n=this._getCircle("",1,1.2,a,"fill","rgba(0,0,0,0)"));return n},_addArea:function(e,t,n,i,a,o,r){for(var s,l,h,m,V=this.deepQuery(this._queryTarget,"type"),U=0;t>U;U++)l=(t-U)/t,r&&("polygon"==V?(m=this._getPointList(e,l,n),s=this._getShape(m,"stroke","",a,o)):"circle"==V&&(s=this._getCircle(a,o,l,n,"stroke")),this.shapeList.push(s)),i.show&&(h=(t-U-1)/t,this._addSplitArea(e,i,l,h,n,U))},_getCircle:function(e,t,n,i,a,o){var s=this._getRadius();return new r({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:i[0],y:i[1],r:s*n,brushType:a,strokeColor:e,lineWidth:t,color:o},hoverable:!1,draggable:!1})},_getRing:function(e,t,n,i){var a=this._getRadius();return new s({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:i[0],y:i[1],r:t*a,r0:n*a,color:e,brushType:"fill"},hoverable:!1,draggable:!1})},_getPointList:function(e,t,n){for(var i,a=[],o=e.length,r=0;o>r;r++)i=e[r].vector,a.push(this._mapVector(i,n,t));return a},_getShape:function(e,t,n,i,a){return new o({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{pointList:e,brushType:t,color:n,strokeColor:i,lineWidth:a},hoverable:!1,draggable:!1})},_addSplitArea:function(e,t,n,i,a,o){var r,s,l,h,m,V=e.length,U=t.areaStyle.color,d=[],V=e.length,p=this.deepQuery(this._queryTarget,"type");if("string"==typeof U&&(U=[U]),s=U.length,r=U[o%s],"polygon"==p)for(var c=0;V>c;c++)d=[],l=e[c].vector,h=e[(c+1)%V].vector,d.push(this._mapVector(l,a,n)),d.push(this._mapVector(l,a,i)),d.push(this._mapVector(h,a,i)),d.push(this._mapVector(h,a,n)),m=this._getShape(d,"fill",r,"",1),this.shapeList.push(m);else"circle"==p&&(m=this._getRing(r,n,i,a),this.shapeList.push(m))},_mapVector:function(e,t,n){return[e[0]*n+t[0],e[1]*n+t[1]]},getCenter:function(e){var e=e||0;return this.parseCenter(this.zr,this.polar[e].center)},_addLine:function(e,t,n){for(var i,a,o=e.length,r=n.lineStyle,s=r.color,l=r.width,h=r.type,m=0;o>m;m++)a=e[m].vector,i=this._getLine(t[0],t[1],a[0]+t[0],a[1]+t[1],s,l,h),this.shapeList.push(i)},_getLine:function(e,t,n,i,o,r,s){return new a({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{xStart:e,yStart:t,xEnd:n,yEnd:i,strokeColor:o,lineWidth:r,lineType:s},hoverable:!1})},_adjustIndicatorValue:function(t){for(var n,i,a=this.polar[t],o=this.deepQuery(this._queryTarget,"indicator"),r=o.length,s=a.__ecIndicator,l=this._getSeriesData(t),h=a.boundaryGap,m=a.splitNumber,V=a.scale,U=e("../util/smartSteps"),d=0;r>d;d++){if("number"==typeof o[d].max)n=o[d].max,i=o[d].min||0;else{var p=this._findValue(l,d,m,h);i=p.min,n=p.max}!V&&i>=0&&n>=0&&(i=0),!V&&0>=i&&0>=n&&(n=0);var c=U(i,n,m);s[d].value={min:c.min,max:c.max,step:c.step}}},_getSeriesData:function(e){for(var t,n,i,a=[],o=this.component.legend,r=0;ro||void 0===o)&&(o=e),(r>e||void 0===r)&&(r=e)}var o,r,s;if(e&&0!==e.length){if(1==e.length&&(r=0),1!=e.length)for(var l=0;l0?r=o/n:o/=n),{max:o,min:r}}},getVector:function(e,t,n){e=e||0,t=t||0;var i=this.polar[e].__ecIndicator;if(!(t>=i.length)){var a,o=this.polar[e].__ecIndicator[t],r=this.getCenter(e),s=o.vector,l=o.value.max,h=o.value.min;if("undefined"==typeof n)return r;switch(n){case"min":n=h;break;case"max":n=l;break;case"center":n=(l+h)/2}return a=l!=h?(n-h)/(l-h):.5,this._mapVector(s,r,a)}},isInside:function(e){var t=this.getNearestIndex(e);return t?t.polarIndex:-1},getNearestIndex:function(e){for(var t,n,i,a,o,r,s,l,h,V=0;Va[0])return{polarIndex:V,valueIndex:Math.floor((h+l/2)/l)%s}}},getIndicator:function(e){var e=e||0;return this.polar[e].indicator},refresh:function(e){e&&(this.option=e,this.polar=this.option.polar,this.series=this.option.series),this.clear(),this._buildShape()}},h.inherits(t,n),e("../component").define("polar",t),t}),n("echarts/util/coordinates",["require","zrender/tool/math"],function(e){function t(e,t){return[e*i.sin(t),e*i.cos(t)]}function n(e,t){return[Math.sqrt(e*e+t*t),Math.atan(t/e)]}var i=e("zrender/tool/math");return{polar2cartesian:t,cartesian2polar:n}}),n("echarts/chart/chord",["require","./base","zrender/shape/Text","zrender/shape/Line","zrender/shape/Sector","../util/shape/Ribbon","../util/shape/Icon","zrender/shape/BezierCurve","../config","../util/ecData","zrender/tool/util","zrender/tool/vector","../data/Graph","../layout/Chord","../chart"],function(e){"use strict";function t(e,t,i,a,o){n.call(this,e,t,i,a,o),this.scaleLineLength=4,this.scaleUnitAngle=4,this.refresh(a)}var n=e("./base"),i=e("zrender/shape/Text"),a=e("zrender/shape/Line"),o=e("zrender/shape/Sector"),r=e("../util/shape/Ribbon"),s=e("../util/shape/Icon"),l=e("zrender/shape/BezierCurve"),h=e("../config");h.chord={zlevel:0,z:2,clickable:!0,radius:["65%","75%"],center:["50%","50%"],padding:2,sort:"none",sortSub:"none",startAngle:90,clockWise:!0,ribbonType:!0,minRadius:10,maxRadius:20,symbol:"circle",showScale:!1,showScaleText:!1,itemStyle:{normal:{borderWidth:0,borderColor:"#000",label:{show:!0,rotate:!1,distance:5},chordStyle:{width:1,color:"black",borderWidth:1,borderColor:"#999",opacity:.5}},emphasis:{borderWidth:0,borderColor:"#000",chordStyle:{width:1,color:"black",borderWidth:1,borderColor:"#999"}}}};var m=e("../util/ecData"),V=e("zrender/tool/util"),U=e("zrender/tool/vector"),d=e("../data/Graph"),p=e("../layout/Chord");return t.prototype={type:h.CHART_TYPE_CHORD,_init:function(){var e=this.series;this.selectedMap={};for(var t={},n={},i=0,a=e.length;a>i;i++)if(e[i].type===this.type){var o=this.isSelected(e[i].name);this.selectedMap[e[i].name]=o,o&&this.buildMark(i),this.reformOption(e[i]),t[e[i].name]=e[i]}for(var i=0,a=e.length;a>i;i++)if(e[i].type===this.type)if(e[i].insertToSerie){var r=t[e[i].insertToSerie];e[i]._referenceSerie=r}else n[e[i].name]=[e[i]];for(var i=0,a=e.length;a>i;i++)if(e[i].type===this.type&&e[i].insertToSerie){for(var s=e[i]._referenceSerie;s&&s._referenceSerie;)s=s._referenceSerie;n[s.name]&&this.selectedMap[e[i].name]&&n[s.name].push(e[i])}for(var l in n)this._buildChords(n[l]);this.addShapeList()},_getNodeCategory:function(e,t){return e.categories&&e.categories[t.category||0]},_getNodeQueryTarget:function(e,t){var n=this._getNodeCategory(e,t);return[t,n,e]},_getEdgeQueryTarget:function(e,t,n){return n=n||"normal",[t.itemStyle&&t.itemStyle[n],e.itemStyle[n].chordStyle]},_buildChords:function(e){for(var t=[],n=e[0],i=function(e){return e.layout.size>0},a=function(e){return function(t){return e.getEdge(t.node2,t.node1)}},o=0;oa;a++){var r=i[a];if(r&&!r.ignore){var s=this._getNodeCategory(t,r),l=s?s.name:r.name;if(this.selectedMap[l]=this.isSelected(l),this.selectedMap[l]){var h=n.addNode(r.name,r);h.rawIndex=a}}}for(var a=0,o=e.links.length;o>a;a++){var m=e.links[a],V=m.source,U=m.target;"number"==typeof V&&(V=i[V],V&&(V=V.name)),"number"==typeof U&&(U=i[U],U&&(U=U.name));var p=n.addEdge(V,U,m);p&&(p.rawIndex=a)}return n.eachNode(function(e){var n=e.data.value;if(null==n)if(n=0,t.ribbonType)for(var i=0;i0&&(p.style.brushType="both"),p.highlightStyle.lineWidth>0&&(p.highlightStyle.brushType="both"),m.pack(p,e,t,n.data,n.rawIndex,n.id,n.category),this.shapeList.push(p),n.shape=p},this)},_buildNodeIcons:function(e,t,n,i){var a=this.parseCenter(this.zr,i.center),o=this.parseRadius(this.zr,i.radius),r=o[1];n.eachNode(function(n){var o=n.layout.startAngle,l=n.layout.endAngle,h=(o+l)/2,V=r*Math.cos(h),U=r*Math.sin(h),d=this._getNodeQueryTarget(i,n.data),p=this._getNodeCategory(i,n.data),c=this.deepQuery(d,"itemStyle.normal.color");c||(c=this.getColor(p?p.name:n.id));var u=new s({zlevel:this.getZlevelBase(),z:this.getZBase()+1,style:{x:-n.layout.size,y:-n.layout.size,width:2*n.layout.size,height:2*n.layout.size,iconType:this.deepQuery(d,"symbol"),color:c,brushType:"both",lineWidth:this.deepQuery(d,"itemStyle.normal.borderWidth"),strokeColor:this.deepQuery(d,"itemStyle.normal.borderColor")},highlightStyle:{color:this.deepQuery(d,"itemStyle.emphasis.color"),lineWidth:this.deepQuery(d,"itemStyle.emphasis.borderWidth"),strokeColor:this.deepQuery(d,"itemStyle.emphasis.borderColor")},clickable:i.clickable,position:[V+a[0],U+a[1]]});m.pack(u,e,t,n.data,n.rawIndex,n.id,n.category),this.shapeList.push(u),n.shape=u},this)},_buildLabels:function(e,t,n,a){var o=this.query(a,"itemStyle.normal.label.color"),r=this.query(a,"itemStyle.normal.label.rotate"),s=this.query(a,"itemStyle.normal.label.distance"),l=this.parseCenter(this.zr,a.center),h=this.parseRadius(this.zr,a.radius),m=a.clockWise,V=m?1:-1;n.eachNode(function(e){var t=e.layout.startAngle/Math.PI*180*V,n=e.layout.endAngle/Math.PI*180*V,m=(t*-V+n*-V)/2;m%=360,0>m&&(m+=360);var d=90>=m||m>=270;m=m*Math.PI/180;var p=[Math.cos(m),-Math.sin(m)],c=0;c=a.ribbonType?a.showScaleText?35+s:s:s+e.layout.size;var u=U.scale([],p,h[1]+c);U.add(u,u,l);var y={zlevel:this.getZlevelBase(),z:this.getZBase()+1,hoverable:!1,style:{text:null==e.data.label?e.id:e.data.label,textAlign:d?"left":"right",color:o||"#000000"}};r?(y.rotation=d?m:Math.PI+m,y.style.x=d?h[1]+c:-h[1]-c,y.style.y=0,y.position=l.slice()):(y.style.x=u[0],y.style.y=u[1]),y.style.textColor=this.deepQuery([e.data,a],"itemStyle.normal.label.textStyle.color")||"#fff",y.style.textFont=this.getFont(this.deepQuery([e.data,a],"itemStyle.normal.label.textStyle")),y=new i(y),this.shapeList.push(y),e.labelShape=y},this)},_buildRibbons:function(e,t,n,i){var a=e[t],o=this.parseCenter(this.zr,i.center),s=this.parseRadius(this.zr,i.radius);n.eachEdge(function(l,h){var V,U=n.getEdge(l.node2,l.node1);if(U&&!l.shape){if(U.shape)return void(l.shape=U.shape);var d=l.layout.startAngle/Math.PI*180,p=l.layout.endAngle/Math.PI*180,c=U.layout.startAngle/Math.PI*180,u=U.layout.endAngle/Math.PI*180;V=this.getColor(1===e.length?l.layout.weight<=U.layout.weight?l.node1.id:l.node2.id:a.name);var y,g,b=this._getEdgeQueryTarget(a,l.data),f=this._getEdgeQueryTarget(a,l.data,"emphasis"),k=new r({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:o[0],y:o[1],r:s[0],source0:d,source1:p,target0:c,target1:u,brushType:"both",opacity:this.deepQuery(b,"opacity"),color:V,lineWidth:this.deepQuery(b,"borderWidth"),strokeColor:this.deepQuery(b,"borderColor"),clockWise:i.clockWise},clickable:i.clickable,highlightStyle:{brushType:"both",opacity:this.deepQuery(f,"opacity"),lineWidth:this.deepQuery(f,"borderWidth"),strokeColor:this.deepQuery(f,"borderColor")}});l.layout.weight<=U.layout.weight?(y=U.node1,g=U.node2):(y=l.node1,g=l.node2),m.pack(k,a,t,l.data,null==l.rawIndex?h:l.rawIndex,l.data.name||y.id+"-"+g.id,y.id,g.id),this.shapeList.push(k),l.shape=k}},this)},_buildEdgeCurves:function(e,t,n,i,a){var o=e[t],r=this.parseCenter(this.zr,i.center);n.eachEdge(function(e,n){var i=a.getNodeById(e.node1.id),s=a.getNodeById(e.node2.id),h=i.shape,V=s.shape,U=this._getEdgeQueryTarget(o,e.data),d=this._getEdgeQueryTarget(o,e.data,"emphasis"),p=new l({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{xStart:h.position[0],yStart:h.position[1],xEnd:V.position[0],yEnd:V.position[1],cpX1:r[0],cpY1:r[1],lineWidth:this.deepQuery(U,"width"),strokeColor:this.deepQuery(U,"color"),opacity:this.deepQuery(U,"opacity")},highlightStyle:{lineWidth:this.deepQuery(d,"width"),strokeColor:this.deepQuery(d,"color"),opacity:this.deepQuery(d,"opacity")}});m.pack(p,o,t,e.data,null==e.rawIndex?n:e.rawIndex,e.data.name||e.node1.id+"-"+e.node2.id,e.node1.id,e.node2.id),this.shapeList.push(p),e.shape=p},this)},_buildScales:function(e,t,n){var o,r,s=e.clockWise,l=this.parseCenter(this.zr,e.center),h=this.parseRadius(this.zr,e.radius),m=s?1:-1,V=0,d=-1/0;e.showScaleText&&(n.eachNode(function(e){var t=e.data.value;t>d&&(d=t),V+=t}),d>1e10?(o="b",r=1e-9):d>1e7?(o="m",r=1e-6):d>1e4?(o="k",r=.001):(o="",r=1));var p=V/(360-e.padding);n.eachNode(function(t){for(var n=t.layout.startAngle/Math.PI*180,V=t.layout.endAngle/Math.PI*180,d=n;;){if(s&&d>V||!s&&V>d)break;var c=d/180*Math.PI,u=[Math.cos(c),Math.sin(c)],y=U.scale([],u,h[1]+1);U.add(y,y,l);var g=U.scale([],u,h[1]+this.scaleLineLength);U.add(g,g,l);var b=new a({zlevel:this.getZlevelBase(),z:this.getZBase()-1,hoverable:!1,style:{xStart:y[0],yStart:y[1],xEnd:g[0],yEnd:g[1],lineCap:"round",brushType:"stroke",strokeColor:"#666",lineWidth:1}});this.shapeList.push(b),d+=m*this.scaleUnitAngle}if(e.showScaleText)for(var f=n,k=5*p*this.scaleUnitAngle,x=0;;){if(s&&f>V||!s&&V>f)break;var c=f;c%=360,0>c&&(c+=360);var _=90>=c||c>=270,L=new i({zlevel:this.getZlevelBase(),z:this.getZBase()-1,hoverable:!1,style:{x:_?h[1]+this.scaleLineLength+4:-h[1]-this.scaleLineLength-4,y:0,text:Math.round(10*x)/10+o,textAlign:_?"left":"right"},position:l.slice(),rotation:_?[-c/180*Math.PI,0,0]:[-(c+180)/180*Math.PI,0,0]});this.shapeList.push(L),x+=k*r,f+=m*this.scaleUnitAngle*5}},this)},refresh:function(e){if(e&&(this.option=e,this.series=e.series),this.legend=this.component.legend,this.legend)this.getColor=function(e){return this.legend.getColor(e)},this.isSelected=function(e){return this.legend.isSelected(e)};else{var t={},n=0;this.getColor=function(e){return t[e]?t[e]:(t[e]||(t[e]=this.zr.getColor(n++)),t[e])},this.isSelected=function(){return!0}}this.backupShapeList(),this._init()},reformOption:function(e){var t=V.merge;e=t(t(e||{},this.ecTheme.chord),h.chord),e.itemStyle.normal.label.textStyle=this.getTextStyle(e.itemStyle.normal.label.textStyle)}},V.inherits(t,n),e("../chart").define("chord",t),t}),n("echarts/util/shape/Ribbon",["require","zrender/shape/Base","zrender/shape/util/PathProxy","zrender/tool/util","zrender/tool/area"],function(e){function t(e){n.call(this,e),this._pathProxy=new i}var n=e("zrender/shape/Base"),i=e("zrender/shape/util/PathProxy"),a=e("zrender/tool/util"),o=e("zrender/tool/area");return t.prototype={type:"ribbon",buildPath:function(e,t){var n=t.clockWise||!1,i=this._pathProxy;i.begin(e);var a=t.x,o=t.y,r=t.r,s=t.source0/180*Math.PI,l=t.source1/180*Math.PI,h=t.target0/180*Math.PI,m=t.target1/180*Math.PI,V=a+Math.cos(s)*r,U=o+Math.sin(s)*r,d=a+Math.cos(l)*r,p=o+Math.sin(l)*r,c=a+Math.cos(h)*r,u=o+Math.sin(h)*r,y=a+Math.cos(m)*r,g=o+Math.sin(m)*r;i.moveTo(V,U),i.arc(a,o,t.r,s,l,!n),i.bezierCurveTo(.7*(a-d)+d,.7*(o-p)+p,.7*(a-c)+c,.7*(o-u)+u,c,u),(t.source0!==t.target0||t.source1!==t.target1)&&(i.arc(a,o,t.r,h,m,!n),i.bezierCurveTo(.7*(a-y)+y,.7*(o-g)+g,.7*(a-V)+V,.7*(o-U)+U,V,U))},getRect:function(e){return e.__rect?e.__rect:(this._pathProxy.isEmpty()||this.buildPath(null,e),this._pathProxy.fastBoundingRect())},isCover:function(e,t){var n=this.getRect(this.style);return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height?o.isInsidePath(this._pathProxy.pathCommands,0,"fill",e,t):void 0}},a.inherits(t,n),t}),n("zrender/shape/BezierCurve",["require","./Base","../tool/util"],function(e){"use strict";var t=e("./Base"),n=function(e){this.brushTypeOnly="stroke",this.textPosition="end",t.call(this,e)};return n.prototype={type:"bezier-curve",buildPath:function(e,t){e.moveTo(t.xStart,t.yStart),"undefined"!=typeof t.cpX2&&"undefined"!=typeof t.cpY2?e.bezierCurveTo(t.cpX1,t.cpY1,t.cpX2,t.cpY2,t.xEnd,t.yEnd):e.quadraticCurveTo(t.cpX1,t.cpY1,t.xEnd,t.yEnd)},getRect:function(e){if(e.__rect)return e.__rect;var t=Math.min(e.xStart,e.xEnd,e.cpX1),n=Math.min(e.yStart,e.yEnd,e.cpY1),i=Math.max(e.xStart,e.xEnd,e.cpX1),a=Math.max(e.yStart,e.yEnd,e.cpY1),o=e.cpX2,r=e.cpY2;"undefined"!=typeof o&&"undefined"!=typeof r&&(t=Math.min(t,o),n=Math.min(n,r),i=Math.max(i,o),a=Math.max(a,r));var s=e.lineWidth||1;return e.__rect={x:t-s,y:n-s,width:i-t+s,height:a-n+s},e.__rect}},e("../tool/util").inherits(n,t),n}),n("echarts/data/Graph",["require","zrender/tool/util"],function(e){var t=e("zrender/tool/util"),n=function(e){this._directed=e||!1,this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={}};n.prototype.isDirected=function(){return this._directed},n.prototype.addNode=function(e,t){if(this._nodesMap[e])return this._nodesMap[e];var i=new n.Node(e,t);return this.nodes.push(i),this._nodesMap[e]=i,i},n.prototype.getNodeById=function(e){return this._nodesMap[e]},n.prototype.addEdge=function(e,t,i){if("string"==typeof e&&(e=this._nodesMap[e]),"string"==typeof t&&(t=this._nodesMap[t]),e&&t){var a=e.id+"-"+t.id;if(this._edgesMap[a])return this._edgesMap[a];var o=new n.Edge(e,t,i);return this._directed&&(e.outEdges.push(o),t.inEdges.push(o)),e.edges.push(o),e!==t&&t.edges.push(o),this.edges.push(o),this._edgesMap[a]=o,o}},n.prototype.removeEdge=function(e){var n=e.node1,i=e.node2,a=n.id+"-"+i.id;this._directed&&(n.outEdges.splice(t.indexOf(n.outEdges,e),1),i.inEdges.splice(t.indexOf(i.inEdges,e),1)),n.edges.splice(t.indexOf(n.edges,e),1),n!==i&&i.edges.splice(t.indexOf(i.edges,e),1),delete this._edgesMap[a],this.edges.splice(t.indexOf(this.edges,e),1)},n.prototype.getEdge=function(e,t){return"string"!=typeof e&&(e=e.id),"string"!=typeof t&&(t=t.id),this._directed?this._edgesMap[e+"-"+t]:this._edgesMap[e+"-"+t]||this._edgesMap[t+"-"+e]},n.prototype.removeNode=function(e){if("string"!=typeof e||(e=this._nodesMap[e])){delete this._nodesMap[e.id],this.nodes.splice(t.indexOf(this.nodes,e),1);for(var n=0;ni;)e.call(t,this.nodes[i],i)?i++:(this.removeNode(this.nodes[i]),n--)},n.prototype.filterEdge=function(e,t){for(var n=this.edges.length,i=0;n>i;)e.call(t,this.edges[i],i)?i++:(this.removeEdge(this.edges[i]),n--)},n.prototype.eachNode=function(e,t){for(var n=this.nodes.length,i=0;n>i;i++)this.nodes[i]&&e.call(t,this.nodes[i],i)},n.prototype.eachEdge=function(e,t){for(var n=this.edges.length,i=0;n>i;i++)this.edges[i]&&e.call(t,this.edges[i],i)},n.prototype.clear=function(){this.nodes.length=0,this.edges.length=0,this._nodesMap={},this._edgesMap={}},n.prototype.breadthFirstTraverse=function(e,t,n,i){if("string"==typeof t&&(t=this._nodesMap[t]),t){var a="edges";"out"===n?a="outEdges":"in"===n&&(a="inEdges");for(var o=0;or;r++){var s=o.addNode(e[r].id,e[r]);s.data.value=0,i&&(s.data.outValue=s.data.inValue=0)}for(var r=0;a>r;r++)for(var l=0;a>l;l++){var h=t[r][l];i&&(o.nodes[r].data.outValue+=h,o.nodes[l].data.inValue+=h),o.nodes[r].data.value+=h,o.nodes[l].data.value+=h}for(var r=0;a>r;r++)for(var l=r;a>l;l++){var h=t[r][l];if(0!==h){var m=o.nodes[r],V=o.nodes[l],U=o.addEdge(m,V,{});if(U.data.weight=h,r!==l&&i&&t[l][r]){var d=o.addEdge(V,m,{});d.data.weight=t[l][r]}}}return o}},n}),n("echarts/layout/Chord",["require"],function(){var e=function(e){e=e||{},this.sort=e.sort||null,this.sortSub=e.sortSub||null,this.padding=.05,this.startAngle=e.startAngle||0,this.clockWise=null==e.clockWise?!1:e.clockWise,this.center=e.center||[0,0],this.directed=!0};e.prototype.run=function(e){e instanceof Array||(e=[e]);var i=e.length;if(i){for(var a=e[0],o=a.nodes.length,r=[],s=0,l=0;o>l;l++){var h=a.nodes[l],m={size:0,subGroups:[],node:h};r.push(m);for(var V=0,U=0;Ul;l++){var m=r[l];m.node.layout.startAngle=f,m.node.layout.endAngle=f+k*m.size*b,m.node.layout.subGroups=[];for(var u=0;ui;i++){var o=n[i];if(o.type===d.CHART_TYPE_FORCE){if(n[i]=this.reformOption(n[i]),e=n[i].name||"",this.selectedMap[e]=t?t.isSelected(e):!0,!this.selectedMap[e])continue;this.buildMark(i),this._initSerie(o,i);break}}this.animationEffect()},_getNodeCategory:function(e,t){return e.categories&&e.categories[t.category||0]},_getNodeQueryTarget:function(e,t,n){n=n||"normal";var i=this._getNodeCategory(e,t)||{};return[t.itemStyle&&t.itemStyle[n],i&&i.itemStyle&&i.itemStyle[n],e.itemStyle[n].nodeStyle]},_getEdgeQueryTarget:function(e,t,n){return n=n||"normal",[t.itemStyle&&t.itemStyle[n],e.itemStyle[n].linkStyle]},_initSerie:function(e,t){this._temperature=1,this._graph=e.data?this._getSerieGraphFromDataMatrix(e):this._getSerieGraphFromNodeLinks(e),this._buildLinkShapes(e,t),this._buildNodeShapes(e,t);var n=e.roam===!0||"move"===e.roam,i=e.roam===!0||"scale"===e.roam;this.zr.modLayer(this.getZlevelBase(),{panable:n,zoomable:i}),(this.query("markPoint.effect.show")||this.query("markLine.effect.show"))&&this.zr.modLayer(d.EFFECT_ZLEVEL,{panable:n,zoomable:i}),this._initLayout(e),this._step()},_getSerieGraphFromDataMatrix:function(e){for(var t=[],n=0,i=[],a=0;ai;i++){var o=n[i];if(o&&!o.ignore){var r=this._getNodeCategory(e,o),l=r?r.name:o.name;if(this.selectedMap[l]=this.isSelected(l),this.selectedMap[l]){var h=t.addNode(o.name,o);h.rawIndex=i}}}for(var i=0,a=e.links.length;a>i;i++){var m=e.links[i],V=m.source,U=m.target;"number"==typeof V&&(V=n[V],V&&(V=V.name)),"number"==typeof U&&(U=n[U],U&&(U=U.name));var d=t.addEdge(V,U,m);d&&(d.rawIndex=i)}return t.eachNode(function(e){var t=e.data.value;if(null==t){t=0;for(var n=0;nl;l++){var h=t.nodes[l];s=Math.max(h.layout.size,s),r=Math.min(h.layout.size,r)}for(var m=s-r,l=0;n>l;l++){var h=t.nodes[l];m>0?(h.layout.size=(h.layout.size-r)*(a-i)/m+i,h.layout.mass=h.layout.size/a):(h.layout.size=(a-i)/2,h.layout.mass=.5)}for(var l=0;n>l;l++){var h=t.nodes[l];if("undefined"!=typeof this.__nodePositionMap[h.id])h.layout.position=y.create(),y.copy(h.layout.position,this.__nodePositionMap[h.id]);else if("undefined"!=typeof h.data.initial)h.layout.position=y.create(),y.copy(h.layout.position,h.data.initial);else{var V=this._layout.center,U=Math.min(this._layout.width,this._layout.height);h.layout.position=o(V[0],V[1],.8*U)}var d=h.shape.style,p=h.layout.size;d.width=d.width||2*p,d.height=d.height||2*p,d.x=-d.width/2,d.y=-d.height/2,y.copy(h.shape.position,h.layout.position)}n=t.edges.length,s=-1/0;for(var l=0;n>l;l++){var c=t.edges[l];c.layout.weight>s&&(s=c.layout.weight)}for(var l=0;n>l;l++){var c=t.edges[l];c.layout.weight/=s}this._layout.init(t,e.useWorker)},_buildNodeShapes:function(e,t){var n=this._graph,i=this.query(e,"categories");n.eachNode(function(n){var a=this._getNodeCategory(e,n.data),o=[n.data,a,e],r=this._getNodeQueryTarget(e,n.data),s=this._getNodeQueryTarget(e,n.data,"emphasis"),l=new U({style:{x:0,y:0,color:this.deepQuery(r,"color"),brushType:"both",strokeColor:this.deepQuery(r,"strokeColor")||this.deepQuery(r,"borderColor"),lineWidth:this.deepQuery(r,"lineWidth")||this.deepQuery(r,"borderWidth")},highlightStyle:{color:this.deepQuery(s,"color"),strokeColor:this.deepQuery(s,"strokeColor")||this.deepQuery(s,"borderColor"),lineWidth:this.deepQuery(s,"lineWidth")||this.deepQuery(s,"borderWidth")},clickable:e.clickable,zlevel:this.getZlevelBase(),z:this.getZBase()});l.style.color||(l.style.color=this.getColor(a?a.name:n.id)),l.style.iconType=this.deepQuery(o,"symbol"),l.style.width=l.style.height=2*(this.deepQuery(o,"symbolSize")||0),l.style.iconType.match("image")&&(l.style.image=l.style.iconType.replace(new RegExp("^image:\\/\\/"),""),l=new V({style:l.style,highlightStyle:l.highlightStyle,clickable:l.clickable,zlevel:this.getZlevelBase(),z:this.getZBase()})),this.deepQuery(o,"itemStyle.normal.label.show")&&(l.style.text=null==n.data.label?n.id:n.data.label,l.style.textPosition=this.deepQuery(o,"itemStyle.normal.label.position"),l.style.textColor=this.deepQuery(o,"itemStyle.normal.label.textStyle.color"),l.style.textFont=this.getFont(this.deepQuery(o,"itemStyle.normal.label.textStyle")||{})),this.deepQuery(o,"itemStyle.emphasis.label.show")&&(l.highlightStyle.textPosition=this.deepQuery(o,"itemStyle.emphasis.label.position"),l.highlightStyle.textColor=this.deepQuery(o,"itemStyle.emphasis.label.textStyle.color"),l.highlightStyle.textFont=this.getFont(this.deepQuery(o,"itemStyle.emphasis.label.textStyle")||{})),this.deepQuery(o,"draggable")&&(this.setCalculable(l),l.dragEnableTime=0,l.draggable=!0,l.ondragstart=this.shapeHandler.ondragstart,l.ondragover=null);var h="";if("undefined"!=typeof n.category){var a=i[n.category];h=a&&a.name||""}p.pack(l,e,t,n.data,n.rawIndex,n.data.name||"",n.category),this.shapeList.push(l),this.zr.addShape(l),n.shape=l},this)},_buildLinkShapes:function(e,t){for(var n=this._graph,i=n.edges.length,a=0;i>a;a++){var o=n.edges[a],r=o.data,s=o.node1,l=o.node2,V=this._getEdgeQueryTarget(e,r),d=this.deepQuery(V,"type");e.linkSymbol&&"none"!==e.linkSymbol&&(d="line");var u="line"===d?h:m,y=new u({style:{xStart:0,yStart:0,xEnd:0,yEnd:0},clickable:this.query(e,"clickable"),highlightStyle:{},zlevel:this.getZlevelBase(),z:this.getZBase()});if(c.merge(y.style,this.query(e,"itemStyle.normal.linkStyle"),!0),c.merge(y.highlightStyle,this.query(e,"itemStyle.emphasis.linkStyle"),!0),"undefined"!=typeof r.itemStyle&&(r.itemStyle.normal&&c.merge(y.style,r.itemStyle.normal,!0),r.itemStyle.emphasis&&c.merge(y.highlightStyle,r.itemStyle.emphasis,!0)),y.style.lineWidth=y.style.lineWidth||y.style.width,y.style.strokeColor=y.style.strokeColor||y.style.color,y.highlightStyle.lineWidth=y.highlightStyle.lineWidth||y.highlightStyle.width,y.highlightStyle.strokeColor=y.highlightStyle.strokeColor||y.highlightStyle.color,p.pack(y,e,t,o.data,null==o.rawIndex?a:o.rawIndex,o.data.name||s.id+" - "+l.id,s.id,l.id),this.shapeList.push(y),this.zr.addShape(y),o.shape=y,e.linkSymbol&&"none"!==e.linkSymbol){var g=new U({style:{x:-5,y:0,width:e.linkSymbolSize[0],height:e.linkSymbolSize[1],iconType:e.linkSymbol,brushType:"fill",color:y.style.strokeColor},highlightStyle:{brushType:"fill"},position:[0,0],rotation:0});y._symbolShape=g,this.shapeList.push(g),this.zr.addShape(g)}}},_updateLinkShapes:function(){for(var e=y.create(),t=this._graph.edges,n=0,i=t.length;i>n;n++){var a=t[n],o=a.node1.shape,r=a.node2.shape,s=o.position,l=r.position;if(a.shape.style.xStart=s[0],a.shape.style.yStart=s[1],a.shape.style.xEnd=l[0],a.shape.style.yEnd=l[1],"bezier-curve"===a.shape.type&&(a.shape.style.cpX1=(s[0]+l[0])/2-(l[1]-s[1])/4,a.shape.style.cpY1=(s[1]+l[1])/2-(s[0]-l[0])/4),a.shape.modSelf(),a.shape._symbolShape){var h=a.shape._symbolShape;y.copy(h.position,r.position),y.sub(e,o.position,r.position),y.normalize(e,e),y.scaleAndAdd(h.position,h.position,e,r.style.width/2+2);var m=Math.atan2(e[1],e[0]);h.rotation=Math.PI/2-m,h.modSelf()}}},_syncNodePositions:function(){for(var e=this._graph,t=0;t.01?this._layout.step(this._steps):this.messageCenter.dispatch(d.EVENT.FORCE_LAYOUT_END,{},{},this.myChart)},refresh:function(e){if(e&&(this.option=e,this.series=this.option.series),this.legend=this.component.legend,this.legend)this.getColor=function(e){return this.legend.getColor(e)},this.isSelected=function(e){return this.legend.isSelected(e)};else{var t={},n=0;this.getColor=function(e){return t[e]?t[e]:(t[e]||(t[e]=this.zr.getColor(n++)),t[e])},this.isSelected=function(){return!0}}this._init()},dispose:function(){this.clear(),this.shapeList=null,this.effectList=null,this._layout.dispose(),this._layout=null,this.__nodePositionMap={}},getPosition:function(){var e=[];return this._graph.eachNode(function(t){t.layout&&e.push({name:t.data.name,position:Array.prototype.slice.call(t.layout.position)})}),e}},c.inherits(t,r),e("../chart").define("force",t),t}),n("echarts/layout/Force",["require","./forceLayoutWorker","zrender/tool/vector"],function(e){function t(){if("undefined"!=typeof Worker&&"undefined"!=typeof Blob)try{var e=new Blob([i.getWorkerCode()]);n=window.URL.createObjectURL(e)}catch(t){n=""}return n}var n,i=e("./forceLayoutWorker"),a=e("zrender/tool/vector"),o=window.requestAnimationFrame||window.msRequestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(e){setTimeout(e,16)},r="undefined"==typeof Float32Array?Array:Float32Array,s=function(e){"undefined"==typeof n&&t(),e=e||{},this.width=e.width||500,this.height=e.height||500,this.center=e.center||[this.width/2,this.height/2],this.ratioScaling=e.ratioScaling||!1,this.scaling=e.scaling||1,this.gravity="undefined"!=typeof e.gravity?e.gravity:1,this.large=e.large||!1,this.preventNodeOverlap=e.preventNodeOverlap||!1,this.preventNodeEdgeOverlap=e.preventNodeEdgeOverlap||!1,this.maxSpeedIncrease=e.maxSpeedIncrease||1,this.onupdate=e.onupdate||function(){},this.temperature=e.temperature||1,this.coolDown=e.coolDown||.99,this._layout=null,this._layoutWorker=null;var i=this,a=this._$onupdate;this._$onupdate=function(e){a.call(i,e)}};return s.prototype.updateConfig=function(){var e=this.width,t=this.height,n=Math.min(e,t),i={center:this.center,width:this.ratioScaling?e:n,height:this.ratioScaling?t:n,scaling:this.scaling||1,gravity:this.gravity||1,barnesHutOptimize:this.large,preventNodeOverlap:this.preventNodeOverlap,preventNodeEdgeOverlap:this.preventNodeEdgeOverlap,maxSpeedIncrease:this.maxSpeedIncrease};if(this._layoutWorker)this._layoutWorker.postMessage({cmd:"updateConfig",config:i});else for(var a in i)this._layout[a]=i[a]},s.prototype.init=function(e,t){if(n&&t)try{this._layoutWorker||(this._layoutWorker=new Worker(n),this._layoutWorker.onmessage=this._$onupdate),this._layout=null}catch(a){this._layoutWorker=null,this._layout||(this._layout=new i)}else this._layout||(this._layout=new i),this._layoutWorker&&(this._layoutWorker.terminate(),this._layoutWorker=null);this.temperature=1,this.graph=e;for(var o=e.nodes.length,s=new r(2*o),l=new r(o),h=new r(o),m=0;o>m;m++){var V=e.nodes[m];s[2*m]=V.layout.position[0],s[2*m+1]=V.layout.position[1],l[m]="undefined"==typeof V.layout.mass?1:V.layout.mass,h[m]="undefined"==typeof V.layout.size?1:V.layout.size,V.layout.__index=m}o=e.edges.length;for(var U=new r(2*o),d=new r(o),m=0;o>m;m++){var p=e.edges[m];U[2*m]=p.node1.layout.__index,U[2*m+1]=p.node2.layout.__index,d[m]=p.layout.weight||1}this._layoutWorker?this._layoutWorker.postMessage({cmd:"init",nodesPosition:s,nodesMass:l,nodesSize:h,edges:U,edgesWeight:d}):(this._layout.initNodes(s,l,h),this._layout.initEdges(U,d)),this.updateConfig()},s.prototype.step=function(e){var t=this.graph.nodes;if(this._layoutWorker){for(var n=new r(2*t.length),i=0;ii;i++)this.temperature*=this.coolDown}else{o(this._$onupdate);for(var i=0;ii;i++)this._layout.temperature=this.temperature,this._layout.update(),this.temperature*=this.coolDown}},s.prototype._$onupdate=function(e){if(this._layoutWorker){for(var t=new Float32Array(e.data),n=0;n0&&(a=1/Math.sqrt(a),e[0]=t[0]*a,e[1]=t[1]*a),e},negate:function(e,t){return e[0]=-t[0],e[1]=-t[1],e},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e},set:function(e,t,n){return e[0]=t,e[1]=n,e}}:e("zrender/tool/vector");var l="undefined"==typeof Float32Array?Array:Float32Array;if(t.prototype.beforeUpdate=function(){for(var e=0;e=e&&this.bbox[1]<=t&&this.bbox[3]>=t},t.prototype.setBBox=function(e,t,n,i){this.bbox[0]=e,this.bbox[1]=t,this.bbox[2]=n,this.bbox[3]=i,this.size=(n-e+i-t)/2},t.prototype._newSubRegion=function(){var e=this.subRegions[this.nSubRegions];return e||(e=new t,this.subRegions[this.nSubRegions]=e),this.nSubRegions++,e},t.prototype._addNodeToSubRegion=function(e){var t=this.findSubRegion(e.position[0],e.position[1]),n=this.bbox;if(!t){var i=(n[0]+n[2])/2,a=(n[1]+n[3])/2,o=(n[2]-n[0])/2,r=(n[3]-n[1])/2,s=e.position[0]>=i?1:0,l=e.position[1]>=a?1:0,t=this._newSubRegion();t.setBBox(s*o+n[0],l*r+n[1],(s+1)*o+n[0],(l+1)*r+n[1])}t.addNode(e)},t.prototype._updateCenterOfMass=function(e){null==this.centerOfMass&&(this.centerOfMass=r.create());var t=this.centerOfMass[0]*this.mass,n=this.centerOfMass[1]*this.mass;t+=e.position[0]*e.mass,n+=e.position[1]*e.mass,this.mass+=e.mass,this.centerOfMass[0]=t/this.mass,this.centerOfMass[1]=n/this.mass},a.prototype.nodeToNodeRepulsionFactor=function(e,t,n){return n*n*e/t},a.prototype.edgeToNodeRepulsionFactor=function(e,t,n){return n*e/t},a.prototype.attractionFactor=function(e,t,n){return e*t/n},a.prototype.initNodes=function(e,t,i){this.temperature=1;var a=e.length/2;this.nodes.length=0;for(var o="undefined"!=typeof i,r=0;a>r;r++){var s=new n;s.position[0]=e[2*r],s.position[1]=e[2*r+1],s.mass=t[r],o&&(s.size=i[r]),this.nodes.push(s)}this._massArr=t,o&&(this._sizeArr=i)},a.prototype.initEdges=function(e,t){var n=e.length/2;this.edges.length=0;for(var a="undefined"!=typeof t,o=0;n>o;o++){var r=e[2*o],s=e[2*o+1],l=this.nodes[r],h=this.nodes[s];if(l&&h){l.outDegree++,h.inDegree++;var m=new i(l,h);a&&(m.weight=t[o]),this.edges.push(m)}}},a.prototype.update=function(){var e=this.nodes.length;if(this.updateBBox(),this._k=.4*this.scaling*Math.sqrt(this.width*this.height/e),this.barnesHutOptimize){this._rootRegion.setBBox(this.bbox[0],this.bbox[1],this.bbox[2],this.bbox[3]),this._rootRegion.beforeUpdate();for(var t=0;e>t;t++)this._rootRegion.addNode(this.nodes[t]);this._rootRegion.afterUpdate()}else{var n=0,i=this._rootRegion.centerOfMass;r.set(i,0,0);for(var t=0;e>t;t++){var a=this.nodes[t];n+=a.mass,r.scaleAndAdd(i,i,a.position,a.mass)}n>0&&r.scale(i,i,1/n)}this.updateForce(),this.updatePosition()},a.prototype.updateForce=function(){for(var e=this.nodes.length,t=0;e>t;t++){var n=this.nodes[t];r.copy(n.forcePrev,n.force),r.copy(n.speedPrev,n.speed),r.set(n.force,0,0)}this.updateNodeNodeForce(),this.gravity>0&&this.updateGravityForce(),this.updateEdgeForce(),this.preventNodeEdgeOverlap&&this.updateNodeEdgeForce()},a.prototype.updatePosition=function(){for(var e=this.nodes.length,t=r.create(),n=0;e>n;n++){var i=this.nodes[n],a=i.speed;r.scale(i.force,i.force,1/30);var o=r.len(i.force)+.1,s=Math.min(o,500)/o;r.scale(i.force,i.force,s),r.add(a,a,i.force),r.scale(a,a,this.temperature),r.sub(t,a,i.speedPrev);var l=r.len(t);if(l>0){r.scale(t,t,1/l);var h=r.len(i.speedPrev);h>0&&(l=Math.min(l/h,this.maxSpeedIncrease)*h,r.scaleAndAdd(a,i.speedPrev,t,l))}var m=r.len(a),s=Math.min(m,100)/(m+.1);r.scale(a,a,s),r.add(i.position,i.position,a)}},a.prototype.updateNodeNodeForce=function(){for(var e=this.nodes.length,t=0;e>t;t++){var n=this.nodes[t];if(this.barnesHutOptimize)this.applyRegionToNodeRepulsion(this._rootRegion,n);else for(var i=t+1;e>i;i++){var a=this.nodes[i];this.applyNodeToNodeRepulsion(n,a,!1)}}},a.prototype.updateGravityForce=function(){for(var e=0;ethis.barnesHutTheta*t.size*t.size){var a=this._k*this._k*(n.mass+t.mass)/(i+1);r.scaleAndAdd(n.force,n.force,e,2*a)}else for(var o=0;o0?o=this.nodeToNodeRepulsionFactor(s,l,this._k):0>=l&&(o=this._k*this._k*10*s)):o=this.nodeToNodeRepulsionFactor(s,l,this._k),i||r.scaleAndAdd(t.force,t.force,e,2*o),r.scaleAndAdd(n.force,n.force,e,2*-o)}}}}(),a.prototype.applyEdgeAttraction=function(){var e=r.create();return function(t){var n=t.node1,i=t.node2;r.sub(e,n.position,i.position);var a,o=r.len(e);a=0===this.edgeWeightInfluence?1:1==this.edgeWeightInfluence?t.weight:Math.pow(t.weight,this.edgeWeightInfluence);var s;if(!(this.preventOverlap&&(o=o-n.size-i.size,0>=o))){var s=this.attractionFactor(a,o,this._k);r.scaleAndAdd(n.force,n.force,e,-s),r.scaleAndAdd(i.force,i.force,e,s)}}}(),a.prototype.applyNodeGravity=function(){var e=r.create();return function(t){r.sub(e,this.center,t.position),this.width>this.height?e[1]*=this.width/this.height:e[0]*=this.height/this.width;var n=r.len(e)/100;this.strongGravity?r.scaleAndAdd(t.force,t.force,e,n*this.gravity*t.mass):r.scaleAndAdd(t.force,t.force,e,this.gravity*t.mass/(n+1))}}(),a.prototype.applyEdgeToNodeRepulsion=function(){var e=r.create(),t=r.create(),n=r.create();return function(i,a){var o=i.node1,s=i.node2;if(o!==a&&s!==a){r.sub(e,s.position,o.position),r.sub(t,a.position,o.position);var l=r.len(e);r.scale(e,e,1/l);var h=r.dot(e,t);if(!(0>h||h>l)){r.scaleAndAdd(n,o.position,e,h);var m=r.dist(n,a.position)-a.size,V=this.edgeToNodeRepulsionFactor(a.mass,Math.max(m,.1),100);r.sub(e,a.position,n),r.normalize(e,e),r.scaleAndAdd(a.force,a.force,e,V),r.scaleAndAdd(o.force,o.force,e,-V),r.scaleAndAdd(s.force,s.force,e,-V)}}}}(),a.prototype.updateBBox=function(){for(var e=1/0,t=1/0,n=-1/0,i=-1/0,a=0;ai;i++){var o=h.nodes[i];o.position[0]=t[2*i],o.position[1]=t[2*i+1]}}else switch(e.data.cmd){case"init":h||(h=new a),h.initNodes(e.data.nodesPosition,e.data.nodesMass,e.data.nodesSize),h.initEdges(e.data.edges,e.data.edgesWeight);break;case"updateConfig":if(h)for(var r in e.data.config)h[r]=e.data.config[r];break;case"update":var s=e.data.steps;if(h){var n=h.nodes.length,t=new Float32Array(2*n);h.temperature=e.data.temperature;for(var i=0;s>i;i++)h.update(),h.temperature*=e.data.coolDown;for(var i=0;n>i;i++){var o=h.nodes[i];t[2*i]=o.position[0],t[2*i+1]=o.position[1]}self.postMessage(t.buffer,[t.buffer])}else{var l=new Float32Array;self.postMessage(l.buffer,[l.buffer])}}}}return a}),n("echarts/chart/map",["require","./base","zrender/shape/Text","zrender/shape/Path","zrender/shape/Circle","zrender/shape/Rectangle","zrender/shape/Line","zrender/shape/Polygon","zrender/shape/Ellipse","../component/dataRange","../component/roamController","../config","../util/ecData","zrender/tool/util","zrender/config","zrender/tool/event","../util/mapData/params","../util/mapData/textFixed","../util/mapData/geoCoord","../util/projection/svg","../util/projection/normal","../chart"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o);var r=this;r._onmousewheel=function(e){return r.__onmousewheel(e)},r._onmousedown=function(e){return r.__onmousedown(e)},r._onmousemove=function(e){return r.__onmousemove(e)},r._onmouseup=function(e){return r.__onmouseup(e)},r._onroamcontroller=function(e){return r.__onroamcontroller(e)},r._ondrhoverlink=function(e){return r.__ondrhoverlink(e)},this._isAlive=!0,this._selectedMode={},this._activeMapType={},this._clickable={},this._hoverable={},this._showLegendSymbol={},this._selected={},this._mapTypeMap={},this._mapDataMap={},this._nameMap={},this._specialArea={},this._refreshDelayTicket,this._mapDataRequireCounter,this._markAnimation=!1,this._hoverLinkMap={},this._roamMap={},this._scaleLimitMap={},this._mx,this._my,this._mousedown,this._justMove,this._curMapType,this.refresh(a),this.zr.on(d.EVENT.MOUSEWHEEL,this._onmousewheel),this.zr.on(d.EVENT.MOUSEDOWN,this._onmousedown),t.bind(m.EVENT.ROAMCONTROLLER,this._onroamcontroller),t.bind(m.EVENT.DATA_RANGE_HOVERLINK,this._ondrhoverlink)}var n=e("./base"),i=e("zrender/shape/Text"),a=e("zrender/shape/Path"),o=e("zrender/shape/Circle"),r=e("zrender/shape/Rectangle"),s=e("zrender/shape/Line"),l=e("zrender/shape/Polygon"),h=e("zrender/shape/Ellipse");e("../component/dataRange"),e("../component/roamController");var m=e("../config");m.map={zlevel:0,z:2,mapType:"china",mapValuePrecision:0,showLegendSymbol:!0,dataRangeHoverLink:!0,hoverable:!0,clickable:!0,itemStyle:{normal:{borderColor:"rgba(0,0,0,0)",borderWidth:1,areaStyle:{color:"#ccc"},label:{show:!1,textStyle:{color:"rgb(139,69,19)"}}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,areaStyle:{color:"rgba(255,215,0,0.8)"},label:{show:!1,textStyle:{color:"rgb(100,0,0)"}}}}};var V=e("../util/ecData"),U=e("zrender/tool/util"),d=e("zrender/config"),p=e("zrender/tool/event"),c=e("../util/mapData/params").params,u=e("../util/mapData/textFixed"),y=e("../util/mapData/geoCoord");return t.prototype={type:m.CHART_TYPE_MAP,_buildShape:function(){var e=this.series;this.selectedMap={},this._activeMapType={};for(var t,n,i,a,o=this.component.legend,r={},s={},l={},h={},V=0,d=e.length;d>V;V++)if(e[V].type==m.CHART_TYPE_MAP&&(e[V]=this.reformOption(e[V]),n=e[V].mapType,s[n]=s[n]||{},s[n][V]=!0,l[n]=l[n]||e[V].mapValuePrecision,this._scaleLimitMap[n]=this._scaleLimitMap[n]||{},e[V].scaleLimit&&U.merge(this._scaleLimitMap[n],e[V].scaleLimit,!0),this._roamMap[n]=e[V].roam||this._roamMap[n],this._hoverLinkMap[n]=e[V].dataRangeHoverLink||this._hoverLinkMap[n],this._nameMap[n]=this._nameMap[n]||{},e[V].nameMap&&U.merge(this._nameMap[n],e[V].nameMap,!0),this._activeMapType[n]=!0,e[V].textFixed&&U.merge(u,e[V].textFixed,!0),e[V].geoCoord&&U.merge(y,e[V].geoCoord,!0),this._selectedMode[n]=this._selectedMode[n]||e[V].selectedMode,(null==this._hoverable[n]||this._hoverable[n])&&(this._hoverable[n]=e[V].hoverable),(null==this._clickable[n]||this._clickable[n])&&(this._clickable[n]=e[V].clickable),(null==this._showLegendSymbol[n]||this._showLegendSymbol[n])&&(this._showLegendSymbol[n]=e[V].showLegendSymbol),h[n]=h[n]||e[V].mapValueCalculation,t=e[V].name,this.selectedMap[t]=o?o.isSelected(t):!0,this.selectedMap[t])){r[n]=r[n]||{},i=e[V].data;for(var p=0,g=i.length;g>p;p++){a=this._nameChange(n,i[p].name),r[n][a]=r[n][a]||{seriesIndex:[]};for(var b in i[p])"value"!=b?r[n][a][b]=i[p][b]:isNaN(i[p].value)||(null==r[n][a].value&&(r[n][a].value=0),r[n][a].value+=i[p].value);r[n][a].seriesIndex.push(V)}}this._mapDataRequireCounter=0;for(var f in r)this._mapDataRequireCounter++;this._clearSelected(),0===this._mapDataRequireCounter&&(this.clear(),this.zr&&this.zr.delShape(this.lastShapeList),this.lastShapeList=[]);for(var f in r){if(h[f]&&"average"==h[f])for(var g in r[f])r[f][g].value=(r[f][g].value/r[f][g].seriesIndex.length).toFixed(l[f])-0;this._mapDataMap[f]=this._mapDataMap[f]||{},this._mapDataMap[f].mapData?this._mapDataCallback(f,r[f],s[f])(this._mapDataMap[f].mapData):c[f.replace(/\|.*/,"")].getGeoJson&&(this._specialArea[f]=c[f.replace(/\|.*/,"")].specialArea||this._specialArea[f],c[f.replace(/\|.*/,"")].getGeoJson(this._mapDataCallback(f,r[f],s[f])))}},_mapDataCallback:function(t,n,i){var a=this;return function(o){a._isAlive&&null!=a._activeMapType[t]&&(-1!=t.indexOf("|")&&(o=a._getSubMapData(t,o)),a._mapDataMap[t].mapData=o,o.firstChild?(a._mapDataMap[t].rate=1,a._mapDataMap[t].projection=e("../util/projection/svg")):(a._mapDataMap[t].rate=.75,a._mapDataMap[t].projection=e("../util/projection/normal")),a._buildMap(t,a._getProjectionData(t,o,i),n,i),a._buildMark(t,i),--a._mapDataRequireCounter<=0&&(a.addShapeList(),a.zr.refreshNextFrame()))}},_clearSelected:function(){for(var e in this._selected)this._activeMapType[this._mapTypeMap[e]]||(delete this._selected[e],delete this._mapTypeMap[e])},_getSubMapData:function(e,t){for(var n=e.replace(/^.*\|/,""),i=t.features,a=0,o=i.length;o>a;a++)if(i[a].properties&&i[a].properties.name==n){i=i[a],"United States of America"==n&&i.geometry.coordinates.length>1&&(i={geometry:{coordinates:i.geometry.coordinates.slice(5,6),type:i.geometry.type},id:i.id,properties:i.properties,type:i.type});break}return{type:"FeatureCollection",features:[i]}},_getProjectionData:function(e,t,n){var i,a=this._mapDataMap[e].projection,o=[],r=this._mapDataMap[e].bbox||a.getBbox(t,this._specialArea[e]);i=this._mapDataMap[e].hasRoam?this._mapDataMap[e].transform:this._getTransform(r,n,this._mapDataMap[e].rate);var s,l=this._mapDataMap[e].lastTransform||{scale:{}};i.left!=l.left||i.top!=l.top||i.scale.x!=l.scale.x||i.scale.y!=l.scale.y?(s=a.geoJson2Path(t,i,this._specialArea[e]),l=U.clone(i)):(i=this._mapDataMap[e].transform,s=this._mapDataMap[e].pathArray),this._mapDataMap[e].bbox=r,this._mapDataMap[e].transform=i,this._mapDataMap[e].lastTransform=l,this._mapDataMap[e].pathArray=s;for(var h=[i.left,i.top],m=0,V=s.length;V>m;m++)o.push(this._getSingleProvince(e,s[m],h));if(this._specialArea[e])for(var d in this._specialArea[e])o.push(this._getSpecialProjectionData(e,t,d,this._specialArea[e][d],h));if("china"==e){var p=this.geo2pos(e,y["南海诸岛"]||c["南海诸岛"].textCoord),g=i.scale.x/10.5,b=[32*g+p[0],83*g+p[1]];u["南海诸岛"]&&(b[0]+=u["南海诸岛"][0],b[1]+=u["南海诸岛"][1]),o.push({name:this._nameChange(e,"南海诸岛"),path:c["南海诸岛"].getPath(p,g),position:h,textX:b[0],textY:b[1]})}return o},_getSpecialProjectionData:function(t,n,i,a,o){n=this._getSubMapData("x|"+i,n);var r=e("../util/projection/normal"),s=r.getBbox(n),l=this.geo2pos(t,[a.left,a.top]),h=this.geo2pos(t,[a.left+a.width,a.top+a.height]),m=Math.abs(h[0]-l[0]),V=Math.abs(h[1]-l[1]),U=s.width,d=s.height,p=m/.75/U,c=V/d;p>c?(p=.75*c,m=U*p):(c=p,p=.75*c,V=d*c);var u={OffsetLeft:l[0],OffsetTop:l[1],scale:{x:p,y:c}},y=r.geoJson2Path(n,u);return this._getSingleProvince(t,y[0],o)},_getSingleProvince:function(e,t,n){var i,a=t.properties.name,o=u[a]||[0,0];if(y[a])i=this.geo2pos(e,y[a]);else if(t.cp)i=[t.cp[0]+o[0],t.cp[1]+o[1]];else{var r=this._mapDataMap[e].bbox;i=this.geo2pos(e,[r.left+r.width/2,r.top+r.height/2]),i[0]+=o[0],i[1]+=o[1]}return t.name=this._nameChange(e,a),t.position=n,t.textX=i[0],t.textY=i[1],t},_getTransform:function(e,t,n){var i,a,o,r,s,l,h,m=this.series,V=this.zr.getWidth(),U=this.zr.getHeight(),d=Math.round(.02*Math.min(V,U));for(var p in t)i=m[p].mapLocation||{},o=i.x||o,s=i.y||s,l=i.width||l,h=i.height||h;a=this.parsePercent(o,V),a=isNaN(a)?d:a,r=this.parsePercent(s,U),r=isNaN(r)?d:r,l=null==l?V-a-2*d:this.parsePercent(l,V),h=null==h?U-r-2*d:this.parsePercent(h,U);var c=e.width,u=e.height,y=l/n/c,g=h/u;if(y>g?(y=g*n,l=c*y):(g=y,y=g*n,h=u*g),isNaN(o))switch(o=o||"center",o+""){case"center":a=Math.floor((V-l)/2);break;case"right":a=V-l}if(isNaN(s))switch(s=s||"center",s+""){case"center":r=Math.floor((U-h)/2);break;case"bottom":r=U-h}return{left:a,top:r,width:l,height:h,baseScale:1,scale:{x:y,y:g}}},_buildMap:function(e,t,n,d){for(var p,c,u,y,g,b,f,k,x,_,L,W=this.series,X=this.component.legend,K=this.component.dataRange,w=0,I=t.length;I>w;w++){if(k=U.clone(t[w]),x={name:k.name,path:k.path,position:U.clone(k.position)},c=k.name,u=n[c]){g=[u],p="";for(var v=0,J=u.seriesIndex.length;J>v;v++)g.push(W[u.seriesIndex[v]]),p+=W[u.seriesIndex[v]].name+" ",X&&this._showLegendSymbol[e]&&X.hasColor(W[u.seriesIndex[v]].name)&&this.shapeList.push(new o({zlevel:this.getZlevelBase(),z:this.getZBase()+1,position:U.clone(k.position),_mapType:e,style:{x:k.textX+3+7*v,y:k.textY-10,r:3,color:X.getColor(W[u.seriesIndex[v]].name)},hoverable:!1}));y=u.value}else{u="-",p="",g=[];for(var C in d)g.push(W[C]);y="-"}switch(this.ecTheme.map&&g.push(this.ecTheme.map),g.push(m),b=K&&!isNaN(y)?K.getColor(y):null,k.color=k.color||b||this.getItemStyleColor(this.deepQuery(g,"itemStyle.normal.color"),u.seriesIndex,-1,u)||this.deepQuery(g,"itemStyle.normal.areaStyle.color"),k.strokeColor=k.strokeColor||this.deepQuery(g,"itemStyle.normal.borderColor"),k.lineWidth=k.lineWidth||this.deepQuery(g,"itemStyle.normal.borderWidth"),x.color=this.getItemStyleColor(this.deepQuery(g,"itemStyle.emphasis.color"),u.seriesIndex,-1,u)||this.deepQuery(g,"itemStyle.emphasis.areaStyle.color")||k.color,x.strokeColor=this.deepQuery(g,"itemStyle.emphasis.borderColor")||k.strokeColor,x.lineWidth=this.deepQuery(g,"itemStyle.emphasis.borderWidth")||k.lineWidth,k.brushType=x.brushType=k.brushType||"both",k.lineJoin=x.lineJoin="round",k._name=x._name=c,f=this.deepQuery(g,"itemStyle.normal.label.textStyle"),L={zlevel:this.getZlevelBase(),z:this.getZBase()+1,position:U.clone(k.position),_mapType:e,_geo:this.pos2geo(e,[k.textX,k.textY]),style:{brushType:"fill",x:k.textX,y:k.textY,text:this.getLabelText(c,y,g,"normal"),_name:c,textAlign:"center",color:this.deepQuery(g,"itemStyle.normal.label.show")?this.deepQuery(g,"itemStyle.normal.label.textStyle.color"):"rgba(0,0,0,0)",textFont:this.getFont(f)}},L._style=U.clone(L.style),L.highlightStyle=U.clone(L.style),this.deepQuery(g,"itemStyle.emphasis.label.show")?(L.highlightStyle.text=this.getLabelText(c,y,g,"emphasis"),L.highlightStyle.color=this.deepQuery(g,"itemStyle.emphasis.label.textStyle.color")||L.style.color,f=this.deepQuery(g,"itemStyle.emphasis.label.textStyle")||f,L.highlightStyle.textFont=this.getFont(f)):L.highlightStyle.color="rgba(0,0,0,0)",_={zlevel:this.getZlevelBase(),z:this.getZBase(),position:U.clone(k.position),style:k,highlightStyle:x,_style:U.clone(k),_mapType:e},null!=k.scale&&(_.scale=U.clone(k.scale)),L=new i(L),_.style.shapeType){case"rectangle":_=new r(_); +break;case"line":_=new s(_);break;case"circle":_=new o(_);break;case"polygon":_=new l(_);break;case"ellipse":_=new h(_);break;default:_=new a(_),_.buildPathArray&&(_.style.pathArray=_.buildPathArray(_.style.path))}(this._selectedMode[e]&&this._selected[c]||u.selected&&this._selected[c]!==!1)&&(L.style=L.highlightStyle,_.style=_.highlightStyle),L.clickable=_.clickable=this._clickable[e]&&(null==u.clickable||u.clickable),this._selectedMode[e]&&(this._selected[c]=null!=this._selected[c]?this._selected[c]:u.selected,this._mapTypeMap[c]=e,(null==u.selectable||u.selectable)&&(_.clickable=L.clickable=!0,_.onclick=L.onclick=this.shapeHandler.onclick)),this._hoverable[e]&&(null==u.hoverable||u.hoverable)?(L.hoverable=_.hoverable=!0,_.hoverConnect=L.id,L.hoverConnect=_.id):L.hoverable=_.hoverable=!1,V.pack(L,{name:p,tooltip:this.deepQuery(g,"tooltip")},0,u,0,c),this.shapeList.push(L),V.pack(_,{name:p,tooltip:this.deepQuery(g,"tooltip")},0,u,0,c),this.shapeList.push(_)}},_buildMark:function(e,t){this._seriesIndexToMapType=this._seriesIndexToMapType||{},this.markAttachStyle=this.markAttachStyle||{};var n=[this._mapDataMap[e].transform.left,this._mapDataMap[e].transform.top];"none"==e&&(n=[0,0]);for(var i in t)this._seriesIndexToMapType[i]=e,this.markAttachStyle[i]={position:n,_mapType:e},this.buildMark(i)},getMarkCoord:function(e,t){return t.geoCoord||y[t.name]?this.geo2pos(this._seriesIndexToMapType[e],t.geoCoord||y[t.name]):[0,0]},getMarkGeo:function(e){return e.geoCoord||y[e.name]},_nameChange:function(e,t){return this._nameMap[e][t]||t},getLabelText:function(e,t,n,i){var a=this.deepQuery(n,"itemStyle."+i+".label.formatter");return a?"function"==typeof a?a.call(this.myChart,e,t):"string"==typeof a?(a=a.replace("{a}","{a0}").replace("{b}","{b0}"),a=a.replace("{a0}",e).replace("{b0}",t)):void 0:e},_findMapTypeByPos:function(e,t){var n,i,a,o,r;for(var s in this._mapDataMap)if(n=this._mapDataMap[s].transform,n&&this._roamMap[s]&&this._activeMapType[s]&&(i=n.left,a=n.top,o=n.width,r=n.height,e>=i&&i+o>=e&&t>=a&&a+r>=t))return s},__onmousewheel:function(e){if(!(this.shapeList.length<=0)){var t,n,i=e.event,a=p.getX(i),o=p.getY(i),r=p.getDelta(i),s=e.mapTypeControl;s||(s={},n=this._findMapTypeByPos(a,o),n&&this._roamMap[n]&&"move"!=this._roamMap[n]&&(s[n]=!0));var l=!1;for(n in s)if(s[n]){l=!0;var h=this._mapDataMap[n].transform,V=h.left,U=h.top,d=h.width,c=h.height,u=this.pos2geo(n,[a-V,o-U]);if(r>0){if(t=1.2,null!=this._scaleLimitMap[n].max&&h.baseScale>=this._scaleLimitMap[n].max)continue}else if(t=1/1.2,null!=this._scaleLimitMap[n].min&&h.baseScale<=this._scaleLimitMap[n].min)continue;h.baseScale*=t,h.scale.x*=t,h.scale.y*=t,h.width=d*t,h.height=c*t,this._mapDataMap[n].hasRoam=!0,this._mapDataMap[n].transform=h,u=this.geo2pos(n,u),h.left-=u[0]-(a-V),h.top-=u[1]-(o-U),this._mapDataMap[n].transform=h,this.clearEffectShape(!0);for(var y=0,g=this.shapeList.length;g>y;y++)this.shapeList[y]._mapType==n&&(this.shapeList[y].position[0]=h.left,this.shapeList[y].position[1]=h.top,"path"==this.shapeList[y].type||"symbol"==this.shapeList[y].type||"circle"==this.shapeList[y].type||"rectangle"==this.shapeList[y].type||"polygon"==this.shapeList[y].type||"line"==this.shapeList[y].type||"ellipse"==this.shapeList[y].type?(this.shapeList[y].scale[0]*=t,this.shapeList[y].scale[1]*=t):"mark-line"==this.shapeList[y].type?(this.shapeList[y].style.pointListLength=void 0,this.shapeList[y].style.pointList=!1,u=this.geo2pos(n,this.shapeList[y]._geo[0]),this.shapeList[y].style.xStart=u[0],this.shapeList[y].style.yStart=u[1],u=this.geo2pos(n,this.shapeList[y]._geo[1]),this.shapeList[y]._x=this.shapeList[y].style.xEnd=u[0],this.shapeList[y]._y=this.shapeList[y].style.yEnd=u[1]):"icon"==this.shapeList[y].type||"image"==this.shapeList[y].type?(u=this.geo2pos(n,this.shapeList[y]._geo),this.shapeList[y].style.x=this.shapeList[y].style._x=u[0]-this.shapeList[y].style.width/2,this.shapeList[y].style.y=this.shapeList[y].style._y=u[1]-this.shapeList[y].style.height/2):(u=this.geo2pos(n,this.shapeList[y]._geo),this.shapeList[y].style.x=u[0],this.shapeList[y].style.y=u[1],"text"==this.shapeList[y].type&&(this.shapeList[y]._style.x=this.shapeList[y].highlightStyle.x=u[0],this.shapeList[y]._style.y=this.shapeList[y].highlightStyle.y=u[1])),this.zr.modShape(this.shapeList[y].id))}if(l){p.stop(i),this.zr.refreshNextFrame();var b=this;clearTimeout(this._refreshDelayTicket),this._refreshDelayTicket=setTimeout(function(){b&&b.shapeList&&b.animationEffect()},100),this.messageCenter.dispatch(m.EVENT.MAP_ROAM,e.event,{type:"scale"},this.myChart)}}},__onmousedown:function(e){if(!(this.shapeList.length<=0)){var t=e.target;if(!t||!t.draggable){var n=e.event,i=p.getX(n),a=p.getY(n),o=this._findMapTypeByPos(i,a);if(o&&this._roamMap[o]&&"scale"!=this._roamMap[o]){this._mousedown=!0,this._mx=i,this._my=a,this._curMapType=o,this.zr.on(d.EVENT.MOUSEUP,this._onmouseup);var r=this;setTimeout(function(){r.zr.on(d.EVENT.MOUSEMOVE,r._onmousemove)},100)}}}},__onmousemove:function(e){if(this._mousedown&&this._isAlive){var t=e.event,n=p.getX(t),i=p.getY(t),a=this._mapDataMap[this._curMapType].transform;a.hasRoam=!0,a.left-=this._mx-n,a.top-=this._my-i,this._mx=n,this._my=i,this._mapDataMap[this._curMapType].transform=a;for(var o=0,r=this.shapeList.length;r>o;o++)this.shapeList[o]._mapType==this._curMapType&&(this.shapeList[o].position[0]=a.left,this.shapeList[o].position[1]=a.top,this.zr.modShape(this.shapeList[o].id));this.messageCenter.dispatch(m.EVENT.MAP_ROAM,e.event,{type:"move"},this.myChart),this.clearEffectShape(!0),this.zr.refreshNextFrame(),this._justMove=!0,p.stop(t)}},__onmouseup:function(e){var t=e.event;this._mx=p.getX(t),this._my=p.getY(t),this._mousedown=!1;var n=this;setTimeout(function(){n._justMove&&n.animationEffect(),n._justMove=!1,n.zr.un(d.EVENT.MOUSEMOVE,n._onmousemove),n.zr.un(d.EVENT.MOUSEUP,n._onmouseup)},120)},__onroamcontroller:function(e){var t=e.event;t.zrenderX=this.zr.getWidth()/2,t.zrenderY=this.zr.getHeight()/2;var n=e.mapTypeControl,i=0,a=0,o=e.step;switch(e.roamType){case"scaleUp":return t.zrenderDelta=1,void this.__onmousewheel({event:t,mapTypeControl:n});case"scaleDown":return t.zrenderDelta=-1,void this.__onmousewheel({event:t,mapTypeControl:n});case"up":i=-o;break;case"down":i=o;break;case"left":a=-o;break;case"right":a=o}var r,s;for(s in n)this._mapDataMap[s]&&this._activeMapType[s]&&(r=this._mapDataMap[s].transform,r.hasRoam=!0,r.left-=a,r.top-=i,this._mapDataMap[s].transform=r);for(var l=0,h=this.shapeList.length;h>l;l++)s=this.shapeList[l]._mapType,n[s]&&this._activeMapType[s]&&(r=this._mapDataMap[s].transform,this.shapeList[l].position[0]=r.left,this.shapeList[l].position[1]=r.top,this.zr.modShape(this.shapeList[l].id));this.messageCenter.dispatch(m.EVENT.MAP_ROAM,e.event,{type:"move"},this.myChart),this.clearEffectShape(!0),this.zr.refreshNextFrame(),clearTimeout(this.dircetionTimer);var V=this;this.dircetionTimer=setTimeout(function(){V.animationEffect()},150)},__ondrhoverlink:function(e){for(var t,n,i=0,a=this.shapeList.length;a>i;i++)t=this.shapeList[i]._mapType,this._hoverLinkMap[t]&&this._activeMapType[t]&&(n=V.get(this.shapeList[i],"value"),null!=n&&n>=e.valueMin&&n<=e.valueMax&&this.zr.addHoverShape(this.shapeList[i]))},onclick:function(e){if(this.isClick&&e.target&&!this._justMove&&"icon"!=e.target.type){this.isClick=!1;var t=e.target,n=t.style._name,i=this.shapeList.length,a=t._mapType||"";if("single"==this._selectedMode[a])for(var o in this._selected)if(this._selected[o]&&this._mapTypeMap[o]==a){for(var r=0;i>r;r++)this.shapeList[r].style._name==o&&this.shapeList[r]._mapType==a&&(this.shapeList[r].style=this.shapeList[r]._style,this.zr.modShape(this.shapeList[r].id));o!=n&&(this._selected[o]=!1)}this._selected[n]=!this._selected[n];for(var r=0;i>r;r++)this.shapeList[r].style._name==n&&this.shapeList[r]._mapType==a&&(this.shapeList[r].style=this._selected[n]?this.shapeList[r].highlightStyle:this.shapeList[r]._style,this.zr.modShape(this.shapeList[r].id));this.messageCenter.dispatch(m.EVENT.MAP_SELECTED,e.event,{selected:this._selected,target:n},this.myChart),this.zr.refreshNextFrame();var s=this;setTimeout(function(){s.zr.trigger(d.EVENT.MOUSEMOVE,e.event)},100)}},refresh:function(e){e&&(this.option=e,this.series=e.series),this._mapDataRequireCounter>0?this.clear():this.backupShapeList(),this._buildShape(),this.zr.refreshHover()},ondataRange:function(e,t){this.component.dataRange&&(this.refresh(),t.needRefresh=!0)},pos2geo:function(e,t){return this._mapDataMap[e].transform?this._mapDataMap[e].projection.pos2geo(this._mapDataMap[e].transform,t):null},getGeoByPos:function(e,t){if(!this._mapDataMap[e].transform)return null;var n=[this._mapDataMap[e].transform.left,this._mapDataMap[e].transform.top];return t instanceof Array?(t[0]-=n[0],t[1]-=n[1]):(t.x-=n[0],t.y-=n[1]),this.pos2geo(e,t)},geo2pos:function(e,t){return this._mapDataMap[e].transform?this._mapDataMap[e].projection.geo2pos(this._mapDataMap[e].transform,t):null},getPosByGeo:function(e,t){if(!this._mapDataMap[e].transform)return null;var n=this.geo2pos(e,t);return n[0]+=this._mapDataMap[e].transform.left,n[1]+=this._mapDataMap[e].transform.top,n},getMapPosition:function(e){return this._mapDataMap[e].transform?[this._mapDataMap[e].transform.left,this._mapDataMap[e].transform.top]:null},onbeforDispose:function(){this._isAlive=!1,this.zr.un(d.EVENT.MOUSEWHEEL,this._onmousewheel),this.zr.un(d.EVENT.MOUSEDOWN,this._onmousedown),this.messageCenter.unbind(m.EVENT.ROAMCONTROLLER,this._onroamcontroller),this.messageCenter.unbind(m.EVENT.DATA_RANGE_HOVERLINK,this._ondrhoverlink)}},U.inherits(t,n),e("../chart").define("map",t),t}),n("zrender/shape/Path",["require","./Base","./util/PathProxy","../tool/util"],function(e){var t=e("./Base"),n=e("./util/PathProxy"),i=n.PathSegment,a=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},o=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(a(e)*a(t))},r=function(e,t){return(e[0]*t[1]0&&""===d[0]&&d.shift();for(var p=0;p0&&!isNaN(d[0]);){var c,u,y,g,b,f,k,x,_=null,L=[],W=h,X=m;switch(U){case"l":h+=d.shift(),m+=d.shift(),_="L",L.push(h,m);break;case"L":h=d.shift(),m=d.shift(),L.push(h,m);break;case"m":h+=d.shift(),m+=d.shift(),_="M",L.push(h,m),U="l";break;case"M":h=d.shift(),m=d.shift(),_="M",L.push(h,m),U="L";break;case"h":h+=d.shift(),_="L",L.push(h,m);break;case"H":h=d.shift(),_="L",L.push(h,m);break;case"v":m+=d.shift(),_="L",L.push(h,m);break;case"V":m=d.shift(),_="L",L.push(h,m);break;case"C":L.push(d.shift(),d.shift(),d.shift(),d.shift()),h=d.shift(),m=d.shift(),L.push(h,m);break;case"c":L.push(h+d.shift(),m+d.shift(),h+d.shift(),m+d.shift()),h+=d.shift(),m+=d.shift(),_="C",L.push(h,m);break;case"S":c=h,u=m,y=l[l.length-1],"C"===y.command&&(c=h+(h-y.points[2]),u=m+(m-y.points[3])),L.push(c,u,d.shift(),d.shift()),h=d.shift(),m=d.shift(),_="C",L.push(h,m);break;case"s":c=h,u=m,y=l[l.length-1],"C"===y.command&&(c=h+(h-y.points[2]),u=m+(m-y.points[3])),L.push(c,u,h+d.shift(),m+d.shift()),h+=d.shift(),m+=d.shift(),_="C",L.push(h,m);break;case"Q":L.push(d.shift(),d.shift()),h=d.shift(),m=d.shift(),L.push(h,m);break;case"q":L.push(h+d.shift(),m+d.shift()),h+=d.shift(),m+=d.shift(),_="Q",L.push(h,m);break;case"T":c=h,u=m,y=l[l.length-1],"Q"===y.command&&(c=h+(h-y.points[0]),u=m+(m-y.points[1])),h=d.shift(),m=d.shift(),_="Q",L.push(c,u,h,m);break;case"t":c=h,u=m,y=l[l.length-1],"Q"===y.command&&(c=h+(h-y.points[0]),u=m+(m-y.points[1])),h+=d.shift(),m+=d.shift(),_="Q",L.push(c,u,h,m);break;case"A":g=d.shift(),b=d.shift(),f=d.shift(),k=d.shift(),x=d.shift(),W=h,X=m,h=d.shift(),m=d.shift(),_="A",L=this._convertPoint(W,X,h,m,k,x,g,b,f);break;case"a":g=d.shift(),b=d.shift(),f=d.shift(),k=d.shift(),x=d.shift(),W=h,X=m,h+=d.shift(),m+=d.shift(),_="A",L=this._convertPoint(W,X,h,m,k,x,g,b,f)}for(var K=0,w=L.length;w>K;K+=2)L[K]+=t,L[K+1]+=n;l.push(new i(_||U,L))}("z"===U||"Z"===U)&&l.push(new i("z",[]))}return l},_convertPoint:function(e,t,n,i,a,s,l,h,m){var V=m*(Math.PI/180),U=Math.cos(V)*(e-n)/2+Math.sin(V)*(t-i)/2,d=-1*Math.sin(V)*(e-n)/2+Math.cos(V)*(t-i)/2,p=U*U/(l*l)+d*d/(h*h);p>1&&(l*=Math.sqrt(p),h*=Math.sqrt(p));var c=Math.sqrt((l*l*h*h-l*l*d*d-h*h*U*U)/(l*l*d*d+h*h*U*U));a===s&&(c*=-1),isNaN(c)&&(c=0);var u=c*l*d/h,y=c*-h*U/l,g=(e+n)/2+Math.cos(V)*u-Math.sin(V)*y,b=(t+i)/2+Math.sin(V)*u+Math.cos(V)*y,f=r([1,0],[(U-u)/l,(d-y)/h]),k=[(U-u)/l,(d-y)/h],x=[(-1*U-u)/l,(-1*d-y)/h],_=r(k,x);return o(k,x)<=-1&&(_=Math.PI),o(k,x)>=1&&(_=0),0===s&&_>0&&(_-=2*Math.PI),1===s&&0>_&&(_+=2*Math.PI),[g,b,l,h,f,_,V,s]},buildPath:function(e,t){var n=t.path,i=t.x||0,a=t.y||0;t.pathArray=t.pathArray||this.buildPathArray(n,i,a);for(var o=t.pathArray,r=t.pointList=[],s=[],l=0,h=o.length;h>l;l++){"M"==o[l].command.toUpperCase()&&(s.length>0&&r.push(s),s=[]);for(var m=o[l].points,V=0,U=m.length;U>V;V+=2)s.push([m[V],m[V+1]])}s.length>0&&r.push(s);for(var l=0,h=o.length;h>l;l++){var d=o[l].command,m=o[l].points;switch(d){case"L":e.lineTo(m[0],m[1]);break;case"M":e.moveTo(m[0],m[1]);break;case"C":e.bezierCurveTo(m[0],m[1],m[2],m[3],m[4],m[5]);break;case"Q":e.quadraticCurveTo(m[0],m[1],m[2],m[3]);break;case"A":var p=m[0],c=m[1],u=m[2],y=m[3],g=m[4],b=m[5],f=m[6],k=m[7],x=u>y?u:y,_=u>y?1:u/y,L=u>y?y/u:1;e.translate(p,c),e.rotate(f),e.scale(_,L),e.arc(0,0,x,g,g+b,1-k),e.scale(1/_,1/L),e.rotate(-f),e.translate(-p,-c);break;case"z":e.closePath()}}},getRect:function(e){if(e.__rect)return e.__rect;var t;t="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0;for(var n=Number.MAX_VALUE,i=Number.MIN_VALUE,a=Number.MAX_VALUE,o=Number.MIN_VALUE,r=e.x||0,s=e.y||0,l=e.pathArray||this.buildPathArray(e.path),h=0;hi&&(i=m[V])):(m[V]+so&&(o=m[V]));var U;return U=n===Number.MAX_VALUE||i===Number.MIN_VALUE||a===Number.MAX_VALUE||o===Number.MIN_VALUE?{x:0,y:0,width:0,height:0}:{x:Math.round(n-t/2),y:Math.round(a-t/2),width:i-n+t,height:o-a+t},e.__rect=U,U}},e("../tool/util").inherits(s,t),s}),n("zrender/shape/Ellipse",["require","./Base","../tool/util"],function(e){var t=e("./Base"),n=function(e){t.call(this,e)};return n.prototype={type:"ellipse",buildPath:function(e,t){var n=.5522848,i=t.x,a=t.y,o=t.a,r=t.b,s=o*n,l=r*n;e.moveTo(i-o,a),e.bezierCurveTo(i-o,a-l,i-s,a-r,i,a-r),e.bezierCurveTo(i+s,a-r,i+o,a-l,i+o,a),e.bezierCurveTo(i+o,a+l,i+s,a+r,i,a+r),e.bezierCurveTo(i-s,a+r,i-o,a+l,i-o,a),e.closePath()},getRect:function(e){if(e.__rect)return e.__rect;var t;return t="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0,e.__rect={x:Math.round(e.x-e.a-t/2),y:Math.round(e.y-e.b-t/2),width:2*e.a+t,height:2*e.b+t},e.__rect}},e("../tool/util").inherits(n,t),n}),n("echarts/component/roamController",["require","./base","zrender/shape/Rectangle","zrender/shape/Sector","zrender/shape/Circle","../config","zrender/tool/util","zrender/tool/color","zrender/tool/event","../component"],function(e){function t(e,t,i,a,o){if(a.roamController&&a.roamController.show){if(!a.roamController.mapTypeControl)return void console.error("option.roamController.mapTypeControl has not been defined.");n.call(this,e,t,i,a,o),this.rcOption=a.roamController;var r=this;this._drictionMouseDown=function(e){return r.__drictionMouseDown(e)},this._drictionMouseUp=function(e){return r.__drictionMouseUp(e)},this._drictionMouseMove=function(e){return r.__drictionMouseMove(e)},this._drictionMouseOut=function(e){return r.__drictionMouseOut(e)},this._scaleHandler=function(e){return r.__scaleHandler(e)},this.refresh(a)}}var n=e("./base"),i=e("zrender/shape/Rectangle"),a=e("zrender/shape/Sector"),o=e("zrender/shape/Circle"),r=e("../config");r.roamController={zlevel:0,z:4,show:!0,x:"left",y:"top",width:80,height:120,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,handleColor:"#6495ed",fillerColor:"#fff",step:15,mapTypeControl:null};var s=e("zrender/tool/util"),l=e("zrender/tool/color"),h=e("zrender/tool/event");return t.prototype={type:r.COMPONENT_TYPE_ROAMCONTROLLER,_buildShape:function(){if(this.rcOption.show){this._itemGroupLocation=this._getItemGroupLocation(),this._buildBackground(),this._buildItem();for(var e=0,t=this.shapeList.length;t>e;e++)this.zr.addShape(this.shapeList[e])}},_buildItem:function(){this.shapeList.push(this._getDirectionShape("up")),this.shapeList.push(this._getDirectionShape("down")),this.shapeList.push(this._getDirectionShape("left")),this.shapeList.push(this._getDirectionShape("right")),this.shapeList.push(this._getScaleShape("scaleUp")),this.shapeList.push(this._getScaleShape("scaleDown"))},_getDirectionShape:function(e){var t=this._itemGroupLocation.r,n=this._itemGroupLocation.x+t,i=this._itemGroupLocation.y+t,o={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:n,y:i,r:t,startAngle:-45,endAngle:45,color:this.rcOption.handleColor,text:">",textX:n+t/2+4,textY:i-.5,textAlign:"center",textBaseline:"middle",textPosition:"specific",textColor:this.rcOption.fillerColor,textFont:Math.floor(t/2)+"px arial"},highlightStyle:{color:l.lift(this.rcOption.handleColor,-.2),brushType:"fill"},clickable:!0};switch(e){case"up":o.rotation=[Math.PI/2,n,i];break;case"left":o.rotation=[Math.PI,n,i];break;case"down":o.rotation=[-Math.PI/2,n,i]}return o=new a(o),o._roamType=e,o.onmousedown=this._drictionMouseDown,o.onmouseup=this._drictionMouseUp,o.onmousemove=this._drictionMouseMove,o.onmouseout=this._drictionMouseOut,o},_getScaleShape:function(e){var t=this._itemGroupLocation.width,n=this._itemGroupLocation.height-t;n=0>n?20:n;var i=Math.min(t/2-5,n)/2,a=this._itemGroupLocation.x+("scaleDown"===e?t-i:i),r=this._itemGroupLocation.y+this._itemGroupLocation.height-i,s={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:a,y:r,r:i,color:this.rcOption.handleColor,text:"scaleDown"===e?"-":"+",textX:a,textY:r-2,textAlign:"center",textBaseline:"middle",textPosition:"specific",textColor:this.rcOption.fillerColor,textFont:Math.floor(i)+"px verdana"},highlightStyle:{color:l.lift(this.rcOption.handleColor,-.2),brushType:"fill"},clickable:!0};return s=new o(s),s._roamType=e,s.onmousedown=this._scaleHandler,s},_buildBackground:function(){var e=this.reformCssArray(this.rcOption.padding);this.shapeList.push(new i({zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this._itemGroupLocation.x-e[3],y:this._itemGroupLocation.y-e[0],width:this._itemGroupLocation.width+e[3]+e[1],height:this._itemGroupLocation.height+e[0]+e[2],brushType:0===this.rcOption.borderWidth?"fill":"both",color:this.rcOption.backgroundColor,strokeColor:this.rcOption.borderColor,lineWidth:this.rcOption.borderWidth}}))},_getItemGroupLocation:function(){var e,t=this.reformCssArray(this.rcOption.padding),n=this.rcOption.width,i=this.rcOption.height,a=this.zr.getWidth(),o=this.zr.getHeight();switch(this.rcOption.x){case"center":e=Math.floor((a-n)/2);break;case"left":e=t[3]+this.rcOption.borderWidth;break;case"right":e=a-n-t[1]-t[3]-2*this.rcOption.borderWidth;break;default:e=this.parsePercent(this.rcOption.x,a)}var r;switch(this.rcOption.y){case"top":r=t[0]+this.rcOption.borderWidth;break;case"bottom":r=o-i-t[0]-t[2]-2*this.rcOption.borderWidth;break;case"center":r=Math.floor((o-i)/2);break;default:r=this.parsePercent(this.rcOption.y,o)}return{x:e,y:r,r:n/2,width:n,height:i}},__drictionMouseDown:function(e){this.mousedown=!0,this._drictionHandlerOn(e)},__drictionMouseUp:function(e){this.mousedown=!1,this._drictionHandlerOff(e)},__drictionMouseMove:function(e){this.mousedown&&this._drictionHandlerOn(e)},__drictionMouseOut:function(e){this._drictionHandlerOff(e)},_drictionHandlerOn:function(e){this._dispatchEvent(e.event,e.target._roamType),clearInterval(this.dircetionTimer);var t=this;this.dircetionTimer=setInterval(function(){t._dispatchEvent(e.event,e.target._roamType)},100),h.stop(e.event)},_drictionHandlerOff:function(){clearInterval(this.dircetionTimer)},__scaleHandler:function(e){this._dispatchEvent(e.event,e.target._roamType),h.stop(e.event)},_dispatchEvent:function(e,t){this.messageCenter.dispatch(r.EVENT.ROAMCONTROLLER,e,{roamType:t,mapTypeControl:this.rcOption.mapTypeControl,step:this.rcOption.step},this.myChart)},refresh:function(e){e&&(this.option=e||this.option,this.option.roamController=this.reformOption(this.option.roamController),this.rcOption=this.option.roamController),this.clear(),this._buildShape()}},s.inherits(t,n),e("../component").define("roamController",t),t}),n("echarts/util/mapData/params",["require"],function(e){function t(e){if(!e.UTF8Encoding)return e;for(var t=e.features,i=0;i>1^-(1&r),s=s>>1^-(1&s),r+=i,s+=a,i=r,a=s,n.push([r/1024,s/1024])}return n}var i={none:{getGeoJson:function(e){e({type:"FeatureCollection",features:[{type:"Feature",geometry:{coordinates:[],encodeOffsets:[],type:"Polygon"},properties:{}}]})}},world:{getGeoJson:function(n){e(["./geoJson/world_geo"],function(e){n(t(e))})}},china:{getGeoJson:function(n){e(["./geoJson/china_geo"],function(e){n(t(e))})}},"南海诸岛":{textCoord:[126,25],getPath:function(e,t){for(var n=[[[0,3.5],[7,11.2],[15,11.9],[30,7],[42,.7],[52,.7],[56,7.7],[59,.7],[64,.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]]],i="",a=e[0],o=e[1],r=0,s=n.length;s>r;r++){i+="M "+((n[r][0][0]*t+a).toFixed(2)-0)+" "+((n[r][0][1]*t+o).toFixed(2)-0)+" ";for(var l=1,h=n[r].length;h>l;l++)i+="L "+((n[r][l][0]*t+a).toFixed(2)-0)+" "+((n[r][l][1]*t+o).toFixed(2)-0)+" "}return i+" Z"}},"新疆":{getGeoJson:function(n){e(["./geoJson/xin_jiang_geo"],function(e){n(t(e))})}},"西藏":{getGeoJson:function(n){e(["./geoJson/xi_zang_geo"],function(e){n(t(e))})}},"内蒙古":{getGeoJson:function(n){e(["./geoJson/nei_meng_gu_geo"],function(e){n(t(e))})}},"青海":{getGeoJson:function(n){e(["./geoJson/qing_hai_geo"],function(e){n(t(e))})}},"四川":{getGeoJson:function(n){e(["./geoJson/si_chuan_geo"],function(e){n(t(e))})}},"黑龙江":{getGeoJson:function(n){e(["./geoJson/hei_long_jiang_geo"],function(e){n(t(e))})}},"甘肃":{getGeoJson:function(n){e(["./geoJson/gan_su_geo"],function(e){n(t(e))})}},"云南":{getGeoJson:function(n){e(["./geoJson/yun_nan_geo"],function(e){n(t(e))})}},"广西":{getGeoJson:function(n){e(["./geoJson/guang_xi_geo"],function(e){n(t(e))})}},"湖南":{getGeoJson:function(n){e(["./geoJson/hu_nan_geo"],function(e){n(t(e))})}},"陕西":{getGeoJson:function(n){e(["./geoJson/shan_xi_1_geo"],function(e){n(t(e))})}},"广东":{getGeoJson:function(n){e(["./geoJson/guang_dong_geo"],function(e){n(t(e))})}},"吉林":{getGeoJson:function(n){e(["./geoJson/ji_lin_geo"],function(e){n(t(e))})}},"河北":{getGeoJson:function(n){e(["./geoJson/he_bei_geo"],function(e){n(t(e))})}},"湖北":{getGeoJson:function(n){e(["./geoJson/hu_bei_geo"],function(e){n(t(e))})}},"贵州":{getGeoJson:function(n){e(["./geoJson/gui_zhou_geo"],function(e){n(t(e))})}},"山东":{getGeoJson:function(n){e(["./geoJson/shan_dong_geo"],function(e){n(t(e))})}},"江西":{getGeoJson:function(n){e(["./geoJson/jiang_xi_geo"],function(e){n(t(e))})}},"河南":{getGeoJson:function(n){e(["./geoJson/he_nan_geo"],function(e){n(t(e))})}},"辽宁":{getGeoJson:function(n){e(["./geoJson/liao_ning_geo"],function(e){n(t(e))})}},"山西":{getGeoJson:function(n){e(["./geoJson/shan_xi_2_geo"],function(e){n(t(e))})}},"安徽":{getGeoJson:function(n){e(["./geoJson/an_hui_geo"],function(e){n(t(e))})}},"福建":{getGeoJson:function(n){e(["./geoJson/fu_jian_geo"],function(e){n(t(e))})}},"浙江":{getGeoJson:function(n){e(["./geoJson/zhe_jiang_geo"],function(e){n(t(e))})}},"江苏":{getGeoJson:function(n){e(["./geoJson/jiang_su_geo"],function(e){n(t(e))})}},"重庆":{getGeoJson:function(n){e(["./geoJson/chong_qing_geo"],function(e){n(t(e))})}},"宁夏":{getGeoJson:function(n){e(["./geoJson/ning_xia_geo"],function(e){n(t(e))})}},"海南":{getGeoJson:function(n){e(["./geoJson/hai_nan_geo"],function(e){n(t(e))})}},"台湾":{getGeoJson:function(n){e(["./geoJson/tai_wan_geo"],function(e){n(t(e))})}},"北京":{getGeoJson:function(n){e(["./geoJson/bei_jing_geo"],function(e){n(t(e))})}},"天津":{getGeoJson:function(n){e(["./geoJson/tian_jin_geo"],function(e){n(t(e))})}},"上海":{getGeoJson:function(n){e(["./geoJson/shang_hai_geo"],function(e){n(t(e))})}},"香港":{getGeoJson:function(n){e(["./geoJson/xiang_gang_geo"],function(e){n(t(e))})}},"澳门":{getGeoJson:function(n){e(["./geoJson/ao_men_geo"],function(e){n(t(e))})}}};return{decode:t,params:i}}),n("echarts/util/mapData/textFixed",[],function(){return{"广东":[0,-10],"香港":[10,10],"澳门":[-10,18],"黑龙江":[0,20],"天津":[5,5],"深圳市":[-35,0],"红河哈尼族彝族自治州":[0,20],"楚雄彝族自治州":[-5,15],"石河子市":[-5,5],"五家渠市":[0,-10],"昌吉回族自治州":[10,10],"昌江黎族自治县":[0,20],"陵水黎族自治县":[0,20],"东方市":[0,20],"渭南市":[0,20]}}),n("echarts/util/mapData/geoCoord",[],function(){return{Russia:[100,60],"United States of America":[-99,38]}}),n("echarts/util/projection/svg",["require","zrender/shape/Path"],function(e){function t(e){return parseFloat(e||0)}function n(e){for(var n=e.firstChild;"svg"!=n.nodeName.toLowerCase()||1!=n.nodeType;)n=n.nextSibling;var i=t(n.getAttribute("x")),a=t(n.getAttribute("y")),o=t(n.getAttribute("width")),r=t(n.getAttribute("height"));return{left:i,top:a,width:o,height:r}}function i(e,t){function n(e){var t=e.tagName;if(m[t]){var o=m[t](e,i);o&&(o.scale=i,o.properties={name:e.getAttribute("name")||""},o.id=e.id,s(o,e),a.push(o))}for(var r=e.childNodes,l=0,h=r.length;h>l;l++)n(r[l])}var i=[t.scale.x,t.scale.y],a=[];return n(e),a}function a(e,t){var n=t instanceof Array?[1*t[0],1*t[1]]:[1*t.x,1*t.y];return[n[0]/e.scale.x,n[1]/e.scale.y]}function o(e,t){var n=t instanceof Array?[1*t[0],1*t[1]]:[1*t.x,1*t.y];return[n[0]*e.scale.x,n[1]*e.scale.y]}function r(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function s(e,t){var n=t.getAttribute("fill"),i=t.getAttribute("stroke"),a=t.getAttribute("stroke-width"),o=t.getAttribute("opacity");n&&"none"!=n?(e.color=n,i?(e.brushType="both",e.strokeColor=i):e.brushType="fill"):i&&"none"!=i&&(e.strokeColor=i,e.brushType="stroke"),a&&"none"!=a&&(e.lineWidth=parseFloat(a)),o&&"none"!=o&&(e.opacity=parseFloat(o))}function l(e){for(var t=r(e).replace(/,/g," ").split(/\s+/),n=[],i=0;io;o++)if(i=a[o],!i.properties.name||!t[i.properties.name])switch(i.type){case"Feature":r[i.geometry.type](i.geometry.coordinates);break;case"GeometryCollection":n=i.geometries;for(var l=0,h=n.length;h>l;l++)r[n[l].type](n[l].coordinates)}return e.srcSize={left:1*r.xmin.toFixed(4),top:1*r.ymin.toFixed(4),width:1*(r.xmax-r.xmin).toFixed(4),height:1*(r.ymax-r.ymin).toFixed(4)},e}function n(e,n,i){function a(e,t){c=e.type,u=e.coordinates,o._bbox={xmin:360,xmax:-360,ymin:180,ymax:-180},y=o[c](u),m.push({path:y,cp:o.makePoint(t.properties.cp?t.properties.cp:[(o._bbox.xmin+o._bbox.xmax)/2,(o._bbox.ymin+o._bbox.ymax)/2]),properties:t.properties,id:t.id})}i=i||{},o.scale=null,o.offset=null,e.srcSize||t(e,i),n.offset={x:e.srcSize.left,y:e.srcSize.top,left:n.OffsetLeft||0,top:n.OffsetTop||0},o.scale=n.scale,o.offset=n.offset;for(var r,s,l,h=e.features,m=[],V=0,U=h.length;U>V;V++)if(l=h[V],!l.properties.name||!i[l.properties.name])if("Feature"==l.type)a(l.geometry,l);else if("GeometryCollection"==l.type){r=l.geometries;for(var d=0,p=r.length;p>d;d++)s=r[d],a(s,s)}var c,u,y;return m}function i(e,t){var n,i;return t instanceof Array?(n=1*t[0],i=1*t[1]):(n=1*t.x,i=1*t.y),n=n/e.scale.x+e.offset.x-168.5,n=n>180?n-360:n,i=90-(i/e.scale.y+e.offset.y),[n,i]}function a(e,t){return o.offset=e.offset,o.scale=e.scale,o.makePoint(t instanceof Array?[1*t[0],1*t[1]]:[1*t.x,1*t.y])}var o={formatPoint:function(e){return[(e[0]<-168.5&&e[1]>63.8?e[0]+360:e[0])+168.5,90-e[1]]},makePoint:function(e){var t=this,n=t.formatPoint(e);t._bbox.xmin>e[0]&&(t._bbox.xmin=e[0]),t._bbox.xmaxe[1]&&(t._bbox.ymin=e[1]),t._bbox.ymaxi;i++)t=o.makePoint(e[i]),n=0===i?"M"+t.join(","):n+"L"+t.join(",");return n},Polygon:function(e){for(var t="",n=0,i=e.length;i>n;n++)t=t+o.LineString(e[n])+"z";return t},MultiPoint:function(e){for(var t=[],n=0,i=e.length;i>n;n++)t.push(o.Point(e[n]));return t},MultiLineString:function(e){for(var t="",n=0,i=e.length;i>n;n++)t+=o.LineString(e[n]);return t},MultiPolygon:function(e){for(var t="",n=0,i=e.length;i>n;n++)t+=o.Polygon(e[n]);return t}},r={formatPoint:o.formatPoint,makePoint:function(e){var t=this,n=t.formatPoint(e),i=n[0],a=n[1];t.xmin>i&&(t.xmin=i),t.xmaxa&&(t.ymin=a),t.ymaxt;t++)this.makePoint(e[t])},Polygon:function(e){for(var t=0,n=e.length;n>t;t++)this.LineString(e[t])},MultiPoint:function(e){for(var t=0,n=e.length;n>t;t++)this.Point(e[t])},MultiLineString:function(e){for(var t=0,n=e.length;n>t;t++)this.LineString(e[t]) +},MultiPolygon:function(e){for(var t=0,n=e.length;n>t;t++)this.Polygon(e[t])}};return{getBbox:e,geoJson2Path:n,pos2geo:i,geo2pos:a}}),n("echarts/util/mapData/geoJson/an_hui_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3415",properties:{name:"六安市",cp:[116.3123,31.8329],childNum:6},geometry:{type:"Polygon",coordinates:["@@„„nJ‚UXUVƒ°U„ÑnU@mlLVaVln@@bn@VU@xlb@lšLnKlšƒVI„JšUVxnI@lVL@b„Ž°VX@˜b„x„nVVUnVVnU‚›@kX@VwV@„al¥UUnUWa@ƒ@wĸU„LU¥lKUa@aUI@alLVaUƒ¯anƒWkUKm@XV@VaXlW@aU_UWVUƒI¯@ma¯W¯™™I@UU@WWU@U@@UU@VkV@@WUUm@UaU@„lK@IUK„L@KWmXUWaXI@ƒ@a@a@U@U@KV¥lw„k°b²JVIVKlV@UX„la„Ul`œUVLVVVUšJ„U@Lnm@_VK@KUIW@™J@Xk@WW@U—ƒmm™XmWk@kK@aUUƒVmmkUwUmWL™@WmU@™UJmUULkKWakLWVkIƒlƒwULƒW@X°lUJ@°ULƒWV—wmJ@bmb¯Vkm@@WkWm¯wƒL@lkXƒWmXym¯UImJUbkV™@Vn¯„@V@lUbƒ@mk@maUxmlUbULWn@J—LmKUkWKkwUKƒbm„X„WxkVUKmLkVV@JUUWL@xkJUUƒV@X@VVlUbVX@xk¤šx‚¼œxWxn„‚nn@Þ¼„JVb°aVn„@šmlnXU„JlbVlkz@‚lUŽlXJmxVxXnWxXÈWlUŽ@šUxU@VX@xUL@šUÆmLnV@lWXk@@JlbXblnlJ"],encodeOffsets:[[118710,33351]]}},{type:"Feature",id:"3408",properties:{name:"安庆市",cp:[116.7517,30.5255],childNum:9},geometry:{type:"Polygon",coordinates:["@@n°‚znW„XlW@k„K°xXn‚l@Xn@l‚°Una@anI˜xXU„ŽVK@¯VIkW¯X@‚„VK„x„klJXUlKXblLVKnVVIšŽV@Xn‚@šŽXKVnVxlŽnn„UlmV@²óUkV™lW„b„lƒšƒn@VVVIn@lw@WVIXblV„@Èx‚aUaVIVVnKVLšK„ƒln@b²K@»U£ƒÑķƒġÝÅb™K™a@Im@ۍ„@kWÓkkmKÅnóJƒUÅ£›W@w„ĕ@wĉţ¯¯ƒUkK±l¯Uƒ¥UÑkÝUķ»Ý¥¯™JƒIUŽVbUl¯ÈV¼VJU¼Vb@bkLUl@„VJ@bUXǚ@lkVmXmKkLVxš‚Ž„VƒL@VkVVVlzW˜kbmLUUUbVbUV™šlÒnJlUnLllUL@bU„Vx„l‚LXVƦÈVU¦WJ"],encodeOffsets:[[118834,31759]]}},{type:"Feature",id:"3411",properties:{name:"滁州市",cp:[118.1909,32.536],childNum:7},geometry:{type:"Polygon",coordinates:["@@š„@`nnl@„xšK@X°KXV˜IXVlbXVWnX‚lL@šÈ»‚LVan@VJ„êVVn@‚X@laÞbVaƒyn@„_‚xnWVXnWl@VnUVkI@l‚nXKVLVV@V@kW@LlVô„@J@bVnnKnkVa@»lç@ƒnwšKma™UUUVњ@n™mWXalI@alVn@VwUaVU„@„nlaôJnU„VVXlJšaXXVK@UšV@VWx@nXVWšXVšUlLUbV‚ULVVnUVbUbVbš@@a„KÆnnKVK@U@UU@@a„@Vƒ°¯ÈJVIlķ@aa˜UaVKU_@mkxUI@aƒUlyU@@™wkKWmUbUnUVWbkJW_J@bƒn@Vm@@KULk@V@@bVbÅm@LW@UVVbkK@UkKWL@VULUKWIUJUbkK@_WVXU›Jka@XƒVa@kšy@aVIUUW@@m„UlLœKWÑUKVan@UkVmmIXKƒaVaUwVU@UmykU¯@±UUL@WUIVUU@KkIWaƒaU@kUUaǃUó»mKƒk¯@y@kWK@bkI¯`mn™l¯XWlkVUzUJlbUbVJl@nnm„@VULV`XnWƗbmUUn™JmUknƒJ¯km@ƒyk@kU›xL@VUbmnn¤lX@`™z@JmaULUVl@Xn@xllkXWa—aW@UVmUbƒ@mVXšWxXbWbUŽƒÒnVVnVVUL"],encodeOffsets:[[120004,33520]]}},{type:"Feature",id:"3418",properties:{name:"宣城市",cp:[118.8062,30.6244],childNum:7},geometry:{type:"Polygon",coordinates:["@@Vb@„XL˜JXxlIXxlVlV@I²¤šnlUnVšU@VULWVUJ@Lnb@lV@UnV@@VVVlLnbnJ‚UVkUUVWn@@anUVnVJVIV‚@@nUJVbUb‚„@VUbVK@bn@VbnIlxkllXVlXKWUXUlL°¤UVVb@bš„UlkXW‚ƒxXz@‚„Ila„UlƒnUlJVInVÆJ„U„LVUnV„K°@VnlVnxV@XLlK@wVL@KnUlJXU˜bnKVLX„lUw@VWlLXKm@@a„@VLnmlIVVnKn@škVašVlwk@@a@k@ƒVIUa™@maUa@wna@kmWƒ™UUmVUIVǗ@aƒKm™aƒ™kU™J@InmUUaVa„k‚lX@Vk@m@VU@wnK@alKVUkUkKƒbmUkmƒ@U£WVk@@UÝbbƒaÇx@b@WVUa¯ƒ@wVwUUV@VwnK@KWaŁ@KšIUyUI@WmXó™UbWaKm™@km@IUyƒIUaWKƒx@zUKUL@llVUnkLVVkJWX@VUKUVƒIkVWakb@VWb@n@JkXUlmL@xkL@`VxšLUÈUJ@Vm@@bmIUlUL@VUVVbknm@mKUw™KVÈ@J@LV±kkJUIƒl"],encodeOffsets:[[120803,31247]]}},{type:"Feature",id:"3412",properties:{name:"阜阳市",cp:[115.7629,32.9919],childNum:6},geometry:{type:"Polygon",coordinates:["@@V™nƒš@ša„k°aš±@‚¥@UUI@aUmlwUUx›b@¥XU@mmI@a@Kn@@_W@@W„I@mšUVVXUl@XaV@‚K@I@a„LX@aVI°K@KVL„UUw‚yXkšK@kšKÆbXnlK@k@a„JlU@w@U@»@aXKWƒn_‚JXkVKnƒ@°LlKXƒW@¯Uƒ@aUK@kmJUw™VƒIUJ™„kŽmL™K@kka@wUVm@@am@UkUbkK@nmVƒÒ¯VU„WVVmIƒƒULk@ƒƒma@kkKƒƒ@nUbUamU™`UUVUkKVkkƒW@@bkmƒnƒmUXVKXVƒL@VƒbU„m‚™bVXJ@nmKÅI@KWKUXVJUL@VUKUX@KUKWL@LUJmaXXm@kVVV@L@VUL@VlK@L@V@LUK@VUb@UUU@°@nVxU`‚Lkn@`@XVJ@X™Vm„k@UKmV¯LVVn±Wm@Ub@JlLUl„@VLk„@lmVVn@bnV@V°IV™šaVJXI°K°V@XXVlVVU„nšKVlUš„bWXnV@bV`U„„@@m@@‚ƒ@nxmn@bXVlL@¤nb„Ul¦šVVUnJVU„Vl@@bÞL"],encodeOffsets:[[118418,34392]]}},{type:"Feature",id:"3413",properties:{name:"宿州市",cp:[117.5208,33.6841],childNum:5},geometry:{type:"Polygon",coordinates:["@@@UWU@bkW@aWU@aUIkWV™lLXb„lVIUVV@‚mn@V_n@VaUK@I‚@UašanJVU„@lV„UVnnKVVlaUa„I@wnK‚Lnll@nVlk@wVKXkl@@b„bUJ@V‚U@U„UUyVk@aVUXwlWXX‚WU¹@aU™@WUI@mlUšn„J@Il@šaXbV@VKl@XxVL@W„IšJlb„@„al@„IUUm@@aVK@¥¯—@mUķ¯bWƒk£Vm@akm@VaÅ@UVWaƒ@UJWkƒJ—UƒbWbU@UlƒXk@ƒamV@K¯nk@ƒlU@Uxmz@bU`ÇbUbÅVm£U@Ww™x@akLUK@UlakwUJWVkLmaUal@n_ƒmVUnKVUUmÅXWa™@kJmx@XUJ@bVLXxl@VVUVV„UbkLWbU@@lUVV„VVX„›K@XkJ@nU@@bV@VxUVlb„U@xXLWŽn@UxVbVĊ„V@b@XV`mnkJ@kUKmbƒaU@VbnbÆx@XU@@`k@@bl„™@@bkL@WƒakXWaU@Vmkx@XWW@@wUUUbƒJ™U¯V™@¯ÞU@WxXŽlL@bkb@ŽlVlnb™JW@kkU@mbkaWJ—IVlmz¯`UnU@mb™@@„ƒ`@bkVlœnV@b@šV@„aVxn@Vx‚KXnl@nbVK„bVK@a„_V@Vƒ„w@W„LlwnK@UmIU@VWš@šUÈ@lKnal„wš@@V°@šaUmlUUw@„ƒV@@UXK"],encodeOffsets:[[119836,35061]]}},{type:"Feature",id:"3410",properties:{name:"黄山市",cp:[118.0481,29.9542],childNum:5},geometry:{type:"Polygon",coordinates:["@@lXnlWX@VUJVnUJVzXJVx„kVJlI²l‚U@K@IUǚLVxnLn@lmUaVU@UVKVknJ@an@@UVIVǙKUw@_lK@wnKVklW@I@mXa@UlaXblU„JVUVL@UXWlIUUlKVmkU@kVKVL@y„wXLVb„JVz@Jlnš@nŽ‚LXbVaôšnW@la@UVWUa@@a@mk@WIk@VwUa¯¥m@UUVK@ImK@aX£ƒkK›ÅV™a™™ƒ_@±ƒakXWW—LƒƒƒnU@@a@¯mK@L™JUWwUV™VmbXX@lWLn`mzUJUb™Lƒ„k@makVWmkX™ambkKknƒaƒ@ƒaƒb@‚U@Unm@—ƒWVƒ@VbUbUJWIk@@lmL@°UVUVm„nš™@@kmWkb@xƒ_m@@aU@b@JlŽUz™lWxXn„@‚b²@l`„IVl„UlL@VšK„nVbUl@VlIn@@b„bVWUk‚@@bX@Valb@bnb°Vn@„xVKlbVnV@V‚x„L@ln@UXVV‚L˜"],encodeOffsets:[[120747,31095]]}},{type:"Feature",id:"3414",properties:{name:"巢湖市",cp:[117.7734,31.4978],childNum:5},geometry:{type:"Polygon",coordinates:["@@VV@blL@ŽXlWnnšnŽ˜„@VXXl@@WšIX@VJ@LšxŎxlnšŽ@bXJVblX@VVbUVn@VbUVlb@LnJVbVLV‚XLšÒVL„ÒšV„bVIVylUXk°Wšknm°_lJ@aXL@l‚z°@„lnLô¼V‚È„VUUaVKU@WW@@UUa@knmVLlaV@„a@kšak±@UmwkKmk™lj™ÝUUkL@mlIVmnÝWkkUÝ@KƑĉ™a@»ƒmma@mX™¤¯Uƒw@ƒ@UU@bU±±L@akmƒ„™LUKmLUUUJVbbÇwƒ@kUWaUJ@Xkxm@UJUUm@™„k„ƒ‚ƒakXUšVl±ôU@kn"],encodeOffsets:[[119847,32007]]}},{type:"Feature",id:"3416",properties:{name:"亳州市",cp:[116.1914,33.4698],childNum:4},geometry:{type:"Polygon",coordinates:["@@lU@Un@@anUlw@KVmUwlaX_lKna@KU@@kWKUU@ankW™XK˜@@V²VVIÈU@al@VaÈamK@wU™@klaUƒV@XƒVUU»WUUbkmUkVmk@aÈw@mWU@VkIkVWKUÑķXȭºU¯lƒ@kkLWmÅa™L@l™LWlzVxƒVUK@L¯LUJ@bWƒK@b@JLU@Wbk@WVUU™V@nƒJ@XX@@`m@@L@bnJ@nWV@¦œa‚wVVkxVn@bVJ@V¦@Ž™²¯bƒl™b™@m„UšUŽƒŽ@¼ƒ¦Xb‚UV`@nnxUxWLkUkVWKkV@XV@@VVL@VX„@lVV@L@blL@`šL@xXKVL‚@„VnUš@lwnU@ml@XnV@@UVW°LnalƒUI@aUK@a‚a@U„kXW@I@mWL@UXK@UVW@U‚@@k„Wn‚@@V„@XblaVxšL@bVKXb„IlJ"],encodeOffsets:[[119183,34594]]}},{type:"Feature",id:"3417",properties:{name:"池州市",cp:[117.3889,30.2014],childNum:4},geometry:{type:"Polygon",coordinates:["@@„V°°ĊŤ@xƒĖ@xœXƤ„VôIÆmnLllXÔ@lƒÜŽn@@JšbšLÆaĢÞĸ„°VVUUKVanK@UV@VL„VVn„ln@‚xnklxXamk@WV@Xa˜@naVk„Klk™@mkUWwkJWw—IWK@ƒUaUwWIUyVIUmVI@UXWmkkW‚—KUUVWm@@kƒKw@U‚UUmkaULƒwm@¯Uma@akaUbW@@a@VlUXƒa@am@kJ@UVkUaƒm™L@UkKƒVUkƒJk_±@aƒ@WmXwÇkkaVaUa±ƒœwV@VkƒwnyUaW@UU¯amLk@m™@kmmU™™¯K@L@lUX¯ƒWlkXƒŽVb„bƒVUL@J@LVKnlJXnlb@`nXlalV@bnL@Vnb˜¼@lXbWlkL™K@zUJmIUxUVUVmX","@@llUL@VlxšL@a@UƒwXa¯@"],encodeOffsets:[[119543,30781],[120061,31152]]}},{type:"Feature",id:"3401",properties:{name:"合肥市",cp:[117.29,32.0581],childNum:4},geometry:{type:"Polygon",coordinates:["@@„L„xV‚ĊLÞkšVlVVXaWaXwW™nU„@‚anVVUX@˜bXblWkk@wWmk@VUVKnb@Išy@_kWm£nmVa@U‚KœwlVl@„zn@°l„IlmnVšIVmnV˜aXÅWmU_VK@Unƒmmk@UIVakaƒa™UƒÑUK™ÑWKUUKUamI@KkaVUUam@VUUa@UkWUaWI@a™kmōw™wUL@`mn@KƒV™IUVUUUK›Vk_ƒVkbWƒ@VkUULUJ±I¯aƒlkxU¦@L@V@V@b@b@„WJXbWVXn@LƒKVL@JkLƒŽV@Vbn@VV@XU@UlV@@VV@V@XXV@@VšJ°š°Xnb°@„JUVVXV`@bkXWŽUbU@WŽn@VLXlm„°bV„UbkK@bVJ@bVbkLV¦ƒKķV@x@„XbmVVVk¦"],encodeOffsets:[[119678,33323]]}},{type:"Feature",id:"3403",properties:{name:"蚌埠市",cp:[117.4109,33.1073],childNum:4},geometry:{type:"Polygon",coordinates:["@@VÒXLlUlJ@UXV@nÇx@bnlUVllnVaXVV¼UVW„U@V„²wVV@Vl@„VnwlIš@XbÆWVnUVmLUV„nm`k@VbnblKXUVIlxkb@VVLlK@bšwXxV@n¤ÆUVaÈaV_@anyVwV@„kl@°m@LnU„bl@„WVkV@Xa„a˜V„IXl‚IV‚„@XbVUÆ@XKWwUkmW@_UmnIlJXkWKXmV@‚w@_XV@Kl@kU@KlX@@UUUUKWLm@klJVUUmk@mXUWmXwƒ`m@„zUbÝakbW@m@UUƒéUIm@UbKǼ@™kKWXmWUkaWU—JWU¯L@W™Lƒwk@mm@_™ƒÅl™UVkmWUnV@VWLUb™bƑĬ¯l"],encodeOffsets:[[119543,33722]]}},{type:"Feature",id:"3402",properties:{name:"芜湖市",cp:[118.3557,31.0858],childNum:4},geometry:{type:"Polygon",coordinates:["@@„bVaV@XllLXU°ŽlL@V@VUnVl¯Ikš›VUVU@@b@lUXUWmb„n@¼šbƒĊ‚LÞ@lVXlmÞUnkJ@nlKVVšÞXklWVaVI@aUKn»lL@Kn@‚XXwlm@mn°@„V@Wy„wXlWVk™ƒ@aUaVU¯£kKWVXVWLUkkWlkkwmJUam@@aULVa@UƒVaUaVI@m‚@UUJUIUmmV@bm@UXVVUlVmImakKUU@UU@VmU@@kma@KVIXUVK@U™VmUkV™m±£@JkU@nlšk‚ƒLUlmb—@WbU@@XnlWb"],encodeOffsets:[[120814,31585]]}},{type:"Feature",id:"3406",properties:{name:"淮北市",cp:[116.6968,33.6896],childNum:3},geometry:{type:"MultiPolygon",coordinates:[["@@lnnK@¦n@@V‚V„@@VV@nIV„V@VW²a@b@bVnUVVV@V™z@lš@°UšV„IVaVV@x@ŽXX@WlwUnV@XblW„b@XlK@aš@kƒ@al@@_V@@WÅwmaUaV@„bnaVL@llInmU_@W@aƒUUĉUaVwm@XWK@wƒVkaVUUwU@@aV@@mlI@WœLWƒUUUƒVU@kV@XalKVaUƒVUUUk@WwUK@aVI@WƒUk@@UUU±xkb@lVš@xnLÇbUbk@@bÇVUJ±U@U—@WLXšml@bVVXL@lV@@LmbkLW`kbVxUn@LkxmV@bm@@VkV"],["@@VVVkV@¥@UV@U@VUUJƒkWakKUšlXVJ@bXV@blX@aXV@V"]],encodeOffsets:[[[119183,34594]],[[119836,35061]]]}},{type:"Feature",id:"3404",properties:{name:"淮南市",cp:[116.7847,32.7722],childNum:2},geometry:{type:"Polygon",coordinates:["@@°kƒīšaVaXK@U‚UVmnXUlšVÆkVKUUUmmU„ÑkU™UÝlĉKUƒwƒKƒbU@UxW@@lœmVUUVmUUƒmƒw—aW„kL¯K@Žm„ULWlIm`X„WL@b@¼@V@xkVƒI@b@l@lk„V°Ȯ¹ĸW"],encodeOffsets:[[119543,33722]]}},{type:"Feature",id:"3405",properties:{name:"马鞍山市",cp:[118.6304,31.5363],childNum:2},geometry:{type:"Polygon",coordinates:["@@šNJnllLnxV@laXLVKma„aXbVI„bVKVVVIVyn@n_ƒƒW@@ƒ„UnJlUVVXlLnaUWlV@VV„IXW@_W@XK@K@UVUUwVamÑXmmwƒw™KUnUK™çU@ƒJƒU¯@mŽ@nknWxWm@@LkKm¼VL@bUJUbkXWl"],encodeOffsets:[[121219,32288]]}},{type:"Feature",id:"3407",properties:{name:"铜陵市",cp:[117.9382,30.9375],childNum:3},geometry:{type:"MultiPolygon",coordinates:[["@@„ÒV¤@¼V²@aVV@Ž@„„x°Vš£nW‚@nbnaVXVW@k@aV@VUœUl™°JUkVm@U@UkK¯WVkKWkU@Ubƒakwmlwm@ƒkUmƒUUKU@@VmLUbVLUV¯U"],["@@LllUL@VlxšL@a@UƒwXamK"]],encodeOffsets:[[[120522,31529]],[[120094,31146]]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/ao_men_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"8200",properties:{name:"澳门",cp:[113.5715,22.1583],childNum:1},geometry:{type:"Polygon",coordinates:["@@HQFMDIDGBI@E@EEKEGCEIGGEKEMGSEU@CBEDAJAP@F@LBT@JCHMPOdADCFADAB@LFLDFFP@DAB@@AF@D@B@@FBD@FADHBBHAD@FAJ@JEDCJI`gFIJW"],encodeOffsets:[[116325,22699]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/bei_jing_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"110228",properties:{name:"密云县",cp:[117.0923,40.5121],childNum:1},geometry:{type:"Polygon",coordinates:["@@vIHZDZQtDLNMXIbHRCXXITbJ@H`LGPRDDJNCLHTOCWFGvGBUJMKGFO^IHWXITQCI’Y^AXGfRˆDXF`DJOLB~G\\DZIHHpErUVMhHb]\\M†BVF@FTP`@zTbD\\@~M\\K`H^EVODWICAakAQXoIcCOCIgGYNWFWNGGKKGaJEGMEIKYJUT_J_Go@_SyQaSFMEGTcYOQLIIi@EKAUPCV[EEXQCW|aMUMAaYCYNIDGGACIMGGSKDQGaF_C[GaB@GOIiOKAYL“mI@CN]F[SWWAcKKI@HMUimEKbeYQYISNUOcBKPIFBNgvDPGZYFSf]CMSIWGEUFgDIQ[MeDMJS@RR@LphFPCHaBAJKF@J]IBJO@HlO@@RKAMPJHCNDJTHFP@ZGNANBRFH@J_fM^ONJNF\\VTDJHDON@XRND\\XRCPVETCLBVKDFJINHRGPRV@\\CLJN@VbXbLVT"],encodeOffsets:[[119561,41684]]}},{type:"Feature",id:"110116",properties:{name:"怀柔区",cp:[116.6377,40.6219],childNum:1},geometry:{type:"Polygon",coordinates:["@@JHTVHXCHPfnDJGHNDJSB[JSBGVSAOH@PMPuDEHHXZN@PHF@ZLJ@LHVYJA\\OFWP]BMtMBSRGV[JeVAPQVIFENMD¡–@^NV\\JH@NNL@NM\\kTQ\\I^FNIpBHGTBFFAZQfKDIXQTLXFXNNVMVHRGpCFLlRLEVBBH`IVO\\G`RDPAXLXBXORHZEHTDLLN@VGTMrQNFPeASKG@GMOAKBYMK@GTUHUXSHMVDNMOUEOZMJML@^KRACMZEZMRQLUHE@OFENPR@DI\\ChMHIDG\\GJMDWHCKGMDCIQCHO_K@GaIJSWWQDaGWJMNCKRsCYGYuJUSaKaW@UIMDK@[QUHOGQJMEILCAUDKFSOUQD[WMC‚Q@WPMGCCIUSE[IMPMN]`e@IEGAQBMHM@YEOSGCIDMIGNOLB@QP@GkP@AI^J@ILEBIbADGEOog@KQQWSekWQQUOFKZLF@PUNmIaHIUeBCTSHENcJa@_IWSaGu`GLSBKJQFOXGDXVQVOBIHcDSJWBEFGTMH[^mLaXcHiKElTRKtFXZ`MHMPCNRDxZˆB\\ICIHK@KŽHbIVFZ@BPnGTGbDXRDJaZKRiGEFSFEJhjFNZFjn"],encodeOffsets:[[119314,41552]]}},{type:"Feature",id:"110111",properties:{name:"房山区",cp:[115.8453,39.7163],childNum:1},geometry:{type:"Polygon",coordinates:["@@h@bl@HRJDZ``TA\\VVD^H`\\pF\\JŒ`JGv@ZO\\GPSTEjPTR`FnEbDTDHEhLFMTK@ETSPULKEI@OVISKSJACEQNQbV˜IXGDIN@dMB[IIBcN]ZHNLP@XOWCFWŠCNRHTpATD@^NVNLED@Rh@jCEF}E[OOHUEW]W@QGGDIQSH_MmFmCUT_K]i@MHCMW—FCF‹E{BMHMPOHKS]CFNGBELDH_@BcAKOACESAOBELaXAROB@FODMEDWJAG[aE@UM@DImEWJMC@OeCA{aE[@{L@MINUCQXKfUJORCHqJBF@TCXWNQX]M[EAJO@@KMBQJIC]EWMCCUBEBFHKDOTMBGNGF]MWDBRDdMDQVyE@LPVHDCP@JVVMTG~HNSH[CmRUvHPHBbA\\PTNRC\\YNJ€PRARPJDDR"],encodeOffsets:[[118343,40770]]}},{type:"Feature",id:"110229",properties:{name:"延庆县",cp:[116.1543,40.5286],childNum:1},geometry:{type:"Polygon",coordinates:["@@^AXOPEB[ZIGU@KKI@YGE@OYMGWFGvCNO@OPGTBHUTA\\ITACIGMIHmCOeDGGWSUIGimYEEMgiFITEFEjHLQbYCIWQaCSHmHAOY@UEaJG@LGLDJ[J‡AwYQCDMNONGY_EWLsSQFkMO[NWAIGaIYL@HMBOKiOQDWEUDMQSF_QIUBWdg@[NaAKQ@M]OQ@WhgLUMMFYQDIRCEUZOOCIOJ[KIUMKL@HIDKVEBM`HJAJSJUdBLGNEdMBMO[BYEWJSNKNaD]PE\\SjOT_RQVEZPpƒNQXfŠNA~lNG`@PNLp¼RFLfbdKbATUh@FSNWjGFZVLFHVA~X¨PPROfFJbNJPLFbENJPrEFNPFRHDDJdENJLVEPBJTVTHGHFRFH@PXP\\ORQHW\\BjWFDERLPPBbB\\E`B\\D\\L`@F]FCnJ^AZL"],encodeOffsets:[[119262,41751]]}},{type:"Feature",id:"110109",properties:{name:"门头沟区",cp:[115.8,39.9957],childNum:1},geometry:{type:"Polygon",coordinates:["@@V@XMnGPY²‰JQNEhH\\AZMPDVTTDZCPiJkHSHCjIdFtEHITCNITQEKUAMCEIKCECABYESKFWAKBEIIHABGDCKCAIHMHALKEI\\CFIBILIJQZS]BBEECS@E@@C]COKI@CABAAEEDMGƒCH]A[M@CJWH—JaUMRFRBDTITLUJ@PFJKLOVST@FSLENgKGFSCaCmF_ESQiOSFOT[HYPu@IH‹_[IoE_[]GUC[USB__CYQI@Gakg@qZeHQNMNV\\FVLPgJAFJPRLCH[XcPELUT[JiV_EELFTADBXRTRLJC@fHXHHbPd`fR@NfT`@TLplHMpCEJHJBVLFŽ@JT‚VnG^KXDXHNVGRLRXFJVdDHSNWLGfEzA"],encodeOffsets:[[118635,41113]]}},{type:"Feature",id:"110114",properties:{name:"昌平区",cp:[116.1777,40.2134],childNum:1},geometry:{type:"Polygon",coordinates:["@@VNLJI\\JPPDYPFVQDCJZRNEVNhKXgR@^P@NLRbB\\Mh@XcVARJE`RTCNFV€XRCjPPLNA@GZKbJJHXB\\MNPjLdGbWnK\\]NGHSFEXATIdCJGPARUWUHCPWRELITAHKv_E@iYCaW_BQ\\Y@QIO@QDCIGZCEMWGFMFAFgHEDOCSqKCCFGAMKEAC@ODGCGs@WH@KQA@EE@CE@GEA@EH@GGUEEJEAYD@JM@@DAA@FHD@FTJEHUC@JUBKCKG@G[CIIQReAYhO@OXGDO@@FF@IHJFCPEBACBIAAKDOABXARHPNEHGbQAAKQFGIAM[C@WHKaGiCEGOA‹HUKCIokSCUSOCYN[BgGMFIR±ŠOZmHWNU@ShbbXDHVXXGJ^lZ@PZ\\Nb@\\FHJAD"],encodeOffsets:[[118750,41232]]}},{type:"Feature",id:"110115",properties:{name:"大兴区",cp:[116.4716,39.6352],childNum:1},geometry:{type:"Polygon",coordinates:["@@F\\E~DFN@BDFEpHFCHBBEGCDCJBHUDSBB@ELCPbF@B\\J@BJVAFJ\\ADKTCBGECFMT@BMN@@FH@DaNBEnvB@FPBATK@FHEFIAKFBFL@@PKBFJHC@FXBRAFCDMPDTOL@JIVFDHH@DDH@BGRFCDLD@N^@@CNA@KNOAEBCECFEGCFGMGFIPMOEJOLBADBBHGG@GCHIECY@INC@DMGS\\AIOZAAEYA@GT@KKMBEETCGMVINFxA@MJADB@FlA@HJA@NND@DFA@DVAZBBOFKH_JA@K^GBC@EFE„G@gAENMXKJigC@IbSJMqGOP£RGSMGE@kbQFDPEFiBSGGSBK]I{CDWCIDOic[C_G@SuSO@EWKCO@MNY@\\uZOPENQD[LKESSKGBKEG@EJGAGHoH¥CqhifeJkX_XFFGHFNEDFPENKHM^IFIVL^S`DVEnNnG`RTCJHH@R^XFXGVPP"],encodeOffsets:[[119042,40704]]}},{type:"Feature",id:"110113",properties:{name:"顺义区",cp:[116.7242,40.1619],childNum:1},geometry:{type:"Polygon",coordinates:["@@EhEBENXHFNYDJHCD@RJP@R[ZARX`DbjZF@bHXT`Jb@dIFMTGDSfAJVbGnJVM@OKELYPERVXRflXTT@NIfC\\NJRhCVEHFJXNT^DTeZEHYCOhuAMJELOdAVPTMOWBWNMNEJgl]@WGUFIC[T{EEDEHGCIGMI@SECUQI[D{A{GQESPUH]CsiMCmHUeoHENcAaDGCMDGMQCACCBaCGLMAHB@DIEQLOAAEEJ@CW@CDINGAAGKQOCgV@LG@BEGDKNeREFBNCFIDOPKD[@YRW@GFWDAFE@EHDDrLDTCPGF","@@KrJEH[\\B@FF@CHFBHUN‹AJKADGECBCMAG^E@EbI@BEGP"],encodeOffsets:[[119283,41084],[119377,41046]]}},{type:"Feature",id:"110117",properties:{name:"平谷区",cp:[117.1706,40.2052],childNum:1},geometry:{type:"Polygon",coordinates:["@@ZJZRafFLjn€VGNJ@LLBdXX\\T^EDMJ@”nZKLBjPPJ@HbA\\H`DbERHLCFK^BZaFWXQLAGMHa\\OLO@SBIpBdCLƒVQfElO@GSAKEDQTC@GEBKG@ORIJBDAPDFA@CaOq@GGQAAEJK@KMUGAAGEAa@MGMBGCGSIIW@WSUCMDOJeWOM@IUF{WMWaDIMgIoRoCOKeEOEAG_I[cg@wLIFENQFDVTFJ@HNDJGHCFFFS|D\\EJHV@Xk^IhMFMNAXPX"],encodeOffsets:[[119748,41190]]}},{type:"Feature",id:"110112",properties:{name:"通州区",cp:[116.7297,39.8131],childNum:1},geometry:{type:"Polygon",coordinates:["@@FDAJTGDNDCTDDEDBBE@DT@@EHCDGJ@EIZ@@FDBR@ATFBBVFFE@@HNA\\VE@CLIFNJFNJBCP]A@LJFA@HJEDD\\C@DBCHLAEPF@@DH@APHAERDF\\GIxDTM@CFLBBFJ@CNUPMHECGDBF]BMFPDLRBHHBJMDCX@@DFIBFPBRKJF@CGANBHKbDDABDRDHNNCHDbCdBFMpGHiOYMefKJMC}HWAUNW\\NNBNA„kNU|]HMTMN@MZBLFFF@RIRUT‘BMFIEGaAGGAOIIUGTSFcYKS@MSLYPKRUBU]EWDOI]CKGASgW@MTWKIMCS@uMAKKADMECGAKVUTSDy@IjWLMNBF@hƒHEF@FAD]H@LIBG`ELAPYAUB@CEB@CMC@MIB@GkB@ECAIB@NwBMEUJHNSDFFNALLS@@HZBBFYBJP[BHTCND@JMZ@FDGJHDH@GHAABCKAIPPFONEJNHEHHDEFFDADBFMP@L"],encodeOffsets:[[119329,40782]]}},{type:"Feature",id:"110105",properties:{name:"朝阳区",cp:[116.4977,39.949],childNum:2},geometry:{type:"MultiPolygon",coordinates:[["@@bFGHBHFBFIVFHHG@@FFB@HDFF@@FRB@LXGt@DHCH@PBDLFBNF@BEXCHEX@ZQ\\@LCPOJCDEAMFEfQLMHCAFH@@KhUNE^AAEHCFDNGVODMI@AEKADEN@CSJw[HCEFQGBBOG@@CE@FOKBDGCAD@C[FCGIB@IE@K^BDOIAEMMIJEDKF@[UMB@GF@EEAUEABSQ@CA@EY@FJI@CHGD@FS@@CAFCACFSCCDCMSHBIECMB@D]@@MKCDCQEAHG@CCG@CGUEIJK@SPOCCNEDQBDNDB@DJCDLFCBBALJB@BVGPBKVO@KHCCCD@FE@BNA@FNCTDDJA@FGB@NBDW@CL@hT@@ZHHQDDDAFSAANBC@HG@EFS@@DE@@PCB@Ue@CADNJB@FCBWA@LI^ix@FIHrH"],["@@HUN‹AJKADGECBCMAG^E@EbI@BEGPKrJEH[\\B@FF@CHFB"]],encodeOffsets:[[[119169,40992]],[[119398,41063]]]}},{type:"Feature",id:"110108",properties:{name:"海淀区",cp:[116.2202,40.0239],childNum:1},geometry:{type:"Polygon",coordinates:["@@plDJVLŒGPBFHjDbHGL@X\\DBNHJREBLRBHaFGŽMGOBQAWPBLCBBAJBDFADOIEJGE@@EP@HCPWP@ZgfBRQJJ\\D@HLHLDVA@IVDFGSI@EGC@EBB@CN@@IZCAGHGaEqGJG@EjwJ]@K@GSA@e_I@NE@CA@Kg@KC@ENCFƒAKQAW@WIMK@V‹@I@@F@^EDFB@HcIaDYCBRRDCHD@EFLN@FE@CJUPEJOJMTBPEDIFCMIAKNOGMRFJNDVBFLSRMJSDGJsFcEiJGDGTIlOjYD"],encodeOffsets:[[118834,41050]]}},{type:"Feature",id:"110106",properties:{name:"丰台区",cp:[116.2683,39.8309],childNum:1},geometry:{type:"Polygon",coordinates:["@@hMN@NFTQCFRCBJFA@HJ@@HJ@HJ\\FTACDŒ@@UNLXJX@@MA@@IECAQlDFEHBDI~D@GXCFMVDFCH@@NF@ANJC@FnAB@AMF@@EDCDDLGP@LUOAUH@AIABKAAEDCKID@CCACMWA@EGDEILA@OK@AELEJBFEEGL@BSOA@EuAFmMACbG@@EM@ANS@ENFDAHSDCL[BEIUBAII@A[E@OaKD@FAACTGVIACDHDAFGAEDoGEFACM@i€g@@QFCMKMU@]SCoBGSMQ‰DEXXDWPO@MKYGM^AdJJA\\cNB\\G^„DNHFCBFABDBJ@PL^D@DF@T@FDAF^A"],encodeOffsets:[[118958,40846]]}},{type:"Feature",id:"110107",properties:{name:"石景山区",cp:[116.1887,39.9346],childNum:1},geometry:{type:"Polygon",coordinates:["@@NQPHLMJBDNJEFCAONSPIFIVODIF@@EKMFEC@DGQCAQZDbCdJ@GEAFC@]@EJ@DCSB[EGII@@GI@@GEBAIQDDESRMEM@gNYTIRKJAJEJ[DFJKLGBGNBJLDCDAHGBJJAFBLEXTLZFBAFDLD"],encodeOffsets:[[118940,40953]]}},{type:"Feature",id:"110102",properties:{name:"西城区",cp:[116.3631,39.9353],childNum:1},geometry:{type:"Polygon",coordinates:["@@XBDA@EIACM@IJAD]BC@SFABISAD]H@@OAEDQEW@BLE„MD@FLDh@@LDBF@@M`J@fTB@H"],encodeOffsets:[[119175,40932]]}},{type:"Feature",id:"110101",properties:{name:"东城区",cp:[116.418,39.9367],childNum:1},geometry:{type:"Polygon",coordinates:["@@DBf@@VDA@OF@@CT@FEH@@GADBMTBBECCRCGG@YS@@gDK@A‘C@PG@C^TBAJEB@TADC^IB@J"],encodeOffsets:[[119182,40921]]}},{type:"Feature",id:"110104",properties:{name:"宣武区",cp:[116.3603,39.8852],childNum:1},geometry:{type:"Polygon",coordinates:["@@RBX@RFFCŽBFU@aK@WA}CCJGAEFkCBRFD@JB@@N"],encodeOffsets:[[119118,40855]]}},{type:"Feature",id:"110103",properties:{name:"崇文区",cp:[116.4166,39.8811],childNum:1},geometry:{type:"Polygon",coordinates:["@@XBL@@bEV’D@BX@AC@MHA@EIBCCDSEMmB@EIDBME@@MG@EDUCENWD@H"],encodeOffsets:[[119175,40829]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/china_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"xin_jiang",properties:{name:"新疆",cp:[84.9023,41.748],childNum:18},geometry:{type:"Polygon",coordinates:["@@@›ρȁôƧƦóəʵסʵóƪԫʵѵͩƧͩړ›υࡓɛʵ@ȃ@óᇑѵƨɝɚôóНѺͩɜ̏ԭʵôƧɞñ@υƩ—݇ȂóƩƧ@ѵȂυœƥŌਗ—॥ɛóʵѵƧѹ˜݇̍ࢯ˜əɞυ˜ρͩ̏óਙƨƧŋôōóš̍ͩóʵן›óŋړͪƧѶ@ɜԭ—ԫƦɛȄ̍›ɝȄöςƩȂ̏œñȀ̏œƩóóŎə˜@Ő̎@ɞȀɝŎôƨóנѵȄƧ@óŏɝœóɜôŎ̍ͨςŎ@ƨóôƨɞ݈ʶóƨφó̎Ȁƨ̍ԮòѸԮמ@ѺȀ@ƪၬֆòȂñ̐òȂɜ˜óƨ̒Ŏ̑߼@φρȀ@Ő๐ς̎Ƨφ@ɝφڔ೦Ԯǿࢰ@ƦŏԮƨƨȄƧ۬ɜʶڔŐɚɚóŐôƨ߼˜ôƧƧó̐ƥóŏѺǿƦȁφƧς˜ƨƧ̒@ɜƥƦυ̐ɛƪͩƩəƪʷ̑ə@ȃƨʵנŋྸōਚԭԪ—@ɝƨŋ̒օςʵôƧ"],encodeOffsets:[[98730,43786]]}},{type:"Feature",id:"xi_zang",properties:{name:"西藏",cp:[88.7695,31.6846],childNum:7},geometry:{type:"Polygon",coordinates:["@@ôŌנœôʶ̎ͪô™óŎƨŌਚƧ̐ôςͪφ—ɚɝࢰ—݈̎Ѻ—Ѷƨôʶ०ɜਘ˜Ʀŋφ›Ѷȁ̍—ôŏɚŋ@̑ə—@ŏò̍ɜ›óƥôʷƧ̍φѹԪ̍ע@Ѹʷɜ@ôñנ@Ѷɛɞô̐ŏѶƨѸƧƥōƦœôŏô—@ƧôƩ̒ŋƨŌƦǿô̎ɜȁ̒—óʶѶôôО̒›ςƥɜНφσɛȁ̎υƨఱƧŏ@ʵƥœ@ŌóóóͩƨƧóŋ̑õóɞóɝԩͪɝρôƧ̍ƧѹͨڑŎ̑ōóƧࢭͩ̏ѵɝóఱóóԪυô@̒ƥŌ̏Ƨ̑Ȅ݇ŎƧ›ѵӏ@ɛõŏɛȄôӒƧŌѵǿɝ˜Ƨŋԫ@̏ʴƥ@óǿ̑Ȁóǿ̍ςóóυô@ʶɛñρƦƩŐó̎óœѵó̑ͪࢯОóɜן˜Ƨ̏ƥȄ߻̎̏̐ןŎɝɜöɞƩȀôöɛȀóͪ̐ƨƪ̍̎ȂƥԪυО@φɞ˜ôƪ"],encodeOffsets:[[80911,35146]]}},{type:"Feature",id:"nei_meng_gu",properties:{name:"内蒙古",cp:[117.5977,44.3408],childNum:12},geometry:{type:"Polygon",coordinates:["@@ኊȁ૊ö߼ƩɜɛנñԮɛѶóԮô@ȁѸóמ̎ගѺၬ@߼ʶԮӒ߼̎@ŐѹӒ̒Ԫƨöග̑ѶȄ̒ς।œѶɚöɞɜʴڔôôȂ̎—ѺȀς—ƨ˜ƪóԪ—ɜôɛОਕڔԭ˜ѵ̍ѹȂԫ›ɛƥ̍Ȃóɜ̎ô@ʶ݊ੲࢮʵږͪנƨôȂƧ˜̐ͪ@ŐƦƨφԬѶɜôƦ@ŐƧôôƦəŐ̏›@ŐڒѶԬô̐ʳԩНςōôŏɞ@ƨȂѶəóƧ̒ػ̎ó̐Őנóƨô̒@ƨɚɚ@עԫɛɛ@ȁυͩƥʳòևρ—̑ࡗƧͪ༃ॣԮփ̎Ʀ@ôô@ôō@š@ȁѵóƨ̍υȃóʵɛƨƥóυȂóəƪ›̐ρƧͩɜԭڔȄ̎عƧȁ̐ŏó̍ɛ›ƥƧ̑óρŐ@Ƨ̏˜ɝəɛ˜߻ͩ̍ͩɝО̍ƪƧóóӓƨóƧʳ݇@ɝςƪœ@ʴƩ—ƧƦôƨɛȄə›Ƨŋυ›óͩѵ@ɝǿóŌן̍ɛ˜óО̍œ̑̏ôȁ̍ŏòȁñóƦͩ@ǿə@ɛƧ̑˜ρȁυô̍օѹœóȃə™@ȂσʵѷƪòƩ̍—ôó߻ۯôʳƧ™óšõʵѵóѹɜ̍ȂѹôɛŌφֈƩͨρóυӑóޟఱ̑݇ͪóƪƨŌóȄڔԬƩςםñ̑ȃѵŐԭŏƨȁɛǿρôõɚɛóƧОə@ѹ̐ѵöԪͨôͪɛ̒ןŏƧƥóôƥƧɛŌôóɝó@̒݇Ӓ̒Ō@Ŏԭࢰ"],encodeOffsets:[[99540,43830]]}},{type:"Feature",id:"qing_hai",properties:{name:"青海",cp:[96.2402,35.4199],childNum:8},geometry:{type:"Polygon",coordinates:["@@ƨ@ôƪ݈ȁƪ˜@φɝòóƨԮʶɛ̐ѹͪôОəóƧɞᇒѶ@ôږô@ǿѶ›ƪȁςœɜͩφ˜ςŋɞôѶɛƨŌɞ—@ɚςŐñԪॢͩƨȂɞóƨŐ̎ŏעӏ̎óƧƦôœ̒ȁɜ›ςͩ̒œɚɛƨôƨɝφɛóȁƨŋóóɚͩƨóóƩ@ƧəŋƦƩ̍@ƧƧôǿυ̑@ȁɞǿõŏρƥסɚƧóτԫɞœôƧƦ@ñȃòñƥóυôôѹѵ—@ŏ̏Ȅɝó@ȂəŌóəѹƦ@Ő̍Ōυ݈ԩŐƧóôƧ̑›ôʵɞƧ̑ѵôƩɞƧ̑œóНѵóôʵ̑˜ɛȂó̍ƥȀƧŋ̑Ōóƪ@ƨó˜óŐƥ›ƦŎѷƨѵƧ̏Őɝóѵɜן@óòɛ@ѷʸס@ԩ̎υѺƨ̎óʸôƦɛœñ̎@Őɚ˜@̒əŌóŐ̎˜"],encodeOffsets:[[91890,36945]]}},{type:"Feature",id:"si_chuan",properties:{name:"四川",cp:[102.9199,30.1904],childNum:21},geometry:{type:"Polygon",coordinates:["@@ô˜ôŋó̑Ԯ̒ɛОמͪƨōöͫ߼ƥôȃƨóóñôƧóƧôōڔŏƨŐ@Ŏô˜òƥѺŎ@ōɜóנ˜ôǿô›ƦôԮ̍ɜôɚ›Ƨ—ñɛɚȁ̍Ƨɛևυ@óóôŋρԭɝ@Ƨʸ̍ŏυɜƧƧóƧƨȁρ̍ƨȃɚ—ôʵφóô̑̏Ȃ̑ʵɜʵɞ@ƨʳסƩóŎə—óɜƧôƩƧρ˜óôôô@ŎƧƨƨƪѹ˜ó̍̍Ʃ@̏ѹНôޟ̍Ʃóƪυɝɛ—əƨôŎɛȀ@Ȃ@ñɝʶ@Ōρנ̏—õóɛͨƨȂѵОɛʵ@̏ƩŐó߼Ƨల̍φɜȂυτɛОρƦɝƨóƪ̒Ѷɝƨóʶ̒œóƨƨôԪŏφ݇̎ŋ@ŏѺƥôɚɚŋ@ȁɞô̐ȃ@ŐѶ˜óѺφóƦôñòòȄ"],encodeOffsets:[[104220,34336]]}},{type:"Feature",id:"hei_long_jiang",properties:{name:"黑龙江",cp:[128.1445,48.5156],childNum:13},geometry:{type:"Polygon",coordinates:["@@ᇔȂਚНƨŐѶŏöƥςŏñƧƦóƨȁ@óƨ—óȁφӑóóƨ˜óǿ̎̑ôНɞ—ó̑ɜə߼›̎ǿ̒ôڒӑφ@Ƨȁ̎̏ƥƩ̎ρశ˜ôȂςƨφ@נɞ݈˜̑ƥƧɛƨʵƧȃƥ@Ƨƥ@ŏ̑ԩôɝρρóɛƧ›ƩͩƧó߻ʸ̍ʷѹƥɞڕõ̍öɝυ—̍ȂƧ̐̑ŏóƨñŋѹóóȁ̍›̏Ԭõʸ̏ŏ@ǿ̍@ƧОυ@ñƨòȀƥŎ̑ŐѵóɛŌóȂԫōƧŎѹñ̍ʶóОן@Ƨ̎Ѷô@Ȃ@™óŎó@@ó̍ƥԭք༄।ƨͩ̒ࡘς˜ñֈƦʴφͪ@ȂɜɜסԬə@Ƨə̑@Ƨóןô̏ŏ̍ô̑ؼôƨѵɚƧȁɝ@óŐρŎԪО̏ʴ"],encodeOffsets:[[124380,54630]]}},{type:"Feature",id:"gan_su",properties:{name:"甘肃",cp:[95.7129,40.166],childNum:14},geometry:{type:"Polygon",coordinates:["@@ڔôԮࢯ@ō̑ŋ݈ӑ@̑ɞôóôɜŋƦƨôóƨƦנŐɜ̑óͩԩͧѶõѺ̏ɚ@ƨНɜôöəςóɜȀƧȂԮŐѶŏ̒ȄמòƪρړԫôȃƧŋôƩ݈ͩɚ@@ǿɜ@φͩóŏɜӑƧōôǿ̎›ôƥƪóõ›ö@ô—ƨ˜ôƧƦôó̒ɜ@ɞŌõʶ̏Ő@ȀóôƨȂ@ʶע@@ƥ୾ӑó̑óŋôʵóɛړ@@ƩöóƩóρ—ɛƨ̑@óʷƥƥ̎ɛƧ›ôōƧǿôͩѵôɝȃɞȁõƧρóó—@ōƧŏړŐóŎôƨóƨôòƧôóȄ߻ƦõͬƧŎםͩɜНԭ̑ô̒óŌó—ƥ@óƨɝ›σԬƨôעəςƦöŐɝȀ@Ȃφ̒óȀƨƨ̎@ƥƪɚŌ@ƨôƪƧôəͪôôƧŌôȂυɜƧɞƧóəɜ̑›ρͪɛœ̑Ȃó›ƨƥ̍ôסӐ̍ŐƧŏɝôƧȁॡͪòԩρŏ@əɝ˜ƧŋѵɜɝóρŌυ—ɛͪρ›ƩȂѵœ@Ȁڕó@ȄɜʶφࡔڔœƨͪѶͪԬʶôƩעʶɚʶƥôóƨςȂ"],encodeOffsets:[[98730,43740]]}},{type:"Feature",id:"yun_nan",properties:{name:"云南",cp:[101.8652,25.1807],childNum:16},geometry:{type:"Polygon",coordinates:["@@ôɞôɝ̒öôŌƧƨôͪôô@ŋƦ›@ʶƨŐô߻ƪŏ@̐ɜʶѶНƧȁɜͧöô̐˜ςן@ŋɞʵ@ò@ȁɜǿóōɚƧɜ˜φɞôƩ̎ƪóޠѺО@̐̎ƪô̎Ѻ—ƧƩƨƧ@ōóóôóς—ƪƨƨóôɛó̑ԭ—ƥŌɛǿɝƨɛͩô›@ǿƨȁѺŌɚɛ̍ןѶНɛƧôóƥȁƦͩôŎɞ—ƨ̑ɜ—òôφ@ƨʵ@ɛѹōóȃəƨυǿóʵρƧƧŌƩɛ̏ȄñƧƧȀɝ̍ԩʶƧ̑υ—óŌƥʳɚӑóНƥô̑›óӒѵʵѹœƧӐןôƪφõŌƪ̒ԫŌƧؼƨƨס›ρȁƧœƨȂóʶó@@ʴƨôôφ̎Ŏ@Ȁƨ—ƪɚƨœóƨôôôςóޤƧŌƩŋƧԪ"],encodeOffsets:[[100530,28800]]}},{type:"Feature",id:"guang_xi",properties:{name:"广西",cp:[108.2813,23.6426],childNum:14},geometry:{type:"Polygon",coordinates:["@@ƦŋѺ̎ڔʵƨŐ@ƦמȄƪôóȂɜŌɚͩɜ@öóɜôôȂƦôɜȁ@ɞφ›óȄ̎›ƨʶɞŋƨʴɚǿ̐̎Ԭ@ôñ@̏ƨ›ρ۫ô›ɚƨƨНƪŐ̎›ƥóƦʵƥŋ@ȃóƥƧ@@ŏɝǿôυƧȁѵɛ@əóŏ̑@@ə̍›óƧó—@ȁƩ˜ρóòНƥô@Ӓ̑@óŎ̍ƥσŎυ@̍ƨ@Ō̑ôóͪƨ̒óŌړœ̏Ŏ@ŌôȄѺŎ@ɜƧʶυ@ñóɛ˜Ƨ̒ɝ˜óōƥͪ"],encodeOffsets:[[107011,25335]]}},{type:"Feature",id:"hu_nan",properties:{name:"湖南",cp:[111.5332,27.3779],childNum:14},geometry:{type:"Polygon",coordinates:["@@@քɜОƨ@öŐמóƪôƩɚ̒Ő߼ȁςͩɜòƪ—ɜȀò—ñɝò—Ѻͪ@ŏƨŋóɝôǿƨ™ɚȃóəƨȃѵͩó̍@ȃƨóóƥƨƧ@ʵƦ›óͩɜ—ɛóñԭɛōυȂ̍ƧƦō@ɛƥ—ɛȀ̑œóʷóō̍œƩŏƧОəƧóœς۬Ƨœ@̐óòԫ@̏̍əȀƧʳɝŌóɞƧ˜ƨɜóŐƨò@ȄƧŌρŋóôԪОóʶ@̎óȄ"],encodeOffsets:[[111870,29161]]}},{type:"Feature",id:"shan_xi_1",properties:{name:"陕西",cp:[109.5996,35.6396],childNum:10},geometry:{type:"Polygon",coordinates:["@@ςôöƨɝȂɞȄѶóóͪƨȀóŎƨœ̍ɜƦƦôʸ̒@ɜƧς˜ƪôõô@ƪڔ@ôɜóʶôŌô̒୽Ӓ@Ʀ@Ѻ̎ɜѺɛѶôöʶô™ƨšóʴ߼۰óô̎˜ñƪѸƩτʶ@ȁòŋəѹóǿ̑ʵ@ȁ̒ʷυփô݉ôН̏ط@ȁƨóô̏ƪõ@ʳ̐ʵ@ɝɛŋƩŌɛóןôƧŋ̒ó@ŏ̐ƥ@ŏυ@ƧƧôן̏@ƥȂѹɜəœɛóԭ̎ƥóóœóȀן—ɛô@ŎѹōñƦ"],encodeOffsets:[[108001,33705]]}},{type:"Feature",id:"guang_dong",properties:{name:"广东",cp:[113.4668,22.8076],childNum:21},geometry:{type:"Polygon",coordinates:["@@@Ȃô˜ôƨ̎œ@ɚ̒@ôŐ@ɚѶɜƨȂóφɞȀ@Őƨ@ôƦ@ȄƦŌƥʶƦôôŎôʸ̒›ɜǿƦ˜@ɜƥŎ̎ƨφȁɜŎòƥԮŎƨōóŏɛƧɝəɞƧ߼ɜςȃñȄƦŎ̒ōôòƨəƨ˜ɚН@əƨ̏ƪʵυŌəɛóəԭŏəœóŏѹœρʵɝƦ̏™ƥʳѶ›öō̑óóŋρȀυƧƥɛѹōƧôן—ɛŏѵ@óŋôʵɝ›ƪԩõ@Ƨō̍@Ƨ@@ƦɝԮƪО@@","@@X¯aWĀ„@l"],encodeOffsets:[[112411,21916],[116325,22697]]}},{type:"Feature",id:"ji_lin",properties:{name:"吉林",cp:[126.4746,43.5938],childNum:9},geometry:{type:"Polygon",coordinates:["@@נ@ôН̎ʵѺòƨōԬŎôȁɜŋѶô̒ŏƦōñǿòƧφ@ƨН̎@@Ȁ̐Őöʷ̐ԫ̎œôȂѺôòŌôƧ̒Őƨ̏̎ȁφ˜@ŋƩͩםȃƨ—@ȁ̑ʶ@Ōóôɛœƥѹ̑—συ݇@ɜρƧȃࢯƨôœəȂɛōƩɛ̏υρóõœƪʴυφ@ʶôŌóœρք@ɜƧ@ɝǿƧͪρȀƩó̏ŐƨȂ̍غړȃɛԮƨͪ̏ςƩœôɚφȁƦôɜƧôʶφȄ"],encodeOffsets:[[126181,47341]]}},{type:"Feature",id:"he_bei",properties:{name:"河北",cp:[115.4004,37.9688],childNum:11},geometry:{type:"MultiPolygon",coordinates:[["@@Ʃ̒̏ŌѺ̒Ʃ˜óȄƧŌƥͪòôñȂ̎ŐóȂ̒̐̎›ôНɜ—נ̎ôŋɞȀѶ@ôͪφœƨŌɚœɜȃóƧƨƥƪ˜@ʳƩ›ɞρ݈@υНφʵɜ˜ƦρƨƧ̍ɝóɛѹ̍ρŏ̑ôóƨ@œƧƦôƨɛ@ƥƨ@ȂƦ@@ôəŐƧʶƨŌυœ̍̎ɛŋôōɝ@óƧ̍›ƦʵѵʳôʵɜŏςôƪŋƨŌɚ@ôНƥƧ@ōѸɛ̐ô̎ʵѵНԭ@̍̍Ƨò@ȁɝ@əρυͩƪ̏ƩõƧŎƧōóšॡȄɛʶɜȀ@ɞςѶƧœƥςɛŐ@ɚɜɜ@Ŏôôςœƪς"],["@@õə@Ƨɛ˜@ŐóƦφô"]],encodeOffsets:[[[117271,40455]],[[120061,41040]]]}},{type:"Feature",id:"hu_bei",properties:{name:"湖北",cp:[112.2363,31.1572],childNum:17},geometry:{type:"Polygon",coordinates:["@@ñȄυƦöŐƩ˜óנƨƨφ@@Ő̏Ʀ@Ő̑ôƨŌנóɜôƪŋɜŌѶօڔə݈òɞōɜŎôӏƦóƨô̒óôȃƨó̎ŐôƧƪ@ƨȁςƧə̑̎Н@̍Ƨŏρôԭͩԫ—̍ʵƧšóȀôɞƧŌ@Őѹͩñ˜òɞñ˜ɛǿƩ˜ɛñρͪ߻Ȃ̑ŏƪəƩóםôõŏƧ@ɛНƥȄó›̑ѺƧ›ôφóƨƨƦƪóɜŐôóòôƨóφ̐ƨóƦ̎"],encodeOffsets:[[112860,31905]]}},{type:"Feature",id:"gui_zhou",properties:{name:"贵州",cp:[106.6113,26.9385],childNum:9},geometry:{type:"Polygon",coordinates:["@@ɜȀƦŋԮ˜ô̒ɚ˜ôōעƪƧʴɝ@ɛʶ̒ʶ̐ȁƦœóȂô@ôŏ@ōô—ƨʶѸô@ʶƨ˜ɞó@ōτöòυƨ@@əƨô@ɛ̒@Ʀɜôȃ@̍ôʵԩНôóςŌƨŋ@ȃƧñôŏƧɛƨ—ôɝƧʵ̍œôȃυœ@ɝɛȂƥóóȁɛóõôɛ@əͪɛŋôȁƩóםȃ@ƥƧŏړʶѹ̍ƥŌƦȂóôɜƨѵО̎נəɜѹŋƧȂ@ȀóœɜͪɞƧ"],encodeOffsets:[[106651,27901]]}},{type:"Feature",id:"shan_dong",properties:{name:"山东",cp:[118.7402,36.4307],childNum:17},geometry:{type:"Polygon",coordinates:["@@Ʃ̐φͪɚςɞ@@Ȃƨñ̎̎Ԯ@ѶОƨƧڔ@φН̑ŋ@Ʃ̒ǿ̎@ƨɜԬςôʶ̐ʶöԫƨƧנƥɜŎôō̎@ôŏóρƧŏԫôóƧԩó@ƥɜƧԭóƨʵɛƨ߻ӑɜНԩ˜óô̑óƧʳə™óɛƧ@õȀƧœ̍ȃɛŐóŏυО̍—óɝƩ—ԩ@ƧɚԫȄɚʶƨ˜ɞʶԪ̐ړɛƪ̒"],encodeOffsets:[[118261,37036]]}},{type:"Feature",id:"jiang_xi",properties:{name:"江西",cp:[116.0156,27.29],childNum:11},geometry:{type:"Polygon",coordinates:["@@ƧȄôɚəȄ̎ʶԬ˜ԮͪςóƨŐƪ›τɞƦōƥƧ@ŏςôóŐôô̒ʷѶ—ƪƩƩǿ@ō̒ɛôυ@—Ƨȁѹɛəƨѹ̑ƨ̏óƥѵʷô̍ɛȁôŏɝǿƧԫƧ›ôʳƥōòȃρȄ߻ɛɝƨɞɚɜƨôŐƧŎԭōñƦòԮɜôɛ˜ôͪƥœ@ʶƧƨôƦƧô@Ȅô̎Ѷͪ"],encodeOffsets:[[117e3,29025]]}},{type:"Feature",id:"he_nan",properties:{name:"河南",cp:[113.4668,33.8818],childNum:17},geometry:{type:"Polygon",coordinates:["@@φ˜̎ƪ̐˜ɞȄɚ@@Ȃעó̎ŌѺ̒ôֆॢȃô™ƨŎƨōƪöƩ̑ڔɜԩ̏ɝʵƧ—əʵԬȃƨəԪ@@Ƨ̒ŏô̍υȁƧɚ̍ôóŋ@ɝƧŋõ̑σ—@ŏɜŋôɝ̒ƧɚôôطρóóɛƩ@óƨ̍ŏƧôóȄ̑ôƧóƥôóӐɛōɝŎ݇ñړɚѵֆ@ɞ̏ʶ@ʴƩöó̐"],encodeOffsets:[[113040,35416]]}},{type:"Feature",id:"liao_ning",properties:{name:"辽宁",cp:[122.3438,41.0889],childNum:14},geometry:{type:"Polygon",coordinates:["@@ƨʴƧôôӔƨô̎ƩɞН̎ͪ߼ͪɜ—ɞɚ̐—@ƨςŏ̒ôƦƨɜœô̎ƪôςǿƨͩɞȀƨ@@ɛςփô›óŋ@ʵφυƩʳö›॥փρѹס@əɛ@ͩࢯ@ѹʵρ—ƩʶφȀƧ݈̒۬óʸɝŎѵ@ԭԫןɛƧƨƥςɛ—υʶφО"],encodeOffsets:[[122131,42301]]}},{type:"Feature",id:"shan_xi_2",properties:{name:"山西",cp:[112.4121,37.6611],childNum:11},geometry:{type:"Polygon",coordinates:["@@ɚѺñŌɚšôȄѺ›̎ֆφóςȂ̒—ɜƨɚ@@Ȁƨŋôȃƪ—ѹ̑̐ŋƪ̑Ʃρρ›óó@ōɛɛ@əɜŏƦρƨ›ρѵ@ɝɛǿɜʵóօѹ̑̍ŋסô@ȁə@ɝȃ̏—̍Ʃυ—Ƨô@Ȃ̐ظóОó݊φք̑ʸ@Ȃ̒ʶôȀ"],encodeOffsets:[[113581,39645]]}},{type:"Feature",id:"an_hui",properties:{name:"安徽",cp:[117.2461,32.0361],childNum:17},geometry:{type:"Polygon",coordinates:["@@ó̎̑Ő@ƨƪ˜Ѷǿɜ̑φ—Ʀʵ̐˜Ƨѵôóƪôôυς—ƨȂɞŏ@̍ԫôò̑ƥ—óȃѶͩƧƥôŏѺœôŏƦ—@›ƥͩƧ—ôȁυó@̑ƧɛѵʵƩƪѵ˜̑ʸóóôŏρó@ŐƦƨƥŎσɝƩœ@̎̍Оɚ̒ρƨƧȂôɜςôóظəó̑ƨóɞɛŌ@Őτ˜ö̒ƨŌ@ɞôŌ̎óƨəφȂ"],encodeOffsets:[[119431,34741]]}},{type:"Feature",id:"fu_jian",properties:{name:"福建",cp:[118.3008,25.9277],childNum:9},geometry:{type:"Polygon",coordinates:["@@̎›óȁƨӑ̒—̎ɚƨͩφŐƨɝ̎ŋóŏρ—@ōƨ›òʳəóƨō̏˜õɛƧ@ƨѵƧōəŏóŋƧô̑ɝɛʳƥ@@óɛõ@Ƨ̑ƧóȁəƧ̑—Ƨ̐@ɚəОƧ—Ƨɚóñ̑ŎóʴƨœƨԬɞȀóŐɜȂó̎ѶʸôƦƧ̐Ѻ̒ɚƧѺɜƨȂ"],encodeOffsets:[[121321,28981]]}},{type:"Feature",id:"zhe_jiang",properties:{name:"浙江",cp:[120.498,29.0918],childNum:11},geometry:{type:"Polygon",coordinates:["@@Ѷʶƨɜ@̒φôóȂƨ˜Ʀͪ@œ̐˜Ѹ̍τȂ̒̑נŐמôƪƧôӑ̑›@ƥρͩƨօ̏@@υɝó@ŋɛ@ôƩəóƧѵυó@ƩɜŋƧ@̍ŌƧɞυŏƧͪ̍ə̑˜ƧӒôȂ̍œ@˜óφ̑ɜ@ŎƪȀ"],encodeOffsets:[[121051,30105]]}},{type:"Feature",id:"jiang_su",properties:{name:"江苏",cp:[120.0586,32.915],childNum:13},geometry:{type:"Polygon",coordinates:["@@ôɞ̎˜φНôŐɜŏ̎Ȅƨ›öǿƨ@ôɜɚšƨʴ̒ôôó@Ƨ̎əԮȃԪૉöͩ̐ƧòʵφƧôʵ@óړɜóŏɜǿƧ›ɝρσȁѷ̎̏—ƥ˜óŐѹ›óŐƨƦѵͪôȄƦ˜ñ̒Ԭó@̎ɝŐƧȁρ˜óφƩóóôƨѶ̏—ƥʶυ˜ɛ̒ѵȀ"],encodeOffsets:[[119161,35460]]}},{type:"Feature",id:"chong_qing",properties:{name:"重庆",cp:[107.7539,30.1904],childNum:40},geometry:{type:"Polygon",coordinates:["@@əȂòɜƨ˜ѺɛƦȁ̐@ƪ—õŏφƥòȃƥ̍Ƨôυ̏ƧôñóóôɛŏƩôƧƥôƧóυƨœ̒ѹôœƦȃ@փƥɛ̑@@ɜƧó@ɚƧ@ñφσõ@ŎɝôƧ—@ʵѷóƧʵó˜@ŎóŐó@ôȁƥ›ó̒υôóʶə˜ƧȄς̎ƧȂôƨƨƨφɛ̎Őƨʷɞ@ςԮóŌôôφ@ɜֈ̎ƨ"],encodeOffsets:[[111150,32446]]}},{type:"Feature",id:"ning_xia",properties:{name:"宁夏",cp:[105.9961,37.3096],childNum:5},geometry:{type:"Polygon",coordinates:["@@ల̒ôޠφӒςôƪͧυևɜŋѺó̎ȁ̍ɛ@ѹס@@ʵƧȁôó@ǿ̐ŏöʵɝŋɛ@ô̑ƥóóƨƧ—ó˜ôœó@ƩôóƦ̍œóȀƨŎɛӒôŐυͪɛ@@Ȁə@"],encodeOffsets:[[106831,38340]]}},{type:"Feature",id:"hai_nan",properties:{name:"海南",cp:[109.9512,19.2041],childNum:18},geometry:{type:"Polygon",coordinates:["@@φɜƦʶ̐ôφô̎@ƨŎö@τʵƦ˜ԩ۫õН̏óƥȃƧ@Ʃəםƨ̑Ʀ@ޤ"],encodeOffsets:[[111240,19846]]}},{type:"Feature",id:"tai_wan",properties:{name:"台湾",cp:[121.0254,23.5986],childNum:1},geometry:{type:"Polygon",coordinates:["@@ô—ƩɝöƧɝѵəޣ̏ρƩԭóōóͪρɞƧОôԪ݈ଦѶɜ̒ɛ"],encodeOffsets:[[124831,25650]]}},{type:"Feature",id:"bei_jing",properties:{name:"北京",cp:[116.4551,40.2539],childNum:19},geometry:{type:"Polygon",coordinates:["@@óóó›υóôƥ@ŏóóə@ƧŋƩŌρóɛŐóʶѶʴƥʶ̎œôƨɞ@óŎɜŌ̎̍φ›Ƨŋƨʵ"],encodeOffsets:[[120241,41176]]}},{type:"Feature",id:"tian_jin",properties:{name:"天津",cp:[117.4219,39.4189],childNum:18},geometry:{type:"Polygon",coordinates:["@@ôôɜ—@ƨöɚôœôôɚŏ@óƥ@@ȁƦƧɜ@óƧƨƥ@›ƧóəН̏óѷɜ@ŎƦƨóО"],encodeOffsets:[[119610,40545]]}},{type:"Feature",id:"shang_hai",properties:{name:"上海",cp:[121.4648,31.2891],childNum:19},geometry:{type:"Polygon",coordinates:["@@ɞςƨœɛȀôŐڔɛóυô̍ןŏ̑̒"],encodeOffsets:[[123840,31771]]}},{type:"Feature",id:"xiang_gang",properties:{name:"香港",cp:[114.2578,22.3242],childNum:1},geometry:{type:"Polygon",coordinates:["@@óɛƩ@ρ@óœôȀɚŎƨ@ö@@ōƨ@"],encodeOffsets:[[117361,22950]]}},{type:"Feature",id:"ao_men",properties:{name:"澳门",cp:[113.5547,22.1484],childNum:1},geometry:{type:"Polygon",coordinates:["@@X¯aWĀ„@l"],encodeOffsets:[[116325,22697]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/chong_qing_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"500242",properties:{name:"酉阳土家族苗族自治县",cp:[108.8196,28.8666],childNum:1},geometry:{type:"Polygon",coordinates:["@@XJ°œlJX@lbl@XbV@VLnJlxnbšƒUU@IVK@lVIVwnJlU@n@J@L@Jn@l_nWVLVln@@blLšmV@@xœÔ‚`nœ™xV‚ÈLlx„LVxVVšƒV_U»VWn_m¥XwVmnX°ƒlmUUVwÞaVƒk@a@mmIUa@™mwk@™ƒm@@U¯a@UV@@K™@ykkmwkV@kU@ƒÑƒVkKWLÅamaUm@kyU@WkU@Ua™IUašVaUUmUUa@aVLXKWa¯UUbmJXnWnX`l@@xkzWÆ@V„LU¦‚x@b@JkIkJ@LmbUamJwm@óxƒnk@V„@x„ŽVnUVmVUVŽUbVlUbkXWŽ"],encodeOffsets:[[110914,29695]]}},{type:"Feature",id:"500236",properties:{name:"奉节县",cp:[109.3909,30.9265],childNum:1},geometry:{type:"Polygon",coordinates:["@@WVXb‚UnK@x@b‚²kxmKkl¯_ƒVV°™VU@bnKVVV@@nkŽ@n›bn‚@š°@VLČUš@°WV@V™nU@InKVl@nU„b˜KnX„WlknLlKUwnalLša„VlUXmWk@UU@UWWIUyķ¹XaWW@X™ƒKUIVm„U@W@UVU@KV@n»VkUkÇmUmVIUmULUbm@ƒwUaƒKkkm¯ÑUL@bWVnx@VmxUI@„klmkkK@aƒK@IlJ@I¯ƒk@mak@mnkJVL@bV@Ub„„W`UUUV™I@VƒU@VVbUJVLUVVbUX„VVxk¦VJUnVxnVVUšJV@Ubl@@bXV@L"],encodeOffsets:[[111781,31658]]}},{type:"Feature",id:"500238",properties:{name:"巫溪县",cp:[109.3359,31.4813],childNum:1},geometry:{type:"Polygon",coordinates:["@@nLWbX‚VLVU„V@KšIVl@b„@lbšU„VnU@JÆU@V@n°KĢUl@VbÞKšVš@„_„V‚KXU‚U@KXƒ@wlkkU@mWKUU@UôJ@XV@œaVmÞIVaVLƒƒ@»kmƒ@ƒUkL™U@aU@WWƒLUUU™™KkbƒwWa@KU@kaƒXmW—LƒamVk@UmL@JmVUšU@¯X™@ċVUK¯@ÅnWK™LkKULWK@UXK@wW@™LkV@bVLƒlXn›`¯xU„°LnŽlV@n°Lnl"],encodeOffsets:[[111488,32361]]}},{type:"Feature",id:"500234",properties:{name:"开县",cp:[108.4131,31.2561],childNum:1},geometry:{type:"Polygon",coordinates:["@@n@na‚I„wš@@VVK„LVbVxnVÆUnanKWXamKmk¯K@mkUm¯KVƒ°w@Wm@UIUUlKUU@a¯KWanwmUXamKkUWUnU@KƒkUwWKXaWLUWkImaUUUƒƒKka±k@lƒ¯w™wmbUƒ™ƒkXm@UJkIW‚XXƒbƒmƒ„UJ™XUV@°šKlšlVXV@xmbnV@blV@VšœU`UL@V™a@bULlb°VXbܚ@V@bƒL@J„xnLVb@lVb@V@@z˜bXWšX„KVLV‚š@@bUVVL@b„„lVna@ll@„zl@@J"],encodeOffsets:[[111150,32434]]}},{type:"Feature",id:"500243",properties:{name:"彭水苗族土家族自治县",cp:[108.2043,29.3994],childNum:1},geometry:{type:"Polygon",coordinates:["@@„Jlb@nVV@bXb@ÆlL„Ul`nVKU¼VxkbW„nlUxlXX‚@°°WnnJ@VUn@J„k°L@VlV@nUJ„x@bVVVz@VnLla„KnalVlIUŽ„¼@nV@@anKUwVal@UlJœƒlI@akU@UWXKVI‚¯Uak@@KmkXWÜkXWykIWwXw@laXamkVUUym_XmlkkmmakwmIUKU@Wak@kaW@kI¯›WIk¦VŽƒUUƒmaUV@XkVUV±aUb¯b¯¥m@@ImJ—@mƒmL@kUKUkkJƒbV¦"],encodeOffsets:[[110408,29729]]}},{type:"Feature",id:"500235",properties:{name:"云阳县",cp:[108.8306,31.0089],childNum:1},geometry:{type:"Polygon",coordinates:["@@lb„LV„VVnblJVXXKWbXLVx„l@LmVXVVl‚nLWbnVmxXb°L@bVVkLVVVJn@@X‚‚œ_Wm„kUK@alUšKX@@xWL@VXLVKlLšKXLÆm@™mœa@ml@mU@UUmL@aVšUU¯„U°`lknLlw±@a@wmLVWaXU@KWU@ak@VaU@™IUVmUUwVmUIl¥UwƒUVWUaVUUKVIUa@UUUUJƒUUm™kƒ„nl@„@VWV@L¯aUb™Ulxƒ@@b@VULUx@VUxVV™U@bU@mxU„U@mUVŽklkkƒ@WxknlxK@amLƒKU„K"],encodeOffsets:[[111016,31742]]}},{type:"Feature",id:"500101",properties:{name:"万州区",cp:[108.3911,30.6958],childNum:1},geometry:{type:"Polygon",coordinates:["@@ĸĊVI„ƒ„n„aWWXlJVIn@lWš„V„našx°xk„l@²Ž‚LVƒ„LnK@b‚LkwlmXw„@lllkUnVV@VƒnwV@@ašVUUVw@UVwVK@U@a„@kwšVVa°b@KXU@U@ƒmk„ƒÇсaml™kUVmn@VULU˜m@kUVkUaƒwUWm@Uw¯„mKUUmVUUULUKU„W@XbWVkaWwkUU™ƒ™k@maUbmbVlk¦ƒxUVUIWVU„kJVVkL@UmJ™UUVU@lLUVU„lx„@@VbƒJ™U™L¯¤@Vƒ„"],encodeOffsets:[[110464,31551]]}},{type:"Feature",id:"500229",properties:{name:"城口县",cp:[108.7756,31.9098],childNum:1},geometry:{type:"Polygon",coordinates:["@@VK@w¯L@m@UÅV@ImVƒU™Vkaƒ@@aUk™J@LƒUUVUKmLmbÅVmUUwUaƒKUL@U™@ƒxJmbm@nVJ@X@VkV‚n™lƒLXx™@ƒb@bUVƒLU`UnƒbU@@ŽmVVX@JX@VLVVšklV—„‚`@bUL@V„LVKn@‚U@„UJkn@lmLmK@X@Jn@mb„nÞWVXnJ‚k„KČÑÆ@VK@knaÜmXlUČW°kôÇƁ@a@yÞ_VmƒUnU@K"],encodeOffsets:[[111893,32513]]}},{type:"Feature",id:"500116",properties:{name:"江津区",cp:[106.2158,28.9874],childNum:1},geometry:{type:"Polygon",coordinates:["@@„InWUUlU@LVašlX@°²lÒXxlK@Ul@@Un@UaVJ@I@W@UƒUUVUwVIUKUa‚UUVwn@Üx@XUlnn‚bœJ@¥VklKUUlk@ynU@kVƒUUVWnI@¥V£VWVIUKU@UVƒa@n@Vm@@nlUaVkUwƒJ@blLkLW@XWmXkmmLn™@m@U@UVm@™„UVUUlakUVa„ƒVkV@@wnaWUk@VwkƒlmVIkUUxmJ@U„™@KƒIkx±V@IUm@K@IUKkbWKUbn„m„@bmVnbmb@xkxUJ@ULW`@bX@WVXL@Vƒš¯„mk¯@UJ@VmLUaWnX@WJ@nkKkxW@UIV@@KkImmkK@UW@XaWIU@U‚ƒIkbWb„xXŽlLVbnV@bWlX@VxVLnl@nÆÞVÜ"],encodeOffsets:[[108585,30032]]}},{type:"Feature",id:"500240",properties:{name:"石柱土家族自治县",cp:[108.2813,30.1025],childNum:1},geometry:{type:"Polygon",coordinates:["@@„š@kl@š¼UbmVXJ@bV@nxVIVJULVVk@@LWbnJVU@bVbUJ@blLXnWV—@mbnV‚@V„„bn@VJVLnaVanbl@„šVšlVXxlbXUWaX@VƒUUVwUUVm@I@WmI@a„mlLœ™lK@alwnUV@kóVaƒÝk@UlbVK@™VU»VUUVWUƒ@U`ULkwm@@KmU@knKƒ»VkJkUmbƒLkbmK@UUyUU@aƒwm@@XXJ@VVLVVUbVnUJVX@K„„k`WXXJWXUbmW@bkL™Um`Xnƒb@JVL@LU@™°VVXKVnUxVLUbmJ"],encodeOffsets:[[110588,30769]]}},{type:"Feature",id:"500237",properties:{name:"巫山县",cp:[109.8853,31.1188],childNum:1},geometry:{type:"Polygon",coordinates:["@@kVƒU™bkKmbVxkLmKkllbV@@LXb„xlašLVšVV„KXXV@@bšVlK„V„@ln@¼°KXa„U@Ulw°JXalIUa„ÝWXW@kVU@ƒVUVWUUUamUw@aVamwn@VUUƒlLXWm£@wÇĉkKklmLUÒ¯ƒWn™@ğ±kwmaWm¼U@@LUV@V@XƒVUnVJ„LWš@‚XXWbĸºVzXJVXV@@VXlWn"],encodeOffsets:[[112399,31917]]}},{type:"Feature",id:"500102",properties:{name:"涪陵区",cp:[107.3364,29.6796],childNum:1},geometry:{type:"Polygon",coordinates:["@@nèVblĖVVnLšŽ„@šx‚V„n@nšJ@L„UVVX@lbUJV@@nn@VVVK@z„˜V@nzVJVUlmX@@_VVVbnaVal@@knW@wnaƒVK@aVI„J@£kUVW@‚wXUVJ„amƒ@Ikƒƒƒƒ_X¥ƒ@WwkKkwmŽ™šƒkUxƒnÅmm¥™WV@Um@UlVL@JU@@Xƒ@UVkKVk™KVk™Kkb@bmJVXU„VVUbU@@`W_UV¯b"],encodeOffsets:[[109508,30207]]}},{type:"Feature",id:"500230",properties:{name:"丰都县",cp:[107.8418,29.9048],childNum:1},geometry:{type:"Polygon",coordinates:["@@Þè@XUK@LlV@blbUJ@„„V@bnV‚@VVVXU@ƒlbXal@VXnKV@maXUރ@amk@aVKXV‚anbš£°mnIVaUKVwUmWLUUš¯V@@KUK@I„aWmn_šVlK@anXVaXWWIXWl_ƒƒ@LUWVIUmVaUUUK@UWI@Wn@VI@mkU@U¯Kƒl@ImVÅLƒwU¤óbUU@wWXkmm@LU@@VUIWVUL@JUnƒaƒx@Jn„ƒbUIWVx@ŽUXlV@¤ƒIUJ@bUL„Žmb@xmX@lk@UbmbUaUU@`W@kn"],encodeOffsets:[[110048,30713]]}},{type:"Feature",id:"500232",properties:{name:"武隆县",cp:[107.655,29.35],childNum:1},geometry:{type:"Polygon",coordinates:["@@l„„w„bVm@IVKXUVJ@UV@@KnnWlX@xVVôaV£„xÆKnUVm@UmIXm¯¯@WkWVwmkXƒlaUwV»ULmk_ƒVkK@ÅWa@aUU@mkaƒIƒb@‚n¼ƒnm‚_@mmK@UƒLUVVmI@aUJ@XWJ@U`UIkm±kk@@lULmUmKUnVšnlUVmI@VkVlx™bkIƒVmLUxkKUŽ‚Xš‚n¦Æn„mVw„lš™nlxlLXx„@W¦„`„„"],encodeOffsets:[[110262,30291]]}},{type:"Feature",id:"500119",properties:{name:"南川区",cp:[107.1716,29.1302],childNum:1},geometry:{type:"Polygon",coordinates:["@@VšUbVJVUn@VLX@WVXVVI@VUVWxU@mš@ĊX@@¼V°aVUX`@_V@VaUUVƒUWnI@alašLUlšLUllLVU„@@WV@@IUKVkn@@VlLVwnK„UlJšakwlU@UnJVUmkU™VmXa@wVK@UUw™@VƒVI@akƒ@alInwlKXUmaUW@wWLk™™KVak_ÇaUƒƒV@šXbƒLVxUlWIk@UK@V™@ƒkU@VbUVUlVnƒLUV@lVXmxkV@L@V@Vk@WbUwmL@JUI@xVxkx"],encodeOffsets:[[109463,29830]]}},{type:"Feature",id:"500241",properties:{name:"秀山土家族苗族自治县",cp:[109.0173,28.5205],childNum:1},geometry:{type:"Polygon",coordinates:["@@XlV@lzn@VŽnbÆbXKlL„U„ÒV@@llUnxll@zšŽ@LU@@V°b@Vn@š„l@VÑUƒnK@UšU@aUaƒkVm@K¯wƒklmnn„Ul`nI@almkIUwmWVkUaƒkkJmUUa@K@aU@@_m@@wUyVUUa@Umƒ@awl@Wka±„UkUykIWV™b@bUVk@›aU@UXU‚UIWakUWmUxUV@nUVWbšŽ@XXVVŽmXXŽ@VƒbVLkVWx"],encodeOffsets:[[111330,29183]]}},{type:"Feature",id:"500114",properties:{name:"黔江区",cp:[108.7207,29.4708],childNum:1},geometry:{type:"Polygon",coordinates:["@@VX@V@LV@VJUL@lVnnxlb@VXV‚XV@@W„@UIVK@kUKna@£VWUaVUUalIVJVIUW„_lm@bXKV@mn@J„UUw@KnIVll@VanLVmUkVKXLVKUIVamw@UaU_lw„KlwUWV_Ua@aUa@KUšwm›_›Ó@wU@™nkK@am@UkUKmXk`m@@I@K@I@mkVmIUxUJ@kUL@JVV™„lnklWnn`VzUVnlWbkb@WxXxlJXzWŽÛlWXnl@Ll@Vb°UJWLX@VlV@bkJ"],encodeOffsets:[[111106,30420]]}},{type:"Feature",id:"500117",properties:{name:"合川区",cp:[106.3257,30.108],childNum:1},geometry:{type:"Polygon",coordinates:["@@XKVXlK„ƒVL@UnV@aValXXK„U@WVwUaVU@IV@@aVW„L@U@anVV@@bVK@UVL@bnJWL@VnUnb˜@@JnIlVl‚@@bXIWbn@UKVLVKXLlaV@VVnK@bVL„m„IVƒ@KmknUUWVI@aVJ@_„WU_VmUwƒU@K™ƒVak@am¯mJU_UJUkU@WkIV`UI@JV@LmmU@@mƒbUzś™@„VK@nUKƒ„ƒb™akb@UWK@bkVVbV„Û@@`ƒXk@WŽ@n@lXL@bmb@VVJUn@JnUlnUlmX@`XLlbkJW@kzlb@`@b@b"],encodeOffsets:[[108529,31101]]}},{type:"Feature",id:"500222",properties:{name:"綦江县",cp:[106.6553,28.8171],childNum:1},geometry:{type:"Polygon",coordinates:["@@@¦‚@X„lVX@@UVKl„VUX@lanVlUVbXWVXVƒ„VVUnKVUlwUwU@UJ@nmVkUV™lwXam@VaUUUw@W@kk»mV@UmKkwVKVUU@@LUKVI@mV@XVWxnXVKUUUK@wWU@UUWnUlLXa‚mUI„am@wI@K@amIm‚UUkI@m‚akUkKWUUanƒ@wƒamLVxk@UVmUUL@Vm@kV@I@ak@@bWVXJlLVbVL@š@bn@@`Un„@WbUKULWVXbƒ@UVmbX„WVƒb@bVmxUKUƒV@šUn@V@V@nmšnKlnnWWXX@lKkK@a„IVxUlVb‚k@mn@@U@m„bVUV@VLUJUXU¤"],encodeOffsets:[[109137,29779]]}},{type:"Feature",id:"500233",properties:{name:"忠县",cp:[107.8967,30.3223],childNum:1},geometry:{type:"Polygon",coordinates:["@@VLÞĊ„U@Wš@¼V‚„@lk@w²mlšVUœ„llšVnI@VlKUUlIVƒXUVJVU„wl¥UkUKUIm@ƒaUƒ@mUna˜@XUWmkK@aVIUa@aUVmIXa@Kl@UUVKUIUJmwU@@aWInUVa™»k@@lƒ™¯n™¤mabWUUL@bnl@b݄WVnbU@mLUWk@Wbka@„WVUU@UmUmVkUULV„lVUx„l@L@VƒbÈÒlb"],encodeOffsets:[[110239,31146]]}},{type:"Feature",id:"500228",properties:{name:"梁平县",cp:[107.7429,30.6519],childNum:1},geometry:{type:"Polygon",coordinates:["@@XLV@VV@b°°nšƒnkb@bƒšnJWVXblIUVšxWnUJnVVLVU„JlUnLVK@UnUVJš²nKVbVKla@aXlJ„k„Klb„ƒ@U°£šKšV„IUa@ƒ@kwVƒVUkKV@VUkk›ƒUVk™±n@xklƒ@U@»™‚@XƒVÝĉUJnxWb@UX›KkVUbUKWUkVmkkLU`›b"],encodeOffsets:[[109980,31247]]}},{type:"Feature",id:"500113",properties:{name:"巴南区",cp:[106.7322,29.4214],childNum:1},geometry:{type:"Polygon",coordinates:["@@nxnVlJlUXLƒ¦@x@Vl@nKVVX@V_V@@KlVXU„@lKlxXIl@ÈĊ@Vl@n_VJlŽnVlnb„²VVVJVVmUUkĕUamçU@»W@@ĉn™V@XwVU@UUJWUXUW@UKm@UVUIVaU™UVmLUVƒUU„UWWXUakVmUkbW@UVkƒUL@VW@kUWƒ@mJUXVVU„@lmV@zklVVkLUl@¦›I"],encodeOffsets:[[108990,30061]]}},{type:"Feature",id:"500223",properties:{name:"潼南县",cp:[105.7764,30.1135],childNum:1},geometry:{type:"Polygon",coordinates:["@@@a@a@_kalyX@lIkaWK@_nWVkkmmV@IVmUI@Una@aWK@k@mkbWaknmJUk@mk@@kUal@Uaš@Wa@aXLlwUKlkkƒ@KmI@VUJ@Lk@@VUUmL@amJU£kKUaWakLmU@bVVUbnbWV@xkL@bUb‚xUxVbXJVbUVWIUVU@kLWxkKWV@n¯VUbU@@VVX@VmaUL@VUK@VVbn@lVnI‚@@lnLULm@Ub@Žl@na„@lK@XVVkJ@b@zl@@VnV@bVb@J@bnXV`lXXmVI@W@InbV@@aVKUblKVLUanLlmnLlK"],encodeOffsets:[[108529,31101]]}},{type:"Feature",id:"500118",properties:{name:"永川区",cp:[105.8643,29.2566],childNum:1},geometry:{type:"Polygon",coordinates:["@@@b܄nWVLX„lxV„VxXxlVn@@bVblK@a@UnLVJV@@UnLVU@VXaVKVXš@n`WUÿ@IUKlaUUUkWyUÛÅÝ@mmkUKUwW@Xk@amUUakKWƒwXaƒK@VVLklƒXVlkxV„UL@bm@Vxn`ƒIVxUVkLVšUšl@@lkXmmƒVUn@VV@Xb"],encodeOffsets:[[108192,30038]]}},{type:"Feature",id:"500231",properties:{name:"垫江县",cp:[107.4573,30.2454],childNum:1},geometry:{type:"Polygon",coordinates:["@@šĊ°¤nҘ¼œaV_lKnllUXVVLValUœLVW‚@XamwVIUKkaÇфa@U@KƒkVwkUUƒVKlVnU@aƒU@ƒVIka@akU@KVL@WÝçUV@Vmbů@L™KƒnnJW„ƒVkxlL@VX@VxmnXVWxUb@bkn"],encodeOffsets:[[109812,30961]]}},{type:"Feature",id:"500112",properties:{name:"渝北区",cp:[106.7212,29.8499],childNum:1},geometry:{type:"Polygon",coordinates:["@@@bVVXL‚a@lnbWn@L„@XVlK@VVLUVlbkLUKVVVL@VšnX‚VL@VV@UbVb@x@¦UxVb@bUJƒL@L„VVxlK@™nk@U@W„UVLlKXV„@VblU@UUKVU@wn@VJVanLlkX@VaVK™¯@a@U@U@ƒVaUK„kUUƒ±maUkm@UUkbm@@Vk@@JƒwU@Ub@I@JmwUL@aƒ@@KkVÇLkƒWkƒ@kUU@@xUVmKUnllUb"],encodeOffsets:[[109013,30381]]}},{type:"Feature",id:"500115",properties:{name:"长寿区",cp:[107.1606,29.9762],childNum:1},geometry:{type:"Polygon",coordinates:["@@VVšU„bX‚lX„¥l@XnVmlxUx„@@blVnnôĀlm@aVaXwWUnmUwW@@UkKlw„UXƒmI„mšL@KÆ°na@UUImyU@ƒ—@yULUUm@@mU@VIkaW@UUƒV@K™I@mƒmU™wƒ@™mKUnU‚UIƒlVLUb@„@V@V@bš°ULUbW@klmKUbUIm@@xUVVL"],encodeOffsets:[[109429,30747]]}},{type:"Feature",id:"500225",properties:{name:"大足县",cp:[105.7544,29.6136],childNum:1},geometry:{type:"Polygon",coordinates:["@@XUmaVaUU@anVlKXbValU@aV@@IXKš@@bV@VxVK@UXLlUšJXa@_‚@@aVK—ÅWVkwWaƒƒwUa@am@kUWLU@kWmX@ykI@W@UV@na@LlLV@UƒkwWƒUKmXX`mIVl@bXLWVkbkkƒx@`VXm@@J@U@UUKUxk@WbUIVl@VXLW„ƒJUkUlUImxXlmb@X@VUJUnVbšW@UV@@VVX@bnW@LVxUnlJUV@n„@VxVIn@l`„UVVVL"],encodeOffsets:[[108270,30578]]}},{type:"Feature",id:"500224",properties:{name:"铜梁县",cp:[106.0291,29.8059],childNum:1},geometry:{type:"Polygon",coordinates:["@@VblLV¤nI@bnKVV@Ul@@KVI@UnJ@Ll„klVLkxWK@bXb™@Vbk@Vb@ll@@nVlnIlmXblaXl@„W@_Ü@UƒUalU@aXL@Vlašb„a„ƒVL@mUL@ƒUUƒƒÇXUW›X_WaƒƒUƒ»m_™@UWULWb@UUVmK@VU@UImK@V@bkL„x‚„XblxXU˜ÆUL@b@@`Wb™IkVWK@VULUwU@@a™@WL@JU@@bkVUb"],encodeOffsets:[[108316,30527]]}},{type:"Feature",id:"500226",properties:{name:"荣昌县",cp:[105.5127,29.4708],childNum:1},geometry:{type:"Polygon",coordinates:["@@VI@U@WnaWknwVJVkVl„IXƒWK@UUkVJXal@VwVL@V@V@In@UW@_„wlllaXUWK@aUknJW_ۃ@aWaU@@UVm„UUaUImJVnÅUmVUm`kUUVWLnVU@VVmXƒK@„nxmŽULkx™ImJ@nU`@X@Vkn@`@nlV@nVJVaX„VLnK@bVV@nV@lbXWš@"],encodeOffsets:[[108012,30392]]}},{type:"Feature",id:"500227",properties:{name:"璧山县",cp:[106.2048,29.5807],childNum:1},geometry:{type:"Polygon",coordinates:["@@XzVlVVkbVL@JVĀXŽ‚¼V„„„XbW`XœWVȎ„„VVšŽVkV@@UXa@alK@IƒƒU@UKWUyUI@wVUUWVak@VUkƒW¹@WXI@yVIUK@kWwkѯ±W@™kUb@KkVVVmXƒJ"],encodeOffsets:[[108585,30032]]}},{type:"Feature",id:"500109",properties:{name:"北碚区",cp:[106.5674,29.8883],childNum:1},geometry:{type:"Polygon",coordinates:["@@X‚VLV@„„@JkL@bWb@VU@UlƜVy„a@nV@nn@KU@IVJU_lJXV@VlVIV`nIn°@b‚lUbš„„KVI@aUaVw@¥@wUaVaU@@UUKW™m@UUKUUVLlKkaVUUK@UkLWUƒ@@KXmma@kbWKUU@aUamLnÞ@VWLk@@Wm@ULU@@U™KUVWI"],encodeOffsets:[[108855,30449]]}},{type:"Feature",id:"500110",properties:{name:"万盛区",cp:[106.908,28.9325],childNum:1},geometry:{type:"Polygon",coordinates:["@@VIV@@wVJ@InKVxXal@@U@U@KlUnwUW@kVU„KUmVkUa@I@KW@@bk@@mƒU@m@k@a@aƒIUxmJk@ƒwULƒwkKmVVX@VXV@xVLVVULmWXwWUU@@nUJVL@KV@UVULlxnL@VnUl¼@l@XVxVVUbn@WbkxUšlVnU@m"],encodeOffsets:[[109452,29779]]}},{type:"Feature",id:"500107",properties:{name:"九龙坡区",cp:[106.3586,29.4049],childNum:1},geometry:{type:"Polygon",coordinates:["@@XK‚L@Vš@XbV@lW@UV@@VXIV@U™VKlL@KnnJ@VV@VU@I„@@mVUVWUUmL@V¯LUK@UV@UU@a@U@yU@WLUK@X@KUVmL@ƒ@aXI@w@ammVk@WÛwm@UxVVVbVLUJVxVU„V@V@X@JUIVbm@@Vk@@VkL@lVLUJ@zWJ@X"],encodeOffsets:[[108799,30241]]}},{type:"Feature",id:"500106",properties:{name:"沙坪坝区",cp:[106.3696,29.6191],childNum:1},geometry:{type:"Polygon",coordinates:["@@Xºl„UVl@UbVXUV@xVJVzXJVUšL@VV@VKn@@Xl@XK@UmÝnKVbVakkVm@k„ƒUK@UmIm@LkKULVšU@WJ@UU@@VkXU@Wa™@@UKWL"],encodeOffsets:[[108799,30241]]}},{type:"Feature",id:"500108",properties:{name:"南岸区",cp:[106.6663,29.5367],childNum:1},geometry:{type:"Polygon",coordinates:["@@VV„JVL@bUVVnl`XIlwXJlw°nnl‚IXW@UÇĉk@WJkwkLƒ@WVkU@LU@U`W@UXUV@n"],encodeOffsets:[[109092,30241]]}},{type:"Feature",id:"500105",properties:{name:"江北区",cp:[106.8311,29.6191],childNum:1},geometry:{type:"Polygon",coordinates:["@@nLVU@wV@lV„@Xll„ÈKlU@L„@@bVKnx@I@JVaV@„x@Il@@Un@laVVn@mkUIm`k@WXJmk¯mkxWIkxWJk_UmVUUKƒ@UU™@ƒ„@l"],encodeOffsets:[[109013,30319]]}},{type:"Feature",id:"500104",properties:{name:"大渡口区",cp:[106.4905,29.4214],childNum:1},geometry:{type:"Polygon",coordinates:["@@k@@U@w„¥WKkVkImUmwa@b@xWJ@b@„nKVU@L@WVLXKV@@z@V@bVVU@@VVL°K@U"],encodeOffsets:[[109080,30190]]}},{type:"Feature",id:"500111",properties:{name:"双桥区",cp:[105.7874,29.4928],childNum:1},geometry:{type:"Polygon",coordinates:["@@WwUwU@kK@KmbU@@V@XlJ@znWlXV@XK"],encodeOffsets:[[108372,30235]]}},{type:"Feature",id:"500103",properties:{name:"渝中区",cp:[106.5344,29.5477],childNum:1},geometry:{type:"Polygon",coordinates:["@@VLš@VV„@VL@aUKƒIUUƒ@@JUVU@"],encodeOffsets:[[109036,30257]]}}],UTF8Encoding:!0} +}),n("echarts/util/mapData/geoJson/fu_jian_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3507",properties:{name:"南平市",cp:[118.136,27.2845],childNum:10},geometry:{type:"Polygon",coordinates:["@@@knyƒk@ƒKU¥šwV@nkƒWƒzUmk@@lKUa@aVI@UƒKUamKUUVaUI‚@Xƒ@UV@K±IUVVlUbUbUL@KWUXmWk@KkXmmkŃKUƒ™a@amUƒbkUkKWUnwUƒÇwV™UUƒÝUKV£U™@ƒnKWwXLVKm¥@wUXkmWk@ƒ@wX@lU„@šyVImaXwVƒƒ@kŽƒnU@mbk@mlUXƒmU@mV@n@bnW@bUIWJ—ImVUKWbUK@nkKƒaU@W_VUUmWmL@UU@™bUWUL@V@bmVUz@`mUUVVbXL@V™L@lmLUxmVamXkW@xWbU„VbUxkU±@ÅUmmkLUbW@@`kLknVlV@lbXxlVUXVV™ŽU„U@UbWŽkIWVUUUJkI@llbUxVL@V™VƒUU°ULUmWXUV@VULWb@™xm@UaVLVKUa@ƒw@V›bkmVambUUm@@VkK@„@b„xlxX@‚„n¤@Xƒ@@lkLWV@Žn„V„kb@bWJXLWx@nkxmm™bXn@VWVUn@VnJ@bVXl@„™VJXnWbX`lL„UlJVI@Žœ@VXV@Vl@bn@@Æmn@VšxXU@mVIlxšVššnI„l@nVJ‚aXI@mlU@aXkVm°klmnVV_naš°@V@xܦXK„V‚nnUlVXbVK‚LXKV@naV@@VVl@@lXblXšWnLlbVK²nš@@‚VLUnlV@lƒXxô°‚V@UnaUUlKXLVUVVUbVVlUnJVX„@VW@an@lb„@nl@VU@anƒšUVW@kƒaUm@InVVKVU@kUW@Uam@km@kVa@a@™nwšU@WlI@mVI@WXaW_nƒ@™nƒlkkW@U‚¥@kV@Uw@wUƒ@@IXK‚¥VIn@nU@`@Xl@VV„LnašW‚bVaUwnU„@VIšKlV"],encodeOffsets:[[122119,28086]]}},{type:"Feature",id:"3504",properties:{name:"三明市",cp:[117.5317,26.3013],childNum:11},geometry:{type:"Polygon",coordinates:["@@lL@Un@VVna‚bnUlœa@U‚x@„VbULUKVbn@šw‚@XaVK@UVUXWVnVKV¯„VšU@UUKVwka@klJVIVVXUlJXVaV@VƒšUUVWkUWwkaU@UklmlK@_X@ValKnnÆV²@lVVwUaVƒXa@wlXnW‚bnUVwnK@kšK@UWKUaVUnV@_VynU@a@UVKVXšaV@@VnKnXVV‚UX`V@„blL@mVLXaVLnU˜JXIVJ@amX@a@mnUV@„nVWnkl@naV@„ml„@@KmKUam@UU@ƒ@UlKU™Vk™U™K@aVaUwV™U¥UIkJ@wmI@‚mbkwkVW@UXƒKULU`™IVKUa@LƒkkVmUU@WlULUWÅU@I@ƒWW™nU@@w@a@ƒUam_XyVIVWkkƒ@mwVKXUV@nw˜VXkWƒÅ™U@ƒaƒU¯KUnƒK@ƒ¯šmUƒLXŽVLnWVbVbUVm@Ub¯¼W@amƒ`kb™amLUUUƒ™aUXV`@x@XmJ@n@L@xkJUU@kU@mWm@kUUwUUVWl@VUkIƒy@kkaVUUm™IWVXbWxU@k„mVkK@nWVX¦WxU@@bkx@VU@WŽk@™kUbmJUUmkUW@_kKWKƒ@knV¤kIUKWLUbV‚@Wbk@@VWL@VkI@lUXVxUVU@@mWIƒV@a¯nUaƒaUV@„ƒJ™b@bÞ°VbUš@X™aUVmL@‚VXblŽnV„°˜n@Vnx„@VUUUlK@InJVb@„Vlnn@V™L@VWJU„x@XlJUVVVl@LUUUJ@Lƒ„@lUL°¦k˜V„VnV@„xV„„l@blLnlšLVaXll@šnVUn@‚xn@nml°‚X@lb"],encodeOffsets:[[119858,27754]]}},{type:"Feature",id:"3508",properties:{name:"龙岩市",cp:[116.8066,25.2026],childNum:7},geometry:{type:"Polygon",coordinates:["@@ša„I@ƒVU„bVb°m@b„UXJ@nV@VUUwVW@klJ@UXK@Ul@Xa‚@UVaXKVLlJU£lm„@XLlL@`VXnlVVnIVašll@XV@@Ulw@aV@XwW¥XU@mlLnUlƒV@XwWaXUšJVnUVlb@l„zlJUVk@UXVVVxlVn@nXV@@lVVlI@w@K@mnI@W@wU_VWšbV„VVnKšbla„_n‚bX@°»Van@VUUaUamXUKW„K@a@Ukƒ@wWkXƒWW@wUU™Kw@_lyƒwUkU@@Uƒ@kamVmƒXašUVUka@Wk@»UUUVƒKkbWU™VUbk@mkƒxkƒƒKnIVUmW@kUKmXUmVaU@kU@m@KUWVkIWJ@ŽU@UI@wUUUa@KW»nU@mVkUmm@XwWU@ƒUUmL@ƒw@mnƒVUU@aWak@@amxU@UxULWVXbVLU`mbUImVU„ƒbn‚V@@bVn@bnVWxLmyUbƒIUKƒ@aƒVm™akbV‚UXW„UlKWbkV@„WLUlk@@nšbƒb@lkKmU@ƒUIWJkw¯UUVVxm@@XkbWx—›XKƒlUzWJkUUL@bmKkVƒ@@VUIUlWV@X„K@VkbWx°xUb@LUbk@@VWb@LXJ@VWXU@@bUVV„VVn@VVlLn„@l„@‚xk¦Vx@bVJXbƒn@JlnXxV@@„nJ@X@V@lmx„bUn@xVL@VVKlL@l„„nLVaVL@xkl@LƒxVl°š„X„WVX„Vl„œJWnxlJ"],encodeOffsets:[[119194,26657]]}},{type:"Feature",id:"3509",properties:{name:"宁德市",cp:[119.6521,26.9824],childNum:9},geometry:{type:"Polygon",coordinates:["@@@LVKVaVaUkVU²J@LVU„@@W‚VJUbVVnLVb„L@VUJ@bVbkL@Žl@Vn„y„XmlU@™xV¦„L@Ž„lmz@lnL@bVVšbVb@l„nšKVk„Vl¤@zXV@šl@XJVLVKnXVK‚VnU@wUm@šKUƒ@UlVlw@U@U@ƒUaUKlU@kXKlmXIWKXaVIVUVK@KU@@k„JVUnLVJUL@V‚IVa@VnLšKUnl`Vb„V„V@š‚Vbn@Vzn@lKnVlI„VVKUalkXJl@XXVWVLVUUmVU@Unm„£lK@Uk@WUXK@U@WVwVkšƒĠkĢÇ°aUÅUwmaţƒɱUÇa™w„±V¹XalKôx„@„UVaÜʓͿVóbÅLƒJm„¯Vk¦ƒŽk@mamXkKUƒUL›akbk@mV@LkJWb@Vk„mXk@UVmaUV@amLUKUamI@KUaU@WbU@UUUƒUIWJUkm@šƒw™Kk„VJm@kxǁVƒUK@mUVUkmlkkVm@amwƒLVWU@UbVLkšUbƒ@VƒmK@XaVWU_VJnwV@@kUmWakxƒ@kwWakIWxnbUJ™zƒ@kVW@@x@„XllnVW@xn¦ULWKXxmL@„VšU¤VL„ÞVVUšÈxV„mxXVlLlV„anV@bšbV„„LlÆnnlW@LXlWnXV"],encodeOffsets:[[121816,27816]]}},{type:"Feature",id:"3501",properties:{name:"福州市",cp:[119.4543,25.9222],childNum:9},geometry:{type:"Polygon",coordinates:["@@lxna@nJ@xlIVJV¦UšVxUb@bšLšVUlVškL@V@„VVn@Vb‚Ln‚@LU„lJXblx„@lwXbVn@lU@mxUIV`UXWb@‚nLU„„@Val™UKVaV@UX„Knx‚bn@lUkllnUVnV‚@VLU„È‚lwn@UIlƒšL„x‚™n@VlXIVJV„VVV@XaV@Vb@LnJVbVLnK@bVUnbVUl@nWlƒ@UXalI@KnUl@laœbVKV„lLnWnbl@„l¥°Unƒ„IÆKôa΀U„a@UUwÇWǓIUWUÅVkƨm@ƒ@£@KmLU¤ULˣJ™kUƒVǟUUķ@ĉVƒKUk@Ñ°wôǚç@īšé@Åţ¥mīÛkm¼Å@ƒVķVó°ō¦U°ƒn@bVJXVVL@bUŽƒakLmx@xmxXzW`XbWnXV@bWLÛ@™aƒ@ƒaXbWVkaÝwU@mlWKkLWWkLUKULW@kVmVUU݁UamV—¤›n@xUVUzkJV¦lJU„"],encodeOffsets:[[121253,26511]]}},{type:"Feature",id:"3506",properties:{name:"漳州市",cp:[117.5757,24.3732],childNum:10},geometry:{type:"Polygon",coordinates:["@@@bl@Xb@bVVUŽm„@n„x‚@nKVV@„XVWxn@VnUl@nmVX¼@LVbVV@xVJV@@XIlJXU‚V@Ln‚@lVV@UbVnnWVL@lnXUVmJ„Ll„„wnll@VašUXVla„LVUVV@¼Xl@lbUV™VWbn„nUlb„@@VV@„aVUšmlUašUny@kU@Wkk@WaUVk@@ammk@@U@UlU@aUa@wl@šmXLllnL‚U@anVnU@L@VVV@KlXnWVnVanUšw@w@wm›nÅ@wƒaUam@Uk„mUl@@a„a@U@¥škôK‚wȯ°w@ŻkwǕaK›ÑÛk@ĕōřċ£ĵƒUKW»kÅŻLU@Ulġw@¤Vz™VUbkKUbmLmlULU¼UxmbXl@bWVƒb@bUnV‚UšVbULU@@VkbVL@`U@WX@ŽXV@b°„@b¯š@¤@Xm@@b@`U„VVUL"],encodeOffsets:[[119712,24953]]}},{type:"Feature",id:"3505",properties:{name:"泉州市",cp:[118.3228,25.1147],childNum:9},geometry:{type:"Polygon",coordinates:["@@Vl„xkz@`‚xšLVV@xXXW„Xl@xl„@V@bnV°™@„„LVm°L„V„bV@ƚX„Wl—UmxU@WVULnx„@llUXUJWzn`Vb@„@b@xV@šmXX@„@JÆVVXVKXkV@nVlU„l@KVbULšJV_VK„LVWX@lUVƒkIU¥lIVyVU@wœm˜£nUVWU@aƒm@UmWw@UX@@am™VUn@@aUUlUVanaWUXWmUnkšK@VšUlVVUUwš@XLWWX™ma@knm‚bVb„VXbVL‚@XJlInlšL„w˜mXóšw@çV»ÇçŋaķƧóƅóKġ°nÅUķƑUÇW@—¯xÇ°öÆlV„n@llšaš@„Lšbƒ`™@™„VšXVƒVx@V@bULVJUk‚Ç@ƒ¼ƒXUKk@mmULkaWbk@ƒx@UkL@a@K@U@UmKmbU@kV@UmVUbUmmXkW@LUU@U@KmVmU@bVmKkkWK™nk@@xVb@bkV@V@Vl@nn@bl@VUXbl@XlV@@lmz™VVbkŽ™nUVƒb"],encodeOffsets:[[120398,25797]]}},{type:"Feature",id:"3503",properties:{name:"莆田市",cp:[119.0918,25.3455],childNum:2},geometry:{type:"Polygon",coordinates:["@@VbނVVnUlUX@VKVLlKXXlKXL‚‚nkV@ÞxlbXUWa„b„@šbÜ@XK@aWUXmWaX_Wynw@wnwlK„bV@aUKWUUI@a„mV¯Ŏ¥ô¯ĸU„UÆ@n»¯aƿé@ţ¯nĉĬÝK™óó@™ÑU¼@è™xWô—nƒx™KmkkJWI@UKWaƒUUaamn@lnbWšXXWK™@VxUVkU™V@U™LmlnVWXXVmbUbkVVV@bm@UVnš@bW@@VXx‚n@V„n@bV‚UX"],encodeOffsets:[[121388,26264]]}},{type:"Feature",id:"3502",properties:{name:"厦门市",cp:[118.1689,24.6478],childNum:1},geometry:{type:"Polygon",coordinates:["@@@VlUV@nanL@V@V@L@blK@V„wl@XalbVKnnl@VL„W„»È@lVUIVK@a@UUw„WUU™šƒš@„_™aƒK™@™bkkm@UƒkõŁxóL™l@¦@Vƒb@bk@VŽƒnVln@Vb„b@xmÆnœ@x@x™x"],encodeOffsets:[[120747,25465]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/gan_su_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"6209",properties:{name:"酒泉市",cp:[96.2622,40.4517],childNum:8},geometry:{type:"Polygon",coordinates:["@@ÇnÅaĉ@ƒU¯¥›UŹ‚ƒ£™WUýUU±JkkUw‚yÞIČxĊĕĊ¯š¥ÆUkţ™UÅÓ±¼™IUx¯UƒÒƑ‚ݐŰƒKÝnğ°ÅU@Žƒ@Vn@þš¼¯šWnŎ°XLWlnVnbWnƒVXxmbƒa—bóUƒlǕUUa™IUmlU™ƒš¥™kƒ¥ĉwkkƒÝɛa@¯™™U¯°mVƒkVnKlƒōÑÇÑU@kl™UġŽkUŻnUW™@š¯ƒk»šmWV£UKnUƒmUw‚w@ƒUIVaX™šwm»Èmmwn¯ċ™¯LĉŽUƒJUalka±Va@U‚k@ƒÛф¯WmnUaɝ¤Ûmƒn¯m±x@wóxÛLġÒUx¯VƒÈ™JUbóz݃ÇKĉ¯ōlÝUŎWl¯nťbÝ@¯ǩLġmV@ƯĢkÆm™ĊkVťLɃmÝXó°@„ĢbVŽóVݦɱ@Ƨaġ„UV„ĠÇÈV¼UVţwmbJÇwˋa™XmǯKkkmŽƒbXšm¼V¼ǬŚ²¤ôŰÆƴô̐ŤǪnɆӨ¼ɆLÆłUĊšxŎƞȘǔˎǬǪnƨŮǬö°»šġ„„ÞÜÆĸÒĊ„ǀbƾèôÈ@¼¯þŤĸƧ°VĀ¯b@lÈĊ‚šʠń̐„ȘKǀŽֲॗţÿǕý@ʊǓƨóÆÑǖŃôw@΋ʈƆÅÈVVĊV„óĊÅ@ÞƒĬV@Þīš@°Ž„V@ĸĢƒ°XτƜĠ@ÈaÜ¥Őƅ‚™nğóĕVġUůƿŋ—ĕƒa±V—UťÇğÑ"],encodeOffsets:[[101892,40821]]}},{type:"Feature",id:"6207",properties:{name:"张掖市",cp:[99.7998,38.7433],childNum:9},geometry:{type:"Polygon",coordinates:["@@ÈÒŎÒk„mLUŽlŽU„¯nV°šš@°ɜb„ÞĠaÈ»ĸl‚š„LVUÈ@Ċ@ýUm„@@ÆVĠ¯Þm„LƯޏƒ„Ñ°VVwšJ²»ÆԚVlŤÅV™¦ĉ°ĉĖċwÝJzVxll²IVVVþšX„¤źœV°¦„VĊ@ÆbÈmǔLĸĠ¯Ģaô¯ĸmÆÛUƒlÇĸk°XyĊUǔV„ǩnmV»ƒa@ýnK°n@l¥@»ż„Ċ¤m皃@£ČU@mƒmVkÞUƐ±²¹°‚ĠwÅƑŃU¯™›V¯aÈŁšƒÇ»™ġn_°xŎKlxœklx„@Þw‚„„@Æm²b‚DzLlkšWXať¯ĊaœÑšK±w@wƒUÅçV±Uk™@@„¯š¯xƒU™±±UU°ōxVxÅÔō°ó¯UÝ¦óbÝþƒ@ĉÈóUV‚Ux„„@VŽUVÝwÅÈǎóVkk¯JǐkmmL@„™KÇx@bkš™@U°ķ²ó`ƒš™šmn¯°ƒUwlÅkUƒ`™¦ɛô™Žķz@ŽÅnÇ°U¼¯KmVk²ƒJƒ¼ƏÞķôš¤ULƒ@mnğ`™šÇnUxÇ@Ûÿ™U@ƒƒkŻŽ@x@móJkŃ¥VŹĉóÒĉlċ°ķ„Uƽ܃@›x"],encodeOffsets:[[99720,40090]]}},{type:"Feature",id:"6230",properties:{name:"甘南藏族自治州",cp:[102.9199,34.6893],childNum:9},geometry:{type:"Polygon",coordinates:["@@ލš™nKlnšwX¥WÝXk˜xÞUnƒ°aĊVnUUKlÞĶWXnĠ¥ô»„™@nmVL@¤°™Vz„JšanU@aÆwna@k›ƒU¯šyX_›aĉb™ƒ„wƒéXkWwÅaš¯V¥mƒ¯UƒƒI@ƒš@„mšb°aÈçšUš¥@»‚knwɜƇ°I°ÑÈmVU™¯Xa@w‚W@wšV¯Č¥l¯Uwnm@k˜aUaóKkk@™Ça™b@ŽÒWa¯IÇxÛam¼™VUƒxÒl‚@zÝÒ¯bÝaĉVĉwDŽW›zJ™mJn²mܯUƒ¯ĉ@ġ¤Åb@²nšmlƒ@@Ž„„U„ƒLVxšV™„U¼Ålma™b@ƒ°™l@WIUƒ¯@mƒ™@™™ó„™„@U›zţyƒXÇU™ÇVUUVLkbWakVWmUbkkƒKUÆ»nƒ°Knk@aƒUVmšnk»l¯Ģ›lw@_kKVU@ƒnaƒ@lUk@¯¥mV@kmbW™b¯Åõa@mkU@kƒÇŽkU@›`@™óó—bl¼Uxƒn„¼šlVȄx@blVkVVnƒ`XÈġÈ@ǃK£ÝJmUUnUĖmlU„mKUn™VÅaUw›Uĉ`¯n¯wW¼nxVŽ™š@bĉnƒ‚kIċŘkXUŽ±Ò™xšÈ@ŽX°`l„œV˜IȯĊV„ƒšVVan@VašUVażVmšblkÈW„ƒWIXa„alL@wVb„„V„¦lL@lĠ™n҄U‚nk‚šL@ÆÞkšÞšK‚bñþW¦Û„ċVƒ„ULUºkÈlŎUxÆxÞUUxšÒ‚x„@XbšL@lÆ@„ÒlXVln@„bm¼ƒJ@„Ån„šƒx@bnšĠm„xVXmbÈè@ŽĊ£ČW˜w"],encodeOffsets:[[105210,36349]]}},{type:"Feature",id:"6206",properties:{name:"武威市",cp:[103.0188,38.1061],childNum:4},geometry:{type:"Polygon",coordinates:["@@±¯¥@klwU»ƒƒÞÝmwKm¯™™ç@™kVÇUL¯lVUKġ„ġm@a@U„@X£°l°LŎÇ@aōVÝw™ÔƒKUŽÅš„WJ¯lm@ÛVWa™@klĉUmaƒLUanaƒ™ƒk¯J„™™±KkXóÜÅxƒ²Ç‚@„„nUÒĊb°@™ÆkL™Ž™XÇÆ@xÝn—xWxţ„¯¤ƒI@Æn„ƒVV„VlU²Æè„V@x²x™L›ÒĉbŦ°Wb™Xklބš@l¤šXĊ`„wl@ĢÈŎm@bšnV‚Ubƒ„@șÆÛLƒèǚUÒŦlĸ™`°ĮʟÆǓbĉôϚĊƚĢnŤé΀ÑĸĀĊ¦„@@l°lœ¦Ȯ¦ɆÞĊKŤ™ĵĸů„»mŁyġ™ķŭ@Çɱȭ¯mƧUĊķnŁŻ»UaU™˜ƛɞÝƨů"],encodeOffsets:[[106336,38543]]}},{type:"Feature",id:"6212",properties:{name:"陇南市",cp:[105.304,33.5632],childNum:9},geometry:{type:"Polygon",coordinates:["@@šÈÞ@l`UmVƒ¼œŽ‚@nnÆwVlnVVa„LVƒÈ_‚ÿރ@n„a„xÆ@„lš_š@VxnK@llLnxmÈŎJnbUxšI°Žl@n¦‚lÈIlmX¥„k°@šk‚J„k²é˜@klaUaVaU@@ÝnIWnmnx‚k„ºÞ„„aV™°„V@nw‚KšxôbÞ£šVšU„bšþšLn»mƒVw„IšJ°Ž@„nb@°°I„ġUkÇKVƒ™™@ů»lƒ„Lnmƒ£@anK@Ñ܍n@»mL@£™yk„UUmbUÞÝ@kyÇbó»™XUxƒWVzb±mÝbXaƒwUamL¯»@wUKVwm¯ĵJ°ÅUWVk„KVk°wÈVšVуlUšƒ¥škmVamknƒUw¯¯ƒbċ¥ÅKƒk™Kk„™VċVk£kKVw‚Ñ„a@kóyÛ¯ÇVk™ów›š—Xō¥Ç¼ów™Ž¯U±‚k„ƒ@x›IĉÒÅVmÈnšÜ@n°„bUbÝV‚ŽUnnJ¯Į@‚m¦nV܃@„„L°JXb‚Ñ@šaÈb@šllôLVb—b@lmnVxk°ċ¦U°™Ž@xX@xWbš°UVÇn¯Ò¯Jɛƈmxl@¼"],encodeOffsets:[[106527,34943]]}},{type:"Feature",id:"6210",properties:{name:"庆阳市",cp:[107.5342,36.2],childNum:8},geometry:{type:"Polygon",coordinates:["@@kw‚ĉ—»VamƒƒV¯wƒIóVkl¯™Km™Vō¯ÝWkL@bÝKō¦@Ž™„@š™Lx›@b@l™a@km@@l¯nm@UaÅ@ƒ„óWUXm¥™nƒw`@UUxķôÇ°ğ¦@„VJš_n‚‚IVŽnalxkX„JWn¯šnVƒLšxl¤nnVbklVX@xnxmV@bUK@nm@@xƒV—°±aÅnƒŽkUWnUaƒx@m™n@ƒ¯LƒššmUĀlU@lV@blLUblxklkIÇx¯°‚UXbšaVŽUnšV@°‚LUlnbšX@`°nVmbnÆmV‚kLmK™¦UŽ@X„y@kl@U„°K@¼XbW„ƒš@b„WnLVa„VšƒVz@xlVČ¥lbUxލlV„U@nÆWôn²™VJlU„Ƨ„LnmÜLXa˜n@mœw@wlUlV²mšblwšVȃlLލ„±@lVnUlxnkma@mškšJ@kXV‚U@mn@š¼VXUƒVƒlLnmVbôaVnWV»ÈUl°È¯ÆIn›ÆU@kk»mKkÆġk¯@»mƒk—¯@óÇlÇ@—Vykkl™Uml¯Þ™@w"],encodeOffsets:[[111229,36383]]}},{type:"Feature",id:"6204",properties:{name:"白银市",cp:[104.8645,36.5076],childNum:6},geometry:{type:"Polygon",coordinates:["@@VKUȚl@šè°šnŽ‚LnxÝބ„V¼kx@l‚¦²°ĊóĠ„™Ċ»š@ÈxšaĊxlwÈVŤa@¯²aÇ£ƒJk£lƒnUÞ@°šô™@y„wl»lIX¥Ǫnw@ÑÞWla„ÅlL@ƒUwĉakƒl@ƒš¯mwna°J„V¯nUVÓÞÑm£²óWaUƒÇ@óÝUçV»ÈkkW@¯‚xV@XlK@wX@Vmm_@wÈݙKU¯ÇwVwÅK¯VƒkƒJ™™™XkWVaƒImŽ¯Uk„ÇlVšœĀV°mxóšk„@¼ó„WxĉÜU@Ub‚zÛJÇk@‚ÆnVlԙ@kŽ„x™ô@ĬWL¯ƒƒK@aÛImm™@ƒIUaƒ@™™UŽÇêU¤VÒÇx¯ÒV„šš™lk@Wbĉ¦UbkWV_‚y¯Lƒaó„kŽ@b@nmbkx„°"],encodeOffsets:[[106077,37885]]}},{type:"Feature",id:"6211",properties:{name:"定西市",cp:[104.5569,35.0848],childNum:7},geometry:{type:"Polygon",coordinates:["@@„a‚V²wVJV_@„LlanÅllŦçÜӚ_šlnƒWaôk„xUš„bmV@È°lèšnk°l¦„`@nnL‚@ÈlÜIyVaV@ĊÛXwôƒ@»lƒô™nwU¯›ÿU™Èklƒ°Vn„JUblXšWšš„I„l°U„ƒVƒš—@aVVVmnL@„lƒ„UUw‚mkƒš£„bV¥VUVwۂƒlaÇÝރmk£ƒLUy¯L@WlkKW_XaWƒ—mƒ„ġU@a™k™‚ƒakXkmVwmŹVƒU™b™WƒónmwnWW£„KÈnV¥ƒ¥„ƒÆ_k™lW„bU¯„V°aôbnaVwmaōInÇmwkK@kmLUw™@™`ƒkÅ@ƒwƒb@m݄ĀÇ`U„ƒKUbmUUkÅxmm@›„»nUVk_Ý@™Ç™¦™VÇè¯b™aƒn™@@„„JV„°Žn„U¦™°ÆbXxWl„êƒxš„ĊaœbW`™zV°œ„@lmbÅx@bmV™bƒI™`™¦@ÒUVUI@ƃL@bš¼@ššŽ@„šlmxnL„°ULƒŽƒÞğޛ°kLUŽƒL™°™xVŽ„n„KVƒl@šzX@"],encodeOffsets:[[106122,36794]]}},{type:"Feature",id:"6205",properties:{name:"天水市",cp:[105.6445,34.6289],childNum:6},geometry:{type:"Polygon",coordinates:["@@UyȍVƒVUnn@ƒVU„`UblzšJnk‚@Vb„KU„°l„wš„„W°„nkVŽ‚UÈlš£°V@n¥šV„kl™kU˜±U„ƒn™ƒlw¯UkwmKUlmkUmnkym@ō@U„mWÈU°l°anlJškUKlU„¯Èm@kmWV»kkÝLUWUx±b™@¯ma@ƒ¯™IƒJUxn„m¼™K™ýƒa™V™Uݤóa™wLmxU@¯ƒUšƒb݃ƒ¹lmwmnXŽmJ@ÞV@UbVbkblŽ—@±êƒlI™l¯@ƒlW¦knÇJkm¥k@¯™Jmbóa¯bƒUV°ƒakXlšÅ`ƒ„„¦U¦ÇmƒLX¤mXnxm‚„ôšXša„VźUnŽUxlnlW„bššl@bĢV„ƒ˜nX„WbX`lLXk@Ž°KVz„Kl¤„nÞ݂Èkb„‚܁"],encodeOffsets:[[108180,35984]]}},{type:"Feature",id:"6201",properties:{name:"兰州市",cp:[103.5901,36.3043],childNum:5},geometry:{type:"MultiPolygon",coordinates:[["@@lW²LššƒŽ°I„l„šmbVb„KnbĊVlkš@XbÜU@Žkn°‚XIƒÆ™V„LšÓÞxŎUlôƒ„b°KzU`lXVaĊ¥Xal@šk™™Uƒ°ÑÈwUтV£ÈéVšš„@Vb„Jš@nnÜJ@b„L°„XK@īšóƒwlš@kÓmUÅmK@mƒ_k¥l¯™mkçǯ@nUƒaV™ƒwólXbm„™k™`ÛÔťèkkmÆkbƒK@U`UI±xUƒbWlX„mbVbÅÒólkƒƒIWJkšƒ@ƒz—KŻ¼™@™xUx󎃄¯LWb@ŽÅ҄„±¦U`nbťĀUšVb„LšŽ„U"],["@@ƒ¯lwna@mōȯK¯kW¤ƒ@@V@bĢnĢƒVLU‚°k"]],encodeOffsets:[[[105188,37649]],[[106077,37885]]]}},{type:"Feature",id:"6208",properties:{name:"平凉市",cp:[107.0728,35.321],childNum:7},geometry:{type:"Polygon",coordinates:["@@ÆLUxÈxV°šLÇÞ@xn`Ü@X@nĊŽÆwnJmwUx‚aUkšw@V@w„aVmlLXÝl@X‚VĢmV°@nl@UUUWK@w„ÿVI²Òlmš@nÝĊýVV@nšJ°„„šUłm@kV¼nK›ĢȤôK„blnKllVk²aĠ¥È¯ĸóVw@V‚_„xšmn¦VWôX„ƒÆ@Vbn@°m@kn@@lšb@k‚aœ@‚wšK@™šƒ@UlKVaƒWX™W²¹lӄw@_°›n@@_lKōķW™@ŽmLUWƒn™»Û@›l_Ç`ƒÛmm°ÅbWb@š—VWbƒUUKDŽÅaġlmkUġlƒ»—Lƒl™Um¦@Ž¯U™¤ÇkVUml¯ƒƒX™ƒƒx¯kVƒƒLUa@ml™IkyVaƒ_UV@„mmUVU„ÇŽVzUxUVU¦ƒa™¤l„nVxƒVk„@ƒmKUnUU@b™˜U„ƒ„","@@@Žż@™mlkƒġk"],encodeOffsets:[[107877,36338],[108439,36265]]}},{type:"Feature",id:"6229",properties:{name:"临夏回族自治州",cp:[103.2715,35.5737],childNum:8},geometry:{type:"Polygon",coordinates:["@@š@ż»˜L„y„@l™XI„Jl„ôkÆÑUanaWƒXkW@™yk@U„ƒLƒmUšwš¯„KVlKœ¯Ġ݄݄VKƒ¯mKnw™k@ƒ™@™™»@a„K@ÅVJVU@њ¥š_Uy¯š@£UKmn@‚ƒšó¼ğ¦WmĵXݎkŽVLmVĉU¯bm„ÝV—wWlXÞW¦™xkmmL™šÝŽœ„±U@Vގ™š@„ÅÈW°X„ܼƨyUĮnŽWŽnXÝxUx°lVXJlôV"],encodeOffsets:[[105548,37075]]}},{type:"Feature",id:"6203",properties:{name:"金昌市",cp:[102.074,38.5126],childNum:2},geometry:{type:"Polygon",coordinates:["@@šĢȼ™„Çł°bœU°šV‚ƒń‚ÆǖŰnšÆ„ōĬǔaʠůĭš_kķÆ¥VÑș„çÜKšÅ@DŽƒVaU™m@aōnġÇk@ƒxĉ_™Wk£™@݃±KÈ±aÅnƒ@ƒÝxƒ@kw›lkwōL¯wm`"],encodeOffsets:[[103849,38970]]}},{type:"Feature",id:"6202",properties:{name:"嘉峪关市",cp:[98.1738,39.8035],childNum:1},geometry:{type:"Polygon",coordinates:["@@llĊx„¦šl™¦š„kVVnšJVbǖV„kôV˜a„bnaWw„UXmmamUXkWKō¯Xm°™™»ĉÇ@UVƒK™ķkǼğb"],encodeOffsets:[[100182,40664]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/guang_dong_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"4418",properties:{name:"清远市",cp:[112.9175,24.3292],childNum:8},geometry:{type:"Polygon",coordinates:["@@lǯkÿƒaV¯™VaÈU„¥ÆDŽIlxšmnb‚Uœxl™„Uôl°kš„„Wl„š@ô™VwUanUl@„xVkšaX¥‚kU»„aš¯±@kka@ƒUwmUkwƒJk™˜„±k@ƒ™™L@ÝWUwV݃—xÇU¯ŽÇX@m™Åƒ@@yĉ£VmUwȗ»ÇšUn„lUnWU¯`Ukƒ@@„™x„Ž@bÇxX¼ƒVVš¯LšĀk‚ÝLƒ„¯@VŽƒĀ¯lnĊW¦kVÇôkUDŽUK@ţ™U@a™™ó܃UU»ƒ@™¦k@Vx„KVb„n‚š@„Æ™„l„@xšƒbWšnlU„lxÈlV„È°Æ„@¼™„@x„šWxœŎ‚V„šK°„š¥ššnƒÆkŎ@ÈÑm™„K@¥šk@™ô@„nôV"],encodeOffsets:[[115707,25527]]}},{type:"Feature",id:"4402",properties:{name:"韶关市",cp:[113.7964,24.7028],childNum:8},geometry:{type:"Polygon",coordinates:["@@W™Xk±Ñ@ƒUw™mUwĉwlmn@Æwn£mkIš¥ÇÅ@¥šaƒón£nWWwš£V`Þ@šnVml@xô¼„IV¥ƒkUmkamUkVWwÛ»móƒ£UVÅKmn@x™@kbmm¯a™Xka›VĉaUb݃ƒ²—‚lš„IlxnVVx@„lb@l²™°ƒbV¼lW¦™bUlƒwk@mVVbUxóš™@kƒƒX™ƒ¯lókƒVkš›wVma™nkwƒJÅȃ¦ÇVUbšŽU°„blĀ°ŽkÈ@x™¦Æܙ°@„°„¦óa™VUôlUlbXl@nÜV„„nKlŽnIVÞ°Wš„°U@bnm@¥šIVƒ²Ulƒ°VnalzXyl_Vyƒ¦lƒœLlxš„@ŽÞbšKm„knVWanwƒÑVwČº˜@n_ÞV„aVŽÜIœl@„˜KȚ„VJ@aš£È@˜™@km™„aV¯W@_ƒa¯KmbkÇkLmwƒ@Å¥"],encodeOffsets:[[117147,25549]]}},{type:"Feature",id:"4408",properties:{name:"湛江市",cp:[110.3577,20.9894],childNum:6},geometry:{type:"Polygon",coordinates:["@@@ƒkXƒ™@a„UUċlk„Jƒk„™@wVJXUWk°W@nKnwlUlš²ƒ„blU@‚lI„l@„XbW„šxnm@lW@w„wU‚JX¯VU°`ŎóˋkÝÝkÅ@ÇmğÈřmw™aĵV›xUہ»°™ĠǷnýmóX¥ɅĵҏÇ@°²ĊUĖ±ĮU¤Ç°™Ā¯ɐnżUĊĊĬV@脎@ԃÒU¼l¤nƒĠb„êVĠ°Èy„zVaV‚nUÆL„ašbVl„wÆ@"],encodeOffsets:[[113040,22416]]}},{type:"Feature",id:"4414",properties:{name:"梅州市",cp:[116.1255,24.1534],childNum:8},geometry:{type:"Polygon",coordinates:["@@„‚nԚlW¼x‚¦@lœVl™lLkè„a@zš¤ƒĖ„¼UxlnUKUbÝlU¼lb@„Vx„V„klJÈwV¯š@ĠlÛĖšnƒbkšÆźÞƒUÈôklmšL„¥‚LœW˜„„™nKUkVa°V„x@IVV@x°bUk„a™a@mV@„@y„w‚L„ÑUwVUšV„‚„U‚bÞVVann‚@XwÇÿš¯²aVamkXaÆ»@»nw@¥›UXaƒkbWa¯KUw@¥m@kwmLU»UU™J@kmU@UUWUƒ@ƒyƒanwmçÛl¯ƒŽ¯UƒmKUmƒwVkmÝXbW@XWÝbƒk¯@±‚w@»U@W¯Å@ƒÇ¥UƒU@ƒƒ™IU™ƒakJƒĀ„ꃰšþƒXkamŽ@Žƒ_J°m‚@X"],encodeOffsets:[[118125,24419]]}},{type:"Feature",id:"4416",properties:{name:"河源市",cp:[114.917,23.9722],childNum:6},geometry:{type:"Polygon",coordinates:["@@°VlmX¹laĢÒlm„@„„šVš£‚‚@¦Ģklynn¼lW°z„W„„°VbÈV@lÆbnn‚JškX„šVÆašÅ„W@™ƒUUw@ƒkaV»ÞkVaVLkmVwƒ»„ĕ™£@yƒblçkKkš›U@k¥‚wX»™kmӃ@Wn¯‚I„`@nlb„W™ý„¯ƒé„ÿlI@™XUmWUwƒ@@UJU„Ç„mKUV@x™„ţk¯¯LWƒƒnUxK@ű»Vwa¯š@¤WX@ŽÛ¦@¤ÇIȼWxXŽƒ@Wx—w›ŽUnVbÅèmVa±²UWl@Žk„lȄ¤nôܼXxlUnVlbVn„lU¦ƒJó»@wnkmU™‚Ý@U_™¤XxmXm¤„ô™b@¦Èƙ¦lJn"],encodeOffsets:[[117057,25167]]}},{type:"Feature",id:"4412",properties:{name:"肇庆市",cp:[112.1265,23.5822],childNum:7},geometry:{type:"Polygon",coordinates:["@@l@š¥„@V¼„Vôۚš@bšV@ŤVLȃlVÈólUX¥mĉ°k„ÿU°@„ƒÞKl™ÿ°KU™„UW»Èw@aƒšw@ƒ„@nm@w›£kÓVUVn„Kš™k¥™£Vamƒ@nkKkbÆǫma—kmLU¥™UmƒÛwmVU™mUƒJ—ÇaUxÇIn`mb@Þ¯b@„nJ@nl„U‚V„lVU„L›W¯—Û`Ç_¯`mš¯I™bĉWċzx±J™xš¯ÆUƒƒ_k@™šƒJ@Umb„šXôlLš˜n¦@¼ĊxlUXŽ˜xUbL‚Ġ„UnVĊwlšUš„b@lW„X„‚m²˜@ÞWxXš‚Unb"],encodeOffsets:[[114627,24818]]}},{type:"Feature",id:"4413",properties:{name:"惠州市",cp:[114.6204,23.1647],childNum:4},geometry:{type:"Polygon",coordinates:["@@lbšW°bnnlaš@@wnmÆLVUkÇlƒ@Xk‚V²±‚bnUÆçUaVmœ˜xXw„@WXwÇ»ÈJ@£Ü¥@XW@£°™‚bUx²¼@ƂLVw„mX„°K°Ťlšƒ@wVUnLȃVƒVIky±wkƒKU¯ƒÅkƒ™XġÑۃlwUwlm@m„nKWašÅm›¯óÇmğb¯alĉUwķbmb@lÞÒVn—šmĀŹ@VŽƒbVŽUnmakLm`@xĉkklVÔVJVn—lV„UnmJmaLUbl‚™zmŽkL™a™‚ō@@zš‚V¦UŽV²kJ„nÜU@˜VXUŽL@„lJƒL@bݤUnVŽ—b@xVnlK²„Vx°V„xlI„lkVl²k¤@n"],encodeOffsets:[[116776,24492]]}},{type:"Feature",id:"4409",properties:{name:"茂名市",cp:[111.0059,22.0221],childNum:5},geometry:{type:"Polygon",coordinates:["@@‚LnÇlk„KnkÆL„ƒUm™ÈxlUœJló°n@ššanŽš„„a@ƒ˜@X_@mÝóóU@a™aU¯mL¯ƒƒkV¯™ÇVwkw@V±Ŏ£@™™@šalw±Vk@m„Åm¯™ÿŃƧIÇ`ōô¯_UVW°IV‚ƒx@xkX@Žmn™wXƒWa@ƒƒkkJ@kVƒa±„k™kVmxmL@‚¯XXlWVUI@xƒš„lƒIklVȃV@b„šlW@„@nUxVblVxkôlx™n„‚y„šnIƻư„aXwlK„bVnƒŽXb‚L„¤„k‚L—èƒVV¼ƒŽ²IlĠVX„ynz°KVx°@VlœLlblKœš"],encodeOffsets:[[113761,23237]]}},{type:"Feature",id:"4407",properties:{name:"江门市",cp:[112.6318,22.1484],childNum:5},geometry:{type:"Polygon",coordinates:["@@lUXx°JWnnƚXVš„W„X@„šºVLV¯nU‚Vnb™ô„x‚aXmW™XIšŽUb°xlK„l¯œK˜xXÞ°ŽšXÈ¥Ü@„ĉޏU™‚çš»nóƒVma—x‚¯UÅU¥Ý¯@ƒƒç@ș@çĉÅUmU籃ĉKÝxÝ_ÅJƒk¯»ó¯nmèkǀšŽWxœ¼mnUÜġ°@¦@ƒxƒLkŽÇaVnUxV„™šVlnIlbnÆÆKX¦"],encodeOffsets:[[114852,22928]]}},{type:"Feature",id:"4417",properties:{name:"阳江市",cp:[111.8298,22.0715],childNum:4},geometry:{type:"Polygon",coordinates:["@@°„nKV°šb@bôVÞô@n„VlÒôÆUnlnn@lmkmVkƒaÈkÆƄ™k¥‚ÅÞ»ÆKXkW¥ÅLmÅkamJUkš™UƒVwUmÈbl„K„w‚@@¥Ģ¯VÛnm›»Xw™lƿ™@kbW™—aʵ@óL›l¯ƽ@™ƒƒLn°ƒÆ@nUl‚²kx™b@‚š@šō¤U²@ŽlxUxšÈU°lŽ„"],encodeOffsets:[[114053,22782]]}},{type:"Feature",id:"4453",properties:{name:"云浮市",cp:[111.7859,22.8516],childNum:5},geometry:{type:"Polygon",coordinates:["@@@V„Iš™l@„`V„°Å™šw²I‚wČyĊXša°Jn™°_È`Ü_°˜œX‚KVƒkUUƒVkƒ@mmI@ƒ°a@Ýnam_ÈJVwlĉX@„šlUšómaUmVU°UK™¹@ƒƒWƒXU™™WmÅXm¯IWwkVWlÅLݼÆl¦ƒšÅÅÇl„bUllnknm@kmVmóÅkуUW`—@@„ƒb™ƒm™b@™¯mkô›IkVÇwnš„VƒÅKmlƒLklmȁKƒšVĊK°²„`n˜¤n„U„bWl„xVx™LUx@°nXm`VklVxmnnx"],encodeOffsets:[[114053,23873]]}},{type:"Feature",id:"4401",properties:{name:"广州市",cp:[113.5107,23.2196],childNum:13},geometry:{type:"Polygon",coordinates:["@@Ș¼VxUnĊ¤@z„@šÆ@nÈW°ÈV˜w„ŽUÞVxÞX@ŽšK„šl@ބVaĊbœU@ml£k±lUƒkkJƒw¯UUw±ƒkLUm@w˜aUVmÞ£@a„KkI@ƒ‚KVUW@—ÛVƒmlIU±VU¥™@yğzƧǃƒšƽĠřšÅnī±m@ƒ²¯lƒ°@nÝÆóUll@XnÝVU¦mVV°—„V¼™Jƒn„b@°mbn„ƒ‚@²¯‚¯wVwƒ@@nmxX¤¯L@ŽVLU„m@@l"],encodeOffsets:[[115673,24019]]}},{type:"Feature",id:"4415",properties:{name:"汕尾市",cp:[115.5762,23.0438],childNum:4},geometry:{type:"Polygon",coordinates:["@@@‚„@VxnXWV@š„bVššJ„„V@ÞÅU¥Ċxš£UWU‚wÅUU¥WVUkĊÇnkV`°LV™„wƒƒnU@™„ƒlbĊ¯„Vnalšš@@çkUÝ¥ġaó¯ÅaÅLŻÆUýmy¯ó@ĉÆó„ȯw™ÆXbmLƒ‚@nknVxkx܄ĢҚW„Æl„V°„Ll‚²xlz"],encodeOffsets:[[118193,23806]]}},{type:"Feature",id:"4452",properties:{name:"揭阳市",cp:[116.1255,23.313],childNum:5},geometry:{type:"Polygon",coordinates:["@@V„Ȧ„Æ@X°V@@¼‚x²°@„lÞaWXX@‚aÞWlnUŽ„xVnnL„‚°V„@k‚mĢl@„ak™@mlk°aXƒ±„nwm±™²¯JV²@ƒwW˜—_mƒa„V»ƒU@m¯ĉUф™šJl™„ašbVn„lĸLlƅÛDZwÝ@ĉxó@è™@k™mbƒUĉ°kaƒ„@šmV„„ƒxUš¯KU_mlĉÈVlXUV¦ÆVxVŽVX™¤ĉwV¦ÝÆ"],encodeOffsets:[[118384,24036]]}},{type:"Feature",id:"4404",properties:{name:"珠海市",cp:[113.7305,22.1155],childNum:1},geometry:{type:"Polygon",coordinates:["@@„è@„Þ°V¦VƁ°˜wnb„UÆ»nçƏ@nxܤ²llU°VnÈJސ°UôéšķUklƒô£VVˌKÞV°£n¥ƒ£ȗ™Ýy¯¯mÅkw¯bÇĔğ@Ýn¯ĊƒVğōŁŻƒķJ@Ț","@@X¯kmèVbnJ‚™"],encodeOffsets:[[115774,22602],[116325,22697]]}},{type:"Feature",id:"4406",properties:{name:"佛山市",cp:[112.8955,23.1097],childNum:1},geometry:{type:"Polygon",coordinates:["@@Èb˜Ž„InVVšnUÜxn„šVV¦nK˜lnbÅǬlalL@mn„Ubš¤l¦™šƒLUmUVlԜ¤@xmnVl°_XVVmƒkVmș@kn@VƒUK@°KW£nw@m„@Ux°x°@±„mƒna@¯ƒa„mšIU»˜ƒU¯nUV¥ÞUWmk@Vk¯™Ukn›ÑWݐƒĊÛ@Ǧ™W¯Wݗw›Lk°ƒkL¯wVa™WJXšWnbƒwkVƒ™W@kĊ"],encodeOffsets:[[115088,23316]]}},{type:"Feature",id:"4451",properties:{name:"潮州市",cp:[116.7847,23.8293],childNum:3},geometry:{type:"Polygon",coordinates:["@@°ŽÜknèmx„b„z„@V‚VX@VnV@lšIVVV¼nKlxn@@¦Vx°LXbla„ŽWbœV°£¯™W@nW@™‚aUñVœwWš»@¥ŤÅUÝǓÝóV@ńǎkUVmƒIUwÅVWÇX¹›—@W„¯bkl@nlšƒb@‚kġŽn@l"],encodeOffsets:[[119161,24306]]}},{type:"Feature",id:"4405",properties:{name:"汕头市",cp:[117.1692,23.3405],childNum:2},geometry:{type:"Polygon",coordinates:["@@‚@U±°Iš±n²mx²ƒ˜@œWºXÈÆUVx„JUnlVȍ@ŃôUǔÞVçn»VyĢÛVm@»kaÝUǼóšÛÈķKċ¥X„¥Wwğk™ƒ¯@ƒwķKƒkUm™aƒbkš™IƒšVÒ°Ċ@n„VU¼ƒ‚„bn˜`X—„x"],encodeOffsets:[[119251,24059]]}},{type:"Feature",id:"4403",properties:{name:"深圳市",cp:[114.5435,22.5439],childNum:1},geometry:{type:"Polygon",coordinates:["@@ÞLš„@xšbV„šVšK°™X°Kô¥Vw@anU„胐š‚lkĊl@wn_lKnbVmU„aUź@nÿ˜™UmÝѯUƒbk„@ÆkxŻ@™aÇX—wƒJƒƒ¯LķÝUĕ™ó™ĸóêWº@b²nmĬ™Æ"],encodeOffsets:[[116404,23265]]}},{type:"Feature",id:"4419",properties:{name:"东莞市",cp:[113.8953,22.901],childNum:1},geometry:{type:"Polygon",coordinates:["@@Ŏ@ššblKnšykVa‚KnbnIVmUƒ˜kUmUIUә„ƒçmV@bUxó¦¯LW‚¯š™L™UUƒ™a@w™ƒÝKğŚ™ƾ„„ƨÈĠy"],encodeOffsets:[[116573,23670]]}},{type:"Feature",id:"4420",properties:{name:"中山市",cp:[113.4229,22.478],childNum:1},geometry:{type:"Polygon",coordinates:["@@‚XœÒlmšV°ôÞÅ@m„¯°k„±‚@@aX¹¯VݏÇIUmV¯kk‚±Û£mw@‚Őmèżmô™¼èVš"],encodeOffsets:[[115887,23209]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/guang_xi_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"4510",properties:{name:"百色市",cp:[106.6003,23.9227],childNum:12},geometry:{type:"Polygon",coordinates:["@@lklWXL@VšI‚l@XnJn@VUUalk@mK@kny@UlU@a°™„ƒUU@VmaU@Ua@UWw@ƒn@KmLm@alkšmnI‚m@an@VIUamWÅImwU@@a@K„X@JVL„UVmUaVkUa@m„@@Ulmkk°ƒUaVUlKXbVwVIkaVmUk@KVk@a„aW¯m@w„¥laœX@KmaškVmnUl@nxVKšInU@yVaVIV@na°KlxX@@_lmXšUV`VIV™V@„n@lšbn@@WUkValK@²yl@„„VUV@@K°L@KU@@UVaXIVVV@naVkVa@K@UUK@UUa™LWa—w@m@K@UVVƒ@mVUUVKnL„mVL„K‚bVK@UUIk›mI@mUIVK@IUK@VkLƒ@WU@mU@WmUk@ƒI@VƒJk@WwX_@amK@UUWkIƒ„ƒK@LVb@mVmakL@J@bU@Ux@xƒbmI@`ƒIwm@UbmKUaUWa¯UkJWV@XƒJUU¯LUmV@ma@kkamKwƒLUUmWVkkm@aVUUkVKnVVUmXK@UW@km@Ukkm@@W@U™kUy@I@aUUmbƒ¤U@kUmL@bmJU@Ua@wkLWWkL@Uƒ@VaU@ƒLUakKWbkUWVkKkLVLUV@JVbƒz@Vƒ„@ƒVmUU@kVmK¯@VƒU_™VWakVmIUKUaU@@bml@XU@@V@LmKUV„mVUKƒƒKƒbkaUXƒKUL@x@V@l@„mxU¦„V@ŽlL@V@Ln@@VV@„nlKUaV@nLUbmJnL@VWLkbmV„@@L„W‚„XLlx„VVIVV@x@V²blUVm„LVUœK@kWWXUlV@Xl`„LX„l@@VšŽƒn@VnbVš@lVUVUÈVbš@@`UXU`l@@XUVm@kš@xmVknUJVXUbmKULmbx@VlJ@LVbkKUbVLÇUUVƒUVmU@VaUkUKƒVUwmLkUUVVlƒbka™XmwƒKUšVVU@@V±Uk@VWUUm»XamU™bƒKk™`ƒ„™U@UnWW_kKmbUVUVmnUV@„nJVUlšUbU@UV@n@JmI@VmbnVUXlx¯ŽkKmnVV@L@V™bkV™Umm™@Ub¯LmlUƒL@VWLkmkLmmn£WmnKU_mW™š™bnbmxƒ@U¦UJU„@Xmlk¦@‚mnUUm@@Jn@lV„ÔVJnIVW„I@a„ƒÆK@I@aVK„IlŽÞnnl@nl`nbÆX²l@xV„@llbVn²ŽVVl@nn„V@IlW@Un@@kVa°KšnÈmVaVXUlaVƒÈU„VlwôUlynIVašan@lVXb‚Iš@n¥la@Kš_n‚@bÆx@XnJV„nKVz@`VXVšU`@bƒ¦UV@VšIlx„UnV‚K„XÈbšVllšbVbnVn@"],encodeOffsets:[[109126,25684]]}},{type:"Feature",id:"4512",properties:{name:"河池市",cp:[107.8638,24.5819],childNum:11},geometry:{type:"Polygon",coordinates:["@@lLVl„bVV@nXVlI@JVX„mšn„W°b„IVV@‚ln„@nalVUb„nW‚@kVkÒlbVKn²°bUŽlV²@˜X@`nb„aUI@ƒ°wlU@aXJVI@aVK@wUamIXm‚@XUV@@bV@Vm„ImnUUwVaVKXU‚nVK@akƒVwV@nL@UV`n@@X‚lnIUJl@X¦˜V@aUIVm@anƒV@UwnL@VlbVL@KVVXUWƒ„wUUVUka@UVJnUlbnalbVVn@°„„LV`Þ@šXVxV@@bVlUVVbXnWlXnmlš@XXWVXJmbUI@V„llUVkn@@VWV@Vnb„@VXUJVnn`lLVk„a„»lVšLnw@WV@lInw@WnU@U@m‚knUVó„K‚wUmUXUƒU@@wVJVIl@XKVVVbVI„J@Un@lŽVLnm„b@U@Ul@nUš°VUVJnnVJV@„@mVU@ƒ@wkUVwkKWk™yUUkU@alkÈ@lJ@x„Ilƒ@UUWVkUw@Kn@@kmaƒVUl™UUL™ÇƒUUKl@UUmL@aXU@mlUUwmKkUUVKVUƒaƒKUnK@U@Vl@XUWU„KlwX@šb@K‚@XkV@UwWJka@aUwmV@U™@@U@wUm@»kLWVkIWŽXnmV@VkbmKƒLUbk™Va@aƒa@@aVU@aVak£@ƒ±UkVU¯V™UUƒJVƒUIƒ@kxmUmWUbL›w@K@aU@@aVU@Kma@aka@_VWkk@UWVUKULWKULUš@KUnƒwVaUKƒxU@UmaƒL—m@kVmVa@UkƒmI@ƒ@KmIkxU@@K™U@mmakI@VƒLkmWkkJ™_U‚@V@L@n˜xXbšKVb@VVL@V@LUbUlmbU@UUWJUb@VV@@L¯K@LU@UVƒƒk@±z@‚kLUbVl@Xm@™akm@ƒU@UšUJU_™VWŽkn@`W@kw¯LmbU@UJUb@zmV™JULmwk@mVUn™lnb@L›Wkbƒ¦@x°nXŽƒb@bUl@LVlUnlbUJUxWakLUVVb¯„llkn@Vƒ@@nVbUlVbUnƒVUK@IƒW@L@bV@nxÆJnXVbUJm@@bnmJ™nkl@b‚nnK@L„m‚@Xx@VVbV@nb@UVVƒ„¯š@bkV@Vmz@lnLl@kŽVbUVm@mI@Wk™J@UWKkXkl"],encodeOffsets:[[109126,25684]]}},{type:"Feature",id:"4503",properties:{name:"桂林市",cp:[110.5554,25.318],childNum:13},geometry:{type:"Polygon",coordinates:["@@nU@J‚X@`XLm¦Vb`lšVXXWš@VblČnVšŽlanLnmVLšK@_Vaƒ¥@kUa„@VmVb„aV@XVVzlVVK@knKVmX£VKšLlbnš@b@llL@xĊôXaV@°È@¤„bn„V@@Wl_„V„U@W„nVamw„wVbn@„K‚VšLX@VmVUxlV@šnVV_nK@m‚I@Wn@@IšUĊ@@wVWX@@I°VVm@wmU@m@IUƒV™kƒlkUmmkÅV@@aV@@Wn_UKla@kšaV„šlVanb@k„@@KlVn@@aV@nIWW™UUaVU@™kKmwU@UImKk@UU@w@W@‚™k@™UkWƒ@mk_W@Ua@a™ƒƒ@—¯ƒmV£@mƒUUam@—kWakƒVama@UUm@nw@alaUmnUlVlIœV‚™šLVyk£Vm@k@UUJkƒK@kmKUw™KkWK@UXImyVwnI@m‚ƒkUlkUKkUVmƒw@kkJWUÈm@_k@@aƒaW@U„UJUwU@@IWKkƒmUUV@nVl@bVb@bU‚UXƒakw@ƒWUkbkKƒbm@™xUlkLm@@wmKUX@‚™UaVW™XVmU@@UUUƒxkmWXkKkUWaUaUb™L@`UL@LV`UXmK@VmakLVbkL‚xUJUIVbUVVb¯KƒV@Xnl@lVXbmÒnV@L@VWKkVUIWJkIƒŽUamUUbm@U„kU@JUbW@X„WxUam@kbVVUnUJmUUV@bƒU@UUV™@ƒVk@ƒbƒmULV¦U@V„U`VLUL@xVbn@UJ@nWJXXVŽVV@bkxVbUx‚Lšš@x„¦@šU‚lXUVVlULV@@šnŽU„ƒb@xl„nJVnlVknUlVUbmŽU@ƒbVš„x"],encodeOffsets:[[112399,26500]]}},{type:"Feature",id:"4501",properties:{name:"南宁市",cp:[108.479,23.1152],childNum:7},geometry:{type:"Polygon",coordinates:["@@lKnbnU‚@Ua@K„L„ƒlJVX@VnL@bW`Xxl@„I@U„Jl@nV@X‚V@nXV„@lK@UVL@JULVJ@nnJlœVJ@VULaƒLUKƒnmKULVVUŽ@nU„š`lIXlln„K@UlJnb@nšV@LV@lwnJ@L@„nJl„@VUbUn@l˜n„KnbVŽV@„wVLUb„xVm@LV™VKXLVKVLXU@VllUX@`lb@bnb‚L@ŽUV@bV@@b@Lœx‚KVanXVƒUUmVUUUaVUky‚UUa„ImK@mUUVUkKU_@W@UVVVIUW„UVaVU@UUKnƒ@k@al@ll@bnL@b„VUV˜X@Vœ@@b‚Knblmn@V_@aUalL@a@akK@kVKUKlwUUnV¥VmU_VWVIVaX@Va„alńK@LVJnalL@LnK„wlVUw‚mX@VXšƒlLUVnblaUmVUVwXU@Wm¯Va@ÞKnw@w™mšk„»‚UVW²a@_mW@U@I„y„LVUUKW@@™„LX@VUV@@yVU@UV@nwUUmJka@IU@ƒmƒVkaW@UwUX@`ƒ@kLWUk@mƒkUUm@k‚UUWkUƒkWxk@@VƒK@nV@UVaƒUUJmIkVƒ@UamLUbkVmamLka™@ƒ‚kmL¯WI@wJmwƒx@akU@aUKmbkaW_nW@_U@Wm@a@wkwUKmƒk@ƒbkb›w@mKUkkU@J@bW@kVWz@bVUa›VUx@„ULkJWbXVVXƒ`@œmJUVU@@Lk@WbU@UJlnXlm„Vx@Ln@‚b@K„LX„WJUUW@kƒaUVUbmV@nnV@n@lVLƒVmLX‚mXkV±@kxÅL›šUbJWIÅJ@I‚mXalkUamKkškL±aVwKƒUU@mÞnbWJX„m„@lbmKULWUUVkaƒbnn@Vl@VVV@VƒbVbnLWLXJWxXLV@@VV"],encodeOffsets:[[109958,23806]]}},{type:"Feature",id:"4502",properties:{name:"柳州市",cp:[109.3799,24.9774],childNum:7},geometry:{type:"Polygon",coordinates:["@@ƒwU™„aV@nVaUVklmkUUmmIkƒ@w„aVƒm@™U@VKUkVUkWV@™ƒ¥@w™™KVwUalw@aUUUWWXI@mVIm@Ua@wVKUKV_UƒV@U¥VK„n„al@„Uš@VU@V„V@aVUnVVIVmUUlan@VbXwWƒX@Va@IlVVƒn@VanVVb„lJXIVJlUXL@U@KmUnÑWakU@mkƒJUI@mk™@wUmmUV@JXaWIXWmaUIƒJƒkk@W„nJ@„ƒaUak@›kkJ@kUKU_ƒ@myUóWUkm¥kUmL@KUKm@k_UmVa@ƒk@@UmU@mm_—JWIUVUŽWLUlbVUJÇVUIVwƒKUVk@mU@n@lUL@Km@@l@L™VƒzJmUU¤m@UbV²U`U@@¼Vn@x@Vš@@VnUVx@blbXIVxU@Wl@@L™aW@kxƒLXVWVk@@U@VmLVŽ„L„bUVULVV‚lnLVxkV@nWV@bnKVVk@VL„VšÈVKšVVk„Unb@lm@@LVxUlVX@Vk„ƒJ@wkIÇ@kl@blVVVšzXllLUxlV@x@„UV@nƒ‚U@UImmUIUV™¯mVk@@V@VƒamnUKkm@@VƒIUJUaUUWLk@UJUI@xV@V„VWVnxƒLUômVV„@VkVVVUnV@UVkL@VVV@bVxla@bkXVJVn„`nU@bƒb@bVL@VnJ@„l@šV„aU@@_lW@UUU@Unƒlll@XLl@@UX@°bVWVanLlknVV@VVX@VVƒnUŽVLmbXJ@nllXX@`VXƒlmaXVWk@Wkƒw—J@„VL@J‚bnU@bn@@bVKUnVJVIVVVL²a@bV@@Vl@nUVakalmš„UL@VUL@V‚a@mXl@nK@UlK„L@Vl@@nkllb@š„Vnn@‚šnV„™V°l„šVInwlKXxlU°Žn@@ƒ‚I@UnVlakUJWkUK@anUWK@_ÞJ@U"],encodeOffsets:[[112399,26500]]}},{type:"Feature",id:"4514",properties:{name:"崇左市",cp:[107.3364,22.4725],childNum:7},geometry:{type:"Polygon",coordinates:["@@@JVzšl@V@Xn@ll@VlnX@@VWLnŽUVmUULVlUV@blnUlnXVV„K‚xnLlb@lnbU@Vn°KVV„I@WXUlI°VXb‚VVbnLVan@‚x„J@_nJ„a@wVwV@@a@IU@UU@WKXwWIXKmKUa„a@U‚UUUk@@Umm„albVUXVVKnL‚a@knƒWƒXImanÝV@„V‚LUx²blKl™nLVbklWbn@JÆIXJ‚IVaœ™ÆKlw²@lUnWWnK„UUK@k@mmU@mnUVaVU„b@lVXVXIWƒƒK@Lam@@KUwnƒWkkmVIV@Xal@@KV@VUnI@›„_UWWUkam@kkm@ka@mƒk@wkJWIUU@WXkW™XkWWLUUƒ@UakLƒW™XV±VIVWUU@anUWaUK@IU@Vak@@UUKWaƒ@m@ak@@wUkla@mUaUklakwVƒ¯¯@WWUkLkKmaƒ™kLUnV`UxWX@Jkn@bmlƒakkk@ƒb@l¯bm„ƒbJ›b@VXn„bVV@„ƒbƒJUkkKWVU@mœÛVUUW@UVUJWXkVkKmUL@WW@U„Vl@XXKW„XJ@XVlmbUxnnm@UlVnV@XVm¦VJb@šmLkKÇbXblVkn@l@bWnX`V@@IVV@ŽV„V°n@@_naÆVVbUVVbUJnzlVUl‚XkV@Vlx@X„VnxƒbƒKUK@b¯VVUV™L"],encodeOffsets:[[109227,23440]]}},{type:"Feature",id:"4513",properties:{name:"来宾市",cp:[109.7095,23.8403],childNum:6},geometry:{type:"Polygon",coordinates:["@@nVlw„@VJU„„IVVUšV°lU²V@„l¤Ub@bUV@b‚@„b@bUblšVa„KnLla@UnUWmXlJXUlKV@V_U±Van@V£nV‚I„yšU@K@kn@@LVK@k@mnVl@VU„LUxVJÈUVIU‚aVkXKVVUXJ˜In`@nnV@Vl@@„UbVnl`n@VL@LnKlVn¦VlôXV‚nz„@V`VL@llIœll@Vb„b@ƒmIXƒl@„l„IVJnbWXXJWb@IU‚nVVn@xlš@nVJ„I@W„U°LUaVUUaVJVIwlKUalKnb@UnLVWU_@KVK@_šKVa„@VKU¯VLVKn@la„aUkU@maVU„J@k™@Um@XmbkyVaUIUU@KV@laVn@KXKWUkUk@ƒaW™UUVw@aXKmƒVaUUkšmIƒlUU@wUa™xUmmU™¯™U@WƒLUmVIUym@UVmUa@wmw@çm@aWLU„™JUIUamKmL@™aƒx¯¥ƒkU¥U@±„k„UVmKU_mJUbkKm„ƒLÅǙ_@WWUXUmaVUkK™„UWW@nVxkUƒxmL@KkKmbUI@KƒLkƃbUbW@UbUJUXV`UnU¦mŽVVkxVLUL@llL@b@bkKVb@bU`m@knmaL@a›@@U—WVUƒU@amK@akkk@@b@lm„VL@VUVUbƒVVXUJUU@V@XV`lLUVVV@nnLƒJVbVlzUVVbVVnUVVU„"],encodeOffsets:[[111083,24599]]}},{type:"Feature",id:"4509",properties:{name:"玉林市",cp:[110.2148,22.3792],childNum:6},geometry:{type:"Polygon",coordinates:["@@VJUXVVXlWX@V™xVnX@@`ššULWŽUXÅbWK@mULUUmJ@n¯b@l@VULVx„x‚XU`VXXJVI„V@nm`@nUŽVXn@lWVn@b@Jn@nU@Lm`@Xn@WJƒ¦U@@VnL„lV@@Xl`nIlJnkVL„w@KVK@UšaVL@bVKX™lUUKVK@I„VšL„a@U@WšLUlVL@bU@@blb@VlbUxVbXUVJ@xVL„U„lV@VU„bVLnKl„XJ@L‚b@an@VanL@`VLšKV_UWl@U_„a@WVInlVUUUVm@I@W@wVakIWm@U@ƒXwlaVbnI@ƒm»Va@aXaVLšU„»@aVa@k™KkL@KmU@WƒzUK@wU@VWUUVUUKUa@mKmbUK@_nWVaUkVaUaVUVLXKVƒVUVmVI@UkKkLm`UkW@UwWW_„UaU@WakXmK@xUXƒJkƒUUWUk@Wl—mJ@km@@aUKzmyVk„a@kkWVUU¯lmU@@w‚kkmV@Vk@mÅIƒ‚Ukƒaƒ@Ub@m@UUU`mUbWaWmb™X™XKWIXUWm@љ@y@UkIUJUUWLUWƒL@UkVUxW@kaWbKWnXxW¦n„m`XLVlUbVbUx™I@JmLUKUb@VW@@bkL@b@VlU@xkš@L@lƒxXxWXX°V@VVVbUVV@UVVbULVnVJUb²b‚aUb@VVVVInlV@VnXaVUšlI„VUb"],encodeOffsets:[[112478,22872]]}},{type:"Feature",id:"4504",properties:{name:"梧州市",cp:[110.9949,23.5052],childNum:6},geometry:{type:"Polygon",coordinates:["@@VbXblVlLXWln„wVV@VV@UnšWUXVbš‚@VWXa@kVK„UaVaVkšUlyX@Vaƒ—VmUwUaVU@UÈymI@aU°@š™nWV@VaVaw@IV@VmnLVK@kmmna@™„™VbVI@aV@XbW`U„„LUVVx„@VbUV@bl@VLXblJn¦lL„°°@n™@K@UlLnK„a°LWbnJ„¦UÒV„UllLlVnKnbWnn„V`„w‚@@Xa±™n™l@XKV_„WVkVa@kVyUa@wU£UW@UIVW‚@@a—wWaX_WKkVmUULmak@UJUI@±m»™—k@m»VyUIm™nmmwnkUmVaVIUn_mW@»Vk„@VwkmmUXa@IƒaVm—mƒ@Wm_U@mIUWóLmUk@laXmmkUK@UmKULUUmWULƒ@VakU™@Ub@bƒ¼™VUKWb@bUbn¼@„mJUakbWx@„@VXnlJUb@x@X@JUnVVUVmkUJ@XƒbV`k@VXU`™LUK@_mKUbm@@b@„U`@nlV@b„UnbVbn@@`VbUbVV¯bm@@mJXb@bVnUllVXUlbUl@LU¦VVmŽkLVb@b™l@V@XlK@V@nUJUz„°mŽwmLmlXbWVU@UUUlƒIU@VVmV@@¦‚bXbWxX„WlXVWL@LUmkbU@@LVVVJUblzna@WVnš@@lƒIUVnbV@Vlƒbkbm@ULUKV°ULƒ@"],encodeOffsets:[[112973,24863]]}},{type:"Feature",id:"4511",properties:{name:"贺州市",cp:[111.3135,24.4006],childNum:4},geometry:{type:"Polygon",coordinates:["@@nL@xn@lKVkšwn@„alLlaXV@„lx„bVWV@aUa@aUk@mVUnVl„XL@JV@VxVIVƒX@„b@bl@@`ÇnXVlI@l„xUnlVVLkllV„@nmJUxnzWJ@VXLlŽšLVxnL@l„LlŽVI@V@lUnl¤Uz™Kš@„Vl@š„L‚l„Lnš‚b@VnVVU@k„a‚Knxn@VkVJ@ńUlakmWIUaVanm@_UK@UVWUa@klXam™U@Vmƒ™VIXW„@lUVknVlKVLXŽVXšW@b@VlšnnVL@KXL‚Kn@lb@UnW°@Va„X„WVb°aVa@I¯aUkUaVKVwƒaXk@a„a‚™@wkm@alanUVw@alK@Umkw@UƒaUmU@WXUaUK@UW@UaVWI@¥Xa@w@WWšVƒXwƒU@mKUXUWVU@a¯kl@akU@UULmK¯VUVW@U_m`U@@xVbUz@lUbUlƒXU`WLk@mš²šWb@Ž@ƒxU_mƒXmmamLkUkKVkUƒVу¥mIXa¯KƒbmLkK@V@Lmš¯@ƒ¯kKm¥kIWaUKk@@aVUUaƒ@UwVUƒKVƒX_WaU@@bUJUaƒš@šmbnn@lULmKUnU@@J‚xUbUbU@mX™š¯@VŽ@bnJÇz@VUVVbVxUn„˜UbW@kz™VUlUbVbƒŽUL@lWb"],encodeOffsets:[[113220,24947]]}},{type:"Feature",id:"4507",properties:{name:"钦州市",cp:[109.0283,22.0935],childNum:3},geometry:{type:"Polygon",coordinates:["@@@IlVVlnL‚@œxla„al@n„VLlx@x@bXnV@@`mXX`lbnaVL@blV@b„wnx‚I@xXJ°nK‚l„š@lbnKnblUVanKVb„@lUnJVI„VUb@V‚U@m„L@Ul@Xw„llVVXV@lVnlVn„l@XVlK„@@_VWVxX@lb„U„nV@@JlbnIlmnVV@UwVK@U@k°a@mnIVVVK@nXLÆaVWXVK™™@_W@Umšw@UXWWkUUVWUIVaƒUkJ™UVWbUmU@mkUJUU@UVab±aVaUIUmVKUaVUU@VUUaUUU@W¯XWWw„w@k@Kl™@wkV@U@alK@aX@@UmIUWUIƒ@mmkXU`U_WJUnUJmUk@@amLU@UVW@UkU@@VƒbUWVUk@@wmKkUWLUWX@JmIƒlUkkKWKkLWU@UKWa@bU@@a@_UKWƒUUUmJmw@nV_@ġğKóLmbU¼VÆ@xUXƒ@Um@wklVnUn›lkaUV@„lV²WVklWXXbWlkVkIm`UUƒLƒUU@UWƒx@XU@@lWLU@kbUbV`UXllUV@bmb@LnKVbULm‚šnVVIV`X@"],encodeOffsets:[[110881,22742]]}},{type:"Feature",id:"4508",properties:{name:"贵港市",cp:[109.9402,23.3459],childNum:3},geometry:{type:"Polygon",coordinates:["@@n@VzUJ‚nVŽ„K@XšVš°nVVnšwVb@xVV„knJl™VVUbn„WL@bUxVVXš„bl@lVXkWƒXwWaa@¥‚@nUUUV@„JVkVVV@XUWanknK‚xnƒ¯VyVI@m@UkL@W@Ušk@aUalKnUUV¥@KVkkaWVkUVkUm@aWanI@n@°aUUVaUa@_m@UamaƒV@akU@mV_@ƒa@KWIkƒmLUKƒaUVU@ƒkƒVUK@wUIWVUaVwka@Uka@aV@@aUKVk™K@X@Vƒb™KƒU@JULVLkVWšUL@aUK™b@VUL@LƒxUKmlkImJk_@WU@ƒkmK@UV@„¥XIm@@Wn_@KmVm@@I@aUmkXm@UWV@mn_@mƒUUJWIUWV_WƒwU@mUknVVmxU@@VUV@zU@UVW@ƒK@šX@VLUVƒKƒz@J@VnX@`±bUXVƒ¼™lšn@xmxÝL@‚Ubn°@XWVUxUVVnkbWVXV@Xš`ÆȄKnƒlLVanIV`nLVUlƒ²ƒV@V¦„l°¦„w‚b@šnKnLVbVJšIVƒXK@b‚n@ènx@xVbUnV‚"],encodeOffsets:[[112568,24255]]}},{type:"Feature",id:"4506",properties:{name:"防城港市",cp:[108.0505,21.9287],childNum:3},geometry:{type:"Polygon",coordinates:["@@XV@X°°U„lxkbVlVb@nkbVl@xl@@b@n„‚XbVL@Vl@UbV@@JVLXbmV@bVVUXUJU²šW„XlKVb„@VVXKlXšWlXXWV@VXJlI@x„l@nlbn@lln@lbXalIVK@ƒVwœUVb‚U@aXylUX@@aW@U_UJmU™nVKUamL@Kna@aVUkkVWU_ValaV@XK@kV@@W„wVXV@„V„KVVn_lJlUXkWaXWlkXU‚±kU@ƒVUlbœkVmUmlk™¯Ý™™W@mb@¦VxULm™kJUU@ma¯wƒmkX@VóJ±bUVUXÝWk™lWXXlƒxUaƒbƒIğ™Ç@U@mVUKkkm@UJm@XnWV@x"],encodeOffsets:[[110070,22174]]}},{type:"Feature",id:"4505",properties:{name:"北海市",cp:[109.314,21.6211],childNum:2},geometry:{type:"Polygon",coordinates:["@@VaVLnK@IšJVwUaVaUkWKn_mƒX¥WwXm‚LXalbU£UyV„Å@ݙwm@™°l›LÅUƒmk™mwÛaƑLÝUUm@ȣƃV_„Ó@£UƒƒUVƒ„™¼U°W̄™ÞVbXbôx@b@bmV@ǃ™UÝ@@ĢU`m@ŽnxnIVV‚VX„VL@`@bV@@aXbVL‚@XVlKXLlLVl„knJ@I‚WVXXKlVnL@xl@UVVX„a@UV@VlX@VUV@nK@bl@nVVIVmXIV`V_lWnn„@VJVXnJ"],encodeOffsets:[[112242,22444]]}}],UTF8Encoding:!0} +}),n("echarts/util/mapData/geoJson/gui_zhou_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"5203",properties:{name:"遵义市",cp:[106.908,28.1744],childNum:14},geometry:{type:"MultiPolygon",coordinates:[["@@@UnUlJn„w‚JU°VL@bnVšU„wlJ@XƒŽXVlU@klVUJknl„UllL@bUJ@xULUlƒ„UblVkblbnw‚UXmla@„wV@VK@L@UXaVKVLXWƒUVa@U@Im@@W@£UKUakKWIXU@al@@llUnL@W@Un@@VlUV@VIUanKl@Xb@lmxVb@b°bb@nlJVVnnJ@b@L‚V@ln„@LmV@Vx@blnVK„nlJXIlw„J@҄b@nlK@Un@UL@VVVVUUUVK„l„@VUVL„J@UVUUw„@Wm@™„UV„ÈVlbUb@JšLlŽX@@x„„ƒLmŽk@@nlx@bUJUzVJ„@@LVxUV@bWxnLnVVK@_‚K²xVbV@n¥@aVI@b„@l@Va„Knb@n‚`n„mmý„W@ƒU_šwV@VlVV@Vn@n„˜@nI@Jn@°¦VaUU@™„mVVWVaUńU@aVKnƒVbVUmmU@a@kUw™m@aUUmUUJ¯lakU‚aXaWUUaVƒkk„amkmUnVlULƒVlJ@XU@UJWUUw„k@aU@WbkWƒL@U@WU@@XUKmV@aUVwUĕUJUamUUVUÑm™nIVJ@kl@XalJVn@KVLœ¥@UWIXWmU@mVUKnUWLUKUaWUUKVU@U@anUny@UlUkK@w@a@aVUƒ»UkVw@Wmk—JƒÅmUUVmwXalLXWWUnam@XkƒJ@UVU@U@W„@@U@I@Wl@Ènlw@KXLWb„lVUkalKUU„VVaV@@wnIlaUmkUƒKWU@KkUkLWaƒKUUWUn@VƒK@LnnWJUIƒVkUWVnV@V™@@XƒK@VUIUJ@IWJkX@VVJ™IƒVkK@I@UVaUWk@m„@wnUWKk@mxk@@„lV@b„xmb@x@VUmLkUƒJ@nVV@b@VkLVbU`¯I›l@™U_UW@UU@™™ƒK¯wm@™xƒL¯¥kIƒ™ƒ‚@bkbƒ@Ua@ƒm@kkW@XVbmV@ŽkV@bWbUbV@„¦ƒxXlmVk@ƒ¦™bkaWL@KUImK@wUK@VUI™b@bmK@LÅy@akXW@kbWlXblL@ŽULUbƒ`@U™kUymX¯@mšUJUUJƒL@Lm@@WX@lU„VlšXll„@l@Èk°V°Ž„X@VU@UVll@XUJVXUVm@@VXLWlnV@Xƒšk@mVULnxV@@bm‚kL@VWLUbU@UVm@ƒb@ķ¥UnmJ@UUVƒkkJUšlÔU`UIW@ƒ°kLUlUI@WVI™U@mWKkXk@ƒ‚WU@bXšW„@J@xX@l@LVl@xšLVxXX@x‚KnxVknb‚KVV@U„L„WlXU`@nUlšX@llVXšVU„KlkUKlI@anKVLXKVaUIVWV_VK@VnLlU„»VKVL„m"],["@@@KlKkUUVVX"]],encodeOffsets:[[[108799,29239]],[[110532,27822]]]}},{type:"Feature",id:"5226",properties:{name:"黔东南苗族侗族自治州",cp:[108.4241,26.4166],childNum:17},geometry:{type:"MultiPolygon",coordinates:[["@@VV@XkV@bUbWJU¼Vb@Vnb@bš„@J@bƒL@LV@UVƒlUI@a™KULVb@bkJmx„šlLVxknVJk„‚xnKmnnL@bn`WIXlWLU@UxVbUVmKV„XI@JVIVJ@U„L@Wš@@UmUXUlV„UVJXImm@K„L@UVmVXV‚„LXblKlV@LXV„LlVVnkbmJ@xnXl@šbXa‚@Vana„ÒšL„m‚VnIl‚Þ¦°k@b„@@lV„nJlUnš‚VX_„@lVlK„šV„UUxVLVWVIXJšUlnnWlI@KUaUUVKn@VaVXV@na@ƒmw¯@mUkJUamI@lk@@am@@I„ƒUmVImUUw˜™@anUVaUU@LU@WaWUXWW„wV@VwnU@L@ynbl@@X@a„J@nW@@Vn@„lVLlxnI„lš@@UWKUƒnIlJXIVllIVVš¼XK@aVI„V‚@@bn@VKXLVKVVVInw„J@UWI@mX@WKnI@KmU„UVJUL@V„KW@@k„@aU@@W@InJWUXwWI@Wƒ@¯wkaVaUIl@nŽValIXWWI@UUm@anwWkXWWIUbk@UJmIUamKVUUUVVama¯VkIVVUlKnXVwX@@WVaUUVa@IlƒaVmƒkna›wk™UU@ƒU@mUVƒšUVwœl°LVbnJVU™¯la@mX@@UWKXU@aV_V@@JlkUƒ¯@V™nK@km¯k„U@ƒWUW@mmƒU@™kmlU@wkL@WƒUkL@VmLƒJ@b@V@bknUUVK@UVKUK@Uk@Wa@LUVVnUbmVk@@UU@@aƒV¯K@U@UU@WmUL@aU@WV—w@ƒ˜I„xXll@UX‚K@KXXVJna@wWaƒ£naUKV„m@UU@mUmalm@@XkVm@U@VƒLmWU@kkWxU@@bVV@VkXVlƒVƒ@UUk@@ƒmI@KUw„m@UmVƒUUwU@lwkV@IUa@mUaVIVKVa@w@U@™UJkb@n@bmJ@XmlVUxWXkJmUkUUVW™xUlU@ƒaULUšmbU@@‚WXkmƒL@xUV@nUxÇm@„XLWbnlƒnV‚nnUV˜U‚nVVz„@lbUVVlULVb@V@nUJkwm@Ux@bWbUK@UULka›JbƒU™U@U@lUK@XUJmn™J@bU@UwWa™x@zkJWnUJUUVšVV@bXn@xVb@J™L™m@X™w@`@bkb@VmXUV¯L@mW@@n@V@‚ƒL@K—IW@@aƒaUx¯@U„m@XbW@@L„V@bnVWVkKUzlV@bÆa@lnI@VV@@LnVVKUaV_VJVbnU@bn@‚‚nX@yVIVxXKVLlUVaXU°J","@@@KlKkUUVVX"],["@@UUVUkUmV@ln@VXVK@K"]],encodeOffsets:[[[110318,27214],[110532,27822]],[[112219,27394]]]}},{type:"Feature",id:"5224",properties:{name:"毕节地区",cp:[105.1611,27.0648],childNum:8},geometry:{type:"Polygon",coordinates:["@@UkVƒ@k‚W@Xn@@K„KVIVVIn™°@nWVzšl@V„_VaVK@kKWaXklaX@lW@bÆz@KnL@ašaVJ@UVL@xnLVJ@LXKlbša„¥l@nUWk„wƒ¥U@VaXa@amLkUƒKmƒ¯kƒmkIUaƒKUIWƒkKm@anw@mlwXIƒmƒUk¯@a@amUƒ`kkKWVkxmUUak_mJmw@w„mXUW¯X›_@WnI@aVwkWWýŃU@WLkU™aUbVV@lUVVnm@kUmV¯™kK™LƒwmVUUaWV™aaWw¯wƒÈ@VULUVUUƒK@nWJkI™l@Umxnbm@kbUJƒa¯bUbVxmLUV™aU@VUUWxkVVV@bUV@XWbnlUbƒbUJlbUV¯b@z„`WbXnmbƒaƒwUwVWUƒbUxmbU@Uam™@Vƒk™VaƒwVaUƒWI@mUKóz@lUlÅ@WIƒb@xXxml@XklULWKUmwUa¯KUXWJkaULmKkLWbkKUVƒImƒƒWa@kUaULƒW¯LƒK¯@kbƒL@b™x@J@bmnnlUšlzU`U@@Uƒb@„m‚n¦°bU„Vx@bkVm¼mx@mk™mVV@bkxVn„aVV@bU@mL@b²`lIVV@lXLlš„bVxn@@bl@XllIVšnbVšn°°wlbXw@mVa°lVnU@mš™VLVbn@@b„@@WVnUV@Xlxn`VznJVb@L@bV`V@šUnwšU„@WUXKV@UUlmUUlaXalLšm„bšIVbnJVIlVVaUUnWVXn‚VL‚k@ƒnWnblnlb²x„xVKVXlVXLVW„LlUVJna@wVL„¼@JVX@`@nnx@nWJU@Vx@XXKšŽUblxUš°„LVKVVlL@KnbVUnJ„IlUšƒnKl£VW„x„IlJ@nšVÞUVVnb‚VX@V_°lnK","@@@UmWUwkU@Um@@VkL@V@„„‚V„VkV@nbVa@ƒ"],encodeOffsets:[[108552,28412],[107213,27445]]}},{type:"Feature",id:"5227",properties:{name:"黔南布依族苗族自治州",cp:[107.2485,25.8398],childNum:12},geometry:{type:"Polygon",coordinates:["@@‚V@IöalK@UV@@KUaVIVVœLlaVbVWnX@‚@LnUlxl@naVLXVVaVU„J@lUUanWWI„@VlV@Xbƒb@V„n@VmVVbk@kU@V›V@X„J@zn`ULW@kK@_WVUK@LUb@Jlxn@nnWlU@@b„x@XVVU@UbVb‚@n`VI@VVLUlUIUV@KmL@VV@XIV@@lVLVmXV„@WLXLW@U`šnkb@Vl@UL@VVV„L„llX@`lIXb„J˜IXW„L‚aVL@ŽXXW‚Ģ™b@bmK@L@°@Vnxmxšn„K@xVn@VkL@V™Lƒakbl`VnnxVnUlššV@@VVXV`@šœk°JV_UalK@U@aUU@m„IlVnK‚V@U@wnaƒw@akU@ƒl@nwl@XLmV@xnƒl@VXUb@V@JlL„UšJUI@UlWUƒnLVUUaVwV@XKWkXJm_@amKnmmLwlƒUIlmUwkKƒ™nwlI@aUaVKšL@bVJ„kVUU@@K„K@a@I™ƒ@ama@UUaV»XIVa@alU@WUU¯IWVUbkVUKWLUwUJ@zmWm@@amVUaUIU`VbULmU@KU@@UmJ@kÅb@akUVylLXUmU@aƒU@KX@Wan@Vƒ°@Vw„b@bX@˜J@L„K@@U@mX@@n°KVUnW@Ula@a@_šx@WšnšK@IUa@wWm@aUUU™VVVIXmlI@yšwXbVxV@@ašInmVI@WVL@k@VšV„V‚aœIlbVK@VVLXa@aVwn@lxVI@m@UUaVKUkVUkaƒ@UymUV—VUmmU„mmkXaWK@ƒÈnVw@mVU@w„KlnXW@V@naV™VKUk@KVIUWƒ@mk@KXU@Um@@lVƒk@UVJna@UWaƒL@a@ƒXa@kmmVUUk@mkkƒamJ—ImJUUmIm±aUUkambkamVUU@VlbUbVVƒxX„WVUU@VUakU@UmUV‚U@mnUVVnUbVJ@b—UW¥kLVamVkUaWJU_UVWKk@@nl„UVVJUXm@Vm@UnVlmbnmJUbULU@@UUKWVIWxnJVb@xUL@bUJWIkxƒbkb@xVJƒbmU@kW±LkKUkVa@a¯am¥ULkalÑlKXUWƒXƒaVakImVƒ@ka@UUƒJ¯aƒX™mmb—KWU@wUUƒaUa™KmU@UXlWb—¼WLUKUb°„UlVbkbVL@VƒšƒJ@nVlUbUXmJ@VX@lbUbU@@bWb@VnLVJ@bVVUz„ŽVL@lnL@b™VVVULmKUk™Jkbm@ƒxVb@V—kƒKVnnV@b@ŽWXU‚„nV„l‚VVXVJUXlVXbWV@VU@Ubk@@KWbUUmL@JnXV°XJ@_‚`UbkXVVlÆkbƒ@VLXVV@‚V@k„KXX@`V@@n"],encodeOffsets:[[108912,26905]]}},{type:"Feature",id:"5222",properties:{name:"铜仁地区",cp:[108.6218,28.0096],childNum:10},geometry:{type:"Polygon",coordinates:["@@°a@aÈbVUlU@aVKnVV„VUlyX¹lWVa@U™VƒnUVU@m™@mUl@„mÞw„@‚xnIVbna@KVI‚J@kwV¥ƒUXÇVkVW@kkKWU@aXUWmnIVa°VXbmL@VVbnVVVUb™VbšJVbVKXkVKVanU@aWnWUWa@U™nk@mVIVK@wXxlLXbVJVlKœbl@VI@mšaXalVV„VbX@@ašalnkx@b@V‚b@Vnx@bVVUXn¤WXn@Vl@Vlzn@š`@I@KUU@ƒV£namVkXa@aVK‚nnU@anVlKƒa@UUU@amk@»kƒU¯@aš„VWnkWmkImU@akaVm@»VUV@UKnkW¯XWlkUKnIWaš@nmlIXmWUnwUwWm@wULmaUJkIUaƒaWa—klwkwmJmU@bkJ@XUJ¯W@XbWbUKUkWJUUVKnn@UmmXUWa@mU@@UI@WmXVykwm@kaULWwU@¯ƒlKUUVU@mU@UkmaUbmV@b—š‚xVnVUJVnƒ„@Jn@@bl@@knJVblInV°@nx@„mbU@UWUbm@ULVVVb@LkJmXkm™VWIUJUXUKVwƒV™UƒŽkLkUƒ@W`Um™kVmIUƒ@kƒ@@a¯lÝ¥kmJUƒn™KƒÑmbUb@Wb™ak@mWU@UbƒUVVkLlbUVƒkXaWK@LkxÇmk@@X@J@Vƒ@@X@VUV@V„IWln@mbXVWXkKWbnxVUnV„ƘInl@XUxVl„¼UV@b@b@xlLkV@VmzmV@b@VUVVLXVVbVLXKmVVLU‚@nnVWXXJ@V›¦UK@LUmkIWbk@@lUImJnšVÒVUnVVbVIVĖUxV‚@bnUVL@WV@@X@V„KlXXaV@@bƒlVxXVVIV@@WkI„UVKUkVmlnnŽƒbllU„VbXVWbblVkb°ŽVInVVV@bšnVx@l@bnVVnUŽUam„UL@bƒVVÆUbUXU‚ƒn@šVVUb"],encodeOffsets:[[110667,29785]]}},{type:"Feature",id:"5223",properties:{name:"黔西南布依族苗族自治州",cp:[105.5347,25.3949],childNum:8},geometry:{type:"Polygon",coordinates:["@@VL@Vl@@IXW@kVUVbnW@XlKVVnU„VlL@b„aVbƒb@xX‚°ÔUxV@kbm@VxkxWJœ„V¦ƒŽ@ÈnšVKšxWXJmV@n„Ò@xVbn@@blLk`VX@bššla²JVUlnn@U±lw@wnw@mlwVIX@@m@klKnk‚a„KnwmmXkƍVm„Uš¥l@nb°n@„aVwVmVIVnI@a„¯@mšU°ƒl@@VnI@JV@UV@b@IUbVJmXöºƒzllUbVa@aXUl@„U@llLnKVaUa@UmK@UšwV„bnKV@VwVK@UXƒV@Vbn@‚w@U„WnX‚@„a@m„I„™@UUKlaUaVk¯ƒVaVLXK˜»XaWk¯mƒkğwmW@mIƒVkwƒJUIšÇVwU™UkVKkƒm@UkmU@WÅwm£Vƒ„m¤¯IkJWa™_™lUbmJzÝJk„ƒUÇVU„ƒ‚@bU„Ýn™m¯LUb@`mL@VkL@VƒUmmk@UU±Umka@kUƒ@ķymUkk@mmkÝmUaUakImV@V@VÅLƒ¦ƒJUXmJXšWb@n°Æœx‚¼nV@LlbUŽUbmL¯@ÞbV¤nbVx@bUVlblIœ™@KVVUnVJUn@VlLUlmLUUUxmK@I@@VW@@bU@UJmUkLVVUl@b@V"],encodeOffsets:[[107157,25965]]}},{type:"Feature",id:"5202",properties:{name:"六盘水市",cp:[104.7546,26.0925],childNum:5},geometry:{type:"MultiPolygon",coordinates:[["@@ôyVL@nXJV„Ub„x‚bUŽlšU„@ŽšnŽVbV@naVw„a‚VUXVx„x„bnaWmXaƒ_@y°aVUkaVI„aVamkXa@WVU@aUUlUXwVV@UVšbVUnKUwVa°a„bVIlan@manw@VšklJXI@m„LVVVUVK@U„ǃk@KUa@UkaVU@UVWV_XWVXVWlLXKlLXaÆKšwVL@akKm@Uwƒ@@XUVk@VUI@wWK@aUV™I@UkK@ƒmL™Wƒ@kImJƒUÅVmkXUW@UJkx@nmx@xkxV²m@kmUV±Ikb™™@aUWl_kK@am@Ua@wƒÑ@mnUWIX™wULm™@DŽU¥›ƒXIlwUwn@laU@Vw¯ÓW@w„aUaƒb@akKƒUmVUUkL@WmXUaUV@lWX@Jk@@UUKULmLUJmzkKmVX°VšUnWKUL™ƒƒL@mU@UnVJ@b@„UV@Xƒ`m_@l@@bmbXJmnnš@°˜wnn@ŽVLX@V‚@nVl@nk@@b‚l@nn°WlXzW`XXVKnUlxVbUb@‚V„Xb@Ž‚VxÈbVlnbmn@ŽkVUL@„ƒŽmLUVVL"],["@@@ƒ@UmWUwkU@Um@@VkL@V@„„‚@„V@VkV@nbVa"]],encodeOffsets:[[[107089,27181]],[[107213,27479]]]}},{type:"Feature",id:"5204",properties:{name:"安顺市",cp:[105.9082,25.9882],childNum:6},geometry:{type:"Polygon",coordinates:["@@lL@bUK™xÅLWbkKWLkKUXUWWXU`UX@VUVlb@VVb@L„l°xXx‚bšbXUVb‚VnU„xšKlL°šnUlVn@UmVU@kUUVašblVXKV@ƄXþlXUxnU@mVK@_@ml@UU„@šblU@KnLVyUw„@@UmkšWVw@UVK@VXzVK@n„VVUUW@kVJnlaš@nKW™kaWL@U—™õb@JU@mU@@_WWƒL@lUU@WUUK„@lakÅUUlWVa_@`WIU¯mW@InKVVXa@Ll@VaV@@UXUWakUVWUIUW‚UkUƒƒmVXW@@amUUm„L˜l@UUa„wn@lašIVlnLVKUUšU@amK@kUKƒVyUU@aUImK@UXa@aV@VakaW@@UnIVWVaUkƒb@mWƒX@Vxm@UaU@W„@VULUxU@mLƒaUŽ™x@VnL@VVbUbmLkK@kƒVk@WV@bUbVakk„yõ¹nWUIVa@J@aVUU@@ImJ@Uk@¯„™V@nƒ°@bmJUUJUnUxƒbm@¯Žmak@™¦ƒVUnŎWlnnmxƒLbmlkL@l@nWVnlÆU„VnIlJ„@šXnK@„lL@VšJVU@bXL@xVJUl@VU@W„@Vxn@"],encodeOffsets:[[108237,26792]]}},{type:"Feature",id:"5201",properties:{name:"贵阳市",cp:[106.6992,26.7682],childNum:5},geometry:{type:"Polygon",coordinates:["@@nŽlLX„VJ„LVblJ„n°ln„„LlVnKlU@nUUa@WlX@l„n@‚Vb„@la@a„„šlJ°¦„Kšwn@°x„LVkUmmwUmk_la„bšK@UlK@UUm@wƒL™mnwmw@U@¯@KnL@aša‚ġXWW@UKbƒKWX—JƒIWakJ@_kWƒkƒKUU@UVKk@@Ula™mV_X@WKXKƒ@WUUnUK@kU@WJU@@UnK@LVUVJVkUK@UUJm_@UaVaV@UU@Wƒw@aV@Xkmmm@kw@IVa@KVLXU@`lLX@VKm_@yƒI@WœU@UlVl@UanU@Uƒm@U„aWaU@Ukƒ@XJmXVbkV@ŽƒIUVUbWUUKmbk@kwmV@K@mWUXUakb›KUUUJVb@LU@@VkL˜š@VXKlbXšmL™@kbm‚UI@lVXUVƒU@mULWy@UUL@VUx™Xnl@Vƒ@VxUzmK@LkV™aƒ@VVk@@n@`UL@nmV@bmJ@Xœ`WX°WVƒn@xnxnIl`VbnVlwXUlLl‚„_nV@b@bl°„V„nWJkx@nmx@b"],encodeOffsets:[[108945,27760]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/hai_nan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"469003",properties:{name:"儋州市",cp:[109.3291,19.5653],childNum:1},geometry:{type:"Polygon",coordinates:["@@஼jpnr’``ŽpRVHʘ̤žZt^JÖA˜[†CâlTébQhRPOhMBcRSQiROE[FYdGNOEIH]MgEAMLLIAG_WMCSL@ED]PCLYC[ZIHgjSxJTMbHNEFCMEE_HSDFHSLECRNSFDRICHNADGPI\\RZGIJTIAHLDQOHG`GTNCOIC@eIGDWHIS[kiE[FMbECZS@KKS[FDWsCeRuU_DUQNOE[LKGUBM¨EDQP@HWHGDImXƒCog_~‹I_fGDG|QDUWKBC\\ore|}[KLsISBHVXHCN`lNdQLOnFJSXcUEJMCKSHOUMDIm_‹DI`kNDIGEYFM\\YPEEIPMSGLIKOVAU_EBGQ@CIk`WGGDUM_XcIOLCJphHT_NCISG_R@V]\\OjSGAQSAKF]@q^mGFKSW^cQUC[]T}SGD@^_ˆaRUTO@OHATŸ”"],encodeOffsets:[[111506,20018]]}},{type:"Feature",id:"469005",properties:{name:"文昌市",cp:[110.8905,19.7823],childNum:1},geometry:{type:"Polygon",coordinates:["@@€hIJ¤Ī¯LQDaFßL[VQìw€G‚F~Z^Ab[€¹ZYöpFº lN®D´INQQk]U‘[GSU©S_­c‹}aoSiA£cŁ¡©EiQeU­qWoESKSSOmwŸćõWkàmJMAAMMCWHGoM]gA[FGZLZCTURFNBncVOXCdGB@TSbk\\gDOKMNKWQHIvXDJ\\VDTXPERHJMFNj@OwX@LOTGzL^GHN^@RPHPE^KTDhhtBjZL[Pg@MNGLEdHV[HbRb@JHEV_NKLBRTPZhERHJcH^HDRlZJOPGdDJPOpXTETaV[GOZXTARQTRLBLWDa^QAF`ENUPBP…\\Eji`yºEvåà"],encodeOffsets:[[113115,20665]]}},{type:"Feature",id:"469033",properties:{name:"乐东黎族自治县",cp:[109.0283,18.6301],childNum:1},geometry:{type:"Polygon",coordinates:["@@ªVLP`@PEdNRAHOPEAKHEVL`GZBJfvdTAXNNTZJFPrHHNpKTD\\ILHbEVd^J‚OHLh@NNBnHP`\\xH@NBRLJTlŽNv_^CTLd@bNDVFbxdFV€UPBTKOGEOUO@OEBXQP[H_EI\\EbeYa@UO_J‹MEJ_IEDKJUGMDcNUd_FMTEJSGoZ]EIYGO[YW‘gEQ]a@WHEDQKUSDUGAbYBUpSCYNiWqOSQEoF[UcQISWWNMSDe_cLQ_UBiKQOOASQAWgS­ā]ZaŽSPÝZ]XMXSŒ[^oVËNgNKlE RôEø"],encodeOffsets:[[111263,19164]]}},{type:"Feature",id:"4602",properties:{name:"三亚市",cp:[109.3716,18.3698],childNum:1},geometry:{type:"Polygon",coordinates:["@@®ĂhTBXTRPBRPjLVAR`dKf`TC‚NXMTXRJVdE\\FpTRrPjXZMTDVoZABaVHTCLVCRGF@X^bFR’hZXP\\ZHHMA[^wBWXJlW¤EJ[bCTOF‹WWMm@ILMGWQ@DQ^QNWFSHEbF`OXNbO„VNKTEPDTLTCCVTREfvfEHNbRAENH^RJXCFHNFRpVGHWISDOTMVCZeGamaLoLÛD¹¹ėgsia{OųE—Tt‰lɂwr}jŸR±E{L}j]HąKÃT[P"],encodeOffsets:[[111547,18737]]}},{type:"Feature",id:"469036",properties:{name:"琼中黎族苗族自治县",cp:[109.8413,19.0736],childNum:1},geometry:{type:"Polygon",coordinates:["@@bRFnHNbHŒgN@NPEnbXP@bND`NT\\@\\QZb@`@J]V@XhžDpW„nCJGHGXO@CR§FANHVKLF\\MPVR`CvVfQtDPKpGHG@S`WJP~^dSTHWX\\RHTFACQTIAUPOU@MG__IaYSFQK‘NSbORHXCZeTFJg„B`YBMNMFi~IVDV[tGJWXGDQRGF]ˆJrALgESLSAYDGIaFeXQLS\\MKSLSQYJY}eKO[EHiGSaK[Yw[bmdURgEK^_kcSGEOHKIAS]aFSU@Y]IWFUTYlkP_CUOUEkmYbSQK@EMWUuAU\\M@EpK^_ZMDQ^OXwC_ZODBrERURGVVZ\\DTXcFWNIAWJWAYUUFYEWLQQaCIZeDM`cLKRGpanJZQd"],encodeOffsets:[[112153,19488]]}},{type:"Feature",id:"469007",properties:{name:"东方市",cp:[108.8498,19.0414],childNum:1},geometry:{type:"Polygon",coordinates:["@@ºŸx‹JYZQ”IŠYXLl@dR\\WZEn]bA\\S~F`KXaDeTiNO^EEKWEDQXITBXaWaDQMUJOIaTWf@NJV@dSxGZ‰Fu_@WMKAUˆ}AQ@MwG_[GOAmMMg@GKP]IUcaFKG[JSCoLGMqGEOYIMSWMSBucIeYA_HUKGFBLOFGPQBcMOF_@KO©UAtERadwZQ\\@ÊJÒgòUĪRlR°KĮVŽLJ"],encodeOffsets:[[111208,19833]]}},{type:"Feature",id:"4601",properties:{name:"海口市",cp:[110.3893,19.8516],childNum:1},geometry:{type:"Polygon",coordinates:["@@ńZƂtĢ¬æßFuz¹j_Fi†[AOVOFME_RBb]XCAKQKRSBQWSPY\\HbUFSWSPoIOcCOHIPkYCQ]GdGGIFQYgSOAQLK`MFUIGa@aQ\\GGUFcHKNMh@\\OYKAigsCgLSF]GOQO]@GM]HyKSHKPW@Pxi@EMINYREXWRQ@MQcFGWIAwXGRH\\yDI`KJIdOCGRNPNtd\\UTMbQYi@]JeYOWaL[EcICMUJqWGDNZEXGJWFEXNbZRELFV]XQbAZFrYVUBCLNFCHmJaMIDDHXHEhQNXZ_TARFHVB@DTQIRR@YHAJVnAbKFUEMLd\\c^ÍÞ"],encodeOffsets:[[112711,20572]]}},{type:"Feature",id:"469006",properties:{name:"万宁市",cp:[110.3137,18.8388],childNum:1},geometry:{type:"Polygon",coordinates:["@@^J@ZTVbET^JBGLFPTHld]`FLQhcVanx\\\\ZbLHTGj\\FLP~fIZRZPVTQFSVAFJE^NDLEE[~LjsxVTG\\NZZNGlLRRGLJTV@hPZANN^@T\\NEPPbDZXO`d^HSvcJDIV\\XZAJUFCLNP@PQ¤@[ïKLÑIÏ]ÇE±I{uƒ­YśUćFcYUmsVeBSVgB[RO@aYYPO^]@UVaNeDShMLG\\EfFVE\\F`"],encodeOffsets:[[112657,19182]]}},{type:"Feature",id:"469027",properties:{name:"澄迈县",cp:[109.9937,19.7314],childNum:1},geometry:{type:"Polygon",coordinates:["@@T\\GJCXJH@fJDDPNCNJENN^NLHBNSx@DDYbBLLDRbjZTj@`XXTlG^Xr@PJLW\\WLTlWR@HDJTD@X_PO@STMDNTMVV@NLDM`M\\XM\\JNBH[PYZ‡úYzŸ`Ċ\\ÎÝd]c[NKVFLEBaUmBIZGQ@JQSR@CUAEGBQ`SWYRMFgWGCGJCbNnIDGMEDKVAZUEqBYRa^WEUFKYQMaFWXEHIFWMYHCrXVIIiaK@aMCUYNSIISTwXALKH@XWXIEIJQCG[IEQDE_XSBaa[AIPW@]RS[FWS[CD]PEBYNGFSaSyJG]@ugEUDQlGHiBKHUIoNSKqHFaPMICK]UUHIPDJMuCA[SCPIDIOILGAEmU[POPBVSJDREBGS[QXWSGcT}]IO_X@TGHoHOLCX\\ELT@LYTD‚aFENF\\lj"],encodeOffsets:[[112385,19987]]}},{type:"Feature",id:"469030",properties:{name:"白沙黎族自治县",cp:[109.3703,19.211],childNum:1},geometry:{type:"Polygon",coordinates:["@@D\\RV]dTXELnHr]^@LETBBRTHPi^[@U`QTHDJ`MGSogDIPKdJ`WVNHCXHl_DJR@AH`FBVPUJLHKNTJOFFZON[ZEHFCJlMJ_ŒCn`CJVNGPLTNDFIdVTWEIPmRKMc_kDMWGGUTAtJLK~\\f{pqD[LAVXRCH{HC`eŒJ`}@W^U@I@_Ya[R[@MSC_aMO@aWFmMOM@‹haGGMEmaQ[@MESHaIQJQ……MckBIw[AOSKKAMPSDSLOAV_@@`KJRbKRDfMdHZERgAWVsDMTUHqOUr@VQXTT@Tƒfg‚L^NH\\@heTCZaESNObHPƒHeZF\\X^ElM^F^"],encodeOffsets:[[111665,19890]]}},{type:"Feature",id:"469002",properties:{name:"琼海市",cp:[110.4208,19.224],childNum:1},geometry:{type:"Polygon",coordinates:["@@TP\\pATHTGlZDJGAQjE\\Rb@jVBDCN`JZ[NCNHNXbULPrP\\KNbMTLjJJRFP`“pNLZz^FLRHjVPZ@hxVKbHBHMNNJFRlLzGPnNHhIrHHADcPWdUAmEMVQDSKYHY\\EhBN^HpXGNDBNNBnIß‹Å_g{³So]ã@ORO@KMEDIVYB[WJUICudGTc]P_YWaCOOMFS[]@MMYBgOU@ISHKQQkKMHYY[MSHwUit}KF\\KFMCF]EIUBETSROUKTLT[NKTWREfJbCHBZKTFTKh"],encodeOffsets:[[112763,19595]]}},{type:"Feature",id:"469031",properties:{name:"昌江黎族自治县",cp:[109.0407,19.2137],childNum:1},geometry:{type:"Polygon",coordinates:["@@`ZĤd–`òüˆ˜ “BSPGP@VSbQ`‡@]HC~T^SE]N]FkW]E[fY„GGOPaTMbFDYfS@g[MGK]h„e@SSSRW@UVqrPVGNStCXUhBFQGYNcCeLQQaLI@_`@EUwcEaCUaMc@SK]Du`MSkKI‡~BVNL@X`‚EvYŠwHcTU@MIe@SXJbIPNVCRXbWbSAWJCRXFFL]FMPSjCfWb_L}E[TaBm^YF[XcQk@WK‰Z“JYRIZwŒ¹ "],encodeOffsets:[[111208,19833]]}},{type:"Feature",id:"469028",properties:{name:"临高县",cp:[109.6957,19.8063],childNum:1},geometry:{type:"Polygon",coordinates:["@@jD`hNd\\^dZädĒH´Op@ˆùZY\\OAGIMN[[W_NCNMKU@NUMSNCTSP@`O@WSCCI@GXQSkXKX[IK@OWqH]SkWW@_SiiYQaKCAKZaCCw@MTGAMKM]FMMIMDSM_HGHRPKCBGSJJIYH[QOJCHMBDGQJECMTDQKFGTCEGTF`NFEDMFaGSNwIiTGhYJD\\KZODC^@FTKND`XBHKJNKFBNhG^FJMPcHEZF\\QPRjQTAdgNOPgQaRSê"],encodeOffsets:[[112122,20431]]}},{type:"Feature",id:"469034",properties:{name:"陵水黎族自治县",cp:[109.9924,18.5415],childNum:1},geometry:{type:"Polygon",coordinates:["@@R]NC`YL]FoN@V[vBXVFNL@TRZalnVFVP`DlOZkVSXEE_F[EUFeH[NKTgfCbMVU^@P]ZObZP@\\QhATUfAtUasñiāEoI]eYǯ@aKmaeƒWuCºKÜKpnbHbYfUDSNCPJTRAHJTDJSfDNLHXC``VBNGTYCQDIXMDSP@xLNEFRNXBIpVNLXah@RgF@`qOML@LJNSPLbaHAh@Jdj"],encodeOffsets:[[112409,19261]]}},{type:"Feature",id:"469026",properties:{name:"屯昌县",cp:[110.0377,19.362],childNum:1},geometry:{type:"Polygon",coordinates:["@@\\OnVBFKHPJCJOJTDB\\vDINOCGJVVL^JDONEbrGTLpMVJLGjAHGRkVChF@vH^zIbTETMHAZOFC^\\DXT\\EffAP\\PdAV@UIYfS|S@YPICMeM@sC[_A]VQEwyHSMuNcAUlQJMVGMS@mVBZPFO\\CSFQK[LqDMACiUa@[QiFBRIHYCHkGSBS[oSOqB‡IE^QHCRWHIXsHU\\UC}JEjMNAN_ZƒAIhSEYfWDQGaPMTL’ERZTJb``NHV@"],encodeOffsets:[[112513,19852]]}},{type:"Feature",id:"469025",properties:{name:"定安县",cp:[110.3384,19.4698],childNum:1},geometry:{type:"Polygon",coordinates:["@@JjDNdJ\\FbKPXfZ^Ij@RZNaVSc[MsMOHQPDJcLIJ_zCG[HQxWJBHXdENRR@XQFWZQQGOFSWUCI[WCJuRGLXNMPLhCl[Ta@SqGgJMGOmyHkKEQMINMAGaGULgwY@UOGiKQ]EYyMK”oO_QEIIKiNSMa[LqOKOaVMWMGMDY\\_IKrL\\ERT[DEPYOUA@nNTUHINkRBVMdNvGTxzRF^U`BD\\@tfNDNOJ@Z{TeTJZ@VU€cB[OBOeeQT@^OXBJb\\AbWTF`RCJFH\\RDJIJFXW@WLGBKxWTSJJMTVZND@bbL"],encodeOffsets:[[112903,20139]]}},{type:"Feature",id:"469035",properties:{name:"保亭黎族苗族自治县",cp:[109.6284,18.6108],childNum:1},geometry:{type:"Polygon",coordinates:["@@FJp@fxpQ\\ApN\\GNPNBM`HLMrXLXj\\PEHnI@WUCEM\\GTc\\GZYHTPBHRCPTd€H\\K\\@HXi–BJILJJAVNTOZJNtFPC`YxDPWci@IBgbGKaTOIM@KNKrP@_hE@QbgKWUMJoWAQMFEKM@wTONCJWRCZDHSAM_UD_GWMKeCITSCGIQBGXUHQoMEEGWDQIG]FMQBMaFGueFeSQDUSDSKOCSFMLƒUaPWM_PaEGFETMX]RCRR@HXKN@JNnXXEŒSPaDI\\£FkXWIAX]xB\\GN"],encodeOffsets:[[112031,19071]]}},{type:"Feature",id:"469001",properties:{name:"五指山市",cp:[109.5282,18.8299],childNum:1},geometry:{type:"Polygon",coordinates:["@@TCNOLBTLBPx\\AJdl†NR†RIbJTGNF\\@RcIYbmHoLQdKN_fCJYbDRRXKZFVEZVXBXIJBXMdESW[CUYHUVQFQAqsEIMPYMSBUIIJKAIj•GW[@[LGScDOGQOAGSYZ[HSd[HFNVD@XmJFG[OWiWKNqGKN_MAMO[HoM[BoRewo@Y^HpITSFENc`MVCdHNIVCLJFI`NFIŒP`@VZbaf[FFJG`O\\WRFA@PVPFPPH"],encodeOffsets:[[111973,19401]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/hei_long_jiang_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"2311",properties:{name:"黑河市",cp:[127.1448,49.2957],childNum:6},geometry:{type:"Polygon",coordinates:["@@VÈÞ@Žkx˜nXŽ°VÈa°V@kôw„b‚š„JVškXlVUx„„@ŽlL@xkVV°ƒ„VbxlVUnVxk@ƒ„ƒKkŽVb„Il„@°kVl„@„™lÆnkll@@V„VXƒŽš@V„²bUlƒVlV„U„VÇn@nkJšŽlkVbœ@›x²V@n°VUnlKU„n`@n°bWLnVUblVUVVbknV`°kkŽl@@V°@nz„J@XšxlWXb°n@bƒĠlbXb™bVbƒJ@Všb„a@„„@lbUbšVmnœ@lšVmnIW‚œ@WbÞ@„n@x°@š„ĢaƐéϚnœ„‚lČ¯ĠŻÈwm@ôçU™mm£Xy°UV™›@wÈ£Ǫ¯kõÝçUњ™Uķ‚ƒĢkVфÆšÞU°nŎ¥ČUĊx°m°¦żVƐœx°ƒÇ£@y„UônރÆ@Èĉ°Kô¦šW„kWU—bÇ»@™ÈĕWÇÈ£ŤU@›n£ÆUUKVamanwŃmÝJ¯k@JƒIkaVaUUÇbkaÆÑkWmÝUۙ™Ý@™ƒwnU±ƒ@kkV¯KUkƒJƒ¼U¦ƒšÅ@ówķaķůV¥Uaó@Åwmƒƒ_kVƒwĉ‚ĉmmn_V»™a@U™ƒVwķóƒ‚U¦LǫéóXÇmōLǓÇķxÝkƒƒĉ™kmakbUĶ°@W¼„@bƒšÈÆ@Ė™L„l@„°J¯„mkl¯L݃±L—amJ@¼ƒ„™VƧUó„™UX˜ċb¯ńVbkÆÝI@llx„k°V²šV@Uxގ˜L@b„@b™`ƒšÇzkókݤ@ğ¯Wƒ™LĉǙLmmnċVkbUaƒL@Ž¯„‚bU°ğL݂Ý@"],encodeOffsets:[[127744,50102]]}},{type:"Feature",id:"2327",properties:{name:"大兴安岭地区",cp:[124.1016,52.2345],childNum:3},geometry:{type:"Polygon",coordinates:["@@k›ƒϙmƏêġb™ƒ¯@@wƒmÝ@XV@IlŽl@bUxl¯VlV™bV@ULVlUV™_kx™VVV™ÈÝJ@„¯šU„™lm¯x@xóÒĉ¼m„¯Wƒxţ@Uz¯ƒWwnUwťƒ@knƒWƒ£óVƒUUwğyó¦WI—Vmm™I@±kwÇ@@bƒ@ĉ¼ó@¯wó@¯aó¼›KՃaUwmWUwÅI@aƒKó@Ua™LƒaƒVÅwō¼UUÝl±I—¤VxÇx@zkJmnn‚mbnz™xlŽƒl¯ČkJl™°@„kb„Žmx@x™@kêmVnŽWxôXšxU°„bWLóJnÇWĵ„V¦™ŽƒUUb™b™ÆġK™šk¯™VU±aXmċÑUwĉKġ„k„™ŽVxk„ÇKkbƒIƒ‚ÛXWl¯bƒŽ™X¯K™bĊš„„ÞVƚnŽĸ²lxUŽ°n°òÈb‚¦—xVbƒŽƒ@¯„Vx@¯VķÞČlĊ°KĸŽȘI°¤ČIôŽò»ƨnȰKǬ¦ôWŎÈƨwlƒnKVXmbX`lbšwkVW‚XXŽ„L°a„ƾaĊ£nƒ°@°¥ŎzÞ¥‚»œalwôkƒJ„a@ĶK„£„bU°ĊxźVÈUĠ¥ƨ™VI@XU°x°Ln¥šw°UmwXm݁V¥ĢŽ°@nU@mÆ£š¯lKœšÜw@aÅU‚¥UaÝIkmV²‚nn@Ķ»@Uk¥VKÞ@ÞÛ@ƒkVmĢa@_ƒJómƒǖ¯Æw—óÇa@alƒUwšwĢřšk@wÆWXUWXƒWa™m@_ƒ»ÇéXaĸwVa@ÝKkUWkX‚kšKXxƒn@lĊV@¯m¯nřÆwš¥"],encodeOffsets:[[130084,52206]]}},{type:"Feature",id:"2301",properties:{name:"哈尔滨市",cp:[127.9688,45.368],childNum:11},geometry:{type:"Polygon",coordinates:["@@°`„_šJlUšŽ@„„@V¦°JUšŽnLôlnŤ@@šÈaUÒVbkbl¤ƒzk°ÇVÛô°IlVUVôU„xÆU„Ž@bźĀ„º@¦šb@l²‚UVlœ@°ÒĠxšnXxÆVô¼Þ@Üx²KލlƒVÑ°UȰôlwô@²ƒĸ°„lanV@„šVŎUll@bÈnÜm„wĢ@la@ÝÞb°UXb˜lŎ²ÆškšV‚I@ŽnJnĠŽ°knƒÜbĢwna@a˜kÞKƒĀ„a‚™œ‚‚IVbU¥wĠwkô˜xnLƒċVçkaUƒ±IUmnġW„°WôĉšalƒÞÅĵ¯@W¹XÝaƒb¯a±X¯ºLƒaVƒmkLóƒƒbkaƒVUKVkkKV_@aÝykk±L@ƒÅU@yV_™aU¥ówÇx™@UkVƒn@lƒkÅlwšWVwUkĉmkklW@šašbVwnWWƒ—wWL™™@Ušƒ™UƒÇLšÇmƒ„@wƒJĉƒL¥@ƒÝ_@a¯y„UWw¯ƒ¯Uġx¯aÝXVmaU£ó±›¯nwƒa¯óÅVƒXman™„Uƒ›lUXkWa@mkI„›ğaƒm™IklÇU™„kĊƒƒzkKƒš„lU„ōĬlš™„@ŽnX°@llUxŹ²mKĉVWwk@UbUK@bmVmI—ƒVmwaWxXlWȁšmºšÞÆbUxV@ĵńWÆĉLkWUbƒaWzkbĉ`U„±LklōwUVÝ£™UW`Uwk@mk¯VkaõVX@WbL™K@XƧºWzxƒK@lmX@bkVVÆk¼Vbk@Vn"],encodeOffsets:[[128712,46604]]}},{type:"Feature",id:"2302",properties:{name:"齐齐哈尔市",cp:[124.541,47.5818],childNum:11},geometry:{type:"Polygon",coordinates:["@@Þ@ށĠKV¯a°ƒ@„KVblaČU‚mnnšKĊȚKX„°ŽĠ@Þ£ôllÈy„™š_@a‚ƒ@a—KݍVwU@±™¯Uƒlkw@kÞJlÅUa°ŃČaW—šVôƒƨVšU„ƒ@»nI˜b²Kބ°Klkn°ƒ¯I@ƒƒkšK@ĕÇń™@aƒX»¯@VĵlaÿVamI@aÅÝउýƒĊȗJƒôȁÅkmƑۃ@kxġ@@l™aVk¯»ƒīŹaƒkƒ¥Å¯™JUaWU@@w™aƒ»„KUkÆkUm„UmwÛ±±UUbUŽUXƒwWwÆÝk™lkUanaWwnKl™kal¯ka™ƽa›kÅx™a¯@™amb¯V™lÇwÛĀ™V@x™šmêVƜVV‚aôV„wÈx@šˌx„¦VÞ¯VšlmX@‚ƒL@¯Ua¯LmV@„„°X„ċK™V™ƒ@UƒÈ@‚¥@w—ƒġIU™km¥Źwƒ¦¯lmn@°kxVV@¦óam„n¦l@nx™lĉVóšmx™n™ÒĉĀĊ¼„þ„šǔêÞ°ˌĠÞÒ°ĀɲĀƨźˤȤƨĊ°w@£nymwnkUUV¥ôÑVmkÆmUUVa™mVIkmô„lxkXÞþƒbl„ƒl@kV„ƆƒV„xV@š¼VÒ@šŽUŽšnnނJ"],encodeOffsets:[[127744,50102]]}},{type:"Feature",id:"2310",properties:{name:"牡丹江市",cp:[129.7815,44.7089],childNum:7},geometry:{type:"Polygon",coordinates:["@@U`lLUlVL„Ulb„aô„lKnŽU„„b‚K°¹²W°b„aÞb˜knyUlUkamř²L@m°@lšmš²n`ôÅlK„x„ÜKnxV@„l@œƒ›ÅXyW_k@™wm™ŹĕmƒX™»‚ƒÛ™l°ƒôšÈ„»š—ô˜ô_WW@Uœal»šwU@@wšUVƒš@VƒXI@w‚Ģ͑ÞȻ›aU_@mUkly@¯óV»XmWUXUWmnm¥nUUaWLk»Æ²IÇa™wÅaÝ°¯nUa±a™ƒ™@¦õÆğ„@„™@Åb›xU܁nÇłlb¯¦„ôó»mƒ—@±ƒUk@Wwƒa¯xU„V°ƒxXbǎŁUV™™ƒK@¹ƒKUaȯ@ōݙXƒal™ƒlÛkalÇUǫÇńÇakbÝƆ¯nlš¯Ž@¼™VUx@x¯W¼™Æ¯šmĖ„Ĭ¯ČƒVk‚ķÅmxœ°ô²V¤‚bUnÞW°bĢw°V°„XxƒV°z@bÞ`@„‚¦„KĊŽ„I@xƒŽn„™ÈÈK‚„šV™„@VššXK˜xX„mXUx™a™b@‚kXllĊnVlUx™XkxlÆk„m@U„Vlš@ÈwôxV¦šbU`@zÆV@„²KllÞz@b"],encodeOffsets:[[132672,46936]]}},{type:"Feature",id:"2312",properties:{name:"绥化市",cp:[126.7163,46.8018],childNum:10},geometry:{type:"Polygon",coordinates:["@@ऊþÆÞ@bnJUb‚ĀnblŽĊš„„ÞlĸwǔÈŎKÈnôWǬê‚KV¥„ĸôUxš„@VšbU¼m`nnĊŽĊ„xlUšmkaVÿšLšwš@°»UmbKmݙUšwUmVknKUUl¯ƒKU™ƒUȃ‚™nK@ĠkX±lX„°„L@¯¥@wV_m›ĵ¯Ww™L¯ƒUkōƒÇVU™l›w—V󁱃¯aƒVka°wVk°mÞ¯Ŧřƙl™²™Ŏk™U@ƒmUkb¯ƒķŽ±„ó@kxȯó¯VUÒk„ÝŽ±LÛwÝ@ó»ÅUWw™mğw¯Ñ›@UkV±@k™a@¥ƒ¹Źÿ@aƒÅVƒwóVVUkU¯JÜóÈUl¯„yk£laUaVÑÇb@™ţ@kmómK™V¯IU¥ƒ@@ƒ™kV™Iƒ`@ô™¼„blU„lƒ™bÈb@xÇKkĢɳaÅɆō@ƒŽVƒK@z™@@¥ÆKnÜ@@aۏUw›wnU‚ķ@ƒ_ƒV°Ž@„klVššnULVVÞbVl@°™@nx™n°LŚÆlV„ȃmU²@VmĠLƒx„n¯xkWƒzšJ‚wnLmbXbW°šÆ‚™²™@™Žšx@JVx„L‚Ā²Æ°I¯º‚È@ÒnÈ"],encodeOffsets:[[128352,48421]]}},{type:"Feature",id:"2307",properties:{name:"伊春市",cp:[129.1992,47.9608],childNum:3},geometry:{type:"Polygon",coordinates:["@@ƒKƒ¯kWW²ğl@ŽmLšÇ„„VVš„Lk°VVmLUlVn™xšVnނLnaVŽ¯¼™@™x™KUĀlb™n„`n„Æxô@VbU¦ĸŰĸbôxÆ@„™V¥„»„IVl°LUŽll@²„mV„x@ššÞܚÞVnŽlXÅÒlbÈaVVUblb„J@I°lÞIn‚Æ„mxnbUbVLÅVm¤@œţVǤXÈÇĖ@šÈ¼˜aXVÜaXbWŽnzŎašř„KôbšUlw@¯naÆKnUU¯Üa@mkkVUĊm„™żÝ‚ǖŽ‚K„™°L²lÆI@ƒ¯¥ĉƛVaÞk@ÝVaĠlnUVwƒœómaƒ@™wĉ@™a™VƒxamX@aƒ@UaÅLƒaVWƒ_nWm£nWm_ÅV¯ƒm@m„󤁚ݦƒ¯ÅalmX£ƒ™VWUŚw™mÇ@@IV™„WUw@ašI@„k@wŎ»Wƒ„ƒ™ÅVaœK›Ika@¥lUkUlwÅwVyÈwWU@a¯U°m—Ç@UçƒaVa¯mV»ÅwÝUlƒUk™V@k„mUk‚X£šw°@@ǃaÝIƒƒam™Ûam„¯lğmmI@J™U™l±ÅōŽ—kWa¯VÝa@Þkbġ@ƒxÛnÇm@akkōVōl±škšÅšťŚÝ°¯nUl¯xlb„U°b²„ô‚˜Uœxšk‚VÈUŎ„Vl°„šKXxĶ°nœU`@x°¦@"],encodeOffsets:[[131637,48556]]}},{type:"Feature",id:"2308",properties:{name:"佳木斯市",cp:[133.0005,47.5763],childNum:7},geometry:{type:"Polygon",coordinates:["@@nš„b‚„ÞJ„b@ȯ@™xW¤Vlƒn@lšUVlk„ÞVÆxU¼°nUb„bVèÈ@˜ŽnIn‚@šĢmlUw°™żƒ‚VUn@lnL@VôbšwĊ‚lœ„JķĸĢl„wôwƨxVVUƒŦšxšLź™Èš°`nnĠwŎJސĶwôJ„@¤Xn܄ĸlšn°¼È°lŽ„„Uš‚b„xš@„l@ÞÞÈm°„lôwšL°¼ĸ‚°Þ²nĠ@ôwÞ`ŤI„V„ÒĠU„„@„VJĸbƄ²@°ŽĊKšœ„JĶaĢȰ@ô¥°nš¤‚bČUš@Vx„mUw@a݁ţƒÇ™ķƒ@ĕķīU¯²@ÆmVÑô¯X¥ċç@™ĉ»U¥ÝţKWVÅkUVÝŎUmǍÝx¯aķxÛUóL¯a±óōb¯™ƒÑŃVÿƒ_Åķ„a@UƒK@wm@Van@UmmLVa—@VImmXUWƒÝUřƒKUwÝUUƒkVƒk@l¯X›‚Å_ƒJ¯k™Jm„ÅLƒa@¥U@¯Vƒz¯@ƒ`@¼šmxƥšŏKÛk@±laÛ@@Xm@™ƒ@xƽ@WŎnšˣĕÅ@@aÅ@@nÝbǏ¯@ƒ_U›kUWƒkb™wÝU@ç„Wlw@anIƒ¯lyœX°m°VšašÛšm@„mVwÞK°ƒšXlaXmm_ƒ@UƒkwÝK@ƒVI™ƒXmV»ƒI@aƒ¯ğW™bġaU_¯JU¯ġŽƒ„ĉ„k„ō`±nÝÆk„™bóĊ¯Xƒ‚ĢX‚mVn²JV„lbUè„ČmK—wlóğx‚xV¦UaJ›šƒbƑÿÝL—l@bmbġx"],encodeOffsets:[[132615,47740]]}},{type:"Feature",id:"2303",properties:{name:"鸡西市",cp:[132.7917,45.7361],childNum:4},geometry:{type:"Polygon",coordinates:["@@‚LšKVVnkšbVšÈb‚²U°VnklVlaÈL@anU°ÜmXV`œnôLƒèšxlŽšLX„˜L²ašVVmÈX@ķ˜lnU„Èl`ȹš@ŤŽ°U@x„KnnV„mlnnUl‚lVnnaŎwlVÞ҄@n¦šLVŽ°lšwVk„Lšaގl„n҄š@xmLÞ¤Wnœ¼‚WÈLVVUxlÈô„„WVaU_VKšKXUÆbn™‚nôK„bÞw°bÆWXamVwœK˜™Uw¯WUk„UlJUwVUa™@@kmyzm›ĉw@kVwškƒW¯ÅKU_Vmƒƒ™xU@aW@@kK@w„a@Kƒ@@kVUƒaky°_Vm™kna¯K@™ƒL™wġk@@IÇóX™ƒwVakmV@mwXUWanƒlĉ@ǙUw™KƒƒóšܛNJۄm°@›w—Å@ƒ±b¯Wƒ¹„WVwŹĕ¯kVmōb¯w@aƒwmV™UUb™V™IkaVwķ™xk¼›b@VXXó`󗙘ƒ¼Çó™¯„kŽÜš„š¼WŽn„źĖnššxl@X`WzœÆ"],encodeOffsets:[[133921,46716]]}},{type:"Feature",id:"2305",properties:{name:"双鸭山市",cp:[133.5938,46.7523],childNum:5},geometry:{type:"Polygon",coordinates:["@@™UƒƒUwó™mÑÞÑUÝÝUkmmŃyV¯ī„¥ƒUÿĉ¯mÇkaWbÅX¯aÝxƒaóLmmšÅaWV™LULV`UbƒXóƒkÇVwUUÇKX›»XmÝ£nK@wƒ™mÑkƒÝ™bƒKUl™x¯kU™Km¥ƒ@ÝÑkUōxmbUmkVkmmnkUƒmmƒL@w¯Vţ™@Ǻk_ƒÇmV—k@ĸVx‚VÈ°lLkllšUbōwƒnVW¼nlUx¯XmWUnÝ@™xÝUó¼¯J@LVbkJWnkb™W¯„ÝLUxƒn@‚™n™Ü™b¯U¯n›Wkz„°mJ@bkxƒX@èÞVšxlaX„lVVœ„`°@ȐÞa@mÆ@@bÆ@ˤĖm™Xōƾ@@wš„n@@WÜ@kb@²ÜlŐLƦ™nw™@»„_°@„y°UV@@¦„bÆKnƒšI°l„IÆ`œ°W@k„llUV„ÞVVx„LƚÞVX„WVnnUJ˜@UbnKVnm@Ubn@@x„L@VƒbÆĸ„`UĀƄ„Ò°šŎa²ô°bôKÜVĸw°bÞwȎVnÞōVUÆlXU"],encodeOffsets:[[137577,48578]]}},{type:"Feature",id:"2306",properties:{name:"大庆市",cp:[124.7717,46.4282],childNum:5},geometry:{type:"Polygon",coordinates:["@@mÇ@сǰ¹¯J±ÅÿƒKUw‚I@™wšš@š±Å‚™X¯WanamKx™I„ylX°wƒm„wğKUn±@nVDŽUƒÅkƙ¯Kšmmwš@@¯UkÝaUUVK™mU™lk@ƒ¯„U„`ĸ@V‚mœxVxܐ@bÛ@m‚ÅL@¦š@@y„L‚U„Ŏ@ÆɅɴblġÈL@wÇaša„ƒkkVƒaš»@ó¯_ÝJ™wÇaÅXny›U¯¥Å„@w™bÝa™Lmm@@ƒVUŽlbğVmš™¯Xƒm_ƒ`¯_Ux™m™L™a¯b@mƒaó¦Çk™¤V„@bóJknVx™VXx±aƒLUbVxkLVlLWlƒ@nX@VÅbWlÈnƒx„bWšÅbmŽ@xœbml°b™„XbW„XVmnn`ƒLmšnbmb@šk@mwU@@š¯Jlbk°lbkšmLXxmbVbkllšÅނxX„xVWVVa²VܲnxƒVVnÅlVlƒL„¼šb@xV@XŽVbšIÆ°„¦„lźb„Ĭ°¼Ulšb@kĢ@lw„@ƒÜlnȂƄóȘI„ĉ"],encodeOffsets:[[128352,48421]]}},{type:"Feature",id:"2304",properties:{name:"鹤岗市",cp:[130.4407,47.7081],childNum:3},geometry:{type:"Polygon",coordinates:["@@Þ¥‚™ô£nƒn@°„ÆUn`mXn¤mX„`UX„bÆKVb„@@bnW‚b„wšUšbĊ@šx„@nbšWVmƒ_mm@ó»Um„ŘWXkĠ»²¯‚¯nķšwŎ@ĊšŎK°bĸUnјKȦĠÈbÆknJššÆUĢV°IšŽšVƾƒwaV™ƒƒkÇ¯¯»™mķkۃWm@£ƒóIĵxݏōIğxmm¯_ǙŹš™K™wťŽ„UVUŽƧwóxƒxġkĸķƒIk›ĉ™xóa@UmK@kVmUŻ„¯šVxkŽġn™‚@mmJ¯n°V@bXVÇxUzÆxkxlVkV@¦lbœJ›LUbšÆƒ„X„ō¼@xƒl@™J@bVxƒXUš@JÈ@šn™xVÆUXš‚„W¤knÆb„°"],encodeOffsets:[[132998,49478]]}},{type:"Feature",id:"2309",properties:{name:"七台河市",cp:[131.2756,45.9558],childNum:2},geometry:{type:"Polygon",coordinates:["@@²mŎ_lƒĊƒ„ƒĢV°°IV`ĢbšaĠX„°@b„JU¼Wnš„UJ@„ÞLlxV„„@n`lIUa@K°Iô»ÞVšwÞ@VmnX°WVwmkX»‚U„mŎxVak™lkkKǯUUwÇWUn™U±b—KWƒ™Kk™w„çóK›mU_nW¯ÛmV@bÇKkbkUml¯U±VÇaU™™amlUU™LK›„k@ƒU@mwÛLƒŽƒwkLóÆm_™±™nkŽ¯@@n±KnŚlbkVV‚mz—lWXº@Ķ°"],encodeOffsets:[[133369,47228]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/he_bei_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"1308",properties:{name:"承德市",cp:[117.5757,41.4075],childNum:11},geometry:{type:"Polygon",coordinates:["@@lLnlmxn„„IVVlUnb@VVxXJWL@LގVnnV„J˜_@wkmšK„b‚x„wXk˜WXXšKlb²K@nVVVb„L@WlU²„lKVnUJVz@VVb@lżmVUVnbôaVX@°Ub@lWbXš@b@bVb°x„@VxÈLVlšaÆ@Þb²k°@lVUŽ@Xn@VW‚LXb@¤VXšKVVVLnm°_ƨ¤@aUIVa„alkX›°k„™V@„alwUVy„U@k󙰃na°UVUUmUÆw@mkLVUƒWVI„WšLnn@xlVnK„myU@ƒU°UXaV@U¥ƒU@Uƙ@aVUkWU¯ƒaU@WLUV@bkbmKULmKkUVUkmVIUwlWV²™Uml°U@W„LUwVm@UUK@_ƒKUUÜaXw@ƒVKUU@mVIUUlmnIVVVbÈVlKnbVKš@nI˜@nVnwVLVK„K„„˜Vnb@aUIVW@In™°@lVnIš@lWĢ@°UVL@b„@VyUUƒa@w@WUnU@Wǯ™K@UkkJWaÛbmk@mVaÞU@amkWƒ@mXUKkÿƒ£@a„kl@Um°UXwla„al@nmlXnW°znW@aƒwV™@ƒakbĉ¥VmU@ƒIƒVƒUƒJkUmWU™KbmkUaƒKkUVU@KV@@klw—™WaU@kmƒXVènbmlUUƒKƒX¯JkbƒI@JmIUWU@ƒLml@XkJ@U™kƒK@aVKwWa—IWwƒmUƒ@mU@J@UaċU™aUUƒVkI±ƒk@UUƒ@UbVVm@UVKƒLƒlkIWaULUWƒXUJU„ƒ@WbUb@lkXUxm@@JVn@J@b„nƒb@Vkx@bšLU‚Æn„JšaVXnKVVmzX‚°V@_lJXxWXƒK¯bÅamUƒ@lUI›bñJ@LÇKkIÇ`kxWL@„ƒ@@bUVUb¯xWKk„Å„VlULW@ƒŽn¦Ul@I™lmUUUVm@kWƒnkKma¯XUKWmnwVwÝL„mŽ™VUbUVWb@Lnxm„xVŽmbXx›¦@„nb@`™„ƒVƒ@kbƒLU„mVUlkbVXkºmnm@@xk¦šbĢÜlš"],encodeOffsets:[[118868,42784]]}},{type:"Feature",id:"1307",properties:{name:"张家口市",cp:[115.1477,40.8527],childNum:15},geometry:{type:"Polygon",coordinates:["@@k™ġۙal¥@wn@nml¹UWlaVknUVƒ„Kla„@„Ušƒ@_ma@ƒœ¥WwnaU‚wnƒmw@KXaVUVašUnmWUk°™lƒnUVUXWVw™IWVóKUI@WXƒxUU@mma@kUKWLkw@yk@ƒaVkUUċaUU@Wk@Unm@UVmLm±IUƒkJ™kWƒ@a„I@m@U„ƒVƒ„Ula„@VXVƒXmVwnkWKƒKU_k@m¥ƒmX_™JmnU@km@U@KmU™VƒU@U™@Umk@@LƒmW@Û£Wƒka@wk™@aƒI@mmk@mUa@UmUƒIƒwW@aWUƒbU@kbÇ@kwƒ@makVUk™U@aƒm@aU@mxkUƒbƒKUXUƒ±KXVWLUK@wkU@V™@WXUa@WbUxƒJIƒŽ@¦VèVVX@±ê¯KUIƒ`¯UULVx@Vƒ@UKƒIƒVkLmVkKmš@nUJÝbkIUJVXšVVxVbU„VJ„Un™°bV„mlU°„XnK@Ul@lVÈVUXšx@W„@VXšV‚KÞb„n@VnbV„m`ƒUx™kW@UVkL™Km¼@lUnUJVnV„XV@Vm@@LV„klƒIkl@VƒWlŽULWKUL@mJ„@blbUVUlmzUJUxm@UUbċÜk@Ub@VšLVV„¦ôbVŽmšUKUkU@m„„@VlVn¼WbUJ¯@@„°šnIllÈl˜@nXšWlLœk‚J@bkxlxkxlXUlklJƒšXL@bW„n`@nƎXxlL@xl@Xb‚LœKlVlIXblVUbUJW@lX@VL@VVŽšXšJšw„n@WnL°K„bVbl@VI@K„@U@nmVmV@XUWI@aXm@™VUUkWmn@lmUUk@mUmK@UnwVĉ@ƒƒmU_V@XJôVVUšLVUn@šllUnJl_n@šml@XŽlLlw²LVJUL@VmbVblVXmVnlš@Ť¦„nn@܎@bšl„@@XV`„Unb@VlLVb²J‚Xn¥ÆÑ@¥Þ@"],encodeOffsets:[[118868,42784]]}},{type:"Feature",id:"1306",properties:{name:"保定市",cp:[115.0488,39.0948],childNum:23},geometry:{type:"Polygon",coordinates:["@@VbXWš@@UlV@xVLXKWU²LV„VW„L„alVnwV@@b„n@bšVVllUnb„@lxÈ@laV@„aXV@b‚X„x„J‚nV@VVb@nnl@n„J@blšl@„ašƒU_VWUwVUškUm™Ukb±mVwœU@VIUW@UWk„@VU@ynL„m@IV@‚bnK„LVaVmnIlaXwV@@WVL°@@xnX„@V`V@VbUVVLVKnwnL@ll@@_V@VVnaÆ@œKVXÆ@nƒ@wƒKmU—™Wm@km@kÜKXU@ÑW±nIUwVƒ„Kla@I°wU±kškmm¯mƒ_ƒJnƒaƒwW@IVaUama@wƒUƒmU@mVw@aXk@mWa@£km@aƒ_kVmUnWW@¯bƒkUmk@ƒVÇm@@kUU™KUU™@UVUamVUaWIkb@xU@@amUkKƒVkam@@kVUkUWmKmUkLUb@xmJƒ™U@UImVÛVmnUwƒJƒU@VƒX@UWm@Ub°¦UšmxklmX@`ULU@@UW@@xkn¯@makV™UmxUb™°ƒlUšƒbUbƒnUJƒUUVƒa™LkbUU›JUU@mUUUƒJkaƒ@™xUIWJƒUnƒJ@V™zƒ@kb@`@bln@l™bƒŽ@X@š@š„@Xl‚bnbVb„@„„VJlInlšbVw@U„K„l@lbnan@Vb‚JôLn‚UzlV@lÈLVbVK@LVx—VWXX`WxXz‚bV`UXV¤nx@„bVlVnVlUL"],encodeOffsets:[[117304,40512]]}},{type:"Feature",id:"1302",properties:{name:"唐山市",cp:[118.4766,39.6826],childNum:11},geometry:{type:"Polygon",coordinates:["@@„@VVl@²„lJ„UVVšbČVVb‚@@InV„@‚V„nXx˜JXb‚xUL@b„Lšl@VlI@Wnk„KV@VXnJ@I„Jla°I„W„LVVnkmaUç„WVkôaܯ„@nV°wnJlaV@VUnUUaW¯wXWWwna@£UaWKU¯ƒ¯@aVUkKUamUUƒn»‚an™„IVwUWlkš@„LlWVakU@K„_lƒšbÞU°@šy°n„@„KÈkWW™ţ¥ĉōƒkġWUw¯£¯ƒÇwţwƒ@kK@kƒ¥ÝwÅbǤېťV™lW°@ĸ™x@VVVULVLkl@V@Xƒ`Ub@Xm@UWbƒk@ÆVbnLWV@lnXUbl‚@X¯lmU™VkKWLkK@_UK@U@UmmUxmVXLWVULkU@`W@ULUK@XlJXzV@@xml@VU@UX@Kk@WbUK@Xn`ƒXmJnšmškxUVbUVlVVxUbV@nKlL„kVKÞbVKXI°KVšmVUIUKULVxVJVLkV@Vƒ@UbU@WUU@UbUK@b@nƒV@VkLmb@b"],encodeOffsets:[[120398,41159]]}},{type:"Feature",id:"1309",properties:{name:"沧州市",cp:[116.8286,38.2104],childNum:15},geometry:{type:"Polygon",coordinates:["@@@ln@UȄŽl@Vn„l°aX@mXnVlU„`@bln@¤Xb@nWl@bUx@nnV‚„„V@xnbVbUb@J‚X„x„b‚mXa@k„UVwlW„k„KôVm@w™kkK@kl»Èƒm™VKXkla°@XVV@VI@ml@@Vn@VX@V@J„@VxUzVVšš²blVk¦@šĠ@@»š@VK@VÈLlK@XnJ@alIUl„a„VVbš@„n@a„U@WUIV@mUn@mKXml@lL@LnWšb@XV@@a„VVb„V„@VV„IVWÈb˜IÈ»ƒǟlWšaVUÅUƒƒ™Um@kVU™WVkaUwmaóUƒJUU¯ÑU¥mk™¯UaƒKÅnÇyóXmWÛX¯aċbÛa›J—W™ÝU¯»ƒaóóUm@IƒšVVl@bƒLUJWLX@@xšXUxl¤V@V„nVUV„XVbVš@Ž„@@VVn„°VŽ@ţU¯VƒUmƒUWV@mUXƒaƒbUKUwUaÇKn„ƒVk¦Wb@VnLmV@bkV@n„xW`Å_UVƒV@bƒUklVX@VmlUƒx@VVL@x—VWVL@VW@UUm@"],encodeOffsets:[[118485,39280]]}},{type:"Feature",id:"1301",properties:{name:"石家庄市",cp:[114.4995,38.1006],childNum:19},geometry:{type:"Polygon",coordinates:["@@la„@šy@U„I‚m„VXIVJšw„@lb„IVVnV‚@VVœIVVlašK„bVU„VVI„mVa„aV™„kš¯VanwšVlUnb°@lm@wX@@VV@VK@_nWlknwV™¯¥Van@VX‚@„W@U„V„IVxnmÜUnUVJV@„šnI@wValKnV@k‚mU£na@mVk°K„LVa@UU@UƒmknWWkXU@aWW@@km@UaU@@klK@UkaWaUnamm@U„a¯wWU@UkƒL@ŽUn@x™V™lUXVJUb™LmU@aUWUkmKkLUUm@mW—XƒaƒmmkkWUm@@U¯JUUm™kU¯@mKĉxÝwÝ¥LƒUóŽmwkUUUWVkKm™kKmLX„lxVLVxXJ@nVJnz@VWL@`nX@šƒxƒ@kVUUmJmIXx„JV„ƒnUVƒ@UVV„@LUšƒ`UXVVƒ„ƒlXL@l@b@VmX@b™xn°™UƒbkKWLXlW@@bƒK„mKULmakLUlmb@šXb@xmXU`V„b@`lLx@nWVXL@‚°WlXnlb„KVK„XVb@˜X@l_lJ@V@XnŽ„I"],encodeOffsets:[[116562,39691]]}},{type:"Feature",id:"1305",properties:{name:"邢台市",cp:[114.8071,37.2821],childNum:18},geometry:{type:"Polygon",coordinates:["@@nKlLnšlLXUVVlVnxô„V‚KÞ¦ÞxĊwnL°@lVnšVV°I@Vn@V‚lXnl„n„b˜WnXn@VVlKnLVlVX@bnVšKVaUIVWškšU@wVm@¯@U¥VmU_°lšK„k‚w@LX‚Va„U@wšUƒUUKlUóW@UVUœUlƒ°K„wlKU_na„KVnlKkkšWWa@IœJVa@IlJnU@„KVUUmVlaXUl@lm@kXWÝÑnkƒ™±™k@wğ›@@U@mKĉLmVJ@zmlnŽWLUÝJU_ƒ@@šmJkXUVlbklÝ@Ýa™b¯@¯±JÅwġaUU@ƒkU™@mVI±bUKƒL™WUXƒJkaƒLóKULWbUVkKmnk@@bmLUŽƒl@b@mnmJkUULƒaƒbnŽmn@lVV@¦n@„l@b‚znx@`Vz@b„xnV@xl„lbnKVx"],encodeOffsets:[[116764,38346]]}},{type:"Feature",id:"1304",properties:{name:"邯郸市",cp:[114.4775,36.535],childNum:18},geometry:{type:"Polygon",coordinates:["@@„bVKlVnInm‚@@a„kVnK@al@nmlLVUXaVKôL„Klb„IVWšX„KVL²a‚JnUš@lV@„VVĢbÆx²I°Ž°@šaÞbÞ@lkkaVUlWnI@™„@V`ÞI‚VXKmnk@y‚InUĊKƒÇkUUamUUkƒƒ@aU@U™ƒk@WUwVkVJVkkw°a@„mK@UX@VV„LVW@wšwVa@¯Xm@@lUIWaU@UWkXWmU@UwmUkKmn@lkVƒ²™VƒaULUVmJUUUwƒLma@™UmkIUm›L—mVšmx@b™LUamKÅL@VmbkU¯KÝamzkJUb±Vkb™L@lU@WIkJƒzkKmKƒnUalWkkKW@@nkbk@WW¯XUVUJ@XlJ@Xƒ@XlWLkUƒ`VUnaWa„UV@UVIƒaUxUUmVƒK@I@W@DŽU@@U@bƒ‚@nmKXmx™@UxkVWUX„@`VLlL@`™zX‚Ýb@b‚„@VUVkIUJVz°KVlnLlKnL„xlLVVUVlXUJ@nn‚„I@mVUlbn@@Žm„@bV„nV"],encodeOffsets:[[116528,37885]]}},{type:"Feature",id:"1303",properties:{name:"秦皇岛市",cp:[119.2126,40.0232],childNum:5},geometry:{type:"Polygon",coordinates:["@@lnV@Xb˜škx@lU@@LUVlV„LVbnl‚ašLXVVn‚l„I„V„U„JV@UnĊ¦la„bš@nJ°UmƒV@„wn@VU„JVI°bnWlXnWVLVK²b‚akk„lI@aUaVƒUwVUUalaVwnUVak¥šX@W‚kœLVÓm„mUK@_lWš@n_UK@alÅ@ğÅƑŃݍmƒ@їţÇlƒLƒ@¯m™z¯@ÝV™ak„ƒ`@LlVUbkXƒK™@klVXUxƒJmšbm¼V„nVVblLUV@b„°V°XLVb@¤mbXxWX°xXŽVbmVUVU@kbmI¯xmUƒ@Û°óbUl"],encodeOffsets:[[121411,41254]]}},{type:"Feature",id:"1311",properties:{name:"衡水市",cp:[115.8838,37.7161],childNum:11},geometry:{type:"Polygon",coordinates:["@@„KVlV@X°xƒb@VnnmbVŽXblb@VkL@lV@Vbn@@l‚@XX@bWVXlmXnlV„V@@VUbƒK¯LUl@nmbV¤n@l‚LXnlVUV@ln@lb„UlLnV@bV@@wlaXJVbnUVbVUš@VVšLVVn@VVX@@U‚KXU˜U@wUK@U„wVnk@UUWlk„V@a„UVUÆ`X_ƒw@mlU@anUmK@UXal¥„UmƒÈLVbVxVL„a„bVW@nXU‚Vn„„V°UŤV@Uƒ¯Um@Uƒ@@U™UaƒWVUmUUƒU@k£Vw™W@wW@XKƒIUa@wU@@al@UK@_mKXKƒbUU@aVKmš@Xmƒƒ±@kbÇakLğVaUw@a@ƒmkUJƒk@ykw@£ƒWX@lknk@WVkbUŽVnUVƒL@‚mVkI@JUb›I@JXb™XllkLUmƒLmbV`kLƒx¯Lk„›VUV@VôXkVVL„V™V@xƒVUbW@Kxƒl™L¯kV`UnV¦°@"],encodeOffsets:[[118024,38549]]}},{type:"Feature",id:"1310",properties:{name:"廊坊市",cp:[116.521,39.0509],childNum:9},geometry:{type:"MultiPolygon",coordinates:[["@@la„Ušš@šUnL@VWbklWxnIVV„V@X„JlbUlšXVbn@@K„mV@@X°WVInJmn²@lmVbnL@amKV_kwlmX@@LVamaXaƒaVU@UnJVanLlUkaW@UaVakK@IlKUU@an@ln@alKUƒkIVa@a@klaUKUV@UkUV¯šKVƒV@kUmƒU@@a¯ImJUU@VV@UL@Uƒ@@WXUWa@Ukwm™@ƒX@@w@al@@aVIUmVUUUVWUknK@I@™l¥kU±a™™UUVyUwƒ@@I@UUWm@@Uk@@nUJU@WU¯@kbWlULnšÇ„k¼@llLšl@xUnóŽƒLƒlkXUxƒV@lWb„I„`°nnn™llŽV²¯x@JkbƒLU„VxmJX²@ÒWVÛL@lln@‚Xn˜šnV„L"],["@@@kX@Valaa@KWI@UXW@WanaUIW@UaUKķŽk_W@UVUKUš@bƒ@UamxVXnJUbWVXLVbn@W°kb@U@Wó¼mIU¼k`V„@bVbl@„lX@lUôVlUœIV`lX„Vn@lUlVn@„l@UVaƒIUWl£Um™VWU@@UUKlUUUnƒVL@KšUnLVWUa›@™U"]],encodeOffsets:[[[119037,40467]],[[119970,40776]]]}}],UTF8Encoding:!0} +}),n("echarts/util/mapData/geoJson/he_nan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"4113",properties:{name:"南阳市",cp:[112.4011,33.0359],childNum:12},geometry:{type:"Polygon",coordinates:["@@lKl@nVV@„bn„@VVnm‚nL‚LXx@š„‚VLlKVU„IXWÜ@șlbl@XUĊUlwnW„LÞw‚m@ÞUVmnVl@nX‚JXLm@VnnJla„I@VkxVb„@VŽln„J@knKVn„@°aVanal@XK°b„‚@š¯VJXIš„VK@al@nV„k‚@nK„a‚b„@XL@blVVKVLXK„@VaVI°mVaX@V_@a@yUkVw„VšIVašJ°™@anIlaV@nKnXÆm@wUUV±UUWUKnaWwXUWmŁ¯Vƒam@kakImƒUKƒ»lan@VXXa˜W@@UlUUa@a@UlwUƒV@Xal@@anIVaUK@V™XmwVmUmV„LXl‚@nalLnal@„šnKlkV@@UnJ‚UXnl@nVl¦V@@VnJ@nUVVVVIn@Va„JƗn@@K@m„kƒa@kmWVaUI@a@™k@@aUL@mmaVIUKUVƒ@@IU@mƒUmmL@K@UUUU@mW@@nU@ğ»mVmbk@klW@UXnV@LƒJm„™lUnUJ™UUUWƒƒ@UnkKƒxmLa@ƒ@@lUU™bmUVWk@@nkUmam@UakJU_ƒVm@ÅlÇLUVmVUwULƒKU@ƒk@UƒVUlU@@Uƒ@UaUUWaŎƒzJƒaWLkl™b@bmL@„kKƒabWŽUVƒ_@mV@b¯JmXUbUK™¤ÇLUU@b@JkLWmkUWIkJ@VmX@JUbVXU`¯VV¯blK@LXKl„UV@Um@@Uk@kxWŽkbƒL@KkbmL@‚UXmaU@@l@x@blX@xUJ@bULUlULÇ@@VšnU`W@@nÛ¼U@@VmKUkm@VVX@@xǚ@bUbVb@VX@@x‚LUb@lƒ¼XLlbUlVVU„Ub@n"],encodeOffsets:[[113671,34364]]}},{type:"Feature",id:"4115",properties:{name:"信阳市",cp:[114.8291,32.0197],childNum:9},geometry:{type:"Polygon",coordinates:["@@VllInJlknJVkVU@mXlUÞ`VnV™VU@U@y„@nXlKV„nJVkXKWaXI‚b@yVk„VUkVwn@‚K@nW@k„KlUXVVUlbnUV`n@V_V@llX@@V„b@bV@@nlVUb¯‚WLnbmb@ŽnLnK˜b„U„bVWnLlaX@VVUX@Vln@`kL@ll@VXVJÈIVl@XÞJ°Una„LlylU@UXKlnn@lanLWWnbVI@KXKVL@LVWVL@UVKUIVWX@@XÆJ@In`@lJVI@a„WšÛnK@UlK@UU@VK„nlm„nXal„UllLUbVVšknJ@nV@Vm@a„l@@xnV„„lJVUU@™w@aƒk„@XW@_mWnUlŁUmVKV@VXwW»XƒWaUwnkWUkVUƒU@@@WlaUkkaƒIWVkm¯xmIUmƒLUVƒaUIó»m@mmwXk@a›mk¯¯l™@wƒmkLmmU@UbkUWJ@XUbƒJ@b@l@znÆmK@Xk@Ub@lm@ƒI@akmVKUUVUkU@U±JUbkƒ@IWmkxƒa@UUV™UWVkIUaW@UlLWn@VkJƒI@VkK@L@bmKƒkJmUUaUKWXk¼VxnJ@„V@@VULV¼ƒ@@UkaUlWL@U@W@IkKmL@KULUWULWKUXUJmIƒb—KƒŽƒ²UW™nWKUUkLUƒmUUam@UU™@ƒmUL@xkV@„VV@bmV@Vk@mwkUƒVUx@mbX‚ÇnVb„‚UL¯šWŽnUVLVb@xnlWnU@UVUVVUbVVlVkn@llVUXUWUXVbUJ@bmLUJnb@nVK@bl@@š@bVJUbnX@l„b"],encodeOffsets:[[116551,33385]]}},{type:"Feature",id:"4103",properties:{name:"洛阳市",cp:[112.0605,34.3158],childNum:11},geometry:{type:"Polygon",coordinates:["@@VVUllLXl@LWn@J„@bƒKUVmnL@`VblLnbV@„b@JmL@LnV@VV@¯„VJVnXL˜@nm@aÞ@‚a„k@m„IšmVbXL‚ynLšk°@°aVJnUV@UVVXk@WJ@VXLlUnJVnnƒ°U@»°U„wl@šb„WmUXƒÆ@VLXU@m@U„a@I›mkb™a@naWW@_@WXUV@@U‚ƒ²@„K@I±U@¥kKWLóLlƒa@£Um@kWKXU@mlLXUVKUU±J¯_@`UL¯Wmk@Wa„kkƒlUnƒVUVaU@KUU@mmK@_ƒa@KX@VaUIm±™k„aVKVUkw™@kaƒƒW@kbkL±UUaƒK@UUKVak£ƒ@UmmL@lƒIkmUƒ@Ualw@UƒJkbmIUmn@WKImWk@mUUnÝV@ŽnÝxƒKmXkxĉVWVk@kaċšÛ@WXƒJUV@zŽm„VWnbUbVbšLlUnŽ‚lUÒnWV—VWnk@@Vm@kxm@Un™l@Ll@@V@šXnƒškJV„šV@nlVXx˜U@l„n@aš@VLnWĊ¦nxš@lbVKXLl@ރVLƒ„XJl@XXl`lIXVl@Xl‚XUVšK„wV@lanx„zUbVJ@VVX@b"],encodeOffsets:[[114683,35551]]}},{type:"Feature",id:"4117",properties:{name:"驻马店市",cp:[114.1589,32.9041],childNum:10},geometry:{type:"Polygon",coordinates:["@@n@„b°UƂXnVlnLÜ@VLœm@n˜@na@J„„m@k„@lVšVxXX@„V`lLV„XVV@VVÞLVV°„²@lašbnxV@@b„Lšmlm„_VWnIWUna@lšLšbnV°ƒVL@KšV„LVUVaVLXK@mÆXna@wVm„a‚@Xw@KlL@a„@Va@wUkaWnIVƒla@Kn@Vn@VUl@nKVn„J@LnK@aVkVUUWƒ@VakUVanI‚²X‚W@UUU°KnUVLl@XaVK@ašU@KUI@W@_lm@KkLUKV_Uƒ@»@UVJ@XV@@mVL@K@U@Kk@VwUUm@kmWL@VkVkzƒKmb¯VÝI@WUkÇJUIUWk@@klK@_km@UVWUUW@kbmKUXƒaƒV—amLmK@namaXK°VakU@mU@@aƒa@UW@kkU@U`m@U_mVkaUVWUkVƒL@lmX@ŽLm@UxVlƒUUl@zaWJXbWLUlmIUƒkLmWƒ@@z@VUVUšUmÝ_kVWŽ@nUVUlmIklmIkJUkƒl@n@Lm@؃IUbm@UJUUVU@mmI@UU@k¥mUk@WmVmI@VU@klmLƒ™k@mbkKmb@WkƒKUŽVnUnnxšW@UVLUbmJ@bk@WbU@V„kx@V@bVbkV@V‚@‚—XWbUWm@kb„¼VLn„lJlb"],encodeOffsets:[[115920,33863]]}},{type:"Feature",id:"4116",properties:{name:"周口市",cp:[114.873,33.6951],childNum:10},geometry:{type:"Polygon",coordinates:["@@lšnb@xlJ@UnLlKXUlJl_„KnV@xVL@bkbVVUè@šWb@„Ubmš„ŽkšVšmbX„VJnUl@„a°@@b„LVbƒlXx˜InmnLVw‚anJÆw²IlmnXVl°VVbÈaVb„@lkn@VWnLlUVmÞUUklƒkƒVkUaVaVaUw™K@kkaVWmw„_„‚l@nU„VVb@b„aV@VV@zXJl@@kl@šlœk°WVnÆbnbUšVJ„Iš@VKVm@k™K@_kK@a@aU@@wW@@k@aUW@IUWVUnLlUlVXKVwmk@W@—VWa„¥@k@lnƒUIÇKUaU@ƒUUVmIUV™Uk¥ƒVma@¯k@Wanwmƒ„@@n@@m@UIVƒkUVamUXWƒaV™U_™@ƒmUVUImW@aUIĉK@VmI™b@lU@@n™JƒkU™@KƒIUmmLk@UVm@UŽm@@LkbU„mJXlbV‚@xUbƒ@@bkK@LWx@ƒbUn@xmbÅW@nWLUKUbUVƒK™U@LUK¯„mU@šVV@xULUŽVL@bU`WšUz¯aUamKUaƒ@@xkX@x"],encodeOffsets:[[116832,34527]]}},{type:"Feature",id:"4114",properties:{name:"商丘市",cp:[115.741,34.2828],childNum:8},geometry:{type:"Polygon",coordinates:["@@XVl@lLȃ„@VkV@V»UanƒWX@VaÆÇô@ÈaVX@xVJXUÞU‚aVLĸbXKl„V@šm°Vn_ny˜XX»mUk¥lK@a„_@yšInaVKVa°_@WXI@ƒ@K‚VnIlbnaV@„l„@‚a@_w@ƒlwUKm™Xa@UV@š»Vƒšw@kUKVUUm@w±VUXUKUwmJUUƒ@km@@±mXkmUI™@mm™KUwkbWakLWaUIkJmŽƒX@l@@VUX@JWbX@VbULWbƒlUVULknlV@bVJk„mb¯KknWmk@@nmVkx™@ƒVmU¯KUnUL™@ƒJUIV™maÅaUm¯X›l™kk@@lk@WI@yUUU@ƒb@aUaƒUmVk@ƒƒ`nxUXlb@lšLVxUbUbVbUll„k„VlÝVUnkVmKUXm@klƒ@ƒnUx@xnxƒn@`VX@V²x@V@b@„Wl@zU`VUVVb„L@Vƒb™W@bkXllkLWV@V„@VVÈwlVœ@@X˜K²Llb„WnnÆL@VnJWn"],encodeOffsets:[[118024,35680]]}},{type:"Feature",id:"4112",properties:{name:"三门峡市",cp:[110.8301,34.3158],childNum:6},geometry:{type:"Polygon",coordinates:["@@WKUmUI°ƒU@@UmU@KnK@IƒaU@makKUa@_‚KnmVU„L@a‚ƒ@IXm@KWkkKVkUU@aUW@UUIVaƒymwkbU@ƒx™LVUWWkk@WUkJk_WWk@WI„ƒUK݄k@WKULka™@mwĉ¥mXUK™@@bƒm@k—VWwkU@m™UUƒlI„™Wm@™@Uk@@KškVmn@lwn@@Ul@Xm˜UXUmVсkmkV™KUaVamaUXnƒ‚@ykLUKƒ@™WwKmKnUm@UmƒƒaU@mUk@kL@lƒxċxUnkVmnXxWb@`kzWJ@V—LmVUn™lmUL@lW@Ub@VšXUbš`VLUbUJ@nmnUlUUm@@bUJlnU„š‚U@lxkbƒ@@XƒJUnƒ@kb¯VVVmlXXlJlzn@VlkVW@bkK™bmškŽUbVb„lƒXVxšKÈnšwÞlĊKlšVnKlwX@lL@xlUnVn„@šl@lmX@ƄÈb°¼ÈwVJlx„_°xšašlšUÈxlUnbVxnL@lllšbm„n@nb‚@@V„L@V„@@„VLšJnIVVlKnV„_"],encodeOffsets:[[114661,35911]]}},{type:"Feature",id:"4107",properties:{name:"新乡市",cp:[114.2029,35.3595],childNum:9},geometry:{type:"Polygon",coordinates:["@@XVlL„K°bUblbUbšl@nX@W„XVVKVkš@@Žmb@„Ubn„W`kL„LƒV@VVLnKlVXIlVš@@a„@l£nWlƒkVa„@°bnUlLVlna‚bnUVUXKlU@ƒ@lk@a„I°y„@ôkUU@wšmôšnkWakml™UkVmkUlmUUm@nkUKWanamU„LXW@U‚VnUln„`l„œblL°KXV@ĠJ@L°„šJšUVw„anK@UUImmƒkK@¯±Um@IVmUmmÅnWaUK¯aUk„w@W±kVƒx™U™VƒwƒnÅJUIWaÝJóI—bm`ÝbÅImJUI¯¥¯@mU¯UƒJmnUVóUkl±V@zXl„bWVXL@bm„mº@@XmJUXU°llk„@nWJk@U„@¦U`m¯ŽWx"],encodeOffsets:[[116100,36349]]}},{type:"Feature",id:"4104",properties:{name:"平顶山市",cp:[112.9724,33.739],childNum:8},geometry:{type:"Polygon",coordinates:["@@l¤UbVL@V„LVb²VlKlaX@„„lbš@lxUVULƒbšln²VJUbW@@L„b@`nL@nVV@LVŽUbUVm„kVl„ƒlXbl@Xn°ŽVK@_°`²IVVV@VUVJnInaWK@Uš@„K„LÆ@nmlXXWVUUw@klKVa@knyVkVanI‚JXUl@XbVUl@@aša@mXk‚bnK@UlK@UUUVaXaWmkUm¥n—WmXaWaœkl@VmÞb„KVL@aVI@mUwVm„@KōméUL™KVaUk@kUK@U˜WXI@VlKXU‚@VVnInVV@VLlK@UUƒkKU_@ƒWWUwU™@klƒn@ƒƒ@Imb—@@m›nUKÛ@mKUkWVXxmbVLXŽVVU²VV@xÅnmWmLU@kbmJ@b¯š™IUb™JƒUUxVl@z@bU`W@Ub¯nUJUbƒ@WLUKULkU@aWKƒ@aƒbmL@ƒlmUk@@bUL™ƒWJUI™°@ƒŽ¯aWLk@mbUb¯b"],encodeOffsets:[[114942,34527]]}},{type:"Feature",id:"4101",properties:{name:"郑州市",cp:[113.4668,34.6234],childNum:8},geometry:{type:"Polygon",coordinates:["@@@nWVUKÅ@W„nVnI‚ŽV@œkƂšwV@šnn@lxÞlnôJ˜zXJl@nalUČVlƒl@²UlkôVVUnm„I°VnV°@°¦VJnIÆJÞan_VmU@ama™@kU˜¥kaUklw@UIV¥kVUI@ƒmmUÅmUlƒwVU@amU—JWbUakVƒ—Vé¯Im`ƒk—@ƒwVWmLkU¯ŽƒXkWmLmx@UUƒbm@@x™J@LbW@UUVWUkVKƒ@ka™IUamKUkkmmLƒUkJUVWXkWmnÅ@ƒKƒL™@@VXLmbmJUIUVU@ULWVkK@nWVXL@lVn@¤„b‚kôKXKlL@¦²V@JƒL±@„@VU@WV@X@`XXmb@Žšblaœn@Jƒb@V"],encodeOffsets:[[115617,35584]]}},{type:"Feature",id:"4105",properties:{name:"安阳市",cp:[114.5325,36.0022],childNum:6},geometry:{type:"Polygon",coordinates:["@@°kVaV¥kVmUkWkWVkVKUwkkmKUU@a„wWWXWakKWkXmlašIVmX¥ƒU@a„@WnK@kƒƒ™V™I¯ƒ@KğI@WU¯LkK›akƒƒ_kmmVU@VWXƒKnVmbXbVLmln@VVknlVUnVlkšlnXbmlmlXblnÈlWbn@@nšK@V„L„bVV°VVzšlnš@V™xƒI™b™ŽU@WLUa¯V™UkWõ@¯kkmxk¼l‚„XUlVbVLnlULmU@lƒLkVUlƒX@xW@¯mUƒ@UmIUW™L@aXa˜kU™¯anƒWk°@k™kKmmUIWaambUkkKmV¯aƒ@UblŽk„mXk¤ƒ@@b™@UbULWVnb@lUVVnmšnVVU„J@bWXX@WJkL@blVU°UV@XlWnXUbW@UVkVšVWbnLUJWLUK@Lnn@blVU‚„nUblxVUVJXU„a˜@Ub„LnUVV@mVIVVn@UbV@‚XbmbUV„_lVXUWanJVI@WkI@WVIVU°WXXl@la@mX@lLXl‚kVbœm‚X„ylIXJV@@kšKla²UVa„IVyÞb°LlVna@UÆKnLVbšK@anwU™"],encodeOffsets:[[117676,36917]]}},{type:"Feature",id:"4102",properties:{name:"开封市",cp:[114.5764,34.6124],childNum:6},geometry:{type:"Polygon",coordinates:["@@lUVbXa˜InV@bUV„x‚knVVÆnn@„VJlUU¦VJ@kxVllb—¦lVš@nb@bVŽUn˜aôJÞIXbVJÆI„m„xšUšV„w‚U²l@XƒxVl°bVLXb‚`XklUnmVblLœ@lmšx°LVK@UXIVašWlL@Ukƒ°KkVaVUXmmI@UÅKmmƒXka±K—L@W›@kUÇxUUƒ@@UXUlKkklW@ašX„a@UƒKUaVUUV_@yXk@ƒ@a@U±w@UUW@_„mmw@wVw„mUaÇbUa¯UUkmWkn±JÅxmIbUxmKmn—JWw„kUaƒK@a¯@ƒbk@mVUIWƒ—Lmwm@Ua@WJUb@LUl™@UUmLUbWJ@VL@VmXWWzUJUꄘ"],encodeOffsets:[[116641,35280]]}},{type:"Feature",id:"4108",properties:{name:"焦作市",cp:[112.8406,35.1508],childNum:8},geometry:{type:"Polygon",coordinates:["@@V@VL@x@bXŽWV@XkššlUŽWX@J„@nI@KlL„KšUVaV@œJlL@KUk@KÞL‚l²_‚@nWlL„UVVš@nLWVUJVn@anV@a„wÞUVLVx„b„@lW„@lbXn‚Vn@@¼šL°mšKVn@bnl@nVK@blb„L„W„U@VWLXV@nlKn@lVVbXw°nV_@¥Vƒl@XI@mlƒkkV¯VWnI@W‚@n¹nƒ@aWKXUƒaWk@yk@k„ċUkVmbk@WI—yóImÝkkwm@™mU@™xŁ›lU@mJƒX™ak@ƒx¯V@¼¯Vm„UmmIkVWK@UXIl@UWVUU@mVUI¯b¯@™lmKzWKUa™nƒJ@nƒlbÝ@@b"],encodeOffsets:[[114728,35888]]}},{type:"Feature",id:"4110",properties:{name:"许昌市",cp:[113.6975,34.0466],childNum:6},geometry:{type:"Polygon",coordinates:["@@lI„VnKlnVlnLVbšJlb„@ULVlUXVVX@‚a@KšI@wn@„aVV‚@nwnKlX„W°lVnKUX„x˜@„ln_°JVIXy‚XnW@U‚K@UXIVanKVVš@Vk@KVaXI‚@Vbn@nx˜KnaU™l™ƒn™Va@ƒXa@™VçUUla@aUK@wmUƒLk`kIWVkLmK@V@XUlƒn@JXV@nm„™bU‚óIƒmUa±@@ÑóVUUk@UlKVU@akWVUUlUUaUK@UUKWbUkÅJ@XWaƒ@XbmJ@nUJ@bUKƒLÝaUnk@›lXbWbXnm˜n¦lVXnWbUbVV@VkL@VmLaWl@n™b@bk@UVWak@WVImJUbUlmz@lUbkL@lVx"],encodeOffsets:[[115797,35089]]}},{type:"Feature",id:"4109",properties:{name:"濮阳市",cp:[115.1917,35.799],childNum:6},geometry:{type:"Polygon",coordinates:["@@lLXbW‚XXƒx@bVVnLllVxULUl‚XXlVlUnlŽU¦Ub¯l˜nœK@V‚bVb@šXbVL„KVxVVnIlašb„a„¥lU@wnalLnVVlVLXnlWVXn@@lVI@WnU@mƒÅW¥—aW_k@WwXy@kmƒ@wU„mš„š¦šlUxVLV@UwšJ°xš@VX„@Vb„@š`VX@VX@llšIVbnJlI„bšV„l„˜J@ƒmѯLóa@ƒƒKUa„k™ƒ™Xƒ@UK@wU@ƒlWUUݯImW¯aƒLUKU@ƒkƒ»k@mƒwƒa@UnKWI@ƒUU@akVWK—k@a±ƒbóUWKXUmk™KUmLƒbUx„„@lmLXŽƒ@@b„VW¦Un™JkbWnXl"],encodeOffsets:[[117642,36501]]}},{type:"Feature",id:"4111",properties:{name:"漯河市",cp:[113.8733,33.6951],childNum:3},geometry:{type:"Polygon",coordinates:["@@@Lƒ‚UnVxnIWa„@Xb@WÆIVlXaVL@VVLVbkVVŽUVlX@bUVkLV‚l@VVôU@Ò²@Vb„nôJVšanƒ@mWU@I„mVk@WkI@wmak™@wlW@w„@VbnLVb°bVyX™V_@aUKVVK@wUU@™™a™K@kmbXVmJUXƒ`kn™nƒK@aU@mw™akb±@¯ƒUUÝKUUU@WU@VkLUKU@mUmJUU@WVkL@UWJ—X@VVL@lVlUbšLVKnêƎ"],encodeOffsets:[[116348,34431]]}},{type:"Feature",id:"4106",properties:{name:"鹤壁市",cp:[114.3787,35.744],childNum:3},geometry:{type:"Polygon",coordinates:["@@ó™™n@xVVólƒ@¯zƒJ@bkl@@„kVWLUVmVXbVJnnlLlš¯@Xlm„°bVš—lWb@bšKVXnJ@VV„°nX@@w„WVklU„K@knVVKmkUKUaVkƒWkl»nwlŽ°lö@lXšV°UVbXKV@šša„Jšw@Um™™kUy¯UUUƒaƒK@U™L@mm@XaÇkkmWank"],encodeOffsets:[[117158,36338]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/hu_bei_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"4228",properties:{name:"恩施土家族苗族自治州",cp:[109.5007,30.2563],childNum:8},geometry:{type:"Polygon",coordinates:["@@VK‚bX@lbUVnL°„@VlVnUl@VUX@„aVƒmaXƒlašUUU@wmaVUn@Vƒnmmk@m™U@kna™aU¥Vam™X_@WƒU™mW@_kƒVaVKnL‚lœ@VVal@k¥@kUW@kUKVUlUVсW@kÇaU»ValmkUVUVak™@aƒV¯_@W‚UkmVUlU@aœƒƒalI@akkVWUaWXUWwœWVbÆ@„„l„alIVK@U™m@UU„W@al²a‚¯UağÇm@ƒbkk@wƒ@@W™aULmxƒIU‚™ƒb¯@U`UX™JmL¯aƒKX›WUL@aknmK™@aWUXaWm@I@UÅmVU@™™aUV@b™VƒI@WkU›bXkm@VakwUKULWKXmJ@XUK@ƒmL@KUwVaUI@KU@mmn™mXka@»V@@UUaƒw¯yVk@ƒUUVmmkÛÈU@mWUnmx„šmlUbV¦UlbWVUL@UUƒ™IUmÇKV„VbUVVxkn™LUxV`VX@š„„kJVVUXWaUVVlUnmKUbkI@WULmK@L@LVlƒLnmUIWV@aknƒ`VXUJIVlUVVbUX@¤mbnLm‚m@UXk@mm@Ukaƒ¥@kV@@KkU@aUKWbkLWVkIVŽk@UbVlmX@bU@@mmL@bn`@Ln@llVLVk„@XVVU@`VXUš‚¼k`VULka@VllVIn¤VU@@bl܃bkx@bkL›škKƒn@bn@@b@JUnV`UnVbVKlVXUlbn@°ƒVx„@@b„nVbUllVn@V—VK@UnW@UVUšlnk‚VÈޚxVb„VVI„xVaÆ@@aka@UVaU@@a„k@Wl@nbVIƎ@Jk@„L@VlXnlla@VJnw@UmwXU@aVK°ÒnllnLlb„xnKVaV@l¦²nVl@llL„x@XVVœ‚Ķš@našx@U@al™XUVa‚LÈþV°XxWXkK@šmLnlUb@b‚xnLVlVVkb@UJ@xWXXš"],encodeOffsets:[[112816,32052]]}},{type:"Feature",id:"4203",properties:{name:"十堰市",cp:[110.5115,32.3877],childNum:9},geometry:{type:"MultiPolygon",coordinates:[["@@@a@w@kV@nbVK@ƒnUla„@la„Ål@nlVakwWX@WkLšaVmšwV@anK@UlIXmWkk@@mmLkWlwk@U_mKXwWK@U¯K@UU@ƒVUa™kmƒkI™yUUVUmanU@mlwkƒ@_mWXaƒUWU@ǃ@U@aUaVwUKUIƒVkK@UWIXƒmaV@k@Vm@UnwlƒUamk@V@„ULUamxUJkU@Iƒ`WkkK¯XWak@@W@IUV™LWJkXkaÇVUKƒ@kUmbmUUƒUKƒbkKWUkI@ƒkKÝ@@aƒUm»nI@mƒU@UnWV_@aUmWbkLUl¯b@a›kkk@WkkJm_k@UV±@J@b›nU@@WÝIUJVbXL@nlJkx@„Wn@VkJmb—LmUƒ`VbUL@xVn„@XVƒŽ@„mVVnnJVbU„ƒx@„V„nVUbVVƒx@šn„™bUK@bƒ„@bƒJ„šm²„VU‚lbXzVJV„„JVbn@@Xmb@V@bVJÈ@‚Vnkn@°aVVV@šX„KnalLVmšUnnVKVlnLWlXX„Klk°š™šXŽWškLUVVV@nU@ml¯nmbk@W`Å@mb—LWm¯UƒxnêVèk@mbƒVƒnUK™@kKmXk@@JUI›lÛLllnbVnlJ@LULnlÆaVLnŽV@nkVJ„@lkô@²bÆm°w„L„WV@VXšKšVXI@W°ÆVšK„b°U„JVIVV„¦XKVL@l‚InaVÝnUl@@bX@‚™nmVL@lVL„lVLVUnbVW@xXn˜bœU°¤V@š™„a@kWKUUn@VlnL@UV@Ü»@mX@V_ƒakaÞ@VK‚¯@kkW"],["@@mUkUUm@nllVKXXVK"]],encodeOffsets:[[[113918,33739]],[[113817,32811]]]}},{type:"Feature",id:"4205",properties:{name:"宜昌市",cp:[111.1707,30.7617],childNum:9},geometry:{type:"Polygon",coordinates:["@@°`„U@blšUbUVlVkn‚ŽUbV¼Èb@l‚XUÒkVUVVL@lVX@ll¦k@UbU‚›@kmKULUbl„@`nXšŽ„V@XW`nšUbV¦šbmb@lšV@nnlmnU„m@UVnb@xVV™VkbW„nb‚VnVa@an@UaVU‚JXnWlXX@l„¦@ŽlKÆX„bX‚V@VV„@°¯°xXx‚XV@nV°UVWU_VWXkmaVnWVkn@lln@lb@UVLXWlnX@˜aXUmaVK@UXU„U@WVI‚W„XXV‚U@¥VKœ@‚Uގ„„‚a²LlV@kV@UanKma@UVUnK@UVLXyVL‚knJ@UV@@UXKWUXaV@Vb@mVLnKW„m@aUUm@@UkK@Ula„LXKWaXI@alKlmUk@wVKXL@m@WWn@UVa@K@wna@aW_XWWkXbVW@k@U¯WWwka@UUaVIVƒkU@m±@U@@wVKkaš_@VV@XUVwU¥‚šyUkm@V±ÈUKk»ÇL„m˜mLk@ó£kmWwƒm@U„IkWKXwWU@ƒkLƒwkbmaƒbkK@VƒLkmWIUKkUUƒÇIǫJ™XÅJULVŽÇLUVƒ@UK™@kI@WVI@UaƒWmXVVUL`±kÅLmKkƒƒkƒÅ@Ua›XXxWVXŽVbUXll@bkJ„b›„@bkVUVlnV@X"],encodeOffsets:[[112906,30961]]}},{type:"Feature",id:"4206",properties:{name:"襄樊市",cp:[111.9397,31.9263],childNum:7},geometry:{type:"Polygon",coordinates:["@@@Xl@Xb°WlLXl„_@JlVVInwVbVK@ƒ@UnlVbk„mx@VUnl@U@nbW„XJ@VlL„UVJVLUxVb@b@VȄ‚@XV„VWbnX@`l„kx@nmVnbUVVVšzlJn„šlVb„UV@@V°L@VXLWxnLV`l@kxlXnK@nl@XlWn„`Xnl@@UVa@VÈKš£VLVanW°U@UVU„@„`VIn‚mV@„nV@Xa@aVW@UšalkXKšblI„yƍXnlJXbl@@VV@nklU@`„nVK„LVKVb@V„U@UÈK„UVKšIlUX@V`lIVbn@nblVVmV@@XXJšUVV@knKVn@`@X‚VnK„wlLVmUUU@ƒU@aXL@WlU@UUW@UmU@KkLWaXkWmXUWm@U@ƒnk@UmK@U@UaUVUUKV_@al@namWUI@KUƒK@aV@WUIƒbƒ¥ULUJkIm™ƒK@U@K™V@U@a@UkU@K@wVaUwlU@mUƒULmKUkV@@anIWmUK@I¯„mKkl@LUb±lUakLmk@WwUKÝVUIm`¯n@Uk@makJU_@ƒƒJma¯ImwUVkKƒb™aUÅ@wWaU@VU@mXIVmmUkJkwm@mIlUKWzUK@VmLUV@VnbmLVbU@@lkU±KbƒƒÝV›@UL@¦VWUƒWXUJ@XƒVWV@VULnbWV—bW@kmWXUK@Vkam@kkm@UlmXUŽnbWlUXV`UX¯VmUU@Ul@Lll@nnJ@LƒnWmbmš@b™`ƒš","@@kUUm@nllVKXXVKmU"],encodeOffsets:[[113423,32597],[113794,32800]]}},{type:"Feature",id:"4211",properties:{name:"黄冈市",cp:[115.2686,30.6628],childNum:10},geometry:{type:"Polygon",coordinates:["@@VVUnWVXnVJ@„‚U@V@VXŽV@@IVJUnŽ@V@L@KlIVlVanLVbnVlI„ƒn@@a@Kl@@I„JlI@aXU@KlK„kVblJXU„VlU@V„bVkVKXn@VlxVa²I@VlVUxln@bšJXklaVWnLmÅ@y@k@ašI@W@aXIlVVaV@nnlKnLVW@IUa@a@K„UVVlI@wXKVV@IUƒla„@lUXwWƒnƒnalLlxXLll°@XwVKVaXIl™nb˜@nln@Va@U@k°ƒUmÆUVaXI„JV¯ÇUmmkU@WaKmakVm@U@aVKkkmKkVmIkÇ°£@aUUVaVVnKlkX‚mkƒ@ƒlUVaX@@Um@‚™UmlUXV„UVU@w‚K²¥Ua@I@UV™l@U™V±UIUÇ°»VkUmVI@a@U™m™ĉ™¯V±bŹĖğaÇL¯lmŽkX@‚óĀ@ŽmšÝêb±WkLƒn@xXx@Ž@b@V@LW@UbƒlţXƒ`kxWnXô¯¦ÆV@L@JVLƒxkK@V@bkz°l‚lXz@J„UlVla@XUV„bVKXnW`XXV@laVV@V„X@V¯xƒx@xULVbUJ@n@LU@VmmakbUK@b™IWWUUVkUmkLm@VJkb@nUJƒ@`V@kX™aUaVmmLkUmJ@Uk@U„±lkzmJUb@b„VUxVXU¤ƒL@JƒX@VlL@JkLUVU@mnUl„¦@V"],encodeOffsets:[[117181,32063]]}},{type:"Feature",id:"4210",properties:{name:"荆州市",cp:[113.291,30.0092],childNum:7},geometry:{type:"Polygon",coordinates:["@@ÈJV„lVVLXJln„K@UlL„anbla„xlK@„XVWxXLlƒJ@V„nXxlnô¤l@nKn—‚ƒÈKl¼VL²Ç‚Un@Vl™zŽV¦UxWVU@@U™`lbUL@xV@²@@nlVU„UJVb@VlbXx°XVWX_VKUwVKVa@UVKUUVk@KnblaUU@wnWl@UX@lÆ@@a„IVmUk„™šxVJ„U„bܙ@Uk@WWnk@Vƒ„™Vm@I@m@Un@m™XUlVlUnJ@knJVU°@@aÆLX@ƒllL@¦nJV@XblLVa²U@UlWš@VX@`@LV@@bXJlIXml_lJœU°b„KÆLnVVl‚@ö—Vƒ‚mXaVIĢllUlVnLVlX@@b‚ašnnxšV„L‚bn@°ÆXmmkĉƒ¯w±™™™Uċ@KÝÅƧŃÝ癙Uw¯ƒm™¯k@W‚kV@¯UIUJW¼kb™Uƒwk@W`@¦Uônb@VƚlÈ@VU@ƒƒ£UWWnUÆUnmJkUÇ£VWUI@aUU@WkI@Uƒa@JW@k£kaWVUKmnkKƒb™kkVWb—VmUUmwU@kk›@UakUUa@V@nlx@lUb±lUbnnWLUyk@UamœUK™@mlk@Wb@VXL@x@xWI@a¯Ž¯V@bVn@LkKmL@`XmKmVU@@bkL@V±bk@Uaƒa™L™KUVƒIƒ„™W™XamVVbUK@b@Lm@UWkxULWVUnm@UlUX"],encodeOffsets:[[113918,30764]]}},{type:"Feature",id:"4208",properties:{name:"荆门市",cp:[112.6758,30.9979],childNum:4},geometry:{type:"Polygon",coordinates:["@@n@lxlInVUnWJ@nUVV@Xb@xVƚb„alLVUnx°Jnb„I@„V`lInbl@@V°mn_VJÞUVLXx‚@nllKVb²kVa@KlknL°ƒ@JVLXnmJ@bU@VlnLVKV„@nX@lUšKVaXal@VKn@¥°L@Unw˜bnašV@KV@VUX@lVXI@KW@@IXWV@laVL„„KlaXUVVnkVWV@lwXblIXWVkVmšaU£VaUmVIkU@y@WakKUamU@UUK@kmK@w@@mK@LƒV¯™U@WwkmULƒamVVUU@ƒƒIƒbUKUa™kmƒm@UakLmxU@UÒWlULţÿmwkIUm@a‚kÈblW@UVƒUUk@JW@XkWWUkUKUIlw@aUWknWUUmnIWƒ™aUwVaۚƒaƒVUI™wƒšVlUnƒJ@bÅ@@kVWk@mX@xVVkbma@LUlVVUL@VUbULVxULW`UX@V@lUXWaXlWXX`@bmb@x@LUb@VmŽXX@‚@nWKUL@xVlknkL@bWJXbWLƒKkb@VlL@Vn@VV@bƒnX‚mLUK@nUaU@WbXVWL@VU@@V"],encodeOffsets:[[114548,31984]]}},{type:"Feature",id:"4212",properties:{name:"咸宁市",cp:[114.2578,29.6631],childNum:6},geometry:{type:"Polygon",coordinates:["@@ÞƂLČ@šV‚š²š°xĊ„nlWnŎ¯m@aƒK@„„°‚n„Jšwn™VIUaÆJšÅ@wšwV™XW@aV_l@²V°lĊwlaXLšwlUkalVVaX@lVXI@a˜UXJ@U°UU¥VIVKVklanLVa@VÈIVV@nk@aVa@mV_@a„K@klKUa@UnKWk@@lU@@UW@@nUWUwmaVIXƒ„lV@mLXblJ@kV@kk@KU@WƒkUWVÅwkLmW@UmL@lUL™KULƒak@maUUÝwUJƒIb›KUUƒ@š™aWK@kUWVkUwVw@™mÝ@™I@wkW@a›ww@LU¥™kƒJ@nVJƒIkVVnkV›UkyUIUl@xWUkaW@@°kz„ŽWxkLUWmzk@@bVVVš„b@‚@XlVœ@Vl@bVbUn™`Wn—@Wb„VVI@`„LVbXLV`mnU@@lƒL@LUŽƒak@ƒLk@WbUJn¦@lVb@xVb@n"],encodeOffsets:[[116303,30567]]}},{type:"Feature",id:"4213",properties:{name:"随州市",cp:[113.4338,31.8768],childNum:2},geometry:{type:"Polygon",coordinates:["@@„@nš`lw„k„ƒ„UmUVWX@lk„@VanUĠ¼V@@mX@@nVV‚VXLmJVLnK@b„V@@J„@VUn@VaVUUUVWVLV@@Kk_@almaVkUU@WVƒVUVLXmmk@wUaUKUV@°™@kmaUaÈmW„mUƒVklaX@lVnxl@@UnaUk@ƒVUVwVK„nš@VVn@VbVJUknUmmVmk_Vw„KUUm™Vak¥@UVKVIkW@UmIVWkIVƒkmmLkwmVUƒ@LƒUU@VVXL@JmLUbmK@UUKmkKUUmVUaUnÇlk¯™mJUnmLUaUJUaWL@UkJ™ƒUƒ@ƒaklkU@¯@KWLUmUUWVkbƒLƒŽUKkbU@WX@JX@@LWJkUW@UVU@@L™Umb—amx@V¯K@¦mŽULk@WbUb™LkVW@kVVxUb@x@LlV@V@b@VšU@L@V„LnšlJVIVK„¦„aVJ@XUŽ@b„LV‚@LVJnXmbk@@bU`VLUVV‚b@V@VnL@Vml@„@VXnWVXnWlXblK@LnV@VVX@VkV@XWK@b„VV@VV"],encodeOffsets:[[115830,33154]]}},{type:"Feature",id:"4209",properties:{name:"孝感市",cp:[113.9502,31.1188],childNum:7},geometry:{type:"Polygon",coordinates:["@@VnXK@L@°lVlk„b„@„VšlI@VXKVbVIVbnKVmnI°šlŽÈkVmVbnUVVlLnVL@VnLVanK@IWKUUV@„V@KV„nUlxnKlnU„lJUXnJ@VlXUJUL@Vl¦UbnšVVƒLUxl`UnnnmVVlnVK„bšmVX@a°Ý°LšaXJV@VUnKVXVK@LnKlLUbVVX@VwVJVn„@@UU¥V@@UUK@ƒmaUVUkkJ@L@K@UmVUI@JU@W@U@UV@ƒUIWmXUVmUUÇ@UVmIlmnmakK@akaW@UwVUkKVnUlKVwk™ƒVU_WKUkVW@UXaWkUa@w@VU@XaW±@IkbƒKƒb¯L@WƒXkWƒ@UakL@UV@UmVUmL@UXWVL@ašUƒVUUUVU@yUUƒIUa@wUKWVU@kƒ™™Wk¯UkwVKƒLUx™K@nVxUlUUWVUmw@wƒUUyXWlX¦WbUV@„U‚@blbUVVbXXƒl@lVL@bk@lxkVVnVx™¦ƒ`UnkL@V@L@Ž‚@@xnL@lVL@VnVVblLXb@‚@zlVUJVnUbV¤™bUnUlWXkJWakxU@UXml"],encodeOffsets:[[116033,32091]]}},{type:"Feature",id:"4201",properties:{name:"武汉市",cp:[114.3896,30.6628],childNum:1},geometry:{type:"Polygon",coordinates:["@@nbnm‚knJVUÈ@@Uƒ¥VknmV@VUlK@IkK@U„W@I„KV£UWVwƒU@aVanIly²kVƒl@@VnIlVnKUnVbšblWU@@_„‚VI@mlaUIn@lKVnUlVVXXšJ@aVLlanbUnV@@K@mVIUaVK@w„w°w@UƒW@UUUkbU@WWX_WmULƒaVU@WkbkUƒV@IWyk¯kly@a@UlL„wUK@I@KÅUW@ѱUm@wl¥kaƒ@@_Vw@ķƒa@akw@ƒkKW£XVUVwVwUaU@VUU™™xWKkbĉx¯k±Uk@U`@bWXUš™x@x™ÆÅIVbUJmš™xƒImƒ¯@ƒ™Umx™nUVVbnJV„@Lƒ@@ŽkV@bVnƒ@UVULlx°VXlššl„V@XUVL@xVb„JVV@zUVVVUV„™V@bUKWX@VnKUVVnU@@VlKVb„@lX„W@X°K„a„Lla@JX²Wb@ŽUV@@xVbXlWb@VUXVlXLV`Uš„lŽUxkLmVUŽlLUVVxX@lb@blL"],encodeOffsets:[[117e3,32097]]}},{type:"Feature",id:"4202",properties:{name:"黄石市",cp:[115.0159,29.9213],childNum:3},geometry:{type:"Polygon",coordinates:["@@VšUVV@VbUx„aWUœblUVmnKlX@bXJVIlVUxVVVIU‚zlx¯š@‚VbnL@x‚x@UVaXK„b˜@Xk‚WU_Vm²klW„XVK„Žl@nXV@@w„mlK²X‚aÞén™@ôÿ@lWn°kUKmmUљUmm@ƒwkImWU@UakL@bVLUVċ@™bUK@alIXKWK@™nXnKmkUVwƒ@¯b@L„lUL±W™n@KULUaW@kL@lƒL@bU`@nUb@bmlU@UÇJ@UUbmKkblŽUULUJV¦¯V@VWI—V@bWJkUW@UbkUlbkV"],encodeOffsets:[[117282,30685]]}},{type:"Feature",id:"429021",properties:{name:"神农架林区",cp:[110.4565,31.5802],childNum:1},geometry:{type:"Polygon",coordinates:["@@n`lIXll@lœl@b°aVklKXaVn@bU`mX@V„V@nmJn¼„V@bÞ@lL@„lJXVlL„aVLV„nVnalV„@VLÈUlblWXIšKVU@J„™š_‚@an™na‚X„m@KmI@mkk@KVkWWw¯w¯°ƒ@UUU@WƒaÅWkL@ƒ¥@kWWXkWmIUVVbm@@bUbmUU„ƒbW@UVk@mVkU@U¯ƒmKVUkaW@aULƒÆVbƒb@VÅ@Un@VƒLWl¯Lš„"],encodeOffsets:[[112624,32266]]}},{type:"Feature",id:"429006",properties:{name:"天门市",cp:[113.0273,30.6409],childNum:1},geometry:{type:"Polygon",coordinates:["@@@K@UlKVm„_š¥UwUmlUkwl@@aUK@k„kWWUaVUka@aV@ƒVUXaW¥Xk@WWIklm@ÅxmI™VÝUkxkaƒ„@bWJaUL@„W@™l¯UULU‚ƒbƒkV™Ua¯bm¤UnÇUkmUšUx˜b@VkXÇal@bVnlJnxŤĀVKXkVÑV@nwlKVbn@n„šlVbVL„a„J@„VV‚UnU„bVKlnXxV@°š„U@KnL"],encodeOffsets:[[116056,31636]]}},{type:"Feature",id:"429004",properties:{name:"仙桃市",cp:[113.3789,30.3003],childNum:1},geometry:{type:"Polygon",coordinates:["@@VK°VškX@@ƒVK‚bXI@a„ƒlblwÞVšUnJÆwn@lkXJ@X‚WVz„V@xnx‚VXUVVVkUw@mšLVw„KVU„@Um@alU@„@@KUƒmIUaVUšmnwmw™mb@aW@UkmKkUkVġkUJWbnU„õ˜@UkmUÅKƒL¯a›VkIk`WnkJƒ@xVLUVVbUbk@WlXbm„VxnxUblbUV™@@VUV@nVL"],encodeOffsets:[[115662,31259]]}},{type:"Feature",id:"429005",properties:{name:"潜江市",cp:[112.7637,30.3607],childNum:1},geometry:{type:"Polygon",coordinates:["@@UbVxšbX„mJVnXVlmVX@bkxVJVLVlXXWlX@@IVl„V‚U—aVwV™lnÈVVmn£°aVbUš„l„aVUK@mVU@Uš@VUkaVamwUwnƒWaXkl@VaUaVUUK@w„WI@aU@@K@_UW™@kX@V±VUbkKWaU@mI@¥kK„kW@ÅK@b¯@UVmI@lmIkVkUWVnšm@@V@n@JUnƒšU„@ŽmlXXl@@V"],encodeOffsets:[[115234,31118]]}},{type:"Feature",id:"4207",properties:{name:"鄂州市",cp:[114.7302,30.4102],childNum:1},geometry:{type:"Polygon",coordinates:["@@°¥WóXmlw„_ŤW„kVaX@@K@U@a@WwU@mWk@ƒULƒWkX±lUnV`XWl—@ƒaWLUb@Vw@wmKUa@°™kw‚yVUJUUVwkUUJWI@akWmLUnkV›aXVƒbUxUVWX¤lL@„lx@b„b@ĸUx@`„@lbk¦@x‚n²VƄX@"],encodeOffsets:[[117541,31349]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/hu_nan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"4312",properties:{name:"怀化市",cp:[109.9512,27.4438],childNum:12},geometry:{type:"Polygon",coordinates:["@@@n„‚@b@XnJ@k°x@aVUnl‚UXnV@@VnJWUJV„nIVV°ŽUbVVVL@Ž²LUVa°V@aV@nm‚UXblLXWVXVmVLVK@an_„`@X@l°„VlXXW`nX@Jmn@b„@nV@Lm`„bUb‚n@VUVl@nIVbUlƒV@LkJUnVV@xVblVUbU@ƒzUKU@mx@xUnn@@WV@lbUb@šnVWXX‚V@VIV@VUnJ@VUz@JWbXllI@VXVVL@ŽVn@„„Wlb@„Žl„XVlL„aV@VJ@XX`„kVwVl@bk„‚bUŽlVXIlƒnLVa„mVwV@@nV@XaVJVbX@lwV@n„@nV@VWnIVVUŽÆ@Xx‚a@I„UUKmk@mVƒ„IXmWUš™VJnUVU@anaVwk™›U@UXa@W™@m_@a¯@@K@UVƒ„bnK@blIlbXa@WW_n@VƒU@¯bmyƒUkUJÇÅ@WU@kWKÅwƒnm°KVkmankVWnXVWV@UƒƒwXkV@mƒ„UlLnaƒVaX@VUn@VnVK@xlnXWšU@a™@@klak™Vw™mUaV@™wmIÛ`m—@mVUXmlIXƒV‚I@K@aU@UaV_UK@wkUmmUKWXŽmVkUƒL@mƒƒU_nK‚™@aVU@Ukak»@U™™@ymUƒ„¯™ƒUUƒVKkam@™nka@ƒmwkLWb¯mkaƒ_VaVKUƒ™IUw@kKmU@WK@UnƒmaULkU@wUalWV¹U@@WUI@WU@‚_@W@U@mƒU@WbbUK@Um@@UmbUwWWkk@WU„a@anUUwlWUwUU@wlJVUnnV@@mnI@m‚K@U@w„a@wUm@_mƒVUUaVUkƒƒƒ_kċUk™VWLƒ@mlU@kn¥W@UwUWV@VÝU@lXLWVUbVLXlVIl‚knmU@VUJk@@„ƒ@™kVmwmVkxU@@XmVUb@xnKVLl@VxUxkIU`@bWVXX@JWL@bkb„¤@bmUUU¯Kƒkmb@V™VU„VVn@@„Vb@`lnœxmb„lUn‚bk„@xU„mV@bmWbUV@VJ„Il@nVUb‚K@nn@VbnJVIlJVkXJ@X@lmx@bnnWVXJWXU@UlU@mk@@llb°x„IUbnJ@VWbXVmI@JVX@bk‚@bWL@JUXUK@U@Uƒ`n@@Xm@XVW@@nX@@`ƒImxU@@JUI@KƒLmK@UÅUUV@VW@™¯kUU@UamVUUmJ@n„xmLKƒkmJkwkKm_mKXU@aƒU@b@Wk@ma@zUJVUmbUlU@™xnXlWlXXblK„¤V@@nUVVLkVš„l@Xb@VVK‚nXKVx@znW@X‚@@lVK@X@JXbWbnn@JUamLVVXIVxnK@aWUX@˜x@VnI@WlI@anV„IVxk‚l@lbXXšxVVVJVInbV@@ln¦ml@XXVWbkJWb","@@XLVKVXVKUa@UUUmV@l"],encodeOffsets:[[112050,28384],[112174,27394]]}},{type:"Feature",id:"4311",properties:{name:"永州市",cp:[111.709,25.752],childNum:10},geometry:{type:"Polygon",coordinates:["@@lxUXV‚lXUVnlVĢ„JVbUXVJV@XUW¯„VIUK@klW@Un@„nl@V`XUVL@l@šVx@„XXW`UnUbšxUlVnUšV„lb@VnJšUVVVInJlUšVnwVklKnw„LVJVšV@nIV@nbVa@KVVVUUa„KV_nVVJ@_VW„nV@n¥lI@anƒl¥X_VKlwVlULUVVVš@šU@VXL˜ƒ@IUmn@VU@wmKXUWU@m²šl@VIXWWkWUkWlkIVamUXamUnmWUU@@Un™lK@XJl@kVUk@mWKXkl@@aVU@UVWUUVa„In`VUVLnw@U@K@Uƒƒ@w@UVmUUƒ™°K@UnV@bV@Xk@KVm@amk„aU£VWUUmUUwm`UbULka›KXU@kVmU™@aV_UWVIn@˜y„XXK@klmV„V_kWVUn@WUU@UƒmaU@™wnwWanUmmXkƒam@UakLmK@b™xUUUU@Km¥Vaƒ¯@ƒkUaVUlm„UU@mUUÇmUk™Uyƒb™bUa™XUWWbÅLmL@V™aL@WWXUKmmk@a@UUK™XW¥kU@VƒUkxmVkUWbUJnVJ@nVJXzWxkŽ@lVbUX@VVL@`mbUnšŽUn™VV¼k@Ulm@mwLƒb@lmLUK@UamƒWkƒK@£Ua@ƒ›UkJkUmbVlkX@bWbUŽVŽnnUVl„@bšbVK@VX@lb„V@nU¤šx‚²„Knblb@x„V„ô@šlŽ@b@l@XWxnVl@„VV@XLVl‚LUŽUXV`šbXXmJU@@bm@UUkLW@UlUKWUUb™wUm™L@nklVVmVXXm@@bUKlÆn„‚XkllVUVVL@nUbV‚@V@nnV@xUn¯U@JW@UX@xĉ@™`m@@LV@b"],encodeOffsets:[[113671,26989]]}},{type:"Feature",id:"4305",properties:{name:"邵阳市",cp:[110.9619,26.8121],childNum:10},geometry:{type:"Polygon",coordinates:["@@XIlJšI„VVK@n@VVVKnLVwVmnLVK@U„@šw„J@wVIƚ°X@ÜȄUÈxll@kn@VwVaXJWXn@@WVL@UUKVKV_U@@aVK„x@U„aV@lk„@XylbUaV_šVnal@W„U@a„I@aV@@aVUl@Xm‚UXWaXml@@kk@ma@V_UnUV™UUWJUa@kkaWLUmk@@LUVWUkJWkK@¼UnWJƒIkV@b@JUIm@Ul™V™m@Uw@a@kWƒXWKUknW@ƒWUU@k™mx™UkVmIUJUU™VmI@UkaUƒV™UmVk™wVaVmX_WW@ƒUw@™@kUKWVU_k@ƒmm@@VkX@lVLUJƒX°WVU@UIVWUaƒIUġmkVUkWUVWkwWXk`mI@¥kUVƒUƒUn±@m›XkWknV„UVmmU@@XƒVƒUk`@Xƒƒƒk@¥¯»mbĉó@mkU@kU™ƒƒ™KmX@˜UnmL@lULkKUƒWUU@ƒbUaUnƒ@Vb@l„¦Ub@l™@UKmnƒKUnl„UVVbUVn„@`Vn@xƒb@x@VL@nmJ@nU@mmUVkI@xVVVxkXVxmV@bƒbXVl@Xl‚XVxna@Vn@@VVL‚aXaV@n„‚@@V@X`V@@XVJ@XV@UºkXVb@xlVVKnbm„@VXLV@n‚lL@VxšJV„ULUb„`lb°nXalKnx@„lbšmn@lbULV„„V°š„ƒnV@zšš@Vl¼lb@VUV@bšmLV`„„@n„KlVnU‚XWVLnnlV@xVLU`VbV@"],encodeOffsets:[[113535,28322]]}},{type:"Feature",id:"4310",properties:{name:"郴州市",cp:[113.2361,25.8673],childNum:10},geometry:{type:"Polygon",coordinates:["@@²zVaVlnVl@nšVk„Jl_XJlIVmnL@mV@VXn@lV@‚XzV@lyV¯²U@UlJ@XVKnVVIXl@UVLV`@n@J„I@mlI„KVLnUlVUVVLXašKVLl@nb@ŽW„XV°KUnVV„L@xVJ„L@b@LUVVVU„˜VXbmbVbn@@lUbm@x@XVVVŽ@@˜@bkImx@Vm@Xbƒb@l°XU¤„a‚L„mnL@bl@@™VUX@VxnV˜anLnƒWƒ¥XKVwnUWXmVIUWÆLVx„L„w@wVmlU@¥XƒWUkwlÇn_Uw„WV@VU°wnU—ƒy@aVškVlnL@lVn„w@VlJ@b„X„x@bVKnb@U@WVUl@@Vnbl@XLlK@aVLVKnxÞn@a„LlmUaVU™ƒm@ÅknUmaUKmVk@m™kk@UlWUkVm@w@kUU@W™U¯™¥@w„Ç@aVIlUV@kUWU@UUm»@k@mKVkUKUwƒaUaUa›@k„kUWJkImaU@UK™@maUzk`@zƒy@XmJkL@UUJmUkV@z›@kŽkVmK@¦UbWL@a@UbmKmwUK™Xk›VUUkmVkw@UUKmL@WUIWa—JW_k@@WmI@mk@WkWULUUVKUUVm@šU„bš@‚nUǃ@U@w„™V@Ua@aƒL@ak„›l@k™UƒJƒwó@@L@V@„™`@œƒJ@xnn™šmV@bkJmUó@ƒn—JW„UUmƒU@UV@Lk„WlnnmVXbmxšxV@nbV„V@XVm@UVlXU`ƒUŽkn@lWLƒW—zm@UJVXU`@bVšUn@lWVœLlbVKVan_VxnVVVUXV¤ƒbnl@bUn@LWlU@@amU@V¯L„šVVUn@V@x„„@V@L@VmxUKUVm_ƒJUbVV"],encodeOffsets:[[114930,26747]]}},{type:"Feature",id:"4307",properties:{name:"常德市",cp:[111.4014,29.2676],childNum:8},geometry:{type:"Polygon",coordinates:["@@l™U™mkUwUyV™@VW@¯Va—VmUU@KVUVUVLnaWƒnkUÓV_@mVU@݄w@ƒka@kVmƒUmK@IkaUamKkXWaUW@WUk„™@@KVU@aU@™L@J@XÇVUKVak_mWkLWakVUbmLUUmlUVKUU@kUWW@UImJ@xkLkKm@@Xƒ@ó݃@UUk@UKƒV™ƒULƒKƒXkWWbkaƒIUƒWU@mUk@WLaUJġ™ƒ@@XÈÆVIl‚„Vnz°aV@U„m@X`@XWbkakJ@amLƒaU„@V@L°@@bn`š@@XWb@VœVlšUxmb@bUVmVUI™šXVWnƒJU„@nnlVLƒV@JbWzk`m@UVK²V‚x„k„LVl„@Vn@V„„°xVKVkœVVlUblx@bU„‚Æœ@@nVnUll„kx@VW@@VkLWxUL@bÝ@kKkVõV@bkXVVUVƒ@ƒVkUkV›LkV™a™@@™ƒ¯xUxmX@JVb°WXkK@Vm@k„Vb™bn¤‚xUXkJƒblxnXÆK²l‚_@Wnašn@ŽUL@b‚JnIlV„@lUœ@@¯ô@lWȂIVKVm„U@aXaV@lwVXn@@K@UVKUUnU‚bn@lWšX„ƒlJnUšLšKV@„„l@²a@UlK@aV@naVX„WV_nKlL@KUm@a°U°@VXL@a@wWmXal@„k„@VLn›V@@bl@VnX@mwVa²aVU@mk@"],encodeOffsets:[[114976,30201]]}},{type:"Feature",id:"4331",properties:{name:"湘西土家族苗族自治州",cp:[109.7864,28.6743],childNum:8},geometry:{type:"Polygon",coordinates:["@@@KšL@wnK±nƒnm‚—@WUk„ƒÜÈn@n»@mVamk„mšU„„l@V™nmmU@wUan¯VKšLn„VWlInyWUœI@WWk@KXU˜n@mnUmU@WœƒmkV@ƒkXašaVaUm‚Ikƒƒ@kaƒX@ƒUm@UKWU@UkJWkXa@IVy@UmIUVU@UJU@WXWmU@™VakaU@@Xm@Vm@wnwV@VL„yV@VakUUa@wUUVmlI@K„UVkUamJk@VU@UmVaƒan_@KmUƒ@@anm@ImWX_WWUk¯ƒ@k@Wƒ_m`@bULUKUnUWWXkKWaVmnU@@b¯UUbVŽ±K@UKUUVa¯UUmJUƒVIXmI@UU@WmVmkUV@b¯w@lmI@W@aƒ@m¯LXbmJVLklWL@V@XXŽmbVVU@@VU²Ul@VlX@bš`Xx›zUmkUVÒlŽ@bXLWxXVlš@V„bkLma@nmVmULVbmVUb@lnzmbUÒVl@°nLV„lJkn@bmJk_ƒVmmkblxÈx@LUb„xVb@V™n@JmLVŽUš@„nV@¦VbnJ@lVVbkx™bm@UxVLV@n`UnVVV„kl°z„xVb@VU@@ÆlXnWm¦nbVK@XVVUVVl@X„KUV@nVL@WnIWŽXLVKVLlxUbVKXVWbn@@UnKVLVb„JšU@aVU°b"],encodeOffsets:[[112354,30325]]}},{type:"Feature",id:"4304",properties:{name:"衡阳市",cp:[112.4121,26.7902],childNum:9},geometry:{type:"Polygon",coordinates:["@@lšV@XV@„mXVlXL„W‚X@l@bVxn@šŽšUVkn@VJ@I@alU„JXIVm@»‚LXllIXVVU@Kl@VnXKlb@lVbXIVVUšmVVU`@nbl@@lXLVVVKVbnXWJ@VXbWxXb„Ul™VK„¦nLVVUVVbšb„K@U˜LnK@Un@VxlUV`UnnL@VVL@JV@VUnxnKVbV@@VšIVUnJUVUl@nW„XllIUa„KVbÞLV¼²`V@VIUwlaVmXa@IWanK@U@m„kVƒVUVaX@lšnaVLÈ@‚¥@kkJUWJUaƒXkaUm‚wVXJ@_lWUU@¥n_‚KkamUK„™@amKƒnKƒbV£¯W@k„aWan@@UnwlJ@a@—@UUU@W‚wn@Va@km@UanaWa—UVƒUUVU@K@aƒKUI@wƒKUUVm¯LWUXƒ@mak@UK™LWbUKVUkUmVUKƒLkJ@nƒJ@I@mU_UK@VWkUJmUUL@WkI@V±VU°kzU@Wy@kUm@UWU@@nmKUnkJWIk`ƒIUlm™k@mUUkUb±yUX@VUV@bk@WlXL@nVlUl‚k@WI@ŽkLmš@VV@XVmnnVWbnVUblJXkVl‚XXlWXUJk@±™@nXVWVnL@xUVm@Vn@J—„WK@U™V™@UUVUVKUkkxULW`k¦m„@bkJm¦U@ƒmUX@`UImUU`ƒLVbUVUU@LUbmaU@mJU@U™UIƒKmxkLUl"],encodeOffsets:[[114222,27484]]}},{type:"Feature",id:"4306",properties:{name:"岳阳市",cp:[113.2361,29.1357],childNum:7},geometry:{type:"Polygon",coordinates:["@@@wUklmUUmU@@UVm@wUaV_mmUKmwkIkJmUUnm@™™@UUƒbUKUƒmÛamm¯xVLkbÇƃUƒVUzkVUlƒUUKWLX¦W@ƒVUUUaƒKUbmLKm„@akU@aƒmVaUUVIVWkk@wkƒƒ@@xmLlmÅwmbVlXlÝIWVkK@kkVƒL@VWKU@Ublnaƒƒm@b@bšnW`@XUJk@UUWKƒk@UKƒnn‚@xmLUVm@kbVbV„nV@V„b‚@KnV„LWšXŽÆVĢ¦VblŽš„n„UJWz@ƙVóUVbkV™aÅx@¦lVUbVVknWKƒ„k@ƒwƒK™VU„Å„ƒl@zkb@`m_mJ@xX„mbVbœ@llV@n„@llbXL˜UXalUšl„alVnwnLVKlšVbX@@I„V@blJ@bVL@VVVUXȤ‚VnkVÑXmlbnš‚„VKkÑř@UmaVç@±XUlI„xlV„@VaX¯lUVVUšVJn—V@°°nŽ°„Vxĸł°¦šb²¦lJ@U@aUK@kUm@_m±VIXal@„Kl@„bV@K„K@k„m@UmUUaƒK@_UJƒaXU˜@Xmš_VmUk@WUk›@kU@a@m@UƒaUUU@al@ny‚XXWWwkly@¯n@@bnV@k@mVI‚„œVlUUmlU„JUw„I‚bXƒVaUal@K„b@ƒVKVkXVl@VkUU@ylUœVVaVL"],encodeOffsets:[[116888,29526]]}},{type:"Feature",id:"4309",properties:{name:"益阳市",cp:[111.731,28.3832],childNum:5},geometry:{type:"Polygon",coordinates:["@@„ŽÆxXL@l‚V„@ĢšVI‚bXKl@nVV@„XVŽ„JlbXalX„W„LVKš„„UVLl@VV„@ôބ@@Wn@lLlK@wnIVJX@VX@lVVUL‚VnkVVnKValUXblKnXl`UbVLÈU@W@IšKV@@bUV@Lš@lƒXV‚@VXXblWnLVblb@JnL„VUn@llb@„ƒx@ÞUV@nU`VÔmlX„mbUKUVUV@LVVUn˜ŽUb@°UXš@U‚VzVxnlVškšVnlVnaWƒ@wnIn`@_la@y„kƃVƒšU„L„xl@„ƒXLlmUUVakU@¥ÆwšblUUaôVšU@ÅXyVImƒ™ƒkUaġ¥ÅUWX™ƒKmU@Lƒa@UmUUƒUalan@VUnK@wm„m‚L@V„lXLVVl@VI@WX_™m@a™¯mKUkwW¥UK@_UWWLUVkUWL@WUIkVƒU@JƒwkLUUmJVI@WkXm@VmkKUIU@mmm_@VUV™@™„kJċwUU@KUWkkW@IWW@km@klwkWVkkU™V¯m@kWLU`mIkmkXm@@`@L@xUKWkU@VL@JUU@mbUKVa¯WVnL@`lXUVkU@xW@UbUWVU@UJ@„lnU@m‚nÈmVƒa@bUL™wUb™@@VkxmUUƒ™UV›K@IƒUƒmk@akm@wmIƒŽkK@b™VWXkm@wULUmm@UVW@Ub„mbkKƒVn„U@Wl„xV„U@UXmWUXmlnbUl¯Lmn"],encodeOffsets:[[113378,28981]]}},{type:"Feature",id:"4301",properties:{name:"长沙市",cp:[113.0823,28.2568],childNum:5},geometry:{type:"Polygon",coordinates:["@@lVUllXkx@lln@‚XX@JlXXl‚V@LVVČxlIšƒš@VU@Un`nnV@VJlLUnn@lW@XUJnIVVlK„x@I„VlUVJ@XXKlVVUXKVX@`VLX¦lxVŽnLš°‚an@„„‚bkmVaV@XL@U„KlU@llLXUÞJWkUknaÆxnŽ‚knK@w„@l„@xllUXUJVVUb„n@blV@bnƒ‚LnKVa„LVbVV„UX@W¥XKVL„VVklUVy„U„VÈÅlaUK°wnnÜbn‚V„VL„aVVš@šn@VmnVlIlJna„@Valkn@na@amwm@„UXw˜K@aUUVUUaVa—wWK@kU@UaW@kKUUƒƒ@k™W¯XWan@k„™mmÅ@@I@U@KmLkaVUƒKkLWVUƒk@UVmU@am@kkk¥ƒUƒVUK™„maUb@ŽUb™I@aƒKkkWm@W¯K¯b@VmaULVxUXlVk@UxVJVbUb@xULƒ@ULWW—LƒĕmxVVL@šVb™KUwƒaŲWwX@@WƒUWLU@VbkV@aU@@VUnmJ@VUn@VƒLUK@U‚mUIk@UÇmU@@UW@J@LƒbUmVI@aUmW@@bkXUx@lmLUbm@UbkJ@V@XmlUbkKm@ma@kUaVU@aUK@mImJUIkVƒUƒVUakbWwka@UWKkLUamKUXm`Å_U˜ƒULmaU@@lUV@X"],encodeOffsets:[[114582,28694]]}},{type:"Feature",id:"4302",properties:{name:"株洲市",cp:[113.5327,27.0319],childNum:6},geometry:{type:"Polygon",coordinates:["@@X‚‚Unw„Ė˜KXXVK„@VK@wVaUaUIVwl@kUVWUwVKnb@U°a°LXŽ‚@Xnll„L@bšJVa@VanbšƒVL„U„V@al@@UV¯ÅÇ@Ummk™w@¯ƒyVwnUVVVUkmWV—nKVUƒa@WXkVKn@lUVU„VVVXIlV°VnI@VlKnV@mwVm@LXKWkU¥wWwƒƒ@k@m„X@KX¯V@VUVa@VnKWkœƒV@VUkm@aWa@wkUWwkmV£VÿXUVL@mVIXaò@nW@ašUš@@am™@aUU„UmXmWUk@ƒƒnUW@_maVm™wUkamaUL@aƒwƒW@akI@UƒxUm@kmKUk™lUŽ@b„zV˜m¯xUVU@ƒXVxm`kÈlxXVW„@¦kVUn@xƒxƒKUwÅKVXUJWnXŽmVUxWL„¦XŽm„mK—bmUUwW@UV@šk@ƒšVLnŽlbLm`@¦VVkX@`WIUŽxVnlb„WVbXIV‚lI@l¦Ç@UKmbk™W@UbUVU„ƒl@n@VmLXb@JWbUnkbVxUJUxWXXlWL@V@V@XXJWx„zUVVVVKnXW`@bkIUl‚„nLVJUbUIWVXlWV@XklVbnn@xlš"],encodeOffsets:[[115774,28587]]}},{type:"Feature",id:"4308",properties:{name:"张家界市",cp:[110.5115,29.328],childNum:3},geometry:{type:"Polygon",coordinates:["@@@InWVw°wš„@š@šblUœKlUlV„U„@VUUUlW@aöUlUlLÞ@@aVKXwlK@UX@@UlwkƒVkUm@m›@ÅVƒ@akwVaUk›UUlUL¯wƒƒ@UUmƒ@UkƒKƒlw±UULVn@l_XyWwÅ@VUUmJUXU@@mmƒU@kxW@UaUIWbU@@mU@UxƒnUbmKk„WJkUValƒ@aUkUxƒlW_@WUIU@ƒbkKWUJVnUb™bWb„lU@nl›„@XnVmV@n—mWV@LXl@X›JXVmzkJUXmƒ™KULm°Vb@xnVmnUšk@ƒƒ™VƒnnlUb@nm¼m@Ûǃ„Vl@X˜mnm„²ŽmL@x™K@LUl@nULÆx@V@VXVWbXX˜l„@nLlm@bVKœX‚W„L°bnUš@VaVUš@šmšVw„JnwVK°zn@V‚Vb„a„@Ċ¼"],encodeOffsets:[[113288,30471]]}},{type:"Feature",id:"4313",properties:{name:"娄底市",cp:[111.6431,27.7185],childNum:5},geometry:{type:"Polygon",coordinates:["@@lL„nJ@xln@bnlV„‚„@JœLVUšŽV„nVlw@Uš@VašxVK@a„bnUmÇnV@km@ƒ‚I@VUVVXVaX@@wlVVUkW@_mKXU°‚UbVLnaV@‚V@IUKV@XlVL@w@K@_n@lWlnnJV_XK@l°nšU@WVU@kV@nbVK„V—lƒ@nLlƒ„LXU@ƒlmkw@nW@UKVa¯IVn@@aVUUKl@nXVKVn²a˜ŽXblKnLlmVI@KUU@akLUaVa‚UXm@aƒ@wVUVKnLnWlXl‚n@@U@anUVm@U‚Inm@IUK@UmKVmU_kVUwm@@VmL—K@VƒL™aUaVUUUmKƒ¥ULkšƒVWaXwWa@UXImWUaULUUWKk@WnXbWŽVWnk@UV@bU@@bƒJ@bƒV@XkŽmb™UU`VbkaWzƒ@klU@ƒb@VƒwUL@bV@U`ULVL@VUK@Xm@XWWIUbUxm@@lkkÇwƒVÛÇW@¯Å™UJ@xƒI™xƒ@@VULmKUnUxmKULUUm@@‚ULƒU™JkIWJ@b@LJUW„kJWnUV@nn˜Ü_nJšxU@VbšnUxlškb@lš@"],encodeOffsets:[[113682,28699]]}},{type:"Feature",id:"4303",properties:{name:"湘潭市",cp:[112.5439,27.7075],childNum:4},geometry:{type:"Polygon",coordinates:["@@Æ`n_VWnLVblKXL@VlbXxlaVb„U„VlUVJnInJ‚@VL@bUVVb@lnbn@lLVank@W@UlIVan@VanK@kVwlW@aX@Vn@bUJVn„a@K‚IX@@VV@nŽVÈl@VJn@VVL„K@UVm@UnIVm@UV@@blUUaV@XK„V@XW@XxƱ„bVxšLUa@™UKWk™@wmmUalk@WXUWkXUVJVaUImKƒVklJ@aX_mWULUUVUƒyXwWI@W@U@UXKWkXWVwU@±_U»ÝKUaƒLVbkJkƒWmXk@UVVŽmIUV™J@UU@UamLmwUVU@mnJ@VUnmV@b@Vm@kkWmXmKULUV@x„Ž@bWnVUbVblK@bVV@LUJknmKkLWa—±bUmULmWk@VLUV@bm@U°JUbVLX@@mlxkn@„WVƒKk„mK@k„"],encodeOffsets:[[114683,28576]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/jiang_su_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3209",properties:{name:"盐城市",cp:[120.2234,33.5577],childNum:8},geometry:{type:"Polygon",coordinates:["@@„n@‚°ĀÞ°@¦ULWKkx@bkLWb@lUlVXXJVbƒnUKmxXV@bm@@Xš‚„LޚܦXlVnš‚mzVJ@n@‚²ÞôkƃÞaȰĉ‚wnljÜó„éVÛnĊīČlj‚ĉ@ō@KÞUlU@ƒkklÇÈњÑlġXɛ@UġƒƒaU@U_ƒW@n™@kaUL@VW@kKmkUV@bkbWW@bkzma@ƒJWI@KUKULƒ@U¦™`@XUJ™U@KmXƒw¯KXkmy@aUIWJXXmV@K¯UU@@bVL@¤VLXbV@@JVXVK@„„JVn@bkKmakVVXUVVVlI@`U@nzVVƒb@¤n@@UlKXLVVšI@V@nV@V‚@ÈUx@šóVōšƒkÅWó@mU@bk@Ýwk@WbXxm@@J@zV@kVƒbV‚nLWVUX™WUXUŽWLUŽ@Wl°z@VkxU@UVWIxWJkbƒĬ„nW@@bUl"],encodeOffsets:[[122344,34504]]}},{type:"Feature",id:"3203",properties:{name:"徐州市",cp:[117.5208,34.3268],childNum:7},geometry:{type:"Polygon",coordinates:["@@XKVX@WnIVx@K°Lnll@@I°K„nVašU°x²mlxš@VanU@aƒk@akmV@@w™@Ua@aUwVwUw@w›@UK@£kaĉlóIÇVkŽ±@@kUKmVkIkxW@Ua¯UUm@UVI@WVI„JV@ƒ@Um@Uana„U@m‚I@J@XV@XaVlkXƒVaUUWLUyVIXmWak@ƒXkJókƒJUL@KWkk@ULU@Wa™lUIkJmI™mk„VbVš@lV°kXUKWKULU„mb@VUlVnƒb@VV@IVKUUmU@ak@@bmV@xklƒUƒU@UKmV@nƒJVbkXƒKUamLUJ¯UUVmI™bVV—Ll`@LƒLU`m@kXUVU@V„lxUK@xkIWbUKƒx@V‚kVVn™b¯@@U™@ƒxk‚mbkLÇK™b™@@XnJ@LmVklƒ@@XƒlUƒVkxƒakVVb@bVnUbU@@x˜VUšVb@š„ŽnIĊ`šXVVôJš_„K@xlU²Klk„U„@VaVVÈm@kVUVmnamUUaVƒXIVJ„@‚ç@¥nkVLn›„@@XVK@VUX@JVUV@UnVJVLUJVLUVlšnI„b‚KnU@m°™VanI@anV‚KVL„an„lK„blš„KÞk@¦@¤@„VKnLVK„L„KVzlWšLX@VmV@VbnU°@Ualk™˜WXLVU„KWkUUWšƒ@£Wa"],encodeOffsets:[[121005,35213]]}},{type:"Feature",id:"3206",properties:{name:"南通市",cp:[121.1023,32.1625],childNum:7},geometry:{type:"Polygon",coordinates:["@@VJ@bnzWl°L„xnW@LšVVI@Wš_V¥„@VKVL@LXJ„I‚@nbly@aXXla@aVUnllLX@@UVKlbš@@m„XV`V@„bĢ„lkČÇƃȘ¯šwnĕVĉVÿšUƒUĠƒŦğlXÑVǵ@±ōLʵĖ¯lÇbÝÞ¯xk@Çkķé™n¯@ğŽġƴǫ@kVVlUbƒL@xULǂóLUl¤@nkVV°VLkxVb@l™aUXUKWĖklVX@¤UšƒUkb"],encodeOffsets:[[123087,33385]]}},{type:"Feature",id:"3208",properties:{name:"淮安市",cp:[118.927,33.4039],childNum:5},geometry:{type:"Polygon",coordinates:["@@šnźUôÒɴ胚l¦nĖV‚kbmš„X@xVlVL@xUb@bUJVnUx‚šœ„lKVLÈx‚m„zXV@lW@XV‚b@bȚVxnb‚ƒVIXa°L„aÆVVaXUlK@aXIƄVlXKVUlIXalK@alwXLVK@¥Ý¯¯ÿ@ƒmVk@aX@ƒm„īlaXI‚wXJVUV@lw@U¯yb›UaƒUġUÅaUKVknaġm@kUm@wÆIV±nLÆw„ÇnUUkƒ@ƅÝU¯JÝI¯¦Ul@bƒ@@VVL@l@LƒLÅmƒL@b™@UaVaUWmLUKV¹KƒLWKX¥WI@mXk@UmaUVUU@VmL@W™bkIUWƒUmVóIkbmm™@UbVLUxmJkU@bkJWbnXU`Wz™KUÞÈlVb™Lmx@„kè@Æ"],encodeOffsets:[[121062,33975]]}},{type:"Feature",id:"3205",properties:{name:"苏州市",cp:[120.6519,31.3989],childNum:6},geometry:{type:"Polygon",coordinates:["@@ôèĊVnX°¤²„lxƒÈÜ@²x@J@b@X‚`nIUƙUUV@bl@VVnL@L@xƒJ@X@blJXnW@@`XbW„kVƒ@UbVxƒXUxkV@LóxVbUVWš²šVJĸklUǬ@ĢƳĠ°@šmƒī°»ÈÇ¥ULUU±a@bU@¯ƒU@KnImUVWUk™mXUVU@lIVaUUVWKUbUkWKU¥n£WakJUkUL›K¯L™KkƒVIn@VaUƒVUUƒ›UkVk@ƒU@amUkJƒ@UUlwX¥W@@UkVmk@JUakL›@kk¯ÝmJUn@nmVXlmbVVkn@„UJ@±WUxV¯a¯KōbżÇxUxƒšUUlWL"],encodeOffsets:[[122794,31917]]}},{type:"Feature",id:"3213",properties:{name:"宿迁市",cp:[118.5535,33.7775],childNum:4},geometry:{type:"Polygon",coordinates:["@@XbWnUJVzXKVVUbW„klUWbU@@W@IJ@nƒVmbVbn@@V@„UŽƒIUJ@XUJ@VVn°VVbX@lwlJnUVL@l²@lÈUôJĊklb@¤VLœ@@xVxUxVx@bVbš@@xU@ln„mnX˜mXLVmV@X@lxVnVJôL„LXa‚x@b„@@KVL@bn@@m@™@alLUUVaU¥nIV±‚I@mXI@aWWXU@LlUXWW_XWmaUwǙ@aaWUX@@kWUƒynÇwUKkL›ƒ™VwUmVI@aVa@wUKUk@wƒWn™laUmĕk¥„™ɳçóÑŹV™mmzkVmm@a@Ióƒk@@LWU@`—„WbXLWlkImJVn@`nXVbXŽmL@Vn@‚l@nUVl°Xx°U@LVĠ@z°˜@¦UV@Xn@VJmV"],encodeOffsets:[[121005,34560]]}},{type:"Feature",id:"3207",properties:{name:"连云港市",cp:[119.1248,34.552],childNum:5},geometry:{type:"Polygon",coordinates:["@@@‚lzXxmÆV„„@@¦„@l`XnlKšXXm‚KnLla„b„@„xmbm@kL@V@Vl@@VUXšJX„mbš@@„°Æ@èÈzlW°XĢJlÈ`lInbšWV_@mš™@UUķnƒôw°ÆmnaVƒVÛVmĸ»Ģw±Ý@@mUIny™UmWkۥݙƒK™@Wn@@aWUnwVL„mUaWIUWVk@kkJUVWLUkŃWJ@bkLWVUbÅUƒb¯KWbUJ„WXX`WXkV@KWVXX@bWJ@nJU²mJV¦UbVVkK@b@š@nm@@aUK@Lƒ@@awWbƒKóKUIUmkwW@U@UnWK—nmWƒn@b„l@bmVUb™@kw±n¯w™VUb"],encodeOffsets:[[121253,35264]]}},{type:"Feature",id:"3210",properties:{name:"扬州市",cp:[119.4653,32.8162],childNum:5},geometry:{type:"Polygon",coordinates:["@@VUXblVVV„b@xV@kz„V@l‚wVLUbVV@VU@VbUbl‚b@nkĶ°IÞV@Ɔ„VlmVƒÈÅxmKU²ÅJ@xVn@lĢnmbUlVLÆbĢV„V‚bœV‚aXk‚@VXKVVWšXVWXUmKU„aWaU@™¥@£XW‚UUV@@ynam_VWkUVUna@ÆV@mnkWmXkWU„W@k„@@akklƒlWUI@UnKl¥™I@VVma@a@I@U@a@anK@UmK@ÅVUnJl™kI@aVwka@mVIUW@UWL@WÅbmIƒƒULka™UWƒUxkLUKWlXL@VƒImƒÅVƒU™mĉL™Uól¯I±l@ÒUbVbUVVXUJUnVV@lnbl@"],encodeOffsets:[[121928,33244]]}},{type:"Feature",id:"3201",properties:{name:"南京市",cp:[118.8062,31.9208],childNum:3},geometry:{type:"Polygon",coordinates:["@@k@ma@kUUVmVIUWVUUaVa@Ѳk°Jôk@Wmk¯KmX¯aUakKƒƒWU„@XU‚LXaV@@mUaVUUl@VmkaUXm@ƒWUUna°IlmV™m™IUW‚@Uk@@aV@VVX@„V‚I°»nm„U@VKVan@m»UaU@U_@WlIUa™aVaUala@¯n@‚ƒkaUkUUWKU@mwkUUmmL@K@ƒLmUUVƒKƒVÅImU—JƒƒVkVVLšèVLVU@W„L„V„š@nVÜULVŽUL@bW@XbWbkJƒUUVUxVXmVk@WUUkVmIƒV@„nbnVWbƒJU„kUULƒa@Jma@XkK@VVL@L@JƒLUVU@V¼ƒnXlƒbm@kbUKmn@lVb@VXXV‚UV@b@LVbÆxXbl@@lV@U„VV@XVK²VlIš`„UbVbUlVVn@WXn@@VUV@„@KmbVLXқLkKƒV@nX@VVUV@b™nVllbšmnb„IWVXU@`lLlknVnmlLlbUmVInK°nUƒU@l@VU@Vn@„ƒ@alI„`VIXaVaVa"],encodeOffsets:[[121928,33244]]}},{type:"Feature",id:"3212",properties:{name:"泰州市",cp:[120.0586,32.5525],childNum:5},geometry:{type:"Polygon",coordinates:["@@lUU@@y@In@WwXal@Þxl@@anVô@ÆX„lŎ™ôU@™Vw@ÇUU@@m@U™JUUWKkL@Vm@@£„aUUmyV@@_kJUUVUUWlUnblL@aUmƒI@ƒULUW@IU@WaUK@£UK@aV@°V@LnUWWXIla„VV™@£UWlkXĕVLVWšb@kUalwUKU¯lU@mk£VôKȁVK@w„KVaUkķlUI±™ğ¥ÝUŹš™Ž¯ôm¦ƒĸ™‚@XXK@VVXUJ@nlbUx@blJkšmIUV@ÆnL@VmL@b@b@V@J@bnb‚U@UšJk¦mL@VVJkXk„ll@bƒ@@lƒXXVWlXnml@nÅU@ŽmbUVlVUXn`mb@zU@V‚VWX@¤š¦V@Xb"],encodeOffsets:[[122592,34015]]}},{type:"Feature",id:"3202",properties:{name:"无锡市",cp:[120.3442,31.5527],childNum:3},geometry:{type:"Polygon",coordinates:["@@nLƒÒlxUVkL™am@™ƒkVWUULUxVVVbUV@bVLU‚nnź™ÞVĠ¦X™VUUaôw@KlUVw„WUwVa„@lUXƒWa@_X@WmkI@a@W„I@w@KmKUUk@@aVUšVVÅmJ_@W@a@I±wÛ@ƑÇkw±ƒ¯£mWĉUóçƒK¯VkUWK@XkV¯UWabƒmUa™UUb™lln@b@xƒbXŽWX`@„VxUblL@bn@Vb@`m@XbWnn@l¤„n@xnVlU„™VLÆWœkV@VbÞJ‚_nƒl@nKVU@aU™U@mVk°WVLUV¯bVXŽ˜bXlVn@VmL@x—V@bl„š‚@œnW@X@VVJ@²VJVU"],encodeOffsets:[[123064,32513]]}},{type:"Feature",id:"3204",properties:{name:"常州市",cp:[119.4543,31.5582],childNum:3},geometry:{type:"Polygon",coordinates:["@@„L˜ŽnxUbVVƒL@xnnW‚nn@VVXn@‚yœImx„„°ƒšL„a‚¥n@VkšKVw„W@nX„VJ@b‚@UVn„ƒ@UnUV@L‚b@`VLklVÞn„Æ@VaXLl™ÈJšmmVUK@aVUUaUUVwVKXVlUš„n@šblKVUkw„ÑmKUVUI@±UI@U@WmX@›™kƒ@a˜U@wnK@UUmWk—aWU°aVUUK¯XUl@nVŽVš@bUVmLk@m„`ÝIUaU@›lÅXUKƒškVmU@wƒmk£m@XmWan@@_Uam@@akKVaUw@ƒW_XW„a@w@akmm@mL@UJmnUKƒ@@XnJWLkKUb@„Vxk„WƒL—aWVUImVULUK@L@lkLVVVllb„m@@°kbVbUbšbVbkJ@XV`V@Vbn¼"],encodeOffsets:[[122097,32389]]}},{type:"Feature",id:"3211",properties:{name:"镇江市",cp:[119.4763,31.9702],childNum:4},geometry:{type:"Polygon",coordinates:["@@šVĊKšn„VÆUn„„J@UWKXkVLlKVwX„šVlbVK„„nJÆaš„ķn¥°óÇIkšWKUbÅ@mƒUÝlkUK@_a@KVUVm„@mƒVU@@aUIWƒ@mƒXUx™LUlm@¦ƒb™K¯„ƒƒnw›Jzm@UW@UmmXmm@w„KUUVamw—ƒKm@UbUL@ŽƒVmn¯¼JƒUW@UUU@@bl@@VŽVXšJšnnU‚‚k¯JmbVV„Xn@VWlbUnk@VVUŽVb@nU@WbKWVƒ@XV„„lLVb°bnW°Lnl@X"],encodeOffsets:[[122097,32997]]}}],UTF8Encoding:!0} +}),n("echarts/util/mapData/geoJson/jiang_xi_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3607",properties:{name:"赣州市",cp:[115.2795,25.8124],childNum:18},geometry:{type:"Polygon",coordinates:["@@„`l@Èbln„@„KVLl@„V@bȎlnšKXkVlVL@„lJnb„¦VKVVnX„W@w°@VU„mln„UV`šU„bVUV@„xnKVI°KXKVkVL@al@Xa„LVlULWV™VVL@b„x@VXVmb@x@V™VV@nn¤„šlb°b°KXXWbX`lbXx‚z@x„`VIVUnK„L‚x„WXLVKVbVLVU@wnW°b„@nalX„‚mXVJn@U²mKkVl„U@@xlnœaVmlKnœ@JVLlŽnVššl@XXÆèVlUX@xVLXVšb°W@wnUWmXk@K‚LVwUmUkUKUw@wVaVK@kƒ@WnkUKWkwlmXL@KVUlLVKXmWU„L@ašL@malaVk@aa‚ašƒnXš@VVUblb„Jn˜ƒXa„V‚wn£„K@UWmUk@ƒUaWIV@b™JW@KmmU@aUUUkmKkVKlUU™nKVU„lVaV£Å¥WUUK@UkUUw@m@mIkƒƒUUWƒLƒK¯Uw°¯@wUKUbƒKmƒ@kkKUL@UUKV¥U@manw@k@U@Wm@@U@Wwkm„wWaUU@UUmV¯kwƒ@@kmƒkKkUW@UK@ÅV@XWWkXa@Ul@Va@KVaUUU@ƒaXwla@UkVWaXk@K@lmkUmV@Vmbk@ƒ»XIƒ¥VUkƒVUVU@anKVUƒKUalU@wX@˜™@a@K—@ÝwƒL@ŽUnÇlUIkJmn@ŽƒbVVb@VmnkLƒV¯U@ƒ±l—IWmƒ@kaUI@aÇU@K@KUIkbWbƒJUIUyƒX¯ƒUbU@méUUmUk„WK—xWIkJm@V¥U_UJUwmVkšƒUU@ƒƒƒ@knƒwm@UmkWJkL@n@VW@@‚U@knm@kUml@xÅxƒ@@XUJlb„@VX„JVxn@lbV„@lULnV@VlnV@bWV@bXL@lVLVb„V@blLn@Vl„K@xln@bX@lašLVbnKUVVb„KlXVVkxƒV@nnVUb‚lV@@z—°WWkbƒIk‚WL@LUJ@bUI@b™`@UmI@mkK¯XW™™mUV¯@UUVUUam@@VULWUJƒIm`IUJ›KUkW@Uxn‚WbnnmlXbmIUVmV@Vnb@V™LUKWLnÒVVV@V„UL@„kJUV@bƒÈ@ŽšV°šŽ@XVV@l@xUz"],encodeOffsets:[[116753,26596]]}},{type:"Feature",id:"3608",properties:{name:"吉安市",cp:[114.884,26.9659],childNum:12},geometry:{type:"Polygon",coordinates:["@@lxnb@V@bV@ln@‚n„‚lInš@blVXK‚nk¼@VUKWL@b™L@`UXU`ƒ@V¦XLĠ@lJ„¦@„nV@l°nn@‚mVXnaš@nb‚K„n@l„IVƒš@VanJ@_lKVVnš„L@L‚K@Vn@VbšUVanKlLnbnJVbšnWVnVVanI@‚Vb@L„bVKVanXVbVJVU@aXLll„bôlƼXxVLVK@Xn@ƒxnVVVmb@LnVVKVXV@@mnaVXUVnV˜K@_UaUmšwnKV_‚anKVLš»„K@¯ÝU@›™U@kWlUn™lknK‚VnaUkma@ƒUIUwl»Åw@ƒVwV@n™‚n@ÈXlKVmna@kVw@anm‚@n_WWk@™™mUkUK@Im›kLUn›bkm@wV@kƒlUnLV±m@UInWƒkWmbƒ@¯amX@xUVUKUaULWKƒXwƒKmLUVUJƒ_@wyWwkaW_XaWW¯L¯akaƒ™m£@mUUš@U@wnaWU@Uƒw@aUKšUXUVKUkƒKWbk@@bUKUlWL¯LUJmLƒwU@UVƒa™VU_ƒVkmƒnUV¯@@xƒXmWUUULƒ¥makI@ƒUKUkWl™LkmǍ@aƒUk@UKƒLƒ@kmÇak@ƒ_VlkL@`lbnšlLVanLnbmVÆln@škJlbknmKUbÝmmwULUK@bkLWKULUUma@Kk@UV@L@llbVzšxUxnl@bVLmŽšŽ@IVJXœVlƒLV`@bn²@J™@™V@Xmbñ@WbUJ@bm@@LUĬU‚„¦lV@xXb@blnUV"],encodeOffsets:[[116652,27608]]}},{type:"Feature",id:"3611",properties:{name:"上饶市",cp:[117.8613,28.7292],childNum:12},geometry:{type:"Polygon",coordinates:["@@„„@„V‚š„„I°`nm¤²@bVJUVVXUl@Vmb@xV@XbmVVœ@lkLmbn`VbnU‚@Va„UnbVllUXV„a@w°VW@_VWšLššnVlbšLVbnl„KšnVK@IUW@_@am@™‚ÑUólK@U@WU@VwU@UI@aUU‚aXƒƒ@kwmJV@yX@k‚anƒƒ@mkwVmmI@aUU@aUUW@kVkV@@anKš»„XVWnIVUl`@_„W@wlUœV@UWKnU‚bnŽ°InJl„UV@VnI‚b„Wn@VklL@l@Vn²m@U`kI@bWJƒnV@°VXnJm„XVmx@VVL@bkLmWULUmU@ƒbWXb@llnX@‚xkxVV„nVV@¤nL‚nVxnJVXX@˜ššbn`VI„b„@„blmlLnaV@„blWXnlUnbl@„ƒšKVanUVmm_XK@kWWnašU@UnaWUXa›ƒXamUkKmXUWƒLX¯WakKm™nUWwXa@KW_„aXWW_@WnIVl@XU‚LnWVknK@ImyUUÆbXK„Û@W@IÆUnƒVÝlkVK@mUIVwkUVaUm@aVIVyXIƒaÈwmmk@UnanVUmÅaó»lwšW@kkUVmUK@WKLƒUmWULkamK™Lk@Wa@wk@UU@U@mbUIWVKUXWmkUmVm›U@LkakKƒw@w@U™¯ƒ‚ƒUUn¯l@bmn@xkJWxkL@VkI@mƒkmJUI@V@b@VVxnbWlkÈkVƒLƒbkKmVƒL@V@²nxW‚kLUL@xlKVx„bXmVnšWJ@ޙ°@n™xUKUw±`UImVmnU@kalm@akwƒU@UUJmxU@@Uƒ@kU@Um@@Kn™ƒVm@k™KmkU@@WUnkLWxkVUwmKmLkU™bmKUbVŽ@xUnkJ@n±ŽšUxVXUšWJ@LUb™lUnm@ƒW@nknUJUVm@kXllknVbÆK„VVbš¼V„@šUl"],encodeOffsets:[[119194,29751]]}},{type:"Feature",id:"3604",properties:{name:"九江市",cp:[115.4224,29.3774],childNum:12},geometry:{type:"Polygon",coordinates:["@@WUkVUkmaƒVUb@mVUam_nalK@kU›nUWaU@@wna@UVkUWVUUI@a‚±n£m¯_ƒJ™ƒU@ƒƒƒĉ¦Ul@UV™Km™mLlm@ğ¹m`Uk¯@@UVK¯™@UUK@amkmKkVVUa@UkUƒKƒŽUa™L@VVXUJ™@ƒnƒ@™š™WUbƒnVb¯V@LÅlÝIƒJÅkݙm@Ua™WUU@UmUXmmwVUUKWUX±mUam@kWƒzUaVmÇw@aÅLmKXƒ‚UWKkL@W¯IƒwVw™lkUƒJ@Um@ÛÈWŽKUxWkƒaUU@KkLVl@„UKUX±KUb@nVVUbUVmaUlUL@„ƒaUL@‚@nUlWzX`@„V@lx²„@Vlb@bšVÞ@°nl@UxVL@lUbVV@n²xVUVmnUÞb‚a„J@IšV°xnbl@nbÆ@VwnK@VnXlK°xnUlVX„V@Vl@L@lk@W_XK@KƒkWxUL@J„nVx@aX@VVUa˜IXlmL@bVVX@VbnK‚a²XVWƒk°a„@UnV¤nbmLmW@XbmJUbVL„aÞK„L@K@U@aVKlbV@nXlJœxV@VnšŽVȚ„ÞKôbźĕČmV@ĊšŽ²xÆIšV@Þ¦ĸ¼ÞVlŽVÞnxln°Jœk‚LXWVUVUVwnJVI@yn@lXlaXmWI@w—»ma@UmK@akKkXmW@_kaWakKWk@@K@IšWƒkUa„ƒ"],encodeOffsets:[[119487,30319]]}},{type:"Feature",id:"3610",properties:{name:"抚州市",cp:[116.4441,27.4933],childNum:11},geometry:{type:"Polygon",coordinates:["@@°V°UnÜ@n@lnLlV@bšV°L„lnLllVzVVXlV„V@@L@xX@WlX„m@UVƒL@V@n„°škVmVUnKlaXxVbšnlU@lVVnaVI@aX@V„šJš@V„@b„b@šVbš‚@X@lUL@Ž@VlIVm@wUVanLšalVnKnLVxlUXwlKVm@k@Una@mWIXKWUÛVƒk@a@UVWn@@kl@@W„XlW@_Um@UVK@a„LnalInWV@@xnI@¥‚K„—šm@kKmƒnk@mlI„¤laXbVblknV@U‚KXVlUXa‚@@Unw@±mU@ak_±a@ƒUJUIƒVKW_Xa@aWU™šK@mmUVa@IXa@UWmšannlmX¯WKXwVUVwƒ@XUlK@klJXa@kƒkmm@Uwƒw@¯ƒW¯kw@WmbULƒaUUU@mVUU™WmkUb™KmkkK@aƒkUƒ¯¥Uƒl—ƒm@akU@mš@KVIVV@KUkUVUkaƒUWb—„mƒIkaVaUU™@mW™„b‚b@bUlkb‚b@n™K@bƒKXVWnULkKUV@LWKknlxXŽVLml@X„Ž@lULUb@xVxVLVlVnUxK@LWlXnmV@x¯X™aWUUK@wVWUkÅçm`@mn@bUx@lmbUnkLÇWm@mšU@Ux@„Æxk¼VxVJ@„nbVlmbUmLklmškVlX@‚VœšV@°Þ"],encodeOffsets:[[118508,28396]]}},{type:"Feature",id:"3609",properties:{name:"宜春市",cp:[115.0159,28.3228],childNum:10},geometry:{type:"Polygon",coordinates:["@@@VlbnK@b@JšLlUnx±ĀXxÆW„X@lš@V„@@blJ@nX@˜xUbVVUbVV@b—VmnmJœ„@bmbm@klUbƒLmbœš@lVb@xUX@bVVVbV¤@LVV„bXlVw‚LXÜÇn@@V„IlVškUx„x°J@XlKXLV„‚WnLÆK@bÈxUnVb„ylXn@Vbn‚W²XV‚LVVUŽnxWnnV@VVVšXVbn@ޚÆl„IÞJÆk@K°UUa„mVa@UUUš»@wV@VƒkkUKUVW£U@UmW@@aXkVUnVlKVV„UUkVmU™@kWaUanU„VVamIX¥W@@aUaUVW@_mW@UnIVVn@VbVm@bVL@anKVUkƒWK„UXV‚Ikx‚@na„bVK„b@nVJ„_V›@Vw„‚VUVVXUlUUaV@X@VblašbnKlkVaXaƒ¯@m@U„KVUn@WƒXkW@@w@KU@UƒWkUUUykkmKƒk¯K™U@akUmK@k@mmÛ¯V¯U@‚ƒL™¼UKmLbU`mL™xVnVb@`—LmUVUUWmb@nU@UWULmU@KnaUUmU„wmJ¯IUJWIkVkaWVUIUlWaUIUVkKmbUIƒÒlVUnnŽ@VlLUJ@bUX¯@ƒaWVUKUXƒKUbm@UwKWa@a@VkUWn™@Uak@mbX„WJXbm@mL—aWVk@™wƒL@WmanU@knwWmkaWL—KWUXaƒU@¥l„UVVVbnwƒ¥nKV™»@aUk@a@UƒJ@kƒmLma™@mbUWnm@ULǺ@LXnmxUŽm@UbkbW@@akLmWk@UXmJmUkV@VUXVlULmKUxkL@lmXnJ@X‚l°Vnb@bU@WbKUX@VmKUX"],encodeOffsets:[[116652,28666]]}},{type:"Feature",id:"3601",properties:{name:"南昌市",cp:[116.0046,28.6633],childNum:6},geometry:{type:"Polygon",coordinates:["@@šXš™„@„mš@VIUW@UšKVb„„LlV@VVbUŽlUnLnl@bVL@V°šUL@V°@Vln_Ġºn@‚knKnššLVU@VkĊ¥Vk@™Uƒ™»UaƒUÅLUalmkklWn@VUVIlm@m„Xn@VmškVa@KXIV™UWVw‚™²@m@U@VK@k@W™Ua@™ƒa@aUƒ™@™IUƒW@@bUJmbUU@kkV™mUaWwkbmLUVUn™lWbUbklmL™akbUaW@U@VbkVWVUUUVƒUx@‚Uœƒ`UI@mƒaULƒamb@lwJWUƒVXLl„UVmL@bUK@aUnUam@UUmJ@VnX@`UXVŽVb@bX@W¦nJUbƒUmVVbXb@lVšUnVlƒVUUkLmUUVWl@bX@VnV@X¤VUVLllU„U@@x™¼VV@V"],encodeOffsets:[[118249,29700]]}},{type:"Feature",id:"3602",properties:{name:"景德镇市",cp:[117.334,29.3225],childNum:3},geometry:{type:"Polygon",coordinates:["@@VVX@Vbmz„xUlU@mbmL@V²xVbUVVblbX@šVškVykValKVI@bn@n`lVWnX@l„L@™WKnƒVIVa@¯nK@alIXJVIVWUw‚ƒn@nU˜„nK@alI@a@anKm_™a—™W@UWmIUwmmK@£UUƒmUUlwwW@km@kWaX„aV@VnVKnXlK@aUK@UnwWUnƒmIUW@¯mU„XI@alJV_n@m±@U@kkKUlm@ƒXamJ@UVUkƒmI¯JmamVXL@V›UkV@xƒX@`k_UVmJUXƒW™¼mL@bU@UllX@VV@bVV@bnJUnlx@n„Žm„b@lWŽ@zU‚nIlx„@W„bVV@bVJV@UxV@@X@VkLVôÒ‚šn@@b@`VX@J"],encodeOffsets:[[119903,30409]]}},{type:"Feature",id:"3603",properties:{name:"萍乡市",cp:[113.9282,27.4823],childNum:4},geometry:{type:"Polygon",coordinates:["@@VWnL@UVW‚LXaV@@ama¯Uk@WmInW@klKVwnLVKUkVW@UlUnVnIVWl@nXlK@bX@laVan@VnwWm@KȹVK¯m@kmU@ƒƒ¥kIğ@WKU¥„@V_VW@_šK@aXKVL@Ul»mWLkU@am™kJƒm@kmU@@a@UmakwU@›„Xlƒ@VXk`UIW¼kWWX@‚œ@l‚xV¦XlW@Ubn„@ŽmUkL@UmJ¯UkUWVUaƒUlm@UXWl„nUJ@LmLU˜nXll@bUVUUmVUn„Ž@¦šxlŽnn@VÆÈU°kbV„VxllnL@VnVVUl@V„„anL"],encodeOffsets:[[116652,28666]]}},{type:"Feature",id:"3606",properties:{name:"鹰潭市",cp:[117.0813,28.2349],childNum:3},geometry:{type:"Polygon",coordinates:["@@@XV@nlšL@lUnš„mŽ@Ln@@VlV„@@VV@nwVI@V„Vlx@bknlbV@nmnUVJ‚_²‚VxVLšw@mš¯@ÝXIm™nUWƒaUwkL@wVKlKXmw@±@U„KnUlL„a„KlUlÇXkmaUw@U@a@Uƒ™UkwUJ@zWJ™w@WbkVWUL@VmUklUaWakbƒ£kJ@nmln„lL@Ž™nƒ˜L@¦mJ@wU@mXkJmbƒK@bUL@VVn@`kXƒW@Xk@@lm@UX@V@b„lÜUXVWLXJ@nmb@V@l"],encodeOffsets:[[119599,29025]]}},{type:"Feature",id:"3605",properties:{name:"新余市",cp:[114.95,27.8174],childNum:2},geometry:{type:"Polygon",coordinates:["@@m@@WULUKWwÅ»ókƒakkWK@bUVUIUamWUbULƒa@KUa@mJUbmUXU™mUamImakKmLUb™VUam@@UL@KƒKm™UUkL@`mIUb™@U„@V@bVl@bš¼UŽmL„¦mxUaUUƒVkŽ@¦„VWbXV˜LXKlbXnmx@lmVnb@X„Kšxl@XU˜bnKn@WaXIWƒnal@Vbš@XmlV@U@bXb‚LVxn@Va„LVWVLXU„b°@VW@aVIkK@UmVmkU„ÑVJnalLVUVJXbVkVJXUlblUXJVI°JnI"],encodeOffsets:[[118182,28542]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/ji_lin_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"2224",properties:{name:"延边朝鲜族自治州",cp:[129.397,43.2587],childNum:8},geometry:{type:"Polygon",coordinates:["@@Wxĵ„mš@„ó¤VX@@xܼƨš²xWxƒV„V@„XVƒ„„„ƒbWšXllaÞU°Ċ„@ô¼„LôÝWanV¥ƒÑnĉ°¥šÅX¥°¯@w°w@»°k£°mÈŹ‚mÈbƃŎ¦„K°z@Žkxl¦UbU¤šššklV„KŤÞȰ@@bšV@nVVUlÞ¦lUllœVlU°ÑU¯Vƒ°w„bXxl@VŽ²„˜@n„ô¼ƒó°™kmVk²ĕ‚w@wV™ÞÞ@@Ġƒö»˜¯œ@‚„šbnb°mÞ¯°V°„ÈJmX¥mam™UřƒUƒlaU¯™ƒ@w™Kk—l±n@@wƒkÝVUUl±¯I¯b™a™lƒ@™kLmakbƒ@ġƒŹé°™Þb°šékƒƒLm™„wX™‚aÅb@bVlƒbVb—ÒVbUb›UUanwƒakbVŽUV›ak„¯„UŽƒLmxV°UxnôŻX@J„Xkl‚bkbĉaƒbƒWU„ƒ@ƒk„WUU¯@@klmƒ@@™Å@aƒwWXlKkI@WbUaVIUanUƒƒ@ĕƒ¯K™„mUnWUwm@£ċèkUmbUmm@@nkJUalwk@@nmWUan_óaWmnw±KœIƒwl@UmƒI@an@@mlUÅmV_™KUkƒ@U`@_ƒKUmU™@U¯™mmb¯@kb™ImV¯ƒƒLkbƒKƒƒÛ@ÇnɱJóaÝĢkb@„›x—ÒÇllœ@‚Ž²V‚„ÆUVV„UÇ°X„óxlV¯„lV@bƒV@n—x›@—¤@„șŎnxV¼knšJ‚nšKX°˜¦UlnVbUbÆVnÞWVX¦llšb@l°œVJôÒnLVbšbXŽ"],encodeOffsets:[[131086,44798]]}},{type:"Feature",id:"2202",properties:{name:"吉林市",cp:[126.8372,43.6047],childNum:6},geometry:{type:"Polygon",coordinates:["@@ôl‚zšaÈV°„šK@„mŽ—LWl™nšVxUV‚È@ŽÝĬUÈn‚ôLša‚„²VmĀkV@„ĠĊnU@b„V@b˜@nl°UVnÞaôJ@bš™V„¦mlkššbmVXx¯@Vxm„nbƒ„šbÈK‚V@bÈL„wĠyônšmnbÜ@nn„V˜x@n²K‚„„J@k„al@nxÞU„Lź±Vwkw¯LWWUš™kŎīVwƒw„°y„Vĕ°wÈVlkÛ»@wW@Uô£@ƒn™ĶƒXwW™aUamKóÑUI¯›@k™akkW¥XUmÝÅUVaUa‚mVk—¥W¯™Lm™IlmU»mwȚō@ƒ˜£kJUÇk@am¯y¯UVwƒa@wġx¦ƒKƒƒ¯X°Ċ¯¦U°ċWULÅa±b¯@UkÅWmVƒ™ƒkIUlóŽċ¹™`óIƒlX„WŽXxmbUƒLݏƒbƧ@ƒx¯bƒÈ—l@xƒš¯zƒaݤ@nšm„VWb²bmn¯J¯Ò@n„š"],encodeOffsets:[[128701,44303]]}},{type:"Feature",id:"2208",properties:{name:"白城市",cp:[123.0029,45.2637],childNum:5},geometry:{type:"Polygon",coordinates:["@@ó™ǩŁ@WlwUaƑwÛÅÇéĉamKƒōÇ@Iƒ™ôġVƒȁÑŹçƒ™ÝUƧċĉwóóÝ@Ƒ»ğL¯ll²@ƆÅV@¦m‚Åb@nmlU²VxšlUn™@VbnW„bÇbk҃š„n@èlnlšU҄Ž°Lšx@¼ĉb@҄šUŽċxՃènLVxƒÒƒbÅJ±a@_ÅJÅnƒŽVb„Kl„nUÜĊ@„Uš™xXVÆn„mšVššJÞ¯V™ĠwšƒXw°xWL„x„KV¦ôU„wVÝǬóÞޙ¼‚‚„ÞkŽVôȘxބU„lVn¦ÞšĊa°w„b°@šbÆw„lŤL²`„z°@V@@™nJVnl@@¥nUmmn„@mwnmmUnk@mlwUaƒLnƒ›wn¯°anƒWakI„ƒÇmXwÆamUXUlJXa‚UUklKUknmÞV@‚K@VWÞ@VkUwVƒ"],encodeOffsets:[[127350,46553]]}},{type:"Feature",id:"2207",properties:{name:"松原市",cp:[124.0906,44.7198],childNum:5},geometry:{type:"Polygon",coordinates:["@@„šźèȂÒU„óĢ„š@JŎȄ‚‚LnŽĊbÈêÜƃxVbkx@XǪłôš„kÞ`„šW„b@n°ašbšKšnVw°`š_X`W„š¦„ĊIkmVšakw‚K„x°UÞb„U@lšƒl@°¦œVW„šaÞbšxÞI@mVI@ƒVkŚUWK„¥nL‚a@ƒ„@ȍ„@°ƒÆ@nU@KÞalkUwVékUWw„™kU›VkkƒJk¯@»ókƒV¯ÆÇI@bĉô¯@™ķw¯nmmÅL¯wƒVƒUÞy@UówÇLkmm@@UóxkkĉmL¯wVwkWWX™mLõm@kűV_ƒƒô»ÛƒÆ¯@™Va™VšaĠVlmğwķUóÝƽ£ÇJkbǫaƽLW@nxݤkzƒy¯XɅm@VšôÇX¯Ė¯ºÝnUŽnLVlUÔmV"],encodeOffsets:[[126068,45580]]}},{type:"Feature",id:"2201",properties:{name:"长春市",cp:[125.8154,44.2584],childNum:5},geometry:{type:"Polygon",coordinates:["@@„U°xÆKnn°mĸxš°@Ċó@aÈJ°Å„Uôl@¼l°„IllœUlVƒšXxlVUêVxkllnÈUVll@Vx²IÞ¤VUlVnIôlރlwô_„›„bVaĶLXÅÞÇ@K˜¯@wÛaƒçn¥š¯WXyW¯XwƒUmmÛ@ma™nómğzƒxÇK@aUÇL™a„ƒmanƒUw°@WwnU™al™nkƒ¥šU™@aóIÝbUm¯Vmk—@@aƒU@amVğĉ@ƒlUnÿ±Uƒ™bóKmVÇÞī@ÇVUUw‚™šmXk˜Kn@ƒ™L¯ƒÇU™byókōè@b‚n@lÝX@x¯ô@ƙUV_maXm@aóƒJWxnX@ŽVVnĖVnUJ@nōÆǼV¼kxƒLklÝw@xƒx@zV`ÅbmxU±xU„nnm‚kn‚ŽğU™bUŽ‚šUb@šÅ°Ü„󼄄U`Ʋ@lön‚KšnXWlXUx°xnKĊllôw@Vn@lnÈKôx@VÝz„V"],encodeOffsets:[[128262,45940]]}},{type:"Feature",id:"2206",properties:{name:"白山市",cp:[127.2217,42.0941],childNum:5},geometry:{type:"Polygon",coordinates:["@@Ušl¦kÒÆ°„IlÒU¤ôz„¼lJš„U„n‚ÆXVl°@²aÆbVKČXV¯°¥¯ĉ°W„„„L‚¥Ģw@x„bUx°V°zn‚‚b@ÈlVŽlIœ@˜w@m„U@akU°ƒkUôwWƒÈ¯VUƒVUƒÅ±U›@kÈk˜Ñœw@ƒlaÞġƒUÞ£@ƅ‚KnÑĢ¯@W‚aUaVUVkkw@a¯@¯™Ý™ƒVXnW@@WkXmK@xkKUb@bW@Uw¯„mmb@WKUbmUbUaWbƒJĉIVW@I—l±LkšmU™bUm™@ƒnkKWa¯n™@„`Ubma™„ĉL@bƚ—@W`ƒL@n¯‚Xb‚@kb@x™Lƒ„™@V‚kL±™™mlUIU¥mL@lÅx@_laƒƒ@U—aƒV@kmmƒK„£ƒƒLƒƒmKUnÅKVbmXVlèĉUUbml„ĢŤƒIlŽ¯bǦœl‚@ô¼Ģ„@x°„l¤„n„a„l@x™b"],encodeOffsets:[[129567,43262]]}},{type:"Feature",id:"2205",properties:{name:"通化市",cp:[125.9583,41.8579],childNum:7},geometry:{type:"Polygon",coordinates:["@@ÆlXnĠxĢ°lÈ°š„K„°kXm‚@¦Vbk„ŤJšnݤk„VÞVVkȄb°y„™@w˜k„Ç°a„wƨ@„aސ„K‚VnaWwXWƒ„kôJš_ČºôVkƒ»óyV£kуJůlÑk¥V™ša@wƒkƒbƒmk£¯ƒ@wġƒó»@›kÈ¥°ak„JÆ£ƒġnkVaĊVkçWUnUaÆLVmnL„„‚KU™±@—„m@a¯U„bmV¯m@_ƒK™™U™ƒaƒÅ™Wó¹ƒ@UanmWak@@wmI@y™@mk„JVa™@UaƒIkJ@n™@Um±kkxƒm™Ik„ƒbÇm@Ž°bXn„V@Ž°ÈmlÞ¼¯XVº¯Lm„kWWXLmVVlknƒ@@lnWƙ„Vxbmšnšm„¯lÝaVȁè@¼V„„b™„ÆŽ°ÞUVšJ„„kx›I—xƒƒƒIV¤™ÒXxmn"],encodeOffsets:[[128273,43330]]}},{type:"Feature",id:"2203",properties:{name:"四平市",cp:[124.541,43.4894],childNum:5},geometry:{type:"Polygon",coordinates:["@@Ɇn°W„zlyÞ£mwX@ƾKǬblaÈIƾ¤ôÞĸVĠxnmmVƒ²w‚VnwÆaU_@y„w@wÞxlk„KlwU»È»ŎÅ@mVIUmmĕUU@mWXw„Iô‚@bWnnbU`‚šV@Å°ó@wÞW@km@aŎ烙@m°Ñ°Inm±aXaƒU™n@mƑšU¦@šÇŽ¯aU£šaU™ġ¦ÅҙJōUŻókUÇ@™¥¯ak¯mUVak@@aċçÅaUƒm¦Ý`XbƄ@n`ƒI™xĊÞōÞml@šUb@Wl™_¯JkšÇUÝÆÅb@n™„llUb¯„±a@ƒ—ƒWĉJġĀ¯™Unóšm¤œxôaVnƒxôI@x„V@bmƙ„@lnLmޯޙxVb¯þ"],encodeOffsets:[[126293,45124]]}},{type:"Feature",id:"2204",properties:{name:"辽源市",cp:[125.343,42.7643],childNum:3},geometry:{type:"Polygon",coordinates:["@@żôŎVšIÆÑĢ¥Vš™bV¤°bȍ@™V¥ƒ™Þ£lÇUUUÝlƒÞ£™mţIlƒUa@¥nlWƒ¯ƒL¯™kÇġ¯ğwWmÅk¯UƒVU„„bWlXlmnƒbUx¯xVVknlŽUbV„ÇKUb@„™VnbmlnzUº±bmJUbWÈnèm҄š@X`WL"],encodeOffsets:[[127879,44168]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/liao_ning_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"2102",properties:{name:"大连市",cp:[122.2229,39.4409],childNum:5},geometry:{type:"Polygon",coordinates:["@@‚IÞmVk@wXWÜbnwlLnU„@‚nLlbXW@a‚wnbl@XL‚aš@Ċ¥@LULnJ@xVnmV@VXXV@VJkn@VÜKXXôJlb„xl@„IVbnJVLUbn‚lnVw„JVU@ƒXU‚aUUlwn@°ƒn„VKnV°_VJšwl@nwlV„IXWlIVVnK@IWmkIVaVU@WÈUlmU@U„WUalkXġŻ@kIƒ»mm™akUm›ĉUŁV»²ġVĕ@aUU؍IɃ`ȃ@kƒw@ƒUƒmwĉ™@ƒWķсIĉÇbÝLkymbIƒwÇmÛbmbU„¯ÜõÈkÆVbŎxnXVÆnšǪ¦„bš¤Uš™xÝnĉÒmĊVȄ¤Èš„bƼ„Ā„„ÆÆބźb„VVbX„‚°²¤"],encodeOffsets:[[124786,41102]]}},{type:"Feature",id:"2113",properties:{name:"朝阳市",cp:[120.0696,41.4899],childNum:6},geometry:{type:"Polygon",coordinates:["@@na@UVI@m„ÑW™kaV¥UI@wl@„aÈbšm@wVašk„@@K@kƒ™@a@UUmƒUUalmU@KÇUű¯@±kUKVkUaƒaU@¥m@@¯k@WLUmkn@mmIkm@amU@wVmkU@Klk@U—m˜aXIWWUL™aULVbƒmk@UUmUk±™_Uym@mbkImaX¯WW™xWKzU@WƒkJWwkV™@Um@UbVVVVXb@VWX—@WŽ@Vkb@V™nUK±aUUlwX™ÇWKknU@mmUkƒLUVƒVUUVƒUaƒw™bkKmwnIƒ™kJ@nmbƒ`kmVkLWwUm@UUU™K@UmaUa@UUaWK@mUƒ¯Wkk¯VmUUŽ„xVXUVmL¯ymXkWUbmXUKƒVknWx¯JVnkLƒl@VVxnxlĀVL²WlX„l@bÝVUn@bnlÜaXblIVl@šš@Ȧ@VmbXV‚@@x„VVnUn@`°@VnXU@K@„VV@VmbnVn@ln@b„xƒ°Ub@bšLV`Ånƒ„W@@lUšnnWVU@Vbkl@Xl`XxV„UblŽkX@Ž°¦V„UVVbUlkV›@UbVbkLUxmJkXšš@b‚bœxVKÆlXX˜bnŽnala@ƒUk@U„VVklKVUXKVU°KVan@VUnLšKVL„WVaU_@mmUXa@m˜wXwVkVWXk‚k@›„k@klm@wXKl@U@KVUUUVaUƒV@„alL„xUx@b°°VnnVšxlIXJmx„LUVlV@bnX@Všb„aVx‚@XJ@b‚n@VŽVXȄl@llX@lU„Vô°°@ބVbn@‚V„k„@VW"],encodeOffsets:[[123919,43262]]}},{type:"Feature",id:"2106",properties:{name:"丹东市",cp:[124.541,40.4242],childNum:4},geometry:{type:"Polygon",coordinates:["@@lzXJ‚U@š²x‚@@Vš„@bUVmKUn„°n@lnVK„„nV@n@VlV„°WbXn@‚VzƒJ@¦@bkb‚bUl@bkbƒJ¯zƒWULWbklV„nb™¦VJ@„„K°U„kl@@W„bVn°@„Všm²U˜nX`„UÜLXmVXlKVbUVVnUbn˜ƒX@VUL@lUbWxš@²kl`n@Vlb„@nUVWVLVU@aV@²bl@ÈmšxWX„VÈU„JV„l@„„la„WnX‚KÈkÈ@Va°bÆm„@XV°IVV°UnalƒVUn@UwVU„@@VVJ„I@bl@XK@wWmXU‚UVbkJVXnJVI@mƒknwlKXL@`l@VI@UUaVKÞn„aVm@aÇ£XW„U@aÇUU@mbkKm£™@WW™ƒL@@Kk@kl›U—bWKUkUU¯UõÛƒmUUaVU„U@WU_W@kVkJƒ_WKkV@bUL™¯¯ƒ±mk¯ġƒğÑ@UmwƒKUakƒ™ƒa@a„m¥ÝƒIUWmk@w™mţ—L›KʝbȗKWĢklVbƒX@VV‚knÇV@XUVUblJXn@J"],encodeOffsets:[[126372,40967]]}},{type:"Feature",id:"2112",properties:{name:"铁岭市",cp:[124.2773,42.7423],childNum:7},geometry:{type:"Polygon",coordinates:["@@XJm@¯šmXUlnVbUJƒU@bV@UJWL@VXLmJVbkXlJXxVL@b@V@n@b@`Vbk@lxknV@VV™V@bUL@bV@@bVK@VXLWLXJ@LV@nbWJ@IUV„x@LVJUXVxVx@VV@@LXJWL@VU@@L@VnL@bVVmVX@@VVInJmbnLWVnVULVVU@VVmX@@JVz‚l@„nVVKVXރ@mk_lm„UUWV_nJlUÞÑÞVVUVƒVL„UVJ@I„Vna‚@@KV@XwWknwnKlalU„w„aĉݚwšJl_@aUaƒKUUU@WU@WXUÆ@@UVK@n@UnVVšblK@bœllb@b„bW@Xbl@UlnLl°°bš¦nKlVnI„V@UWU@WXkƒw@am@nm@aVw@I@KUaVIm±XÑlknJVnVJšaX_VaUaVKmwnkmmn@lU@U@mnašXlKUmUIVmklaUK@UlUVUW@U™kVm™a@UUU@JmUU@@bmb—KWV¯XUKm@ka@UVKVk@aUKmLkKUUÝUmbXbÇJ@k@WU_@m™™@klm@UXKVaUI@KWUXaƒÇWk™aWUkWUL±U@lUU@ƒUJƒI@V¯JmIm@@aU@Uwƒa™@UV@VkI›V¯aUkƒWkb@bVL„@@VVVUXW@Uaƒ@@b—‚ÝbUV݄@ŽƒLmUkVUbVllLUV@LššXŽWbUXm@U`@„kxlnnJlbnIllšLX„lVlUXmVK„n‚V@L"],encodeOffsets:[[126720,43572]]}},{type:"Feature",id:"2101",properties:{name:"沈阳市",cp:[123.1238,42.1216],childNum:5},geometry:{type:"Polygon",coordinates:["@@ȚĊÜ°„b„L‚lÞxUbUn±‚@ÈnVÆL@xnLšlUVƒbƒxkImJkn@V±LUxkV@bšbšKVKnzVl@L°@Va„xÞUlbôxVVœ@@V±bnŽ@llXL˜ŽöXĶŽnal@nkVJVI@aU@@aVK@ašUUUU@lmkwl@Ua@_@a@m@U@aUKWwkIlWUanIWK@UXKVIU@@a„VVIUa‚mVknW°™n@WI@KUƒmULWnkVkUWƒ™KkkmJkamIkmlw@ƒV_n@VWXaW™™@KVUkKUkValUnV„K@ÞƒVUÞa˜@a„@VbX@VWUU@Uƒ@UK@ala@IkKmUUa@U@ƒVƒkk™WVwU_@KÜUXbl@V¥XUVmƒƒƒXa‚kŃlUUkIm`UIUJW@UIKmkm@UUJƒImmU@ƒVUXU`mIUbUK@LƒJUU™l@Xƒ@UbƒJ™kU@ƒŽn„m@Uam@@ƒ™aUmLKƒwƒ™mWXUK@kUaÇa@JUIUa@aƒKVUƒUXmƒUy™_@lmbkLUKWLX`‚n@bVL@JXL„‚WX@Vnb@Vm@UbnVmL@V@x@LUbVV@V@LƒUVl@mb¯U@xU@UVVV@X@VVblJ@bn„VKUn„x@llnL±¤™b@k`VXÆK@„kV@¼kl@bWIUl@VmLnbm@@JXXmb"],encodeOffsets:[[125359,43139]]}},{type:"Feature",id:"2104",properties:{name:"抚顺市",cp:[124.585,41.8579],childNum:4},geometry:{type:"Polygon",coordinates:["@@„XVl°bœUlJ@UVUš@„bVxV@@bn@nJ°I@U„J‚I„VV@V@k²VVKlXXVšb‚lÈX„ŽWbXV@LVJUbWL@Vkn@lšš@nV`@X@lÈIWanaÞVVVlLnKVL@bUlUL@Vlbn@VL°WXU˜Lna@aV@nV@IVV@VšbUnšl@V‚XnKVa@U„UnyWkXaƒaVk@ašašbnm@_WKXmWanU@alaU—l@XJVLVxX@˜wnKnVlwƒƒ™@V_@a¯¥@UkKWUaUU‚anK@IƒaU@WUaVw@klUVyUUVUUÇ@Iôbša@mnUma@kXa@UWak@Wa—l@a›@WUƒLmU@U`mIUU™`mUk@@UUK±nkJƒbUam@kwm@@a@UU@Ua@@K@ƒVK@kmKU_UKƒUUaĉWmkkL@`™LƒnmlkLkbmK@k™@Ulmb@b™„@Ž„xUVƒIUlmVXXƒxm@™JUUk@WUk@ƒakx±@¯x¯Umb™KUUVmUU¯UmVVn™WkÆ„lWb„„„ŽUnWVU¦k@WaÛV@LV`UxšXllU„@„@VVbnVlL@J"],encodeOffsets:[[126754,42992]]}},{type:"Feature",id:"2114",properties:{name:"葫芦岛市",cp:[120.1575,40.578],childNum:4},geometry:{type:"Polygon",coordinates:["@@ll°X„ŽnV‚@XLVb@VVbnb@VšLVV@VVnXxlKnU‚l„_na@mlI„šmJnxlLša„xVbU„VV„UVU„KVlnnV@lmXLšÈWŽkxVV²bVLšm@Ula@UX˜@XW@UWaUUUUVan@V‚š@lUXxlIX„V@‚yXLšw‚ŽXXW°nblJnan@Vzš`l²nVVVl@„nUaVKšbVKnXVaUaVUšyšnXK@kVK‚@X@m@m‚LXa„LWƒU¯„w@™ƒa@UVw„¥°™ó¯¯y¯ƒUǯ»›w¯Iƒm—¯Ç™UUl™¯»ţKċÑţķm¯w@mU_ómk¼VnU`±IkbVlƒnnŽU¼±Lk`@X™Wl¦UbmVUxkXVlkbllU„Vb@bkVmx@XVV@Jb±aULkKWXkWmX¯aUJmIkVm@ƒxU@n„"],encodeOffsets:[[122097,41575]]}},{type:"Feature",id:"2109",properties:{name:"阜新市",cp:[122.0032,42.2699],childNum:4},geometry:{type:"Polygon",coordinates:["@@šXnb°lš„VlnXVJ„LlVnl@zÆxnK@b„blKVLn@@V„aVLVK@L@Vl@XVVInVVKVwlUXwlKšL„ššVVb@aV@X„lUXbVW@n„lWnXKV@@V@XUVVLUVV@@bVVV@@ln@VbVUXV‚I„xVanJ@UšIVWšL@UV@@¤V@nInw˜W„k„lnIVx‚lnzUVÇJ¦VVÜLĸUnW@aV_šWĊXXa‚Knkl@nm™L™a@alUVw²K@UlmnIlJ„w„aVU™kmK@wÅKmU@DzVmVaÝwkƒKƒaÛ¯șĉķ¥ğ¥ƒ@kUWkƏī݃ƒ@@akU„K@KWIUm¯nƒU¯JmwUVmIkJÇLm@™UImJUU@aW@U@@nUb™JƒaƒbXVWn@UVmX@V@b„š@l@Lƒ@™lUb@x™nÇaƒbk@@xVJU¦lbXšƒÒ@nUJ@Vmb"],encodeOffsets:[[123919,43262]]}},{type:"Feature",id:"2107",properties:{name:"锦州市",cp:[121.6626,41.4294],childNum:5},geometry:{type:"Polygon",coordinates:["@@nJ@nlmVnXKl@@°n@@¦‚V„bVbUlVL²l°@ƲÈV@LV‚knVb„VVnnWVU‚@XmWU„a„bšIVa@mV@X@@bVVnIVJ@š‚nÈKlInJVUnx°I„V°mVnXJ@LƒLlV@b„@ބƐĬXllV„@Ġ¦ĸ¦naWW@In@manK@UVkXJ@alk@»lU@ƒÅLUWl_@ša²£‚Kkm@kƒwVmULmƒ@akIUa@U@WUUVU™aÝ@ğ›wkƒƒmĉ£UWƒ@@bÇL@m—a@_mKƒlƒXUwKƒLţÓ@UWw@K@U„I@m™U@UV¥„@°UnJ°@@_™KUwƒW@UnaWUmmI@m™ķwUaÇLóVĵwݙUUW™¯šƒ¦Ux@V„b@šƒxV°X„ƒKWbK@n@nW‚@UL@lWL™m™zUVVbUbmWXXWJ—b˜n@Vkl@LlVUn@xnV@bln"],encodeOffsets:[[123694,42391]]}},{type:"Feature",id:"2103",properties:{name:"鞍山市",cp:[123.0798,40.6055],childNum:4},geometry:{type:"Polygon",coordinates:["@@l„œxĠŽÞ@šbV@@w°Vna‚@Uk„V@K@UUUVa@K@w@UnKmUVan@@Uma@UXWƒWK@IUK@amW_XKVLlKna@kmKVak@VU„@VmšU@anIÆan@‚a„šUVnb@blLV`ÞLlU„bna‚Kn@naVU@¥°IVK@anUUKVaƒUVak™@mJƒkXƒ™UVwkƒVUUa°U@Wƒ@WlkXWlIXUlJlaœx‚IVVXLšll@nLV@lLXl„KĊzš¥maUƒlkXaVK„X°y„Ila@aVkala@a@¥„IUy@WmXaƒ¯kU@U@mmUƒƒULkmm@ƒ¯VmnLVU@a™ƒ@U@±w@™VWIkymLUUkJWXƒJkUmxk@™xUI¯`mUULmƒ¯„m@kxVVbWV@„UVƒIUx@bkšVšVVšxUbVV@V@zšJVXU‚lnk@@lkLƒlƒLUU±Jkšm@UIUVƒLUVU@™K@UƒnnV@l@Ll„ƒaUJ@zn`@nWlƒIUVUUUV±Ln‚@nmL@VUVkLVlUxVLVlÅXma™@@akLmWUX@JUnVJVkXJ@X@`WX„VUVUIlb„W@bVUVL@`Un@¦U`@bUV@z@Jm@@XV`„LUL¯J@IVKmKÅI@J™nWVnLnšVxV¤™z@bmV@VUV@bUL"],encodeOffsets:[[125123,42447]]}},{type:"Feature",id:"2105",properties:{name:"本溪市",cp:[124.1455,41.1987],childNum:3},geometry:{type:"Polygon",coordinates:["@@lb@Vn„lnVVUb@šVJ@nnJ@bmXUx@xVbkbkŽWLUxnl@Ul@„xWx@nUV@¼Ull„knkK@bmbnl‚LVJX@VIVJn_lJVVšXUmnU°VVVUnVVšLna°V°w²@lw„bl@XVl@VVšIn@„wWWnUVk„JVUƒw@šƒ@anaVkš@@lnLlalKnk„mšK@_lKnlĊXVb„VVLV`nL@lUL@„@L@‚VbV@@V@bn@lxn@Vb„alI²mVL@Vl@nVš_VVnJV_‚@nV„K‚V@Xœ‚@b˜kXbl@XblylUUkš™@Xa@UVIlK@UUWVU„Llm@UUUnKWU@K@UXm„XVa@U°KVUUWUk@ašUVKkaWkƒKUknaWa@U—@m@mk@ƒaUJk@@_WKkLmx„l@nUJmIUWlIUaVWVXn@xWLk@@aƒJUI@Uƒ@UVVxm@UVk„mb¯VUU¯JWUƒ@Ån¯aUbÇ@ÇlLmWƒXkbƒƒk@UƒƒIÇVƒUXW™wÇnk@±aU@@bUVUKUXmVƒ@kaUm@k_±l™@XwVa@kVK@U„Wm—VaUmVUUakLUWWnÛKƒVW_—m±V™nƒU¯@Umƒa@Xk@ƒl¯V"],encodeOffsets:[[126552,41839]]}},{type:"Feature",id:"2108",properties:{name:"营口市",cp:[122.4316,40.4297],childNum:4},geometry:{type:"Polygon",coordinates:["@@ĊĖƐn¤„„°Ċ¯ŎWšô„@xXb‚wnKl@nX@VUVƒKmL@VU@Ux݄@Vlb„x„U@VUb@b‚kœ`‚IUlVUn„V@@UV@@JnXlK@bš@nbÆWUkUKVwUklKVU@UnK@mm²KVUVVVU„JXk@mm_@yVI„bkƒ@K@kmU„m@VšLV@VU„KVUVJn@l™²IVV„K„klK@kl@kmVUW™I@y@UUUVa™wUUU™l™@akmmVaUKmIUaƒJk@ƒwkaóIWWÛL@UlmUIU@WW@UnUUm@wmIVK@Kĉ¦™@bWKk@max@bWXkamKƒ@mVkKmxÛaWX@xUlÝnJ"],encodeOffsets:[[124786,41102]]}},{type:"Feature",id:"2110",properties:{name:"辽阳市",cp:[123.4094,41.1383],childNum:5},geometry:{type:"Polygon",coordinates:["@@š`Vz„‚Wn„VUV„L@bVbVJ@IÈbVb@lVLXW‚n„š„x‚LnKVŽšb@„n@Vbn@mƒ„V@šl„IVa„@@WškVV„I@KVLVanJV_VW„UV@nn„JVI‚Vn@na@alLlmkƒVk@»VU@mXwƒwk@@VmkVwXKllaUa@wVwnW@amI@mUI@™VaUUkmmƒ@UkaƒL@ƒUIĉyƒLWkkKU@mKk@™kWKUUJ›wkbkIWVkJWXkl@X„‚@X¯VVbUVl„UxšVW„„lnIš@l‚Ub„VUbVLmV@bUL¯J@¦UVmbm@LmbƒakVÝKU_kK@amaVUƒ™bm@ÅbmJ@b™VUnƒ@UVl@UbnL"],encodeOffsets:[[125562,42194]]}},{type:"Feature",id:"2111",properties:{name:"盘锦市",cp:[121.9482,41.0449],childNum:3},geometry:{type:"Polygon",coordinates:["@@Vbĸx‚š@nnJVnXŽmb@V„XVxšL@`¯@mI¯Vƒ@U¦@VšV@nƒJ@V@LXx@VŤÔ„K‚LVx„W„knL@`˜b@nÈK@a„@VXĊ¤„nVK@aVU@UnU@ašyU£Uwm™mKXUšm@IÆJnLUL@J°IVKƒKU_@Wn@@I@yVU@aV_@¥Vm@_UKUV@aƒXkaVJVUƒUXW@_@WWIUlUIVm@IVW@IU@@VU@mƒUVVkJ›_l@aVa@UƒVƒwka@UރVwV@@UnK„LVU@UmWk@mLxWa@wóƒUVUIÇÆĉ¦¯¦¯xʟJ"],encodeOffsets:[[124392,41822]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/nei_meng_gu_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"1507",properties:{name:"呼伦贝尔市",cp:[120.8057,50.2185],childNum:13},geometry:{type:"Polygon",coordinates:["@@„m@Łkƒ™Žƒklƒôƒ@£kJ°ý™ɅķÑó¤ğLĉÅlÇğŁW¯¯›™ƥóÿlwkţÈéÝƛó™°ÞÅxV¤ĉĖWƒ¯lȭţυ̃ɱÿķƅˋğɱřÝţϙȍƧĊţ@¯kWKUKm¹Å@ķJU@ƧÑƧ„ō¥˹Ɔ@L@„Þ‚VLnš@VōČWJX¦@JŻbU@ţÞmVU@ȁýóbkWWLƒƒÅ™¯UWġkmóƒ±UŹôV¼ƽ¼ƒł̥ĖƽǬʉxĉŽŻȗKΕ̛ʵƨʟÞ˹»Ƨţ»Ǖō˷Ȍ±ȚʊĠUɾɜɨmÜ֞߼˸ƅȂ¯ǖKˢğÈÒǔnƾŎՂ@šĊbôô̐¼ƒ@ĊôĊŽÞĀ™xšĖƧL±ŽœŽ‚Uš°U„°ĬƒČ°ÜƒêɴȂVł°@ƒ„nxŎèƒbȄÞȌ΀ǸlŽ²IlxĊl²ÒmšôĖ™Èl„ĵºm„ÈêVþ„xɛČʉÇĵVmš„ÒƒÈɆôƐŰǀĊ°ÆǬĮƾb„yĊ@ĠšƒXǀċm»ôw°Ûk¥Çm¯ç™kkÇǫţǕéX_ĶWǖīŎaÆĵĸĊ@ȚȘ‚™ĊLĢĉ„VÆĉʊÇĕóaU¥šĉ°mkÅ°ġUĠřk°mƒÑČÿ˜ÛƒWĸ£ʠšÆxÈÞŎÞ»ʈ²ĊÇČalÒ°Ť±ĸz„ŽĊKȲm¤Ŏ@Ò°¼nyȂUźīǖƳÈē°@šÝĶƒ@ƒÈkl¥Ççkxk™›JXÇƒUÅ@˜£k»„óƿīÛ@lÅJl¥óý@¯ƽġƍÅan™ċ™°é¯¹"],encodeOffsets:[[128194,51014]]}},{type:"Feature",id:"1529",properties:{name:"阿拉善盟",cp:[102.019,40.1001],childNum:3},geometry:{type:"Polygon",coordinates:["@@™ƏnǟƨʫšŹɆÿ°¯ÆV²ˢ™żÿ@ÝÆŁȰ¯ȀƳĉó™™@ğkyš¹@īš›ƒwl£Źƒƒ¯Ŧé@™ÇÇxŋĉƩUUŃōL™Ç™ĵóÝnƒóç@™™ó@ġƒƱ„¥ƒç™WUçÆōƒ@é—çťK™çȭVһƽ̻aW¥ȁ£ʵNJǓƲɳޗǔlżÞmĠóĬȂɲȮ@ÈĢŮźÔnĶŻǠšŎȭœгŃċóȭţΗÆƑÞƧÅΫóȘǫɱȁġlÛkÇ°ȁÈnšõl¯ô„ÞɛÝkĢóWĊ„zÇɼʝ@ÇÈķlUČÅÜķnέƒǓKȮŎŎb°ĢǀŌ@ȼôĬmĠğŰōĖƧbЇƧōx@ķó£Ål±ĀƧīXÝġƃêĉK°Ýʇƅ@ΌʉżÅÒϱʈ@˺ƾ֛।࡬ţશóЈèʞUš¤Ґ_޸Ƒʠɽ̦ÝɜL׈ɛϜóȂJϚÈ@ǟͪaÞ»Ȯź"],encodeOffsets:[[107764,42750]]}},{type:"Feature",id:"1525",properties:{name:"锡林郭勒盟",cp:[115.6421,44.176],childNum:12},geometry:{type:"Polygon",coordinates:["@@ʶĬĊIȘƨƨŽ@ĬÛĢșŤĉĬƒĀóšU‚ÈŚÜènŦƐȤȄłϰUƨťƾÑ܆ğɲƜǔÈèʈƲĊƞƒšɆ¯̼V˺Ò˺ȂŤVĢêU܃x„Āˌ˘ƨ„Æ°ѢmÞżU¼ÆlŎ@ĊçŎnÈÒͪŎźƒĸU°lżwUb°°°Vš£ÞlĠĉĊLޏɆnźÞ„n¦ĊaȂīġŃ¯Iĉůl»kƒ„™Çý„¥Ŏ¯ƒén£ġљÝȭxƒÇ™@Åçķ»óƱŎ¥™çWÿmlóa£Çb™yVÅČÇV»ÝU¯™KĉýǕċţnġ¯»ÇōUm»ğƒÑ™wƏbċÇŎċwˋÈÛÿʉÑ°Łkw@óÇ»ĉw™¥VÑŹU™mW»ğğljVÿŤÅźī@ř¯ğnõƐ@ÞÅnŁVljóJƒwĊÑkĕÝw¯nk¥ŏaó¦ĉƒV¦Å`ğуÑÝ@mwn¯m±@óƒÛKˍƏǓ±UšÝ™a¯lƒōšșk„èƒĬގn@ŤġŰk°ċx@œĉ`Ƨĕ°@ţÒĉwmĉ@ƒƒnƒƒa„™¥ķnƒÞĉVóÆókĉŽķ@ÝkƧƧÛaƒ°Ç@ÝÈU˜óbݼ@„ÛÒV°™@V¼ˋL™ÞɅŤŹǠVÞȗŤÇĖŚōbȁƜ"],encodeOffsets:[[113817,44421]]}},{type:"Feature",id:"1506",properties:{name:"鄂尔多斯市",cp:[108.9734,39.2487],childNum:8},geometry:{type:"Polygon",coordinates:["@@ĶL²ĬVłƑkkl@Ȏ™ŘWńÈĬȗ¯™ºlz@ĠššĊôŦô„ÒĠ°kÞܚ™n@¤„UĸèĸbŌÈXŽĸLlÒĢxɲÆ¤ÈÛƾJÈÝ°UšÅĶ»²VW¯ĸJôšbk‚V@ôlbnĊyÈzVôašb@ĸ‚ÞUl°yǬ²Ǭm°ššk„±lbn°@È»˜JX„VŎÑÆJ@k„LšƒÆl²™Ġ²ʊůĊġ‚řóƛÞÅ@m„ƒmLUÿóĉƧ@™»L@„›`ČĸmšȗÑţů±ĉğl¯Ā™wǎƒçƧŤÛI@±ÜĉǓçō°Uwô™ǫůķƳř±bÅ£™ÓÇwnÑó@ȁƽ@™ƒÇƧĢón»ŏĕóĊ¯b„Å™™VȯÅImƒōKU„™LǓ±Ýxċ—ŋ˜V±Āȗ°™„Źl±šÛ@WÒȁŚŹНŚÅèŌô„¼°ȰɞȂVĊ"],encodeOffsets:[[109542,39983]]}},{type:"Feature",id:"1504",properties:{name:"赤峰市",cp:[118.6743,43.2642],childNum:10},geometry:{type:"Polygon",coordinates:["@@ɲŁĢljĊwƾōÞĭ°_ŎŃźȹƒUČÿl»¯ôķVÿǬƽ™ɅġÅÑǫ»̐ʟȣU™¯wVWݍÈġW»Þ¹m݃ɛŎÿŎōͩůV¹›ō™éċ™óŹÅVVĢǩʈ@Ėċ@ķšÛšV°¯xÇÅţ¥™»°Ûô™ĉʟ„¥WýČ¥™w‚灻±mnÅķ¥ˋVƒbUÒġ»ÅxğLƧ™ƒbWĖÅxš¦U°ÝVóŰlô²@š¥ÜÞÛô„V@²±`š¦™„™¯Ý@„ŽÅ„VÒō¼ôš™¤V²ŹĬÇĊƑƒţxƒç¯Lk»ʟlƽýmłÝÆƏ@mö°Ġ@ŚŹĬţÆUĀĠNJĠŽX¼šnźVUҚ¦Ċxȼ@ôlx¯łʊÒÜĀˌÇČxƍČÈƐašx„ÒĠŽn¼ŎVȐ‚¼Ģ°ŤmǖČĊþšLV°ÞŽU¼ċÈUƚzÈa‚¤ôbkŽ‚nXĀšè"],encodeOffsets:[[122232,46328]]}},{type:"Feature",id:"1508",properties:{name:"巴彦淖尔市",cp:[107.5562,41.3196],childNum:7},geometry:{type:"Polygon",coordinates:["@@²@Ζǀݴʶհĸ„˜ƒ¦Ķ™̒Uˌ¼ӾÇƾ¼̨UÞĉ˜Ƨ—éÝ»ƒĕĉ—ƐȍœōǪakó‚ó¯a@™ôţ™aV¯Þ¯°@²él¥ĵğťwōxó¯k±š—Vó@™aóbUÇyĉzmŽkaóŽU@l™aó‚ķIX°±Uĵ¼™Æ¯VÇÞƽIÇÜÅ£ɱŽġwkÑķKWŋÇķaķçƒV@£šmۙlÝğ¯ƒÑťóǿƴȯ°Åł@ÞŻĀˡš±ŽÅU¯°ɅĀ™źƧʬmǠšƐ"],encodeOffsets:[[107764,42750]]}},{type:"Feature",id:"1505",properties:{name:"通辽市",cp:[121.4758,43.9673],childNum:8},geometry:{type:"Polygon",coordinates:["@@ôƲĸ¼Æèš@„ÈȮwƾ»ʠĢ¥VÆ@²¥@»Ŏњ¯ĊJŤ£k»ÆÇX¯̼ōšī°aX£ôƒƾȁź¥„ƒ™aôŤ™ĢL°ƒĸ@Ȯ¼ÈÒʈŚôVXůÆaĠƛÈKƒķšĉôÿ@ğÈĉ™»ÇVn™ĉV›wXĠÝ°šČÿĸwVƒ™¯¯ǵ±™ĉ‚ǫ™ÅÅm»²Ż±ƽIm¥ţÈķ@¯šƧJV»ÞUÝç¯UġºU£ţŽóaÅÅlƒƒ™Ƨī¯K¯Þ݃ğL̑ȍƽ@ōŎōĀƑɜnÞݺX¼ÇĢގUX°xVšʠȤ̏Ǭ¼ÆÒɆĢšŽǫƾUĀóĸ°‚k¼ċĀƑVŹȺōń¯`ÝĮƽŎĉxġNJɱłō¦"],encodeOffsets:[[122097,46379]]}},{type:"Feature",id:"1509",properties:{name:"乌兰察布市",cp:[112.5769,41.77],childNum:11},geometry:{type:"Polygon",coordinates:["@@ʠǠÞĸɲȺƒÒȂƛŎaƙÈĕȘţUÝźǟɆţšÝˌKU»š@U¯ÜÑ@ƒÞ»ôaV—ÞÇÈ@„¯ÜbƨƨÞlĸ@ĊôlôÅĊU„Ýĸmš¦ƒŽ„bm„„„Ċ@n‚ĊxŤÑ@¯‚ƨĖĊ_@›Čwl¯™ƒȭL›Ý„»ƽ¯ķů„Ǔ@ÇǓbċ™ÅÅÆwÿĠÇU£óaƒ¥¯aŎğĠţkw°»¯ůlÝĵkǻݰɱƧǫaóôɱ»Çk¯ŃóƒʇŐŻ›ĉNJŻĢ„Ž¯ÒÈUl°ƒx°n„Ò™Ĭón™Ċğ°ÇŚĉ¦ʵVƒ°°ĬÛżÇJȁńʇʹó˂ƽŎ›Æţ¦"],encodeOffsets:[[112984,43763]]}},{type:"Feature",id:"1522",properties:{name:"兴安盟",cp:[121.3879,46.1426],childNum:6},geometry:{type:"Polygon",coordinates:["@@ÆXnlŎ°@LVLĠþœxĊUȮĊnU„ĠV@żaW¯XIŎġƒ¥Ý@K@w@K@I˺ŻŎ¦ƨƒƨÒŎIÆ@X@VºnX°lŎ@ƾĉˤƒȘǷȘÑÝݚÞbVţĸÿŤxÈĖƐŽêÇKnĸ¥ô@›ķÞUnÒl@UŚaƒīˋƒ¯ÑƧx@±kXřƐƏÛéV™ˋ»lō¯ĉ„ÅÇÓǫޗĖġV@ğ»›°ĵ„ÇÞǓ¼¯m˜ÛÅŃĉĠÇƾb²çƒ™šéż¯VƒƒğÞml»ōÑV痻V¯™¯šĕÆU¯y°k¯¯V»ôDŽѰa@Źk™ġKţšóŽšbƒ„Ź¦ƽȂó„W¤¯b™Ĭ̻ŎW°ÅÈl¼ţ¤ĉI™°ōÒ@¼±¦Å@UŽġ¦ʟŽƽ¼šÞĢÒm¤„êō°ƒ¦Èþƒšl„k¼ĊŰ°JĢńȁĬ„°ƒżn‚ÇbV„ݼ@¼óĸţ¤@°Ånšl"],encodeOffsets:[[122412,48482]]}},{type:"Feature",id:"1502",properties:{name:"包头市",cp:[110.3467,41.4899],childNum:5},geometry:{type:"Polygon",coordinates:["@@źxżĀǔÆǬVȘĀŤ¥œÅƾōôˁʈͳȂŃÈIÜŻ¯ī„¯ōm™¯ɱĖ¯ƒķÒÝIÝ»ÅV™ƒlÅôфġ™ğVmÞnnƒWçkW܁XƝÆwU»Șĕš£ĉÑ𱱚Åk™„ƒK@lÅIō҃UW‚—IǼ¯@m‚kaƒ²™l¯™ǫnǫ±¯zkŽÝVķUô™˜l²ô°ŎwŦxĶĠk¦±ê¯@Ý°U°šbóŤ@š°bôlôǩb›ŎƏȎĊ˜„ĖÞ¼˜ê—ƨÝĊ"],encodeOffsets:[[112017,43465]]}},{type:"Feature",id:"1501",properties:{name:"呼和浩特市",cp:[111.4124,40.4901],childNum:6},geometry:{type:"Polygon",coordinates:["@@ʶUĊ¥ÈřĠ¯šĉômšīƒÑ¯m„wk¯ÇV°ÑƒżġĊljǓɱţǓ›ƝóX¯ƒɛÒóa@nÝÆôƜŚĉĢʉŰĊҙ¤ȗĖV¼ÅxWƞۂlXXèm„ÝmUnšĠƒĢóÒkƚ„ÆUÞ¼ÞJĸÑ°„ɲĕš°Ŏn"],encodeOffsets:[[114098,42312]]}},{type:"Feature",id:"1503",properties:{name:"乌海市",cp:[106.886,39.4739],childNum:1},geometry:{type:"Polygon",coordinates:["@@Ș°ÇīXњŗ@ȍlkƒlUŁ±īĵKō¼VŽÇôXĸ¯Ž@šťê„°ź„k¤„x™œ@Ĭ"],encodeOffsets:[[109317,40799]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/ning_xia_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"6403",properties:{name:"吴忠市",cp:[106.853,37.3755],childNum:4},geometry:{type:"Polygon",coordinates:["@@nLV‚@šVLšaÞbn@@l˜š@bUVlUV„zVx™¤kÞVèšXnš‚@nm°a@UƒÑ„@VŽXnV@Va„UšŽVKUUU@@U‚@@KVa@U²@‚wXkWnk„±lLnU@UmmVKnIVWnI@UK›@UK@@UVKXkmWLWUXmlkVwUyVa@w„w@aVI„K@aVÈw„KlLVV@LnV„VVnU‚ܲ°WÈIUÆ@nÞ¼‚‚@¦™@UÞUVW@UxUxVn„b„K‚b¯ÞU`VbǬ™V@XXÆVVl°InmnUôƒ°¯‚anam£œWVX‚KXmškôaVU@ƒVak@@wmaƒn@K@UÛUWKXUƒÇƒ@UI™b@alW@akLUKV@@Ukw±Iš›nL@kmwkWmk@JUIƒůVmnnU@m@UƒK„VKlkUwkƒƒnVUKmbkI±š—KƒkmVkKƒb@U@aƒVkUmn™`kIlaUK@UUKmbUIݚUa@mUa@aƒ„m@UUULUK@bmKkbWI@WXwlkXƒWa@k@kKƒLVkkK@L@JUVmzUKlwUUnW˜£XVlKUwVU@aXI@aWaUw@W@_nam@¯‚UkWVkUWaU@nwmJkUVkWVUmUkJ@ImbUaƒ@@WÅ_mJknmak@@mƒXƒaUV@„ƒxUšƒ„@‚ƒ„@VUnkVƒ@Vn@`ULUbWLXVW@kbUJ@XW`@ƒnÅĖWJƒ@—m°@xƒxšbnUa‚w²lƒÞ°xŤIVVULۂWbšbkVVXÆ`UbVL„@kx°LlV@Vœ„WbƒJn@bl¤ULV„°@lmL@ƒƒ£U@@aUwmKULVxUVVx@„™@kU™@mK¯LÇa¯@"],encodeOffsets:[[108124,38605]]}},{type:"Feature",id:"6405",properties:{name:"中卫市",cp:[105.4028,36.9525],childNum:3},geometry:{type:"Polygon",coordinates:["@@°@Èb°KnLš@lVš@@ƒUwVUUwVKnLVx@bV@„¤@„nK@k‚¯UƒVKk£@a‚m„IXa›ƒ@UkU¯Klwƒ@UKVaÅ_UWlU™aXa܁VKUUţJ¯w„ݱkxVbmŽ™a„w@wn¯˜„@XIÆĕ„m‚@X_@WVIlaX@WUXKVaVK@_Um„@lUVm@U„ƒ@„ƒV™„w@ƒVUÛwm@@W@ImKUkU@Ua‚aXƒ@wWaUKkw@UVaUamLU™nk@»±`¯@k—W@Ua™ykbƒI„„@VWJkLWUkJƒwU@ƒn¤mL¯wm@Umƒ²XVWbnV@bmxƒVkxUblLUV@kVWKU¼ƒŽkUƒ@mn@JnV@bUnmJUn@„k‚@XlxšLVVnKlLVV@š@LkKULVbk`WL@lkXW@kVƒ@UÞUlÇX™lkaUbmV¯@@L@šƒV@bkb@xƒlW„—bƒbW@—±@UJ@IU@mVk„VxV@@l„Illœn@Vm@ƒVUbl„@JLmKÛXmVkU›KULU`@LĉwƒKUX„lVUl@Vb„JX¦̼bÞxŎxɜĖĠ„Ŏaô@"],encodeOffsets:[[108124,38605]]}},{type:"Feature",id:"6404",properties:{name:"固原市",cp:[106.1389,35.9363],childNum:6},geometry:{type:"MultiPolygon",coordinates:[["@@Vnn@°xnK‚£„mV@„xlIXVlKXI@Uƒƒ„JlašzVbX@l˜°@²_@¼mlVšnKVbUb@VlxVLXb@xW„bVbV@VlnL@J@Xn@Üx„b„W@nl@nblmnIÆ`@X„@Vbna@aVUUWVkƒ@kbWakbU@VwšW@_l@nmn@@alVlk@UkmVak@@a‚UXaƒL@¯@KVa@axWI@KnkVaVJn_lJ@„X@‚m@nVanUVb@mXLlJ„VWnLla„VVaVX@KXVVkVKlknKVa@aVU@KXb@klJUknUmƒ@K@_UW@alIUamaU¯kJma@IUK@U„@@UW@@aXLVƒVJVaXIƒKlaUkUV@ambUUJkIWJ@wUI™V@JU@UwV@@Um@™nU`@UkUmVUxWUUV@aÅb@aWXkKUUƒUUaWK@wnm@IVU@aXwm@UmVaUalk@anKUwlƒUwlkK@wmaƒUkmmIk@VmkUUbW@UVUnW@kV@xkVmbVnU‚™@UbUV@a›k@kkW@„kLW¤@„nV@VU@W_UV™UU`VLUV@IUVõVULU@UUUJ@wmkUJ@šWI@l@bkKkbVVƒbVbUL@UUJ@Vm@@L@xbVVVLVlVwX@Vb@bmUkbk@@JWIUVÅw@Km@UkWKXxWLÅ@UVUnWK@xkVW„@KULwWVXVWzXVVKVXkV›V@VUbV@U„VV@š@LXxVL@V„b‚Ž„LnKVLVxXVmb@l"],["@@@J@aƒU@LWK¯UUxVVn@Ġ„„LUW@UbUUUa@KUX"]],encodeOffsets:[[[108023,37052]],[[108541,36299]]]}},{type:"Feature",id:"6401",properties:{name:"银川市",cp:[106.3586,38.1775],childNum:4},geometry:{type:"Polygon",coordinates:["@@šUšwVK@UVWÞUšbšw„V@knV˜@@KU_VK@K„ƒn@W_XWlL@Vn@Ċw@Ulaœ@Wanamī@aƒ»ŋó@aÆÅɲÿUaV_°ÝaƒLƒaUmVwVwX@VUVݚ@@¥Ý»@mVÅÇJ¯XÛ±VUmƒUmU@KUUkKƒLÇxUŽ@bƒLUJ@bƒx@xUbVzUxklWnXV‚KnXWlUL@V@ŽVLœ@VL@ŽmJUXmJULnn@VmVkKƒ²mlXWlx±@@VUb@L@@VV@VVUL™ƒVUbU@WmUƒ@„Ò@V¯bmn@VŽƒ„@lVnUšnVWŽXVl@¦VVUn@x‚š@‚XL@¦‚lXxš„Vb"],encodeOffsets:[[108563,39803]]}},{type:"Feature",id:"6402",properties:{name:"石嘴山市",cp:[106.4795,39.0015],childNum:2},geometry:{type:"Polygon",coordinates:["@@U¯ķó±ÇÛ¯™ķmbXb›@kb@Vĉxm@@UkKWXX`m@ƒ„@LULV`@L—@mU@lƒU™x™aÝVUX@VUL™x™VkLWVšš@J„nVLXVlŽUV@zl‚VL@V@b„„n@lU²WVLlLVbUŽVxUx@xǀL˜xôҜk‚K²ŽVa‚U@wXa@W™ÈĉUa@‚bÈk„m@¯"],encodeOffsets:[[109542,39938]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/qing_hai_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"6328",properties:{name:"海西蒙古族藏族自治州",cp:[94.9768,37.1118],childNum:7},geometry:{type:"MultiPolygon",coordinates:[["@@„V£°š@laœXô±źwš™ô@„Ulƒża܍n™Kƒw@U„aƒ™ša²L‚mÈLƚÈxlaUa„wÞmÜbÞUšnJ°a„kôƒ‚ÑkwÝVğwÇ@ÝkkV¯¥@ò„»„nŤ¥XImw@mVwša@Åw™mLkaW—wƒ¥l»kçƒó„»@ƒWÑĉŽğ@ĉ„™‚Ń„UwóřVómĵ»™™Ý@VǕ¯kšÝĊÅk™°ÓUklkU±šI„ÇÞkƒ±@šƽJƒ™@UġIk@W¦™VÑșÓÅnťKULnŽ¯X›ƒ@¯mUÛ@WřmóKknōbƒxÝ@ƒŽU@kw@ÿÇLţšÝUkšmwƒŽk™lċVŚU¦™ŽƒLkUWlÅÑ@aƒ@ÅѱUóġŹ¼ƒÈĉmŻ@@wkw™Kl¯U™ġ@—„lÇU™Ó¯_ƒ‚Waĉ²Åló¼VbknƒKǎÅ@ƧĢō°Ý@ğ„W™ÅxUUm@™‚ÝXۂW„ULUè¯@mbUaƒLƒbUWġxIUJWz™a¯b™y™@ōÈóLU`ÇXUl™UĉV¯n›mÛbǕLklƒUĉVƒšóaġ„ƏbġKţnkbÝmmnÝWȭȃŽÝXţWókUÇl¯U¯‚ġUɅĀ@°¯„„š¯„VÆnmJ@ĊķnóJUbÝXUlVškL@lVxnnmb@¤Vzš`ÞÞŤ@„VnÆJV„°b„UôJkzlŽkl@²óš@ÆÇ°kĖƒšÇbÛU@lmb™XV˜kzƒV™ŽɅĀXˢlń„ĬŹ@›éÅ@ĉńÆ°ğbUšlŽɜ_°‚@xŦ˜škbVbƒKĢ„ŤVŎŽ°@żÈźlĊ„ôKôb@nôxŦ„Æ@ôŽŎL@þÆb@šnnšWˌbÈx‚InaŎxlU@Ѳ±ƒğVUĢƒƨbɲ@Þ¥ôUUķWVô¯ĊWʶnôaŤˁ@£nmnIôŽǪK°xUXô@Ŧa°m‚kXÆÞVŎkĊ°ÞLȄôyVašIlwX°UVwĢÑÜKôw@nV@œm°nmŽn„Ü‚ɞ£VbmŽXnƒ°ÜÒ@xx@V‚b²UlbkxVnšJUnVVĊ°KȚm°nxÇnn¤±¦@ŽUXVV@„lV„„bmVVȁŽVxšÒ™°šIšbźaȃšbVwš@šƒVL„™ƾÑ@ƒŦô¯ĊkôÑ"],["@@„@šƒ„@n„òVœa‚w²bVxšxÜaČVô_ĊJšIVmšL„a°@Ŏ¥XlK@ƒšk„l„KVbUb˜@nUĢn‚aÈ@lmǬ»Ġ¯œn‚mnƒƨVy™Ñǖ™Ġ»ɲInŽ‚@@ÅĢƳ@¯°™ôV„KÈbVIÇ¥¯@Ýó„™@ÑnīWKšƒk™‚k@¥š™¯™Åa™Xƒ±VÅw@±Ġ¯@»™š™n™Wmw@ƒ™@¯ƒVƒUUWçƒKĉ„a±VkkƒV¯w™x@šUJ‚x@bknÇb™mÅ@Uw±U¯¦UŽ™Kmš¯I¯Žť¼ğĊ™@ǃŹÈ¯@Ý»ÇnˡJƒbÛèÇnƒ„ÅK¯„ġĠŹW¼Ålm„@¤n²ƒŽÝb@b„š¯lƒ¯@ƒšÅ¤W„™¼nV@x„„°@Vx„@lbUblbX¼W‚œšÇ²lšUŽ@¼ŽV¦@bÇlVxUbVxÞbVšœbm¦ƒVV„"]],encodeOffsets:[[[100452,39719]],[[91980,35742]]]}},{type:"Feature",id:"6327",properties:{name:"玉树藏族自治州",cp:[93.5925,33.9368],childNum:6},geometry:{type:"Polygon",coordinates:["@@ɆÿĢV°°VÈklVôŤXÞW„ȮÇÞXnmÞnlaŤmĢLƐaĢƒôb„™ĊU„VlkǖKÜaœn°mĊUšVVkÈWV_ôKŎǚ@šz°ašbXyVI‚JĢwVX„a„KVbna°@VçVKXƒÜÞWšn@VVÆwXšĠƒÞ@Ŏ¯ƨġÆ@ȍ„LlmUaô»ÆkĊ±Xb„°`šÔV‚kȘƒĢ@Všk°šLlx@xż@Ċn„Çź»ôĢ²VÆ҄@@bÆÒXklV„KšV¥Æ™ČUšk‚l„nxl™çƒ¥ċç@±m¥ƒwÅJƒ@™™™Vƒ„mÈIléÈa°U¥™™@kÞV‚K²ÑWƒ°w²Ñ‚K²ñšyƐ„ÝšVmw„»kkWĉ—JWUƒVÅwƒL™mÅ@@ƒmw„kn¥Vу»°™°@@»„¯„Lla„JônV‚UůƒU@W¯Umѯ¯k@WykU@¯„wV¥ƒkVwţƒk»šwWǜĉĶçšK„ƒÞ™ÇaĉbƒI™lUƒ@kwƒWƒXUƒ°w™±@UšKn£Wĉ—KWxƒkĕVƒšamwXw™@™„Wmnk@aƒVkƒ™bĉLƒl™Imm„wUÇ‚Wx™nÝJn@¥Æ™kwƒaXƒÜĉ™¯ÅV¯¤mkƒx¯kķܙ²VWôŹVUƒƒ@V£™¥@ƒ°wn@™m@¯@UbUôķŽmn@ÆÛ@ÇýVaUÇĊVƒ@Çlğ—¯xÝŤ™lVÈÈVƒx„ƒ¤Vx™„kK@™@ƒx@„kVƒĖġ¥kIWbXŽŎx@nƒxÅUW`ƒ_—@±ŽUa™LUxƒK¯„WbkVlb—bmŽƒLÛÆWIUwƒWkwÝV@kI›ŽéUb›UUk™V¯Km¯k@Umݐ¯m¯›m—L›Þĉ‚ÛUm™ġ£UxkKm°™Lw›šk@kšƒVm„ƒKVUk›@¯a¯Ģ™móKUU™x™ImlÅn™™ÇbXèVVU„°„@ŽšŽ@„‚xXnmš™ššŽ@¼ğ°@²ÆxU‚„²šWÆb°š™š@¦llš™„XLmĬ@҃šÞô°@ȦUJÇaƒLóU¯š@°ġƴ@Ɓ@mɱJğ¼ǕššÒUzƧ‚m„n›mğ°ǫ¼knÇ@bġmmV—@VaUaƒLƒk™l@„kLW‚ō¦¯@ƒb™KUn™JĉIó`ċUÛb™wUw±ax›bñUmƒƒ@™„ƒ@—bƒaƒbǏÅXm˜„ƒÝ„ÅôVbގ™bl„UšÞVޚ„U‚°„VUxƒ@U„V„@l`™¼nL@Ċ„LW„„¤kXķWġXUVVVķ„UbVb@°kVVxÈa‚@ȦĊbšaźJ„U@Ț„„˜Vœƒlš@XkôaWƒĢ™Þ@laĸUÆb²mÞLĠ™ÞÑôbšÒĊa„JVbm¦"],encodeOffsets:[[93285,37030]]}},{type:"Feature",id:"6326",properties:{name:"果洛藏族自治州",cp:[99.3823,34.0466],childNum:6},geometry:{type:"Polygon",coordinates:["@@ÞVŤ™ÈK@ĀlxV@„Þ@„wŎalmôLšnXÆÜ@nV‚°@œ„°WmVKŦLÆmȚԂҚUX¥l@ĢJVš@„ŽƾI@w™W°™™Ån¥›kÅÝVwôƒÈç„@lÑĊĕša„JnaÆLVw°kny°UnkÆVȍĊll¦„Vƾ@@™nUźƒÈǂIn°X„wÞKô¦VWV£„@£°ókċ±I™™am¯Va™»ČĉV¥°™@m„k„¥l@„Ċm@ašU™mwXƒ@wÆxšmĢ_„`VnÆbšKVw„@@ƒnUVğVmVVöIlŽl@@çÛmƒ£UDŽw°@VUƒ¯»m¯ƒJōĖÅLƒa@»ĉĢ±`U_k`ÇçšóƒkX™lK@ƒakÝރš£WċkÝ™kxƒJݯÅw™xķxmIÅx„@k±J@ýŋš›¤UœkŽmV™°ÅÝxkwmġƒnÝVU„š¦ƒŤlmšóXk¤™UKƒç™@mVkK@klīƒ£mš¯VUbƒW¯¼ċb¯ĵam¼mVX„m@k¤ÇX‚ÇbƒUƒ„¯J¯„¯È@˜™bVXVҙ¤V¼kxݚV„@l‚V—„WxÛ¦Wš¯šmKnlŽkŽ‚šU‚@nƑUĉ„Ý@ǺۄċUĉ¥™UƒÞŏ™z±òL±Ò¯xX„±ÒLÝU@lššV¦¯‚ÇbkêÇJƒnU„šš@š„‚ÆI„xn¦‚‚@²Č脦‚è"],encodeOffsets:[[99709,36130]]}},{type:"Feature",id:"6325",properties:{name:"海南藏族自治州",cp:[100.3711,35.9418],childNum:5},geometry:{type:"Polygon",coordinates:["@@VxƒŽńƒš@ĊĠŽĊXÒ°UƾĕÞm°£nb@‚@LUUW„Ûº@nlÆǬšĠ£ÞV°UXb‚VȂǵ„éƒ@kWanm°@™x„z„K°¯ĠVšƒVƒkw™Lnm°kÞxÆa„¥@‚wnĉƏ@™œ_l›š_VwšmĸèŤÅČU@™˜Wn@ÑmKU™nğƒK@ƒ°¯UÿV£nmšLl™„UƒUÛé±óókkmƒnƒakV@Ç°óÝXƒWəÞťIţxmm™VÛUVȂÓnWyȁĉkƒVš°WnkĊa„¥‚_œK°ÿWna@ƒmU¯wƒlÝIU¤UXó¥ÝLƒx¯WmJÇÈŹ„mV@šƽ@ƒUk¥ĉkċŽÅUml¯Vmz¯lUxÅKmbƒI™bĉĖk҃@Çèó„UxÆޜlm¦šÆ¯ššX@x™Ž@Ž„²ÝlƒÈ™JV²klVl¯ÔlšĉƙްlUǖÞ@ššĶ¼nŽUôôŚ"],encodeOffsets:[[101712,37632]]}},{type:"Feature",id:"6322",properties:{name:"海北藏族自治州",cp:[100.3711,37.9138],childNum:4},geometry:{type:"Polygon",coordinates:["@@ōmġxƽUm±Lǿþġԙ@kxmWƒb¯I¯‚mIUx@bƒbŹVǎƒkĵbƒlĉI¯¥ƒUšm@ƒÆ¯È@šašóšUlƒČ»@w›œ»›wXaƒƒó°ţç݄kUƒaV¥ÅbÝw¯lmnšKlxU„™„ğU¯°ƒLƒyšw¯@mnXb‚l„@ƒêȁǶUWa¯VÝUğ¤ǫ™kÅ@mܹXƒVV@K@ma¯¤ÝnƽĖ¯V@„ƒ¼„ôlèk¼„¦˜xXŽlbnKšÆx@Ž™bUx@nnxWJţ¦ƒmƒ¼ñ@Ž°¦lUÞlÈ@ĠxÞUlxÒó„ƒl¯bmI™ŽÝVÛaÝnƒxVbkbÇwřÇKn±K™b„šƒb@V„xšLmŽÛŽŻbk„ƒVó@™šŹxó²›Wkb™@¯U¤ƒźĊ@lUX„°lÆôU„ƒlLX‚aœV°wšxUb°xÜôÈKVkÈmlwškÈKšwšK™™VUŤĉŎ»„»„Il¥na°LV»²¯Üy@wĢƒ°ĸwlwĢw°±„_lVkš@°ƒbƒÆ¯zƒ‚„š„@l_„@Ģ±lŚVlUaރ„LVƒnKlnȏ°IllČa˜wÞÑ°x„UU™@wƒVkmĠLô»„KÞýôaÞ¥ôĀÞmƁ„™‚mUƒŎV¥Èl°²°a²¥V„@@w„amm@Ñn@Æ£żƒVƒĠ£@W„¯Þƒšl@š»@Uk@"],encodeOffsets:[[105087,37992]]}},{type:"Feature",id:"6323",properties:{name:"黄南藏族自治州",cp:[101.5686,35.1178],childNum:4},geometry:{type:"Polygon",coordinates:["@@ôl²ôÜê„VƒVkš™KmnU¤VĀ¯°@„„LmĠVšnLÈL@alb@al@n°Vš_XmWUÈamaVIn@n‚aV£œóVWƒ™U£°ašxÈ¥@™‚aĊwȹ@óša™ƒğbm@k„w@mƒaÆw@ƒ„In¯mmƒ@UkkWƒÑÅ@@kċÅçVkÝJÅkVykŹl¥@¯š™ĢU܃X¥òý—mmX™ÝÅlmU@£™Wly™XW»Åbƒl@aI›»k@klm@UxUUƒVƒ¼¯Xƒl™aUnķ‚ƒI@x™@¯„ƒK™„ĉUU`óšlČ¯ô@¤ƒÞJ„k°xVŽ„n@ŽmbXŽ¯Ā›L`ƒ¦ĉbml¯X™ŽUŽl„ȂĊXzm‚ȁÔU‚ÜVšUnnŤwŦJɚ݄XÞW¯ô@ÈlU„b„mln"],encodeOffsets:[[103984,36344]]}},{type:"Feature",id:"6321",properties:{name:"海东地区",cp:[102.3706,36.2988],childNum:6},geometry:{type:"Polygon",coordinates:["@@@҄bš¤ÆI°ôU¼š°UŽnnWx™š@b¯L@lUUWbXxWl„ƨnxVUllš„XVŽUŽnL@lȀý²KVnƾ‚ĢwV»ƒ@mÞ£nÆƒÞÑmL™ƒKUaVżĕƒWVk²ƒƒÆÝ@ƒXw°@„ô™@a°wóUUmIk™™aVmÞwmknyƒ¹VÿƧnŏm£X»˜™naV±„Ýw@ašb@aƒm¯„ĉVó¦kÝWKUU@WanU™b@ôǺĉxb@šÇ¦™w¯bV¤„šUX›ôU¤bmm@UJnbÇbXVWn™`¯Umk@@bka@bÇK"],encodeOffsets:[[104108,37030]]}},{type:"Feature",id:"6301",properties:{name:"西宁市",cp:[101.4038,36.8207],childNum:4},geometry:{type:"Polygon",coordinates:["@@@kmKVUƒWk™VkUmwƒƧXkWwXaVV@k°K@aš™XwmmV™¯V»¯óÅJ™£ƒamŽ—X@šċVţÆķç™nUx™`kœ›`@šÅmĊx@Žƒ¦U¦„blVރŤèô¯„„Wbœx›¼œŽ@xċ¼k„™V™ô™bÇ@Å°@„™n„V°¦ĊJ„kĶa„lȍźU„a@aVwnJ°°J„anXlwš@ĢÓ"],encodeOffsets:[[104356,38042]]}}],UTF8Encoding:!0} +}),n("echarts/util/mapData/geoJson/shang_hai_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"310230",properties:{name:"崇明县",cp:[121.5637,31.5383],childNum:1},geometry:{type:"Polygon",coordinates:["@@uŏu»GPIV±ÐɃŜ{\\qJmC[W\\t„¾ÕjÕp‡nα|ěÔe`²„ †nZzZ~V|B^IpUbU†{bs\\a\\OvQ’Kªs†Mň£RAhQĤ‹lA`GĂA@ĥWĝO“"],encodeOffsets:[[124908,32105]]}},{type:"Feature",id:"310119",properties:{name:"南汇区",cp:[121.8755,30.954],childNum:1},geometry:{type:"Polygon",coordinates:["@@`y”ĉNǕDwǏ»ƒÖLxCdJ`HB@LBTD@CPFXANC@@PGBKNECCBB@EBFHEDDDSNKAUNBDMNqf[HcDCCcF…@EFGLEBa@ACoCCDDD@LGHD@DJFBBJED@BGAEGGFKIGDBDLBAD@FHBEF@RFDMLE@SGANFFJBANPH@@E@FJjRIACDMDOEKLFD@DbDAJI@AP@BGHFBCBGDCC@DCA@CECGH@FKCEHFJGBFDIHACEDNJDCVFBDCRKRLDLITB@CjNJI^DBCfNVDHDFKHAFGDIICDWBIF@@CFAjFJNJBBHD@CJ@AEFJ@@DH@BFBCPDBMFEQGDIFCNDHIP@HDABFACBJFHEBSZC@DP@@JDBƤ~"],encodeOffsets:[[124854,31907]]}},{type:"Feature",id:"310120",properties:{name:"奉贤区",cp:[121.5747,30.8475],childNum:1},geometry:{type:"Polygon",coordinates:["@@~T~JjZdDbLXDLCB_J@@FHFZJJIAGH@HGR@BENBLID@@LFCDF\\FpDBDb@FAHKFE†@dEDDdC\\GreNMACVMLBTMCCFCEGFAA@DAFDLMHA@OD@BMEWDOC@AS@KGAI_DcKw„ÕísƝ‘åĆctKbMBQ@EGEBEJ@@MBKL@BJB@FIBGKE@ABG@@FMFCPL@AjCD@ZOFCJIDICIlKJHNGJALH@@FPDCTJDGDBNCn"],encodeOffsets:[[124274,31722]]}},{type:"Feature",id:"310115",properties:{name:"浦东新区",cp:[121.6928,31.2561],childNum:1},geometry:{type:"Polygon",coordinates:["@@EN@JJLNHjLJNR^GRYVBNZJRBV@PDvbLNDN@LGNER@nCNQNuT_TIVFV\\Z\\XnDrI|[Ʉś²ÏJUHOƣ}CA@IO@@CYDATGFIEDAEBBAGCO@GJMCEDCJRHEFANOCADAEG@@CI@FE@BDIC@AGIAIMiEEB@DE@AJCXJDCJEHGBELGCUCeMAD]CIJiM@DSAKJKCLQDQACUECDMIFCBDJGECHAEIWCK@GLMCCGEACNKCEJG@MMBMC@@CIJUINT@JAJSTEPZZCP"],encodeOffsets:[[124383,31915]]}},{type:"Feature",id:"310116",properties:{name:"金山区",cp:[121.2657,30.8112],childNum:1},geometry:{type:"Polygon",coordinates:["@@L@BIHFN@@EE@@EFBDGDAADVDD@@EF@CA@IIsRE@GDAF@BF@CV@|FBCHBLCNHAFCADBMDCFZXHILBVEEQA@MWFARJJ@DCX@@TEFBLHAAERE@AJABRPBNK\\BrJ\\VHGND@CNADKDADQjGAGNC@GJ@FCFFHC@JF@@dLBDSFADHVG\\DTEPDDHJALIJkJDJCDIPE@YDCBiK@DONE@EH@BAF@HLJA@EIA@ALKNA@@FIFAFHR@NALadsæąyQY@ƒA±DʼnXUVI^BF@FFF@HBJEDFFGFEBSRkVEXGHFBMFIVW@GAEEFOIAIPKABGWEKFSCQLQBSEIBC\\FdBLRR@JGACFDDEF@AWB@LJJYNABBA@CUEGPaO_AIE@MYMFIGAEFECHSAAKAO\\[JEDB@E@MMA@@AGBKMGDFFCDDFEDFJF@NPBAFLHFH@EDDHBADDC@DDCDHHCDDFDABDAD@FEFOBCJ[D@HEDDNJBDDHABJIBBvGLBJAH"],encodeOffsets:[[123901,31695]]}},{type:"Feature",id:"310118",properties:{name:"青浦区",cp:[121.1751,31.1909],childNum:1},geometry:{type:"Polygon",coordinates:["@@RUNKdOFDJCbRFMLAHPLDN@JGL@@APBWYCKN@TU@SHGCEJIDIJKVIZVNM`iNY@CIE@CA@KBOEGEUFCCSADEIEFCDDDIDDHC@CKIeDCG@IG@DHWFEEGCH@@GO@@O]CNpeEQDBFME[JC]DGF@CKOA@QSB@GB@@GW@@ED@AQIJIAAFE@@DO@CFI@KNG@CDACAFEGKGBEGBDCCAIFCCLIECFI@MBCLDHGNAHSF@DMB@EEKBA@@C]DEICFG@ADBHGFKCDAKKHKD@@FHGAANGEEFCHKCECBCKG@ADKCNE\\[A[I@@mGBDQQEO@BCE@AI[AML@JGACLOAFKEMM@EQKC@CUCBCCBCHEA@FF@@FM@GEAJK@GNF@EXPH@FD@M^@HIADJCFDBER@DK@@DE@CAKFOCCBDHIBCNSB@GFC@GQEEOWFICGDUAEJIDBTAHJHEB@DIF@NE@H|HBDBEH@DKBAHEF@HEEUB@FGFGCCCE@AHOB@NH@PRLVNNFBX@RC€PbAvMtBfH@DJF@ELBFA@EH@HNED@FFB@HLC@CJ@@DJ@PIRf@HE@CFF@GPHD@DKE@FFBEFFD@DEFCA@DD@IjCRFBAHFDKD@HF@@PM@H@BlbDJDBFEF@DLXB@HCD@@IFCBIFEJD@FDC@FBALLF@PAACJERACAJCBD@EL@JD"],encodeOffsets:[[124061,32028]]}},{type:"Feature",id:"310117",properties:{name:"松江区",cp:[121.1984,31.0268],childNum:1},geometry:{type:"Polygon",coordinates:["@@@DLDFRN@FNELPBDKHB@INK\\BBJF@ADP@RFCRHA@nJ@B\\[\\MFLDBCH@DLDADFGLEDFFMHBBGH@EC@GLLLCBLDHEAGBCH@DEFJ^C@DB@LAFFA@CNE@GTMBGHKCAD@NEJFDKJDDJEDBCDHAAFLHFHBEBDDCH@LMJ@DEP@@CF@BEJBJIBRC@@FX@@HA@@HTA@RPBDLE@CHD^\\INFAERCfFMo^D@PP@@HG@HDFFXECGH@@JDHfCLJ@DGDCCCJCCEDJFCFTBDDVEHFPFLAB@NBFCFKFC@CHIACNOHWHCAAFIDD@CDAGEI@ACFMF@R@R_@GQED@EGFEQEDE_IAHKAEXCQUOQCUDEN@ZI\\DDmAMHCICDSOC@EG@BKHIGMIBCGOCSF[CUHCGEBCTKA@cE@@IGDEEEDI@@HMDBHiHCRCBCLMB@DMCGH[UqI[AMLOAAQIB@BQFBFGBAKFE@SW@CDI@QIEBNXB@FRUFKAGJYWDENCCADBBEMGKDGAAD{EU@@DAEE@CB@HQFJt@JDBE@@FC@"],encodeOffsets:[[123933,31687]]}},{type:"Feature",id:"310114",properties:{name:"嘉定区",cp:[121.2437,31.3625],childNum:1},geometry:{type:"Polygon",coordinates:["@@F@LI@IDKJADKIEJICADGACFECCJ@HKCAFOHAJI@aCBEE@ICAEB[GFGCKL@FGEIFADMLCAEJM@ELQECEIG@BE^QKKLQCA@EHBIGQ[GEHOMGGDHKH@JOECFCjCBEFDNCACMBCILGTABDLEEOEIG@GFIMM@CGKFBFCDE@@GEAGEEACIcGaHMFITIHDN[AKF@FS@OA@BK@IHM@KCGOKBENaQIDECcPMLQVFHFB@BFBKLGD@FAJOVGIACQ@A`LPCB@JEF@RU@ANS@@RCL\\HIFpRBFRBBDKLLDADJDGBFDABHBEDNF@DGBBBADKDAHC@\\JJFBDEH[DEFDH\\LX@XLBLbT@DNJLDCEL@VJABJNDHB@HBHYFBAA@GNFB@@AFB@AFABFLFBHFCL@HJBAFBLC@DN@HN"],encodeOffsets:[[124213,32254]]}},{type:"Feature",id:"310113",properties:{name:"宝山区",cp:[121.4346,31.4051],childNum:1},geometry:{type:"Polygon",coordinates:["@@ˆmÖoÖiƒ½[s[YEUJU`SCIEBCCWJY_LIICDWU@@FaBCJIB[ICH[@@CDKEE@MK@@IMCAEBCH@AMFI@SMGEFGB@FK@BHCAIFJNQD@FEBDFMBKGACG@ECWH@@CDDTOEEBGEK@GC@EE@GPHFR\\JHGA@FDBKRLL]RAFH@FJFDKR@FINBFKDCNEBFJEHK@DLEH\\HFADB@JFFDA@bIJGBEPDBGLI@DDEFBDCHDBIJJFCLIBCL@JKJE@ADHDBHJ@HIBBDFHBBAEIJ@BJFAVL¢ˆ"],encodeOffsets:[[124300,32302]]}},{type:"Feature",id:"310112",properties:{name:"闵行区",cp:[121.4992,31.0838],childNum:1},geometry:{type:"Polygon",coordinates:["@@T@@ELE\\BCMJGJSNEbGdHDJFBJAFIEIFCEWG@@gMENSFCVJFAxR~B@IH@AIiI@GE@FGEAFQPDRiV[\\DFSGMHAXHDOMCJCDETBBNVJJI@DD@ANNNH@FILDDMFBDHNDHKL@XDFGLD@EHGFD@DDB@CDDHCDAEAHG@ABOJ@BIaC@CECLKPFNCDCJBiQEIF@@@OGBMIAEEBMTHF@NKEC@QFEGA@EBCKAACHCLJHEFHHB@AFCAIEACIC@HG@KCCDC[ECEED@KC@KJMAAFQ@GHG@BHIJYIGE@EI@A`KDWCaKcCiY}I}S[CYJM@CFDVPRRVWDFžLBBG`JCFRFEFFHC@RF@HQ`Q@E@ENBDJ@HFCB@DCCEJBBGDGXMPBDGJ@DEDELEDMA@DJF@DMZ_jMNYUUJILCJIJDFGH@TSVM@DLXZ"],encodeOffsets:[[124165,32010]]}},{type:"Feature",id:"310110",properties:{name:"杨浦区",cp:[121.528,31.2966],childNum:1},geometry:{type:"Polygon",coordinates:["@@V@CXJDKJZ`XIDDFADJvSRMDM@mFQHM@KCMKMuaOCU@BDAJSX@HKJGD@PNJCJWAGT@R"],encodeOffsets:[[124402,32064]]}},{type:"Feature",id:"310107",properties:{name:"普陀区",cp:[121.3879,31.2602],childNum:1},geometry:{type:"Polygon",coordinates:["@@F@@FHDL@HFFAPFCSDC@@XGFDH@BDLHNACEFA@ERCIMJEDBAGL@@EHAFENHHJ\\ONQBQCIBC[MKACKI@GGGH@I_G@CW@[DMHCDIBMTDHN@JNHEH@FJFPKFACSBKHDJNABDMDECAFiDEDFDIPG@GLHCNH"],encodeOffsets:[[124248,32045]]}},{type:"Feature",id:"310104",properties:{name:"徐汇区",cp:[121.4333,31.1607],childNum:1},geometry:{type:"Polygon",coordinates:["@@RADL\\NCPHFfLJaJ@FWLGMGIK@IFMDOYYFOTSBI@IMSAMSACFIDNDCPWGGBHNET[CU\\QjOCERFBEHF@@HjJBJG@@J"],encodeOffsets:[[124327,31941]]}},{type:"Feature",id:"310105",properties:{name:"长宁区",cp:[121.3852,31.2115],childNum:1},geometry:{type:"Polygon",coordinates:["@@HFFB@HF@DCAELENSJADCNG\\CX@@D`H@JHGHHJ@BINBFUGEDO[MCKQB}AwQEBUIEDMTNF@hH@FXEDFJEJIB"],encodeOffsets:[[124250,31987]]}},{type:"Feature",id:"310108",properties:{name:"闸北区",cp:[121.4511,31.2794],childNum:1},geometry:{type:"Polygon",coordinates:["@@CSG@BQGODUPWTOBQAAFMECKBGEMFKEOHADDJARMR[PGI@TEJBNG@ADBFND@JL@@NFFCL@D\\@DG\\JJADI"],encodeOffsets:[[124385,32068]]}},{type:"Feature",id:"310109",properties:{name:"虹口区",cp:[121.4882,31.2788],childNum:1},geometry:{type:"Polygon",coordinates:["@@bA@E@QHSXBDIMI@OHCLI@GTWBIACQAYIOFGCENBBARSPOXCVHPARH@DT"],encodeOffsets:[[124385,32068]]}},{type:"Feature",id:"310101",properties:{name:"黄浦区",cp:[121.4868,31.219],childNum:1},geometry:{type:"Polygon",coordinates:["@@NEHFLAFDHDPEAMZUHQQ]IMKJG@EPERABHBGRUCCNGV"],encodeOffsets:[[124379,31992]]}},{type:"Feature",id:"310103",properties:{name:"卢湾区",cp:[121.4758,31.2074],childNum:1},geometry:{type:"Polygon",coordinates:["@@VDHQGABAFQFOH@LIiKKHEXI@IbAFZB"],encodeOffsets:[[124385,31974]]}},{type:"Feature",id:"310106",properties:{name:"静安区",cp:[121.4484,31.2286],childNum:1},geometry:{type:"Polygon",coordinates:["@@DLLB\\NPGLFHUDMYABEeKEVMAAJ"],encodeOffsets:[[124343,31979]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/shan_dong_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3706",properties:{name:"烟台市",cp:[120.7397,37.5128],childNum:9},geometry:{type:"Polygon",coordinates:["@@ŤLšLllVń²è°xżĢĠÆl҄šŤbœ„V¤ĊXnŽlĢVĊ„Òš„È°ĊŰÞè˜L„±@џn»VUźċ²»ÆkôVɆkĊŃ²kŤVVwUUVmUaƒ@KkU@ƒmUmmk@UwUkmW@UVIXa@ƒmw@a™KULƒaƒx@Uk@UbWU@yULmK¯@kXƒVUwm@@JUUknWKUVƒLUbU@™wWykIƒa@w@mUI@ašUVynIWa„k„@@W„bl@@knmƒK@wnIl™°Kna@V¥ğ@ġUķ»™¥@UōJƒX¯¤k@™wmI¯‚k@mwƒak@@šlX@bUJ@VƒbknWxkLkxlŽšLVlkLmŽšb@bU@ƒbU@VbU`Vb@n„L@Žmb—U@˜VnUVmnU@mm™@kIUWVIUK›VkkUJUnmL@VmLUaVWaXamU@™™U@KUUmVƒU—JƒU™VÇwğn™mƒ@mXĉV@l¯xnô"],encodeOffsets:[[122446,38042]]}},{type:"Feature",id:"3713",properties:{name:"临沂市",cp:[118.3118,35.2936],childNum:10},geometry:{type:"Polygon",coordinates:["@@˜bXlƒl@zlV@lXXmŽkbVVlš„U@Vn@@Vmb@XšKšVX„WJ@XXl@„‚ŽÈbVLšUl`„@XXV@VVUxVbUxVbš¦„@‚WnXVJ@bnVUzl@„°Æx„U„KlU@mUUnUlUVWVUnVV@XX°V@Všll@Vk„aXVl@Ux@bmbXLlKlb@b@bUJn@@„„b@n°x°K@an@@UlLVKVbXb@bVVnK°LVa@UVa@™Xw‚KVxnLšU°@naV@UWUkWƒULmV—wÝKUUla@aó_@mƒK@aUU@ƒWUkwVm@aVI°W„@@IUw@a±¯@¥kUVUm@a‚wkw™@ƒK@kVKk@maXalI@alL„WXblaVLVU„V@LnKš@„l@w˜aXašLlnUl„LšmV@n°J@_VmnIVym£UKmI@WnIVm@anUVmÇ_kġIÅWUXÇm@U@ݯÅ@ƒ™@naWƒ™IVW@IkK@klKn@naWIƒmk@ƒaƒbkKkLWn™WkLWmk_ƒ@UaVƒUKmLUw@mn£WwUmU™ƒaóV@UkUm@UKULUwmJUX@WW@XҙzVblJXŽWXk@UVWK—X‚¤UL@xU@ƒ@ƒVUaU@@XmVkLmWkXUyÝLmKXnVŽ@n@l™x@bWLnVVn™`knULmxUl„„WLXŽVb@VƒK@z¯x¯¼Wx™KUn@bk@ƒlƒVVVz"],encodeOffsets:[[120241,36119]]}},{type:"Feature",id:"3707",properties:{name:"潍坊市",cp:[119.0918,36.524],childNum:9},geometry:{type:"Polygon",coordinates:["@@l@@UšK@Ž@L@bX@@VlL@JƒLUVnX@`ÜXn`V²mJ@bU@@n„b@l°xnnĸVƚ°@„ƒĊ£Þ@lWnÑnkʶJmó°w@kk»V@»ƒ¥k@V@kw@wVm„a˜Å„mšaô£ŎƒXI@mln„Kla@mV_UKƒ@kUkw@alW™IU»™mƒ—@WUIl±UUÅU›bkJƒ@a@wUKUaVIÆmXIWaka@m@Ul£XKVw@ƒUIƒJUkmJ™ƒVkU@a„ƒWK—ImVƒ@UxmL@bX`WXU@U`ÇkUak@@°UblXk‚mLUKmL@VULóƒƒVk@@Vlbn@Ub@ċaUJUbƒIUlVLUVVbVKX„VlVXU@mb¯@™VmKUwLWx@šUb@VUb¯KmLUU@aWaUaULkK@Vm@@b¯L¯w@mƒa@ƒm@UUU@U¦lJUXƒVƒmkb@nm„XVWŽkb™IVxUV@VUbWLXVƒLW`Ux@nk@Vn@x@VkJ@œV`mXkŽ@V„xV@lVššI@VULš˜VU„IV`°bVXXx„V@VWVnL@xV„Ub"],encodeOffsets:[[121332,37840]]}},{type:"Feature",id:"3702",properties:{name:"青岛市",cp:[120.4651,36.3373],childNum:6},geometry:{type:"Polygon",coordinates:["@@„@nU˜JXLƒ„@blVU‚š„nIVl„IVJ@„UxWLk¤@V@nlbXbWJÅnUJVbVL@x@b„ŽlIœaÆVVVk²VJ@X„˜šnV¼šJkX@blxlV„@VLU`@nkbƒLkm@nWJō„ó¤™bƒn—ƃbUn@xlxU@l@„¦@¼UŽl¼ĊUnW„@šnĠmÈxšU„V˜I„VnUVV@LšV@šnVWbXb‚UVbnK@UnKVmVIllœUVLUJVXlJš@nnV@nmVUUm@—˜Vna@ƒK@mUaV_UaV@„aV@@a™anlKUk™KklwlKXwlm„a@UVI@akW@™l@„bnxl@°nJšxl@°£„WŎIUÑn»lašmô¹Ŏ¥VaUUkƒmkġWɱIUUŹ`›@kk@ĉƨřV¥_Ç@™Ĭƒ¤ÝL¯m¯£ƽóķwUW±ī¯kōaĉĕ™kğmó°ƒbW@UKkLUaƒVmz@V@ŽUxVn"],encodeOffsets:[[122389,36580]]}},{type:"Feature",id:"3717",properties:{name:"菏泽市",cp:[115.6201,35.2057],childNum:9},geometry:{type:"Polygon",coordinates:["@@@¥šIVUÈmÞ»@UlU@Un@VW@UVmkk@aVUUKVÝ@UVknK@UV@VVnIVƒ@wnƒmwmKXaWaXI@UV@Vy²blkVKkam™U@kb@Um@VmUkmƒKmkXKWwkU@Ulƒ@UnK@UVUUm‚KXwšUVL„w‚K„U„@@Wl@@wUkV¥—@@I@W@_V@VWUw@UUa@aƒaWa—@@_mKUw™l¯amzmV—@WK™nU@kƒWLķaUKbÝVmV@UWÇbÛ@ƒX™°UbW@XŽm„Vlk²UJUbmLÇxÅWUzl‚¯Ll„@VkK™XUbWJ@bU@¯@™ƒkbƒLmKka™„@l™_WšXºVbUz@J‚n²V@¤lX„Ž„nV°šLn`WbXLôVlKVUšxXn˜lXLlU@bVV@„XJWLUVnVV@„„@n‚l„°nn‚V„KÈbVXÆJU°VnXV„kV@@xVL„@šWlb"],encodeOffsets:[[118654,36726]]}},{type:"Feature",id:"3708",properties:{name:"济宁市",cp:[116.8286,35.3375],childNum:11},geometry:{type:"Polygon",coordinates:["@@nam_nKlVLXa„Il`š_@KVVXI@m@w‚ƒ„@@k@Kšnô@n`VbV@@L„L@KVVn@VX@‚VL„Jl„š@VUUƒU@Uam@Uk„wšKWaXamkJmIUVUÈblašUnV@kVKl@@lXL°kVJ@VÈnVJUX@V‚LXl@xVLnU‚@VK„V@a„IUaV@„bĊU„x„K‚kVJXUlV„ƒ„UVašI@WUI@KlUnw„mWk@WXIWƒ™U™L@Wna@Um@@UƒVk™UUlanWW@kkU@y„kWk—aWVUlÝbUU@kƒJUIU@@ƒ™JmaókƒLKǃUUkKWLk@WbkUUaƒbmKn¯°¥V@XwV@VanaVaU_@Wlk@WÈ@VUÈVVۂm„aklKȯlLVUX@lK@aX@@kV@VmV@VwnJV_UWUwƒX™am@kW@wVUkKVIUUVmU@UV@IVK@aUL@aƒV@Lm„UKmx@ŽômLkUWJ@šnXmlUxUL@Vkn›VUšU„@V™L™`Ub±LkV@kUKÇbÛ@ƒU™Wó_mJƒ@Wk@@Xƒ@ƒVLƒxUK™VWxLVnUV@VmL@Vk„@VlVXxWLnl‚Ln„VlUnn@@VlaV@nšlbULkl±aUzU@@VWJXbWbnLnxm„@xU„mJUUU@@VmLUl@VUÞVLUV@bllUn@VUXm@@VkV@VݼÇnUV™J@¦nnƒlnVlL@„Þb°KVV"],encodeOffsets:[[118834,36844]]}},{type:"Feature",id:"3714",properties:{name:"德州市",cp:[116.6858,37.2107],childNum:11},geometry:{type:"Polygon",coordinates:["@@„¤@VmbVXnVVbVJššX@Žll@z„lVInl@„@bVxUbĠ‚l@Èbla„IšxXVWb@L™@n‚ULWVXXšWWLnL@`@LUVVL@lVn„JšU@UUk‚a„™nš‚Vôô„b°¼V‚ސXš˜‚œIÜbČa˜bôW„XÞWÈzÆmnLVJ°ÈnlV²lbnW@™@UƒUV™šmnwmkkKWƒkla@mVIUKUa™aUwmn™JU@@amIk@@bVlkX@mmUklUUƒƒa@_UaUUƒV@wƒw™WkXmW@I@WUaÝU@UXaWUU@UUVW@UUUWUn¥nUVa@m@k@alU@wk™LWa@UUm@@wnmU™wla@anKn_@alK@ݙ_ƒ@@WUUUmlkaƒIƒyU@UwU_Wa¯yU_mWUwkImm@InWWUk@@UVWV—kW¯U@VƒL@b¯b@l±¦@šVV@lUbV„@škxVnUšl¼XV@b@lV@nIWxnbƒ‚™@UU™LƒxÅxm¯ƒaUƒ™wU@mUÅVÝKULm@bmKUXó@"],encodeOffsets:[[118542,37801]]}},{type:"Feature",id:"3716",properties:{name:"滨州市",cp:[117.8174,37.4963],childNum:7},geometry:{type:"Polygon",coordinates:["@@Vb@`„bV„kVlnV@nlWUk@al@nJ@bV@šInmVxšbVbVLUJ@nkb‚lX„lLnlmx™nUš„V@V@šmXn˜lbĸ@nnVx‚b@lnXV@UJ@nVxšxnxVbÆVn¯ƒĕ‚@@wÈçUÇlķVIœb‚@„Çmk@¥k@UkUK@aWakUóJW_UW@wkkWK@U@Kš@XUƒƒUkmUUalKXala@U@kkWlkÈl@kšV„mVIVmU_‚a„ƒƒwnwVW@wƒwUƒ@wU£ƒwkJWIyUI±bk‚VUJ@nmV™Ukl„Xmx@lnbW„kVƒUkLWŽƒxkKUUmUkb™J±—LÇxUKmkUmkkW™™a„mUaVkšJÆ_²KĠ@U„W@w„U‚¥nUWwK@aÝUkÅVaVK@akLWƒƒƒ¯I@bnbVx¯JW„ñšWbUL@šƒŽnV@VmbkUUV@IÇak@@bWak@WJUœJWL@bXV@„‚@„V„Jlb@zUlUŽUImšnbV‚mz@°UV@V™bV@@V@L@xLmKUnmJVX„J@VkLW@UVUL@b"],encodeOffsets:[[120083,38442]]}},{type:"Feature",id:"3715",properties:{name:"聊城市",cp:[115.9167,36.4032],childNum:8},geometry:{type:"Polygon",coordinates:["@@ô@VWnL‚an@VKÞLÆUnVV@šxV„„bn°Æw„wšKVVš@„maXwmJU@@k@aWUk»V™Umlw@™UƒVa@kUU@™²¥@k°a@a„K@U›ƒU@mmm@ów—ѱ¥¯@@w™Kmw—I›¥kU¯UmakJmIUaƒVkKUkm@VUUa™Uƒ@UaƒKUK¯@™w™UVŽUIUKVw™k™¥™wƒbVŽ@xn„@lWnXxlL@`„XlJX¦l°XxW¦@¦Ul™n@Ž™@@Um@@VXVmx@¯bllUnUJ@VULVn@b„xV‚VL@b„„VlnVVblV„ÈnVlIVJœLô„lJ@xl²„"],encodeOffsets:[[118542,37801]]}},{type:"Feature",id:"3705",properties:{name:"东营市",cp:[118.7073,37.5513],childNum:5},geometry:{type:"Polygon",coordinates:["@@ͬUǪlô@°Uœw°ōĠ¯š»Ģ炻XÇ@w™wƑa™ÇƒkwVƑ¯@řķUmm¯w@kƒa@mV@@anIU±m_ÛW@_mWVU„K@IkK@UW@@a@K@™L@Vk@±U@UV@lm@mUU@kLm„„xV¤@xV„„x@xUXmx„xƒ„bV`UnUJƒn™U@lÇkkllX@l@VkbWbkLVbnVVl„„WV™@@L@VXLll@xVXX`ôIlVXb@bVLVll@@¦nlƒÈ@›aUJkĸVÈÇè@x"],encodeOffsets:[[121005,39066]]}},{type:"Feature",id:"3701",properties:{name:"济南市",cp:[117.1582,36.8701],childNum:5},geometry:{type:"Polygon",coordinates:["@@²¦˜Òôxn@nn‚@V‚œ„°VlXU˜UX@Vl@XVmX@JnnlJVxnXV`°zXbV`VxV@„z„JlbkŽVnVV@X„@š`@ÞkL@bm`mL@bkbšxnVm@xn@VV‚@XbšKl@xkV@b@l@nUbmVm¦XVVV@VUXVVV@XVWb@VÞVVb@X@JnXlWšX„x@x„UVV@aVKVUX@lK@UƒIUWnIVmnL‚K@w@K@UU@ša@UVU@¯nyUman™VJVVk@ykaƒIƒU@@ƒWU@aXK‚IV›XIl@Xb@al@Èb@JVUlVna@UmU„@™VKXaò™Xƒ°IUwma@aU@UU@wVW@фw@a™I±`kbƒUkw™UmJ@UkmÇUUkmKknUVƒ@mJUkaWkƒa@KmKkUƒLmyXa¯_@WmImmbƒLmUkVUbUVƒJ™bƒUkkWJkUƒl™IUm™k™Lƒ›„lK@knaVmkI@mWaƒLUK™UU@@VmLUVLWK@UUUƒWUkkVmx@„Vl™¦"],encodeOffsets:[[119014,37041]]}},{type:"Feature",id:"3709",properties:{name:"泰安市",cp:[117.0264,36.0516],childNum:5},geometry:{type:"Polygon",coordinates:["@@n¼šŽW„nxšL@x°@š¥Uk@ƒnwlUVl„XVV@VXL‚KVUnK@UV@šVVL„KXb@nlJUnmb@lkLƒ‚„œšKšlVnšJ„klVXIll„Vša„IVUValUnV„K‚annnJ@X°`Wbnz„KlVnL‚Ž@L„bXl‚bVlnI„@VUU@UmVƒ@U@Uš¥@VmV@@_Ua@m°@@ƒ„kmUUm@UVmn@nX‚@@a„anJVUVL„mlIVJn@nkVLVa@KVmVLXVVLš@@U°bn@VaV@@K@aVkœbWaXUVymU@aUImWXƒ@™¥UaVwUaVwUUU@WWƒ@k_™VUKÇa@ƒƒnmxkV@LVJ@X™JUbƒVƒ„kUWVUIlƒLƒwĉVƒaU@VbƒJ@bƒUUL@mVUK@wWkK@UVWUIÇm@UUI¯lWK@kk@UL@lmU™VkbÇaUVVnJlIn‚WbXb™LƒxVln@VbV@V„UV™@kƒƒIUK@UWm@UU@LƒK@KU@Uam_ó@™m@L@lƒ@„@x@nWJUU@L™`k_ƒJWbUKkmLn`mb"],encodeOffsets:[[118834,36844]]}},{type:"Feature",id:"3710",properties:{name:"威海市",cp:[121.9482,37.1393],childNum:4},geometry:{type:"Polygon",coordinates:["@@VbUnVVUxĊ¼š¼ô@Þф¯‚WǬLŎUÆW„¹Uǃō¯ÑƒÝkţ™™ţóġ™óL™ł̥U™wm¥kÝmkkKóbÝ@U¦@‚mb¯LkšmJ@x„Lmn@lk@ƒa@Xƒ@ƒlXbmJUz™V@bVJ@n@x„blJXzšxV@Va„KVUXLlmVV@In@Vx„UlW°@nLVK@zXVVal@@V„w„bVKšL@bnx@„WbUJ@VnXVlVxl@nnnV@„lV@L„‚"],encodeOffsets:[[124842,38312]]}},{type:"Feature",id:"3711",properties:{name:"日照市",cp:[119.2786,35.5023],childNum:3},geometry:{type:"Polygon",coordinates:["@@UaVUUKVk„JVaVIČb@Vam@ka@Ul@„Uô„VK@UnKVLnKlkWVa@¯l@VbÈlV_V@XWW_@anKVwUmVw@@Uny„UVblKVLX@„aô¯ó¥mÛĊÿÈ¥š™Þ¹lUīƒ¯Kĉ¼ʟbÇV™U™ŽUŽ™XmakJUnmV@bUnmJ@XnJVLn¤UzmJUn@`¯ImŽU@™nƒKVkkm™KWb—b@xƒk™@mL@KƒUUVUKkbWaƒXkK@bkJWbnbl@UL@l„Lš@lxx@b‚nUVlV@¦²°@bVx@Jƒ@¯XUJ@bUnlxVŽ„X@‚VV@b„L@nô`@bkbVVÞL˜xnU"],encodeOffsets:[[121883,36895]]}},{type:"Feature",id:"3703",properties:{name:"淄博市",cp:[118.0371,36.6064],childNum:4},geometry:{type:"Polygon",coordinates:["@@nƒlKV@nVn@@kVU‚@²VVaUƒ@wmKXU@UƒUWwUW¯aU_ƒJUV™—VK@U™JU™@kUƒw@UlnWU_@›lI@U@wUml@@mVwX_„KWUXKVa@UVUUwšJlaXWUnƒ@mla„n„UVWkIV¥V@VVVI@a@akakLWKna@aVwk@WUƒbUlk@™k@U¯UWWU@mUUVUXkVmVVV@nkVƒLƒVÅwƒ¯k@WVXb›aUl@bV@@b@xkVVXVxkJ@nk@@ŽVLUlVb‚VXUVVUzV‚™LVbUbV„VWVkLmškJ@n±@UxU„VVkV@bƒx@ÒUX@xVVV@°J„„X„lK@bULUblÆÞV@b‚LXxmV¦ƒV@xƒXVŽğ@±LÅ`™IUlVbƒnšbXšllVnnlVLÈw˜K²ŽšIlanVVVlL„wXlK„VlUXƒma@knwƒWlkšVnU@mVIUl²aVJ‚zXJlI"],encodeOffsets:[[121129,37891]]}},{type:"Feature",id:"3704",properties:{name:"枣庄市",cp:[117.323,34.8926],childNum:2},geometry:{type:"Polygon",coordinates:["@@‚yUU„U„kl@@aVmšLXw°»°w@y„L@UUaWXKƒƒVknwVKlmš_UmmUXK@ašw@k@mUWmUL@ƒ@™@£@KƒbÝV@akw™aULmƒƒbUK™LUU@lm@—°mL@nUJVxVXU`mIUxU@UnU@@lW@@bkLW@UVkKÇ°kLlŽƒbnUÜÇUUVÇ@@Xkl@XV`UbmbUbU@WxU@¯¦m°nL„aVblVXal@XKlLVVȄ‚L„KôlnbšI@„V@VJ„I@lVVÞaVkXU"],encodeOffsets:[[120241,36119]]}},{type:"Feature",id:"3712",properties:{name:"莱芜市",cp:[117.6526,36.2714],childNum:1},geometry:{type:"Polygon",coordinates:["@@lmnLVlÈVln@VnIšVlx„Vla²_šJlUUUVƒVw²@@mlIn™lKXU‚UUƒVaUašKUVyUUWVUUaVkUK@l@@mlIUwUWlU@w@aU@@LU@Ubm@¯a@V™@UKWUUKUn@LUbUKmlm@UIkJƒnUKUVmIƒb@b@mWm@Un@VVnnVƒl@„¯@@nVb@`U@Un@Ž™¦@V@VU„VnV@"],encodeOffsets:[[120173,37334]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/shan_xi_1_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"6108",properties:{name:"榆林市",cp:[109.8743,38.205],childNum:12},geometry:{type:"Polygon",coordinates:["@@™ýVƒnIW»ƒW@»kUÇL—݃U¯¥ÇIUWWїUWwX¯mƒ@»n@ÜÈķô™@a±kȱƒw„ÑmwçċmU»ÆkkVyIm™ĉÿ@ƒÝ¹ƒWnwÇVš™Åaƒzmmĉ¦ó™kVmx™xU¼VškVm_UlVlk„°IV‚kmJa›¦k™™LmmV@XmKnšlUô›VXbƒbƒ@UaÇLğܙ™Åwƒ£mKnmċwÅ@UkƒbmaVƒƒƒn@m¯aU™Jm_k˜@kWXyl@@kÅamw™LU™Þ™ƒ™mWÅzUKƒš™Uk±@™b@nnK‚bX¤mzVšŽVxÇn„‚¯„@ÒknWƒƒVUbkķÈÑWkk@Va™™U@„mUkbƒÝÅ@Ý¥ÇbkĬ™XV`kLǍVmalUUa™nV±nwmkƒJ@Inƒ°KVw¯UnÅ@¥™ƒ™U±bUU˜±œmWbÛKWnUm`UƒVK@bmnœm‚Èż@V„L@xƒxmš„Ť°nŽ@VmK™²VlšlKk„ô@„êÜV@VXLlmš¦UššV°Ș¯²ÿ@¥š@ƁĊ˜²IšmĶnnb°b„KVƒĸLl„Þ@UȮš™Ü°IVƒÞÝސlŽœx@ŽķĀWŽ„Ux„èƐ@š°ŽXnšlĊĖ°m„nƒšV„²V°ÒƦ„aބ„˜@zll@bÞĀšlš¼nKĊ¼óȂb²±šIǪÒ¯ĖV@„lxnVlk„JlaXwŌĉ„„@VnŽššlÆĕ„UÆLœèŌŤôxȚlUœ@šxlaUċĕXm„IWmnkšVVƒ„VW_@aÈWUUmk@ƒ¯çVm»™±W¯n¥V™mkXw±ÇVwƒ"],encodeOffsets:[[113592,39645]]}},{type:"Feature",id:"6106",properties:{name:"延安市",cp:[109.1052,36.4252],childNum:13},geometry:{type:"Polygon",coordinates:["@@@kkÇmIšmUwVkUƒƒU²WmšVkm@m`mIĢĕUƒVa@™mXƒƒÿVVkyUýšĕ@l_UmnƒW„KVkţ™™¥™aƒwğ@™@aôƒ„ƒWa„kUmƒa¯¯™a±£kx™mmxUwÝ@xmU™b¯K™wó„Ý@kmm¹Ub@lklVbmnnVUV@x›UknƧJUX@ŽƒLÇWkw™LķƧÅwWJk„ƒLkþĉxWz™JUnǚkš@Ɛk¼ÜÔÈKšè@°lșÆk¦l„n@l¼@l¯L™°UU™VÇ°ƒ¹—`m¼mXk‚™bUaƒV@U¯x@¦™Ç™„UUmlmUVm„nnmlkw™@@šƒ¦Å‚ÇLmx¯Iklš„@¦mÆ°VUx¯Lm„@J„InlmxU²šmVbkV‚bUnȎlKU_šWlīÈaÞ¦Æ@„ÞlanV@ƒšVšUbl@XlÇÒĸlŽVa„UX„lm@Ñ°ƒƒÈmUw‚U™nyW£amL@mša²@lšV„™VLÆynX„šÝšVššKnxÆb@lk@WzXŽ@ll—n`šIV‚°b@n„m„„‚Unb„aVlÆ@ČxmnnL„¤ÆxššĠÛÈKVb„@„aWaœU‚ókVm™nL@W‚UnnšKlšœ¥‚bnIlU¯JlƒUkVkn`lUU™V»šwnwlUôšĊ¥nn„yÆb"],encodeOffsets:[[113074,37862]]}},{type:"Feature",id:"6107",properties:{name:"汉中市",cp:[106.886,33.0139],childNum:11},geometry:{type:"Polygon",coordinates:["@@lKnb@n„lWb°bkxĸwVb@ł„nlŽ„ƒĊ¥šL@XŽl™ÈƒVblÈK‚b„akVwôml²`‚nœ@‚nVKœl˜k²xŎƒ°¦VU„JĊw@çnWçރVkUóÛ@¥kwš™šUmƒX¯WšÑkƒ@UymIUwlUn¥‚mUk²a°¯V»@™ÝVș„ÝċÅÅVl»@l@a°±@_kammÅb™a@ƒƒm@ż™KknõĠ—@mšƒ„¯LÅw›‚—LVxmb@¼kV™@mw¯wVakKW»X±¼¯Vkxƒb„¼WŽ@nx@x±bóakbƒ@ÝmU™@ķÓÛL™kƒVUm™k¯¤ÝLUlÝ@Ýz™š„x@x™°™™™bƒmƒX¯aUJW¯—k@bÇWƒwÛwWxƒ@XWlb@Žƒ„VŽÈUlwšLnl°VlUô¦œU°¤VšUxVXUxlbkVVlƒI„°„ÅVlU°m@k„ÇU¯xUlƒLUlVL@b™°ĠInĠ°ÈnK‚„@xÞa²n‚aUyšXUKVkšWô¼Èa‚z°JXUVÇV_„JVƒšz@Žnb"],encodeOffsets:[[109137,34392]]}},{type:"Feature",id:"6109",properties:{name:"安康市",cp:[109.1162,32.7722],childNum:10},geometry:{type:"Polygon",coordinates:["@@„bĊaƨèšwôô„¼šb°ašXVƒÞVUÞ@‚aXƒm¥kImx¯¯ƒV@anU@UÇéğL@ƒ¯¥V£mƒ@ÝÈb„K‚™„X°wČÿ˜ƒ„b@xÈblxȯĊ„„mÆUVƒ„nÈ@ƨÜLĢ¥ƒŹnƒ°Vnn˜K„aô_ȃšwU‚aXmnW‚¯kl›LXƒÇ™ō¦ÝaÅVmbğUn¥±wÅéVƒan¥ƒ„U„»°am¥„£ƒÝ@ƒ„wVw™¥nU„уUmmVwmķIÅaóVWxkblb@ból@œğÒĉ¤ċXƒ˜¯X™xk„Ç@óÆÅx@š™xķ_kmݎǣkblb@`¯²@bk‚‚@k¼ÆUČƃÞǚÞU@šU¼¯°±bVlnm¦kVVxnJVz@‚l„™ÒXW°n„™V™šlx@¦ôÜVUl݄Xèm@è"],encodeOffsets:[[110644,34521]]}},{type:"Feature",id:"6110",properties:{name:"商洛市",cp:[109.8083,33.761],childNum:7},geometry:{type:"Polygon",coordinates:["@@²nl‚ôbš„°aVwnKÞIš`°wšXôw°VĊ°@ŽÅš„ÞÆV„zÞK@xšŽ@a‚LŚ@b@ŽnLlƒ@šln„mnLVw„a„bVƒ‚VnbU¼„Vƒ°„bl„šbÈ@ĶŦb˜@nÇ@amIyUI@ĠVmôƒU™ƒVwkwlanJ„¯lwó¥@an°Jš_„‚@š™nóƒó@£l¥UwmašÑ@ƒUm±V_ƒJ—£›J—UW¥¯@ƒ_k¯¼mUƒVUè¯b@wmL™»ğVmağI¯¤ċIUW™XƒKĵ¦ķaƒJUb™IƒlUóVmk@WÅÅÇ@ƒmU„ÅVƒnĉƒÇ°kwÇa@wƒa—„ċĀ¯xƒWšƒLÇa@Þn„U¤°¦@„ĠKÈê@VmV@b„U°°nwlJn¦W„bÝ@VŽ"],encodeOffsets:[[111454,34628]]}},{type:"Feature",id:"6103",properties:{name:"宝鸡市",cp:[107.1826,34.3433],childNum:10},geometry:{type:"Polygon",coordinates:["@@@ƒ„£@›°Išb@¯°ynŹƒaUƒlƒU£„Umšĵĉ@@ylUÞ@@£kWU¯WaU£¯ÇV¥ƒ@kb¯wƒn™¥ÇkUÇnUƒ@¯±›kULm›@m±_kŽónUxlŽƒbaÇLkŽUaDŽkšW@™Kĉ¦ƒ„kƒm@ŁUaķxlw¯aXaƒk@mmakL@šmšÛŽ@¼m„@l„XV`ƒn™KUš°°@²š¤UÈ@VxmôƒxKl„VV²aVw„Xla„Vlx@UVnŽÇnk°ƒVVL™lkI™šƒJÇk¯V@šknƘn@lznmlVkzVŽ„VVxš@Ux„z@x±¼VxxU„l‚kb˜@„¼Čk˜VXlĠkôV²w‚LUKlwœJ@a‚IV¥Þƒn¯Ün„‚„@nk˜l²kÆ@š°„aVbnI@™š‚Ťn"],encodeOffsets:[[110408,35815]]}},{type:"Feature",id:"6105",properties:{name:"渭南市",cp:[109.7864,35.0299],childNum:11},geometry:{type:"Polygon",coordinates:["@@@ÈôL„xUŽ°„Þ@mŽÈnl¤nUôL‚wX`@ÞÝL™ŽUšmLô„„ŽôbVbnºlnÞ@ôƒšx°LšanV‚wÞ@Vxnwšnlw²¤šb°°„bVnƒlXbƒ„ó„@bš‚Ġ@„xšbš¦ŤšV™Xġ„£W¥ƽɽƒó@ýóƝÝ»„£X™mƅšĊkUƒ„@™™šó„kťaĵŽÇ@™akƒƒa„¯ƒUV»maUU„ƒaƒbUxmKƒnkm@™k„mK@ƒxó@¯n¯KǦ@ôÅèlxkx°nƒƾ¯KU¯WķL@VÝIUb™yWbX¼Ç°"],encodeOffsets:[[111589,35657]]}},{type:"Feature",id:"6104",properties:{name:"咸阳市",cp:[108.4131,34.8706],childNum:14},geometry:{type:"Polygon",coordinates:["@@šIXyĊwlý„KlƒXIVaķƒ™»a›£„¯aVU@a™‚wÈō‚ašL²»‚VœUln°WȯW»XašzVaÞJ@Uƒ»@¯Ýbğwly@£kÑţ±Wу@ka™IUƒƒnƒ@¯ƒómţU™b™U¯lÇIÝb@¤Ý@kV@zĊ@™ĶnƒVV¤k„V„„bmź¯z@°™a¯J@œƒ¤@„„bUx™bƒ„@`™xUÔ±ºVXœW‚„UnUJ‚LĢ¯ÈKlblmÈXŎ°šU„°LšŽlkÞKš@Èxl_°ĶUÒkblš"],encodeOffsets:[[111229,36394]]}},{type:"Feature",id:"6101",properties:{name:"西安市",cp:[109.1162,34.2004],childNum:5},geometry:{type:"Polygon",coordinates:["@@°²@‚„mVVÈÈlš¦„m°xla„@U¦°ÈV¤XbV°lXÞaÈJ°kšVšaŤVôn°„„@„mV„šJlb„@XÒŤ²lÒ@¤kzĠxÞa@°„¼ĸK°XV‚°L„ƽ¯mlwkwÆç@óÈ¥°L°mô@„w@aƙK@b™@wÝLƒyÅUƒÝƙ@ĉ¯¯Uóx™W¯x™_ÝJmLUx¯b™ƒóak±mÝUU„™W¯b™aƒ»óó™xƧçĉbƒaĉxƒIUV¯¥ō„±w—l"],encodeOffsets:[[110206,34532]]}},{type:"Feature",id:"6102",properties:{name:"铜川市",cp:[109.0393,35.1947],childNum:2},geometry:{type:"Polygon",coordinates:["@@ÆxĸƨšKlxÈX„K@VWƨIlmœV@wVUmUnmUalk@kVaUaóaƒóƒnKV™šÞK@ÝW_xóKmVk£ÇmnÝ@¯ƒVƒwóK@ǯXkm›VU±¼™KbÇŎx‚š@bUV°bƒœ¤‚bš¼ĸ„Ub"],encodeOffsets:[[111477,36192]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/shan_xi_2_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"1409",properties:{name:"忻州市",cp:[112.4561,38.8971],childNum:14},geometry:{type:"Polygon",coordinates:["@@Vx@lnbn¦WlnnUšmš°š²VšV‚VVVnUn„ºlz@l„„@Jƒ@kXWVXl@Lƒa@„ƒKUL„ŽlbnKlLnK‚LnKÆXn°šbVV@bUVl°Un@LnaVJUbW@UX²l‚@ČwlVVIšWnkÆa°„„anV‚Kn°™UW¯@™aVUVk@Un@„aV@ValwUanmWU„k@WVUUanaVwnLVl°@nk@mVU@UVK@w„LVKVU@ƒ„K@UUKVUV@@bnL„a‚V„aôšlIXmlKX_°KVV@bVV„@šzV`kblI„V„Ul‚šL@bnV@V„Ċll„„VlIXW@k„a‚U²blKšVnIlJ„albXXlWVn°JnšnL@l@XlJlaX@„X˜W²@l_VmnKšU„blU@mnkVK„¯@U@ƒma@kX¥VƒmakkƒLƒa@aƒ@WIUUVXWWnk@a°a@kkm@kUUmJm@WUUUIk`m@V—kaWWkX™KmƒXk¯ƒ@WKƒLkak@±bƒw@ƒaƒa@akaƒ@ma¯@ƒL—KÇÅkKWbkmġ™±ÅUƒLUK™VVkƒm¯LUVVbƒ„UwUW¯bm„ƒULƒxWJ—@ƒklmkUm@@KnwVkVK@akwƒ@@a¯bƒKkn›VUI™b¯mmbk@UbmKUL@xUUƒ@klmLUŽlVXI‚VVVUVUœU`mLXVWbXnW`Ų°xmŽxU@mĉƒƒwU@mbU@UƒmbkVW¦kJ™@ƒX@`¯Im@UlUVVnb@bWJXnmbƒJUU™UUaƒ@UamIkaƒxƒ@@x@b"],encodeOffsets:[[113614,39657]]}},{type:"Feature",id:"1411",properties:{name:"吕梁市",cp:[111.3574,37.7325],childNum:13},geometry:{type:"Polygon",coordinates:["@@@a@w„@„wlbnJVb„@VbšVVV„InaWmXI@a‚aUmVUVkn@°J@_„Wš@lIX¥lUnaV„V@naV@„xĊ„n‚V@‚wn¯wƱX_WmXaWUnKV_V›VUUUUWJkUVnKlk¯™@@kmKUaŁ±KkU@WmI@WUIlUUmVwXƒ‚w@ƒUlUVwœV‚@„Lnb‚W@anU@UšaVkô@l»n@na˜JnUÈLVaƃUUVm„VKVƒ²L@mU_lK@UVWkU‚a@a@U¯aUaƒÑóÑUb™„ƒKk@@aƒk¯mVaUwVƒÑkWUmK@UUKmXUWÝwUa™LUU@aWJUUU@Ua݄U@WL@VKVaVI@WnU@alIVKƒƒ@kIƒmIkJ@™m@ƒ™@@_™K@xƒ@kaW@U„@Vmn@ŽUK@mIƒJUXV¤XXWlkKƒkkK@XmJVakImJU@ó™¯LWKUV@nUVƒLkxmKkLma@kXKmmƒLƒab™LmK@V@mXVÆUxƒX@`nL„aV@@VmLUVnLlLš˜„b@„šŽ°²nx@b‚VUxlb@V¯bUV@zV‚XVĊXVx@lVn@VnnmŽUš@LlJXVƒz¯VWVXbšV@bmn™VUVk„Çþń@XVxmbUlV„Uln„W„@„Xl‚@VLXÒ@bÞJ°¦„L˜ò„@nU‚b@°„X@ŽXbmVU„V„nb@x‚x"],encodeOffsets:[[113614,39657]]}},{type:"Feature",id:"1410",properties:{name:"临汾市",cp:[111.4783,36.1615],childNum:17},geometry:{type:"Polygon",coordinates:["@@nW‚@@UnLšK‚a„b„KnnWL@lnblKnLlw„KVU@mVUXL°KôšV@nIlJUbnI@WlL„llLXkWWU£VW„InJ‚@VL@nm@UVƒX@lb„@@wšL@`‚@„šn@V@lw„@n„VmVX„WmwnUlƒœa@_lK„wVlUn°xVKVXXWlUšVVI@K@K„n°KœwlVlU@kna@V_„Wn‚m„UVm@kXml_@m„LlKXw°m@_ôJVUV@X™l@UaV@Va°I„lk»VwUkVmwUmmVn@V¯@KƒU—wmK@U¯wUVÝ@mJƒU—nWK™@@UnKVa„_lykUmKÛnm@™x@ƒUUlwVk™ƒXW@ƒa@Uƒ@@K@ƒkIV™nammVakUlƒ@wX@@kƒ™¯@ƒVVbml@„„°UbULmlVbnbÅK±VƒKVXUJWa@ULWaUU@@U@aWK@UkxUKƒLUUUJ±UkL@V±kk@kam@UV@l@LWl@n@VVUx„LlUUx@VUV™U@aƒIUl™L@°mLU‚ƒbkUUaWUUaUU@aWK—LWJ@bUL@VUVVbU@m@a@kmKmnĉlUK™XƒWUblb—xmIkƒƒU@xWb@lkšVx™LXŽmzVV@bklVVUzm˜@bk„@Vx@xlŽU„@lUbVnl@„Wxnl@n@ŽUbV„mL‚mƒb@`X@lUX@@xlnkLWaUJnnWV™Vn@l„@bULVV@l™V@XnJVX"],encodeOffsets:[[113063,37784]]}},{type:"Feature",id:"1407",properties:{name:"晋中市",cp:[112.7747,37.37],childNum:11},geometry:{type:"Polygon",coordinates:["@@@šlInJ„lJ„@‚„ULkJ@bmV@XUJUb‚L@UXKV@ރVbV@VVXI@bVVšKVbÞxVXnWVL@VnLV‚lX„ÒUŽVxUb°n„l@bl@„LšƒVaô҄ÒVb°b@VnLnnV@lmn@lb„U„V@„‚JœUVV‚Xkl@lUzmJ@xšXkl‚bUn„JVšUb„nU‚lb„V@nlLX@lakšV`Ub°š@XVJnU‚L²KlxnI@KV@lbUbVV„KnVl@„zlm@Uš@nŽšI@WUaVl@@mVU„@XkW@ƒnkVKVƒ„_Vw„y@knwVa‚@XalU„@šVnml@„X@V„L‚KVaÞbnnlJšI„mVKn„VVVInVlU„@„m@™mXK@UmyUI@mWUUakamw@wUwmLkakwVƒmK™w@wUam£y@am_ƒW@™UU@knmm„amU@WUa@knw@ƒUUUUV@nƒJm@mVUkKVUUUkKmwƒKULƒKUImV@lUn™nŽm@mbUK@°™bUnmbUmkkƒWUb@am@UXkK@a±@™V™@ĉř„V‚UXVxUVkLWl¯@@bULUlm@@nm`—XƒlWakIkm›VUbUL@Vm@kIƒ@@Kšm@—VaX‚I@W@aU@kUƒVU_™KƒbƒJkkǎ™b@nkKmL™wÅW@kVUUƒVU@WUIƒJmIXmma@_kyVaUUlkUm@ƒkU›x¯Lƒm@L@LUJ™UkVWXUWUL¯wVmUkƒxkL@`›bk„mVnxƒXUWUnmƒƒ@kxU@"],encodeOffsets:[[114087,37682]]}},{type:"Feature",id:"1408",properties:{name:"运城市",cp:[111.1487,35.2002],childNum:13},geometry:{type:"Polygon",coordinates:["@@„Vl„nJ˜wkaVa„XšWVLĊknmnL‚l@@bn‚V@UaVU@UVK@aXI˜KXL@bVVVbXVVblV„aVnK@¯šKVk„J@bšVVU@UVwkVƒKVwUUm@@Xk@K@kVUn@lbl@²l@UlK²VVIVV„KVLlw@VXL@b@VV@VŽXbVK‚@XbVIUW„L‚U²ÆLmaUankVKVaƒ¯@ƒnkUa„U°@„š‚n@@kWa„UVaXUW@IXKVw@U™ƒ„™WU@W@@UUƒU@mn@ƒ`m@UUULkUmJ™IUƒ@@UƒK@U@›anƒ™ak_@wmKUwmakV™kmK™V™k¯b™wƒ`kwUIÇx¯»ÇaŃmn@@™mƒmUkV@wkKW@kxmL™UkĉLÝk™xÝw¯lóVU„mV@ĀVVX¦W¤kz@`Vx°„²ĸ‚š@„Ul@x„êĸNJ°¤V„VlXLWnXxmV@nUl@„"],encodeOffsets:[[113232,36597]]}},{type:"Feature",id:"1402",properties:{name:"大同市",cp:[113.7854,39.8035],childNum:8},geometry:{type:"Polygon",coordinates:["@@²£šyl@Ȑ˜Ė@bĸŽĢbĸ„˜X„a‚KŤnn@ŎôllÈx„nVnÞDŽV@b‚nXllL°KšbVb@J@b—„‚„@ŽU„„xlKXLlKlXk„@Ulk„JlkUƒVKXUƒÇVIVm@_nǚLšašl‚w„VnU@UUwma@aƒaÝaLmUk@@Wƒ@U@@X™wVWÝUUUk@@VmLƒKV»nwUw™aUL@`mzƒJUIVƒUaUw™KUaVIlJôanÑlLVUn@ša„@VV„@@UUwVK°Vn_lJÆLœéW@UUUÅ@»lm@aÞIVwXW˜UUkkm@U@aƒU@mwU£VWU_kWmƒXwW_°yUkkK@UÇK@kkUVymóK—U@KWIƒbUak@mJ@bkbmLkŽ™UmƒkVU„W¦@lnb@„@Vƒ°ULml@nkVƒa™VmLUnk`±@—XƒWW@kbǦXŽ¯„WxI@xmbmxXlWV„„@bŎUz@J‚b@bÞb™ŽU@Wbk@ƒxk@WX¯VۙƒWÝbÝUkVUU@alI@a@akLWa™m@U¯UUmÇL@K@aU@¯VUkƒKmX@`@œkJ@nV‚Ub@lbVÆXVW„ULU`VbkLUV@XWl@bXJ˜@VbV@Vl"],encodeOffsets:[[115335,41209]]}},{type:"Feature",id:"1404",properties:{name:"长治市",cp:[112.8625,36.4746],childNum:12},geometry:{type:"Polygon",coordinates:["@@Uk™Lky@I‚JVa@mÞaWšy@_W@_WƒXVlUVwš@nw°K@m„UƒVaƒmVkU@mmmnLVUmKXa™U@IlKVUnK@UmWkX@WV_Vƒ@akU@a„KWIXyƒIUVmUn™Ua@WaXUVKVmkUWVkUƒLU@@VƒbƒKbƒIUmƒ@mbVL—x›WUUkn±V¯wƒbÅJUbmLkbmKÅKƒbVnUbƒV™KUb™KUbmLKmƒb™aƒKkUm@UŽnn‚VnxUVlUxl¼ƒk¯JUbU@Vbk@WšU@UVóI@`¯nWxkLƒK@nk`Wn@lUnƒVnm‚ƒXU`@mb@lkV@„VnklVVUblz@`nbWnnJ„IVJ@XUVV„UV@lÆXšxnKlL@mšaȍll„I„ašLV`„UlVV@@b@XJWUb@˜™n@L„@lJn@@UVKVaœUlnlJXb„k˜Wn_@mn@VkVK@a°@XklKVUUwVWUšƒĊƚ@šU²@@blLVWn@@bVa„XllVnnaVmša@¯VLnan@‚šmVm@knUVJ"],encodeOffsets:[[116269,37637]]}},{type:"Feature",id:"1406",properties:{name:"朔州市",cp:[113.0713,39.6991],childNum:5},geometry:{type:"Polygon",coordinates:["@@XXWVXVWnnlnn@èƼ@„„xlš„ŽV„nblšššVŽÈUVl‚š@„blnœL܃ĊmUkU@Ua‚—@WI@aXk@WVUlKUaV_VKXƒWUUÅka@VaU@mlI@›@_nW„LVl°UV@@b@LÈKVn°V@VšnXblK@b@bkJ@bVVlUÞVÞa„Xܚ°UXWl@„wl@XaV@šÝa@aa@IVyƍ@aƒƒXUWknwna@w‚JXw°ƒWÈ¥kI@W@kmKm™¯IUmkXWWkaƒbkImJ™UkL±aVƒb@lWXkJƒUkƒĉkƒ@UmU@a™KkƒVƒUkJlaU_™yƒ@UU@aUU¯LW`kLWnkJó™ƒbUƒbmK@aU@UVVL@VƒL@„UVULƒK@xUL@VUV@nml¯@UkmKUxmbVbUV@XƒlXVmnVbkxUbU@ƒbm@@VUlUVšb°@VX¯šm‚"],encodeOffsets:[[114615,40562]]}},{type:"Feature",id:"1405",properties:{name:"晋城市",cp:[112.7856,35.6342],childNum:6},geometry:{type:"Polygon",coordinates:["@@lV„Lšb„an‚LnKVašLVašL„UVaUm„aÆLnLlanKVaÆI„a°x²UlmVVœX˜wUKna„@Vn„J‚a„L„a@UV@@alUkKVKnkmmVwUk„w@ƒ™@kxWUXƒW@@mƒk@aUa@a¯aƒLkKmwkUm@kL@K@aWIXmƒVƒXƒWkUVakL@UVKƒw@aUK@UUKmLU@¯n™KUwVƒUIWJUWmka™@UXƒJƒk@UkmW@kLWKVƒx@bmI@VUaVU@a¯@UUmVKmX@±`kÝKVxUL±akL@V™bƒLkKmVƒ@XWVUbƒVXb@lm@@lW@@xk„lVUbnnmbUšlJ@„@L„@@V„b@‚WXš„UlkxVV@„šwn@ÜmnLlVkzƒ`UbmL@Vš@XL˜m„VnIÞ@VU°x@VnL˜x„V@LU°"],encodeOffsets:[[115223,36895]]}},{type:"Feature",id:"1401",properties:{name:"太原市",cp:[112.3352,37.9413],childNum:5},geometry:{type:"Polygon",coordinates:["@@„@VV@wVKnLVal@na°nšaVJœUlm„L°a@b„@lx@bULUlmx@Ln@lVkn„l˜@XI„w‚K„Vnƒ°aVXVx„ƒUaVU°K„nUlšUVL„KÆVš²Ģ‚lnXalLÈƘL„KUaVkUanmWU™a@WwkUWU¯y¯Ñ@anIl@@aVU„m„I„ymUƒLUUVakaU@@LmJkw±LKmVUI@W¯™VaU_l™kbW@kK@mƒUkaVƒmVaU™ƒIVmalk™W@wnIVy@klkWUU›VI@ƒƒUƒVkam@knU@mmmK@bblVUX@VkLV`@n±KU„ULƒ‚UnVVńUbÇKmV—Imbm@k¼ó@Ul™b@VmV@bXmaƒK@›UUxkV‚V@„xW„UxVnkVVJ@XnJ@XlV²LƂVbnL@lš@°"],encodeOffsets:[[114503,39134]]}},{type:"Feature",id:"1403",properties:{name:"阳泉市",cp:[113.4778,38.0951],childNum:3},geometry:{type:"Polygon",coordinates:["@@°@nb„@lb@b„b„b‚@„x²al@lb„KXU@m‚kUWkkmUUƒVwV@XUW@™naVklKXblKnL‚ƒnLVanImaXKlL„ašV@U@KUKW„alƒXK@£WKXUV@VU„ƒUUVW„_V™@W@@K„@šƒUƒƒIWmXUmƒULƒn™JkImmÝaUbLƒK@UƒWk@mn™Uƒ@kVWb@Ubmx@lƒzUxƒ`U„ULml@„XWlƒ@UV@nk@U‚Vb@X™Jm™@@Vknƒyk@ƒzƒJƒnUV@bk@mJ@b°Ò°zXVlVXx‚@šbXVmnVbUlVb"],encodeOffsets:[[115864,39336]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/si_chuan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"5133",properties:{name:"甘孜藏族自治州",cp:[99.9207,31.0803],childNum:18},geometry:{type:"Polygon",coordinates:["@@ƒaXamƒ¯wm@±°wUwV@UaVw²Kš™„U@UƒU„¥‚a„ƒ@£Þ™ôx‚Knkm™X¥™IUƒÝUwlk°V„@ƒÈ™‚KUwlkUyV¹„mšx²Xll„ÑW»š„l„w°UŎ„nƒ„„˜Jœƒl¯°V@wôIVÇn™nUllšLšVǚLô¼XW£@±„@¥k_ÇJƒkUéƒkšƒƒwXa@ƒšLlw²™Vx„b‚mš¼ÈxlLȃ„VWÞn¯mǙÑUÝlÛkwlĉmƒULmwUJ™ç@wkm@ÑlUX™ƒÑôġƒVa™ƒUф¯@wķÓkbV„mnU@@y¯IķKƒV@¹šaƒé@k„mÞU°¥@a¯@anKlblU„¥@óğç@Çw@wkla„çݱk¯±@ğÝUÛmݯwƒ@kb±¯akXWÜkXUÆÇUš¤X_Ɛw„V@¤ƒXU‚ƒbUƒŽƒIUlÇUkŽġ@™aXČmlUlèUV@„mVk¦Vxš@¦±š¯ƒƒ¯¯anlWš¯nƒƒÅw@w°KVak£m@klƒKknÇU™»óKšīlaUaV£@™™¯@ƙU™VƒÛÝÇXƒÇl—ÓlŹ„»WUğJ¯£mx™Lĵô›ºX„VlUll²bl„„lŽƒxónn°ÝšU¼mJUš¯nƒƒƒV@êĉ°Uĸ™w™@mƒ@¯kmXamѯaUwÝKU¥„mÅn¥Wmn™ƒ¹n±ƑƆÇôXê±NJnšƒ‚UôlĖkȂVÒ¯¼VnƒȮ¯ĀnƆ˜Ģ@Žk°V°¯ĢVlkšVxm¼X²™Ŏ@ŽVxknWÜ°U‚¯n™Æݜ@`„ôݲÒƒ‚Çzn‚mX@x„è°K°Å„UČĬóĖ݄ƒ˜ó¼ÅêƒÒƒbmšk@V„Ž˜„@ҁl@nĉܛê—x@Ėml՛J¯¦óxȭ°ÝmŽ¯Lĵè›Ā@Ɓ„l°żƒ‚šX@xmŽkV@z@‚„°blŽnÞ°J@bn@ƼUVƒUóŽóLƒ°X°ÝLƒxUn„°ƒĬƒn@lnL@ŽÆ@šn„KÆxnUnV˜InĬmÆnxŎ¼ĊIĢóÞ@ĊƒƨbUƒ‚mV¥lkƒ‚wnL„mšÅÆ¥Xƒ˜wU@w‚wUÞ™@alUUŚU™Vkkm°aU—°Ó°w°U„ƒ„b°aš²K˜¯œĕ˜@ÈbޏĊaš»„XVm°In„‚Ĭk¼Vb„ašJšôš£VĊan™‚k„ů™™nƒÜU@anKnĮ‚bÈmƎš»nI‚霣Ġ™"],encodeOffsets:[[103073,33295]]}},{type:"Feature",id:"5132",properties:{name:"阿坝藏族羌族自治州",cp:[102.4805,32.4536],childNum:13},geometry:{type:"Polygon",coordinates:["@@l@@þ²I@lƒ„VL°wnJ°Uĸ™Ŏè„Ilw„V°¤nĮ™¤Ý„lè„L@„ƒ„@x„l™è²ôĊ_ĊġVÈôJżīlbXšÆÈVŽkxÇVƒ„n°„¦Üb@è@nn@@°šUÈ¥WDŽ_Uala¯¯UǙkƒ»„mVwk»˜k²°VxlL@¤œ_@x‚`ȍ‚Ėöb˜š@l²alX„a@bnK°¦VK@nnWmx@nUnl@@lƒlĉk°l°UXkmW@Unš`k„ÇL„ŽW„ÛÈVxšVVlVk@l„IXb@ylXÈW˜Į„WŤzœy@šmIƒŽ²šJ‚š@nŽ°@V„„J°a„Å@ƒŎkVǚk™aUw„KVw™™Vƒ„@nkm™@±ôkô™ĊJš¼šInÑm±nIššÞ‚XȃĊxĊUÈbÜyÈ£Vkw@kVUV™„m@ša„»ÜbÈmƒUXwÝxƒUn¥@°ġ™Å‚aœJVk™aW¯Û@W¥—UŏĶ™@¯kUƒŃ@ašI@mmanwސ‚W@œ™mw°»Uřk¹±W„xVx¯¦U°ƒzţW™w@°ÇVÑk¯@„y°aš£š@šmšnl¼„ašÝÝakwUƒ±aĉImlĵn@ƒm@kkVƒ¯Ñm™ĸ™°x„l™œ@˜ƒXVÞmlÛݙĉUÅ¥mwÅ¥VaUw›™XġċaVůÛŹlwU¯U™ó±™xÛV±¯¯n¯mċƒLmnĊm‚™@™_kJWaXmwUƒĉK™»™@mwX݃UDŽkKÇw™»nƒaUw±škx™K@„Wb„x™„„lVê„lÈIl`@¦ƒŽ@²X¤Wó»™KUșŽ™KkkmVmšUÈóJ@x¯Uk°›„—Iƒƒm„ōƒ¯Vƒxƒk™ŽX¼ƒÒkk±W™wƒnUºVzklVxLǚ@„ƒŽ¯UklVxސV„šJW¦nšmlLówݚ@¤ƒ„bƒ¦„V@VƒV™š±LUxVbU@Vx¯x@²n‚°xn„Wb„b"],encodeOffsets:[[103073,33295]]}},{type:"Feature",id:"5134",properties:{name:"凉山彝族自治州",cp:[101.9641,27.6746],childNum:17},geometry:{type:"Polygon",coordinates:["@@ĶóšKnw°¤ĠIXVƒ¼kź˜Ôk‚„ÈWŽÞȄÜUVšÅš°@šš‚@U¤Vbkb™ĬôLš¼ÈVlm„Llkn@l¤Ub¯L@xÆx„„°mX™mk°b„°°„²™@¥‚™Uwl¥nU@ƒVUkçVnkWċšbĢ@lÈVVk„J„‚V„aV„W@£ƒUƏxW`™£ÈVVÅlWXÛlW°b²la„@°xnÞVÜĠÞ²@l°Þ²ƒèkblŽ@xÈx@Ġènal£nU‚Dz@‚ÞK„nn¤@¼˜°U¼„nV‚šXU‚šbn™ĠUVbUlVš°LX„@lV„èÜUnK@_ƒyXVyUwmIU»Vƒ„kÇ¥šÿkkV¯m±n@ƒn¯ÜanVVƄz@Ž‚bœwÜb„m@wša@kƒmk»@™a@VUUó„w˜@nb°mš„XŽmnVbގVôanwšJ‚ak£lw„˜šLšÅnÝ@wl¥IÇӃ@U™™Lƒ¼kVǃÅó¯kVmmw@ƒn_‚Vn»°LÅ»@éÇçŹīVÇÝ@ÝğU™ƒaVݙ™š¯ķlŭġlƒ@óÞۂċ@¯nkUӄ—m±™IVġUwóKUn±¯—K›w»ƒKݐV„nl@„óxUwţ›£ĉƒUmŗÇ݃K™„ÝUlmKƒ£UVŽ@ÞȎW¦„Ò@Ĭšnny‚@nÒmœVŽ—¼@°Vbl@VlnUUwl™°a@„œ„@llnk°lbnKWĀnŽU„VxUŽ‚²Å‚m¦Û›ÇŚƒaU„Vbš@¦m`móX™Umm™xÅ@±Þn虲™U¯»m™ƒV—m@wƒU@wݚÝmLƒa@„™VÇUk„l°¯„VlkVƒ¦UšmxƒaULUèVx@„kIUxmWV¼¯VmȯšU„nl›È—@m»Å™ƒVWxÅbÅğW@kƒm@kVV¦mlnn@‚ō„l¦Åƙxkœ"],encodeOffsets:[[102466,28756]]}},{type:"Feature",id:"5107",properties:{name:"绵阳市",cp:[104.7327,31.8713],childNum:8},geometry:{type:"Polygon",coordinates:["@@„ńlV°š@Őĵ˜VX»ÆUĊќJ‚w„@È»m»š£°Kšk@ÇnÑƍš@„w°JUwnw@wšbVbš@VlźLUw„aƒ»„aUklyUUVakwWXwWƒUxkLƒmn¥mšwk™˜UX™lJ„w@aƒIk°X„¥Wƒ²l¥šaU™„IlmkklƒÈL@m°nlWU™aW—š@Vƒ„@UaV¥@ašk@Çk¹ƒK@a™K@kƒKkšÇX@VU@kx±V™èkIWwUVUkkKÇ@ƒa@wkml¯@kUWn£Wa„aVwnaV݃w¯@UaWx—n›JńUxUšma@L@„mbUŽU±VVnkxUƙ„VŽm@kkKW°„X@¤ÇUkÆÇnU¦¯ŽkƒmLVwÅK@UóbÇƁVƒ¦™L@‚±êX¦mVޚkÜÝnWU—„›@kšƒŽ¯wķšnš°ÒU„lln@@„ĶmnkĊJ²bV„lxÞb™Þƒbk»™m™n™@™¤¯bƒz@Žl°UÒ¯È@ŽšxŤX„yV¯°¥Uwƒw²XlºVŚ¯¼nx›š@ŽXݏmxnb@n™J@b"],encodeOffsets:[[106448,33694]]}},{type:"Feature",id:"5117",properties:{name:"达州市",cp:[107.6111,31.333],childNum:7},geometry:{type:"Polygon",coordinates:["@@Uxn°‚bnŽlUnÒƃnn@n‚¤„LnxlU„ššV@„Æl„x°XXxl`XœƒVW‚œL˜è—„±nÈbƒŽ°b@š²x°Kܼ°ĉ„V¦lJnU@¦šÞ‚JÞğ„mšLÞ»šxU„lb„VÆann„alŽ„VƍX@lnŎV„mU™maÅXƒa@aWmœ@‚£@wĉJVƒkk‚kkmƒnk@ƒmna@šal„Kš™‚J@Þwm‚ÅŃ@ambkUƒƒ@™™KUġKU@m‚ak¯±ƒ„a@aĉÑÅaVwšXlwƒ±—V¥l@@a™kƒ›@@£šmƒĉÝónWV@ŽnÝÇÇx—UmbƒaVkkk@m„@m°ƒÝýXm›akÅīƒ@@ƒmb@@xmšnbƒ@mxšŽkWL@ƒ¯b@WUXmWœWKkbm@kx™Xmm@LUl„xlêóK™nUš„all™LƒlLó°m¯JVšU„K„„@x˜K²Āô¦l°"],encodeOffsets:[[109519,31917]]}},{type:"Feature",id:"5108",properties:{name:"广元市",cp:[105.6885,32.2284],childNum:5},geometry:{type:"Polygon",coordinates:["@@ÆL„Ċx°»Ŧ¦˜W„™šLȄ@xÞKÜ°ÞnVxÅĀlÒnJ°a@w„V¯l@XWknKnw˜VȚ°XXa˜lX°VI°b„W„nšaššš¥@ƒw°™n@šyÆ@nkÞ@°¯lJn„°IÈl‚UšlXÅ@ķlUV¥VUUÝޙUUƒ@UwƒJUkĉm@ýƒƒlk™WUwVwWJk@VUK™lUkaVƒUƒmLk„m@ƒƒ@Uƒ›Ik`@„™UmlUkV¯ÇXKÝ_mm¯@Uƒ`kwmƒl¼±KV¯—¯Vk±Vk±kzma™KUnDZ™bk¦±ŽX„ƒ¦¯Wl„J@bƒxkIWš—Vlš™xnŽm¦„nlKVwX„WxXŽlxUbVVkzVlƒb„¼ƒbVxŹKUk™@Ua™a@xmxVx¯Iƒx™@ŎmÒ@șl¯L™¤n¼"],encodeOffsets:[[107146,33452]]}},{type:"Feature",id:"5118",properties:{name:"雅安市",cp:[102.6672,29.8938],childNum:8},geometry:{type:"Polygon",coordinates:["@@ln@xšèVInxVKn„‚ĊklxkÜVޚÒnÈm°nxš@š¼ĊLV„nx‚WXblIš`š@nmĉn‚KȄôÅlUÑmU„K²¹@ÇÅVÓůVýÞW„‚UVmX„ÆbnwšKUÿ‚™@UmmIUb¯¥Uwƒ™¯™Çmš™„çmanUm»UUƒl—kƒ¤ƒa¯bV™U_WĕmÇŚ±ĢUlƒUl™ÛVƒçkUƒ@WŽ¯KU™VkUağVmš™aV™WUƒmV»—¯@»m£ƒmÝLŽ±@ÈmVk¤mb@ôƒ¦kVkamL@b°‚@b¯¦ÝVƒn@l„ê™b@º„UĸL°J@zV@nmUƒlaĸÔ@xƒ°VҚ„Ub„‚óĢ„ÒWškV@Ò"],encodeOffsets:[[104727,30797]]}},{type:"Feature",id:"5115",properties:{name:"宜宾市",cp:[104.6558,28.548],childNum:10},geometry:{type:"Polygon",coordinates:["@@VlÈnl‚XnWLX`m„²nV‚@b°xĢçlnšVm‚nn„@@„°‚UzšlV°nޘÒkxl„w„`UnVb„mšL@albÞKÈۚmܼ°@Xǚ@wmW@ńKĊL„lV„šLVŎçÞL²±‚ğkw@Uƒy@¹lKX™lKVa@w™™Č@‚w@a˜ÇU¯n™@@wġak—™aō‚ƒƒK@Å»VakUWmķwkbğ¥mL™akš™@ġރ°¯xVVÞ@VšxVš—VWx„XlxU‚™@k²WVŃULmèULVĊklĠ„VœJVx±nŃ¯¦mwğ@mƒƒlğkkl±@kšUk@¯±Ç™Kƒ—kxl¤b™Imx"],encodeOffsets:[[106099,29279]]}},{type:"Feature",id:"5111",properties:{name:"乐山市",cp:[103.5791,29.1742],childNum:9},geometry:{type:"Polygon",coordinates:["@@kšVŽk„ššÆkšV²UlºÈIlxƒLXèÜlU„„XU‚mkƒbVè„x°@„@¼°Knnn@m˜ÆIUbnJ@bVI°b°±@nK@mVakkƒKl¯nbšmĸ„èl@VnÈl‚UUw„wmwnm°¥„L„™lLnU@Va™ImbkƒmK„ƒƒnk@mƒb™ƒƒLV„JVUUƒ„VnkVmb@a¯JUaÆkk¥„IW¥„Klw—ÑmÝU¯™kVy¯@ƒƒ@mmn™Ukmġè¯w@aU±mnƒW_XKWmkÇmUkóbUÝUanmW™ƒ¯nma—@ƒxVôUV@šb@‚l¼„n@l™b@xƒnÛa›xa@ƒyUÅmUÛbm°@„m‚n²U°ll™ĀȦƒlU„V¼nJVxUz‚W„z@`mL"],encodeOffsets:[[105480,29993]]}},{type:"Feature",id:"5113",properties:{name:"南充市",cp:[106.2048,31.1517],childNum:7},geometry:{type:"Polygon",coordinates:["@@ȲVmšLnblyl²²UUl˜°U°²L‚»„knlx„_VŽ°@nnÞ`WL°ÈUŽVlnkšV@ƒl_œJV„‚@„„n@lƒnKV£™Çšƒ„UV¯šm„@laX˜U„‚UbVx„@VkôJU°Jn™@™‚wUk°wnUƒV_nJmknmm¯Vwk¯ó¥±ÿ—L@wƒƒƒLVU™kU›bX¯mykI@a±Kk¦ULmaXƒƒVm¯ƒK—z±ƒklUIVbÇJšƒkL¯™l™ƒU™ÿ™UƒlUkJƒUmŽUUkVVklKk@@a™U@„™J„²ƒxƒ¦kĬ@¼±ºXnWb—xƒU@xƒx@lšL@b„Llº@șl@bU¦Vbƒ@U„™@X˜‚bVškX¯m@nÇKk„llknƒJVš"],encodeOffsets:[[107989,32282]]}},{type:"Feature",id:"5119",properties:{name:"巴中市",cp:[107.0618,31.9977],childNum:4},geometry:{type:"Polygon",coordinates:["@@V„U„lbkVšŽVLUŽl@XI‚ŽUxVxšXkl„„@þĊnVl„IVx„@VVݚVÞUVU¦kV@ĸWÆô²š@VÞnš@Vaôb²W@‚K@XUmÑUW°¯°Ina@y„_lWn¼lLUbô¼„Kla@™nkUyô—Æx°@šn£™Ý@¥mVkIU¥Ċƒ‚¯Û»¯L±w@™¯a„Ça²m˜ƒ—ç›KX„UW›k_Ww¯WƒwÅk@ƒ™Uƒ™kVmwƒK£@mmmńmÑkVmamnnlmIU`V„m¯xVlx@šmš¯IV‚óIUlƒ@UwVaƒ—VW‚kbƒ@™nU°ƒV™„šÈU¤"],encodeOffsets:[[108957,32569]]}},{type:"Feature",id:"5105",properties:{name:"泸州市",cp:[105.4578,28.493],childNum:5},geometry:{type:"Polygon",coordinates:["@@VVXwVKn„˜wnVƒn„l@b¯xmKUbVn°°X°@blLšènV„@Vn‚l@U„LnmmUna„VV_ĶV@wnJ„„l@@kkKVólaUwnJm„wUlm@ašUaôKVnJWbޚ@VšwVLX¥VVš_Þ`šw„WƒÞŹmmnIn¥Wƒ@k„WV¯@ƒ°kI™ŽƒLk¼Ç@k¤±Xk˜™nmݯUlÅÛKWV¯kƒlUwkLƒÓ™@U—@ƒ‚w@ġXV„˜WX„š@UbVbšV›š_kÇV™lU°lnwŎ¦ÞaƯnmm¯šU„™m¥nkVmkƒl_ó¥¯UÇl¯@™ƒ™L™kƒ`¯ķLUy¯@mw—¼ķ°ġ_řU°mlšnÇVUޚ„@‚ƒš_ƒJUnV‚UXšbl˜Ģb@x@mšV°—È‚b@‚xċ@šš@xUbkLWškL@º„zV‚@lxĠ±²"],encodeOffsets:[[107674,29639]]}},{type:"Feature",id:"5101",properties:{name:"成都市",cp:[103.9526,30.7617],childNum:11},geometry:{type:"Polygon",coordinates:["@@°n°m²°ÜUšw²ŽôVš°ŽVkxÜźUŰČb‚ŽĢlaÈL„»ƒ@k„wVǂ@„ƒnÛƻșUÝ°Kl_„V°Uš`Vbn@VbÈLšaVU@ƨ»V™nIl™šUUa„±lIk±š@VnKmÅ@WaƒK¦™lVōškK™Ý@maXÇmw¯IU‚@kƒVƒwUmVIƒƒƒç—ÿƒU±ŽÅ@¯È@xƒK@wƒLUbÇKō@mÝ£@yóUóóUxkI@WlIUaƒbƒaŽVĀ™LmxÅaWƒUnVƒÝXUþÆ°UÔÈÆ@±ºƒLnVVÒkóÆ"],encodeOffsets:[[105492,31534]]}},{type:"Feature",id:"5120",properties:{name:"资阳市",cp:[104.9744,30.1575],childNum:4},geometry:{type:"Polygon",coordinates:["@@„è„„UJVn„x„U@lV°JnxWÈnbÞ@šŽlLŎ™Ušk‚¥„LXbÆ@nŽmLU‚@zlbXmlnVynL„çšJVb‚UnómUnamU„an¥lKV_²aValWô„n@nƒ‚bVœK°¯VblW@kkƒlUnlV£°W@w„UXk°KVwƒmVkwVyVI@wkmƒVÅ_Umm@Uÿmbk£™xUaVw±V¼V¤kLWxU@Uk™bƒyƒXšómƒ°V@@zÝÒkKƒn™±U@@_VVkƒÇaVwnLWalm@@kkVVl™¦kIV`±n@w„Kƒƒk²™aƒVUUV¤™nkxmUkVWVnLUbVbƒ`kUU„mLU‚mX@`ÅbǚXbWLXŽ›n"],encodeOffsets:[[106695,31062]]}},{type:"Feature",id:"5104",properties:{name:"攀枝花市",cp:[101.6895,26.7133],childNum:3},geometry:{type:"Polygon",coordinates:["@@„b‚KÞnޙ@x„V@x˜n„Unš°¼šVš±mç²ÝÆ@šwnnšVWŽnôn_@¥‚™UaVƒ„bƙœÈ܎n¥Æ±VUwVƒmXÿmLkal¯km@k›ƒ@ƒ¯bkšVxmVUkk@Ua@¯˜»Un›mс@mz™m@īƒÑX¥Ç@ݙxU¦ƒšÅŽÇUkx@šlb„UWVX„mV@xĵĖ±@@Ž¯xUšÆLnÆm„šx@nXL±lUUVwKWak@WxkbšÞƒŽĉbUn@‚ƒ@@xó¦„Ŏ"],encodeOffsets:[[103602,27816]]}},{type:"Feature",id:"5114",properties:{name:"眉山市",cp:[103.8098,30.0146],childNum:6},geometry:{type:"Polygon",coordinates:["@@„šVx°¦VanJVnš@„b„aVbkJ@XlJVwôôôV@zÞ¤@nƎÈLVa„K@x„L@w°ÇÆ@²„V˜ĀœmWXKWașÆa@_nWVnKVƒlV„_UaVamKXUWwnmmwœÑm£@ynUƒkWƒĉUkWVkkV±çkJmkKƒšƒK¯¦mnnxƒxVxVÇkUmk@ƒçķ™nmak°„LllUb@nmL@‚¯²¯aUJ@amIVaÅJn—m@mm¯L@»ƒŽ¯@ƒwUç„anlVƒWVƒÛkWç„KkwÇJk¹±V™UÅl™™ġV™²ÈƂnXĖV`Uš°a„b„£˜l„kVVn¼mVnbƒè™šÈn°š"],encodeOffsets:[[105683,30685]]}},{type:"Feature",id:"5116",properties:{name:"广安市",cp:[106.6333,30.4376],childNum:5},geometry:{type:"Polygon",coordinates:["@@„VlIV‚„kšVšĀ„Vkš°šlK™„ÈIUaVJlk²„˜y„Ln°„UW„nbVKl¥²L@blJnzW°œalV°Inô¯‚K„kšKkkƒbV™šmôLkéƒwVk@KnnšWlwn@laXL›ŽnXVW@X°a@„XKl™nw„@man™@w‚@na@„„@ƒw™ĕġġ™wUkUWb@mk@™¦ƒ¥mUÛb±yÅn@bml@kV@„ƒlknVbmVnlmš—bÇk¯bWyk@V_UamJ@I—@WaƒVXamIVWkUkbVaƒUUxƒ@VnkVU¼›bkKUxmK™„@WšƒxnV@n"],encodeOffsets:[[108518,31208]]}},{type:"Feature",id:"5106",properties:{name:"德阳市",cp:[104.48,31.1133],childNum:6},geometry:{type:"Polygon",coordinates:["@@nUW¥²é@šK„¥‚UÈÅôa@VÆLUxnKl„°V¥ÈmlÅÈV@£ƒWX¯lLln@UšƒVÅlwUm²U‚VVna@ƒ@KnbV™VwƃœI˜mXwWƒkIVwÝĕVUa™IƒèmKUzkmWnka@y™@l²kJƒ²Vb™VkšmJUšƧ¼@UV™bÇKUam@Ua™_¯VƒUk`¯LVÞǚżm܃„@Uȃx@l„ƒ¼ÇKkbWŽœšVxUbƦnxƦĊV"],encodeOffsets:[[106594,32457]]}},{type:"Feature",id:"5110",properties:{name:"内江市",cp:[104.8535,29.6136],childNum:4},geometry:{type:"Polygon",coordinates:["@@²èlUUllXĊVX„„lmV@zn¤›ÒnxmnXxlUnVlwšmU£VV„Ušbl±„„ƒL@x²mU_lJš¥UklU@ln@‚kXbmKUxÈbl„UU@`V@š²„mlLÞÑ@yU@„¯ôn‚™„W„zšaVlV@XwlKU£‚»—aVaUwm@mwUVUwkƒlVDzLlƒ„KV™m_@ykUmƒ@mU™çkKmxkIU‚Ý„@LUJ@n±„kº‚LXb™¼@mmIXa™@mamnkW™ƒKUƒƒxƒ_U`UklwUw™mUbƒV™²ƒakbƒmkn@`„UmҙšVxUb™I™`UƒaÝÈ"],encodeOffsets:[[106774,30342]]}},{type:"Feature",id:"5109",properties:{name:"遂宁市",cp:[105.5347,30.6683],childNum:4},geometry:{type:"Polygon",coordinates:["@@ÞĖUxlJX„Vb°@„xUÞmbUxƒbXbm¤VX@lk°ln@x„bÈ@lLVlVUXxlJšç²UlwV@@UÈWl™„L„w@w„V˜wXaWm²¹@»lī„¥„wƒ±šI@ƒšV@bl@kLUllUVVn@mmU„wX™ċbVb@VUkbmamšW@kƒa@™™k@ƒlaUa™@¯b@šmmwó@@lkXUa¯°›LU‚am„m@óƒkXUb±bU`kLm¦ƒbnVmbnVmô"],encodeOffsets:[[107595,31270]]}},{type:"Feature",id:"5103",properties:{name:"自贡市",cp:[104.6667,29.2786],childNum:3},geometry:{type:"Polygon",coordinates:["@@lIÞDŽbVŽš_šJVaUwš™nуV@_lm„nla„bš±„UVašnVxkxVlV_„`„wV„„LšlXnmnbš@WbnJ@nš»WaKl¹²ƒ@mVI@KރVlJnw@aW¯¯¯UmVanL°w@aƒk„mmU—xmƒULWxUUÝKōèU™KUƒƒkĉKƒL@ÆnX@x™‚Wȯ@Û»™nÇÜÝLka@b™KƒnUaVmƒ_ƒxkƒLX¦ƒJl¦ÅlVb°I@bnaUŽmlƒUV„UVƒIUŽ„Kš„„a@nml„„ƒŽnLl„našJUbV@"],encodeOffsets:[[106752,30347]]}}],UTF8Encoding:!0} +}),n("echarts/util/mapData/geoJson/tai_wan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"7100",properties:{name:"台湾",cp:[121.0295,23.6082],childNum:1},geometry:{type:"Polygon",coordinates:["@@\\sŽ@pS}aekgKSu™SsMß`¡CqZ·be@Q^o@‹gieMp‹‰]}•}Ľc_Kk…{™ù“A¡r‰[uom@эĥJiq©mʼnq¯Bq]ÙYgSåk_gwU­isTE…“‘ĕiqiUEkue_‰OSsZ‹aWKo¡­q“ycY£w}‹ĩ™ĕS§Z©S™N¥SyLÑ¡±Ks^IY‰PdƒY[Uo†Fp}´\\¬\\j]ˆe܍ò‹¤¡–ā a\\bn™U㺹Ìs¼j®[cíȈEŽĝĆ`ļf¶Š®K|VØDdKGpVnU‚FjpH—F`†B’[pMºxÖjbpÎxp€¬‚|ΟÜÒCŠ²®‚ÜAp„ZG~€Šd˜ÞàV¨|¸€`|Œ²tx~\\~|dFf^zG€ĄŚhœdL\\hĸž¼†ŠOªP®lV`p\\]Xpll˜æ¤œCpQ|oF}fMRi†NSon_²qämœM„NM‹\\•"],encodeOffsets:[[124853,25650]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/tian_jin_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"120225",properties:{name:"蓟县",cp:[117.4672,40.004],childNum:1},geometry:{type:"Polygon",coordinates:["@@EUDAEI@WNMNCBFAHFFNACDJDPBD@@GD@DIFFHEFGDBDEQOFG@EI_KG@OcJQM]RMEKBGPG@[LaCIICBWKCEEG@WBQHCDFD@HSLEJI@IHWECFGAAEKCGDBFCBSBIDCKKHEADMJMFABKOKEQAA@IEEG@GIQAEK@OZEESMOL“lu@SLUTYFQCMG@@SQUAYKAACA@IB@BDB@B@DC@@BGAEFAA@BEGKJCC@AGAIHA@@JC@QEIP@@A@EGIDC@O@C@@@@CJCWKABFLBBEBSQGBAAMIEM@AKBcJEN@BEBCFMAEFEF@J@BG@BFABECKFG@AFQ@@F@BEB@@A@@AAAKAE@GFGDECEFEECBKIKDELDFEDYH@EIACDCHKBEB@BAAC@ADBHABKJIAIJICEDGDCD@@A@A@DHCHJHDFEFGBKRKBGIK@GIMHSBCH_BOJECCJCFKKMD@DNJEDEGC@OJCJHRUL@HRJ@H[DCNKDZHCTFDHCFFKR`TANVDFZRDLFARB@HPAPG`ILAR@TERNDFNHDLCLDDCXDYbHF@FEB@LDDVE@JPNfXPINCVDJJD@NJPAJHLXHDNANHhB@DPNLRMTBFRBHHr@`NBFEBOCCBIAQJDHCHLHFA@HSDCRLFTB@HEFLNF@PELBDJALFLTC@EPFLLP@tUHQJDfIHGTB^JTCPDLKAIBATFPADIEGECEMJ@JIAIHGECFEAGDI\\SPOXAFCL@BQTQBBTMZECYGAHA@GJAE@HCAEME@IECFKJADDBABLTHHG@ILEAMNDJCDHEBF@@JNFJELDFKTOT@JETBFFHBHEHKI@@IJEJ@XKEOUMS@AF@CEB"],encodeOffsets:[[120575,41009]]}},{type:"Feature",id:"120114",properties:{name:"武清区",cp:[117.0621,39.4121],childNum:1},geometry:{type:"Polygon",coordinates:["@@FWôµ@IFCLIB@EHNBp]AGEAKAEDMGZKFGBGME@ILGP@HEFB@BXMEAHUGC@IHCLOD@X[NWHWPKAEF[@EKIOL@EKGBNMJ@EIEHKBIC@BAKMIACCFQZCF]DB@ERAKADIHGEIBCGIIECFaGLZO@EFCNGAGDGAKL@BMG@IE@ADSDEH[JGC@CGA@BMDeK@EIACFE@@GG@FIAMM@CCGC@EM@ADE@CFMAAGHBDKIEAJG@DOGCDEKAGIS@KFCHKAEHIE]BeKNO[IFIOELC@A]GMBKVYCDDgGAICARc@MW@AQE@DGI@@AQ@@BKBAIQQYEFW@CEADIGGBCEIiMEMF_LGEKMBBDWEBGRC@E_CHYGCH_IAED@FFBQh@FGJaJ}AHRAREF@bE\\C@CT`FHC@\\BBF@BID@HGDDJ@@FAHKBARECKDAZBJIVNHCTA@EREAMLHDAFFBVFFC@RNRETHD@FOJMACH@CAB@P@DF@@FGDWE@FFSIEMKQDYCCHKb^JADOCIDGNDBdBCFJB@EC\\A@BJEA@JAAAD@HHD@LFBCFF@BERDHNhZQHMBGHOACCEBWEGD@PSJKCGEUD@CINLFGHE@AJK@HDABBHTB@F`DBFLBBHEDARCFG@ABJBAPVFE^FBGLGCFG_BMLEXGAAFE@@JNRVJHFALFBEHQJCTbNDHCF@PlFLJSXCHFHfVBTNJ\\BPJXC^FAVNFCHFB@FFH@JF@\\ABCFD\\BDMCAAJKQBGAILOEGHILECQLWFENJHADC@QxNHFJNLDFA@CBA@D˜UÂmR@FBL@BD"],encodeOffsets:[[119959,40574]]}},{type:"Feature",id:"120115",properties:{name:"宝坻区",cp:[117.4274,39.5913],childNum:1},geometry:{type:"Polygon",coordinates:["@@TZbB@JHD@DODCLM@AP@LL@BNH@ETFN@`E@DNG@CHLBCJA@AICFKDDBKA@\\N@AFNAGRBFjFFFL@DHLBLFQPcXAZMJ]GAVHAIZJFNE@JpDRRDCLFDGXA@EFF@CFFPDfEBDB@DCHCFCJDJIJBLI@I@CB@@ADBB@FALADGDC@@H@BB@FZGFCCE@@FMLALJDAFFFEFDFCB@@AHCF@L@@BBB@BB@FC@E@@R@BEL@HEFD@G@AH@AIB@@@FEFEBALDDEFAFO^IF@JCBBFPNJJ@D@PRDCEKBAXL@BIFD@T@JE@BHHJORFDI@@B@JGH@@B@BDDLIFFHCD@D@DEE@BAAAB@DAF@B@H@NGLJLMRDNMfGIEPMI@GDAKK@KIDIJ@GE@CFDN@FE@GFEPGV@TCDFKHBBF@RW@DD@@ID@TJFKIKLI@EP@IGBCLAEKLEN@KSHIGYACSD@SEAMBBMGEBMQBCMIGKFB[D@HDLPHDBC@IFITDLG@IIIFGVBNJDLN@VIRI@YIAIHIC@CLKZCBEE@JECEIHEAKGDGECBGEEM@@DA@CCCBBEGA[GEDBBoNAAH]MKiIAWKQoIIPMFQAEEDMH@FMSUYIeF@EK@BIOEKJEBICFKaKPFAFSE@LWCCFMHDDEKESBOGBKIEIODLG@CCDEQCEDWEMDIEIB@EHGEEDAEAa@@HqDEJGF[AECCFa@WCEIKAAEQB@FCAE^YDERDDJBLNABD@AJGLJF@FNIAMLH@FPKLJ@FE\\BFOLGXMXW\\C@KPGD@JHDGVFBWN@AEAGFO@KH@JNFAHEHYLNHFCLBFBBHo^MAFGA@KJED@Jó¶EX"],encodeOffsets:[[119959,40574]]}},{type:"Feature",id:"120223",properties:{name:"静海县",cp:[116.9824,38.8312],childNum:1},geometry:{type:"Polygon",coordinates:["@@NGFMDATCNDR@CCbINEHNJA@C\\EEGVE@IhE–[˜w”epc¢·²›^QEKIEKIgiQDkehY£uSDBMkUDOJDHC@GF@CAFBFEN@C‹Q@BeP@@G@HD@@MHQKi@[IGCOCESE@GMA_OcCGDu`aˆ@VZzKDkJBLNXGDqKEWE@cFEFA@ƒISIi@@KMABJGBcMuFEzGVH\\ATSEUBeALCEMG@CEBUHUCGXaBPtUBBFIBFTDFF@DDKBFNGBJPHXDDMDCLJ^mBIHIL@LR\\@LCR[@@z@NFD@LLBNb@RHDBNTPT\\F@BJF@BXCFBHHBDLFB@HODADE@@JHVXCPDHCFTLBBFNCDCCCU@@GAABEHHZHBCAEdEjFDD@GfD@DXFCHF@ERFDLBH@"],encodeOffsets:[[119688,40010]]}},{type:"Feature",id:"120221",properties:{name:"宁河县",cp:[117.6801,39.3853],childNum:1},geometry:{type:"Polygon",coordinates:["@@BFLBFJXDb@DEFD\\BHEFIrC@Gb@FBCBFFGH@FJAJFNCXFFCRDCFDDH@CKJPJFALPHTALFCFGCENDDKXF@ETEBO‚bLELJDFALIPFAJL@@FfEZJTVENG@CNFFRBNEJOpJLRBXjJNLG^BBpMAAFC\\HHBAFDADDB@@CN@FFAHFDCHLHFBJGFCFUNKJJTD\\XUXF\\^F@DDDQXXBRLRCBDFEVCDLVDpUl@LEDJHAPRFGL@CETGPBTCDDVI@CFF@GFDCCVGLKEK[Y@MECISG@BKNSCGCKWEAaEBEKNGFSECO@GGM@GYI@DÅCMLHPTF@DJHAVVNKEGDETJ^[TJNNd@NOAMFYJ@@GFANDPEJB^aOadSTQSI@MHBDIEOKCG@EEFCKCqXO@@DMFENCDDHCCGJ]AKFoDaGGHYFDHKJiCMFGC@EQ@AEHGAC@IEAATKOHGIC@IXIFEoƒGE[JCFCDHNmRADFZMF[EEBMO{GU@AOW@@]ZeHBDEHBKEfQkuIWBs‡@EC@d[@[^EDMTKCEEcI@cDAB@FCBCACmOCG{PYHeBgPwPFDDALFFFCHQGSD@BHFAR[TaFYXMASUiGFL@DQNCJI@@D@PLDN`ETEFIGMCGBCE‘~CAIFDPEHGEQPHJADFJGHCJLB"],encodeOffsets:[[120145,40295]]}},{type:"Feature",id:"120109",properties:{name:"大港区",cp:[117.3875,38.757],childNum:1},geometry:{type:"Polygon",coordinates:["@@JFFL°_`ONJKDDFIFZN xlb~yFVNRŒrdJGzDPVFBCTNND\\UR@E`F@@Ip@IWGUoawOEE@ÏDgK{İEEMFëC—b…™@—KwOCDHHKBDJCDEEEAGHOABFABMCgDLSQ@CFEB‰MgYIDQINE@AUSwSAdYEHQMEyK[KI@GRMLE@@OqOoBOnpJ@BmEAFHL^FDB[C@BBDVFAHFJENB@sNEjQAMYsUgCSBGDJH@\\LjGR@NC@@G@HO@AfR@DŒM@EFEADBE@@HGDICCPlVANTC¤vgZlfRChjLJ"],encodeOffsets:[[120065,39771]]}},{type:"Feature",id:"120107",properties:{name:"塘沽区",cp:[117.6801,38.9987],childNum:1},geometry:{type:"Polygon",coordinates:["@@|ODHnPBDADEDA@CB@ddJFFLDNSFC\\]\\@@cFDˆ@nACOMW@M@ITURBRZNHNWRQšoO•j½f‡cqŸAqeiDÿÍyÓįFL|Ch@ÐFFxPpbHVJXo@@JCTR^BPABQA]^MB@bE@@FQBFVJRH@FXtPNZSBAja@@NƒDTŽLJrQTHFXZFB`"],encodeOffsets:[[120391,40118]]}},{type:"Feature",id:"120111",properties:{name:"西青区",cp:[117.1829,39.0022],childNum:1},geometry:{type:"Polygon",coordinates:["@@@LHAHRHATh`LHNHDG`HDGZ`D@FQDAHXFACNAFLVRTBFOfHDCVBFQH@HSXHEPFB@LDBF[bDbLFKJBFLADBDjLvCPEI]FGEIGCBEUSjcFiBIVWfaHCjN^HtwBBFGPBJGjFBEGECGDONMFAP]TDHQOWCMGAMHKIJEIGQ]aDlUG]VGEGDC„{PEbBZmE@@GH@BCA@FMQCFMYMJECELCMI_P¯`]R±œ¡¸od“f—x•\\gF@JUFFH[F@DIBGMMFaJDDQ@MCSDCBENMH"],encodeOffsets:[[119688,40010]]}},{type:"Feature",id:"120113",properties:{name:"北辰区",cp:[117.1761,39.2548],childNum:1},geometry:{type:"Polygon",coordinates:["@@ROHFFGCOJEDB’}DFHANDJHFEFSM_KC@O@CJ@DIRM@CEKKA…L…FKACHoLSJSIBETDJaEIIE]E]K[MYUYQILC@GF[MGNKEK@A@BCWECAIFEFYAGFOMI[OFuDiKACBCEKIAELaKaCE\\CA@KEAFOWGGTG@ERUACDeGEPSAUQKHE`FNjNFJADHHCJFB@DEXZFRRBJLA@AR@@BJ@CHF@BRX@@NQdDBBJhHCCZDLUNA^H@BKDPFEJ\\JMPfL^AJFFGLBDGLET@HJLBCFHDCPH@BIJFCLGABHNBDEF@BCN@@FHDDDN@BNEJH@@HF@DEJB@FfLNC@AHB@DHD\\IFGTCBCF@@JNH@ALKHBHCHBDMFEP@KYbHDEJF"],encodeOffsets:[[120139,40273]]}},{type:"Feature",id:"120110",properties:{name:"东丽区",cp:[117.4013,39.1223],childNum:1},geometry:{type:"Polygon",coordinates:["@@ZV\\N^L^FJFFJIbSCAFTJTIpKDGLB†E†KLBjHTVNBZWbE\\SBQGE@ATCRHDGEEKECBECxOhOfAZGA_YEEWSGqRKIS„C@Mb@BiTAMYsOEWG@IQEURA@EF@@acUOXQRYCUDCHDTEF[SUEgAYDcVGJM`iAWDWLQRMHUHgDsDBLHJFCFDFGHBFFVEAGHCJN@RJF‡PIhBD\\FENCPWA@LFBAFHBEJUEARCDIAEDQBRNa^"],encodeOffsets:[[120048,40134]]}},{type:"Feature",id:"120108",properties:{name:"汉沽区",cp:[117.8888,39.2191],childNum:1},geometry:{type:"Polygon",coordinates:["@@LMEI\\MTABKN@FCDMH@COAcH[AoēA™M¡Wa[Meq™pQRMXMGQYQASV@J@NNXDPmBAtJXlveRLFGACFGAYf@^X@BPV@|HNPFA\\FNEEYBCnQGMDCDE\\IHFp„EFWJ@JJDGHLPBSFB@JBDGHBFR@@FHDNEjDLICGZEHGbHpCLE^BHIDDCGDCFMNE@CP@rWLDEDFFH@"],encodeOffsets:[[120859,40235]]}},{type:"Feature",id:"120112",properties:{name:"津南区",cp:[117.3958,38.9603],childNum:1},geometry:{type:"Polygon",coordinates:["@@TLv@CNHFFBHGZFETNPhCVGNGRQXKXCjBN_HIdUZChBVF\\TFECSDGVCZDRQPWdVNA^]RBBAAOQ]DSE@F_Q@[VMCSMADUECOHycI‹qMQEU}zkaŸwENRDENB@ADG@@HF@YnaAOFƒ|CDFHUHH^kVbCR^JHIFLJNGHBDNPXGRSCO^EBMNCPDHHFAFiEIHOAEH"],encodeOffsets:[[120045,39982]]}},{type:"Feature",id:"120103",properties:{name:"河西区",cp:[117.2365,39.0804],childNum:1},geometry:{type:"Polygon",coordinates:["@@d@hZNFdcLYXKRCtCMOFSYEGHEAGEDMu@SKAAsx]GMTGt"],encodeOffsets:[[119992,40041]]}},{type:"Feature",id:"120102",properties:{name:"河东区",cp:[117.2571,39.1209],childNum:1},geometry:{type:"Polygon",coordinates:["@@ZBVFFIGABEEA@KXBDOFM[EACJgˆOIE@QIMGDBHUFEEGAEHECEDGIAKQDWLKZcdQPEP@FOFBJTJ@HNORJf@DBCN"],encodeOffsets:[[120063,40098]]}},{type:"Feature",id:"120104",properties:{name:"南开区",cp:[117.1527,39.1065],childNum:1},geometry:{type:"Polygon",coordinates:["@@NMVDCG\\E^B@HlB@YEDS@C…HsNSiMGDebUXAJEjidVTAFHDFJ"],encodeOffsets:[[119940,40093]]}},{type:"Feature",id:"120105",properties:{name:"河北区",cp:[117.2145,39.1615],childNum:1},geometry:{type:"Polygon",coordinates:["@@DBXFADB@L@LFHM\\NHED@JKZRb]QMRAFCJBDCBQYADMCAe@QIMP@GSIAIPE@E[EGH@ZEF]^HJAXK@KF"],encodeOffsets:[[119980,40125]]}},{type:"Feature",id:"120106",properties:{name:"红桥区",cp:[117.1596,39.1663],childNum:1},geometry:{type:"Polygon",coordinates:["@@J\\PNHEZBFEJELEL@BWGI^]FEkA@G]A[FDHUCMNEHJ^"],encodeOffsets:[[119942,40112]]}},{type:"Feature",id:"120101",properties:{name:"和平区",cp:[117.2008,39.1189],childNum:1},geometry:{type:"Polygon",coordinates:["@@D†T@FCHG\\FFOROMEgYc@"],encodeOffsets:[[119992,40041]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/world_geo",[],function(){return{type:"FeatureCollection",offset:{x:170,y:90},features:[{type:"Feature",id:"AFG",properties:{name:"Afghanistan"},geometry:{type:"Polygon",coordinates:["@@ࡪ͇وŐǬϠڐŶӂʮǚڦ۾njƀ̚ІɣʪҴMوǯʲĹ،˒˰Nj˖ϪԈiżŬĘͺβ̈Ҕȏĝʱʪ¡ý۷ͪ˟̊ǰώĊԼϖׂ×ࢀAƬʋӧĥяƹ७ĭࣗǭӫλȤΣĪллΛ–͑ɳ̡ߛ€ͦ։՗ɅΥԕ²ԋ͡ɿ̳þٝŋğɻسDҵӇ‡܍થΓבôǝȁԇņ࠿űටіހހåզُƚßՔ˟ڢάҢιŮɲؒ΂ਸ"],encodeOffsets:[[62680,36506]]}},{type:"Feature",id:"AGO",properties:{name:"Angola"},geometry:{type:"MultiPolygon",coordinates:[["@@ȸصʌԋȘ˕͐ѯ֊æˤŠҬşŲɀɂӨԶ®ƤіHñ̡৴RfՉǞ͕ūԑÖԫ˪̷­ৃȼüκsԴŴϦ¹ĘʹĩСƨϿů̿î́ყZᦵ֤ۋպԽ໳΁᎝Š׋Ж₭—ŵÏԃϞկ~ԉƝЙDžÿՈŜ݊̂ޒªΰ˚ݶȨΆӘռːϐĘج«ӊʣ̜ɡԚȵԎ®Ǩʶͬʭ߼ǣ֚сՐĄǎΌŔʒg̎ĸៜ["],["@@ɉėɣلͼδʪƘ̀˽̩ǯƍɍλ"]],encodeOffsets:[[[16719,-6018]],[[12736,-5820]]]}},{type:"Feature",id:"ALB",properties:{name:"Albania"},geometry:{type:"Polygon",coordinates:["@@Ń˷ŢέΒȳiə˗ŧ»˙ϷСƛÐgȂү˰ñАîֶŖʼƗƂÉˌθаÂƿɨôǴɥȪďȨ̂"],encodeOffsets:[[21085,42860]]}},{type:"Feature",id:"ARE",properties:{name:"United Arab Emirates"},geometry:{type:"Polygon",coordinates:["@@Ƭ¤ŒɱڂƂ۞uԖ{ֺ֪ظՠՎԮdž˹ŖڑѕGçճƪŝϝǑE΅ʓΏuͷǝDZᡋъ͏࡚Ț"],encodeOffsets:[[52818,24828]]}},{type:"Feature",id:"ARG",properties:{name:"Argentina"},geometry:{type:"MultiPolygon",coordinates:[["@@ߗ§ѓ̔ԑx࣑@Aሞ͒ϵрؿનԋ୲ȿϙп"],["@@Ӵ؇͠ڰॠ“ƊǷ໶ോۊŷਆاࡾ͡Ŧχࠡ౧ࡒɭ़ŷڔƈނ٢ƎݐжLjфӝiڣۻҩ֟΁ॅࠃ૭ଧȽڥɣࡹT࠷ǽȇÝիËѫ੨ܙŗ׃Հν§Ч߯ઁఛ҉။ǩउĎǰԅǣػƺщԋ̏ࡱř̪͕߱ɗŜ࠳֨ʧҠˆʢѧޛʻڭԹūࡋȣ҇ߏEڃљʋؿؙࠞߦǝ˿ݭ঳Ӄձটލͧ΅Ͽ˔ࢍ֔ӡΟ¨ީƀ᎓ŒΑӪhؾ֓Ą̃̏óࢺ٤φˈՒĭьѾܔ̬૘ěӲξDŽę̈́ϵǚˢΜϛ͈ȝॺ͸Ǣƙ਀ȠࡲɤݢԊ̨ʭࠐEޚَոo۰ӒࠎDޜɓƶϭฐԬࡺÿࠀ̜ބռ߂צԺʥ͢Ǭ˔ඔࣶд̀ࢎĹɂ۬ݺશȱ"]],encodeOffsets:[[[-67072,-56524]],[[-66524,-22605]]]}},{type:"Feature",id:"ARM",properties:{name:"Armenia"},geometry:{type:"Polygon",coordinates:["@@୞ƀǨə͌ƣǛɁ҄˽ʁˋΦɫϘƏl׋̣}΃ӢHżχCʝɤǩuͧʖرȼĄФƛ̒"],encodeOffsets:[[44629,42079]]}},{type:"Feature",id:"ATF",properties:{name:"French Southern and Antarctic Lands"},geometry:{type:"Polygon",coordinates:["@@ը˃ߐĿˆDžɽϣಇÃq҂ŮΎÊǢ"],encodeOffsets:[[70590,-49792]]}},{type:"Feature",id:"AUS",properties:{name:"Australia"},geometry:{type:"MultiPolygon",coordinates:[["@@ߺ́ҜŘپNJԎÉÐঽ˽́ēگ̉ɰ׍בǧ®ԫ€ԭܘŗֈӝܸtϬռõ"],["@@̢ڇբ̈́˦ΡЖ͟đϋǴܛŸнɄĹɬܕąѥ˖֭࣬ѭצЋ֞λŋȯӔՃࣧ͜ͲȂ;ηȴźƢࢹ׬ԩϸ͋ڀڹʀڭtӏËԳА܋µݓơϵɩݡjӕǕ׻χއثЭ̫ٱ˫гʝܧ͕нɅػʼnׁªˇӕ̇व‰ޡ·ϫ͙ԕέ۟ψԥƪżѬҝǃ݁؉ܩɪӉƄӑÔ߿ʐիԮƻْțьЭ;߱ĸˢРȯزЧ׉ݝƷѮҬŶӞ͘ЬãجہܑԿ˽͏ڛٽΊ~ҀԿ،ѹ̀ǂȘઃԚןz߯Цຓāછ̝ख़˫ߡÈࢻљܯȗljѱ̳Ϳ܉qՅõݑƶ׿ğֽԁ҃ʕœуʁЗˋؕ֛Bࢽ՜ҋDŽlӖкŘƚȒ‡̠ĺאģӼѻࡖƏӒ˜ӎͭնsʚϋͰĽڄӓڔřΪτε˳ެиʑʞ͗aјеڎă˄țʦĠӠǢȸŘрęӮΎ؀Úٕ΢׀ۀˬЦΪٜ̰ϤàɴĻڎ̺ԚĤŶȀɞüҬoࢨʖҚώɊ҆ӲѐœͲvҘט܎ΠܩΦǚ̗Ј˂ТψǻĸٖҠаȮͨцƜ`ɼτĭdɂτŦОŔبϫҲӽՂMՖÿDZҦДڪϜɘſȾκӒԘ̒јıۺǂeі؛ˢ҂Ū֎ȻҀ·ۼɋʈĐԶʵӬʊ͂ñȠNJϬеɡ͉҇ͻ˿ƒĮͱʙп̗ЭÔʁڜҫ٨ˏѠ́؈ӻʂBѰɍŶʷߤ˵ֈ˼ǐҊǠόľҤʰڞŝОÔʔīӔŌنLjǠŽˬȮѾdžҦtʈ̸̾ʂЩÎՃȾķ˜Λ̨ёÚӇ‡̥"]],encodeOffsets:[[[148888,-41771]],[[147008,-14093]]]}},{type:"Feature",id:"AUT",properties:{name:"Austria"},geometry:{type:"Polygon",coordinates:["@@Û΃ӁCǎǻ˧էLJƗܽsщȏۛÞயɐȉ̊ࠧƣĭDžԗŢѕxϝƶźȴƬʪ²ьɹŤɜݎ•׸ƮЖ}ˀǣþƜšո̠ń̒ϰز˓ӀΆ̐ÚٶʱЂªϰǁãŃČ̅"],encodeOffsets:[[17388,49279]]}},{type:"Feature",id:"AZE",properties:{name:"Azerbaijan"},geometry:{type:"MultiPolygon",coordinates:[["@@ʞɣψDGŻ΄ӡֽŒщϰƃ͆Ǫv"],["@@ϊËƞɈԈͺѴѵђ׭ϺŸʸɧۗãƣٵƟ̭̍ȝvзȽ¥ԻѲ̂дʝʚ̿×যإk׌ϗƐΥɬʂˌ҃˾ǜɂ͋ƤǧɚȶƎضʍҐ¹ŘIJбҔɔŚʀ…׀ԙ"]],encodeOffsets:[[[46083,40694]],[[48511,42210]]]}},{type:"Feature",id:"BDI",properties:{name:"Burundi"},geometry:{type:"Polygon",coordinates:["@@Á০ɃϢԜßʲӎҀŸͧǸȏT˗ȹǭ͛ѫ̧̥΍Ÿ"],encodeOffsets:[[30045,-4607]]}},{type:"Feature",id:"BEL",properties:{name:"Belgium"},geometry:{type:"Polygon",coordinates:["@@؜áުǪՐοҦȝħ֧ɕĝһܿϦћßדІϷͶϷ`ũ̒ڪǔ"],encodeOffsets:[[3395,52579]]}},{type:"Feature",id:"BEN",properties:{name:"Benin"},geometry:{type:"Polygon",coordinates:["@@ۛįȹ׆žኞǛǦЮ̇̌ʱʞņѶ̀ĨǠξЪĀȀʤˮʘ̠F٘ә˩ȎӽǓͷĘɧСԳʵʳǁՉt՗µണ"],encodeOffsets:[[2757,6410]]}},{type:"Feature",id:"BFA",properties:{name:"Burkina Faso"},geometry:{type:"Polygon",coordinates:["@@ֹɐϽ‹̍Ƀϗǰƥ˦ϙǾÅӦɮΤo˴ښۢŬּɲȴОœΚǢŘɎٴϖdžˀ޼ΒҦŢɀLJՠJáСŔϣӀչ€НॺȏmֻǿʣЩÿǟν˿ħ݁lϳâ˓ƉωÖร¡qӉŘم"],encodeOffsets:[[-2895,9874]]}},{type:"Feature",id:"BGD",properties:{name:"Bangladesh"},geometry:{type:"Polygon",coordinates:["@@i׽̉ŶÆگʉѬµєDžКΕӨޟ’ü΋˃ҳΧǠũƵʃĠ͗øŽۖ̅لƜԒԫɤȆ̪Հ̼؅Ѽ֮̔ږεВ£ô׏ߞřު^Ӟƛϯ܅ϕµʷӍҢѥƎ՞ɶFѶ೯"],encodeOffsets:[[94897,22571]]}},{type:"Feature",id:"BGR",properties:{name:"Bulgaria"},geometry:{type:"Polygon",coordinates:["@@ʎΉ͚Ö٦ſ௾«иɌবȜ̩ؒӴĕѥΏ̫׹˔ӏܣŒࡥ˃Uлޅÿס̊ڧɱة|Ñ֊сːƒŢĝĴƘˌ͌ˀСδ÷̬ȸȐ"],encodeOffsets:[[23201,45297]]}},{type:"Feature",id:"BHS",properties:{name:"The Bahamas"},geometry:{type:"MultiPolygon",coordinates:[["@@ȵ£ɇӜ̿ʐǾՔʨ‘ۣ̎Jӥ"],["@@ࣷƅÏ̴Ђäֈ{~ɕ"],["@@ƟׯƷņ`ѮϓͪCĪڐϗ"]],encodeOffsets:[[[-79395,24330]],[[-79687,27218]],[[-78848,27229]]]}},{type:"Feature",id:"BIH",properties:{name:"Bosnia and Herzegovina"},geometry:{type:"Polygon",coordinates:["@@̦FȿσМ͓ūЃȡ™ƽû˙țūҥݓ͈ͅΘ͋Ȅϭ̾ǻʺЩϾǬΒ̞ȕǼǨϾnܠƓ׈\\Ϟȅ"],encodeOffsets:[[19462,45937]]}},{type:"Feature",id:"BLR",properties:{name:"Belarus"},geometry:{type:"Polygon",coordinates:["@@߼Mࣰ̈́ȚӄېːÿϔԜƚ͖ࣘࢮɁŢȻѲĴࠒȧĊЁǷɧՄս΂Ƴ»Ʊ֦Ʃʎɡ͝ǿڳˆljÿȠ˧ȸ՝ܝ¹ʵȁÃхͭĆݷ¡əȞ̿ƥ́ŨڍjफȬࡕàٱmҡɩГeϐʷϴԌǢLͰɷ͌™ϊ"],encodeOffsets:[[24048,55207]]}},{type:"Feature",id:"BLZ",properties:{name:"Belize"},geometry:{type:"Polygon",coordinates:["@@OŮĸžƴı̞ԔDŽZHūDŽGaɭƋεôŻĕ̝ÀăīщǓɟƱǓ̅ʣ@àॆPژ"],encodeOffsets:[[-91282,18236]]}},{type:"Feature",id:"BMU",properties:{name:"Bermuda"},geometry:{type:"Polygon",coordinates:["@@OEMA]NOGNG\\Q^McMOI_OK@CQSGa@WNLVWHFLJXVFGJ`ZRTDLeeWKIHGIK@@[MQNi`]VDTBHCJAPBJLVFjT^LV\\RJZRn^RH`TfJjZHHOTTFJP_NOX[EYQQKMEJOLANJH@HQHAARF@ZEPS[U_IcRQXE@EEKKOCGGCQCOGISKYGUC"],encodeOffsets:[[-66334,33083]]}},{type:"Feature",id:"BOL",properties:{name:"Bolivia"},geometry:{type:"Polygon",coordinates:["@@य़”͟گӳ؈વȲ۫ݹ؅ŗ͡୆ҋऺˆ߾ѳ΢ŏ؆ЫֲՌ࣢αۺȖ˰ƭ̶͠рh܎¤נǸ˶ܩഠزíѠnȈʪ݀;Ѷ͂સƚęؽļ͓ãࣰ֛ݫऴƑ̻ͦ֨ǕΐʑՈTӦʟšӟǐʕZγʓa͒এྖ“ūӟĜͧҞɽȤԹƫڋɯρĄӏʿǥaʶ޳јޭ^ัʓЕ݋sҋͥ৕ƉǸ"],encodeOffsets:[[-64354,-22563]]}},{type:"Feature",id:"BRA",properties:{name:"Brazil"},geometry:{type:"Polygon",coordinates:["@@૮ନॆࠄ֠΂ۼҪjڤуӞеLJǒӜŖӼBҦ̡ƴ̿Ƌ̻œį͔ýޔƿʤ֥ɪ΃ǏࢱLjÈଜʝҴˀǦăӐɰςƬڌȣԺҝɾěͨŬӠྕ”͑ঐʔbYδǏʖ™ӠӥʠՇSΏʒ֧ǖ̼ͥळƒ࣯ݬä֜Ļ͔Ěؾષƙѵ́ܿͽȇʩџmرîӃƟϡĪÈ౨ۏӷݏv҄ͅ֏¶DzΰұԞΓݴɜƶA΢ԖʎċҔɊ̈Ôϼ०ֲێNJŔŴݴŸϚᘰpθſӔύ̬LؐӀƒǚē†͐ӯĔYՀ࿖k˦̂ɸˉǐӷǂļҨѻٸÆnjʲشȞΊƐĮΤ׸ʆ¯Ǯ܅ðśՊ’֞ϓɒǀþجŅڜȿʐȤ؀žल̮͎̾ŏʂѪšȜȗʼnσ̀ŵȖϷɷ̏ƅ܏ɌыÔϳԬϿЮ¥Ģǒˆ˜ϠƦ˚ɢҬíȲŠҚçøǢƗǘĎʐͺõЈĒӔDZξǥʺɪȊ•ŘɿДÒ͒͊ʴؤӼޒ˺¢ȺҫҼ฽҈Ƒxׅمەʾʩ๤ƁŠࡃٔր੐̟ඊԡШӱƏҫ঎ʶ࿐ѹఴŽఔ۝੸व٪ʏܖ‘̦˅˸੭Ɣԗͯ൹ёշஅୡՙोثܯȿgɻءÒ༽ɹಓęօˇͧƫ૱࡛઱ƛࢁڹηȟԋ࣯Fೕ͓סύवʗ঩ڝ܅࠯ũطƔҫƽࡓȏЧחҥट๕݉ڗ֯Ͻϥߛ։ӑɷӈψЊӟֲڇҬࡹՠ̹{ࡅٰձę"],encodeOffsets:[[-59008,-30941]]}},{type:"Feature",id:"BRN",properties:{name:"Brunei"},geometry:{type:"Polygon",coordinates:["@@ͬ̾܎Ң›Я·՛Б€ǭ˹ϥѦ"],encodeOffsets:[[116945,4635]]}},{type:"Feature",id:"BTN",properties:{name:"Bhutan"},geometry:{type:"Polygon",coordinates:["@@΂ˍÏԩۇ{ۿÈՇſޅ͊kǚ֌زҒɈ׸șѺqπɥ"],encodeOffsets:[[93898,28439]]}},{type:"Feature",id:"BWA",properties:{name:"Botswana"},geometry:{type:"Polygon",coordinates:["@@ǜƭ˄ӡॎइήĝD̑ʚՑٰŹ՚ϝ஑أݭع˩֓ʧ́ҙãƧГďʽ՝țہ¤БɾΟĸХșȵГЉʧпϑ׻đȇ̐üԠӽߚɧŲAរࠤˆ|Ჾش„ಖ͎̎΍՜ͤʮDӂȎưÙ͔ڣ"],encodeOffsets:[[26265,-18980]]}},{type:"Feature",id:"CAF",properties:{name:"Central African Republic"},geometry:{type:"Polygon",coordinates:["@@ۜÚƺɎƔgȾȏ੔͐Τ͠Ѭ̌ĉ̐ʂüߺ½߆ϴ؊ࣺю;ՐƜĪΫӜԿF΃ƋΓÄʻ̆ʍٖοҢͻT˗֠ѫΖεɆԋغͩƊˉˣęաpكĘ̹ïųȱ˕}ͧDzधнϥĎŗÝʥԕطǐؙĊ՗̴ۓ˸҉˓͛яùדգ²֩Ƙԅѻѯޱėʐ›Ϧϧ˔̳Ѡï̠ЇѮæʢċΞÞٴȬƴц࡜"],encodeOffsets:[[15647,7601]]}},{type:"Feature",id:"CAN",properties:{name:"Canada"},geometry:{type:"MultiPolygon",coordinates:[["@@؎œުxЯ΅̵Å੥Φȿˬ͆ʸ̎С"],["@@Хcઝ˂ޯІ̄î૆Ɂ࡮Η|Ʒ"],["@@хŝൡϢʥ̘ݩ̌Ưʈࡻư͕ҜðȚࢨǿԨŵ߄ė˺̃дЋ࠼΍Όҩ"],["@@։ܿո˴֠ǵ̏̉ݚɱϰȴ࠼ʵʹ؛טƞņѿʼԷΝ݉ϝ‹փǂǾیɻńইܯԅ†צЂ߫Ȳࣙ¹࿅~ŹʠԼ̐λɬ۸Ԓࢄ೾Զӎܲ̂϶™Njɫ҅Չ"],["@@@@@@@@߰äʥ॓ܶگͯDԑϪ̵ϮчʾƻτºˎЂŋ"],["@@͡ѳχîəʢ Î͖ʦΆkɈǣ"],["@@ঝҧץnǿɪزϲ଼SiǍ"],["@@ƼυјżӨɗं˽४ʽöЍؤÞ׶˥ݙ˃ಳȬҽϚ࠭ҁ஡ѣ˿Ӯଗăܴдņڌ˺ޔ؈å"],["@@ष¥ȿЪΦҼޖŜپɷXέħřձʛ"],["@@Է̍ଉʬۃğଫϘ݊ʼטζࢼʃԎƯʦDžԠ͍"],["@@G࡭૰ڄ৐եʡح߾֥࢚؈ؖܨ°ईஞÝఔūૼй¼зس҃פ҇ŃУ࿩חୡŻࢃʨʣуߵ۽ʓοই֩ளÇڏΡÇձ঍Ŀਉڻ࣭ु͙ڏ±উంƕϜ޻ϼّ୲ǔ༞εࡀ͋׺Ѕ੆ɳࢸΟ൶µࣴąƍܫʼࡋ،ळనߗ٨˚ҔࡺѭೢףѶഎЀ॒לҮהç֭֘܌৷لলࢤνݾ˫ಾגȘ෸ɫࡸć۠ɚ޴˵ਚӣʮ͙ຄÛ}۷˪ਜ਼ގſ،ӵ௖Ұߦऔ֌ϸٺݣબੳघ৙͵Յ૤Ӂݰӓംɏբˍͬ܃ټŏͶͅÖऻ؍́׽̏൯̗੏ۑ෇ƋᅛǮుPࢇÍ۱׽ੳω௉૗ॵޡ܌Ɛഘૄᄈ۪సČݔЫߍ֟ˊࣟ˜هતп൸ŨࡆीÎ؍ժ̥ਣսᇷԁ࠯ͽय؁ٓ֍܆ฤ۞഍ƒणĹջӆBନύʐ֛ƛ˧ɚٙىʱٹ̕ϡΥŽˏ¥čȹ໽A౥MϛƷࢵ؃Ŀßˍ͝ޗBࠛGϛƅƊǑøʯeďષлࡽſউ҅Ɂ@˷ƂĥŦnĔȂ̎ЂҦʘӺǙܴǵނ࢕ЂľƬūĺɳ@ǛƆ¥ȤǍēɥ€¾ĊȡĊćɚٵːڹ˪ࠑ͘߁̨ݧʃ˝Sਕɔڻʼnࠁʺ࡫Ɔו¾ʻƜƫҤ˳IE͓჏BᮝA᭯@ᡃ@ᠿ@៙@ᢡ@ࠛ@᠁@ᛷ@őF྽ࠜ׵δຽΐҳݖŤԨ੻ΨƧڴ৭؎iѠҲКwՌෙ՘࡭ॠՁ׾ޑϚ֣ΈѿѢࡇ˕ࠇҹݛւדπࠋɸࠟ|JⷎNᷲ༬ȭ೘Й࢘û݆ΖৰˀఢĹ఼τ൘Ⱦ־ΑظȠȊЄ׈ęෆݫ૦֬ŖّਔƐ͆ʖৰ·౼Λዸ̭ୄƛࠖÄଊэ஁зຶǷᗘIJܒƦࣆԋࣴьࡩΦժ˼৾žڦĎڴȩࡊҗरä๢ϛಬƄ௬oĭԺݞƦದ˵KߑՖڠڰuϞࡊ࣑԰কͺäघশ؎ૌƇࡘχଞॅݗЭ༠ǝ"],["@@нϿሎʬୠщॊіސ˟یࠛфΒ׭ࡰ݊Ŭ࠲Ƈश͹ՆࠉʼץථеະЉĝσൡã՚͓˱ູ̯Ƃฃɪঋ»ཅ˷ᒃű๻āҕІଫɮݙģਛږ֔ĚಘƜஈ›રƦྷȞᅗã஗jѷ̴ዎͲಗ[ืɚ۶ـגͮᖬԠ࡬Nj"],["@@݉ևಹך˸Ş૸’ٔȁ"],["@@öɵࢿ|ࣟjࣿőʑ¼ऍѾ˜̠ИÈነěชң"],["@@ڎԽޤڴᒆΈ෺ࢅůջဒʒߒͮሀыୄЏŊν༚Ȑ࢘՗᎐ܸͩ͹ߐ޻໯ϹጘչೲȁீޙೖÇʽכ้ঋਗά೓߲ઙĿŁӕࢪӥଜϯΌɟմࠩ́׿੕ɪᑏڨஎܣ࢔ԕƎ̉ᗱͲᅩӤ৳Ц̌ʂయќ௥Т`ʑᝡƅ܃˾ֆؤ཈dႸņ˫̜̊оચࠊɳϊ͕˾౿Рၳ˺՞ɆࢷԺ݋´ڏ˸҇ʛ຿ŅᵝȈᄫʚഹŴۥ̐࢞Ϧ஝Hˉ࡚٦ݨࡺ΄ᓪɢأի"],["@@৊ǯຄńɖʑ޷Е౜αƱݳ൝͗߳ê׉͎ᐡٮjˎ႖ĽएռসР"],["@@࣓عय़ŒԽ݆`кѮΨ࠰ɮც‡ྈȱళݟ৉Ǎ"],["@@ᕍЙѷςኹѺήΤ׌ؘܰւࠑԦᭊƀ஬ǧᒰ±ࠄʑࣖΝ੍ɃᏝןਫי@ν"],["@@ҙ͙௝Øৱɖ҂Ϛீɨܼ̬̍ˇ"],["@@ٞϵ€љϣس൱đࣗƈjӬ൝ÝÁٮࣜౌ˺ஂµÜŎ"],["@@̙͢ݠƘࢢ™ƪЩԝЋ᭗Žᑯη౩mŅ˜პϊ④ij୯Ʈପࠐ߈ɾᛄ˳๶ӻฺÛறߨޔ̪ࢄĭ˲Џ"],["@@ढ˓ကFܨˡȑ́८ȍՔȧଊ™௬ë೸ǼႊðീÏ࣒ͅȊ΍ԽɟభǷ੽ĸᜱŻႫcഫļᖁ˔̃ҦĹжࡇξ჋ĺঅʼ͂ΈႾÁ"],["@@ŗ٣٩̇޹£༝Ϋ഍ŹଗǼ@@ුؼႮծಆ[ସŬ"],["@@ϣy༽Âɡɼၜ]מƻĵĩ"],["@@༩ʋఝ˔ڼˎ௮Đஈſ˩ʥ"],["@@৽ǏඉBbŤࡴʦҌદǝ"],["@@కǥۃȚέ͂áΎજ‘ӪÅ৐̇ɫ̣"],["@@͜Ε൏Ĥ൩˘ሏŒߺʠ৫ȮÕ͐࿶ŕᗢ̫ٞЍ"],["@@০˕ଽʟ༇ك๥Óდņࣗ΄^̦ڔɢ໡Oए˨ՑϠ׌ώ׊ʲࡴÎοȖዜ¨੶҅මǵ൞ǃڒև"],["@@ᖢßᅮŅ໤ɫ™ɡᏅη᎙ǟݻȉᆬJጡԙേʃ෯ۇႿƓՙǡᡷěୈĿׇƭ۞бߙ˽ಛʃЋ͡୫ʣŞȏ෬lȳᖟԋᔧɴឿŻధĸཟªĿЖ༊Ȑб؆ԢÐᖤγ଩բഹLjڼ͘๰Ȩʄ̊஋͠ΥѠᘞ—ڒĝ಼̪ቃĬ᰽Á๣˸۩ͼগʘȁ˺దLjঘ‚࿲ƌం̺ਬ©ࣤɽٔҒૐƈບĢᢲ–Ҁĝ᝚ƚᆔÁᆒÁ"]],encodeOffsets:[[[-65192,47668]],[[-63289,50284]],[[-126474,49675]],[[-57481,51904]],[[-135895,55337]],[[-81168,63651]],[[-83863,64216]],[[-87205,67234]],[[-77686,68761]],[[-97943,70767]],[[-92720,71166]],[[-116907,74877]],[[-107008,75183]],[[-78172,74858]],[[-88639,74914]],[[-102764,75617]],[[-95433,74519]],[[-123351,73097]],[[-95859,76780]],[[-100864,78562]],[[-110808,78031]],[[-96956,78949]],[[-118987,79509]],[[-96092,79381]],[[-112831,79562]],[[-112295,80489]],[[-98130,79931]],[[-102461,80205]],[[-89108,81572]],[[-70144,85101]]]}},{type:"Feature",id:"CHE",properties:{name:"Switzerland"},geometry:{type:"Polygon",coordinates:["@@ƫŹȳϞƵіwá΅χƙةŀǻ͹ЏơƄһ˵Л¡αǶ˽ςБſ^ϠؚҾɈϤûɲƞ܎MǦǼ࣒ʱ"],encodeOffsets:[[9825,48666]]}},{type:"Feature",id:"CHL",properties:{name:"Chile"},geometry:{type:"MultiPolygon",coordinates:[["@@Bም࣒@Ԓw˧ͻܛʻЭ‚ӻä؏ʨ࢟ŨੑҸ࡫Ҏୃशۘǭ୼֗૜̟ѢϬ˘ֺޠΎװı"],["@@͢୅؆ŘĺɁ˿ࢍࣵг€ඓǫ˓ʦ͡ץԹջ߁̛ރĀ߿ԫࡹϮฏɔƵCޛӑࠍpۯٍշFޙʮࠏԉ̧ɣݡȟࡱƚ৿ͷǡȞॹϜ͇ˡΛ϶ǙĚ̓νǃĜӱ̫૗ѽܓĮыˇՑ٣υôࢹ̧̐֔ÄgؽΒө᎔őުſݝPЙȷݷ̣Ɖ޹Σoॅ˚१ג@@ਲ਼ӔˁՒʄӰх֒Ņ෤Φ߰ࢴٰౣʔߞݒ˸ඊत̏Ѯგ֝ɠʿ਻ՉŠ˂ல˺༒ϮָʍࠎéूΠ„Ԩപ׈എΤబȗ఼ʤۚĵਞӮਆưྺ˒ნˀሤÕ൘ǩ஄ќɌɦњЬֱŐ؅ѴΡ˅߽Ҍह"]],encodeOffsets:[[[-70281,-53899]],[[-69857,-22010]]]}},{type:"Feature",id:"CHN",properties:{name:"China"},geometry:{type:"MultiPolygon",coordinates:[["@@ԑഓΫۏѷ܂ĩخӶࠜڦَϨʡƣԓ","@@ܩЗۏʺyܢаϠࣾɾӚoȊ͍σσșӟ"],["@@ฬˍ঺ׯͼ߃౨Cܰͨ൸ʜѳݱ͙̭˽ः֡ࠇ৵ƪܝ̑ɜܙť঳ѕwLяթӺͯһಙαƀѹܩŒЍ˂ֽ׭ऑҋۃա୭ʑأϽࣝɭ҂ϴǭ͞ږ֠ѹѲܷ̓ॉ׏ԫթ࠙¡ѓϻѸ֩یƏ„ϕڔʕस׶ݚ͝լuƌѱஓɻϻҏࠇућיࣜҥͦࠝԞޓ֮٥_دՅɯȪ҃ӶʻŻۃɇڗҷ÷ؗࣧڹિޭোିޡୟۻृĩԣύ̃˘Ӈй୭сࢵŹ˻ࢱҭ·ə؎Ȧ͘ૻːЇƍࡍɔЏ΀ƄӜޏƶЙܑ̀҃ࠇīڡJ҉ȳѥūŶ॥҃x÷Ȣ}Ύ؝ʓεƸر͂ʔۤՏǎȧޜࢱƓĴাߔۮ”ۚ{٠νȨ˭ӶӭÙࣟŲ˴ΜϿԺ׳Ν۵ȸॷ՗އسڳĿοɦѹr׷Țґɇ֋رëڌԟǭওĈोȖڿτٵǔ˯ЖҽŦࡓոکʴΑȩଢ଼טࠛՒɽऐ׾ő‚іͭјĐۆࣙঠ൧ͼʝ٦ةϼƫʌųӎˆ͜ԛȔ˟ďɇިʈȔśȠߤЈ׈ǐࢸő͆՜ંIJͮ̚೜ҔŠȐãӐּɔݱฦဘͲјȈ؆ຒဠˡҲϞ¢ࡆۦĀٖ֔͢èɚו۸ѽப̿׆ڱ͕ঙ̢ηূƝଆŝ৪ԻԲġϤޟӲӿऒnჄȉ૤Ŝࠦůఔԛ৮BόʽঐҌബ̈ాŒঘ̒׾҈ך˰Ƌˤˍ͔ѴըӀùࡺǝ࠸Ѿ౲͚؞֊נʆ௠ŐڐĥĠ̘ݿזګː٥̳ࠣžӇŃɏΆר࠾Цو৚̓ஆՎQτݸࢾҲːWҪңȦۜмਰƲ૜vసʡ݈̱԰ࡏ̀α̊ԩ̶ࠕ"]],encodeOffsets:[[[124701,24980],[112988,19127]],[[130722,50955]]]}},{type:"Feature",id:"CIV",properties:{name:"Ivory Coast"},geometry:{type:"Polygon",coordinates:["@@ϣUוǒ՟Wহƥ׍ʍ̯ࠫNjvÞۖĄŀ}ͨΣΚˉÈʕɲǾώčО ʔƄB¸ξÝnjĄŜ̸ĶȹڨȗΎæ˸ǘÞŊúɸųٮOƸʖƢgʎĦžΫȞłΌŰϚǽƦ˥Ϙǯ̎ɄϾŒֺɏɠ஡Ο۷ɕेθܣ›ͧ"],encodeOffsets:[[-2924,5115]]}},{type:"Feature",id:"CMR",properties:{name:"Cameroon"},geometry:{type:"Polygon",coordinates:["@@Ľ°ӻŇԝŒЋÅ൅nŬڒ͟֊ϧƚǟϖɋŦXɶɎתЎ߸ʒRԄӮ͈bҾΉ־˲ĀΔȌͺžь҆ΊǞךDzȊŢѨɜ՚۾ٲ¬˨ĠƲͫͰ‚ˌʂ¶ͮ՟Ê֏‹֏ҜޅҷTʁÏϥČǻЅӸөμƛŠΏˆ׃ſɩх࡛ȫƳÝٳČΝåʡЈѭð̴̟џϨ˓œϥĘʏÓґڛȤڷɜ੗"],encodeOffsets:[[13390,2322]]}},{type:"Feature",id:"COD",properties:{name:"Democratic Republic of the Congo"},geometry:{type:"Polygon",coordinates:["@@»ঙͶŕˑ̗͓ɟ͍ѫǯϷ±ګț͍Oهʍɹ‹ԃŗÝýҟɄϡÂ৥ưޝċѧǘӣӤҹҒ੕ͥĒ૿ƙɣĵʇՙȊχƫষĻࡇɨƫט͝ɲƴìٟࣟR·Ҧ̳ΨٟŠȋѰԣ˅ڧŞ˫ϢՕüϽqµʾ́rϥºԳųιtȻû®ৄ˩̸ÕԬŬԒǝ͖eՊ৳Qò̢ѕG­ƣԵɁӧűȿҫŠˣş։å͏Ѱȗ˖ʋԌȷض៛\\̍ķʑh΋œşʼɊʀμƎɎ̪ǰɚđ˼͐ҜSÄʃ̼ƩӶՄӨШɆːƒ۔θࠆϬўքМĪˌt̰Ǝ̆«ӊŀݖǐԾʦ҈¸Ԕúה͜ѐҊ˔۔˷՘ؚ̳ĉظǏʦԖŘÞϦčनоͨDZ˖~ŴȲ̺ðلėբoˤĚԘۙϘķɤƖϲÅҶDzȦΫ݊֏"],encodeOffsets:[[31574,3594]]}},{type:"Feature",id:"COG",properties:{name:"Republic of the Congo"},geometry:{type:"Polygon",coordinates:["@@̿˾ʩƗͻγۏࢸٖҪ̓֌˾ɂ֦ĺäό҆Зݐ•ʴЈł֒ĝڀЉӺζ঄ȽǘسçɻѢÔξ੘ڸɛڜȣÔҒѰ޲ԆѼ֪Ɨդ±·ԓʥ҇ǏԽĿݕ¬Ӊƍ̅s̯ĩˋփЛϫѝηࠅ„ۓɅˏӧЧӵՃ̻ƪÃʄқT˻͏əĒ"],encodeOffsets:[[13308,-4895]]}},{type:"Feature",id:"COL",properties:{name:"Colombia"},geometry:{type:"Polygon",coordinates:["@@ΫȤЭ˨ʅƅ܉Ŝȱΰƽ_࠿Ӓŕʺ̼ڛтȢ̦иÊΞՆ͐Ѵ̳ȦDŽӦȏސǸɚƃ܄ͻ҄ņТ˔ÑǂʠțӶĺŬѢـהΌĚT˦ƺ܂ӖϸՊfäǪڂéڌъ͞ȊОК̖»ɚɛǍ˱գƕɇп͗ʋʓ̷Ĺ׵ɷӭѢÇņϭȄȁâ͹ij̵ˆǫȸéȨ̉ઊĄӦŃעܡͼĚ؂­ӐĪ̔ƟƱҍȇ˯ß׻ǜ֑ʆʟ†ȉэл̨ȃɠ̋ʰ࠹ǁĻǏӸɷˊ˥́࿕lZԿӰē…͏ǙĔҿƑK؏ώ̫ƀӓoηϙᘯп҂ʣpժࡤٟϾԍị̈ƤҧɝصŀӵࢤϳɐˍІ֑Њɡā"],encodeOffsets:[[-77182,-155]]}},{type:"Feature",id:"CRI",properties:{name:"Costa Rica"},geometry:{type:"Polygon",coordinates:["@@җȆǟǮĬƤ‰ȄɷȪͥǔ́ņÅʖəƮÄʑǗȩȓɸˑĊŗǞLʮŎˆʁŠȖnjŴňֆɝȖŊˊéƔǥʜÇȪDzɈҙ͖ͷЂΩ͗õLͷǪűűıƱëǟ©Ǖ"],encodeOffsets:[[-84956,8423]]}},{type:"Feature",id:"CUB",properties:{name:"Cuba"},geometry:{type:"Polygon",coordinates:["@@ܨÑڊW߄˹̭ͮ޺Ĩ̔ȡ܈ԳԺϛˢ\\ԆǟÕʁئ“ٌ΅ıȟ֑Ń֡¥׃âளą֜Ҷ΁ɔէÈ̃ʐȥӎӃ޵ɦʥǬભž̋ǐ̀ɀࠗ¨׿ѧΏ[ťȳеğΫĂѺʸǼ̤ϞȈіǎَĄȰĢ"],encodeOffsets:[[-84242,23746]]}},{type:"Feature",id:"-99",properties:{name:"Northern Cyprus"},geometry:{type:"Polygon",coordinates:["@@ÐJŨȮ؄Yކʢ֧ΧÔƿęˆLJÙűj¥iĎѾNjVɫïƿ¬"],encodeOffsets:[[33518,35984]]}},{type:"Feature",id:"CYP",properties:{name:"Cyprus"},geometry:{type:"Polygon",coordinates:["@@€ãࡱͿЩŊȟͶЎŒǀ«ɬðnjUÒ½j覎ŲiLjÚ̇"],encodeOffsets:[[34789,35900]]}},{type:"Feature",id:"CZE",properties:{name:"Czech Republic"},geometry:{type:"Polygon",coordinates:["@@ϯǂЁ©ٵʲ̏Ùҿ΅ر˔ӃΰѕȬėΠƧʠؒǾ̸Ⱦ׾ǎɂdžɜīϒĖЊ˓ؼñ¿ɳҘǧŲɒּĥĄʿز»ϮЯʡCŽƯȕ—ÅȑLJ¡wý˹ēϋbšȁ"],encodeOffsets:[[17368,49764]]}},{type:"Feature",id:"DEU",properties:{name:"Germany"},geometry:{type:"Polygon",coordinates:["@@d͗ࡔțS̗ࡢǂҾɰॊͧІˋȞёɹɣ̨̙Ⱥ҅ß́Έ՛ϑĕɛĬɁDž׽Ǎ̷ȽؑǽƨʟĘΟіȫӄί̑ϯ̟ŃŢշýƛʿǤЕ~׷ƭݍ–ţɛыɺʩ±࣑ʲǥǻ܍Nń״ьֺ௅ƸЇɘ´ςǗȐĨ֨ƗࢢԎ@Ɉ͂Ⱦޔƿ˴ǐDz۰°Ƽȃ֮вȓ̀ӈٌōՠŸ"],encodeOffsets:[[10161,56303]]}},{type:"Feature",id:"DJI",properties:{name:"Djibouti"},geometry:{type:"Polygon",coordinates:["@@ȤʹΑӏȩήɯ̱҇ȅƬȭÏҷb_ʮßɶ˴Ѐ̐ϊήñʪȴ"],encodeOffsets:[[44116,13005]]}},{type:"Feature",id:"DNK",properties:{name:"Denmark"},geometry:{type:"MultiPolygon",coordinates:[["@@ԋڹ࢟ӄŝΒ௼˨ˎу"],["@@ȵ̓ʡĞ؁؁ɮХ՟ŷًŎͽҲ}࡬Ɣɪʌʦ݌À̐ɴڮʂƒѝʟ˙ĶɽҘŵ"]],encodeOffsets:[[[12995,56945]],[[11175,57814]]]}},{type:"Feature",id:"DOM",properties:{name:"Dominican Republic"},geometry:{type:"Polygon",coordinates:["@@ŀƞپIӾɏɜtƴ̕Ҡhʡϐ‰Ю̷̯ͿЍǼϫ•ˡ¢ƱƵ͑½ŷȲˣťͳֻɏƆ§ʎjɬɍʦȲƚÞ͒óҜ"],encodeOffsets:[[-73433,20188]]}},{type:"Feature",id:"DZA",properties:{name:"Algeria"},geometry:{type:"Polygon",coordinates:["@@ᮩཽᝩ࿷இϑटćU՘ϵƌԹʊȧЀᬻᆴᬻᆴṕᎠfnj@ÊQ঺ബب࠼Ÿێɦ͎тচͪ˜جӢòϞ̶સƚƸ͜ɛDz̃ࢲ¹Ԟ́ՠ߰ҠࣦƢՌΎ߶ʰ෎Ƭർæшůߊͨ࣌P΀ȝֺ¾ǟћƄߟȡۙԭҵôمۊԃRȯԮ͹Ϊຝ˖ݏ°ϵƧۇÔϥŃҟòՇͫΗӺؓŽέ̘ҵϼƸڒϷςՃ"],encodeOffsets:[[12288,24035]]}},{type:"Feature",id:"ECU",properties:{name:"Ecuador"},geometry:{type:"Polygon",coordinates:["@@҂غǻξ͍ϵԉςǞʀƙބ̎ŴƺԼ͆զÍ΄ҢǸ׀Ͱࡀӑƾ`Ȳί܊śʆƆЮ˧άȣŞٓʽճࣷ࢟য়ͧԥܵǃ֣Ӆ΋ΙъͻĞ΍áw̮ʈȨıΔ"],encodeOffsets:[[-82229,-3486]]}},{type:"Feature",id:"EGY",properties:{name:"Egypt"},geometry:{type:"Polygon",coordinates:["@@ɽͷǹىɫѩȝƥ˩˔ϛϒ׵ஸđùΐࢯԪࡋٌವ̴ҙ˒ӃݮछǗƣ‚ճ঒ݭƨǣΏ@Ὁ@⁩@@ᶶ@Ჴʥڲɐ԰Żά̤Ж૦b߲ɝ࠲ʛϴſ٨ˊΌʊݎêװŃɮеȜ˜ڨȣټ³аɄւ෽"],encodeOffsets:[[35761,30210]]}},{type:"Feature",id:"ERI",properties:{name:"Eritrea"},geometry:{type:"Polygon",coordinates:["@@˻˖ΉӰϋ˒ɏܷ̄ͶֻXȭǬӯȡԛϢʽط঑ǬęʹβఀĊ֒ˆʴؤƐьӒӦঃɴޗҢУବߏҲӍҖӝˀ˿аʧʩȳέò"],encodeOffsets:[[43368,12844]]}},{type:"Feature",id:"ESP",properties:{name:"Spain"},geometry:{type:"Polygon",coordinates:["@@¦״΃θஒ؆ਊƱ૾NࣂƝۦªമƒͰ͛໺ϡ̨ǺीϝআŊ®ӥߓ֓ઁǯõ˱ԩү͕ہ͞ӑӟϑǹճىǗש٥੧_ߟhՃ͍̓ͅЩê̵˴ʃӚ޷žé˦̶̀Śɬ̃ʢɶրͳԌδè’ЈƎŬZپϲɪɻфөˆƝŁӹCɁЬ΃ū̥ɇ"],encodeOffsets:[[-9251,42886]]}},{type:"Feature",id:"EST",properties:{name:"Estonia"},geometry:{type:"Polygon",coordinates:["@@ĮӸ̱ŁՓ̘ñӘਫ਼ɼ੔Ũ࣮Ƒࢂ|Ŵƣׯӝʞ޵ΫˉۙDܡ̸ρļ܏Ʃ"],encodeOffsets:[[24897,59181]]}},{type:"Feature",id:"ETH",properties:{name:"Ethiopia"},geometry:{type:"Polygon",coordinates:["@@ԜϡӰȢȮǫּWܸ͵ɐ̃όˑΊӯ˼˕̏ω˳Ͽàɵ`ʭҸaȮÐȆƫǽ̴̕ҧ̴Й̛͎ᩨঽۺNᛛᡃફ™ݟףաeɯ˅ַB͹˴ލΙʝΓ֕àȃĬȟwˇT੟܌ב@˹ˢ@ҾѧƘӻࣴϥȚƧʹэЦԧÒ˸ӐҀrŲʰ[ݲʞࢠЊɾĎ΄ήٜԔи΀ࠠƆܠ঒ǫʾظ"],encodeOffsets:[[38816,15319]]}},{type:"Feature",id:"FIN",properties:{name:"Finland"},geometry:{type:"Polygon",coordinates:["@@ūיಀ֓ޡى঎ख़֡ܛݴس΅յఘֻ́ѓޭӟᅡੵໃá๑̯ൃǯӡҞ߿ˠȈࠢСݶАӪނՆ኎࣮֖Ǭē΢ୟЈ˳͜uಒ಻ֲ૩ЪԊɞतѻલ¦ࣘȭߠϊЬ؞ಬ˶઄ͯΡכ"],encodeOffsets:[[29279,70723]]}},{type:"Feature",id:"FJI",properties:{name:"Fiji"},geometry:{type:"MultiPolygon",coordinates:[["@@̂ʍƓѭԳŗҩļąτ͖̀ϤĻȼƐ"],["@@՛ǯŅ̼оǤˊ°Ӱˀ@ЧՕȷ"],["@@é­@ШǨžĽЗ"]],encodeOffsets:[[[182655,-17756]],[[183669,-17204]],[[-184235,-16897]]]}},{type:"Feature",id:"FLK",properties:{name:"Falkland Islands"},geometry:{type:"Polygon",coordinates:["@@৘Ԍ܎ȿԌʹڦϙʥ̋ଋʥϙ̌܋ϙпϚ"],encodeOffsets:[[-62668,-53094]]}},{type:"Feature",id:"FRA",properties:{name:"France"},geometry:{type:"MultiPolygon",coordinates:[["@@ˣ٭ϡǠș֢ǜ̺ը͎Ɯܛ"],["@@הЅќà݀ϥȊñʎjЈɗெƷыֹŃ׳ɱƝϣü‚ɇؙҽ]ϟВƀ˾ρ“ʁʚ̿̅ʯɐٱҖŃĩηݿӅစɬ௧˗ĩԑঅʼnिϞ̧ǹ໹Ϣͯ͜ѢԎdžူࢁࢤإю౹͒čؖઠǾථɏˇॎߌέዠپʨێܾǞŪ̑ϸ_ϸ͵"]],encodeOffsets:[[[9790,43165]],[[3675,51589]]]}},{type:"Feature",id:"GAB",properties:{name:"Gabon"},geometry:{type:"Polygon",coordinates:["@@ࡹࡔ։ۚԙࢄ‚˨ǾˎȲؔǜخ˴¶௢SOৠЌÆԞőӼňľ¯ÓνɼѡشèȾǗεঃЊӹĞٿŁ֑ʳЇݏ–҅Иãϋ֥Ĺ˽Ɂ̈́֋ٕҩ"],encodeOffsets:[[11361,-4074]]}},{type:"Feature",id:"GBR",properties:{name:"United Kingdom"},geometry:{type:"MultiPolygon",coordinates:[["@@҉ֽًǦԱ[ǦҊǥ҈۴–ࣔԳ"],["@@࣋ࣧࡦŘऄIɕۅݯݩࢄÃäĕݠ঱ֺƇԬढ़ʈͧৰDžķ՝ѓʗͲѣݱѯ૳Rෝɱϻǒ։ϿޥĪם͍ҁǘ௼ࢨݪǺOBಽƔʃͰ࢜ʺҡҐdžռఢ÷D@ŮӤ֛Ԯ_\\৵ƨȧɬ̨ϒˡɴҍЇ·߶щє̨ࢆٶھڤá০ì"]],encodeOffsets:[[[-5797,55864]],[[-3077,60043]]]}},{type:"Feature",id:"GEO",properties:{name:"Georgia"},geometry:{type:"Polygon",coordinates:["@@Ųάȿִӟ̲ҭĬ̯ʴĺIJ܄ƝఆƋଦЕƦƻԚƂ޶ǭʴ·Նșɓřвғŗıҏºصʎȵƍଢ଼ſ߳Юࣅ¡"],encodeOffsets:[[42552,42533]]}},{type:"Feature",id:"GHA",properties:{name:"Ghana"},geometry:{type:"Polygon",coordinates:["@@೉ӯҳ˽ݳʑݡʆœͨηܤɖैΠ۸ɟ஢ŗنrӊฤ¢ϊÕ˔ƊϴáÕʿΖџC؍Ąڍɂ̫ȅݳäйɢՓȈ̍"],encodeOffsets:[[1086,6072]]}},{type:"Feature",id:"GIN",properties:{name:"Guinea"},geometry:{type:"Polygon",coordinates:["@@ʃtǡͷʁJǏǴÈͶΗԨɕħǵmɳ³V̮Ƈɘ‚ʔǻΜɹ̜ڥDțǁɵoƝǷīɹ҅σρӼ͛͢ɋŊȿǖħϊūȂʓƐώЦʮeɖƘȄDƄŎï˨ĢĖd˶МU؀ȱȄlÚĤҜáŨ´¶̭ƆBɖŒƔƒɸɇάãɲǺ˖ŒȬŠǚuȈȁĴɳΆΙǣɏ˙ǴĊŀį«ʡʲʍǗÝå˷Ș΍Ⱥڧ̷ĵăśÞNj·νƃA"],encodeOffsets:[[-8641,7871]]}},{type:"Feature",id:"GMB",properties:{name:"Gambia"},geometry:{type:"Polygon",coordinates:["@@ņόࣶzȎȦˊ`ͨȷʼIˢƚǞʏεȋιdέǰ̷ȗƭQȫŝއl"],encodeOffsets:[[-17245,13468]]}},{type:"Feature",id:"GNB",properties:{name:"Guinea Bissau"},geometry:{type:"Polygon",coordinates:["@@҅ΘΝÈȕʀLŸʯǴÁǶѼƌ˦ɦĨ༈•c˵ġĕð˧ƃōȃCɕƗʭfύХ"],encodeOffsets:[[-15493,11306]]}},{type:"Feature",id:"GNQ",properties:{name:"Equatorial Guinea"},geometry:{type:"Polygon",coordinates:["@@ƿŴ़̀െmPয়௡T˳µ"],encodeOffsets:[[9721,1035]]}},{type:"Feature",id:"GRC",properties:{name:"Greece"},geometry:{type:"MultiPolygon",coordinates:[["@@Ҡ˱ٺ¶شÑqƣҜĶĿʛ௃íTƒਁǎƺΦ"],["@@ʹՁȥĥԟ|ѫĀৱɓ׌ҿяƋҳAѻўƿȁȊԅрЁ̓ǿҴϯжʑ^ӅޥɠʜѕՓĕ͈ݏ֏Yۍμ̿ڦƧ֒͝ϮљӐÉʆϸТ¼˚˘Ũjɚռö͌ȀҖgƒƦdž„ت{ڨɲע̉ކĀVмЦɝ"]],encodeOffsets:[[[24269,36562]],[[27243,42560]]]}},{type:"Feature",id:"GRL",properties:{name:"Greenland"},geometry:{type:"Polygon",coordinates:["@@ᬜԆ᱒›ੴ̴ᲈĄ䀦Ŀ㉊ڗ༅͕ộ™⭏ćшƫᲐĠᡚ́࿈ʴۦ̝इӧᒞ̺✘͚ᠼNjҾΫ⃝ױӃȕ᧑ơወ¡ছؕگկ€ध৚շಽ“൧ˇ༂ѽȢ܋࣍ýઞܡህÑঈ΁˟̑இŽ୥E੆֩\\Ϗပΐћɣଌȿ઼ԣ͈ڱກlj٫͖ਣӘ˼֭উѵᕖ•୆¯ᖯܵᗿڏឧ́ओIࢅ͓ୟࢱᅵכׅ“૧ȷ஽ȝܛԱ[כыտോڧͺٿϗ۝љࠍஅ½఍ۈဿLࠁҢ֕ࠐฝਲэոŗݮ୓ޢ̢ئ֗̒ࠪচొ̺ͨΘǬڀॡ̕қůݯţਏ˜Éְ͢҂ެ\\႔ɟ෿Քݩ˾࠷ş۫ȼम޴ԝ̺ڗ׈ৡࢼ੯͚XΚᖷӮᄻÖᖟ‘Ꮕ×ইˌวՈᕂ˄ၚ¬≹ɖ቉΄Ś͜ẊИᶎИ̪͘ᗗ̠ܺͰ᯲ז௢ĚΓϘጲɜᣚƂᣖRࣺʽᕺҨፘ̽୺áპ˙ፅҐŘή"],encodeOffsets:[[-47886,84612]]}},{type:"Feature",id:"GTM",properties:{name:"Guatemala"},geometry:{type:"Polygon",coordinates:["@@ћƦԻfϩǖҍΌrʖĮȠšƾКۆ઄Ft˸Ƌ¾ġǺ̵Ț̹ˬϜDBӂ޸BަUOڗßॅʤ@˚ƱòŰʘŃϥ͍ЉɻÏljâǑǧɇȟ½¬ıƿġ˽Ƀ}ŭ"],encodeOffsets:[[-92257,14065]]}},{type:"Feature",id:"GUF",properties:{name:"French Guiana"},geometry:{type:"Polygon",coordinates:["@@͉͑ГÑŗʀȉ–ʹɩνǦɈΪòϤƢή͛ӸáֺѪܠ˸ğؤȥࢸۿƔ·ӻޑʳأ"],encodeOffsets:[[-53817,2565]]}},{type:"Feature",id:"GUY",properties:{name:"Guyana"},geometry:{type:"Polygon",coordinates:["@@ր̯Դյzџ̈́o҈Чͪ̇Ƈݱԛɕ°ȣƹџϊ؏ːAŎӃԢܳȱ‰ҫî˙ɡϟƥ˅—ġǑЭ¦ԫЀÓϴɋьƆܐɸ̐ȕϸ˿ŶŊτțȘѩ™ْ֩ɬɲiϲԬƊȾƾ˽̸ô̬ږӲ"],encodeOffsets:[[-61192,8568]]}},{type:"Feature",id:"HND",properties:{name:"Honduras"},geometry:{type:"Polygon",coordinates:["@@ơˀʭòÐʹŗĞǣÒσij‹ŔʩƈǷǚʛìǨɈáǒÐNJЊɼϦ͎ĔȂƨʊ\\þ垦ϸùϲv˒ĢİĦˎ©ȪÉɘnǖòϨśƄkʲƿʐį̏Źɜɳ˽jśŕ̇ŋɃAȅŃǙœƛźĕ{ŇȩăRaǥ̉ɳƹıđĽʛǞǹɣǫPȟqlЭūQĿȓʽ“"],encodeOffsets:[[-89412,13297]]}},{type:"Feature",id:"HRV",properties:{name:"Croatia"},geometry:{type:"Polygon",coordinates:["@@Ȳ͗ˊʇ͓̓ϝȆׇ[ܟƔϽmǻǧ̝ȖǫΑЪϽǼʹϮ̽͌ȃ͆Ηݔ͇ġƛ߃̶ӣ̢ޑʠ۹ؤǞØϥΞe˲եƄʱγʝˮn̆Šbג…Ƹƚ˸ƍͤgGɼ̈ĒĈͺڞɠˊĻؼέۜlj̼Ų"],encodeOffsets:[[19282,47011]]}},{type:"Feature",id:"HTI",properties:{name:"Haiti"},geometry:{type:"Polygon",coordinates:["@@Ԣ™ܰƁôқÝ͑ȱƙɎʥiɫ֏ƜЅÍԡÔϽƿ҉ʾö˔ޜśيã̢ȈϧθP͎ՋžȌɶ"],encodeOffsets:[[-74946,20394]]}},{type:"Feature",id:"HUN",properties:{name:"Hungary"},geometry:{type:"Polygon",coordinates:["@@˨ըǍǼӂDÜ΄ђɋ̲ğ۸ļäǚͮ~ЦžĜÃЂŀȠȢˠ¼࣒ʭǴĒҲɭÎɣԡǭЉ֫ԕ֭کǁԽš١ə̻űۛNJػήˉļǍ˴ƗV"],encodeOffsets:[[16592,47977]]}},{type:"Feature",id:"IDN",properties:{name:"Indonesia"},geometry:{type:"MultiPolygon",coordinates:[["@@Λe૝ך޴ǒѴʭ̎ʭ»ɩ"],["@@ܙȁijĶø˸ΰԢࠨͬĐǓfʫշع"],["@@̢ɣԲèȼΥॿǛ׉őҍP̀ӚҤPɤ̖"],["@@ūұ౅ʅૣľE̬ښǪՂʥ֔Üݬ̮"],["@@ྔċȂΌ༘З̪կీƵਐӿय़͋ऍ͸ݻwࢍØ޻ưঅ͎؝ČΓŁ໕ΌƣΰޑØּߤ৶·ڴ͡ΒÛŘ̗"],["@@ѝֱćنƬ̠Ǭ˴ȒʗCЏ"],["@@̿˥ׅƸǏΰࡘ¢Ⱦˣ"],["@@̨ٝۿΌۯìӃÅׇˆȦҦਠ”ऎʕ"],["@@ɼയ࢈ԉ۰ࢼ८ԔݜBܘ̉خ̛ࣘLJbᩑbᩑݟې࡟ǜȷʇ੡}ΦۂՈɺɕࣲЕ۸࿃܆ۗêృަʛУ͑óȏ̮GκٛЮ̢ࣞ״gëɠ௵DͩԄݥƺΡдଈȰњ˜ഘ·Ƃ̹"],["@@ڭ࠭كlj߱ǐඓ¥ܽŧţٍݪݛҒϠ༪˸çϯλŪιӯ͙݉ߒ੿Ƶ˿ݲॻQտ҅ʙ̐͡Мی࠙͗ȻɶŊ͖؅ӲØࠌ֕ʭîও”றՓũίʚʌޜŽ߸ΛPʻֺΎվŤښф౎ǮΎ܎ذپʛ੖śॴ–ࠨ؎Ʀȉ"],["@@©ܽџĈŷԝΌѷɽĵ͹Ւʟ੺ǚڤ˨̨ÔҝӸóĀ΃"],["@@सާহį˫ֵšݿַ߱u࠷͕౻ŭ̚ॕϙͫԤ׳´лːৃ̟̩Оս¯ۗĬŹૺнɺЕܘŝ݀ĮުԂ֐Ɩָ֗ӅըǠ՜ÑӪъЖôߒɽۆǶњୠ͔̈̆क़ॲ@ܰƙӍݷآߓơϭ"],["@@छkۻ۰અۊέԚٍۄзؾٕ୴۪݅ʙܠ̳ڀݵՊѭܘمҺࢗऒóђզ‘ಢNjݔࠓٮ֫ҪΓߔࣙࡢ_ۺֹӠ۳٘ϥͳۉӖ̞̅sƜו̊ҵؠõФՏɁ਱‘ಟ"]],encodeOffsets:[[[123613,-10485]],[[127423,-10383]],[[120730,-8289]],[[125854,-8288]],[[111231,-6940]],[[137959,-6363]],[[130304,-3542]],[[133603,-3168]],[[137363,-1179]],[[128247,1454]],[[131777,1160]],[[120705,1872]],[[108358,-5992]]]}},{type:"Feature",id:"IND",properties:{name:"India"},geometry:{type:"Polygon",coordinates:["@@ࣚটďۅͮїѕ׽ŒɾएࠜՑ୞חՑϟ͛޻ࠀͅߊЭરһସʼnӜёٮāৠȝ۪bĪͪŋՖÞβԠǮìڋlǙކ͉Ոƀ܀Çۈ|ÐԪ΁ˎڴŀވشॸ՘۶ȷ״ΞЀԹ˳Λ࣠űÜ͇̍Ʒèԫ׷Ʋછׅ~ӓҩ۵§ХϏۗځȒࢇȏ˹ĚΣгȥѵ೰ɵEƍ՝ҡѦʸӎϖ¶ϰ܆ӝƜީ]ߝŚóאБ¤ڕζ֭̓؆ѻԿ̻ȅ̩Ԭɣƛԑ̆كžەţֱ̫Zਛǩ´ك҃ӻ௃֡ळ঩كՋ࠷ջCϭлȹݳ̝Ͻ«ʥٙǪધ®ۡΣߙI෗ѣ¡ϣٙʰˣދʃ˱֯͵ʍߑ޸ϳ୴͑ࡒ̍Јѿ߰ȻੂơՀޅ଼Α࿀ʣ੾HৰǍ޾௣ԉףĶ઱৲И̤ʝͤড܊֖֔ᇜCǗܞҽюĩ٨ջϘऒࢢঊÙ࢞ࢢՄ࡞ࠄࡈ_״ܒӠڳд֪݂̇̕Ьβ౤ȱपŰߺ۸"],encodeOffsets:[[79706,36346]]}},{type:"Feature",id:"IRL",properties:{name:"Ireland"},geometry:{type:"Polygon",coordinates:["@@ƒ׷ًݣ๯ӹ஑Ŷڼ࢚ѭࡢତڄٌϼǦ҇ǥ҉Բ\\ٌǥ"],encodeOffsets:[[-6346,55161]]}},{type:"Feature",id:"IRN",properties:{name:"Iran"},geometry:{type:"Polygon",coordinates:["@@݈njװӔ֚{τƾװýघэڤğ।ݓظ‰òۻ΁਷ɱؑκŭΫҡˠڡàՓِƙæեݿݿжѵ͸ԓߦυx݉ДƋêϯ௉ѡ̓উཌྷʪࣷȖेŊΧਐЕƪ٣ƭࡑНਇ˦ࡑ٦߳ʈ֗ߘا૪ҍƋՕ˦̻͝ҭѴS҂ˍ@Ɛ،ѝٔ਍Ң׉ߜȜپц̂ÙӬտʨխ৊ҟڨǐʼʿ६ּʈƄͅъϯ־ő̤~রئ̀Øʞʙ́гԼѱȾ¦ˈإߖǩ׎у஠ƟಾɞĄȞ"],encodeOffsets:[[55216,38092]]}},{type:"Feature",id:"IRQ",properties:{name:"Iraq"},geometry:{type:"Polygon",coordinates:["@@րʧÚӫх́țٽ׊ߛ਎ҡўٓƏ؋ˎ@TҁҮѳӿ¤֟ê؝߭༟äᛍၖఫךৡɪ͹৾ᇶ࢔͆৬āؘҢȺјԾΰž঎Ň̐ɉЖƚծ৉"],encodeOffsets:[[46511,36842]]}},{type:"Feature",id:"ISL",properties:{name:"Iceland"},geometry:{type:"Polygon",coordinates:["@@șիॊֵથٙᝓֹܣƵૉŮᚑˈࠠψᆧЪ๪ǎ—ʘᄋȜ֨նౠŰಸ֭౨Ҝ੒ʃൌ҄ආÑ"],encodeOffsets:[[-14856,68051]]}},{type:"Feature",id:"ISR",properties:{name:"Israel"},geometry:{type:"Polygon",coordinates:["@@ƥ˅̣Ŝǫ֓ɂĥɋř—ɛЄŖp͛нഉց෾ʔˢ˶ɞϼǠيŤɆzVˬCþƦɤ\\`·ŕŵhM"],encodeOffsets:[[36578,33495]]}},{type:"Feature",id:"ITA",properties:{name:"Italy"},geometry:{type:"MultiPolygon",coordinates:[["@@̟ڋŲʹǭѝٝ̈́ёĞ୩ѐŞќজûࡪĠْò"],["@@Ԍ׭ş૕ϣÂ΁˫͇ɞ‘২ȓӒҨ¥рʼ"],["@@ரɏĝЯȬΧڝŪہ̗²зĻʇˠё߀чцۛदڱچLȲȃɽǗݪ̥ؠʩܜѫĔƿƽ̛үϼܳƐΝի؈̷ıѫΗ¹҅ܛΕÝHʲǢҊǼǶ͝ӤʱшΑŀʛδգƴεͶثÆٿϜޑմ֯ӜʿࠪйĮہˤϯŕӝϵΓÕĪθҕńɏٲ̆ʰʙ̀”ʂβǵМ¢Ҽ˶ƢƃА€ǼͺتĿψƚâΆԘšĮdžࠨƤȊ̉"]],encodeOffsets:[[[15893,39149]],[[9432,42200]],[[12674,47890]]]}},{type:"Feature",id:"JAM",properties:{name:"Jamaica"},geometry:{type:"Polygon",coordinates:["@@֢÷ҀȫƔɯןeʭƗҹƊӑ̪ĶȔΜÎȒƒ"],encodeOffsets:[[-79431,18935]]}},{type:"Feature",id:"JOR",properties:{name:"Jordan"},geometry:{type:"Polygon",coordinates:["@@Ʀˆपͫ࿪ࣆͺ৽Džų၅у࠸࠿ˣƛƑ˭ٙřȩ̡εʵधƆƒŨоഊo͜Ůʚ@Ԥ"],encodeOffsets:[[36399,33172]]}},{type:"Feature",id:"JPN",properties:{name:"Japan"},geometry:{type:"MultiPolygon",coordinates:[["@@ņ˽ҿԕΉːљțɝӭշʈRЊҬԆӌīΊΜؠǹ"],["@@́ڡƤсѩף੹Ѓ๏½ணॡ͔֡“غษȃষЃঝe࡞أ֗෗իΝН͜ȶݶՏʒͿ־ߐʶѲՈࡌѢ؞ָာʤ࣎ǣࢠ๺֔Б௾ࡀӌ͜ՈਈƟा΢ՎࣀƸҞୗ}ڻޥࡍbࢁ"],["@@נǵרΤȈहఝɯ݁࠱೓ָқँण]ř࠴д٨࣌²ʖ୐ʜټন࢓٤˯"]],encodeOffsets:[[[137870,34969]],[[144360,38034]],[[147365,45235]]]}},{type:"Feature",id:"KAZ",properties:{name:"Kazakhstan"},geometry:{type:"Polygon",coordinates:["@@ӕƹ્דο׹̹KɱЊ੫‚ǡێХNÚࡆ৓ؘ෷ßডũߣݶۋ͆ಥ׼ƽðᓗӹᶽљ£יچ֧ɼॕǩχ˧±ȲȶΖDž̊অ˺ϛݮҩɆ…˜ࠊāŽؘ܎ƎܼűƲࠎƭԲ࠿£܍ȴঃσ޵ǭяƌĐўՙ֘دw܉֬ӞِʕǢڢऊࡺӣŀؘჄࣴಾtᇢ׉঺ͻࢼΠ೰j੺ѥʔʠ୼—ɂЊഷ׀߮Цƿɮ߮ɔ؅ֺϬ˼Ḯ̈ШȺᑆ̴ݰΒຢǹ˄ࢉ࢚Ȳઆ˹éҝ߮´ᑌߎ̭ˁ੶٭ሠᒑ҄ѰୄӛீɎҪƯКӟטNjΨΥ઎ŒѾԣٕ֓ۥÿ¡ࡅұϝဟˢ؅ຑїȇဗͱݲลֻɓäӏԭŬу̠ఝĖඃx̧ġ஥ΞӉǧŽӹ൩̂փşȉρ"],encodeOffsets:[[72666,43281]]}},{type:"Feature",id:"KEN",properties:{name:"Kenya"},geometry:{type:"Polygon",coordinates:["@@ӾۙיͱȹΕ̿Õšףˑ͹Ǐ֑ͷ˥஻ࡀËӤᵁႌƙĢSࢺʊ;а֌̨ؔσ॰įтЉ׎ԬԈ֬ֆѨƗ@ҽ˺ˡג@੠܋ˈSȠxȄī֖ßʞΔގΚͺ˳ָAܽ॑Xᵣ"],encodeOffsets:[[41977,-878]]}},{type:"Feature",id:"KGZ",properties:{name:"Kyrgyzstan"},geometry:{type:"Polygon",coordinates:["@@ȊςքŠ൪́žӺӊǨ஦Ν̨Ģ඄wఞĕф̟Ԯūşȏ೛ғ̙ͭઁıͅ՛ࢷŒׇǏߣЇŜȟʇȓཟŵਡ˘࣫ÝĂӜࣴƕ̮ʸٖĉ੾؂঻ѸױȽإ͂۶ծʟĊ"],encodeOffsets:[[72666,43281]]}},{type:"Feature",id:"KHM",properties:{name:"Cambodia"},geometry:{type:"Polygon",coordinates:["@@΁Ѭыࢄȣ২ՠۨઘdž߀ťۚ͡Ϟׄݖ̱Ȝ֕Ļ৕ඳ٧τԙࢥÓܫͷ۱Ū"],encodeOffsets:[[105982,10888]]}},{type:"Feature",id:"KOR",properties:{name:"South Korea"},geometry:{type:"Polygon",coordinates:["@@ܨযȺխPॷ̓ҥݽljڥΏݳïĥҚƼـχ࢔ذƚֻܘÂúϒ‡͞Ϝצ¢ΨÈŨȮ"],encodeOffsets:[[131431,39539]]}},{type:"Feature",id:"CS-KM",properties:{name:"Kosovo"},geometry:{type:"Polygon",coordinates:["@@›ǣŃPĘ́ȩĐdzɦƾȌȪÒŜ˨ư²Ţşƾ¿ŌƅƒŸǎƻŢLĥȳijij„×ȉӹŻ"],encodeOffsets:[[21261,43062]]}},{type:"Feature",id:"KWT",properties:{name:"Kuwait"},geometry:{type:"Polygon",coordinates:["@@Ǭχõȓ˔هשuȽАݟĆ؞߮֠é"],encodeOffsets:[[49126,30696]]}},{type:"Feature",id:"LAO",properties:{name:"Laos"},geometry:{type:"Polygon",coordinates:["@@˚Ϝœ܆ڹܸ¿ٕࠦھٍÎǛ̉ӯyʣƨࢯԅoݬȸࢮ֧ž³ԎηʸǴ̲ܐնøȡ҄wŵ०ѦŬӮڏϖޅਚO͚ܹ՝ɗʉ̟৔ԉۦ঳Ռ݋َ׏ɄץƵ࠿ݕ̲ϝ׃ۙ͢"],encodeOffsets:[[107745,14616]]}},{type:"Feature",id:"LBN",properties:{name:"Lebanon"},geometry:{type:"Polygon",coordinates:["@@ɣ[ýƥ˫D̘ۄмעfˆϘ§Ɛͣқ̓ȷҟ"],encodeOffsets:[[36681,34077]]}},{type:"Feature",id:"LBR",properties:{name:"Liberia"},geometry:{type:"Polygon",coordinates:["@@ɗQࡽАޅٖ܏Ң֣ըȪː¬ʔϜҘϺϺǶnɖĨΘԧÇ͵ǐdzʂIǢ͸ʄsŸʓĎНǽύʖɱˊÇΤΙ~ͧăĿÝە"],encodeOffsets:[[-7897,4470]]}},{type:"Feature",id:"LBY",properties:{name:"Libya"},geometry:{type:"Polygon",coordinates:["@@ק̷ҿҤ೧βρՄڑϸϻƷ̗ҶήӹؔͬΘñՈńҠÓϦƨۈ¯϶˕ݐШȜðΠėΒ־͔ʶːЦʌ´٦দ́ΜðۮƓ૞ϓЀݛݮǍஆΙࣆйЦɔЖϮț٠˂Ф؄ЀׂŘ଒ǣ˺ϑ̺Iˌƛ࠴ıȲˣ̣ЕżΫɏԯʦڱ@Ჳ@ᶵ@့ॱGYΙ‧ྐ‧ྒࡓҟ"],encodeOffsets:[[15208,23412]]}},{type:"Feature",id:"LKA",properties:{name:"Sri Lanka"},geometry:{type:"Polygon",coordinates:["@@ų࢓ΙʇܵȓЍڜƫீϠ഼׆ұϺסО࢓"],encodeOffsets:[[83751,7704]]}},{type:"Feature",id:"LSO",properties:{name:"Lesotho"},geometry:{type:"Polygon",coordinates:["@@̆ʩʳУƛ˛ҳſƹˍ̛ċؿ٨҄ՐҖ͢ϼǠξʵ"],encodeOffsets:[[29674,-29650]]}},{type:"Feature",id:"LTU",properties:{name:"Lithuania"},geometry:{type:"Polygon",coordinates:["@@ãɊĚɲχƄࢡƨDZ۸२ʴඬÁࠜĊŞǩ҂Ã߲СĀϓۏˏșӃ࣯̓߻NȫʶљĜ"],encodeOffsets:[[23277,55632]]}},{type:"Feature",id:"LUX",properties:{name:"Luxembourg"},geometry:{type:"Polygon",coordinates:["@@ǘȏ³ρʍiȉòĞҼɖŽ"],encodeOffsets:[[6189,51332]]}},{type:"Feature",id:"LVA",properties:{name:"Latvia"},geometry:{type:"Polygon",coordinates:["@@†نЮՆߊ˼ڜعڪhNJ٤ܐƪςĻܢ̷ۚCКȕîС˒ӷ͕ࣗԛƙ߱ТҁÄŝǪࠛĉණÂ१ʳ"],encodeOffsets:[[21562,57376]]}},{type:"Feature",id:"MAR",properties:{name:"Morocco"},geometry:{type:"Polygon",coordinates:["@@ԒΥߜÎࢊȃκU͂՟ºԝ̄ࢱɜDZƷ͛ષƙϝ̵ӡñ—ثঙ͍ͩсۍɥ࠻ŷഫاRহŷ@@@p҉Ա˓ȑϡ@̥Ŋ۹ě˛ٻʿÕЁ੕ୟ࣡ˣୋ΅ϗĵ̡ቅãaD ϶͒ɮ˞ѪÃ˶̀פҴՖ˲ƊɞӬp҂̤Բ̪֔Ւ࡬f\\ц͔ްĢڎָтɠۮۮȿਸ਼͊ܢŔѶդ֨ࡈϦخΐ֘࢈˄ԪؤI"],encodeOffsets:[[-5318,36614]]}},{type:"Feature",id:"MDA",properties:{name:"Moldova"},geometry:{type:"Polygon",coordinates:["@@ȨŮ֒ĊؤʽΊϞɥÑ˵̪ƏŨΗ̊ɇÏűƾčɝ×ӷ|ĉŜǫãÒƭɱˍƥ˽ɁĝƯϦĘΪςӝԂˉΠʹʠʯĈ"],encodeOffsets:[[27259,49379]]}},{type:"Feature",id:"MDG",properties:{name:"Madagascar"},geometry:{type:"Polygon",coordinates:["@@ɠΥȺ։Ɗঢ়ɒϽĉЗƩʙ˷ӰǁʝLjثõΥɵȗ¿܅ͧওб୅ԯཧ͑ୟϛইہȣܻΡӛɊڙ̜ɳѺÇݘ̑ڠù؂Ʈ؄ϰƢD˪Дِø՚șЈǃՌãޠ̊ҺŔՒмŒҶǤ̶Ʋτ\\ӐӎۖԮʦцŗάΦĵҪ׎fԐ˦ϔ̊ί"],encodeOffsets:[[50733,-12769]]}},{type:"Feature",id:"MEX",properties:{name:"Mexico"},geometry:{type:"Polygon",coordinates:["@@͙݅ƥ؁Õ૷ąЧƤқʺЧǚٳ֎سȞӏ͢бࢾɝΐΙ݄ɾٚĎؼưՊƠՖ΂ȨӬè۸Ƣʖ֬ɚࢶȚݔ‡ԚîȬDZ…ЙҋԁȥԝƸƥűγɁٽɅɎǭcǃY̝ԓƳIJķPŭޥV޷AAӁϛC̺˫̶șĢǹƌ½s˷ઃEЙۅŢƽĭȟqʕ्ࣞџ˘ۇɖҷÓګ́чĉץɜؿDŽ޹ϬؿŠ्ϸ۱ВɃɤҹº࡯ˈΓϦࣗӊсՌȧЦ˪ĈđʈȖɔJ̄˱Ϙùͮ˭ъ݋࠴ࡋڀУԼܝ΄ƷȴŸԲѓȞӹФȽהҍæӣѸϿФ™ˀҍو̓٠^͔؇ͬ˫™ӑɴƇͿƔЕĆف̀΋خׁƒȡŸÓŎ˽Ƭ\\ǜթʮɇǴ̕Նё˨ޯʠρɸϿ²ѷКƒͶϡ̨ϑqƭΝ̱ƫJɛԞջӎ؃РїɈ„ؚŵҖЏʺֿϒŏŇɃɖԭȰӷӦÖÚΊ³̸̼ŽϜ٩׶ӱɶ̱Հ̷վϳڦͿݲॖÞ੪ĞÿǑ౔СኀףဪPژ@DΌผ@̪̕јˇԀσ˨ѭȾҥѢʩۤʥՊڒۊhפͱфֹ̄ӯӸӏȂחɾЃپʹ׮ȁ͞|"],encodeOffsets:[[-99471,26491]]}},{type:"Feature",id:"MKD",properties:{name:"Macedonia"},geometry:{type:"Polygon",coordinates:["@@ńOœǤӺżȊ˺¶ϴbтˏÒ։DžƒƑƥҕh͋ǿջõΑȴšήń˸"],encodeOffsets:[[21085,42860]]}},{type:"Feature",id:"MLI",properties:{name:"Mali"},geometry:{type:"Polygon",coordinates:["@@˰ƶƘӶˊpזɻӄǖ͖ÇŴȈ⁚^ȈךƣļЛ⋈Л⋆౾dᬼᆳᬼᆳȨϿԺʉ϶ƋV՗ठĈFካҟ֗íԭݛƃ଩ï̳̗ա՟IȿLjҥš޻ΑDžʿٳϕŗɍΙǡНŔɱȳūֻڙۡp˳ɭΣÆӥ΋ůȝŁŽάʍĥơhƷʕ٭PɷŴʼnùʱʎ¬ʢĿİdzĉ˚Ǥɐ΅ΚijɴȇȂǙvȫş˕őɱǹΫäɷɈƓ„ɕőƅAµ̮žʾí̽͘ʀǓӔԺ"],encodeOffsets:[[-12462,14968]]}},{type:"Feature",id:"MMR",properties:{name:"Myanmar"},geometry:{type:"Polygon",coordinates:["@@ӫηץ›ϥࣥΟƳО݅ՔؗΈօ̭ܵ̃ƹȪу֖ڙĪҷ_ϵ͠ދң޵Сࡷăذʴ٠˯ӼæࣸͽѤ˛৔Ʊਗ਼εۢօуॕ׳ҽöԳȠ̂ਪǫ޾څॺļ̢ӭņ׭ۆÅڰ̊ŵj׾дȦęΤȐ˺Ž࢈ڂȑϐۘ¨ЦҪ۶}Ӕજ׆׸ƱçԬ̎ƸÛ͈ӮÚˮӵξȧ|ٟ“ۙߓۭijঽࢲƔȨޛՐǍʓۣز́ζƷ؞ʔ~΍܏յdẕӓȗ"],encodeOffsets:[[101933,20672]]}},{type:"Feature",id:"MNE",properties:{name:"Montenegro"},geometry:{type:"Polygon",coordinates:["@@ÁǀηЯÊˋǫÞɽ˞εǖĢƜŬҦ˚ȜƾüɠƟŬśˠě͌ǧçïƽȋɧó"],encodeOffsets:[[20277,43521]]}},{type:"Feature",id:"MNG",properties:{name:"Mongolia"},geometry:{type:"Polygon",coordinates:["@@ࢮƢ྄ܤ౬Єܴʳ࢚]֘Ͻ࠼‰ௐɁࠈגͿӶࢊࢊश΍ނįনɍLjؿஜΛߐƺਫ਼ŌࡆōࠖЗԚѕެT੒Ƌޜȼૈƒ௸פԌĝѰ˭ৌêХهק࠽ɐ΅ӈńࠤŽ٦̴ڬˏހוğ̗ڏĦ௟ŏןʅ؝։౱͙࠷ѽࡹǞҿúѳէˎ͓ƌˣי˯׽҇গ̑ఽ‹ഫ̇এҋϋʾ৭AఓԜࠥŰૣśჃȊऑmӱԀϣޠԱĢ৩ԼଅŞুƞ̡θ͖চׅڲன̀۷Ѿəז"],encodeOffsets:[[89858,50481]]}},{type:"Feature",id:"MOZ",properties:{name:"Mozambique"},geometry:{type:"Polygon",coordinates:["@@لæ৞ʁɖńגt̚ʦԌaऀ͜ڞӤƊϕ“࠷ľ݅ಿƨЫʣ׷͙׍՗Եޏ͉ृСॉ͓ࣕƵוׯ΋ȗí׳ЌُǔӱZʣƪ¦{ࠗƋϷȤƝűΓΗ̗ۗ˳য়ҕρ̳ðΟɊÉíѵّRïϊůϖí̠ƬपɓװГஂࢬ॔ɜ؆ŶúĨӶƉʞ˜غǐ׌E੠ѥ˒ЏÔǹȼϳǰ۫gÅ̼āװᢈۘӚЕɴüͨɅ¸͵ǯϷØסոԱʲ׌ζǰíઊΙ؈̣˖̅]ɽદɾٔ"],encodeOffsets:[[35390,-11796]]}},{type:"Feature",id:"MRT",properties:{name:"Mauritania"},geometry:{type:"Polygon",coordinates:["@@և־ԗؤ֍ɞГʚҵUЧǽйð˽ˏïҐɺаŀߊģࠨĵкČмɑЎѵδǾˬᾔMǃ௎ȴќ߀øᒸ᪂©F౞Ṗ᎟౽cМ⋅М⋇ƤĻȇי⁙]ųȇ͕ÈӃǕוɼˉoƗӵ˯Ƶ"],encodeOffsets:[[-12462,14968]]}},{type:"Feature",id:"MWI",properties:{name:"Malawi"},geometry:{type:"Polygon",coordinates:["@@ɽٓɾથ̆^̤˕Κ؇îઉεǯʱ׋շԲ×עǰϸ·ͶͧɆɳûәЖѵɔʮޮ˄̈LJۢǚڼƞɪɉ܌Ѕϐ࠘ƽǜɵ˶Ϲɾଡ"],encodeOffsets:[[35390,-11796]]}},{type:"Feature",id:"MYS",properties:{name:"Malaysia"},geometry:{type:"MultiPolygon",coordinates:[["@@àћֈĶ˞ΈȘýӸԓΜ֛¶֣ęϡĆ˿Öӻ̒ɵͤݑe˳׫Éߑخ঵ښįђӟ֚ś̡۠ҜĠؔȃΤƤƮۈρ"],["@@أ˹ܯƚॱ@̅ॗ͓̇љୟۅǵߑɾЕóөщ՛Òէǟַӆƕ֘؜˽ٮǀǜ܆άǂ৖Ǻ׾ڔЬՐϦѥǮ˺В¸՜œа٪אшڀͼHќыžιֆɻ۬ʧÑ֝͡¥ƮЧ"]],encodeOffsets:[[[103502,6354]],[[121466,4586]]]}},{type:"Feature",id:"NAM",properties:{name:"Namibia"},geometry:{type:"Polygon",coordinates:["@@رٌؖ͡ȃࠊȷ،˯ಒm৒ŅҞ͛Όѡۜѳ৘ǽՆۃࠐ»٢КdžԊƞհ}ԄϝŶÐ₮˜׌Е᎞ş໴΂یȒհµͨȍPéӁȍʭC՛͍ͣΎಕ̍سƒ{Ჽࠣ‡BយA᷋ݣѕҋÕՇDŽϗÔƗάͩɰГг"],encodeOffsets:[[16738,-29262]]}},{type:"Feature",id:"NCL",properties:{name:"New Caledonia"},geometry:{type:"Polygon",coordinates:["@@ېԵѨϭ͉ȫҥɪ׹ϚէѼ։פś˶β[Һ˹φ˷ˎɻ"],encodeOffsets:[[169759,-21585]]}},{type:"Feature",id:"NER",properties:{name:"Niger"},geometry:{type:"Polygon",coordinates:["@@nּॹȐОҿպœϤâТբ̴̘ପðݜƄîԮҠ֘Eኬஈϒᝪ࿸᮪ཾ೨αӀңר̸ȸಯ̾ɓ`ˋΔ˽ǻί͕ၻ«ધੳߋγૉΔ̵CեբmčЃʁµˋƻm֩ंȟ’ځҷٱʔҍ¸ʏşӯ~ӷΧѓq৯ѢЉȵѓb̿͆ࡅ̼ࣗıɕǻşӗʋ͹ÍݣٗӚ̟E˭ʗ"],encodeOffsets:[[2207,12227]]}},{type:"Feature",id:"NGA",properties:{name:"Nigeria"},geometry:{type:"Polygon",coordinates:["@@ࢍ̡͉¬͓ȉڥl҇Ղˡ؊שֆكYݍB¶തs՘ǂՊʶʴТԴėɨǔ͸ȍӾ˪ÎݤʌͺŠӘɖǼࣘIJࡆ̻̀ͅєaЊȶৰѡєrӸΨӰ}ʐŠҎ·ٲʓڂҸȠ‘֪ँƼnͬͯğƱ«˧۽ٱɛՙšѧDZȉǝי҅ΉŽыȋ͹ÿΓֽ˱ҽΊ͇aԃӭʑQЍ߷ɍש"],encodeOffsets:[[8705,4887]]}},{type:"Feature",id:"NIC",properties:{name:"Nicaragua"},geometry:{type:"Polygon",coordinates:["@@̃ˆϽͺȁ˲Ο˄сϜĤžƒŵÚÒʾ”ŀȔŬRkЮȠrǬOǺɤʜǝĒľƺIJ̊ɴbǦĄQňȪĖ|ƜŹǚ›ȆńɄB̈ŌŜŖ˾iïă§ȉĐ̫ȗ˹ěͷυ®ɏtϙŹĉýΫÌɛǣɋ ɩźƏȩDZʛÈƓǦˉêȕʼnօɞųŇ"],encodeOffsets:[[-87769,11355]]}},{type:"Feature",id:"NLD",properties:{name:"Netherlands"},geometry:{type:"Polygon",coordinates:["@@ۦyǀ˳Ƚޓɇ́ԍ@ƘࢡҥȞՏπީǩ؛âѠɲ݀ఆଲΘ"],encodeOffsets:[[6220,54795]]}},{type:"Feature",id:"NOR",properties:{name:"Norway"},geometry:{type:"MultiPolygon",coordinates:[["@@᥆ؙઍɣऄՅෛ͵ڵû΢לઃͰಫ˵Ы؝ߟωࣗȮ઱¥णѼԉɝԷ“ūփནƊɝҵ߭Hևױ࠿झಫ஁̨˹̇ͫ࠯bձ޿¾૟՞э˥ধֻۧυӛ֝Ԫဋঁ૫ȟ୏є̛ࣚˇ኶ޞզᕠ۶ဌࢂ໤୦፺ྴඦلᘼ੊ᇎπ൪­౮ۢ໖›ພǘ"],["@@ም΅๝Ȝ׆ɐԕˎეǚͮ̿ொȍ"],["@@᪖صᑟͥұأ݅ǁЍۡৣᅵԢނ̘ఽʐ࿕܂ٷڄᘎ̜Ң̋஦\\͊˼௾ˆ੖̋"],["@@࿮̏ఝҍ᝱ı៙ƖƫɴஹdँϬᣴɼ௞ȫࡘʤᑺȽ"]],encodeOffsets:[[[28842,72894]],[[25318,79723]],[[18690,81615]],[[26059,82338]]]}},{type:"Feature",id:"NPL",properties:{name:"Nepal"},geometry:{type:"Polygon",coordinates:["@@ÝαŌՕĩͩ۩aয়Ȟ٭ĂӛђଷŊયҼ߉Ю߿͆͜޼ՒϠΒȪڪʳࡔշҾť˰ЕٶǓۀσौȕঔć"],encodeOffsets:[[90236,28546]]}},{type:"Feature",id:"NZL",properties:{name:"New Zealand"},geometry:{type:"MultiPolygon",coordinates:[["@@Ȓ΋װ;ʐΡBΝ̹ϳչإїͷ̴З٭Yܗ̓ɣջӋࡗڇϓнʇޝlխˢࣱÐƗ̰Ҍذ੐ࠦժǀ׾͌ܜѰԎѦώظ͈ɆŰҶלϴȆΧ"],["@@،ࢫlָϜɯŲًڰ˛֨ãӒ͎юĭȯݗʯӫٛjɡʭþαūƻͅҏзֹ٭ͯƟɘΕŨӞ۔˟ҨࣛͲz̦؈̌ƚ٨Ÿլͻ֜vƪБΎڋݔΗת̸àҚұٺɑʂݡ"]],encodeOffsets:[[[177173,-41901]],[[178803,-37024]]]}},{type:"Feature",id:"OMN",properties:{name:"Oman"},geometry:{type:"MultiPolygon",coordinates:[["@@ֹ̻ϟªǩȧƉэļ֗ÿĻϯFԽ̻ćХȓǯԹP͡ɃJͻПɷҩĂ֗˳ϱ³˝טٿ൴ᠾ࠾֖၂ϩתv͸ʔΐFΆϞǒƩŞèմіHϖֵҸ̧؞ŋӼƳϜӕɨ˧̞ŃCȉ̩ԃƅɽΟˏ"],["@@ʼnƳDž˺ʔ˺ľñā΍"]],encodeOffsets:[[[60274,21621]],[[57745,26518]]]}},{type:"Feature",id:"PAK",properties:{name:"Pakistan"},geometry:{type:"Polygon",coordinates:["@@تϻʞ٥൨ͻ߹۷ऩůౣȲЫα̖݁̈֩ڴгܑӟ`׳ࠃࡇՃ࡝࢝ࢡউÚऑࢡռϗĪ٧ҾэǘܝᇛD֓֕؛Ɇʣ؀٭٘໻ǁിeஃŝ̈́ঊொѢéϰГƌw݊ߥφͷԔеѶඨѕࡀŲԈŅǞȂגóદĈ܎ҶӈشCĠɼٞŌ̴ý͢ʀ±ԌΦԖ՘Ɇͥ֊ߜɴ̢•͒мΜĩмȣΤӬμࣘǮ८ĮѐƺӨĦ"],encodeOffsets:[[76962,38025]]}},{type:"Feature",id:"PAN",properties:{name:"Panama"},geometry:{type:"Polygon",coordinates:["@@˫ʎǵҒȺɢɅÎƿˤлɸοÁǝ̇ͻɁǽ‡ĉǩВҗɯŅŧŭϷ©ơԈŋƛˡ¸ǝ͸·ÈɓİέCǻĩŶªǖìǠƲŲIJǩŲK͸͘ö̠̝iDZͲ›ĀæɴȵЮÔΨɄԜǞ˺ʤҬ·‹ĉҶ…ώơ˜ʧ̈́ɵĹūȜӵǁʟ˓ÒŅС"],encodeOffsets:[[-79750,7398]]}},{type:"Feature",id:"PER",properties:{name:"Peru"},geometry:{type:"Polygon",coordinates:["@@ɥљћɋࡅӘñΈရࡊທࣾ٫԰ΏۜƐʎ܅ાࠣ༄ߍီ΅Ϥ˃ؤٷպױͼ˖ϒПߢʼךڢՎIJΓʇȧx̭ΎâͼĝΚщӆΌDŽ֤ԦܶৠͨࣸࢠʾմŝٔɢĂ֒ЉˎЅϴɏӶࢣضĿҨɞ̤ƣԎð٠Ͻթࡣʤoрҁݳ œųۍlj॥ֱÓϻɉ̇ČғԕʍBΡɛƵΔݳҲԝDZί֐µ͆҃ݐuېӸÇ౧ϢĩӄƠܪടǷ˵£ןg܍͟пƮ̵ȕ˯β۹Ջ࣡"],encodeOffsets:[[-71260,-18001]]}},{type:"Feature",id:"PHL",properties:{name:"Philippines"},geometry:{type:"MultiPolygon",coordinates:[["@@Đ֏ºҽ˹ޑ̫ࡨϽэˎإʉϿ঩Ӧɿ؊ʰЎՑЈˁΑЃثҵƑʖ͢۾ՌʀҜ̈́̔ϝٔɰƎϒרv·ٰڼЋêхÐ̱"],["@@̟ˡˁՍ˃ʝԫ׈ǦɤɂɾĢԸҨ¸Ɖ֣جߺāߡ"],["@@ૣߕЬט؈԰Ԏ׊Ѱ࠲Ʈۅևҧѳֿ"],["@@Ԏʹ՘BgΗϳΣՕʧ‡ϸÒєŽА"],["@@ʀभ٫ɞj˭ȶԯЍȋ•עʧªƁԘӶãY͈ԣٜ߮mɴ̻"],["@@ɟܩέоѓ٘ܚ‰̡̈"],["@@ԮʉʶɖüɇƍΑ˼׻ɛۥӷ˥ƁڳȊڝѾġϊIJਾүăҙ˜ȫēϯٻЮ̵Ѵɍ̯՗ԊރůлȆ¨ΎˀɊʣȘŇ̡бӚűμߨͺˡĔೄ˜ހԘA"]],encodeOffsets:[[[129410,8617]],[[126959,10526]],[[121349,9540]],[[124809,12178]],[[128515,12455]],[[124445,13384]],[[124234,18949]]]}},{type:"Feature",id:"PNG",properties:{name:"Papua New Guinea"},geometry:{type:"MultiPolygon",coordinates:[["@@ɽčε͔ρՔǷ٘ŜĆĜʡʬȏРՑЈ˵ŝɽ"],["@@ѯçƃɽҟȱћȟѽBۏʔӑɺêʺݬũҠàŶЖŦrĆѽӐÜʂ˼Ҹ̚ġӸԌfǜƏgү˯ԡ"],["@@ݤտղࢻӖ„‘ω٬ƛʥǁࣀΝġʏ֋ÏȷɔܟĦࡕŴٷ՚ӉҦѧ݀ભπ܇ʇԡˣńإڇ˿һƖࢅ–aᩒaᩒภ׃༊ӓׄїҴхŸӵඔԱȲѽޛěȄ֕"],["@@ʿɡǁӸȝ͘ϝ˞ӍΪ؇ʚɺȮҒɻ˸ȁΜȫʹΛ͊ˏĶѧ"]],encodeOffsets:[[[159622,-6983]],[[155631,-5609]],[[150725,-7565]],[[156816,-4607]]]}},{type:"Feature",id:"POL",properties:{name:"Poland"},geometry:{type:"Polygon",coordinates:["@@·՜à̂ȹ̧҆̚ɺɤȝђָʘ಼ϴ੒˴࠼ƙÚȱ߸Yਚħ໶^њěȬʵšωɸ͋KͯԋǡʸϳfϏцܻěɽзįރۥɒϗǿ¶ߙ͔؁šЇĒӹǵч̖Ήŕ³¼ϭаر¼ăˀֻĦűɑҗǨÀɴػòЉ˔"],encodeOffsets:[[15378,52334]]}},{type:"Feature",id:"PRI",properties:{name:"Puerto Rico"},geometry:{type:"Polygon",coordinates:["@@јõưǕɋɃمLӫ‡·άŢŬیK"],encodeOffsets:[[-67873,18960]]}},{type:"Feature",id:"PRK",properties:{name:"North Korea"},geometry:{type:"Polygon",coordinates:["@@Şƥ͉ºη˵ʣ˷Ž׽ѣȅƫƧ̓ʝ֓ƏηɥηįġͰƋӈσŧȭΧÇץ¡͝ϛϑˆÁùСdžĵƿʙé‡ǀɑüɥƆɰφȤİõƶɆҒÅƎөĠЇɤۄբऒҌ־׮Ўˁܪ‹ſѺಚβͰҼժӹ"],encodeOffsets:[[133776,43413]]}},{type:"Feature",id:"PRT",properties:{name:"Portugal"},geometry:{type:"Polygon",coordinates:["@@̦Ɉ΄ŬɂЫӺDƞłӪ‡ɼуϱɩYٽƍū‘Їγçʹԋɵտ̄ʡřɫ̵̿ê˥ͷɓѷŠџġŸڂÿԬϓþȩ͈äռͰ̨ÒͼǪԎkΤǙ̠™˲"],encodeOffsets:[[-9251,42886]]}},{type:"Feature",id:"PRY",properties:{name:"Paraguay"},geometry:{type:"Polygon",coordinates:["@@ͦ৖tҌЖ݌าʔޮ]޴їbʵʞҳÇଛࢲLJ΄ǐ֦ɩǀʣþޓİ͓̼›̀ƌ̢ƳAҥŕӻǑӛƍݏށ١ړƇऻŸࡑɮࠢ౨ťψࡽ͢ਅبۉŸ໵ൌ"],encodeOffsets:[[-64189,-22783]]}},{type:"Feature",id:"QAT",properties:{name:"Qatar"},geometry:{type:"Polygon",coordinates:["@@ÇؔɨѲɰĜʬˁdӯǽӳɵÑʫǖ"],encodeOffsets:[[52030,25349]]}},{type:"Feature",id:"ROU",properties:{name:"Romania"},geometry:{type:"Polygon",coordinates:["@@δǶԴġՠGϸȳ˺źبĄɄȠΠ@ʰćʺʟˊΟӞԁ€ρėΩưϥϒƹЂƊϠƟpɏПǹʯĀɻ৥ӳĖ̪ؑফțзɋ௽¬٥ƀ͙ÕʍΊƵƦȚƘȷŀ˃ȋөʔßΌԟȢĥˌҕͤڪǂԖ֮Њ֬ԢǮ"],encodeOffsets:[[23256,49032]]}},{type:"Feature",id:"RUS",properties:{name:"Russia"},geometry:{type:"MultiPolygon",coordinates:[["@@ࡌ๫కˤԫ்ࠌࡳyוُԒսٱƻ۸Ĥࠊħ࣢Țٌš૴ӯࠜôରަϮͭϴϐŠɔ։̆ߵuࠟΎࡑ"],["@@໵]ਙĨȒτ୊˚ࢢƧψƃęɱäɉ"],["@@֦Ƚțؐᗸű࿨޻࠭λ൛ēsࠑͳǩ޽~ٗ̊ૣʖȉθ࡟Ǝॗʼnҗ̎Ǽ̸৓ȥϚЃӉΣ@„Ꮪٛᔺ࠳ïԷ"],["@@ः©ƭˌੲΖ@ַ"],["@@ળ»@ָň–܈E௒ʉïŗࡽȩ"],["@@ౡMႣĤƧ¬ߘͪੀþஞ͏ĸə"],["@@ॿͩഉø༛ͨȪ˖༨ųᑔɗ"],["@@ډرᶽzඃȣမղҎ׀૎ǂᕞ™ᴬѽ"],["@@ӹóᩣŊɟώູɦūҒ࡮Ƕ…Ҟသܒޙĺ፨݆ɩϢሤѺ᪪բ᫠ǀ෴̸࿐Ŋאͩ֟ʻᲗз᢭Џᤙߝఫࠍ೉߱Ǡۥྎۏ"],["@@ɨгސȲឤYቈЧڬ̿ȽѧङʝᕅүفʟਬşఖɃݴDŽєաτɔഊƂ᧪ƑȴϽ↲ů´ٜᄼƥഄLബѷϮ՝ӹΙੌڋ೔Ϳ߸ࢦഖϙ෢ɦྼʵؤʀൖş؅ޮૐζ䢀ձܐӿᔲٛ₎DŽာƑ۪΍Ĺؙਜʇ૴Ǥ๰vཚǑཪĢะݛਪˎڷ՞ϐώᧆɻფºᝂБ୲ν@”MKઇσઝÖݶҁԄەϲɧĮΏɑɝ༧Ǿ᚝مݛĭ౽ן௛ԧ̱ϣய׊ᔗڇϣ̸ߵΫ૱Ř˓ց৙߽Šͻड़ȋő௣ޭ‹Ϋ۱Δα฽ѕ̅ॡభȳʥ࡟ே޳ׂ̳έ௬ҵለИ୘܀ԆªϾರȊຊ੒คࡺຢڢڮஆ৷ëԍۗᒉइۍਖᓧ˷ᑃටۚԧሙɕಝēÔ؊ಯŶ਩ЭᢵƠ᪏ʟᨩ࿛ủጝ೚ŁаՃࠄȅ՞оईÃௌऍ†܍ځ࠽ë্ϛഉ్௓˯ׇଙ঑ଇॻթӹ૩ӱՉYՇФૻؙſ˩ŝƦKѐіxŦ঴ɛܚܞ̒৶Ʃ֢ࠈ˾ऄ͚̮Ѵݲ൷ʛܯͧ౧Dͻ߄হװหˎ̵ࠖ̉Ԫ̿βԯࡐ̲݇షʢ૛uਯƱۛлҤȥXҩұˑݷࢻRσஅՍ৙̈́োéѯˮԋĞ௷ףેƑޛȻੑƌޫSԙіࠕИࡅŎ੝ŋߏƹ஛ΜLJـধɎށİवΎࢉࢉ΀ӵࠇב௏ɂ࠻Š֗Ͼ࢙^ܳʴ౫Ѓྃܣࢭơ͡çѽԤઍőΧΦחnjЙӠҩưிɍୃӜ҃ѯሟᒒੵٮ̮˂ᑋߍ߭³êҞઅ˺࢙ȱ˃ࢊມǺݯΑᑅ̳Чȹḭ̇ϫ˻؆ֹ߭ɓǀɭ߭ХസֿɁЉ୻˜ʓʟ੹Ѧ೯iࢻΟহͼᇡ׊ಽsჃࣳĿؗࡹӤڡउʖǡӝُ܊֫ذx՚֗ďѝѐƋϥӽ߿Ƒ࠳ࢁކߕĉ֣ࣼফԇ͹ƝɇωÌֿԚɿ†ՅȚʳΈ޵ǮԙƁƥƼଥЖఅƌ܃ƞĹıੱ܂य़̈́ܩӴؒƈۤ۰ҹͪఌ΄uȀݯƉ‚ώѠɼ߼ÖƄ˪ȅҪ΀ѰWʚఉ˚ӭUԯЀ١ƃ੩̐lǒ̗θڟ¤éʼɀǞ՝ӈࢋąʭ¦Ƀȑ̽”ȷ՞ȟ˨NJĀڴ‡͞Ȁʍɢ֥ƪ¼Ʋ΁ƴՃվǸɨĉЂࠑȨѱijšȼࢭɂˑӸíТЙȖάˊʝ޶װӞųƤक़ҬࢡЎᅢ੶ޮӠ͂єగּΆնݳش֢ܜ঍ग़ޢي౿֔ŬךڶüොͶࢀ̈൦ԕᘨȧṺो٤ЋÆ֓टѳ൏ɡ⏷ٔ؟Ńൌ؛ÂϵÆ࡫ઌʯڂɓňРԑΰ՘͈᎖Թ۾Ȳ֣؜ዦࠖޢµ޸̋Ӫ׀۫ԄЪԊءԶᚠˑӔҹ੡ĻNҳڌ˽ಜǼȶ՚ჶАᰪܞي£ࠣԙਬĕ׼˼༾xఢΐफ़ԏॖ֌ࢡӢѪˤ២ʫ୒ʿᴾॣ֚ѰࡡѺ{ǴৣĈˢЌ҅ټ}ː༄ݾրކزǒᕮɛǬұߕڽԺˋ˒חȏଵऒԧέ֕࿫஝०ŭ̢ͮऎɎɞжܮЎөӌϼֈࣿêȫҲڢࡈણۆຒ֦șװмnѴүͧ߷࣐Ƶϥ؄ඤͦლ¬༈ӏݛ۪ċࣆศǞ፾™ᆘŌہѮংւॲx࿎иᕠŐ˪ɲᕂþیȋሴҀ໲aɶδߤΨጤΈ෸˗ଥȷበŹ"],["@@ⵙ͕ໞીےĦقÃᒈӋʟͿ"],["@@૽ōݱÛśƏঙƑ࣫ȦӐʾል~࿞ƶ౨XǢɧӘȬߊƐఞǿ͗ŷ"],["@@ᆳĿᚉʎඅ͎٣׾଩ǔᔆָᆎȎ࿌чኬ߻ȹݯ"]],encodeOffsets:[[[147096,51966]],[[23277,55632]],[[-179214,68183]],[[184320,72533]],[[-182982,72595]],[[147051,74970]],[[154350,76887]],[[148569,77377]],[[58917,72418]],[[109538,78822]],[[107598,80187]],[[52364,82481]],[[102339,80775]]]}},{type:"Feature",id:"RWA",properties:{name:"Rwanda"},geometry:{type:"Polygon",coordinates:["@@ͬӃµӵʏŁѿÆʱӍԛàþҠŘތԄʎɺȰďԈʸ"],encodeOffsets:[[31150,-1161]]}},{type:"Feature",id:"ESH",properties:{name:"Western Sahara"},geometry:{type:"Polygon",coordinates:["@@oҊŸ@@ÉeNjEౝ᪁ª‚ᒷ޿÷ȳћDŽ்ᾓNǽ˫˜΢bCቆäĶ̢ΆϘˤୌୠ࣢Ђ੖ˀÖ˜ټۺĜ̦ʼnϢ@˔ȒԲ‚"],encodeOffsets:[[-9005,27772]]}},{type:"Feature",id:"SAU",properties:{name:"Saudi Arabia"},geometry:{type:"Polygon",coordinates:["@@ʼnΪʩʨÝͲѡ̞҃۴ʁۆׇ׀ϑƐ֋ߠīא–ӾӕञϿ͠ґǨˡӖ°ȎɹѦʕȊ͝زԟڴѓ־лIžҦœ̌ļͲनƅζʶȪ̢ٚŚƒˮˤƜ࠷ࡀ၆фdžŴৢɩబיᛎၕ༠ãݠąȾЏתv͠ܥаȓƠִ̏Λ¼΍ċ˩ł˯ʎɽŐ˟ŲȵʬǕɶÒdž͍Žș࡙͐ᡌщǞDzϪש֕၁ᠽ࠽ᝑ͑޷ϙ׻ࢥϹƕɁˬ͏§߻ĎƷČॹmɫùΉɔɝЭĒΟρˋ"],encodeOffsets:[[43807,16741]]}},{type:"Feature",id:"SDN",properties:{name:"Sudan"},geometry:{type:"Polygon",coordinates:["@@śhdмĵ̀џͨĵ؄ĶبϳÌÍȇԍ©Ȭʕðԍңңл؅џđ۹Ӫͅǥđʓџǃ…ǥ࠵@řǦ؃†̡ƝɳîѝӬƟɲ؃ŗɱϵɏݣ˿ǁʳğå ̅ʎÃʼƌΔE΄ӛՀĩάZȰ̱ʜUӦǭ͖̍µĎ̰ɒΖħΐˢʴǫȞɞ԰ϨئܦÏ¥ ZΚॲH@း@Ὂ@ῼ@˔ࠗȁƳŪࡻ্̰͌ȷҠ̳ыӑأƏ˅ʳĉ֑α௿ĚͳƅܟͿࠟԓзέٛč΃Љɽʝ࢟Dij"],encodeOffsets:[[34779,9692]]}},{type:"Feature",id:"SDS",properties:{name:"South Sudan"},geometry:{type:"Polygon",coordinates:["@@Xٽűʯѿq˷ӏԨÑюХƨͳϦșӼࣳ֫օԫԇԫϭסFگȟՕȊ΋ɭ݉֐ȥάҵDZϱÆɣƕϗĸԗۚƉˊعͪɅԌΕζ֟ѬS˘ҡͼ֯͠ʴĠ̀ǂɐݤɲ϶؄ŘƠɱўӫɴí̢ƞ؄…Śǥ࠶@†ǦѠDŽĒʔ͆ǦۺөѠĒм؆ҤҤïԎȫʖԎªÎȈϴËĵاĶ؃ѠͧĶ˿cлŜg"],encodeOffsets:[[34779,9692]]}},{type:"Feature",id:"SEN",properties:{name:"Senegal"},geometry:{type:"Polygon",coordinates:["@@΍ٺн̚φDŽРמȦќ˾ːкïШǾҶVДʙ֎ɝԘأֈֽžԹǔӓ̾ɿî͗ʽŧ³қâÙģȃk׿ȲЛV༇–ɥħ˥‚ѻƋƏ٢ވkȬŞƮR̸ȘήǯκcζȌǝʐˡƙʻJͧȸˉ_ȍȥࣵy"],encodeOffsets:[[-17114,13922]]}},{type:"Feature",id:"SLB",properties:{name:"Solomon Islands"},geometry:{type:"MultiPolygon",coordinates:[["@@ɾ˿חN͉ԬԈȯǜ‰"],["@@͝mԧĎǫżÀͮֈƁ˜ǭƎə"],["@@ųƹحܰǫԈ˺@̠ڥʹЗ"],["@@–ǛڅΦҟ̠̿˪ŰĐϮȫېϭȢˉ"],["@@Ǘ³οȒ·Ί¨ƖԈΡͰ˛"]],encodeOffsets:[[[166010,-10734]],[[164713,-10109]],[[165561,-9830]],[[163713,-8537]],[[161320,-7524]]]}},{type:"Feature",id:"SLE",properties:{name:"Sierra Leone"},geometry:{type:"Polygon",coordinates:["@@ɧØ؁ͺѩ҈Ƨ̬Ĺت҆τĬɺƞǸɶpȜǂڦCɺ̛ǼˁʓƈɗṶɴ´ϹϹϛҗ«ʓȩˏ"],encodeOffsets:[[-11713,6949]]}},{type:"Feature",id:"SLV",properties:{name:"El Salvador"},geometry:{type:"Polygon",coordinates:["@@ġȡӡ^̡Ą΍ǘұÀʃǶ~Ů˾ɄǀĢ«IJȠ¾ʜëǸǙʪƇŒœτĴǤÑŘĝÏͳ"],encodeOffsets:[[-89900,13706]]}},{type:"Feature",id:"-99",properties:{name:"Somaliland"},geometry:{type:"Polygon",coordinates:["@@ϛԩד۫۹Mᩧা͍̜̳К̳ҨǾ̖̲҈˚ƹǒΏϜΗкGߊɌࣴĴ݌ʼиÆ̚ƶӎˆKaE΋Aࡑ@ѫ"],encodeOffsets:[[50113,9679]]}},{type:"Feature",id:"SOM",properties:{name:"Somalia"},geometry:{type:"Polygon",coordinates:["@@ѼĎЊ˾͈FpɵýӧHѳǯ̣ʁࣥЙयԱ੷ܝ௷ܓवধ଩ࡁڹష࠯޳ٕँৱȗѷȍȣӽۚWᵤܾ॒ɰˆբfݠפબšᛜᡄה۬ϜԪ@ѬBࡒFΌLbːhϰŰ"],encodeOffsets:[[50923,11857]]}},{type:"Feature",id:"SRB",properties:{name:"Republic of Serbia"},geometry:{type:"Polygon",coordinates:["@@Ԡȡà΋Ӫʓ˄ȌȸĿșƗƶƥȷȏø̫Тγ͋ʿƗˋĞijƑšϳa˹µƒØĴĴĦȴšKǍƼƑ ŋƆƽÀšŠƯ±ś˧ȩÑèð͋Ǩ˟ĜūŜɟƠȢšŬЄЛ͔ɀτ̥Ë͔́ˉʈȱ͘٢ɚԾ™ҖͣĦˋ"],encodeOffsets:[[21376,46507]]}},{type:"Feature",id:"SUR",properties:{name:"Suriname"},geometry:{type:"Polygon",coordinates:["@@৔ǙĞưڶÔࣚɥѩܟâֹͤӽƥίóϩɉΛӓDzЇđ͹öčʏƘǗ÷ǡҙèԡܴōӄˏBωؐƺѠ¯ȤԜɖƈݲ"],encodeOffsets:[[-58518,6117]]}},{type:"Feature",id:"SVK",properties:{name:"Slovakia"},geometry:{type:"Polygon",coordinates:["@@´»ΊŖш̕ӺǶЈđ؂Ţߚ͓ɷɓǏ͹dzđ࣑ʮ˟»ȟȡЁĿěÄХŽͭ}ãǙ۷Ļ̱ĠёɌċ̆äńŢȂόa˺ĔxþLj¢ÆȒȖ˜žưʢD"],encodeOffsets:[[19306,50685]]}},{type:"Feature",id:"SVN",properties:{name:"Slovenia"},geometry:{type:"Polygon",coordinates:["@@ۜÝъȐܾtLjƘƘUǎ˳ڝɟć͹̇đHɻͣh˷ƎƷƙב†ȈúȫΨĞа"],encodeOffsets:[[14138,47626]]}},{type:"Feature",id:"SWE",properties:{name:"Sweden"},geometry:{type:"Polygon",coordinates:["@@ࠁוƀԥ೹ڭྱܡؓஃײףߦүޗॅ࢑ȝ͍තӋ޿৳ĆӅڗঃˉߐ۳॔ٓஐφӜּۨ˦ন՝ю½ૠղ߀࠰ä̧ͬ˺ಬஂࡀञֈײ߮GɞҶཔƉŬքԸ”૪Щ಼ֱv಑˴͛ฃʃ"],encodeOffsets:[[22716,67302]]}},{type:"Feature",id:"SWZ",properties:{name:"Swaziland"},geometry:{type:"Polygon",coordinates:["@@ǡύӭěԅҖS̄ɰ̀ĂʔʐÒшƵŰϕðω"],encodeOffsets:[[32842,-27375]]}},{type:"Feature",id:"SYR",properties:{name:"Syria"},geometry:{type:"Polygon",coordinates:["@@࿩ࣅऩͬgNŖŶ_ΈȸҠҜ̈́Əͤϗ¨ÿٞȶΌɤȀɤȀ°Ҹ˞Ǐऎɺ҂ƿۖFॴ̀Ґaक़žїԽҡȹĂؗͅ৫ᇵ࢓"],encodeOffsets:[[39724,34180]]}},{type:"Feature",id:"TCD",properties:{name:"Chad"},geometry:{type:"Polygon",coordinates:["@@ĎЄաnDզΓ̶δ૊ੴߌ¬ન͖ၼǼΰΓ˾_ˌ̽ɔȷರࡔҠ…ྑ…ྏ¦ ܥÐϧإɝԯǬȝˡʳĨΏɑΕč̯̎¶Ǯ͕Vӥ̲ʛYȯՏƛэͽ؉ࣹ߅ϳ߹¾ʁûĊ̏ѫ̋Σ͟੓͏ȽȐƓhƹɍۛÙƀɪ˅ׄşΐλƜӷӪǼІϦċʂÐҸSқކŒ֐É֐ͭՠ"],encodeOffsets:[[14844,13169]]}},{type:"Feature",id:"TGO",properties:{name:"Togo"},geometry:{type:"Polygon",coordinates:["@@ڱdzȇ̎ɡՔãкȆݴɁ̬ăڎD؎ΕѠÖˀ݂kŅѵʲʝ̈̋ŽЭǜǥኝȺׅ"],encodeOffsets:[[1911,6290]]}},{type:"Feature",id:"THA",properties:{name:"Thailand"},geometry:{type:"Polygon",coordinates:["@@ݭϬܗeŬڈ݉Káऋґ௯˙ݏÌ؋ն΀ދưܭҶӓԚĭѤѧ˝·ևĵßќۇςƣƭͧ͒ƝжҁӄПЌƏӳǃҲĠԾʚ߬ТࡸҤ޶͟ތ`϶ĩҸ֕ښȩф̄ƺ̮ܶ·ֆՓؘН݆ΠƴϦࣦצœӬθӔȘθʷ´ԍ֨ȷࢭpݫࢰԆʤƧӰzǜَ̊ÍٖڽÀࠥںܷ›܅˙ϛ޿ŦગDž՟ۧȤ১"],encodeOffsets:[[105047,12480]]}},{type:"Feature",id:"TJK",properties:{name:"Tajikistan"},geometry:{type:"Polygon",coordinates:["@@̭ʷࣳƖāӛ࣬Þਢ˗འŶɈާˠĐԜȓ‡͛ŴӍࡿBׁØԻϕύĉ̉ǯͩˠþ۸ʩ¢ĞʲғȐα̇ė͹Żūԇj˕ϩ˯nj؋ˑʱĺӀࡘǹض؟ȨɔφۮŸЌҬˌբ૲ȜǩϵŤɹΎv"],encodeOffsets:[[72719,41211]]}},{type:"Feature",id:"TKM",properties:{name:"Turkmenistan"},geometry:{type:"Polygon",coordinates:["@@ñۼطŠॣݔڣĠगюׯþσƽ֙|ׯӓ݇NjƻרŪ࢞ٽ˶Ɏֺ֏¸Ȇ۾ߊȵ݈ˎؓԎʉӔڱɋď؛ʿհψ˨ॖǪ֨ɻךڅњ¤ॆ\\Əцܖ̂۾ӦଆѹĜڡ͐ǣࣦžˮƳаࡽ०ׇոЃ࢞Щ૤Ϋwԥʩ€Ѕɤſ̙۽NjǙڥӁʭڏŵǫϟهŏࡩ͈"],encodeOffsets:[[62680,36506]]}},{type:"Feature",id:"TLS",properties:{name:"East Timor"},geometry:{type:"Polygon",coordinates:["@@IJȤܢȌז†ˀŀ͆Ľ̯ɫ࢕ο۳ʋeʬďǔ"],encodeOffsets:[[127968,-9106]]}},{type:"Feature",id:"TTO",properties:{name:"Trinidad and Tobago"},geometry:{type:"Polygon",coordinates:["@@ӚŊǮ‡‘صۭġƯúʒɲiͪ"],encodeOffsets:[[-63160,11019]]}},{type:"Feature",id:"TUN",properties:{name:"Tunisia"},geometry:{type:"Polygon",coordinates:["@@ΩພԭͺQȰۉԄóنԮҶȢۚƃߠǠќࣶͺךĵ}ы܊̲ÒljпЫMϱ̆ȽōܫփхDŽқѤaɄЍ͊ſ³٥Хʋʵˏֽ͓ĘΑïΟЧț"],encodeOffsets:[[9710,31035]]}},{type:"Feature",id:"TUR",properties:{name:"Turkey"},geometry:{type:"MultiPolygon",coordinates:[["@@஺͗ঐżܤõলѬࣆ¢ߴЭƜ̑ăУزȻͨʕֻʇˀ५ǏʻҠڧЕƙ̏Ɋ঍ňίŽॗŽҏbॳ̿ەEҁǀऍɹ˝ǐ¯ҷɣǿɣǿ̱Ϡ͈͂ԟí۱ȖֿәౣĥڹҊࣟ†ȗΑׇij߻҄ࣻeӽ࠶ؗҰЦٸՓВठߨಒ’Μྀٔŏ৞հ঒ʄർlุף"],["@@۫ҏ˃Ϻ\\ǦȦĦʺՂХɞࡦ˄ܤőĴ͓ܼ˓Ƶȵি±Ωʷ"]],encodeOffsets:[[[37800,42328]],[[27845,41668]]]}},{type:"Feature",id:"TZA",properties:{name:"United Republic of Tanzania"},geometry:{type:"Polygon",coordinates:["@@ƚġᵂႋÌӣ஼࠿ϱਙ¸Ӊՠ̩~ɓɳԓ¶ʭÇГ̌Ճΐ̰ࠡǿڝӣࣿ͛ԋb̙ʥבsɕŃঢ়ʂكåɽଢ˵ϺǛɶࠗƾӉʨՕƘͯƘΗɈґ੖ӣҺǗӤČѨƯޞΎ ̨̦͜ѬȺǮS˘ǷȐ·ͨʐł¶Ӷͫӄ̎Ķऄ[ႎà"],encodeOffsets:[[34718,-972]]}},{type:"Feature",id:"UGA",properties:{name:"Uganda"},geometry:{type:"Polygon",coordinates:["@@ः\\̍ĵԇʷȯĐPوȜ͎²ڬǰϸ͎Ѭ͔ɠ˒̘͵Ŗ¼চΌɮՖȉڰȠעEԬϮЊ׍İсτ९̧ؓЯ֋ʉͽTࢹႍß"],encodeOffsets:[[32631,-1052]]}},{type:"Feature",id:"UKR",properties:{name:"Ukraine"},geometry:{type:"Polygon",coordinates:["@@̾“ɄȒʮ¥ࢌĆ՞Ӈȿǝêʻڠ£̘ηkǑ੪̏٢Ƅ԰ϿӮVఊ˙XʙͿѯȆҩƃ˩߻Õџɻύڡã֑˕޽«ܣ̻¸ԹЪȭࡨ¼Ǐ̛ँơଛӟұǠȄЂࣽʘƨLjߪ˪ʑȔಯɆË̼ީĻ̷ҧٱةϟƠЁƉϑƺɂĞƦ˾ɲˎÑƮǬäĊśӸ{ɞØƽĎÐŲ̉ɈŧΘ̩ƐÒ˶ϝɦΉŽأʾ֑ĉȧŭΟ@Ƀȟاă˹ŹϷȴ՟HԳĢγǵÍɤұɮǐͺɸɔȀµɑϘބۦиİĜɾхܼДҢɪٲnࡖßबȫڎi͂ŧ̀Ʀɚȝݸ¢ͮąÄцʶȂܞº"],encodeOffsets:[[32549,53353]]}},{type:"Feature",id:"URY",properties:{name:"Uruguay"},geometry:{type:"Polygon",coordinates:["@@ղĚࡆٯ̺|ࡺ՟ڈҫӠֱχЉɸӇεՇॉұاǚғěޥΰ֫ԟҬÞլǾȈS࠸ɤࡺȾڦ"],encodeOffsets:[[-59008,-30941]]}},{type:"Feature",id:"USA",properties:{name:"United States of America"},geometry:{type:"MultiPolygon",coordinates:[["@@ũƕȽŤ|ɾƓ̨¦ĤƤƎÍǔ¸þÜe͐ƙƬñƌőɊ̍q¯͟ǵˏſ"],["@@˭ÑƟǮīèQÀĈî̘āɘŹëĵ"],["@@ĝ҉|Úĸа•"],["@@­µÓŻˆŃȒ’ɤŚêÃʐ˥"],["@@ıĉ˱ƴªÖŸĈȘijȝ"],["@@Ƭңʼƛז½࡬ƅࠂʹڼŊਖɓ˞Tݨʄ߂̧ࠒ͗ں˩ٶˏĈəȢĉ½ĉɦǎĔ¦ȣǜƅɴ@ŬĹĽƫ࢖ЁǶށǚܳʗӹЁҥȁ̍mēĦť˸Ɓɂ@ঊ҆ࡾƀસмfĐ÷ʰƉǒϜƆࠜHޘAˎ͞ŀàࢶ؄ϜƸ౦N໾BĎȺː¦Φž̖Ϣʲٺٚي˨ə֜ƜώʏAଧռӅƢ˝࣋Пࡷ̃ࢱʝѻӿƛȋSѽˤѽΒsė̬ʦȇãʇ֥ƋЗhةƥλ¥ӥ¥۫ʏఀǂʠǃ୳ʥ՗C|ĺʭɷʚǹ׽ؑ٧×Ɏȁª˟ɀǪҍȼƭ^ͅˏ͛ҿڡûʺֲѕ͎įۦljεǴՑևƀׂ˓˜ߛʊÍĖ̃ŠࡁՕدࢇʝցӱнÁэ̱ţ˭इձӁЍЅӽŻׯƪ׍ˬܗώשLεЊঅ֥—͛ȿԡʣŃЯĺƁς͋ȖѻܢϹٞű͢Ǥ֐ɽҦٻ۲͟źࡑϡƭ¦СϼՃȺोŁݗĤٙÍΏſƲɟaͽǴǓLJō̵Ů́ǃ؍€طѺܻĿ؏ȚԹÏۻȝއح࠳γҝБȕϗUׅ¨ЕDŽ˹͝{׭ȂٽʺɽЄȁטӷӐ̃ӰуֺףͲۉgՉڑۣʦѡʪȽҦ˧Ѯӿτїˈ̩̖ป@C΋ڗ@ဩOቿפ౓ТĀǒ੩ĝॕÝƙіխӚϻĴğʌһ¦̝ɪޭĊɉƌĹҢࠁࡊ۩ୠˆȚχˤٯ۴řۆ҃ҞȀۢ…ܜˍ٢͠ߊĸނĺނƱૼˇܘʓ϶ĸǐ௒˷҂ߋȺɜƇې˷ێᛸ@᠂@ࠜ@ᢢ@៚@ᡀ@ᡄ@᭰@ᮞBაAF͔˴J"],["@@࠽͋ѕɐŽЀބ̘҆Ÿ֐ÉΤʻܫЍ"],["@@ԧŽսƾԛɮࠦƞښùĂ͑"],["@@԰DžԾĒڸɛ࠲őéĝُDZٕǾ͋Ʋݍµȧôº̈́"],["@@؊ϛώnjහ»¹ȕ౾ƛࡨČᄚ˅ྤā٨ʼn૦Ǝౢʧࣲŝ@@MᷱIⷍࠠ{ࠌɵהρݜցࠈҺࡈ˖Ҁѡ֤·ޒϙՂ׽࡮य़ේ՗xՋұЙҥ͂ݍˌʃܺએںҍߎ߯Ä೷rটʌ჉ࢎߩDŽ฽̜୑í࿻ϬৃΨटǯǦ׏ҫÁঁǫ݉˱झdzťӶϚࠚࣀʶɱɂੱҵֵ֑௅ױؚСߏ׿ࣗΗࡁʱȻωಽѡ˅ϿছΫֽÞ޷ɻ࡝˹ۧ˫෹ʉſƘऀϾࠔʸࣆҠਬĨвΈ୘ԊȈǚب̒ƢْђӸॹʫ˓Ơҕ̧շюɧ̝̽м࠿ͳԩBïԄƲ̮ե̚થLJ܁ЀַȬIӈ٩Ϊ͘ӘۆҸ̚њںÖ־ƇڴМ؎ï٘ʼƻϨҹưج͖ԩWࢻǽʯȃڏȄஏĥ௷ȬΛ͸੟Ӧ୾ΘመШ۔@ŕнᄢŽڽԶਕ͌ױр߫ΨଽˈҺѲ๰‚ਗ਼ϦȨФ࡬ЎࠊĪཪώޜÉಐ҄ౚǭ"]],encodeOffsets:[[[-159275,19542]],[[-159825,21140]],[[-160520,21686]],[[-161436,21834]],[[-163169,22510]],[[-97093,50575]],[[-156678,58487]],[[-169553,61348]],[[-175853,65314]],[[-158789,72856]]]}},{type:"Feature",id:"UZB",properties:{name:"Uzbekistan"},geometry:{type:"Polygon",coordinates:["@@xԦૣά࢝ЪշЄ॥׈Яࡾ˭ƴࣥ͏ǤěڢଅѺ۽ӥܕ́Ɛхॅ[ᶾᓘӺƾïದ׻یͅߤݵঢŪ෸à৔ؗÙࡅЦMǢۍ੬ɲЉ̺Lπ׺૎הӖƺʠĉ۵խئ́ײȾ়ѷ੽؁ٕĊ΍uţɺǪ϶૱țˋաЋҫۭ ɓυؠȧǺصҿࡗهǰҳN"],encodeOffsets:[[68116,38260]]}},{type:"Feature",id:"VEN",properties:{name:"Venezuela"},geometry:{type:"Polygon",coordinates:["@@yȣӱĭ˜ϡYѭυӥ͆ڙδÆȌ؈ʻ̒§َਸ਼΀řІ̎ˆ̞ןל_մҵ˧ݮQ࣌ĔӖϕٞĻҼʾXɄਨ¼৖\\܉ʛ˼Їڦ×ِЯƆڧѬn͢ȣڕӱó̫˾̷ȽƽԫƉjϱɫɱّ֪Őʁ̭͍ऱ̽׿Žʏȣڛɀثņƿýϔɑ‘֝ŜՉ܆ï°ǭ׷ʅĭΣΉƏسȝNjʱٷÅҧѼʯ࠺ɟ̧̌Ȅюм…ȊʅʠǛ֒à׼Ȉ˰ƲҎ̓Ơӏĩ؁®ͻęסܢӥńઉăȧ̊ȷê‡ǬĴ̶áͺȃȂŅϮѡÈɸӮĺ׶ʔ̸͘ʌɈрդƖ"],encodeOffsets:[[-73043,12059]]}},{type:"Feature",id:"VNM",properties:{name:"Vietnam"},geometry:{type:"Polygon",coordinates:["@@૭ܗ۫ߍȁ׍٠ࢭ޺ળނԱԞګϪ།ŕ๓۫փ१եۇ۫਷ޱ̧ՠʀ֬دӌܬ͸ࢦÔσԚප٨ļ৖ț֖ƶࡀɃצٍאՋ݌ۥ঴৓Ԋʊ̠՞ɘ͙ܺਙPϕކӭڐҊȴڢIࠈĬܒ҄К̿ސƵƃӛАͿࡎɓ"],encodeOffsets:[[110644,22070]]}},{type:"Feature",id:"VUT",properties:{name:"Vanuatu"},geometry:{type:"MultiPolygon",coordinates:[["@@ˣō˭ςŒɤՆӗ"],["@@ƌڱɥŀǩ­ťɴi٢Дʵ"]],encodeOffsets:[[[171874,-16861]],[[171119,-15292]]]}},{type:"Feature",id:"PSE",properties:{name:"West Bank"},geometry:{type:"Polygon",coordinates:["@@@ԣŭʙЃŕ˜ɜɌŚɁĦǬ̤֔ś"],encodeOffsets:[[36399,33172]]}},{type:"Feature",id:"YEM",properties:{name:"Yemen"},geometry:{type:"Polygon",coordinates:["@@؉ɥNjύo˹࠷Οഇϻݩףυ±ʥºӭΑ՗lj۷©ɃµǿɛəÕŻɇеlˍœ׉¨ɓӬzҠƍʜǑتʋΊǚ¤đϨĸNJ™ξςˌđΠɞЮΊɓɬúॺnƸċ߼č͐¨ɂ˫ϺƖ׼ࢦ޸Ϛᝒ͒ڀ൳˞ח"],encodeOffsets:[[54384,17051]]}},{type:"Feature",id:"ZAF",properties:{name:"South Africa"},geometry:{type:"Polygon",coordinates:["@@ǏŧΣяɻћӇ׻ोࢁףԋًϣ࢛͙ѓ«ŇɷԛŰеDž࣫NJԙĹΏ¬ࡿͩܓƃԱͅϡoΣ̚˳fαϒŸśŏɦLӰ˙֞˔ƴs٤ս޼х܈AF׽તДдͪɯƘΫϘÓՈǃҌÖݤіB᷌ɨűӾߙûԟȈ̏׼ĒрϒЊʨȶДЦȚΠķВɽۂ£՞ȜĐʾƨДҚäʨ͂˪֔ݮغஒؤ΂UОƛ˲Ķ҂ċД஁ɔׯƫऩî̟чƶʏÑāʓɯ̿T̃ԆҕӮĜǢώْQȿؑıۥɑϛֵщ","@@νʶϻǟҕ҃͡Տـ٧̜ČƺˎҴƀƜ˜ʴФ̅ʪ"],encodeOffsets:[[32278,-29959],[29674,-29650]]}},{type:"Feature",id:"ZMB",properties:{name:"Zambia"},geometry:{type:"Polygon",coordinates:["@@ІϏɊ܋ƝɩǙڻLjۡ˃̇ʭޭѶɓᢇۗĂׯٍřӍͯĹ̛̅ßܵۓҭխ˳o˗ĬऱĠƯÚOêͧȎկ¶ۋȑչԾ֣یžᦶშYí̂Ű̀ƧЀĪТėʺ̂q¶ʽϾrՖûˬϡڨŝԤˆȌѯ٠ş̴ΧΈҥ٠Që࣠ɱƳח͞ɧƬļࡈƬসȉψʈ՚ɤĶ଀ƚͦđΘɇͰƗՖƗӊʧ"],encodeOffsets:[[33546,-9452]]}},{type:"Feature",id:"ZWE",properties:{name:"Zimbabwe"},geometry:{type:"Polygon",coordinates:["@@ҁČ˱ĵНƜ΁VՙϞٯźʙՒC̒έĞ्ई˃ӢǛƮ͓ڤलğ˘ī˴pҮծܶ۔̜àĺ̆ӎͰَŚÆ̻۬hϴǯǺȻАÓѦˑF੟Ǐ׋—عƊʝħӵŵùɛ؅ࢫ॓"],encodeOffsets:[[31941,-22785]]}}],UTF8Encoding:!0} +}),n("echarts/util/mapData/geoJson/xiang_gang_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"8100",properties:{name:"香港",cp:[114.2784,22.3057],childNum:1},geometry:{type:"Polygon",coordinates:["@@™@}ScTʟ@cWuJÁ–]„l¦RLj¼BĄà˜ ŽH@TOHCTDDDHDNAT@PEHDDNJLX@BABALHFF@DKHADBBLDHHFBLEJB@GDBBFBADDB@@KFAFBBJJA@BB@@FFDDADFF@FADDDBJC@AFBD@@DDD@DAA@D@DB@DHHBFJBBFEHDFAN@DGDC@DLCBDDCFDlAFBFCBEF@BC@GDAB@FD@DZJ‚X´HĐMja@Ý`p_PCZ@lLnRGSDMFK|a\\Y}­ƒ§™Mën"],encodeOffsets:[[117078,22678]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/xin_jiang_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"6528",properties:{name:"巴音郭楞蒙古自治州",cp:[88.1653,39.6002],childNum:9},geometry:{type:"Polygon",coordinates:["@@˜@ÈÒĊanwŎV„™Ȯ¦ͪŃĢ„ÜōȂçČéƐżLɆóĊ‚ĊaʊŁ±¯²Um»ˌmÈ»V™ʠţWÑůǓ郙ôƑƒğÆīŎī@Ƿ™wô™˺LÞ¯ƨVǪуšĢ™ȘV°wĢŽôk°¯ƒ»΀@Ȃ»ĸŽǔ@΀ƒ͔ôôLɆó̐ÝɜLɲōͪƒƨóŤK@ī@IU܃ÛmȻţǩÝ˹ÛljťǓǫō@Ɲ²¯VçōKͿŁΗÇţ»ƽ™ɅƑLÓŏÅÅɱV@ÝĊU¯ÑĊĭÞLšÞŎJ±̃XȣˌōlƒUÈ¯ŎKÆƅ°™XÑܱnŗġV¯™óaUƒƧUōŁ„Ñ™±„çɲ¥lĉkğ°ƒk¥˜ƒnğţL¯ÝÝUƽĬ΁lķ°@„ō„XÿݯV»ŹLʉÞɱŤĉó°ÝJ™¦ÝKÝ£ţܙÈĉ@ƒxǩUċƑ@ky͓¹™`U²ĉVġ»ğa¯¥ť@ĉ™‚ó@ŻÛÛJƒw¯nó¯ġWƽʩķÝɛwĉĕݼȭÞķō@ó£Å΀ƑŽ¯ôȯÞ¯Ȱ™ÆōèĉXǼó@ݚnºƒĸ„ÞVƜĸȚUʶõˀĵĖɱŎÝĖVࢰӒѢ°˘nϚVˌ™ÈmɼĵŦW¤öʊõʔ@°ÈXVŽ™ènŎȁb¯ǫĉ„±Èğ`ġwōÔğ»mVVŽ„Ý¥ó@™ĸķô@ššbX„ĶmV²²`Þ_˜˜ɴbͪÈ°„ÞWĸÈŌmބškɲŽÈUÆ»n¼ǬVķĸźô¯°n¦ɄǜÈ"],encodeOffsets:[[86986,44534]]}},{type:"Feature",id:"6532",properties:{name:"和田地区",cp:[81.167,36.9855],childNum:8},geometry:{type:"Polygon",coordinates:["@@ƨ¥šèź٨ΘƑᩄbUࢯÞĕɲōĶĕöʿVʵķșUƛƒÝ„ķm¹Þ™ô@È»ĊWŎçšÅ°ȯȰÝ°óƒÆͿĉ»̽çnƒmɱĵƧºóU™™ƽ@±wóL¯°̻L±Æ¯Vƴķb¯VÇ¥ğ²Ǖbk¥ÇKlÅɱġ@у™óK@™ÇaÝXğţxĉČǫķê¯K@уaŹ„ƑKƒ¼¯Vóaónġw™óÞéU™ġbóĉğÇl¹™aUóğKW„Vůn›ÇŋƑ›ķnʇ»óxĉw™çÇ°Åw™°ċ„XŽ™„ób±ƒkÈÇJ—ƒm²ţx@ÒݎšŦǺn„ó¼n°ÇbUÒ±¼XĸĠłƽXmwĉºƒzÈÜmnxmx²ĖmҚbnŽƧêUºĊêÆVóĖóUĉ¼ÅĬƑ°ɆƆŻŚlłÞLš¼nĠƒ¼@ޙšÞź@ŎÞ°VšɄɴжϼِ͈Ŏ„"],encodeOffsets:[[81293,39764]]}},{type:"Feature",id:"6522",properties:{name:"哈密地区",cp:[93.7793,42.9236],childNum:3},geometry:{type:"Polygon",coordinates:["@@WnŐÆĶLĢ¦ţºź„lxÅĸƽŚ‚Ʉ—Į˜è@ô²ÞUĔƐńV°¯ĸX¦Ɛm̐bƒ»Ɇa΀šĢ™ƐLˤ™ȘÑnƒІljĸÿn¯ĶaŎ¯ĢĕȘ¯°΂œla¯¥™ǕǔwˤӱlťО̻nŻmɃĕċţUw°WUóƨÅţķ°ýV±óÅǓéʉ¯ƽŁƒéōǖȁÝƏůǕw˹ǫȗǓƧǕVý™é@ĬţLƧôͩ„ɱŎɛK̏ÞɅôóK@²@°ōؚ¼lŦ¯ŰóƜÛlV¼ķ¼ƒ°kȰ™Ű„ĠƒǬ™ŚÝŎmĖ`@ÇÜn„"],encodeOffsets:[[93387,44539]]}},{type:"Feature",id:"6529",properties:{name:"阿克苏地区",cp:[82.9797,41.0229],childNum:10},geometry:{type:"Polygon",coordinates:["@@VƚxˌŎÞŎƒ°n„ȂÒ°²VĊ¯VğƾˍǬƨÞÞKÈÞĊVźôɆÞĢèŌôWČ²ŤVÞĸʶbl‚¯ôn_VÆĸlmÞnVź_ĸ¼Ȯmǖ„šéĸW°°„ĸJ„kʠ¼Æw°¤ÈƒlxɆzČºĶI²ÆǔUš°ô@Þ¦‚ƒUnUĠ¼ŎÓĢxĠ_²ÇĊƒǬ°ŽȂamōšçUÇW@¯öʓõʉX£ĶťnɻšÇUˋmϙ¯˗ӑѡᩃaΗƒœɜ°xWƴUxɃÒˣ¤Ʌwğ„ʉōóÝŹ±°ȗ@¯„ƃ²¼","@@ō™гwȁ¥Ƨ°ŹÑķV™¼ÞêĊ»‚lĵšm¦ÅW@ĀôÈźaɜxÈbÞÆĶIОŘnIÇŃÛÝĊÑĠƏ"],encodeOffsets:[[80022,41294],[83914,41474]]}},{type:"Feature",id:"6543",properties:{name:"阿勒泰地区",cp:[88.2971,47.0929],childNum:7},geometry:{type:"Polygon",coordinates:["@@ɲˣĊIÈ¥‚ÅU±Ċýkō°ƒĉƽó»ĶƽXóʵʵ™ȯƑÅȁɅ¯ĉ@ÇሗK֛@@ˤV֜ʵрƒǬVĸƑŎ@ƆϯÑóŽķ@ʇ»ķ¦έmlÈĸĊX¼WźÛÞÝѸ‚ĢČþ„ĀĊôάVö¼ĊUƨ°°èŎČUÜƐóôVôôŽ²êȘlˌç°`n²ǬŽĊaš™ƒÛ°±kğmm»š@°ÝɆÛÅÇVaݍVm͔ğôÝÈb‚„@„ƒ™n¯š™ÜUĢÑĊ@źīżWŤÈǖWôŁÆI²ÓƨL@ŽĊX„mmÑÆ»ȰÑkƒĶō@ý°m—¯"],encodeOffsets:[[92656,48460]]}},{type:"Feature",id:"6531",properties:{name:"喀什地区",cp:[77.168,37.8534],childNum:13},geometry:{type:"Polygon",coordinates:["@@Č@°ƒĠ„ôÓô@Ŏĉ@Ƴĸ@Ť£ĢlVôWVóřXĉŤêÞ@ƐÒĢÑlèÈV@šĠIk°ÆŘ@ÈÈĀ@ǶťÒğ@š„@ÒĉlŻ_@šƧĖÅĬōÆ@bźÞnƒƒlVœÝĬšWƼʇ„ƒÝÅ@ÇÅÈwWóĉ±ğz‚ĬČƨƂÝIĉݯbÇÑĉƒ¯ʈV°xUŰĊ¤ƪ_ôÓɚI@lȚXȮ™ŎlɴȘ՘š„¦ɲÆʈ_ɴŽźŽôÞʊŎĠƒɆxˤ£ɄÑVwXƳ¯w›ɛŹ٧™çƧ¦ōƒُ͇еϻɃɳU™Ý¯@ōÝŹš™@݄»mğ™»ÝKkŁżřɅƅƒ¯ÆīĊ»ôVôĕÅUĉéV¹ƨém™anѱĕnwmwnÇۄyĉ¹ŹlŏkĵèķmōÞġKñÔċKÅèĉzƒŽ„ômxȗÿƿI@þÅČÝKÝ°@¼ÈVºš@ÅĢšÆUċłn„ÝÆǕČĵJm£ÝJ¦@ĊƒxV°ƏLċ¼ǩ™@™m@ÅĢómÇÆğ¹Çš™ÆšĖÞKšx„wô¦ÆÑÆL²ÆƾŽU„Ž±ŚÅŻĖ@ĬŤÈñ„@ǔÇx„Èǃ","@@VÇ™ţ°ğUĠ¯mk¯ó¥ķIġÿƏbƒ„ĉa±ÒĸĀlKU„_m»nwšŽ„m@ÈŤ¦ĉbÞ°±Þżł̦°ĢŁVé"],encodeOffsets:[[76624,39196],[81507,40877]]}},{type:"Feature",id:"6542",properties:{name:"塔城地区",cp:[86.6272,45.8514],childNum:7},geometry:{type:"Polygon",coordinates:["@@ήnĸ¥ʈ¼ĸ@ôϰÒ@ƅƒōUķƑǫʶпU֛܃LګK@΋ĸ@Æ£ÞġÅĠċšLV݄»™@Å»Ýnm¯š»nŻĊ@nķŃ@¯ómóÛÝǟ¯aÝóȭ¥ƒšōUmxĉbÇї@›bUº¯X¯ÆƧbVÒĉnǕw¯°ƑŽV„—ŽÇ@kx±Uƒšɱn™ŽÅKƒ„¯ƒĠǠU°ɜL@°ƒxnĬ‚ĀŋŎÇLƒŽğšϱÞέƜkôÅĀǕłƒĸĊŤUŰĢ°„¦ȂϰÜɨ°x@°żǠÆƈČVĠ»ČL°ÇšbĊÑ̐óÞlĶwބɆVÞwǬxǪţȼÜLŐĶˢ@","@@óKĵĀV͈ĉłƾNJÆŤƒzXl°ƒÆL²¼źŽôÈĢǔ™¦l„ô°ɜÞʊĠğŃm»ʵƳƑʝȗīV¥¯ĉ°Ñ@ŃÅI™»ĉmğn™ƒašƒċƨbš™Vğ—w›ġ¯@Uōa™ĉÝJğÑÆŎkŎÞĀlźƒ¦"],encodeOffsets:[[87593,48184],[86884,45760]]}},{type:"Feature",id:"6523",properties:{name:"昌吉回族自治州",cp:[89.6814,44.4507],childNum:7},geometry:{type:"MultiPolygon",coordinates:[["@@መL@È°ĊȂɆƒÆĊ£„ťôWÓɆbĢÅŎƒÆ¦ČÑW¥°ķU¯ƏŃVē±Ý@ó—ç˜ĭɃƾřÆķkwŹƒŤ¹ġ¥ĵKŏÅXmˍщwǓ¤Ƒ@wóōVķ£ɱšġôÛa±Òȁ„óèţIVŽƽ¼k¤ó¹ġJmx—»ÝUƒ²™@ÅƃĸǫŎ„ĊmŎǬ՘"],["@@Þô°bÞǠôÜôn@°ĸń˜Ƕkłƒ¼UޙKğȂÆÝĢŤķ@@ΌڬL܄K@ˣȂ˭lĉńW¥ĵVÆý@ŃÞēUŃȗƅ@ŹƩǕĉ»k»Ç™VğóřX™ŻKƏŽċêȁèÛŎġƒͩń"]],encodeOffsets:[[[90113,46080]],[[87638,44579]]]}},{type:"Feature",id:"6530",properties:{name:"克孜勒苏柯尔克孜自治州",cp:[74.6301,39.5233],childNum:4},geometry:{type:"Polygon",coordinates:["@@ˎǫĠƽ°UUĉ¯±ȁÑmƒ„¯Ýōˋō™wUű»ÅƑ°ƒȘ@²¯ɳʇ`ɱŃ¥՗™ɳȗōkȭšșW@kəJóÔƩ`ĉ£Vů¯wU°ʇĊ„ÈÒ°aĊÞÞJŁċƧīĠyĊ²XôÇxÈÆÆ@„ÞʈƒÅ»™XÞīU›Ƒkm„ŹÝ@aŎÅÆīƨĕ@™ż`Ċk@љƒĠ@ŦÑ@ǵÇÿ@ÇÅŗl¯ğJ@™ÇUkçġÒƏÑÝ@ţéWĊôŚUŽóXUġkţ¤ķ@@ƴōĊó@óÔğƒ¯„ċ@@Қ¤kôˣŰ͓„k»ƒKX¯ċwƧôğɐšÒôIVƙš¯UķǬķšnŽ™¼ôb°ÒȰVVÈÞ°ƒĸó¤V¼°„V°²êƒlĢ҂Uƨ¦ôȰƴĊVV¼ǖIċĊ„ÞɜéšnČW˸Ǹša„řÈw±īšçĸ¤ĊšôšwšŽĸUĢ¦˜éǖĬ„Āô¼lÞkÒ°x°ƆÞx„šÆV²ǔ»„b°wގȘ¥°n„šŎV@°„„ʠè‚ŰȂb"],encodeOffsets:[[80269,42396]]}},{type:"Feature",id:"6521",properties:{name:"吐鲁番地区",cp:[89.6375,42.4127],childNum:3},geometry:{type:"Polygon",coordinates:["@@ôK„ĉǪa²¼lÜô@ʠê°Ĭ™ôȂƒ²ÑÜbĢóɲ™ĸ¤ŎUô@xƒŽǔ£ъxˎmƒÈÛ@‚_nĕÞōšř„ǫƒğšůlȯ„¯ĸ»U»Ükôƛ°ůkť™»Ŏŗ@¯@±͓óͿ„Ǔ@ķȁ¼Ϳ@Ƒ¼¯°ólġ¯xȗUġšƑ™ǩÒƧUÝ°˹Kóššx@ǸōĬÅĬƑĠ󃄚ǔêÆ°XÒʟŤUšÇ¼ˋnn¼±V²°ȂUŌݜbʟǔɅô@żǬaҎÈ"],encodeOffsets:[[90248,44371]]}},{type:"Feature",id:"6540",properties:{name:"伊犁哈萨克自治州",cp:[82.5513,43.5498],childNum:10},geometry:{type:"MultiPolygon",coordinates:[["@@ĉ„ÆŘȁ̐mÞ¯ĀX°±¼@ƾ¯ƴ°ŎÝþŋ¦WÜÞbȂĉźUœÇmwVUȂóô@ȰÝ΀nÆJn™ƾ™ʠ™ŌLČóǪ¯œ¥ǔaǖšŌaôÝĢLšx„ƒÆLšɲm„™²VlwÈ@˜Uƒƒ°¯ǖxĊmUÑƨa°Å°WV¹œa›ÇɃÈm¥°¯ŹóĸķǫUm»Å¼ÇVɱ™l݃ŋnķÇÝX¯ƒͩÇɳa——Ý`±_U±ĵnWƒ™a@™ĸóšķ™¯ǓV±ÅĵJċ¹ɅykwDŽ¯£Åxʟ»ƒlķI¯ƒX¯ķ‚™êǕƒȭnķ»Ź`±„kÞ@Žš„Ýô@Þ°xšŤŎIƨÆUxōš¯²ǔĬǬlUŚ"],["@@ÞĀlźƒ¦¯ĸŤKޙšƒċƨbš™Vğ—w›ġ¯@ţƽJ"]],encodeOffsets:[[[82722,44337]],[[86817,45456]]]}},{type:"Feature",id:"6527",properties:{name:"博尔塔拉蒙古自治州",cp:[81.8481,44.6979],childNum:3},geometry:{type:"Polygon",coordinates:["@@ήƛϲÝĠ™„ÈKŌōÿmī„w@¯ɛKV¯ğǟ°Ƒ™wġKóÞŋbǕ™Ǔb›¦ǩ°ċôŋKʟšƽšmšÅImŽͿŽȯÞó@ȁôUVnx›ÈŹVȁĊÝabŻ£¯°l„óxȂŤĸkĊšÞyĊêĊmĢxV„ƨÈŽĠX„ŽΘÆĠÔź‚Ɇţ°LXƾŤŤb"],encodeOffsets:[[84555,46311]]}},{type:"Feature",id:"6501",properties:{name:"乌鲁木齐市",cp:[87.9236,43.5883],childNum:4},geometry:{type:"Polygon",coordinates:["@@šŽWŽôŚUĠȚl¼Ċ¼ƪǖ@źȘƆ@ýlܚXVŘޙš¦V¼kĖó҃èkĊȁˮ֜@ǫ՗nōƒĉǬō„ķÆŚ@„±ÞV˜¼nwĢIôºl£ƾ»UŤJôçšó¯īʟéó@kÛ±»ǩbƒĊóLҍÇǫb@ŻɆóʠǓ›aŋÞȁVʉłĉbĉɅô"],encodeOffsets:[[88887,44146]]}},{type:"Feature",id:"6502",properties:{name:"克拉玛依市",cp:[85.2869,45.5054],childNum:2},geometry:{type:"MultiPolygon",coordinates:[["@@ɜÞʊĊýVaŃm»ʵƳƑʝȗīV¥¯ĉ°Ñ@ŃÅI™»ĉmğn™ƒaݚţL°ķóKĵĀV͈ĉłƾNJÆŤƒzXl°ƒÆL²¼źŽôÈĢǔ™¦l„ô°"],["@@ƾIŤ@UUwōa™ĉÝJğÑÆŎkŎ"]],encodeOffsets:[[[87424,47245]],[[86817,45456]]]}},{type:"Feature",id:"659002",properties:{name:"阿拉尔市",cp:[81.2769,40.6549],childNum:1},geometry:{type:"Polygon",coordinates:["@@nIÇŃÛÝĊÑĠƏō™гwȁ¥Ƨ°ŹÑķV™¼ÞêĊ»‚lĵšm¦ÅW@ĀôÈźaɜxÈbÞÆĶIОŘ"],encodeOffsets:[[83824,41929]]}},{type:"Feature",id:"659003",properties:{name:"图木舒克市",cp:[79.1345,39.8749],childNum:1},geometry:{type:"Polygon",coordinates:["@@VéVÇ™ţ°ğUĠ¯mk¯ó¥ķIġÿƏbƒ„ĉa±ÒĸĀlKU„_m»nwšŽ„m@ÈŤ¦ĉbÞ°±Þżł̦°ĢŁ"],encodeOffsets:[[81496,40962]]}},{type:"Feature",id:"659004",properties:{name:"五家渠市",cp:[87.5391,44.3024],childNum:1},geometry:{type:"Polygon",coordinates:["@@„çôÑlĕU»™¥ÝšUŗ™WkÛ@þVńÝĔ@ńÅþĶUX¦Æƒ"],encodeOffsets:[[89674,45636]]}},{type:"Feature",id:"659001",properties:{name:"石河子市",cp:[86.0229,44.2914],childNum:1},geometry:{type:"Polygon",coordinates:["@@lŁ—ǵm‚ĉ@mż™¼n°ÞmƼš@"],encodeOffsets:[[88178,45529]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/xi_zang_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"5424",properties:{name:"那曲地区",cp:[88.1982,33.3215],childNum:10},geometry:{type:"Polygon",coordinates:["@@ƨʔĸbܺÞwnxźbÞ°ô@„ĶŽĸIȼĊJŎÈôUšÝƒ¤ǔLސŎ@ĢŽȘblƒôL„ÇźçȤôLš¥ÞIÞ¯Ķxʊťƨ™ƿÑĉXVķŦ¯ȂKÇǕšÑ¯IUš£¯Óƿ£VĕōÞÿÆwƒƑ„£ǖxÞĕ±ÇÝaUÑȃU¯‚UōÈ݃wWŁĵ™±Ý„óĢÿ°IÞ±mÅĢ¯mÿ„¥°UnÑŤĢĕĶwǬŻͪwŎ¼źÇĢ„ĠĕˎŁ°óƨ¼Èa‚m@¥°wǔ„ǖ°ŽƨÇŤœšġƨ„ŎŃôbÈÛŎĊ°@Ġw²ÑÞJƃÆb²ƒ°êĊUނlȲƒV„ÈKĊÒĸĉ›»ÅôťUÅǃk¯@ǂÑklǁÅl™Ģ™VÑóƒ@°@„ÛĸƒV¯ƒÇĊ™n¯Uĕšƽ¯m›¯b™È@Ò°Ĭƒbĵ›¼„‚kxķýÇJk£ÝaUÑÅóĶǟkÓʉnĉƒÝ¼Ƒ„ó»Þmn£m™Č¯@ƒȮÿV¯ĸƒ™k@Ýówƒ»ğ„ġ±ǓLō„ƒšV¼Əèķĉ™è±b@Òţ„UÑóakƒl£™Ó@¯L@™ÇlUóȁš¯aġÈÅĕÝLķ¯Ė¯@WĬ—x‚ÒÈnW°ţôU²ǓÓġ²V°¯ôƒǔÝL—ċšk™š»Ý»Ýš¯ÞƒVƒwۄÝÇōͩÈĉċ»ĉm¯£W¥ţKkóġƏW@¯±kōŽÈ›b@җšÇaƒÆ¯a™„ƒkóŽÛƒÇ¦Ýa¯šÝ™ĉ@ǻۄmƒǓxķƛ¯lVĀÅÞġb™™ÇJUÅV™ĖƑW™zō»ōšƒW™n@è¯ÞóVkwƩnkźÇބҙޯƒƒýğÇUxÆÈnè±bĉÝ»ÈуwšwÞ@m»ÈV@ýÇ°ķ™xƒa„ݯXċ¥ƒÈóW@ôkxlnxVÈóĊkŤġ¼@°¯ŰƑL̻۱ŎÝV—Þ›VƒÇÞŎÇakƞ‚š@èğŎĸżšƾ°ÒšLÞôĠKȰĖźVÈÒĠ„¤™VôšŽU„ÈþťL@ôǬÞlÜÈnÇÒUŚ™@šĊƨW°™°Xƒ‚@ČÇþ„ƴĉÒķ¦@ŽĢôWĀôłUÞĢǬ™ź°¼š@ƒôV°„bUÆnzm¤ƽĸƒÈ"],encodeOffsets:[[88133,36721]]}},{type:"Feature",id:"5425",properties:{name:"阿里地区",cp:[82.3645,32.7667],childNum:7},geometry:{type:"Polygon",coordinates:["@@„Çƾķn£myVŃaU¯„ó™@¯»šŹġǫVÝóŁXÿġó@ĸ¥ĊуƳÈý@ċ„Wš¯X¯ĉƧ‚™š@VřÈÑÇmkÛǫÝ@óŦKÇýVƒ™U󚏃£ğÇÑŹUȯĕğLÝó™K¯Ñ™ƽķŻĠō@灙lƝÈbƍÈ݂„œU˜ÝÞU²ō̼ůƒK°ů@¯UK±—ĊƧbōÇmçÈġƒóšÅób™™źóš¥kīƯól™ç™KôĵUƒÅ„VŃķ¥nÅŏm¯¹Å‚™»@ÑǍóxÝkʇȤU¤ķb@ƒ¯ĊÇx¯ĸĉKm°šĀk¦l„„KnĬȀƾÛ¦WÆŐmNJĉ°ōUţ¤UšŎ°šŎKÞłÆ„Ǔ¦ƒÞ™‚™„ř¯bmUÝl¯Um™ğl¯£șwŎǫaÝnĉĶƒk@¯™K™šō»ĉn™aÞ»ťnkml™ĸ¥UŚŻkÑťƒĉV™ôó°LôīĠU„ÿĉǕÅz±Kƒ¤„²ō¤¯Ė¯UÝ¥Vĵ™óÈťÝwķșÑk¤ó„™ƒWýĵĕ™„VĠƒV󍃎Ǔ„ķ°k±VU±ţ¦UǟÝřJVљ¥XUċUŎlÛƆǕÆȗƆ¯wŏÞÅ@™šĉl݁óŽƒÒ™nUôńlxólÝôێ±™™LÛôÝL@‚ġ¯X¯ÇUżóa󤛼XÒġŎóLk¦‚ôżĸĠ™¼™KġƆô¦„ÆƑÔĉĶ¯ImÒ°¦n°¯Þl˜ÝČn„ƒÒšKĠޚĕkƒlýƾťœšôI‚ĖŤÒnƜm¼¯lnżóÞ@Ůó¦™ôƽĖċŚn°Ý°ôÈUƜƒblÞóŽ@Žǖô°UÈƆ°X„þôŽô‚lѢšŽ²Ėm¦°š@¤™XŽĊblܚzkºƒĖmX„šŎWVšóÞn°lĠxȚa°»żLźƒ„b@Æ°XĠÝȚxĊĕŤaȚ‚°È@„„@èŤ¦Ü¼œW˜ÞkŽÈ@V°lŤkŎ±²¦ƐUšlj°aÈÑŎbĢƒŎbÆ¥ÞIȘlššôVÈU‚™šb„kɲĶn„mnXb̼òƾĖŎ@ĢȂÑôÓĠĖʊšĊÔ"],encodeOffsets:[[88133,36721]]}},{type:"Feature",id:"5423",properties:{name:"日喀则地区",cp:[86.2427,29.5093],childNum:18},geometry:{type:"Polygon",coordinates:["@@ĶĖXþš„ôƒl£šÒĸÇÞxÇŦšôUĶÞ¦°V°ĕŎ£ƒ±„£²LÆyĊǖƒĀğVóĬ¯KóôUš‚ĊŦ„lҙżVÆķ¦kšlnŦmݼšbĊmŎ¼š™šL@°„lĊĵÞmǬbƍȚx°¤Ġknš°VÞkVn°aƒŚš‚š„Ýǔ¥ÅƒÝŁōL¯™ōV™Ť£ŎVĊ¯nljƏXÅÜ¥ǿƽmīƒLkƒl¥™ÿn¯ĊL°ķÈw°ĉ@ƑĸaV£ʈȣÞlôwȎ@Қ¼Æ°ºŐnmÆĸ¦UńƃV„óĶšLšèôkÅ°lĬ™¦Źôššôa™Æ„ôÇĢnèŎÈƨa˜ĉ²‚VLĢ»lţôĉUǂwkmlw@óôX„ÇȦ°WƒÞ„b‚wĸšÈ¯@þÇUn¼Ý@™x„xÇńÞ¼ĊŽ²amçÅÇVwĠȄþ°„šÝƒÑÈÝlŹƪmlxôU°Ý@çšm„XŎ™Ŏ¼šyƒXšĕÆUVÈIššĢaÆÝUÿ°kĸƜǔwn„܃ȼĊ@ޚ°™Þbȥ܄ô„lšƒ°b„ÅÈb˜™@ќa‚ǯUU¯Vġš»ƒ™¯aV¯Ç°Å™mnÑŤçǬVǬ™±ĉ¯¥Vĕ¯Ýk£˜ō—w@±ġÛ°ÇVїƒ@ۘa@ČL™Ƴ™„ƒÇa¯¤ÝIĵ¼U¥ƿōķÅţŻókÝóĕ‚¥¯™U»Æ£X¯ġŃÛkÝ°V°ó¼¯èWôÞĖ„ȎƒŽkĀƧĀówm¥¯JŹÝJݙōVVŁaݐƑ@ƒ˜ğŭǂ¯_ƒ˜ĵ—›VnxŃón›ƒĵxÇĖĉVÝÈğV™Ò󃯐±Żĉ£ķÆÅL™Ljĉý˜ţۃ¯VƒnV¤ÝÈ@°ÅÞݤ™ŰğŁm¦ÝxóKƒ¥ɱÈUĠôêVôÛ¼ÇWÝçĵaō¦óĖƧlÇĢƑŽnŎDŽV¼¼‚ºÛ@m¦ƽ„ĉmm¯ÝKÛç¯bŏłĬ™bƒ¼ÅLmŽ„xť°ÅU™šÝXkŽÝmĉ¦W„¯K„ÒknÝaV„Ýè¯KɅńÝKnÞ¯¼"],encodeOffsets:[[84117,30927]]}},{type:"Feature",id:"5426",properties:{name:"林芝地区",cp:[95.4602,29.1138],childNum:7},geometry:{type:"Polygon",coordinates:["@@‚VÈłVôÈk@š°K@ŽšÔk¤l„ôbVÒŤƒ@ѲašçĸĊƐçU»„™ŎƒǔKĢ²Ġƒ„¼ôx@ޚlƨĬ„Ul¯ÈLV‚šÞJ„°Ünʊ„wÜbXê‚VÞ¯°ššanaU°wƼɴÑWÑ°mÈýÈam¥Þ£Ť@„¥ôblÞĢ„ź¥ôxÈÅmݚ™ƒĕŃV»ĉōŤōnóƒ»ÈīķIUƒĠÑ°ġĸLÞ¯VÒƂ@Ābš¼WôÈ@V¼ôóŤKÈÑU»šwVǫżnWÒÈx™¼‚lŦ£ĊōŤx²¯@ƒÆƒU¯šçÆ@„¤°£„é°k°lšůÈó@¯ŤÇÈĉƒkkÿó¥ÝXķљÜ@ÒóŚÝ¯°ĉówÇ±¦ÅJUÒĉĀķw¯°mĖ¯„±akxÝÅnƒ™»lуK@¯lU™¯UVѯóĊ¯mōğVǓƅƒÞƒWÝÈÛ@ƿô¯ÜġzÅþ¯ólmôʇġĊÅUͿřŏȁˋŁóÇˡōƧƒÇb™w°Ķôk¦šÒƒnUþġҙÔkǔķèó@ƒ²@ŘōńĵyƒzġaݤÅIƒ¤Ƀť¦ğѯ¤ķbóš¯ó±ŽU²°¤ČÜVnÈƂ„ŚŎ°ôĢ„þÆzèVĀǎĀǘƒXŹÑ¯¤ówċķk¦šłUÒġzÇ@ƒ™ÆÝx@²Þ@Ƥ„Uô¦Uš°x„U"],encodeOffsets:[[94737,30809]]}},{type:"Feature",id:"5421",properties:{name:"昌都地区",cp:[97.0203,30.7068],childNum:11},geometry:{type:"Polygon",coordinates:["@@™ŽVĖm°ĉš„ÈU°ķ„ƒÜ¯@@ô„UÒġškš‚ÆkÈlŽÒ@Èl°È„VÆóŦƂœ¼‚a„ÅĢ™Ʉwnōw@¥Ŏ¦°ŹÞmVš°wnÿƒw„wÝw@¯šmÞŗ°wĠ˜ĸkÞğlĔ²¦°@„ĕĸwVóšal@nĢÇĊn°@¦šŽźUXçǔůĸVš™ÆK„ÈÝĠš²ÅĔô@lšŽÈ_m˜„zǖl„šaU¼ôwV°¯¦‚ĬÈa„l@Čǎ„¼™„nŽ˜I„xô»ɜ@ƨ¥ɆŁ„ŃǪȁkƛƨȍʊȡóĭ›@—ÈÇVƒůރĸƅmēƨť™ÅÈʉVǵ°ġVŭÅɧ°ÿnɛš£mƒķ²ŃóÑUĉ°mÇ»¯@mxUĀ¯èţ°ȁÝç„ġU¯ÆÇţÈ@°Çô™Ű¯k¯lƒê¯¤ƒ£Å@™èV°Å„@„±°ţwĉŎť¤kš»ÇwXÑŻmUǬ™xV¼ÇÒţLóôU»Ç@X󙻂a@ÿŁUÑÝ°ķK¯ĢğÒV„ĸJÇĬ„¼môţŎĊŎU¼Æ„„Ė™šnÞÇÆówŹ¦ġƒkÝóaƒ¦ţ@ݤn¦ÇbÇþ¯nXÒɳÒÅ»¯xVmb™b¯™Ý°UWéÛaƒxʉÛmƒ¯ÝI™‚UÇKk°ƒVƧīķ„U°ȭĀ@„ċ°nšm¤Ýnô¼ƒƒÞ»Ċ„ʊmlÔĵǠÆôVÒÞbl¤ÈIĸþlwƒœ»ĶŽ„a¯ī@њǰanœƾ°"],encodeOffsets:[[97302,31917]]}},{type:"Feature",id:"5422",properties:{name:"山南地区",cp:[92.2083,28.3392],childNum:12},geometry:{type:"Polygon",coordinates:["@@°ÞUĖ°¦²ĊôÇÜLǖĀɜŽȘŰÞLĸźêÞ@UÜUŤ°ɞ¯Ü„°WŦĀmŎ„¦ĢyVљŁl¥Čĸôx°£źÒ„Wȗ‚ÿȍUÿ‚çÅyƒýóġō¯ƒřŁmÇÛUċŽ¯£V±²°ôô™ĸa°£ĠÒŦ¥ɄŽ„£ÆJÞ£Ģb„yĶzŎŃ@ŗ„±ô@ĸçlǓšÓĢÑVý„m™Ñl¥ĵó‚¯̻̥™ƛǫÝһÇƧĉyţ¼ҍēVĶĉŎ°ĸmšÞVÝĸ™ÒÛaċ„ó™ŹĖƒèÈÈl¼k¤ÝX@`ސŏ¼Æō¼ÇçĉKUÝÝ£ğ¤@¦ġl¯Òġĉ¯óš™móxÝÞğVšƴċK@—b@ܘ„UÒ¯ÈĢÜ@²˜x—Ŏl¤"],encodeOffsets:[[92363,29672]]}},{type:"Feature",id:"5401",properties:{name:"拉萨市",cp:[91.1865,30.1465],childNum:8},geometry:{type:"Polygon",coordinates:["@@Ŏ²l@°‚XĢƐlôŤLX¦°¤ĊnČ¼ÇĊŎͪÞÈ܃„x„U°Ýޙ޼™¼lšČ™˜ŽÞK„Ǔ°óU¯Ģ±ǔÔV±ŤóX¯ÇmÑ˜wXī°@°ĕĸÞKÆĖĢÇ°bȂ™ÇŁUƒV¯wV™ó¥ƒVÅ£Ý@@±ÞwšÅ‚„È@ƒ¥nōťÿ¯Xۃɝ°ţ¯ÛVVÝ@ŹéķÝKȗůɛǕÿÛKóÈǫšǫUţèmҚn¯Æ°ÈU‚°b„š™¼UĢV°°V"],encodeOffsets:[[92059,30696]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/yun_nan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"5308",properties:{name:"普洱市",cp:[100.7446,23.4229],childNum:10},geometry:{type:"Polygon",coordinates:["@@U‚ô²‚a@Ž²²Ķ¥œV°šĶ²bl¤kVxl‚@œ°‚Ś²@˜„„y„@ô¦¯„@xƒxVxU„VššbVšÜm¼Ŏ„„ĢmºXXWÆ@ĀœšmŽmXU°ÅÒm¼Þx°w„@°‚XêĠ°»nV°U„l@k„@V±ôī@£‚ƒČŃÆ£„KÞý@¥‚k@y„a@—nWV„UVƒšwƒmƒ£Jƒknm@wmkn‚X„˜šX„¥mUUlUnbš¯°ŽnkƒVInlIUw°n™mk@@mlanXlanmšk@wVWUw™_@éĠašnmUaÜ£ƒmXƒ¥¯@@„óUmݯ¯ÞÝlKnxô£š»„»Ġ„J°aV„UÝÿV¥ÛbƒI@wmŽón¯yÛL@ƒWkŎmș`IWa¯K@¯mUnmaXm™bmak„¯ŽƒĢ™ÒÝm¯mV¯KÇb¯KۜWW™X@a™V™knċLUWV™kXóW@k™a@ƒób¯Uƒwmb¥UUlaU¥U£maķšƒKXkƒmÝ@kwmѯk±ċbUUVakaġ¦ƒƒkL@`ƒœ™a¯xƒm™Åƒ™LUWƒ@ċnŎUV°LkL@b°°@¤š²ƒ‚šnôôk„l°kè›ÒÈzV¤È„WôôƒnV@„ƒ¦@¼Ux"],encodeOffsets:[[101903,23637]]}},{type:"Feature",id:"5325",properties:{name:"红河哈尼族彝族自治州",cp:[103.0408,23.6041],childNum:13},geometry:{type:"Polygon",coordinates:["@@°°nÞôV@ƒ°@„¦WŽ„nÛ¤Vbmn™ğb@êš`VxUX@xš„ƏÞUnn˜WÞĸĢƒšÈ@ŽÇè@zÛÜWšÅêlš²„˜KnV¯ĖĊx@bk@@„°JÆ£Èbl„nnm°nlUkVUUwVm„Kn„‚nVŽÞxVLX¥laX@@xl@VzȎVmšk@b°šÈĸmŽV¦`W„XšƒbUb‚bX¼°x@ašVVkn@lþnXUlVxŤÅ„y‚IUƒka‚IŎĊ@lXx@b„z@‚ô„ƒ¥„_V@l‚n@„ôy@al_l`nmƒÈ»@kƒmXwWK™U¯»™a™Å@wƒmUÝKUa™UUƒ™wWƒ@w²»@kƃV£—mm£VKkÑV@@»nwƒ¥™ƒ@kƙnllIVlnLVakalknJšWmnaUaVÑVVލn¥m@ƒ„¯Uÿl™@™™™VçƒaXaV¯UyVLVkš@nJlšXLlŽkxlbla²Òl@nVJVkšx„KlkUaVķÝÑU@Åm¯@±™Uó°ğńķĠmU™Ñ@ǯ¯Å¼@nml@°¯¯`@w™£@¯Çƒk@ƒ»nmċ¯U»™I™Ž¯LÇĶÛn@bó°™U›šwmŽ¯„™Umǯa„™ƒ™ƒI@ykIƒVUŽ¯bƒIğŽƒ¼™¼ó¤mwkLÝÞ"],encodeOffsets:[[104243,23429]]}},{type:"Feature",id:"5326",properties:{name:"文山壮族苗族自治州",cp:[104.8865,23.5712],childNum:8},geometry:{type:"Polygon",coordinates:["@@šwô„š@²¯maUmôUÆxš@Xš˜bÞInlVUVw„JVaU„K°¥„xmÞXnlKlnna°@ĊČ„ÆwUmnkl@°ƒƒ£nyn@VV@Vak™ƒ@@kÞ݄bmx°Vnw°klÞInĖÞVlKl™@Xa°„„KlV„U@šJnx‚U@ÈĢbUKlm@ak_‚wšanWUk°ƒl»„k@Wk@lwU_ƒ@UalóU¥ƒÇnƒ™kJWƒ@mVXx±bƒK@nV±a@™Åa™£ÝK²ƒWknamKknǏk¯ƒaV™™V¯ĀƒU™„™Ò¥ƒI@mm¯¯xōW@@`k@ó»ƒUU¯lm£ÅWlĵ„w@mmwÅmWU@y±U—xmwU„¯Uƒ¥Ý¥¯£m@kŽÇVUV°VbklƒL™wUlUIm‚k@±ÑkbkalwkWKk™mI™@UlUKVzU°Wb„bU蚚@škšVĀƒ°@„n‚m¦ÝŽUUUÒVbmbXn™‚mIkllbUbmKUkkJmkŚ@lš„„¦mx@¼U@lÒULn¤˜nU¤Å„@l±¼@xX„šxV„šVVbÞLVŽ„n@xšÆšb°¼šV"],encodeOffsets:[[106504,25037]]}},{type:"Feature",id:"5303",properties:{name:"曲靖市",cp:[103.9417,25.7025],childNum:9},geometry:{type:"Polygon",coordinates:["@@ȦlKÞĕUV¯Um¯„ÇVUnVVUƒĉn™ĊÇƾLn°°È„JÆw„@lbÞa„¦V„XJ°¯W¯„aÞJVkUša„ƒ@lKnÅmWUk¯a¯»@m±@уkkbWWX_WÓU»_l™kÑm@U»m@l@IWċn¯l@VanV„UV™UVwVx„KȄVmUē‚@„ƒn@VÝÆL„w„VVwnVlmkUVÑÇ°ka@k™ÿÝaÞUl£™›—ċĕX±±ĉƒa@UnVnalónk@wl™UVmkÝJ—aW™™@ÅwóVVnnb±°™@óƒ™xXLWx„n@lǼn„m‚k_k`@bózƒ‚m@kU@ƒ`„¦óƒ@nWš@ÜÅXWw@ƒyƒb¦@ÒlnUb@x™lܐk‚@²Ç@Uƒ¯bmy@kV@bƒb„¦U`lLVx@b—Ll¼Þ¤@„°VVބU@WސUb›J@nnš@lnnm„šxUŽƒUUbƒK@šÇwklkUƒVWakn@ŽlbU@@„ULVxkKUn‚°¯Ò@¼™„kmƒ¦m@kl™Ȱ@lU„l¦„@Vl°wšnnþĊUÆbUx™b„ŽV„šĖU°„a‚nnašV„al@@b"],encodeOffsets:[[106099,27653]]}},{type:"Feature",id:"5323",properties:{name:"楚雄彝族自治州",cp:[101.6016,25.3619],childNum:10},geometry:{type:"Polygon",coordinates:["@@mҁXU`Wnšš™@Xl±¦š„Uxnbl°knmKUx„„ƒxVôUx°¼ôÒȄ°JlnÞKĠœW°¦ƒ„Vx²JVwš_°¥@UV@@wnymknK¯I@‚™²b°ƒš£V¥šwU‚V„¤nLškÆJÈwôô°„l»Č¯ƒġVƒUU@@ƒ°ƒƒÝXl@U»°Å„@U„¯@w±¯VmUUlm@m™„ÑnIVyUwmak£Vwm±—@Çw@nƒ@UxkwlÇnL‚mkř@±Žk™ka@kóJV¯Ç»U£lw¯™Xalbl¥¯UXƒ@a˜™UaÈL@ÇVIVƒkaU¯mm™akLWkUJ¯Umxnšƒ@ƒkUx¯xƒ„mWÅīÝkkbƒŤƒbkxWmXwWk¯wƒKkƒƒLŤċń„@¤óĬU²ƒ@@lƒk¯VmU¯¼@xV@k°l°kbUš°nm‚VnUš@°„š„UVèރÆbUÒÞnU¦›V—¼lô„@Vl"],encodeOffsets:[[103433,26196]]}},{type:"Feature",id:"5329",properties:{name:"大理白族自治州",cp:[99.9536,25.6805],childNum:12},geometry:{type:"Polygon",coordinates:["@@lbœKVIUa˜@²m@b™xôÒÜxXLmbnšl@š„„K°šš¼k„Uô‚xôlV¦nJ„Uš™Ænšm„@šx„ÆwšbXšÆôô„LUVwôK@wlmšaVwœ@WknmƒIUmlnJla@_™@kÝmKUašÑm¯Xw°aUaVl»²JV„bÆJkôĶĀ²VVk„mšbVwUó„wƒƒVwnLlmk¯maVw™ƒ²¥Wkš@™™XmV_‚WnÑUkƒ@k󘻜UV¥ÝmVÑÅa݄UçƒVƒ™@¯V™Umn¯mV™lak¯l¯U@@wğŽW鯁ƒ@¯xÝw¯š¯Jċa¯U¥mLU¤„bÞȤƒbÇLWUwmIUVW¼kbš`U„Vb¯L±ĊÛkƒÿÝKkwƒKţê™UĉþƒÈƒV¯ÞVbUŽ°KVšk²Ý‚mI—ƒmV@kƒm™UkšVxm„¯KXÈķJU¦V°ULWxšL@môƒšb@bkx±LnVUŽVLnkÜWnwlLŃmW@kkJU_ƒV„šWĊ„Þ"],encodeOffsets:[[101408,26770]]}},{type:"Feature",id:"5309",properties:{name:"临沧市",cp:[99.613,24.0546],childNum:8},geometry:{type:"Polygon",coordinates:["@@‚xĢ„l`²X°ŽV„šx@x°Þ°KXašğUњW‚bnIl`X²°b„xl°„„šV@xVxk¦mb„l@xšXV‚ÆzX¤™Æ˜k°„kx@lźêlaX»VUnJVx‚XÈK„aÝȣƒaV£nKV¦°‚Čb°I°™n»ÆÑV¯nWn›™@ÿXÅWWn¹ƒġōƒn»‚ÛU™™aU™VƒUw„w@w°ƒó¥ƒ@ƒz—ƒ±@ř›¯@kUwlk£±aĵŽ¯™›Uĵ¦±±@bó±VÝ@ó¤ƒw¯I@mńóm±XŽ¯IólƒK@š°Ullb™zkKlln@@ԙºƒUmVk²ôҙx™ŎUVóLƒb„ŽmÈnŽmbnl‚a„x@z„@Ǝ„¦kš"],encodeOffsets:[[101251,24734]]}},{type:"Feature",id:"5334",properties:{name:"迪庆藏族自治州",cp:[99.4592,27.9327],childNum:3},geometry:{type:"Polygon",coordinates:["@@W™Xwƒ™@akk@y›—k°īX¥›Uóķ¯w@n»UaVaUۃ¯ƒmV¼k‚™Þċô@n¯xÛÒm„V‚¯Ô@xƒ‚@šk™wm™Åa@ƒUa‚݁¯VŃyV„a@ÿšn»ÝVmank™mmÞÅôƒ@n£±›ğzÇmU¦™Vm„nÜmbn@°nV@xmzÅ@mºV¦k°ln¤š¼õô„n@xkƃIUxUš@Ťƒ¦VšmVkmkXW¤XzVx@ƚx™¼ƒÞ¯b@lVš™ĸގV„m¼XŽm¦V„ŽÞ@Ǝš¹Vón¥ÆKn„‚KX¯x@èĊȱłXšaÆxnlV@UÛlȻkğV¥„m²ljmÅÞĕƒƛm°„ÆmX¤mznƃŽV¦ÞVVb°bnÞWbnŽ°l@V„È@„‚VĵĊ±@ó„InxÆw„¥@£Þ›W¯ĸ£UƒUK‚ƒk±akkkbmWmÈķ„aÆÇU—ȃÆW@wmknmU¯"],encodeOffsets:[[102702,28401]]}},{type:"Feature",id:"5306",properties:{name:"昭通市",cp:[104.0955,27.6031],childNum:11},geometry:{type:"Polygon",coordinates:["@@mƒnK@wmƒUř¥mšóXǓŏmX@Ž—VƒmL@xţ™nk@mlUšŻÒğŋ@ƒL@mmLkm™š@b™XŎW¼ka¯lÇŹ¯aÇ»™ÝÝ_@m„@@a™@UklwUm@ak@ƒb™UmbmƒbV¯™ĕUƒƒšaVwÅaĉVmý™m¯xUkƒ@k¥VƒUXƒ¤VÈm`@„—ńÇÜ@Ākn‚ĔkƞÆĠ„™Þš‚U„VôƆÞI@ŽUxƦn„l@ĊĊnxUÒ°¦Vb¯WUnWŽIml@xn„Ubô¤‚¼ÈxlI„»šKVš„@ÈԂJkšUĖ±ÆVb@nœ„VÜVUVƒšL„wĠl„kn„Ġ@nx°¥Æ„²mUwƒ@m™mÅUl¯UњÑUm„Lll„Il±š@VkwƒW@w°@U»™kUóI°ƒ„»ĢтL„™š`nUĠ²lm„bôV@n„JUxƦX¦l@š‚ŎUƒV„@lV„KVřV£UaÞU™ƒnW@¯VU@ó™"],encodeOffsets:[[107787,28244]]}},{type:"Feature",id:"5301",properties:{name:"昆明市",cp:[102.9199,25.4663],childNum:11},geometry:{type:"Polygon",coordinates:["@@n@Vk‚VUn²°@xƒ°Vƒ@¯ÆV¼k@WŽ„Þ¯„@„@‚VVU„„Ģċ°k¼V„Ċxœ¤Ōœx°mVkƒÑȏšL‚°„x°Xœ°VmĊLVxUĖ°bX¦VW@kšȯlkn@„¥lnšƒ@»°Ñ¯VmlLUwVK@ƒV@ka@lmXb„UlVlkÈx@™„LVa„VV™wnƒmm@km™@mœIVaݏ@XƒVUݯU@ƒÝ£k»˜K@aUwkKV_ƒ¥„a@alU@nz°aV„È@@±lÛšk@wVakm@т¥„a„z‚@XxÆW@ÛX™@m@ƒy@aWw@kōĉJlbV„JƒzţÆUwVkmWkým@Ul™U@b¯wVºƒU™VUêšĠƒXUaUbVĊUŽWXUmkK™™WnUUU™V™ƒƒVV™Ý@kk±‚™¯ƒƒLkƒš±WkXlVklƒ@ƒwXbmLƒ›VUIVmk@Ubma@kkaVKUƒ™kmlXLWn™J¯ÒĊ°@zkºlLUŤn@@n›ô@lƁnmKkÈlxVw„@@mÈx˜@n²Uxl¤nbVxUzmJƒÒnš"],encodeOffsets:[[104828,25999]]}},{type:"Feature",id:"5307",properties:{name:"丽江市",cp:[100.448,26.955],childNum:5},geometry:{type:"Polygon",coordinates:["@@l@™„@w°ÓUnƒÜÑ°w@mČóšÝlU»n°„„VÜUbVbm¼@Ž°xôĸœVW¦¯Ĭlœ˜@zll@b„šWxXš‚a„X@ÆĠÆaXwl@XaƦn¼˜Jn@mnKW¯È»V¯°ak™VanXVwl@VyUĕVU„bÈīlaUk°ƒk¯lƒ²V˜Ukƛô@ƒ„I@mVwĊa„™ƒVaka„™ÆbUŽVLšaXIWKUw™ƒ„aWÑÅKUaVk°ƒ@Uw„ƒ¯¥›XğÝLkm¯Iǃóѯ»™aƒnUl±UĵÿlóÅIƒaU‚±Ik¼UŽVb¯bWxn°™ÒVbnLlޚ@@`kbmIkŽVn„JmnXl›@Ux™bkn@xóLUxVŽƒKóóŐW™™aÅxƒŽ™wƒ@™nÅm™šƒV™„ƒôX„ƒLlVU¤ƒb¦m¼™Ž@ĀƒbU‚„zUƂ°ÞVb@„Æbnššx"],encodeOffsets:[[101937,28227]]}},{type:"Feature",id:"5328",properties:{name:"西双版纳傣族自治州",cp:[100.8984,21.8628],childNum:3},geometry:{type:"Polygon",coordinates:["@@l²°ŽnÒlxÞ@„nWl„Lĸ™nbV¤V¦kbVV‚¦na„x°Vôa@„šb@lôXlWUšVXČKlmššU@bšWXXܛ°LÈa°LnU°‚ÞnšÑ„ġ°lƒnbšaƒ¯¯KWƒœó@kmK@UšĉV@k°„VV¹„a@y‚_ċl_nÓlL@anI@ƒóWl£VU—ƒl™kĕl™šKVw„U@™kVƒam¯ÅL@bƒ‚Ýk@Vn„UbÇbÝwÅ@ċ¥¯lk‚¼ÅŽ™Ò°b@¦nlUn@ŽÇV„mƁbWôU@ÝÅōm™¯ƒaU™™mk™WWw—@±ƒ™n¯U™è™a™Lƒ¯mƒL™škwƒl@°mnÈÒ¯šów@V™xƒĀU¤°Įƒ°Xl"],encodeOffsets:[[102376,22579]]}},{type:"Feature",id:"5305",properties:{name:"保山市",cp:[99.0637,24.9884],childNum:5},geometry:{type:"Polygon",coordinates:["@@X°„Il‚@¦ƒŽÈ¼m¼ÞaÞÅl„ÈxV¼šlVôÈÆlLޣȺlkUƒ‚ƒUw„¯UĕVwĊ@n¦mlnVĸIWÇ°LnƒUwl™šV„n@lnU˜„nJށl±U™¯LVUa°Ý„U„ÇĊýšVŤé„LlxÞL„ĀÜl²ĉ°KUaVƒ™_Źé@klw¯ƒlÅ—šW£ÅyU™W@wƒknal¥Uw@w™Uƒƒk¯ƒw¯aW±k_mJa™XVҙĠWb¯L¯Ý@w™wUƒ¯±Wk_ġƒwƒwōKmb@¤„bk°lĖƒô„UJƒšVnÅlťUš¯°VbnbWxX„m„ÞššWUĀ™L™yWzÛKmbUxVKkn݃kŽVšĀċ¤Ux„@Ž¯Žm@ƒ¦"],encodeOffsets:[[100440,25943]]}},{type:"Feature",id:"5304",properties:{name:"玉溪市",cp:[101.9312,23.8898],childNum:9},geometry:{type:"Polygon",coordinates:["@@l„„L°xXlWxXnlw„a„ţlaÞlÆĬnX„ƒ°wVw„l„@m™nw°VVIXllKšbnnV°lbU„UJ@ÈÇKVb—š@bW„°Vk¦kaWb°škxV¤È¼U°ôI@llblš²š@‚@œó@mm@VţkKl¹@yĉ¯°ÑšIXmWKnkšlV„ULlb@lnbVal@UnVJœU‚„nKWa„x„@lkkUlW²X„™‚l„K°„šl²@lšÞUŽ„U‚„UšVšVVXmššlLVnXWVUĉVaVb„W™ğVéšU„VU¹W»aVa„aW™Xƒ‚_U¥nÇķ¯™@a™lUnǍUyk@@wW@kbW¦UKÝwUmmƒƒLUnVxUVVlk¯mmnƒmkÇaŤ¯I@ƒl@@aĉw°ĕmU—L±ƒk™ÆéX™ÜÛ@yÈç@™Çġ„Ýķ—XmmÝVՙƒ™lmnkbmWkb@nl@nŽmš¯VxkJmUJ„ml¯™°makVVnVƒ¦™Wƒ—Wmnl@xmn„l‚I„¤„n™xU„ƒVUŽmX@˜ƒb@zl@¦Ýþ"],encodeOffsets:[[103703,24874]]}},{type:"Feature",id:"5333",properties:{name:"怒江傈僳族自治州",cp:[99.1516,26.5594],childNum:4},geometry:{type:"Polygon",coordinates:["@@WyX£lWlnnUU™„¥@ţV™Vw„JlÅ@wƒmö󙻂£kml¯U¥n¹Æ@ny@wmU@¯mnamÛnƒšUV¥ÈnĠy²œm¤„@ÆónݚnmlnbÞU‚¥„aV£kU„KWƒ„óšƒmIU¥ókwVólƒ™»¯™ƒL™ƒk@m™naWKÛwóњw@a±n—@VbUJ›LkaƒÝXĉƒ™„UV`lI@lnXÆƑkKmxÛXmlUKVmU²Klw@a™aó„@n™KXwVKU¯V¥mUnkm¥ĉ@UxVĖƒ°Vx„V„klmޙkKWĀkVWšnl°Lnm@°ŽUxlV@nk¦™JVÈ°ŽVÒ@nX°@ÆlUômlnôƒ²nxmłnVV„¯x@Èm°XblVUšl°@xkXU¤WXX‚W„Xƃ„mkÅJmށw±bƒxUīkKmÅVUĖÝèV„kx@š›lX„lnk¤ƒLkŽ‚Ėk¦‚xUššL°‚¯Ė@LnK@b°xVI„¥Ua°Ñ@»nm@¹‚KŎÞÈWln²n"],encodeOffsets:[[101071,28891]]}},{type:"Feature",id:"5331",properties:{name:"德宏傣族景颇族自治州",cp:[98.1299,24.5874],childNum:5},geometry:{type:"Polygon",coordinates:["@@„¥n@°@ƒVwČ£™ÿUlÞ„lmULVwnaÜLXyšzšKVÿ™XݙnƒWƒXwmaUa°¯V™ŦŽÆkUm„™VIƒ„ókĕl¯ƒa@£nama™@¯m¯œó@óyţbġkÅm±ÛammVkƒLwU`Wk@VƒkUmŃlUUKmbkkUVUwƒ¦óŽ°¼šbn°ô¦lºƒz@xšŽ¯„™@UŽ°nƒšU¤ţU„°VƆ@ÈmlnzÞl°¦Æa„xUxƒLkxWƒn@‚š²ŰšW„™‚@°ÈXl°Llx"],encodeOffsets:[[100440,25943]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/zhe_jiang_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3311",properties:{name:"丽水市",cp:[119.5642,28.1854],childNum:9},geometry:{type:"Polygon",coordinates:["@@@V‚bVl@Xn‚UXƒKVŽ@¦nxlUXV‚n„KVmnL‚UV@bn¤lLXK˜²„`nnlJXIVJ‚I„Vnn°KnnVll@VLXWV@UkVaVK„zV@„ƒšVVaUK@U»VUl@@WnUUƒ@wVLn@Vwl@XW°LVbn@VU‚@X„l`@XnKVbkl@XVJlUnlV„„xlL@lnXl„@VšUnV°°„@a„UVLXblWVXn@VVUV@Lš¤VLV„U‚VbnalLUUVX_laVa„WVzXKV@@a@KUmImmXama@kU@yVIUK‚aVa@kXK@aWU@VIUmW@kkVm„Uš@VwUa@K@k@Uƒ`@kUKVk@UV@VaUm²Vy@klUUWUkVmUa@_ƒKVaXa›XmƒU@mUlWkaUXƒ@mmkL@w™JƒnVVÅbWKXa™@@I@aƒJUUÇ@V„UL™W@akLmb@K@a™XXw@mƒVmUVkUy@£@aU@@VkUWm@kUKƒXUWU_mW@wkkmJUUkLWWUXƒW@IkJ@k@mW_kӃ_Ul™Lƒm@I@aUa¯m@kƒa¯LUJƒ@mVVxUb™a@LUKkXƒbm@Uak@@a@Um`ƒIUbUJ@nUVW@@LnVV@lšUbVlUX@`š@blXklW„Ušm„Xlm¦U@@V¯bml@š@nUb@llnn@VbX@lV@ŽUVULmU@JVn„bVbkb™VWxU@@nUVk@"],encodeOffsets:[[121546,28992]]}},{type:"Feature",id:"3301",properties:{name:"杭州市",cp:[119.5313,29.8773],childNum:6},geometry:{type:"Polygon",coordinates:["@@X@l„°KXXlW„b@²„`šššb‚I„šX`l@„@bWl@n@VnLUV@V„@°¦@šl@XVlU@š@xVbUb@Vkb@‚@XVJVz™J@Lޚ@VmLUxUJ@LU„Vx‚b„xXUl@VaÈw„b‚aÞa@Vl@XUVx@V@V„LlbnV„al@lb„Vnn‚LnKnL@VlbVJXalIšb@KUU@mVInJ˜„U„Vl@xUšVLnUš@UÞaV@lkV@UanK„L@UlKVUnbÆmn@@nUlVnVJl@@UXU„L@WVIVJVxVLXV@IÜKnbn@V¥V@@I@ƒƒ„y°b@UUwnk°ÆƨVlUšçXm›£aƒÇ™IkVƒ@WV@@aWIUWUIkb@WW@UnƒK@UU@kaWVkƒVIVVnU@UWVUV@VmVkKkWIkVWaULU`UImJUImm—U@ƒƒwmwUV™IUWVkUamaU@mV—kƒb@KVU@aVU@anKULVJ‚U@kÛU™JUV›kkƒVakU@ƒaVwkW@UWkXmWaULUaUK@XƒJUUmƒVU@UVƒUkJ@ImwmKU@k„@lU„W@@akKm„kamIkWl_UwVm@UkaVUUaƒ@UamakbWlkL@aUalU@mkL@U@U™lmK@XkKm@Ýakb@xƒnXbƒ`ƒnUUU@›™U@™wU@@ƒmKkkƒV¯U@lULUbVbUb@V‚a@L™ºÝb@bLmK™x@VUL@bk@mxULWl"],encodeOffsets:[[121185,30184]]}},{type:"Feature",id:"3303",properties:{name:"温州市",cp:[120.498,27.8119],childNum:9},geometry:{type:"Polygon",coordinates:["@@ll@xnXV`VX„WVL@lXnlV@UV@@b@¤VzUlnV„U@nWxšW@b@LnalK@bšXVKUƒÈ@VV„I@b@Jš@WbXLÆaUU„mšI@xlKnn„@VWlbkXV‚@n„VWnœ‚WbUb„L@`VbUnVlVXkV@lUz±‚VnUbU@@VUlVL@l„_@V@l@LVbV@XLV`VÈlxn@lU@aœaVV‚k„@XJ@nl@@LU`°LVb„L°a@a„UVy@anI@a„a‚nV@²wÜJX@VšVV°k„na@WVk„aWwU@m@™ƒkƒaUĕ™ÝšÝŤnÈa„aóI›»@±X™WkUķ@kV±kw™ƒUkWw„™UƒÝ»ÛkɳlImaUaWóXÿǬk‚UnWVmmk™KţnŏÞğl™„UlUx@XWb„V@JkXƒ°mb@VULVxUVk@@LWWk@WIkšƒUkJmUkVmI@yƒ@Ua™kLm‚U@mUUUkaVk™@mK@UlUU@UmKmbUUUJ@n@KVLUL@VkJWXX`mnULWlkL@JVLVb@°kxkU@LVŽ™V@„VLV`UL@VUX"],encodeOffsets:[[122502,28334]]}},{type:"Feature",id:"3302",properties:{name:"宁波市",cp:[121.5967,29.6466],childNum:6},geometry:{type:"Polygon",coordinates:["@@Ċ¦ĸĀ°‚nXÞVšKškƨƑźÿ°»n„@wô¥ÜbœU°ÆXÞWóçĉݱIUƒÈ¥@U°wÆ»²mm_@aXƒVKÞVlk@akk›̅@£X»VwƏXWa¯aȗb™KƽۃĊ™xƒLóŽk@ƒƒƒ@¯nƒKUL@xkL›ÑkWULUUmJUXVŽU@mŽUX¯@V`mbXbV@@nn¤WXšx@škJ@nVVUVl²UbÝVUVk@Wx@V@„ƒVXzmlaƒL@VlLU`„XUVVVUnl@VbnJlnUVVnƒlUKkbmnn„VxlJnxmbU@UL@KUV™X@xmb@lk@mnVVUš™è"],encodeOffsets:[[123784,30977]]}},{type:"Feature",id:"3309",properties:{name:"舟山市",cp:[122.2559,30.2234],childNum:3},geometry:{type:"Polygon",coordinates:["@@l΢ƒʠþÆVĢLĊƒǬXĊ܄XôV„ÑÆw„ƒlšƏÈóVĭVǓ@ƒĉwɛkmK@ĉXīWaĉUĵÝmƒ¯ĉƒwĉ±±nż¯x@VǦV„²JĊÞôèÝXÅW¯›VÛaó¦@xƒŽmŽ¯¼ŹĀ"],encodeOffsets:[[124437,30983]]}},{type:"Feature",id:"3310",properties:{name:"台州市",cp:[121.1353,28.6688],childNum:7},geometry:{type:"Polygon",coordinates:["@@lV„IVWVz@bXJl@Xal@°„nLll@nVxnV„K@UJVbƒ¦°„k`UIWJXnƚ@bUJ„Xl@lb„Wn@UzVV@bVVšmVnnJVXna‚bšKUKnUVVUnVLlKVLXa„Jm£@mU@WanaU_°@VWnV@UVWnIVVVKlXœÒlK@wVK„L°m„@„„l@ô„Kšw„ĉƾůUƒl£@»UƒVk„m@ƅUƒƒaÛIŏmUk@m„w@a™£ƒWk@ţšƒIm±@ankôUlaU™Uw¯ƒōaƒbÇbţm™ÞšÞVĖ„b„l@š@n‚VXxƒbUl@XmbƒŽ¯lUUU™W@ÛI±xU@mƒb@bmJ@bUzƒV@b¯bƒKUa¯KV_@Kk@@mWIƒ@lUU›b@bkVm@kwUÇU_WKU@Ux™@ƒVUnllX@Vn‚J@UXV@bWL@lUbbVLUJ@z‚V@lnbWbnnnJVŽ@L"],encodeOffsets:[[123312,29526]]}},{type:"Feature",id:"3307",properties:{name:"金华市",cp:[120.0037,29.1028],childNum:8},geometry:{type:"Polygon",coordinates:["@@nbVb„@VbUVlb@VUnVxk`lXnJlbnƒlL@bX@Vƒ@klƒV@nLnx@JlI„V‚U@VUVn„VV„I@WVLVbVKXbWnXl@VlXUx„b@ŽlVUbl„œlVUšIÜVnalKX@@bV@@aUUlUƒwUw„@naWW„UVaUUšaVb„LlxXJVk°ƒUƒlkU¥@k„a@LVlXLVlšVWznVn@lxšJl_@WX_@mVa„a@alU@kVVna„KVLlK„b@UUaVašbnUWmXU@k@yVI@ařWmXIVJl_¯ƒ„¥UaVI@ƒLmUUw@mkkmK¯ƒk@Wbk@WI@aUyUXƒJkU@bU@WLUyƒXUbkbW`UVVkKmbUaVUƒUK™£@KVUUUm@UWkXWaUKƒV@b¯ƒ¯mU™V@UkƒmW@kkKƒwUƒmkkVUI@WlkUamL@Wk_Wƒ@UVm@Ua¯KWXk@Uxm@UK@xV„mV@Xk@UVV¼@‚VLUb™Uƒ„U@ƒyULUbVlU@@XlVUVVbƒU@lXXVW@XUVl@@VUVƒÈn@VVU„@lVa@„U„mL@`X@`WL@VUX@lUL@xlx"],encodeOffsets:[[122119,29948]]}},{type:"Feature",id:"3308",properties:{name:"衢州市",cp:[118.6853,28.8666],childNum:5},geometry:{type:"Polygon",coordinates:["@@XkVKnwl@@aVK@UšwnL‚K@aÞaš¹@Kb@UVaUaVaVK@k°V„UllnL@„V@šxV@œšV@VV„m„_Wa„m@wlaÞbn@lL@WnLšk@V@VlK@nkVVb@blKXklakw@wVK@kVW@UXK@_‚W@_nKVƒ@ƒUb@kVƒUUm@„ÇVU@Uk@VU@WUXWW@k„VUaVUkU@WWXUKk@Ukmm¯LmmƒUJUIWJkImmƒ_—±WLkKm£@aVUmKUnƒLmWUkVmw@¥U„LVWm@WUka@UmmLmm@@bUX™@@WUIm@UVUK@UVUUU™VVJmb@b„Xn‚mVƒ¼nnn¦mJUVƒL„V@VW@UzUlVnUbl`UnVl@XU@kl@bmÈUx™Vk@@J@„ƒ¼W@ÅaVVnzmVƒ„@WJk@kWJ@ƒlXbWbXxmVnšlLXb@°lKVXnWšbWV„„X„mbV@Xl‚bšI@Kn@@x@šVLlm"],encodeOffsets:[[121185,30184]]}},{type:"Feature",id:"3306",properties:{name:"绍兴市",cp:[120.564,29.7565],childNum:6},geometry:{type:"Polygon",coordinates:["@@„x@„˜VnnVJnIVJV_VKXblUXJlŽlLUŽUnU@UVVX@ŽmVUUUJl„XUlbV@@V„LVmX@@XlaVJVXXJ@b‚@XU„@lUšJ„È‚bœ¤Ō„JšçV™UUnml@@kna@wšWVU@LVKV@namwkIUwmƒnmlaVL„kUmVUkmmIUak@VmUUVUƒWV_kK@U„K‚bnkWy„U@ƒ@UXwl@VUÞUVak±VUUU@mlI@™™wXWƒIWbUKkLUKVmUUmVVL™LambUWmIUm™nUU@aUUVym@ƒXkak@ƒW@z@lWVXnmV™aUbVb@VƒakLUKƒLmbUU@lkV@bƒbUb@nW`@Xk`™Ikwm@mUXy™UUkWKUk@Kƒb@lV¦klV„¯„UlWIkwƒKUa™bVVUbƒVXXmbƒ@Vx„xkVVV@bU@@aW@kLmb@lVUIVKmL@bUV@bUV@L„a˜lnUV@nbVbUlVXšJVUnx"],encodeOffsets:[[122997,30561]]}},{type:"Feature",id:"3304",properties:{name:"嘉兴市",cp:[120.9155,30.6354],childNum:6},geometry:{type:"Polygon",coordinates:["@@@blIX@@VÜVUnn@l‚k„lKnI°Þl`²LVKVbnbVaVLUVn@W¦@VkVVb„@VI„`@blLnL‚aX@„VVb@U‚@XlVa„@@kVaUKV»U_lWXUƒƒ@alb„k@VllnLVKn@@UVIUw@y°IVVXU@VV@lw„m@wVkƾaœJ‚LkΡƧƒ™l™LÝUmW¯ķÿĉ¥ƒIŋŽWn™èkVƧU¯ÅmlVx@V¯aƒz„Ž@„@JU@U¦m@@šnVmn@V„LV‚"],encodeOffsets:[[123233,31382]]}},{type:"Feature",id:"3305",properties:{name:"湖州市",cp:[119.8608,30.7782],childNum:4},geometry:{type:"Polygon",coordinates:["@@kLlƒkm@VmÛU@UW@kJ@aUƒK@UnmmU@™maÛL@JWUUKUwUIUJ@XƒKWV@Vk@UIUmVk@mm@ÅnmaUVkL@VƒKmLVbU@klU@ÝbV™@mVUKV™@wUkVƒ—ƒmIUJ@nVV@L™akJWbUIka@UmKmLKmmƒUUVk@@nmLX`WXUV@Ž@nUl™kmlU@Ub„„ƒxVVšIlV„Žšnn„@@n˜„UҚ@„°n@@xmb@„VbnV@šš„@b@`@L@L@x@blVklVbnnV@‚aXb°VlU@W„b°U„LXWVUV™„™VwÈwÜ»ĸaĠnUVw²X@V@lVU@wlaUUVm@knUV›"],encodeOffsets:[[123379,31500]]}}],UTF8Encoding:!0}}),n("echarts/chart/gauge",["require","./base","../util/shape/GaugePointer","zrender/shape/Text","zrender/shape/Line","zrender/shape/Rectangle","zrender/shape/Circle","zrender/shape/Sector","../config","../util/ecData","../util/accMath","zrender/tool/util","../chart"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o),this.refresh(a)}var n=e("./base"),i=e("../util/shape/GaugePointer"),a=e("zrender/shape/Text"),o=e("zrender/shape/Line"),r=e("zrender/shape/Rectangle"),s=e("zrender/shape/Circle"),l=e("zrender/shape/Sector"),h=e("../config");h.gauge={zlevel:0,z:2,center:["50%","50%"],clickable:!0,legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,min:0,max:100,precision:0,splitNumber:10,axisLine:{show:!0,lineStyle:{color:[[.2,"#228b22"],[.8,"#48b"],[1,"#ff4500"]],width:30}},axisTick:{show:!0,splitNumber:5,length:8,lineStyle:{color:"#eee",width:1,type:"solid"}},axisLabel:{show:!0,textStyle:{color:"auto"}},splitLine:{show:!0,length:30,lineStyle:{color:"#eee",width:2,type:"solid"}},pointer:{show:!0,length:"80%",width:8,color:"auto"},title:{show:!0,offsetCenter:[0,"-40%"],textStyle:{color:"#333",fontSize:15}},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:40,offsetCenter:[0,"40%"],textStyle:{color:"auto",fontSize:30}}};var m=e("../util/ecData"),V=e("../util/accMath"),U=e("zrender/tool/util");return t.prototype={type:h.CHART_TYPE_GAUGE,_buildShape:function(){var e=this.series;this._paramsMap={};for(var t=0,n=e.length;n>t;t++)e[t].type===h.CHART_TYPE_GAUGE&&(e[t]=this.reformOption(e[t]),this.legendHoverLink=e[t].legendHoverLink||this.legendHoverLink,this._buildSingleGauge(t),this.buildMark(t));this.addShapeList()},_buildSingleGauge:function(e){var t=this.series[e];this._paramsMap[e]={center:this.parseCenter(this.zr,t.center),radius:this.parseRadius(this.zr,t.radius),startAngle:t.startAngle.toFixed(2)-0,endAngle:t.endAngle.toFixed(2)-0},this._paramsMap[e].totalAngle=this._paramsMap[e].startAngle-this._paramsMap[e].endAngle,this._colorMap(e),this._buildAxisLine(e),this._buildSplitLine(e),this._buildAxisTick(e),this._buildAxisLabel(e),this._buildPointer(e),this._buildTitle(e),this._buildDetail(e)},_buildAxisLine:function(e){var t=this.series[e];if(t.axisLine.show)for(var n,i,a=t.min,o=t.max-a,r=this._paramsMap[e],s=r.center,l=r.startAngle,h=r.totalAngle,V=r.colorArray,U=t.axisLine.lineStyle,d=this.parsePercent(U.width,r.radius[1]),p=r.radius[1],c=p-d,u=l,y=0,g=V.length;g>y;y++)i=l-h*(V[y][0]-a)/o,n=this._getSector(s,c,p,i,u,V[y][1],U),u=i,n._animationAdd="r",m.set(n,"seriesIndex",e),m.set(n,"dataIndex",y),this.shapeList.push(n)},_buildSplitLine:function(e){var t=this.series[e];if(t.splitLine.show)for(var n,i,a,r=this._paramsMap[e],s=t.splitNumber,l=t.min,h=t.max-l,m=t.splitLine,V=this.parsePercent(m.length,r.radius[1]),U=m.lineStyle,d=U.color,p=r.center,c=r.startAngle*Math.PI/180,u=r.totalAngle*Math.PI/180,y=r.radius[1],g=y-V,b=0;s>=b;b++)n=c-u/s*b,i=Math.sin(n),a=Math.cos(n),this.shapeList.push(new o({zlevel:this.getZlevelBase(),z:this.getZBase()+1,hoverable:!1,style:{xStart:p[0]+a*y,yStart:p[1]-i*y,xEnd:p[0]+a*g,yEnd:p[1]-i*g,strokeColor:"auto"===d?this._getColor(e,l+h/s*b):d,lineType:U.type,lineWidth:U.width,shadowColor:U.shadowColor,shadowBlur:U.shadowBlur,shadowOffsetX:U.shadowOffsetX,shadowOffsetY:U.shadowOffsetY}}))},_buildAxisTick:function(e){var t=this.series[e];if(t.axisTick.show)for(var n,i,a,r=this._paramsMap[e],s=t.splitNumber,l=t.min,h=t.max-l,m=t.axisTick,V=m.splitNumber,U=this.parsePercent(m.length,r.radius[1]),d=m.lineStyle,p=d.color,c=r.center,u=r.startAngle*Math.PI/180,y=r.totalAngle*Math.PI/180,g=r.radius[1],b=g-U,f=0,k=s*V;k>=f;f++)f%V!==0&&(n=u-y/k*f,i=Math.sin(n),a=Math.cos(n),this.shapeList.push(new o({zlevel:this.getZlevelBase(),z:this.getZBase()+1,hoverable:!1,style:{xStart:c[0]+a*g,yStart:c[1]-i*g,xEnd:c[0]+a*b,yEnd:c[1]-i*b,strokeColor:"auto"===p?this._getColor(e,l+h/k*f):p,lineType:d.type,lineWidth:d.width,shadowColor:d.shadowColor,shadowBlur:d.shadowBlur,shadowOffsetX:d.shadowOffsetX,shadowOffsetY:d.shadowOffsetY}})))},_buildAxisLabel:function(e){var t=this.series[e];if(t.axisLabel.show)for(var n,i,o,r,s=t.splitNumber,l=t.min,h=t.max-l,m=t.axisLabel.textStyle,U=this.getFont(m),d=m.color,p=this._paramsMap[e],c=p.center,u=p.startAngle,y=p.totalAngle,g=p.radius[1]-this.parsePercent(t.splitLine.length,p.radius[1])-5,b=0;s>=b;b++)r=V.accAdd(l,V.accMul(V.accDiv(h,s),b)),n=u-y/s*b,i=Math.sin(n*Math.PI/180),o=Math.cos(n*Math.PI/180),n=(n+360)%360,this.shapeList.push(new a({zlevel:this.getZlevelBase(),z:this.getZBase()+1,hoverable:!1,style:{x:c[0]+o*g,y:c[1]-i*g,color:"auto"===d?this._getColor(e,r):d,text:this._getLabelText(t.axisLabel.formatter,r),textAlign:n>=110&&250>=n?"left":70>=n||n>=290?"right":"center",textBaseline:n>=10&&170>=n?"top":n>=190&&350>=n?"bottom":"middle",textFont:U,shadowColor:m.shadowColor,shadowBlur:m.shadowBlur,shadowOffsetX:m.shadowOffsetX,shadowOffsetY:m.shadowOffsetY}})) +},_buildPointer:function(e){var t=this.series[e];if(t.pointer.show){var n=t.max-t.min,a=t.pointer,o=this._paramsMap[e],r=this.parsePercent(a.length,o.radius[1]),l=this.parsePercent(a.width,o.radius[1]),h=o.center,V=this._getValue(e);V=V2?2:l/2,color:"#fff"}});m.pack(p,this.series[e],e,this.series[e].data[0],0,this.series[e].data[0].name,V),this.shapeList.push(p),this.shapeList.push(new s({zlevel:this.getZlevelBase(),z:this.getZBase()+2,hoverable:!1,style:{x:h[0],y:h[1],r:a.width/2.5,color:"#fff"}}))}},_buildTitle:function(e){var t=this.series[e];if(t.title.show){var n=t.data[0],i=null!=n.name?n.name:"";if(""!==i){var o=t.title,r=o.offsetCenter,s=o.textStyle,l=s.color,h=this._paramsMap[e],m=h.center[0]+this.parsePercent(r[0],h.radius[1]),V=h.center[1]+this.parsePercent(r[1],h.radius[1]);this.shapeList.push(new a({zlevel:this.getZlevelBase(),z:this.getZBase()+(Math.abs(m-h.center[0])+Math.abs(V-h.center[1])<2*s.fontSize?2:1),hoverable:!1,style:{x:m,y:V,color:"auto"===l?this._getColor(e):l,text:i,textAlign:"center",textFont:this.getFont(s),shadowColor:s.shadowColor,shadowBlur:s.shadowBlur,shadowOffsetX:s.shadowOffsetX,shadowOffsetY:s.shadowOffsetY}}))}}},_buildDetail:function(e){var t=this.series[e];if(t.detail.show){var n=t.detail,i=n.offsetCenter,a=n.backgroundColor,o=n.textStyle,s=o.color,l=this._paramsMap[e],h=this._getValue(e),m=l.center[0]-n.width/2+this.parsePercent(i[0],l.radius[1]),V=l.center[1]+this.parsePercent(i[1],l.radius[1]);this.shapeList.push(new r({zlevel:this.getZlevelBase(),z:this.getZBase()+(Math.abs(m+n.width/2-l.center[0])+Math.abs(V+n.height/2-l.center[1])r;r++)o.push([a[r][0]*i+n,a[r][1]]);this._paramsMap[e].colorArray=o},_getColor:function(e,t){null==t&&(t=this._getValue(e));for(var n=this._paramsMap[e].colorArray,i=0,a=n.length;a>i;i++)if(n[i][0]>=t)return n[i][1];return n[n.length-1][1]},_getSector:function(e,t,n,i,a,o,r){return new l({zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:e[0],y:e[1],r0:t,r:n,startAngle:i,endAngle:a,brushType:"fill",color:o,shadowColor:r.shadowColor,shadowBlur:r.shadowBlur,shadowOffsetX:r.shadowOffsetX,shadowOffsetY:r.shadowOffsetY}})},_getLabelText:function(e,t){if(e){if("function"==typeof e)return e.call(this.myChart,t);if("string"==typeof e)return e.replace("{value}",t)}return t},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()}},U.inherits(t,n),e("../chart").define("gauge",t),t}),n("echarts/util/shape/GaugePointer",["require","zrender/shape/Base","zrender/tool/util","./normalIsCover"],function(e){function t(e){n.call(this,e)}var n=e("zrender/shape/Base"),i=e("zrender/tool/util");return t.prototype={type:"gauge-pointer",buildPath:function(e,t){var n=t.r,i=t.width,a=t.angle,o=t.x-Math.cos(a)*i*(i>=n/3?1:2),r=t.y+Math.sin(a)*i*(i>=n/3?1:2);a=t.angle-Math.PI/2,e.moveTo(o,r),e.lineTo(t.x+Math.cos(a)*i,t.y-Math.sin(a)*i),e.lineTo(t.x+Math.cos(t.angle)*n,t.y-Math.sin(t.angle)*n),e.lineTo(t.x-Math.cos(a)*i,t.y+Math.sin(a)*i),e.lineTo(o,r)},getRect:function(e){if(e.__rect)return e.__rect;var t=2*e.width,n=e.x,i=e.y,a=n+Math.cos(e.angle)*e.r,o=i-Math.sin(e.angle)*e.r;return e.__rect={x:Math.min(n,a)-t,y:Math.min(i,o)-t,width:Math.abs(n-a)+t,height:Math.abs(i-o)+t},e.__rect},isCover:e("./normalIsCover")},i.inherits(t,n),t}),n("echarts/chart/funnel",["require","./base","zrender/shape/Text","zrender/shape/Line","zrender/shape/Polygon","../config","../util/ecData","../util/number","zrender/tool/util","zrender/tool/color","zrender/tool/area","../chart"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o),this.refresh(a)}var n=e("./base"),i=e("zrender/shape/Text"),a=e("zrender/shape/Line"),o=e("zrender/shape/Polygon"),r=e("../config");r.funnel={zlevel:0,z:2,clickable:!0,legendHoverLink:!0,x:80,y:60,x2:80,y2:60,min:0,max:100,minSize:"0%",maxSize:"100%",sort:"descending",gap:0,funnelAlign:"center",itemStyle:{normal:{borderColor:"#fff",borderWidth:1,label:{show:!0,position:"outer"},labelLine:{show:!0,length:10,lineStyle:{width:1,type:"solid"}}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!0},labelLine:{show:!0}}}};var s=e("../util/ecData"),l=e("../util/number"),h=e("zrender/tool/util"),m=e("zrender/tool/color"),V=e("zrender/tool/area");return t.prototype={type:r.CHART_TYPE_FUNNEL,_buildShape:function(){var e=this.series,t=this.component.legend;this._paramsMap={},this._selected={},this.selectedMap={};for(var n,i=0,a=e.length;a>i;i++)if(e[i].type===r.CHART_TYPE_FUNNEL){if(e[i]=this.reformOption(e[i]),this.legendHoverLink=e[i].legendHoverLink||this.legendHoverLink,n=e[i].name||"",this.selectedMap[n]=t?t.isSelected(n):!0,!this.selectedMap[n])continue;this._buildSingleFunnel(i),this.buildMark(i)}this.addShapeList()},_buildSingleFunnel:function(e){var t=this.component.legend,n=this.series[e],i=this._mapData(e),a=this._getLocation(e);this._paramsMap[e]={location:a,data:i};for(var o,r=0,s=[],h=0,m=i.length;m>h;h++)o=i[h].name,this.selectedMap[o]=t?t.isSelected(o):!0,this.selectedMap[o]&&!isNaN(i[h].value)&&(s.push(i[h]),r++);if(0!==r){for(var V,U,d,p,c=this._buildFunnelCase(e),u=n.funnelAlign,y=n.gap,g=r>1?(a.height-(r-1)*y)/r:a.height,b=a.y,f="descending"===n.sort?this._getItemWidth(e,s[0].value):l.parsePercent(n.minSize,a.width),k="descending"===n.sort?1:0,x=a.centerX,_=[],h=0,m=s.length;m>h;h++)if(o=s[h].name,this.selectedMap[o]&&!isNaN(s[h].value)){switch(V=m-2>=h?this._getItemWidth(e,s[h+k].value):"descending"===n.sort?l.parsePercent(n.minSize,a.width):l.parsePercent(n.maxSize,a.width),u){case"left":U=a.x;break;case"right":U=a.x+a.width-f;break;default:U=x-f/2}d=this._buildItem(e,s[h]._index,t?t.getColor(o):this.zr.getColor(s[h]._index),U,b,f,V,g,u),b+=g+y,p=d.style.pointList,_.unshift([p[0][0]-10,p[0][1]]),_.push([p[1][0]+10,p[1][1]]),0===h&&(0===f?(p=_.pop(),"center"==u&&(_[0][0]+=10),"right"==u&&(_[0][0]=p[0]),_[0][1]-="center"==u?10:15,1==m&&(p=d.style.pointList)):(_[_.length-1][1]-=5,_[0][1]-=5)),f=V}c&&(_.unshift([p[3][0]-10,p[3][1]]),_.push([p[2][0]+10,p[2][1]]),0===f?(p=_.pop(),"center"==u&&(_[0][0]+=10),"right"==u&&(_[0][0]=p[0]),_[0][1]+="center"==u?10:15):(_[_.length-1][1]+=5,_[0][1]+=5),c.style.pointList=_)}},_buildFunnelCase:function(e){var t=this.series[e];if(this.deepQuery([t,this.option],"calculable")){var n=this._paramsMap[e].location,i=10,a={hoverable:!1,style:{pointListd:[[n.x-i,n.y-i],[n.x+n.width+i,n.y-i],[n.x+n.width+i,n.y+n.height+i],[n.x-i,n.y+n.height+i]],brushType:"stroke",lineWidth:1,strokeColor:t.calculableHolderColor||this.ecTheme.calculableHolderColor||r.calculableHolderColor}};return s.pack(a,t,e,void 0,-1),this.setCalculable(a),a=new o(a),this.shapeList.push(a),a}},_getLocation:function(e){var t=this.series[e],n=this.zr.getWidth(),i=this.zr.getHeight(),a=this.parsePercent(t.x,n),o=this.parsePercent(t.y,i),r=null==t.width?n-a-this.parsePercent(t.x2,n):this.parsePercent(t.width,n);return{x:a,y:o,width:r,height:null==t.height?i-o-this.parsePercent(t.y2,i):this.parsePercent(t.height,i),centerX:a+r/2}},_mapData:function(e){function t(e,t){return"-"===e.value?1:"-"===t.value?-1:t.value-e.value}function n(e,n){return-t(e,n)}for(var i=this.series[e],a=h.clone(i.data),o=0,r=a.length;r>o;o++)a[o]._index=o;return"none"!=i.sort&&a.sort("descending"===i.sort?t:n),a},_buildItem:function(e,t,n,i,a,o,r,l,h){var m=this.series,V=m[e],U=V.data[t],d=this.getPolygon(e,t,n,i,a,o,r,l,h);s.pack(d,m[e],e,m[e].data[t],t,m[e].data[t].name),this.shapeList.push(d);var p=this.getLabel(e,t,n,i,a,o,r,l,h);s.pack(p,m[e],e,m[e].data[t],t,m[e].data[t].name),this.shapeList.push(p),this._needLabel(V,U,!1)||(p.invisible=!0);var c=this.getLabelLine(e,t,n,i,a,o,r,l,h);this.shapeList.push(c),this._needLabelLine(V,U,!1)||(c.invisible=!0);var u=[],y=[];return this._needLabelLine(V,U,!0)&&(u.push(c.id),y.push(c.id)),this._needLabel(V,U,!0)&&(u.push(p.id),y.push(d.id)),d.hoverConnect=u,p.hoverConnect=y,d},_getItemWidth:function(e,t){var n=this.series[e],i=this._paramsMap[e].location,a=n.min,o=n.max,r=l.parsePercent(n.minSize,i.width),s=l.parsePercent(n.maxSize,i.width);return t*(s-r)/(o-a)},getPolygon:function(e,t,n,i,a,r,s,l,h){var V,U=this.series[e],d=U.data[t],p=[d,U],c=this.deepMerge(p,"itemStyle.normal")||{},u=this.deepMerge(p,"itemStyle.emphasis")||{},y=this.getItemStyleColor(c.color,e,t,d)||n,g=this.getItemStyleColor(u.color,e,t,d)||("string"==typeof y?m.lift(y,-.2):y);switch(h){case"left":V=i;break;case"right":V=i+(r-s);break;default:V=i+(r-s)/2}var b={zlevel:this.getZlevelBase(),z:this.getZBase(),clickable:this.deepQuery(p,"clickable"),style:{pointList:[[i,a],[i+r,a],[V+s,a+l],[V,a+l]],brushType:"both",color:y,lineWidth:c.borderWidth,strokeColor:c.borderColor},highlightStyle:{color:g,lineWidth:u.borderWidth,strokeColor:u.borderColor}};return this.deepQuery([d,U,this.option],"calculable")&&(this.setCalculable(b),b.draggable=!0),new o(b)},getLabel:function(e,t,n,a,o,r,s,l,U){var d,p=this.series[e],c=p.data[t],u=this._paramsMap[e].location,y=h.merge(h.clone(c.itemStyle)||{},p.itemStyle),g="normal",b=y[g].label,f=b.textStyle||{},k=y[g].labelLine.length,x=this.getLabelText(e,t,g),_=this.getFont(f),L=n;b.position=b.position||y.normal.label.position,"inner"===b.position||"inside"===b.position||"center"===b.position?(d=U,L=Math.max(r,s)/2>V.getTextWidth(x,_)?"#fff":m.reverse(n)):d="left"===b.position?"right":"left";var W={zlevel:this.getZlevelBase(),z:this.getZBase()+1,style:{x:this._getLabelPoint(b.position,a,u,r,s,k,U),y:o+l/2,color:f.color||L,text:x,textAlign:f.align||d,textBaseline:f.baseline||"middle",textFont:_}};return g="emphasis",b=y[g].label||b,f=b.textStyle||f,k=y[g].labelLine.length||k,b.position=b.position||y.normal.label.position,x=this.getLabelText(e,t,g),_=this.getFont(f),L=n,"inner"===b.position||"inside"===b.position||"center"===b.position?(d=U,L=Math.max(r,s)/2>V.getTextWidth(x,_)?"#fff":m.reverse(n)):d="left"===b.position?"right":"left",W.highlightStyle={x:this._getLabelPoint(b.position,a,u,r,s,k,U),color:f.color||L,text:x,textAlign:f.align||d,textFont:_,brushType:"fill"},new i(W)},getLabelText:function(e,t,n){var i=this.series,a=i[e],o=a.data[t],r=this.deepQuery([o,a],"itemStyle."+n+".label.formatter");return r?"function"==typeof r?r.call(this.myChart,{seriesIndex:e,seriesName:a.name||"",series:a,dataIndex:t,data:o,name:o.name,value:o.value}):"string"==typeof r?r=r.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}").replace("{a0}",a.name).replace("{b0}",o.name).replace("{c0}",o.value):void 0:o.name},getLabelLine:function(e,t,n,i,o,r,s,l,m){var V=this.series[e],U=V.data[t],d=this._paramsMap[e].location,p=h.merge(h.clone(U.itemStyle)||{},V.itemStyle),c="normal",u=p[c].labelLine,y=p[c].labelLine.length,g=u.lineStyle||{},b=p[c].label;b.position=b.position||p.normal.label.position;var f={zlevel:this.getZlevelBase(),z:this.getZBase()+1,hoverable:!1,style:{xStart:this._getLabelLineStartPoint(i,d,r,s,m),yStart:o+l/2,xEnd:this._getLabelPoint(b.position,i,d,r,s,y,m),yEnd:o+l/2,strokeColor:g.color||n,lineType:g.type,lineWidth:g.width}};return c="emphasis",u=p[c].labelLine||u,y=p[c].labelLine.length||y,g=u.lineStyle||g,b=p[c].label||b,b.position=b.position,f.highlightStyle={xEnd:this._getLabelPoint(b.position,i,d,r,s,y,m),strokeColor:g.color||n,lineType:g.type,lineWidth:g.width},new a(f)},_getLabelPoint:function(e,t,n,i,a,o,r){switch(e="inner"===e||"inside"===e?"center":e){case"center":return"center"==r?t+i/2:"left"==r?t+10:t+i-10;case"left":return"auto"===o?n.x-10:"center"==r?n.centerX-Math.max(i,a)/2-o:"right"==r?t-(a>i?a-i:0)-o:n.x-o;default:return"auto"===o?n.x+n.width+10:"center"==r?n.centerX+Math.max(i,a)/2+o:"right"==r?n.x+n.width+o:t+Math.max(i,a)+o}},_getLabelLineStartPoint:function(e,t,n,i,a){return"center"==a?t.centerX:i>n?e+Math.min(n,i)/2:e+Math.max(n,i)/2},_needLabel:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".label.show")},_needLabelLine:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".labelLine.show")},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()}},h.inherits(t,n),e("../chart").define("funnel",t),t}),n("echarts/chart/eventRiver",["require","./base","../layout/eventRiver","zrender/shape/Polygon","../component/axis","../component/grid","../component/dataZoom","../config","../util/ecData","../util/date","zrender/tool/util","zrender/tool/color","../chart"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o);var r=this;r._ondragend=function(){r.isDragend=!0},this.refresh(a)}var n=e("./base"),i=e("../layout/eventRiver"),a=e("zrender/shape/Polygon");e("../component/axis"),e("../component/grid"),e("../component/dataZoom");var o=e("../config");o.eventRiver={zlevel:0,z:2,clickable:!0,legendHoverLink:!0,itemStyle:{normal:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!0,position:"inside",formatter:"{b}"}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!0}}}};var r=e("../util/ecData"),s=e("../util/date"),l=e("zrender/tool/util"),h=e("zrender/tool/color");return t.prototype={type:o.CHART_TYPE_EVENTRIVER,_buildShape:function(){var e=this.series;this.selectedMap={},this._dataPreprocessing();for(var t=this.component.legend,n=[],a=0;ai;i++)if(n[i].type===this.type){e=this.component.xAxis.getAxis(n[i].xAxisIndex||0);for(var o=0,r=n[i].eventList.length;r>o;o++){t=n[i].eventList[o].evolution;for(var l=0,h=t.length;h>l;l++)t[l].timeScale=e.getCoord(s.getNewDate(t[l].time)-0),t[l].valueScale=Math.pow(t[l].value,.8)}}this._intervalX=Math.round(this.component.grid.getWidth()/40)},_drawEventRiver:function(){for(var e=this.series,t=0;ta)){for(var o=[],r=[],s=0;a>s;s++)o.push(i[s].timeScale),r.push(i[s].valueScale);var l=[];l.push([o[0],n]);var s=0;for(s=0;a-1>s;s++)l.push([(o[s]+o[s+1])/2,r[s]/-2+n]);for(l.push([(o[s]+(o[s]+t))/2,r[s]/-2+n]),l.push([o[s]+t,n]),l.push([(o[s]+(o[s]+t))/2,r[s]/2+n]),s=a-1;s>0;s--)l.push([(o[s]+o[s-1])/2,r[s-1]/2+n]);return l}},ondragend:function(e,t){this.isDragend&&e.target&&(t.dragOut=!0,t.dragIn=!0,t.needRefresh=!1,this.isDragend=!1)},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()}},l.inherits(t,n),e("../chart").define("eventRiver",t),t}),n("echarts/layout/eventRiver",["require"],function(){function e(e,o,r){function s(e,t){var n=e.importance,i=t.importance;return n>i?-1:i>n?1:0}function l(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,i=e.length;i>n;n++)if(e[n]===t)return n;return-1}for(var h=5,m=o,V=0;Ve+1){var a=Math.round((e+t)/2);i.leftChild=n(e,a),i.rightChild=n(a,t)}return i}function i(e,t,n){if(1>n-t)return 0;var a=Math.round((e.left+e.right)/2),o=0;if(t==e.left&&n==e.right)o=e.maxValue;else if(a>=n&&null!=e.leftChild)o=i(e.leftChild,t,n);else if(t>=a&&null!=e.rightChild)o=i(e.rightChild,t,n);else{var r=0,s=0;null!=e.leftChild&&(r=i(e.leftChild,t,a)),null!=e.rightChild&&(s=i(e.rightChild,a,n)),o=r>s?r:s}return o}function a(e,t,n,i){if(null!=e){var o=Math.round((e.left+e.right)/2);e.maxValue=e.maxValue>i?e.maxValue:i,(Math.floor(10*t)!=Math.floor(10*e.left)||Math.floor(10*n)!=Math.floor(10*e.right))&&(o>=n?a(e.leftChild,t,n,i):t>=o?a(e.rightChild,t,n,i):(a(e.leftChild,t,o,i),a(e.rightChild,o,n,i)))}}return e});var i=t("zrender");i.tool={color:t("zrender/tool/color"),math:t("zrender/tool/math"),util:t("zrender/tool/util"),vector:t("zrender/tool/vector"),area:t("zrender/tool/area"),event:t("zrender/tool/event")},i.animation={Animation:t("zrender/animation/Animation"),Cip:t("zrender/animation/Clip"),easing:t("zrender/animation/easing")};var a=t("echarts");a.config=t("echarts/config"),a.util={mapData:{params:t("echarts/util/mapData/params")}},t("echarts/chart/line"),t("echarts/chart/bar"),t("echarts/chart/scatter"),t("echarts/chart/k"),t("echarts/chart/pie"),t("echarts/chart/radar"),t("echarts/chart/chord"),t("echarts/chart/force"),t("echarts/chart/map"),t("echarts/chart/gauge"),t("echarts/chart/funnel"),t("echarts/chart/eventRiver"),e.echarts=a,e.zrender=i}(window); \ No newline at end of file diff --git a/build/dist/echarts.js b/build/dist/echarts.js new file mode 100644 index 0000000..1d544db --- /dev/null +++ b/build/dist/echarts.js @@ -0,0 +1,11 @@ +var define,require,esl;!function(e){function t(e){c(e,F)||(O[e]=1)}function i(e,t){function i(e){0===e.indexOf(".")&&a.push(e)}var a=[];if("string"==typeof e?i(e):C(e,function(e){i(e)}),a.length>0)throw new Error("[REQUIRE_FATAL]Relative ID is not allowed in global require: "+a.join(", "));var o=N.waitSeconds;return o&&e instanceof Array&&(E&&clearTimeout(E),E=setTimeout(n,1e3*o)),D(e,t)}function n(){function e(r,s){if(!o[r]&&!c(r,F)){o[r]=1,c(r,J)||n[r]||(n[r]=1,t.push(r));var l=z[r];l?s&&(n[r]||(n[r]=1,t.push(r)),C(l.depMs,function(t){e(t.absId,t.hard)})):a[r]||(a[r]=1,i.push(r))}}var t=[],i=[],n={},a={},o={};for(var r in O)e(r,1);if(t.length||i.length)throw new Error("[MODULE_TIMEOUT]Hang( "+(t.join(", ")||"none")+" ) Miss( "+(i.join(", ")||"none")+" )")}function a(e){C(B,function(t){s(e,t.deps,t.factory)}),B.length=0}function o(e,t,i){if(null==i&&(null==t?(i=e,e=null):(i=t,t=null,e instanceof Array&&(t=e,e=null))),null!=i){var n=window.opera;if(!e&&document.attachEvent&&(!n||"[object Opera]"!==n.toString())){var a=I();e=a&&a.getAttribute("data-require-id")}e?s(e,t,i):B[0]={deps:t,factory:i}}}function r(){var e=N.config[this.id];return e&&"object"==typeof e?e:{}}function s(e,t,i){z[e]||(z[e]={id:e,depsDec:t,deps:t||["require","exports","module"],factoryDeps:[],factory:i,exports:{},config:r,state:A,require:L(e),depMs:[],depMkv:{},depRs:[]})}function l(e){var t=z[e];if(t&&!c(e,M)){var i=t.deps,n=t.factory,a=0;"function"==typeof n&&(a=Math.min(n.length,i.length),!t.depsDec&&n.toString().replace(/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/gm,"").replace(/require\(\s*(['"'])([^'"]+)\1\s*\)/g,function(e,t,n){i.push(n)}));var o=[],r=[];C(i,function(i,n){var s,l,h=w(i),d=v(h.mod,e);d&&!P[d]?(h.res&&(l={id:i,mod:d,res:h.res},r.push(i),t.depRs.push(l)),s=t.depMkv[d],s||(s={id:h.mod,absId:d,hard:a>n},t.depMs.push(s),t.depMkv[d]=s,o.push(d))):s={absId:d},a>n&&t.factoryDeps.push(l||s)}),t.state=M,m(e),g(o),r.length&&t.require(r,function(){C(t.depRs,function(t){t.absId||(t.absId=v(t.id,e))}),h()})}}function h(){for(var e in O)l(e),d(e),p(e)}function d(e){function t(e){if(l(e),!c(e,M))return!1;if(c(e,J)||i[e])return!0;i[e]=1;var n=z[e],a=!0;return C(n.depMs,function(e){return a=t(e.absId)}),a&&C(n.depRs,function(e){return a=!!e.absId}),a&&(n.state=J),a}var i={};t(e)}function m(t){function i(){if(!n&&a.state===J){n=1;var i=1;if(C(a.factoryDeps,function(e){var t=e.absId;return P[t]?void 0:(p(t),i=c(t,F))}),i){try{var o=a.factory,r="function"==typeof o?o.apply(e,u(a.factoryDeps,{require:a.require,exports:a.exports,module:a})):o;null!=r&&(a.exports=r),a.invokeFactory=null}catch(s){if(/^\[MODULE_MISS\]"([^"]+)/.test(s.message)){var l=a.depMkv[RegExp.$1];return l&&(l.hard=1),void(n=0)}throw s}U(t)}}}var n,a=z[t];a.invokeFactory=i}function c(e,t){return z[e]&&z[e].state>=t}function p(e){var t=z[e];t&&t.invokeFactory&&t.invokeFactory()}function u(e,t){var i=[];return C(e,function(e,n){"object"==typeof e&&(e=e.absId),i[n]=t[e]||z[e].exports}),i}function V(e,t){if(c(e,F))return void t();var i=H[e];i||(i=H[e]=[]),i.push(t)}function U(e){var t=z[e];t.state=F,delete O[e];for(var i=H[e]||[],n=i.length;n--;)i[n]();i.length=0,H[e]=null}function g(t,i,n){function a(){if("function"==typeof i&&!o){var n=1;C(t,function(e){return P[e]?void 0:n=!!c(e,F)}),n&&(o=1,i.apply(e,u(t,P)))}}var o=0;C(t,function(e){P[e]||c(e,F)||(V(e,a),(e.indexOf("!")>0?f:y)(e,n))}),a()}function y(t){function i(){var e=Q[t];K(e||t,n)}function n(){if(r){var i;"function"==typeof r.init&&(i=r.init.apply(e,u(s,P))),null==i&&r.exports&&(i=e,C(r.exports.split("."),function(e){return i=i[e],!!i})),o(t,s,i||{})}else a(t);h()}if(!R[t]&&!z[t]){R[t]=1;var r=N.shim[t];r instanceof Array&&(N.shim[t]=r={deps:r});var s=r&&(r.deps||[]);s?(C(s,function(e){N.shim[e]||(N.shim[e]={})}),D(s,i)):i()}}function f(e,t){function i(t){l.exports=t||!0,U(e)}function n(n){var a=t?z[t].require:D;n.load(s.res,a,i,r.call({id:e}))}if(!z[e]){var o=Q[e];if(o)return void y(o);var s=w(e),l={id:e,state:M};z[e]=l,i.fromText=function(e,t){new Function(t)(),a(e)},n(D(s.mod))}}function b(e,t){var i=X(e,1,t);return i.sort(T),i}function _(){function e(e){Q[e]=t}N.baseUrl=N.baseUrl.replace(/\/$/,"")+"/",G=b(N.paths),Z=b(N.map,1),C(Z,function(e){e.v=b(e.v)}),Y=[],C(N.packages,function(e){var t=e;"string"==typeof e&&(t={name:e.split("/")[0],location:e,main:"main"}),t.location=t.location||t.name,t.main=(t.main||"main").replace(/\.js$/i,""),t.reg=S(t.name),Y.push(t)}),Y.sort(T),q=b(N.urlArgs,1),Q={};for(var t in N.bundles)C(N.bundles[t],e)}function x(e,t,i){C(t,function(t){return t.reg.test(e)?(i(t.v,t.k,t),!1):void 0})}function k(e){var t=/(\.[a-z0-9]+)$/i,i=/(\?[^#]*)$/,n="",a=e,o="";i.test(e)&&(o=RegExp.$1,e=e.replace(i,"")),t.test(e)&&(n=RegExp.$1,a=e.replace(t,""));var r,s=a;return x(a,G,function(e,t){s=s.replace(t,e),r=1}),r||x(a,Y,function(e,t,i){s=s.replace(i.name,i.location)}),/^([a-z]{2,10}:\/)?\//i.test(s)||(s=N.baseUrl+s),s+=n+o,x(a,q,function(e){s+=(s.indexOf("?")>0?"&":"?")+e}),s}function L(e){function i(i,a){if("string"==typeof i){if(!n[i]){var o=v(i,e);if(p(o),!c(o,F))throw new Error('[MODULE_MISS]"'+o+'" is not exists!');n[i]=z[o].exports}return n[i]}if(i instanceof Array){var r=[],s=[];C(i,function(i,n){var a=w(i),o=v(a.mod,e),l=a.res,h=o;if(l){var d=o+"!"+l;0!==l.indexOf(".")&&Q[d]?o=h=d:h=null}s[n]=h,t(o),r.push(o)}),g(r,function(){C(s,function(n,a){null==n&&(n=s[a]=v(i[a],e),t(n))}),g(s,a,e),h()},e),h()}}var n={};return i.toUrl=function(t){return k(v(t,e))},i}function v(e,t){if(!e)return"";t=t||"";var i=w(e);if(!i)return e;var n=i.res,a=W(i.mod,t);if(C(Y,function(e){var t=e.name;return t===a?(a=t+"/"+e.main,!1):void 0}),x(t,Z,function(e){x(a,e,function(e,t){a=a.replace(t,e)})}),n){var o=c(a,F)&&D(a);n=o&&o.normalize?o.normalize(n,function(e){return v(e,t)}):v(n,t),a+="!"+n}return a}function W(e,t){if(0===e.indexOf(".")){var i=t.split("/"),n=e.split("/"),a=i.length-1,o=n.length,r=0,s=0;e:for(var l=0;o>l;l++)switch(n[l]){case"..":if(!(a>r))break e;r++,s++;break;case".":s++;break;default:break e}return i.length=a-r,n=n.slice(s),i.concat(n).join("/")}return e}function w(e){var t=e.split("!");return t[0]?{mod:t[0],res:t[1]}:void 0}function X(e,t,i){var n=[];for(var a in e)if(e.hasOwnProperty(a)){var o={k:a,v:e[a]};n.push(o),t&&(o.reg="*"===a&&i?/^/:S(a))}return n}function I(){if(j)return j;if($&&"interactive"===$.readyState)return $;for(var e=document.getElementsByTagName("script"),t=e.length;t--;){var i=e[t];if("interactive"===i.readyState)return $=i,i}}function K(e,t){function i(){var e=n.readyState;("undefined"==typeof e||/^(loaded|complete)$/.test(e))&&(n.onload=n.onreadystatechange=null,n=null,t())}var n=document.createElement("script");n.setAttribute("data-require-id",e),n.src=k(e+".js"),n.async=!0,n.readyState?n.onreadystatechange=i:n.onload=i,j=n,tt?et.insertBefore(n,tt):et.appendChild(n),j=null}function S(e){return new RegExp("^"+e+"(/|$)")}function C(e,t){if(e instanceof Array)for(var i=0,n=e.length;n>i&&t(e[i],i)!==!1;i++);}function T(e,t){var i=e.k||e.name,n=t.k||t.name;return"*"===n?-1:"*"===i?1:n.length-i.length}var E,z={},A=1,M=2,J=3,F=4,O={},P={require:i,exports:1,module:1},D=L(),N={baseUrl:"./",paths:{},config:{},map:{},packages:[],shim:{},waitSeconds:0,bundles:{},urlArgs:{}};i.version="2.0.2",i.loader="esl",i.toUrl=D.toUrl;var B=[];o.amd={};var H={},R={};i.config=function(e){if(e){for(var t in N){var i=e[t],n=N[t];if(i)if("urlArgs"===t&&"string"==typeof i)N.urlArgs["*"]=i;else if(n instanceof Array)n.push.apply(n,i);else if("object"==typeof n)for(var a in i)n[a]=i[a];else N[t]=i}_()}},_();var G,Y,Z,Q,q,j,$,et=document.getElementsByTagName("head")[0],tt=document.getElementsByTagName("base")[0];tt&&(et=tt.parentNode),define||(define=o,require||(require=i),esl=i)}(this),define("echarts",["echarts/echarts"],function(e){return e}),define("echarts/echarts",["require","./config","zrender/tool/util","zrender/tool/event","zrender/tool/env","zrender","zrender/config","./chart/island","./component/toolbox","./component","./component/title","./component/tooltip","./component/legend","./util/ecData","./chart","zrender/tool/color","./component/timeline","zrender/shape/Image","zrender/loadingEffect/Bar","zrender/loadingEffect/Bubble","zrender/loadingEffect/DynamicLine","zrender/loadingEffect/Ring","zrender/loadingEffect/Spin","zrender/loadingEffect/Whirling","./theme/macarons","./theme/infographic"],function(e){function t(){r.Dispatcher.call(this)}function i(e){e.innerHTML="",this._themeConfig={},this.dom=e,this._connected=!1,this._status={dragIn:!1,dragOut:!1,needRefresh:!1},this._curEventType=!1,this._chartList=[],this._messageCenter=new t,this._messageCenterOutSide=new t,this.resize=this.resize(),this._init()}function n(e,t,i,n,a){for(var o=e._chartList,r=o.length;r--;){var s=o[r];"function"==typeof s[t]&&s[t](i,n,a)}}var a=e("./config"),o=e("zrender/tool/util"),r=e("zrender/tool/event"),s={},l=e("zrender/tool/env").canvasSupported,h=new Date-0,d={},m="_echarts_instance_";s.version="2.2.0",s.dependencies={zrender:"2.0.7"},s.init=function(t,n){var a=e("zrender");a.version.replace(".","")-0r;r++){var l=p[r],h=c[l];o[h]="_on"+l.toLowerCase(),i.on(h,this._onzrevent)}this.chart={},this.component={};var d=e("./chart/island");this._island=new d(this._themeConfig,this._messageCenter,i,{},this),this.chart.island=this._island;var m=e("./component/toolbox");this._toolbox=new m(this._themeConfig,this._messageCenter,i,{},this),this.component.toolbox=this._toolbox;var u=e("./component");u.define("title",e("./component/title")),u.define("tooltip",e("./component/tooltip")),u.define("legend",e("./component/legend")),(0===i.getWidth()||0===i.getHeight())&&console.error("Dom’s width & height should be ready before init.")},__onevent:function(e){e.__echartsId=e.__echartsId||this.id;var t=e.__echartsId===this.id;switch(this._curEventType||(this._curEventType=e.type),e.type){case a.EVENT.LEGEND_SELECTED:this._onlegendSelected(e);break;case a.EVENT.DATA_ZOOM:if(!t){var i=this.component.dataZoom;i&&(i.silence(!0),i.absoluteZoom(e.zoom),i.silence(!1))}this._ondataZoom(e);break;case a.EVENT.DATA_RANGE:t&&this._ondataRange(e);break;case a.EVENT.MAGIC_TYPE_CHANGED:if(!t){var n=this.component.toolbox;n&&(n.silence(!0),n.setMagicType(e.magicType),n.silence(!1))}this._onmagicTypeChanged(e);break;case a.EVENT.DATA_VIEW_CHANGED:t&&this._ondataViewChanged(e);break;case a.EVENT.TOOLTIP_HOVER:t&&this._tooltipHover(e);break;case a.EVENT.RESTORE:this._onrestore();break;case a.EVENT.REFRESH:t&&this._onrefresh(e);break;case a.EVENT.TOOLTIP_IN_GRID:case a.EVENT.TOOLTIP_OUT_GRID:if(t){if(this._connected){var o=this.component.grid;o&&(e.x=(e.event.zrenderX-o.getX())/o.getWidth(),e.y=(e.event.zrenderY-o.getY())/o.getHeight())}}else{var o=this.component.grid;o&&this._zr.trigger("mousemove",{connectTrigger:!0,zrenderX:o.getX()+e.x*o.getWidth(),zrenderY:o.getY()+e.y*o.getHeight()})}}if(this._connected&&t&&this._curEventType===e.type){for(var r in this._connected)this._connected[r].connectedEventHandler(e);this._curEventType=null}(!t||!this._connected&&t)&&(this._curEventType=null)},_onclick:function(e){if(n(this,"onclick",e),e.target){var t=this._eventPackage(e.target);t&&null!=t.seriesIndex&&this._messageCenter.dispatch(a.EVENT.CLICK,e.event,t,this)}},_ondblclick:function(e){if(n(this,"ondblclick",e),e.target){var t=this._eventPackage(e.target);t&&null!=t.seriesIndex&&this._messageCenter.dispatch(a.EVENT.DBLCLICK,e.event,t,this)}},_onmouseover:function(e){if(e.target){var t=this._eventPackage(e.target);t&&null!=t.seriesIndex&&this._messageCenter.dispatch(a.EVENT.HOVER,e.event,t,this)}},_onmouseout:function(e){if(e.target){var t=this._eventPackage(e.target);t&&null!=t.seriesIndex&&this._messageCenter.dispatch(a.EVENT.MOUSEOUT,e.event,t,this)}},_ondragstart:function(e){this._status={dragIn:!1,dragOut:!1,needRefresh:!1},n(this,"ondragstart",e)},_ondragenter:function(e){n(this,"ondragenter",e)},_ondragover:function(e){n(this,"ondragover",e)},_ondragleave:function(e){n(this,"ondragleave",e)},_ondrop:function(e){n(this,"ondrop",e,this._status),this._island.ondrop(e,this._status)},_ondragend:function(e){if(n(this,"ondragend",e,this._status),this._timeline&&this._timeline.ondragend(e,this._status),this._island.ondragend(e,this._status),this._status.needRefresh){this._syncBackupData(this._option);var t=this._messageCenter;t.dispatch(a.EVENT.DATA_CHANGED,e.event,this._eventPackage(e.target),this),t.dispatch(a.EVENT.REFRESH,null,null,this)}},_onlegendSelected:function(e){this._status.needRefresh=!1,n(this,"onlegendSelected",e,this._status),this._status.needRefresh&&this._messageCenter.dispatch(a.EVENT.REFRESH,null,null,this)},_ondataZoom:function(e){this._status.needRefresh=!1,n(this,"ondataZoom",e,this._status),this._status.needRefresh&&this._messageCenter.dispatch(a.EVENT.REFRESH,null,null,this)},_ondataRange:function(e){this._clearEffect(),this._status.needRefresh=!1,n(this,"ondataRange",e,this._status),this._status.needRefresh&&this._zr.refreshNextFrame()},_onmagicTypeChanged:function(){this._clearEffect(),this._render(this._toolbox.getMagicOption())},_ondataViewChanged:function(e){this._syncBackupData(e.option),this._messageCenter.dispatch(a.EVENT.DATA_CHANGED,null,e,this),this._messageCenter.dispatch(a.EVENT.REFRESH,null,null,this)},_tooltipHover:function(e){var t=[];n(this,"ontooltipHover",e,t)},_onrestore:function(){this.restore()},_onrefresh:function(e){this._refreshInside=!0,this.refresh(e),this._refreshInside=!1},_syncBackupData:function(e){this.component.dataZoom&&this.component.dataZoom.syncBackupData(e)},_eventPackage:function(t){if(t){var i=e("./util/ecData"),n=i.get(t,"seriesIndex"),a=i.get(t,"dataIndex");return a=-1!=n&&this.component.dataZoom?this.component.dataZoom.getRealDataIndex(n,a):a,{seriesIndex:n,seriesName:(i.get(t,"series")||{}).name,dataIndex:a,data:i.get(t,"data"),name:i.get(t,"name"),value:i.get(t,"value"),special:i.get(t,"special")}}},_noDataCheck:function(e){for(var t=e.series,i=0,n=t.length;n>i;i++)if(t[i].type==a.CHART_TYPE_MAP||t[i].data&&t[i].data.length>0||t[i].markPoint&&t[i].markPoint.data&&t[i].markPoint.data.length>0||t[i].markLine&&t[i].markLine.data&&t[i].markLine.data.length>0||t[i].nodes&&t[i].nodes.length>0||t[i].links&&t[i].links.length>0||t[i].matrix&&t[i].matrix.length>0||t[i].eventList&&t[i].eventList.length>0)return!1;this.clear();var o=this._option&&this._option.noDataLoadingOption||this._themeConfig.noDataLoadingOption||a.noDataLoadingOption||{text:this._option&&this._option.noDataText||this._themeConfig.noDataText||a.noDataText,effect:this._option&&this._option.noDataEffect||this._themeConfig.noDataEffect||a.noDataEffect};return this.showLoading(o),!0},_render:function(t){if(this._mergeGlobalConifg(t),!this._noDataCheck(t)){var i=t.backgroundColor;if(i)if(l||-1==i.indexOf("rgba"))this.dom.style.backgroundColor=i;else{var n=i.split(",");this.dom.style.filter="alpha(opacity="+100*n[3].substring(0,n[3].lastIndexOf(")"))+")",n.length=3,n[0]=n[0].replace("a",""),this.dom.style.backgroundColor=n.join(",")+")"}this._zr.clearAnimation(),this._chartList=[];var o=e("./chart"),r=e("./component");(t.xAxis||t.yAxis)&&(t.grid=t.grid||{},t.dataZoom=t.dataZoom||{});for(var s,h,d,m=["title","legend","tooltip","dataRange","roamController","grid","dataZoom","xAxis","yAxis","polar"],c=0,p=m.length;p>c;c++)h=m[c],d=this.component[h],t[h]?(d?d.refresh&&d.refresh(t):(s=r.get(/^[xy]Axis$/.test(h)?"axis":h),d=new s(this._themeConfig,this._messageCenter,this._zr,t,this,h),this.component[h]=d),this._chartList.push(d)):d&&(d.dispose(),this.component[h]=null,delete this.component[h]);for(var u,V,U,g={},c=0,p=t.series.length;p>c;c++)V=t.series[c].type,V?g[V]||(g[V]=!0,u=o.get(V),u?(this.chart[V]?(U=this.chart[V],U.refresh(t)):U=new u(this._themeConfig,this._messageCenter,this._zr,t,this),this._chartList.push(U),this.chart[V]=U):console.error(V+" has not been required.")):console.error("series["+c+"] chart type has not been defined.");for(V in this.chart)V==a.CHART_TYPE_ISLAND||g[V]||(this.chart[V].dispose(),this.chart[V]=null,delete this.chart[V]);this.component.grid&&this.component.grid.refixAxisShape(this.component),this._island.refresh(t),this._toolbox.refresh(t),t.animation&&!t.renderAsImage?this._zr.refresh():this._zr.render();var y="IMG"+this.id,f=document.getElementById(y);t.renderAsImage&&l?(f?f.src=this.getDataURL(t.renderAsImage):(f=this.getImage(t.renderAsImage),f.id=y,f.style.position="absolute",f.style.left=0,f.style.top=0,this.dom.firstChild.appendChild(f)),this.un(),this._zr.un(),this._disposeChartList(),this._zr.clear()):f&&f.parentNode.removeChild(f),f=null,this._option=t}},restore:function(){this._clearEffect(),this._option=o.clone(this._optionRestore),this._disposeChartList(),this._island.clear(),this._toolbox.reset(this._option,!0),this._render(this._option)},refresh:function(e){this._clearEffect(),e=e||{};var t=e.option;!this._refreshInside&&t&&(t=this.getOption(),o.merge(t,e.option,!0),o.merge(this._optionRestore,e.option,!0),this._toolbox.reset(t)),this._island.refresh(t),this._toolbox.refresh(t),this._zr.clearAnimation();for(var i=0,n=this._chartList.length;n>i;i++)this._chartList[i].refresh&&this._chartList[i].refresh(t);this.component.grid&&this.component.grid.refixAxisShape(this.component),this._zr.refresh()},_disposeChartList:function(){this._clearEffect(),this._zr.clearAnimation();for(var e=this._chartList.length;e--;){var t=this._chartList[e];if(t){var i=t.type;this.chart[i]&&delete this.chart[i],this.component[i]&&delete this.component[i],t.dispose&&t.dispose()}}this._chartList=[]},_mergeGlobalConifg:function(t){for(var i=["backgroundColor","calculable","calculableColor","calculableHolderColor","nameConnector","valueConnector","animation","animationThreshold","animationDuration","animationDurationUpdate","animationEasing","addDataAnimation","symbolList","DRAG_ENABLE_TIME"],n=i.length;n--;){var o=i[n];null==t[o]&&(t[o]=null!=this._themeConfig[o]?this._themeConfig[o]:a[o])}var r=t.color;r&&r.length||(r=this._themeConfig.color||a.color),this._zr.getColor=function(t){var i=e("zrender/tool/color");return i.getColor(t,r)},l||(t.animation=!1,t.addDataAnimation=!1)},setOption:function(e,t){return e.timeline?this._setTimelineOption(e):this._setOption(e,t)},_setOption:function(e,t){return this._option=!t&&this._option?o.merge(this.getOption(),o.clone(e),!0):o.clone(e),this._optionRestore=o.clone(this._option),this._option.series&&0!==this._option.series.length?(this.component.dataZoom&&(this._option.dataZoom||this._option.toolbox&&this._option.toolbox.feature&&this._option.toolbox.feature.dataZoom&&this._option.toolbox.feature.dataZoom.show)&&this.component.dataZoom.syncOption(this._option),this._toolbox.reset(this._option),this._render(this._option),this):void this._zr.clear()},getOption:function(){function e(e){var n=i._optionRestore[e];if(n)if(n instanceof Array)for(var a=n.length;a--;)t[e][a].data=o.clone(n[a].data);else t[e].data=o.clone(n.data)}var t=o.clone(this._option),i=this;return e("xAxis"),e("yAxis"),e("series"),t},setSeries:function(e,t){return t?(this._option.series=e,this.setOption(this._option,t)):this.setOption({series:e}),this},getSeries:function(){return this.getOption().series},_setTimelineOption:function(t){this._timeline&&this._timeline.dispose();var i=e("./component/timeline"),n=new i(this._themeConfig,this._messageCenter,this._zr,t,this);return this._timeline=n,this.component.timeline=this._timeline,this},addData:function(e,t,i,n,r){for(var s=e instanceof Array?e:[[e,t,i,n,r]],l=this.getOption(),h=this._optionRestore,d=0,m=s.length;m>d;d++){e=s[d][0],t=s[d][1],i=s[d][2],n=s[d][3],r=s[d][4];var c=h.series[e],p=i?"unshift":"push",u=i?"pop":"shift";if(c){var V=c.data,U=l.series[e].data;if(V[p](t),U[p](t),n||(V[u](),t=U[u]()),null!=r){var g,y;if(c.type===a.CHART_TYPE_PIE&&(g=h.legend)&&(y=g.data)){var f=l.legend.data;if(y[p](r),f[p](r),!n){var b=o.indexOf(y,t.name);-1!=b&&y.splice(b,1),b=o.indexOf(f,t.name),-1!=b&&f.splice(b,1)}}else if(null!=h.xAxis&&null!=h.yAxis){var _,x,k=c.xAxisIndex||0;(null==h.xAxis[k].type||"category"===h.xAxis[k].type)&&(_=h.xAxis[k].data,x=l.xAxis[k].data,_[p](r),x[p](r),n||(_[u](),x[u]())),k=c.yAxisIndex||0,"category"===h.yAxis[k].type&&(_=h.yAxis[k].data,x=l.yAxis[k].data,_[p](r),x[p](r),n||(_[u](),x[u]()))}}this._option.series[e].data=l.series[e].data}}this._zr.clearAnimation();for(var L=this._chartList,d=0,m=L.length;m>d;d++)l.addDataAnimation&&L[d].addDataAnimation&&L[d].addDataAnimation(s);this.component.dataZoom&&this.component.dataZoom.syncOption(l),this._option=l;var v=this;return setTimeout(function(){if(v._zr){v._zr.clearAnimation();for(var e=0,t=L.length;t>e;e++)L[e].motionlessOnce=l.addDataAnimation&&L[e].addDataAnimation;v._messageCenter.dispatch(a.EVENT.REFRESH,null,{option:l},v)}},l.addDataAnimation?l.animationDurationUpdate:0),this},addMarkPoint:function(e,t){return this._addMark(e,t,"markPoint")},addMarkLine:function(e,t){return this._addMark(e,t,"markLine")},_addMark:function(e,t,i){var n,a=this._option.series;if(a&&(n=a[e])){var r=this._optionRestore.series,s=r[e],l=n[i],h=s[i];l=n[i]=l||{data:[]},h=s[i]=h||{data:[]};for(var d in t)"data"===d?(l.data=l.data.concat(t.data),h.data=h.data.concat(t.data)):"object"!=typeof t[d]||null==l[d]?l[d]=h[d]=t[d]:(o.merge(l[d],t[d],!0),o.merge(h[d],t[d],!0));var m=this.chart[n.type];m&&m.addMark(e,t,i)}return this},delMarkPoint:function(e,t){return this._delMark(e,t,"markPoint")},delMarkLine:function(e,t){return this._delMark(e,t,"markLine")},_delMark:function(e,t,i){var n,a,o,r=this._option.series;if(!(r&&(n=r[e])&&(a=n[i])&&(o=a.data)))return this;t=t.split(" > ");for(var s=-1,l=0,h=o.length;h>l;l++){var d=o[l];if(d instanceof Array){if(d[0].name===t[0]&&d[1].name===t[1]){s=l;break}}else if(d.name===t[0]){s=l;break}}if(s>-1){o.splice(s,1),this._optionRestore.series[e][i].data.splice(s,1);var m=this.chart[n.type];m&&m.delMark(e,t.join(" > "),i)}return this},getDom:function(){return this.dom},getZrender:function(){return this._zr},getDataURL:function(e){if(!l)return"";if(0===this._chartList.length){var t="IMG"+this.id,i=document.getElementById(t);if(i)return i.src}var n=this.component.tooltip;switch(n&&n.hideTip(),e){case"jpeg":break;default:e="png"}var a=this._option.backgroundColor;return a&&"rgba(0,0,0,0)"===a.replace(" ","")&&(a="#fff"),this._zr.toDataURL("image/"+e,a)},getImage:function(e){var t=this._optionRestore.title,i=document.createElement("img");return i.src=this.getDataURL(e),i.title=t&&t.text||"ECharts",i},getConnectedDataURL:function(t){if(!this.isConnected())return this.getDataURL(t);var i=this.dom,n={self:{img:this.getDataURL(t),left:i.offsetLeft,top:i.offsetTop,right:i.offsetLeft+i.offsetWidth,bottom:i.offsetTop+i.offsetHeight}},a=n.self.left,o=n.self.top,r=n.self.right,s=n.self.bottom;for(var l in this._connected)i=this._connected[l].getDom(),n[l]={img:this._connected[l].getDataURL(t),left:i.offsetLeft,top:i.offsetTop,right:i.offsetLeft+i.offsetWidth,bottom:i.offsetTop+i.offsetHeight},a=Math.min(a,n[l].left),o=Math.min(o,n[l].top),r=Math.max(r,n[l].right),s=Math.max(s,n[l].bottom);var h=document.createElement("div");h.style.position="absolute",h.style.left="-4000px",h.style.width=r-a+"px",h.style.height=s-o+"px",document.body.appendChild(h);var d=e("zrender").init(h),m=e("zrender/shape/Image");for(var l in n)d.addShape(new m({style:{x:n[l].left-a,y:n[l].top-o,image:n[l].img}}));d.render();var c=this._option.backgroundColor;c&&"rgba(0,0,0,0)"===c.replace(/ /g,"")&&(c="#fff");var p=d.toDataURL("image/png",c);return setTimeout(function(){d.dispose(),h.parentNode.removeChild(h),h=null},100),p},getConnectedImage:function(e){var t=this._optionRestore.title,i=document.createElement("img");return i.src=this.getConnectedDataURL(e),i.title=t&&t.text||"ECharts",i},on:function(e,t){return this._messageCenterOutSide.bind(e,t,this),this},un:function(e,t){return this._messageCenterOutSide.unbind(e,t),this},connect:function(e){if(!e)return this;if(this._connected||(this._connected={}),e instanceof Array)for(var t=0,i=e.length;i>t;t++)this._connected[e[t].id]=e[t];else this._connected[e.id]=e;return this},disConnect:function(e){if(!e||!this._connected)return this;if(e instanceof Array)for(var t=0,i=e.length;i>t;t++)delete this._connected[e[t].id];else delete this._connected[e.id];for(var n in this._connected)return this;return this._connected=!1,this},connectedEventHandler:function(e){e.__echartsId!=this.id&&this._onevent(e)},isConnected:function(){return!!this._connected},showLoading:function(t){var i={bar:e("zrender/loadingEffect/Bar"),bubble:e("zrender/loadingEffect/Bubble"),dynamicLine:e("zrender/loadingEffect/DynamicLine"),ring:e("zrender/loadingEffect/Ring"),spin:e("zrender/loadingEffect/Spin"),whirling:e("zrender/loadingEffect/Whirling")};this._toolbox.hideDataView(),t=t||{};var n=t.textStyle||{};t.textStyle=n;var r=o.merge(o.merge(o.clone(n),this._themeConfig.textStyle),a.textStyle);n.textFont=r.fontStyle+" "+r.fontWeight+" "+r.fontSize+"px "+r.fontFamily,n.text=t.text||this._option&&this._option.loadingText||this._themeConfig.loadingText||a.loadingText,null!=t.x&&(n.x=t.x),null!=t.y&&(n.y=t.y),t.effectOption=t.effectOption||{},t.effectOption.textStyle=n;var s=t.effect;return("string"==typeof s||null==s)&&(s=i[t.effect||this._option&&this._option.loadingEffect||this._themeConfig.loadingEffect||a.loadingEffect]||i.spin),this._zr.showLoading(new s(t.effectOption)),this},hideLoading:function(){return this._zr.hideLoading(),this},setTheme:function(t){if(t){if("string"==typeof t)switch(t){case"macarons":t=e("./theme/macarons");break;case"infographic":t=e("./theme/infographic");break;default:t={}}else t=t||{};this._themeConfig=t}if(!l){var i=this._themeConfig.textStyle;i&&i.fontFamily&&i.fontFamily2&&(i.fontFamily=i.fontFamily2),i=a.textStyle,i.fontFamily=i.fontFamily2}this._timeline&&this._timeline.setTheme(!0),this._optionRestore&&this.restore()},resize:function(){var e=this;return function(){if(e._clearEffect(),e._zr.resize(),e._option&&e._option.renderAsImage&&l)return e._render(e._option),e;e._zr.clearAnimation(),e._island.resize(),e._toolbox.resize(),e._timeline&&e._timeline.resize();for(var t=0,i=e._chartList.length;i>t;t++)e._chartList[t].resize&&e._chartList[t].resize();return e.component.grid&&e.component.grid.refixAxisShape(e.component),e._zr.refresh(),e._messageCenter.dispatch(a.EVENT.RESIZE,null,null,e),e}},_clearEffect:function(){this._zr.modLayer(a.EFFECT_ZLEVEL,{motionBlur:!1}),this._zr.painter.clearLayer(a.EFFECT_ZLEVEL)},clear:function(){return this._disposeChartList(),this._zr.clear(),this._option={},this._optionRestore={},this.dom.style.backgroundColor=null,this},dispose:function(){var e=this.dom.getAttribute(m);e&&delete d[e],this._island.dispose(),this._toolbox.dispose(),this._timeline&&this._timeline.dispose(),this._messageCenter.unbind(),this.clear(),this._zr.dispose(),this._zr=null}},s}),define("echarts/config",[],function(){var e={CHART_TYPE_LINE:"line",CHART_TYPE_BAR:"bar",CHART_TYPE_SCATTER:"scatter",CHART_TYPE_PIE:"pie",CHART_TYPE_RADAR:"radar",CHART_TYPE_MAP:"map",CHART_TYPE_K:"k",CHART_TYPE_ISLAND:"island",CHART_TYPE_FORCE:"force",CHART_TYPE_CHORD:"chord",CHART_TYPE_GAUGE:"gauge",CHART_TYPE_FUNNEL:"funnel",CHART_TYPE_EVENTRIVER:"eventRiver",COMPONENT_TYPE_TITLE:"title",COMPONENT_TYPE_LEGEND:"legend",COMPONENT_TYPE_DATARANGE:"dataRange",COMPONENT_TYPE_DATAVIEW:"dataView",COMPONENT_TYPE_DATAZOOM:"dataZoom",COMPONENT_TYPE_TOOLBOX:"toolbox",COMPONENT_TYPE_TOOLTIP:"tooltip",COMPONENT_TYPE_GRID:"grid",COMPONENT_TYPE_AXIS:"axis",COMPONENT_TYPE_POLAR:"polar",COMPONENT_TYPE_X_AXIS:"xAxis",COMPONENT_TYPE_Y_AXIS:"yAxis",COMPONENT_TYPE_AXIS_CATEGORY:"categoryAxis",COMPONENT_TYPE_AXIS_VALUE:"valueAxis",COMPONENT_TYPE_TIMELINE:"timeline",COMPONENT_TYPE_ROAMCONTROLLER:"roamController",backgroundColor:"rgba(0,0,0,0)",color:["#ff7f50","#87cefa","#da70d6","#32cd32","#6495ed","#ff69b4","#ba55d3","#cd5c5c","#ffa500","#40e0d0","#1e90ff","#ff6347","#7b68ee","#00fa9a","#ffd700","#6699FF","#ff6666","#3cb371","#b8860b","#30e0e0"],markPoint:{clickable:!0,symbol:"pin",symbolSize:10,large:!1,effect:{show:!1,loop:!0,period:15,type:"scale",scaleSize:2,bounceDistance:10},itemStyle:{normal:{borderWidth:2,label:{show:!0,position:"inside"}},emphasis:{label:{show:!0}}}},markLine:{clickable:!0,symbol:["circle","arrow"],symbolSize:[2,4],smoothRadian:.2,precision:2,effect:{show:!1,loop:!0,period:15,scaleSize:2},itemStyle:{normal:{borderWidth:1.5,label:{show:!0,position:"end"},lineStyle:{type:"dashed"}},emphasis:{label:{show:!1},lineStyle:{}}}},textStyle:{decoration:"none",fontFamily:"Arial, Verdana, sans-serif",fontFamily2:"微软雅黑",fontSize:12,fontStyle:"normal",fontWeight:"normal"},EVENT:{REFRESH:"refresh",RESTORE:"restore",RESIZE:"resize",CLICK:"click",DBLCLICK:"dblclick",HOVER:"hover",MOUSEOUT:"mouseout",DATA_CHANGED:"dataChanged",DATA_ZOOM:"dataZoom",DATA_RANGE:"dataRange",DATA_RANGE_SELECTED:"dataRangeSelected",DATA_RANGE_HOVERLINK:"dataRangeHoverLink",LEGEND_SELECTED:"legendSelected",LEGEND_HOVERLINK:"legendHoverLink",MAP_SELECTED:"mapSelected",PIE_SELECTED:"pieSelected",MAGIC_TYPE_CHANGED:"magicTypeChanged",DATA_VIEW_CHANGED:"dataViewChanged",TIMELINE_CHANGED:"timelineChanged",MAP_ROAM:"mapRoam",FORCE_LAYOUT_END:"forceLayoutEnd",TOOLTIP_HOVER:"tooltipHover",TOOLTIP_IN_GRID:"tooltipInGrid",TOOLTIP_OUT_GRID:"tooltipOutGrid",ROAMCONTROLLER:"roamController"},DRAG_ENABLE_TIME:120,EFFECT_ZLEVEL:10,symbolList:["circle","rectangle","triangle","diamond","emptyCircle","emptyRectangle","emptyTriangle","emptyDiamond"],loadingEffect:"spin",loadingText:"数据读取中...",noDataEffect:"bubble",noDataText:"暂无数据",calculable:!1,calculableColor:"rgba(255,165,0,0.6)",calculableHolderColor:"#ccc",nameConnector:" & ",valueConnector:": ",animation:!0,addDataAnimation:!0,animationThreshold:2e3,animationDuration:2e3,animationDurationUpdate:500,animationEasing:"ExponentialOut"};return e}),define("zrender/tool/util",["require","../dep/excanvas"],function(e){function t(e){return e&&1===e.nodeType&&"string"==typeof e.nodeName}function i(e){if("object"==typeof e&&null!==e){var n=e;if(e instanceof Array){n=[];for(var a=0,o=e.length;o>a;a++)n[a]=i(e[a])}else if(!U[g.call(e)]&&!t(e)){n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=i(e[r]))}return n}return e}function n(e,i,n,o){if(i.hasOwnProperty(n)){var r=e[n];"object"!=typeof r||U[g.call(r)]||t(r)?!o&&n in e||(e[n]=i[n]):a(e[n],i[n],o)}}function a(e,t,i){for(var a in t)n(e,t,a,i);return e}function o(){if(!m)if(e("../dep/excanvas"),window.G_vmlCanvasManager){var t=document.createElement("div");t.style.position="absolute",t.style.top="-1000px",document.body.appendChild(t),m=G_vmlCanvasManager.initElement(t).getContext("2d")}else m=document.createElement("canvas").getContext("2d");return m}function r(){return p||(c=document.createElement("canvas"),u=c.width,V=c.height,p=c.getContext("2d")),p +}function s(e,t){var i,n=100;e+y>u&&(u=e+y+n,c.width=u,i=!0),t+f>V&&(V=t+f+n,c.height=V,i=!0),-y>e&&(y=Math.ceil(-e/n)*n,u+=y,c.width=u,i=!0),-f>t&&(f=Math.ceil(-t/n)*n,V+=f,c.height=V,i=!0),i&&p.translate(y,f)}function l(){return{x:y,y:f}}function h(e,t){if(e.indexOf)return e.indexOf(t);for(var i=0,n=e.length;n>i;i++)if(e[i]===t)return i;return-1}function d(e,t){function i(){}var n=e.prototype;i.prototype=t.prototype,e.prototype=new i;for(var a in n)e.prototype[a]=n[a];e.constructor=e}var m,c,p,u,V,U={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1},g=Object.prototype.toString,y=0,f=0;return{inherits:d,clone:i,merge:a,getContext:o,getPixelContext:r,getPixelOffset:l,adjustCanvasSize:s,indexOf:h}}),define("zrender/tool/event",["require","../mixin/Eventful"],function(e){"use strict";function t(e){return"undefined"!=typeof e.zrenderX&&e.zrenderX||"undefined"!=typeof e.offsetX&&e.offsetX||"undefined"!=typeof e.layerX&&e.layerX||"undefined"!=typeof e.clientX&&e.clientX}function i(e){return"undefined"!=typeof e.zrenderY&&e.zrenderY||"undefined"!=typeof e.offsetY&&e.offsetY||"undefined"!=typeof e.layerY&&e.layerY||"undefined"!=typeof e.clientY&&e.clientY}function n(e){return"undefined"!=typeof e.zrenderDelta&&e.zrenderDelta||"undefined"!=typeof e.wheelDelta&&e.wheelDelta||"undefined"!=typeof e.detail&&-e.detail}var a=e("../mixin/Eventful"),o="function"==typeof window.addEventListener?function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0}:function(e){e.returnValue=!1,e.cancelBubble=!0};return{getX:t,getY:i,getDelta:n,stop:o,Dispatcher:a}}),define("zrender/tool/env",[],function(){function e(e){var t=this.os={},i=this.browser={},n=e.match(/Web[kK]it[\/]{0,1}([\d.]+)/),a=e.match(/(Android);?[\s\/]+([\d.]+)?/),o=e.match(/(iPad).*OS\s([\d_]+)/),r=e.match(/(iPod)(.*OS\s([\d_]+))?/),s=!o&&e.match(/(iPhone\sOS)\s([\d_]+)/),l=e.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),h=l&&e.match(/TouchPad/),d=e.match(/Kindle\/([\d.]+)/),m=e.match(/Silk\/([\d._]+)/),c=e.match(/(BlackBerry).*Version\/([\d.]+)/),p=e.match(/(BB10).*Version\/([\d.]+)/),u=e.match(/(RIM\sTablet\sOS)\s([\d.]+)/),V=e.match(/PlayBook/),U=e.match(/Chrome\/([\d.]+)/)||e.match(/CriOS\/([\d.]+)/),g=e.match(/Firefox\/([\d.]+)/),y=e.match(/MSIE ([\d.]+)/),f=n&&e.match(/Mobile\//)&&!U,b=e.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/)&&!U,y=e.match(/MSIE\s([\d.]+)/);return(i.webkit=!!n)&&(i.version=n[1]),a&&(t.android=!0,t.version=a[2]),s&&!r&&(t.ios=t.iphone=!0,t.version=s[2].replace(/_/g,".")),o&&(t.ios=t.ipad=!0,t.version=o[2].replace(/_/g,".")),r&&(t.ios=t.ipod=!0,t.version=r[3]?r[3].replace(/_/g,"."):null),l&&(t.webos=!0,t.version=l[2]),h&&(t.touchpad=!0),c&&(t.blackberry=!0,t.version=c[2]),p&&(t.bb10=!0,t.version=p[2]),u&&(t.rimtabletos=!0,t.version=u[2]),V&&(i.playbook=!0),d&&(t.kindle=!0,t.version=d[1]),m&&(i.silk=!0,i.version=m[1]),!m&&t.android&&e.match(/Kindle Fire/)&&(i.silk=!0),U&&(i.chrome=!0,i.version=U[1]),g&&(i.firefox=!0,i.version=g[1]),y&&(i.ie=!0,i.version=y[1]),f&&(e.match(/Safari/)||t.ios)&&(i.safari=!0),b&&(i.webview=!0),y&&(i.ie=!0,i.version=y[1]),t.tablet=!!(o||V||a&&!e.match(/Mobile/)||g&&e.match(/Tablet/)||y&&!e.match(/Phone/)&&e.match(/Touch/)),t.phone=!(t.tablet||t.ipod||!(a||s||l||c||p||U&&e.match(/Android/)||U&&e.match(/CriOS\/([\d.]+)/)||g&&e.match(/Mobile/)||y&&e.match(/Touch/))),{browser:i,os:t,canvasSupported:document.createElement("canvas").getContext?!0:!1}}return e(navigator.userAgent)}),define("zrender",["zrender/zrender"],function(e){return e}),define("zrender/zrender",["require","./dep/excanvas","./tool/util","./tool/log","./tool/guid","./Handler","./Painter","./Storage","./animation/Animation","./tool/env"],function(e){function t(e){return function(){for(var t=e.animatingElements,i=0,n=t.length;n>i;i++)e.storage.mod(t[i].id);(t.length||e._needsRefreshNextFrame)&&e.refresh()}}e("./dep/excanvas");var i=e("./tool/util"),n=e("./tool/log"),a=e("./tool/guid"),o=e("./Handler"),r=e("./Painter"),s=e("./Storage"),l=e("./animation/Animation"),h={},d={};d.version="2.0.7",d.init=function(e){var t=new m(a(),e);return h[t.id]=t,t},d.dispose=function(e){if(e)e.dispose();else{for(var t in h)h[t].dispose();h={}}return d},d.getInstance=function(e){return h[e]},d.delInstance=function(e){return delete h[e],d};var m=function(i,n){this.id=i,this.env=e("./tool/env"),this.storage=new s,this.painter=new r(n,this.storage),this.handler=new o(n,this.storage,this.painter),this.animatingElements=[],this.animation=new l({stage:{update:t(this)}}),this.animation.start();var a=this;this.painter.refreshNextFrame=function(){a.refreshNextFrame()},this._needsRefreshNextFrame=!1};return m.prototype.getId=function(){return this.id},m.prototype.addShape=function(e){return this.storage.addRoot(e),this},m.prototype.addGroup=function(e){return this.storage.addRoot(e),this},m.prototype.delShape=function(e){return this.storage.delRoot(e),this},m.prototype.delGroup=function(e){return this.storage.delRoot(e),this},m.prototype.modShape=function(e,t){return this.storage.mod(e,t),this},m.prototype.modGroup=function(e,t){return this.storage.mod(e,t),this},m.prototype.modLayer=function(e,t){return this.painter.modLayer(e,t),this},m.prototype.addHoverShape=function(e){return this.storage.addHover(e),this},m.prototype.render=function(e){return this.painter.render(e),this._needsRefreshNextFrame=!1,this},m.prototype.refresh=function(e){return this.painter.refresh(e),this._needsRefreshNextFrame=!1,this},m.prototype.refreshNextFrame=function(){return this._needsRefreshNextFrame=!0,this},m.prototype.refreshHover=function(e){return this.painter.refreshHover(e),this},m.prototype.refreshShapes=function(e,t){return this.painter.refreshShapes(e,t),this},m.prototype.resize=function(){return this.painter.resize(),this},m.prototype.animate=function(e,t,a){if("string"==typeof e&&(e=this.storage.get(e)),e){var o;if(t){for(var r=t.split("."),s=e,l=0,h=r.length;h>l;l++)s&&(s=s[r[l]]);s&&(o=s)}else o=e;if(!o)return void n('Property "'+t+'" is not existed in element '+e.id);var d=this.animatingElements;return"undefined"==typeof e.__aniCount&&(e.__aniCount=0),0===e.__aniCount&&d.push(e),e.__aniCount++,this.animation.animate(o,{loop:a}).done(function(){if(e.__aniCount--,0===e.__aniCount){var t=i.indexOf(d,e);d.splice(t,1)}})}n("Element not existed")},m.prototype.clearAnimation=function(){this.animation.clear()},m.prototype.showLoading=function(e){return this.painter.showLoading(e),this},m.prototype.hideLoading=function(){return this.painter.hideLoading(),this},m.prototype.getWidth=function(){return this.painter.getWidth()},m.prototype.getHeight=function(){return this.painter.getHeight()},m.prototype.toDataURL=function(e,t,i){return this.painter.toDataURL(e,t,i)},m.prototype.shapeToImage=function(e,t,i){var n=a();return this.painter.shapeToImage(n,e,t,i)},m.prototype.on=function(e,t,i){return this.handler.on(e,t,i),this},m.prototype.un=function(e,t){return this.handler.un(e,t),this},m.prototype.trigger=function(e,t){return this.handler.trigger(e,t),this},m.prototype.clear=function(){return this.storage.delRoot(),this.painter.clear(),this},m.prototype.dispose=function(){this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.animatingElements=this.storage=this.painter=this.handler=null,d.delInstance(this.id)},d}),define("zrender/config",[],function(){var e={EVENT:{RESIZE:"resize",CLICK:"click",DBLCLICK:"dblclick",MOUSEWHEEL:"mousewheel",MOUSEMOVE:"mousemove",MOUSEOVER:"mouseover",MOUSEOUT:"mouseout",MOUSEDOWN:"mousedown",MOUSEUP:"mouseup",GLOBALOUT:"globalout",DRAGSTART:"dragstart",DRAGEND:"dragend",DRAGENTER:"dragenter",DRAGOVER:"dragover",DRAGLEAVE:"dragleave",DROP:"drop",touchClickDelay:300},catchBrushException:!1,debugMode:0,devicePixelRatio:Math.max(window.devicePixelRatio||1,1)};return e}),define("echarts/chart/island",["require","./base","zrender/shape/Circle","../config","../util/ecData","zrender/tool/util","zrender/tool/event","zrender/tool/color","../util/accMath","../chart"],function(e){function t(e,t,n,a,r){i.call(this,e,t,n,a,r),this._nameConnector,this._valueConnector,this._zrHeight=this.zr.getHeight(),this._zrWidth=this.zr.getWidth();var l=this;l.shapeHandler.onmousewheel=function(e){var t=e.target,i=e.event,n=s.getDelta(i);n=n>0?-1:1,t.style.r-=n,t.style.r=t.style.r<5?5:t.style.r;var a=o.get(t,"value"),r=a*l.option.island.calculateStep;a=r>1?Math.round(a-r*n):+(a-r*n).toFixed(2);var h=o.get(t,"name");t.style.text=h+":"+a,o.set(t,"value",a),o.set(t,"name",h),l.zr.modShape(t.id),l.zr.refreshNextFrame(),s.stop(i)}}var i=e("./base"),n=e("zrender/shape/Circle"),a=e("../config");a.island={zlevel:0,z:5,r:15,calculateStep:.1};var o=e("../util/ecData"),r=e("zrender/tool/util"),s=e("zrender/tool/event");return t.prototype={type:a.CHART_TYPE_ISLAND,_combine:function(t,i){var n=e("zrender/tool/color"),a=e("../util/accMath"),r=a.accAdd(o.get(t,"value"),o.get(i,"value")),s=o.get(t,"name")+this._nameConnector+o.get(i,"name");t.style.text=s+this._valueConnector+r,o.set(t,"value",r),o.set(t,"name",s),t.style.r=this.option.island.r,t.style.color=n.mix(t.style.color,i.style.color)},refresh:function(e){e&&(e.island=this.reformOption(e.island),this.option=e,this._nameConnector=this.option.nameConnector,this._valueConnector=this.option.valueConnector)},getOption:function(){return this.option},resize:function(){var e=this.zr.getWidth(),t=this.zr.getHeight(),i=e/(this._zrWidth||e),n=t/(this._zrHeight||t);if(1!==i||1!==n){this._zrWidth=e,this._zrHeight=t;for(var a=0,o=this.shapeList.length;o>a;a++)this.zr.modShape(this.shapeList[a].id,{style:{x:Math.round(this.shapeList[a].style.x*i),y:Math.round(this.shapeList[a].style.y*n)}})}},add:function(e){var t=o.get(e,"name"),i=o.get(e,"value"),a=null!=o.get(e,"series")?o.get(e,"series").name:"",r=this.getFont(this.option.island.textStyle),s={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:e.style.x,y:e.style.y,r:this.option.island.r,color:e.style.color||e.style.strokeColor,text:t+this._valueConnector+i,textFont:r},draggable:!0,hoverable:!0,onmousewheel:this.shapeHandler.onmousewheel,_type:"island"};"#fff"===s.style.color&&(s.style.color=e.style.strokeColor),this.setCalculable(s),s.dragEnableTime=0,o.pack(s,{name:a},-1,i,-1,t),s=new n(s),this.shapeList.push(s),this.zr.addShape(s)},del:function(e){this.zr.delShape(e.id);for(var t=[],i=0,n=this.shapeList.length;n>i;i++)this.shapeList[i].id!=e.id&&t.push(this.shapeList[i]);this.shapeList=t},ondrop:function(e,t){if(this.isDrop&&e.target){var i=e.target,n=e.dragged;this._combine(i,n),this.zr.modShape(i.id),t.dragIn=!0,this.isDrop=!1}},ondragend:function(e,t){var i=e.target;this.isDragend?t.dragIn&&(this.del(i),t.needRefresh=!0):t.dragIn||(i.style.x=s.getX(e.event),i.style.y=s.getY(e.event),this.add(i),t.needRefresh=!0),this.isDragend=!1}},r.inherits(t,i),e("../chart").define("island",t),t}),define("echarts/component/toolbox",["require","./base","zrender/shape/Line","zrender/shape/Image","zrender/shape/Rectangle","../util/shape/Icon","../config","zrender/tool/util","zrender/config","zrender/tool/event","./dataView","../component"],function(e){function t(e,t,n,a,o){i.call(this,e,t,n,a,o),this.dom=o.dom,this._magicType={},this._magicMap={},this._isSilence=!1,this._iconList,this._iconShapeMap={},this._featureTitle={},this._featureIcon={},this._featureColor={},this._featureOption={},this._enableColor="red",this._disableColor="#ccc",this._markShapeList=[];var r=this;r._onMark=function(e){r.__onMark(e)},r._onMarkUndo=function(e){r.__onMarkUndo(e)},r._onMarkClear=function(e){r.__onMarkClear(e)},r._onDataZoom=function(e){r.__onDataZoom(e)},r._onDataZoomReset=function(e){r.__onDataZoomReset(e)},r._onDataView=function(e){r.__onDataView(e)},r._onRestore=function(e){r.__onRestore(e)},r._onSaveAsImage=function(e){r.__onSaveAsImage(e)},r._onMagicType=function(e){r.__onMagicType(e)},r._onCustomHandler=function(e){r.__onCustomHandler(e)},r._onmousemove=function(e){return r.__onmousemove(e)},r._onmousedown=function(e){return r.__onmousedown(e)},r._onmouseup=function(e){return r.__onmouseup(e)},r._onclick=function(e){return r.__onclick(e)}}var i=e("./base"),n=e("zrender/shape/Line"),a=e("zrender/shape/Image"),o=e("zrender/shape/Rectangle"),r=e("../util/shape/Icon"),s=e("../config");s.toolbox={zlevel:0,z:6,show:!1,orient:"horizontal",x:"right",y:"top",color:["#1e90ff","#22bb22","#4b0082","#d2691e"],disableColor:"#ddd",effectiveColor:"red",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,itemSize:16,showTitle:!0,feature:{mark:{show:!1,title:{mark:"辅助线开关",markUndo:"删除辅助线",markClear:"清空辅助线"},lineStyle:{width:1,color:"#1e90ff",type:"dashed"}},dataZoom:{show:!1,title:{dataZoom:"区域缩放",dataZoomReset:"区域缩放后退"}},dataView:{show:!1,title:"数据视图",readOnly:!1,lang:["数据视图","关闭","刷新"]},magicType:{show:!1,title:{line:"折线图切换",bar:"柱形图切换",stack:"堆积",tiled:"平铺",force:"力导向布局图切换",chord:"和弦图切换",pie:"饼图切换",funnel:"漏斗图切换"},type:[]},restore:{show:!1,title:"还原"},saveAsImage:{show:!1,title:"保存为图片",type:"png",lang:["点击保存"]}}};var l=e("zrender/tool/util"),h=e("zrender/config"),d=e("zrender/tool/event"),m="stack",c="tiled";return t.prototype={type:s.COMPONENT_TYPE_TOOLBOX,_buildShape:function(){this._iconList=[];var e=this.option.toolbox;this._enableColor=e.effectiveColor,this._disableColor=e.disableColor;var t=e.feature,i=[];for(var n in t)if(t[n].show)switch(n){case"mark":i.push({key:n,name:"mark"}),i.push({key:n,name:"markUndo"}),i.push({key:n,name:"markClear"});break;case"magicType":for(var a=0,o=t[n].type.length;o>a;a++)t[n].title[t[n].type[a]+"Chart"]=t[n].title[t[n].type[a]],t[n].option&&(t[n].option[t[n].type[a]+"Chart"]=t[n].option[t[n].type[a]]),i.push({key:n,name:t[n].type[a]+"Chart"});break;case"dataZoom":i.push({key:n,name:"dataZoom"}),i.push({key:n,name:"dataZoomReset"});break;case"saveAsImage":this.canvasSupported&&i.push({key:n,name:"saveAsImage"});break;default:i.push({key:n,name:n})}if(i.length>0){for(var r,n,a=0,o=i.length;o>a;a++)r=i[a].name,n=i[a].key,this._iconList.push(r),this._featureTitle[r]=t[n].title[r]||t[n].title,t[n].icon&&(this._featureIcon[r]=t[n].icon[r]||t[n].icon),t[n].color&&(this._featureColor[r]=t[n].color[r]||t[n].color),t[n].option&&(this._featureOption[r]=t[n].option[r]||t[n].option);this._itemGroupLocation=this._getItemGroupLocation(),this._buildBackground(),this._buildItem();for(var a=0,o=this.shapeList.length;o>a;a++)this.zr.addShape(this.shapeList[a]);this._iconShapeMap.mark&&(this._iconDisable(this._iconShapeMap.markUndo),this._iconDisable(this._iconShapeMap.markClear)),this._iconShapeMap.dataZoomReset&&0===this._zoomQueue.length&&this._iconDisable(this._iconShapeMap.dataZoomReset)}},_buildItem:function(){var t,i,n,o,s=this.option.toolbox,l=this._iconList.length,h=this._itemGroupLocation.x,d=this._itemGroupLocation.y,m=s.itemSize,c=s.itemGap,p=s.color instanceof Array?s.color:[s.color],u=this.getFont(s.textStyle);"horizontal"===s.orient?(i=this._itemGroupLocation.y/this.zr.getHeight()<.5?"bottom":"top",n=this._itemGroupLocation.x/this.zr.getWidth()<.5?"left":"right",o=this._itemGroupLocation.y/this.zr.getHeight()<.5?"top":"bottom"):i=this._itemGroupLocation.x/this.zr.getWidth()<.5?"right":"left",this._iconShapeMap={};for(var V=this,U=0;l>U;U++){switch(t={type:"icon",zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:h,y:d,width:m,height:m,iconType:this._iconList[U],lineWidth:1,strokeColor:this._featureColor[this._iconList[U]]||p[U%p.length],brushType:"stroke"},highlightStyle:{lineWidth:1,text:s.showTitle?this._featureTitle[this._iconList[U]]:void 0,textFont:u,textPosition:i,strokeColor:this._featureColor[this._iconList[U]]||p[U%p.length]},hoverable:!0,clickable:!0},this._featureIcon[this._iconList[U]]&&(t.style.image=this._featureIcon[this._iconList[U]].replace(new RegExp("^image:\\/\\/"),""),t.style.opacity=.8,t.highlightStyle.opacity=1,t.type="image"),"horizontal"===s.orient&&(0===U&&"left"===n&&(t.highlightStyle.textPosition="specific",t.highlightStyle.textAlign=n,t.highlightStyle.textBaseline=o,t.highlightStyle.textX=h,t.highlightStyle.textY="top"===o?d+m+10:d-10),U===l-1&&"right"===n&&(t.highlightStyle.textPosition="specific",t.highlightStyle.textAlign=n,t.highlightStyle.textBaseline=o,t.highlightStyle.textX=h+m,t.highlightStyle.textY="top"===o?d+m+10:d-10)),this._iconList[U]){case"mark":t.onclick=V._onMark;break;case"markUndo":t.onclick=V._onMarkUndo;break;case"markClear":t.onclick=V._onMarkClear;break;case"dataZoom":t.onclick=V._onDataZoom;break;case"dataZoomReset":t.onclick=V._onDataZoomReset;break;case"dataView":if(!this._dataView){var g=e("./dataView");this._dataView=new g(this.ecTheme,this.messageCenter,this.zr,this.option,this.myChart)}t.onclick=V._onDataView;break;case"restore":t.onclick=V._onRestore;break;case"saveAsImage":t.onclick=V._onSaveAsImage;break;default:this._iconList[U].match("Chart")?(t._name=this._iconList[U].replace("Chart",""),t.onclick=V._onMagicType):t.onclick=V._onCustomHandler}"icon"===t.type?t=new r(t):"image"===t.type&&(t=new a(t)),this.shapeList.push(t),this._iconShapeMap[this._iconList[U]]=t,"horizontal"===s.orient?h+=m+c:d+=m+c}},_buildBackground:function(){var e=this.option.toolbox,t=this.reformCssArray(this.option.toolbox.padding);this.shapeList.push(new o({zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this._itemGroupLocation.x-t[3],y:this._itemGroupLocation.y-t[0],width:this._itemGroupLocation.width+t[3]+t[1],height:this._itemGroupLocation.height+t[0]+t[2],brushType:0===e.borderWidth?"fill":"both",color:e.backgroundColor,strokeColor:e.borderColor,lineWidth:e.borderWidth}}))},_getItemGroupLocation:function(){var e=this.option.toolbox,t=this.reformCssArray(this.option.toolbox.padding),i=this._iconList.length,n=e.itemGap,a=e.itemSize,o=0,r=0;"horizontal"===e.orient?(o=(a+n)*i-n,r=a):(r=(a+n)*i-n,o=a);var s,l=this.zr.getWidth();switch(e.x){case"center":s=Math.floor((l-o)/2);break;case"left":s=t[3]+e.borderWidth;break;case"right":s=l-o-t[1]-e.borderWidth;break;default:s=e.x-0,s=isNaN(s)?0:s}var h,d=this.zr.getHeight();switch(e.y){case"top":h=t[0]+e.borderWidth;break;case"bottom":h=d-r-t[2]-e.borderWidth;break;case"center":h=Math.floor((d-r)/2);break;default:h=e.y-0,h=isNaN(h)?0:h}return{x:s,y:h,width:o,height:r}},__onmousemove:function(e){this._marking&&(this._markShape.style.xEnd=d.getX(e.event),this._markShape.style.yEnd=d.getY(e.event),this.zr.addHoverShape(this._markShape)),this._zooming&&(this._zoomShape.style.width=d.getX(e.event)-this._zoomShape.style.x,this._zoomShape.style.height=d.getY(e.event)-this._zoomShape.style.y,this.zr.addHoverShape(this._zoomShape),this.dom.style.cursor="crosshair",d.stop(e.event)),this._zoomStart&&"pointer"!=this.dom.style.cursor&&"move"!=this.dom.style.cursor&&(this.dom.style.cursor="crosshair")},__onmousedown:function(e){if(!e.target){this._zooming=!0;var t=d.getX(e.event),i=d.getY(e.event),n=this.option.dataZoom||{};return this._zoomShape=new o({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:t,y:i,width:1,height:1,brushType:"both"},highlightStyle:{lineWidth:2,color:n.fillerColor||s.dataZoom.fillerColor,strokeColor:n.handleColor||s.dataZoom.handleColor,brushType:"both"}}),this.zr.addHoverShape(this._zoomShape),!0}},__onmouseup:function(){if(!this._zoomShape||Math.abs(this._zoomShape.style.width)<10||Math.abs(this._zoomShape.style.height)<10)return this._zooming=!1,!0;if(this._zooming&&this.component.dataZoom){this._zooming=!1;var e=this.component.dataZoom.rectZoom(this._zoomShape.style);e&&(this._zoomQueue.push({start:e.start,end:e.end,start2:e.start2,end2:e.end2}),this._iconEnable(this._iconShapeMap.dataZoomReset),this.zr.refreshNextFrame())}return!0},__onclick:function(e){if(!e.target)if(this._marking)this._marking=!1,this._markShapeList.push(this._markShape),this._iconEnable(this._iconShapeMap.markUndo),this._iconEnable(this._iconShapeMap.markClear),this.zr.addShape(this._markShape),this.zr.refreshNextFrame();else if(this._markStart){this._marking=!0;var t=d.getX(e.event),i=d.getY(e.event);this._markShape=new n({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{xStart:t,yStart:i,xEnd:t,yEnd:i,lineWidth:this.query(this.option,"toolbox.feature.mark.lineStyle.width"),strokeColor:this.query(this.option,"toolbox.feature.mark.lineStyle.color"),lineType:this.query(this.option,"toolbox.feature.mark.lineStyle.type")}}),this.zr.addHoverShape(this._markShape)}},__onMark:function(e){var t=e.target;if(this._marking||this._markStart)this._resetMark(),this.zr.refreshNextFrame();else{this._resetZoom(),this.zr.modShape(t.id,{style:{strokeColor:this._enableColor}}),this.zr.refreshNextFrame(),this._markStart=!0;var i=this;setTimeout(function(){i.zr&&i.zr.on(h.EVENT.CLICK,i._onclick)&&i.zr.on(h.EVENT.MOUSEMOVE,i._onmousemove)},10)}return!0},__onMarkUndo:function(){if(this._marking)this._marking=!1;else{var e=this._markShapeList.length;if(e>=1){var t=this._markShapeList[e-1];this.zr.delShape(t.id),this.zr.refreshNextFrame(),this._markShapeList.pop(),1===e&&(this._iconDisable(this._iconShapeMap.markUndo),this._iconDisable(this._iconShapeMap.markClear))}}return!0},__onMarkClear:function(){this._marking&&(this._marking=!1);var e=this._markShapeList.length;if(e>0){for(;e--;)this.zr.delShape(this._markShapeList.pop().id);this._iconDisable(this._iconShapeMap.markUndo),this._iconDisable(this._iconShapeMap.markClear),this.zr.refreshNextFrame()}return!0},__onDataZoom:function(e){var t=e.target;if(this._zooming||this._zoomStart)this._resetZoom(),this.zr.refreshNextFrame(),this.dom.style.cursor="default";else{this._resetMark(),this.zr.modShape(t.id,{style:{strokeColor:this._enableColor}}),this.zr.refreshNextFrame(),this._zoomStart=!0;var i=this;setTimeout(function(){i.zr&&i.zr.on(h.EVENT.MOUSEDOWN,i._onmousedown)&&i.zr.on(h.EVENT.MOUSEUP,i._onmouseup)&&i.zr.on(h.EVENT.MOUSEMOVE,i._onmousemove)},10),this.dom.style.cursor="crosshair"}return!0},__onDataZoomReset:function(){return this._zooming&&(this._zooming=!1),this._zoomQueue.pop(),this._zoomQueue.length>0?this.component.dataZoom.absoluteZoom(this._zoomQueue[this._zoomQueue.length-1]):(this.component.dataZoom.rectZoom(),this._iconDisable(this._iconShapeMap.dataZoomReset),this.zr.refreshNextFrame()),!0},_resetMark:function(){this._marking=!1,this._markStart&&(this._markStart=!1,this._iconShapeMap.mark&&this.zr.modShape(this._iconShapeMap.mark.id,{style:{strokeColor:this._iconShapeMap.mark.highlightStyle.strokeColor}}),this.zr.un(h.EVENT.CLICK,this._onclick),this.zr.un(h.EVENT.MOUSEMOVE,this._onmousemove))},_resetZoom:function(){this._zooming=!1,this._zoomStart&&(this._zoomStart=!1,this._iconShapeMap.dataZoom&&this.zr.modShape(this._iconShapeMap.dataZoom.id,{style:{strokeColor:this._iconShapeMap.dataZoom.highlightStyle.strokeColor}}),this.zr.un(h.EVENT.MOUSEDOWN,this._onmousedown),this.zr.un(h.EVENT.MOUSEUP,this._onmouseup),this.zr.un(h.EVENT.MOUSEMOVE,this._onmousemove))},_iconDisable:function(e){"image"!=e.type?this.zr.modShape(e.id,{hoverable:!1,clickable:!1,style:{strokeColor:this._disableColor}}):this.zr.modShape(e.id,{hoverable:!1,clickable:!1,style:{opacity:.3}})},_iconEnable:function(e){"image"!=e.type?this.zr.modShape(e.id,{hoverable:!0,clickable:!0,style:{strokeColor:e.highlightStyle.strokeColor}}):this.zr.modShape(e.id,{hoverable:!0,clickable:!0,style:{opacity:.8}})},__onDataView:function(){return this._dataView.show(this.option),!0},__onRestore:function(){return this._resetMark(),this._resetZoom(),this.messageCenter.dispatch(s.EVENT.RESTORE,null,null,this.myChart),!0},__onSaveAsImage:function(){var e=this.option.toolbox.feature.saveAsImage,t=e.type||"png";"png"!=t&&"jpeg"!=t&&(t="png");var i;i=this.myChart.isConnected()?this.myChart.getConnectedDataURL(t):this.zr.toDataURL("image/"+t,this.option.backgroundColor&&"rgba(0,0,0,0)"===this.option.backgroundColor.replace(" ","")?"#fff":this.option.backgroundColor);var n=document.createElement("div");n.id="__echarts_download_wrap__",n.style.cssText="position:fixed;z-index:99999;display:block;top:0;left:0;background-color:rgba(33,33,33,0.5);text-align:center;width:100%;height:100%;line-height:"+document.documentElement.clientHeight+"px;";var a=document.createElement("a");a.href=i,a.setAttribute("download",(e.name?e.name:this.option.title&&(this.option.title.text||this.option.title.subtext)?this.option.title.text||this.option.title.subtext:"ECharts")+"."+t),a.innerHTML='图片另存为":e.lang?e.lang[0]:"点击保存")+'"/>',n.appendChild(a),document.body.appendChild(n),a=null,n=null,setTimeout(function(){var e=document.getElementById("__echarts_download_wrap__");e&&(e.onclick=function(){var e=document.getElementById("__echarts_download_wrap__");e.onclick=null,e.innerHTML="",document.body.removeChild(e),e=null},e=null)},500)},__onMagicType:function(e){this._resetMark();var t=e.target._name;return this._magicType[t]||(this._magicType[t]=!0,t===s.CHART_TYPE_LINE?this._magicType[s.CHART_TYPE_BAR]=!1:t===s.CHART_TYPE_BAR&&(this._magicType[s.CHART_TYPE_LINE]=!1),t===s.CHART_TYPE_PIE?this._magicType[s.CHART_TYPE_FUNNEL]=!1:t===s.CHART_TYPE_FUNNEL&&(this._magicType[s.CHART_TYPE_PIE]=!1),t===s.CHART_TYPE_FORCE?this._magicType[s.CHART_TYPE_CHORD]=!1:t===s.CHART_TYPE_CHORD&&(this._magicType[s.CHART_TYPE_FORCE]=!1),t===m?this._magicType[c]=!1:t===c&&(this._magicType[m]=!1),this.messageCenter.dispatch(s.EVENT.MAGIC_TYPE_CHANGED,e.event,{magicType:this._magicType},this.myChart)),!0},setMagicType:function(e){this._resetMark(),this._magicType=e,!this._isSilence&&this.messageCenter.dispatch(s.EVENT.MAGIC_TYPE_CHANGED,null,{magicType:this._magicType},this.myChart)},__onCustomHandler:function(e){var t=e.target.style.iconType,i=this.option.toolbox.feature[t].onclick;"function"==typeof i&&i.call(this,this.option)},reset:function(e,t){if(t&&this.clear(),this.query(e,"toolbox.show")&&this.query(e,"toolbox.feature.magicType.show")){var i=e.toolbox.feature.magicType.type,n=i.length;for(this._magicMap={};n--;)this._magicMap[i[n]]=!0;n=e.series.length;for(var a,o;n--;)a=e.series[n].type,this._magicMap[a]&&(o=e.xAxis instanceof Array?e.xAxis[e.series[n].xAxisIndex||0]:e.xAxis,o&&"category"===(o.type||"category")&&(o.__boundaryGap=null!=o.boundaryGap?o.boundaryGap:!0),o=e.yAxis instanceof Array?e.yAxis[e.series[n].yAxisIndex||0]:e.yAxis,o&&"category"===o.type&&(o.__boundaryGap=null!=o.boundaryGap?o.boundaryGap:!0),e.series[n].__type=a,e.series[n].__itemStyle=l.clone(e.series[n].itemStyle||{})),(this._magicMap[m]||this._magicMap[c])&&(e.series[n].__stack=e.series[n].stack)}this._magicType=t?{}:this._magicType||{};for(var r in this._magicType)if(this._magicType[r]){this.option=e,this.getMagicOption();break}var s=e.dataZoom;if(s&&s.show){var h=null!=s.start&&s.start>=0&&s.start<=100?s.start:0,d=null!=s.end&&s.end>=0&&s.end<=100?s.end:100;h>d&&(h+=d,d=h-d,h-=d),this._zoomQueue=[{start:h,end:d,start2:0,end2:100}]}else this._zoomQueue=[]},getMagicOption:function(){var e,t;if(this._magicType[s.CHART_TYPE_LINE]||this._magicType[s.CHART_TYPE_BAR]){for(var i=this._magicType[s.CHART_TYPE_LINE]?!1:!0,n=0,a=this.option.series.length;a>n;n++)t=this.option.series[n].type,(t==s.CHART_TYPE_LINE||t==s.CHART_TYPE_BAR)&&(e=this.option.xAxis instanceof Array?this.option.xAxis[this.option.series[n].xAxisIndex||0]:this.option.xAxis,e&&"category"===(e.type||"category")&&(e.boundaryGap=i?!0:e.__boundaryGap),e=this.option.yAxis instanceof Array?this.option.yAxis[this.option.series[n].yAxisIndex||0]:this.option.yAxis,e&&"category"===e.type&&(e.boundaryGap=i?!0:e.__boundaryGap));this._defaultMagic(s.CHART_TYPE_LINE,s.CHART_TYPE_BAR)}if(this._defaultMagic(s.CHART_TYPE_CHORD,s.CHART_TYPE_FORCE),this._defaultMagic(s.CHART_TYPE_PIE,s.CHART_TYPE_FUNNEL),this._magicType[m]||this._magicType[c])for(var n=0,a=this.option.series.length;a>n;n++)this._magicType[m]?(this.option.series[n].stack="_ECHARTS_STACK_KENER_2014_",t=m):this._magicType[c]&&(this.option.series[n].stack=null,t=c),this._featureOption[t+"Chart"]&&l.merge(this.option.series[n],this._featureOption[t+"Chart"]||{},!0);return this.option},_defaultMagic:function(e,t){if(this._magicType[e]||this._magicType[t])for(var i=0,n=this.option.series.length;n>i;i++){var a=this.option.series[i].type;(a==e||a==t)&&(this.option.series[i].type=this._magicType[e]?e:t,this.option.series[i].itemStyle=l.clone(this.option.series[i].__itemStyle),a=this.option.series[i].type,this._featureOption[a+"Chart"]&&l.merge(this.option.series[i],this._featureOption[a+"Chart"]||{},!0))}},silence:function(e){this._isSilence=e},resize:function(){this._resetMark(),this.clear(),this.option&&this.option.toolbox&&this.option.toolbox.show&&this._buildShape(),this._dataView&&this._dataView.resize()},hideDataView:function(){this._dataView&&this._dataView.hide()},clear:function(e){this.zr&&(this.zr.delShape(this.shapeList),this.shapeList=[],e||(this.zr.delShape(this._markShapeList),this._markShapeList=[]))},onbeforDispose:function(){this._dataView&&(this._dataView.dispose(),this._dataView=null),this._markShapeList=null},refresh:function(e){e&&(this._resetMark(),this._resetZoom(),e.toolbox=this.reformOption(e.toolbox),this.option=e,this.clear(!0),e.toolbox.show&&this._buildShape(),this.hideDataView())}},l.inherits(t,i),e("../component").define("toolbox",t),t}),define("echarts/component",[],function(){var e={},t={};return e.define=function(i,n){return t[i]=n,e},e.get=function(e){return t[e]},e}),define("echarts/component/title",["require","./base","zrender/shape/Text","zrender/shape/Rectangle","../config","zrender/tool/util","zrender/tool/area","zrender/tool/color","../component"],function(e){function t(e,t,n,a,o){i.call(this,e,t,n,a,o),this.refresh(a)}var i=e("./base"),n=e("zrender/shape/Text"),a=e("zrender/shape/Rectangle"),o=e("../config");o.title={zlevel:0,z:6,show:!0,text:"",subtext:"",x:"left",y:"top",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:5,textStyle:{fontSize:18,fontWeight:"bolder",color:"#333"},subtextStyle:{color:"#aaa"}};var r=e("zrender/tool/util"),s=e("zrender/tool/area"),l=e("zrender/tool/color");return t.prototype={type:o.COMPONENT_TYPE_TITLE,_buildShape:function(){if(this.titleOption.show){this._itemGroupLocation=this._getItemGroupLocation(),this._buildBackground(),this._buildItem();for(var e=0,t=this.shapeList.length;t>e;e++)this.zr.addShape(this.shapeList[e])}},_buildItem:function(){var e=this.titleOption.text,t=this.titleOption.link,i=this.titleOption.target,a=this.titleOption.subtext,o=this.titleOption.sublink,r=this.titleOption.subtarget,s=this.getFont(this.titleOption.textStyle),h=this.getFont(this.titleOption.subtextStyle),d=this._itemGroupLocation.x,m=this._itemGroupLocation.y,c=this._itemGroupLocation.width,p=this._itemGroupLocation.height,u={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{y:m,color:this.titleOption.textStyle.color,text:e,textFont:s,textBaseline:"top"},highlightStyle:{color:l.lift(this.titleOption.textStyle.color,1),brushType:"fill"},hoverable:!1};t&&(u.hoverable=!0,u.clickable=!0,u.onclick=function(){i&&"self"==i?window.location=t:window.open(t)});var V={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{y:m+p,color:this.titleOption.subtextStyle.color,text:a,textFont:h,textBaseline:"bottom"},highlightStyle:{color:l.lift(this.titleOption.subtextStyle.color,1),brushType:"fill"},hoverable:!1};switch(o&&(V.hoverable=!0,V.clickable=!0,V.onclick=function(){r&&"self"==r?window.location=o:window.open(o)}),this.titleOption.x){case"center":u.style.x=V.style.x=d+c/2,u.style.textAlign=V.style.textAlign="center";break;case"left":u.style.x=V.style.x=d,u.style.textAlign=V.style.textAlign="left";break;case"right":u.style.x=V.style.x=d+c,u.style.textAlign=V.style.textAlign="right";break;default:d=this.titleOption.x-0,d=isNaN(d)?0:d,u.style.x=V.style.x=d}this.titleOption.textAlign&&(u.style.textAlign=V.style.textAlign=this.titleOption.textAlign),this.shapeList.push(new n(u)),""!==a&&this.shapeList.push(new n(V))},_buildBackground:function(){var e=this.reformCssArray(this.titleOption.padding); +this.shapeList.push(new a({zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this._itemGroupLocation.x-e[3],y:this._itemGroupLocation.y-e[0],width:this._itemGroupLocation.width+e[3]+e[1],height:this._itemGroupLocation.height+e[0]+e[2],brushType:0===this.titleOption.borderWidth?"fill":"both",color:this.titleOption.backgroundColor,strokeColor:this.titleOption.borderColor,lineWidth:this.titleOption.borderWidth}}))},_getItemGroupLocation:function(){var e,t=this.reformCssArray(this.titleOption.padding),i=this.titleOption.text,n=this.titleOption.subtext,a=this.getFont(this.titleOption.textStyle),o=this.getFont(this.titleOption.subtextStyle),r=Math.max(s.getTextWidth(i,a),s.getTextWidth(n,o)),l=s.getTextHeight(i,a)+(""===n?0:this.titleOption.itemGap+s.getTextHeight(n,o)),h=this.zr.getWidth();switch(this.titleOption.x){case"center":e=Math.floor((h-r)/2);break;case"left":e=t[3]+this.titleOption.borderWidth;break;case"right":e=h-r-t[1]-this.titleOption.borderWidth;break;default:e=this.titleOption.x-0,e=isNaN(e)?0:e}var d,m=this.zr.getHeight();switch(this.titleOption.y){case"top":d=t[0]+this.titleOption.borderWidth;break;case"bottom":d=m-l-t[2]-this.titleOption.borderWidth;break;case"center":d=Math.floor((m-l)/2);break;default:d=this.titleOption.y-0,d=isNaN(d)?0:d}return{x:e,y:d,width:r,height:l}},refresh:function(e){e&&(this.option=e,this.option.title=this.reformOption(this.option.title),this.titleOption=this.option.title,this.titleOption.textStyle=this.getTextStyle(this.titleOption.textStyle),this.titleOption.subtextStyle=this.getTextStyle(this.titleOption.subtextStyle)),this.clear(),this._buildShape()}},r.inherits(t,i),e("../component").define("title",t),t}),define("echarts/component/tooltip",["require","./base","../util/shape/Cross","zrender/shape/Line","zrender/shape/Rectangle","../config","../util/ecData","zrender/config","zrender/tool/event","zrender/tool/area","zrender/tool/color","zrender/tool/util","zrender/shape/Base","../component"],function(e){function t(e,t,o,r,s){i.call(this,e,t,o,r,s),this.dom=s.dom;var l=this;l._onmousemove=function(e){return l.__onmousemove(e)},l._onglobalout=function(e){return l.__onglobalout(e)},this.zr.on(h.EVENT.MOUSEMOVE,l._onmousemove),this.zr.on(h.EVENT.GLOBALOUT,l._onglobalout),l._hide=function(e){return l.__hide(e)},l._tryShow=function(e){return l.__tryShow(e)},l._refixed=function(e){return l.__refixed(e)},l._setContent=function(e,t){return l.__setContent(e,t)},this._tDom=this._tDom||document.createElement("div"),this._tDom.onselectstart=function(){return!1},this._tDom.onmouseover=function(){l._mousein=!0},this._tDom.onmouseout=function(){l._mousein=!1},this._tDom.className="echarts-tooltip",this._tDom.style.position="absolute",this.hasAppend=!1,this._axisLineShape&&this.zr.delShape(this._axisLineShape.id),this._axisLineShape=new a({zlevel:this.getZlevelBase(),z:this.getZBase(),invisible:!0,hoverable:!1}),this.shapeList.push(this._axisLineShape),this.zr.addShape(this._axisLineShape),this._axisShadowShape&&this.zr.delShape(this._axisShadowShape.id),this._axisShadowShape=new a({zlevel:this.getZlevelBase(),z:1,invisible:!0,hoverable:!1}),this.shapeList.push(this._axisShadowShape),this.zr.addShape(this._axisShadowShape),this._axisCrossShape&&this.zr.delShape(this._axisCrossShape.id),this._axisCrossShape=new n({zlevel:this.getZlevelBase(),z:this.getZBase(),invisible:!0,hoverable:!1}),this.shapeList.push(this._axisCrossShape),this.zr.addShape(this._axisCrossShape),this.showing=!1,this.refresh(r)}var i=e("./base"),n=e("../util/shape/Cross"),a=e("zrender/shape/Line"),o=e("zrender/shape/Rectangle"),r=new o({}),s=e("../config");s.tooltip={zlevel:1,z:8,show:!0,showContent:!0,trigger:"item",islandFormatter:"{a}
{b} : {c}",showDelay:20,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"rgba(0,0,0,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,axisPointer:{type:"line",lineStyle:{color:"#48b",width:2,type:"solid"},crossStyle:{color:"#1e90ff",width:1,type:"dashed"},shadowStyle:{color:"rgba(150,150,150,0.3)",width:"auto",type:"default"}},textStyle:{color:"#fff"}};var l=e("../util/ecData"),h=e("zrender/config"),d=e("zrender/tool/event"),m=e("zrender/tool/area"),c=e("zrender/tool/color"),p=e("zrender/tool/util"),u=e("zrender/shape/Base");return t.prototype={type:s.COMPONENT_TYPE_TOOLTIP,_gCssText:"position:absolute;display:block;border-style:solid;white-space:nowrap;",_style:function(e){if(!e)return"";var t=[];if(e.transitionDuration){var i="left "+e.transitionDuration+"s,top "+e.transitionDuration+"s";t.push("transition:"+i),t.push("-moz-transition:"+i),t.push("-webkit-transition:"+i),t.push("-o-transition:"+i)}e.backgroundColor&&(t.push("background-Color:"+c.toHex(e.backgroundColor)),t.push("filter:alpha(opacity=70)"),t.push("background-Color:"+e.backgroundColor)),null!=e.borderWidth&&t.push("border-width:"+e.borderWidth+"px"),null!=e.borderColor&&t.push("border-color:"+e.borderColor),null!=e.borderRadius&&(t.push("border-radius:"+e.borderRadius+"px"),t.push("-moz-border-radius:"+e.borderRadius+"px"),t.push("-webkit-border-radius:"+e.borderRadius+"px"),t.push("-o-border-radius:"+e.borderRadius+"px"));var n=e.textStyle;n&&(n.color&&t.push("color:"+n.color),n.decoration&&t.push("text-decoration:"+n.decoration),n.align&&t.push("text-align:"+n.align),n.fontFamily&&t.push("font-family:"+n.fontFamily),n.fontSize&&t.push("font-size:"+n.fontSize+"px"),n.fontSize&&t.push("line-height:"+Math.round(3*n.fontSize/2)+"px"),n.fontStyle&&t.push("font-style:"+n.fontStyle),n.fontWeight&&t.push("font-weight:"+n.fontWeight));var a=e.padding;return null!=a&&(a=this.reformCssArray(a),t.push("padding:"+a[0]+"px "+a[1]+"px "+a[2]+"px "+a[3]+"px")),t=t.join(";")+";"},__hide:function(){this._lastDataIndex=-1,this._lastSeriesIndex=-1,this._lastItemTriggerId=-1,this._tDom&&(this._tDom.style.display="none");var e=!1;this._axisLineShape.invisible||(this._axisLineShape.invisible=!0,this.zr.modShape(this._axisLineShape.id),e=!0),this._axisShadowShape.invisible||(this._axisShadowShape.invisible=!0,this.zr.modShape(this._axisShadowShape.id),e=!0),this._axisCrossShape.invisible||(this._axisCrossShape.invisible=!0,this.zr.modShape(this._axisCrossShape.id),e=!0),this._lastTipShape&&this._lastTipShape.tipShape.length>0&&(this.zr.delShape(this._lastTipShape.tipShape),this._lastTipShape=!1,this.shapeList.length=2),e&&this.zr.refreshNextFrame(),this.showing=!1},_show:function(e,t,i,n){var a=this._tDom.offsetHeight,o=this._tDom.offsetWidth;e&&("function"==typeof e&&(e=e([t,i])),e instanceof Array&&(t=e[0],i=e[1])),t+o>this._zrWidth&&(t-=o+40),i+a>this._zrHeight&&(i-=a-20),20>i&&(i=0),this._tDom.style.cssText=this._gCssText+this._defaultCssText+(n?n:"")+"left:"+t+"px;top:"+i+"px;",(10>a||10>o)&&setTimeout(this._refixed,20),this.showing=!0},__refixed:function(){if(this._tDom){var e="",t=this._tDom.offsetHeight,i=this._tDom.offsetWidth;this._tDom.offsetLeft+i>this._zrWidth&&(e+="left:"+(this._zrWidth-i-20)+"px;"),this._tDom.offsetTop+t>this._zrHeight&&(e+="top:"+(this._zrHeight-t-10)+"px;"),""!==e&&(this._tDom.style.cssText+=e)}},__tryShow:function(){var e,t;if(this._curTarget){if("island"===this._curTarget._type&&this.option.tooltip.show)return void this._showItemTrigger();var i=l.get(this._curTarget,"series"),n=l.get(this._curTarget,"data");e=this.deepQuery([n,i,this.option],"tooltip.show"),null!=i&&null!=n&&e?(t=this.deepQuery([n,i,this.option],"tooltip.trigger"),"axis"===t?this._showAxisTrigger(i.xAxisIndex,i.yAxisIndex,l.get(this._curTarget,"dataIndex")):this._showItemTrigger()):(clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this._hidingTicket=setTimeout(this._hide,this._hideDelay))}else this._findPolarTrigger()||this._findAxisTrigger()},_findAxisTrigger:function(){if(!this.component.xAxis||!this.component.yAxis)return void(this._hidingTicket=setTimeout(this._hide,this._hideDelay));for(var e,t,i=this.option.series,n=0,a=i.length;a>n;n++)if("axis"===this.deepQuery([i[n],this.option],"tooltip.trigger"))return e=i[n].xAxisIndex||0,t=i[n].yAxisIndex||0,this.component.xAxis.getAxis(e)&&this.component.xAxis.getAxis(e).type===s.COMPONENT_TYPE_AXIS_CATEGORY?void this._showAxisTrigger(e,t,this._getNearestDataIndex("x",this.component.xAxis.getAxis(e))):this.component.yAxis.getAxis(t)&&this.component.yAxis.getAxis(t).type===s.COMPONENT_TYPE_AXIS_CATEGORY?void this._showAxisTrigger(e,t,this._getNearestDataIndex("y",this.component.yAxis.getAxis(t))):void this._showAxisTrigger(e,t,-1);"cross"===this.option.tooltip.axisPointer.type&&this._showAxisTrigger(-1,-1,-1)},_findPolarTrigger:function(){if(!this.component.polar)return!1;var e,t=d.getX(this._event),i=d.getY(this._event),n=this.component.polar.getNearestIndex([t,i]);return n?(e=n.valueIndex,n=n.polarIndex):n=-1,-1!=n?this._showPolarTrigger(n,e):!1},_getNearestDataIndex:function(e,t){var i=-1,n=d.getX(this._event),a=d.getY(this._event);if("x"===e){for(var o,r,s=this.component.grid.getXend(),l=t.getCoordByIndex(i);s>l&&(r=l,n>=l);)o=l,l=t.getCoordByIndex(++i);return 0>=i?i=0:r-n>=n-o?i-=1:null==t.getNameByIndex(i)&&(i-=1),i}for(var h,m,c=this.component.grid.getY(),l=t.getCoordByIndex(i);l>c&&(h=l,l>=a);)m=l,l=t.getCoordByIndex(++i);return 0>=i?i=0:a-h>=m-a?i-=1:null==t.getNameByIndex(i)&&(i-=1),i},_showAxisTrigger:function(e,t,i){if(!this._event.connectTrigger&&this.messageCenter.dispatch(s.EVENT.TOOLTIP_IN_GRID,this._event,null,this.myChart),null==this.component.xAxis||null==this.component.yAxis||null==e||null==t)return clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),void(this._hidingTicket=setTimeout(this._hide,this._hideDelay));var n,a,o,r,l=this.option.series,h=[],m=[],c="";if("axis"===this.option.tooltip.trigger){if(!this.option.tooltip.show)return;a=this.option.tooltip.formatter,o=this.option.tooltip.position}var p,u,V=-1!=e&&this.component.xAxis.getAxis(e).type===s.COMPONENT_TYPE_AXIS_CATEGORY?"xAxis":-1!=t&&this.component.yAxis.getAxis(t).type===s.COMPONENT_TYPE_AXIS_CATEGORY?"yAxis":!1;if(V){var U="xAxis"==V?e:t;n=this.component[V].getAxis(U);for(var g=0,y=l.length;y>g;g++)this._isSelected(l[g].name)&&l[g][V+"Index"]===U&&"axis"===this.deepQuery([l[g],this.option],"tooltip.trigger")&&(r=this.query(l[g],"tooltip.showContent")||r,a=this.query(l[g],"tooltip.formatter")||a,o=this.query(l[g],"tooltip.position")||o,c+=this._style(this.query(l[g],"tooltip")),null!=l[g].stack&&"xAxis"==V?(h.unshift(l[g]),m.unshift(g)):(h.push(l[g]),m.push(g)));this.messageCenter.dispatch(s.EVENT.TOOLTIP_HOVER,this._event,{seriesIndex:m,dataIndex:i},this.myChart);var f;"xAxis"==V?(p=this.subPixelOptimize(n.getCoordByIndex(i),this._axisLineWidth),u=d.getY(this._event),f=[p,this.component.grid.getY(),p,this.component.grid.getYend()]):(p=d.getX(this._event),u=this.subPixelOptimize(n.getCoordByIndex(i),this._axisLineWidth),f=[this.component.grid.getX(),u,this.component.grid.getXend(),u]),this._styleAxisPointer(h,f[0],f[1],f[2],f[3],n.getGap(),p,u)}else p=d.getX(this._event),u=d.getY(this._event),this._styleAxisPointer(l,this.component.grid.getX(),u,this.component.grid.getXend(),u,0,p,u),i>=0?this._showItemTrigger(!0):(clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this._tDom.style.display="none");if(h.length>0){if(this._lastItemTriggerId=-1,this._lastDataIndex!=i||this._lastSeriesIndex!=m[0]){this._lastDataIndex=i,this._lastSeriesIndex=m[0];var b,_;if("function"==typeof a){for(var x=[],g=0,y=h.length;y>g;g++)b=h[g].data[i],_=this.getDataFromOption(b,"-"),x.push({seriesIndex:m[g],seriesName:h[g].name||"",series:h[g],dataIndex:i,data:b,name:n.getNameByIndex(i),value:_,0:h[g].name||"",1:n.getNameByIndex(i),2:_,3:b});this._curTicket="axis:"+i,this._tDom.innerHTML=a.call(this.myChart,x,this._curTicket,this._setContent)}else if("string"==typeof a){this._curTicket=0/0,a=a.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}");for(var g=0,y=h.length;y>g;g++)a=a.replace("{a"+g+"}",this._encodeHTML(h[g].name||"")),a=a.replace("{b"+g+"}",this._encodeHTML(n.getNameByIndex(i))),b=h[g].data[i],b=this.getDataFromOption(b,"-"),a=a.replace("{c"+g+"}",b instanceof Array?b:this.numAddCommas(b));this._tDom.innerHTML=a}else{this._curTicket=0/0,a=this._encodeHTML(n.getNameByIndex(i));for(var g=0,y=h.length;y>g;g++)a+="
"+this._encodeHTML(h[g].name||"")+" : ",b=h[g].data[i],b=this.getDataFromOption(b,"-"),a+=b instanceof Array?b:this.numAddCommas(b);this._tDom.innerHTML=a}}if(r===!1||!this.option.tooltip.showContent)return;this.hasAppend||(this._tDom.style.left=this._zrWidth/2+"px",this._tDom.style.top=this._zrHeight/2+"px",this.dom.firstChild.appendChild(this._tDom),this.hasAppend=!0),this._show(o,p+10,u+10,c)}},_showPolarTrigger:function(e,t){if(null==this.component.polar||null==e||null==t||0>t)return!1;var i,n,a,o=this.option.series,r=[],s=[],l="";if("axis"===this.option.tooltip.trigger){if(!this.option.tooltip.show)return!1;i=this.option.tooltip.formatter,n=this.option.tooltip.position}for(var h=this.option.polar[e].indicator[t].text,m=0,c=o.length;c>m;m++)this._isSelected(o[m].name)&&o[m].polarIndex===e&&"axis"===this.deepQuery([o[m],this.option],"tooltip.trigger")&&(a=this.query(o[m],"tooltip.showContent")||a,i=this.query(o[m],"tooltip.formatter")||i,n=this.query(o[m],"tooltip.position")||n,l+=this._style(this.query(o[m],"tooltip")),r.push(o[m]),s.push(m));if(r.length>0){for(var p,u,V,U=[],m=0,c=r.length;c>m;m++){p=r[m].data;for(var g=0,y=p.length;y>g;g++)u=p[g],this._isSelected(u.name)&&(u=null!=u?u:{name:"",value:{dataIndex:"-"}},V=this.getDataFromOption(u.value[t]),U.push({seriesIndex:s[m],seriesName:r[m].name||"",series:r[m],dataIndex:t,data:u,name:u.name,indicator:h,value:V,0:r[m].name||"",1:u.name,2:V,3:h}))}if(U.length<=0)return;if(this._lastItemTriggerId=-1,this._lastDataIndex!=t||this._lastSeriesIndex!=s[0])if(this._lastDataIndex=t,this._lastSeriesIndex=s[0],"function"==typeof i)this._curTicket="axis:"+t,this._tDom.innerHTML=i.call(this.myChart,U,this._curTicket,this._setContent);else if("string"==typeof i){i=i.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}").replace("{d}","{d0}");for(var m=0,c=U.length;c>m;m++)i=i.replace("{a"+m+"}",this._encodeHTML(U[m].seriesName)),i=i.replace("{b"+m+"}",this._encodeHTML(U[m].name)),i=i.replace("{c"+m+"}",this.numAddCommas(U[m].value)),i=i.replace("{d"+m+"}",this._encodeHTML(U[m].indicator));this._tDom.innerHTML=i}else{i=this._encodeHTML(U[0].name)+"
"+this._encodeHTML(U[0].indicator)+" : "+this.numAddCommas(U[0].value);for(var m=1,c=U.length;c>m;m++)i+="
"+this._encodeHTML(U[m].name)+"
",i+=this._encodeHTML(U[m].indicator)+" : "+this.numAddCommas(U[m].value);this._tDom.innerHTML=i}if(a===!1||!this.option.tooltip.showContent)return;return this.hasAppend||(this._tDom.style.left=this._zrWidth/2+"px",this._tDom.style.top=this._zrHeight/2+"px",this.dom.firstChild.appendChild(this._tDom),this.hasAppend=!0),this._show(n,d.getX(this._event),d.getY(this._event),l),!0}},_showItemTrigger:function(e){if(this._curTarget){var t,i,n,a=l.get(this._curTarget,"series"),o=l.get(this._curTarget,"seriesIndex"),r=l.get(this._curTarget,"data"),h=l.get(this._curTarget,"dataIndex"),m=l.get(this._curTarget,"name"),c=l.get(this._curTarget,"value"),p=l.get(this._curTarget,"special"),u=l.get(this._curTarget,"special2"),V=[r,a,this.option],U="";if("island"!=this._curTarget._type){var g=e?"axis":"item";this.option.tooltip.trigger===g&&(t=this.option.tooltip.formatter,i=this.option.tooltip.position),this.query(a,"tooltip.trigger")===g&&(n=this.query(a,"tooltip.showContent")||n,t=this.query(a,"tooltip.formatter")||t,i=this.query(a,"tooltip.position")||i,U+=this._style(this.query(a,"tooltip"))),n=this.query(r,"tooltip.showContent")||n,t=this.query(r,"tooltip.formatter")||t,i=this.query(r,"tooltip.position")||i,U+=this._style(this.query(r,"tooltip"))}else this._lastItemTriggerId=0/0,n=this.deepQuery(V,"tooltip.showContent"),t=this.deepQuery(V,"tooltip.islandFormatter"),i=this.deepQuery(V,"tooltip.islandPosition");this._lastDataIndex=-1,this._lastSeriesIndex=-1,this._lastItemTriggerId!==this._curTarget.id&&(this._lastItemTriggerId=this._curTarget.id,"function"==typeof t?(this._curTicket=(a.name||"")+":"+h,this._tDom.innerHTML=t.call(this.myChart,{seriesIndex:o,seriesName:a.name||"",series:a,dataIndex:h,data:r,name:m,value:c,percent:p,indicator:p,value2:u,indicator2:u,0:a.name||"",1:m,2:c,3:p,4:u,5:r,6:o,7:h},this._curTicket,this._setContent)):"string"==typeof t?(this._curTicket=0/0,t=t.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}"),t=t.replace("{a0}",this._encodeHTML(a.name||"")).replace("{b0}",this._encodeHTML(m)).replace("{c0}",c instanceof Array?c:this.numAddCommas(c)),t=t.replace("{d}","{d0}").replace("{d0}",p||""),t=t.replace("{e}","{e0}").replace("{e0}",l.get(this._curTarget,"special2")||""),this._tDom.innerHTML=t):(this._curTicket=0/0,this._tDom.innerHTML=a.type===s.CHART_TYPE_RADAR&&p?this._itemFormatter.radar.call(this,a,m,c,p):a.type===s.CHART_TYPE_EVENTRIVER?this._itemFormatter.eventRiver.call(this,a,m,c,r):""+(null!=a.name?this._encodeHTML(a.name)+"
":"")+(""===m?"":this._encodeHTML(m)+" : ")+(c instanceof Array?c:this.numAddCommas(c))));var y=d.getX(this._event),f=d.getY(this._event);this.deepQuery(V,"tooltip.axisPointer.show")&&this.component.grid&&this._styleAxisPointer([a],this.component.grid.getX(),f,this.component.grid.getXend(),f,0,y,f),n!==!1&&this.option.tooltip.showContent&&(this.hasAppend||(this._tDom.style.left=this._zrWidth/2+"px",this._tDom.style.top=this._zrHeight/2+"px",this.dom.firstChild.appendChild(this._tDom),this.hasAppend=!0),this._show(i,y+20,f-20,U))}},_itemFormatter:{radar:function(e,t,i,n){var a="";a+=this._encodeHTML(""===t?e.name||"":t),a+=""===a?"":"
";for(var o=0;o";return a},chord:function(e,t,i,n,a){if(null==a)return this._encodeHTML(t)+" ("+this.numAddCommas(i)+")";var o=this._encodeHTML(t),r=this._encodeHTML(n);return""+(null!=e.name?this._encodeHTML(e.name)+"
":"")+o+" -> "+r+" ("+this.numAddCommas(i)+")
"+r+" -> "+o+" ("+this.numAddCommas(a)+")"},eventRiver:function(e,t,i,n){var a="";a+=this._encodeHTML(""===e.name?"":e.name+" : "),a+=this._encodeHTML(t),a+=""===a?"":"
",n=n.evolution;for(var o=0,r=n.length;r>o;o++)a+='
',n[o].detail&&(n[o].detail.img&&(a+=''),a+='
'+n[o].time+"
",a+='',a+=n[o].detail.text+"
",a+="
");return a}},_styleAxisPointer:function(e,t,i,n,a,o,r,s){if(e.length>0){var l,h,d=this.option.tooltip.axisPointer,m=d.type,c={line:{},cross:{},shadow:{}};for(var p in c)c[p].color=d[p+"Style"].color,c[p].width=d[p+"Style"].width,c[p].type=d[p+"Style"].type;for(var u=0,V=e.length;V>u;u++)l=e[u],h=this.query(l,"tooltip.axisPointer.type"),m=h||m,h&&(c[h].color=this.query(l,"tooltip.axisPointer."+h+"Style.color")||c[h].color,c[h].width=this.query(l,"tooltip.axisPointer."+h+"Style.width")||c[h].width,c[h].type=this.query(l,"tooltip.axisPointer."+h+"Style.type")||c[h].type);if("line"===m){var U=c.line.width,g=t==n;this._axisLineShape.style={xStart:g?this.subPixelOptimize(t,U):t,yStart:g?i:this.subPixelOptimize(i,U),xEnd:g?this.subPixelOptimize(n,U):n,yEnd:g?a:this.subPixelOptimize(a,U),strokeColor:c.line.color,lineWidth:U,lineType:c.line.type},this._axisLineShape.invisible=!1,this.zr.modShape(this._axisLineShape.id)}else if("cross"===m){var y=c.cross.width;this._axisCrossShape.style={brushType:"stroke",rect:this.component.grid.getArea(),x:this.subPixelOptimize(r,y),y:this.subPixelOptimize(s,y),text:("( "+this.component.xAxis.getAxis(0).getValueFromCoord(r)+" , "+this.component.yAxis.getAxis(0).getValueFromCoord(s)+" )").replace(" , "," ").replace(" , "," "),textPosition:"specific",strokeColor:c.cross.color,lineWidth:y,lineType:c.cross.type},this.component.grid.getXend()-r>100?(this._axisCrossShape.style.textAlign="left",this._axisCrossShape.style.textX=r+10):(this._axisCrossShape.style.textAlign="right",this._axisCrossShape.style.textX=r-10),s-this.component.grid.getY()>50?(this._axisCrossShape.style.textBaseline="bottom",this._axisCrossShape.style.textY=s-10):(this._axisCrossShape.style.textBaseline="top",this._axisCrossShape.style.textY=s+10),this._axisCrossShape.invisible=!1,this.zr.modShape(this._axisCrossShape.id)}else"shadow"===m&&((null==c.shadow.width||"auto"===c.shadow.width||isNaN(c.shadow.width))&&(c.shadow.width=o),t===n?Math.abs(this.component.grid.getX()-t)<2?(c.shadow.width/=2,t=n+=c.shadow.width/2):Math.abs(this.component.grid.getXend()-t)<2&&(c.shadow.width/=2,t=n-=c.shadow.width/2):i===a&&(Math.abs(this.component.grid.getY()-i)<2?(c.shadow.width/=2,i=a+=c.shadow.width/2):Math.abs(this.component.grid.getYend()-i)<2&&(c.shadow.width/=2,i=a-=c.shadow.width/2)),this._axisShadowShape.style={xStart:t,yStart:i,xEnd:n,yEnd:a,strokeColor:c.shadow.color,lineWidth:c.shadow.width},this._axisShadowShape.invisible=!1,this.zr.modShape(this._axisShadowShape.id));this.zr.refreshNextFrame()}},__onmousemove:function(e){if(clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),!this._mousein||!this._enterable){var t=e.target,i=d.getX(e.event),n=d.getY(e.event);if(t){this._curTarget=t,this._event=e.event,this._event.zrenderX=i,this._event.zrenderY=n;var a;if(this._needAxisTrigger&&this.component.polar&&-1!=(a=this.component.polar.isInside([i,n])))for(var o=this.option.series,l=0,h=o.length;h>l;l++)if(o[l].polarIndex===a&&"axis"===this.deepQuery([o[l],this.option],"tooltip.trigger")){this._curTarget=null;break}this._showingTicket=setTimeout(this._tryShow,this._showDelay)}else this._curTarget=!1,this._event=e.event,this._event.zrenderX=i,this._event.zrenderY=n,this._needAxisTrigger&&this.component.grid&&m.isInside(r,this.component.grid.getArea(),i,n)?this._showingTicket=setTimeout(this._tryShow,this._showDelay):this._needAxisTrigger&&this.component.polar&&-1!=this.component.polar.isInside([i,n])?this._showingTicket=setTimeout(this._tryShow,this._showDelay):(!this._event.connectTrigger&&this.messageCenter.dispatch(s.EVENT.TOOLTIP_OUT_GRID,this._event,null,this.myChart),this._hidingTicket=setTimeout(this._hide,this._hideDelay))}},__onglobalout:function(){clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this._hidingTicket=setTimeout(this._hide,this._hideDelay)},__setContent:function(e,t){this._tDom&&(e===this._curTicket&&(this._tDom.innerHTML=t),setTimeout(this._refixed,20))},ontooltipHover:function(e,t){if(!this._lastTipShape||this._lastTipShape&&this._lastTipShape.dataIndex!=e.dataIndex){this._lastTipShape&&this._lastTipShape.tipShape.length>0&&(this.zr.delShape(this._lastTipShape.tipShape),this.shapeList.length=2);for(var i=0,n=t.length;n>i;i++)t[i].zlevel=this.getZlevelBase(),t[i].z=this.getZBase(),t[i].style=u.prototype.getHighlightStyle(t[i].style,t[i].highlightStyle),t[i].draggable=!1,t[i].hoverable=!1,t[i].clickable=!1,t[i].ondragend=null,t[i].ondragover=null,t[i].ondrop=null,this.shapeList.push(t[i]),this.zr.addShape(t[i]);this._lastTipShape={dataIndex:e.dataIndex,tipShape:t}}},ondragend:function(){this._hide()},onlegendSelected:function(e){this._selectedMap=e.selected},_setSelectedMap:function(){this._selectedMap=this.component.legend?p.clone(this.component.legend.getSelectedMap()):{}},_isSelected:function(e){return null!=this._selectedMap[e]?this._selectedMap[e]:!0},showTip:function(e){if(e){var t,i=this.option.series;if(null!=e.seriesIndex)t=e.seriesIndex;else for(var n=e.seriesName,a=0,o=i.length;o>a;a++)if(i[a].name===n){t=a;break}var r=i[t];if(null!=r){var d=this.myChart.chart[r.type],m="axis"===this.deepQuery([r,this.option],"tooltip.trigger");if(d)if(m){var c=e.dataIndex;switch(d.type){case s.CHART_TYPE_LINE:case s.CHART_TYPE_BAR:case s.CHART_TYPE_K:if(null==this.component.xAxis||null==this.component.yAxis||r.data.length<=c)return;var p=r.xAxisIndex||0,u=r.yAxisIndex||0;this._event=this.component.xAxis.getAxis(p).type===s.COMPONENT_TYPE_AXIS_CATEGORY?{zrenderX:this.component.xAxis.getAxis(p).getCoordByIndex(c),zrenderY:this.component.grid.getY()+(this.component.grid.getYend()-this.component.grid.getY())/4}:{zrenderX:this.component.grid.getX()+(this.component.grid.getXend()-this.component.grid.getX())/4,zrenderY:this.component.yAxis.getAxis(u).getCoordByIndex(c)},this._showAxisTrigger(p,u,c);break;case s.CHART_TYPE_RADAR:if(null==this.component.polar||r.data[0].value.length<=c)return;var V=r.polarIndex||0,U=this.component.polar.getVector(V,c,"max");this._event={zrenderX:U[0],zrenderY:U[1]},this._showPolarTrigger(V,c)}}else{var g,y,f=d.shapeList;switch(d.type){case s.CHART_TYPE_LINE:case s.CHART_TYPE_BAR:case s.CHART_TYPE_K:case s.CHART_TYPE_SCATTER:for(var c=e.dataIndex,a=0,o=f.length;o>a;a++)if(null==f[a]._mark&&l.get(f[a],"seriesIndex")==t&&l.get(f[a],"dataIndex")==c){this._curTarget=f[a],g=f[a].style.x,y=d.type!=s.CHART_TYPE_K?f[a].style.y:f[a].style.y[0];break}break;case s.CHART_TYPE_RADAR:for(var c=e.dataIndex,a=0,o=f.length;o>a;a++)if("polygon"===f[a].type&&l.get(f[a],"seriesIndex")==t&&l.get(f[a],"dataIndex")==c){this._curTarget=f[a];var U=this.component.polar.getCenter(r.polarIndex||0);g=U[0],y=U[1];break}break;case s.CHART_TYPE_PIE:for(var b=e.name,a=0,o=f.length;o>a;a++)if("sector"===f[a].type&&l.get(f[a],"seriesIndex")==t&&l.get(f[a],"name")==b){this._curTarget=f[a];var _=this._curTarget.style,x=(_.startAngle+_.endAngle)/2*Math.PI/180;g=this._curTarget.style.x+Math.cos(x)*_.r/1.5,y=this._curTarget.style.y-Math.sin(x)*_.r/1.5;break}break;case s.CHART_TYPE_MAP:for(var b=e.name,k=r.mapType,a=0,o=f.length;o>a;a++)if("text"===f[a].type&&f[a]._mapType===k&&f[a].style._name===b){this._curTarget=f[a],g=this._curTarget.style.x+this._curTarget.position[0],y=this._curTarget.style.y+this._curTarget.position[1];break}break;case s.CHART_TYPE_CHORD:for(var b=e.name,a=0,o=f.length;o>a;a++)if("sector"===f[a].type&&l.get(f[a],"name")==b){this._curTarget=f[a];var _=this._curTarget.style,x=(_.startAngle+_.endAngle)/2*Math.PI/180;return g=this._curTarget.style.x+Math.cos(x)*(_.r-2),y=this._curTarget.style.y-Math.sin(x)*(_.r-2),void this.zr.trigger(h.EVENT.MOUSEMOVE,{zrenderX:g,zrenderY:y})}break;case s.CHART_TYPE_FORCE:for(var b=e.name,a=0,o=f.length;o>a;a++)if("circle"===f[a].type&&l.get(f[a],"name")==b){this._curTarget=f[a],g=this._curTarget.position[0],y=this._curTarget.position[1];break}}null!=g&&null!=y&&(this._event={zrenderX:g,zrenderY:y},this.zr.addHoverShape(this._curTarget),this.zr.refreshHover(),this._showItemTrigger())}}}},hideTip:function(){this._hide()},refresh:function(e){if(this._zrHeight=this.zr.getHeight(),this._zrWidth=this.zr.getWidth(),this._lastTipShape&&this._lastTipShape.tipShape.length>0&&this.zr.delShape(this._lastTipShape.tipShape),this._lastTipShape=!1,this.shapeList.length=2,this._lastDataIndex=-1,this._lastSeriesIndex=-1,this._lastItemTriggerId=-1,e){this.option=e,this.option.tooltip=this.reformOption(this.option.tooltip),this.option.tooltip.textStyle=p.merge(this.option.tooltip.textStyle,this.ecTheme.textStyle),this._needAxisTrigger=!1,"axis"===this.option.tooltip.trigger&&(this._needAxisTrigger=!0);for(var t=this.option.series,i=0,n=t.length;n>i;i++)if("axis"===this.query(t[i],"tooltip.trigger")){this._needAxisTrigger=!0;break}this._showDelay=this.option.tooltip.showDelay,this._hideDelay=this.option.tooltip.hideDelay,this._defaultCssText=this._style(this.option.tooltip),this._setSelectedMap(),this._axisLineWidth=this.option.tooltip.axisPointer.lineStyle.width,this._enterable=this.option.tooltip.enterable}if(this.showing){var a=this;setTimeout(function(){a.zr.trigger(h.EVENT.MOUSEMOVE,a.zr.handler._event)},50)}},onbeforDispose:function(){this._lastTipShape&&this._lastTipShape.tipShape.length>0&&this.zr.delShape(this._lastTipShape.tipShape),clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this.zr.un(h.EVENT.MOUSEMOVE,this._onmousemove),this.zr.un(h.EVENT.GLOBALOUT,this._onglobalout),this.hasAppend&&this.dom.firstChild&&this.dom.firstChild.removeChild(this._tDom),this._tDom=null},_encodeHTML:function(e){return String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}},p.inherits(t,i),e("../component").define("tooltip",t),t}),define("echarts/component/legend",["require","./base","zrender/shape/Text","zrender/shape/Rectangle","zrender/shape/Sector","../util/shape/Icon","../util/shape/Candle","../config","zrender/tool/util","zrender/tool/area","../component"],function(e){function t(e,t,n,a,o){if(!this.query(a,"legend.data"))return void console.error("option.legend.data has not been defined.");i.call(this,e,t,n,a,o);var r=this;r._legendSelected=function(e){r.__legendSelected(e)},r._dispatchHoverLink=function(e){return r.__dispatchHoverLink(e)},this._colorIndex=0,this._colorMap={},this._selectedMap={},this._hasDataMap={},this.refresh(a)}var i=e("./base"),n=e("zrender/shape/Text"),a=e("zrender/shape/Rectangle"),o=e("zrender/shape/Sector"),r=e("../util/shape/Icon"),s=e("../util/shape/Candle"),l=e("../config");l.legend={zlevel:0,z:4,show:!0,orient:"horizontal",x:"center",y:"top",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,itemWidth:20,itemHeight:14,textStyle:{color:"#333"},selectedMode:!0};var h=e("zrender/tool/util"),d=e("zrender/tool/area");t.prototype={type:l.COMPONENT_TYPE_LEGEND,_buildShape:function(){if(this.legendOption.show){this._itemGroupLocation=this._getItemGroupLocation(),this._buildBackground(),this._buildItem();for(var e=0,t=this.shapeList.length;t>e;e++)this.zr.addShape(this.shapeList[e])}},_buildItem:function(){var e,t,i,a,o,s,l,m,c=this.legendOption.data,p=c.length,u=this.legendOption.textStyle,V=this.zr.getWidth(),U=this.zr.getHeight(),g=this._itemGroupLocation.x,y=this._itemGroupLocation.y,f=this.legendOption.itemWidth,b=this.legendOption.itemHeight,_=this.legendOption.itemGap;"vertical"===this.legendOption.orient&&"right"===this.legendOption.x&&(g=this._itemGroupLocation.x+this._itemGroupLocation.width-f);for(var x=0;p>x;x++)o=h.merge(c[x].textStyle||{},u),s=this.getFont(o),e=this._getName(c[x]),l=this._getFormatterName(e),""!==e?(t=c[x].icon||this._getSomethingByName(e).type,m=this.getColor(e),"horizontal"===this.legendOption.orient?200>V-g&&f+5+d.getTextWidth(l,s)+(x===p-1||""===c[x+1]?0:_)>=V-g&&(g=this._itemGroupLocation.x,y+=b+_):200>U-y&&b+(x===p-1||""===c[x+1]?0:_)>=U-y&&("right"===this.legendOption.x?g-=this._itemGroupLocation.maxWidth+_:g+=this._itemGroupLocation.maxWidth+_,y=this._itemGroupLocation.y),i=this._getItemShapeByType(g,y,f,b,this._selectedMap[e]&&this._hasDataMap[e]?m:"#ccc",t,m),i._name=e,i=new r(i),a={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:g+f+5,y:y+b/2,color:this._selectedMap[e]?"auto"===o.color?m:o.color:"#ccc",text:l,textFont:s,textBaseline:"middle"},highlightStyle:{color:m,brushType:"fill"},hoverable:!!this.legendOption.selectedMode,clickable:!!this.legendOption.selectedMode},"vertical"===this.legendOption.orient&&"right"===this.legendOption.x&&(a.style.x-=f+10,a.style.textAlign="right"),a._name=e,a=new n(a),this.legendOption.selectedMode&&(i.onclick=a.onclick=this._legendSelected,i.onmouseover=a.onmouseover=this._dispatchHoverLink,i.hoverConnect=a.id,a.hoverConnect=i.id),this.shapeList.push(i),this.shapeList.push(a),"horizontal"===this.legendOption.orient?g+=f+5+d.getTextWidth(l,s)+_:y+=b+_):"horizontal"===this.legendOption.orient?(g=this._itemGroupLocation.x,y+=b+_):("right"===this.legendOption.x?g-=this._itemGroupLocation.maxWidth+_:g+=this._itemGroupLocation.maxWidth+_,y=this._itemGroupLocation.y);"horizontal"===this.legendOption.orient&&"center"===this.legendOption.x&&y!=this._itemGroupLocation.y&&this._mLineOptimize()},_getName:function(e){return"undefined"!=typeof e.name?e.name:e},_getFormatterName:function(e){var t,i=this.legendOption.formatter;return t="function"==typeof i?i.call(this.myChart,e):"string"==typeof i?i.replace("{name}",e):e +},_getFormatterNameFromData:function(e){var t=this._getName(e);return this._getFormatterName(t)},_mLineOptimize:function(){for(var e=[],t=this._itemGroupLocation.x,i=2,n=this.shapeList.length;n>i;i++)this.shapeList[i].style.x===t?e.push((this._itemGroupLocation.width-(this.shapeList[i-1].style.x+d.getTextWidth(this.shapeList[i-1].style.text,this.shapeList[i-1].style.textFont)-t))/2):i===n-1&&e.push((this._itemGroupLocation.width-(this.shapeList[i].style.x+d.getTextWidth(this.shapeList[i].style.text,this.shapeList[i].style.textFont)-t))/2);for(var a=-1,i=1,n=this.shapeList.length;n>i;i++)this.shapeList[i].style.x===t&&a++,0!==e[a]&&(this.shapeList[i].style.x+=e[a])},_buildBackground:function(){var e=this.reformCssArray(this.legendOption.padding);this.shapeList.push(new a({zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this._itemGroupLocation.x-e[3],y:this._itemGroupLocation.y-e[0],width:this._itemGroupLocation.width+e[3]+e[1],height:this._itemGroupLocation.height+e[0]+e[2],brushType:0===this.legendOption.borderWidth?"fill":"both",color:this.legendOption.backgroundColor,strokeColor:this.legendOption.borderColor,lineWidth:this.legendOption.borderWidth}}))},_getItemGroupLocation:function(){var e=this.legendOption.data,t=e.length,i=this.legendOption.itemGap,n=this.legendOption.itemWidth+5,a=this.legendOption.itemHeight,o=this.legendOption.textStyle,r=this.getFont(o),s=0,l=0,m=this.reformCssArray(this.legendOption.padding),c=this.zr.getWidth()-m[1]-m[3],p=this.zr.getHeight()-m[0]-m[2],u=0,V=0;if("horizontal"===this.legendOption.orient){l=a;for(var U=0;t>U;U++)if(""!==this._getName(e[U])){var g=d.getTextWidth(this._getFormatterNameFromData(e[U]),e[U].textStyle?this.getFont(h.merge(e[U].textStyle||{},o)):r);u+n+g+i>c?(u-=i,s=Math.max(s,u),l+=a+i,u=0):(u+=n+g+i,s=Math.max(s,u-i))}else u-=i,s=Math.max(s,u),l+=a+i,u=0}else{for(var U=0;t>U;U++)V=Math.max(V,d.getTextWidth(this._getFormatterNameFromData(e[U]),e[U].textStyle?this.getFont(h.merge(e[U].textStyle||{},o)):r));V+=n,s=V;for(var U=0;t>U;U++)""!==this._getName(e[U])?u+a+i>p?(s+=V+i,u-=i,l=Math.max(l,u),u=0):(u+=a+i,l=Math.max(l,u-i)):(s+=V+i,u-=i,l=Math.max(l,u),u=0)}c=this.zr.getWidth(),p=this.zr.getHeight();var y;switch(this.legendOption.x){case"center":y=Math.floor((c-s)/2);break;case"left":y=m[3]+this.legendOption.borderWidth;break;case"right":y=c-s-m[1]-m[3]-2*this.legendOption.borderWidth;break;default:y=this.parsePercent(this.legendOption.x,c)}var f;switch(this.legendOption.y){case"top":f=m[0]+this.legendOption.borderWidth;break;case"bottom":f=p-l-m[0]-m[2]-2*this.legendOption.borderWidth;break;case"center":f=Math.floor((p-l)/2);break;default:f=this.parsePercent(this.legendOption.y,p)}return{x:y,y:f,width:s,height:l,maxWidth:V}},_getSomethingByName:function(e){for(var t,i=this.option.series,n=0,a=i.length;a>n;n++){if(i[n].name===e)return{type:i[n].type,series:i[n],seriesIndex:n,data:null,dataIndex:-1};if(i[n].type===l.CHART_TYPE_PIE||i[n].type===l.CHART_TYPE_RADAR||i[n].type===l.CHART_TYPE_CHORD||i[n].type===l.CHART_TYPE_FORCE||i[n].type===l.CHART_TYPE_FUNNEL){t=i[n].categories||i[n].data||i[n].nodes;for(var o=0,r=t.length;r>o;o++)if(t[o].name===e)return{type:i[n].type,series:i[n],seriesIndex:n,data:t[o],dataIndex:o}}}return{type:"bar",series:null,seriesIndex:-1,data:null,dataIndex:-1}},_getItemShapeByType:function(e,t,i,n,a,o,r){var s,h="#ccc"===a?r:a,d={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{iconType:"legendicon"+o,x:e,y:t,width:i,height:n,color:a,strokeColor:a,lineWidth:2},highlightStyle:{color:h,strokeColor:h,lineWidth:1},hoverable:this.legendOption.selectedMode,clickable:this.legendOption.selectedMode};if(o.match("image")){var s=o.replace(new RegExp("^image:\\/\\/"),"");o="image"}switch(o){case"line":d.style.brushType="stroke",d.highlightStyle.lineWidth=3;break;case"radar":case"scatter":d.highlightStyle.lineWidth=3;break;case"k":d.style.brushType="both",d.highlightStyle.lineWidth=3,d.highlightStyle.color=d.style.color=this.deepQuery([this.ecTheme,l],"k.itemStyle.normal.color")||"#fff",d.style.strokeColor="#ccc"!=a?this.deepQuery([this.ecTheme,l],"k.itemStyle.normal.lineStyle.color")||"#ff3200":a;break;case"image":d.style.iconType="image",d.style.image=s,"#ccc"===a&&(d.style.opacity=.5)}return d},__legendSelected:function(e){var t=e.target._name;if("single"===this.legendOption.selectedMode)for(var i in this._selectedMap)this._selectedMap[i]=!1;this._selectedMap[t]=!this._selectedMap[t],this.messageCenter.dispatch(l.EVENT.LEGEND_SELECTED,e.event,{selected:this._selectedMap,target:t},this.myChart)},__dispatchHoverLink:function(e){this.messageCenter.dispatch(l.EVENT.LEGEND_HOVERLINK,e.event,{target:e.target._name},this.myChart)},refresh:function(e){if(e){this.option=e||this.option,this.option.legend=this.reformOption(this.option.legend),this.legendOption=this.option.legend;var t,i,n,a,o=this.legendOption.data||[];if(this.legendOption.selected)for(var r in this.legendOption.selected)this._selectedMap[r]="undefined"!=typeof this._selectedMap[r]?this._selectedMap[r]:this.legendOption.selected[r];for(var s=0,h=o.length;h>s;s++)t=this._getName(o[s]),""!==t&&(i=this._getSomethingByName(t),i.series?(this._hasDataMap[t]=!0,a=!i.data||i.type!==l.CHART_TYPE_PIE&&i.type!==l.CHART_TYPE_FORCE&&i.type!==l.CHART_TYPE_FUNNEL?[i.series]:[i.data,i.series],n=this.getItemStyleColor(this.deepQuery(a,"itemStyle.normal.color"),i.seriesIndex,i.dataIndex,i.data),n&&i.type!=l.CHART_TYPE_K&&this.setColor(t,n),this._selectedMap[t]=null!=this._selectedMap[t]?this._selectedMap[t]:!0):this._hasDataMap[t]=!1)}this.clear(),this._buildShape()},getRelatedAmount:function(e){for(var t,i=0,n=this.option.series,a=0,o=n.length;o>a;a++)if(n[a].name===e&&i++,n[a].type===l.CHART_TYPE_PIE||n[a].type===l.CHART_TYPE_RADAR||n[a].type===l.CHART_TYPE_CHORD||n[a].type===l.CHART_TYPE_FORCE||n[a].type===l.CHART_TYPE_FUNNEL){t=n[a].type!=l.CHART_TYPE_FORCE?n[a].data:n[a].categories;for(var r=0,s=t.length;s>r;r++)t[r].name===e&&"-"!=t[r].value&&i++}return i},setColor:function(e,t){this._colorMap[e]=t},getColor:function(e){return this._colorMap[e]||(this._colorMap[e]=this.zr.getColor(this._colorIndex++)),this._colorMap[e]},hasColor:function(e){return this._colorMap[e]?this._colorMap[e]:!1},add:function(e,t){for(var i=this.legendOption.data,n=0,a=i.length;a>n;n++)if(this._getName(i[n])===e)return;this.legendOption.data.push(e),this.setColor(e,t),this._selectedMap[e]=!0,this._hasDataMap[e]=!0},del:function(e){for(var t=this.legendOption.data,i=0,n=t.length;n>i;i++)if(this._getName(t[i])===e)return this.legendOption.data.splice(i,1)},getItemShape:function(e){if(null!=e)for(var t,i=0,n=this.shapeList.length;n>i;i++)if(t=this.shapeList[i],t._name===e&&"text"!=t.type)return t},setItemShape:function(e,t){for(var i,n=0,a=this.shapeList.length;a>n;n++)i=this.shapeList[n],i._name===e&&"text"!=i.type&&(this._selectedMap[e]||(t.style.color="#ccc",t.style.strokeColor="#ccc"),this.zr.modShape(i.id,t))},isSelected:function(e){return"undefined"!=typeof this._selectedMap[e]?this._selectedMap[e]:!0},getSelectedMap:function(){return this._selectedMap},setSelected:function(e,t){if("single"===this.legendOption.selectedMode)for(var i in this._selectedMap)this._selectedMap[i]=!1;this._selectedMap[e]=t,this.messageCenter.dispatch(l.EVENT.LEGEND_SELECTED,null,{selected:this._selectedMap,target:e},this.myChart)},onlegendSelected:function(e,t){var i=e.selected;for(var n in i)this._selectedMap[n]!=i[n]&&(t.needRefresh=!0),this._selectedMap[n]=i[n]}};var m={line:function(e,t){var i=t.height/2;e.moveTo(t.x,t.y+i),e.lineTo(t.x+t.width,t.y+i)},pie:function(e,t){var i=t.x,n=t.y,a=t.width,r=t.height;o.prototype.buildPath(e,{x:i+a/2,y:n+r+2,r:r,r0:6,startAngle:45,endAngle:135})},eventRiver:function(e,t){var i=t.x,n=t.y,a=t.width,o=t.height;e.moveTo(i,n+o),e.bezierCurveTo(i+a,n+o,i,n+4,i+a,n+4),e.lineTo(i+a,n),e.bezierCurveTo(i,n,i+a,n+o-4,i,n+o-4),e.lineTo(i,n+o)},k:function(e,t){var i=t.x,n=t.y,a=t.width,o=t.height;s.prototype.buildPath(e,{x:i+a/2,y:[n+1,n+1,n+o-6,n+o],width:a-6})},bar:function(e,t){var i=t.x,n=t.y+1,a=t.width,o=t.height-2,r=3;e.moveTo(i+r,n),e.lineTo(i+a-r,n),e.quadraticCurveTo(i+a,n,i+a,n+r),e.lineTo(i+a,n+o-r),e.quadraticCurveTo(i+a,n+o,i+a-r,n+o),e.lineTo(i+r,n+o),e.quadraticCurveTo(i,n+o,i,n+o-r),e.lineTo(i,n+r),e.quadraticCurveTo(i,n,i+r,n)},force:function(e,t){r.prototype.iconLibrary.circle(e,t)},radar:function(e,t){var i=6,n=t.x+t.width/2,a=t.y+t.height/2,o=t.height/2,r=2*Math.PI/i,s=-Math.PI/2,l=n+o*Math.cos(s),h=a+o*Math.sin(s);e.moveTo(l,h),s+=r;for(var d=0,m=i-1;m>d;d++)e.lineTo(n+o*Math.cos(s),a+o*Math.sin(s)),s+=r;e.lineTo(l,h)}};m.chord=m.pie,m.map=m.bar;for(var c in m)r.prototype.iconLibrary["legendicon"+c]=m[c];return h.inherits(t,i),e("../component").define("legend",t),t}),define("echarts/util/ecData",[],function(){function e(e,t,i,n,a,o,r,s){var l;return"undefined"!=typeof n&&(l=null==n.value?n:n.value),e._echartsData={_series:t,_seriesIndex:i,_data:n,_dataIndex:a,_name:o,_value:l,_special:r,_special2:s},e._echartsData}function t(e,t){var i=e._echartsData;if(!t)return i;switch(t){case"series":case"seriesIndex":case"data":case"dataIndex":case"name":case"value":case"special":case"special2":return i&&i["_"+t]}return null}function i(e,t,i){switch(e._echartsData=e._echartsData||{},t){case"series":case"seriesIndex":case"data":case"dataIndex":case"name":case"value":case"special":case"special2":e._echartsData["_"+t]=i}}function n(e,t){t._echartsData={_series:e._echartsData._series,_seriesIndex:e._echartsData._seriesIndex,_data:e._echartsData._data,_dataIndex:e._echartsData._dataIndex,_name:e._echartsData._name,_value:e._echartsData._value,_special:e._echartsData._special,_special2:e._echartsData._special2}}return{pack:e,set:i,get:t,clone:n}}),define("echarts/chart",[],function(){var e={},t={};return e.define=function(i,n){return t[i]=n,e},e.get=function(e){return t[e]},e}),define("zrender/tool/color",["require","../tool/util"],function(e){function t(e){D=e}function i(){D=N}function n(e,t){return e=0|e,t=t||D,t[e%t.length]}function a(e){B=e}function o(){H=B}function r(){return B}function s(e,t,i,n,a,o,r){O||(O=P.getContext());for(var s=O.createRadialGradient(e,t,i,n,a,o),l=0,h=r.length;h>l;l++)s.addColorStop(r[l][0],r[l][1]);return s.__nonRecursion=!0,s}function l(e,t,i,n,a){O||(O=P.getContext());for(var o=O.createLinearGradient(e,t,i,n),r=0,s=a.length;s>r;r++)o.addColorStop(a[r][0],a[r][1]);return o.__nonRecursion=!0,o}function h(e,t,i){e=u(e),t=u(t),e=K(e),t=K(t);for(var n=[],a=(t[0]-e[0])/i,o=(t[1]-e[1])/i,r=(t[2]-e[2])/i,s=(t[3]-e[3])/i,l=0,h=e[0],d=e[1],c=e[2],p=e[3];i>l;l++)n[l]=m([T(Math.floor(h),[0,255]),T(Math.floor(d),[0,255]),T(Math.floor(c),[0,255]),p.toFixed(4)-0],"rgba"),h+=a,d+=o,c+=r,p+=s;return h=t[0],d=t[1],c=t[2],p=t[3],n[l]=m([h,d,c,p],"rgba"),n}function d(e,t){var i=[],n=e.length;if(void 0===t&&(t=20),1===n)i=h(e[0],e[0],t);else if(n>1)for(var a=0,o=n-1;o>a;a++){var r=h(e[a],e[a+1],t);o-1>a&&r.pop(),i=i.concat(r)}return i}function m(e,t){if(t=t||"rgb",e&&(3===e.length||4===e.length)){if(e=C(e,function(e){return e>1?Math.ceil(e):e}),t.indexOf("hex")>-1)return"#"+((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1);if(t.indexOf("hs")>-1){var i=C(e.slice(1,3),function(e){return e+"%"});e[1]=i[0],e[2]=i[1]}return t.indexOf("a")>-1?(3===e.length&&e.push(1),e[3]=T(e[3],[0,1]),t+"("+e.slice(0,4).join(",")+")"):t+"("+e.slice(0,3).join(",")+")"}}function c(e){e=L(e),e.indexOf("rgba")<0&&(e=u(e));var t=[],i=0;return e.replace(/[\d.]+/g,function(e){e=3>i?0|e:+e,t[i++]=e}),t}function p(e,t){if(!E(e))return e;var i=K(e),n=i[3];return"undefined"==typeof n&&(n=1),e.indexOf("hsb")>-1?i=z(i):e.indexOf("hsl")>-1&&(i=A(i)),t.indexOf("hsb")>-1||t.indexOf("hsv")>-1?i=J(i):t.indexOf("hsl")>-1&&(i=F(i)),i[3]=n,m(i,t)}function u(e){return p(e,"rgba")}function V(e){return p(e,"rgb")}function U(e){return p(e,"hex")}function g(e){return p(e,"hsva")}function y(e){return p(e,"hsv")}function f(e){return p(e,"hsba")}function b(e){return p(e,"hsb")}function _(e){return p(e,"hsla")}function x(e){return p(e,"hsl")}function k(e){for(var t in G)if(U(G[t])===U(e))return t;return null}function L(e){return String(e).replace(/\s+/g,"")}function v(e){if(G[e]&&(e=G[e]),e=L(e),e=e.replace(/hsv/i,"hsb"),/^#[\da-f]{3}$/i.test(e)){e=parseInt(e.slice(1),16);var t=(3840&e)<<8,i=(240&e)<<4,n=15&e;e="#"+((1<<24)+(t<<4)+t+(i<<4)+i+(n<<4)+n).toString(16).slice(1)}return e}function W(e,t){if(!E(e))return e;var i=t>0?1:-1;"undefined"==typeof t&&(t=0),t=Math.abs(t)>1?1:Math.abs(t),e=V(e);for(var n=K(e),a=0;3>a;a++)n[a]=1===i?n[a]*(1-t)|0:(255-n[a])*t+n[a]|0;return"rgb("+n.join(",")+")"}function w(e){if(!E(e))return e;var t=K(u(e));return t=C(t,function(e){return 255-e}),m(t,"rgb")}function X(e,t,i){if(!E(e)||!E(t))return e;"undefined"==typeof i&&(i=.5),i=1-T(i,[0,1]);for(var n=2*i-1,a=K(u(e)),o=K(u(t)),r=a[3]-o[3],s=((n*r===-1?n:(n+r)/(1+n*r))+1)/2,l=1-s,h=[],d=0;3>d;d++)h[d]=a[d]*s+o[d]*l;var c=a[3]*i+o[3]*(1-i);return c=Math.max(0,Math.min(1,c)),1===a[3]&&1===o[3]?m(h,"rgb"):(h[3]=c,m(h,"rgba"))}function I(){return"#"+(Math.random().toString(16)+"0000").slice(2,8)}function K(e){e=v(e);var t=e.match(R);if(null===t)throw new Error("The color format error");var i,n,a,o=[];if(t[2])i=t[2].replace("#","").split(""),a=[i[0]+i[1],i[2]+i[3],i[4]+i[5]],o=C(a,function(e){return T(parseInt(e,16),[0,255])});else if(t[4]){var r=t[4].split(",");n=r[3],a=r.slice(0,3),o=C(a,function(e){return e=Math.floor(e.indexOf("%")>0?2.55*parseInt(e,0):e),T(e,[0,255])}),"undefined"!=typeof n&&o.push(T(parseFloat(n),[0,1]))}else if(t[5]||t[6]){var s=(t[5]||t[6]).split(","),l=parseInt(s[0],0)/360,h=s[1],d=s[2];n=s[3],o=C([h,d],function(e){return T(parseFloat(e)/100,[0,1])}),o.unshift(l),"undefined"!=typeof n&&o.push(T(parseFloat(n),[0,1]))}return o}function S(e,t){if(!E(e))return e;null===t&&(t=1);var i=K(u(e));return i[3]=T(Number(t).toFixed(4),[0,1]),m(i,"rgba")}function C(e,t){if("function"!=typeof t)throw new TypeError;for(var i=e?e.length:0,n=0;i>n;n++)e[n]=t(e[n]);return e}function T(e,t){return e<=t[0]?e=t[0]:e>=t[1]&&(e=t[1]),e}function E(e){return e instanceof Array||"string"==typeof e}function z(e){var t,i,n,a=e[0],o=e[1],r=e[2];if(0===o)t=255*r,i=255*r,n=255*r;else{var s=6*a;6===s&&(s=0);var l=0|s,h=r*(1-o),d=r*(1-o*(s-l)),m=r*(1-o*(1-(s-l))),c=0,p=0,u=0;0===l?(c=r,p=m,u=h):1===l?(c=d,p=r,u=h):2===l?(c=h,p=r,u=m):3===l?(c=h,p=d,u=r):4===l?(c=m,p=h,u=r):(c=r,p=h,u=d),t=255*c,i=255*p,n=255*u}return[t,i,n]}function A(e){var t,i,n,a=e[0],o=e[1],r=e[2];if(0===o)t=255*r,i=255*r,n=255*r;else{var s;s=.5>r?r*(1+o):r+o-o*r;var l=2*r-s;t=255*M(l,s,a+1/3),i=255*M(l,s,a),n=255*M(l,s,a-1/3)}return[t,i,n]}function M(e,t,i){return 0>i&&(i+=1),i>1&&(i-=1),1>6*i?e+6*(t-e)*i:1>2*i?t:2>3*i?e+(t-e)*(2/3-i)*6:e}function J(e){var t,i,n=e[0]/255,a=e[1]/255,o=e[2]/255,r=Math.min(n,a,o),s=Math.max(n,a,o),l=s-r,h=s;if(0===l)t=0,i=0;else{i=l/s;var d=((s-n)/6+l/2)/l,m=((s-a)/6+l/2)/l,c=((s-o)/6+l/2)/l;n===s?t=c-m:a===s?t=1/3+d-c:o===s&&(t=2/3+m-d),0>t&&(t+=1),t>1&&(t-=1)}return t=360*t,i=100*i,h=100*h,[t,i,h]}function F(e){var t,i,n=e[0]/255,a=e[1]/255,o=e[2]/255,r=Math.min(n,a,o),s=Math.max(n,a,o),l=s-r,h=(s+r)/2;if(0===l)t=0,i=0;else{i=.5>h?l/(s+r):l/(2-s-r);var d=((s-n)/6+l/2)/l,m=((s-a)/6+l/2)/l,c=((s-o)/6+l/2)/l;n===s?t=c-m:a===s?t=1/3+d-c:o===s&&(t=2/3+m-d),0>t&&(t+=1),t>1&&(t-=1)}return t=360*t,i=100*i,h=100*h,[t,i,h]}var O,P=e("../tool/util"),D=["#ff9277"," #dddd00"," #ffc877"," #bbe3ff"," #d5ffbb","#bbbbff"," #ddb000"," #b0dd00"," #e2bbff"," #ffbbe3","#ff7777"," #ff9900"," #83dd00"," #77e3ff"," #778fff","#c877ff"," #ff77ab"," #ff6600"," #aa8800"," #77c7ff","#ad77ff"," #ff77ff"," #dd0083"," #777700"," #00aa00","#0088aa"," #8400dd"," #aa0088"," #dd0000"," #772e00"],N=D,B="rgba(255,255,0,0.5)",H=B,R=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,G={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#789",lightslategrey:"#789",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#f0f",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"};return{customPalette:t,resetPalette:i,getColor:n,getHighlightColor:r,customHighlight:a,resetHighlight:o,getRadialGradient:s,getLinearGradient:l,getGradientColors:d,getStepColors:h,reverse:w,mix:X,lift:W,trim:L,random:I,toRGB:V,toRGBA:u,toHex:U,toHSL:x,toHSLA:_,toHSB:b,toHSBA:f,toHSV:y,toHSVA:g,toName:k,toColor:m,toArray:c,alpha:S,getData:K}}),define("echarts/component/timeline",["require","./base","zrender/shape/Rectangle","../util/shape/Icon","../util/shape/Chain","../config","zrender/tool/util","zrender/tool/area","zrender/tool/event","../component"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o);var r=this;if(r._onclick=function(e){return r.__onclick(e)},r._ondrift=function(e,t){return r.__ondrift(this,e,t)},r._ondragend=function(){return r.__ondragend()},r._setCurrentOption=function(){var e=r.timelineOption;r.currentIndex%=e.data.length;var t=r.options[r.currentIndex]||{};r.myChart.setOption(t,e.notMerge),r.messageCenter.dispatch(s.EVENT.TIMELINE_CHANGED,null,{currentIndex:r.currentIndex,data:null!=e.data[r.currentIndex].name?e.data[r.currentIndex].name:e.data[r.currentIndex]},r.myChart)},r._onFrame=function(){r._setCurrentOption(),r._syncHandleShape(),r.timelineOption.autoPlay&&(r.playTicket=setTimeout(function(){return r.currentIndex+=1,!r.timelineOption.loop&&r.currentIndex>=r.timelineOption.data.length?(r.currentIndex=r.timelineOption.data.length-1,void r.stop()):void r._onFrame()},r.timelineOption.playInterval))},this.setTheme(!1),this.options=this.option.options,this.currentIndex=this.timelineOption.currentIndex%this.timelineOption.data.length,this.timelineOption.notMerge||0===this.currentIndex||(this.options[this.currentIndex]=l.merge(this.options[this.currentIndex],this.options[0])),this.timelineOption.show&&(this._buildShape(),this._syncHandleShape()),this._setCurrentOption(),this.timelineOption.autoPlay){var r=this;this.playTicket=setTimeout(function(){r.play()},null!=this.ecTheme.animationDuration?this.ecTheme.animationDuration:s.animationDuration)}}function i(e,t){var i=2,n=t.x+i,a=t.y+i+2,r=t.width-i,s=t.height-i,l=t.symbol;if("last"===l)e.moveTo(n+r-2,a+s/3),e.lineTo(n+r-2,a),e.lineTo(n+2,a+s/2),e.lineTo(n+r-2,a+s),e.lineTo(n+r-2,a+s/3*2),e.moveTo(n,a),e.lineTo(n,a);else if("next"===l)e.moveTo(n+2,a+s/3),e.lineTo(n+2,a),e.lineTo(n+r-2,a+s/2),e.lineTo(n+2,a+s),e.lineTo(n+2,a+s/3*2),e.moveTo(n,a),e.lineTo(n,a);else if("play"===l)if("stop"===t.status)e.moveTo(n+2,a),e.lineTo(n+r-2,a+s/2),e.lineTo(n+2,a+s),e.lineTo(n+2,a);else{var h="both"===t.brushType?2:3;e.rect(n+2,a,h,s),e.rect(n+r-h-2,a,h,s)}else if(l.match("image")){var d="";d=l.replace(new RegExp("^image:\\/\\/"),""),l=o.prototype.iconLibrary.image,l(e,{x:n,y:a,width:r,height:s,image:d})}}var n=e("./base"),a=e("zrender/shape/Rectangle"),o=e("../util/shape/Icon"),r=e("../util/shape/Chain"),s=e("../config");s.timeline={zlevel:0,z:4,show:!0,type:"time",notMerge:!1,realtime:!0,x:80,x2:80,y2:0,height:50,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,controlPosition:"left",autoPlay:!1,loop:!0,playInterval:2e3,lineStyle:{width:1,color:"#666",type:"dashed"},label:{show:!0,interval:"auto",rotate:0,textStyle:{color:"#333"}},checkpointStyle:{symbol:"auto",symbolSize:"auto",color:"auto",borderColor:"auto",borderWidth:"auto",label:{show:!1,textStyle:{color:"auto"}}},controlStyle:{itemSize:15,itemGap:5,normal:{color:"#333"},emphasis:{color:"#1e90ff"}},symbol:"emptyDiamond",symbolSize:4,currentIndex:0};var l=e("zrender/tool/util"),h=e("zrender/tool/area"),d=e("zrender/tool/event");return t.prototype={type:s.COMPONENT_TYPE_TIMELINE,_buildShape:function(){if(this._location=this._getLocation(),this._buildBackground(),this._buildControl(),this._chainPoint=this._getChainPoint(),this.timelineOption.label.show)for(var e=this._getInterval(),t=0,i=this._chainPoint.length;i>t;t+=e)this._chainPoint[t].showLabel=!0;this._buildChain(),this._buildHandle();for(var t=0,n=this.shapeList.length;n>t;t++)this.zr.addShape(this.shapeList[t])},_getLocation:function(){var e,t=this.timelineOption,i=this.reformCssArray(this.timelineOption.padding),n=this.zr.getWidth(),a=this.parsePercent(t.x,n),o=this.parsePercent(t.x2,n);null==t.width?(e=n-a-o,o=n-o):(e=this.parsePercent(t.width,n),o=a+e);var r,s,l=this.zr.getHeight(),h=this.parsePercent(t.height,l);return null!=t.y?(r=this.parsePercent(t.y,l),s=r+h):(s=l-this.parsePercent(t.y2,l),r=s-h),{x:a+i[3],y:r+i[0],x2:o-i[1],y2:s-i[2],width:e-i[1]-i[3],height:h-i[0]-i[2]}},_getReformedLabel:function(e){var t=this.timelineOption,i=null!=t.data[e].name?t.data[e].name:t.data[e],n=t.data[e].formatter||t.label.formatter;return n&&("function"==typeof n?i=n.call(this.myChart,i):"string"==typeof n&&(i=n.replace("{value}",i))),i},_getInterval:function(){var e=this._chainPoint,t=this.timelineOption,i=t.label.interval;if("auto"===i){var n=t.label.textStyle.fontSize,a=t.data,o=t.data.length;if(o>3){var r,s,l=!1;for(i=0;!l&&o>i;){i++,l=!0;for(var d=i;o>d;d+=i){if(r=e[d].x-e[d-i].x,0!==t.label.rotate)s=n;else if(a[d].textStyle)s=h.getTextWidth(e[d].name,e[d].textFont);else{var m=e[d].name+"",c=(m.match(/\w/g)||"").length,p=m.length-c;s=c*n*2/3+p*n}if(s>r){l=!1;break}}}}else i=1}else i=i-0+1;return i},_getChainPoint:function(){function e(e){return null!=h[e].name?h[e].name:h[e]+""}var t,i=this.timelineOption,n=i.symbol.toLowerCase(),a=i.symbolSize,o=i.label.rotate,r=i.label.textStyle,s=this.getFont(r),h=i.data,d=this._location.x,m=this._location.y+this._location.height/4*3,c=this._location.x2-this._location.x,p=h.length,u=[];if(p>1){var V=c/p;if(V=V>50?50:20>V?5:V,c-=2*V,"number"===i.type)for(var U=0;p>U;U++)u.push(d+V+c/(p-1)*U);else{u[0]=new Date(e(0).replace(/-/g,"/")),u[p-1]=new Date(e(p-1).replace(/-/g,"/"))-u[0];for(var U=1;p>U;U++)u[U]=d+V+c*(new Date(e(U).replace(/-/g,"/"))-u[0])/u[p-1];u[0]=d+V}}else u.push(d+c/2);for(var g,y,f,b,_,x=[],U=0;p>U;U++)d=u[U],g=h[U].symbol&&h[U].symbol.toLowerCase()||n,g.match("empty")?(g=g.replace("empty",""),f=!0):f=!1,g.match("star")&&(y=g.replace("star","")-0||5,g="star"),t=h[U].textStyle?l.merge(h[U].textStyle||{},r):r,b=t.align||"center",o?(b=o>0?"right":"left",_=[o*Math.PI/180,d,m-5]):_=!1,x.push({x:d,n:y,isEmpty:f,symbol:g,symbolSize:h[U].symbolSize||a,color:h[U].color,borderColor:h[U].borderColor,borderWidth:h[U].borderWidth,name:this._getReformedLabel(U),textColor:t.color,textAlign:b,textBaseline:t.baseline||"middle",textX:d,textY:m-(o?5:0),textFont:h[U].textStyle?this.getFont(t):s,rotation:_,showLabel:!1});return x},_buildBackground:function(){var e=this.timelineOption,t=this.reformCssArray(this.timelineOption.padding),i=this._location.width,n=this._location.height;(0!==e.borderWidth||"rgba(0,0,0,0)"!=e.backgroundColor.replace(/\s/g,""))&&this.shapeList.push(new a({zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this._location.x-t[3],y:this._location.y-t[0],width:i+t[1]+t[3],height:n+t[0]+t[2],brushType:0===e.borderWidth?"fill":"both",color:e.backgroundColor,strokeColor:e.borderColor,lineWidth:e.borderWidth}}))},_buildControl:function(){var e=this,t=this.timelineOption,i=t.lineStyle,n=t.controlStyle;if("none"!==t.controlPosition){var a,r=n.itemSize,s=n.itemGap;"left"===t.controlPosition?(a=this._location.x,this._location.x+=3*(r+s)):(a=this._location.x2-(3*(r+s)-s),this._location.x2-=3*(r+s));var h=this._location.y,d={zlevel:this.getZlevelBase(),z:this.getZBase()+1,style:{iconType:"timelineControl",symbol:"last",x:a,y:h,width:r,height:r,brushType:"stroke",color:n.normal.color,strokeColor:n.normal.color,lineWidth:i.width},highlightStyle:{color:n.emphasis.color,strokeColor:n.emphasis.color,lineWidth:i.width+1},clickable:!0};this._ctrLastShape=new o(d),this._ctrLastShape.onclick=function(){e.last()},this.shapeList.push(this._ctrLastShape),a+=r+s,this._ctrPlayShape=new o(l.clone(d)),this._ctrPlayShape.style.brushType="fill",this._ctrPlayShape.style.symbol="play",this._ctrPlayShape.style.status=this.timelineOption.autoPlay?"playing":"stop",this._ctrPlayShape.style.x=a,this._ctrPlayShape.onclick=function(){"stop"===e._ctrPlayShape.style.status?e.play():e.stop()},this.shapeList.push(this._ctrPlayShape),a+=r+s,this._ctrNextShape=new o(l.clone(d)),this._ctrNextShape.style.symbol="next",this._ctrNextShape.style.x=a,this._ctrNextShape.onclick=function(){e.next()},this.shapeList.push(this._ctrNextShape)}},_buildChain:function(){var e=this.timelineOption,t=e.lineStyle;this._timelineShae={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:this._location.x,y:this.subPixelOptimize(this._location.y,t.width),width:this._location.x2-this._location.x,height:this._location.height,chainPoint:this._chainPoint,brushType:"both",strokeColor:t.color,lineWidth:t.width,lineType:t.type},hoverable:!1,clickable:!0,onclick:this._onclick},this._timelineShae=new r(this._timelineShae),this.shapeList.push(this._timelineShae)},_buildHandle:function(){var e=this._chainPoint[this.currentIndex],t=e.symbolSize+1;t=5>t?5:t,this._handleShape={zlevel:this.getZlevelBase(),z:this.getZBase()+1,hoverable:!1,draggable:!0,style:{iconType:"diamond",n:e.n,x:e.x-t,y:this._location.y+this._location.height/4-t,width:2*t,height:2*t,brushType:"both",textPosition:"specific",textX:e.x,textY:this._location.y-this._location.height/4,textAlign:"center",textBaseline:"middle"},highlightStyle:{},ondrift:this._ondrift,ondragend:this._ondragend},this._handleShape=new o(this._handleShape),this.shapeList.push(this._handleShape)},_syncHandleShape:function(){if(this.timelineOption.show){var e=this.timelineOption,t=e.checkpointStyle,i=this._chainPoint[this.currentIndex];this._handleShape.style.text=t.label.show?i.name:"",this._handleShape.style.textFont=i.textFont,this._handleShape.style.n=i.n,"auto"===t.symbol?this._handleShape.style.iconType="none"!=i.symbol?i.symbol:"diamond":(this._handleShape.style.iconType=t.symbol,t.symbol.match("star")&&(this._handleShape.style.n=t.symbol.replace("star","")-0||5,this._handleShape.style.iconType="star"));var n;"auto"===t.symbolSize?(n=i.symbolSize+2,n=5>n?5:n):n=t.symbolSize-0,this._handleShape.style.color="auto"===t.color?i.color?i.color:e.controlStyle.emphasis.color:t.color,this._handleShape.style.textColor="auto"===t.label.textStyle.color?this._handleShape.style.color:t.label.textStyle.color,this._handleShape.highlightStyle.strokeColor=this._handleShape.style.strokeColor="auto"===t.borderColor?i.borderColor?i.borderColor:"#fff":t.borderColor,this._handleShape.style.lineWidth="auto"===t.borderWidth?i.borderWidth?i.borderWidth:0:t.borderWidth-0,this._handleShape.highlightStyle.lineWidth=this._handleShape.style.lineWidth+1,this.zr.animate(this._handleShape.id,"style").when(500,{x:i.x-n,textX:i.x,y:this._location.y+this._location.height/4-n,width:2*n,height:2*n}).start("ExponentialOut")}},_findChainIndex:function(e){var t=this._chainPoint,i=t.length;if(e<=t[0].x)return 0;if(e>=t[i-1].x)return i-1;for(var n=0;i-1>n;n++)if(e>=t[n].x&&e<=t[n+1].x)return Math.abs(e-t[n].x)=n[a-1].x-n[a-1].symbolSize?(e.style.x=n[a-1].x-n[a-1].symbolSize,i=a-1):(e.style.x+=t,i=this._findChainIndex(e.style.x));var o=n[i],r=o.symbolSize+2;if(e.style.iconType=o.symbol,e.style.n=o.n,e.style.textX=e.style.x+r/2,e.style.y=this._location.y+this._location.height/4-r,e.style.width=2*r,e.style.height=2*r,e.style.text=o.name,i===this.currentIndex)return!0;if(this.currentIndex=i,this.timelineOption.realtime){clearTimeout(this.playTicket);var s=this;this.playTicket=setTimeout(function(){s._setCurrentOption()},200)}return!0},__ondragend:function(){this.isDragend=!0},ondragend:function(e,t){this.isDragend&&e.target&&(!this.timelineOption.realtime&&this._setCurrentOption(),t.dragOut=!0,t.dragIn=!0,t.needRefresh=!1,this.isDragend=!1,this._syncHandleShape())},last:function(){return this.timelineOption.autoPlay&&this.stop(),this.currentIndex-=1,this.currentIndex<0&&(this.currentIndex=this.timelineOption.data.length-1),this._onFrame(),this.currentIndex},next:function(){return this.timelineOption.autoPlay&&this.stop(),this.currentIndex+=1,this.currentIndex>=this.timelineOption.data.length&&(this.currentIndex=0),this._onFrame(),this.currentIndex},play:function(e,t){return this._ctrPlayShape&&"playing"!=this._ctrPlayShape.style.status&&(this._ctrPlayShape.style.status="playing",this.zr.modShape(this._ctrPlayShape.id),this.zr.refreshNextFrame()),this.timelineOption.autoPlay=null!=t?t:!0,this.timelineOption.autoPlay||clearTimeout(this.playTicket),this.currentIndex=null!=e?e:this.currentIndex+1,this.currentIndex>=this.timelineOption.data.length&&(this.currentIndex=0),this._onFrame(),this.currentIndex},stop:function(){return this._ctrPlayShape&&"stop"!=this._ctrPlayShape.style.status&&(this._ctrPlayShape.style.status="stop",this.zr.modShape(this._ctrPlayShape.id),this.zr.refreshNextFrame()),this.timelineOption.autoPlay=!1,clearTimeout(this.playTicket),this.currentIndex +},resize:function(){this.timelineOption.show&&(this.clear(),this._buildShape(),this._syncHandleShape())},setTheme:function(e){this.timelineOption=this.reformOption(l.clone(this.option.timeline)),this.timelineOption.label.textStyle=this.getTextStyle(this.timelineOption.label.textStyle),this.timelineOption.checkpointStyle.label.textStyle=this.getTextStyle(this.timelineOption.checkpointStyle.label.textStyle),this.myChart.canvasSupported||(this.timelineOption.realtime=!1),this.timelineOption.show&&e&&(this.clear(),this._buildShape(),this._syncHandleShape())},onbeforDispose:function(){clearTimeout(this.playTicket)}},o.prototype.iconLibrary.timelineControl=i,l.inherits(t,n),e("../component").define("timeline",t),t}),define("zrender/shape/Image",["require","./Base","../tool/util"],function(e){var t=e("./Base"),i=function(e){t.call(this,e)};return i.prototype={type:"image",brush:function(e,t,i){var n=this.style||{};t&&(n=this.getHighlightStyle(n,this.highlightStyle||{}));var a=n.image,o=this;if(this._imageCache||(this._imageCache={}),"string"==typeof a){var r=a;this._imageCache[r]?a=this._imageCache[r]:(a=new Image,a.onload=function(){a.onload=null,o.modSelf(),i()},a.src=r,this._imageCache[r]=a)}if(a){if("IMG"==a.nodeName.toUpperCase())if(window.ActiveXObject){if("complete"!=a.readyState)return}else if(!a.complete)return;var s=n.width||a.width,l=n.height||a.height,h=n.x,d=n.y;if(!a.width||!a.height)return;if(e.save(),this.doClip(e),this.setContext(e,n),this.setTransform(e),n.sWidth&&n.sHeight){var m=n.sx||0,c=n.sy||0;e.drawImage(a,m,c,n.sWidth,n.sHeight,h,d,s,l)}else if(n.sx&&n.sy){var m=n.sx,c=n.sy,p=s-m,u=l-c;e.drawImage(a,m,c,p,u,h,d,s,l)}else e.drawImage(a,h,d,s,l);n.width||(n.width=s),n.height||(n.height=l),this.style.width||(this.style.width=s),this.style.height||(this.style.height=l),this.drawText(e,n,this.style),e.restore()}},getRect:function(e){return{x:e.x,y:e.y,width:e.width,height:e.height}},clearCache:function(){this._imageCache={}}},e("../tool/util").inherits(i,t),i}),define("zrender/loadingEffect/Bar",["require","./Base","../tool/util","../tool/color","../shape/Rectangle"],function(e){function t(e){i.call(this,e)}var i=e("./Base"),n=e("../tool/util"),a=e("../tool/color"),o=e("../shape/Rectangle");return n.inherits(t,i),t.prototype._start=function(e,t){var i=n.merge(this.options,{textStyle:{color:"#888"},backgroundColor:"rgba(250, 250, 250, 0.8)",effectOption:{x:0,y:this.canvasHeight/2-30,width:this.canvasWidth,height:5,brushType:"fill",timeInterval:100}}),r=this.createTextShape(i.textStyle),s=this.createBackgroundShape(i.backgroundColor),l=i.effectOption,h=new o({highlightStyle:n.clone(l)});return h.highlightStyle.color=l.color||a.getLinearGradient(l.x,l.y,l.x+l.width,l.y+l.height,[[0,"#ff6400"],[.5,"#ffe100"],[1,"#b1ff00"]]),null!=i.progress?(e(s),h.highlightStyle.width=this.adjust(i.progress,[0,1])*i.effectOption.width,e(h),e(r),void t()):(h.highlightStyle.width=0,setInterval(function(){e(s),h.highlightStyle.widthV;V++){var U="random"==l.color?a.alpha(a.random(),.3):l.color;c[V]=new o({highlightStyle:{x:Math.ceil(Math.random()*p),y:Math.ceil(Math.random()*u),r:Math.ceil(40*Math.random()),brushType:d,color:U,strokeColor:U,lineWidth:m},animationY:Math.ceil(20*Math.random())})}return setInterval(function(){e(s);for(var i=0;h>i;i++){var n=c[i].highlightStyle;n.y-c[i].animationY+n.r<=0&&(c[i].highlightStyle.y=u+n.r,c[i].highlightStyle.x=Math.ceil(Math.random()*p)),c[i].highlightStyle.y-=c[i].animationY,e(c[i])}e(r),t()},l.timeInterval)},t}),define("zrender/loadingEffect/DynamicLine",["require","./Base","../tool/util","../tool/color","../shape/Line"],function(e){function t(e){i.call(this,e)}var i=e("./Base"),n=e("../tool/util"),a=e("../tool/color"),o=e("../shape/Line");return n.inherits(t,i),t.prototype._start=function(e,t){for(var i=n.merge(this.options,{textStyle:{color:"#fff"},backgroundColor:"rgba(0, 0, 0, 0.8)",effectOption:{n:30,lineWidth:1,color:"random",timeInterval:100}}),r=this.createTextShape(i.textStyle),s=this.createBackgroundShape(i.backgroundColor),l=i.effectOption,h=l.n,d=l.lineWidth,m=[],c=this.canvasWidth,p=this.canvasHeight,u=0;h>u;u++){var V=-Math.ceil(1e3*Math.random()),U=Math.ceil(400*Math.random()),g=Math.ceil(Math.random()*p),y="random"==l.color?a.random():l.color;m[u]=new o({highlightStyle:{xStart:V,yStart:g,xEnd:V+U,yEnd:g,strokeColor:y,lineWidth:d},animationX:Math.ceil(100*Math.random()),len:U})}return setInterval(function(){e(s);for(var i=0;h>i;i++){var n=m[i].highlightStyle;n.xStart>=c&&(m[i].len=Math.ceil(400*Math.random()),n.xStart=-400,n.xEnd=-400+m[i].len,n.yStart=Math.ceil(Math.random()*p),n.yEnd=n.yStart),n.xStart+=m[i].animationX,n.xEnd+=m[i].animationX,e(m[i])}e(r),t()},l.timeInterval)},t}),define("zrender/loadingEffect/Ring",["require","./Base","../tool/util","../tool/color","../shape/Ring","../shape/Sector"],function(e){function t(e){i.call(this,e)}var i=e("./Base"),n=e("../tool/util"),a=e("../tool/color"),o=e("../shape/Ring"),r=e("../shape/Sector");return n.inherits(t,i),t.prototype._start=function(e,t){var i=n.merge(this.options,{textStyle:{color:"#07a"},backgroundColor:"rgba(250, 250, 250, 0.8)",effect:{x:this.canvasWidth/2,y:this.canvasHeight/2,r0:60,r:100,color:"#bbdcff",brushType:"fill",textPosition:"inside",textFont:"normal 30px verdana",textColor:"rgba(30, 144, 255, 0.6)",timeInterval:100}}),s=i.effect,l=i.textStyle;null==l.x&&(l.x=s.x),null==l.y&&(l.y=s.y+(s.r0+s.r)/2-5);for(var h=this.createTextShape(i.textStyle),d=this.createBackgroundShape(i.backgroundColor),m=s.x,c=s.y,p=s.r0+6,u=s.r-6,V=s.color,U=a.lift(V,.1),g=new o({highlightStyle:n.clone(s)}),y=[],f=a.getGradientColors(["#ff6400","#ffe100","#97ff00"],25),b=15,_=240,x=0;16>x;x++)y.push(new r({highlightStyle:{x:m,y:c,r0:p,r:u,startAngle:_-b,endAngle:_,brushType:"fill",color:U},_color:a.getLinearGradient(m+p*Math.cos(_,!0),c-p*Math.sin(_,!0),m+p*Math.cos(_-b,!0),c-p*Math.sin(_-b,!0),[[0,f[2*x]],[1,f[2*x+1]]])})),_-=b;_=360;for(var x=0;4>x;x++)y.push(new r({highlightStyle:{x:m,y:c,r0:p,r:u,startAngle:_-b,endAngle:_,brushType:"fill",color:U},_color:a.getLinearGradient(m+p*Math.cos(_,!0),c-p*Math.sin(_,!0),m+p*Math.cos(_-b,!0),c-p*Math.sin(_-b,!0),[[0,f[2*x+32]],[1,f[2*x+33]]])})),_-=b;var k=0;if(null!=i.progress){e(d),k=100*this.adjust(i.progress,[0,1]).toFixed(2)/5,g.highlightStyle.text=5*k+"%",e(g);for(var x=0;20>x;x++)y[x].highlightStyle.color=k>x?y[x]._color:U,e(y[x]);return e(h),void t()}return setInterval(function(){e(d),k+=k>=20?-20:1,e(g);for(var i=0;20>i;i++)y[i].highlightStyle.color=k>i?y[i]._color:U,e(y[i]);e(h),t()},s.timeInterval)},t}),define("zrender/loadingEffect/Spin",["require","./Base","../tool/util","../tool/color","../tool/area","../shape/Sector"],function(e){function t(e){i.call(this,e)}var i=e("./Base"),n=e("../tool/util"),a=e("../tool/color"),o=e("../tool/area"),r=e("../shape/Sector");return n.inherits(t,i),t.prototype._start=function(e,t){var i=n.merge(this.options,{textStyle:{color:"#fff",textAlign:"start"},backgroundColor:"rgba(0, 0, 0, 0.8)"}),s=this.createTextShape(i.textStyle),l=10,h=o.getTextWidth(s.highlightStyle.text,s.highlightStyle.textFont),d=o.getTextHeight(s.highlightStyle.text,s.highlightStyle.textFont),m=n.merge(this.options.effect||{},{r0:9,r:15,n:18,color:"#fff",timeInterval:100}),c=this.getLocation(this.options.textStyle,h+l+2*m.r,Math.max(2*m.r,d));m.x=c.x+m.r,m.y=s.highlightStyle.y=c.y+c.height/2,s.highlightStyle.x=m.x+m.r+l;for(var p=this.createBackgroundShape(i.backgroundColor),u=m.n,V=m.x,U=m.y,g=m.r0,y=m.r,f=m.color,b=[],_=Math.round(180/u),x=0;u>x;x++)b[x]=new r({highlightStyle:{x:V,y:U,r0:g,r:y,startAngle:_*x*2,endAngle:_*x*2+_,color:a.alpha(f,(x+1)/u),brushType:"fill"}});var k=[0,V,U];return setInterval(function(){e(p),k[0]-=.3;for(var i=0;u>i;i++)b[i].rotation=k,e(b[i]);e(s),t()},m.timeInterval)},t}),define("zrender/loadingEffect/Whirling",["require","./Base","../tool/util","../tool/area","../shape/Ring","../shape/Droplet","../shape/Circle"],function(e){function t(e){i.call(this,e)}var i=e("./Base"),n=e("../tool/util"),a=e("../tool/area"),o=e("../shape/Ring"),r=e("../shape/Droplet"),s=e("../shape/Circle");return n.inherits(t,i),t.prototype._start=function(e,t){var i=n.merge(this.options,{textStyle:{color:"#888",textAlign:"start"},backgroundColor:"rgba(250, 250, 250, 0.8)"}),l=this.createTextShape(i.textStyle),h=10,d=a.getTextWidth(l.highlightStyle.text,l.highlightStyle.textFont),m=a.getTextHeight(l.highlightStyle.text,l.highlightStyle.textFont),c=n.merge(this.options.effect||{},{r:18,colorIn:"#fff",colorOut:"#555",colorWhirl:"#6cf",timeInterval:50}),p=this.getLocation(this.options.textStyle,d+h+2*c.r,Math.max(2*c.r,m));c.x=p.x+c.r,c.y=l.highlightStyle.y=p.y+p.height/2,l.highlightStyle.x=c.x+c.r+h;var u=this.createBackgroundShape(i.backgroundColor),V=new r({highlightStyle:{a:Math.round(c.r/2),b:Math.round(c.r-c.r/6),brushType:"fill",color:c.colorWhirl}}),U=new s({highlightStyle:{r:Math.round(c.r/6),brushType:"fill",color:c.colorIn}}),g=new o({highlightStyle:{r0:Math.round(c.r-c.r/3),r:c.r,brushType:"fill",color:c.colorOut}}),y=[0,c.x,c.y];return V.highlightStyle.x=U.highlightStyle.x=g.highlightStyle.x=y[1],V.highlightStyle.y=U.highlightStyle.y=g.highlightStyle.y=y[2],setInterval(function(){e(u),e(g),y[0]-=.3,V.rotation=y,e(V),e(U),e(l),t()},c.timeInterval)},t}),define("echarts/theme/macarons",[],function(){var e={color:["#2ec7c9","#b6a2de","#5ab1ef","#ffb980","#d87a80","#8d98b3","#e5cf0d","#97b552","#95706d","#dc69aa","#07a2a4","#9a7fd1","#588dd5","#f5994e","#c05050","#59678c","#c9ab00","#7eb00a","#6f5553","#c14089"],title:{textStyle:{fontWeight:"normal",color:"#008acd"}},dataRange:{itemWidth:15,color:["#5ab1ef","#e0ffff"]},toolbox:{color:["#1e90ff","#1e90ff","#1e90ff","#1e90ff"],effectiveColor:"#ff4500"},tooltip:{backgroundColor:"rgba(50,50,50,0.5)",axisPointer:{type:"line",lineStyle:{color:"#008acd"},crossStyle:{color:"#008acd"},shadowStyle:{color:"rgba(200,200,200,0.2)"}}},dataZoom:{dataBackgroundColor:"#efefff",fillerColor:"rgba(182,162,222,0.2)",handleColor:"#008acd"},grid:{borderColor:"#eee"},categoryAxis:{axisLine:{lineStyle:{color:"#008acd"}},splitLine:{lineStyle:{color:["#eee"]}}},valueAxis:{axisLine:{lineStyle:{color:"#008acd"}},splitArea:{show:!0,areaStyle:{color:["rgba(250,250,250,0.1)","rgba(200,200,200,0.1)"]}},splitLine:{lineStyle:{color:["#eee"]}}},polar:{axisLine:{lineStyle:{color:"#ddd"}},splitArea:{show:!0,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(200,200,200,0.2)"]}},splitLine:{lineStyle:{color:"#ddd"}}},timeline:{lineStyle:{color:"#008acd"},controlStyle:{normal:{color:"#008acd"},emphasis:{color:"#008acd"}},symbol:"emptyCircle",symbolSize:3},bar:{itemStyle:{normal:{barBorderRadius:5},emphasis:{barBorderRadius:5}}},line:{smooth:!0,symbol:"emptyCircle",symbolSize:3},k:{itemStyle:{normal:{color:"#d87a80",color0:"#2ec7c9",lineStyle:{color:"#d87a80",color0:"#2ec7c9"}}}},scatter:{symbol:"circle",symbolSize:4},radar:{symbol:"emptyCircle",symbolSize:3},map:{itemStyle:{normal:{areaStyle:{color:"#ddd"},label:{textStyle:{color:"#d87a80"}}},emphasis:{areaStyle:{color:"#fe994e"}}}},force:{itemStyle:{normal:{linkStyle:{color:"#1e90ff"}}}},chord:{itemStyle:{normal:{borderWidth:1,borderColor:"rgba(128, 128, 128, 0.5)",chordStyle:{lineStyle:{color:"rgba(128, 128, 128, 0.5)"}}},emphasis:{borderWidth:1,borderColor:"rgba(128, 128, 128, 0.5)",chordStyle:{lineStyle:{color:"rgba(128, 128, 128, 0.5)"}}}}},gauge:{axisLine:{lineStyle:{color:[[.2,"#2ec7c9"],[.8,"#5ab1ef"],[1,"#d87a80"]],width:10}},axisTick:{splitNumber:10,length:15,lineStyle:{color:"auto"}},splitLine:{length:22,lineStyle:{color:"auto"}},pointer:{width:5}},textStyle:{fontFamily:"微软雅黑, Arial, Verdana, sans-serif"}};return e}),define("echarts/theme/infographic",[],function(){var e={color:["#C1232B","#B5C334","#FCCE10","#E87C25","#27727B","#FE8463","#9BCA63","#FAD860","#F3A43B","#60C0DD","#D7504B","#C6E579","#F4E001","#F0805A","#26C0C0"],title:{textStyle:{fontWeight:"normal",color:"#27727B"}},dataRange:{x:"right",y:"center",itemWidth:5,itemHeight:25,color:["#C1232B","#FCCE10"]},toolbox:{color:["#C1232B","#B5C334","#FCCE10","#E87C25","#27727B","#FE8463","#9BCA63","#FAD860","#F3A43B","#60C0DD"],effectiveColor:"#ff4500"},tooltip:{backgroundColor:"rgba(50,50,50,0.5)",axisPointer:{type:"line",lineStyle:{color:"#27727B",type:"dashed"},crossStyle:{color:"#27727B"},shadowStyle:{color:"rgba(200,200,200,0.3)"}}},dataZoom:{dataBackgroundColor:"rgba(181,195,52,0.3)",fillerColor:"rgba(181,195,52,0.2)",handleColor:"#27727B"},grid:{borderWidth:0},categoryAxis:{axisLine:{lineStyle:{color:"#27727B"}},splitLine:{show:!1}},valueAxis:{axisLine:{show:!1},splitArea:{show:!1},splitLine:{lineStyle:{color:["#ccc"],type:"dashed"}}},polar:{axisLine:{lineStyle:{color:"#ddd"}},splitArea:{show:!0,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(200,200,200,0.2)"]}},splitLine:{lineStyle:{color:"#ddd"}}},timeline:{lineStyle:{color:"#27727B"},controlStyle:{normal:{color:"#27727B"},emphasis:{color:"#27727B"}},symbol:"emptyCircle",symbolSize:3},line:{itemStyle:{normal:{borderWidth:2,borderColor:"#fff",lineStyle:{width:3}},emphasis:{borderWidth:0}},symbol:"circle",symbolSize:3.5},k:{itemStyle:{normal:{color:"#C1232B",color0:"#B5C334",lineStyle:{width:1,color:"#C1232B",color0:"#B5C334"}}}},scatter:{itemdStyle:{normal:{borderWidth:1,borderColor:"rgba(200,200,200,0.5)"},emphasis:{borderWidth:0}},symbol:"star4",symbolSize:4},radar:{symbol:"emptyCircle",symbolSize:3},map:{itemStyle:{normal:{areaStyle:{color:"#ddd"},label:{textStyle:{color:"#C1232B"}}},emphasis:{areaStyle:{color:"#fe994e"},label:{textStyle:{color:"rgb(100,0,0)"}}}}},force:{itemStyle:{normal:{linkStyle:{color:"#27727B"}}}},chord:{itemStyle:{normal:{borderWidth:1,borderColor:"rgba(128, 128, 128, 0.5)",chordStyle:{lineStyle:{color:"rgba(128, 128, 128, 0.5)"}}},emphasis:{borderWidth:1,borderColor:"rgba(128, 128, 128, 0.5)",chordStyle:{lineStyle:{color:"rgba(128, 128, 128, 0.5)"}}}}},gauge:{center:["50%","80%"],radius:"100%",startAngle:180,endAngle:0,axisLine:{show:!0,lineStyle:{color:[[.2,"#B5C334"],[.8,"#27727B"],[1,"#C1232B"]],width:"40%"}},axisTick:{splitNumber:2,length:5,lineStyle:{color:"#fff"}},axisLabel:{textStyle:{color:"#fff",fontWeight:"bolder"}},splitLine:{length:"5%",lineStyle:{color:"#fff"}},pointer:{width:"40%",length:"80%",color:"#fff"},title:{offsetCenter:[0,-20],textStyle:{color:"auto",fontSize:20}},detail:{offsetCenter:[0,0],textStyle:{color:"auto",fontSize:40}}},textStyle:{fontFamily:"微软雅黑, Arial, Verdana, sans-serif"}};return e}),define("zrender/dep/excanvas",["require"],function(){return document.createElement("canvas").getContext?G_vmlCanvasManager=!1:!function(){function e(){return this.context_||(this.context_=new b(this))}function t(e,t){var i=O.call(arguments,2);return function(){return e.apply(t,i.concat(O.call(arguments)))}}function i(e){return String(e).replace(/&/g,"&").replace(/"/g,""")}function n(e,t,i){e.namespaces[t]||e.namespaces.add(t,i,"#default#VML")}function a(e){if(n(e,"g_vml_","urn:schemas-microsoft-com:vml"),n(e,"g_o_","urn:schemas-microsoft-com:office:office"),!e.styleSheets.ex_canvas_){var t=e.createStyleSheet();t.owningElement.id="ex_canvas_",t.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}function o(e){var t=e.srcElement;switch(e.propertyName){case"width":t.getContext().clearRect(),t.style.width=t.attributes.width.nodeValue+"px",t.firstChild.style.width=t.clientWidth+"px";break;case"height":t.getContext().clearRect(),t.style.height=t.attributes.height.nodeValue+"px",t.firstChild.style.height=t.clientHeight+"px"}}function r(e){var t=e.srcElement;t.firstChild&&(t.firstChild.style.width=t.clientWidth+"px",t.firstChild.style.height=t.clientHeight+"px")}function s(){return[[1,0,0],[0,1,0],[0,0,1]]}function l(e,t){for(var i=s(),n=0;3>n;n++)for(var a=0;3>a;a++){for(var o=0,r=0;3>r;r++)o+=e[n][r]*t[r][a];i[n][a]=o}return i}function h(e,t){t.fillStyle=e.fillStyle,t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY,t.strokeStyle=e.strokeStyle,t.globalAlpha=e.globalAlpha,t.font=e.font,t.textAlign=e.textAlign,t.textBaseline=e.textBaseline,t.scaleX_=e.scaleX_,t.scaleY_=e.scaleY_,t.lineScale_=e.lineScale_}function d(e){var t=e.indexOf("(",3),i=e.indexOf(")",t+1),n=e.substring(t+1,i).split(",");return(4!=n.length||"a"!=e.charAt(3))&&(n[3]=1),n}function m(e){return parseFloat(e)/100}function c(e,t,i){return Math.min(i,Math.max(t,e))}function p(e){var t,i,n,a,o,r;if(a=parseFloat(e[0])/360%360,0>a&&a++,o=c(m(e[1]),0,1),r=c(m(e[2]),0,1),0==o)t=i=n=r;else{var s=.5>r?r*(1+o):r+o-r*o,l=2*r-s;t=u(l,s,a+1/3),i=u(l,s,a),n=u(l,s,a-1/3)}return"#"+D[Math.floor(255*t)]+D[Math.floor(255*i)]+D[Math.floor(255*n)]}function u(e,t,i){return 0>i&&i++,i>1&&i--,1>6*i?e+6*(t-e)*i:1>2*i?t:2>3*i?e+(t-e)*(2/3-i)*6:e}function V(e){if(e in R)return R[e];var t,i=1;if(e=String(e),"#"==e.charAt(0))t=e;else if(/^rgb/.test(e)){for(var n,a=d(e),t="#",o=0;3>o;o++)n=-1!=a[o].indexOf("%")?Math.floor(255*m(a[o])):+a[o],t+=D[c(n,0,255)];i=+a[3]}else if(/^hsl/.test(e)){var a=d(e);t=p(a),i=a[3]}else t=H[e]||e;return R[e]={color:t,alpha:i}}function U(e){if(Y[e])return Y[e];var t,i=document.createElement("div"),n=i.style;try{n.font=e,t=n.fontFamily.split(",")[0]}catch(a){}return Y[e]={style:n.fontStyle||G.style,variant:n.fontVariant||G.variant,weight:n.fontWeight||G.weight,size:n.fontSize||G.size,family:t||G.family}}function g(e,t){var i={};for(var n in e)i[n]=e[n];var a=parseFloat(t.currentStyle.fontSize),o=parseFloat(e.size);return i.size="number"==typeof e.size?e.size:-1!=e.size.indexOf("px")?o:-1!=e.size.indexOf("em")?a*o:-1!=e.size.indexOf("%")?a/100*o:-1!=e.size.indexOf("pt")?o/.75:a,i}function y(e){return e.style+" "+e.variant+" "+e.weight+" "+e.size+"px '"+e.family+"'"}function f(e){return Z[e]||"square"}function b(e){this.m_=s(),this.mStack_=[],this.aStack_=[],this.currentPath_=[],this.strokeStyle="#000",this.fillStyle="#000",this.lineWidth=1,this.lineJoin="miter",this.lineCap="butt",this.miterLimit=1*J,this.globalAlpha=1,this.font="12px 微软雅黑",this.textAlign="left",this.textBaseline="alphabetic",this.canvas=e;var t="width:"+e.clientWidth+"px;height:"+e.clientHeight+"px;overflow:hidden;position:absolute",i=e.ownerDocument.createElement("div");i.style.cssText=t,e.appendChild(i);var n=i.cloneNode(!1);n.style.backgroundColor="#fff",n.style.filter="alpha(opacity=0)",e.appendChild(n),this.element_=i,this.scaleX_=1,this.scaleY_=1,this.lineScale_=1}function _(e,t,i,n){e.currentPath_.push({type:"bezierCurveTo",cp1x:t.x,cp1y:t.y,cp2x:i.x,cp2y:i.y,x:n.x,y:n.y}),e.currentX_=n.x,e.currentY_=n.y}function x(e,t){var i=V(e.strokeStyle),n=i.color,a=i.alpha*e.globalAlpha,o=e.lineScale_*e.lineWidth;1>o&&(a*=o),t.push("')}function k(e,t,i,n){var a=e.fillStyle,o=e.scaleX_,r=e.scaleY_,s=n.x-i.x,l=n.y-i.y;if(a instanceof w){var h=0,d={x:0,y:0},m=0,c=1;if("gradient"==a.type_){var p=a.x0_/o,u=a.y0_/r,U=a.x1_/o,g=a.y1_/r,y=L(e,p,u),f=L(e,U,g),b=f.x-y.x,_=f.y-y.y;h=180*Math.atan2(b,_)/Math.PI,0>h&&(h+=360),1e-6>h&&(h=0)}else{var y=L(e,a.x0_,a.y0_);d={x:(y.x-i.x)/s,y:(y.y-i.y)/l},s/=o*J,l/=r*J;var x=C.max(s,l);m=2*a.r0_/x,c=2*a.r1_/x-m}var k=a.colors_;k.sort(function(e,t){return e.offset-t.offset});for(var v=k.length,W=k[0].color,I=k[v-1].color,K=k[0].alpha*e.globalAlpha,S=k[v-1].alpha*e.globalAlpha,T=[],E=0;v>E;E++){var z=k[E];T.push(z.offset*c+m+" "+z.color)}t.push('')}else if(a instanceof X){if(s&&l){var A=-i.x,M=-i.y;t.push("')}}else{var F=V(e.fillStyle),O=F.color,P=F.alpha*e.globalAlpha;t.push('')}}function L(e,t,i){var n=e.m_;return{x:J*(t*n[0][0]+i*n[1][0]+n[2][0])-F,y:J*(t*n[0][1]+i*n[1][1]+n[2][1])-F}}function v(e){return isFinite(e[0][0])&&isFinite(e[0][1])&&isFinite(e[1][0])&&isFinite(e[1][1])&&isFinite(e[2][0])&&isFinite(e[2][1])}function W(e,t,i){if(v(t)&&(e.m_=t,e.scaleX_=Math.sqrt(t[0][0]*t[0][0]+t[0][1]*t[0][1]),e.scaleY_=Math.sqrt(t[1][0]*t[1][0]+t[1][1]*t[1][1]),i)){var n=t[0][0]*t[1][1]-t[0][1]*t[1][0];e.lineScale_=M(A(n))}}function w(e){this.type_=e,this.x0_=0,this.y0_=0,this.r0_=0,this.x1_=0,this.y1_=0,this.r1_=0,this.colors_=[]}function X(e,t){switch(K(e),t){case"repeat":case null:case"":this.repetition_="repeat";break;case"repeat-x":case"repeat-y":case"no-repeat":this.repetition_=t;break;default:I("SYNTAX_ERR")}this.src_=e.src,this.width_=e.width,this.height_=e.height}function I(e){throw new S(e)}function K(e){e&&1==e.nodeType&&"IMG"==e.tagName||I("TYPE_MISMATCH_ERR"),"complete"!=e.readyState&&I("INVALID_STATE_ERR")}function S(e){this.code=this[e],this.message=e+": DOM Exception "+this.code}var C=Math,T=C.round,E=C.sin,z=C.cos,A=C.abs,M=C.sqrt,J=10,F=J/2,O=(+navigator.userAgent.match(/MSIE ([\d.]+)?/)[1],Array.prototype.slice);a(document);var P={init:function(e){var i=e||document;i.createElement("canvas"),i.attachEvent("onreadystatechange",t(this.init_,this,i))},init_:function(e){for(var t=e.getElementsByTagName("canvas"),i=0;iN;N++)for(var B=0;16>B;B++)D[16*N+B]=N.toString(16)+B.toString(16);var H={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgreen:"#006400",darkgrey:"#A9A9A9",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",grey:"#808080",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgreen:"#90EE90",lightgrey:"#D3D3D3",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",oldlace:"#FDF5E6",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",whitesmoke:"#F5F5F5",yellowgreen:"#9ACD32"},R={},G={style:"normal",variant:"normal",weight:"normal",size:12,family:"微软雅黑"},Y={},Z={butt:"flat",round:"round"},Q=b.prototype;Q.clearRect=function(){this.textMeasureEl_&&(this.textMeasureEl_.removeNode(!0),this.textMeasureEl_=null),this.element_.innerHTML=""},Q.beginPath=function(){this.currentPath_=[]},Q.moveTo=function(e,t){var i=L(this,e,t);this.currentPath_.push({type:"moveTo",x:i.x,y:i.y}),this.currentX_=i.x,this.currentY_=i.y},Q.lineTo=function(e,t){var i=L(this,e,t);this.currentPath_.push({type:"lineTo",x:i.x,y:i.y}),this.currentX_=i.x,this.currentY_=i.y},Q.bezierCurveTo=function(e,t,i,n,a,o){var r=L(this,a,o),s=L(this,e,t),l=L(this,i,n);_(this,s,l,r)},Q.quadraticCurveTo=function(e,t,i,n){var a=L(this,e,t),o=L(this,i,n),r={x:this.currentX_+2/3*(a.x-this.currentX_),y:this.currentY_+2/3*(a.y-this.currentY_)},s={x:r.x+(o.x-this.currentX_)/3,y:r.y+(o.y-this.currentY_)/3};_(this,r,s,o)},Q.arc=function(e,t,i,n,a,o){i*=J;var r=o?"at":"wa",s=e+z(n)*i-F,l=t+E(n)*i-F,h=e+z(a)*i-F,d=t+E(a)*i-F;s!=h||o||(s+=.125);var m=L(this,e,t),c=L(this,s,l),p=L(this,h,d);this.currentPath_.push({type:r,x:m.x,y:m.y,radius:i,xStart:c.x,yStart:c.y,xEnd:p.x,yEnd:p.y})},Q.rect=function(e,t,i,n){this.moveTo(e,t),this.lineTo(e+i,t),this.lineTo(e+i,t+n),this.lineTo(e,t+n),this.closePath()},Q.strokeRect=function(e,t,i,n){var a=this.currentPath_;this.beginPath(),this.moveTo(e,t),this.lineTo(e+i,t),this.lineTo(e+i,t+n),this.lineTo(e,t+n),this.closePath(),this.stroke(),this.currentPath_=a},Q.fillRect=function(e,t,i,n){var a=this.currentPath_;this.beginPath(),this.moveTo(e,t),this.lineTo(e+i,t),this.lineTo(e+i,t+n),this.lineTo(e,t+n),this.closePath(),this.fill(),this.currentPath_=a},Q.createLinearGradient=function(e,t,i,n){var a=new w("gradient");return a.x0_=e,a.y0_=t,a.x1_=i,a.y1_=n,a},Q.createRadialGradient=function(e,t,i,n,a,o){var r=new w("gradientradial");return r.x0_=e,r.y0_=t,r.r0_=i,r.x1_=n,r.y1_=a,r.r1_=o,r},Q.drawImage=function(e){var t,i,n,a,o,r,s,l,h=e.runtimeStyle.width,d=e.runtimeStyle.height;e.runtimeStyle.width="auto",e.runtimeStyle.height="auto";var m=e.width,c=e.height;if(e.runtimeStyle.width=h,e.runtimeStyle.height=d,3==arguments.length)t=arguments[1],i=arguments[2],o=r=0,s=n=m,l=a=c;else if(5==arguments.length)t=arguments[1],i=arguments[2],n=arguments[3],a=arguments[4],o=r=0,s=m,l=c;else{if(9!=arguments.length)throw Error("Invalid number of arguments");o=arguments[1],r=arguments[2],s=arguments[3],l=arguments[4],t=arguments[5],i=arguments[6],n=arguments[7],a=arguments[8]}var p=L(this,t,i),u=[],V=10,U=10,g=f=1;if(u.push(" '),(o||r)&&u.push('
'),u.push('
'),(o||r)&&u.push("
"),u.push("
"),this.element_.insertAdjacentHTML("BeforeEnd",u.join(""))},Q.stroke=function(e){var t=[],i=10,n=10;t.push("o.x)&&(o.x=l.x),(null==a.y||l.yo.y)&&(o.y=l.y))}t.push(' ">'),e?k(this,t,a,o):x(this,t),t.push(""),this.element_.insertAdjacentHTML("beforeEnd",t.join(""))},Q.fill=function(){this.stroke(!0)},Q.closePath=function(){this.currentPath_.push({type:"close"})},Q.save=function(){var e={};h(this,e),this.aStack_.push(e),this.mStack_.push(this.m_),this.m_=l(s(),this.m_)},Q.restore=function(){this.aStack_.length&&(h(this.aStack_.pop(),this),this.m_=this.mStack_.pop())},Q.translate=function(e,t){var i=[[1,0,0],[0,1,0],[e,t,1]];W(this,l(i,this.m_),!1)},Q.rotate=function(e){var t=z(e),i=E(e),n=[[t,i,0],[-i,t,0],[0,0,1]];W(this,l(n,this.m_),!1)},Q.scale=function(e,t){var i=[[e,0,0],[0,t,0],[0,0,1]];W(this,l(i,this.m_),!0)},Q.transform=function(e,t,i,n,a,o){var r=[[e,t,0],[i,n,0],[a,o,1]];W(this,l(r,this.m_),!0)},Q.setTransform=function(e,t,i,n,a,o){var r=[[e,t,0],[i,n,0],[a,o,1]];W(this,r,!0)},Q.drawText_=function(e,t,n,a,o){var r=this.m_,s=1e3,l=0,h=s,d={x:0,y:0},m=[],c=g(U(this.font),this.element_),p=y(c),u=this.element_.currentStyle,V=this.textAlign.toLowerCase();switch(V){case"left":case"center":case"right":break;case"end":V="ltr"==u.direction?"right":"left";break;case"start":V="rtl"==u.direction?"right":"left";break;default:V="left"}switch(this.textBaseline){case"hanging":case"top":d.y=c.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":d.y=-c.size/2.25}switch(V){case"right":l=s,h=.05;break;case"center":l=h=s/2}var f=L(this,t+d.x,n+d.y);m.push(''),o?x(this,m):k(this,m,{x:-l,y:0},{x:h,y:c.size});var b=r[0][0].toFixed(3)+","+r[1][0].toFixed(3)+","+r[0][1].toFixed(3)+","+r[1][1].toFixed(3)+",0,0",_=T(f.x/J)+","+T(f.y/J); +m.push('','',''),this.element_.insertAdjacentHTML("beforeEnd",m.join(""))},Q.fillText=function(e,t,i,n){this.drawText_(e,t,i,n,!1)},Q.strokeText=function(e,t,i,n){this.drawText_(e,t,i,n,!0)},Q.measureText=function(e){if(!this.textMeasureEl_){var t='';this.element_.insertAdjacentHTML("beforeEnd",t),this.textMeasureEl_=this.element_.lastChild}var i=this.element_.ownerDocument;this.textMeasureEl_.innerHTML="";try{this.textMeasureEl_.style.font=this.font}catch(n){}return this.textMeasureEl_.appendChild(i.createTextNode(e)),{width:this.textMeasureEl_.offsetWidth}},Q.clip=function(){},Q.arcTo=function(){},Q.createPattern=function(e,t){return new X(e,t)},w.prototype.addColorStop=function(e,t){t=V(t),this.colors_.push({offset:e,color:t.color,alpha:t.alpha})};var q=S.prototype=new Error;q.INDEX_SIZE_ERR=1,q.DOMSTRING_SIZE_ERR=2,q.HIERARCHY_REQUEST_ERR=3,q.WRONG_DOCUMENT_ERR=4,q.INVALID_CHARACTER_ERR=5,q.NO_DATA_ALLOWED_ERR=6,q.NO_MODIFICATION_ALLOWED_ERR=7,q.NOT_FOUND_ERR=8,q.NOT_SUPPORTED_ERR=9,q.INUSE_ATTRIBUTE_ERR=10,q.INVALID_STATE_ERR=11,q.SYNTAX_ERR=12,q.INVALID_MODIFICATION_ERR=13,q.NAMESPACE_ERR=14,q.INVALID_ACCESS_ERR=15,q.VALIDATION_ERR=16,q.TYPE_MISMATCH_ERR=17,G_vmlCanvasManager=P,CanvasRenderingContext2D=b,CanvasGradient=w,CanvasPattern=X,DOMException=S}(),G_vmlCanvasManager}),define("zrender/mixin/Eventful",["require"],function(){var e=function(){this._handlers={}};return e.prototype.one=function(e,t,i){var n=this._handlers;return t&&e?(n[e]||(n[e]=[]),n[e].push({h:t,one:!0,ctx:i||this}),this):this},e.prototype.bind=function(e,t,i){var n=this._handlers;return t&&e?(n[e]||(n[e]=[]),n[e].push({h:t,one:!1,ctx:i||this}),this):this},e.prototype.unbind=function(e,t){var i=this._handlers;if(!e)return this._handlers={},this;if(t){if(i[e]){for(var n=[],a=0,o=i[e].length;o>a;a++)i[e][a].h!=t&&n.push(i[e][a]);i[e]=n}i[e]&&0===i[e].length&&delete i[e]}else delete i[e];return this},e.prototype.dispatch=function(e){if(this._handlers[e]){var t=arguments,i=t.length;i>3&&(t=Array.prototype.slice.call(t,1));for(var n=this._handlers[e],a=n.length,o=0;a>o;){switch(i){case 1:n[o].h.call(n[o].ctx);break;case 2:n[o].h.call(n[o].ctx,t[1]);break;case 3:n[o].h.call(n[o].ctx,t[1],t[2]);break;default:n[o].h.apply(n[o].ctx,t)}n[o].one?(n.splice(o,1),a--):o++}}return this},e.prototype.dispatchWithContext=function(e){if(this._handlers[e]){var t=arguments,i=t.length;i>4&&(t=Array.prototype.slice.call(t,1,t.length-1));for(var n=t[t.length-1],a=this._handlers[e],o=a.length,r=0;o>r;){switch(i){case 1:a[r].h.call(n);break;case 2:a[r].h.call(n,t[1]);break;case 3:a[r].h.call(n,t[1],t[2]);break;default:a[r].h.apply(n,t)}a[r].one?(a.splice(r,1),o--):r++}}return this},e}),define("zrender/tool/log",["require","../config"],function(e){var t=e("../config");return function(){if(0!==t.debugMode)if(1==t.debugMode)for(var e in arguments)throw new Error(arguments[e]);else if(t.debugMode>1)for(var e in arguments)console.log(arguments[e])}}),define("zrender/tool/guid",[],function(){var e=2311;return function(){return"zrender__"+e++}}),define("zrender/Handler",["require","./config","./tool/env","./tool/event","./tool/util","./tool/vector","./tool/matrix","./mixin/Eventful"],function(e){"use strict";function t(e,t){return function(i){return e.call(t,i)}}function i(e,t){return function(i,n,a){return e.call(t,i,n,a)}}function n(e){for(var i=p.length;i--;){var n=p[i];e["_"+n+"Handler"]=t(u[n],e)}}function a(e,t,i){if(this._draggingTarget&&this._draggingTarget.id==e.id||e.isSilent())return!1;var n=this._event;if(e.isCover(t,i)){e.hoverable&&this.storage.addHover(e);for(var a=e.parent;a;){if(a.clipShape&&!a.clipShape.isCover(this._mouseX,this._mouseY))return!1;a=a.parent}return this._lastHover!=e&&(this._processOutShape(n),this._processDragLeave(n),this._lastHover=e,this._processDragEnter(n)),this._processOverShape(n),this._processDragOver(n),this._hasfound=1,!0}return!1}var o=e("./config"),r=e("./tool/env"),s=e("./tool/event"),l=e("./tool/util"),h=e("./tool/vector"),d=e("./tool/matrix"),m=o.EVENT,c=e("./mixin/Eventful"),p=["resize","click","dblclick","mousewheel","mousemove","mouseout","mouseup","mousedown","touchstart","touchend","touchmove"],u={resize:function(e){e=e||window.event,this._lastHover=null,this._isMouseDown=0,this.dispatch(m.RESIZE,e)},click:function(e){e=this._zrenderEventFixed(e);var t=this._lastHover;(t&&t.clickable||!t)&&this._clickThreshold<5&&this._dispatchAgency(t,m.CLICK,e),this._mousemoveHandler(e)},dblclick:function(e){e=e||window.event,e=this._zrenderEventFixed(e);var t=this._lastHover;(t&&t.clickable||!t)&&this._clickThreshold<5&&this._dispatchAgency(t,m.DBLCLICK,e),this._mousemoveHandler(e)},mousewheel:function(e){e=this._zrenderEventFixed(e);var t=e.wheelDelta||-e.detail,i=t>0?1.1:1/1.1,n=!1,a=this._mouseX,o=this._mouseY;this.painter.eachBuildinLayer(function(t){var r=t.position;if(t.zoomable){t.__zoom=t.__zoom||1;var l=t.__zoom;l*=i,l=Math.max(Math.min(t.maxZoom,l),t.minZoom),i=l/t.__zoom,t.__zoom=l,r[0]-=(a-r[0])*(i-1),r[1]-=(o-r[1])*(i-1),t.scale[0]*=i,t.scale[1]*=i,t.dirty=!0,n=!0,s.stop(e)}}),n&&this.painter.refresh(),this._dispatchAgency(this._lastHover,m.MOUSEWHEEL,e),this._mousemoveHandler(e)},mousemove:function(e){if(!this.painter.isLoading()){e=this._zrenderEventFixed(e),this._lastX=this._mouseX,this._lastY=this._mouseY,this._mouseX=s.getX(e),this._mouseY=s.getY(e);var t=this._mouseX-this._lastX,i=this._mouseY-this._lastY;this._processDragStart(e),this._hasfound=0,this._event=e,this._iterateAndFindHover(),this._hasfound||((!this._draggingTarget||this._lastHover&&this._lastHover!=this._draggingTarget)&&(this._processOutShape(e),this._processDragLeave(e)),this._lastHover=null,this.storage.delHover(),this.painter.clearHover());var n="default";if(this._draggingTarget)this.storage.drift(this._draggingTarget.id,t,i),this._draggingTarget.modSelf(),this.storage.addHover(this._draggingTarget),this._clickThreshold++;else if(this._isMouseDown){var a=!1;this.painter.eachBuildinLayer(function(e){e.panable&&(n="move",e.position[0]+=t,e.position[1]+=i,a=!0,e.dirty=!0)}),a&&this.painter.refresh()}this._draggingTarget||this._hasfound&&this._lastHover.draggable?n="move":this._hasfound&&this._lastHover.clickable&&(n="pointer"),this.root.style.cursor=n,this._dispatchAgency(this._lastHover,m.MOUSEMOVE,e),(this._draggingTarget||this._hasfound||this.storage.hasHoverShape())&&this.painter.refreshHover()}},mouseout:function(e){e=this._zrenderEventFixed(e);var t=e.toElement||e.relatedTarget;if(t!=this.root)for(;t&&9!=t.nodeType;){if(t==this.root)return void this._mousemoveHandler(e);t=t.parentNode}e.zrenderX=this._lastX,e.zrenderY=this._lastY,this.root.style.cursor="default",this._isMouseDown=0,this._processOutShape(e),this._processDrop(e),this._processDragEnd(e),this.painter.isLoading()||this.painter.refreshHover(),this.dispatch(m.GLOBALOUT,e)},mousedown:function(e){return this._clickThreshold=0,2==this._lastDownButton?(this._lastDownButton=e.button,void(this._mouseDownTarget=null)):(this._lastMouseDownMoment=new Date,e=this._zrenderEventFixed(e),this._isMouseDown=1,this._mouseDownTarget=this._lastHover,this._dispatchAgency(this._lastHover,m.MOUSEDOWN,e),void(this._lastDownButton=e.button))},mouseup:function(e){e=this._zrenderEventFixed(e),this.root.style.cursor="default",this._isMouseDown=0,this._mouseDownTarget=null,this._dispatchAgency(this._lastHover,m.MOUSEUP,e),this._processDrop(e),this._processDragEnd(e)},touchstart:function(e){e=this._zrenderEventFixed(e,!0),this._lastTouchMoment=new Date,this._mobileFindFixed(e),this._mousedownHandler(e)},touchmove:function(e){e=this._zrenderEventFixed(e,!0),this._mousemoveHandler(e),this._isDragging&&s.stop(e)},touchend:function(e){e=this._zrenderEventFixed(e,!0),this._mouseupHandler(e);var t=new Date;t-this._lastTouchMoment=0;o--){var r=n[o];if(t!==r.zlevel&&(i=this.painter.getLayer(r.zlevel,i),a[0]=this._mouseX,a[1]=this._mouseY,i.needTransform&&(d.invert(e,i.transform),h.applyTransform(a,a,e))),this._findHover(r,a[0],a[1]))break}}}();var U=[{x:10},{x:-20},{x:10,y:10},{y:-20}];return V.prototype._mobileFindFixed=function(e){this._lastHover=null,this._mouseX=e.zrenderX,this._mouseY=e.zrenderY,this._event=e,this._iterateAndFindHover();for(var t=0;!this._lastHover&&ts;s++){var h=e[s];if(n!==h.zlevel&&(i&&(i.needTransform&&o.restore(),o.flush&&o.flush()),n=h.zlevel,i=this.getLayer(n),i.isBuildin||r("ZLevel "+n+" has been used by unkown layer "+i.id),o=i.ctx,i.unusedCount=0,(i.dirty||t)&&i.clear(),i.needTransform&&(o.save(),i.setTransform(o))),(i.dirty||t)&&!h.invisible&&(!h.onbrush||h.onbrush&&!h.onbrush(o,!1)))if(a.catchBrushException)try{h.brush(o,!1,this.refreshNextFrame)}catch(d){r(d,"brush error of "+h.type,h)}else h.brush(o,!1,this.refreshNextFrame);h.__dirty=!1}i&&(i.needTransform&&o.restore(),o.flush&&o.flush()),this.eachBuildinLayer(this._postProcessLayer)},h.prototype.getLayer=function(e){var t=this._layers[e];return t||(t=new l(e,this),t.isBuildin=!0,this._layerConfig[e]&&o.merge(t,this._layerConfig[e],!0),t.updateTransform(),this.insertLayer(e,t),t.initContext()),t},h.prototype.insertLayer=function(e,t){if(this._layers[e])return void r("ZLevel "+e+" has been used already");if(!n(t))return void r("Layer of zlevel "+e+" is not valid");var i=this._zlevelList.length,a=null,o=-1;if(i>0&&e>this._zlevelList[0]){for(o=0;i-1>o&&!(this._zlevelList[o]e);o++);a=this._layers[this._zlevelList[o]]}this._zlevelList.splice(o+1,0,e);var s=a?a.dom:this._bgDom;s.nextSibling?s.parentNode.insertBefore(t.dom,s.nextSibling):s.parentNode.appendChild(t.dom),this._layers[e]=t},h.prototype.eachLayer=function(e,t){for(var i=0;in;n++){var o=e[n],r=o.zlevel,s=t[r];if(s){if(s.elCount++,s.dirty)continue;s.dirty=o.__dirty}}this.eachBuildinLayer(function(e,t){i[t]!==e.elCount&&(e.dirty=!0)})},h.prototype.refreshShapes=function(e,t){for(var i=0,n=e.length;n>i;i++){var a=e[i];a.modSelf()}return this.refresh(t),this},h.prototype.setLoadingEffect=function(e){return this._loadingEffect=e,this},h.prototype.clear=function(){return this.eachBuildinLayer(this._clearLayer),this},h.prototype._clearLayer=function(e){e.clear()},h.prototype.modLayer=function(e,t){if(t){this._layerConfig[e]?o.merge(this._layerConfig[e],t,!0):this._layerConfig[e]=t;var i=this._layers[e];i&&o.merge(i,this._layerConfig[e],!0)}},h.prototype.delLayer=function(e){var t=this._layers[e];t&&(this.modLayer(e,{position:t.position,rotation:t.rotation,scale:t.scale}),t.dom.parentNode.removeChild(t.dom),delete this._layers[e],this._zlevelList.splice(o.indexOf(this._zlevelList,e),1))},h.prototype.refreshHover=function(){this.clearHover();for(var e=this.storage.getHoverShapes(!0),t=0,i=e.length;i>t;t++)this._brushHover(e[t]);var n=this._layers.hover.ctx;return n.flush&&n.flush(),this.storage.delHover(),this},h.prototype.clearHover=function(){var e=this._layers.hover;return e&&e.clear(),this},h.prototype.showLoading=function(e){return this._loadingEffect&&this._loadingEffect.stop(),e&&this.setLoadingEffect(e),this._loadingEffect.start(this),this.loading=!0,this},h.prototype.hideLoading=function(){return this._loadingEffect.stop(),this.clearHover(),this.loading=!1,this},h.prototype.isLoading=function(){return this.loading},h.prototype.resize=function(){var e=this._domRoot;e.style.display="none";var t=this._getWidth(),i=this._getHeight();if(e.style.display="",this._width!=t||i!=this._height){this._width=t,this._height=i,e.style.width=t+"px",e.style.height=i+"px";for(var n in this._layers)this._layers[n].resize(t,i);this.refresh(null,!0)}return this},h.prototype.clearLayer=function(e){var t=this._layers[e];t&&t.clear()},h.prototype.dispose=function(){this.isLoading()&&this.hideLoading(),this.root.innerHTML="",this.root=this.storage=this._domRoot=this._layers=null},h.prototype.getDomHover=function(){return this._layers.hover.dom},h.prototype.toDataURL=function(e,t,i){if(window.G_vmlCanvasManager)return null;var n=new l("image",this);this._bgDom.appendChild(n.dom),n.initContext();var o=n.ctx;n.clearColor=t||"#fff",n.clear();var s=this;this.storage.iterShape(function(e){if(!e.invisible&&(!e.onbrush||e.onbrush&&!e.onbrush(o,!1)))if(a.catchBrushException)try{e.brush(o,!1,s.refreshNextFrame)}catch(t){r(t,"brush error of "+e.type,e)}else e.brush(o,!1,s.refreshNextFrame)},{normal:"up",update:!0});var h=n.dom.toDataURL(e,i);return o=null,this._bgDom.removeChild(n.dom),h},h.prototype.getWidth=function(){return this._width},h.prototype.getHeight=function(){return this._height},h.prototype._getWidth=function(){var e=this.root,t=e.currentStyle||document.defaultView.getComputedStyle(e);return((e.clientWidth||parseInt(t.width,10))-parseInt(t.paddingLeft,10)-parseInt(t.paddingRight,10)).toFixed(0)-0},h.prototype._getHeight=function(){var e=this.root,t=e.currentStyle||document.defaultView.getComputedStyle(e);return((e.clientHeight||parseInt(t.height,10))-parseInt(t.paddingTop,10)-parseInt(t.paddingBottom,10)).toFixed(0)-0},h.prototype._brushHover=function(e){var t=this._layers.hover.ctx;if(!e.onbrush||e.onbrush&&!e.onbrush(t,!0)){var i=this.getLayer(e.zlevel);if(i.needTransform&&(t.save(),i.setTransform(t)),a.catchBrushException)try{e.brush(t,!0,this.refreshNextFrame)}catch(n){r(n,"hoverBrush error of "+e.type,e)}else e.brush(t,!0,this.refreshNextFrame);i.needTransform&&t.restore()}},h.prototype._shapeToImage=function(t,i,n,a,o){var r=document.createElement("canvas"),s=r.getContext("2d");r.style.width=n+"px",r.style.height=a+"px",r.setAttribute("width",n*o),r.setAttribute("height",a*o),s.clearRect(0,0,n*o,a*o);var l={position:i.position,rotation:i.rotation,scale:i.scale};i.position=[0,0,0],i.rotation=0,i.scale=[1,1],i&&i.brush(s,!1);var h=e("./shape/Image"),d=new h({id:t,style:{x:0,y:0,image:r}});return null!=l.position&&(d.position=i.position=l.position),null!=l.rotation&&(d.rotation=i.rotation=l.rotation),null!=l.scale&&(d.scale=i.scale=l.scale),d},h.prototype._createShapeToImageProcessor=function(){if(window.G_vmlCanvasManager)return i;var e=this;return function(t,i,n,o){return e._shapeToImage(t,i,n,o,a.devicePixelRatio)}},h}),define("zrender/Storage",["require","./tool/util","./Group"],function(e){"use strict";function t(e,t){return e.zlevel==t.zlevel?e.z==t.z?e.__renderidx-t.__renderidx:e.z-t.z:e.zlevel-t.zlevel}var i=e("./tool/util"),n=e("./Group"),a={hover:!1,normal:"down",update:!1},o=function(){this._elements={},this._hoverElements=[],this._roots=[],this._shapeList=[],this._shapeListOffset=0};return o.prototype.iterShape=function(e,t){if(t||(t=a),t.hover)for(var i=0,n=this._hoverElements.length;n>i;i++){var o=this._hoverElements[i];if(o.updateTransform(),e(o))return this}switch(t.update&&this.updateShapeList(),t.normal){case"down":for(var n=this._shapeList.length;n--;)if(e(this._shapeList[n]))return this;break;default:for(var i=0,n=this._shapeList.length;n>i;i++)if(e(this._shapeList[i]))return this}return this},o.prototype.getHoverShapes=function(e){for(var i=[],n=0,a=this._hoverElements.length;a>n;n++){i.push(this._hoverElements[n]);var o=this._hoverElements[n].hoverConnect;if(o){var r;o=o instanceof Array?o:[o];for(var s=0,l=o.length;l>s;s++)r=o[s].id?o[s]:this.get(o[s]),r&&i.push(r)}}if(i.sort(t),e)for(var n=0,a=i.length;a>n;n++)i[n].updateTransform();return i},o.prototype.getShapeList=function(e){return e&&this.updateShapeList(),this._shapeList},o.prototype.updateShapeList=function(){this._shapeListOffset=0;for(var e=0,i=this._roots.length;i>e;e++){var n=this._roots[e];this._updateAndAddShape(n)}this._shapeList.length=this._shapeListOffset;for(var e=0,i=this._shapeList.length;i>e;e++)this._shapeList[e].__renderidx=e;this._shapeList.sort(t)},o.prototype._updateAndAddShape=function(e,t){if(!e.ignore)if(e.updateTransform(),"group"==e.type){e.clipShape&&(e.clipShape.parent=e,e.clipShape.updateTransform(),t?(t=t.slice(),t.push(e.clipShape)):t=[e.clipShape]);for(var i=0;i0},o.prototype.addRoot=function(e){e instanceof n&&e.addChildrenToStorage(this),this.addToMap(e),this._roots.push(e)},o.prototype.delRoot=function(e){if("undefined"==typeof e){for(var t=0;tt;t++)this.delRoot(e[t]);else{var r;r="string"==typeof e?this._elements[e]:e;var s=i.indexOf(this._roots,r);s>=0&&(this.delFromMap(r.id),this._roots.splice(s,1),r instanceof n&&r.delChildrenFromStorage(this))}},o.prototype.addToMap=function(e){return e instanceof n&&(e._storage=this),e.modSelf(),this._elements[e.id]=e,this},o.prototype.get=function(e){return this._elements[e]},o.prototype.delFromMap=function(e){var t=this._elements[e];return t&&(delete this._elements[e],t instanceof n&&(t._storage=null)),this},o.prototype.dispose=function(){this._elements=this._renderList=this._roots=this._hoverElements=null},o}),define("zrender/animation/Animation",["require","./Clip","../tool/color","../tool/util","../tool/event"],function(e){"use strict";function t(e,t){return e[t]}function i(e,t,i){e[t]=i}function n(e,t,i){return(t-e)*i+e}function a(e,t,i,a,o){var r=e.length;if(1==o)for(var s=0;r>s;s++)a[s]=n(e[s],t[s],i);else for(var l=e[0].length,s=0;r>s;s++)for(var h=0;l>h;h++)a[s][h]=n(e[s][h],t[s][h],i)}function o(e){switch(typeof e){case"undefined":case"string":return!1}return"undefined"!=typeof e.length}function r(e,t,i,n,a,o,r,l,h){var d=e.length;if(1==h)for(var m=0;d>m;m++)l[m]=s(e[m],t[m],i[m],n[m],a,o,r);else for(var c=e[0].length,m=0;d>m;m++)for(var p=0;c>p;p++)l[m][p]=s(e[m][p],t[m][p],i[m][p],n[m][p],a,o,r)}function s(e,t,i,n,a,o,r){var s=.5*(i-e),l=.5*(n-t);return(2*(t-i)+s+l)*r+(-3*(t-i)-2*s-l)*o+s*a+t}function l(e){if(o(e)){var t=e.length;if(o(e[0])){for(var i=[],n=0;t>n;n++)i.push(V.call(e[n]));return i}return V.call(e)}return e}function h(e){return e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.floor(e[2]),"rgba("+e.join(",")+")"}var d=e("./Clip"),m=e("../tool/color"),c=e("../tool/util"),p=e("../tool/event").Dispatcher,u=window.requestAnimationFrame||window.msRequestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(e){setTimeout(e,16)},V=Array.prototype.slice,U=function(e){e=e||{},this.stage=e.stage||{},this.onframe=e.onframe||function(){},this._clips=[],this._running=!1,this._time=0,p.call(this)};U.prototype={add:function(e){this._clips.push(e)},remove:function(e){var t=c.indexOf(this._clips,e);t>=0&&this._clips.splice(t,1)},_update:function(){for(var e=(new Date).getTime(),t=e-this._time,i=this._clips,n=i.length,a=[],o=[],r=0;n>r;r++){var s=i[r],l=s.step(e);l&&(a.push(l),o.push(s))}for(var r=0;n>r;)i[r]._needsRemove?(i[r]=i[n-1],i.pop(),n--):r++;n=a.length;for(var r=0;n>r;r++)o[r].fire(a[r]);this._time=e,this.onframe(t),this.dispatch("frame",t),this.stage.update&&this.stage.update()},start:function(){function e(){t._running&&(t._update(),u(e))}var t=this;this._running=!0,this._time=(new Date).getTime(),u(e)},stop:function(){this._running=!1},clear:function(){this._clips=[]},animate:function(e,t){t=t||{};var i=new g(e,t.loop,t.getter,t.setter);return i.animation=this,i},constructor:U},c.merge(U.prototype,p.prototype,!0);var g=function(e,n,a,o){this._tracks={},this._target=e,this._loop=n||!1,this._getter=a||t,this._setter=o||i,this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[]};return g.prototype={when:function(e,t){for(var i in t)this._tracks[i]||(this._tracks[i]=[],0!==e&&this._tracks[i].push({time:0,value:l(this._getter(this._target,i))})),this._tracks[i].push({time:parseInt(e,10),value:t[i]});return this},during:function(e){return this._onframeList.push(e),this},start:function(e){var t=this,i=this._setter,l=this._getter,c="spline"===e,p=function(){if(t._clipCount--,0===t._clipCount){t._tracks={};for(var e=t._doneList.length,i=0;e>i;i++)t._doneList[i].call(t)}},u=function(u,V){var U=u.length;if(U){var g=u[0].value,y=o(g),f=!1,b=y&&o(g[0])?2:1;u.sort(function(e,t){return e.time-t.time});var _;if(U){_=u[U-1].time;for(var x=[],k=[],L=0;U>L;L++){x.push(u[L].time/_);var v=u[L].value;"string"==typeof v&&(v=m.toArray(v),0===v.length&&(v[0]=v[1]=v[2]=0,v[3]=1),f=!0),k.push(v)}var W,L,w,X,I,K,S,C=0,T=0;if(f)var E=[0,0,0,0];var z=function(e,o){if(T>o){for(W=Math.min(C+1,U-1),L=W;L>=0&&!(x[L]<=o);L--);L=Math.min(L,U-2)}else{for(L=C;U>L&&!(x[L]>o);L++);L=Math.min(L-1,U-2)}C=L,T=o;var d=x[L+1]-x[L];if(0!==d){if(w=(o-x[L])/d,c)if(I=k[L],X=k[0===L?L:L-1],K=k[L>U-2?U-1:L+1],S=k[L>U-3?U-1:L+2],y)r(X,I,K,S,w,w*w,w*w*w,l(e,V),b);else{var m;f?(m=r(X,I,K,S,w,w*w,w*w*w,E,1),m=h(E)):m=s(X,I,K,S,w,w*w,w*w*w),i(e,V,m)}else if(y)a(k[L],k[L+1],w,l(e,V),b);else{var m;f?(a(k[L],k[L+1],w,E,1),m=h(E)):m=n(k[L],k[L+1],w),i(e,V,m)}for(L=0;L=t[1]&&(e=t[1]),e},t.prototype.getLocation=function(e,t,i){var n=null!=e.x?e.x:"center";switch(n){case"center":n=Math.floor((this.canvasWidth-t)/2);break;case"left":n=0;break;case"right":n=this.canvasWidth-t}var a=null!=e.y?e.y:"center";switch(a){case"center":a=Math.floor((this.canvasHeight-i)/2);break;case"top":a=0;break;case"bottom":a=this.canvasHeight-i}return{x:n,y:a,width:t,height:i}},t}),define("zrender/Layer",["require","./mixin/Transformable","./tool/util","./config"],function(e){function t(){return!1}function i(e,t,i){var n=document.createElement(t),a=i.getWidth(),o=i.getHeight();return n.style.position="absolute",n.style.left=0,n.style.top=0,n.style.width=a+"px",n.style.height=o+"px",n.width=a*r.devicePixelRatio,n.height=o*r.devicePixelRatio,n.setAttribute("data-zr-dom-id",e),n}var n=e("./mixin/Transformable"),a=e("./tool/util"),o=window.G_vmlCanvasManager,r=e("./config"),s=function(e,a){this.id=e,this.dom=i(e,"canvas",a),this.dom.onselectstart=t,this.dom.style["-webkit-user-select"]="none",this.dom.style["user-select"]="none",this.dom.style["-webkit-touch-callout"]="none",this.dom.style["-webkit-tap-highlight-color"]="rgba(0,0,0,0)",o&&o.initElement(this.dom),this.domBack=null,this.ctxBack=null,this.painter=a,this.unusedCount=0,this.config=null,this.dirty=!0,this.elCount=0,this.clearColor=0,this.motionBlur=!1,this.lastFrameAlpha=.7,this.zoomable=!1,this.panable=!1,this.maxZoom=1/0,this.minZoom=0,n.call(this)};return s.prototype.initContext=function(){this.ctx=this.dom.getContext("2d");var e=r.devicePixelRatio;1!=e&&this.ctx.scale(e,e)},s.prototype.createBackBuffer=function(){if(!o){this.domBack=i("back-"+this.id,"canvas",this.painter),this.ctxBack=this.domBack.getContext("2d");var e=r.devicePixelRatio;1!=e&&this.ctxBack.scale(e,e)}},s.prototype.resize=function(e,t){var i=r.devicePixelRatio;this.dom.style.width=e+"px",this.dom.style.height=t+"px",this.dom.setAttribute("width",e*i),this.dom.setAttribute("height",t*i),1!=i&&this.ctx.scale(i,i),this.domBack&&(this.domBack.setAttribute("width",e*i),this.domBack.setAttribute("height",t*i),1!=i&&this.ctxBack.scale(i,i))},s.prototype.clear=function(){var e=this.dom,t=this.ctx,i=e.width,n=e.height,a=this.clearColor&&!o,s=this.motionBlur&&!o,l=this.lastFrameAlpha,h=r.devicePixelRatio;if(s&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(e,0,0,i/h,n/h)),t.clearRect(0,0,i/h,n/h),a&&(t.save(),t.fillStyle=this.clearColor,t.fillRect(0,0,i/h,n/h),t.restore()),s){var d=this.domBack;t.save(),t.globalAlpha=l,t.drawImage(d,0,0,i/h,n/h),t.restore()}},a.merge(s.prototype,n.prototype),s}),define("zrender/shape/Text",["require","../tool/area","./Base","../tool/util"],function(e){var t=e("../tool/area"),i=e("./Base"),n=function(e){i.call(this,e)};return n.prototype={type:"text",brush:function(e,i){var n=this.style;if(i&&(n=this.getHighlightStyle(n,this.highlightStyle||{})),"undefined"!=typeof n.text&&n.text!==!1){e.save(),this.doClip(e),this.setContext(e,n),this.setTransform(e),n.textFont&&(e.font=n.textFont),e.textAlign=n.textAlign||"start",e.textBaseline=n.textBaseline||"middle";var a,o=(n.text+"").split("\n"),r=t.getTextHeight("国",n.textFont),s=this.getRect(n),l=n.x;a="top"==n.textBaseline?s.y:"bottom"==n.textBaseline?s.y+r:s.y+r/2;for(var h=0,d=o.length;d>h;h++){if(n.maxWidth)switch(n.brushType){case"fill":e.fillText(o[h],l,a,n.maxWidth);break;case"stroke":e.strokeText(o[h],l,a,n.maxWidth);break;case"both":e.fillText(o[h],l,a,n.maxWidth),e.strokeText(o[h],l,a,n.maxWidth);break;default:e.fillText(o[h],l,a,n.maxWidth)}else switch(n.brushType){case"fill":e.fillText(o[h],l,a);break;case"stroke":e.strokeText(o[h],l,a);break;case"both":e.fillText(o[h],l,a),e.strokeText(o[h],l,a);break;default:e.fillText(o[h],l,a)}a+=r}e.restore()}},getRect:function(e){if(e.__rect)return e.__rect;var i=t.getTextWidth(e.text,e.textFont),n=t.getTextHeight(e.text,e.textFont),a=e.x;"end"==e.textAlign||"right"==e.textAlign?a-=i:"center"==e.textAlign&&(a-=i/2);var o;return o="top"==e.textBaseline?e.y:"bottom"==e.textBaseline?e.y-n:e.y-n/2,e.__rect={x:a,y:o,width:i,height:n},e.__rect}},e("../tool/util").inherits(n,i),n}),define("zrender/shape/Rectangle",["require","./Base","../tool/util"],function(e){var t=e("./Base"),i=function(e){t.call(this,e)};return i.prototype={type:"rectangle",_buildRadiusPath:function(e,t){var i,n,a,o,r=t.x,s=t.y,l=t.width,h=t.height,d=t.radius;"number"==typeof d?i=n=a=o=d:d instanceof Array?1===d.length?i=n=a=o=d[0]:2===d.length?(i=a=d[0],n=o=d[1]):3===d.length?(i=d[0],n=o=d[1],a=d[2]):(i=d[0],n=d[1],a=d[2],o=d[3]):i=n=a=o=0;var m;i+n>l&&(m=i+n,i*=l/m,n*=l/m),a+o>l&&(m=a+o,a*=l/m,o*=l/m),n+a>h&&(m=n+a,n*=h/m,a*=h/m),i+o>h&&(m=i+o,i*=h/m,o*=h/m),e.moveTo(r+i,s),e.lineTo(r+l-n,s),0!==n&&e.quadraticCurveTo(r+l,s,r+l,s+n),e.lineTo(r+l,s+h-a),0!==a&&e.quadraticCurveTo(r+l,s+h,r+l-a,s+h),e.lineTo(r+o,s+h),0!==o&&e.quadraticCurveTo(r,s+h,r,s+h-o),e.lineTo(r,s+i),0!==i&&e.quadraticCurveTo(r,s,r+i,s)},buildPath:function(e,t){t.radius?this._buildRadiusPath(e,t):(e.moveTo(t.x,t.y),e.lineTo(t.x+t.width,t.y),e.lineTo(t.x+t.width,t.y+t.height),e.lineTo(t.x,t.y+t.height),e.lineTo(t.x,t.y)),e.closePath()},getRect:function(e){if(e.__rect)return e.__rect;var t;return t="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0,e.__rect={x:Math.round(e.x-t/2),y:Math.round(e.y-t/2),width:e.width+t,height:e.height+t},e.__rect}},e("../tool/util").inherits(i,t),i}),define("zrender/tool/area",["require","./util","./curve"],function(e){"use strict";function t(e){return e%=C,0>e&&(e+=C),e}function i(e,t,i,o){if(!t||!e)return!1;var r=e.type;L=L||v.getContext();var s=n(e,t,i,o);if("undefined"!=typeof s)return s;if(e.buildPath&&L.isPointInPath)return a(e,L,t,i,o);switch(r){case"ellipse":return!0;case"trochoid":var l="out"==t.location?t.r1+t.r2+t.d:t.r1-t.r2+t.d;return p(t,i,o,l);case"rose":return p(t,i,o,t.maxr);default:return!1}}function n(e,t,i,n){var a=e.type;switch(a){case"bezier-curve":return"undefined"==typeof t.cpX2?l(t.xStart,t.yStart,t.cpX1,t.cpY1,t.xEnd,t.yEnd,t.lineWidth,i,n):s(t.xStart,t.yStart,t.cpX1,t.cpY1,t.cpX2,t.cpY2,t.xEnd,t.yEnd,t.lineWidth,i,n);case"line":return r(t.xStart,t.yStart,t.xEnd,t.yEnd,t.lineWidth,i,n);case"polyline":return d(t.pointList,t.lineWidth,i,n);case"ring":return m(t.x,t.y,t.r0,t.r,i,n);case"circle":return p(t.x,t.y,t.r,i,n);case"sector":var o=t.startAngle*Math.PI/180,h=t.endAngle*Math.PI/180;return t.clockWise||(o=-o,h=-h),u(t.x,t.y,t.r0,t.r,o,h,!t.clockWise,i,n);case"path":return t.pathArray&&_(t.pathArray,Math.max(t.lineWidth,5),t.brushType,i,n);case"polygon":case"star":case"isogon":return V(t.pointList,i,n);case"text":var U=t.__rect||e.getRect(t);return c(U.x,U.y,U.width,U.height,i,n);case"rectangle":case"image":return c(t.x,t.y,t.width,t.height,i,n)}}function a(e,t,i,n,a){return t.beginPath(),e.buildPath(t,i),t.closePath(),t.isPointInPath(n,a)}function o(e,t,n,a){return!i(e,t,n,a)}function r(e,t,i,n,a,o,r){if(0===a)return!1;var s=Math.max(a,5),l=0,h=e;if(r>t+s&&r>n+s||t-s>r&&n-s>r||o>e+s&&o>i+s||e-s>o&&i-s>o)return!1;if(e===i)return Math.abs(o-e)<=s/2;l=(t-n)/(e-i),h=(e*n-i*t)/(e-i);var d=l*o-r+h,m=d*d/(l*l+1);return s/2*s/2>=m}function s(e,t,i,n,a,o,r,s,l,h,d){if(0===l)return!1;var m=Math.max(l,5);if(d>t+m&&d>n+m&&d>o+m&&d>s+m||t-m>d&&n-m>d&&o-m>d&&s-m>d||h>e+m&&h>i+m&&h>a+m&&h>r+m||e-m>h&&i-m>h&&a-m>h&&r-m>h)return!1;var c=W.cubicProjectPoint(e,t,i,n,a,o,r,s,h,d,null);return m/2>=c}function l(e,t,i,n,a,o,r,s,l){if(0===r)return!1;var h=Math.max(r,5);if(l>t+h&&l>n+h&&l>o+h||t-h>l&&n-h>l&&o-h>l||s>e+h&&s>i+h&&s>a+h||e-h>s&&i-h>s&&a-h>s)return!1;var d=W.quadraticProjectPoint(e,t,i,n,a,o,s,l,null);return h/2>=d}function h(e,i,n,a,o,r,s,l,h){if(0===s)return!1;var d=Math.max(s,5);l-=e,h-=i;var m=Math.sqrt(l*l+h*h);if(m-d>n||n>m+d)return!1;if(Math.abs(a-o)>=C)return!0;if(r){var c=a;a=t(o),o=t(c)}else a=t(a),o=t(o);a>o&&(o+=C);var p=Math.atan2(h,l);return 0>p&&(p+=C),p>=a&&o>=p||p+C>=a&&o>=p+C}function d(e,t,i,n){for(var t=Math.max(t,10),a=0,o=e.length-1;o>a;a++){var s=e[a][0],l=e[a][1],h=e[a+1][0],d=e[a+1][1];if(r(s,l,h,d,t,i,n))return!0}return!1}function m(e,t,i,n,a,o){var r=(a-e)*(a-e)+(o-t)*(o-t);return n*n>r&&r>i*i}function c(e,t,i,n,a,o){return a>=e&&e+i>=a&&o>=t&&t+n>=o}function p(e,t,i,n,a){return i*i>(n-e)*(n-e)+(a-t)*(a-t)}function u(e,t,i,n,a,o,r,s,l){return h(e,t,(i+n)/2,a,o,r,n-i,s,l)}function V(e,t,i){for(var n=e.length,a=0,o=0,r=n-1;n>o;o++){var s=e[r][0],l=e[r][1],h=e[o][0],d=e[o][1];a+=U(s,l,h,d,t,i),r=o}return 0!==a}function U(e,t,i,n,a,o){if(o>t&&o>n||t>o&&n>o)return 0;if(n==t)return 0;var r=t>n?1:-1,s=(o-t)/(n-t),l=s*(i-e)+e;return l>a?r:0}function g(){var e=E[0];E[0]=E[1],E[1]=e}function y(e,t,i,n,a,o,r,s,l,h){if(h>t&&h>n&&h>o&&h>s||t>h&&n>h&&o>h&&s>h)return 0;var d=W.cubicRootAt(t,n,o,s,h,T);if(0===d)return 0;for(var m,c,p=0,u=-1,V=0;d>V;V++){var U=T[V],y=W.cubicAt(e,i,a,r,U);l>y||(0>u&&(u=W.cubicExtrema(t,n,o,s,E),E[1]1&&g(),m=W.cubicAt(t,n,o,s,E[0]),u>1&&(c=W.cubicAt(t,n,o,s,E[1]))),p+=2==u?Um?1:-1:Uc?1:-1:c>s?1:-1:Um?1:-1:m>s?1:-1)}return p}function f(e,t,i,n,a,o,r,s){if(s>t&&s>n&&s>o||t>s&&n>s&&o>s)return 0;var l=W.quadraticRootAt(t,n,o,s,T);if(0===l)return 0;var h=W.quadraticExtremum(t,n,o);if(h>=0&&1>=h){for(var d=0,m=W.quadraticAt(t,n,o,h),c=0;l>c;c++){var p=W.quadraticAt(e,i,a,T[c]);p>r||(d+=T[c]m?1:-1:m>o?1:-1)}return d}var p=W.quadraticAt(e,i,a,T[0]);return p>r?0:t>o?1:-1}function b(e,i,n,a,o,r,s,l){if(l-=i,l>n||-n>l)return 0;var h=Math.sqrt(n*n-l*l);if(T[0]=-h,T[1]=h,Math.abs(a-o)>=C){a=0,o=C;var d=r?1:-1;return s>=T[0]+e&&s<=T[1]+e?d:0}if(r){var h=a;a=t(o),o=t(h)}else a=t(a),o=t(o);a>o&&(o+=C);for(var m=0,c=0;2>c;c++){var p=T[c];if(p+e>s){var u=Math.atan2(l,p),d=r?1:-1;0>u&&(u=C+u),(u>=a&&o>=u||u+C>=a&&o>=u+C)&&(u>Math.PI/2&&u<1.5*Math.PI&&(d=-d),m+=d)}}return m}function _(e,t,i,n,a){var o=0,d=0,m=0,c=0,p=0,u=!0,V=!0;i=i||"fill";for(var g="stroke"===i||"both"===i,_="fill"===i||"both"===i,x=0;x0&&(_&&(o+=U(d,m,c,p,n,a)),0!==o))return!0;c=L[L.length-2],p=L[L.length-1],u=!1,V&&"A"!==k.command&&(V=!1,d=c,m=p)}switch(k.command){case"M":d=L[0],m=L[1];break;case"L":if(g&&r(d,m,L[0],L[1],t,n,a))return!0;_&&(o+=U(d,m,L[0],L[1],n,a)),d=L[0],m=L[1];break;case"C":if(g&&s(d,m,L[0],L[1],L[2],L[3],L[4],L[5],t,n,a))return!0;_&&(o+=y(d,m,L[0],L[1],L[2],L[3],L[4],L[5],n,a)),d=L[4],m=L[5];break;case"Q":if(g&&l(d,m,L[0],L[1],L[2],L[3],t,n,a))return!0;_&&(o+=f(d,m,L[0],L[1],L[2],L[3],n,a)),d=L[2],m=L[3];break;case"A":var v=L[0],W=L[1],w=L[2],X=L[3],I=L[4],K=L[5],S=Math.cos(I)*w+v,C=Math.sin(I)*X+W;V?(V=!1,c=S,p=C):o+=U(d,m,S,C);var T=(n-v)*X/w+v;if(g&&h(v,W,X,I,I+K,1-L[7],t,T,a))return!0;_&&(o+=b(v,W,X,I,I+K,1-L[7],T,a)),d=Math.cos(I+K)*w+v,m=Math.sin(I+K)*X+W;break;case"z":if(g&&r(d,m,c,p,t,n,a))return!0;u=!0}}return _&&(o+=U(d,m,c,p,n,a)),0!==o}function x(e,t){var i=e+":"+t;if(w[i])return w[i];L=L||v.getContext(),L.save(),t&&(L.font=t),e=(e+"").split("\n");for(var n=0,a=0,o=e.length;o>a;a++)n=Math.max(L.measureText(e[a]).width,n);return L.restore(),w[i]=n,++I>S&&(I=0,w={}),n}function k(e,t){var i=e+":"+t;if(X[i])return X[i];L=L||v.getContext(),L.save(),t&&(L.font=t),e=(e+"").split("\n");var n=(L.measureText("国").width+2)*e.length;return L.restore(),X[i]=n,++K>S&&(K=0,X={}),n}var L,v=e("./util"),W=e("./curve"),w={},X={},I=0,K=0,S=5e3,C=2*Math.PI,T=[-1,-1,-1],E=[-1,-1];return{isInside:i,isOutside:o,getTextWidth:x,getTextHeight:k,isInsidePath:_,isInsidePolygon:V,isInsideSector:u,isInsideCircle:p,isInsideLine:r,isInsideRect:c,isInsidePolyline:d,isInsideCubicStroke:s,isInsideQuadraticStroke:l}}),define("zrender/shape/Base",["require","../tool/matrix","../tool/guid","../tool/util","../tool/log","../mixin/Transformable","../mixin/Eventful","../tool/area","../tool/color"],function(e){function t(t,n,a,o,r,s,l){r&&(t.font=r),t.textAlign=s,t.textBaseline=l;var h=i(n,a,o,r,s,l);n=(n+"").split("\n");var d=e("../tool/area").getTextHeight("国",r);switch(l){case"top":o=h.y;break;case"bottom":o=h.y+d;break;default:o=h.y+d/2}for(var m=0,c=n.length;c>m;m++)t.fillText(n[m],a,o),o+=d}function i(t,i,n,a,o,r){var s=e("../tool/area"),l=s.getTextWidth(t,a),h=s.getTextHeight("国",a);switch(t=(t+"").split("\n"),o){case"end":case"right":i-=l;break;case"center":i-=l/2}switch(r){case"top":break;case"bottom":n-=h*t.length;break;default:n-=h*t.length/2}return{x:i,y:n,width:l,height:h*t.length}}var n=window.G_vmlCanvasManager,a=e("../tool/matrix"),o=e("../tool/guid"),r=e("../tool/util"),s=e("../tool/log"),l=e("../mixin/Transformable"),h=e("../mixin/Eventful"),d=function(e){e=e||{},this.id=e.id||o();for(var t in e)this[t]=e[t];this.style=this.style||{},this.highlightStyle=this.highlightStyle||null,this.parent=null,this.__dirty=!0,this.__clipShapes=[],l.call(this),h.call(this)};d.prototype.invisible=!1,d.prototype.ignore=!1,d.prototype.zlevel=0,d.prototype.draggable=!1,d.prototype.clickable=!1,d.prototype.hoverable=!0,d.prototype.z=0,d.prototype.brush=function(e,t){var i=this.beforeBrush(e,t);switch(e.beginPath(),this.buildPath(e,i),i.brushType){case"both":e.fill();case"stroke":i.lineWidth>0&&e.stroke();break;default:e.fill()}this.drawText(e,i,this.style),this.afterBrush(e)},d.prototype.beforeBrush=function(e,t){var i=this.style;return this.brushTypeOnly&&(i.brushType=this.brushTypeOnly),t&&(i=this.getHighlightStyle(i,this.highlightStyle||{},this.brushTypeOnly)),"stroke"==this.brushTypeOnly&&(i.strokeColor=i.strokeColor||i.color),e.save(),this.doClip(e),this.setContext(e,i),this.setTransform(e),i},d.prototype.afterBrush=function(e){e.restore()};var m=[["color","fillStyle"],["strokeColor","strokeStyle"],["opacity","globalAlpha"],["lineCap","lineCap"],["lineJoin","lineJoin"],["miterLimit","miterLimit"],["lineWidth","lineWidth"],["shadowBlur","shadowBlur"],["shadowColor","shadowColor"],["shadowOffsetX","shadowOffsetX"],["shadowOffsetY","shadowOffsetY"]];d.prototype.setContext=function(e,t){for(var i=0,n=m.length;n>i;i++){var a=m[i][0],o=t[a],r=m[i][1];"undefined"!=typeof o&&(e[r]=o)}};var c=a.create();return d.prototype.doClip=function(e){if(this.__clipShapes&&!n)for(var t=0;t=a.x&&t<=a.x+a.width&&i>=a.y&&i<=a.y+a.height?e("../tool/area").isInside(this,this.style,t,i):!1},d.prototype.drawText=function(e,i,n){if("undefined"!=typeof i.text&&i.text!==!1){var a=i.textColor||i.color||i.strokeColor;e.fillStyle=a;var o,r,s,l,h=10,d=i.textPosition||this.textPosition||"top";switch(d){case"inside":case"top":case"bottom":case"left":case"right":if(this.getRect){var m=(n||i).__rect||this.getRect(n||i);switch(d){case"inside":s=m.x+m.width/2,l=m.y+m.height/2,o="center",r="middle","stroke"!=i.brushType&&a==i.color&&(e.fillStyle="#fff");break;case"left":s=m.x-h,l=m.y+m.height/2,o="end",r="middle";break;case"right":s=m.x+m.width+h,l=m.y+m.height/2,o="start",r="middle";break;case"top":s=m.x+m.width/2,l=m.y-h,o="center",r="bottom";break;case"bottom":s=m.x+m.width/2,l=m.y+m.height+h,o="center",r="top"}}break;case"start":case"end":var c=i.pointList||[[i.xStart||0,i.yStart||0],[i.xEnd||0,i.yEnd||0]],p=c.length;if(2>p)return;var u,V,U,g;switch(d){case"start":u=c[1][0],V=c[0][0],U=c[1][1],g=c[0][1];break;case"end":u=c[p-2][0],V=c[p-1][0],U=c[p-2][1],g=c[p-1][1]}s=V,l=g;var y=Math.atan((U-g)/(V-u))/Math.PI*180;0>V-u?y+=180:0>U-g&&(y+=360),h=5,y>=30&&150>=y?(o="center",r="bottom",l-=h):y>150&&210>y?(o="right",r="middle",s-=h):y>=210&&330>=y?(o="center",r="top",l+=h):(o="left",r="middle",s+=h);break;case"specific":s=i.textX||0,l=i.textY||0,o="start",r="middle"}null!=s&&null!=l&&t(e,i.text,s,l,i.textFont,i.textAlign||o,i.textBaseline||r)}},d.prototype.modSelf=function(){this.__dirty=!0,this.style&&(this.style.__rect=null),this.highlightStyle&&(this.highlightStyle.__rect=null)},d.prototype.isSilent=function(){return!(this.hoverable||this.draggable||this.clickable||this.onmousemove||this.onmouseover||this.onmouseout||this.onmousedown||this.onmouseup||this.onclick||this.ondragenter||this.ondragover||this.ondragleave||this.ondrop)},r.merge(d.prototype,l.prototype,!0),r.merge(d.prototype,h.prototype,!0),d}),define("zrender/tool/curve",["require","./vector"],function(e){function t(e){return e>-V&&V>e}function i(e){return e>V||-V>e}function n(e,t,i,n,a){var o=1-a;return o*o*(o*e+3*a*t)+a*a*(a*n+3*o*i)}function a(e,t,i,n,a){var o=1-a;return 3*(((t-e)*o+2*(i-t)*a)*o+(n-i)*a*a)}function o(e,i,n,a,o,r){var s=a+3*(i-n)-e,l=3*(n-2*i+e),h=3*(i-e),d=e-o,m=l*l-3*s*h,c=l*h-9*s*d,p=h*h-3*l*d,u=0;if(t(m)&&t(c))if(t(l))r[0]=0;else{var V=-h/l;V>=0&&1>=V&&(r[u++]=V)}else{var y=c*c-4*m*p;if(t(y)){var f=c/m,V=-l/s+f,b=-f/2;V>=0&&1>=V&&(r[u++]=V),b>=0&&1>=b&&(r[u++]=b)}else if(y>0){var _=Math.sqrt(y),x=m*l+1.5*s*(-c+_),k=m*l+1.5*s*(-c-_);x=0>x?-Math.pow(-x,g):Math.pow(x,g),k=0>k?-Math.pow(-k,g):Math.pow(k,g);var V=(-l-(x+k))/(3*s);V>=0&&1>=V&&(r[u++]=V)}else{var L=(2*m*l-3*s*c)/(2*Math.sqrt(m*m*m)),v=Math.acos(L)/3,W=Math.sqrt(m),w=Math.cos(v),V=(-l-2*W*w)/(3*s),b=(-l+W*(w+U*Math.sin(v)))/(3*s),X=(-l+W*(w-U*Math.sin(v)))/(3*s);V>=0&&1>=V&&(r[u++]=V),b>=0&&1>=b&&(r[u++]=b),X>=0&&1>=X&&(r[u++]=X)}}return u}function r(e,n,a,o,r){var s=6*a-12*n+6*e,l=9*n+3*o-3*e-9*a,h=3*n-3*e,d=0;if(t(l)){if(i(s)){var m=-h/s;m>=0&&1>=m&&(r[d++]=m)}}else{var c=s*s-4*l*h;if(t(c))r[0]=-s/(2*l);else if(c>0){var p=Math.sqrt(c),m=(-s+p)/(2*l),u=(-s-p)/(2*l);m>=0&&1>=m&&(r[d++]=m),u>=0&&1>=u&&(r[d++]=u)}}return d}function s(e,t,i,n,a,o){var r=(t-e)*a+e,s=(i-t)*a+t,l=(n-i)*a+i,h=(s-r)*a+r,d=(l-s)*a+s,m=(d-h)*a+h;o[0]=e,o[1]=r,o[2]=h,o[3]=m,o[4]=m,o[5]=d,o[6]=l,o[7]=n}function l(e,t,i,a,o,r,s,l,h,d,m){var c,p=.005,U=1/0;y[0]=h,y[1]=d;for(var g=0;1>g;g+=.05){f[0]=n(e,i,o,s,g),f[1]=n(t,a,r,l,g);var _=u.distSquare(y,f);U>_&&(c=g,U=_)}U=1/0;for(var x=0;32>x&&!(V>p);x++){var k=c-p,L=c+p;f[0]=n(e,i,o,s,k),f[1]=n(t,a,r,l,k);var _=u.distSquare(f,y);if(k>=0&&U>_)c=k,U=_;else{b[0]=n(e,i,o,s,L),b[1]=n(t,a,r,l,L);var v=u.distSquare(b,y);1>=L&&U>v?(c=L,U=v):p*=.5}}return m&&(m[0]=n(e,i,o,s,c),m[1]=n(t,a,r,l,c)),Math.sqrt(U)}function h(e,t,i,n){var a=1-n;return a*(a*e+2*n*t)+n*n*i}function d(e,t,i,n){return 2*((1-n)*(t-e)+n*(i-t))}function m(e,n,a,o,r){var s=e-2*n+a,l=2*(n-e),h=e-o,d=0;if(t(s)){if(i(l)){var m=-h/l;m>=0&&1>=m&&(r[d++]=m)}}else{var c=l*l-4*s*h;if(t(c)){var m=-l/(2*s);m>=0&&1>=m&&(r[d++]=m)}else if(c>0){var p=Math.sqrt(c),m=(-l+p)/(2*s),u=(-l-p)/(2*s);m>=0&&1>=m&&(r[d++]=m),u>=0&&1>=u&&(r[d++]=u)}}return d}function c(e,t,i){var n=e+i-2*t;return 0===n?.5:(e-t)/n}function p(e,t,i,n,a,o,r,s,l){var d,m=.005,c=1/0;y[0]=r,y[1]=s;for(var p=0;1>p;p+=.05){f[0]=h(e,i,a,p),f[1]=h(t,n,o,p);var U=u.distSquare(y,f);c>U&&(d=p,c=U)}c=1/0;for(var g=0;32>g&&!(V>m);g++){var _=d-m,x=d+m;f[0]=h(e,i,a,_),f[1]=h(t,n,o,_);var U=u.distSquare(f,y);if(_>=0&&c>U)d=_,c=U;else{b[0]=h(e,i,a,x),b[1]=h(t,n,o,x);var k=u.distSquare(b,y);1>=x&&c>k?(d=x,c=k):m*=.5}}return l&&(l[0]=h(e,i,a,d),l[1]=h(t,n,o,d)),Math.sqrt(c)}var u=e("./vector"),V=1e-4,U=Math.sqrt(3),g=1/3,y=u.create(),f=u.create(),b=u.create();return{cubicAt:n,cubicDerivativeAt:a,cubicRootAt:o,cubicExtrema:r,cubicSubdivide:s,cubicProjectPoint:l,quadraticAt:h,quadraticDerivativeAt:d,quadraticRootAt:m,quadraticExtremum:c,quadraticProjectPoint:p}}),define("zrender/mixin/Transformable",["require","../tool/matrix","../tool/vector"],function(e){"use strict";function t(e){return e>-r&&r>e}function i(e){return e>r||-r>e}var n=e("../tool/matrix"),a=e("../tool/vector"),o=[0,0],r=5e-5,s=function(){this.position||(this.position=[0,0]),"undefined"==typeof this.rotation&&(this.rotation=[0,0,0]),this.scale||(this.scale=[1,1,0,0]),this.needLocalTransform=!1,this.needTransform=!1};return s.prototype={constructor:s,updateNeedTransform:function(){this.needLocalTransform=i(this.rotation[0])||i(this.position[0])||i(this.position[1])||i(this.scale[0]-1)||i(this.scale[1]-1)},updateTransform:function(){if(this.updateNeedTransform(),this.needTransform=this.parent?this.needLocalTransform||this.parent.needTransform:this.needLocalTransform,this.needTransform){var e=this.transform||n.create();if(n.identity(e),this.needLocalTransform){if(i(this.scale[0])||i(this.scale[1])){o[0]=-this.scale[2]||0,o[1]=-this.scale[3]||0;var t=i(o[0])||i(o[1]);t&&n.translate(e,e,o),n.scale(e,e,this.scale),t&&(o[0]=-o[0],o[1]=-o[1],n.translate(e,e,o))}if(this.rotation instanceof Array){if(0!==this.rotation[0]){o[0]=-this.rotation[1]||0,o[1]=-this.rotation[2]||0;var t=i(o[0])||i(o[1]);t&&n.translate(e,e,o),n.rotate(e,e,this.rotation[0]),t&&(o[0]=-o[0],o[1]=-o[1],n.translate(e,e,o))}}else 0!==this.rotation&&n.rotate(e,e,this.rotation);(i(this.position[0])||i(this.position[1]))&&n.translate(e,e,this.position)}this.transform=e,this.parent&&this.parent.needTransform&&(this.needLocalTransform?n.mul(this.transform,this.parent.transform,this.transform):n.copy(this.transform,this.parent.transform))}},setTransform:function(e){if(this.needTransform){var t=this.transform;e.transform(t[0],t[1],t[2],t[3],t[4],t[5])}},lookAt:function(){var e=a.create();return function(i){this.transform||(this.transform=n.create());var o=this.transform;a.sub(e,i,this.position),t(e[0])&&t(e[1])||(a.normalize(e,e),o[2]=e[0]*this.scale[1],o[3]=e[1]*this.scale[1],o[0]=e[1]*this.scale[0],o[1]=-e[0]*this.scale[0],o[4]=this.position[0],o[5]=this.position[1],this.decomposeTransform())}}(),decomposeTransform:function(){if(this.transform){var e=this.transform,t=e[0]*e[0]+e[1]*e[1],n=this.position,a=this.scale,o=this.rotation;i(t-1)&&(t=Math.sqrt(t));var r=e[2]*e[2]+e[3]*e[3];i(r-1)&&(r=Math.sqrt(r)),n[0]=e[4],n[1]=e[5],a[0]=t,a[1]=r,a[2]=a[3]=0,o[0]=Math.atan2(-e[1]/r,e[0]/t),o[1]=o[2]=0}}},s}),define("zrender/Group",["require","./tool/guid","./tool/util","./mixin/Transformable","./mixin/Eventful"],function(e){var t=e("./tool/guid"),i=e("./tool/util"),n=e("./mixin/Transformable"),a=e("./mixin/Eventful"),o=function(e){e=e||{},this.id=e.id||t();for(var i in e)this[i]=e[i];this.type="group",this.clipShape=null,this._children=[],this._storage=null,this.__dirty=!0,n.call(this),a.call(this)};return o.prototype.ignore=!1,o.prototype.children=function(){return this._children.slice()},o.prototype.childAt=function(e){return this._children[e]},o.prototype.addChild=function(e){e!=this&&e.parent!=this&&(e.parent&&e.parent.removeChild(e),this._children.push(e),e.parent=this,this._storage&&this._storage!==e._storage&&(this._storage.addToMap(e),e instanceof o&&e.addChildrenToStorage(this._storage)))},o.prototype.removeChild=function(e){var t=i.indexOf(this._children,e);this._children.splice(t,1),e.parent=null,this._storage&&(this._storage.delFromMap(e.id),e instanceof o&&e.delChildrenFromStorage(this._storage))},o.prototype.clearChildren=function(){for(var e=0;et)){t=Math.min(t,1);var n="string"==typeof this.easing?i[this.easing]:this.easing,a="function"==typeof n?n(t):t;return this.fire("frame",a),1==t?this.loop?(this.restart(),"restart"):(this._needsRemove=!0,"destroy"):null}},restart:function(){var e=(new Date).getTime(),t=(e-this._startTime)%this._life;this._startTime=(new Date).getTime()-t+this.gap,this._needsRemove=!1},fire:function(e,t){for(var i=0,n=this._targetPool.length;n>i;i++)this["on"+e]&&this["on"+e](this._targetPool[i],t)},constructor:t},t}),define("zrender/animation/easing",[],function(){var e={Linear:function(e){return e},QuadraticIn:function(e){return e*e},QuadraticOut:function(e){return e*(2-e)},QuadraticInOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},CubicIn:function(e){return e*e*e},CubicOut:function(e){return--e*e*e+1},CubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},QuarticIn:function(e){return e*e*e*e},QuarticOut:function(e){return 1- --e*e*e*e},QuarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},QuinticIn:function(e){return e*e*e*e*e},QuinticOut:function(e){return--e*e*e*e*e+1},QuinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},SinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},SinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},SinusoidalInOut:function(e){return.5*(1-Math.cos(Math.PI*e))},ExponentialIn:function(e){return 0===e?0:Math.pow(1024,e-1)},ExponentialOut:function(e){return 1===e?1:1-Math.pow(2,-10*e)},ExponentialInOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)},CircularIn:function(e){return 1-Math.sqrt(1-e*e)},CircularOut:function(e){return Math.sqrt(1- --e*e)},CircularInOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},ElasticIn:function(e){var t,i=.1,n=.4;return 0===e?0:1===e?1:(!i||1>i?(i=1,t=n/4):t=n*Math.asin(1/i)/(2*Math.PI),-(i*Math.pow(2,10*(e-=1))*Math.sin(2*(e-t)*Math.PI/n)))},ElasticOut:function(e){var t,i=.1,n=.4;return 0===e?0:1===e?1:(!i||1>i?(i=1,t=n/4):t=n*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-10*e)*Math.sin(2*(e-t)*Math.PI/n)+1)},ElasticInOut:function(e){var t,i=.1,n=.4;return 0===e?0:1===e?1:(!i||1>i?(i=1,t=n/4):t=n*Math.asin(1/i)/(2*Math.PI),(e*=2)<1?-.5*i*Math.pow(2,10*(e-=1))*Math.sin(2*(e-t)*Math.PI/n):i*Math.pow(2,-10*(e-=1))*Math.sin(2*(e-t)*Math.PI/n)*.5+1)},BackIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},BackOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},BackInOut:function(e){var t=2.5949095;return(e*=2)<1?.5*e*e*((t+1)*e-t):.5*((e-=2)*e*((t+1)*e+t)+2)},BounceIn:function(t){return 1-e.BounceOut(1-t)},BounceOut:function(e){return 1/2.75>e?7.5625*e*e:2/2.75>e?7.5625*(e-=1.5/2.75)*e+.75:2.5/2.75>e?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},BounceInOut:function(t){return.5>t?.5*e.BounceIn(2*t):.5*e.BounceOut(2*t-1)+.5}};return e}),define("echarts/chart/base",["require","zrender/shape/Image","../util/shape/Icon","../util/shape/MarkLine","../util/shape/Symbol","../config","../util/ecData","../util/ecAnimation","../util/ecEffect","../util/accMath","../component/base","zrender/tool/util","zrender/tool/area"],function(e){function t(e,t,i,n,a){m.call(this,e,t,i,n,a);var o=this;this.selectedMap={},this.lastShapeList=[],this.shapeHandler={onclick:function(){o.isClick=!0},ondragover:function(e){var t=e.target;t.highlightStyle=t.highlightStyle||{}; +var i=t.highlightStyle,n=i.brushTyep,a=i.strokeColor,s=i.lineWidth;i.brushType="stroke",i.strokeColor=o.ecTheme.calculableColor||r.calculableColor,i.lineWidth="icon"===t.type?30:10,o.zr.addHoverShape(t),setTimeout(function(){i&&(i.brushType=n,i.strokeColor=a,i.lineWidth=s)},20)},ondrop:function(e){null!=s.get(e.dragged,"data")&&(o.isDrop=!0)},ondragend:function(){o.isDragend=!0}}}var i=e("zrender/shape/Image"),n=e("../util/shape/Icon"),a=e("../util/shape/MarkLine"),o=e("../util/shape/Symbol"),r=e("../config"),s=e("../util/ecData"),l=e("../util/ecAnimation"),h=e("../util/ecEffect"),d=e("../util/accMath"),m=e("../component/base"),c=e("zrender/tool/util"),p=e("zrender/tool/area");return t.prototype={setCalculable:function(e){return e.dragEnableTime=this.ecTheme.DRAG_ENABLE_TIME||r.DRAG_ENABLE_TIME,e.ondragover=this.shapeHandler.ondragover,e.ondragend=this.shapeHandler.ondragend,e.ondrop=this.shapeHandler.ondrop,e},ondrop:function(e,t){if(this.isDrop&&e.target&&!t.dragIn){var i,n=e.target,a=e.dragged,o=s.get(n,"seriesIndex"),l=s.get(n,"dataIndex"),h=this.series,m=this.component.legend;if(-1===l){if(s.get(a,"seriesIndex")==o)return t.dragOut=t.dragIn=t.needRefresh=!0,void(this.isDrop=!1);i={value:s.get(a,"value"),name:s.get(a,"name")},this.type===r.CHART_TYPE_PIE&&i.value<0&&(i.value=0);for(var c=!1,p=h[o].data,u=0,V=p.length;V>u;u++)p[u].name===i.name&&"-"===p[u].value&&(h[o].data[u].value=i.value,c=!0);!c&&h[o].data.push(i),m&&m.add(i.name,a.style.color||a.style.strokeColor)}else i=h[o].data[l]||"-",null!=i.value?(h[o].data[l].value="-"!=i.value?d.accAdd(h[o].data[l].value,s.get(a,"value")):s.get(a,"value"),(this.type===r.CHART_TYPE_FUNNEL||this.type===r.CHART_TYPE_PIE)&&(m&&1===m.getRelatedAmount(i.name)&&this.component.legend.del(i.name),i.name+=this.option.nameConnector+s.get(a,"name"),m&&m.add(i.name,a.style.color||a.style.strokeColor))):h[o].data[l]="-"!=i?d.accAdd(h[o].data[l],s.get(a,"value")):s.get(a,"value");t.dragIn=t.dragIn||!0,this.isDrop=!1;var U=this;setTimeout(function(){U.zr.trigger("mousemove",e.event)},300)}},ondragend:function(e,t){if(this.isDragend&&e.target&&!t.dragOut){var i=e.target,n=s.get(i,"seriesIndex"),a=s.get(i,"dataIndex"),o=this.series;if(null!=o[n].data[a].value){o[n].data[a].value="-";var r=o[n].data[a].name,l=this.component.legend;l&&0===l.getRelatedAmount(r)&&l.del(r)}else o[n].data[a]="-";t.dragOut=!0,t.needRefresh=!0,this.isDragend=!1}},onlegendSelected:function(e,t){var i=e.selected;for(var n in this.selectedMap)this.selectedMap[n]!=i[n]&&(t.needRefresh=!0),this.selectedMap[n]=i[n]},_buildPosition:function(){this._symbol=this.option.symbolList,this._sIndex2ShapeMap={},this._sIndex2ColorMap={},this.selectedMap={},this.xMarkMap={};for(var e,t,i,n,a=this.series,o={top:[],bottom:[],left:[],right:[],other:[]},s=0,l=a.length;l>s;s++)a[s].type===this.type&&(a[s]=this.reformOption(a[s]),this.legendHoverLink=a[s].legendHoverLink||this.legendHoverLink,e=a[s].xAxisIndex,t=a[s].yAxisIndex,i=this.component.xAxis.getAxis(e),n=this.component.yAxis.getAxis(t),i.type===r.COMPONENT_TYPE_AXIS_CATEGORY?o[i.getPosition()].push(s):n.type===r.COMPONENT_TYPE_AXIS_CATEGORY?o[n.getPosition()].push(s):o.other.push(s));for(var h in o)o[h].length>0&&this._buildSinglePosition(h,o[h]);this.addShapeList()},_buildSinglePosition:function(e,t){var i=this._mapData(t),n=i.locationMap,a=i.maxDataLength;if(0!==a&&0!==n.length){switch(e){case"bottom":case"top":this._buildHorizontal(t,a,n,this.xMarkMap);break;case"left":case"right":this._buildVertical(t,a,n,this.xMarkMap);break;case"other":this._buildOther(t,a,n,this.xMarkMap)}for(var o=0,r=t.length;r>o;o++)this.buildMark(t[o])}},_mapData:function(e){for(var t,i,n,a,o=this.series,s=0,l={},h="__kener__stack__",d=this.component.legend,m=[],c=0,p=0,u=e.length;u>p;p++){if(t=o[e[p]],n=t.name,this._sIndex2ShapeMap[e[p]]=this._sIndex2ShapeMap[e[p]]||this.query(t,"symbol")||this._symbol[p%this._symbol.length],d){if(this.selectedMap[n]=d.isSelected(n),this._sIndex2ColorMap[e[p]]=d.getColor(n),a=d.getItemShape(n)){var V=a.style;if(this.type==r.CHART_TYPE_LINE)V.iconType="legendLineIcon",V.symbol=this._sIndex2ShapeMap[e[p]];else if(t.itemStyle.normal.barBorderWidth>0){var U=a.highlightStyle;V.brushType="both",V.x+=1,V.y+=1,V.width-=2,V.height-=2,V.strokeColor=U.strokeColor=t.itemStyle.normal.barBorderColor,U.lineWidth=3}d.setItemShape(n,a)}}else this.selectedMap[n]=!0,this._sIndex2ColorMap[e[p]]=this.zr.getColor(e[p]);this.selectedMap[n]&&(i=t.stack||h+e[p],null==l[i]?(l[i]=s,m[s]=[e[p]],s++):m[l[i]].push(e[p])),c=Math.max(c,t.data.length)}return{locationMap:m,maxDataLength:c}},_calculMarkMapXY:function(e,t,i){for(var n=this.series,a=0,o=t.length;o>a;a++)for(var r=0,s=t[a].length;s>r;r++){var l=t[a][r],h="xy"==i?0:"",d=this.component.grid,m=e[l];if("-1"!=i.indexOf("x")){m["counter"+h]>0&&(m["average"+h]=m["sum"+h]/m["counter"+h]);var c=this.component.xAxis.getAxis(n[l].xAxisIndex||0).getCoord(m["average"+h]);m["averageLine"+h]=[[c,d.getYend()],[c,d.getY()]],m["minLine"+h]=[[m["minX"+h],d.getYend()],[m["minX"+h],d.getY()]],m["maxLine"+h]=[[m["maxX"+h],d.getYend()],[m["maxX"+h],d.getY()]],m.isHorizontal=!1}if(h="xy"==i?1:"","-1"!=i.indexOf("y")){m["counter"+h]>0&&(m["average"+h]=m["sum"+h]/m["counter"+h]);var p=this.component.yAxis.getAxis(n[l].yAxisIndex||0).getCoord(m["average"+h]);m["averageLine"+h]=[[d.getX(),p],[d.getXend(),p]],m["minLine"+h]=[[d.getX(),m["minY"+h]],[d.getXend(),m["minY"+h]]],m["maxLine"+h]=[[d.getX(),m["maxY"+h]],[d.getXend(),m["maxY"+h]]],m.isHorizontal=!0}}},addLabel:function(e,t,i,n,a){var o=[i,t],r=this.deepMerge(o,"itemStyle.normal.label"),s=this.deepMerge(o,"itemStyle.emphasis.label"),l=r.textStyle||{},h=s.textStyle||{};if(r.show){var d=e.style;d.text=this._getLabelText(t,i,n,"normal"),d.textPosition=null==r.position?"horizontal"===a?"right":"top":r.position,d.textColor=l.color,d.textFont=this.getFont(l),d.textAlign=l.align,d.textBaseline=l.baseline}if(s.show){var m=e.highlightStyle;m.text=this._getLabelText(t,i,n,"emphasis"),m.textPosition=r.show?e.style.textPosition:null==s.position?"horizontal"===a?"right":"top":s.position,m.textColor=h.color,m.textFont=this.getFont(h),m.textAlign=h.align,m.textBaseline=h.baseline}return e},_getLabelText:function(e,t,i,n){var a=this.deepQuery([t,e],"itemStyle."+n+".label.formatter");a||"emphasis"!==n||(a=this.deepQuery([t,e],"itemStyle.normal.label.formatter"));var o=this.getDataFromOption(t,"-");return a?"function"==typeof a?a.call(this.myChart,{seriesName:e.name,series:e,name:i,value:o,data:t,status:n}):"string"==typeof a?a=a.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}").replace("{a0}",e.name).replace("{b0}",i).replace("{c0}",this.numAddCommas(o)):void 0:o instanceof Array?null!=o[2]?this.numAddCommas(o[2]):o[0]+" , "+o[1]:this.numAddCommas(o)},buildMark:function(e){var t=this.series[e];this.selectedMap[t.name]&&(t.markLine&&this._buildMarkLine(e),t.markPoint&&this._buildMarkPoint(e))},_buildMarkPoint:function(e){for(var t,i,n=(this.markAttachStyle||{})[e],a=this.series[e],o=c.clone(a.markPoint),s=0,l=o.data.length;l>s;s++)t=o.data[s],i=this.getMarkCoord(e,t),t.x=null!=t.x?t.x:i[0],t.y=null!=t.y?t.y:i[1],!t.type||"max"!==t.type&&"min"!==t.type||(t.value=i[3],t.name=t.name||t.type,t.symbolSize=t.symbolSize||p.getTextWidth(i[3],this.getFont())/2+5);for(var h=this._markPoint(e,o),s=0,l=h.length;l>s;s++){var d=h[s];d.zlevel=this.getZlevelBase(),d.z=this.getZBase()+1;for(var m in n)d[m]=c.clone(n[m]);this.shapeList.push(d)}if(this.type===r.CHART_TYPE_FORCE||this.type===r.CHART_TYPE_CHORD)for(var s=0,l=h.length;l>s;s++)this.zr.addShape(h[s])},_buildMarkLine:function(e){for(var t,i=(this.markAttachStyle||{})[e],n=this.series[e],a=c.clone(n.markLine),o=0,s=a.data.length;s>o;o++){var l=a.data[o];!l.type||"max"!==l.type&&"min"!==l.type&&"average"!==l.type?t=[this.getMarkCoord(e,l[0]),this.getMarkCoord(e,l[1])]:(t=this.getMarkCoord(e,l),a.data[o]=[c.clone(l),{}],a.data[o][0].name=l.name||l.type,a.data[o][0].value="average"!==l.type?t[3]:+t[3].toFixed(null!=a.precision?a.precision:this.deepQuery([this.ecTheme,r],"markLine.precision")),t=t[2],l=[{},{}]),null!=t&&null!=t[0]&&null!=t[1]&&(a.data[o][0].x=null!=l[0].x?l[0].x:t[0][0],a.data[o][0].y=null!=l[0].y?l[0].y:t[0][1],a.data[o][1].x=null!=l[1].x?l[1].x:t[1][0],a.data[o][1].y=null!=l[1].y?l[1].y:t[1][1])}for(var h=this._markLine(e,a),o=0,s=h.length;s>o;o++){var d=h[o];d.zlevel=this.getZlevelBase(),d.z=this.getZBase()+1;for(var m in i)d[m]=c.clone(i[m]);this.shapeList.push(d)}if(this.type===r.CHART_TYPE_FORCE||this.type===r.CHART_TYPE_CHORD)for(var o=0,s=h.length;s>o;o++)this.zr.addShape(h[o])},_markPoint:function(e,t){var i=this.series[e],n=this.component;c.merge(c.merge(t,c.clone(this.ecTheme.markPoint||{})),c.clone(r.markPoint)),t.name=i.name;var a,o,l,h,d,m,p,u=[],V=t.data,U=n.dataRange,g=n.legend,y=this.zr.getWidth(),f=this.zr.getHeight();if(t.large)a=this.getLargeMarkPoingShape(e,t),a._mark="largePoint",a&&u.push(a);else for(var b=0,_=V.length;_>b;b++)null!=V[b].x&&null!=V[b].y&&(l=null!=V[b].value?V[b].value:"",g&&(o=g.getColor(i.name)),U&&(o=isNaN(l)?o:U.getColor(l),h=[V[b],t],d=this.deepQuery(h,"itemStyle.normal.color")||o,m=this.deepQuery(h,"itemStyle.emphasis.color")||d,null==d&&null==m)||(o=null==o?this.zr.getColor(e):o,V[b].tooltip=V[b].tooltip||t.tooltip||{trigger:"item"},V[b].name=null!=V[b].name?V[b].name:"",V[b].value=l,a=this.getSymbolShape(t,e,V[b],b,V[b].name,this.parsePercent(V[b].x,y),this.parsePercent(V[b].y,f),"pin",o,"rgba(0,0,0,0)","horizontal"),a._mark="point",p=this.deepMerge([V[b],t],"effect"),p.show&&(a.effect=p),i.type===r.CHART_TYPE_MAP&&(a._geo=this.getMarkGeo(V[b])),s.pack(a,i,e,V[b],b,V[b].name,l),u.push(a)));return u},_markLine:function(e,t){var i=this.series[e],n=this.component;c.merge(c.merge(t,c.clone(this.ecTheme.markLine||{})),c.clone(r.markLine)),t.symbol=t.symbol instanceof Array?t.symbol.length>1?t.symbol:[t.symbol[0],t.symbol[0]]:[t.symbol,t.symbol],t.symbolSize=t.symbolSize instanceof Array?t.symbolSize.length>1?t.symbolSize:[t.symbolSize[0],t.symbolSize[0]]:[t.symbolSize,t.symbolSize],t.symbolRotate=t.symbolRotate instanceof Array?t.symbolRotate.length>1?t.symbolRotate:[t.symbolRotate[0],t.symbolRotate[0]]:[t.symbolRotate,t.symbolRotate],t.name=i.name;for(var a,o,l,h,d,m,p,u,V=[],U=t.data,g=n.dataRange,y=n.legend,f=this.zr.getWidth(),b=this.zr.getHeight(),_=0,x=U.length;x>_;_++){var k=U[_];null!=k[0].x&&null!=k[0].y&&null!=k[1].x&&null!=k[1].y&&(o=y?y.getColor(i.name):this.zr.getColor(e),u=this.deepMerge(k),l=null!=u.value?u.value:"",g&&(o=isNaN(l)?o:g.getColor(l),h=[u,t],d=this.deepQuery(h,"itemStyle.normal.color")||o,m=this.deepQuery(h,"itemStyle.emphasis.color")||d,null==d&&null==m)||(k[0].tooltip=u.tooltip||t.tooltip||{trigger:"item"},k[0].name=null!=k[0].name?k[0].name:"",k[1].name=null!=k[1].name?k[1].name:"",k[0].value=l,a=this.getLineMarkShape(t,e,k,_,this.parsePercent(k[0].x,f),this.parsePercent(k[0].y,b),this.parsePercent(k[1].x,f),this.parsePercent(k[1].y,b),o),a._mark="line",p=this.deepMerge([u,t],"effect"),p.show&&(a.effect=p),i.type===r.CHART_TYPE_MAP&&(a._geo=[this.getMarkGeo(k[0]),this.getMarkGeo(k[1])]),s.pack(a,i,e,k[0],_,k[0].name+(""!==k[1].name?" > "+k[1].name:""),l),V.push(a)))}return V},getMarkCoord:function(){return[0,0]},getSymbolShape:function(e,t,a,o,r,l,h,d,m,c,p){var u=[a,e],V=this.getDataFromOption(a,"-");d=this.deepQuery(u,"symbol")||d;var U=this.deepQuery(u,"symbolSize");U="function"==typeof U?U(V):U;var g=this.deepQuery(u,"symbolRotate"),y=this.deepMerge(u,"itemStyle.normal"),f=this.deepMerge(u,"itemStyle.emphasis"),b=null!=y.borderWidth?y.borderWidth:y.lineStyle&&y.lineStyle.width;null==b&&(b=d.match("empty")?2:0);var _=null!=f.borderWidth?f.borderWidth:f.lineStyle&&f.lineStyle.width;null==_&&(_=b+2);var x=new n({style:{iconType:d.replace("empty","").toLowerCase(),x:l-U,y:h-U,width:2*U,height:2*U,brushType:"both",color:d.match("empty")?c:this.getItemStyleColor(y.color,t,o,a)||m,strokeColor:y.borderColor||this.getItemStyleColor(y.color,t,o,a)||m,lineWidth:b},highlightStyle:{color:d.match("empty")?c:this.getItemStyleColor(f.color,t,o,a),strokeColor:f.borderColor||y.borderColor||this.getItemStyleColor(y.color,t,o,a)||m,lineWidth:_},clickable:this.deepQuery(u,"clickable")});return d.match("image")&&(x.style.image=d.replace(new RegExp("^image:\\/\\/"),""),x=new i({style:x.style,highlightStyle:x.highlightStyle,clickable:this.deepQuery(u,"clickable")})),null!=g&&(x.rotation=[g*Math.PI/180,l,h]),d.match("star")&&(x.style.iconType="star",x.style.n=d.replace("empty","").replace("star","")-0||5),"none"===d&&(x.invisible=!0,x.hoverable=!1),x=this.addLabel(x,e,a,r,p),d.match("empty")&&(null==x.style.textColor&&(x.style.textColor=x.style.strokeColor),null==x.highlightStyle.textColor&&(x.highlightStyle.textColor=x.highlightStyle.strokeColor)),s.pack(x,e,t,a,o,r),x._x=l,x._y=h,x._dataIndex=o,x._seriesIndex=t,x},getLineMarkShape:function(e,t,i,n,o,r,s,l,h){var d=null!=i[0].value?i[0].value:"-",m=null!=i[1].value?i[1].value:"-",c=[this.query(i[0],"symbol")||e.symbol[0],this.query(i[1],"symbol")||e.symbol[1]],p=[this.query(i[0],"symbolSize")||e.symbolSize[0],this.query(i[1],"symbolSize")||e.symbolSize[1]];p[0]="function"==typeof p[0]?p[0](d):p[0],p[1]="function"==typeof p[1]?p[1](m):p[1];var u=[this.query(i[0],"symbolRotate")||e.symbolRotate[0],this.query(i[1],"symbolRotate")||e.symbolRotate[1]],V=[i[0],i[1],e],U=this.deepMerge(V,"itemStyle.normal");U.color=this.getItemStyleColor(U.color,t,n,i);var g=this.deepMerge(V,"itemStyle.emphasis");g.color=this.getItemStyleColor(g.color,t,n,i);var y=U.lineStyle,f=g.lineStyle,b=y.width;null==b&&(b=U.borderWidth);var _=f.width;null==_&&(_=null!=g.borderWidth?g.borderWidth:b+2);var x=new a({style:{smooth:this.deepQuery([i[0],i[1],e],"smooth")?"spline":!1,smoothRadian:this.deepQuery([i[0],i[1],e],"smoothRadian"),symbol:c,symbolSize:p,symbolRotate:u,xStart:o,yStart:r,xEnd:s,yEnd:l,brushType:"both",lineType:y.type,shadowColor:y.shadowColor||y.color||U.borderColor||U.color||h,shadowBlur:y.shadowBlur,shadowOffsetX:y.shadowOffsetX,shadowOffsetY:y.shadowOffsetY,color:U.color||h,strokeColor:y.color||U.borderColor||U.color||h,lineWidth:b,symbolBorderColor:U.borderColor||U.color||h,symbolBorder:U.borderWidth},highlightStyle:{shadowColor:f.shadowColor,shadowBlur:f.shadowBlur,shadowOffsetX:f.shadowOffsetX,shadowOffsetY:f.shadowOffsetY,color:g.color||U.color||h,strokeColor:f.color||y.color||g.borderColor||U.borderColor||g.color||U.color||h,lineWidth:_,symbolBorderColor:g.borderColor||U.borderColor||g.color||U.color||h,symbolBorder:null==g.borderWidth?U.borderWidth+2:g.borderWidth},clickable:this.deepQuery(V,"clickable")});return x=this.addLabel(x,e,i[0],i[0].name+" : "+i[1].name),x._x=s,x._y=l,x},getLargeMarkPoingShape:function(e,t){var i,n,a,r,s,l,h=this.series[e],d=this.component,m=t.data,c=d.dataRange,p=d.legend,u=[m[0],t];if(p&&(n=p.getColor(h.name)),!c||(a=null!=m[0].value?m[0].value:"",n=isNaN(a)?n:c.getColor(a),r=this.deepQuery(u,"itemStyle.normal.color")||n,s=this.deepQuery(u,"itemStyle.emphasis.color")||r,null!=r||null!=s)){n=this.deepMerge(u,"itemStyle.normal").color||n;var V=this.deepQuery(u,"symbol")||"circle";V=V.replace("empty","").replace(/\d/g,""),l=this.deepMerge([m[0],t],"effect");var U=window.devicePixelRatio||1;return i=new o({style:{pointList:m,color:n,strokeColor:n,shadowColor:l.shadowColor||n,shadowBlur:(null!=l.shadowBlur?l.shadowBlur:8)*U,size:this.deepQuery(u,"symbolSize"),iconType:V,brushType:"fill",lineWidth:1},draggable:!1,hoverable:!1}),l.show&&(i.effect=l),i}},backupShapeList:function(){this.shapeList&&this.shapeList.length>0?(this.lastShapeList=this.shapeList,this.shapeList=[]):this.lastShapeList=[]},addShapeList:function(){var e,t,i=this.option.animationThreshold/(this.canvasSupported?2:4),n=this.lastShapeList,a=this.shapeList,o=n.length>0,s=o?this.query(this.option,"animationDurationUpdate"):this.query(this.option,"animationDuration"),l=this.query(this.option,"animationEasing"),h={},d={};if(this.option.animation&&!this.option.renderAsImage&&a.lengthm;m++)t=this._getAnimationKey(n[m]),t.match("undefined")?this.zr.delShape(n[m].id):(t+=n[m].type,h[t]?this.zr.delShape(n[m].id):h[t]=n[m]);for(var m=0,c=a.length;c>m;m++)t=this._getAnimationKey(a[m]),t.match("undefined")?this.zr.addShape(a[m]):(t+=a[m].type,d[t]=a[m]);for(t in h)d[t]||this.zr.delShape(h[t].id);for(t in d)h[t]?(this.zr.delShape(h[t].id),this._animateMod(h[t],d[t],s,l,0,o)):(e=this.type!=r.CHART_TYPE_LINE&&this.type!=r.CHART_TYPE_RADAR||0===t.indexOf("icon")?0:s/2,this._animateMod(!1,d[t],s,l,e,o));this.zr.refresh(),this.animationEffect()}else{this.motionlessOnce=!1,this.zr.delShape(n);for(var m=0,c=a.length;c>m;m++)this.zr.addShape(a[m])}},_getAnimationKey:function(e){return this.type!=r.CHART_TYPE_MAP?s.get(e,"seriesIndex")+"_"+s.get(e,"dataIndex")+(e._mark?e._mark:"")+(this.type===r.CHART_TYPE_RADAR?s.get(e,"special"):""):s.get(e,"seriesIndex")+"_"+s.get(e,"dataIndex")+(e._mark?e._mark:"undefined")},_animateMod:function(e,t,i,n,a,o){switch(t.type){case"polyline":case"half-smooth-polygon":l.pointList(this.zr,e,t,i,n);break;case"rectangle":l.rectangle(this.zr,e,t,i,n);break;case"image":case"icon":l.icon(this.zr,e,t,i,n,a);break;case"candle":o?this.zr.addShape(t):l.candle(this.zr,e,t,i,n);break;case"ring":case"sector":case"circle":o?"sector"===t.type?l.sector(this.zr,e,t,i,n):this.zr.addShape(t):l.ring(this.zr,e,t,i+(s.get(t,"dataIndex")||0)%20*100,n);break;case"text":l.text(this.zr,e,t,i,n);break;case"polygon":o?l.pointList(this.zr,e,t,i,n):l.polygon(this.zr,e,t,i,n);break;case"ribbon":l.ribbon(this.zr,e,t,i,n);break;case"gauge-pointer":l.gaugePointer(this.zr,e,t,i,n);break;case"mark-line":l.markline(this.zr,e,t,i,n);break;case"bezier-curve":case"line":l.line(this.zr,e,t,i,n);break;default:this.zr.addShape(t)}},animationMark:function(e,t,i){for(var n=i||this.shapeList,a=0,o=n.length;o>a;a++)n[a]._mark&&this._animateMod(!1,n[a],e,t,0,!0);this.animationEffect(i)},animationEffect:function(e){!e&&this.clearEffectShape();var t=e||this.shapeList;if(null!=t){var i=r.EFFECT_ZLEVEL;this.canvasSupported&&this.zr.modLayer(i,{motionBlur:!0,lastFrameAlpha:.95});for(var n,a=0,o=t.length;o>a;a++)n=t[a],n._mark&&n.effect&&n.effect.show&&h[n._mark]&&(h[n._mark](this.zr,this.effectList,n,i),this.effectList[this.effectList.length-1]._mark=n._mark)}},clearEffectShape:function(e){this.zr&&this.effectList&&this.effectList.length>0&&(e&&this.zr.modLayer(r.EFFECT_ZLEVEL,{motionBlur:!1}),this.zr.delShape(this.effectList)),this.effectList=[]},addMark:function(e,t,i){var n=this.series[e];if(this.selectedMap[n.name]){var a=this.query(this.option,"animationDurationUpdate"),o=this.query(this.option,"animationEasing"),r=n[i].data,s=this.shapeList.length;if(n[i].data=t.data,this["_build"+i.replace("m","M")](e),this.option.animation&&!this.option.renderAsImage)this.animationMark(a,o,this.shapeList.slice(s));else{for(var l=s,h=this.shapeList.length;h>l;l++)this.zr.addShape(this.shapeList[l]);this.zr.refreshNextFrame()}n[i].data=r}},delMark:function(e,t,i){i=i.replace("mark","").replace("large","").toLowerCase();var n=this.series[e];if(this.selectedMap[n.name]){for(var a=!1,o=[this.shapeList,this.effectList],r=2;r--;)for(var l=0,h=o[r].length;h>l;l++)if(o[r][l]._mark==i&&s.get(o[r][l],"seriesIndex")==e&&s.get(o[r][l],"name")==t){this.zr.delShape(o[r][l].id),o[r].splice(l,1),a=!0;break}a&&this.zr.refreshNextFrame()}}},c.inherits(t,m),t}),define("zrender/shape/Circle",["require","./Base","../tool/util"],function(e){"use strict";var t=e("./Base"),i=function(e){t.call(this,e)};return i.prototype={type:"circle",buildPath:function(e,t){e.arc(t.x,t.y,t.r,0,2*Math.PI,!0)},getRect:function(e){if(e.__rect)return e.__rect;var t;return t="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0,e.__rect={x:Math.round(e.x-e.r-t/2),y:Math.round(e.y-e.r-t/2),width:2*e.r+t,height:2*e.r+t},e.__rect}},e("../tool/util").inherits(i,t),i}),define("echarts/util/accMath",[],function(){function e(e,t){var i=e.toString(),n=t.toString(),a=0;try{a=n.split(".")[1].length}catch(o){}try{a-=i.split(".")[1].length}catch(o){}return(i.replace(".","")-0)/(n.replace(".","")-0)*Math.pow(10,a)}function t(e,t){var i=e.toString(),n=t.toString(),a=0;try{a+=i.split(".")[1].length}catch(o){}try{a+=n.split(".")[1].length}catch(o){}return(i.replace(".","")-0)*(n.replace(".","")-0)/Math.pow(10,a)}function i(e,t){var i=0,n=0;try{i=e.toString().split(".")[1].length}catch(a){}try{n=t.toString().split(".")[1].length}catch(a){}var o=Math.pow(10,Math.max(i,n));return(Math.round(e*o)+Math.round(t*o))/o}function n(e,t){return i(e,-t)}return{accDiv:e,accMul:t,accAdd:i,accSub:n}}),define("echarts/util/shape/Icon",["require","zrender/tool/util","zrender/shape/Star","zrender/shape/Heart","zrender/shape/Droplet","zrender/shape/Image","zrender/shape/Base"],function(e){function t(e,t){var i=t.x,n=t.y,a=t.width/16,o=t.height/16;e.moveTo(i,n+t.height),e.lineTo(i+5*a,n+14*o),e.lineTo(i+t.width,n+3*o),e.lineTo(i+13*a,n),e.lineTo(i+2*a,n+11*o),e.lineTo(i,n+t.height),e.moveTo(i+6*a,n+10*o),e.lineTo(i+14*a,n+2*o),e.moveTo(i+10*a,n+13*o),e.lineTo(i+t.width,n+13*o),e.moveTo(i+13*a,n+10*o),e.lineTo(i+13*a,n+t.height)}function i(e,t){var i=t.x,n=t.y,a=t.width/16,o=t.height/16;e.moveTo(i,n+t.height),e.lineTo(i+5*a,n+14*o),e.lineTo(i+t.width,n+3*o),e.lineTo(i+13*a,n),e.lineTo(i+2*a,n+11*o),e.lineTo(i,n+t.height),e.moveTo(i+6*a,n+10*o),e.lineTo(i+14*a,n+2*o),e.moveTo(i+10*a,n+13*o),e.lineTo(i+t.width,n+13*o)}function n(e,t){var i=t.x,n=t.y,a=t.width/16,o=t.height/16;e.moveTo(i+4*a,n+15*o),e.lineTo(i+9*a,n+13*o),e.lineTo(i+14*a,n+8*o),e.lineTo(i+11*a,n+5*o),e.lineTo(i+6*a,n+10*o),e.lineTo(i+4*a,n+15*o),e.moveTo(i+5*a,n),e.lineTo(i+11*a,n),e.moveTo(i+5*a,n+o),e.lineTo(i+11*a,n+o),e.moveTo(i,n+2*o),e.lineTo(i+t.width,n+2*o),e.moveTo(i,n+5*o),e.lineTo(i+3*a,n+t.height),e.lineTo(i+13*a,n+t.height),e.lineTo(i+t.width,n+5*o)}function a(e,t){var i=t.x,n=t.y,a=t.width/16,o=t.height/16;e.moveTo(i,n+3*o),e.lineTo(i+6*a,n+3*o),e.moveTo(i+3*a,n),e.lineTo(i+3*a,n+6*o),e.moveTo(i+3*a,n+8*o),e.lineTo(i+3*a,n+t.height),e.lineTo(i+t.width,n+t.height),e.lineTo(i+t.width,n+3*o),e.lineTo(i+8*a,n+3*o)}function o(e,t){var i=t.x,n=t.y,a=t.width/16,o=t.height/16;e.moveTo(i+6*a,n),e.lineTo(i+2*a,n+3*o),e.lineTo(i+6*a,n+6*o),e.moveTo(i+2*a,n+3*o),e.lineTo(i+14*a,n+3*o),e.lineTo(i+14*a,n+11*o),e.moveTo(i+2*a,n+5*o),e.lineTo(i+2*a,n+13*o),e.lineTo(i+14*a,n+13*o),e.moveTo(i+10*a,n+10*o),e.lineTo(i+14*a,n+13*o),e.lineTo(i+10*a,n+t.height)}function r(e,t){var i=t.x,n=t.y,a=t.width/16,o=t.height/16,r=t.width/2;e.lineWidth=1.5,e.arc(i+r,n+r,r-a,0,2*Math.PI/3),e.moveTo(i+3*a,n+t.height),e.lineTo(i+0*a,n+12*o),e.lineTo(i+5*a,n+11*o),e.moveTo(i,n+8*o),e.arc(i+r,n+r,r-a,Math.PI,5*Math.PI/3),e.moveTo(i+13*a,n),e.lineTo(i+t.width,n+4*o),e.lineTo(i+11*a,n+5*o)}function s(e,t){var i=t.x,n=t.y,a=t.width/16,o=t.height/16;e.moveTo(i,n),e.lineTo(i,n+t.height),e.lineTo(i+t.width,n+t.height),e.moveTo(i+2*a,n+14*o),e.lineTo(i+7*a,n+6*o),e.lineTo(i+11*a,n+11*o),e.lineTo(i+15*a,n+2*o)}function l(e,t){var i=t.x,n=t.y,a=t.width/16,o=t.height/16;e.moveTo(i,n),e.lineTo(i,n+t.height),e.lineTo(i+t.width,n+t.height),e.moveTo(i+3*a,n+14*o),e.lineTo(i+3*a,n+6*o),e.lineTo(i+4*a,n+6*o),e.lineTo(i+4*a,n+14*o),e.moveTo(i+7*a,n+14*o),e.lineTo(i+7*a,n+2*o),e.lineTo(i+8*a,n+2*o),e.lineTo(i+8*a,n+14*o),e.moveTo(i+11*a,n+14*o),e.lineTo(i+11*a,n+9*o),e.lineTo(i+12*a,n+9*o),e.lineTo(i+12*a,n+14*o)}function h(e,t){var i=t.x,n=t.y,a=t.width-2,o=t.height-2,r=Math.min(a,o)/2;n+=2,e.moveTo(i+r+3,n+r-3),e.arc(i+r+3,n+r-3,r-1,0,-Math.PI/2,!0),e.lineTo(i+r+3,n+r-3),e.moveTo(i+r,n),e.lineTo(i+r,n+r),e.arc(i+r,n+r,r,-Math.PI/2,2*Math.PI,!0),e.lineTo(i+r,n+r),e.lineWidth=1.5}function d(e,t){var i=t.x,n=t.y,a=t.width/16,o=t.height/16;n-=o,e.moveTo(i+1*a,n+2*o),e.lineTo(i+15*a,n+2*o),e.lineTo(i+14*a,n+3*o),e.lineTo(i+2*a,n+3*o),e.moveTo(i+3*a,n+6*o),e.lineTo(i+13*a,n+6*o),e.lineTo(i+12*a,n+7*o),e.lineTo(i+4*a,n+7*o),e.moveTo(i+5*a,n+10*o),e.lineTo(i+11*a,n+10*o),e.lineTo(i+10*a,n+11*o),e.lineTo(i+6*a,n+11*o),e.moveTo(i+7*a,n+14*o),e.lineTo(i+9*a,n+14*o),e.lineTo(i+8*a,n+15*o),e.lineTo(i+7*a,n+15*o)}function m(e,t){var i=t.x,n=t.y,a=t.width,o=t.height,r=a/16,s=o/16,l=2*Math.min(r,s);e.moveTo(i+r+l,n+s+l),e.arc(i+r,n+s,l,Math.PI/4,3*Math.PI),e.lineTo(i+7*r-l,n+6*s-l),e.arc(i+7*r,n+6*s,l,Math.PI/4*5,4*Math.PI),e.arc(i+7*r,n+6*s,l/2,Math.PI/4*5,4*Math.PI),e.moveTo(i+7*r-l/2,n+6*s+l),e.lineTo(i+r+l,n+14*s-l),e.arc(i+r,n+14*s,l,-Math.PI/4,2*Math.PI),e.moveTo(i+7*r+l/2,n+6*s),e.lineTo(i+14*r-l,n+10*s-l/2),e.moveTo(i+16*r,n+10*s),e.arc(i+14*r,n+10*s,l,0,3*Math.PI),e.lineWidth=1.5}function c(e,t){var i=t.x,n=t.y,a=t.width,o=t.height,r=Math.min(a,o)/2;e.moveTo(i+a,n+o/2),e.arc(i+r,n+r,r,0,2*Math.PI),e.arc(i+r,n,r,Math.PI/4,Math.PI/5*4),e.arc(i,n+r,r,-Math.PI/3,Math.PI/3),e.arc(i+a,n+o,r,Math.PI,Math.PI/2*3),e.lineWidth=1.5}function p(e,t){for(var i=t.x,n=t.y,a=t.width,o=t.height,r=Math.round(o/3),s=Math.round((r-2)/2),l=3;l--;)e.rect(i,n+r*l+s,a,2)}function u(e,t){for(var i=t.x,n=t.y,a=t.width,o=t.height,r=Math.round(a/3),s=Math.round((r-2)/2),l=3;l--;)e.rect(i+r*l+s,n,2,o)}function V(e,t){var i=t.x,n=t.y,a=t.width/16;e.moveTo(i+a,n),e.lineTo(i+a,n+t.height),e.lineTo(i+15*a,n+t.height),e.lineTo(i+15*a,n),e.lineTo(i+a,n),e.moveTo(i+3*a,n+3*a),e.lineTo(i+13*a,n+3*a),e.moveTo(i+3*a,n+6*a),e.lineTo(i+13*a,n+6*a),e.moveTo(i+3*a,n+9*a),e.lineTo(i+13*a,n+9*a),e.moveTo(i+3*a,n+12*a),e.lineTo(i+9*a,n+12*a)}function U(e,t){var i=t.x,n=t.y,a=t.width/16,o=t.height/16;e.moveTo(i,n),e.lineTo(i,n+t.height),e.lineTo(i+t.width,n+t.height),e.lineTo(i+t.width,n),e.lineTo(i,n),e.moveTo(i+4*a,n),e.lineTo(i+4*a,n+8*o),e.lineTo(i+12*a,n+8*o),e.lineTo(i+12*a,n),e.moveTo(i+6*a,n+11*o),e.lineTo(i+6*a,n+13*o),e.lineTo(i+10*a,n+13*o),e.lineTo(i+10*a,n+11*o),e.lineTo(i+6*a,n+11*o)}function g(e,t){var i=t.x,n=t.y,a=t.width,o=t.height;e.moveTo(i,n+o/2),e.lineTo(i+a,n+o/2),e.moveTo(i+a/2,n),e.lineTo(i+a/2,n+o)}function y(e,t){var i=t.width/2,n=t.height/2,a=Math.min(i,n);e.moveTo(t.x+i+a,t.y+n),e.arc(t.x+i,t.y+n,a,0,2*Math.PI),e.closePath()}function f(e,t){e.rect(t.x,t.y,t.width,t.height),e.closePath()}function b(e,t){var i=t.width/2,n=t.height/2,a=t.x+i,o=t.y+n,r=Math.min(i,n);e.moveTo(a,o-r),e.lineTo(a+r,o+r),e.lineTo(a-r,o+r),e.lineTo(a,o-r),e.closePath()}function _(e,t){var i=t.width/2,n=t.height/2,a=t.x+i,o=t.y+n,r=Math.min(i,n);e.moveTo(a,o-r),e.lineTo(a+r,o),e.lineTo(a,o+r),e.lineTo(a-r,o),e.lineTo(a,o-r),e.closePath()}function x(e,t){var i=t.x,n=t.y,a=t.width/16;e.moveTo(i+8*a,n),e.lineTo(i+a,n+t.height),e.lineTo(i+8*a,n+t.height/4*3),e.lineTo(i+15*a,n+t.height),e.lineTo(i+8*a,n),e.closePath()}function k(t,i){var n=e("zrender/shape/Star"),a=i.width/2,o=i.height/2;n.prototype.buildPath(t,{x:i.x+a,y:i.y+o,r:Math.min(a,o),n:i.n||5})}function L(t,i){var n=e("zrender/shape/Heart");n.prototype.buildPath(t,{x:i.x+i.width/2,y:i.y+.2*i.height,a:i.width/2,b:.8*i.height})}function v(t,i){var n=e("zrender/shape/Droplet");n.prototype.buildPath(t,{x:i.x+.5*i.width,y:i.y+.5*i.height,a:.5*i.width,b:.8*i.height})}function W(e,t){var i=t.x,n=t.y-t.height/2*1.5,a=t.width/2,o=t.height/2,r=Math.min(a,o);e.arc(i+a,n+o,r,Math.PI/5*4,Math.PI/5),e.lineTo(i+a,n+o+1.5*r),e.closePath()}function w(t,i,n){var a=e("zrender/shape/Image");this._imageShape=this._imageShape||new a({style:{}});for(var o in i)this._imageShape.style[o]=i[o];this._imageShape.brush(t,!1,n)}function X(e){K.call(this,e)}var I=e("zrender/tool/util"),K=e("zrender/shape/Base");return X.prototype={type:"icon",iconLibrary:{mark:t,markUndo:i,markClear:n,dataZoom:a,dataZoomReset:o,restore:r,lineChart:s,barChart:l,pieChart:h,funnelChart:d,forceChart:m,chordChart:c,stackChart:p,tiledChart:u,dataView:V,saveAsImage:U,cross:g,circle:y,rectangle:f,triangle:b,diamond:_,arrow:x,star:k,heart:L,droplet:v,pin:W,image:w},brush:function(t,i,n){var a=i?this.highlightStyle:this.style;a=a||{};var o=a.iconType||this.style.iconType;if("image"===o){var r=e("zrender/shape/Image");r.prototype.brush.call(this,t,i,n)}else{var a=this.beforeBrush(t,i);switch(t.beginPath(),this.buildPath(t,a,n),a.brushType){case"both":t.fill();case"stroke":a.lineWidth>0&&t.stroke();break;default:t.fill()}this.drawText(t,a,this.style),this.afterBrush(t)}},buildPath:function(e,t,i){this.iconLibrary[t.iconType]?this.iconLibrary[t.iconType].call(this,e,t,i):(e.moveTo(t.x,t.y),e.lineTo(t.x+t.width,t.y),e.lineTo(t.x+t.width,t.y+t.height),e.lineTo(t.x,t.y+t.height),e.lineTo(t.x,t.y),e.closePath())},getRect:function(e){return e.__rect?e.__rect:(e.__rect={x:Math.round(e.x),y:Math.round(e.y-("pin"==e.iconType?e.height/2*1.5:0)),width:e.width,height:e.height*("pin"===e.iconType?1.25:1)},e.__rect)},isCover:function(e,t){var i=this.getTansform(e,t);e=i[0],t=i[1];var n=this.style.__rect;n||(n=this.style.__rect=this.getRect(this.style));var a=n.height<8||n.width<8?4:0;return e>=n.x-a&&e<=n.x+n.width+a&&t>=n.y-a&&t<=n.y+n.height+a?!0:!1}},I.inherits(X,K),X}),define("echarts/util/shape/MarkLine",["require","zrender/shape/Base","./Icon","zrender/shape/Line","zrender/shape/Polyline","zrender/tool/matrix","zrender/tool/area","zrender/shape/util/dashedLineTo","zrender/shape/util/smoothSpline","zrender/tool/util"],function(e){function t(e){i.call(this,e)}var i=e("zrender/shape/Base"),n=e("./Icon"),a=e("zrender/shape/Line"),o=new a({}),r=e("zrender/shape/Polyline"),s=new r({}),l=e("zrender/tool/matrix"),h=e("zrender/tool/area"),d=e("zrender/shape/util/dashedLineTo"),m=e("zrender/shape/util/smoothSpline"),c=e("zrender/tool/util");return t.prototype={type:"mark-line",brush:function(e,t){var i=this.style;t&&(i=this.getHighlightStyle(i,this.highlightStyle||{})),e.save(),this.setContext(e,i),this.setTransform(e),e.save(),e.beginPath(),this.buildLinePath(e,i,this.style.lineWidth||1),e.stroke(),e.restore(),this.brushSymbol(e,i,0),this.brushSymbol(e,i,1),this.drawText(e,i,this.style),e.restore()},buildLinePath:function(e,t,i){var n=t.pointList||this.getPointList(t);t.pointList=n;var a=Math.min(t.pointList.length,Math.round(t.pointListLength||t.pointList.length));if(t.lineType&&"solid"!=t.lineType){if("dashed"==t.lineType||"dotted"==t.lineType)if("spline"!==t.smooth){var o=i*("dashed"==t.lineType?5:1);e.moveTo(n[0][0],n[0][1]);for(var r=1;a>r;r++)d(e,n[r-1][0],n[r-1][1],n[r][0],n[r][1],o)}else for(var r=1;a>r;r+=2)e.moveTo(n[r-1][0],n[r-1][1]),e.lineTo(n[r][0],n[r][1])}else{e.moveTo(n[0][0],n[0][1]);for(var r=1;a>r;r++)e.lineTo(n[r][0],n[r][1])}},brushSymbol:function(e,t,i){if("none"!=t.symbol[i]){e.save(),e.beginPath(),e.lineWidth=t.symbolBorder,e.strokeStyle=t.symbolBorderColor,t.iconType=t.symbol[i].replace("empty","").toLowerCase(),t.symbol[i].match("empty")&&(e.fillStyle="#fff");var a,o=Math.min(t.pointList.length,Math.round(t.pointListLength||t.pointList.length)),r=0===i?t.pointList[0][0]:t.pointList[o-1][0],s=0===i?t.pointList[0][1]:t.pointList[o-1][1],h="undefined"!=typeof t.symbolRotate[i]?t.symbolRotate[i]-0:0;if(0!==h&&(a=l.create(),l.identity(a),(r||s)&&l.translate(a,a,[-r,-s]),l.rotate(a,a,h*Math.PI/180),(r||s)&&l.translate(a,a,[r,s]),e.transform.apply(e,a)),"arrow"==t.iconType&&0===h)this.buildArrawPath(e,t,i);else{var d=t.symbolSize[i];t.x=r-d,t.y=s-d,t.width=2*d,t.height=2*d,n.prototype.buildPath(e,t)}e.closePath(),e.fill(),e.stroke(),e.restore()}},buildArrawPath:function(e,t,i){var n=Math.min(t.pointList.length,Math.round(t.pointListLength||t.pointList.length)),a=2*t.symbolSize[i],o=t.pointList[0][0],r=t.pointList[n-1][0],s=t.pointList[0][1],l=t.pointList[n-1][1],h=0;"spline"===t.smooth&&(h=t.smoothRadian*(r>=o?1:-1));var d=Math.atan(Math.abs((l-s)/(o-r)));0===i?r>o?l>s?d=2*Math.PI-d+h:d+=h:l>s?d+=Math.PI-h:d=Math.PI-d-h:o>r?s>l?d=2*Math.PI-d+h:d+=h:s>l?d+=Math.PI-h:d=Math.PI-d-h;var m=Math.PI/8,c=0===i?o:r,p=0===i?s:l,u=[[c+a*Math.cos(d-m),p-a*Math.sin(d-m)],[c+.6*a*Math.cos(d),p-.6*a*Math.sin(d)],[c+a*Math.cos(d+m),p-a*Math.sin(d+m)]];e.moveTo(c,p);for(var V=0,U=u.length;U>V;V++)e.lineTo(u[V][0],u[V][1]);e.lineTo(c,p)},getPointList:function(e){var t=[[e.xStart,e.yStart],[e.xEnd,e.yEnd]]; +if("spline"===e.smooth){var i=t[1][0],n=t[1][1];if(e.smoothRadian<=.8){t[3]=[i,n];var a=t[0][0]<=t[3][0];t[1]=this.getOffetPoint(t[0],t[3],a,e.smoothRadian),t[2]=this.getOffetPoint(t[3],t[0],a,e.smoothRadian)}else t[2]=[i,n],t[1]=this.getOffetPoint(t[0],t[2],t[0][0]<=t[2][0],e.smoothRadian);t=m(t,!1),t[t.length-1]=[i,n]}return t},getOffetPoint:function(e,t,i,n){var a,o=(2-Math.abs(n))/.6,r=Math.sqrt(Math.round((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])))/o,s=[e[0],e[1]];if(e[0]!=t[0]&&e[1]!=t[1]){var l=(t[1]-e[1])/(t[0]-e[0]);a=Math.atan(l)}else a=e[0]==t[0]?(e[1]<=t[1]?1:-1)*Math.PI/2:0;var h,d;return e[0]<=t[0]?(a-=n*(i?1:-1),h=Math.round(Math.cos(a)*r),d=Math.round(Math.sin(a)*r),s[0]+=h,s[1]+=d):(a+=n*(i?1:-1),h=Math.round(Math.cos(a)*r),d=Math.round(Math.sin(a)*r),s[0]-=h,s[1]-=d),s},getRect:function(e){if(e.__rect)return e.__rect;var t=e.lineWidth||1;return e.__rect={x:Math.min(e.xStart,e.xEnd)-t,y:Math.min(e.yStart,e.yEnd)-t,width:Math.abs(e.xStart-e.xEnd)+t,height:Math.abs(e.yStart-e.yEnd)+t},e.__rect},isCover:function(e,t){var i=this.getTansform(e,t);e=i[0],t=i[1];var n=this.style.__rect;return n||(n=this.style.__rect=this.getRect(this.style)),e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height?"spline"!==this.style.smooth?h.isInside(o,this.style,e,t):h.isInside(s,this.style,e,t):!1}},c.inherits(t,i),t}),define("echarts/util/shape/Symbol",["require","zrender/shape/Base","zrender/shape/Polygon","zrender/tool/util","./normalIsCover"],function(e){function t(e){i.call(this,e)}var i=e("zrender/shape/Base"),n=e("zrender/shape/Polygon"),a=new n({}),o=e("zrender/tool/util");return t.prototype={type:"symbol",buildPath:function(e,t){var i=t.pointList,n=i.length;if(0!==n)for(var a,o,r,s,l,h=1e4,d=Math.ceil(n/h),m=i[0]instanceof Array,c=t.size?t.size:2,p=c,u=c/2,V=2*Math.PI,U=0;d>U;U++){e.beginPath(),a=U*h,o=a+h,o=o>n?n:o;for(var g=a;o>g;g++)if(t.random&&(r=t["randomMap"+g%20]/100,p=c*r*r,u=p/2),m?(s=i[g][0],l=i[g][1]):(s=i[g].x,l=i[g].y),3>p)e.rect(s-u,l-u,p,p);else switch(t.iconType){case"circle":e.moveTo(s,l),e.arc(s,l,u,0,V,!0);break;case"diamond":e.moveTo(s,l-u),e.lineTo(s+u/3,l-u/3),e.lineTo(s+u,l),e.lineTo(s+u/3,l+u/3),e.lineTo(s,l+u),e.lineTo(s-u/3,l+u/3),e.lineTo(s-u,l),e.lineTo(s-u/3,l-u/3),e.lineTo(s,l-u);break;default:e.rect(s-u,l-u,p,p)}if(e.closePath(),d-1>U)switch(t.brushType){case"both":e.fill(),t.lineWidth>0&&e.stroke();break;case"stroke":t.lineWidth>0&&e.stroke();break;default:e.fill()}}},getRect:function(e){return e.__rect||a.getRect(e)},isCover:e("./normalIsCover")},o.inherits(t,i),t}),define("echarts/util/ecAnimation",["require","zrender/tool/util","zrender/shape/Polygon"],function(e){function t(e,t,i,n,a){var o,r=i.style.pointList,s=r.length;if(!t){if(o=[],"vertical"!=i._orient)for(var l=r[0][1],h=0;s>h;h++)o[h]=[r[h][0],l];else for(var d=r[0][0],h=0;s>h;h++)o[h]=[d,r[h][1]];"half-smooth-polygon"==i.type&&(o[s-1]=u.clone(r[s-1]),o[s-2]=u.clone(r[s-2])),t={style:{pointList:o}}}o=t.style.pointList;var m=o.length;i.style.pointList=m==s?o:s>m?o.concat(r.slice(m)):o.slice(0,s),e.addShape(i),i._animating=!0,e.animate(i.id,"style").when(n,{pointList:r}).done(function(){i._animating=!1}).start(a)}function i(e,t){for(var i=arguments.length,n=2;i>n;n++){var a=arguments[n];e.style[a]=t.style[a]}}function n(e,t,n,a,o){var r=n.style;t||(t={position:n.position,style:{x:r.x,y:"vertical"==n._orient?r.y+r.height:r.y,width:"vertical"==n._orient?r.width:0,height:"vertical"!=n._orient?r.height:0}});var s=r.x,l=r.y,h=r.width,d=r.height,m=[n.position[0],n.position[1]];i(n,t,"x","y","width","height"),n.position=t.position,e.addShape(n),(m[0]!=t.position[0]||m[1]!=t.position[1])&&e.animate(n.id,"").when(a,{position:m}).start(o),n._animating=!0,e.animate(n.id,"style").when(a,{x:s,y:l,width:h,height:d}).done(function(){n._animating=!1}).start(o)}function a(e,t,i,n,a){if(!t){var o=i.style.y;t={style:{y:[o[0],o[0],o[0],o[0]]}}}var r=i.style.y;i.style.y=t.style.y,e.addShape(i),i._animating=!0,e.animate(i.id,"style").when(n,{y:r}).done(function(){i._animating=!1}).start(a)}function o(e,t,i,n,a){var o=i.style.x,r=i.style.y,s=i.style.r0,l=i.style.r;i._animating=!0,"r"!=i._animationAdd?(i.style.r0=0,i.style.r=0,i.rotation=[2*Math.PI,o,r],e.addShape(i),e.animate(i.id,"style").when(n,{r0:s,r:l}).done(function(){i._animating=!1}).start(a),e.animate(i.id,"").when(Math.round(n/3*2),{rotation:[0,o,r]}).start(a)):(i.style.r0=i.style.r,e.addShape(i),e.animate(i.id,"style").when(n,{r0:s}).done(function(){i._animating=!1}).start(a))}function r(e,t,n,a,o){t||(t="r"!=n._animationAdd?{style:{startAngle:n.style.startAngle,endAngle:n.style.startAngle}}:{style:{r0:n.style.r}});var r=n.style.startAngle,s=n.style.endAngle;i(n,t,"startAngle","endAngle"),e.addShape(n),n._animating=!0,e.animate(n.id,"style").when(a,{startAngle:r,endAngle:s}).done(function(){n._animating=!1}).start(o)}function s(e,t,n,a,o){t||(t={style:{x:"left"==n.style.textAlign?n.style.x+100:n.style.x-100,y:n.style.y}});var r=n.style.x,s=n.style.y;i(n,t,"x","y"),e.addShape(n),n._animating=!0,e.animate(n.id,"style").when(a,{x:r,y:s}).done(function(){n._animating=!1}).start(o)}function l(t,i,n,a,o){var r=e("zrender/shape/Polygon").prototype.getRect(n.style),s=r.x+r.width/2,l=r.y+r.height/2;n.scale=[.1,.1,s,l],t.addShape(n),n._animating=!0,t.animate(n.id,"").when(a,{scale:[1,1,s,l]}).done(function(){n._animating=!1}).start(o)}function h(e,t,n,a,o){t||(t={style:{source0:0,source1:n.style.source1>0?360:-360,target0:0,target1:n.style.target1>0?360:-360}});var r=n.style.source0,s=n.style.source1,l=n.style.target0,h=n.style.target1;t.style&&i(n,t,"source0","source1","target0","target1"),e.addShape(n),n._animating=!0,e.animate(n.id,"style").when(a,{source0:r,source1:s,target0:l,target1:h}).done(function(){n._animating=!1}).start(o)}function d(e,t,i,n,a){t||(t={style:{angle:i.style.startAngle}});var o=i.style.angle;i.style.angle=t.style.angle,e.addShape(i),i._animating=!0,e.animate(i.id,"style").when(n,{angle:o}).done(function(){i._animating=!1}).start(a)}function m(e,t,i,a,o,r){if(i.style._x=i.style.x,i.style._y=i.style.y,i.style._width=i.style.width,i.style._height=i.style.height,t)n(e,t,i,a,o);else{var s=i._x||0,l=i._y||0;i.scale=[.01,.01,s,l],e.addShape(i),i._animating=!0,e.animate(i.id,"").delay(r).when(a,{scale:[1,1,s,l]}).done(function(){i._animating=!1}).start(o||"QuinticOut")}}function c(e,t,n,a,o){t||(t={style:{xStart:n.style.xStart,yStart:n.style.yStart,xEnd:n.style.xStart,yEnd:n.style.yStart}});var r=n.style.xStart,s=n.style.xEnd,l=n.style.yStart,h=n.style.yEnd;i(n,t,"xStart","xEnd","yStart","yEnd"),e.addShape(n),n._animating=!0,e.animate(n.id,"style").when(a,{xStart:r,xEnd:s,yStart:l,yEnd:h}).done(function(){n._animating=!1}).start(o)}function p(e,t,i,n,a){i.style.smooth?t?e.addShape(i):(i.style.pointListLength=1,e.addShape(i),i._animating=!0,i.style.pointList=i.style.pointList||i.getPointList(i.style),e.animate(i.id,"style").when(n,{pointListLength:i.style.pointList.length}).done(function(){i._animating=!1}).start(a||"QuinticOut")):(i.style.pointList=t?t.style.pointList:[[i.style.xStart,i.style.yStart],[i.style.xStart,i.style.yStart]],e.addShape(i),i._animating=!0,e.animate(i.id,"style").when(n,{pointList:[[i.style.xStart,i.style.yStart],[i._x||0,i._y||0]]}).done(function(){i._animating=!1}).start(a||"QuinticOut"))}var u=e("zrender/tool/util");return{pointList:t,rectangle:n,candle:a,ring:o,sector:r,text:s,polygon:l,ribbon:h,gaugePointer:d,icon:m,line:c,markline:p}}),define("echarts/util/ecEffect",["require","../util/ecData","zrender/shape/Circle","zrender/shape/Image","../util/shape/Icon","../util/shape/Symbol","zrender/tool/env"],function(e){function t(e,t,i,n){var o,l=i.effect,d=l.color||i.style.strokeColor||i.style.color,m=l.shadowColor||d,c=l.scaleSize,p=l.bounceDistance,u="undefined"!=typeof l.shadowBlur?l.shadowBlur:c;"image"!==i.type?(o=new s({zlevel:n,style:{brushType:"stroke",iconType:"droplet"!=i.style.iconType?i.style.iconType:"circle",x:u+1,y:u+1,n:i.style.n,width:i.style._width*c,height:i.style._height*c,lineWidth:1,strokeColor:d,shadowColor:m,shadowBlur:u},draggable:!1,hoverable:!1}),"pin"==i.style.iconType&&(o.style.y+=o.style.height/2*1.5),h&&(o.style.image=e.shapeToImage(o,o.style.width+2*u+2,o.style.height+2*u+2).style.image,o=new r({zlevel:o.zlevel,style:o.style,draggable:!1,hoverable:!1}))):o=new r({zlevel:n,style:i.style,draggable:!1,hoverable:!1}),a.clone(i,o),o.position=i.position,t.push(o),e.addShape(o);var V="image"!==i.type?window.devicePixelRatio||1:1,U=(o.style.width/V-i.style._width)/2;o.style.x=i.style._x-U,o.style.y=i.style._y-U,"pin"==i.style.iconType&&(o.style.y-=i.style.height/2*1.5);var g=100*(l.period+10*Math.random());e.modShape(i.id,{invisible:!0});var y=o.style.x+o.style.width/2/V,f=o.style.y+o.style.height/2/V;"scale"===l.type?(e.modShape(o.id,{scale:[.1,.1,y,f]}),e.animate(o.id,"",l.loop).when(g,{scale:[1,1,y,f]}).done(function(){i.effect.show=!1,e.delShape(o.id)}).start()):e.animate(o.id,"style",l.loop).when(g,{y:o.style.y-p}).when(2*g,{y:o.style.y}).done(function(){i.effect.show=!1,e.delShape(o.id)}).start()}function i(e,t,i,n){var a=i.effect,o=a.color||i.style.strokeColor||i.style.color,r=a.scaleSize,s=a.shadowColor||o,h="undefined"!=typeof a.shadowBlur?a.shadowBlur:2*r,d=window.devicePixelRatio||1,m=new l({zlevel:n,position:i.position,scale:i.scale,style:{pointList:i.style.pointList,iconType:i.style.iconType,color:o,strokeColor:o,shadowColor:s,shadowBlur:h*d,random:!0,brushType:"fill",lineWidth:1,size:i.style.size},draggable:!1,hoverable:!1});t.push(m),e.addShape(m),e.modShape(i.id,{invisible:!0});for(var c=Math.round(100*a.period),p={},u={},V=0;20>V;V++)m.style["randomMap"+V]=0,p={},p["randomMap"+V]=100,u={},u["randomMap"+V]=0,m.style["randomMap"+V]=100*Math.random(),e.animate(m.id,"style",!0).when(c,p).when(2*c,u).when(3*c,p).when(4*c,p).delay(Math.random()*c*V).start()}function n(e,t,i,n){var s,l=i.effect,d=l.color||i.style.strokeColor||i.style.color,m=l.shadowColor||i.style.strokeColor||d,c=i.style.lineWidth*l.scaleSize,p="undefined"!=typeof l.shadowBlur?l.shadowBlur:c,u=new o({zlevel:n,style:{x:p,y:p,r:c,color:d,shadowColor:m,shadowBlur:p},draggable:!1,hoverable:!1});h?(u.style.image=e.shapeToImage(u,2*(c+p),2*(c+p)).style.image,u=new r({zlevel:u.zlevel,style:u.style,draggable:!1,hoverable:!1}),s=p):s=0,a.clone(i,u),u.position=i.position,t.push(u),e.addShape(u),u.style.x=i.style.xStart-s,u.style.y=i.style.yStart-s;var V=(i.style.xStart-i.style.xEnd)*(i.style.xStart-i.style.xEnd)+(i.style.yStart-i.style.yEnd)*(i.style.yStart-i.style.yEnd),U=Math.round(Math.sqrt(Math.round(V*l.period*l.period)));if(i.style.smooth){var g=i.style.pointList||i.getPointList(i.style),y=g.length;U=Math.round(U/y);for(var f=e.animate(u.id,"style",l.loop),b=Math.ceil(y/8),_=0;y-b>_;_+=b)f.when(U*(_+1),{x:g[_][0]-s,y:g[_][1]-s});f.when(U*y,{x:g[y-1][0]-s,y:g[y-1][1]-s}),f.done(function(){i.effect.show=!1,e.delShape(u.id)}),f.start("spline")}else e.animate(u.id,"style",l.loop).when(U,{x:i._x-s,y:i._y-s}).done(function(){i.effect.show=!1,e.delShape(u.id)}).start()}var a=e("../util/ecData"),o=e("zrender/shape/Circle"),r=e("zrender/shape/Image"),s=e("../util/shape/Icon"),l=e("../util/shape/Symbol"),h=e("zrender/tool/env").canvasSupported;return{point:t,largePoint:i,line:n}}),define("echarts/component/base",["require","../config","../util/ecData","../util/ecQuery","../util/number","zrender/tool/util","zrender/tool/env"],function(e){function t(e,t,a,o,r){this.ecTheme=e,this.messageCenter=t,this.zr=a,this.option=o,this.series=o.series,this.myChart=r,this.component=r.component,this.shapeList=[],this.effectList=[];var s=this;s._onlegendhoverlink=function(e){if(s.legendHoverLink)for(var t,a=e.target,o=s.shapeList.length-1;o>=0;o--)t=s.type==i.CHART_TYPE_PIE||s.type==i.CHART_TYPE_FUNNEL?n.get(s.shapeList[o],"name"):(n.get(s.shapeList[o],"series")||{}).name,t!=a||s.shapeList[o].invisible||s.shapeList[o]._animating||s.zr.addHoverShape(s.shapeList[o])},t&&t.bind(i.EVENT.LEGEND_HOVERLINK,this._onlegendhoverlink)}var i=e("../config"),n=e("../util/ecData"),a=e("../util/ecQuery"),o=e("../util/number"),r=e("zrender/tool/util");return t.prototype={canvasSupported:e("zrender/tool/env").canvasSupported,_getZ:function(e){var t=this.ecTheme[this.type];return t&&null!=t[e]?t[e]:(t=i[this.type],t&&null!=t[e]?t[e]:0)},getZlevelBase:function(){return this._getZ("zlevel")},getZBase:function(){return this._getZ("z")},reformOption:function(e){return r.merge(r.merge(e||{},r.clone(this.ecTheme[this.type]||{})),r.clone(i[this.type]||{}))},reformCssArray:function(e){if(!(e instanceof Array))return[e,e,e,e];switch(e.length+""){case"4":return e;case"3":return[e[0],e[1],e[2],e[1]];case"2":return[e[0],e[1],e[0],e[1]];case"1":return[e[0],e[0],e[0],e[0]];case"0":return[0,0,0,0]}},getShapeById:function(e){for(var t=0,i=this.shapeList.length;i>t;t++)if(this.shapeList[t].id===e)return this.shapeList[t];return null},getFont:function(e){var t=this.getTextStyle(r.clone(e));return t.fontStyle+" "+t.fontWeight+" "+t.fontSize+"px "+t.fontFamily},getTextStyle:function(e){return r.merge(r.merge(e||{},this.ecTheme.textStyle),i.textStyle)},getItemStyleColor:function(e,t,i,n){return"function"==typeof e?e.call(this.myChart,{seriesIndex:t,series:this.series[t],dataIndex:i,data:n}):e},getDataFromOption:function(e,t){return null!=e?null!=e.value?e.value:e:t},subPixelOptimize:function(e,t){return e=t%2===1?Math.floor(e)+.5:Math.round(e)},resize:function(){this.refresh&&this.refresh(),this.clearEffectShape&&this.clearEffectShape(!0);var e=this;setTimeout(function(){e.animationEffect&&e.animationEffect()},200)},clear:function(){this.clearEffectShape&&this.clearEffectShape(),this.zr&&this.zr.delShape(this.shapeList),this.shapeList=[]},dispose:function(){this.onbeforDispose&&this.onbeforDispose(),this.clear(),this.shapeList=null,this.effectList=null,this.messageCenter&&this.messageCenter.unbind(i.EVENT.LEGEND_HOVERLINK,this._onlegendhoverlink),this.onafterDispose&&this.onafterDispose()},query:a.query,deepQuery:a.deepQuery,deepMerge:a.deepMerge,parsePercent:o.parsePercent,parseCenter:o.parseCenter,parseRadius:o.parseRadius,numAddCommas:o.addCommas},t}),define("zrender/shape/Star",["require","../tool/math","./Base","../tool/util"],function(e){var t=e("../tool/math"),i=t.sin,n=t.cos,a=Math.PI,o=e("./Base"),r=function(e){o.call(this,e)};return r.prototype={type:"star",buildPath:function(e,t){var o=t.n;if(o&&!(2>o)){var r=t.x,s=t.y,l=t.r,h=t.r0;null==h&&(h=o>4?l*n(2*a/o)/n(a/o):l/3);var d=a/o,m=-a/2,c=r+l*n(m),p=s+l*i(m);m+=d;var u=t.pointList=[];u.push([c,p]);for(var V,U=0,g=2*o-1;g>U;U++)V=U%2===0?h:l,u.push([r+V*n(m),s+V*i(m)]),m+=d;u.push([c,p]),e.moveTo(u[0][0],u[0][1]);for(var U=0;U=a.x&&e<=a.x+a.width&&t>=a.y&&t<=a.y+a.height?n.isInsidePath(this._pathProxy.pathCommands,this.style.lineWidth,this.style.brushType,e,t):void 0}},e("../tool/util").inherits(a,t),a}),define("zrender/shape/Droplet",["require","./Base","./util/PathProxy","../tool/area","../tool/util"],function(e){"use strict";var t=e("./Base"),i=e("./util/PathProxy"),n=e("../tool/area"),a=function(e){t.call(this,e),this._pathProxy=new i};return a.prototype={type:"droplet",buildPath:function(e,t){var n=this._pathProxy||new i;n.begin(e),n.moveTo(t.x,t.y+t.a),n.bezierCurveTo(t.x+t.a,t.y+t.a,t.x+3*t.a/2,t.y-t.a/3,t.x,t.y-t.b),n.bezierCurveTo(t.x-3*t.a/2,t.y-t.a/3,t.x-t.a,t.y+t.a,t.x,t.y+t.a),n.closePath()},getRect:function(e){return e.__rect?e.__rect:(this._pathProxy.isEmpty()||this.buildPath(null,e),this._pathProxy.fastBoundingRect())},isCover:function(e,t){var i=this.getTansform(e,t);e=i[0],t=i[1];var a=this.getRect(this.style);return e>=a.x&&e<=a.x+a.width&&t>=a.y&&t<=a.y+a.height?n.isInsidePath(this._pathProxy.pathCommands,this.style.lineWidth,this.style.brushType,e,t):void 0}},e("../tool/util").inherits(a,t),a}),define("zrender/tool/math",[],function(){function e(e,t){return Math.sin(t?e*a:e)}function t(e,t){return Math.cos(t?e*a:e)}function i(e){return e*a}function n(e){return e/a}var a=Math.PI/180;return{sin:e,cos:t,degreeToRadian:i,radianToDegree:n}}),define("zrender/shape/util/PathProxy",["require","../../tool/vector"],function(e){var t=e("../../tool/vector"),i=function(e,t){this.command=e,this.points=t||null},n=function(){this.pathCommands=[],this._ctx=null,this._min=[],this._max=[]};return n.prototype.fastBoundingRect=function(){var e=this._min,i=this._max;e[0]=e[1]=1/0,i[0]=i[1]=-1/0;for(var n=0;nr;r+=2)e[0]=Math.min(e[0],e[0],o[r]),e[1]=Math.min(e[1],e[1],o[r+1]),i[0]=Math.max(i[0],i[0],o[r]),i[1]=Math.max(i[1],i[1],o[r+1]);break;case"Q":for(var r=0;4>r;r+=2)e[0]=Math.min(e[0],e[0],o[r]),e[1]=Math.min(e[1],e[1],o[r+1]),i[0]=Math.max(i[0],i[0],o[r]),i[1]=Math.max(i[1],i[1],o[r+1]);break;case"A":var s=o[0],l=o[1],h=o[2],d=o[3];e[0]=Math.min(e[0],e[0],s-h),e[1]=Math.min(e[1],e[1],l-d),i[0]=Math.max(i[0],i[0],s+h),i[1]=Math.max(i[1],i[1],l+d)}}return{x:e[0],y:e[1],width:i[0]-e[0],height:i[1]-e[1]}},n.prototype.begin=function(e){return this._ctx=e||null,this.pathCommands.length=0,this},n.prototype.moveTo=function(e,t){return this.pathCommands.push(new i("M",[e,t])),this._ctx&&this._ctx.moveTo(e,t),this},n.prototype.lineTo=function(e,t){return this.pathCommands.push(new i("L",[e,t])),this._ctx&&this._ctx.lineTo(e,t),this},n.prototype.bezierCurveTo=function(e,t,n,a,o,r){return this.pathCommands.push(new i("C",[e,t,n,a,o,r])),this._ctx&&this._ctx.bezierCurveTo(e,t,n,a,o,r),this},n.prototype.quadraticCurveTo=function(e,t,n,a){return this.pathCommands.push(new i("Q",[e,t,n,a])),this._ctx&&this._ctx.quadraticCurveTo(e,t,n,a),this},n.prototype.arc=function(e,t,n,a,o,r){return this.pathCommands.push(new i("A",[e,t,n,n,a,o-a,0,r?0:1])),this._ctx&&this._ctx.arc(e,t,n,a,o,r),this},n.prototype.arcTo=function(e,t,i,n,a){return this._ctx&&this._ctx.arcTo(e,t,i,n,a),this},n.prototype.rect=function(e,t,i,n){return this._ctx&&this._ctx.rect(e,t,i,n),this},n.prototype.closePath=function(){return this.pathCommands.push(new i("z")),this._ctx&&this._ctx.closePath(),this},n.prototype.isEmpty=function(){return 0===this.pathCommands.length},n.PathSegment=i,n}),define("zrender/shape/Line",["require","./Base","./util/dashedLineTo","../tool/util"],function(e){var t=e("./Base"),i=e("./util/dashedLineTo"),n=function(e){this.brushTypeOnly="stroke",this.textPosition="end",t.call(this,e)};return n.prototype={type:"line",buildPath:function(e,t){if(t.lineType&&"solid"!=t.lineType){if("dashed"==t.lineType||"dotted"==t.lineType){var n=(t.lineWidth||1)*("dashed"==t.lineType?5:1);i(e,t.xStart,t.yStart,t.xEnd,t.yEnd,n)}}else e.moveTo(t.xStart,t.yStart),e.lineTo(t.xEnd,t.yEnd)},getRect:function(e){if(e.__rect)return e.__rect;var t=e.lineWidth||1;return e.__rect={x:Math.min(e.xStart,e.xEnd)-t,y:Math.min(e.yStart,e.yEnd)-t,width:Math.abs(e.xStart-e.xEnd)+t,height:Math.abs(e.yStart-e.yEnd)+t},e.__rect}},e("../tool/util").inherits(n,t),n}),define("zrender/shape/Polyline",["require","./Base","./util/smoothSpline","./util/smoothBezier","./util/dashedLineTo","./Polygon","../tool/util"],function(e){var t=e("./Base"),i=e("./util/smoothSpline"),n=e("./util/smoothBezier"),a=e("./util/dashedLineTo"),o=function(e){this.brushTypeOnly="stroke",this.textPosition="end",t.call(this,e)};return o.prototype={type:"polyline",buildPath:function(e,t){var o=t.pointList;if(!(o.length<2)){var r=Math.min(t.pointList.length,Math.round(t.pointListLength||t.pointList.length));if(t.smooth&&"spline"!==t.smooth){var s=n(o,t.smooth,!1,t.smoothConstraint);e.moveTo(o[0][0],o[0][1]);for(var l,h,d,m=0;r-1>m;m++)l=s[2*m],h=s[2*m+1],d=o[m+1],e.bezierCurveTo(l[0],l[1],h[0],h[1],d[0],d[1])}else if("spline"===t.smooth&&(o=i(o),r=o.length),t.lineType&&"solid"!=t.lineType){if("dashed"==t.lineType||"dotted"==t.lineType){var c=(t.lineWidth||1)*("dashed"==t.lineType?5:1);e.moveTo(o[0][0],o[0][1]);for(var m=1;r>m;m++)a(e,o[m-1][0],o[m-1][1],o[m][0],o[m][1],c)}}else{e.moveTo(o[0][0],o[0][1]);for(var m=1;r>m;m++)e.lineTo(o[m][0],o[m][1])}}},getRect:function(t){return e("./Polygon").prototype.getRect(t)}},e("../tool/util").inherits(o,t),o}),define("zrender/shape/util/dashedLineTo",[],function(){var e=[5,5];return function(t,i,n,a,o,r){if(t.setLineDash)return e[0]=e[1]=r,t.setLineDash(e),t.moveTo(i,n),void t.lineTo(a,o);r="number"!=typeof r?5:r;var s=a-i,l=o-n,h=Math.floor(Math.sqrt(s*s+l*l)/r);s/=h,l/=h;for(var d=!0,m=0;h>m;++m)d?t.moveTo(i,n):t.lineTo(i,n),d=!d,i+=s,n+=l;t.lineTo(a,o)}}),define("zrender/shape/util/smoothSpline",["require","../../tool/vector"],function(e){function t(e,t,i,n,a,o,r){var s=.5*(i-e),l=.5*(n-t);return(2*(t-i)+s+l)*r+(-3*(t-i)-2*s-l)*o+s*a+t}var i=e("../../tool/vector");return function(e,n){for(var a=e.length,o=[],r=0,s=1;a>s;s++)r+=i.distance(e[s-1],e[s]);var l=r/5;l=a>l?a:l;for(var s=0;l>s;s++){var h,d,m,c=s/(l-1)*(n?a:a-1),p=Math.floor(c),u=c-p,V=e[p%a];n?(h=e[(p-1+a)%a],d=e[(p+1)%a],m=e[(p+2)%a]):(h=e[0===p?p:p-1],d=e[p>a-2?a-1:p+1],m=e[p>a-3?a-1:p+2]);var U=u*u,g=u*U;o.push([t(h[0],V[0],d[0],m[0],u,U,g),t(h[1],V[1],d[1],m[1],u,U,g)])}return o}}),define("zrender/shape/util/smoothBezier",["require","../../tool/vector"],function(e){var t=e("../../tool/vector");return function(e,i,n,a){var o,r,s,l,h=[],d=[],m=[],c=[],p=!!a;if(p){s=[1/0,1/0],l=[-1/0,-1/0];for(var u=0,V=e.length;V>u;u++)t.min(s,s,e[u]),t.max(l,l,e[u]);t.min(s,s,a[0]),t.max(l,l,a[1])}for(var u=0,V=e.length;V>u;u++){var o,r,U=e[u];if(n)o=e[u?u-1:V-1],r=e[(u+1)%V];else{if(0===u||u===V-1){h.push(e[u]);continue}o=e[u-1],r=e[u+1]}t.sub(d,r,o),t.scale(d,d,i);var g=t.distance(U,o),y=t.distance(U,r),f=g+y;0!==f&&(g/=f,y/=f),t.scale(m,d,-g),t.scale(c,d,y);var b=t.add([],U,m),_=t.add([],U,c);p&&(t.max(b,b,s),t.min(b,b,l),t.max(_,_,s),t.min(_,_,l)),h.push(b),h.push(_)}return n&&h.push(h.shift()),h}}),define("zrender/shape/Polygon",["require","./Base","./util/smoothSpline","./util/smoothBezier","./util/dashedLineTo","../tool/util"],function(e){var t=e("./Base"),i=e("./util/smoothSpline"),n=e("./util/smoothBezier"),a=e("./util/dashedLineTo"),o=function(e){t.call(this,e)};return o.prototype={type:"polygon",buildPath:function(e,t){var o=t.pointList;if(!(o.length<2)){if(t.smooth&&"spline"!==t.smooth){var r=n(o,t.smooth,!0,t.smoothConstraint);e.moveTo(o[0][0],o[0][1]);for(var s,l,h,d=o.length,m=0;d>m;m++)s=r[2*m],l=r[2*m+1],h=o[(m+1)%d],e.bezierCurveTo(s[0],s[1],l[0],l[1],h[0],h[1])}else if("spline"===t.smooth&&(o=i(o,!0)),t.lineType&&"solid"!=t.lineType){if("dashed"==t.lineType||"dotted"==t.lineType){var c=t._dashLength||(t.lineWidth||1)*("dashed"==t.lineType?5:1);t._dashLength=c,e.moveTo(o[0][0],o[0][1]);for(var m=1,p=o.length;p>m;m++)a(e,o[m-1][0],o[m-1][1],o[m][0],o[m][1],c);a(e,o[o.length-1][0],o[o.length-1][1],o[0][0],o[0][1],c)}}else{e.moveTo(o[0][0],o[0][1]);for(var m=1,p=o.length;p>m;m++)e.lineTo(o[m][0],o[m][1]);e.lineTo(o[0][0],o[0][1])}e.closePath()}},getRect:function(e){if(e.__rect)return e.__rect;for(var t=Number.MAX_VALUE,i=Number.MIN_VALUE,n=Number.MAX_VALUE,a=Number.MIN_VALUE,o=e.pointList,r=0,s=o.length;s>r;r++)o[r][0]i&&(i=o[r][0]),o[r][1]a&&(a=o[r][1]);var l;return l="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0,e.__rect={x:Math.round(t-l/2),y:Math.round(n-l/2),width:i-t+l,height:a-n+l},e.__rect}},e("../tool/util").inherits(o,t),o}),define("echarts/util/shape/normalIsCover",[],function(){return function(e,t){var i=this.getTansform(e,t);e=i[0],t=i[1];var n=this.style.__rect;return n||(n=this.style.__rect=this.getRect(this.style)),e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}}),define("echarts/util/ecQuery",["require","zrender/tool/util"],function(e){function t(e,t){if("undefined"!=typeof e){if(!t)return e;t=t.split(".");for(var i=t.length,n=0;i>n;){if(e=e[t[n]],"undefined"==typeof e)return;n++}return e}}function i(e,i){for(var n,a=0,o=e.length;o>a;a++)if(n=t(e[a],i),"undefined"!=typeof n)return n}function n(e,i){for(var n,o=e.length;o--;){var r=t(e[o],i);"undefined"!=typeof r&&("undefined"==typeof n?n=a.clone(r):a.merge(n,r,!0))}return n}var a=e("zrender/tool/util");return{query:t,deepQuery:i,deepMerge:n}}),define("echarts/util/number",[],function(){function e(e){return e.replace(/^\s+/,"").replace(/\s+$/,"")}function t(t,i){return"string"==typeof t?e(t).match(/%$/)?parseFloat(t)/100*i:parseFloat(t):t}function i(e,i){return[t(i[0],e.getWidth()),t(i[1],e.getHeight())]}function n(e,i){i instanceof Array||(i=[0,i]);var n=Math.min(e.getWidth(),e.getHeight())/2;return[t(i[0],n),t(i[1],n)]}function a(e){return isNaN(e)?"-":(e=(e+"").split("."),e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:""))}return{parsePercent:t,parseCenter:i,parseRadius:n,addCommas:a}}),define("echarts/component/dataView",["require","./base","../config","zrender/tool/util","../component"],function(e){function t(e,t,n,a,o){i.call(this,e,t,n,a,o),this.dom=o.dom,this._tDom=document.createElement("div"),this._textArea=document.createElement("textArea"),this._buttonRefresh=document.createElement("button"),this._buttonClose=document.createElement("button"),this._hasShow=!1,this._zrHeight=n.getHeight(),this._zrWidth=n.getWidth(),this._tDom.className="echarts-dataview",this.hide(),this.dom.firstChild.appendChild(this._tDom),window.addEventListener?(this._tDom.addEventListener("click",this._stop),this._tDom.addEventListener("mousewheel",this._stop),this._tDom.addEventListener("mousemove",this._stop),this._tDom.addEventListener("mousedown",this._stop),this._tDom.addEventListener("mouseup",this._stop),this._tDom.addEventListener("touchstart",this._stop),this._tDom.addEventListener("touchmove",this._stop),this._tDom.addEventListener("touchend",this._stop)):(this._tDom.attachEvent("onclick",this._stop),this._tDom.attachEvent("onmousewheel",this._stop),this._tDom.attachEvent("onmousemove",this._stop),this._tDom.attachEvent("onmousedown",this._stop),this._tDom.attachEvent("onmouseup",this._stop))}var i=e("./base"),n=e("../config"),a=e("zrender/tool/util");return t.prototype={type:n.COMPONENT_TYPE_DATAVIEW,_lang:["Data View","close","refresh"],_gCssText:"position:absolute;display:block;overflow:hidden;transition:height 0.8s,background-color 1s;-moz-transition:height 0.8s,background-color 1s;-webkit-transition:height 0.8s,background-color 1s;-o-transition:height 0.8s,background-color 1s;z-index:1;left:0;top:0;",hide:function(){this._sizeCssText="width:"+this._zrWidth+"px;height:0px;background-color:#f0ffff;",this._tDom.style.cssText=this._gCssText+this._sizeCssText},show:function(e){this._hasShow=!0;var t=this.query(this.option,"toolbox.feature.dataView.lang")||this._lang;this.option=e,this._tDom.innerHTML='

'+(t[0]||this._lang[0])+"

",this._textArea.style.cssText="display:block;margin:0 0 8px 0;padding:4px 6px;overflow:auto;width:"+(this._zrWidth-15)+"px;height:"+(this._zrHeight-100)+"px;";var i=this.query(this.option,"toolbox.feature.dataView.optionToContent");this._textArea.value="function"!=typeof i?this._optionToContent():i(this.option),this._tDom.appendChild(this._textArea),this._buttonClose.style.cssText="float:right;padding:1px 6px;",this._buttonClose.innerHTML=t[1]||this._lang[1];var n=this;this._buttonClose.onclick=function(){n.hide()},this._tDom.appendChild(this._buttonClose),this.query(this.option,"toolbox.feature.dataView.readOnly")===!1?(this._buttonRefresh.style.cssText="float:right;margin-right:10px;padding:1px 6px;",this._buttonRefresh.innerHTML=t[2]||this._lang[2],this._buttonRefresh.onclick=function(){n._save()},this._tDom.appendChild(this._buttonRefresh),this._textArea.readOnly=!1,this._textArea.style.cursor="default"):(this._textArea.readOnly=!0,this._textArea.style.cursor="text"),this._sizeCssText="width:"+this._zrWidth+"px;height:"+this._zrHeight+"px;background-color:#fff;",this._tDom.style.cssText=this._gCssText+this._sizeCssText},_optionToContent:function(){var e,t,i,a,o,r,s=[],l="";if(this.option.xAxis)for(s=this.option.xAxis instanceof Array?this.option.xAxis:[this.option.xAxis],e=0,a=s.length;a>e;e++)if("category"==(s[e].type||"category")){for(r=[],t=0,i=s[e].data.length;i>t;t++)r.push(this.getDataFromOption(s[e].data[t]));l+=r.join(", ")+"\n\n"}if(this.option.yAxis)for(s=this.option.yAxis instanceof Array?this.option.yAxis:[this.option.yAxis],e=0,a=s.length;a>e;e++)if("category"==s[e].type){for(r=[],t=0,i=s[e].data.length;i>t;t++)r.push(this.getDataFromOption(s[e].data[t]));l+=r.join(", ")+"\n\n"}var h,d=this.option.series;for(e=0,a=d.length;a>e;e++){for(r=[],t=0,i=d[e].data.length;i>t;t++)o=d[e].data[t],h=d[e].type==n.CHART_TYPE_PIE||d[e].type==n.CHART_TYPE_MAP?(o.name||"-")+":":"",d[e].type==n.CHART_TYPE_SCATTER&&(o=this.getDataFromOption(o).join(", ")),r.push(h+this.getDataFromOption(o));l+=(d[e].name||"-")+" : \n",l+=r.join(d[e].type==n.CHART_TYPE_SCATTER?"\n":", "),l+="\n\n"}return l},_save:function(){var e=this._textArea.value,t=this.query(this.option,"toolbox.feature.dataView.contentToOption");if("function"!=typeof t){e=e.split("\n");for(var i=[],a=0,o=e.length;o>a;a++)e[a]=this._trim(e[a]),""!==e[a]&&i.push(e[a]);this._contentToOption(i)}else t(e,this.option);this.hide();var r=this;setTimeout(function(){r.messageCenter&&r.messageCenter.dispatch(n.EVENT.DATA_VIEW_CHANGED,null,{option:r.option},r.myChart)},r.canvasSupported?800:100)},_contentToOption:function(e){var t,i,a,o,r,s,l,h=[],d=0;if(this.option.xAxis)for(h=this.option.xAxis instanceof Array?this.option.xAxis:[this.option.xAxis],t=0,o=h.length;o>t;t++)if("category"==(h[t].type||"category")){for(s=e[d].split(","),i=0,a=h[t].data.length;a>i;i++)l=this._trim(s[i]||""),r=h[t].data[i],"undefined"!=typeof h[t].data[i].value?h[t].data[i].value=l:h[t].data[i]=l;d++}if(this.option.yAxis)for(h=this.option.yAxis instanceof Array?this.option.yAxis:[this.option.yAxis],t=0,o=h.length;o>t;t++)if("category"==h[t].type){for(s=e[d].split(","),i=0,a=h[t].data.length;a>i;i++)l=this._trim(s[i]||""),r=h[t].data[i],"undefined"!=typeof h[t].data[i].value?h[t].data[i].value=l:h[t].data[i]=l;d++}var m=this.option.series;for(t=0,o=m.length;o>t;t++)if(d++,m[t].type==n.CHART_TYPE_SCATTER)for(var i=0,a=m[t].data.length;a>i;i++)s=e[d],l=s.replace(" ","").split(","),"undefined"!=typeof m[t].data[i].value?m[t].data[i].value=l:m[t].data[i]=l,d++;else{s=e[d].split(",");for(var i=0,a=m[t].data.length;a>i;i++)l=(s[i]||"").replace(/.*:/,""),l=this._trim(l),l="-"!=l&&""!==l?l-0:"-","undefined"!=typeof m[t].data[i].value?m[t].data[i].value=l:m[t].data[i]=l;d++}},_trim:function(e){var t=new RegExp("(^[\\s\\t\\xa0\\u3000]+)|([\\u3000\\xa0\\s\\t]+$)","g");return e.replace(t,"")},_stop:function(e){e=e||window.event,e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},resize:function(){this._zrHeight=this.zr.getHeight(),this._zrWidth=this.zr.getWidth(),this._tDom.offsetHeight>10&&(this._sizeCssText="width:"+this._zrWidth+"px;height:"+this._zrHeight+"px;background-color:#fff;",this._tDom.style.cssText=this._gCssText+this._sizeCssText,this._textArea.style.cssText="display:block;margin:0 0 8px 0;padding:4px 6px;overflow:auto;width:"+(this._zrWidth-15)+"px;height:"+(this._zrHeight-100)+"px;") +},dispose:function(){window.removeEventListener?(this._tDom.removeEventListener("click",this._stop),this._tDom.removeEventListener("mousewheel",this._stop),this._tDom.removeEventListener("mousemove",this._stop),this._tDom.removeEventListener("mousedown",this._stop),this._tDom.removeEventListener("mouseup",this._stop),this._tDom.removeEventListener("touchstart",this._stop),this._tDom.removeEventListener("touchmove",this._stop),this._tDom.removeEventListener("touchend",this._stop)):(this._tDom.detachEvent("onclick",this._stop),this._tDom.detachEvent("onmousewheel",this._stop),this._tDom.detachEvent("onmousemove",this._stop),this._tDom.detachEvent("onmousedown",this._stop),this._tDom.detachEvent("onmouseup",this._stop)),this._buttonRefresh.onclick=null,this._buttonClose.onclick=null,this._hasShow&&(this._tDom.removeChild(this._textArea),this._tDom.removeChild(this._buttonRefresh),this._tDom.removeChild(this._buttonClose)),this._textArea=null,this._buttonRefresh=null,this._buttonClose=null,this.dom.firstChild.removeChild(this._tDom),this._tDom=null}},a.inherits(t,i),e("../component").define("dataView",t),t}),define("echarts/util/shape/Cross",["require","zrender/shape/Base","zrender/shape/Line","zrender/tool/util","./normalIsCover"],function(e){function t(e){i.call(this,e)}var i=e("zrender/shape/Base"),n=e("zrender/shape/Line"),a=e("zrender/tool/util");return t.prototype={type:"cross",buildPath:function(e,t){var i=t.rect;t.xStart=i.x,t.xEnd=i.x+i.width,t.yStart=t.yEnd=t.y,n.prototype.buildPath(e,t),t.xStart=t.xEnd=t.x,t.yStart=i.y,t.yEnd=i.y+i.height,n.prototype.buildPath(e,t)},getRect:function(e){return e.rect},isCover:e("./normalIsCover")},a.inherits(t,i),t}),define("zrender/shape/Sector",["require","../tool/math","../tool/computeBoundingBox","../tool/vector","./Base","../tool/util"],function(e){var t=e("../tool/math"),i=e("../tool/computeBoundingBox"),n=e("../tool/vector"),a=e("./Base"),o=n.create(),r=n.create(),s=n.create(),l=n.create(),h=function(e){a.call(this,e)};return h.prototype={type:"sector",buildPath:function(e,i){var n=i.x,a=i.y,o=i.r0||0,r=i.r,s=i.startAngle,l=i.endAngle,h=i.clockWise||!1;s=t.degreeToRadian(s),l=t.degreeToRadian(l),h||(s=-s,l=-l);var d=t.cos(s),m=t.sin(s);e.moveTo(d*o+n,m*o+a),e.lineTo(d*r+n,m*r+a),e.arc(n,a,r,s,l,!h),e.lineTo(t.cos(l)*o+n,t.sin(l)*o+a),0!==o&&e.arc(n,a,o,l,s,h),e.closePath()},getRect:function(e){if(e.__rect)return e.__rect;var a=e.x,h=e.y,d=e.r0||0,m=e.r,c=t.degreeToRadian(e.startAngle),p=t.degreeToRadian(e.endAngle),u=e.clockWise;return u||(c=-c,p=-p),d>1?i.arc(a,h,d,c,p,!u,o,s):(o[0]=s[0]=a,o[1]=s[1]=h),i.arc(a,h,m,c,p,!u,r,l),n.min(o,o,r),n.max(s,s,l),e.__rect={x:o[0],y:o[1],width:s[0]-o[0],height:s[1]-o[1]},e.__rect}},e("../tool/util").inherits(h,a),h}),define("echarts/util/shape/Candle",["require","zrender/shape/Base","zrender/tool/util","./normalIsCover"],function(e){function t(e){i.call(this,e)}var i=e("zrender/shape/Base"),n=e("zrender/tool/util");return t.prototype={type:"candle",_numberOrder:function(e,t){return t-e},buildPath:function(e,t){var i=n.clone(t.y).sort(this._numberOrder);e.moveTo(t.x,i[3]),e.lineTo(t.x,i[2]),e.moveTo(t.x-t.width/2,i[2]),e.rect(t.x-t.width/2,i[2],t.width,i[1]-i[2]),e.moveTo(t.x,i[1]),e.lineTo(t.x,i[0])},getRect:function(e){if(!e.__rect){var t=0;("stroke"==e.brushType||"fill"==e.brushType)&&(t=e.lineWidth||1);var i=n.clone(e.y).sort(this._numberOrder);e.__rect={x:Math.round(e.x-e.width/2-t/2),y:Math.round(i[3]-t/2),width:e.width+t,height:i[0]-i[3]+t}}return e.__rect},isCover:e("./normalIsCover")},n.inherits(t,i),t}),define("zrender/tool/computeBoundingBox",["require","./vector","./curve"],function(e){function t(e,t,i){if(0!==e.length){for(var n=e[0][0],a=e[0][0],o=e[0][1],r=e[0][1],s=1;sa&&(a=l[0]),l[1]r&&(r=l[1])}t[0]=n,t[1]=o,i[0]=a,i[1]=r}}function i(e,t,i,n,a,r){var s=[];o.cubicExtrema(e[0],t[0],i[0],n[0],s);for(var l=0;l=2*Math.PI)return d[0]=e-i,d[1]=t-i,m[0]=e+i,void(m[1]=t+i);if(r[0]=Math.cos(n)*i+e,r[1]=Math.sin(n)*i+t,s[0]=Math.cos(o)*i+e,s[1]=Math.sin(o)*i+t,a.min(d,r,s),a.max(m,r,s),n%=2*Math.PI,0>n&&(n+=2*Math.PI),o%=2*Math.PI,0>o&&(o+=2*Math.PI),n>o&&!h?o+=2*Math.PI:o>n&&h&&(n+=2*Math.PI),h){var c=o;o=n,n=c}for(var p=0;o>p;p+=Math.PI/2)p>n&&(l[0]=Math.cos(p)*i+e,l[1]=Math.sin(p)*i+t,a.min(d,l,d),a.max(m,l,m))};return t.cubeBezier=i,t.quadraticBezier=n,t.arc=h,t}),define("echarts/util/shape/Chain",["require","zrender/shape/Base","./Icon","zrender/shape/util/dashedLineTo","zrender/tool/util","zrender/tool/matrix"],function(e){function t(e){i.call(this,e)}var i=e("zrender/shape/Base"),n=e("./Icon"),a=e("zrender/shape/util/dashedLineTo"),o=e("zrender/tool/util"),r=e("zrender/tool/matrix");return t.prototype={type:"chain",brush:function(e,t){var i=this.style;t&&(i=this.getHighlightStyle(i,this.highlightStyle||{})),e.save(),this.setContext(e,i),this.setTransform(e),e.save(),e.beginPath(),this.buildLinePath(e,i),e.stroke(),e.restore(),this.brushSymbol(e,i),e.restore()},buildLinePath:function(e,t){var i=t.x,n=t.y+5,o=t.width,r=t.height/2-10;if(e.moveTo(i,n),e.lineTo(i,n+r),e.moveTo(i+o,n),e.lineTo(i+o,n+r),e.moveTo(i,n+r/2),t.lineType&&"solid"!=t.lineType){if("dashed"==t.lineType||"dotted"==t.lineType){var s=(t.lineWidth||1)*("dashed"==t.lineType?5:1);a(e,i,n+r/2,i+o,n+r/2,s)}}else e.lineTo(i+o,n+r/2)},brushSymbol:function(e,t){var i=t.y+t.height/4;e.save();for(var a,o=t.chainPoint,r=0,s=o.length;s>r;r++){if(a=o[r],"none"!=a.symbol){e.beginPath();var l=a.symbolSize;n.prototype.buildPath(e,{iconType:a.symbol,x:a.x-l,y:i-l,width:2*l,height:2*l,n:a.n}),e.fillStyle=a.isEmpty?"#fff":t.strokeColor,e.closePath(),e.fill(),e.stroke()}a.showLabel&&(e.font=a.textFont,e.fillStyle=a.textColor,e.textAlign=a.textAlign,e.textBaseline=a.textBaseline,a.rotation?(e.save(),this._updateTextTransform(e,a.rotation),e.fillText(a.name,a.textX,a.textY),e.restore()):e.fillText(a.name,a.textX,a.textY))}e.restore()},_updateTextTransform:function(e,t){var i=r.create();if(r.identity(i),0!==t[0]){var n=t[1]||0,a=t[2]||0;(n||a)&&r.translate(i,i,[-n,-a]),r.rotate(i,i,t[0]),(n||a)&&r.translate(i,i,[n,a])}e.transform.apply(e,i)},isCover:function(e,t){var i=this.style;return e>=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height?!0:!1}},o.inherits(t,i),t}),define("zrender/shape/Ring",["require","./Base","../tool/util"],function(e){var t=e("./Base"),i=function(e){t.call(this,e)};return i.prototype={type:"ring",buildPath:function(e,t){e.arc(t.x,t.y,t.r,0,2*Math.PI,!1),e.moveTo(t.x+t.r0,t.y),e.arc(t.x,t.y,t.r0,0,2*Math.PI,!0)},getRect:function(e){if(e.__rect)return e.__rect;var t;return t="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0,e.__rect={x:Math.round(e.x-e.r-t/2),y:Math.round(e.y-e.r-t/2),width:2*e.r+t,height:2*e.r+t},e.__rect}},e("../tool/util").inherits(i,t),i}),define("echarts/component/axis",["require","./base","zrender/shape/Line","../config","../util/ecData","zrender/tool/util","zrender/tool/color","./categoryAxis","./valueAxis","../component"],function(e){function t(e,t,n,a,o,r){i.call(this,e,t,n,a,o),this.axisType=r,this._axisList=[],this.refresh(a)}var i=e("./base"),n=e("zrender/shape/Line"),a=e("../config"),o=e("../util/ecData"),r=e("zrender/tool/util"),s=e("zrender/tool/color");return t.prototype={type:a.COMPONENT_TYPE_AXIS,axisBase:{_buildAxisLine:function(){var e=this.option.axisLine.lineStyle.width,t=e/2,i={_axisShape:"axisLine",zlevel:this.getZlevelBase(),z:this.getZBase()+3,hoverable:!1},a=this.grid;switch(this.option.position){case"left":i.style={xStart:a.getX()-t,yStart:a.getYend(),xEnd:a.getX()-t,yEnd:a.getY(),lineCap:"round"};break;case"right":i.style={xStart:a.getXend()+t,yStart:a.getYend(),xEnd:a.getXend()+t,yEnd:a.getY(),lineCap:"round"};break;case"bottom":i.style={xStart:a.getX(),yStart:a.getYend()+t,xEnd:a.getXend(),yEnd:a.getYend()+t,lineCap:"round"};break;case"top":i.style={xStart:a.getX(),yStart:a.getY()-t,xEnd:a.getXend(),yEnd:a.getY()-t,lineCap:"round"}}var o=i.style;""!==this.option.name&&(o.text=this.option.name,o.textPosition=this.option.nameLocation,o.textFont=this.getFont(this.option.nameTextStyle),this.option.nameTextStyle.align&&(o.textAlign=this.option.nameTextStyle.align),this.option.nameTextStyle.baseline&&(o.textBaseline=this.option.nameTextStyle.baseline),this.option.nameTextStyle.color&&(o.textColor=this.option.nameTextStyle.color)),o.strokeColor=this.option.axisLine.lineStyle.color,o.lineWidth=e,this.isHorizontal()?o.yStart=o.yEnd=this.subPixelOptimize(o.yEnd,e):o.xStart=o.xEnd=this.subPixelOptimize(o.xEnd,e),o.lineType=this.option.axisLine.lineStyle.type,i=new n(i),this.shapeList.push(i)},_axisLabelClickable:function(e,t){return e?(o.pack(t,void 0,-1,void 0,-1,t.style.text),t.hoverable=!0,t.clickable=!0,t.highlightStyle={color:s.lift(t.style.color,1),brushType:"fill"},t):t},refixAxisShape:function(e,t){if(this.option.axisLine.onZero){var i;if(this.isHorizontal()&&null!=t)for(var n=0,a=this.shapeList.length;a>n;n++)"axisLine"===this.shapeList[n]._axisShape?(this.shapeList[n].style.yStart=this.shapeList[n].style.yEnd=this.subPixelOptimize(t,this.shapeList[n].stylelineWidth),this.zr.modShape(this.shapeList[n].id)):"axisTick"===this.shapeList[n]._axisShape&&(i=this.shapeList[n].style.yEnd-this.shapeList[n].style.yStart,this.shapeList[n].style.yStart=t-i,this.shapeList[n].style.yEnd=t,this.zr.modShape(this.shapeList[n].id));if(!this.isHorizontal()&&null!=e)for(var n=0,a=this.shapeList.length;a>n;n++)"axisLine"===this.shapeList[n]._axisShape?(this.shapeList[n].style.xStart=this.shapeList[n].style.xEnd=this.subPixelOptimize(e,this.shapeList[n].stylelineWidth),this.zr.modShape(this.shapeList[n].id)):"axisTick"===this.shapeList[n]._axisShape&&(i=this.shapeList[n].style.xEnd-this.shapeList[n].style.xStart,this.shapeList[n].style.xStart=e,this.shapeList[n].style.xEnd=e+i,this.zr.modShape(this.shapeList[n].id))}},getPosition:function(){return this.option.position},isHorizontal:function(){return"bottom"===this.option.position||"top"===this.option.position}},reformOption:function(e){if(!e||e instanceof Array&&0===e.length?e=[{type:a.COMPONENT_TYPE_AXIS_VALUE}]:e instanceof Array||(e=[e]),e.length>2&&(e=[e[0],e[1]]),"xAxis"===this.axisType){(!e[0].position||"bottom"!=e[0].position&&"top"!=e[0].position)&&(e[0].position="bottom"),e.length>1&&(e[1].position="bottom"===e[0].position?"top":"bottom");for(var t=0,i=e.length;i>t;t++)e[t].type=e[t].type||"category",e[t].xAxisIndex=t,e[t].yAxisIndex=-1}else{(!e[0].position||"left"!=e[0].position&&"right"!=e[0].position)&&(e[0].position="left"),e.length>1&&(e[1].position="left"===e[0].position?"right":"left");for(var t=0,i=e.length;i>t;t++)e[t].type=e[t].type||"value",e[t].xAxisIndex=-1,e[t].yAxisIndex=t}return e},refresh:function(t){var i;t&&(this.option=t,"xAxis"===this.axisType?(this.option.xAxis=this.reformOption(t.xAxis),i=this.option.xAxis):(this.option.yAxis=this.reformOption(t.yAxis),i=this.option.yAxis),this.series=t.series);for(var n=e("./categoryAxis"),a=e("./valueAxis"),o=Math.max(i&&i.length||0,this._axisList.length),r=0;o>r;r++)!this._axisList[r]||!t||i[r]&&this._axisList[r].type==i[r].type||(this._axisList[r].dispose&&this._axisList[r].dispose(),this._axisList[r]=!1),this._axisList[r]?this._axisList[r].refresh&&this._axisList[r].refresh(i?i[r]:!1,this.series):i&&i[r]&&(this._axisList[r]="category"===i[r].type?new n(this.ecTheme,this.messageCenter,this.zr,i[r],this.myChart,this.axisBase):new a(this.ecTheme,this.messageCenter,this.zr,i[r],this.myChart,this.axisBase,this.series))},getAxis:function(e){return this._axisList[e]},clear:function(){for(var e=0,t=this._axisList.length;t>e;e++)this._axisList[e].dispose&&this._axisList[e].dispose();this._axisList=[]}},r.inherits(t,i),e("../component").define("axis",t),t}),define("echarts/component/grid",["require","./base","zrender/shape/Rectangle","../config","zrender/tool/util","../component"],function(e){function t(e,t,n,a,o){i.call(this,e,t,n,a,o),this.refresh(a)}var i=e("./base"),n=e("zrender/shape/Rectangle"),a=e("../config");a.grid={zlevel:0,z:0,x:80,y:60,x2:80,y2:60,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"};var o=e("zrender/tool/util");return t.prototype={type:a.COMPONENT_TYPE_GRID,getX:function(){return this._x},getY:function(){return this._y},getWidth:function(){return this._width},getHeight:function(){return this._height},getXend:function(){return this._x+this._width},getYend:function(){return this._y+this._height},getArea:function(){return{x:this._x,y:this._y,width:this._width,height:this._height}},getBbox:function(){return[[this._x,this._y],[this.getXend(),this.getYend()]]},refixAxisShape:function(e){for(var t,i,n,o=e.xAxis._axisList.concat(e.yAxis?e.yAxis._axisList:[]),r=o.length;r--;)n=o[r],n.type==a.COMPONENT_TYPE_AXIS_VALUE&&n._min<0&&n._max>=0&&(n.isHorizontal()?t=n.getCoord(0):i=n.getCoord(0));if("undefined"!=typeof t||"undefined"!=typeof i)for(r=o.length;r--;)o[r].refixAxisShape(t,i)},refresh:function(e){if(e||this._zrWidth!=this.zr.getWidth()||this._zrHeight!=this.zr.getHeight()){this.clear(),this.option=e||this.option,this.option.grid=this.reformOption(this.option.grid);var t=this.option.grid;this._zrWidth=this.zr.getWidth(),this._zrHeight=this.zr.getHeight(),this._x=this.parsePercent(t.x,this._zrWidth),this._y=this.parsePercent(t.y,this._zrHeight);var i=this.parsePercent(t.x2,this._zrWidth),a=this.parsePercent(t.y2,this._zrHeight);this._width="undefined"==typeof t.width?this._zrWidth-this._x-i:this.parsePercent(t.width,this._zrWidth),this._width=this._width<=0?10:this._width,this._height="undefined"==typeof t.height?this._zrHeight-this._y-a:this.parsePercent(t.height,this._zrHeight),this._height=this._height<=0?10:this._height,this._x=this.subPixelOptimize(this._x,t.borderWidth),this._y=this.subPixelOptimize(this._y,t.borderWidth),this.shapeList.push(new n({zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this._x,y:this._y,width:this._width,height:this._height,brushType:t.borderWidth>0?"both":"fill",color:t.backgroundColor,strokeColor:t.borderColor,lineWidth:t.borderWidth}})),this.zr.addShape(this.shapeList[0])}}},o.inherits(t,i),e("../component").define("grid",t),t}),define("echarts/component/dataZoom",["require","./base","zrender/shape/Rectangle","zrender/shape/Polygon","../util/shape/Icon","../config","../util/date","zrender/tool/util","../component"],function(e){function t(e,t,n,a,o){i.call(this,e,t,n,a,o);var r=this;r._ondrift=function(e,t){return r.__ondrift(this,e,t)},r._ondragend=function(){return r.__ondragend()},this._fillerSize=30,this._isSilence=!1,this._zoom={},this.option.dataZoom=this.reformOption(this.option.dataZoom),this.zoomOption=this.option.dataZoom,this._handleSize=this.zoomOption.handleSize,this.myChart.canvasSupported||(this.zoomOption.realtime=!1),this._location=this._getLocation(),this._zoom=this._getZoom(),this._backupData(),this.option.dataZoom.show&&this._buildShape(),this._syncData()}var i=e("./base"),n=e("zrender/shape/Rectangle"),a=e("zrender/shape/Polygon"),o=e("../util/shape/Icon"),r=e("../config");r.dataZoom={zlevel:0,z:4,show:!1,orient:"horizontal",backgroundColor:"rgba(0,0,0,0)",dataBackgroundColor:"#eee",fillerColor:"rgba(144,197,237,0.2)",handleColor:"rgba(70,130,180,0.8)",handleSize:8,showDetail:!0,realtime:!0};var s=e("../util/date"),l=e("zrender/tool/util");return t.prototype={type:r.COMPONENT_TYPE_DATAZOOM,_buildShape:function(){this._buildBackground(),this._buildFiller(),this._buildHandle(),this._buildFrame();for(var e=0,t=this.shapeList.length;t>e;e++)this.zr.addShape(this.shapeList[e]);this._syncFrameShape()},_getLocation:function(){var e,t,i,n,a=this.component.grid;return"horizontal"==this.zoomOption.orient?(i=this.zoomOption.width||a.getWidth(),n=this.zoomOption.height||this._fillerSize,e=null!=this.zoomOption.x?this.zoomOption.x:a.getX(),t=null!=this.zoomOption.y?this.zoomOption.y:this.zr.getHeight()-n-2):(i=this.zoomOption.width||this._fillerSize,n=this.zoomOption.height||a.getHeight(),e=null!=this.zoomOption.x?this.zoomOption.x:2,t=null!=this.zoomOption.y?this.zoomOption.y:a.getY()),{x:e,y:t,width:i,height:n}},_getZoom:function(){var e=this.option.series,t=this.option.xAxis;!t||t instanceof Array||(t=[t],this.option.xAxis=t);var i=this.option.yAxis;!i||i instanceof Array||(i=[i],this.option.yAxis=i);var n,a,o=[],s=this.zoomOption.xAxisIndex;if(t&&null==s){n=[];for(var l=0,h=t.length;h>l;l++)("category"==t[l].type||null==t[l].type)&&n.push(l)}else n=s instanceof Array?s:null!=s?[s]:[];if(s=this.zoomOption.yAxisIndex,i&&null==s){a=[];for(var l=0,h=i.length;h>l;l++)"category"==i[l].type&&a.push(l)}else a=s instanceof Array?s:null!=s?[s]:[];for(var d,l=0,h=e.length;h>l;l++)if(d=e[l],d.type==r.CHART_TYPE_LINE||d.type==r.CHART_TYPE_BAR||d.type==r.CHART_TYPE_SCATTER||d.type==r.CHART_TYPE_K){for(var m=0,c=n.length;c>m;m++)if(n[m]==(d.xAxisIndex||0)){o.push(l);break}for(var m=0,c=a.length;c>m;m++)if(a[m]==(d.yAxisIndex||0)){o.push(l);break}null==this.zoomOption.xAxisIndex&&null==this.zoomOption.yAxisIndex&&d.data&&this.getDataFromOption(d.data[0])instanceof Array&&(d.type==r.CHART_TYPE_SCATTER||d.type==r.CHART_TYPE_LINE||d.type==r.CHART_TYPE_BAR)&&o.push(l)}var p=null!=this._zoom.start?this._zoom.start:null!=this.zoomOption.start?this.zoomOption.start:0,u=null!=this._zoom.end?this._zoom.end:null!=this.zoomOption.end?this.zoomOption.end:100;p>u&&(p+=u,u=p-u,p-=u);var V=Math.round((u-p)/100*("horizontal"==this.zoomOption.orient?this._location.width:this._location.height));return{start:p,end:u,start2:0,end2:100,size:V,xAxisIndex:n,yAxisIndex:a,seriesIndex:o,scatterMap:this._zoom.scatterMap||{}}},_backupData:function(){this._originalData={xAxis:{},yAxis:{},series:{}};for(var e=this.option.xAxis,t=this._zoom.xAxisIndex,i=0,n=t.length;n>i;i++)this._originalData.xAxis[t[i]]=e[t[i]].data;for(var a=this.option.yAxis,o=this._zoom.yAxisIndex,i=0,n=o.length;n>i;i++)this._originalData.yAxis[o[i]]=a[o[i]].data;for(var s,l=this.option.series,h=this._zoom.seriesIndex,i=0,n=h.length;n>i;i++)s=l[h[i]],this._originalData.series[h[i]]=s.data,s.data&&this.getDataFromOption(s.data[0])instanceof Array&&(s.type==r.CHART_TYPE_SCATTER||s.type==r.CHART_TYPE_LINE||s.type==r.CHART_TYPE_BAR)&&(this._backupScale(),this._calculScatterMap(h[i]))},_calculScatterMap:function(t){this._zoom.scatterMap=this._zoom.scatterMap||{},this._zoom.scatterMap[t]=this._zoom.scatterMap[t]||{};var i=e("../component"),n=i.get("axis"),a=l.clone(this.option.xAxis);"category"==a[0].type&&(a[0].type="value"),a[1]&&"category"==a[1].type&&(a[1].type="value");var o=new n(this.ecTheme,null,!1,{xAxis:a,series:this.option.series},this,"xAxis"),r=this.option.series[t].xAxisIndex||0;this._zoom.scatterMap[t].x=o.getAxis(r).getExtremum(),o.dispose(),a=l.clone(this.option.yAxis),"category"==a[0].type&&(a[0].type="value"),a[1]&&"category"==a[1].type&&(a[1].type="value"),o=new n(this.ecTheme,null,!1,{yAxis:a,series:this.option.series},this,"yAxis"),r=this.option.series[t].yAxisIndex||0,this._zoom.scatterMap[t].y=o.getAxis(r).getExtremum(),o.dispose()},_buildBackground:function(){var e=this._location.width,t=this._location.height;this.shapeList.push(new n({zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this._location.x,y:this._location.y,width:e,height:t,color:this.zoomOption.backgroundColor}}));for(var i=0,o=this._originalData.xAxis,s=this._zoom.xAxisIndex,l=0,h=s.length;h>l;l++)i=Math.max(i,o[s[l]].length);for(var d=this._originalData.yAxis,m=this._zoom.yAxisIndex,l=0,h=m.length;h>l;l++)i=Math.max(i,d[m[l]].length);for(var c,p=this._zoom.seriesIndex[0],u=this._originalData.series[p],V=Number.MIN_VALUE,U=Number.MAX_VALUE,l=0,h=u.length;h>l;l++)c=this.getDataFromOption(u[l],0),this.option.series[p].type==r.CHART_TYPE_K&&(c=c[1]),isNaN(c)&&(c=0),V=Math.max(V,c),U=Math.min(U,c);var g=V-U,y=[],f=e/(i-(i>1?1:0)),b=t/(i-(i>1?1:0)),_=1;"horizontal"==this.zoomOption.orient&&1>f?_=Math.floor(3*i/e):"vertical"==this.zoomOption.orient&&1>b&&(_=Math.floor(3*i/t));for(var l=0,h=i;h>l;l+=_)c=this.getDataFromOption(u[l],0),this.option.series[p].type==r.CHART_TYPE_K&&(c=c[1]),isNaN(c)&&(c=0),y.push("horizontal"==this.zoomOption.orient?[this._location.x+f*l,this._location.y+t-1-Math.round((c-U)/g*(t-10))]:[this._location.x+1+Math.round((c-U)/g*(e-10)),this._location.y+b*(h-l-1)]);"horizontal"==this.zoomOption.orient?(y.push([this._location.x+e,this._location.y+t]),y.push([this._location.x,this._location.y+t])):(y.push([this._location.x,this._location.y]),y.push([this._location.x,this._location.y+t])),this.shapeList.push(new a({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{pointList:y,color:this.zoomOption.dataBackgroundColor},hoverable:!1}))},_buildFiller:function(){this._fillerShae={zlevel:this.getZlevelBase(),z:this.getZBase(),draggable:!0,ondrift:this._ondrift,ondragend:this._ondragend,_type:"filler"},this._fillerShae.style="horizontal"==this.zoomOption.orient?{x:this._location.x+Math.round(this._zoom.start/100*this._location.width)+this._handleSize,y:this._location.y,width:this._zoom.size-2*this._handleSize,height:this._location.height,color:this.zoomOption.fillerColor,text:":::",textPosition:"inside"}:{x:this._location.x,y:this._location.y+Math.round(this._zoom.start/100*this._location.height)+this._handleSize,width:this._location.width,height:this._zoom.size-2*this._handleSize,color:this.zoomOption.fillerColor,text:"::",textPosition:"inside"},this._fillerShae.highlightStyle={brushType:"fill",color:"rgba(0,0,0,0)"},this._fillerShae=new n(this._fillerShae),this.shapeList.push(this._fillerShae)},_buildHandle:function(){var e=this.zoomOption.showDetail?this._getDetail():{start:"",end:""};this._startShape={zlevel:this.getZlevelBase(),z:this.getZBase(),draggable:!0,style:{iconType:"rectangle",x:this._location.x,y:this._location.y,width:this._handleSize,height:this._handleSize,color:this.zoomOption.handleColor,text:"=",textPosition:"inside"},highlightStyle:{text:e.start,brushType:"fill",textPosition:"left"},ondrift:this._ondrift,ondragend:this._ondragend},"horizontal"==this.zoomOption.orient?(this._startShape.style.height=this._location.height,this._endShape=l.clone(this._startShape),this._startShape.style.x=this._fillerShae.style.x-this._handleSize,this._endShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._endShape.highlightStyle.text=e.end,this._endShape.highlightStyle.textPosition="right"):(this._startShape.style.width=this._location.width,this._endShape=l.clone(this._startShape),this._startShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._startShape.highlightStyle.textPosition="bottom",this._endShape.style.y=this._fillerShae.style.y-this._handleSize,this._endShape.highlightStyle.text=e.end,this._endShape.highlightStyle.textPosition="top"),this._startShape=new o(this._startShape),this._endShape=new o(this._endShape),this.shapeList.push(this._startShape),this.shapeList.push(this._endShape)},_buildFrame:function(){var e=this.subPixelOptimize(this._location.x,1),t=this.subPixelOptimize(this._location.y,1);this._startFrameShape={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:e,y:t,width:this._location.width-(e>this._location.x?1:0),height:this._location.height-(t>this._location.y?1:0),lineWidth:1,brushType:"stroke",strokeColor:this.zoomOption.handleColor}},this._endFrameShape=l.clone(this._startFrameShape),this._startFrameShape=new n(this._startFrameShape),this._endFrameShape=new n(this._endFrameShape),this.shapeList.push(this._startFrameShape),this.shapeList.push(this._endFrameShape)},_syncHandleShape:function(){"horizontal"==this.zoomOption.orient?(this._startShape.style.x=this._fillerShae.style.x-this._handleSize,this._endShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._zoom.start=(this._startShape.style.x-this._location.x)/this._location.width*100,this._zoom.end=(this._endShape.style.x+this._handleSize-this._location.x)/this._location.width*100):(this._startShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._endShape.style.y=this._fillerShae.style.y-this._handleSize,this._zoom.start=(this._location.y+this._location.height-this._startShape.style.y)/this._location.height*100,this._zoom.end=(this._location.y+this._location.height-this._endShape.style.y-this._handleSize)/this._location.height*100),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this._syncFrameShape(),this.zr.refreshNextFrame()},_syncFillerShape:function(){var e,t;"horizontal"==this.zoomOption.orient?(e=this._startShape.style.x,t=this._endShape.style.x,this._fillerShae.style.x=Math.min(e,t)+this._handleSize,this._fillerShae.style.width=Math.abs(e-t)-this._handleSize,this._zoom.start=(Math.min(e,t)-this._location.x)/this._location.width*100,this._zoom.end=(Math.max(e,t)+this._handleSize-this._location.x)/this._location.width*100):(e=this._startShape.style.y,t=this._endShape.style.y,this._fillerShae.style.y=Math.min(e,t)+this._handleSize,this._fillerShae.style.height=Math.abs(e-t)-this._handleSize,this._zoom.start=(this._location.y+this._location.height-Math.max(e,t))/this._location.height*100,this._zoom.end=(this._location.y+this._location.height-Math.min(e,t)-this._handleSize)/this._location.height*100),this.zr.modShape(this._fillerShae.id),this._syncFrameShape(),this.zr.refreshNextFrame()},_syncFrameShape:function(){"horizontal"==this.zoomOption.orient?(this._startFrameShape.style.width=this._fillerShae.style.x-this._location.x,this._endFrameShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._endFrameShape.style.width=this._location.x+this._location.width-this._endFrameShape.style.x):(this._startFrameShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._startFrameShape.style.height=this._location.y+this._location.height-this._startFrameShape.style.y,this._endFrameShape.style.height=this._fillerShae.style.y-this._location.y),this.zr.modShape(this._startFrameShape.id),this.zr.modShape(this._endFrameShape.id)},_syncShape:function(){this.zoomOption.show&&("horizontal"==this.zoomOption.orient?(this._startShape.style.x=this._location.x+this._zoom.start/100*this._location.width,this._endShape.style.x=this._location.x+this._zoom.end/100*this._location.width-this._handleSize,this._fillerShae.style.x=this._startShape.style.x+this._handleSize,this._fillerShae.style.width=this._endShape.style.x-this._startShape.style.x-this._handleSize):(this._startShape.style.y=this._location.y+this._location.height-this._zoom.start/100*this._location.height,this._endShape.style.y=this._location.y+this._location.height-this._zoom.end/100*this._location.height-this._handleSize,this._fillerShae.style.y=this._endShape.style.y+this._handleSize,this._fillerShae.style.height=this._startShape.style.y-this._endShape.style.y-this._handleSize),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this.zr.modShape(this._fillerShae.id),this._syncFrameShape(),this.zr.refresh())},_syncData:function(e){var t,i,n,a,o;for(var s in this._originalData){t=this._originalData[s];for(var l in t)o=t[l],null!=o&&(a=o.length,i=Math.floor(this._zoom.start/100*a),n=Math.ceil(this._zoom.end/100*a),this.getDataFromOption(o[0])instanceof Array&&this.option[s][l].type!=r.CHART_TYPE_K?(this._setScale(),this.option[s][l].data=this._synScatterData(l,o)):this.option[s][l].data=o.slice(i,n))}this._isSilence||!this.zoomOption.realtime&&!e||this.messageCenter.dispatch(r.EVENT.DATA_ZOOM,null,{zoom:this._zoom},this.myChart)},_synScatterData:function(e,t){if(0===this._zoom.start&&100==this._zoom.end&&0===this._zoom.start2&&100==this._zoom.end2)return t;var i,n,a,o,r,s=[],l=this._zoom.scatterMap[e];"horizontal"==this.zoomOption.orient?(i=l.x.max-l.x.min,n=this._zoom.start/100*i+l.x.min,a=this._zoom.end/100*i+l.x.min,i=l.y.max-l.y.min,o=this._zoom.start2/100*i+l.y.min,r=this._zoom.end2/100*i+l.y.min):(i=l.x.max-l.x.min,n=this._zoom.start2/100*i+l.x.min,a=this._zoom.end2/100*i+l.x.min,i=l.y.max-l.y.min,o=this._zoom.start/100*i+l.y.min,r=this._zoom.end/100*i+l.y.min);for(var h,d=0,m=t.length;m>d;d++)h=t[d].value||t[d],h[0]>=n&&h[0]<=a&&h[1]>=o&&h[1]<=r&&s.push(t[d]);return s},_setScale:function(){var e=0!==this._zoom.start||100!==this._zoom.end||0!==this._zoom.start2||100!==this._zoom.end2,t={xAxis:this.option.xAxis,yAxis:this.option.yAxis};for(var i in t)for(var n=0,a=t[i].length;a>n;n++)t[i][n].scale=e||t[i][n]._scale},_backupScale:function(){var e={xAxis:this.option.xAxis,yAxis:this.option.yAxis};for(var t in e)for(var i=0,n=e[t].length;n>i;i++)e[t][i]._scale=e[t][i].scale},_getDetail:function(){var e="horizontal"==this.zoomOption.orient?"xAxis":"yAxis",t=this._originalData[e];for(var i in t){var n=t[i];if(null!=n){var a=n.length,o=Math.floor(this._zoom.start/100*a),r=Math.ceil(this._zoom.end/100*a);return r-=r>0?1:0,{start:this.getDataFromOption(n[o]),end:this.getDataFromOption(n[r])}}}var l=this._zoom.seriesIndex[0],h=this.option.series[l][e+"Index"]||0,d=this.option[e][h].type,m=this._zoom.scatterMap[l][e.charAt(0)].min,c=this._zoom.scatterMap[l][e.charAt(0)].max,p=c-m;if("value"==d)return{start:m+p*this._zoom.start/100,end:m+p*this._zoom.end/100};if("time"==d){c=m+p*this._zoom.end/100,m+=p*this._zoom.start/100;var u=s.getAutoFormatter(m,c).formatter;return{start:s.format(u,m),end:s.format(u,c)}}return{start:"",end:""}},__ondrift:function(e,t,i){this.zoomOption.zoomLock&&(e=this._fillerShae);var n="filler"==e._type?this._handleSize:0;if("horizontal"==this.zoomOption.orient?e.style.x+t-n<=this._location.x?e.style.x=this._location.x+n:e.style.x+t+e.style.width+n>=this._location.x+this._location.width?e.style.x=this._location.x+this._location.width-e.style.width-n:e.style.x+=t:e.style.y+i-n<=this._location.y?e.style.y=this._location.y+n:e.style.y+i+e.style.height+n>=this._location.y+this._location.height?e.style.y=this._location.y+this._location.height-e.style.height-n:e.style.y+=i,"filler"==e._type?this._syncHandleShape():this._syncFillerShape(),this.zoomOption.realtime&&this._syncData(),this.zoomOption.showDetail){var a=this._getDetail();this._startShape.style.text=this._startShape.highlightStyle.text=a.start,this._endShape.style.text=this._endShape.highlightStyle.text=a.end,this._startShape.style.textPosition=this._startShape.highlightStyle.textPosition,this._endShape.style.textPosition=this._endShape.highlightStyle.textPosition}return!0},__ondragend:function(){this.zoomOption.showDetail&&(this._startShape.style.text=this._endShape.style.text="=",this._startShape.style.textPosition=this._endShape.style.textPosition="inside",this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this.zr.refreshNextFrame()),this.isDragend=!0},ondragend:function(e,t){this.isDragend&&e.target&&(!this.zoomOption.realtime&&this._syncData(),t.dragOut=!0,t.dragIn=!0,this._isSilence||this.zoomOption.realtime||this.messageCenter.dispatch(r.EVENT.DATA_ZOOM,null,{zoom:this._zoom},this.myChart),t.needRefresh=!1,this.isDragend=!1)},ondataZoom:function(e,t){t.needRefresh=!0},absoluteZoom:function(e){this._zoom.start=e.start,this._zoom.end=e.end,this._zoom.start2=e.start2,this._zoom.end2=e.end2,this._syncShape(),this._syncData(!0)},rectZoom:function(e){if(!e)return this._zoom.start=this._zoom.start2=0,this._zoom.end=this._zoom.end2=100,this._syncShape(),this._syncData(!0),this._zoom; +var t=this.component.grid.getArea(),i={x:e.x,y:e.y,width:e.width,height:e.height};if(i.width<0&&(i.x+=i.width,i.width=-i.width),i.height<0&&(i.y+=i.height,i.height=-i.height),i.x>t.x+t.width||i.y>t.y+t.height)return!1;i.xt.x+t.width&&(i.width=t.x+t.width-i.x),i.y+i.height>t.y+t.height&&(i.height=t.y+t.height-i.y);var n,a=(i.x-t.x)/t.width,o=1-(i.x+i.width-t.x)/t.width,r=1-(i.y+i.height-t.y)/t.height,s=(i.y-t.y)/t.height;return"horizontal"==this.zoomOption.orient?(n=this._zoom.end-this._zoom.start,this._zoom.start+=n*a,this._zoom.end-=n*o,n=this._zoom.end2-this._zoom.start2,this._zoom.start2+=n*r,this._zoom.end2-=n*s):(n=this._zoom.end-this._zoom.start,this._zoom.start+=n*r,this._zoom.end-=n*s,n=this._zoom.end2-this._zoom.start2,this._zoom.start2+=n*a,this._zoom.end2-=n*o),this._syncShape(),this._syncData(!0),this._zoom},syncBackupData:function(e){for(var t,i,n=this._originalData.series,a=e.series,o=0,r=a.length;r>o;o++){i=a[o].data||a[o].eventList,t=n[o]?Math.floor(this._zoom.start/100*n[o].length):0;for(var s=0,l=i.length;l>s;s++)n[o]&&(n[o][s+t]=i[s])}},syncOption:function(e){this.silence(!0),this.option=e,this.option.dataZoom=this.reformOption(this.option.dataZoom),this.zoomOption=this.option.dataZoom,this.myChart.canvasSupported||(this.zoomOption.realtime=!1),this.clear(),this._location=this._getLocation(),this._zoom=this._getZoom(),this._backupData(),this.option.dataZoom&&this.option.dataZoom.show&&this._buildShape(),this._syncData(),this.silence(!1)},silence:function(e){this._isSilence=e},getRealDataIndex:function(e,t){if(!this._originalData||0===this._zoom.start&&100==this._zoom.end)return t;var i=this._originalData.series;return i[e]?Math.floor(this._zoom.start/100*i[e].length)+t:-1},resize:function(){this.clear(),this._location=this._getLocation(),this._zoom=this._getZoom(),this.option.dataZoom.show&&this._buildShape()}},l.inherits(t,i),e("../component").define("dataZoom",t),t}),define("echarts/component/categoryAxis",["require","./base","zrender/shape/Text","zrender/shape/Line","zrender/shape/Rectangle","../config","zrender/tool/util","zrender/tool/area","../component"],function(e){function t(e,t,n,a,o,r){if(a.data.length<1)return void console.error("option.data.length < 1.");i.call(this,e,t,n,a,o),this.grid=this.component.grid;for(var s in r)this[s]=r[s];this.refresh(a)}var i=e("./base"),n=e("zrender/shape/Text"),a=e("zrender/shape/Line"),o=e("zrender/shape/Rectangle"),r=e("../config");r.categoryAxis={zlevel:0,z:0,show:!0,position:"bottom",name:"",nameLocation:"end",nameTextStyle:{},boundaryGap:!0,axisLine:{show:!0,onZero:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!0,interval:"auto",inside:!1,length:5,lineStyle:{color:"#333",width:1}},axisLabel:{show:!0,interval:"auto",rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}}};var s=e("zrender/tool/util"),l=e("zrender/tool/area");return t.prototype={type:r.COMPONENT_TYPE_AXIS_CATEGORY,_getReformedLabel:function(e){var t=this.getDataFromOption(this.option.data[e]),i=this.option.data[e].formatter||this.option.axisLabel.formatter;return i&&("function"==typeof i?t=i.call(this.myChart,t):"string"==typeof i&&(t=i.replace("{value}",t))),t},_getInterval:function(){var e=this.option.axisLabel.interval;if("auto"==e){var t=this.option.axisLabel.textStyle.fontSize,i=this.option.data,n=this.option.data.length;if(this.isHorizontal())if(n>3){var a,o,r=this.getGap(),h=!1,d=Math.floor(.5/r);for(d=1>d?1:d,e=Math.floor(15/r);!h&&n>e;){e+=d,h=!0,a=Math.floor(r*e);for(var m=Math.floor((n-1)/e)*e;m>=0;m-=e){if(0!==this.option.axisLabel.rotate)o=t;else if(i[m].textStyle)o=l.getTextWidth(this._getReformedLabel(m),this.getFont(s.merge(i[m].textStyle,this.option.axisLabel.textStyle)));else{var c=this._getReformedLabel(m)+"",p=(c.match(/\w/g)||"").length,u=c.length-p;o=p*t*2/3+u*t}if(o>a){h=!1;break}}}}else e=1;else if(n>3){var r=this.getGap();for(e=Math.floor(11/r);t>r*e-6&&n>e;)e++}else e=1}else e="function"==typeof e?1:e-0+1;return e},_buildShape:function(){if(this._interval=this._getInterval(),this.option.show){this.option.splitArea.show&&this._buildSplitArea(),this.option.splitLine.show&&this._buildSplitLine(),this.option.axisLine.show&&this._buildAxisLine(),this.option.axisTick.show&&this._buildAxisTick(),this.option.axisLabel.show&&this._buildAxisLabel();for(var e=0,t=this.shapeList.length;t>e;e++)this.zr.addShape(this.shapeList[e])}},_buildAxisTick:function(){var e,t=this.option.data,i=this.option.data.length,n=this.option.axisTick,o=n.length,r=n.lineStyle.color,s=n.lineStyle.width,l="function"==typeof n.interval?n.interval:"auto"==n.interval&&"function"==typeof this.option.axisLabel.interval?this.option.axisLabel.interval:!1,h=l?1:"auto"==n.interval?this._interval:n.interval-0+1,d=n.onGap,m=d?this.getGap()/2:"undefined"==typeof d&&this.option.boundaryGap?this.getGap()/2:0,c=m>0?-h:0;if(this.isHorizontal())for(var p,u="bottom"==this.option.position?n.inside?this.grid.getYend()-o-1:this.grid.getYend()+1:n.inside?this.grid.getY()+1:this.grid.getY()-o-1,V=c;i>V;V+=h)(!l||l(V,t[V]))&&(p=this.subPixelOptimize(this.getCoordByIndex(V)+(V>=0?m:0),s),e={_axisShape:"axisTick",zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:p,yStart:u,xEnd:p,yEnd:u+o,strokeColor:r,lineWidth:s}},this.shapeList.push(new a(e)));else for(var U,g="left"==this.option.position?n.inside?this.grid.getX()+1:this.grid.getX()-o-1:n.inside?this.grid.getXend()-o-1:this.grid.getXend()+1,V=c;i>V;V+=h)(!l||l(V,t[V]))&&(U=this.subPixelOptimize(this.getCoordByIndex(V)-(V>=0?m:0),s),e={_axisShape:"axisTick",zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:g,yStart:U,xEnd:g+o,yEnd:U,strokeColor:r,lineWidth:s}},this.shapeList.push(new a(e)))},_buildAxisLabel:function(){var e,t,i=this.option.data,a=this.option.data.length,o=this.option.axisLabel,r=o.rotate,l=o.margin,h=o.clickable,d=o.textStyle,m="function"==typeof o.interval?o.interval:!1;if(this.isHorizontal()){var c,p;"bottom"==this.option.position?(c=this.grid.getYend()+l,p="top"):(c=this.grid.getY()-l,p="bottom");for(var u=0;a>u;u+=this._interval)m&&!m(u,i[u])||""===this._getReformedLabel(u)||(t=s.merge(i[u].textStyle||{},d),e={zlevel:this.getZlevelBase(),z:this.getZBase()+3,hoverable:!1,style:{x:this.getCoordByIndex(u),y:c,color:t.color,text:this._getReformedLabel(u),textFont:this.getFont(t),textAlign:t.align||"center",textBaseline:t.baseline||p}},r&&(e.style.textAlign=r>0?"bottom"==this.option.position?"right":"left":"bottom"==this.option.position?"left":"right",e.rotation=[r*Math.PI/180,e.style.x,e.style.y]),this.shapeList.push(new n(this._axisLabelClickable(h,e))))}else{var V,U;"left"==this.option.position?(V=this.grid.getX()-l,U="right"):(V=this.grid.getXend()+l,U="left");for(var u=0;a>u;u+=this._interval)m&&!m(u,i[u])||""===this._getReformedLabel(u)||(t=s.merge(i[u].textStyle||{},d),e={zlevel:this.getZlevelBase(),z:this.getZBase()+3,hoverable:!1,style:{x:V,y:this.getCoordByIndex(u),color:t.color,text:this._getReformedLabel(u),textFont:this.getFont(t),textAlign:t.align||U,textBaseline:t.baseline||0===u&&""!==this.option.name?"bottom":u==a-1&&""!==this.option.name?"top":"middle"}},r&&(e.rotation=[r*Math.PI/180,e.style.x,e.style.y]),this.shapeList.push(new n(this._axisLabelClickable(h,e))))}},_buildSplitLine:function(){var e,t=this.option.data,i=this.option.data.length,n=this.option.splitLine,o=n.lineStyle.type,r=n.lineStyle.width,s=n.lineStyle.color;s=s instanceof Array?s:[s];var l=s.length,h="function"==typeof this.option.axisLabel.interval?this.option.axisLabel.interval:!1,d=n.onGap,m=d?this.getGap()/2:"undefined"==typeof d&&this.option.boundaryGap?this.getGap()/2:0;if(i-=d||"undefined"==typeof d&&this.option.boundaryGap?1:0,this.isHorizontal())for(var c,p=this.grid.getY(),u=this.grid.getYend(),V=0;i>V;V+=this._interval)(!h||h(V,t[V]))&&(c=this.subPixelOptimize(this.getCoordByIndex(V)+m,r),e={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:c,yStart:p,xEnd:c,yEnd:u,strokeColor:s[V/this._interval%l],lineType:o,lineWidth:r}},this.shapeList.push(new a(e)));else for(var U,g=this.grid.getX(),y=this.grid.getXend(),V=0;i>V;V+=this._interval)(!h||h(V,t[V]))&&(U=this.subPixelOptimize(this.getCoordByIndex(V)-m,r),e={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:g,yStart:U,xEnd:y,yEnd:U,strokeColor:s[V/this._interval%l],lineType:o,lineWidth:r}},this.shapeList.push(new a(e)))},_buildSplitArea:function(){var e,t=this.option.data,i=this.option.splitArea,n=i.areaStyle.color;if(n instanceof Array){var a=n.length,r=this.option.data.length,s="function"==typeof this.option.axisLabel.interval?this.option.axisLabel.interval:!1,l=i.onGap,h=l?this.getGap()/2:"undefined"==typeof l&&this.option.boundaryGap?this.getGap()/2:0;if(this.isHorizontal())for(var d,m=this.grid.getY(),c=this.grid.getHeight(),p=this.grid.getX(),u=0;r>=u;u+=this._interval)s&&!s(u,t[u])&&r>u||(d=r>u?this.getCoordByIndex(u)+h:this.grid.getXend(),e={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:p,y:m,width:d-p,height:c,color:n[u/this._interval%a]}},this.shapeList.push(new o(e)),p=d);else for(var V,U=this.grid.getX(),g=this.grid.getWidth(),y=this.grid.getYend(),u=0;r>=u;u+=this._interval)s&&!s(u,t[u])&&r>u||(V=r>u?this.getCoordByIndex(u)-h:this.grid.getY(),e={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:U,y:V,width:g,height:y-V,color:n[u/this._interval%a]}},this.shapeList.push(new o(e)),y=V)}else e={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this.grid.getX(),y:this.grid.getY(),width:this.grid.getWidth(),height:this.grid.getHeight(),color:n}},this.shapeList.push(new o(e))},refresh:function(e){e&&(this.option=this.reformOption(e),this.option.axisLabel.textStyle=this.getTextStyle(this.option.axisLabel.textStyle)),this.clear(),this._buildShape()},getGap:function(){var e=this.option.data.length,t=this.isHorizontal()?this.grid.getWidth():this.grid.getHeight();return this.option.boundaryGap?t/e:t/(e>1?e-1:1)},getCoord:function(e){for(var t=this.option.data,i=t.length,n=this.getGap(),a=this.option.boundaryGap?n/2:0,o=0;i>o;o++){if(this.getDataFromOption(t[o])==e)return a=this.isHorizontal()?this.grid.getX()+a:this.grid.getYend()-a;a+=n}},getCoordByIndex:function(e){if(0>e)return this.isHorizontal()?this.grid.getX():this.grid.getYend();if(e>this.option.data.length-1)return this.isHorizontal()?this.grid.getXend():this.grid.getY();var t=this.getGap(),i=this.option.boundaryGap?t/2:0;return i+=e*t,i=this.isHorizontal()?this.grid.getX()+i:this.grid.getYend()-i},getNameByIndex:function(e){return this.getDataFromOption(this.option.data[e])},getIndexByName:function(e){for(var t=this.option.data,i=t.length,n=0;i>n;n++)if(this.getDataFromOption(t[n])==e)return n;return-1},getValueFromCoord:function(){return""},isMainAxis:function(e){return e%this._interval===0}},s.inherits(t,i),e("../component").define("categoryAxis",t),t}),define("echarts/component/valueAxis",["require","./base","zrender/shape/Text","zrender/shape/Line","zrender/shape/Rectangle","../config","../util/date","zrender/tool/util","../util/smartSteps","../util/accMath","../component"],function(e){function t(e,t,n,a,o,r,s){if(!s||0===s.length)return void console.err("option.series.length == 0.");i.call(this,e,t,n,a,o),this.series=s,this.grid=this.component.grid;for(var l in r)this[l]=r[l];this.refresh(a,s)}var i=e("./base"),n=e("zrender/shape/Text"),a=e("zrender/shape/Line"),o=e("zrender/shape/Rectangle"),r=e("../config");r.valueAxis={zlevel:0,z:0,show:!0,position:"left",name:"",nameLocation:"end",nameTextStyle:{},boundaryGap:[0,0],axisLine:{show:!0,onZero:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,inside:!1,length:5,lineStyle:{color:"#333",width:1}},axisLabel:{show:!0,rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}}};var s=e("../util/date"),l=e("zrender/tool/util");return t.prototype={type:r.COMPONENT_TYPE_AXIS_VALUE,_buildShape:function(){if(this._hasData=!1,this._calculateValue(),this._hasData&&this.option.show){this.option.splitArea.show&&this._buildSplitArea(),this.option.splitLine.show&&this._buildSplitLine(),this.option.axisLine.show&&this._buildAxisLine(),this.option.axisTick.show&&this._buildAxisTick(),this.option.axisLabel.show&&this._buildAxisLabel();for(var e=0,t=this.shapeList.length;t>e;e++)this.zr.addShape(this.shapeList[e])}},_buildAxisTick:function(){var e,t=this._valueList,i=this._valueList.length,n=this.option.axisTick,o=n.length,r=n.lineStyle.color,s=n.lineStyle.width;if(this.isHorizontal())for(var l,h="bottom"===this.option.position?n.inside?this.grid.getYend()-o-1:this.grid.getYend()+1:n.inside?this.grid.getY()+1:this.grid.getY()-o-1,d=0;i>d;d++)l=this.subPixelOptimize(this.getCoord(t[d]),s),e={_axisShape:"axisTick",zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:l,yStart:h,xEnd:l,yEnd:h+o,strokeColor:r,lineWidth:s}},this.shapeList.push(new a(e));else for(var m,c="left"===this.option.position?n.inside?this.grid.getX()+1:this.grid.getX()-o-1:n.inside?this.grid.getXend()-o-1:this.grid.getXend()+1,d=0;i>d;d++)m=this.subPixelOptimize(this.getCoord(t[d]),s),e={_axisShape:"axisTick",zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:c,yStart:m,xEnd:c+o,yEnd:m,strokeColor:r,lineWidth:s}},this.shapeList.push(new a(e))},_buildAxisLabel:function(){var e,t=this._valueList,i=this._valueList.length,a=this.option.axisLabel.rotate,o=this.option.axisLabel.margin,r=this.option.axisLabel.clickable,s=this.option.axisLabel.textStyle;if(this.isHorizontal()){var l,h;"bottom"===this.option.position?(l=this.grid.getYend()+o,h="top"):(l=this.grid.getY()-o,h="bottom");for(var d=0;i>d;d++)e={zlevel:this.getZlevelBase(),z:this.getZBase()+3,hoverable:!1,style:{x:this.getCoord(t[d]),y:l,color:"function"==typeof s.color?s.color(t[d]):s.color,text:this._valueLabel[d],textFont:this.getFont(s),textAlign:s.align||"center",textBaseline:s.baseline||h}},a&&(e.style.textAlign=a>0?"bottom"===this.option.position?"right":"left":"bottom"===this.option.position?"left":"right",e.rotation=[a*Math.PI/180,e.style.x,e.style.y]),this.shapeList.push(new n(this._axisLabelClickable(r,e)))}else{var m,c;"left"===this.option.position?(m=this.grid.getX()-o,c="right"):(m=this.grid.getXend()+o,c="left");for(var d=0;i>d;d++)e={zlevel:this.getZlevelBase(),z:this.getZBase()+3,hoverable:!1,style:{x:m,y:this.getCoord(t[d]),color:"function"==typeof s.color?s.color(t[d]):s.color,text:this._valueLabel[d],textFont:this.getFont(s),textAlign:s.align||c,textBaseline:s.baseline||(0===d&&""!==this.option.name?"bottom":d===i-1&&""!==this.option.name?"top":"middle")}},a&&(e.rotation=[a*Math.PI/180,e.style.x,e.style.y]),this.shapeList.push(new n(this._axisLabelClickable(r,e)))}},_buildSplitLine:function(){var e,t=this._valueList,i=this._valueList.length,n=this.option.splitLine,o=n.lineStyle.type,r=n.lineStyle.width,s=n.lineStyle.color;s=s instanceof Array?s:[s];var l=s.length;if(this.isHorizontal())for(var h,d=this.grid.getY(),m=this.grid.getYend(),c=0;i>c;c++)h=this.subPixelOptimize(this.getCoord(t[c]),r),e={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:h,yStart:d,xEnd:h,yEnd:m,strokeColor:s[c%l],lineType:o,lineWidth:r}},this.shapeList.push(new a(e));else for(var p,u=this.grid.getX(),V=this.grid.getXend(),c=0;i>c;c++)p=this.subPixelOptimize(this.getCoord(t[c]),r),e={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:u,yStart:p,xEnd:V,yEnd:p,strokeColor:s[c%l],lineType:o,lineWidth:r}},this.shapeList.push(new a(e))},_buildSplitArea:function(){var e,t=this.option.splitArea.areaStyle.color;if(t instanceof Array){var i=t.length,n=this._valueList,a=this._valueList.length;if(this.isHorizontal())for(var r,s=this.grid.getY(),l=this.grid.getHeight(),h=this.grid.getX(),d=0;a>=d;d++)r=a>d?this.getCoord(n[d]):this.grid.getXend(),e={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:h,y:s,width:r-h,height:l,color:t[d%i]}},this.shapeList.push(new o(e)),h=r;else for(var m,c=this.grid.getX(),p=this.grid.getWidth(),u=this.grid.getYend(),d=0;a>=d;d++)m=a>d?this.getCoord(n[d]):this.grid.getY(),e={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:c,y:m,width:p,height:u-m,color:t[d%i]}},this.shapeList.push(new o(e)),u=m}else e={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this.grid.getX(),y:this.grid.getY(),width:this.grid.getWidth(),height:this.grid.getHeight(),color:t}},this.shapeList.push(new o(e))},_calculateValue:function(){if(isNaN(this.option.min-0)||isNaN(this.option.max-0)){for(var e,t,i={},n=this.component.legend,a=0,o=this.series.length;o>a;a++)!(this.series[a].type!=r.CHART_TYPE_LINE&&this.series[a].type!=r.CHART_TYPE_BAR&&this.series[a].type!=r.CHART_TYPE_SCATTER&&this.series[a].type!=r.CHART_TYPE_K&&this.series[a].type!=r.CHART_TYPE_EVENTRIVER||n&&!n.isSelected(this.series[a].name)||(e=this.series[a].xAxisIndex||0,t=this.series[a].yAxisIndex||0,this.option.xAxisIndex!=e&&this.option.yAxisIndex!=t||!this._calculSum(i,a)));var s;for(var a in i){s=i[a];for(var l=0,h=s.length;h>l;l++)if(!isNaN(s[l])){this._hasData=!0,this._min=s[l],this._max=s[l];break}if(this._hasData)break}for(var a in i){s=i[a];for(var l=0,h=s.length;h>l;l++)isNaN(s[l])||(this._min=Math.min(this._min,s[l]),this._max=Math.max(this._max,s[l]))}var d=Math.abs(this._max-this._min);this._min=isNaN(this.option.min-0)?this._min-Math.abs(d*this.option.boundaryGap[0]):this.option.min-0,this._max=isNaN(this.option.max-0)?this._max+Math.abs(d*this.option.boundaryGap[1]):this.option.max-0,this._min===this._max&&(0===this._max?this._max=1:this._max>0?this._min=this._max/this.option.splitNumber!=null?this.option.splitNumber:5:this._max=this._max/this.option.splitNumber!=null?this.option.splitNumber:5),"time"!=this.option.type?this._reformValue(this.option.scale):this._reformTimeValue()}else this._hasData=!0,this._min=this.option.min-0,this._max=this.option.max-0,"time"!=this.option.type?this._customerValue():this._reformTimeValue()},_calculSum:function(e,t){var i,n,a=this.series[t].name||"kener";if(this.series[t].stack){var o="__Magic_Key_Positive__"+this.series[t].stack,l="__Magic_Key_Negative__"+this.series[t].stack;e[o]=e[o]||[],e[l]=e[l]||[],e[a]=e[a]||[],n=this.series[t].data;for(var h=0,d=n.length;d>h;h++)i=this.getDataFromOption(n[h]),"-"!==i&&(i-=0,i>=0?null!=e[o][h]?e[o][h]+=i:e[o][h]=i:null!=e[l][h]?e[l][h]+=i:e[l][h]=i,this.option.scale&&e[a].push(i))}else if(e[a]=e[a]||[],this.series[t].type!=r.CHART_TYPE_EVENTRIVER){n=this.series[t].data;for(var h=0,d=n.length;d>h;h++)i=this.getDataFromOption(n[h]),this.series[t].type===r.CHART_TYPE_K?(e[a].push(i[0]),e[a].push(i[1]),e[a].push(i[2]),e[a].push(i[3])):i instanceof Array?(-1!=this.option.xAxisIndex&&e[a].push("time"!=this.option.type?i[0]:s.getNewDate(i[0])),-1!=this.option.yAxisIndex&&e[a].push("time"!=this.option.type?i[1]:s.getNewDate(i[1]))):e[a].push(i)}else{n=this.series[t].eventList;for(var h=0,d=n.length;d>h;h++)for(var m=n[h].evolution,c=0,p=m.length;p>c;c++)e[a].push(s.getNewDate(m[c].time))}},_reformValue:function(t){var i=e("../util/smartSteps"),n=this.option.splitNumber;!t&&this._min>=0&&this._max>=0&&(this._min=0),!t&&this._min<=0&&this._max<=0&&(this._max=0);var a=i(this._min,this._max,n);n=null!=n?n:a.secs,this._min=a.min,this._max=a.max,this._valueList=a.pnts,this._reformLabelData()},_reformTimeValue:function(){var e=null!=this.option.splitNumber?this.option.splitNumber:5,t=s.getAutoFormatter(this._min,this._max,e),i=t.formatter,n=t.gapValue;this._valueList=[s.getNewDate(this._min)];var a;switch(i){case"week":a=s.nextMonday(this._min);break;case"month":a=s.nextNthOnMonth(this._min,1);break;case"quarter":a=s.nextNthOnQuarterYear(this._min,1);break;case"half-year":a=s.nextNthOnHalfYear(this._min,1);break;case"year":a=s.nextNthOnYear(this._min,1);break;default:72e5>=n?a=(Math.floor(this._min/n)+1)*n:(a=s.getNewDate(this._min- -n),a.setHours(6*Math.round(a.getHours()/6)),a.setMinutes(0),a.setSeconds(0))}for(a-this._min=0&&(("month"==i||"quarter"==i||"half-year"==i||"year"==i)&&t.setDate(1),!(this._max-t=a;a++)this._valueList.push(t.accAdd(this._min,t.accMul(n,a)));this._reformLabelData()},_reformLabelData:function(e){this._valueLabel=[];var t=this.option.axisLabel.formatter;if(t)for(var i=0,n=this._valueList.length;n>i;i++)"function"==typeof t?this._valueLabel.push(e?t.call(this.myChart,this._valueList[i],e):t.call(this.myChart,this._valueList[i])):"string"==typeof t&&this._valueLabel.push(e?s.format(t,this._valueList[i]):t.replace("{value}",this._valueList[i]));else if(e)for(var i=0,n=this._valueList.length;n>i;i++)this._valueLabel.push(s.format(e,this._valueList[i]));else for(var i=0,n=this._valueList.length;n>i;i++)this._valueLabel.push(this.numAddCommas(this._valueList[i]))},getExtremum:function(){return this._calculateValue(),{min:this._min,max:this._max}},refresh:function(e,t){e&&(this.option=this.reformOption(e),this.option.axisLabel.textStyle=l.merge(this.option.axisLabel.textStyle||{},this.ecTheme.textStyle),this.series=t),this.zr&&(this.clear(),this._buildShape())},getCoord:function(e){e=ethis._max?this._max:e;var t;return t=this.isHorizontal()?this.grid.getX()+(e-this._min)/(this._max-this._min)*this.grid.getWidth():this.grid.getYend()-(e-this._min)/(this._max-this._min)*this.grid.getHeight()},getCoordSize:function(e){return Math.abs(this.isHorizontal()?e/(this._max-this._min)*this.grid.getWidth():e/(this._max-this._min)*this.grid.getHeight())},getValueFromCoord:function(e){var t;return this.isHorizontal()?(e=ethis.grid.getXend()?this.grid.getXend():e,t=this._min+(e-this.grid.getX())/this.grid.getWidth()*(this._max-this._min)):(e=ethis.grid.getYend()?this.grid.getYend():e,t=this._max-(e-this.grid.getY())/this.grid.getHeight()*(this._max-this._min)),t.toFixed(2)-0},isMaindAxis:function(e){for(var t=0,i=this._valueList.length;i>t;t++)if(this._valueList[t]===e)return!0;return!1}},l.inherits(t,i),e("../component").define("valueAxis",t),t}),define("echarts/util/date",[],function(){function e(e,t,i){i=i>1?i:2;for(var n,a,o,r,s=0,l=d.length;l>s;s++)if(n=d[s].value,a=Math.ceil(t/n)*n-Math.floor(e/n)*n,Math.round(a/n)<=1.2*i){o=d[s].formatter,r=d[s].value;break}return null==o&&(o="year",n=317088e5,a=Math.ceil(t/n)*n-Math.floor(e/n)*n,r=Math.round(a/(i-1)/n)*n),{formatter:o,gapValue:r}}function t(e){return 10>e?"0"+e:e}function i(e,i){("week"==e||"month"==e||"quarter"==e||"half-year"==e||"year"==e)&&(e="MM - dd\nyyyy");var n=h(i),a=n.getFullYear(),o=n.getMonth()+1,r=n.getDate(),s=n.getHours(),l=n.getMinutes(),d=n.getSeconds();return e=e.replace("MM",t(o)),e=e.toLowerCase(),e=e.replace("yyyy",a),e=e.replace("yy",a%100),e=e.replace("dd",t(r)),e=e.replace("d",r),e=e.replace("hh",t(s)),e=e.replace("h",s),e=e.replace("mm",t(l)),e=e.replace("m",l),e=e.replace("ss",t(d)),e=e.replace("s",d)}function n(e){return e=h(e),e.setDate(e.getDate()+8-e.getDay()),e}function a(e,t,i){return e=h(e),e.setMonth(Math.ceil((e.getMonth()+1)/i)*i),e.setDate(t),e}function o(e,t){return a(e,t,1)}function r(e,t){return a(e,t,3)}function s(e,t){return a(e,t,6)}function l(e,t){return a(e,t,12)}function h(e){return e instanceof Date?e:new Date("string"==typeof e?e.replace(/-/g,"/"):e)}var d=[{formatter:"hh : mm : ss",value:1e3},{formatter:"hh : mm : ss",value:5e3},{formatter:"hh : mm : ss",value:1e4},{formatter:"hh : mm : ss",value:15e3},{formatter:"hh : mm : ss",value:3e4},{formatter:"hh : mm\nMM - dd",value:6e4},{formatter:"hh : mm\nMM - dd",value:3e5},{formatter:"hh : mm\nMM - dd",value:6e5},{formatter:"hh : mm\nMM - dd",value:9e5},{formatter:"hh : mm\nMM - dd",value:18e5},{formatter:"hh : mm\nMM - dd",value:36e5},{formatter:"hh : mm\nMM - dd",value:72e5},{formatter:"hh : mm\nMM - dd",value:216e5},{formatter:"hh : mm\nMM - dd",value:432e5},{formatter:"MM - dd\nyyyy",value:864e5},{formatter:"week",value:6048e5},{formatter:"month",value:26784e5},{formatter:"quarter",value:8208e6},{formatter:"half-year",value:16416e6},{formatter:"year",value:32832e6}];return{getAutoFormatter:e,getNewDate:h,format:i,nextMonday:n,nextNthPerNmonth:a,nextNthOnMonth:o,nextNthOnQuarterYear:r,nextNthOnHalfYear:s,nextNthOnYear:l}}),define("echarts/util/smartSteps",[],function(){function e(e){return W.log(K(e))/W.LN10}function t(e){return W.pow(10,e)}function i(e){return e===X(e)}function n(e,t,n,a){f=a||{},b=f.steps||L,_=f.secs||v,n=w(+n||0)%99,e=+e||0,t=+t||0,x=k=0,"min"in f&&(e=+f.min||0,x=1),"max"in f&&(t=+f.max||0,k=1),e>t&&(t=[e,e=t][0]);var o=t-e;if(x&&k)return y(e,t,n);if((n||5)>o){if(i(e)&&i(t))return p(e,t,n);if(0===o)return u(e,t,n)}return h(e,t,n)}function a(e,i,n,a){a=a||0;var s=o((i-e)/n,-1),l=o(e,-1,1),h=o(i,-1),d=W.min(s.e,l.e,h.e);0===l.c?d=W.min(s.e,h.e):0===h.c&&(d=W.min(s.e,l.e)),r(s,{c:0,e:d}),r(l,s,1),r(h,s),a+=d,e=l.c,i=h.c;for(var m=(i-e)/n,c=t(a),p=0,u=[],V=n+1;V--;)u[V]=(e+m*V)*c;if(0>a){p=U(c),m=+(m*c).toFixed(p),e=+(e*c).toFixed(p),i=+(i*c).toFixed(p);for(var V=u.length;V--;)u[V]=u[V].toFixed(p),0===+u[V]&&(u[V]="0")}else e*=c,i*=c,m*=c;return _=0,b=0,f=0,{min:e,max:i,secs:n,step:m,fix:p,exp:a,pnts:u}}function o(n,a,o){a=w(a%10)||2,0>a&&(i(n)?a=(""+K(n)).replace(/0+$/,"").length||1:(n=n.toFixed(15).replace(/0+$/,""),a=n.replace(".","").replace(/^[-0]+/,"").length,n=+n));var r=X(e(n))-a+1,s=+(n*t(-r)).toFixed(15)||0;return s=o?X(s):I(s),!s&&(r=0),(""+K(s)).length>a&&(r+=1,s/=10),{c:s,e:r}}function r(e,i,n){var a=i.e-e.e;a&&(e.e+=a,e.c*=t(-a),e.c=n?X(e.c):I(e.c))}function s(e,t,i){e.et[n];)n++;if(!t[n])for(i/=10,e.e+=1,n=0;i>t[n];)n++;return e.c=t[n],e}function h(e,t,n){var s,h=n||+_.slice(-1),u=l((t-e)/h,b),U=o(t-e),y=o(e,-1,1),f=o(t,-1);if(r(U,u),r(y,u,1),r(f,u),n?s=m(y,f,h):h=d(y,f),i(e)&&i(t)&&e*t>=0){if(h>t-e)return p(e,t,h);h=c(e,t,n,y,f,h)}var L=V(e,t,y.c,f.c);return y.c=L[0],f.c=L[1],(x||k)&&g(e,t,y,f),a(y.c,f.c,h,f.e)}function d(e,i){for(var n,a,o,r,s=[],h=_.length;h--;)n=_[h],a=l((i.c-e.c)/n,b),a=a.c*t(a.e),o=X(e.c/a)*a,r=I(i.c/a)*a,s[h]={min:o,max:r,step:a,span:r-o};return s.sort(function(e,t){var i=e.span-t.span;return 0===i&&(i=e.step-t.step),i}),s=s[0],n=s.span/s.step,e.c=s.min,i.c=s.max,3>n?2*n:n}function m(e,i,n){for(var a,o,r=i.c,s=(i.c-e.c)/n-1;r>e.c;)s=l(s+1,b),s=s.c*t(s.e),a=s*n,o=I(i.c/s)*s,r=o-a;var h=e.c-r,d=o-i.c,m=h-d;return m>1.1*s&&(m=w(m/s/2)*s,r+=m,o+=m),e.c=r,i.c=o,s}function c(e,n,a,o,r,s){var l=r.c-o.c,h=l/s*t(r.e);if(!i(h)&&(h=X(h),l=h*s,n-e>l&&(h+=1,l=h*s,!a&&h*(s-1)>=n-e&&(s-=1,l=h*s)),l>=n-e)){var d=l-(n-e);o.c=w(e-d/2),r.c=w(n+d/2),o.e=0,r.e=0}return s}function p(e,t,i){if(i=i||5,x)t=e+i;else if(k)e=t-i;else{var n=i-(t-e),o=w(e-n/2),r=w(t+n/2),s=V(e,t,o,r);e=s[0],t=s[1]}return a(e,t,i)}function u(e,t,i){i=i||5;var n=W.min(K(t/i),i)/2.1;return x?t=e+n:k?e=t-n:(e-=n,t+=n),h(e,t,i)}function V(e,t,i,n){return e>=0&&0>i?(n-=i,i=0):0>=t&&n>0&&(i-=n,n=0),[i,n]}function U(e){return e=(+e).toFixed(15).split("."),e.pop().replace(/0+$/,"").length}function g(e,t,i,n){if(x){var a=o(e,4,1);i.e-a.e>6&&(a={c:0,e:i.e}),s(i,a),s(n,a),n.c+=a.c-i.c,i.c=a.c}else if(k){var r=o(t,4);n.e-r.e>6&&(r={c:0,e:n.e}),s(i,r),s(n,r),i.c+=r.c-n.c,n.c=r.c}}function y(e,t,i){var n=i?[i]:_,s=t-e;if(0===s)return t=o(t,3),i=n[0],t.c=w(t.c+i/2),a(t.c-i,t.c,i,t.e);K(t/s)<1e-6&&(t=0),K(e/s)<1e-6&&(e=0);var l,h,d,m=[[5,10],[10,2],[50,10],[100,2]],c=[],p=[],u=o(t-e,3),V=o(e,-1,1),U=o(t,-1);r(V,u,1),r(U,u),s=U.c-V.c,u.c=s;for(var g=n.length;g--;){i=n[g],l=I(s/i),h=l*i-s,d=3*(h+3),d+=2*(i-n[0]+2),i%5===0&&(d-=10);for(var y=m.length;y--;)l%m[y][0]===0&&(d/=m[y][1]);p[g]=[i,l,h,d].join(),c[g]={secs:i,step:l,delta:h,score:d}}return c.sort(function(e,t){return e.score-t.score}),c=c[0],V.c=w(V.c-c.delta/2),U.c=w(U.c+c.delta/2),a(V.c,U.c,c.secs,u.e)}var f,b,_,x,k,L=[10,20,25,50],v=[4,5,6],W=Math,w=W.round,X=W.floor,I=W.ceil,K=W.abs;return n}); \ No newline at end of file diff --git a/build/echarts-2.1.10.zip b/build/echarts-2.1.10.zip new file mode 100644 index 0000000..4096a18 Binary files /dev/null and b/build/echarts-2.1.10.zip differ diff --git a/build/echarts-map.js b/build/echarts-map.js index c32969d..d3b87dd 100644 --- a/build/echarts-map.js +++ b/build/echarts-map.js @@ -1,30 +1,29 @@ -// Copyright 2006 Google Inc. - -// http://www.apache.org/licenses/LICENSE-2.0 - -// (c) 2010-2013 Thomas Fuchs - -// Zepto.js may be freely distributed under the MIT license. - -/*! - * ZRender, a lightweight canvas library with a MVC architecture, data-driven - * and provides an event model like DOM. - * - * Copyright (c) 2013, Baidu Inc. - * All rights reserved. - * - * LICENSE - * https://github.com/ecomfe/zrender/blob/master/LICENSE.txt - */ - -/*! - * ECharts, a javascript interactive chart library. - * - * Copyright (c) 2014, Baidu Inc. - * All rights reserved. - * - * LICENSE - * https://github.com/ecomfe/echarts/blob/master/LICENSE.txt - */ - -define("echarts/config",[],function(){var e={CHART_TYPE_LINE:"line",CHART_TYPE_BAR:"bar",CHART_TYPE_SCATTER:"scatter",CHART_TYPE_PIE:"pie",CHART_TYPE_RADAR:"radar",CHART_TYPE_MAP:"map",CHART_TYPE_K:"k",CHART_TYPE_ISLAND:"island",CHART_TYPE_FORCE:"force",CHART_TYPE_CHORD:"chord",CHART_TYPE_GAUGE:"gauge",CHART_TYPE_FUNNEL:"funnel",COMPONENT_TYPE_TITLE:"title",COMPONENT_TYPE_LEGEND:"legend",COMPONENT_TYPE_DATARANGE:"dataRange",COMPONENT_TYPE_DATAVIEW:"dataView",COMPONENT_TYPE_DATAZOOM:"dataZoom",COMPONENT_TYPE_TOOLBOX:"toolbox",COMPONENT_TYPE_TOOLTIP:"tooltip",COMPONENT_TYPE_GRID:"grid",COMPONENT_TYPE_AXIS:"axis",COMPONENT_TYPE_POLAR:"polar",COMPONENT_TYPE_X_AXIS:"xAxis",COMPONENT_TYPE_Y_AXIS:"yAxis",COMPONENT_TYPE_AXIS_CATEGORY:"categoryAxis",COMPONENT_TYPE_AXIS_VALUE:"valueAxis",COMPONENT_TYPE_TIMELINE:"timeline",backgroundColor:"rgba(0,0,0,0)",color:["#ff7f50","#87cefa","#da70d6","#32cd32","#6495ed","#ff69b4","#ba55d3","#cd5c5c","#ffa500","#40e0d0","#1e90ff","#ff6347","#7b68ee","#00fa9a","#ffd700","#6699FF","#ff6666","#3cb371","#b8860b","#30e0e0"],title:{text:"",subtext:"",x:"left",y:"top",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:5,textStyle:{fontSize:18,fontWeight:"bolder",color:"#333"},subtextStyle:{color:"#aaa"}},legend:{orient:"horizontal",x:"center",y:"top",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,itemWidth:20,itemHeight:14,textStyle:{color:"#333"},selectedMode:!0},dataRange:{orient:"vertical",x:"left",y:"bottom",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,itemWidth:20,itemHeight:14,precision:0,splitNumber:5,calculable:!1,realtime:!0,color:["#006edd","#e0ffff"],textStyle:{color:"#333"}},toolbox:{show:!1,orient:"horizontal",x:"right",y:"top",color:["#1e90ff","#22bb22","#4b0082","#d2691e"],disableColor:"#ddd",effectiveColor:"red",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,itemSize:16,showTitle:!0,feature:{mark:{show:!1,title:{mark:"辅助线开关",markUndo:"删除辅助线",markClear:"清空辅助线"},lineStyle:{width:1,color:"#1e90ff",type:"dashed"}},dataZoom:{show:!1,title:{dataZoom:"区域缩放",dataZoomReset:"区域缩放后退"}},dataView:{show:!1,title:"数据视图",readOnly:!1,lang:["Data View","close","refresh"]},magicType:{show:!1,title:{line:"折线图切换",bar:"柱形图切换",stack:"堆积",tiled:"平铺"},type:[]},restore:{show:!1,title:"还原"},saveAsImage:{show:!1,title:"保存为图片",type:"png",lang:["点击保存"]}}},tooltip:{show:!0,showContent:!0,trigger:"item",islandFormatter:"{a}
{b} : {c}",showDelay:20,hideDelay:100,transitionDuration:.4,backgroundColor:"rgba(0,0,0,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,axisPointer:{type:"line",lineStyle:{color:"#48b",width:2,type:"solid"},crossStyle:{color:"#1e90ff",width:1,type:"dashed"},shadowStyle:{color:"rgba(150,150,150,0.3)",width:"auto",type:"default"}},textStyle:{color:"#fff"}},dataZoom:{show:!1,orient:"horizontal",backgroundColor:"rgba(0,0,0,0)",dataBackgroundColor:"#eee",fillerColor:"rgba(144,197,237,0.2)",handleColor:"rgba(70,130,180,0.8)",realtime:!0},grid:{x:80,y:60,x2:80,y2:60,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},categoryAxis:{position:"bottom",name:"",nameLocation:"end",nameTextStyle:{},boundaryGap:!0,axisLine:{show:!0,onZero:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!0,interval:"auto",inside:!1,length:5,lineStyle:{color:"#333",width:1}},axisLabel:{show:!0,interval:"auto",rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}}},valueAxis:{position:"left",name:"",nameLocation:"end",nameTextStyle:{},boundaryGap:[0,0],precision:0,power:100,splitNumber:5,axisLine:{show:!0,onZero:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,inside:!1,length:5,lineStyle:{color:"#333",width:1}},axisLabel:{show:!0,rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}}},polar:{center:["50%","50%"],radius:"75%",startAngle:90,splitNumber:5,name:{show:!0,textStyle:{color:"#333"}},axisLine:{show:!0,lineStyle:{color:"#ccc",width:1,type:"solid"}},axisLabel:{show:!1,textStyle:{color:"#333"}},splitArea:{show:!0,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}},splitLine:{show:!0,lineStyle:{width:1,color:"#ccc"}},type:"polygon"},timeline:{show:!0,type:"time",notMerge:!1,realtime:!0,x:80,x2:80,y2:0,height:50,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,controlPosition:"left",autoPlay:!1,loop:!0,playInterval:2e3,lineStyle:{width:1,color:"#666",type:"dashed"},label:{show:!0,interval:"auto",rotate:0,textStyle:{color:"#333"}},checkpointStyle:{symbol:"auto",symbolSize:"auto",color:"auto",borderColor:"auto",borderWidth:"auto",label:{show:!1,textStyle:{color:"auto"}}},controlStyle:{normal:{color:"#333"},emphasis:{color:"#1e90ff"}},symbol:"emptyDiamond",symbolSize:4,currentIndex:0},bar:{xAxisIndex:0,yAxisIndex:0,barMinHeight:0,barGap:"30%",barCategoryGap:"20%",itemStyle:{normal:{borderColor:"#fff",borderRadius:0,borderWidth:0,label:{show:!1}},emphasis:{borderColor:"#fff",borderRadius:0,borderWidth:0,label:{show:!1}}}},line:{xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid",shadowColor:"rgba(0,0,0,0)",shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0}},emphasis:{label:{show:!1}}},symbolSize:2,showAllSymbol:!1},k:{xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{color:"#fff",color0:"#00aa11",lineStyle:{width:1,color:"#ff3200",color0:"#00aa11"}},emphasis:{}}},scatter:{xAxisIndex:0,yAxisIndex:0,symbolSize:4,large:!1,largeThreshold:2e3,itemStyle:{normal:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}},emphasis:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}}}},radar:{polarIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid"}},emphasis:{label:{show:!1}}},symbolSize:2},pie:{center:["50%","50%"],radius:[0,"75%"],clockWise:!0,startAngle:90,minAngle:0,selectedOffset:10,itemStyle:{normal:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1,type:"solid"}}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!1},labelLine:{show:!1,length:20,lineStyle:{width:1,type:"solid"}}}}},map:{mapType:"china",mapValuePrecision:0,showLegendSymbol:!0,hoverable:!0,itemStyle:{normal:{borderColor:"rgba(0,0,0,0)",borderWidth:1,areaStyle:{color:"#ccc"},label:{show:!1,textStyle:{color:"rgb(139,69,19)"}}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,areaStyle:{color:"rgba(255,215,0,0.8)"},label:{show:!1,textStyle:{color:"rgb(100,0,0)"}}}}},force:{center:["50%","50%"],size:"100%",coolDown:.99,minRadius:10,maxRadius:20,ratioScaling:!1,large:!1,useWorker:!1,steps:1,scaling:1,gravity:1,symbol:"circle",symbolSize:0,linkSymbol:null,linkSymbolSize:[10,15],draggable:!0,categories:[{}],itemStyle:{normal:{label:{show:!1},nodeStyle:{brushType:"both",color:"#f08c2e",strokeColor:"#5182ab",lineWidth:1},linkStyle:{strokeColor:"#5182ab"}},emphasis:{label:{show:!1},nodeStyle:{},linkStyle:{opacity:0}}}},chord:{radius:["65%","75%"],center:["50%","50%"],padding:2,sort:"none",sortSub:"none",startAngle:90,clockWise:!0,showScale:!1,showScaleText:!1,itemStyle:{normal:{label:{show:!0,rotate:!1,distance:10},lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:1,color:"#999"}}},emphasis:{lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:1,color:"#666"}}}},matrix:[]},gauge:{center:["50%","50%"],radius:"75%",startAngle:225,endAngle:-45,min:0,max:100,precision:0,splitNumber:10,axisLine:{show:!0,lineStyle:{color:[[.2,"#228b22"],[.8,"#48b"],[1,"#ff4500"]],width:30}},axisTick:{show:!0,splitNumber:5,length:8,lineStyle:{color:"#eee",width:1,type:"solid"}},axisLabel:{show:!0,textStyle:{color:"auto"}},splitLine:{show:!0,length:30,lineStyle:{color:"#eee",width:2,type:"solid"}},pointer:{show:!0,length:"80%",width:8,color:"auto"},title:{show:!0,offsetCenter:[0,"-40%"],textStyle:{color:"#333",fontSize:15}},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:40,offsetCenter:[0,"40%"],textStyle:{color:"auto",fontSize:30}}},funnel:{x:80,y:60,x2:80,y2:60,min:0,max:100,minSize:"0%",maxSize:"100%",sort:"descending",gap:0,itemStyle:{normal:{borderColor:"#fff",borderWidth:1,label:{show:!0,position:"outer"},labelLine:{show:!0,length:10,lineStyle:{width:1,type:"solid"}}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!0},labelLine:{show:!0}}}},island:{r:15,calculateStep:.1},markPoint:{symbol:"pin",symbolSize:10,large:!1,effect:{show:!1,loop:!0,period:15,scaleSize:2},itemStyle:{normal:{borderWidth:2,label:{show:!0,position:"inside"}},emphasis:{label:{show:!0}}}},markLine:{symbol:["circle","arrow"],symbolSize:[2,4],large:!1,effect:{show:!1,loop:!0,period:15,scaleSize:2},itemStyle:{normal:{borderWidth:1.5,label:{show:!0,position:"end"},lineStyle:{type:"dashed"}},emphasis:{label:{show:!1},lineStyle:{}}}},textStyle:{decoration:"none",fontFamily:"Arial, Verdana, sans-serif",fontFamily2:"微软雅黑",fontSize:12,fontStyle:"normal",fontWeight:"normal"},EVENT:{REFRESH:"refresh",RESTORE:"restore",RESIZE:"resize",CLICK:"click",HOVER:"hover",DATA_CHANGED:"dataChanged",DATA_ZOOM:"dataZoom",DATA_RANGE:"dataRange",LEGEND_SELECTED:"legendSelected",MAP_SELECTED:"mapSelected",PIE_SELECTED:"pieSelected",MAGIC_TYPE_CHANGED:"magicTypeChanged",DATA_VIEW_CHANGED:"dataViewChanged",TIMELINE_CHANGED:"timelineChanged",MAP_ROAM:"mapRoam",TOOLTIP_HOVER:"tooltipHover",TOOLTIP_IN_GRID:"tooltipInGrid",TOOLTIP_OUT_GRID:"tooltipOutGrid"},DRAG_ENABLE_TIME:120,EFFECT_ZLEVEL:7,symbolList:["circle","rectangle","triangle","diamond","emptyCircle","emptyRectangle","emptyTriangle","emptyDiamond"],loadingText:"Loading...",calculable:!1,calculableColor:"rgba(255,165,0,0.6)",calculableHolderColor:"#ccc",nameConnector:" & ",valueConnector:" : ",animation:!0,addDataAnimation:!0,animationThreshold:2e3,animationDuration:2e3,animationEasing:"ExponentialOut"};return e}),define("zrender/lib/excanvas",["require"],function(e){return document.createElement("canvas").getContext?G_vmlCanvasManager=!1:function(){function f(){return this.context_||(this.context_=new I(this))}function c(e,t,n){var r=l.call(arguments,2);return function(){return e.apply(t,r.concat(l.call(arguments)))}}function h(e){return String(e).replace(/&/g,"&").replace(/"/g,""")}function p(e,t,n){e.namespaces[t]||e.namespaces.add(t,n,"#default#VML")}function d(e){p(e,"g_vml_","urn:schemas-microsoft-com:vml"),p(e,"g_o_","urn:schemas-microsoft-com:office:office");if(!e.styleSheets.ex_canvas_){var t=e.createStyleSheet();t.owningElement.id="ex_canvas_",t.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}function m(e){var t=e.srcElement;switch(e.propertyName){case"width":t.getContext().clearRect(),t.style.width=t.attributes.width.nodeValue+"px",t.firstChild.style.width=t.clientWidth+"px";break;case"height":t.getContext().clearRect(),t.style.height=t.attributes.height.nodeValue+"px",t.firstChild.style.height=t.clientHeight+"px"}}function g(e){var t=e.srcElement;t.firstChild&&(t.firstChild.style.width=t.clientWidth+"px",t.firstChild.style.height=t.clientHeight+"px")}function E(){return[[1,0,0],[0,1,0],[0,0,1]]}function S(e,t){var n=E();for(var r=0;r<3;r++)for(var i=0;i<3;i++){var s=0;for(var o=0;o<3;o++)s+=e[r][o]*t[o][i];n[r][i]=s}return n}function x(e,t){t.fillStyle=e.fillStyle,t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY,t.strokeStyle=e.strokeStyle,t.globalAlpha=e.globalAlpha,t.font=e.font,t.textAlign=e.textAlign,t.textBaseline=e.textBaseline,t.arcScaleX_=e.arcScaleX_,t.arcScaleY_=e.arcScaleY_,t.lineScale_=e.lineScale_}function N(e){var t=e.indexOf("(",3),n=e.indexOf(")",t+1),r=e.substring(t+1,n).split(",");if(r.length!=4||e.charAt(3)!="a")r[3]=1;return r}function C(e){return parseFloat(e)/100}function k(e,t,n){return Math.min(n,Math.max(t,e))}function L(e){var t,n,r,i,s,o;i=parseFloat(e[0])/360%360,i<0&&i++,s=k(C(e[1]),0,1),o=k(C(e[2]),0,1);if(s==0)t=n=r=o;else{var u=o<.5?o*(1+s):o+s-o*s,a=2*o-u;t=A(a,u,i+1/3),n=A(a,u,i),r=A(a,u,i-1/3)}return"#"+y[Math.floor(t*255)]+y[Math.floor(n*255)]+y[Math.floor(r*255)]}function A(e,t,n){return n<0&&n++,n>1&&n--,6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function M(e){if(e in O)return O[e];var t,n=1;e=String(e);if(e.charAt(0)=="#")t=e;else if(/^rgb/.test(e)){var r=N(e),t="#",i;for(var s=0;s<3;s++)r[s].indexOf("%")!=-1?i=Math.floor(C(r[s])*255):i=+r[s],t+=y[k(i,0,255)];n=+r[3]}else if(/^hsl/.test(e)){var r=N(e);t=L(r),n=r[3]}else t=T[e]||e;return O[e]={color:t,alpha:n}}function P(e){if(D[e])return D[e];var t=document.createElement("div"),n=t.style,r;try{n.font=e,r=n.fontFamily.split(",")[0]}catch(i){}return D[e]={style:n.fontStyle||_.style,variant:n.fontVariant||_.variant,weight:n.fontWeight||_.weight,size:n.fontSize||_.size,family:r||_.family}}function H(e,t){var n={};for(var r in e)n[r]=e[r];var i=parseFloat(t.currentStyle.fontSize),s=parseFloat(e.size);return typeof e.size=="number"?n.size=e.size:e.size.indexOf("px")!=-1?n.size=s:e.size.indexOf("em")!=-1?n.size=i*s:e.size.indexOf("%")!=-1?n.size=i/100*s:e.size.indexOf("pt")!=-1?n.size=s/.75:n.size=i,n}function B(e){return e.style+" "+e.variant+" "+e.weight+" "+e.size+"px '"+e.family+"'"}function F(e){return j[e]||"square"}function I(e){this.m_=E(),this.mStack_=[],this.aStack_=[],this.currentPath_=[],this.strokeStyle="#000",this.fillStyle="#000",this.lineWidth=1,this.lineJoin="miter",this.lineCap="butt",this.miterLimit=o*1,this.globalAlpha=1,this.font="12px 微软雅黑",this.textAlign="left",this.textBaseline="alphabetic",this.canvas=e;var t="width:"+e.clientWidth+"px;height:"+e.clientHeight+"px;overflow:hidden;position:absolute",n=e.ownerDocument.createElement("div");n.style.cssText=t,e.appendChild(n);var r=n.cloneNode(!1);r.style.backgroundColor="#fff",r.style.filter="alpha(opacity=0)",e.appendChild(r),this.element_=n,this.arcScaleX_=1,this.arcScaleY_=1,this.lineScale_=1}function R(e,t,n,r){e.currentPath_.push({type:"bezierCurveTo",cp1x:t.x,cp1y:t.y,cp2x:n.x,cp2y:n.y,x:r.x,y:r.y}),e.currentX_=r.x,e.currentY_=r.y}function U(e,t){var n=M(e.strokeStyle),r=n.color,i=n.alpha*e.globalAlpha,s=e.lineScale_*e.lineWidth;s<1&&(i*=s),t.push("')}function z(t,n,r,i){var s=t.fillStyle,u=t.arcScaleX_,a=t.arcScaleY_,f=i.x-r.x,l=i.y-r.y;if(s instanceof $){var c=0,h={x:0,y:0},p=0,d=1;if(s.type_=="gradient"){var v=s.x0_/u,m=s.y0_/a,g=s.x1_/u,y=s.y1_/a,b=W(t,v,m),w=W(t,g,y),E=w.x-b.x,S=w.y-b.y;c=Math.atan2(E,S)*180/Math.PI,c<0&&(c+=360),c<1e-6&&(c=0)}else{var b=W(t,s.x0_,s.y0_);h={x:(b.x-r.x)/f,y:(b.y-r.y)/l},f/=u*o,l/=a*o;var x=e.max(f,l);p=2*s.r0_/x,d=2*s.r1_/x-p}var T=s.colors_;T.sort(function(e,t){return e.offset-t.offset});var N=T.length,C=T[0].color,k=T[N-1].color,L=T[0].alpha*t.globalAlpha,A=T[N-1].alpha*t.globalAlpha,O=[];for(var _=0;_')}else if(s instanceof J){if(f&&l){var P=-r.x,H=-r.y;n.push("')}}else{var B=M(t.fillStyle),j=B.color,F=B.alpha*t.globalAlpha;n.push('')}}function W(e,t,n){var r=e.m_;return{x:o*(t*r[0][0]+n*r[1][0]+r[2][0])-u,y:o*(t*r[0][1]+n*r[1][1]+r[2][1])-u}}function X(e){return isFinite(e[0][0])&&isFinite(e[0][1])&&isFinite(e[1][0])&&isFinite(e[1][1])&&isFinite(e[2][0])&&isFinite(e[2][1])}function V(e,t,n){if(!X(t))return;e.m_=t;if(n){var r=t[0][0]*t[1][1]-t[0][1]*t[1][0];e.lineScale_=s(i(r))}}function $(e){this.type_=e,this.x0_=0,this.y0_=0,this.r0_=0,this.x1_=0,this.y1_=0,this.r1_=0,this.colors_=[]}function J(e,t){Q(e);switch(t){case"repeat":case null:case"":this.repetition_="repeat";break;case"repeat-x":case"repeat-y":case"no-repeat":this.repetition_=t;break;default:K("SYNTAX_ERR")}this.src_=e.src,this.width_=e.width,this.height_=e.height}function K(e){throw new G(e)}function Q(e){(!e||e.nodeType!=1||e.tagName!="IMG")&&K("TYPE_MISMATCH_ERR"),e.readyState!="complete"&&K("INVALID_STATE_ERR")}function G(e){this.code=this[e],this.message=e+": DOM Exception "+this.code}var e=Math,t=e.round,n=e.sin,r=e.cos,i=e.abs,s=e.sqrt,o=10,u=o/2,a=+navigator.userAgent.match(/MSIE ([\d.]+)?/)[1],l=Array.prototype.slice;d(document);var v={init:function(e){var t=e||document;t.createElement("canvas"),t.attachEvent("onreadystatechange",c(this.init_,this,t))},init_:function(e){var t=e.getElementsByTagName("canvas");for(var n=0;n'),(f||l)&&w.push('
'),w.push('
'),(f||l)&&w.push("
"),w.push("
"),this.element_.insertAdjacentHTML("BeforeEnd",w.join(""))},q.stroke=function(e){var n=[],r=!1,i=10,s=10;n.push("f.x)f.x=c.x;if(a.y==null||c.yf.y)f.y=c.y}}n.push(' ">'),e?z(this,n,a,f):U(this,n),n.push(""),this.element_.insertAdjacentHTML("beforeEnd",n.join(""))},q.fill=function(){this.stroke(!0)},q.closePath=function(){this.currentPath_.push({type:"close"})},q.save=function(){var e={};x(this,e),this.aStack_.push(e),this.mStack_.push(this.m_),this.m_=S(E(),this.m_)},q.restore=function(){this.aStack_.length&&(x(this.aStack_.pop(),this),this.m_=this.mStack_.pop())},q.translate=function(e,t){var n=[[1,0,0],[0,1,0],[e,t,1]];V(this,S(n,this.m_),!1)},q.rotate=function(e){var t=r(e),i=n(e),s=[[t,i,0],[-i,t,0],[0,0,1]];V(this,S(s,this.m_),!1)},q.scale=function(e,t){this.arcScaleX_*=e,this.arcScaleY_*=t;var n=[[e,0,0],[0,t,0],[0,0,1]];V(this,S(n,this.m_),!0)},q.transform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,S(o,this.m_),!0)},q.setTransform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,o,!0)},q.drawText_=function(e,n,r,i,s){var u=this.m_,a=1e3,f=0,l=a,c={x:0,y:0},p=[],d=H(P(this.font),this.element_),v=B(d),m=this.element_.currentStyle,g=this.textAlign.toLowerCase();switch(g){case"left":case"center":case"right":break;case"end":g=m.direction=="ltr"?"right":"left";break;case"start":g=m.direction=="rtl"?"right":"left";break;default:g="left"}switch(this.textBaseline){case"hanging":case"top":c.y=d.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":c.y=-d.size/2.25}switch(g){case"right":f=a,l=.05;break;case"center":f=l=a/2}var y=W(this,n+c.x,r+c.y);p.push(''),s?U(this,p):z(this,p,{x:-f,y:0},{x:l,y:d.size});var b=u[0][0].toFixed(3)+","+u[1][0].toFixed(3)+","+u[0][1].toFixed(3)+","+u[1][1].toFixed(3)+",0,0",w=t(y.x/o)+","+t(y.y/o);p.push('','',''),this.element_.insertAdjacentHTML("beforeEnd",p.join(""))},q.fillText=function(e,t,n,r){this.drawText_(e,t,n,r,!1)},q.strokeText=function(e,t,n,r){this.drawText_(e,t,n,r,!0)},q.measureText=function(e){if(!this.textMeasureEl_){var t='';this.element_.insertAdjacentHTML("beforeEnd",t),this.textMeasureEl_=this.element_.lastChild}var n=this.element_.ownerDocument;return this.textMeasureEl_.innerHTML="",this.textMeasureEl_.style.font=this.font,this.textMeasureEl_.appendChild(n.createTextNode(e)),{width:this.textMeasureEl_.offsetWidth}},q.clip=function(){},q.arcTo=function(){},q.createPattern=function(e,t){return new J(e,t)},$.prototype.addColorStop=function(e,t){t=M(t),this.colors_.push({offset:e,color:t.color,alpha:t.alpha})};var Y=G.prototype=new Error;Y.INDEX_SIZE_ERR=1,Y.DOMSTRING_SIZE_ERR=2,Y.HIERARCHY_REQUEST_ERR=3,Y.WRONG_DOCUMENT_ERR=4,Y.INVALID_CHARACTER_ERR=5,Y.NO_DATA_ALLOWED_ERR=6,Y.NO_MODIFICATION_ALLOWED_ERR=7,Y.NOT_FOUND_ERR=8,Y.NOT_SUPPORTED_ERR=9,Y.INUSE_ATTRIBUTE_ERR=10,Y.INVALID_STATE_ERR=11,Y.SYNTAX_ERR=12,Y.INVALID_MODIFICATION_ERR=13,Y.NAMESPACE_ERR=14,Y.INVALID_ACCESS_ERR=15,Y.VALIDATION_ERR=16,Y.TYPE_MISMATCH_ERR=17,G_vmlCanvasManager=v,CanvasRenderingContext2D=I,CanvasGradient=$,CanvasPattern=J,DOMException=G}(),G_vmlCanvasManager}),define("zrender/tool/util",["require","../lib/excanvas"],function(e){function n(e){if(typeof e=="object"&&e!==null){var r=e;if(e instanceof Array){r=[];for(var i=0,s=e.length;if&&(f=e+c+n,u.width=f,r=!0),t+h>l&&(l=t+h+n,u.height=l,r=!0),e<-c&&(c=Math.ceil(-e/n)*n,f+=c,u.width=f,r=!0),t<-h&&(h=Math.ceil(-t/n)*n,l+=h,u.height=l,r=!0),r&&a.translate(c,h)}function v(){return{x:c,y:h}}function m(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n3&&(t=Array.prototype.slice.call(t,1));if(this._handlers[e]){var r=this._handlers[e],i=r.length;for(var s=0;s4&&(t=Array.prototype.slice.call(t,1,t.length-1));var r=t[t.length-1];if(this._handlers[e]){var i=this._handlers[e],s=i.length;for(var o=0;o1)for(var e in arguments)console.log(arguments[e])}}),define("zrender/tool/guid",[],function(){var e=2311;return function(){return"zrender__"+e++}}),define("zrender/Handler",["require","./config","./tool/env","./tool/event","./tool/util"],function(e){function a(e,t){return function(n){return e.call(t,n)}}function f(e){var t=o.length;while(t--){var n=o[t];e["_"+n+"Handler"]=a(u[n],e)}}function l(e,t,i){r.Dispatcher.call(this),this.root=e,this.storage=t,this.painter=i,this._lastX=this._lastY=this._mouseX=this._mouseY=0,this._findHover=a(h,this),this._domHover=i.getDomHover(),f(this),window.addEventListener?(window.addEventListener("resize",this._resizeHandler),n.os.tablet||n.os.phone?(e.addEventListener("touchstart",this._touchstartHandler),e.addEventListener("touchmove",this._touchmoveHandler),e.addEventListener("touchend",this._touchendHandler)):(e.addEventListener("click",this._clickHandler),e.addEventListener("mousewheel",this._mousewheelHandler),e.addEventListener("mousemove",this._mousemoveHandler),e.addEventListener("mousedown",this._mousedownHandler),e.addEventListener("mouseup",this._mouseupHandler)),e.addEventListener("DOMMouseScroll",this._mousewheelHandler),e.addEventListener("mouseout",this._mouseoutHandler)):(window.attachEvent("onresize",this._resizeHandler),e.attachEvent("onclick",this._clickHandler),e.attachEvent("onmousewheel",this._mousewheelHandler),e.attachEvent("onmousemove",this._mousemoveHandler),e.attachEvent("onmouseout",this._mouseoutHandler),e.attachEvent("onmousedown",this._mousedownHandler),e.attachEvent("onmouseup",this._mouseupHandler))}function h(e){if(this._draggingTarget&&this._draggingTarget.id==e.id||e.isSilent())return!1;var t=this._event;if(e.isCover(this._mouseX,this._mouseY)){e.hoverable&&this.storage.addHover(e);var n=e.parent;while(n){if(n.clipShape&&!n.clipShape.isCover(this._mouseX,this._mouseY))return!1;n=n.parent}return this._lastHover!=e&&(this._processOutShape(t),this._processDragLeave(t),this._lastHover=e,this._processDragEnter(t)),this._processOverShape(t),this._processDragOver(t),this._hasfound=1,!0}return!1}var t=e("./config"),n=e("./tool/env"),r=e("./tool/event"),i=e("./tool/util"),s=t.EVENT,o=["resize","click","mousewheel","mousemove","mouseout","mouseup","mousedown","touchstart","touchend","touchmove"],u={resize:function(e){e=e||window.event,this._lastHover=null,this._isMouseDown=0,this.dispatch(s.RESIZE,e)},click:function(e){e=this._zrenderEventFixed(e);var t=this._lastHover;(t&&t.clickable||!t)&&this._dispatchAgency(t,s.CLICK,e),this._mousemoveHandler(e)},mousewheel:function(e){e=this._zrenderEventFixed(e),this._dispatchAgency(this._lastHover,s.MOUSEWHEEL,e),this._mousemoveHandler(e)},mousemove:function(e){if(this.painter.isLoading())return;e=this._zrenderEventFixed(e),this._lastX=this._mouseX,this._lastY=this._mouseY,this._mouseX=r.getX(e),this._mouseY=r.getY(e),this._processDragStart(e),this._hasfound=0,this._event=e,this.storage.iterShape(this._findHover,{normal:"down"});if(!this._hasfound){if(!this._draggingTarget||this._lastHover&&this._lastHover!=this._draggingTarget)this._processOutShape(e),this._processDragLeave(e);this._lastHover=null,this.storage.delHover(),this.painter.clearHover()}this._draggingTarget&&(this.storage.drift(this._draggingTarget.id,this._mouseX-this._lastX,this._mouseY-this._lastY),this.storage.addHover(this._draggingTarget));var t="default";this._draggingTarget||this._hasfound&&this._lastHover.draggable?t="move":this._hasfound&&this._lastHover.clickable&&(t="pointer"),this.root.style.cursor=t,this._dispatchAgency(this._lastHover,s.MOUSEMOVE,e),(this._draggingTarget||this._hasfound||this.storage.hasHoverShape())&&this.painter.refreshHover()},mouseout:function(e){e=this._zrenderEventFixed(e);var t=e.toElement||e.relatedTarget;if(t!=this.root)while(t&&t.nodeType!=9){if(t==this.root){this._mousemoveHandler(e);return}t=t.parentNode}e.zrenderX=this._lastX,e.zrenderY=this._lastY,this.root.style.cursor="default",this._isMouseDown=0,this._processOutShape(e),this._processDrop(e),this._processDragEnd(e),this.painter.isLoading()||this.painter.refreshHover(),this.dispatch(s.GLOBALOUT,e)},mousedown:function(e){if(this._lastDownButton==2){this._lastDownButton=e.button,this._mouseDownTarget=null;return}this._lastMouseDownMoment=new Date,e=this._zrenderEventFixed(e),this._isMouseDown=1,this._mouseDownTarget=this._lastHover,this._dispatchAgency(this._lastHover,s.MOUSEDOWN,e),this._lastDownButton=e.button},mouseup:function(e){e=this._zrenderEventFixed(e),this.root.style.cursor="default",this._isMouseDown=0,this._mouseDownTarget=null,this._dispatchAgency(this._lastHover,s.MOUSEUP,e),this._processDrop(e),this._processDragEnd(e)},touchstart:function(e){e=this._zrenderEventFixed(e,!0),this._lastTouchMoment=new Date,this._mobildFindFixed(e),this._mousedownHandler(e)},touchmove:function(e){e=this._zrenderEventFixed(e,!0),this._mousemoveHandler(e),this._isDragging&&r.stop(e)},touchend:function(e){e=this._zrenderEventFixed(e,!0),this._mouseupHandler(e),new Date-this._lastTouchMoment1e-4||Math.abs(this.position[0])>1e-4||Math.abs(this.position[1])>1e-4||Math.abs(this.scale[0]-1)>1e-4||Math.abs(this.scale[1]-1)>1e-4},updateTransform:function(){this.updateNeedTransform(),this.parent?this.needTransform=this.needLocalTransform||this.parent.needTransform:this.needTransform=this.needLocalTransform;if(!this.needTransform)return;var e=this.transform||t.create();t.identity(e);if(this.needLocalTransform){if(this.scale&&(this.scale[0]!==1||this.scale[1]!==1)){n[0]=-this.scale[2]||0,n[1]=-this.scale[3]||0,(n[0]||n[1])&&t.translate(e,e,n),t.scale(e,e,this.scale);if(n[0]||n[1])n[0]=-n[0],n[1]=-n[1],t.translate(e,e,n)}if(this.rotation)if(this.rotation instanceof Array){if(this.rotation[0]!==0){n[0]=-this.rotation[1]||0,n[1]=-this.rotation[2]||0,(n[0]||n[1])&&t.translate(e,e,n),t.rotate(e,e,this.rotation[0]);if(n[0]||n[1])n[0]=-n[0],n[1]=-n[1],t.translate(e,e,n)}}else this.rotation!==0&&t.rotate(e,e,this.rotation);this.position&&(this.position[0]!==0||this.position[1]!==0)&&t.translate(e,e,this.position)}this.transform=e,this.parent&&this.parent.needTransform&&(this.needLocalTransform?t.mul(this.transform,this.parent.transform,this.transform):t.copy(this.transform,this.parent.transform))},setTransform:function(e){if(this.needTransform){var t=this.transform;e.transform(t[0],t[1],t[2],t[3],t[4],t[5])}}},r}),define("zrender/tool/color",["require","../tool/util"],function(e){function f(e){r=e}function l(){r=i}function c(e,t){return e|=0,t=t||r,t[e%t.length]}function h(e){s=e}function p(){o=s}function d(){return s}function v(e,r,i,s,o,u,a){n||(n=t.getContext());var f=n.createRadialGradient(e,r,i,s,o,u);for(var l=0,c=a.length;l1)for(var i=0,s=r-1;i1?Math.ceil(e):e});if(t.indexOf("hex")>-1)return"#"+((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1);if(t.indexOf("hs")>-1){var n=q(e.slice(1,3),function(e){return e+"%"});e[1]=n[0],e[2]=n[1]}return t.indexOf("a")>-1?(e.length===3&&e.push(1),e[3]=R(e[3],[0,1]),t+"("+e.slice(0,4).join(",")+")"):t+"("+e.slice(0,3).join(",")+")"}}function w(e){e=_(e),e.indexOf("rgba")<0&&(e=S(e));var t=[],n=0;return e.replace(/[\d.]+/g,function(e){n<3?e|=0:e=+e,t[n++]=e}),t}function E(e,t){var n=F(e),r=n[3];return typeof r=="undefined"&&(r=1),e.indexOf("hsb")>-1?n=U(n):e.indexOf("hsl")>-1&&(n=z(n)),t.indexOf("hsb")>-1||t.indexOf("hsv")>-1?n=X(n):t.indexOf("hsl")>-1&&(n=V(n)),n[3]=r,b(n,t)}function S(e){return E(e,"rgba")}function x(e){return E(e,"rgb")}function T(e){return E(e,"hex")}function N(e){return E(e,"hsva")}function C(e){return E(e,"hsv")}function k(e){return E(e,"hsba")}function L(e){return E(e,"hsb")}function A(e){return E(e,"hsla")}function O(e){return E(e,"hsl")}function M(e){for(var t in a)if(T(a[t])===T(e))return t;return null}function _(e){return String(e).replace(/\s+/g,"")}function D(e){a[e]&&(e=a[e]),e=_(e),e=e.replace(/hsv/i,"hsb");if(/^#[\da-f]{3}$/i.test(e)){e=parseInt(e.slice(1),16);var t=(e&3840)<<8,n=(e&240)<<4,r=e&15;e="#"+((1<<24)+(t<<4)+t+(n<<4)+n+(r<<4)+r).toString(16).slice(1)}return e}function P(e,t){var n=t>0?1:-1;typeof t=="undefined"&&(t=0),t=Math.abs(t)>1?1:Math.abs(t),e=x(e);var r=F(e);for(var i=0;i<3;i++)n===1?r[i]=r[i]*(1-t)|0:r[i]=(255-r[i])*t+r[i]|0;return"rgb("+r.join(",")+")"}function H(e){var t=F(S(e));return t=q(t,function(e){return 255-e}),b(t,"rgb")}function B(e,t,n){typeof n=="undefined"&&(n=.5),n=1-R(n,[0,1]);var r=n*2-1,i=F(S(e)),s=F(S(t)),o=i[3]-s[3],u=((r*o===-1?r:(r+o)/(1+r*o))+1)/2,a=1-u,f=[];for(var l=0;l<3;l++)f[l]=i[l]*u+s[l]*a;var c=i[3]*n+s[3]*(1-n);return c=Math.max(0,Math.min(1,c)),i[3]===1&&s[3]===1?b(f,"rgb"):(f[3]=c,b(f,"rgba"))}function j(){return"#"+Math.random().toString(16).slice(2,8)}function F(e){e=D(e);var t=e.match(u);if(t===null)throw new Error("The color format error");var n,r,i=[],s;if(t[2])n=t[2].replace("#","").split(""),s=[n[0]+n[1],n[2]+n[3],n[4]+n[5]],i=q(s,function(e){return R(parseInt(e,16),[0,255])});else if(t[4]){var o=t[4].split(",");r=o[3],s=o.slice(0,3),i=q(s,function(e){return e=Math.floor(e.indexOf("%")>0?parseInt(e,0)*2.55:e),R(e,[0,255])}),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}else if(t[5]||t[6]){var a=(t[5]||t[6]).split(","),f=parseInt(a[0],0)/360,l=a[1],c=a[2];r=a[3],i=q([l,c],function(e){return R(parseFloat(e)/100,[0,1])}),i.unshift(f),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}return i}function I(e,t){t===null&&(t=1);var n=F(S(e));return n[3]=R(Number(t).toFixed(4),[0,1]),b(n,"rgba")}function q(e,t){if(typeof t!="function")throw new TypeError;var n=e?e.length:0;for(var r=0;r=t[1]&&(e=t[1]),e}function U(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u=t*6;u===6&&(u=0);var a=u|0,f=r*(1-n),l=r*(1-n*(u-a)),c=r*(1-n*(1-(u-a))),h=0,p=0,d=0;a===0?(h=r,p=c,d=f):a===1?(h=l,p=r,d=f):a===2?(h=f,p=r,d=c):a===3?(h=f,p=l,d=r):a===4?(h=c,p=f,d=r):(h=r,p=f,d=l),i=h*255,s=p*255,o=d*255}return[i,s,o]}function z(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u;r<.5?u=r*(1+n):u=r+n-n*r;var a=2*r-u;i=255*W(a,u,t+1/3),s=255*W(a,u,t),o=255*W(a,u,t-1/3)}return[i,s,o]}function W(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function X(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=s,a,f;if(o===0)a=0,f=0;else{f=o/s;var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}function V(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=(s+i)/2,a,f;if(o===0)a=0,f=0;else{u<.5?f=o/(s+i):f=o/(2-s-i);var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}var t=e("../tool/util"),n,r=["#ff9277"," #dddd00"," #ffc877"," #bbe3ff"," #d5ffbb","#bbbbff"," #ddb000"," #b0dd00"," #e2bbff"," #ffbbe3","#ff7777"," #ff9900"," #83dd00"," #77e3ff"," #778fff","#c877ff"," #ff77ab"," #ff6600"," #aa8800"," #77c7ff","#ad77ff"," #ff77ff"," #dd0083"," #777700"," #00aa00","#0088aa"," #8400dd"," #aa0088"," #dd0000"," #772e00"],i=r,s="rgba(255,255,0,0.5)",o=s,u=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,a={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#789",lightslategrey:"#789",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#f0f",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"};return{customPalette:f,resetPalette:l,getColor:c,getHighlightColor:d,customHighlight:h,resetHighlight:p,getRadialGradient:v,getLinearGradient:m,getGradientColors:y,getStepColors:g,reverse:H,mix:B,lift:P,trim:_,random:j,toRGB:x,toRGBA:S,toHex:T,toHSL:O,toHSLA:A,toHSB:L,toHSBA:k,toHSV:C,toHSVA:N,toName:M,toColor:b,toArray:w,alpha:I,getData:F}}),define("zrender/shape/Base",["require","../tool/matrix","../tool/guid","../tool/util","./mixin/Transformable","../tool/event","../tool/area","../tool/area","../tool/color","../tool/area"],function(e){function o(t,n,r,i,s,o,a){s&&(t.font=s),t.textAlign=o,t.textBaseline=a;var f=u(n,r,i,s,o,a);n=(n+"").split("\n");var l=e("../tool/area").getTextHeight("国",s);switch(a){case"top":i=f.y;break;case"bottom":i=f.y+l;break;default:i=f.y+l/2}for(var c=0,h=n.length;c0&&e.stroke();break;default:e.fill()}this.drawText(e,n,this.style),e.restore()};var f=[["color","fillStyle"],["strokeColor","strokeStyle"],["opacity","globalAlpha"],["lineCap","lineCap"],["lineJoin","lineJoin"],["miterLimit","miterLimit"],["lineWidth","lineWidth"],["shadowBlur","shadowBlur"],["shadowColor","shadowColor"],["shadowOffsetX","shadowOffsetX"],["shadowOffsetY","shadowOffsetY"]];return a.prototype.setContext=function(e,t){for(var n=0,r=f.length;n=i.x&&t<=i.x+i.width&&n>=i.y&&n<=i.y+i.height?e("../tool/area").isInside(this,this.style,t,n):!1},a.prototype.drawText=function(e,t,n){if(typeof t.text=="undefined"||t.text===!1)return;var r=t.textColor||t.color||t.strokeColor;e.fillStyle=r;var i=10,s,u,a,f,l=t.textPosition||this.textPosition||"top";switch(l){case"inside":case"top":case"bottom":case"left":case"right":if(this.getRect){var c=(n||t).__rect||this.getRect(n||t);switch(l){case"inside":a=c.x+c.width/2,f=c.y+c.height/2,s="center",u="middle",t.brushType!="stroke"&&r==t.color&&(e.fillStyle="#fff");break;case"left":a=c.x-i,f=c.y+c.height/2,s="end",u="middle";break;case"right":a=c.x+c.width+i,f=c.y+c.height/2,s="start",u="middle";break;case"top":a=c.x+c.width/2,f=c.y-i,s="center",u="bottom";break;case"bottom":a=c.x+c.width/2,f=c.y+c.height+i,s="center",u="top"}}break;case"start":case"end":var h,p,d,v;if(typeof t.pointList!="undefined"){var m=t.pointList;if(m.length<2)return;var g=m.length;switch(l){case"start":h=m[0][0],p=m[1][0],d=m[0][1],v=m[1][1];break;case"end":h=m[g-2][0],p=m[g-1][0],d=m[g-2][1],v=m[g-1][1]}}else h=t.xStart||0,p=t.xEnd||0,d=t.yStart||0,v=t.yEnd||0;switch(l){case"start":s=h0&&l[0]===""&&l.shift();for(var c=0;c0){if(isNaN(l[0]))break;var h=null,p=[],d,v,m,g,y,b,w,E,S=o,x=u;switch(f){case"l":o+=l.shift(),u+=l.shift(),h="L",p.push(o,u);break;case"L":o=l.shift(),u=l.shift(),p.push(o,u);break;case"m":o+=l.shift(),u+=l.shift(),h="M",p.push(o,u),f="l";break;case"M":o=l.shift(),u=l.shift(),h="M",p.push(o,u),f="L";break;case"h":o+=l.shift(),h="L",p.push(o,u);break;case"H":o=l.shift(),h="L",p.push(o,u);break;case"v":u+=l.shift(),h="L",p.push(o,u);break;case"V":u=l.shift(),h="L",p.push(o,u);break;case"C":p.push(l.shift(),l.shift(),l.shift(),l.shift()),o=l.shift(),u=l.shift(),p.push(o,u);break;case"c":p.push(o+l.shift(),u+l.shift(),o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="C",p.push(o,u);break;case"S":d=o,v=u,m=s[s.length-1],m.command==="C"&&(d=o+(o-m.points[2]),v=u+(u-m.points[3])),p.push(d,v,l.shift(),l.shift()),o=l.shift(),u=l.shift(),h="C",p.push(o,u);break;case"s":d=o,v=u,m=s[s.length-1],m.command==="C"&&(d=o+(o-m.points[2]),v=u+(u-m.points[3])),p.push(d,v,o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="C",p.push(o,u);break;case"Q":p.push(l.shift(),l.shift()),o=l.shift(),u=l.shift(),p.push(o,u);break;case"q":p.push(o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="Q",p.push(o,u);break;case"T":d=o,v=u,m=s[s.length-1],m.command==="Q"&&(d=o+(o-m.points[0]),v=u+(u-m.points[1])),o=l.shift(),u=l.shift(),h="Q",p.push(d,v,o,u);break;case"t":d=o,v=u,m=s[s.length-1],m.command==="Q"&&(d=o+(o-m.points[0]),v=u+(u-m.points[1])),o+=l.shift(),u+=l.shift(),h="Q",p.push(d,v,o,u);break;case"A":g=l.shift(),y=l.shift(),b=l.shift(),w=l.shift(),E=l.shift(),S=o,x=u,o=l.shift(),u=l.shift(),h="A",p=this._convertPoint(S,x,o,u,w,E,g,y,b);break;case"a":g=l.shift(),y=l.shift(),b=l.shift(),w=l.shift(),E=l.shift(),S=o,x=u,o+=l.shift(),u+=l.shift(),h="A",p=this._convertPoint(S,x,o,u,w,E,g,y,b)}s.push({command:h||f,points:p})}(f==="z"||f==="Z")&&s.push({command:"z",points:[]})}return s},_convertPoint:function(e,t,n,r,i,s,o,u,a){var f=a*(Math.PI/180),l=Math.cos(f)*(e-n)/2+Math.sin(f)*(t-r)/2,c=-1*Math.sin(f)*(e-n)/2+Math.cos(f)*(t-r)/2,h=l*l/(o*o)+c*c/(u*u);h>1&&(o*=Math.sqrt(h),u*=Math.sqrt(h));var p=Math.sqrt((o*o*u*u-o*o*c*c-u*u*l*l)/(o*o*c*c+u*u*l*l));i===s&&(p*=-1),isNaN(p)&&(p=0);var d=p*o*c/u,v=p*-u*l/o,m=(e+n)/2+Math.cos(f)*d-Math.sin(f)*v,g=(t+r)/2+Math.sin(f)*d+Math.cos(f)*v,y=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},b=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(y(e)*y(t))},w=function(e,t){return(e[0]*t[1]=1&&(T=0),s===0&&T>0&&(T-=2*Math.PI),s===1&&T<0&&(T+=2*Math.PI),[m,g,o,u,E,T,f,s]},buildPath:function(e,t){var n=t.path,r=this.pathArray||this._parsePathData(n),i=t.x||0,s=t.y||0,o,u=t.pointList=[],a=[];for(var f=0,l=r.length;f0&&u.push(a),a=[]),o=r[f].points;for(var c=0,h=o.length;c0&&u.push(a);var p;for(var f=0,l=r.length;fg?m:g,x=m>g?1:m/g,T=m>g?g/m:1;e.translate(d,v),e.rotate(w),e.scale(x,T),e.arc(0,0,S,y,y+b,1-E),e.scale(1/x,1/T),e.rotate(-w),e.translate(-d,-v);break;case"z":e.closePath()}}return},getRect:function(e){if(e.__rect)return e.__rect;var t;e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0;var n=Number.MAX_VALUE,r=Number.MIN_VALUE,i=Number.MAX_VALUE,s=Number.MIN_VALUE,o=e.x||0,u=e.y||0,a=this.pathArray||this._parsePathData(e.path);for(var f=0;fr&&(r=l[c]+o)):(l[c]+us&&(s=l[c]+u))}var h;return n===Number.MAX_VALUE||r===Number.MIN_VALUE||i===Number.MAX_VALUE||s===Number.MIN_VALUE?h={x:0,y:0,width:0,height:0}:h={x:Math.round(n-t/2),y:Math.round(i-t/2),width:r-n+t,height:s-i+t},e.__rect=h,h}},e("../tool/util").inherits(n,t),n}),define("zrender/tool/area",["require","../tool/util","../shape/Path"],function(e){function a(e,r,i,s){if(!r||!e)return!1;var o=e.type;n=n||t.getContext();if(!g(r.__rect||e.getRect(r),i,s))return!1;var u=f(o,r,i,s);if(typeof u!="undefined")return u;if(o!="bezier-curve"&&e.buildPath&&n.isPointInPath)return l(e,n,r,i,s);if(n.getImageData)return c(e,r,i,s);switch(o){case"heart":case"droplet":case"ellipse":return!0;case"trochoid":var a=r.location=="out"?r.r1+r.r2+r.d:r.r1-r.r2+r.d;return y(r,i,s,a);case"rose":return y(r,i,s,r.maxr);default:return!1}}function f(e,t,n,r){switch(e){case"line":return d(t,n,r);case"broken-line":return v(t,n,r);case"text":return!0;case"ring":return m(t,n,r);case"rectangle":return!0;case"circle":return y(t,n,r,t.r);case"sector":return b(t,n,r);case"path":return E(t,n,r);case"polygon":case"star":case"isogon":return w(t,n,r);case"image":return!0}}function l(e,t,n,r,i){return t.beginPath(),e.buildPath(t,n),t.closePath(),t.isPointInPath(r,i)}function c(e,n,r,i){var s=n.__rect||e.getRect(n),o=t.getPixelContext(),u=t.getPixelOffset();return t.adjustCanvasSize(r,i),o.clearRect(s.x,s.y,s.width,s.height),o.beginPath(),e.brush(o,{style:n}),o.closePath(),h(o,r+u.x,i+u.y)}function h(e,t,n,r){var i;typeof r!="undefined"?(r=(r||1)>>1,i=e.getImageData(t-r,n-r,r+r,r+r).data):i=e.getImageData(t,n,1,1).data;var s=i.length;while(s--)if(i[s]!==0)return!0;return!1}function p(e,t,n,r){return!a(e,t,n,r)}function d(e,t,n){var r=e.xStart,i=e.yStart,s=e.xEnd,o=e.yEnd,u=Math.max(e.lineWidth,5),a=0,f=r,l,c;rc||np)return!1;if(r===s)return Math.abs(t-r)<=u/2;a=(i-o)/(r-s),f=(r*o-s*i)/(r-s);var d=(a*t-n+f)*(a*t-n+f)/(a*a+1);return d<=u/2*u/2}function v(e,t,n){var r=e.pointList,i={xStart:0,yStart:0,xEnd:0,yEnd:0,lineWidth:0};for(var s=0,o=r.length-1;s=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function y(e,t,n,r){return(t-e.x)*(t-e.x)+(n-e.y)*(n-e.y)0&&y({x:e.x,y:e.y},t,n,e.r0))return!1;if(Math.abs(e.endAngle-e.startAngle)>=360)return!0;var r=(360-Math.atan2(n-e.y,t-e.x)/Math.PI*180)%360,i=(360+e.endAngle)%360,s=(360+e.startAngle)%360;return i>s?r>=s&&r<=i:!(r>=i&&r<=s)}function w(e,t,n){var r,i,s=e.pointList,o=s.length,u=!1,a=!0,f;for(r=0;rs[i][1]?--n:++n;break}}else if(s[r][1]==s[i][1]&&n==s[r][1]&&(s[r][0]u&&(s=0,r={}),a}function x(e,r){var s=e+":"+r;if(i[s])return i[s];n=n||t.getContext(),n.save(),r&&(n.font=r),e=(e+"").split("\n");var a=(n.measureText("国").width+2)*e.length;return n.restore(),i[s]=a,++o>u&&(o=0,i={}),a}var t=e("../tool/util"),n,r={},i={},s=0,o=0,u=2e4;return{isInside:a,isOutside:p,getTextWidth:S,getTextHeight:x}}),define("zrender/shape/Text",["require","../tool/area","./Base","../tool/util"],function(e){function r(e){n.call(this,e)}var t=e("../tool/area"),n=e("./Base");return r.prototype={type:"text",brush:function(e,n){var r=this.style;n&&(r=this.getHighlightStyle(r,this.highlightStyle||{}));if(typeof r.text=="undefined"||r.text===!1)return;e.save(),this.setContext(e,r),this.setTransform(e),r.textFont&&(e.font=r.textFont),e.textAlign=r.textAlign||"start",e.textBaseline=r.textBaseline||"middle";var i=(r.text+"").split("\n"),s=t.getTextHeight("国",r.textFont),o=this.getRect(r),u=r.x,a;r.textBaseline=="top"?a=o.y:r.textBaseline=="bottom"?a=o.y+s:a=o.y+s/2;for(var f=0,l=i.length;f=t[1]&&(e=t[1]),e},o}),define("zrender/shape/Image",["require","./Base","../tool/util"],function(e){function s(e){i.call(this,e)}var t={},n=[],r,i=e("./Base");return s.prototype={type:"image",brush:function(e,i,s){var o=this.style||{};i&&(o=this.getHighlightStyle(o,this.highlightStyle||{}));var u=o.image,a=this;if(typeof u=="string"){var f=u;t[f]?u=t[f]:(u=new Image,u.onload=function(){u.onload=null,clearTimeout(r),n.push(a),r=setTimeout(function(){s&&s(n),n=[]},10)},t[f]=u,u.src=f)}if(u){if(u.nodeName.toUpperCase()=="IMG")if(window.ActiveXObject){if(u.readyState!="complete")return}else if(!u.complete)return;var l=o.width||u.width,c=o.height||u.height,h=o.x,p=o.y;if(!u.width||!u.height)return;e.save(),this.setContext(e,o),this.setTransform(e);if(o.sWidth&&o.sHeight){var d=o.sx||0,v=o.sy||0;e.drawImage(u,d,v,o.sWidth,o.sHeight,h,p,l,c)}else if(o.sx&&o.sy){var d=o.sx,v=o.sy,m=l-d,g=c-v;e.drawImage(u,d,v,m,g,h,p,l,c)}else e.drawImage(u,h,p,l,c);o.width=l,o.height=c,this.style.width=l,this.style.height=c,this.drawText(e,o,this.style),e.restore()}},buildPath:function(e,t){e.rect(t.x,t.y,t.width,t.height);return},getRect:function(e){return{x:e.x,y:e.y,width:e.width,height:e.height}}},e("../tool/util").inherits(s,i),s}),define("zrender/Painter",["require","./config","./tool/util","./tool/log","./tool/matrix","./loadingEffect/Base","./shape/Image"],function(e){function a(){return!1}function f(){}function l(e,t){this.root=e,this.storage=t,e.innerHTML="",this._width=this._getWidth(),this._height=this._getHeight();var n=document.createElement("div");this._domRoot=n,n.style.position="relative",n.style.overflow="hidden",n.style.width=this._width+"px",n.style.height=this._height+"px",e.appendChild(n),this._layers={},this._layerConfig={},this._loadingEffect=new s({}),this.shapeToImage=this._createShapeToImageProcessor(),this._bgDom=c("bg","div",this),n.appendChild(this._bgDom);var r=new h("_zrender_hover_",this);this._layers.hover=r,n.appendChild(r.dom),r.initContext(),r.onselectstart=a;var i=this;this.updatePainter=function(e,t){i.update(e,t)}}function c(e,t,n){var r=document.createElement(t),i=n._width,s=n._height;return r.style.position="absolute",r.style.left=0,r.style.top=0,r.style.width=i+"px",r.style.height=s+"px",r.setAttribute("width",i*o),r.setAttribute("height",s*o),r.setAttribute("data-zr-dom-id",e),r}function h(e,t){this.dom=c(e,"canvas",t),u&&u.initElement(this.dom),this.domBack=null,this.ctxBack=null,this.painter=t,this.unusedCount=0,this.config=null,this.dirty=!0,this.elCount=0}var t=e("./config"),n=e("./tool/util"),r=e("./tool/log"),i=e("./tool/matrix"),s=e("./loadingEffect/Base"),o=window.devicePixelRatio||1;o=Math.max(o,1);var u=window.G_vmlCanvasManager;return l.prototype.render=function(e){return this.isLoading()&&this.hideLoading(),this.refresh(e,!0),this},l.prototype.refresh=function(e,t){var n=this.storage.getShapeList(!0);return this._paintList(n,t),typeof e=="function"&&e(),this},l.prototype._paintList=function(e,n){typeof n=="undefined"&&(n=!1),this._updateLayerStatus(e);var s,o,a;for(var f in this._layers)f!=="hover"&&this._layers[f].unusedCount++;var l=[];for(var c=0,h=e.length;c=500?(delete this._layers[f],g.dom.parentNode.removeChild(g.dom)):g.unusedCount==1&&g.clear()}},l.prototype.getLayer=function(e,t){var n=this._layers[e];if(!n){n=new h(e,this);var r=t?t.dom:this._bgDom;r.nextSibling?r.parentNode.insertBefore(n.dom,r.nextSibling):r.parentNode.appendChild(n.dom),n.initContext(),this._layers[e]=n,n.config=this._layerConfig[e]}return n},l.prototype._updateLayerStatus=function(e){var t=this._layers,n={};for(var r in t)r!=="hover"&&(n[r]=t[r].elCount,t[r].elCount=0);for(var i=0,s=e.length;i0},s.prototype.addRoot=function(e){e instanceof n&&e.addChildrenToStorage(this),this.addToMap(e),this._roots.push(e)},s.prototype.delRoot=function(e){if(typeof e=="undefined"){for(var r=0;r=0&&(this.delFromMap(o.id),this._roots.splice(u,1),o instanceof n&&o.delChildrenFromStorage(this))},s.prototype.addToMap=function(e){return e instanceof n?e._storage=this:e.style.__rect=null,this._elements[e.id]=e,this},s.prototype.get=function(e){return this._elements[e]},s.prototype.delFromMap=function(e){var t=this._elements[e];return t&&(delete this._elements[e],t instanceof n&&(t._storage=null)),this},s.prototype.dispose=function(){this._elements=this._renderList=this._roots=this._hoverElements=null},s}),define("zrender/animation/easing",[],function(){var e={Linear:function(e){return e},QuadraticIn:function(e){return e*e},QuadraticOut:function(e){return e*(2-e)},QuadraticInOut:function(e){return(e*=2)<1?.5*e*e:-0.5*(--e*(e-2)-1)},CubicIn:function(e){return e*e*e},CubicOut:function(e){return--e*e*e+1},CubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},QuarticIn:function(e){return e*e*e*e},QuarticOut:function(e){return 1- --e*e*e*e},QuarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-0.5*((e-=2)*e*e*e-2)},QuinticIn:function(e){return e*e*e*e*e},QuinticOut:function(e){return--e*e*e*e*e+1},QuinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},SinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},SinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},SinusoidalInOut:function(e){return.5*(1-Math.cos(Math.PI*e))},ExponentialIn:function(e){return e===0?0:Math.pow(1024,e-1)},ExponentialOut:function(e){return e===1?1:1-Math.pow(2,-10*e)},ExponentialInOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)},CircularIn:function(e){return 1-Math.sqrt(1-e*e)},CircularOut:function(e){return Math.sqrt(1- --e*e)},CircularInOut:function(e){return(e*=2)<1?-0.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},ElasticIn:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),-(n*Math.pow(2,10*(e-=1))*Math.sin((e-t)*2*Math.PI/r)))},ElasticOut:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*e)*Math.sin((e-t)*2*Math.PI/r)+1)},ElasticInOut:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),(e*=2)<1?-0.5*n*Math.pow(2,10*(e-=1))*Math.sin((e-t)*2*Math.PI/r):n*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*2*Math.PI/r)*.5+1)},BackIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},BackOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},BackInOut:function(e){var t=2.5949095;return(e*=2)<1?.5*e*e*((t+1)*e-t):.5*((e-=2)*e*((t+1)*e+t)+2)},BounceIn:function(t){return 1-e.BounceOut(1-t)},BounceOut:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},BounceInOut:function(t){return t<.5?e.BounceIn(t*2)*.5:e.BounceOut(t*2-1)*.5+.5}};return e}),define("zrender/animation/Clip",["require","./easing"],function(e){function n(e){this._targetPool=e.target||{},this._targetPool instanceof Array||(this._targetPool=[this._targetPool]),this._life=e.life||1e3,this._delay=e.delay||0,this._startTime=(new Date).getTime()+this._delay,this._endTime=this._startTime+this._life*1e3,this.loop=typeof e.loop=="undefined"?!1:e.loop,this.gap=e.gap||0,this.easing=e.easing||"Linear",this.onframe=e.onframe,this.ondestroy=e.ondestroy,this.onrestart=e.onrestart}var t=e("./easing");return n.prototype={step:function(e){var n=(e-this._startTime)/this._life;if(n<0)return;n=Math.min(n,1);var r=typeof this.easing=="string"?t[this.easing]:this.easing,i=typeof r=="function"?r(n):n;return this.fire("frame",i),n==1?this.loop?(this.restart(),"restart"):(this._needsRemove=!0,"destroy"):null},restart:function(){var e=(new Date).getTime(),t=(e-this._startTime)%this._life;this._startTime=(new Date).getTime()-t+this.gap},fire:function(e,t){for(var n=0,r=this._targetPool.length;n=0&&this._clips.splice(t,1)},update:function(){var e=(new Date).getTime(),t=e-this._time,n=this._clips,r=n.length,i=[],s=[];for(var o=0;o=0;N--)if(x[N]<=t)break;N=Math.min(N,g-2)}else{for(N=k;Nt)break;N=Math.min(N-1,g-2)}k=N,L=t;var n=x[N+1]-x[N];if(n===0)return;O=(t-x[N])/n;if(u){_=T[N],M=T[N===0?N:N-1],D=T[N>g-2?g-1:N+1],P=T[N>g-3?g-1:N+2];if(b)p(M,_,D,P,O,O*O,O*O*O,s(e,v),E);else{var a;w?(a=p(M,_,D,P,O,O*O,O*O*O,H,1),a=m(H)):a=d(M,_,D,P,O,O*O,O*O*O),i(e,v,a)}}else if(b)c(T[N],T[N+1],O,s(e,v),E);else{var a;w?(c(T[N],T[N+1],O,H,1),a=m(H)):a=l(T[N],T[N+1],O),i(e,v,a)}for(N=0;N1?"."+e[1]:""))}return{parsePercent:t,parseCenter:n,parseRadius:r,addCommas:i}}),define("echarts/component/base",["require","../config","../util/ecQuery","../util/number","zrender/tool/util","zrender/tool/env"],function(e){function s(e,t,n,r,i){this.ecTheme=e,this.messageCenter=t,this.zr=n,this.option=r,this.series=r.series,this.myChart=i,this.component=i.component,this._zlevelBase=this.getZlevelBase(),this.shapeList=[],this.effectList=[];var s=this;s.hoverConnect=function(e){var t=(e.target||{}).hoverConnect;if(t){var n=10,r;if(t instanceof Array)for(var i=0,o=t.length;i4?a*r(2*i/s)/r(i/s):a/3);var l=i/s,c=-i/2,h=o+a*r(c),p=u+a*n(c);c+=l;var d=t.pointList=[];d.push([h,p]);for(var v=0,m=s*2-1,g;v=r.x-i&&e<=r.x+r.width+i&&t>=r.y-i&&t<=r.y+r.height+i?!0:!1}},t.inherits(C,N),C}),define("zrender/shape/util/dashedLineTo",[],function(){var e=[5,5];return function(t,n,r,i,s,o){if(t.setLineDash){e[0]=e[1]=o,t.setLineDash(e),t.moveTo(n,r),t.lineTo(i,s);return}o=typeof o!="number"?5:o;var u=i-n,a=s-r,f=Math.floor(Math.sqrt(u*u+a*a)/o);u/=f,a/=f;var l=!0;for(var c=0;ci-2?i-1:l+1],v=e[l>i-3?i-1:l+2]);var m=c*c,g=c*m;s.push([n(h[0],p[0],d[0],v[0],c,m,g),n(h[1],p[1],d[1],v[1],c,m,g)])}return s}}),define("zrender/shape/util/smoothBezier",["require","../../tool/vector"],function(e){var t=e("../../tool/vector");return function(e,n,r){var i=[],s=[],o=[],u=[],a,f;for(var l=0,c=e.length;l0&&(n.brushType=="stroke"||n.brushType=="both")&&(r||(e.beginPath(),this.buildPath(e,n),e.closePath()),e.stroke()),this.drawText(e,n,this.style),e.restore();return},buildPath:function(e,t){var s=t.pointList;if(s.length<2)return;if(t.smooth&&t.smooth!=="spline"){var o=r(s,t.smooth,!0);e.moveTo(s[0][0],s[0][1]);var u,a,f,l=s.length;for(var c=0;cn&&(n=s[o][0]),s[o][1]i&&(i=s[o][1]);var a;return e.brushType=="stroke"||e.brushType=="fill"?a=e.lineWidth||1:a=0,e.__rect={x:Math.round(t-a/2),y:Math.round(r-a/2),width:n-t+a,height:i-r+a},e.__rect}},e("../tool/util").inherits(s,t),s}),define("zrender/shape/BrokenLine",["require","./Base","./util/smoothSpline","./util/smoothBezier","./util/dashedLineTo","./Polygon","../tool/util"],function(e){function s(e){this.brushTypeOnly="stroke",this.textPosition="end",t.call(this,e)}var t=e("./Base"),n=e("./util/smoothSpline"),r=e("./util/smoothBezier"),i=e("./util/dashedLineTo");return s.prototype={type:"broken-line",buildPath:function(e,t){var s=t.pointList;if(s.length<2)return;var o=Math.min(t.pointList.length,Math.round(t.pointListLength||t.pointList.length));if(t.smooth&&t.smooth!=="spline"){var u=r(s,t.smooth);e.moveTo(s[0][0],s[0][1]);var a,f,l;for(var c=0;cs?a>u?l=Math.PI*2-l+f:l+=f:a>u?l+=Math.PI-f:l=Math.PI-l-f:s>o?u>a?l=Math.PI*2-l+f:l+=f:u>a?l+=Math.PI-f:l=Math.PI-l-f;var c=Math.PI/8,h=n===0?s:o,p=n===0?u:a,d=[[h+i*Math.cos(l-c),p-i*Math.sin(l-c)],[h+i*.6*Math.cos(l),p-i*.6*Math.sin(l)],[h+i*Math.cos(l+c),p-i*Math.sin(l+c)]];e.moveTo(h,p);for(var v=0,m=d.length;v=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height?this.style.smooth!=="spline"?a.isInside(i,this.style,e,t):a.isInside(o,this.style,e,t):!1}},c.inherits(h,t),h}),define("echarts/util/shape/normalIsCover",[],function(){return function(e,t){var n=this.getTansform(e,t);e=n[0],t=n[1];var r=this.style.__rect;return r||(r=this.style.__rect=this.getRect(this.style)),e>=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height}}),define("echarts/util/shape/Symbol",["require","zrender/shape/Base","zrender/shape/Polygon","zrender/tool/util","./normalIsCover"],function(e){function s(e){t.call(this,e)}var t=e("zrender/shape/Base"),n=e("zrender/shape/Polygon"),r=new n({}),i=e("zrender/tool/util");return s.prototype={type:"symbol",buildPath:function(e,t){var n=t.pointList,r=n.length;if(r===0)return;var i=1e4,s=Math.ceil(r/i),o,u,a=n[0]instanceof Array,f=t.size?t.size:2,l=f,c=f/2,h=Math.PI*2,p,d,v;for(var m=0;mr?r:u;for(var g=o;g0&&e.stroke();break;case"stroke":t.lineWidth>0&&e.stroke();break;default:e.fill()}}},getRect:function(e){return e.__rect||r.getRect(e)},isCover:e("./normalIsCover")},i.inherits(s,t),s}),define("echarts/util/ecData",[],function(){function e(e,t,n,r,i,s,o,u){var a;return typeof r!="undefined"&&(a=r.value==null?r:r.value),e._echartsData={_series:t,_seriesIndex:n,_data:r,_dataIndex:i,_name:s,_value:a,_special:o,_special2:u},e._echartsData}function t(e,t){var n=e._echartsData;if(!t)return n;switch(t){case"series":case"seriesIndex":case"data":case"dataIndex":case"name":case"value":case"special":case"special2":return n&&n["_"+t]}return null}function n(e,t,n){e._echartsData=e._echartsData||{};switch(t){case"series":case"seriesIndex":case"data":case"dataIndex":case"name":case"value":case"special":case"special2":e._echartsData["_"+t]=n}}function r(e,t){t._echartsData={_series:e._echartsData._series,_seriesIndex:e._echartsData._seriesIndex,_data:e._echartsData._data,_dataIndex:e._echartsData._dataIndex,_name:e._echartsData._name,_value:e._echartsData._value,_special:e._echartsData._special,_special2:e._echartsData._special2}}return{pack:e,set:n,get:t,clone:r}}),define("echarts/util/ecAnimation",["require","zrender/tool/util","zrender/shape/Polygon"],function(e){function n(e,n,r,i,s){var o=r.style.pointList,u=o.length,a;if(!n){a=[];if(r._orient!="vertical"){var f=o[0][1];for(var l=0;l1?t.symbol:[t.symbol[0],t.symbol[0]]:[t.symbol,t.symbol],t.symbolSize=t.symbolSize instanceof Array?t.symbolSize.length>1?t.symbolSize:[t.symbolSize[0],t.symbolSize[0]]:[t.symbolSize,t.symbolSize],t.symbolRotate=t.symbolRotate instanceof Array?t.symbolRotate.length>1?t.symbolRotate:[t.symbolRotate[0],t.symbolRotate[0]]:[t.symbolRotate,t.symbolRotate],t.name=n.name;var i=[],u=t.data,a,f=r.dataRange,c=r.legend,h,p,d,v,m,g,y=this.zr.getWidth(),b=this.zr.getHeight(),w;for(var E=0,S=u.length;E "+u[E][1].name:""),p),i.push(a)}return i},getMarkCoord:function(){return[0,0]},getSymbolShape:function(e,r,i,s,u,a,f,l,c,h,p){var d=[i,e],v=typeof i!="undefined"?typeof i.value!="undefined"?i.value:i:"-";l=this.deepQuery(d,"symbol")||l;var m=this.deepQuery(d,"symbolSize");m=typeof m=="function"?m(v):m;var g=this.deepQuery(d,"symbolRotate"),y=this.deepMerge(d,"itemStyle.normal"),b=this.deepMerge(d,"itemStyle.emphasis"),w=typeof y.borderWidth!="undefined"?y.borderWidth:y.lineStyle&&y.lineStyle.width;typeof w=="undefined"&&(w=l.match("empty")?2:0);var E=typeof b.borderWidth!="undefined"?b.borderWidth:b.lineStyle&&b.lineStyle.width;typeof E=="undefined"&&(E=w+2);var S=new n({style:{iconType:l.replace("empty","").toLowerCase(),x:a-m,y:f-m,width:m*2,height:m*2,brushType:"both",color:l.match("empty")?h:this.getItemStyleColor(y.color,r,s,i)||c,strokeColor:y.borderColor||this.getItemStyleColor(y.color,r,s,i)||c,lineWidth:w},highlightStyle:{color:l.match("empty")?h:this.getItemStyleColor(b.color,r,s,i),strokeColor:b.borderColor||y.borderColor||this.getItemStyleColor(y.color,r,s,i)||c,lineWidth:E},clickable:!0});return l.match("image")&&(S.style.image=l.replace(new RegExp("^image:\\/\\/"),""),S=new t({style:S.style,highlightStyle:S.highlightStyle,clickable:!0})),typeof g!="undefined"&&(S.rotation=[g*Math.PI/180,a,f]),l.match("star")&&(S.style.iconType="star",S.style.n=l.replace("empty","").replace("star","")-0||5),l=="none"&&(S.invisible=!0,S.hoverable=!1),S=this.addLabel(S,e,i,u,p),l.match("empty")&&(typeof S.style.textColor=="undefined"&&(S.style.textColor=S.style.strokeColor),typeof S.highlightStyle.textColor=="undefined"&&(S.highlightStyle.textColor=S.highlightStyle.strokeColor)),o.pack(S,e,r,i,s,u),S._x=a,S._y=f,S._dataIndex=s,S._seriesIndex=r,S},getLineMarkShape:function(e,t,n,i,s,o,u,a,f){var l=typeof n[0]!="undefined"?typeof n[0].value!="undefined"?n[0].value:n[0]:"-",c=typeof n[1]!="undefined"?typeof n[1].value!="undefined"?n[1].value:n[1]:"-",h=[this.query(n[0],"symbol")||e.symbol[0],this.query(n[1],"symbol")||e.symbol[1]],p=[this.query(n[0],"symbolSize")||e.symbolSize[0],this.query(n[1],"symbolSize")||e.symbolSize[1]];p[0]=typeof p[0]=="function"?p[0](l):p[0],p[1]=typeof p[1]=="function"?p[1](c):p[1];var d=[this.query(n[0],"symbolRotate")||e.symbolRotate[0],this.query(n[1],"symbolRotate")||e.symbolRotate[1]],v=[n[0],e],m=this.deepMerge(v,"itemStyle.normal");m.color=this.getItemStyleColor(m.color,t,i,n);var g=this.deepMerge(v,"itemStyle.emphasis");g.color=this.getItemStyleColor(g.color,t,i,n);var y=m.lineStyle,b=g.lineStyle,w=y.width;typeof w=="undefined"&&(w=m.borderWidth);var E=b.width;typeof E=="undefined"&&(typeof g.borderWidth!="undefined"?E=g.borderWidth:E=w+2);var S=new r({style:{smooth:e.smooth?"spline":!1,symbol:h,symbolSize:p,symbolRotate:d,xStart:s,yStart:o,xEnd:u,yEnd:a,brushType:"both",lineType:y.type,shadowColor:y.shadowColor||y.color||m.borderColor||m.color||f,shadowBlur:y.shadowBlur,shadowOffsetX:y.shadowOffsetX,shadowOffsetY:y.shadowOffsetY,color:m.color||f,strokeColor:y.color||m.borderColor||m.color||f,lineWidth:w,symbolBorderColor:m.borderColor||m.color||f,symbolBorder:m.borderWidth},highlightStyle:{shadowColor:b.shadowColor,shadowBlur:b.shadowBlur,shadowOffsetX:b.shadowOffsetX,shadowOffsetY:b.shadowOffsetY,color:g.color||m.color||f,strokeColor:b.color||y.color||g.borderColor||m.borderColor||g.color||m.color||f,lineWidth:E,symbolBorderColor:g.borderColor||m.borderColor||g.color||m.color||f,symbolBorder:typeof g.borderWidth=="undefined"?m.borderWidth+2:g.borderWidth},clickable:!0});return S=this.addLabel(S,e,n[0],n[0].name+" : "+n[1].name),S._x=u,S._y=a,S},getLargeMarkPoingShape:function(e,t){var n=this.series[e],r=this.component,s=t.data,o,u=r.dataRange,a=r.legend,f,l,c=[s[0],t],h,p,d;a&&(f=a.getColor(n.name));if(u){l=typeof s[0]!="undefined"?typeof s[0].value!="undefined"?s[0].value:s[0]:"-",f=isNaN(l)?f:u.getColor(l),h=this.deepQuery(c,"itemStyle.normal.color")||f,p=this.deepQuery(c,"itemStyle.emphasis.color")||h;if(h==null&&p==null)return}f=this.deepMerge(c,"itemStyle.normal").color||f;var v=this.deepQuery(c,"symbol")||"circle";v=v.replace("empty","").replace(/\d/g,""),d=this.deepMerge([s[0],t],"effect");var m=window.devicePixelRatio||1;return o=new i({style:{pointList:s,color:f,strokeColor:f,shadowColor:d.shadowColor||f,shadowBlur:(typeof d.shadowBlur!="undefined"?d.shadowBlur:8)*m,size:this.deepQuery(c,"symbolSize"),iconType:v,brushType:"fill",lineWidth:1},draggable:!1,hoverable:!1}),d.show&&(o.effect=d),o},backupShapeList:function(){this.shapeList&&this.shapeList.length>0?(this.lastShapeList=this.shapeList,this.shapeList=[]):this.lastShapeList=[]},addShapeList:function(){var e=this.option.animationThreshold/(this.canvasSupported?2:4),t=this.lastShapeList,n=this.shapeList,r=t.length>0?500:this.query(this.option,"animationDuration"),i=this.query(this.option,"animationEasing"),s,o={},u={};if(this.option.animation&&!this.option.renderAsImage&&n.length500?u.candle(this.zr,e,t,n,r):this.zr.addShape(t);break;case"ring":case"sector":case"circle":n>500?u.ring(this.zr,e,t,n+(o.get(t,"dataIndex")||0)%20*100,r):t.type=="sector"?u.sector(this.zr,e,t,n,r):this.zr.addShape(t);break;case"text":u.text(this.zr,e,t,n,r);break;case"polygon":n>500?u.polygon(this.zr,e,t,n,r):u.pointList(this.zr,e,t,n,r);break;case"chord":u.chord(this.zr,e,t,n,r);break;case"gauge-pointer":u.gaugePointer(this.zr,e,t,n,r);break;case"mark-line":u.markline(this.zr,e,t,n,r);break;case"line":u.line(this.zr,e,t,n,r);break;default:this.zr.addShape(t)}},animationMark:function(e,t,n){var r=n||this.shapeList;for(var i=0,s=r.length;i0&&(e&&this.zr.modLayer(s.EFFECT_ZLEVEL,{motionBlur:!1}),this.zr.delShape(this.effectList)),this.effectList=[]},addMark:function(e,t,n){var r=this.series[e];if(this.selectedMap[r.name]){var i=500,s=this.query(this.option,"animationEasing"),o=r[n].data,u=this.shapeList.length;r[n].data=t.data,this["_build"+n.replace("m","M")](e);for(var a=u,f=this.shapeList.length;a0?-1:1,t.style.r-=r,t.style.r=t.style.r<5?5:t.style.r;var i=s.get(t,"value"),o=i*f.option.island.calculateStep;o>1?i=Math.round(i-o*r):i=(i-o*r).toFixed(2)-0;var a=s.get(t,"name");t.style.text=a+":"+i,s.set(t,"value",i),s.set(t,"name",a),f.zr.modShape(t.id),f.zr.refresh(),u.stop(n)}}var t=e("../component/base"),n=e("./base"),r=e("zrender/shape/Circle"),i=e("../config"),s=e("../util/ecData"),o=e("zrender/tool/util"),u=e("zrender/tool/event");return a.prototype={type:i.CHART_TYPE_ISLAND,_combine:function(t,n){var r=e("zrender/tool/color"),i=e("../util/accMath"),o=i.accAdd(s.get(t,"value"),s.get(n,"value")),u=s.get(t,"name")+this._nameConnector+s.get(n,"name");t.style.text=u+this._valueConnector+o,s.set(t,"value",o),s.set(t,"name",u),t.style.r=this.option.island.r,t.style.color=r.mix(t.style.color,n.style.color)},refresh:function(e){e&&(e.island=this.reformOption(e.island),this.option=e,this._nameConnector=this.option.nameConnector,this._valueConnector=this.option.valueConnector)},getOption:function(){return this.option},resize:function(){var e=this.zr.getWidth(),t=this.zr.getHeight(),n=e/(this._zrWidth||e),r=t/(this._zrHeight||t);if(n==1&&r==1)return;this._zrWidth=e,this._zrHeight=t;for(var i=0,s=this.shapeList.length;i'+(t[0]||this._lang[0])+"

",this._textArea.style.cssText="display:block;margin:0 0 8px 0;padding:4px 6px;overflow:auto;width:"+(this._zrWidth-15)+"px;"+"height:"+(this._zrHeight-100)+"px;";var n=this.query(this.option,"toolbox.feature.dataView.optionToContent");typeof n!="function"?this._textArea.value=this._optionToContent():this._textArea.value=n(this.option),this._tDom.appendChild(this._textArea),this._buttonClose.style.cssText="float:right;padding:1px 6px;",this._buttonClose.innerHTML=t[1]||this._lang[1];var r=this;this._buttonClose.onclick=function(){r.hide()},this._tDom.appendChild(this._buttonClose),this.query(this.option,"toolbox.feature.dataView.readOnly")===!1?(this._buttonRefresh.style.cssText="float:right;margin-right:10px;padding:1px 6px;",this._buttonRefresh.innerHTML=t[2]||this._lang[2],this._buttonRefresh.onclick=function(){r._save()},this._tDom.appendChild(this._buttonRefresh),this._textArea.readOnly=!1,this._textArea.style.cursor="default"):(this._textArea.readOnly=!0,this._textArea.style.cursor="text"),this._sizeCssText="width:"+this._zrWidth+"px;"+"height:"+this._zrHeight+"px;"+"background-color:#fff;",this._tDom.style.cssText=this._gCssText+this._sizeCssText},_optionToContent:function(){var e,t,r,i,s,o,u=[],a="";if(this.option.xAxis){this.option.xAxis instanceof Array?u=this.option.xAxis:u=[this.option.xAxis];for(e=0,i=u.length;e10&&(this._sizeCssText="width:"+this._zrWidth+"px;"+"height:"+this._zrHeight+"px;"+"background-color:#fff;",this._tDom.style.cssText=this._gCssText+this._sizeCssText,this._textArea.style.cssText="display:block;margin:0 0 8px 0;padding:4px 6px;overflow:auto;width:"+(this._zrWidth-15)+"px;"+"height:"+(this._zrHeight-100)+"px;")},dispose:function(){window.removeEventListener?(this._tDom.removeEventListener("click",this._stop),this._tDom.removeEventListener("mousewheel",this._stop),this._tDom.removeEventListener("mousemove",this._stop),this._tDom.removeEventListener("mousedown",this._stop),this._tDom.removeEventListener("mouseup",this._stop),this._tDom.removeEventListener("touchstart",this._stop),this._tDom.removeEventListener("touchmove",this._stop),this._tDom.removeEventListener("touchend",this._stop)):(this._tDom.detachEvent("onclick",this._stop),this._tDom.detachEvent("onmousewheel",this._stop),this._tDom.detachEvent("onmousemove",this._stop),this._tDom.detachEvent("onmousedown",this._stop),this._tDom.detachEvent("onmouseup",this._stop)),this._buttonRefresh.onclick=null,this._buttonClose.onclick=null,this._hasShow&&(this._tDom.removeChild(this._textArea),this._tDom.removeChild(this._buttonRefresh),this._tDom.removeChild(this._buttonClose)),this._textArea=null,this._buttonRefresh=null,this._buttonClose=null,this.dom.firstChild.removeChild(this._tDom),this._tDom=null}},r.inherits(i,t),e("../component").define("dataView",i),i}),define("echarts/component/toolbox",["require","./base","zrender/shape/Line","zrender/shape/Image","zrender/shape/Rectangle","../util/shape/Icon","../config","zrender/tool/util","zrender/config","zrender/tool/event","./dataView","../component"],function(e){function h(e,n,r,i,s){t.call(this,e,n,r,i,s),this.dom=s.dom,this._magicType={},this._isSilence=!1,this._iconList,this._iconShapeMap={},this._featureTitle={},this._featureIcon={},this._featureColor={},this._enableColor="red",this._disableColor="#ccc",this._markShapeList=[];var o=this;o._onMark=function(e){o.__onMark(e)},o._onMarkUndo=function(e){o.__onMarkUndo(e)},o._onMarkClear=function(e){o.__onMarkClear(e)},o._onDataZoom=function(e){o.__onDataZoom(e)},o._onDataZoomReset=function(e){o.__onDataZoomReset(e)},o._onDataView=function(e){o.__onDataView(e)},o._onRestore=function(e){o.__onRestore(e)},o._onSaveAsImage=function(e){o.__onSaveAsImage(e)},o._onMagicType=function(e){o.__onMagicType(e)},o._onCustomHandler=function(e){o.__onCustomHandler(e)},o._onmousemove=function(e){return o.__onmousemove(e)},o._onmousedown=function(e){return o.__onmousedown(e)},o._onmouseup=function(e){return o.__onmouseup(e)},o._onclick=function(e){return o.__onclick(e)}}var t=e("./base"),n=e("zrender/shape/Line"),r=e("zrender/shape/Image"),i=e("zrender/shape/Rectangle"),s=e("../util/shape/Icon"),o=e("../config"),u=e("zrender/tool/util"),a=e("zrender/config"),f=e("zrender/tool/event"),l="stack",c="tiled";return h.prototype={type:o.COMPONENT_TYPE_TOOLBOX,_buildShape:function(){this._iconList=[];var e=this.option.toolbox;this._enableColor=e.effectiveColor,this._disableColor=e.disableColor;var t=e.feature,n=[];for(var r in t)if(t[r].show)switch(r){case"mark":n.push({key:r,name:"mark"}),n.push({key:r,name:"markUndo"}),n.push({key:r,name:"markClear"});break;case"magicType":for(var i=0,s=t[r].type.length;i0){var o,r;for(var i=0,s=n.length;i=1){var t=this._markShapeList[e-1];this.zr.delShape(t.id),this.zr.refresh(),this._markShapeList.pop(),e==1&&(this._iconDisable(this._iconShapeMap.markUndo),this._iconDisable(this._iconShapeMap.markClear))}}return!0},__onMarkClear:function(){this._marking&&(this._marking=!1);var e=this._markShapeList.length;if(e>0){while(e--)this.zr.delShape(this._markShapeList.pop().id);this._iconDisable(this._iconShapeMap.markUndo),this._iconDisable(this._iconShapeMap.markClear),this.zr.refresh()}return!0},__onDataZoom:function(e){var t=e.target;if(this._zooming||this._zoomStart)this._resetZoom(),this.zr.refresh(),this.dom.style.cursor="default";else{this._resetMark(),this.zr.modShape(t.id,{style:{strokeColor:this._enableColor}}),this.zr.refresh(),this._zoomStart=!0;var n=this;setTimeout(function(){n.zr&&n.zr.on(a.EVENT.MOUSEDOWN,n._onmousedown)&&n.zr.on(a.EVENT.MOUSEUP,n._onmouseup)&&n.zr.on(a.EVENT.MOUSEMOVE,n._onmousemove)},10),this.dom.style.cursor="crosshair"}return!0},__onDataZoomReset:function(){return this._zooming&&(this._zooming=!1),this._zoomQueue.pop(),this._zoomQueue.length>0?this.component.dataZoom.absoluteZoom(this._zoomQueue[this._zoomQueue.length-1]):(this.component.dataZoom.rectZoom(),this._iconDisable(this._iconShapeMap.dataZoomReset),this.zr.refresh()),!0},_resetMark:function(){this._marking=!1,this._markStart&&(this._markStart=!1,this._iconShapeMap.mark&&this.zr.modShape(this._iconShapeMap.mark.id,{style:{strokeColor:this._iconShapeMap.mark.highlightStyle.strokeColor}}),this.zr.un(a.EVENT.CLICK,this._onclick),this.zr.un(a.EVENT.MOUSEMOVE,this._onmousemove))},_resetZoom:function(){this._zooming=!1,this._zoomStart&&(this._zoomStart=!1,this._iconShapeMap.dataZoom&&this.zr.modShape(this._iconShapeMap.dataZoom.id,{style:{strokeColor:this._iconShapeMap.dataZoom.highlightStyle.strokeColor}}),this.zr.un(a.EVENT.MOUSEDOWN,this._onmousedown),this.zr.un(a.EVENT.MOUSEUP,this._onmouseup),this.zr.un(a.EVENT.MOUSEMOVE,this._onmousemove))},_iconDisable:function(e){e.type!="image"?this.zr.modShape(e.id,{hoverable:!1,clickable:!1,style:{strokeColor:this._disableColor}}):this.zr.modShape(e.id,{hoverable:!1,clickable:!1,style:{opacity:.3}})},_iconEnable:function(e){e.type!="image"?this.zr.modShape(e.id,{hoverable:!0,clickable:!0,style:{strokeColor:e.highlightStyle.strokeColor}}):this.zr.modShape(e.id,{hoverable:!0,clickable:!0,style:{opacity:.8}})},__onDataView:function(){return this._dataView.show(this.option),!0},__onRestore:function(){return this._resetMark(),this._resetZoom(),this.messageCenter.dispatch(o.EVENT.RESTORE,null,null,this.myChart),!0},__onSaveAsImage:function(){var e=this.option.toolbox.feature.saveAsImage,t=e.type||"png";t!="png"&&t!="jpeg"&&(t="png");var n;this.myChart.isConnected()?n=this.myChart.getConnectedDataURL(t):n=this.zr.toDataURL("image/"+t,this.option.backgroundColor&&this.option.backgroundColor.replace(" ","")=="rgba(0,0,0,0)"?"#fff":this.option.backgroundColor);var r=document.createElement("div");r.id="__echarts_download_wrap__",r.style.cssText="position:fixed;z-index:99999;display:block;top:0;left:0;background-color:rgba(33,33,33,0.5);text-align:center;width:100%;height:100%;line-height:"+document.documentElement.clientHeight+"px;";var i=document.createElement("a");i.href=n,i.setAttribute("download",(e.name?e.name:this.option.title&&(this.option.title.text||this.option.title.subtext)?this.option.title.text||this.option.title.subtext:"ECharts")+"."+t),i.innerHTML='图片另存为")+'"/>',r.appendChild(i),document.body.appendChild(r),i=null,r=null,setTimeout(function(){var e=document.getElementById("__echarts_download_wrap__");e&&(e.onclick=function(){var e=document.getElementById("__echarts_download_wrap__");e.onclick=null,e.innerHTML="",document.body.removeChild(e),e=null},e=null)},500);return},__onMagicType:function(e){this._resetMark();var t=e.target._name;return this._magicType[t]||(this._magicType[t]=!0,t==o.CHART_TYPE_LINE?this._magicType[o.CHART_TYPE_BAR]=!1:t==o.CHART_TYPE_BAR&&(this._magicType[o.CHART_TYPE_LINE]=!1),t==l?this._magicType[c]=!1:t==c&&(this._magicType[l]=!1),this.messageCenter.dispatch(o.EVENT.MAGIC_TYPE_CHANGED,e.event,{magicType:this._magicType},this.myChart)),!0},setMagicType:function(e){this._resetMark(),this._magicType=e,!this._isSilence&&this.messageCenter.dispatch(o.EVENT.MAGIC_TYPE_CHANGED,null,{magicType:this._magicType},this.myChart)},__onCustomHandler:function(e){var t=e.target.style.iconType,n=this.option.toolbox.feature[t].onclick;typeof n=="function"&&n(this.option)},reset:function(e,t){t&&this.clear();if(this.query(e,"toolbox.show")&&this.query(e,"toolbox.feature.magicType.show")){var n=e.toolbox.feature.magicType.type,r=n.length;this._magicMap={};while(r--)this._magicMap[n[r]]=!0;r=e.series.length;var i,s;while(r--){i=e.series[r].type,this._magicMap[i]&&(s=e.xAxis instanceof Array?e.xAxis[e.series[r].xAxisIndex||0]:e.xAxis,s&&(s.type||"category")=="category"&&(s.__boundaryGap=typeof s.boundaryGap!="undefined"?s.boundaryGap:!0),s=e.yAxis instanceof Array?e.yAxis[e.series[r].yAxisIndex||0]:e.yAxis,s&&s.type=="category"&&(s.__boundaryGap=typeof s.boundaryGap!="undefined"?s.boundaryGap:!0),e.series[r].__type=i,e.series[r].__itemStyle=u.clone(e.series[r].itemStyle||{}));if(this._magicMap[l]||this._magicMap[c])e.series[r].__stack=e.series[r].stack}}this._magicType=t?{}:this._magicType||{};for(var o in this._magicType)if(this._magicType[o]){this.option=e,this.getMagicOption();break}var a=e.dataZoom;if(a&&a.show){var f=typeof a.start!="undefined"&&a.start>=0&&a.start<=100?a.start:0,h=typeof a.end!="undefined"&&a.end>=0&&a.end<=100?a.end:100;f>h&&(f+=h,h=f-h,f-=h),this._zoomQueue=[{start:f,end:h,start2:0,end2:100}]}else this._zoomQueue=[]},getMagicOption:function(){var e;if(this._magicType[o.CHART_TYPE_LINE]||this._magicType[o.CHART_TYPE_BAR]){var t=this._magicType[o.CHART_TYPE_LINE]?!1:!0;for(var n=0,r=this.option.series.length;n0&&(this.zr.delShape(this._lastTipShape.tipShape),this._lastTipShape=!1,this.shapeList.length=2),e&&this.zr.refresh(),this.showing=!1},_show:function(e,t,n,r){var i=this._tDom.offsetHeight,s=this._tDom.offsetWidth;e&&(typeof e=="function"&&(e=e([t,n])),e instanceof Array&&(t=e[0],n=e[1])),t+s>this._zrWidth&&(t-=s+40),n+i>this._zrHeight&&(n-=i-20),n<20&&(n=0),this._tDom.style.cssText=this._gCssText+this._defaultCssText+(r?r:"")+"left:"+t+"px;top:"+n+"px;",(i<10||s<10)&&setTimeout(this._refixed,20),this.showing=!0},__refixed:function(){if(this._tDom){var e="",t=this._tDom.offsetHeight,n=this._tDom.offsetWidth;this._tDom.offsetLeft+n>this._zrWidth&&(e+="left:"+(this._zrWidth-n-20)+"px;"),this._tDom.offsetTop+t>this._zrHeight&&(e+="top:"+(this._zrHeight-t-10)+"px;"),e!==""&&(this._tDom.style.cssText+=e)}},__tryShow:function(){var e,t;if(!this._curTarget)this._findPolarTrigger()||this._findAxisTrigger();else{if(this._curTarget._type=="island"&&this.option.tooltip.show){this._showItemTrigger();return}var n=u.get(this._curTarget,"series"),r=u.get(this._curTarget,"data");e=this.deepQuery([r,n,this.option],"tooltip.show"),typeof n=="undefined"||typeof r=="undefined"||e===!1?(clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this._hidingTicket=setTimeout(this._hide,this._hideDelay)):(t=this.deepQuery([r,n,this.option],"tooltip.trigger"),t=="axis"?this._showAxisTrigger(n.xAxisIndex,n.yAxisIndex,u.get(this._curTarget,"dataIndex")):this._showItemTrigger())}},_findAxisTrigger:function(){if(!this.component.xAxis||!this.component.yAxis){this._hidingTicket=setTimeout(this._hide,this._hideDelay);return}var e=this.option.series,t,n;for(var r=0,i=e.length;r=r)break;a=t.getCoordByIndex(++n),o=a}return r-sh){a>=i&&(c=a);if(a<=i)break;a=t.getCoordByIndex(++n),l=a}return i-l>c-i?n-=n!==0?1:0:typeof t.getNameByIndex(n)=="undefined"&&(n-=1),n},_showAxisTrigger:function(e,t,n){!this._event.connectTrigger&&this.messageCenter.dispatch(o.EVENT.TOOLTIP_IN_GRID,this._event,null,this.myChart);if(typeof this.component.xAxis=="undefined"||typeof this.component.yAxis=="undefined"||typeof e=="undefined"||typeof t=="undefined"){clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this._hidingTicket=setTimeout(this._hide,this._hideDelay);return}var r=this.option.series,i=[],s=[],u,a,l,c,h,p,d="";if(this.option.tooltip.trigger=="axis"){if(this.option.tooltip.show===!1)return;c=this.option.tooltip.formatter,h=this.option.tooltip.position}if(e!=-1&&this.component.xAxis.getAxis(e).type==o.COMPONENT_TYPE_AXIS_CATEGORY){u=this.component.xAxis.getAxis(e);for(var v=0,m=r.length;v=0?this._showItemTrigger():(clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this._tDom.style.display="none");if(i.length>0){var g;if(typeof c=="function"){var y=[];for(var v=0,m=i.length;v"+this._encodeHTML(i[v].name||"")+" : ",g=i[v].data[n],g=typeof g!="undefined"?typeof g.value!="undefined"?g.value:g:"-",c+=g instanceof Array?g:this.numAddCommas(g);this._tDom.innerHTML=c}if(p===!1||!this.option.tooltip.showContent)return;this.hasAppend||(this._tDom.style.left=this._zrWidth/2+"px",this._tDom.style.top=this._zrHeight/2+"px",this.dom.firstChild.appendChild(this._tDom),this.hasAppend=!0),this._show(h,a+10,l+10,d)}},_showPolarTrigger:function(e,t){if(typeof this.component.polar=="undefined"||typeof e=="undefined"||typeof t=="undefined"||t<0)return!1;var n=this.option.series,r=[],i,s,o,u="";if(this.option.tooltip.trigger=="axis"){if(this.option.tooltip.show===!1)return!1;i=this.option.tooltip.formatter,s=this.option.tooltip.position}var a=this.option.polar[e].indicator[t].text;for(var l=0,c=n.length;l0){var h,p,d=[];for(var l=0,c=r.length;l"+this._encodeHTML(d[0][3])+" : "+this.numAddCommas(d[0][2]);for(var l=1,c=d.length;l"+this._encodeHTML(d[l][1])+"
",i+=this._encodeHTML(d[l][3])+" : "+this.numAddCommas(d[l][2]);this._tDom.innerHTML=i}if(o===!1||!this.option.tooltip.showContent)return;return this.hasAppend||(this._tDom.style.left=this._zrWidth/2+"px",this._tDom.style.top=this._zrHeight/2+"px",this.dom.firstChild.appendChild(this._tDom),this.hasAppend=!0),this._show(s,f.getX(this._event),f.getY(this._event),u),!0}},_showItemTrigger:function(){if(!this._curTarget)return;var e=u.get(this._curTarget,"series"),t=u.get(this._curTarget,"data"),n=u.get(this._curTarget,"name"),r=u.get(this._curTarget,"value"),i=u.get(this._curTarget,"special"),s=u.get(this._curTarget,"special2"),a,l,c,h="",p,d="";this._curTarget._type!="island"?(this.option.tooltip.trigger=="item"&&(a=this.option.tooltip.formatter,l=this.option.tooltip.position),this.query(e,"tooltip.trigger")=="item"&&(c=this.query(e,"tooltip.showContent")||c,a=this.query(e,"tooltip.formatter")||a,l=this.query(e,"tooltip.position")||l,h+=this._style(this.query(e,"tooltip"))),c=this.query(t,"tooltip.showContent")||c,a=this.query(t,"tooltip.formatter")||a,l=this.query(t,"tooltip.position")||l,h+=this._style(this.query(t,"tooltip"))):(c=this.deepQuery([t,e,this.option],"tooltip.showContent"),a=this.deepQuery([t,e,this.option],"tooltip.islandFormatter"),l=this.deepQuery([t,e,this.option],"tooltip.islandPosition"));if(typeof a=="function")this._curTicket=(e.name||"")+":"+u.get(this._curTarget,"dataIndex"),this._tDom.innerHTML=a.call(this.myChart,[e.name||"",n,r,i,s,t],this._curTicket,this._setContent);else if(typeof a=="string")this._curTicket=NaN,a=a.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}"),a=a.replace("{a0}",this._encodeHTML(e.name||"")).replace("{b0}",this._encodeHTML(n)).replace("{c0}",r instanceof Array?r:this.numAddCommas(r)),a=a.replace("{d}","{d0}").replace("{d0}",i||""),a=a.replace("{e}","{e0}").replace("{e0}",u.get(this._curTarget,"special2")||""),this._tDom.innerHTML=a;else{this._curTicket=NaN;if(e.type==o.CHART_TYPE_SCATTER)this._tDom.innerHTML=(typeof e.name!="undefined"?this._encodeHTML(e.name)+"
":"")+(n===""?"":this._encodeHTML(n)+" : ")+r+(typeof i=="undefined"?"":" ("+i+")");else if(e.type==o.CHART_TYPE_RADAR&&i){p=i,d+=this._encodeHTML(n===""?e.name||"":n),d+=d===""?"":"
";for(var v=0;v";this._tDom.innerHTML=d}else if(e.type==o.CHART_TYPE_CHORD)if(typeof s=="undefined")this._tDom.innerHTML=this._encodeHTML(n)+" ("+this.numAddCommas(r)+")";else{var m=this._encodeHTML(n),g=this._encodeHTML(i);this._tDom.innerHTML=(typeof e.name!="undefined"?this._encodeHTML(e.name)+"
":"")+m+" -> "+g+" ("+this.numAddCommas(r)+")"+"
"+g+" -> "+m+" ("+this.numAddCommas(s)+")"}else this._tDom.innerHTML=(typeof e.name!="undefined"?this._encodeHTML(e.name)+"
":"")+this._encodeHTML(n)+" : "+this.numAddCommas(r)+(typeof i=="undefined"?"":" ("+this.numAddCommas(i)+")")}if(!this._axisLineShape.invisible||!this._axisShadowShape.invisible)this._axisLineShape.invisible=!0,this.zr.modShape(this._axisLineShape.id),this._axisShadowShape.invisible=!0,this.zr.modShape(this._axisShadowShape.id),this.zr.refresh();if(c===!1||!this.option.tooltip.showContent)return;this.hasAppend||(this._tDom.style.left=this._zrWidth/2+"px",this._tDom.style.top=this._zrHeight/2+"px",this.dom.firstChild.appendChild(this._tDom),this.hasAppend=!0),this._show(l,f.getX(this._event)+20,f.getY(this._event)-20,h)},_styleAxisPointer:function(e,t,n,r,i,s,o,u){if(e.length>0){var a,f,l=this.option.tooltip.axisPointer,c=l.type,h={line:{},cross:{},shadow:{}};for(var p in h)h[p].color=l[p+"Style"].color,h[p].width=l[p+"Style"].width,h[p].type=l[p+"Style"].type;for(var d=0,v=e.length;d100?(this._axisCrossShape.style.textAlign="left",this._axisCrossShape.style.textX=o+10):(this._axisCrossShape.style.textAlign="right",this._axisCrossShape.style.textX=o-10),u-this.component.grid.getY()>50?(this._axisCrossShape.style.textBaseline="bottom",this._axisCrossShape.style.textY=u-10):(this._axisCrossShape.style.textBaseline="top",this._axisCrossShape.style.textY=u+10),this._axisCrossShape.invisible=!1,this.zr.modShape(this._axisCrossShape.id);else if(c=="shadow"){if(typeof h.shadow.width=="undefined"||h.shadow.width=="auto"||isNaN(h.shadow.width))h.shadow.width=s;t==r?Math.abs(this.component.grid.getX()-t)<2?(h.shadow.width/=2,t=r+=h.shadow.width/2):Math.abs(this.component.grid.getXend()-t)<2&&(h.shadow.width/=2,t=r-=h.shadow.width/2):n==i&&(Math.abs(this.component.grid.getY()-n)<2?(h.shadow.width/=2,n=i+=h.shadow.width/2):Math.abs(this.component.grid.getYend()-n)<2&&(h.shadow.width/=2,n=i-=h.shadow.width/2)),this._axisShadowShape.style={xStart:t,yStart:n,xEnd:r,yEnd:i,strokeColor:h.shadow.color,lineWidth:h.shadow.width},this._axisShadowShape.invisible=!1,this.zr.modShape(this._axisShadowShape.id)}this.zr.refresh()}},__onmousemove:function(e){clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket);var t=e.target,n=f.getX(e.event),r=f.getY(e.event);if(!t)this._curTarget=!1,this._event=e.event,this._event.zrenderX=n,this._event.zrenderY=r,this._needAxisTrigger&&this.component.grid&&l.isInside(s,this.component.grid.getArea(),n,r)?this._showingTicket=setTimeout(this._tryShow,this._showDelay):this._needAxisTrigger&&this.component.polar&&this.component.polar.isInside([n,r])!=-1?this._showingTicket=setTimeout(this._tryShow,this._showDelay):(!this._event.connectTrigger&&this.messageCenter.dispatch(o.EVENT.TOOLTIP_OUT_GRID,this._event,null,this.myChart),this._hidingTicket=setTimeout(this._hide,this._hideDelay));else{this._curTarget=t,this._event=e.event,this._event.zrenderX=n,this._event.zrenderY=r;var i;if(this._needAxisTrigger&&this.component.polar&&(i=this.component.polar.isInside([n,r]))!=-1){var u=this.option.series;for(var a=0,c=u.length;a0&&(this.zr.delShape(this._lastTipShape.tipShape),this.shapeList.length=2);for(var n=0,r=t.length;n0&&this.zr.delShape(this._lastTipShape.tipShape),this._lastTipShape=!1,this.shapeList.length=2;if(e){this.option=e,this.option.tooltip=this.reformOption(this.option.tooltip),this.option.tooltip.textStyle=h.merge(this.option.tooltip.textStyle,this.ecTheme.textStyle),this.option.tooltip.padding=this.reformCssArray(this.option.tooltip.padding),this._needAxisTrigger=!1,this.option.tooltip.trigger=="axis"&&(this._needAxisTrigger=!0);var t=this.option.series;for(var n=0,r=t.length;n0&&this.zr.delShape(this._lastTipShape.tipShape),this.clear(),this.shapeList=null,clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this.zr.un(a.EVENT.MOUSEMOVE,this._onmousemove),this.zr.un(a.EVENT.GLOBALOUT,this._onglobalout),this.hasAppend&&this.dom.firstChild.removeChild(this._tDom),this._tDom=null},_encodeHTML:function(e){return String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}},h.inherits(d,t),e("../component").define("tooltip",d),d}),define("zrender/shape/Ring",["require","./Base","../tool/util"],function(e){function n(e){t.call(this,e)}var t=e("./Base");return n.prototype={type:"ring",buildPath:function(e,t){e.arc(t.x,t.y,t.r,0,Math.PI*2,!1),e.moveTo(t.x+t.r0,t.y),e.arc(t.x,t.y,t.r0,0,Math.PI*2,!0);return},getRect:function(e){if(e.__rect)return e.__rect;var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,e.__rect={x:Math.round(e.x-e.r-t/2),y:Math.round(e.y-e.r-t/2),width:e.r*2+t,height:e.r*2+t},e.__rect}},e("../tool/util").inherits(n,t),n}),define("zrender/shape/Sector",["require","../tool/math","./Base","./Ring","./Polygon","../tool/util"],function(e){function r(e){n.call(this,e)}var t=e("../tool/math"),n=e("./Base");return r.prototype={type:"sector",buildPath:function(e,n){var r=n.x,i=n.y,s=typeof n.r0=="undefined"?0:n.r0,o=n.r,u=n.startAngle,a=n.endAngle;if(Math.abs(a-u)>=360){e.arc(r,i,o,0,Math.PI*2,!1),s!==0&&(e.moveTo(r+s,i),e.arc(r,i,s,0,Math.PI*2,!0));return}u=t.degreeToRadian(u),a=t.degreeToRadian(a);var f=Math.PI*2,l=t.cos(u),c=t.sin(u);e.moveTo(l*s+r,i-c*s),e.lineTo(l*o+r,i-c*o),e.arc(r,i,o,f-u,f-a,!0),e.lineTo(t.cos(a)*s+r,i-t.sin(a)*s),s!==0&&e.arc(r,i,s,f-a,f-u,!1);return},getRect:function(n){if(n.__rect)return n.__rect;var r=n.x,i=n.y,s=typeof n.r0=="undefined"?0:n.r0,o=n.r,u=n.startAngle,a=n.endAngle;if(Math.abs(a-u)>=360)return n.__rect=e("./Ring").prototype.getRect(n),n.__rect;u=(720+u)%360,a=(720+a)%360,a<=u&&(a+=360);var f=[];return u<=90&&a>=90&&f.push([r,i-o]),u<=180&&a>=180&&f.push([r-o,i]),u<=270&&a>=270&&f.push([r,i+o]),u<=360&&a>=360&&f.push([r+o,i]),u=t.degreeToRadian(u),a=t.degreeToRadian(a),f.push([t.cos(u)*s+r,i-t.sin(u)*s]),f.push([t.cos(u)*o+r,i-t.sin(u)*o]),f.push([t.cos(a)*o+r,i-t.sin(a)*o]),f.push([t.cos(a)*s+r,i-t.sin(a)*s]),n.__rect=e("./Polygon").prototype.getRect({brushType:n.brushType,lineWidth:n.lineWidth,pointList:f}),n.__rect}},e("../tool/util").inherits(r,n),r}),define("echarts/util/shape/Candle",["require","zrender/shape/Base","zrender/tool/util","./normalIsCover"],function(e){function r(e){t.call(this,e)}var t=e("zrender/shape/Base"),n=e("zrender/tool/util");return r.prototype={type:"candle",_numberOrder:function(e,t){return t-e},buildPath:function(e,t){var r=n.clone(t.y).sort(this._numberOrder);e.moveTo(t.x,r[3]),e.lineTo(t.x,r[2]),e.moveTo(t.x-t.width/2,r[2]),e.rect(t.x-t.width/2,r[2],t.width,r[1]-r[2]),e.moveTo(t.x,r[1]),e.lineTo(t.x,r[0])},getRect:function(e){if(!e.__rect){var t=0;if(e.brushType=="stroke"||e.brushType=="fill")t=e.lineWidth||1;var r=n.clone(e.y).sort(this._numberOrder);e.__rect={x:Math.round(e.x-e.width/2-t/2),y:Math.round(r[3]-t/2),width:e.width+t,height:r[0]-r[3]+t}}return e.__rect},isCover:e("./normalIsCover")},n.inherits(r,t),r}),define("echarts/component/legend",["require","./base","zrender/shape/Text","zrender/shape/Rectangle","zrender/shape/Sector","../util/shape/Icon","../util/shape/Candle","../config","zrender/tool/util","zrender/tool/area","../component"],function(e){function l(e,n,r,i,s){if(!this.query(i,"legend.data")){console.error("option.legend.data has not been defined.");return}t.call(this,e,n,r,i,s);var o=this;o._legendSelected=function(e){o.__legendSelected(e)},this._colorIndex=0,this._colorMap={},this._selectedMap={},this.refresh(i)}var t=e("./base"),n=e("zrender/shape/Text"),r=e("zrender/shape/Rectangle"),i=e("zrender/shape/Sector"),s=e("../util/shape/Icon"),o=e("../util/shape/Candle"),u=e("../config"),a=e("zrender/tool/util"),f=e("zrender/tool/area");l.prototype={type:u.COMPONENT_TYPE_LEGEND,_buildShape:function(){this._itemGroupLocation=this._getItemGroupLocation(),this._buildBackground(),this._buildItem();for(var e=0,t=this.shapeList.length;e=d-m&&(m=this._itemGroupLocation.x,g+=b+w):v-g<200&&b+(S==t-1||e[S+1]===""?0:w)>=v-g&&(this.legendOption.x=="right"?m-=this._itemGroupLocation.maxWidth+w:m+=this._itemGroupLocation.maxWidth+w,g=this._itemGroupLocation.y),o=this._getItemShapeByType(m,g,y,b,this._selectedMap[r]?E:"#ccc",i,E),o._name=r,o=new s(o),u={zlevel:this._zlevelBase,style:{x:m+y+5,y:g+b/2,color:this._selectedMap[r]?c.color==="auto"?E:c.color:"#ccc",text:p,textFont:h,textBaseline:"middle"},highlightStyle:{color:E,brushType:"fill"},hoverable:!!this.legendOption.selectedMode,clickable:!!this.legendOption.selectedMode},this.legendOption.orient=="vertical"&&this.legendOption.x=="right"&&(u.style.x-=y+10,u.style.textAlign="right"),u._name=r,u=new n(u),this.legendOption.selectedMode&&(o.onclick=u.onclick=this._legendSelected,o.onmouseover=u.onmouseover=this.hoverConnect,o.hoverConnect=u.id,u.hoverConnect=o.id),this.shapeList.push(o),this.shapeList.push(u),this.legendOption.orient=="horizontal"?m+=y+5+f.getTextWidth(p,h)+w:g+=b+w}this.legendOption.orient=="horizontal"&&this.legendOption.x=="center"&&g!=this._itemGroupLocation.y&&this._mLineOptimize()},_getName:function(e){return typeof e.name!="undefined"?e.name:e},_getFormatterName:function(e){var t=this.legendOption.formatter,n;return typeof t=="function"?n=t.call(this.myChart,e):typeof t=="string"?n=t.replace("{name}",e):n=e,n},_getFormatterNameFromData:function(e){var t=this._getName(e);return this._getFormatterName(t)},_mLineOptimize:function(){var e=[],t=this._itemGroupLocation.x;for(var n=2,r=this.shapeList.length;nh?(u=h,l+=i+n):u=Math.max(u,d),l+=i+n,d=0;continue}d+=r+f.getTextWidth(this._getFormatterNameFromData(e[m]),e[m].textStyle?this.getFont(a.merge(e[m].textStyle||{},s)):o)+n}l=Math.max(l,i),d-=n,d>h?(u=h,l+=i+n):u=Math.max(u,d)}else{for(var m=0;mp?(l=p,u+=v+n):l=Math.max(l,d),u+=v+n,d=0;continue}d+=i+n}u=Math.max(u,v),d-=n,d>p?(l=p,u+=v+n):l=Math.max(l,d)}h=this.zr.getWidth(),p=this.zr.getHeight();var g;switch(this.legendOption.x){case"center":g=Math.floor((h-u)/2);break;case"left":g=this.legendOption.padding[3]+this.legendOption.borderWidth;break;case"right":g=h-u-this.legendOption.padding[1]-this.legendOption.padding[3]-this.legendOption.borderWidth*2;break;default:g=this.parsePercent(this.legendOption.x,h)}var y;switch(this.legendOption.y){case"top":y=this.legendOption.padding[0]+this.legendOption.borderWidth;break;case"bottom":y=p-l-this.legendOption.padding[0]-this.legendOption.padding[2]-this.legendOption.borderWidth*2;break;case"center":y=Math.floor((p-l)/2);break;default:y=this.parsePercent(this.legendOption.y,p)}return{x:g,y:y,width:u,height:l,maxWidth:v}},_getSomethingByName:function(e){var t=this.option.series,n;for(var r=0,i=t.length;r=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height?!0:!1}},i.inherits(o,t),o}),define("echarts/component/timeline",["require","./base","zrender/shape/Rectangle","../util/shape/Icon","../util/shape/Chain","../config","zrender/tool/util","zrender/tool/area","zrender/tool/event","../component"],function(e){function f(e,n,r,i,u){t.call(this,e,n,r,i,u);var a=this;a._onclick=function(e){return a.__onclick(e)},a._ondrift=function(e,t){return a.__ondrift(this,e,t)},a._ondragend=function(){return a.__ondragend()},a._setCurrentOption=function(){var e=a.timelineOption;a.currentIndex%=e.data.length;var t=a.options[a.currentIndex]||{};a.myChart.setOption(t,e.notMerge),a.messageCenter.dispatch(s.EVENT.TIMELINE_CHANGED,null,{currentIndex:a.currentIndex,data:typeof e.data[a.currentIndex].name!="undefined"?e.data[a.currentIndex].name:e.data[a.currentIndex]},a.myChart)},a._onFrame=function(){a._setCurrentOption(),a._syncHandleShape(),a.timelineOption.autoPlay&&(a.playTicket=setTimeout(function(){a.currentIndex+=1;if(!a.timelineOption.loop&&a.currentIndex>=a.timelineOption.data.length){a.currentIndex=a.timelineOption.data.length-1,a.stop();return}a._onFrame()},a.timelineOption.playInterval))},this.setTheme(!1),this.options=this.option.options,this.currentIndex=this.timelineOption.currentIndex%this.timelineOption.data.length,!this.timelineOption.notMerge&&this.currentIndex!==0&&(this.options[this.currentIndex]=o.merge(this.options[this.currentIndex],this.options[0])),this.timelineOption.show&&(this._buildShape(),this._syncHandleShape()),this._setCurrentOption();if(this.timelineOption.autoPlay){var a=this;this.playTicket=setTimeout(function(){a.play()},this.ecTheme.animationDuration)}}function l(e,t){var n=2,i=t.x+n,s=t.y+n+2,o=t.width-n,u=t.height-n,a=t.symbol;if(a=="last")e.moveTo(i+o-2,s+u/3),e.lineTo(i+o-2,s),e.lineTo(i+2,s+u/2),e.lineTo(i+o-2,s+u),e.lineTo(i+o-2,s+u/3*2),e.moveTo(i,s),e.lineTo(i,s);else if(a=="next")e.moveTo(i+2,s+u/3),e.lineTo(i+2,s),e.lineTo(i+o-2,s+u/2),e.lineTo(i+2,s+u),e.lineTo(i+2,s+u/3*2),e.moveTo(i,s),e.lineTo(i,s);else if(a=="play")if(t.status=="stop")e.moveTo(i+2,s),e.lineTo(i+o-2,s+u/2),e.lineTo(i+2,s+u),e.lineTo(i+2,s);else{var f=t.brushType=="both"?2:3;e.rect(i+2,s,f,u),e.rect(i+o-f-2,s,f,u)}else if(a.match("image")){var l="";l=a.replace(new RegExp("^image:\\/\\/"),""),a=r.prototype.iconLibrary.image,a(e,{x:i,y:s,width:o,height:u,image:l})}}var t=e("./base"),n=e("zrender/shape/Rectangle"),r=e("../util/shape/Icon"),i=e("../util/shape/Chain"),s=e("../config"),o=e("zrender/tool/util"),u=e("zrender/tool/area"),a=e("zrender/tool/event");return f.prototype={type:s.COMPONENT_TYPE_TIMELINE,_buildShape:function(){this._location=this._getLocation(),this._buildBackground(),this._buildControl(),this._chainPoint=this._getChainPoint();if(this.timelineOption.label.show){var e=this._getInterval();for(var t=0,n=this._chainPoint.length;t3){var o=!1,a,f;n=0;while(!o&&n1){var v=c/h;v=v>50?50:v<20?5:v,c-=v*2;if(e.type=="number")for(var m=0;m0?"right":"left",S=[r*Math.PI/180,f,l-5]):S=!1,g.push({x:f,n:b,isEmpty:w,symbol:y,symbolSize:a[m].symbolSize||n,color:a[m].color,borderColor:a[m].borderColor,borderWidth:a[m].borderWidth,name:this._getReformedLabel(m),textColor:u.color,textAlign:E,textBaseline:u.baseline||"middle",textX:f,textY:l-(r?5:0),textFont:a[m].textStyle?this.getFont(u):s,rotation:S,showLabel:!1});return g},_buildBackground:function(){var e=this.timelineOption,t=e.padding,r=this._location.width,i=this._location.height;(e.borderWidth!==0||e.backgroundColor.replace(/\s/g,"")!="rgba(0,0,0,0)")&&this.shapeList.push(new n({zlevel:this._zlevelBase,hoverable:!1,style:{x:this._location.x-t[3],y:this._location.y-t[0],width:r+t[1]+t[3],height:i+t[0]+t[2],brushType:e.borderWidth===0?"fill":"both",color:e.backgroundColor,strokeColor:e.borderColor,lineWidth:e.borderWidth}}))},_buildControl:function(){var e=this,t=this.timelineOption,n=t.lineStyle,i=t.controlStyle;if(t.controlPosition=="none")return;var s=15,u=5,a;t.controlPosition=="left"?(a=this._location.x,this._location.x+=(s+u)*3):(a=this._location.x2-((s+u)*3-u),this._location.x2-=(s+u)*3);var f=this._location.y,l={zlevel:this._zlevelBase+1,style:{iconType:"timelineControl",symbol:"last",x:a,y:f,width:s,height:s,brushType:"stroke",color:i.normal.color,strokeColor:i.normal.color,lineWidth:n.width},highlightStyle:{color:i.emphasis.color,strokeColor:i.emphasis.color,lineWidth:n.width+1},clickable:!0};this._ctrLastShape=new r(l),this._ctrLastShape.onclick=function(){e.last()},this.shapeList.push(this._ctrLastShape),a+=s+u,this._ctrPlayShape=new r(o.clone(l)),this._ctrPlayShape.style.brushType="fill",this._ctrPlayShape.style.symbol="play",this._ctrPlayShape.style.status=this.timelineOption.autoPlay?"playing":"stop",this._ctrPlayShape.style.x=a,this._ctrPlayShape.onclick=function(){e._ctrPlayShape.style.status=="stop"?e.play():e.stop()},this.shapeList.push(this._ctrPlayShape),a+=s+u,this._ctrNextShape=new r(o.clone(l)),this._ctrNextShape.style.symbol="next",this._ctrNextShape.style.x=a,this._ctrNextShape.onclick=function(){e.next()},this.shapeList.push(this._ctrNextShape)},_buildChain:function(){var e=this.timelineOption,t=e.lineStyle;this._timelineShae={zlevel:this._zlevelBase,style:{x:this._location.x,y:this.subPixelOptimize(this._location.y,t.width),width:this._location.x2-this._location.x,height:this._location.height,chainPoint:this._chainPoint,brushType:"both",strokeColor:t.color,lineWidth:t.width,lineType:t.type},hoverable:!1,clickable:!0,onclick:this._onclick},this._timelineShae=new i(this._timelineShae),this.shapeList.push(this._timelineShae)},_buildHandle:function(){var e=this._chainPoint[this.currentIndex],t=e.symbolSize+1;t=t<5?5:t,this._handleShape={zlevel:this._zlevelBase+1,hoverable:!1,draggable:!0,style:{iconType:"diamond",n:e.n,x:e.x-t,y:this._location.y+this._location.height/4-t,width:t*2,height:t*2,brushType:"both",textPosition:"specific",textX:e.x,textY:this._location.y-this._location.height/4,textAlign:"center",textBaseline:"middle"},highlightStyle:{},ondrift:this._ondrift,ondragend:this._ondragend},this._handleShape=new r(this._handleShape),this.shapeList.push(this._handleShape)},_syncHandleShape:function(){if(!this.timelineOption.show)return;var e=this.timelineOption,t=e.checkpointStyle,n=this._chainPoint[this.currentIndex];this._handleShape.style.text=t.label.show?n.name:"",this._handleShape.style.textFont=n.textFont,this._handleShape.style.n=n.n,t.symbol=="auto"?this._handleShape.style.iconType=n.symbol!="none"?n.symbol:"diamond":(this._handleShape.style.iconType=t.symbol,t.symbol.match("star")&&(this._handleShape.style.n=t.symbol.replace("star","")-0||5,this._handleShape.style.iconType="star"));var r;t.symbolSize=="auto"?(r=n.symbolSize+2,r=r<5?5:r):r=t.symbolSize-0,this._handleShape.style.color=t.color=="auto"?n.color?n.color:e.controlStyle.emphasis.color:t.color,this._handleShape.style.textColor=t.label.textStyle.color=="auto"?this._handleShape.style.color:t.label.textStyle.color,this._handleShape.highlightStyle.strokeColor=this._handleShape.style.strokeColor=t.borderColor=="auto"?n.borderColor?n.borderColor:"#fff":t.borderColor,this._handleShape.style.lineWidth=t.borderWidth=="auto"?n.borderWidth?n.borderWidth:0:t.borderWidth-0,this._handleShape.highlightStyle.lineWidth=this._handleShape.style.lineWidth+1,this.zr.animate(this._handleShape.id,"style").when(500,{x:n.x-r,textX:n.x,y:this._location.y+this._location.height/4-r,width:r*2,height:r*2}).start("ExponentialOut")},_findChainIndex:function(e){var t=this._chainPoint,n=t.length;if(e<=t[0].x)return 0;if(e>=t[n-1].x)return n-1;for(var r=0;r=t[r].x&&e<=t[r+1].x)return Math.abs(e-t[r].x)=n[r-1].x-n[r-1].symbolSize?(e.style.x=n[r-1].x-n[r-1].symbolSize,i=r-1):(e.style.x+=t,i=this._findChainIndex(e.style.x));var s=n[i],o=s.symbolSize+2;e.style.iconType=s.symbol,e.style.n=s.n,e.style.textX=e.style.x+o/2,e.style.y=this._location.y+this._location.height/4-o,e.style.width=o*2,e.style.height=o*2,e.style.text=s.name;if(i==this.currentIndex)return!0;this.currentIndex=i;if(this.timelineOption.realtime){clearTimeout(this.playTicket);var u=this;this.playTicket=setTimeout(function(){u._setCurrentOption()},200)}return!0},__ondragend:function(){this.isDragend=!0},ondragend:function(e,t){if(!this.isDragend||!e.target)return;!this.timelineOption.realtime&&this._setCurrentOption(),t.dragOut=!0,t.dragIn=!0,t.needRefresh=!1,this.isDragend=!1,this._syncHandleShape();return},last:function(){return this.timelineOption.autoPlay&&this.stop(),this.currentIndex-=1,this.currentIndex<0&&(this.currentIndex=this.timelineOption.data.length-1),this._onFrame(),this.currentIndex},next:function(){return this.timelineOption.autoPlay&&this.stop(),this.currentIndex+=1,this.currentIndex>=this.timelineOption.data.length&&(this.currentIndex=0),this._onFrame(),this.currentIndex},play:function(e,t){return this._ctrPlayShape&&this._ctrPlayShape.style.status!="playing"&&(this._ctrPlayShape.style.status="playing",this.zr.modShape(this._ctrPlayShape.id),this.zr.refresh()),this.timelineOption.autoPlay=typeof t!="undefined"?t:!0,this.timelineOption.autoPlay||clearTimeout(this.playTicket),this.currentIndex=typeof e!="undefined"?e:this.currentIndex+1,this.currentIndex>=this.timelineOption.data.length&&(this.currentIndex=0),this._onFrame(),this.currentIndex},stop:function(){return this._ctrPlayShape&&this._ctrPlayShape.style.status!="stop"&&(this._ctrPlayShape.style.status="stop",this.zr.modShape(this._ctrPlayShape.id),this.zr.refresh()),this.timelineOption.autoPlay=!1,clearTimeout(this.playTicket),this.currentIndex},resize:function(){this.timelineOption.show&&(this.clear(),this._buildShape(),this._syncHandleShape())},setTheme:function(e){this.timelineOption=this.reformOption(o.clone(this.option.timeline)),this.timelineOption.padding=this.reformCssArray(this.timelineOption.padding),this.timelineOption.label.textStyle=o.merge(this.timelineOption.label.textStyle||{},this.ecTheme.textStyle),this.timelineOption.checkpointStyle.label.textStyle=o.merge(this.timelineOption.checkpointStyle.label.textStyle||{},this.ecTheme.textStyle),this.timelineOption.show&&e&&(this.clear(),this._buildShape(),this._syncHandleShape())},dispose:function(){this.clear(),this.shapeList=null,clearTimeout(this.playTicket)}},r.prototype.iconLibrary.timelineControl=l,o.inherits(f,t),e("../component").define("timeline",f),f}),define("zrender/loadingEffect/Bar",["require","./Base","../tool/util","../tool/color","../shape/Rectangle"],function(e){function s(e){t.call(this,e)}var t=e("./Base"),n=e("../tool/util"),r=e("../tool/color"),i=e("../shape/Rectangle");return n.inherits(s,t),s.prototype._start=function(e,t){var s=n.merge(this.options,{textStyle:{color:"#888"},backgroundColor:"rgba(250, 250, 250, 0.8)",effectOption:{x:0,y:this.canvasHeight/2-30,width:this.canvasWidth,height:5,brushType:"fill",timeInterval:100}}),o=this.createTextShape(s.textStyle),u=this.createBackgroundShape(s.backgroundColor),a=s.effectOption,f=new i({highlightStyle:n.clone(a)});f.highlightStyle.color=a.color||r.getLinearGradient(a.x,a.y,a.x+a.width,a.y+a.height,[[0,"#ff6400"],[.5,"#ffe100"],[1,"#b1ff00"]]);if(s.progress!=null){e(u),f.highlightStyle.width=this.adjust(s.progress,[0,1])*s.effectOption.width,e(f),e(o),t();return}return f.highlightStyle.width=0,setInterval(function(){e(u),f.highlightStyle.width=h&&(c[n].len=Math.ceil(Math.random()*400),r.xStart=-400,r.xEnd=-400+c[n].len,r.yStart=Math.ceil(Math.random()*p),r.yEnd=r.yStart),r.xStart+=c[n].animationX,r.xEnd+=c[n].animationX,e(c[n])}e(o),t()},a.timeInterval)},s}),define("zrender/loadingEffect/Ring",["require","./Base","../tool/util","../tool/color","../shape/Ring","../shape/Sector"],function(e){function o(e){t.call(this,e)}var t=e("./Base"),n=e("../tool/util"),r=e("../tool/color"),i=e("../shape/Ring"),s=e("../shape/Sector");return n.inherits(o,t),o.prototype._start=function(e,t){var o=n.merge(this.options,{textStyle:{color:"#07a"},backgroundColor:"rgba(250, 250, 250, 0.8)",effect:{x:this.canvasWidth/2,y:this.canvasHeight/2,r0:60,r:100,color:"#bbdcff",brushType:"fill",textPosition:"inside",textFont:"normal 30px verdana",textColor:"rgba(30, 144, 255, 0.6)",timeInterval:100}}),u=o.effect,a=o.textStyle;a.x==null&&(a.x=u.x),a.y==null&&(a.y=u.y+(u.r0+u.r)/2-5);var f=this.createTextShape(o.textStyle),l=this.createBackgroundShape(o.backgroundColor),c=u.x,h=u.y,p=u.r0+6,d=u.r-6,v=u.color,m=r.lift(v,.1),g=new i({highlightStyle:n.clone(u)}),y=[],b=r.getGradientColors(["#ff6400","#ffe100","#97ff00"],25),w=15,E=240;for(var S=0;S<16;S++)y.push(new s({highlightStyle:{x:c,y:h,r0:p,r:d,startAngle:E-w,endAngle:E,brushType:"fill",color:m},_color:r.getLinearGradient(c+p*Math.cos(E,!0),h-p*Math.sin(E,!0),c+p*Math.cos(E-w,!0),h-p*Math.sin(E-w,!0),[[0,b[S*2]],[1,b[S*2+1]]])})),E-=w;E=360;for(var S=0;S<4;S++)y.push(new s({highlightStyle:{x:c,y:h,r0:p,r:d,startAngle:E-w,endAngle:E,brushType:"fill",color:m},_color:r.getLinearGradient(c+p*Math.cos(E,!0),h-p*Math.sin(E,!0),c+p*Math.cos(E-w,!0),h-p*Math.sin(E-w,!0),[[0,b[S*2+32]],[1,b[S*2+33]]])})),E-=w;var x=0;if(o.progress!=null){e(l),x=this.adjust(o.progress,[0,1]).toFixed(2)*100/5,g.highlightStyle.text=x*5+"%",e(g);for(var S=0;S<20;S++)y[S].highlightStyle.color=S=20?-20:1,e(g);for(var n=0;n<20;n++)y[n].highlightStyle.color=n ");var u=-1;for(var a=0,f=o.length;a-1){o.splice(u,1),this._optionRestore.series[e][n].data.splice(u,1);var c=this.chart[i.type];c&&c.delMark(e,t.join(" > "),n)}return this},getDom:function(){return this.dom},getZrender:function(){return this._zr},getDataURL:function(e){if(!s)return"";if(this._chartList.length===0){var t="IMG"+this.id,n=document.getElementById(t);if(n)return n.src}var r=this.component.tooltip;r&&r.hideTip();switch(e){case"jpeg":break;default:e="png"}var i=this._option.backgroundColor;return i&&i.replace(" ","")=="rgba(0,0,0,0)"&&(i="#fff"),this._zr.toDataURL("image/"+e,i)},getImage:function(e){var t=this._optionRestore.title,n=document.createElement("img");return n.src=this.getDataURL(e),n.title=t&&t.text||"ECharts",n},getConnectedDataURL:function(t){if(!this.isConnected())return this.getDataURL(t);var n=this.dom,r={self:{img:this.getDataURL(t),left:n.offsetLeft,top:n.offsetTop,right:n.offsetLeft+n.offsetWidth,bottom:n.offsetTop+n.offsetHeight}},i=r.self.left,s=r.self.top,o=r.self.right,u=r.self.bottom;for(var a in this._connected)n=this._connected[a].getDom(),r[a]={img:this._connected[a].getDataURL(t),left:n.offsetLeft,top:n.offsetTop,right:n.offsetLeft+n.offsetWidth,bottom:n.offsetTop+n.offsetHeight},i=Math.min(i,r[a].left),s=Math.min(s,r[a].top),o=Math.max(o,r[a].right),u=Math.max(u,r[a].bottom);var f=document.createElement("div");f.style.position="absolute",f.style.left="-4000px",f.style.width=o-i+"px",f.style.height=u-s+"px",document.body.appendChild(f);var l=e("zrender").init(f),c=e("zrender/shape/Image");for(var a in r)l.addShape(new c({style:{x:r[a].left-i,y:r[a].top-s,image:r[a].img}}));l.render();var h=this._option.backgroundColor;h&&h.replace(/ /g,"")=="rgba(0,0,0,0)"&&(h="#fff");var p=l.toDataURL("image/png",h);return setTimeout(function(){l.dispose(),f.parentNode.removeChild(f),f=null},100),p},getConnectedImage:function(e){var t=this._optionRestore.title,n=document.createElement("img");return n.src=this.getConnectedDataURL(e),n.title=t&&t.text||"ECharts",n},on:function(e,t){return this._messageCenterOutSide.bind(e,t,this),this},un:function(e,t){return this._messageCenterOutSide.unbind(e,t),this},connect:function(e){if(!e)return this;this._connected||(this._connected={});if(e instanceof Array)for(var t=0,n=e.length;t=n/3?1:2),o=t.y+Math.sin(i)*r*(r>=n/3?1:2);i=t.angle-Math.PI/2,e.moveTo(s,o),e.lineTo(t.x+Math.cos(i)*r,t.y-Math.sin(i)*r),e.lineTo(t.x+Math.cos(t.angle)*n,t.y-Math.sin(t.angle)*n),e.lineTo(t.x-Math.cos(i)*r,t.y+Math.sin(i)*r),e.lineTo(s,o);return},getRect:function(e){if(e.__rect)return e.__rect;var t=e.width*2,n=e.x,r=e.y,i=n+Math.cos(e.angle)*e.r,s=r-Math.sin(e.angle)*e.r;return e.__rect={x:Math.min(n,i)-t,y:Math.min(r,s)-t,width:Math.abs(n-i)+t,height:Math.abs(r-s)+t},e.__rect},isCover:e("./normalIsCover")},n.inherits(r,t),r}),define("echarts/chart/gauge",["require","../component/base","./base","../util/shape/GaugePointer","zrender/shape/Text","zrender/shape/Line","zrender/shape/Rectangle","zrender/shape/Circle","zrender/shape/Sector","../config","../util/ecData","../util/accMath","zrender/tool/util","../chart"],function(e){function p(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this),this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("../util/shape/GaugePointer"),i=e("zrender/shape/Text"),s=e("zrender/shape/Line"),o=e("zrender/shape/Rectangle"),u=e("zrender/shape/Circle"),a=e("zrender/shape/Sector"),f=e("../config"),l=e("../util/ecData"),c=e("../util/accMath"),h=e("zrender/tool/util");return p.prototype={type:f.CHART_TYPE_GAUGE,_buildShape:function(){var e=this.series;this._paramsMap={};for(var t=0,n=e.length;t=110&&v<=250?"left":v<=70||v>=290?"right":"center",textBaseline:v>=10&&v<=170?"top":v>=190&&v<=350?"bottom":"middle",textFont:u,shadowColor:o.shadowColor,shadowBlur:o.shadowBlur,shadowOffsetX:o.shadowOffsetX,shadowOffsetY:o.shadowOffsetY}}))},_buildPointer:function(e){var t=this.series[e];if(!t.pointer.show)return;var n=t.max-t.min,i=t.pointer,s=this._paramsMap[e],o=this.parsePercent(i.length,s.radius[1]),a=this.parsePercent(i.width,s.radius[1]),f=s.center,c=this._getValue(e);c=c2?2:a/2,color:"#fff"}});l.pack(d,this.series[e],e,this.series[e].data[0],0,this.series[e].data[0].name,c),this.shapeList.push(d),this.shapeList.push(new u({zlevel:this._zlevelBase+2,hoverable:!1,style:{x:f[0],y:f[1],r:i.width/2.5,color:"#fff"}}))},_buildTitle:function(e){var t=this.series[e];if(!t.title.show)return;var n=t.data[0],r=typeof n.name!="undefined"?n.name:"";if(r!==""){var s=t.title,o=s.offsetCenter,u=s.textStyle,a=u.color,f=this._paramsMap[e],l=f.center[0]+this.parsePercent(o[0],f.radius[1]),c=f.center[1]+this.parsePercent(o[1],f.radius[1]);this.shapeList.push(new i({zlevel:this._zlevelBase+(Math.abs(l-f.center[0])+Math.abs(c-f.center[1]))=t)return n[r][1];return n[n.length-1][1]},_getSector:function(e,t,n,r,i,s,o){return new a({zlevel:this._zlevelBase,hoverable:!1,style:{x:e[0],y:e[1],r0:t,r:n,startAngle:r,endAngle:i,brushType:"fill",color:s,shadowColor:o.shadowColor,shadowBlur:o.shadowBlur,shadowOffsetX:o.shadowOffsetX,shadowOffsetY:o.shadowOffsetY}})},_getLabelText:function(e,t){if(e){if(typeof e=="function")return e.call(this.myChart,t);if(typeof e=="string")return e.replace("{value}",t)}return t},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()}},h.inherits(p,n),h.inherits(p,t),e("../chart").define("gauge",p),p}),define("echarts/chart/funnel",["require","../component/base","./base","zrender/shape/Text","zrender/shape/Line","zrender/shape/Polygon","../config","../util/ecData","../util/number","zrender/tool/util","zrender/tool/color","zrender/tool/area","../chart"],function(e){function h(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this),this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("zrender/shape/Text"),i=e("zrender/shape/Line"),s=e("zrender/shape/Polygon"),o=e("../config"),u=e("../util/ecData"),a=e("../util/number"),f=e("zrender/tool/util"),l=e("zrender/tool/color"),c=e("zrender/tool/area");return h.prototype={type:o.CHART_TYPE_FUNNEL,_buildShape:function(){var e=this.series,t=this.component.legend;this._paramsMap={},this._selected={},this.selectedMap={};var n;for(var r=0,i=e.length;r1?(i.height-(o-1)*h)/o:i.height,d,v=i.y,m=n.sort=="descending"?this._getItemWidth(e,u[0].value):a.parsePercent(n.minSize,i.width),g=n.sort=="descending"?1:0,y=i.centerX,b=[[y-m/2-(m===0?0:10),v-(m===0?10:5)],[y+m/2+(m===0?0:10),v-(m===0?10:5)]];for(var f=0,l=u.length;fc.getTextWidth(w,E)?T="#fff":T=l.reverse(n)):g.position=="left"?(S="right",x=b=="auto"?d.x-10:d.centerX-Math.max(o,u)/2-b):(S="left",x=b=="auto"?d.x+d.width+10:d.centerX+Math.max(o,u)/2+b);var N={zlevel:this._zlevelBase+1,style:{x:x,y:s+a/2,color:y.color||T,text:w,textAlign:y.align||S,textBaseline:y.baseline||"middle",textFont:E}};return m="emphasis",g=v[m].label||g,y=g.textStyle||y,b=v[m].labelLine.length||b,g.position=g.position||v.normal.label.position,w=this.getLabelText(e,t,m),E=this.getFont(y),T=n,g.position=="inner"||g.position=="inside"?(S="center",x=i+o/2,Math.max(o,u)/2>c.getTextWidth(w,E)?T="#fff":T=l.reverse(n)):g.position=="left"?(S="right",x=b=="auto"?d.x-10:d.centerX-Math.max(o,u)/2-b):(S="left",x=b=="auto"?d.x+d.width+10:d.centerX+Math.max(o,u)/2+b),N.highlightStyle={x:x,color:y.color||T,text:w,textAlign:y.align||S,textFont:E,brushType:"fill"},new r(N)},getLabelText:function(e,t,n){var r=this.series,i=r[e],s=i.data[t],o=this.deepQuery([s,i],"itemStyle."+n+".label.formatter");if(!o)return s.name;if(typeof o=="function")return o.call(this.myChart,i.name,s.name,s.value);if(typeof o=="string")return o=o.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}"),o=o.replace("{a0}",i.name).replace("{b0}",s.name).replace("{c0}",s.value),o},getLabelLine:function(e,t,n,r,s,o,u,a){var l=this.series[e],c=l.data[t],h=this._paramsMap[e].location,p=f.merge(f.clone(c.itemStyle)||{},l.itemStyle),d="normal",v=p[d].labelLine,m=p[d].labelLine.length,g=v.lineStyle||{},y=p[d].label;y.position=y.position||p.normal.label.position;var b;y.position=="inner"||y.position=="inside"?b=r+o/2:y.position=="left"?b=m=="auto"?h.x-10:h.centerX-Math.max(o,u)/2-m:b=m=="auto"?h.x+h.width+10:h.centerX+Math.max(o,u)/2+m;var w={zlevel:this._zlevelBase+1,hoverable:!1,style:{xStart:h.centerX,yStart:s+a/2,xEnd:b,yEnd:s+a/2,strokeColor:g.color||n,lineType:g.type,lineWidth:g.width}};return d="emphasis",v=p[d].labelLine||v,m=p[d].labelLine.length||m,g=v.lineStyle||g,y=p[d].label||y,y.position=y.position,y.position=="inner"||y.position=="inside"?b=r+o/2:y.position=="left"?b=m=="auto"?h.x-10:h.centerX-Math.max(o,u)/2-m:b=m=="auto"?h.x+h.width+10:h.centerX+Math.max(o,u)/2+m,w.highlightStyle={xEnd:b,strokeColor:g.color||n,lineType:g.type,lineWidth:g.width},new i(w)},_needLabel:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".label.show")},_needLabelLine:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".labelLine.show")},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()}},f.inherits(h,n),f.inherits(h,t),e("../chart").define("funnel",h),h}),define("echarts/component/categoryAxis",["require","./base","zrender/shape/Text","zrender/shape/Line","zrender/shape/Rectangle","../config","zrender/tool/util","zrender/tool/area","../component"],function(e){function a(e,n,r,i,s,o){if(i.data.length<1){console.error("option.data.length < 1.");return}t.call(this,e,n,r,i,s),this.grid=this.component.grid;for(var u in o)this[u]=o[u];this.refresh(i)}var t=e("./base"),n=e("zrender/shape/Text"),r=e("zrender/shape/Line"),i=e("zrender/shape/Rectangle"),s=e("../config"),o=e("zrender/tool/util"),u=e("zrender/tool/area");return a.prototype={type:s.COMPONENT_TYPE_AXIS_CATEGORY,_getReformedLabel:function(e){var t=typeof this.option.data[e].value!="undefined"?this.option.data[e].value:this.option.data[e],n=this.option.data[e].formatter||this.option.axisLabel.formatter;return n&&(typeof n=="function"?t=n.call(this.myChart,t):typeof n=="string"&&(t=n.replace("{value}",t))),t},_getInterval:function(){var e=this.option.axisLabel.interval;if(e=="auto"){var t=this.option.axisLabel.textStyle.fontSize,n=this.option.data,r=this.option.data.length;if(this.isHorizontal())if(r>3){var i=this.getGap(),s=!1,a,f,l=Math.floor(.5/i);l=l<1?1:l,e=Math.floor(15/i);while(!s&&e=0;c-=e){if(this.option.axisLabel.rotate!==0)f=t;else if(n[c].textStyle)f=u.getTextWidth(this._getReformedLabel(c),this.getFont(o.merge(n[c].textStyle,this.option.axisLabel.textStyle)));else{var h=this._getReformedLabel(c)+"",p=(h.match(/\w/g)||"").length,d=h.length-p;f=p*t*2/3+d*t}if(a3){var i=this.getGap();e=Math.floor(11/i);while(i*e-60?-u:0;if(this.isHorizontal()){var c=this.option.position=="bottom"?n.inside?this.grid.getYend()-i-1:this.grid.getYend()+1:n.inside?this.grid.getY()+1:this.grid.getY()-i-1,h;for(var p=l;p=0?f:0),o),e={_axisShape:"axisTick",zlevel:this._zlevelBase,hoverable:!1,style:{xStart:h,yStart:c,xEnd:h,yEnd:c+i,strokeColor:s,lineWidth:o}},this.shapeList.push(new r(e))}else{var d=this.option.position=="left"?n.inside?this.grid.getX()+1:this.grid.getX()-i-1:n.inside?this.grid.getXend()-i-1:this.grid.getXend()+1,v;for(var p=l;p=0?f:0),o),e={_axisShape:"axisTick",zlevel:this._zlevelBase,hoverable:!1,style:{xStart:d,yStart:v,xEnd:d+i,yEnd:v,strokeColor:s,lineWidth:o}},this.shapeList.push(new r(e))}},_buildAxisLabel:function(){var e,t=this.option.data,r=this.option.data.length,i=this.option.axisLabel.rotate,s=this.option.axisLabel.margin,u=this.option.axisLabel.clickable,a=this.option.axisLabel.textStyle,f;if(this.isHorizontal()){var l,c;this.option.position=="bottom"?(l=this.grid.getYend()+s,c="top"):(l=this.grid.getY()-s,c="bottom");for(var h=0;h0?this.option.position=="bottom"?"right":"left":this.option.position=="bottom"?"left":"right",e.rotation=[i*Math.PI/180,e.style.x,e.style.y]),this.shapeList.push(new n(this._axisLabelClickable(u,e)))}}else{var p,d;this.option.position=="left"?(p=this.grid.getX()-s,d="right"):(p=this.grid.getXend()+s,d="left");for(var h=0;h1?e-1:1)},getCoord:function(e){var t=this.option.data,n=t.length,r=this.getGap(),i=this.option.boundaryGap?r/2:0;for(var s=0;sthis.option.data.length-1)return this.isHorizontal()?this.grid.getXend():this.grid.getY();var t=this.getGap(),n=this.option.boundaryGap?t/2:0;return n+=e*t,this.isHorizontal()?n=this.grid.getX()+n:n=this.grid.getYend()-n,n},getNameByIndex:function(e){var t=this.option.data[e];return typeof t!="undefined"&&typeof t.value!="undefined"?t.value:t},getIndexByName:function(e){var t=this.option.data,n=t.length;for(var r=0;r0?this.option.position=="bottom"?"right":"left":this.option.position=="bottom"?"left":"right",e.rotation=[i*Math.PI/180,e.style.x,e.style.y]),this.shapeList.push(new n(this._axisLabelClickable(o,e)))}else{var c,h;this.option.position=="left"?(c=this.grid.getX()-s,h="right"):(c=this.grid.getXend()+s,h="left");for(var l=0;l=0?typeof t[h][l]!="undefined"?t[h][l]+=n:t[h][l]=n:typeof t[p][l]!="undefined"?t[p][l]+=n:t[p][l]=n,this.option.scale&&t[f].push(n)}}}for(var u in t){e=t[u];for(var l=0,c=e.length;l0?this.option.power:1:this._max>0?this._min=this._max/this.option.splitNumber:this._max=this._max/this.option.splitNumber),this._reformValue(this.option.scale)}else this._hasData=!0,this._min=this.option.min-0,this._max=this.option.max-0,this._customerValue()},_reformValue:function(e){var t=this.option.splitNumber,n=this.option.precision,r,i;n===0?i=this.option.power>1?this.option.power:1:(i=Math.pow(10,n),this._min*=i,this._max*=i,i=this.option.power);var s;if(this._min>=0&&this._max>=0){if(!e){while(this._max/i1?i/10:1,s=this._max-this._min,r=Math.ceil(s/t/i)*i,this._max=this._min+r*t}else if(this._min<=0&&this._max<=0){i=-i;if(!e){while(this._min/ii&&i!=-1)i/=10;n===0&&(this._min=Math.ceil(this._min/i)*i,this._max=Math.floor(this._max/i)*i)}i=i<-1?i/10:-1,s=this._min-this._max,r=-Math.ceil(s/t/i)*i,this._min=-r*t+this._max}else{s=this._max-this._min;while(s/ithis._max?this._max:e;var t;return this.isHorizontal()?t=this.grid.getX()+(e-this._min)/(this._max-this._min)*this.grid.getWidth():t=this.grid.getYend()-(e-this._min)/(this._max-this._min)*this.grid.getHeight(),t},getCoordSize:function(e){return this.isHorizontal()?Math.abs(e/(this._max-this._min)*this.grid.getWidth()):Math.abs(e/(this._max-this._min)*this.grid.getHeight())},getValueFromCoord:function(e){var t;return this.isHorizontal()?(e=ethis.grid.getXend()?this.grid.getXend():e,t=this._min+(e-this.grid.getX())/this.grid.getWidth()*(this._max-this._min)):(e=ethis.grid.getYend()?this.grid.getYend():e,t=this._max-(e-this.grid.getY())/this.grid.getHeight()*(this._max-this._min)),t.toFixed(2)-0}},o.inherits(u,t),e("../component").define("valueAxis",u),u}),define("echarts/component/axis",["require","./base","zrender/shape/Line","../config","../util/ecData","zrender/tool/util","zrender/tool/color","./categoryAxis","./valueAxis","../component"],function(e){function u(e,n,r,i,s,o){t.call(this,e,n,r,i,s),this.axisType=o,this._axisList=[],this.refresh(i)}var t=e("./base"),n=e("zrender/shape/Line"),r=e("../config"),i=e("../util/ecData"),s=e("zrender/tool/util"),o=e("zrender/tool/color");return u.prototype={type:r.COMPONENT_TYPE_AXIS,axisBase:{_buildAxisLine:function(){var e=this.option.axisLine.lineStyle.width,t=e/2,r={_axisShape:"axisLine",zlevel:this._zlevelBase+1,hoverable:!1};switch(this.option.position){case"left":r.style={xStart:this.grid.getX()-t,yStart:this.grid.getYend(),xEnd:this.grid.getX()-t,yEnd:this.grid.getY(),lineCap:"round"};break;case"right":r.style={xStart:this.grid.getXend()+t,yStart:this.grid.getYend(),xEnd:this.grid.getXend()+t,yEnd:this.grid.getY(),lineCap:"round"};break;case"bottom":r.style={xStart:this.grid.getX(),yStart:this.grid.getYend()+t,xEnd:this.grid.getXend(),yEnd:this.grid.getYend()+t,lineCap:"round"};break;case"top":r.style={xStart:this.grid.getX(),yStart:this.grid.getY()-t,xEnd:this.grid.getXend(),yEnd:this.grid.getY()-t,lineCap:"round"}}this.option.name!==""&&(r.style.text=this.option.name,r.style.textPosition=this.option.nameLocation,r.style.textFont=this.getFont(this.option.nameTextStyle),this.option.nameTextStyle.align&&(r.style.textAlign=this.option.nameTextStyle.align),this.option.nameTextStyle.baseline&&(r.style.textBaseline=this.option.nameTextStyle.baseline),this.option.nameTextStyle.color&&(r.style.textColor=this.option.nameTextStyle.color)),r.style.strokeColor=this.option.axisLine.lineStyle.color,r.style.lineWidth=e,this.isHorizontal()?r.style.yStart=r.style.yEnd=this.subPixelOptimize(r.style.yEnd,e):r.style.xStart=r.style.xEnd=this.subPixelOptimize(r.style.xEnd,e),r.style.lineType=this.option.axisLine.lineStyle.type,r=new n(r),this.shapeList.push(r)},_axisLabelClickable:function(e,t){return e?(i.pack(t,undefined,-1,undefined,-1,t.style.text),t.hoverable=!0,t.clickable=!0,t.highlightStyle={color:o.lift(t.style.color,1),brushType:"fill"},t):t},refixAxisShape:function(e,t){if(!this.option.axisLine.onZero)return;var n;if(this.isHorizontal()&&typeof t!="undefined")for(var r=0,i=this.shapeList.length;r2&&(e=[e[0],e[1]]);if(this.axisType=="xAxis"){if(!e[0].position||e[0].position!="bottom"&&e[0].position!="top")e[0].position="bottom";e.length>1&&(e[1].position=e[0].position=="bottom"?"top":"bottom");for(var t=0,n=e.length;t1&&(e[1].position=e[0].position=="left"?"right":"left");for(var t=0,n=e.length;t=0&&(o.isHorizontal()?t=o.getCoord(0):n=o.getCoord(0));if(typeof t!="undefined"||typeof n!="undefined"){s=i.length;while(s--)i[s].refixAxisShape(t,n)}},refresh:function(e){if(e||this._zrWidth!=this.zr.getWidth()||this._zrHeight!=this.zr.getHeight()){this.clear(),this.option=e||this.option,this.option.grid=this.reformOption(this.option.grid);var t=this.option.grid;this._zrWidth=this.zr.getWidth(),this._zrHeight=this.zr.getHeight(),this._x=this.parsePercent(t.x,this._zrWidth),this._y=this.parsePercent(t.y,this._zrHeight);var r=this.parsePercent(t.x2,this._zrWidth),i=this.parsePercent(t.y2,this._zrHeight);typeof t.width=="undefined"?this._width=this._zrWidth-this._x-r:this._width=this.parsePercent(t.width,this._zrWidth),typeof t.height=="undefined"?this._height=this._zrHeight-this._y-i:this._height=this.parsePercent(t.height,this._zrHeight),this._x=this.subPixelOptimize(this._x,t.borderWidth),this._y=this.subPixelOptimize(this._y,t.borderWidth),this.shapeList.push(new n({zlevel:this._zlevelBase,hoverable:!1,style:{x:this._x,y:this._y,width:this._width,height:this._height,brushType:t.borderWidth>0?"both":"fill",color:t.backgroundColor,strokeColor:t.borderColor,lineWidth:t.borderWidth}})),this.zr.addShape(this.shapeList[0])}}},i.inherits(s,t),e("../component").define("grid",s),s}),define("echarts/component/dataZoom",["require","./base","zrender/shape/Rectangle","zrender/shape/Polygon","../util/shape/Icon","../config","zrender/tool/util","../component","../component"],function(e){function u(e,n,r,i,s){t.call(this,e,n,r,i,s);var o=this;o._ondrift=function(e,t){return o.__ondrift(this,e,t)},o._ondragend=function(){return o.__ondragend()},this._fillerSize=28,this._handleSize=8,this._isSilence=!1,this._zoom={},this.option.dataZoom=this.reformOption(this.option.dataZoom),this.zoomOption=this.option.dataZoom,this._location=this._getLocation(),this._zoom=this._getZoom(),this._backupData(),this.option.dataZoom.show&&this._buildShape(),this._syncData()}var t=e("./base"),n=e("zrender/shape/Rectangle"),r=e("zrender/shape/Polygon"),i=e("../util/shape/Icon"),s=e("../config"),o=e("zrender/tool/util");return u.prototype={type:s.COMPONENT_TYPE_DATAZOOM,_buildShape:function(){this._buildBackground(),this._buildFiller(),this._buildHandle(),this._buildFrame();for(var e=0,t=this.shapeList.length;ep&&(h+=p,p=h-p,h-=p);var d=Math.round((p-h)/100*(this.zoomOption.orient=="horizontal"?this._location.width:this._location.height));return{start:h,end:p,start2:0,end2:100,size:d,xAxisIndex:i,yAxisIndex:o,seriesIndex:r,scatterMap:this._zoom.scatterMap||{}}},_backupData:function(){this._originalData={xAxis:{},yAxis:{},series:{}};var e=this.option.xAxis,t=this._zoom.xAxisIndex;for(var n=0,r=t.length;n1?1:0)),w=t/(i-(i>1?1:0)),E=1;this.zoomOption.orient=="horizontal"&&b<1?E=Math.floor(i*3/e):this.zoomOption.orient=="vertical"&&w<1&&(E=Math.floor(i*3/t));for(var a=0,f=i;athis._location.x?1:0),height:this._location.height-(t>this._location.y?1:0),lineWidth:1,brushType:"stroke",strokeColor:this.zoomOption.handleColor}},this._endFrameShape=o.clone(this._startFrameShape),this._startFrameShape=new n(this._startFrameShape),this._endFrameShape=new n(this._endFrameShape),this.shapeList.push(this._startFrameShape),this.shapeList.push(this._endFrameShape);return},_syncHandleShape:function(){this.zoomOption.orient=="horizontal"?(this._startShape.style.x=this._fillerShae.style.x-this._handleSize,this._endShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._zoom.start=Math.floor((this._startShape.style.x-this._location.x)/this._location.width*100),this._zoom.end=Math.ceil((this._endShape.style.x+this._handleSize-this._location.x)/this._location.width*100)):(this._startShape.style.y=this._fillerShae.style.y-this._handleSize,this._endShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._zoom.start=Math.floor((this._startShape.style.y-this._location.y)/this._location.height*100),this._zoom.end=Math.ceil((this._endShape.style.y+this._handleSize-this._location.y)/this._location.height*100)),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this._syncFrameShape(),this.zr.refresh()},_syncFillerShape:function(){var e,t;this.zoomOption.orient=="horizontal"?(e=this._startShape.style.x,t=this._endShape.style.x,this._fillerShae.style.x=Math.min(e,t)+this._handleSize,this._fillerShae.style.width=Math.abs(e-t)-this._handleSize,this._zoom.start=Math.floor((Math.min(e,t)-this._location.x)/this._location.width*100),this._zoom.end=Math.ceil((Math.max(e,t)+this._handleSize-this._location.x)/this._location.width*100)):(e=this._startShape.style.y,t=this._endShape.style.y,this._fillerShae.style.y=Math.min(e,t)+this._handleSize,this._fillerShae.style.height=Math.abs(e-t)-this._handleSize,this._zoom.start=Math.floor((Math.min(e,t)-this._location.y)/this._location.height*100),this._zoom.end=Math.ceil((Math.max(e,t)+this._handleSize-this._location.y)/this._location.height*100)),this.zr.modShape(this._fillerShae.id),this._syncFrameShape(),this.zr.refresh()},_syncFrameShape:function(){this.zoomOption.orient=="horizontal"?(this._startFrameShape.style.width=this._fillerShae.style.x-this._location.x,this._endFrameShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._endFrameShape.style.width=this._location.x+this._location.width-this._endFrameShape.style.x):(this._startFrameShape.style.height=this._fillerShae.style.y-this._location.y,this._endFrameShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._endFrameShape.style.height=this._location.y+this._location.height-this._endFrameShape.style.y),this.zr.modShape(this._startFrameShape.id),this.zr.modShape(this._endFrameShape.id)},_syncShape:function(){if(!this.zoomOption.show)return;this.zoomOption.orient=="horizontal"?(this._startShape.style.x=this._location.x+this._zoom.start/100*this._location.width,this._endShape.style.x=this._location.x+this._zoom.end/100*this._location.width-this._handleSize,this._fillerShae.style.x=this._startShape.style.x+this._handleSize,this._fillerShae.style.width=this._endShape.style.x-this._startShape.style.x-this._handleSize):(this._startShape.style.y=this._location.y+this._zoom.start/100*this._location.height,this._endShape.style.y=this._location.y+this._zoom.end/100*this._location.height-this._handleSize,this._fillerShae.style.y=this._startShape.style.y+this._handleSize,this._fillerShae.style.height=this._endShape.style.y-this._startShape.style.y-this._handleSize),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this.zr.modShape(this._fillerShae.id),this._syncFrameShape(),this.zr.refresh()},_syncData:function(e){var t,n,r,i,o;for(var u in this._originalData){t=this._originalData[u];for(var a in t){o=t[a];if(typeof o=="undefined")continue;i=o.length,n=Math.floor(this._zoom.start/100*i),r=Math.ceil(this._zoom.end/100*i),this.option[u][a].type!=s.CHART_TYPE_SCATTER?this.option[u][a].data=o.slice(n,r):this.option[u][a].data=this._synScatterData(a,o)}}!this._isSilence&&(this.zoomOption.realtime||e)&&this.messageCenter.dispatch(s.EVENT.DATA_ZOOM,null,{zoom:this._zoom},this.myChart)},_synScatterData:function(e,t){if(this._zoom.start===0&&this._zoom.end==100&&this._zoom.start2===0&&this._zoom.end2==100)return t;var n=[],r=this._zoom.scatterMap[e],i,s,o,u,a;this.zoomOption.orient=="horizontal"?(i=r.x.max-r.x.min,s=this._zoom.start/100*i+r.x.min,o=this._zoom.end/100*i+r.x.min,i=r.y.max-r.y.min,u=this._zoom.start2/100*i+r.y.min,a=this._zoom.end2/100*i+r.y.min):(i=r.x.max-r.x.min,s=this._zoom.start2/100*i+r.x.min,o=this._zoom.end2/100*i+r.x.min,i=r.y.max-r.y.min,u=this._zoom.start/100*i+r.y.min,a=this._zoom.end/100*i+r.y.min);var f;for(var l=0,c=t.length;l=s&&f[0]<=o&&f[1]>=u&&f[1]<=a&&n.push(t[l]);return n},__ondrift:function(e,t,n){this.zoomOption.zoomLock&&(e=this._fillerShae);var r=e._type=="filler"?this._handleSize:0;return this.zoomOption.orient=="horizontal"?e.style.x+t-r<=this._location.x?e.style.x=this._location.x+r:e.style.x+t+e.style.width+r>=this._location.x+this._location.width?e.style.x=this._location.x+this._location.width-e.style.width-r:e.style.x+=t:e.style.y+n-r<=this._location.y?e.style.y=this._location.y+r:e.style.y+n+e.style.height+r>=this._location.y+this._location.height?e.style.y=this._location.y+this._location.height-e.style.height-r:e.style.y+=n,e._type=="filler"?this._syncHandleShape():this._syncFillerShape(),this.zoomOption.realtime&&this._syncData(),!0},__ondragend:function(){this.isDragend=!0},ondragend:function(e,t){if(!this.isDragend||!e.target)return;!this.zoomOption.realtime&&this._syncData(),t.dragOut=!0,t.dragIn=!0,!this._isSilence&&!this.zoomOption.realtime&&this.messageCenter.dispatch(s.EVENT.DATA_ZOOM,null,{zoom:this._zoom},this.myChart),t.needRefresh=!1,this.isDragend=!1;return},ondataZoom:function(e,t){t.needRefresh=!0;return},absoluteZoom:function(e){this._zoom.start=e.start,this._zoom.end=e.end,this._zoom.start2=e.start2,this._zoom.end2=e.end2,this._syncShape(),this._syncData(!0);return},rectZoom:function(e){if(!e)return this._zoom.start=this._zoom.start2=0,this._zoom.end=this._zoom.end2=100,this._syncShape(),this._syncData(!0),this._zoom;var t=this.component.grid.getArea(),n={x:e.x,y:e.y,width:e.width,height:e.height};n.width<0&&(n.x+=n.width,n.width=-n.width),n.height<0&&(n.y+=n.height,n.height=-n.height);if(n.x>t.x+t.width||n.y>t.y+t.height)return!1;n.xt.x+t.width&&(n.width=t.x+t.width-n.x),n.y+n.height>t.y+t.height&&(n.height=t.y+t.height-n.y);var r,i=(n.x-t.x)/t.width,s=1-(n.x+n.width-t.x)/t.width,o=1-(n.y+n.height-t.y)/t.height,u=(n.y-t.y)/t.height;return this.zoomOption.orient=="horizontal"?(r=this._zoom.end-this._zoom.start,this._zoom.start+=r*i,this._zoom.end-=r*s,r=this._zoom.end2-this._zoom.start2,this._zoom.start2+=r*o,this._zoom.end2-=r*u):(r=this._zoom.end-this._zoom.start,this._zoom.start+=r*o,this._zoom.end-=r*u,r=this._zoom.end2-this._zoom.start2,this._zoom.start2+=r*i,this._zoom.end2-=r*s),this._syncShape(),this._syncData(!0),this._zoom},syncBackupData:function(e){var t,n=this._originalData.series,r=e.series,i;for(var s=0,o=r.length;s=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height?!0:!1}},r.inherits(i,t),i}),define("echarts/component/dataRange",["require","./base","zrender/shape/Text","zrender/shape/Rectangle","../util/shape/HandlePolygon","../config","zrender/tool/util","zrender/tool/area","zrender/tool/color","zrender/tool/color","../component"],function(e){function f(e,n,r,i,s){if(typeof this.query(i,"dataRange.min")=="undefined"||typeof this.query(i,"dataRange.max")=="undefined"){console.error("option.dataRange.min or option.dataRange.max has not been defined.");return}t.call(this,e,n,r,i,s);var o=this;o._ondrift=function(e,t){return o.__ondrift(this,e,t)},o._ondragend=function(){return o.__ondragend()},o._dataRangeSelected=function(e){return o.__dataRangeSelected(e)},this._selectedMap={},this._range={},this.refresh(i)}var t=e("./base"),n=e("zrender/shape/Text"),r=e("zrender/shape/Rectangle"),i=e("../util/shape/HandlePolygon"),s=e("../config"),o=e("zrender/tool/util"),u=e("zrender/tool/area"),a=e("zrender/tool/color");return f.prototype={type:s.COMPONENT_TYPE_DATARANGE,_textGap:10,_buildShape:function(){this._itemGroupLocation=this._getItemGroupLocation(),this._buildBackground(),this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable?this._buildGradient():this._buildItem();for(var e=0,t=this.shapeList.length;ep&&(h-=m)):(dv&&(d-=f))}return{x:h,y:d,width:s,height:o}},_getTextShape:function(e,t,n){return{zlevel:this._zlevelBase,style:{x:this.dataRangeOption.orient=="horizontal"?e:this._itemGroupLocation.x+this._itemGroupLocation.width/2,y:this.dataRangeOption.orient=="horizontal"?this._itemGroupLocation.y+this._itemGroupLocation.height/2:t,color:this.dataRangeOption.textStyle.color,text:n,textFont:this.getFont(this.dataRangeOption.textStyle),textBaseline:this.dataRangeOption.orient=="horizontal"?"middle":"top",textAlign:this.dataRangeOption.orient=="horizontal"?"left":"center"},hoverable:!1}},_getItemShape:function(e,t,n,r,i){return{zlevel:this._zlevelBase,style:{x:e,y:t+1,width:n,height:r-2,color:i},highlightStyle:{strokeColor:i,lineWidth:1},clickable:!0}},__ondrift:function(e,t,n){var r=this._calculableLocation.x,i=this._calculableLocation.y,s=this._calculableLocation.width,o=this._calculableLocation.height;return this.dataRangeOption.orient=="horizontal"?e.style.x+t<=r?e.style.x=r:e.style.x+t+e.style.width>=r+s?e.style.x=r+s-e.style.width:e.style.x+=t:e.style.y+n<=i?e.style.y=i:e.style.y+n+e.style.height>=i+o?e.style.y=i+o-e.style.height:e.style.y+=n,e._type=="filler"?this._syncHandleShape():this._syncFillerShape(e),this.dataRangeOption.realtime&&this._syncData(),!0},__ondragend:function(){this.isDragend=!0},ondragend:function(e,t){if(!this.isDragend||!e.target)return;!this.dataRangeOption.realtime&&this._syncData(),t.dragOut=!0,t.dragIn=!0,!this.dataRangeOption.realtime&&!1&&this.messageCenter.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:this._range.end,end:this._range.start}},this.myChart),t.needRefresh=!1,this.isDragend=!1;return},_syncShapeFromRange:function(){var e=this.dataRangeOption.range||{};this._range.end=typeof this._range.end!="undefined"?this._range.end:typeof e.start!="undefined"?e.start:0,this._range.start=typeof this._range.start!="undefined"?this._range.start:typeof e.end!="undefined"?e.end:100;if(this._range.start!=100||this._range.end!==0){if(this.dataRangeOption.orient=="horizontal"){var t=this._fillerShae.style.width;this._fillerShae.style.x+=t*(100-this._range.start)/100,this._fillerShae.style.width=t*(this._range.start-this._range.end)/100}else{var n=this._fillerShae.style.height;this._fillerShae.style.y+=n*(100-this._range.start)/100,this._fillerShae.style.height=n*(this._range.start-this._range.end)/100}this.zr.modShape(this._fillerShae.id),this._syncHandleShape()}},_syncHandleShape:function(){var e=this._calculableLocation.x,t=this._calculableLocation.y,n=this._calculableLocation.width,r=this._calculableLocation.height;this.dataRangeOption.orient=="horizontal"?(this._startShape.style.x=this._fillerShae.style.x,this._startMask.style.width=this._startShape.style.x-e,this._endShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._endMask.style.x=this._endShape.style.x,this._endMask.style.width=e+n-this._endShape.style.x,this._range.start=Math.ceil(100-(this._startShape.style.x-e)/n*100),this._range.end=Math.floor(100-(this._endShape.style.x-e)/n*100)):(this._startShape.style.y=this._fillerShae.style.y,this._startMask.style.height=this._startShape.style.y-t,this._endShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._endMask.style.y=this._endShape.style.y,this._endMask.style.height=t+r-this._endShape.style.y,this._range.start=Math.ceil(100-(this._startShape.style.y-t)/r*100),this._range.end=Math.floor(100-(this._endShape.style.y-t)/r*100)),this._syncShape()},_syncFillerShape:function(e){var t=this._calculableLocation.x,n=this._calculableLocation.y,r=this._calculableLocation.width,i=this._calculableLocation.height,s,o;this.dataRangeOption.orient=="horizontal"?(s=this._startShape.style.x,o=this._endShape.style.x,e.id==this._startShape.id&&s>=o?(o=s,this._endShape.style.x=s):e.id==this._endShape.id&&s>=o&&(s=o,this._startShape.style.x=s),this._fillerShae.style.x=s,this._fillerShae.style.width=o-s,this._startMask.style.width=s-t,this._endMask.style.x=o,this._endMask.style.width=t+r-o,this._range.start=Math.ceil(100-(s-t)/r*100),this._range.end=Math.floor(100-(o-t)/r*100)):(s=this._startShape.style.y,o=this._endShape.style.y,e.id==this._startShape.id&&s>=o?(o=s,this._endShape.style.y=s):e.id==this._endShape.id&&s>=o&&(s=o,this._startShape.style.y=s),this._fillerShae.style.y=s,this._fillerShae.style.height=o-s,this._startMask.style.height=s-n,this._endMask.style.y=o,this._endMask.style.height=n+i-o,this._range.start=Math.ceil(100-(s-n)/i*100),this._range.end=Math.floor(100-(o-n)/i*100)),this._syncShape()},_syncShape:function(){this._startShape.position=[this._startShape.style.x-this._startShape.style._x,this._startShape.style.y-this._startShape.style._y],this._startShape.style.text=this._textFormat(this._gap*this._range.start+this.dataRangeOption.min),this._startShape.style.color=this._startShape.highlightStyle.strokeColor=this.getColor(this._gap*this._range.start+this.dataRangeOption.min),this._endShape.position=[this._endShape.style.x-this._endShape.style._x,this._endShape.style.y-this._endShape.style._y],this._endShape.style.text=this._textFormat(this._gap*this._range.end+this.dataRangeOption.min),this._endShape.style.color=this._endShape.highlightStyle.strokeColor=this.getColor(this._gap*this._range.end+this.dataRangeOption.min),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this.zr.modShape(this._startMask.id),this.zr.modShape(this._endMask.id),this.zr.modShape(this._fillerShae.id),this.zr.refresh()},_syncData:function(){this.dataRangeOption.realtime&&this.messageCenter.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:this._range.end,end:this._range.start}},this.myChart)},__dataRangeSelected:function(e){var t=e.target._idx;this._selectedMap[t]=!this._selectedMap[t],this.messageCenter.dispatch(s.EVENT.REFRESH,null,null,this.myChart)},_textFormat:function(e,t){e=e.toFixed(this.dataRangeOption.precision),t=typeof t!="undefined"?t.toFixed(this.dataRangeOption.precision):"";if(this.dataRangeOption.formatter){if(typeof this.dataRangeOption.formatter=="string")return this.dataRangeOption.formatter.replace("{value}",e).replace("{value2}",t);if(typeof this.dataRangeOption.formatter=="function")return this.dataRangeOption.formatter.call(this.myChart,e,t)}return t!==""?e+" - "+t:e},refresh:function(e){if(e){this.option=e,this.option.dataRange=this.reformOption(this.option.dataRange),this.option.dataRange.padding=this.reformCssArray(this.option.dataRange.padding),this.dataRangeOption=this.option.dataRange;var t=this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable?100:this.dataRangeOption.splitNumber;this._colorList=a.getGradientColors(this.dataRangeOption.color,Math.max((t-this.dataRangeOption.color.length)/(this.dataRangeOption.color.length-1),0)+1);if(this._colorList.length>t){var n=this._colorList.length,r=[this._colorList[0]],i=n/(t-1);for(var s=1;sthis.dataRangeOption.max&&(e=this.dataRangeOption.max);if(this.dataRangeOption.calculable)if(e-(this._gap*this._range.start+this.dataRangeOption.min)>5e-5||e-(this._gap*this._range.end+this.dataRangeOption.min)<-0.00005)return null;var t=this._colorList.length-Math.ceil((e-this.dataRangeOption.min)/(this.dataRangeOption.max-this.dataRangeOption.min)*this._colorList.length);return t==this._colorList.length&&t--,this._selectedMap[t]?this._colorList[t]:null}},o.inherits(f,t),e("../component").define("dataRange",f),f}),define("echarts/chart/scatter",["require","../component/base","./base","../util/shape/Symbol","../component/axis","../component/grid","../component/dataZoom","../component/dataRange","../config","zrender/tool/util","zrender/tool/color","../chart"],function(e){function u(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this),this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("../util/shape/Symbol");e("../component/axis"),e("../component/grid"),e("../component/dataZoom"),e("../component/dataRange");var i=e("../config"),s=e("zrender/tool/util"),o=e("zrender/tool/color");return u.prototype={type:i.CHART_TYPE_SCATTER,_buildShape:function(){var e=this.series;this._sIndex2ColorMap={},this._symbol=this.option.symbolList,this._sIndex2ShapeMap={},this.selectedMap={},this.xMarkMap={};var t=this.component.legend,n=[],r,s,u,a;for(var f=0,l=e.length;fs[0]&&(i.min0=s[0],i.minY0=r[o][1],i.minX0=r[o][0]),i.max0s[1]&&(i.min1=s[1],i.minY1=r[o][1],i.minX1=r[o][0]),i.max1n.largeThreshold){this.shapeList.push(this._getLargeSymbol(r,this.getItemStyleColor(this.query(n,"itemStyle.normal.color"),o,-1)||this._sIndex2ColorMap[o]));continue}for(var u=0,a=r.length;u0&&this._buildSinglePosition(o,t[o]);this.addShapeList()},_buildSinglePosition:function(e,t){var n=this._mapData(t),r=n.locationMap,i=n.maxDataLength;if(i===0||r.length===0)return;this._buildHorizontal(t,i,r);for(var s=0,o=t.length;s0?a="left":Math.round(i[0])<0?a="right":a="center",f.margin?(p=f.margin,c=i[0]>0?p:-p,h=i[1]>0?p:-p,c=i[0]===0?0:c,h=i[1]===0?0:h,i=this._mapVector(i,o,1)):i=this._mapVector(i,o,1.2),u.textAlign=a,u.x=i[0]+c,u.y=i[1]+h,f.rotate?l=[f.rotate/180*Math.PI,i[0],i[1]]:l=[0,0,0],this.shapeList.push(new n({zlevel:this._zlevelBase,style:u,draggable:!1,hoverable:!1,rotation:l}))}},getIndicatorText:function(e,t){return this.polar[e]&&this.polar[e].__ecIndicator[t]&&this.polar[e].__ecIndicator[t].text},getDropBox:function(e){var e=e||0,t=this.polar[e],n=this.getCenter(e),r=t.__ecIndicator,i=r.length,s=[],o,u,a=t.type;if(a=="polygon"){for(var f=0;fu||u===undefined)&&(u=e),(e=1)a=Math.floor(a/l)*l-l;else{if(l===0)return u>0?(d=0,p=2*u):u===0?(d=0,p=100):(p=0,d=2*a),{max:p,min:d};c=(l+"").split(".")[1],h=c.length,a=Math.floor(a*Math.pow(10,h))/Math.pow(10,h)-l}Math.abs(a)<=l&&(a=0),u=a+Math.floor(l*Math.pow(10,h)*(n+1))/Math.pow(10,h)}else a=a>0?0:a;return r&&(u=u>0?u*1.2:u*.8,a=a>0?a*.8:a*1.2),{max:u,min:a}},_getDelta:function(e,t,n,r,i){var s=(e-t)/n,o,u;if(s>1)return i?(s=Math.ceil(s),s%i>0?(Math.ceil(s/i)+1)*i:s):(o=(s+"").split(".")[0],u=o.length,o.charAt(0)>=5?Math.pow(10,u):(o.charAt(0)-0+1)*Math.pow(10,u-1));if(s==1)return 1;if(s===0)return 0;if(!r){o=(s+"").split(".")[1],u=0;while(o[u]=="0")u++;return o[u]>=5?"0."+o.substring(0,u+1)-0+1/Math.pow(10,u):"0."+o.substring(0,u+1)-0+1/Math.pow(10,u+1)}return Math.ceil(s*Math.pow(10,r))/Math.pow(10,r)},getVector:function(e,t,n){e=e||0,t=t||0;var r=this.polar[e].__ecIndicator;if(t>=r.length)return;var i=this.polar[e].__ecIndicator[t],s=this.getCenter(e),o=i.vector,u=i.value.max,a=i.value.min,f;if(typeof n=="undefined")return s;switch(n){case"min":n=a;break;case"max":n=u;break;case"center":n=(u+a)/2}return u!=a?f=(n-a)/(u-a):f=.5,this._mapVector(o,s,f)},isInside:function(e){var t=this.getNearestIndex(e);return t?t.polarIndex:-1},getNearestIndex:function(e){var t,n,r,i,s,o,u,a,l;for(var c=0;ci[0])return{polarIndex:c,valueIndex:Math.floor((l+a/2)/a)%u}}},getIndicator:function(e){var e=e||0;return this.polar[e].indicator},refresh:function(e){e&&(this.option=e,this.polar=this.option.polar,this.series=this.option.series),this.clear(),this._buildShape()}},a.inherits(l,t),e("../component").define("polar",l),l}),define("echarts/chart/radar",["require","../component/base","./base","zrender/shape/Polygon","../component/polar","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../util/accMath","../chart"],function(e){function a(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this),this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("zrender/shape/Polygon");e("../component/polar");var i=e("../config"),s=e("../util/ecData"),o=e("zrender/tool/util"),u=e("zrender/tool/color");return a.prototype={type:i.CHART_TYPE_RADAR,_buildShape:function(){this.selectedMap={},this._symbol=this.option.symbolList,this._queryTarget,this._dropBoxList=[],this._radarDataCounter=0;var e=this.series,t=this.component.legend,n;for(var r=0,s=e.length;r\\/]*>)","gim"),r=new RegExp("\\s+","gim"),i=new RegExp("function.*?\\((.*?)\\)","i"),s=e.toString().replace(n,"").replace(r,"").match(i)[1].split(",");return t!==Object(t)&&(t={}),function(){var n=Array.prototype.slice.call(arguments),r=n[n.length-1];r&&r.constructor===Object?n.pop():r={};for(var i=0;i=0){var n=e.split(/\s*:\s*/),r=parseInt(n[2]||1,10),i,s;if(r===0)throw new Error("Slice step cannot be zero");return r>0?(i=parseInt(n[0]||0,10),s=parseInt(n[1]||t,10)):(i=parseInt(n[0]||t-1,10),s=parseInt(n[1]||-1,10)),i<0&&(i=t+i),s<0&&n[1]&&(s=t+s),r>0?(i=Math.max(Math.min(t,i),0),s=Math.max(Math.min(t,s),0)):(i=Math.max(Math.min(t-1,i),-1),s=Math.max(Math.min(t-1,s),-1)),[i,s,r]}var i=parseInt(e,10);i<0&&(i=t+i);if(i<0||i>t)throw new Error(N(e));return i=Math.max(Math.min(t-1,i),0),[i,i+1,1]}function g(e){var t=e[0];for(var n=1;n=this._shape.length)throw new Error(T(e[r]));if(e.length<=1)return this;var i=n.slice();for(var r=0;r=Math.ceil(e.length/2);s--)i[e[r]]=e[s],i[e[s]]=e[r];return this._transposelike(i,t)}),swapaxes:t(function(e,t,n){return this.transpose([e,t],n)}),rollaxis:t(function(e,t,n){if(e>=this._shape.length)throw new Error(T(e));var r=[];for(var i=0;i=this._shape.length||e<0)throw new Error(T(e));var s=this._shape.slice();s.splice(e,1);if(t&&!S(s,t._shape))throw new Error(x(s,t._shape));t||(t=new v(this._dtype),t.initFromShape(s));var o=t._array,u=w(this._shape,e),a=this._shape[e],f=u*a;return n.call(this,o,i,f,a,u),t}return r.call(this,i)},_withPreprocess2:function(e,t,n,r){var i=this._array;if(!this._size)return;if(t&&!S(this._shape,t._shape))throw new Error(x(this._shape,t._shape));t||(t=new v(this._dtype),t.initFromShape(this._shape));var s=t._array;if(typeof e!="undefined"){e<0&&(e=this._shape.length+e);if(e>=this._shape.length||e<0)throw new Error(T(e));if(e>=this._shape.length)throw new Error(T(e));var o=w(this._shape,e),u=this._shape[e],a=o*u;n.call(this,s,i,a,u,o)}else t.reshape([this._size]),r.call(this,s,i);return t},max:t(function(){function e(e,t,n,r,i){var s=0;for(var o=0;of&&(f=c),a+=i}e[s++]=f}}function t(e){var t=e[0];for(var n=1;nt&&(t=e[n]);return t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}()),min:t(function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h,a=c),f+=i}e[s++]=a}}function t(e){var t=e[0],n=0;for(var r=1;rt&&(n=r,t=e[r]);return n}return function(n,r){return this._withPreprocess1(n,r,e,t)}}()),argmin:t(function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h),a+=i}e[s++]=l-f}}function t(e){var t=e[0],n=e[0];for(var r=1;rn&&(n=e[r]);return n-t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}()),sort:t(function(e,t){e<0&&(e=this._shape.length+e);var n;t==="ascending"?n=function(e,t){return e-t}:t==="descending"&&(n=function(e,t){return t-e});var r=this._array,i=w(this._shape,e),s=this._shape[e],o=i*s,u=new Array(s);for(var a=0;as&&(s=a)}var f=s-i,l=t-e;for(var u=0;u=0&&y>=0){if(e._shape[g]==1)i.unshift(t._shape[y]),b=e.repeat(t._shape[y],g);else if(t._shape[y]==1)i.unshift(e._shape[g]),E=t.repeat(e._shape[g],y);else{if(t._shape[y]!=e._shape[g])throw new Error(x(e._shape,t._shape));i.unshift(e._shape[g])}g--,y--}for(var T=g;T>=0;T--)i.unshift(e._shape[T]);for(var T=y;T>=0;T--)i.unshift(t._shape[T]);e=b,t=E}if(!r)r=new v(this._dtype),r.initFromShape(i);else if(!S(i,r._shape))throw new Error(x(i,r._shape));var N=r._array,C,k,L,A;d?(C=t._shape.length-1,k=!1,L=e,A=t._array):m?(C=e._shape.length-1,k=!0,A=t,L=e._array):(C=Math.abs(e._shape.length-t._shape.length),k=e._shape.length>=t._shape.length,L=e._array,A=t._array);var O=w(i,C),M=i[C],_=O*M,D=r._size/_,P,H,B,j=0;if(k)if(m)for(var F=0;F0)for(var c=r[0];cr[1];c+=r[2])l(e+1,t+s*c);else if(r[2]>0)for(var c=r[0];cr[1];c+=r[2])for(var h=0;hthis._shape.length)throw new Error("Too many indices");var o=i.length,u;s.length?(t=new v(this._dtype),t.initFromShape(s),u=t._array):u=[];var a=this._array,f=0;return l(0,0),s.length?t:u[0]},set:function(e,t){typeof e=="number"&&(e=e.toString());var n=E(this._shape),r=this._parseRanges(e),i=r[0],s=r[1];if(i.length>this._shape.length)throw new Error("Too many indices");var o=typeof t=="number",u=i.length,a=this._array;if(o)var f=t;else{if(!S(s,t.shape()))throw new Error(x(s,t.shape()));var f=t._array}var l=0,c=function(e,t){var r=i[e],s=n[e];if(e0)for(var h=r[0];hr[1];h+=r[2])c(e+1,t+s*h);else if(r[2]>0)for(var h=r[0];hr[1];h+=r[2])for(var p=0;pu)throw new Error(N(e[a]));if(e[a]=0&&h>=0){if(l[c]===1)p=t.repeat(f[h],c);else if(l[c]!==f[h])throw new Error(x(l,f));c--,h--}t=p;var d=w(this._shape,n),u=this._shape[n],m=u*d,y=this._size/m,b=e.length,E=new Uint32Array(y*b),S=0;for(var T=0;T=0){for(var a=_-1;a>=D;a--)i[P--]=A[a];_=D,D=E[--M];for(var a=0;a=0;a--)i[P--]=A[a];return this._array=i,this._shape=k,this._size=L,this}),append:function(){console.warn("TODO")},"delete":t(function(e,t){var n=this._array;typeof e=="number"&&(e=[e]);var r=this._size;typeof t=="undefined"&&(this._shape=[r],t=0);var i=w(this._shape,t),s=this._shape[t],o=i*s,u=0;for(var a=0;as)throw new Error(N(l));if(l=0){var a=Math.floor((u[1]-u[0])/u[2]);a=a<0?0:a,r.push(a)}i++}for(;i0&&(E.style.brushType="both"),E.highlightStyle.lineWidth>0&&(E.highlightStyle.brushType="both"),a.pack(E,this.chordSeries[0],0,t[m],m,g.name);if(u){var S=[b+w]/2;S%=360;var x=S<=90||S>=270;S=S*Math.PI/180;var T=[Math.cos(S),-Math.sin(S)],N=this.showScaleText?35+h:h,C=l.scale([],T,this.outerRadius+N);l.add(C,C,this.center);var k={zlevel:this._zlevelBase-1,hoverable:!1,style:{text:g.name,textAlign:x?"left":"right",color:f}};c?(k.rotation=x?S:Math.PI+S,x?k.style.x=this.outerRadius+N:k.style.x=-this.outerRadius-N,k.style.y=0,k.position=this.center):(k.style.x=C[0],k.style.y=C[1]),k.style.textColor=this.deepQuery([g,this.chordSerieSample],"itemStyle.normal.label.textStyle.color")||"#fff",k.style.textFont=this.getFont(this.deepQuery([g,this.chordSerieSample],"itemStyle.normal.label.textStyle")),k=new r(k),this.shapeList.push(k)}E.onmouseover=d(m),E.onmouseout=v(),E=new s(E),this.shapeList.push(E),this.sectorShapes.push(E)}},_buildChords:function(e,t){var n=e.length;if(!n)return;var r=e[0][0].length,i=this.chordSerieSample.itemStyle.normal.chordStyle.lineStyle,s=this.chordSerieSample.itemStyle.emphasis.chordStyle.lineStyle;for(var u=0;u=270,E={zlevel:this._zlevelBase-1,hoverable:!1,style:{x:w?this.outerRadius+this.scaleLineLength+4:-this.outerRadius-this.scaleLineLength-4,y:0,text:Math.round(b.shift()*10)/10+t,textAlign:w?"left":"right"},position:this.center.slice(),rotation:w?[h/180*Math.PI,0,0]:[(h+180)/180*Math.PI,0,0]};E=new r(E),this.shapeList.push(E),g+=this.scaleUnitAngle*5}}},normalizeValue:function(e){var t=[],n=(new c(e)).max(),r,i;n>1e4?(r="k",i=.001):n>1e7?(r="m",i=1e-6):n>1e10?(r="b",i=1e-9):(r="",i=1);for(var s=0;s0&&(i=1/Math.sqrt(i),e[0]=t[0]*i,e[1]=t[1]*i),e},negate:function(e,t){return e[0]=-t[0],e[1]=-t[1],e},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e},set:function(e,t,n){return e[0]=t,e[1]=n,e}}:n=t("zrender/tool/vector");var i=typeof Float32Array=="undefined"?Array:Float32Array;s.prototype.beforeUpdate=function(){for(var e=0;e=e&&this.bbox[1]<=t&&this.bbox[3]>=t},s.prototype.setBBox=function(e,t,n,r){this.bbox[0]=e,this.bbox[1]=t,this.bbox[2]=n,this.bbox[3]=r,this.size=(n-e+r-t)/2},s.prototype._newSubRegion=function(){var e=this.subRegions[this.nSubRegions];return e||(e=new s,this.subRegions[this.nSubRegions]=e),this.nSubRegions++,e},s.prototype._addNodeToSubRegion=function(e){var t=this.findSubRegion(e.position[0],e.position[1]),n=this.bbox;if(!t){var r=(n[0]+n[2])/2,i=(n[1]+n[3])/2,s=(n[2]-n[0])/2,o=(n[3]-n[1])/2,u=e.position[0]>=r?1:0,a=e.position[1]>=i?1:0,t=this._newSubRegion();t.setBBox(u*s+n[0],a*o+n[1],(u+1)*s+n[0],(a+1)*o+n[1])}t.addNode(e)},s.prototype._updateCenterOfMass=function(e){this.centerOfMass==null&&(this.centerOfMass=n.create());var t=this.centerOfMass[0]*this.mass,r=this.centerOfMass[1]*this.mass;t+=e.position[0]*e.mass,r+=e.position[1]*e.mass,this.mass+=e.mass,this.centerOfMass[0]=t/this.mass,this.centerOfMass[1]=r/this.mass},a.prototype.initNodes=function(e,t,n){this.temperature=1;var r=e.length/2;this.nodes.length=0;var i=typeof n!="undefined";for(var s=0;s0&&this.applyNodeGravity(o)}for(var t=0;t0){n.scale(f,f,1/p);var d=n.len(s.speedPrev);d>0&&(p=Math.min(p/d,this.maxSpeedIncrease)*d,n.scaleAndAdd(l,s.speedPrev,f,p))}var v=n.len(l),h=Math.min(v,100)/(v+.1);n.scale(l,l,h),n.add(s.position,s.position,l)}},a.prototype.applyRegionToNodeRepulsion=function(){var e=n.create();return function(r,i){if(r.node)this.applyNodeToNodeRepulsion(r.node,i,!0);else{n.sub(e,i.position,r.centerOfMass);var s=e[0]*e[0]+e[1]*e[1];if(s>this.barnesHutTheta*r.size*r.size){var o=this._k*this._k*(i.mass+r.mass)/(s+1);n.scaleAndAdd(i.force,i.force,e,o*2)}else for(var u=0;u0?u=a*f/(l*l):l<=0&&(u=a*10*f)}else u=a*f/o;s||n.scaleAndAdd(r.force,r.force,e,u*2),n.scaleAndAdd(i.force,i.force,e,-u*2)}}(),a.prototype.applyEdgeAttraction=function(){var e=n.create();return function(r){var i=r.source,s=r.target;n.sub(e,i.position,s.position);var o=n.len(e),u;this.edgeWeightInfluence===0?u=1:this.edgeWeightInfluence==1?u=r.weight:u=Math.pow(r.weight,this.edgeWeightInfluence);var a;if(this.preventOverlap){o=o-i.size-s.size;if(o<=0)return}var a=-u*o/this._k;n.scaleAndAdd(i.force,i.force,e,a),n.scaleAndAdd(s.force,s.force,e,-a)}}(),a.prototype.applyNodeGravity=function(){var e=n.create();return function(t){n.sub(e,this.center,t.position),this.width>this.height?e[1]*=this.width/this.height:e[0]*=this.height/this.width;var r=n.len(e)/100;this.strongGravity?n.scaleAndAdd(t.force,t.force,e,r*this.gravity*t.mass):n.scaleAndAdd(t.force,t.force,e,this.gravity*t.mass/(r+1))}}(),a.prototype.updateBBox=function(){var e=Infinity,t=Infinity,n=-Infinity,r=-Infinity;for(var i=0;i.01){for(var r=0;r=0});var s,o;this._filteredLinks=x(this._rawLinks,function(e,r){s=e.source,o=e.target;var i=!0,u=typeof s=="string"?n[s]:t[s];typeof u=="undefined"&&(u=-1),u>=0?e.source=u:i=!1;var u=typeof o=="string"?n[o]:t[o];return typeof u=="undefined"&&(u=-1),u>=0?e.target=u:i=!1,e.rawIndex=r,i})},_initLayout:function(e){var t=this._filteredNodes,n=this._filteredLinks,r=this._nodeShapes,i=t.length,s=this.query(e,"minRadius"),o=this.query(e,"maxRadius");this._steps=e.steps||1,this._coolDown=e.coolDown||.99;var u=this.parseCenter(this.zr,e.center),f=this.parsePercent(e.size,this.zr.getWidth()),p=this.parsePercent(e.size,this.zr.getHeight()),d=Math.min(f,p),v=[];for(var m=0;m>1^-(o&1),u=u>>1^-(u&1),o+=r,u+=i,r=o,i=u,n.push([o/1024,u/1024])}return n}var r={world:{getGeoJson:function(n){e(["./geoJson/world_geo"],function(e){n(t(e))})}},china:{getGeoJson:function(n){e(["./geoJson/china_geo"],function(e){n(t(e))})}},"南海诸岛":{textCoord:[126,25],getPath:function(e,t){var n=[[[0,3.5],[7,11.2],[15,11.9],[30,7],[42,.7],[52,.7],[56,7.7],[59,.7],[64,.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]]],r="",i=e[0],s=e[1];for(var o=0,u=n.length;o180?n-360:n,r=90-(r/e.scale.y+e.offset.y),[n,r]}function o(e,t){return n.offset=e.offset,n.scale=e.scale,t instanceof Array?n.makePoint([t[0]*1,t[1]*1]):n.makePoint([t.x*1,t.y*1])}var n={formatPoint:function(e){return[(e[0]<-168.5&&e[1]>63.8?e[0]+360:e[0])+168.5,90-e[1]]},makePoint:function(e){var t=this,r=t.formatPoint(e);t._bbox.xmin>e[0]&&(t._bbox.xmin=e[0]),t._bbox.xmaxe[1]&&(t._bbox.ymin=e[1]),t._bbox.ymaxr&&(t.xmin=r),t.xmaxi&&(t.ymin=i),t.ymax1&&(r={geometry:{coordinates:r.geometry.coordinates.slice(5,6),type:r.geometry.type},id:r.id,properties:r.properties,type:r.type});break}return{type:"FeatureCollection",features:[r]}},_getProjectionData:function(e,t,n){var r=this._mapDataMap[e].projection,i=[],s=this._mapDataMap[e].bbox||r.getBbox(t,this._specialArea[e]),o;this._mapDataMap[e].hasRoam?o=this._mapDataMap[e].transform:o=this._getTransform(s,n,this._mapDataMap[e].rate);var u=this._mapDataMap[e].lastTransform||{scale:{}},a;o.left!=u.left||o.top!=u.top||o.scale.x!=u.scale.x||o.scale.y!=u.scale.y?(a=r.geoJson2Path(t,o,this._specialArea[e]),u=h.clone(o)):(o=this._mapDataMap[e].transform,a=this._mapDataMap[e].pathArray),this._mapDataMap[e].bbox=s,this._mapDataMap[e].transform=o,this._mapDataMap[e].lastTransform=u,this._mapDataMap[e].pathArray=a;var f=[o.left,o.top];for(var l=0,c=a.length;lv?(d=v*.75,l=h*d):(v=d,d=v*.75,c=p*v);var m={OffsetLeft:a[0],OffsetTop:a[1],scale:{x:d,y:v}},g=o.geoJson2Path(n,m);return this._getSingleProvince(t,g[0],s)},_getSingleProvince:function(e,t,n){var r,i=t.properties.name,s=m[i]||[0,0];if(g[i])r=this.geo2pos(e,g[i]);else if(t.cp)r=[t.cp[0]+s[0],t.cp[1]+s[1]];else{var o=this._mapDataMap[e].bbox;r=this.geo2pos(e,[o.left+o.width/2,o.top+o.height/2]),r[0]+=s[0],r[1]+=s[1]}return t.name=this._nameChange(e,i),t.position=n,t.textX=r[0],t.textY=r[1],t},_getTransform:function(e,t,n){var r=this.series,i,s,o,u,a,f,l,c=this.zr.getWidth(),h=this.zr.getHeight(),p=Math.round(Math.min(c,h)*.02);for(var d in t)i=r[d].mapLocation||{},o=i.x||o,a=i.y||a,f=i.width||f,l=i.height||l;s=this.parsePercent(o,c),s=isNaN(s)?p:s,u=this.parsePercent(a,h),u=isNaN(u)?p:u,typeof f=="undefined"?f=c-s-2*p:f=this.parsePercent(f,c),typeof l=="undefined"?l=h-u-2*p:l=this.parsePercent(l,h);var v=e.width,m=e.height,g=f/n/v,y=l/m;g>y?(g=y*n,f=v*g):(y=g,g=y*n,l=m*y);if(isNaN(o)){o=o||"center";switch(o+""){case"center":s=Math.floor((c-f)/2);break;case"right":s=c-f}}if(isNaN(a)){a=a||"center";switch(a+""){case"center":u=Math.floor((h-l)/2);break;case"bottom":u=h-l}}return{left:s,top:u,width:f,height:l,baseScale:1,scale:{x:g,y:y}}},_buildMap:function(e,t,n,l){var p=this.series,d=this.component.legend,v=this.component.dataRange,m,g,y,b,w,E=this.ecTheme.map,S,x,T,N,C,k;for(var L=0,A=t.length;L=r&&e<=r+s&&t>=i&&t<=i+o)return u}return},__onmousewheel:function(e){if(this.shapeList.length<=0)return;var t=e.event,n=d.getX(t),r=d.getY(t),i=d.getDelta(t),s=this._findMapTypeByPos(n,r);if(s){d.stop(t);var o=this._mapDataMap[s].transform,u=o.left,a=o.top,f=o.width,c=o.height,h=this.pos2geo(s,[n-u,r-a]);if(i>0){i=1.2;if(typeof this._scaleLimitMap[s].max!="undefined"&&o.baseScale>=this._scaleLimitMap[s].max)return}else{i=1/1.2;if(typeof this._scaleLimitMap[s].min!="undefined"&&o.baseScale<=this._scaleLimitMap[s].min)return}o.baseScale*=i,o.scale.x*=i,o.scale.y*=i,o.width=f*i,o.height=c*i,this._mapDataMap[s].hasRoam=!0,this._mapDataMap[s].transform=o,h=this.geo2pos(s,h),o.left-=h[0]-(n-u),o.top-=h[1]-(r-a),this._mapDataMap[s].transform=o,this.clearEffectShape(!0);for(var p=0,v=this.shapeList.length;p0?this.clear():this.backupShapeList(),this._buildShape(),this.zr.refreshHover()},ondataRange:function(e,t){this.component.dataRange&&(this.refresh(),t.needRefresh=!0);return},pos2geo:function(e,t){return this._mapDataMap[e].transform?this._mapDataMap[e].projection.pos2geo(this._mapDataMap[e].transform,t):null},getGeoByPos:function(e,t){if(!this._mapDataMap[e].transform)return null;var n=[this._mapDataMap[e].transform.left,this._mapDataMap[e].transform.top];return t instanceof Array?(t[0]-=n[0],t[1]-=n[1]):(t.x-=n[0],t.y-=n[1]),this.pos2geo(e,t)},geo2pos:function(e,t){return this._mapDataMap[e].transform?this._mapDataMap[e].projection.geo2pos(this._mapDataMap[e].transform,t):null},getPosByGeo:function(e,t){if(!this._mapDataMap[e].transform)return null;var n=this.geo2pos(e,t);return n[0]+=this._mapDataMap[e].transform.left,n[1]+=this._mapDataMap[e].transform.top,n},getMapPosition:function(e){return this._mapDataMap[e].transform?[this._mapDataMap[e].transform.left,this._mapDataMap[e].transform.top]:null},dispose:function(){this.clear(),this.shapeList=null,this.effectList=null,this._isAlive=!1,this._needRoam&&(this.zr.un(p.EVENT.MOUSEWHEEL,this._onmousewheel),this.zr.un(p.EVENT.MOUSEDOWN,this._onmousedown))}},h.inherits(y,n),h.inherits(y,t),e("../chart").define("map",y),y}),define("echarts/util/mapData/geoJson/an_hui_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3415",properties:{name:"六安市",cp:[116.3123,31.8329],childNum:6},geometry:{type:"Polygon",coordinates:["@@„„nJ‚UXUVƒ°U„ÑnU@mlLVaVln@@bn@VU@xlb@lšLnKlšƒVI„JšUVxnI@lVL@b„Ž°VX@˜b„x„nVVUnVVnU‚›@kX@VwV@„al¥UUnUWa@ƒ@wĸU„LU¥lKUa@aUI@alLVaUƒ¯anƒWkUKm@XV@VaXlW@aU_UWVUƒI¯@ma¯W¯™™I@UU@WWU@U@@UU@VkV@@WUUm@UaU@„lK@IUK„L@KWmXUWaXI@ƒ@a@a@U@U@KV¥lw„k°b²JVIVKlV@UX„la„Ul`œUVLVVVUšJ„U@Lnm@_VK@KUIW@™J@Xk@WW@U—ƒmm™XmWk@kK@aUUƒVmmkUwUmWL™@WmU@™UJmUULkKWakLWVkIƒlƒwULƒW@X°lUJ@°ULƒWV—wmJ@bmb¯Vkm@@WkWm¯wƒL@lkXƒWmXym¯UImJUbkV™@Vn¯„@V@lUbƒ@mk@maUxmlUbULWn@J—LmKUkWKkwUKƒbm„X„WxkVUKmLkVV@JUUWL@xkJUUƒV@X@VVlUbVX@xk¤šx‚¼œxWxn„‚nn@Þ¼„JVb°aVn„@šmlnXU„JlbVlkz@‚lUŽlXJmxVxXnWxXÈWlUŽ@šUxU@VX@xUL@šUÆmLnV@lWXk@@JlbXblnlJ"],encodeOffsets:[[118710,33351]]}},{type:"Feature",id:"3408",properties:{name:"安庆市",cp:[116.7517,30.5255],childNum:9},geometry:{type:"Polygon",coordinates:["@@n°‚znW„XlW@k„K°xXn‚l@Xn@l‚°Una@anI˜xXU„ŽVK@¯VIkW¯X@‚„VK„x„klJXUlKXblLVKnVVIšŽV@Xn‚@šŽXKVnVxlŽnn„UlmV@²óUkV™lW„b„lƒšƒn@VVVIn@lw@WVIXblV„@Èx‚aUaVIVVnKVLšK„ƒln@b²K@»U£ƒÑķƒġÝÅb™K™a@Im@ۍ„@kWÓkkmKÅnóJƒUÅ£›W@w„ĕ@wĉţ¯¯ƒUkK±l¯Uƒ¥UÑkÝUķ»Ý¥¯™JƒIUŽVbUl¯ÈV¼VJU¼Vb@bkLUl@„VJ@bUXǚ@lkVmXmKkLVxš‚Ž„VƒL@VkVVVlzW˜kbmLUUUbVbUV™šlÒnJlUnLllUL@bU„Vx„l‚LXVƦÈVU¦WJ"],encodeOffsets:[[118834,31759]]}},{type:"Feature",id:"3411",properties:{name:"滁州市",cp:[118.1909,32.536],childNum:7},geometry:{type:"Polygon",coordinates:["@@š„@`nnl@„xšK@X°KXV˜IXVlbXVWnX‚lL@šÈ»‚LVan@VJ„êVVn@‚X@laÞbVaƒyn@„_‚xnWVXnWl@VnUVkI@l‚nXKVLVV@V@kW@LlVô„@J@bVnnKnkVa@»lç@ƒnwšKma™UUUVњ@n™mWXalI@alVn@VwUaVU„@„nlaôJnU„VVXlJšaXXVK@UšV@VWx@nXVWšXVšUlLUbV‚ULVVnUVbUbVbš@@a„KÆnnKVK@U@UU@@a„@Vƒ°¯ÈJVIlķ@aa˜UaVKU_@mkxUI@aƒUlyU@@™wkKWmUbUnUVWbkJW_J@bƒn@Vm@@KULk@V@@bVbÅm@LW@UVVbkK@UkKWL@VULUKWIUJUbkK@_WVXU›Jka@XƒVa@kšy@aVIUUW@@m„UlLœKWÑUKVan@UkVmmIXKƒaVaUwVU@UmykU¯@±UUL@WUIVUU@KkIWaƒaU@kUUaǃUó»mKƒk¯@y@kWK@bkI¯`mn™l¯XWlkVUzUJlbUbVJl@nnm„@VULV`XnWƗbmUUn™JmUknƒJ¯km@ƒyk@kU›xL@VUbmnn¤lX@`™z@JmaULUVl@Xn@xllkXWa—aW@UVmUbƒ@mVXšWxXbWbUŽƒÒnVVnVVUL"],encodeOffsets:[[120004,33520]]}},{type:"Feature",id:"3418",properties:{name:"宣城市",cp:[118.8062,30.6244],childNum:7},geometry:{type:"Polygon",coordinates:["@@Vb@„XL˜JXxlIXxlVlV@I²¤šnlUnVšU@VULWVUJ@Lnb@lV@UnV@@VVVlLnbnJ‚UVkUUVWn@@anUVnVJVIV‚@@nUJVbUb‚„@VUbVK@bn@VbnIlxkllXVlXKWUXUlL°¤UVVb@bš„UlkXW‚ƒxXz@‚„Ila„UlƒnUlJVInVÆJ„U„LVUnV„K°@VnlVnxV@XLlK@wVL@KnUlJXU˜bnKVLX„lUw@VWlLXKm@@a„@VLnmlIVVnKn@škVašVlwk@@a@k@ƒVIUa™@maUa@wna@kmWƒ™UUmVUIVǗ@aƒKm™aƒ™kU™J@InmUUaVa„k‚lX@Vk@m@VU@wnK@alKVUkUkKƒbmUkmƒ@U£WVk@@UÝbbƒaÇx@b@WVUa¯ƒ@wVwUUV@VwnK@KWaŁ@KšIUyUI@WmXó™UbWaKm™@km@IUyƒIUaWKƒx@zUKUL@llVUnkLVVkJWX@VUKUVƒIkVWakb@VWb@n@JkXUlmL@xkL@`VxšLUÈUJ@Vm@@bmIUlUL@VUVVbknm@mKUw™KVÈ@J@LV±kkJUIƒl"],encodeOffsets:[[120803,31247]]}},{type:"Feature",id:"3412",properties:{name:"阜阳市",cp:[115.7629,32.9919],childNum:6},geometry:{type:"Polygon",coordinates:["@@V™nƒš@ša„k°aš±@‚¥@UUI@aUmlwUUx›b@¥XU@mmI@a@Kn@@_W@@W„I@mšUVVXUl@XaV@‚K@I@a„LX@aVI°K@KVL„UUw‚yXkšK@kšKÆbXnlK@k@a„JlU@w@U@»@aXKWƒn_‚JXkVKnƒ@°LlKXƒW@¯Uƒ@aUK@kmJUw™VƒIUJ™„kŽmL™K@kka@wUVm@@am@UkUbkK@nmVƒÒ¯VU„WVVmIƒƒULk@ƒƒma@kkKƒƒ@nUbUamU™`UUVUkKVkkƒW@@bkmƒnƒmUXVKXVƒL@VƒbU„m‚™bVXJ@nmKÅI@KWKUXVJUL@VUKUX@KUKWL@LUJmaXXm@kVVV@L@VUL@VlK@L@V@LUK@VUb@UUU@°@nVxU`‚Lkn@`@XVJ@X™Vm„k@UKmV¯LVVn±Wm@Ub@JlLUl„@VLk„@lmVVn@bnV@V°IV™šaVJXI°K°V@XXVlVVU„nšKVlUš„bWXnV@bV`U„„@@m@@‚ƒ@nxmn@bXVlL@¤nb„Ul¦šVVUnJVU„Vl@@bÞL"],encodeOffsets:[[118418,34392]]}},{type:"Feature",id:"3413",properties:{name:"宿州市",cp:[117.5208,33.6841],childNum:5},geometry:{type:"Polygon",coordinates:["@@@UWU@bkW@aWU@aUIkWV™lLXb„lVIUVV@‚mn@V_n@VaUK@I‚@UašanJVU„@lV„UVnnKVVlaUa„I@wnK‚Lnll@nVlk@wVKXkl@@b„bUJ@V‚U@U„UUyVk@aVUXwlWXX‚WU¹@aU™@WUI@mlUšn„J@Il@šaXbV@VKl@XxVL@W„IšJlb„@„al@„IUUm@@aVK@¥¯—@mUķ¯bWƒk£Vm@akm@VaÅ@UVWaƒ@UJWkƒJ—UƒbWbU@UlƒXk@ƒamV@K¯nk@ƒlU@Uxmz@bU`ÇbUbÅVm£U@Ww™x@akLUK@UlakwUJWVkLmaUal@n_ƒmVUnKVUUmÅXWa™@kJmx@XUJ@bVLXxl@VVUVV„UbkLWbU@@lUVV„VVX„›K@XkJ@nU@@bV@VxUVlb„U@xXLWŽn@UxVbVĊ„V@b@XV`mnkJ@kUKmbƒaU@VbnbÆx@XU@@`k@@bl„™@@bkL@WƒakXWaU@Vmkx@XWW@@wUUUbƒJ™U¯V™@¯ÞU@WxXŽlL@bkb@ŽlVlnb™JW@kkU@mbkaWJ—IVlmz¯`UnU@mb™@@„ƒ`@bkVlœnV@b@šV@„aVxn@Vx‚KXnl@nbVK„bVK@a„_V@Vƒ„w@W„LlwnK@UmIU@VWš@šUÈ@lKnal„wš@@V°@šaUmlUUw@„ƒV@@UXK"],encodeOffsets:[[119836,35061]]}},{type:"Feature",id:"3410",properties:{name:"黄山市",cp:[118.0481,29.9542],childNum:5},geometry:{type:"Polygon",coordinates:["@@lXnlWX@VUJVnUJVzXJVx„kVJlI²l‚U@K@IUǚLVxnLn@lmUaVU@UVKVknJ@an@@UVIVǙKUw@_lK@wnKVklW@I@mXa@UlaXblU„JVUVL@UXWlIUUlKVmkU@kVKVL@y„wXLVb„JVz@Jlnš@nŽ‚LXbVaôšnW@la@UVWUa@@a@mk@WIk@VwUa¯¥m@UUVK@ImK@aX£ƒkK›ÅV™a™™ƒ_@±ƒakXWW—LƒƒƒnU@@a@¯mK@L™JUWwUV™VmbXX@lWLn`mzUJUb™Lƒ„k@makVWmkX™ambkKknƒaƒ@ƒaƒb@‚U@Unm@—ƒWVƒ@VbUbUJWIk@@lmL@°UVUVm„nš™@@kmWkb@xƒ_m@@aU@b@JlŽUz™lWxXn„@‚b²@l`„IVl„UlL@VšK„nVbUl@VlIn@@b„bVWUk‚@@bX@Valb@bnb°Vn@„xVKlbVnV@V‚x„L@ln@UXVV‚L˜"],encodeOffsets:[[120747,31095]]}},{type:"Feature",id:"3414",properties:{name:"巢湖市",cp:[117.7734,31.4978],childNum:5},geometry:{type:"Polygon",coordinates:["@@VV@blL@ŽXlWnnšnŽ˜„@VXXl@@WšIX@VJ@LšxŎxlnšŽ@bXJVblX@VVbUVn@VbUVlb@LnJVbVLV‚XLšÒVL„ÒšV„bVIVylUXk°Wšknm°_lJ@aXL@l‚z°@„lnLô¼V‚È„VUUaVKU@WW@@UUa@knmVLlaV@„a@kšak±@UmwkKmk™lj™ÝUUkL@mlIVmnÝWkkUÝ@KƑĉ™a@»ƒmma@mX™¤¯Uƒw@ƒ@UU@bU±±L@akmƒ„™LUKmLUUUJVbbÇwƒ@kUWaUJ@Xkxm@UJUUm@™„k„ƒ‚ƒakXUšVl±ôU@kn"],encodeOffsets:[[119847,32007]]}},{type:"Feature",id:"3416",properties:{name:"亳州市",cp:[116.1914,33.4698],childNum:4},geometry:{type:"Polygon",coordinates:["@@lU@Un@@anUlw@KVmUwlaX_lKna@KU@@kWKUU@ankW™XK˜@@V²VVIÈU@al@VaÈamK@wU™@klaUƒV@XƒVUU»WUUbkmUkVmk@aÈw@mWU@VkIkVWKUÑķXȭºU¯lƒ@kkLWmÅa™L@l™LWlzVxƒVUK@L¯LUJ@bWƒK@b@JLU@Wbk@WVUU™V@nƒJ@XX@@`m@@L@bnJ@nWV@¦œa‚wVVkxVn@bVJ@V¦@Ž™²¯bƒl™b™@m„UšUŽƒŽ@¼ƒ¦Xb‚UV`@nnxUxWLkUkVWKkV@XV@@VVL@VX„@lVV@L@blL@`šL@xXKVL‚@„VnUš@lwnU@ml@XnV@@UVW°LnalƒUI@aUK@a‚a@U„kXW@I@mWL@UXK@UVW@U‚@@k„Wn‚@@V„@XblaVxšL@bVKXb„IlJ"],encodeOffsets:[[119183,34594]]}},{type:"Feature",id:"3417",properties:{name:"池州市",cp:[117.3889,30.2014],childNum:4},geometry:{type:"Polygon",coordinates:["@@„V°°ĊŤ@xƒĖ@xœXƤ„VôIÆmnLllXÔ@lƒÜŽn@@JšbšLÆaĢÞĸ„°VVUUKVanK@UV@VL„VVn„ln@‚xnklxXamk@WV@Xa˜@naVk„Klk™@mkUWwkJWw—IWK@ƒUaUwWIUyVIUmVI@UXWmkkW‚—KUUVWm@@kƒKw@U‚UUmkaULƒwm@¯Uma@akaUbW@@a@VlUXƒa@am@kJ@UVkUaƒm™L@UkKƒVUkƒJk_±@aƒ@WmXwÇkkaVaUa±ƒœwV@VkƒwnyUaW@UU¯amLk@m™@kmmU™™¯K@L@lUX¯ƒWlkXƒŽVb„bƒVUL@J@LVKnlJXnlb@`nXlalV@bnL@Vnb˜¼@lXbWlkL™K@zUJmIUxUVUVmX","@@llUL@VlxšL@a@UƒwXa¯@"],encodeOffsets:[[119543,30781],[120061,31152]]}},{type:"Feature",id:"3401",properties:{name:"合肥市",cp:[117.29,32.0581],childNum:4},geometry:{type:"Polygon",coordinates:["@@„L„xV‚ĊLÞkšVlVVXaWaXwW™nU„@‚anVVUX@˜bXblWkk@wWmk@VUVKnb@Išy@_kWm£nmVa@U‚KœwlVl@„zn@°l„IlmnVšIVmnV˜aXÅWmU_VK@Unƒmmk@UIVakaƒa™UƒÑUK™ÑWKUUKUamI@KkaVUUam@VUUa@UkWUaWI@a™kmōw™wUL@`mn@KƒV™IUVUUUK›Vk_ƒVkbWƒ@VkUULUJ±I¯aƒlkxU¦@L@V@V@b@b@„WJXbWVXn@LƒKVL@JkLƒŽV@Vbn@VV@XU@UlV@@VV@V@XXV@@VšJ°š°Xnb°@„JUVVXV`@bkXWŽUbU@WŽn@VLXlm„°bV„UbkK@bVJ@bVbkLV¦ƒKķV@x@„XbmVVVk¦"],encodeOffsets:[[119678,33323]]}},{type:"Feature",id:"3403",properties:{name:"蚌埠市",cp:[117.4109,33.1073],childNum:4},geometry:{type:"Polygon",coordinates:["@@VÒXLlUlJ@UXV@nÇx@bnlUVllnVaXVV¼UVW„U@V„²wVV@Vl@„VnwlIš@XbÆWVnUVmLUV„nm`k@VbnblKXUVIlxkb@VVLlK@bšwXxV@n¤ÆUVaÈaV_@anyVwV@„kl@°m@LnU„bl@„WVkV@Xa„a˜V„IXl‚IV‚„@XbVUÆ@XKWwUkmW@_UmnIlJXkWKXmV@‚w@_XV@Kl@kU@KlX@@UUUUKWLm@klJVUUmk@mXUWmXwƒ`m@„zUbÝakbW@m@UUƒéUIm@UbKǼ@™kKWXmWUkaWU—JWU¯L@W™Lƒwk@mm@_™ƒÅl™UVkmWUnV@VWLUb™bƑĬ¯l"],encodeOffsets:[[119543,33722]]}},{type:"Feature",id:"3402",properties:{name:"芜湖市",cp:[118.3557,31.0858],childNum:4},geometry:{type:"Polygon",coordinates:["@@„bVaV@XllLXU°ŽlL@V@VUnVl¯Ikš›VUVU@@b@lUXUWmb„n@¼šbƒĊ‚LÞ@lVXlmÞUnkJ@nlKVVšÞXklWVaVI@aUKn»lL@Kn@‚XXwlm@mn°@„V@Wy„wXlWVk™ƒ@aUaVU¯£kKWVXVWLUkkWlkkwmJUam@@aULVa@UƒVaUaVI@m‚@UUJUIUmmV@bm@UXVVUlVmImakKUU@UU@VmU@@kma@KVIXUVK@U™VmUkV™m±£@JkU@nlšk‚ƒLUlmb—@WbU@@XnlWb"],encodeOffsets:[[120814,31585]]}},{type:"Feature",id:"3406",properties:{name:"淮北市",cp:[116.6968,33.6896],childNum:3},geometry:{type:"MultiPolygon",coordinates:[["@@lnnK@¦n@@V‚V„@@VV@nIV„V@VW²a@b@bVnUVVV@V™z@lš@°UšV„IVaVV@x@ŽXX@WlwUnV@XblW„b@XlK@aš@kƒ@al@@_V@@WÅwmaUaV@„bnaVL@llInmU_@W@aƒUUĉUaVwm@XWK@wƒVkaVUUwU@@aV@@mlI@WœLWƒUUUƒVU@kV@XalKVaUƒVUUUk@WwUK@aVI@WƒUk@@UUU±xkb@lVš@xnLÇbUbk@@bÇVUJ±U@U—@WLXšml@bVVXL@lV@@LmbkLW`kbVxUn@LkxmV@bm@@VkV"],["@@VVVkV@¥@UV@U@VUUJƒkWakKUšlXVJ@bXV@blX@aXV@V"]],encodeOffsets:[[[119183,34594]],[[119836,35061]]]}},{type:"Feature",id:"3404",properties:{name:"淮南市",cp:[116.7847,32.7722],childNum:2},geometry:{type:"Polygon",coordinates:["@@°kƒīšaVaXK@U‚UVmnXUlšVÆkVKUUUmmU„ÑkU™UÝlĉKUƒwƒKƒbU@UxW@@lœmVUUVmUUƒmƒw—aW„kL¯K@Žm„ULWlIm`X„WL@b@¼@V@xkVƒI@b@l@lk„V°Ȯ¹ĸW"],encodeOffsets:[[119543,33722]]}},{type:"Feature",id:"3405",properties:{name:"马鞍山市",cp:[118.6304,31.5363],childNum:2},geometry:{type:"Polygon",coordinates:["@@šNJnllLnxV@laXLVKma„aXbVI„bVKVVVIVyn@n_ƒƒW@@ƒ„UnJlUVVXlLnaUWlV@VV„IXW@_W@XK@K@UVUUwVamÑXmmwƒw™KUnUK™çU@ƒJƒU¯@mŽ@nknWxWm@@LkKm¼VL@bUJUbkXWl"],encodeOffsets:[[121219,32288]]}},{type:"Feature",id:"3407",properties:{name:"铜陵市",cp:[117.9382,30.9375],childNum:3},geometry:{type:"MultiPolygon",coordinates:[["@@„ÒV¤@¼V²@aVV@Ž@„„x°Vš£nW‚@nbnaVXVW@k@aV@VUœUl™°JUkVm@U@UkK¯WVkKWkU@Ubƒakwmlwm@ƒkUmƒUUKU@@VmLUbVLUV¯U"],["@@LllUL@VlxšL@a@UƒwXamK"]],encodeOffsets:[[[120522,31529]],[[120094,31146]]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/ao_men_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"8200",properties:{name:"澳门",cp:[113.5715,22.1583],childNum:1},geometry:{type:"Polygon",coordinates:["@@HQFMDIDGBI@E@EEKEGCEIGGEKEMGSEU@CBEDAJAP@F@LBT@JCHMPOdADCFADAB@LFLDFFP@DAB@@AF@D@B@@FBD@FADHBBHAD@FAJ@JEDCJI`gFIJW"],encodeOffsets:[[116325,22699]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/bei_jing_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"110228",properties:{name:"密云县",cp:[117.0923,40.5121],childNum:1},geometry:{type:"Polygon",coordinates:["@@vIHZDZQtDLNMXIbHRCXXITbJ@H`LGPRDDJNCLHTOCWFGvGBUJMKGFO^IHWXITQCI’Y^AXGfRˆDXF`DJOLB~G\\DZIHHpErUVMhHb]\\M†BVF@FTP`@zTbD\\@~M\\K`H^EVODWICAakAQXoIcCOCIgGYNWFWNGGKKGaJEGMEIKYJUT_J_Go@_SyQaSFMEGTcYOQLIIi@EKAUPCV[EEXQCW|aMUMAaYCYNIDGGACIMGGSKDQGaF_C[GaB@GOIiOKAYL“mI@CN]F[SWWAcKKI@HMUimEKbeYQYISNUOcBKPIFBNgvDPGZYFSf]CMSIWGEUFgDIQ[MeDMJS@RR@LphFPCHaBAJKF@J]IBJO@HlO@@RKAMPJHCNDJTHFP@ZGNANBRFH@J_fM^ONJNF\\VTDJHDON@XRND\\XRCPVETCLBVKDFJINHRGPRV@\\CLJN@VbXbLVT"],encodeOffsets:[[119561,41684]]}},{type:"Feature",id:"110116",properties:{name:"怀柔区",cp:[116.6377,40.6219],childNum:1},geometry:{type:"Polygon",coordinates:["@@JHTVHXCHPfnDJGHNDJSB[JSBGVSAOH@PMPuDEHHXZN@PHF@ZLJ@LHVYJA\\OFWP]BMtMBSRGV[JeVAPQVIFENMD¡–@^NV\\JH@NNL@NM\\kTQ\\I^FNIpBHGTBFFAZQfKDIXQTLXFXNNVMVHRGpCFLlRLEVBBH`IVO\\G`RDPAXLXBXORHZEHTDLLN@VGTMrQNFPeASKG@GMOAKBYMK@GTUHUXSHMVDNMOUEOZMJML@^KRACMZEZMRQLUHE@OFENPR@DI\\ChMHIDG\\GJMDWHCKGMDCIQCHO_K@GaIJSWWQDaGWJMNCKRsCYGYuJUSaKaW@UIMDK@[QUHOGQJMEILCAUDKFSOUQD[WMC‚Q@WPMGCCIUSE[IMPMN]`e@IEGAQBMHM@YEOSGCIDMIGNOLB@QP@GkP@AI^J@ILEBIbADGEOog@KQQWSekWQQUOFKZLF@PUNmIaHIUeBCTSHENcJa@_IWSaGu`GLSBKJQFOXGDXVQVOBIHcDSJWBEFGTMH[^mLaXcHiKElTRKtFXZ`MHMPCNRDxZˆB\\ICIHK@KŽHbIVFZ@BPnGTGbDXRDJaZKRiGEFSFEJhjFNZFjn"],encodeOffsets:[[119314,41552]]}},{type:"Feature",id:"110111",properties:{name:"房山区",cp:[115.8453,39.7163],childNum:1},geometry:{type:"Polygon",coordinates:["@@h@bl@HRJDZ``TA\\VVD^H`\\pF\\JŒ`JGv@ZO\\GPSTEjPTR`FnEbDTDHEhLFMTK@ETSPULKEI@OVISKSJACEQNQbV˜IXGDIN@dMB[IIBcN]ZHNLP@XOWCFWŠCNRHTpATD@^NVNLED@Rh@jCEF}E[OOHUEW]W@QGGDIQSH_MmFmCUT_K]i@MHCMW—FCF‹E{BMHMPOHKS]CFNGBELDH_@BcAKOACESAOBELaXAROB@FODMEDWJAG[aE@UM@DImEWJMC@OeCA{aE[@{L@MINUCQXKfUJORCHqJBF@TCXWNQX]M[EAJO@@KMBQJIC]EWMCCUBEBFHKDOTMBGNGF]MWDBRDdMDQVyE@LPVHDCP@JVVMTG~HNSH[CmRUvHPHBbA\\PTNRC\\YNJ€PRARPJDDR"],encodeOffsets:[[118343,40770]]}},{type:"Feature",id:"110229",properties:{name:"延庆县",cp:[116.1543,40.5286],childNum:1},geometry:{type:"Polygon",coordinates:["@@^AXOPEB[ZIGU@KKI@YGE@OYMGWFGvCNO@OPGTBHUTA\\ITACIGMIHmCOeDGGWSUIGimYEEMgiFITEFEjHLQbYCIWQaCSHmHAOY@UEaJG@LGLDJ[J‡AwYQCDMNONGY_EWLsSQFkMO[NWAIGaIYL@HMBOKiOQDWEUDMQSF_QIUBWdg@[NaAKQ@M]OQ@WhgLUMMFYQDIRCEUZOOCIOJ[KIUMKL@HIDKVEBM`HJAJSJUdBLGNEdMBMO[BYEWJSNKNaD]PE\\SjOT_RQVEZPpƒNQXfŠNA~lNG`@PNLp¼RFLfbdKbATUh@FSNWjGFZVLFHVA~X¨PPROfFJbNJPLFbENJPrEFNPFRHDDJdENJLVEPBJTVTHGHFRFH@PXP\\ORQHW\\BjWFDERLPPBbB\\E`B\\D\\L`@F]FCnJ^AZL"],encodeOffsets:[[119262,41751]]}},{type:"Feature",id:"110109",properties:{name:"门头沟区",cp:[115.8,39.9957],childNum:1},geometry:{type:"Polygon",coordinates:["@@V@XMnGPY²‰JQNEhH\\AZMPDVTTDZCPiJkHSHCjIdFtEHITCNITQEKUAMCEIKCECABYESKFWAKBEIIHABGDCKCAIHMHALKEI\\CFIBILIJQZS]BBEECS@E@@C]COKI@CABAAEEDMGƒCH]A[M@CJWH—JaUMRFRBDTITLUJ@PFJKLOVST@FSLENgKGFSCaCmF_ESQiOSFOT[HYPu@IH‹_[IoE_[]GUC[USB__CYQI@Gakg@qZeHQNMNV\\FVLPgJAFJPRLCH[XcPELUT[JiV_EELFTADBXRTRLJC@fHXHHbPd`fR@NfT`@TLplHMpCEJHJBVLFŽ@JT‚VnG^KXDXHNVGRLRXFJVdDHSNWLGfEzA"],encodeOffsets:[[118635,41113]]}},{type:"Feature",id:"110114",properties:{name:"昌平区",cp:[116.1777,40.2134],childNum:1},geometry:{type:"Polygon",coordinates:["@@VNLJI\\JPPDYPFVQDCJZRNEVNhKXgR@^P@NLRbB\\Mh@XcVARJE`RTCNFV€XRCjPPLNA@GZKbJJHXB\\MNPjLdGbWnK\\]NGHSFEXATIdCJGPARUWUHCPWRELITAHKv_E@iYCaW_BQ\\Y@QIO@QDCIGZCEMWGFMFAFgHEDOCSqKCCFGAMKEAC@ODGCGs@WH@KQA@EE@CE@GEA@EH@GGUEEJEAYD@JM@@DAA@FHD@FTJEHUC@JUBKCKG@G[CIIQReAYhO@OXGDO@@FF@IHJFCPEBACBIAAKDOABXARHPNEHGbQAAKQFGIAM[C@WHKaGiCEGOA‹HUKCIokSCUSOCYN[BgGMFIR±ŠOZmHWNU@ShbbXDHVXXGJ^lZ@PZ\\Nb@\\FHJAD"],encodeOffsets:[[118750,41232]]}},{type:"Feature",id:"110115",properties:{name:"大兴区",cp:[116.4716,39.6352],childNum:1},geometry:{type:"Polygon",coordinates:["@@F\\E~DFN@BDFEpHFCHBBEGCDCJBHUDSBB@ELCPbF@B\\J@BJVAFJ\\ADKTCBGECFMT@BMN@@FH@DaNBEnvB@FPBATK@FHEFIAKFBFL@@PKBFJHC@FXBRAFCDMPDTOL@JIVFDHH@DDH@BGRFCDLD@N^@@CNA@KNOAEBCECFEGCFGMGFIPMOEJOLBADBBHGG@GCHIECY@INC@DMGS\\AIOZAAEYA@GT@KKMBEETCGMVINFxA@MJADB@FlA@HJA@NND@DFA@DVAZBBOFKH_JA@K^GBC@EFE„G@gAENMXKJigC@IbSJMqGOP£RGSMGE@kbQFDPEFiBSGGSBK]I{CDWCIDOic[C_G@SuSO@EWKCO@MNY@\\uZOPENQD[LKESSKGBKEG@EJGAGHoH¥CqhifeJkX_XFFGHFNEDFPENKHM^IFIVL^S`DVEnNnG`RTCJHH@R^XFXGVPP"],encodeOffsets:[[119042,40704]]}},{type:"Feature",id:"110113",properties:{name:"顺义区",cp:[116.7242,40.1619],childNum:1},geometry:{type:"Polygon",coordinates:["@@EhEBENXHFNYDJHCD@RJP@R[ZARX`DbjZF@bHXT`Jb@dIFMTGDSfAJVbGnJVM@OKELYPERVXRflXTT@NIfC\\NJRhCVEHFJXNT^DTeZEHYCOhuAMJELOdAVPTMOWBWNMNEJgl]@WGUFIC[T{EEDEHGCIGMI@SECUQI[D{A{GQESPUH]CsiMCmHUeoHENcAaDGCMDGMQCACCBaCGLMAHB@DIEQLOAAEEJ@CW@CDINGAAGKQOCgV@LG@BEGDKNeREFBNCFIDOPKD[@YRW@GFWDAFE@EHDDrLDTCPGF","@@KrJEH[\\B@FF@CHFBHUN‹AJKADGECBCMAG^E@EbI@BEGP"],encodeOffsets:[[119283,41084],[119377,41046]]}},{type:"Feature",id:"110117",properties:{name:"平谷区",cp:[117.1706,40.2052],childNum:1},geometry:{type:"Polygon",coordinates:["@@ZJZRafFLjn€VGNJ@LLBdXX\\T^EDMJ@”nZKLBjPPJ@HbA\\H`DbERHLCFK^BZaFWXQLAGMHa\\OLO@SBIpBdCLƒVQfElO@GSAKEDQTC@GEBKG@ORIJBDAPDFA@CaOq@GGQAAEJK@KMUGAAGEAa@MGMBGCGSIIW@WSUCMDOJeWOM@IUF{WMWaDIMgIoRoCOKeEOEAG_I[cg@wLIFENQFDVTFJ@HNDJGHCFFFS|D\\EJHV@Xk^IhMFMNAXPX"],encodeOffsets:[[119748,41190]]}},{type:"Feature",id:"110112",properties:{name:"通州区",cp:[116.7297,39.8131],childNum:1},geometry:{type:"Polygon",coordinates:["@@FDAJTGDNDCTDDEDBBE@DT@@EHCDGJ@EIZ@@FDBR@ATFBBVFFE@@HNA\\VE@CLIFNJFNJBCP]A@LJFA@HJEDD\\C@DBCHLAEPF@@DH@APHAERDF\\GIxDTM@CFLBBFJ@CNUPMHECGDBF]BMFPDLRBHHBJMDCX@@DFIBFPBRKJF@CGANBHKbDDABDRDHNNCHDbCdBFMpGHiOYMefKJMC}HWAUNW\\NNBNA„kNU|]HMTMN@MZBLFFF@RIRUT‘BMFIEGaAGGAOIIUGTSFcYKS@MSLYPKRUBU]EWDOI]CKGASgW@MTWKIMCS@uMAKKADMECGAKVUTSDy@IjWLMNBF@hƒHEF@FAD]H@LIBG`ELAPYAUB@CEB@CMC@MIB@GkB@ECAIB@NwBMEUJHNSDFFNALLS@@HZBBFYBJP[BHTCND@JMZ@FDGJHDH@GHAABCKAIPPFONEJNHEHHDEFFDADBFMP@L"],encodeOffsets:[[119329,40782]]}},{type:"Feature",id:"110105",properties:{name:"朝阳区",cp:[116.4977,39.949],childNum:2},geometry:{type:"MultiPolygon",coordinates:[["@@bFGHBHFBFIVFHHG@@FFB@HDFF@@FRB@LXGt@DHCH@PBDLFBNF@BEXCHEX@ZQ\\@LCPOJCDEAMFEfQLMHCAFH@@KhUNE^AAEHCFDNGVODMI@AEKADEN@CSJw[HCEFQGBBOG@@CE@FOKBDGCAD@C[FCGIB@IE@K^BDOIAEMMIJEDKF@[UMB@GF@EEAUEABSQ@CA@EY@FJI@CHGD@FS@@CAFCACFSCCDCMSHBIECMB@D]@@MKCDCQEAHG@CCG@CGUEIJK@SPOCCNEDQBDNDB@DJCDLFCBBALJB@BVGPBKVO@KHCCCD@FE@BNA@FNCTDDJA@FGB@NBDW@CL@hT@@ZHHQDDDAFSAANBC@HG@EFS@@DE@@PCB@Ue@CADNJB@FCBWA@LI^ix@FIHrH"],["@@HUN‹AJKADGECBCMAG^E@EbI@BEGPKrJEH[\\B@FF@CHFB"]],encodeOffsets:[[[119169,40992]],[[119398,41063]]]}},{type:"Feature",id:"110108",properties:{name:"海淀区",cp:[116.2202,40.0239],childNum:1},geometry:{type:"Polygon",coordinates:["@@plDJVLŒGPBFHjDbHGL@X\\DBNHJREBLRBHaFGŽMGOBQAWPBLCBBAJBDFADOIEJGE@@EP@HCPWP@ZgfBRQJJ\\D@HLHLDVA@IVDFGSI@EGC@EBB@CN@@IZCAGHGaEqGJG@EjwJ]@K@GSA@e_I@NE@CA@Kg@KC@ENCFƒAKQAW@WIMK@V‹@I@@F@^EDFB@HcIaDYCBRRDCHD@EFLN@FE@CJUPEJOJMTBPEDIFCMIAKNOGMRFJNDVBFLSRMJSDGJsFcEiJGDGTIlOjYD"],encodeOffsets:[[118834,41050]]}},{type:"Feature",id:"110106",properties:{name:"丰台区",cp:[116.2683,39.8309],childNum:1},geometry:{type:"Polygon",coordinates:["@@hMN@NFTQCFRCBJFA@HJ@@HJ@HJ\\FTACDŒ@@UNLXJX@@MA@@IECAQlDFEHBDI~D@GXCFMVDFCH@@NF@ANJC@FnAB@AMF@@EDCDDLGP@LUOAUH@AIABKAAEDCKID@CCACMWA@EGDEILA@OK@AELEJBFEEGL@BSOA@EuAFmMACbG@@EM@ANS@ENFDAHSDCL[BEIUBAII@A[E@OaKD@FAACTGVIACDHDAFGAEDoGEFACM@i€g@@QFCMKMU@]SCoBGSMQ‰DEXXDWPO@MKYGM^AdJJA\\cNB\\G^„DNHFCBFABDBJ@PL^D@DF@T@FDAF^A"],encodeOffsets:[[118958,40846]]}},{type:"Feature",id:"110107",properties:{name:"石景山区",cp:[116.1887,39.9346],childNum:1},geometry:{type:"Polygon",coordinates:["@@NQPHLMJBDNJEFCAONSPIFIVODIF@@EKMFEC@DGQCAQZDbCdJ@GEAFC@]@EJ@DCSB[EGII@@GI@@GEBAIQDDESRMEM@gNYTIRKJAJEJ[DFJKLGBGNBJLDCDAHGBJJAFBLEXTLZFBAFDLD"],encodeOffsets:[[118940,40953]]}},{type:"Feature",id:"110102",properties:{name:"西城区",cp:[116.3631,39.9353],childNum:1},geometry:{type:"Polygon",coordinates:["@@XBDA@EIACM@IJAD]BC@SFABISAD]H@@OAEDQEW@BLE„MD@FLDh@@LDBF@@M`J@fTB@H"],encodeOffsets:[[119175,40932]]}},{type:"Feature",id:"110101",properties:{name:"东城区",cp:[116.418,39.9367],childNum:1},geometry:{type:"Polygon",coordinates:["@@DBf@@VDA@OF@@CT@FEH@@GADBMTBBECCRCGG@YS@@gDK@A‘C@PG@C^TBAJEB@TADC^IB@J"],encodeOffsets:[[119182,40921]]}},{type:"Feature",id:"110104",properties:{name:"宣武区",cp:[116.3603,39.8852],childNum:1},geometry:{type:"Polygon",coordinates:["@@RBX@RFFCŽBFU@aK@WA}CCJGAEFkCBRFD@JB@@N"],encodeOffsets:[[119118,40855]]}},{type:"Feature",id:"110103",properties:{name:"崇文区",cp:[116.4166,39.8811],childNum:1},geometry:{type:"Polygon",coordinates:["@@XBL@@bEV’D@BX@AC@MHA@EIBCCDSEMmB@EIDBME@@MG@EDUCENWD@H"],encodeOffsets:[[119175,40829]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/china_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"xin_jiang",properties:{name:"新疆",cp:[84.9023,41.748],childNum:18},geometry:{type:"Polygon",coordinates:["@@@›ρȁôƧƦóəʵסʵóƪԫʵѵͩƧͩړ›υࡓɛʵ@ȃ@óᇑѵƨɝɚôóНѺͩɜ̏ԭʵôƧɞñ@υƩ—݇ȂóƩƧ@ѵȂυœƥŌਗ—॥ɛóʵѵƧѹ˜݇̍ࢯ˜əɞυ˜ρͩ̏óਙƨƧŋôōóš̍ͩóʵן›óŋړͪƧѶ@ɜԭ—ԫƦɛȄ̍›ɝȄöςƩȂ̏œñȀ̏œƩóóŎə˜@Ő̎@ɞȀɝŎôƨóנѵȄƧ@óŏɝœóɜôŎ̍ͨςŎ@ƨóôƨɞ݈ʶóƨφó̎Ȁƨ̍ԮòѸԮמ@ѺȀ@ƪၬֆòȂñ̐òȂɜ˜óƨ̒Ŏ̑߼@φρȀ@Ő๐ς̎Ƨφ@ɝφڔ೦Ԯǿࢰ@ƦŏԮƨƨȄƧ۬ɜʶڔŐɚɚóŐôƨ߼˜ôƧƧó̐ƥóŏѺǿƦȁφƧς˜ƨƧ̒@ɜƥƦυ̐ɛƪͩƩəƪʷ̑ə@ȃƨʵנŋྸōਚԭԪ—@ɝƨŋ̒օςʵôƧ"],encodeOffsets:[[98730,43786]]}},{type:"Feature",id:"xi_zang",properties:{name:"西藏",cp:[88.7695,31.6846],childNum:7},geometry:{type:"Polygon",coordinates:["@@ôŌנœôʶ̎ͪô™óŎƨŌਚƧ̐ôςͪφ—ɚɝࢰ—݈̎Ѻ—Ѷƨôʶ०ɜਘ˜Ʀŋφ›Ѷȁ̍—ôŏɚŋ@̑ə—@ŏò̍ɜ›óƥôʷƧ̍φѹԪ̍ע@Ѹʷɜ@ôñנ@Ѷɛɞô̐ŏѶƨѸƧƥōƦœôŏô—@ƧôƩ̒ŋƨŌƦǿô̎ɜȁ̒—óʶѶôôО̒›ςƥɜНφσɛȁ̎υƨఱƧŏ@ʵƥœ@ŌóóóͩƨƧóŋ̑õóɞóɝԩͪɝρôƧ̍ƧѹͨڑŎ̑ōóƧࢭͩ̏ѵɝóఱóóԪυô@̒ƥŌ̏Ƨ̑Ȅ݇ŎƧ›ѵӏ@ɛõŏɛȄôӒƧŌѵǿɝ˜Ƨŋԫ@̏ʴƥ@óǿ̑Ȁóǿ̍ςóóυô@ʶɛñρƦƩŐó̎óœѵó̑ͪࢯОóɜן˜Ƨ̏ƥȄ߻̎̏̐ןŎɝɜöɞƩȀôöɛȀóͪ̐ƨƪ̍̎ȂƥԪυО@φɞ˜ôƪ"],encodeOffsets:[[80911,35146]]}},{type:"Feature",id:"nei_meng_gu",properties:{name:"内蒙古",cp:[117.5977,44.3408],childNum:12},geometry:{type:"Polygon",coordinates:["@@ኊȁ૊ö߼ƩɜɛנñԮɛѶóԮô@ȁѸóמ̎ගѺၬ@߼ʶԮӒ߼̎@ŐѹӒ̒Ԫƨöග̑ѶȄ̒ς।œѶɚöɞɜʴڔôôȂ̎—ѺȀς—ƨ˜ƪóԪ—ɜôɛОਕڔԭ˜ѵ̍ѹȂԫ›ɛƥ̍Ȃóɜ̎ô@ʶ݊ੲࢮʵږͪנƨôȂƧ˜̐ͪ@ŐƦƨφԬѶɜôƦ@ŐƧôôƦəŐ̏›@ŐڒѶԬô̐ʳԩНςōôŏɞ@ƨȂѶəóƧ̒ػ̎ó̐Őנóƨô̒@ƨɚɚ@עԫɛɛ@ȁυͩƥʳòևρ—̑ࡗƧͪ༃ॣԮփ̎Ʀ@ôô@ôō@š@ȁѵóƨ̍υȃóʵɛƨƥóυȂóəƪ›̐ρƧͩɜԭڔȄ̎عƧȁ̐ŏó̍ɛ›ƥƧ̑óρŐ@Ƨ̏˜ɝəɛ˜߻ͩ̍ͩɝО̍ƪƧóóӓƨóƧʳ݇@ɝςƪœ@ʴƩ—ƧƦôƨɛȄə›Ƨŋυ›óͩѵ@ɝǿóŌן̍ɛ˜óО̍œ̑̏ôȁ̍ŏòȁñóƦͩ@ǿə@ɛƧ̑˜ρȁυô̍օѹœóȃə™@ȂσʵѷƪòƩ̍—ôó߻ۯôʳƧ™óšõʵѵóѹɜ̍ȂѹôɛŌφֈƩͨρóυӑóޟఱ̑݇ͪóƪƨŌóȄڔԬƩςםñ̑ȃѵŐԭŏƨȁɛǿρôõɚɛóƧОə@ѹ̐ѵöԪͨôͪɛ̒ןŏƧƥóôƥƧɛŌôóɝó@̒݇Ӓ̒Ō@Ŏԭࢰ"],encodeOffsets:[[99540,43830]]}},{type:"Feature",id:"qing_hai",properties:{name:"青海",cp:[96.2402,35.4199],childNum:8},geometry:{type:"Polygon",coordinates:["@@ƨ@ôƪ݈ȁƪ˜@φɝòóƨԮʶɛ̐ѹͪôОəóƧɞᇒѶ@ôږô@ǿѶ›ƪȁςœɜͩφ˜ςŋɞôѶɛƨŌɞ—@ɚςŐñԪॢͩƨȂɞóƨŐ̎ŏעӏ̎óƧƦôœ̒ȁɜ›ςͩ̒œɚɛƨôƨɝφɛóȁƨŋóóɚͩƨóóƩ@ƧəŋƦƩ̍@ƧƧôǿυ̑@ȁɞǿõŏρƥסɚƧóτԫɞœôƧƦ@ñȃòñƥóυôôѹѵ—@ŏ̏Ȅɝó@ȂəŌóəѹƦ@Ő̍Ōυ݈ԩŐƧóôƧ̑›ôʵɞƧ̑ѵôƩɞƧ̑œóНѵóôʵ̑˜ɛȂó̍ƥȀƧŋ̑Ōóƪ@ƨó˜óŐƥ›ƦŎѷƨѵƧ̏Őɝóѵɜן@óòɛ@ѷʸס@ԩ̎υѺƨ̎óʸôƦɛœñ̎@Őɚ˜@̒əŌóŐ̎˜"],encodeOffsets:[[91890,36945]]}},{type:"Feature",id:"si_chuan",properties:{name:"四川",cp:[102.9199,30.1904],childNum:21},geometry:{type:"Polygon",coordinates:["@@ô˜ôŋó̑Ԯ̒ɛОמͪƨōöͫ߼ƥôȃƨóóñôƧóƧôōڔŏƨŐ@Ŏô˜òƥѺŎ@ōɜóנ˜ôǿô›ƦôԮ̍ɜôɚ›Ƨ—ñɛɚȁ̍Ƨɛևυ@óóôŋρԭɝ@Ƨʸ̍ŏυɜƧƧóƧƨȁρ̍ƨȃɚ—ôʵφóô̑̏Ȃ̑ʵɜʵɞ@ƨʳסƩóŎə—óɜƧôƩƧρ˜óôôô@ŎƧƨƨƪѹ˜ó̍̍Ʃ@̏ѹНôޟ̍Ʃóƪυɝɛ—əƨôŎɛȀ@Ȃ@ñɝʶ@Ōρנ̏—õóɛͨƨȂѵОɛʵ@̏ƩŐó߼Ƨల̍φɜȂυτɛОρƦɝƨóƪ̒Ѷɝƨóʶ̒œóƨƨôԪŏφ݇̎ŋ@ŏѺƥôɚɚŋ@ȁɞô̐ȃ@ŐѶ˜óѺφóƦôñòòȄ"],encodeOffsets:[[104220,34336]]}},{type:"Feature",id:"hei_long_jiang",properties:{name:"黑龙江",cp:[128.1445,48.5156],childNum:13},geometry:{type:"Polygon",coordinates:["@@ᇔȂਚНƨŐѶŏöƥςŏñƧƦóƨȁ@óƨ—óȁφӑóóƨ˜óǿ̎̑ôНɞ—ó̑ɜə߼›̎ǿ̒ôڒӑφ@Ƨȁ̎̏ƥƩ̎ρశ˜ôȂςƨφ@נɞ݈˜̑ƥƧɛƨʵƧȃƥ@Ƨƥ@ŏ̑ԩôɝρρóɛƧ›ƩͩƧó߻ʸ̍ʷѹƥɞڕõ̍öɝυ—̍ȂƧ̐̑ŏóƨñŋѹóóȁ̍›̏Ԭõʸ̏ŏ@ǿ̍@ƧОυ@ñƨòȀƥŎ̑ŐѵóɛŌóȂԫōƧŎѹñ̍ʶóОן@Ƨ̎Ѷô@Ȃ@™óŎó@@ó̍ƥԭք༄।ƨͩ̒ࡘς˜ñֈƦʴφͪ@ȂɜɜסԬə@Ƨə̑@Ƨóןô̏ŏ̍ô̑ؼôƨѵɚƧȁɝ@óŐρŎԪО̏ʴ"],encodeOffsets:[[124380,54630]]}},{type:"Feature",id:"gan_su",properties:{name:"甘肃",cp:[95.7129,40.166],childNum:14},geometry:{type:"Polygon",coordinates:["@@ڔôԮࢯ@ō̑ŋ݈ӑ@̑ɞôóôɜŋƦƨôóƨƦנŐɜ̑óͩԩͧѶõѺ̏ɚ@ƨНɜôöəςóɜȀƧȂԮŐѶŏ̒ȄמòƪρړԫôȃƧŋôƩ݈ͩɚ@@ǿɜ@φͩóŏɜӑƧōôǿ̎›ôƥƪóõ›ö@ô—ƨ˜ôƧƦôó̒ɜ@ɞŌõʶ̏Ő@ȀóôƨȂ@ʶע@@ƥ୾ӑó̑óŋôʵóɛړ@@ƩöóƩóρ—ɛƨ̑@óʷƥƥ̎ɛƧ›ôōƧǿôͩѵôɝȃɞȁõƧρóó—@ōƧŏړŐóŎôƨóƨôòƧôóȄ߻ƦõͬƧŎםͩɜНԭ̑ô̒óŌó—ƥ@óƨɝ›σԬƨôעəςƦöŐɝȀ@Ȃφ̒óȀƨƨ̎@ƥƪɚŌ@ƨôƪƧôəͪôôƧŌôȂυɜƧɞƧóəɜ̑›ρͪɛœ̑Ȃó›ƨƥ̍ôסӐ̍ŐƧŏɝôƧȁॡͪòԩρŏ@əɝ˜ƧŋѵɜɝóρŌυ—ɛͪρ›ƩȂѵœ@Ȁڕó@ȄɜʶφࡔڔœƨͪѶͪԬʶôƩעʶɚʶƥôóƨςȂ"],encodeOffsets:[[98730,43740]]}},{type:"Feature",id:"yun_nan",properties:{name:"云南",cp:[101.8652,25.1807],childNum:16},geometry:{type:"Polygon",coordinates:["@@ôɞôɝ̒öôŌƧƨôͪôô@ŋƦ›@ʶƨŐô߻ƪŏ@̐ɜʶѶНƧȁɜͧöô̐˜ςן@ŋɞʵ@ò@ȁɜǿóōɚƧɜ˜φɞôƩ̎ƪóޠѺО@̐̎ƪô̎Ѻ—ƧƩƨƧ@ōóóôóς—ƪƨƨóôɛó̑ԭ—ƥŌɛǿɝƨɛͩô›@ǿƨȁѺŌɚɛ̍ןѶНɛƧôóƥȁƦͩôŎɞ—ƨ̑ɜ—òôφ@ƨʵ@ɛѹōóȃəƨυǿóʵρƧƧŌƩɛ̏ȄñƧƧȀɝ̍ԩʶƧ̑υ—óŌƥʳɚӑóНƥô̑›óӒѵʵѹœƧӐןôƪφõŌƪ̒ԫŌƧؼƨƨס›ρȁƧœƨȂóʶó@@ʴƨôôφ̎Ŏ@Ȁƨ—ƪɚƨœóƨôôôςóޤƧŌƩŋƧԪ"],encodeOffsets:[[100530,28800]]}},{type:"Feature",id:"guang_xi",properties:{name:"广西",cp:[108.2813,23.6426],childNum:14},geometry:{type:"Polygon",coordinates:["@@ƦŋѺ̎ڔʵƨŐ@ƦמȄƪôóȂɜŌɚͩɜ@öóɜôôȂƦôɜȁ@ɞφ›óȄ̎›ƨʶɞŋƨʴɚǿ̐̎Ԭ@ôñ@̏ƨ›ρ۫ô›ɚƨƨНƪŐ̎›ƥóƦʵƥŋ@ȃóƥƧ@@ŏɝǿôυƧȁѵɛ@əóŏ̑@@ə̍›óƧó—@ȁƩ˜ρóòНƥô@Ӓ̑@óŎ̍ƥσŎυ@̍ƨ@Ō̑ôóͪƨ̒óŌړœ̏Ŏ@ŌôȄѺŎ@ɜƧʶυ@ñóɛ˜Ƨ̒ɝ˜óōƥͪ"],encodeOffsets:[[107011,25335]]}},{type:"Feature",id:"hu_nan",properties:{name:"湖南",cp:[111.5332,27.3779],childNum:14},geometry:{type:"Polygon",coordinates:["@@@քɜОƨ@öŐמóƪôƩɚ̒Ő߼ȁςͩɜòƪ—ɜȀò—ñɝò—Ѻͪ@ŏƨŋóɝôǿƨ™ɚȃóəƨȃѵͩó̍@ȃƨóóƥƨƧ@ʵƦ›óͩɜ—ɛóñԭɛōυȂ̍ƧƦō@ɛƥ—ɛȀ̑œóʷóō̍œƩŏƧОəƧóœς۬Ƨœ@̐óòԫ@̏̍əȀƧʳɝŌóɞƧ˜ƨɜóŐƨò@ȄƧŌρŋóôԪОóʶ@̎óȄ"],encodeOffsets:[[111870,29161]]}},{type:"Feature",id:"shan_xi_1",properties:{name:"陕西",cp:[109.5996,35.6396],childNum:10},geometry:{type:"Polygon",coordinates:["@@ςôöƨɝȂɞȄѶóóͪƨȀóŎƨœ̍ɜƦƦôʸ̒@ɜƧς˜ƪôõô@ƪڔ@ôɜóʶôŌô̒୽Ӓ@Ʀ@Ѻ̎ɜѺɛѶôöʶô™ƨšóʴ߼۰óô̎˜ñƪѸƩτʶ@ȁòŋəѹóǿ̑ʵ@ȁ̒ʷυփô݉ôН̏ط@ȁƨóô̏ƪõ@ʳ̐ʵ@ɝɛŋƩŌɛóןôƧŋ̒ó@ŏ̐ƥ@ŏυ@ƧƧôן̏@ƥȂѹɜəœɛóԭ̎ƥóóœóȀן—ɛô@ŎѹōñƦ"],encodeOffsets:[[108001,33705]]}},{type:"Feature",id:"guang_dong",properties:{name:"广东",cp:[113.4668,22.8076],childNum:21},geometry:{type:"Polygon",coordinates:["@@@Ȃô˜ôƨ̎œ@ɚ̒@ôŐ@ɚѶɜƨȂóφɞȀ@Őƨ@ôƦ@ȄƦŌƥʶƦôôŎôʸ̒›ɜǿƦ˜@ɜƥŎ̎ƨφȁɜŎòƥԮŎƨōóŏɛƧɝəɞƧ߼ɜςȃñȄƦŎ̒ōôòƨəƨ˜ɚН@əƨ̏ƪʵυŌəɛóəԭŏəœóŏѹœρʵɝƦ̏™ƥʳѶ›öō̑óóŋρȀυƧƥɛѹōƧôן—ɛŏѵ@óŋôʵɝ›ƪԩõ@Ƨō̍@Ƨ@@ƦɝԮƪО@@","@@X¯aWĀ„@l"],encodeOffsets:[[112411,21916],[116325,22697]]}},{type:"Feature",id:"ji_lin",properties:{name:"吉林",cp:[126.4746,43.5938],childNum:9},geometry:{type:"Polygon",coordinates:["@@נ@ôН̎ʵѺòƨōԬŎôȁɜŋѶô̒ŏƦōñǿòƧφ@ƨН̎@@Ȁ̐Őöʷ̐ԫ̎œôȂѺôòŌôƧ̒Őƨ̏̎ȁφ˜@ŋƩͩםȃƨ—@ȁ̑ʶ@Ōóôɛœƥѹ̑—συ݇@ɜρƧȃࢯƨôœəȂɛōƩɛ̏υρóõœƪʴυφ@ʶôŌóœρք@ɜƧ@ɝǿƧͪρȀƩó̏ŐƨȂ̍غړȃɛԮƨͪ̏ςƩœôɚφȁƦôɜƧôʶφȄ"],encodeOffsets:[[126181,47341]]}},{type:"Feature",id:"he_bei",properties:{name:"河北",cp:[115.4004,37.9688],childNum:11},geometry:{type:"MultiPolygon",coordinates:[["@@Ʃ̒̏ŌѺ̒Ʃ˜óȄƧŌƥͪòôñȂ̎ŐóȂ̒̐̎›ôНɜ—נ̎ôŋɞȀѶ@ôͪφœƨŌɚœɜȃóƧƨƥƪ˜@ʳƩ›ɞρ݈@υНφʵɜ˜ƦρƨƧ̍ɝóɛѹ̍ρŏ̑ôóƨ@œƧƦôƨɛ@ƥƨ@ȂƦ@@ôəŐƧʶƨŌυœ̍̎ɛŋôōɝ@óƧ̍›ƦʵѵʳôʵɜŏςôƪŋƨŌɚ@ôНƥƧ@ōѸɛ̐ô̎ʵѵНԭ@̍̍Ƨò@ȁɝ@əρυͩƪ̏ƩõƧŎƧōóšॡȄɛʶɜȀ@ɞςѶƧœƥςɛŐ@ɚɜɜ@Ŏôôςœƪς"],["@@õə@Ƨɛ˜@ŐóƦφô"]],encodeOffsets:[[[117271,40455]],[[120061,41040]]]}},{type:"Feature",id:"hu_bei",properties:{name:"湖北",cp:[112.2363,31.1572],childNum:17},geometry:{type:"Polygon",coordinates:["@@ñȄυƦöŐƩ˜óנƨƨφ@@Ő̏Ʀ@Ő̑ôƨŌנóɜôƪŋɜŌѶօڔə݈òɞōɜŎôӏƦóƨô̒óôȃƨó̎ŐôƧƪ@ƨȁςƧə̑̎Н@̍Ƨŏρôԭͩԫ—̍ʵƧšóȀôɞƧŌ@Őѹͩñ˜òɞñ˜ɛǿƩ˜ɛñρͪ߻Ȃ̑ŏƪəƩóםôõŏƧ@ɛНƥȄó›̑ѺƧ›ôφóƨƨƦƪóɜŐôóòôƨóφ̐ƨóƦ̎"],encodeOffsets:[[112860,31905]]}},{type:"Feature",id:"gui_zhou",properties:{name:"贵州",cp:[106.6113,26.9385],childNum:9},geometry:{type:"Polygon",coordinates:["@@ɜȀƦŋԮ˜ô̒ɚ˜ôōעƪƧʴɝ@ɛʶ̒ʶ̐ȁƦœóȂô@ôŏ@ōô—ƨʶѸô@ʶƨ˜ɞó@ōτöòυƨ@@əƨô@ɛ̒@Ʀɜôȃ@̍ôʵԩНôóςŌƨŋ@ȃƧñôŏƧɛƨ—ôɝƧʵ̍œôȃυœ@ɝɛȂƥóóȁɛóõôɛ@əͪɛŋôȁƩóםȃ@ƥƧŏړʶѹ̍ƥŌƦȂóôɜƨѵО̎נəɜѹŋƧȂ@ȀóœɜͪɞƧ"],encodeOffsets:[[106651,27901]]}},{type:"Feature",id:"shan_dong",properties:{name:"山东",cp:[118.7402,36.4307],childNum:17},geometry:{type:"Polygon",coordinates:["@@Ʃ̐φͪɚςɞ@@Ȃƨñ̎̎Ԯ@ѶОƨƧڔ@φН̑ŋ@Ʃ̒ǿ̎@ƨɜԬςôʶ̐ʶöԫƨƧנƥɜŎôō̎@ôŏóρƧŏԫôóƧԩó@ƥɜƧԭóƨʵɛƨ߻ӑɜНԩ˜óô̑óƧʳə™óɛƧ@õȀƧœ̍ȃɛŐóŏυО̍—óɝƩ—ԩ@ƧɚԫȄɚʶƨ˜ɞʶԪ̐ړɛƪ̒"],encodeOffsets:[[118261,37036]]}},{type:"Feature",id:"jiang_xi",properties:{name:"江西",cp:[116.0156,27.29],childNum:11},geometry:{type:"Polygon",coordinates:["@@ƧȄôɚəȄ̎ʶԬ˜ԮͪςóƨŐƪ›τɞƦōƥƧ@ŏςôóŐôô̒ʷѶ—ƪƩƩǿ@ō̒ɛôυ@—Ƨȁѹɛəƨѹ̑ƨ̏óƥѵʷô̍ɛȁôŏɝǿƧԫƧ›ôʳƥōòȃρȄ߻ɛɝƨɞɚɜƨôŐƧŎԭōñƦòԮɜôɛ˜ôͪƥœ@ʶƧƨôƦƧô@Ȅô̎Ѷͪ"],encodeOffsets:[[117e3,29025]]}},{type:"Feature",id:"he_nan",properties:{name:"河南",cp:[113.4668,33.8818],childNum:17},geometry:{type:"Polygon",coordinates:["@@φ˜̎ƪ̐˜ɞȄɚ@@Ȃעó̎ŌѺ̒ôֆॢȃô™ƨŎƨōƪöƩ̑ڔɜԩ̏ɝʵƧ—əʵԬȃƨəԪ@@Ƨ̒ŏô̍υȁƧɚ̍ôóŋ@ɝƧŋõ̑σ—@ŏɜŋôɝ̒ƧɚôôطρóóɛƩ@óƨ̍ŏƧôóȄ̑ôƧóƥôóӐɛōɝŎ݇ñړɚѵֆ@ɞ̏ʶ@ʴƩöó̐"],encodeOffsets:[[113040,35416]]}},{type:"Feature",id:"liao_ning",properties:{name:"辽宁",cp:[122.3438,41.0889],childNum:14},geometry:{type:"Polygon",coordinates:["@@ƨʴƧôôӔƨô̎ƩɞН̎ͪ߼ͪɜ—ɞɚ̐—@ƨςŏ̒ôƦƨɜœô̎ƪôςǿƨͩɞȀƨ@@ɛςփô›óŋ@ʵφυƩʳö›॥փρѹס@əɛ@ͩࢯ@ѹʵρ—ƩʶφȀƧ݈̒۬óʸɝŎѵ@ԭԫןɛƧƨƥςɛ—υʶφО"],encodeOffsets:[[122131,42301]]}},{type:"Feature",id:"shan_xi_2",properties:{name:"山西",cp:[112.4121,37.6611],childNum:11},geometry:{type:"Polygon",coordinates:["@@ɚѺñŌɚšôȄѺ›̎ֆφóςȂ̒—ɜƨɚ@@Ȁƨŋôȃƪ—ѹ̑̐ŋƪ̑Ʃρρ›óó@ōɛɛ@əɜŏƦρƨ›ρѵ@ɝɛǿɜʵóօѹ̑̍ŋסô@ȁə@ɝȃ̏—̍Ʃυ—Ƨô@Ȃ̐ظóОó݊φք̑ʸ@Ȃ̒ʶôȀ"],encodeOffsets:[[113581,39645]]}},{type:"Feature",id:"an_hui",properties:{name:"安徽",cp:[117.2461,32.0361],childNum:17},geometry:{type:"Polygon",coordinates:["@@ó̎̑Ő@ƨƪ˜Ѷǿɜ̑φ—Ʀʵ̐˜Ƨѵôóƪôôυς—ƨȂɞŏ@̍ԫôò̑ƥ—óȃѶͩƧƥôŏѺœôŏƦ—@›ƥͩƧ—ôȁυó@̑ƧɛѵʵƩƪѵ˜̑ʸóóôŏρó@ŐƦƨƥŎσɝƩœ@̎̍Оɚ̒ρƨƧȂôɜςôóظəó̑ƨóɞɛŌ@Őτ˜ö̒ƨŌ@ɞôŌ̎óƨəφȂ"],encodeOffsets:[[119431,34741]]}},{type:"Feature",id:"fu_jian",properties:{name:"福建",cp:[118.3008,25.9277],childNum:9},geometry:{type:"Polygon",coordinates:["@@̎›óȁƨӑ̒—̎ɚƨͩφŐƨɝ̎ŋóŏρ—@ōƨ›òʳəóƨō̏˜õɛƧ@ƨѵƧōəŏóŋƧô̑ɝɛʳƥ@@óɛõ@Ƨ̑ƧóȁəƧ̑—Ƨ̐@ɚəОƧ—Ƨɚóñ̑ŎóʴƨœƨԬɞȀóŐɜȂó̎ѶʸôƦƧ̐Ѻ̒ɚƧѺɜƨȂ"],encodeOffsets:[[121321,28981]]}},{type:"Feature",id:"zhe_jiang",properties:{name:"浙江",cp:[120.498,29.0918],childNum:11},geometry:{type:"Polygon",coordinates:["@@Ѷʶƨɜ@̒φôóȂƨ˜Ʀͪ@œ̐˜Ѹ̍τȂ̒̑נŐמôƪƧôӑ̑›@ƥρͩƨօ̏@@υɝó@ŋɛ@ôƩəóƧѵυó@ƩɜŋƧ@̍ŌƧɞυŏƧͪ̍ə̑˜ƧӒôȂ̍œ@˜óφ̑ɜ@ŎƪȀ"],encodeOffsets:[[121051,30105]]}},{type:"Feature",id:"jiang_su",properties:{name:"江苏",cp:[120.0586,32.915],childNum:13},geometry:{type:"Polygon",coordinates:["@@ôɞ̎˜φНôŐɜŏ̎Ȅƨ›öǿƨ@ôɜɚšƨʴ̒ôôó@Ƨ̎əԮȃԪૉöͩ̐ƧòʵφƧôʵ@óړɜóŏɜǿƧ›ɝρσȁѷ̎̏—ƥ˜óŐѹ›óŐƨƦѵͪôȄƦ˜ñ̒Ԭó@̎ɝŐƧȁρ˜óφƩóóôƨѶ̏—ƥʶυ˜ɛ̒ѵȀ"],encodeOffsets:[[119161,35460]]}},{type:"Feature",id:"chong_qing",properties:{name:"重庆",cp:[107.7539,30.1904],childNum:40},geometry:{type:"Polygon",coordinates:["@@əȂòɜƨ˜ѺɛƦȁ̐@ƪ—õŏφƥòȃƥ̍Ƨôυ̏ƧôñóóôɛŏƩôƧƥôƧóυƨœ̒ѹôœƦȃ@փƥɛ̑@@ɜƧó@ɚƧ@ñφσõ@ŎɝôƧ—@ʵѷóƧʵó˜@ŎóŐó@ôȁƥ›ó̒υôóʶə˜ƧȄς̎ƧȂôƨƨƨφɛ̎Őƨʷɞ@ςԮóŌôôφ@ɜֈ̎ƨ"],encodeOffsets:[[111150,32446]]}},{type:"Feature",id:"ning_xia",properties:{name:"宁夏",cp:[105.9961,37.3096],childNum:5},geometry:{type:"Polygon",coordinates:["@@ల̒ôޠφӒςôƪͧυևɜŋѺó̎ȁ̍ɛ@ѹס@@ʵƧȁôó@ǿ̐ŏöʵɝŋɛ@ô̑ƥóóƨƧ—ó˜ôœó@ƩôóƦ̍œóȀƨŎɛӒôŐυͪɛ@@Ȁə@"],encodeOffsets:[[106831,38340]]}},{type:"Feature",id:"hai_nan",properties:{name:"海南",cp:[109.9512,19.2041],childNum:18},geometry:{type:"Polygon",coordinates:["@@φɜƦʶ̐ôφô̎@ƨŎö@τʵƦ˜ԩ۫õН̏óƥȃƧ@Ʃəםƨ̑Ʀ@ޤ"],encodeOffsets:[[111240,19846]]}},{type:"Feature",id:"tai_wan",properties:{name:"台湾",cp:[121.0254,23.5986],childNum:1},geometry:{type:"Polygon",coordinates:["@@ô—ƩɝöƧɝѵəޣ̏ρƩԭóōóͪρɞƧОôԪ݈ଦѶɜ̒ɛ"],encodeOffsets:[[124831,25650]]}},{type:"Feature",id:"bei_jing",properties:{name:"北京",cp:[116.4551,40.2539],childNum:19},geometry:{type:"Polygon",coordinates:["@@óóó›υóôƥ@ŏóóə@ƧŋƩŌρóɛŐóʶѶʴƥʶ̎œôƨɞ@óŎɜŌ̎̍φ›Ƨŋƨʵ"],encodeOffsets:[[120241,41176]]}},{type:"Feature",id:"tian_jin",properties:{name:"天津",cp:[117.4219,39.4189],childNum:18},geometry:{type:"Polygon",coordinates:["@@ôôɜ—@ƨöɚôœôôɚŏ@óƥ@@ȁƦƧɜ@óƧƨƥ@›ƧóəН̏óѷɜ@ŎƦƨóО"],encodeOffsets:[[119610,40545]]}},{type:"Feature",id:"shang_hai",properties:{name:"上海",cp:[121.4648,31.2891],childNum:19},geometry:{type:"Polygon",coordinates:["@@ɞςƨœɛȀôŐڔɛóυô̍ןŏ̑̒"],encodeOffsets:[[123840,31771]]}},{type:"Feature",id:"xiang_gang",properties:{name:"香港",cp:[114.2578,22.3242],childNum:1},geometry:{type:"Polygon",coordinates:["@@óɛƩ@ρ@óœôȀɚŎƨ@ö@@ōƨ@"],encodeOffsets:[[117361,22950]]}},{type:"Feature",id:"ao_men",properties:{name:"澳门",cp:[113.5547,22.1484],childNum:1},geometry:{type:"Polygon",coordinates:["@@X¯aWĀ„@l"],encodeOffsets:[[116325,22697]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/chong_qing_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"500242",properties:{name:"酉阳土家族苗族自治县",cp:[108.8196,28.8666],childNum:1},geometry:{type:"Polygon",coordinates:["@@XJ°œlJX@lbl@XbV@VLnJlxnbšƒUU@IVK@lVIVwnJlU@n@J@L@Jn@l_nWVLVln@@blLšmV@@xœÔ‚`nœ™xV‚ÈLlx„LVxVVšƒV_U»VWn_m¥XwVmnX°ƒlmUUVwÞaVƒk@a@mmIUa@™mwk@™ƒm@@U¯a@UV@@K™@ykkmwkV@kU@ƒÑƒVkKWLÅamaUm@kyU@WkU@Ua™IUašVaUUmUUa@aVLXKWa¯UUbmJXnWnX`l@@xkzWÆ@V„LU¦‚x@b@JkIkJ@LmbUamJwm@óxƒnk@V„@x„ŽVnUVmVUVŽUbVlUbkXWŽ"],encodeOffsets:[[110914,29695]]}},{type:"Feature",id:"500236",properties:{name:"奉节县",cp:[109.3909,30.9265],childNum:1},geometry:{type:"Polygon",coordinates:["@@WVXb‚UnK@x@b‚²kxmKkl¯_ƒVV°™VU@bnKVVV@@nkŽ@n›bn‚@š°@VLČUš@°WV@V™nU@InKVl@nU„b˜KnX„WlknLlKUwnalLša„VlUXmWk@UU@UWWIUyķ¹XaWW@X™ƒKUIVm„U@W@UVU@KV@n»VkUkÇmUmVIUmULUbm@ƒwUaƒKkkm¯ÑUL@bWVnx@VmxUI@„klmkkK@aƒK@IlJ@I¯ƒk@mak@mnkJVL@bV@Ub„„W`UUUV™I@VƒU@VVbUJVLUVVbUX„VVxk¦VJUnVxnVVUšJV@Ubl@@bXV@L"],encodeOffsets:[[111781,31658]]}},{type:"Feature",id:"500238",properties:{name:"巫溪县",cp:[109.3359,31.4813],childNum:1},geometry:{type:"Polygon",coordinates:["@@nLWbX‚VLVU„V@KšIVl@b„@lbšU„VnU@JÆU@V@n°KĢUl@VbÞKšVš@„_„V‚KXU‚U@KXƒ@wlkkU@mWKUU@UôJ@XV@œaVmÞIVaVLƒƒ@»kmƒ@ƒUkL™U@aU@WWƒLUUU™™KkbƒwWa@KU@kaƒXmW—LƒamVk@UmL@JmVUšU@¯X™@ċVUK¯@ÅnWK™LkKULWK@UXK@wW@™LkV@bVLƒlXn›`¯xU„°LnŽlV@n°Lnl"],encodeOffsets:[[111488,32361]]}},{type:"Feature",id:"500234",properties:{name:"开县",cp:[108.4131,31.2561],childNum:1},geometry:{type:"Polygon",coordinates:["@@n@na‚I„wš@@VVK„LVbVxnVÆUnanKWXamKmk¯K@mkUm¯KVƒ°w@Wm@UIUUlKUU@a¯KWanwmUXamKkUWUnU@KƒkUwWKXaWLUWkImaUUUƒƒKka±k@lƒ¯w™wmbUƒ™ƒkXm@UJkIW‚XXƒbƒmƒ„UJ™XUV@°šKlšlVXV@xmbnV@blV@VšœU`UL@V™a@bULlb°VXbܚ@V@bƒL@J„xnLVb@lVb@V@@z˜bXWšX„KVLV‚š@@bUVVL@b„„lVna@ll@„zl@@J"],encodeOffsets:[[111150,32434]]}},{type:"Feature",id:"500243",properties:{name:"彭水苗族土家族自治县",cp:[108.2043,29.3994],childNum:1},geometry:{type:"Polygon",coordinates:["@@„Jlb@nVV@bXb@ÆlL„Ul`nVKU¼VxkbW„nlUxlXX‚@°°WnnJ@VUn@J„k°L@VlV@nUJ„x@bVVVz@VnLla„KnalVlIUŽ„¼@nV@@anKUwVal@UlJœƒlI@akU@UWXKVI‚¯Uak@@KmkXWÜkXWykIWwXw@laXamkVUUym_XmlkkmmakwmIUKU@Wak@kaW@kI¯›WIk¦VŽƒUUƒmaUV@XkVUV±aUb¯b¯¥m@@ImJ—@mƒmL@kUKUkkJƒbV¦"],encodeOffsets:[[110408,29729]]}},{type:"Feature",id:"500235",properties:{name:"云阳县",cp:[108.8306,31.0089],childNum:1},geometry:{type:"Polygon",coordinates:["@@lb„LV„VVnblJVXXKWbXLVx„l@LmVXVVl‚nLWbnVmxXb°L@bVVkLVVVJn@@X‚‚œ_Wm„kUK@alUšKX@@xWL@VXLVKlLšKXLÆm@™mœa@ml@mU@UUmL@aVšUU¯„U°`lknLlw±@a@wmLVWaXU@KWU@ak@VaU@™IUVmUUwVmUIl¥UwƒUVWUaVUUKVIUa@UUUUJƒUUm™kƒ„nl@„@VWV@L¯aUb™Ulxƒ@@b@VULUx@VUxVV™U@bU@mxU„U@mUVŽklkkƒ@WxknlxK@amLƒKU„K"],encodeOffsets:[[111016,31742]]}},{type:"Feature",id:"500101",properties:{name:"万州区",cp:[108.3911,30.6958],childNum:1},geometry:{type:"Polygon",coordinates:["@@ĸĊVI„ƒ„n„aWWXlJVIn@lWš„V„našx°xk„l@²Ž‚LVƒ„LnK@b‚LkwlmXw„@lllkUnVV@VƒnwV@@ašVUUVw@UVwVK@U@a„@kwšVVa°b@KXU@U@ƒmk„ƒÇсaml™kUVmn@VULU˜m@kUVkUaƒwUWm@Uw¯„mKUUmVUUULUKU„W@XbWVkaWwkUU™ƒ™k@maUbmbVlk¦ƒxUVUIWVU„kJVVkL@UmJ™UUVU@lLUVU„lx„@@VbƒJ™U™L¯¤@Vƒ„"],encodeOffsets:[[110464,31551]]}},{type:"Feature",id:"500229",properties:{name:"城口县",cp:[108.7756,31.9098],childNum:1},geometry:{type:"Polygon",coordinates:["@@VK@w¯L@m@UÅV@ImVƒU™Vkaƒ@@aUk™J@LƒUUVUKmLmbÅVmUUwUaƒKUL@U™@ƒxJmbm@nVJ@X@VkV‚n™lƒLXx™@ƒb@bUVƒLU`UnƒbU@@ŽmVVX@JX@VLVVšklV—„‚`@bUL@V„LVKn@‚U@„UJkn@lmLmK@X@Jn@mb„nÞWVXnJ‚k„KČÑÆ@VK@knaÜmXlUČW°kôÇƁ@a@yÞ_VmƒUnU@K"],encodeOffsets:[[111893,32513]]}},{type:"Feature",id:"500116",properties:{name:"江津区",cp:[106.2158,28.9874],childNum:1},geometry:{type:"Polygon",coordinates:["@@„InWUUlU@LVašlX@°²lÒXxlK@Ul@@Un@UaVJ@I@W@UƒUUVUwVIUKUa‚UUVwn@Üx@XUlnn‚bœJ@¥VklKUUlk@ynU@kVƒUUVWnI@¥V£VWVIUKU@UVƒa@n@Vm@@nlUaVkUwƒJ@blLkLW@XWmXkmmLn™@m@U@UVm@™„UVUUlakUVa„ƒVkV@@wnaWUk@VwkƒlmVIkUUxmJ@U„™@KƒIkx±V@IUm@K@IUKkbWKUbn„m„@bmVnbmb@xkxUJ@ULW`@bX@WVXL@Vƒš¯„mk¯@UJ@VmLUaWnX@WJ@nkKkxW@UIV@@KkImmkK@UW@XaWIU@U‚ƒIkbWb„xXŽlLVbnV@bWlX@VxVLnl@nÆÞVÜ"],encodeOffsets:[[108585,30032]]}},{type:"Feature",id:"500240",properties:{name:"石柱土家族自治县",cp:[108.2813,30.1025],childNum:1},geometry:{type:"Polygon",coordinates:["@@„š@kl@š¼UbmVXJ@bV@nxVIVJULVVk@@LWbnJVU@bVbUJ@blLXnWV—@mbnV‚@V„„bn@VJVLnaVanbl@„šVšlVXxlbXUWaX@VƒUUVwUUVm@I@WmI@a„mlLœ™lK@alwnUV@kóVaƒÝk@UlbVK@™VU»VUUVWUƒ@U`ULkwm@@KmU@knKƒ»VkJkUmbƒLkbmK@UUyUU@aƒwm@@XXJ@VVLVVUbVnUJVX@K„„k`WXXJWXUbmW@bkL™Um`Xnƒb@JVL@LU@™°VVXKVnUxVLUbmJ"],encodeOffsets:[[110588,30769]]}},{type:"Feature",id:"500237",properties:{name:"巫山县",cp:[109.8853,31.1188],childNum:1},geometry:{type:"Polygon",coordinates:["@@kVƒU™bkKmbVxkLmKkllbV@@LXb„xlašLVšVV„KXXV@@bšVlK„V„@ln@¼°KXa„U@Ulw°JXalIUa„ÝWXW@kVU@ƒVUVWUUUamUw@aVamwn@VUUƒlLXWm£@wÇĉkKklmLUÒ¯ƒWn™@ğ±kwmaWm¼U@@LUV@V@XƒVUnVJ„LWš@‚XXWbĸºVzXJVXV@@VXlWn"],encodeOffsets:[[112399,31917]]}},{type:"Feature",id:"500102",properties:{name:"涪陵区",cp:[107.3364,29.6796],childNum:1},geometry:{type:"Polygon",coordinates:["@@nèVblĖVVnLšŽ„@šx‚V„n@nšJ@L„UVVX@lbUJV@@nn@VVVK@z„˜V@nzVJVUlmX@@_VVVbnaVal@@knW@wnaƒVK@aVI„J@£kUVW@‚wXUVJ„amƒ@Ikƒƒƒƒ_X¥ƒ@WwkKkwmŽ™šƒkUxƒnÅmm¥™WV@Um@UlVL@JU@@Xƒ@UVkKVk™KVk™Kkb@bmJVXU„VVUbU@@`W_UV¯b"],encodeOffsets:[[109508,30207]]}},{type:"Feature",id:"500230",properties:{name:"丰都县",cp:[107.8418,29.9048],childNum:1},geometry:{type:"Polygon",coordinates:["@@Þè@XUK@LlV@blbUJ@„„V@bnV‚@VVVXU@ƒlbXal@VXnKV@maXUރ@amk@aVKXV‚anbš£°mnIVaUKVwUmWLUUš¯V@@KUK@I„aWmn_šVlK@anXVaXWWIXWl_ƒƒ@LUWVIUmVaUUUK@UWI@Wn@VI@mkU@U¯Kƒl@ImVÅLƒwU¤óbUU@wWXkmm@LU@@VUIWVUL@JUnƒaƒx@Jn„ƒbUIWVx@ŽUXlV@¤ƒIUJ@bUL„Žmb@xmX@lk@UbmbUaUU@`W@kn"],encodeOffsets:[[110048,30713]]}},{type:"Feature",id:"500232",properties:{name:"武隆县",cp:[107.655,29.35],childNum:1},geometry:{type:"Polygon",coordinates:["@@l„„w„bVm@IVKXUVJ@UV@@KnnWlX@xVVôaV£„xÆKnUVm@UmIXm¯¯@WkWVwmkXƒlaUwV»ULmk_ƒVkK@ÅWa@aUU@mkaƒIƒb@‚n¼ƒnm‚_@mmK@UƒLUVVmI@aUJ@XWJ@U`UIkm±kk@@lULmUmKUnVšnlUVmI@VkVlx™bkIƒVmLUxkKUŽ‚Xš‚n¦Æn„mVw„lš™nlxlLXx„@W¦„`„„"],encodeOffsets:[[110262,30291]]}},{type:"Feature",id:"500119",properties:{name:"南川区",cp:[107.1716,29.1302],childNum:1},geometry:{type:"Polygon",coordinates:["@@VšUbVJVUn@VLX@WVXVVI@VUVWxU@mš@ĊX@@¼V°aVUX`@_V@VaUUVƒUWnI@alašLUlšLUllLVU„@@WV@@IUKVkn@@VlLVwnK„UlJšakwlU@UnJVUmkU™VmXa@wVK@UUw™@VƒVI@akƒ@alInwlKXUmaUW@wWLk™™KVak_ÇaUƒƒV@šXbƒLVxUlWIk@UK@V™@ƒkU@VbUVUlVnƒLUV@lVXmxkV@L@V@Vk@WbUwmL@JUI@xVxkx"],encodeOffsets:[[109463,29830]]}},{type:"Feature",id:"500241",properties:{name:"秀山土家族苗族自治县",cp:[109.0173,28.5205],childNum:1},geometry:{type:"Polygon",coordinates:["@@XlV@lzn@VŽnbÆbXKlL„U„ÒV@@llUnxll@zšŽ@LU@@V°b@Vn@š„l@VÑUƒnK@UšU@aUaƒkVm@K¯wƒklmnn„Ul`nI@almkIUwmWVkUaƒkkJmUUa@K@aU@@_m@@wUyVUUa@Umƒ@awl@Wka±„UkUykIWV™b@bUVk@›aU@UXU‚UIWakUWmUxUV@nUVWbšŽ@XXVVŽmXXŽ@VƒbVLkVWx"],encodeOffsets:[[111330,29183]]}},{type:"Feature",id:"500114",properties:{name:"黔江区",cp:[108.7207,29.4708],childNum:1},geometry:{type:"Polygon",coordinates:["@@VX@V@LV@VJUL@lVnnxlb@VXV‚XV@@W„@UIVK@kUKna@£VWUaVUUalIVJVIUW„_lm@bXKV@mn@J„UUw@KnIVll@VanLVmUkVKXLVKUIVamw@UaU_lw„KlwUWV_Ua@aUa@KUšwm›_›Ó@wU@™nkK@am@UkUKmXk`m@@I@K@I@mkVmIUxUJ@kUL@JVV™„lnklWnn`VzUVnlWbkb@WxXxlJXzWŽÛlWXnl@Ll@Vb°UJWLX@VlV@bkJ"],encodeOffsets:[[111106,30420]]}},{type:"Feature",id:"500117",properties:{name:"合川区",cp:[106.3257,30.108],childNum:1},geometry:{type:"Polygon",coordinates:["@@XKVXlK„ƒVL@UnV@aValXXK„U@WVwUaVU@IV@@aVW„L@U@anVV@@bVK@UVL@bnJWL@VnUnb˜@@JnIlVl‚@@bXIWbn@UKVLVKXLlaV@VVnK@bVL„m„IVƒ@KmknUUWVI@aVJ@_„WU_VmUwƒU@K™ƒVak@am¯mJU_UJUkU@WkIV`UI@JV@LmmU@@mƒbUzś™@„VK@nUKƒ„ƒb™akb@UWK@bkVVbV„Û@@`ƒXk@WŽ@n@lXL@bmb@VVJUn@JnUlnUlmX@`XLlbkJW@kzlb@`@b@b"],encodeOffsets:[[108529,31101]]}},{type:"Feature",id:"500222",properties:{name:"綦江县",cp:[106.6553,28.8171],childNum:1},geometry:{type:"Polygon",coordinates:["@@@¦‚@X„lVX@@UVKl„VUX@lanVlUVbXWVXVƒ„VVUnKVUlwUwU@UJ@nmVkUV™lwXam@VaUUUw@W@kk»mV@UmKkwVKVUU@@LUKVI@mV@XVWxnXVKUUUK@wWU@UUWnUlLXa‚mUI„am@wI@K@amIm‚UUkI@m‚akUkKWUUanƒ@wƒamLVxk@UVmUUL@Vm@kV@I@ak@@bWVXJlLVbVL@š@bn@@`Un„@WbUKULWVXbƒ@UVmbX„WVƒb@bVmxUKUƒV@šUn@V@V@nmšnKlnnWWXX@lKkK@a„IVxUlVb‚k@mn@@U@m„bVUV@VLUJUXU¤"],encodeOffsets:[[109137,29779]]}},{type:"Feature",id:"500233",properties:{name:"忠县",cp:[107.8967,30.3223],childNum:1},geometry:{type:"Polygon",coordinates:["@@VLÞĊ„U@Wš@¼V‚„@lk@w²mlšVUœ„llšVnI@VlKUUlIVƒXUVJVU„wl¥UkUKUIm@ƒaUƒ@mUna˜@XUWmkK@aVIUa@aUVmIXa@Kl@UUVKUIUJmwU@@aWInUVa™»k@@lƒ™¯n™¤mabWUUL@bnl@b݄WVnbU@mLUWk@Wbka@„WVUU@UmUmVkUULV„lVUx„l@L@VƒbÈÒlb"],encodeOffsets:[[110239,31146]]}},{type:"Feature",id:"500228",properties:{name:"梁平县",cp:[107.7429,30.6519],childNum:1},geometry:{type:"Polygon",coordinates:["@@XLV@VV@b°°nšƒnkb@bƒšnJWVXblIUVšxWnUJnVVLVU„JlUnLVK@UnUVJš²nKVbVKla@aXlJ„k„Klb„ƒ@U°£šKšV„IUa@ƒ@kwVƒVUkKV@VUkk›ƒUVk™±n@xklƒ@U@»™‚@XƒVÝĉUJnxWb@UX›KkVUbUKWUkVmkkLU`›b"],encodeOffsets:[[109980,31247]]}},{type:"Feature",id:"500113",properties:{name:"巴南区",cp:[106.7322,29.4214],childNum:1},geometry:{type:"Polygon",coordinates:["@@nxnVlJlUXLƒ¦@x@Vl@nKVVX@V_V@@KlVXU„@lKlxXIl@ÈĊ@Vl@n_VJlŽnVlnb„²VVVJVVmUUkĕUamçU@»W@@ĉn™V@XwVU@UUJWUXUW@UKm@UVUIVaU™UVmLUVƒUU„UWWXUakVmUkbW@UVkƒUL@VW@kUWƒ@mJUXVVU„@lmV@zklVVkLUl@¦›I"],encodeOffsets:[[108990,30061]]}},{type:"Feature",id:"500223",properties:{name:"潼南县",cp:[105.7764,30.1135],childNum:1},geometry:{type:"Polygon",coordinates:["@@@a@a@_kalyX@lIkaWK@_nWVkkmmV@IVmUI@Una@aWK@k@mkbWaknmJUk@mk@@kUal@Uaš@Wa@aXLlwUKlkkƒ@KmI@VUJ@Lk@@VUUmL@amJU£kKUaWakLmU@bVVUbnbWV@xkL@bUb‚xUxVbXJVbUVWIUVU@kLWxkKWV@n¯VUbU@@VVX@VmaUL@VUK@VVbn@lVnI‚@@lnLULm@Ub@Žl@na„@lK@XVVkJ@b@zl@@VnV@bVb@J@bnXV`lXXmVI@W@InbV@@aVKUblKVLUanLlmnLlK"],encodeOffsets:[[108529,31101]]}},{type:"Feature",id:"500118",properties:{name:"永川区",cp:[105.8643,29.2566],childNum:1},geometry:{type:"Polygon",coordinates:["@@@b܄nWVLX„lxV„VxXxlVn@@bVblK@a@UnLVJV@@UnLVU@VXaVKVXš@n`WUÿ@IUKlaUUUkWyUÛÅÝ@mmkUKUwW@Xk@amUUakKWƒwXaƒK@VVLklƒXVlkxV„UL@bm@Vxn`ƒIVxUVkLVšUšl@@lkXmmƒVUn@VV@Xb"],encodeOffsets:[[108192,30038]]}},{type:"Feature",id:"500231",properties:{name:"垫江县",cp:[107.4573,30.2454],childNum:1},geometry:{type:"Polygon",coordinates:["@@šĊ°¤nҘ¼œaV_lKnllUXVVLValUœLVW‚@XamwVIUKkaÇфa@U@KƒkVwkUUƒVKlVnU@aƒU@ƒVIka@akU@KVL@WÝçUV@Vmbů@L™KƒnnJW„ƒVkxlL@VX@VxmnXVWxUb@bkn"],encodeOffsets:[[109812,30961]]}},{type:"Feature",id:"500112",properties:{name:"渝北区",cp:[106.7212,29.8499],childNum:1},geometry:{type:"Polygon",coordinates:["@@@bVVXL‚a@lnbWn@L„@XVlK@VVLUVlbkLUKVVVL@VšnX‚VL@VV@UbVb@x@¦UxVb@bUJƒL@L„VVxlK@™nk@U@W„UVLlKXV„@VblU@UUKVU@wn@VJVanLlkX@VaVK™¯@a@U@U@ƒVaUK„kUUƒ±maUkm@UUkbm@@Vk@@JƒwU@Ub@I@JmwUL@aƒ@@KkVÇLkƒWkƒ@kUU@@xUVmKUnllUb"],encodeOffsets:[[109013,30381]]}},{type:"Feature",id:"500115",properties:{name:"长寿区",cp:[107.1606,29.9762],childNum:1},geometry:{type:"Polygon",coordinates:["@@VVšU„bX‚lX„¥l@XnVmlxUx„@@blVnnôĀlm@aVaXwWUnmUwW@@UkKlw„UXƒmI„mšL@KÆ°na@UUImyU@ƒ—@yULUUm@@mU@VIkaW@UUƒV@K™I@mƒmU™wƒ@™mKUnU‚UIƒlVLUb@„@V@V@bš°ULUbW@klmKUbUIm@@xUVVL"],encodeOffsets:[[109429,30747]]}},{type:"Feature",id:"500225",properties:{name:"大足县",cp:[105.7544,29.6136],childNum:1},geometry:{type:"Polygon",coordinates:["@@XUmaVaUU@anVlKXbValU@aV@@IXKš@@bV@VxVK@UXLlUšJXa@_‚@@aVK—ÅWVkwWaƒƒwUa@am@kUWLU@kWmX@ykI@W@UV@na@LlLV@UƒkwWƒUKmXX`mIVl@bXLWVkbkkƒx@`VXm@@J@U@UUKUxk@WbUIVl@VXLW„ƒJUkUlUImxXlmb@X@VUJUnVbšW@UV@@VVX@bnW@LVxUnlJUV@n„@VxVIn@l`„UVVVL"],encodeOffsets:[[108270,30578]]}},{type:"Feature",id:"500224",properties:{name:"铜梁县",cp:[106.0291,29.8059],childNum:1},geometry:{type:"Polygon",coordinates:["@@VblLV¤nI@bnKVV@Ul@@KVI@UnJ@Ll„klVLkxWK@bXb™@Vbk@Vb@ll@@nVlnIlmXblaXl@„W@_Ü@UƒUalU@aXL@Vlašb„a„ƒVL@mUL@ƒUUƒƒÇXUW›X_WaƒƒUƒ»m_™@UWULWb@UUVmK@VU@UImK@V@bkL„x‚„XblxXU˜ÆUL@b@@`Wb™IkVWK@VULUwU@@a™@WL@JU@@bkVUb"],encodeOffsets:[[108316,30527]]}},{type:"Feature",id:"500226",properties:{name:"荣昌县",cp:[105.5127,29.4708],childNum:1},geometry:{type:"Polygon",coordinates:["@@VI@U@WnaWknwVJVkVl„IXƒWK@UUkVJXal@VwVL@V@V@In@UW@_„wlllaXUWK@aUknJW_ۃ@aWaU@@UVm„UUaUImJVnÅUmVUm`kUUVWLnVU@VVmXƒK@„nxmŽULkx™ImJ@nU`@X@Vkn@`@nlV@nVJVaX„VLnK@bVV@nV@lbXWš@"],encodeOffsets:[[108012,30392]]}},{type:"Feature",id:"500227",properties:{name:"璧山县",cp:[106.2048,29.5807],childNum:1},geometry:{type:"Polygon",coordinates:["@@XzVlVVkbVL@JVĀXŽ‚¼V„„„XbW`XœWVȎ„„VVšŽVkV@@UXa@alK@IƒƒU@UKWUyUI@wVUUWVak@VUkƒW¹@WXI@yVIUK@kWwkѯ±W@™kUb@KkVVVmXƒJ"],encodeOffsets:[[108585,30032]]}},{type:"Feature",id:"500109",properties:{name:"北碚区",cp:[106.5674,29.8883],childNum:1},geometry:{type:"Polygon",coordinates:["@@X‚VLV@„„@JkL@bWb@VU@UlƜVy„a@nV@nn@KU@IVJU_lJXV@VlVIV`nIn°@b‚lUbš„„KVI@aUaVw@¥@wUaVaU@@UUKW™m@UUKUUVLlKkaVUUK@UkLWUƒ@@KXmma@kbWKUU@aUamLnÞ@VWLk@@Wm@ULU@@U™KUVWI"],encodeOffsets:[[108855,30449]]}},{type:"Feature",id:"500110",properties:{name:"万盛区",cp:[106.908,28.9325],childNum:1},geometry:{type:"Polygon",coordinates:["@@VIV@@wVJ@InKVxXal@@U@U@KlUnwUW@kVU„KUmVkUa@I@KW@@bk@@mƒU@m@k@a@aƒIUxmJk@ƒwULƒwkKmVVX@VXV@xVLVVULmWXwWUU@@nUJVL@KV@UVULlxnL@VnUl¼@l@XVxVVUbn@WbkxUšlVnU@m"],encodeOffsets:[[109452,29779]]}},{type:"Feature",id:"500107",properties:{name:"九龙坡区",cp:[106.3586,29.4049],childNum:1},geometry:{type:"Polygon",coordinates:["@@XK‚L@Vš@XbV@lW@UV@@VXIV@U™VKlL@KnnJ@VV@VU@I„@@mVUVWUUmL@V¯LUK@UV@UU@a@U@yU@WLUK@X@KUVmL@ƒ@aXI@w@ammVk@WÛwm@UxVVVbVLUJVxVU„V@V@X@JUIVbm@@Vk@@VkL@lVLUJ@zWJ@X"],encodeOffsets:[[108799,30241]]}},{type:"Feature",id:"500106",properties:{name:"沙坪坝区",cp:[106.3696,29.6191],childNum:1},geometry:{type:"Polygon",coordinates:["@@Xºl„UVl@UbVXUV@xVJVzXJVUšL@VV@VKn@@Xl@XK@UmÝnKVbVakkVm@k„ƒUK@UmIm@LkKULVšU@WJ@UU@@VkXU@Wa™@@UKWL"],encodeOffsets:[[108799,30241]]}},{type:"Feature",id:"500108",properties:{name:"南岸区",cp:[106.6663,29.5367],childNum:1},geometry:{type:"Polygon",coordinates:["@@VV„JVL@bUVVnl`XIlwXJlw°nnl‚IXW@UÇĉk@WJkwkLƒ@WVkU@LU@U`W@UXUV@n"],encodeOffsets:[[109092,30241]]}},{type:"Feature",id:"500105",properties:{name:"江北区",cp:[106.8311,29.6191],childNum:1},geometry:{type:"Polygon",coordinates:["@@nLVU@wV@lV„@Xll„ÈKlU@L„@@bVKnx@I@JVaV@„x@Il@@Un@laVVn@mkUIm`k@WXJmk¯mkxWIkxWJk_UmVUUKƒ@UU™@ƒ„@l"],encodeOffsets:[[109013,30319]]}},{type:"Feature",id:"500104",properties:{name:"大渡口区",cp:[106.4905,29.4214],childNum:1},geometry:{type:"Polygon",coordinates:["@@k@@U@w„¥WKkVkImUmwa@b@xWJ@b@„nKVU@L@WVLXKV@@z@V@bVVU@@VVL°K@U"],encodeOffsets:[[109080,30190]]}},{type:"Feature",id:"500111",properties:{name:"双桥区",cp:[105.7874,29.4928],childNum:1},geometry:{type:"Polygon",coordinates:["@@WwUwU@kK@KmbU@@V@XlJ@znWlXV@XK"],encodeOffsets:[[108372,30235]]}},{type:"Feature",id:"500103",properties:{name:"渝中区",cp:[106.5344,29.5477],childNum:1},geometry:{type:"Polygon",coordinates:["@@VLš@VV„@VL@aUKƒIUUƒ@@JUVU@"],encodeOffsets:[[109036,30257]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/fu_jian_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3507",properties:{name:"南平市",cp:[118.136,27.2845],childNum:10},geometry:{type:"Polygon",coordinates:["@@@knyƒk@ƒKU¥šwV@nkƒWƒzUmk@@lKUa@aVI@UƒKUamKUUVaUI‚@Xƒ@UV@K±IUVVlUbUbUL@KWUXmWk@KkXmmkŃKUƒ™a@amUƒbkUkKWUnwUƒÇwV™UUƒÝUKV£U™@ƒnKWwXLVKm¥@wUXkmWk@ƒ@wX@lU„@šyVImaXwVƒƒ@kŽƒnU@mbk@mlUXƒmU@mV@n@bnW@bUIWJ—ImVUKWbUK@nkKƒaU@W_VUUmWmL@UU@™bUWUL@V@bmVUz@`mUUVVbXL@V™L@lmLUxmVamXkW@xWbU„VbUxkU±@ÅUmmkLUbW@@`kLknVlV@lbXxlVUXVV™ŽU„U@UbWŽkIWVUUUJkI@llbUxVL@V™VƒUU°ULUmWXUV@VULWb@™xm@UaVLVKUa@ƒw@V›bkmVambUUm@@VkK@„@b„xlxX@‚„n¤@Xƒ@@lkLWV@Žn„V„kb@bWJXLWx@nkxmm™bXn@VWVUn@VnJ@bVXl@„™VJXnWbX`lL„UlJVI@Žœ@VXV@Vl@bn@@Æmn@VšxXU@mVIlxšVššnI„l@nVJ‚aXI@mlU@aXkVm°klmnVV_naš°@V@xܦXK„V‚nnUlVXbVK‚LXKV@naV@@VVl@@lXblXšWnLlbVK²nš@@‚VLUnlV@lƒXxô°‚V@UnaUUlKXLVUVVUbVVlUnJVX„@VW@an@lb„@nl@VU@anƒšUVW@kƒaUm@InVVKVU@kUW@Uam@km@kVa@a@™nwšU@WlI@mVI@WXaW_nƒ@™nƒlkkW@U‚¥@kV@Uw@wUƒ@@IXK‚¥VIn@nU@`@Xl@VV„LnašW‚bVaUwnU„@VIšKlV"],encodeOffsets:[[122119,28086]]}},{type:"Feature",id:"3504",properties:{name:"三明市",cp:[117.5317,26.3013],childNum:11},geometry:{type:"Polygon",coordinates:["@@lL@Un@VVna‚bnUlœa@U‚x@„VbULUKVbn@šw‚@XaVK@UVUXWVnVKV¯„VšU@UUKVwka@klJVIVVXUlJXVaV@VƒšUUVWkUWwkaU@UklmlK@_X@ValKnnÆV²@lVVwUaVƒXa@wlXnW‚bnUVwnK@kšK@UWKUaVUnV@_VynU@a@UVKVXšaV@@VnKnXVV‚UX`V@„blL@mVLXaVLnU˜JXIVJ@amX@a@mnUV@„nVWnkl@naV@„ml„@@KmKUam@UU@ƒ@UlKU™Vk™U™K@aVaUwV™U¥UIkJ@wmI@‚mbkwkVW@UXƒKULU`™IVKUa@LƒkkVmUU@WlULUWÅU@I@ƒWW™nU@@w@a@ƒUam_XyVIVWkkƒ@mwVKXUV@nw˜VXkWƒÅ™U@ƒaƒU¯KUnƒK@ƒ¯šmUƒLXŽVLnWVbVbUVm@Ub¯¼W@amƒ`kb™amLUUUƒ™aUXV`@x@XmJ@n@L@xkJUU@kU@mWm@kUUwUUVWl@VUkIƒy@kkaVUUm™IWVXbWxU@k„mVkK@nWVX¦WxU@@bkx@VU@WŽk@™kUbmJUUmkUW@_kKWKƒ@knV¤kIUKWLUbV‚@Wbk@@VWL@VkI@lUXVxUVU@@mWIƒV@a¯nUaƒaUV@„ƒJ™b@bÞ°VbUš@X™aUVmL@‚VXblŽnV„°˜n@Vnx„@VUUUlK@InJVb@„Vlnn@V™L@VWJU„x@XlJUVVVl@LUUUJ@Lƒ„@lUL°¦k˜V„VnV@„xV„„l@blLnlšLVaXll@šnVUn@‚xn@nml°‚X@lb"],encodeOffsets:[[119858,27754]]}},{type:"Feature",id:"3508",properties:{name:"龙岩市",cp:[116.8066,25.2026],childNum:7},geometry:{type:"Polygon",coordinates:["@@ša„I@ƒVU„bVb°m@b„UXJ@nV@VUUwVW@klJ@UXK@Ul@Xa‚@UVaXKVLlJU£lm„@XLlL@`VXnlVVnIVašll@XV@@Ulw@aV@XwW¥XU@mlLnUlƒV@XwWaXUšJVnUVlb@l„zlJUVk@UXVVVxlVn@nXV@@lVVlI@w@K@mnI@W@wU_VWšbV„VVnKšbla„_n‚bX@°»Van@VUUaUamXUKW„K@a@Ukƒ@wWkXƒWW@wUU™Kw@_lyƒwUkU@@Uƒ@kamVmƒXašUVUka@Wk@»UUUVƒKkbWU™VUbk@mkƒxkƒƒKnIVUmW@kUKmXUmVaU@kU@m@KUWVkIWJ@ŽU@UI@wUUUa@KW»nU@mVkUmm@XwWU@ƒUUmL@ƒw@mnƒVUU@aWak@@amxU@UxULWVXbVLU`mbUImVU„ƒbn‚V@@bVn@bnVWxLmyUbƒIUKƒ@aƒVm™akbV‚UXW„UlKWbkV@„WLUlk@@nšbƒb@lkKmU@ƒUIWJkw¯UUVVxm@@XkbWx—›XKƒlUzWJkUUL@bmKkVƒ@@VUIUlWV@X„K@VkbWx°xUb@LUbk@@VWb@LXJ@VWXU@@bUVV„VVn@VVlLn„@l„@‚xk¦Vx@bVJXbƒn@JlnXxV@@„nJ@X@V@lmx„bUn@xVL@VVKlL@l„„nLVaVL@xkl@LƒxVl°š„X„WVX„Vl„œJWnxlJ"],encodeOffsets:[[119194,26657]]}},{type:"Feature",id:"3509",properties:{name:"宁德市",cp:[119.6521,26.9824],childNum:9},geometry:{type:"Polygon",coordinates:["@@@LVKVaVaUkVU²J@LVU„@@W‚VJUbVVnLVb„L@VUJ@bVbkL@Žl@Vn„y„XmlU@™xV¦„L@Ž„lmz@lnL@bVVšbVb@l„nšKVk„Vl¤@zXV@šl@XJVLVKnXVK‚VnU@wUm@šKUƒ@UlVlw@U@U@ƒUaUKlU@kXKlmXIWKXaVIVUVK@KU@@k„JVUnLVJUL@V‚IVa@VnLšKUnl`Vb„V„V@š‚Vbn@Vzn@lKnVlI„VVKUalkXJl@XXVWVLVUUmVU@Unm„£lK@Uk@WUXK@U@WVwVkšƒĠkĢÇ°aUÅUwmaţƒɱUÇa™w„±V¹XalKôx„@„UVaÜʓͿVóbÅLƒJm„¯Vk¦ƒŽk@mamXkKUƒUL›akbk@mV@LkJWb@Vk„mXk@UVmaUV@amLUKUamI@KUaU@WbU@UUUƒUIWJUkm@šƒw™Kk„VJm@kxǁVƒUK@mUVUkmlkkVm@amwƒLVWU@UbVLkšUbƒ@VƒmK@XaVWU_VJnwV@@kUmWakxƒ@kwWakIWxnbUJ™zƒ@kVW@@x@„XllnVW@xn¦ULWKXxmL@„VšU¤VL„ÞVVUšÈxV„mxXVlLlV„anV@bšbV„„LlÆnnlW@LXlWnXV"],encodeOffsets:[[121816,27816]]}},{type:"Feature",id:"3501",properties:{name:"福州市",cp:[119.4543,25.9222],childNum:9},geometry:{type:"Polygon",coordinates:["@@lxna@nJ@xlIVJV¦UšVxUb@bšLšVUlVškL@V@„VVn@Vb‚Ln‚@LU„lJXblx„@lwXbVn@lU@mxUIV`UXWb@‚nLU„„@Val™UKVaV@UX„Knx‚bn@lUkllnUVnV‚@VLU„È‚lwn@UIlƒšL„x‚™n@VlXIVJV„VVV@XaV@Vb@LnJVbVLnK@bVUnbVUl@nWlƒ@UXalI@KnUl@laœbVKV„lLnWnbl@„l¥°Unƒ„IÆKôa΀U„a@UUwÇWǓIUWUÅVkƨm@ƒ@£@KmLU¤ULˣJ™kUƒVǟUUķ@ĉVƒKUk@Ñ°wôǚç@īšé@Åţ¥mīÛkm¼Å@ƒVķVó°ō¦U°ƒn@bVJXVVL@bUŽƒakLmx@xmxXzW`XbWnXV@bWLÛ@™aƒ@ƒaXbWVkaÝwU@mlWKkLWWkLUKULW@kVmVUU݁UamV—¤›n@xUVUzkJV¦lJU„"],encodeOffsets:[[121253,26511]]}},{type:"Feature",id:"3506",properties:{name:"漳州市",cp:[117.5757,24.3732],childNum:10},geometry:{type:"Polygon",coordinates:["@@@bl@Xb@bVVUŽm„@n„x‚@nKVV@„XVWxn@VnUl@nmVX¼@LVbVV@xVJV@@XIlJXU‚V@Ln‚@lVV@UbVnnWVL@lnXUVmJ„Ll„„wnll@VašUXVla„LVUVV@¼Xl@lbUV™VWbn„nUlb„@@VV@„aVUšmlUašUny@kU@Wkk@WaUVk@@ammk@@U@UlU@aUa@wl@šmXLllnL‚U@anVnU@L@VVV@KlXnWVnVanUšw@w@wm›nÅ@wƒaUam@Uk„mUl@@a„a@U@¥škôK‚wȯ°w@ŻkwǕaK›ÑÛk@ĕōřċ£ĵƒUKW»kÅŻLU@Ulġw@¤Vz™VUbkKUbmLmlULU¼UxmbXl@bWVƒb@bUnV‚UšVbULU@@VkbVL@`U@WX@ŽXV@b°„@b¯š@¤@Xm@@b@`U„VVUL"],encodeOffsets:[[119712,24953]]}},{type:"Feature",id:"3505",properties:{name:"泉州市",cp:[118.3228,25.1147],childNum:9},geometry:{type:"Polygon",coordinates:["@@Vl„xkz@`‚xšLVV@xXXW„Xl@xl„@V@bnV°™@„„LVm°L„V„bV@ƚX„Wl—UmxU@WVULnx„@llUXUJWzn`Vb@„@b@xV@šmXX@„@JÆVVXVKXkV@nVlU„l@KVbULšJV_VK„LVWX@lUVƒkIU¥lIVyVU@wœm˜£nUVWU@aƒm@UmWw@UX@@am™VUn@@aUUlUVanaWUXWmUnkšK@VšUlVVUUwš@XLWWX™ma@knm‚bVb„VXbVL‚@XJlInlšL„w˜mXóšw@çV»ÇçŋaķƧóƅóKġ°nÅUķƑUÇW@—¯xÇ°öÆlV„n@llšaš@„Lšbƒ`™@™„VšXVƒVx@V@bULVJUk‚Ç@ƒ¼ƒXUKk@mmULkaWbk@ƒx@UkL@a@K@U@UmKmbU@kV@UmVUbUmmXkW@LUU@U@KmVmU@bVmKkkWK™nk@@xVb@bkV@V@Vl@nn@bl@VUXbl@XlV@@lmz™VVbkŽ™nUVƒb"],encodeOffsets:[[120398,25797]]}},{type:"Feature",id:"3503",properties:{name:"莆田市",cp:[119.0918,25.3455],childNum:2},geometry:{type:"Polygon",coordinates:["@@VbނVVnUlUX@VKVLlKXXlKXL‚‚nkV@ÞxlbXUWa„b„@šbÜ@XK@aWUXmWaX_Wynw@wnwlK„bV@aUKWUUI@a„mV¯Ŏ¥ô¯ĸU„UÆ@n»¯aƿé@ţ¯nĉĬÝK™óó@™ÑU¼@è™xWô—nƒx™KmkkJWI@UKWaƒUUaamn@lnbWšXXWK™@VxUVkU™V@U™LmlnVWXXVmbUbkVVV@bm@UVnš@bW@@VXx‚n@V„n@bV‚UX"],encodeOffsets:[[121388,26264]]}},{type:"Feature",id:"3502",properties:{name:"厦门市",cp:[118.1689,24.6478],childNum:1},geometry:{type:"Polygon",coordinates:["@@@VlUV@nanL@V@V@L@blK@V„wl@XalbVKnnl@VL„W„»È@lVUIVK@a@UUw„WUU™šƒš@„_™aƒK™@™bkkm@UƒkõŁxóL™l@¦@Vƒb@bk@VŽƒnVln@Vb„b@xmÆnœ@x@x™x"],encodeOffsets:[[120747,25465]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/gan_su_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"6209",properties:{name:"酒泉市",cp:[96.2622,40.4517],childNum:8},geometry:{type:"Polygon",coordinates:["@@ÇnÅaĉ@ƒU¯¥›UŹ‚ƒ£™WUýUU±JkkUw‚yÞIČxĊĕĊ¯š¥ÆUkţ™UÅÓ±¼™IUx¯UƒÒƑ‚ݐŰƒKÝnğ°ÅU@Žƒ@Vn@þš¼¯šWnŎ°XLWlnVnbWnƒVXxmbƒa—bóUƒlǕUUa™IUmlU™ƒš¥™kƒ¥ĉwkkƒÝɛa@¯™™U¯°mVƒkVnKlƒōÑÇÑU@kl™UġŽkUŻnUW™@š¯ƒk»šmWV£UKnUƒmUw‚w@ƒUIVaX™šwm»Èmmwn¯ċ™¯LĉŽUƒJUalka±Va@U‚k@ƒÛф¯WmnUaɝ¤Ûmƒn¯m±x@wóxÛLġÒUx¯VƒÈ™JUbóz݃ÇKĉ¯ōlÝUŎWl¯nťbÝ@¯ǩLġmV@ƯĢkÆm™ĊkVťLɃmÝXó°@„ĢbVŽóVݦɱ@Ƨaġ„UV„ĠÇÈV¼UVţwmbJÇwˋa™XmǯKkkmŽƒbXšm¼V¼ǬŚ²¤ôŰÆƴô̐ŤǪnɆӨ¼ɆLÆłUĊšxŎƞȘǔˎǬǪnƨŮǬö°»šġ„„ÞÜÆĸÒĊ„ǀbƾèôÈ@¼¯þŤĸƧ°VĀ¯b@lÈĊ‚šʠń̐„ȘKǀŽֲॗţÿǕý@ʊǓƨóÆÑǖŃôw@΋ʈƆÅÈVVĊV„óĊÅ@ÞƒĬV@Þīš@°Ž„V@ĸĢƒ°XτƜĠ@ÈaÜ¥Őƅ‚™nğóĕVġUůƿŋ—ĕƒa±V—UťÇğÑ"],encodeOffsets:[[101892,40821]]}},{type:"Feature",id:"6207",properties:{name:"张掖市",cp:[99.7998,38.7433],childNum:9},geometry:{type:"Polygon",coordinates:["@@ÈÒŎÒk„mLUŽlŽU„¯nV°šš@°ɜb„ÞĠaÈ»ĸl‚š„LVUÈ@Ċ@ýUm„@@ÆVĠ¯Þm„LƯޏƒ„Ñ°VVwšJ²»ÆԚVlŤÅV™¦ĉ°ĉĖċwÝJzVxll²IVVVþšX„¤źœV°¦„VĊ@ÆbÈmǔLĸĠ¯Ģaô¯ĸmÆÛUƒlÇĸk°XyĊUǔV„ǩnmV»ƒa@ýnK°n@l¥@»ż„Ċ¤m皃@£ČU@mƒmVkÞUƐ±²¹°‚ĠwÅƑŃU¯™›V¯aÈŁšƒÇ»™ġn_°xŎKlxœklx„@Þw‚„„@Æm²b‚DzLlkšWXať¯ĊaœÑšK±w@wƒUÅçV±Uk™@@„¯š¯xƒU™±±UU°ōxVxÅÔō°ó¯UÝ¦óbÝþƒ@ĉÈóUV‚Ux„„@VŽUVÝwÅÈǎóVkk¯JǐkmmL@„™KÇx@bkš™@U°ķ²ó`ƒš™šmn¯°ƒUwlÅkUƒ`™¦ɛô™Žķz@ŽÅnÇ°U¼¯KmVk²ƒJƒ¼ƏÞķôš¤ULƒ@mnğ`™šÇnUxÇ@Ûÿ™U@ƒƒkŻŽ@x@móJkŃ¥VŹĉóÒĉlċ°ķ„Uƽ܃@›x"],encodeOffsets:[[99720,40090]]}},{type:"Feature",id:"6230",properties:{name:"甘南藏族自治州",cp:[102.9199,34.6893],childNum:9},geometry:{type:"Polygon",coordinates:["@@ލš™nKlnšwX¥WÝXk˜xÞUnƒ°aĊVnUUKlÞĶWXnĠ¥ô»„™@nmVL@¤°™Vz„JšanU@aÆwna@k›ƒU¯šyX_›aĉb™ƒ„wƒéXkWwÅaš¯V¥mƒ¯UƒƒI@ƒš@„mšb°aÈçšUš¥@»‚knwɜƇ°I°ÑÈmVU™¯Xa@w‚W@wšV¯Č¥l¯Uwnm@k˜aUaóKkk@™Ça™b@ŽÒWa¯IÇxÛam¼™VUƒxÒl‚@zÝÒ¯bÝaĉVĉwDŽW›zJ™mJn²mܯUƒ¯ĉ@ġ¤Åb@²nšmlƒ@@Ž„„U„ƒLVxšV™„U¼Ålma™b@ƒ°™l@WIUƒ¯@mƒ™@™™ó„™„@U›zţyƒXÇU™ÇVUUVLkbWakVWmUbkkƒKUÆ»nƒ°Knk@aƒUVmšnk»l¯Ģ›lw@_kKVU@ƒnaƒ@lUk@¯¥mV@kmbW™b¯Åõa@mkU@kƒÇŽkU@›`@™óó—bl¼Uxƒn„¼šlVȄx@blVkVVnƒ`XÈġÈ@ǃK£ÝJmUUnUĖmlU„mKUn™VÅaUw›Uĉ`¯n¯wW¼nxVŽ™š@bĉnƒ‚kIċŘkXUŽ±Ò™xšÈ@ŽX°`l„œV˜IȯĊV„ƒšVVan@VašUVażVmšblkÈW„ƒWIXa„alL@wVb„„V„¦lL@lĠ™n҄U‚nk‚šL@ÆÞkšÞšK‚bñþW¦Û„ċVƒ„ULUºkÈlŎUxÆxÞUUxšÒ‚x„@XbšL@lÆ@„ÒlXVln@„bm¼ƒJ@„Ån„šƒx@bnšĠm„xVXmbÈè@ŽĊ£ČW˜w"],encodeOffsets:[[105210,36349]]}},{type:"Feature",id:"6206",properties:{name:"武威市",cp:[103.0188,38.1061],childNum:4},geometry:{type:"Polygon",coordinates:["@@±¯¥@klwU»ƒƒÞÝmwKm¯™™ç@™kVÇUL¯lVUKġ„ġm@a@U„@X£°l°LŎÇ@aōVÝw™ÔƒKUŽÅš„WJ¯lm@ÛVWa™@klĉUmaƒLUanaƒ™ƒk¯J„™™±KkXóÜÅxƒ²Ç‚@„„nUÒĊb°@™ÆkL™Ž™XÇÆ@xÝn—xWxţ„¯¤ƒI@Æn„ƒVV„VlU²Æè„V@x²x™L›ÒĉbŦ°Wb™Xklބš@l¤šXĊ`„wl@ĢÈŎm@bšnV‚Ubƒ„@șÆÛLƒèǚUÒŦlĸ™`°ĮʟÆǓbĉôϚĊƚĢnŤé΀ÑĸĀĊ¦„@@l°lœ¦Ȯ¦ɆÞĊKŤ™ĵĸů„»mŁyġ™ķŭ@Çɱȭ¯mƧUĊķnŁŻ»UaU™˜ƛɞÝƨů"],encodeOffsets:[[106336,38543]]}},{type:"Feature",id:"6212",properties:{name:"陇南市",cp:[105.304,33.5632],childNum:9},geometry:{type:"Polygon",coordinates:["@@šÈÞ@l`UmVƒ¼œŽ‚@nnÆwVlnVVa„LVƒÈ_‚ÿރ@n„a„xÆ@„lš_š@VxnK@llLnxmÈŎJnbUxšI°Žl@n¦‚lÈIlmX¥„k°@šk‚J„k²é˜@klaUaVaU@@ÝnIWnmnx‚k„ºÞ„„aV™°„V@nw‚KšxôbÞ£šVšU„bšþšLn»mƒVw„IšJ°Ž@„nb@°°I„ġUkÇKVƒ™™@ů»lƒ„Lnmƒ£@anK@Ñ܍n@»mL@£™yk„UUmbUÞÝ@kyÇbó»™XUxƒWVzb±mÝbXaƒwUamL¯»@wUKVwm¯ĵJ°ÅUWVk„KVk°wÈVšVуlUšƒ¥škmVamknƒUw¯¯ƒbċ¥ÅKƒk™Kk„™VċVk£kKVw‚Ñ„a@kóyÛ¯ÇVk™ów›š—Xō¥Ç¼ów™Ž¯U±‚k„ƒ@x›IĉÒÅVmÈnšÜ@n°„bUbÝV‚ŽUnnJ¯Į@‚m¦nV܃@„„L°JXb‚Ñ@šaÈb@šllôLVb—b@lmnVxk°ċ¦U°™Ž@xX@xWbš°UVÇn¯Ò¯Jɛƈmxl@¼"],encodeOffsets:[[106527,34943]]}},{type:"Feature",id:"6210",properties:{name:"庆阳市",cp:[107.5342,36.2],childNum:8},geometry:{type:"Polygon",coordinates:["@@kw‚ĉ—»VamƒƒV¯wƒIóVkl¯™Km™Vō¯ÝWkL@bÝKō¦@Ž™„@š™Lx›@b@l™a@km@@l¯nm@UaÅ@ƒ„óWUXm¥™nƒw`@UUxķôÇ°ğ¦@„VJš_n‚‚IVŽnalxkX„JWn¯šnVƒLšxl¤nnVbklVX@xnxmV@bUK@nm@@xƒV—°±aÅnƒŽkUWnUaƒx@m™n@ƒ¯LƒššmUĀlU@lV@blLUblxklkIÇx¯°‚UXbšaVŽUnšV@°‚LUlnbšX@`°nVmbnÆmV‚kLmK™¦UŽ@X„y@kl@U„°K@¼XbW„ƒš@b„WnLVa„VšƒVz@xlVČ¥lbUxލlV„U@nÆWôn²™VJlU„Ƨ„LnmÜLXa˜n@mœw@wlUlV²mšblwšVȃlLލ„±@lVnUlxnkma@mškšJ@kXV‚U@mn@š¼VXUƒVƒlLnmVbôaVnWV»ÈUl°È¯ÆIn›ÆU@kk»mKkÆġk¯@»mƒk—¯@óÇlÇ@—Vykkl™Uml¯Þ™@w"],encodeOffsets:[[111229,36383]]}},{type:"Feature",id:"6204",properties:{name:"白银市",cp:[104.8645,36.5076],childNum:6},geometry:{type:"Polygon",coordinates:["@@VKUȚl@šè°šnŽ‚LnxÝބ„V¼kx@l‚¦²°ĊóĠ„™Ċ»š@ÈxšaĊxlwÈVŤa@¯²aÇ£ƒJk£lƒnUÞ@°šô™@y„wl»lIX¥Ǫnw@ÑÞWla„ÅlL@ƒUwĉakƒl@ƒš¯mwna°J„V¯nUVÓÞÑm£²óWaUƒÇ@óÝUçV»ÈkkW@¯‚xV@XlK@wX@Vmm_@wÈݙKU¯ÇwVwÅK¯VƒkƒJ™™™XkWVaƒImŽ¯Uk„ÇlVšœĀV°mxóšk„@¼ó„WxĉÜU@Ub‚zÛJÇk@‚ÆnVlԙ@kŽ„x™ô@ĬWL¯ƒƒK@aÛImm™@ƒIUaƒ@™™UŽÇêU¤VÒÇx¯ÒV„šš™lk@Wbĉ¦UbkWV_‚y¯Lƒaó„kŽ@b@nmbkx„°"],encodeOffsets:[[106077,37885]]}},{type:"Feature",id:"6211",properties:{name:"定西市",cp:[104.5569,35.0848],childNum:7},geometry:{type:"Polygon",coordinates:["@@„a‚V²wVJV_@„LlanÅllŦçÜӚ_šlnƒWaôk„xUš„bmV@È°lèšnk°l¦„`@nnL‚@ÈlÜIyVaV@ĊÛXwôƒ@»lƒô™nwU¯›ÿU™Èklƒ°Vn„JUblXšWšš„I„l°U„ƒVƒš—@aVVVmnL@„lƒ„UUw‚mkƒš£„bV¥VUVwۂƒlaÇÝރmk£ƒLUy¯L@WlkKW_XaWƒ—mƒ„ġU@a™k™‚ƒakXkmVwmŹVƒU™b™WƒónmwnWW£„KÈnV¥ƒ¥„ƒÆ_k™lW„bU¯„V°aôbnaVwmaōInÇmwkK@kmLUw™@™`ƒkÅ@ƒwƒb@m݄ĀÇ`U„ƒKUbmUUkÅxmm@›„»nUVk_Ý@™Ç™¦™VÇè¯b™aƒn™@@„„JV„°Žn„U¦™°ÆbXxWl„êƒxš„ĊaœbW`™zV°œ„@lmbÅx@bmV™bƒI™`™¦@ÒUVUI@ƃL@bš¼@ššŽ@„šlmxnL„°ULƒŽƒÞğޛ°kLUŽƒL™°™xVŽ„n„KVƒl@šzX@"],encodeOffsets:[[106122,36794]]}},{type:"Feature",id:"6205",properties:{name:"天水市",cp:[105.6445,34.6289],childNum:6},geometry:{type:"Polygon",coordinates:["@@UyȍVƒVUnn@ƒVU„`UblzšJnk‚@Vb„KU„°l„wš„„W°„nkVŽ‚UÈlš£°V@n¥šV„kl™kU˜±U„ƒn™ƒlw¯UkwmKUlmkUmnkym@ō@U„mWÈU°l°anlJškUKlU„¯Èm@kmWV»kkÝLUWUx±b™@¯ma@ƒ¯™IƒJUxn„m¼™K™ýƒa™V™Uݤóa™wLmxU@¯ƒUšƒb݃ƒ¹lmwmnXŽmJ@ÞV@UbVbkblŽ—@±êƒlI™l¯@ƒlW¦knÇJkm¥k@¯™Jmbóa¯bƒUV°ƒakXlšÅ`ƒ„„¦U¦ÇmƒLX¤mXnxm‚„ôšXša„VźUnŽUxlnlW„bššl@bĢV„ƒ˜nX„WbX`lLXk@Ž°KVz„Kl¤„nÞ݂Èkb„‚܁"],encodeOffsets:[[108180,35984]]}},{type:"Feature",id:"6201",properties:{name:"兰州市",cp:[103.5901,36.3043],childNum:5},geometry:{type:"MultiPolygon",coordinates:[["@@lW²LššƒŽ°I„l„šmbVb„KnbĊVlkš@XbÜU@Žkn°‚XIƒÆ™V„LšÓÞxŎUlôƒ„b°KzU`lXVaĊ¥Xal@šk™™Uƒ°ÑÈwUтV£ÈéVšš„@Vb„Jš@nnÜJ@b„L°„XK@īšóƒwlš@kÓmUÅmK@mƒ_k¥l¯™mkçǯ@nUƒaV™ƒwólXbm„™k™`ÛÔťèkkmÆkbƒK@U`UI±xUƒbWlX„mbVbÅÒólkƒƒIWJkšƒ@ƒz—KŻ¼™@™xUx󎃄¯LWb@ŽÅ҄„±¦U`nbťĀUšVb„LšŽ„U"],["@@ƒ¯lwna@mōȯK¯kW¤ƒ@@V@bĢnĢƒVLU‚°k"]],encodeOffsets:[[[105188,37649]],[[106077,37885]]]}},{type:"Feature",id:"6208",properties:{name:"平凉市",cp:[107.0728,35.321],childNum:7},geometry:{type:"Polygon",coordinates:["@@ÆLUxÈxV°šLÇÞ@xn`Ü@X@nĊŽÆwnJmwUx‚aUkšw@V@w„aVmlLXÝl@X‚VĢmV°@nl@UUUWK@w„ÿVI²Òlmš@nÝĊýVV@nšJ°„„šUłm@kV¼nK›ĢȤôK„blnKllVk²aĠ¥È¯ĸóVw@V‚_„xšmn¦VWôX„ƒÆ@Vbn@°m@kn@@lšb@k‚aœ@‚wšK@™šƒ@UlKVaƒWX™W²¹lӄw@_°›n@@_lKōķW™@ŽmLUWƒn™»Û@›l_Ç`ƒÛmm°ÅbWb@š—VWbƒUUKDŽÅaġlmkUġlƒ»—Lƒl™Um¦@Ž¯U™¤ÇkVUml¯ƒƒX™ƒƒx¯kVƒƒLUa@ml™IkyVaƒ_UV@„mmUVU„ÇŽVzUxUVU¦ƒa™¤l„nVxƒVk„@ƒmKUnUU@b™˜U„ƒ„","@@@Žż@™mlkƒġk"],encodeOffsets:[[107877,36338],[108439,36265]]}},{type:"Feature",id:"6229",properties:{name:"临夏回族自治州",cp:[103.2715,35.5737],childNum:8},geometry:{type:"Polygon",coordinates:["@@š@ż»˜L„y„@l™XI„Jl„ôkÆÑUanaWƒXkW@™yk@U„ƒLƒmUšwš¯„KVlKœ¯Ġ݄݄VKƒ¯mKnw™k@ƒ™@™™»@a„K@ÅVJVU@њ¥š_Uy¯š@£UKmn@‚ƒšó¼ğ¦WmĵXݎkŽVLmVĉU¯bm„ÝV—wWlXÞW¦™xkmmL™šÝŽœ„±U@Vގ™š@„ÅÈW°X„ܼƨyUĮnŽWŽnXÝxUx°lVXJlôV"],encodeOffsets:[[105548,37075]]}},{type:"Feature",id:"6203",properties:{name:"金昌市",cp:[102.074,38.5126],childNum:2},geometry:{type:"Polygon",coordinates:["@@šĢȼ™„Çł°bœU°šV‚ƒń‚ÆǖŰnšÆ„ōĬǔaʠůĭš_kķÆ¥VÑș„çÜKšÅ@DŽƒVaU™m@aōnġÇk@ƒxĉ_™Wk£™@݃±KÈ±aÅnƒ@ƒÝxƒ@kw›lkwōL¯wm`"],encodeOffsets:[[103849,38970]]}},{type:"Feature",id:"6202",properties:{name:"嘉峪关市",cp:[98.1738,39.8035],childNum:1},geometry:{type:"Polygon",coordinates:["@@llĊx„¦šl™¦š„kVVnšJVbǖV„kôV˜a„bnaWw„UXmmamUXkWKō¯Xm°™™»ĉÇ@UVƒK™ķkǼğb"],encodeOffsets:[[100182,40664]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/guang_dong_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"4418",properties:{name:"清远市",cp:[112.9175,24.3292],childNum:8},geometry:{type:"Polygon",coordinates:["@@lǯkÿƒaV¯™VaÈU„¥ÆDŽIlxšmnb‚Uœxl™„Uôl°kš„„Wl„š@ô™VwUanUl@„xVkšaX¥‚kU»„aš¯±@kka@ƒUwmUkwƒJk™˜„±k@ƒ™™L@ÝWUwV݃—xÇU¯ŽÇX@m™Åƒ@@yĉ£VmUwȗ»ÇšUn„lUnWU¯`Ukƒ@@„™x„Ž@bÇxX¼ƒVVš¯LšĀk‚ÝLƒ„¯@VŽƒĀ¯lnĊW¦kVÇôkUDŽUK@ţ™U@a™™ó܃UU»ƒ@™¦k@Vx„KVb„n‚š@„Æ™„l„@xšƒbWšnlU„lxÈlV„È°Æ„@¼™„@x„šWxœŎ‚V„šK°„š¥ššnƒÆkŎ@ÈÑm™„K@¥šk@™ô@„nôV"],encodeOffsets:[[115707,25527]]}},{type:"Feature",id:"4402",properties:{name:"韶关市",cp:[113.7964,24.7028],childNum:8},geometry:{type:"Polygon",coordinates:["@@W™Xk±Ñ@ƒUw™mUwĉwlmn@Æwn£mkIš¥ÇÅ@¥šaƒón£nWWwš£V`Þ@šnVml@xô¼„IV¥ƒkUmkamUkVWwÛ»móƒ£UVÅKmn@x™@kbmm¯a™Xka›VĉaUb݃ƒ²—‚lš„IlxnVVx@„lb@l²™°ƒbV¼lW¦™bUlƒwk@mVVbUxóš™@kƒƒX™ƒ¯lókƒVkš›wVma™nkwƒJÅȃ¦ÇVUbšŽU°„blĀ°ŽkÈ@x™¦Æܙ°@„°„¦óa™VUôlUlbXl@nÜV„„nKlŽnIVÞ°Wš„°U@bnm@¥šIVƒ²Ulƒ°VnalzXyl_Vyƒ¦lƒœLlxš„@ŽÞbšKm„knVWanwƒÑVwČº˜@n_ÞV„aVŽÜIœl@„˜KȚ„VJ@aš£È@˜™@km™„aV¯W@_ƒa¯KmbkÇkLmwƒ@Å¥"],encodeOffsets:[[117147,25549]]}},{type:"Feature",id:"4408",properties:{name:"湛江市",cp:[110.3577,20.9894],childNum:6},geometry:{type:"Polygon",coordinates:["@@@ƒkXƒ™@a„UUċlk„Jƒk„™@wVJXUWk°W@nKnwlUlš²ƒ„blU@‚lI„l@„XbW„šxnm@lW@w„wU‚JX¯VU°`ŎóˋkÝÝkÅ@ÇmğÈřmw™aĵV›xUہ»°™ĠǷnýmóX¥ɅĵҏÇ@°²ĊUĖ±ĮU¤Ç°™Ā¯ɐnżUĊĊĬV@脎@ԃÒU¼l¤nƒĠb„êVĠ°Èy„zVaV‚nUÆL„ašbVl„wÆ@"],encodeOffsets:[[113040,22416]]}},{type:"Feature",id:"4414",properties:{name:"梅州市",cp:[116.1255,24.1534],childNum:8},geometry:{type:"Polygon",coordinates:["@@„‚nԚlW¼x‚¦@lœVl™lLkè„a@zš¤ƒĖ„¼UxlnUKUbÝlU¼lb@„Vx„V„klJÈwV¯š@ĠlÛĖšnƒbkšÆźÞƒUÈôklmšL„¥‚LœW˜„„™nKUkVa°V„x@IVV@x°bUk„a™a@mV@„@y„w‚L„ÑUwVUšV„‚„U‚bÞVVann‚@XwÇÿš¯²aVamkXaÆ»@»nw@¥›UXaƒkbWa¯KUw@¥m@kwmLU»UU™J@kmU@UUWUƒ@ƒyƒanwmçÛl¯ƒŽ¯UƒmKUmƒwVkmÝXbW@XWÝbƒk¯@±‚w@»U@W¯Å@ƒÇ¥UƒU@ƒƒ™IU™ƒakJƒĀ„ꃰšþƒXkamŽ@Žƒ_J°m‚@X"],encodeOffsets:[[118125,24419]]}},{type:"Feature",id:"4416",properties:{name:"河源市",cp:[114.917,23.9722],childNum:6},geometry:{type:"Polygon",coordinates:["@@°VlmX¹laĢÒlm„@„„šVš£‚‚@¦Ģklynn¼lW°z„W„„°VbÈV@lÆbnn‚JškX„šVÆašÅ„W@™ƒUUw@ƒkaV»ÞkVaVLkmVwƒ»„ĕ™£@yƒblçkKkš›U@k¥‚wX»™kmӃ@Wn¯‚I„`@nlb„W™ý„¯ƒé„ÿlI@™XUmWUwƒ@@UJU„Ç„mKUV@x™„ţk¯¯LWƒƒnUxK@ű»Vwa¯š@¤WX@ŽÛ¦@¤ÇIȼWxXŽƒ@Wx—w›ŽUnVbÅèmVa±²UWl@Žk„lȄ¤nôܼXxlUnVlbVn„lU¦ƒJó»@wnkmU™‚Ý@U_™¤XxmXm¤„ô™b@¦Èƙ¦lJn"],encodeOffsets:[[117057,25167]]}},{type:"Feature",id:"4412",properties:{name:"肇庆市",cp:[112.1265,23.5822],childNum:7},geometry:{type:"Polygon",coordinates:["@@l@š¥„@V¼„Vôۚš@bšV@ŤVLȃlVÈólUX¥mĉ°k„ÿU°@„ƒÞKl™ÿ°KU™„UW»Èw@aƒšw@ƒ„@nm@w›£kÓVUVn„Kš™k¥™£Vamƒ@nkKkbÆǫma—kmLU¥™UmƒÛwmVU™mUƒJ—ÇaUxÇIn`mb@Þ¯b@„nJ@nl„U‚V„lVU„L›W¯—Û`Ç_¯`mš¯I™bĉWċzx±J™xš¯ÆUƒƒ_k@™šƒJ@Umb„šXôlLš˜n¦@¼ĊxlUXŽ˜xUbL‚Ġ„UnVĊwlšUš„b@lW„X„‚m²˜@ÞWxXš‚Unb"],encodeOffsets:[[114627,24818]]}},{type:"Feature",id:"4413",properties:{name:"惠州市",cp:[114.6204,23.1647],childNum:4},geometry:{type:"Polygon",coordinates:["@@lbšW°bnnlaš@@wnmÆLVUkÇlƒ@Xk‚V²±‚bnUÆçUaVmœ˜xXw„@WXwÇ»ÈJ@£Ü¥@XW@£°™‚bUx²¼@ƂLVw„mX„°K°Ťlšƒ@wVUnLȃVƒVIky±wkƒKU¯ƒÅkƒ™XġÑۃlwUwlm@m„nKWašÅm›¯óÇmğb¯alĉUwķbmb@lÞÒVn—šmĀŹ@VŽƒbVŽUnmakLm`@xĉkklVÔVJVn—lV„UnmJmaLUbl‚™zmŽkL™a™‚ō@@zš‚V¦UŽV²kJ„nÜU@˜VXUŽL@„lJƒL@bݤUnVŽ—b@xVnlK²„Vx°V„xlI„lkVl²k¤@n"],encodeOffsets:[[116776,24492]]}},{type:"Feature",id:"4409",properties:{name:"茂名市",cp:[111.0059,22.0221],childNum:5},geometry:{type:"Polygon",coordinates:["@@‚LnÇlk„KnkÆL„ƒUm™ÈxlUœJló°n@ššanŽš„„a@ƒ˜@X_@mÝóóU@a™aU¯mL¯ƒƒkV¯™ÇVwkw@V±Ŏ£@™™@šalw±Vk@m„Åm¯™ÿŃƧIÇ`ōô¯_UVW°IV‚ƒx@xkX@Žmn™wXƒWa@ƒƒkkJ@kVƒa±„k™kVmxmL@‚¯XXlWVUI@xƒš„lƒIklVȃV@b„šlW@„@nUxVblVxkôlx™n„‚y„šnIƻư„aXwlK„bVnƒŽXb‚L„¤„k‚L—èƒVV¼ƒŽ²IlĠVX„ynz°KVx°@VlœLlblKœš"],encodeOffsets:[[113761,23237]]}},{type:"Feature",id:"4407",properties:{name:"江门市",cp:[112.6318,22.1484],childNum:5},geometry:{type:"Polygon",coordinates:["@@lUXx°JWnnƚXVš„W„X@„šºVLV¯nU‚Vnb™ô„x‚aXmW™XIšŽUb°xlK„l¯œK˜xXÞ°ŽšXÈ¥Ü@„ĉޏU™‚çš»nóƒVma—x‚¯UÅU¥Ý¯@ƒƒç@ș@çĉÅUmU籃ĉKÝxÝ_ÅJƒk¯»ó¯nmèkǀšŽWxœ¼mnUÜġ°@¦@ƒxƒLkŽÇaVnUxV„™šVlnIlbnÆÆKX¦"],encodeOffsets:[[114852,22928]]}},{type:"Feature",id:"4417",properties:{name:"阳江市",cp:[111.8298,22.0715],childNum:4},geometry:{type:"Polygon",coordinates:["@@°„nKV°šb@bôVÞô@n„VlÒôÆUnlnn@lmkmVkƒaÈkÆƄ™k¥‚ÅÞ»ÆKXkW¥ÅLmÅkamJUkš™UƒVwUmÈbl„K„w‚@@¥Ģ¯VÛnm›»Xw™lƿ™@kbW™—aʵ@óL›l¯ƽ@™ƒƒLn°ƒÆ@nUl‚²kx™b@‚š@šō¤U²@ŽlxUxšÈU°lŽ„"],encodeOffsets:[[114053,22782]]}},{type:"Feature",id:"4453",properties:{name:"云浮市",cp:[111.7859,22.8516],childNum:5},geometry:{type:"Polygon",coordinates:["@@@V„Iš™l@„`V„°Å™šw²I‚wČyĊXša°Jn™°_È`Ü_°˜œX‚KVƒkUUƒVkƒ@mmI@ƒ°a@Ýnam_ÈJVwlĉX@„šlUšómaUmVU°UK™¹@ƒƒWƒXU™™WmÅXm¯IWwkVWlÅLݼÆl¦ƒšÅÅÇl„bUllnknm@kmVmóÅkуUW`—@@„ƒb™ƒm™b@™¯mkô›IkVÇwnš„VƒÅKmlƒLklmȁKƒšVĊK°²„`n˜¤n„U„bWl„xVx™LUx@°nXm`VklVxmnnx"],encodeOffsets:[[114053,23873]]}},{type:"Feature",id:"4401",properties:{name:"广州市",cp:[113.5107,23.2196],childNum:13},geometry:{type:"Polygon",coordinates:["@@Ș¼VxUnĊ¤@z„@šÆ@nÈW°ÈV˜w„ŽUÞVxÞX@ŽšK„šl@ބVaĊbœU@ml£k±lUƒkkJƒw¯UUw±ƒkLUm@w˜aUVmÞ£@a„KkI@ƒ‚KVUW@—ÛVƒmlIU±VU¥™@yğzƧǃƒšƽĠřšÅnī±m@ƒ²¯lƒ°@nÝÆóUll@XnÝVU¦mVV°—„V¼™Jƒn„b@°mbn„ƒ‚@²¯‚¯wVwƒ@@nmxX¤¯L@ŽVLU„m@@l"],encodeOffsets:[[115673,24019]]}},{type:"Feature",id:"4415",properties:{name:"汕尾市",cp:[115.5762,23.0438],childNum:4},geometry:{type:"Polygon",coordinates:["@@@‚„@VxnXWV@š„bVššJ„„V@ÞÅU¥Ċxš£UWU‚wÅUU¥WVUkĊÇnkV`°LV™„wƒƒnU@™„ƒlbĊ¯„Vnalšš@@çkUÝ¥ġaó¯ÅaÅLŻÆUýmy¯ó@ĉÆó„ȯw™ÆXbmLƒ‚@nknVxkx܄ĢҚW„Æl„V°„Ll‚²xlz"],encodeOffsets:[[118193,23806]]}},{type:"Feature",id:"4452",properties:{name:"揭阳市",cp:[116.1255,23.313],childNum:5},geometry:{type:"Polygon",coordinates:["@@V„Ȧ„Æ@X°V@@¼‚x²°@„lÞaWXX@‚aÞWlnUŽ„xVnnL„‚°V„@k‚mĢl@„ak™@mlk°aXƒ±„nwm±™²¯JV²@ƒwW˜—_mƒa„V»ƒU@m¯ĉUф™šJl™„ašbVn„lĸLlƅÛDZwÝ@ĉxó@è™@k™mbƒUĉ°kaƒ„@šmV„„ƒxUš¯KU_mlĉÈVlXUV¦ÆVxVŽVX™¤ĉwV¦ÝÆ"],encodeOffsets:[[118384,24036]]}},{type:"Feature",id:"4404",properties:{name:"珠海市",cp:[113.7305,22.1155],childNum:1},geometry:{type:"Polygon",coordinates:["@@„è@„Þ°V¦VƁ°˜wnb„UÆ»nçƏ@nxܤ²llU°VnÈJސ°UôéšķUklƒô£VVˌKÞV°£n¥ƒ£ȗ™Ýy¯¯mÅkw¯bÇĔğ@Ýn¯ĊƒVğōŁŻƒķJ@Ț","@@X¯kmèVbnJ‚™"],encodeOffsets:[[115774,22602],[116325,22697]]}},{type:"Feature",id:"4406",properties:{name:"佛山市",cp:[112.8955,23.1097],childNum:1},geometry:{type:"Polygon",coordinates:["@@Èb˜Ž„InVVšnUÜxn„šVV¦nK˜lnbÅǬlalL@mn„Ubš¤l¦™šƒLUmUVlԜ¤@xmnVl°_XVVmƒkVmș@kn@VƒUK@°KW£nw@m„@Ux°x°@±„mƒna@¯ƒa„mšIU»˜ƒU¯nUV¥ÞUWmk@Vk¯™Ukn›ÑWݐƒĊÛ@Ǧ™W¯Wݗw›Lk°ƒkL¯wVa™WJXšWnbƒwkVƒ™W@kĊ"],encodeOffsets:[[115088,23316]]}},{type:"Feature",id:"4451",properties:{name:"潮州市",cp:[116.7847,23.8293],childNum:3},geometry:{type:"Polygon",coordinates:["@@°ŽÜknèmx„b„z„@V‚VX@VnV@lšIVVV¼nKlxn@@¦Vx°LXbla„ŽWbœV°£¯™W@nW@™‚aUñVœwWš»@¥ŤÅUÝǓÝóV@ńǎkUVmƒIUwÅVWÇX¹›—@W„¯bkl@nlšƒb@‚kġŽn@l"],encodeOffsets:[[119161,24306]]}},{type:"Feature",id:"4405",properties:{name:"汕头市",cp:[117.1692,23.3405],childNum:2},geometry:{type:"Polygon",coordinates:["@@‚@U±°Iš±n²mx²ƒ˜@œWºXÈÆUVx„JUnlVȍ@ŃôUǔÞVçn»VyĢÛVm@»kaÝUǼóšÛÈķKċ¥X„¥Wwğk™ƒ¯@ƒwķKƒkUm™aƒbkš™IƒšVÒ°Ċ@n„VU¼ƒ‚„bn˜`X—„x"],encodeOffsets:[[119251,24059]]}},{type:"Feature",id:"4403",properties:{name:"深圳市",cp:[114.5435,22.5439],childNum:1},geometry:{type:"Polygon",coordinates:["@@ÞLš„@xšbV„šVšK°™X°Kô¥Vw@anU„胐š‚lkĊl@wn_lKnbVmU„aUź@nÿ˜™UmÝѯUƒbk„@ÆkxŻ@™aÇX—wƒJƒƒ¯LķÝUĕ™ó™ĸóêWº@b²nmĬ™Æ"],encodeOffsets:[[116404,23265]]}},{type:"Feature",id:"4419",properties:{name:"东莞市",cp:[113.8953,22.901],childNum:1},geometry:{type:"Polygon",coordinates:["@@Ŏ@ššblKnšykVa‚KnbnIVmUƒ˜kUmUIUә„ƒçmV@bUxó¦¯LW‚¯š™L™UUƒ™a@w™ƒÝKğŚ™ƾ„„ƨÈĠy"],encodeOffsets:[[116573,23670]]}},{type:"Feature",id:"4420",properties:{name:"中山市",cp:[113.4229,22.478],childNum:1},geometry:{type:"Polygon",coordinates:["@@‚XœÒlmšV°ôÞÅ@m„¯°k„±‚@@aX¹¯VݏÇIUmV¯kk‚±Û£mw@‚Őmèżmô™¼èVš"],encodeOffsets:[[115887,23209]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/guang_xi_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"4510",properties:{name:"百色市",cp:[106.6003,23.9227],childNum:12},geometry:{type:"Polygon",coordinates:["@@lklWXL@VšI‚l@XnJn@VUUalk@mK@kny@UlU@a°™„ƒUU@VmaU@Ua@UWw@ƒn@KmLm@alkšmnI‚m@an@VIUamWÅImwU@@a@K„X@JVL„UVmUaVkUa@m„@@Ulmkk°ƒUaVUlKXbVwVIkaVmUk@KVk@a„aW¯m@w„¥laœX@KmaškVmnUl@nxVKšInU@yVaVIV@na°KlxX@@_lmXšUV`VIV™V@„n@lšbn@@WUkValK@²yl@„„VUV@@K°L@KU@@UVaXIVVV@naVkVa@K@UUK@UUa™LWa—w@m@K@UVVƒ@mVUUVKnL„mVL„K‚bVK@UUIk›mI@mUIVK@IUK@VkLƒ@WU@mU@WmUk@ƒI@VƒJk@WwX_@amK@UUWkIƒ„ƒK@LVb@mVmakL@J@bU@Ux@xƒbmI@`ƒIwm@UbmKUaUWa¯UkJWV@XƒJUU¯LUmV@ma@kkamKwƒLUUmWVkkm@aVUUkVKnVVUmXK@UW@km@Ukkm@@W@U™kUy@I@aUUmbƒ¤U@kUmL@bmJU@Ua@wkLWWkL@Uƒ@VaU@ƒLUakKWbkUWVkKkLVLUV@JVbƒz@Vƒ„@ƒVmUU@kVmK¯@VƒU_™VWakVmIUKUaU@@bml@XU@@V@LmKUV„mVUKƒƒKƒbkaUXƒKUL@x@V@l@„mxU¦„V@ŽlL@V@Ln@@VV@„nlKUaV@nLUbmJnL@VWLkbmV„@@L„W‚„XLlx„VVIVV@x@V²blUVm„LVUœK@kWWXUlV@Xl`„LX„l@@VšŽƒn@VnbVš@lVUVUÈVbš@@`UXU`l@@XUVm@kš@xmVknUJVXUbmKULmbx@VlJ@LVbkKUbVLÇUUVƒUVmU@VaUkUKƒVUwmLkUUVVlƒbka™XmwƒKUšVVU@@V±Uk@VWUUm»XamU™bƒKk™`ƒ„™U@UnWW_kKmbUVUVmnUV@„nJVUlšUbU@UV@n@JmI@VmbnVUXlx¯ŽkKmnVV@L@V™bkV™Umm™@Ub¯LmlUƒL@VWLkmkLmmn£WmnKU_mW™š™bnbmxƒ@U¦UJU„@Xmlk¦@‚mnUUm@@Jn@lV„ÔVJnIVW„I@a„ƒÆK@I@aVK„IlŽÞnnl@nl`nbÆX²l@xV„@llbVn²ŽVVl@nn„V@IlW@Un@@kVa°KšnÈmVaVXUlaVƒÈU„VlwôUlynIVašan@lVXb‚Iš@n¥la@Kš_n‚@bÆx@XnJV„nKVz@`VXVšU`@bƒ¦UV@VšIlx„UnV‚K„XÈbšVllšbVbnVn@"],encodeOffsets:[[109126,25684]]}},{type:"Feature",id:"4512",properties:{name:"河池市",cp:[107.8638,24.5819],childNum:11},geometry:{type:"Polygon",coordinates:["@@lLVl„bVV@nXVlI@JVX„mšn„W°b„IVV@‚ln„@nalVUb„nW‚@kVkÒlbVKn²°bUŽlV²@˜X@`nb„aUI@ƒ°wlU@aXJVI@aVK@wUamIXm‚@XUV@@bV@Vm„ImnUUwVaVKXU‚nVK@akƒVwV@nL@UV`n@@X‚lnIUJl@X¦˜V@aUIVm@anƒV@UwnL@VlbVL@KVVXUWƒ„wUUVUka@UVJnUlbnalbVVn@°„„LV`Þ@šXVxV@@bVlUVVbXnWlXnmlš@XXWVXJmbUI@V„llUVkn@@VWV@Vnb„@VXUJVnn`lLVk„a„»lVšLnw@WV@lInw@WnU@U@m‚knUVó„K‚wUmUXUƒU@@wVJVIl@XKVVVbVI„J@Un@lŽVLnm„b@U@Ul@nUš°VUVJnnVJV@„@mVU@ƒ@wkUVwkKWk™yUUkU@alkÈ@lJ@x„Ilƒ@UUWVkUw@Kn@@kmaƒVUl™UUL™ÇƒUUKl@UUmL@aXU@mlUUwmKkUUVKVUƒaƒKUnK@U@Vl@XUWU„KlwX@šb@K‚@XkV@UwWJka@aUwmV@U™@@U@wUm@»kLWVkIWŽXnmV@VkbmKƒLUbk™Va@aƒa@@aVU@aVak£@ƒ±UkVU¯V™UUƒJVƒUIƒ@kxmUmWUbL›w@K@aU@@aVU@Kma@aka@_VWkk@UWVUKULWKULUš@KUnƒwVaUKƒxU@UmaƒL—m@kVmVa@UkƒmI@ƒ@KmIkxU@@K™U@mmakI@VƒLkmWkkJ™_U‚@V@L@n˜xXbšKVb@VVL@V@LUbUlmbU@UUWJUb@VV@@L¯K@LU@UVƒƒk@±z@‚kLUbVl@Xm@™akm@ƒU@UšUJU_™VWŽkn@`W@kw¯LmbU@UJUb@zmV™JULmwk@mVUn™lnb@L›Wkbƒ¦@x°nXŽƒb@bUl@LVlUnlbUJUxWakLUVVb¯„llkn@Vƒ@@nVbUlVbUnƒVUK@IƒW@L@bV@nxÆJnXVbUJm@@bnmJ™nkl@b‚nnK@L„m‚@Xx@VVbV@nb@UVVƒ„¯š@bkV@Vmz@lnLl@kŽVbUVm@mI@Wk™J@UWKkXkl"],encodeOffsets:[[109126,25684]]}},{type:"Feature",id:"4503",properties:{name:"桂林市",cp:[110.5554,25.318],childNum:13},geometry:{type:"Polygon",coordinates:["@@nU@J‚X@`XLm¦Vb`lšVXXWš@VblČnVšŽlanLnmVLšK@_Vaƒ¥@kUa„@VmVb„aV@XVVzlVVK@knKVmX£VKšLlbnš@b@llL@xĊôXaV@°È@¤„bn„V@@Wl_„V„U@W„nVamw„wVbn@„K‚VšLX@VmVUxlV@šnVV_nK@m‚I@Wn@@IšUĊ@@wVWX@@I°VVm@wmU@m@IUƒV™kƒlkUmmkÅV@@aV@@Wn_UKla@kšaV„šlVanb@k„@@KlVn@@aV@nIWW™UUaVU@™kKmwU@UImKk@UU@w@W@‚™k@™UkWƒ@mk_W@Ua@a™ƒƒ@—¯ƒmV£@mƒUUam@—kWakƒVama@UUm@nw@alaUmnUlVlIœV‚™šLVyk£Vm@k@UUJkƒK@kmKUw™KkWK@UXImyVwnI@m‚ƒkUlkUKkUVmƒw@kkJWUÈm@_k@@aƒaW@U„UJUwU@@IWKkƒmUUV@nVl@bVb@bU‚UXƒakw@ƒWUkbkKƒbm@™xUlkLm@@wmKUX@‚™UaVW™XVmU@@UUUƒxkmWXkKkUWaUaUb™L@`UL@LV`UXmK@VmakLVbkL‚xUJUIVbUVVb¯KƒV@Xnl@lVXbmÒnV@L@VWKkVUIWJkIƒŽUamUUbm@U„kU@JUbW@X„WxUam@kbVVUnUJmUUV@bƒU@UUV™@ƒVk@ƒbƒmULV¦U@V„U`VLUL@xVbn@UJ@nWJXXVŽVV@bkxVbUx‚Lšš@x„¦@šU‚lXUVVlULV@@šnŽU„ƒb@xl„nJVnlVknUlVUbmŽU@ƒbVš„x"],encodeOffsets:[[112399,26500]]}},{type:"Feature",id:"4501",properties:{name:"南宁市",cp:[108.479,23.1152],childNum:7},geometry:{type:"Polygon",coordinates:["@@lKnbnU‚@Ua@K„L„ƒlJVX@VnL@bW`Xxl@„I@U„Jl@nV@X‚V@nXV„@lK@UVL@JULVJ@nnJlœVJ@VULaƒLUKƒnmKULVVUŽ@nU„š`lIXlln„K@UlJnb@nšV@LV@lwnJ@L@„nJl„@VUbUn@l˜n„KnbVŽV@„wVLUb„xVm@LV™VKXLVKVLXU@VllUX@`lb@bnb‚L@ŽUV@bV@@b@Lœx‚KVanXVƒUUmVUUUaVUky‚UUa„ImK@mUUVUkKU_@W@UVVVIUW„UVaVU@UUKnƒ@k@al@ll@bnL@b„VUV˜X@Vœ@@b‚Knblmn@V_@aUalL@a@akK@kVKUKlwUUnV¥VmU_VWVIVaX@Va„alńK@LVJnalL@LnK„wlVUw‚mX@VXšƒlLUVnblaUmVUVwXU@Wm¯Va@ÞKnw@w™mšk„»‚UVW²a@_mW@U@I„y„LVUUKW@@™„LX@VUV@@yVU@UV@nwUUmJka@IU@ƒmƒVkaW@UwUX@`ƒ@kLWUk@mƒkUUm@k‚UUWkUƒkWxk@@VƒK@nV@UVaƒUUJmIkVƒ@UamLUbkVmamLka™@ƒ‚kmL¯WI@wJmwƒx@akU@aUKmbkaW_nW@_U@Wm@a@wkwUKmƒk@ƒbkb›w@mKUkkU@J@bW@kVWz@bVUa›VUx@„ULkJWbXVVXƒ`@œmJUVU@@Lk@WbU@UJlnXlm„Vx@Ln@‚b@K„LX„WJUUW@kƒaUVUbmV@nnV@n@lVLƒVmLX‚mXkV±@kxÅL›šUbJWIÅJ@I‚mXalkUamKkškL±aVwKƒUU@mÞnbWJX„m„@lbmKULWUUVkaƒbnn@Vl@VVV@VƒbVbnLWLXJWxXLV@@VV"],encodeOffsets:[[109958,23806]]}},{type:"Feature",id:"4502",properties:{name:"柳州市",cp:[109.3799,24.9774],childNum:7},geometry:{type:"Polygon",coordinates:["@@ƒwU™„aV@nVaUVklmkUUmmIkƒ@w„aVƒm@™U@VKUkVUkWV@™ƒ¥@w™™KVwUalw@aUUUWWXI@mVIm@Ua@wVKUKV_UƒV@U¥VK„n„al@„Uš@VU@V„V@aVUnVVIVmUUlan@VbXwWƒX@Va@IlVVƒn@VanVVb„lJXIVJlUXL@U@KmUnÑWakU@mkƒJUI@mk™@wUmmUV@JXaWIXWmaUIƒJƒkk@W„nJ@„ƒaUak@›kkJ@kUKU_ƒ@myUóWUkm¥kUmL@KUKm@k_UmVa@ƒk@@UmU@mm_—JWIUVUŽWLUlbVUJÇVUIVwƒKUVk@mU@n@lUL@Km@@l@L™VƒzJmUU¤m@UbV²U`U@@¼Vn@x@Vš@@VnUVx@blbXIVxU@Wl@@L™aW@kxƒLXVWVk@@U@VmLVŽ„L„bUVULVV‚lnLVxkV@nWV@bnKVVk@VL„VšÈVKšVVk„Unb@lm@@LVxUlVX@Vk„ƒJ@wkIÇ@kl@blVVVšzXllLUxlV@x@„UV@nƒ‚U@UImmUIUV™¯mVk@@V@VƒamnUKkm@@VƒIUJUaUUWLk@UJUI@xV@V„VWVnxƒLUômVV„@VkVVVUnV@UVkL@VVV@bVxla@bkXVJVn„`nU@bƒb@bVL@VnJ@„l@šV„aU@@_lW@UUU@Unƒlll@XLl@@UX@°bVWVanLlknVV@VVX@VVƒnUŽVLmbXJ@nllXX@`VXƒlmaXVWk@Wkƒw—J@„VL@J‚bnU@bn@@bVKUnVJVIVVVL²a@bV@@Vl@nUVakalmš„UL@VUL@V‚a@mXl@nK@UlK„L@Vl@@nkllb@š„Vnn@‚šnV„™V°l„šVInwlKXxlU°Žn@@ƒ‚I@UnVlakUJWkUK@anUWK@_ÞJ@U"],encodeOffsets:[[112399,26500]]}},{type:"Feature",id:"4514",properties:{name:"崇左市",cp:[107.3364,22.4725],childNum:7},geometry:{type:"Polygon",coordinates:["@@@JVzšl@V@Xn@ll@VlnX@@VWLnŽUVmUULVlUV@blnUlnXVV„K‚xnLlb@lnbU@Vn°KVV„I@WXUlI°VXb‚VVbnLVan@‚x„J@_nJ„a@wVwV@@a@IU@UU@WKXwWIXKmKUa„a@U‚UUUk@@Umm„albVUXVVKnL‚a@knƒWƒXImanÝV@„V‚LUx²blKl™nLVbklWbn@JÆIXJ‚IVaœ™ÆKlw²@lUnWWnK„UUK@k@mmU@mnUVaVU„b@lVXVXIWƒƒK@Lam@@KUwnƒWkkmVIV@Xal@@KV@VUnI@›„_UWWUkam@kkm@ka@mƒk@wkJWIUU@WXkW™XkWWLUUƒ@UakLƒW™XV±VIVWUU@anUWaUK@IU@Vak@@UUKWaƒ@m@ak@@wUkla@mUaUklakwVƒ¯¯@WWUkLkKmaƒ™kLUnV`UxWX@Jkn@bmlƒakkk@ƒb@l¯bm„ƒbJ›b@VXn„bVV@„ƒbƒJUkkKWVU@mœÛVUUW@UVUJWXkVkKmUL@WW@U„Vl@XXKW„XJ@XVlmbUxnnm@UlVnV@XVm¦VJb@šmLkKÇbXblVkn@l@bWnX`V@@IVV@ŽV„V°n@@_naÆVVbUVVbUJnzlVUl‚XkV@Vlx@X„VnxƒbƒKUK@b¯VVUV™L"],encodeOffsets:[[109227,23440]]}},{type:"Feature",id:"4513",properties:{name:"来宾市",cp:[109.7095,23.8403],childNum:6},geometry:{type:"Polygon",coordinates:["@@nVlw„@VJU„„IVVUšV°lU²V@„l¤Ub@bUV@b‚@„b@bUblšVa„KnLla@UnUWmXlJXUlKV@V_U±Van@V£nV‚I„yšU@K@kn@@LVK@k@mnVl@VU„LUxVJÈUVIU‚aVkXKVVUXJ˜In`@nnV@Vl@@„UbVnl`n@VL@LnKlVn¦VlôXV‚nz„@V`VL@llIœll@Vb„b@ƒmIXƒl@„l„IVJnbWXXJWb@IU‚nVVn@xlš@nVJ„I@W„U°LUaVUUaVJVIwlKUalKnb@UnLVWU_@KVK@_šKVa„@VKU¯VLVKn@la„aUkU@maVU„J@k™@Um@XmbkyVaUIUU@KV@laVn@KXKWUkUk@ƒaW™UUVw@aXKmƒVaUUkšmIƒlUU@wUa™xUmmU™¯™U@WƒLUmVIUym@UVmUa@wmw@çm@aWLU„™JUIUamKmL@™aƒx¯¥ƒkU¥U@±„k„UVmKU_mJUbkKm„ƒLÅǙ_@WWUXUmaVUkK™„UWW@nVxkUƒxmL@KkKmbUI@KƒLkƃbUbW@UbUJUXV`UnU¦mŽVVkxVLUL@llL@b@bkKVb@bU`m@knmaL@a›@@U—WVUƒU@amK@akkk@@b@lm„VL@VUVUbƒVVXUJUU@V@XV`lLUVVV@nnLƒJVbVlzUVVbVVnUVVU„"],encodeOffsets:[[111083,24599]]}},{type:"Feature",id:"4509",properties:{name:"玉林市",cp:[110.2148,22.3792],childNum:6},geometry:{type:"Polygon",coordinates:["@@VJUXVVXlWX@V™xVnX@@`ššULWŽUXÅbWK@mULUUmJ@n¯b@l@VULVx„x‚XU`VXXJVI„V@nm`@nUŽVXn@lWVn@b@Jn@nU@Lm`@Xn@WJƒ¦U@@VnL„lV@@Xl`nIlJnkVL„w@KVK@UšaVL@bVKX™lUUKVK@I„VšL„a@U@WšLUlVL@bU@@blb@VlbUxVbXUVJ@xVL„U„lV@VU„bVLnKl„XJ@L‚b@an@VanL@`VLšKV_UWl@U_„a@WVInlVUUUVm@I@W@wVakIWm@U@ƒXwlaVbnI@ƒm»Va@aXaVLšU„»@aVa@k™KkL@KmU@WƒzUK@wU@VWUUVUUKUa@mKmbUK@_nWVaUkVaUaVUVLXKVƒVUVmVI@UkKkLm`UkW@UwWW_„UaU@WakXmK@xUXƒJkƒUUWUk@Wl—mJ@km@@aUKzmyVk„a@kkWVUU¯lmU@@w‚kkmV@Vk@mÅIƒ‚Ukƒaƒ@Ub@m@UUU`mUbWaWmb™X™XKWIXUWm@љ@y@UkIUJUUWLUWƒL@UkVUxW@kaWbKWnXxW¦n„m`XLVlUbVbUx™I@JmLUKUb@VW@@bkL@b@VlU@xkš@L@lƒxXxWXX°V@VVVbUVV@UVVbULVnVJUb²b‚aUb@VVVVInlV@VnXaVUšlI„VUb"],encodeOffsets:[[112478,22872]]}},{type:"Feature",id:"4504",properties:{name:"梧州市",cp:[110.9949,23.5052],childNum:6},geometry:{type:"Polygon",coordinates:["@@VbXblVlLXWln„wVV@VV@UnšWUXVbš‚@VWXa@kVK„UaVaVkšUlyX@Vaƒ—VmUwUaVU@UÈymI@aU°@š™nWV@VaVaw@IV@VmnLVK@kmmna@™„™VbVI@aV@XbW`U„„LUVVx„@VbUV@bl@VLXblJn¦lL„°°@n™@K@UlLnK„a°LWbnJ„¦UÒV„UllLlVnKnbWnn„V`„w‚@@Xa±™n™l@XKV_„WVkVa@kVyUa@wU£UW@UIVW‚@@a—wWaX_WKkVmUULmak@UJUI@±m»™—k@m»VyUIm™nmmwnkUmVaVIUn_mW@»Vk„@VwkmmUXa@IƒaVm—mƒ@Wm_U@mIUWóLmUk@laXmmkUK@UmKULUUmWULƒ@VakU™@Ub@bƒ¼™VUKWb@bUbn¼@„mJUakbWx@„@VXnlJUb@x@X@JUnVVUVmkUJ@XƒbV`k@VXU`™LUK@_mKUbm@@b@„U`@nlV@b„UnbVbn@@`VbUbVV¯bm@@mJXb@bVnUllVXUlbUl@LU¦VVmŽkLVb@b™l@V@XlK@V@nUJUz„°mŽwmLmlXbWVU@UUUlƒIU@VVmV@@¦‚bXbWxX„WlXVWL@LUmkbU@@LVVVJUblzna@WVnš@@lƒIUVnbV@Vlƒbkbm@ULUKV°ULƒ@"],encodeOffsets:[[112973,24863]]}},{type:"Feature",id:"4511",properties:{name:"贺州市",cp:[111.3135,24.4006],childNum:4},geometry:{type:"Polygon",coordinates:["@@nL@xn@lKVkšwn@„alLlaXV@„lx„bVWV@aUa@aUk@mVUnVl„XL@JV@VxVIVƒX@„b@bl@@`ÇnXVlI@l„xUnlVVLkllV„@nmJUxnzWJ@VXLlŽšLVxnL@l„LlŽVI@V@lUnl¤Uz™Kš@„Vl@š„L‚l„Lnš‚b@VnVVU@k„a‚Knxn@VkVJ@ńUlakmWIUaVanm@_UK@UVWUa@klXam™U@Vmƒ™VIXW„@lUVknVlKVLXŽVXšW@b@VlšnnVL@KXL‚Kn@lb@UnW°@Va„X„WVb°aVa@I¯aUkUaVKVwƒaXk@a„a‚™@wkm@alanUVw@alK@Umkw@UƒaUmU@WXUaUK@UW@UaVWI@¥Xa@w@WWšVƒXwƒU@mKUXUWVU@a¯kl@akU@UULmK¯VUVW@U_m`U@@xVbUz@lUbUlƒXU`WLk@mš²šWb@Ž@ƒxU_mƒXmmamLkUkKVkUƒVу¥mIXa¯KƒbmLkK@V@Lmš¯@ƒ¯kKm¥kIWaUKk@@aVUUaƒ@UwVUƒKVƒX_WaU@@bUJUaƒš@šmbnn@lULmKUnU@@J‚xUbUbU@mX™š¯@VŽ@bnJÇz@VUVVbVxUn„˜UbW@kz™VUlUbVbƒŽUL@lWb"],encodeOffsets:[[113220,24947]]}},{type:"Feature",id:"4507",properties:{name:"钦州市",cp:[109.0283,22.0935],childNum:3},geometry:{type:"Polygon",coordinates:["@@@IlVVlnL‚@œxla„al@n„VLlx@x@bXnV@@`mXX`lbnaVL@blV@b„wnx‚I@xXJ°nK‚l„š@lbnKnblUVanKVb„@lUnJVI„VUb@V‚U@m„L@Ul@Xw„llVVXV@lVnlVn„l@XVlK„@@_VWVxX@lb„U„nV@@JlbnIlmnVV@UwVK@U@k°a@mnIVVVK@nXLÆaVWXVK™™@_W@Umšw@UXWWkUUVWUIVaƒUkJ™UVWbUmU@mkUJUU@UVab±aVaUIUmVKUaVUU@VUUaUUU@W¯XWWw„w@k@Kl™@wkV@U@alK@aX@@UmIUWUIƒ@mmkXU`U_WJUnUJmUk@@amLU@UVW@UkU@@VƒbUWVUk@@wmKkUWLUWX@JmIƒlUkkKWKkLWU@UKWa@bU@@a@_UKWƒUUUmJmw@nV_@ġğKóLmbU¼VÆ@xUXƒ@Um@wklVnUn›lkaUV@„lV²WVklWXXbWlkVkIm`UUƒLƒUU@UWƒx@XU@@lWLU@kbUbV`UXllUV@bmb@LnKVbULm‚šnVVIV`X@"],encodeOffsets:[[110881,22742]]}},{type:"Feature",id:"4508",properties:{name:"贵港市",cp:[109.9402,23.3459],childNum:3},geometry:{type:"Polygon",coordinates:["@@n@VzUJ‚nVŽ„K@XšVš°nVVnšwVb@xVV„knJl™VVUbn„WL@bUxVVXš„bl@lVXkWƒXwWaa@¥‚@nUUUV@„JVkVVV@XUWanknK‚xnƒ¯VyVI@m@UkL@W@Ušk@aUalKnUUV¥@KVkkaWVkUVkUm@aWanI@n@°aUUVaUa@_m@UamaƒV@akU@mV_@ƒa@KWIkƒmLUKƒaUVU@ƒkƒVUK@wUIWVUaVwka@Uka@aV@@aUKVk™K@X@Vƒb™KƒU@JULVLkVWšUL@aUK™b@VUL@LƒxUKmlkImJk_@WU@ƒkmK@UV@„¥XIm@@Wn_@KmVm@@I@aUmkXm@UWV@mn_@mƒUUJWIUWV_WƒwU@mUknVVmxU@@VUV@zU@UVW@ƒK@šX@VLUVƒKƒz@J@VnX@`±bUXVƒ¼™lšn@xmxÝL@‚Ubn°@XWVUxUVVnkbWVXV@Xš`ÆȄKnƒlLVanIV`nLVUlƒ²ƒV@V¦„l°¦„w‚b@šnKnLVbVJšIVƒXK@b‚n@ènx@xVbUnV‚"],encodeOffsets:[[112568,24255]]}},{type:"Feature",id:"4506",properties:{name:"防城港市",cp:[108.0505,21.9287],childNum:3},geometry:{type:"Polygon",coordinates:["@@XV@X°°U„lxkbVlVb@nkbVl@xl@@b@n„‚XbVL@Vl@UbV@@JVLXbmV@bVVUXUJU²šW„XlKVb„@VVXKlXšWlXXWV@VXJlI@x„l@nlbn@lln@lbXalIVK@ƒVwœUVb‚U@aXylUX@@aW@U_UJmU™nVKUamL@Kna@aVUkkVWU_ValaV@XK@kV@@W„wVXV@„V„KVVn_lJlUXkWaXWlkXU‚±kU@ƒVUlbœkVmUmlk™¯Ý™™W@mb@¦VxULm™kJUU@ma¯wƒmkX@VóJ±bUVUXÝWk™lWXXlƒxUaƒbƒIğ™Ç@U@mVUKkkm@UJm@XnWV@x"],encodeOffsets:[[110070,22174]]}},{type:"Feature",id:"4505",properties:{name:"北海市",cp:[109.314,21.6211],childNum:2},geometry:{type:"Polygon",coordinates:["@@VaVLnK@IšJVwUaVaUkWKn_mƒX¥WwXm‚LXalbU£UyV„Å@ݙwm@™°l›LÅUƒmk™mwÛaƑLÝUUm@ȣƃV_„Ó@£UƒƒUVƒ„™¼U°W̄™ÞVbXbôx@b@bmV@ǃ™UÝ@@ĢU`m@ŽnxnIVV‚VX„VL@`@bV@@aXbVL‚@XVlKXLlLVl„knJ@I‚WVXXKlVnL@xl@UVVX„a@UV@VlX@VUV@nK@bl@nVVIVmXIV`V_lWnn„@VJVXnJ"],encodeOffsets:[[112242,22444]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/gui_zhou_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"5203",properties:{name:"遵义市",cp:[106.908,28.1744],childNum:14},geometry:{type:"MultiPolygon",coordinates:[["@@@UnUlJn„w‚JU°VL@bnVšU„wlJ@XƒŽXVlU@klVUJknl„UllL@bUJ@xULUlƒ„UblVkblbnw‚UXmla@„wV@VK@L@UXaVKVLXWƒUVa@U@Im@@W@£UKUakKWIXU@al@@llUnL@W@Un@@VlUV@VIUanKl@Xb@lmxVb@b°bb@nlJVVnnJ@b@L‚V@ln„@LmV@Vx@blnVK„nlJXIlw„J@҄b@nlK@Un@UL@VVVVUUUVK„l„@VUVL„J@UVUUw„@Wm@™„UV„ÈVlbUb@JšLlŽX@@x„„ƒLmŽk@@nlx@bUJUzVJ„@@LVxUV@bWxnLnVVK@_‚K²xVbV@n¥@aVI@b„@l@Va„Knb@n‚`n„mmý„W@ƒU_šwV@VlVV@Vn@n„˜@nI@Jn@°¦VaUU@™„mVVWVaUńU@aVKnƒVbVUmmU@a@kUw™m@aUUmUUJ¯lakU‚aXaWUUaVƒkk„amkmUnVlULƒVlJ@XU@UJWUUw„k@aU@WbkWƒL@U@WU@@XUKmV@aUVwUĕUJUamUUVUÑm™nIVJ@kl@XalJVn@KVLœ¥@UWIXWmU@mVUKnUWLUKUaWUUKVU@U@anUny@UlUkK@w@a@aVUƒ»UkVw@Wmk—JƒÅmUUVmwXalLXWWUnam@XkƒJ@UVU@U@W„@@U@I@Wl@Ènlw@KXLWb„lVUkalKUU„VVaV@@wnIlaUmkUƒKWU@KkUkLWaƒKUUWUn@VƒK@LnnWJUIƒVkUWVnV@V™@@XƒK@VUIUJ@IWJkX@VVJ™IƒVkK@I@UVaUWk@m„@wnUWKk@mxk@@„lV@b„xmb@x@VUmLkUƒJ@nVV@b@VkLVbU`¯I›l@™U_UW@UU@™™ƒK¯wm@™xƒL¯¥kIƒ™ƒ‚@bkbƒ@Ua@ƒm@kkW@XVbmV@ŽkV@bWbUbV@„¦ƒxXlmVk@ƒ¦™bkaWL@KUImK@wUK@VUI™b@bmK@LÅy@akXW@kbWlXblL@ŽULUbƒ`@U™kUymX¯@mšUJUUJƒL@Lm@@WX@lU„VlšXll„@l@Èk°V°Ž„X@VU@UVll@XUJVXUVm@@VXLWlnV@Xƒšk@mVULnxV@@bm‚kL@VWLUbU@UVm@ƒb@ķ¥UnmJ@UUVƒkkJUšlÔU`UIW@ƒ°kLUlUI@WVI™U@mWKkXk@ƒ‚WU@bXšW„@J@xX@l@LVl@xšLVxXX@x‚KnxVknb‚KVV@U„L„WlXU`@nUlšX@llVXšVU„KlkUKlI@anKVLXKVaUIVWV_VK@VnLlU„»VKVL„m"],["@@@KlKkUUVVX"]],encodeOffsets:[[[108799,29239]],[[110532,27822]]]}},{type:"Feature",id:"5226",properties:{name:"黔东南苗族侗族自治州",cp:[108.4241,26.4166],childNum:17},geometry:{type:"MultiPolygon",coordinates:[["@@VV@XkV@bUbWJU¼Vb@Vnb@bš„@J@bƒL@LV@UVƒlUI@a™KULVb@bkJmx„šlLVxknVJk„‚xnKmnnL@bn`WIXlWLU@UxVbUVmKV„XI@JVIVJ@U„L@Wš@@UmUXUlV„UVJXImm@K„L@UVmVXV‚„LXblKlV@LXV„LlVVnkbmJ@xnXl@šbXa‚@Vana„ÒšL„m‚VnIl‚Þ¦°k@b„@@lV„nJlUnš‚VX_„@lVlK„šV„UUxVLVWVIXJšUlnnWlI@KUaUUVKn@VaVXV@na@ƒmw¯@mUkJUamI@lk@@am@@I„ƒUmVImUUw˜™@anUVaUU@LU@WaWUXWW„wV@VwnU@L@ynbl@@X@a„J@nW@@Vn@„lVLlxnI„lš@@UWKUƒnIlJXIVllIVVš¼XK@aVI„V‚@@bn@VKXLVKVVVInw„J@UWI@mX@WKnI@KmU„UVJUL@V„KW@@k„@aU@@W@InJWUXwWI@Wƒ@¯wkaVaUIl@nŽValIXWWI@UUm@anwWkXWWIUbk@UJmIUamKVUUUVVama¯VkIVVUlKnXVwX@@WVaUUVa@IlƒaVmƒkna›wk™UU@ƒU@mUVƒšUVwœl°LVbnJVU™¯la@mX@@UWKXU@aV_V@@JlkUƒ¯@V™nK@km¯k„U@ƒWUW@mmƒU@™kmlU@wkL@WƒUkL@VmLƒJ@b@V@bknUUVK@UVKUK@Uk@Wa@LUVVnUbmVk@@UU@@aƒV¯K@U@UU@WmUL@aU@WV—w@ƒ˜I„xXll@UX‚K@KXXVJna@wWaƒ£naUKV„m@UU@mUmalm@@XkVm@U@VƒLmWU@kkWxU@@bVV@VkXVlƒVƒ@UUk@@ƒmI@KUw„m@UmVƒUUwU@lwkV@IUa@mUaVIVKVa@w@U@™UJkb@n@bmJ@XmlVUxWXkJmUkUUVW™xUlU@ƒaULUšmbU@@‚WXkmƒL@xUV@nUxÇm@„XLWbnlƒnV‚nnUV˜U‚nVVz„@lbUVVlULVb@V@nUJkwm@Ux@bWbUK@UULka›JbƒU™U@U@lUK@XUJmn™J@bU@UwWa™x@zkJWnUJUUVšVV@bXn@xVb@J™L™m@X™w@`@bkb@VmXUV¯L@mW@@n@V@‚ƒL@K—IW@@aƒaUx¯@U„m@XbW@@L„V@bnVWVkKUzlV@bÆa@lnI@VV@@LnVVKUaV_VJVbnU@bn@‚‚nX@yVIVxXKVLlUVaXU°J","@@@KlKkUUVVX"],["@@UUVUkUmV@ln@VXVK@K"]],encodeOffsets:[[[110318,27214],[110532,27822]],[[112219,27394]]]}},{type:"Feature",id:"5224",properties:{name:"毕节地区",cp:[105.1611,27.0648],childNum:8},geometry:{type:"Polygon",coordinates:["@@UkVƒ@k‚W@Xn@@K„KVIVVIn™°@nWVzšl@V„_VaVK@kKWaXklaX@lW@bÆz@KnL@ašaVJ@UVL@xnLVJ@LXKlbša„¥l@nUWk„wƒ¥U@VaXa@amLkUƒKmƒ¯kƒmkIUaƒKUIWƒkKm@anw@mlwXIƒmƒUk¯@a@amUƒ`kkKWVkxmUUak_mJmw@w„mXUW¯X›_@WnI@aVwkWWýŃU@WLkU™aUbVV@lUVVnm@kUmV¯™kK™LƒwmVUUaWV™aaWw¯wƒÈ@VULUVUUƒK@nWJkI™l@Umxnbm@kbUJƒa¯bUbVxmLUV™aU@VUUWxkVVV@bUV@XWbnlUbƒbUJlbUV¯b@z„`WbXnmbƒaƒwUwVWUƒbUxmbU@Uam™@Vƒk™VaƒwVaUƒWI@mUKóz@lUlÅ@WIƒb@xXxml@XklULWKUmwUa¯KUXWJkaULmKkLWbkKUVƒImƒƒWa@kUaULƒW¯LƒK¯@kbƒL@b™x@J@bmnnlUšlzU`U@@Uƒb@„m‚n¦°bU„Vx@bkVm¼mx@mk™mVV@bkxVn„aVV@bU@mL@b²`lIVV@lXLlš„bVxn@@bl@XllIVšnbVšn°°wlbXw@mVa°lVnU@mš™VLVbn@@b„@@WVnUV@Xlxn`VznJVb@L@bV`V@šUnwšU„@WUXKV@UUlmUUlaXalLšm„bšIVbnJVIlVVaUUnWVXn‚VL‚k@ƒnWnblnlb²x„xVKVXlVXLVW„LlUVJna@wVL„¼@JVX@`@nnx@nWJU@Vx@XXKšŽUblxUš°„LVKVVlL@KnbVUnJ„IlUšƒnKl£VW„x„IlJ@nšVÞUVVnb‚VX@V_°lnK","@@@UmWUwkU@Um@@VkL@V@„„‚V„VkV@nbVa@ƒ"],encodeOffsets:[[108552,28412],[107213,27445]]}},{type:"Feature",id:"5227",properties:{name:"黔南布依族苗族自治州",cp:[107.2485,25.8398],childNum:12},geometry:{type:"Polygon",coordinates:["@@‚V@IöalK@UV@@KUaVIVVœLlaVbVWnX@‚@LnUlxl@naVLXVVaVU„J@lUUanWWI„@VlV@Xbƒb@V„n@VmVVbk@kU@V›V@X„J@zn`ULW@kK@_WVUK@LUb@Jlxn@nnWlU@@b„x@XVVU@UbVb‚@n`VI@VVLUlUIUV@KmL@VV@XIV@@lVLVmXV„@WLXLW@U`šnkb@Vl@UL@VVV„L„llX@`lIXb„J˜IXW„L‚aVL@ŽXXW‚Ģ™b@bmK@L@°@Vnxmxšn„K@xVn@VkL@V™Lƒakbl`VnnxVnUlššV@@VVXV`@šœk°JV_UalK@U@aUU@m„IlVnK‚V@U@wnaƒw@akU@ƒl@nwl@XLmV@xnƒl@VXUb@V@JlL„UšJUI@UlWUƒnLVUUaVwV@XKWkXJm_@amKnmmLwlƒUIlmUwkKƒ™nwlI@aUaVKšL@bVJ„kVUU@@K„K@a@I™ƒ@ama@UUaV»XIVa@alU@WUU¯IWVUbkVUKWLUwUJ@zmWm@@amVUaUIU`VbULmU@KU@@UmJ@kÅb@akUVylLXUmU@aƒU@KX@Wan@Vƒ°@Vw„b@bX@˜J@L„K@@U@mX@@n°KVUnW@Ula@a@_šx@WšnšK@IUa@wWm@aUUU™VVVIXmlI@yšwXbVxV@@ašInmVI@WVL@k@VšV„V‚aœIlbVK@VVLXa@aVwn@lxVI@m@UUaVKUkVUkaƒ@UymUV—VUmmU„mmkXaWK@ƒÈnVw@mVU@w„KlnXW@V@naV™VKUk@KVIUWƒ@mk@KXU@Um@@lVƒk@UVJna@UWaƒL@a@ƒXa@kmmVUUk@mkkƒamJ—ImJUUmIm±aUUkambkamVUU@VlbUbVVƒxX„WVUU@VUakU@UmUV‚U@mnUVVnUbVJ@b—UW¥kLVamVkUaWJU_UVWKk@@nl„UVVJUXm@Vm@UnVlmbnmJUbULU@@UUKWVIWxnJVb@xUL@bUJWIkxƒbkb@xVJƒbmU@kW±LkKUkVa@a¯am¥ULkalÑlKXUWƒXƒaVakImVƒ@ka@UUƒJ¯aƒX™mmb—KWU@wUUƒaUa™KmU@UXlWb—¼WLUKUb°„UlVbkbVL@VƒšƒJ@nVlUbUXmJ@VX@lbUbU@@bWb@VnLVJ@bVVUz„ŽVL@lnL@b™VVVULmKUk™Jkbm@ƒxVb@V—kƒKVnnV@b@ŽWXU‚„nV„l‚VVXVJUXlVXbWV@VU@Ubk@@KWbUUmL@JnXV°XJ@_‚`UbkXVVlÆkbƒ@VLXVV@‚V@k„KXX@`V@@n"],encodeOffsets:[[108912,26905]]}},{type:"Feature",id:"5222",properties:{name:"铜仁地区",cp:[108.6218,28.0096],childNum:10},geometry:{type:"Polygon",coordinates:["@@°a@aÈbVUlU@aVKnVV„VUlyX¹lWVa@U™VƒnUVU@m™@mUl@„mÞw„@‚xnIVbna@KVI‚J@kwV¥ƒUXÇVkVW@kkKWU@aXUWmnIVa°VXbmL@VVbnVVVUb™VbšJVbVKXkVKVanU@aWnWUWa@U™nk@mVIVK@wXxlLXbVJVlKœbl@VI@mšaXalVV„VbX@@ašalnkx@b@V‚b@Vnx@bVVUXn¤WXn@Vl@Vlzn@š`@I@KUU@ƒV£namVkXa@aVK‚nnU@anVlKƒa@UUU@amk@»kƒU¯@aš„VWnkWmkImU@akaVm@»VUV@UKnkW¯XWlkUKnIWaš@nmlIXmWUnwUwWm@wULmaUJkIUaƒaWa—klwkwmJmU@bkJ@XUJ¯W@XbWbUKUkWJUUVKnn@UmmXUWa@mU@@UI@WmXVykwm@kaULWwU@¯ƒlKUUVU@mU@UkmaUbmV@b—š‚xVnVUJVnƒ„@Jn@@bl@@knJVblInV°@nx@„mbU@UWUbm@ULVVVb@LkJmXkm™VWIUJUXUKVwƒV™UƒŽkLkUƒ@W`Um™kVmIUƒ@kƒ@@a¯lÝ¥kmJUƒn™KƒÑmbUb@Wb™ak@mWU@UbƒUVVkLlbUVƒkXaWK@LkxÇmk@@X@J@Vƒ@@X@VUV@V„IWln@mbXVWXkKWbnxVUnV„ƘInl@XUxVl„¼UV@b@b@xlLkV@VmzmV@b@VUVVLXVVbVLXKmVVLU‚@nnVWXXJ@V›¦UK@LUmkIWbk@@lUImJnšVÒVUnVVbVIVĖUxV‚@bnUVL@WV@@X@V„KlXXaV@@bƒlVxXVVIV@@WkI„UVKUkVmlnnŽƒbllU„VbXVWbblVkb°ŽVInVVV@bšnVx@l@bnVVnUŽUam„UL@bƒVVÆUbUXU‚ƒn@šVVUb"],encodeOffsets:[[110667,29785]]}},{type:"Feature",id:"5223",properties:{name:"黔西南布依族苗族自治州",cp:[105.5347,25.3949],childNum:8},geometry:{type:"Polygon",coordinates:["@@VL@Vl@@IXW@kVUVbnW@XlKVVnU„VlL@b„aVbƒb@xX‚°ÔUxV@kbm@VxkxWJœ„V¦ƒŽ@ÈnšVKšxWXJmV@n„Ò@xVbn@@blLk`VX@bššla²JVUlnn@U±lw@wnw@mlwVIX@@m@klKnk‚a„KnwmmXkƍVm„Uš¥l@nb°n@„aVwVmVIVnI@a„¯@mšU°ƒl@@VnI@JV@UV@b@IUbVJmXöºƒzllUbVa@aXUl@„U@llLnKVaUa@UmK@UšwV„bnKV@VwVK@UXƒV@Vbn@‚w@U„WnX‚@„a@m„I„™@UUKlaUaVk¯ƒVaVLXK˜»XaWk¯mƒkğwmW@mIƒVkwƒJUIšÇVwU™UkVKkƒm@UkmU@WÅwm£Vƒ„m¤¯IkJWa™_™lUbmJzÝJk„ƒUÇVU„ƒ‚@bU„Ýn™m¯LUb@`mL@VkL@VƒUmmk@UU±Umka@kUƒ@ķymUkk@mmkÝmUaUakImV@V@VÅLƒ¦ƒJUXmJXšWb@n°Æœx‚¼nV@LlbUŽUbmL¯@ÞbV¤nbVx@bUVlblIœ™@KVVUnVJUn@VlLUlmLUUUxmK@I@@VW@@bU@UJmUkLVVUl@b@V"],encodeOffsets:[[107157,25965]]}},{type:"Feature",id:"5202",properties:{name:"六盘水市",cp:[104.7546,26.0925],childNum:5},geometry:{type:"MultiPolygon",coordinates:[["@@ôyVL@nXJV„Ub„x‚bUŽlšU„@ŽšnŽVbV@naVw„a‚VUXVx„x„bnaWmXaƒ_@y°aVUkaVI„aVamkXa@WVU@aUUlUXwVV@UVšbVUnKUwVa°a„bVIlan@manw@VšklJXI@m„LVVVUVK@U„ǃk@KUa@UkaVU@UVWV_XWVXVWlLXKlLXaÆKšwVL@akKm@Uwƒ@@XUVk@VUI@wWK@aUV™I@UkK@ƒmL™Wƒ@kImJƒUÅVmkXUW@UJkx@nmx@xkxV²m@kmUV±Ikb™™@aUWl_kK@am@Ua@wƒÑ@mnUWIX™wULm™@DŽU¥›ƒXIlwUwn@laU@Vw¯ÓW@w„aUaƒb@akKƒUmVUUkL@WmXUaUV@lWX@Jk@@UUKULmLUJmzkKmVX°VšUnWKUL™ƒƒL@mU@UnVJ@b@„UV@Xƒ`m_@l@@bmbXJmnnš@°˜wnn@ŽVLX@V‚@nVl@nk@@b‚l@nn°WlXzW`XXVKnUlxVbUb@‚V„Xb@Ž‚VxÈbVlnbmn@ŽkVUL@„ƒŽmLUVVL"],["@@@ƒ@UmWUwkU@Um@@VkL@V@„„‚@„V@VkV@nbVa"]],encodeOffsets:[[[107089,27181]],[[107213,27479]]]}},{type:"Feature",id:"5204",properties:{name:"安顺市",cp:[105.9082,25.9882],childNum:6},geometry:{type:"Polygon",coordinates:["@@lL@bUK™xÅLWbkKWLkKUXUWWXU`UX@VUVlb@VVb@L„l°xXx‚bšbXUVb‚VnU„xšKlL°šnUlVn@UmVU@kUUVašblVXKV@ƄXþlXUxnU@mVK@_@ml@UU„@šblU@KnLVyUw„@@UmkšWVw@UVK@VXzVK@n„VVUUW@kVJnlaš@nKW™kaWL@U—™õb@JU@mU@@_WWƒL@lUU@WUUK„@lakÅUUlWVa_@`WIU¯mW@InKVVXa@Ll@VaV@@UXUWakUVWUIUW‚UkUƒƒmVXW@@amUUm„L˜l@UUa„wn@lašIVlnLVKUUšU@amK@kUKƒVyUU@aUImK@UXa@aV@VakaW@@UnIVWVaUkƒb@mWƒX@Vxm@UaU@W„@VULUxU@mLƒaUŽ™x@VnL@VVbUbmLkK@kƒVk@WV@bUbVakk„yõ¹nWUIVa@J@aVUU@@ImJ@Uk@¯„™V@nƒ°@bmJUUJUnUxƒbm@¯Žmak@™¦ƒVUnŎWlnnmxƒLbmlkL@l@nWVnlÆU„VnIlJ„@šXnK@„lL@VšJVU@bXL@xVJUl@VU@W„@Vxn@"],encodeOffsets:[[108237,26792]]}},{type:"Feature",id:"5201",properties:{name:"贵阳市",cp:[106.6992,26.7682],childNum:5},geometry:{type:"Polygon",coordinates:["@@nŽlLX„VJ„LVblJ„n°ln„„LlVnKlU@nUUa@WlX@l„n@‚Vb„@la@a„„šlJ°¦„Kšwn@°x„LVkUmmwUmk_la„bšK@UlK@UUm@wƒL™mnwmw@U@¯@KnL@aša‚ġXWW@UKbƒKWX—JƒIWakJ@_kWƒkƒKUU@UVKk@@Ula™mV_X@WKXKƒ@WUUnUK@kU@WJU@@UnK@LVUVJVkUK@UUJm_@UaVaV@UU@Wƒw@aV@Xkmmm@kw@IVa@KVLXU@`lLX@VKm_@yƒI@WœU@UlVl@UanU@Uƒm@U„aWaU@Ukƒ@XJmXVbkV@ŽƒIUVUbWUUKmbk@kwmV@K@mWUXUakb›KUUUJVb@LU@@VkL˜š@VXKlbXšmL™@kbm‚UI@lVXUVƒU@mULWy@UUL@VUx™Xnl@Vƒ@VxUzmK@LkV™aƒ@VVk@@n@`UL@nmV@bmJ@Xœ`WX°WVƒn@xnxnIl`VbnVlwXUlLl‚„_nV@b@bl°„V„nWJkx@nmx@b"],encodeOffsets:[[108945,27760]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/hai_nan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"469003",properties:{name:"儋州市",cp:[109.3291,19.5653],childNum:1},geometry:{type:"Polygon",coordinates:["@@஼jpnr’``ŽpRVHʘ̤žZt^JÖA˜[†CâlTébQhRPOhMBcRSQiROE[FYdGNOEIH]MgEAMLLIAG_WMCSL@ED]PCLYC[ZIHgjSxJTMbHNEFCMEE_HSDFHSLECRNSFDRICHNADGPI\\RZGIJTIAHLDQOHG`GTNCOIC@eIGDWHIS[kiE[FMbECZS@KKS[FDWsCeRuU_DUQNOE[LKGUBM¨EDQP@HWHGDImXƒCog_~‹I_fGDG|QDUWKBC\\ore|}[KLsISBHVXHCN`lNdQLOnFJSXcUEJMCKSHOUMDIm_‹DI`kNDIGEYFM\\YPEEIPMSGLIKOVAU_EBGQ@CIk`WGGDUM_XcIOLCJphHT_NCISG_R@V]\\OjSGAQSAKF]@q^mGFKSW^cQUC[]T}SGD@^_ˆaRUTO@OHATŸ”"],encodeOffsets:[[111506,20018]]}},{type:"Feature",id:"469005",properties:{name:"文昌市",cp:[110.8905,19.7823],childNum:1},geometry:{type:"Polygon",coordinates:["@@€hIJ¤Ī¯LQDaFßL[VQìw€G‚F~Z^Ab[€¹ZYöpFº lN®D´INQQk]U‘[GSU©S_­c‹}aoSiA£cŁ¡©EiQeU­qWoESKSSOmwŸćõWkàmJMAAMMCWHGoM]gA[FGZLZCTURFNBncVOXCdGB@TSbk\\gDOKMNKWQHIvXDJ\\VDTXPERHJMFNj@OwX@LOTGzL^GHN^@RPHPE^KTDhhtBjZL[Pg@MNGLEdHV[HbRb@JHEV_NKLBRTPZhERHJcH^HDRlZJOPGdDJPOpXTETaV[GOZXTARQTRLBLWDa^QAF`ENUPBP…\\Eji`yºEvåà"],encodeOffsets:[[113115,20665]]}},{type:"Feature",id:"469033",properties:{name:"乐东黎族自治县",cp:[109.0283,18.6301],childNum:1},geometry:{type:"Polygon",coordinates:["@@ªVLP`@PEdNRAHOPEAKHEVL`GZBJfvdTAXNNTZJFPrHHNpKTD\\ILHbEVd^J‚OHLh@NNBnHP`\\xH@NBRLJTlŽNv_^CTLd@bNDVFbxdFV€UPBTKOGEOUO@OEBXQP[H_EI\\EbeYa@UO_J‹MEJ_IEDKJUGMDcNUd_FMTEJSGoZ]EIYGO[YW‘gEQ]a@WHEDQKUSDUGAbYBUpSCYNiWqOSQEoF[UcQISWWNMSDe_cLQ_UBiKQOOASQAWgS­ā]ZaŽSPÝZ]XMXSŒ[^oVËNgNKlE RôEø"],encodeOffsets:[[111263,19164]]}},{type:"Feature",id:"4602",properties:{name:"三亚市",cp:[109.3716,18.3698],childNum:1},geometry:{type:"Polygon",coordinates:["@@®ĂhTBXTRPBRPjLVAR`dKf`TC‚NXMTXRJVdE\\FpTRrPjXZMTDVoZABaVHTCLVCRGF@X^bFR’hZXP\\ZHHMA[^wBWXJlW¤EJ[bCTOF‹WWMm@ILMGWQ@DQ^QNWFSHEbF`OXNbO„VNKTEPDTLTCCVTREfvfEHNbRAENH^RJXCFHNFRpVGHWISDOTMVCZeGamaLoLÛD¹¹ėgsia{OųE—Tt‰lɂwr}jŸR±E{L}j]HąKÃT[P"],encodeOffsets:[[111547,18737]]}},{type:"Feature",id:"469036",properties:{name:"琼中黎族苗族自治县",cp:[109.8413,19.0736],childNum:1},geometry:{type:"Polygon",coordinates:["@@bRFnHNbHŒgN@NPEnbXP@bND`NT\\@\\QZb@`@J]V@XhžDpW„nCJGHGXO@CR§FANHVKLF\\MPVR`CvVfQtDPKpGHG@S`WJP~^dSTHWX\\RHTFACQTIAUPOU@MG__IaYSFQK‘NSbORHXCZeTFJg„B`YBMNMFi~IVDV[tGJWXGDQRGF]ˆJrALgESLSAYDGIaFeXQLS\\MKSLSQYJY}eKO[EHiGSaK[Yw[bmdURgEK^_kcSGEOHKIAS]aFSU@Y]IWFUTYlkP_CUOUEkmYbSQK@EMWUuAU\\M@EpK^_ZMDQ^OXwC_ZODBrERURGVVZ\\DTXcFWNIAWJWAYUUFYEWLQQaCIZeDM`cLKRGpanJZQd"],encodeOffsets:[[112153,19488]]}},{type:"Feature",id:"469007",properties:{name:"东方市",cp:[108.8498,19.0414],childNum:1},geometry:{type:"Polygon",coordinates:["@@ºŸx‹JYZQ”IŠYXLl@dR\\WZEn]bA\\S~F`KXaDeTiNO^EEKWEDQXITBXaWaDQMUJOIaTWf@NJV@dSxGZ‰Fu_@WMKAUˆ}AQ@MwG_[GOAmMMg@GKP]IUcaFKG[JSCoLGMqGEOYIMSWMSBucIeYA_HUKGFBLOFGPQBcMOF_@KO©UAtERadwZQ\\@ÊJÒgòUĪRlR°KĮVŽLJ"],encodeOffsets:[[111208,19833]]}},{type:"Feature",id:"4601",properties:{name:"海口市",cp:[110.3893,19.8516],childNum:1},geometry:{type:"Polygon",coordinates:["@@ńZƂtĢ¬æßFuz¹j_Fi†[AOVOFME_RBb]XCAKQKRSBQWSPY\\HbUFSWSPoIOcCOHIPkYCQ]GdGGIFQYgSOAQLK`MFUIGa@aQ\\GGUFcHKNMh@\\OYKAigsCgLSF]GOQO]@GM]HyKSHKPW@Pxi@EMINYREXWRQ@MQcFGWIAwXGRH\\yDI`KJIdOCGRNPNtd\\UTMbQYi@]JeYOWaL[EcICMUJqWGDNZEXGJWFEXNbZRELFV]XQbAZFrYVUBCLNFCHmJaMIDDHXHEhQNXZ_TARFHVB@DTQIRR@YHAJVnAbKFUEMLd\\c^ÍÞ"],encodeOffsets:[[112711,20572]]}},{type:"Feature",id:"469006",properties:{name:"万宁市",cp:[110.3137,18.8388],childNum:1},geometry:{type:"Polygon",coordinates:["@@^J@ZTVbET^JBGLFPTHld]`FLQhcVanx\\\\ZbLHTGj\\FLP~fIZRZPVTQFSVAFJE^NDLEE[~LjsxVTG\\NZZNGlLRRGLJTV@hPZANN^@T\\NEPPbDZXO`d^HSvcJDIV\\XZAJUFCLNP@PQ¤@[ïKLÑIÏ]ÇE±I{uƒ­YśUćFcYUmsVeBSVgB[RO@aYYPO^]@UVaNeDShMLG\\EfFVE\\F`"],encodeOffsets:[[112657,19182]]}},{type:"Feature",id:"469027",properties:{name:"澄迈县",cp:[109.9937,19.7314],childNum:1},geometry:{type:"Polygon",coordinates:["@@T\\GJCXJH@fJDDPNCNJENN^NLHBNSx@DDYbBLLDRbjZTj@`XXTlG^Xr@PJLW\\WLTlWR@HDJTD@X_PO@STMDNTMVV@NLDM`M\\XM\\JNBH[PYZ‡úYzŸ`Ċ\\ÎÝd]c[NKVFLEBaUmBIZGQ@JQSR@CUAEGBQ`SWYRMFgWGCGJCbNnIDGMEDKVAZUEqBYRa^WEUFKYQMaFWXEHIFWMYHCrXVIIiaK@aMCUYNSIISTwXALKH@XWXIEIJQCG[IEQDE_XSBaa[AIPW@]RS[FWS[CD]PEBYNGFSaSyJG]@ugEUDQlGHiBKHUIoNSKqHFaPMICK]UUHIPDJMuCA[SCPIDIOILGAEmU[POPBVSJDREBGS[QXWSGcT}]IO_X@TGHoHOLCX\\ELT@LYTD‚aFENF\\lj"],encodeOffsets:[[112385,19987]]}},{type:"Feature",id:"469030",properties:{name:"白沙黎族自治县",cp:[109.3703,19.211],childNum:1},geometry:{type:"Polygon",coordinates:["@@D\\RV]dTXELnHr]^@LETBBRTHPi^[@U`QTHDJ`MGSogDIPKdJ`WVNHCXHl_DJR@AH`FBVPUJLHKNTJOFFZON[ZEHFCJlMJ_ŒCn`CJVNGPLTNDFIdVTWEIPmRKMc_kDMWGGUTAtJLK~\\f{pqD[LAVXRCH{HC`eŒJ`}@W^U@I@_Ya[R[@MSC_aMO@aWFmMOM@‹haGGMEmaQ[@MESHaIQJQ……MckBIw[AOSKKAMPSDSLOAV_@@`KJRbKRDfMdHZERgAWVsDMTUHqOUr@VQXTT@Tƒfg‚L^NH\\@heTCZaESNObHPƒHeZF\\X^ElM^F^"],encodeOffsets:[[111665,19890]]}},{type:"Feature",id:"469002",properties:{name:"琼海市",cp:[110.4208,19.224],childNum:1},geometry:{type:"Polygon",coordinates:["@@TP\\pATHTGlZDJGAQjE\\Rb@jVBDCN`JZ[NCNHNXbULPrP\\KNbMTLjJJRFP`“pNLZz^FLRHjVPZ@hxVKbHBHMNNJFRlLzGPnNHhIrHHADcPWdUAmEMVQDSKYHY\\EhBN^HpXGNDBNNBnIß‹Å_g{³So]ã@ORO@KMEDIVYB[WJUICudGTc]P_YWaCOOMFS[]@MMYBgOU@ISHKQQkKMHYY[MSHwUit}KF\\KFMCF]EIUBETSROUKTLT[NKTWREfJbCHBZKTFTKh"],encodeOffsets:[[112763,19595]]}},{type:"Feature",id:"469031",properties:{name:"昌江黎族自治县",cp:[109.0407,19.2137],childNum:1},geometry:{type:"Polygon",coordinates:["@@`ZĤd–`òüˆ˜ “BSPGP@VSbQ`‡@]HC~T^SE]N]FkW]E[fY„GGOPaTMbFDYfS@g[MGK]h„e@SSSRW@UVqrPVGNStCXUhBFQGYNcCeLQQaLI@_`@EUwcEaCUaMc@SK]Du`MSkKI‡~BVNL@X`‚EvYŠwHcTU@MIe@SXJbIPNVCRXbWbSAWJCRXFFL]FMPSjCfWb_L}E[TaBm^YF[XcQk@WK‰Z“JYRIZwŒ¹ "],encodeOffsets:[[111208,19833]]}},{type:"Feature",id:"469028",properties:{name:"临高县",cp:[109.6957,19.8063],childNum:1},geometry:{type:"Polygon",coordinates:["@@jD`hNd\\^dZädĒH´Op@ˆùZY\\OAGIMN[[W_NCNMKU@NUMSNCTSP@`O@WSCCI@GXQSkXKX[IK@OWqH]SkWW@_SiiYQaKCAKZaCCw@MTGAMKM]FMMIMDSM_HGHRPKCBGSJJIYH[QOJCHMBDGQJECMTDQKFGTCEGTF`NFEDMFaGSNwIiTGhYJD\\KZODC^@FTKND`XBHKJNKFBNhG^FJMPcHEZF\\QPRjQTAdgNOPgQaRSê"],encodeOffsets:[[112122,20431]]}},{type:"Feature",id:"469034",properties:{name:"陵水黎族自治县",cp:[109.9924,18.5415],childNum:1},geometry:{type:"Polygon",coordinates:["@@R]NC`YL]FoN@V[vBXVFNL@TRZalnVFVP`DlOZkVSXEE_F[EUFeH[NKTgfCbMVU^@P]ZObZP@\\QhATUfAtUasñiāEoI]eYǯ@aKmaeƒWuCºKÜKpnbHbYfUDSNCPJTRAHJTDJSfDNLHXC``VBNGTYCQDIXMDSP@xLNEFRNXBIpVNLXah@RgF@`qOML@LJNSPLbaHAh@Jdj"],encodeOffsets:[[112409,19261]]}},{type:"Feature",id:"469026",properties:{name:"屯昌县",cp:[110.0377,19.362],childNum:1},geometry:{type:"Polygon",coordinates:["@@\\OnVBFKHPJCJOJTDB\\vDINOCGJVVL^JDONEbrGTLpMVJLGjAHGRkVChF@vH^zIbTETMHAZOFC^\\DXT\\EffAP\\PdAV@UIYfS|S@YPICMeM@sC[_A]VQEwyHSMuNcAUlQJMVGMS@mVBZPFO\\CSFQK[LqDMACiUa@[QiFBRIHYCHkGSBS[oSOqB‡IE^QHCRWHIXsHU\\UC}JEjMNAN_ZƒAIhSEYfWDQGaPMTL’ERZTJb``NHV@"],encodeOffsets:[[112513,19852]]}},{type:"Feature",id:"469025",properties:{name:"定安县",cp:[110.3384,19.4698],childNum:1},geometry:{type:"Polygon",coordinates:["@@JjDNdJ\\FbKPXfZ^Ij@RZNaVSc[MsMOHQPDJcLIJ_zCG[HQxWJBHXdENRR@XQFWZQQGOFSWUCI[WCJuRGLXNMPLhCl[Ta@SqGgJMGOmyHkKEQMINMAGaGULgwY@UOGiKQ]EYyMK”oO_QEIIKiNSMa[LqOKOaVMWMGMDY\\_IKrL\\ERT[DEPYOUA@nNTUHINkRBVMdNvGTxzRF^U`BD\\@tfNDNOJ@Z{TeTJZ@VU€cB[OBOeeQT@^OXBJb\\AbWTF`RCJFH\\RDJIJFXW@WLGBKxWTSJJMTVZND@bbL"],encodeOffsets:[[112903,20139]]}},{type:"Feature",id:"469035",properties:{name:"保亭黎族苗族自治县",cp:[109.6284,18.6108],childNum:1},geometry:{type:"Polygon",coordinates:["@@FJp@fxpQ\\ApN\\GNPNBM`HLMrXLXj\\PEHnI@WUCEM\\GTc\\GZYHTPBHRCPTd€H\\K\\@HXi–BJILJJAVNTOZJNtFPC`YxDPWci@IBgbGKaTOIM@KNKrP@_hE@QbgKWUMJoWAQMFEKM@wTONCJWRCZDHSAM_UD_GWMKeCITSCGIQBGXUHQoMEEGWDQIG]FMQBMaFGueFeSQDUSDSKOCSFMLƒUaPWM_PaEGFETMX]RCRR@HXKN@JNnXXEŒSPaDI\\£FkXWIAX]xB\\GN"],encodeOffsets:[[112031,19071]]}},{type:"Feature",id:"469001",properties:{name:"五指山市",cp:[109.5282,18.8299],childNum:1},geometry:{type:"Polygon",coordinates:["@@TCNOLBTLBPx\\AJdl†NR†RIbJTGNF\\@RcIYbmHoLQdKN_fCJYbDRRXKZFVEZVXBXIJBXMdESW[CUYHUVQFQAqsEIMPYMSBUIIJKAIj•GW[@[LGScDOGQOAGSYZ[HSd[HFNVD@XmJFG[OWiWKNqGKN_MAMO[HoM[BoRewo@Y^HpITSFENc`MVCdHNIVCLJFI`NFIŒP`@VZbaf[FFJG`O\\WRFA@PVPFPPH"],encodeOffsets:[[111973,19401]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/hei_long_jiang_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"2311",properties:{name:"黑河市",cp:[127.1448,49.2957],childNum:6},geometry:{type:"Polygon",coordinates:["@@VÈÞ@Žkx˜nXŽ°VÈa°V@kôw„b‚š„JVškXlVUx„„@ŽlL@xkVV°ƒ„VbxlVUnVxk@ƒ„ƒKkŽVb„Il„@°kVl„@„™lÆnkll@@V„VXƒŽš@V„²bUlƒVlV„U„VÇn@nkJšŽlkVbœ@›x²V@n°VUnlKU„n`@n°bWLnVUblVUVVbknV`°kkŽl@@V°@nz„J@XšxlWXb°n@bƒĠlbXb™bVbƒJ@Všb„a@„„@lbUbšVmnœ@lšVmnIW‚œ@WbÞ@„n@x°@š„ĢaƐéϚnœ„‚lČ¯ĠŻÈwm@ôçU™mm£Xy°UV™›@wÈ£Ǫ¯kõÝçUњ™Uķ‚ƒĢkVфÆšÞU°nŎ¥ČUĊx°m°¦żVƐœx°ƒÇ£@y„UônރÆ@Èĉ°Kô¦šW„kWU—bÇ»@™ÈĕWÇÈ£ŤU@›n£ÆUUKVamanwŃmÝJ¯k@JƒIkaVaUUÇbkaÆÑkWmÝUۙ™Ý@™ƒwnU±ƒ@kkV¯KUkƒJƒ¼U¦ƒšÅ@ówķaķůV¥Uaó@Åwmƒƒ_kVƒwĉ‚ĉmmn_V»™a@U™ƒVwķóƒ‚U¦LǫéóXÇmōLǓÇķxÝkƒƒĉ™kmakbUĶ°@W¼„@bƒšÈÆ@Ė™L„l@„°J¯„mkl¯L݃±L—amJ@¼ƒ„™VƧUó„™UX˜ċb¯ńVbkÆÝI@llx„k°V²šV@Uxގ˜L@b„@b™`ƒšÇzkókݤ@ğ¯Wƒ™LĉǙLmmnċVkbUaƒL@Ž¯„‚bU°ğL݂Ý@"],encodeOffsets:[[127744,50102]]}},{type:"Feature",id:"2327",properties:{name:"大兴安岭地区",cp:[124.1016,52.2345],childNum:3},geometry:{type:"Polygon",coordinates:["@@k›ƒϙmƏêġb™ƒ¯@@wƒmÝ@XV@IlŽl@bUxl¯VlV™bV@ULVlUV™_kx™VVV™ÈÝJ@„¯šU„™lm¯x@xóÒĉ¼m„¯Wƒxţ@Uz¯ƒWwnUwťƒ@knƒWƒ£óVƒUUwğyó¦WI—Vmm™I@±kwÇ@@bƒ@ĉ¼ó@¯wó@¯aó¼›KՃaUwmWUwÅI@aƒKó@Ua™LƒaƒVÅwō¼UUÝl±I—¤VxÇx@zkJmnn‚mbnz™xlŽƒl¯ČkJl™°@„kb„Žmx@x™@kêmVnŽWxôXšxU°„bWLóJnÇWĵ„V¦™ŽƒUUb™b™ÆġK™šk¯™VU±aXmċÑUwĉKġ„k„™ŽVxk„ÇKkbƒIƒ‚ÛXWl¯bƒŽ™X¯K™bĊš„„ÞVƚnŽĸ²lxUŽ°n°òÈb‚¦—xVbƒŽƒ@¯„Vx@¯VķÞČlĊ°KĸŽȘI°¤ČIôŽò»ƨnȰKǬ¦ôWŎÈƨwlƒnKVXmbX`lbšwkVW‚XXŽ„L°a„ƾaĊ£nƒ°@°¥ŎzÞ¥‚»œalwôkƒJ„a@ĶK„£„bU°ĊxźVÈUĠ¥ƨ™VI@XU°x°Ln¥šw°UmwXm݁V¥ĢŽ°@nU@mÆ£š¯lKœšÜw@aÅU‚¥UaÝIkmV²‚nn@Ķ»@Uk¥VKÞ@ÞÛ@ƒkVmĢa@_ƒJómƒǖ¯Æw—óÇa@alƒUwšwĢřšk@wÆWXUWXƒWa™m@_ƒ»ÇéXaĸwVa@ÝKkUWkX‚kšKXxƒn@lĊV@¯m¯nřÆwš¥"],encodeOffsets:[[130084,52206]]}},{type:"Feature",id:"2301",properties:{name:"哈尔滨市",cp:[127.9688,45.368],childNum:11},geometry:{type:"Polygon",coordinates:["@@°`„_šJlUšŽ@„„@V¦°JUšŽnLôlnŤ@@šÈaUÒVbkbl¤ƒzk°ÇVÛô°IlVUVôU„xÆU„Ž@bźĀ„º@¦šb@l²‚UVlœ@°ÒĠxšnXxÆVô¼Þ@Üx²KލlƒVÑ°UȰôlwô@²ƒĸ°„lanV@„šVŎUll@bÈnÜm„wĢ@la@ÝÞb°UXb˜lŎ²ÆškšV‚I@ŽnJnĠŽ°knƒÜbĢwna@a˜kÞKƒĀ„a‚™œ‚‚IVbU¥wĠwkô˜xnLƒċVçkaUƒ±IUmnġW„°WôĉšalƒÞÅĵ¯@W¹XÝaƒb¯a±X¯ºLƒaVƒmkLóƒƒbkaƒVUKVkkKV_@aÝykk±L@ƒÅU@yV_™aU¥ówÇx™@UkVƒn@lƒkÅlwšWVwUkĉmkklW@šašbVwnWWƒ—wWL™™@Ušƒ™UƒÇLšÇmƒ„@wƒJĉƒL¥@ƒÝ_@a¯y„UWw¯ƒ¯Uġx¯aÝXVmaU£ó±›¯nwƒa¯óÅVƒXman™„Uƒ›lUXkWa@mkI„›ğaƒm™IklÇU™„kĊƒƒzkKƒš„lU„ōĬlš™„@ŽnX°@llUxŹ²mKĉVWwk@UbUK@bmVmI—ƒVmwaWxXlWȁšmºšÞÆbUxV@ĵńWÆĉLkWUbƒaWzkbĉ`U„±LklōwUVÝ£™UW`Uwk@mk¯VkaõVX@WbL™K@XƧºWzxƒK@lmX@bkVVÆk¼Vbk@Vn"],encodeOffsets:[[128712,46604]]}},{type:"Feature",id:"2302",properties:{name:"齐齐哈尔市",cp:[124.541,47.5818],childNum:11},geometry:{type:"Polygon",coordinates:["@@Þ@ށĠKV¯a°ƒ@„KVblaČU‚mnnšKĊȚKX„°ŽĠ@Þ£ôllÈy„™š_@a‚ƒ@a—KݍVwU@±™¯Uƒlkw@kÞJlÅUa°ŃČaW—šVôƒƨVšU„ƒ@»nI˜b²Kބ°Klkn°ƒ¯I@ƒƒkšK@ĕÇń™@aƒX»¯@VĵlaÿVamI@aÅÝउýƒĊȗJƒôȁÅkmƑۃ@kxġ@@l™aVk¯»ƒīŹaƒkƒ¥Å¯™JUaWU@@w™aƒ»„KUkÆkUm„UmwÛ±±UUbUŽUXƒwWwÆÝk™lkUanaWwnKl™kal¯ka™ƽa›kÅx™a¯@™amb¯V™lÇwÛĀ™V@x™šmêVƜVV‚aôV„wÈx@šˌx„¦VÞ¯VšlmX@‚ƒL@¯Ua¯LmV@„„°X„ċK™V™ƒ@UƒÈ@‚¥@w—ƒġIU™km¥Źwƒ¦¯lmn@°kxVV@¦óam„n¦l@nx™lĉVóšmx™n™ÒĉĀĊ¼„þ„šǔêÞ°ˌĠÞÒ°ĀɲĀƨźˤȤƨĊ°w@£nymwnkUUV¥ôÑVmkÆmUUVa™mVIkmô„lxkXÞþƒbl„ƒl@kV„ƆƒV„xV@š¼VÒ@šŽUŽšnnނJ"],encodeOffsets:[[127744,50102]]}},{type:"Feature",id:"2310",properties:{name:"牡丹江市",cp:[129.7815,44.7089],childNum:7},geometry:{type:"Polygon",coordinates:["@@U`lLUlVL„Ulb„aô„lKnŽU„„b‚K°¹²W°b„aÞb˜knyUlUkamř²L@m°@lšmš²n`ôÅlK„x„ÜKnxV@„l@œƒ›ÅXyW_k@™wm™ŹĕmƒX™»‚ƒÛ™l°ƒôšÈ„»š—ô˜ô_WW@Uœal»šwU@@wšUVƒš@VƒXI@w‚Ģ͑ÞȻ›aU_@mUkly@¯óV»XmWUXUWmnm¥nUUaWLk»Æ²IÇa™wÅaÝ°¯nUa±a™ƒ™@¦õÆğ„@„™@Åb›xU܁nÇłlb¯¦„ôó»mƒ—@±ƒUk@Wwƒa¯xU„V°ƒxXbǎŁUV™™ƒK@¹ƒKUaȯ@ōݙXƒal™ƒlÛkalÇUǫÇńÇakbÝƆ¯nlš¯Ž@¼™VUx@x¯W¼™Æ¯šmĖ„Ĭ¯ČƒVk‚ķÅmxœ°ô²V¤‚bUnÞW°bĢw°V°„XxƒV°z@bÞ`@„‚¦„KĊŽ„I@xƒŽn„™ÈÈK‚„šV™„@VššXK˜xX„mXUx™a™b@‚kXllĊnVlUx™XkxlÆk„m@U„Vlš@ÈwôxV¦šbU`@zÆV@„²KllÞz@b"],encodeOffsets:[[132672,46936]]}},{type:"Feature",id:"2312",properties:{name:"绥化市",cp:[126.7163,46.8018],childNum:10},geometry:{type:"Polygon",coordinates:["@@ऊþÆÞ@bnJUb‚ĀnblŽĊš„„ÞlĸwǔÈŎKÈnôWǬê‚KV¥„ĸôUxš„@VšbU¼m`nnĊŽĊ„xlUšmkaVÿšLšwš@°»UmbKmݙUšwUmVknKUUl¯ƒKU™ƒUȃ‚™nK@ĠkX±lX„°„L@¯¥@wV_m›ĵ¯Ww™L¯ƒUkōƒÇVU™l›w—V󁱃¯aƒVka°wVk°mÞ¯Ŧřƙl™²™Ŏk™U@ƒmUkb¯ƒķŽ±„ó@kxȯó¯VUÒk„ÝŽ±LÛwÝ@ó»ÅUWw™mğw¯Ñ›@UkV±@k™a@¥ƒ¹Źÿ@aƒÅVƒwóVVUkU¯JÜóÈUl¯„yk£laUaVÑÇb@™ţ@kmómK™V¯IU¥ƒ@@ƒ™kV™Iƒ`@ô™¼„blU„lƒ™bÈb@xÇKkĢɳaÅɆō@ƒŽVƒK@z™@@¥ÆKnÜ@@aۏUw›wnU‚ķ@ƒ_ƒV°Ž@„klVššnULVVÞbVl@°™@nx™n°LŚÆlV„ȃmU²@VmĠLƒx„n¯xkWƒzšJ‚wnLmbXbW°šÆ‚™²™@™Žšx@JVx„L‚Ā²Æ°I¯º‚È@ÒnÈ"],encodeOffsets:[[128352,48421]]}},{type:"Feature",id:"2307",properties:{name:"伊春市",cp:[129.1992,47.9608],childNum:3},geometry:{type:"Polygon",coordinates:["@@ƒKƒ¯kWW²ğl@ŽmLšÇ„„VVš„Lk°VVmLUlVn™xšVnނLnaVŽ¯¼™@™x™KUĀlb™n„`n„Æxô@VbU¦ĸŰĸbôxÆ@„™V¥„»„IVl°LUŽll@²„mV„x@ššÞܚÞVnŽlXÅÒlbÈaVVUblb„J@I°lÞIn‚Æ„mxnbUbVLÅVm¤@œţVǤXÈÇĖ@šÈ¼˜aXVÜaXbWŽnzŎašř„KôbšUlw@¯naÆKnUU¯Üa@mkkVUĊm„™żÝ‚ǖŽ‚K„™°L²lÆI@ƒ¯¥ĉƛVaÞk@ÝVaĠlnUVwƒœómaƒ@™wĉ@™a™VƒxamX@aƒ@UaÅLƒaVWƒ_nWm£nWm_ÅV¯ƒm@m„󤁚ݦƒ¯ÅalmX£ƒ™VWUŚw™mÇ@@IV™„WUw@ašI@„k@wŎ»Wƒ„ƒ™ÅVaœK›Ika@¥lUkUlwÅwVyÈwWU@a¯U°m—Ç@UçƒaVa¯mV»ÅwÝUlƒUk™V@k„mUk‚X£šw°@@ǃaÝIƒƒam™Ûam„¯lğmmI@J™U™l±ÅōŽ—kWa¯VÝa@Þkbġ@ƒxÛnÇm@akkōVōl±škšÅšťŚÝ°¯nUl¯xlb„U°b²„ô‚˜Uœxšk‚VÈUŎ„Vl°„šKXxĶ°nœU`@x°¦@"],encodeOffsets:[[131637,48556]]}},{type:"Feature",id:"2308",properties:{name:"佳木斯市",cp:[133.0005,47.5763],childNum:7},geometry:{type:"Polygon",coordinates:["@@nš„b‚„ÞJ„b@ȯ@™xW¤Vlƒn@lšUVlk„ÞVÆxU¼°nUb„bVèÈ@˜ŽnIn‚@šĢmlUw°™żƒ‚VUn@lnL@VôbšwĊ‚lœ„JķĸĢl„wôwƨxVVUƒŦšxšLź™Èš°`nnĠwŎJސĶwôJ„@¤Xn܄ĸlšn°¼È°lŽ„„Uš‚b„xš@„l@ÞÞÈm°„lôwšL°¼ĸ‚°Þ²nĠ@ôwÞ`ŤI„V„ÒĠU„„@„VJĸbƄ²@°ŽĊKšœ„JĶaĢȰ@ô¥°nš¤‚bČUš@Vx„mUw@a݁ţƒÇ™ķƒ@ĕķīU¯²@ÆmVÑô¯X¥ċç@™ĉ»U¥ÝţKWVÅkUVÝŎUmǍÝx¯aķxÛUóL¯a±óōb¯™ƒÑŃVÿƒ_Åķ„a@UƒK@wm@Van@UmmLVa—@VImmXUWƒÝUřƒKUwÝUUƒkVƒk@l¯X›‚Å_ƒJ¯k™Jm„ÅLƒa@¥U@¯Vƒz¯@ƒ`@¼šmxƥšŏKÛk@±laÛ@@Xm@™ƒ@xƽ@WŎnšˣĕÅ@@aÅ@@nÝbǏ¯@ƒ_U›kUWƒkb™wÝU@ç„Wlw@anIƒ¯lyœX°m°VšašÛšm@„mVwÞK°ƒšXlaXmm_ƒ@UƒkwÝK@ƒVI™ƒXmV»ƒI@aƒ¯ğW™bġaU_¯JU¯ġŽƒ„ĉ„k„ō`±nÝÆk„™bóĊ¯Xƒ‚ĢX‚mVn²JV„lbUè„ČmK—wlóğx‚xV¦UaJ›šƒbƑÿÝL—l@bmbġx"],encodeOffsets:[[132615,47740]]}},{type:"Feature",id:"2303",properties:{name:"鸡西市",cp:[132.7917,45.7361],childNum:4},geometry:{type:"Polygon",coordinates:["@@‚LšKVVnkšbVšÈb‚²U°VnklVlaÈL@anU°ÜmXV`œnôLƒèšxlŽšLX„˜L²ašVVmÈX@ķ˜lnU„Èl`ȹš@ŤŽ°U@x„KnnV„mlnnUl‚lVnnaŎwlVÞ҄@n¦šLVŽ°lšwVk„Lšaގl„n҄š@xmLÞ¤Wnœ¼‚WÈLVVUxlÈô„„WVaU_VKšKXUÆbn™‚nôK„bÞw°bÆWXamVwœK˜™Uw¯WUk„UlJUwVUa™@@kmyzm›ĉw@kVwškƒW¯ÅKU_Vmƒƒ™xU@aW@@kK@w„a@Kƒ@@kVUƒaky°_Vm™kna¯K@™ƒL™wġk@@IÇóX™ƒwVakmV@mwXUWanƒlĉ@ǙUw™KƒƒóšܛNJۄm°@›w—Å@ƒ±b¯Wƒ¹„WVwŹĕ¯kVmōb¯w@aƒwmV™UUb™V™IkaVwķ™xk¼›b@VXXó`󗙘ƒ¼Çó™¯„kŽÜš„š¼WŽn„źĖnššxl@X`WzœÆ"],encodeOffsets:[[133921,46716]]}},{type:"Feature",id:"2305",properties:{name:"双鸭山市",cp:[133.5938,46.7523],childNum:5},geometry:{type:"Polygon",coordinates:["@@™UƒƒUwó™mÑÞÑUÝÝUkmmŃyV¯ī„¥ƒUÿĉ¯mÇkaWbÅX¯aÝxƒaóLmmšÅaWV™LULV`UbƒXóƒkÇVwUUÇKX›»XmÝ£nK@wƒ™mÑkƒÝ™bƒKUl™x¯kU™Km¥ƒ@ÝÑkUōxmbUmkVkmmnkUƒmmƒL@w¯Vţ™@Ǻk_ƒÇmV—k@ĸVx‚VÈ°lLkllšUbōwƒnVW¼nlUx¯XmWUnÝ@™xÝUó¼¯J@LVbkJWnkb™W¯„ÝLUxƒn@‚™n™Ü™b¯U¯n›Wkz„°mJ@bkxƒX@èÞVšxlaX„lVVœ„`°@ȐÞa@mÆ@@bÆ@ˤĖm™Xōƾ@@wš„n@@WÜ@kb@²ÜlŐLƦ™nw™@»„_°@„y°UV@@¦„bÆKnƒšI°l„IÆ`œ°W@k„llUV„ÞVVx„LƚÞVX„WVnnUJ˜@UbnKVnm@Ubn@@x„L@VƒbÆĸ„`UĀƄ„Ò°šŎa²ô°bôKÜVĸw°bÞwȎVnÞōVUÆlXU"],encodeOffsets:[[137577,48578]]}},{type:"Feature",id:"2306",properties:{name:"大庆市",cp:[124.7717,46.4282],childNum:5},geometry:{type:"Polygon",coordinates:["@@mÇ@сǰ¹¯J±ÅÿƒKUw‚I@™wšš@š±Å‚™X¯WanamKx™I„ylX°wƒm„wğKUn±@nVDŽUƒÅkƙ¯Kšmmwš@@¯UkÝaUUVK™mU™lk@ƒ¯„U„`ĸ@V‚mœxVxܐ@bÛ@m‚ÅL@¦š@@y„L‚U„Ŏ@ÆɅɴblġÈL@wÇaša„ƒkkVƒaš»@ó¯_ÝJ™wÇaÅXny›U¯¥Å„@w™bÝa™Lmm@@ƒVUŽlbğVmš™¯Xƒm_ƒ`¯_Ux™m™L™a¯b@mƒaó¦Çk™¤V„@bóJknVx™VXx±aƒLUbVxkLVlLWlƒ@nX@VÅbWlÈnƒx„bWšÅbmŽ@xœbml°b™„XbW„XVmnn`ƒLmšnbmb@šk@mwU@@š¯Jlbk°lbkšmLXxmbVbkllšÅނxX„xVWVVa²VܲnxƒVVnÅlVlƒL„¼šb@xV@XŽVbšIÆ°„¦„lźb„Ĭ°¼Ulšb@kĢ@lw„@ƒÜlnȂƄóȘI„ĉ"],encodeOffsets:[[128352,48421]]}},{type:"Feature",id:"2304",properties:{name:"鹤岗市",cp:[130.4407,47.7081],childNum:3},geometry:{type:"Polygon",coordinates:["@@Þ¥‚™ô£nƒn@°„ÆUn`mXn¤mX„`UX„bÆKVb„@@bnW‚b„wšUšbĊ@šx„@nbšWVmƒ_mm@ó»Um„ŘWXkĠ»²¯‚¯nķšwŎ@ĊšŎK°bĸUnјKȦĠÈbÆknJššÆUĢV°IšŽšVƾƒwaV™ƒƒkÇ¯¯»™mķkۃWm@£ƒóIĵxݏōIğxmm¯_ǙŹš™K™wťŽ„UVUŽƧwóxƒxġkĸķƒIk›ĉ™xóa@UmK@kVmUŻ„¯šVxkŽġn™‚@mmJ¯n°V@bXVÇxUzÆxkxlVkV@¦lbœJ›LUbšÆƒ„X„ō¼@xƒl@™J@bVxƒXUš@JÈ@šn™xVÆUXš‚„W¤knÆb„°"],encodeOffsets:[[132998,49478]]}},{type:"Feature",id:"2309",properties:{name:"七台河市",cp:[131.2756,45.9558],childNum:2},geometry:{type:"Polygon",coordinates:["@@²mŎ_lƒĊƒ„ƒĢV°°IV`ĢbšaĠX„°@b„JU¼Wnš„UJ@„ÞLlxV„„@n`lIUa@K°Iô»ÞVšwÞ@VmnX°WVwmkX»‚U„mŎxVak™lkkKǯUUwÇWUn™U±b—KWƒ™Kk™w„çóK›mU_nW¯ÛmV@bÇKkbkUml¯U±VÇaU™™amlUU™LK›„k@ƒU@mwÛLƒŽƒwkLóÆm_™±™nkŽ¯@@n±KnŚlbkVV‚mz—lWXº@Ķ°"],encodeOffsets:[[133369,47228]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/he_bei_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"1308",properties:{name:"承德市",cp:[117.5757,41.4075],childNum:11},geometry:{type:"Polygon",coordinates:["@@lLnlmxn„„IVVlUnb@VVxXJWL@LގVnnV„J˜_@wkmšK„b‚x„wXk˜WXXšKlb²K@nVVVb„L@WlU²„lKVnUJVz@VVb@lżmVUVnbôaVX@°Ub@lWbXš@b@bVb°x„@VxÈLVlšaÆ@Þb²k°@lVUŽ@Xn@VW‚LXb@¤VXšKVVVLnm°_ƨ¤@aUIVa„alkX›°k„™V@„alwUVy„U@k󙰃na°UVUUmUÆw@mkLVUƒWVI„WšLnn@xlVnK„myU@ƒU°UXaV@U¥ƒU@Uƙ@aVUkWU¯ƒaU@WLUV@bkbmKULmKkUVUkmVIUwlWV²™Uml°U@W„LUwVm@UUK@_ƒKUUÜaXw@ƒVKUU@mVIUUlmnIVVVbÈVlKnbVKš@nI˜@nVnwVLVK„K„„˜Vnb@aUIVW@In™°@lVnIš@lWĢ@°UVL@b„@VyUUƒa@w@WUnU@Wǯ™K@UkkJWaÛbmk@mVaÞU@amkWƒ@mXUKkÿƒ£@a„kl@Um°UXwla„al@nmlXnW°znW@aƒwV™@ƒakbĉ¥VmU@ƒIƒVƒUƒJkUmWU™KbmkUaƒKkUVU@KV@@klw—™WaU@kmƒXVènbmlUUƒKƒX¯JkbƒI@JmIUWU@ƒLml@XkJ@U™kƒK@aVKwWa—IWwƒmUƒ@mU@J@UaċU™aUUƒVkI±ƒk@UUƒ@UbVVm@UVKƒLƒlkIWaULUWƒXUJU„ƒ@WbUb@lkXUxm@@JVn@J@b„nƒb@Vkx@bšLU‚Æn„JšaVXnKVVmzX‚°V@_lJXxWXƒK¯bÅamUƒ@lUI›bñJ@LÇKkIÇ`kxWL@„ƒ@@bUVUb¯xWKk„Å„VlULW@ƒŽn¦Ul@I™lmUUUVm@kWƒnkKma¯XUKWmnwVwÝL„mŽ™VUbUVWb@Lnxm„xVŽmbXx›¦@„nb@`™„ƒVƒ@kbƒLU„mVUlkbVXkºmnm@@xk¦šbĢÜlš"],encodeOffsets:[[118868,42784]]}},{type:"Feature",id:"1307",properties:{name:"张家口市",cp:[115.1477,40.8527],childNum:15},geometry:{type:"Polygon",coordinates:["@@k™ġۙal¥@wn@nml¹UWlaVknUVƒ„Kla„@„Ušƒ@_ma@ƒœ¥WwnaU‚wnƒmw@KXaVUVašUnmWUk°™lƒnUVUXWVw™IWVóKUI@WXƒxUU@mma@kUKWLkw@yk@ƒaVkUUċaUU@Wk@Unm@UVmLm±IUƒkJ™kWƒ@a„I@m@U„ƒVƒ„Ula„@VXVƒXmVwnkWKƒKU_k@m¥ƒmX_™JmnU@km@U@KmU™VƒU@U™@Umk@@LƒmW@Û£Wƒka@wk™@aƒI@mmk@mUa@UmUƒIƒwW@aWUƒbU@kbÇ@kwƒ@makVUk™U@aƒm@aU@mxkUƒbƒKUXUƒ±KXVWLUK@wkU@V™@WXUa@WbUxƒJIƒŽ@¦VèVVX@±ê¯KUIƒ`¯UULVx@Vƒ@UKƒIƒVkLmVkKmš@nUJÝbkIUJVXšVVxVbU„VJ„Un™°bV„mlU°„XnK@Ul@lVÈVUXšx@W„@VXšV‚KÞb„n@VnbV„m`ƒUx™kW@UVkL™Km¼@lUnUJVnV„XV@Vm@@LV„klƒIkl@VƒWlŽULWKUL@mJ„@blbUVUlmzUJUxm@UUbċÜk@Ub@VšLVV„¦ôbVŽmšUKUkU@m„„@VlVn¼WbUJ¯@@„°šnIllÈl˜@nXšWlLœk‚J@bkxlxkxlXUlklJƒšXL@bW„n`@nƎXxlL@xl@Xb‚LœKlVlIXblVUbUJW@lX@VL@VVŽšXšJšw„n@WnL°K„bVbl@VI@K„@U@nmVmV@XUWI@aXm@™VUUkWmn@lmUUk@mUmK@UnwVĉ@ƒƒmU_V@XJôVVUšLVUn@šllUnJl_n@šml@XŽlLlw²LVJUL@VmbVblVXmVnlš@Ť¦„nn@܎@bšl„@@XV`„Unb@VlLVb²J‚Xn¥ÆÑ@¥Þ@"],encodeOffsets:[[118868,42784]]}},{type:"Feature",id:"1306",properties:{name:"保定市",cp:[115.0488,39.0948],childNum:23},geometry:{type:"Polygon",coordinates:["@@VbXWš@@UlV@xVLXKWU²LV„VW„L„alVnwV@@b„n@bšVVllUnb„@lxÈ@laV@„aXV@b‚X„x„J‚nV@VVb@nnl@n„J@blšl@„ašƒU_VWUwVUškUm™Ukb±mVwœU@VIUW@UWk„@VU@ynL„m@IV@‚bnK„LVaVmnIlaXwV@@WVL°@@xnX„@V`V@VbUVVLVKnwnL@ll@@_V@VVnaÆ@œKVXÆ@nƒ@wƒKmU—™Wm@km@kÜKXU@ÑW±nIUwVƒ„Kla@I°wU±kškmm¯mƒ_ƒJnƒaƒwW@IVaUama@wƒUƒmU@mVw@aXk@mWa@£km@aƒ_kVmUnWW@¯bƒkUmk@ƒVÇm@@kUU™KUU™@UVUamVUaWIkb@xU@@amUkKƒVkam@@kVUkUWmKmUkLUb@xmJƒ™U@UImVÛVmnUwƒJƒU@VƒX@UWm@Ub°¦UšmxklmX@`ULU@@UW@@xkn¯@makV™UmxUb™°ƒlUšƒbUbƒnUJƒUUVƒa™LkbUU›JUU@mUUUƒJkaƒ@™xUIWJƒUnƒJ@V™zƒ@kb@`@bln@l™bƒŽ@X@š@š„@Xl‚bnbVb„@„„VJlInlšbVw@U„K„l@lbnan@Vb‚JôLn‚UzlV@lÈLVbVK@LVx—VWXX`WxXz‚bV`UXV¤nx@„bVlVnVlUL"],encodeOffsets:[[117304,40512]]}},{type:"Feature",id:"1302",properties:{name:"唐山市",cp:[118.4766,39.6826],childNum:11},geometry:{type:"Polygon",coordinates:["@@„@VVl@²„lJ„UVVšbČVVb‚@@InV„@‚V„nXx˜JXb‚xUL@b„Lšl@VlI@Wnk„KV@VXnJ@I„Jla°I„W„LVVnkmaUç„WVkôaܯ„@nV°wnJlaV@VUnUUaW¯wXWWwna@£UaWKU¯ƒ¯@aVUkKUamUUƒn»‚an™„IVwUWlkš@„LlWVakU@K„_lƒšbÞU°@šy°n„@„KÈkWW™ţ¥ĉōƒkġWUw¯£¯ƒÇwţwƒ@kK@kƒ¥ÝwÅbǤېťV™lW°@ĸ™x@VVVULVLkl@V@Xƒ`Ub@Xm@UWbƒk@ÆVbnLWV@lnXUbl‚@X¯lmU™VkKWLkK@_UK@U@UmmUxmVXLWVULkU@`W@ULUK@XlJXzV@@xml@VU@UX@Kk@WbUK@Xn`ƒXmJnšmškxUVbUVlVVxUbV@nKlL„kVKÞbVKXI°KVšmVUIUKULVxVJVLkV@Vƒ@UbU@WUU@UbUK@b@nƒV@VkLmb@b"],encodeOffsets:[[120398,41159]]}},{type:"Feature",id:"1309",properties:{name:"沧州市",cp:[116.8286,38.2104],childNum:15},geometry:{type:"Polygon",coordinates:["@@@ln@UȄŽl@Vn„l°aX@mXnVlU„`@bln@¤Xb@nWl@bUx@nnV‚„„V@xnbVbUb@J‚X„x„b‚mXa@k„UVwlW„k„KôVm@w™kkK@kl»Èƒm™VKXkla°@XVV@VI@ml@@Vn@VX@V@J„@VxUzVVšš²blVk¦@šĠ@@»š@VK@VÈLlK@XnJ@alIUl„a„VVbš@„n@a„U@WUIV@mUn@mKXml@lL@LnWšb@XV@@a„VVb„V„@VV„IVWÈb˜IÈ»ƒǟlWšaVUÅUƒƒ™Um@kVU™WVkaUwmaóUƒJUU¯ÑU¥mk™¯UaƒKÅnÇyóXmWÛX¯aċbÛa›J—W™ÝU¯»ƒaóóUm@IƒšVVl@bƒLUJWLX@@xšXUxl¤V@V„nVUV„XVbVš@Ž„@@VVn„°VŽ@ţU¯VƒUmƒUWV@mUXƒaƒbUKUwUaÇKn„ƒVk¦Wb@VnLmV@bkV@n„xW`Å_UVƒV@bƒUklVX@VmlUƒx@VVL@x—VWVL@VW@UUm@"],encodeOffsets:[[118485,39280]]}},{type:"Feature",id:"1301",properties:{name:"石家庄市",cp:[114.4995,38.1006],childNum:19},geometry:{type:"Polygon",coordinates:["@@la„@šy@U„I‚m„VXIVJšw„@lb„IVVnV‚@VVœIVVlašK„bVU„VVI„mVa„aV™„kš¯VanwšVlUnb°@lm@wX@@VV@VK@_nWlknwV™¯¥Van@VX‚@„W@U„V„IVxnmÜUnUVJV@„šnI@wValKnV@k‚mU£na@mVk°K„LVa@UU@UƒmknWWkXU@aWW@@km@UaU@@klK@UkaWaUnamm@U„a¯wWU@UkƒL@ŽUn@x™V™lUXVJUb™LmU@aUWUkmKkLUUm@mW—XƒaƒmmkkWUm@@U¯JUUm™kU¯@mKĉxÝwÝ¥LƒUóŽmwkUUUWVkKm™kKmLX„lxVLVxXJ@nVJnz@VWL@`nX@šƒxƒ@kVUUmJmIXx„JV„ƒnUVƒ@UVV„@LUšƒ`UXVVƒ„ƒlXL@l@b@VmX@b™xn°™UƒbkKWLXlW@@bƒK„mKULmakLUlmb@šXb@xmXU`V„b@`lLx@nWVXL@‚°WlXnlb„KVK„XVb@˜X@l_lJ@V@XnŽ„I"],encodeOffsets:[[116562,39691]]}},{type:"Feature",id:"1305",properties:{name:"邢台市",cp:[114.8071,37.2821],childNum:18},geometry:{type:"Polygon",coordinates:["@@nKlLnšlLXUVVlVnxô„V‚KÞ¦ÞxĊwnL°@lVnšVV°I@Vn@V‚lXnl„n„b˜WnXn@VVlKnLVlVX@bnVšKVaUIVWškšU@wVm@¯@U¥VmU_°lšK„k‚w@LX‚Va„U@wšUƒUUKlUóW@UVUœUlƒ°K„wlKU_na„KVnlKkkšWWa@IœJVa@IlJnU@„KVUUmVlaXUl@lm@kXWÝÑnkƒ™±™k@wğ›@@U@mKĉLmVJ@zmlnŽWLUÝJU_ƒ@@šmJkXUVlbklÝ@Ýa™b¯@¯±JÅwġaUU@ƒkU™@mVI±bUKƒL™WUXƒJkaƒLóKULWbUVkKmnk@@bmLUŽƒl@b@mnmJkUULƒaƒbnŽmn@lVV@¦n@„l@b‚znx@`Vz@b„xnV@xl„lbnKVx"],encodeOffsets:[[116764,38346]]}},{type:"Feature",id:"1304",properties:{name:"邯郸市",cp:[114.4775,36.535],childNum:18},geometry:{type:"Polygon",coordinates:["@@„bVKlVnInm‚@@a„kVnK@al@nmlLVUXaVKôL„Klb„IVWšX„KVL²a‚JnUš@lV@„VVĢbÆx²I°Ž°@šaÞbÞ@lkkaVUlWnI@™„@V`ÞI‚VXKmnk@y‚InUĊKƒÇkUUamUUkƒƒ@aU@U™ƒk@WUwVkVJVkkw°a@„mK@UX@VV„LVW@wšwVa@¯Xm@@lUIWaU@UWkXWmU@UwmUkKmn@lkVƒ²™VƒaULUVmJUUUwƒLma@™UmkIUm›L—mVšmx@b™LUamKÅL@VmbkU¯KÝamzkJUb±Vkb™L@lU@WIkJƒzkKmKƒnUalWkkKW@@nkbk@WW¯XUVUJ@XlJ@Xƒ@XlWLkUƒ`VUnaWa„UV@UVIƒaUxUUmVƒK@I@W@DŽU@@U@bƒ‚@nmKXmx™@UxkVWUX„@`VLlL@`™zX‚Ýb@b‚„@VUVkIUJVz°KVlnLlKnL„xlLVVUVlXUJ@nn‚„I@mVUlbn@@Žm„@bV„nV"],encodeOffsets:[[116528,37885]]}},{type:"Feature",id:"1303",properties:{name:"秦皇岛市",cp:[119.2126,40.0232],childNum:5},geometry:{type:"Polygon",coordinates:["@@lnV@Xb˜škx@lU@@LUVlV„LVbnl‚ašLXVVn‚l„I„V„U„JV@UnĊ¦la„bš@nJ°UmƒV@„wn@VU„JVI°bnWlXnWVLVK²b‚akk„lI@aUaVƒUwVUUalaVwnUVak¥šX@W‚kœLVÓm„mUK@_lWš@n_UK@alÅ@ğÅƑŃݍmƒ@їţÇlƒLƒ@¯m™z¯@ÝV™ak„ƒ`@LlVUbkXƒK™@klVXUxƒJmšbm¼V„nVVblLUV@b„°V°XLVb@¤mbXxWX°xXŽVbmVUVU@kbmI¯xmUƒ@Û°óbUl"],encodeOffsets:[[121411,41254]]}},{type:"Feature",id:"1311",properties:{name:"衡水市",cp:[115.8838,37.7161],childNum:11},geometry:{type:"Polygon",coordinates:["@@„KVlV@X°xƒb@VnnmbVŽXblb@VkL@lV@Vbn@@l‚@XX@bWVXlmXnlV„V@@VUbƒK¯LUl@nmbV¤n@l‚LXnlVUV@ln@lb„UlLnV@bV@@wlaXJVbnUVbVUš@VVšLVVn@VVX@@U‚KXU˜U@wUK@U„wVnk@UUWlk„V@a„UVUÆ`X_ƒw@mlU@anUmK@UXal¥„UmƒÈLVbVxVL„a„bVW@nXU‚Vn„„V°UŤV@Uƒ¯Um@Uƒ@@U™UaƒWVUmUUƒU@k£Vw™W@wW@XKƒIUa@wU@@al@UK@_mKXKƒbUU@aVKmš@Xmƒƒ±@kbÇakLğVaUw@a@ƒmkUJƒk@ykw@£ƒWX@lknk@WVkbUŽVnUVƒL@‚mVkI@JUb›I@JXb™XllkLUmƒLmbV`kLƒx¯Lk„›VUV@VôXkVVL„V™V@xƒVUbW@Kxƒl™L¯kV`UnV¦°@"],encodeOffsets:[[118024,38549]]}},{type:"Feature",id:"1310",properties:{name:"廊坊市",cp:[116.521,39.0509],childNum:9},geometry:{type:"MultiPolygon",coordinates:[["@@la„Ušš@šUnL@VWbklWxnIVV„V@X„JlbUlšXVbn@@K„mV@@X°WVInJmn²@lmVbnL@amKV_kwlmX@@LVamaXaƒaVU@UnJVanLlUkaW@UaVakK@IlKUU@an@ln@alKUƒkIVa@a@klaUKUV@UkUV¯šKVƒV@kUmƒU@@a¯ImJUU@VV@UL@Uƒ@@WXUWa@Ukwm™@ƒX@@w@al@@aVIUmVUUUVWUknK@I@™l¥kU±a™™UUVyUwƒ@@I@UUWm@@Uk@@nUJU@WU¯@kbWlULnšÇ„k¼@llLšl@xUnóŽƒLƒlkXUxƒV@lWb„I„`°nnn™llŽV²¯x@JkbƒLU„VxmJX²@ÒWVÛL@lln@‚Xn˜šnV„L"],["@@@kX@Valaa@KWI@UXW@WanaUIW@UaUKķŽk_W@UVUKUš@bƒ@UamxVXnJUbWVXLVbn@W°kb@U@Wó¼mIU¼k`V„@bVbl@„lX@lUôVlUœIV`lX„Vn@lUlVn@„l@UVaƒIUWl£Um™VWU@@UUKlUUUnƒVL@KšUnLVWUa›@™U"]],encodeOffsets:[[[119037,40467]],[[119970,40776]]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/he_nan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"4113",properties:{name:"南阳市",cp:[112.4011,33.0359],childNum:12},geometry:{type:"Polygon",coordinates:["@@lKl@nVV@„bn„@VVnm‚nL‚LXx@š„‚VLlKVU„IXWÜ@șlbl@XUĊUlwnW„LÞw‚m@ÞUVmnVl@nX‚JXLm@VnnJla„I@VkxVb„@VŽln„J@knKVn„@°aVanal@XK°b„‚@š¯VJXIš„VK@al@nV„k‚@nK„a‚b„@XL@blVVKVLXK„@VaVI°mVaX@V_@a@yUkVw„VšIVašJ°™@anIlaV@nKnXÆm@wUUV±UUWUKnaWwXUWmŁ¯Vƒam@kakImƒUKƒ»lan@VXXa˜W@@UlUUa@a@UlwUƒV@Xal@@anIVaUK@V™XmwVmUmV„LXl‚@nalLnal@„šnKlkV@@UnJ‚UXnl@nVl¦V@@VnJ@nUVVVVIn@Va„JƗn@@K@m„kƒa@kmWVaUI@a@™k@@aUL@mmaVIUKUVƒ@@IU@mƒUmmL@K@UUUU@mW@@nU@ğ»mVmbk@klW@UXnV@LƒJm„™lUnUJ™UUUWƒƒ@UnkKƒxmLa@ƒ@@lUU™bmUVWk@@nkUmam@UakJU_ƒVm@ÅlÇLUVmVUwULƒKU@ƒk@UƒVUlU@@Uƒ@UaUUWaŎƒzJƒaWLkl™b@bmL@„kKƒabWŽUVƒ_@mV@b¯JmXUbUK™¤ÇLUU@b@JkLWmkUWIkJ@VmX@JUbVXU`¯VV¯blK@LXKl„UV@Um@@Uk@kxWŽkbƒL@KkbmL@‚UXmaU@@l@x@blX@xUJ@bULUlULÇ@@VšnU`W@@nÛ¼U@@VmKUkm@VVX@@xǚ@bUbVb@VX@@x‚LUb@lƒ¼XLlbUlVVU„Ub@n"],encodeOffsets:[[113671,34364]]}},{type:"Feature",id:"4115",properties:{name:"信阳市",cp:[114.8291,32.0197],childNum:9},geometry:{type:"Polygon",coordinates:["@@VllInJlknJVkVU@mXlUÞ`VnV™VU@U@y„@nXlKV„nJVkXKWaXI‚b@yVk„VUkVwn@‚K@nW@k„KlUXVVUlbnUV`n@V_V@llX@@V„b@bV@@nlVUb¯‚WLnbmb@ŽnLnK˜b„U„bVWnLlaX@VVUX@Vln@`kL@ll@VXVJÈIVl@XÞJ°Una„LlylU@UXKlnn@lanLWWnbVI@KXKVL@LVWVL@UVKUIVWX@@XÆJ@In`@lJVI@a„WšÛnK@UlK@UU@VK„nlm„nXal„UllLUbVVšknJ@nV@Vm@a„l@@xnV„„lJVUU@™w@aƒk„@XW@_mWnUlŁUmVKV@VXwW»XƒWaUwnkWUkVUƒU@@@WlaUkkaƒIWVkm¯xmIUmƒLUVƒaUIó»m@mmwXk@a›mk¯¯l™@wƒmkLmmU@UbkUWJ@XUbƒJ@b@l@znÆmK@Xk@Ub@lm@ƒI@akmVKUUVUkU@U±JUbkƒ@IWmkxƒa@UUV™UWVkIUaW@UlLWn@VkJƒI@VkK@L@bmKƒkJmUUaUKWXk¼VxnJ@„V@@VULV¼ƒ@@UkaUlWL@U@W@IkKmL@KULUWULWKUXUJmIƒb—KƒŽƒ²UW™nWKUUkLUƒmUUam@UU™@ƒmUL@xkV@„VV@bmV@Vk@mwkUƒVUx@mbX‚ÇnVb„‚UL¯šWŽnUVLVb@xnlWnU@UVUVVUbVVlVkn@llVUXUWUXVbUJ@bmLUJnb@nVK@bl@@š@bVJUbnX@l„b"],encodeOffsets:[[116551,33385]]}},{type:"Feature",id:"4103",properties:{name:"洛阳市",cp:[112.0605,34.3158],childNum:11},geometry:{type:"Polygon",coordinates:["@@VVUllLXl@LWn@J„@bƒKUVmnL@`VblLnbV@„b@JmL@LnV@VV@¯„VJVnXL˜@nm@aÞ@‚a„k@m„IšmVbXL‚ynLšk°@°aVJnUV@UVVXk@WJ@VXLlUnJVnnƒ°U@»°U„wl@šb„WmUXƒÆ@VLXU@m@U„a@I›mkb™a@naWW@_@WXUV@@U‚ƒ²@„K@I±U@¥kKWLóLlƒa@£Um@kWKXU@mlLXUVKUU±J¯_@`UL¯Wmk@Wa„kkƒlUnƒVUVaU@KUU@mmK@_ƒa@KX@VaUIm±™k„aVKVUkw™@kaƒƒW@kbkL±UUaƒK@UUKVak£ƒ@UmmL@lƒIkmUƒ@Ualw@UƒJkbmIUmn@WKImWk@mUUnÝV@ŽnÝxƒKmXkxĉVWVk@kaċšÛ@WXƒJUV@zŽm„VWnbUbVbšLlUnŽ‚lUÒnWV—VWnk@@Vm@kxm@Un™l@Ll@@V@šXnƒškJV„šV@nlVXx˜U@l„n@aš@VLnWĊ¦nxš@lbVKXLl@ރVLƒ„XJl@XXl`lIXVl@Xl‚XUVšK„wV@lanx„zUbVJ@VVX@b"],encodeOffsets:[[114683,35551]]}},{type:"Feature",id:"4117",properties:{name:"驻马店市",cp:[114.1589,32.9041],childNum:10},geometry:{type:"Polygon",coordinates:["@@n@„b°UƂXnVlnLÜ@VLœm@n˜@na@J„„m@k„@lVšVxXX@„V`lLV„XVV@VVÞLVV°„²@lašbnxV@@b„Lšmlm„_VWnIWUna@lšLšbnV°ƒVL@KšV„LVUVaVLXK@mÆXna@wVm„a‚@Xw@KlL@a„@Va@wUkaWnIVƒla@Kn@Vn@VUl@nKVn„J@LnK@aVkVUUWƒ@VakUVanI‚²X‚W@UUU°KnUVLl@XaVK@ašU@KUI@W@_lm@KkLUKV_Uƒ@»@UVJ@XV@@mVL@K@U@Kk@VwUUm@kmWL@VkVkzƒKmb¯VÝI@WUkÇJUIUWk@@klK@_km@UVWUUW@kbmKUXƒaƒV—amLmK@namaXK°VakU@mU@@aƒa@UW@kkU@U`m@U_mVkaUVWUkVƒL@lmX@ŽLm@UxVlƒUUl@zaWJXbWLUlmIUƒkLmWƒ@@z@VUVUšUmÝ_kVWŽ@nUVUlmIklmIkJUkƒl@n@Lm@؃IUbm@UJUUVU@mmI@UU@k¥mUk@WmVmI@VU@klmLƒ™k@mbkKmb@WkƒKUŽVnUnnxšW@UVLUbmJ@bk@WbU@V„kx@V@bVbkV@V‚@‚—XWbUWm@kb„¼VLn„lJlb"],encodeOffsets:[[115920,33863]]}},{type:"Feature",id:"4116",properties:{name:"周口市",cp:[114.873,33.6951],childNum:10},geometry:{type:"Polygon",coordinates:["@@lšnb@xlJ@UnLlKXUlJl_„KnV@xVL@bkbVVUè@šWb@„Ubmš„ŽkšVšmbX„VJnUl@„a°@@b„LVbƒlXx˜InmnLVw‚anJÆw²IlmnXVl°VVbÈaVb„@lkn@VWnLlUVmÞUUklƒkƒVkUaVaVaUw™K@kkaVWmw„_„‚l@nU„VVb@b„aV@VV@zXJl@@kl@šlœk°WVnÆbnbUšVJ„Iš@VKVm@k™K@_kK@a@aU@@wW@@k@aUW@IUWVUnLlUlVXKVwmk@W@—VWa„¥@k@lnƒUIÇKUaU@ƒUUVmIUV™Uk¥ƒVma@¯k@Wanwmƒ„@@n@@m@UIVƒkUVamUXWƒaV™U_™@ƒmUVUImW@aUIĉK@VmI™b@lU@@n™JƒkU™@KƒIUmmLk@UVm@UŽm@@LkbU„mJXlbV‚@xUbƒ@@bkK@LWx@ƒbUn@xmbÅW@nWLUKUbUVƒK™U@LUK¯„mU@šVV@xULUŽVL@bU`WšUz¯aUamKUaƒ@@xkX@x"],encodeOffsets:[[116832,34527]]}},{type:"Feature",id:"4114",properties:{name:"商丘市",cp:[115.741,34.2828],childNum:8},geometry:{type:"Polygon",coordinates:["@@XVl@lLȃ„@VkV@V»UanƒWX@VaÆÇô@ÈaVX@xVJXUÞU‚aVLĸbXKl„V@šm°Vn_ny˜XX»mUk¥lK@a„_@yšInaVKVa°_@WXI@ƒ@K‚VnIlbnaV@„l„@‚a@_w@ƒlwUKm™Xa@UV@š»Vƒšw@kUKVUUm@w±VUXUKUwmJUUƒ@km@@±mXkmUI™@mm™KUwkbWakLWaUIkJmŽƒX@l@@VUX@JWbX@VbULWbƒlUVULknlV@bVJk„mb¯KknWmk@@nmVkx™@ƒVmU¯KUnUL™@ƒJUIV™maÅaUm¯X›l™kk@@lk@WI@yUUU@ƒb@aUaƒUmVk@ƒƒ`nxUXlb@lšLVxUbUbVbUll„k„VlÝVUnkVmKUXm@klƒ@ƒnUx@xnxƒn@`VX@V²x@V@b@„Wl@zU`VUVVb„L@Vƒb™W@bkXllkLWV@V„@VVÈwlVœ@@X˜K²Llb„WnnÆL@VnJWn"],encodeOffsets:[[118024,35680]]}},{type:"Feature",id:"4112",properties:{name:"三门峡市",cp:[110.8301,34.3158],childNum:6},geometry:{type:"Polygon",coordinates:["@@WKUmUI°ƒU@@UmU@KnK@IƒaU@makKUa@_‚KnmVU„L@a‚ƒ@IXm@KWkkKVkUU@aUW@UUIVaƒymwkbU@ƒx™LVUWWkk@WUkJk_WWk@WI„ƒUK݄k@WKULka™@mwĉ¥mXUK™@@bƒm@k—VWwkU@m™UUƒlI„™Wm@™@Uk@@KškVmn@lwn@@Ul@Xm˜UXUmVсkmkV™KUaVamaUXnƒ‚@ykLUKƒ@™WwKmKnUm@UmƒƒaU@mUk@kL@lƒxċxUnkVmnXxWb@`kzWJ@V—LmVUn™lmUL@lW@Ub@VšXUbš`VLUbUJ@nmnUlUUm@@bUJlnU„š‚U@lxkbƒ@@XƒJUnƒ@kb¯VVVmlXXlJlzn@VlkVW@bkK™bmškŽUbVb„lƒXVxšKÈnšwÞlĊKlšVnKlwX@lL@xlUnVn„@šl@lmX@ƄÈb°¼ÈwVJlx„_°xšašlšUÈxlUnbVxnL@lllšbm„n@nb‚@@V„L@V„@@„VLšJnIVVlKnV„_"],encodeOffsets:[[114661,35911]]}},{type:"Feature",id:"4107",properties:{name:"新乡市",cp:[114.2029,35.3595],childNum:9},geometry:{type:"Polygon",coordinates:["@@XVlL„K°bUblbUbšl@nX@W„XVVKVkš@@Žmb@„Ubn„W`kL„LƒV@VVLnKlVXIlVš@@a„@l£nWlƒkVa„@°bnUlLVlna‚bnUVUXKlU@ƒ@lk@a„I°y„@ôkUU@wšmôšnkWakml™UkVmkUlmUUm@nkUKWanamU„LXW@U‚VnUln„`l„œblL°KXV@ĠJ@L°„šJšUVw„anK@UUImmƒkK@¯±Um@IVmUmmÅnWaUK¯aUk„w@W±kVƒx™U™VƒwƒnÅJUIWaÝJóI—bm`ÝbÅImJUI¯¥¯@mU¯UƒJmnUVóUkl±V@zXl„bWVXL@bm„mº@@XmJUXU°llk„@nWJk@U„@¦U`m¯ŽWx"],encodeOffsets:[[116100,36349]]}},{type:"Feature",id:"4104",properties:{name:"平顶山市",cp:[112.9724,33.739],childNum:8},geometry:{type:"Polygon",coordinates:["@@l¤UbVL@V„LVb²VlKlaX@„„lbš@lxUVULƒbšln²VJUbW@@L„b@`nL@nVV@LVŽUbUVm„kVl„ƒlXbl@Xn°ŽVK@_°`²IVVV@VUVJnInaWK@Uš@„K„LÆ@nmlXXWVUUw@klKVa@knyVkVanI‚JXUl@XbVUl@@aša@mXk‚bnK@UlK@UUUVaXaWmkUm¥n—WmXaWaœkl@VmÞb„KVL@aVI@mUwVm„@KōméUL™KVaUk@kUK@U˜WXI@VlKXU‚@VVnInVV@VLlK@UUƒkKU_@ƒWWUwU™@klƒn@ƒƒ@Imb—@@m›nUKÛ@mKUkWVXxmbVLXŽVVU²VV@xÅnmWmLU@kbmJ@b¯š™IUb™JƒUUxVl@z@bU`W@Ub¯nUJUbƒ@WLUKULkU@aWKƒ@aƒbmL@ƒlmUk@@bUL™ƒWJUI™°@ƒŽ¯aWLk@mbUb¯b"],encodeOffsets:[[114942,34527]]}},{type:"Feature",id:"4101",properties:{name:"郑州市",cp:[113.4668,34.6234],childNum:8},geometry:{type:"Polygon",coordinates:["@@@nWVUKÅ@W„nVnI‚ŽV@œkƂšwV@šnn@lxÞlnôJ˜zXJl@nalUČVlƒl@²UlkôVVUnm„I°VnV°@°¦VJnIÆJÞan_VmU@ama™@kU˜¥kaUklw@UIV¥kVUI@ƒmmUÅmUlƒwVU@amU—JWbUakVƒ—Vé¯Im`ƒk—@ƒwVWmLkU¯ŽƒXkWmLmx@UUƒbm@@x™J@LbW@UUVWUkVKƒ@ka™IUamKUkkmmLƒUkJUVWXkWmnÅ@ƒKƒL™@@VXLmbmJUIUVU@ULWVkK@nWVXL@lVn@¤„b‚kôKXKlL@¦²V@JƒL±@„@VU@WV@X@`XXmb@Žšblaœn@Jƒb@V"],encodeOffsets:[[115617,35584]]}},{type:"Feature",id:"4105",properties:{name:"安阳市",cp:[114.5325,36.0022],childNum:6},geometry:{type:"Polygon",coordinates:["@@°kVaV¥kVmUkWkWVkVKUwkkmKUU@a„wWWXWakKWkXmlašIVmX¥ƒU@a„@WnK@kƒƒ™V™I¯ƒ@KğI@WU¯LkK›akƒƒ_kmmVU@VWXƒKnVmbXbVLmln@VVknlVUnVlkšlnXbmlmlXblnÈlWbn@@nšK@V„L„bVV°VVzšlnš@V™xƒI™b™ŽU@WLUa¯V™UkWõ@¯kkmxk¼l‚„XUlVbVLnlULmU@lƒLkVUlƒX@xW@¯mUƒ@UmIUW™L@aXa˜kU™¯anƒWk°@k™kKmmUIWaambUkkKmV¯aƒ@UblŽk„mXk¤ƒ@@b™@UbULWVnb@lUVVnmšnVVU„J@bWXX@WJkL@blVU°UV@XlWnXUbW@UVkVšVWbnLUJWLUK@Lnn@blVU‚„nUblxVUVJXU„a˜@Ub„LnUVV@mVIVVn@UbV@‚XbmbUV„_lVXUWanJVI@WkI@WVIVU°WXXl@la@mX@lLXl‚kVbœm‚X„ylIXJV@@kšKla²UVa„IVyÞb°LlVna@UÆKnLVbšK@anwU™"],encodeOffsets:[[117676,36917]]}},{type:"Feature",id:"4102",properties:{name:"开封市",cp:[114.5764,34.6124],childNum:6},geometry:{type:"Polygon",coordinates:["@@lUVbXa˜InV@bUV„x‚knVVÆnn@„VJlUU¦VJ@kxVllb—¦lVš@nb@bVŽUn˜aôJÞIXbVJÆI„m„xšUšV„w‚U²l@XƒxVl°bVLXb‚`XklUnmVblLœ@lmšx°LVK@UXIVašWlL@Ukƒ°KkVaVUXmmI@UÅKmmƒXka±K—L@W›@kUÇxUUƒ@@UXUlKkklW@ašX„a@UƒKUaVUUV_@yXk@ƒ@a@U±w@UUW@_„mmw@wVw„mUaÇbUa¯UUkmWkn±JÅxmIbUxmKmn—JWw„kUaƒK@a¯@ƒbk@mVUIWƒ—Lmwm@Ua@WJUb@LUl™@UUmLUbWJ@VL@VmXWWzUJUꄘ"],encodeOffsets:[[116641,35280]]}},{type:"Feature",id:"4108",properties:{name:"焦作市",cp:[112.8406,35.1508],childNum:8},geometry:{type:"Polygon",coordinates:["@@V@VL@x@bXŽWV@XkššlUŽWX@J„@nI@KlL„KšUVaV@œJlL@KUk@KÞL‚l²_‚@nWlL„UVVš@nLWVUJVn@anV@a„wÞUVLVx„b„@lW„@lbXn‚Vn@@¼šL°mšKVn@bnl@nVK@blb„L„W„U@VWLXV@nlKn@lVVbXw°nV_@¥Vƒl@XI@mlƒkkV¯VWnI@W‚@n¹nƒ@aWKXUƒaWk@yk@k„ċUkVmbk@WI—yóImÝkkwm@™mU@™xŁ›lU@mJƒX™ak@ƒx¯V@¼¯Vm„UmmIkVWK@UXIl@UWVUU@mVUI¯b¯@™lmKzWKUa™nƒJ@nƒlbÝ@@b"],encodeOffsets:[[114728,35888]]}},{type:"Feature",id:"4110",properties:{name:"许昌市",cp:[113.6975,34.0466],childNum:6},geometry:{type:"Polygon",coordinates:["@@lI„VnKlnVlnLVbšJlb„@ULVlUXVVX@‚a@KšI@wn@„aVV‚@nwnKlX„W°lVnKUX„x˜@„ln_°JVIXy‚XnW@U‚K@UXIVanKVVš@Vk@KVaXI‚@Vbn@nx˜KnaU™l™ƒn™Va@ƒXa@™VçUUla@aUK@wmUƒLk`kIWVkLmK@V@XUlƒn@JXV@nm„™bU‚óIƒmUa±@@ÑóVUUk@UlKVU@akWVUUlUUaUK@UUKWbUkÅJ@XWaƒ@XbmJ@nUJ@bUKƒLÝaUnk@›lXbWbXnm˜n¦lVXnWbUbVV@VkL@VmLaWl@n™b@bk@UVWak@WVImJUbUlmz@lUbkL@lVx"],encodeOffsets:[[115797,35089]]}},{type:"Feature",id:"4109",properties:{name:"濮阳市",cp:[115.1917,35.799],childNum:6},geometry:{type:"Polygon",coordinates:["@@lLXbW‚XXƒx@bVVnLllVxULUl‚XXlVlUnlŽU¦Ub¯l˜nœK@V‚bVb@šXbVL„KVxVVnIlašb„a„¥lU@wnalLnVVlVLXnlWVXn@@lVI@WnU@mƒÅW¥—aW_k@WwXy@kmƒ@wU„mš„š¦šlUxVLV@UwšJ°xš@VX„@Vb„@š`VX@VX@llšIVbnJlI„bšV„l„˜J@ƒmѯLóa@ƒƒKUa„k™ƒ™Xƒ@UK@wU@ƒlWUUݯImW¯aƒLUKU@ƒkƒ»k@mƒwƒa@UnKWI@ƒUU@akVWK—k@a±ƒbóUWKXUmk™KUmLƒbUx„„@lmLXŽƒ@@b„VW¦Un™JkbWnXl"],encodeOffsets:[[117642,36501]]}},{type:"Feature",id:"4111",properties:{name:"漯河市",cp:[113.8733,33.6951],childNum:3},geometry:{type:"Polygon",coordinates:["@@@Lƒ‚UnVxnIWa„@Xb@WÆIVlXaVL@VVLVbkVVŽUVlX@bUVkLV‚l@VVôU@Ò²@Vb„nôJVšanƒ@mWU@I„mVk@WkI@wmak™@wlW@w„@VbnLVb°bVyX™V_@aUKVVK@wUU@™™a™K@kmbXVmJUXƒ`kn™nƒK@aU@mw™akb±@¯ƒUUÝKUUU@WU@VkLUKU@mUmJUU@WVkL@UWJ—X@VVL@lVlUbšLVKnêƎ"],encodeOffsets:[[116348,34431]]}},{type:"Feature",id:"4106",properties:{name:"鹤壁市",cp:[114.3787,35.744],childNum:3},geometry:{type:"Polygon",coordinates:["@@ó™™n@xVVólƒ@¯zƒJ@bkl@@„kVWLUVmVXbVJnnlLlš¯@Xlm„°bVš—lWb@bšKVXnJ@VV„°nX@@w„WVklU„K@knVVKmkUKUaVkƒWkl»nwlŽ°lö@lXšV°UVbXKV@šša„Jšw@Um™™kUy¯UUUƒaƒK@U™L@mm@XaÇkkmWank"],encodeOffsets:[[117158,36338]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/hu_bei_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"4228",properties:{name:"恩施土家族苗族自治州",cp:[109.5007,30.2563],childNum:8},geometry:{type:"Polygon",coordinates:["@@VK‚bX@lbUVnL°„@VlVnUl@VUX@„aVƒmaXƒlašUUU@wmaVUn@Vƒnmmk@m™U@kna™aU¥Vam™X_@WƒU™mW@_kƒVaVKnL‚lœ@VVal@k¥@kUW@kUKVUlUVсW@kÇaU»ValmkUVUVak™@aƒV¯_@W‚UkmVUlU@aœƒƒalI@akkVWUaWXUWwœWVbÆ@„„l„alIVK@U™m@UU„W@al²a‚¯UağÇm@ƒbkk@wƒ@@W™aULmxƒIU‚™ƒb¯@U`UX™JmL¯aƒKX›WUL@aknmK™@aWUXaWm@I@UÅmVU@™™aUV@b™VƒI@WkU›bXkm@VakwUKULWKXmJ@XUK@ƒmL@KUwVaUI@KU@mmn™mXka@»V@@UUaƒw¯yVk@ƒUUVmmkÛÈU@mWUnmx„šmlUbV¦UlbWVUL@UUƒ™IUmÇKV„VbUVVxkn™LUxV`VX@š„„kJVVUXWaUVVlUnmKUbkI@WULmK@L@LVlƒLnmUIWV@aknƒ`VXUJIVlUVVbUX@¤mbnLm‚m@UXk@mm@Ukaƒ¥@kV@@KkU@aUKWbkLWVkIVŽk@UbVlmX@bU@@mmL@bn`@Ln@llVLVk„@XVVU@`VXUš‚¼k`VULka@VllVIn¤VU@@bl܃bkx@bkL›škKƒn@bn@@b@JUnV`UnVbVKlVXUlbn@°ƒVx„@@b„nVbUllVn@V—VK@UnW@UVUšlnk‚VÈޚxVb„VVI„xVaÆ@@aka@UVaU@@a„k@Wl@nbVIƎ@Jk@„L@VlXnlla@VJnw@UmwXU@aVK°ÒnllnLlb„xnKVaV@l¦²nVl@llL„x@XVVœ‚Ķš@našx@U@al™XUVa‚LÈþV°XxWXkK@šmLnlUb@b‚xnLVlVVkb@UJ@xWXXš"],encodeOffsets:[[112816,32052]]}},{type:"Feature",id:"4203",properties:{name:"十堰市",cp:[110.5115,32.3877],childNum:9},geometry:{type:"MultiPolygon",coordinates:[["@@@a@w@kV@nbVK@ƒnUla„@la„Ål@nlVakwWX@WkLšaVmšwV@anK@UlIXmWkk@@mmLkWlwk@U_mKXwWK@U¯K@UU@ƒVUa™kmƒkI™yUUVUmanU@mlwkƒ@_mWXaƒUWU@ǃ@U@aUaVwUKUIƒVkK@UWIXƒmaV@k@Vm@UnwlƒUamk@V@„ULUamxUJkU@Iƒ`WkkK¯XWak@@W@IUV™LWJkXkaÇVUKƒ@kUmbmUUƒUKƒbkKWUkI@ƒkKÝ@@aƒUm»nI@mƒU@UnWV_@aUmWbkLUl¯b@a›kkk@WkkJm_k@UV±@J@b›nU@@WÝIUJVbXL@nlJkx@„Wn@VkJmb—LmUƒ`VbUL@xVn„@XVƒŽ@„mVVnnJVbU„ƒx@„V„nVUbVVƒx@šn„™bUK@bƒ„@bƒJ„šm²„VU‚lbXzVJV„„JVbn@@Xmb@V@bVJÈ@‚Vnkn@°aVVV@šX„KnalLVmšUnnVKVlnLWlXX„Klk°š™šXŽWškLUVVV@nU@ml¯nmbk@W`Å@mb—LWm¯UƒxnêVèk@mbƒVƒnUK™@kKmXk@@JUI›lÛLllnbVnlJ@LULnlÆaVLnŽV@nkVJ„@lkô@²bÆm°w„L„WV@VXšKšVXI@W°ÆVšK„b°U„JVIVV„¦XKVL@l‚InaVÝnUl@@bX@‚™nmVL@lVL„lVLVUnbVW@xXn˜bœU°¤V@š™„a@kWKUUn@VlnL@UV@Ü»@mX@V_ƒakaÞ@VK‚¯@kkW"],["@@mUkUUm@nllVKXXVK"]],encodeOffsets:[[[113918,33739]],[[113817,32811]]]}},{type:"Feature",id:"4205",properties:{name:"宜昌市",cp:[111.1707,30.7617],childNum:9},geometry:{type:"Polygon",coordinates:["@@°`„U@blšUbUVlVkn‚ŽUbV¼Èb@l‚XUÒkVUVVL@lVX@ll¦k@UbU‚›@kmKULUbl„@`nXšŽ„V@XW`nšUbV¦šbmb@lšV@nnlmnU„m@UVnb@xVV™VkbW„nb‚VnVa@an@UaVU‚JXnWlXX@l„¦@ŽlKÆX„bX‚V@VV„@°¯°xXx‚XV@nV°UVWU_VWXkmaVnWVkn@lln@lb@UVLXWlnX@˜aXUmaVK@UXU„U@WVI‚W„XXV‚U@¥VKœ@‚Uގ„„‚a²LlV@kV@UanKma@UVUnK@UVLXyVL‚knJ@UV@@UXKWUXaV@Vb@mVLnKW„m@aUUm@@UkK@Ula„LXKWaXI@alKlmUk@wVKXL@m@WWn@UVa@K@wna@aW_XWWkXbVW@k@U¯WWwka@UUaVIVƒkU@m±@U@@wVKkaš_@VV@XUVwU¥‚šyUkm@V±ÈUKk»ÇL„m˜mLk@ó£kmWwƒm@U„IkWKXwWU@ƒkLƒwkbmaƒbkK@VƒLkmWIUKkUUƒÇIǫJ™XÅJULVŽÇLUVƒ@UK™@kI@WVI@UaƒWmXVVUL`±kÅLmKkƒƒkƒÅ@Ua›XXxWVXŽVbUXll@bkJ„b›„@bkVUVlnV@X"],encodeOffsets:[[112906,30961]]}},{type:"Feature",id:"4206",properties:{name:"襄樊市",cp:[111.9397,31.9263],childNum:7},geometry:{type:"Polygon",coordinates:["@@@Xl@Xb°WlLXl„_@JlVVInwVbVK@ƒ@UnlVbk„mx@VUnl@U@nbW„XJ@VlL„UVJVLUxVb@b@VȄ‚@XV„VWbnX@`l„kx@nmVnbUVVVšzlJn„šlVb„UV@@V°L@VXLWxnLV`l@kxlXnK@nl@XlWn„`Xnl@@UVa@VÈKš£VLVanW°U@UVU„@„`VIn‚mV@„nV@Xa@aVW@UšalkXKšblI„yƍXnlJXbl@@VV@nklU@`„nVK„LVKVb@V„U@UÈK„UVKšIlUX@V`lIVbn@nblVVmV@@XXJšUVV@knKVn@`@X‚VnK„wlLVmUUU@ƒU@aXL@WlU@UUW@UmU@KkLWaXkWmXUWm@U@ƒnk@UmK@U@UaUVUUKV_@al@namWUI@KUƒK@aV@WUIƒbƒ¥ULUJkIm™ƒK@U@K™V@U@a@UkU@K@wVaUwlU@mUƒULmKUkV@@anIWmUK@I¯„mKkl@LUb±lUakLmk@WwUKÝVUIm`¯n@Uk@makJU_@ƒƒJma¯ImwUVkKƒb™aUÅ@wWaU@VU@mXIVmmUkJkwm@mIlUKWzUK@VmLUV@VnbmLVbU@@lkU±KbƒƒÝV›@UL@¦VWUƒWXUJ@XƒVWV@VULnbWV—bW@kmWXUK@Vkam@kkm@UlmXUŽnbWlUXV`UX¯VmUU@Ul@Lll@nnJ@LƒnWmbmš@b™`ƒš","@@kUUm@nllVKXXVKmU"],encodeOffsets:[[113423,32597],[113794,32800]]}},{type:"Feature",id:"4211",properties:{name:"黄冈市",cp:[115.2686,30.6628],childNum:10},geometry:{type:"Polygon",coordinates:["@@VVUnWVXnVJ@„‚U@V@VXŽV@@IVJUnŽ@V@L@KlIVlVanLVbnVlI„ƒn@@a@Kl@@I„JlI@aXU@KlK„kVblJXU„VlU@V„bVkVKXn@VlxVa²I@VlVUxln@bšJXklaVWnLmÅ@y@k@ašI@W@aXIlVVaV@nnlKnLVW@IUa@a@K„UVVlI@wXKVV@IUƒla„@lUXwWƒnƒnalLlxXLll°@XwVKVaXIl™nb˜@nln@Va@U@k°ƒUmÆUVaXI„JV¯ÇUmmkU@WaKmakVm@U@aVKkkmKkVmIkÇ°£@aUUVaVVnKlkX‚mkƒ@ƒlUVaX@@Um@‚™UmlUXV„UVU@w‚K²¥Ua@I@UV™l@U™V±UIUÇ°»VkUmVI@a@U™m™ĉ™¯V±bŹĖğaÇL¯lmŽkX@‚óĀ@ŽmšÝêb±WkLƒn@xXx@Ž@b@V@LW@UbƒlţXƒ`kxWnXô¯¦ÆV@L@JVLƒxkK@V@bkz°l‚lXz@J„UlVla@XUV„bVKXnW`XXV@laVV@V„X@V¯xƒx@xULVbUJ@n@LU@VmmakbUK@b™IWWUUVkUmkLm@VJkb@nUJƒ@`V@kX™aUaVmmLkUmJ@Uk@U„±lkzmJUb@b„VUxVXU¤ƒL@JƒX@VlL@JkLUVU@mnUl„¦@V"],encodeOffsets:[[117181,32063]]}},{type:"Feature",id:"4210",properties:{name:"荆州市",cp:[113.291,30.0092],childNum:7},geometry:{type:"Polygon",coordinates:["@@ÈJV„lVVLXJln„K@UlL„anbla„xlK@„XVWxXLlƒJ@V„nXxlnô¤l@nKn—‚ƒÈKl¼VL²Ç‚Un@Vl™zŽV¦UxWVU@@U™`lbUL@xV@²@@nlVU„UJVb@VlbXx°XVWX_VKUwVKVa@UVKUUVk@KnblaUU@wnWl@UX@lÆ@@a„IVmUk„™šxVJ„U„bܙ@Uk@WWnk@Vƒ„™Vm@I@m@Un@m™XUlVlUnJ@knJVU°@@aÆLX@ƒllL@¦nJV@XblLVa²U@UlWš@VX@`@LV@@bXJlIXml_lJœU°b„KÆLnVVl‚@ö—Vƒ‚mXaVIĢllUlVnLVlX@@b‚ašnnxšV„L‚bn@°ÆXmmkĉƒ¯w±™™™Uċ@KÝÅƧŃÝ癙Uw¯ƒm™¯k@W‚kV@¯UIUJW¼kb™Uƒwk@W`@¦Uônb@VƚlÈ@VU@ƒƒ£UWWnUÆUnmJkUÇ£VWUI@aUU@WkI@Uƒa@JW@k£kaWVUKmnkKƒb™kkVWb—VmUUmwU@kk›@UakUUa@V@nlx@lUb±lUbnnWLUyk@UamœUK™@mlk@Wb@VXL@x@xWI@a¯Ž¯V@bVn@LkKmL@`XmKmVU@@bkL@V±bk@Uaƒa™L™KUVƒIƒ„™W™XamVVbUK@b@Lm@UWkxULWVUnm@UlUX"],encodeOffsets:[[113918,30764]]}},{type:"Feature",id:"4208",properties:{name:"荆门市",cp:[112.6758,30.9979],childNum:4},geometry:{type:"Polygon",coordinates:["@@n@lxlInVUnWJ@nUVV@Xb@xVƚb„alLVUnx°Jnb„I@„V`lInbl@@V°mn_VJÞUVLXx‚@nllKVb²kVa@KlknL°ƒ@JVLXnmJ@bU@VlnLVKV„@nX@lUšKVaXal@VKn@¥°L@Unw˜bnašV@KV@VUX@lVXI@KW@@IXWV@laVL„„KlaXUVVnkVWV@lwXblIXWVkVmšaU£VaUmVIkU@y@WakKUamU@UUK@kmK@w@@mK@LƒV¯™U@WwkmULƒamVVUU@ƒƒIƒbUKUa™kmƒm@UakLmxU@UÒWlULţÿmwkIUm@a‚kÈblW@UVƒUUk@JW@XkWWUkUKUIlw@aUWknWUUmnIWƒ™aUwVaۚƒaƒVUI™wƒšVlUnƒJ@bÅ@@kVWk@mX@xVVkbma@LUlVVUL@VUbULVxULW`UX@V@lUXWaXlWXX`@bmb@x@LUb@VmŽXX@‚@nWKUL@xVlknkL@bWJXbWLƒKkb@VlL@Vn@VV@bƒnX‚mLUK@nUaU@WbXVWL@VU@@V"],encodeOffsets:[[114548,31984]]}},{type:"Feature",id:"4212",properties:{name:"咸宁市",cp:[114.2578,29.6631],childNum:6},geometry:{type:"Polygon",coordinates:["@@ÞƂLČ@šV‚š²š°xĊ„nlWnŎ¯m@aƒK@„„°‚n„Jšwn™VIUaÆJšÅ@wšwV™XW@aV_l@²V°lĊwlaXLšwlUkalVVaX@lVXI@a˜UXJ@U°UU¥VIVKVklanLVa@VÈIVV@nk@aVa@mV_@a„K@klKUa@UnKWk@@lU@@UW@@nUWUwmaVIXƒ„lV@mLXblJ@kV@kk@KU@WƒkUWVÅwkLmW@UmL@lUL™KULƒak@maUUÝwUJƒIb›KUUƒ@š™aWK@kUWVkUwVw@™mÝ@™I@wkW@a›ww@LU¥™kƒJ@nVJƒIkVVnkV›UkyUIUl@xWUkaW@@°kz„ŽWxkLUWmzk@@bVVVš„b@‚@XlVœ@Vl@bVbUn™`Wn—@Wb„VVI@`„LVbXLV`mnU@@lƒL@LUŽƒak@ƒLk@WbUJn¦@lVb@xVb@n"],encodeOffsets:[[116303,30567]]}},{type:"Feature",id:"4213",properties:{name:"随州市",cp:[113.4338,31.8768],childNum:2},geometry:{type:"Polygon",coordinates:["@@„@nš`lw„k„ƒ„UmUVWX@lk„@VanUĠ¼V@@mX@@nVV‚VXLmJVLnK@b„V@@J„@VUn@VaVUUUVWVLV@@Kk_@almaVkUU@WVƒVUVLXmmk@wUaUKUV@°™@kmaUaÈmW„mUƒVklaX@lVnxl@@UnaUk@ƒVUVwVK„nš@VVn@VbVJUknUmmVmk_Vw„KUUm™Vak¥@UVKVIkW@UmIVWkIVƒkmmLkwmVUƒ@LƒUU@VVXL@JmLUbmK@UUKmkKUUmVUaUnÇlk¯™mJUnmLUaUJUaWL@UkJ™ƒUƒ@ƒaklkU@¯@KWLUmUUWVkbƒLƒŽUKkbU@WX@JX@@LWJkUW@UVU@@L™Umb—amx@V¯K@¦mŽULk@WbUb™LkVW@kVVxUb@x@LlV@V@b@VšU@L@V„LnšlJVIVK„¦„aVJ@XUŽ@b„LV‚@LVJnXmbk@@bU`VLUVV‚b@V@VnL@Vml@„@VXnWVXnWlXblK@LnV@VVX@VkV@XWK@b„VV@VV"],encodeOffsets:[[115830,33154]]}},{type:"Feature",id:"4209",properties:{name:"孝感市",cp:[113.9502,31.1188],childNum:7},geometry:{type:"Polygon",coordinates:["@@VnXK@L@°lVlk„b„@„VšlI@VXKVbVIVbnKVmnI°šlŽÈkVmVbnUVVlLnVL@VnLVanK@IWKUUV@„V@KV„nUlxnKlnU„lJUXnJ@VlXUJUL@Vl¦UbnšVVƒLUxl`UnnnmVVlnVK„bšmVX@a°Ý°LšaXJV@VUnKVXVK@LnKlLUbVVX@VwVJVn„@@UU¥V@@UUK@ƒmaUVUkkJ@L@K@UmVUI@JU@W@U@UV@ƒUIWmXUVmUUÇ@UVmIlmnmakK@akaW@UwVUkKVnUlKVwk™ƒVU_WKUkVW@UXaWkUa@w@VU@XaW±@IkbƒKƒb¯L@WƒXkWƒ@UakL@UV@UmVUmL@UXWVL@ašUƒVUUUVU@yUUƒIUa@wUKWVU@kƒ™™Wk¯UkwVKƒLUx™K@nVxUlUUWVUmw@wƒUUyXWlX¦WbUV@„U‚@blbUVVbXXƒl@lVL@bk@lxkVVnVx™¦ƒ`UnkL@V@L@Ž‚@@xnL@lVL@VnVVblLXb@‚@zlVUJVnUbV¤™bUnUlWXkJWakxU@UXml"],encodeOffsets:[[116033,32091]]}},{type:"Feature",id:"4201",properties:{name:"武汉市",cp:[114.3896,30.6628],childNum:1},geometry:{type:"Polygon",coordinates:["@@nbnm‚knJVUÈ@@Uƒ¥VknmV@VUlK@IkK@U„W@I„KV£UWVwƒU@aVanIly²kVƒl@@VnIlVnKUnVbšblWU@@_„‚VI@mlaUIn@lKVnUlVVXXšJ@aVLlanbUnV@@K@mVIUaVK@w„w°w@UƒW@UUUkbU@WWX_WmULƒaVU@WkbkUƒV@IWyk¯kly@a@UlL„wUK@I@KÅUW@ѱUm@wl¥kaƒ@@_Vw@ķƒa@akw@ƒkKW£XVUVwVwUaU@VUU™™xWKkbĉx¯k±Uk@U`@bWXUš™x@x™ÆÅIVbUJmš™xƒImƒ¯@ƒ™Umx™nUVVbnJV„@Lƒ@@ŽkV@bVnƒ@UVULlx°VXlššl„V@XUVL@xVb„JVV@zUVVVUV„™V@bUKWX@VnKUVVnU@@VlKVb„@lX„W@X°K„a„Lla@JX²Wb@ŽUV@@xVbXlWb@VUXVlXLV`Uš„lŽUxkLmVUŽlLUVVxX@lb@blL"],encodeOffsets:[[117e3,32097]]}},{type:"Feature",id:"4202",properties:{name:"黄石市",cp:[115.0159,29.9213],childNum:3},geometry:{type:"Polygon",coordinates:["@@VšUVV@VbUx„aWUœblUVmnKlX@bXJVIlVUxVVVIU‚zlx¯š@‚VbnL@x‚x@UVaXK„b˜@Xk‚WU_Vm²klW„XVK„Žl@nXV@@w„mlK²X‚aÞén™@ôÿ@lWn°kUKmmUљUmm@ƒwkImWU@UakL@bVLUVċ@™bUK@alIXKWK@™nXnKmkUVwƒ@¯b@L„lUL±W™n@KULUaW@kL@lƒL@bU`@nUb@bmlU@UÇJ@UUbmKkblŽUULUJV¦¯V@VWI—V@bWJkUW@UbkUlbkV"],encodeOffsets:[[117282,30685]]}},{type:"Feature",id:"429021",properties:{name:"神农架林区",cp:[110.4565,31.5802],childNum:1},geometry:{type:"Polygon",coordinates:["@@n`lIXll@lœl@b°aVklKXaVn@bU`mX@V„V@nmJn¼„V@bÞ@lL@„lJXVlL„aVLV„nVnalV„@VLÈUlblWXIšKVU@J„™š_‚@an™na‚X„m@KmI@mkk@KVkWWw¯w¯°ƒ@UUU@WƒaÅWkL@ƒ¥@kWWXkWmIUVVbm@@bUbmUU„ƒbW@UVk@mVkU@U¯ƒmKVUkaW@aULƒÆVbƒb@VÅ@Un@VƒLWl¯Lš„"],encodeOffsets:[[112624,32266]]}},{type:"Feature",id:"429006",properties:{name:"天门市",cp:[113.0273,30.6409],childNum:1},geometry:{type:"Polygon",coordinates:["@@@K@UlKVm„_š¥UwUmlUkwl@@aUK@k„kWWUaVUka@aV@ƒVUXaW¥Xk@WWIklm@ÅxmI™VÝUkxkaƒ„@bWJaUL@„W@™l¯UULU‚ƒbƒkV™Ua¯bm¤UnÇUkmUšUx˜b@VkXÇal@bVnlJnxŤĀVKXkVÑV@nwlKVbn@n„šlVbVL„a„J@„VV‚UnU„bVKlnXxV@°š„U@KnL"],encodeOffsets:[[116056,31636]]}},{type:"Feature",id:"429004",properties:{name:"仙桃市",cp:[113.3789,30.3003],childNum:1},geometry:{type:"Polygon",coordinates:["@@VK°VškX@@ƒVK‚bXI@a„ƒlblwÞVšUnJÆwn@lkXJ@X‚WVz„V@xnx‚VXUVVVkUw@mšLVw„KVU„@Um@alU@„@@KUƒmIUaVUšmnwmw™mb@aW@UkmKkUkVġkUJWbnU„õ˜@UkmUÅKƒL¯a›VkIk`WnkJƒ@xVLUVVbUbk@WlXbm„VxnxUblbUV™@@VUV@nVL"],encodeOffsets:[[115662,31259]]}},{type:"Feature",id:"429005",properties:{name:"潜江市",cp:[112.7637,30.3607],childNum:1},geometry:{type:"Polygon",coordinates:["@@UbVxšbX„mJVnXVlmVX@bkxVJVLVlXXWlX@@IVl„V‚U—aVwV™lnÈVVmn£°aVbUš„l„aVUK@mVU@Uš@VUkaVamwUwnƒWaXkl@VaUaVUUK@w„WI@aU@@K@_UW™@kX@V±VUbkKWaU@mI@¥kK„kW@ÅK@b¯@UVmI@lmIkVkUWVnšm@@V@n@JUnƒšU„@ŽmlXXl@@V"],encodeOffsets:[[115234,31118]]}},{type:"Feature",id:"4207",properties:{name:"鄂州市",cp:[114.7302,30.4102],childNum:1},geometry:{type:"Polygon",coordinates:["@@°¥WóXmlw„_ŤW„kVaX@@K@U@a@WwU@mWk@ƒULƒWkX±lUnV`XWl—@ƒaWLUb@Vw@wmKUa@°™kw‚yVUJUUVwkUUJWI@akWmLUnkV›aXVƒbUxUVWX¤lL@„lx@b„b@ĸUx@`„@lbk¦@x‚n²VƄX@"],encodeOffsets:[[117541,31349]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/hu_nan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"4312",properties:{name:"怀化市",cp:[109.9512,27.4438],childNum:12},geometry:{type:"Polygon",coordinates:["@@@n„‚@b@XnJ@k°x@aVUnl‚UXnV@@VnJWUJV„nIVV°ŽUbVVVL@Ž²LUVa°V@aV@nm‚UXblLXWVXVmVLVK@an_„`@X@l°„VlXXW`nX@Jmn@b„@nV@Lm`„bUb‚n@VUVl@nIVbUlƒV@LkJUnVV@xVblVUbU@ƒzUKU@mx@xUnn@@WV@lbUb@šnVWXX‚V@VIV@VUnJ@VUz@JWbXllI@VXVVL@ŽVn@„„Wlb@„Žl„XVlL„aV@VJ@XX`„kVwVl@bk„‚bUŽlVXIlƒnLVa„mVwV@@nV@XaVJVbX@lwV@n„@nV@VWnIVVUŽÆ@Xx‚a@I„UUKmk@mVƒ„IXmWUš™VJnUVU@anaVwk™›U@UXa@W™@m_@a¯@@K@UVƒ„bnK@blIlbXa@WW_n@VƒU@¯bmyƒUkUJÇÅ@WU@kWKÅwƒnm°KVkmankVWnXVWV@UƒƒwXkV@mƒ„UlLnaƒVaX@VUn@VnVK@xlnXWšU@a™@@klak™Vw™mUaV@™wmIÛ`m—@mVUXmlIXƒV‚I@K@aU@UaV_UK@wkUmmUKWXŽmVkUƒL@mƒƒU_nK‚™@aVU@Ukak»@U™™@ymUƒ„¯™ƒUUƒVKkam@™nka@ƒmwkLWb¯mkaƒ_VaVKUƒ™IUw@kKmU@WK@UnƒmaULkU@wUalWV¹U@@WUI@WU@‚_@W@U@mƒU@WbbUK@Um@@UmbUwWWkk@WU„a@anUUwlWUwUU@wlJVUnnV@@mnI@m‚K@U@w„a@wUm@_mƒVUUaVUkƒƒƒ_kċUk™VWLƒ@mlU@kn¥W@UwUWV@VÝU@lXLWVUbVLXlVIl‚knmU@VUJk@@„ƒ@™kVmwmVkxU@@XmVUb@xnKVLl@VxUxkIU`@bWVXX@JWL@bkb„¤@bmUUU¯Kƒkmb@V™VU„VVn@@„Vb@`lnœxmb„lUn‚bk„@xU„mV@bmWbUV@VJ„Il@nVUb‚K@nn@VbnJVIlJVkXJ@X@lmx@bnnWVXJWXU@UlU@mk@@llb°x„IUbnJ@VWbXVmI@JVX@bk‚@bWL@JUXUK@U@Uƒ`n@@Xm@XVW@@nX@@`ƒImxU@@JUI@KƒLmK@UÅUUV@VW@™¯kUU@UamVUUmJ@n„xmLKƒkmJkwkKm_mKXU@aƒU@b@Wk@ma@zUJVUmbUlU@™xnXlWlXXblK„¤V@@nUVVLkVš„l@Xb@VVK‚nXKVx@znW@X‚@@lVK@X@JXbWbnn@JUamLVVXIVxnK@aWUX@˜x@VnI@WlI@anV„IVxk‚l@lbXXšxVVVJVInbV@@ln¦ml@XXVWbkJWb","@@XLVKVXVKUa@UUUmV@l"],encodeOffsets:[[112050,28384],[112174,27394]]}},{type:"Feature",id:"4311",properties:{name:"永州市",cp:[111.709,25.752],childNum:10},geometry:{type:"Polygon",coordinates:["@@lxUXV‚lXUVnlVĢ„JVbUXVJV@XUW¯„VIUK@klW@Un@„nl@V`XUVL@l@šVx@„XXW`UnUbšxUlVnUšV„lb@VnJšUVVVInJlUšVnwVklKnw„LVJVšV@nIV@nbVa@KVVVUUa„KV_nVVJ@_VW„nV@n¥lI@anƒl¥X_VKlwVlULUVVVš@šU@VXL˜ƒ@IUmn@VU@wmKXUWU@m²šl@VIXWWkWUkWlkIVamUXamUnmWUU@@Un™lK@XJl@kVUk@mWKXkl@@aVU@UVWUUVa„In`VUVLnw@U@K@Uƒƒ@w@UVmUUƒ™°K@UnV@bV@Xk@KVm@amk„aU£VWUUmUUwm`UbULka›KXU@kVmU™@aV_UWVIn@˜y„XXK@klmV„V_kWVUn@WUU@UƒmaU@™wnwWanUmmXkƒam@UakLmK@b™xUUUU@Km¥Vaƒ¯@ƒkUaVUlm„UU@mUUÇmUk™Uyƒb™bUa™XUWWbÅLmL@V™aL@WWXUKmmk@a@UUK™XW¥kU@VƒUkxmVkUWbUJnVJ@nVJXzWxkŽ@lVbUX@VVL@`mbUnšŽUn™VV¼k@Ulm@mwLƒb@lmLUK@UamƒWkƒK@£Ua@ƒ›UkJkUmbVlkX@bWbUŽVŽnnUVl„@bšbVK@VX@lb„V@nU¤šx‚²„Knblb@x„V„ô@šlŽ@b@l@XWxnVl@„VV@XLVl‚LUŽUXV`šbXXmJU@@bm@UUkLW@UlUKWUUb™wUm™L@nklVVmVXXm@@bUKlÆn„‚XkllVUVVL@nUbV‚@V@nnV@xUn¯U@JW@UX@xĉ@™`m@@LV@b"],encodeOffsets:[[113671,26989]]}},{type:"Feature",id:"4305",properties:{name:"邵阳市",cp:[110.9619,26.8121],childNum:10},geometry:{type:"Polygon",coordinates:["@@XIlJšI„VVK@n@VVVKnLVwVmnLVK@U„@šw„J@wVIƚ°X@ÜȄUÈxll@kn@VwVaXJWXn@@WVL@UUKVKV_U@@aVK„x@U„aV@lk„@XylbUaV_šVnal@W„U@a„I@aV@@aVUl@Xm‚UXWaXml@@kk@ma@V_UnUV™UUWJUa@kkaWLUmk@@LUVWUkJWkK@¼UnWJƒIkV@b@JUIm@Ul™V™m@Uw@a@kWƒXWKUknW@ƒWUU@k™mx™UkVmIUJUU™VmI@UkaUƒV™UmVk™wVaVmX_WW@ƒUw@™@kUKWVU_k@ƒmm@@VkX@lVLUJƒX°WVU@UIVWUaƒIUġmkVUkWUVWkwWXk`mI@¥kUVƒUƒUn±@m›XkWknV„UVmmU@@XƒVƒUk`@Xƒƒƒk@¥¯»mbĉó@mkU@kU™ƒƒ™KmX@˜UnmL@lULkKUƒWUU@ƒbUaUnƒ@Vb@l„¦Ub@l™@UKmnƒKUnl„UVVbUVn„@`Vn@xƒb@x@VL@nmJ@nU@mmUVkI@xVVVxkXVxmV@bƒbXVl@Xl‚XVxna@Vn@@VVL‚aXaV@n„‚@@V@X`V@@XVJ@XV@UºkXVb@xlVVKnbm„@VXLV@n‚lL@VxšJV„ULUb„`lb°nXalKnx@„lbšmn@lbULV„„V°š„ƒnV@zšš@Vl¼lb@VUV@bšmLV`„„@n„KlVnU‚XWVLnnlV@xVLU`VbV@"],encodeOffsets:[[113535,28322]]}},{type:"Feature",id:"4310",properties:{name:"郴州市",cp:[113.2361,25.8673],childNum:10},geometry:{type:"Polygon",coordinates:["@@²zVaVlnVl@nšVk„Jl_XJlIVmnL@mV@VXn@lV@‚XzV@lyV¯²U@UlJ@XVKnVVIXl@UVLV`@n@J„I@mlI„KVLnUlVUVVLXašKVLl@nb@ŽW„XV°KUnVV„L@xVJ„L@b@LUVVVU„˜VXbmbVbn@@lUbm@x@XVVVŽ@@˜@bkImx@Vm@Xbƒb@l°XU¤„a‚L„mnL@bl@@™VUX@VxnV˜anLnƒWƒ¥XKVwnUWXmVIUWÆLVx„L„w@wVmlU@¥XƒWUkwlÇn_Uw„WV@VU°wnU—ƒy@aVškVlnL@lVn„w@VlJ@b„X„x@bVKnb@U@WVUl@@Vnbl@XLlK@aVLVKnxÞn@a„LlmUaVU™ƒm@ÅknUmaUKmVk@m™kk@UlWUkVm@w@kUU@W™U¯™¥@w„Ç@aVIlUV@kUWU@UUm»@k@mKVkUKUwƒaUaUa›@k„kUWJkImaU@UK™@maUzk`@zƒy@XmJkL@UUJmUkV@z›@kŽkVmK@¦UbWL@a@UbmKmwUK™Xk›VUUkmVkw@UUKmL@WUIWa—JW_k@@WmI@mk@WkWULUUVKUUVm@šU„bš@‚nUǃ@U@w„™V@Ua@aƒL@ak„›l@k™UƒJƒwó@@L@V@„™`@œƒJ@xnn™šmV@bkJmUó@ƒn—JW„UUmƒU@UV@Lk„WlnnmVXbmxšxV@nbV„V@XVm@UVlXU`ƒUŽkn@lWLƒW—zm@UJVXU`@bVšUn@lWVœLlbVKVan_VxnVVVUXV¤ƒbnl@bUn@LWlU@@amU@V¯L„šVVUn@V@x„„@V@L@VmxUKUVm_ƒJUbVV"],encodeOffsets:[[114930,26747]]}},{type:"Feature",id:"4307",properties:{name:"常德市",cp:[111.4014,29.2676],childNum:8},geometry:{type:"Polygon",coordinates:["@@l™U™mkUwUyV™@VW@¯Va—VmUU@KVUVUVLnaWƒnkUÓV_@mVU@݄w@ƒka@kVmƒUmK@IkaUamKkXWaUW@WUk„™@@KVU@aU@™L@J@XÇVUKVak_mWkLWakVUbmLUUmlUVKUU@kUWW@UImJ@xkLkKm@@Xƒ@ó݃@UUk@UKƒV™ƒULƒKƒXkWWbkaƒIUƒWU@mUk@WLaUJġ™ƒ@@XÈÆVIl‚„Vnz°aV@U„m@X`@XWbkakJ@amLƒaU„@V@L°@@bn`š@@XWb@VœVlšUxmb@bUVmVUI™šXVWnƒJU„@nnlVLƒV@JbWzk`m@UVK²V‚x„k„LVl„@Vn@V„„°xVKVkœVVlUblx@bU„‚Æœ@@nVnUll„kx@VW@@VkLWxUL@bÝ@kKkVõV@bkXVVUVƒ@ƒVkUkV›LkV™a™@@™ƒ¯xUxmX@JVb°WXkK@Vm@k„Vb™bn¤‚xUXkJƒblxnXÆK²l‚_@Wnašn@ŽUL@b‚JnIlV„@lUœ@@¯ô@lWȂIVKVm„U@aXaV@lwVXn@@K@UVKUUnU‚bn@lWšX„ƒlJnUšLšKV@„„l@²a@UlK@aV@naVX„WV_nKlL@KUm@a°U°@VXL@a@wWmXal@„k„@VLn›V@@bl@VnX@mwVa²aVU@mk@"],encodeOffsets:[[114976,30201]]}},{type:"Feature",id:"4331",properties:{name:"湘西土家族苗族自治州",cp:[109.7864,28.6743],childNum:8},geometry:{type:"Polygon",coordinates:["@@@KšL@wnK±nƒnm‚—@WUk„ƒÜÈn@n»@mVamk„mšU„„l@V™nmmU@wUan¯VKšLn„VWlInyWUœI@WWk@KXU˜n@mnUmU@WœƒmkV@ƒkXašaVaUm‚Ikƒƒ@kaƒX@ƒUm@UKWU@UkJWkXa@IVy@UmIUVU@UJU@WXWmU@™VakaU@@Xm@Vm@wnwV@VL„yV@VakUUa@wUUVmlI@K„UVkUamJk@VU@UmVaƒan_@KmUƒ@@anm@ImWX_WWUk¯ƒ@k@Wƒ_m`@bULUKUnUWWXkKWaVmnU@@b¯UUbVŽ±K@UKUUVa¯UUmJUƒVIXmI@UU@WmVmkUV@b¯w@lmI@W@aƒ@m¯LXbmJVLklWL@V@XXŽmbVVU@@VU²Ul@VlX@bš`Xx›zUmkUVÒlŽ@bXLWxXVlš@V„bkLma@nmVmULVbmVUb@lnzmbUÒVl@°nLV„lJkn@bmJk_ƒVmmkblxÈx@LUb„xVb@V™n@JmLVŽUš@„nV@¦VbnJ@lVVbkx™bm@UxVLV@n`UnVVV„kl°z„xVb@VU@@ÆlXnWm¦nbVK@XVVUVVl@X„KUV@nVL@WnIWŽXLVKVLlxUbVKXVWbn@@UnKVLVb„JšU@aVU°b"],encodeOffsets:[[112354,30325]]}},{type:"Feature",id:"4304",properties:{name:"衡阳市",cp:[112.4121,26.7902],childNum:9},geometry:{type:"Polygon",coordinates:["@@lšV@XV@„mXVlXL„W‚X@l@bVxn@šŽšUVkn@VJ@I@alU„JXIVm@»‚LXllIXVVU@Kl@VnXKlb@lVbXIVVUšmVVU`@nbl@@lXLVVVKVbnXWJ@VXbWxXb„Ul™VK„¦nLVVUVVbšb„K@U˜LnK@Un@VxlUV`UnnL@VVL@JV@VUnxnKVbV@@VšIVUnJUVUl@nW„XllIUa„KVbÞLV¼²`V@VIUwlaVmXa@IWanK@U@m„kVƒVUVaX@lšnaVLÈ@‚¥@kkJUWJUaƒXkaUm‚wVXJ@_lWUU@¥n_‚KkamUK„™@amKƒnKƒbV£¯W@k„aWan@@UnwlJ@a@—@UUU@W‚wn@Va@km@UanaWa—UVƒUUVU@K@aƒKUI@wƒKUUVm¯LWUXƒ@mak@UK™LWbUKVUkUmVUKƒLkJ@nƒJ@I@mU_UK@VWkUJmUUL@WkI@V±VU°kzU@Wy@kUm@UWU@@nmKUnkJWIk`ƒIUlm™k@mUUkUb±yUX@VUV@bk@WlXL@nVlUl‚k@WI@ŽkLmš@VV@XVmnnVWbnVUblJXkVl‚XXlWXUJk@±™@nXVWVnL@xUVm@Vn@J—„WK@U™V™@UUVUVKUkkxULW`k¦m„@bkJm¦U@ƒmUX@`UImUU`ƒLVbUVUU@LUbmaU@mJU@U™UIƒKmxkLUl"],encodeOffsets:[[114222,27484]]}},{type:"Feature",id:"4306",properties:{name:"岳阳市",cp:[113.2361,29.1357],childNum:7},geometry:{type:"Polygon",coordinates:["@@@wUklmUUmU@@UVm@wUaV_mmUKmwkIkJmUUnm@™™@UUƒbUKUƒmÛamm¯xVLkbÇƃUƒVUzkVUlƒUUKWLX¦W@ƒVUUUaƒKUbmLKm„@akU@aƒmVaUUVIVWkk@wkƒƒ@@xmLlmÅwmbVlXlÝIWVkK@kkVƒL@VWKU@Ublnaƒƒm@b@bšnW`@XUJk@UUWKƒk@UKƒnn‚@xmLUVm@kbVbV„nV@V„b‚@KnV„LWšXŽÆVĢ¦VblŽš„n„UJWz@ƙVóUVbkV™aÅx@¦lVUbVVknWKƒ„k@ƒwƒK™VU„Å„ƒl@zkb@`m_mJ@xX„mbVbœ@llV@n„@llbXL˜UXalUšl„alVnwnLVKlšVbX@@I„V@blJ@bVL@VVVUXȤ‚VnkVÑXmlbnš‚„VKkÑř@UmaVç@±XUlI„xlV„@VaX¯lUVVUšVJn—V@°°nŽ°„Vxĸł°¦šb²¦lJ@U@aUK@kUm@_m±VIXal@„Kl@„bV@K„K@k„m@UmUUaƒK@_UJƒaXU˜@Xmš_VmUk@WUk›@kU@a@m@UƒaUUU@al@ny‚XXWWwkly@¯n@@bnV@k@mVI‚„œVlUUmlU„JUw„I‚bXƒVaUal@K„b@ƒVKVkXVl@VkUU@ylUœVVaVL"],encodeOffsets:[[116888,29526]]}},{type:"Feature",id:"4309",properties:{name:"益阳市",cp:[111.731,28.3832],childNum:5},geometry:{type:"Polygon",coordinates:["@@„ŽÆxXL@l‚V„@ĢšVI‚bXKl@nVV@„XVŽ„JlbXalX„W„LVKš„„UVLl@VV„@ôބ@@Wn@lLlK@wnIVJX@VX@lVVUL‚VnkVVnKValUXblKnXl`UbVLÈU@W@IšKV@@bUV@Lš@lƒXV‚@VXXblWnLVblb@JnL„VUn@llb@„ƒx@ÞUV@nU`VÔmlX„mbUKUVUV@LVVUn˜ŽUb@°UXš@U‚VzVxnlVškšVnlVnaWƒ@wnIn`@_la@y„kƃVƒšU„L„xl@„ƒXLlmUUVakU@¥ÆwšblUUaôVšU@ÅXyVImƒ™ƒkUaġ¥ÅUWX™ƒKmU@Lƒa@UmUUƒUalan@VUnK@wm„m‚L@V„lXLVVl@VI@WX_™m@a™¯mKUkwW¥UK@_UWWLUVkUWL@WUIkVƒU@JƒwkLUUmJVI@WkXm@VmkKUIU@mmm_@VUV™@™„kJċwUU@KUWkkW@IWW@km@klwkWVkkU™V¯m@kWLU`mIkmkXm@@`@L@xUKWkU@VL@JUU@mbUKVa¯WVnL@`lXUVkU@xW@UbUWVU@UJ@„lnU@m‚nÈmVƒa@bUL™wUb™@@VkxmUUƒ™UV›K@IƒUƒmk@akm@wmIƒŽkK@b™VWXkm@wULUmm@UVW@Ub„mbkKƒVn„U@Wl„xV„U@UXmWUXmlnbUl¯Lmn"],encodeOffsets:[[113378,28981]]}},{type:"Feature",id:"4301",properties:{name:"长沙市",cp:[113.0823,28.2568],childNum:5},geometry:{type:"Polygon",coordinates:["@@lVUllXkx@lln@‚XX@JlXXl‚V@LVVČxlIšƒš@VU@Un`nnV@VJlLUnn@lW@XUJnIVVlK„x@I„VlUVJ@XXKlVVUXKVX@`VLX¦lxVŽnLš°‚an@„„‚bkmVaV@XL@U„KlU@llLXUÞJWkUknaÆxnŽ‚knK@w„@l„@xllUXUJVVUb„n@blV@bnƒ‚LnKVa„LVbVV„UX@W¥XKVL„VVklUVy„U„VÈÅlaUK°wnnÜbn‚V„VL„aVVš@šn@VmnVlIlJna„@Valkn@na@amwm@„UXw˜K@aUUVUUaVa—wWK@kU@UaW@kKUUƒƒ@k™W¯XWan@k„™mmÅ@@I@U@KmLkaVUƒKkLWVUƒk@UVmU@am@kkk¥ƒUƒVUK™„maUb@ŽUb™I@aƒKkkWm@W¯K¯b@VmaULVxUXlVk@UxVJVbUb@xULƒ@ULWW—LƒĕmxVVL@šVb™KUwƒaŲWwX@@WƒUWLU@VbkV@aU@@VUnmJ@VUn@VƒLUK@U‚mUIk@UÇmU@@UW@J@LƒbUmVI@aUmW@@bkXUx@lmLUbm@UbkJ@V@XmlUbkKm@ma@kUaVU@aUK@mImJUIkVƒUƒVUakbWwka@UWKkLUamKUXm`Å_U˜ƒULmaU@@lUV@X"],encodeOffsets:[[114582,28694]]}},{type:"Feature",id:"4302",properties:{name:"株洲市",cp:[113.5327,27.0319],childNum:6},geometry:{type:"Polygon",coordinates:["@@X‚‚Unw„Ė˜KXXVK„@VK@wVaUaUIVwl@kUVWUwVKnb@U°a°LXŽ‚@Xnll„L@bšJVa@VanbšƒVL„U„V@al@@UV¯ÅÇ@Ummk™w@¯ƒyVwnUVVVUkmWV—nKVUƒa@WXkVKn@lUVU„VVVXIlV°VnI@VlKnV@mwVm@LXKWkU¥wWwƒƒ@k@m„X@KX¯V@VUVa@VnKWkœƒV@VUkm@aWa@wkUWwkmV£VÿXUVL@mVIXaò@nW@ašUš@@am™@aUU„UmXmWUk@ƒƒnUW@_maVm™wUkamaUL@aƒwƒW@akI@UƒxUm@kmKUk™lUŽ@b„zV˜m¯xUVU@ƒXVxm`kÈlxXVW„@¦kVUn@xƒxƒKUwÅKVXUJWnXŽmVUxWL„¦XŽm„mK—bmUUwW@UV@šk@ƒšVLnŽlbLm`@¦VVkX@`WIUŽxVnlb„WVbXIV‚lI@l¦Ç@UKmbk™W@UbUVU„ƒl@n@VmLXb@JWbUnkbVxUJUxWXXlWL@V@V@XXJWx„zUVVVVKnXW`@bkIUl‚„nLVJUbUIWVXlWV@XklVbnn@xlš"],encodeOffsets:[[115774,28587]]}},{type:"Feature",id:"4308",properties:{name:"张家界市",cp:[110.5115,29.328],childNum:3},geometry:{type:"Polygon",coordinates:["@@@InWVw°wš„@š@šblUœKlUlV„U„@VUUUlW@aöUlUlLÞ@@aVKXwlK@UX@@UlwkƒVkUm@m›@ÅVƒ@akwVaUk›UUlUL¯wƒƒ@UUmƒ@UkƒKƒlw±UULVn@l_XyWwÅ@VUUmJUXU@@mmƒU@kxW@UaUIWbU@@mU@UxƒnUbmKk„WJkUValƒ@aUkUxƒlW_@WUIU@ƒbkKWUJVnUb™bWb„lU@nl›„@XnVmV@n—mWV@LXl@X›JXVmzkJUXmƒ™KULm°Vb@xnVmnUšk@ƒƒ™VƒnnlUb@nm¼m@Ûǃ„Vl@X˜mnm„²ŽmL@x™K@LUl@nULÆx@V@VXVWbXX˜l„@nLlm@bVKœX‚W„L°bnUš@VaVUš@šmšVw„JnwVK°zn@V‚Vb„a„@Ċ¼"],encodeOffsets:[[113288,30471]]}},{type:"Feature",id:"4313",properties:{name:"娄底市",cp:[111.6431,27.7185],childNum:5},geometry:{type:"Polygon",coordinates:["@@lL„nJ@xln@bnlV„‚„@JœLVUšŽV„nVlw@Uš@VašxVK@a„bnUmÇnV@km@ƒ‚I@VUVVXVaX@@wlVVUkW@_mKXU°‚UbVLnaV@‚V@IUKV@XlVL@w@K@_n@lWlnnJV_XK@l°nšU@WVU@kV@nbVK„V—lƒ@nLlƒ„LXU@ƒlmkw@nW@UKVa¯IVn@@aVUUKl@nXVKVn²a˜ŽXblKnLlmVI@KUU@akLUaVa‚UXm@aƒ@wVUVKnLnWlXl‚n@@U@anUVm@U‚Inm@IUK@UmKVmU_kVUwm@@VmL—K@VƒL™aUaVUUUmKƒ¥ULkšƒVWaXwWa@UXImWUaULUUWKk@WnXbWŽVWnk@UV@bU@@bƒJ@bƒV@XkŽmb™UU`VbkaWzƒ@klU@ƒb@VƒwUL@bV@U`ULVL@VUK@Xm@XWWIUbUxm@@lkkÇwƒVÛÇW@¯Å™UJ@xƒI™xƒ@@VULmKUnUxmKULUUm@@‚ULƒU™JkIWJ@b@LJUW„kJWnUV@nn˜Ü_nJšxU@VbšnUxlškb@lš@"],encodeOffsets:[[113682,28699]]}},{type:"Feature",id:"4303",properties:{name:"湘潭市",cp:[112.5439,27.7075],childNum:4},geometry:{type:"Polygon",coordinates:["@@Æ`n_VWnLVblKXL@VlbXxlaVb„U„VlUVJnInJ‚@VL@bUVVb@lnbn@lLVank@W@UlIVan@VanK@kVwlW@aX@Vn@bUJVn„a@K‚IX@@VV@nŽVÈl@VJn@VVL„K@UVm@UnIVm@UV@@blUUaV@XK„V@XW@XxƱ„bVxšLUa@™UKWk™@wmmUalk@WXUWkXUVJVaUImKƒVklJ@aX_mWULUUVUƒyXwWI@W@U@UXKWkXWVwU@±_U»ÝKUaƒLVbkJkƒWmXk@UVVŽmIUV™J@UU@UamLmwUVU@mnJ@VUnmV@b@Vm@kkWmXmKULUV@x„Ž@bWnVUbVblK@bVV@LUJknmKkLWa—±bUmULmWk@VLUV@bm@U°JUbVLX@@mlxkn@„WVƒKk„mK@k„"],encodeOffsets:[[114683,28576]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/jiang_su_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3209",properties:{name:"盐城市",cp:[120.2234,33.5577],childNum:8},geometry:{type:"Polygon",coordinates:["@@„n@‚°ĀÞ°@¦ULWKkx@bkLWb@lUlVXXJVbƒnUKmxXV@bm@@Xš‚„LޚܦXlVnš‚mzVJ@n@‚²ÞôkƃÞaȰĉ‚wnljÜó„éVÛnĊīČlj‚ĉ@ō@KÞUlU@ƒkklÇÈњÑlġXɛ@UġƒƒaU@U_ƒW@n™@kaUL@VW@kKmkUV@bkbWW@bkzma@ƒJWI@KUKULƒ@U¦™`@XUJ™U@KmXƒw¯KXkmy@aUIWJXXmV@K¯UU@@bVL@¤VLXbV@@JVXVK@„„JVn@bkKmakVVXUVVVlI@`U@nzVVƒb@¤n@@UlKXLVVšI@V@nV@V‚@ÈUx@šóVōšƒkÅWó@mU@bk@Ýwk@WbXxm@@J@zV@kVƒbV‚nLWVUX™WUXUŽWLUŽ@Wl°z@VkxU@UVWIxWJkbƒĬ„nW@@bUl"],encodeOffsets:[[122344,34504]]}},{type:"Feature",id:"3203",properties:{name:"徐州市",cp:[117.5208,34.3268],childNum:7},geometry:{type:"Polygon",coordinates:["@@XKVX@WnIVx@K°Lnll@@I°K„nVašU°x²mlxš@VanU@aƒk@akmV@@w™@Ua@aUwVwUw@w›@UK@£kaĉlóIÇVkŽ±@@kUKmVkIkxW@Ua¯UUm@UVI@WVI„JV@ƒ@Um@Uana„U@m‚I@J@XV@XaVlkXƒVaUUWLUyVIXmWak@ƒXkJókƒJUL@KWkk@ULU@Wa™lUIkJmI™mk„VbVš@lV°kXUKWKULU„mb@VUlVnƒb@VV@IVKUUmU@ak@@bmV@xklƒUƒU@UKmV@nƒJVbkXƒKUamLUJ¯UUVmI™bVV—Ll`@LƒLU`m@kXUVU@V„lxUK@xkIWbUKƒx@V‚kVVn™b¯@@U™@ƒxk‚mbkLÇK™b™@@XnJ@LmVklƒ@@XƒlUƒVkxƒakVVb@bVnUbU@@x˜VUšVb@š„ŽnIĊ`šXVVôJš_„K@xlU²Klk„U„@VaVVÈm@kVUVmnamUUaVƒXIVJ„@‚ç@¥nkVLn›„@@XVK@VUX@JVUV@UnVJVLUJVLUVlšnI„b‚KnU@m°™VanI@anV‚KVL„an„lK„blš„KÞk@¦@¤@„VKnLVK„L„KVzlWšLX@VmV@VbnU°@Ualk™˜WXLVU„KWkUUWšƒ@£Wa"],encodeOffsets:[[121005,35213]]}},{type:"Feature",id:"3206",properties:{name:"南通市",cp:[121.1023,32.1625],childNum:7},geometry:{type:"Polygon",coordinates:["@@VJ@bnzWl°L„xnW@LšVVI@Wš_V¥„@VKVL@LXJ„I‚@nbly@aXXla@aVUnllLX@@UVKlbš@@m„XV`V@„bĢ„lkČÇƃȘ¯šwnĕVĉVÿšUƒUĠƒŦğlXÑVǵ@±ōLʵĖ¯lÇbÝÞ¯xk@Çkķé™n¯@ğŽġƴǫ@kVVlUbƒL@xULǂóLUl¤@nkVV°VLkxVb@l™aUXUKWĖklVX@¤UšƒUkb"],encodeOffsets:[[123087,33385]]}},{type:"Feature",id:"3208",properties:{name:"淮安市",cp:[118.927,33.4039],childNum:5},geometry:{type:"Polygon",coordinates:["@@šnźUôÒɴ胚l¦nĖV‚kbmš„X@xVlVL@xUb@bUJVnUx‚šœ„lKVLÈx‚m„zXV@lW@XV‚b@bȚVxnb‚ƒVIXa°L„aÆVVaXUlK@aXIƄVlXKVUlIXalK@alwXLVK@¥Ý¯¯ÿ@ƒmVk@aX@ƒm„īlaXI‚wXJVUV@lw@U¯yb›UaƒUġUÅaUKVknaġm@kUm@wÆIV±nLÆw„ÇnUUkƒ@ƅÝU¯JÝI¯¦Ul@bƒ@@VVL@l@LƒLÅmƒL@b™@UaVaUWmLUKV¹KƒLWKX¥WI@mXk@UmaUVUU@VmL@W™bkIUWƒUmVóIkbmm™@UbVLUxmJkU@bkJWbnXU`Wz™KUÞÈlVb™Lmx@„kè@Æ"],encodeOffsets:[[121062,33975]]}},{type:"Feature",id:"3205",properties:{name:"苏州市",cp:[120.6519,31.3989],childNum:6},geometry:{type:"Polygon",coordinates:["@@ôèĊVnX°¤²„lxƒÈÜ@²x@J@b@X‚`nIUƙUUV@bl@VVnL@L@xƒJ@X@blJXnW@@`XbW„kVƒ@UbVxƒXUxkV@LóxVbUVWš²šVJĸklUǬ@ĢƳĠ°@šmƒī°»ÈÇ¥ULUU±a@bU@¯ƒU@KnImUVWUk™mXUVU@lIVaUUVWKUbUkWKU¥n£WakJUkUL›K¯L™KkƒVIn@VaUƒVUUƒ›UkVk@ƒU@amUkJƒ@UUlwX¥W@@UkVmk@JUakL›@kk¯ÝmJUn@nmVXlmbVVkn@„UJ@±WUxV¯a¯KōbżÇxUxƒšUUlWL"],encodeOffsets:[[122794,31917]]}},{type:"Feature",id:"3213",properties:{name:"宿迁市",cp:[118.5535,33.7775],childNum:4},geometry:{type:"Polygon",coordinates:["@@XbWnUJVzXKVVUbW„klUWbU@@W@IJ@nƒVmbVbn@@V@„UŽƒIUJ@XUJ@VVn°VVbX@lwlJnUVL@l²@lÈUôJĊklb@¤VLœ@@xVxUxVx@bVbš@@xU@ln„mnX˜mXLVmV@X@lxVnVJôL„LXa‚x@b„@@KVL@bn@@m@™@alLUUVaU¥nIV±‚I@mXI@aWWXU@LlUXWW_XWmaUwǙ@aaWUX@@kWUƒynÇwUKkL›ƒ™VwUmVI@aVa@wUKUk@wƒWn™laUmĕk¥„™ɳçóÑŹV™mmzkVmm@a@Ióƒk@@LWU@`—„WbXLWlkImJVn@`nXVbXŽmL@Vn@‚l@nUVl°Xx°U@LVĠ@z°˜@¦UV@Xn@VJmV"],encodeOffsets:[[121005,34560]]}},{type:"Feature",id:"3207",properties:{name:"连云港市",cp:[119.1248,34.552],childNum:5},geometry:{type:"Polygon",coordinates:["@@@‚lzXxmÆV„„@@¦„@l`XnlKšXXm‚KnLla„b„@„xmbm@kL@V@Vl@@VUXšJX„mbš@@„°Æ@èÈzlW°XĢJlÈ`lInbšWV_@mš™@UUķnƒôw°ÆmnaVƒVÛVmĸ»Ģw±Ý@@mUIny™UmWkۥݙƒK™@Wn@@aWUnwVL„mUaWIUWVk@kkJUVWLUkŃWJ@bkLWVUbÅUƒb¯KWbUJ„WXX`WXkV@KWVXX@bWJ@nJU²mJV¦UbVVkK@b@š@nm@@aUK@Lƒ@@awWbƒKóKUIUmkwW@U@UnWK—nmWƒn@b„l@bmVUb™@kw±n¯w™VUb"],encodeOffsets:[[121253,35264]]}},{type:"Feature",id:"3210",properties:{name:"扬州市",cp:[119.4653,32.8162],childNum:5},geometry:{type:"Polygon",coordinates:["@@VUXblVVV„b@xV@kz„V@l‚wVLUbVV@VU@VbUbl‚b@nkĶ°IÞV@Ɔ„VlmVƒÈÅxmKU²ÅJ@xVn@lĢnmbUlVLÆbĢV„V‚bœV‚aXk‚@VXKVVWšXVWXUmKU„aWaU@™¥@£XW‚UUV@@ynam_VWkUVUna@ÆV@mnkWmXkWU„W@k„@@akklƒlWUI@UnKl¥™I@VVma@a@I@U@a@anK@UmK@ÅVUnJl™kI@aVwka@mVIUW@UWL@WÅbmIƒƒULka™UWƒUxkLUKWlXL@VƒImƒÅVƒU™mĉL™Uól¯I±l@ÒUbVbUVVXUJUnVV@lnbl@"],encodeOffsets:[[121928,33244]]}},{type:"Feature",id:"3201",properties:{name:"南京市",cp:[118.8062,31.9208],childNum:3},geometry:{type:"Polygon",coordinates:["@@k@ma@kUUVmVIUWVUUaVa@Ѳk°Jôk@Wmk¯KmX¯aUakKƒƒWU„@XU‚LXaV@@mUaVUUl@VmkaUXm@ƒWUUna°IlmV™m™IUW‚@Uk@@aV@VVX@„V‚I°»nm„U@VKVan@m»UaU@U_@WlIUa™aVaUala@¯n@‚ƒkaUkUUWKU@mwkUUmmL@K@ƒLmUUVƒKƒVÅImU—JƒƒVkVVLšèVLVU@W„L„V„š@nVÜULVŽUL@bW@XbWbkJƒUUVUxVXmVk@WUUkVmIƒV@„nbnVWbƒJU„kUULƒa@Jma@XkK@VVL@L@JƒLUVU@V¼ƒnXlƒbm@kbUKmn@lVb@VXXV‚UV@b@LVbÆxXbl@@lV@U„VV@XVK²VlIš`„UbVbUlVVn@WXn@@VUV@„@KmbVLXқLkKƒV@nX@VVUV@b™nVllbšmnb„IWVXU@`lLlknVnmlLlbUmVInK°nUƒU@l@VU@Vn@„ƒ@alI„`VIXaVaVa"],encodeOffsets:[[121928,33244]]}},{type:"Feature",id:"3212",properties:{name:"泰州市",cp:[120.0586,32.5525],childNum:5},geometry:{type:"Polygon",coordinates:["@@lUU@@y@In@WwXal@Þxl@@anVô@ÆX„lŎ™ôU@™Vw@ÇUU@@m@U™JUUWKkL@Vm@@£„aUUmyV@@_kJUUVUUWlUnblL@aUmƒI@ƒULUW@IU@WaUK@£UK@aV@°V@LnUWWXIla„VV™@£UWlkXĕVLVWšb@kUalwUKU¯lU@mk£VôKȁVK@w„KVaUkķlUI±™ğ¥ÝUŹš™Ž¯ôm¦ƒĸ™‚@XXK@VVXUJ@nlbUx@blJkšmIUV@ÆnL@VmL@b@b@V@J@bnb‚U@UšJk¦mL@VVJkXk„ll@bƒ@@lƒXXVWlXnml@nÅU@ŽmbUVlVUXn`mb@zU@V‚VWX@¤š¦V@Xb"],encodeOffsets:[[122592,34015]]}},{type:"Feature",id:"3202",properties:{name:"无锡市",cp:[120.3442,31.5527],childNum:3},geometry:{type:"Polygon",coordinates:["@@nLƒÒlxUVkL™am@™ƒkVWUULUxVVVbUV@bVLU‚nnź™ÞVĠ¦X™VUUaôw@KlUVw„WUwVa„@lUXƒWa@_X@WmkI@a@W„I@w@KmKUUk@@aVUšVVÅmJ_@W@a@I±wÛ@ƑÇkw±ƒ¯£mWĉUóçƒK¯VkUWK@XkV¯UWabƒmUa™UUb™lln@b@xƒbXŽWX`@„VxUblL@bn@Vb@`m@XbWnn@l¤„n@xnVlU„™VLÆWœkV@VbÞJ‚_nƒl@nKVU@aU™U@mVk°WVLUV¯bVXŽ˜bXlVn@VmL@x—V@bl„š‚@œnW@X@VVJ@²VJVU"],encodeOffsets:[[123064,32513]]}},{type:"Feature",id:"3204",properties:{name:"常州市",cp:[119.4543,31.5582],childNum:3},geometry:{type:"Polygon",coordinates:["@@„L˜ŽnxUbVVƒL@xnnW‚nn@VVXn@‚yœImx„„°ƒšL„a‚¥n@VkšKVw„W@nX„VJ@b‚@UVn„ƒ@UnUV@L‚b@`VLklVÞn„Æ@VaXLl™ÈJšmmVUK@aVUUaUUVwVKXVlUš„n@šblKVUkw„ÑmKUVUI@±UI@U@WmX@›™kƒ@a˜U@wnK@UUmWk—aWU°aVUUK¯XUl@nVŽVš@bUVmLk@m„`ÝIUaU@›lÅXUKƒškVmU@wƒmk£m@XmWan@@_Uam@@akKVaUw@ƒW_XW„a@w@akmm@mL@UJmnUKƒ@@XnJWLkKUb@„Vxk„WƒL—aWVUImVULUK@L@lkLVVVllb„m@@°kbVbUbšbVbkJ@XV`V@Vbn¼"],encodeOffsets:[[122097,32389]]}},{type:"Feature",id:"3211",properties:{name:"镇江市",cp:[119.4763,31.9702],childNum:4},geometry:{type:"Polygon",coordinates:["@@šVĊKšn„VÆUn„„J@UWKXkVLlKVwX„šVlbVK„„nJÆaš„ķn¥°óÇIkšWKUbÅ@mƒUÝlkUK@_a@KVUVm„@mƒVU@@aUIWƒ@mƒXUx™LUlm@¦ƒb™K¯„ƒƒnw›Jzm@UW@UmmXmm@w„KUUVamw—ƒKm@UbUL@ŽƒVmn¯¼JƒUW@UUU@@bl@@VŽVXšJšnnU‚‚k¯JmbVV„Xn@VWlbUnk@VVUŽVb@nU@WbKWVƒ@XV„„lLVb°bnW°Lnl@X"],encodeOffsets:[[122097,32997]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/jiang_xi_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3607",properties:{name:"赣州市",cp:[115.2795,25.8124],childNum:18},geometry:{type:"Polygon",coordinates:["@@„`l@Èbln„@„KVLl@„V@bȎlnšKXkVlVL@„lJnb„¦VKVVnX„W@w°@VU„mln„UV`šU„bVUV@„xnKVI°KXKVkVL@al@Xa„LVlULWV™VVL@b„x@VXVmb@x@V™VV@nn¤„šlb°b°KXXWbX`lbXx‚z@x„`VIVUnK„L‚x„WXLVKVbVLVU@wnW°b„@nalX„‚mXVJn@U²mKkVl„U@@xlnœaVmlKnœ@JVLlŽnVššl@XXÆèVlUX@xVLXVšb°W@wnUWmXk@K‚LVwUmUkUKUw@wVaVK@kƒ@WnkUKWkwlmXL@KVUlLVKXmWU„L@ašL@malaVk@aa‚ašƒnXš@VVUblb„Jn˜ƒXa„V‚wn£„K@UWmUk@ƒUaWIV@b™JW@KmmU@aUUUkmKkVKlUU™nKVU„lVaV£Å¥WUUK@UkUUw@m@mIkƒƒUUWƒLƒK¯Uw°¯@wUKUbƒKmƒ@kkKUL@UUKV¥U@manw@k@U@Wm@@U@Wwkm„wWaUU@UUmV¯kwƒ@@kmƒkKkUW@UK@ÅV@XWWkXa@Ul@Va@KVaUUU@ƒaXwla@UkVWaXk@K@lmkUmV@Vmbk@ƒ»XIƒ¥VUkƒVUVU@anKVUƒKUalU@wX@˜™@a@K—@ÝwƒL@ŽUnÇlUIkJmn@ŽƒbVVb@VmnkLƒV¯U@ƒ±l—IWmƒ@kaUI@aÇU@K@KUIkbWbƒJUIUyƒX¯ƒUbU@méUUmUk„WK—xWIkJm@V¥U_UJUwmVkšƒUU@ƒƒƒ@knƒwm@UmkWJkL@n@VW@@‚U@knm@kUml@xÅxƒ@@XUJlb„@VX„JVxn@lbV„@lULnV@VlnV@bWV@bXL@lVLVb„V@blLn@Vl„K@xln@bX@lašLVbnKUVVb„KlXVVkxƒV@nnVUb‚lV@@z—°WWkbƒIk‚WL@LUJ@bUI@b™`@UmI@mkK¯XW™™mUV¯@UUVUUam@@VULWUJƒIm`IUJ›KUkW@Uxn‚WbnnmlXbmIUVmV@Vnb@V™LUKWLnÒVVV@V„UL@„kJUV@bƒÈ@ŽšV°šŽ@XVV@l@xUz"],encodeOffsets:[[116753,26596]]}},{type:"Feature",id:"3608",properties:{name:"吉安市",cp:[114.884,26.9659],childNum:12},geometry:{type:"Polygon",coordinates:["@@lxnb@V@bV@ln@‚n„‚lInš@blVXK‚nk¼@VUKWL@b™L@`UXU`ƒ@V¦XLĠ@lJ„¦@„nV@l°nn@‚mVXnaš@nb‚K„n@l„IVƒš@VanJ@_lKVVnš„L@L‚K@Vn@VbšUVanKlLnbnJVbšnWVnVVanI@‚Vb@L„bVKVanXVbVJVU@aXLll„bôlƼXxVLVK@Xn@ƒxnVVVmb@LnVVKVXV@@mnaVXUVnV˜K@_UaUmšwnKV_‚anKVLš»„K@¯ÝU@›™U@kWlUn™lknK‚VnaUkma@ƒUIUwl»Åw@ƒVwV@n™‚n@ÈXlKVmna@kVw@anm‚@n_WWk@™™mUkUK@Im›kLUn›bkm@wV@kƒlUnLV±m@UInWƒkWmbƒ@¯amX@xUVUKUaULWKƒXwƒKmLUVUJƒ_@wyWwkaW_XaWW¯L¯akaƒ™m£@mUUš@U@wnaWU@Uƒw@aUKšUXUVKUkƒKWbk@@bUKUlWL¯LUJmLƒwU@UVƒa™VU_ƒVkmƒnUV¯@@xƒXmWUUULƒ¥makI@ƒUKUkWl™LkmǍ@aƒUk@UKƒLƒ@kmÇak@ƒ_VlkL@`lbnšlLVanLnbmVÆln@škJlbknmKUbÝmmwULUK@bkLWKULUUma@Kk@UV@L@llbVzšxUxnl@bVLmŽšŽ@IVJXœVlƒLV`@bn²@J™@™V@Xmbñ@WbUJ@bm@@LUĬU‚„¦lV@xXb@blnUV"],encodeOffsets:[[116652,27608]]}},{type:"Feature",id:"3611",properties:{name:"上饶市",cp:[117.8613,28.7292],childNum:12},geometry:{type:"Polygon",coordinates:["@@„„@„V‚š„„I°`nm¤²@bVJUVVXUl@Vmb@xV@XbmVVœ@lkLmbn`VbnU‚@Va„UnbVllUXV„a@w°VW@_VWšLššnVlbšLVbnl„KšnVK@IUW@_@am@™‚ÑUólK@U@WU@VwU@UI@aUU‚aXƒƒ@kwmJV@yX@k‚anƒƒ@mkwVmmI@aUU@aUUW@kVkV@@anKš»„XVWnIVUl`@_„W@wlUœV@UWKnU‚bnŽ°InJl„UV@VnI‚b„Wn@VklL@l@Vn²m@U`kI@bWJƒnV@°VXnJm„XVmx@VVL@bkLmWULUmU@ƒbWXb@llnX@‚xkxVV„nVV@¤nL‚nVxnJVXX@˜ššbn`VI„b„@„blmlLnaV@„blWXnlUnbl@„ƒšKVanUVmm_XK@kWWnašU@UnaWUXa›ƒXamUkKmXUWƒLX¯WakKm™nUWwXa@KW_„aXWW_@WnIVl@XU‚LnWVknK@ImyUUÆbXK„Û@W@IÆUnƒVÝlkVK@mUIVwkUVaUm@aVIVyXIƒaÈwmmk@UnanVUmÅaó»lwšW@kkUVmUK@WKLƒUmWULkamK™Lk@Wa@wk@UU@U@mbUIWVKUXWmkUmVm›U@LkakKƒw@w@U™¯ƒ‚ƒUUn¯l@bmn@xkJWxkL@VkI@mƒkmJUI@V@b@VVxnbWlkÈkVƒLƒbkKmVƒL@V@²nxW‚kLUL@xlKVx„bXmVnšWJ@ޙ°@n™xUKUw±`UImVmnU@kalm@akwƒU@UUJmxU@@Uƒ@kU@Um@@Kn™ƒVm@k™KmkU@@WUnkLWxkVUwmKmLkU™bmKUbVŽ@xUnkJ@n±ŽšUxVXUšWJ@LUb™lUnm@ƒW@nknUJUVm@kXllknVbÆK„VVbš¼V„@šUl"],encodeOffsets:[[119194,29751]]}},{type:"Feature",id:"3604",properties:{name:"九江市",cp:[115.4224,29.3774],childNum:12},geometry:{type:"Polygon",coordinates:["@@WUkVUkmaƒVUb@mVUam_nalK@kU›nUWaU@@wna@UVkUWVUUI@a‚±n£m¯_ƒJ™ƒU@ƒƒƒĉ¦Ul@UV™Km™mLlm@ğ¹m`Uk¯@@UVK¯™@UUK@amkmKkVVUa@UkUƒKƒŽUa™L@VVXUJ™@ƒnƒ@™š™WUbƒnVb¯V@LÅlÝIƒJÅkݙm@Ua™WUU@UmUXmmwVUUKWUX±mUam@kWƒzUaVmÇw@aÅLmKXƒ‚UWKkL@W¯IƒwVw™lkUƒJ@Um@ÛÈWŽKUxWkƒaUU@KkLVl@„UKUX±KUb@nVVUbUVmaUlUL@„ƒaUL@‚@nUlWzX`@„V@lx²„@Vlb@bšVÞ@°nl@UxVL@lUbVV@n²xVUVmnUÞb‚a„J@IšV°xnbl@nbÆ@VwnK@VnXlK°xnUlVX„V@Vl@L@lk@W_XK@KƒkWxUL@J„nVx@aX@VVUa˜IXlmL@bVVX@VbnK‚a²XVWƒk°a„@UnV¤nbmLmW@XbmJUbVL„aÞK„L@K@U@aVKlbV@nXlJœxV@VnšŽVȚ„ÞKôbźĕČmV@ĊšŽ²xÆIšV@Þ¦ĸ¼ÞVlŽVÞnxln°Jœk‚LXWVUVUVwnJVI@yn@lXlaXmWI@w—»ma@UmK@akKkXmW@_kaWakKWk@@K@IšWƒkUa„ƒ"],encodeOffsets:[[119487,30319]]}},{type:"Feature",id:"3610",properties:{name:"抚州市",cp:[116.4441,27.4933],childNum:11},geometry:{type:"Polygon",coordinates:["@@°V°UnÜ@n@lnLlV@bšV°L„lnLllVzVVXlV„V@@L@xX@WlX„m@UVƒL@V@n„°škVmVUnKlaXxVbšnlU@lVVnaVI@aX@V„šJš@V„@b„b@šVbš‚@X@lUL@Ž@VlIVm@wUVanLšalVnKnLVxlUXwlKVm@k@Una@mWIXKWUÛVƒk@a@UVWn@@kl@@W„XlW@_Um@UVK@a„LnalInWV@@xnI@¥‚K„—šm@kKmƒnk@mlI„¤laXbVblknV@U‚KXVlUXa‚@@Unw@±mU@ak_±a@ƒUJUIƒVKW_Xa@aWU™šK@mmUVa@IXa@UWmšannlmX¯WKXwVUVwƒ@XUlK@klJXa@kƒkmm@Uwƒw@¯ƒW¯kw@WmbULƒaUUU@mVUU™WmkUb™KmkkK@aƒkUƒ¯¥Uƒl—ƒm@akU@mš@KVIVV@KUkUVUkaƒUWb—„mƒIkaVaUU™@mW™„b‚b@bUlkb‚b@n™K@bƒKXVWnULkKUV@LWKknlxXŽVLml@X„Ž@lULUb@xVxVLVlVnUxK@LWlXnmV@x¯X™aWUUK@wVWUkÅçm`@mn@bUx@lmbUnkLÇWm@mšU@Ux@„Æxk¼VxVJ@„nbVlmbUmLklmškVlX@‚VœšV@°Þ"],encodeOffsets:[[118508,28396]]}},{type:"Feature",id:"3609",properties:{name:"宜春市",cp:[115.0159,28.3228],childNum:10},geometry:{type:"Polygon",coordinates:["@@@VlbnK@b@JšLlUnx±ĀXxÆW„X@lš@V„@@blJ@nX@˜xUbVVUbVV@b—VmnmJœ„@bmbm@klUbƒLmbœš@lVb@xUX@bVVVbV¤@LVV„bXlVw‚LXÜÇn@@V„IlVškUx„x°J@XlKXLV„‚WnLÆK@bÈxUnVb„ylXn@Vbn‚W²XV‚LVVUŽnxWnnV@VVVšXVbn@ޚÆl„IÞJÆk@K°UUa„mVa@UUUš»@wV@VƒkkUKUVW£U@UmW@@aXkVUnVlKVV„UUkVmU™@kWaUanU„VVamIX¥W@@aUaUVW@_mW@UnIVVn@VbVm@bVL@anKVUkƒWK„UXV‚Ikx‚@na„bVK„b@nVJ„_V›@Vw„‚VUVVXUlUUaV@X@VblašbnKlkVaXaƒ¯@m@U„KVUn@WƒXkW@@w@KU@UƒWkUUUykkmKƒk¯K™U@akUmK@k@mmÛ¯V¯U@‚ƒL™¼UKmLbU`mL™xVnVb@`—LmUVUUWmb@nU@UWULmU@KnaUUmU„wmJ¯IUJWIkVkaWVUIUlWaUIUVkKmbUIƒÒlVUnnŽ@VlLUJ@bUX¯@ƒaWVUKUXƒKUbm@UwKWa@a@VkUWn™@Uak@mbX„WJXbm@mL—aWVk@™wƒL@WmanU@knwWmkaWL—KWUXaƒU@¥l„UVVVbnwƒ¥nKV™»@aUk@a@UƒJ@kƒmLma™@mbUWnm@ULǺ@LXnmxUŽm@UbkbW@@akLmWk@UXmJmUkV@VUXVlULmKUxkL@lmXnJ@X‚l°Vnb@bU@WbKUX@VmKUX"],encodeOffsets:[[116652,28666]]}},{type:"Feature",id:"3601",properties:{name:"南昌市",cp:[116.0046,28.6633],childNum:6},geometry:{type:"Polygon",coordinates:["@@šXš™„@„mš@VIUW@UšKVb„„LlV@VVbUŽlUnLnl@bVL@V°šUL@V°@Vln_Ġºn@‚knKnššLVU@VkĊ¥Vk@™Uƒ™»UaƒUÅLUalmkklWn@VUVIlm@m„Xn@VmškVa@KXIV™UWVw‚™²@m@U@VK@k@W™Ua@™ƒa@aUƒ™@™IUƒW@@bUJmbUU@kkV™mUaWwkbmLUVUn™lWbUbklmL™akbUaW@U@VbkVWVUUUVƒUx@‚Uœƒ`UI@mƒaULƒamb@lwJWUƒVXLl„UVmL@bUK@aUnUam@UUmJ@VnX@`UXVŽVb@bX@W¦nJUbƒUmVVbXb@lVšUnVlƒVUUkLmUUVWl@bX@VnV@X¤VUVLllU„U@@x™¼VV@V"],encodeOffsets:[[118249,29700]]}},{type:"Feature",id:"3602",properties:{name:"景德镇市",cp:[117.334,29.3225],childNum:3},geometry:{type:"Polygon",coordinates:["@@VVX@Vbmz„xUlU@mbmL@V²xVbUVVblbX@šVškVykValKVI@bn@n`lVWnX@l„L@™WKnƒVIVa@¯nK@alIXJVIVWUw‚ƒn@nU˜„nK@alI@a@anKm_™a—™W@UWmIUwmmK@£UUƒmUUlwwW@km@kWaX„aV@VnVKnXlK@aUK@UnwWUnƒmIUW@¯mU„XI@alJV_n@m±@U@kkKUlm@ƒXamJ@UVUkƒmI¯JmamVXL@V›UkV@xƒX@`k_UVmJUXƒW™¼mL@bU@UllX@VV@bVV@bnJUnlx@n„Žm„b@lWŽ@zU‚nIlx„@W„bVV@bVJV@UxV@@X@VkLVôÒ‚šn@@b@`VX@J"],encodeOffsets:[[119903,30409]]}},{type:"Feature",id:"3603",properties:{name:"萍乡市",cp:[113.9282,27.4823],childNum:4},geometry:{type:"Polygon",coordinates:["@@VWnL@UVW‚LXaV@@ama¯Uk@WmInW@klKVwnLVKUkVW@UlUnVnIVWl@nXlK@bX@laVan@VnwWm@KȹVK¯m@kmU@ƒƒ¥kIğ@WKU¥„@V_VW@_šK@aXKVL@Ul»mWLkU@am™kJƒm@kmU@@a@UmakwU@›„Xlƒ@VXk`UIW¼kWWX@‚œ@l‚xV¦XlW@Ubn„@ŽmUkL@UmJ¯UkUWVUaƒUlm@UXWl„nUJ@LmLU˜nXll@bUVUUmVUn„Ž@¦šxlŽnn@VÆÈU°kbV„VxllnL@VnVVUl@V„„anL"],encodeOffsets:[[116652,28666]]}},{type:"Feature",id:"3606",properties:{name:"鹰潭市",cp:[117.0813,28.2349],childNum:3},geometry:{type:"Polygon",coordinates:["@@@XV@nlšL@lUnš„mŽ@Ln@@VlV„@@VV@nwVI@V„Vlx@bknlbV@nmnUVJ‚_²‚VxVLšw@mš¯@ÝXIm™nUWƒaUwkL@wVKlKXmw@±@U„KnUlL„a„KlUlÇXkmaUw@U@a@Uƒ™UkwUJ@zWJ™w@WbkVWUL@VmUklUaWakbƒ£kJ@nmln„lL@Ž™nƒ˜L@¦mJ@wU@mXkJmbƒK@bUL@VVn@`kXƒW@Xk@@lm@UX@V@b„lÜUXVWLXJ@nmb@V@l"],encodeOffsets:[[119599,29025]]}},{type:"Feature",id:"3605",properties:{name:"新余市",cp:[114.95,27.8174],childNum:2},geometry:{type:"Polygon",coordinates:["@@m@@WULUKWwÅ»ókƒakkWK@bUVUIUamWUbULƒa@KUa@mJUbmUXU™mUamImakKmLUb™VUam@@UL@KƒKm™UUkL@`mIUb™@U„@V@bVl@bš¼UŽmL„¦mxUaUUƒVkŽ@¦„VWbXV˜LXKlbXnmx@lmVnb@X„Kšxl@XU˜bnKn@WaXIWƒnal@Vbš@XmlV@U@bXb‚LVxn@Va„LVWVLXU„b°@VW@aVIkK@UmVmkU„ÑVJnalLVUVJXbVkVJXUlblUXJVI°JnI"],encodeOffsets:[[118182,28542]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/ji_lin_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"2224",properties:{name:"延边朝鲜族自治州",cp:[129.397,43.2587],childNum:8},geometry:{type:"Polygon",coordinates:["@@Wxĵ„mš@„ó¤VX@@xܼƨš²xWxƒV„V@„XVƒ„„„ƒbWšXllaÞU°Ċ„@ô¼„LôÝWanV¥ƒÑnĉ°¥šÅX¥°¯@w°w@»°k£°mÈŹ‚mÈbƃŎ¦„K°z@Žkxl¦UbU¤šššklV„KŤÞȰ@@bšV@nVVUlÞ¦lUllœVlU°ÑU¯Vƒ°w„bXxl@VŽ²„˜@n„ô¼ƒó°™kmVk²ĕ‚w@wV™ÞÞ@@Ġƒö»˜¯œ@‚„šbnb°mÞ¯°V°„ÈJmX¥mam™UřƒUƒlaU¯™ƒ@w™Kk—l±n@@wƒkÝVUUl±¯I¯b™a™lƒ@™kLmakbƒ@ġƒŹé°™Þb°šékƒƒLm™„wX™‚aÅb@bVlƒbVb—ÒVbUb›UUanwƒakbVŽUV›ak„¯„UŽƒLmxV°UxnôŻX@J„Xkl‚bkbĉaƒbƒWU„ƒ@ƒk„WUU¯@@klmƒ@@™Å@aƒwWXlKkI@WbUaVIUanUƒƒ@ĕƒ¯K™„mUnWUwm@£ċèkUmbUmm@@nkJUalwk@@nmWUan_óaWmnw±KœIƒwl@UmƒI@an@@mlUÅmV_™KUkƒ@U`@_ƒKUmU™@U¯™mmb¯@kb™ImV¯ƒƒLkbƒKƒƒÛ@ÇnɱJóaÝĢkb@„›x—ÒÇllœ@‚Ž²V‚„ÆUVV„UÇ°X„óxlV¯„lV@bƒV@n—x›@—¤@„șŎnxV¼knšJ‚nšKX°˜¦UlnVbUbÆVnÞWVX¦llšb@l°œVJôÒnLVbšbXŽ"],encodeOffsets:[[131086,44798]]}},{type:"Feature",id:"2202",properties:{name:"吉林市",cp:[126.8372,43.6047],childNum:6},geometry:{type:"Polygon",coordinates:["@@ôl‚zšaÈV°„šK@„mŽ—LWl™nšVxUV‚È@ŽÝĬUÈn‚ôLša‚„²VmĀkV@„ĠĊnU@b„V@b˜@nl°UVnÞaôJ@bš™V„¦mlkššbmVXx¯@Vxm„nbƒ„šbÈK‚V@bÈL„wĠyônšmnbÜ@nn„V˜x@n²K‚„„J@k„al@nxÞU„Lź±Vwkw¯LWWUš™kŎīVwƒw„°y„Vĕ°wÈVlkÛ»@wW@Uô£@ƒn™ĶƒXwW™aUamKóÑUI¯›@k™akkW¥XUmÝÅUVaUa‚mVk—¥W¯™Lm™IlmU»mwȚō@ƒ˜£kJUÇk@am¯y¯UVwƒa@wġx¦ƒKƒƒ¯X°Ċ¯¦U°ċWULÅa±b¯@UkÅWmVƒ™ƒkIUlóŽċ¹™`óIƒlX„WŽXxmbUƒLݏƒbƧ@ƒx¯bƒÈ—l@xƒš¯zƒaݤ@nšm„VWb²bmn¯J¯Ò@n„š"],encodeOffsets:[[128701,44303]]}},{type:"Feature",id:"2208",properties:{name:"白城市",cp:[123.0029,45.2637],childNum:5},geometry:{type:"Polygon",coordinates:["@@ó™ǩŁ@WlwUaƑwÛÅÇéĉamKƒōÇ@Iƒ™ôġVƒȁÑŹçƒ™ÝUƧċĉwóóÝ@Ƒ»ğL¯ll²@ƆÅV@¦m‚Åb@nmlU²VxšlUn™@VbnW„bÇbk҃š„n@èlnlšU҄Ž°Lšx@¼ĉb@҄šUŽċxՃènLVxƒÒƒbÅJ±a@_ÅJÅnƒŽVb„Kl„nUÜĊ@„Uš™xXVÆn„mšVššJÞ¯V™ĠwšƒXw°xWL„x„KV¦ôU„wVÝǬóÞޙ¼‚‚„ÞkŽVôȘxބU„lVn¦ÞšĊa°w„b°@šbÆw„lŤL²`„z°@V@@™nJVnl@@¥nUmmn„@mwnmmUnk@mlwUaƒLnƒ›wn¯°anƒWakI„ƒÇmXwÆamUXUlJXa‚UUklKUknmÞV@‚K@VWÞ@VkUwVƒ"],encodeOffsets:[[127350,46553]]}},{type:"Feature",id:"2207",properties:{name:"松原市",cp:[124.0906,44.7198],childNum:5},geometry:{type:"Polygon",coordinates:["@@„šźèȂÒU„óĢ„š@JŎȄ‚‚LnŽĊbÈêÜƃxVbkx@XǪłôš„kÞ`„šW„b@n°ašbšKšnVw°`š_X`W„š¦„ĊIkmVšakw‚K„x°UÞb„U@lšƒl@°¦œVW„šaÞbšxÞI@mVI@ƒVkŚUWK„¥nL‚a@ƒ„@ȍ„@°ƒÆ@nU@KÞalkUwVékUWw„™kU›VkkƒJk¯@»ókƒV¯ÆÇI@bĉô¯@™ķw¯nmmÅL¯wƒVƒUÞy@UówÇLkmm@@UóxkkĉmL¯wVwkWWX™mLõm@kűV_ƒƒô»ÛƒÆ¯@™Va™VšaĠVlmğwķUóÝƽ£ÇJkbǫaƽLW@nxݤkzƒy¯XɅm@VšôÇX¯Ė¯ºÝnUŽnLVlUÔmV"],encodeOffsets:[[126068,45580]]}},{type:"Feature",id:"2201",properties:{name:"长春市",cp:[125.8154,44.2584],childNum:5},geometry:{type:"Polygon",coordinates:["@@„U°xÆKnn°mĸxš°@Ċó@aÈJ°Å„Uôl@¼l°„IllœUlVƒšXxlVUêVxkllnÈUVll@Vx²IÞ¤VUlVnIôlރlwô_„›„bVaĶLXÅÞÇ@K˜¯@wÛaƒçn¥š¯WXyW¯XwƒUmmÛ@ma™nómğzƒxÇK@aUÇL™a„ƒmanƒUw°@WwnU™al™nkƒ¥šU™@aóIÝbUm¯Vmk—@@aƒU@amVğĉ@ƒlUnÿ±Uƒ™bóKmVÇÞī@ÇVUUw‚™šmXk˜Kn@ƒ™L¯ƒÇU™byókōè@b‚n@lÝX@x¯ô@ƙUV_maXm@aóƒJWxnX@ŽVVnĖVnUJ@nōÆǼV¼kxƒLklÝw@xƒx@zV`ÅbmxU±xU„nnm‚kn‚ŽğU™bUŽ‚šUb@šÅ°Ü„󼄄U`Ʋ@lön‚KšnXWlXUx°xnKĊllôw@Vn@lnÈKôx@VÝz„V"],encodeOffsets:[[128262,45940]]}},{type:"Feature",id:"2206",properties:{name:"白山市",cp:[127.2217,42.0941],childNum:5},geometry:{type:"Polygon",coordinates:["@@Ušl¦kÒÆ°„IlÒU¤ôz„¼lJš„U„n‚ÆXVl°@²aÆbVKČXV¯°¥¯ĉ°W„„„L‚¥Ģw@x„bUx°V°zn‚‚b@ÈlVŽlIœ@˜w@m„U@akU°ƒkUôwWƒÈ¯VUƒVUƒÅ±U›@kÈk˜Ñœw@ƒlaÞġƒUÞ£@ƅ‚KnÑĢ¯@W‚aUaVUVkkw@a¯@¯™Ý™ƒVXnW@@WkXmK@xkKUb@bW@Uw¯„mmb@WKUbmUbUaWbƒJĉIVW@I—l±LkšmU™bUm™@ƒnkKWa¯n™@„`Ubma™„ĉL@bƚ—@W`ƒL@n¯‚Xb‚@kb@x™Lƒ„™@V‚kL±™™mlUIU¥mL@lÅx@_laƒƒ@U—aƒV@kmmƒK„£ƒƒLƒƒmKUnÅKVbmXVlèĉUUbml„ĢŤƒIlŽ¯bǦœl‚@ô¼Ģ„@x°„l¤„n„a„l@x™b"],encodeOffsets:[[129567,43262]]}},{type:"Feature",id:"2205",properties:{name:"通化市",cp:[125.9583,41.8579],childNum:7},geometry:{type:"Polygon",coordinates:["@@ÆlXnĠxĢ°lÈ°š„K„°kXm‚@¦Vbk„ŤJšnݤk„VÞVVkȄb°y„™@w˜k„Ç°a„wƨ@„aސ„K‚VnaWwXWƒ„kôJš_ČºôVkƒ»óyV£kуJůlÑk¥V™ša@wƒkƒbƒmk£¯ƒ@wġƒó»@›kÈ¥°ak„JÆ£ƒġnkVaĊVkçWUnUaÆLVmnL„„‚KU™±@—„m@a¯U„bmV¯m@_ƒK™™U™ƒaƒÅ™Wó¹ƒ@UanmWak@@wmI@y™@mk„JVa™@UaƒIkJ@n™@Um±kkxƒm™Ik„ƒbÇm@Ž°bXn„V@Ž°ÈmlÞ¼¯XVº¯Lm„kWWXLmVVlknƒ@@lnWƙ„Vxbmšnšm„¯lÝaVȁè@¼V„„b™„ÆŽ°ÞUVšJ„„kx›I—xƒƒƒIV¤™ÒXxmn"],encodeOffsets:[[128273,43330]]}},{type:"Feature",id:"2203",properties:{name:"四平市",cp:[124.541,43.4894],childNum:5},geometry:{type:"Polygon",coordinates:["@@Ɇn°W„zlyÞ£mwX@ƾKǬblaÈIƾ¤ôÞĸVĠxnmmVƒ²w‚VnwÆaU_@y„w@wÞxlk„KlwU»È»ŎÅ@mVIUmmĕUU@mWXw„Iô‚@bWnnbU`‚šV@Å°ó@wÞW@km@aŎ烙@m°Ñ°Inm±aXaƒU™n@mƑšU¦@šÇŽ¯aU£šaU™ġ¦ÅҙJōUŻókUÇ@™¥¯ak¯mUVak@@aċçÅaUƒm¦Ý`XbƄ@n`ƒI™xĊÞōÞml@šUb@Wl™_¯JkšÇUÝÆÅb@n™„llUb¯„±a@ƒ—ƒWĉJġĀ¯™Unóšm¤œxôaVnƒxôI@x„V@bmƙ„@lnLmޯޙxVb¯þ"],encodeOffsets:[[126293,45124]]}},{type:"Feature",id:"2204",properties:{name:"辽源市",cp:[125.343,42.7643],childNum:3},geometry:{type:"Polygon",coordinates:["@@żôŎVšIÆÑĢ¥Vš™bV¤°bȍ@™V¥ƒ™Þ£lÇUUUÝlƒÞ£™mţIlƒUa@¥nlWƒ¯ƒL¯™kÇġ¯ğwWmÅk¯UƒVU„„bWlXlmnƒbUx¯xVVknlŽUbV„ÇKUb@„™VnbmlnzUº±bmJUbWÈnèm҄š@X`WL"],encodeOffsets:[[127879,44168]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/liao_ning_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"2102",properties:{name:"大连市",cp:[122.2229,39.4409],childNum:5},geometry:{type:"Polygon",coordinates:["@@‚IÞmVk@wXWÜbnwlLnU„@‚nLlbXW@a‚wnbl@XL‚aš@Ċ¥@LULnJ@xVnmV@VXXV@VJkn@VÜKXXôJlb„xl@„IVbnJVLUbn‚lnVw„JVU@ƒXU‚aUUlwn@°ƒn„VKnV°_VJšwl@nwlV„IXWlIVVnK@IWmkIVaVU@WÈUlmU@U„WUalkXġŻ@kIƒ»mm™akUm›ĉUŁV»²ġVĕ@aUU؍IɃ`ȃ@kƒw@ƒUƒmwĉ™@ƒWķсIĉÇbÝLkymbIƒwÇmÛbmbU„¯ÜõÈkÆVbŎxnXVÆnšǪ¦„bš¤Uš™xÝnĉÒmĊVȄ¤Èš„bƼ„Ā„„ÆÆބźb„VVbX„‚°²¤"],encodeOffsets:[[124786,41102]]}},{type:"Feature",id:"2113",properties:{name:"朝阳市",cp:[120.0696,41.4899],childNum:6},geometry:{type:"Polygon",coordinates:["@@na@UVI@m„ÑW™kaV¥UI@wl@„aÈbšm@wVašk„@@K@kƒ™@a@UUmƒUUalmU@KÇUű¯@±kUKVkUaƒaU@¥m@@¯k@WLUmkn@mmIkm@amU@wVmkU@Klk@U—m˜aXIWWUL™aULVbƒmk@UUmUk±™_Uym@mbkImaX¯WW™xWKzU@WƒkJWwkV™@Um@UbVVVVXb@VWX—@WŽ@Vkb@V™nUK±aUUlwX™ÇWKknU@mmUkƒLUVƒVUUVƒUaƒw™bkKmwnIƒ™kJ@nmbƒ`kmVkLWwUm@UUU™K@UmaUa@UUaWK@mUƒ¯Wkk¯VmUUŽ„xVXUVmL¯ymXkWUbmXUKƒVknWx¯JVnkLƒl@VVxnxlĀVL²WlX„l@bÝVUn@bnlÜaXblIVl@šš@Ȧ@VmbXV‚@@x„VVnUn@`°@VnXU@K@„VV@VmbnVn@ln@b„xƒ°Ub@bšLV`Ånƒ„W@@lUšnnWVU@Vbkl@Xl`XxV„UblŽkX@Ž°¦V„UVVbUlkV›@UbVbkLUxmJkXšš@b‚bœxVKÆlXX˜bnŽnala@ƒUk@U„VVklKVUXKVU°KVan@VUnLšKVL„WVaU_@mmUXa@m˜wXwVkVWXk‚k@›„k@klm@wXKl@U@KVUUUVaUƒV@„alL„xUx@b°°VnnVšxlIXJmx„LUVlV@bnX@Všb„aVx‚@XJ@b‚n@VŽVXȄl@llX@lU„Vô°°@ބVbn@‚V„k„@VW"],encodeOffsets:[[123919,43262]]}},{type:"Feature",id:"2106",properties:{name:"丹东市",cp:[124.541,40.4242],childNum:4},geometry:{type:"Polygon",coordinates:["@@lzXJ‚U@š²x‚@@Vš„@bUVmKUn„°n@lnVK„„nV@n@VlV„°WbXn@‚VzƒJ@¦@bkb‚bUl@bkbƒJ¯zƒWULWbklV„nb™¦VJ@„„K°U„kl@@W„bVn°@„Všm²U˜nX`„UÜLXmVXlKVbUVVnUbn˜ƒX@VUL@lUbWxš@²kl`n@Vlb„@nUVWVLVU@aV@²bl@ÈmšxWX„VÈU„JV„l@„„la„WnX‚KÈkÈ@Va°bÆm„@XV°IVV°UnalƒVUn@UwVU„@@VVJ„I@bl@XK@wWmXU‚UVbkJVXnJVI@mƒknwlKXL@`l@VI@UUaVKÞn„aVm@aÇ£XW„U@aÇUU@mbkKm£™@WW™ƒL@@Kk@kl›U—bWKUkUU¯UõÛƒmUUaVU„U@WU_W@kVkJƒ_WKkV@bUL™¯¯ƒ±mk¯ġƒğÑ@UmwƒKUakƒ™ƒa@a„m¥ÝƒIUWmk@w™mţ—L›KʝbȗKWĢklVbƒX@VV‚knÇV@XUVUblJXn@J"],encodeOffsets:[[126372,40967]]}},{type:"Feature",id:"2112",properties:{name:"铁岭市",cp:[124.2773,42.7423],childNum:7},geometry:{type:"Polygon",coordinates:["@@XJm@¯šmXUlnVbUJƒU@bV@UJWL@VXLmJVbkXlJXxVL@b@V@n@b@`Vbk@lxknV@VV™V@bUL@bV@@bVK@VXLWLXJ@LV@nbWJ@IUV„x@LVJUXVxVx@VV@@LXJWL@VU@@L@VnL@bVVmVX@@VVInJmbnLWVnVULVVU@VVmX@@JVz‚l@„nVVKVXރ@mk_lm„UUWV_nJlUÞÑÞVVUVƒVL„UVJ@I„Vna‚@@KV@XwWknwnKlalU„w„aĉݚwšJl_@aUaƒKUUU@WU@WXUÆ@@UVK@n@UnVVšblK@bœllb@b„bW@Xbl@UlnLl°°bš¦nKlVnI„V@UWU@WXkƒw@am@nm@aVw@I@KUaVIm±XÑlknJVnVJšaX_VaUaVKmwnkmmn@lU@U@mnašXlKUmUIVmklaUK@UlUVUW@U™kVm™a@UUU@JmUU@@bmb—KWV¯XUKm@ka@UVKVk@aUKmLkKUUÝUmbXbÇJ@k@WU_@m™™@klm@UXKVaUI@KWUXaƒÇWk™aWUkWUL±U@lUU@ƒUJƒI@V¯JmIm@@aU@Uwƒa™@UV@VkI›V¯aUkƒWkb@bVL„@@VVVUXW@Uaƒ@@b—‚ÝbUV݄@ŽƒLmUkVUbVllLUV@LššXŽWbUXm@U`@„kxlnnJlbnIllšLX„lVlUXmVK„n‚V@L"],encodeOffsets:[[126720,43572]]}},{type:"Feature",id:"2101",properties:{name:"沈阳市",cp:[123.1238,42.1216],childNum:5},geometry:{type:"Polygon",coordinates:["@@ȚĊÜ°„b„L‚lÞxUbUn±‚@ÈnVÆL@xnLšlUVƒbƒxkImJkn@V±LUxkV@bšbšKVKnzVl@L°@Va„xÞUlbôxVVœ@@V±bnŽ@llXL˜ŽöXĶŽnal@nkVJVI@aU@@aVK@ašUUUU@lmkwl@Ua@_@a@m@U@aUKWwkIlWUanIWK@UXKVIU@@a„VVIUa‚mVknW°™n@WI@KUƒmULWnkVkUWƒ™KkkmJkamIkmlw@ƒV_n@VWXaW™™@KVUkKUkValUnV„K@ÞƒVUÞa˜@a„@VbX@VWUU@Uƒ@UK@ala@IkKmUUa@U@ƒVƒkk™WVwU_@KÜUXbl@V¥XUVmƒƒƒXa‚kŃlUUkIm`UIUJW@UIKmkm@UUJƒImmU@ƒVUXU`mIUbUK@LƒJUU™l@Xƒ@UbƒJ™kU@ƒŽn„m@Uam@@ƒ™aUmLKƒwƒ™mWXUK@kUaÇa@JUIUa@aƒKVUƒUXmƒUy™_@lmbkLUKWLX`‚n@bVL@JXL„‚WX@Vnb@Vm@UbnVmL@V@x@LUbVV@V@LƒUVl@mb¯U@xU@UVVV@X@VVblJ@bn„VKUn„x@llnL±¤™b@k`VXÆK@„kV@¼kl@bWIUl@VmLnbm@@JXXmb"],encodeOffsets:[[125359,43139]]}},{type:"Feature",id:"2104",properties:{name:"抚顺市",cp:[124.585,41.8579],childNum:4},geometry:{type:"Polygon",coordinates:["@@„XVl°bœUlJ@UVUš@„bVxV@@bn@nJ°I@U„J‚I„VV@V@k²VVKlXXVšb‚lÈX„ŽWbXV@LVJUbWL@Vkn@lšš@nV`@X@lÈIWanaÞVVVlLnKVL@bUlUL@Vlbn@VL°WXU˜Lna@aV@nV@IVV@VšbUnšl@V‚XnKVa@U„UnyWkXaƒaVk@ašašbnm@_WKXmWanU@alaU—l@XJVLVxX@˜wnKnVlwƒƒ™@V_@a¯¥@UkKWUaUU‚anK@IƒaU@WUaVw@klUVyUUVUUÇ@Iôbša@mnUma@kXa@UWak@Wa—l@a›@WUƒLmU@U`mIUU™`mUk@@UUK±nkJƒbUam@kwm@@a@UU@Ua@@K@ƒVK@kmKU_UKƒUUaĉWmkkL@`™LƒnmlkLkbmK@k™@Ulmb@b™„@Ž„xUVƒIUlmVXXƒxm@™JUUk@WUk@ƒakx±@¯x¯Umb™KUUVmUU¯UmVVn™WkÆ„lWb„„„ŽUnWVU¦k@WaÛV@LV`UxšXllU„@„@VVbnVlL@J"],encodeOffsets:[[126754,42992]]}},{type:"Feature",id:"2114",properties:{name:"葫芦岛市",cp:[120.1575,40.578],childNum:4},geometry:{type:"Polygon",coordinates:["@@ll°X„ŽnV‚@XLVb@VVbnb@VšLVV@VVnXxlKnU‚l„_na@mlI„šmJnxlLša„xVbU„VV„UVU„KVlnnV@lmXLšÈWŽkxVV²bVLšm@Ula@UX˜@XW@UWaUUUUVan@V‚š@lUXxlIX„V@‚yXLšw‚ŽXXW°nblJnan@Vzš`l²nVVVl@„nUaVKšbVKnXVaUaVUšyšnXK@kVK‚@X@m@m‚LXa„LWƒU¯„w@™ƒa@UVw„¥°™ó¯¯y¯ƒUǯ»›w¯Iƒm—¯Ç™UUl™¯»ţKċÑţķm¯w@mU_ómk¼VnU`±IkbVlƒnnŽU¼±Lk`@X™Wl¦UbmVUxkXVlkbllU„Vb@bkVmx@XVV@Jb±aULkKWXkWmX¯aUJmIkVm@ƒxU@n„"],encodeOffsets:[[122097,41575]]}},{type:"Feature",id:"2109",properties:{name:"阜新市",cp:[122.0032,42.2699],childNum:4},geometry:{type:"Polygon",coordinates:["@@šXnb°lš„VlnXVJ„LlVnl@zÆxnK@b„blKVLn@@V„aVLVK@L@Vl@XVVInVVKVwlUXwlKšL„ššVVb@aV@X„lUXbVW@n„lWnXKV@@V@XUVVLUVV@@bVVV@@ln@VbVUXV‚I„xVanJ@UšIVWšL@UV@@¤V@nInw˜W„k„lnIVx‚lnzUVÇJ¦VVÜLĸUnW@aV_šWĊXXa‚Knkl@nm™L™a@alUVw²K@UlmnIlJ„w„aVU™kmK@wÅKmU@DzVmVaÝwkƒKƒaÛ¯șĉķ¥ğ¥ƒ@kUWkƏī݃ƒ@@akU„K@KWIUm¯nƒU¯JmwUVmIkJÇLm@™UImJUU@aW@U@@nUb™JƒaƒbXVWn@UVmX@V@b„š@l@Lƒ@™lUb@x™nÇaƒbk@@xVJU¦lbXšƒÒ@nUJ@Vmb"],encodeOffsets:[[123919,43262]]}},{type:"Feature",id:"2107",properties:{name:"锦州市",cp:[121.6626,41.4294],childNum:5},geometry:{type:"Polygon",coordinates:["@@nJ@nlmVnXKl@@°n@@¦‚V„bVbUlVL²l°@ƲÈV@LV‚knVb„VVnnWVU‚@XmWU„a„bšIVa@mV@X@@bVVnIVJ@š‚nÈKlInJVUnx°I„V°mVnXJ@LƒLlV@b„@ބƐĬXllV„@Ġ¦ĸ¦naWW@In@manK@UVkXJ@alk@»lU@ƒÅLUWl_@ša²£‚Kkm@kƒwVmULmƒ@akIUa@U@WUUVU™aÝ@ğ›wkƒƒmĉ£UWƒ@@bÇL@m—a@_mKƒlƒXUwKƒLţÓ@UWw@K@U„I@m™U@UV¥„@°UnJ°@@_™KUwƒW@UnaWUmmI@m™ķwUaÇLóVĵwݙUUW™¯šƒ¦Ux@V„b@šƒxV°X„ƒKWbK@n@nW‚@UL@lWL™m™zUVVbUbmWXXWJ—b˜n@Vkl@LlVUn@xnV@bln"],encodeOffsets:[[123694,42391]]}},{type:"Feature",id:"2103",properties:{name:"鞍山市",cp:[123.0798,40.6055],childNum:4},geometry:{type:"Polygon",coordinates:["@@l„œxĠŽÞ@šbV@@w°Vna‚@Uk„V@K@UUUVa@K@w@UnKmUVan@@Uma@UXWƒWK@IUK@amW_XKVLlKna@kmKVak@VU„@VmšU@anIÆan@‚a„šUVnb@blLV`ÞLlU„bna‚Kn@naVU@¥°IVK@anUUKVaƒUVak™@mJƒkXƒ™UVwkƒVUUa°U@Wƒ@WlkXWlIXUlJlaœx‚IVVXLšll@nLV@lLXl„KĊzš¥maUƒlkXaVK„X°y„Ila@aVkala@a@¥„IUy@WmXaƒ¯kU@U@mmUƒƒULkmm@ƒ¯VmnLVU@a™ƒ@U@±w@™VWIkymLUUkJWXƒJkUmxk@™xUI¯`mUULmƒ¯„m@kxVVbWV@„UVƒIUx@bkšVšVVšxUbVV@V@zšJVXU‚lnk@@lkLƒlƒLUU±Jkšm@UIUVƒLUVU@™K@UƒnnV@l@Ll„ƒaUJ@zn`@nWlƒIUVUUUV±Ln‚@nmL@VUVkLVlUxVLVlÅXma™@@akLmWUX@JUnVJVkXJ@X@`WX„VUVUIlb„W@bVUVL@`Un@¦U`@bUV@z@Jm@@XV`„LUL¯J@IVKmKÅI@J™nWVnLnšVxV¤™z@bmV@VUV@bUL"],encodeOffsets:[[125123,42447]]}},{type:"Feature",id:"2105",properties:{name:"本溪市",cp:[124.1455,41.1987],childNum:3},geometry:{type:"Polygon",coordinates:["@@lb@Vn„lnVVUb@šVJ@nnJ@bmXUx@xVbkbkŽWLUxnl@Ul@„xWx@nUV@¼Ull„knkK@bmbnl‚LVJX@VIVJn_lJVVšXUmnU°VVVUnVVšLna°V°w²@lw„bl@XVl@VVšIn@„wWWnUVk„JVUƒw@šƒ@anaVkš@@lnLlalKnk„mšK@_lKnlĊXVb„VVLV`nL@lUL@„@L@‚VbV@@V@bn@lxn@Vb„alI²mVL@Vl@nVš_VVnJV_‚@nV„K‚V@Xœ‚@b˜kXbl@XblylUUkš™@Xa@UVIlK@UUWVU„Llm@UUUnKWU@K@UXm„XVa@U°KVUUWUk@ašUVKkaWkƒKUknaWa@U—@m@mk@ƒaUJk@@_WKkLmx„l@nUJmIUWlIUaVWVXn@xWLk@@aƒJUI@Uƒ@UVVxm@UVk„mb¯VUU¯JWUƒ@Ån¯aUbÇ@ÇlLmWƒXkbƒƒk@UƒƒIÇVƒUXW™wÇnk@±aU@@bUVUKUXmVƒ@kaUm@k_±l™@XwVa@kVK@U„Wm—VaUmVUUakLUWWnÛKƒVW_—m±V™nƒU¯@Umƒa@Xk@ƒl¯V"],encodeOffsets:[[126552,41839]]}},{type:"Feature",id:"2108",properties:{name:"营口市",cp:[122.4316,40.4297],childNum:4},geometry:{type:"Polygon",coordinates:["@@ĊĖƐn¤„„°Ċ¯ŎWšô„@xXb‚wnKl@nX@VUVƒKmL@VU@Ux݄@Vlb„x„U@VUb@b‚kœ`‚IUlVUn„V@@UV@@JnXlK@bš@nbÆWUkUKVwUklKVU@UnK@mm²KVUVVVU„JXk@mm_@yVI„bkƒ@K@kmU„m@VšLV@VU„KVUVJn@l™²IVV„K„klK@kl@kmVUW™I@y@UUUVa™wUUU™l™@akmmVaUKmIUaƒJk@ƒwkaóIWWÛL@UlmUIU@WW@UnUUm@wmIVK@Kĉ¦™@bWKk@max@bWXkamKƒ@mVkKmxÛaWX@xUlÝnJ"],encodeOffsets:[[124786,41102]]}},{type:"Feature",id:"2110",properties:{name:"辽阳市",cp:[123.4094,41.1383],childNum:5},geometry:{type:"Polygon",coordinates:["@@š`Vz„‚Wn„VUV„L@bVbVJ@IÈbVb@lVLXW‚n„š„x‚LnKVŽšb@„n@Vbn@mƒ„V@šl„IVa„@@WškVV„I@KVLVanJV_VW„UV@nn„JVI‚Vn@na@alLlmkƒVk@»VU@mXwƒwk@@VmkVwXKllaUa@wVwnW@amI@mUI@™VaUUkmmƒ@UkaƒL@ƒUIĉyƒLWkkKU@mKk@™kWKUUJ›wkbkIWVkJWXkl@X„‚@X¯VVbUVl„UxšVW„„lnIš@l‚Ub„VUbVLmV@bUL¯J@¦UVmbm@LmbƒakVÝKU_kK@amaVUƒ™bm@ÅbmJ@b™VUnƒ@UVl@UbnL"],encodeOffsets:[[125562,42194]]}},{type:"Feature",id:"2111",properties:{name:"盘锦市",cp:[121.9482,41.0449],childNum:3},geometry:{type:"Polygon",coordinates:["@@Vbĸx‚š@nnJVnXŽmb@V„XVxšL@`¯@mI¯Vƒ@U¦@VšV@nƒJ@V@LXx@VŤÔ„K‚LVx„W„knL@`˜b@nÈK@a„@VXĊ¤„nVK@aVU@UnU@ašyU£Uwm™mKXUšm@IÆJnLUL@J°IVKƒKU_@Wn@@I@yVU@aV_@¥Vm@_UKUV@aƒXkaVJVUƒUXW@_@WWIUlUIVm@IVW@IU@@VU@mƒUVVkJ›_l@aVa@UƒVƒwka@UރVwV@@UnK„LVU@UmWk@mLxWa@wóƒUVUIÇÆĉ¦¯¦¯xʟJ"],encodeOffsets:[[124392,41822]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/nei_meng_gu_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"1507",properties:{name:"呼伦贝尔市",cp:[120.8057,50.2185],childNum:13},geometry:{type:"Polygon",coordinates:["@@„m@Łkƒ™Žƒklƒôƒ@£kJ°ý™ɅķÑó¤ğLĉÅlÇğŁW¯¯›™ƥóÿlwkţÈéÝƛó™°ÞÅxV¤ĉĖWƒ¯lȭţυ̃ɱÿķƅˋğɱřÝţϙȍƧĊţ@¯kWKUKm¹Å@ķJU@ƧÑƧ„ō¥˹Ɔ@L@„Þ‚VLnš@VōČWJX¦@JŻbU@ţÞmVU@ȁýóbkWWLƒƒÅ™¯UWġkmóƒ±UŹôV¼ƽ¼ƒł̥ĖƽǬʉxĉŽŻȗKΕ̛ʵƨʟÞ˹»Ƨţ»Ǖō˷Ȍ±ȚʊĠUɾɜɨmÜ֞߼˸ƅȂ¯ǖKˢğÈÒǔnƾŎՂ@šĊbôô̐¼ƒ@ĊôĊŽÞĀ™xšĖƧL±ŽœŽ‚Uš°U„°ĬƒČ°ÜƒêɴȂVł°@ƒ„nxŎèƒbȄÞȌ΀ǸlŽ²IlxĊl²ÒmšôĖ™Èl„ĵºm„ÈêVþ„xɛČʉÇĵVmš„ÒƒÈɆôƐŰǀĊ°ÆǬĮƾb„yĊ@ĠšƒXǀċm»ôw°Ûk¥Çm¯ç™kkÇǫţǕéX_ĶWǖīŎaÆĵĸĊ@ȚȘ‚™ĊLĢĉ„VÆĉʊÇĕóaU¥šĉ°mkÅ°ġUĠřk°mƒÑČÿ˜ÛƒWĸ£ʠšÆxÈÞŎÞ»ʈ²ĊÇČalÒ°Ť±ĸz„ŽĊKȲm¤Ŏ@Ò°¼nyȂUźīǖƳÈē°@šÝĶƒ@ƒÈkl¥Ççkxk™›JXÇƒUÅ@˜£k»„óƿīÛ@lÅJl¥óý@¯ƽġƍÅan™ċ™°é¯¹"],encodeOffsets:[[128194,51014]]}},{type:"Feature",id:"1529",properties:{name:"阿拉善盟",cp:[102.019,40.1001],childNum:3},geometry:{type:"Polygon",coordinates:["@@™ƏnǟƨʫšŹɆÿ°¯ÆV²ˢ™żÿ@ÝÆŁȰ¯ȀƳĉó™™@ğkyš¹@īš›ƒwl£Źƒƒ¯Ŧé@™ÇÇxŋĉƩUUŃōL™Ç™ĵóÝnƒóç@™™ó@ġƒƱ„¥ƒç™WUçÆōƒ@é—çťK™çȭVһƽ̻aW¥ȁ£ʵNJǓƲɳޗǔlżÞmĠóĬȂɲȮ@ÈĢŮźÔnĶŻǠšŎȭœгŃċóȭţΗÆƑÞƧÅΫóȘǫɱȁġlÛkÇ°ȁÈnšõl¯ô„ÞɛÝkĢóWĊ„zÇɼʝ@ÇÈķlUČÅÜķnέƒǓKȮŎŎb°ĢǀŌ@ȼôĬmĠğŰōĖƧbЇƧōx@ķó£Ål±ĀƧīXÝġƃêĉK°Ýʇƅ@ΌʉżÅÒϱʈ@˺ƾ֛।࡬ţશóЈèʞUš¤Ґ_޸Ƒʠɽ̦ÝɜL׈ɛϜóȂJϚÈ@ǟͪaÞ»Ȯź"],encodeOffsets:[[107764,42750]]}},{type:"Feature",id:"1525",properties:{name:"锡林郭勒盟",cp:[115.6421,44.176],childNum:12},geometry:{type:"Polygon",coordinates:["@@ʶĬĊIȘƨƨŽ@ĬÛĢșŤĉĬƒĀóšU‚ÈŚÜènŦƐȤȄłϰUƨťƾÑ܆ğɲƜǔÈèʈƲĊƞƒšɆ¯̼V˺Ò˺ȂŤVĢêU܃x„Āˌ˘ƨ„Æ°ѢmÞżU¼ÆlŎ@ĊçŎnÈÒͪŎźƒĸU°lżwUb°°°Vš£ÞlĠĉĊLޏɆnźÞ„n¦ĊaȂīġŃ¯Iĉůl»kƒ„™Çý„¥Ŏ¯ƒén£ġљÝȭxƒÇ™@Åçķ»óƱŎ¥™çWÿmlóa£Çb™yVÅČÇV»ÝU¯™KĉýǕċţnġ¯»ÇōUm»ğƒÑ™wƏbċÇŎċwˋÈÛÿʉÑ°Łkw@óÇ»ĉw™¥VÑŹU™mW»ğğljVÿŤÅźī@ř¯ğnõƐ@ÞÅnŁVljóJƒwĊÑkĕÝw¯nk¥ŏaó¦ĉƒV¦Å`ğуÑÝ@mwn¯m±@óƒÛKˍƏǓ±UšÝ™a¯lƒōšșk„èƒĬގn@ŤġŰk°ċx@œĉ`Ƨĕ°@ţÒĉwmĉ@ƒƒnƒƒa„™¥ķnƒÞĉVóÆókĉŽķ@ÝkƧƧÛaƒ°Ç@ÝÈU˜óbݼ@„ÛÒV°™@V¼ˋL™ÞɅŤŹǠVÞȗŤÇĖŚōbȁƜ"],encodeOffsets:[[113817,44421]]}},{type:"Feature",id:"1506",properties:{name:"鄂尔多斯市",cp:[108.9734,39.2487],childNum:8},geometry:{type:"Polygon",coordinates:["@@ĶL²ĬVłƑkkl@Ȏ™ŘWńÈĬȗ¯™ºlz@ĠššĊôŦô„ÒĠ°kÞܚ™n@¤„UĸèĸbŌÈXŽĸLlÒĢxɲÆ¤ÈÛƾJÈÝ°UšÅĶ»²VW¯ĸJôšbk‚V@ôlbnĊyÈzVôašb@ĸ‚ÞUl°yǬ²Ǭm°ššk„±lbn°@È»˜JX„VŎÑÆJ@k„LšƒÆl²™Ġ²ʊůĊġ‚řóƛÞÅ@m„ƒmLUÿóĉƧ@™»L@„›`ČĸmšȗÑţů±ĉğl¯Ā™wǎƒçƧŤÛI@±ÜĉǓçō°Uwô™ǫůķƳř±bÅ£™ÓÇwnÑó@ȁƽ@™ƒÇƧĢón»ŏĕóĊ¯b„Å™™VȯÅImƒōKU„™LǓ±Ýxċ—ŋ˜V±Āȗ°™„Źl±šÛ@WÒȁŚŹНŚÅèŌô„¼°ȰɞȂVĊ"],encodeOffsets:[[109542,39983]]}},{type:"Feature",id:"1504",properties:{name:"赤峰市",cp:[118.6743,43.2642],childNum:10},geometry:{type:"Polygon",coordinates:["@@ɲŁĢljĊwƾōÞĭ°_ŎŃźȹƒUČÿl»¯ôķVÿǬƽ™ɅġÅÑǫ»̐ʟȣU™¯wVWݍÈġW»Þ¹m݃ɛŎÿŎōͩůV¹›ō™éċ™óŹÅVVĢǩʈ@Ėċ@ķšÛšV°¯xÇÅţ¥™»°Ûô™ĉʟ„¥WýČ¥™w‚灻±mnÅķ¥ˋVƒbUÒġ»ÅxğLƧ™ƒbWĖÅxš¦U°ÝVóŰlô²@š¥ÜÞÛô„V@²±`š¦™„™¯Ý@„ŽÅ„VÒō¼ôš™¤V²ŹĬÇĊƑƒţxƒç¯Lk»ʟlƽýmłÝÆƏ@mö°Ġ@ŚŹĬţÆUĀĠNJĠŽX¼šnźVUҚ¦Ċxȼ@ôlx¯łʊÒÜĀˌÇČxƍČÈƐašx„ÒĠŽn¼ŎVȐ‚¼Ģ°ŤmǖČĊþšLV°ÞŽU¼ċÈUƚzÈa‚¤ôbkŽ‚nXĀšè"],encodeOffsets:[[122232,46328]]}},{type:"Feature",id:"1508",properties:{name:"巴彦淖尔市",cp:[107.5562,41.3196],childNum:7},geometry:{type:"Polygon",coordinates:["@@²@Ζǀݴʶհĸ„˜ƒ¦Ķ™̒Uˌ¼ӾÇƾ¼̨UÞĉ˜Ƨ—éÝ»ƒĕĉ—ƐȍœōǪakó‚ó¯a@™ôţ™aV¯Þ¯°@²él¥ĵğťwōxó¯k±š—Vó@™aóbUÇyĉzmŽkaóŽU@l™aó‚ķIX°±Uĵ¼™Æ¯VÇÞƽIÇÜÅ£ɱŽġwkÑķKWŋÇķaķçƒV@£šmۙlÝğ¯ƒÑťóǿƴȯ°Åł@ÞŻĀˡš±ŽÅU¯°ɅĀ™źƧʬmǠšƐ"],encodeOffsets:[[107764,42750]]}},{type:"Feature",id:"1505",properties:{name:"通辽市",cp:[121.4758,43.9673],childNum:8},geometry:{type:"Polygon",coordinates:["@@ôƲĸ¼Æèš@„ÈȮwƾ»ʠĢ¥VÆ@²¥@»Ŏњ¯ĊJŤ£k»ÆÇX¯̼ōšī°aX£ôƒƾȁź¥„ƒ™aôŤ™ĢL°ƒĸ@Ȯ¼ÈÒʈŚôVXůÆaĠƛÈKƒķšĉôÿ@ğÈĉ™»ÇVn™ĉV›wXĠÝ°šČÿĸwVƒ™¯¯ǵ±™ĉ‚ǫ™ÅÅm»²Ż±ƽIm¥ţÈķ@¯šƧJV»ÞUÝç¯UġºU£ţŽóaÅÅlƒƒ™Ƨī¯K¯Þ݃ğL̑ȍƽ@ōŎōĀƑɜnÞݺX¼ÇĢގUX°xVšʠȤ̏Ǭ¼ÆÒɆĢšŽǫƾUĀóĸ°‚k¼ċĀƑVŹȺōń¯`ÝĮƽŎĉxġNJɱłō¦"],encodeOffsets:[[122097,46379]]}},{type:"Feature",id:"1509",properties:{name:"乌兰察布市",cp:[112.5769,41.77],childNum:11},geometry:{type:"Polygon",coordinates:["@@ʠǠÞĸɲȺƒÒȂƛŎaƙÈĕȘţUÝźǟɆţšÝˌKU»š@U¯ÜÑ@ƒÞ»ôaV—ÞÇÈ@„¯ÜbƨƨÞlĸ@ĊôlôÅĊU„Ýĸmš¦ƒŽ„bm„„„Ċ@n‚ĊxŤÑ@¯‚ƨĖĊ_@›Čwl¯™ƒȭL›Ý„»ƽ¯ķů„Ǔ@ÇǓbċ™ÅÅÆwÿĠÇU£óaƒ¥¯aŎğĠţkw°»¯ůlÝĵkǻݰɱƧǫaóôɱ»Çk¯ŃóƒʇŐŻ›ĉNJŻĢ„Ž¯ÒÈUl°ƒx°n„Ò™Ĭón™Ċğ°ÇŚĉ¦ʵVƒ°°ĬÛżÇJȁńʇʹó˂ƽŎ›Æţ¦"],encodeOffsets:[[112984,43763]]}},{type:"Feature",id:"1522",properties:{name:"兴安盟",cp:[121.3879,46.1426],childNum:6},geometry:{type:"Polygon",coordinates:["@@ÆXnlŎ°@LVLĠþœxĊUȮĊnU„ĠV@żaW¯XIŎġƒ¥Ý@K@w@K@I˺ŻŎ¦ƨƒƨÒŎIÆ@X@VºnX°lŎ@ƾĉˤƒȘǷȘÑÝݚÞbVţĸÿŤxÈĖƐŽêÇKnĸ¥ô@›ķÞUnÒl@UŚaƒīˋƒ¯ÑƧx@±kXřƐƏÛéV™ˋ»lō¯ĉ„ÅÇÓǫޗĖġV@ğ»›°ĵ„ÇÞǓ¼¯m˜ÛÅŃĉĠÇƾb²çƒ™šéż¯VƒƒğÞml»ōÑV痻V¯™¯šĕÆU¯y°k¯¯V»ôDŽѰa@Źk™ġKţšóŽšbƒ„Ź¦ƽȂó„W¤¯b™Ĭ̻ŎW°ÅÈl¼ţ¤ĉI™°ōÒ@¼±¦Å@UŽġ¦ʟŽƽ¼šÞĢÒm¤„êō°ƒ¦Èþƒšl„k¼ĊŰ°JĢńȁĬ„°ƒżn‚ÇbV„ݼ@¼óĸţ¤@°Ånšl"],encodeOffsets:[[122412,48482]]}},{type:"Feature",id:"1502",properties:{name:"包头市",cp:[110.3467,41.4899],childNum:5},geometry:{type:"Polygon",coordinates:["@@źxżĀǔÆǬVȘĀŤ¥œÅƾōôˁʈͳȂŃÈIÜŻ¯ī„¯ōm™¯ɱĖ¯ƒķÒÝIÝ»ÅV™ƒlÅôфġ™ğVmÞnnƒWçkW܁XƝÆwU»Șĕš£ĉÑ𱱚Åk™„ƒK@lÅIō҃UW‚—IǼ¯@m‚kaƒ²™l¯™ǫnǫ±¯zkŽÝVķUô™˜l²ô°ŎwŦxĶĠk¦±ê¯@Ý°U°šbóŤ@š°bôlôǩb›ŎƏȎĊ˜„ĖÞ¼˜ê—ƨÝĊ"],encodeOffsets:[[112017,43465]]}},{type:"Feature",id:"1501",properties:{name:"呼和浩特市",cp:[111.4124,40.4901],childNum:6},geometry:{type:"Polygon",coordinates:["@@ʶUĊ¥ÈřĠ¯šĉômšīƒÑ¯m„wk¯ÇV°ÑƒżġĊljǓɱţǓ›ƝóX¯ƒɛÒóa@nÝÆôƜŚĉĢʉŰĊҙ¤ȗĖV¼ÅxWƞۂlXXèm„ÝmUnšĠƒĢóÒkƚ„ÆUÞ¼ÞJĸÑ°„ɲĕš°Ŏn"],encodeOffsets:[[114098,42312]]}},{type:"Feature",id:"1503",properties:{name:"乌海市",cp:[106.886,39.4739],childNum:1},geometry:{type:"Polygon",coordinates:["@@Ș°ÇīXњŗ@ȍlkƒlUŁ±īĵKō¼VŽÇôXĸ¯Ž@šťê„°ź„k¤„x™œ@Ĭ"],encodeOffsets:[[109317,40799]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/ning_xia_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"6403",properties:{name:"吴忠市",cp:[106.853,37.3755],childNum:4},geometry:{type:"Polygon",coordinates:["@@nLV‚@šVLšaÞbn@@l˜š@bUVlUV„zVx™¤kÞVèšXnš‚@nm°a@UƒÑ„@VŽXnV@Va„UšŽVKUUU@@U‚@@KVa@U²@‚wXkWnk„±lLnU@UmmVKnIVWnI@UK›@UK@@UVKXkmWLWUXmlkVwUyVa@w„w@aVI„K@aVÈw„KlLVV@LnV„VVnU‚ܲ°WÈIUÆ@nÞ¼‚‚@¦™@UÞUVW@UxUxVn„b„K‚b¯ÞU`VbǬ™V@XXÆVVl°InmnUôƒ°¯‚anam£œWVX‚KXmškôaVU@ƒVak@@wmaƒn@K@UÛUWKXUƒÇƒ@UI™b@alW@akLUKV@@Ukw±Iš›nL@kmwkWmk@JUIƒůVmnnU@m@UƒK„VKlkUwkƒƒnVUKmbkI±š—KƒkmVkKƒb@U@aƒVkUmn™`kIlaUK@UUKmbUIݚUa@mUa@aƒ„m@UUULUK@bmKkbWI@WXwlkXƒWa@k@kKƒLVkkK@L@JUVmzUKlwUUnW˜£XVlKUwVU@aXI@aWaUw@W@_nam@¯‚UkWVkUWaU@nwmJkUVkWVUmUkJ@ImbUaƒ@@WÅ_mJknmak@@mƒXƒaUV@„ƒxUšƒ„@‚ƒ„@VUnkVƒ@Vn@`ULUbWLXVW@kbUJ@XW`@ƒnÅĖWJƒ@—m°@xƒxšbnUa‚w²lƒÞ°xŤIVVULۂWbšbkVVXÆ`UbVL„@kx°LlV@Vœ„WbƒJn@bl¤ULV„°@lmL@ƒƒ£U@@aUwmKULVxUVVx@„™@kU™@mK¯LÇa¯@"],encodeOffsets:[[108124,38605]]}},{type:"Feature",id:"6405",properties:{name:"中卫市",cp:[105.4028,36.9525],childNum:3},geometry:{type:"Polygon",coordinates:["@@°@Èb°KnLš@lVš@@ƒUwVUUwVKnLVx@bV@„¤@„nK@k‚¯UƒVKk£@a‚m„IXa›ƒ@UkU¯Klwƒ@UKVaÅ_UWlU™aXa܁VKUUţJ¯w„ݱkxVbmŽ™a„w@wn¯˜„@XIÆĕ„m‚@X_@WVIlaX@WUXKVaVK@_Um„@lUVm@U„ƒ@„ƒV™„w@ƒVUÛwm@@W@ImKUkU@Ua‚aXƒ@wWaUKkw@UVaUamLU™nk@»±`¯@k—W@Ua™ykbƒI„„@VWJkLWUkJƒwU@ƒn¤mL¯wm@Umƒ²XVWbnV@bmxƒVkxUblLUV@kVWKU¼ƒŽkUƒ@mn@JnV@bUnmJUn@„k‚@XlxšLVVnKlLVV@š@LkKULVbk`WL@lkXW@kVƒ@UÞUlÇX™lkaUbmV¯@@L@šƒV@bkb@xƒlW„—bƒbW@—±@UJ@IU@mVk„VxV@@l„Illœn@Vm@ƒVUbl„@JLmKÛXmVkU›KULU`@LĉwƒKUX„lVUl@Vb„JX¦̼bÞxŎxɜĖĠ„Ŏaô@"],encodeOffsets:[[108124,38605]]}},{type:"Feature",id:"6404",properties:{name:"固原市",cp:[106.1389,35.9363],childNum:6},geometry:{type:"MultiPolygon",coordinates:[["@@Vnn@°xnK‚£„mV@„xlIXVlKXI@Uƒƒ„JlašzVbX@l˜°@²_@¼mlVšnKVbUb@VlxVLXb@xW„bVbV@VlnL@J@Xn@Üx„b„W@nl@nblmnIÆ`@X„@Vbna@aVUUWVkƒ@kbWakbU@VwšW@_l@nmn@@alVlk@UkmVak@@a‚UXaƒL@¯@KVa@axWI@KnkVaVJn_lJ@„X@‚m@nVanUVb@mXLlJ„VWnLla„VVaVX@KXVVkVKlknKVa@aVU@KXb@klJUknUmƒ@K@_UW@alIUamaU¯kJma@IUK@U„@@UW@@aXLVƒVJVaXIƒKlaUkUV@ambUUJkIWJ@wUI™V@JU@UwV@@Um@™nU`@UkUmVUxWUUV@aÅb@aWXkKUUƒUUaWK@wnm@IVU@aXwm@UmVaUalk@anKUwlƒUwlkK@wmaƒUkmmIk@VmkUUbW@UVUnW@kV@xkVmbVnU‚™@UbUV@a›k@kkW@„kLW¤@„nV@VU@W_UV™UU`VLUV@IUVõVULU@UUUJ@wmkUJ@šWI@l@bkKkbVVƒbVbUL@UUJ@Vm@@L@xbVVVLVlVwX@Vb@bmUkbk@@JWIUVÅw@Km@UkWKXxWLÅ@UVUnWK@xkVW„@KULwWVXVWzXVVKVXkV›V@VUbV@U„VV@š@LXxVL@V„b‚Ž„LnKVLVxXVmb@l"],["@@@J@aƒU@LWK¯UUxVVn@Ġ„„LUW@UbUUUa@KUX"]],encodeOffsets:[[[108023,37052]],[[108541,36299]]]}},{type:"Feature",id:"6401",properties:{name:"银川市",cp:[106.3586,38.1775],childNum:4},geometry:{type:"Polygon",coordinates:["@@šUšwVK@UVWÞUšbšw„V@knV˜@@KU_VK@K„ƒn@W_XWlL@Vn@Ċw@Ulaœ@Wanamī@aƒ»ŋó@aÆÅɲÿUaV_°ÝaƒLƒaUmVwVwX@VUVݚ@@¥Ý»@mVÅÇJ¯XÛ±VUmƒUmU@KUUkKƒLÇxUŽ@bƒLUJ@bƒx@xUbVzUxklWnXV‚KnXWlUL@V@ŽVLœ@VL@ŽmJUXmJULnn@VmVkKƒ²mlXWlx±@@VUb@L@@VV@VVUL™ƒVUbU@WmUƒ@„Ò@V¯bmn@VŽƒ„@lVnUšnVWŽXVl@¦VVUn@x‚š@‚XL@¦‚lXxš„Vb"],encodeOffsets:[[108563,39803]]}},{type:"Feature",id:"6402",properties:{name:"石嘴山市",cp:[106.4795,39.0015],childNum:2},geometry:{type:"Polygon",coordinates:["@@U¯ķó±ÇÛ¯™ķmbXb›@kb@Vĉxm@@UkKWXX`m@ƒ„@LULV`@L—@mU@lƒU™x™aÝVUX@VUL™x™VkLWVšš@J„nVLXVlŽUV@zl‚VL@V@b„„n@lU²WVLlLVbUŽVxUx@xǀL˜xôҜk‚K²ŽVa‚U@wXa@W™ÈĉUa@‚bÈk„m@¯"],encodeOffsets:[[109542,39938]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/qing_hai_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"6328",properties:{name:"海西蒙古族藏族自治州",cp:[94.9768,37.1118],childNum:7},geometry:{type:"MultiPolygon",coordinates:[["@@„V£°š@laœXô±źwš™ô@„Ulƒża܍n™Kƒw@U„aƒ™ša²L‚mÈLƚÈxlaUa„wÞmÜbÞUšnJ°a„kôƒ‚ÑkwÝVğwÇ@ÝkkV¯¥@ò„»„nŤ¥XImw@mVwša@Åw™mLkaW—wƒ¥l»kçƒó„»@ƒWÑĉŽğ@ĉ„™‚Ń„UwóřVómĵ»™™Ý@VǕ¯kšÝĊÅk™°ÓUklkU±šI„ÇÞkƒ±@šƽJƒ™@UġIk@W¦™VÑșÓÅnťKULnŽ¯X›ƒ@¯mUÛ@WřmóKknōbƒxÝ@ƒŽU@kw@ÿÇLţšÝUkšmwƒŽk™lċVŚU¦™ŽƒLkUWlÅÑ@aƒ@ÅѱUóġŹ¼ƒÈĉmŻ@@wkw™Kl¯U™ġ@—„lÇU™Ó¯_ƒ‚Waĉ²Åló¼VbknƒKǎÅ@ƧĢō°Ý@ğ„W™ÅxUUm@™‚ÝXۂW„ULUè¯@mbUaƒLƒbUWġxIUJWz™a¯b™y™@ōÈóLU`ÇXUl™UĉV¯n›mÛbǕLklƒUĉVƒšóaġ„ƏbġKţnkbÝmmnÝWȭȃŽÝXţWókUÇl¯U¯‚ġUɅĀ@°¯„„š¯„VÆnmJ@ĊķnóJUbÝXUlVškL@lVxnnmb@¤Vzš`ÞÞŤ@„VnÆJV„°b„UôJkzlŽkl@²óš@ÆÇ°kĖƒšÇbÛU@lmb™XV˜kzƒV™ŽɅĀXˢlń„ĬŹ@›éÅ@ĉńÆ°ğbUšlŽɜ_°‚@xŦ˜škbVbƒKĢ„ŤVŎŽ°@żÈźlĊ„ôKôb@nôxŦ„Æ@ôŽŎL@þÆb@šnnšWˌbÈx‚InaŎxlU@Ѳ±ƒğVUĢƒƨbɲ@Þ¥ôUUķWVô¯ĊWʶnôaŤˁ@£nmnIôŽǪK°xUXô@Ŧa°m‚kXÆÞVŎkĊ°ÞLȄôyVašIlwX°UVwĢÑÜKôw@nV@œm°nmŽn„Ü‚ɞ£VbmŽXnƒ°ÜÒ@xx@V‚b²UlbkxVnšJUnVVĊ°KȚm°nxÇnn¤±¦@ŽUXVV@„lV„„bmVVȁŽVxšÒ™°šIšbźaȃšbVwš@šƒVL„™ƾÑ@ƒŦô¯ĊkôÑ"],["@@„@šƒ„@n„òVœa‚w²bVxšxÜaČVô_ĊJšIVmšL„a°@Ŏ¥XlK@ƒšk„l„KVbUb˜@nUĢn‚aÈ@lmǬ»Ġ¯œn‚mnƒƨVy™Ñǖ™Ġ»ɲInŽ‚@@ÅĢƳ@¯°™ôV„KÈbVIÇ¥¯@Ýó„™@ÑnīWKšƒk™‚k@¥š™¯™Åa™Xƒ±VÅw@±Ġ¯@»™š™n™Wmw@ƒ™@¯ƒVƒUUWçƒKĉ„a±VkkƒV¯w™x@šUJ‚x@bknÇb™mÅ@Uw±U¯¦UŽ™Kmš¯I¯Žť¼ğĊ™@ǃŹÈ¯@Ý»ÇnˡJƒbÛèÇnƒ„ÅK¯„ġĠŹW¼Ålm„@¤n²ƒŽÝb@b„š¯lƒ¯@ƒšÅ¤W„™¼nV@x„„°@Vx„@lbUblbX¼W‚œšÇ²lšUŽ@¼ŽV¦@bÇlVxUbVxÞbVšœbm¦ƒVV„"]],encodeOffsets:[[[100452,39719]],[[91980,35742]]]}},{type:"Feature",id:"6327",properties:{name:"玉树藏族自治州",cp:[93.5925,33.9368],childNum:6},geometry:{type:"Polygon",coordinates:["@@ɆÿĢV°°VÈklVôŤXÞW„ȮÇÞXnmÞnlaŤmĢLƐaĢƒôb„™ĊU„VlkǖKÜaœn°mĊUšVVkÈWV_ôKŎǚ@šz°ašbXyVI‚JĢwVX„a„KVbna°@VçVKXƒÜÞWšn@VVÆwXšĠƒÞ@Ŏ¯ƨġÆ@ȍ„LlmUaô»ÆkĊ±Xb„°`šÔV‚kȘƒĢ@Všk°šLlx@xż@Ċn„Çź»ôĢ²VÆ҄@@bÆÒXklV„KšV¥Æ™ČUšk‚l„nxl™çƒ¥ċç@±m¥ƒwÅJƒ@™™™Vƒ„mÈIléÈa°U¥™™@kÞV‚K²ÑWƒ°w²Ñ‚K²ñšyƐ„ÝšVmw„»kkWĉ—JWUƒVÅwƒL™mÅ@@ƒmw„kn¥Vу»°™°@@»„¯„Lla„JônV‚UůƒU@W¯Umѯ¯k@WykU@¯„wV¥ƒkVwţƒk»šwWǜĉĶçšK„ƒÞ™ÇaĉbƒI™lUƒ@kwƒWƒXUƒ°w™±@UšKn£Wĉ—KWxƒkĕVƒšamwXw™@™„Wmnk@aƒVkƒ™bĉLƒl™Imm„wUÇ‚Wx™nÝJn@¥Æ™kwƒaXƒÜĉ™¯ÅV¯¤mkƒx¯kķܙ²VWôŹVUƒƒ@V£™¥@ƒ°wn@™m@¯@UbUôķŽmn@ÆÛ@ÇýVaUÇĊVƒ@Çlğ—¯xÝŤ™lVÈÈVƒx„ƒ¤Vx™„kK@™@ƒx@„kVƒĖġ¥kIWbXŽŎx@nƒxÅUW`ƒ_—@±ŽUa™LUxƒK¯„WbkVlb—bmŽƒLÛÆWIUwƒWkwÝV@kI›ŽéUb›UUk™V¯Km¯k@Umݐ¯m¯›m—L›Þĉ‚ÛUm™ġ£UxkKm°™Lw›šk@kšƒVm„ƒKVUk›@¯a¯Ģ™móKUU™x™ImlÅn™™ÇbXèVVU„°„@ŽšŽ@„‚xXnmš™ššŽ@¼ğ°@²ÆxU‚„²šWÆb°š™š@¦llš™„XLmĬ@҃šÞô°@ȦUJÇaƒLóU¯š@°ġƴ@Ɓ@mɱJğ¼ǕššÒUzƧ‚m„n›mğ°ǫ¼knÇ@bġmmV—@VaUaƒLƒk™l@„kLW‚ō¦¯@ƒb™KUn™JĉIó`ċUÛb™wUw±ax›bñUmƒƒ@™„ƒ@—bƒaƒbǏÅXm˜„ƒÝ„ÅôVbގ™bl„UšÞVޚ„U‚°„VUxƒ@U„V„@l`™¼nL@Ċ„LW„„¤kXķWġXUVVVķ„UbVb@°kVVxÈa‚@ȦĊbšaźJ„U@Ț„„˜Vœƒlš@XkôaWƒĢ™Þ@laĸUÆb²mÞLĠ™ÞÑôbšÒĊa„JVbm¦"],encodeOffsets:[[93285,37030]]}},{type:"Feature",id:"6326",properties:{name:"果洛藏族自治州",cp:[99.3823,34.0466],childNum:6},geometry:{type:"Polygon",coordinates:["@@ÞVŤ™ÈK@ĀlxV@„Þ@„wŎalmôLšnXÆÜ@nV‚°@œ„°WmVKŦLÆmȚԂҚUX¥l@ĢJVš@„ŽƾI@w™W°™™Ån¥›kÅÝVwôƒÈç„@lÑĊĕša„JnaÆLVw°kny°UnkÆVȍĊll¦„Vƾ@@™nUźƒÈǂIn°X„wÞKô¦VWV£„@£°ókċ±I™™am¯Va™»ČĉV¥°™@m„k„¥l@„Ċm@ašU™mwXƒ@wÆxšmĢ_„`VnÆbšKVw„@@ƒnUVğVmVVöIlŽl@@çÛmƒ£UDŽw°@VUƒ¯»m¯ƒJōĖÅLƒa@»ĉĢ±`U_k`ÇçšóƒkX™lK@ƒakÝރš£WċkÝ™kxƒJݯÅw™xķxmIÅx„@k±J@ýŋš›¤UœkŽmV™°ÅÝxkwmġƒnÝVU„š¦ƒŤlmšóXk¤™UKƒç™@mVkK@klīƒ£mš¯VUbƒW¯¼ċb¯ĵam¼mVX„m@k¤ÇX‚ÇbƒUƒ„¯J¯„¯È@˜™bVXVҙ¤V¼kxݚV„@l‚V—„WxÛ¦Wš¯šmKnlŽkŽ‚šU‚@nƑUĉ„Ý@ǺۄċUĉ¥™UƒÞŏ™z±òL±Ò¯xX„±ÒLÝU@lššV¦¯‚ÇbkêÇJƒnU„šš@š„‚ÆI„xn¦‚‚@²Č脦‚è"],encodeOffsets:[[99709,36130]]}},{type:"Feature",id:"6325",properties:{name:"海南藏族自治州",cp:[100.3711,35.9418],childNum:5},geometry:{type:"Polygon",coordinates:["@@VxƒŽńƒš@ĊĠŽĊXÒ°UƾĕÞm°£nb@‚@LUUW„Ûº@nlÆǬšĠ£ÞV°UXb‚VȂǵ„éƒ@kWanm°@™x„z„K°¯ĠVšƒVƒkw™Lnm°kÞxÆa„¥@‚wnĉƏ@™œ_l›š_VwšmĸèŤÅČU@™˜Wn@ÑmKU™nğƒK@ƒ°¯UÿV£nmšLl™„UƒUÛé±óókkmƒnƒakV@Ç°óÝXƒWəÞťIţxmm™VÛUVȂÓnWyȁĉkƒVš°WnkĊa„¥‚_œK°ÿWna@ƒmU¯wƒlÝIU¤UXó¥ÝLƒx¯WmJÇÈŹ„mV@šƽ@ƒUk¥ĉkċŽÅUml¯Vmz¯lUxÅKmbƒI™bĉĖk҃@Çèó„UxÆޜlm¦šÆ¯ššX@x™Ž@Ž„²ÝlƒÈ™JV²klVl¯ÔlšĉƙްlUǖÞ@ššĶ¼nŽUôôŚ"],encodeOffsets:[[101712,37632]]}},{type:"Feature",id:"6322",properties:{name:"海北藏族自治州",cp:[100.3711,37.9138],childNum:4},geometry:{type:"Polygon",coordinates:["@@ōmġxƽUm±Lǿþġԙ@kxmWƒb¯I¯‚mIUx@bƒbŹVǎƒkĵbƒlĉI¯¥ƒUšm@ƒÆ¯È@šašóšUlƒČ»@w›œ»›wXaƒƒó°ţç݄kUƒaV¥ÅbÝw¯lmnšKlxU„™„ğU¯°ƒLƒyšw¯@mnXb‚l„@ƒêȁǶUWa¯VÝUğ¤ǫ™kÅ@mܹXƒVV@K@ma¯¤ÝnƽĖ¯V@„ƒ¼„ôlèk¼„¦˜xXŽlbnKšÆx@Ž™bUx@nnxWJţ¦ƒmƒ¼ñ@Ž°¦lUÞlÈ@ĠxÞUlxÒó„ƒl¯bmI™ŽÝVÛaÝnƒxVbkbÇwřÇKn±K™b„šƒb@V„xšLmŽÛŽŻbk„ƒVó@™šŹxó²›Wkb™@¯U¤ƒźĊ@lUX„°lÆôU„ƒlLX‚aœV°wšxUb°xÜôÈKVkÈmlwškÈKšwšK™™VUŤĉŎ»„»„Il¥na°LV»²¯Üy@wĢƒ°ĸwlwĢw°±„_lVkš@°ƒbƒÆ¯zƒ‚„š„@l_„@Ģ±lŚVlUaރ„LVƒnKlnȏ°IllČa˜wÞÑ°x„UU™@wƒVkmĠLô»„KÞýôaÞ¥ôĀÞmƁ„™‚mUƒŎV¥Èl°²°a²¥V„@@w„amm@Ñn@Æ£żƒVƒĠ£@W„¯Þƒšl@š»@Uk@"],encodeOffsets:[[105087,37992]]}},{type:"Feature",id:"6323",properties:{name:"黄南藏族自治州",cp:[101.5686,35.1178],childNum:4},geometry:{type:"Polygon",coordinates:["@@ôl²ôÜê„VƒVkš™KmnU¤VĀ¯°@„„LmĠVšnLÈL@alb@al@n°Vš_XmWUÈamaVIn@n‚aV£œóVWƒ™U£°ašxÈ¥@™‚aĊwȹ@óša™ƒğbm@k„w@mƒaÆw@ƒ„In¯mmƒ@UkkWƒÑÅ@@kċÅçVkÝJÅkVykŹl¥@¯š™ĢU܃X¥òý—mmX™ÝÅlmU@£™Wly™XW»Åbƒl@aI›»k@klm@UxUUƒVƒ¼¯Xƒl™aUnķ‚ƒI@x™@¯„ƒK™„ĉUU`óšlČ¯ô@¤ƒÞJ„k°xVŽ„n@ŽmbXŽ¯Ā›L`ƒ¦ĉbml¯X™ŽUŽl„ȂĊXzm‚ȁÔU‚ÜVšUnnŤwŦJɚ݄XÞW¯ô@ÈlU„b„mln"],encodeOffsets:[[103984,36344]]}},{type:"Feature",id:"6321",properties:{name:"海东地区",cp:[102.3706,36.2988],childNum:6},geometry:{type:"Polygon",coordinates:["@@@҄bš¤ÆI°ôU¼š°UŽnnWx™š@b¯L@lUUWbXxWl„ƨnxVUllš„XVŽUŽnL@lȀý²KVnƾ‚ĢwV»ƒ@mÞ£nÆƒÞÑmL™ƒKUaVżĕƒWVk²ƒƒÆÝ@ƒXw°@„ô™@a°wóUUmIk™™aVmÞwmknyƒ¹VÿƧnŏm£X»˜™naV±„Ýw@ašb@aƒm¯„ĉVó¦kÝWKUU@WanU™b@ôǺĉxb@šÇ¦™w¯bV¤„šUX›ôU¤bmm@UJnbÇbXVWn™`¯Umk@@bka@bÇK"],encodeOffsets:[[104108,37030]]}},{type:"Feature",id:"6301",properties:{name:"西宁市",cp:[101.4038,36.8207],childNum:4},geometry:{type:"Polygon",coordinates:["@@@kmKVUƒWk™VkUmwƒƧXkWwXaVV@k°K@aš™XwmmV™¯V»¯óÅJ™£ƒamŽ—X@šċVţÆķç™nUx™`kœ›`@šÅmĊx@Žƒ¦U¦„blVރŤèô¯„„Wbœx›¼œŽ@xċ¼k„™V™ô™bÇ@Å°@„™n„V°¦ĊJ„kĶa„lȍźU„a@aVwnJ°°J„anXlwš@ĢÓ"],encodeOffsets:[[104356,38042]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/shang_hai_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"310230",properties:{name:"崇明县",cp:[121.5637,31.5383],childNum:1},geometry:{type:"Polygon",coordinates:["@@uŏu»GPIV±ÐɃŜ{\\qJmC[W\\t„¾ÕjÕp‡nα|ěÔe`²„ †nZzZ~V|B^IpUbU†{bs\\a\\OvQ’Kªs†Mň£RAhQĤ‹lA`GĂA@ĥWĝO“"],encodeOffsets:[[124908,32105]]}},{type:"Feature",id:"310119",properties:{name:"南汇区",cp:[121.8755,30.954],childNum:1},geometry:{type:"Polygon",coordinates:["@@`y”ĉNǕDwǏ»ƒÖLxCdJ`HB@LBTD@CPFXANC@@PGBKNECCBB@EBFHEDDDSNKAUNBDMNqf[HcDCCcF…@EFGLEBa@ACoCCDDD@LGHD@DJFBBJED@BGAEGGFKIGDBDLBAD@FHBEF@RFDMLE@SGANFFJBANPH@@E@FJjRIACDMDOEKLFD@DbDAJI@AP@BGHFBCBGDCC@DCA@CECGH@FKCEHFJGBFDIHACEDNJDCVFBDCRKRLDLITB@CjNJI^DBCfNVDHDFKHAFGDIICDWBIF@@CFAjFJNJBBHD@CJ@AEFJ@@DH@BFBCPDBMFEQGDIFCNDHIP@HDABFACBJFHEBSZC@DP@@JDBƤ~"],encodeOffsets:[[124854,31907]]}},{type:"Feature",id:"310120",properties:{name:"奉贤区",cp:[121.5747,30.8475],childNum:1},geometry:{type:"Polygon",coordinates:["@@~T~JjZdDbLXDLCB_J@@FHFZJJIAGH@HGR@BENBLID@@LFCDF\\FpDBDb@FAHKFE†@dEDDdC\\GreNMACVMLBTMCCFCEGFAA@DAFDLMHA@OD@BMEWDOC@AS@KGAI_DcKw„ÕísƝ‘åĆctKbMBQ@EGEBEJ@@MBKL@BJB@FIBGKE@ABG@@FMFCPL@AjCD@ZOFCJIDICIlKJHNGJALH@@FPDCTJDGDBNCn"],encodeOffsets:[[124274,31722]]}},{type:"Feature",id:"310115",properties:{name:"浦东新区",cp:[121.6928,31.2561],childNum:1},geometry:{type:"Polygon",coordinates:["@@EN@JJLNHjLJNR^GRYVBNZJRBV@PDvbLNDN@LGNER@nCNQNuT_TIVFV\\Z\\XnDrI|[Ʉś²ÏJUHOƣ}CA@IO@@CYDATGFIEDAEBBAGCO@GJMCEDCJRHEFANOCADAEG@@CI@FE@BDIC@AGIAIMiEEB@DE@AJCXJDCJEHGBELGCUCeMAD]CIJiM@DSAKJKCLQDQACUECDMIFCBDJGECHAEIWCK@GLMCCGEACNKCEJG@MMBMC@@CIJUINT@JAJSTEPZZCP"],encodeOffsets:[[124383,31915]]}},{type:"Feature",id:"310116",properties:{name:"金山区",cp:[121.2657,30.8112],childNum:1},geometry:{type:"Polygon",coordinates:["@@L@BIHFN@@EE@@EFBDGDAADVDD@@EF@CA@IIsRE@GDAF@BF@CV@|FBCHBLCNHAFCADBMDCFZXHILBVEEQA@MWFARJJ@DCX@@TEFBLHAAERE@AJABRPBNK\\BrJ\\VHGND@CNADKDADQjGAGNC@GJ@FCFFHC@JF@@dLBDSFADHVG\\DTEPDDHJALIJkJDJCDIPE@YDCBiK@DONE@EH@BAF@HLJA@EIA@ALKNA@@FIFAFHR@NALadsæąyQY@ƒA±DʼnXUVI^BF@FFF@HBJEDFFGFEBSRkVEXGHFBMFIVW@GAEEFOIAIPKABGWEKFSCQLQBSEIBC\\FdBLRR@JGACFDDEF@AWB@LJJYNABBA@CUEGPaO_AIE@MYMFIGAEFECHSAAKAO\\[JEDB@E@MMA@@AGBKMGDFFCDDFEDFJF@NPBAFLHFH@EDDHBADDC@DDCDHHCDDFDABDAD@FEFOBCJ[D@HEDDNJBDDHABJIBBvGLBJAH"],encodeOffsets:[[123901,31695]]}},{type:"Feature",id:"310118",properties:{name:"青浦区",cp:[121.1751,31.1909],childNum:1},geometry:{type:"Polygon",coordinates:["@@RUNKdOFDJCbRFMLAHPLDN@JGL@@APBWYCKN@TU@SHGCEJIDIJKVIZVNM`iNY@CIE@CA@KBOEGEUFCCSADEIEFCDDDIDDHC@CKIeDCG@IG@DHWFEEGCH@@GO@@O]CNpeEQDBFME[JC]DGF@CKOA@QSB@GB@@GW@@ED@AQIJIAAFE@@DO@CFI@KNG@CDACAFEGKGBEGBDCCAIFCCLIECFI@MBCLDHGNAHSF@DMB@EEKBA@@C]DEICFG@ADBHGFKCDAKKHKD@@FHGAANGEEFCHKCECBCKG@ADKCNE\\[A[I@@mGBDQQEO@BCE@AI[AML@JGACLOAFKEMM@EQKC@CUCBCCBCHEA@FF@@FM@GEAJK@GNF@EXPH@FD@M^@HIADJCFDBER@DK@@DE@CAKFOCCBDHIBCNSB@GFC@GQEEOWFICGDUAEJIDBTAHJHEB@DIF@NE@H|HBDBEH@DKBAHEF@HEEUB@FGFGCCCE@AHOB@NH@PRLVNNFBX@RC€PbAvMtBfH@DJF@ELBFA@EH@HNED@FFB@HLC@CJ@@DJ@PIRf@HE@CFF@GPHD@DKE@FFBEFFD@DEFCA@DD@IjCRFBAHFDKD@HF@@PM@H@BlbDJDBFEF@DLXB@HCD@@IFCBIFEJD@FDC@FBALLF@PAACJERACAJCBD@EL@JD"],encodeOffsets:[[124061,32028]]}},{type:"Feature",id:"310117",properties:{name:"松江区",cp:[121.1984,31.0268],childNum:1},geometry:{type:"Polygon",coordinates:["@@@DLDFRN@FNELPBDKHB@INK\\BBJF@ADP@RFCRHA@nJ@B\\[\\MFLDBCH@DLDADFGLEDFFMHBBGH@EC@GLLLCBLDHEAGBCH@DEFJ^C@DB@LAFFA@CNE@GTMBGHKCAD@NEJFDKJDDJEDBCDHAAFLHFHBEBDDCH@LMJ@DEP@@CF@BEJBJIBRC@@FX@@HA@@HTA@RPBDLE@CHD^\\INFAERCfFMo^D@PP@@HG@HDFFXECGH@@JDHfCLJ@DGDCCCJCCEDJFCFTBDDVEHFPFLAB@NBFCFKFC@CHIACNOHWHCAAFIDD@CDAGEI@ACFMF@R@R_@GQED@EGFEQEDE_IAHKAEXCQUOQCUDEN@ZI\\DDmAMHCICDSOC@EG@BKHIGMIBCGOCSF[CUHCGEBCTKA@cE@@IGDEEEDI@@HMDBHiHCRCBCLMB@DMCGH[UqI[AMLOAAQIB@BQFBFGBAKFE@SW@CDI@QIEBNXB@FRUFKAGJYWDENCCADBBEMGKDGAAD{EU@@DAEE@CB@HQFJt@JDBE@@FC@"],encodeOffsets:[[123933,31687]]}},{type:"Feature",id:"310114",properties:{name:"嘉定区",cp:[121.2437,31.3625],childNum:1},geometry:{type:"Polygon",coordinates:["@@F@LI@IDKJADKIEJICADGACFECCJ@HKCAFOHAJI@aCBEE@ICAEB[GFGCKL@FGEIFADMLCAEJM@ELQECEIG@BE^QKKLQCA@EHBIGQ[GEHOMGGDHKH@JOECFCjCBEFDNCACMBCILGTABDLEEOEIG@GFIMM@CGKFBFCDE@@GEAGEEACIcGaHMFITIHDN[AKF@FS@OA@BK@IHM@KCGOKBENaQIDECcPMLQVFHFB@BFBKLGD@FAJOVGIACQ@A`LPCB@JEF@RU@ANS@@RCL\\HIFpRBFRBBDKLLDADJDGBFDABHBEDNF@DGBBBADKDAHC@\\JJFBDEH[DEFDH\\LX@XLBLbT@DNJLDCEL@VJABJNDHB@HBHYFBAA@GNFB@@AFB@AFABFLFBHFCL@HJBAFBLC@DN@HN"],encodeOffsets:[[124213,32254]]}},{type:"Feature",id:"310113",properties:{name:"宝山区",cp:[121.4346,31.4051],childNum:1},geometry:{type:"Polygon",coordinates:["@@ˆmÖoÖiƒ½[s[YEUJU`SCIEBCCWJY_LIICDWU@@FaBCJIB[ICH[@@CDKEE@MK@@IMCAEBCH@AMFI@SMGEFGB@FK@BHCAIFJNQD@FEBDFMBKGACG@ECWH@@CDDTOEEBGEK@GC@EE@GPHFR\\JHGA@FDBKRLL]RAFH@FJFDKR@FINBFKDCNEBFJEHK@DLEH\\HFADB@JFFDA@bIJGBEPDBGLI@DDEFBDCHDBIJJFCLIBCL@JKJE@ADHDBHJ@HIBBDFHBBAEIJ@BJFAVL¢ˆ"],encodeOffsets:[[124300,32302]]}},{type:"Feature",id:"310112",properties:{name:"闵行区",cp:[121.4992,31.0838],childNum:1},geometry:{type:"Polygon",coordinates:["@@T@@ELE\\BCMJGJSNEbGdHDJFBJAFIEIFCEWG@@gMENSFCVJFAxR~B@IH@AIiI@GE@FGEAFQPDRiV[\\DFSGMHAXHDOMCJCDETBBNVJJI@DD@ANNNH@FILDDMFBDHNDHKL@XDFGLD@EHGFD@DDB@CDDHCDAEAHG@ABOJ@BIaC@CECLKPFNCDCJBiQEIF@@@OGBMIAEEBMTHF@NKEC@QFEGA@EBCKAACHCLJHEFHHB@AFCAIEACIC@HG@KCCDC[ECEED@KC@KJMAAFQ@GHG@BHIJYIGE@EI@A`KDWCaKcCiY}I}S[CYJM@CFDVPRRVWDFžLBBG`JCFRFEFFHC@RF@HQ`Q@E@ENBDJ@HFCB@DCCEJBBGDGXMPBDGJ@DEDELEDMA@DJF@DMZ_jMNYUUJILCJIJDFGH@TSVM@DLXZ"],encodeOffsets:[[124165,32010]]}},{type:"Feature",id:"310110",properties:{name:"杨浦区",cp:[121.528,31.2966],childNum:1},geometry:{type:"Polygon",coordinates:["@@V@CXJDKJZ`XIDDFADJvSRMDM@mFQHM@KCMKMuaOCU@BDAJSX@HKJGD@PNJCJWAGT@R"],encodeOffsets:[[124402,32064]]}},{type:"Feature",id:"310107",properties:{name:"普陀区",cp:[121.3879,31.2602],childNum:1},geometry:{type:"Polygon",coordinates:["@@F@@FHDL@HFFAPFCSDC@@XGFDH@BDLHNACEFA@ERCIMJEDBAGL@@EHAFENHHJ\\ONQBQCIBC[MKACKI@GGGH@I_G@CW@[DMHCDIBMTDHN@JNHEH@FJFPKFACSBKHDJNABDMDECAFiDEDFDIPG@GLHCNH"],encodeOffsets:[[124248,32045]]}},{type:"Feature",id:"310104",properties:{name:"徐汇区",cp:[121.4333,31.1607],childNum:1},geometry:{type:"Polygon",coordinates:["@@RADL\\NCPHFfLJaJ@FWLGMGIK@IFMDOYYFOTSBI@IMSAMSACFIDNDCPWGGBHNET[CU\\QjOCERFBEHF@@HjJBJG@@J"],encodeOffsets:[[124327,31941]]}},{type:"Feature",id:"310105",properties:{name:"长宁区",cp:[121.3852,31.2115],childNum:1},geometry:{type:"Polygon",coordinates:["@@HFFB@HF@DCAELENSJADCNG\\CX@@D`H@JHGHHJ@BINBFUGEDO[MCKQB}AwQEBUIEDMTNF@hH@FXEDFJEJIB"],encodeOffsets:[[124250,31987]]}},{type:"Feature",id:"310108",properties:{name:"闸北区",cp:[121.4511,31.2794],childNum:1},geometry:{type:"Polygon",coordinates:["@@CSG@BQGODUPWTOBQAAFMECKBGEMFKEOHADDJARMR[PGI@TEJBNG@ADBFND@JL@@NFFCL@D\\@DG\\JJADI"],encodeOffsets:[[124385,32068]]}},{type:"Feature",id:"310109",properties:{name:"虹口区",cp:[121.4882,31.2788],childNum:1},geometry:{type:"Polygon",coordinates:["@@bA@E@QHSXBDIMI@OHCLI@GTWBIACQAYIOFGCENBBARSPOXCVHPARH@DT"],encodeOffsets:[[124385,32068]]}},{type:"Feature",id:"310101",properties:{name:"黄浦区",cp:[121.4868,31.219],childNum:1},geometry:{type:"Polygon",coordinates:["@@NEHFLAFDHDPEAMZUHQQ]IMKJG@EPERABHBGRUCCNGV"],encodeOffsets:[[124379,31992]]}},{type:"Feature",id:"310103",properties:{name:"卢湾区",cp:[121.4758,31.2074],childNum:1},geometry:{type:"Polygon",coordinates:["@@VDHQGABAFQFOH@LIiKKHEXI@IbAFZB"],encodeOffsets:[[124385,31974]]}},{type:"Feature",id:"310106",properties:{name:"静安区",cp:[121.4484,31.2286],childNum:1},geometry:{type:"Polygon",coordinates:["@@DLLB\\NPGLFHUDMYABEeKEVMAAJ"],encodeOffsets:[[124343,31979]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/shan_dong_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3706",properties:{name:"烟台市",cp:[120.7397,37.5128],childNum:9},geometry:{type:"Polygon",coordinates:["@@ŤLšLllVń²è°xżĢĠÆl҄šŤbœ„V¤ĊXnŽlĢVĊ„Òš„È°ĊŰÞè˜L„±@џn»VUźċ²»ÆkôVɆkĊŃ²kŤVVwUUVmUaƒ@KkU@ƒmUmmk@UwUkmW@UVIXa@ƒmw@a™KULƒaƒx@Uk@UbWU@yULmK¯@kXƒVUwm@@JUUknWKUVƒLUbU@™wWykIƒa@w@mUI@ašUVynIWa„k„@@W„bl@@knmƒK@wnIl™°Kna@V¥ğ@ġUķ»™¥@UōJƒX¯¤k@™wmI¯‚k@mwƒak@@šlX@bUJ@VƒbknWxkLkxlŽšLVlkLmŽšb@bU@ƒbU@VbU`Vb@n„L@Žmb—U@˜VnUVmnU@mm™@kIUWVIUK›VkkUJUnmL@VmLUaVWaXamU@™™U@KUUmVƒU—JƒU™VÇwğn™mƒ@mXĉV@l¯xnô"],encodeOffsets:[[122446,38042]]}},{type:"Feature",id:"3713",properties:{name:"临沂市",cp:[118.3118,35.2936],childNum:10},geometry:{type:"Polygon",coordinates:["@@˜bXlƒl@zlV@lXXmŽkbVVlš„U@Vn@@Vmb@XšKšVX„WJ@XXl@„‚ŽÈbVLšUl`„@XXV@VVUxVbUxVbš¦„@‚WnXVJ@bnVUzl@„°Æx„U„KlU@mUUnUlUVWVUnVV@XX°V@Všll@Vk„aXVl@Ux@bmbXLlKlb@b@bUJn@@„„b@n°x°K@an@@UlLVKVbXb@bVVnK°LVa@UVa@™Xw‚KVxnLšU°@naV@UWUkWƒULmV—wÝKUUla@aó_@mƒK@aUU@ƒWUkwVm@aVI°W„@@IUw@a±¯@¥kUVUm@a‚wkw™@ƒK@kVKk@maXalI@alL„WXblaVLVU„V@LnKš@„l@w˜aXašLlnUl„LšmV@n°J@_VmnIVym£UKmI@WnIVm@anUVmÇ_kġIÅWUXÇm@U@ݯÅ@ƒ™@naWƒ™IVW@IkK@klKn@naWIƒmk@ƒaƒbkKkLWn™WkLWmk_ƒ@UaVƒUKmLUw@mn£WwUmU™ƒaóV@UkUm@UKULUwmJUX@WW@XҙzVblJXŽWXk@UVWK—X‚¤UL@xU@ƒ@ƒVUaU@@XmVkLmWkXUyÝLmKXnVŽ@n@l™x@bWLnVVn™`knULmxUl„„WLXŽVb@VƒK@z¯x¯¼Wx™KUn@bk@ƒlƒVVVz"],encodeOffsets:[[120241,36119]]}},{type:"Feature",id:"3707",properties:{name:"潍坊市",cp:[119.0918,36.524],childNum:9},geometry:{type:"Polygon",coordinates:["@@l@@UšK@Ž@L@bX@@VlL@JƒLUVnX@`ÜXn`V²mJ@bU@@n„b@l°xnnĸVƚ°@„ƒĊ£Þ@lWnÑnkʶJmó°w@kk»V@»ƒ¥k@V@kw@wVm„a˜Å„mšaô£ŎƒXI@mln„Kla@mV_UKƒ@kUkw@alW™IU»™mƒ—@WUIl±UUÅU›bkJƒ@a@wUKUaVIÆmXIWaka@m@Ul£XKVw@ƒUIƒJUkmJ™ƒVkU@a„ƒWK—ImVƒ@UxmL@bX`WXU@U`ÇkUak@@°UblXk‚mLUKmL@VULóƒƒVk@@Vlbn@Ub@ċaUJUbƒIUlVLUVVbVKX„VlVXU@mb¯@™VmKUwLWx@šUb@VUb¯KmLUU@aWaUaULkK@Vm@@b¯L¯w@mƒa@ƒm@UUU@U¦lJUXƒVƒmkb@nm„XVWŽkb™IVxUV@VUbWLXVƒLW`Ux@nk@Vn@x@VkJ@œV`mXkŽ@V„xV@lVššI@VULš˜VU„IV`°bVXXx„V@VWVnL@xV„Ub"],encodeOffsets:[[121332,37840]]}},{type:"Feature",id:"3702",properties:{name:"青岛市",cp:[120.4651,36.3373],childNum:6},geometry:{type:"Polygon",coordinates:["@@„@nU˜JXLƒ„@blVU‚š„nIVl„IVJ@„UxWLk¤@V@nlbXbWJÅnUJVbVL@x@b„ŽlIœaÆVVVk²VJ@X„˜šnV¼šJkX@blxlV„@VLU`@nkbƒLkm@nWJō„ó¤™bƒn—ƃbUn@xlxU@l@„¦@¼UŽl¼ĊUnW„@šnĠmÈxšU„V˜I„VnUVV@LšV@šnVWbXb‚UVbnK@UnKVmVIllœUVLUJVXlJš@nnV@nmVUUm@—˜Vna@ƒK@mUaV_UaV@„aV@@a™anlKUk™KklwlKXwlm„a@UVI@akW@™l@„bnxl@°nJšxl@°£„WŎIUÑn»lašmô¹Ŏ¥VaUUkƒmkġWɱIUUŹ`›@kk@ĉƨřV¥_Ç@™Ĭƒ¤ÝL¯m¯£ƽóķwUW±ī¯kōaĉĕ™kğmó°ƒbW@UKkLUaƒVmz@V@ŽUxVn"],encodeOffsets:[[122389,36580]]}},{type:"Feature",id:"3717",properties:{name:"菏泽市",cp:[115.6201,35.2057],childNum:9},geometry:{type:"Polygon",coordinates:["@@@¥šIVUÈmÞ»@UlU@Un@VW@UVmkk@aVUUKVÝ@UVknK@UV@VVnIVƒ@wnƒmwmKXaWaXI@UV@Vy²blkVKkam™U@kb@Um@VmUkmƒKmkXKWwkU@Ulƒ@UnK@UVUUm‚KXwšUVL„w‚K„U„@@Wl@@wUkV¥—@@I@W@_V@VWUw@UUa@aƒaWa—@@_mKUw™l¯amzmV—@WK™nU@kƒWLķaUKbÝVmV@UWÇbÛ@ƒX™°UbW@XŽm„Vlk²UJUbmLÇxÅWUzl‚¯Ll„@VkK™XUbWJ@bU@¯@™ƒkbƒLmKka™„@l™_WšXºVbUz@J‚n²V@¤lX„Ž„nV°šLn`WbXLôVlKVUšxXn˜lXLlU@bVV@„XJWLUVnVV@„„@n‚l„°nn‚V„KÈbVXÆJU°VnXV„kV@@xVL„@šWlb"],encodeOffsets:[[118654,36726]]}},{type:"Feature",id:"3708",properties:{name:"济宁市",cp:[116.8286,35.3375],childNum:11},geometry:{type:"Polygon",coordinates:["@@nam_nKlVLXa„Il`š_@KVVXI@m@w‚ƒ„@@k@Kšnô@n`VbV@@L„L@KVVn@VX@‚VL„Jl„š@VUUƒU@Uam@Uk„wšKWaXamkJmIUVUÈblašUnV@kVKl@@lXL°kVJ@VÈnVJUX@V‚LXl@xVLnU‚@VK„V@a„IUaV@„bĊU„x„K‚kVJXUlV„ƒ„UVašI@WUI@KlUnw„mWk@WXIWƒ™U™L@Wna@Um@@UƒVk™UUlanWW@kkU@y„kWk—aWVUlÝbUU@kƒJUIU@@ƒ™JmaókƒLKǃUUkKWLk@WbkUUaƒbmKn¯°¥V@XwV@VanaVaU_@Wlk@WÈ@VUÈVVۂm„aklKȯlLVUX@lK@aX@@kV@VmV@VwnJV_UWUwƒX™am@kW@wVUkKVIUUVmU@UV@IVK@aUL@aƒV@Lm„UKmx@ŽômLkUWJ@šnXmlUxUL@Vkn›VUšU„@V™L™`Ub±LkV@kUKÇbÛ@ƒU™Wó_mJƒ@Wk@@Xƒ@ƒVLƒxUK™VWxLVnUV@VmL@Vk„@VlVXxWLnl‚Ln„VlUnn@@VlaV@nšlbULkl±aUzU@@VWJXbWbnLnxm„@xU„mJUUU@@VmLUl@VUÞVLUV@bllUn@VUXm@@VkV@VݼÇnUV™J@¦nnƒlnVlL@„Þb°KVV"],encodeOffsets:[[118834,36844]]}},{type:"Feature",id:"3714",properties:{name:"德州市",cp:[116.6858,37.2107],childNum:11},geometry:{type:"Polygon",coordinates:["@@„¤@VmbVXnVVbVJššX@Žll@z„lVInl@„@bVxUbĠ‚l@Èbla„IšxXVWb@L™@n‚ULWVXXšWWLnL@`@LUVVL@lVn„JšU@UUk‚a„™nš‚Vôô„b°¼V‚ސXš˜‚œIÜbČa˜bôW„XÞWÈzÆmnLVJ°ÈnlV²lbnW@™@UƒUV™šmnwmkkKWƒkla@mVIUKUa™aUwmn™JU@@amIk@@bVlkX@mmUklUUƒƒa@_UaUUƒV@wƒw™WkXmW@I@WUaÝU@UXaWUU@UUVW@UUUWUn¥nUVa@m@k@alU@wk™LWa@UUm@@wnmU™wla@anKn_@alK@ݙ_ƒ@@WUUUmlkaƒIƒyU@UwU_Wa¯yU_mWUwkImm@InWWUk@@UVWV—kW¯U@VƒL@b¯b@l±¦@šVV@lUbV„@škxVnUšl¼XV@b@lV@nIWxnbƒ‚™@UU™LƒxÅxm¯ƒaUƒ™wU@mUÅVÝKULm@bmKUXó@"],encodeOffsets:[[118542,37801]]}},{type:"Feature",id:"3716",properties:{name:"滨州市",cp:[117.8174,37.4963],childNum:7},geometry:{type:"Polygon",coordinates:["@@Vb@`„bV„kVlnV@nlWUk@al@nJ@bV@šInmVxšbVbVLUJ@nkb‚lX„lLnlmx™nUš„V@V@šmXn˜lbĸ@nnVx‚b@lnXV@UJ@nVxšxnxVbÆVn¯ƒĕ‚@@wÈçUÇlķVIœb‚@„Çmk@¥k@UkUK@aWakUóJW_UW@wkkWK@U@Kš@XUƒƒUkmUUalKXala@U@kkWlkÈl@kšV„mVIVmU_‚a„ƒƒwnwVW@wƒwUƒ@wU£ƒwkJWIyUI±bk‚VUJ@nmV™Ukl„Xmx@lnbW„kVƒUkLWŽƒxkKUUmUkb™J±—LÇxUKmkUmkkW™™a„mUaVkšJÆ_²KĠ@U„W@w„U‚¥nUWwK@aÝUkÅVaVK@akLWƒƒƒ¯I@bnbVx¯JW„ñšWbUL@šƒŽnV@VmbkUUV@IÇak@@bWak@WJUœJWL@bXV@„‚@„V„Jlb@zUlUŽUImšnbV‚mz@°UV@V™bV@@V@L@xLmKUnmJVX„J@VkLW@UVUL@b"],encodeOffsets:[[120083,38442]]}},{type:"Feature",id:"3715",properties:{name:"聊城市",cp:[115.9167,36.4032],childNum:8},geometry:{type:"Polygon",coordinates:["@@ô@VWnL‚an@VKÞLÆUnVV@šxV„„bn°Æw„wšKVVš@„maXwmJU@@k@aWUk»V™Umlw@™UƒVa@kUU@™²¥@k°a@a„K@U›ƒU@mmm@ów—ѱ¥¯@@w™Kmw—I›¥kU¯UmakJmIUaƒVkKUkm@VUUa™Uƒ@UaƒKUK¯@™w™UVŽUIUKVw™k™¥™wƒbVŽ@xn„@lWnXxlL@`„XlJX¦l°XxW¦@¦Ul™n@Ž™@@Um@@VXVmx@¯bllUnUJ@VULVn@b„xV‚VL@b„„VlnVVblV„ÈnVlIVJœLô„lJ@xl²„"],encodeOffsets:[[118542,37801]]}},{type:"Feature",id:"3705",properties:{name:"东营市",cp:[118.7073,37.5513],childNum:5},geometry:{type:"Polygon",coordinates:["@@ͬUǪlô@°Uœw°ōĠ¯š»Ģ炻XÇ@w™wƑa™ÇƒkwVƑ¯@řķUmm¯w@kƒa@mV@@anIU±m_ÛW@_mWVU„K@IkK@UW@@a@K@™L@Vk@±U@UV@lm@mUU@kLm„„xV¤@xV„„x@xUXmx„xƒ„bV`UnUJƒn™U@lÇkkllX@l@VkbWbkLVbnVVl„„WV™@@L@VXLll@xVXX`ôIlVXb@bVLVll@@¦nlƒÈ@›aUJkĸVÈÇè@x"],encodeOffsets:[[121005,39066]]}},{type:"Feature",id:"3701",properties:{name:"济南市",cp:[117.1582,36.8701],childNum:5},geometry:{type:"Polygon",coordinates:["@@²¦˜Òôxn@nn‚@V‚œ„°VlXU˜UX@Vl@XVmX@JnnlJVxnXV`°zXbV`VxV@„z„JlbkŽVnVV@X„@š`@ÞkL@bm`mL@bkbšxnVm@xn@VV‚@XbšKl@xkV@b@l@nUbmVm¦XVVV@VUXVVV@XVWb@VÞVVb@X@JnXlWšX„x@x„UVV@aVKVUX@lK@UƒIUWnIVmnL‚K@w@K@UU@ša@UVU@¯nyUman™VJVVk@ykaƒIƒU@@ƒWU@aXK‚IV›XIl@Xb@al@Èb@JVUlVna@UmU„@™VKXaò™Xƒ°IUwma@aU@UU@wVW@фw@a™I±`kbƒUkw™UmJ@UkmÇUUkmKknUVƒ@mJUkaWkƒa@KmKkUƒLmyXa¯_@WmImmbƒLmUkVUbUVƒJ™bƒUkkWJkUƒl™IUm™k™Lƒ›„lK@knaVmkI@mWaƒLUK™UU@@VmLUVLWK@UUUƒWUkkVmx@„Vl™¦"],encodeOffsets:[[119014,37041]]}},{type:"Feature",id:"3709",properties:{name:"泰安市",cp:[117.0264,36.0516],childNum:5},geometry:{type:"Polygon",coordinates:["@@n¼šŽW„nxšL@x°@š¥Uk@ƒnwlUVl„XVV@VXL‚KVUnK@UV@šVVL„KXb@nlJUnmb@lkLƒ‚„œšKšlVnšJ„klVXIll„Vša„IVUValUnV„K‚annnJ@X°`Wbnz„KlVnL‚Ž@L„bXl‚bVlnI„@VUU@UmVƒ@U@Uš¥@VmV@@_Ua@m°@@ƒ„kmUUm@UVmn@nX‚@@a„anJVUVL„mlIVJn@nkVLVa@KVmVLXVVLš@@U°bn@VaV@@K@aVkœbWaXUVymU@aUImWXƒ@™¥UaVwUaVwUUU@WWƒ@k_™VUKÇa@ƒƒnmxkV@LVJ@X™JUbƒVƒ„kUWVUIlƒLƒwĉVƒaU@VbƒJ@bƒUUL@mVUK@wWkK@UVWUIÇm@UUI¯lWK@kk@UL@lmU™VkbÇaUVVnJlIn‚WbXb™LƒxVln@VbV@V„UV™@kƒƒIUK@UWm@UU@LƒK@KU@Uam_ó@™m@L@lƒ@„@x@nWJUU@L™`k_ƒJWbUKkmLn`mb"],encodeOffsets:[[118834,36844]]}},{type:"Feature",id:"3710",properties:{name:"威海市",cp:[121.9482,37.1393],childNum:4},geometry:{type:"Polygon",coordinates:["@@VbUnVVUxĊ¼š¼ô@Þф¯‚WǬLŎUÆW„¹Uǃō¯ÑƒÝkţ™™ţóġ™óL™ł̥U™wm¥kÝmkkKóbÝ@U¦@‚mb¯LkšmJ@x„Lmn@lk@ƒa@Xƒ@ƒlXbmJUz™V@bVJ@n@x„blJXzšxV@Va„KVUXLlmVV@In@Vx„UlW°@nLVK@zXVVal@@V„w„bVKšL@bnx@„WbUJ@VnXVlVxl@nnnV@„lV@L„‚"],encodeOffsets:[[124842,38312]]}},{type:"Feature",id:"3711",properties:{name:"日照市",cp:[119.2786,35.5023],childNum:3},geometry:{type:"Polygon",coordinates:["@@UaVUUKVk„JVaVIČb@Vam@ka@Ul@„Uô„VK@UnKVLnKlkWVa@¯l@VbÈlV_V@XWW_@anKVwUmVw@@Uny„UVblKVLX@„aô¯ó¥mÛĊÿÈ¥š™Þ¹lUīƒ¯Kĉ¼ʟbÇV™U™ŽUŽ™XmakJUnmV@bUnmJ@XnJVLn¤UzmJUn@`¯ImŽU@™nƒKVkkm™KWb—b@xƒk™@mL@KƒUUVUKkbWaƒXkK@bkJWbnbl@UL@l„Lš@lxx@b‚nUVlV@¦²°@bVx@Jƒ@¯XUJ@bUnlxVŽ„X@‚VV@b„L@nô`@bkbVVÞL˜xnU"],encodeOffsets:[[121883,36895]]}},{type:"Feature",id:"3703",properties:{name:"淄博市",cp:[118.0371,36.6064],childNum:4},geometry:{type:"Polygon",coordinates:["@@nƒlKV@nVn@@kVU‚@²VVaUƒ@wmKXU@UƒUWwUW¯aU_ƒJUV™—VK@U™JU™@kUƒw@UlnWU_@›lI@U@wUml@@mVwX_„KWUXKVa@UVUUwšJlaXWUnƒ@mla„n„UVWkIV¥V@VVVI@a@akakLWKna@aVwk@WUƒbUlk@™k@U¯UWWU@mUUVUXkVmVVV@nkVƒLƒVÅwƒ¯k@WVXb›aUl@bV@@b@xkVVXVxkJ@nk@@ŽVLUlVb‚VXUVVUzV‚™LVbUbV„VWVkLmškJ@n±@UxU„VVkV@bƒx@ÒUX@xVVV@°J„„X„lK@bULUblÆÞV@b‚LXxmV¦ƒV@xƒXVŽğ@±LÅ`™IUlVbƒnšbXšllVnnlVLÈw˜K²ŽšIlanVVVlL„wXlK„VlUXƒma@knwƒWlkšVnU@mVIUl²aVJ‚zXJlI"],encodeOffsets:[[121129,37891]]}},{type:"Feature",id:"3704",properties:{name:"枣庄市",cp:[117.323,34.8926],childNum:2},geometry:{type:"Polygon",coordinates:["@@‚yUU„U„kl@@aVmšLXw°»°w@y„L@UUaWXKƒƒVknwVKlmš_UmmUXK@ašw@k@mUWmUL@ƒ@™@£@KƒbÝV@akw™aULmƒƒbUK™LUU@lm@—°mL@nUJVxVXU`mIUxU@UnU@@lW@@bkLW@UVkKÇ°kLlŽƒbnUÜÇUUVÇ@@Xkl@XV`UbmbUbU@WxU@¯¦m°nL„aVblVXal@XKlLVVȄ‚L„KôlnbšI@„V@VJ„I@lVVÞaVkXU"],encodeOffsets:[[120241,36119]]}},{type:"Feature",id:"3712",properties:{name:"莱芜市",cp:[117.6526,36.2714],childNum:1},geometry:{type:"Polygon",coordinates:["@@lmnLVlÈVln@VnIšVlx„Vla²_šJlUUUVƒVw²@@mlIn™lKXU‚UUƒVaUašKUVyUUWVUUaVkUK@l@@mlIUwUWlU@w@aU@@LU@Ubm@¯a@V™@UKWUUKUn@LUbUKmlm@UIkJƒnUKUVmIƒb@b@mWm@Un@VVnnVƒl@„¯@@nVb@`U@Un@Ž™¦@V@VU„VnV@"],encodeOffsets:[[120173,37334]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/shan_xi_1_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"6108",properties:{name:"榆林市",cp:[109.8743,38.205],childNum:12},geometry:{type:"Polygon",coordinates:["@@™ýVƒnIW»ƒW@»kUÇL—݃U¯¥ÇIUWWїUWwX¯mƒ@»n@ÜÈķô™@a±kȱƒw„ÑmwçċmU»ÆkkVyIm™ĉÿ@ƒÝ¹ƒWnwÇVš™Åaƒzmmĉ¦ó™kVmx™xU¼VškVm_UlVlk„°IV‚kmJa›¦k™™LmmV@XmKnšlUô›VXbƒbƒ@UaÇLğܙ™Åwƒ£mKnmċwÅ@UkƒbmaVƒƒƒn@m¯aU™Jm_k˜@kWXyl@@kÅamw™LU™Þ™ƒ™mWÅzUKƒš™Uk±@™b@nnK‚bX¤mzVšŽVxÇn„‚¯„@ÒknWƒƒVUbkķÈÑWkk@Va™™U@„mUkbƒÝÅ@Ý¥ÇbkĬ™XV`kLǍVmalUUa™nV±nwmkƒJ@Inƒ°KVw¯UnÅ@¥™ƒ™U±bUU˜±œmWbÛKWnUm`UƒVK@bmnœm‚Èż@V„L@xƒxmš„Ť°nŽ@VmK™²VlšlKk„ô@„êÜV@VXLlmš¦UššV°Ș¯²ÿ@¥š@ƁĊ˜²IšmĶnnb°b„KVƒĸLl„Þ@UȮš™Ü°IVƒÞÝސlŽœx@ŽķĀWŽ„Ux„èƐ@š°ŽXnšlĊĖ°m„nƒšV„²V°ÒƦ„aބ„˜@zll@bÞĀšlš¼nKĊ¼óȂb²±šIǪÒ¯ĖV@„lxnVlk„JlaXwŌĉ„„@VnŽššlÆĕ„UÆLœèŌŤôxȚlUœ@šxlaUċĕXm„IWmnkšVVƒ„VW_@aÈWUUmk@ƒ¯çVm»™±W¯n¥V™mkXw±ÇVwƒ"],encodeOffsets:[[113592,39645]]}},{type:"Feature",id:"6106",properties:{name:"延安市",cp:[109.1052,36.4252],childNum:13},geometry:{type:"Polygon",coordinates:["@@@kkÇmIšmUwVkUƒƒU²WmšVkm@m`mIĢĕUƒVa@™mXƒƒÿVVkyUýšĕ@l_UmnƒW„KVkţ™™¥™aƒwğ@™@aôƒ„ƒWa„kUmƒa¯¯™a±£kx™mmxUwÝ@xmU™b¯K™wó„Ý@kmm¹Ub@lklVbmnnVUV@x›UknƧJUX@ŽƒLÇWkw™LķƧÅwWJk„ƒLkþĉxWz™JUnǚkš@Ɛk¼ÜÔÈKšè@°lșÆk¦l„n@l¼@l¯L™°UU™VÇ°ƒ¹—`m¼mXk‚™bUaƒV@U¯x@¦™Ç™„UUmlmUVm„nnmlkw™@@šƒ¦Å‚ÇLmx¯Iklš„@¦mÆ°VUx¯Lm„@J„InlmxU²šmVbkV‚bUnȎlKU_šWlīÈaÞ¦Æ@„ÞlanV@ƒšVšUbl@XlÇÒĸlŽVa„UX„lm@Ñ°ƒƒÈmUw‚U™nyW£amL@mša²@lšV„™VLÆynX„šÝšVššKnxÆb@lk@WzXŽ@ll—n`šIV‚°b@n„m„„‚Unb„aVlÆ@ČxmnnL„¤ÆxššĠÛÈKVb„@„aWaœU‚ókVm™nL@W‚UnnšKlšœ¥‚bnIlU¯JlƒUkVkn`lUU™V»šwnwlUôšĊ¥nn„yÆb"],encodeOffsets:[[113074,37862]]}},{type:"Feature",id:"6107",properties:{name:"汉中市",cp:[106.886,33.0139],childNum:11},geometry:{type:"Polygon",coordinates:["@@lKnb@n„lWb°bkxĸwVb@ł„nlŽ„ƒĊ¥šL@XŽl™ÈƒVblÈK‚b„akVwôml²`‚nœ@‚nVKœl˜k²xŎƒ°¦VU„JĊw@çnWçރVkUóÛ@¥kwš™šUmƒX¯WšÑkƒ@UymIUwlUn¥‚mUk²a°¯V»@™ÝVș„ÝċÅÅVl»@l@a°±@_kammÅb™a@ƒƒm@ż™KknõĠ—@mšƒ„¯LÅw›‚—LVxmb@¼kV™@mw¯wVakKW»X±¼¯Vkxƒb„¼WŽ@nx@x±bóakbƒ@ÝmU™@ķÓÛL™kƒVUm™k¯¤ÝLUlÝ@Ýz™š„x@x™°™™™bƒmƒX¯aUJW¯—k@bÇWƒwÛwWxƒ@XWlb@Žƒ„VŽÈUlwšLnl°VlUô¦œU°¤VšUxVXUxlbkVVlƒI„°„ÅVlU°m@k„ÇU¯xUlƒLUlVL@b™°ĠInĠ°ÈnK‚„@xÞa²n‚aUyšXUKVkšWô¼Èa‚z°JXUVÇV_„JVƒšz@Žnb"],encodeOffsets:[[109137,34392]]}},{type:"Feature",id:"6109",properties:{name:"安康市",cp:[109.1162,32.7722],childNum:10},geometry:{type:"Polygon",coordinates:["@@„bĊaƨèšwôô„¼šb°ašXVƒÞVUÞ@‚aXƒm¥kImx¯¯ƒV@anU@UÇéğL@ƒ¯¥V£mƒ@ÝÈb„K‚™„X°wČÿ˜ƒ„b@xÈblxȯĊ„„mÆUVƒ„nÈ@ƨÜLĢ¥ƒŹnƒ°Vnn˜K„aô_ȃšwU‚aXmnW‚¯kl›LXƒÇ™ō¦ÝaÅVmbğUn¥±wÅéVƒan¥ƒ„U„»°am¥„£ƒÝ@ƒ„wVw™¥nU„уUmmVwmķIÅaóVWxkblb@ból@œğÒĉ¤ċXƒ˜¯X™xk„Ç@óÆÅx@š™xķ_kmݎǣkblb@`¯²@bk‚‚@k¼ÆUČƃÞǚÞU@šU¼¯°±bVlnm¦kVVxnJVz@‚l„™ÒXW°n„™V™šlx@¦ôÜVUl݄Xèm@è"],encodeOffsets:[[110644,34521]]}},{type:"Feature",id:"6110",properties:{name:"商洛市",cp:[109.8083,33.761],childNum:7},geometry:{type:"Polygon",coordinates:["@@²nl‚ôbš„°aVwnKÞIš`°wšXôw°VĊ°@ŽÅš„ÞÆV„zÞK@xšŽ@a‚LŚ@b@ŽnLlƒ@šln„mnLVw„a„bVƒ‚VnbU¼„Vƒ°„bl„šbÈ@ĶŦb˜@nÇ@amIyUI@ĠVmôƒU™ƒVwkwlanJ„¯lwó¥@an°Jš_„‚@š™nóƒó@£l¥UwmašÑ@ƒUm±V_ƒJ—£›J—UW¥¯@ƒ_k¯¼mUƒVUè¯b@wmL™»ğVmağI¯¤ċIUW™XƒKĵ¦ķaƒJUb™IƒlUóVmk@WÅÅÇ@ƒmU„ÅVƒnĉƒÇ°kwÇa@wƒa—„ċĀ¯xƒWšƒLÇa@Þn„U¤°¦@„ĠKÈê@VmV@b„U°°nwlJn¦W„bÝ@VŽ"],encodeOffsets:[[111454,34628]]}},{type:"Feature",id:"6103",properties:{name:"宝鸡市",cp:[107.1826,34.3433],childNum:10},geometry:{type:"Polygon",coordinates:["@@@ƒ„£@›°Išb@¯°ynŹƒaUƒlƒU£„Umšĵĉ@@ylUÞ@@£kWU¯WaU£¯ÇV¥ƒ@kb¯wƒn™¥ÇkUÇnUƒ@¯±›kULm›@m±_kŽónUxlŽƒbaÇLkŽUaDŽkšW@™Kĉ¦ƒ„kƒm@ŁUaķxlw¯aXaƒk@mmakL@šmšÛŽ@¼m„@l„XV`ƒn™KUš°°@²š¤UÈ@VxmôƒxKl„VV²aVw„Xla„Vlx@UVnŽÇnk°ƒVVL™lkI™šƒJÇk¯V@šknƘn@lznmlVkzVŽ„VVxš@Ux„z@x±¼VxxU„l‚kb˜@„¼Čk˜VXlĠkôV²w‚LUKlwœJ@a‚IV¥Þƒn¯Ün„‚„@nk˜l²kÆ@š°„aVbnI@™š‚Ťn"],encodeOffsets:[[110408,35815]]}},{type:"Feature",id:"6105",properties:{name:"渭南市",cp:[109.7864,35.0299],childNum:11},geometry:{type:"Polygon",coordinates:["@@@ÈôL„xUŽ°„Þ@mŽÈnl¤nUôL‚wX`@ÞÝL™ŽUšmLô„„ŽôbVbnºlnÞ@ôƒšx°LšanV‚wÞ@Vxnwšnlw²¤šb°°„bVnƒlXbƒ„ó„@bš‚Ġ@„xšbš¦ŤšV™Xġ„£W¥ƽɽƒó@ýóƝÝ»„£X™mƅšĊkUƒ„@™™šó„kťaĵŽÇ@™akƒƒa„¯ƒUV»maUU„ƒaƒbUxmKƒnkm@™k„mK@ƒxó@¯n¯KǦ@ôÅèlxkx°nƒƾ¯KU¯WķL@VÝIUb™yWbX¼Ç°"],encodeOffsets:[[111589,35657]]}},{type:"Feature",id:"6104",properties:{name:"咸阳市",cp:[108.4131,34.8706],childNum:14},geometry:{type:"Polygon",coordinates:["@@šIXyĊwlý„KlƒXIVaķƒ™»a›£„¯aVU@a™‚wÈō‚ašL²»‚VœUln°WȯW»XašzVaÞJ@Uƒ»@¯Ýbğwly@£kÑţ±Wу@ka™IUƒƒnƒ@¯ƒómţU™b™U¯lÇIÝb@¤Ý@kV@zĊ@™ĶnƒVV¤k„V„„bmź¯z@°™a¯J@œƒ¤@„„bUx™bƒ„@`™xUÔ±ºVXœW‚„UnUJ‚LĢ¯ÈKlblmÈXŎ°šU„°LšŽlkÞKš@Èxl_°ĶUÒkblš"],encodeOffsets:[[111229,36394]]}},{type:"Feature",id:"6101",properties:{name:"西安市",cp:[109.1162,34.2004],childNum:5},geometry:{type:"Polygon",coordinates:["@@°²@‚„mVVÈÈlš¦„m°xla„@U¦°ÈV¤XbV°lXÞaÈJ°kšVšaŤVôn°„„@„mV„šJlb„@XÒŤ²lÒ@¤kzĠxÞa@°„¼ĸK°XV‚°L„ƽ¯mlwkwÆç@óÈ¥°L°mô@„w@aƙK@b™@wÝLƒyÅUƒÝƙ@ĉ¯¯Uóx™W¯x™_ÝJmLUx¯b™ƒóak±mÝUU„™W¯b™aƒ»óó™xƧçĉbƒaĉxƒIUV¯¥ō„±w—l"],encodeOffsets:[[110206,34532]]}},{type:"Feature",id:"6102",properties:{name:"铜川市",cp:[109.0393,35.1947],childNum:2},geometry:{type:"Polygon",coordinates:["@@ÆxĸƨšKlxÈX„K@VWƨIlmœV@wVUmUnmUalk@kVaUaóaƒóƒnKV™šÞK@ÝW_xóKmVk£ÇmnÝ@¯ƒVƒwóK@ǯXkm›VU±¼™KbÇŎx‚š@bUV°bƒœ¤‚bš¼ĸ„Ub"],encodeOffsets:[[111477,36192]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/shan_xi_2_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"1409",properties:{name:"忻州市",cp:[112.4561,38.8971],childNum:14},geometry:{type:"Polygon",coordinates:["@@Vx@lnbn¦WlnnUšmš°š²VšV‚VVVnUn„ºlz@l„„@Jƒ@kXWVXl@Lƒa@„ƒKUL„ŽlbnKlLnK‚LnKÆXn°šbVV@bUVl°Un@LnaVJUbW@UX²l‚@ČwlVVIšWnkÆa°„„anV‚Kn°™UW¯@™aVUVk@Un@„aV@ValwUanmWU„k@WVUUanaVwnLVl°@nk@mVU@UVK@w„LVKVU@ƒ„K@UUKVUV@@bnL„a‚V„aôšlIXmlKX_°KVV@bVV„@šzV`kblI„V„Ul‚šL@bnV@V„Ċll„„VlIXW@k„a‚U²blKšVnIlJ„albXXlWVn°JnšnL@l@XlJlaX@„X˜W²@l_VmnKšU„blU@mnkVK„¯@U@ƒma@kX¥VƒmakkƒLƒa@aƒ@WIUUVXWWnk@a°a@kkm@kUUmJm@WUUUIk`m@V—kaWWkX™KmƒXk¯ƒ@WKƒLkak@±bƒw@ƒaƒa@akaƒ@ma¯@ƒL—KÇÅkKWbkmġ™±ÅUƒLUK™VVkƒm¯LUVVbƒ„UwUW¯bm„ƒULƒxWJ—@ƒklmkUm@@KnwVkVK@akwƒ@@a¯bƒKkn›VUI™b¯mmbk@UbmKUL@xUUƒ@klmLUŽlVXI‚VVVUVUœU`mLXVWbXnW`Ų°xmŽxU@mĉƒƒwU@mbU@UƒmbkVW¦kJ™@ƒX@`¯Im@UlUVVnb@bWJXnmbƒJUU™UUaƒ@UamIkaƒxƒ@@x@b"],encodeOffsets:[[113614,39657]]}},{type:"Feature",id:"1411",properties:{name:"吕梁市",cp:[111.3574,37.7325],childNum:13},geometry:{type:"Polygon",coordinates:["@@@a@w„@„wlbnJVb„@VbšVVV„InaWmXI@a‚aUmVUVkn@°J@_„Wš@lIX¥lUnaV„V@naV@„xĊ„n‚V@‚wn¯wƱX_WmXaWUnKV_V›VUUUUWJkUVnKlk¯™@@kmKUaŁ±KkU@WmI@WUIlUUmVwXƒ‚w@ƒUlUVwœV‚@„Lnb‚W@anU@UšaVkô@l»n@na˜JnUÈLVaƃUUVm„VKVƒ²L@mU_lK@UVWkU‚a@a@U¯aUaƒÑóÑUb™„ƒKk@@aƒk¯mVaUwVƒÑkWUmK@UUKmXUWÝwUa™LUU@aWJUUU@Ua݄U@WL@VKVaVI@WnU@alIVKƒƒ@kIƒmIkJ@™m@ƒ™@@_™K@xƒ@kaW@U„@Vmn@ŽUK@mIƒJUXV¤XXWlkKƒkkK@XmJVakImJU@ó™¯LWKUV@nUVƒLkxmKkLma@kXKmmƒLƒab™LmK@V@mXVÆUxƒX@`nL„aV@@VmLUVnLlLš˜„b@„šŽ°²nx@b‚VUxlb@V¯bUV@zV‚XVĊXVx@lVn@VnnmŽUš@LlJXVƒz¯VWVXbšV@bmn™VUVk„Çþń@XVxmbUlV„Uln„W„@„Xl‚@VLXÒ@bÞJ°¦„L˜ò„@nU‚b@°„X@ŽXbmVU„V„nb@x‚x"],encodeOffsets:[[113614,39657]]}},{type:"Feature",id:"1410",properties:{name:"临汾市",cp:[111.4783,36.1615],childNum:17},geometry:{type:"Polygon",coordinates:["@@nW‚@@UnLšK‚a„b„KnnWL@lnblKnLlw„KVU@mVUXL°KôšV@nIlJUbnI@WlL„llLXkWWU£VW„InJ‚@VL@nm@UVƒX@lb„@@wšL@`‚@„šn@V@lw„@n„VmVX„WmwnUlƒœa@_lK„wVlUn°xVKVXXWlUšVVI@K@K„n°KœwlVlU@kna@V_„Wn‚m„UVm@kXml_@m„LlKXw°m@_ôJVUV@X™l@UaV@Va°I„lk»VwUkVmwUmmVn@V¯@KƒU—wmK@U¯wUVÝ@mJƒU—nWK™@@UnKVa„_lykUmKÛnm@™x@ƒUUlwVk™ƒXW@ƒa@Uƒ@@K@ƒkIV™nammVakUlƒ@wX@@kƒ™¯@ƒVVbml@„„°UbULmlVbnbÅK±VƒKVXUJWa@ULWaUU@@U@aWK@UkxUKƒLUUUJ±UkL@V±kk@kam@UV@l@LWl@n@VVUx„LlUUx@VUV™U@aƒIUl™L@°mLU‚ƒbkUUaWUUaUU@aWK—LWJ@bUL@VUVVbU@m@a@kmKmnĉlUK™XƒWUblb—xmIkƒƒU@xWb@lkšVx™LXŽmzVV@bklVVUzm˜@bk„@Vx@xlŽU„@lUbVnl@„Wxnl@n@ŽUbV„mL‚mƒb@`X@lUX@@xlnkLWaUJnnWV™Vn@l„@bULVV@l™V@XnJVX"],encodeOffsets:[[113063,37784]]}},{type:"Feature",id:"1407",properties:{name:"晋中市",cp:[112.7747,37.37],childNum:11},geometry:{type:"Polygon",coordinates:["@@@šlInJ„lJ„@‚„ULkJ@bmV@XUJUb‚L@UXKV@ރVbV@VVXI@bVVšKVbÞxVXnWVL@VnLV‚lX„ÒUŽVxUb°n„l@bl@„LšƒVaô҄ÒVb°b@VnLnnV@lmn@lb„U„V@„‚JœUVV‚Xkl@lUzmJ@xšXkl‚bUn„JVšUb„nU‚lb„V@nlLX@lakšV`Ub°š@XVJnU‚L²KlxnI@KV@lbUbVV„KnVl@„zlm@Uš@nŽšI@WUaVl@@mVU„@XkW@ƒnkVKVƒ„_Vw„y@knwVa‚@XalU„@šVnml@„X@V„L‚KVaÞbnnlJšI„mVKn„VVVInVlU„@„m@™mXK@UmyUI@mWUUakamw@wUwmLkakwVƒmK™w@wUam£y@am_ƒW@™UU@knmm„amU@WUa@knw@ƒUUUUV@nƒJm@mVUkKVUUUkKmwƒKULƒKUImV@lUn™nŽm@mbUK@°™bUnmbUmkkƒWUb@am@UXkK@a±@™V™@ĉř„V‚UXVxUVkLWl¯@@bULUlm@@nm`—XƒlWakIkm›VUbUL@Vm@kIƒ@@Kšm@—VaX‚I@W@aU@kUƒVU_™KƒbƒJkkǎ™b@nkKmL™wÅW@kVUUƒVU@WUIƒJmIXmma@_kyVaUUlkUm@ƒkU›x¯Lƒm@L@LUJ™UkVWXUWUL¯wVmUkƒxkL@`›bk„mVnxƒXUWUnmƒƒ@kxU@"],encodeOffsets:[[114087,37682]]}},{type:"Feature",id:"1408",properties:{name:"运城市",cp:[111.1487,35.2002],childNum:13},geometry:{type:"Polygon",coordinates:["@@„Vl„nJ˜wkaVa„XšWVLĊknmnL‚l@@bn‚V@UaVU@UVK@aXI˜KXL@bVVVbXVVblV„aVnK@¯šKVk„J@bšVVU@UVwkVƒKVwUUm@@Xk@K@kVUn@lbl@²l@UlK²VVIVV„KVLlw@VXL@b@VV@VŽXbVK‚@XbVIUW„L‚U²ÆLmaUankVKVaƒ¯@ƒnkUa„U°@„š‚n@@kWa„UVaXUW@IXKVw@U™ƒ„™WU@W@@UUƒU@mn@ƒ`m@UUULkUmJ™IUƒ@@UƒK@U@›anƒ™ak_@wmKUwmakV™kmK™V™k¯b™wƒ`kwUIÇx¯»ÇaŃmn@@™mƒmUkV@wkKW@kxmL™UkĉLÝk™xÝw¯lóVU„mV@ĀVVX¦W¤kz@`Vx°„²ĸ‚š@„Ul@x„êĸNJ°¤V„VlXLWnXxmV@nUl@„"],encodeOffsets:[[113232,36597]]}},{type:"Feature",id:"1402",properties:{name:"大同市",cp:[113.7854,39.8035],childNum:8},geometry:{type:"Polygon",coordinates:["@@²£šyl@Ȑ˜Ė@bĸŽĢbĸ„˜X„a‚KŤnn@ŎôllÈx„nVnÞDŽV@b‚nXllL°KšbVb@J@b—„‚„@ŽU„„xlKXLlKlXk„@Ulk„JlkUƒVKXUƒÇVIVm@_nǚLšašl‚w„VnU@UUwma@aƒaÝaLmUk@@Wƒ@U@@X™wVWÝUUUk@@VmLƒKV»nwUw™aUL@`mzƒJUIVƒUaUw™KUaVIlJôanÑlLVUn@ša„@VV„@@UUwVK°Vn_lJÆLœéW@UUUÅ@»lm@aÞIVwXW˜UUkkm@U@aƒU@mwU£VWU_kWmƒXwW_°yUkkK@UÇK@kkUVymóK—U@KWIƒbUak@mJ@bkbmLkŽ™UmƒkVU„W¦@lnb@„@Vƒ°ULml@nkVƒa™VmLUnk`±@—XƒWW@kbǦXŽ¯„WxI@xmbmxXlWV„„@bŎUz@J‚b@bÞb™ŽU@Wbk@ƒxk@WX¯VۙƒWÝbÝUkVUU@alI@a@akLWa™m@U¯UUmÇL@K@aU@¯VUkƒKmX@`@œkJ@nV‚Ub@lbVÆXVW„ULU`VbkLUV@XWl@bXJ˜@VbV@Vl"],encodeOffsets:[[115335,41209]]}},{type:"Feature",id:"1404",properties:{name:"长治市",cp:[112.8625,36.4746],childNum:12},geometry:{type:"Polygon",coordinates:["@@Uk™Lky@I‚JVa@mÞaWšy@_W@_WƒXVlUVwš@nw°K@m„UƒVaƒmVkU@mmmnLVUmKXa™U@IlKVUnK@UmWkX@WV_Vƒ@akU@a„KWIXyƒIUVmUn™Ua@WaXUVKVmkUWVkUƒLU@@VƒbƒKbƒIUmƒ@mbVL—x›WUUkn±V¯wƒbÅJUbmLkbmKÅKƒbVnUbƒV™KUb™KUbmLKmƒb™aƒKkUm@UŽnn‚VnxUVlUxl¼ƒk¯JUbU@Vbk@WšU@UVóI@`¯nWxkLƒK@nk`Wn@lUnƒVnm‚ƒXU`@mb@lkV@„VnklVVUblz@`nbWnnJ„IVJ@XUVV„UV@lÆXšxnKlL@mšaȍll„I„ašLV`„UlVV@@b@XJWUb@˜™n@L„@lJn@@UVKVaœUlnlJXb„k˜Wn_@mn@VkVK@a°@XklKVUUwVWUšƒĊƚ@šU²@@blLVWn@@bVa„XllVnnaVmša@¯VLnan@‚šmVm@knUVJ"],encodeOffsets:[[116269,37637]]}},{type:"Feature",id:"1406",properties:{name:"朔州市",cp:[113.0713,39.6991],childNum:5},geometry:{type:"Polygon",coordinates:["@@XXWVXVWnnlnn@èƼ@„„xlš„ŽV„nblšššVŽÈUVl‚š@„blnœL܃ĊmUkU@Ua‚—@WI@aXk@WVUlKUaV_VKXƒWUUÅka@VaU@mlI@›@_nW„LVl°UV@@b@LÈKVn°V@VšnXblK@b@bkJ@bVVlUÞVÞa„Xܚ°UXWl@„wl@XaV@šÝa@aa@IVyƍ@aƒƒXUWknwna@w‚JXw°ƒWÈ¥kI@W@kmKm™¯IUmkXWWkaƒbkImJ™UkL±aVƒb@lWXkJƒUkƒĉkƒ@UmU@a™KkƒVƒUkJlaU_™yƒ@UU@aUU¯LW`kLWnkJó™ƒbUƒbmK@aU@UVVL@VƒL@„UVULƒK@xUL@VUV@nml¯@UkmKUxmbVbUV@XƒlXVmnVbkxUbU@ƒbm@@VUlUVšb°@VX¯šm‚"],encodeOffsets:[[114615,40562]]}},{type:"Feature",id:"1405",properties:{name:"晋城市",cp:[112.7856,35.6342],childNum:6},geometry:{type:"Polygon",coordinates:["@@lV„Lšb„an‚LnKVašLVašL„UVaUm„aÆLnLlanKVaÆI„a°x²UlmVVœX˜wUKna„@Vn„J‚a„L„a@UV@@alUkKVKnkmmVwUk„w@ƒ™@kxWUXƒW@@mƒk@aUa@a¯aƒLkKmwkUm@kL@K@aWIXmƒVƒXƒWkUVakL@UVKƒw@aUK@UUKmLU@¯n™KUwVƒUIWJUWmka™@UXƒJƒk@UkmW@kLWKVƒx@bmI@VUaVU@a¯@UUmVKmX@±`kÝKVxUL±akL@V™bƒLkKmVƒ@XWVUbƒVXb@lm@@lW@@xk„lVUbnnmbUšlJ@„@L„@@V„b@‚WXš„UlkxVV@„šwn@ÜmnLlVkzƒ`UbmL@Vš@XL˜m„VnIÞ@VU°x@VnL˜x„V@LU°"],encodeOffsets:[[115223,36895]]}},{type:"Feature",id:"1401",properties:{name:"太原市",cp:[112.3352,37.9413],childNum:5},geometry:{type:"Polygon",coordinates:["@@„@VV@wVKnLVal@na°nšaVJœUlm„L°a@b„@lx@bULUlmx@Ln@lVkn„l˜@XI„w‚K„Vnƒ°aVXVx„ƒUaVU°K„nUlšUVL„KÆVš²Ģ‚lnXalLÈƘL„KUaVkUanmWU™a@WwkUWU¯y¯Ñ@anIl@@aVU„m„I„ymUƒLUUVakaU@@LmJkw±LKmVUI@W¯™VaU_l™kbW@kK@mƒUkaVƒmVaU™ƒIVmalk™W@wnIVy@klkWUU›VI@ƒƒUƒVkam@knU@mmmK@bblVUX@VkLV`@n±KU„ULƒ‚UnVVńUbÇKmV—Imbm@k¼ó@Ul™b@VmV@bXmaƒK@›UUxkV‚V@„xW„UxVnkVVJ@XnJ@XlV²LƂVbnL@lš@°"],encodeOffsets:[[114503,39134]]}},{type:"Feature",id:"1403",properties:{name:"阳泉市",cp:[113.4778,38.0951],childNum:3},geometry:{type:"Polygon",coordinates:["@@°@nb„@lb@b„b„b‚@„x²al@lb„KXU@m‚kUWkkmUUƒVwV@XUW@™naVklKXblKnL‚ƒnLVanImaXKlL„ašV@U@KUKW„alƒXK@£WKXUV@VU„ƒUUVW„_V™@W@@K„@šƒUƒƒIWmXUmƒULƒn™JkImmÝaUbLƒK@UƒWk@mn™Uƒ@kVWb@Ubmx@lƒzUxƒ`U„ULml@„XWlƒ@UV@nk@U‚Vb@X™Jm™@@Vknƒyk@ƒzƒJƒnUV@bk@mJ@b°Ò°zXVlVXx‚@šbXVmnVbUlVb"],encodeOffsets:[[115864,39336]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/si_chuan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"5133",properties:{name:"甘孜藏族自治州",cp:[99.9207,31.0803],childNum:18},geometry:{type:"Polygon",coordinates:["@@ƒaXamƒ¯wm@±°wUwV@UaVw²Kš™„U@UƒU„¥‚a„ƒ@£Þ™ôx‚Knkm™X¥™IUƒÝUwlk°V„@ƒÈ™‚KUwlkUyV¹„mšx²Xll„ÑW»š„l„w°UŎ„nƒ„„˜Jœƒl¯°V@wôIVÇn™nUllšLšVǚLô¼XW£@±„@¥k_ÇJƒkUéƒkšƒƒwXa@ƒšLlw²™Vx„b‚mš¼ÈxlLȃ„VWÞn¯mǙÑUÝlÛkwlĉmƒULmwUJ™ç@wkm@ÑlUX™ƒÑôġƒVa™ƒUф¯@wķÓkbV„mnU@@y¯IķKƒV@¹šaƒé@k„mÞU°¥@a¯@anKlblU„¥@óğç@Çw@wkla„çݱk¯±@ğÝUÛmݯwƒ@kb±¯akXWÜkXUÆÇUš¤X_Ɛw„V@¤ƒXU‚ƒbUƒŽƒIUlÇUkŽġ@™aXČmlUlèUV@„mVk¦Vxš@¦±š¯ƒƒ¯¯anlWš¯nƒƒÅw@w°KVak£m@klƒKknÇU™»óKšīlaUaV£@™™¯@ƙU™VƒÛÝÇXƒÇl—ÓlŹ„»WUğJ¯£mx™Lĵô›ºX„VlUll²bl„„lŽƒxónn°ÝšU¼mJUš¯nƒƒƒV@êĉ°Uĸ™w™@mƒ@¯kmXamѯaUwÝKU¥„mÅn¥Wmn™ƒ¹n±ƑƆÇôXê±NJnšƒ‚UôlĖkȂVÒ¯¼VnƒȮ¯ĀnƆ˜Ģ@Žk°V°¯ĢVlkšVxm¼X²™Ŏ@ŽVxknWÜ°U‚¯n™Æݜ@`„ôݲÒƒ‚Çzn‚mX@x„è°K°Å„UČĬóĖ݄ƒ˜ó¼ÅêƒÒƒbmšk@V„Ž˜„@ҁl@nĉܛê—x@Ėml՛J¯¦óxȭ°ÝmŽ¯Lĵè›Ā@Ɓ„l°żƒ‚šX@xmŽkV@z@‚„°blŽnÞ°J@bn@ƼUVƒUóŽóLƒ°X°ÝLƒxUn„°ƒĬƒn@lnL@ŽÆ@šn„KÆxnUnV˜InĬmÆnxŎ¼ĊIĢóÞ@ĊƒƨbUƒ‚mV¥lkƒ‚wnL„mšÅÆ¥Xƒ˜wU@w‚wUÞ™@alUUŚU™Vkkm°aU—°Ó°w°U„ƒ„b°aš²K˜¯œĕ˜@ÈbޏĊaš»„XVm°In„‚Ĭk¼Vb„ašJšôš£VĊan™‚k„ů™™nƒÜU@anKnĮ‚bÈmƎš»nI‚霣Ġ™"],encodeOffsets:[[103073,33295]]}},{type:"Feature",id:"5132",properties:{name:"阿坝藏族羌族自治州",cp:[102.4805,32.4536],childNum:13},geometry:{type:"Polygon",coordinates:["@@l@@þ²I@lƒ„VL°wnJ°Uĸ™Ŏè„Ilw„V°¤nĮ™¤Ý„lè„L@„ƒ„@x„l™è²ôĊ_ĊġVÈôJżīlbXšÆÈVŽkxÇVƒ„n°„¦Üb@è@nn@@°šUÈ¥WDŽ_Uala¯¯UǙkƒ»„mVwk»˜k²°VxlL@¤œ_@x‚`ȍ‚Ėöb˜š@l²alX„a@bnK°¦VK@nnWmx@nUnl@@lƒlĉk°l°UXkmW@Unš`k„ÇL„ŽW„ÛÈVxšVVlVk@l„IXb@ylXÈW˜Į„WŤzœy@šmIƒŽ²šJ‚š@nŽ°@V„„J°a„Å@ƒŎkVǚk™aUw„KVw™™Vƒ„@nkm™@±ôkô™ĊJš¼šInÑm±nIššÞ‚XȃĊxĊUÈbÜyÈ£Vkw@kVUV™„m@ša„»ÜbÈmƒUXwÝxƒUn¥@°ġ™Å‚aœJVk™aW¯Û@W¥—UŏĶ™@¯kUƒŃ@ašI@mmanwސ‚W@œ™mw°»Uřk¹±W„xVx¯¦U°ƒzţW™w@°ÇVÑk¯@„y°aš£š@šmšnl¼„ašÝÝakwUƒ±aĉImlĵn@ƒm@kkVƒ¯Ñm™ĸ™°x„l™œ@˜ƒXVÞmlÛݙĉUÅ¥mwÅ¥VaUw›™XġċaVůÛŹlwU¯U™ó±™xÛV±¯¯n¯mċƒLmnĊm‚™@™_kJWaXmwUƒĉK™»™@mwX݃UDŽkKÇw™»nƒaUw±škx™K@„Wb„x™„„lVê„lÈIl`@¦ƒŽ@²X¤Wó»™KUșŽ™KkkmVmšUÈóJ@x¯Uk°›„—Iƒƒm„ōƒ¯Vƒxƒk™ŽX¼ƒÒkk±W™wƒnUºVzklVxLǚ@„ƒŽ¯UklVxސV„šJW¦nšmlLówݚ@¤ƒ„bƒ¦„V@VƒV™š±LUxVbU@Vx¯x@²n‚°xn„Wb„b"],encodeOffsets:[[103073,33295]]}},{type:"Feature",id:"5134",properties:{name:"凉山彝族自治州",cp:[101.9641,27.6746],childNum:17},geometry:{type:"Polygon",coordinates:["@@ĶóšKnw°¤ĠIXVƒ¼kź˜Ôk‚„ÈWŽÞȄÜUVšÅš°@šš‚@U¤Vbkb™ĬôLš¼ÈVlm„Llkn@l¤Ub¯L@xÆx„„°mX™mk°b„°°„²™@¥‚™Uwl¥nU@ƒVUkçVnkWċšbĢ@lÈVVk„J„‚V„aV„W@£ƒUƏxW`™£ÈVVÅlWXÛlW°b²la„@°xnÞVÜĠÞ²@l°Þ²ƒèkblŽ@xÈx@Ġènal£nU‚Dz@‚ÞK„nn¤@¼˜°U¼„nV‚šXU‚šbn™ĠUVbUlVš°LX„@lV„èÜUnK@_ƒyXVyUwmIU»Vƒ„kÇ¥šÿkkV¯m±n@ƒn¯ÜanVVƄz@Ž‚bœwÜb„m@wša@kƒmk»@™a@VUUó„w˜@nb°mš„XŽmnVbގVôanwšJ‚ak£lw„˜šLšÅnÝ@wl¥IÇӃ@U™™Lƒ¼kVǃÅó¯kVmmw@ƒn_‚Vn»°LÅ»@éÇçŹīVÇÝ@ÝğU™ƒaVݙ™š¯ķlŭġlƒ@óÞۂċ@¯nkUӄ—m±™IVġUwóKUn±¯—K›w»ƒKݐV„nl@„óxUwţ›£ĉƒUmŗÇ݃K™„ÝUlmKƒ£UVŽ@ÞȎW¦„Ò@Ĭšnny‚@nÒmœVŽ—¼@°Vbl@VlnUUwl™°a@„œ„@llnk°lbnKWĀnŽU„VxUŽ‚²Å‚m¦Û›ÇŚƒaU„Vbš@¦m`móX™Umm™xÅ@±Þn虲™U¯»m™ƒV—m@wƒU@wݚÝmLƒa@„™VÇUk„l°¯„VlkVƒ¦UšmxƒaULUèVx@„kIUxmWV¼¯VmȯšU„nl›È—@m»Å™ƒVWxÅbÅğW@kƒm@kVV¦mlnn@‚ō„l¦Åƙxkœ"],encodeOffsets:[[102466,28756]]}},{type:"Feature",id:"5107",properties:{name:"绵阳市",cp:[104.7327,31.8713],childNum:8},geometry:{type:"Polygon",coordinates:["@@„ńlV°š@Őĵ˜VX»ÆUĊќJ‚w„@È»m»š£°Kšk@ÇnÑƍš@„w°JUwnw@wšbVbš@VlźLUw„aƒ»„aUklyUUVakwWXwWƒUxkLƒmn¥mšwk™˜UX™lJ„w@aƒIk°X„¥Wƒ²l¥šaU™„IlmkklƒÈL@m°nlWU™aW—š@Vƒ„@UaV¥@ašk@Çk¹ƒK@a™K@kƒKkšÇX@VU@kx±V™èkIWwUVUkkKÇ@ƒa@wkml¯@kUWn£Wa„aVwnaV݃w¯@UaWx—n›JńUxUšma@L@„mbUŽU±VVnkxUƙ„VŽm@kkKW°„X@¤ÇUkÆÇnU¦¯ŽkƒmLVwÅK@UóbÇƁVƒ¦™L@‚±êX¦mVޚkÜÝnWU—„›@kšƒŽ¯wķšnš°ÒU„lln@@„ĶmnkĊJ²bV„lxÞb™Þƒbk»™m™n™@™¤¯bƒz@Žl°UÒ¯È@ŽšxŤX„yV¯°¥Uwƒw²XlºVŚ¯¼nx›š@ŽXݏmxnb@n™J@b"],encodeOffsets:[[106448,33694]]}},{type:"Feature",id:"5117",properties:{name:"达州市",cp:[107.6111,31.333],childNum:7},geometry:{type:"Polygon",coordinates:["@@Uxn°‚bnŽlUnÒƃnn@n‚¤„LnxlU„ššV@„Æl„x°XXxl`XœƒVW‚œL˜è—„±nÈbƒŽ°b@š²x°Kܼ°ĉ„V¦lJnU@¦šÞ‚JÞğ„mšLÞ»šxU„lb„VÆann„alŽ„VƍX@lnŎV„mU™maÅXƒa@aWmœ@‚£@wĉJVƒkk‚kkmƒnk@ƒmna@šal„Kš™‚J@Þwm‚ÅŃ@ambkUƒƒ@™™KUġKU@m‚ak¯±ƒ„a@aĉÑÅaVwšXlwƒ±—V¥l@@a™kƒ›@@£šmƒĉÝónWV@ŽnÝÇÇx—UmbƒaVkkk@m„@m°ƒÝýXm›akÅīƒ@@ƒmb@@xmšnbƒ@mxšŽkWL@ƒ¯b@WUXmWœWKkbm@kx™Xmm@LUl„xlêóK™nUš„all™LƒlLó°m¯JVšU„K„„@x˜K²Āô¦l°"],encodeOffsets:[[109519,31917]]}},{type:"Feature",id:"5108",properties:{name:"广元市",cp:[105.6885,32.2284],childNum:5},geometry:{type:"Polygon",coordinates:["@@ÆL„Ċx°»Ŧ¦˜W„™šLȄ@xÞKÜ°ÞnVxÅĀlÒnJ°a@w„V¯l@XWknKnw˜VȚ°XXa˜lX°VI°b„W„nšaššš¥@ƒw°™n@šyÆ@nkÞ@°¯lJn„°IÈl‚UšlXÅ@ķlUV¥VUUÝޙUUƒ@UwƒJUkĉm@ýƒƒlk™WUwVwWJk@VUK™lUkaVƒUƒmLk„m@ƒƒ@Uƒ›Ik`@„™UmlUkV¯ÇXKÝ_mm¯@Uƒ`kwmƒl¼±KV¯—¯Vk±Vk±kzma™KUnDZ™bk¦±ŽX„ƒ¦¯Wl„J@bƒxkIWš—Vlš™xnŽm¦„nlKVwX„WxXŽlxUbVVkzVlƒb„¼ƒbVxŹKUk™@Ua™a@xmxVx¯Iƒx™@ŎmÒ@șl¯L™¤n¼"],encodeOffsets:[[107146,33452]]}},{type:"Feature",id:"5118",properties:{name:"雅安市",cp:[102.6672,29.8938],childNum:8},geometry:{type:"Polygon",coordinates:["@@ln@xšèVInxVKn„‚ĊklxkÜVޚÒnÈm°nxš@š¼ĊLV„nx‚WXblIš`š@nmĉn‚KȄôÅlUÑmU„K²¹@ÇÅVÓůVýÞW„‚UVmX„ÆbnwšKUÿ‚™@UmmIUb¯¥Uwƒ™¯™Çmš™„çmanUm»UUƒl—kƒ¤ƒa¯bV™U_WĕmÇŚ±ĢUlƒUl™ÛVƒçkUƒ@WŽ¯KU™VkUağVmš™aV™WUƒmV»—¯@»m£ƒmÝLŽ±@ÈmVk¤mb@ôƒ¦kVkamL@b°‚@b¯¦ÝVƒn@l„ê™b@º„UĸL°J@zV@nmUƒlaĸÔ@xƒ°VҚ„Ub„‚óĢ„ÒWškV@Ò"],encodeOffsets:[[104727,30797]]}},{type:"Feature",id:"5115",properties:{name:"宜宾市",cp:[104.6558,28.548],childNum:10},geometry:{type:"Polygon",coordinates:["@@VlÈnl‚XnWLX`m„²nV‚@b°xĢçlnšVm‚nn„@@„°‚UzšlV°nޘÒkxl„w„`UnVb„mšL@albÞKÈۚmܼ°@Xǚ@wmW@ńKĊL„lV„šLVŎçÞL²±‚ğkw@Uƒy@¹lKX™lKVa@w™™Č@‚w@a˜ÇU¯n™@@wġak—™aō‚ƒƒK@Å»VakUWmķwkbğ¥mL™akš™@ġރ°¯xVVÞ@VšxVš—VWx„XlxU‚™@k²WVŃULmèULVĊklĠ„VœJVx±nŃ¯¦mwğ@mƒƒlğkkl±@kšUk@¯±Ç™Kƒ—kxl¤b™Imx"],encodeOffsets:[[106099,29279]]}},{type:"Feature",id:"5111",properties:{name:"乐山市",cp:[103.5791,29.1742],childNum:9},geometry:{type:"Polygon",coordinates:["@@kšVŽk„ššÆkšV²UlºÈIlxƒLXèÜlU„„XU‚mkƒbVè„x°@„@¼°Knnn@m˜ÆIUbnJ@bVI°b°±@nK@mVakkƒKl¯nbšmĸ„èl@VnÈl‚UUw„wmwnm°¥„L„™lLnU@Va™ImbkƒmK„ƒƒnk@mƒb™ƒƒLV„JVUUƒ„VnkVmb@a¯JUaÆkk¥„IW¥„Klw—ÑmÝU¯™kVy¯@ƒƒ@mmn™Ukmġè¯w@aU±mnƒW_XKWmkÇmUkóbUÝUanmW™ƒ¯nma—@ƒxVôUV@šb@‚l¼„n@l™b@xƒnÛa›xa@ƒyUÅmUÛbm°@„m‚n²U°ll™ĀȦƒlU„V¼nJVxUz‚W„z@`mL"],encodeOffsets:[[105480,29993]]}},{type:"Feature",id:"5113",properties:{name:"南充市",cp:[106.2048,31.1517],childNum:7},geometry:{type:"Polygon",coordinates:["@@ȲVmšLnblyl²²UUl˜°U°²L‚»„knlx„_VŽ°@nnÞ`WL°ÈUŽVlnkšV@ƒl_œJV„‚@„„n@lƒnKV£™Çšƒ„UV¯šm„@laX˜U„‚UbVx„@VkôJU°Jn™@™‚wUk°wnUƒV_nJmknmm¯Vwk¯ó¥±ÿ—L@wƒƒƒLVU™kU›bX¯mykI@a±Kk¦ULmaXƒƒVm¯ƒK—z±ƒklUIVbÇJšƒkL¯™l™ƒU™ÿ™UƒlUkJƒUmŽUUkVVklKk@@a™U@„™J„²ƒxƒ¦kĬ@¼±ºXnWb—xƒU@xƒx@lšL@b„Llº@șl@bU¦Vbƒ@U„™@X˜‚bVškX¯m@nÇKk„llknƒJVš"],encodeOffsets:[[107989,32282]]}},{type:"Feature",id:"5119",properties:{name:"巴中市",cp:[107.0618,31.9977],childNum:4},geometry:{type:"Polygon",coordinates:["@@V„U„lbkVšŽVLUŽl@XI‚ŽUxVxšXkl„„@þĊnVl„IVx„@VVݚVÞUVU¦kV@ĸWÆô²š@VÞnš@Vaôb²W@‚K@XUmÑUW°¯°Ina@y„_lWn¼lLUbô¼„Kla@™nkUyô—Æx°@šn£™Ý@¥mVkIU¥Ċƒ‚¯Û»¯L±w@™¯a„Ça²m˜ƒ—ç›KX„UW›k_Ww¯WƒwÅk@ƒ™Uƒ™kVmwƒK£@mmmńmÑkVmamnnlmIU`V„m¯xVlx@šmš¯IV‚óIUlƒ@UwVaƒ—VW‚kbƒ@™nU°ƒV™„šÈU¤"],encodeOffsets:[[108957,32569]]}},{type:"Feature",id:"5105",properties:{name:"泸州市",cp:[105.4578,28.493],childNum:5},geometry:{type:"Polygon",coordinates:["@@VVXwVKn„˜wnVƒn„l@b¯xmKUbVn°°X°@blLšènV„@Vn‚l@U„LnmmUna„VV_ĶV@wnJ„„l@@kkKVólaUwnJm„wUlm@ašUaôKVnJWbޚ@VšwVLX¥VVš_Þ`šw„WƒÞŹmmnIn¥Wƒ@k„WV¯@ƒ°kI™ŽƒLk¼Ç@k¤±Xk˜™nmݯUlÅÛKWV¯kƒlUwkLƒÓ™@U—@ƒ‚w@ġXV„˜WX„š@UbVbšV›š_kÇV™lU°lnwŎ¦ÞaƯnmm¯šU„™m¥nkVmkƒl_ó¥¯UÇl¯@™ƒ™L™kƒ`¯ķLUy¯@mw—¼ķ°ġ_řU°mlšnÇVUޚ„@‚ƒš_ƒJUnV‚UXšbl˜Ģb@x@mšV°—È‚b@‚xċ@šš@xUbkLWškL@º„zV‚@lxĠ±²"],encodeOffsets:[[107674,29639]]}},{type:"Feature",id:"5101",properties:{name:"成都市",cp:[103.9526,30.7617],childNum:11},geometry:{type:"Polygon",coordinates:["@@°n°m²°ÜUšw²ŽôVš°ŽVkxÜźUŰČb‚ŽĢlaÈL„»ƒ@k„wVǂ@„ƒnÛƻșUÝ°Kl_„V°Uš`Vbn@VbÈLšaVU@ƨ»V™nIl™šUUa„±lIk±š@VnKmÅ@WaƒK¦™lVōškK™Ý@maXÇmw¯IU‚@kƒVƒwUmVIƒƒƒç—ÿƒU±ŽÅ@¯È@xƒK@wƒLUbÇKō@mÝ£@yóUóóUxkI@WlIUaƒbƒaŽVĀ™LmxÅaWƒUnVƒÝXUþÆ°UÔÈÆ@±ºƒLnVVÒkóÆ"],encodeOffsets:[[105492,31534]]}},{type:"Feature",id:"5120",properties:{name:"资阳市",cp:[104.9744,30.1575],childNum:4},geometry:{type:"Polygon",coordinates:["@@„è„„UJVn„x„U@lV°JnxWÈnbÞ@šŽlLŎ™Ušk‚¥„LXbÆ@nŽmLU‚@zlbXmlnVynL„çšJVb‚UnómUnamU„an¥lKV_²aValWô„n@nƒ‚bVœK°¯VblW@kkƒlUnlV£°W@w„UXk°KVwƒmVkwVyVI@wkmƒVÅ_Umm@Uÿmbk£™xUaVw±V¼V¤kLWxU@Uk™bƒyƒXšómƒ°V@@zÝÒkKƒn™±U@@_VVkƒÇaVwnLWalm@@kkVVl™¦kIV`±n@w„Kƒƒk²™aƒVUUV¤™nkxmUkVWVnLUbVbƒ`kUU„mLU‚mX@`ÅbǚXbWLXŽ›n"],encodeOffsets:[[106695,31062]]}},{type:"Feature",id:"5104",properties:{name:"攀枝花市",cp:[101.6895,26.7133],childNum:3},geometry:{type:"Polygon",coordinates:["@@„b‚KÞnޙ@x„V@x˜n„Unš°¼šVš±mç²ÝÆ@šwnnšVWŽnôn_@¥‚™UaVƒ„bƙœÈ܎n¥Æ±VUwVƒmXÿmLkal¯km@k›ƒ@ƒ¯bkšVxmVUkk@Ua@¯˜»Un›mс@mz™m@īƒÑX¥Ç@ݙxU¦ƒšÅŽÇUkx@šlb„UWVX„mV@xĵĖ±@@Ž¯xUšÆLnÆm„šx@nXL±lUUVwKWak@WxkbšÞƒŽĉbUn@‚ƒ@@xó¦„Ŏ"],encodeOffsets:[[103602,27816]]}},{type:"Feature",id:"5114",properties:{name:"眉山市",cp:[103.8098,30.0146],childNum:6},geometry:{type:"Polygon",coordinates:["@@„šVx°¦VanJVnš@„b„aVbkJ@XlJVwôôôV@zÞ¤@nƎÈLVa„K@x„L@w°ÇÆ@²„V˜ĀœmWXKWașÆa@_nWVnKVƒlV„_UaVamKXUWwnmmwœÑm£@ynUƒkWƒĉUkWVkkV±çkJmkKƒšƒK¯¦mnnxƒxVxVÇkUmk@ƒçķ™nmak°„LllUb@nmL@‚¯²¯aUJ@amIVaÅJn—m@mm¯L@»ƒŽ¯@ƒwUç„anlVƒWVƒÛkWç„KkwÇJk¹±V™UÅl™™ġV™²ÈƂnXĖV`Uš°a„b„£˜l„kVVn¼mVnbƒè™šÈn°š"],encodeOffsets:[[105683,30685]]}},{type:"Feature",id:"5116",properties:{name:"广安市",cp:[106.6333,30.4376],childNum:5},geometry:{type:"Polygon",coordinates:["@@„VlIV‚„kšVšĀ„Vkš°šlK™„ÈIUaVJlk²„˜y„Ln°„UW„nbVKl¥²L@blJnzW°œalV°Inô¯‚K„kšKkkƒbV™šmôLkéƒwVk@KnnšWlwn@laXL›ŽnXVW@X°a@„XKl™nw„@man™@w‚@na@„„@ƒw™ĕġġ™wUkUWb@mk@™¦ƒ¥mUÛb±yÅn@bml@kV@„ƒlknVbmVnlmš—bÇk¯bWyk@V_UamJ@I—@WaƒVXamIVWkUkbVaƒUUxƒ@VnkVU¼›bkKUxmK™„@WšƒxnV@n"],encodeOffsets:[[108518,31208]]}},{type:"Feature",id:"5106",properties:{name:"德阳市",cp:[104.48,31.1133],childNum:6},geometry:{type:"Polygon",coordinates:["@@nUW¥²é@šK„¥‚UÈÅôa@VÆLUxnKl„°V¥ÈmlÅÈV@£ƒWX¯lLln@UšƒVÅlwUm²U‚VVna@ƒ@KnbV™VwƃœI˜mXwWƒkIVwÝĕVUa™IƒèmKUzkmWnka@y™@l²kJƒ²Vb™VkšmJUšƧ¼@UV™bÇKUam@Ua™_¯VƒUk`¯LVÞǚżm܃„@Uȃx@l„ƒ¼ÇKkbWŽœšVxUbƦnxƦĊV"],encodeOffsets:[[106594,32457]]}},{type:"Feature",id:"5110",properties:{name:"内江市",cp:[104.8535,29.6136],childNum:4},geometry:{type:"Polygon",coordinates:["@@²èlUUllXĊVX„„lmV@zn¤›ÒnxmnXxlUnVlwšmU£VV„Ušbl±„„ƒL@x²mU_lJš¥UklU@ln@‚kXbmKUxÈbl„UU@`V@š²„mlLÞÑ@yU@„¯ôn‚™„W„zšaVlV@XwlKU£‚»—aVaUwm@mwUVUwkƒlVDzLlƒ„KV™m_@ykUmƒ@mU™çkKmxkIU‚Ý„@LUJ@n±„kº‚LXb™¼@mmIXa™@mamnkW™ƒKUƒƒxƒ_U`UklwUw™mUbƒV™²ƒakbƒmkn@`„UmҙšVxUb™I™`UƒaÝÈ"],encodeOffsets:[[106774,30342]]}},{type:"Feature",id:"5109",properties:{name:"遂宁市",cp:[105.5347,30.6683],childNum:4},geometry:{type:"Polygon",coordinates:["@@ÞĖUxlJX„Vb°@„xUÞmbUxƒbXbm¤VX@lk°ln@x„bÈ@lLVlVUXxlJšç²UlwV@@UÈWl™„L„w@w„V˜wXaWm²¹@»lī„¥„wƒ±šI@ƒšV@bl@kLUllUVVn@mmU„wX™ċbVb@VUkbmamšW@kƒa@™™k@ƒlaUa™@¯b@šmmwó@@lkXUa¯°›LU‚am„m@óƒkXUb±bU`kLm¦ƒbnVmbnVmô"],encodeOffsets:[[107595,31270]]}},{type:"Feature",id:"5103",properties:{name:"自贡市",cp:[104.6667,29.2786],childNum:3},geometry:{type:"Polygon",coordinates:["@@lIÞDŽbVŽš_šJVaUwš™nуV@_lm„nla„bš±„UVašnVxkxVlV_„`„wV„„LšlXnmnbš@WbnJ@nš»WaKl¹²ƒ@mVI@KރVlJnw@aW¯¯¯UmVanL°w@aƒk„mmU—xmƒULWxUUÝKōèU™KUƒƒkĉKƒL@ÆnX@x™‚Wȯ@Û»™nÇÜÝLka@b™KƒnUaVmƒ_ƒxkƒLX¦ƒJl¦ÅlVb°I@bnaUŽmlƒUV„UVƒIUŽ„Kš„„a@nml„„ƒŽnLl„našJUbV@"],encodeOffsets:[[106752,30347]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/tai_wan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"7100",properties:{name:"台湾",cp:[121.0295,23.6082],childNum:1},geometry:{type:"Polygon",coordinates:["@@\\sŽ@pS}aekgKSu™SsMß`¡CqZ·be@Q^o@‹gieMp‹‰]}•}Ľc_Kk…{™ù“A¡r‰[uom@эĥJiq©mʼnq¯Bq]ÙYgSåk_gwU­isTE…“‘ĕiqiUEkue_‰OSsZ‹aWKo¡­q“ycY£w}‹ĩ™ĕS§Z©S™N¥SyLÑ¡±Ks^IY‰PdƒY[Uo†Fp}´\\¬\\j]ˆe܍ò‹¤¡–ā a\\bn™U㺹Ìs¼j®[cíȈEŽĝĆ`ļf¶Š®K|VØDdKGpVnU‚FjpH—F`†B’[pMºxÖjbpÎxp€¬‚|ΟÜÒCŠ²®‚ÜAp„ZG~€Šd˜ÞàV¨|¸€`|Œ²tx~\\~|dFf^zG€ĄŚhœdL\\hĸž¼†ŠOªP®lV`p\\]Xpll˜æ¤œCpQ|oF}fMRi†NSon_²qämœM„NM‹\\•"],encodeOffsets:[[124853,25650]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/tian_jin_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"120225",properties:{name:"蓟县",cp:[117.4672,40.004],childNum:1},geometry:{type:"Polygon",coordinates:["@@EUDAEI@WNMNCBFAHFFNACDJDPBD@@GD@DIFFHEFGDBDEQOFG@EI_KG@OcJQM]RMEKBGPG@[LaCIICBWKCEEG@WBQHCDFD@HSLEJI@IHWECFGAAEKCGDBFCBSBIDCKKHEADMJMFABKOKEQAA@IEEG@GIQAEK@OZEESMOL“lu@SLUTYFQCMG@@SQUAYKAACA@IB@BDB@B@DC@@BGAEFAA@BEGKJCC@AGAIHA@@JC@QEIP@@A@EGIDC@O@C@@@@CJCWKABFLBBEBSQGBAAMIEM@AKBcJEN@BEBCFMAEFEF@J@BG@BFABECKFG@AFQ@@F@BEB@@A@@AAAKAE@GFGDECEFEECBKIKDELDFEDYH@EIACDCHKBEB@BAAC@ADBHABKJIAIJICEDGDCD@@A@A@DHCHJHDFEFGBKRKBGIK@GIMHSBCH_BOJECCJCFKKMD@DNJEDEGC@OJCJHRUL@HRJ@H[DCNKDZHCTFDHCFFKR`TANVDFZRDLFARB@HPAPG`ILAR@TERNDFNHDLCLDDCXDYbHF@FEB@LDDVE@JPNfXPINCVDJJD@NJPAJHLXHDNANHhB@DPNLRMTBFRBHHr@`NBFEBOCCBIAQJDHCHLHFA@HSDCRLFTB@HEFLNF@PELBDJALFLTC@EPFLLP@tUHQJDfIHGTB^JTCPDLKAIBATFPADIEGECEMJ@JIAIHGECFEAGDI\\SPOXAFCL@BQTQBBTMZECYGAHA@GJAE@HCAEME@IECFKJADDBABLTHHG@ILEAMNDJCDHEBF@@JNFJELDFKTOT@JETBFFHBHEHKI@@IJEJ@XKEOUMS@AF@CEB"],encodeOffsets:[[120575,41009]]}},{type:"Feature",id:"120114",properties:{name:"武清区",cp:[117.0621,39.4121],childNum:1},geometry:{type:"Polygon",coordinates:["@@FWôµ@IFCLIB@EHNBp]AGEAKAEDMGZKFGBGME@ILGP@HEFB@BXMEAHUGC@IHCLOD@X[NWHWPKAEF[@EKIOL@EKGBNMJ@EIEHKBIC@BAKMIACCFQZCF]DB@ERAKADIHGEIBCGIIECFaGLZO@EFCNGAGDGAKL@BMG@IE@ADSDEH[JGC@CGA@BMDeK@EIACFE@@GG@FIAMM@CCGC@EM@ADE@CFMAAGHBDKIEAJG@DOGCDEKAGIS@KFCHKAEHIE]BeKNO[IFIOELC@A]GMBKVYCDDgGAICARc@MW@AQE@DGI@@AQ@@BKBAIQQYEFW@CEADIGGBCEIiMEMF_LGEKMBBDWEBGRC@E_CHYGCH_IAED@FFBQh@FGJaJ}AHRAREF@bE\\C@CT`FHC@\\BBF@BID@HGDDJ@@FAHKBARECKDAZBJIVNHCTA@EREAMLHDAFFBVFFC@RNRETHD@FOJMACH@CAB@P@DF@@FGDWE@FFSIEMKQDYCCHKb^JADOCIDGNDBdBCFJB@EC\\A@BJEA@JAAAD@HHD@LFBCFF@BERDHNhZQHMBGHOACCEBWEGD@PSJKCGEUD@CINLFGHE@AJK@HDABBHTB@F`DBFLBBHEDARCFG@ABJBAPVFE^FBGLGCFG_BMLEXGAAFE@@JNRVJHFALFBEHQJCTbNDHCF@PlFLJSXCHFHfVBTNJ\\BPJXC^FAVNFCHFB@FFH@JF@\\ABCFD\\BDMCAAJKQBGAILOEGHILECQLWFENJHADC@QxNHFJNLDFA@CBA@D˜UÂmR@FBL@BD"],encodeOffsets:[[119959,40574]]}},{type:"Feature",id:"120115",properties:{name:"宝坻区",cp:[117.4274,39.5913],childNum:1},geometry:{type:"Polygon",coordinates:["@@TZbB@JHD@DODCLM@AP@LL@BNH@ETFN@`E@DNG@CHLBCJA@AICFKDDBKA@\\N@AFNAGRBFjFFFL@DHLBLFQPcXAZMJ]GAVHAIZJFNE@JpDRRDCLFDGXA@EFF@CFFPDfEBDB@DCHCFCJDJIJBLI@I@CB@@ADBB@FALADGDC@@H@BB@FZGFCCE@@FMLALJDAFFFEFDFCB@@AHCF@L@@BBB@BB@FC@E@@R@BEL@HEFD@G@AH@AIB@@@FEFEBALDDEFAFO^IF@JCBBFPNJJ@D@PRDCEKBAXL@BIFD@T@JE@BHHJORFDI@@B@JGH@@B@BDDLIFFHCD@D@DEE@BAAAB@DAF@B@H@NGLJLMRDNMfGIEPMI@GDAKK@KIDIJ@GE@CFDN@FE@GFEPGV@TCDFKHBBF@RW@DD@@ID@TJFKIKLI@EP@IGBCLAEKLEN@KSHIGYACSD@SEAMBBMGEBMQBCMIGKFB[D@HDLPHDBC@IFITDLG@IIIFGVBNJDLN@VIRI@YIAIHIC@CLKZCBEE@JECEIHEAKGDGECBGEEM@@DA@CCCBBEGA[GEDBBoNAAH]MKiIAWKQoIIPMFQAEEDMH@FMSUYIeF@EK@BIOEKJEBICFKaKPFAFSE@LWCCFMHDDEKESBOGBKIEIODLG@CCDEQCEDWEMDIEIB@EHGEEDAEAa@@HqDEJGF[AECCFa@WCEIKAAEQB@FCAE^YDERDDJBLNABD@AJGLJF@FNIAMLH@FPKLJ@FE\\BFOLGXMXW\\C@KPGD@JHDGVFBWN@AEAGFO@KH@JNFAHEHYLNHFCLBFBBHo^MAFGA@KJED@Jó¶EX"],encodeOffsets:[[119959,40574]]}},{type:"Feature",id:"120223",properties:{name:"静海县",cp:[116.9824,38.8312],childNum:1},geometry:{type:"Polygon",coordinates:["@@NGFMDATCNDR@CCbINEHNJA@C\\EEGVE@IhE–[˜w”epc¢·²›^QEKIEKIgiQDkehY£uSDBMkUDOJDHC@GF@CAFBFEN@C‹Q@BeP@@G@HD@@MHQKi@[IGCOCESE@GMA_OcCGDu`aˆ@VZzKDkJBLNXGDqKEWE@cFEFA@ƒISIi@@KMABJGBcMuFEzGVH\\ATSEUBeALCEMG@CEBUHUCGXaBPtUBBFIBFTDFF@DDKBFNGBJPHXDDMDCLJ^mBIHIL@LR\\@LCR[@@z@NFD@LLBNb@RHDBNTPT\\F@BJF@BXCFBHHBDLFB@HODADE@@JHVXCPDHCFTLBBFNCDCCCU@@GAABEHHZHBCAEdEjFDD@GfD@DXFCHF@ERFDLBH@"],encodeOffsets:[[119688,40010]]}},{type:"Feature",id:"120221",properties:{name:"宁河县",cp:[117.6801,39.3853],childNum:1},geometry:{type:"Polygon",coordinates:["@@BFLBFJXDb@DEFD\\BHEFIrC@Gb@FBCBFFGH@FJAJFNCXFFCRDCFDDH@CKJPJFALPHTALFCFGCENDDKXF@ETEBO‚bLELJDFALIPFAJL@@FfEZJTVENG@CNFFRBNEJOpJLRBXjJNLG^BBpMAAFC\\HHBAFDADDB@@CN@FFAHFDCHLHFBJGFCFUNKJJTD\\XUXF\\^F@DDDQXXBRLRCBDFEVCDLVDpUl@LEDJHAPRFGL@CETGPBTCDDVI@CFF@GFDCCVGLKEK[Y@MECISG@BKNSCGCKWEAaEBEKNGFSECO@GGM@GYI@DÅCMLHPTF@DJHAVVNKEGDETJ^[TJNNd@NOAMFYJ@@GFANDPEJB^aOadSTQSI@MHBDIEOKCG@EEFCKCqXO@@DMFENCDDHCCGJ]AKFoDaGGHYFDHKJiCMFGC@EQ@AEHGAC@IEAATKOHGIC@IXIFEoƒGE[JCFCDHNmRADFZMF[EEBMO{GU@AOW@@]ZeHBDEHBKEfQkuIWBs‡@EC@d[@[^EDMTKCEEcI@cDAB@FCBCACmOCG{PYHeBgPwPFDDALFFFCHQGSD@BHFAR[TaFYXMASUiGFL@DQNCJI@@D@PLDN`ETEFIGMCGBCE‘~CAIFDPEHGEQPHJADFJGHCJLB"],encodeOffsets:[[120145,40295]]}},{type:"Feature",id:"120109",properties:{name:"大港区",cp:[117.3875,38.757],childNum:1},geometry:{type:"Polygon",coordinates:["@@JFFL°_`ONJKDDFIFZN xlb~yFVNRŒrdJGzDPVFBCTNND\\UR@E`F@@Ip@IWGUoawOEE@ÏDgK{İEEMFëC—b…™@—KwOCDHHKBDJCDEEEAGHOABFABMCgDLSQ@CFEB‰MgYIDQINE@AUSwSAdYEHQMEyK[KI@GRMLE@@OqOoBOnpJ@BmEAFHL^FDB[C@BBDVFAHFJENB@sNEjQAMYsUgCSBGDJH@\\LjGR@NC@@G@HO@AfR@DŒM@EFEADBE@@HGDICCPlVANTC¤vgZlfRChjLJ"],encodeOffsets:[[120065,39771]]}},{type:"Feature",id:"120107",properties:{name:"塘沽区",cp:[117.6801,38.9987],childNum:1},geometry:{type:"Polygon",coordinates:["@@|ODHnPBDADEDA@CB@ddJFFLDNSFC\\]\\@@cFDˆ@nACOMW@M@ITURBRZNHNWRQšoO•j½f‡cqŸAqeiDÿÍyÓįFL|Ch@ÐFFxPpbHVJXo@@JCTR^BPABQA]^MB@bE@@FQBFVJRH@FXtPNZSBAja@@NƒDTŽLJrQTHFXZFB`"],encodeOffsets:[[120391,40118]]}},{type:"Feature",id:"120111",properties:{name:"西青区",cp:[117.1829,39.0022],childNum:1},geometry:{type:"Polygon",coordinates:["@@@LHAHRHATh`LHNHDG`HDGZ`D@FQDAHXFACNAFLVRTBFOfHDCVBFQH@HSXHEPFB@LDBF[bDbLFKJBFLADBDjLvCPEI]FGEIGCBEUSjcFiBIVWfaHCjN^HtwBBFGPBJGjFBEGECGDONMFAP]TDHQOWCMGAMHKIJEIGQ]aDlUG]VGEGDC„{PEbBZmE@@GH@BCA@FMQCFMYMJECELCMI_P¯`]R±œ¡¸od“f—x•\\gF@JUFFH[F@DIBGMMFaJDDQ@MCSDCBENMH"],encodeOffsets:[[119688,40010]]}},{type:"Feature",id:"120113",properties:{name:"北辰区",cp:[117.1761,39.2548],childNum:1},geometry:{type:"Polygon",coordinates:["@@ROHFFGCOJEDB’}DFHANDJHFEFSM_KC@O@CJ@DIRM@CEKKA…L…FKACHoLSJSIBETDJaEIIE]E]K[MYUYQILC@GF[MGNKEK@A@BCWECAIFEFYAGFOMI[OFuDiKACBCEKIAELaKaCE\\CA@KEAFOWGGTG@ERUACDeGEPSAUQKHE`FNjNFJADHHCJFB@DEXZFRRBJLA@AR@@BJ@CHF@BRX@@NQdDBBJhHCCZDLUNA^H@BKDPFEJ\\JMPfL^AJFFGLBDGLET@HJLBCFHDCPH@BIJFCLGABHNBDEF@BCN@@FHDDDN@BNEJH@@HF@DEJB@FfLNC@AHB@DHD\\IFGTCBCF@@JNH@ALKHBHCHBDMFEP@KYbHDEJF"],encodeOffsets:[[120139,40273]]}},{type:"Feature",id:"120110",properties:{name:"东丽区",cp:[117.4013,39.1223],childNum:1},geometry:{type:"Polygon",coordinates:["@@ZV\\N^L^FJFFJIbSCAFTJTIpKDGLB†E†KLBjHTVNBZWbE\\SBQGE@ATCRHDGEEKECBECxOhOfAZGA_YEEWSGqRKIS„C@Mb@BiTAMYsOEWG@IQEURA@EF@@acUOXQRYCUDCHDTEF[SUEgAYDcVGJM`iAWDWLQRMHUHgDsDBLHJFCFDFGHBFFVEAGHCJN@RJF‡PIhBD\\FENCPWA@LFBAFHBEJUEARCDIAEDQBRNa^"],encodeOffsets:[[120048,40134]]}},{type:"Feature",id:"120108",properties:{name:"汉沽区",cp:[117.8888,39.2191],childNum:1},geometry:{type:"Polygon",coordinates:["@@LMEI\\MTABKN@FCDMH@COAcH[AoēA™M¡Wa[Meq™pQRMXMGQYQASV@J@NNXDPmBAtJXlveRLFGACFGAYf@^X@BPV@|HNPFA\\FNEEYBCnQGMDCDE\\IHFp„EFWJ@JJDGHLPBSFB@JBDGHBFR@@FHDNEjDLICGZEHGbHpCLE^BHIDDCGDCFMNE@CP@rWLDEDFFH@"],encodeOffsets:[[120859,40235]]}},{type:"Feature",id:"120112",properties:{name:"津南区",cp:[117.3958,38.9603],childNum:1},geometry:{type:"Polygon",coordinates:["@@TLv@CNHFFBHGZFETNPhCVGNGRQXKXCjBN_HIdUZChBVF\\TFECSDGVCZDRQPWdVNA^]RBBAAOQ]DSE@F_Q@[VMCSMADUECOHycI‹qMQEU}zkaŸwENRDENB@ADG@@HF@YnaAOFƒ|CDFHUHH^kVbCR^JHIFLJNGHBDNPXGRSCO^EBMNCPDHHFAFiEIHOAEH"],encodeOffsets:[[120045,39982]]}},{type:"Feature",id:"120103",properties:{name:"河西区",cp:[117.2365,39.0804],childNum:1},geometry:{type:"Polygon",coordinates:["@@d@hZNFdcLYXKRCtCMOFSYEGHEAGEDMu@SKAAsx]GMTGt"],encodeOffsets:[[119992,40041]]}},{type:"Feature",id:"120102",properties:{name:"河东区",cp:[117.2571,39.1209],childNum:1},geometry:{type:"Polygon",coordinates:["@@ZBVFFIGABEEA@KXBDOFM[EACJgˆOIE@QIMGDBHUFEEGAEHECEDGIAKQDWLKZcdQPEP@FOFBJTJ@HNORJf@DBCN"],encodeOffsets:[[120063,40098]]}},{type:"Feature",id:"120104",properties:{name:"南开区",cp:[117.1527,39.1065],childNum:1},geometry:{type:"Polygon",coordinates:["@@NMVDCG\\E^B@HlB@YEDS@C…HsNSiMGDebUXAJEjidVTAFHDFJ"],encodeOffsets:[[119940,40093]]}},{type:"Feature",id:"120105",properties:{name:"河北区",cp:[117.2145,39.1615],childNum:1},geometry:{type:"Polygon",coordinates:["@@DBXFADB@L@LFHM\\NHED@JKZRb]QMRAFCJBDCBQYADMCAe@QIMP@GSIAIPE@E[EGH@ZEF]^HJAXK@KF"],encodeOffsets:[[119980,40125]]}},{type:"Feature",id:"120106",properties:{name:"红桥区",cp:[117.1596,39.1663],childNum:1},geometry:{type:"Polygon",coordinates:["@@J\\PNHEZBFEJELEL@BWGI^]FEkA@G]A[FDHUCMNEHJ^"],encodeOffsets:[[119942,40112]]}},{type:"Feature",id:"120101",properties:{name:"和平区",cp:[117.2008,39.1189],childNum:1},geometry:{type:"Polygon",coordinates:["@@D†T@FCHG\\FFOROMEgYc@"],encodeOffsets:[[119992,40041]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/world_geo",[],function(){return{type:"FeatureCollection",offset:{x:170,y:90},features:[{type:"Feature",id:"AFG",properties:{name:"Afghanistan"},geometry:{type:"Polygon",coordinates:["@@ࡪ͇وŐǬϠڐŶӂʮǚڦ۾njƀ̚ІɣʪҴMوǯʲĹ،˒˰Nj˖ϪԈiżŬĘͺβ̈Ҕȏĝʱʪ¡ý۷ͪ˟̊ǰώĊԼϖׂ×ࢀAƬʋӧĥяƹ७ĭࣗǭӫλȤΣĪллΛ–͑ɳ̡ߛ€ͦ։՗ɅΥԕ²ԋ͡ɿ̳þٝŋğɻسDҵӇ‡܍થΓבôǝȁԇņ࠿űටіހހåզُƚßՔ˟ڢάҢιŮɲؒ΂ਸ"],encodeOffsets:[[62680,36506]]}},{type:"Feature",id:"AGO",properties:{name:"Angola"},geometry:{type:"MultiPolygon",coordinates:[["@@ȸصʌԋȘ˕͐ѯ֊æˤŠҬşŲɀɂӨԶ®ƤіHñ̡৴RfՉǞ͕ūԑÖԫ˪̷­ৃȼüκsԴŴϦ¹ĘʹĩСƨϿů̿î́ყZᦵ֤ۋպԽ໳΁᎝Š׋Ж₭—ŵÏԃϞկ~ԉƝЙDžÿՈŜ݊̂ޒªΰ˚ݶȨΆӘռːϐĘج«ӊʣ̜ɡԚȵԎ®Ǩʶͬʭ߼ǣ֚сՐĄǎΌŔʒg̎ĸៜ["],["@@ɉėɣلͼδʪƘ̀˽̩ǯƍɍλ"]],encodeOffsets:[[[16719,-6018]],[[12736,-5820]]]}},{type:"Feature",id:"ALB",properties:{name:"Albania"},geometry:{type:"Polygon",coordinates:["@@Ń˷ŢέΒȳiə˗ŧ»˙ϷСƛÐgȂү˰ñАîֶŖʼƗƂÉˌθаÂƿɨôǴɥȪďȨ̂"],encodeOffsets:[[21085,42860]]}},{type:"Feature",id:"ARE",properties:{name:"United Arab Emirates"},geometry:{type:"Polygon",coordinates:["@@Ƭ¤ŒɱڂƂ۞uԖ{ֺ֪ظՠՎԮdž˹ŖڑѕGçճƪŝϝǑE΅ʓΏuͷǝDZᡋъ͏࡚Ț"],encodeOffsets:[[52818,24828]]}},{type:"Feature",id:"ARG",properties:{name:"Argentina"},geometry:{type:"MultiPolygon",coordinates:[["@@ߗ§ѓ̔ԑx࣑@Aሞ͒ϵрؿનԋ୲ȿϙп"],["@@Ӵ؇͠ڰॠ“ƊǷ໶ോۊŷਆاࡾ͡Ŧχࠡ౧ࡒɭ़ŷڔƈނ٢ƎݐжLjфӝiڣۻҩ֟΁ॅࠃ૭ଧȽڥɣࡹT࠷ǽȇÝիËѫ੨ܙŗ׃Հν§Ч߯ઁఛ҉။ǩउĎǰԅǣػƺщԋ̏ࡱř̪͕߱ɗŜ࠳֨ʧҠˆʢѧޛʻڭԹūࡋȣ҇ߏEڃљʋؿؙࠞߦǝ˿ݭ঳Ӄձটލͧ΅Ͽ˔ࢍ֔ӡΟ¨ީƀ᎓ŒΑӪhؾ֓Ą̃̏óࢺ٤φˈՒĭьѾܔ̬૘ěӲξDŽę̈́ϵǚˢΜϛ͈ȝॺ͸Ǣƙ਀ȠࡲɤݢԊ̨ʭࠐEޚَոo۰ӒࠎDޜɓƶϭฐԬࡺÿࠀ̜ބռ߂צԺʥ͢Ǭ˔ඔࣶд̀ࢎĹɂ۬ݺશȱ"]],encodeOffsets:[[[-67072,-56524]],[[-66524,-22605]]]}},{type:"Feature",id:"ARM",properties:{name:"Armenia"},geometry:{type:"Polygon",coordinates:["@@୞ƀǨə͌ƣǛɁ҄˽ʁˋΦɫϘƏl׋̣}΃ӢHżχCʝɤǩuͧʖرȼĄФƛ̒"],encodeOffsets:[[44629,42079]]}},{type:"Feature",id:"ATF",properties:{name:"French Southern and Antarctic Lands"},geometry:{type:"Polygon",coordinates:["@@ը˃ߐĿˆDžɽϣಇÃq҂ŮΎÊǢ"],encodeOffsets:[[70590,-49792]]}},{type:"Feature",id:"AUS",properties:{name:"Australia"},geometry:{type:"MultiPolygon",coordinates:[["@@ߺ́ҜŘپNJԎÉÐঽ˽́ēگ̉ɰ׍בǧ®ԫ€ԭܘŗֈӝܸtϬռõ"],["@@̢ڇբ̈́˦ΡЖ͟đϋǴܛŸнɄĹɬܕąѥ˖֭࣬ѭצЋ֞λŋȯӔՃࣧ͜ͲȂ;ηȴźƢࢹ׬ԩϸ͋ڀڹʀڭtӏËԳА܋µݓơϵɩݡjӕǕ׻χއثЭ̫ٱ˫гʝܧ͕нɅػʼnׁªˇӕ̇व‰ޡ·ϫ͙ԕέ۟ψԥƪżѬҝǃ݁؉ܩɪӉƄӑÔ߿ʐիԮƻْțьЭ;߱ĸˢРȯزЧ׉ݝƷѮҬŶӞ͘ЬãجہܑԿ˽͏ڛٽΊ~ҀԿ،ѹ̀ǂȘઃԚןz߯Цຓāછ̝ख़˫ߡÈࢻљܯȗljѱ̳Ϳ܉qՅõݑƶ׿ğֽԁ҃ʕœуʁЗˋؕ֛Bࢽ՜ҋDŽlӖкŘƚȒ‡̠ĺאģӼѻࡖƏӒ˜ӎͭնsʚϋͰĽڄӓڔřΪτε˳ެиʑʞ͗aјеڎă˄țʦĠӠǢȸŘрęӮΎ؀Úٕ΢׀ۀˬЦΪٜ̰ϤàɴĻڎ̺ԚĤŶȀɞüҬoࢨʖҚώɊ҆ӲѐœͲvҘט܎ΠܩΦǚ̗Ј˂ТψǻĸٖҠаȮͨцƜ`ɼτĭdɂτŦОŔبϫҲӽՂMՖÿDZҦДڪϜɘſȾκӒԘ̒јıۺǂeі؛ˢ҂Ū֎ȻҀ·ۼɋʈĐԶʵӬʊ͂ñȠNJϬеɡ͉҇ͻ˿ƒĮͱʙп̗ЭÔʁڜҫ٨ˏѠ́؈ӻʂBѰɍŶʷߤ˵ֈ˼ǐҊǠόľҤʰڞŝОÔʔīӔŌنLjǠŽˬȮѾdžҦtʈ̸̾ʂЩÎՃȾķ˜Λ̨ёÚӇ‡̥"]],encodeOffsets:[[[148888,-41771]],[[147008,-14093]]]}},{type:"Feature",id:"AUT",properties:{name:"Austria"},geometry:{type:"Polygon",coordinates:["@@Û΃ӁCǎǻ˧էLJƗܽsщȏۛÞயɐȉ̊ࠧƣĭDžԗŢѕxϝƶźȴƬʪ²ьɹŤɜݎ•׸ƮЖ}ˀǣþƜšո̠ń̒ϰز˓ӀΆ̐ÚٶʱЂªϰǁãŃČ̅"],encodeOffsets:[[17388,49279]]}},{type:"Feature",id:"AZE",properties:{name:"Azerbaijan"},geometry:{type:"MultiPolygon",coordinates:[["@@ʞɣψDGŻ΄ӡֽŒщϰƃ͆Ǫv"],["@@ϊËƞɈԈͺѴѵђ׭ϺŸʸɧۗãƣٵƟ̭̍ȝvзȽ¥ԻѲ̂дʝʚ̿×যإk׌ϗƐΥɬʂˌ҃˾ǜɂ͋ƤǧɚȶƎضʍҐ¹ŘIJбҔɔŚʀ…׀ԙ"]],encodeOffsets:[[[46083,40694]],[[48511,42210]]]}},{type:"Feature",id:"BDI",properties:{name:"Burundi"},geometry:{type:"Polygon",coordinates:["@@Á০ɃϢԜßʲӎҀŸͧǸȏT˗ȹǭ͛ѫ̧̥΍Ÿ"],encodeOffsets:[[30045,-4607]]}},{type:"Feature",id:"BEL",properties:{name:"Belgium"},geometry:{type:"Polygon",coordinates:["@@؜áުǪՐοҦȝħ֧ɕĝһܿϦћßדІϷͶϷ`ũ̒ڪǔ"],encodeOffsets:[[3395,52579]]}},{type:"Feature",id:"BEN",properties:{name:"Benin"},geometry:{type:"Polygon",coordinates:["@@ۛįȹ׆žኞǛǦЮ̇̌ʱʞņѶ̀ĨǠξЪĀȀʤˮʘ̠F٘ә˩ȎӽǓͷĘɧСԳʵʳǁՉt՗µണ"],encodeOffsets:[[2757,6410]]}},{type:"Feature",id:"BFA",properties:{name:"Burkina Faso"},geometry:{type:"Polygon",coordinates:["@@ֹɐϽ‹̍Ƀϗǰƥ˦ϙǾÅӦɮΤo˴ښۢŬּɲȴОœΚǢŘɎٴϖdžˀ޼ΒҦŢɀLJՠJáСŔϣӀչ€НॺȏmֻǿʣЩÿǟν˿ħ݁lϳâ˓ƉωÖร¡qӉŘم"],encodeOffsets:[[-2895,9874]]}},{type:"Feature",id:"BGD",properties:{name:"Bangladesh"},geometry:{type:"Polygon",coordinates:["@@i׽̉ŶÆگʉѬµєDžКΕӨޟ’ü΋˃ҳΧǠũƵʃĠ͗øŽۖ̅لƜԒԫɤȆ̪Հ̼؅Ѽ֮̔ږεВ£ô׏ߞřު^Ӟƛϯ܅ϕµʷӍҢѥƎ՞ɶFѶ೯"],encodeOffsets:[[94897,22571]]}},{type:"Feature",id:"BGR",properties:{name:"Bulgaria"},geometry:{type:"Polygon",coordinates:["@@ʎΉ͚Ö٦ſ௾«иɌবȜ̩ؒӴĕѥΏ̫׹˔ӏܣŒࡥ˃Uлޅÿס̊ڧɱة|Ñ֊сːƒŢĝĴƘˌ͌ˀСδ÷̬ȸȐ"],encodeOffsets:[[23201,45297]]}},{type:"Feature",id:"BHS",properties:{name:"The Bahamas"},geometry:{type:"MultiPolygon",coordinates:[["@@ȵ£ɇӜ̿ʐǾՔʨ‘ۣ̎Jӥ"],["@@ࣷƅÏ̴Ђäֈ{~ɕ"],["@@ƟׯƷņ`ѮϓͪCĪڐϗ"]],encodeOffsets:[[[-79395,24330]],[[-79687,27218]],[[-78848,27229]]]}},{type:"Feature",id:"BIH",properties:{name:"Bosnia and Herzegovina"},geometry:{type:"Polygon",coordinates:["@@̦FȿσМ͓ūЃȡ™ƽû˙țūҥݓ͈ͅΘ͋Ȅϭ̾ǻʺЩϾǬΒ̞ȕǼǨϾnܠƓ׈\\Ϟȅ"],encodeOffsets:[[19462,45937]]}},{type:"Feature",id:"BLR",properties:{name:"Belarus"},geometry:{type:"Polygon",coordinates:["@@߼Mࣰ̈́ȚӄېːÿϔԜƚ͖ࣘࢮɁŢȻѲĴࠒȧĊЁǷɧՄս΂Ƴ»Ʊ֦Ʃʎɡ͝ǿڳˆljÿȠ˧ȸ՝ܝ¹ʵȁÃхͭĆݷ¡əȞ̿ƥ́ŨڍjफȬࡕàٱmҡɩГeϐʷϴԌǢLͰɷ͌™ϊ"],encodeOffsets:[[24048,55207]]}},{type:"Feature",id:"BLZ",properties:{name:"Belize"},geometry:{type:"Polygon",coordinates:["@@OŮĸžƴı̞ԔDŽZHūDŽGaɭƋεôŻĕ̝ÀăīщǓɟƱǓ̅ʣ@àॆPژ"],encodeOffsets:[[-91282,18236]]}},{type:"Feature",id:"BMU",properties:{name:"Bermuda"},geometry:{type:"Polygon",coordinates:["@@OEMA]NOGNG\\Q^McMOI_OK@CQSGa@WNLVWHFLJXVFGJ`ZRTDLeeWKIHGIK@@[MQNi`]VDTBHCJAPBJLVFjT^LV\\RJZRn^RH`TfJjZHHOTTFJP_NOX[EYQQKMEJOLANJH@HQHAARF@ZEPS[U_IcRQXE@EEKKOCGGCQCOGISKYGUC"],encodeOffsets:[[-66334,33083]]}},{type:"Feature",id:"BOL",properties:{name:"Bolivia"},geometry:{type:"Polygon",coordinates:["@@य़”͟گӳ؈વȲ۫ݹ؅ŗ͡୆ҋऺˆ߾ѳ΢ŏ؆ЫֲՌ࣢αۺȖ˰ƭ̶͠рh܎¤נǸ˶ܩഠزíѠnȈʪ݀;Ѷ͂સƚęؽļ͓ãࣰ֛ݫऴƑ̻ͦ֨ǕΐʑՈTӦʟšӟǐʕZγʓa͒এྖ“ūӟĜͧҞɽȤԹƫڋɯρĄӏʿǥaʶ޳јޭ^ัʓЕ݋sҋͥ৕ƉǸ"],encodeOffsets:[[-64354,-22563]]}},{type:"Feature",id:"BRA",properties:{name:"Brazil"},geometry:{type:"Polygon",coordinates:["@@૮ନॆࠄ֠΂ۼҪjڤуӞеLJǒӜŖӼBҦ̡ƴ̿Ƌ̻œį͔ýޔƿʤ֥ɪ΃ǏࢱLjÈଜʝҴˀǦăӐɰςƬڌȣԺҝɾěͨŬӠྕ”͑ঐʔbYδǏʖ™ӠӥʠՇSΏʒ֧ǖ̼ͥळƒ࣯ݬä֜Ļ͔Ěؾષƙѵ́ܿͽȇʩџmرîӃƟϡĪÈ౨ۏӷݏv҄ͅ֏¶DzΰұԞΓݴɜƶA΢ԖʎċҔɊ̈Ôϼ०ֲێNJŔŴݴŸϚᘰpθſӔύ̬LؐӀƒǚē†͐ӯĔYՀ࿖k˦̂ɸˉǐӷǂļҨѻٸÆnjʲشȞΊƐĮΤ׸ʆ¯Ǯ܅ðśՊ’֞ϓɒǀþجŅڜȿʐȤ؀žल̮͎̾ŏʂѪšȜȗʼnσ̀ŵȖϷɷ̏ƅ܏ɌыÔϳԬϿЮ¥Ģǒˆ˜ϠƦ˚ɢҬíȲŠҚçøǢƗǘĎʐͺõЈĒӔDZξǥʺɪȊ•ŘɿДÒ͒͊ʴؤӼޒ˺¢ȺҫҼ฽҈Ƒxׅمەʾʩ๤ƁŠࡃٔր੐̟ඊԡШӱƏҫ঎ʶ࿐ѹఴŽఔ۝੸व٪ʏܖ‘̦˅˸੭Ɣԗͯ൹ёշஅୡՙोثܯȿgɻءÒ༽ɹಓęօˇͧƫ૱࡛઱ƛࢁڹηȟԋ࣯Fೕ͓סύवʗ঩ڝ܅࠯ũطƔҫƽࡓȏЧחҥट๕݉ڗ֯Ͻϥߛ։ӑɷӈψЊӟֲڇҬࡹՠ̹{ࡅٰձę"],encodeOffsets:[[-59008,-30941]]}},{type:"Feature",id:"BRN",properties:{name:"Brunei"},geometry:{type:"Polygon",coordinates:["@@ͬ̾܎Ң›Я·՛Б€ǭ˹ϥѦ"],encodeOffsets:[[116945,4635]]}},{type:"Feature",id:"BTN",properties:{name:"Bhutan"},geometry:{type:"Polygon",coordinates:["@@΂ˍÏԩۇ{ۿÈՇſޅ͊kǚ֌زҒɈ׸șѺqπɥ"],encodeOffsets:[[93898,28439]]}},{type:"Feature",id:"BWA",properties:{name:"Botswana"},geometry:{type:"Polygon",coordinates:["@@ǜƭ˄ӡॎइήĝD̑ʚՑٰŹ՚ϝ஑أݭع˩֓ʧ́ҙãƧГďʽ՝țہ¤БɾΟĸХșȵГЉʧпϑ׻đȇ̐üԠӽߚɧŲAរࠤˆ|Ჾش„ಖ͎̎΍՜ͤʮDӂȎưÙ͔ڣ"],encodeOffsets:[[26265,-18980]]}},{type:"Feature",id:"CAF",properties:{name:"Central African Republic"},geometry:{type:"Polygon",coordinates:["@@ۜÚƺɎƔgȾȏ੔͐Τ͠Ѭ̌ĉ̐ʂüߺ½߆ϴ؊ࣺю;ՐƜĪΫӜԿF΃ƋΓÄʻ̆ʍٖοҢͻT˗֠ѫΖεɆԋغͩƊˉˣęաpكĘ̹ïųȱ˕}ͧDzधнϥĎŗÝʥԕطǐؙĊ՗̴ۓ˸҉˓͛яùדգ²֩Ƙԅѻѯޱėʐ›Ϧϧ˔̳Ѡï̠ЇѮæʢċΞÞٴȬƴц࡜"],encodeOffsets:[[15647,7601]]}},{type:"Feature",id:"CAN",properties:{name:"Canada"},geometry:{type:"MultiPolygon",coordinates:[["@@؎œުxЯ΅̵Å੥Φȿˬ͆ʸ̎С"],["@@Хcઝ˂ޯІ̄î૆Ɂ࡮Η|Ʒ"],["@@хŝൡϢʥ̘ݩ̌Ưʈࡻư͕ҜðȚࢨǿԨŵ߄ė˺̃дЋ࠼΍Όҩ"],["@@։ܿո˴֠ǵ̏̉ݚɱϰȴ࠼ʵʹ؛טƞņѿʼԷΝ݉ϝ‹փǂǾیɻńইܯԅ†צЂ߫Ȳࣙ¹࿅~ŹʠԼ̐λɬ۸Ԓࢄ೾Զӎܲ̂϶™Njɫ҅Չ"],["@@@@@@@@߰äʥ॓ܶگͯDԑϪ̵ϮчʾƻτºˎЂŋ"],["@@͡ѳχîəʢ Î͖ʦΆkɈǣ"],["@@ঝҧץnǿɪزϲ଼SiǍ"],["@@ƼυјżӨɗं˽४ʽöЍؤÞ׶˥ݙ˃ಳȬҽϚ࠭ҁ஡ѣ˿Ӯଗăܴдņڌ˺ޔ؈å"],["@@ष¥ȿЪΦҼޖŜپɷXέħřձʛ"],["@@Է̍ଉʬۃğଫϘ݊ʼטζࢼʃԎƯʦDžԠ͍"],["@@G࡭૰ڄ৐եʡح߾֥࢚؈ؖܨ°ईஞÝఔūૼй¼зس҃פ҇ŃУ࿩חୡŻࢃʨʣуߵ۽ʓοই֩ளÇڏΡÇձ঍Ŀਉڻ࣭ु͙ڏ±উంƕϜ޻ϼّ୲ǔ༞εࡀ͋׺Ѕ੆ɳࢸΟ൶µࣴąƍܫʼࡋ،ळనߗ٨˚ҔࡺѭೢףѶഎЀ॒לҮהç֭֘܌৷لলࢤνݾ˫ಾגȘ෸ɫࡸć۠ɚ޴˵ਚӣʮ͙ຄÛ}۷˪ਜ਼ގſ،ӵ௖Ұߦऔ֌ϸٺݣબੳघ৙͵Յ૤Ӂݰӓംɏբˍͬ܃ټŏͶͅÖऻ؍́׽̏൯̗੏ۑ෇ƋᅛǮుPࢇÍ۱׽ੳω௉૗ॵޡ܌Ɛഘૄᄈ۪సČݔЫߍ֟ˊࣟ˜هતп൸ŨࡆीÎ؍ժ̥ਣսᇷԁ࠯ͽय؁ٓ֍܆ฤ۞഍ƒणĹջӆBନύʐ֛ƛ˧ɚٙىʱٹ̕ϡΥŽˏ¥čȹ໽A౥MϛƷࢵ؃Ŀßˍ͝ޗBࠛGϛƅƊǑøʯeďષлࡽſউ҅Ɂ@˷ƂĥŦnĔȂ̎ЂҦʘӺǙܴǵނ࢕ЂľƬūĺɳ@ǛƆ¥ȤǍēɥ€¾ĊȡĊćɚٵːڹ˪ࠑ͘߁̨ݧʃ˝Sਕɔڻʼnࠁʺ࡫Ɔו¾ʻƜƫҤ˳IE͓჏BᮝA᭯@ᡃ@ᠿ@៙@ᢡ@ࠛ@᠁@ᛷ@őF྽ࠜ׵δຽΐҳݖŤԨ੻ΨƧڴ৭؎iѠҲКwՌෙ՘࡭ॠՁ׾ޑϚ֣ΈѿѢࡇ˕ࠇҹݛւדπࠋɸࠟ|JⷎNᷲ༬ȭ೘Й࢘û݆ΖৰˀఢĹ఼τ൘Ⱦ־ΑظȠȊЄ׈ęෆݫ૦֬ŖّਔƐ͆ʖৰ·౼Λዸ̭ୄƛࠖÄଊэ஁зຶǷᗘIJܒƦࣆԋࣴьࡩΦժ˼৾žڦĎڴȩࡊҗरä๢ϛಬƄ௬oĭԺݞƦದ˵KߑՖڠڰuϞࡊ࣑԰কͺäघশ؎ૌƇࡘχଞॅݗЭ༠ǝ"],["@@нϿሎʬୠщॊіސ˟یࠛфΒ׭ࡰ݊Ŭ࠲Ƈश͹ՆࠉʼץථеະЉĝσൡã՚͓˱ູ̯Ƃฃɪঋ»ཅ˷ᒃű๻āҕІଫɮݙģਛږ֔ĚಘƜஈ›રƦྷȞᅗã஗jѷ̴ዎͲಗ[ืɚ۶ـגͮᖬԠ࡬Nj"],["@@݉ևಹך˸Ş૸’ٔȁ"],["@@öɵࢿ|ࣟjࣿőʑ¼ऍѾ˜̠ИÈነěชң"],["@@ڎԽޤڴᒆΈ෺ࢅůջဒʒߒͮሀыୄЏŊν༚Ȑ࢘՗᎐ܸͩ͹ߐ޻໯ϹጘչೲȁீޙೖÇʽכ้ঋਗά೓߲ઙĿŁӕࢪӥଜϯΌɟմࠩ́׿੕ɪᑏڨஎܣ࢔ԕƎ̉ᗱͲᅩӤ৳Ц̌ʂయќ௥Т`ʑᝡƅ܃˾ֆؤ཈dႸņ˫̜̊оચࠊɳϊ͕˾౿Рၳ˺՞ɆࢷԺ݋´ڏ˸҇ʛ຿ŅᵝȈᄫʚഹŴۥ̐࢞Ϧ஝Hˉ࡚٦ݨࡺ΄ᓪɢأի"],["@@৊ǯຄńɖʑ޷Е౜αƱݳ൝͗߳ê׉͎ᐡٮjˎ႖ĽएռসР"],["@@࣓عय़ŒԽ݆`кѮΨ࠰ɮც‡ྈȱళݟ৉Ǎ"],["@@ᕍЙѷςኹѺήΤ׌ؘܰւࠑԦᭊƀ஬ǧᒰ±ࠄʑࣖΝ੍ɃᏝןਫי@ν"],["@@ҙ͙௝Øৱɖ҂Ϛீɨܼ̬̍ˇ"],["@@ٞϵ€љϣس൱đࣗƈjӬ൝ÝÁٮࣜౌ˺ஂµÜŎ"],["@@̙͢ݠƘࢢ™ƪЩԝЋ᭗Žᑯη౩mŅ˜პϊ④ij୯Ʈପࠐ߈ɾᛄ˳๶ӻฺÛறߨޔ̪ࢄĭ˲Џ"],["@@ढ˓ကFܨˡȑ́८ȍՔȧଊ™௬ë೸ǼႊðീÏ࣒ͅȊ΍ԽɟభǷ੽ĸᜱŻႫcഫļᖁ˔̃ҦĹжࡇξ჋ĺঅʼ͂ΈႾÁ"],["@@ŗ٣٩̇޹£༝Ϋ഍ŹଗǼ@@ුؼႮծಆ[ସŬ"],["@@ϣy༽Âɡɼၜ]מƻĵĩ"],["@@༩ʋఝ˔ڼˎ௮Đஈſ˩ʥ"],["@@৽ǏඉBbŤࡴʦҌદǝ"],["@@కǥۃȚέ͂áΎજ‘ӪÅ৐̇ɫ̣"],["@@͜Ε൏Ĥ൩˘ሏŒߺʠ৫ȮÕ͐࿶ŕᗢ̫ٞЍ"],["@@০˕ଽʟ༇ك๥Óდņࣗ΄^̦ڔɢ໡Oए˨ՑϠ׌ώ׊ʲࡴÎοȖዜ¨੶҅මǵ൞ǃڒև"],["@@ᖢßᅮŅ໤ɫ™ɡᏅη᎙ǟݻȉᆬJጡԙേʃ෯ۇႿƓՙǡᡷěୈĿׇƭ۞бߙ˽ಛʃЋ͡୫ʣŞȏ෬lȳᖟԋᔧɴឿŻధĸཟªĿЖ༊Ȑб؆ԢÐᖤγ଩բഹLjڼ͘๰Ȩʄ̊஋͠ΥѠᘞ—ڒĝ಼̪ቃĬ᰽Á๣˸۩ͼগʘȁ˺దLjঘ‚࿲ƌం̺ਬ©ࣤɽٔҒૐƈບĢᢲ–Ҁĝ᝚ƚᆔÁᆒÁ"]],encodeOffsets:[[[-65192,47668]],[[-63289,50284]],[[-126474,49675]],[[-57481,51904]],[[-135895,55337]],[[-81168,63651]],[[-83863,64216]],[[-87205,67234]],[[-77686,68761]],[[-97943,70767]],[[-92720,71166]],[[-116907,74877]],[[-107008,75183]],[[-78172,74858]],[[-88639,74914]],[[-102764,75617]],[[-95433,74519]],[[-123351,73097]],[[-95859,76780]],[[-100864,78562]],[[-110808,78031]],[[-96956,78949]],[[-118987,79509]],[[-96092,79381]],[[-112831,79562]],[[-112295,80489]],[[-98130,79931]],[[-102461,80205]],[[-89108,81572]],[[-70144,85101]]]}},{type:"Feature",id:"CHE",properties:{name:"Switzerland"},geometry:{type:"Polygon",coordinates:["@@ƫŹȳϞƵіwá΅χƙةŀǻ͹ЏơƄһ˵Л¡αǶ˽ςБſ^ϠؚҾɈϤûɲƞ܎MǦǼ࣒ʱ"],encodeOffsets:[[9825,48666]]}},{type:"Feature",id:"CHL",properties:{name:"Chile"},geometry:{type:"MultiPolygon",coordinates:[["@@Bም࣒@Ԓw˧ͻܛʻЭ‚ӻä؏ʨ࢟ŨੑҸ࡫Ҏୃशۘǭ୼֗૜̟ѢϬ˘ֺޠΎװı"],["@@͢୅؆ŘĺɁ˿ࢍࣵг€ඓǫ˓ʦ͡ץԹջ߁̛ރĀ߿ԫࡹϮฏɔƵCޛӑࠍpۯٍշFޙʮࠏԉ̧ɣݡȟࡱƚ৿ͷǡȞॹϜ͇ˡΛ϶ǙĚ̓νǃĜӱ̫૗ѽܓĮыˇՑ٣υôࢹ̧̐֔ÄgؽΒө᎔őުſݝPЙȷݷ̣Ɖ޹Σoॅ˚१ג@@ਲ਼ӔˁՒʄӰх֒Ņ෤Φ߰ࢴٰౣʔߞݒ˸ඊत̏Ѯგ֝ɠʿ਻ՉŠ˂ல˺༒ϮָʍࠎéूΠ„Ԩപ׈എΤబȗ఼ʤۚĵਞӮਆưྺ˒ნˀሤÕ൘ǩ஄ќɌɦњЬֱŐ؅ѴΡ˅߽Ҍह"]],encodeOffsets:[[[-70281,-53899]],[[-69857,-22010]]]}},{type:"Feature",id:"CHN",properties:{name:"China"},geometry:{type:"MultiPolygon",coordinates:[["@@ԑഓΫۏѷ܂ĩخӶࠜڦَϨʡƣԓ","@@ܩЗۏʺyܢаϠࣾɾӚoȊ͍σσșӟ"],["@@ฬˍ঺ׯͼ߃౨Cܰͨ൸ʜѳݱ͙̭˽ः֡ࠇ৵ƪܝ̑ɜܙť঳ѕwLяթӺͯһಙαƀѹܩŒЍ˂ֽ׭ऑҋۃա୭ʑأϽࣝɭ҂ϴǭ͞ږ֠ѹѲܷ̓ॉ׏ԫթ࠙¡ѓϻѸ֩یƏ„ϕڔʕस׶ݚ͝լuƌѱஓɻϻҏࠇућיࣜҥͦࠝԞޓ֮٥_دՅɯȪ҃ӶʻŻۃɇڗҷ÷ؗࣧڹિޭোିޡୟۻृĩԣύ̃˘Ӈй୭сࢵŹ˻ࢱҭ·ə؎Ȧ͘ૻːЇƍࡍɔЏ΀ƄӜޏƶЙܑ̀҃ࠇīڡJ҉ȳѥūŶ॥҃x÷Ȣ}Ύ؝ʓεƸر͂ʔۤՏǎȧޜࢱƓĴাߔۮ”ۚ{٠νȨ˭ӶӭÙࣟŲ˴ΜϿԺ׳Ν۵ȸॷ՗އسڳĿοɦѹr׷Țґɇ֋رëڌԟǭওĈोȖڿτٵǔ˯ЖҽŦࡓոکʴΑȩଢ଼טࠛՒɽऐ׾ő‚іͭјĐۆࣙঠ൧ͼʝ٦ةϼƫʌųӎˆ͜ԛȔ˟ďɇިʈȔśȠߤЈ׈ǐࢸő͆՜ંIJͮ̚೜ҔŠȐãӐּɔݱฦဘͲјȈ؆ຒဠˡҲϞ¢ࡆۦĀٖ֔͢èɚו۸ѽப̿׆ڱ͕ঙ̢ηূƝଆŝ৪ԻԲġϤޟӲӿऒnჄȉ૤Ŝࠦůఔԛ৮BόʽঐҌബ̈ాŒঘ̒׾҈ך˰Ƌˤˍ͔ѴըӀùࡺǝ࠸Ѿ౲͚؞֊נʆ௠ŐڐĥĠ̘ݿזګː٥̳ࠣžӇŃɏΆר࠾Цو৚̓ஆՎQτݸࢾҲːWҪңȦۜмਰƲ૜vసʡ݈̱԰ࡏ̀α̊ԩ̶ࠕ"]],encodeOffsets:[[[124701,24980],[112988,19127]],[[130722,50955]]]}},{type:"Feature",id:"CIV",properties:{name:"Ivory Coast"},geometry:{type:"Polygon",coordinates:["@@ϣUוǒ՟Wহƥ׍ʍ̯ࠫNjvÞۖĄŀ}ͨΣΚˉÈʕɲǾώčО ʔƄB¸ξÝnjĄŜ̸ĶȹڨȗΎæ˸ǘÞŊúɸųٮOƸʖƢgʎĦžΫȞłΌŰϚǽƦ˥Ϙǯ̎ɄϾŒֺɏɠ஡Ο۷ɕेθܣ›ͧ"],encodeOffsets:[[-2924,5115]]}},{type:"Feature",id:"CMR",properties:{name:"Cameroon"},geometry:{type:"Polygon",coordinates:["@@Ľ°ӻŇԝŒЋÅ൅nŬڒ͟֊ϧƚǟϖɋŦXɶɎתЎ߸ʒRԄӮ͈bҾΉ־˲ĀΔȌͺžь҆ΊǞךDzȊŢѨɜ՚۾ٲ¬˨ĠƲͫͰ‚ˌʂ¶ͮ՟Ê֏‹֏ҜޅҷTʁÏϥČǻЅӸөμƛŠΏˆ׃ſɩх࡛ȫƳÝٳČΝåʡЈѭð̴̟џϨ˓œϥĘʏÓґڛȤڷɜ੗"],encodeOffsets:[[13390,2322]]}},{type:"Feature",id:"COD",properties:{name:"Democratic Republic of the Congo"},geometry:{type:"Polygon",coordinates:["@@»ঙͶŕˑ̗͓ɟ͍ѫǯϷ±ګț͍Oهʍɹ‹ԃŗÝýҟɄϡÂ৥ưޝċѧǘӣӤҹҒ੕ͥĒ૿ƙɣĵʇՙȊχƫষĻࡇɨƫט͝ɲƴìٟࣟR·Ҧ̳ΨٟŠȋѰԣ˅ڧŞ˫ϢՕüϽqµʾ́rϥºԳųιtȻû®ৄ˩̸ÕԬŬԒǝ͖eՊ৳Qò̢ѕG­ƣԵɁӧűȿҫŠˣş։å͏Ѱȗ˖ʋԌȷض៛\\̍ķʑh΋œşʼɊʀμƎɎ̪ǰɚđ˼͐ҜSÄʃ̼ƩӶՄӨШɆːƒ۔θࠆϬўքМĪˌt̰Ǝ̆«ӊŀݖǐԾʦ҈¸Ԕúה͜ѐҊ˔۔˷՘ؚ̳ĉظǏʦԖŘÞϦčनоͨDZ˖~ŴȲ̺ðلėբoˤĚԘۙϘķɤƖϲÅҶDzȦΫ݊֏"],encodeOffsets:[[31574,3594]]}},{type:"Feature",id:"COG",properties:{name:"Republic of the Congo"},geometry:{type:"Polygon",coordinates:["@@̿˾ʩƗͻγۏࢸٖҪ̓֌˾ɂ֦ĺäό҆Зݐ•ʴЈł֒ĝڀЉӺζ঄ȽǘسçɻѢÔξ੘ڸɛڜȣÔҒѰ޲ԆѼ֪Ɨդ±·ԓʥ҇ǏԽĿݕ¬Ӊƍ̅s̯ĩˋփЛϫѝηࠅ„ۓɅˏӧЧӵՃ̻ƪÃʄқT˻͏əĒ"],encodeOffsets:[[13308,-4895]]}},{type:"Feature",id:"COL",properties:{name:"Colombia"},geometry:{type:"Polygon",coordinates:["@@ΫȤЭ˨ʅƅ܉Ŝȱΰƽ_࠿Ӓŕʺ̼ڛтȢ̦иÊΞՆ͐Ѵ̳ȦDŽӦȏސǸɚƃ܄ͻ҄ņТ˔ÑǂʠțӶĺŬѢـהΌĚT˦ƺ܂ӖϸՊfäǪڂéڌъ͞ȊОК̖»ɚɛǍ˱գƕɇп͗ʋʓ̷Ĺ׵ɷӭѢÇņϭȄȁâ͹ij̵ˆǫȸéȨ̉ઊĄӦŃעܡͼĚ؂­ӐĪ̔ƟƱҍȇ˯ß׻ǜ֑ʆʟ†ȉэл̨ȃɠ̋ʰ࠹ǁĻǏӸɷˊ˥́࿕lZԿӰē…͏ǙĔҿƑK؏ώ̫ƀӓoηϙᘯп҂ʣpժࡤٟϾԍị̈ƤҧɝصŀӵࢤϳɐˍІ֑Њɡā"],encodeOffsets:[[-77182,-155]]}},{type:"Feature",id:"CRI",properties:{name:"Costa Rica"},geometry:{type:"Polygon",coordinates:["@@җȆǟǮĬƤ‰ȄɷȪͥǔ́ņÅʖəƮÄʑǗȩȓɸˑĊŗǞLʮŎˆʁŠȖnjŴňֆɝȖŊˊéƔǥʜÇȪDzɈҙ͖ͷЂΩ͗õLͷǪűűıƱëǟ©Ǖ"],encodeOffsets:[[-84956,8423]]}},{type:"Feature",id:"CUB",properties:{name:"Cuba"},geometry:{type:"Polygon",coordinates:["@@ܨÑڊW߄˹̭ͮ޺Ĩ̔ȡ܈ԳԺϛˢ\\ԆǟÕʁئ“ٌ΅ıȟ֑Ń֡¥׃âளą֜Ҷ΁ɔէÈ̃ʐȥӎӃ޵ɦʥǬભž̋ǐ̀ɀࠗ¨׿ѧΏ[ťȳеğΫĂѺʸǼ̤ϞȈіǎَĄȰĢ"],encodeOffsets:[[-84242,23746]]}},{type:"Feature",id:"-99",properties:{name:"Northern Cyprus"},geometry:{type:"Polygon",coordinates:["@@ÐJŨȮ؄Yކʢ֧ΧÔƿęˆLJÙűj¥iĎѾNjVɫïƿ¬"],encodeOffsets:[[33518,35984]]}},{type:"Feature",id:"CYP",properties:{name:"Cyprus"},geometry:{type:"Polygon",coordinates:["@@€ãࡱͿЩŊȟͶЎŒǀ«ɬðnjUÒ½j覎ŲiLjÚ̇"],encodeOffsets:[[34789,35900]]}},{type:"Feature",id:"CZE",properties:{name:"Czech Republic"},geometry:{type:"Polygon",coordinates:["@@ϯǂЁ©ٵʲ̏Ùҿ΅ر˔ӃΰѕȬėΠƧʠؒǾ̸Ⱦ׾ǎɂdžɜīϒĖЊ˓ؼñ¿ɳҘǧŲɒּĥĄʿز»ϮЯʡCŽƯȕ—ÅȑLJ¡wý˹ēϋbšȁ"],encodeOffsets:[[17368,49764]]}},{type:"Feature",id:"DEU",properties:{name:"Germany"},geometry:{type:"Polygon",coordinates:["@@d͗ࡔțS̗ࡢǂҾɰॊͧІˋȞёɹɣ̨̙Ⱥ҅ß́Έ՛ϑĕɛĬɁDž׽Ǎ̷ȽؑǽƨʟĘΟіȫӄί̑ϯ̟ŃŢշýƛʿǤЕ~׷ƭݍ–ţɛыɺʩ±࣑ʲǥǻ܍Nń״ьֺ௅ƸЇɘ´ςǗȐĨ֨ƗࢢԎ@Ɉ͂Ⱦޔƿ˴ǐDz۰°Ƽȃ֮вȓ̀ӈٌōՠŸ"],encodeOffsets:[[10161,56303]]}},{type:"Feature",id:"DJI",properties:{name:"Djibouti"},geometry:{type:"Polygon",coordinates:["@@ȤʹΑӏȩήɯ̱҇ȅƬȭÏҷb_ʮßɶ˴Ѐ̐ϊήñʪȴ"],encodeOffsets:[[44116,13005]]}},{type:"Feature",id:"DNK",properties:{name:"Denmark"},geometry:{type:"MultiPolygon",coordinates:[["@@ԋڹ࢟ӄŝΒ௼˨ˎу"],["@@ȵ̓ʡĞ؁؁ɮХ՟ŷًŎͽҲ}࡬Ɣɪʌʦ݌À̐ɴڮʂƒѝʟ˙ĶɽҘŵ"]],encodeOffsets:[[[12995,56945]],[[11175,57814]]]}},{type:"Feature",id:"DOM",properties:{name:"Dominican Republic"},geometry:{type:"Polygon",coordinates:["@@ŀƞپIӾɏɜtƴ̕Ҡhʡϐ‰Ю̷̯ͿЍǼϫ•ˡ¢ƱƵ͑½ŷȲˣťͳֻɏƆ§ʎjɬɍʦȲƚÞ͒óҜ"],encodeOffsets:[[-73433,20188]]}},{type:"Feature",id:"DZA",properties:{name:"Algeria"},geometry:{type:"Polygon",coordinates:["@@ᮩཽᝩ࿷இϑटćU՘ϵƌԹʊȧЀᬻᆴᬻᆴṕᎠfnj@ÊQ঺ബب࠼Ÿێɦ͎тচͪ˜جӢòϞ̶સƚƸ͜ɛDz̃ࢲ¹Ԟ́ՠ߰ҠࣦƢՌΎ߶ʰ෎Ƭർæшůߊͨ࣌P΀ȝֺ¾ǟћƄߟȡۙԭҵôمۊԃRȯԮ͹Ϊຝ˖ݏ°ϵƧۇÔϥŃҟòՇͫΗӺؓŽέ̘ҵϼƸڒϷςՃ"],encodeOffsets:[[12288,24035]]}},{type:"Feature",id:"ECU",properties:{name:"Ecuador"},geometry:{type:"Polygon",coordinates:["@@҂غǻξ͍ϵԉςǞʀƙބ̎ŴƺԼ͆զÍ΄ҢǸ׀Ͱࡀӑƾ`Ȳί܊śʆƆЮ˧άȣŞٓʽճࣷ࢟য়ͧԥܵǃ֣Ӆ΋ΙъͻĞ΍áw̮ʈȨıΔ"],encodeOffsets:[[-82229,-3486]]}},{type:"Feature",id:"EGY",properties:{name:"Egypt"},geometry:{type:"Polygon",coordinates:["@@ɽͷǹىɫѩȝƥ˩˔ϛϒ׵ஸđùΐࢯԪࡋٌವ̴ҙ˒ӃݮछǗƣ‚ճ঒ݭƨǣΏ@Ὁ@⁩@@ᶶ@Ჴʥڲɐ԰Żά̤Ж૦b߲ɝ࠲ʛϴſ٨ˊΌʊݎêװŃɮеȜ˜ڨȣټ³аɄւ෽"],encodeOffsets:[[35761,30210]]}},{type:"Feature",id:"ERI",properties:{name:"Eritrea"},geometry:{type:"Polygon",coordinates:["@@˻˖ΉӰϋ˒ɏܷ̄ͶֻXȭǬӯȡԛϢʽط঑ǬęʹβఀĊ֒ˆʴؤƐьӒӦঃɴޗҢУବߏҲӍҖӝˀ˿аʧʩȳέò"],encodeOffsets:[[43368,12844]]}},{type:"Feature",id:"ESP",properties:{name:"Spain"},geometry:{type:"Polygon",coordinates:["@@¦״΃θஒ؆ਊƱ૾NࣂƝۦªമƒͰ͛໺ϡ̨ǺीϝআŊ®ӥߓ֓ઁǯõ˱ԩү͕ہ͞ӑӟϑǹճىǗש٥੧_ߟhՃ͍̓ͅЩê̵˴ʃӚ޷žé˦̶̀Śɬ̃ʢɶրͳԌδè’ЈƎŬZپϲɪɻфөˆƝŁӹCɁЬ΃ū̥ɇ"],encodeOffsets:[[-9251,42886]]}},{type:"Feature",id:"EST",properties:{name:"Estonia"},geometry:{type:"Polygon",coordinates:["@@ĮӸ̱ŁՓ̘ñӘਫ਼ɼ੔Ũ࣮Ƒࢂ|Ŵƣׯӝʞ޵ΫˉۙDܡ̸ρļ܏Ʃ"],encodeOffsets:[[24897,59181]]}},{type:"Feature",id:"ETH",properties:{name:"Ethiopia"},geometry:{type:"Polygon",coordinates:["@@ԜϡӰȢȮǫּWܸ͵ɐ̃όˑΊӯ˼˕̏ω˳Ͽàɵ`ʭҸaȮÐȆƫǽ̴̕ҧ̴Й̛͎ᩨঽۺNᛛᡃફ™ݟףաeɯ˅ַB͹˴ލΙʝΓ֕àȃĬȟwˇT੟܌ב@˹ˢ@ҾѧƘӻࣴϥȚƧʹэЦԧÒ˸ӐҀrŲʰ[ݲʞࢠЊɾĎ΄ήٜԔи΀ࠠƆܠ঒ǫʾظ"],encodeOffsets:[[38816,15319]]}},{type:"Feature",id:"FIN",properties:{name:"Finland"},geometry:{type:"Polygon",coordinates:["@@ūיಀ֓ޡى঎ख़֡ܛݴس΅յఘֻ́ѓޭӟᅡੵໃá๑̯ൃǯӡҞ߿ˠȈࠢСݶАӪނՆ኎࣮֖Ǭē΢ୟЈ˳͜uಒ಻ֲ૩ЪԊɞतѻલ¦ࣘȭߠϊЬ؞ಬ˶઄ͯΡכ"],encodeOffsets:[[29279,70723]]}},{type:"Feature",id:"FJI",properties:{name:"Fiji"},geometry:{type:"MultiPolygon",coordinates:[["@@̂ʍƓѭԳŗҩļąτ͖̀ϤĻȼƐ"],["@@՛ǯŅ̼оǤˊ°Ӱˀ@ЧՕȷ"],["@@é­@ШǨžĽЗ"]],encodeOffsets:[[[182655,-17756]],[[183669,-17204]],[[-184235,-16897]]]}},{type:"Feature",id:"FLK",properties:{name:"Falkland Islands"},geometry:{type:"Polygon",coordinates:["@@৘Ԍ܎ȿԌʹڦϙʥ̋ଋʥϙ̌܋ϙпϚ"],encodeOffsets:[[-62668,-53094]]}},{type:"Feature",id:"FRA",properties:{name:"France"},geometry:{type:"MultiPolygon",coordinates:[["@@ˣ٭ϡǠș֢ǜ̺ը͎Ɯܛ"],["@@הЅќà݀ϥȊñʎjЈɗெƷыֹŃ׳ɱƝϣü‚ɇؙҽ]ϟВƀ˾ρ“ʁʚ̿̅ʯɐٱҖŃĩηݿӅစɬ௧˗ĩԑঅʼnिϞ̧ǹ໹Ϣͯ͜ѢԎdžူࢁࢤإю౹͒čؖઠǾථɏˇॎߌέዠپʨێܾǞŪ̑ϸ_ϸ͵"]],encodeOffsets:[[[9790,43165]],[[3675,51589]]]}},{type:"Feature",id:"GAB",properties:{name:"Gabon"},geometry:{type:"Polygon",coordinates:["@@ࡹࡔ։ۚԙࢄ‚˨ǾˎȲؔǜخ˴¶௢SOৠЌÆԞőӼňľ¯ÓνɼѡشèȾǗεঃЊӹĞٿŁ֑ʳЇݏ–҅Иãϋ֥Ĺ˽Ɂ̈́֋ٕҩ"],encodeOffsets:[[11361,-4074]]}},{type:"Feature",id:"GBR",properties:{name:"United Kingdom"},geometry:{type:"MultiPolygon",coordinates:[["@@҉ֽًǦԱ[ǦҊǥ҈۴–ࣔԳ"],["@@࣋ࣧࡦŘऄIɕۅݯݩࢄÃäĕݠ঱ֺƇԬढ़ʈͧৰDžķ՝ѓʗͲѣݱѯ૳Rෝɱϻǒ։ϿޥĪם͍ҁǘ௼ࢨݪǺOBಽƔʃͰ࢜ʺҡҐdžռఢ÷D@ŮӤ֛Ԯ_\\৵ƨȧɬ̨ϒˡɴҍЇ·߶щє̨ࢆٶھڤá০ì"]],encodeOffsets:[[[-5797,55864]],[[-3077,60043]]]}},{type:"Feature",id:"GEO",properties:{name:"Georgia"},geometry:{type:"Polygon",coordinates:["@@Ųάȿִӟ̲ҭĬ̯ʴĺIJ܄ƝఆƋଦЕƦƻԚƂ޶ǭʴ·Նșɓřвғŗıҏºصʎȵƍଢ଼ſ߳Юࣅ¡"],encodeOffsets:[[42552,42533]]}},{type:"Feature",id:"GHA",properties:{name:"Ghana"},geometry:{type:"Polygon",coordinates:["@@೉ӯҳ˽ݳʑݡʆœͨηܤɖैΠ۸ɟ஢ŗنrӊฤ¢ϊÕ˔ƊϴáÕʿΖџC؍Ąڍɂ̫ȅݳäйɢՓȈ̍"],encodeOffsets:[[1086,6072]]}},{type:"Feature",id:"GIN",properties:{name:"Guinea"},geometry:{type:"Polygon",coordinates:["@@ʃtǡͷʁJǏǴÈͶΗԨɕħǵmɳ³V̮Ƈɘ‚ʔǻΜɹ̜ڥDțǁɵoƝǷīɹ҅σρӼ͛͢ɋŊȿǖħϊūȂʓƐώЦʮeɖƘȄDƄŎï˨ĢĖd˶МU؀ȱȄlÚĤҜáŨ´¶̭ƆBɖŒƔƒɸɇάãɲǺ˖ŒȬŠǚuȈȁĴɳΆΙǣɏ˙ǴĊŀį«ʡʲʍǗÝå˷Ș΍Ⱥڧ̷ĵăśÞNj·νƃA"],encodeOffsets:[[-8641,7871]]}},{type:"Feature",id:"GMB",properties:{name:"Gambia"},geometry:{type:"Polygon",coordinates:["@@ņόࣶzȎȦˊ`ͨȷʼIˢƚǞʏεȋιdέǰ̷ȗƭQȫŝއl"],encodeOffsets:[[-17245,13468]]}},{type:"Feature",id:"GNB",properties:{name:"Guinea Bissau"},geometry:{type:"Polygon",coordinates:["@@҅ΘΝÈȕʀLŸʯǴÁǶѼƌ˦ɦĨ༈•c˵ġĕð˧ƃōȃCɕƗʭfύХ"],encodeOffsets:[[-15493,11306]]}},{type:"Feature",id:"GNQ",properties:{name:"Equatorial Guinea"},geometry:{type:"Polygon",coordinates:["@@ƿŴ़̀െmPয়௡T˳µ"],encodeOffsets:[[9721,1035]]}},{type:"Feature",id:"GRC",properties:{name:"Greece"},geometry:{type:"MultiPolygon",coordinates:[["@@Ҡ˱ٺ¶شÑqƣҜĶĿʛ௃íTƒਁǎƺΦ"],["@@ʹՁȥĥԟ|ѫĀৱɓ׌ҿяƋҳAѻўƿȁȊԅрЁ̓ǿҴϯжʑ^ӅޥɠʜѕՓĕ͈ݏ֏Yۍμ̿ڦƧ֒͝ϮљӐÉʆϸТ¼˚˘Ũjɚռö͌ȀҖgƒƦdž„ت{ڨɲע̉ކĀVмЦɝ"]],encodeOffsets:[[[24269,36562]],[[27243,42560]]]}},{type:"Feature",id:"GRL",properties:{name:"Greenland"},geometry:{type:"Polygon",coordinates:["@@ᬜԆ᱒›ੴ̴ᲈĄ䀦Ŀ㉊ڗ༅͕ộ™⭏ćшƫᲐĠᡚ́࿈ʴۦ̝इӧᒞ̺✘͚ᠼNjҾΫ⃝ױӃȕ᧑ơወ¡ছؕگկ€ध৚շಽ“൧ˇ༂ѽȢ܋࣍ýઞܡህÑঈ΁˟̑இŽ୥E੆֩\\Ϗပΐћɣଌȿ઼ԣ͈ڱກlj٫͖ਣӘ˼֭উѵᕖ•୆¯ᖯܵᗿڏឧ́ओIࢅ͓ୟࢱᅵכׅ“૧ȷ஽ȝܛԱ[כыտോڧͺٿϗ۝љࠍஅ½఍ۈဿLࠁҢ֕ࠐฝਲэոŗݮ୓ޢ̢ئ֗̒ࠪচొ̺ͨΘǬڀॡ̕қůݯţਏ˜Éְ͢҂ެ\\႔ɟ෿Քݩ˾࠷ş۫ȼम޴ԝ̺ڗ׈ৡࢼ੯͚XΚᖷӮᄻÖᖟ‘Ꮕ×ইˌวՈᕂ˄ၚ¬≹ɖ቉΄Ś͜ẊИᶎИ̪͘ᗗ̠ܺͰ᯲ז௢ĚΓϘጲɜᣚƂᣖRࣺʽᕺҨፘ̽୺áპ˙ፅҐŘή"],encodeOffsets:[[-47886,84612]]}},{type:"Feature",id:"GTM",properties:{name:"Guatemala"},geometry:{type:"Polygon",coordinates:["@@ћƦԻfϩǖҍΌrʖĮȠšƾКۆ઄Ft˸Ƌ¾ġǺ̵Ț̹ˬϜDBӂ޸BަUOڗßॅʤ@˚ƱòŰʘŃϥ͍ЉɻÏljâǑǧɇȟ½¬ıƿġ˽Ƀ}ŭ"],encodeOffsets:[[-92257,14065]]}},{type:"Feature",id:"GUF",properties:{name:"French Guiana"},geometry:{type:"Polygon",coordinates:["@@͉͑ГÑŗʀȉ–ʹɩνǦɈΪòϤƢή͛ӸáֺѪܠ˸ğؤȥࢸۿƔ·ӻޑʳأ"],encodeOffsets:[[-53817,2565]]}},{type:"Feature",id:"GUY",properties:{name:"Guyana"},geometry:{type:"Polygon",coordinates:["@@ր̯Դյzџ̈́o҈Чͪ̇Ƈݱԛɕ°ȣƹџϊ؏ːAŎӃԢܳȱ‰ҫî˙ɡϟƥ˅—ġǑЭ¦ԫЀÓϴɋьƆܐɸ̐ȕϸ˿ŶŊτțȘѩ™ْ֩ɬɲiϲԬƊȾƾ˽̸ô̬ږӲ"],encodeOffsets:[[-61192,8568]]}},{type:"Feature",id:"HND",properties:{name:"Honduras"},geometry:{type:"Polygon",coordinates:["@@ơˀʭòÐʹŗĞǣÒσij‹ŔʩƈǷǚʛìǨɈáǒÐNJЊɼϦ͎ĔȂƨʊ\\þ垦ϸùϲv˒ĢİĦˎ©ȪÉɘnǖòϨśƄkʲƿʐį̏Źɜɳ˽jśŕ̇ŋɃAȅŃǙœƛźĕ{ŇȩăRaǥ̉ɳƹıđĽʛǞǹɣǫPȟqlЭūQĿȓʽ“"],encodeOffsets:[[-89412,13297]]}},{type:"Feature",id:"HRV",properties:{name:"Croatia"},geometry:{type:"Polygon",coordinates:["@@Ȳ͗ˊʇ͓̓ϝȆׇ[ܟƔϽmǻǧ̝ȖǫΑЪϽǼʹϮ̽͌ȃ͆Ηݔ͇ġƛ߃̶ӣ̢ޑʠ۹ؤǞØϥΞe˲եƄʱγʝˮn̆Šbג…Ƹƚ˸ƍͤgGɼ̈ĒĈͺڞɠˊĻؼέۜlj̼Ų"],encodeOffsets:[[19282,47011]]}},{type:"Feature",id:"HTI",properties:{name:"Haiti"},geometry:{type:"Polygon",coordinates:["@@Ԣ™ܰƁôқÝ͑ȱƙɎʥiɫ֏ƜЅÍԡÔϽƿ҉ʾö˔ޜśيã̢ȈϧθP͎ՋžȌɶ"],encodeOffsets:[[-74946,20394]]}},{type:"Feature",id:"HUN",properties:{name:"Hungary"},geometry:{type:"Polygon",coordinates:["@@˨ըǍǼӂDÜ΄ђɋ̲ğ۸ļäǚͮ~ЦžĜÃЂŀȠȢˠ¼࣒ʭǴĒҲɭÎɣԡǭЉ֫ԕ֭کǁԽš١ə̻űۛNJػήˉļǍ˴ƗV"],encodeOffsets:[[16592,47977]]}},{type:"Feature",id:"IDN",properties:{name:"Indonesia"},geometry:{type:"MultiPolygon",coordinates:[["@@Λe૝ך޴ǒѴʭ̎ʭ»ɩ"],["@@ܙȁijĶø˸ΰԢࠨͬĐǓfʫշع"],["@@̢ɣԲèȼΥॿǛ׉őҍP̀ӚҤPɤ̖"],["@@ūұ౅ʅૣľE̬ښǪՂʥ֔Üݬ̮"],["@@ྔċȂΌ༘З̪կీƵਐӿय़͋ऍ͸ݻwࢍØ޻ưঅ͎؝ČΓŁ໕ΌƣΰޑØּߤ৶·ڴ͡ΒÛŘ̗"],["@@ѝֱćنƬ̠Ǭ˴ȒʗCЏ"],["@@̿˥ׅƸǏΰࡘ¢Ⱦˣ"],["@@̨ٝۿΌۯìӃÅׇˆȦҦਠ”ऎʕ"],["@@ɼയ࢈ԉ۰ࢼ८ԔݜBܘ̉خ̛ࣘLJbᩑbᩑݟې࡟ǜȷʇ੡}ΦۂՈɺɕࣲЕ۸࿃܆ۗêృަʛУ͑óȏ̮GκٛЮ̢ࣞ״gëɠ௵DͩԄݥƺΡдଈȰњ˜ഘ·Ƃ̹"],["@@ڭ࠭كlj߱ǐඓ¥ܽŧţٍݪݛҒϠ༪˸çϯλŪιӯ͙݉ߒ੿Ƶ˿ݲॻQտ҅ʙ̐͡Мی࠙͗ȻɶŊ͖؅ӲØࠌ֕ʭîও”றՓũίʚʌޜŽ߸ΛPʻֺΎվŤښф౎ǮΎ܎ذپʛ੖śॴ–ࠨ؎Ʀȉ"],["@@©ܽџĈŷԝΌѷɽĵ͹Ւʟ੺ǚڤ˨̨ÔҝӸóĀ΃"],["@@सާহį˫ֵšݿַ߱u࠷͕౻ŭ̚ॕϙͫԤ׳´лːৃ̟̩Оս¯ۗĬŹૺнɺЕܘŝ݀ĮުԂ֐Ɩָ֗ӅըǠ՜ÑӪъЖôߒɽۆǶњୠ͔̈̆क़ॲ@ܰƙӍݷآߓơϭ"],["@@छkۻ۰અۊέԚٍۄзؾٕ୴۪݅ʙܠ̳ڀݵՊѭܘمҺࢗऒóђզ‘ಢNjݔࠓٮ֫ҪΓߔࣙࡢ_ۺֹӠ۳٘ϥͳۉӖ̞̅sƜו̊ҵؠõФՏɁ਱‘ಟ"]],encodeOffsets:[[[123613,-10485]],[[127423,-10383]],[[120730,-8289]],[[125854,-8288]],[[111231,-6940]],[[137959,-6363]],[[130304,-3542]],[[133603,-3168]],[[137363,-1179]],[[128247,1454]],[[131777,1160]],[[120705,1872]],[[108358,-5992]]]}},{type:"Feature",id:"IND",properties:{name:"India"},geometry:{type:"Polygon",coordinates:["@@ࣚটďۅͮїѕ׽ŒɾएࠜՑ୞חՑϟ͛޻ࠀͅߊЭરһସʼnӜёٮāৠȝ۪bĪͪŋՖÞβԠǮìڋlǙކ͉Ոƀ܀Çۈ|ÐԪ΁ˎڴŀވشॸ՘۶ȷ״ΞЀԹ˳Λ࣠űÜ͇̍Ʒèԫ׷Ʋછׅ~ӓҩ۵§ХϏۗځȒࢇȏ˹ĚΣгȥѵ೰ɵEƍ՝ҡѦʸӎϖ¶ϰ܆ӝƜީ]ߝŚóאБ¤ڕζ֭̓؆ѻԿ̻ȅ̩Ԭɣƛԑ̆كžەţֱ̫Zਛǩ´ك҃ӻ௃֡ळ঩كՋ࠷ջCϭлȹݳ̝Ͻ«ʥٙǪધ®ۡΣߙI෗ѣ¡ϣٙʰˣދʃ˱֯͵ʍߑ޸ϳ୴͑ࡒ̍Јѿ߰ȻੂơՀޅ଼Α࿀ʣ੾HৰǍ޾௣ԉףĶ઱৲И̤ʝͤড܊֖֔ᇜCǗܞҽюĩ٨ջϘऒࢢঊÙ࢞ࢢՄ࡞ࠄࡈ_״ܒӠڳд֪݂̇̕Ьβ౤ȱपŰߺ۸"],encodeOffsets:[[79706,36346]]}},{type:"Feature",id:"IRL",properties:{name:"Ireland"},geometry:{type:"Polygon",coordinates:["@@ƒ׷ًݣ๯ӹ஑Ŷڼ࢚ѭࡢତڄٌϼǦ҇ǥ҉Բ\\ٌǥ"],encodeOffsets:[[-6346,55161]]}},{type:"Feature",id:"IRN",properties:{name:"Iran"},geometry:{type:"Polygon",coordinates:["@@݈njװӔ֚{τƾװýघэڤğ।ݓظ‰òۻ΁਷ɱؑκŭΫҡˠڡàՓِƙæեݿݿжѵ͸ԓߦυx݉ДƋêϯ௉ѡ̓উཌྷʪࣷȖेŊΧਐЕƪ٣ƭࡑНਇ˦ࡑ٦߳ʈ֗ߘا૪ҍƋՕ˦̻͝ҭѴS҂ˍ@Ɛ،ѝٔ਍Ң׉ߜȜپц̂ÙӬտʨխ৊ҟڨǐʼʿ६ּʈƄͅъϯ־ő̤~রئ̀Øʞʙ́гԼѱȾ¦ˈإߖǩ׎у஠ƟಾɞĄȞ"],encodeOffsets:[[55216,38092]]}},{type:"Feature",id:"IRQ",properties:{name:"Iraq"},geometry:{type:"Polygon",coordinates:["@@րʧÚӫх́țٽ׊ߛ਎ҡўٓƏ؋ˎ@TҁҮѳӿ¤֟ê؝߭༟äᛍၖఫךৡɪ͹৾ᇶ࢔͆৬āؘҢȺјԾΰž঎Ň̐ɉЖƚծ৉"],encodeOffsets:[[46511,36842]]}},{type:"Feature",id:"ISL",properties:{name:"Iceland"},geometry:{type:"Polygon",coordinates:["@@șիॊֵથٙᝓֹܣƵૉŮᚑˈࠠψᆧЪ๪ǎ—ʘᄋȜ֨նౠŰಸ֭౨Ҝ੒ʃൌ҄ආÑ"],encodeOffsets:[[-14856,68051]]}},{type:"Feature",id:"ISR",properties:{name:"Israel"},geometry:{type:"Polygon",coordinates:["@@ƥ˅̣Ŝǫ֓ɂĥɋř—ɛЄŖp͛нഉց෾ʔˢ˶ɞϼǠيŤɆzVˬCþƦɤ\\`·ŕŵhM"],encodeOffsets:[[36578,33495]]}},{type:"Feature",id:"ITA",properties:{name:"Italy"},geometry:{type:"MultiPolygon",coordinates:[["@@̟ڋŲʹǭѝٝ̈́ёĞ୩ѐŞќজûࡪĠْò"],["@@Ԍ׭ş૕ϣÂ΁˫͇ɞ‘২ȓӒҨ¥рʼ"],["@@ரɏĝЯȬΧڝŪہ̗²зĻʇˠё߀чцۛदڱچLȲȃɽǗݪ̥ؠʩܜѫĔƿƽ̛үϼܳƐΝի؈̷ıѫΗ¹҅ܛΕÝHʲǢҊǼǶ͝ӤʱшΑŀʛδգƴεͶثÆٿϜޑմ֯ӜʿࠪйĮہˤϯŕӝϵΓÕĪθҕńɏٲ̆ʰʙ̀”ʂβǵМ¢Ҽ˶ƢƃА€ǼͺتĿψƚâΆԘšĮdžࠨƤȊ̉"]],encodeOffsets:[[[15893,39149]],[[9432,42200]],[[12674,47890]]]}},{type:"Feature",id:"JAM",properties:{name:"Jamaica"},geometry:{type:"Polygon",coordinates:["@@֢÷ҀȫƔɯןeʭƗҹƊӑ̪ĶȔΜÎȒƒ"],encodeOffsets:[[-79431,18935]]}},{type:"Feature",id:"JOR",properties:{name:"Jordan"},geometry:{type:"Polygon",coordinates:["@@Ʀˆपͫ࿪ࣆͺ৽Džų၅у࠸࠿ˣƛƑ˭ٙřȩ̡εʵधƆƒŨоഊo͜Ůʚ@Ԥ"],encodeOffsets:[[36399,33172]]}},{type:"Feature",id:"JPN",properties:{name:"Japan"},geometry:{type:"MultiPolygon",coordinates:[["@@ņ˽ҿԕΉːљțɝӭշʈRЊҬԆӌīΊΜؠǹ"],["@@́ڡƤсѩף੹Ѓ๏½ணॡ͔֡“غษȃষЃঝe࡞أ֗෗իΝН͜ȶݶՏʒͿ־ߐʶѲՈࡌѢ؞ָာʤ࣎ǣࢠ๺֔Б௾ࡀӌ͜ՈਈƟा΢ՎࣀƸҞୗ}ڻޥࡍbࢁ"],["@@נǵרΤȈहఝɯ݁࠱೓ָқँण]ř࠴д٨࣌²ʖ୐ʜټন࢓٤˯"]],encodeOffsets:[[[137870,34969]],[[144360,38034]],[[147365,45235]]]}},{type:"Feature",id:"KAZ",properties:{name:"Kazakhstan"},geometry:{type:"Polygon",coordinates:["@@ӕƹ્דο׹̹KɱЊ੫‚ǡێХNÚࡆ৓ؘ෷ßডũߣݶۋ͆ಥ׼ƽðᓗӹᶽљ£יچ֧ɼॕǩχ˧±ȲȶΖDž̊অ˺ϛݮҩɆ…˜ࠊāŽؘ܎ƎܼűƲࠎƭԲ࠿£܍ȴঃσ޵ǭяƌĐўՙ֘دw܉֬ӞِʕǢڢऊࡺӣŀؘჄࣴಾtᇢ׉঺ͻࢼΠ೰j੺ѥʔʠ୼—ɂЊഷ׀߮Цƿɮ߮ɔ؅ֺϬ˼Ḯ̈ШȺᑆ̴ݰΒຢǹ˄ࢉ࢚Ȳઆ˹éҝ߮´ᑌߎ̭ˁ੶٭ሠᒑ҄ѰୄӛீɎҪƯКӟטNjΨΥ઎ŒѾԣٕ֓ۥÿ¡ࡅұϝဟˢ؅ຑїȇဗͱݲลֻɓäӏԭŬу̠ఝĖඃx̧ġ஥ΞӉǧŽӹ൩̂փşȉρ"],encodeOffsets:[[72666,43281]]}},{type:"Feature",id:"KEN",properties:{name:"Kenya"},geometry:{type:"Polygon",coordinates:["@@ӾۙיͱȹΕ̿Õšףˑ͹Ǐ֑ͷ˥஻ࡀËӤᵁႌƙĢSࢺʊ;а֌̨ؔσ॰įтЉ׎ԬԈ֬ֆѨƗ@ҽ˺ˡג@੠܋ˈSȠxȄī֖ßʞΔގΚͺ˳ָAܽ॑Xᵣ"],encodeOffsets:[[41977,-878]]}},{type:"Feature",id:"KGZ",properties:{name:"Kyrgyzstan"},geometry:{type:"Polygon",coordinates:["@@ȊςքŠ൪́žӺӊǨ஦Ν̨Ģ඄wఞĕф̟Ԯūşȏ೛ғ̙ͭઁıͅ՛ࢷŒׇǏߣЇŜȟʇȓཟŵਡ˘࣫ÝĂӜࣴƕ̮ʸٖĉ੾؂঻ѸױȽإ͂۶ծʟĊ"],encodeOffsets:[[72666,43281]]}},{type:"Feature",id:"KHM",properties:{name:"Cambodia"},geometry:{type:"Polygon",coordinates:["@@΁Ѭыࢄȣ২ՠۨઘdž߀ťۚ͡Ϟׄݖ̱Ȝ֕Ļ৕ඳ٧τԙࢥÓܫͷ۱Ū"],encodeOffsets:[[105982,10888]]}},{type:"Feature",id:"KOR",properties:{name:"South Korea"},geometry:{type:"Polygon",coordinates:["@@ܨযȺխPॷ̓ҥݽljڥΏݳïĥҚƼـχ࢔ذƚֻܘÂúϒ‡͞Ϝצ¢ΨÈŨȮ"],encodeOffsets:[[131431,39539]]}},{type:"Feature",id:"CS-KM",properties:{name:"Kosovo"},geometry:{type:"Polygon",coordinates:["@@›ǣŃPĘ́ȩĐdzɦƾȌȪÒŜ˨ư²Ţşƾ¿ŌƅƒŸǎƻŢLĥȳijij„×ȉӹŻ"],encodeOffsets:[[21261,43062]]}},{type:"Feature",id:"KWT",properties:{name:"Kuwait"},geometry:{type:"Polygon",coordinates:["@@Ǭχõȓ˔هשuȽАݟĆ؞߮֠é"],encodeOffsets:[[49126,30696]]}},{type:"Feature",id:"LAO",properties:{name:"Laos"},geometry:{type:"Polygon",coordinates:["@@˚Ϝœ܆ڹܸ¿ٕࠦھٍÎǛ̉ӯyʣƨࢯԅoݬȸࢮ֧ž³ԎηʸǴ̲ܐնøȡ҄wŵ०ѦŬӮڏϖޅਚO͚ܹ՝ɗʉ̟৔ԉۦ঳Ռ݋َ׏ɄץƵ࠿ݕ̲ϝ׃ۙ͢"],encodeOffsets:[[107745,14616]]}},{type:"Feature",id:"LBN",properties:{name:"Lebanon"},geometry:{type:"Polygon",coordinates:["@@ɣ[ýƥ˫D̘ۄмעfˆϘ§Ɛͣқ̓ȷҟ"],encodeOffsets:[[36681,34077]]}},{type:"Feature",id:"LBR",properties:{name:"Liberia"},geometry:{type:"Polygon",coordinates:["@@ɗQࡽАޅٖ܏Ң֣ըȪː¬ʔϜҘϺϺǶnɖĨΘԧÇ͵ǐdzʂIǢ͸ʄsŸʓĎНǽύʖɱˊÇΤΙ~ͧăĿÝە"],encodeOffsets:[[-7897,4470]]}},{type:"Feature",id:"LBY",properties:{name:"Libya"},geometry:{type:"Polygon",coordinates:["@@ק̷ҿҤ೧βρՄڑϸϻƷ̗ҶήӹؔͬΘñՈńҠÓϦƨۈ¯϶˕ݐШȜðΠėΒ־͔ʶːЦʌ´٦দ́ΜðۮƓ૞ϓЀݛݮǍஆΙࣆйЦɔЖϮț٠˂Ф؄ЀׂŘ଒ǣ˺ϑ̺Iˌƛ࠴ıȲˣ̣ЕżΫɏԯʦڱ@Ჳ@ᶵ@့ॱGYΙ‧ྐ‧ྒࡓҟ"],encodeOffsets:[[15208,23412]]}},{type:"Feature",id:"LKA",properties:{name:"Sri Lanka"},geometry:{type:"Polygon",coordinates:["@@ų࢓ΙʇܵȓЍڜƫீϠ഼׆ұϺסО࢓"],encodeOffsets:[[83751,7704]]}},{type:"Feature",id:"LSO",properties:{name:"Lesotho"},geometry:{type:"Polygon",coordinates:["@@̆ʩʳУƛ˛ҳſƹˍ̛ċؿ٨҄ՐҖ͢ϼǠξʵ"],encodeOffsets:[[29674,-29650]]}},{type:"Feature",id:"LTU",properties:{name:"Lithuania"},geometry:{type:"Polygon",coordinates:["@@ãɊĚɲχƄࢡƨDZ۸२ʴඬÁࠜĊŞǩ҂Ã߲СĀϓۏˏșӃ࣯̓߻NȫʶљĜ"],encodeOffsets:[[23277,55632]]}},{type:"Feature",id:"LUX",properties:{name:"Luxembourg"},geometry:{type:"Polygon",coordinates:["@@ǘȏ³ρʍiȉòĞҼɖŽ"],encodeOffsets:[[6189,51332]]}},{type:"Feature",id:"LVA",properties:{name:"Latvia"},geometry:{type:"Polygon",coordinates:["@@†نЮՆߊ˼ڜعڪhNJ٤ܐƪςĻܢ̷ۚCКȕîС˒ӷ͕ࣗԛƙ߱ТҁÄŝǪࠛĉණÂ१ʳ"],encodeOffsets:[[21562,57376]]}},{type:"Feature",id:"MAR",properties:{name:"Morocco"},geometry:{type:"Polygon",coordinates:["@@ԒΥߜÎࢊȃκU͂՟ºԝ̄ࢱɜDZƷ͛ષƙϝ̵ӡñ—ثঙ͍ͩсۍɥ࠻ŷഫاRহŷ@@@p҉Ա˓ȑϡ@̥Ŋ۹ě˛ٻʿÕЁ੕ୟ࣡ˣୋ΅ϗĵ̡ቅãaD ϶͒ɮ˞ѪÃ˶̀פҴՖ˲ƊɞӬp҂̤Բ̪֔Ւ࡬f\\ц͔ްĢڎָтɠۮۮȿਸ਼͊ܢŔѶդ֨ࡈϦخΐ֘࢈˄ԪؤI"],encodeOffsets:[[-5318,36614]]}},{type:"Feature",id:"MDA",properties:{name:"Moldova"},geometry:{type:"Polygon",coordinates:["@@ȨŮ֒ĊؤʽΊϞɥÑ˵̪ƏŨΗ̊ɇÏűƾčɝ×ӷ|ĉŜǫãÒƭɱˍƥ˽ɁĝƯϦĘΪςӝԂˉΠʹʠʯĈ"],encodeOffsets:[[27259,49379]]}},{type:"Feature",id:"MDG",properties:{name:"Madagascar"},geometry:{type:"Polygon",coordinates:["@@ɠΥȺ։Ɗঢ়ɒϽĉЗƩʙ˷ӰǁʝLjثõΥɵȗ¿܅ͧওб୅ԯཧ͑ୟϛইہȣܻΡӛɊڙ̜ɳѺÇݘ̑ڠù؂Ʈ؄ϰƢD˪Дِø՚șЈǃՌãޠ̊ҺŔՒмŒҶǤ̶Ʋτ\\ӐӎۖԮʦцŗάΦĵҪ׎fԐ˦ϔ̊ί"],encodeOffsets:[[50733,-12769]]}},{type:"Feature",id:"MEX",properties:{name:"Mexico"},geometry:{type:"Polygon",coordinates:["@@͙݅ƥ؁Õ૷ąЧƤқʺЧǚٳ֎سȞӏ͢бࢾɝΐΙ݄ɾٚĎؼưՊƠՖ΂ȨӬè۸Ƣʖ֬ɚࢶȚݔ‡ԚîȬDZ…ЙҋԁȥԝƸƥűγɁٽɅɎǭcǃY̝ԓƳIJķPŭޥV޷AAӁϛC̺˫̶șĢǹƌ½s˷ઃEЙۅŢƽĭȟqʕ्ࣞџ˘ۇɖҷÓګ́чĉץɜؿDŽ޹ϬؿŠ्ϸ۱ВɃɤҹº࡯ˈΓϦࣗӊсՌȧЦ˪ĈđʈȖɔJ̄˱Ϙùͮ˭ъ݋࠴ࡋڀУԼܝ΄ƷȴŸԲѓȞӹФȽהҍæӣѸϿФ™ˀҍو̓٠^͔؇ͬ˫™ӑɴƇͿƔЕĆف̀΋خׁƒȡŸÓŎ˽Ƭ\\ǜթʮɇǴ̕Նё˨ޯʠρɸϿ²ѷКƒͶϡ̨ϑqƭΝ̱ƫJɛԞջӎ؃РїɈ„ؚŵҖЏʺֿϒŏŇɃɖԭȰӷӦÖÚΊ³̸̼ŽϜ٩׶ӱɶ̱Հ̷վϳڦͿݲॖÞ੪ĞÿǑ౔СኀףဪPژ@DΌผ@̪̕јˇԀσ˨ѭȾҥѢʩۤʥՊڒۊhפͱфֹ̄ӯӸӏȂחɾЃپʹ׮ȁ͞|"],encodeOffsets:[[-99471,26491]]}},{type:"Feature",id:"MKD",properties:{name:"Macedonia"},geometry:{type:"Polygon",coordinates:["@@ńOœǤӺżȊ˺¶ϴbтˏÒ։DžƒƑƥҕh͋ǿջõΑȴšήń˸"],encodeOffsets:[[21085,42860]]}},{type:"Feature",id:"MLI",properties:{name:"Mali"},geometry:{type:"Polygon",coordinates:["@@˰ƶƘӶˊpזɻӄǖ͖ÇŴȈ⁚^ȈךƣļЛ⋈Л⋆౾dᬼᆳᬼᆳȨϿԺʉ϶ƋV՗ठĈFካҟ֗íԭݛƃ଩ï̳̗ա՟IȿLjҥš޻ΑDžʿٳϕŗɍΙǡНŔɱȳūֻڙۡp˳ɭΣÆӥ΋ůȝŁŽάʍĥơhƷʕ٭PɷŴʼnùʱʎ¬ʢĿİdzĉ˚Ǥɐ΅ΚijɴȇȂǙvȫş˕őɱǹΫäɷɈƓ„ɕőƅAµ̮žʾí̽͘ʀǓӔԺ"],encodeOffsets:[[-12462,14968]]}},{type:"Feature",id:"MMR",properties:{name:"Myanmar"},geometry:{type:"Polygon",coordinates:["@@ӫηץ›ϥࣥΟƳО݅ՔؗΈօ̭ܵ̃ƹȪу֖ڙĪҷ_ϵ͠ދң޵Сࡷăذʴ٠˯ӼæࣸͽѤ˛৔Ʊਗ਼εۢօуॕ׳ҽöԳȠ̂ਪǫ޾څॺļ̢ӭņ׭ۆÅڰ̊ŵj׾дȦęΤȐ˺Ž࢈ڂȑϐۘ¨ЦҪ۶}Ӕજ׆׸ƱçԬ̎ƸÛ͈ӮÚˮӵξȧ|ٟ“ۙߓۭijঽࢲƔȨޛՐǍʓۣز́ζƷ؞ʔ~΍܏յdẕӓȗ"],encodeOffsets:[[101933,20672]]}},{type:"Feature",id:"MNE",properties:{name:"Montenegro"},geometry:{type:"Polygon",coordinates:["@@ÁǀηЯÊˋǫÞɽ˞εǖĢƜŬҦ˚ȜƾüɠƟŬśˠě͌ǧçïƽȋɧó"],encodeOffsets:[[20277,43521]]}},{type:"Feature",id:"MNG",properties:{name:"Mongolia"},geometry:{type:"Polygon",coordinates:["@@ࢮƢ྄ܤ౬Єܴʳ࢚]֘Ͻ࠼‰ௐɁࠈגͿӶࢊࢊश΍ނįনɍLjؿஜΛߐƺਫ਼ŌࡆōࠖЗԚѕެT੒Ƌޜȼૈƒ௸פԌĝѰ˭ৌêХهק࠽ɐ΅ӈńࠤŽ٦̴ڬˏހוğ̗ڏĦ௟ŏןʅ؝։౱͙࠷ѽࡹǞҿúѳէˎ͓ƌˣי˯׽҇গ̑ఽ‹ഫ̇এҋϋʾ৭AఓԜࠥŰૣśჃȊऑmӱԀϣޠԱĢ৩ԼଅŞুƞ̡θ͖চׅڲன̀۷Ѿəז"],encodeOffsets:[[89858,50481]]}},{type:"Feature",id:"MOZ",properties:{name:"Mozambique"},geometry:{type:"Polygon",coordinates:["@@لæ৞ʁɖńגt̚ʦԌaऀ͜ڞӤƊϕ“࠷ľ݅ಿƨЫʣ׷͙׍՗Եޏ͉ृСॉ͓ࣕƵוׯ΋ȗí׳ЌُǔӱZʣƪ¦{ࠗƋϷȤƝűΓΗ̗ۗ˳য়ҕρ̳ðΟɊÉíѵّRïϊůϖí̠ƬपɓװГஂࢬ॔ɜ؆ŶúĨӶƉʞ˜غǐ׌E੠ѥ˒ЏÔǹȼϳǰ۫gÅ̼āװᢈۘӚЕɴüͨɅ¸͵ǯϷØסոԱʲ׌ζǰíઊΙ؈̣˖̅]ɽદɾٔ"],encodeOffsets:[[35390,-11796]]}},{type:"Feature",id:"MRT",properties:{name:"Mauritania"},geometry:{type:"Polygon",coordinates:["@@և־ԗؤ֍ɞГʚҵUЧǽйð˽ˏïҐɺаŀߊģࠨĵкČмɑЎѵδǾˬᾔMǃ௎ȴќ߀øᒸ᪂©F౞Ṗ᎟౽cМ⋅М⋇ƤĻȇי⁙]ųȇ͕ÈӃǕוɼˉoƗӵ˯Ƶ"],encodeOffsets:[[-12462,14968]]}},{type:"Feature",id:"MWI",properties:{name:"Malawi"},geometry:{type:"Polygon",coordinates:["@@ɽٓɾથ̆^̤˕Κ؇îઉεǯʱ׋շԲ×עǰϸ·ͶͧɆɳûәЖѵɔʮޮ˄̈LJۢǚڼƞɪɉ܌Ѕϐ࠘ƽǜɵ˶Ϲɾଡ"],encodeOffsets:[[35390,-11796]]}},{type:"Feature",id:"MYS",properties:{name:"Malaysia"},geometry:{type:"MultiPolygon",coordinates:[["@@àћֈĶ˞ΈȘýӸԓΜ֛¶֣ęϡĆ˿Öӻ̒ɵͤݑe˳׫Éߑخ঵ښįђӟ֚ś̡۠ҜĠؔȃΤƤƮۈρ"],["@@أ˹ܯƚॱ@̅ॗ͓̇љୟۅǵߑɾЕóөщ՛Òէǟַӆƕ֘؜˽ٮǀǜ܆άǂ৖Ǻ׾ڔЬՐϦѥǮ˺В¸՜œа٪אшڀͼHќыžιֆɻ۬ʧÑ֝͡¥ƮЧ"]],encodeOffsets:[[[103502,6354]],[[121466,4586]]]}},{type:"Feature",id:"NAM",properties:{name:"Namibia"},geometry:{type:"Polygon",coordinates:["@@رٌؖ͡ȃࠊȷ،˯ಒm৒ŅҞ͛Όѡۜѳ৘ǽՆۃࠐ»٢КdžԊƞհ}ԄϝŶÐ₮˜׌Е᎞ş໴΂یȒհµͨȍPéӁȍʭC՛͍ͣΎಕ̍سƒ{Ჽࠣ‡BយA᷋ݣѕҋÕՇDŽϗÔƗάͩɰГг"],encodeOffsets:[[16738,-29262]]}},{type:"Feature",id:"NCL",properties:{name:"New Caledonia"},geometry:{type:"Polygon",coordinates:["@@ېԵѨϭ͉ȫҥɪ׹ϚէѼ։פś˶β[Һ˹φ˷ˎɻ"],encodeOffsets:[[169759,-21585]]}},{type:"Feature",id:"NER",properties:{name:"Niger"},geometry:{type:"Polygon",coordinates:["@@nּॹȐОҿպœϤâТբ̴̘ପðݜƄîԮҠ֘Eኬஈϒᝪ࿸᮪ཾ೨αӀңר̸ȸಯ̾ɓ`ˋΔ˽ǻί͕ၻ«ધੳߋγૉΔ̵CեբmčЃʁµˋƻm֩ंȟ’ځҷٱʔҍ¸ʏşӯ~ӷΧѓq৯ѢЉȵѓb̿͆ࡅ̼ࣗıɕǻşӗʋ͹ÍݣٗӚ̟E˭ʗ"],encodeOffsets:[[2207,12227]]}},{type:"Feature",id:"NGA",properties:{name:"Nigeria"},geometry:{type:"Polygon",coordinates:["@@ࢍ̡͉¬͓ȉڥl҇Ղˡ؊שֆكYݍB¶തs՘ǂՊʶʴТԴėɨǔ͸ȍӾ˪ÎݤʌͺŠӘɖǼࣘIJࡆ̻̀ͅєaЊȶৰѡєrӸΨӰ}ʐŠҎ·ٲʓڂҸȠ‘֪ँƼnͬͯğƱ«˧۽ٱɛՙšѧDZȉǝי҅ΉŽыȋ͹ÿΓֽ˱ҽΊ͇aԃӭʑQЍ߷ɍש"],encodeOffsets:[[8705,4887]]}},{type:"Feature",id:"NIC",properties:{name:"Nicaragua"},geometry:{type:"Polygon",coordinates:["@@̃ˆϽͺȁ˲Ο˄сϜĤžƒŵÚÒʾ”ŀȔŬRkЮȠrǬOǺɤʜǝĒľƺIJ̊ɴbǦĄQňȪĖ|ƜŹǚ›ȆńɄB̈ŌŜŖ˾iïă§ȉĐ̫ȗ˹ěͷυ®ɏtϙŹĉýΫÌɛǣɋ ɩźƏȩDZʛÈƓǦˉêȕʼnօɞųŇ"],encodeOffsets:[[-87769,11355]]}},{type:"Feature",id:"NLD",properties:{name:"Netherlands"},geometry:{type:"Polygon",coordinates:["@@ۦyǀ˳Ƚޓɇ́ԍ@ƘࢡҥȞՏπީǩ؛âѠɲ݀ఆଲΘ"],encodeOffsets:[[6220,54795]]}},{type:"Feature",id:"NOR",properties:{name:"Norway"},geometry:{type:"MultiPolygon",coordinates:[["@@᥆ؙઍɣऄՅෛ͵ڵû΢לઃͰಫ˵Ы؝ߟωࣗȮ઱¥णѼԉɝԷ“ūփནƊɝҵ߭Hևױ࠿झಫ஁̨˹̇ͫ࠯bձ޿¾૟՞э˥ধֻۧυӛ֝Ԫဋঁ૫ȟ୏є̛ࣚˇ኶ޞզᕠ۶ဌࢂ໤୦፺ྴඦلᘼ੊ᇎπ൪­౮ۢ໖›ພǘ"],["@@ም΅๝Ȝ׆ɐԕˎეǚͮ̿ொȍ"],["@@᪖صᑟͥұأ݅ǁЍۡৣᅵԢނ̘ఽʐ࿕܂ٷڄᘎ̜Ң̋஦\\͊˼௾ˆ੖̋"],["@@࿮̏ఝҍ᝱ı៙ƖƫɴஹdँϬᣴɼ௞ȫࡘʤᑺȽ"]],encodeOffsets:[[[28842,72894]],[[25318,79723]],[[18690,81615]],[[26059,82338]]]}},{type:"Feature",id:"NPL",properties:{name:"Nepal"},geometry:{type:"Polygon",coordinates:["@@ÝαŌՕĩͩ۩aয়Ȟ٭ĂӛђଷŊયҼ߉Ю߿͆͜޼ՒϠΒȪڪʳࡔշҾť˰ЕٶǓۀσौȕঔć"],encodeOffsets:[[90236,28546]]}},{type:"Feature",id:"NZL",properties:{name:"New Zealand"},geometry:{type:"MultiPolygon",coordinates:[["@@Ȓ΋װ;ʐΡBΝ̹ϳչإїͷ̴З٭Yܗ̓ɣջӋࡗڇϓнʇޝlխˢࣱÐƗ̰Ҍذ੐ࠦժǀ׾͌ܜѰԎѦώظ͈ɆŰҶלϴȆΧ"],["@@،ࢫlָϜɯŲًڰ˛֨ãӒ͎юĭȯݗʯӫٛjɡʭþαūƻͅҏзֹ٭ͯƟɘΕŨӞ۔˟ҨࣛͲz̦؈̌ƚ٨Ÿլͻ֜vƪБΎڋݔΗת̸àҚұٺɑʂݡ"]],encodeOffsets:[[[177173,-41901]],[[178803,-37024]]]}},{type:"Feature",id:"OMN",properties:{name:"Oman"},geometry:{type:"MultiPolygon",coordinates:[["@@ֹ̻ϟªǩȧƉэļ֗ÿĻϯFԽ̻ćХȓǯԹP͡ɃJͻПɷҩĂ֗˳ϱ³˝טٿ൴ᠾ࠾֖၂ϩתv͸ʔΐFΆϞǒƩŞèմіHϖֵҸ̧؞ŋӼƳϜӕɨ˧̞ŃCȉ̩ԃƅɽΟˏ"],["@@ʼnƳDž˺ʔ˺ľñā΍"]],encodeOffsets:[[[60274,21621]],[[57745,26518]]]}},{type:"Feature",id:"PAK",properties:{name:"Pakistan"},geometry:{type:"Polygon",coordinates:["@@تϻʞ٥൨ͻ߹۷ऩůౣȲЫα̖݁̈֩ڴгܑӟ`׳ࠃࡇՃ࡝࢝ࢡউÚऑࢡռϗĪ٧ҾэǘܝᇛD֓֕؛Ɇʣ؀٭٘໻ǁിeஃŝ̈́ঊொѢéϰГƌw݊ߥφͷԔеѶඨѕࡀŲԈŅǞȂגóદĈ܎ҶӈشCĠɼٞŌ̴ý͢ʀ±ԌΦԖ՘Ɇͥ֊ߜɴ̢•͒мΜĩмȣΤӬμࣘǮ८ĮѐƺӨĦ"],encodeOffsets:[[76962,38025]]}},{type:"Feature",id:"PAN",properties:{name:"Panama"},geometry:{type:"Polygon",coordinates:["@@˫ʎǵҒȺɢɅÎƿˤлɸοÁǝ̇ͻɁǽ‡ĉǩВҗɯŅŧŭϷ©ơԈŋƛˡ¸ǝ͸·ÈɓİέCǻĩŶªǖìǠƲŲIJǩŲK͸͘ö̠̝iDZͲ›ĀæɴȵЮÔΨɄԜǞ˺ʤҬ·‹ĉҶ…ώơ˜ʧ̈́ɵĹūȜӵǁʟ˓ÒŅС"],encodeOffsets:[[-79750,7398]]}},{type:"Feature",id:"PER",properties:{name:"Peru"},geometry:{type:"Polygon",coordinates:["@@ɥљћɋࡅӘñΈရࡊທࣾ٫԰ΏۜƐʎ܅ાࠣ༄ߍီ΅Ϥ˃ؤٷպױͼ˖ϒПߢʼךڢՎIJΓʇȧx̭ΎâͼĝΚщӆΌDŽ֤ԦܶৠͨࣸࢠʾմŝٔɢĂ֒ЉˎЅϴɏӶࢣضĿҨɞ̤ƣԎð٠Ͻթࡣʤoрҁݳ œųۍlj॥ֱÓϻɉ̇ČғԕʍBΡɛƵΔݳҲԝDZί֐µ͆҃ݐuېӸÇ౧ϢĩӄƠܪടǷ˵£ןg܍͟пƮ̵ȕ˯β۹Ջ࣡"],encodeOffsets:[[-71260,-18001]]}},{type:"Feature",id:"PHL",properties:{name:"Philippines"},geometry:{type:"MultiPolygon",coordinates:[["@@Đ֏ºҽ˹ޑ̫ࡨϽэˎإʉϿ঩Ӧɿ؊ʰЎՑЈˁΑЃثҵƑʖ͢۾ՌʀҜ̈́̔ϝٔɰƎϒרv·ٰڼЋêхÐ̱"],["@@̟ˡˁՍ˃ʝԫ׈ǦɤɂɾĢԸҨ¸Ɖ֣جߺāߡ"],["@@ૣߕЬט؈԰Ԏ׊Ѱ࠲Ʈۅևҧѳֿ"],["@@Ԏʹ՘BgΗϳΣՕʧ‡ϸÒєŽА"],["@@ʀभ٫ɞj˭ȶԯЍȋ•עʧªƁԘӶãY͈ԣٜ߮mɴ̻"],["@@ɟܩέоѓ٘ܚ‰̡̈"],["@@ԮʉʶɖüɇƍΑ˼׻ɛۥӷ˥ƁڳȊڝѾġϊIJਾүăҙ˜ȫēϯٻЮ̵Ѵɍ̯՗ԊރůлȆ¨ΎˀɊʣȘŇ̡бӚűμߨͺˡĔೄ˜ހԘA"]],encodeOffsets:[[[129410,8617]],[[126959,10526]],[[121349,9540]],[[124809,12178]],[[128515,12455]],[[124445,13384]],[[124234,18949]]]}},{type:"Feature",id:"PNG",properties:{name:"Papua New Guinea"},geometry:{type:"MultiPolygon",coordinates:[["@@ɽčε͔ρՔǷ٘ŜĆĜʡʬȏРՑЈ˵ŝɽ"],["@@ѯçƃɽҟȱћȟѽBۏʔӑɺêʺݬũҠàŶЖŦrĆѽӐÜʂ˼Ҹ̚ġӸԌfǜƏgү˯ԡ"],["@@ݤտղࢻӖ„‘ω٬ƛʥǁࣀΝġʏ֋ÏȷɔܟĦࡕŴٷ՚ӉҦѧ݀ભπ܇ʇԡˣńإڇ˿һƖࢅ–aᩒaᩒภ׃༊ӓׄїҴхŸӵඔԱȲѽޛěȄ֕"],["@@ʿɡǁӸȝ͘ϝ˞ӍΪ؇ʚɺȮҒɻ˸ȁΜȫʹΛ͊ˏĶѧ"]],encodeOffsets:[[[159622,-6983]],[[155631,-5609]],[[150725,-7565]],[[156816,-4607]]]}},{type:"Feature",id:"POL",properties:{name:"Poland"},geometry:{type:"Polygon",coordinates:["@@·՜à̂ȹ̧҆̚ɺɤȝђָʘ಼ϴ੒˴࠼ƙÚȱ߸Yਚħ໶^њěȬʵšωɸ͋KͯԋǡʸϳfϏцܻěɽзįރۥɒϗǿ¶ߙ͔؁šЇĒӹǵч̖Ήŕ³¼ϭаر¼ăˀֻĦűɑҗǨÀɴػòЉ˔"],encodeOffsets:[[15378,52334]]}},{type:"Feature",id:"PRI",properties:{name:"Puerto Rico"},geometry:{type:"Polygon",coordinates:["@@јõưǕɋɃمLӫ‡·άŢŬیK"],encodeOffsets:[[-67873,18960]]}},{type:"Feature",id:"PRK",properties:{name:"North Korea"},geometry:{type:"Polygon",coordinates:["@@Şƥ͉ºη˵ʣ˷Ž׽ѣȅƫƧ̓ʝ֓ƏηɥηįġͰƋӈσŧȭΧÇץ¡͝ϛϑˆÁùСdžĵƿʙé‡ǀɑüɥƆɰφȤİõƶɆҒÅƎөĠЇɤۄբऒҌ־׮Ўˁܪ‹ſѺಚβͰҼժӹ"],encodeOffsets:[[133776,43413]]}},{type:"Feature",id:"PRT",properties:{name:"Portugal"},geometry:{type:"Polygon",coordinates:["@@̦Ɉ΄ŬɂЫӺDƞłӪ‡ɼуϱɩYٽƍū‘Їγçʹԋɵտ̄ʡřɫ̵̿ê˥ͷɓѷŠџġŸڂÿԬϓþȩ͈äռͰ̨ÒͼǪԎkΤǙ̠™˲"],encodeOffsets:[[-9251,42886]]}},{type:"Feature",id:"PRY",properties:{name:"Paraguay"},geometry:{type:"Polygon",coordinates:["@@ͦ৖tҌЖ݌าʔޮ]޴їbʵʞҳÇଛࢲLJ΄ǐ֦ɩǀʣþޓİ͓̼›̀ƌ̢ƳAҥŕӻǑӛƍݏށ١ړƇऻŸࡑɮࠢ౨ťψࡽ͢ਅبۉŸ໵ൌ"],encodeOffsets:[[-64189,-22783]]}},{type:"Feature",id:"QAT",properties:{name:"Qatar"},geometry:{type:"Polygon",coordinates:["@@ÇؔɨѲɰĜʬˁdӯǽӳɵÑʫǖ"],encodeOffsets:[[52030,25349]]}},{type:"Feature",id:"ROU",properties:{name:"Romania"},geometry:{type:"Polygon",coordinates:["@@δǶԴġՠGϸȳ˺źبĄɄȠΠ@ʰćʺʟˊΟӞԁ€ρėΩưϥϒƹЂƊϠƟpɏПǹʯĀɻ৥ӳĖ̪ؑফțзɋ௽¬٥ƀ͙ÕʍΊƵƦȚƘȷŀ˃ȋөʔßΌԟȢĥˌҕͤڪǂԖ֮Њ֬ԢǮ"],encodeOffsets:[[23256,49032]]}},{type:"Feature",id:"RUS",properties:{name:"Russia"},geometry:{type:"MultiPolygon",coordinates:[["@@ࡌ๫కˤԫ்ࠌࡳyוُԒսٱƻ۸Ĥࠊħ࣢Țٌš૴ӯࠜôରަϮͭϴϐŠɔ։̆ߵuࠟΎࡑ"],["@@໵]ਙĨȒτ୊˚ࢢƧψƃęɱäɉ"],["@@֦Ƚțؐᗸű࿨޻࠭λ൛ēsࠑͳǩ޽~ٗ̊ૣʖȉθ࡟Ǝॗʼnҗ̎Ǽ̸৓ȥϚЃӉΣ@„Ꮪٛᔺ࠳ïԷ"],["@@ः©ƭˌੲΖ@ַ"],["@@ળ»@ָň–܈E௒ʉïŗࡽȩ"],["@@ౡMႣĤƧ¬ߘͪੀþஞ͏ĸə"],["@@ॿͩഉø༛ͨȪ˖༨ųᑔɗ"],["@@ډرᶽzඃȣမղҎ׀૎ǂᕞ™ᴬѽ"],["@@ӹóᩣŊɟώູɦūҒ࡮Ƕ…Ҟသܒޙĺ፨݆ɩϢሤѺ᪪բ᫠ǀ෴̸࿐Ŋאͩ֟ʻᲗз᢭Џᤙߝఫࠍ೉߱Ǡۥྎۏ"],["@@ɨгސȲឤYቈЧڬ̿ȽѧङʝᕅүفʟਬşఖɃݴDŽєաτɔഊƂ᧪ƑȴϽ↲ů´ٜᄼƥഄLബѷϮ՝ӹΙੌڋ೔Ϳ߸ࢦഖϙ෢ɦྼʵؤʀൖş؅ޮૐζ䢀ձܐӿᔲٛ₎DŽာƑ۪΍Ĺؙਜʇ૴Ǥ๰vཚǑཪĢะݛਪˎڷ՞ϐώᧆɻფºᝂБ୲ν@”MKઇσઝÖݶҁԄەϲɧĮΏɑɝ༧Ǿ᚝مݛĭ౽ן௛ԧ̱ϣய׊ᔗڇϣ̸ߵΫ૱Ř˓ց৙߽Šͻड़ȋő௣ޭ‹Ϋ۱Δα฽ѕ̅ॡభȳʥ࡟ே޳ׂ̳έ௬ҵለИ୘܀ԆªϾರȊຊ੒คࡺຢڢڮஆ৷ëԍۗᒉइۍਖᓧ˷ᑃටۚԧሙɕಝēÔ؊ಯŶ਩ЭᢵƠ᪏ʟᨩ࿛ủጝ೚ŁаՃࠄȅ՞оईÃௌऍ†܍ځ࠽ë্ϛഉ్௓˯ׇଙ঑ଇॻթӹ૩ӱՉYՇФૻؙſ˩ŝƦKѐіxŦ঴ɛܚܞ̒৶Ʃ֢ࠈ˾ऄ͚̮Ѵݲ൷ʛܯͧ౧Dͻ߄হװหˎ̵ࠖ̉Ԫ̿βԯࡐ̲݇షʢ૛uਯƱۛлҤȥXҩұˑݷࢻRσஅՍ৙̈́োéѯˮԋĞ௷ףેƑޛȻੑƌޫSԙіࠕИࡅŎ੝ŋߏƹ஛ΜLJـধɎށİवΎࢉࢉ΀ӵࠇב௏ɂ࠻Š֗Ͼ࢙^ܳʴ౫Ѓྃܣࢭơ͡çѽԤઍőΧΦחnjЙӠҩưிɍୃӜ҃ѯሟᒒੵٮ̮˂ᑋߍ߭³êҞઅ˺࢙ȱ˃ࢊມǺݯΑᑅ̳Чȹḭ̇ϫ˻؆ֹ߭ɓǀɭ߭ХസֿɁЉ୻˜ʓʟ੹Ѧ೯iࢻΟহͼᇡ׊ಽsჃࣳĿؗࡹӤڡउʖǡӝُ܊֫ذx՚֗ďѝѐƋϥӽ߿Ƒ࠳ࢁކߕĉ֣ࣼফԇ͹ƝɇωÌֿԚɿ†ՅȚʳΈ޵ǮԙƁƥƼଥЖఅƌ܃ƞĹıੱ܂य़̈́ܩӴؒƈۤ۰ҹͪఌ΄uȀݯƉ‚ώѠɼ߼ÖƄ˪ȅҪ΀ѰWʚఉ˚ӭUԯЀ١ƃ੩̐lǒ̗θڟ¤éʼɀǞ՝ӈࢋąʭ¦Ƀȑ̽”ȷ՞ȟ˨NJĀڴ‡͞Ȁʍɢ֥ƪ¼Ʋ΁ƴՃվǸɨĉЂࠑȨѱijšȼࢭɂˑӸíТЙȖάˊʝ޶װӞųƤक़ҬࢡЎᅢ੶ޮӠ͂єగּΆնݳش֢ܜ঍ग़ޢي౿֔ŬךڶüොͶࢀ̈൦ԕᘨȧṺो٤ЋÆ֓टѳ൏ɡ⏷ٔ؟Ńൌ؛ÂϵÆ࡫ઌʯڂɓňРԑΰ՘͈᎖Թ۾Ȳ֣؜ዦࠖޢµ޸̋Ӫ׀۫ԄЪԊءԶᚠˑӔҹ੡ĻNҳڌ˽ಜǼȶ՚ჶАᰪܞي£ࠣԙਬĕ׼˼༾xఢΐफ़ԏॖ֌ࢡӢѪˤ២ʫ୒ʿᴾॣ֚ѰࡡѺ{ǴৣĈˢЌ҅ټ}ː༄ݾրކزǒᕮɛǬұߕڽԺˋ˒חȏଵऒԧέ֕࿫஝०ŭ̢ͮऎɎɞжܮЎөӌϼֈࣿêȫҲڢࡈણۆຒ֦șװмnѴүͧ߷࣐Ƶϥ؄ඤͦლ¬༈ӏݛ۪ċࣆศǞ፾™ᆘŌہѮংւॲx࿎иᕠŐ˪ɲᕂþیȋሴҀ໲aɶδߤΨጤΈ෸˗ଥȷበŹ"],["@@ⵙ͕ໞીےĦقÃᒈӋʟͿ"],["@@૽ōݱÛśƏঙƑ࣫ȦӐʾል~࿞ƶ౨XǢɧӘȬߊƐఞǿ͗ŷ"],["@@ᆳĿᚉʎඅ͎٣׾଩ǔᔆָᆎȎ࿌чኬ߻ȹݯ"]],encodeOffsets:[[[147096,51966]],[[23277,55632]],[[-179214,68183]],[[184320,72533]],[[-182982,72595]],[[147051,74970]],[[154350,76887]],[[148569,77377]],[[58917,72418]],[[109538,78822]],[[107598,80187]],[[52364,82481]],[[102339,80775]]]}},{type:"Feature",id:"RWA",properties:{name:"Rwanda"},geometry:{type:"Polygon",coordinates:["@@ͬӃµӵʏŁѿÆʱӍԛàþҠŘތԄʎɺȰďԈʸ"],encodeOffsets:[[31150,-1161]]}},{type:"Feature",id:"ESH",properties:{name:"Western Sahara"},geometry:{type:"Polygon",coordinates:["@@oҊŸ@@ÉeNjEౝ᪁ª‚ᒷ޿÷ȳћDŽ்ᾓNǽ˫˜΢bCቆäĶ̢ΆϘˤୌୠ࣢Ђ੖ˀÖ˜ټۺĜ̦ʼnϢ@˔ȒԲ‚"],encodeOffsets:[[-9005,27772]]}},{type:"Feature",id:"SAU",properties:{name:"Saudi Arabia"},geometry:{type:"Polygon",coordinates:["@@ʼnΪʩʨÝͲѡ̞҃۴ʁۆׇ׀ϑƐ֋ߠīא–ӾӕञϿ͠ґǨˡӖ°ȎɹѦʕȊ͝زԟڴѓ־лIžҦœ̌ļͲनƅζʶȪ̢ٚŚƒˮˤƜ࠷ࡀ၆фdžŴৢɩబיᛎၕ༠ãݠąȾЏתv͠ܥаȓƠִ̏Λ¼΍ċ˩ł˯ʎɽŐ˟ŲȵʬǕɶÒdž͍Žș࡙͐ᡌщǞDzϪש֕၁ᠽ࠽ᝑ͑޷ϙ׻ࢥϹƕɁˬ͏§߻ĎƷČॹmɫùΉɔɝЭĒΟρˋ"],encodeOffsets:[[43807,16741]]}},{type:"Feature",id:"SDN",properties:{name:"Sudan"},geometry:{type:"Polygon",coordinates:["@@śhdмĵ̀џͨĵ؄ĶبϳÌÍȇԍ©Ȭʕðԍңңл؅џđ۹Ӫͅǥđʓџǃ…ǥ࠵@řǦ؃†̡ƝɳîѝӬƟɲ؃ŗɱϵɏݣ˿ǁʳğå ̅ʎÃʼƌΔE΄ӛՀĩάZȰ̱ʜUӦǭ͖̍µĎ̰ɒΖħΐˢʴǫȞɞ԰ϨئܦÏ¥ ZΚॲH@း@Ὂ@ῼ@˔ࠗȁƳŪࡻ্̰͌ȷҠ̳ыӑأƏ˅ʳĉ֑α௿ĚͳƅܟͿࠟԓзέٛč΃Љɽʝ࢟Dij"],encodeOffsets:[[34779,9692]]}},{type:"Feature",id:"SDS",properties:{name:"South Sudan"},geometry:{type:"Polygon",coordinates:["@@Xٽűʯѿq˷ӏԨÑюХƨͳϦșӼࣳ֫օԫԇԫϭסFگȟՕȊ΋ɭ݉֐ȥάҵDZϱÆɣƕϗĸԗۚƉˊعͪɅԌΕζ֟ѬS˘ҡͼ֯͠ʴĠ̀ǂɐݤɲ϶؄ŘƠɱўӫɴí̢ƞ؄…Śǥ࠶@†ǦѠDŽĒʔ͆ǦۺөѠĒм؆ҤҤïԎȫʖԎªÎȈϴËĵاĶ؃ѠͧĶ˿cлŜg"],encodeOffsets:[[34779,9692]]}},{type:"Feature",id:"SEN",properties:{name:"Senegal"},geometry:{type:"Polygon",coordinates:["@@΍ٺн̚φDŽРמȦќ˾ːкïШǾҶVДʙ֎ɝԘأֈֽžԹǔӓ̾ɿî͗ʽŧ³қâÙģȃk׿ȲЛV༇–ɥħ˥‚ѻƋƏ٢ވkȬŞƮR̸ȘήǯκcζȌǝʐˡƙʻJͧȸˉ_ȍȥࣵy"],encodeOffsets:[[-17114,13922]]}},{type:"Feature",id:"SLB",properties:{name:"Solomon Islands"},geometry:{type:"MultiPolygon",coordinates:[["@@ɾ˿חN͉ԬԈȯǜ‰"],["@@͝mԧĎǫżÀͮֈƁ˜ǭƎə"],["@@ųƹحܰǫԈ˺@̠ڥʹЗ"],["@@–ǛڅΦҟ̠̿˪ŰĐϮȫېϭȢˉ"],["@@Ǘ³οȒ·Ί¨ƖԈΡͰ˛"]],encodeOffsets:[[[166010,-10734]],[[164713,-10109]],[[165561,-9830]],[[163713,-8537]],[[161320,-7524]]]}},{type:"Feature",id:"SLE",properties:{name:"Sierra Leone"},geometry:{type:"Polygon",coordinates:["@@ɧØ؁ͺѩ҈Ƨ̬Ĺت҆τĬɺƞǸɶpȜǂڦCɺ̛ǼˁʓƈɗṶɴ´ϹϹϛҗ«ʓȩˏ"],encodeOffsets:[[-11713,6949]]}},{type:"Feature",id:"SLV",properties:{name:"El Salvador"},geometry:{type:"Polygon",coordinates:["@@ġȡӡ^̡Ą΍ǘұÀʃǶ~Ů˾ɄǀĢ«IJȠ¾ʜëǸǙʪƇŒœτĴǤÑŘĝÏͳ"],encodeOffsets:[[-89900,13706]]}},{type:"Feature",id:"-99",properties:{name:"Somaliland"},geometry:{type:"Polygon",coordinates:["@@ϛԩד۫۹Mᩧা͍̜̳К̳ҨǾ̖̲҈˚ƹǒΏϜΗкGߊɌࣴĴ݌ʼиÆ̚ƶӎˆKaE΋Aࡑ@ѫ"],encodeOffsets:[[50113,9679]]}},{type:"Feature",id:"SOM",properties:{name:"Somalia"},geometry:{type:"Polygon",coordinates:["@@ѼĎЊ˾͈FpɵýӧHѳǯ̣ʁࣥЙयԱ੷ܝ௷ܓवধ଩ࡁڹష࠯޳ٕँৱȗѷȍȣӽۚWᵤܾ॒ɰˆբfݠפબšᛜᡄה۬ϜԪ@ѬBࡒFΌLbːhϰŰ"],encodeOffsets:[[50923,11857]]}},{type:"Feature",id:"SRB",properties:{name:"Republic of Serbia"},geometry:{type:"Polygon",coordinates:["@@Ԡȡà΋Ӫʓ˄ȌȸĿșƗƶƥȷȏø̫Тγ͋ʿƗˋĞijƑšϳa˹µƒØĴĴĦȴšKǍƼƑ ŋƆƽÀšŠƯ±ś˧ȩÑèð͋Ǩ˟ĜūŜɟƠȢšŬЄЛ͔ɀτ̥Ë͔́ˉʈȱ͘٢ɚԾ™ҖͣĦˋ"],encodeOffsets:[[21376,46507]]}},{type:"Feature",id:"SUR",properties:{name:"Suriname"},geometry:{type:"Polygon",coordinates:["@@৔ǙĞưڶÔࣚɥѩܟâֹͤӽƥίóϩɉΛӓDzЇđ͹öčʏƘǗ÷ǡҙèԡܴōӄˏBωؐƺѠ¯ȤԜɖƈݲ"],encodeOffsets:[[-58518,6117]]}},{type:"Feature",id:"SVK",properties:{name:"Slovakia"},geometry:{type:"Polygon",coordinates:["@@´»ΊŖш̕ӺǶЈđ؂Ţߚ͓ɷɓǏ͹dzđ࣑ʮ˟»ȟȡЁĿěÄХŽͭ}ãǙ۷Ļ̱ĠёɌċ̆äńŢȂόa˺ĔxþLj¢ÆȒȖ˜žưʢD"],encodeOffsets:[[19306,50685]]}},{type:"Feature",id:"SVN",properties:{name:"Slovenia"},geometry:{type:"Polygon",coordinates:["@@ۜÝъȐܾtLjƘƘUǎ˳ڝɟć͹̇đHɻͣh˷ƎƷƙב†ȈúȫΨĞа"],encodeOffsets:[[14138,47626]]}},{type:"Feature",id:"SWE",properties:{name:"Sweden"},geometry:{type:"Polygon",coordinates:["@@ࠁוƀԥ೹ڭྱܡؓஃײףߦүޗॅ࢑ȝ͍තӋ޿৳ĆӅڗঃˉߐ۳॔ٓஐφӜּۨ˦ন՝ю½ૠղ߀࠰ä̧ͬ˺ಬஂࡀञֈײ߮GɞҶཔƉŬքԸ”૪Щ಼ֱv಑˴͛ฃʃ"],encodeOffsets:[[22716,67302]]}},{type:"Feature",id:"SWZ",properties:{name:"Swaziland"},geometry:{type:"Polygon",coordinates:["@@ǡύӭěԅҖS̄ɰ̀ĂʔʐÒшƵŰϕðω"],encodeOffsets:[[32842,-27375]]}},{type:"Feature",id:"SYR",properties:{name:"Syria"},geometry:{type:"Polygon",coordinates:["@@࿩ࣅऩͬgNŖŶ_ΈȸҠҜ̈́Əͤϗ¨ÿٞȶΌɤȀɤȀ°Ҹ˞Ǐऎɺ҂ƿۖFॴ̀Ґaक़žїԽҡȹĂؗͅ৫ᇵ࢓"],encodeOffsets:[[39724,34180]]}},{type:"Feature",id:"TCD",properties:{name:"Chad"},geometry:{type:"Polygon",coordinates:["@@ĎЄաnDզΓ̶δ૊ੴߌ¬ન͖ၼǼΰΓ˾_ˌ̽ɔȷರࡔҠ…ྑ…ྏ¦ ܥÐϧإɝԯǬȝˡʳĨΏɑΕč̯̎¶Ǯ͕Vӥ̲ʛYȯՏƛэͽ؉ࣹ߅ϳ߹¾ʁûĊ̏ѫ̋Σ͟੓͏ȽȐƓhƹɍۛÙƀɪ˅ׄşΐλƜӷӪǼІϦċʂÐҸSқކŒ֐É֐ͭՠ"],encodeOffsets:[[14844,13169]]}},{type:"Feature",id:"TGO",properties:{name:"Togo"},geometry:{type:"Polygon",coordinates:["@@ڱdzȇ̎ɡՔãкȆݴɁ̬ăڎD؎ΕѠÖˀ݂kŅѵʲʝ̈̋ŽЭǜǥኝȺׅ"],encodeOffsets:[[1911,6290]]}},{type:"Feature",id:"THA",properties:{name:"Thailand"},geometry:{type:"Polygon",coordinates:["@@ݭϬܗeŬڈ݉Káऋґ௯˙ݏÌ؋ն΀ދưܭҶӓԚĭѤѧ˝·ևĵßќۇςƣƭͧ͒ƝжҁӄПЌƏӳǃҲĠԾʚ߬ТࡸҤ޶͟ތ`϶ĩҸ֕ښȩф̄ƺ̮ܶ·ֆՓؘН݆ΠƴϦࣦצœӬθӔȘθʷ´ԍ֨ȷࢭpݫࢰԆʤƧӰzǜَ̊ÍٖڽÀࠥںܷ›܅˙ϛ޿ŦગDž՟ۧȤ১"],encodeOffsets:[[105047,12480]]}},{type:"Feature",id:"TJK",properties:{name:"Tajikistan"},geometry:{type:"Polygon",coordinates:["@@̭ʷࣳƖāӛ࣬Þਢ˗འŶɈާˠĐԜȓ‡͛ŴӍࡿBׁØԻϕύĉ̉ǯͩˠþ۸ʩ¢ĞʲғȐα̇ė͹Żūԇj˕ϩ˯nj؋ˑʱĺӀࡘǹض؟ȨɔφۮŸЌҬˌբ૲ȜǩϵŤɹΎv"],encodeOffsets:[[72719,41211]]}},{type:"Feature",id:"TKM",properties:{name:"Turkmenistan"},geometry:{type:"Polygon",coordinates:["@@ñۼطŠॣݔڣĠगюׯþσƽ֙|ׯӓ݇NjƻרŪ࢞ٽ˶Ɏֺ֏¸Ȇ۾ߊȵ݈ˎؓԎʉӔڱɋď؛ʿհψ˨ॖǪ֨ɻךڅњ¤ॆ\\Əцܖ̂۾ӦଆѹĜڡ͐ǣࣦžˮƳаࡽ०ׇոЃ࢞Щ૤Ϋwԥʩ€Ѕɤſ̙۽NjǙڥӁʭڏŵǫϟهŏࡩ͈"],encodeOffsets:[[62680,36506]]}},{type:"Feature",id:"TLS",properties:{name:"East Timor"},geometry:{type:"Polygon",coordinates:["@@IJȤܢȌז†ˀŀ͆Ľ̯ɫ࢕ο۳ʋeʬďǔ"],encodeOffsets:[[127968,-9106]]}},{type:"Feature",id:"TTO",properties:{name:"Trinidad and Tobago"},geometry:{type:"Polygon",coordinates:["@@ӚŊǮ‡‘صۭġƯúʒɲiͪ"],encodeOffsets:[[-63160,11019]]}},{type:"Feature",id:"TUN",properties:{name:"Tunisia"},geometry:{type:"Polygon",coordinates:["@@ΩພԭͺQȰۉԄóنԮҶȢۚƃߠǠќࣶͺךĵ}ы܊̲ÒljпЫMϱ̆ȽōܫփхDŽқѤaɄЍ͊ſ³٥Хʋʵˏֽ͓ĘΑïΟЧț"],encodeOffsets:[[9710,31035]]}},{type:"Feature",id:"TUR",properties:{name:"Turkey"},geometry:{type:"MultiPolygon",coordinates:[["@@஺͗ঐżܤõলѬࣆ¢ߴЭƜ̑ăУزȻͨʕֻʇˀ५ǏʻҠڧЕƙ̏Ɋ঍ňίŽॗŽҏbॳ̿ەEҁǀऍɹ˝ǐ¯ҷɣǿɣǿ̱Ϡ͈͂ԟí۱ȖֿәౣĥڹҊࣟ†ȗΑׇij߻҄ࣻeӽ࠶ؗҰЦٸՓВठߨಒ’Μྀٔŏ৞հ঒ʄർlุף"],["@@۫ҏ˃Ϻ\\ǦȦĦʺՂХɞࡦ˄ܤőĴ͓ܼ˓Ƶȵি±Ωʷ"]],encodeOffsets:[[[37800,42328]],[[27845,41668]]]}},{type:"Feature",id:"TZA",properties:{name:"United Republic of Tanzania"},geometry:{type:"Polygon",coordinates:["@@ƚġᵂႋÌӣ஼࠿ϱਙ¸Ӊՠ̩~ɓɳԓ¶ʭÇГ̌Ճΐ̰ࠡǿڝӣࣿ͛ԋb̙ʥבsɕŃঢ়ʂكåɽଢ˵ϺǛɶࠗƾӉʨՕƘͯƘΗɈґ੖ӣҺǗӤČѨƯޞΎ ̨̦͜ѬȺǮS˘ǷȐ·ͨʐł¶Ӷͫӄ̎Ķऄ[ႎà"],encodeOffsets:[[34718,-972]]}},{type:"Feature",id:"UGA",properties:{name:"Uganda"},geometry:{type:"Polygon",coordinates:["@@ः\\̍ĵԇʷȯĐPوȜ͎²ڬǰϸ͎Ѭ͔ɠ˒̘͵Ŗ¼চΌɮՖȉڰȠעEԬϮЊ׍İсτ९̧ؓЯ֋ʉͽTࢹႍß"],encodeOffsets:[[32631,-1052]]}},{type:"Feature",id:"UKR",properties:{name:"Ukraine"},geometry:{type:"Polygon",coordinates:["@@̾“ɄȒʮ¥ࢌĆ՞Ӈȿǝêʻڠ£̘ηkǑ੪̏٢Ƅ԰ϿӮVఊ˙XʙͿѯȆҩƃ˩߻Õџɻύڡã֑˕޽«ܣ̻¸ԹЪȭࡨ¼Ǐ̛ँơଛӟұǠȄЂࣽʘƨLjߪ˪ʑȔಯɆË̼ީĻ̷ҧٱةϟƠЁƉϑƺɂĞƦ˾ɲˎÑƮǬäĊśӸ{ɞØƽĎÐŲ̉ɈŧΘ̩ƐÒ˶ϝɦΉŽأʾ֑ĉȧŭΟ@Ƀȟاă˹ŹϷȴ՟HԳĢγǵÍɤұɮǐͺɸɔȀµɑϘބۦиİĜɾхܼДҢɪٲnࡖßबȫڎi͂ŧ̀Ʀɚȝݸ¢ͮąÄцʶȂܞº"],encodeOffsets:[[32549,53353]]}},{type:"Feature",id:"URY",properties:{name:"Uruguay"},geometry:{type:"Polygon",coordinates:["@@ղĚࡆٯ̺|ࡺ՟ڈҫӠֱχЉɸӇεՇॉұاǚғěޥΰ֫ԟҬÞլǾȈS࠸ɤࡺȾڦ"],encodeOffsets:[[-59008,-30941]]}},{type:"Feature",id:"USA",properties:{name:"United States of America"},geometry:{type:"MultiPolygon",coordinates:[["@@ũƕȽŤ|ɾƓ̨¦ĤƤƎÍǔ¸þÜe͐ƙƬñƌőɊ̍q¯͟ǵˏſ"],["@@˭ÑƟǮīèQÀĈî̘āɘŹëĵ"],["@@ĝ҉|Úĸа•"],["@@­µÓŻˆŃȒ’ɤŚêÃʐ˥"],["@@ıĉ˱ƴªÖŸĈȘijȝ"],["@@Ƭңʼƛז½࡬ƅࠂʹڼŊਖɓ˞Tݨʄ߂̧ࠒ͗ں˩ٶˏĈəȢĉ½ĉɦǎĔ¦ȣǜƅɴ@ŬĹĽƫ࢖ЁǶށǚܳʗӹЁҥȁ̍mēĦť˸Ɓɂ@ঊ҆ࡾƀસмfĐ÷ʰƉǒϜƆࠜHޘAˎ͞ŀàࢶ؄ϜƸ౦N໾BĎȺː¦Φž̖Ϣʲٺٚي˨ə֜ƜώʏAଧռӅƢ˝࣋Пࡷ̃ࢱʝѻӿƛȋSѽˤѽΒsė̬ʦȇãʇ֥ƋЗhةƥλ¥ӥ¥۫ʏఀǂʠǃ୳ʥ՗C|ĺʭɷʚǹ׽ؑ٧×Ɏȁª˟ɀǪҍȼƭ^ͅˏ͛ҿڡûʺֲѕ͎įۦljεǴՑևƀׂ˓˜ߛʊÍĖ̃ŠࡁՕدࢇʝցӱнÁэ̱ţ˭इձӁЍЅӽŻׯƪ׍ˬܗώשLεЊঅ֥—͛ȿԡʣŃЯĺƁς͋ȖѻܢϹٞű͢Ǥ֐ɽҦٻ۲͟źࡑϡƭ¦СϼՃȺोŁݗĤٙÍΏſƲɟaͽǴǓLJō̵Ů́ǃ؍€طѺܻĿ؏ȚԹÏۻȝއح࠳γҝБȕϗUׅ¨ЕDŽ˹͝{׭ȂٽʺɽЄȁטӷӐ̃ӰуֺףͲۉgՉڑۣʦѡʪȽҦ˧Ѯӿτїˈ̩̖ป@C΋ڗ@ဩOቿפ౓ТĀǒ੩ĝॕÝƙіխӚϻĴğʌһ¦̝ɪޭĊɉƌĹҢࠁࡊ۩ୠˆȚχˤٯ۴řۆ҃ҞȀۢ…ܜˍ٢͠ߊĸނĺނƱૼˇܘʓ϶ĸǐ௒˷҂ߋȺɜƇې˷ێᛸ@᠂@ࠜ@ᢢ@៚@ᡀ@ᡄ@᭰@ᮞBაAF͔˴J"],["@@࠽͋ѕɐŽЀބ̘҆Ÿ֐ÉΤʻܫЍ"],["@@ԧŽսƾԛɮࠦƞښùĂ͑"],["@@԰DžԾĒڸɛ࠲őéĝُDZٕǾ͋Ʋݍµȧôº̈́"],["@@؊ϛώnjහ»¹ȕ౾ƛࡨČᄚ˅ྤā٨ʼn૦Ǝౢʧࣲŝ@@MᷱIⷍࠠ{ࠌɵהρݜցࠈҺࡈ˖Ҁѡ֤·ޒϙՂ׽࡮य़ේ՗xՋұЙҥ͂ݍˌʃܺએںҍߎ߯Ä೷rটʌ჉ࢎߩDŽ฽̜୑í࿻ϬৃΨटǯǦ׏ҫÁঁǫ݉˱झdzťӶϚࠚࣀʶɱɂੱҵֵ֑௅ױؚСߏ׿ࣗΗࡁʱȻωಽѡ˅ϿছΫֽÞ޷ɻ࡝˹ۧ˫෹ʉſƘऀϾࠔʸࣆҠਬĨвΈ୘ԊȈǚب̒ƢْђӸॹʫ˓Ơҕ̧շюɧ̝̽м࠿ͳԩBïԄƲ̮ե̚થLJ܁ЀַȬIӈ٩Ϊ͘ӘۆҸ̚њںÖ־ƇڴМ؎ï٘ʼƻϨҹưج͖ԩWࢻǽʯȃڏȄஏĥ௷ȬΛ͸੟Ӧ୾ΘመШ۔@ŕнᄢŽڽԶਕ͌ױр߫ΨଽˈҺѲ๰‚ਗ਼ϦȨФ࡬ЎࠊĪཪώޜÉಐ҄ౚǭ"]],encodeOffsets:[[[-159275,19542]],[[-159825,21140]],[[-160520,21686]],[[-161436,21834]],[[-163169,22510]],[[-97093,50575]],[[-156678,58487]],[[-169553,61348]],[[-175853,65314]],[[-158789,72856]]]}},{type:"Feature",id:"UZB",properties:{name:"Uzbekistan"},geometry:{type:"Polygon",coordinates:["@@xԦૣά࢝ЪշЄ॥׈Яࡾ˭ƴࣥ͏ǤěڢଅѺ۽ӥܕ́Ɛхॅ[ᶾᓘӺƾïದ׻یͅߤݵঢŪ෸à৔ؗÙࡅЦMǢۍ੬ɲЉ̺Lπ׺૎הӖƺʠĉ۵խئ́ײȾ়ѷ੽؁ٕĊ΍uţɺǪ϶૱țˋաЋҫۭ ɓυؠȧǺصҿࡗهǰҳN"],encodeOffsets:[[68116,38260]]}},{type:"Feature",id:"VEN",properties:{name:"Venezuela"},geometry:{type:"Polygon",coordinates:["@@yȣӱĭ˜ϡYѭυӥ͆ڙδÆȌ؈ʻ̒§َਸ਼΀řІ̎ˆ̞ןל_մҵ˧ݮQ࣌ĔӖϕٞĻҼʾXɄਨ¼৖\\܉ʛ˼Їڦ×ِЯƆڧѬn͢ȣڕӱó̫˾̷ȽƽԫƉjϱɫɱّ֪Őʁ̭͍ऱ̽׿Žʏȣڛɀثņƿýϔɑ‘֝ŜՉ܆ï°ǭ׷ʅĭΣΉƏسȝNjʱٷÅҧѼʯ࠺ɟ̧̌Ȅюм…ȊʅʠǛ֒à׼Ȉ˰ƲҎ̓Ơӏĩ؁®ͻęסܢӥńઉăȧ̊ȷê‡ǬĴ̶áͺȃȂŅϮѡÈɸӮĺ׶ʔ̸͘ʌɈрդƖ"],encodeOffsets:[[-73043,12059]]}},{type:"Feature",id:"VNM",properties:{name:"Vietnam"},geometry:{type:"Polygon",coordinates:["@@૭ܗ۫ߍȁ׍٠ࢭ޺ળނԱԞګϪ།ŕ๓۫փ१եۇ۫਷ޱ̧ՠʀ֬دӌܬ͸ࢦÔσԚප٨ļ৖ț֖ƶࡀɃצٍאՋ݌ۥ঴৓Ԋʊ̠՞ɘ͙ܺਙPϕކӭڐҊȴڢIࠈĬܒ҄К̿ސƵƃӛАͿࡎɓ"],encodeOffsets:[[110644,22070]]}},{type:"Feature",id:"VUT",properties:{name:"Vanuatu"},geometry:{type:"MultiPolygon",coordinates:[["@@ˣō˭ςŒɤՆӗ"],["@@ƌڱɥŀǩ­ťɴi٢Дʵ"]],encodeOffsets:[[[171874,-16861]],[[171119,-15292]]]}},{type:"Feature",id:"PSE",properties:{name:"West Bank"},geometry:{type:"Polygon",coordinates:["@@@ԣŭʙЃŕ˜ɜɌŚɁĦǬ̤֔ś"],encodeOffsets:[[36399,33172]]}},{type:"Feature",id:"YEM",properties:{name:"Yemen"},geometry:{type:"Polygon",coordinates:["@@؉ɥNjύo˹࠷Οഇϻݩףυ±ʥºӭΑ՗lj۷©ɃµǿɛəÕŻɇеlˍœ׉¨ɓӬzҠƍʜǑتʋΊǚ¤đϨĸNJ™ξςˌđΠɞЮΊɓɬúॺnƸċ߼č͐¨ɂ˫ϺƖ׼ࢦ޸Ϛᝒ͒ڀ൳˞ח"],encodeOffsets:[[54384,17051]]}},{type:"Feature",id:"ZAF",properties:{name:"South Africa"},geometry:{type:"Polygon",coordinates:["@@ǏŧΣяɻћӇ׻ोࢁףԋًϣ࢛͙ѓ«ŇɷԛŰеDž࣫NJԙĹΏ¬ࡿͩܓƃԱͅϡoΣ̚˳fαϒŸśŏɦLӰ˙֞˔ƴs٤ս޼х܈AF׽તДдͪɯƘΫϘÓՈǃҌÖݤіB᷌ɨűӾߙûԟȈ̏׼ĒрϒЊʨȶДЦȚΠķВɽۂ£՞ȜĐʾƨДҚäʨ͂˪֔ݮغஒؤ΂UОƛ˲Ķ҂ċД஁ɔׯƫऩî̟чƶʏÑāʓɯ̿T̃ԆҕӮĜǢώْQȿؑıۥɑϛֵщ","@@νʶϻǟҕ҃͡Տـ٧̜ČƺˎҴƀƜ˜ʴФ̅ʪ"],encodeOffsets:[[32278,-29959],[29674,-29650]]}},{type:"Feature",id:"ZMB",properties:{name:"Zambia"},geometry:{type:"Polygon",coordinates:["@@ІϏɊ܋ƝɩǙڻLjۡ˃̇ʭޭѶɓᢇۗĂׯٍřӍͯĹ̛̅ßܵۓҭխ˳o˗ĬऱĠƯÚOêͧȎկ¶ۋȑչԾ֣یžᦶშYí̂Ű̀ƧЀĪТėʺ̂q¶ʽϾrՖûˬϡڨŝԤˆȌѯ٠ş̴ΧΈҥ٠Që࣠ɱƳח͞ɧƬļࡈƬসȉψʈ՚ɤĶ଀ƚͦđΘɇͰƗՖƗӊʧ"],encodeOffsets:[[33546,-9452]]}},{type:"Feature",id:"ZWE",properties:{name:"Zimbabwe"},geometry:{type:"Polygon",coordinates:["@@ҁČ˱ĵНƜ΁VՙϞٯźʙՒC̒έĞ्ई˃ӢǛƮ͓ڤलğ˘ī˴pҮծܶ۔̜àĺ̆ӎͰَŚÆ̻۬hϴǯǺȻАÓѦˑF੟Ǐ׋—عƊʝħӵŵùɛ؅ࢫ॓"],encodeOffsets:[[31941,-22785]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/xiang_gang_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"8100",properties:{name:"香港",cp:[114.2784,22.3057],childNum:1},geometry:{type:"Polygon",coordinates:["@@™@}ScTʟ@cWuJÁ–]„l¦RLj¼BĄà˜ ŽH@TOHCTDDDHDNAT@PEHDDNJLX@BABALHFF@DKHADBBLDHHFBLEJB@GDBBFBADDB@@KFAFBBJJA@BB@@FFDDADFF@FADDDBJC@AFBD@@DDD@DAA@D@DB@DHHBFJBBFEHDFAN@DGDC@DLCBDDCFDlAFBFCBEF@BC@GDAB@FD@DZJ‚X´HĐMja@Ý`p_PCZ@lLnRGSDMFK|a\\Y}­ƒ§™Mën"],encodeOffsets:[[117078,22678]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/xin_jiang_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"6528",properties:{name:"巴音郭楞蒙古自治州",cp:[88.1653,39.6002],childNum:9},geometry:{type:"Polygon",coordinates:["@@˜@ÈÒĊanwŎV„™Ȯ¦ͪŃĢ„ÜōȂçČéƐżLɆóĊ‚ĊaʊŁ±¯²Um»ˌmÈ»V™ʠţWÑůǓ郙ôƑƒğÆīŎī@Ƿ™wô™˺LÞ¯ƨVǪуšĢ™ȘV°wĢŽôk°¯ƒ»΀@Ȃ»ĸŽǔ@΀ƒ͔ôôLɆó̐ÝɜLɲōͪƒƨóŤK@ī@IU܃ÛmȻţǩÝ˹ÛljťǓǫō@Ɲ²¯VçōKͿŁΗÇţ»ƽ™ɅƑLÓŏÅÅɱV@ÝĊU¯ÑĊĭÞLšÞŎJ±̃XȣˌōlƒUÈ¯ŎKÆƅ°™XÑܱnŗġV¯™óaUƒƧUōŁ„Ñ™±„çɲ¥lĉkğ°ƒk¥˜ƒnğţL¯ÝÝUƽĬ΁lķ°@„ō„XÿݯV»ŹLʉÞɱŤĉó°ÝJ™¦ÝKÝ£ţܙÈĉ@ƒxǩUċƑ@ky͓¹™`U²ĉVġ»ğa¯¥ť@ĉ™‚ó@ŻÛÛJƒw¯nó¯ġWƽʩķÝɛwĉĕݼȭÞķō@ó£Å΀ƑŽ¯ôȯÞ¯Ȱ™ÆōèĉXǼó@ݚnºƒĸ„ÞVƜĸȚUʶõˀĵĖɱŎÝĖVࢰӒѢ°˘nϚVˌ™ÈmɼĵŦW¤öʊõʔ@°ÈXVŽ™ènŎȁb¯ǫĉ„±Èğ`ġwōÔğ»mVVŽ„Ý¥ó@™ĸķô@ššbX„ĶmV²²`Þ_˜˜ɴbͪÈ°„ÞWĸÈŌmބškɲŽÈUÆ»n¼ǬVķĸźô¯°n¦ɄǜÈ"],encodeOffsets:[[86986,44534]]}},{type:"Feature",id:"6532",properties:{name:"和田地区",cp:[81.167,36.9855],childNum:8},geometry:{type:"Polygon",coordinates:["@@ƨ¥šèź٨ΘƑᩄbUࢯÞĕɲōĶĕöʿVʵķșUƛƒÝ„ķm¹Þ™ô@È»ĊWŎçšÅ°ȯȰÝ°óƒÆͿĉ»̽çnƒmɱĵƧºóU™™ƽ@±wóL¯°̻L±Æ¯Vƴķb¯VÇ¥ğ²Ǖbk¥ÇKlÅɱġ@у™óK@™ÇaÝXğţxĉČǫķê¯K@уaŹ„ƑKƒ¼¯Vóaónġw™óÞéU™ġbóĉğÇl¹™aUóğKW„Vůn›ÇŋƑ›ķnʇ»óxĉw™çÇ°Åw™°ċ„XŽ™„ób±ƒkÈÇJ—ƒm²ţx@ÒݎšŦǺn„ó¼n°ÇbUÒ±¼XĸĠłƽXmwĉºƒzÈÜmnxmx²ĖmҚbnŽƧêUºĊêÆVóĖóUĉ¼ÅĬƑ°ɆƆŻŚlłÞLš¼nĠƒ¼@ޙšÞź@ŎÞ°VšɄɴжϼِ͈Ŏ„"],encodeOffsets:[[81293,39764]]}},{type:"Feature",id:"6522",properties:{name:"哈密地区",cp:[93.7793,42.9236],childNum:3},geometry:{type:"Polygon",coordinates:["@@WnŐÆĶLĢ¦ţºź„lxÅĸƽŚ‚Ʉ—Į˜è@ô²ÞUĔƐńV°¯ĸX¦Ɛm̐bƒ»Ɇa΀šĢ™ƐLˤ™ȘÑnƒІljĸÿn¯ĶaŎ¯ĢĕȘ¯°΂œla¯¥™ǕǔwˤӱlťО̻nŻmɃĕċţUw°WUóƨÅţķ°ýV±óÅǓéʉ¯ƽŁƒéōǖȁÝƏůǕw˹ǫȗǓƧǕVý™é@ĬţLƧôͩ„ɱŎɛK̏ÞɅôóK@²@°ōؚ¼lŦ¯ŰóƜÛlV¼ķ¼ƒ°kȰ™Ű„ĠƒǬ™ŚÝŎmĖ`@ÇÜn„"],encodeOffsets:[[93387,44539]]}},{type:"Feature",id:"6529",properties:{name:"阿克苏地区",cp:[82.9797,41.0229],childNum:10},geometry:{type:"Polygon",coordinates:["@@VƚxˌŎÞŎƒ°n„ȂÒ°²VĊ¯VğƾˍǬƨÞÞKÈÞĊVźôɆÞĢèŌôWČ²ŤVÞĸʶbl‚¯ôn_VÆĸlmÞnVź_ĸ¼Ȯmǖ„šéĸW°°„ĸJ„kʠ¼Æw°¤ÈƒlxɆzČºĶI²ÆǔUš°ô@Þ¦‚ƒUnUĠ¼ŎÓĢxĠ_²ÇĊƒǬ°ŽȂamōšçUÇW@¯öʓõʉX£ĶťnɻšÇUˋmϙ¯˗ӑѡᩃaΗƒœɜ°xWƴUxɃÒˣ¤Ʌwğ„ʉōóÝŹ±°ȗ@¯„ƃ²¼","@@ō™гwȁ¥Ƨ°ŹÑķV™¼ÞêĊ»‚lĵšm¦ÅW@ĀôÈźaɜxÈbÞÆĶIОŘnIÇŃÛÝĊÑĠƏ"],encodeOffsets:[[80022,41294],[83914,41474]]}},{type:"Feature",id:"6543",properties:{name:"阿勒泰地区",cp:[88.2971,47.0929],childNum:7},geometry:{type:"Polygon",coordinates:["@@ɲˣĊIÈ¥‚ÅU±Ċýkō°ƒĉƽó»ĶƽXóʵʵ™ȯƑÅȁɅ¯ĉ@ÇሗK֛@@ˤV֜ʵрƒǬVĸƑŎ@ƆϯÑóŽķ@ʇ»ķ¦έmlÈĸĊX¼WźÛÞÝѸ‚ĢČþ„ĀĊôάVö¼ĊUƨ°°èŎČUÜƐóôVôôŽ²êȘlˌç°`n²ǬŽĊaš™ƒÛ°±kğmm»š@°ÝɆÛÅÇVaݍVm͔ğôÝÈb‚„@„ƒ™n¯š™ÜUĢÑĊ@źīżWŤÈǖWôŁÆI²ÓƨL@ŽĊX„mmÑÆ»ȰÑkƒĶō@ý°m—¯"],encodeOffsets:[[92656,48460]]}},{type:"Feature",id:"6531",properties:{name:"喀什地区",cp:[77.168,37.8534],childNum:13},geometry:{type:"Polygon",coordinates:["@@Č@°ƒĠ„ôÓô@Ŏĉ@Ƴĸ@Ť£ĢlVôWVóřXĉŤêÞ@ƐÒĢÑlèÈV@šĠIk°ÆŘ@ÈÈĀ@ǶťÒğ@š„@ÒĉlŻ_@šƧĖÅĬōÆ@bźÞnƒƒlVœÝĬšWƼʇ„ƒÝÅ@ÇÅÈwWóĉ±ğz‚ĬČƨƂÝIĉݯbÇÑĉƒ¯ʈV°xUŰĊ¤ƪ_ôÓɚI@lȚXȮ™ŎlɴȘ՘š„¦ɲÆʈ_ɴŽźŽôÞʊŎĠƒɆxˤ£ɄÑVwXƳ¯w›ɛŹ٧™çƧ¦ōƒُ͇еϻɃɳU™Ý¯@ōÝŹš™@݄»mğ™»ÝKkŁżřɅƅƒ¯ÆīĊ»ôVôĕÅUĉéV¹ƨém™anѱĕnwmwnÇۄyĉ¹ŹlŏkĵèķmōÞġKñÔċKÅèĉzƒŽ„ômxȗÿƿI@þÅČÝKÝ°@¼ÈVºš@ÅĢšÆUċłn„ÝÆǕČĵJm£ÝJ¦@ĊƒxV°ƏLċ¼ǩ™@™m@ÅĢómÇÆğ¹Çš™ÆšĖÞKšx„wô¦ÆÑÆL²ÆƾŽU„Ž±ŚÅŻĖ@ĬŤÈñ„@ǔÇx„Èǃ","@@VÇ™ţ°ğUĠ¯mk¯ó¥ķIġÿƏbƒ„ĉa±ÒĸĀlKU„_m»nwšŽ„m@ÈŤ¦ĉbÞ°±Þżł̦°ĢŁVé"],encodeOffsets:[[76624,39196],[81507,40877]]}},{type:"Feature",id:"6542",properties:{name:"塔城地区",cp:[86.6272,45.8514],childNum:7},geometry:{type:"Polygon",coordinates:["@@ήnĸ¥ʈ¼ĸ@ôϰÒ@ƅƒōUķƑǫʶпU֛܃LګK@΋ĸ@Æ£ÞġÅĠċšLV݄»™@Å»Ýnm¯š»nŻĊ@nķŃ@¯ómóÛÝǟ¯aÝóȭ¥ƒšōUmxĉbÇї@›bUº¯X¯ÆƧbVÒĉnǕw¯°ƑŽV„—ŽÇ@kx±Uƒšɱn™ŽÅKƒ„¯ƒĠǠU°ɜL@°ƒxnĬ‚ĀŋŎÇLƒŽğšϱÞέƜkôÅĀǕłƒĸĊŤUŰĢ°„¦ȂϰÜɨ°x@°żǠÆƈČVĠ»ČL°ÇšbĊÑ̐óÞlĶwބɆVÞwǬxǪţȼÜLŐĶˢ@","@@óKĵĀV͈ĉłƾNJÆŤƒzXl°ƒÆL²¼źŽôÈĢǔ™¦l„ô°ɜÞʊĠğŃm»ʵƳƑʝȗīV¥¯ĉ°Ñ@ŃÅI™»ĉmğn™ƒašƒċƨbš™Vğ—w›ġ¯@Uōa™ĉÝJğÑÆŎkŎÞĀlźƒ¦"],encodeOffsets:[[87593,48184],[86884,45760]]}},{type:"Feature",id:"6523",properties:{name:"昌吉回族自治州",cp:[89.6814,44.4507],childNum:7},geometry:{type:"MultiPolygon",coordinates:[["@@መL@È°ĊȂɆƒÆĊ£„ťôWÓɆbĢÅŎƒÆ¦ČÑW¥°ķU¯ƏŃVē±Ý@ó—ç˜ĭɃƾřÆķkwŹƒŤ¹ġ¥ĵKŏÅXmˍщwǓ¤Ƒ@wóōVķ£ɱšġôÛa±Òȁ„óèţIVŽƽ¼k¤ó¹ġJmx—»ÝUƒ²™@ÅƃĸǫŎ„ĊmŎǬ՘"],["@@Þô°bÞǠôÜôn@°ĸń˜Ƕkłƒ¼UޙKğȂÆÝĢŤķ@@ΌڬL܄K@ˣȂ˭lĉńW¥ĵVÆý@ŃÞēUŃȗƅ@ŹƩǕĉ»k»Ç™VğóřX™ŻKƏŽċêȁèÛŎġƒͩń"]],encodeOffsets:[[[90113,46080]],[[87638,44579]]]}},{type:"Feature",id:"6530",properties:{name:"克孜勒苏柯尔克孜自治州",cp:[74.6301,39.5233],childNum:4},geometry:{type:"Polygon",coordinates:["@@ˎǫĠƽ°UUĉ¯±ȁÑmƒ„¯Ýōˋō™wUű»ÅƑ°ƒȘ@²¯ɳʇ`ɱŃ¥՗™ɳȗōkȭšșW@kəJóÔƩ`ĉ£Vů¯wU°ʇĊ„ÈÒ°aĊÞÞJŁċƧīĠyĊ²XôÇxÈÆÆ@„ÞʈƒÅ»™XÞīU›Ƒkm„ŹÝ@aŎÅÆīƨĕ@™ż`Ċk@љƒĠ@ŦÑ@ǵÇÿ@ÇÅŗl¯ğJ@™ÇUkçġÒƏÑÝ@ţéWĊôŚUŽóXUġkţ¤ķ@@ƴōĊó@óÔğƒ¯„ċ@@Қ¤kôˣŰ͓„k»ƒKX¯ċwƧôğɐšÒôIVƙš¯UķǬķšnŽ™¼ôb°ÒȰVVÈÞ°ƒĸó¤V¼°„V°²êƒlĢ҂Uƨ¦ôȰƴĊVV¼ǖIċĊ„ÞɜéšnČW˸Ǹša„řÈw±īšçĸ¤ĊšôšwšŽĸUĢ¦˜éǖĬ„Āô¼lÞkÒ°x°ƆÞx„šÆV²ǔ»„b°wގȘ¥°n„šŎV@°„„ʠè‚ŰȂb"],encodeOffsets:[[80269,42396]]}},{type:"Feature",id:"6521",properties:{name:"吐鲁番地区",cp:[89.6375,42.4127],childNum:3},geometry:{type:"Polygon",coordinates:["@@ôK„ĉǪa²¼lÜô@ʠê°Ĭ™ôȂƒ²ÑÜbĢóɲ™ĸ¤ŎUô@xƒŽǔ£ъxˎmƒÈÛ@‚_nĕÞōšř„ǫƒğšůlȯ„¯ĸ»U»Ükôƛ°ůkť™»Ŏŗ@¯@±͓óͿ„Ǔ@ķȁ¼Ϳ@Ƒ¼¯°ólġ¯xȗUġšƑ™ǩÒƧUÝ°˹Kóššx@ǸōĬÅĬƑĠ󃄚ǔêÆ°XÒʟŤUšÇ¼ˋnn¼±V²°ȂUŌݜbʟǔɅô@żǬaҎÈ"],encodeOffsets:[[90248,44371]]}},{type:"Feature",id:"6540",properties:{name:"伊犁哈萨克自治州",cp:[82.5513,43.5498],childNum:10},geometry:{type:"MultiPolygon",coordinates:[["@@ĉ„ÆŘȁ̐mÞ¯ĀX°±¼@ƾ¯ƴ°ŎÝþŋ¦WÜÞbȂĉźUœÇmwVUȂóô@ȰÝ΀nÆJn™ƾ™ʠ™ŌLČóǪ¯œ¥ǔaǖšŌaôÝĢLšx„ƒÆLšɲm„™²VlwÈ@˜Uƒƒ°¯ǖxĊmUÑƨa°Å°WV¹œa›ÇɃÈm¥°¯ŹóĸķǫUm»Å¼ÇVɱ™l݃ŋnķÇÝX¯ƒͩÇɳa——Ý`±_U±ĵnWƒ™a@™ĸóšķ™¯ǓV±ÅĵJċ¹ɅykwDŽ¯£Åxʟ»ƒlķI¯ƒX¯ķ‚™êǕƒȭnķ»Ź`±„kÞ@Žš„Ýô@Þ°xšŤŎIƨÆUxōš¯²ǔĬǬlUŚ"],["@@ÞĀlźƒ¦¯ĸŤKޙšƒċƨbš™Vğ—w›ġ¯@ţƽJ"]],encodeOffsets:[[[82722,44337]],[[86817,45456]]]}},{type:"Feature",id:"6527",properties:{name:"博尔塔拉蒙古自治州",cp:[81.8481,44.6979],childNum:3},geometry:{type:"Polygon",coordinates:["@@ήƛϲÝĠ™„ÈKŌōÿmī„w@¯ɛKV¯ğǟ°Ƒ™wġKóÞŋbǕ™Ǔb›¦ǩ°ċôŋKʟšƽšmšÅImŽͿŽȯÞó@ȁôUVnx›ÈŹVȁĊÝabŻ£¯°l„óxȂŤĸkĊšÞyĊêĊmĢxV„ƨÈŽĠX„ŽΘÆĠÔź‚Ɇţ°LXƾŤŤb"],encodeOffsets:[[84555,46311]]}},{type:"Feature",id:"6501",properties:{name:"乌鲁木齐市",cp:[87.9236,43.5883],childNum:4},geometry:{type:"Polygon",coordinates:["@@šŽWŽôŚUĠȚl¼Ċ¼ƪǖ@źȘƆ@ýlܚXVŘޙš¦V¼kĖó҃èkĊȁˮ֜@ǫ՗nōƒĉǬō„ķÆŚ@„±ÞV˜¼nwĢIôºl£ƾ»UŤJôçšó¯īʟéó@kÛ±»ǩbƒĊóLҍÇǫb@ŻɆóʠǓ›aŋÞȁVʉłĉbĉɅô"],encodeOffsets:[[88887,44146]]}},{type:"Feature",id:"6502",properties:{name:"克拉玛依市",cp:[85.2869,45.5054],childNum:2},geometry:{type:"MultiPolygon",coordinates:[["@@ɜÞʊĊýVaŃm»ʵƳƑʝȗīV¥¯ĉ°Ñ@ŃÅI™»ĉmğn™ƒaݚţL°ķóKĵĀV͈ĉłƾNJÆŤƒzXl°ƒÆL²¼źŽôÈĢǔ™¦l„ô°"],["@@ƾIŤ@UUwōa™ĉÝJğÑÆŎkŎ"]],encodeOffsets:[[[87424,47245]],[[86817,45456]]]}},{type:"Feature",id:"659002",properties:{name:"阿拉尔市",cp:[81.2769,40.6549],childNum:1},geometry:{type:"Polygon",coordinates:["@@nIÇŃÛÝĊÑĠƏō™гwȁ¥Ƨ°ŹÑķV™¼ÞêĊ»‚lĵšm¦ÅW@ĀôÈźaɜxÈbÞÆĶIОŘ"],encodeOffsets:[[83824,41929]]}},{type:"Feature",id:"659003",properties:{name:"图木舒克市",cp:[79.1345,39.8749],childNum:1},geometry:{type:"Polygon",coordinates:["@@VéVÇ™ţ°ğUĠ¯mk¯ó¥ķIġÿƏbƒ„ĉa±ÒĸĀlKU„_m»nwšŽ„m@ÈŤ¦ĉbÞ°±Þżł̦°ĢŁ"],encodeOffsets:[[81496,40962]]}},{type:"Feature",id:"659004",properties:{name:"五家渠市",cp:[87.5391,44.3024],childNum:1},geometry:{type:"Polygon",coordinates:["@@„çôÑlĕU»™¥ÝšUŗ™WkÛ@þVńÝĔ@ńÅþĶUX¦Æƒ"],encodeOffsets:[[89674,45636]]}},{type:"Feature",id:"659001",properties:{name:"石河子市",cp:[86.0229,44.2914],childNum:1},geometry:{type:"Polygon",coordinates:["@@lŁ—ǵm‚ĉ@mż™¼n°ÞmƼš@"],encodeOffsets:[[88178,45529]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/xi_zang_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"5424",properties:{name:"那曲地区",cp:[88.1982,33.3215],childNum:10},geometry:{type:"Polygon",coordinates:["@@ƨʔĸbܺÞwnxźbÞ°ô@„ĶŽĸIȼĊJŎÈôUšÝƒ¤ǔLސŎ@ĢŽȘblƒôL„ÇźçȤôLš¥ÞIÞ¯Ķxʊťƨ™ƿÑĉXVķŦ¯ȂKÇǕšÑ¯IUš£¯Óƿ£VĕōÞÿÆwƒƑ„£ǖxÞĕ±ÇÝaUÑȃU¯‚UōÈ݃wWŁĵ™±Ý„óĢÿ°IÞ±mÅĢ¯mÿ„¥°UnÑŤĢĕĶwǬŻͪwŎ¼źÇĢ„ĠĕˎŁ°óƨ¼Èa‚m@¥°wǔ„ǖ°ŽƨÇŤœšġƨ„ŎŃôbÈÛŎĊ°@Ġw²ÑÞJƃÆb²ƒ°êĊUނlȲƒV„ÈKĊÒĸĉ›»ÅôťUÅǃk¯@ǂÑklǁÅl™Ģ™VÑóƒ@°@„ÛĸƒV¯ƒÇĊ™n¯Uĕšƽ¯m›¯b™È@Ò°Ĭƒbĵ›¼„‚kxķýÇJk£ÝaUÑÅóĶǟkÓʉnĉƒÝ¼Ƒ„ó»Þmn£m™Č¯@ƒȮÿV¯ĸƒ™k@Ýówƒ»ğ„ġ±ǓLō„ƒšV¼Əèķĉ™è±b@Òţ„UÑóakƒl£™Ó@¯L@™ÇlUóȁš¯aġÈÅĕÝLķ¯Ė¯@WĬ—x‚ÒÈnW°ţôU²ǓÓġ²V°¯ôƒǔÝL—ċšk™š»Ý»Ýš¯ÞƒVƒwۄÝÇōͩÈĉċ»ĉm¯£W¥ţKkóġƏW@¯±kōŽÈ›b@җšÇaƒÆ¯a™„ƒkóŽÛƒÇ¦Ýa¯šÝ™ĉ@ǻۄmƒǓxķƛ¯lVĀÅÞġb™™ÇJUÅV™ĖƑW™zō»ōšƒW™n@è¯ÞóVkwƩnkźÇބҙޯƒƒýğÇUxÆÈnè±bĉÝ»ÈуwšwÞ@m»ÈV@ýÇ°ķ™xƒa„ݯXċ¥ƒÈóW@ôkxlnxVÈóĊkŤġ¼@°¯ŰƑL̻۱ŎÝV—Þ›VƒÇÞŎÇakƞ‚š@èğŎĸżšƾ°ÒšLÞôĠKȰĖźVÈÒĠ„¤™VôšŽU„ÈþťL@ôǬÞlÜÈnÇÒUŚ™@šĊƨW°™°Xƒ‚@ČÇþ„ƴĉÒķ¦@ŽĢôWĀôłUÞĢǬ™ź°¼š@ƒôV°„bUÆnzm¤ƽĸƒÈ"],encodeOffsets:[[88133,36721]]}},{type:"Feature",id:"5425",properties:{name:"阿里地区",cp:[82.3645,32.7667],childNum:7},geometry:{type:"Polygon",coordinates:["@@„Çƾķn£myVŃaU¯„ó™@¯»šŹġǫVÝóŁXÿġó@ĸ¥ĊуƳÈý@ċ„Wš¯X¯ĉƧ‚™š@VřÈÑÇmkÛǫÝ@óŦKÇýVƒ™U󚏃£ğÇÑŹUȯĕğLÝó™K¯Ñ™ƽķŻĠō@灙lƝÈbƍÈ݂„œU˜ÝÞU²ō̼ůƒK°ů@¯UK±—ĊƧbōÇmçÈġƒóšÅób™™źóš¥kīƯól™ç™KôĵUƒÅ„VŃķ¥nÅŏm¯¹Å‚™»@ÑǍóxÝkʇȤU¤ķb@ƒ¯ĊÇx¯ĸĉKm°šĀk¦l„„KnĬȀƾÛ¦WÆŐmNJĉ°ōUţ¤UšŎ°šŎKÞłÆ„Ǔ¦ƒÞ™‚™„ř¯bmUÝl¯Um™ğl¯£șwŎǫaÝnĉĶƒk@¯™K™šō»ĉn™aÞ»ťnkml™ĸ¥UŚŻkÑťƒĉV™ôó°LôīĠU„ÿĉǕÅz±Kƒ¤„²ō¤¯Ė¯UÝ¥Vĵ™óÈťÝwķșÑk¤ó„™ƒWýĵĕ™„VĠƒV󍃎Ǔ„ķ°k±VU±ţ¦UǟÝřJVљ¥XUċUŎlÛƆǕÆȗƆ¯wŏÞÅ@™šĉl݁óŽƒÒ™nUôńlxólÝôێ±™™LÛôÝL@‚ġ¯X¯ÇUżóa󤛼XÒġŎóLk¦‚ôżĸĠ™¼™KġƆô¦„ÆƑÔĉĶ¯ImÒ°¦n°¯Þl˜ÝČn„ƒÒšKĠޚĕkƒlýƾťœšôI‚ĖŤÒnƜm¼¯lnżóÞ@Ůó¦™ôƽĖċŚn°Ý°ôÈUƜƒblÞóŽ@Žǖô°UÈƆ°X„þôŽô‚lѢšŽ²Ėm¦°š@¤™XŽĊblܚzkºƒĖmX„šŎWVšóÞn°lĠxȚa°»żLźƒ„b@Æ°XĠÝȚxĊĕŤaȚ‚°È@„„@èŤ¦Ü¼œW˜ÞkŽÈ@V°lŤkŎ±²¦ƐUšlj°aÈÑŎbĢƒŎbÆ¥ÞIȘlššôVÈU‚™šb„kɲĶn„mnXb̼òƾĖŎ@ĢȂÑôÓĠĖʊšĊÔ"],encodeOffsets:[[88133,36721]]}},{type:"Feature",id:"5423",properties:{name:"日喀则地区",cp:[86.2427,29.5093],childNum:18},geometry:{type:"Polygon",coordinates:["@@ĶĖXþš„ôƒl£šÒĸÇÞxÇŦšôUĶÞ¦°V°ĕŎ£ƒ±„£²LÆyĊǖƒĀğVóĬ¯KóôUš‚ĊŦ„lҙżVÆķ¦kšlnŦmݼšbĊmŎ¼š™šL@°„lĊĵÞmǬbƍȚx°¤Ġknš°VÞkVn°aƒŚš‚š„Ýǔ¥ÅƒÝŁōL¯™ōV™Ť£ŎVĊ¯nljƏXÅÜ¥ǿƽmīƒLkƒl¥™ÿn¯ĊL°ķÈw°ĉ@ƑĸaV£ʈȣÞlôwȎ@Қ¼Æ°ºŐnmÆĸ¦UńƃV„óĶšLšèôkÅ°lĬ™¦Źôššôa™Æ„ôÇĢnèŎÈƨa˜ĉ²‚VLĢ»lţôĉUǂwkmlw@óôX„ÇȦ°WƒÞ„b‚wĸšÈ¯@þÇUn¼Ý@™x„xÇńÞ¼ĊŽ²amçÅÇVwĠȄþ°„šÝƒÑÈÝlŹƪmlxôU°Ý@çšm„XŎ™Ŏ¼šyƒXšĕÆUVÈIššĢaÆÝUÿ°kĸƜǔwn„܃ȼĊ@ޚ°™Þbȥ܄ô„lšƒ°b„ÅÈb˜™@ќa‚ǯUU¯Vġš»ƒ™¯aV¯Ç°Å™mnÑŤçǬVǬ™±ĉ¯¥Vĕ¯Ýk£˜ō—w@±ġÛ°ÇVїƒ@ۘa@ČL™Ƴ™„ƒÇa¯¤ÝIĵ¼U¥ƿōķÅţŻókÝóĕ‚¥¯™U»Æ£X¯ġŃÛkÝ°V°ó¼¯èWôÞĖ„ȎƒŽkĀƧĀówm¥¯JŹÝJݙōVVŁaݐƑ@ƒ˜ğŭǂ¯_ƒ˜ĵ—›VnxŃón›ƒĵxÇĖĉVÝÈğV™Ò󃯐±Żĉ£ķÆÅL™Ljĉý˜ţۃ¯VƒnV¤ÝÈ@°ÅÞݤ™ŰğŁm¦ÝxóKƒ¥ɱÈUĠôêVôÛ¼ÇWÝçĵaō¦óĖƧlÇĢƑŽnŎDŽV¼¼‚ºÛ@m¦ƽ„ĉmm¯ÝKÛç¯bŏłĬ™bƒ¼ÅLmŽ„xť°ÅU™šÝXkŽÝmĉ¦W„¯K„ÒknÝaV„Ýè¯KɅńÝKnÞ¯¼"],encodeOffsets:[[84117,30927]]}},{type:"Feature",id:"5426",properties:{name:"林芝地区",cp:[95.4602,29.1138],childNum:7},geometry:{type:"Polygon",coordinates:["@@‚VÈłVôÈk@š°K@ŽšÔk¤l„ôbVÒŤƒ@ѲašçĸĊƐçU»„™ŎƒǔKĢ²Ġƒ„¼ôx@ޚlƨĬ„Ul¯ÈLV‚šÞJ„°Ünʊ„wÜbXê‚VÞ¯°ššanaU°wƼɴÑWÑ°mÈýÈam¥Þ£Ť@„¥ôblÞĢ„ź¥ôxÈÅmݚ™ƒĕŃV»ĉōŤōnóƒ»ÈīķIUƒĠÑ°ġĸLÞ¯VÒƂ@Ābš¼WôÈ@V¼ôóŤKÈÑU»šwVǫżnWÒÈx™¼‚lŦ£ĊōŤx²¯@ƒÆƒU¯šçÆ@„¤°£„é°k°lšůÈó@¯ŤÇÈĉƒkkÿó¥ÝXķљÜ@ÒóŚÝ¯°ĉówÇ±¦ÅJUÒĉĀķw¯°mĖ¯„±akxÝÅnƒ™»lуK@¯lU™¯UVѯóĊ¯mōğVǓƅƒÞƒWÝÈÛ@ƿô¯ÜġzÅþ¯ólmôʇġĊÅUͿřŏȁˋŁóÇˡōƧƒÇb™w°Ķôk¦šÒƒnUþġҙÔkǔķèó@ƒ²@ŘōńĵyƒzġaݤÅIƒ¤Ƀť¦ğѯ¤ķbóš¯ó±ŽU²°¤ČÜVnÈƂ„ŚŎ°ôĢ„þÆzèVĀǎĀǘƒXŹÑ¯¤ówċķk¦šłUÒġzÇ@ƒ™ÆÝx@²Þ@Ƥ„Uô¦Uš°x„U"],encodeOffsets:[[94737,30809]]}},{type:"Feature",id:"5421",properties:{name:"昌都地区",cp:[97.0203,30.7068],childNum:11},geometry:{type:"Polygon",coordinates:["@@™ŽVĖm°ĉš„ÈU°ķ„ƒÜ¯@@ô„UÒġškš‚ÆkÈlŽÒ@Èl°È„VÆóŦƂœ¼‚a„ÅĢ™Ʉwnōw@¥Ŏ¦°ŹÞmVš°wnÿƒw„wÝw@¯šmÞŗ°wĠ˜ĸkÞğlĔ²¦°@„ĕĸwVóšal@nĢÇĊn°@¦šŽźUXçǔůĸVš™ÆK„ÈÝĠš²ÅĔô@lšŽÈ_m˜„zǖl„šaU¼ôwV°¯¦‚ĬÈa„l@Čǎ„¼™„nŽ˜I„xô»ɜ@ƨ¥ɆŁ„ŃǪȁkƛƨȍʊȡóĭ›@—ÈÇVƒůރĸƅmēƨť™ÅÈʉVǵ°ġVŭÅɧ°ÿnɛš£mƒķ²ŃóÑUĉ°mÇ»¯@mxUĀ¯èţ°ȁÝç„ġU¯ÆÇţÈ@°Çô™Ű¯k¯lƒê¯¤ƒ£Å@™èV°Å„@„±°ţwĉŎť¤kš»ÇwXÑŻmUǬ™xV¼ÇÒţLóôU»Ç@X󙻂a@ÿŁUÑÝ°ķK¯ĢğÒV„ĸJÇĬ„¼môţŎĊŎU¼Æ„„Ė™šnÞÇÆówŹ¦ġƒkÝóaƒ¦ţ@ݤn¦ÇbÇþ¯nXÒɳÒÅ»¯xVmb™b¯™Ý°UWéÛaƒxʉÛmƒ¯ÝI™‚UÇKk°ƒVƧīķ„U°ȭĀ@„ċ°nšm¤Ýnô¼ƒƒÞ»Ċ„ʊmlÔĵǠÆôVÒÞbl¤ÈIĸþlwƒœ»ĶŽ„a¯ī@њǰanœƾ°"],encodeOffsets:[[97302,31917]]}},{type:"Feature",id:"5422",properties:{name:"山南地区",cp:[92.2083,28.3392],childNum:12},geometry:{type:"Polygon",coordinates:["@@°ÞUĖ°¦²ĊôÇÜLǖĀɜŽȘŰÞLĸźêÞ@UÜUŤ°ɞ¯Ü„°WŦĀmŎ„¦ĢyVљŁl¥Čĸôx°£źÒ„Wȗ‚ÿȍUÿ‚çÅyƒýóġō¯ƒřŁmÇÛUċŽ¯£V±²°ôô™ĸa°£ĠÒŦ¥ɄŽ„£ÆJÞ£Ģb„yĶzŎŃ@ŗ„±ô@ĸçlǓšÓĢÑVý„m™Ñl¥ĵó‚¯̻̥™ƛǫÝһÇƧĉyţ¼ҍēVĶĉŎ°ĸmšÞVÝĸ™ÒÛaċ„ó™ŹĖƒèÈÈl¼k¤ÝX@`ސŏ¼Æō¼ÇçĉKUÝÝ£ğ¤@¦ġl¯Òġĉ¯óš™móxÝÞğVšƴċK@—b@ܘ„UÒ¯ÈĢÜ@²˜x—Ŏl¤"],encodeOffsets:[[92363,29672]]}},{type:"Feature",id:"5401",properties:{name:"拉萨市",cp:[91.1865,30.1465],childNum:8},geometry:{type:"Polygon",coordinates:["@@Ŏ²l@°‚XĢƐlôŤLX¦°¤ĊnČ¼ÇĊŎͪÞÈ܃„x„U°Ýޙ޼™¼lšČ™˜ŽÞK„Ǔ°óU¯Ģ±ǔÔV±ŤóX¯ÇmÑ˜wXī°@°ĕĸÞKÆĖĢÇ°bȂ™ÇŁUƒV¯wV™ó¥ƒVÅ£Ý@@±ÞwšÅ‚„È@ƒ¥nōťÿ¯Xۃɝ°ţ¯ÛVVÝ@ŹéķÝKȗůɛǕÿÛKóÈǫšǫUţèmҚn¯Æ°ÈU‚°b„š™¼UĢV°°V"],encodeOffsets:[[92059,30696]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/yun_nan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"5308",properties:{name:"普洱市",cp:[100.7446,23.4229],childNum:10},geometry:{type:"Polygon",coordinates:["@@U‚ô²‚a@Ž²²Ķ¥œV°šĶ²bl¤kVxl‚@œ°‚Ś²@˜„„y„@ô¦¯„@xƒxVxU„VššbVšÜm¼Ŏ„„ĢmºXXWÆ@ĀœšmŽmXU°ÅÒm¼Þx°w„@°‚XêĠ°»nV°U„l@k„@V±ôī@£‚ƒČŃÆ£„KÞý@¥‚k@y„a@—nWV„UVƒšwƒmƒ£Jƒknm@wmkn‚X„˜šX„¥mUUlUnbš¯°ŽnkƒVInlIUw°n™mk@@mlanXlanmšk@wVWUw™_@éĠašnmUaÜ£ƒmXƒ¥¯@@„óUmݯ¯ÞÝlKnxô£š»„»Ġ„J°aV„UÝÿV¥ÛbƒI@wmŽón¯yÛL@ƒWkŎmș`IWa¯K@¯mUnmaXm™bmak„¯ŽƒĢ™ÒÝm¯mV¯KÇb¯KۜWW™X@a™V™knċLUWV™kXóW@k™a@ƒób¯Uƒwmb¥UUlaU¥U£maķšƒKXkƒmÝ@kwmѯk±ċbUUVakaġ¦ƒƒkL@`ƒœ™a¯xƒm™Åƒ™LUWƒ@ċnŎUV°LkL@b°°@¤š²ƒ‚šnôôk„l°kè›ÒÈzV¤È„WôôƒnV@„ƒ¦@¼Ux"],encodeOffsets:[[101903,23637]]}},{type:"Feature",id:"5325",properties:{name:"红河哈尼族彝族自治州",cp:[103.0408,23.6041],childNum:13},geometry:{type:"Polygon",coordinates:["@@°°nÞôV@ƒ°@„¦WŽ„nÛ¤Vbmn™ğb@êš`VxUX@xš„ƏÞUnn˜WÞĸĢƒšÈ@ŽÇè@zÛÜWšÅêlš²„˜KnV¯ĖĊx@bk@@„°JÆ£Èbl„nnm°nlUkVUUwVm„Kn„‚nVŽÞxVLX¥laX@@xl@VzȎVmšk@b°šÈĸmŽV¦`W„XšƒbUb‚bX¼°x@ašVVkn@lþnXUlVxŤÅ„y‚IUƒka‚IŎĊ@lXx@b„z@‚ô„ƒ¥„_V@l‚n@„ôy@al_l`nmƒÈ»@kƒmXwWK™U¯»™a™Å@wƒmUÝKUa™UUƒ™wWƒ@w²»@kƃV£—mm£VKkÑV@@»nwƒ¥™ƒ@kƙnllIVlnLVakalknJšWmnaUaVÑVVލn¥m@ƒ„¯Uÿl™@™™™VçƒaXaV¯UyVLVkš@nJlšXLlŽkxlbla²Òl@nVJVkšx„KlkUaVķÝÑU@Åm¯@±™Uó°ğńķĠmU™Ñ@ǯ¯Å¼@nml@°¯¯`@w™£@¯Çƒk@ƒ»nmċ¯U»™I™Ž¯LÇĶÛn@bó°™U›šwmŽ¯„™Umǯa„™ƒ™ƒI@ykIƒVUŽ¯bƒIğŽƒ¼™¼ó¤mwkLÝÞ"],encodeOffsets:[[104243,23429]]}},{type:"Feature",id:"5326",properties:{name:"文山壮族苗族自治州",cp:[104.8865,23.5712],childNum:8},geometry:{type:"Polygon",coordinates:["@@šwô„š@²¯maUmôUÆxš@Xš˜bÞInlVUVw„JVaU„K°¥„xmÞXnlKlnna°@ĊČ„ÆwUmnkl@°ƒƒ£nyn@VV@Vak™ƒ@@kÞ݄bmx°Vnw°klÞInĖÞVlKl™@Xa°„„KlV„U@šJnx‚U@ÈĢbUKlm@ak_‚wšanWUk°ƒl»„k@Wk@lwU_ƒ@UalóU¥ƒÇnƒ™kJWƒ@mVXx±bƒK@nV±a@™Åa™£ÝK²ƒWknamKknǏk¯ƒaV™™V¯ĀƒU™„™Ò¥ƒI@mm¯¯xōW@@`k@ó»ƒUU¯lm£ÅWlĵ„w@mmwÅmWU@y±U—xmwU„¯Uƒ¥Ý¥¯£m@kŽÇVUV°VbklƒL™wUlUIm‚k@±ÑkbkalwkWKk™mI™@UlUKVzU°Wb„bU蚚@škšVĀƒ°@„n‚m¦ÝŽUUUÒVbmbXn™‚mIkllbUbmKUkkJmkŚ@lš„„¦mx@¼U@lÒULn¤˜nU¤Å„@l±¼@xX„šxV„šVVbÞLVŽ„n@xšÆšb°¼šV"],encodeOffsets:[[106504,25037]]}},{type:"Feature",id:"5303",properties:{name:"曲靖市",cp:[103.9417,25.7025],childNum:9},geometry:{type:"Polygon",coordinates:["@@ȦlKÞĕUV¯Um¯„ÇVUnVVUƒĉn™ĊÇƾLn°°È„JÆw„@lbÞa„¦V„XJ°¯W¯„aÞJVkUša„ƒ@lKnÅmWUk¯a¯»@m±@уkkbWWX_WÓU»_l™kÑm@U»m@l@IWċn¯l@VanV„UV™UVwVx„KȄVmUē‚@„ƒn@VÝÆL„w„VVwnVlmkUVÑÇ°ka@k™ÿÝaÞUl£™›—ċĕX±±ĉƒa@UnVnalónk@wl™UVmkÝJ—aW™™@ÅwóVVnnb±°™@óƒ™xXLWx„n@lǼn„m‚k_k`@bózƒ‚m@kU@ƒ`„¦óƒ@nWš@ÜÅXWw@ƒyƒb¦@ÒlnUb@x™lܐk‚@²Ç@Uƒ¯bmy@kV@bƒb„¦U`lLVx@b—Ll¼Þ¤@„°VVބU@WސUb›J@nnš@lnnm„šxUŽƒUUbƒK@šÇwklkUƒVWakn@ŽlbU@@„ULVxkKUn‚°¯Ò@¼™„kmƒ¦m@kl™Ȱ@lU„l¦„@Vl°wšnnþĊUÆbUx™b„ŽV„šĖU°„a‚nnašV„al@@b"],encodeOffsets:[[106099,27653]]}},{type:"Feature",id:"5323",properties:{name:"楚雄彝族自治州",cp:[101.6016,25.3619],childNum:10},geometry:{type:"Polygon",coordinates:["@@mҁXU`Wnšš™@Xl±¦š„Uxnbl°knmKUx„„ƒxVôUx°¼ôÒȄ°JlnÞKĠœW°¦ƒ„Vx²JVwš_°¥@UV@@wnymknK¯I@‚™²b°ƒš£V¥šwU‚V„¤nLškÆJÈwôô°„l»Č¯ƒġVƒUU@@ƒ°ƒƒÝXl@U»°Å„@U„¯@w±¯VmUUlm@m™„ÑnIVyUwmak£Vwm±—@Çw@nƒ@UxkwlÇnL‚mkř@±Žk™ka@kóJV¯Ç»U£lw¯™Xalbl¥¯UXƒ@a˜™UaÈL@ÇVIVƒkaU¯mm™akLWkUJ¯Umxnšƒ@ƒkUx¯xƒ„mWÅīÝkkbƒŤƒbkxWmXwWk¯wƒKkƒƒLŤċń„@¤óĬU²ƒ@@lƒk¯VmU¯¼@xV@k°l°kbUš°nm‚VnUš@°„š„UVèރÆbUÒÞnU¦›V—¼lô„@Vl"],encodeOffsets:[[103433,26196]]}},{type:"Feature",id:"5329",properties:{name:"大理白族自治州",cp:[99.9536,25.6805],childNum:12},geometry:{type:"Polygon",coordinates:["@@lbœKVIUa˜@²m@b™xôÒÜxXLmbnšl@š„„K°šš¼k„Uô‚xôlV¦nJ„Uš™Ænšm„@šx„ÆwšbXšÆôô„LUVwôK@wlmšaVwœ@WknmƒIUmlnJla@_™@kÝmKUašÑm¯Xw°aUaVl»²JV„bÆJkôĶĀ²VVk„mšbVwUó„wƒƒVwnLlmk¯maVw™ƒ²¥Wkš@™™XmV_‚WnÑUkƒ@k󘻜UV¥ÝmVÑÅa݄UçƒVƒ™@¯V™Umn¯mV™lak¯l¯U@@wğŽW鯁ƒ@¯xÝw¯š¯Jċa¯U¥mLU¤„bÞȤƒbÇLWUwmIUVW¼kbš`U„Vb¯L±ĊÛkƒÿÝKkwƒKţê™UĉþƒÈƒV¯ÞVbUŽ°KVšk²Ý‚mI—ƒmV@kƒm™UkšVxm„¯KXÈķJU¦V°ULWxšL@môƒšb@bkx±LnVUŽVLnkÜWnwlLŃmW@kkJU_ƒV„šWĊ„Þ"],encodeOffsets:[[101408,26770]]}},{type:"Feature",id:"5309",properties:{name:"临沧市",cp:[99.613,24.0546],childNum:8},geometry:{type:"Polygon",coordinates:["@@‚xĢ„l`²X°ŽV„šx@x°Þ°KXašğUњW‚bnIl`X²°b„xl°„„šV@xVxk¦mb„l@xšXV‚ÆzX¤™Æ˜k°„kx@lźêlaX»VUnJVx‚XÈK„aÝȣƒaV£nKV¦°‚Čb°I°™n»ÆÑV¯nWn›™@ÿXÅWWn¹ƒġōƒn»‚ÛU™™aU™VƒUw„w@w°ƒó¥ƒ@ƒz—ƒ±@ř›¯@kUwlk£±aĵŽ¯™›Uĵ¦±±@bó±VÝ@ó¤ƒw¯I@mńóm±XŽ¯IólƒK@š°Ullb™zkKlln@@ԙºƒUmVk²ôҙx™ŎUVóLƒb„ŽmÈnŽmbnl‚a„x@z„@Ǝ„¦kš"],encodeOffsets:[[101251,24734]]}},{type:"Feature",id:"5334",properties:{name:"迪庆藏族自治州",cp:[99.4592,27.9327],childNum:3},geometry:{type:"Polygon",coordinates:["@@W™Xwƒ™@akk@y›—k°īX¥›Uóķ¯w@n»UaVaUۃ¯ƒmV¼k‚™Þċô@n¯xÛÒm„V‚¯Ô@xƒ‚@šk™wm™Åa@ƒUa‚݁¯VŃyV„a@ÿšn»ÝVmank™mmÞÅôƒ@n£±›ğzÇmU¦™Vm„nÜmbn@°nV@xmzÅ@mºV¦k°ln¤š¼õô„n@xkƃIUxUš@Ťƒ¦VšmVkmkXW¤XzVx@ƚx™¼ƒÞ¯b@lVš™ĸގV„m¼XŽm¦V„ŽÞ@Ǝš¹Vón¥ÆKn„‚KX¯x@èĊȱłXšaÆxnlV@UÛlȻkğV¥„m²ljmÅÞĕƒƛm°„ÆmX¤mznƃŽV¦ÞVVb°bnÞWbnŽ°l@V„È@„‚VĵĊ±@ó„InxÆw„¥@£Þ›W¯ĸ£UƒUK‚ƒk±akkkbmWmÈķ„aÆÇU—ȃÆW@wmknmU¯"],encodeOffsets:[[102702,28401]]}},{type:"Feature",id:"5306",properties:{name:"昭通市",cp:[104.0955,27.6031],childNum:11},geometry:{type:"Polygon",coordinates:["@@mƒnK@wmƒUř¥mšóXǓŏmX@Ž—VƒmL@xţ™nk@mlUšŻÒğŋ@ƒL@mmLkm™š@b™XŎW¼ka¯lÇŹ¯aÇ»™ÝÝ_@m„@@a™@UklwUm@ak@ƒb™UmbmƒbV¯™ĕUƒƒšaVwÅaĉVmý™m¯xUkƒ@k¥VƒUXƒ¤VÈm`@„—ńÇÜ@Ākn‚ĔkƞÆĠ„™Þš‚U„VôƆÞI@ŽUxƦn„l@ĊĊnxUÒ°¦Vb¯WUnWŽIml@xn„Ubô¤‚¼ÈxlI„»šKVš„@ÈԂJkšUĖ±ÆVb@nœ„VÜVUVƒšL„wĠl„kn„Ġ@nx°¥Æ„²mUwƒ@m™mÅUl¯UњÑUm„Lll„Il±š@VkwƒW@w°@U»™kUóI°ƒ„»ĢтL„™š`nUĠ²lm„bôV@n„JUxƦX¦l@š‚ŎUƒV„@lV„KVřV£UaÞU™ƒnW@¯VU@ó™"],encodeOffsets:[[107787,28244]]}},{type:"Feature",id:"5301",properties:{name:"昆明市",cp:[102.9199,25.4663],childNum:11},geometry:{type:"Polygon",coordinates:["@@n@Vk‚VUn²°@xƒ°Vƒ@¯ÆV¼k@WŽ„Þ¯„@„@‚VVU„„Ģċ°k¼V„Ċxœ¤Ōœx°mVkƒÑȏšL‚°„x°Xœ°VmĊLVxUĖ°bX¦VW@kšȯlkn@„¥lnšƒ@»°Ñ¯VmlLUwVK@ƒV@ka@lmXb„UlVlkÈx@™„LVa„VV™wnƒmm@km™@mœIVaݏ@XƒVUݯU@ƒÝ£k»˜K@aUwkKV_ƒ¥„a@alU@nz°aV„È@@±lÛšk@wVakm@т¥„a„z‚@XxÆW@ÛX™@m@ƒy@aWw@kōĉJlbV„JƒzţÆUwVkmWkým@Ul™U@b¯wVºƒU™VUêšĠƒXUaUbVĊUŽWXUmkK™™WnUUU™V™ƒƒVV™Ý@kk±‚™¯ƒƒLkƒš±WkXlVklƒ@ƒwXbmLƒ›VUIVmk@Ubma@kkaVKUƒ™kmlXLWn™J¯ÒĊ°@zkºlLUŤn@@n›ô@lƁnmKkÈlxVw„@@mÈx˜@n²Uxl¤nbVxUzmJƒÒnš"],encodeOffsets:[[104828,25999]]}},{type:"Feature",id:"5307",properties:{name:"丽江市",cp:[100.448,26.955],childNum:5},geometry:{type:"Polygon",coordinates:["@@l@™„@w°ÓUnƒÜÑ°w@mČóšÝlU»n°„„VÜUbVbm¼@Ž°xôĸœVW¦¯Ĭlœ˜@zll@b„šWxXš‚a„X@ÆĠÆaXwl@XaƦn¼˜Jn@mnKW¯È»V¯°ak™VanXVwl@VyUĕVU„bÈīlaUk°ƒk¯lƒ²V˜Ukƛô@ƒ„I@mVwĊa„™ƒVaka„™ÆbUŽVLšaXIWKUw™ƒ„aWÑÅKUaVk°ƒ@Uw„ƒ¯¥›XğÝLkm¯Iǃóѯ»™aƒnUl±UĵÿlóÅIƒaU‚±Ik¼UŽVb¯bWxn°™ÒVbnLlޚ@@`kbmIkŽVn„JmnXl›@Ux™bkn@xóLUxVŽƒKóóŐW™™aÅxƒŽ™wƒ@™nÅm™šƒV™„ƒôX„ƒLlVU¤ƒb¦m¼™Ž@ĀƒbU‚„zUƂ°ÞVb@„Æbnššx"],encodeOffsets:[[101937,28227]]}},{type:"Feature",id:"5328",properties:{name:"西双版纳傣族自治州",cp:[100.8984,21.8628],childNum:3},geometry:{type:"Polygon",coordinates:["@@l²°ŽnÒlxÞ@„nWl„Lĸ™nbV¤V¦kbVV‚¦na„x°Vôa@„šb@lôXlWUšVXČKlmššU@bšWXXܛ°LÈa°LnU°‚ÞnšÑ„ġ°lƒnbšaƒ¯¯KWƒœó@kmK@UšĉV@k°„VV¹„a@y‚_ċl_nÓlL@anI@ƒóWl£VU—ƒl™kĕl™šKVw„U@™kVƒam¯ÅL@bƒ‚Ýk@Vn„UbÇbÝwÅ@ċ¥¯lk‚¼ÅŽ™Ò°b@¦nlUn@ŽÇV„mƁbWôU@ÝÅōm™¯ƒaU™™mk™WWw—@±ƒ™n¯U™è™a™Lƒ¯mƒL™škwƒl@°mnÈÒ¯šów@V™xƒĀU¤°Įƒ°Xl"],encodeOffsets:[[102376,22579]]}},{type:"Feature",id:"5305",properties:{name:"保山市",cp:[99.0637,24.9884],childNum:5},geometry:{type:"Polygon",coordinates:["@@X°„Il‚@¦ƒŽÈ¼m¼ÞaÞÅl„ÈxV¼šlVôÈÆlLޣȺlkUƒ‚ƒUw„¯UĕVwĊ@n¦mlnVĸIWÇ°LnƒUwl™šV„n@lnU˜„nJށl±U™¯LVUa°Ý„U„ÇĊýšVŤé„LlxÞL„ĀÜl²ĉ°KUaVƒ™_Źé@klw¯ƒlÅ—šW£ÅyU™W@wƒknal¥Uw@w™Uƒƒk¯ƒw¯aW±k_mJa™XVҙĠWb¯L¯Ý@w™wUƒ¯±Wk_ġƒwƒwōKmb@¤„bk°lĖƒô„UJƒšVnÅlťUš¯°VbnbWxX„m„ÞššWUĀ™L™yWzÛKmbUxVKkn݃kŽVšĀċ¤Ux„@Ž¯Žm@ƒ¦"],encodeOffsets:[[100440,25943]]}},{type:"Feature",id:"5304",properties:{name:"玉溪市",cp:[101.9312,23.8898],childNum:9},geometry:{type:"Polygon",coordinates:["@@l„„L°xXlWxXnlw„a„ţlaÞlÆĬnX„ƒ°wVw„l„@m™nw°VVIXllKšbnnV°lbU„UJ@ÈÇKVb—š@bW„°Vk¦kaWb°škxV¤È¼U°ôI@llblš²š@‚@œó@mm@VţkKl¹@yĉ¯°ÑšIXmWKnkšlV„ULlb@lnbVal@UnVJœU‚„nKWa„x„@lkkUlW²X„™‚l„K°„šl²@lšÞUŽ„U‚„UšVšVVXmššlLVnXWVUĉVaVb„W™ğVéšU„VU¹W»aVa„aW™Xƒ‚_U¥nÇķ¯™@a™lUnǍUyk@@wW@kbW¦UKÝwUmmƒƒLUnVxUVVlk¯mmnƒmkÇaŤ¯I@ƒl@@aĉw°ĕmU—L±ƒk™ÆéX™ÜÛ@yÈç@™Çġ„Ýķ—XmmÝVՙƒ™lmnkbmWkb@nl@nŽmš¯VxkJmUJ„ml¯™°makVVnVƒ¦™Wƒ—Wmnl@xmn„l‚I„¤„n™xU„ƒVUŽmX@˜ƒb@zl@¦Ýþ"],encodeOffsets:[[103703,24874]]}},{type:"Feature",id:"5333",properties:{name:"怒江傈僳族自治州",cp:[99.1516,26.5594],childNum:4},geometry:{type:"Polygon",coordinates:["@@WyX£lWlnnUU™„¥@ţV™Vw„JlÅ@wƒmö󙻂£kml¯U¥n¹Æ@ny@wmU@¯mnamÛnƒšUV¥ÈnĠy²œm¤„@ÆónݚnmlnbÞU‚¥„aV£kU„KWƒ„óšƒmIU¥ókwVólƒ™»¯™ƒL™ƒk@m™naWKÛwóњw@a±n—@VbUJ›LkaƒÝXĉƒ™„UV`lI@lnXÆƑkKmxÛXmlUKVmU²Klw@a™aó„@n™KXwVKU¯V¥mUnkm¥ĉ@UxVĖƒ°Vx„V„klmޙkKWĀkVWšnl°Lnm@°ŽUxlV@nk¦™JVÈ°ŽVÒ@nX°@ÆlUômlnôƒ²nxmłnVV„¯x@Èm°XblVUšl°@xkXU¤WXX‚W„Xƃ„mkÅJmށw±bƒxUīkKmÅVUĖÝèV„kx@š›lX„lnk¤ƒLkŽ‚Ėk¦‚xUššL°‚¯Ė@LnK@b°xVI„¥Ua°Ñ@»nm@¹‚KŎÞÈWln²n"],encodeOffsets:[[101071,28891]]}},{type:"Feature",id:"5331",properties:{name:"德宏傣族景颇族自治州",cp:[98.1299,24.5874],childNum:5},geometry:{type:"Polygon",coordinates:["@@„¥n@°@ƒVwČ£™ÿUlÞ„lmULVwnaÜLXyšzšKVÿ™XݙnƒWƒXwmaUa°¯V™ŦŽÆkUm„™VIƒ„ókĕl¯ƒa@£nama™@¯m¯œó@óyţbġkÅm±ÛammVkƒLwU`Wk@VƒkUmŃlUUKmbkkUVUwƒ¦óŽ°¼šbn°ô¦lºƒz@xšŽ¯„™@UŽ°nƒšU¤ţU„°VƆ@ÈmlnzÞl°¦Æa„xUxƒLkxWƒn@‚š²ŰšW„™‚@°ÈXl°Llx"],encodeOffsets:[[100440,25943]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/zhe_jiang_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3311",properties:{name:"丽水市",cp:[119.5642,28.1854],childNum:9},geometry:{type:"Polygon",coordinates:["@@@V‚bVl@Xn‚UXƒKVŽ@¦nxlUXV‚n„KVmnL‚UV@bn¤lLXK˜²„`nnlJXIVJ‚I„Vnn°KnnVll@VLXWV@UkVaVK„zV@„ƒšVVaUK@U»VUl@@WnUUƒ@wVLn@Vwl@XW°LVbn@VU‚@X„l`@XnKVbkl@XVJlUnlV„„xlL@lnXl„@VšUnV°°„@a„UVLXblWVXn@VVUV@Lš¤VLV„U‚VbnalLUUVX_laVa„WVzXKV@@a@KUmImmXama@kU@yVIUK‚aVa@kXK@aWU@VIUmW@kkVm„Uš@VwUa@K@k@Uƒ`@kUKVk@UV@VaUm²Vy@klUUWUkVmUa@_ƒKVaXa›XmƒU@mUlWkaUXƒ@mmkL@w™JƒnVVÅbWKXa™@@I@aƒJUUÇ@V„UL™W@akLmb@K@a™XXw@mƒVmUVkUy@£@aU@@VkUWm@kUKƒXUWU_mW@wkkmJUUkLWWUXƒW@IkJ@k@mW_kӃ_Ul™Lƒm@I@aUa¯m@kƒa¯LUJƒ@mVVxUb™a@LUKkXƒbm@Uak@@a@Um`ƒIUbUJ@nUVW@@LnVV@lšUbVlUX@`š@blXklW„Ušm„Xlm¦U@@V¯bml@š@nUb@llnn@VbX@lV@ŽUVULmU@JVn„bVbkb™VWxU@@nUVk@"],encodeOffsets:[[121546,28992]]}},{type:"Feature",id:"3301",properties:{name:"杭州市",cp:[119.5313,29.8773],childNum:6},geometry:{type:"Polygon",coordinates:["@@X@l„°KXXlW„b@²„`šššb‚I„šX`l@„@bWl@n@VnLUV@V„@°¦@šl@XVlU@š@xVbUb@Vkb@‚@XVJVz™J@Lޚ@VmLUxUJ@LU„Vx‚b„xXUl@VaÈw„b‚aÞa@Vl@XUVx@V@V„LlbnV„al@lb„Vnn‚LnKnL@VlbVJXalIšb@KUU@mVInJ˜„U„Vl@xUšVLnUš@UÞaV@lkV@UanK„L@UlKVUnbÆmn@@nUlVnVJl@@UXU„L@WVIVJVxVLXV@IÜKnbn@V¥V@@I@ƒƒ„y°b@UUwnk°ÆƨVlUšçXm›£aƒÇ™IkVƒ@WV@@aWIUWUIkb@WW@UnƒK@UU@kaWVkƒVIVVnU@UWVUV@VmVkKkWIkVWaULU`UImJUImm—U@ƒƒwmwUV™IUWVkUamaU@mV—kƒb@KVU@aVU@anKULVJ‚U@kÛU™JUV›kkƒVakU@ƒaVwkW@UWkXmWaULUaUK@XƒJUUmƒVU@UVƒUkJ@ImwmKU@k„@lU„W@@akKm„kamIkWl_UwVm@UkaVUUaƒ@UamakbWlkL@aUalU@mkL@U@U™lmK@XkKm@Ýakb@xƒnXbƒ`ƒnUUU@›™U@™wU@@ƒmKkkƒV¯U@lULUbVbUb@V‚a@L™ºÝb@bLmK™x@VUL@bk@mxULWl"],encodeOffsets:[[121185,30184]]}},{type:"Feature",id:"3303",properties:{name:"温州市",cp:[120.498,27.8119],childNum:9},geometry:{type:"Polygon",coordinates:["@@ll@xnXV`VX„WVL@lXnlV@UV@@b@¤VzUlnV„U@nWxšW@b@LnalK@bšXVKUƒÈ@VV„I@b@Jš@WbXLÆaUU„mšI@xlKnn„@VWlbkXV‚@n„VWnœ‚WbUb„L@`VbUnVlVXkV@lUz±‚VnUbU@@VUlVL@l„_@V@l@LVbV@XLV`VÈlxn@lU@aœaVV‚k„@XJ@nl@@LU`°LVb„L°a@a„UVy@anI@a„a‚nV@²wÜJX@VšVV°k„na@WVk„aWwU@m@™ƒkƒaUĕ™ÝšÝŤnÈa„aóI›»@±X™WkUķ@kV±kw™ƒUkWw„™UƒÝ»ÛkɳlImaUaWóXÿǬk‚UnWVmmk™KţnŏÞğl™„UlUx@XWb„V@JkXƒ°mb@VULVxUVk@@LWWk@WIkšƒUkJmUkVmI@yƒ@Ua™kLm‚U@mUUUkaVk™@mK@UlUU@UmKmbUUUJ@n@KVLUL@VkJWXX`mnULWlkL@JVLVb@°kxkU@LVŽ™V@„VLV`UL@VUX"],encodeOffsets:[[122502,28334]]}},{type:"Feature",id:"3302",properties:{name:"宁波市",cp:[121.5967,29.6466],childNum:6},geometry:{type:"Polygon",coordinates:["@@Ċ¦ĸĀ°‚nXÞVšKškƨƑźÿ°»n„@wô¥ÜbœU°ÆXÞWóçĉݱIUƒÈ¥@U°wÆ»²mm_@aXƒVKÞVlk@akk›̅@£X»VwƏXWa¯aȗb™KƽۃĊ™xƒLóŽk@ƒƒƒ@¯nƒKUL@xkL›ÑkWULUUmJUXVŽU@mŽUX¯@V`mbXbV@@nn¤WXšx@škJ@nVVUVl²UbÝVUVk@Wx@V@„ƒVXzmlaƒL@VlLU`„XUVVVUnl@VbnJlnUVVnƒlUKkbmnn„VxlJnxmbU@UL@KUV™X@xmb@lk@mnVVUš™è"],encodeOffsets:[[123784,30977]]}},{type:"Feature",id:"3309",properties:{name:"舟山市",cp:[122.2559,30.2234],childNum:3},geometry:{type:"Polygon",coordinates:["@@l΢ƒʠþÆVĢLĊƒǬXĊ܄XôV„ÑÆw„ƒlšƏÈóVĭVǓ@ƒĉwɛkmK@ĉXīWaĉUĵÝmƒ¯ĉƒwĉ±±nż¯x@VǦV„²JĊÞôèÝXÅW¯›VÛaó¦@xƒŽmŽ¯¼ŹĀ"],encodeOffsets:[[124437,30983]]}},{type:"Feature",id:"3310",properties:{name:"台州市",cp:[121.1353,28.6688],childNum:7},geometry:{type:"Polygon",coordinates:["@@lV„IVWVz@bXJl@Xal@°„nLll@nVxnV„K@UJVbƒ¦°„k`UIWJXnƚ@bUJ„Xl@lb„Wn@UzVV@bVVšmVnnJVXna‚bšKUKnUVVUnVLlKVLXa„Jm£@mU@WanaU_°@VWnV@UVWnIVVVKlXœÒlK@wVK„L°m„@„„l@ô„Kšw„ĉƾůUƒl£@»UƒVk„m@ƅUƒƒaÛIŏmUk@m„w@a™£ƒWk@ţšƒIm±@ankôUlaU™Uw¯ƒōaƒbÇbţm™ÞšÞVĖ„b„l@š@n‚VXxƒbUl@XmbƒŽ¯lUUU™W@ÛI±xU@mƒb@bmJ@bUzƒV@b¯bƒKUa¯KV_@Kk@@mWIƒ@lUU›b@bkVm@kwUÇU_WKU@Ux™@ƒVUnllX@Vn‚J@UXV@bWL@lUbbVLUJ@z‚V@lnbWbnnnJVŽ@L"],encodeOffsets:[[123312,29526]]}},{type:"Feature",id:"3307",properties:{name:"金华市",cp:[120.0037,29.1028],childNum:8},geometry:{type:"Polygon",coordinates:["@@nbVb„@VbUVlb@VUnVxk`lXnJlbnƒlL@bX@Vƒ@klƒV@nLnx@JlI„V‚U@VUVn„VV„I@WVLVbVKXbWnXl@VlXUx„b@ŽlVUbl„œlVUšIÜVnalKX@@bV@@aUUlUƒwUw„@naWW„UVaUUšaVb„LlxXJVk°ƒUƒlkU¥@k„a@LVlXLVlšVWznVn@lxšJl_@WX_@mVa„a@alU@kVVna„KVLlK„b@UUaVašbnUWmXU@k@yVI@ařWmXIVJl_¯ƒ„¥UaVI@ƒLmUUw@mkkmK¯ƒk@Wbk@WI@aUyUXƒJkU@bU@WLUyƒXUbkbW`UVVkKmbUaVUƒUK™£@KVUUUm@UWkXWaUKƒV@b¯ƒ¯mU™V@UkƒmW@kkKƒwUƒmkkVUI@WlkUamL@Wk_Wƒ@UVm@Ua¯KWXk@Uxm@UK@xV„mV@Xk@UVV¼@‚VLUb™Uƒ„U@ƒyULUbVlU@@XlVUVVbƒU@lXXVW@XUVl@@VUVƒÈn@VVU„@lVa@„U„mL@`X@`WL@VUX@lUL@xlx"],encodeOffsets:[[122119,29948]]}},{type:"Feature",id:"3308",properties:{name:"衢州市",cp:[118.6853,28.8666],childNum:5},geometry:{type:"Polygon",coordinates:["@@XkVKnwl@@aVK@UšwnL‚K@aÞaš¹@Kb@UVaUaVaVK@k°V„UllnL@„V@šxV@œšV@VV„m„_Wa„m@wlaÞbn@lL@WnLšk@V@VlK@nkVVb@blKXklakw@wVK@kVW@UXK@_‚W@_nKVƒ@ƒUb@kVƒUUm@„ÇVU@Uk@VU@WUXWW@k„VUaVUkU@WWXUKk@Ukmm¯LmmƒUJUIWJkImmƒ_—±WLkKm£@aVUmKUnƒLmWUkVmw@¥U„LVWm@WUka@UmmLmm@@bUX™@@WUIm@UVUK@UVUUU™VVJmb@b„Xn‚mVƒ¼nnn¦mJUVƒL„V@VW@UzUlVnUbl`UnVl@XU@kl@bmÈUx™Vk@@J@„ƒ¼W@ÅaVVnzmVƒ„@WJk@kWJ@ƒlXbWbXxmVnšlLXb@°lKVXnWšbWV„„X„mbV@Xl‚bšI@Kn@@x@šVLlm"],encodeOffsets:[[121185,30184]]}},{type:"Feature",id:"3306",properties:{name:"绍兴市",cp:[120.564,29.7565],childNum:6},geometry:{type:"Polygon",coordinates:["@@„x@„˜VnnVJnIVJV_VKXblUXJlŽlLUŽUnU@UVVX@ŽmVUUUJl„XUlbV@@V„LVmX@@XlaVJVXXJ@b‚@XU„@lUšJ„È‚bœ¤Ō„JšçV™UUnml@@kna@wšWVU@LVKV@namwkIUwmƒnmlaVL„kUmVUkmmIUak@VmUUVUƒWV_kK@U„K‚bnkWy„U@ƒ@UXwl@VUÞUVak±VUUU@mlI@™™wXWƒIWbUKkLUKVmUUmVVL™LambUWmIUm™nUU@aUUVym@ƒXkak@ƒW@z@lWVXnmV™aUbVb@VƒakLUKƒLmbUU@lkV@bƒbUb@nW`@Xk`™Ikwm@mUXy™UUkWKUk@Kƒb@lV¦klV„¯„UlWIkwƒKUa™bVVUbƒVXXmbƒ@Vx„xkVVV@bU@@aW@kLmb@lVUIVKmL@bUV@bUV@L„a˜lnUV@nbVbUlVXšJVUnx"],encodeOffsets:[[122997,30561]]}},{type:"Feature",id:"3304",properties:{name:"嘉兴市",cp:[120.9155,30.6354],childNum:6},geometry:{type:"Polygon",coordinates:["@@@blIX@@VÜVUnn@l‚k„lKnI°Þl`²LVKVbnbVaVLUVn@W¦@VkVVb„@VI„`@blLnL‚aX@„VVb@U‚@XlVa„@@kVaUKV»U_lWXUƒƒ@alb„k@VllnLVKn@@UVIUw@y°IVVXU@VV@lw„m@wVkƾaœJ‚LkΡƧƒ™l™LÝUmW¯ķÿĉ¥ƒIŋŽWn™èkVƧU¯ÅmlVx@V¯aƒz„Ž@„@JU@U¦m@@šnVmn@V„LV‚"],encodeOffsets:[[123233,31382]]}},{type:"Feature",id:"3305",properties:{name:"湖州市",cp:[119.8608,30.7782],childNum:4},geometry:{type:"Polygon",coordinates:["@@kLlƒkm@VmÛU@UW@kJ@aUƒK@UnmmU@™maÛL@JWUUKUwUIUJ@XƒKWV@Vk@UIUmVk@mm@ÅnmaUVkL@VƒKmLVbU@klU@ÝbV™@mVUKV™@wUkVƒ—ƒmIUJ@nVV@L™akJWbUIka@UmKmLKmmƒUUVk@@nmLX`WXUV@Ž@nUl™kmlU@Ub„„ƒxVVšIlV„Žšnn„@@n˜„UҚ@„°n@@xmb@„VbnV@šš„@b@`@L@L@x@blVklVbnnV@‚aXb°VlU@W„b°U„LXWVUV™„™VwÈwÜ»ĸaĠnUVw²X@V@lVU@wlaUUVm@knUV›"],encodeOffsets:[[123379,31500]]}}],UTF8Encoding:!0}}),define("echarts/util/shape/HalfSmoothPolygon",["require","zrender/shape/Base","zrender/shape/util/smoothBezier","zrender/tool/util","zrender/shape/Polygon"],function(e){function i(e){t.call(this,e)}var t=e("zrender/shape/Base"),n=e("zrender/shape/util/smoothBezier"),r=e("zrender/tool/util");return i.prototype={type:"half-smooth-polygon",buildPath:function(t,r){var i=r.pointList;if(i.length<2)return;if(r.smooth){var s=n(i.slice(0,-2),r.smooth);t.moveTo(i[0][0],i[0][1]);var o,u,a,f=i.length;for(var l=0;l0&&this._buildSinglePosition(f,t[f]);this.addShapeList()},_buildSinglePosition:function(e,t){var n=this._mapData(t),r=n.locationMap,i=n.maxDataLength;if(i===0||r.length===0)return;switch(e){case"bottom":case"top":this._buildHorizontal(t,i,r,this.xMarkMap);break;case"left":case"right":this._buildVertical(t,i,r,this.xMarkMap)}for(var s=0,o=t.length;s0&&(this.finalPLMap[s]=this.finalPLMap[s]||[],this.finalPLMap[s].push(g[s]),g[s]=[]);continue}b>=0?(p-=T>0?l.getCoordSize(b):d-l.getCoord(b),h=p):b<0&&(v+=T>0?l.getCoordSize(b):l.getCoord(b)-m,h=v),g[s].push([c,h,w,a.getNameByIndex(w),c,d]),r[s].min>b&&(r[s].min=b,r[s].minY=h,r[s].minX=c),r[s].max0&&(this.finalPLMap[k]=this.finalPLMap[k]||[],this.finalPLMap[k].push(g[k]),g[k]=[]);for(var S=0,x=n.length;S0&&(r[s].average=(r[s].sum/r[s].counter).toFixed(2)-0),h=this.component.yAxis.getAxis(i[s].yAxisIndex||0).getCoord(r[s].average),r[s].averageLine=[[this.component.grid.getX(),h],[this.component.grid.getXend(),h]],r[s].minLine=[[this.component.grid.getX(),r[s].minY],[this.component.grid.getXend(),r[s].minY]],r[s].maxLine=[[this.component.grid.getX(),r[s].maxY],[this.component.grid.getXend(),r[s].maxY]];this._buildBorkenLine(e,this.finalPLMap,a,"horizontal")},_buildVertical:function(e,t,n,r){var i=this.series,s=n[0][0],o=i[s],u=o.yAxisIndex,a=this.component.yAxis.getAxis(u),f,l,c,h,p,d,v,m,g={},y,b;for(var w=0,E=t;w0&&(this.finalPLMap[s]=this.finalPLMap[s]||[],this.finalPLMap[s].push(g[s]),g[s]=[]);continue}b>=0?(p+=T>0?l.getCoordSize(b):l.getCoord(b)-d,c=p):b<0&&(v-=T>0?l.getCoordSize(b):m-l.getCoord(b),c=v),g[s].push([c,h,w,a.getNameByIndex(w),d,h]),r[s].min>b&&(r[s].min=b,r[s].minX=c,r[s].minY=h),r[s].max0&&(this.finalPLMap[k]=this.finalPLMap[k]||[],this.finalPLMap[k].push(g[k]),g[k]=[]);for(var S=0,x=n.length;S0&&(r[s].average=(r[s].sum/r[s].counter).toFixed(2)-0),c=this.component.xAxis.getAxis(i[s].xAxisIndex||0).getCoord(r[s].average),r[s].averageLine=[[c,this.component.grid.getYend()],[c,this.component.grid.getY()]],r[s].minLine=[[r[s].minX,this.component.grid.getYend()],[r[s].minX,this.component.grid.getY()]],r[s].maxLine=[[r[s].maxX,this.component.grid.getYend()],[r[s].maxX,this.component.grid.getY()]];this._buildBorkenLine(e,this.finalPLMap,a,"vertical")},_buildBorkenLine:function(e,t,n,i){var o=this.series,l,c,h,p,d,v,m,g,y,b,w,E,S,x,T;for(var N=e.length-1;N>=0;N--){T=e[N],g=o[T],b=t[T];if(g.type==this.type&&typeof b!="undefined"){l=this._sIndex2ColorMap[T],c=this.query(g,"itemStyle.normal.lineStyle.width"),h=this.query(g,"itemStyle.normal.lineStyle.type"),p=this.query(g,"itemStyle.normal.lineStyle.color"),d=this.getItemStyleColor(this.query(g,"itemStyle.normal.color"),T,-1),v=typeof this.query(g,"itemStyle.normal.areaStyle")!="undefined",m=this.query(g,"itemStyle.normal.areaStyle.color");for(var C=0,k=b.length;C=0;r--){f=this.shapeList[r]._seriesIndex;if(n[f]&&!n[f][3]){if(this.shapeList[r]._main&&this.shapeList[r].style.pointList.length>1){l=this.shapeList[r].style.pointList,o=Math.abs(l[0][0]-l[1][0]),a=Math.abs(l[0][1]-l[1][1]),c=this.shapeList[r]._orient=="horizontal";if(n[f][2]){if(this.shapeList[r].type=="polygon"){var h=l.length;this.shapeList[r].style.pointList[h-3]=l[h-2],c?this.shapeList[r].style.pointList[h-3][0]=l[h-4][0]:this.shapeList[r].style.pointList[h-3][1]=l[h-4][1],this.shapeList[r].style.pointList[h-2]=l[h-1]}this.shapeList[r].style.pointList.pop(),c?(s=o,u=0):(s=0,u=-a)}else{this.shapeList[r].style.pointList.shift();if(this.shapeList[r].type=="polygon"){var p=this.shapeList[r].style.pointList.pop();c?p[0]=l[0][0]:p[1]=l[0][1],this.shapeList[r].style.pointList.push(p)}c?(s=-o,u=0):(s=0,u=a)}this.zr.modShape(this.shapeList[r].id,{style:{pointList:this.shapeList[r].style.pointList}},!0)}else{if(n[f][2]&&this.shapeList[r]._dataIndex==t[f].data.length-1){this.zr.delShape(this.shapeList[r].id);continue}if(!n[f][2]&&this.shapeList[r]._dataIndex===0){this.zr.delShape(this.shapeList[r].id);continue}}this.shapeList[r].position=[0,0],this.zr.animate(this.shapeList[r].id,"").when(500,{position:[s,u]}).start()}}}},i.prototype.iconLibrary.legendLineIcon=c,a.inherits(l,n),a.inherits(l,t),e("../chart").define("line",l),l}),define("echarts/chart/bar",["require","../component/base","./base","zrender/shape/Rectangle","../component/axis","../component/grid","../component/dataZoom","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../chart"],function(e){function a(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this),this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("zrender/shape/Rectangle");e("../component/axis"),e("../component/grid"),e("../component/dataZoom");var i=e("../config"),s=e("../util/ecData"),o=e("zrender/tool/util"),u=e("zrender/tool/color");return a.prototype={type:i.CHART_TYPE_BAR,_buildShape:function(){var e=this.series;this.selectedMap={},this.xMarkMap={},this._sIndex2colorMap={};var t={top:[],bottom:[],left:[],right:[]},n,r,s,o;for(var u=0,a=e.length;u0&&this._buildSinglePosition(f,t[f],this.xMarkMap);this.addShapeList()},_buildSinglePosition:function(e,t,n){var r=this._mapData(t),i=r.locationMap,s=r.maxDataLength;if(s===0||i.length===0)return;switch(e){case"bottom":case"top":this._buildHorizontal(s,i,t,n);break;case"left":case"right":this._buildVertical(s,i,t,n)}},_mapData:function(e){var t=this.series,n,r=0,i={},s="__kener__stack__",o,u,a=this.component.legend,f=[],l=0,c;for(var h=0,p=e.length;h0&&(c.style.x+=1,c.style.y+=1,c.style.width-=2,c.style.height-=2,c.style.strokeColor=c.highlightStyle.strokeColor=n.itemStyle.normal.borderColor,c.highlightStyle.lineWidth=3,c.style.brushType="both"),a.setItemShape(u,c))):(this.selectedMap[u]=!0,this._sIndex2colorMap[e[h]]=this.zr.getColor(e[h])),this.selectedMap[u]&&(o=n.stack||s+e[h],typeof i[o]=="undefined"?(i[o]=r,f[r]=[e[h]],r++):f[i[o]].push(e[h])),l=Math.max(l,n.data.length);return{locationMap:f,maxDataLength:l}},_buildHorizontal:function(e,t,n,i){var s=this.series,o=t[0][0],u=s[o],a=u.xAxisIndex,f=this.component.xAxis.getAxis(a),l,c,h=this._mapSize(f,t),p=h.gap,d=h.barGap,v=h.barWidthMap,m=h.barWidth,g=h.barMinHeightMap,y,b=h.interval,w,E,S,x,T,N,C,k,L;for(var A=0,O=e;A0?(y=D>0?c.getCoordSize(L):x-c.getCoord(L),P==1&&g[o]>y&&(y=g[o]),S-=y,E=S):L<0?(y=D>0?c.getCoordSize(L):c.getCoord(L)-N,P==1&&g[o]>y&&(y=g[o]),E=T,T+=y):(y=0,S-=y,E=S),i[o][A]=w+(v[o]||m)/2,i[o].min>L&&(i[o].min=L,i[o].minY=E,i[o].minX=i[o][A]),i[o].max0&&(i[o].average=(i[o].sum/i[o].counter).toFixed(2)-0),E=this.component.yAxis.getAxis(s[o].yAxisIndex||0).getCoord(i[o].average),i[o].averageLine=[[this.component.grid.getX(),E],[this.component.grid.getXend(),E]],i[o].minLine=[[this.component.grid.getX(),i[o].minY],[this.component.grid.getXend(),i[o].minY]],i[o].maxLine=[[this.component.grid.getX(),i[o].maxY],[this.component.grid.getXend(),i[o].maxY]],i[o].isHorizontal=!0,this.buildMark(o)},_buildVertical:function(e,t,n,i){var s=this.series,o=t[0][0],u=s[o],a=u.yAxisIndex,f=this.component.yAxis.getAxis(a),l,c,h=this._mapSize(f,t),p=h.gap,d=h.barGap,v=h.barWidthMap,m=h.barWidth,g=h.barMinHeightMap,y,b=h.interval,w,E,S,x,T,N,C,k,L;for(var A=0,O=e;A0?(y=D>0?c.getCoordSize(L):c.getCoord(L)-x,P==1&&g[o]>y&&(y=g[o]),w=S,S+=y):L<0?(y=D>0?c.getCoordSize(L):N-c.getCoord(L),P==1&&g[o]>y&&(y=g[o]),T-=y,w=T):(y=0,w=S,S+=y),i[o][A]=E-(v[o]||m)/2,i[o].min>L&&(i[o].min=L,i[o].minX=w+y,i[o].minY=i[o][A]),i[o].max0&&(i[o].average=(i[o].sum/i[o].counter).toFixed(2)-0),w=this.component.xAxis.getAxis(s[o].xAxisIndex||0).getCoord(i[o].average),i[o].averageLine=[[w,this.component.grid.getYend()],[w,this.component.grid.getY()]],i[o].minLine=[[i[o].minX,this.component.grid.getYend()],[i[o].minX,this.component.grid.getY()]],i[o].maxLine=[[i[o].maxX,this.component.grid.getYend()],[i[o].maxX,this.component.grid.getY()]],i[o].isHorizontal=!1,this.buildMark(o)},_mapSize:function(e,t,n){var r=this.series,i,s={},o={},u,a=0,f=0,l,c,h,p,d=1;for(var v=0,m=t.length;v1?typeof c=="string"&&c.match(/%$/)?Math.floor(e.getGap()*(100-parseFloat(c))/100):e.getGap()-c:f,x=0,l=a>1?Math.floor((S-f)/(a-1)):0;if(l<0)return this._mapSize(e,t,!0)}return{barWidthMap:s,barMinHeightMap:o,gap:S,barWidth:x,barGap:l,interval:d}},_getBarItem:function(e,t,n,r,i,o,a,f){var l=this.series,c,h=l[e],p=h.data[t],d=this._sIndex2colorMap[e],v=[p,h],m=this.deepQuery(v,"itemStyle.normal.color")||d,g=this.deepQuery(v,"itemStyle.emphasis.color"),y=this.deepMerge(v,"itemStyle.normal"),b=y.borderWidth,w=this.deepMerge(v,"itemStyle.emphasis");c={zlevel:this._zlevelBase,clickable:!0,style:{x:r,y:i,width:o,height:a,brushType:"both",color:this.getItemStyleColor(m,e,t,p),radius:y.borderRadius,lineWidth:b,strokeColor:y.borderColor},highlightStyle:{color:this.getItemStyleColor(g,e,t,p),radius:w.borderRadius,lineWidth:w.borderWidth,strokeColor:w.borderColor},_orient:f},c.highlightStyle.color=c.highlightStyle.color||(typeof c.style.color=="string"?u.lift(c.style.color,-0.3):c.style.color),b>0&&c.style.height>b&&c.style.width>b?(c.style.y+=b/2,c.style.height-=b,c.style.x+=b/2,c.style.width-=b):c.style.brushType="fill",c.highlightStyle.textColor=c.highlightStyle.color,c=this.addLabel(c,h,p,n,f);if(c.style.textPosition=="insideLeft"||c.style.textPosition=="insideRight"||c.style.textPosition=="insideTop"||c.style.textPosition=="insideBottom"){var E=5;switch(c.style.textPosition){case"insideLeft":c.style.textX=c.style.x+E,c.style.textY=c.style.y+c.style.height/2,c.style.textAlign="left",c.style.textBaseline="middle";break;case"insideRight":c.style.textX=c.style.x+c.style.width-E,c.style.textY=c.style.y+c.style.height/2,c.style.textAlign="right",c.style.textBaseline="middle";break;case"insideTop":c.style.textX=c.style.x+c.style.width/2,c.style.textY=c.style.y+E/2,c.style.textAlign="center",c.style.textBaseline="top";break;case"insideBottom":c.style.textX=c.style.x+c.style.width/2,c.style.textY=c.style.y+c.style.height-E/2,c.style.textAlign="center",c.style.textBaseline="bottom"}c.style.textPosition="specific",c.style.textColor=c.style.textColor||"#fff"}return this.deepQuery([p,h,this.option],"calculable")&&(this.setCalculable(c),c.draggable=!0),s.pack(c,l[e],e,l[e].data[t],t,n),c},getMarkCoord:function(e,t){var n=this.series[e],r=this.xMarkMap[e],i=this.component.xAxis.getAxis(n.xAxisIndex),s=this.component.yAxis.getAxis(n.yAxisIndex),o,u;if(!t.type||t.type!="max"&&t.type!="min"&&t.type!="average")if(r.isHorizontal){o=typeof t.xAxis=="string"&&i.getIndexByName?i.getIndexByName(t.xAxis):t.xAxis||0;var a=r[o];a=typeof a!="undefined"?a:typeof t.xAxis!="string"&&i.getCoordByIndex?i.getCoordByIndex(t.xAxis||0):i.getCoord(t.xAxis||0),u=[a,s.getCoord(t.yAxis||0)]}else{o=typeof t.yAxis=="string"&&s.getIndexByName?s.getIndexByName(t.yAxis):t.yAxis||0;var f=r[o];f=typeof f!="undefined"?f:typeof t.yAxis!="string"&&s.getCoordByIndex?s.getCoordByIndex(t.yAxis||0):s.getCoord(t.yAxis||0),u=[i.getCoord(t.xAxis||0),f]}else u=[r[t.type+"X"],r[t.type+"Y"],r[t.type+"Line"],r[t.type]];return u},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},addDataAnimation:function(e){var t=this.series,n={};for(var r=0,i=e.length;r=0;r--){c=s.get(this.shapeList[r],"seriesIndex");if(n[c]&&!n[c][3]&&this.shapeList[r].type=="rectangle"){h=s.get(this.shapeList[r],"dataIndex"),l=t[c];if(n[c][2]&&h==l.data.length-1){this.zr.delShape(this.shapeList[r].id);continue}if(!n[c][2]&&h===0){this.zr.delShape(this.shapeList[r].id);continue}this.shapeList[r]._orient=="horizontal"?(f=this.component.yAxis.getAxis(l.yAxisIndex||0).getGap(),a=n[c][2]?-f:f,o=0):(u=this.component.xAxis.getAxis(l.xAxisIndex||0).getGap(),o=n[c][2]?u:-u,a=0),this.shapeList[r].position=[0,0],this.zr.animate(this.shapeList[r].id,"").when(500,{position:[o,a]}).start()}}}},o.inherits(a,n),o.inherits(a,t),e("../chart").define("bar",a),a}),define("echarts/chart/pie",["require","../component/base","./base","zrender/shape/Text","zrender/shape/Ring","zrender/shape/Circle","zrender/shape/Sector","zrender/shape/BrokenLine","../config","../util/ecData","zrender/tool/util","zrender/tool/math","zrender/tool/color","../chart"],function(e){function p(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this);var u=this;u.shapeHandler.onmouseover=function(e){var t=e.target,n=f.get(t,"seriesIndex"),r=f.get(t,"dataIndex"),i=f.get(t,"special"),s=t._lastAddRadius,o=t.style.startAngle,a=t.style.endAngle,l=t.highlightStyle.color,c=u.getLabel(n,r,i,s,o,a,l,!0);c&&u.zr.addHoverShape(c);var h=u.getLabelLine(n,r,s,t.style.r0,t.style.r,o,a,l,!0);h&&u.zr.addHoverShape(h)},this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("zrender/shape/Text"),i=e("zrender/shape/Ring"),s=e("zrender/shape/Circle"),o=e("zrender/shape/Sector"),u=e("zrender/shape/BrokenLine"),a=e("../config"),f=e("../util/ecData"),l=e("zrender/tool/util"),c=e("zrender/tool/math"),h=e("zrender/tool/color");return p.prototype={type:a.CHART_TYPE_PIE,_buildShape:function(){var e=this.series,t=this.component.legend;this.selectedMap={},this._selected={};var n,r,o;this._selectedMode=!1;var u;for(var l=0,c=e.length;l0&&Math.abs(m-g)<15&&p<4&&this._needLabel(n,r[l],!1)&&this.deepQuery([r[l],n],"itemStyle.normal.label.position")!="center"?d+=h<4?20:-20:d=0,this._buildItem(e,l,h,d,r[l].selected,x,T,m,g,w),v||(m=g)}},_buildItem:function(e,t,n,r,i,s,o,u,a,l){var c=this.series,h=this.getSector(e,t,n,i,s,o,u,a,l);f.pack(h,c[e],e,c[e].data[t],t,c[e].data[t].name,n),h._lastAddRadius=r,this.shapeList.push(h);var p=this.getLabel(e,t,n,r,u,a,l,!1);p&&(f.pack(p,c[e],e,c[e].data[t],t,c[e].data[t].name,n),p._dataIndex=t,this.shapeList.push(p));var d=this.getLabelLine(e,t,r,s,o,u,a,l,!1);d&&(f.pack(d,c[e],e,c[e].data[t],t,c[e].data[t].name,n),d._dataIndex=t,this.shapeList.push(d))},getSector:function(e,t,n,r,i,s,u,a,f){var l=this.series,p=l[e],d=p.data[t],v=[d,p],m=this.parseCenter(this.zr,p.center),g=this.deepMerge(v,"itemStyle.normal")||{},y=this.deepMerge(v,"itemStyle.emphasis")||{},b=this.getItemStyleColor(g.color,e,t,d)||f,w=this.getItemStyleColor(y.color,e,t,d)||(typeof b=="string"?h.lift(b,-0.2):b),E={zlevel:this._zlevelBase,clickable:!0,style:{x:m[0],y:m[1],r0:i,r:s,startAngle:u,endAngle:a,brushType:"both",color:b,lineWidth:g.borderWidth,strokeColor:g.borderColor,lineJoin:"round"},highlightStyle:{color:w,lineWidth:y.borderWidth,strokeColor:y.borderColor,lineJoin:"round"},_seriesIndex:e,_dataIndex:t};if(r){var S=((E.style.startAngle+E.style.endAngle)/2).toFixed(2)-0;E.style._hasSelected=!0,E.style._x=E.style.x,E.style._y=E.style.y;var x=this.query(p,"selectedOffset");E.style.x+=c.cos(S,!0)*x,E.style.y-=c.sin(S,!0)*x,this._selected[e][t]=!0}else this._selected[e][t]=!1;this._selectedMode&&(E.onclick=this.shapeHandler.onclick),this.deepQuery([d,p,this.option],"calculable")&&(this.setCalculable(E),E.draggable=!0);if(this._needLabel(p,d,!0)||this._needLabelLine(p,d,!0))E.onmouseover=this.shapeHandler.onmouseover;return E=new o(E),E},getLabel:function(e,t,n,i,s,o,u,a){var f=this.series,h=f[e],p=h.data[t];if(!this._needLabel(h,p,a))return;var d=a?"emphasis":"normal",v=l.merge(l.clone(p.itemStyle)||{},h.itemStyle),m=v[d].label,g=m.textStyle||{},y=this.parseCenter(this.zr,h.center),b=y[0],w=y[1],E,S,x=((o+s)/2+360)%360,T=this.parseRadius(this.zr,h.radius),N,C="middle";return m.position=m.position||v.normal.label.position,m.position=="center"?(T=T[1],E=b,S=w,N="center"):m.position=="inner"?(T=(T[0]+T[1])/2+i,E=Math.round(b+T*c.cos(x,!0)),S=Math.round(w-T*c.sin(x,!0)),u="#fff",N="center"):(T=T[1]- -v[d].labelLine.length+i,E=b+T*c.cos(x,!0),S=w-T*c.sin(x,!0),N=x>=90&&x<=270?"right":"left"),m.position!="center"&&m.position!="inner"&&(E+=N=="left"?20:-20),p.__labelX=E-(N=="left"?5:-5),p.__labelY=S,new r({zlevel:this._zlevelBase+1,hoverable:!1,style:{x:E,y:S,color:g.color||u,text:this.getLabelText(e,t,n,d),textAlign:g.align||N,textBaseline:g.baseline||C,textFont:this.getFont(g)},highlightStyle:{brushType:"fill"},_seriesIndex:e,_dataIndex:t})},getLabelText:function(e,t,n,r){var i=this.series,s=i[e],o=s.data[t],u=this.deepQuery([o,s],"itemStyle."+r+".label.formatter");if(!u)return o.name;if(typeof u=="function")return u.call(this.myChart,s.name,o.name,o.value,n);if(typeof u=="string")return u=u.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}").replace("{d}","{d0}"),u=u.replace("{a0}",s.name).replace("{b0}",o.name).replace("{c0}",o.value).replace("{d0}",n),u},getLabelLine:function(e,t,n,r,i,s,o,a,f){var h=this.series,p=h[e],d=p.data[t];if(this._needLabelLine(p,d,f)){var v=f?"emphasis":"normal",m=l.merge(l.clone(d.itemStyle)||{},p.itemStyle),g=m[v].labelLine,y=g.lineStyle||{},b=this.parseCenter(this.zr,p.center),w=b[0],E=b[1],S=i,x=this.parseRadius(this.zr,p.radius)[1]- -g.length+n,T=(o+s)/2%360,N=c.cos(T,!0),C=c.sin(T,!0);return new u({zlevel:this._zlevelBase+1,hoverable:!1,style:{pointList:[[w+S*N,E-S*C],[w+x*N,E-x*C],[d.__labelX,d.__labelY]],strokeColor:y.color||a,lineType:y.type,lineWidth:y.width},_seriesIndex:e,_dataIndex:t})}return},_needLabel:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".label.show")},_needLabelLine:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".labelLine.show")},reformOption:function(e){var t=l.merge;return e=t(e||{},this.ecTheme.pie),e.itemStyle.normal.label.textStyle=t(e.itemStyle.normal.label.textStyle||{},this.ecTheme.textStyle),e.itemStyle.emphasis.label.textStyle=t(e.itemStyle.emphasis.label.textStyle||{},this.ecTheme.textStyle),e},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},addDataAnimation:function(e){var t=this.series,n={};for(var r=0,i=e.length;r{b} : {c}",showDelay:20,hideDelay:100,transitionDuration:.4,backgroundColor:"rgba(0,0,0,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,axisPointer:{type:"line",lineStyle:{color:"#48b",width:2,type:"solid"},crossStyle:{color:"#1e90ff",width:1,type:"dashed"},shadowStyle:{color:"rgba(150,150,150,0.3)",width:"auto",type:"default"}},textStyle:{color:"#fff"}},dataZoom:{show:!1,orient:"horizontal",backgroundColor:"rgba(0,0,0,0)",dataBackgroundColor:"#eee",fillerColor:"rgba(144,197,237,0.2)",handleColor:"rgba(70,130,180,0.8)",realtime:!0},grid:{x:80,y:60,x2:80,y2:60,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},categoryAxis:{position:"bottom",name:"",nameLocation:"end",nameTextStyle:{},boundaryGap:!0,axisLine:{show:!0,onZero:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!0,interval:"auto",inside:!1,length:5,lineStyle:{color:"#333",width:1}},axisLabel:{show:!0,interval:"auto",rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}}},valueAxis:{position:"left",name:"",nameLocation:"end",nameTextStyle:{},boundaryGap:[0,0],precision:0,power:100,splitNumber:5,axisLine:{show:!0,onZero:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,inside:!1,length:5,lineStyle:{color:"#333",width:1}},axisLabel:{show:!0,rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}}},polar:{center:["50%","50%"],radius:"75%",startAngle:90,splitNumber:5,name:{show:!0,textStyle:{color:"#333"}},axisLine:{show:!0,lineStyle:{color:"#ccc",width:1,type:"solid"}},axisLabel:{show:!1,textStyle:{color:"#333"}},splitArea:{show:!0,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}},splitLine:{show:!0,lineStyle:{width:1,color:"#ccc"}},type:"polygon"},timeline:{show:!0,type:"time",notMerge:!1,realtime:!0,x:80,x2:80,y2:0,height:50,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,controlPosition:"left",autoPlay:!1,loop:!0,playInterval:2e3,lineStyle:{width:1,color:"#666",type:"dashed"},label:{show:!0,interval:"auto",rotate:0,textStyle:{color:"#333"}},checkpointStyle:{symbol:"auto",symbolSize:"auto",color:"auto",borderColor:"auto",borderWidth:"auto",label:{show:!1,textStyle:{color:"auto"}}},controlStyle:{normal:{color:"#333"},emphasis:{color:"#1e90ff"}},symbol:"emptyDiamond",symbolSize:4,currentIndex:0},roamController:{show:!1,x:"left",y:"top",width:80,height:120,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,handlerColor:"#6495ed",fillerColor:"#fff",step:15,mapTypeControl:null},bar:{clickable:!0,xAxisIndex:0,yAxisIndex:0,barMinHeight:0,barGap:"30%",barCategoryGap:"20%",itemStyle:{normal:{barBorderColor:"#fff",barBorderRadius:0,barBorderWidth:0,label:{show:!1}},emphasis:{barBorderColor:"#fff",barBorderRadius:0,barBorderWidth:0,label:{show:!1}}}},line:{clickable:!0,xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid",shadowColor:"rgba(0,0,0,0)",shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0}},emphasis:{label:{show:!1}}},symbolSize:2,showAllSymbol:!1},k:{clickable:!0,xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{color:"#fff",color0:"#00aa11",lineStyle:{width:1,color:"#ff3200",color0:"#00aa11"}},emphasis:{}}},scatter:{clickable:!0,xAxisIndex:0,yAxisIndex:0,symbolSize:4,large:!1,largeThreshold:2e3,itemStyle:{normal:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}},emphasis:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}}}},radar:{clickable:!0,polarIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid"}},emphasis:{label:{show:!1}}},symbolSize:2},pie:{clickable:!0,center:["50%","50%"],radius:[0,"75%"],clockWise:!0,startAngle:90,minAngle:0,selectedOffset:10,itemStyle:{normal:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1,type:"solid"}}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!1},labelLine:{show:!1,length:20,lineStyle:{width:1,type:"solid"}}}}},map:{mapType:"china",mapValuePrecision:0,showLegendSymbol:!0,hoverable:!0,clickable:!0,itemStyle:{normal:{borderColor:"rgba(0,0,0,0)",borderWidth:1,areaStyle:{color:"#ccc"},label:{show:!1,textStyle:{color:"rgb(139,69,19)"}}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,areaStyle:{color:"rgba(255,215,0,0.8)"},label:{show:!1,textStyle:{color:"rgb(100,0,0)"}}}}},force:{center:["50%","50%"],size:"100%",coolDown:.99,minRadius:10,maxRadius:20,ratioScaling:!1,large:!1,useWorker:!1,steps:1,scaling:1,gravity:1,symbol:"circle",symbolSize:0,linkSymbol:null,linkSymbolSize:[10,15],draggable:!0,clickable:!0,categories:[{}],itemStyle:{normal:{label:{show:!1},nodeStyle:{brushType:"both",color:"#f08c2e",strokeColor:"#5182ab",lineWidth:1},linkStyle:{strokeColor:"#5182ab"}},emphasis:{label:{show:!1},nodeStyle:{},linkStyle:{opacity:0}}}},chord:{clickable:!0,radius:["65%","75%"],center:["50%","50%"],padding:2,sort:"none",sortSub:"none",startAngle:90,clockWise:!0,showScale:!1,showScaleText:!1,itemStyle:{normal:{label:{show:!0,rotate:!1,distance:10},lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:1,color:"#999"}}},emphasis:{lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:1,color:"#666"}}}},matrix:[]},gauge:{center:["50%","50%"],radius:"75%",startAngle:225,endAngle:-45,min:0,max:100,precision:0,splitNumber:10,axisLine:{show:!0,lineStyle:{color:[[.2,"#228b22"],[.8,"#48b"],[1,"#ff4500"]],width:30}},axisTick:{show:!0,splitNumber:5,length:8,lineStyle:{color:"#eee",width:1,type:"solid"}},axisLabel:{show:!0,textStyle:{color:"auto"}},splitLine:{show:!0,length:30,lineStyle:{color:"#eee",width:2,type:"solid"}},pointer:{show:!0,length:"80%",width:8,color:"auto"},title:{show:!0,offsetCenter:[0,"-40%"],textStyle:{color:"#333",fontSize:15}},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:40,offsetCenter:[0,"40%"],textStyle:{color:"auto",fontSize:30}}},funnel:{clickable:!0,x:80,y:60,x2:80,y2:60,min:0,max:100,minSize:"0%",maxSize:"100%",sort:"descending",gap:0,itemStyle:{normal:{borderColor:"#fff",borderWidth:1,label:{show:!0,position:"outer"},labelLine:{show:!0,length:10,lineStyle:{width:1,type:"solid"}}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!0},labelLine:{show:!0}}}},island:{r:15,calculateStep:.1},markPoint:{clickable:!0,symbol:"pin",symbolSize:10,large:!1,effect:{show:!1,loop:!0,period:15,scaleSize:2},itemStyle:{normal:{borderWidth:2,label:{show:!0,position:"inside"}},emphasis:{label:{show:!0}}}},markLine:{clickable:!0,symbol:["circle","arrow"],symbolSize:[2,4],large:!1,effect:{show:!1,loop:!0,period:15,scaleSize:2},itemStyle:{normal:{borderWidth:1.5,label:{show:!0,position:"end"},lineStyle:{type:"dashed"}},emphasis:{label:{show:!1},lineStyle:{}}}},textStyle:{decoration:"none",fontFamily:"Arial, Verdana, sans-serif",fontFamily2:"微软雅黑",fontSize:12,fontStyle:"normal",fontWeight:"normal"},EVENT:{REFRESH:"refresh",RESTORE:"restore",RESIZE:"resize",CLICK:"click",DBLCLICK:"dblclick",HOVER:"hover",MOUSEOUT:"mouseout",DATA_CHANGED:"dataChanged",DATA_ZOOM:"dataZoom",DATA_RANGE:"dataRange",LEGEND_SELECTED:"legendSelected",MAP_SELECTED:"mapSelected",PIE_SELECTED:"pieSelected",MAGIC_TYPE_CHANGED:"magicTypeChanged",DATA_VIEW_CHANGED:"dataViewChanged",TIMELINE_CHANGED:"timelineChanged",MAP_ROAM:"mapRoam",TOOLTIP_HOVER:"tooltipHover",TOOLTIP_IN_GRID:"tooltipInGrid",TOOLTIP_OUT_GRID:"tooltipOutGrid",ROAMCONTROLLER:"roamController"},DRAG_ENABLE_TIME:120,EFFECT_ZLEVEL:7,symbolList:["circle","rectangle","triangle","diamond","emptyCircle","emptyRectangle","emptyTriangle","emptyDiamond"],loadingText:"Loading...",calculable:!1,calculableColor:"rgba(255,165,0,0.6)",calculableHolderColor:"#ccc",nameConnector:" & ",valueConnector:": ",animation:!0,addDataAnimation:!0,animationThreshold:2e3,animationDuration:2e3,animationEasing:"ExponentialOut"};return e}),define("zrender/dep/excanvas",["require"],function(e){return document.createElement("canvas").getContext?G_vmlCanvasManager=!1:function(){function f(){return this.context_||(this.context_=new I(this))}function c(e,t,n){var r=l.call(arguments,2);return function(){return e.apply(t,r.concat(l.call(arguments)))}}function h(e){return String(e).replace(/&/g,"&").replace(/"/g,""")}function p(e,t,n){e.namespaces[t]||e.namespaces.add(t,n,"#default#VML")}function d(e){p(e,"g_vml_","urn:schemas-microsoft-com:vml"),p(e,"g_o_","urn:schemas-microsoft-com:office:office");if(!e.styleSheets.ex_canvas_){var t=e.createStyleSheet();t.owningElement.id="ex_canvas_",t.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}function m(e){var t=e.srcElement;switch(e.propertyName){case"width":t.getContext().clearRect(),t.style.width=t.attributes.width.nodeValue+"px",t.firstChild.style.width=t.clientWidth+"px";break;case"height":t.getContext().clearRect(),t.style.height=t.attributes.height.nodeValue+"px",t.firstChild.style.height=t.clientHeight+"px"}}function g(e){var t=e.srcElement;t.firstChild&&(t.firstChild.style.width=t.clientWidth+"px",t.firstChild.style.height=t.clientHeight+"px")}function E(){return[[1,0,0],[0,1,0],[0,0,1]]}function S(e,t){var n=E();for(var r=0;r<3;r++)for(var i=0;i<3;i++){var s=0;for(var o=0;o<3;o++)s+=e[r][o]*t[o][i];n[r][i]=s}return n}function x(e,t){t.fillStyle=e.fillStyle,t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY,t.strokeStyle=e.strokeStyle,t.globalAlpha=e.globalAlpha,t.font=e.font,t.textAlign=e.textAlign,t.textBaseline=e.textBaseline,t.arcScaleX_=e.arcScaleX_,t.arcScaleY_=e.arcScaleY_,t.lineScale_=e.lineScale_}function N(e){var t=e.indexOf("(",3),n=e.indexOf(")",t+1),r=e.substring(t+1,n).split(",");if(r.length!=4||e.charAt(3)!="a")r[3]=1;return r}function C(e){return parseFloat(e)/100}function k(e,t,n){return Math.min(n,Math.max(t,e))}function L(e){var t,n,r,i,s,o;i=parseFloat(e[0])/360%360,i<0&&i++,s=k(C(e[1]),0,1),o=k(C(e[2]),0,1);if(s==0)t=n=r=o;else{var u=o<.5?o*(1+s):o+s-o*s,a=2*o-u;t=A(a,u,i+1/3),n=A(a,u,i),r=A(a,u,i-1/3)}return"#"+y[Math.floor(t*255)]+y[Math.floor(n*255)]+y[Math.floor(r*255)]}function A(e,t,n){return n<0&&n++,n>1&&n--,6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function M(e){if(e in O)return O[e];var t,n=1;e=String(e);if(e.charAt(0)=="#")t=e;else if(/^rgb/.test(e)){var r=N(e),t="#",i;for(var s=0;s<3;s++)r[s].indexOf("%")!=-1?i=Math.floor(C(r[s])*255):i=+r[s],t+=y[k(i,0,255)];n=+r[3]}else if(/^hsl/.test(e)){var r=N(e);t=L(r),n=r[3]}else t=T[e]||e;return O[e]={color:t,alpha:n}}function P(e){if(D[e])return D[e];var t=document.createElement("div"),n=t.style,r;try{n.font=e,r=n.fontFamily.split(",")[0]}catch(i){}return D[e]={style:n.fontStyle||_.style,variant:n.fontVariant||_.variant,weight:n.fontWeight||_.weight,size:n.fontSize||_.size,family:r||_.family}}function H(e,t){var n={};for(var r in e)n[r]=e[r];var i=parseFloat(t.currentStyle.fontSize),s=parseFloat(e.size);return typeof e.size=="number"?n.size=e.size:e.size.indexOf("px")!=-1?n.size=s:e.size.indexOf("em")!=-1?n.size=i*s:e.size.indexOf("%")!=-1?n.size=i/100*s:e.size.indexOf("pt")!=-1?n.size=s/.75:n.size=i,n}function B(e){return e.style+" "+e.variant+" "+e.weight+" "+e.size+"px '"+e.family+"'"}function F(e){return j[e]||"square"}function I(e){this.m_=E(),this.mStack_=[],this.aStack_=[],this.currentPath_=[],this.strokeStyle="#000",this.fillStyle="#000",this.lineWidth=1,this.lineJoin="miter",this.lineCap="butt",this.miterLimit=o*1,this.globalAlpha=1,this.font="12px 微软雅黑",this.textAlign="left",this.textBaseline="alphabetic",this.canvas=e;var t="width:"+e.clientWidth+"px;height:"+e.clientHeight+"px;overflow:hidden;position:absolute",n=e.ownerDocument.createElement("div");n.style.cssText=t,e.appendChild(n);var r=n.cloneNode(!1);r.style.backgroundColor="#fff",r.style.filter="alpha(opacity=0)",e.appendChild(r),this.element_=n,this.arcScaleX_=1,this.arcScaleY_=1,this.lineScale_=1}function R(e,t,n,r){e.currentPath_.push({type:"bezierCurveTo",cp1x:t.x,cp1y:t.y,cp2x:n.x,cp2y:n.y,x:r.x,y:r.y}),e.currentX_=r.x,e.currentY_=r.y}function U(e,t){var n=M(e.strokeStyle),r=n.color,i=n.alpha*e.globalAlpha,s=e.lineScale_*e.lineWidth;s<1&&(i*=s),t.push("')}function z(t,n,r,i){var s=t.fillStyle,u=t.arcScaleX_,a=t.arcScaleY_,f=i.x-r.x,l=i.y-r.y;if(s instanceof $){var c=0,h={x:0,y:0},p=0,d=1;if(s.type_=="gradient"){var v=s.x0_/u,m=s.y0_/a,g=s.x1_/u,y=s.y1_/a,b=W(t,v,m),w=W(t,g,y),E=w.x-b.x,S=w.y-b.y;c=Math.atan2(E,S)*180/Math.PI,c<0&&(c+=360),c<1e-6&&(c=0)}else{var b=W(t,s.x0_,s.y0_);h={x:(b.x-r.x)/f,y:(b.y-r.y)/l},f/=u*o,l/=a*o;var x=e.max(f,l);p=2*s.r0_/x,d=2*s.r1_/x-p}var T=s.colors_;T.sort(function(e,t){return e.offset-t.offset});var N=T.length,C=T[0].color,k=T[N-1].color,L=T[0].alpha*t.globalAlpha,A=T[N-1].alpha*t.globalAlpha,O=[];for(var _=0;_')}else if(s instanceof J){if(f&&l){var P=-r.x,H=-r.y;n.push("')}}else{var B=M(t.fillStyle),j=B.color,F=B.alpha*t.globalAlpha;n.push('')}}function W(e,t,n){var r=e.m_;return{x:o*(t*r[0][0]+n*r[1][0]+r[2][0])-u,y:o*(t*r[0][1]+n*r[1][1]+r[2][1])-u}}function X(e){return isFinite(e[0][0])&&isFinite(e[0][1])&&isFinite(e[1][0])&&isFinite(e[1][1])&&isFinite(e[2][0])&&isFinite(e[2][1])}function V(e,t,n){if(!X(t))return;e.m_=t;if(n){var r=t[0][0]*t[1][1]-t[0][1]*t[1][0];e.lineScale_=s(i(r))}}function $(e){this.type_=e,this.x0_=0,this.y0_=0,this.r0_=0,this.x1_=0,this.y1_=0,this.r1_=0,this.colors_=[]}function J(e,t){Q(e);switch(t){case"repeat":case null:case"":this.repetition_="repeat";break;case"repeat-x":case"repeat-y":case"no-repeat":this.repetition_=t;break;default:K("SYNTAX_ERR")}this.src_=e.src,this.width_=e.width,this.height_=e.height}function K(e){throw new G(e)}function Q(e){(!e||e.nodeType!=1||e.tagName!="IMG")&&K("TYPE_MISMATCH_ERR"),e.readyState!="complete"&&K("INVALID_STATE_ERR")}function G(e){this.code=this[e],this.message=e+": DOM Exception "+this.code}var e=Math,t=e.round,n=e.sin,r=e.cos,i=e.abs,s=e.sqrt,o=10,u=o/2,a=+navigator.userAgent.match(/MSIE ([\d.]+)?/)[1],l=Array.prototype.slice;d(document);var v={init:function(e){var t=e||document;t.createElement("canvas"),t.attachEvent("onreadystatechange",c(this.init_,this,t))},init_:function(e){var t=e.getElementsByTagName("canvas");for(var n=0;n'),(f||l)&&w.push('
'),w.push('
'),(f||l)&&w.push("
"),w.push("
"),this.element_.insertAdjacentHTML("BeforeEnd",w.join(""))},q.stroke=function(e){var n=[],r=!1,i=10,s=10;n.push("f.x)f.x=c.x;if(a.y==null||c.yf.y)f.y=c.y}}n.push(' ">'),e?z(this,n,a,f):U(this,n),n.push(""),this.element_.insertAdjacentHTML("beforeEnd",n.join(""))},q.fill=function(){this.stroke(!0)},q.closePath=function(){this.currentPath_.push({type:"close"})},q.save=function(){var e={};x(this,e),this.aStack_.push(e),this.mStack_.push(this.m_),this.m_=S(E(),this.m_)},q.restore=function(){this.aStack_.length&&(x(this.aStack_.pop(),this),this.m_=this.mStack_.pop())},q.translate=function(e,t){var n=[[1,0,0],[0,1,0],[e,t,1]];V(this,S(n,this.m_),!1)},q.rotate=function(e){var t=r(e),i=n(e),s=[[t,i,0],[-i,t,0],[0,0,1]];V(this,S(s,this.m_),!1)},q.scale=function(e,t){this.arcScaleX_*=e,this.arcScaleY_*=t;var n=[[e,0,0],[0,t,0],[0,0,1]];V(this,S(n,this.m_),!0)},q.transform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,S(o,this.m_),!0)},q.setTransform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,o,!0)},q.drawText_=function(e,n,r,i,s){var u=this.m_,a=1e3,f=0,l=a,c={x:0,y:0},p=[],d=H(P(this.font),this.element_),v=B(d),m=this.element_.currentStyle,g=this.textAlign.toLowerCase();switch(g){case"left":case"center":case"right":break;case"end":g=m.direction=="ltr"?"right":"left";break;case"start":g=m.direction=="rtl"?"right":"left";break;default:g="left"}switch(this.textBaseline){case"hanging":case"top":c.y=d.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":c.y=-d.size/2.25}switch(g){case"right":f=a,l=.05;break;case"center":f=l=a/2}var y=W(this,n+c.x,r+c.y);p.push(''),s?U(this,p):z(this,p,{x:-f,y:0},{x:l,y:d.size});var b=u[0][0].toFixed(3)+","+u[1][0].toFixed(3)+","+u[0][1].toFixed(3)+","+u[1][1].toFixed(3)+",0,0",w=t(y.x/o)+","+t(y.y/o);p.push('','',''),this.element_.insertAdjacentHTML("beforeEnd",p.join(""))},q.fillText=function(e,t,n,r){this.drawText_(e,t,n,r,!1)},q.strokeText=function(e,t,n,r){this.drawText_(e,t,n,r,!0)},q.measureText=function(e){if(!this.textMeasureEl_){var t='';this.element_.insertAdjacentHTML("beforeEnd",t),this.textMeasureEl_=this.element_.lastChild}var n=this.element_.ownerDocument;return this.textMeasureEl_.innerHTML="",this.textMeasureEl_.style.font=this.font,this.textMeasureEl_.appendChild(n.createTextNode(e)),{width:this.textMeasureEl_.offsetWidth}},q.clip=function(){},q.arcTo=function(){},q.createPattern=function(e,t){return new J(e,t)},$.prototype.addColorStop=function(e,t){t=M(t),this.colors_.push({offset:e,color:t.color,alpha:t.alpha})};var Y=G.prototype=new Error;Y.INDEX_SIZE_ERR=1,Y.DOMSTRING_SIZE_ERR=2,Y.HIERARCHY_REQUEST_ERR=3,Y.WRONG_DOCUMENT_ERR=4,Y.INVALID_CHARACTER_ERR=5,Y.NO_DATA_ALLOWED_ERR=6,Y.NO_MODIFICATION_ALLOWED_ERR=7,Y.NOT_FOUND_ERR=8,Y.NOT_SUPPORTED_ERR=9,Y.INUSE_ATTRIBUTE_ERR=10,Y.INVALID_STATE_ERR=11,Y.SYNTAX_ERR=12,Y.INVALID_MODIFICATION_ERR=13,Y.NAMESPACE_ERR=14,Y.INVALID_ACCESS_ERR=15,Y.VALIDATION_ERR=16,Y.TYPE_MISMATCH_ERR=17,G_vmlCanvasManager=v,CanvasRenderingContext2D=I,CanvasGradient=$,CanvasPattern=J,DOMException=G}(),G_vmlCanvasManager}),define("zrender/tool/util",["require","../dep/excanvas"],function(e){function n(e){if(typeof e=="object"&&e!==null){var r=e;if(e instanceof Array){r=[];for(var i=0,s=e.length;if&&(f=e+c+n,u.width=f,r=!0),t+h>l&&(l=t+h+n,u.height=l,r=!0),e<-c&&(c=Math.ceil(-e/n)*n,f+=c,u.width=f,r=!0),t<-h&&(h=Math.ceil(-t/n)*n,l+=h,u.height=l,r=!0),r&&a.translate(c,h)}function v(){return{x:c,y:h}}function m(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n3&&(t=Array.prototype.slice.call(t,1));var r=this._handlers[e],i=r.length;for(var s=0;s4&&(t=Array.prototype.slice.call(t,1,t.length-1));var r=t[t.length-1],i=this._handlers[e],s=i.length;for(var o=0;o1)for(var e in arguments)console.log(arguments[e])}}),define("zrender/tool/guid",[],function(){var e=2311;return function(){return"zrender__"+e++}}),define("zrender/tool/vector",[],function(){var e=typeof Float32Array=="undefined"?Array:Float32Array,t={create:function(t,n){var r=new e(2);return r[0]=t||0,r[1]=n||0,r},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e},set:function(e,t,n){return e[0]=t,e[1]=n,e},add:function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e},scaleAndAdd:function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e},sub:function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e},len:function(e){return Math.sqrt(this.lenSquare(e))},lenSquare:function(e){return e[0]*e[0]+e[1]*e[1]},mul:function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e},div:function(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e},dot:function(e,t){return e[0]*t[0]+e[1]*t[1]},scale:function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e},normalize:function(e,n){var r=t.len(n);return r===0?(e[0]=0,e[1]=0):(e[0]=n[0]/r,e[1]=n[1]/r),e},distance:function(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))},distanceSquare:function(e,t){return(e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])},negate:function(e,t){return e[0]=-t[0],e[1]=-t[1],e},lerp:function(e,t,n,r){return e[0]=t[0]+r*(n[0]-t[0]),e[1]=t[1]+r*(n[1]-t[1]),e},applyTransform:function(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[2]*i+n[4],e[1]=n[1]*r+n[3]*i+n[5],e},min:function(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e},max:function(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}};return t.length=t.len,t.lengthSquare=t.lenSquare,t.dist=t.distance,t.distSquare=t.distanceSquare,t}),define("zrender/tool/matrix",[],function(){var e=typeof Float32Array=="undefined"?Array:Float32Array,t={create:function(){var n=new e(6);return t.identity(n),n},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},mul:function(e,t,n){return e[0]=t[0]*n[0]+t[2]*n[1],e[1]=t[1]*n[0]+t[3]*n[1],e[2]=t[0]*n[2]+t[2]*n[3],e[3]=t[1]*n[2]+t[3]*n[3],e[4]=t[0]*n[4]+t[2]*n[5]+t[4],e[5]=t[1]*n[4]+t[3]*n[5]+t[5],e},translate:function(e,t,n){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+n[0],e[5]=t[5]+n[1],e},rotate:function(e,t,n){var r=t[0],i=t[2],s=t[4],o=t[1],u=t[3],a=t[5],f=Math.sin(n),l=Math.cos(n);return e[0]=r*l+o*f,e[1]=-r*f+o*l,e[2]=i*l+u*f,e[3]=-i*f+l*u,e[4]=l*s+f*a,e[5]=l*a-f*s,e},scale:function(e,t,n){var r=n[0],i=n[1];return e[0]=t[0]*r,e[1]=t[1]*i,e[2]=t[2]*r,e[3]=t[3]*i,e[4]=t[4]*r,e[5]=t[5]*i,e},invert:function(e,t){var n=t[0],r=t[2],i=t[4],s=t[1],o=t[3],u=t[5],a=n*o-s*r;return a?(a=1/a,e[0]=o*a,e[1]=-s*a,e[2]=-r*a,e[3]=n*a,e[4]=(r*u-o*i)*a,e[5]=(s*i-n*u)*a,e):null},mulVector:function(e,t,n){var r=t[0],i=t[2],s=t[4],o=t[1],u=t[3],a=t[5];return e[0]=n[0]*r+n[1]*i+s,e[1]=n[0]*o+n[1]*u+a,e}};return t}),define("zrender/Handler",["require","./config","./tool/env","./tool/event","./tool/util","./tool/vector","./tool/matrix","./mixin/Eventful"],function(e){function c(e,t){return function(n){return e.call(t,n)}}function h(e,t){return function(n,r,i){return e.call(t,n,r,i)}}function p(e){var t=f.length;while(t--){var n=f[t];e["_"+n+"Handler"]=c(l[n],e)}}function m(e,t,n){if(this._draggingTarget&&this._draggingTarget.id==e.id||e.isSilent())return!1;var r=this._event;if(e.isCover(t,n)){e.hoverable&&this.storage.addHover(e);var i=e.parent;while(i){if(i.clipShape&&!i.clipShape.isCover(this._mouseX,this._mouseY))return!1;i=i.parent}return this._lastHover!=e&&(this._processOutShape(r),this._processDragLeave(r),this._lastHover=e,this._processDragEnter(r)),this._processOverShape(r),this._processDragOver(r),this._hasfound=1,!0}return!1}var t=e("./config"),n=e("./tool/env"),r=e("./tool/event"),i=e("./tool/util"),s=e("./tool/vector"),o=e("./tool/matrix"),u=t.EVENT,a=e("./mixin/Eventful"),f=["resize","click","dblclick","mousewheel","mousemove","mouseout","mouseup","mousedown","touchstart","touchend","touchmove"],l={resize:function(e){e=e||window.event,this._lastHover=null,this._isMouseDown=0,this.dispatch(u.RESIZE,e)},click:function(e){e=this._zrenderEventFixed(e);var t=this._lastHover;(t&&t.clickable||!t)&&this._dispatchAgency(t,u.CLICK,e),this._mousemoveHandler(e)},dblclick:function(e){e=this._zrenderEventFixed(e);var t=this._lastHover;(t&&t.clickable||!t)&&this._dispatchAgency(t,u.DBLCLICK,e),this._mousemoveHandler(e)},mousewheel:function(e){e=this._zrenderEventFixed(e);var t=e.wheelDelta||-e.detail,n=t>0?1.1:1/1.1,r=this.painter.getLayers(),i=!1;for(var s in r)if(s!=="hover"){var o=r[s],a=o.position;if(o.zoomable){o.__zoom=o.__zoom||1;var f=o.__zoom;f*=n,f=Math.max(Math.min(o.maxZoom,f),o.minZoom),n=f/o.__zoom,o.__zoom=f,a[0]-=(this._mouseX-a[0])*(n-1),a[1]-=(this._mouseY-a[1])*(n-1),o.scale[0]*=n,o.scale[1]*=n,o.dirty=!0,i=!0}}i&&this.painter.refresh(),this._dispatchAgency(this._lastHover,u.MOUSEWHEEL,e),this._mousemoveHandler(e)},mousemove:function(e){if(this.painter.isLoading())return;e=this._zrenderEventFixed(e),this._lastX=this._mouseX,this._lastY=this._mouseY,this._mouseX=r.getX(e),this._mouseY=r.getY(e);var t=this._mouseX-this._lastX,n=this._mouseY-this._lastY;this._processDragStart(e),this._hasfound=0,this._event=e,this._iterateAndFindHover();if(!this._hasfound){if(!this._draggingTarget||this._lastHover&&this._lastHover!=this._draggingTarget)this._processOutShape(e),this._processDragLeave(e);this._lastHover=null,this.storage.delHover(),this.painter.clearHover()}var i="default";if(this._draggingTarget)this.storage.drift(this._draggingTarget.id,t,n),this.storage.addHover(this._draggingTarget);else if(this._isMouseDown){var s=this.painter.getLayers(),o=!1;for(var a in s)if(a!=="hover"){var f=s[a];f.panable&&(i="move",f.position[0]+=t,f.position[1]+=n,o=!0,f.dirty=!0)}o&&this.painter.refresh()}this._draggingTarget||this._hasfound&&this._lastHover.draggable?i="move":this._hasfound&&this._lastHover.clickable&&(i="pointer"),this.root.style.cursor=i,this._dispatchAgency(this._lastHover,u.MOUSEMOVE,e),(this._draggingTarget||this._hasfound||this.storage.hasHoverShape())&&this.painter.refreshHover()},mouseout:function(e){e=this._zrenderEventFixed(e);var t=e.toElement||e.relatedTarget;if(t!=this.root)while(t&&t.nodeType!=9){if(t==this.root){this._mousemoveHandler(e);return}t=t.parentNode}e.zrenderX=this._lastX,e.zrenderY=this._lastY,this.root.style.cursor="default",this._isMouseDown=0,this._processOutShape(e),this._processDrop(e),this._processDragEnd(e),this.painter.isLoading()||this.painter.refreshHover(),this.dispatch(u.GLOBALOUT,e)},mousedown:function(e){if(this._lastDownButton==2){this._lastDownButton=e.button,this._mouseDownTarget=null;return}this._lastMouseDownMoment=new Date,e=this._zrenderEventFixed(e),this._isMouseDown=1,this._mouseDownTarget=this._lastHover,this._dispatchAgency(this._lastHover,u.MOUSEDOWN,e),this._lastDownButton=e.button},mouseup:function(e){e=this._zrenderEventFixed(e),this.root.style.cursor="default",this._isMouseDown=0,this._mouseDownTarget=null,this._dispatchAgency(this._lastHover,u.MOUSEUP,e),this._processDrop(e),this._processDragEnd(e)},touchstart:function(e){e=this._zrenderEventFixed(e,!0),this._lastTouchMoment=new Date,this._mobildFindFixed(e),this._mousedownHandler(e)},touchmove:function(e){e=this._zrenderEventFixed(e,!0),this._mousemoveHandler(e),this._isDragging&&r.stop(e)},touchend:function(e){e=this._zrenderEventFixed(e,!0),this._mouseupHandler(e);var t=new Date;t-this._lastTouchMoment=0;u--){var a=t[u];n!==a.zlevel&&(r=this.painter.getLayer(a.zlevel,r),i[0]=this._mouseX,i[1]=this._mouseY,r.needTransform&&(o.invert(e,r.transform),s.applyTransform(i,i,e)));if(this._findHover(a,i[0],i[1]))break}}}();var v=[{x:10},{x:-20},{x:10,y:10},{y:-20}];return d.prototype._mobildFindFixed=function(e){this._lastHover=null,this._mouseX=e.zrenderX,this._mouseY=e.zrenderY,this._event=e,this._iterateAndFindHover();for(var t=0;!this._lastHover&&t-n&&en||e<-n}function l(e,t,n,r,i){var s=1-i;return s*s*(s*e+3*i*t)+i*i*(i*r+3*s*n)}function c(e,t,n,r,i){var s=1-i;return 3*(((t-e)*s+2*(n-t)*i)*s+(r-n)*i*i)}function h(e,t,n,s,o,u){var f=s+3*(t-n)-e,l=3*(n-t*2+e),c=3*(t-e),h=e-o,p=l*l-3*f*c,d=l*c-9*f*h,v=c*c-3*l*h,m=0;if(a(p)&&a(d))if(a(l))u[0]=0;else{var g=-c/l;g>=0&&g<=1&&(u[m++]=g)}else{var y=d*d-4*p*v;if(a(y)){var b=d/p,g=-l/f+b,w=-b/2;g>=0&&g<=1&&(u[m++]=g),w>=0&&w<=1&&(u[m++]=w)}else if(y>0){var E=Math.sqrt(y),S=p*l+1.5*f*(-d+E),x=p*l+1.5*f*(-d-E);S<0?S=-Math.pow(-S,i):S=Math.pow(S,i),x<0?x=-Math.pow(-x,i):x=Math.pow(x,i);var g=(-l-(S+x))/(3*f);g>=0&&g<=1&&(u[m++]=g)}else{var T=(2*p*l-3*f*d)/(2*Math.sqrt(p*p*p)),N=Math.acos(T)/3,C=Math.sqrt(p),k=Math.cos(N),g=(-l-2*C*k)/(3*f),w=(-l+C*(k+r*Math.sin(N)))/(3*f),L=(-l+C*(k-r*Math.sin(N)))/(3*f);g>=0&&g<=1&&(u[m++]=g),w>=0&&w<=1&&(u[m++]=w),L>=0&&L<=1&&(u[m++]=L)}}return m}function p(e,t,n,r,i){var s=6*n-12*t+6*e,o=9*t+3*r-3*e-9*n,u=3*t-3*e,l=0;if(a(o)){if(f(s)){var c=-u/s;c>=0&&c<=1&&(i[l++]=c)}}else{var h=s*s-4*o*u;if(a(h))i[0]=-s/(2*o);else if(h>0){var p=Math.sqrt(h),c=(-s+p)/(2*o),d=(-s-p)/(2*o);c>=0&&c<=1&&(i[l++]=c),d>=0&&d<=1&&(i[l++]=d)}}return l}function d(e,t,n,r,i,s){var o=(t-e)*i+e,u=(n-t)*i+t,a=(r-n)*i+n,f=(u-o)*i+o,l=(a-u)*i+u,c=(l-f)*i+f;s[0]=e,s[1]=o,s[2]=f,s[3]=c,s[4]=c,s[5]=l,s[6]=a,s[7]=r}function v(e,r,i,a,f,c,h,p,d,v,m){var g,y=.005,b=Infinity;s[0]=d,s[1]=v;for(var w=0;w<1;w+=.05){o[0]=l(e,i,f,h,w),o[1]=l(r,a,c,p,w);var E=t.distSquare(s,o);E=0&&E=0&&c<=1&&(i[l++]=c)}}else{var h=o*o-4*s*u;if(a(h)){var c=-o/(2*s);c>=0&&c<=1&&(i[l++]=c)}else if(h>0){var p=Math.sqrt(h),c=(-o+p)/(2*s),d=(-o-p)/(2*s);c>=0&&c<=1&&(i[l++]=c),d>=0&&d<=1&&(i[l++]=d)}}return l}function b(e,t,n){var r=e+n-2*t;return r===0?.5:(e-t)/r}function w(e,r,i,a,f,l,c,h,p){var d,v=.005,g=Infinity;s[0]=c,s[1]=h;for(var y=0;y<1;y+=.05){o[0]=m(e,i,f,y),o[1]=m(r,a,l,y);var b=t.distSquare(s,o);b=0&&bt+u&&o>r+u||oe+u&&s>n+u||st+h&&c>i+h&&c>o+h&&c>a+h||ce+h&&l>r+h&&l>s+h&&l>u+h||lt+l&&f>i+l&&f>o+l||fe+l&&a>r+l&&a>s+l||an||h+ci&&(i+=f);var p=Math.atan2(a,u);return p<0&&(p+=f),p>=r&&p<=i||p+f>=r&&p+f<=i}function b(e,t,n,r){var t=Math.max(t,10);for(var i=0,s=e.length-1;in*n}function E(e,t,n,r,i,s){return i>=e&&i<=e+n&&s>=t&&s<=t+r}function S(e,t,n,r,i){return(r-e)*(r-e)+(i-t)*(i-t)=360)return!0;var r=(360-Math.atan2(n-e.y,t-e.x)/Math.PI*180)%360,i=(360+e.endAngle)%360,s=(360+e.startAngle)%360;return i>s?r>=s&&r<=i:!(r>=i&&r<=s)}function T(e,t,n){var r=e.length,i=0;for(var s=0,o=r-1;st&&s>r||si?o:0}function L(){var e=k[0];k[0]=k[1],k[1]=e}function A(e,t,r,i,s,o,u,a,f,l){if(l>t&&l>i&&l>o&&l>a||l1&&L(),d=n.cubicAt(t,i,o,a,k[0]),p>1&&(v=n.cubicAt(t,i,o,a,k[1]))),p==2?gt&&a>i&&a>o||a=0&&l<=1){var c=0,h=n.quadraticAt(t,i,o,l);for(var p=0;pu)continue;C[p]u?0:on||u<-n)return 0;var a=Math.sqrt(n*n-u*u);C[0]=-a,C[1]=a,s?(r=l(i),i=l(r)):(r=l(r),i=l(i)),r>i&&(i+=f);var c=0;for(var h=0;h<2;h++){var p=C[h];if(p+e>o){var d=Math.atan2(u,p),v=s?1:-1;d<0&&(d=f+d);if(d>=r&&d<=i||d+f>=r&&d+f<=i)d>Math.PI/2&&d0){h&&(s+=N(o,u,a,f,r,i));if(s!==0)return!0}a=b[b.length-2],f=b[b.length-1],l=!1}switch(d.command){case"M":o=b[0],u=b[1];break;case"L":if(c&&v(o,u,b[0],b[1],t,r,i))return!0;h&&(s+=N(o,u,b[0],b[1],r,i)),o=b[0],u=b[1];break;case"C":if(c&&m(o,u,b[0],b[1],b[2],b[3],b[4],b[5],t,r,i))return!0;h&&(s+=A(o,u,b[0],b[1],b[2],b[3],b[4],b[5],r,i)),o=b[4],u=b[5];break;case"Q":if(c&&g(o,u,b[0],b[1],b[2],b[3],t,r,i))return!0;h&&(s+=O(o,u,b[0],b[1],b[2],b[3],r,i)),o=b[2],u=b[3];break;case"A":var w=b[0],E=b[1],S=b[2],x=b[3],T=b[4],C=b[5],k=Math.cos(T)*S+w,L=Math.sin(T)*x+E;s+=N(o,u,k,L);var _=(r-w)*x/S+w;if(c&&y(w,E,x,T,T+C,1-b[7],t,_,i))return!0;h&&(s+=M(w,E,x,T,T+C,1-b[7],_,i)),o=Math.cos(T+C)*S+w,u=Math.sin(T+C)*x+E;break;case"z":if(c&&v(o,u,a,f,t,r,i))return!0;l=!0}}return h&&(s+=N(o,u,a,f,r,i)),s!==0}function D(e,n){var s=e+":"+n;if(i[s])return i[s];r=r||t.getContext(),r.save(),n&&(r.font=n),e=(e+"").split("\n");var u=0;for(var f=0,l=e.length;fa&&(o=0,i={}),u}function P(e,n){var i=e+":"+n;if(s[i])return s[i];r=r||t.getContext(),r.save(),n&&(r.font=n),e=(e+"").split("\n");var o=(r.measureText("国").width+2)*e.length;return r.restore(),s[i]=o,++u>a&&(u=0,s={}),o}var t=e("./util"),n=e("./curve"),r,i={},s={},o=0,u=0,a=5e3,f=Math.PI*2,C=[-1,-1,-1],k=[-1,-1];return{isInside:c,isOutside:d,getTextWidth:D,getTextHeight:P,isInsidePath:_,isInsidePolygon:T,isInsideSector:x,isInsideCircle:S,isInsideLine:v,isInsideRect:E,isInsideBrokenLine:b}}),define("zrender/mixin/Transformable",["require","../tool/matrix","../tool/vector"],function(e){function s(e){return e>-i&&ei||e<-i}var t=e("../tool/matrix"),n=e("../tool/vector"),r=[0,0],i=5e-5,u=function(){this.position||(this.position=[0,0]),typeof this.rotation=="undefined"&&(this.rotation=[0,0,0]),this.scale||(this.scale=[1,1,0,0]),this.needLocalTransform=!1,this.needTransform=!1};return u.prototype={constructor:u,updateNeedTransform:function(){this.needLocalTransform=o(this.rotation[0])||o(this.position[0])||o(this.position[1])||o(this.scale[0]-1)||o(this.scale[1]-1)},updateTransform:function(){this.updateNeedTransform(),this.parent?this.needTransform=this.needLocalTransform||this.parent.needTransform:this.needTransform=this.needLocalTransform;if(!this.needTransform)return;var e=this.transform||t.create();t.identity(e);if(this.needLocalTransform){if(o(this.scale[0])||o(this.scale[1])){r[0]=-this.scale[2]||0,r[1]=-this.scale[3]||0;var n=o(r[0])||o(r[1]);n&&t.translate(e,e,r),t.scale(e,e,this.scale),n&&(r[0]=-r[0],r[1]=-r[1],t.translate(e,e,r))}if(this.rotation instanceof Array){if(this.rotation[0]!==0){r[0]=-this.rotation[1]||0,r[1]=-this.rotation[2]||0;var n=o(r[0])||o(r[1]);n&&t.translate(e,e,r),t.rotate(e,e,this.rotation[0]),n&&(r[0]=-r[0],r[1]=-r[1],t.translate(e,e,r))}}else this.rotation!==0&&t.rotate(e,e,this.rotation);(o(this.position[0])||o(this.position[1]))&&t.translate(e,e,this.position)}this.transform=e,this.parent&&this.parent.needTransform&&(this.needLocalTransform?t.mul(this.transform,this.parent.transform,this.transform):t.copy(this.transform,this.parent.transform))},setTransform:function(e){if(this.needTransform){var t=this.transform;e.transform(t[0],t[1],t[2],t[3],t[4],t[5])}},lookAt:function(){var e=n.create();return function(r){this.transform||(this.transform=t.create());var i=this.transform;n.sub(e,r,this.position);if(s(e[0])&&s(e[1]))return;n.normalize(e,e),i[2]=e[0]*this.scale[1],i[3]=e[1]*this.scale[1],i[0]=e[1]*this.scale[0],i[1]=-e[0]*this.scale[0],i[4]=this.position[0],i[5]=this.position[1],this.decomposeTransform()}}(),decomposeTransform:function(){if(!this.transform)return;var e=this.transform,t=e[0]*e[0]+e[1]*e[1],n=this.position,r=this.scale,i=this.rotation;o(t-1)&&(t=Math.sqrt(t));var s=e[2]*e[2]+e[3]*e[3];o(s-1)&&(s=Math.sqrt(s)),n[0]=e[4],n[1]=e[5],r[0]=t,r[1]=s,r[2]=r[3]=0,i[0]=Math.atan2(-e[1]/s,e[0]/t),i[1]=i[2]=0}},u}),define("zrender/tool/color",["require","../tool/util"],function(e){function f(e){r=e}function l(){r=i}function c(e,t){return e|=0,t=t||r,t[e%t.length]}function h(e){s=e}function p(){o=s}function d(){return s}function v(e,r,i,s,o,u,a){n||(n=t.getContext());var f=n.createRadialGradient(e,r,i,s,o,u);for(var l=0,c=a.length;l1)for(var i=0,s=r-1;i1?Math.ceil(e):e});if(t.indexOf("hex")>-1)return"#"+((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1);if(t.indexOf("hs")>-1){var n=q(e.slice(1,3),function(e){return e+"%"});e[1]=n[0],e[2]=n[1]}return t.indexOf("a")>-1?(e.length===3&&e.push(1),e[3]=R(e[3],[0,1]),t+"("+e.slice(0,4).join(",")+")"):t+"("+e.slice(0,3).join(",")+")"}}function w(e){e=_(e),e.indexOf("rgba")<0&&(e=S(e));var t=[],n=0;return e.replace(/[\d.]+/g,function(e){n<3?e|=0:e=+e,t[n++]=e}),t}function E(e,t){var n=F(e),r=n[3];return typeof r=="undefined"&&(r=1),e.indexOf("hsb")>-1?n=U(n):e.indexOf("hsl")>-1&&(n=z(n)),t.indexOf("hsb")>-1||t.indexOf("hsv")>-1?n=X(n):t.indexOf("hsl")>-1&&(n=V(n)),n[3]=r,b(n,t)}function S(e){return E(e,"rgba")}function x(e){return E(e,"rgb")}function T(e){return E(e,"hex")}function N(e){return E(e,"hsva")}function C(e){return E(e,"hsv")}function k(e){return E(e,"hsba")}function L(e){return E(e,"hsb")}function A(e){return E(e,"hsla")}function O(e){return E(e,"hsl")}function M(e){for(var t in a)if(T(a[t])===T(e))return t;return null}function _(e){return String(e).replace(/\s+/g,"")}function D(e){a[e]&&(e=a[e]),e=_(e),e=e.replace(/hsv/i,"hsb");if(/^#[\da-f]{3}$/i.test(e)){e=parseInt(e.slice(1),16);var t=(e&3840)<<8,n=(e&240)<<4,r=e&15;e="#"+((1<<24)+(t<<4)+t+(n<<4)+n+(r<<4)+r).toString(16).slice(1)}return e}function P(e,t){var n=t>0?1:-1;typeof t=="undefined"&&(t=0),t=Math.abs(t)>1?1:Math.abs(t),e=x(e);var r=F(e);for(var i=0;i<3;i++)n===1?r[i]=r[i]*(1-t)|0:r[i]=(255-r[i])*t+r[i]|0;return"rgb("+r.join(",")+")"}function H(e){var t=F(S(e));return t=q(t,function(e){return 255-e}),b(t,"rgb")}function B(e,t,n){typeof n=="undefined"&&(n=.5),n=1-R(n,[0,1]);var r=n*2-1,i=F(S(e)),s=F(S(t)),o=i[3]-s[3],u=((r*o===-1?r:(r+o)/(1+r*o))+1)/2,a=1-u,f=[];for(var l=0;l<3;l++)f[l]=i[l]*u+s[l]*a;var c=i[3]*n+s[3]*(1-n);return c=Math.max(0,Math.min(1,c)),i[3]===1&&s[3]===1?b(f,"rgb"):(f[3]=c,b(f,"rgba"))}function j(){return"#"+Math.random().toString(16).slice(2,8)}function F(e){e=D(e);var t=e.match(u);if(t===null)throw new Error("The color format error");var n,r,i=[],s;if(t[2])n=t[2].replace("#","").split(""),s=[n[0]+n[1],n[2]+n[3],n[4]+n[5]],i=q(s,function(e){return R(parseInt(e,16),[0,255])});else if(t[4]){var o=t[4].split(",");r=o[3],s=o.slice(0,3),i=q(s,function(e){return e=Math.floor(e.indexOf("%")>0?parseInt(e,0)*2.55:e),R(e,[0,255])}),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}else if(t[5]||t[6]){var a=(t[5]||t[6]).split(","),f=parseInt(a[0],0)/360,l=a[1],c=a[2];r=a[3],i=q([l,c],function(e){return R(parseFloat(e)/100,[0,1])}),i.unshift(f),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}return i}function I(e,t){t===null&&(t=1);var n=F(S(e));return n[3]=R(Number(t).toFixed(4),[0,1]),b(n,"rgba")}function q(e,t){if(typeof t!="function")throw new TypeError;var n=e?e.length:0;for(var r=0;r=t[1]&&(e=t[1]),e}function U(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u=t*6;u===6&&(u=0);var a=u|0,f=r*(1-n),l=r*(1-n*(u-a)),c=r*(1-n*(1-(u-a))),h=0,p=0,d=0;a===0?(h=r,p=c,d=f):a===1?(h=l,p=r,d=f):a===2?(h=f,p=r,d=c):a===3?(h=f,p=l,d=r):a===4?(h=c,p=f,d=r):(h=r,p=f,d=l),i=h*255,s=p*255,o=d*255}return[i,s,o]}function z(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u;r<.5?u=r*(1+n):u=r+n-n*r;var a=2*r-u;i=255*W(a,u,t+1/3),s=255*W(a,u,t),o=255*W(a,u,t-1/3)}return[i,s,o]}function W(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function X(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=s,a,f;if(o===0)a=0,f=0;else{f=o/s;var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}function V(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=(s+i)/2,a,f;if(o===0)a=0,f=0;else{u<.5?f=o/(s+i):f=o/(2-s-i);var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}var t=e("../tool/util"),n,r=["#ff9277"," #dddd00"," #ffc877"," #bbe3ff"," #d5ffbb","#bbbbff"," #ddb000"," #b0dd00"," #e2bbff"," #ffbbe3","#ff7777"," #ff9900"," #83dd00"," #77e3ff"," #778fff","#c877ff"," #ff77ab"," #ff6600"," #aa8800"," #77c7ff","#ad77ff"," #ff77ff"," #dd0083"," #777700"," #00aa00","#0088aa"," #8400dd"," #aa0088"," #dd0000"," #772e00"],i=r,s="rgba(255,255,0,0.5)",o=s,u=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,a={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#789",lightslategrey:"#789",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#f0f",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"};return{customPalette:f,resetPalette:l,getColor:c,getHighlightColor:d,customHighlight:h,resetHighlight:p,getRadialGradient:v,getLinearGradient:m,getGradientColors:y,getStepColors:g,reverse:H,mix:B,lift:P,trim:_,random:j,toRGB:x,toRGBA:S,toHex:T,toHSL:O,toHSLA:A,toHSB:L,toHSBA:k,toHSV:C,toHSVA:N,toName:M,toColor:b,toArray:w,alpha:I,getData:F}}),define("zrender/shape/Base",["require","../tool/matrix","../tool/guid","../tool/util","../tool/log","../mixin/Transformable","../mixin/Eventful","../tool/area","../tool/area","../tool/color","../tool/area"],function(e){function u(t,n,r,i,s,o,u){s&&(t.font=s),t.textAlign=o,t.textBaseline=u;var f=a(n,r,i,s,o,u);n=(n+"").split("\n");var l=e("../tool/area").getTextHeight("国",s);switch(u){case"top":i=f.y;break;case"bottom":i=f.y+l;break;default:i=f.y+l/2}for(var c=0,h=n.length;c0&&e.stroke();break;default:e.fill()}this.drawText(e,n,this.style),e.restore()};var l=[["color","fillStyle"],["strokeColor","strokeStyle"],["opacity","globalAlpha"],["lineCap","lineCap"],["lineJoin","lineJoin"],["miterLimit","miterLimit"],["lineWidth","lineWidth"],["shadowBlur","shadowBlur"],["shadowColor","shadowColor"],["shadowOffsetX","shadowOffsetX"],["shadowOffsetY","shadowOffsetY"]];return f.prototype.setContext=function(e,t){for(var n=0,r=l.length;n=i.x&&t<=i.x+i.width&&n>=i.y&&n<=i.y+i.height?e("../tool/area").isInside(this,this.style,t,n):!1},f.prototype.drawText=function(e,t,n){if(typeof t.text=="undefined"||t.text===!1)return;var r=t.textColor||t.color||t.strokeColor;e.fillStyle=r;var i=10,s,o,a,f,l=t.textPosition||this.textPosition||"top";switch(l){case"inside":case"top":case"bottom":case"left":case"right":if(this.getRect){var c=(n||t).__rect||this.getRect(n||t);switch(l){case"inside":a=c.x+c.width/2,f=c.y+c.height/2,s="center",o="middle",t.brushType!="stroke"&&r==t.color&&(e.fillStyle="#fff");break;case"left":a=c.x-i,f=c.y+c.height/2,s="end",o="middle";break;case"right":a=c.x+c.width+i,f=c.y+c.height/2,s="start",o="middle";break;case"top":a=c.x+c.width/2,f=c.y-i,s="center",o="bottom";break;case"bottom":a=c.x+c.width/2,f=c.y+c.height+i,s="center",o="top"}}break;case"start":case"end":var h,p,d,v;if(typeof t.pointList!="undefined"){var m=t.pointList;if(m.length<2)return;var g=m.length;switch(l){case"start":h=m[0][0],p=m[1][0],d=m[0][1],v=m[1][1];break;case"end":h=m[g-2][0],p=m[g-1][0],d=m[g-2][1],v=m[g-1][1]}}else h=t.xStart||0,p=t.xEnd||0,d=t.yStart||0,v=t.yEnd||0;switch(l){case"start":s=hi&&(c=u+a,u*=i/c,a*=i/c),f+l>i&&(c=f+l,f*=i/c,l*=i/c),a+f>s&&(c=a+f,a*=s/c,f*=s/c),u+l>s&&(c=u+l,u*=s/c,l*=s/c),e.moveTo(n+u,r),e.lineTo(n+i-a,r),a!==0&&e.quadraticCurveTo(n+i,r,n+i,r+a),e.lineTo(n+i,r+s-f),f!==0&&e.quadraticCurveTo(n+i,r+s,n+i-f,r+s),e.lineTo(n+l,r+s),l!==0&&e.quadraticCurveTo(n,r+s,n,r+s-l),e.lineTo(n,r+u),u!==0&&e.quadraticCurveTo(n,r,n+u,r)},buildPath:function(e,t){t.radius?this._buildRadiusPath(e,t):(e.moveTo(t.x,t.y),e.lineTo(t.x+t.width,t.y),e.lineTo(t.x+t.width,t.y+t.height),e.lineTo(t.x,t.y+t.height),e.lineTo(t.x,t.y)),e.closePath();return},getRect:function(e){if(e.__rect)return e.__rect;var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,e.__rect={x:Math.round(e.x-t/2),y:Math.round(e.y-t/2),width:e.width+t,height:e.height+t},e.__rect}},e("../tool/util").inherits(n,t),n}),define("zrender/loadingEffect/Base",["require","../tool/util","../shape/Text","../shape/Rectangle"],function(e){function o(e){this.setOptions(e)}var t=e("../tool/util"),n=e("../shape/Text"),r=e("../shape/Rectangle"),i="Loading...",s="normal 16px Arial";return o.prototype.createTextShape=function(e){return new n({highlightStyle:t.merge({x:this.canvasWidth/2,y:this.canvasHeight/2,text:i,textAlign:"center",textBaseline:"middle",textFont:s,color:"#333",brushType:"fill"},e,!0)})},o.prototype.createBackgroundShape=function(e){return new r({highlightStyle:{x:0,y:0,width:this.canvasWidth,height:this.canvasHeight,brushType:"fill",color:e}})},o.prototype.start=function(e){function t(t){e.storage.addHover(t)}function n(){e.refreshHover()}this.canvasWidth=e._width,this.canvasHeight=e._height,this.loadingTimer=this._start(t,n)},o.prototype._start=function(){return setInterval(function(){},1e4)},o.prototype.stop=function(){clearInterval(this.loadingTimer)},o.prototype.setOptions=function(e){this.options=e||{}},o.prototype.adjust=function(e,t){return e<=t[0]?e=t[0]:e>=t[1]&&(e=t[1]),e},o.prototype.getLocation=function(e,t,n){var r=e.x!=null?e.x:"center";switch(r){case"center":r=Math.floor((this.canvasWidth-t)/2);break;case"left":r=0;break;case"right":r=this.canvasWidth-t}var i=e.y!=null?e.y:"center";switch(i){case"center":i=Math.floor((this.canvasHeight-n)/2);break;case"top":i=0;break;case"bottom":i=this.canvasHeight-n}return{x:r,y:i,width:t,height:n}},o}),define("zrender/shape/Image",["require","./Base","../tool/util"],function(e){var t=[],n,r=e("./Base"),i=function(e){r.call(this,e),this._imageCache={}};return i.prototype={type:"image",brush:function(e,r,i){var s=this.style||{};r&&(s=this.getHighlightStyle(s,this.highlightStyle||{}));var o=s.image,u=this;if(typeof o=="string"){var a=o;this._imageCache[a]?o=this._imageCache[a]:(o=new Image,o.onload=function(){o.onload=null,clearTimeout(n),t.push(u),n=setTimeout(function(){i&&i(t),t=[]},10)},o.src=a,this._imageCache[a]=o)}if(o){if(o.nodeName.toUpperCase()=="IMG")if(window.ActiveXObject){if(o.readyState!="complete")return}else if(!o.complete)return;var f=s.width||o.width,l=s.height||o.height,c=s.x,h=s.y;if(!o.width||!o.height)return;e.save(),this.setContext(e,s),this.setTransform(e);if(s.sWidth&&s.sHeight){var p=s.sx||0,d=s.sy||0;e.drawImage(o,p,d,s.sWidth,s.sHeight,c,h,f,l)}else if(s.sx&&s.sy){var p=s.sx,d=s.sy,v=f-p,m=l-d;e.drawImage(o,p,d,v,m,c,h,f,l)}else e.drawImage(o,c,h,f,l);s.width||(s.width=f),s.height||(s.height=l),this.style.width||(this.style.width=f),this.style.height||(this.style.height=l),this.drawText(e,s,this.style),e.restore()}},getRect:function(e){return{x:e.x,y:e.y,width:e.width,height:e.height}},clearCache:function(){this._imageCache={}}},e("../tool/util").inherits(i,r),i}),define("zrender/Painter",["require","./config","./tool/util","./tool/log","./tool/matrix","./loadingEffect/Base","./mixin/Transformable","./shape/Image"],function(e){function f(){return!1}function l(){}function h(e,t,n){var r=document.createElement(t),i=n._width,s=n._height;return r.style.position="absolute",r.style.left=0,r.style.top=0,r.style.width=i+"px",r.style.height=s+"px",r.setAttribute("width",i*u),r.setAttribute("height",s*u),r.setAttribute("data-zr-dom-id",e),r}var t=e("./config"),n=e("./tool/util"),r=e("./tool/log"),i=e("./tool/matrix"),s=e("./loadingEffect/Base"),o=e("./mixin/Transformable"),u=window.devicePixelRatio||1;u=Math.max(u,1);var a=window.G_vmlCanvasManager,c=function(e,t){this.root=e,this.storage=t,e.innerHTML="",this._width=this._getWidth(),this._height=this._getHeight();var n=document.createElement("div");this._domRoot=n,n.style.position="relative",n.style.overflow="hidden",n.style.width=this._width+"px",n.style.height=this._height+"px",e.appendChild(n),this._layers={},this._layerConfig={},this._loadingEffect=new s({}),this.shapeToImage=this._createShapeToImageProcessor(),this._bgDom=h("bg","div",this),n.appendChild(this._bgDom),this._bgDom.onselectstart=f,this._bgDom.style["-webkit-user-select"]="none",this._bgDom.style["user-select"]="none";var r=new p("_zrender_hover_",this);this._layers.hover=r,n.appendChild(r.dom),r.initContext(),r.dom.onselectstart=f,r.dom.style["-webkit-user-select"]="none",r.dom.style["user-select"]="none";var i=this;this.updatePainter=function(e,t){i.refreshShapes(e,t)}};c.prototype.render=function(e){return this.isLoading()&&this.hideLoading(),this.refresh(e,!0),this},c.prototype.refresh=function(e,t){var n=this.storage.getShapeList(!0);return this._paintList(n,t),typeof e=="function"&&e(),this},c.prototype._paintList=function(e,n){typeof n=="undefined"&&(n=!1),this._updateLayerStatus(e);var s,o,u;for(var f in this._layers)f!=="hover"&&(this._layers[f].unusedCount++,this._layers[f].updateTransform());var l=[];for(var c=0,h=e.length;c0},s.prototype.addRoot=function(e){e instanceof n&&e.addChildrenToStorage(this),this.addToMap(e),this._roots.push(e)},s.prototype.delRoot=function(e){if(typeof e=="undefined"){for(var r=0;r=0&&(this.delFromMap(o.id),this._roots.splice(u,1),o instanceof n&&o.delChildrenFromStorage(this))},s.prototype.addToMap=function(e){return e instanceof n&&(e._storage=this),e.modSelf(),this._elements[e.id]=e,this},s.prototype.get=function(e){return this._elements[e]},s.prototype.delFromMap=function(e){var t=this._elements[e];return t&&(delete this._elements[e],t instanceof n&&(t._storage=null)),this},s.prototype.dispose=function(){this._elements=this._renderList=this._roots=this._hoverElements=null},s}),define("zrender/animation/easing",[],function(){var e={Linear:function(e){return e},QuadraticIn:function(e){return e*e},QuadraticOut:function(e){return e*(2-e)},QuadraticInOut:function(e){return(e*=2)<1?.5*e*e:-0.5*(--e*(e-2)-1)},CubicIn:function(e){return e*e*e},CubicOut:function(e){return--e*e*e+1},CubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},QuarticIn:function(e){return e*e*e*e},QuarticOut:function(e){return 1- --e*e*e*e},QuarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-0.5*((e-=2)*e*e*e-2)},QuinticIn:function(e){return e*e*e*e*e},QuinticOut:function(e){return--e*e*e*e*e+1},QuinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},SinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},SinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},SinusoidalInOut:function(e){return.5*(1-Math.cos(Math.PI*e))},ExponentialIn:function(e){return e===0?0:Math.pow(1024,e-1)},ExponentialOut:function(e){return e===1?1:1-Math.pow(2,-10*e)},ExponentialInOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)},CircularIn:function(e){return 1-Math.sqrt(1-e*e)},CircularOut:function(e){return Math.sqrt(1- --e*e)},CircularInOut:function(e){return(e*=2)<1?-0.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},ElasticIn:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),-(n*Math.pow(2,10*(e-=1))*Math.sin((e-t)*2*Math.PI/r)))},ElasticOut:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*e)*Math.sin((e-t)*2*Math.PI/r)+1)},ElasticInOut:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),(e*=2)<1?-0.5*n*Math.pow(2,10*(e-=1))*Math.sin((e-t)*2*Math.PI/r):n*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*2*Math.PI/r)*.5+1)},BackIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},BackOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},BackInOut:function(e){var t=2.5949095;return(e*=2)<1?.5*e*e*((t+1)*e-t):.5*((e-=2)*e*((t+1)*e+t)+2)},BounceIn:function(t){return 1-e.BounceOut(1-t)},BounceOut:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},BounceInOut:function(t){return t<.5?e.BounceIn(t*2)*.5:e.BounceOut(t*2-1)*.5+.5}};return e}),define("zrender/animation/Clip",["require","./easing"],function(e){function n(e){this._targetPool=e.target||{},this._targetPool instanceof Array||(this._targetPool=[this._targetPool]),this._life=e.life||1e3,this._delay=e.delay||0,this._startTime=(new Date).getTime()+this._delay,this._endTime=this._startTime+this._life*1e3,this.loop=typeof e.loop=="undefined"?!1:e.loop,this.gap=e.gap||0,this.easing=e.easing||"Linear",this.onframe=e.onframe,this.ondestroy=e.ondestroy,this.onrestart=e.onrestart}var t=e("./easing");return n.prototype={step:function(e){var n=(e-this._startTime)/this._life;if(n<0)return;n=Math.min(n,1);var r=typeof this.easing=="string"?t[this.easing]:this.easing,i=typeof r=="function"?r(n):n;return this.fire("frame",i),n==1?this.loop?(this.restart(),"restart"):(this._needsRemove=!0,"destroy"):null},restart:function(){var e=(new Date).getTime(),t=(e-this._startTime)%this._life;this._startTime=(new Date).getTime()-t+this.gap},fire:function(e,t){for(var n=0,r=this._targetPool.length;n=0&&this._clips.splice(t,1)},_update:function(){var e=(new Date).getTime(),t=e-this._time,n=this._clips,r=n.length,i=[],s=[];for(var o=0;o=0;N--)if(x[N]<=t)break;N=Math.min(N,g-2)}else{for(N=k;Nt)break;N=Math.min(N-1,g-2)}k=N,L=t;var n=x[N+1]-x[N];if(n===0)return;O=(t-x[N])/n;if(u){_=T[N],M=T[N===0?N:N-1],D=T[N>g-2?g-1:N+1],P=T[N>g-3?g-1:N+2];if(b)p(M,_,D,P,O,O*O,O*O*O,s(e,v),E);else{var a;w?(a=p(M,_,D,P,O,O*O,O*O*O,H,1),a=m(H)):a=d(M,_,D,P,O,O*O,O*O*O),i(e,v,a)}}else if(b)c(T[N],T[N+1],O,s(e,v),E);else{var a;w?(c(T[N],T[N+1],O,H,1),a=m(H)):a=l(T[N],T[N+1],O),i(e,v,a)}for(N=0;N1?"."+e[1]:""))}return{parsePercent:t,parseCenter:n,parseRadius:r,addCommas:i}}),define("echarts/component/base",["require","../config","../util/ecQuery","../util/number","zrender/tool/util","zrender/tool/env"],function(e){function s(e,t,n,r,i){this.ecTheme=e,this.messageCenter=t,this.zr=n,this.option=r,this.series=r.series,this.myChart=i,this.component=i.component,this._zlevelBase=this.getZlevelBase(),this.shapeList=[],this.effectList=[];var s=this;s.hoverConnect=function(e){var t=(e.target||{}).hoverConnect;if(t){var n=10,r;if(t instanceof Array)for(var i=0,o=t.length;i4?a*r(2*i/s)/r(i/s):a/3);var l=i/s,c=-i/2,h=o+a*r(c),p=u+a*n(c);c+=l;var d=t.pointList=[];d.push([h,p]);for(var v=0,m=s*2-1,g;v=r.x-i&&e<=r.x+r.width+i&&t>=r.y-i&&t<=r.y+r.height+i?!0:!1}},t.inherits(C,N),C}),define("zrender/shape/util/dashedLineTo",[],function(){var e=[5,5];return function(t,n,r,i,s,o){if(t.setLineDash){e[0]=e[1]=o,t.setLineDash(e),t.moveTo(n,r),t.lineTo(i,s);return}o=typeof o!="number"?5:o;var u=i-n,a=s-r,f=Math.floor(Math.sqrt(u*u+a*a)/o);u/=f,a/=f;var l=!0;for(var c=0;cs-2?s-1:c+1],m=e[c>s-3?s-1:c+2]);var g=h*h,y=h*g;o.push([n(p[0],d[0],v[0],m[0],h,g,y),n(p[1],d[1],v[1],m[1],h,g,y)])}return o}}),define("zrender/shape/util/smoothBezier",["require","../../tool/vector"],function(e){var t=e("../../tool/vector");return function(e,n,r,i){var s=[],o=[],u=[],a=[],f,l,c=!!i,h,p;if(c){h=[Infinity,Infinity],p=[-Infinity,-Infinity];for(var d=0,v=e.length;d0&&(n.brushType=="stroke"||n.brushType=="both")&&(r||(e.beginPath(),this.buildPath(e,n)),e.stroke()),this.drawText(e,n,this.style),e.restore();return},buildPath:function(e,t){var s=t.pointList;if(s.length<2)return;if(t.smooth&&t.smooth!=="spline"){var o=r(s,t.smooth,!0,t.smoothConstraint);e.moveTo(s[0][0],s[0][1]);var u,a,f,l=s.length;for(var c=0;cn&&(n=s[o][0]),s[o][1]i&&(i=s[o][1]);var a;return e.brushType=="stroke"||e.brushType=="fill"?a=e.lineWidth||1:a=0,e.__rect={x:Math.round(t-a/2),y:Math.round(r-a/2),width:n-t+a,height:i-r+a},e.__rect}},e("../tool/util").inherits(s,t),s}),define("zrender/shape/BrokenLine",["require","./Base","./util/smoothSpline","./util/smoothBezier","./util/dashedLineTo","./Polygon","../tool/util"],function(e){var t=e("./Base"),n=e("./util/smoothSpline"),r=e("./util/smoothBezier"),i=e("./util/dashedLineTo"),s=function(e){this.brushTypeOnly="stroke",this.textPosition="end",t.call(this,e)};return s.prototype={type:"broken-line",buildPath:function(e,t){var s=t.pointList;if(s.length<2)return;var o=Math.min(t.pointList.length,Math.round(t.pointListLength||t.pointList.length));if(t.smooth&&t.smooth!=="spline"){var u=r(s,t.smooth,!1,t.smoothConstraint);e.moveTo(s[0][0],s[0][1]);var a,f,l;for(var c=0;cs?a>u?l=Math.PI*2-l+f:l+=f:a>u?l+=Math.PI-f:l=Math.PI-l-f:s>o?u>a?l=Math.PI*2-l+f:l+=f:u>a?l+=Math.PI-f:l=Math.PI-l-f;var c=Math.PI/8,h=n===0?s:o,p=n===0?u:a,d=[[h+i*Math.cos(l-c),p-i*Math.sin(l-c)],[h+i*.6*Math.cos(l),p-i*.6*Math.sin(l)],[h+i*Math.cos(l+c),p-i*Math.sin(l+c)]];e.moveTo(h,p);for(var v=0,m=d.length;v=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height?this.style.smooth!=="spline"?a.isInside(i,this.style,e,t):a.isInside(o,this.style,e,t):!1}},c.inherits(h,t),h}),define("echarts/util/shape/normalIsCover",[],function(){return function(e,t){var n=this.getTansform(e,t);e=n[0],t=n[1];var r=this.style.__rect;return r||(r=this.style.__rect=this.getRect(this.style)),e>=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height}}),define("echarts/util/shape/Symbol",["require","zrender/shape/Base","zrender/shape/Polygon","zrender/tool/util","./normalIsCover"],function(e){function s(e){t.call(this,e)}var t=e("zrender/shape/Base"),n=e("zrender/shape/Polygon"),r=new n({}),i=e("zrender/tool/util");return s.prototype={type:"symbol",buildPath:function(e,t){var n=t.pointList,r=n.length;if(r===0)return;var i=1e4,s=Math.ceil(r/i),o,u,a=n[0]instanceof Array,f=t.size?t.size:2,l=f,c=f/2,h=Math.PI*2,p,d,v;for(var m=0;mr?r:u;for(var g=o;g0&&e.stroke();break;case"stroke":t.lineWidth>0&&e.stroke();break;default:e.fill()}}},getRect:function(e){return e.__rect||r.getRect(e)},isCover:e("./normalIsCover")},i.inherits(s,t),s}),define("echarts/util/ecData",[],function(){function e(e,t,n,r,i,s,o,u){var a;return typeof r!="undefined"&&(a=r.value==null?r:r.value),e._echartsData={_series:t,_seriesIndex:n,_data:r,_dataIndex:i,_name:s,_value:a,_special:o,_special2:u},e._echartsData}function t(e,t){var n=e._echartsData;if(!t)return n;switch(t){case"series":case"seriesIndex":case"data":case"dataIndex":case"name":case"value":case"special":case"special2":return n&&n["_"+t]}return null}function n(e,t,n){e._echartsData=e._echartsData||{};switch(t){case"series":case"seriesIndex":case"data":case"dataIndex":case"name":case"value":case"special":case"special2":e._echartsData["_"+t]=n}}function r(e,t){t._echartsData={_series:e._echartsData._series,_seriesIndex:e._echartsData._seriesIndex,_data:e._echartsData._data,_dataIndex:e._echartsData._dataIndex,_name:e._echartsData._name,_value:e._echartsData._value,_special:e._echartsData._special,_special2:e._echartsData._special2}}return{pack:e,set:n,get:t,clone:r}}),define("echarts/util/ecAnimation",["require","zrender/tool/util","zrender/shape/Polygon"],function(e){function n(e,n,r,i,s){var o=r.style.pointList,u=o.length,a;if(!n){a=[];if(r._orient!="vertical"){var f=o[0][1];for(var l=0;l1?t.symbol:[t.symbol[0],t.symbol[0]]:[t.symbol,t.symbol],t.symbolSize=t.symbolSize instanceof Array?t.symbolSize.length>1?t.symbolSize:[t.symbolSize[0],t.symbolSize[0]]:[t.symbolSize,t.symbolSize],t.symbolRotate=t.symbolRotate instanceof Array?t.symbolRotate.length>1?t.symbolRotate:[t.symbolRotate[0],t.symbolRotate[0]]:[t.symbolRotate,t.symbolRotate],t.name=n.name;var i=[],u=t.data,a,f=r.dataRange,c=r.legend,h,p,d,v,m,g,y=this.zr.getWidth(),b=this.zr.getHeight(),w;for(var E=0,S=u.length;E "+u[E][1].name:""),p),i.push(a)}return i},getMarkCoord:function(){return[0,0]},getSymbolShape:function(e,r,i,s,u,a,f,l,c,h,p){var d=[i,e],v=i!=null?i.value!=null?i.value:i:"-";l=this.deepQuery(d,"symbol")||l;var m=this.deepQuery(d,"symbolSize");m=typeof m=="function"?m(v):m;var g=this.deepQuery(d,"symbolRotate"),y=this.deepMerge(d,"itemStyle.normal"),b=this.deepMerge(d,"itemStyle.emphasis"),w=y.borderWidth!=null?y.borderWidth:y.lineStyle&&y.lineStyle.width;w==null&&(w=l.match("empty")?2:0);var E=b.borderWidth!=null?b.borderWidth:b.lineStyle&&b.lineStyle.width;E==null&&(E=w+2);var S=new n({style:{iconType:l.replace("empty","").toLowerCase(),x:a-m,y:f-m,width:m*2,height:m*2,brushType:"both",color:l.match("empty")?h:this.getItemStyleColor(y.color,r,s,i)||c,strokeColor:y.borderColor||this.getItemStyleColor(y.color,r,s,i)||c,lineWidth:w},highlightStyle:{color:l.match("empty")?h:this.getItemStyleColor(b.color,r,s,i),strokeColor:b.borderColor||y.borderColor||this.getItemStyleColor(y.color,r,s,i)||c,lineWidth:E},clickable:this.deepQuery(d,"clickable")});return l.match("image")&&(S.style.image=l.replace(new RegExp("^image:\\/\\/"),""),S=new t({style:S.style,highlightStyle:S.highlightStyle,clickable:this.deepQuery(d,"clickable")})),g!=null&&(S.rotation=[g*Math.PI/180,a,f]),l.match("star")&&(S.style.iconType="star",S.style.n=l.replace("empty","").replace("star","")-0||5),l==="none"&&(S.invisible=!0,S.hoverable=!1),S=this.addLabel(S,e,i,u,p),l.match("empty")&&(S.style.textColor==null&&(S.style.textColor=S.style.strokeColor),S.highlightStyle.textColor==null&&(S.highlightStyle.textColor=S.highlightStyle.strokeColor)),o.pack(S,e,r,i,s,u),S._x=a,S._y=f,S._dataIndex=s,S._seriesIndex=r,S},getLineMarkShape:function(e,t,n,i,s,o,u,a,f){var l=n[0]!=null?n[0].value!=null?n[0].value:n[0]:"-",c=n[1]!=null?n[1].value!=null?n[1].value:n[1]:"-",h=[this.query(n[0],"symbol")||e.symbol[0],this.query(n[1],"symbol")||e.symbol[1]],p=[this.query(n[0],"symbolSize")||e.symbolSize[0],this.query(n[1],"symbolSize")||e.symbolSize[1]];p[0]=typeof p[0]=="function"?p[0](l):p[0],p[1]=typeof p[1]=="function"?p[1](c):p[1];var d=[this.query(n[0],"symbolRotate")||e.symbolRotate[0],this.query(n[1],"symbolRotate")||e.symbolRotate[1]],v=[n[0],e],m=this.deepMerge(v,"itemStyle.normal");m.color=this.getItemStyleColor(m.color,t,i,n);var g=this.deepMerge(v,"itemStyle.emphasis");g.color=this.getItemStyleColor(g.color,t,i,n);var y=m.lineStyle,b=g.lineStyle,w=y.width;w==null&&(w=m.borderWidth);var E=b.width;E==null&&(E=g.borderWidth!=null?g.borderWidth:w+2);var S=new r({style:{smooth:e.smooth?"spline":!1,symbol:h,symbolSize:p,symbolRotate:d,xStart:s,yStart:o,xEnd:u,yEnd:a,brushType:"both",lineType:y.type,shadowColor:y.shadowColor||y.color||m.borderColor||m.color||f,shadowBlur:y.shadowBlur,shadowOffsetX:y.shadowOffsetX,shadowOffsetY:y.shadowOffsetY,color:m.color||f,strokeColor:y.color||m.borderColor||m.color||f,lineWidth:w,symbolBorderColor:m.borderColor||m.color||f,symbolBorder:m.borderWidth},highlightStyle:{shadowColor:b.shadowColor,shadowBlur:b.shadowBlur,shadowOffsetX:b.shadowOffsetX,shadowOffsetY:b.shadowOffsetY,color:g.color||m.color||f,strokeColor:b.color||y.color||g.borderColor||m.borderColor||g.color||m.color||f,lineWidth:E,symbolBorderColor:g.borderColor||m.borderColor||g.color||m.color||f,symbolBorder:g.borderWidth==null?m.borderWidth+2:g.borderWidth},clickable:this.deepQuery(v,"clickable")});return S=this.addLabel(S,e,n[0],n[0].name+" : "+n[1].name),S._x=u,S._y=a,S},getLargeMarkPoingShape:function(e,t){var n=this.series[e],r=this.component,s=t.data,o,u=r.dataRange,a=r.legend,f,l,c=[s[0],t],h,p,d;a&&(f=a.getColor(n.name));if(u){l=s[0]!=null?s[0].value!=null?s[0].value:s[0]:"-",f=isNaN(l)?f:u.getColor(l),h=this.deepQuery(c,"itemStyle.normal.color")||f,p=this.deepQuery(c,"itemStyle.emphasis.color")||h;if(h==null&&p==null)return}f=this.deepMerge(c,"itemStyle.normal").color||f;var v=this.deepQuery(c,"symbol")||"circle";v=v.replace("empty","").replace(/\d/g,""),d=this.deepMerge([s[0],t],"effect");var m=window.devicePixelRatio||1;return o=new i({style:{pointList:s,color:f,strokeColor:f,shadowColor:d.shadowColor||f,shadowBlur:(d.shadowBlur!=null?d.shadowBlur:8)*m,size:this.deepQuery(c,"symbolSize"),iconType:v,brushType:"fill",lineWidth:1},draggable:!1,hoverable:!1}),d.show&&(o.effect=d),o},backupShapeList:function(){this.shapeList&&this.shapeList.length>0?(this.lastShapeList=this.shapeList,this.shapeList=[]):this.lastShapeList=[]},addShapeList:function(){var e=this.option.animationThreshold/(this.canvasSupported?2:4),t=this.lastShapeList,n=this.shapeList,r=t.length>0?500:this.query(this.option,"animationDuration"),i=this.query(this.option,"animationEasing"),s,o={},u={};if(this.option.animation&&!this.option.renderAsImage&&n.length500?u.candle(this.zr,e,t,n,r):this.zr.addShape(t);break;case"ring":case"sector":case"circle":n>500?u.ring(this.zr,e,t,n+(o.get(t,"dataIndex")||0)%20*100,r):t.type==="sector"?u.sector(this.zr,e,t,n,r):this.zr.addShape(t);break;case"text":u.text(this.zr,e,t,n,r);break;case"polygon":n>500?u.polygon(this.zr,e,t,n,r):u.pointList(this.zr,e,t,n,r);break;case"chord":u.chord(this.zr,e,t,n,r);break;case"gauge-pointer":u.gaugePointer(this.zr,e,t,n,r);break;case"mark-line":u.markline(this.zr,e,t,n,r);break;case"line":u.line(this.zr,e,t,n,r);break;default:this.zr.addShape(t)}},animationMark:function(e,t,n){var r=n||this.shapeList;for(var i=0,s=r.length;i0&&(e&&this.zr.modLayer(s.EFFECT_ZLEVEL,{motionBlur:!1}),this.zr.delShape(this.effectList)),this.effectList=[]},addMark:function(e,t,n){var r=this.series[e];if(this.selectedMap[r.name]){var i=500,s=this.query(this.option,"animationEasing"),o=r[n].data,u=this.shapeList.length;r[n].data=t.data,this["_build"+n.replace("m","M")](e);if(this.option.animation&&!this.option.renderAsImage)this.animationMark(i,s,this.shapeList.slice(u));else{for(var a=u,f=this.shapeList.length;a0?-1:1,t.style.r-=r,t.style.r=t.style.r<5?5:t.style.r;var i=s.get(t,"value"),o=i*f.option.island.calculateStep;o>1?i=Math.round(i-o*r):i=(i-o*r).toFixed(2)-0;var a=s.get(t,"name");t.style.text=a+":"+i,s.set(t,"value",i),s.set(t,"name",a),f.zr.modShape(t.id),f.zr.refresh(),u.stop(n)}}var t=e("../component/base"),n=e("./base"),r=e("zrender/shape/Circle"),i=e("../config"),s=e("../util/ecData"),o=e("zrender/tool/util"),u=e("zrender/tool/event");return a.prototype={type:i.CHART_TYPE_ISLAND,_combine:function(t,n){var r=e("zrender/tool/color"),i=e("../util/accMath"),o=i.accAdd(s.get(t,"value"),s.get(n,"value")),u=s.get(t,"name")+this._nameConnector+s.get(n,"name");t.style.text=u+this._valueConnector+o,s.set(t,"value",o),s.set(t,"name",u),t.style.r=this.option.island.r,t.style.color=r.mix(t.style.color,n.style.color)},refresh:function(e){e&&(e.island=this.reformOption(e.island),this.option=e,this._nameConnector=this.option.nameConnector,this._valueConnector=this.option.valueConnector)},getOption:function(){return this.option},resize:function(){var e=this.zr.getWidth(),t=this.zr.getHeight(),n=e/(this._zrWidth||e),r=t/(this._zrHeight||t);if(n===1&&r===1)return;this._zrWidth=e,this._zrHeight=t;for(var i=0,s=this.shapeList.length;i'+(t[0]||this._lang[0])+"

",this._textArea.style.cssText="display:block;margin:0 0 8px 0;padding:4px 6px;overflow:auto;width:"+(this._zrWidth-15)+"px;"+"height:"+(this._zrHeight-100)+"px;";var n=this.query(this.option,"toolbox.feature.dataView.optionToContent");typeof n!="function"?this._textArea.value=this._optionToContent():this._textArea.value=n(this.option),this._tDom.appendChild(this._textArea),this._buttonClose.style.cssText="float:right;padding:1px 6px;",this._buttonClose.innerHTML=t[1]||this._lang[1];var r=this;this._buttonClose.onclick=function(){r.hide()},this._tDom.appendChild(this._buttonClose),this.query(this.option,"toolbox.feature.dataView.readOnly")===!1?(this._buttonRefresh.style.cssText="float:right;margin-right:10px;padding:1px 6px;",this._buttonRefresh.innerHTML=t[2]||this._lang[2],this._buttonRefresh.onclick=function(){r._save()},this._tDom.appendChild(this._buttonRefresh),this._textArea.readOnly=!1,this._textArea.style.cursor="default"):(this._textArea.readOnly=!0,this._textArea.style.cursor="text"),this._sizeCssText="width:"+this._zrWidth+"px;"+"height:"+this._zrHeight+"px;"+"background-color:#fff;",this._tDom.style.cssText=this._gCssText+this._sizeCssText},_optionToContent:function(){var e,t,r,i,s,o,u=[],a="";if(this.option.xAxis){this.option.xAxis instanceof Array?u=this.option.xAxis:u=[this.option.xAxis];for(e=0,i=u.length;e10&&(this._sizeCssText="width:"+this._zrWidth+"px;"+"height:"+this._zrHeight+"px;"+"background-color:#fff;",this._tDom.style.cssText=this._gCssText+this._sizeCssText,this._textArea.style.cssText="display:block;margin:0 0 8px 0;padding:4px 6px;overflow:auto;width:"+(this._zrWidth-15)+"px;"+"height:"+(this._zrHeight-100)+"px;")},dispose:function(){window.removeEventListener?(this._tDom.removeEventListener("click",this._stop),this._tDom.removeEventListener("mousewheel",this._stop),this._tDom.removeEventListener("mousemove",this._stop),this._tDom.removeEventListener("mousedown",this._stop),this._tDom.removeEventListener("mouseup",this._stop),this._tDom.removeEventListener("touchstart",this._stop),this._tDom.removeEventListener("touchmove",this._stop),this._tDom.removeEventListener("touchend",this._stop)):(this._tDom.detachEvent("onclick",this._stop),this._tDom.detachEvent("onmousewheel",this._stop),this._tDom.detachEvent("onmousemove",this._stop),this._tDom.detachEvent("onmousedown",this._stop),this._tDom.detachEvent("onmouseup",this._stop)),this._buttonRefresh.onclick=null,this._buttonClose.onclick=null,this._hasShow&&(this._tDom.removeChild(this._textArea),this._tDom.removeChild(this._buttonRefresh),this._tDom.removeChild(this._buttonClose)),this._textArea=null,this._buttonRefresh=null,this._buttonClose=null,this.dom.firstChild.removeChild(this._tDom),this._tDom=null}},r.inherits(i,t),e("../component").define("dataView",i),i}),define("echarts/component/toolbox",["require","./base","zrender/shape/Line","zrender/shape/Image","zrender/shape/Rectangle","../util/shape/Icon","../config","zrender/tool/util","zrender/config","zrender/tool/event","./dataView","../component"],function(e){function h(e,n,r,i,s){t.call(this,e,n,r,i,s),this.dom=s.dom,this._magicType={},this._magicMap={},this._isSilence=!1,this._iconList,this._iconShapeMap={},this._featureTitle={},this._featureIcon={},this._featureColor={},this._enableColor="red",this._disableColor="#ccc",this._markShapeList=[];var o=this;o._onMark=function(e){o.__onMark(e)},o._onMarkUndo=function(e){o.__onMarkUndo(e)},o._onMarkClear=function(e){o.__onMarkClear(e)},o._onDataZoom=function(e){o.__onDataZoom(e)},o._onDataZoomReset=function(e){o.__onDataZoomReset(e)},o._onDataView=function(e){o.__onDataView(e)},o._onRestore=function(e){o.__onRestore(e)},o._onSaveAsImage=function(e){o.__onSaveAsImage(e)},o._onMagicType=function(e){o.__onMagicType(e)},o._onCustomHandler=function(e){o.__onCustomHandler(e)},o._onmousemove=function(e){return o.__onmousemove(e)},o._onmousedown=function(e){return o.__onmousedown(e)},o._onmouseup=function(e){return o.__onmouseup(e)},o._onclick=function(e){return o.__onclick(e)}}var t=e("./base"),n=e("zrender/shape/Line"),r=e("zrender/shape/Image"),i=e("zrender/shape/Rectangle"),s=e("../util/shape/Icon"),o=e("../config"),u=e("zrender/tool/util"),a=e("zrender/config"),f=e("zrender/tool/event"),l="stack",c="tiled";return h.prototype={type:o.COMPONENT_TYPE_TOOLBOX,_buildShape:function(){this._iconList=[];var e=this.option.toolbox;this._enableColor=e.effectiveColor,this._disableColor=e.disableColor;var t=e.feature,n=[];for(var r in t)if(t[r].show)switch(r){case"mark":n.push({key:r,name:"mark"}),n.push({key:r,name:"markUndo"}),n.push({key:r,name:"markClear"});break;case"magicType":for(var i=0,s=t[r].type.length;i0){var o,r;for(var i=0,s=n.length;i=1){var t=this._markShapeList[e-1];this.zr.delShape(t.id),this.zr.refresh(),this._markShapeList.pop(),e===1&&(this._iconDisable(this._iconShapeMap.markUndo),this._iconDisable(this._iconShapeMap.markClear))}}return!0},__onMarkClear:function(){this._marking&&(this._marking=!1);var e=this._markShapeList.length;if(e>0){while(e--)this.zr.delShape(this._markShapeList.pop().id);this._iconDisable(this._iconShapeMap.markUndo),this._iconDisable(this._iconShapeMap.markClear),this.zr.refresh()}return!0},__onDataZoom:function(e){var t=e.target;if(this._zooming||this._zoomStart)this._resetZoom(),this.zr.refresh(),this.dom.style.cursor="default";else{this._resetMark(),this.zr.modShape(t.id,{style:{strokeColor:this._enableColor}}),this.zr.refresh(),this._zoomStart=!0;var n=this;setTimeout(function(){n.zr&&n.zr.on(a.EVENT.MOUSEDOWN,n._onmousedown)&&n.zr.on(a.EVENT.MOUSEUP,n._onmouseup)&&n.zr.on(a.EVENT.MOUSEMOVE,n._onmousemove)},10),this.dom.style.cursor="crosshair"}return!0},__onDataZoomReset:function(){return this._zooming&&(this._zooming=!1),this._zoomQueue.pop(),this._zoomQueue.length>0?this.component.dataZoom.absoluteZoom(this._zoomQueue[this._zoomQueue.length-1]):(this.component.dataZoom.rectZoom(),this._iconDisable(this._iconShapeMap.dataZoomReset),this.zr.refresh()),!0},_resetMark:function(){this._marking=!1,this._markStart&&(this._markStart=!1,this._iconShapeMap.mark&&this.zr.modShape(this._iconShapeMap.mark.id,{style:{strokeColor:this._iconShapeMap.mark.highlightStyle.strokeColor}}),this.zr.un(a.EVENT.CLICK,this._onclick),this.zr.un(a.EVENT.MOUSEMOVE,this._onmousemove))},_resetZoom:function(){this._zooming=!1,this._zoomStart&&(this._zoomStart=!1,this._iconShapeMap.dataZoom&&this.zr.modShape(this._iconShapeMap.dataZoom.id,{style:{strokeColor:this._iconShapeMap.dataZoom.highlightStyle.strokeColor}}),this.zr.un(a.EVENT.MOUSEDOWN,this._onmousedown),this.zr.un(a.EVENT.MOUSEUP,this._onmouseup),this.zr.un(a.EVENT.MOUSEMOVE,this._onmousemove))},_iconDisable:function(e){e.type!="image"?this.zr.modShape(e.id,{hoverable:!1,clickable:!1,style:{strokeColor:this._disableColor}}):this.zr.modShape(e.id,{hoverable:!1,clickable:!1,style:{opacity:.3}})},_iconEnable:function(e){e.type!="image"?this.zr.modShape(e.id,{hoverable:!0,clickable:!0,style:{strokeColor:e.highlightStyle.strokeColor}}):this.zr.modShape(e.id,{hoverable:!0,clickable:!0,style:{opacity:.8}})},__onDataView:function(){return this._dataView.show(this.option),!0},__onRestore:function(){return this._resetMark(),this._resetZoom(),this.messageCenter.dispatch(o.EVENT.RESTORE,null,null,this.myChart),!0},__onSaveAsImage:function(){var e=this.option.toolbox.feature.saveAsImage,t=e.type||"png";t!="png"&&t!="jpeg"&&(t="png");var n;this.myChart.isConnected()?n=this.myChart.getConnectedDataURL(t):n=this.zr.toDataURL("image/"+t,this.option.backgroundColor&&this.option.backgroundColor.replace(" ","")==="rgba(0,0,0,0)"?"#fff":this.option.backgroundColor);var r=document.createElement("div");r.id="__echarts_download_wrap__",r.style.cssText="position:fixed;z-index:99999;display:block;top:0;left:0;background-color:rgba(33,33,33,0.5);text-align:center;width:100%;height:100%;line-height:"+document.documentElement.clientHeight+"px;";var i=document.createElement("a");i.href=n,i.setAttribute("download",(e.name?e.name:this.option.title&&(this.option.title.text||this.option.title.subtext)?this.option.title.text||this.option.title.subtext:"ECharts")+"."+t),i.innerHTML='图片另存为")+'"/>',r.appendChild(i),document.body.appendChild(r),i=null,r=null,setTimeout(function(){var e=document.getElementById("__echarts_download_wrap__");e&&(e.onclick=function(){var e=document.getElementById("__echarts_download_wrap__");e.onclick=null,e.innerHTML="",document.body.removeChild(e),e=null},e=null)},500);return},__onMagicType:function(e){this._resetMark();var t=e.target._name;return this._magicType[t]||(this._magicType[t]=!0,t===o.CHART_TYPE_LINE?this._magicType[o.CHART_TYPE_BAR]=!1:t===o.CHART_TYPE_BAR&&(this._magicType[o.CHART_TYPE_LINE]=!1),t===l?this._magicType[c]=!1:t===c&&(this._magicType[l]=!1),this.messageCenter.dispatch(o.EVENT.MAGIC_TYPE_CHANGED,e.event,{magicType:this._magicType},this.myChart)),!0},setMagicType:function(e){this._resetMark(),this._magicType=e,!this._isSilence&&this.messageCenter.dispatch(o.EVENT.MAGIC_TYPE_CHANGED,null,{magicType:this._magicType},this.myChart)},__onCustomHandler:function(e){var t=e.target.style.iconType,n=this.option.toolbox.feature[t].onclick;typeof n=="function"&&n.call(this,this.option)},reset:function(e,t){t&&this.clear();if(this.query(e,"toolbox.show")&&this.query(e,"toolbox.feature.magicType.show")){var n=e.toolbox.feature.magicType.type,r=n.length;this._magicMap={};while(r--)this._magicMap[n[r]]=!0;r=e.series.length;var i,s;while(r--){i=e.series[r].type,this._magicMap[i]&&(s=e.xAxis instanceof Array?e.xAxis[e.series[r].xAxisIndex||0]:e.xAxis,s&&(s.type||"category")==="category"&&(s.__boundaryGap=s.boundaryGap!=null?s.boundaryGap:!0),s=e.yAxis instanceof Array?e.yAxis[e.series[r].yAxisIndex||0]:e.yAxis,s&&s.type==="category"&&(s.__boundaryGap=s.boundaryGap!=null?s.boundaryGap:!0),e.series[r].__type=i,e.series[r].__itemStyle=u.clone(e.series[r].itemStyle||{}));if(this._magicMap[l]||this._magicMap[c])e.series[r].__stack=e.series[r].stack}}this._magicType=t?{}:this._magicType||{};for(var o in this._magicType)if(this._magicType[o]){this.option=e,this.getMagicOption();break}var a=e.dataZoom;if(a&&a.show){var f=a.start!=null&&a.start>=0&&a.start<=100?a.start:0,h=a.end!=null&&a.end>=0&&a.end<=100?a.end:100;f>h&&(f+=h,h=f-h,f-=h),this._zoomQueue=[{start:f,end:h,start2:0,end2:100}]}else this._zoomQueue=[]},getMagicOption:function(){var e;if(this._magicType[o.CHART_TYPE_LINE]||this._magicType[o.CHART_TYPE_BAR]){var t=this._magicType[o.CHART_TYPE_LINE]?!1:!0;for(var n=0,r=this.option.series.length;n0&&(this.zr.delShape(this._lastTipShape.tipShape),this._lastTipShape=!1,this.shapeList.length=2),e&&this.zr.refresh(),this.showing=!1},_show:function(e,t,n,r){var i=this._tDom.offsetHeight,s=this._tDom.offsetWidth;e&&(typeof e=="function"&&(e=e([t,n])),e instanceof Array&&(t=e[0],n=e[1])),t+s>this._zrWidth&&(t-=s+40),n+i>this._zrHeight&&(n-=i-20),n<20&&(n=0),this._tDom.style.cssText=this._gCssText+this._defaultCssText+(r?r:"")+"left:"+t+"px;top:"+n+"px;",(i<10||s<10)&&setTimeout(this._refixed,20),this.showing=!0},__refixed:function(){if(this._tDom){var e="",t=this._tDom.offsetHeight,n=this._tDom.offsetWidth;this._tDom.offsetLeft+n>this._zrWidth&&(e+="left:"+(this._zrWidth-n-20)+"px;"),this._tDom.offsetTop+t>this._zrHeight&&(e+="top:"+(this._zrHeight-t-10)+"px;"),e!==""&&(this._tDom.style.cssText+=e)}},__tryShow:function(){var e,t;if(!this._curTarget)this._findPolarTrigger()||this._findAxisTrigger();else{if(this._curTarget._type==="island"&&this.option.tooltip.show){this._showItemTrigger();return}var n=u.get(this._curTarget,"series"),r=u.get(this._curTarget,"data");e=this.deepQuery([r,n,this.option],"tooltip.show"),n==null||r==null||!e?(clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this._hidingTicket=setTimeout(this._hide,this._hideDelay)):(t=this.deepQuery([r,n,this.option],"tooltip.trigger"),t==="axis"?this._showAxisTrigger(n.xAxisIndex,n.yAxisIndex,u.get(this._curTarget,"dataIndex")):this._showItemTrigger())}},_findAxisTrigger:function(){if(!this.component.xAxis||!this.component.yAxis){this._hidingTicket=setTimeout(this._hide,this._hideDelay);return}var e=this.option.series,t,n;for(var r=0,i=e.length;rh){l=a;if(!(a>=i))break;c=a,a=t.getCoordByIndex(++n)}return n<=0?n=0:i-l>=c-i?n-=1:t.getNameByIndex(n)==null&&(n-=1),n},_showAxisTrigger:function(e,t,n){!this._event.connectTrigger&&this.messageCenter.dispatch(o.EVENT.TOOLTIP_IN_GRID,this._event,null,this.myChart);if(this.component.xAxis==null||this.component.yAxis==null||e==null||t==null){clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this._hidingTicket=setTimeout(this._hide,this._hideDelay);return}var r=this.option.series,i=[],s=[],u,a,l,c,h,p,d="";if(this.option.tooltip.trigger==="axis"){if(!this.option.tooltip.show)return;c=this.option.tooltip.formatter,h=this.option.tooltip.position}if(e!=-1&&this.component.xAxis.getAxis(e).type===o.COMPONENT_TYPE_AXIS_CATEGORY){u=this.component.xAxis.getAxis(e);for(var v=0,m=r.length;v=0?this._showItemTrigger():(clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this._tDom.style.display="none");if(i.length>0){var g;if(typeof c=="function"){var y=[];for(var v=0,m=i.length;v"+this._encodeHTML(i[v].name||"")+" : ",g=i[v].data[n],g=g!=null?g.value!=null?g.value:g:"-",c+=g instanceof Array?g:this.numAddCommas(g);this._tDom.innerHTML=c}if(p===!1||!this.option.tooltip.showContent)return;this.hasAppend||(this._tDom.style.left=this._zrWidth/2+"px",this._tDom.style.top=this._zrHeight/2+"px",this.dom.firstChild.appendChild(this._tDom),this.hasAppend=!0),this._show(h,a+10,l+10,d)}},_showPolarTrigger:function(e,t){if(this.component.polar==null||e==null||t==null||t<0)return!1;var n=this.option.series,r=[],i,s,o,u="";if(this.option.tooltip.trigger==="axis"){if(!this.option.tooltip.show)return!1;i=this.option.tooltip.formatter,s=this.option.tooltip.position}var a=this.option.polar[e].indicator[t].text;for(var l=0,c=n.length;l0){var h,p,d=[];for(var l=0,c=r.length;l"+this._encodeHTML(d[0][3])+" : "+this.numAddCommas(d[0][2]);for(var l=1,c=d.length;l"+this._encodeHTML(d[l][1])+"
",i+=this._encodeHTML(d[l][3])+" : "+this.numAddCommas(d[l][2]);this._tDom.innerHTML=i}if(o===!1||!this.option.tooltip.showContent)return;return this.hasAppend||(this._tDom.style.left=this._zrWidth/2+"px",this._tDom.style.top=this._zrHeight/2+"px",this.dom.firstChild.appendChild(this._tDom),this.hasAppend=!0),this._show(s,f.getX(this._event),f.getY(this._event),u),!0}},_showItemTrigger:function(){if(!this._curTarget)return;var e=u.get(this._curTarget,"series"),t=u.get(this._curTarget,"data"),n=u.get(this._curTarget,"name"),r=u.get(this._curTarget,"value"),i=u.get(this._curTarget,"special"),s=u.get(this._curTarget,"special2"),a,l,c,h="",p,d="";this._curTarget._type!="island"?(this.option.tooltip.trigger==="item"&&(a=this.option.tooltip.formatter,l=this.option.tooltip.position),this.query(e,"tooltip.trigger")==="item"&&(c=this.query(e,"tooltip.showContent")||c,a=this.query(e,"tooltip.formatter")||a,l=this.query(e,"tooltip.position")||l,h+=this._style(this.query(e,"tooltip"))),c=this.query(t,"tooltip.showContent")||c,a=this.query(t,"tooltip.formatter")||a,l=this.query(t,"tooltip.position")||l,h+=this._style(this.query(t,"tooltip"))):(c=this.deepQuery([t,e,this.option],"tooltip.showContent"),a=this.deepQuery([t,e,this.option],"tooltip.islandFormatter"),l=this.deepQuery([t,e,this.option],"tooltip.islandPosition"));if(typeof a=="function")this._curTicket=(e.name||"")+":"+u.get(this._curTarget,"dataIndex"),this._tDom.innerHTML=a.call(this.myChart,[e.name||"",n,r,i,s,t],this._curTicket,this._setContent);else if(typeof a=="string")this._curTicket=NaN,a=a.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}"),a=a.replace("{a0}",this._encodeHTML(e.name||"")).replace("{b0}",this._encodeHTML(n)).replace("{c0}",r instanceof Array?r:this.numAddCommas(r)),a=a.replace("{d}","{d0}").replace("{d0}",i||""),a=a.replace("{e}","{e0}").replace("{e0}",u.get(this._curTarget,"special2")||""),this._tDom.innerHTML=a;else{this._curTicket=NaN;if(e.type===o.CHART_TYPE_SCATTER)this._tDom.innerHTML=""+(e.name!=null?this._encodeHTML(e.name)+"
":"")+(n===""?"":this._encodeHTML(n)+" : ")+r+(i==null?"":" ("+i+")");else if(e.type===o.CHART_TYPE_RADAR&&i){p=i,d+=this._encodeHTML(n===""?e.name||"":n),d+=d===""?"":"
";for(var v=0;v";this._tDom.innerHTML=d}else if(e.type===o.CHART_TYPE_CHORD)if(s==null)this._tDom.innerHTML=this._encodeHTML(n)+" ("+this.numAddCommas(r)+")";else{var m=this._encodeHTML(n),g=this._encodeHTML(i);this._tDom.innerHTML=""+(e.name!=null?this._encodeHTML(e.name)+"
":"")+m+" -> "+g+" ("+this.numAddCommas(r)+")"+"
"+g+" -> "+m+" ("+this.numAddCommas(s)+")"}else this._tDom.innerHTML=""+(e.name!=null?this._encodeHTML(e.name)+"
":"")+this._encodeHTML(n)+" : "+this.numAddCommas(r)+(i==null?"":" ("+this.numAddCommas(i)+")")}if(!this._axisLineShape.invisible||!this._axisShadowShape.invisible)this._axisLineShape.invisible=!0,this.zr.modShape(this._axisLineShape.id),this._axisShadowShape.invisible=!0,this.zr.modShape(this._axisShadowShape.id),this.zr.refresh();if(c===!1||!this.option.tooltip.showContent)return;this.hasAppend||(this._tDom.style.left=this._zrWidth/2+"px",this._tDom.style.top=this._zrHeight/2+"px",this.dom.firstChild.appendChild(this._tDom),this.hasAppend=!0),this._show(l,f.getX(this._event)+20,f.getY(this._event)-20,h)},_styleAxisPointer:function(e,t,n,r,i,s,o,u){if(e.length>0){var a,f,l=this.option.tooltip.axisPointer,c=l.type,h={line:{},cross:{},shadow:{}};for(var p in h)h[p].color=l[p+"Style"].color,h[p].width=l[p+"Style"].width,h[p].type=l[p+"Style"].type;for(var d=0,v=e.length;d100?(this._axisCrossShape.style.textAlign="left",this._axisCrossShape.style.textX=o+10):(this._axisCrossShape.style.textAlign="right",this._axisCrossShape.style.textX=o-10),u-this.component.grid.getY()>50?(this._axisCrossShape.style.textBaseline="bottom",this._axisCrossShape.style.textY=u-10):(this._axisCrossShape.style.textBaseline="top",this._axisCrossShape.style.textY=u+10),this._axisCrossShape.invisible=!1,this.zr.modShape(this._axisCrossShape.id);else if(c==="shadow"){if(h.shadow.width==null||h.shadow.width==="auto"||isNaN(h.shadow.width))h.shadow.width=s;t===r?Math.abs(this.component.grid.getX()-t)<2?(h.shadow.width/=2,t=r+=h.shadow.width/2):Math.abs(this.component.grid.getXend()-t)<2&&(h.shadow.width/=2,t=r-=h.shadow.width/2):n===i&&(Math.abs(this.component.grid.getY()-n)<2?(h.shadow.width/=2,n=i+=h.shadow.width/2):Math.abs(this.component.grid.getYend()-n)<2&&(h.shadow.width/=2,n=i-=h.shadow.width/2)),this._axisShadowShape.style={xStart:t,yStart:n,xEnd:r,yEnd:i,strokeColor:h.shadow.color,lineWidth:h.shadow.width},this._axisShadowShape.invisible=!1,this.zr.modShape(this._axisShadowShape.id)}this.zr.refresh()}},__onmousemove:function(e){clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket);var t=e.target,n=f.getX(e.event),r=f.getY(e.event);if(!t)this._curTarget=!1,this._event=e.event,this._event.zrenderX=n,this._event.zrenderY=r,this._needAxisTrigger&&this.component.grid&&l.isInside(s,this.component.grid.getArea(),n,r)?this._showingTicket=setTimeout(this._tryShow,this._showDelay):this._needAxisTrigger&&this.component.polar&&this.component.polar.isInside([n,r])!=-1?this._showingTicket=setTimeout(this._tryShow,this._showDelay):(!this._event.connectTrigger&&this.messageCenter.dispatch(o.EVENT.TOOLTIP_OUT_GRID,this._event,null,this.myChart),this._hidingTicket=setTimeout(this._hide,this._hideDelay));else{this._curTarget=t,this._event=e.event,this._event.zrenderX=n,this._event.zrenderY=r;var i;if(this._needAxisTrigger&&this.component.polar&&(i=this.component.polar.isInside([n,r]))!=-1){var u=this.option.series;for(var a=0,c=u.length;a0&&(this.zr.delShape(this._lastTipShape.tipShape),this.shapeList.length=2);for(var n=0,r=t.length;n0&&this.zr.delShape(this._lastTipShape.tipShape),this._lastTipShape=!1,this.shapeList.length=2;if(e){this.option=e,this.option.tooltip=this.reformOption(this.option.tooltip),this.option.tooltip.textStyle=h.merge(this.option.tooltip.textStyle,this.ecTheme.textStyle),this.option.tooltip.padding=this.reformCssArray(this.option.tooltip.padding),this._needAxisTrigger=!1,this.option.tooltip.trigger==="axis"&&(this._needAxisTrigger=!0);var t=this.option.series;for(var n=0,r=t.length;n0&&this.zr.delShape(this._lastTipShape.tipShape),this.clear(),this.shapeList=null,clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this.zr.un(a.EVENT.MOUSEMOVE,this._onmousemove),this.zr.un(a.EVENT.GLOBALOUT,this._onglobalout),this.hasAppend&&this.dom.firstChild.removeChild(this._tDom),this._tDom=null},_encodeHTML:function(e){return String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}},h.inherits(d,t),e("../component").define("tooltip",d),d}),define("zrender/shape/Ring",["require","./Base","../tool/util"],function(e){var t=e("./Base"),n=function(e){t.call(this,e)};return n.prototype={type:"ring",buildPath:function(e,t){e.arc(t.x,t.y,t.r,0,Math.PI*2,!1),e.moveTo(t.x+t.r0,t.y),e.arc(t.x,t.y,t.r0,0,Math.PI*2,!0);return},getRect:function(e){if(e.__rect)return e.__rect;var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,e.__rect={x:Math.round(e.x-e.r-t/2),y:Math.round(e.y-e.r-t/2),width:e.r*2+t,height:e.r*2+t},e.__rect}},e("../tool/util").inherits(n,t),n}),define("zrender/shape/Sector",["require","../tool/math","./Base","./Ring","./Polygon","../tool/util"],function(e){var t=e("../tool/math"),n=e("./Base"),r=function(e){n.call(this,e)};return r.prototype={type:"sector",buildPath:function(e,n){var r=n.x,i=n.y,s=typeof n.r0=="undefined"?0:n.r0,o=n.r,u=n.startAngle,a=n.endAngle;if(Math.abs(a-u)>=360){e.arc(r,i,o,0,Math.PI*2,!1),s!==0&&(e.moveTo(r+s,i),e.arc(r,i,s,0,Math.PI*2,!0));return}u=t.degreeToRadian(u),a=t.degreeToRadian(a);var f=Math.PI*2,l=t.cos(u),c=t.sin(u);e.moveTo(l*s+r,i-c*s),e.lineTo(l*o+r,i-c*o),e.arc(r,i,o,f-u,f-a,!0),e.lineTo(t.cos(a)*s+r,i-t.sin(a)*s),s!==0&&e.arc(r,i,s,f-a,f-u,!1),e.closePath();return},getRect:function(n){if(n.__rect)return n.__rect;var r=n.x,i=n.y,s=typeof n.r0=="undefined"?0:n.r0,o=n.r,u=n.startAngle,a=n.endAngle;if(Math.abs(a-u)>=360)return n.__rect=e("./Ring").prototype.getRect(n),n.__rect;u=(720+u)%360,a=(720+a)%360,a<=u&&(a+=360);var f=[];return u<=90&&a>=90&&f.push([r,i-o]),u<=180&&a>=180&&f.push([r-o,i]),u<=270&&a>=270&&f.push([r,i+o]),u<=360&&a>=360&&f.push([r+o,i]),u=t.degreeToRadian(u),a=t.degreeToRadian(a),f.push([t.cos(u)*s+r,i-t.sin(u)*s]),f.push([t.cos(u)*o+r,i-t.sin(u)*o]),f.push([t.cos(a)*o+r,i-t.sin(a)*o]),f.push([t.cos(a)*s+r,i-t.sin(a)*s]),n.__rect=e("./Polygon").prototype.getRect({brushType:n.brushType,lineWidth:n.lineWidth,pointList:f}),n.__rect}},e("../tool/util").inherits(r,n),r}),define("echarts/util/shape/Candle",["require","zrender/shape/Base","zrender/tool/util","./normalIsCover"],function(e){function r(e){t.call(this,e)}var t=e("zrender/shape/Base"),n=e("zrender/tool/util");return r.prototype={type:"candle",_numberOrder:function(e,t){return t-e},buildPath:function(e,t){var r=n.clone(t.y).sort(this._numberOrder);e.moveTo(t.x,r[3]),e.lineTo(t.x,r[2]),e.moveTo(t.x-t.width/2,r[2]),e.rect(t.x-t.width/2,r[2],t.width,r[1]-r[2]),e.moveTo(t.x,r[1]),e.lineTo(t.x,r[0])},getRect:function(e){if(!e.__rect){var t=0;if(e.brushType=="stroke"||e.brushType=="fill")t=e.lineWidth||1;var r=n.clone(e.y).sort(this._numberOrder);e.__rect={x:Math.round(e.x-e.width/2-t/2),y:Math.round(r[3]-t/2),width:e.width+t,height:r[0]-r[3]+t}}return e.__rect},isCover:e("./normalIsCover")},n.inherits(r,t),r}),define("echarts/component/legend",["require","./base","zrender/shape/Text","zrender/shape/Rectangle","zrender/shape/Sector","../util/shape/Icon","../util/shape/Candle","../config","zrender/tool/util","zrender/tool/area","../component"],function(e){function l(e,n,r,i,s){if(!this.query(i,"legend.data")){console.error("option.legend.data has not been defined.");return}t.call(this,e,n,r,i,s);var o=this;o._legendSelected=function(e){o.__legendSelected(e)},this._colorIndex=0,this._colorMap={},this._selectedMap={},this.refresh(i)}var t=e("./base"),n=e("zrender/shape/Text"),r=e("zrender/shape/Rectangle"),i=e("zrender/shape/Sector"),s=e("../util/shape/Icon"),o=e("../util/shape/Candle"),u=e("../config"),a=e("zrender/tool/util"),f=e("zrender/tool/area");l.prototype={type:u.COMPONENT_TYPE_LEGEND,_buildShape:function(){this._itemGroupLocation=this._getItemGroupLocation(),this._buildBackground(),this._buildItem();for(var e=0,t=this.shapeList.length;e=d-m&&(m=this._itemGroupLocation.x,g+=b+w):v-g<200&&b+(S===t-1||e[S+1]===""?0:w)>=v-g&&(this.legendOption.x==="right"?m-=this._itemGroupLocation.maxWidth+w:m+=this._itemGroupLocation.maxWidth+w,g=this._itemGroupLocation.y),o=this._getItemShapeByType(m,g,y,b,this._selectedMap[r]?E:"#ccc",i,E),o._name=r,o=new s(o),u={zlevel:this._zlevelBase,style:{x:m+y+5,y:g+b/2,color:this._selectedMap[r]?c.color==="auto"?E:c.color:"#ccc",text:p,textFont:h,textBaseline:"middle"},highlightStyle:{color:E,brushType:"fill"},hoverable:!!this.legendOption.selectedMode,clickable:!!this.legendOption.selectedMode},this.legendOption.orient==="vertical"&&this.legendOption.x==="right"&&(u.style.x-=y+10,u.style.textAlign="right"),u._name=r,u=new n(u),this.legendOption.selectedMode&&(o.onclick=u.onclick=this._legendSelected,o.onmouseover=u.onmouseover=this.hoverConnect,o.hoverConnect=u.id,u.hoverConnect=o.id),this.shapeList.push(o),this.shapeList.push(u),this.legendOption.orient==="horizontal"?m+=y+5+f.getTextWidth(p,h)+w:g+=b+w}this.legendOption.orient==="horizontal"&&this.legendOption.x==="center"&&g!=this._itemGroupLocation.y&&this._mLineOptimize()},_getName:function(e){return typeof e.name!="undefined"?e.name:e},_getFormatterName:function(e){var t=this.legendOption.formatter,n;return typeof t=="function"?n=t.call(this.myChart,e):typeof t=="string"?n=t.replace("{name}",e):n=e,n},_getFormatterNameFromData:function(e){var t=this._getName(e);return this._getFormatterName(t)},_mLineOptimize:function(){var e=[],t=this._itemGroupLocation.x;for(var n=2,r=this.shapeList.length;nh?(u=h,l+=i+n):u=Math.max(u,d),l+=i+n,d=0;continue}d+=r+f.getTextWidth(this._getFormatterNameFromData(e[m]),e[m].textStyle?this.getFont(a.merge(e[m].textStyle||{},s)):o)+n}l=Math.max(l,i),d-=n,d>h?(u=h,l+=i+n):u=Math.max(u,d)}else{for(var m=0;mp?(l=p,u+=v+n):l=Math.max(l,d),u+=v+n,d=0;continue}d+=i+n}u=Math.max(u,v),d-=n,d>p?(l=p,u+=v+n):l=Math.max(l,d)}h=this.zr.getWidth(),p=this.zr.getHeight();var g;switch(this.legendOption.x){case"center":g=Math.floor((h-u)/2);break;case"left":g=this.legendOption.padding[3]+this.legendOption.borderWidth;break;case"right":g=h-u-this.legendOption.padding[1]-this.legendOption.padding[3]-this.legendOption.borderWidth*2;break;default:g=this.parsePercent(this.legendOption.x,h)}var y;switch(this.legendOption.y){case"top":y=this.legendOption.padding[0]+this.legendOption.borderWidth;break;case"bottom":y=p-l-this.legendOption.padding[0]-this.legendOption.padding[2]-this.legendOption.borderWidth*2;break;case"center":y=Math.floor((p-l)/2);break;default:y=this.parsePercent(this.legendOption.y,p)}return{x:g,y:y,width:u,height:l,maxWidth:v}},_getSomethingByName:function(e){var t=this.option.series,n;for(var r=0,i=t.length;r=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height?!0:!1}},i.inherits(o,t),o}),define("echarts/component/timeline",["require","./base","zrender/shape/Rectangle","../util/shape/Icon","../util/shape/Chain","../config","zrender/tool/util","zrender/tool/area","zrender/tool/event","../component"],function(e){function f(e,n,r,i,u){t.call(this,e,n,r,i,u);var a=this;a._onclick=function(e){return a.__onclick(e)},a._ondrift=function(e,t){return a.__ondrift(this,e,t)},a._ondragend=function(){return a.__ondragend()},a._setCurrentOption=function(){var e=a.timelineOption;a.currentIndex%=e.data.length;var t=a.options[a.currentIndex]||{};a.myChart.setOption(t,e.notMerge),a.messageCenter.dispatch(s.EVENT.TIMELINE_CHANGED,null,{currentIndex:a.currentIndex,data:e.data[a.currentIndex].name!=null?e.data[a.currentIndex].name:e.data[a.currentIndex]},a.myChart)},a._onFrame=function(){a._setCurrentOption(),a._syncHandleShape(),a.timelineOption.autoPlay&&(a.playTicket=setTimeout(function(){a.currentIndex+=1;if(!a.timelineOption.loop&&a.currentIndex>=a.timelineOption.data.length){a.currentIndex=a.timelineOption.data.length-1,a.stop();return}a._onFrame()},a.timelineOption.playInterval))},this.setTheme(!1),this.options=this.option.options,this.currentIndex=this.timelineOption.currentIndex%this.timelineOption.data.length,!this.timelineOption.notMerge&&this.currentIndex!==0&&(this.options[this.currentIndex]=o.merge(this.options[this.currentIndex],this.options[0])),this.timelineOption.show&&(this._buildShape(),this._syncHandleShape()),this._setCurrentOption();if(this.timelineOption.autoPlay){var a=this;this.playTicket=setTimeout(function(){a.play()},this.ecTheme.animationDuration)}}function l(e,t){var n=2,i=t.x+n,s=t.y+n+2,o=t.width-n,u=t.height-n,a=t.symbol;if(a==="last")e.moveTo(i+o-2,s+u/3),e.lineTo(i+o-2,s),e.lineTo(i+2,s+u/2),e.lineTo(i+o-2,s+u),e.lineTo(i+o-2,s+u/3*2),e.moveTo(i,s),e.lineTo(i,s);else if(a==="next")e.moveTo(i+2,s+u/3),e.lineTo(i+2,s),e.lineTo(i+o-2,s+u/2),e.lineTo(i+2,s+u),e.lineTo(i+2,s+u/3*2),e.moveTo(i,s),e.lineTo(i,s);else if(a==="play")if(t.status==="stop")e.moveTo(i+2,s),e.lineTo(i+o-2,s+u/2),e.lineTo(i+2,s+u),e.lineTo(i+2,s);else{var f=t.brushType==="both"?2:3;e.rect(i+2,s,f,u),e.rect(i+o-f-2,s,f,u)}else if(a.match("image")){var l="";l=a.replace(new RegExp("^image:\\/\\/"),""),a=r.prototype.iconLibrary.image,a(e,{x:i,y:s,width:o,height:u,image:l})}}var t=e("./base"),n=e("zrender/shape/Rectangle"),r=e("../util/shape/Icon"),i=e("../util/shape/Chain"),s=e("../config"),o=e("zrender/tool/util"),u=e("zrender/tool/area"),a=e("zrender/tool/event");return f.prototype={type:s.COMPONENT_TYPE_TIMELINE,_buildShape:function(){this._location=this._getLocation(),this._buildBackground(),this._buildControl(),this._chainPoint=this._getChainPoint();if(this.timelineOption.label.show){var e=this._getInterval();for(var t=0,n=this._chainPoint.length;t3){var o=!1,a,f;n=0;while(!o&&n1){var v=c/h;v=v>50?50:v<20?5:v,c-=v*2;if(e.type==="number")for(var m=0;m0?"right":"left",S=[r*Math.PI/180,f,l-5]):S=!1,g.push({x:f,n:b,isEmpty:w,symbol:y,symbolSize:a[m].symbolSize||n,color:a[m].color,borderColor:a[m].borderColor,borderWidth:a[m].borderWidth,name:this._getReformedLabel(m),textColor:u.color,textAlign:E,textBaseline:u.baseline||"middle",textX:f,textY:l-(r?5:0),textFont:a[m].textStyle?this.getFont(u):s,rotation:S,showLabel:!1});return g},_buildBackground:function(){var e=this.timelineOption,t=e.padding,r=this._location.width,i=this._location.height;(e.borderWidth!==0||e.backgroundColor.replace(/\s/g,"")!="rgba(0,0,0,0)")&&this.shapeList.push(new n({zlevel:this._zlevelBase,hoverable:!1,style:{x:this._location.x-t[3],y:this._location.y-t[0],width:r+t[1]+t[3],height:i+t[0]+t[2],brushType:e.borderWidth===0?"fill":"both",color:e.backgroundColor,strokeColor:e.borderColor,lineWidth:e.borderWidth}}))},_buildControl:function(){var e=this,t=this.timelineOption,n=t.lineStyle,i=t.controlStyle;if(t.controlPosition==="none")return;var s=15,u=5,a;t.controlPosition==="left"?(a=this._location.x,this._location.x+=(s+u)*3):(a=this._location.x2-((s+u)*3-u),this._location.x2-=(s+u)*3);var f=this._location.y,l={zlevel:this._zlevelBase+1,style:{iconType:"timelineControl",symbol:"last",x:a,y:f,width:s,height:s,brushType:"stroke",color:i.normal.color,strokeColor:i.normal.color,lineWidth:n.width},highlightStyle:{color:i.emphasis.color,strokeColor:i.emphasis.color,lineWidth:n.width+1},clickable:!0};this._ctrLastShape=new r(l),this._ctrLastShape.onclick=function(){e.last()},this.shapeList.push(this._ctrLastShape),a+=s+u,this._ctrPlayShape=new r(o.clone(l)),this._ctrPlayShape.style.brushType="fill",this._ctrPlayShape.style.symbol="play",this._ctrPlayShape.style.status=this.timelineOption.autoPlay?"playing":"stop",this._ctrPlayShape.style.x=a,this._ctrPlayShape.onclick=function(){e._ctrPlayShape.style.status==="stop"?e.play():e.stop()},this.shapeList.push(this._ctrPlayShape),a+=s+u,this._ctrNextShape=new r(o.clone(l)),this._ctrNextShape.style.symbol="next",this._ctrNextShape.style.x=a,this._ctrNextShape.onclick=function(){e.next()},this.shapeList.push(this._ctrNextShape)},_buildChain:function(){var e=this.timelineOption,t=e.lineStyle;this._timelineShae={zlevel:this._zlevelBase,style:{x:this._location.x,y:this.subPixelOptimize(this._location.y,t.width),width:this._location.x2-this._location.x,height:this._location.height,chainPoint:this._chainPoint,brushType:"both",strokeColor:t.color,lineWidth:t.width,lineType:t.type},hoverable:!1,clickable:!0,onclick:this._onclick},this._timelineShae=new i(this._timelineShae),this.shapeList.push(this._timelineShae)},_buildHandle:function(){var e=this._chainPoint[this.currentIndex],t=e.symbolSize+1;t=t<5?5:t,this._handleShape={zlevel:this._zlevelBase+1,hoverable:!1,draggable:!0,style:{iconType:"diamond",n:e.n,x:e.x-t,y:this._location.y+this._location.height/4-t,width:t*2,height:t*2,brushType:"both",textPosition:"specific",textX:e.x,textY:this._location.y-this._location.height/4,textAlign:"center",textBaseline:"middle"},highlightStyle:{},ondrift:this._ondrift,ondragend:this._ondragend},this._handleShape=new r(this._handleShape),this.shapeList.push(this._handleShape)},_syncHandleShape:function(){if(!this.timelineOption.show)return;var e=this.timelineOption,t=e.checkpointStyle,n=this._chainPoint[this.currentIndex];this._handleShape.style.text=t.label.show?n.name:"",this._handleShape.style.textFont=n.textFont,this._handleShape.style.n=n.n,t.symbol==="auto"?this._handleShape.style.iconType=n.symbol!="none"?n.symbol:"diamond":(this._handleShape.style.iconType=t.symbol,t.symbol.match("star")&&(this._handleShape.style.n=t.symbol.replace("star","")-0||5,this._handleShape.style.iconType="star"));var r;t.symbolSize==="auto"?(r=n.symbolSize+2,r=r<5?5:r):r=t.symbolSize-0,this._handleShape.style.color=t.color==="auto"?n.color?n.color:e.controlStyle.emphasis.color:t.color,this._handleShape.style.textColor=t.label.textStyle.color==="auto"?this._handleShape.style.color:t.label.textStyle.color,this._handleShape.highlightStyle.strokeColor=this._handleShape.style.strokeColor=t.borderColor==="auto"?n.borderColor?n.borderColor:"#fff":t.borderColor,this._handleShape.style.lineWidth=t.borderWidth==="auto"?n.borderWidth?n.borderWidth:0:t.borderWidth-0,this._handleShape.highlightStyle.lineWidth=this._handleShape.style.lineWidth+1,this.zr.animate(this._handleShape.id,"style").when(500,{x:n.x-r,textX:n.x,y:this._location.y+this._location.height/4-r,width:r*2,height:r*2}).start("ExponentialOut")},_findChainIndex:function(e){var t=this._chainPoint,n=t.length;if(e<=t[0].x)return 0;if(e>=t[n-1].x)return n-1;for(var r=0;r=t[r].x&&e<=t[r+1].x)return Math.abs(e-t[r].x)=n[r-1].x-n[r-1].symbolSize?(e.style.x=n[r-1].x-n[r-1].symbolSize,i=r-1):(e.style.x+=t,i=this._findChainIndex(e.style.x));var s=n[i],o=s.symbolSize+2;e.style.iconType=s.symbol,e.style.n=s.n,e.style.textX=e.style.x+o/2,e.style.y=this._location.y+this._location.height/4-o,e.style.width=o*2,e.style.height=o*2,e.style.text=s.name;if(i===this.currentIndex)return!0;this.currentIndex=i;if(this.timelineOption.realtime){clearTimeout(this.playTicket);var u=this;this.playTicket=setTimeout(function(){u._setCurrentOption()},200)}return!0},__ondragend:function(){this.isDragend=!0},ondragend:function(e,t){if(!this.isDragend||!e.target)return;!this.timelineOption.realtime&&this._setCurrentOption(),t.dragOut=!0,t.dragIn=!0,t.needRefresh=!1,this.isDragend=!1,this._syncHandleShape();return},last:function(){return this.timelineOption.autoPlay&&this.stop(),this.currentIndex-=1,this.currentIndex<0&&(this.currentIndex=this.timelineOption.data.length-1),this._onFrame(),this.currentIndex},next:function(){return this.timelineOption.autoPlay&&this.stop(),this.currentIndex+=1,this.currentIndex>=this.timelineOption.data.length&&(this.currentIndex=0),this._onFrame(),this.currentIndex},play:function(e,t){return this._ctrPlayShape&&this._ctrPlayShape.style.status!="playing"&&(this._ctrPlayShape.style.status="playing",this.zr.modShape(this._ctrPlayShape.id),this.zr.refresh()),this.timelineOption.autoPlay=t!=null?t:!0,this.timelineOption.autoPlay||clearTimeout(this.playTicket),this.currentIndex=e!=null?e:this.currentIndex+1,this.currentIndex>=this.timelineOption.data.length&&(this.currentIndex=0),this._onFrame(),this.currentIndex},stop:function(){return this._ctrPlayShape&&this._ctrPlayShape.style.status!="stop"&&(this._ctrPlayShape.style.status="stop",this.zr.modShape(this._ctrPlayShape.id),this.zr.refresh()),this.timelineOption.autoPlay=!1,clearTimeout(this.playTicket),this.currentIndex},resize:function(){this.timelineOption.show&&(this.clear(),this._buildShape(),this._syncHandleShape())},setTheme:function(e){this.timelineOption=this.reformOption(o.clone(this.option.timeline)),this.timelineOption.padding=this.reformCssArray(this.timelineOption.padding),this.timelineOption.label.textStyle=o.merge(this.timelineOption.label.textStyle||{},this.ecTheme.textStyle),this.timelineOption.checkpointStyle.label.textStyle=o.merge(this.timelineOption.checkpointStyle.label.textStyle||{},this.ecTheme.textStyle),this.timelineOption.show&&e&&(this.clear(),this._buildShape(),this._syncHandleShape())},dispose:function(){this.clear(),this.shapeList=null,clearTimeout(this.playTicket)}},r.prototype.iconLibrary.timelineControl=l,o.inherits(f,t),e("../component").define("timeline",f),f}),define("zrender/loadingEffect/Bar",["require","./Base","../tool/util","../tool/color","../shape/Rectangle"],function(e){function s(e){t.call(this,e)}var t=e("./Base"),n=e("../tool/util"),r=e("../tool/color"),i=e("../shape/Rectangle");return n.inherits(s,t),s.prototype._start=function(e,t){var s=n.merge(this.options,{textStyle:{color:"#888"},backgroundColor:"rgba(250, 250, 250, 0.8)",effectOption:{x:0,y:this.canvasHeight/2-30,width:this.canvasWidth,height:5,brushType:"fill",timeInterval:100}}),o=this.createTextShape(s.textStyle),u=this.createBackgroundShape(s.backgroundColor),a=s.effectOption,f=new i({highlightStyle:n.clone(a)});f.highlightStyle.color=a.color||r.getLinearGradient(a.x,a.y,a.x+a.width,a.y+a.height,[[0,"#ff6400"],[.5,"#ffe100"],[1,"#b1ff00"]]);if(s.progress!=null){e(u),f.highlightStyle.width=this.adjust(s.progress,[0,1])*s.effectOption.width,e(f),e(o),t();return}return f.highlightStyle.width=0,setInterval(function(){e(u),f.highlightStyle.width=h&&(c[n].len=Math.ceil(Math.random()*400),r.xStart=-400,r.xEnd=-400+c[n].len,r.yStart=Math.ceil(Math.random()*p),r.yEnd=r.yStart),r.xStart+=c[n].animationX,r.xEnd+=c[n].animationX,e(c[n])}e(o),t()},a.timeInterval)},s}),define("zrender/loadingEffect/Ring",["require","./Base","../tool/util","../tool/color","../shape/Ring","../shape/Sector"],function(e){function o(e){t.call(this,e)}var t=e("./Base"),n=e("../tool/util"),r=e("../tool/color"),i=e("../shape/Ring"),s=e("../shape/Sector");return n.inherits(o,t),o.prototype._start=function(e,t){var o=n.merge(this.options,{textStyle:{color:"#07a"},backgroundColor:"rgba(250, 250, 250, 0.8)",effect:{x:this.canvasWidth/2,y:this.canvasHeight/2,r0:60,r:100,color:"#bbdcff",brushType:"fill",textPosition:"inside",textFont:"normal 30px verdana",textColor:"rgba(30, 144, 255, 0.6)",timeInterval:100}}),u=o.effect,a=o.textStyle;a.x==null&&(a.x=u.x),a.y==null&&(a.y=u.y+(u.r0+u.r)/2-5);var f=this.createTextShape(o.textStyle),l=this.createBackgroundShape(o.backgroundColor),c=u.x,h=u.y,p=u.r0+6,d=u.r-6,v=u.color,m=r.lift(v,.1),g=new i({highlightStyle:n.clone(u)}),y=[],b=r.getGradientColors(["#ff6400","#ffe100","#97ff00"],25),w=15,E=240;for(var S=0;S<16;S++)y.push(new s({highlightStyle:{x:c,y:h,r0:p,r:d,startAngle:E-w,endAngle:E,brushType:"fill",color:m},_color:r.getLinearGradient(c+p*Math.cos(E,!0),h-p*Math.sin(E,!0),c+p*Math.cos(E-w,!0),h-p*Math.sin(E-w,!0),[[0,b[S*2]],[1,b[S*2+1]]])})),E-=w;E=360;for(var S=0;S<4;S++)y.push(new s({highlightStyle:{x:c,y:h,r0:p,r:d,startAngle:E-w,endAngle:E,brushType:"fill",color:m},_color:r.getLinearGradient(c+p*Math.cos(E,!0),h-p*Math.sin(E,!0),c+p*Math.cos(E-w,!0),h-p*Math.sin(E-w,!0),[[0,b[S*2+32]],[1,b[S*2+33]]])})),E-=w;var x=0;if(o.progress!=null){e(l),x=this.adjust(o.progress,[0,1]).toFixed(2)*100/5,g.highlightStyle.text=x*5+"%",e(g);for(var S=0;S<20;S++)y[S].highlightStyle.color=S=20?-20:1,e(g);for(var n=0;n<20;n++)y[n].highlightStyle.color=n ");var u=-1;for(var a=0,f=o.length;a-1){o.splice(u,1),this._optionRestore.series[e][n].data.splice(u,1);var c=this.chart[i.type];c&&c.delMark(e,t.join(" > "),n)}return this},getDom:function(){return this.dom},getZrender:function(){return this._zr},getDataURL:function(e){if(!s)return"";if(this._chartList.length===0){var t="IMG"+this.id,n=document.getElementById(t);if(n)return n.src}var r=this.component.tooltip;r&&r.hideTip();switch(e){case"jpeg":break;default:e="png"}var i=this._option.backgroundColor;return i&&i.replace(" ","")==="rgba(0,0,0,0)"&&(i="#fff"),this._zr.toDataURL("image/"+e,i)},getImage:function(e){var t=this._optionRestore.title,n=document.createElement("img");return n.src=this.getDataURL(e),n.title=t&&t.text||"ECharts",n},getConnectedDataURL:function(t){if(!this.isConnected())return this.getDataURL(t);var n=this.dom,r={self:{img:this.getDataURL(t),left:n.offsetLeft,top:n.offsetTop,right:n.offsetLeft+n.offsetWidth,bottom:n.offsetTop+n.offsetHeight}},i=r.self.left,s=r.self.top,o=r.self.right,u=r.self.bottom;for(var a in this._connected)n=this._connected[a].getDom(),r[a]={img:this._connected[a].getDataURL(t),left:n.offsetLeft,top:n.offsetTop,right:n.offsetLeft+n.offsetWidth,bottom:n.offsetTop+n.offsetHeight},i=Math.min(i,r[a].left),s=Math.min(s,r[a].top),o=Math.max(o,r[a].right),u=Math.max(u,r[a].bottom);var f=document.createElement("div");f.style.position="absolute",f.style.left="-4000px",f.style.width=o-i+"px",f.style.height=u-s+"px",document.body.appendChild(f);var l=e("zrender").init(f),c=e("zrender/shape/Image");for(var a in r)l.addShape(new c({style:{x:r[a].left-i,y:r[a].top-s,image:r[a].img}}));l.render();var h=this._option.backgroundColor;h&&h.replace(/ /g,"")==="rgba(0,0,0,0)"&&(h="#fff");var p=l.toDataURL("image/png",h);return setTimeout(function(){l.dispose(),f.parentNode.removeChild(f),f=null},100),p},getConnectedImage:function(e){var t=this._optionRestore.title,n=document.createElement("img");return n.src=this.getConnectedDataURL(e),n.title=t&&t.text||"ECharts",n},on:function(e,t){return this._messageCenterOutSide.bind(e,t,this),this},un:function(e,t){return this._messageCenterOutSide.unbind(e,t),this},connect:function(e){if(!e)return this;this._connected||(this._connected={});if(e instanceof Array)for(var t=0,n=e.length;t=n/3?1:2),o=t.y+Math.sin(i)*r*(r>=n/3?1:2);i=t.angle-Math.PI/2,e.moveTo(s,o),e.lineTo(t.x+Math.cos(i)*r,t.y-Math.sin(i)*r),e.lineTo(t.x+Math.cos(t.angle)*n,t.y-Math.sin(t.angle)*n),e.lineTo(t.x-Math.cos(i)*r,t.y+Math.sin(i)*r),e.lineTo(s,o);return},getRect:function(e){if(e.__rect)return e.__rect;var t=e.width*2,n=e.x,r=e.y,i=n+Math.cos(e.angle)*e.r,s=r-Math.sin(e.angle)*e.r;return e.__rect={x:Math.min(n,i)-t,y:Math.min(r,s)-t,width:Math.abs(n-i)+t,height:Math.abs(r-s)+t},e.__rect},isCover:e("./normalIsCover")},n.inherits(r,t),r}),define("echarts/chart/gauge",["require","../component/base","./base","../util/shape/GaugePointer","zrender/shape/Text","zrender/shape/Line","zrender/shape/Rectangle","zrender/shape/Circle","zrender/shape/Sector","../config","../util/ecData","../util/accMath","zrender/tool/util","../chart"],function(e){function p(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this),this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("../util/shape/GaugePointer"),i=e("zrender/shape/Text"),s=e("zrender/shape/Line"),o=e("zrender/shape/Rectangle"),u=e("zrender/shape/Circle"),a=e("zrender/shape/Sector"),f=e("../config"),l=e("../util/ecData"),c=e("../util/accMath"),h=e("zrender/tool/util");return p.prototype={type:f.CHART_TYPE_GAUGE,_buildShape:function(){var e=this.series;this._paramsMap={};for(var t=0,n=e.length;t=110&&v<=250?"left":v<=70||v>=290?"right":"center",textBaseline:v>=10&&v<=170?"top":v>=190&&v<=350?"bottom":"middle",textFont:u,shadowColor:o.shadowColor,shadowBlur:o.shadowBlur,shadowOffsetX:o.shadowOffsetX,shadowOffsetY:o.shadowOffsetY}}))},_buildPointer:function(e){var t=this.series[e];if(!t.pointer.show)return;var n=t.max-t.min,i=t.pointer,s=this._paramsMap[e],o=this.parsePercent(i.length,s.radius[1]),a=this.parsePercent(i.width,s.radius[1]),f=s.center,c=this._getValue(e);c=c2?2:a/2,color:"#fff"}});l.pack(d,this.series[e],e,this.series[e].data[0],0,this.series[e].data[0].name,c),this.shapeList.push(d),this.shapeList.push(new u({zlevel:this._zlevelBase+2,hoverable:!1,style:{x:f[0],y:f[1],r:i.width/2.5,color:"#fff"}}))},_buildTitle:function(e){var t=this.series[e];if(!t.title.show)return;var n=t.data[0],r=n.name!=null?n.name:"";if(r!==""){var s=t.title,o=s.offsetCenter,u=s.textStyle,a=u.color,f=this._paramsMap[e],l=f.center[0]+this.parsePercent(o[0],f.radius[1]),c=f.center[1]+this.parsePercent(o[1],f.radius[1]);this.shapeList.push(new i({zlevel:this._zlevelBase+(Math.abs(l-f.center[0])+Math.abs(c-f.center[1]))=t)return n[r][1];return n[n.length-1][1]},_getSector:function(e,t,n,r,i,s,o){return new a({zlevel:this._zlevelBase,hoverable:!1,style:{x:e[0],y:e[1],r0:t,r:n,startAngle:r,endAngle:i,brushType:"fill",color:s,shadowColor:o.shadowColor,shadowBlur:o.shadowBlur,shadowOffsetX:o.shadowOffsetX,shadowOffsetY:o.shadowOffsetY}})},_getLabelText:function(e,t){if(e){if(typeof e=="function")return e.call(this.myChart,t);if(typeof e=="string")return e.replace("{value}",t)}return t},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()}},h.inherits(p,n),h.inherits(p,t),e("../chart").define("gauge",p),p}),define("echarts/chart/funnel",["require","../component/base","./base","zrender/shape/Text","zrender/shape/Line","zrender/shape/Polygon","../config","../util/ecData","../util/number","zrender/tool/util","zrender/tool/color","zrender/tool/area","../chart"],function(e){function h(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this),this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("zrender/shape/Text"),i=e("zrender/shape/Line"),s=e("zrender/shape/Polygon"),o=e("../config"),u=e("../util/ecData"),a=e("../util/number"),f=e("zrender/tool/util"),l=e("zrender/tool/color"),c=e("zrender/tool/area");return h.prototype={type:o.CHART_TYPE_FUNNEL,_buildShape:function(){var e=this.series,t=this.component.legend;this._paramsMap={},this._selected={},this.selectedMap={};var n;for(var r=0,i=e.length;r1?(i.height-(o-1)*h)/o:i.height,d,v=i.y,m=n.sort==="descending"?this._getItemWidth(e,u[0].value):a.parsePercent(n.minSize,i.width),g=n.sort==="descending"?1:0,y=i.centerX,b=[[y-m/2-(m===0?0:10),v-(m===0?10:5)],[y+m/2+(m===0?0:10),v-(m===0?10:5)]];for(var f=0,l=u.length;fc.getTextWidth(w,E)?T="#fff":T=l.reverse(n)):g.position==="left"?(S="right",x=b==="auto"?d.x-10:d.centerX-Math.max(o,u)/2-b):(S="left",x=b==="auto"?d.x+d.width+10:d.centerX+Math.max(o,u)/2+b);var N={zlevel:this._zlevelBase+1,style:{x:x,y:s+a/2,color:y.color||T,text:w,textAlign:y.align||S,textBaseline:y.baseline||"middle",textFont:E}};return m="emphasis",g=v[m].label||g,y=g.textStyle||y,b=v[m].labelLine.length||b,g.position=g.position||v.normal.label.position,w=this.getLabelText(e,t,m),E=this.getFont(y),T=n,g.position==="inner"||g.position==="inside"?(S="center",x=i+o/2,Math.max(o,u)/2>c.getTextWidth(w,E)?T="#fff":T=l.reverse(n)):g.position==="left"?(S="right",x=b==="auto"?d.x-10:d.centerX-Math.max(o,u)/2-b):(S="left",x=b==="auto"?d.x+d.width+10:d.centerX+Math.max(o,u)/2+b),N.highlightStyle={x:x,color:y.color||T,text:w,textAlign:y.align||S,textFont:E,brushType:"fill"},new r(N)},getLabelText:function(e,t,n){var r=this.series,i=r[e],s=i.data[t],o=this.deepQuery([s,i],"itemStyle."+n+".label.formatter");if(!o)return s.name;if(typeof o=="function")return o.call(this.myChart,i.name,s.name,s.value);if(typeof o=="string")return o=o.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}"),o=o.replace("{a0}",i.name).replace("{b0}",s.name).replace("{c0}",s.value),o},getLabelLine:function(e,t,n,r,s,o,u,a){var l=this.series[e],c=l.data[t],h=this._paramsMap[e].location,p=f.merge(f.clone(c.itemStyle)||{},l.itemStyle),d="normal",v=p[d].labelLine,m=p[d].labelLine.length,g=v.lineStyle||{},y=p[d].label;y.position=y.position||p.normal.label.position;var b;y.position==="inner"||y.position==="inside"?b=r+o/2:y.position==="left"?b=m==="auto"?h.x-10:h.centerX-Math.max(o,u)/2-m:b=m==="auto"?h.x+h.width+10:h.centerX+Math.max(o,u)/2+m;var w={zlevel:this._zlevelBase+1,hoverable:!1,style:{xStart:h.centerX,yStart:s+a/2,xEnd:b,yEnd:s+a/2,strokeColor:g.color||n,lineType:g.type,lineWidth:g.width}};return d="emphasis",v=p[d].labelLine||v,m=p[d].labelLine.length||m,g=v.lineStyle||g,y=p[d].label||y,y.position=y.position,y.position==="inner"||y.position==="inside"?b=r+o/2:y.position==="left"?b=m==="auto"?h.x-10:h.centerX-Math.max(o,u)/2-m:b=m==="auto"?h.x+h.width+10:h.centerX+Math.max(o,u)/2+m,w.highlightStyle={xEnd:b,strokeColor:g.color||n,lineType:g.type,lineWidth:g.width},new i(w)},_needLabel:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".label.show")},_needLabelLine:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".labelLine.show")},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()}},f.inherits(h,n),f.inherits(h,t),e("../chart").define("funnel",h),h}),define("echarts/component/categoryAxis",["require","./base","zrender/shape/Text","zrender/shape/Line","zrender/shape/Rectangle","../config","zrender/tool/util","zrender/tool/area","../component"],function(e){function a(e,n,r,i,s,o){if(i.data.length<1){console.error("option.data.length < 1.");return}t.call(this,e,n,r,i,s),this.grid=this.component.grid;for(var u in o)this[u]=o[u];this.refresh(i)}var t=e("./base"),n=e("zrender/shape/Text"),r=e("zrender/shape/Line"),i=e("zrender/shape/Rectangle"),s=e("../config"),o=e("zrender/tool/util"),u=e("zrender/tool/area");return a.prototype={type:s.COMPONENT_TYPE_AXIS_CATEGORY,_getReformedLabel:function(e){var t=typeof this.option.data[e].value!="undefined"?this.option.data[e].value:this.option.data[e],n=this.option.data[e].formatter||this.option.axisLabel.formatter;return n&&(typeof n=="function"?t=n.call(this.myChart,t):typeof n=="string"&&(t=n.replace("{value}",t))),t},_getInterval:function(){var e=this.option.axisLabel.interval;if(e=="auto"){var t=this.option.axisLabel.textStyle.fontSize,n=this.option.data,r=this.option.data.length;if(this.isHorizontal())if(r>3){var i=this.getGap(),s=!1,a,f,l=Math.floor(.5/i);l=l<1?1:l,e=Math.floor(15/i);while(!s&&e=0;c-=e){if(this.option.axisLabel.rotate!==0)f=t;else if(n[c].textStyle)f=u.getTextWidth(this._getReformedLabel(c),this.getFont(o.merge(n[c].textStyle,this.option.axisLabel.textStyle)));else{var h=this._getReformedLabel(c)+"",p=(h.match(/\w/g)||"").length,d=h.length-p;f=p*t*2/3+d*t}if(a3){var i=this.getGap();e=Math.floor(11/i);while(i*e-60?-u:0;if(this.isHorizontal()){var c=this.option.position=="bottom"?n.inside?this.grid.getYend()-i-1:this.grid.getYend()+1:n.inside?this.grid.getY()+1:this.grid.getY()-i-1,h;for(var p=l;p=0?f:0),o),e={_axisShape:"axisTick",zlevel:this._zlevelBase,hoverable:!1,style:{xStart:h,yStart:c,xEnd:h,yEnd:c+i,strokeColor:s,lineWidth:o}},this.shapeList.push(new r(e))}else{var d=this.option.position=="left"?n.inside?this.grid.getX()+1:this.grid.getX()-i-1:n.inside?this.grid.getXend()-i-1:this.grid.getXend()+1,v;for(var p=l;p=0?f:0),o),e={_axisShape:"axisTick",zlevel:this._zlevelBase,hoverable:!1,style:{xStart:d,yStart:v,xEnd:d+i,yEnd:v,strokeColor:s,lineWidth:o}},this.shapeList.push(new r(e))}},_buildAxisLabel:function(){var e,t=this.option.data,r=this.option.data.length,i=this.option.axisLabel.rotate,s=this.option.axisLabel.margin,u=this.option.axisLabel.clickable,a=this.option.axisLabel.textStyle,f;if(this.isHorizontal()){var l,c;this.option.position=="bottom"?(l=this.grid.getYend()+s,c="top"):(l=this.grid.getY()-s,c="bottom");for(var h=0;h0?this.option.position=="bottom"?"right":"left":this.option.position=="bottom"?"left":"right",e.rotation=[i*Math.PI/180,e.style.x,e.style.y]),this.shapeList.push(new n(this._axisLabelClickable(u,e)))}}else{var p,d;this.option.position=="left"?(p=this.grid.getX()-s,d="right"):(p=this.grid.getXend()+s,d="left");for(var h=0;h1?e-1:1)},getCoord:function(e){var t=this.option.data,n=t.length,r=this.getGap(),i=this.option.boundaryGap?r/2:0;for(var s=0;sthis.option.data.length-1)return this.isHorizontal()?this.grid.getXend():this.grid.getY();var t=this.getGap(),n=this.option.boundaryGap?t/2:0;return n+=e*t,this.isHorizontal()?n=this.grid.getX()+n:n=this.grid.getYend()-n,n},getNameByIndex:function(e){var t=this.option.data[e];return typeof t!="undefined"&&typeof t.value!="undefined"?t.value:t},getIndexByName:function(e){var t=this.option.data,n=t.length;for(var r=0;r0?this.option.position==="bottom"?"right":"left":this.option.position==="bottom"?"left":"right",e.rotation=[i*Math.PI/180,e.style.x,e.style.y]),this.shapeList.push(new n(this._axisLabelClickable(o,e)))}else{var c,h;this.option.position==="left"?(c=this.grid.getX()-s,h="right"):(c=this.grid.getXend()+s,h="left");for(var l=0;l=0?t[h][l]!=null?t[h][l]+=n:t[h][l]=n:t[p][l]!=null?t[p][l]+=n:t[p][l]=n,this.option.scale&&t[f].push(n)}}}for(var u in t){e=t[u];for(var l=0,c=e.length;l0?this.option.power:1:this._max>0?this._min=this._max/this.option.splitNumber:this._max=this._max/this.option.splitNumber),this._reformValue(this.option.scale)}else this._hasData=!0,this._min=this.option.min-0,this._max=this.option.max-0,this._customerValue()},_reformValue:function(e){var t=this.option.splitNumber,n=this.option.precision,r,i;n===0?i=this.option.power>1?this.option.power:1:(i=Math.pow(10,n),this._min*=i,this._max*=i,i=this.option.power);var s;if(this._min>=0&&this._max>=0){if(!e){while(this._max/i1?i/10:1,s=this._max-this._min,r=Math.ceil(s/t/i)*i,this._max=this._min+r*t}else if(this._min<=0&&this._max<=0){i=-i;if(!e){while(this._min/ii&&i!=-1)i/=10;n===0&&(this._min=Math.ceil(this._min/i)*i,this._max=Math.floor(this._max/i)*i)}i=i<-1?i/10:-1,s=this._min-this._max,r=-Math.ceil(s/t/i)*i,this._min=-r*t+this._max}else{s=this._max-this._min;while(s/ithis._max?this._max:e;var t;return this.isHorizontal()?t=this.grid.getX()+(e-this._min)/(this._max-this._min)*this.grid.getWidth():t=this.grid.getYend()-(e-this._min)/(this._max-this._min)*this.grid.getHeight(),t},getCoordSize:function(e){return this.isHorizontal()?Math.abs(e/(this._max-this._min)*this.grid.getWidth()):Math.abs(e/(this._max-this._min)*this.grid.getHeight())},getValueFromCoord:function(e){var t;return this.isHorizontal()?(e=ethis.grid.getXend()?this.grid.getXend():e,t=this._min+(e-this.grid.getX())/this.grid.getWidth()*(this._max-this._min)):(e=ethis.grid.getYend()?this.grid.getYend():e,t=this._max-(e-this.grid.getY())/this.grid.getHeight()*(this._max-this._min)),t.toFixed(2)-0}},o.inherits(u,t),e("../component").define("valueAxis",u),u}),define("echarts/component/axis",["require","./base","zrender/shape/Line","../config","../util/ecData","zrender/tool/util","zrender/tool/color","./categoryAxis","./valueAxis","../component"],function(e){function u(e,n,r,i,s,o){t.call(this,e,n,r,i,s),this.axisType=o,this._axisList=[],this.refresh(i)}var t=e("./base"),n=e("zrender/shape/Line"),r=e("../config"),i=e("../util/ecData"),s=e("zrender/tool/util"),o=e("zrender/tool/color");return u.prototype={type:r.COMPONENT_TYPE_AXIS,axisBase:{_buildAxisLine:function(){var e=this.option.axisLine.lineStyle.width,t=e/2,r={_axisShape:"axisLine",zlevel:this._zlevelBase+1,hoverable:!1};switch(this.option.position){case"left":r.style={xStart:this.grid.getX()-t,yStart:this.grid.getYend(),xEnd:this.grid.getX()-t,yEnd:this.grid.getY(),lineCap:"round"};break;case"right":r.style={xStart:this.grid.getXend()+t,yStart:this.grid.getYend(),xEnd:this.grid.getXend()+t,yEnd:this.grid.getY(),lineCap:"round"};break;case"bottom":r.style={xStart:this.grid.getX(),yStart:this.grid.getYend()+t,xEnd:this.grid.getXend(),yEnd:this.grid.getYend()+t,lineCap:"round"};break;case"top":r.style={xStart:this.grid.getX(),yStart:this.grid.getY()-t,xEnd:this.grid.getXend(),yEnd:this.grid.getY()-t,lineCap:"round"}}this.option.name!==""&&(r.style.text=this.option.name,r.style.textPosition=this.option.nameLocation,r.style.textFont=this.getFont(this.option.nameTextStyle),this.option.nameTextStyle.align&&(r.style.textAlign=this.option.nameTextStyle.align),this.option.nameTextStyle.baseline&&(r.style.textBaseline=this.option.nameTextStyle.baseline),this.option.nameTextStyle.color&&(r.style.textColor=this.option.nameTextStyle.color)),r.style.strokeColor=this.option.axisLine.lineStyle.color,r.style.lineWidth=e,this.isHorizontal()?r.style.yStart=r.style.yEnd=this.subPixelOptimize(r.style.yEnd,e):r.style.xStart=r.style.xEnd=this.subPixelOptimize(r.style.xEnd,e),r.style.lineType=this.option.axisLine.lineStyle.type,r=new n(r),this.shapeList.push(r)},_axisLabelClickable:function(e,t){return e?(i.pack(t,undefined,-1,undefined,-1,t.style.text),t.hoverable=!0,t.clickable=!0,t.highlightStyle={color:o.lift(t.style.color,1),brushType:"fill"},t):t},refixAxisShape:function(e,t){if(!this.option.axisLine.onZero)return;var n;if(this.isHorizontal()&&t!=null)for(var r=0,i=this.shapeList.length;r2&&(e=[e[0],e[1]]);if(this.axisType==="xAxis"){if(!e[0].position||e[0].position!="bottom"&&e[0].position!="top")e[0].position="bottom";e.length>1&&(e[1].position=e[0].position==="bottom"?"top":"bottom");for(var t=0,n=e.length;t1&&(e[1].position=e[0].position==="left"?"right":"left");for(var t=0,n=e.length;t=0&&(o.isHorizontal()?t=o.getCoord(0):n=o.getCoord(0));if(typeof t!="undefined"||typeof n!="undefined"){s=i.length;while(s--)i[s].refixAxisShape(t,n)}},refresh:function(e){if(e||this._zrWidth!=this.zr.getWidth()||this._zrHeight!=this.zr.getHeight()){this.clear(),this.option=e||this.option,this.option.grid=this.reformOption(this.option.grid);var t=this.option.grid;this._zrWidth=this.zr.getWidth(),this._zrHeight=this.zr.getHeight(),this._x=this.parsePercent(t.x,this._zrWidth),this._y=this.parsePercent(t.y,this._zrHeight);var r=this.parsePercent(t.x2,this._zrWidth),i=this.parsePercent(t.y2,this._zrHeight);typeof t.width=="undefined"?this._width=this._zrWidth-this._x-r:this._width=this.parsePercent(t.width,this._zrWidth),this._width=this._width<=0?10:this._width,typeof t.height=="undefined"?this._height=this._zrHeight-this._y-i:this._height=this.parsePercent(t.height,this._zrHeight),this._height=this._height<=0?10:this._height,this._x=this.subPixelOptimize(this._x,t.borderWidth),this._y=this.subPixelOptimize(this._y,t.borderWidth),this.shapeList.push(new n({zlevel:this._zlevelBase,hoverable:!1,style:{x:this._x,y:this._y,width:this._width,height:this._height,brushType:t.borderWidth>0?"both":"fill",color:t.backgroundColor,strokeColor:t.borderColor,lineWidth:t.borderWidth}})),this.zr.addShape(this.shapeList[0])}}},i.inherits(s,t),e("../component").define("grid",s),s}),define("echarts/component/dataZoom",["require","./base","zrender/shape/Rectangle","zrender/shape/Polygon","../util/shape/Icon","../config","zrender/tool/util","../component","../component"],function(e){function u(e,n,r,i,s){t.call(this,e,n,r,i,s);var o=this;o._ondrift=function(e,t){return o.__ondrift(this,e,t)},o._ondragend=function(){return o.__ondragend()},this._fillerSize=28,this._handleSize=8,this._isSilence=!1,this._zoom={},this.option.dataZoom=this.reformOption(this.option.dataZoom),this.zoomOption=this.option.dataZoom,this._location=this._getLocation(),this._zoom=this._getZoom(),this._backupData(),this.option.dataZoom.show&&this._buildShape(),this._syncData()}var t=e("./base"),n=e("zrender/shape/Rectangle"),r=e("zrender/shape/Polygon"),i=e("../util/shape/Icon"),s=e("../config"),o=e("zrender/tool/util");return u.prototype={type:s.COMPONENT_TYPE_DATAZOOM,_buildShape:function(){this._buildBackground(),this._buildFiller(),this._buildHandle(),this._buildFrame();for(var e=0,t=this.shapeList.length;ep&&(h+=p,p=h-p,h-=p);var d=Math.round((p-h)/100*(this.zoomOption.orient=="horizontal"?this._location.width:this._location.height));return{start:h,end:p,start2:0,end2:100,size:d,xAxisIndex:i,yAxisIndex:o,seriesIndex:r,scatterMap:this._zoom.scatterMap||{}}},_backupData:function(){this._originalData={xAxis:{},yAxis:{},series:{}};var e=this.option.xAxis,t=this._zoom.xAxisIndex;for(var n=0,r=t.length;n1?1:0)),w=t/(i-(i>1?1:0)),E=1;this.zoomOption.orient=="horizontal"&&b<1?E=Math.floor(i*3/e):this.zoomOption.orient=="vertical"&&w<1&&(E=Math.floor(i*3/t));for(var a=0,f=i;athis._location.x?1:0),height:this._location.height-(t>this._location.y?1:0),lineWidth:1,brushType:"stroke",strokeColor:this.zoomOption.handleColor}},this._endFrameShape=o.clone(this._startFrameShape),this._startFrameShape=new n(this._startFrameShape),this._endFrameShape=new n(this._endFrameShape),this.shapeList.push(this._startFrameShape),this.shapeList.push(this._endFrameShape);return},_syncHandleShape:function(){this.zoomOption.orient=="horizontal"?(this._startShape.style.x=this._fillerShae.style.x-this._handleSize,this._endShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._zoom.start=Math.floor((this._startShape.style.x-this._location.x)/this._location.width*100),this._zoom.end=Math.ceil((this._endShape.style.x+this._handleSize-this._location.x)/this._location.width*100)):(this._startShape.style.y=this._fillerShae.style.y-this._handleSize,this._endShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._zoom.start=Math.floor((this._startShape.style.y-this._location.y)/this._location.height*100),this._zoom.end=Math.ceil((this._endShape.style.y+this._handleSize-this._location.y)/this._location.height*100)),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this._syncFrameShape(),this.zr.refresh()},_syncFillerShape:function(){var e,t;this.zoomOption.orient=="horizontal"?(e=this._startShape.style.x,t=this._endShape.style.x,this._fillerShae.style.x=Math.min(e,t)+this._handleSize,this._fillerShae.style.width=Math.abs(e-t)-this._handleSize,this._zoom.start=Math.floor((Math.min(e,t)-this._location.x)/this._location.width*100),this._zoom.end=Math.ceil((Math.max(e,t)+this._handleSize-this._location.x)/this._location.width*100)):(e=this._startShape.style.y,t=this._endShape.style.y,this._fillerShae.style.y=Math.min(e,t)+this._handleSize,this._fillerShae.style.height=Math.abs(e-t)-this._handleSize,this._zoom.start=Math.floor((Math.min(e,t)-this._location.y)/this._location.height*100),this._zoom.end=Math.ceil((Math.max(e,t)+this._handleSize-this._location.y)/this._location.height*100)),this.zr.modShape(this._fillerShae.id),this._syncFrameShape(),this.zr.refresh()},_syncFrameShape:function(){this.zoomOption.orient=="horizontal"?(this._startFrameShape.style.width=this._fillerShae.style.x-this._location.x,this._endFrameShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._endFrameShape.style.width=this._location.x+this._location.width-this._endFrameShape.style.x):(this._startFrameShape.style.height=this._fillerShae.style.y-this._location.y,this._endFrameShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._endFrameShape.style.height=this._location.y+this._location.height-this._endFrameShape.style.y),this.zr.modShape(this._startFrameShape.id),this.zr.modShape(this._endFrameShape.id)},_syncShape:function(){if(!this.zoomOption.show)return;this.zoomOption.orient=="horizontal"?(this._startShape.style.x=this._location.x+this._zoom.start/100*this._location.width,this._endShape.style.x=this._location.x+this._zoom.end/100*this._location.width-this._handleSize,this._fillerShae.style.x=this._startShape.style.x+this._handleSize,this._fillerShae.style.width=this._endShape.style.x-this._startShape.style.x-this._handleSize):(this._startShape.style.y=this._location.y+this._zoom.start/100*this._location.height,this._endShape.style.y=this._location.y+this._zoom.end/100*this._location.height-this._handleSize,this._fillerShae.style.y=this._startShape.style.y+this._handleSize,this._fillerShae.style.height=this._endShape.style.y-this._startShape.style.y-this._handleSize),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this.zr.modShape(this._fillerShae.id),this._syncFrameShape(),this.zr.refresh()},_syncData:function(e){var t,n,r,i,o;for(var u in this._originalData){t=this._originalData[u];for(var a in t){o=t[a];if(typeof o=="undefined")continue;i=o.length,n=Math.floor(this._zoom.start/100*i),r=Math.ceil(this._zoom.end/100*i),this.option[u][a].type!=s.CHART_TYPE_SCATTER?this.option[u][a].data=o.slice(n,r):this.option[u][a].data=this._synScatterData(a,o)}}!this._isSilence&&(this.zoomOption.realtime||e)&&this.messageCenter.dispatch(s.EVENT.DATA_ZOOM,null,{zoom:this._zoom},this.myChart)},_synScatterData:function(e,t){if(this._zoom.start===0&&this._zoom.end==100&&this._zoom.start2===0&&this._zoom.end2==100)return t;var n=[],r=this._zoom.scatterMap[e],i,s,o,u,a;this.zoomOption.orient=="horizontal"?(i=r.x.max-r.x.min,s=this._zoom.start/100*i+r.x.min,o=this._zoom.end/100*i+r.x.min,i=r.y.max-r.y.min,u=this._zoom.start2/100*i+r.y.min,a=this._zoom.end2/100*i+r.y.min):(i=r.x.max-r.x.min,s=this._zoom.start2/100*i+r.x.min,o=this._zoom.end2/100*i+r.x.min,i=r.y.max-r.y.min,u=this._zoom.start/100*i+r.y.min,a=this._zoom.end/100*i+r.y.min);var f;for(var l=0,c=t.length;l=s&&f[0]<=o&&f[1]>=u&&f[1]<=a&&n.push(t[l]);return n},__ondrift:function(e,t,n){this.zoomOption.zoomLock&&(e=this._fillerShae);var r=e._type=="filler"?this._handleSize:0;return this.zoomOption.orient=="horizontal"?e.style.x+t-r<=this._location.x?e.style.x=this._location.x+r:e.style.x+t+e.style.width+r>=this._location.x+this._location.width?e.style.x=this._location.x+this._location.width-e.style.width-r:e.style.x+=t:e.style.y+n-r<=this._location.y?e.style.y=this._location.y+r:e.style.y+n+e.style.height+r>=this._location.y+this._location.height?e.style.y=this._location.y+this._location.height-e.style.height-r:e.style.y+=n,e._type=="filler"?this._syncHandleShape():this._syncFillerShape(),this.zoomOption.realtime&&this._syncData(),!0},__ondragend:function(){this.isDragend=!0},ondragend:function(e,t){if(!this.isDragend||!e.target)return;!this.zoomOption.realtime&&this._syncData(),t.dragOut=!0,t.dragIn=!0,!this._isSilence&&!this.zoomOption.realtime&&this.messageCenter.dispatch(s.EVENT.DATA_ZOOM,null,{zoom:this._zoom},this.myChart),t.needRefresh=!1,this.isDragend=!1;return},ondataZoom:function(e,t){t.needRefresh=!0;return},absoluteZoom:function(e){this._zoom.start=e.start,this._zoom.end=e.end,this._zoom.start2=e.start2,this._zoom.end2=e.end2,this._syncShape(),this._syncData(!0);return},rectZoom:function(e){if(!e)return this._zoom.start=this._zoom.start2=0,this._zoom.end=this._zoom.end2=100,this._syncShape(),this._syncData(!0),this._zoom;var t=this.component.grid.getArea(),n={x:e.x,y:e.y,width:e.width,height:e.height};n.width<0&&(n.x+=n.width,n.width=-n.width),n.height<0&&(n.y+=n.height,n.height=-n.height);if(n.x>t.x+t.width||n.y>t.y+t.height)return!1;n.xt.x+t.width&&(n.width=t.x+t.width-n.x),n.y+n.height>t.y+t.height&&(n.height=t.y+t.height-n.y);var r,i=(n.x-t.x)/t.width,s=1-(n.x+n.width-t.x)/t.width,o=1-(n.y+n.height-t.y)/t.height,u=(n.y-t.y)/t.height;return this.zoomOption.orient=="horizontal"?(r=this._zoom.end-this._zoom.start,this._zoom.start+=r*i,this._zoom.end-=r*s,r=this._zoom.end2-this._zoom.start2,this._zoom.start2+=r*o,this._zoom.end2-=r*u):(r=this._zoom.end-this._zoom.start,this._zoom.start+=r*o,this._zoom.end-=r*u,r=this._zoom.end2-this._zoom.start2,this._zoom.start2+=r*i,this._zoom.end2-=r*s),this._syncShape(),this._syncData(!0),this._zoom},syncBackupData:function(e){var t,n=this._originalData.series,r=e.series,i;for(var s=0,o=r.length;s=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height?!0:!1}},r.inherits(i,t),i}),define("echarts/component/dataRange",["require","./base","zrender/shape/Text","zrender/shape/Rectangle","../util/shape/HandlePolygon","../config","zrender/tool/util","zrender/tool/area","zrender/tool/color","zrender/tool/color","../component"],function(e){function f(e,n,r,i,s){if(typeof this.query(i,"dataRange.min")=="undefined"||typeof this.query(i,"dataRange.max")=="undefined"){console.error("option.dataRange.min or option.dataRange.max has not been defined.");return}t.call(this,e,n,r,i,s);var o=this;o._ondrift=function(e,t){return o.__ondrift(this,e,t)},o._ondragend=function(){return o.__ondragend()},o._dataRangeSelected=function(e){return o.__dataRangeSelected(e)},this._selectedMap={},this._range={},this.refresh(i)}var t=e("./base"),n=e("zrender/shape/Text"),r=e("zrender/shape/Rectangle"),i=e("../util/shape/HandlePolygon"),s=e("../config"),o=e("zrender/tool/util"),u=e("zrender/tool/area"),a=e("zrender/tool/color");return f.prototype={type:s.COMPONENT_TYPE_DATARANGE,_textGap:10,_buildShape:function(){this._itemGroupLocation=this._getItemGroupLocation(),this._buildBackground(),this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable?this._buildGradient():this._buildItem();for(var e=0,t=this.shapeList.length;ep&&(h-=m)):(dv&&(d-=f))}return{x:h,y:d,width:s,height:o}},_getTextShape:function(e,t,n){return{zlevel:this._zlevelBase,style:{x:this.dataRangeOption.orient=="horizontal"?e:this._itemGroupLocation.x+this._itemGroupLocation.width/2,y:this.dataRangeOption.orient=="horizontal"?this._itemGroupLocation.y+this._itemGroupLocation.height/2:t,color:this.dataRangeOption.textStyle.color,text:n,textFont:this.getFont(this.dataRangeOption.textStyle),textBaseline:this.dataRangeOption.orient=="horizontal"?"middle":"top",textAlign:this.dataRangeOption.orient=="horizontal"?"left":"center"},hoverable:!1}},_getItemShape:function(e,t,n,r,i){return{zlevel:this._zlevelBase,style:{x:e,y:t+1,width:n,height:r-2,color:i},highlightStyle:{strokeColor:i,lineWidth:1},clickable:!0}},__ondrift:function(e,t,n){var r=this._calculableLocation.x,i=this._calculableLocation.y,s=this._calculableLocation.width,o=this._calculableLocation.height;return this.dataRangeOption.orient=="horizontal"?e.style.x+t<=r?e.style.x=r:e.style.x+t+e.style.width>=r+s?e.style.x=r+s-e.style.width:e.style.x+=t:e.style.y+n<=i?e.style.y=i:e.style.y+n+e.style.height>=i+o?e.style.y=i+o-e.style.height:e.style.y+=n,e._type=="filler"?this._syncHandleShape():this._syncFillerShape(e),this.dataRangeOption.realtime&&this._syncData(),!0},__ondragend:function(){this.isDragend=!0},ondragend:function(e,t){if(!this.isDragend||!e.target)return;!this.dataRangeOption.realtime&&this._syncData(),t.dragOut=!0,t.dragIn=!0,!this.dataRangeOption.realtime&&!1&&this.messageCenter.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:this._range.end,end:this._range.start}},this.myChart),t.needRefresh=!1,this.isDragend=!1;return},_syncShapeFromRange:function(){var e=this.dataRangeOption.range||{};this._range.end=typeof this._range.end!="undefined"?this._range.end:typeof e.start!="undefined"?e.start:0,this._range.start=typeof this._range.start!="undefined"?this._range.start:typeof e.end!="undefined"?e.end:100;if(this._range.start!=100||this._range.end!==0){if(this.dataRangeOption.orient=="horizontal"){var t=this._fillerShae.style.width;this._fillerShae.style.x+=t*(100-this._range.start)/100,this._fillerShae.style.width=t*(this._range.start-this._range.end)/100}else{var n=this._fillerShae.style.height;this._fillerShae.style.y+=n*(100-this._range.start)/100,this._fillerShae.style.height=n*(this._range.start-this._range.end)/100}this.zr.modShape(this._fillerShae.id),this._syncHandleShape()}},_syncHandleShape:function(){var e=this._calculableLocation.x,t=this._calculableLocation.y,n=this._calculableLocation.width,r=this._calculableLocation.height;this.dataRangeOption.orient=="horizontal"?(this._startShape.style.x=this._fillerShae.style.x,this._startMask.style.width=this._startShape.style.x-e,this._endShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._endMask.style.x=this._endShape.style.x,this._endMask.style.width=e+n-this._endShape.style.x,this._range.start=Math.ceil(100-(this._startShape.style.x-e)/n*100),this._range.end=Math.floor(100-(this._endShape.style.x-e)/n*100)):(this._startShape.style.y=this._fillerShae.style.y,this._startMask.style.height=this._startShape.style.y-t,this._endShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._endMask.style.y=this._endShape.style.y,this._endMask.style.height=t+r-this._endShape.style.y,this._range.start=Math.ceil(100-(this._startShape.style.y-t)/r*100),this._range.end=Math.floor(100-(this._endShape.style.y-t)/r*100)),this._syncShape()},_syncFillerShape:function(e){var t=this._calculableLocation.x,n=this._calculableLocation.y,r=this._calculableLocation.width,i=this._calculableLocation.height,s,o;this.dataRangeOption.orient=="horizontal"?(s=this._startShape.style.x,o=this._endShape.style.x,e.id==this._startShape.id&&s>=o?(o=s,this._endShape.style.x=s):e.id==this._endShape.id&&s>=o&&(s=o,this._startShape.style.x=s),this._fillerShae.style.x=s,this._fillerShae.style.width=o-s,this._startMask.style.width=s-t,this._endMask.style.x=o,this._endMask.style.width=t+r-o,this._range.start=Math.ceil(100-(s-t)/r*100),this._range.end=Math.floor(100-(o-t)/r*100)):(s=this._startShape.style.y,o=this._endShape.style.y,e.id==this._startShape.id&&s>=o?(o=s,this._endShape.style.y=s):e.id==this._endShape.id&&s>=o&&(s=o,this._startShape.style.y=s),this._fillerShae.style.y=s,this._fillerShae.style.height=o-s,this._startMask.style.height=s-n,this._endMask.style.y=o,this._endMask.style.height=n+i-o,this._range.start=Math.ceil(100-(s-n)/i*100),this._range.end=Math.floor(100-(o-n)/i*100)),this._syncShape()},_syncShape:function(){this._startShape.position=[this._startShape.style.x-this._startShape.style._x,this._startShape.style.y-this._startShape.style._y],this._startShape.style.text=this._textFormat(this._gap*this._range.start+this.dataRangeOption.min),this._startShape.style.color=this._startShape.highlightStyle.strokeColor=this.getColor(this._gap*this._range.start+this.dataRangeOption.min),this._endShape.position=[this._endShape.style.x-this._endShape.style._x,this._endShape.style.y-this._endShape.style._y],this._endShape.style.text=this._textFormat(this._gap*this._range.end+this.dataRangeOption.min),this._endShape.style.color=this._endShape.highlightStyle.strokeColor=this.getColor(this._gap*this._range.end+this.dataRangeOption.min),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this.zr.modShape(this._startMask.id),this.zr.modShape(this._endMask.id),this.zr.modShape(this._fillerShae.id),this.zr.refresh()},_syncData:function(){this.dataRangeOption.realtime&&this.messageCenter.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:this._range.end,end:this._range.start}},this.myChart)},__dataRangeSelected:function(e){var t=e.target._idx;this._selectedMap[t]=!this._selectedMap[t],this.messageCenter.dispatch(s.EVENT.REFRESH,null,null,this.myChart)},_textFormat:function(e,t){e=e.toFixed(this.dataRangeOption.precision),t=typeof t!="undefined"?t.toFixed(this.dataRangeOption.precision):"";if(this.dataRangeOption.formatter){if(typeof this.dataRangeOption.formatter=="string")return this.dataRangeOption.formatter.replace("{value}",e).replace("{value2}",t);if(typeof this.dataRangeOption.formatter=="function")return this.dataRangeOption.formatter.call(this.myChart,e,t)}return t!==""?e+" - "+t:e},refresh:function(e){if(e){this.option=e,this.option.dataRange=this.reformOption(this.option.dataRange),this.option.dataRange.padding=this.reformCssArray(this.option.dataRange.padding),this.dataRangeOption=this.option.dataRange;var t=this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable?100:this.dataRangeOption.splitNumber;this._colorList=a.getGradientColors(this.dataRangeOption.color,Math.max((t-this.dataRangeOption.color.length)/(this.dataRangeOption.color.length-1),0)+1);if(this._colorList.length>t){var n=this._colorList.length,r=[this._colorList[0]],i=n/(t-1);for(var s=1;sthis.dataRangeOption.max&&(e=this.dataRangeOption.max);if(this.dataRangeOption.calculable)if(e-(this._gap*this._range.start+this.dataRangeOption.min)>5e-5||e-(this._gap*this._range.end+this.dataRangeOption.min)<-0.00005)return null;var t=this._colorList.length-Math.ceil((e-this.dataRangeOption.min)/(this.dataRangeOption.max-this.dataRangeOption.min)*this._colorList.length);return t==this._colorList.length&&t--,this._selectedMap[t]?this._colorList[t]:null}},o.inherits(f,t),e("../component").define("dataRange",f),f}),define("echarts/chart/scatter",["require","../component/base","./base","../util/shape/Symbol","../component/axis","../component/grid","../component/dataZoom","../component/dataRange","../config","zrender/tool/util","zrender/tool/color","../chart"],function(e){function u(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this),this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("../util/shape/Symbol");e("../component/axis"),e("../component/grid"),e("../component/dataZoom"),e("../component/dataRange");var i=e("../config"),s=e("zrender/tool/util"),o=e("zrender/tool/color");return u.prototype={type:i.CHART_TYPE_SCATTER,_buildShape:function(){var e=this.series;this._sIndex2ColorMap={},this._symbol=this.option.symbolList,this._sIndex2ShapeMap={},this.selectedMap={},this.xMarkMap={};var t=this.component.legend,n=[],r,s,u,a;for(var f=0,l=e.length;fs[0]&&(i.min0=s[0],i.minY0=r[o][1],i.minX0=r[o][0]),i.max0s[1]&&(i.min1=s[1],i.minY1=r[o][1],i.minX1=r[o][0]),i.max1n.largeThreshold){this.shapeList.push(this._getLargeSymbol(r,this.getItemStyleColor(this.query(n,"itemStyle.normal.color"),o,-1)||this._sIndex2ColorMap[o]));continue}for(var u=0,a=r.length;u0&&this._buildSinglePosition(o,t[o]);this.addShapeList()},_buildSinglePosition:function(e,t){var n=this._mapData(t),r=n.locationMap,i=n.maxDataLength;if(i===0||r.length===0)return;this._buildHorizontal(t,i,r);for(var s=0,o=t.length;s0?a="left":Math.round(i[0])<0?a="right":a="center",f.margin?(p=f.margin,c=i[0]>0?p:-p,h=i[1]>0?p:-p,c=i[0]===0?0:c,h=i[1]===0?0:h,i=this._mapVector(i,o,1)):i=this._mapVector(i,o,1.2),u.textAlign=a,u.x=i[0]+c,u.y=i[1]+h,f.rotate?l=[f.rotate/180*Math.PI,i[0],i[1]]:l=[0,0,0],this.shapeList.push(new n({zlevel:this._zlevelBase,style:u,draggable:!1,hoverable:!1,rotation:l}))}},getIndicatorText:function(e,t){return this.polar[e]&&this.polar[e].__ecIndicator[t]&&this.polar[e].__ecIndicator[t].text},getDropBox:function(e){var e=e||0,t=this.polar[e],n=this.getCenter(e),r=t.__ecIndicator,i=r.length,s=[],o,u,a=t.type;if(a=="polygon"){for(var f=0;fu||u===undefined)&&(u=e),(e=1)a=Math.floor(a/l)*l-l;else{if(l===0)return u>0?(d=0,p=2*u):u===0?(d=0,p=100):(p=0,d=2*a),{max:p,min:d};c=(l+"").split(".")[1],h=c.length,a=Math.floor(a*Math.pow(10,h))/Math.pow(10,h)-l}Math.abs(a)<=l&&(a=0),u=a+Math.floor(l*Math.pow(10,h)*(n+1))/Math.pow(10,h)}else a=a>0?0:a;return r&&(u=u>0?u*1.2:u*.8,a=a>0?a*.8:a*1.2),{max:u,min:a}},_getDelta:function(e,t,n,r,i){var s=(e-t)/n,o,u;if(s>1)return i?(s=Math.ceil(s),s%i>0?(Math.ceil(s/i)+1)*i:s):(o=(s+"").split(".")[0],u=o.length,o.charAt(0)>=5?Math.pow(10,u):(o.charAt(0)-0+1)*Math.pow(10,u-1));if(s==1)return 1;if(s===0)return 0;if(!r){o=(s+"").split(".")[1],u=0;while(o[u]=="0")u++;return o[u]>=5?"0."+o.substring(0,u+1)-0+1/Math.pow(10,u):"0."+o.substring(0,u+1)-0+1/Math.pow(10,u+1)}return Math.ceil(s*Math.pow(10,r))/Math.pow(10,r)},getVector:function(e,t,n){e=e||0,t=t||0;var r=this.polar[e].__ecIndicator;if(t>=r.length)return;var i=this.polar[e].__ecIndicator[t],s=this.getCenter(e),o=i.vector,u=i.value.max,a=i.value.min,f;if(typeof n=="undefined")return s;switch(n){case"min":n=a;break;case"max":n=u;break;case"center":n=(u+a)/2}return u!=a?f=(n-a)/(u-a):f=.5,this._mapVector(o,s,f)},isInside:function(e){var t=this.getNearestIndex(e);return t?t.polarIndex:-1},getNearestIndex:function(e){var t,n,r,i,s,o,u,a,l;for(var c=0;ci[0])return{polarIndex:c,valueIndex:Math.floor((l+a/2)/a)%u}}},getIndicator:function(e){var e=e||0;return this.polar[e].indicator},refresh:function(e){e&&(this.option=e,this.polar=this.option.polar,this.series=this.option.series),this.clear(),this._buildShape()}},a.inherits(l,t),e("../component").define("polar",l),l}),define("echarts/chart/radar",["require","../component/base","./base","zrender/shape/Polygon","../component/polar","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../util/accMath","../chart"],function(e){function a(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this),this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("zrender/shape/Polygon");e("../component/polar");var i=e("../config"),s=e("../util/ecData"),o=e("zrender/tool/util"),u=e("zrender/tool/color");return a.prototype={type:i.CHART_TYPE_RADAR,_buildShape:function(){this.selectedMap={},this._symbol=this.option.symbolList,this._queryTarget,this._dropBoxList=[],this._radarDataCounter=0;var e=this.series,t=this.component.legend,n;for(var r=0,s=e.length;r=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height)return i.isInsidePath(this._pathProxy.pathCommands,0,"fill",e,t)}},r.inherits(s,t),s}),define("echarts/util/kwargs",[],function(){function e(e,t){var n=new RegExp("(\\/\\*[\\w\\'\\,\\(\\)\\s\\r\\n\\*]*\\*\\/)|(\\/\\/[\\w\\s\\'][^\\n\\r]*$)|(\\/]*>)","gim"),r=new RegExp("\\s+","gim"),i=new RegExp("function.*?\\((.*?)\\)","i"),s=e.toString().replace(n,"").replace(r,"").match(i)[1].split(",");return t!==Object(t)&&(t={}),function(){var n=Array.prototype.slice.call(arguments),r=n[n.length-1];r&&r.constructor===Object?n.pop():r={};for(var i=0;i=0){var n=e.split(/\s*:\s*/),r=parseInt(n[2]||1,10),i,s;if(r===0)throw new Error("Slice step cannot be zero");return r>0?(i=parseInt(n[0]||0,10),s=parseInt(n[1]||t,10)):(i=parseInt(n[0]||t-1,10),s=parseInt(n[1]||-1,10)),i<0&&(i=t+i),s<0&&n[1]&&(s=t+s),r>0?(i=Math.max(Math.min(t,i),0),s=Math.max(Math.min(t,s),0)):(i=Math.max(Math.min(t-1,i),-1),s=Math.max(Math.min(t-1,s),-1)),[i,s,r]}var i=parseInt(e,10);i<0&&(i=t+i);if(i<0||i>t)throw new Error(N(e));return i=Math.max(Math.min(t-1,i),0),[i,i+1,1]}function g(e){var t=e[0];for(var n=1;n=this._shape.length)throw new Error(T(e[r]));if(e.length<=1)return this;var i=n.slice();for(var r=0;r=Math.ceil(e.length/2);s--)i[e[r]]=e[s],i[e[s]]=e[r];return this._transposelike(i,t)}),swapaxes:t(function(e,t,n){return this.transpose([e,t],n)}),rollaxis:t(function(e,t,n){if(e>=this._shape.length)throw new Error(T(e));var r=[];for(var i=0;i=this._shape.length||e<0)throw new Error(T(e));var s=this._shape.slice();s.splice(e,1);if(t&&!S(s,t._shape))throw new Error(x(s,t._shape));t||(t=new v(this._dtype),t.initFromShape(s));var o=t._array,u=w(this._shape,e),a=this._shape[e],f=u*a;return n.call(this,o,i,f,a,u),t}return r.call(this,i)},_withPreprocess2:function(e,t,n,r){var i=this._array;if(!this._size)return;if(t&&!S(this._shape,t._shape))throw new Error(x(this._shape,t._shape));t||(t=new v(this._dtype),t.initFromShape(this._shape));var s=t._array;if(typeof e!="undefined"){e<0&&(e=this._shape.length+e);if(e>=this._shape.length||e<0)throw new Error(T(e));if(e>=this._shape.length)throw new Error(T(e));var o=w(this._shape,e),u=this._shape[e],a=o*u;n.call(this,s,i,a,u,o)}else t.reshape([this._size]),r.call(this,s,i);return t},max:t(function(){function e(e,t,n,r,i){var s=0;for(var o=0;of&&(f=c),a+=i}e[s++]=f}}function t(e){var t=e[0];for(var n=1;nt&&(t=e[n]);return t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}()),min:t(function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h,a=c),f+=i}e[s++]=a}}function t(e){var t=e[0],n=0;for(var r=1;rt&&(n=r,t=e[r]);return n}return function(n,r){return this._withPreprocess1(n,r,e,t)}}()),argmin:t(function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h),a+=i}e[s++]=l-f}}function t(e){var t=e[0],n=e[0];for(var r=1;rn&&(n=e[r]);return n-t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}()),sort:t(function(e,t){e<0&&(e=this._shape.length+e);var n;t==="ascending"?n=function(e,t){return e-t}:t==="descending"&&(n=function(e,t){return t-e});var r=this._array,i=w(this._shape,e),s=this._shape[e],o=i*s,u=new Array(s);for(var a=0;as&&(s=a)}var f=s-i,l=t-e;for(var u=0;u=0&&y>=0){if(e._shape[g]==1)i.unshift(t._shape[y]),b=e.repeat(t._shape[y],g);else if(t._shape[y]==1)i.unshift(e._shape[g]),E=t.repeat(e._shape[g],y);else{if(t._shape[y]!=e._shape[g])throw new Error(x(e._shape,t._shape));i.unshift(e._shape[g])}g--,y--}for(var T=g;T>=0;T--)i.unshift(e._shape[T]);for(var T=y;T>=0;T--)i.unshift(t._shape[T]);e=b,t=E}if(!r)r=new v(this._dtype),r.initFromShape(i);else if(!S(i,r._shape))throw new Error(x(i,r._shape));var N=r._array,C,k,L,A;d?(C=t._shape.length-1,k=!1,L=e,A=t._array):m?(C=e._shape.length-1,k=!0,A=t,L=e._array):(C=Math.abs(e._shape.length-t._shape.length),k=e._shape.length>=t._shape.length,L=e._array,A=t._array);var O=w(i,C),M=i[C],_=O*M,D=r._size/_,P,H,B,j=0;if(k)if(m)for(var F=0;F0)for(var c=r[0];cr[1];c+=r[2])l(e+1,t+s*c);else if(r[2]>0)for(var c=r[0];cr[1];c+=r[2])for(var h=0;hthis._shape.length)throw new Error("Too many indices");var o=i.length,u;s.length?(t=new v(this._dtype),t.initFromShape(s),u=t._array):u=[];var a=this._array,f=0;return l(0,0),s.length?t:u[0]},set:function(e,t){typeof e=="number"&&(e=e.toString());var n=E(this._shape),r=this._parseRanges(e),i=r[0],s=r[1];if(i.length>this._shape.length)throw new Error("Too many indices");var o=typeof t=="number",u=i.length,a=this._array;if(o)var f=t;else{if(!S(s,t.shape()))throw new Error(x(s,t.shape()));var f=t._array}var l=0,c=function(e,t){var r=i[e],s=n[e];if(e0)for(var h=r[0];hr[1];h+=r[2])c(e+1,t+s*h);else if(r[2]>0)for(var h=r[0];hr[1];h+=r[2])for(var p=0;pu)throw new Error(N(e[a]));if(e[a]=0&&h>=0){if(l[c]===1)p=t.repeat(f[h],c);else if(l[c]!==f[h])throw new Error(x(l,f));c--,h--}t=p;var d=w(this._shape,n),u=this._shape[n],m=u*d,y=this._size/m,b=e.length,E=new Uint32Array(y*b),S=0;for(var T=0;T=0){for(var a=_-1;a>=D;a--)i[P--]=A[a];_=D,D=E[--M];for(var a=0;a=0;a--)i[P--]=A[a];return this._array=i,this._shape=k,this._size=L,this}),append:function(){console.warn("TODO")},"delete":t(function(e,t){var n=this._array;typeof e=="number"&&(e=[e]);var r=this._size;typeof t=="undefined"&&(this._shape=[r],t=0);var i=w(this._shape,t),s=this._shape[t],o=i*s,u=0;for(var a=0;as)throw new Error(N(l));if(l=0){var a=Math.floor((u[1]-u[0])/u[2]);a=a<0?0:a,r.push(a)}i++}for(;i0&&(E.style.brushType="both"),E.highlightStyle.lineWidth>0&&(E.highlightStyle.brushType="both"),a.pack(E,this.chordSeries[0],0,t[m],m,g.name);if(u){var S=[b+w]/2;S%=360;var x=S<=90||S>=270;S=S*Math.PI/180;var T=[Math.cos(S),-Math.sin(S)],N=this.showScaleText?35+h:h,C=l.scale([],T,this.outerRadius+N);l.add(C,C,this.center);var k={zlevel:this._zlevelBase-1,hoverable:!1,style:{text:g.name,textAlign:x?"left":"right",color:f}};c?(k.rotation=x?S:Math.PI+S,x?k.style.x=this.outerRadius+N:k.style.x=-this.outerRadius-N,k.style.y=0,k.position=this.center):(k.style.x=C[0],k.style.y=C[1]),k.style.textColor=this.deepQuery([g,this.chordSerieSample],"itemStyle.normal.label.textStyle.color")||"#fff",k.style.textFont=this.getFont(this.deepQuery([g,this.chordSerieSample],"itemStyle.normal.label.textStyle")),k=new r(k),this.shapeList.push(k)}E.onmouseover=d(m),E.onmouseout=v(),E=new s(E),this.shapeList.push(E),this.sectorShapes.push(E)}},_buildChords:function(e,t){var n=e.length;if(!n)return;var r=e[0][0].length,i=this.chordSerieSample.itemStyle.normal.chordStyle.lineStyle,s=this.chordSerieSample.itemStyle.emphasis.chordStyle.lineStyle;for(var u=0;u=270,E={zlevel:this._zlevelBase-1,hoverable:!1,style:{x:w?this.outerRadius+this.scaleLineLength+4:-this.outerRadius-this.scaleLineLength-4,y:0,text:Math.round(b.shift()*10)/10+t,textAlign:w?"left":"right"},position:this.center.slice(),rotation:w?[h/180*Math.PI,0,0]:[(h+180)/180*Math.PI,0,0]};E=new r(E),this.shapeList.push(E),g+=this.scaleUnitAngle*5}}},normalizeValue:function(e){var t=[],n=(new c(e)).max(),r,i;n>1e4?(r="k",i=.001):n>1e7?(r="m",i=1e-6):n>1e10?(r="b",i=1e-9):(r="",i=1);for(var s=0;s0&&(i=1/Math.sqrt(i),e[0]=t[0]*i,e[1]=t[1]*i),e},negate:function(e,t){return e[0]=-t[0],e[1]=-t[1],e},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e},set:function(e,t,n){return e[0]=t,e[1]=n,e}}:n=t("zrender/tool/vector");var i=typeof Float32Array=="undefined"?Array:Float32Array;s.prototype.beforeUpdate=function(){for(var e=0;e=e&&this.bbox[1]<=t&&this.bbox[3]>=t},s.prototype.setBBox=function(e,t,n,r){this.bbox[0]=e,this.bbox[1]=t,this.bbox[2]=n,this.bbox[3]=r,this.size=(n-e+r-t)/2},s.prototype._newSubRegion=function(){var e=this.subRegions[this.nSubRegions];return e||(e=new s,this.subRegions[this.nSubRegions]=e),this.nSubRegions++,e},s.prototype._addNodeToSubRegion=function(e){var t=this.findSubRegion(e.position[0],e.position[1]),n=this.bbox;if(!t){var r=(n[0]+n[2])/2,i=(n[1]+n[3])/2,s=(n[2]-n[0])/2,o=(n[3]-n[1])/2,u=e.position[0]>=r?1:0,a=e.position[1]>=i?1:0,t=this._newSubRegion();t.setBBox(u*s+n[0],a*o+n[1],(u+1)*s+n[0],(a+1)*o+n[1])}t.addNode(e)},s.prototype._updateCenterOfMass=function(e){this.centerOfMass==null&&(this.centerOfMass=n.create());var t=this.centerOfMass[0]*this.mass,r=this.centerOfMass[1]*this.mass;t+=e.position[0]*e.mass,r+=e.position[1]*e.mass,this.mass+=e.mass,this.centerOfMass[0]=t/this.mass,this.centerOfMass[1]=r/this.mass},a.prototype.initNodes=function(e,t,n){this.temperature=1;var r=e.length/2;this.nodes.length=0;var i=typeof n!="undefined";for(var s=0;s0&&this.applyNodeGravity(o)}for(var t=0;t0){n.scale(f,f,1/p);var d=n.len(s.speedPrev);d>0&&(p=Math.min(p/d,this.maxSpeedIncrease)*d,n.scaleAndAdd(l,s.speedPrev,f,p))}var v=n.len(l),h=Math.min(v,100)/(v+.1);n.scale(l,l,h),n.add(s.position,s.position,l)}},a.prototype.applyRegionToNodeRepulsion=function(){var e=n.create();return function(r,i){if(r.node)this.applyNodeToNodeRepulsion(r.node,i,!0);else{n.sub(e,i.position,r.centerOfMass);var s=e[0]*e[0]+e[1]*e[1];if(s>this.barnesHutTheta*r.size*r.size){var o=this._k*this._k*(i.mass+r.mass)/(s+1);n.scaleAndAdd(i.force,i.force,e,o*2)}else for(var u=0;u0?u=a*f/(l*l):l<=0&&(u=a*10*f)}else u=a*f/o;s||n.scaleAndAdd(r.force,r.force,e,u*2),n.scaleAndAdd(i.force,i.force,e,-u*2)}}(),a.prototype.applyEdgeAttraction=function(){var e=n.create();return function(r){var i=r.node1,s=r.node2;n.sub(e,i.position,s.position);var o=n.len(e),u;this.edgeWeightInfluence===0?u=1:this.edgeWeightInfluence==1?u=r.weight:u=Math.pow(r.weight,this.edgeWeightInfluence);var a;if(this.preventOverlap){o=o-i.size-s.size;if(o<=0)return}var a=-u*o/this._k;n.scaleAndAdd(i.force,i.force,e,a),n.scaleAndAdd(s.force,s.force,e,-a)}}(),a.prototype.applyNodeGravity=function(){var e=n.create();return function(t){n.sub(e,this.center,t.position),this.width>this.height?e[1]*=this.width/this.height:e[0]*=this.height/this.width;var r=n.len(e)/100;this.strongGravity?n.scaleAndAdd(t.force,t.force,e,r*this.gravity*t.mass):n.scaleAndAdd(t.force,t.force,e,this.gravity*t.mass/(r+1))}}(),a.prototype.updateBBox=function(){var e=Infinity,t=Infinity,n=-Infinity,r=-Infinity;for(var i=0;i0?(a.layout.radius=(a.layout.radius-s)*(i-r)/f+r,a.layout.mass=a.layout.radius/i):(a.layout.radius=(i-r)/2,a.layout.mass=.5)}for(var u=0;uo&&(o=v.layout.weight)}for(var u=0;u.01&&this._layout.step(this._steps)},refresh:function(e){e&&(this.option=e,this.series=this.option.series),this._init()},dispose:function(){this.clear(),this.shapeList=null,this.effectList=null,this._layout.dispose(),this._layout=null,this.__nodePositionMap={}}},l.inherits(p,n),l.inherits(p,t),e("../chart").define("force",p),p}),define("zrender/shape/Path",["require","./Base","./util/PathProxy","../tool/util"],function(e){var t=e("./Base"),n=e("./util/PathProxy"),r=n.PathSegment,i=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},s=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(i(e)*i(t))},o=function(e,t){return(e[0]*t[1]0&&p[0]===""&&p.shift();for(var d=0;d0){if(isNaN(p[0]))break;var v=null,m=[],g,y,b,w,E,S,x,T,N=f,C=l;switch(h){case"l":f+=p.shift(),l+=p.shift(),v="L",m.push(f,l);break;case"L":f=p.shift(),l=p.shift(),m.push(f,l);break;case"m":f+=p.shift(),l+=p.shift(),v="M",m.push(f,l),h="l";break;case"M":f=p.shift(),l=p.shift(),v="M",m.push(f,l),h="L";break;case"h":f+=p.shift(),v="L",m.push(f,l);break;case"H":f=p.shift(),v="L",m.push(f,l);break;case"v":l+=p.shift(),v="L",m.push(f,l);break;case"V":l=p.shift(),v="L",m.push(f,l);break;case"C":m.push(p.shift(),p.shift(),p.shift(),p.shift()),f=p.shift(),l=p.shift(),m.push(f,l);break;case"c":m.push(f+p.shift(),l+p.shift(),f+p.shift(),l+p.shift()),f+=p.shift(),l+=p.shift(),v="C",m.push(f,l);break;case"S":g=f,y=l,b=a[a.length-1],b.command==="C"&&(g=f+(f-b.points[2]),y=l+(l-b.points[3])),m.push(g,y,p.shift(),p.shift()),f=p.shift(),l=p.shift(),v="C",m.push(f,l);break;case"s":g=f,y=l,b=a[a.length-1],b.command==="C"&&(g=f+(f-b.points[2]),y=l+(l-b.points[3])),m.push(g,y,f+p.shift(),l+p.shift()),f+=p.shift(),l+=p.shift(),v="C",m.push(f,l);break;case"Q":m.push(p.shift(),p.shift()),f=p.shift(),l=p.shift(),m.push(f,l);break;case"q":m.push(f+p.shift(),l+p.shift()),f+=p.shift(),l+=p.shift(),v="Q",m.push(f,l);break;case"T":g=f,y=l,b=a[a.length-1],b.command==="Q"&&(g=f+(f-b.points[0]),y=l+(l-b.points[1])),f=p.shift(),l=p.shift(),v="Q",m.push(g,y,f,l);break;case"t":g=f,y=l,b=a[a.length-1],b.command==="Q"&&(g=f+(f-b.points[0]),y=l+(l-b.points[1])),f+=p.shift(),l+=p.shift(),v="Q",m.push(g,y,f,l);break;case"A":w=p.shift(),E=p.shift(),S=p.shift(),x=p.shift(),T=p.shift(),N=f,C=l,f=p.shift(),l=p.shift(),v="A",m=this._convertPoint(N,C,f,l,x,T,w,E,S);break;case"a":w=p.shift(),E=p.shift(),S=p.shift(),x=p.shift(),T=p.shift(),N=f,C=l,f+=p.shift(),l+=p.shift(),v="A",m=this._convertPoint(N,C,f,l,x,T,w,E,S)}for(var k=0,L=m.length;k1&&(a*=Math.sqrt(d),f*=Math.sqrt(d));var v=Math.sqrt((a*a*f*f-a*a*p*p-f*f*h*h)/(a*a*p*p+f*f*h*h));i===u&&(v*=-1),isNaN(v)&&(v=0);var m=v*a*p/f,g=v*-f*h/a,y=(e+n)/2+Math.cos(c)*m-Math.sin(c)*g,b=(t+r)/2+Math.sin(c)*m+Math.cos(c)*g,w=o([1,0],[(h-m)/a,(p-g)/f]),E=[(h-m)/a,(p-g)/f],S=[(-1*h-m)/a,(-1*p-g)/f],x=o(E,S);return s(E,S)<=-1&&(x=Math.PI),s(E,S)>=1&&(x=0),u===0&&x>0&&(x-=2*Math.PI),u===1&&x<0&&(x+=2*Math.PI),[y,b,a,f,w,x,c,u]},buildPath:function(e,t){var n=t.path,r=t.x||0,i=t.y||0;t.pathArray=t.pathArray||this.buildPathArray(n,r,i);var s=t.pathArray,o=t.pointList=[],u=[];for(var a=0,f=s.length;a0&&o.push(u),u=[]);var l=s[a].points;for(var c=0,h=l.length;c0&&o.push(u);for(var a=0,f=s.length;ag?m:g,x=m>g?1:m/g,T=m>g?g/m:1;e.translate(d,v),e.rotate(w),e.scale(x,T),e.arc(0,0,S,y,y+b,1-E),e.scale(1/x,1/T),e.rotate(-w),e.translate(-d,-v);break;case"z":e.closePath()}}return},getRect:function(e){if(e.__rect)return e.__rect;var t;e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0;var n=Number.MAX_VALUE,r=Number.MIN_VALUE,i=Number.MAX_VALUE,s=Number.MIN_VALUE,o=e.x||0,u=e.y||0,a=e.pathArray||this.buildPathArray(e.path);for(var f=0;fr&&(r=l[c])):(l[c]+us&&(s=l[c]))}var h;return n===Number.MAX_VALUE||r===Number.MIN_VALUE||i===Number.MAX_VALUE||s===Number.MIN_VALUE?h={x:0,y:0,width:0,height:0}:h={x:Math.round(n-t/2),y:Math.round(i-t/2),width:r-n+t,height:s-i+t},e.__rect=h,h}},e("../tool/util").inherits(u,t),u}),define("zrender/shape/Ellipse",["require","./Base","../tool/util"],function(e){var t=e("./Base"),n=function(e){t.call(this,e)};return n.prototype={type:"ellipse",buildPath:function(e,t){var n=.5522848,r=t.x,i=t.y,s=t.a,o=t.b,u=s*n,a=o*n;e.moveTo(r-s,i),e.bezierCurveTo(r-s,i-a,r-u,i-o,r,i-o),e.bezierCurveTo(r+u,i-o,r+s,i-a,r+s,i),e.bezierCurveTo(r+s,i+a,r+u,i+o,r,i+o),e.bezierCurveTo(r-u,i+o,r-s,i+a,r-s,i),e.closePath()},getRect:function(e){if(e.__rect)return e.__rect;var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,e.__rect={x:Math.round(e.x-e.a-t/2),y:Math.round(e.y-e.b-t/2),width:e.a*2+t,height:e.b*2+t},e.__rect}},e("../tool/util").inherits(n,t),n}),define("echarts/component/roamController",["require","./base","zrender/shape/Rectangle","zrender/shape/Sector","zrender/shape/Circle","../config","zrender/tool/util","zrender/tool/color","zrender/tool/event","../component"],function(e){function f(e,n,r,i,s){if(!i.roamController||!i.roamController.show)return;if(!i.roamController.mapTypeControl){console.error("option.roamController.mapTypeControl has not been defined.");return}t.call(this,e,n,r,i,s),this.rcOption=i.roamController;var o=this;this._drictionMouseDown=function(e){return o.__drictionMouseDown(e)},this._drictionMouseUp=function(e){return o.__drictionMouseUp(e)},this._drictionMouseMove=function(e){return o.__drictionMouseMove(e)},this._drictionMouseOut=function(e){return o.__drictionMouseOut(e)},this._scaleHandler=function(e){return o.__scaleHandler(e)},this.refresh(i)}var t=e("./base"),n=e("zrender/shape/Rectangle"),r=e("zrender/shape/Sector"),i=e("zrender/shape/Circle"),s=e("../config"),o=e("zrender/tool/util"),u=e("zrender/tool/color"),a=e("zrender/tool/event");return f.prototype={type:s.COMPONENT_TYPE_ROAMCONTROLLER,_buildShape:function(){this._itemGroupLocation=this._getItemGroupLocation(),this._buildBackground(),this._buildItem();for(var e=0,t=this.shapeList.length;e",textX:n+t/2+4,textY:i-.5,textAlign:"center",textBaseline:"middle",textPosition:"specific",textColor:this.rcOption.fillerColor,textFont:Math.floor(t/2)+"px arial"},highlightStyle:{color:u.lift(this.rcOption.handlerColor,-0.2),brushType:"fill"},clickable:!0};switch(e){case"up":s.rotation=[Math.PI/2,n,i];break;case"left":s.rotation=[Math.PI,n,i];break;case"down":s.rotation=[-Math.PI/2,n,i]}return s=new r(s),s._roamType=e,s.onmousedown=this._drictionMouseDown,s.onmouseup=this._drictionMouseUp,s.onmousemove=this._drictionMouseMove,s.onmouseout=this._drictionMouseOut,s},_getScaleShape:function(e){var t=this._itemGroupLocation.width,n=this._itemGroupLocation.height-t;n=n<0?20:n;var r=Math.min(t/2-5,n)/2,s=this._itemGroupLocation.x+(e==="scaleDown"?t-r:r),o=this._itemGroupLocation.y+this._itemGroupLocation.height-r,a={zlevel:this._zlevelBase,style:{x:s,y:o,r:r,color:this.rcOption.handlerColor,text:e==="scaleDown"?"-":"+",textX:s,textY:o-2,textAlign:"center",textBaseline:"middle",textPosition:"specific",textColor:this.rcOption.fillerColor,textFont:Math.floor(r)+"px verdana"},highlightStyle:{color:u.lift(this.rcOption.handlerColor,-0.2),brushType:"fill"},clickable:!0};return a=new i(a),a._roamType=e,a.onmousedown=this._scaleHandler,a},_buildBackground:function(){var e=this.rcOption.padding[0],t=this.rcOption.padding[1],r=this.rcOption.padding[2],i=this.rcOption.padding[3];this.shapeList.push(new n({zlevel:this._zlevelBase,hoverable:!1,style:{x:this._itemGroupLocation.x-i,y:this._itemGroupLocation.y-e,width:this._itemGroupLocation.width+i+t,height:this._itemGroupLocation.height+e+r,brushType:this.rcOption.borderWidth===0?"fill":"both",color:this.rcOption.backgroundColor,strokeColor:this.rcOption.borderColor,lineWidth:this.rcOption.borderWidth}}))},_getItemGroupLocation:function(){var e=this.rcOption.padding,t=this.rcOption.width,n=this.rcOption.height,r=this.zr.getWidth(),i=this.zr.getHeight(),s;switch(this.rcOption.x){case"center":s=Math.floor((r-t)/2);break;case"left":s=e[3]+this.rcOption.borderWidth;break;case"right":s=r-t-e[1]-e[3]-this.rcOption.borderWidth*2;break;default:s=this.parsePercent(this.rcOption.x,r)}var o;switch(this.rcOption.y){case"top":o=e[0]+this.rcOption.borderWidth;break;case"bottom":o=i-n-e[0]-e[2]-this.rcOption.borderWidth*2;break;case"center":o=Math.floor((i-n)/2);break;default:o=this.parsePercent(this.rcOption.y,i)}return{x:s,y:o,r:t/2,width:t,height:n}},__drictionMouseDown:function(e){this.mousedown=!0,this._drictionHandlerOn(e)},__drictionMouseUp:function(e){this.mousedown=!1,this._drictionHandlerOff(e)},__drictionMouseMove:function(e){this.mousedown&&this._drictionHandlerOn(e)},__drictionMouseOut:function(e){this._drictionHandlerOff(e)},_drictionHandlerOn:function(e){this._dispatchEvent(e.event,e.target._roamType),clearInterval(this.dircetionTimer);var t=this;this.dircetionTimer=setInterval(function(){t._dispatchEvent(e.event,e.target._roamType)},100),a.stop(e.event)},_drictionHandlerOff:function(e){clearInterval(this.dircetionTimer)},__scaleHandler:function(e){this._dispatchEvent(e.event,e.target._roamType),a.stop(e.event)},_dispatchEvent:function(e,t){this.messageCenter.dispatch(s.EVENT.ROAMCONTROLLER,e,{roamType:t,mapTypeControl:this.rcOption.mapTypeControl,step:this.rcOption.step},this.myChart)},refresh:function(e){e&&(this.option=e||this.option,this.option.roamController=this.reformOption(this.option.roamController),this.option.roamController.padding=this.reformCssArray(this.option.roamController.padding),this.rcOption=this.option.roamController),this.clear(),this._buildShape()}},o.inherits(f,t),e("../component").define("roamController",f),f}),define("echarts/util/mapData/params",["require"],function(e){function t(e){if(!e.UTF8Encoding)return e;var t=e.features;for(var r=0;r>1^-(o&1),u=u>>1^-(u&1),o+=r,u+=i,r=o,i=u,n.push([o/1024,u/1024])}return n}var r={none:{getGeoJson:function(e){e({type:"FeatureCollection",features:[{type:"Feature",geometry:{coordinates:[],encodeOffsets:[],type:"Polygon"},properties:{}}]})}},world:{getGeoJson:function(n){e(["./geoJson/world_geo"],function(e){n(t(e))})}},china:{getGeoJson:function(n){e(["./geoJson/china_geo"],function(e){n(t(e))})}},"南海诸岛":{textCoord:[126,25],getPath:function(e,t){var n=[[[0,3.5],[7,11.2],[15,11.9],[30,7],[42,.7],[52,.7],[56,7.7],[59,.7],[64,.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]]],r="",i=e[0],s=e[1];for(var o=0,u=n.length;o180?n-360:n,r=90-(r/e.scale.y+e.offset.y),[n,r]}function o(e,t){return n.offset=e.offset,n.scale=e.scale,t instanceof Array?n.makePoint([t[0]*1,t[1]*1]):n.makePoint([t.x*1,t.y*1])}var n={formatPoint:function(e){return[(e[0]<-168.5&&e[1]>63.8?e[0]+360:e[0])+168.5,90-e[1]]},makePoint:function(e){var t=this,r=t.formatPoint(e);t._bbox.xmin>e[0]&&(t._bbox.xmin=e[0]),t._bbox.xmaxe[1]&&(t._bbox.ymin=e[1]),t._bbox.ymaxr&&(t.xmin=r),t.xmaxi&&(t.ymin=i),t.ymax1&&(r={geometry:{coordinates:r.geometry.coordinates.slice(5,6),type:r.geometry.type},id:r.id,properties:r.properties,type:r.type});break}return{type:"FeatureCollection",features:[r]}},_getProjectionData:function(e,t,n){var r=this._mapDataMap[e].projection,i=[],s=this._mapDataMap[e].bbox||r.getBbox(t,this._specialArea[e]),o;this._mapDataMap[e].hasRoam?o=this._mapDataMap[e].transform:o=this._getTransform(s,n,this._mapDataMap[e].rate);var u=this._mapDataMap[e].lastTransform||{scale:{}},a;o.left!=u.left||o.top!=u.top||o.scale.x!=u.scale.x||o.scale.y!=u.scale.y?(a=r.geoJson2Path(t,o,this._specialArea[e]),u=h.clone(o)):(o=this._mapDataMap[e].transform,a=this._mapDataMap[e].pathArray),this._mapDataMap[e].bbox=s,this._mapDataMap[e].transform=o,this._mapDataMap[e].lastTransform=u,this._mapDataMap[e].pathArray=a;var f=[o.left,o.top];for(var l=0,c=a.length;lv?(d=v*.75,l=h*d):(v=d,d=v*.75,c=p*v);var m={OffsetLeft:a[0],OffsetTop:a[1],scale:{x:d,y:v}},g=o.geoJson2Path(n,m);return this._getSingleProvince(t,g[0],s)},_getSingleProvince:function(e,t,n){var r,i=t.properties.name,s=m[i]||[0,0];if(g[i])r=this.geo2pos(e,g[i]);else if(t.cp)r=[t.cp[0]+s[0],t.cp[1]+s[1]];else{var o=this._mapDataMap[e].bbox;r=this.geo2pos(e,[o.left+o.width/2,o.top+o.height/2]),r[0]+=s[0],r[1]+=s[1]}return t.name=this._nameChange(e,i),t.position=n,t.textX=r[0],t.textY=r[1],t},_getTransform:function(e,t,n){var r=this.series,i,s,o,u,a,f,l,c=this.zr.getWidth(),h=this.zr.getHeight(),p=Math.round(Math.min(c,h)*.02);for(var d in t)i=r[d].mapLocation||{},o=i.x||o,a=i.y||a,f=i.width||f,l=i.height||l;s=this.parsePercent(o,c),s=isNaN(s)?p:s,u=this.parsePercent(a,h),u=isNaN(u)?p:u,f=f==null?c-s-2*p:this.parsePercent(f,c),l=l==null?h-u-2*p:this.parsePercent(l,h);var v=e.width,m=e.height,g=f/n/v,y=l/m;g>y?(g=y*n,f=v*g):(y=g,g=y*n,l=m*y);if(isNaN(o)){o=o||"center";switch(o+""){case"center":s=Math.floor((c-f)/2);break;case"right":s=c-f}}if(isNaN(a)){a=a||"center";switch(a+""){case"center":u=Math.floor((h-l)/2);break;case"bottom":u=h-l}}return{left:s,top:u,width:f,height:l,baseScale:1,scale:{x:g,y:y}}},_buildMap:function(e,t,n,l){var p=this.series,d=this.component.legend,v=this.component.dataRange,m,g,y,b,w,E=this.ecTheme.map,S,x,T,N,C,k;for(var L=0,A=t.length;L=r&&e<=r+s&&t>=i&&t<=i+o)return u}return},__onmousewheel:function(e){if(this.shapeList.length<=0)return;var t=e.event,n=d.getX(t),r=d.getY(t),i=d.getDelta(t),s,o=e.mapTypeControl;o||(o={},s=this._findMapTypeByPos(n,r),s&&this._roamMap[s]&&this._roamMap[s]!="move"&&(o[s]=!0));var u=!1;for(s in o)if(o[s]){u=!0;var a=this._mapDataMap[s].transform,f=a.left,c=a.top,h=a.width,p=a.height,v=this.pos2geo(s,[n-f,r-c]);if(i>0){i=1.2;if(this._scaleLimitMap[s].max!=null&&a.baseScale>=this._scaleLimitMap[s].max)return}else{i=1/1.2;if(this._scaleLimitMap[s].min!=null&&a.baseScale<=this._scaleLimitMap[s].min)return}a.baseScale*=i,a.scale.x*=i,a.scale.y*=i,a.width=h*i,a.height=p*i,this._mapDataMap[s].hasRoam=!0,this._mapDataMap[s].transform=a,v=this.geo2pos(s,v),a.left-=v[0]-(n-f),a.top-=v[1]-(r-c),this._mapDataMap[s].transform=a,this.clearEffectShape(!0);for(var m=0,g=this.shapeList.length;m0?this.clear():this.backupShapeList(),this._buildShape(),this.zr.refreshHover()},ondataRange:function(e,t){this.component.dataRange&&(this.refresh(),t.needRefresh=!0);return},pos2geo:function(e,t){return this._mapDataMap[e].transform?this._mapDataMap[e].projection.pos2geo(this._mapDataMap[e].transform,t):null},getGeoByPos:function(e,t){if(!this._mapDataMap[e].transform)return null;var n=[this._mapDataMap[e].transform.left,this._mapDataMap[e].transform.top];return t instanceof Array?(t[0]-=n[0],t[1]-=n[1]):(t.x-=n[0],t.y-=n[1]),this.pos2geo(e,t)},geo2pos:function(e,t){return this._mapDataMap[e].transform?this._mapDataMap[e].projection.geo2pos(this._mapDataMap[e].transform,t):null},getPosByGeo:function(e,t){if(!this._mapDataMap[e].transform)return null;var n=this.geo2pos(e,t);return n[0]+=this._mapDataMap[e].transform.left,n[1]+=this._mapDataMap[e].transform.top,n},getMapPosition:function(e){return this._mapDataMap[e].transform?[this._mapDataMap[e].transform.left,this._mapDataMap[e].transform.top]:null},dispose:function(){this.clear(),this.shapeList=null,this.effectList=null,this._isAlive=!1,this.zr.un(p.EVENT.MOUSEWHEEL,this._onmousewheel),this.zr.un(p.EVENT.MOUSEDOWN,this._onmousedown),this.messageCenter.unbind(l.EVENT.ROAMCONTROLLER,this._onroamcontroller)}},h.inherits(y,n),h.inherits(y,t),e("../chart").define("map",y),y}),define("echarts/util/mapData/geoJson/an_hui_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3415",properties:{name:"六安市",cp:[116.3123,31.8329],childNum:6},geometry:{type:"Polygon",coordinates:["@@„„nJ‚UXUVƒ°U„ÑnU@mlLVaVln@@bn@VU@xlb@lšLnKlšƒVI„JšUVxnI@lVL@b„Ž°VX@˜b„x„nVVUnVVnU‚›@kX@VwV@„al¥UUnUWa@ƒ@wĸU„LU¥lKUa@aUI@alLVaUƒ¯anƒWkUKm@XV@VaXlW@aU_UWVUƒI¯@ma¯W¯™™I@UU@WWU@U@@UU@VkV@@WUUm@UaU@„lK@IUK„L@KWmXUWaXI@ƒ@a@a@U@U@KV¥lw„k°b²JVIVKlV@UX„la„Ul`œUVLVVVUšJ„U@Lnm@_VK@KUIW@™J@Xk@WW@U—ƒmm™XmWk@kK@aUUƒVmmkUwUmWL™@WmU@™UJmUULkKWakLWVkIƒlƒwULƒW@X°lUJ@°ULƒWV—wmJ@bmb¯Vkm@@WkWm¯wƒL@lkXƒWmXym¯UImJUbkV™@Vn¯„@V@lUbƒ@mk@maUxmlUbULWn@J—LmKUkWKkwUKƒbm„X„WxkVUKmLkVV@JUUWL@xkJUUƒV@X@VVlUbVX@xk¤šx‚¼œxWxn„‚nn@Þ¼„JVb°aVn„@šmlnXU„JlbVlkz@‚lUŽlXJmxVxXnWxXÈWlUŽ@šUxU@VX@xUL@šUÆmLnV@lWXk@@JlbXblnlJ"],encodeOffsets:[[118710,33351]]}},{type:"Feature",id:"3408",properties:{name:"安庆市",cp:[116.7517,30.5255],childNum:9},geometry:{type:"Polygon",coordinates:["@@n°‚znW„XlW@k„K°xXn‚l@Xn@l‚°Una@anI˜xXU„ŽVK@¯VIkW¯X@‚„VK„x„klJXUlKXblLVKnVVIšŽV@Xn‚@šŽXKVnVxlŽnn„UlmV@²óUkV™lW„b„lƒšƒn@VVVIn@lw@WVIXblV„@Èx‚aUaVIVVnKVLšK„ƒln@b²K@»U£ƒÑķƒġÝÅb™K™a@Im@ۍ„@kWÓkkmKÅnóJƒUÅ£›W@w„ĕ@wĉţ¯¯ƒUkK±l¯Uƒ¥UÑkÝUķ»Ý¥¯™JƒIUŽVbUl¯ÈV¼VJU¼Vb@bkLUl@„VJ@bUXǚ@lkVmXmKkLVxš‚Ž„VƒL@VkVVVlzW˜kbmLUUUbVbUV™šlÒnJlUnLllUL@bU„Vx„l‚LXVƦÈVU¦WJ"],encodeOffsets:[[118834,31759]]}},{type:"Feature",id:"3411",properties:{name:"滁州市",cp:[118.1909,32.536],childNum:7},geometry:{type:"Polygon",coordinates:["@@š„@`nnl@„xšK@X°KXV˜IXVlbXVWnX‚lL@šÈ»‚LVan@VJ„êVVn@‚X@laÞbVaƒyn@„_‚xnWVXnWl@VnUVkI@l‚nXKVLVV@V@kW@LlVô„@J@bVnnKnkVa@»lç@ƒnwšKma™UUUVњ@n™mWXalI@alVn@VwUaVU„@„nlaôJnU„VVXlJšaXXVK@UšV@VWx@nXVWšXVšUlLUbV‚ULVVnUVbUbVbš@@a„KÆnnKVK@U@UU@@a„@Vƒ°¯ÈJVIlķ@aa˜UaVKU_@mkxUI@aƒUlyU@@™wkKWmUbUnUVWbkJW_J@bƒn@Vm@@KULk@V@@bVbÅm@LW@UVVbkK@UkKWL@VULUKWIUJUbkK@_WVXU›Jka@XƒVa@kšy@aVIUUW@@m„UlLœKWÑUKVan@UkVmmIXKƒaVaUwVU@UmykU¯@±UUL@WUIVUU@KkIWaƒaU@kUUaǃUó»mKƒk¯@y@kWK@bkI¯`mn™l¯XWlkVUzUJlbUbVJl@nnm„@VULV`XnWƗbmUUn™JmUknƒJ¯km@ƒyk@kU›xL@VUbmnn¤lX@`™z@JmaULUVl@Xn@xllkXWa—aW@UVmUbƒ@mVXšWxXbWbUŽƒÒnVVnVVUL"],encodeOffsets:[[120004,33520]]}},{type:"Feature",id:"3418",properties:{name:"宣城市",cp:[118.8062,30.6244],childNum:7},geometry:{type:"Polygon",coordinates:["@@Vb@„XL˜JXxlIXxlVlV@I²¤šnlUnVšU@VULWVUJ@Lnb@lV@UnV@@VVVlLnbnJ‚UVkUUVWn@@anUVnVJVIV‚@@nUJVbUb‚„@VUbVK@bn@VbnIlxkllXVlXKWUXUlL°¤UVVb@bš„UlkXW‚ƒxXz@‚„Ila„UlƒnUlJVInVÆJ„U„LVUnV„K°@VnlVnxV@XLlK@wVL@KnUlJXU˜bnKVLX„lUw@VWlLXKm@@a„@VLnmlIVVnKn@škVašVlwk@@a@k@ƒVIUa™@maUa@wna@kmWƒ™UUmVUIVǗ@aƒKm™aƒ™kU™J@InmUUaVa„k‚lX@Vk@m@VU@wnK@alKVUkUkKƒbmUkmƒ@U£WVk@@UÝbbƒaÇx@b@WVUa¯ƒ@wVwUUV@VwnK@KWaŁ@KšIUyUI@WmXó™UbWaKm™@km@IUyƒIUaWKƒx@zUKUL@llVUnkLVVkJWX@VUKUVƒIkVWakb@VWb@n@JkXUlmL@xkL@`VxšLUÈUJ@Vm@@bmIUlUL@VUVVbknm@mKUw™KVÈ@J@LV±kkJUIƒl"],encodeOffsets:[[120803,31247]]}},{type:"Feature",id:"3412",properties:{name:"阜阳市",cp:[115.7629,32.9919],childNum:6},geometry:{type:"Polygon",coordinates:["@@V™nƒš@ša„k°aš±@‚¥@UUI@aUmlwUUx›b@¥XU@mmI@a@Kn@@_W@@W„I@mšUVVXUl@XaV@‚K@I@a„LX@aVI°K@KVL„UUw‚yXkšK@kšKÆbXnlK@k@a„JlU@w@U@»@aXKWƒn_‚JXkVKnƒ@°LlKXƒW@¯Uƒ@aUK@kmJUw™VƒIUJ™„kŽmL™K@kka@wUVm@@am@UkUbkK@nmVƒÒ¯VU„WVVmIƒƒULk@ƒƒma@kkKƒƒ@nUbUamU™`UUVUkKVkkƒW@@bkmƒnƒmUXVKXVƒL@VƒbU„m‚™bVXJ@nmKÅI@KWKUXVJUL@VUKUX@KUKWL@LUJmaXXm@kVVV@L@VUL@VlK@L@V@LUK@VUb@UUU@°@nVxU`‚Lkn@`@XVJ@X™Vm„k@UKmV¯LVVn±Wm@Ub@JlLUl„@VLk„@lmVVn@bnV@V°IV™šaVJXI°K°V@XXVlVVU„nšKVlUš„bWXnV@bV`U„„@@m@@‚ƒ@nxmn@bXVlL@¤nb„Ul¦šVVUnJVU„Vl@@bÞL"],encodeOffsets:[[118418,34392]]}},{type:"Feature",id:"3413",properties:{name:"宿州市",cp:[117.5208,33.6841],childNum:5},geometry:{type:"Polygon",coordinates:["@@@UWU@bkW@aWU@aUIkWV™lLXb„lVIUVV@‚mn@V_n@VaUK@I‚@UašanJVU„@lV„UVnnKVVlaUa„I@wnK‚Lnll@nVlk@wVKXkl@@b„bUJ@V‚U@U„UUyVk@aVUXwlWXX‚WU¹@aU™@WUI@mlUšn„J@Il@šaXbV@VKl@XxVL@W„IšJlb„@„al@„IUUm@@aVK@¥¯—@mUķ¯bWƒk£Vm@akm@VaÅ@UVWaƒ@UJWkƒJ—UƒbWbU@UlƒXk@ƒamV@K¯nk@ƒlU@Uxmz@bU`ÇbUbÅVm£U@Ww™x@akLUK@UlakwUJWVkLmaUal@n_ƒmVUnKVUUmÅXWa™@kJmx@XUJ@bVLXxl@VVUVV„UbkLWbU@@lUVV„VVX„›K@XkJ@nU@@bV@VxUVlb„U@xXLWŽn@UxVbVĊ„V@b@XV`mnkJ@kUKmbƒaU@VbnbÆx@XU@@`k@@bl„™@@bkL@WƒakXWaU@Vmkx@XWW@@wUUUbƒJ™U¯V™@¯ÞU@WxXŽlL@bkb@ŽlVlnb™JW@kkU@mbkaWJ—IVlmz¯`UnU@mb™@@„ƒ`@bkVlœnV@b@šV@„aVxn@Vx‚KXnl@nbVK„bVK@a„_V@Vƒ„w@W„LlwnK@UmIU@VWš@šUÈ@lKnal„wš@@V°@šaUmlUUw@„ƒV@@UXK"],encodeOffsets:[[119836,35061]]}},{type:"Feature",id:"3410",properties:{name:"黄山市",cp:[118.0481,29.9542],childNum:5},geometry:{type:"Polygon",coordinates:["@@lXnlWX@VUJVnUJVzXJVx„kVJlI²l‚U@K@IUǚLVxnLn@lmUaVU@UVKVknJ@an@@UVIVǙKUw@_lK@wnKVklW@I@mXa@UlaXblU„JVUVL@UXWlIUUlKVmkU@kVKVL@y„wXLVb„JVz@Jlnš@nŽ‚LXbVaôšnW@la@UVWUa@@a@mk@WIk@VwUa¯¥m@UUVK@ImK@aX£ƒkK›ÅV™a™™ƒ_@±ƒakXWW—LƒƒƒnU@@a@¯mK@L™JUWwUV™VmbXX@lWLn`mzUJUb™Lƒ„k@makVWmkX™ambkKknƒaƒ@ƒaƒb@‚U@Unm@—ƒWVƒ@VbUbUJWIk@@lmL@°UVUVm„nš™@@kmWkb@xƒ_m@@aU@b@JlŽUz™lWxXn„@‚b²@l`„IVl„UlL@VšK„nVbUl@VlIn@@b„bVWUk‚@@bX@Valb@bnb°Vn@„xVKlbVnV@V‚x„L@ln@UXVV‚L˜"],encodeOffsets:[[120747,31095]]}},{type:"Feature",id:"3414",properties:{name:"巢湖市",cp:[117.7734,31.4978],childNum:5},geometry:{type:"Polygon",coordinates:["@@VV@blL@ŽXlWnnšnŽ˜„@VXXl@@WšIX@VJ@LšxŎxlnšŽ@bXJVblX@VVbUVn@VbUVlb@LnJVbVLV‚XLšÒVL„ÒšV„bVIVylUXk°Wšknm°_lJ@aXL@l‚z°@„lnLô¼V‚È„VUUaVKU@WW@@UUa@knmVLlaV@„a@kšak±@UmwkKmk™lj™ÝUUkL@mlIVmnÝWkkUÝ@KƑĉ™a@»ƒmma@mX™¤¯Uƒw@ƒ@UU@bU±±L@akmƒ„™LUKmLUUUJVbbÇwƒ@kUWaUJ@Xkxm@UJUUm@™„k„ƒ‚ƒakXUšVl±ôU@kn"],encodeOffsets:[[119847,32007]]}},{type:"Feature",id:"3416",properties:{name:"亳州市",cp:[116.1914,33.4698],childNum:4},geometry:{type:"Polygon",coordinates:["@@lU@Un@@anUlw@KVmUwlaX_lKna@KU@@kWKUU@ankW™XK˜@@V²VVIÈU@al@VaÈamK@wU™@klaUƒV@XƒVUU»WUUbkmUkVmk@aÈw@mWU@VkIkVWKUÑķXȭºU¯lƒ@kkLWmÅa™L@l™LWlzVxƒVUK@L¯LUJ@bWƒK@b@JLU@Wbk@WVUU™V@nƒJ@XX@@`m@@L@bnJ@nWV@¦œa‚wVVkxVn@bVJ@V¦@Ž™²¯bƒl™b™@m„UšUŽƒŽ@¼ƒ¦Xb‚UV`@nnxUxWLkUkVWKkV@XV@@VVL@VX„@lVV@L@blL@`šL@xXKVL‚@„VnUš@lwnU@ml@XnV@@UVW°LnalƒUI@aUK@a‚a@U„kXW@I@mWL@UXK@UVW@U‚@@k„Wn‚@@V„@XblaVxšL@bVKXb„IlJ"],encodeOffsets:[[119183,34594]]}},{type:"Feature",id:"3417",properties:{name:"池州市",cp:[117.3889,30.2014],childNum:4},geometry:{type:"Polygon",coordinates:["@@„V°°ĊŤ@xƒĖ@xœXƤ„VôIÆmnLllXÔ@lƒÜŽn@@JšbšLÆaĢÞĸ„°VVUUKVanK@UV@VL„VVn„ln@‚xnklxXamk@WV@Xa˜@naVk„Klk™@mkUWwkJWw—IWK@ƒUaUwWIUyVIUmVI@UXWmkkW‚—KUUVWm@@kƒKw@U‚UUmkaULƒwm@¯Uma@akaUbW@@a@VlUXƒa@am@kJ@UVkUaƒm™L@UkKƒVUkƒJk_±@aƒ@WmXwÇkkaVaUa±ƒœwV@VkƒwnyUaW@UU¯amLk@m™@kmmU™™¯K@L@lUX¯ƒWlkXƒŽVb„bƒVUL@J@LVKnlJXnlb@`nXlalV@bnL@Vnb˜¼@lXbWlkL™K@zUJmIUxUVUVmX","@@llUL@VlxšL@a@UƒwXa¯@"],encodeOffsets:[[119543,30781],[120061,31152]]}},{type:"Feature",id:"3401",properties:{name:"合肥市",cp:[117.29,32.0581],childNum:4},geometry:{type:"Polygon",coordinates:["@@„L„xV‚ĊLÞkšVlVVXaWaXwW™nU„@‚anVVUX@˜bXblWkk@wWmk@VUVKnb@Išy@_kWm£nmVa@U‚KœwlVl@„zn@°l„IlmnVšIVmnV˜aXÅWmU_VK@Unƒmmk@UIVakaƒa™UƒÑUK™ÑWKUUKUamI@KkaVUUam@VUUa@UkWUaWI@a™kmōw™wUL@`mn@KƒV™IUVUUUK›Vk_ƒVkbWƒ@VkUULUJ±I¯aƒlkxU¦@L@V@V@b@b@„WJXbWVXn@LƒKVL@JkLƒŽV@Vbn@VV@XU@UlV@@VV@V@XXV@@VšJ°š°Xnb°@„JUVVXV`@bkXWŽUbU@WŽn@VLXlm„°bV„UbkK@bVJ@bVbkLV¦ƒKķV@x@„XbmVVVk¦"],encodeOffsets:[[119678,33323]]}},{type:"Feature",id:"3403",properties:{name:"蚌埠市",cp:[117.4109,33.1073],childNum:4},geometry:{type:"Polygon",coordinates:["@@VÒXLlUlJ@UXV@nÇx@bnlUVllnVaXVV¼UVW„U@V„²wVV@Vl@„VnwlIš@XbÆWVnUVmLUV„nm`k@VbnblKXUVIlxkb@VVLlK@bšwXxV@n¤ÆUVaÈaV_@anyVwV@„kl@°m@LnU„bl@„WVkV@Xa„a˜V„IXl‚IV‚„@XbVUÆ@XKWwUkmW@_UmnIlJXkWKXmV@‚w@_XV@Kl@kU@KlX@@UUUUKWLm@klJVUUmk@mXUWmXwƒ`m@„zUbÝakbW@m@UUƒéUIm@UbKǼ@™kKWXmWUkaWU—JWU¯L@W™Lƒwk@mm@_™ƒÅl™UVkmWUnV@VWLUb™bƑĬ¯l"],encodeOffsets:[[119543,33722]]}},{type:"Feature",id:"3402",properties:{name:"芜湖市",cp:[118.3557,31.0858],childNum:4},geometry:{type:"Polygon",coordinates:["@@„bVaV@XllLXU°ŽlL@V@VUnVl¯Ikš›VUVU@@b@lUXUWmb„n@¼šbƒĊ‚LÞ@lVXlmÞUnkJ@nlKVVšÞXklWVaVI@aUKn»lL@Kn@‚XXwlm@mn°@„V@Wy„wXlWVk™ƒ@aUaVU¯£kKWVXVWLUkkWlkkwmJUam@@aULVa@UƒVaUaVI@m‚@UUJUIUmmV@bm@UXVVUlVmImakKUU@UU@VmU@@kma@KVIXUVK@U™VmUkV™m±£@JkU@nlšk‚ƒLUlmb—@WbU@@XnlWb"],encodeOffsets:[[120814,31585]]}},{type:"Feature",id:"3406",properties:{name:"淮北市",cp:[116.6968,33.6896],childNum:3},geometry:{type:"MultiPolygon",coordinates:[["@@lnnK@¦n@@V‚V„@@VV@nIV„V@VW²a@b@bVnUVVV@V™z@lš@°UšV„IVaVV@x@ŽXX@WlwUnV@XblW„b@XlK@aš@kƒ@al@@_V@@WÅwmaUaV@„bnaVL@llInmU_@W@aƒUUĉUaVwm@XWK@wƒVkaVUUwU@@aV@@mlI@WœLWƒUUUƒVU@kV@XalKVaUƒVUUUk@WwUK@aVI@WƒUk@@UUU±xkb@lVš@xnLÇbUbk@@bÇVUJ±U@U—@WLXšml@bVVXL@lV@@LmbkLW`kbVxUn@LkxmV@bm@@VkV"],["@@VVVkV@¥@UV@U@VUUJƒkWakKUšlXVJ@bXV@blX@aXV@V"]],encodeOffsets:[[[119183,34594]],[[119836,35061]]]}},{type:"Feature",id:"3404",properties:{name:"淮南市",cp:[116.7847,32.7722],childNum:2},geometry:{type:"Polygon",coordinates:["@@°kƒīšaVaXK@U‚UVmnXUlšVÆkVKUUUmmU„ÑkU™UÝlĉKUƒwƒKƒbU@UxW@@lœmVUUVmUUƒmƒw—aW„kL¯K@Žm„ULWlIm`X„WL@b@¼@V@xkVƒI@b@l@lk„V°Ȯ¹ĸW"],encodeOffsets:[[119543,33722]]}},{type:"Feature",id:"3405",properties:{name:"马鞍山市",cp:[118.6304,31.5363],childNum:2},geometry:{type:"Polygon",coordinates:["@@šNJnllLnxV@laXLVKma„aXbVI„bVKVVVIVyn@n_ƒƒW@@ƒ„UnJlUVVXlLnaUWlV@VV„IXW@_W@XK@K@UVUUwVamÑXmmwƒw™KUnUK™çU@ƒJƒU¯@mŽ@nknWxWm@@LkKm¼VL@bUJUbkXWl"],encodeOffsets:[[121219,32288]]}},{type:"Feature",id:"3407",properties:{name:"铜陵市",cp:[117.9382,30.9375],childNum:3},geometry:{type:"MultiPolygon",coordinates:[["@@„ÒV¤@¼V²@aVV@Ž@„„x°Vš£nW‚@nbnaVXVW@k@aV@VUœUl™°JUkVm@U@UkK¯WVkKWkU@Ubƒakwmlwm@ƒkUmƒUUKU@@VmLUbVLUV¯U"],["@@LllUL@VlxšL@a@UƒwXamK"]],encodeOffsets:[[[120522,31529]],[[120094,31146]]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/ao_men_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"8200",properties:{name:"澳门",cp:[113.5715,22.1583],childNum:1},geometry:{type:"Polygon",coordinates:["@@HQFMDIDGBI@E@EEKEGCEIGGEKEMGSEU@CBEDAJAP@F@LBT@JCHMPOdADCFADAB@LFLDFFP@DAB@@AF@D@B@@FBD@FADHBBHAD@FAJ@JEDCJI`gFIJW"],encodeOffsets:[[116325,22699]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/bei_jing_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"110228",properties:{name:"密云县",cp:[117.0923,40.5121],childNum:1},geometry:{type:"Polygon",coordinates:["@@vIHZDZQtDLNMXIbHRCXXITbJ@H`LGPRDDJNCLHTOCWFGvGBUJMKGFO^IHWXITQCI’Y^AXGfRˆDXF`DJOLB~G\\DZIHHpErUVMhHb]\\M†BVF@FTP`@zTbD\\@~M\\K`H^EVODWICAakAQXoIcCOCIgGYNWFWNGGKKGaJEGMEIKYJUT_J_Go@_SyQaSFMEGTcYOQLIIi@EKAUPCV[EEXQCW|aMUMAaYCYNIDGGACIMGGSKDQGaF_C[GaB@GOIiOKAYL“mI@CN]F[SWWAcKKI@HMUimEKbeYQYISNUOcBKPIFBNgvDPGZYFSf]CMSIWGEUFgDIQ[MeDMJS@RR@LphFPCHaBAJKF@J]IBJO@HlO@@RKAMPJHCNDJTHFP@ZGNANBRFH@J_fM^ONJNF\\VTDJHDON@XRND\\XRCPVETCLBVKDFJINHRGPRV@\\CLJN@VbXbLVT"],encodeOffsets:[[119561,41684]]}},{type:"Feature",id:"110116",properties:{name:"怀柔区",cp:[116.6377,40.6219],childNum:1},geometry:{type:"Polygon",coordinates:["@@JHTVHXCHPfnDJGHNDJSB[JSBGVSAOH@PMPuDEHHXZN@PHF@ZLJ@LHVYJA\\OFWP]BMtMBSRGV[JeVAPQVIFENMD¡–@^NV\\JH@NNL@NM\\kTQ\\I^FNIpBHGTBFFAZQfKDIXQTLXFXNNVMVHRGpCFLlRLEVBBH`IVO\\G`RDPAXLXBXORHZEHTDLLN@VGTMrQNFPeASKG@GMOAKBYMK@GTUHUXSHMVDNMOUEOZMJML@^KRACMZEZMRQLUHE@OFENPR@DI\\ChMHIDG\\GJMDWHCKGMDCIQCHO_K@GaIJSWWQDaGWJMNCKRsCYGYuJUSaKaW@UIMDK@[QUHOGQJMEILCAUDKFSOUQD[WMC‚Q@WPMGCCIUSE[IMPMN]`e@IEGAQBMHM@YEOSGCIDMIGNOLB@QP@GkP@AI^J@ILEBIbADGEOog@KQQWSekWQQUOFKZLF@PUNmIaHIUeBCTSHENcJa@_IWSaGu`GLSBKJQFOXGDXVQVOBIHcDSJWBEFGTMH[^mLaXcHiKElTRKtFXZ`MHMPCNRDxZˆB\\ICIHK@KŽHbIVFZ@BPnGTGbDXRDJaZKRiGEFSFEJhjFNZFjn"],encodeOffsets:[[119314,41552]]}},{type:"Feature",id:"110111",properties:{name:"房山区",cp:[115.8453,39.7163],childNum:1},geometry:{type:"Polygon",coordinates:["@@h@bl@HRJDZ``TA\\VVD^H`\\pF\\JŒ`JGv@ZO\\GPSTEjPTR`FnEbDTDHEhLFMTK@ETSPULKEI@OVISKSJACEQNQbV˜IXGDIN@dMB[IIBcN]ZHNLP@XOWCFWŠCNRHTpATD@^NVNLED@Rh@jCEF}E[OOHUEW]W@QGGDIQSH_MmFmCUT_K]i@MHCMW—FCF‹E{BMHMPOHKS]CFNGBELDH_@BcAKOACESAOBELaXAROB@FODMEDWJAG[aE@UM@DImEWJMC@OeCA{aE[@{L@MINUCQXKfUJORCHqJBF@TCXWNQX]M[EAJO@@KMBQJIC]EWMCCUBEBFHKDOTMBGNGF]MWDBRDdMDQVyE@LPVHDCP@JVVMTG~HNSH[CmRUvHPHBbA\\PTNRC\\YNJ€PRARPJDDR"],encodeOffsets:[[118343,40770]]}},{type:"Feature",id:"110229",properties:{name:"延庆县",cp:[116.1543,40.5286],childNum:1},geometry:{type:"Polygon",coordinates:["@@^AXOPEB[ZIGU@KKI@YGE@OYMGWFGvCNO@OPGTBHUTA\\ITACIGMIHmCOeDGGWSUIGimYEEMgiFITEFEjHLQbYCIWQaCSHmHAOY@UEaJG@LGLDJ[J‡AwYQCDMNONGY_EWLsSQFkMO[NWAIGaIYL@HMBOKiOQDWEUDMQSF_QIUBWdg@[NaAKQ@M]OQ@WhgLUMMFYQDIRCEUZOOCIOJ[KIUMKL@HIDKVEBM`HJAJSJUdBLGNEdMBMO[BYEWJSNKNaD]PE\\SjOT_RQVEZPpƒNQXfŠNA~lNG`@PNLp¼RFLfbdKbATUh@FSNWjGFZVLFHVA~X¨PPROfFJbNJPLFbENJPrEFNPFRHDDJdENJLVEPBJTVTHGHFRFH@PXP\\ORQHW\\BjWFDERLPPBbB\\E`B\\D\\L`@F]FCnJ^AZL"],encodeOffsets:[[119262,41751]]}},{type:"Feature",id:"110109",properties:{name:"门头沟区",cp:[115.8,39.9957],childNum:1},geometry:{type:"Polygon",coordinates:["@@V@XMnGPY²‰JQNEhH\\AZMPDVTTDZCPiJkHSHCjIdFtEHITCNITQEKUAMCEIKCECABYESKFWAKBEIIHABGDCKCAIHMHALKEI\\CFIBILIJQZS]BBEECS@E@@C]COKI@CABAAEEDMGƒCH]A[M@CJWH—JaUMRFRBDTITLUJ@PFJKLOVST@FSLENgKGFSCaCmF_ESQiOSFOT[HYPu@IH‹_[IoE_[]GUC[USB__CYQI@Gakg@qZeHQNMNV\\FVLPgJAFJPRLCH[XcPELUT[JiV_EELFTADBXRTRLJC@fHXHHbPd`fR@NfT`@TLplHMpCEJHJBVLFŽ@JT‚VnG^KXDXHNVGRLRXFJVdDHSNWLGfEzA"],encodeOffsets:[[118635,41113]]}},{type:"Feature",id:"110114",properties:{name:"昌平区",cp:[116.1777,40.2134],childNum:1},geometry:{type:"Polygon",coordinates:["@@VNLJI\\JPPDYPFVQDCJZRNEVNhKXgR@^P@NLRbB\\Mh@XcVARJE`RTCNFV€XRCjPPLNA@GZKbJJHXB\\MNPjLdGbWnK\\]NGHSFEXATIdCJGPARUWUHCPWRELITAHKv_E@iYCaW_BQ\\Y@QIO@QDCIGZCEMWGFMFAFgHEDOCSqKCCFGAMKEAC@ODGCGs@WH@KQA@EE@CE@GEA@EH@GGUEEJEAYD@JM@@DAA@FHD@FTJEHUC@JUBKCKG@G[CIIQReAYhO@OXGDO@@FF@IHJFCPEBACBIAAKDOABXARHPNEHGbQAAKQFGIAM[C@WHKaGiCEGOA‹HUKCIokSCUSOCYN[BgGMFIR±ŠOZmHWNU@ShbbXDHVXXGJ^lZ@PZ\\Nb@\\FHJAD"],encodeOffsets:[[118750,41232]]}},{type:"Feature",id:"110115",properties:{name:"大兴区",cp:[116.4716,39.6352],childNum:1},geometry:{type:"Polygon",coordinates:["@@F\\E~DFN@BDFEpHFCHBBEGCDCJBHUDSBB@ELCPbF@B\\J@BJVAFJ\\ADKTCBGECFMT@BMN@@FH@DaNBEnvB@FPBATK@FHEFIAKFBFL@@PKBFJHC@FXBRAFCDMPDTOL@JIVFDHH@DDH@BGRFCDLD@N^@@CNA@KNOAEBCECFEGCFGMGFIPMOEJOLBADBBHGG@GCHIECY@INC@DMGS\\AIOZAAEYA@GT@KKMBEETCGMVINFxA@MJADB@FlA@HJA@NND@DFA@DVAZBBOFKH_JA@K^GBC@EFE„G@gAENMXKJigC@IbSJMqGOP£RGSMGE@kbQFDPEFiBSGGSBK]I{CDWCIDOic[C_G@SuSO@EWKCO@MNY@\\uZOPENQD[LKESSKGBKEG@EJGAGHoH¥CqhifeJkX_XFFGHFNEDFPENKHM^IFIVL^S`DVEnNnG`RTCJHH@R^XFXGVPP"],encodeOffsets:[[119042,40704]]}},{type:"Feature",id:"110113",properties:{name:"顺义区",cp:[116.7242,40.1619],childNum:1},geometry:{type:"Polygon",coordinates:["@@EhEBENXHFNYDJHCD@RJP@R[ZARX`DbjZF@bHXT`Jb@dIFMTGDSfAJVbGnJVM@OKELYPERVXRflXTT@NIfC\\NJRhCVEHFJXNT^DTeZEHYCOhuAMJELOdAVPTMOWBWNMNEJgl]@WGUFIC[T{EEDEHGCIGMI@SECUQI[D{A{GQESPUH]CsiMCmHUeoHENcAaDGCMDGMQCACCBaCGLMAHB@DIEQLOAAEEJ@CW@CDINGAAGKQOCgV@LG@BEGDKNeREFBNCFIDOPKD[@YRW@GFWDAFE@EHDDrLDTCPGF","@@KrJEH[\\B@FF@CHFBHUN‹AJKADGECBCMAG^E@EbI@BEGP"],encodeOffsets:[[119283,41084],[119377,41046]]}},{type:"Feature",id:"110117",properties:{name:"平谷区",cp:[117.1706,40.2052],childNum:1},geometry:{type:"Polygon",coordinates:["@@ZJZRafFLjn€VGNJ@LLBdXX\\T^EDMJ@”nZKLBjPPJ@HbA\\H`DbERHLCFK^BZaFWXQLAGMHa\\OLO@SBIpBdCLƒVQfElO@GSAKEDQTC@GEBKG@ORIJBDAPDFA@CaOq@GGQAAEJK@KMUGAAGEAa@MGMBGCGSIIW@WSUCMDOJeWOM@IUF{WMWaDIMgIoRoCOKeEOEAG_I[cg@wLIFENQFDVTFJ@HNDJGHCFFFS|D\\EJHV@Xk^IhMFMNAXPX"],encodeOffsets:[[119748,41190]]}},{type:"Feature",id:"110112",properties:{name:"通州区",cp:[116.7297,39.8131],childNum:1},geometry:{type:"Polygon",coordinates:["@@FDAJTGDNDCTDDEDBBE@DT@@EHCDGJ@EIZ@@FDBR@ATFBBVFFE@@HNA\\VE@CLIFNJFNJBCP]A@LJFA@HJEDD\\C@DBCHLAEPF@@DH@APHAERDF\\GIxDTM@CFLBBFJ@CNUPMHECGDBF]BMFPDLRBHHBJMDCX@@DFIBFPBRKJF@CGANBHKbDDABDRDHNNCHDbCdBFMpGHiOYMefKJMC}HWAUNW\\NNBNA„kNU|]HMTMN@MZBLFFF@RIRUT‘BMFIEGaAGGAOIIUGTSFcYKS@MSLYPKRUBU]EWDOI]CKGASgW@MTWKIMCS@uMAKKADMECGAKVUTSDy@IjWLMNBF@hƒHEF@FAD]H@LIBG`ELAPYAUB@CEB@CMC@MIB@GkB@ECAIB@NwBMEUJHNSDFFNALLS@@HZBBFYBJP[BHTCND@JMZ@FDGJHDH@GHAABCKAIPPFONEJNHEHHDEFFDADBFMP@L"],encodeOffsets:[[119329,40782]]}},{type:"Feature",id:"110105",properties:{name:"朝阳区",cp:[116.4977,39.949],childNum:2},geometry:{type:"MultiPolygon",coordinates:[["@@bFGHBHFBFIVFHHG@@FFB@HDFF@@FRB@LXGt@DHCH@PBDLFBNF@BEXCHEX@ZQ\\@LCPOJCDEAMFEfQLMHCAFH@@KhUNE^AAEHCFDNGVODMI@AEKADEN@CSJw[HCEFQGBBOG@@CE@FOKBDGCAD@C[FCGIB@IE@K^BDOIAEMMIJEDKF@[UMB@GF@EEAUEABSQ@CA@EY@FJI@CHGD@FS@@CAFCACFSCCDCMSHBIECMB@D]@@MKCDCQEAHG@CCG@CGUEIJK@SPOCCNEDQBDNDB@DJCDLFCBBALJB@BVGPBKVO@KHCCCD@FE@BNA@FNCTDDJA@FGB@NBDW@CL@hT@@ZHHQDDDAFSAANBC@HG@EFS@@DE@@PCB@Ue@CADNJB@FCBWA@LI^ix@FIHrH"],["@@HUN‹AJKADGECBCMAG^E@EbI@BEGPKrJEH[\\B@FF@CHFB"]],encodeOffsets:[[[119169,40992]],[[119398,41063]]]}},{type:"Feature",id:"110108",properties:{name:"海淀区",cp:[116.2202,40.0239],childNum:1},geometry:{type:"Polygon",coordinates:["@@plDJVLŒGPBFHjDbHGL@X\\DBNHJREBLRBHaFGŽMGOBQAWPBLCBBAJBDFADOIEJGE@@EP@HCPWP@ZgfBRQJJ\\D@HLHLDVA@IVDFGSI@EGC@EBB@CN@@IZCAGHGaEqGJG@EjwJ]@K@GSA@e_I@NE@CA@Kg@KC@ENCFƒAKQAW@WIMK@V‹@I@@F@^EDFB@HcIaDYCBRRDCHD@EFLN@FE@CJUPEJOJMTBPEDIFCMIAKNOGMRFJNDVBFLSRMJSDGJsFcEiJGDGTIlOjYD"],encodeOffsets:[[118834,41050]]}},{type:"Feature",id:"110106",properties:{name:"丰台区",cp:[116.2683,39.8309],childNum:1},geometry:{type:"Polygon",coordinates:["@@hMN@NFTQCFRCBJFA@HJ@@HJ@HJ\\FTACDŒ@@UNLXJX@@MA@@IECAQlDFEHBDI~D@GXCFMVDFCH@@NF@ANJC@FnAB@AMF@@EDCDDLGP@LUOAUH@AIABKAAEDCKID@CCACMWA@EGDEILA@OK@AELEJBFEEGL@BSOA@EuAFmMACbG@@EM@ANS@ENFDAHSDCL[BEIUBAII@A[E@OaKD@FAACTGVIACDHDAFGAEDoGEFACM@i€g@@QFCMKMU@]SCoBGSMQ‰DEXXDWPO@MKYGM^AdJJA\\cNB\\G^„DNHFCBFABDBJ@PL^D@DF@T@FDAF^A"],encodeOffsets:[[118958,40846]]}},{type:"Feature",id:"110107",properties:{name:"石景山区",cp:[116.1887,39.9346],childNum:1},geometry:{type:"Polygon",coordinates:["@@NQPHLMJBDNJEFCAONSPIFIVODIF@@EKMFEC@DGQCAQZDbCdJ@GEAFC@]@EJ@DCSB[EGII@@GI@@GEBAIQDDESRMEM@gNYTIRKJAJEJ[DFJKLGBGNBJLDCDAHGBJJAFBLEXTLZFBAFDLD"],encodeOffsets:[[118940,40953]]}},{type:"Feature",id:"110102",properties:{name:"西城区",cp:[116.3631,39.9353],childNum:1},geometry:{type:"Polygon",coordinates:["@@XBDA@EIACM@IJAD]BC@SFABISAD]H@@OAEDQEW@BLE„MD@FLDh@@LDBF@@M`J@fTB@H"],encodeOffsets:[[119175,40932]]}},{type:"Feature",id:"110101",properties:{name:"东城区",cp:[116.418,39.9367],childNum:1},geometry:{type:"Polygon",coordinates:["@@DBf@@VDA@OF@@CT@FEH@@GADBMTBBECCRCGG@YS@@gDK@A‘C@PG@C^TBAJEB@TADC^IB@J"],encodeOffsets:[[119182,40921]]}},{type:"Feature",id:"110104",properties:{name:"宣武区",cp:[116.3603,39.8852],childNum:1},geometry:{type:"Polygon",coordinates:["@@RBX@RFFCŽBFU@aK@WA}CCJGAEFkCBRFD@JB@@N"],encodeOffsets:[[119118,40855]]}},{type:"Feature",id:"110103",properties:{name:"崇文区",cp:[116.4166,39.8811],childNum:1},geometry:{type:"Polygon",coordinates:["@@XBL@@bEV’D@BX@AC@MHA@EIBCCDSEMmB@EIDBME@@MG@EDUCENWD@H"],encodeOffsets:[[119175,40829]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/china_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"xin_jiang",properties:{name:"新疆",cp:[84.9023,41.748],childNum:18},geometry:{type:"Polygon",coordinates:["@@@›ρȁôƧƦóəʵסʵóƪԫʵѵͩƧͩړ›υࡓɛʵ@ȃ@óᇑѵƨɝɚôóНѺͩɜ̏ԭʵôƧɞñ@υƩ—݇ȂóƩƧ@ѵȂυœƥŌਗ—॥ɛóʵѵƧѹ˜݇̍ࢯ˜əɞυ˜ρͩ̏óਙƨƧŋôōóš̍ͩóʵן›óŋړͪƧѶ@ɜԭ—ԫƦɛȄ̍›ɝȄöςƩȂ̏œñȀ̏œƩóóŎə˜@Ő̎@ɞȀɝŎôƨóנѵȄƧ@óŏɝœóɜôŎ̍ͨςŎ@ƨóôƨɞ݈ʶóƨφó̎Ȁƨ̍ԮòѸԮמ@ѺȀ@ƪၬֆòȂñ̐òȂɜ˜óƨ̒Ŏ̑߼@φρȀ@Ő๐ς̎Ƨφ@ɝφڔ೦Ԯǿࢰ@ƦŏԮƨƨȄƧ۬ɜʶڔŐɚɚóŐôƨ߼˜ôƧƧó̐ƥóŏѺǿƦȁφƧς˜ƨƧ̒@ɜƥƦυ̐ɛƪͩƩəƪʷ̑ə@ȃƨʵנŋྸōਚԭԪ—@ɝƨŋ̒օςʵôƧ"],encodeOffsets:[[98730,43786]]}},{type:"Feature",id:"xi_zang",properties:{name:"西藏",cp:[88.7695,31.6846],childNum:7},geometry:{type:"Polygon",coordinates:["@@ôŌנœôʶ̎ͪô™óŎƨŌਚƧ̐ôςͪφ—ɚɝࢰ—݈̎Ѻ—Ѷƨôʶ०ɜਘ˜Ʀŋφ›Ѷȁ̍—ôŏɚŋ@̑ə—@ŏò̍ɜ›óƥôʷƧ̍φѹԪ̍ע@Ѹʷɜ@ôñנ@Ѷɛɞô̐ŏѶƨѸƧƥōƦœôŏô—@ƧôƩ̒ŋƨŌƦǿô̎ɜȁ̒—óʶѶôôО̒›ςƥɜНφσɛȁ̎υƨఱƧŏ@ʵƥœ@ŌóóóͩƨƧóŋ̑õóɞóɝԩͪɝρôƧ̍ƧѹͨڑŎ̑ōóƧࢭͩ̏ѵɝóఱóóԪυô@̒ƥŌ̏Ƨ̑Ȅ݇ŎƧ›ѵӏ@ɛõŏɛȄôӒƧŌѵǿɝ˜Ƨŋԫ@̏ʴƥ@óǿ̑Ȁóǿ̍ςóóυô@ʶɛñρƦƩŐó̎óœѵó̑ͪࢯОóɜן˜Ƨ̏ƥȄ߻̎̏̐ןŎɝɜöɞƩȀôöɛȀóͪ̐ƨƪ̍̎ȂƥԪυО@φɞ˜ôƪ"],encodeOffsets:[[80911,35146]]}},{type:"Feature",id:"nei_meng_gu",properties:{name:"内蒙古",cp:[117.5977,44.3408],childNum:12},geometry:{type:"Polygon",coordinates:["@@ኊȁ૊ö߼ƩɜɛנñԮɛѶóԮô@ȁѸóמ̎ගѺၬ@߼ʶԮӒ߼̎@ŐѹӒ̒Ԫƨöග̑ѶȄ̒ς।œѶɚöɞɜʴڔôôȂ̎—ѺȀς—ƨ˜ƪóԪ—ɜôɛОਕڔԭ˜ѵ̍ѹȂԫ›ɛƥ̍Ȃóɜ̎ô@ʶ݊ੲࢮʵږͪנƨôȂƧ˜̐ͪ@ŐƦƨφԬѶɜôƦ@ŐƧôôƦəŐ̏›@ŐڒѶԬô̐ʳԩНςōôŏɞ@ƨȂѶəóƧ̒ػ̎ó̐Őנóƨô̒@ƨɚɚ@עԫɛɛ@ȁυͩƥʳòևρ—̑ࡗƧͪ༃ॣԮփ̎Ʀ@ôô@ôō@š@ȁѵóƨ̍υȃóʵɛƨƥóυȂóəƪ›̐ρƧͩɜԭڔȄ̎عƧȁ̐ŏó̍ɛ›ƥƧ̑óρŐ@Ƨ̏˜ɝəɛ˜߻ͩ̍ͩɝО̍ƪƧóóӓƨóƧʳ݇@ɝςƪœ@ʴƩ—ƧƦôƨɛȄə›Ƨŋυ›óͩѵ@ɝǿóŌן̍ɛ˜óО̍œ̑̏ôȁ̍ŏòȁñóƦͩ@ǿə@ɛƧ̑˜ρȁυô̍օѹœóȃə™@ȂσʵѷƪòƩ̍—ôó߻ۯôʳƧ™óšõʵѵóѹɜ̍ȂѹôɛŌφֈƩͨρóυӑóޟఱ̑݇ͪóƪƨŌóȄڔԬƩςםñ̑ȃѵŐԭŏƨȁɛǿρôõɚɛóƧОə@ѹ̐ѵöԪͨôͪɛ̒ןŏƧƥóôƥƧɛŌôóɝó@̒݇Ӓ̒Ō@Ŏԭࢰ"],encodeOffsets:[[99540,43830]]}},{type:"Feature",id:"qing_hai",properties:{name:"青海",cp:[96.2402,35.4199],childNum:8},geometry:{type:"Polygon",coordinates:["@@ƨ@ôƪ݈ȁƪ˜@φɝòóƨԮʶɛ̐ѹͪôОəóƧɞᇒѶ@ôږô@ǿѶ›ƪȁςœɜͩφ˜ςŋɞôѶɛƨŌɞ—@ɚςŐñԪॢͩƨȂɞóƨŐ̎ŏעӏ̎óƧƦôœ̒ȁɜ›ςͩ̒œɚɛƨôƨɝφɛóȁƨŋóóɚͩƨóóƩ@ƧəŋƦƩ̍@ƧƧôǿυ̑@ȁɞǿõŏρƥסɚƧóτԫɞœôƧƦ@ñȃòñƥóυôôѹѵ—@ŏ̏Ȅɝó@ȂəŌóəѹƦ@Ő̍Ōυ݈ԩŐƧóôƧ̑›ôʵɞƧ̑ѵôƩɞƧ̑œóНѵóôʵ̑˜ɛȂó̍ƥȀƧŋ̑Ōóƪ@ƨó˜óŐƥ›ƦŎѷƨѵƧ̏Őɝóѵɜן@óòɛ@ѷʸס@ԩ̎υѺƨ̎óʸôƦɛœñ̎@Őɚ˜@̒əŌóŐ̎˜"],encodeOffsets:[[91890,36945]]}},{type:"Feature",id:"si_chuan",properties:{name:"四川",cp:[102.9199,30.1904],childNum:21},geometry:{type:"Polygon",coordinates:["@@ô˜ôŋó̑Ԯ̒ɛОמͪƨōöͫ߼ƥôȃƨóóñôƧóƧôōڔŏƨŐ@Ŏô˜òƥѺŎ@ōɜóנ˜ôǿô›ƦôԮ̍ɜôɚ›Ƨ—ñɛɚȁ̍Ƨɛևυ@óóôŋρԭɝ@Ƨʸ̍ŏυɜƧƧóƧƨȁρ̍ƨȃɚ—ôʵφóô̑̏Ȃ̑ʵɜʵɞ@ƨʳסƩóŎə—óɜƧôƩƧρ˜óôôô@ŎƧƨƨƪѹ˜ó̍̍Ʃ@̏ѹНôޟ̍Ʃóƪυɝɛ—əƨôŎɛȀ@Ȃ@ñɝʶ@Ōρנ̏—õóɛͨƨȂѵОɛʵ@̏ƩŐó߼Ƨల̍φɜȂυτɛОρƦɝƨóƪ̒Ѷɝƨóʶ̒œóƨƨôԪŏφ݇̎ŋ@ŏѺƥôɚɚŋ@ȁɞô̐ȃ@ŐѶ˜óѺφóƦôñòòȄ"],encodeOffsets:[[104220,34336]]}},{type:"Feature",id:"hei_long_jiang",properties:{name:"黑龙江",cp:[128.1445,48.5156],childNum:13},geometry:{type:"Polygon",coordinates:["@@ᇔȂਚНƨŐѶŏöƥςŏñƧƦóƨȁ@óƨ—óȁφӑóóƨ˜óǿ̎̑ôНɞ—ó̑ɜə߼›̎ǿ̒ôڒӑφ@Ƨȁ̎̏ƥƩ̎ρశ˜ôȂςƨφ@נɞ݈˜̑ƥƧɛƨʵƧȃƥ@Ƨƥ@ŏ̑ԩôɝρρóɛƧ›ƩͩƧó߻ʸ̍ʷѹƥɞڕõ̍öɝυ—̍ȂƧ̐̑ŏóƨñŋѹóóȁ̍›̏Ԭõʸ̏ŏ@ǿ̍@ƧОυ@ñƨòȀƥŎ̑ŐѵóɛŌóȂԫōƧŎѹñ̍ʶóОן@Ƨ̎Ѷô@Ȃ@™óŎó@@ó̍ƥԭք༄।ƨͩ̒ࡘς˜ñֈƦʴφͪ@ȂɜɜסԬə@Ƨə̑@Ƨóןô̏ŏ̍ô̑ؼôƨѵɚƧȁɝ@óŐρŎԪО̏ʴ"],encodeOffsets:[[124380,54630]]}},{type:"Feature",id:"gan_su",properties:{name:"甘肃",cp:[95.7129,40.166],childNum:14},geometry:{type:"Polygon",coordinates:["@@ڔôԮࢯ@ō̑ŋ݈ӑ@̑ɞôóôɜŋƦƨôóƨƦנŐɜ̑óͩԩͧѶõѺ̏ɚ@ƨНɜôöəςóɜȀƧȂԮŐѶŏ̒ȄמòƪρړԫôȃƧŋôƩ݈ͩɚ@@ǿɜ@φͩóŏɜӑƧōôǿ̎›ôƥƪóõ›ö@ô—ƨ˜ôƧƦôó̒ɜ@ɞŌõʶ̏Ő@ȀóôƨȂ@ʶע@@ƥ୾ӑó̑óŋôʵóɛړ@@ƩöóƩóρ—ɛƨ̑@óʷƥƥ̎ɛƧ›ôōƧǿôͩѵôɝȃɞȁõƧρóó—@ōƧŏړŐóŎôƨóƨôòƧôóȄ߻ƦõͬƧŎםͩɜНԭ̑ô̒óŌó—ƥ@óƨɝ›σԬƨôעəςƦöŐɝȀ@Ȃφ̒óȀƨƨ̎@ƥƪɚŌ@ƨôƪƧôəͪôôƧŌôȂυɜƧɞƧóəɜ̑›ρͪɛœ̑Ȃó›ƨƥ̍ôסӐ̍ŐƧŏɝôƧȁॡͪòԩρŏ@əɝ˜ƧŋѵɜɝóρŌυ—ɛͪρ›ƩȂѵœ@Ȁڕó@ȄɜʶφࡔڔœƨͪѶͪԬʶôƩעʶɚʶƥôóƨςȂ"],encodeOffsets:[[98730,43740]]}},{type:"Feature",id:"yun_nan",properties:{name:"云南",cp:[101.8652,25.1807],childNum:16},geometry:{type:"Polygon",coordinates:["@@ôɞôɝ̒öôŌƧƨôͪôô@ŋƦ›@ʶƨŐô߻ƪŏ@̐ɜʶѶНƧȁɜͧöô̐˜ςן@ŋɞʵ@ò@ȁɜǿóōɚƧɜ˜φɞôƩ̎ƪóޠѺО@̐̎ƪô̎Ѻ—ƧƩƨƧ@ōóóôóς—ƪƨƨóôɛó̑ԭ—ƥŌɛǿɝƨɛͩô›@ǿƨȁѺŌɚɛ̍ןѶНɛƧôóƥȁƦͩôŎɞ—ƨ̑ɜ—òôφ@ƨʵ@ɛѹōóȃəƨυǿóʵρƧƧŌƩɛ̏ȄñƧƧȀɝ̍ԩʶƧ̑υ—óŌƥʳɚӑóНƥô̑›óӒѵʵѹœƧӐןôƪφõŌƪ̒ԫŌƧؼƨƨס›ρȁƧœƨȂóʶó@@ʴƨôôφ̎Ŏ@Ȁƨ—ƪɚƨœóƨôôôςóޤƧŌƩŋƧԪ"],encodeOffsets:[[100530,28800]]}},{type:"Feature",id:"guang_xi",properties:{name:"广西",cp:[108.2813,23.6426],childNum:14},geometry:{type:"Polygon",coordinates:["@@ƦŋѺ̎ڔʵƨŐ@ƦמȄƪôóȂɜŌɚͩɜ@öóɜôôȂƦôɜȁ@ɞφ›óȄ̎›ƨʶɞŋƨʴɚǿ̐̎Ԭ@ôñ@̏ƨ›ρ۫ô›ɚƨƨНƪŐ̎›ƥóƦʵƥŋ@ȃóƥƧ@@ŏɝǿôυƧȁѵɛ@əóŏ̑@@ə̍›óƧó—@ȁƩ˜ρóòНƥô@Ӓ̑@óŎ̍ƥσŎυ@̍ƨ@Ō̑ôóͪƨ̒óŌړœ̏Ŏ@ŌôȄѺŎ@ɜƧʶυ@ñóɛ˜Ƨ̒ɝ˜óōƥͪ"],encodeOffsets:[[107011,25335]]}},{type:"Feature",id:"hu_nan",properties:{name:"湖南",cp:[111.5332,27.3779],childNum:14},geometry:{type:"Polygon",coordinates:["@@@քɜОƨ@öŐמóƪôƩɚ̒Ő߼ȁςͩɜòƪ—ɜȀò—ñɝò—Ѻͪ@ŏƨŋóɝôǿƨ™ɚȃóəƨȃѵͩó̍@ȃƨóóƥƨƧ@ʵƦ›óͩɜ—ɛóñԭɛōυȂ̍ƧƦō@ɛƥ—ɛȀ̑œóʷóō̍œƩŏƧОəƧóœς۬Ƨœ@̐óòԫ@̏̍əȀƧʳɝŌóɞƧ˜ƨɜóŐƨò@ȄƧŌρŋóôԪОóʶ@̎óȄ"],encodeOffsets:[[111870,29161]]}},{type:"Feature",id:"shan_xi_1",properties:{name:"陕西",cp:[109.5996,35.6396],childNum:10},geometry:{type:"Polygon",coordinates:["@@ςôöƨɝȂɞȄѶóóͪƨȀóŎƨœ̍ɜƦƦôʸ̒@ɜƧς˜ƪôõô@ƪڔ@ôɜóʶôŌô̒୽Ӓ@Ʀ@Ѻ̎ɜѺɛѶôöʶô™ƨšóʴ߼۰óô̎˜ñƪѸƩτʶ@ȁòŋəѹóǿ̑ʵ@ȁ̒ʷυփô݉ôН̏ط@ȁƨóô̏ƪõ@ʳ̐ʵ@ɝɛŋƩŌɛóןôƧŋ̒ó@ŏ̐ƥ@ŏυ@ƧƧôן̏@ƥȂѹɜəœɛóԭ̎ƥóóœóȀן—ɛô@ŎѹōñƦ"],encodeOffsets:[[108001,33705]]}},{type:"Feature",id:"guang_dong",properties:{name:"广东",cp:[113.4668,22.8076],childNum:21},geometry:{type:"Polygon",coordinates:["@@@Ȃô˜ôƨ̎œ@ɚ̒@ôŐ@ɚѶɜƨȂóφɞȀ@Őƨ@ôƦ@ȄƦŌƥʶƦôôŎôʸ̒›ɜǿƦ˜@ɜƥŎ̎ƨφȁɜŎòƥԮŎƨōóŏɛƧɝəɞƧ߼ɜςȃñȄƦŎ̒ōôòƨəƨ˜ɚН@əƨ̏ƪʵυŌəɛóəԭŏəœóŏѹœρʵɝƦ̏™ƥʳѶ›öō̑óóŋρȀυƧƥɛѹōƧôן—ɛŏѵ@óŋôʵɝ›ƪԩõ@Ƨō̍@Ƨ@@ƦɝԮƪО@@","@@X¯aWĀ„@l"],encodeOffsets:[[112411,21916],[116325,22697]]}},{type:"Feature",id:"ji_lin",properties:{name:"吉林",cp:[126.4746,43.5938],childNum:9},geometry:{type:"Polygon",coordinates:["@@נ@ôН̎ʵѺòƨōԬŎôȁɜŋѶô̒ŏƦōñǿòƧφ@ƨН̎@@Ȁ̐Őöʷ̐ԫ̎œôȂѺôòŌôƧ̒Őƨ̏̎ȁφ˜@ŋƩͩםȃƨ—@ȁ̑ʶ@Ōóôɛœƥѹ̑—συ݇@ɜρƧȃࢯƨôœəȂɛōƩɛ̏υρóõœƪʴυφ@ʶôŌóœρք@ɜƧ@ɝǿƧͪρȀƩó̏ŐƨȂ̍غړȃɛԮƨͪ̏ςƩœôɚφȁƦôɜƧôʶφȄ"],encodeOffsets:[[126181,47341]]}},{type:"Feature",id:"he_bei",properties:{name:"河北",cp:[115.4004,37.9688],childNum:11},geometry:{type:"MultiPolygon",coordinates:[["@@Ʃ̒̏ŌѺ̒Ʃ˜óȄƧŌƥͪòôñȂ̎ŐóȂ̒̐̎›ôНɜ—נ̎ôŋɞȀѶ@ôͪφœƨŌɚœɜȃóƧƨƥƪ˜@ʳƩ›ɞρ݈@υНφʵɜ˜ƦρƨƧ̍ɝóɛѹ̍ρŏ̑ôóƨ@œƧƦôƨɛ@ƥƨ@ȂƦ@@ôəŐƧʶƨŌυœ̍̎ɛŋôōɝ@óƧ̍›ƦʵѵʳôʵɜŏςôƪŋƨŌɚ@ôНƥƧ@ōѸɛ̐ô̎ʵѵНԭ@̍̍Ƨò@ȁɝ@əρυͩƪ̏ƩõƧŎƧōóšॡȄɛʶɜȀ@ɞςѶƧœƥςɛŐ@ɚɜɜ@Ŏôôςœƪς"],["@@õə@Ƨɛ˜@ŐóƦφô"]],encodeOffsets:[[[117271,40455]],[[120061,41040]]]}},{type:"Feature",id:"hu_bei",properties:{name:"湖北",cp:[112.2363,31.1572],childNum:17},geometry:{type:"Polygon",coordinates:["@@ñȄυƦöŐƩ˜óנƨƨφ@@Ő̏Ʀ@Ő̑ôƨŌנóɜôƪŋɜŌѶօڔə݈òɞōɜŎôӏƦóƨô̒óôȃƨó̎ŐôƧƪ@ƨȁςƧə̑̎Н@̍Ƨŏρôԭͩԫ—̍ʵƧšóȀôɞƧŌ@Őѹͩñ˜òɞñ˜ɛǿƩ˜ɛñρͪ߻Ȃ̑ŏƪəƩóםôõŏƧ@ɛНƥȄó›̑ѺƧ›ôφóƨƨƦƪóɜŐôóòôƨóφ̐ƨóƦ̎"],encodeOffsets:[[112860,31905]]}},{type:"Feature",id:"gui_zhou",properties:{name:"贵州",cp:[106.6113,26.9385],childNum:9},geometry:{type:"Polygon",coordinates:["@@ɜȀƦŋԮ˜ô̒ɚ˜ôōעƪƧʴɝ@ɛʶ̒ʶ̐ȁƦœóȂô@ôŏ@ōô—ƨʶѸô@ʶƨ˜ɞó@ōτöòυƨ@@əƨô@ɛ̒@Ʀɜôȃ@̍ôʵԩНôóςŌƨŋ@ȃƧñôŏƧɛƨ—ôɝƧʵ̍œôȃυœ@ɝɛȂƥóóȁɛóõôɛ@əͪɛŋôȁƩóםȃ@ƥƧŏړʶѹ̍ƥŌƦȂóôɜƨѵО̎נəɜѹŋƧȂ@ȀóœɜͪɞƧ"],encodeOffsets:[[106651,27901]]}},{type:"Feature",id:"shan_dong",properties:{name:"山东",cp:[118.7402,36.4307],childNum:17},geometry:{type:"Polygon",coordinates:["@@Ʃ̐φͪɚςɞ@@Ȃƨñ̎̎Ԯ@ѶОƨƧڔ@φН̑ŋ@Ʃ̒ǿ̎@ƨɜԬςôʶ̐ʶöԫƨƧנƥɜŎôō̎@ôŏóρƧŏԫôóƧԩó@ƥɜƧԭóƨʵɛƨ߻ӑɜНԩ˜óô̑óƧʳə™óɛƧ@õȀƧœ̍ȃɛŐóŏυО̍—óɝƩ—ԩ@ƧɚԫȄɚʶƨ˜ɞʶԪ̐ړɛƪ̒"],encodeOffsets:[[118261,37036]]}},{type:"Feature",id:"jiang_xi",properties:{name:"江西",cp:[116.0156,27.29],childNum:11},geometry:{type:"Polygon",coordinates:["@@ƧȄôɚəȄ̎ʶԬ˜ԮͪςóƨŐƪ›τɞƦōƥƧ@ŏςôóŐôô̒ʷѶ—ƪƩƩǿ@ō̒ɛôυ@—Ƨȁѹɛəƨѹ̑ƨ̏óƥѵʷô̍ɛȁôŏɝǿƧԫƧ›ôʳƥōòȃρȄ߻ɛɝƨɞɚɜƨôŐƧŎԭōñƦòԮɜôɛ˜ôͪƥœ@ʶƧƨôƦƧô@Ȅô̎Ѷͪ"],encodeOffsets:[[117e3,29025]]}},{type:"Feature",id:"he_nan",properties:{name:"河南",cp:[113.4668,33.8818],childNum:17},geometry:{type:"Polygon",coordinates:["@@φ˜̎ƪ̐˜ɞȄɚ@@Ȃעó̎ŌѺ̒ôֆॢȃô™ƨŎƨōƪöƩ̑ڔɜԩ̏ɝʵƧ—əʵԬȃƨəԪ@@Ƨ̒ŏô̍υȁƧɚ̍ôóŋ@ɝƧŋõ̑σ—@ŏɜŋôɝ̒ƧɚôôطρóóɛƩ@óƨ̍ŏƧôóȄ̑ôƧóƥôóӐɛōɝŎ݇ñړɚѵֆ@ɞ̏ʶ@ʴƩöó̐"],encodeOffsets:[[113040,35416]]}},{type:"Feature",id:"liao_ning",properties:{name:"辽宁",cp:[122.3438,41.0889],childNum:14},geometry:{type:"Polygon",coordinates:["@@ƨʴƧôôӔƨô̎ƩɞН̎ͪ߼ͪɜ—ɞɚ̐—@ƨςŏ̒ôƦƨɜœô̎ƪôςǿƨͩɞȀƨ@@ɛςփô›óŋ@ʵφυƩʳö›॥փρѹס@əɛ@ͩࢯ@ѹʵρ—ƩʶφȀƧ݈̒۬óʸɝŎѵ@ԭԫןɛƧƨƥςɛ—υʶφО"],encodeOffsets:[[122131,42301]]}},{type:"Feature",id:"shan_xi_2",properties:{name:"山西",cp:[112.4121,37.6611],childNum:11},geometry:{type:"Polygon",coordinates:["@@ɚѺñŌɚšôȄѺ›̎ֆφóςȂ̒—ɜƨɚ@@Ȁƨŋôȃƪ—ѹ̑̐ŋƪ̑Ʃρρ›óó@ōɛɛ@əɜŏƦρƨ›ρѵ@ɝɛǿɜʵóօѹ̑̍ŋסô@ȁə@ɝȃ̏—̍Ʃυ—Ƨô@Ȃ̐ظóОó݊φք̑ʸ@Ȃ̒ʶôȀ"],encodeOffsets:[[113581,39645]]}},{type:"Feature",id:"an_hui",properties:{name:"安徽",cp:[117.2461,32.0361],childNum:17},geometry:{type:"Polygon",coordinates:["@@ó̎̑Ő@ƨƪ˜Ѷǿɜ̑φ—Ʀʵ̐˜Ƨѵôóƪôôυς—ƨȂɞŏ@̍ԫôò̑ƥ—óȃѶͩƧƥôŏѺœôŏƦ—@›ƥͩƧ—ôȁυó@̑ƧɛѵʵƩƪѵ˜̑ʸóóôŏρó@ŐƦƨƥŎσɝƩœ@̎̍Оɚ̒ρƨƧȂôɜςôóظəó̑ƨóɞɛŌ@Őτ˜ö̒ƨŌ@ɞôŌ̎óƨəφȂ"],encodeOffsets:[[119431,34741]]}},{type:"Feature",id:"fu_jian",properties:{name:"福建",cp:[118.3008,25.9277],childNum:9},geometry:{type:"Polygon",coordinates:["@@̎›óȁƨӑ̒—̎ɚƨͩφŐƨɝ̎ŋóŏρ—@ōƨ›òʳəóƨō̏˜õɛƧ@ƨѵƧōəŏóŋƧô̑ɝɛʳƥ@@óɛõ@Ƨ̑ƧóȁəƧ̑—Ƨ̐@ɚəОƧ—Ƨɚóñ̑ŎóʴƨœƨԬɞȀóŐɜȂó̎ѶʸôƦƧ̐Ѻ̒ɚƧѺɜƨȂ"],encodeOffsets:[[121321,28981]]}},{type:"Feature",id:"zhe_jiang",properties:{name:"浙江",cp:[120.498,29.0918],childNum:11},geometry:{type:"Polygon",coordinates:["@@Ѷʶƨɜ@̒φôóȂƨ˜Ʀͪ@œ̐˜Ѹ̍τȂ̒̑נŐמôƪƧôӑ̑›@ƥρͩƨօ̏@@υɝó@ŋɛ@ôƩəóƧѵυó@ƩɜŋƧ@̍ŌƧɞυŏƧͪ̍ə̑˜ƧӒôȂ̍œ@˜óφ̑ɜ@ŎƪȀ"],encodeOffsets:[[121051,30105]]}},{type:"Feature",id:"jiang_su",properties:{name:"江苏",cp:[120.0586,32.915],childNum:13},geometry:{type:"Polygon",coordinates:["@@ôɞ̎˜φНôŐɜŏ̎Ȅƨ›öǿƨ@ôɜɚšƨʴ̒ôôó@Ƨ̎əԮȃԪૉöͩ̐ƧòʵφƧôʵ@óړɜóŏɜǿƧ›ɝρσȁѷ̎̏—ƥ˜óŐѹ›óŐƨƦѵͪôȄƦ˜ñ̒Ԭó@̎ɝŐƧȁρ˜óφƩóóôƨѶ̏—ƥʶυ˜ɛ̒ѵȀ"],encodeOffsets:[[119161,35460]]}},{type:"Feature",id:"chong_qing",properties:{name:"重庆",cp:[107.7539,30.1904],childNum:40},geometry:{type:"Polygon",coordinates:["@@əȂòɜƨ˜ѺɛƦȁ̐@ƪ—õŏφƥòȃƥ̍Ƨôυ̏ƧôñóóôɛŏƩôƧƥôƧóυƨœ̒ѹôœƦȃ@փƥɛ̑@@ɜƧó@ɚƧ@ñφσõ@ŎɝôƧ—@ʵѷóƧʵó˜@ŎóŐó@ôȁƥ›ó̒υôóʶə˜ƧȄς̎ƧȂôƨƨƨφɛ̎Őƨʷɞ@ςԮóŌôôφ@ɜֈ̎ƨ"],encodeOffsets:[[111150,32446]]}},{type:"Feature",id:"ning_xia",properties:{name:"宁夏",cp:[105.9961,37.3096],childNum:5},geometry:{type:"Polygon",coordinates:["@@ల̒ôޠφӒςôƪͧυևɜŋѺó̎ȁ̍ɛ@ѹס@@ʵƧȁôó@ǿ̐ŏöʵɝŋɛ@ô̑ƥóóƨƧ—ó˜ôœó@ƩôóƦ̍œóȀƨŎɛӒôŐυͪɛ@@Ȁə@"],encodeOffsets:[[106831,38340]]}},{type:"Feature",id:"hai_nan",properties:{name:"海南",cp:[109.9512,19.2041],childNum:18},geometry:{type:"Polygon",coordinates:["@@φɜƦʶ̐ôφô̎@ƨŎö@τʵƦ˜ԩ۫õН̏óƥȃƧ@Ʃəםƨ̑Ʀ@ޤ"],encodeOffsets:[[111240,19846]]}},{type:"Feature",id:"tai_wan",properties:{name:"台湾",cp:[121.0254,23.5986],childNum:1},geometry:{type:"Polygon",coordinates:["@@ô—ƩɝöƧɝѵəޣ̏ρƩԭóōóͪρɞƧОôԪ݈ଦѶɜ̒ɛ"],encodeOffsets:[[124831,25650]]}},{type:"Feature",id:"bei_jing",properties:{name:"北京",cp:[116.4551,40.2539],childNum:19},geometry:{type:"Polygon",coordinates:["@@óóó›υóôƥ@ŏóóə@ƧŋƩŌρóɛŐóʶѶʴƥʶ̎œôƨɞ@óŎɜŌ̎̍φ›Ƨŋƨʵ"],encodeOffsets:[[120241,41176]]}},{type:"Feature",id:"tian_jin",properties:{name:"天津",cp:[117.4219,39.4189],childNum:18},geometry:{type:"Polygon",coordinates:["@@ôôɜ—@ƨöɚôœôôɚŏ@óƥ@@ȁƦƧɜ@óƧƨƥ@›ƧóəН̏óѷɜ@ŎƦƨóО"],encodeOffsets:[[119610,40545]]}},{type:"Feature",id:"shang_hai",properties:{name:"上海",cp:[121.4648,31.2891],childNum:19},geometry:{type:"Polygon",coordinates:["@@ɞςƨœɛȀôŐڔɛóυô̍ןŏ̑̒"],encodeOffsets:[[123840,31771]]}},{type:"Feature",id:"xiang_gang",properties:{name:"香港",cp:[114.2578,22.3242],childNum:1},geometry:{type:"Polygon",coordinates:["@@óɛƩ@ρ@óœôȀɚŎƨ@ö@@ōƨ@"],encodeOffsets:[[117361,22950]]}},{type:"Feature",id:"ao_men",properties:{name:"澳门",cp:[113.5547,22.1484],childNum:1},geometry:{type:"Polygon",coordinates:["@@X¯aWĀ„@l"],encodeOffsets:[[116325,22697]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/chong_qing_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"500242",properties:{name:"酉阳土家族苗族自治县",cp:[108.8196,28.8666],childNum:1},geometry:{type:"Polygon",coordinates:["@@XJ°œlJX@lbl@XbV@VLnJlxnbšƒUU@IVK@lVIVwnJlU@n@J@L@Jn@l_nWVLVln@@blLšmV@@xœÔ‚`nœ™xV‚ÈLlx„LVxVVšƒV_U»VWn_m¥XwVmnX°ƒlmUUVwÞaVƒk@a@mmIUa@™mwk@™ƒm@@U¯a@UV@@K™@ykkmwkV@kU@ƒÑƒVkKWLÅamaUm@kyU@WkU@Ua™IUašVaUUmUUa@aVLXKWa¯UUbmJXnWnX`l@@xkzWÆ@V„LU¦‚x@b@JkIkJ@LmbUamJwm@óxƒnk@V„@x„ŽVnUVmVUVŽUbVlUbkXWŽ"],encodeOffsets:[[110914,29695]]}},{type:"Feature",id:"500236",properties:{name:"奉节县",cp:[109.3909,30.9265],childNum:1},geometry:{type:"Polygon",coordinates:["@@WVXb‚UnK@x@b‚²kxmKkl¯_ƒVV°™VU@bnKVVV@@nkŽ@n›bn‚@š°@VLČUš@°WV@V™nU@InKVl@nU„b˜KnX„WlknLlKUwnalLša„VlUXmWk@UU@UWWIUyķ¹XaWW@X™ƒKUIVm„U@W@UVU@KV@n»VkUkÇmUmVIUmULUbm@ƒwUaƒKkkm¯ÑUL@bWVnx@VmxUI@„klmkkK@aƒK@IlJ@I¯ƒk@mak@mnkJVL@bV@Ub„„W`UUUV™I@VƒU@VVbUJVLUVVbUX„VVxk¦VJUnVxnVVUšJV@Ubl@@bXV@L"],encodeOffsets:[[111781,31658]]}},{type:"Feature",id:"500238",properties:{name:"巫溪县",cp:[109.3359,31.4813],childNum:1},geometry:{type:"Polygon",coordinates:["@@nLWbX‚VLVU„V@KšIVl@b„@lbšU„VnU@JÆU@V@n°KĢUl@VbÞKšVš@„_„V‚KXU‚U@KXƒ@wlkkU@mWKUU@UôJ@XV@œaVmÞIVaVLƒƒ@»kmƒ@ƒUkL™U@aU@WWƒLUUU™™KkbƒwWa@KU@kaƒXmW—LƒamVk@UmL@JmVUšU@¯X™@ċVUK¯@ÅnWK™LkKULWK@UXK@wW@™LkV@bVLƒlXn›`¯xU„°LnŽlV@n°Lnl"],encodeOffsets:[[111488,32361]]}},{type:"Feature",id:"500234",properties:{name:"开县",cp:[108.4131,31.2561],childNum:1},geometry:{type:"Polygon",coordinates:["@@n@na‚I„wš@@VVK„LVbVxnVÆUnanKWXamKmk¯K@mkUm¯KVƒ°w@Wm@UIUUlKUU@a¯KWanwmUXamKkUWUnU@KƒkUwWKXaWLUWkImaUUUƒƒKka±k@lƒ¯w™wmbUƒ™ƒkXm@UJkIW‚XXƒbƒmƒ„UJ™XUV@°šKlšlVXV@xmbnV@blV@VšœU`UL@V™a@bULlb°VXbܚ@V@bƒL@J„xnLVb@lVb@V@@z˜bXWšX„KVLV‚š@@bUVVL@b„„lVna@ll@„zl@@J"],encodeOffsets:[[111150,32434]]}},{type:"Feature",id:"500243",properties:{name:"彭水苗族土家族自治县",cp:[108.2043,29.3994],childNum:1},geometry:{type:"Polygon",coordinates:["@@„Jlb@nVV@bXb@ÆlL„Ul`nVKU¼VxkbW„nlUxlXX‚@°°WnnJ@VUn@J„k°L@VlV@nUJ„x@bVVVz@VnLla„KnalVlIUŽ„¼@nV@@anKUwVal@UlJœƒlI@akU@UWXKVI‚¯Uak@@KmkXWÜkXWykIWwXw@laXamkVUUym_XmlkkmmakwmIUKU@Wak@kaW@kI¯›WIk¦VŽƒUUƒmaUV@XkVUV±aUb¯b¯¥m@@ImJ—@mƒmL@kUKUkkJƒbV¦"],encodeOffsets:[[110408,29729]]}},{type:"Feature",id:"500235",properties:{name:"云阳县",cp:[108.8306,31.0089],childNum:1},geometry:{type:"Polygon",coordinates:["@@lb„LV„VVnblJVXXKWbXLVx„l@LmVXVVl‚nLWbnVmxXb°L@bVVkLVVVJn@@X‚‚œ_Wm„kUK@alUšKX@@xWL@VXLVKlLšKXLÆm@™mœa@ml@mU@UUmL@aVšUU¯„U°`lknLlw±@a@wmLVWaXU@KWU@ak@VaU@™IUVmUUwVmUIl¥UwƒUVWUaVUUKVIUa@UUUUJƒUUm™kƒ„nl@„@VWV@L¯aUb™Ulxƒ@@b@VULUx@VUxVV™U@bU@mxU„U@mUVŽklkkƒ@WxknlxK@amLƒKU„K"],encodeOffsets:[[111016,31742]]}},{type:"Feature",id:"500101",properties:{name:"万州区",cp:[108.3911,30.6958],childNum:1},geometry:{type:"Polygon",coordinates:["@@ĸĊVI„ƒ„n„aWWXlJVIn@lWš„V„našx°xk„l@²Ž‚LVƒ„LnK@b‚LkwlmXw„@lllkUnVV@VƒnwV@@ašVUUVw@UVwVK@U@a„@kwšVVa°b@KXU@U@ƒmk„ƒÇсaml™kUVmn@VULU˜m@kUVkUaƒwUWm@Uw¯„mKUUmVUUULUKU„W@XbWVkaWwkUU™ƒ™k@maUbmbVlk¦ƒxUVUIWVU„kJVVkL@UmJ™UUVU@lLUVU„lx„@@VbƒJ™U™L¯¤@Vƒ„"],encodeOffsets:[[110464,31551]]}},{type:"Feature",id:"500229",properties:{name:"城口县",cp:[108.7756,31.9098],childNum:1},geometry:{type:"Polygon",coordinates:["@@VK@w¯L@m@UÅV@ImVƒU™Vkaƒ@@aUk™J@LƒUUVUKmLmbÅVmUUwUaƒKUL@U™@ƒxJmbm@nVJ@X@VkV‚n™lƒLXx™@ƒb@bUVƒLU`UnƒbU@@ŽmVVX@JX@VLVVšklV—„‚`@bUL@V„LVKn@‚U@„UJkn@lmLmK@X@Jn@mb„nÞWVXnJ‚k„KČÑÆ@VK@knaÜmXlUČW°kôÇƁ@a@yÞ_VmƒUnU@K"],encodeOffsets:[[111893,32513]]}},{type:"Feature",id:"500116",properties:{name:"江津区",cp:[106.2158,28.9874],childNum:1},geometry:{type:"Polygon",coordinates:["@@„InWUUlU@LVašlX@°²lÒXxlK@Ul@@Un@UaVJ@I@W@UƒUUVUwVIUKUa‚UUVwn@Üx@XUlnn‚bœJ@¥VklKUUlk@ynU@kVƒUUVWnI@¥V£VWVIUKU@UVƒa@n@Vm@@nlUaVkUwƒJ@blLkLW@XWmXkmmLn™@m@U@UVm@™„UVUUlakUVa„ƒVkV@@wnaWUk@VwkƒlmVIkUUxmJ@U„™@KƒIkx±V@IUm@K@IUKkbWKUbn„m„@bmVnbmb@xkxUJ@ULW`@bX@WVXL@Vƒš¯„mk¯@UJ@VmLUaWnX@WJ@nkKkxW@UIV@@KkImmkK@UW@XaWIU@U‚ƒIkbWb„xXŽlLVbnV@bWlX@VxVLnl@nÆÞVÜ"],encodeOffsets:[[108585,30032]]}},{type:"Feature",id:"500240",properties:{name:"石柱土家族自治县",cp:[108.2813,30.1025],childNum:1},geometry:{type:"Polygon",coordinates:["@@„š@kl@š¼UbmVXJ@bV@nxVIVJULVVk@@LWbnJVU@bVbUJ@blLXnWV—@mbnV‚@V„„bn@VJVLnaVanbl@„šVšlVXxlbXUWaX@VƒUUVwUUVm@I@WmI@a„mlLœ™lK@alwnUV@kóVaƒÝk@UlbVK@™VU»VUUVWUƒ@U`ULkwm@@KmU@knKƒ»VkJkUmbƒLkbmK@UUyUU@aƒwm@@XXJ@VVLVVUbVnUJVX@K„„k`WXXJWXUbmW@bkL™Um`Xnƒb@JVL@LU@™°VVXKVnUxVLUbmJ"],encodeOffsets:[[110588,30769]]}},{type:"Feature",id:"500237",properties:{name:"巫山县",cp:[109.8853,31.1188],childNum:1},geometry:{type:"Polygon",coordinates:["@@kVƒU™bkKmbVxkLmKkllbV@@LXb„xlašLVšVV„KXXV@@bšVlK„V„@ln@¼°KXa„U@Ulw°JXalIUa„ÝWXW@kVU@ƒVUVWUUUamUw@aVamwn@VUUƒlLXWm£@wÇĉkKklmLUÒ¯ƒWn™@ğ±kwmaWm¼U@@LUV@V@XƒVUnVJ„LWš@‚XXWbĸºVzXJVXV@@VXlWn"],encodeOffsets:[[112399,31917]]}},{type:"Feature",id:"500102",properties:{name:"涪陵区",cp:[107.3364,29.6796],childNum:1},geometry:{type:"Polygon",coordinates:["@@nèVblĖVVnLšŽ„@šx‚V„n@nšJ@L„UVVX@lbUJV@@nn@VVVK@z„˜V@nzVJVUlmX@@_VVVbnaVal@@knW@wnaƒVK@aVI„J@£kUVW@‚wXUVJ„amƒ@Ikƒƒƒƒ_X¥ƒ@WwkKkwmŽ™šƒkUxƒnÅmm¥™WV@Um@UlVL@JU@@Xƒ@UVkKVk™KVk™Kkb@bmJVXU„VVUbU@@`W_UV¯b"],encodeOffsets:[[109508,30207]]}},{type:"Feature",id:"500230",properties:{name:"丰都县",cp:[107.8418,29.9048],childNum:1},geometry:{type:"Polygon",coordinates:["@@Þè@XUK@LlV@blbUJ@„„V@bnV‚@VVVXU@ƒlbXal@VXnKV@maXUރ@amk@aVKXV‚anbš£°mnIVaUKVwUmWLUUš¯V@@KUK@I„aWmn_šVlK@anXVaXWWIXWl_ƒƒ@LUWVIUmVaUUUK@UWI@Wn@VI@mkU@U¯Kƒl@ImVÅLƒwU¤óbUU@wWXkmm@LU@@VUIWVUL@JUnƒaƒx@Jn„ƒbUIWVx@ŽUXlV@¤ƒIUJ@bUL„Žmb@xmX@lk@UbmbUaUU@`W@kn"],encodeOffsets:[[110048,30713]]}},{type:"Feature",id:"500232",properties:{name:"武隆县",cp:[107.655,29.35],childNum:1},geometry:{type:"Polygon",coordinates:["@@l„„w„bVm@IVKXUVJ@UV@@KnnWlX@xVVôaV£„xÆKnUVm@UmIXm¯¯@WkWVwmkXƒlaUwV»ULmk_ƒVkK@ÅWa@aUU@mkaƒIƒb@‚n¼ƒnm‚_@mmK@UƒLUVVmI@aUJ@XWJ@U`UIkm±kk@@lULmUmKUnVšnlUVmI@VkVlx™bkIƒVmLUxkKUŽ‚Xš‚n¦Æn„mVw„lš™nlxlLXx„@W¦„`„„"],encodeOffsets:[[110262,30291]]}},{type:"Feature",id:"500119",properties:{name:"南川区",cp:[107.1716,29.1302],childNum:1},geometry:{type:"Polygon",coordinates:["@@VšUbVJVUn@VLX@WVXVVI@VUVWxU@mš@ĊX@@¼V°aVUX`@_V@VaUUVƒUWnI@alašLUlšLUllLVU„@@WV@@IUKVkn@@VlLVwnK„UlJšakwlU@UnJVUmkU™VmXa@wVK@UUw™@VƒVI@akƒ@alInwlKXUmaUW@wWLk™™KVak_ÇaUƒƒV@šXbƒLVxUlWIk@UK@V™@ƒkU@VbUVUlVnƒLUV@lVXmxkV@L@V@Vk@WbUwmL@JUI@xVxkx"],encodeOffsets:[[109463,29830]]}},{type:"Feature",id:"500241",properties:{name:"秀山土家族苗族自治县",cp:[109.0173,28.5205],childNum:1},geometry:{type:"Polygon",coordinates:["@@XlV@lzn@VŽnbÆbXKlL„U„ÒV@@llUnxll@zšŽ@LU@@V°b@Vn@š„l@VÑUƒnK@UšU@aUaƒkVm@K¯wƒklmnn„Ul`nI@almkIUwmWVkUaƒkkJmUUa@K@aU@@_m@@wUyVUUa@Umƒ@awl@Wka±„UkUykIWV™b@bUVk@›aU@UXU‚UIWakUWmUxUV@nUVWbšŽ@XXVVŽmXXŽ@VƒbVLkVWx"],encodeOffsets:[[111330,29183]]}},{type:"Feature",id:"500114",properties:{name:"黔江区",cp:[108.7207,29.4708],childNum:1},geometry:{type:"Polygon",coordinates:["@@VX@V@LV@VJUL@lVnnxlb@VXV‚XV@@W„@UIVK@kUKna@£VWUaVUUalIVJVIUW„_lm@bXKV@mn@J„UUw@KnIVll@VanLVmUkVKXLVKUIVamw@UaU_lw„KlwUWV_Ua@aUa@KUšwm›_›Ó@wU@™nkK@am@UkUKmXk`m@@I@K@I@mkVmIUxUJ@kUL@JVV™„lnklWnn`VzUVnlWbkb@WxXxlJXzWŽÛlWXnl@Ll@Vb°UJWLX@VlV@bkJ"],encodeOffsets:[[111106,30420]]}},{type:"Feature",id:"500117",properties:{name:"合川区",cp:[106.3257,30.108],childNum:1},geometry:{type:"Polygon",coordinates:["@@XKVXlK„ƒVL@UnV@aValXXK„U@WVwUaVU@IV@@aVW„L@U@anVV@@bVK@UVL@bnJWL@VnUnb˜@@JnIlVl‚@@bXIWbn@UKVLVKXLlaV@VVnK@bVL„m„IVƒ@KmknUUWVI@aVJ@_„WU_VmUwƒU@K™ƒVak@am¯mJU_UJUkU@WkIV`UI@JV@LmmU@@mƒbUzś™@„VK@nUKƒ„ƒb™akb@UWK@bkVVbV„Û@@`ƒXk@WŽ@n@lXL@bmb@VVJUn@JnUlnUlmX@`XLlbkJW@kzlb@`@b@b"],encodeOffsets:[[108529,31101]]}},{type:"Feature",id:"500222",properties:{name:"綦江县",cp:[106.6553,28.8171],childNum:1},geometry:{type:"Polygon",coordinates:["@@@¦‚@X„lVX@@UVKl„VUX@lanVlUVbXWVXVƒ„VVUnKVUlwUwU@UJ@nmVkUV™lwXam@VaUUUw@W@kk»mV@UmKkwVKVUU@@LUKVI@mV@XVWxnXVKUUUK@wWU@UUWnUlLXa‚mUI„am@wI@K@amIm‚UUkI@m‚akUkKWUUanƒ@wƒamLVxk@UVmUUL@Vm@kV@I@ak@@bWVXJlLVbVL@š@bn@@`Un„@WbUKULWVXbƒ@UVmbX„WVƒb@bVmxUKUƒV@šUn@V@V@nmšnKlnnWWXX@lKkK@a„IVxUlVb‚k@mn@@U@m„bVUV@VLUJUXU¤"],encodeOffsets:[[109137,29779]]}},{type:"Feature",id:"500233",properties:{name:"忠县",cp:[107.8967,30.3223],childNum:1},geometry:{type:"Polygon",coordinates:["@@VLÞĊ„U@Wš@¼V‚„@lk@w²mlšVUœ„llšVnI@VlKUUlIVƒXUVJVU„wl¥UkUKUIm@ƒaUƒ@mUna˜@XUWmkK@aVIUa@aUVmIXa@Kl@UUVKUIUJmwU@@aWInUVa™»k@@lƒ™¯n™¤mabWUUL@bnl@b݄WVnbU@mLUWk@Wbka@„WVUU@UmUmVkUULV„lVUx„l@L@VƒbÈÒlb"],encodeOffsets:[[110239,31146]]}},{type:"Feature",id:"500228",properties:{name:"梁平县",cp:[107.7429,30.6519],childNum:1},geometry:{type:"Polygon",coordinates:["@@XLV@VV@b°°nšƒnkb@bƒšnJWVXblIUVšxWnUJnVVLVU„JlUnLVK@UnUVJš²nKVbVKla@aXlJ„k„Klb„ƒ@U°£šKšV„IUa@ƒ@kwVƒVUkKV@VUkk›ƒUVk™±n@xklƒ@U@»™‚@XƒVÝĉUJnxWb@UX›KkVUbUKWUkVmkkLU`›b"],encodeOffsets:[[109980,31247]]}},{type:"Feature",id:"500113",properties:{name:"巴南区",cp:[106.7322,29.4214],childNum:1},geometry:{type:"Polygon",coordinates:["@@nxnVlJlUXLƒ¦@x@Vl@nKVVX@V_V@@KlVXU„@lKlxXIl@ÈĊ@Vl@n_VJlŽnVlnb„²VVVJVVmUUkĕUamçU@»W@@ĉn™V@XwVU@UUJWUXUW@UKm@UVUIVaU™UVmLUVƒUU„UWWXUakVmUkbW@UVkƒUL@VW@kUWƒ@mJUXVVU„@lmV@zklVVkLUl@¦›I"],encodeOffsets:[[108990,30061]]}},{type:"Feature",id:"500223",properties:{name:"潼南县",cp:[105.7764,30.1135],childNum:1},geometry:{type:"Polygon",coordinates:["@@@a@a@_kalyX@lIkaWK@_nWVkkmmV@IVmUI@Una@aWK@k@mkbWaknmJUk@mk@@kUal@Uaš@Wa@aXLlwUKlkkƒ@KmI@VUJ@Lk@@VUUmL@amJU£kKUaWakLmU@bVVUbnbWV@xkL@bUb‚xUxVbXJVbUVWIUVU@kLWxkKWV@n¯VUbU@@VVX@VmaUL@VUK@VVbn@lVnI‚@@lnLULm@Ub@Žl@na„@lK@XVVkJ@b@zl@@VnV@bVb@J@bnXV`lXXmVI@W@InbV@@aVKUblKVLUanLlmnLlK"],encodeOffsets:[[108529,31101]]}},{type:"Feature",id:"500118",properties:{name:"永川区",cp:[105.8643,29.2566],childNum:1},geometry:{type:"Polygon",coordinates:["@@@b܄nWVLX„lxV„VxXxlVn@@bVblK@a@UnLVJV@@UnLVU@VXaVKVXš@n`WUÿ@IUKlaUUUkWyUÛÅÝ@mmkUKUwW@Xk@amUUakKWƒwXaƒK@VVLklƒXVlkxV„UL@bm@Vxn`ƒIVxUVkLVšUšl@@lkXmmƒVUn@VV@Xb"],encodeOffsets:[[108192,30038]]}},{type:"Feature",id:"500231",properties:{name:"垫江县",cp:[107.4573,30.2454],childNum:1},geometry:{type:"Polygon",coordinates:["@@šĊ°¤nҘ¼œaV_lKnllUXVVLValUœLVW‚@XamwVIUKkaÇфa@U@KƒkVwkUUƒVKlVnU@aƒU@ƒVIka@akU@KVL@WÝçUV@Vmbů@L™KƒnnJW„ƒVkxlL@VX@VxmnXVWxUb@bkn"],encodeOffsets:[[109812,30961]]}},{type:"Feature",id:"500112",properties:{name:"渝北区",cp:[106.7212,29.8499],childNum:1},geometry:{type:"Polygon",coordinates:["@@@bVVXL‚a@lnbWn@L„@XVlK@VVLUVlbkLUKVVVL@VšnX‚VL@VV@UbVb@x@¦UxVb@bUJƒL@L„VVxlK@™nk@U@W„UVLlKXV„@VblU@UUKVU@wn@VJVanLlkX@VaVK™¯@a@U@U@ƒVaUK„kUUƒ±maUkm@UUkbm@@Vk@@JƒwU@Ub@I@JmwUL@aƒ@@KkVÇLkƒWkƒ@kUU@@xUVmKUnllUb"],encodeOffsets:[[109013,30381]]}},{type:"Feature",id:"500115",properties:{name:"长寿区",cp:[107.1606,29.9762],childNum:1},geometry:{type:"Polygon",coordinates:["@@VVšU„bX‚lX„¥l@XnVmlxUx„@@blVnnôĀlm@aVaXwWUnmUwW@@UkKlw„UXƒmI„mšL@KÆ°na@UUImyU@ƒ—@yULUUm@@mU@VIkaW@UUƒV@K™I@mƒmU™wƒ@™mKUnU‚UIƒlVLUb@„@V@V@bš°ULUbW@klmKUbUIm@@xUVVL"],encodeOffsets:[[109429,30747]]}},{type:"Feature",id:"500225",properties:{name:"大足县",cp:[105.7544,29.6136],childNum:1},geometry:{type:"Polygon",coordinates:["@@XUmaVaUU@anVlKXbValU@aV@@IXKš@@bV@VxVK@UXLlUšJXa@_‚@@aVK—ÅWVkwWaƒƒwUa@am@kUWLU@kWmX@ykI@W@UV@na@LlLV@UƒkwWƒUKmXX`mIVl@bXLWVkbkkƒx@`VXm@@J@U@UUKUxk@WbUIVl@VXLW„ƒJUkUlUImxXlmb@X@VUJUnVbšW@UV@@VVX@bnW@LVxUnlJUV@n„@VxVIn@l`„UVVVL"],encodeOffsets:[[108270,30578]]}},{type:"Feature",id:"500224",properties:{name:"铜梁县",cp:[106.0291,29.8059],childNum:1},geometry:{type:"Polygon",coordinates:["@@VblLV¤nI@bnKVV@Ul@@KVI@UnJ@Ll„klVLkxWK@bXb™@Vbk@Vb@ll@@nVlnIlmXblaXl@„W@_Ü@UƒUalU@aXL@Vlašb„a„ƒVL@mUL@ƒUUƒƒÇXUW›X_WaƒƒUƒ»m_™@UWULWb@UUVmK@VU@UImK@V@bkL„x‚„XblxXU˜ÆUL@b@@`Wb™IkVWK@VULUwU@@a™@WL@JU@@bkVUb"],encodeOffsets:[[108316,30527]]}},{type:"Feature",id:"500226",properties:{name:"荣昌县",cp:[105.5127,29.4708],childNum:1},geometry:{type:"Polygon",coordinates:["@@VI@U@WnaWknwVJVkVl„IXƒWK@UUkVJXal@VwVL@V@V@In@UW@_„wlllaXUWK@aUknJW_ۃ@aWaU@@UVm„UUaUImJVnÅUmVUm`kUUVWLnVU@VVmXƒK@„nxmŽULkx™ImJ@nU`@X@Vkn@`@nlV@nVJVaX„VLnK@bVV@nV@lbXWš@"],encodeOffsets:[[108012,30392]]}},{type:"Feature",id:"500227",properties:{name:"璧山县",cp:[106.2048,29.5807],childNum:1},geometry:{type:"Polygon",coordinates:["@@XzVlVVkbVL@JVĀXŽ‚¼V„„„XbW`XœWVȎ„„VVšŽVkV@@UXa@alK@IƒƒU@UKWUyUI@wVUUWVak@VUkƒW¹@WXI@yVIUK@kWwkѯ±W@™kUb@KkVVVmXƒJ"],encodeOffsets:[[108585,30032]]}},{type:"Feature",id:"500109",properties:{name:"北碚区",cp:[106.5674,29.8883],childNum:1},geometry:{type:"Polygon",coordinates:["@@X‚VLV@„„@JkL@bWb@VU@UlƜVy„a@nV@nn@KU@IVJU_lJXV@VlVIV`nIn°@b‚lUbš„„KVI@aUaVw@¥@wUaVaU@@UUKW™m@UUKUUVLlKkaVUUK@UkLWUƒ@@KXmma@kbWKUU@aUamLnÞ@VWLk@@Wm@ULU@@U™KUVWI"],encodeOffsets:[[108855,30449]]}},{type:"Feature",id:"500110",properties:{name:"万盛区",cp:[106.908,28.9325],childNum:1},geometry:{type:"Polygon",coordinates:["@@VIV@@wVJ@InKVxXal@@U@U@KlUnwUW@kVU„KUmVkUa@I@KW@@bk@@mƒU@m@k@a@aƒIUxmJk@ƒwULƒwkKmVVX@VXV@xVLVVULmWXwWUU@@nUJVL@KV@UVULlxnL@VnUl¼@l@XVxVVUbn@WbkxUšlVnU@m"],encodeOffsets:[[109452,29779]]}},{type:"Feature",id:"500107",properties:{name:"九龙坡区",cp:[106.3586,29.4049],childNum:1},geometry:{type:"Polygon",coordinates:["@@XK‚L@Vš@XbV@lW@UV@@VXIV@U™VKlL@KnnJ@VV@VU@I„@@mVUVWUUmL@V¯LUK@UV@UU@a@U@yU@WLUK@X@KUVmL@ƒ@aXI@w@ammVk@WÛwm@UxVVVbVLUJVxVU„V@V@X@JUIVbm@@Vk@@VkL@lVLUJ@zWJ@X"],encodeOffsets:[[108799,30241]]}},{type:"Feature",id:"500106",properties:{name:"沙坪坝区",cp:[106.3696,29.6191],childNum:1},geometry:{type:"Polygon",coordinates:["@@Xºl„UVl@UbVXUV@xVJVzXJVUšL@VV@VKn@@Xl@XK@UmÝnKVbVakkVm@k„ƒUK@UmIm@LkKULVšU@WJ@UU@@VkXU@Wa™@@UKWL"],encodeOffsets:[[108799,30241]]}},{type:"Feature",id:"500108",properties:{name:"南岸区",cp:[106.6663,29.5367],childNum:1},geometry:{type:"Polygon",coordinates:["@@VV„JVL@bUVVnl`XIlwXJlw°nnl‚IXW@UÇĉk@WJkwkLƒ@WVkU@LU@U`W@UXUV@n"],encodeOffsets:[[109092,30241]]}},{type:"Feature",id:"500105",properties:{name:"江北区",cp:[106.8311,29.6191],childNum:1},geometry:{type:"Polygon",coordinates:["@@nLVU@wV@lV„@Xll„ÈKlU@L„@@bVKnx@I@JVaV@„x@Il@@Un@laVVn@mkUIm`k@WXJmk¯mkxWIkxWJk_UmVUUKƒ@UU™@ƒ„@l"],encodeOffsets:[[109013,30319]]}},{type:"Feature",id:"500104",properties:{name:"大渡口区",cp:[106.4905,29.4214],childNum:1},geometry:{type:"Polygon",coordinates:["@@k@@U@w„¥WKkVkImUmwa@b@xWJ@b@„nKVU@L@WVLXKV@@z@V@bVVU@@VVL°K@U"],encodeOffsets:[[109080,30190]]}},{type:"Feature",id:"500111",properties:{name:"双桥区",cp:[105.7874,29.4928],childNum:1},geometry:{type:"Polygon",coordinates:["@@WwUwU@kK@KmbU@@V@XlJ@znWlXV@XK"],encodeOffsets:[[108372,30235]]}},{type:"Feature",id:"500103",properties:{name:"渝中区",cp:[106.5344,29.5477],childNum:1},geometry:{type:"Polygon",coordinates:["@@VLš@VV„@VL@aUKƒIUUƒ@@JUVU@"],encodeOffsets:[[109036,30257]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/fu_jian_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3507",properties:{name:"南平市",cp:[118.136,27.2845],childNum:10},geometry:{type:"Polygon",coordinates:["@@@knyƒk@ƒKU¥šwV@nkƒWƒzUmk@@lKUa@aVI@UƒKUamKUUVaUI‚@Xƒ@UV@K±IUVVlUbUbUL@KWUXmWk@KkXmmkŃKUƒ™a@amUƒbkUkKWUnwUƒÇwV™UUƒÝUKV£U™@ƒnKWwXLVKm¥@wUXkmWk@ƒ@wX@lU„@šyVImaXwVƒƒ@kŽƒnU@mbk@mlUXƒmU@mV@n@bnW@bUIWJ—ImVUKWbUK@nkKƒaU@W_VUUmWmL@UU@™bUWUL@V@bmVUz@`mUUVVbXL@V™L@lmLUxmVamXkW@xWbU„VbUxkU±@ÅUmmkLUbW@@`kLknVlV@lbXxlVUXVV™ŽU„U@UbWŽkIWVUUUJkI@llbUxVL@V™VƒUU°ULUmWXUV@VULWb@™xm@UaVLVKUa@ƒw@V›bkmVambUUm@@VkK@„@b„xlxX@‚„n¤@Xƒ@@lkLWV@Žn„V„kb@bWJXLWx@nkxmm™bXn@VWVUn@VnJ@bVXl@„™VJXnWbX`lL„UlJVI@Žœ@VXV@Vl@bn@@Æmn@VšxXU@mVIlxšVššnI„l@nVJ‚aXI@mlU@aXkVm°klmnVV_naš°@V@xܦXK„V‚nnUlVXbVK‚LXKV@naV@@VVl@@lXblXšWnLlbVK²nš@@‚VLUnlV@lƒXxô°‚V@UnaUUlKXLVUVVUbVVlUnJVX„@VW@an@lb„@nl@VU@anƒšUVW@kƒaUm@InVVKVU@kUW@Uam@km@kVa@a@™nwšU@WlI@mVI@WXaW_nƒ@™nƒlkkW@U‚¥@kV@Uw@wUƒ@@IXK‚¥VIn@nU@`@Xl@VV„LnašW‚bVaUwnU„@VIšKlV"],encodeOffsets:[[122119,28086]]}},{type:"Feature",id:"3504",properties:{name:"三明市",cp:[117.5317,26.3013],childNum:11},geometry:{type:"Polygon",coordinates:["@@lL@Un@VVna‚bnUlœa@U‚x@„VbULUKVbn@šw‚@XaVK@UVUXWVnVKV¯„VšU@UUKVwka@klJVIVVXUlJXVaV@VƒšUUVWkUWwkaU@UklmlK@_X@ValKnnÆV²@lVVwUaVƒXa@wlXnW‚bnUVwnK@kšK@UWKUaVUnV@_VynU@a@UVKVXšaV@@VnKnXVV‚UX`V@„blL@mVLXaVLnU˜JXIVJ@amX@a@mnUV@„nVWnkl@naV@„ml„@@KmKUam@UU@ƒ@UlKU™Vk™U™K@aVaUwV™U¥UIkJ@wmI@‚mbkwkVW@UXƒKULU`™IVKUa@LƒkkVmUU@WlULUWÅU@I@ƒWW™nU@@w@a@ƒUam_XyVIVWkkƒ@mwVKXUV@nw˜VXkWƒÅ™U@ƒaƒU¯KUnƒK@ƒ¯šmUƒLXŽVLnWVbVbUVm@Ub¯¼W@amƒ`kb™amLUUUƒ™aUXV`@x@XmJ@n@L@xkJUU@kU@mWm@kUUwUUVWl@VUkIƒy@kkaVUUm™IWVXbWxU@k„mVkK@nWVX¦WxU@@bkx@VU@WŽk@™kUbmJUUmkUW@_kKWKƒ@knV¤kIUKWLUbV‚@Wbk@@VWL@VkI@lUXVxUVU@@mWIƒV@a¯nUaƒaUV@„ƒJ™b@bÞ°VbUš@X™aUVmL@‚VXblŽnV„°˜n@Vnx„@VUUUlK@InJVb@„Vlnn@V™L@VWJU„x@XlJUVVVl@LUUUJ@Lƒ„@lUL°¦k˜V„VnV@„xV„„l@blLnlšLVaXll@šnVUn@‚xn@nml°‚X@lb"],encodeOffsets:[[119858,27754]]}},{type:"Feature",id:"3508",properties:{name:"龙岩市",cp:[116.8066,25.2026],childNum:7},geometry:{type:"Polygon",coordinates:["@@ša„I@ƒVU„bVb°m@b„UXJ@nV@VUUwVW@klJ@UXK@Ul@Xa‚@UVaXKVLlJU£lm„@XLlL@`VXnlVVnIVašll@XV@@Ulw@aV@XwW¥XU@mlLnUlƒV@XwWaXUšJVnUVlb@l„zlJUVk@UXVVVxlVn@nXV@@lVVlI@w@K@mnI@W@wU_VWšbV„VVnKšbla„_n‚bX@°»Van@VUUaUamXUKW„K@a@Ukƒ@wWkXƒWW@wUU™Kw@_lyƒwUkU@@Uƒ@kamVmƒXašUVUka@Wk@»UUUVƒKkbWU™VUbk@mkƒxkƒƒKnIVUmW@kUKmXUmVaU@kU@m@KUWVkIWJ@ŽU@UI@wUUUa@KW»nU@mVkUmm@XwWU@ƒUUmL@ƒw@mnƒVUU@aWak@@amxU@UxULWVXbVLU`mbUImVU„ƒbn‚V@@bVn@bnVWxLmyUbƒIUKƒ@aƒVm™akbV‚UXW„UlKWbkV@„WLUlk@@nšbƒb@lkKmU@ƒUIWJkw¯UUVVxm@@XkbWx—›XKƒlUzWJkUUL@bmKkVƒ@@VUIUlWV@X„K@VkbWx°xUb@LUbk@@VWb@LXJ@VWXU@@bUVV„VVn@VVlLn„@l„@‚xk¦Vx@bVJXbƒn@JlnXxV@@„nJ@X@V@lmx„bUn@xVL@VVKlL@l„„nLVaVL@xkl@LƒxVl°š„X„WVX„Vl„œJWnxlJ"],encodeOffsets:[[119194,26657]]}},{type:"Feature",id:"3509",properties:{name:"宁德市",cp:[119.6521,26.9824],childNum:9},geometry:{type:"Polygon",coordinates:["@@@LVKVaVaUkVU²J@LVU„@@W‚VJUbVVnLVb„L@VUJ@bVbkL@Žl@Vn„y„XmlU@™xV¦„L@Ž„lmz@lnL@bVVšbVb@l„nšKVk„Vl¤@zXV@šl@XJVLVKnXVK‚VnU@wUm@šKUƒ@UlVlw@U@U@ƒUaUKlU@kXKlmXIWKXaVIVUVK@KU@@k„JVUnLVJUL@V‚IVa@VnLšKUnl`Vb„V„V@š‚Vbn@Vzn@lKnVlI„VVKUalkXJl@XXVWVLVUUmVU@Unm„£lK@Uk@WUXK@U@WVwVkšƒĠkĢÇ°aUÅUwmaţƒɱUÇa™w„±V¹XalKôx„@„UVaÜʓͿVóbÅLƒJm„¯Vk¦ƒŽk@mamXkKUƒUL›akbk@mV@LkJWb@Vk„mXk@UVmaUV@amLUKUamI@KUaU@WbU@UUUƒUIWJUkm@šƒw™Kk„VJm@kxǁVƒUK@mUVUkmlkkVm@amwƒLVWU@UbVLkšUbƒ@VƒmK@XaVWU_VJnwV@@kUmWakxƒ@kwWakIWxnbUJ™zƒ@kVW@@x@„XllnVW@xn¦ULWKXxmL@„VšU¤VL„ÞVVUšÈxV„mxXVlLlV„anV@bšbV„„LlÆnnlW@LXlWnXV"],encodeOffsets:[[121816,27816]]}},{type:"Feature",id:"3501",properties:{name:"福州市",cp:[119.4543,25.9222],childNum:9},geometry:{type:"Polygon",coordinates:["@@lxna@nJ@xlIVJV¦UšVxUb@bšLšVUlVškL@V@„VVn@Vb‚Ln‚@LU„lJXblx„@lwXbVn@lU@mxUIV`UXWb@‚nLU„„@Val™UKVaV@UX„Knx‚bn@lUkllnUVnV‚@VLU„È‚lwn@UIlƒšL„x‚™n@VlXIVJV„VVV@XaV@Vb@LnJVbVLnK@bVUnbVUl@nWlƒ@UXalI@KnUl@laœbVKV„lLnWnbl@„l¥°Unƒ„IÆKôa΀U„a@UUwÇWǓIUWUÅVkƨm@ƒ@£@KmLU¤ULˣJ™kUƒVǟUUķ@ĉVƒKUk@Ñ°wôǚç@īšé@Åţ¥mīÛkm¼Å@ƒVķVó°ō¦U°ƒn@bVJXVVL@bUŽƒakLmx@xmxXzW`XbWnXV@bWLÛ@™aƒ@ƒaXbWVkaÝwU@mlWKkLWWkLUKULW@kVmVUU݁UamV—¤›n@xUVUzkJV¦lJU„"],encodeOffsets:[[121253,26511]]}},{type:"Feature",id:"3506",properties:{name:"漳州市",cp:[117.5757,24.3732],childNum:10},geometry:{type:"Polygon",coordinates:["@@@bl@Xb@bVVUŽm„@n„x‚@nKVV@„XVWxn@VnUl@nmVX¼@LVbVV@xVJV@@XIlJXU‚V@Ln‚@lVV@UbVnnWVL@lnXUVmJ„Ll„„wnll@VašUXVla„LVUVV@¼Xl@lbUV™VWbn„nUlb„@@VV@„aVUšmlUašUny@kU@Wkk@WaUVk@@ammk@@U@UlU@aUa@wl@šmXLllnL‚U@anVnU@L@VVV@KlXnWVnVanUšw@w@wm›nÅ@wƒaUam@Uk„mUl@@a„a@U@¥škôK‚wȯ°w@ŻkwǕaK›ÑÛk@ĕōřċ£ĵƒUKW»kÅŻLU@Ulġw@¤Vz™VUbkKUbmLmlULU¼UxmbXl@bWVƒb@bUnV‚UšVbULU@@VkbVL@`U@WX@ŽXV@b°„@b¯š@¤@Xm@@b@`U„VVUL"],encodeOffsets:[[119712,24953]]}},{type:"Feature",id:"3505",properties:{name:"泉州市",cp:[118.3228,25.1147],childNum:9},geometry:{type:"Polygon",coordinates:["@@Vl„xkz@`‚xšLVV@xXXW„Xl@xl„@V@bnV°™@„„LVm°L„V„bV@ƚX„Wl—UmxU@WVULnx„@llUXUJWzn`Vb@„@b@xV@šmXX@„@JÆVVXVKXkV@nVlU„l@KVbULšJV_VK„LVWX@lUVƒkIU¥lIVyVU@wœm˜£nUVWU@aƒm@UmWw@UX@@am™VUn@@aUUlUVanaWUXWmUnkšK@VšUlVVUUwš@XLWWX™ma@knm‚bVb„VXbVL‚@XJlInlšL„w˜mXóšw@çV»ÇçŋaķƧóƅóKġ°nÅUķƑUÇW@—¯xÇ°öÆlV„n@llšaš@„Lšbƒ`™@™„VšXVƒVx@V@bULVJUk‚Ç@ƒ¼ƒXUKk@mmULkaWbk@ƒx@UkL@a@K@U@UmKmbU@kV@UmVUbUmmXkW@LUU@U@KmVmU@bVmKkkWK™nk@@xVb@bkV@V@Vl@nn@bl@VUXbl@XlV@@lmz™VVbkŽ™nUVƒb"],encodeOffsets:[[120398,25797]]}},{type:"Feature",id:"3503",properties:{name:"莆田市",cp:[119.0918,25.3455],childNum:2},geometry:{type:"Polygon",coordinates:["@@VbނVVnUlUX@VKVLlKXXlKXL‚‚nkV@ÞxlbXUWa„b„@šbÜ@XK@aWUXmWaX_Wynw@wnwlK„bV@aUKWUUI@a„mV¯Ŏ¥ô¯ĸU„UÆ@n»¯aƿé@ţ¯nĉĬÝK™óó@™ÑU¼@è™xWô—nƒx™KmkkJWI@UKWaƒUUaamn@lnbWšXXWK™@VxUVkU™V@U™LmlnVWXXVmbUbkVVV@bm@UVnš@bW@@VXx‚n@V„n@bV‚UX"],encodeOffsets:[[121388,26264]]}},{type:"Feature",id:"3502",properties:{name:"厦门市",cp:[118.1689,24.6478],childNum:1},geometry:{type:"Polygon",coordinates:["@@@VlUV@nanL@V@V@L@blK@V„wl@XalbVKnnl@VL„W„»È@lVUIVK@a@UUw„WUU™šƒš@„_™aƒK™@™bkkm@UƒkõŁxóL™l@¦@Vƒb@bk@VŽƒnVln@Vb„b@xmÆnœ@x@x™x"],encodeOffsets:[[120747,25465]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/gan_su_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"6209",properties:{name:"酒泉市",cp:[96.2622,40.4517],childNum:8},geometry:{type:"Polygon",coordinates:["@@ÇnÅaĉ@ƒU¯¥›UŹ‚ƒ£™WUýUU±JkkUw‚yÞIČxĊĕĊ¯š¥ÆUkţ™UÅÓ±¼™IUx¯UƒÒƑ‚ݐŰƒKÝnğ°ÅU@Žƒ@Vn@þš¼¯šWnŎ°XLWlnVnbWnƒVXxmbƒa—bóUƒlǕUUa™IUmlU™ƒš¥™kƒ¥ĉwkkƒÝɛa@¯™™U¯°mVƒkVnKlƒōÑÇÑU@kl™UġŽkUŻnUW™@š¯ƒk»šmWV£UKnUƒmUw‚w@ƒUIVaX™šwm»Èmmwn¯ċ™¯LĉŽUƒJUalka±Va@U‚k@ƒÛф¯WmnUaɝ¤Ûmƒn¯m±x@wóxÛLġÒUx¯VƒÈ™JUbóz݃ÇKĉ¯ōlÝUŎWl¯nťbÝ@¯ǩLġmV@ƯĢkÆm™ĊkVťLɃmÝXó°@„ĢbVŽóVݦɱ@Ƨaġ„UV„ĠÇÈV¼UVţwmbJÇwˋa™XmǯKkkmŽƒbXšm¼V¼ǬŚ²¤ôŰÆƴô̐ŤǪnɆӨ¼ɆLÆłUĊšxŎƞȘǔˎǬǪnƨŮǬö°»šġ„„ÞÜÆĸÒĊ„ǀbƾèôÈ@¼¯þŤĸƧ°VĀ¯b@lÈĊ‚šʠń̐„ȘKǀŽֲॗţÿǕý@ʊǓƨóÆÑǖŃôw@΋ʈƆÅÈVVĊV„óĊÅ@ÞƒĬV@Þīš@°Ž„V@ĸĢƒ°XτƜĠ@ÈaÜ¥Őƅ‚™nğóĕVġUůƿŋ—ĕƒa±V—UťÇğÑ"],encodeOffsets:[[101892,40821]]}},{type:"Feature",id:"6207",properties:{name:"张掖市",cp:[99.7998,38.7433],childNum:9},geometry:{type:"Polygon",coordinates:["@@ÈÒŎÒk„mLUŽlŽU„¯nV°šš@°ɜb„ÞĠaÈ»ĸl‚š„LVUÈ@Ċ@ýUm„@@ÆVĠ¯Þm„LƯޏƒ„Ñ°VVwšJ²»ÆԚVlŤÅV™¦ĉ°ĉĖċwÝJzVxll²IVVVþšX„¤źœV°¦„VĊ@ÆbÈmǔLĸĠ¯Ģaô¯ĸmÆÛUƒlÇĸk°XyĊUǔV„ǩnmV»ƒa@ýnK°n@l¥@»ż„Ċ¤m皃@£ČU@mƒmVkÞUƐ±²¹°‚ĠwÅƑŃU¯™›V¯aÈŁšƒÇ»™ġn_°xŎKlxœklx„@Þw‚„„@Æm²b‚DzLlkšWXať¯ĊaœÑšK±w@wƒUÅçV±Uk™@@„¯š¯xƒU™±±UU°ōxVxÅÔō°ó¯UÝ¦óbÝþƒ@ĉÈóUV‚Ux„„@VŽUVÝwÅÈǎóVkk¯JǐkmmL@„™KÇx@bkš™@U°ķ²ó`ƒš™šmn¯°ƒUwlÅkUƒ`™¦ɛô™Žķz@ŽÅnÇ°U¼¯KmVk²ƒJƒ¼ƏÞķôš¤ULƒ@mnğ`™šÇnUxÇ@Ûÿ™U@ƒƒkŻŽ@x@móJkŃ¥VŹĉóÒĉlċ°ķ„Uƽ܃@›x"],encodeOffsets:[[99720,40090]]}},{type:"Feature",id:"6230",properties:{name:"甘南藏族自治州",cp:[102.9199,34.6893],childNum:9},geometry:{type:"Polygon",coordinates:["@@ލš™nKlnšwX¥WÝXk˜xÞUnƒ°aĊVnUUKlÞĶWXnĠ¥ô»„™@nmVL@¤°™Vz„JšanU@aÆwna@k›ƒU¯šyX_›aĉb™ƒ„wƒéXkWwÅaš¯V¥mƒ¯UƒƒI@ƒš@„mšb°aÈçšUš¥@»‚knwɜƇ°I°ÑÈmVU™¯Xa@w‚W@wšV¯Č¥l¯Uwnm@k˜aUaóKkk@™Ça™b@ŽÒWa¯IÇxÛam¼™VUƒxÒl‚@zÝÒ¯bÝaĉVĉwDŽW›zJ™mJn²mܯUƒ¯ĉ@ġ¤Åb@²nšmlƒ@@Ž„„U„ƒLVxšV™„U¼Ålma™b@ƒ°™l@WIUƒ¯@mƒ™@™™ó„™„@U›zţyƒXÇU™ÇVUUVLkbWakVWmUbkkƒKUÆ»nƒ°Knk@aƒUVmšnk»l¯Ģ›lw@_kKVU@ƒnaƒ@lUk@¯¥mV@kmbW™b¯Åõa@mkU@kƒÇŽkU@›`@™óó—bl¼Uxƒn„¼šlVȄx@blVkVVnƒ`XÈġÈ@ǃK£ÝJmUUnUĖmlU„mKUn™VÅaUw›Uĉ`¯n¯wW¼nxVŽ™š@bĉnƒ‚kIċŘkXUŽ±Ò™xšÈ@ŽX°`l„œV˜IȯĊV„ƒšVVan@VašUVażVmšblkÈW„ƒWIXa„alL@wVb„„V„¦lL@lĠ™n҄U‚nk‚šL@ÆÞkšÞšK‚bñþW¦Û„ċVƒ„ULUºkÈlŎUxÆxÞUUxšÒ‚x„@XbšL@lÆ@„ÒlXVln@„bm¼ƒJ@„Ån„šƒx@bnšĠm„xVXmbÈè@ŽĊ£ČW˜w"],encodeOffsets:[[105210,36349]]}},{type:"Feature",id:"6206",properties:{name:"武威市",cp:[103.0188,38.1061],childNum:4},geometry:{type:"Polygon",coordinates:["@@±¯¥@klwU»ƒƒÞÝmwKm¯™™ç@™kVÇUL¯lVUKġ„ġm@a@U„@X£°l°LŎÇ@aōVÝw™ÔƒKUŽÅš„WJ¯lm@ÛVWa™@klĉUmaƒLUanaƒ™ƒk¯J„™™±KkXóÜÅxƒ²Ç‚@„„nUÒĊb°@™ÆkL™Ž™XÇÆ@xÝn—xWxţ„¯¤ƒI@Æn„ƒVV„VlU²Æè„V@x²x™L›ÒĉbŦ°Wb™Xklބš@l¤šXĊ`„wl@ĢÈŎm@bšnV‚Ubƒ„@șÆÛLƒèǚUÒŦlĸ™`°ĮʟÆǓbĉôϚĊƚĢnŤé΀ÑĸĀĊ¦„@@l°lœ¦Ȯ¦ɆÞĊKŤ™ĵĸů„»mŁyġ™ķŭ@Çɱȭ¯mƧUĊķnŁŻ»UaU™˜ƛɞÝƨů"],encodeOffsets:[[106336,38543]]}},{type:"Feature",id:"6212",properties:{name:"陇南市",cp:[105.304,33.5632],childNum:9},geometry:{type:"Polygon",coordinates:["@@šÈÞ@l`UmVƒ¼œŽ‚@nnÆwVlnVVa„LVƒÈ_‚ÿރ@n„a„xÆ@„lš_š@VxnK@llLnxmÈŎJnbUxšI°Žl@n¦‚lÈIlmX¥„k°@šk‚J„k²é˜@klaUaVaU@@ÝnIWnmnx‚k„ºÞ„„aV™°„V@nw‚KšxôbÞ£šVšU„bšþšLn»mƒVw„IšJ°Ž@„nb@°°I„ġUkÇKVƒ™™@ů»lƒ„Lnmƒ£@anK@Ñ܍n@»mL@£™yk„UUmbUÞÝ@kyÇbó»™XUxƒWVzb±mÝbXaƒwUamL¯»@wUKVwm¯ĵJ°ÅUWVk„KVk°wÈVšVуlUšƒ¥škmVamknƒUw¯¯ƒbċ¥ÅKƒk™Kk„™VċVk£kKVw‚Ñ„a@kóyÛ¯ÇVk™ów›š—Xō¥Ç¼ów™Ž¯U±‚k„ƒ@x›IĉÒÅVmÈnšÜ@n°„bUbÝV‚ŽUnnJ¯Į@‚m¦nV܃@„„L°JXb‚Ñ@šaÈb@šllôLVb—b@lmnVxk°ċ¦U°™Ž@xX@xWbš°UVÇn¯Ò¯Jɛƈmxl@¼"],encodeOffsets:[[106527,34943]]}},{type:"Feature",id:"6210",properties:{name:"庆阳市",cp:[107.5342,36.2],childNum:8},geometry:{type:"Polygon",coordinates:["@@kw‚ĉ—»VamƒƒV¯wƒIóVkl¯™Km™Vō¯ÝWkL@bÝKō¦@Ž™„@š™Lx›@b@l™a@km@@l¯nm@UaÅ@ƒ„óWUXm¥™nƒw`@UUxķôÇ°ğ¦@„VJš_n‚‚IVŽnalxkX„JWn¯šnVƒLšxl¤nnVbklVX@xnxmV@bUK@nm@@xƒV—°±aÅnƒŽkUWnUaƒx@m™n@ƒ¯LƒššmUĀlU@lV@blLUblxklkIÇx¯°‚UXbšaVŽUnšV@°‚LUlnbšX@`°nVmbnÆmV‚kLmK™¦UŽ@X„y@kl@U„°K@¼XbW„ƒš@b„WnLVa„VšƒVz@xlVČ¥lbUxލlV„U@nÆWôn²™VJlU„Ƨ„LnmÜLXa˜n@mœw@wlUlV²mšblwšVȃlLލ„±@lVnUlxnkma@mškšJ@kXV‚U@mn@š¼VXUƒVƒlLnmVbôaVnWV»ÈUl°È¯ÆIn›ÆU@kk»mKkÆġk¯@»mƒk—¯@óÇlÇ@—Vykkl™Uml¯Þ™@w"],encodeOffsets:[[111229,36383]]}},{type:"Feature",id:"6204",properties:{name:"白银市",cp:[104.8645,36.5076],childNum:6},geometry:{type:"Polygon",coordinates:["@@VKUȚl@šè°šnŽ‚LnxÝބ„V¼kx@l‚¦²°ĊóĠ„™Ċ»š@ÈxšaĊxlwÈVŤa@¯²aÇ£ƒJk£lƒnUÞ@°šô™@y„wl»lIX¥Ǫnw@ÑÞWla„ÅlL@ƒUwĉakƒl@ƒš¯mwna°J„V¯nUVÓÞÑm£²óWaUƒÇ@óÝUçV»ÈkkW@¯‚xV@XlK@wX@Vmm_@wÈݙKU¯ÇwVwÅK¯VƒkƒJ™™™XkWVaƒImŽ¯Uk„ÇlVšœĀV°mxóšk„@¼ó„WxĉÜU@Ub‚zÛJÇk@‚ÆnVlԙ@kŽ„x™ô@ĬWL¯ƒƒK@aÛImm™@ƒIUaƒ@™™UŽÇêU¤VÒÇx¯ÒV„šš™lk@Wbĉ¦UbkWV_‚y¯Lƒaó„kŽ@b@nmbkx„°"],encodeOffsets:[[106077,37885]]}},{type:"Feature",id:"6211",properties:{name:"定西市",cp:[104.5569,35.0848],childNum:7},geometry:{type:"Polygon",coordinates:["@@„a‚V²wVJV_@„LlanÅllŦçÜӚ_šlnƒWaôk„xUš„bmV@È°lèšnk°l¦„`@nnL‚@ÈlÜIyVaV@ĊÛXwôƒ@»lƒô™nwU¯›ÿU™Èklƒ°Vn„JUblXšWšš„I„l°U„ƒVƒš—@aVVVmnL@„lƒ„UUw‚mkƒš£„bV¥VUVwۂƒlaÇÝރmk£ƒLUy¯L@WlkKW_XaWƒ—mƒ„ġU@a™k™‚ƒakXkmVwmŹVƒU™b™WƒónmwnWW£„KÈnV¥ƒ¥„ƒÆ_k™lW„bU¯„V°aôbnaVwmaōInÇmwkK@kmLUw™@™`ƒkÅ@ƒwƒb@m݄ĀÇ`U„ƒKUbmUUkÅxmm@›„»nUVk_Ý@™Ç™¦™VÇè¯b™aƒn™@@„„JV„°Žn„U¦™°ÆbXxWl„êƒxš„ĊaœbW`™zV°œ„@lmbÅx@bmV™bƒI™`™¦@ÒUVUI@ƃL@bš¼@ššŽ@„šlmxnL„°ULƒŽƒÞğޛ°kLUŽƒL™°™xVŽ„n„KVƒl@šzX@"],encodeOffsets:[[106122,36794]]}},{type:"Feature",id:"6205",properties:{name:"天水市",cp:[105.6445,34.6289],childNum:6},geometry:{type:"Polygon",coordinates:["@@UyȍVƒVUnn@ƒVU„`UblzšJnk‚@Vb„KU„°l„wš„„W°„nkVŽ‚UÈlš£°V@n¥šV„kl™kU˜±U„ƒn™ƒlw¯UkwmKUlmkUmnkym@ō@U„mWÈU°l°anlJškUKlU„¯Èm@kmWV»kkÝLUWUx±b™@¯ma@ƒ¯™IƒJUxn„m¼™K™ýƒa™V™Uݤóa™wLmxU@¯ƒUšƒb݃ƒ¹lmwmnXŽmJ@ÞV@UbVbkblŽ—@±êƒlI™l¯@ƒlW¦knÇJkm¥k@¯™Jmbóa¯bƒUV°ƒakXlšÅ`ƒ„„¦U¦ÇmƒLX¤mXnxm‚„ôšXša„VźUnŽUxlnlW„bššl@bĢV„ƒ˜nX„WbX`lLXk@Ž°KVz„Kl¤„nÞ݂Èkb„‚܁"],encodeOffsets:[[108180,35984]]}},{type:"Feature",id:"6201",properties:{name:"兰州市",cp:[103.5901,36.3043],childNum:5},geometry:{type:"MultiPolygon",coordinates:[["@@lW²LššƒŽ°I„l„šmbVb„KnbĊVlkš@XbÜU@Žkn°‚XIƒÆ™V„LšÓÞxŎUlôƒ„b°KzU`lXVaĊ¥Xal@šk™™Uƒ°ÑÈwUтV£ÈéVšš„@Vb„Jš@nnÜJ@b„L°„XK@īšóƒwlš@kÓmUÅmK@mƒ_k¥l¯™mkçǯ@nUƒaV™ƒwólXbm„™k™`ÛÔťèkkmÆkbƒK@U`UI±xUƒbWlX„mbVbÅÒólkƒƒIWJkšƒ@ƒz—KŻ¼™@™xUx󎃄¯LWb@ŽÅ҄„±¦U`nbťĀUšVb„LšŽ„U"],["@@ƒ¯lwna@mōȯK¯kW¤ƒ@@V@bĢnĢƒVLU‚°k"]],encodeOffsets:[[[105188,37649]],[[106077,37885]]]}},{type:"Feature",id:"6208",properties:{name:"平凉市",cp:[107.0728,35.321],childNum:7},geometry:{type:"Polygon",coordinates:["@@ÆLUxÈxV°šLÇÞ@xn`Ü@X@nĊŽÆwnJmwUx‚aUkšw@V@w„aVmlLXÝl@X‚VĢmV°@nl@UUUWK@w„ÿVI²Òlmš@nÝĊýVV@nšJ°„„šUłm@kV¼nK›ĢȤôK„blnKllVk²aĠ¥È¯ĸóVw@V‚_„xšmn¦VWôX„ƒÆ@Vbn@°m@kn@@lšb@k‚aœ@‚wšK@™šƒ@UlKVaƒWX™W²¹lӄw@_°›n@@_lKōķW™@ŽmLUWƒn™»Û@›l_Ç`ƒÛmm°ÅbWb@š—VWbƒUUKDŽÅaġlmkUġlƒ»—Lƒl™Um¦@Ž¯U™¤ÇkVUml¯ƒƒX™ƒƒx¯kVƒƒLUa@ml™IkyVaƒ_UV@„mmUVU„ÇŽVzUxUVU¦ƒa™¤l„nVxƒVk„@ƒmKUnUU@b™˜U„ƒ„","@@@Žż@™mlkƒġk"],encodeOffsets:[[107877,36338],[108439,36265]]}},{type:"Feature",id:"6229",properties:{name:"临夏回族自治州",cp:[103.2715,35.5737],childNum:8},geometry:{type:"Polygon",coordinates:["@@š@ż»˜L„y„@l™XI„Jl„ôkÆÑUanaWƒXkW@™yk@U„ƒLƒmUšwš¯„KVlKœ¯Ġ݄݄VKƒ¯mKnw™k@ƒ™@™™»@a„K@ÅVJVU@њ¥š_Uy¯š@£UKmn@‚ƒšó¼ğ¦WmĵXݎkŽVLmVĉU¯bm„ÝV—wWlXÞW¦™xkmmL™šÝŽœ„±U@Vގ™š@„ÅÈW°X„ܼƨyUĮnŽWŽnXÝxUx°lVXJlôV"],encodeOffsets:[[105548,37075]]}},{type:"Feature",id:"6203",properties:{name:"金昌市",cp:[102.074,38.5126],childNum:2},geometry:{type:"Polygon",coordinates:["@@šĢȼ™„Çł°bœU°šV‚ƒń‚ÆǖŰnšÆ„ōĬǔaʠůĭš_kķÆ¥VÑș„çÜKšÅ@DŽƒVaU™m@aōnġÇk@ƒxĉ_™Wk£™@݃±KÈ±aÅnƒ@ƒÝxƒ@kw›lkwōL¯wm`"],encodeOffsets:[[103849,38970]]}},{type:"Feature",id:"6202",properties:{name:"嘉峪关市",cp:[98.1738,39.8035],childNum:1},geometry:{type:"Polygon",coordinates:["@@llĊx„¦šl™¦š„kVVnšJVbǖV„kôV˜a„bnaWw„UXmmamUXkWKō¯Xm°™™»ĉÇ@UVƒK™ķkǼğb"],encodeOffsets:[[100182,40664]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/guang_dong_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"4418",properties:{name:"清远市",cp:[112.9175,24.3292],childNum:8},geometry:{type:"Polygon",coordinates:["@@lǯkÿƒaV¯™VaÈU„¥ÆDŽIlxšmnb‚Uœxl™„Uôl°kš„„Wl„š@ô™VwUanUl@„xVkšaX¥‚kU»„aš¯±@kka@ƒUwmUkwƒJk™˜„±k@ƒ™™L@ÝWUwV݃—xÇU¯ŽÇX@m™Åƒ@@yĉ£VmUwȗ»ÇšUn„lUnWU¯`Ukƒ@@„™x„Ž@bÇxX¼ƒVVš¯LšĀk‚ÝLƒ„¯@VŽƒĀ¯lnĊW¦kVÇôkUDŽUK@ţ™U@a™™ó܃UU»ƒ@™¦k@Vx„KVb„n‚š@„Æ™„l„@xšƒbWšnlU„lxÈlV„È°Æ„@¼™„@x„šWxœŎ‚V„šK°„š¥ššnƒÆkŎ@ÈÑm™„K@¥šk@™ô@„nôV"],encodeOffsets:[[115707,25527]]}},{type:"Feature",id:"4402",properties:{name:"韶关市",cp:[113.7964,24.7028],childNum:8},geometry:{type:"Polygon",coordinates:["@@W™Xk±Ñ@ƒUw™mUwĉwlmn@Æwn£mkIš¥ÇÅ@¥šaƒón£nWWwš£V`Þ@šnVml@xô¼„IV¥ƒkUmkamUkVWwÛ»móƒ£UVÅKmn@x™@kbmm¯a™Xka›VĉaUb݃ƒ²—‚lš„IlxnVVx@„lb@l²™°ƒbV¼lW¦™bUlƒwk@mVVbUxóš™@kƒƒX™ƒ¯lókƒVkš›wVma™nkwƒJÅȃ¦ÇVUbšŽU°„blĀ°ŽkÈ@x™¦Æܙ°@„°„¦óa™VUôlUlbXl@nÜV„„nKlŽnIVÞ°Wš„°U@bnm@¥šIVƒ²Ulƒ°VnalzXyl_Vyƒ¦lƒœLlxš„@ŽÞbšKm„knVWanwƒÑVwČº˜@n_ÞV„aVŽÜIœl@„˜KȚ„VJ@aš£È@˜™@km™„aV¯W@_ƒa¯KmbkÇkLmwƒ@Å¥"],encodeOffsets:[[117147,25549]]}},{type:"Feature",id:"4408",properties:{name:"湛江市",cp:[110.3577,20.9894],childNum:6},geometry:{type:"Polygon",coordinates:["@@@ƒkXƒ™@a„UUċlk„Jƒk„™@wVJXUWk°W@nKnwlUlš²ƒ„blU@‚lI„l@„XbW„šxnm@lW@w„wU‚JX¯VU°`ŎóˋkÝÝkÅ@ÇmğÈřmw™aĵV›xUہ»°™ĠǷnýmóX¥ɅĵҏÇ@°²ĊUĖ±ĮU¤Ç°™Ā¯ɐnżUĊĊĬV@脎@ԃÒU¼l¤nƒĠb„êVĠ°Èy„zVaV‚nUÆL„ašbVl„wÆ@"],encodeOffsets:[[113040,22416]]}},{type:"Feature",id:"4414",properties:{name:"梅州市",cp:[116.1255,24.1534],childNum:8},geometry:{type:"Polygon",coordinates:["@@„‚nԚlW¼x‚¦@lœVl™lLkè„a@zš¤ƒĖ„¼UxlnUKUbÝlU¼lb@„Vx„V„klJÈwV¯š@ĠlÛĖšnƒbkšÆźÞƒUÈôklmšL„¥‚LœW˜„„™nKUkVa°V„x@IVV@x°bUk„a™a@mV@„@y„w‚L„ÑUwVUšV„‚„U‚bÞVVann‚@XwÇÿš¯²aVamkXaÆ»@»nw@¥›UXaƒkbWa¯KUw@¥m@kwmLU»UU™J@kmU@UUWUƒ@ƒyƒanwmçÛl¯ƒŽ¯UƒmKUmƒwVkmÝXbW@XWÝbƒk¯@±‚w@»U@W¯Å@ƒÇ¥UƒU@ƒƒ™IU™ƒakJƒĀ„ꃰšþƒXkamŽ@Žƒ_J°m‚@X"],encodeOffsets:[[118125,24419]]}},{type:"Feature",id:"4416",properties:{name:"河源市",cp:[114.917,23.9722],childNum:6},geometry:{type:"Polygon",coordinates:["@@°VlmX¹laĢÒlm„@„„šVš£‚‚@¦Ģklynn¼lW°z„W„„°VbÈV@lÆbnn‚JškX„šVÆašÅ„W@™ƒUUw@ƒkaV»ÞkVaVLkmVwƒ»„ĕ™£@yƒblçkKkš›U@k¥‚wX»™kmӃ@Wn¯‚I„`@nlb„W™ý„¯ƒé„ÿlI@™XUmWUwƒ@@UJU„Ç„mKUV@x™„ţk¯¯LWƒƒnUxK@ű»Vwa¯š@¤WX@ŽÛ¦@¤ÇIȼWxXŽƒ@Wx—w›ŽUnVbÅèmVa±²UWl@Žk„lȄ¤nôܼXxlUnVlbVn„lU¦ƒJó»@wnkmU™‚Ý@U_™¤XxmXm¤„ô™b@¦Èƙ¦lJn"],encodeOffsets:[[117057,25167]]}},{type:"Feature",id:"4412",properties:{name:"肇庆市",cp:[112.1265,23.5822],childNum:7},geometry:{type:"Polygon",coordinates:["@@l@š¥„@V¼„Vôۚš@bšV@ŤVLȃlVÈólUX¥mĉ°k„ÿU°@„ƒÞKl™ÿ°KU™„UW»Èw@aƒšw@ƒ„@nm@w›£kÓVUVn„Kš™k¥™£Vamƒ@nkKkbÆǫma—kmLU¥™UmƒÛwmVU™mUƒJ—ÇaUxÇIn`mb@Þ¯b@„nJ@nl„U‚V„lVU„L›W¯—Û`Ç_¯`mš¯I™bĉWċzx±J™xš¯ÆUƒƒ_k@™šƒJ@Umb„šXôlLš˜n¦@¼ĊxlUXŽ˜xUbL‚Ġ„UnVĊwlšUš„b@lW„X„‚m²˜@ÞWxXš‚Unb"],encodeOffsets:[[114627,24818]]}},{type:"Feature",id:"4413",properties:{name:"惠州市",cp:[114.6204,23.1647],childNum:4},geometry:{type:"Polygon",coordinates:["@@lbšW°bnnlaš@@wnmÆLVUkÇlƒ@Xk‚V²±‚bnUÆçUaVmœ˜xXw„@WXwÇ»ÈJ@£Ü¥@XW@£°™‚bUx²¼@ƂLVw„mX„°K°Ťlšƒ@wVUnLȃVƒVIky±wkƒKU¯ƒÅkƒ™XġÑۃlwUwlm@m„nKWašÅm›¯óÇmğb¯alĉUwķbmb@lÞÒVn—šmĀŹ@VŽƒbVŽUnmakLm`@xĉkklVÔVJVn—lV„UnmJmaLUbl‚™zmŽkL™a™‚ō@@zš‚V¦UŽV²kJ„nÜU@˜VXUŽL@„lJƒL@bݤUnVŽ—b@xVnlK²„Vx°V„xlI„lkVl²k¤@n"],encodeOffsets:[[116776,24492]]}},{type:"Feature",id:"4409",properties:{name:"茂名市",cp:[111.0059,22.0221],childNum:5},geometry:{type:"Polygon",coordinates:["@@‚LnÇlk„KnkÆL„ƒUm™ÈxlUœJló°n@ššanŽš„„a@ƒ˜@X_@mÝóóU@a™aU¯mL¯ƒƒkV¯™ÇVwkw@V±Ŏ£@™™@šalw±Vk@m„Åm¯™ÿŃƧIÇ`ōô¯_UVW°IV‚ƒx@xkX@Žmn™wXƒWa@ƒƒkkJ@kVƒa±„k™kVmxmL@‚¯XXlWVUI@xƒš„lƒIklVȃV@b„šlW@„@nUxVblVxkôlx™n„‚y„šnIƻư„aXwlK„bVnƒŽXb‚L„¤„k‚L—èƒVV¼ƒŽ²IlĠVX„ynz°KVx°@VlœLlblKœš"],encodeOffsets:[[113761,23237]]}},{type:"Feature",id:"4407",properties:{name:"江门市",cp:[112.6318,22.1484],childNum:5},geometry:{type:"Polygon",coordinates:["@@lUXx°JWnnƚXVš„W„X@„šºVLV¯nU‚Vnb™ô„x‚aXmW™XIšŽUb°xlK„l¯œK˜xXÞ°ŽšXÈ¥Ü@„ĉޏU™‚çš»nóƒVma—x‚¯UÅU¥Ý¯@ƒƒç@ș@çĉÅUmU籃ĉKÝxÝ_ÅJƒk¯»ó¯nmèkǀšŽWxœ¼mnUÜġ°@¦@ƒxƒLkŽÇaVnUxV„™šVlnIlbnÆÆKX¦"],encodeOffsets:[[114852,22928]]}},{type:"Feature",id:"4417",properties:{name:"阳江市",cp:[111.8298,22.0715],childNum:4},geometry:{type:"Polygon",coordinates:["@@°„nKV°šb@bôVÞô@n„VlÒôÆUnlnn@lmkmVkƒaÈkÆƄ™k¥‚ÅÞ»ÆKXkW¥ÅLmÅkamJUkš™UƒVwUmÈbl„K„w‚@@¥Ģ¯VÛnm›»Xw™lƿ™@kbW™—aʵ@óL›l¯ƽ@™ƒƒLn°ƒÆ@nUl‚²kx™b@‚š@šō¤U²@ŽlxUxšÈU°lŽ„"],encodeOffsets:[[114053,22782]]}},{type:"Feature",id:"4453",properties:{name:"云浮市",cp:[111.7859,22.8516],childNum:5},geometry:{type:"Polygon",coordinates:["@@@V„Iš™l@„`V„°Å™šw²I‚wČyĊXša°Jn™°_È`Ü_°˜œX‚KVƒkUUƒVkƒ@mmI@ƒ°a@Ýnam_ÈJVwlĉX@„šlUšómaUmVU°UK™¹@ƒƒWƒXU™™WmÅXm¯IWwkVWlÅLݼÆl¦ƒšÅÅÇl„bUllnknm@kmVmóÅkуUW`—@@„ƒb™ƒm™b@™¯mkô›IkVÇwnš„VƒÅKmlƒLklmȁKƒšVĊK°²„`n˜¤n„U„bWl„xVx™LUx@°nXm`VklVxmnnx"],encodeOffsets:[[114053,23873]]}},{type:"Feature",id:"4401",properties:{name:"广州市",cp:[113.5107,23.2196],childNum:13},geometry:{type:"Polygon",coordinates:["@@Ș¼VxUnĊ¤@z„@šÆ@nÈW°ÈV˜w„ŽUÞVxÞX@ŽšK„šl@ބVaĊbœU@ml£k±lUƒkkJƒw¯UUw±ƒkLUm@w˜aUVmÞ£@a„KkI@ƒ‚KVUW@—ÛVƒmlIU±VU¥™@yğzƧǃƒšƽĠřšÅnī±m@ƒ²¯lƒ°@nÝÆóUll@XnÝVU¦mVV°—„V¼™Jƒn„b@°mbn„ƒ‚@²¯‚¯wVwƒ@@nmxX¤¯L@ŽVLU„m@@l"],encodeOffsets:[[115673,24019]]}},{type:"Feature",id:"4415",properties:{name:"汕尾市",cp:[115.5762,23.0438],childNum:4},geometry:{type:"Polygon",coordinates:["@@@‚„@VxnXWV@š„bVššJ„„V@ÞÅU¥Ċxš£UWU‚wÅUU¥WVUkĊÇnkV`°LV™„wƒƒnU@™„ƒlbĊ¯„Vnalšš@@çkUÝ¥ġaó¯ÅaÅLŻÆUýmy¯ó@ĉÆó„ȯw™ÆXbmLƒ‚@nknVxkx܄ĢҚW„Æl„V°„Ll‚²xlz"],encodeOffsets:[[118193,23806]]}},{type:"Feature",id:"4452",properties:{name:"揭阳市",cp:[116.1255,23.313],childNum:5},geometry:{type:"Polygon",coordinates:["@@V„Ȧ„Æ@X°V@@¼‚x²°@„lÞaWXX@‚aÞWlnUŽ„xVnnL„‚°V„@k‚mĢl@„ak™@mlk°aXƒ±„nwm±™²¯JV²@ƒwW˜—_mƒa„V»ƒU@m¯ĉUф™šJl™„ašbVn„lĸLlƅÛDZwÝ@ĉxó@è™@k™mbƒUĉ°kaƒ„@šmV„„ƒxUš¯KU_mlĉÈVlXUV¦ÆVxVŽVX™¤ĉwV¦ÝÆ"],encodeOffsets:[[118384,24036]]}},{type:"Feature",id:"4404",properties:{name:"珠海市",cp:[113.7305,22.1155],childNum:1},geometry:{type:"Polygon",coordinates:["@@„è@„Þ°V¦VƁ°˜wnb„UÆ»nçƏ@nxܤ²llU°VnÈJސ°UôéšķUklƒô£VVˌKÞV°£n¥ƒ£ȗ™Ýy¯¯mÅkw¯bÇĔğ@Ýn¯ĊƒVğōŁŻƒķJ@Ț","@@X¯kmèVbnJ‚™"],encodeOffsets:[[115774,22602],[116325,22697]]}},{type:"Feature",id:"4406",properties:{name:"佛山市",cp:[112.8955,23.1097],childNum:1},geometry:{type:"Polygon",coordinates:["@@Èb˜Ž„InVVšnUÜxn„šVV¦nK˜lnbÅǬlalL@mn„Ubš¤l¦™šƒLUmUVlԜ¤@xmnVl°_XVVmƒkVmș@kn@VƒUK@°KW£nw@m„@Ux°x°@±„mƒna@¯ƒa„mšIU»˜ƒU¯nUV¥ÞUWmk@Vk¯™Ukn›ÑWݐƒĊÛ@Ǧ™W¯Wݗw›Lk°ƒkL¯wVa™WJXšWnbƒwkVƒ™W@kĊ"],encodeOffsets:[[115088,23316]]}},{type:"Feature",id:"4451",properties:{name:"潮州市",cp:[116.7847,23.8293],childNum:3},geometry:{type:"Polygon",coordinates:["@@°ŽÜknèmx„b„z„@V‚VX@VnV@lšIVVV¼nKlxn@@¦Vx°LXbla„ŽWbœV°£¯™W@nW@™‚aUñVœwWš»@¥ŤÅUÝǓÝóV@ńǎkUVmƒIUwÅVWÇX¹›—@W„¯bkl@nlšƒb@‚kġŽn@l"],encodeOffsets:[[119161,24306]]}},{type:"Feature",id:"4405",properties:{name:"汕头市",cp:[117.1692,23.3405],childNum:2},geometry:{type:"Polygon",coordinates:["@@‚@U±°Iš±n²mx²ƒ˜@œWºXÈÆUVx„JUnlVȍ@ŃôUǔÞVçn»VyĢÛVm@»kaÝUǼóšÛÈķKċ¥X„¥Wwğk™ƒ¯@ƒwķKƒkUm™aƒbkš™IƒšVÒ°Ċ@n„VU¼ƒ‚„bn˜`X—„x"],encodeOffsets:[[119251,24059]]}},{type:"Feature",id:"4403",properties:{name:"深圳市",cp:[114.5435,22.5439],childNum:1},geometry:{type:"Polygon",coordinates:["@@ÞLš„@xšbV„šVšK°™X°Kô¥Vw@anU„胐š‚lkĊl@wn_lKnbVmU„aUź@nÿ˜™UmÝѯUƒbk„@ÆkxŻ@™aÇX—wƒJƒƒ¯LķÝUĕ™ó™ĸóêWº@b²nmĬ™Æ"],encodeOffsets:[[116404,23265]]}},{type:"Feature",id:"4419",properties:{name:"东莞市",cp:[113.8953,22.901],childNum:1},geometry:{type:"Polygon",coordinates:["@@Ŏ@ššblKnšykVa‚KnbnIVmUƒ˜kUmUIUә„ƒçmV@bUxó¦¯LW‚¯š™L™UUƒ™a@w™ƒÝKğŚ™ƾ„„ƨÈĠy"],encodeOffsets:[[116573,23670]]}},{type:"Feature",id:"4420",properties:{name:"中山市",cp:[113.4229,22.478],childNum:1},geometry:{type:"Polygon",coordinates:["@@‚XœÒlmšV°ôÞÅ@m„¯°k„±‚@@aX¹¯VݏÇIUmV¯kk‚±Û£mw@‚Őmèżmô™¼èVš"],encodeOffsets:[[115887,23209]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/guang_xi_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"4510",properties:{name:"百色市",cp:[106.6003,23.9227],childNum:12},geometry:{type:"Polygon",coordinates:["@@lklWXL@VšI‚l@XnJn@VUUalk@mK@kny@UlU@a°™„ƒUU@VmaU@Ua@UWw@ƒn@KmLm@alkšmnI‚m@an@VIUamWÅImwU@@a@K„X@JVL„UVmUaVkUa@m„@@Ulmkk°ƒUaVUlKXbVwVIkaVmUk@KVk@a„aW¯m@w„¥laœX@KmaškVmnUl@nxVKšInU@yVaVIV@na°KlxX@@_lmXšUV`VIV™V@„n@lšbn@@WUkValK@²yl@„„VUV@@K°L@KU@@UVaXIVVV@naVkVa@K@UUK@UUa™LWa—w@m@K@UVVƒ@mVUUVKnL„mVL„K‚bVK@UUIk›mI@mUIVK@IUK@VkLƒ@WU@mU@WmUk@ƒI@VƒJk@WwX_@amK@UUWkIƒ„ƒK@LVb@mVmakL@J@bU@Ux@xƒbmI@`ƒIwm@UbmKUaUWa¯UkJWV@XƒJUU¯LUmV@ma@kkamKwƒLUUmWVkkm@aVUUkVKnVVUmXK@UW@km@Ukkm@@W@U™kUy@I@aUUmbƒ¤U@kUmL@bmJU@Ua@wkLWWkL@Uƒ@VaU@ƒLUakKWbkUWVkKkLVLUV@JVbƒz@Vƒ„@ƒVmUU@kVmK¯@VƒU_™VWakVmIUKUaU@@bml@XU@@V@LmKUV„mVUKƒƒKƒbkaUXƒKUL@x@V@l@„mxU¦„V@ŽlL@V@Ln@@VV@„nlKUaV@nLUbmJnL@VWLkbmV„@@L„W‚„XLlx„VVIVV@x@V²blUVm„LVUœK@kWWXUlV@Xl`„LX„l@@VšŽƒn@VnbVš@lVUVUÈVbš@@`UXU`l@@XUVm@kš@xmVknUJVXUbmKULmbx@VlJ@LVbkKUbVLÇUUVƒUVmU@VaUkUKƒVUwmLkUUVVlƒbka™XmwƒKUšVVU@@V±Uk@VWUUm»XamU™bƒKk™`ƒ„™U@UnWW_kKmbUVUVmnUV@„nJVUlšUbU@UV@n@JmI@VmbnVUXlx¯ŽkKmnVV@L@V™bkV™Umm™@Ub¯LmlUƒL@VWLkmkLmmn£WmnKU_mW™š™bnbmxƒ@U¦UJU„@Xmlk¦@‚mnUUm@@Jn@lV„ÔVJnIVW„I@a„ƒÆK@I@aVK„IlŽÞnnl@nl`nbÆX²l@xV„@llbVn²ŽVVl@nn„V@IlW@Un@@kVa°KšnÈmVaVXUlaVƒÈU„VlwôUlynIVašan@lVXb‚Iš@n¥la@Kš_n‚@bÆx@XnJV„nKVz@`VXVšU`@bƒ¦UV@VšIlx„UnV‚K„XÈbšVllšbVbnVn@"],encodeOffsets:[[109126,25684]]}},{type:"Feature",id:"4512",properties:{name:"河池市",cp:[107.8638,24.5819],childNum:11},geometry:{type:"Polygon",coordinates:["@@lLVl„bVV@nXVlI@JVX„mšn„W°b„IVV@‚ln„@nalVUb„nW‚@kVkÒlbVKn²°bUŽlV²@˜X@`nb„aUI@ƒ°wlU@aXJVI@aVK@wUamIXm‚@XUV@@bV@Vm„ImnUUwVaVKXU‚nVK@akƒVwV@nL@UV`n@@X‚lnIUJl@X¦˜V@aUIVm@anƒV@UwnL@VlbVL@KVVXUWƒ„wUUVUka@UVJnUlbnalbVVn@°„„LV`Þ@šXVxV@@bVlUVVbXnWlXnmlš@XXWVXJmbUI@V„llUVkn@@VWV@Vnb„@VXUJVnn`lLVk„a„»lVšLnw@WV@lInw@WnU@U@m‚knUVó„K‚wUmUXUƒU@@wVJVIl@XKVVVbVI„J@Un@lŽVLnm„b@U@Ul@nUš°VUVJnnVJV@„@mVU@ƒ@wkUVwkKWk™yUUkU@alkÈ@lJ@x„Ilƒ@UUWVkUw@Kn@@kmaƒVUl™UUL™ÇƒUUKl@UUmL@aXU@mlUUwmKkUUVKVUƒaƒKUnK@U@Vl@XUWU„KlwX@šb@K‚@XkV@UwWJka@aUwmV@U™@@U@wUm@»kLWVkIWŽXnmV@VkbmKƒLUbk™Va@aƒa@@aVU@aVak£@ƒ±UkVU¯V™UUƒJVƒUIƒ@kxmUmWUbL›w@K@aU@@aVU@Kma@aka@_VWkk@UWVUKULWKULUš@KUnƒwVaUKƒxU@UmaƒL—m@kVmVa@UkƒmI@ƒ@KmIkxU@@K™U@mmakI@VƒLkmWkkJ™_U‚@V@L@n˜xXbšKVb@VVL@V@LUbUlmbU@UUWJUb@VV@@L¯K@LU@UVƒƒk@±z@‚kLUbVl@Xm@™akm@ƒU@UšUJU_™VWŽkn@`W@kw¯LmbU@UJUb@zmV™JULmwk@mVUn™lnb@L›Wkbƒ¦@x°nXŽƒb@bUl@LVlUnlbUJUxWakLUVVb¯„llkn@Vƒ@@nVbUlVbUnƒVUK@IƒW@L@bV@nxÆJnXVbUJm@@bnmJ™nkl@b‚nnK@L„m‚@Xx@VVbV@nb@UVVƒ„¯š@bkV@Vmz@lnLl@kŽVbUVm@mI@Wk™J@UWKkXkl"],encodeOffsets:[[109126,25684]]}},{type:"Feature",id:"4503",properties:{name:"桂林市",cp:[110.5554,25.318],childNum:13},geometry:{type:"Polygon",coordinates:["@@nU@J‚X@`XLm¦Vb`lšVXXWš@VblČnVšŽlanLnmVLšK@_Vaƒ¥@kUa„@VmVb„aV@XVVzlVVK@knKVmX£VKšLlbnš@b@llL@xĊôXaV@°È@¤„bn„V@@Wl_„V„U@W„nVamw„wVbn@„K‚VšLX@VmVUxlV@šnVV_nK@m‚I@Wn@@IšUĊ@@wVWX@@I°VVm@wmU@m@IUƒV™kƒlkUmmkÅV@@aV@@Wn_UKla@kšaV„šlVanb@k„@@KlVn@@aV@nIWW™UUaVU@™kKmwU@UImKk@UU@w@W@‚™k@™UkWƒ@mk_W@Ua@a™ƒƒ@—¯ƒmV£@mƒUUam@—kWakƒVama@UUm@nw@alaUmnUlVlIœV‚™šLVyk£Vm@k@UUJkƒK@kmKUw™KkWK@UXImyVwnI@m‚ƒkUlkUKkUVmƒw@kkJWUÈm@_k@@aƒaW@U„UJUwU@@IWKkƒmUUV@nVl@bVb@bU‚UXƒakw@ƒWUkbkKƒbm@™xUlkLm@@wmKUX@‚™UaVW™XVmU@@UUUƒxkmWXkKkUWaUaUb™L@`UL@LV`UXmK@VmakLVbkL‚xUJUIVbUVVb¯KƒV@Xnl@lVXbmÒnV@L@VWKkVUIWJkIƒŽUamUUbm@U„kU@JUbW@X„WxUam@kbVVUnUJmUUV@bƒU@UUV™@ƒVk@ƒbƒmULV¦U@V„U`VLUL@xVbn@UJ@nWJXXVŽVV@bkxVbUx‚Lšš@x„¦@šU‚lXUVVlULV@@šnŽU„ƒb@xl„nJVnlVknUlVUbmŽU@ƒbVš„x"],encodeOffsets:[[112399,26500]]}},{type:"Feature",id:"4501",properties:{name:"南宁市",cp:[108.479,23.1152],childNum:7},geometry:{type:"Polygon",coordinates:["@@lKnbnU‚@Ua@K„L„ƒlJVX@VnL@bW`Xxl@„I@U„Jl@nV@X‚V@nXV„@lK@UVL@JULVJ@nnJlœVJ@VULaƒLUKƒnmKULVVUŽ@nU„š`lIXlln„K@UlJnb@nšV@LV@lwnJ@L@„nJl„@VUbUn@l˜n„KnbVŽV@„wVLUb„xVm@LV™VKXLVKVLXU@VllUX@`lb@bnb‚L@ŽUV@bV@@b@Lœx‚KVanXVƒUUmVUUUaVUky‚UUa„ImK@mUUVUkKU_@W@UVVVIUW„UVaVU@UUKnƒ@k@al@ll@bnL@b„VUV˜X@Vœ@@b‚Knblmn@V_@aUalL@a@akK@kVKUKlwUUnV¥VmU_VWVIVaX@Va„alńK@LVJnalL@LnK„wlVUw‚mX@VXšƒlLUVnblaUmVUVwXU@Wm¯Va@ÞKnw@w™mšk„»‚UVW²a@_mW@U@I„y„LVUUKW@@™„LX@VUV@@yVU@UV@nwUUmJka@IU@ƒmƒVkaW@UwUX@`ƒ@kLWUk@mƒkUUm@k‚UUWkUƒkWxk@@VƒK@nV@UVaƒUUJmIkVƒ@UamLUbkVmamLka™@ƒ‚kmL¯WI@wJmwƒx@akU@aUKmbkaW_nW@_U@Wm@a@wkwUKmƒk@ƒbkb›w@mKUkkU@J@bW@kVWz@bVUa›VUx@„ULkJWbXVVXƒ`@œmJUVU@@Lk@WbU@UJlnXlm„Vx@Ln@‚b@K„LX„WJUUW@kƒaUVUbmV@nnV@n@lVLƒVmLX‚mXkV±@kxÅL›šUbJWIÅJ@I‚mXalkUamKkškL±aVwKƒUU@mÞnbWJX„m„@lbmKULWUUVkaƒbnn@Vl@VVV@VƒbVbnLWLXJWxXLV@@VV"],encodeOffsets:[[109958,23806]]}},{type:"Feature",id:"4502",properties:{name:"柳州市",cp:[109.3799,24.9774],childNum:7},geometry:{type:"Polygon",coordinates:["@@ƒwU™„aV@nVaUVklmkUUmmIkƒ@w„aVƒm@™U@VKUkVUkWV@™ƒ¥@w™™KVwUalw@aUUUWWXI@mVIm@Ua@wVKUKV_UƒV@U¥VK„n„al@„Uš@VU@V„V@aVUnVVIVmUUlan@VbXwWƒX@Va@IlVVƒn@VanVVb„lJXIVJlUXL@U@KmUnÑWakU@mkƒJUI@mk™@wUmmUV@JXaWIXWmaUIƒJƒkk@W„nJ@„ƒaUak@›kkJ@kUKU_ƒ@myUóWUkm¥kUmL@KUKm@k_UmVa@ƒk@@UmU@mm_—JWIUVUŽWLUlbVUJÇVUIVwƒKUVk@mU@n@lUL@Km@@l@L™VƒzJmUU¤m@UbV²U`U@@¼Vn@x@Vš@@VnUVx@blbXIVxU@Wl@@L™aW@kxƒLXVWVk@@U@VmLVŽ„L„bUVULVV‚lnLVxkV@nWV@bnKVVk@VL„VšÈVKšVVk„Unb@lm@@LVxUlVX@Vk„ƒJ@wkIÇ@kl@blVVVšzXllLUxlV@x@„UV@nƒ‚U@UImmUIUV™¯mVk@@V@VƒamnUKkm@@VƒIUJUaUUWLk@UJUI@xV@V„VWVnxƒLUômVV„@VkVVVUnV@UVkL@VVV@bVxla@bkXVJVn„`nU@bƒb@bVL@VnJ@„l@šV„aU@@_lW@UUU@Unƒlll@XLl@@UX@°bVWVanLlknVV@VVX@VVƒnUŽVLmbXJ@nllXX@`VXƒlmaXVWk@Wkƒw—J@„VL@J‚bnU@bn@@bVKUnVJVIVVVL²a@bV@@Vl@nUVakalmš„UL@VUL@V‚a@mXl@nK@UlK„L@Vl@@nkllb@š„Vnn@‚šnV„™V°l„šVInwlKXxlU°Žn@@ƒ‚I@UnVlakUJWkUK@anUWK@_ÞJ@U"],encodeOffsets:[[112399,26500]]}},{type:"Feature",id:"4514",properties:{name:"崇左市",cp:[107.3364,22.4725],childNum:7},geometry:{type:"Polygon",coordinates:["@@@JVzšl@V@Xn@ll@VlnX@@VWLnŽUVmUULVlUV@blnUlnXVV„K‚xnLlb@lnbU@Vn°KVV„I@WXUlI°VXb‚VVbnLVan@‚x„J@_nJ„a@wVwV@@a@IU@UU@WKXwWIXKmKUa„a@U‚UUUk@@Umm„albVUXVVKnL‚a@knƒWƒXImanÝV@„V‚LUx²blKl™nLVbklWbn@JÆIXJ‚IVaœ™ÆKlw²@lUnWWnK„UUK@k@mmU@mnUVaVU„b@lVXVXIWƒƒK@Lam@@KUwnƒWkkmVIV@Xal@@KV@VUnI@›„_UWWUkam@kkm@ka@mƒk@wkJWIUU@WXkW™XkWWLUUƒ@UakLƒW™XV±VIVWUU@anUWaUK@IU@Vak@@UUKWaƒ@m@ak@@wUkla@mUaUklakwVƒ¯¯@WWUkLkKmaƒ™kLUnV`UxWX@Jkn@bmlƒakkk@ƒb@l¯bm„ƒbJ›b@VXn„bVV@„ƒbƒJUkkKWVU@mœÛVUUW@UVUJWXkVkKmUL@WW@U„Vl@XXKW„XJ@XVlmbUxnnm@UlVnV@XVm¦VJb@šmLkKÇbXblVkn@l@bWnX`V@@IVV@ŽV„V°n@@_naÆVVbUVVbUJnzlVUl‚XkV@Vlx@X„VnxƒbƒKUK@b¯VVUV™L"],encodeOffsets:[[109227,23440]]}},{type:"Feature",id:"4513",properties:{name:"来宾市",cp:[109.7095,23.8403],childNum:6},geometry:{type:"Polygon",coordinates:["@@nVlw„@VJU„„IVVUšV°lU²V@„l¤Ub@bUV@b‚@„b@bUblšVa„KnLla@UnUWmXlJXUlKV@V_U±Van@V£nV‚I„yšU@K@kn@@LVK@k@mnVl@VU„LUxVJÈUVIU‚aVkXKVVUXJ˜In`@nnV@Vl@@„UbVnl`n@VL@LnKlVn¦VlôXV‚nz„@V`VL@llIœll@Vb„b@ƒmIXƒl@„l„IVJnbWXXJWb@IU‚nVVn@xlš@nVJ„I@W„U°LUaVUUaVJVIwlKUalKnb@UnLVWU_@KVK@_šKVa„@VKU¯VLVKn@la„aUkU@maVU„J@k™@Um@XmbkyVaUIUU@KV@laVn@KXKWUkUk@ƒaW™UUVw@aXKmƒVaUUkšmIƒlUU@wUa™xUmmU™¯™U@WƒLUmVIUym@UVmUa@wmw@çm@aWLU„™JUIUamKmL@™aƒx¯¥ƒkU¥U@±„k„UVmKU_mJUbkKm„ƒLÅǙ_@WWUXUmaVUkK™„UWW@nVxkUƒxmL@KkKmbUI@KƒLkƃbUbW@UbUJUXV`UnU¦mŽVVkxVLUL@llL@b@bkKVb@bU`m@knmaL@a›@@U—WVUƒU@amK@akkk@@b@lm„VL@VUVUbƒVVXUJUU@V@XV`lLUVVV@nnLƒJVbVlzUVVbVVnUVVU„"],encodeOffsets:[[111083,24599]]}},{type:"Feature",id:"4509",properties:{name:"玉林市",cp:[110.2148,22.3792],childNum:6},geometry:{type:"Polygon",coordinates:["@@VJUXVVXlWX@V™xVnX@@`ššULWŽUXÅbWK@mULUUmJ@n¯b@l@VULVx„x‚XU`VXXJVI„V@nm`@nUŽVXn@lWVn@b@Jn@nU@Lm`@Xn@WJƒ¦U@@VnL„lV@@Xl`nIlJnkVL„w@KVK@UšaVL@bVKX™lUUKVK@I„VšL„a@U@WšLUlVL@bU@@blb@VlbUxVbXUVJ@xVL„U„lV@VU„bVLnKl„XJ@L‚b@an@VanL@`VLšKV_UWl@U_„a@WVInlVUUUVm@I@W@wVakIWm@U@ƒXwlaVbnI@ƒm»Va@aXaVLšU„»@aVa@k™KkL@KmU@WƒzUK@wU@VWUUVUUKUa@mKmbUK@_nWVaUkVaUaVUVLXKVƒVUVmVI@UkKkLm`UkW@UwWW_„UaU@WakXmK@xUXƒJkƒUUWUk@Wl—mJ@km@@aUKzmyVk„a@kkWVUU¯lmU@@w‚kkmV@Vk@mÅIƒ‚Ukƒaƒ@Ub@m@UUU`mUbWaWmb™X™XKWIXUWm@љ@y@UkIUJUUWLUWƒL@UkVUxW@kaWbKWnXxW¦n„m`XLVlUbVbUx™I@JmLUKUb@VW@@bkL@b@VlU@xkš@L@lƒxXxWXX°V@VVVbUVV@UVVbULVnVJUb²b‚aUb@VVVVInlV@VnXaVUšlI„VUb"],encodeOffsets:[[112478,22872]]}},{type:"Feature",id:"4504",properties:{name:"梧州市",cp:[110.9949,23.5052],childNum:6},geometry:{type:"Polygon",coordinates:["@@VbXblVlLXWln„wVV@VV@UnšWUXVbš‚@VWXa@kVK„UaVaVkšUlyX@Vaƒ—VmUwUaVU@UÈymI@aU°@š™nWV@VaVaw@IV@VmnLVK@kmmna@™„™VbVI@aV@XbW`U„„LUVVx„@VbUV@bl@VLXblJn¦lL„°°@n™@K@UlLnK„a°LWbnJ„¦UÒV„UllLlVnKnbWnn„V`„w‚@@Xa±™n™l@XKV_„WVkVa@kVyUa@wU£UW@UIVW‚@@a—wWaX_WKkVmUULmak@UJUI@±m»™—k@m»VyUIm™nmmwnkUmVaVIUn_mW@»Vk„@VwkmmUXa@IƒaVm—mƒ@Wm_U@mIUWóLmUk@laXmmkUK@UmKULUUmWULƒ@VakU™@Ub@bƒ¼™VUKWb@bUbn¼@„mJUakbWx@„@VXnlJUb@x@X@JUnVVUVmkUJ@XƒbV`k@VXU`™LUK@_mKUbm@@b@„U`@nlV@b„UnbVbn@@`VbUbVV¯bm@@mJXb@bVnUllVXUlbUl@LU¦VVmŽkLVb@b™l@V@XlK@V@nUJUz„°mŽwmLmlXbWVU@UUUlƒIU@VVmV@@¦‚bXbWxX„WlXVWL@LUmkbU@@LVVVJUblzna@WVnš@@lƒIUVnbV@Vlƒbkbm@ULUKV°ULƒ@"],encodeOffsets:[[112973,24863]]}},{type:"Feature",id:"4511",properties:{name:"贺州市",cp:[111.3135,24.4006],childNum:4},geometry:{type:"Polygon",coordinates:["@@nL@xn@lKVkšwn@„alLlaXV@„lx„bVWV@aUa@aUk@mVUnVl„XL@JV@VxVIVƒX@„b@bl@@`ÇnXVlI@l„xUnlVVLkllV„@nmJUxnzWJ@VXLlŽšLVxnL@l„LlŽVI@V@lUnl¤Uz™Kš@„Vl@š„L‚l„Lnš‚b@VnVVU@k„a‚Knxn@VkVJ@ńUlakmWIUaVanm@_UK@UVWUa@klXam™U@Vmƒ™VIXW„@lUVknVlKVLXŽVXšW@b@VlšnnVL@KXL‚Kn@lb@UnW°@Va„X„WVb°aVa@I¯aUkUaVKVwƒaXk@a„a‚™@wkm@alanUVw@alK@Umkw@UƒaUmU@WXUaUK@UW@UaVWI@¥Xa@w@WWšVƒXwƒU@mKUXUWVU@a¯kl@akU@UULmK¯VUVW@U_m`U@@xVbUz@lUbUlƒXU`WLk@mš²šWb@Ž@ƒxU_mƒXmmamLkUkKVkUƒVу¥mIXa¯KƒbmLkK@V@Lmš¯@ƒ¯kKm¥kIWaUKk@@aVUUaƒ@UwVUƒKVƒX_WaU@@bUJUaƒš@šmbnn@lULmKUnU@@J‚xUbUbU@mX™š¯@VŽ@bnJÇz@VUVVbVxUn„˜UbW@kz™VUlUbVbƒŽUL@lWb"],encodeOffsets:[[113220,24947]]}},{type:"Feature",id:"4507",properties:{name:"钦州市",cp:[109.0283,22.0935],childNum:3},geometry:{type:"Polygon",coordinates:["@@@IlVVlnL‚@œxla„al@n„VLlx@x@bXnV@@`mXX`lbnaVL@blV@b„wnx‚I@xXJ°nK‚l„š@lbnKnblUVanKVb„@lUnJVI„VUb@V‚U@m„L@Ul@Xw„llVVXV@lVnlVn„l@XVlK„@@_VWVxX@lb„U„nV@@JlbnIlmnVV@UwVK@U@k°a@mnIVVVK@nXLÆaVWXVK™™@_W@Umšw@UXWWkUUVWUIVaƒUkJ™UVWbUmU@mkUJUU@UVab±aVaUIUmVKUaVUU@VUUaUUU@W¯XWWw„w@k@Kl™@wkV@U@alK@aX@@UmIUWUIƒ@mmkXU`U_WJUnUJmUk@@amLU@UVW@UkU@@VƒbUWVUk@@wmKkUWLUWX@JmIƒlUkkKWKkLWU@UKWa@bU@@a@_UKWƒUUUmJmw@nV_@ġğKóLmbU¼VÆ@xUXƒ@Um@wklVnUn›lkaUV@„lV²WVklWXXbWlkVkIm`UUƒLƒUU@UWƒx@XU@@lWLU@kbUbV`UXllUV@bmb@LnKVbULm‚šnVVIV`X@"],encodeOffsets:[[110881,22742]]}},{type:"Feature",id:"4508",properties:{name:"贵港市",cp:[109.9402,23.3459],childNum:3},geometry:{type:"Polygon",coordinates:["@@n@VzUJ‚nVŽ„K@XšVš°nVVnšwVb@xVV„knJl™VVUbn„WL@bUxVVXš„bl@lVXkWƒXwWaa@¥‚@nUUUV@„JVkVVV@XUWanknK‚xnƒ¯VyVI@m@UkL@W@Ušk@aUalKnUUV¥@KVkkaWVkUVkUm@aWanI@n@°aUUVaUa@_m@UamaƒV@akU@mV_@ƒa@KWIkƒmLUKƒaUVU@ƒkƒVUK@wUIWVUaVwka@Uka@aV@@aUKVk™K@X@Vƒb™KƒU@JULVLkVWšUL@aUK™b@VUL@LƒxUKmlkImJk_@WU@ƒkmK@UV@„¥XIm@@Wn_@KmVm@@I@aUmkXm@UWV@mn_@mƒUUJWIUWV_WƒwU@mUknVVmxU@@VUV@zU@UVW@ƒK@šX@VLUVƒKƒz@J@VnX@`±bUXVƒ¼™lšn@xmxÝL@‚Ubn°@XWVUxUVVnkbWVXV@Xš`ÆȄKnƒlLVanIV`nLVUlƒ²ƒV@V¦„l°¦„w‚b@šnKnLVbVJšIVƒXK@b‚n@ènx@xVbUnV‚"],encodeOffsets:[[112568,24255]]}},{type:"Feature",id:"4506",properties:{name:"防城港市",cp:[108.0505,21.9287],childNum:3},geometry:{type:"Polygon",coordinates:["@@XV@X°°U„lxkbVlVb@nkbVl@xl@@b@n„‚XbVL@Vl@UbV@@JVLXbmV@bVVUXUJU²šW„XlKVb„@VVXKlXšWlXXWV@VXJlI@x„l@nlbn@lln@lbXalIVK@ƒVwœUVb‚U@aXylUX@@aW@U_UJmU™nVKUamL@Kna@aVUkkVWU_ValaV@XK@kV@@W„wVXV@„V„KVVn_lJlUXkWaXWlkXU‚±kU@ƒVUlbœkVmUmlk™¯Ý™™W@mb@¦VxULm™kJUU@ma¯wƒmkX@VóJ±bUVUXÝWk™lWXXlƒxUaƒbƒIğ™Ç@U@mVUKkkm@UJm@XnWV@x"],encodeOffsets:[[110070,22174]]}},{type:"Feature",id:"4505",properties:{name:"北海市",cp:[109.314,21.6211],childNum:2},geometry:{type:"Polygon",coordinates:["@@VaVLnK@IšJVwUaVaUkWKn_mƒX¥WwXm‚LXalbU£UyV„Å@ݙwm@™°l›LÅUƒmk™mwÛaƑLÝUUm@ȣƃV_„Ó@£UƒƒUVƒ„™¼U°W̄™ÞVbXbôx@b@bmV@ǃ™UÝ@@ĢU`m@ŽnxnIVV‚VX„VL@`@bV@@aXbVL‚@XVlKXLlLVl„knJ@I‚WVXXKlVnL@xl@UVVX„a@UV@VlX@VUV@nK@bl@nVVIVmXIV`V_lWnn„@VJVXnJ"],encodeOffsets:[[112242,22444]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/gui_zhou_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"5203",properties:{name:"遵义市",cp:[106.908,28.1744],childNum:14},geometry:{type:"MultiPolygon",coordinates:[["@@@UnUlJn„w‚JU°VL@bnVšU„wlJ@XƒŽXVlU@klVUJknl„UllL@bUJ@xULUlƒ„UblVkblbnw‚UXmla@„wV@VK@L@UXaVKVLXWƒUVa@U@Im@@W@£UKUakKWIXU@al@@llUnL@W@Un@@VlUV@VIUanKl@Xb@lmxVb@b°bb@nlJVVnnJ@b@L‚V@ln„@LmV@Vx@blnVK„nlJXIlw„J@҄b@nlK@Un@UL@VVVVUUUVK„l„@VUVL„J@UVUUw„@Wm@™„UV„ÈVlbUb@JšLlŽX@@x„„ƒLmŽk@@nlx@bUJUzVJ„@@LVxUV@bWxnLnVVK@_‚K²xVbV@n¥@aVI@b„@l@Va„Knb@n‚`n„mmý„W@ƒU_šwV@VlVV@Vn@n„˜@nI@Jn@°¦VaUU@™„mVVWVaUńU@aVKnƒVbVUmmU@a@kUw™m@aUUmUUJ¯lakU‚aXaWUUaVƒkk„amkmUnVlULƒVlJ@XU@UJWUUw„k@aU@WbkWƒL@U@WU@@XUKmV@aUVwUĕUJUamUUVUÑm™nIVJ@kl@XalJVn@KVLœ¥@UWIXWmU@mVUKnUWLUKUaWUUKVU@U@anUny@UlUkK@w@a@aVUƒ»UkVw@Wmk—JƒÅmUUVmwXalLXWWUnam@XkƒJ@UVU@U@W„@@U@I@Wl@Ènlw@KXLWb„lVUkalKUU„VVaV@@wnIlaUmkUƒKWU@KkUkLWaƒKUUWUn@VƒK@LnnWJUIƒVkUWVnV@V™@@XƒK@VUIUJ@IWJkX@VVJ™IƒVkK@I@UVaUWk@m„@wnUWKk@mxk@@„lV@b„xmb@x@VUmLkUƒJ@nVV@b@VkLVbU`¯I›l@™U_UW@UU@™™ƒK¯wm@™xƒL¯¥kIƒ™ƒ‚@bkbƒ@Ua@ƒm@kkW@XVbmV@ŽkV@bWbUbV@„¦ƒxXlmVk@ƒ¦™bkaWL@KUImK@wUK@VUI™b@bmK@LÅy@akXW@kbWlXblL@ŽULUbƒ`@U™kUymX¯@mšUJUUJƒL@Lm@@WX@lU„VlšXll„@l@Èk°V°Ž„X@VU@UVll@XUJVXUVm@@VXLWlnV@Xƒšk@mVULnxV@@bm‚kL@VWLUbU@UVm@ƒb@ķ¥UnmJ@UUVƒkkJUšlÔU`UIW@ƒ°kLUlUI@WVI™U@mWKkXk@ƒ‚WU@bXšW„@J@xX@l@LVl@xšLVxXX@x‚KnxVknb‚KVV@U„L„WlXU`@nUlšX@llVXšVU„KlkUKlI@anKVLXKVaUIVWV_VK@VnLlU„»VKVL„m"],["@@@KlKkUUVVX"]],encodeOffsets:[[[108799,29239]],[[110532,27822]]]}},{type:"Feature",id:"5226",properties:{name:"黔东南苗族侗族自治州",cp:[108.4241,26.4166],childNum:17},geometry:{type:"MultiPolygon",coordinates:[["@@VV@XkV@bUbWJU¼Vb@Vnb@bš„@J@bƒL@LV@UVƒlUI@a™KULVb@bkJmx„šlLVxknVJk„‚xnKmnnL@bn`WIXlWLU@UxVbUVmKV„XI@JVIVJ@U„L@Wš@@UmUXUlV„UVJXImm@K„L@UVmVXV‚„LXblKlV@LXV„LlVVnkbmJ@xnXl@šbXa‚@Vana„ÒšL„m‚VnIl‚Þ¦°k@b„@@lV„nJlUnš‚VX_„@lVlK„šV„UUxVLVWVIXJšUlnnWlI@KUaUUVKn@VaVXV@na@ƒmw¯@mUkJUamI@lk@@am@@I„ƒUmVImUUw˜™@anUVaUU@LU@WaWUXWW„wV@VwnU@L@ynbl@@X@a„J@nW@@Vn@„lVLlxnI„lš@@UWKUƒnIlJXIVllIVVš¼XK@aVI„V‚@@bn@VKXLVKVVVInw„J@UWI@mX@WKnI@KmU„UVJUL@V„KW@@k„@aU@@W@InJWUXwWI@Wƒ@¯wkaVaUIl@nŽValIXWWI@UUm@anwWkXWWIUbk@UJmIUamKVUUUVVama¯VkIVVUlKnXVwX@@WVaUUVa@IlƒaVmƒkna›wk™UU@ƒU@mUVƒšUVwœl°LVbnJVU™¯la@mX@@UWKXU@aV_V@@JlkUƒ¯@V™nK@km¯k„U@ƒWUW@mmƒU@™kmlU@wkL@WƒUkL@VmLƒJ@b@V@bknUUVK@UVKUK@Uk@Wa@LUVVnUbmVk@@UU@@aƒV¯K@U@UU@WmUL@aU@WV—w@ƒ˜I„xXll@UX‚K@KXXVJna@wWaƒ£naUKV„m@UU@mUmalm@@XkVm@U@VƒLmWU@kkWxU@@bVV@VkXVlƒVƒ@UUk@@ƒmI@KUw„m@UmVƒUUwU@lwkV@IUa@mUaVIVKVa@w@U@™UJkb@n@bmJ@XmlVUxWXkJmUkUUVW™xUlU@ƒaULUšmbU@@‚WXkmƒL@xUV@nUxÇm@„XLWbnlƒnV‚nnUV˜U‚nVVz„@lbUVVlULVb@V@nUJkwm@Ux@bWbUK@UULka›JbƒU™U@U@lUK@XUJmn™J@bU@UwWa™x@zkJWnUJUUVšVV@bXn@xVb@J™L™m@X™w@`@bkb@VmXUV¯L@mW@@n@V@‚ƒL@K—IW@@aƒaUx¯@U„m@XbW@@L„V@bnVWVkKUzlV@bÆa@lnI@VV@@LnVVKUaV_VJVbnU@bn@‚‚nX@yVIVxXKVLlUVaXU°J","@@@KlKkUUVVX"],["@@UUVUkUmV@ln@VXVK@K"]],encodeOffsets:[[[110318,27214],[110532,27822]],[[112219,27394]]]}},{type:"Feature",id:"5224",properties:{name:"毕节地区",cp:[105.1611,27.0648],childNum:8},geometry:{type:"Polygon",coordinates:["@@UkVƒ@k‚W@Xn@@K„KVIVVIn™°@nWVzšl@V„_VaVK@kKWaXklaX@lW@bÆz@KnL@ašaVJ@UVL@xnLVJ@LXKlbša„¥l@nUWk„wƒ¥U@VaXa@amLkUƒKmƒ¯kƒmkIUaƒKUIWƒkKm@anw@mlwXIƒmƒUk¯@a@amUƒ`kkKWVkxmUUak_mJmw@w„mXUW¯X›_@WnI@aVwkWWýŃU@WLkU™aUbVV@lUVVnm@kUmV¯™kK™LƒwmVUUaWV™aaWw¯wƒÈ@VULUVUUƒK@nWJkI™l@Umxnbm@kbUJƒa¯bUbVxmLUV™aU@VUUWxkVVV@bUV@XWbnlUbƒbUJlbUV¯b@z„`WbXnmbƒaƒwUwVWUƒbUxmbU@Uam™@Vƒk™VaƒwVaUƒWI@mUKóz@lUlÅ@WIƒb@xXxml@XklULWKUmwUa¯KUXWJkaULmKkLWbkKUVƒImƒƒWa@kUaULƒW¯LƒK¯@kbƒL@b™x@J@bmnnlUšlzU`U@@Uƒb@„m‚n¦°bU„Vx@bkVm¼mx@mk™mVV@bkxVn„aVV@bU@mL@b²`lIVV@lXLlš„bVxn@@bl@XllIVšnbVšn°°wlbXw@mVa°lVnU@mš™VLVbn@@b„@@WVnUV@Xlxn`VznJVb@L@bV`V@šUnwšU„@WUXKV@UUlmUUlaXalLšm„bšIVbnJVIlVVaUUnWVXn‚VL‚k@ƒnWnblnlb²x„xVKVXlVXLVW„LlUVJna@wVL„¼@JVX@`@nnx@nWJU@Vx@XXKšŽUblxUš°„LVKVVlL@KnbVUnJ„IlUšƒnKl£VW„x„IlJ@nšVÞUVVnb‚VX@V_°lnK","@@@UmWUwkU@Um@@VkL@V@„„‚V„VkV@nbVa@ƒ"],encodeOffsets:[[108552,28412],[107213,27445]]}},{type:"Feature",id:"5227",properties:{name:"黔南布依族苗族自治州",cp:[107.2485,25.8398],childNum:12},geometry:{type:"Polygon",coordinates:["@@‚V@IöalK@UV@@KUaVIVVœLlaVbVWnX@‚@LnUlxl@naVLXVVaVU„J@lUUanWWI„@VlV@Xbƒb@V„n@VmVVbk@kU@V›V@X„J@zn`ULW@kK@_WVUK@LUb@Jlxn@nnWlU@@b„x@XVVU@UbVb‚@n`VI@VVLUlUIUV@KmL@VV@XIV@@lVLVmXV„@WLXLW@U`šnkb@Vl@UL@VVV„L„llX@`lIXb„J˜IXW„L‚aVL@ŽXXW‚Ģ™b@bmK@L@°@Vnxmxšn„K@xVn@VkL@V™Lƒakbl`VnnxVnUlššV@@VVXV`@šœk°JV_UalK@U@aUU@m„IlVnK‚V@U@wnaƒw@akU@ƒl@nwl@XLmV@xnƒl@VXUb@V@JlL„UšJUI@UlWUƒnLVUUaVwV@XKWkXJm_@amKnmmLwlƒUIlmUwkKƒ™nwlI@aUaVKšL@bVJ„kVUU@@K„K@a@I™ƒ@ama@UUaV»XIVa@alU@WUU¯IWVUbkVUKWLUwUJ@zmWm@@amVUaUIU`VbULmU@KU@@UmJ@kÅb@akUVylLXUmU@aƒU@KX@Wan@Vƒ°@Vw„b@bX@˜J@L„K@@U@mX@@n°KVUnW@Ula@a@_šx@WšnšK@IUa@wWm@aUUU™VVVIXmlI@yšwXbVxV@@ašInmVI@WVL@k@VšV„V‚aœIlbVK@VVLXa@aVwn@lxVI@m@UUaVKUkVUkaƒ@UymUV—VUmmU„mmkXaWK@ƒÈnVw@mVU@w„KlnXW@V@naV™VKUk@KVIUWƒ@mk@KXU@Um@@lVƒk@UVJna@UWaƒL@a@ƒXa@kmmVUUk@mkkƒamJ—ImJUUmIm±aUUkambkamVUU@VlbUbVVƒxX„WVUU@VUakU@UmUV‚U@mnUVVnUbVJ@b—UW¥kLVamVkUaWJU_UVWKk@@nl„UVVJUXm@Vm@UnVlmbnmJUbULU@@UUKWVIWxnJVb@xUL@bUJWIkxƒbkb@xVJƒbmU@kW±LkKUkVa@a¯am¥ULkalÑlKXUWƒXƒaVakImVƒ@ka@UUƒJ¯aƒX™mmb—KWU@wUUƒaUa™KmU@UXlWb—¼WLUKUb°„UlVbkbVL@VƒšƒJ@nVlUbUXmJ@VX@lbUbU@@bWb@VnLVJ@bVVUz„ŽVL@lnL@b™VVVULmKUk™Jkbm@ƒxVb@V—kƒKVnnV@b@ŽWXU‚„nV„l‚VVXVJUXlVXbWV@VU@Ubk@@KWbUUmL@JnXV°XJ@_‚`UbkXVVlÆkbƒ@VLXVV@‚V@k„KXX@`V@@n"],encodeOffsets:[[108912,26905]]}},{type:"Feature",id:"5222",properties:{name:"铜仁地区",cp:[108.6218,28.0096],childNum:10},geometry:{type:"Polygon",coordinates:["@@°a@aÈbVUlU@aVKnVV„VUlyX¹lWVa@U™VƒnUVU@m™@mUl@„mÞw„@‚xnIVbna@KVI‚J@kwV¥ƒUXÇVkVW@kkKWU@aXUWmnIVa°VXbmL@VVbnVVVUb™VbšJVbVKXkVKVanU@aWnWUWa@U™nk@mVIVK@wXxlLXbVJVlKœbl@VI@mšaXalVV„VbX@@ašalnkx@b@V‚b@Vnx@bVVUXn¤WXn@Vl@Vlzn@š`@I@KUU@ƒV£namVkXa@aVK‚nnU@anVlKƒa@UUU@amk@»kƒU¯@aš„VWnkWmkImU@akaVm@»VUV@UKnkW¯XWlkUKnIWaš@nmlIXmWUnwUwWm@wULmaUJkIUaƒaWa—klwkwmJmU@bkJ@XUJ¯W@XbWbUKUkWJUUVKnn@UmmXUWa@mU@@UI@WmXVykwm@kaULWwU@¯ƒlKUUVU@mU@UkmaUbmV@b—š‚xVnVUJVnƒ„@Jn@@bl@@knJVblInV°@nx@„mbU@UWUbm@ULVVVb@LkJmXkm™VWIUJUXUKVwƒV™UƒŽkLkUƒ@W`Um™kVmIUƒ@kƒ@@a¯lÝ¥kmJUƒn™KƒÑmbUb@Wb™ak@mWU@UbƒUVVkLlbUVƒkXaWK@LkxÇmk@@X@J@Vƒ@@X@VUV@V„IWln@mbXVWXkKWbnxVUnV„ƘInl@XUxVl„¼UV@b@b@xlLkV@VmzmV@b@VUVVLXVVbVLXKmVVLU‚@nnVWXXJ@V›¦UK@LUmkIWbk@@lUImJnšVÒVUnVVbVIVĖUxV‚@bnUVL@WV@@X@V„KlXXaV@@bƒlVxXVVIV@@WkI„UVKUkVmlnnŽƒbllU„VbXVWbblVkb°ŽVInVVV@bšnVx@l@bnVVnUŽUam„UL@bƒVVÆUbUXU‚ƒn@šVVUb"],encodeOffsets:[[110667,29785]]}},{type:"Feature",id:"5223",properties:{name:"黔西南布依族苗族自治州",cp:[105.5347,25.3949],childNum:8},geometry:{type:"Polygon",coordinates:["@@VL@Vl@@IXW@kVUVbnW@XlKVVnU„VlL@b„aVbƒb@xX‚°ÔUxV@kbm@VxkxWJœ„V¦ƒŽ@ÈnšVKšxWXJmV@n„Ò@xVbn@@blLk`VX@bššla²JVUlnn@U±lw@wnw@mlwVIX@@m@klKnk‚a„KnwmmXkƍVm„Uš¥l@nb°n@„aVwVmVIVnI@a„¯@mšU°ƒl@@VnI@JV@UV@b@IUbVJmXöºƒzllUbVa@aXUl@„U@llLnKVaUa@UmK@UšwV„bnKV@VwVK@UXƒV@Vbn@‚w@U„WnX‚@„a@m„I„™@UUKlaUaVk¯ƒVaVLXK˜»XaWk¯mƒkğwmW@mIƒVkwƒJUIšÇVwU™UkVKkƒm@UkmU@WÅwm£Vƒ„m¤¯IkJWa™_™lUbmJzÝJk„ƒUÇVU„ƒ‚@bU„Ýn™m¯LUb@`mL@VkL@VƒUmmk@UU±Umka@kUƒ@ķymUkk@mmkÝmUaUakImV@V@VÅLƒ¦ƒJUXmJXšWb@n°Æœx‚¼nV@LlbUŽUbmL¯@ÞbV¤nbVx@bUVlblIœ™@KVVUnVJUn@VlLUlmLUUUxmK@I@@VW@@bU@UJmUkLVVUl@b@V"],encodeOffsets:[[107157,25965]]}},{type:"Feature",id:"5202",properties:{name:"六盘水市",cp:[104.7546,26.0925],childNum:5},geometry:{type:"MultiPolygon",coordinates:[["@@ôyVL@nXJV„Ub„x‚bUŽlšU„@ŽšnŽVbV@naVw„a‚VUXVx„x„bnaWmXaƒ_@y°aVUkaVI„aVamkXa@WVU@aUUlUXwVV@UVšbVUnKUwVa°a„bVIlan@manw@VšklJXI@m„LVVVUVK@U„ǃk@KUa@UkaVU@UVWV_XWVXVWlLXKlLXaÆKšwVL@akKm@Uwƒ@@XUVk@VUI@wWK@aUV™I@UkK@ƒmL™Wƒ@kImJƒUÅVmkXUW@UJkx@nmx@xkxV²m@kmUV±Ikb™™@aUWl_kK@am@Ua@wƒÑ@mnUWIX™wULm™@DŽU¥›ƒXIlwUwn@laU@Vw¯ÓW@w„aUaƒb@akKƒUmVUUkL@WmXUaUV@lWX@Jk@@UUKULmLUJmzkKmVX°VšUnWKUL™ƒƒL@mU@UnVJ@b@„UV@Xƒ`m_@l@@bmbXJmnnš@°˜wnn@ŽVLX@V‚@nVl@nk@@b‚l@nn°WlXzW`XXVKnUlxVbUb@‚V„Xb@Ž‚VxÈbVlnbmn@ŽkVUL@„ƒŽmLUVVL"],["@@@ƒ@UmWUwkU@Um@@VkL@V@„„‚@„V@VkV@nbVa"]],encodeOffsets:[[[107089,27181]],[[107213,27479]]]}},{type:"Feature",id:"5204",properties:{name:"安顺市",cp:[105.9082,25.9882],childNum:6},geometry:{type:"Polygon",coordinates:["@@lL@bUK™xÅLWbkKWLkKUXUWWXU`UX@VUVlb@VVb@L„l°xXx‚bšbXUVb‚VnU„xšKlL°šnUlVn@UmVU@kUUVašblVXKV@ƄXþlXUxnU@mVK@_@ml@UU„@šblU@KnLVyUw„@@UmkšWVw@UVK@VXzVK@n„VVUUW@kVJnlaš@nKW™kaWL@U—™õb@JU@mU@@_WWƒL@lUU@WUUK„@lakÅUUlWVa_@`WIU¯mW@InKVVXa@Ll@VaV@@UXUWakUVWUIUW‚UkUƒƒmVXW@@amUUm„L˜l@UUa„wn@lašIVlnLVKUUšU@amK@kUKƒVyUU@aUImK@UXa@aV@VakaW@@UnIVWVaUkƒb@mWƒX@Vxm@UaU@W„@VULUxU@mLƒaUŽ™x@VnL@VVbUbmLkK@kƒVk@WV@bUbVakk„yõ¹nWUIVa@J@aVUU@@ImJ@Uk@¯„™V@nƒ°@bmJUUJUnUxƒbm@¯Žmak@™¦ƒVUnŎWlnnmxƒLbmlkL@l@nWVnlÆU„VnIlJ„@šXnK@„lL@VšJVU@bXL@xVJUl@VU@W„@Vxn@"],encodeOffsets:[[108237,26792]]}},{type:"Feature",id:"5201",properties:{name:"贵阳市",cp:[106.6992,26.7682],childNum:5},geometry:{type:"Polygon",coordinates:["@@nŽlLX„VJ„LVblJ„n°ln„„LlVnKlU@nUUa@WlX@l„n@‚Vb„@la@a„„šlJ°¦„Kšwn@°x„LVkUmmwUmk_la„bšK@UlK@UUm@wƒL™mnwmw@U@¯@KnL@aša‚ġXWW@UKbƒKWX—JƒIWakJ@_kWƒkƒKUU@UVKk@@Ula™mV_X@WKXKƒ@WUUnUK@kU@WJU@@UnK@LVUVJVkUK@UUJm_@UaVaV@UU@Wƒw@aV@Xkmmm@kw@IVa@KVLXU@`lLX@VKm_@yƒI@WœU@UlVl@UanU@Uƒm@U„aWaU@Ukƒ@XJmXVbkV@ŽƒIUVUbWUUKmbk@kwmV@K@mWUXUakb›KUUUJVb@LU@@VkL˜š@VXKlbXšmL™@kbm‚UI@lVXUVƒU@mULWy@UUL@VUx™Xnl@Vƒ@VxUzmK@LkV™aƒ@VVk@@n@`UL@nmV@bmJ@Xœ`WX°WVƒn@xnxnIl`VbnVlwXUlLl‚„_nV@b@bl°„V„nWJkx@nmx@b"],encodeOffsets:[[108945,27760]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/hai_nan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"469003",properties:{name:"儋州市",cp:[109.3291,19.5653],childNum:1},geometry:{type:"Polygon",coordinates:["@@஼jpnr’``ŽpRVHʘ̤žZt^JÖA˜[†CâlTébQhRPOhMBcRSQiROE[FYdGNOEIH]MgEAMLLIAG_WMCSL@ED]PCLYC[ZIHgjSxJTMbHNEFCMEE_HSDFHSLECRNSFDRICHNADGPI\\RZGIJTIAHLDQOHG`GTNCOIC@eIGDWHIS[kiE[FMbECZS@KKS[FDWsCeRuU_DUQNOE[LKGUBM¨EDQP@HWHGDImXƒCog_~‹I_fGDG|QDUWKBC\\ore|}[KLsISBHVXHCN`lNdQLOnFJSXcUEJMCKSHOUMDIm_‹DI`kNDIGEYFM\\YPEEIPMSGLIKOVAU_EBGQ@CIk`WGGDUM_XcIOLCJphHT_NCISG_R@V]\\OjSGAQSAKF]@q^mGFKSW^cQUC[]T}SGD@^_ˆaRUTO@OHATŸ”"],encodeOffsets:[[111506,20018]]}},{type:"Feature",id:"469005",properties:{name:"文昌市",cp:[110.8905,19.7823],childNum:1},geometry:{type:"Polygon",coordinates:["@@€hIJ¤Ī¯LQDaFßL[VQìw€G‚F~Z^Ab[€¹ZYöpFº lN®D´INQQk]U‘[GSU©S_­c‹}aoSiA£cŁ¡©EiQeU­qWoESKSSOmwŸćõWkàmJMAAMMCWHGoM]gA[FGZLZCTURFNBncVOXCdGB@TSbk\\gDOKMNKWQHIvXDJ\\VDTXPERHJMFNj@OwX@LOTGzL^GHN^@RPHPE^KTDhhtBjZL[Pg@MNGLEdHV[HbRb@JHEV_NKLBRTPZhERHJcH^HDRlZJOPGdDJPOpXTETaV[GOZXTARQTRLBLWDa^QAF`ENUPBP…\\Eji`yºEvåà"],encodeOffsets:[[113115,20665]]}},{type:"Feature",id:"469033",properties:{name:"乐东黎族自治县",cp:[109.0283,18.6301],childNum:1},geometry:{type:"Polygon",coordinates:["@@ªVLP`@PEdNRAHOPEAKHEVL`GZBJfvdTAXNNTZJFPrHHNpKTD\\ILHbEVd^J‚OHLh@NNBnHP`\\xH@NBRLJTlŽNv_^CTLd@bNDVFbxdFV€UPBTKOGEOUO@OEBXQP[H_EI\\EbeYa@UO_J‹MEJ_IEDKJUGMDcNUd_FMTEJSGoZ]EIYGO[YW‘gEQ]a@WHEDQKUSDUGAbYBUpSCYNiWqOSQEoF[UcQISWWNMSDe_cLQ_UBiKQOOASQAWgS­ā]ZaŽSPÝZ]XMXSŒ[^oVËNgNKlE RôEø"],encodeOffsets:[[111263,19164]]}},{type:"Feature",id:"4602",properties:{name:"三亚市",cp:[109.3716,18.3698],childNum:1},geometry:{type:"Polygon",coordinates:["@@®ĂhTBXTRPBRPjLVAR`dKf`TC‚NXMTXRJVdE\\FpTRrPjXZMTDVoZABaVHTCLVCRGF@X^bFR’hZXP\\ZHHMA[^wBWXJlW¤EJ[bCTOF‹WWMm@ILMGWQ@DQ^QNWFSHEbF`OXNbO„VNKTEPDTLTCCVTREfvfEHNbRAENH^RJXCFHNFRpVGHWISDOTMVCZeGamaLoLÛD¹¹ėgsia{OųE—Tt‰lɂwr}jŸR±E{L}j]HąKÃT[P"],encodeOffsets:[[111547,18737]]}},{type:"Feature",id:"469036",properties:{name:"琼中黎族苗族自治县",cp:[109.8413,19.0736],childNum:1},geometry:{type:"Polygon",coordinates:["@@bRFnHNbHŒgN@NPEnbXP@bND`NT\\@\\QZb@`@J]V@XhžDpW„nCJGHGXO@CR§FANHVKLF\\MPVR`CvVfQtDPKpGHG@S`WJP~^dSTHWX\\RHTFACQTIAUPOU@MG__IaYSFQK‘NSbORHXCZeTFJg„B`YBMNMFi~IVDV[tGJWXGDQRGF]ˆJrALgESLSAYDGIaFeXQLS\\MKSLSQYJY}eKO[EHiGSaK[Yw[bmdURgEK^_kcSGEOHKIAS]aFSU@Y]IWFUTYlkP_CUOUEkmYbSQK@EMWUuAU\\M@EpK^_ZMDQ^OXwC_ZODBrERURGVVZ\\DTXcFWNIAWJWAYUUFYEWLQQaCIZeDM`cLKRGpanJZQd"],encodeOffsets:[[112153,19488]]}},{type:"Feature",id:"469007",properties:{name:"东方市",cp:[108.8498,19.0414],childNum:1},geometry:{type:"Polygon",coordinates:["@@ºŸx‹JYZQ”IŠYXLl@dR\\WZEn]bA\\S~F`KXaDeTiNO^EEKWEDQXITBXaWaDQMUJOIaTWf@NJV@dSxGZ‰Fu_@WMKAUˆ}AQ@MwG_[GOAmMMg@GKP]IUcaFKG[JSCoLGMqGEOYIMSWMSBucIeYA_HUKGFBLOFGPQBcMOF_@KO©UAtERadwZQ\\@ÊJÒgòUĪRlR°KĮVŽLJ"],encodeOffsets:[[111208,19833]]}},{type:"Feature",id:"4601",properties:{name:"海口市",cp:[110.3893,19.8516],childNum:1},geometry:{type:"Polygon",coordinates:["@@ńZƂtĢ¬æßFuz¹j_Fi†[AOVOFME_RBb]XCAKQKRSBQWSPY\\HbUFSWSPoIOcCOHIPkYCQ]GdGGIFQYgSOAQLK`MFUIGa@aQ\\GGUFcHKNMh@\\OYKAigsCgLSF]GOQO]@GM]HyKSHKPW@Pxi@EMINYREXWRQ@MQcFGWIAwXGRH\\yDI`KJIdOCGRNPNtd\\UTMbQYi@]JeYOWaL[EcICMUJqWGDNZEXGJWFEXNbZRELFV]XQbAZFrYVUBCLNFCHmJaMIDDHXHEhQNXZ_TARFHVB@DTQIRR@YHAJVnAbKFUEMLd\\c^ÍÞ"],encodeOffsets:[[112711,20572]]}},{type:"Feature",id:"469006",properties:{name:"万宁市",cp:[110.3137,18.8388],childNum:1},geometry:{type:"Polygon",coordinates:["@@^J@ZTVbET^JBGLFPTHld]`FLQhcVanx\\\\ZbLHTGj\\FLP~fIZRZPVTQFSVAFJE^NDLEE[~LjsxVTG\\NZZNGlLRRGLJTV@hPZANN^@T\\NEPPbDZXO`d^HSvcJDIV\\XZAJUFCLNP@PQ¤@[ïKLÑIÏ]ÇE±I{uƒ­YśUćFcYUmsVeBSVgB[RO@aYYPO^]@UVaNeDShMLG\\EfFVE\\F`"],encodeOffsets:[[112657,19182]]}},{type:"Feature",id:"469027",properties:{name:"澄迈县",cp:[109.9937,19.7314],childNum:1},geometry:{type:"Polygon",coordinates:["@@T\\GJCXJH@fJDDPNCNJENN^NLHBNSx@DDYbBLLDRbjZTj@`XXTlG^Xr@PJLW\\WLTlWR@HDJTD@X_PO@STMDNTMVV@NLDM`M\\XM\\JNBH[PYZ‡úYzŸ`Ċ\\ÎÝd]c[NKVFLEBaUmBIZGQ@JQSR@CUAEGBQ`SWYRMFgWGCGJCbNnIDGMEDKVAZUEqBYRa^WEUFKYQMaFWXEHIFWMYHCrXVIIiaK@aMCUYNSIISTwXALKH@XWXIEIJQCG[IEQDE_XSBaa[AIPW@]RS[FWS[CD]PEBYNGFSaSyJG]@ugEUDQlGHiBKHUIoNSKqHFaPMICK]UUHIPDJMuCA[SCPIDIOILGAEmU[POPBVSJDREBGS[QXWSGcT}]IO_X@TGHoHOLCX\\ELT@LYTD‚aFENF\\lj"],encodeOffsets:[[112385,19987]]}},{type:"Feature",id:"469030",properties:{name:"白沙黎族自治县",cp:[109.3703,19.211],childNum:1},geometry:{type:"Polygon",coordinates:["@@D\\RV]dTXELnHr]^@LETBBRTHPi^[@U`QTHDJ`MGSogDIPKdJ`WVNHCXHl_DJR@AH`FBVPUJLHKNTJOFFZON[ZEHFCJlMJ_ŒCn`CJVNGPLTNDFIdVTWEIPmRKMc_kDMWGGUTAtJLK~\\f{pqD[LAVXRCH{HC`eŒJ`}@W^U@I@_Ya[R[@MSC_aMO@aWFmMOM@‹haGGMEmaQ[@MESHaIQJQ……MckBIw[AOSKKAMPSDSLOAV_@@`KJRbKRDfMdHZERgAWVsDMTUHqOUr@VQXTT@Tƒfg‚L^NH\\@heTCZaESNObHPƒHeZF\\X^ElM^F^"],encodeOffsets:[[111665,19890]]}},{type:"Feature",id:"469002",properties:{name:"琼海市",cp:[110.4208,19.224],childNum:1},geometry:{type:"Polygon",coordinates:["@@TP\\pATHTGlZDJGAQjE\\Rb@jVBDCN`JZ[NCNHNXbULPrP\\KNbMTLjJJRFP`“pNLZz^FLRHjVPZ@hxVKbHBHMNNJFRlLzGPnNHhIrHHADcPWdUAmEMVQDSKYHY\\EhBN^HpXGNDBNNBnIß‹Å_g{³So]ã@ORO@KMEDIVYB[WJUICudGTc]P_YWaCOOMFS[]@MMYBgOU@ISHKQQkKMHYY[MSHwUit}KF\\KFMCF]EIUBETSROUKTLT[NKTWREfJbCHBZKTFTKh"],encodeOffsets:[[112763,19595]]}},{type:"Feature",id:"469031",properties:{name:"昌江黎族自治县",cp:[109.0407,19.2137],childNum:1},geometry:{type:"Polygon",coordinates:["@@`ZĤd–`òüˆ˜ “BSPGP@VSbQ`‡@]HC~T^SE]N]FkW]E[fY„GGOPaTMbFDYfS@g[MGK]h„e@SSSRW@UVqrPVGNStCXUhBFQGYNcCeLQQaLI@_`@EUwcEaCUaMc@SK]Du`MSkKI‡~BVNL@X`‚EvYŠwHcTU@MIe@SXJbIPNVCRXbWbSAWJCRXFFL]FMPSjCfWb_L}E[TaBm^YF[XcQk@WK‰Z“JYRIZwŒ¹ "],encodeOffsets:[[111208,19833]]}},{type:"Feature",id:"469028",properties:{name:"临高县",cp:[109.6957,19.8063],childNum:1},geometry:{type:"Polygon",coordinates:["@@jD`hNd\\^dZädĒH´Op@ˆùZY\\OAGIMN[[W_NCNMKU@NUMSNCTSP@`O@WSCCI@GXQSkXKX[IK@OWqH]SkWW@_SiiYQaKCAKZaCCw@MTGAMKM]FMMIMDSM_HGHRPKCBGSJJIYH[QOJCHMBDGQJECMTDQKFGTCEGTF`NFEDMFaGSNwIiTGhYJD\\KZODC^@FTKND`XBHKJNKFBNhG^FJMPcHEZF\\QPRjQTAdgNOPgQaRSê"],encodeOffsets:[[112122,20431]]}},{type:"Feature",id:"469034",properties:{name:"陵水黎族自治县",cp:[109.9924,18.5415],childNum:1},geometry:{type:"Polygon",coordinates:["@@R]NC`YL]FoN@V[vBXVFNL@TRZalnVFVP`DlOZkVSXEE_F[EUFeH[NKTgfCbMVU^@P]ZObZP@\\QhATUfAtUasñiāEoI]eYǯ@aKmaeƒWuCºKÜKpnbHbYfUDSNCPJTRAHJTDJSfDNLHXC``VBNGTYCQDIXMDSP@xLNEFRNXBIpVNLXah@RgF@`qOML@LJNSPLbaHAh@Jdj"],encodeOffsets:[[112409,19261]]}},{type:"Feature",id:"469026",properties:{name:"屯昌县",cp:[110.0377,19.362],childNum:1},geometry:{type:"Polygon",coordinates:["@@\\OnVBFKHPJCJOJTDB\\vDINOCGJVVL^JDONEbrGTLpMVJLGjAHGRkVChF@vH^zIbTETMHAZOFC^\\DXT\\EffAP\\PdAV@UIYfS|S@YPICMeM@sC[_A]VQEwyHSMuNcAUlQJMVGMS@mVBZPFO\\CSFQK[LqDMACiUa@[QiFBRIHYCHkGSBS[oSOqB‡IE^QHCRWHIXsHU\\UC}JEjMNAN_ZƒAIhSEYfWDQGaPMTL’ERZTJb``NHV@"],encodeOffsets:[[112513,19852]]}},{type:"Feature",id:"469025",properties:{name:"定安县",cp:[110.3384,19.4698],childNum:1},geometry:{type:"Polygon",coordinates:["@@JjDNdJ\\FbKPXfZ^Ij@RZNaVSc[MsMOHQPDJcLIJ_zCG[HQxWJBHXdENRR@XQFWZQQGOFSWUCI[WCJuRGLXNMPLhCl[Ta@SqGgJMGOmyHkKEQMINMAGaGULgwY@UOGiKQ]EYyMK”oO_QEIIKiNSMa[LqOKOaVMWMGMDY\\_IKrL\\ERT[DEPYOUA@nNTUHINkRBVMdNvGTxzRF^U`BD\\@tfNDNOJ@Z{TeTJZ@VU€cB[OBOeeQT@^OXBJb\\AbWTF`RCJFH\\RDJIJFXW@WLGBKxWTSJJMTVZND@bbL"],encodeOffsets:[[112903,20139]]}},{type:"Feature",id:"469035",properties:{name:"保亭黎族苗族自治县",cp:[109.6284,18.6108],childNum:1},geometry:{type:"Polygon",coordinates:["@@FJp@fxpQ\\ApN\\GNPNBM`HLMrXLXj\\PEHnI@WUCEM\\GTc\\GZYHTPBHRCPTd€H\\K\\@HXi–BJILJJAVNTOZJNtFPC`YxDPWci@IBgbGKaTOIM@KNKrP@_hE@QbgKWUMJoWAQMFEKM@wTONCJWRCZDHSAM_UD_GWMKeCITSCGIQBGXUHQoMEEGWDQIG]FMQBMaFGueFeSQDUSDSKOCSFMLƒUaPWM_PaEGFETMX]RCRR@HXKN@JNnXXEŒSPaDI\\£FkXWIAX]xB\\GN"],encodeOffsets:[[112031,19071]]}},{type:"Feature",id:"469001",properties:{name:"五指山市",cp:[109.5282,18.8299],childNum:1},geometry:{type:"Polygon",coordinates:["@@TCNOLBTLBPx\\AJdl†NR†RIbJTGNF\\@RcIYbmHoLQdKN_fCJYbDRRXKZFVEZVXBXIJBXMdESW[CUYHUVQFQAqsEIMPYMSBUIIJKAIj•GW[@[LGScDOGQOAGSYZ[HSd[HFNVD@XmJFG[OWiWKNqGKN_MAMO[HoM[BoRewo@Y^HpITSFENc`MVCdHNIVCLJFI`NFIŒP`@VZbaf[FFJG`O\\WRFA@PVPFPPH"],encodeOffsets:[[111973,19401]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/hei_long_jiang_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"2311",properties:{name:"黑河市",cp:[127.1448,49.2957],childNum:6},geometry:{type:"Polygon",coordinates:["@@VÈÞ@Žkx˜nXŽ°VÈa°V@kôw„b‚š„JVškXlVUx„„@ŽlL@xkVV°ƒ„VbxlVUnVxk@ƒ„ƒKkŽVb„Il„@°kVl„@„™lÆnkll@@V„VXƒŽš@V„²bUlƒVlV„U„VÇn@nkJšŽlkVbœ@›x²V@n°VUnlKU„n`@n°bWLnVUblVUVVbknV`°kkŽl@@V°@nz„J@XšxlWXb°n@bƒĠlbXb™bVbƒJ@Všb„a@„„@lbUbšVmnœ@lšVmnIW‚œ@WbÞ@„n@x°@š„ĢaƐéϚnœ„‚lČ¯ĠŻÈwm@ôçU™mm£Xy°UV™›@wÈ£Ǫ¯kõÝçUњ™Uķ‚ƒĢkVфÆšÞU°nŎ¥ČUĊx°m°¦żVƐœx°ƒÇ£@y„UônރÆ@Èĉ°Kô¦šW„kWU—bÇ»@™ÈĕWÇÈ£ŤU@›n£ÆUUKVamanwŃmÝJ¯k@JƒIkaVaUUÇbkaÆÑkWmÝUۙ™Ý@™ƒwnU±ƒ@kkV¯KUkƒJƒ¼U¦ƒšÅ@ówķaķůV¥Uaó@Åwmƒƒ_kVƒwĉ‚ĉmmn_V»™a@U™ƒVwķóƒ‚U¦LǫéóXÇmōLǓÇķxÝkƒƒĉ™kmakbUĶ°@W¼„@bƒšÈÆ@Ė™L„l@„°J¯„mkl¯L݃±L—amJ@¼ƒ„™VƧUó„™UX˜ċb¯ńVbkÆÝI@llx„k°V²šV@Uxގ˜L@b„@b™`ƒšÇzkókݤ@ğ¯Wƒ™LĉǙLmmnċVkbUaƒL@Ž¯„‚bU°ğL݂Ý@"],encodeOffsets:[[127744,50102]]}},{type:"Feature",id:"2327",properties:{name:"大兴安岭地区",cp:[124.1016,52.2345],childNum:3},geometry:{type:"Polygon",coordinates:["@@k›ƒϙmƏêġb™ƒ¯@@wƒmÝ@XV@IlŽl@bUxl¯VlV™bV@ULVlUV™_kx™VVV™ÈÝJ@„¯šU„™lm¯x@xóÒĉ¼m„¯Wƒxţ@Uz¯ƒWwnUwťƒ@knƒWƒ£óVƒUUwğyó¦WI—Vmm™I@±kwÇ@@bƒ@ĉ¼ó@¯wó@¯aó¼›KՃaUwmWUwÅI@aƒKó@Ua™LƒaƒVÅwō¼UUÝl±I—¤VxÇx@zkJmnn‚mbnz™xlŽƒl¯ČkJl™°@„kb„Žmx@x™@kêmVnŽWxôXšxU°„bWLóJnÇWĵ„V¦™ŽƒUUb™b™ÆġK™šk¯™VU±aXmċÑUwĉKġ„k„™ŽVxk„ÇKkbƒIƒ‚ÛXWl¯bƒŽ™X¯K™bĊš„„ÞVƚnŽĸ²lxUŽ°n°òÈb‚¦—xVbƒŽƒ@¯„Vx@¯VķÞČlĊ°KĸŽȘI°¤ČIôŽò»ƨnȰKǬ¦ôWŎÈƨwlƒnKVXmbX`lbšwkVW‚XXŽ„L°a„ƾaĊ£nƒ°@°¥ŎzÞ¥‚»œalwôkƒJ„a@ĶK„£„bU°ĊxźVÈUĠ¥ƨ™VI@XU°x°Ln¥šw°UmwXm݁V¥ĢŽ°@nU@mÆ£š¯lKœšÜw@aÅU‚¥UaÝIkmV²‚nn@Ķ»@Uk¥VKÞ@ÞÛ@ƒkVmĢa@_ƒJómƒǖ¯Æw—óÇa@alƒUwšwĢřšk@wÆWXUWXƒWa™m@_ƒ»ÇéXaĸwVa@ÝKkUWkX‚kšKXxƒn@lĊV@¯m¯nřÆwš¥"],encodeOffsets:[[130084,52206]]}},{type:"Feature",id:"2301",properties:{name:"哈尔滨市",cp:[127.9688,45.368],childNum:11},geometry:{type:"Polygon",coordinates:["@@°`„_šJlUšŽ@„„@V¦°JUšŽnLôlnŤ@@šÈaUÒVbkbl¤ƒzk°ÇVÛô°IlVUVôU„xÆU„Ž@bźĀ„º@¦šb@l²‚UVlœ@°ÒĠxšnXxÆVô¼Þ@Üx²KލlƒVÑ°UȰôlwô@²ƒĸ°„lanV@„šVŎUll@bÈnÜm„wĢ@la@ÝÞb°UXb˜lŎ²ÆškšV‚I@ŽnJnĠŽ°knƒÜbĢwna@a˜kÞKƒĀ„a‚™œ‚‚IVbU¥wĠwkô˜xnLƒċVçkaUƒ±IUmnġW„°WôĉšalƒÞÅĵ¯@W¹XÝaƒb¯a±X¯ºLƒaVƒmkLóƒƒbkaƒVUKVkkKV_@aÝykk±L@ƒÅU@yV_™aU¥ówÇx™@UkVƒn@lƒkÅlwšWVwUkĉmkklW@šašbVwnWWƒ—wWL™™@Ušƒ™UƒÇLšÇmƒ„@wƒJĉƒL¥@ƒÝ_@a¯y„UWw¯ƒ¯Uġx¯aÝXVmaU£ó±›¯nwƒa¯óÅVƒXman™„Uƒ›lUXkWa@mkI„›ğaƒm™IklÇU™„kĊƒƒzkKƒš„lU„ōĬlš™„@ŽnX°@llUxŹ²mKĉVWwk@UbUK@bmVmI—ƒVmwaWxXlWȁšmºšÞÆbUxV@ĵńWÆĉLkWUbƒaWzkbĉ`U„±LklōwUVÝ£™UW`Uwk@mk¯VkaõVX@WbL™K@XƧºWzxƒK@lmX@bkVVÆk¼Vbk@Vn"],encodeOffsets:[[128712,46604]]}},{type:"Feature",id:"2302",properties:{name:"齐齐哈尔市",cp:[124.541,47.5818],childNum:11},geometry:{type:"Polygon",coordinates:["@@Þ@ށĠKV¯a°ƒ@„KVblaČU‚mnnšKĊȚKX„°ŽĠ@Þ£ôllÈy„™š_@a‚ƒ@a—KݍVwU@±™¯Uƒlkw@kÞJlÅUa°ŃČaW—šVôƒƨVšU„ƒ@»nI˜b²Kބ°Klkn°ƒ¯I@ƒƒkšK@ĕÇń™@aƒX»¯@VĵlaÿVamI@aÅÝउýƒĊȗJƒôȁÅkmƑۃ@kxġ@@l™aVk¯»ƒīŹaƒkƒ¥Å¯™JUaWU@@w™aƒ»„KUkÆkUm„UmwÛ±±UUbUŽUXƒwWwÆÝk™lkUanaWwnKl™kal¯ka™ƽa›kÅx™a¯@™amb¯V™lÇwÛĀ™V@x™šmêVƜVV‚aôV„wÈx@šˌx„¦VÞ¯VšlmX@‚ƒL@¯Ua¯LmV@„„°X„ċK™V™ƒ@UƒÈ@‚¥@w—ƒġIU™km¥Źwƒ¦¯lmn@°kxVV@¦óam„n¦l@nx™lĉVóšmx™n™ÒĉĀĊ¼„þ„šǔêÞ°ˌĠÞÒ°ĀɲĀƨźˤȤƨĊ°w@£nymwnkUUV¥ôÑVmkÆmUUVa™mVIkmô„lxkXÞþƒbl„ƒl@kV„ƆƒV„xV@š¼VÒ@šŽUŽšnnނJ"],encodeOffsets:[[127744,50102]]}},{type:"Feature",id:"2310",properties:{name:"牡丹江市",cp:[129.7815,44.7089],childNum:7},geometry:{type:"Polygon",coordinates:["@@U`lLUlVL„Ulb„aô„lKnŽU„„b‚K°¹²W°b„aÞb˜knyUlUkamř²L@m°@lšmš²n`ôÅlK„x„ÜKnxV@„l@œƒ›ÅXyW_k@™wm™ŹĕmƒX™»‚ƒÛ™l°ƒôšÈ„»š—ô˜ô_WW@Uœal»šwU@@wšUVƒš@VƒXI@w‚Ģ͑ÞȻ›aU_@mUkly@¯óV»XmWUXUWmnm¥nUUaWLk»Æ²IÇa™wÅaÝ°¯nUa±a™ƒ™@¦õÆğ„@„™@Åb›xU܁nÇłlb¯¦„ôó»mƒ—@±ƒUk@Wwƒa¯xU„V°ƒxXbǎŁUV™™ƒK@¹ƒKUaȯ@ōݙXƒal™ƒlÛkalÇUǫÇńÇakbÝƆ¯nlš¯Ž@¼™VUx@x¯W¼™Æ¯šmĖ„Ĭ¯ČƒVk‚ķÅmxœ°ô²V¤‚bUnÞW°bĢw°V°„XxƒV°z@bÞ`@„‚¦„KĊŽ„I@xƒŽn„™ÈÈK‚„šV™„@VššXK˜xX„mXUx™a™b@‚kXllĊnVlUx™XkxlÆk„m@U„Vlš@ÈwôxV¦šbU`@zÆV@„²KllÞz@b"],encodeOffsets:[[132672,46936]]}},{type:"Feature",id:"2312",properties:{name:"绥化市",cp:[126.7163,46.8018],childNum:10},geometry:{type:"Polygon",coordinates:["@@ऊþÆÞ@bnJUb‚ĀnblŽĊš„„ÞlĸwǔÈŎKÈnôWǬê‚KV¥„ĸôUxš„@VšbU¼m`nnĊŽĊ„xlUšmkaVÿšLšwš@°»UmbKmݙUšwUmVknKUUl¯ƒKU™ƒUȃ‚™nK@ĠkX±lX„°„L@¯¥@wV_m›ĵ¯Ww™L¯ƒUkōƒÇVU™l›w—V󁱃¯aƒVka°wVk°mÞ¯Ŧřƙl™²™Ŏk™U@ƒmUkb¯ƒķŽ±„ó@kxȯó¯VUÒk„ÝŽ±LÛwÝ@ó»ÅUWw™mğw¯Ñ›@UkV±@k™a@¥ƒ¹Źÿ@aƒÅVƒwóVVUkU¯JÜóÈUl¯„yk£laUaVÑÇb@™ţ@kmómK™V¯IU¥ƒ@@ƒ™kV™Iƒ`@ô™¼„blU„lƒ™bÈb@xÇKkĢɳaÅɆō@ƒŽVƒK@z™@@¥ÆKnÜ@@aۏUw›wnU‚ķ@ƒ_ƒV°Ž@„klVššnULVVÞbVl@°™@nx™n°LŚÆlV„ȃmU²@VmĠLƒx„n¯xkWƒzšJ‚wnLmbXbW°šÆ‚™²™@™Žšx@JVx„L‚Ā²Æ°I¯º‚È@ÒnÈ"],encodeOffsets:[[128352,48421]]}},{type:"Feature",id:"2307",properties:{name:"伊春市",cp:[129.1992,47.9608],childNum:3},geometry:{type:"Polygon",coordinates:["@@ƒKƒ¯kWW²ğl@ŽmLšÇ„„VVš„Lk°VVmLUlVn™xšVnނLnaVŽ¯¼™@™x™KUĀlb™n„`n„Æxô@VbU¦ĸŰĸbôxÆ@„™V¥„»„IVl°LUŽll@²„mV„x@ššÞܚÞVnŽlXÅÒlbÈaVVUblb„J@I°lÞIn‚Æ„mxnbUbVLÅVm¤@œţVǤXÈÇĖ@šÈ¼˜aXVÜaXbWŽnzŎašř„KôbšUlw@¯naÆKnUU¯Üa@mkkVUĊm„™żÝ‚ǖŽ‚K„™°L²lÆI@ƒ¯¥ĉƛVaÞk@ÝVaĠlnUVwƒœómaƒ@™wĉ@™a™VƒxamX@aƒ@UaÅLƒaVWƒ_nWm£nWm_ÅV¯ƒm@m„󤁚ݦƒ¯ÅalmX£ƒ™VWUŚw™mÇ@@IV™„WUw@ašI@„k@wŎ»Wƒ„ƒ™ÅVaœK›Ika@¥lUkUlwÅwVyÈwWU@a¯U°m—Ç@UçƒaVa¯mV»ÅwÝUlƒUk™V@k„mUk‚X£šw°@@ǃaÝIƒƒam™Ûam„¯lğmmI@J™U™l±ÅōŽ—kWa¯VÝa@Þkbġ@ƒxÛnÇm@akkōVōl±škšÅšťŚÝ°¯nUl¯xlb„U°b²„ô‚˜Uœxšk‚VÈUŎ„Vl°„šKXxĶ°nœU`@x°¦@"],encodeOffsets:[[131637,48556]]}},{type:"Feature",id:"2308",properties:{name:"佳木斯市",cp:[133.0005,47.5763],childNum:7},geometry:{type:"Polygon",coordinates:["@@nš„b‚„ÞJ„b@ȯ@™xW¤Vlƒn@lšUVlk„ÞVÆxU¼°nUb„bVèÈ@˜ŽnIn‚@šĢmlUw°™żƒ‚VUn@lnL@VôbšwĊ‚lœ„JķĸĢl„wôwƨxVVUƒŦšxšLź™Èš°`nnĠwŎJސĶwôJ„@¤Xn܄ĸlšn°¼È°lŽ„„Uš‚b„xš@„l@ÞÞÈm°„lôwšL°¼ĸ‚°Þ²nĠ@ôwÞ`ŤI„V„ÒĠU„„@„VJĸbƄ²@°ŽĊKšœ„JĶaĢȰ@ô¥°nš¤‚bČUš@Vx„mUw@a݁ţƒÇ™ķƒ@ĕķīU¯²@ÆmVÑô¯X¥ċç@™ĉ»U¥ÝţKWVÅkUVÝŎUmǍÝx¯aķxÛUóL¯a±óōb¯™ƒÑŃVÿƒ_Åķ„a@UƒK@wm@Van@UmmLVa—@VImmXUWƒÝUřƒKUwÝUUƒkVƒk@l¯X›‚Å_ƒJ¯k™Jm„ÅLƒa@¥U@¯Vƒz¯@ƒ`@¼šmxƥšŏKÛk@±laÛ@@Xm@™ƒ@xƽ@WŎnšˣĕÅ@@aÅ@@nÝbǏ¯@ƒ_U›kUWƒkb™wÝU@ç„Wlw@anIƒ¯lyœX°m°VšašÛšm@„mVwÞK°ƒšXlaXmm_ƒ@UƒkwÝK@ƒVI™ƒXmV»ƒI@aƒ¯ğW™bġaU_¯JU¯ġŽƒ„ĉ„k„ō`±nÝÆk„™bóĊ¯Xƒ‚ĢX‚mVn²JV„lbUè„ČmK—wlóğx‚xV¦UaJ›šƒbƑÿÝL—l@bmbġx"],encodeOffsets:[[132615,47740]]}},{type:"Feature",id:"2303",properties:{name:"鸡西市",cp:[132.7917,45.7361],childNum:4},geometry:{type:"Polygon",coordinates:["@@‚LšKVVnkšbVšÈb‚²U°VnklVlaÈL@anU°ÜmXV`œnôLƒèšxlŽšLX„˜L²ašVVmÈX@ķ˜lnU„Èl`ȹš@ŤŽ°U@x„KnnV„mlnnUl‚lVnnaŎwlVÞ҄@n¦šLVŽ°lšwVk„Lšaގl„n҄š@xmLÞ¤Wnœ¼‚WÈLVVUxlÈô„„WVaU_VKšKXUÆbn™‚nôK„bÞw°bÆWXamVwœK˜™Uw¯WUk„UlJUwVUa™@@kmyzm›ĉw@kVwškƒW¯ÅKU_Vmƒƒ™xU@aW@@kK@w„a@Kƒ@@kVUƒaky°_Vm™kna¯K@™ƒL™wġk@@IÇóX™ƒwVakmV@mwXUWanƒlĉ@ǙUw™KƒƒóšܛNJۄm°@›w—Å@ƒ±b¯Wƒ¹„WVwŹĕ¯kVmōb¯w@aƒwmV™UUb™V™IkaVwķ™xk¼›b@VXXó`󗙘ƒ¼Çó™¯„kŽÜš„š¼WŽn„źĖnššxl@X`WzœÆ"],encodeOffsets:[[133921,46716]]}},{type:"Feature",id:"2305",properties:{name:"双鸭山市",cp:[133.5938,46.7523],childNum:5},geometry:{type:"Polygon",coordinates:["@@™UƒƒUwó™mÑÞÑUÝÝUkmmŃyV¯ī„¥ƒUÿĉ¯mÇkaWbÅX¯aÝxƒaóLmmšÅaWV™LULV`UbƒXóƒkÇVwUUÇKX›»XmÝ£nK@wƒ™mÑkƒÝ™bƒKUl™x¯kU™Km¥ƒ@ÝÑkUōxmbUmkVkmmnkUƒmmƒL@w¯Vţ™@Ǻk_ƒÇmV—k@ĸVx‚VÈ°lLkllšUbōwƒnVW¼nlUx¯XmWUnÝ@™xÝUó¼¯J@LVbkJWnkb™W¯„ÝLUxƒn@‚™n™Ü™b¯U¯n›Wkz„°mJ@bkxƒX@èÞVšxlaX„lVVœ„`°@ȐÞa@mÆ@@bÆ@ˤĖm™Xōƾ@@wš„n@@WÜ@kb@²ÜlŐLƦ™nw™@»„_°@„y°UV@@¦„bÆKnƒšI°l„IÆ`œ°W@k„llUV„ÞVVx„LƚÞVX„WVnnUJ˜@UbnKVnm@Ubn@@x„L@VƒbÆĸ„`UĀƄ„Ò°šŎa²ô°bôKÜVĸw°bÞwȎVnÞōVUÆlXU"],encodeOffsets:[[137577,48578]]}},{type:"Feature",id:"2306",properties:{name:"大庆市",cp:[124.7717,46.4282],childNum:5},geometry:{type:"Polygon",coordinates:["@@mÇ@сǰ¹¯J±ÅÿƒKUw‚I@™wšš@š±Å‚™X¯WanamKx™I„ylX°wƒm„wğKUn±@nVDŽUƒÅkƙ¯Kšmmwš@@¯UkÝaUUVK™mU™lk@ƒ¯„U„`ĸ@V‚mœxVxܐ@bÛ@m‚ÅL@¦š@@y„L‚U„Ŏ@ÆɅɴblġÈL@wÇaša„ƒkkVƒaš»@ó¯_ÝJ™wÇaÅXny›U¯¥Å„@w™bÝa™Lmm@@ƒVUŽlbğVmš™¯Xƒm_ƒ`¯_Ux™m™L™a¯b@mƒaó¦Çk™¤V„@bóJknVx™VXx±aƒLUbVxkLVlLWlƒ@nX@VÅbWlÈnƒx„bWšÅbmŽ@xœbml°b™„XbW„XVmnn`ƒLmšnbmb@šk@mwU@@š¯Jlbk°lbkšmLXxmbVbkllšÅނxX„xVWVVa²VܲnxƒVVnÅlVlƒL„¼šb@xV@XŽVbšIÆ°„¦„lźb„Ĭ°¼Ulšb@kĢ@lw„@ƒÜlnȂƄóȘI„ĉ"],encodeOffsets:[[128352,48421]]}},{type:"Feature",id:"2304",properties:{name:"鹤岗市",cp:[130.4407,47.7081],childNum:3},geometry:{type:"Polygon",coordinates:["@@Þ¥‚™ô£nƒn@°„ÆUn`mXn¤mX„`UX„bÆKVb„@@bnW‚b„wšUšbĊ@šx„@nbšWVmƒ_mm@ó»Um„ŘWXkĠ»²¯‚¯nķšwŎ@ĊšŎK°bĸUnјKȦĠÈbÆknJššÆUĢV°IšŽšVƾƒwaV™ƒƒkÇ¯¯»™mķkۃWm@£ƒóIĵxݏōIğxmm¯_ǙŹš™K™wťŽ„UVUŽƧwóxƒxġkĸķƒIk›ĉ™xóa@UmK@kVmUŻ„¯šVxkŽġn™‚@mmJ¯n°V@bXVÇxUzÆxkxlVkV@¦lbœJ›LUbšÆƒ„X„ō¼@xƒl@™J@bVxƒXUš@JÈ@šn™xVÆUXš‚„W¤knÆb„°"],encodeOffsets:[[132998,49478]]}},{type:"Feature",id:"2309",properties:{name:"七台河市",cp:[131.2756,45.9558],childNum:2},geometry:{type:"Polygon",coordinates:["@@²mŎ_lƒĊƒ„ƒĢV°°IV`ĢbšaĠX„°@b„JU¼Wnš„UJ@„ÞLlxV„„@n`lIUa@K°Iô»ÞVšwÞ@VmnX°WVwmkX»‚U„mŎxVak™lkkKǯUUwÇWUn™U±b—KWƒ™Kk™w„çóK›mU_nW¯ÛmV@bÇKkbkUml¯U±VÇaU™™amlUU™LK›„k@ƒU@mwÛLƒŽƒwkLóÆm_™±™nkŽ¯@@n±KnŚlbkVV‚mz—lWXº@Ķ°"],encodeOffsets:[[133369,47228]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/he_bei_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"1308",properties:{name:"承德市",cp:[117.5757,41.4075],childNum:11},geometry:{type:"Polygon",coordinates:["@@lLnlmxn„„IVVlUnb@VVxXJWL@LގVnnV„J˜_@wkmšK„b‚x„wXk˜WXXšKlb²K@nVVVb„L@WlU²„lKVnUJVz@VVb@lżmVUVnbôaVX@°Ub@lWbXš@b@bVb°x„@VxÈLVlšaÆ@Þb²k°@lVUŽ@Xn@VW‚LXb@¤VXšKVVVLnm°_ƨ¤@aUIVa„alkX›°k„™V@„alwUVy„U@k󙰃na°UVUUmUÆw@mkLVUƒWVI„WšLnn@xlVnK„myU@ƒU°UXaV@U¥ƒU@Uƙ@aVUkWU¯ƒaU@WLUV@bkbmKULmKkUVUkmVIUwlWV²™Uml°U@W„LUwVm@UUK@_ƒKUUÜaXw@ƒVKUU@mVIUUlmnIVVVbÈVlKnbVKš@nI˜@nVnwVLVK„K„„˜Vnb@aUIVW@In™°@lVnIš@lWĢ@°UVL@b„@VyUUƒa@w@WUnU@Wǯ™K@UkkJWaÛbmk@mVaÞU@amkWƒ@mXUKkÿƒ£@a„kl@Um°UXwla„al@nmlXnW°znW@aƒwV™@ƒakbĉ¥VmU@ƒIƒVƒUƒJkUmWU™KbmkUaƒKkUVU@KV@@klw—™WaU@kmƒXVènbmlUUƒKƒX¯JkbƒI@JmIUWU@ƒLml@XkJ@U™kƒK@aVKwWa—IWwƒmUƒ@mU@J@UaċU™aUUƒVkI±ƒk@UUƒ@UbVVm@UVKƒLƒlkIWaULUWƒXUJU„ƒ@WbUb@lkXUxm@@JVn@J@b„nƒb@Vkx@bšLU‚Æn„JšaVXnKVVmzX‚°V@_lJXxWXƒK¯bÅamUƒ@lUI›bñJ@LÇKkIÇ`kxWL@„ƒ@@bUVUb¯xWKk„Å„VlULW@ƒŽn¦Ul@I™lmUUUVm@kWƒnkKma¯XUKWmnwVwÝL„mŽ™VUbUVWb@Lnxm„xVŽmbXx›¦@„nb@`™„ƒVƒ@kbƒLU„mVUlkbVXkºmnm@@xk¦šbĢÜlš"],encodeOffsets:[[118868,42784]]}},{type:"Feature",id:"1307",properties:{name:"张家口市",cp:[115.1477,40.8527],childNum:15},geometry:{type:"Polygon",coordinates:["@@k™ġۙal¥@wn@nml¹UWlaVknUVƒ„Kla„@„Ušƒ@_ma@ƒœ¥WwnaU‚wnƒmw@KXaVUVašUnmWUk°™lƒnUVUXWVw™IWVóKUI@WXƒxUU@mma@kUKWLkw@yk@ƒaVkUUċaUU@Wk@Unm@UVmLm±IUƒkJ™kWƒ@a„I@m@U„ƒVƒ„Ula„@VXVƒXmVwnkWKƒKU_k@m¥ƒmX_™JmnU@km@U@KmU™VƒU@U™@Umk@@LƒmW@Û£Wƒka@wk™@aƒI@mmk@mUa@UmUƒIƒwW@aWUƒbU@kbÇ@kwƒ@makVUk™U@aƒm@aU@mxkUƒbƒKUXUƒ±KXVWLUK@wkU@V™@WXUa@WbUxƒJIƒŽ@¦VèVVX@±ê¯KUIƒ`¯UULVx@Vƒ@UKƒIƒVkLmVkKmš@nUJÝbkIUJVXšVVxVbU„VJ„Un™°bV„mlU°„XnK@Ul@lVÈVUXšx@W„@VXšV‚KÞb„n@VnbV„m`ƒUx™kW@UVkL™Km¼@lUnUJVnV„XV@Vm@@LV„klƒIkl@VƒWlŽULWKUL@mJ„@blbUVUlmzUJUxm@UUbċÜk@Ub@VšLVV„¦ôbVŽmšUKUkU@m„„@VlVn¼WbUJ¯@@„°šnIllÈl˜@nXšWlLœk‚J@bkxlxkxlXUlklJƒšXL@bW„n`@nƎXxlL@xl@Xb‚LœKlVlIXblVUbUJW@lX@VL@VVŽšXšJšw„n@WnL°K„bVbl@VI@K„@U@nmVmV@XUWI@aXm@™VUUkWmn@lmUUk@mUmK@UnwVĉ@ƒƒmU_V@XJôVVUšLVUn@šllUnJl_n@šml@XŽlLlw²LVJUL@VmbVblVXmVnlš@Ť¦„nn@܎@bšl„@@XV`„Unb@VlLVb²J‚Xn¥ÆÑ@¥Þ@"],encodeOffsets:[[118868,42784]]}},{type:"Feature",id:"1306",properties:{name:"保定市",cp:[115.0488,39.0948],childNum:23},geometry:{type:"Polygon",coordinates:["@@VbXWš@@UlV@xVLXKWU²LV„VW„L„alVnwV@@b„n@bšVVllUnb„@lxÈ@laV@„aXV@b‚X„x„J‚nV@VVb@nnl@n„J@blšl@„ašƒU_VWUwVUškUm™Ukb±mVwœU@VIUW@UWk„@VU@ynL„m@IV@‚bnK„LVaVmnIlaXwV@@WVL°@@xnX„@V`V@VbUVVLVKnwnL@ll@@_V@VVnaÆ@œKVXÆ@nƒ@wƒKmU—™Wm@km@kÜKXU@ÑW±nIUwVƒ„Kla@I°wU±kškmm¯mƒ_ƒJnƒaƒwW@IVaUama@wƒUƒmU@mVw@aXk@mWa@£km@aƒ_kVmUnWW@¯bƒkUmk@ƒVÇm@@kUU™KUU™@UVUamVUaWIkb@xU@@amUkKƒVkam@@kVUkUWmKmUkLUb@xmJƒ™U@UImVÛVmnUwƒJƒU@VƒX@UWm@Ub°¦UšmxklmX@`ULU@@UW@@xkn¯@makV™UmxUb™°ƒlUšƒbUbƒnUJƒUUVƒa™LkbUU›JUU@mUUUƒJkaƒ@™xUIWJƒUnƒJ@V™zƒ@kb@`@bln@l™bƒŽ@X@š@š„@Xl‚bnbVb„@„„VJlInlšbVw@U„K„l@lbnan@Vb‚JôLn‚UzlV@lÈLVbVK@LVx—VWXX`WxXz‚bV`UXV¤nx@„bVlVnVlUL"],encodeOffsets:[[117304,40512]]}},{type:"Feature",id:"1302",properties:{name:"唐山市",cp:[118.4766,39.6826],childNum:11},geometry:{type:"Polygon",coordinates:["@@„@VVl@²„lJ„UVVšbČVVb‚@@InV„@‚V„nXx˜JXb‚xUL@b„Lšl@VlI@Wnk„KV@VXnJ@I„Jla°I„W„LVVnkmaUç„WVkôaܯ„@nV°wnJlaV@VUnUUaW¯wXWWwna@£UaWKU¯ƒ¯@aVUkKUamUUƒn»‚an™„IVwUWlkš@„LlWVakU@K„_lƒšbÞU°@šy°n„@„KÈkWW™ţ¥ĉōƒkġWUw¯£¯ƒÇwţwƒ@kK@kƒ¥ÝwÅbǤېťV™lW°@ĸ™x@VVVULVLkl@V@Xƒ`Ub@Xm@UWbƒk@ÆVbnLWV@lnXUbl‚@X¯lmU™VkKWLkK@_UK@U@UmmUxmVXLWVULkU@`W@ULUK@XlJXzV@@xml@VU@UX@Kk@WbUK@Xn`ƒXmJnšmškxUVbUVlVVxUbV@nKlL„kVKÞbVKXI°KVšmVUIUKULVxVJVLkV@Vƒ@UbU@WUU@UbUK@b@nƒV@VkLmb@b"],encodeOffsets:[[120398,41159]]}},{type:"Feature",id:"1309",properties:{name:"沧州市",cp:[116.8286,38.2104],childNum:15},geometry:{type:"Polygon",coordinates:["@@@ln@UȄŽl@Vn„l°aX@mXnVlU„`@bln@¤Xb@nWl@bUx@nnV‚„„V@xnbVbUb@J‚X„x„b‚mXa@k„UVwlW„k„KôVm@w™kkK@kl»Èƒm™VKXkla°@XVV@VI@ml@@Vn@VX@V@J„@VxUzVVšš²blVk¦@šĠ@@»š@VK@VÈLlK@XnJ@alIUl„a„VVbš@„n@a„U@WUIV@mUn@mKXml@lL@LnWšb@XV@@a„VVb„V„@VV„IVWÈb˜IÈ»ƒǟlWšaVUÅUƒƒ™Um@kVU™WVkaUwmaóUƒJUU¯ÑU¥mk™¯UaƒKÅnÇyóXmWÛX¯aċbÛa›J—W™ÝU¯»ƒaóóUm@IƒšVVl@bƒLUJWLX@@xšXUxl¤V@V„nVUV„XVbVš@Ž„@@VVn„°VŽ@ţU¯VƒUmƒUWV@mUXƒaƒbUKUwUaÇKn„ƒVk¦Wb@VnLmV@bkV@n„xW`Å_UVƒV@bƒUklVX@VmlUƒx@VVL@x—VWVL@VW@UUm@"],encodeOffsets:[[118485,39280]]}},{type:"Feature",id:"1301",properties:{name:"石家庄市",cp:[114.4995,38.1006],childNum:19},geometry:{type:"Polygon",coordinates:["@@la„@šy@U„I‚m„VXIVJšw„@lb„IVVnV‚@VVœIVVlašK„bVU„VVI„mVa„aV™„kš¯VanwšVlUnb°@lm@wX@@VV@VK@_nWlknwV™¯¥Van@VX‚@„W@U„V„IVxnmÜUnUVJV@„šnI@wValKnV@k‚mU£na@mVk°K„LVa@UU@UƒmknWWkXU@aWW@@km@UaU@@klK@UkaWaUnamm@U„a¯wWU@UkƒL@ŽUn@x™V™lUXVJUb™LmU@aUWUkmKkLUUm@mW—XƒaƒmmkkWUm@@U¯JUUm™kU¯@mKĉxÝwÝ¥LƒUóŽmwkUUUWVkKm™kKmLX„lxVLVxXJ@nVJnz@VWL@`nX@šƒxƒ@kVUUmJmIXx„JV„ƒnUVƒ@UVV„@LUšƒ`UXVVƒ„ƒlXL@l@b@VmX@b™xn°™UƒbkKWLXlW@@bƒK„mKULmakLUlmb@šXb@xmXU`V„b@`lLx@nWVXL@‚°WlXnlb„KVK„XVb@˜X@l_lJ@V@XnŽ„I"],encodeOffsets:[[116562,39691]]}},{type:"Feature",id:"1305",properties:{name:"邢台市",cp:[114.8071,37.2821],childNum:18},geometry:{type:"Polygon",coordinates:["@@nKlLnšlLXUVVlVnxô„V‚KÞ¦ÞxĊwnL°@lVnšVV°I@Vn@V‚lXnl„n„b˜WnXn@VVlKnLVlVX@bnVšKVaUIVWškšU@wVm@¯@U¥VmU_°lšK„k‚w@LX‚Va„U@wšUƒUUKlUóW@UVUœUlƒ°K„wlKU_na„KVnlKkkšWWa@IœJVa@IlJnU@„KVUUmVlaXUl@lm@kXWÝÑnkƒ™±™k@wğ›@@U@mKĉLmVJ@zmlnŽWLUÝJU_ƒ@@šmJkXUVlbklÝ@Ýa™b¯@¯±JÅwġaUU@ƒkU™@mVI±bUKƒL™WUXƒJkaƒLóKULWbUVkKmnk@@bmLUŽƒl@b@mnmJkUULƒaƒbnŽmn@lVV@¦n@„l@b‚znx@`Vz@b„xnV@xl„lbnKVx"],encodeOffsets:[[116764,38346]]}},{type:"Feature",id:"1304",properties:{name:"邯郸市",cp:[114.4775,36.535],childNum:18},geometry:{type:"Polygon",coordinates:["@@„bVKlVnInm‚@@a„kVnK@al@nmlLVUXaVKôL„Klb„IVWšX„KVL²a‚JnUš@lV@„VVĢbÆx²I°Ž°@šaÞbÞ@lkkaVUlWnI@™„@V`ÞI‚VXKmnk@y‚InUĊKƒÇkUUamUUkƒƒ@aU@U™ƒk@WUwVkVJVkkw°a@„mK@UX@VV„LVW@wšwVa@¯Xm@@lUIWaU@UWkXWmU@UwmUkKmn@lkVƒ²™VƒaULUVmJUUUwƒLma@™UmkIUm›L—mVšmx@b™LUamKÅL@VmbkU¯KÝamzkJUb±Vkb™L@lU@WIkJƒzkKmKƒnUalWkkKW@@nkbk@WW¯XUVUJ@XlJ@Xƒ@XlWLkUƒ`VUnaWa„UV@UVIƒaUxUUmVƒK@I@W@DŽU@@U@bƒ‚@nmKXmx™@UxkVWUX„@`VLlL@`™zX‚Ýb@b‚„@VUVkIUJVz°KVlnLlKnL„xlLVVUVlXUJ@nn‚„I@mVUlbn@@Žm„@bV„nV"],encodeOffsets:[[116528,37885]]}},{type:"Feature",id:"1303",properties:{name:"秦皇岛市",cp:[119.2126,40.0232],childNum:5},geometry:{type:"Polygon",coordinates:["@@lnV@Xb˜škx@lU@@LUVlV„LVbnl‚ašLXVVn‚l„I„V„U„JV@UnĊ¦la„bš@nJ°UmƒV@„wn@VU„JVI°bnWlXnWVLVK²b‚akk„lI@aUaVƒUwVUUalaVwnUVak¥šX@W‚kœLVÓm„mUK@_lWš@n_UK@alÅ@ğÅƑŃݍmƒ@їţÇlƒLƒ@¯m™z¯@ÝV™ak„ƒ`@LlVUbkXƒK™@klVXUxƒJmšbm¼V„nVVblLUV@b„°V°XLVb@¤mbXxWX°xXŽVbmVUVU@kbmI¯xmUƒ@Û°óbUl"],encodeOffsets:[[121411,41254]]}},{type:"Feature",id:"1311",properties:{name:"衡水市",cp:[115.8838,37.7161],childNum:11},geometry:{type:"Polygon",coordinates:["@@„KVlV@X°xƒb@VnnmbVŽXblb@VkL@lV@Vbn@@l‚@XX@bWVXlmXnlV„V@@VUbƒK¯LUl@nmbV¤n@l‚LXnlVUV@ln@lb„UlLnV@bV@@wlaXJVbnUVbVUš@VVšLVVn@VVX@@U‚KXU˜U@wUK@U„wVnk@UUWlk„V@a„UVUÆ`X_ƒw@mlU@anUmK@UXal¥„UmƒÈLVbVxVL„a„bVW@nXU‚Vn„„V°UŤV@Uƒ¯Um@Uƒ@@U™UaƒWVUmUUƒU@k£Vw™W@wW@XKƒIUa@wU@@al@UK@_mKXKƒbUU@aVKmš@Xmƒƒ±@kbÇakLğVaUw@a@ƒmkUJƒk@ykw@£ƒWX@lknk@WVkbUŽVnUVƒL@‚mVkI@JUb›I@JXb™XllkLUmƒLmbV`kLƒx¯Lk„›VUV@VôXkVVL„V™V@xƒVUbW@Kxƒl™L¯kV`UnV¦°@"],encodeOffsets:[[118024,38549]]}},{type:"Feature",id:"1310",properties:{name:"廊坊市",cp:[116.521,39.0509],childNum:9},geometry:{type:"MultiPolygon",coordinates:[["@@la„Ušš@šUnL@VWbklWxnIVV„V@X„JlbUlšXVbn@@K„mV@@X°WVInJmn²@lmVbnL@amKV_kwlmX@@LVamaXaƒaVU@UnJVanLlUkaW@UaVakK@IlKUU@an@ln@alKUƒkIVa@a@klaUKUV@UkUV¯šKVƒV@kUmƒU@@a¯ImJUU@VV@UL@Uƒ@@WXUWa@Ukwm™@ƒX@@w@al@@aVIUmVUUUVWUknK@I@™l¥kU±a™™UUVyUwƒ@@I@UUWm@@Uk@@nUJU@WU¯@kbWlULnšÇ„k¼@llLšl@xUnóŽƒLƒlkXUxƒV@lWb„I„`°nnn™llŽV²¯x@JkbƒLU„VxmJX²@ÒWVÛL@lln@‚Xn˜šnV„L"],["@@@kX@Valaa@KWI@UXW@WanaUIW@UaUKķŽk_W@UVUKUš@bƒ@UamxVXnJUbWVXLVbn@W°kb@U@Wó¼mIU¼k`V„@bVbl@„lX@lUôVlUœIV`lX„Vn@lUlVn@„l@UVaƒIUWl£Um™VWU@@UUKlUUUnƒVL@KšUnLVWUa›@™U"]],encodeOffsets:[[[119037,40467]],[[119970,40776]]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/he_nan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"4113",properties:{name:"南阳市",cp:[112.4011,33.0359],childNum:12},geometry:{type:"Polygon",coordinates:["@@lKl@nVV@„bn„@VVnm‚nL‚LXx@š„‚VLlKVU„IXWÜ@șlbl@XUĊUlwnW„LÞw‚m@ÞUVmnVl@nX‚JXLm@VnnJla„I@VkxVb„@VŽln„J@knKVn„@°aVanal@XK°b„‚@š¯VJXIš„VK@al@nV„k‚@nK„a‚b„@XL@blVVKVLXK„@VaVI°mVaX@V_@a@yUkVw„VšIVašJ°™@anIlaV@nKnXÆm@wUUV±UUWUKnaWwXUWmŁ¯Vƒam@kakImƒUKƒ»lan@VXXa˜W@@UlUUa@a@UlwUƒV@Xal@@anIVaUK@V™XmwVmUmV„LXl‚@nalLnal@„šnKlkV@@UnJ‚UXnl@nVl¦V@@VnJ@nUVVVVIn@Va„JƗn@@K@m„kƒa@kmWVaUI@a@™k@@aUL@mmaVIUKUVƒ@@IU@mƒUmmL@K@UUUU@mW@@nU@ğ»mVmbk@klW@UXnV@LƒJm„™lUnUJ™UUUWƒƒ@UnkKƒxmLa@ƒ@@lUU™bmUVWk@@nkUmam@UakJU_ƒVm@ÅlÇLUVmVUwULƒKU@ƒk@UƒVUlU@@Uƒ@UaUUWaŎƒzJƒaWLkl™b@bmL@„kKƒabWŽUVƒ_@mV@b¯JmXUbUK™¤ÇLUU@b@JkLWmkUWIkJ@VmX@JUbVXU`¯VV¯blK@LXKl„UV@Um@@Uk@kxWŽkbƒL@KkbmL@‚UXmaU@@l@x@blX@xUJ@bULUlULÇ@@VšnU`W@@nÛ¼U@@VmKUkm@VVX@@xǚ@bUbVb@VX@@x‚LUb@lƒ¼XLlbUlVVU„Ub@n"],encodeOffsets:[[113671,34364]]}},{type:"Feature",id:"4115",properties:{name:"信阳市",cp:[114.8291,32.0197],childNum:9},geometry:{type:"Polygon",coordinates:["@@VllInJlknJVkVU@mXlUÞ`VnV™VU@U@y„@nXlKV„nJVkXKWaXI‚b@yVk„VUkVwn@‚K@nW@k„KlUXVVUlbnUV`n@V_V@llX@@V„b@bV@@nlVUb¯‚WLnbmb@ŽnLnK˜b„U„bVWnLlaX@VVUX@Vln@`kL@ll@VXVJÈIVl@XÞJ°Una„LlylU@UXKlnn@lanLWWnbVI@KXKVL@LVWVL@UVKUIVWX@@XÆJ@In`@lJVI@a„WšÛnK@UlK@UU@VK„nlm„nXal„UllLUbVVšknJ@nV@Vm@a„l@@xnV„„lJVUU@™w@aƒk„@XW@_mWnUlŁUmVKV@VXwW»XƒWaUwnkWUkVUƒU@@@WlaUkkaƒIWVkm¯xmIUmƒLUVƒaUIó»m@mmwXk@a›mk¯¯l™@wƒmkLmmU@UbkUWJ@XUbƒJ@b@l@znÆmK@Xk@Ub@lm@ƒI@akmVKUUVUkU@U±JUbkƒ@IWmkxƒa@UUV™UWVkIUaW@UlLWn@VkJƒI@VkK@L@bmKƒkJmUUaUKWXk¼VxnJ@„V@@VULV¼ƒ@@UkaUlWL@U@W@IkKmL@KULUWULWKUXUJmIƒb—KƒŽƒ²UW™nWKUUkLUƒmUUam@UU™@ƒmUL@xkV@„VV@bmV@Vk@mwkUƒVUx@mbX‚ÇnVb„‚UL¯šWŽnUVLVb@xnlWnU@UVUVVUbVVlVkn@llVUXUWUXVbUJ@bmLUJnb@nVK@bl@@š@bVJUbnX@l„b"],encodeOffsets:[[116551,33385]]}},{type:"Feature",id:"4103",properties:{name:"洛阳市",cp:[112.0605,34.3158],childNum:11},geometry:{type:"Polygon",coordinates:["@@VVUllLXl@LWn@J„@bƒKUVmnL@`VblLnbV@„b@JmL@LnV@VV@¯„VJVnXL˜@nm@aÞ@‚a„k@m„IšmVbXL‚ynLšk°@°aVJnUV@UVVXk@WJ@VXLlUnJVnnƒ°U@»°U„wl@šb„WmUXƒÆ@VLXU@m@U„a@I›mkb™a@naWW@_@WXUV@@U‚ƒ²@„K@I±U@¥kKWLóLlƒa@£Um@kWKXU@mlLXUVKUU±J¯_@`UL¯Wmk@Wa„kkƒlUnƒVUVaU@KUU@mmK@_ƒa@KX@VaUIm±™k„aVKVUkw™@kaƒƒW@kbkL±UUaƒK@UUKVak£ƒ@UmmL@lƒIkmUƒ@Ualw@UƒJkbmIUmn@WKImWk@mUUnÝV@ŽnÝxƒKmXkxĉVWVk@kaċšÛ@WXƒJUV@zŽm„VWnbUbVbšLlUnŽ‚lUÒnWV—VWnk@@Vm@kxm@Un™l@Ll@@V@šXnƒškJV„šV@nlVXx˜U@l„n@aš@VLnWĊ¦nxš@lbVKXLl@ރVLƒ„XJl@XXl`lIXVl@Xl‚XUVšK„wV@lanx„zUbVJ@VVX@b"],encodeOffsets:[[114683,35551]]}},{type:"Feature",id:"4117",properties:{name:"驻马店市",cp:[114.1589,32.9041],childNum:10},geometry:{type:"Polygon",coordinates:["@@n@„b°UƂXnVlnLÜ@VLœm@n˜@na@J„„m@k„@lVšVxXX@„V`lLV„XVV@VVÞLVV°„²@lašbnxV@@b„Lšmlm„_VWnIWUna@lšLšbnV°ƒVL@KšV„LVUVaVLXK@mÆXna@wVm„a‚@Xw@KlL@a„@Va@wUkaWnIVƒla@Kn@Vn@VUl@nKVn„J@LnK@aVkVUUWƒ@VakUVanI‚²X‚W@UUU°KnUVLl@XaVK@ašU@KUI@W@_lm@KkLUKV_Uƒ@»@UVJ@XV@@mVL@K@U@Kk@VwUUm@kmWL@VkVkzƒKmb¯VÝI@WUkÇJUIUWk@@klK@_km@UVWUUW@kbmKUXƒaƒV—amLmK@namaXK°VakU@mU@@aƒa@UW@kkU@U`m@U_mVkaUVWUkVƒL@lmX@ŽLm@UxVlƒUUl@zaWJXbWLUlmIUƒkLmWƒ@@z@VUVUšUmÝ_kVWŽ@nUVUlmIklmIkJUkƒl@n@Lm@؃IUbm@UJUUVU@mmI@UU@k¥mUk@WmVmI@VU@klmLƒ™k@mbkKmb@WkƒKUŽVnUnnxšW@UVLUbmJ@bk@WbU@V„kx@V@bVbkV@V‚@‚—XWbUWm@kb„¼VLn„lJlb"],encodeOffsets:[[115920,33863]]}},{type:"Feature",id:"4116",properties:{name:"周口市",cp:[114.873,33.6951],childNum:10},geometry:{type:"Polygon",coordinates:["@@lšnb@xlJ@UnLlKXUlJl_„KnV@xVL@bkbVVUè@šWb@„Ubmš„ŽkšVšmbX„VJnUl@„a°@@b„LVbƒlXx˜InmnLVw‚anJÆw²IlmnXVl°VVbÈaVb„@lkn@VWnLlUVmÞUUklƒkƒVkUaVaVaUw™K@kkaVWmw„_„‚l@nU„VVb@b„aV@VV@zXJl@@kl@šlœk°WVnÆbnbUšVJ„Iš@VKVm@k™K@_kK@a@aU@@wW@@k@aUW@IUWVUnLlUlVXKVwmk@W@—VWa„¥@k@lnƒUIÇKUaU@ƒUUVmIUV™Uk¥ƒVma@¯k@Wanwmƒ„@@n@@m@UIVƒkUVamUXWƒaV™U_™@ƒmUVUImW@aUIĉK@VmI™b@lU@@n™JƒkU™@KƒIUmmLk@UVm@UŽm@@LkbU„mJXlbV‚@xUbƒ@@bkK@LWx@ƒbUn@xmbÅW@nWLUKUbUVƒK™U@LUK¯„mU@šVV@xULUŽVL@bU`WšUz¯aUamKUaƒ@@xkX@x"],encodeOffsets:[[116832,34527]]}},{type:"Feature",id:"4114",properties:{name:"商丘市",cp:[115.741,34.2828],childNum:8},geometry:{type:"Polygon",coordinates:["@@XVl@lLȃ„@VkV@V»UanƒWX@VaÆÇô@ÈaVX@xVJXUÞU‚aVLĸbXKl„V@šm°Vn_ny˜XX»mUk¥lK@a„_@yšInaVKVa°_@WXI@ƒ@K‚VnIlbnaV@„l„@‚a@_w@ƒlwUKm™Xa@UV@š»Vƒšw@kUKVUUm@w±VUXUKUwmJUUƒ@km@@±mXkmUI™@mm™KUwkbWakLWaUIkJmŽƒX@l@@VUX@JWbX@VbULWbƒlUVULknlV@bVJk„mb¯KknWmk@@nmVkx™@ƒVmU¯KUnUL™@ƒJUIV™maÅaUm¯X›l™kk@@lk@WI@yUUU@ƒb@aUaƒUmVk@ƒƒ`nxUXlb@lšLVxUbUbVbUll„k„VlÝVUnkVmKUXm@klƒ@ƒnUx@xnxƒn@`VX@V²x@V@b@„Wl@zU`VUVVb„L@Vƒb™W@bkXllkLWV@V„@VVÈwlVœ@@X˜K²Llb„WnnÆL@VnJWn"],encodeOffsets:[[118024,35680]]}},{type:"Feature",id:"4112",properties:{name:"三门峡市",cp:[110.8301,34.3158],childNum:6},geometry:{type:"Polygon",coordinates:["@@WKUmUI°ƒU@@UmU@KnK@IƒaU@makKUa@_‚KnmVU„L@a‚ƒ@IXm@KWkkKVkUU@aUW@UUIVaƒymwkbU@ƒx™LVUWWkk@WUkJk_WWk@WI„ƒUK݄k@WKULka™@mwĉ¥mXUK™@@bƒm@k—VWwkU@m™UUƒlI„™Wm@™@Uk@@KškVmn@lwn@@Ul@Xm˜UXUmVсkmkV™KUaVamaUXnƒ‚@ykLUKƒ@™WwKmKnUm@UmƒƒaU@mUk@kL@lƒxċxUnkVmnXxWb@`kzWJ@V—LmVUn™lmUL@lW@Ub@VšXUbš`VLUbUJ@nmnUlUUm@@bUJlnU„š‚U@lxkbƒ@@XƒJUnƒ@kb¯VVVmlXXlJlzn@VlkVW@bkK™bmškŽUbVb„lƒXVxšKÈnšwÞlĊKlšVnKlwX@lL@xlUnVn„@šl@lmX@ƄÈb°¼ÈwVJlx„_°xšašlšUÈxlUnbVxnL@lllšbm„n@nb‚@@V„L@V„@@„VLšJnIVVlKnV„_"],encodeOffsets:[[114661,35911]]}},{type:"Feature",id:"4107",properties:{name:"新乡市",cp:[114.2029,35.3595],childNum:9},geometry:{type:"Polygon",coordinates:["@@XVlL„K°bUblbUbšl@nX@W„XVVKVkš@@Žmb@„Ubn„W`kL„LƒV@VVLnKlVXIlVš@@a„@l£nWlƒkVa„@°bnUlLVlna‚bnUVUXKlU@ƒ@lk@a„I°y„@ôkUU@wšmôšnkWakml™UkVmkUlmUUm@nkUKWanamU„LXW@U‚VnUln„`l„œblL°KXV@ĠJ@L°„šJšUVw„anK@UUImmƒkK@¯±Um@IVmUmmÅnWaUK¯aUk„w@W±kVƒx™U™VƒwƒnÅJUIWaÝJóI—bm`ÝbÅImJUI¯¥¯@mU¯UƒJmnUVóUkl±V@zXl„bWVXL@bm„mº@@XmJUXU°llk„@nWJk@U„@¦U`m¯ŽWx"],encodeOffsets:[[116100,36349]]}},{type:"Feature",id:"4104",properties:{name:"平顶山市",cp:[112.9724,33.739],childNum:8},geometry:{type:"Polygon",coordinates:["@@l¤UbVL@V„LVb²VlKlaX@„„lbš@lxUVULƒbšln²VJUbW@@L„b@`nL@nVV@LVŽUbUVm„kVl„ƒlXbl@Xn°ŽVK@_°`²IVVV@VUVJnInaWK@Uš@„K„LÆ@nmlXXWVUUw@klKVa@knyVkVanI‚JXUl@XbVUl@@aša@mXk‚bnK@UlK@UUUVaXaWmkUm¥n—WmXaWaœkl@VmÞb„KVL@aVI@mUwVm„@KōméUL™KVaUk@kUK@U˜WXI@VlKXU‚@VVnInVV@VLlK@UUƒkKU_@ƒWWUwU™@klƒn@ƒƒ@Imb—@@m›nUKÛ@mKUkWVXxmbVLXŽVVU²VV@xÅnmWmLU@kbmJ@b¯š™IUb™JƒUUxVl@z@bU`W@Ub¯nUJUbƒ@WLUKULkU@aWKƒ@aƒbmL@ƒlmUk@@bUL™ƒWJUI™°@ƒŽ¯aWLk@mbUb¯b"],encodeOffsets:[[114942,34527]]}},{type:"Feature",id:"4101",properties:{name:"郑州市",cp:[113.4668,34.6234],childNum:8},geometry:{type:"Polygon",coordinates:["@@@nWVUKÅ@W„nVnI‚ŽV@œkƂšwV@šnn@lxÞlnôJ˜zXJl@nalUČVlƒl@²UlkôVVUnm„I°VnV°@°¦VJnIÆJÞan_VmU@ama™@kU˜¥kaUklw@UIV¥kVUI@ƒmmUÅmUlƒwVU@amU—JWbUakVƒ—Vé¯Im`ƒk—@ƒwVWmLkU¯ŽƒXkWmLmx@UUƒbm@@x™J@LbW@UUVWUkVKƒ@ka™IUamKUkkmmLƒUkJUVWXkWmnÅ@ƒKƒL™@@VXLmbmJUIUVU@ULWVkK@nWVXL@lVn@¤„b‚kôKXKlL@¦²V@JƒL±@„@VU@WV@X@`XXmb@Žšblaœn@Jƒb@V"],encodeOffsets:[[115617,35584]]}},{type:"Feature",id:"4105",properties:{name:"安阳市",cp:[114.5325,36.0022],childNum:6},geometry:{type:"Polygon",coordinates:["@@°kVaV¥kVmUkWkWVkVKUwkkmKUU@a„wWWXWakKWkXmlašIVmX¥ƒU@a„@WnK@kƒƒ™V™I¯ƒ@KğI@WU¯LkK›akƒƒ_kmmVU@VWXƒKnVmbXbVLmln@VVknlVUnVlkšlnXbmlmlXblnÈlWbn@@nšK@V„L„bVV°VVzšlnš@V™xƒI™b™ŽU@WLUa¯V™UkWõ@¯kkmxk¼l‚„XUlVbVLnlULmU@lƒLkVUlƒX@xW@¯mUƒ@UmIUW™L@aXa˜kU™¯anƒWk°@k™kKmmUIWaambUkkKmV¯aƒ@UblŽk„mXk¤ƒ@@b™@UbULWVnb@lUVVnmšnVVU„J@bWXX@WJkL@blVU°UV@XlWnXUbW@UVkVšVWbnLUJWLUK@Lnn@blVU‚„nUblxVUVJXU„a˜@Ub„LnUVV@mVIVVn@UbV@‚XbmbUV„_lVXUWanJVI@WkI@WVIVU°WXXl@la@mX@lLXl‚kVbœm‚X„ylIXJV@@kšKla²UVa„IVyÞb°LlVna@UÆKnLVbšK@anwU™"],encodeOffsets:[[117676,36917]]}},{type:"Feature",id:"4102",properties:{name:"开封市",cp:[114.5764,34.6124],childNum:6},geometry:{type:"Polygon",coordinates:["@@lUVbXa˜InV@bUV„x‚knVVÆnn@„VJlUU¦VJ@kxVllb—¦lVš@nb@bVŽUn˜aôJÞIXbVJÆI„m„xšUšV„w‚U²l@XƒxVl°bVLXb‚`XklUnmVblLœ@lmšx°LVK@UXIVašWlL@Ukƒ°KkVaVUXmmI@UÅKmmƒXka±K—L@W›@kUÇxUUƒ@@UXUlKkklW@ašX„a@UƒKUaVUUV_@yXk@ƒ@a@U±w@UUW@_„mmw@wVw„mUaÇbUa¯UUkmWkn±JÅxmIbUxmKmn—JWw„kUaƒK@a¯@ƒbk@mVUIWƒ—Lmwm@Ua@WJUb@LUl™@UUmLUbWJ@VL@VmXWWzUJUꄘ"],encodeOffsets:[[116641,35280]]}},{type:"Feature",id:"4108",properties:{name:"焦作市",cp:[112.8406,35.1508],childNum:8},geometry:{type:"Polygon",coordinates:["@@V@VL@x@bXŽWV@XkššlUŽWX@J„@nI@KlL„KšUVaV@œJlL@KUk@KÞL‚l²_‚@nWlL„UVVš@nLWVUJVn@anV@a„wÞUVLVx„b„@lW„@lbXn‚Vn@@¼šL°mšKVn@bnl@nVK@blb„L„W„U@VWLXV@nlKn@lVVbXw°nV_@¥Vƒl@XI@mlƒkkV¯VWnI@W‚@n¹nƒ@aWKXUƒaWk@yk@k„ċUkVmbk@WI—yóImÝkkwm@™mU@™xŁ›lU@mJƒX™ak@ƒx¯V@¼¯Vm„UmmIkVWK@UXIl@UWVUU@mVUI¯b¯@™lmKzWKUa™nƒJ@nƒlbÝ@@b"],encodeOffsets:[[114728,35888]]}},{type:"Feature",id:"4110",properties:{name:"许昌市",cp:[113.6975,34.0466],childNum:6},geometry:{type:"Polygon",coordinates:["@@lI„VnKlnVlnLVbšJlb„@ULVlUXVVX@‚a@KšI@wn@„aVV‚@nwnKlX„W°lVnKUX„x˜@„ln_°JVIXy‚XnW@U‚K@UXIVanKVVš@Vk@KVaXI‚@Vbn@nx˜KnaU™l™ƒn™Va@ƒXa@™VçUUla@aUK@wmUƒLk`kIWVkLmK@V@XUlƒn@JXV@nm„™bU‚óIƒmUa±@@ÑóVUUk@UlKVU@akWVUUlUUaUK@UUKWbUkÅJ@XWaƒ@XbmJ@nUJ@bUKƒLÝaUnk@›lXbWbXnm˜n¦lVXnWbUbVV@VkL@VmLaWl@n™b@bk@UVWak@WVImJUbUlmz@lUbkL@lVx"],encodeOffsets:[[115797,35089]]}},{type:"Feature",id:"4109",properties:{name:"濮阳市",cp:[115.1917,35.799],childNum:6},geometry:{type:"Polygon",coordinates:["@@lLXbW‚XXƒx@bVVnLllVxULUl‚XXlVlUnlŽU¦Ub¯l˜nœK@V‚bVb@šXbVL„KVxVVnIlašb„a„¥lU@wnalLnVVlVLXnlWVXn@@lVI@WnU@mƒÅW¥—aW_k@WwXy@kmƒ@wU„mš„š¦šlUxVLV@UwšJ°xš@VX„@Vb„@š`VX@VX@llšIVbnJlI„bšV„l„˜J@ƒmѯLóa@ƒƒKUa„k™ƒ™Xƒ@UK@wU@ƒlWUUݯImW¯aƒLUKU@ƒkƒ»k@mƒwƒa@UnKWI@ƒUU@akVWK—k@a±ƒbóUWKXUmk™KUmLƒbUx„„@lmLXŽƒ@@b„VW¦Un™JkbWnXl"],encodeOffsets:[[117642,36501]]}},{type:"Feature",id:"4111",properties:{name:"漯河市",cp:[113.8733,33.6951],childNum:3},geometry:{type:"Polygon",coordinates:["@@@Lƒ‚UnVxnIWa„@Xb@WÆIVlXaVL@VVLVbkVVŽUVlX@bUVkLV‚l@VVôU@Ò²@Vb„nôJVšanƒ@mWU@I„mVk@WkI@wmak™@wlW@w„@VbnLVb°bVyX™V_@aUKVVK@wUU@™™a™K@kmbXVmJUXƒ`kn™nƒK@aU@mw™akb±@¯ƒUUÝKUUU@WU@VkLUKU@mUmJUU@WVkL@UWJ—X@VVL@lVlUbšLVKnêƎ"],encodeOffsets:[[116348,34431]]}},{type:"Feature",id:"4106",properties:{name:"鹤壁市",cp:[114.3787,35.744],childNum:3},geometry:{type:"Polygon",coordinates:["@@ó™™n@xVVólƒ@¯zƒJ@bkl@@„kVWLUVmVXbVJnnlLlš¯@Xlm„°bVš—lWb@bšKVXnJ@VV„°nX@@w„WVklU„K@knVVKmkUKUaVkƒWkl»nwlŽ°lö@lXšV°UVbXKV@šša„Jšw@Um™™kUy¯UUUƒaƒK@U™L@mm@XaÇkkmWank"],encodeOffsets:[[117158,36338]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/hu_bei_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"4228",properties:{name:"恩施土家族苗族自治州",cp:[109.5007,30.2563],childNum:8},geometry:{type:"Polygon",coordinates:["@@VK‚bX@lbUVnL°„@VlVnUl@VUX@„aVƒmaXƒlašUUU@wmaVUn@Vƒnmmk@m™U@kna™aU¥Vam™X_@WƒU™mW@_kƒVaVKnL‚lœ@VVal@k¥@kUW@kUKVUlUVсW@kÇaU»ValmkUVUVak™@aƒV¯_@W‚UkmVUlU@aœƒƒalI@akkVWUaWXUWwœWVbÆ@„„l„alIVK@U™m@UU„W@al²a‚¯UağÇm@ƒbkk@wƒ@@W™aULmxƒIU‚™ƒb¯@U`UX™JmL¯aƒKX›WUL@aknmK™@aWUXaWm@I@UÅmVU@™™aUV@b™VƒI@WkU›bXkm@VakwUKULWKXmJ@XUK@ƒmL@KUwVaUI@KU@mmn™mXka@»V@@UUaƒw¯yVk@ƒUUVmmkÛÈU@mWUnmx„šmlUbV¦UlbWVUL@UUƒ™IUmÇKV„VbUVVxkn™LUxV`VX@š„„kJVVUXWaUVVlUnmKUbkI@WULmK@L@LVlƒLnmUIWV@aknƒ`VXUJIVlUVVbUX@¤mbnLm‚m@UXk@mm@Ukaƒ¥@kV@@KkU@aUKWbkLWVkIVŽk@UbVlmX@bU@@mmL@bn`@Ln@llVLVk„@XVVU@`VXUš‚¼k`VULka@VllVIn¤VU@@bl܃bkx@bkL›škKƒn@bn@@b@JUnV`UnVbVKlVXUlbn@°ƒVx„@@b„nVbUllVn@V—VK@UnW@UVUšlnk‚VÈޚxVb„VVI„xVaÆ@@aka@UVaU@@a„k@Wl@nbVIƎ@Jk@„L@VlXnlla@VJnw@UmwXU@aVK°ÒnllnLlb„xnKVaV@l¦²nVl@llL„x@XVVœ‚Ķš@našx@U@al™XUVa‚LÈþV°XxWXkK@šmLnlUb@b‚xnLVlVVkb@UJ@xWXXš"],encodeOffsets:[[112816,32052]]}},{type:"Feature",id:"4203",properties:{name:"十堰市",cp:[110.5115,32.3877],childNum:9},geometry:{type:"MultiPolygon",coordinates:[["@@@a@w@kV@nbVK@ƒnUla„@la„Ål@nlVakwWX@WkLšaVmšwV@anK@UlIXmWkk@@mmLkWlwk@U_mKXwWK@U¯K@UU@ƒVUa™kmƒkI™yUUVUmanU@mlwkƒ@_mWXaƒUWU@ǃ@U@aUaVwUKUIƒVkK@UWIXƒmaV@k@Vm@UnwlƒUamk@V@„ULUamxUJkU@Iƒ`WkkK¯XWak@@W@IUV™LWJkXkaÇVUKƒ@kUmbmUUƒUKƒbkKWUkI@ƒkKÝ@@aƒUm»nI@mƒU@UnWV_@aUmWbkLUl¯b@a›kkk@WkkJm_k@UV±@J@b›nU@@WÝIUJVbXL@nlJkx@„Wn@VkJmb—LmUƒ`VbUL@xVn„@XVƒŽ@„mVVnnJVbU„ƒx@„V„nVUbVVƒx@šn„™bUK@bƒ„@bƒJ„šm²„VU‚lbXzVJV„„JVbn@@Xmb@V@bVJÈ@‚Vnkn@°aVVV@šX„KnalLVmšUnnVKVlnLWlXX„Klk°š™šXŽWškLUVVV@nU@ml¯nmbk@W`Å@mb—LWm¯UƒxnêVèk@mbƒVƒnUK™@kKmXk@@JUI›lÛLllnbVnlJ@LULnlÆaVLnŽV@nkVJ„@lkô@²bÆm°w„L„WV@VXšKšVXI@W°ÆVšK„b°U„JVIVV„¦XKVL@l‚InaVÝnUl@@bX@‚™nmVL@lVL„lVLVUnbVW@xXn˜bœU°¤V@š™„a@kWKUUn@VlnL@UV@Ü»@mX@V_ƒakaÞ@VK‚¯@kkW"],["@@mUkUUm@nllVKXXVK"]],encodeOffsets:[[[113918,33739]],[[113817,32811]]]}},{type:"Feature",id:"4205",properties:{name:"宜昌市",cp:[111.1707,30.7617],childNum:9},geometry:{type:"Polygon",coordinates:["@@°`„U@blšUbUVlVkn‚ŽUbV¼Èb@l‚XUÒkVUVVL@lVX@ll¦k@UbU‚›@kmKULUbl„@`nXšŽ„V@XW`nšUbV¦šbmb@lšV@nnlmnU„m@UVnb@xVV™VkbW„nb‚VnVa@an@UaVU‚JXnWlXX@l„¦@ŽlKÆX„bX‚V@VV„@°¯°xXx‚XV@nV°UVWU_VWXkmaVnWVkn@lln@lb@UVLXWlnX@˜aXUmaVK@UXU„U@WVI‚W„XXV‚U@¥VKœ@‚Uގ„„‚a²LlV@kV@UanKma@UVUnK@UVLXyVL‚knJ@UV@@UXKWUXaV@Vb@mVLnKW„m@aUUm@@UkK@Ula„LXKWaXI@alKlmUk@wVKXL@m@WWn@UVa@K@wna@aW_XWWkXbVW@k@U¯WWwka@UUaVIVƒkU@m±@U@@wVKkaš_@VV@XUVwU¥‚šyUkm@V±ÈUKk»ÇL„m˜mLk@ó£kmWwƒm@U„IkWKXwWU@ƒkLƒwkbmaƒbkK@VƒLkmWIUKkUUƒÇIǫJ™XÅJULVŽÇLUVƒ@UK™@kI@WVI@UaƒWmXVVUL`±kÅLmKkƒƒkƒÅ@Ua›XXxWVXŽVbUXll@bkJ„b›„@bkVUVlnV@X"],encodeOffsets:[[112906,30961]]}},{type:"Feature",id:"4206",properties:{name:"襄樊市",cp:[111.9397,31.9263],childNum:7},geometry:{type:"Polygon",coordinates:["@@@Xl@Xb°WlLXl„_@JlVVInwVbVK@ƒ@UnlVbk„mx@VUnl@U@nbW„XJ@VlL„UVJVLUxVb@b@VȄ‚@XV„VWbnX@`l„kx@nmVnbUVVVšzlJn„šlVb„UV@@V°L@VXLWxnLV`l@kxlXnK@nl@XlWn„`Xnl@@UVa@VÈKš£VLVanW°U@UVU„@„`VIn‚mV@„nV@Xa@aVW@UšalkXKšblI„yƍXnlJXbl@@VV@nklU@`„nVK„LVKVb@V„U@UÈK„UVKšIlUX@V`lIVbn@nblVVmV@@XXJšUVV@knKVn@`@X‚VnK„wlLVmUUU@ƒU@aXL@WlU@UUW@UmU@KkLWaXkWmXUWm@U@ƒnk@UmK@U@UaUVUUKV_@al@namWUI@KUƒK@aV@WUIƒbƒ¥ULUJkIm™ƒK@U@K™V@U@a@UkU@K@wVaUwlU@mUƒULmKUkV@@anIWmUK@I¯„mKkl@LUb±lUakLmk@WwUKÝVUIm`¯n@Uk@makJU_@ƒƒJma¯ImwUVkKƒb™aUÅ@wWaU@VU@mXIVmmUkJkwm@mIlUKWzUK@VmLUV@VnbmLVbU@@lkU±KbƒƒÝV›@UL@¦VWUƒWXUJ@XƒVWV@VULnbWV—bW@kmWXUK@Vkam@kkm@UlmXUŽnbWlUXV`UX¯VmUU@Ul@Lll@nnJ@LƒnWmbmš@b™`ƒš","@@kUUm@nllVKXXVKmU"],encodeOffsets:[[113423,32597],[113794,32800]]}},{type:"Feature",id:"4211",properties:{name:"黄冈市",cp:[115.2686,30.6628],childNum:10},geometry:{type:"Polygon",coordinates:["@@VVUnWVXnVJ@„‚U@V@VXŽV@@IVJUnŽ@V@L@KlIVlVanLVbnVlI„ƒn@@a@Kl@@I„JlI@aXU@KlK„kVblJXU„VlU@V„bVkVKXn@VlxVa²I@VlVUxln@bšJXklaVWnLmÅ@y@k@ašI@W@aXIlVVaV@nnlKnLVW@IUa@a@K„UVVlI@wXKVV@IUƒla„@lUXwWƒnƒnalLlxXLll°@XwVKVaXIl™nb˜@nln@Va@U@k°ƒUmÆUVaXI„JV¯ÇUmmkU@WaKmakVm@U@aVKkkmKkVmIkÇ°£@aUUVaVVnKlkX‚mkƒ@ƒlUVaX@@Um@‚™UmlUXV„UVU@w‚K²¥Ua@I@UV™l@U™V±UIUÇ°»VkUmVI@a@U™m™ĉ™¯V±bŹĖğaÇL¯lmŽkX@‚óĀ@ŽmšÝêb±WkLƒn@xXx@Ž@b@V@LW@UbƒlţXƒ`kxWnXô¯¦ÆV@L@JVLƒxkK@V@bkz°l‚lXz@J„UlVla@XUV„bVKXnW`XXV@laVV@V„X@V¯xƒx@xULVbUJ@n@LU@VmmakbUK@b™IWWUUVkUmkLm@VJkb@nUJƒ@`V@kX™aUaVmmLkUmJ@Uk@U„±lkzmJUb@b„VUxVXU¤ƒL@JƒX@VlL@JkLUVU@mnUl„¦@V"],encodeOffsets:[[117181,32063]]}},{type:"Feature",id:"4210",properties:{name:"荆州市",cp:[113.291,30.0092],childNum:7},geometry:{type:"Polygon",coordinates:["@@ÈJV„lVVLXJln„K@UlL„anbla„xlK@„XVWxXLlƒJ@V„nXxlnô¤l@nKn—‚ƒÈKl¼VL²Ç‚Un@Vl™zŽV¦UxWVU@@U™`lbUL@xV@²@@nlVU„UJVb@VlbXx°XVWX_VKUwVKVa@UVKUUVk@KnblaUU@wnWl@UX@lÆ@@a„IVmUk„™šxVJ„U„bܙ@Uk@WWnk@Vƒ„™Vm@I@m@Un@m™XUlVlUnJ@knJVU°@@aÆLX@ƒllL@¦nJV@XblLVa²U@UlWš@VX@`@LV@@bXJlIXml_lJœU°b„KÆLnVVl‚@ö—Vƒ‚mXaVIĢllUlVnLVlX@@b‚ašnnxšV„L‚bn@°ÆXmmkĉƒ¯w±™™™Uċ@KÝÅƧŃÝ癙Uw¯ƒm™¯k@W‚kV@¯UIUJW¼kb™Uƒwk@W`@¦Uônb@VƚlÈ@VU@ƒƒ£UWWnUÆUnmJkUÇ£VWUI@aUU@WkI@Uƒa@JW@k£kaWVUKmnkKƒb™kkVWb—VmUUmwU@kk›@UakUUa@V@nlx@lUb±lUbnnWLUyk@UamœUK™@mlk@Wb@VXL@x@xWI@a¯Ž¯V@bVn@LkKmL@`XmKmVU@@bkL@V±bk@Uaƒa™L™KUVƒIƒ„™W™XamVVbUK@b@Lm@UWkxULWVUnm@UlUX"],encodeOffsets:[[113918,30764]]}},{type:"Feature",id:"4208",properties:{name:"荆门市",cp:[112.6758,30.9979],childNum:4},geometry:{type:"Polygon",coordinates:["@@n@lxlInVUnWJ@nUVV@Xb@xVƚb„alLVUnx°Jnb„I@„V`lInbl@@V°mn_VJÞUVLXx‚@nllKVb²kVa@KlknL°ƒ@JVLXnmJ@bU@VlnLVKV„@nX@lUšKVaXal@VKn@¥°L@Unw˜bnašV@KV@VUX@lVXI@KW@@IXWV@laVL„„KlaXUVVnkVWV@lwXblIXWVkVmšaU£VaUmVIkU@y@WakKUamU@UUK@kmK@w@@mK@LƒV¯™U@WwkmULƒamVVUU@ƒƒIƒbUKUa™kmƒm@UakLmxU@UÒWlULţÿmwkIUm@a‚kÈblW@UVƒUUk@JW@XkWWUkUKUIlw@aUWknWUUmnIWƒ™aUwVaۚƒaƒVUI™wƒšVlUnƒJ@bÅ@@kVWk@mX@xVVkbma@LUlVVUL@VUbULVxULW`UX@V@lUXWaXlWXX`@bmb@x@LUb@VmŽXX@‚@nWKUL@xVlknkL@bWJXbWLƒKkb@VlL@Vn@VV@bƒnX‚mLUK@nUaU@WbXVWL@VU@@V"],encodeOffsets:[[114548,31984]]}},{type:"Feature",id:"4212",properties:{name:"咸宁市",cp:[114.2578,29.6631],childNum:6},geometry:{type:"Polygon",coordinates:["@@ÞƂLČ@šV‚š²š°xĊ„nlWnŎ¯m@aƒK@„„°‚n„Jšwn™VIUaÆJšÅ@wšwV™XW@aV_l@²V°lĊwlaXLšwlUkalVVaX@lVXI@a˜UXJ@U°UU¥VIVKVklanLVa@VÈIVV@nk@aVa@mV_@a„K@klKUa@UnKWk@@lU@@UW@@nUWUwmaVIXƒ„lV@mLXblJ@kV@kk@KU@WƒkUWVÅwkLmW@UmL@lUL™KULƒak@maUUÝwUJƒIb›KUUƒ@š™aWK@kUWVkUwVw@™mÝ@™I@wkW@a›ww@LU¥™kƒJ@nVJƒIkVVnkV›UkyUIUl@xWUkaW@@°kz„ŽWxkLUWmzk@@bVVVš„b@‚@XlVœ@Vl@bVbUn™`Wn—@Wb„VVI@`„LVbXLV`mnU@@lƒL@LUŽƒak@ƒLk@WbUJn¦@lVb@xVb@n"],encodeOffsets:[[116303,30567]]}},{type:"Feature",id:"4213",properties:{name:"随州市",cp:[113.4338,31.8768],childNum:2},geometry:{type:"Polygon",coordinates:["@@„@nš`lw„k„ƒ„UmUVWX@lk„@VanUĠ¼V@@mX@@nVV‚VXLmJVLnK@b„V@@J„@VUn@VaVUUUVWVLV@@Kk_@almaVkUU@WVƒVUVLXmmk@wUaUKUV@°™@kmaUaÈmW„mUƒVklaX@lVnxl@@UnaUk@ƒVUVwVK„nš@VVn@VbVJUknUmmVmk_Vw„KUUm™Vak¥@UVKVIkW@UmIVWkIVƒkmmLkwmVUƒ@LƒUU@VVXL@JmLUbmK@UUKmkKUUmVUaUnÇlk¯™mJUnmLUaUJUaWL@UkJ™ƒUƒ@ƒaklkU@¯@KWLUmUUWVkbƒLƒŽUKkbU@WX@JX@@LWJkUW@UVU@@L™Umb—amx@V¯K@¦mŽULk@WbUb™LkVW@kVVxUb@x@LlV@V@b@VšU@L@V„LnšlJVIVK„¦„aVJ@XUŽ@b„LV‚@LVJnXmbk@@bU`VLUVV‚b@V@VnL@Vml@„@VXnWVXnWlXblK@LnV@VVX@VkV@XWK@b„VV@VV"],encodeOffsets:[[115830,33154]]}},{type:"Feature",id:"4209",properties:{name:"孝感市",cp:[113.9502,31.1188],childNum:7},geometry:{type:"Polygon",coordinates:["@@VnXK@L@°lVlk„b„@„VšlI@VXKVbVIVbnKVmnI°šlŽÈkVmVbnUVVlLnVL@VnLVanK@IWKUUV@„V@KV„nUlxnKlnU„lJUXnJ@VlXUJUL@Vl¦UbnšVVƒLUxl`UnnnmVVlnVK„bšmVX@a°Ý°LšaXJV@VUnKVXVK@LnKlLUbVVX@VwVJVn„@@UU¥V@@UUK@ƒmaUVUkkJ@L@K@UmVUI@JU@W@U@UV@ƒUIWmXUVmUUÇ@UVmIlmnmakK@akaW@UwVUkKVnUlKVwk™ƒVU_WKUkVW@UXaWkUa@w@VU@XaW±@IkbƒKƒb¯L@WƒXkWƒ@UakL@UV@UmVUmL@UXWVL@ašUƒVUUUVU@yUUƒIUa@wUKWVU@kƒ™™Wk¯UkwVKƒLUx™K@nVxUlUUWVUmw@wƒUUyXWlX¦WbUV@„U‚@blbUVVbXXƒl@lVL@bk@lxkVVnVx™¦ƒ`UnkL@V@L@Ž‚@@xnL@lVL@VnVVblLXb@‚@zlVUJVnUbV¤™bUnUlWXkJWakxU@UXml"],encodeOffsets:[[116033,32091]]}},{type:"Feature",id:"4201",properties:{name:"武汉市",cp:[114.3896,30.6628],childNum:1},geometry:{type:"Polygon",coordinates:["@@nbnm‚knJVUÈ@@Uƒ¥VknmV@VUlK@IkK@U„W@I„KV£UWVwƒU@aVanIly²kVƒl@@VnIlVnKUnVbšblWU@@_„‚VI@mlaUIn@lKVnUlVVXXšJ@aVLlanbUnV@@K@mVIUaVK@w„w°w@UƒW@UUUkbU@WWX_WmULƒaVU@WkbkUƒV@IWyk¯kly@a@UlL„wUK@I@KÅUW@ѱUm@wl¥kaƒ@@_Vw@ķƒa@akw@ƒkKW£XVUVwVwUaU@VUU™™xWKkbĉx¯k±Uk@U`@bWXUš™x@x™ÆÅIVbUJmš™xƒImƒ¯@ƒ™Umx™nUVVbnJV„@Lƒ@@ŽkV@bVnƒ@UVULlx°VXlššl„V@XUVL@xVb„JVV@zUVVVUV„™V@bUKWX@VnKUVVnU@@VlKVb„@lX„W@X°K„a„Lla@JX²Wb@ŽUV@@xVbXlWb@VUXVlXLV`Uš„lŽUxkLmVUŽlLUVVxX@lb@blL"],encodeOffsets:[[117e3,32097]]}},{type:"Feature",id:"4202",properties:{name:"黄石市",cp:[115.0159,29.9213],childNum:3},geometry:{type:"Polygon",coordinates:["@@VšUVV@VbUx„aWUœblUVmnKlX@bXJVIlVUxVVVIU‚zlx¯š@‚VbnL@x‚x@UVaXK„b˜@Xk‚WU_Vm²klW„XVK„Žl@nXV@@w„mlK²X‚aÞén™@ôÿ@lWn°kUKmmUљUmm@ƒwkImWU@UakL@bVLUVċ@™bUK@alIXKWK@™nXnKmkUVwƒ@¯b@L„lUL±W™n@KULUaW@kL@lƒL@bU`@nUb@bmlU@UÇJ@UUbmKkblŽUULUJV¦¯V@VWI—V@bWJkUW@UbkUlbkV"],encodeOffsets:[[117282,30685]]}},{type:"Feature",id:"429021",properties:{name:"神农架林区",cp:[110.4565,31.5802],childNum:1},geometry:{type:"Polygon",coordinates:["@@n`lIXll@lœl@b°aVklKXaVn@bU`mX@V„V@nmJn¼„V@bÞ@lL@„lJXVlL„aVLV„nVnalV„@VLÈUlblWXIšKVU@J„™š_‚@an™na‚X„m@KmI@mkk@KVkWWw¯w¯°ƒ@UUU@WƒaÅWkL@ƒ¥@kWWXkWmIUVVbm@@bUbmUU„ƒbW@UVk@mVkU@U¯ƒmKVUkaW@aULƒÆVbƒb@VÅ@Un@VƒLWl¯Lš„"],encodeOffsets:[[112624,32266]]}},{type:"Feature",id:"429006",properties:{name:"天门市",cp:[113.0273,30.6409],childNum:1},geometry:{type:"Polygon",coordinates:["@@@K@UlKVm„_š¥UwUmlUkwl@@aUK@k„kWWUaVUka@aV@ƒVUXaW¥Xk@WWIklm@ÅxmI™VÝUkxkaƒ„@bWJaUL@„W@™l¯UULU‚ƒbƒkV™Ua¯bm¤UnÇUkmUšUx˜b@VkXÇal@bVnlJnxŤĀVKXkVÑV@nwlKVbn@n„šlVbVL„a„J@„VV‚UnU„bVKlnXxV@°š„U@KnL"],encodeOffsets:[[116056,31636]]}},{type:"Feature",id:"429004",properties:{name:"仙桃市",cp:[113.3789,30.3003],childNum:1},geometry:{type:"Polygon",coordinates:["@@VK°VškX@@ƒVK‚bXI@a„ƒlblwÞVšUnJÆwn@lkXJ@X‚WVz„V@xnx‚VXUVVVkUw@mšLVw„KVU„@Um@alU@„@@KUƒmIUaVUšmnwmw™mb@aW@UkmKkUkVġkUJWbnU„õ˜@UkmUÅKƒL¯a›VkIk`WnkJƒ@xVLUVVbUbk@WlXbm„VxnxUblbUV™@@VUV@nVL"],encodeOffsets:[[115662,31259]]}},{type:"Feature",id:"429005",properties:{name:"潜江市",cp:[112.7637,30.3607],childNum:1},geometry:{type:"Polygon",coordinates:["@@UbVxšbX„mJVnXVlmVX@bkxVJVLVlXXWlX@@IVl„V‚U—aVwV™lnÈVVmn£°aVbUš„l„aVUK@mVU@Uš@VUkaVamwUwnƒWaXkl@VaUaVUUK@w„WI@aU@@K@_UW™@kX@V±VUbkKWaU@mI@¥kK„kW@ÅK@b¯@UVmI@lmIkVkUWVnšm@@V@n@JUnƒšU„@ŽmlXXl@@V"],encodeOffsets:[[115234,31118]]}},{type:"Feature",id:"4207",properties:{name:"鄂州市",cp:[114.7302,30.4102],childNum:1},geometry:{type:"Polygon",coordinates:["@@°¥WóXmlw„_ŤW„kVaX@@K@U@a@WwU@mWk@ƒULƒWkX±lUnV`XWl—@ƒaWLUb@Vw@wmKUa@°™kw‚yVUJUUVwkUUJWI@akWmLUnkV›aXVƒbUxUVWX¤lL@„lx@b„b@ĸUx@`„@lbk¦@x‚n²VƄX@"],encodeOffsets:[[117541,31349]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/hu_nan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"4312",properties:{name:"怀化市",cp:[109.9512,27.4438],childNum:12},geometry:{type:"Polygon",coordinates:["@@@n„‚@b@XnJ@k°x@aVUnl‚UXnV@@VnJWUJV„nIVV°ŽUbVVVL@Ž²LUVa°V@aV@nm‚UXblLXWVXVmVLVK@an_„`@X@l°„VlXXW`nX@Jmn@b„@nV@Lm`„bUb‚n@VUVl@nIVbUlƒV@LkJUnVV@xVblVUbU@ƒzUKU@mx@xUnn@@WV@lbUb@šnVWXX‚V@VIV@VUnJ@VUz@JWbXllI@VXVVL@ŽVn@„„Wlb@„Žl„XVlL„aV@VJ@XX`„kVwVl@bk„‚bUŽlVXIlƒnLVa„mVwV@@nV@XaVJVbX@lwV@n„@nV@VWnIVVUŽÆ@Xx‚a@I„UUKmk@mVƒ„IXmWUš™VJnUVU@anaVwk™›U@UXa@W™@m_@a¯@@K@UVƒ„bnK@blIlbXa@WW_n@VƒU@¯bmyƒUkUJÇÅ@WU@kWKÅwƒnm°KVkmankVWnXVWV@UƒƒwXkV@mƒ„UlLnaƒVaX@VUn@VnVK@xlnXWšU@a™@@klak™Vw™mUaV@™wmIÛ`m—@mVUXmlIXƒV‚I@K@aU@UaV_UK@wkUmmUKWXŽmVkUƒL@mƒƒU_nK‚™@aVU@Ukak»@U™™@ymUƒ„¯™ƒUUƒVKkam@™nka@ƒmwkLWb¯mkaƒ_VaVKUƒ™IUw@kKmU@WK@UnƒmaULkU@wUalWV¹U@@WUI@WU@‚_@W@U@mƒU@WbbUK@Um@@UmbUwWWkk@WU„a@anUUwlWUwUU@wlJVUnnV@@mnI@m‚K@U@w„a@wUm@_mƒVUUaVUkƒƒƒ_kċUk™VWLƒ@mlU@kn¥W@UwUWV@VÝU@lXLWVUbVLXlVIl‚knmU@VUJk@@„ƒ@™kVmwmVkxU@@XmVUb@xnKVLl@VxUxkIU`@bWVXX@JWL@bkb„¤@bmUUU¯Kƒkmb@V™VU„VVn@@„Vb@`lnœxmb„lUn‚bk„@xU„mV@bmWbUV@VJ„Il@nVUb‚K@nn@VbnJVIlJVkXJ@X@lmx@bnnWVXJWXU@UlU@mk@@llb°x„IUbnJ@VWbXVmI@JVX@bk‚@bWL@JUXUK@U@Uƒ`n@@Xm@XVW@@nX@@`ƒImxU@@JUI@KƒLmK@UÅUUV@VW@™¯kUU@UamVUUmJ@n„xmLKƒkmJkwkKm_mKXU@aƒU@b@Wk@ma@zUJVUmbUlU@™xnXlWlXXblK„¤V@@nUVVLkVš„l@Xb@VVK‚nXKVx@znW@X‚@@lVK@X@JXbWbnn@JUamLVVXIVxnK@aWUX@˜x@VnI@WlI@anV„IVxk‚l@lbXXšxVVVJVInbV@@ln¦ml@XXVWbkJWb","@@XLVKVXVKUa@UUUmV@l"],encodeOffsets:[[112050,28384],[112174,27394]]}},{type:"Feature",id:"4311",properties:{name:"永州市",cp:[111.709,25.752],childNum:10},geometry:{type:"Polygon",coordinates:["@@lxUXV‚lXUVnlVĢ„JVbUXVJV@XUW¯„VIUK@klW@Un@„nl@V`XUVL@l@šVx@„XXW`UnUbšxUlVnUšV„lb@VnJšUVVVInJlUšVnwVklKnw„LVJVšV@nIV@nbVa@KVVVUUa„KV_nVVJ@_VW„nV@n¥lI@anƒl¥X_VKlwVlULUVVVš@šU@VXL˜ƒ@IUmn@VU@wmKXUWU@m²šl@VIXWWkWUkWlkIVamUXamUnmWUU@@Un™lK@XJl@kVUk@mWKXkl@@aVU@UVWUUVa„In`VUVLnw@U@K@Uƒƒ@w@UVmUUƒ™°K@UnV@bV@Xk@KVm@amk„aU£VWUUmUUwm`UbULka›KXU@kVmU™@aV_UWVIn@˜y„XXK@klmV„V_kWVUn@WUU@UƒmaU@™wnwWanUmmXkƒam@UakLmK@b™xUUUU@Km¥Vaƒ¯@ƒkUaVUlm„UU@mUUÇmUk™Uyƒb™bUa™XUWWbÅLmL@V™aL@WWXUKmmk@a@UUK™XW¥kU@VƒUkxmVkUWbUJnVJ@nVJXzWxkŽ@lVbUX@VVL@`mbUnšŽUn™VV¼k@Ulm@mwLƒb@lmLUK@UamƒWkƒK@£Ua@ƒ›UkJkUmbVlkX@bWbUŽVŽnnUVl„@bšbVK@VX@lb„V@nU¤šx‚²„Knblb@x„V„ô@šlŽ@b@l@XWxnVl@„VV@XLVl‚LUŽUXV`šbXXmJU@@bm@UUkLW@UlUKWUUb™wUm™L@nklVVmVXXm@@bUKlÆn„‚XkllVUVVL@nUbV‚@V@nnV@xUn¯U@JW@UX@xĉ@™`m@@LV@b"],encodeOffsets:[[113671,26989]]}},{type:"Feature",id:"4305",properties:{name:"邵阳市",cp:[110.9619,26.8121],childNum:10},geometry:{type:"Polygon",coordinates:["@@XIlJšI„VVK@n@VVVKnLVwVmnLVK@U„@šw„J@wVIƚ°X@ÜȄUÈxll@kn@VwVaXJWXn@@WVL@UUKVKV_U@@aVK„x@U„aV@lk„@XylbUaV_šVnal@W„U@a„I@aV@@aVUl@Xm‚UXWaXml@@kk@ma@V_UnUV™UUWJUa@kkaWLUmk@@LUVWUkJWkK@¼UnWJƒIkV@b@JUIm@Ul™V™m@Uw@a@kWƒXWKUknW@ƒWUU@k™mx™UkVmIUJUU™VmI@UkaUƒV™UmVk™wVaVmX_WW@ƒUw@™@kUKWVU_k@ƒmm@@VkX@lVLUJƒX°WVU@UIVWUaƒIUġmkVUkWUVWkwWXk`mI@¥kUVƒUƒUn±@m›XkWknV„UVmmU@@XƒVƒUk`@Xƒƒƒk@¥¯»mbĉó@mkU@kU™ƒƒ™KmX@˜UnmL@lULkKUƒWUU@ƒbUaUnƒ@Vb@l„¦Ub@l™@UKmnƒKUnl„UVVbUVn„@`Vn@xƒb@x@VL@nmJ@nU@mmUVkI@xVVVxkXVxmV@bƒbXVl@Xl‚XVxna@Vn@@VVL‚aXaV@n„‚@@V@X`V@@XVJ@XV@UºkXVb@xlVVKnbm„@VXLV@n‚lL@VxšJV„ULUb„`lb°nXalKnx@„lbšmn@lbULV„„V°š„ƒnV@zšš@Vl¼lb@VUV@bšmLV`„„@n„KlVnU‚XWVLnnlV@xVLU`VbV@"],encodeOffsets:[[113535,28322]]}},{type:"Feature",id:"4310",properties:{name:"郴州市",cp:[113.2361,25.8673],childNum:10},geometry:{type:"Polygon",coordinates:["@@²zVaVlnVl@nšVk„Jl_XJlIVmnL@mV@VXn@lV@‚XzV@lyV¯²U@UlJ@XVKnVVIXl@UVLV`@n@J„I@mlI„KVLnUlVUVVLXašKVLl@nb@ŽW„XV°KUnVV„L@xVJ„L@b@LUVVVU„˜VXbmbVbn@@lUbm@x@XVVVŽ@@˜@bkImx@Vm@Xbƒb@l°XU¤„a‚L„mnL@bl@@™VUX@VxnV˜anLnƒWƒ¥XKVwnUWXmVIUWÆLVx„L„w@wVmlU@¥XƒWUkwlÇn_Uw„WV@VU°wnU—ƒy@aVškVlnL@lVn„w@VlJ@b„X„x@bVKnb@U@WVUl@@Vnbl@XLlK@aVLVKnxÞn@a„LlmUaVU™ƒm@ÅknUmaUKmVk@m™kk@UlWUkVm@w@kUU@W™U¯™¥@w„Ç@aVIlUV@kUWU@UUm»@k@mKVkUKUwƒaUaUa›@k„kUWJkImaU@UK™@maUzk`@zƒy@XmJkL@UUJmUkV@z›@kŽkVmK@¦UbWL@a@UbmKmwUK™Xk›VUUkmVkw@UUKmL@WUIWa—JW_k@@WmI@mk@WkWULUUVKUUVm@šU„bš@‚nUǃ@U@w„™V@Ua@aƒL@ak„›l@k™UƒJƒwó@@L@V@„™`@œƒJ@xnn™šmV@bkJmUó@ƒn—JW„UUmƒU@UV@Lk„WlnnmVXbmxšxV@nbV„V@XVm@UVlXU`ƒUŽkn@lWLƒW—zm@UJVXU`@bVšUn@lWVœLlbVKVan_VxnVVVUXV¤ƒbnl@bUn@LWlU@@amU@V¯L„šVVUn@V@x„„@V@L@VmxUKUVm_ƒJUbVV"],encodeOffsets:[[114930,26747]]}},{type:"Feature",id:"4307",properties:{name:"常德市",cp:[111.4014,29.2676],childNum:8},geometry:{type:"Polygon",coordinates:["@@l™U™mkUwUyV™@VW@¯Va—VmUU@KVUVUVLnaWƒnkUÓV_@mVU@݄w@ƒka@kVmƒUmK@IkaUamKkXWaUW@WUk„™@@KVU@aU@™L@J@XÇVUKVak_mWkLWakVUbmLUUmlUVKUU@kUWW@UImJ@xkLkKm@@Xƒ@ó݃@UUk@UKƒV™ƒULƒKƒXkWWbkaƒIUƒWU@mUk@WLaUJġ™ƒ@@XÈÆVIl‚„Vnz°aV@U„m@X`@XWbkakJ@amLƒaU„@V@L°@@bn`š@@XWb@VœVlšUxmb@bUVmVUI™šXVWnƒJU„@nnlVLƒV@JbWzk`m@UVK²V‚x„k„LVl„@Vn@V„„°xVKVkœVVlUblx@bU„‚Æœ@@nVnUll„kx@VW@@VkLWxUL@bÝ@kKkVõV@bkXVVUVƒ@ƒVkUkV›LkV™a™@@™ƒ¯xUxmX@JVb°WXkK@Vm@k„Vb™bn¤‚xUXkJƒblxnXÆK²l‚_@Wnašn@ŽUL@b‚JnIlV„@lUœ@@¯ô@lWȂIVKVm„U@aXaV@lwVXn@@K@UVKUUnU‚bn@lWšX„ƒlJnUšLšKV@„„l@²a@UlK@aV@naVX„WV_nKlL@KUm@a°U°@VXL@a@wWmXal@„k„@VLn›V@@bl@VnX@mwVa²aVU@mk@"],encodeOffsets:[[114976,30201]]}},{type:"Feature",id:"4331",properties:{name:"湘西土家族苗族自治州",cp:[109.7864,28.6743],childNum:8},geometry:{type:"Polygon",coordinates:["@@@KšL@wnK±nƒnm‚—@WUk„ƒÜÈn@n»@mVamk„mšU„„l@V™nmmU@wUan¯VKšLn„VWlInyWUœI@WWk@KXU˜n@mnUmU@WœƒmkV@ƒkXašaVaUm‚Ikƒƒ@kaƒX@ƒUm@UKWU@UkJWkXa@IVy@UmIUVU@UJU@WXWmU@™VakaU@@Xm@Vm@wnwV@VL„yV@VakUUa@wUUVmlI@K„UVkUamJk@VU@UmVaƒan_@KmUƒ@@anm@ImWX_WWUk¯ƒ@k@Wƒ_m`@bULUKUnUWWXkKWaVmnU@@b¯UUbVŽ±K@UKUUVa¯UUmJUƒVIXmI@UU@WmVmkUV@b¯w@lmI@W@aƒ@m¯LXbmJVLklWL@V@XXŽmbVVU@@VU²Ul@VlX@bš`Xx›zUmkUVÒlŽ@bXLWxXVlš@V„bkLma@nmVmULVbmVUb@lnzmbUÒVl@°nLV„lJkn@bmJk_ƒVmmkblxÈx@LUb„xVb@V™n@JmLVŽUš@„nV@¦VbnJ@lVVbkx™bm@UxVLV@n`UnVVV„kl°z„xVb@VU@@ÆlXnWm¦nbVK@XVVUVVl@X„KUV@nVL@WnIWŽXLVKVLlxUbVKXVWbn@@UnKVLVb„JšU@aVU°b"],encodeOffsets:[[112354,30325]]}},{type:"Feature",id:"4304",properties:{name:"衡阳市",cp:[112.4121,26.7902],childNum:9},geometry:{type:"Polygon",coordinates:["@@lšV@XV@„mXVlXL„W‚X@l@bVxn@šŽšUVkn@VJ@I@alU„JXIVm@»‚LXllIXVVU@Kl@VnXKlb@lVbXIVVUšmVVU`@nbl@@lXLVVVKVbnXWJ@VXbWxXb„Ul™VK„¦nLVVUVVbšb„K@U˜LnK@Un@VxlUV`UnnL@VVL@JV@VUnxnKVbV@@VšIVUnJUVUl@nW„XllIUa„KVbÞLV¼²`V@VIUwlaVmXa@IWanK@U@m„kVƒVUVaX@lšnaVLÈ@‚¥@kkJUWJUaƒXkaUm‚wVXJ@_lWUU@¥n_‚KkamUK„™@amKƒnKƒbV£¯W@k„aWan@@UnwlJ@a@—@UUU@W‚wn@Va@km@UanaWa—UVƒUUVU@K@aƒKUI@wƒKUUVm¯LWUXƒ@mak@UK™LWbUKVUkUmVUKƒLkJ@nƒJ@I@mU_UK@VWkUJmUUL@WkI@V±VU°kzU@Wy@kUm@UWU@@nmKUnkJWIk`ƒIUlm™k@mUUkUb±yUX@VUV@bk@WlXL@nVlUl‚k@WI@ŽkLmš@VV@XVmnnVWbnVUblJXkVl‚XXlWXUJk@±™@nXVWVnL@xUVm@Vn@J—„WK@U™V™@UUVUVKUkkxULW`k¦m„@bkJm¦U@ƒmUX@`UImUU`ƒLVbUVUU@LUbmaU@mJU@U™UIƒKmxkLUl"],encodeOffsets:[[114222,27484]]}},{type:"Feature",id:"4306",properties:{name:"岳阳市",cp:[113.2361,29.1357],childNum:7},geometry:{type:"Polygon",coordinates:["@@@wUklmUUmU@@UVm@wUaV_mmUKmwkIkJmUUnm@™™@UUƒbUKUƒmÛamm¯xVLkbÇƃUƒVUzkVUlƒUUKWLX¦W@ƒVUUUaƒKUbmLKm„@akU@aƒmVaUUVIVWkk@wkƒƒ@@xmLlmÅwmbVlXlÝIWVkK@kkVƒL@VWKU@Ublnaƒƒm@b@bšnW`@XUJk@UUWKƒk@UKƒnn‚@xmLUVm@kbVbV„nV@V„b‚@KnV„LWšXŽÆVĢ¦VblŽš„n„UJWz@ƙVóUVbkV™aÅx@¦lVUbVVknWKƒ„k@ƒwƒK™VU„Å„ƒl@zkb@`m_mJ@xX„mbVbœ@llV@n„@llbXL˜UXalUšl„alVnwnLVKlšVbX@@I„V@blJ@bVL@VVVUXȤ‚VnkVÑXmlbnš‚„VKkÑř@UmaVç@±XUlI„xlV„@VaX¯lUVVUšVJn—V@°°nŽ°„Vxĸł°¦šb²¦lJ@U@aUK@kUm@_m±VIXal@„Kl@„bV@K„K@k„m@UmUUaƒK@_UJƒaXU˜@Xmš_VmUk@WUk›@kU@a@m@UƒaUUU@al@ny‚XXWWwkly@¯n@@bnV@k@mVI‚„œVlUUmlU„JUw„I‚bXƒVaUal@K„b@ƒVKVkXVl@VkUU@ylUœVVaVL"],encodeOffsets:[[116888,29526]]}},{type:"Feature",id:"4309",properties:{name:"益阳市",cp:[111.731,28.3832],childNum:5},geometry:{type:"Polygon",coordinates:["@@„ŽÆxXL@l‚V„@ĢšVI‚bXKl@nVV@„XVŽ„JlbXalX„W„LVKš„„UVLl@VV„@ôބ@@Wn@lLlK@wnIVJX@VX@lVVUL‚VnkVVnKValUXblKnXl`UbVLÈU@W@IšKV@@bUV@Lš@lƒXV‚@VXXblWnLVblb@JnL„VUn@llb@„ƒx@ÞUV@nU`VÔmlX„mbUKUVUV@LVVUn˜ŽUb@°UXš@U‚VzVxnlVškšVnlVnaWƒ@wnIn`@_la@y„kƃVƒšU„L„xl@„ƒXLlmUUVakU@¥ÆwšblUUaôVšU@ÅXyVImƒ™ƒkUaġ¥ÅUWX™ƒKmU@Lƒa@UmUUƒUalan@VUnK@wm„m‚L@V„lXLVVl@VI@WX_™m@a™¯mKUkwW¥UK@_UWWLUVkUWL@WUIkVƒU@JƒwkLUUmJVI@WkXm@VmkKUIU@mmm_@VUV™@™„kJċwUU@KUWkkW@IWW@km@klwkWVkkU™V¯m@kWLU`mIkmkXm@@`@L@xUKWkU@VL@JUU@mbUKVa¯WVnL@`lXUVkU@xW@UbUWVU@UJ@„lnU@m‚nÈmVƒa@bUL™wUb™@@VkxmUUƒ™UV›K@IƒUƒmk@akm@wmIƒŽkK@b™VWXkm@wULUmm@UVW@Ub„mbkKƒVn„U@Wl„xV„U@UXmWUXmlnbUl¯Lmn"],encodeOffsets:[[113378,28981]]}},{type:"Feature",id:"4301",properties:{name:"长沙市",cp:[113.0823,28.2568],childNum:5},geometry:{type:"Polygon",coordinates:["@@lVUllXkx@lln@‚XX@JlXXl‚V@LVVČxlIšƒš@VU@Un`nnV@VJlLUnn@lW@XUJnIVVlK„x@I„VlUVJ@XXKlVVUXKVX@`VLX¦lxVŽnLš°‚an@„„‚bkmVaV@XL@U„KlU@llLXUÞJWkUknaÆxnŽ‚knK@w„@l„@xllUXUJVVUb„n@blV@bnƒ‚LnKVa„LVbVV„UX@W¥XKVL„VVklUVy„U„VÈÅlaUK°wnnÜbn‚V„VL„aVVš@šn@VmnVlIlJna„@Valkn@na@amwm@„UXw˜K@aUUVUUaVa—wWK@kU@UaW@kKUUƒƒ@k™W¯XWan@k„™mmÅ@@I@U@KmLkaVUƒKkLWVUƒk@UVmU@am@kkk¥ƒUƒVUK™„maUb@ŽUb™I@aƒKkkWm@W¯K¯b@VmaULVxUXlVk@UxVJVbUb@xULƒ@ULWW—LƒĕmxVVL@šVb™KUwƒaŲWwX@@WƒUWLU@VbkV@aU@@VUnmJ@VUn@VƒLUK@U‚mUIk@UÇmU@@UW@J@LƒbUmVI@aUmW@@bkXUx@lmLUbm@UbkJ@V@XmlUbkKm@ma@kUaVU@aUK@mImJUIkVƒUƒVUakbWwka@UWKkLUamKUXm`Å_U˜ƒULmaU@@lUV@X"],encodeOffsets:[[114582,28694]]}},{type:"Feature",id:"4302",properties:{name:"株洲市",cp:[113.5327,27.0319],childNum:6},geometry:{type:"Polygon",coordinates:["@@X‚‚Unw„Ė˜KXXVK„@VK@wVaUaUIVwl@kUVWUwVKnb@U°a°LXŽ‚@Xnll„L@bšJVa@VanbšƒVL„U„V@al@@UV¯ÅÇ@Ummk™w@¯ƒyVwnUVVVUkmWV—nKVUƒa@WXkVKn@lUVU„VVVXIlV°VnI@VlKnV@mwVm@LXKWkU¥wWwƒƒ@k@m„X@KX¯V@VUVa@VnKWkœƒV@VUkm@aWa@wkUWwkmV£VÿXUVL@mVIXaò@nW@ašUš@@am™@aUU„UmXmWUk@ƒƒnUW@_maVm™wUkamaUL@aƒwƒW@akI@UƒxUm@kmKUk™lUŽ@b„zV˜m¯xUVU@ƒXVxm`kÈlxXVW„@¦kVUn@xƒxƒKUwÅKVXUJWnXŽmVUxWL„¦XŽm„mK—bmUUwW@UV@šk@ƒšVLnŽlbLm`@¦VVkX@`WIUŽxVnlb„WVbXIV‚lI@l¦Ç@UKmbk™W@UbUVU„ƒl@n@VmLXb@JWbUnkbVxUJUxWXXlWL@V@V@XXJWx„zUVVVVKnXW`@bkIUl‚„nLVJUbUIWVXlWV@XklVbnn@xlš"],encodeOffsets:[[115774,28587]]}},{type:"Feature",id:"4308",properties:{name:"张家界市",cp:[110.5115,29.328],childNum:3},geometry:{type:"Polygon",coordinates:["@@@InWVw°wš„@š@šblUœKlUlV„U„@VUUUlW@aöUlUlLÞ@@aVKXwlK@UX@@UlwkƒVkUm@m›@ÅVƒ@akwVaUk›UUlUL¯wƒƒ@UUmƒ@UkƒKƒlw±UULVn@l_XyWwÅ@VUUmJUXU@@mmƒU@kxW@UaUIWbU@@mU@UxƒnUbmKk„WJkUValƒ@aUkUxƒlW_@WUIU@ƒbkKWUJVnUb™bWb„lU@nl›„@XnVmV@n—mWV@LXl@X›JXVmzkJUXmƒ™KULm°Vb@xnVmnUšk@ƒƒ™VƒnnlUb@nm¼m@Ûǃ„Vl@X˜mnm„²ŽmL@x™K@LUl@nULÆx@V@VXVWbXX˜l„@nLlm@bVKœX‚W„L°bnUš@VaVUš@šmšVw„JnwVK°zn@V‚Vb„a„@Ċ¼"],encodeOffsets:[[113288,30471]]}},{type:"Feature",id:"4313",properties:{name:"娄底市",cp:[111.6431,27.7185],childNum:5},geometry:{type:"Polygon",coordinates:["@@lL„nJ@xln@bnlV„‚„@JœLVUšŽV„nVlw@Uš@VašxVK@a„bnUmÇnV@km@ƒ‚I@VUVVXVaX@@wlVVUkW@_mKXU°‚UbVLnaV@‚V@IUKV@XlVL@w@K@_n@lWlnnJV_XK@l°nšU@WVU@kV@nbVK„V—lƒ@nLlƒ„LXU@ƒlmkw@nW@UKVa¯IVn@@aVUUKl@nXVKVn²a˜ŽXblKnLlmVI@KUU@akLUaVa‚UXm@aƒ@wVUVKnLnWlXl‚n@@U@anUVm@U‚Inm@IUK@UmKVmU_kVUwm@@VmL—K@VƒL™aUaVUUUmKƒ¥ULkšƒVWaXwWa@UXImWUaULUUWKk@WnXbWŽVWnk@UV@bU@@bƒJ@bƒV@XkŽmb™UU`VbkaWzƒ@klU@ƒb@VƒwUL@bV@U`ULVL@VUK@Xm@XWWIUbUxm@@lkkÇwƒVÛÇW@¯Å™UJ@xƒI™xƒ@@VULmKUnUxmKULUUm@@‚ULƒU™JkIWJ@b@LJUW„kJWnUV@nn˜Ü_nJšxU@VbšnUxlškb@lš@"],encodeOffsets:[[113682,28699]]}},{type:"Feature",id:"4303",properties:{name:"湘潭市",cp:[112.5439,27.7075],childNum:4},geometry:{type:"Polygon",coordinates:["@@Æ`n_VWnLVblKXL@VlbXxlaVb„U„VlUVJnInJ‚@VL@bUVVb@lnbn@lLVank@W@UlIVan@VanK@kVwlW@aX@Vn@bUJVn„a@K‚IX@@VV@nŽVÈl@VJn@VVL„K@UVm@UnIVm@UV@@blUUaV@XK„V@XW@XxƱ„bVxšLUa@™UKWk™@wmmUalk@WXUWkXUVJVaUImKƒVklJ@aX_mWULUUVUƒyXwWI@W@U@UXKWkXWVwU@±_U»ÝKUaƒLVbkJkƒWmXk@UVVŽmIUV™J@UU@UamLmwUVU@mnJ@VUnmV@b@Vm@kkWmXmKULUV@x„Ž@bWnVUbVblK@bVV@LUJknmKkLWa—±bUmULmWk@VLUV@bm@U°JUbVLX@@mlxkn@„WVƒKk„mK@k„"],encodeOffsets:[[114683,28576]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/jiang_su_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3209",properties:{name:"盐城市",cp:[120.2234,33.5577],childNum:8},geometry:{type:"Polygon",coordinates:["@@„n@‚°ĀÞ°@¦ULWKkx@bkLWb@lUlVXXJVbƒnUKmxXV@bm@@Xš‚„LޚܦXlVnš‚mzVJ@n@‚²ÞôkƃÞaȰĉ‚wnljÜó„éVÛnĊīČlj‚ĉ@ō@KÞUlU@ƒkklÇÈњÑlġXɛ@UġƒƒaU@U_ƒW@n™@kaUL@VW@kKmkUV@bkbWW@bkzma@ƒJWI@KUKULƒ@U¦™`@XUJ™U@KmXƒw¯KXkmy@aUIWJXXmV@K¯UU@@bVL@¤VLXbV@@JVXVK@„„JVn@bkKmakVVXUVVVlI@`U@nzVVƒb@¤n@@UlKXLVVšI@V@nV@V‚@ÈUx@šóVōšƒkÅWó@mU@bk@Ýwk@WbXxm@@J@zV@kVƒbV‚nLWVUX™WUXUŽWLUŽ@Wl°z@VkxU@UVWIxWJkbƒĬ„nW@@bUl"],encodeOffsets:[[122344,34504]]}},{type:"Feature",id:"3203",properties:{name:"徐州市",cp:[117.5208,34.3268],childNum:7},geometry:{type:"Polygon",coordinates:["@@XKVX@WnIVx@K°Lnll@@I°K„nVašU°x²mlxš@VanU@aƒk@akmV@@w™@Ua@aUwVwUw@w›@UK@£kaĉlóIÇVkŽ±@@kUKmVkIkxW@Ua¯UUm@UVI@WVI„JV@ƒ@Um@Uana„U@m‚I@J@XV@XaVlkXƒVaUUWLUyVIXmWak@ƒXkJókƒJUL@KWkk@ULU@Wa™lUIkJmI™mk„VbVš@lV°kXUKWKULU„mb@VUlVnƒb@VV@IVKUUmU@ak@@bmV@xklƒUƒU@UKmV@nƒJVbkXƒKUamLUJ¯UUVmI™bVV—Ll`@LƒLU`m@kXUVU@V„lxUK@xkIWbUKƒx@V‚kVVn™b¯@@U™@ƒxk‚mbkLÇK™b™@@XnJ@LmVklƒ@@XƒlUƒVkxƒakVVb@bVnUbU@@x˜VUšVb@š„ŽnIĊ`šXVVôJš_„K@xlU²Klk„U„@VaVVÈm@kVUVmnamUUaVƒXIVJ„@‚ç@¥nkVLn›„@@XVK@VUX@JVUV@UnVJVLUJVLUVlšnI„b‚KnU@m°™VanI@anV‚KVL„an„lK„blš„KÞk@¦@¤@„VKnLVK„L„KVzlWšLX@VmV@VbnU°@Ualk™˜WXLVU„KWkUUWšƒ@£Wa"],encodeOffsets:[[121005,35213]]}},{type:"Feature",id:"3206",properties:{name:"南通市",cp:[121.1023,32.1625],childNum:7},geometry:{type:"Polygon",coordinates:["@@VJ@bnzWl°L„xnW@LšVVI@Wš_V¥„@VKVL@LXJ„I‚@nbly@aXXla@aVUnllLX@@UVKlbš@@m„XV`V@„bĢ„lkČÇƃȘ¯šwnĕVĉVÿšUƒUĠƒŦğlXÑVǵ@±ōLʵĖ¯lÇbÝÞ¯xk@Çkķé™n¯@ğŽġƴǫ@kVVlUbƒL@xULǂóLUl¤@nkVV°VLkxVb@l™aUXUKWĖklVX@¤UšƒUkb"],encodeOffsets:[[123087,33385]]}},{type:"Feature",id:"3208",properties:{name:"淮安市",cp:[118.927,33.4039],childNum:5},geometry:{type:"Polygon",coordinates:["@@šnźUôÒɴ胚l¦nĖV‚kbmš„X@xVlVL@xUb@bUJVnUx‚šœ„lKVLÈx‚m„zXV@lW@XV‚b@bȚVxnb‚ƒVIXa°L„aÆVVaXUlK@aXIƄVlXKVUlIXalK@alwXLVK@¥Ý¯¯ÿ@ƒmVk@aX@ƒm„īlaXI‚wXJVUV@lw@U¯yb›UaƒUġUÅaUKVknaġm@kUm@wÆIV±nLÆw„ÇnUUkƒ@ƅÝU¯JÝI¯¦Ul@bƒ@@VVL@l@LƒLÅmƒL@b™@UaVaUWmLUKV¹KƒLWKX¥WI@mXk@UmaUVUU@VmL@W™bkIUWƒUmVóIkbmm™@UbVLUxmJkU@bkJWbnXU`Wz™KUÞÈlVb™Lmx@„kè@Æ"],encodeOffsets:[[121062,33975]]}},{type:"Feature",id:"3205",properties:{name:"苏州市",cp:[120.6519,31.3989],childNum:6},geometry:{type:"Polygon",coordinates:["@@ôèĊVnX°¤²„lxƒÈÜ@²x@J@b@X‚`nIUƙUUV@bl@VVnL@L@xƒJ@X@blJXnW@@`XbW„kVƒ@UbVxƒXUxkV@LóxVbUVWš²šVJĸklUǬ@ĢƳĠ°@šmƒī°»ÈÇ¥ULUU±a@bU@¯ƒU@KnImUVWUk™mXUVU@lIVaUUVWKUbUkWKU¥n£WakJUkUL›K¯L™KkƒVIn@VaUƒVUUƒ›UkVk@ƒU@amUkJƒ@UUlwX¥W@@UkVmk@JUakL›@kk¯ÝmJUn@nmVXlmbVVkn@„UJ@±WUxV¯a¯KōbżÇxUxƒšUUlWL"],encodeOffsets:[[122794,31917]]}},{type:"Feature",id:"3213",properties:{name:"宿迁市",cp:[118.5535,33.7775],childNum:4},geometry:{type:"Polygon",coordinates:["@@XbWnUJVzXKVVUbW„klUWbU@@W@IJ@nƒVmbVbn@@V@„UŽƒIUJ@XUJ@VVn°VVbX@lwlJnUVL@l²@lÈUôJĊklb@¤VLœ@@xVxUxVx@bVbš@@xU@ln„mnX˜mXLVmV@X@lxVnVJôL„LXa‚x@b„@@KVL@bn@@m@™@alLUUVaU¥nIV±‚I@mXI@aWWXU@LlUXWW_XWmaUwǙ@aaWUX@@kWUƒynÇwUKkL›ƒ™VwUmVI@aVa@wUKUk@wƒWn™laUmĕk¥„™ɳçóÑŹV™mmzkVmm@a@Ióƒk@@LWU@`—„WbXLWlkImJVn@`nXVbXŽmL@Vn@‚l@nUVl°Xx°U@LVĠ@z°˜@¦UV@Xn@VJmV"],encodeOffsets:[[121005,34560]]}},{type:"Feature",id:"3207",properties:{name:"连云港市",cp:[119.1248,34.552],childNum:5},geometry:{type:"Polygon",coordinates:["@@@‚lzXxmÆV„„@@¦„@l`XnlKšXXm‚KnLla„b„@„xmbm@kL@V@Vl@@VUXšJX„mbš@@„°Æ@èÈzlW°XĢJlÈ`lInbšWV_@mš™@UUķnƒôw°ÆmnaVƒVÛVmĸ»Ģw±Ý@@mUIny™UmWkۥݙƒK™@Wn@@aWUnwVL„mUaWIUWVk@kkJUVWLUkŃWJ@bkLWVUbÅUƒb¯KWbUJ„WXX`WXkV@KWVXX@bWJ@nJU²mJV¦UbVVkK@b@š@nm@@aUK@Lƒ@@awWbƒKóKUIUmkwW@U@UnWK—nmWƒn@b„l@bmVUb™@kw±n¯w™VUb"],encodeOffsets:[[121253,35264]]}},{type:"Feature",id:"3210",properties:{name:"扬州市",cp:[119.4653,32.8162],childNum:5},geometry:{type:"Polygon",coordinates:["@@VUXblVVV„b@xV@kz„V@l‚wVLUbVV@VU@VbUbl‚b@nkĶ°IÞV@Ɔ„VlmVƒÈÅxmKU²ÅJ@xVn@lĢnmbUlVLÆbĢV„V‚bœV‚aXk‚@VXKVVWšXVWXUmKU„aWaU@™¥@£XW‚UUV@@ynam_VWkUVUna@ÆV@mnkWmXkWU„W@k„@@akklƒlWUI@UnKl¥™I@VVma@a@I@U@a@anK@UmK@ÅVUnJl™kI@aVwka@mVIUW@UWL@WÅbmIƒƒULka™UWƒUxkLUKWlXL@VƒImƒÅVƒU™mĉL™Uól¯I±l@ÒUbVbUVVXUJUnVV@lnbl@"],encodeOffsets:[[121928,33244]]}},{type:"Feature",id:"3201",properties:{name:"南京市",cp:[118.8062,31.9208],childNum:3},geometry:{type:"Polygon",coordinates:["@@k@ma@kUUVmVIUWVUUaVa@Ѳk°Jôk@Wmk¯KmX¯aUakKƒƒWU„@XU‚LXaV@@mUaVUUl@VmkaUXm@ƒWUUna°IlmV™m™IUW‚@Uk@@aV@VVX@„V‚I°»nm„U@VKVan@m»UaU@U_@WlIUa™aVaUala@¯n@‚ƒkaUkUUWKU@mwkUUmmL@K@ƒLmUUVƒKƒVÅImU—JƒƒVkVVLšèVLVU@W„L„V„š@nVÜULVŽUL@bW@XbWbkJƒUUVUxVXmVk@WUUkVmIƒV@„nbnVWbƒJU„kUULƒa@Jma@XkK@VVL@L@JƒLUVU@V¼ƒnXlƒbm@kbUKmn@lVb@VXXV‚UV@b@LVbÆxXbl@@lV@U„VV@XVK²VlIš`„UbVbUlVVn@WXn@@VUV@„@KmbVLXқLkKƒV@nX@VVUV@b™nVllbšmnb„IWVXU@`lLlknVnmlLlbUmVInK°nUƒU@l@VU@Vn@„ƒ@alI„`VIXaVaVa"],encodeOffsets:[[121928,33244]]}},{type:"Feature",id:"3212",properties:{name:"泰州市",cp:[120.0586,32.5525],childNum:5},geometry:{type:"Polygon",coordinates:["@@lUU@@y@In@WwXal@Þxl@@anVô@ÆX„lŎ™ôU@™Vw@ÇUU@@m@U™JUUWKkL@Vm@@£„aUUmyV@@_kJUUVUUWlUnblL@aUmƒI@ƒULUW@IU@WaUK@£UK@aV@°V@LnUWWXIla„VV™@£UWlkXĕVLVWšb@kUalwUKU¯lU@mk£VôKȁVK@w„KVaUkķlUI±™ğ¥ÝUŹš™Ž¯ôm¦ƒĸ™‚@XXK@VVXUJ@nlbUx@blJkšmIUV@ÆnL@VmL@b@b@V@J@bnb‚U@UšJk¦mL@VVJkXk„ll@bƒ@@lƒXXVWlXnml@nÅU@ŽmbUVlVUXn`mb@zU@V‚VWX@¤š¦V@Xb"],encodeOffsets:[[122592,34015]]}},{type:"Feature",id:"3202",properties:{name:"无锡市",cp:[120.3442,31.5527],childNum:3},geometry:{type:"Polygon",coordinates:["@@nLƒÒlxUVkL™am@™ƒkVWUULUxVVVbUV@bVLU‚nnź™ÞVĠ¦X™VUUaôw@KlUVw„WUwVa„@lUXƒWa@_X@WmkI@a@W„I@w@KmKUUk@@aVUšVVÅmJ_@W@a@I±wÛ@ƑÇkw±ƒ¯£mWĉUóçƒK¯VkUWK@XkV¯UWabƒmUa™UUb™lln@b@xƒbXŽWX`@„VxUblL@bn@Vb@`m@XbWnn@l¤„n@xnVlU„™VLÆWœkV@VbÞJ‚_nƒl@nKVU@aU™U@mVk°WVLUV¯bVXŽ˜bXlVn@VmL@x—V@bl„š‚@œnW@X@VVJ@²VJVU"],encodeOffsets:[[123064,32513]]}},{type:"Feature",id:"3204",properties:{name:"常州市",cp:[119.4543,31.5582],childNum:3},geometry:{type:"Polygon",coordinates:["@@„L˜ŽnxUbVVƒL@xnnW‚nn@VVXn@‚yœImx„„°ƒšL„a‚¥n@VkšKVw„W@nX„VJ@b‚@UVn„ƒ@UnUV@L‚b@`VLklVÞn„Æ@VaXLl™ÈJšmmVUK@aVUUaUUVwVKXVlUš„n@šblKVUkw„ÑmKUVUI@±UI@U@WmX@›™kƒ@a˜U@wnK@UUmWk—aWU°aVUUK¯XUl@nVŽVš@bUVmLk@m„`ÝIUaU@›lÅXUKƒškVmU@wƒmk£m@XmWan@@_Uam@@akKVaUw@ƒW_XW„a@w@akmm@mL@UJmnUKƒ@@XnJWLkKUb@„Vxk„WƒL—aWVUImVULUK@L@lkLVVVllb„m@@°kbVbUbšbVbkJ@XV`V@Vbn¼"],encodeOffsets:[[122097,32389]]}},{type:"Feature",id:"3211",properties:{name:"镇江市",cp:[119.4763,31.9702],childNum:4},geometry:{type:"Polygon",coordinates:["@@šVĊKšn„VÆUn„„J@UWKXkVLlKVwX„šVlbVK„„nJÆaš„ķn¥°óÇIkšWKUbÅ@mƒUÝlkUK@_a@KVUVm„@mƒVU@@aUIWƒ@mƒXUx™LUlm@¦ƒb™K¯„ƒƒnw›Jzm@UW@UmmXmm@w„KUUVamw—ƒKm@UbUL@ŽƒVmn¯¼JƒUW@UUU@@bl@@VŽVXšJšnnU‚‚k¯JmbVV„Xn@VWlbUnk@VVUŽVb@nU@WbKWVƒ@XV„„lLVb°bnW°Lnl@X"],encodeOffsets:[[122097,32997]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/jiang_xi_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3607",properties:{name:"赣州市",cp:[115.2795,25.8124],childNum:18},geometry:{type:"Polygon",coordinates:["@@„`l@Èbln„@„KVLl@„V@bȎlnšKXkVlVL@„lJnb„¦VKVVnX„W@w°@VU„mln„UV`šU„bVUV@„xnKVI°KXKVkVL@al@Xa„LVlULWV™VVL@b„x@VXVmb@x@V™VV@nn¤„šlb°b°KXXWbX`lbXx‚z@x„`VIVUnK„L‚x„WXLVKVbVLVU@wnW°b„@nalX„‚mXVJn@U²mKkVl„U@@xlnœaVmlKnœ@JVLlŽnVššl@XXÆèVlUX@xVLXVšb°W@wnUWmXk@K‚LVwUmUkUKUw@wVaVK@kƒ@WnkUKWkwlmXL@KVUlLVKXmWU„L@ašL@malaVk@aa‚ašƒnXš@VVUblb„Jn˜ƒXa„V‚wn£„K@UWmUk@ƒUaWIV@b™JW@KmmU@aUUUkmKkVKlUU™nKVU„lVaV£Å¥WUUK@UkUUw@m@mIkƒƒUUWƒLƒK¯Uw°¯@wUKUbƒKmƒ@kkKUL@UUKV¥U@manw@k@U@Wm@@U@Wwkm„wWaUU@UUmV¯kwƒ@@kmƒkKkUW@UK@ÅV@XWWkXa@Ul@Va@KVaUUU@ƒaXwla@UkVWaXk@K@lmkUmV@Vmbk@ƒ»XIƒ¥VUkƒVUVU@anKVUƒKUalU@wX@˜™@a@K—@ÝwƒL@ŽUnÇlUIkJmn@ŽƒbVVb@VmnkLƒV¯U@ƒ±l—IWmƒ@kaUI@aÇU@K@KUIkbWbƒJUIUyƒX¯ƒUbU@méUUmUk„WK—xWIkJm@V¥U_UJUwmVkšƒUU@ƒƒƒ@knƒwm@UmkWJkL@n@VW@@‚U@knm@kUml@xÅxƒ@@XUJlb„@VX„JVxn@lbV„@lULnV@VlnV@bWV@bXL@lVLVb„V@blLn@Vl„K@xln@bX@lašLVbnKUVVb„KlXVVkxƒV@nnVUb‚lV@@z—°WWkbƒIk‚WL@LUJ@bUI@b™`@UmI@mkK¯XW™™mUV¯@UUVUUam@@VULWUJƒIm`IUJ›KUkW@Uxn‚WbnnmlXbmIUVmV@Vnb@V™LUKWLnÒVVV@V„UL@„kJUV@bƒÈ@ŽšV°šŽ@XVV@l@xUz"],encodeOffsets:[[116753,26596]]}},{type:"Feature",id:"3608",properties:{name:"吉安市",cp:[114.884,26.9659],childNum:12},geometry:{type:"Polygon",coordinates:["@@lxnb@V@bV@ln@‚n„‚lInš@blVXK‚nk¼@VUKWL@b™L@`UXU`ƒ@V¦XLĠ@lJ„¦@„nV@l°nn@‚mVXnaš@nb‚K„n@l„IVƒš@VanJ@_lKVVnš„L@L‚K@Vn@VbšUVanKlLnbnJVbšnWVnVVanI@‚Vb@L„bVKVanXVbVJVU@aXLll„bôlƼXxVLVK@Xn@ƒxnVVVmb@LnVVKVXV@@mnaVXUVnV˜K@_UaUmšwnKV_‚anKVLš»„K@¯ÝU@›™U@kWlUn™lknK‚VnaUkma@ƒUIUwl»Åw@ƒVwV@n™‚n@ÈXlKVmna@kVw@anm‚@n_WWk@™™mUkUK@Im›kLUn›bkm@wV@kƒlUnLV±m@UInWƒkWmbƒ@¯amX@xUVUKUaULWKƒXwƒKmLUVUJƒ_@wyWwkaW_XaWW¯L¯akaƒ™m£@mUUš@U@wnaWU@Uƒw@aUKšUXUVKUkƒKWbk@@bUKUlWL¯LUJmLƒwU@UVƒa™VU_ƒVkmƒnUV¯@@xƒXmWUUULƒ¥makI@ƒUKUkWl™LkmǍ@aƒUk@UKƒLƒ@kmÇak@ƒ_VlkL@`lbnšlLVanLnbmVÆln@škJlbknmKUbÝmmwULUK@bkLWKULUUma@Kk@UV@L@llbVzšxUxnl@bVLmŽšŽ@IVJXœVlƒLV`@bn²@J™@™V@Xmbñ@WbUJ@bm@@LUĬU‚„¦lV@xXb@blnUV"],encodeOffsets:[[116652,27608]]}},{type:"Feature",id:"3611",properties:{name:"上饶市",cp:[117.8613,28.7292],childNum:12},geometry:{type:"Polygon",coordinates:["@@„„@„V‚š„„I°`nm¤²@bVJUVVXUl@Vmb@xV@XbmVVœ@lkLmbn`VbnU‚@Va„UnbVllUXV„a@w°VW@_VWšLššnVlbšLVbnl„KšnVK@IUW@_@am@™‚ÑUólK@U@WU@VwU@UI@aUU‚aXƒƒ@kwmJV@yX@k‚anƒƒ@mkwVmmI@aUU@aUUW@kVkV@@anKš»„XVWnIVUl`@_„W@wlUœV@UWKnU‚bnŽ°InJl„UV@VnI‚b„Wn@VklL@l@Vn²m@U`kI@bWJƒnV@°VXnJm„XVmx@VVL@bkLmWULUmU@ƒbWXb@llnX@‚xkxVV„nVV@¤nL‚nVxnJVXX@˜ššbn`VI„b„@„blmlLnaV@„blWXnlUnbl@„ƒšKVanUVmm_XK@kWWnašU@UnaWUXa›ƒXamUkKmXUWƒLX¯WakKm™nUWwXa@KW_„aXWW_@WnIVl@XU‚LnWVknK@ImyUUÆbXK„Û@W@IÆUnƒVÝlkVK@mUIVwkUVaUm@aVIVyXIƒaÈwmmk@UnanVUmÅaó»lwšW@kkUVmUK@WKLƒUmWULkamK™Lk@Wa@wk@UU@U@mbUIWVKUXWmkUmVm›U@LkakKƒw@w@U™¯ƒ‚ƒUUn¯l@bmn@xkJWxkL@VkI@mƒkmJUI@V@b@VVxnbWlkÈkVƒLƒbkKmVƒL@V@²nxW‚kLUL@xlKVx„bXmVnšWJ@ޙ°@n™xUKUw±`UImVmnU@kalm@akwƒU@UUJmxU@@Uƒ@kU@Um@@Kn™ƒVm@k™KmkU@@WUnkLWxkVUwmKmLkU™bmKUbVŽ@xUnkJ@n±ŽšUxVXUšWJ@LUb™lUnm@ƒW@nknUJUVm@kXllknVbÆK„VVbš¼V„@šUl"],encodeOffsets:[[119194,29751]]}},{type:"Feature",id:"3604",properties:{name:"九江市",cp:[115.4224,29.3774],childNum:12},geometry:{type:"Polygon",coordinates:["@@WUkVUkmaƒVUb@mVUam_nalK@kU›nUWaU@@wna@UVkUWVUUI@a‚±n£m¯_ƒJ™ƒU@ƒƒƒĉ¦Ul@UV™Km™mLlm@ğ¹m`Uk¯@@UVK¯™@UUK@amkmKkVVUa@UkUƒKƒŽUa™L@VVXUJ™@ƒnƒ@™š™WUbƒnVb¯V@LÅlÝIƒJÅkݙm@Ua™WUU@UmUXmmwVUUKWUX±mUam@kWƒzUaVmÇw@aÅLmKXƒ‚UWKkL@W¯IƒwVw™lkUƒJ@Um@ÛÈWŽKUxWkƒaUU@KkLVl@„UKUX±KUb@nVVUbUVmaUlUL@„ƒaUL@‚@nUlWzX`@„V@lx²„@Vlb@bšVÞ@°nl@UxVL@lUbVV@n²xVUVmnUÞb‚a„J@IšV°xnbl@nbÆ@VwnK@VnXlK°xnUlVX„V@Vl@L@lk@W_XK@KƒkWxUL@J„nVx@aX@VVUa˜IXlmL@bVVX@VbnK‚a²XVWƒk°a„@UnV¤nbmLmW@XbmJUbVL„aÞK„L@K@U@aVKlbV@nXlJœxV@VnšŽVȚ„ÞKôbźĕČmV@ĊšŽ²xÆIšV@Þ¦ĸ¼ÞVlŽVÞnxln°Jœk‚LXWVUVUVwnJVI@yn@lXlaXmWI@w—»ma@UmK@akKkXmW@_kaWakKWk@@K@IšWƒkUa„ƒ"],encodeOffsets:[[119487,30319]]}},{type:"Feature",id:"3610",properties:{name:"抚州市",cp:[116.4441,27.4933],childNum:11},geometry:{type:"Polygon",coordinates:["@@°V°UnÜ@n@lnLlV@bšV°L„lnLllVzVVXlV„V@@L@xX@WlX„m@UVƒL@V@n„°škVmVUnKlaXxVbšnlU@lVVnaVI@aX@V„šJš@V„@b„b@šVbš‚@X@lUL@Ž@VlIVm@wUVanLšalVnKnLVxlUXwlKVm@k@Una@mWIXKWUÛVƒk@a@UVWn@@kl@@W„XlW@_Um@UVK@a„LnalInWV@@xnI@¥‚K„—šm@kKmƒnk@mlI„¤laXbVblknV@U‚KXVlUXa‚@@Unw@±mU@ak_±a@ƒUJUIƒVKW_Xa@aWU™šK@mmUVa@IXa@UWmšannlmX¯WKXwVUVwƒ@XUlK@klJXa@kƒkmm@Uwƒw@¯ƒW¯kw@WmbULƒaUUU@mVUU™WmkUb™KmkkK@aƒkUƒ¯¥Uƒl—ƒm@akU@mš@KVIVV@KUkUVUkaƒUWb—„mƒIkaVaUU™@mW™„b‚b@bUlkb‚b@n™K@bƒKXVWnULkKUV@LWKknlxXŽVLml@X„Ž@lULUb@xVxVLVlVnUxK@LWlXnmV@x¯X™aWUUK@wVWUkÅçm`@mn@bUx@lmbUnkLÇWm@mšU@Ux@„Æxk¼VxVJ@„nbVlmbUmLklmškVlX@‚VœšV@°Þ"],encodeOffsets:[[118508,28396]]}},{type:"Feature",id:"3609",properties:{name:"宜春市",cp:[115.0159,28.3228],childNum:10},geometry:{type:"Polygon",coordinates:["@@@VlbnK@b@JšLlUnx±ĀXxÆW„X@lš@V„@@blJ@nX@˜xUbVVUbVV@b—VmnmJœ„@bmbm@klUbƒLmbœš@lVb@xUX@bVVVbV¤@LVV„bXlVw‚LXÜÇn@@V„IlVškUx„x°J@XlKXLV„‚WnLÆK@bÈxUnVb„ylXn@Vbn‚W²XV‚LVVUŽnxWnnV@VVVšXVbn@ޚÆl„IÞJÆk@K°UUa„mVa@UUUš»@wV@VƒkkUKUVW£U@UmW@@aXkVUnVlKVV„UUkVmU™@kWaUanU„VVamIX¥W@@aUaUVW@_mW@UnIVVn@VbVm@bVL@anKVUkƒWK„UXV‚Ikx‚@na„bVK„b@nVJ„_V›@Vw„‚VUVVXUlUUaV@X@VblašbnKlkVaXaƒ¯@m@U„KVUn@WƒXkW@@w@KU@UƒWkUUUykkmKƒk¯K™U@akUmK@k@mmÛ¯V¯U@‚ƒL™¼UKmLbU`mL™xVnVb@`—LmUVUUWmb@nU@UWULmU@KnaUUmU„wmJ¯IUJWIkVkaWVUIUlWaUIUVkKmbUIƒÒlVUnnŽ@VlLUJ@bUX¯@ƒaWVUKUXƒKUbm@UwKWa@a@VkUWn™@Uak@mbX„WJXbm@mL—aWVk@™wƒL@WmanU@knwWmkaWL—KWUXaƒU@¥l„UVVVbnwƒ¥nKV™»@aUk@a@UƒJ@kƒmLma™@mbUWnm@ULǺ@LXnmxUŽm@UbkbW@@akLmWk@UXmJmUkV@VUXVlULmKUxkL@lmXnJ@X‚l°Vnb@bU@WbKUX@VmKUX"],encodeOffsets:[[116652,28666]]}},{type:"Feature",id:"3601",properties:{name:"南昌市",cp:[116.0046,28.6633],childNum:6},geometry:{type:"Polygon",coordinates:["@@šXš™„@„mš@VIUW@UšKVb„„LlV@VVbUŽlUnLnl@bVL@V°šUL@V°@Vln_Ġºn@‚knKnššLVU@VkĊ¥Vk@™Uƒ™»UaƒUÅLUalmkklWn@VUVIlm@m„Xn@VmškVa@KXIV™UWVw‚™²@m@U@VK@k@W™Ua@™ƒa@aUƒ™@™IUƒW@@bUJmbUU@kkV™mUaWwkbmLUVUn™lWbUbklmL™akbUaW@U@VbkVWVUUUVƒUx@‚Uœƒ`UI@mƒaULƒamb@lwJWUƒVXLl„UVmL@bUK@aUnUam@UUmJ@VnX@`UXVŽVb@bX@W¦nJUbƒUmVVbXb@lVšUnVlƒVUUkLmUUVWl@bX@VnV@X¤VUVLllU„U@@x™¼VV@V"],encodeOffsets:[[118249,29700]]}},{type:"Feature",id:"3602",properties:{name:"景德镇市",cp:[117.334,29.3225],childNum:3},geometry:{type:"Polygon",coordinates:["@@VVX@Vbmz„xUlU@mbmL@V²xVbUVVblbX@šVškVykValKVI@bn@n`lVWnX@l„L@™WKnƒVIVa@¯nK@alIXJVIVWUw‚ƒn@nU˜„nK@alI@a@anKm_™a—™W@UWmIUwmmK@£UUƒmUUlwwW@km@kWaX„aV@VnVKnXlK@aUK@UnwWUnƒmIUW@¯mU„XI@alJV_n@m±@U@kkKUlm@ƒXamJ@UVUkƒmI¯JmamVXL@V›UkV@xƒX@`k_UVmJUXƒW™¼mL@bU@UllX@VV@bVV@bnJUnlx@n„Žm„b@lWŽ@zU‚nIlx„@W„bVV@bVJV@UxV@@X@VkLVôÒ‚šn@@b@`VX@J"],encodeOffsets:[[119903,30409]]}},{type:"Feature",id:"3603",properties:{name:"萍乡市",cp:[113.9282,27.4823],childNum:4},geometry:{type:"Polygon",coordinates:["@@VWnL@UVW‚LXaV@@ama¯Uk@WmInW@klKVwnLVKUkVW@UlUnVnIVWl@nXlK@bX@laVan@VnwWm@KȹVK¯m@kmU@ƒƒ¥kIğ@WKU¥„@V_VW@_šK@aXKVL@Ul»mWLkU@am™kJƒm@kmU@@a@UmakwU@›„Xlƒ@VXk`UIW¼kWWX@‚œ@l‚xV¦XlW@Ubn„@ŽmUkL@UmJ¯UkUWVUaƒUlm@UXWl„nUJ@LmLU˜nXll@bUVUUmVUn„Ž@¦šxlŽnn@VÆÈU°kbV„VxllnL@VnVVUl@V„„anL"],encodeOffsets:[[116652,28666]]}},{type:"Feature",id:"3606",properties:{name:"鹰潭市",cp:[117.0813,28.2349],childNum:3},geometry:{type:"Polygon",coordinates:["@@@XV@nlšL@lUnš„mŽ@Ln@@VlV„@@VV@nwVI@V„Vlx@bknlbV@nmnUVJ‚_²‚VxVLšw@mš¯@ÝXIm™nUWƒaUwkL@wVKlKXmw@±@U„KnUlL„a„KlUlÇXkmaUw@U@a@Uƒ™UkwUJ@zWJ™w@WbkVWUL@VmUklUaWakbƒ£kJ@nmln„lL@Ž™nƒ˜L@¦mJ@wU@mXkJmbƒK@bUL@VVn@`kXƒW@Xk@@lm@UX@V@b„lÜUXVWLXJ@nmb@V@l"],encodeOffsets:[[119599,29025]]}},{type:"Feature",id:"3605",properties:{name:"新余市",cp:[114.95,27.8174],childNum:2},geometry:{type:"Polygon",coordinates:["@@m@@WULUKWwÅ»ókƒakkWK@bUVUIUamWUbULƒa@KUa@mJUbmUXU™mUamImakKmLUb™VUam@@UL@KƒKm™UUkL@`mIUb™@U„@V@bVl@bš¼UŽmL„¦mxUaUUƒVkŽ@¦„VWbXV˜LXKlbXnmx@lmVnb@X„Kšxl@XU˜bnKn@WaXIWƒnal@Vbš@XmlV@U@bXb‚LVxn@Va„LVWVLXU„b°@VW@aVIkK@UmVmkU„ÑVJnalLVUVJXbVkVJXUlblUXJVI°JnI"],encodeOffsets:[[118182,28542]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/ji_lin_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"2224",properties:{name:"延边朝鲜族自治州",cp:[129.397,43.2587],childNum:8},geometry:{type:"Polygon",coordinates:["@@Wxĵ„mš@„ó¤VX@@xܼƨš²xWxƒV„V@„XVƒ„„„ƒbWšXllaÞU°Ċ„@ô¼„LôÝWanV¥ƒÑnĉ°¥šÅX¥°¯@w°w@»°k£°mÈŹ‚mÈbƃŎ¦„K°z@Žkxl¦UbU¤šššklV„KŤÞȰ@@bšV@nVVUlÞ¦lUllœVlU°ÑU¯Vƒ°w„bXxl@VŽ²„˜@n„ô¼ƒó°™kmVk²ĕ‚w@wV™ÞÞ@@Ġƒö»˜¯œ@‚„šbnb°mÞ¯°V°„ÈJmX¥mam™UřƒUƒlaU¯™ƒ@w™Kk—l±n@@wƒkÝVUUl±¯I¯b™a™lƒ@™kLmakbƒ@ġƒŹé°™Þb°šékƒƒLm™„wX™‚aÅb@bVlƒbVb—ÒVbUb›UUanwƒakbVŽUV›ak„¯„UŽƒLmxV°UxnôŻX@J„Xkl‚bkbĉaƒbƒWU„ƒ@ƒk„WUU¯@@klmƒ@@™Å@aƒwWXlKkI@WbUaVIUanUƒƒ@ĕƒ¯K™„mUnWUwm@£ċèkUmbUmm@@nkJUalwk@@nmWUan_óaWmnw±KœIƒwl@UmƒI@an@@mlUÅmV_™KUkƒ@U`@_ƒKUmU™@U¯™mmb¯@kb™ImV¯ƒƒLkbƒKƒƒÛ@ÇnɱJóaÝĢkb@„›x—ÒÇllœ@‚Ž²V‚„ÆUVV„UÇ°X„óxlV¯„lV@bƒV@n—x›@—¤@„șŎnxV¼knšJ‚nšKX°˜¦UlnVbUbÆVnÞWVX¦llšb@l°œVJôÒnLVbšbXŽ"],encodeOffsets:[[131086,44798]]}},{type:"Feature",id:"2202",properties:{name:"吉林市",cp:[126.8372,43.6047],childNum:6},geometry:{type:"Polygon",coordinates:["@@ôl‚zšaÈV°„šK@„mŽ—LWl™nšVxUV‚È@ŽÝĬUÈn‚ôLša‚„²VmĀkV@„ĠĊnU@b„V@b˜@nl°UVnÞaôJ@bš™V„¦mlkššbmVXx¯@Vxm„nbƒ„šbÈK‚V@bÈL„wĠyônšmnbÜ@nn„V˜x@n²K‚„„J@k„al@nxÞU„Lź±Vwkw¯LWWUš™kŎīVwƒw„°y„Vĕ°wÈVlkÛ»@wW@Uô£@ƒn™ĶƒXwW™aUamKóÑUI¯›@k™akkW¥XUmÝÅUVaUa‚mVk—¥W¯™Lm™IlmU»mwȚō@ƒ˜£kJUÇk@am¯y¯UVwƒa@wġx¦ƒKƒƒ¯X°Ċ¯¦U°ċWULÅa±b¯@UkÅWmVƒ™ƒkIUlóŽċ¹™`óIƒlX„WŽXxmbUƒLݏƒbƧ@ƒx¯bƒÈ—l@xƒš¯zƒaݤ@nšm„VWb²bmn¯J¯Ò@n„š"],encodeOffsets:[[128701,44303]]}},{type:"Feature",id:"2208",properties:{name:"白城市",cp:[123.0029,45.2637],childNum:5},geometry:{type:"Polygon",coordinates:["@@ó™ǩŁ@WlwUaƑwÛÅÇéĉamKƒōÇ@Iƒ™ôġVƒȁÑŹçƒ™ÝUƧċĉwóóÝ@Ƒ»ğL¯ll²@ƆÅV@¦m‚Åb@nmlU²VxšlUn™@VbnW„bÇbk҃š„n@èlnlšU҄Ž°Lšx@¼ĉb@҄šUŽċxՃènLVxƒÒƒbÅJ±a@_ÅJÅnƒŽVb„Kl„nUÜĊ@„Uš™xXVÆn„mšVššJÞ¯V™ĠwšƒXw°xWL„x„KV¦ôU„wVÝǬóÞޙ¼‚‚„ÞkŽVôȘxބU„lVn¦ÞšĊa°w„b°@šbÆw„lŤL²`„z°@V@@™nJVnl@@¥nUmmn„@mwnmmUnk@mlwUaƒLnƒ›wn¯°anƒWakI„ƒÇmXwÆamUXUlJXa‚UUklKUknmÞV@‚K@VWÞ@VkUwVƒ"],encodeOffsets:[[127350,46553]]}},{type:"Feature",id:"2207",properties:{name:"松原市",cp:[124.0906,44.7198],childNum:5},geometry:{type:"Polygon",coordinates:["@@„šźèȂÒU„óĢ„š@JŎȄ‚‚LnŽĊbÈêÜƃxVbkx@XǪłôš„kÞ`„šW„b@n°ašbšKšnVw°`š_X`W„š¦„ĊIkmVšakw‚K„x°UÞb„U@lšƒl@°¦œVW„šaÞbšxÞI@mVI@ƒVkŚUWK„¥nL‚a@ƒ„@ȍ„@°ƒÆ@nU@KÞalkUwVékUWw„™kU›VkkƒJk¯@»ókƒV¯ÆÇI@bĉô¯@™ķw¯nmmÅL¯wƒVƒUÞy@UówÇLkmm@@UóxkkĉmL¯wVwkWWX™mLõm@kűV_ƒƒô»ÛƒÆ¯@™Va™VšaĠVlmğwķUóÝƽ£ÇJkbǫaƽLW@nxݤkzƒy¯XɅm@VšôÇX¯Ė¯ºÝnUŽnLVlUÔmV"],encodeOffsets:[[126068,45580]]}},{type:"Feature",id:"2201",properties:{name:"长春市",cp:[125.8154,44.2584],childNum:5},geometry:{type:"Polygon",coordinates:["@@„U°xÆKnn°mĸxš°@Ċó@aÈJ°Å„Uôl@¼l°„IllœUlVƒšXxlVUêVxkllnÈUVll@Vx²IÞ¤VUlVnIôlރlwô_„›„bVaĶLXÅÞÇ@K˜¯@wÛaƒçn¥š¯WXyW¯XwƒUmmÛ@ma™nómğzƒxÇK@aUÇL™a„ƒmanƒUw°@WwnU™al™nkƒ¥šU™@aóIÝbUm¯Vmk—@@aƒU@amVğĉ@ƒlUnÿ±Uƒ™bóKmVÇÞī@ÇVUUw‚™šmXk˜Kn@ƒ™L¯ƒÇU™byókōè@b‚n@lÝX@x¯ô@ƙUV_maXm@aóƒJWxnX@ŽVVnĖVnUJ@nōÆǼV¼kxƒLklÝw@xƒx@zV`ÅbmxU±xU„nnm‚kn‚ŽğU™bUŽ‚šUb@šÅ°Ü„󼄄U`Ʋ@lön‚KšnXWlXUx°xnKĊllôw@Vn@lnÈKôx@VÝz„V"],encodeOffsets:[[128262,45940]]}},{type:"Feature",id:"2206",properties:{name:"白山市",cp:[127.2217,42.0941],childNum:5},geometry:{type:"Polygon",coordinates:["@@Ušl¦kÒÆ°„IlÒU¤ôz„¼lJš„U„n‚ÆXVl°@²aÆbVKČXV¯°¥¯ĉ°W„„„L‚¥Ģw@x„bUx°V°zn‚‚b@ÈlVŽlIœ@˜w@m„U@akU°ƒkUôwWƒÈ¯VUƒVUƒÅ±U›@kÈk˜Ñœw@ƒlaÞġƒUÞ£@ƅ‚KnÑĢ¯@W‚aUaVUVkkw@a¯@¯™Ý™ƒVXnW@@WkXmK@xkKUb@bW@Uw¯„mmb@WKUbmUbUaWbƒJĉIVW@I—l±LkšmU™bUm™@ƒnkKWa¯n™@„`Ubma™„ĉL@bƚ—@W`ƒL@n¯‚Xb‚@kb@x™Lƒ„™@V‚kL±™™mlUIU¥mL@lÅx@_laƒƒ@U—aƒV@kmmƒK„£ƒƒLƒƒmKUnÅKVbmXVlèĉUUbml„ĢŤƒIlŽ¯bǦœl‚@ô¼Ģ„@x°„l¤„n„a„l@x™b"],encodeOffsets:[[129567,43262]]}},{type:"Feature",id:"2205",properties:{name:"通化市",cp:[125.9583,41.8579],childNum:7},geometry:{type:"Polygon",coordinates:["@@ÆlXnĠxĢ°lÈ°š„K„°kXm‚@¦Vbk„ŤJšnݤk„VÞVVkȄb°y„™@w˜k„Ç°a„wƨ@„aސ„K‚VnaWwXWƒ„kôJš_ČºôVkƒ»óyV£kуJůlÑk¥V™ša@wƒkƒbƒmk£¯ƒ@wġƒó»@›kÈ¥°ak„JÆ£ƒġnkVaĊVkçWUnUaÆLVmnL„„‚KU™±@—„m@a¯U„bmV¯m@_ƒK™™U™ƒaƒÅ™Wó¹ƒ@UanmWak@@wmI@y™@mk„JVa™@UaƒIkJ@n™@Um±kkxƒm™Ik„ƒbÇm@Ž°bXn„V@Ž°ÈmlÞ¼¯XVº¯Lm„kWWXLmVVlknƒ@@lnWƙ„Vxbmšnšm„¯lÝaVȁè@¼V„„b™„ÆŽ°ÞUVšJ„„kx›I—xƒƒƒIV¤™ÒXxmn"],encodeOffsets:[[128273,43330]]}},{type:"Feature",id:"2203",properties:{name:"四平市",cp:[124.541,43.4894],childNum:5},geometry:{type:"Polygon",coordinates:["@@Ɇn°W„zlyÞ£mwX@ƾKǬblaÈIƾ¤ôÞĸVĠxnmmVƒ²w‚VnwÆaU_@y„w@wÞxlk„KlwU»È»ŎÅ@mVIUmmĕUU@mWXw„Iô‚@bWnnbU`‚šV@Å°ó@wÞW@km@aŎ烙@m°Ñ°Inm±aXaƒU™n@mƑšU¦@šÇŽ¯aU£šaU™ġ¦ÅҙJōUŻókUÇ@™¥¯ak¯mUVak@@aċçÅaUƒm¦Ý`XbƄ@n`ƒI™xĊÞōÞml@šUb@Wl™_¯JkšÇUÝÆÅb@n™„llUb¯„±a@ƒ—ƒWĉJġĀ¯™Unóšm¤œxôaVnƒxôI@x„V@bmƙ„@lnLmޯޙxVb¯þ"],encodeOffsets:[[126293,45124]]}},{type:"Feature",id:"2204",properties:{name:"辽源市",cp:[125.343,42.7643],childNum:3},geometry:{type:"Polygon",coordinates:["@@żôŎVšIÆÑĢ¥Vš™bV¤°bȍ@™V¥ƒ™Þ£lÇUUUÝlƒÞ£™mţIlƒUa@¥nlWƒ¯ƒL¯™kÇġ¯ğwWmÅk¯UƒVU„„bWlXlmnƒbUx¯xVVknlŽUbV„ÇKUb@„™VnbmlnzUº±bmJUbWÈnèm҄š@X`WL"],encodeOffsets:[[127879,44168]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/liao_ning_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"2102",properties:{name:"大连市",cp:[122.2229,39.4409],childNum:5},geometry:{type:"Polygon",coordinates:["@@‚IÞmVk@wXWÜbnwlLnU„@‚nLlbXW@a‚wnbl@XL‚aš@Ċ¥@LULnJ@xVnmV@VXXV@VJkn@VÜKXXôJlb„xl@„IVbnJVLUbn‚lnVw„JVU@ƒXU‚aUUlwn@°ƒn„VKnV°_VJšwl@nwlV„IXWlIVVnK@IWmkIVaVU@WÈUlmU@U„WUalkXġŻ@kIƒ»mm™akUm›ĉUŁV»²ġVĕ@aUU؍IɃ`ȃ@kƒw@ƒUƒmwĉ™@ƒWķсIĉÇbÝLkymbIƒwÇmÛbmbU„¯ÜõÈkÆVbŎxnXVÆnšǪ¦„bš¤Uš™xÝnĉÒmĊVȄ¤Èš„bƼ„Ā„„ÆÆބźb„VVbX„‚°²¤"],encodeOffsets:[[124786,41102]]}},{type:"Feature",id:"2113",properties:{name:"朝阳市",cp:[120.0696,41.4899],childNum:6},geometry:{type:"Polygon",coordinates:["@@na@UVI@m„ÑW™kaV¥UI@wl@„aÈbšm@wVašk„@@K@kƒ™@a@UUmƒUUalmU@KÇUű¯@±kUKVkUaƒaU@¥m@@¯k@WLUmkn@mmIkm@amU@wVmkU@Klk@U—m˜aXIWWUL™aULVbƒmk@UUmUk±™_Uym@mbkImaX¯WW™xWKzU@WƒkJWwkV™@Um@UbVVVVXb@VWX—@WŽ@Vkb@V™nUK±aUUlwX™ÇWKknU@mmUkƒLUVƒVUUVƒUaƒw™bkKmwnIƒ™kJ@nmbƒ`kmVkLWwUm@UUU™K@UmaUa@UUaWK@mUƒ¯Wkk¯VmUUŽ„xVXUVmL¯ymXkWUbmXUKƒVknWx¯JVnkLƒl@VVxnxlĀVL²WlX„l@bÝVUn@bnlÜaXblIVl@šš@Ȧ@VmbXV‚@@x„VVnUn@`°@VnXU@K@„VV@VmbnVn@ln@b„xƒ°Ub@bšLV`Ånƒ„W@@lUšnnWVU@Vbkl@Xl`XxV„UblŽkX@Ž°¦V„UVVbUlkV›@UbVbkLUxmJkXšš@b‚bœxVKÆlXX˜bnŽnala@ƒUk@U„VVklKVUXKVU°KVan@VUnLšKVL„WVaU_@mmUXa@m˜wXwVkVWXk‚k@›„k@klm@wXKl@U@KVUUUVaUƒV@„alL„xUx@b°°VnnVšxlIXJmx„LUVlV@bnX@Všb„aVx‚@XJ@b‚n@VŽVXȄl@llX@lU„Vô°°@ބVbn@‚V„k„@VW"],encodeOffsets:[[123919,43262]]}},{type:"Feature",id:"2106",properties:{name:"丹东市",cp:[124.541,40.4242],childNum:4},geometry:{type:"Polygon",coordinates:["@@lzXJ‚U@š²x‚@@Vš„@bUVmKUn„°n@lnVK„„nV@n@VlV„°WbXn@‚VzƒJ@¦@bkb‚bUl@bkbƒJ¯zƒWULWbklV„nb™¦VJ@„„K°U„kl@@W„bVn°@„Všm²U˜nX`„UÜLXmVXlKVbUVVnUbn˜ƒX@VUL@lUbWxš@²kl`n@Vlb„@nUVWVLVU@aV@²bl@ÈmšxWX„VÈU„JV„l@„„la„WnX‚KÈkÈ@Va°bÆm„@XV°IVV°UnalƒVUn@UwVU„@@VVJ„I@bl@XK@wWmXU‚UVbkJVXnJVI@mƒknwlKXL@`l@VI@UUaVKÞn„aVm@aÇ£XW„U@aÇUU@mbkKm£™@WW™ƒL@@Kk@kl›U—bWKUkUU¯UõÛƒmUUaVU„U@WU_W@kVkJƒ_WKkV@bUL™¯¯ƒ±mk¯ġƒğÑ@UmwƒKUakƒ™ƒa@a„m¥ÝƒIUWmk@w™mţ—L›KʝbȗKWĢklVbƒX@VV‚knÇV@XUVUblJXn@J"],encodeOffsets:[[126372,40967]]}},{type:"Feature",id:"2112",properties:{name:"铁岭市",cp:[124.2773,42.7423],childNum:7},geometry:{type:"Polygon",coordinates:["@@XJm@¯šmXUlnVbUJƒU@bV@UJWL@VXLmJVbkXlJXxVL@b@V@n@b@`Vbk@lxknV@VV™V@bUL@bV@@bVK@VXLWLXJ@LV@nbWJ@IUV„x@LVJUXVxVx@VV@@LXJWL@VU@@L@VnL@bVVmVX@@VVInJmbnLWVnVULVVU@VVmX@@JVz‚l@„nVVKVXރ@mk_lm„UUWV_nJlUÞÑÞVVUVƒVL„UVJ@I„Vna‚@@KV@XwWknwnKlalU„w„aĉݚwšJl_@aUaƒKUUU@WU@WXUÆ@@UVK@n@UnVVšblK@bœllb@b„bW@Xbl@UlnLl°°bš¦nKlVnI„V@UWU@WXkƒw@am@nm@aVw@I@KUaVIm±XÑlknJVnVJšaX_VaUaVKmwnkmmn@lU@U@mnašXlKUmUIVmklaUK@UlUVUW@U™kVm™a@UUU@JmUU@@bmb—KWV¯XUKm@ka@UVKVk@aUKmLkKUUÝUmbXbÇJ@k@WU_@m™™@klm@UXKVaUI@KWUXaƒÇWk™aWUkWUL±U@lUU@ƒUJƒI@V¯JmIm@@aU@Uwƒa™@UV@VkI›V¯aUkƒWkb@bVL„@@VVVUXW@Uaƒ@@b—‚ÝbUV݄@ŽƒLmUkVUbVllLUV@LššXŽWbUXm@U`@„kxlnnJlbnIllšLX„lVlUXmVK„n‚V@L"],encodeOffsets:[[126720,43572]]}},{type:"Feature",id:"2101",properties:{name:"沈阳市",cp:[123.1238,42.1216],childNum:5},geometry:{type:"Polygon",coordinates:["@@ȚĊÜ°„b„L‚lÞxUbUn±‚@ÈnVÆL@xnLšlUVƒbƒxkImJkn@V±LUxkV@bšbšKVKnzVl@L°@Va„xÞUlbôxVVœ@@V±bnŽ@llXL˜ŽöXĶŽnal@nkVJVI@aU@@aVK@ašUUUU@lmkwl@Ua@_@a@m@U@aUKWwkIlWUanIWK@UXKVIU@@a„VVIUa‚mVknW°™n@WI@KUƒmULWnkVkUWƒ™KkkmJkamIkmlw@ƒV_n@VWXaW™™@KVUkKUkValUnV„K@ÞƒVUÞa˜@a„@VbX@VWUU@Uƒ@UK@ala@IkKmUUa@U@ƒVƒkk™WVwU_@KÜUXbl@V¥XUVmƒƒƒXa‚kŃlUUkIm`UIUJW@UIKmkm@UUJƒImmU@ƒVUXU`mIUbUK@LƒJUU™l@Xƒ@UbƒJ™kU@ƒŽn„m@Uam@@ƒ™aUmLKƒwƒ™mWXUK@kUaÇa@JUIUa@aƒKVUƒUXmƒUy™_@lmbkLUKWLX`‚n@bVL@JXL„‚WX@Vnb@Vm@UbnVmL@V@x@LUbVV@V@LƒUVl@mb¯U@xU@UVVV@X@VVblJ@bn„VKUn„x@llnL±¤™b@k`VXÆK@„kV@¼kl@bWIUl@VmLnbm@@JXXmb"],encodeOffsets:[[125359,43139]]}},{type:"Feature",id:"2104",properties:{name:"抚顺市",cp:[124.585,41.8579],childNum:4},geometry:{type:"Polygon",coordinates:["@@„XVl°bœUlJ@UVUš@„bVxV@@bn@nJ°I@U„J‚I„VV@V@k²VVKlXXVšb‚lÈX„ŽWbXV@LVJUbWL@Vkn@lšš@nV`@X@lÈIWanaÞVVVlLnKVL@bUlUL@Vlbn@VL°WXU˜Lna@aV@nV@IVV@VšbUnšl@V‚XnKVa@U„UnyWkXaƒaVk@ašašbnm@_WKXmWanU@alaU—l@XJVLVxX@˜wnKnVlwƒƒ™@V_@a¯¥@UkKWUaUU‚anK@IƒaU@WUaVw@klUVyUUVUUÇ@Iôbša@mnUma@kXa@UWak@Wa—l@a›@WUƒLmU@U`mIUU™`mUk@@UUK±nkJƒbUam@kwm@@a@UU@Ua@@K@ƒVK@kmKU_UKƒUUaĉWmkkL@`™LƒnmlkLkbmK@k™@Ulmb@b™„@Ž„xUVƒIUlmVXXƒxm@™JUUk@WUk@ƒakx±@¯x¯Umb™KUUVmUU¯UmVVn™WkÆ„lWb„„„ŽUnWVU¦k@WaÛV@LV`UxšXllU„@„@VVbnVlL@J"],encodeOffsets:[[126754,42992]]}},{type:"Feature",id:"2114",properties:{name:"葫芦岛市",cp:[120.1575,40.578],childNum:4},geometry:{type:"Polygon",coordinates:["@@ll°X„ŽnV‚@XLVb@VVbnb@VšLVV@VVnXxlKnU‚l„_na@mlI„šmJnxlLša„xVbU„VV„UVU„KVlnnV@lmXLšÈWŽkxVV²bVLšm@Ula@UX˜@XW@UWaUUUUVan@V‚š@lUXxlIX„V@‚yXLšw‚ŽXXW°nblJnan@Vzš`l²nVVVl@„nUaVKšbVKnXVaUaVUšyšnXK@kVK‚@X@m@m‚LXa„LWƒU¯„w@™ƒa@UVw„¥°™ó¯¯y¯ƒUǯ»›w¯Iƒm—¯Ç™UUl™¯»ţKċÑţķm¯w@mU_ómk¼VnU`±IkbVlƒnnŽU¼±Lk`@X™Wl¦UbmVUxkXVlkbllU„Vb@bkVmx@XVV@Jb±aULkKWXkWmX¯aUJmIkVm@ƒxU@n„"],encodeOffsets:[[122097,41575]]}},{type:"Feature",id:"2109",properties:{name:"阜新市",cp:[122.0032,42.2699],childNum:4},geometry:{type:"Polygon",coordinates:["@@šXnb°lš„VlnXVJ„LlVnl@zÆxnK@b„blKVLn@@V„aVLVK@L@Vl@XVVInVVKVwlUXwlKšL„ššVVb@aV@X„lUXbVW@n„lWnXKV@@V@XUVVLUVV@@bVVV@@ln@VbVUXV‚I„xVanJ@UšIVWšL@UV@@¤V@nInw˜W„k„lnIVx‚lnzUVÇJ¦VVÜLĸUnW@aV_šWĊXXa‚Knkl@nm™L™a@alUVw²K@UlmnIlJ„w„aVU™kmK@wÅKmU@DzVmVaÝwkƒKƒaÛ¯șĉķ¥ğ¥ƒ@kUWkƏī݃ƒ@@akU„K@KWIUm¯nƒU¯JmwUVmIkJÇLm@™UImJUU@aW@U@@nUb™JƒaƒbXVWn@UVmX@V@b„š@l@Lƒ@™lUb@x™nÇaƒbk@@xVJU¦lbXšƒÒ@nUJ@Vmb"],encodeOffsets:[[123919,43262]]}},{type:"Feature",id:"2107",properties:{name:"锦州市",cp:[121.6626,41.4294],childNum:5},geometry:{type:"Polygon",coordinates:["@@nJ@nlmVnXKl@@°n@@¦‚V„bVbUlVL²l°@ƲÈV@LV‚knVb„VVnnWVU‚@XmWU„a„bšIVa@mV@X@@bVVnIVJ@š‚nÈKlInJVUnx°I„V°mVnXJ@LƒLlV@b„@ބƐĬXllV„@Ġ¦ĸ¦naWW@In@manK@UVkXJ@alk@»lU@ƒÅLUWl_@ša²£‚Kkm@kƒwVmULmƒ@akIUa@U@WUUVU™aÝ@ğ›wkƒƒmĉ£UWƒ@@bÇL@m—a@_mKƒlƒXUwKƒLţÓ@UWw@K@U„I@m™U@UV¥„@°UnJ°@@_™KUwƒW@UnaWUmmI@m™ķwUaÇLóVĵwݙUUW™¯šƒ¦Ux@V„b@šƒxV°X„ƒKWbK@n@nW‚@UL@lWL™m™zUVVbUbmWXXWJ—b˜n@Vkl@LlVUn@xnV@bln"],encodeOffsets:[[123694,42391]]}},{type:"Feature",id:"2103",properties:{name:"鞍山市",cp:[123.0798,40.6055],childNum:4},geometry:{type:"Polygon",coordinates:["@@l„œxĠŽÞ@šbV@@w°Vna‚@Uk„V@K@UUUVa@K@w@UnKmUVan@@Uma@UXWƒWK@IUK@amW_XKVLlKna@kmKVak@VU„@VmšU@anIÆan@‚a„šUVnb@blLV`ÞLlU„bna‚Kn@naVU@¥°IVK@anUUKVaƒUVak™@mJƒkXƒ™UVwkƒVUUa°U@Wƒ@WlkXWlIXUlJlaœx‚IVVXLšll@nLV@lLXl„KĊzš¥maUƒlkXaVK„X°y„Ila@aVkala@a@¥„IUy@WmXaƒ¯kU@U@mmUƒƒULkmm@ƒ¯VmnLVU@a™ƒ@U@±w@™VWIkymLUUkJWXƒJkUmxk@™xUI¯`mUULmƒ¯„m@kxVVbWV@„UVƒIUx@bkšVšVVšxUbVV@V@zšJVXU‚lnk@@lkLƒlƒLUU±Jkšm@UIUVƒLUVU@™K@UƒnnV@l@Ll„ƒaUJ@zn`@nWlƒIUVUUUV±Ln‚@nmL@VUVkLVlUxVLVlÅXma™@@akLmWUX@JUnVJVkXJ@X@`WX„VUVUIlb„W@bVUVL@`Un@¦U`@bUV@z@Jm@@XV`„LUL¯J@IVKmKÅI@J™nWVnLnšVxV¤™z@bmV@VUV@bUL"],encodeOffsets:[[125123,42447]]}},{type:"Feature",id:"2105",properties:{name:"本溪市",cp:[124.1455,41.1987],childNum:3},geometry:{type:"Polygon",coordinates:["@@lb@Vn„lnVVUb@šVJ@nnJ@bmXUx@xVbkbkŽWLUxnl@Ul@„xWx@nUV@¼Ull„knkK@bmbnl‚LVJX@VIVJn_lJVVšXUmnU°VVVUnVVšLna°V°w²@lw„bl@XVl@VVšIn@„wWWnUVk„JVUƒw@šƒ@anaVkš@@lnLlalKnk„mšK@_lKnlĊXVb„VVLV`nL@lUL@„@L@‚VbV@@V@bn@lxn@Vb„alI²mVL@Vl@nVš_VVnJV_‚@nV„K‚V@Xœ‚@b˜kXbl@XblylUUkš™@Xa@UVIlK@UUWVU„Llm@UUUnKWU@K@UXm„XVa@U°KVUUWUk@ašUVKkaWkƒKUknaWa@U—@m@mk@ƒaUJk@@_WKkLmx„l@nUJmIUWlIUaVWVXn@xWLk@@aƒJUI@Uƒ@UVVxm@UVk„mb¯VUU¯JWUƒ@Ån¯aUbÇ@ÇlLmWƒXkbƒƒk@UƒƒIÇVƒUXW™wÇnk@±aU@@bUVUKUXmVƒ@kaUm@k_±l™@XwVa@kVK@U„Wm—VaUmVUUakLUWWnÛKƒVW_—m±V™nƒU¯@Umƒa@Xk@ƒl¯V"],encodeOffsets:[[126552,41839]]}},{type:"Feature",id:"2108",properties:{name:"营口市",cp:[122.4316,40.4297],childNum:4},geometry:{type:"Polygon",coordinates:["@@ĊĖƐn¤„„°Ċ¯ŎWšô„@xXb‚wnKl@nX@VUVƒKmL@VU@Ux݄@Vlb„x„U@VUb@b‚kœ`‚IUlVUn„V@@UV@@JnXlK@bš@nbÆWUkUKVwUklKVU@UnK@mm²KVUVVVU„JXk@mm_@yVI„bkƒ@K@kmU„m@VšLV@VU„KVUVJn@l™²IVV„K„klK@kl@kmVUW™I@y@UUUVa™wUUU™l™@akmmVaUKmIUaƒJk@ƒwkaóIWWÛL@UlmUIU@WW@UnUUm@wmIVK@Kĉ¦™@bWKk@max@bWXkamKƒ@mVkKmxÛaWX@xUlÝnJ"],encodeOffsets:[[124786,41102]]}},{type:"Feature",id:"2110",properties:{name:"辽阳市",cp:[123.4094,41.1383],childNum:5},geometry:{type:"Polygon",coordinates:["@@š`Vz„‚Wn„VUV„L@bVbVJ@IÈbVb@lVLXW‚n„š„x‚LnKVŽšb@„n@Vbn@mƒ„V@šl„IVa„@@WškVV„I@KVLVanJV_VW„UV@nn„JVI‚Vn@na@alLlmkƒVk@»VU@mXwƒwk@@VmkVwXKllaUa@wVwnW@amI@mUI@™VaUUkmmƒ@UkaƒL@ƒUIĉyƒLWkkKU@mKk@™kWKUUJ›wkbkIWVkJWXkl@X„‚@X¯VVbUVl„UxšVW„„lnIš@l‚Ub„VUbVLmV@bUL¯J@¦UVmbm@LmbƒakVÝKU_kK@amaVUƒ™bm@ÅbmJ@b™VUnƒ@UVl@UbnL"],encodeOffsets:[[125562,42194]]}},{type:"Feature",id:"2111",properties:{name:"盘锦市",cp:[121.9482,41.0449],childNum:3},geometry:{type:"Polygon",coordinates:["@@Vbĸx‚š@nnJVnXŽmb@V„XVxšL@`¯@mI¯Vƒ@U¦@VšV@nƒJ@V@LXx@VŤÔ„K‚LVx„W„knL@`˜b@nÈK@a„@VXĊ¤„nVK@aVU@UnU@ašyU£Uwm™mKXUšm@IÆJnLUL@J°IVKƒKU_@Wn@@I@yVU@aV_@¥Vm@_UKUV@aƒXkaVJVUƒUXW@_@WWIUlUIVm@IVW@IU@@VU@mƒUVVkJ›_l@aVa@UƒVƒwka@UރVwV@@UnK„LVU@UmWk@mLxWa@wóƒUVUIÇÆĉ¦¯¦¯xʟJ"],encodeOffsets:[[124392,41822]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/nei_meng_gu_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"1507",properties:{name:"呼伦贝尔市",cp:[120.8057,50.2185],childNum:13},geometry:{type:"Polygon",coordinates:["@@„m@Łkƒ™Žƒklƒôƒ@£kJ°ý™ɅķÑó¤ğLĉÅlÇğŁW¯¯›™ƥóÿlwkţÈéÝƛó™°ÞÅxV¤ĉĖWƒ¯lȭţυ̃ɱÿķƅˋğɱřÝţϙȍƧĊţ@¯kWKUKm¹Å@ķJU@ƧÑƧ„ō¥˹Ɔ@L@„Þ‚VLnš@VōČWJX¦@JŻbU@ţÞmVU@ȁýóbkWWLƒƒÅ™¯UWġkmóƒ±UŹôV¼ƽ¼ƒł̥ĖƽǬʉxĉŽŻȗKΕ̛ʵƨʟÞ˹»Ƨţ»Ǖō˷Ȍ±ȚʊĠUɾɜɨmÜ֞߼˸ƅȂ¯ǖKˢğÈÒǔnƾŎՂ@šĊbôô̐¼ƒ@ĊôĊŽÞĀ™xšĖƧL±ŽœŽ‚Uš°U„°ĬƒČ°ÜƒêɴȂVł°@ƒ„nxŎèƒbȄÞȌ΀ǸlŽ²IlxĊl²ÒmšôĖ™Èl„ĵºm„ÈêVþ„xɛČʉÇĵVmš„ÒƒÈɆôƐŰǀĊ°ÆǬĮƾb„yĊ@ĠšƒXǀċm»ôw°Ûk¥Çm¯ç™kkÇǫţǕéX_ĶWǖīŎaÆĵĸĊ@ȚȘ‚™ĊLĢĉ„VÆĉʊÇĕóaU¥šĉ°mkÅ°ġUĠřk°mƒÑČÿ˜ÛƒWĸ£ʠšÆxÈÞŎÞ»ʈ²ĊÇČalÒ°Ť±ĸz„ŽĊKȲm¤Ŏ@Ò°¼nyȂUźīǖƳÈē°@šÝĶƒ@ƒÈkl¥Ççkxk™›JXÇƒUÅ@˜£k»„óƿīÛ@lÅJl¥óý@¯ƽġƍÅan™ċ™°é¯¹"],encodeOffsets:[[128194,51014]]}},{type:"Feature",id:"1529",properties:{name:"阿拉善盟",cp:[102.019,40.1001],childNum:3},geometry:{type:"Polygon",coordinates:["@@™ƏnǟƨʫšŹɆÿ°¯ÆV²ˢ™żÿ@ÝÆŁȰ¯ȀƳĉó™™@ğkyš¹@īš›ƒwl£Źƒƒ¯Ŧé@™ÇÇxŋĉƩUUŃōL™Ç™ĵóÝnƒóç@™™ó@ġƒƱ„¥ƒç™WUçÆōƒ@é—çťK™çȭVһƽ̻aW¥ȁ£ʵNJǓƲɳޗǔlżÞmĠóĬȂɲȮ@ÈĢŮźÔnĶŻǠšŎȭœгŃċóȭţΗÆƑÞƧÅΫóȘǫɱȁġlÛkÇ°ȁÈnšõl¯ô„ÞɛÝkĢóWĊ„zÇɼʝ@ÇÈķlUČÅÜķnέƒǓKȮŎŎb°ĢǀŌ@ȼôĬmĠğŰōĖƧbЇƧōx@ķó£Ål±ĀƧīXÝġƃêĉK°Ýʇƅ@ΌʉżÅÒϱʈ@˺ƾ֛।࡬ţશóЈèʞUš¤Ґ_޸Ƒʠɽ̦ÝɜL׈ɛϜóȂJϚÈ@ǟͪaÞ»Ȯź"],encodeOffsets:[[107764,42750]]}},{type:"Feature",id:"1525",properties:{name:"锡林郭勒盟",cp:[115.6421,44.176],childNum:12},geometry:{type:"Polygon",coordinates:["@@ʶĬĊIȘƨƨŽ@ĬÛĢșŤĉĬƒĀóšU‚ÈŚÜènŦƐȤȄłϰUƨťƾÑ܆ğɲƜǔÈèʈƲĊƞƒšɆ¯̼V˺Ò˺ȂŤVĢêU܃x„Āˌ˘ƨ„Æ°ѢmÞżU¼ÆlŎ@ĊçŎnÈÒͪŎźƒĸU°lżwUb°°°Vš£ÞlĠĉĊLޏɆnźÞ„n¦ĊaȂīġŃ¯Iĉůl»kƒ„™Çý„¥Ŏ¯ƒén£ġљÝȭxƒÇ™@Åçķ»óƱŎ¥™çWÿmlóa£Çb™yVÅČÇV»ÝU¯™KĉýǕċţnġ¯»ÇōUm»ğƒÑ™wƏbċÇŎċwˋÈÛÿʉÑ°Łkw@óÇ»ĉw™¥VÑŹU™mW»ğğljVÿŤÅźī@ř¯ğnõƐ@ÞÅnŁVljóJƒwĊÑkĕÝw¯nk¥ŏaó¦ĉƒV¦Å`ğуÑÝ@mwn¯m±@óƒÛKˍƏǓ±UšÝ™a¯lƒōšșk„èƒĬގn@ŤġŰk°ċx@œĉ`Ƨĕ°@ţÒĉwmĉ@ƒƒnƒƒa„™¥ķnƒÞĉVóÆókĉŽķ@ÝkƧƧÛaƒ°Ç@ÝÈU˜óbݼ@„ÛÒV°™@V¼ˋL™ÞɅŤŹǠVÞȗŤÇĖŚōbȁƜ"],encodeOffsets:[[113817,44421]]}},{type:"Feature",id:"1506",properties:{name:"鄂尔多斯市",cp:[108.9734,39.2487],childNum:8},geometry:{type:"Polygon",coordinates:["@@ĶL²ĬVłƑkkl@Ȏ™ŘWńÈĬȗ¯™ºlz@ĠššĊôŦô„ÒĠ°kÞܚ™n@¤„UĸèĸbŌÈXŽĸLlÒĢxɲÆ¤ÈÛƾJÈÝ°UšÅĶ»²VW¯ĸJôšbk‚V@ôlbnĊyÈzVôašb@ĸ‚ÞUl°yǬ²Ǭm°ššk„±lbn°@È»˜JX„VŎÑÆJ@k„LšƒÆl²™Ġ²ʊůĊġ‚řóƛÞÅ@m„ƒmLUÿóĉƧ@™»L@„›`ČĸmšȗÑţů±ĉğl¯Ā™wǎƒçƧŤÛI@±ÜĉǓçō°Uwô™ǫůķƳř±bÅ£™ÓÇwnÑó@ȁƽ@™ƒÇƧĢón»ŏĕóĊ¯b„Å™™VȯÅImƒōKU„™LǓ±Ýxċ—ŋ˜V±Āȗ°™„Źl±šÛ@WÒȁŚŹНŚÅèŌô„¼°ȰɞȂVĊ"],encodeOffsets:[[109542,39983]]}},{type:"Feature",id:"1504",properties:{name:"赤峰市",cp:[118.6743,43.2642],childNum:10},geometry:{type:"Polygon",coordinates:["@@ɲŁĢljĊwƾōÞĭ°_ŎŃźȹƒUČÿl»¯ôķVÿǬƽ™ɅġÅÑǫ»̐ʟȣU™¯wVWݍÈġW»Þ¹m݃ɛŎÿŎōͩůV¹›ō™éċ™óŹÅVVĢǩʈ@Ėċ@ķšÛšV°¯xÇÅţ¥™»°Ûô™ĉʟ„¥WýČ¥™w‚灻±mnÅķ¥ˋVƒbUÒġ»ÅxğLƧ™ƒbWĖÅxš¦U°ÝVóŰlô²@š¥ÜÞÛô„V@²±`š¦™„™¯Ý@„ŽÅ„VÒō¼ôš™¤V²ŹĬÇĊƑƒţxƒç¯Lk»ʟlƽýmłÝÆƏ@mö°Ġ@ŚŹĬţÆUĀĠNJĠŽX¼šnźVUҚ¦Ċxȼ@ôlx¯łʊÒÜĀˌÇČxƍČÈƐašx„ÒĠŽn¼ŎVȐ‚¼Ģ°ŤmǖČĊþšLV°ÞŽU¼ċÈUƚzÈa‚¤ôbkŽ‚nXĀšè"],encodeOffsets:[[122232,46328]]}},{type:"Feature",id:"1508",properties:{name:"巴彦淖尔市",cp:[107.5562,41.3196],childNum:7},geometry:{type:"Polygon",coordinates:["@@²@Ζǀݴʶհĸ„˜ƒ¦Ķ™̒Uˌ¼ӾÇƾ¼̨UÞĉ˜Ƨ—éÝ»ƒĕĉ—ƐȍœōǪakó‚ó¯a@™ôţ™aV¯Þ¯°@²él¥ĵğťwōxó¯k±š—Vó@™aóbUÇyĉzmŽkaóŽU@l™aó‚ķIX°±Uĵ¼™Æ¯VÇÞƽIÇÜÅ£ɱŽġwkÑķKWŋÇķaķçƒV@£šmۙlÝğ¯ƒÑťóǿƴȯ°Åł@ÞŻĀˡš±ŽÅU¯°ɅĀ™źƧʬmǠšƐ"],encodeOffsets:[[107764,42750]]}},{type:"Feature",id:"1505",properties:{name:"通辽市",cp:[121.4758,43.9673],childNum:8},geometry:{type:"Polygon",coordinates:["@@ôƲĸ¼Æèš@„ÈȮwƾ»ʠĢ¥VÆ@²¥@»Ŏњ¯ĊJŤ£k»ÆÇX¯̼ōšī°aX£ôƒƾȁź¥„ƒ™aôŤ™ĢL°ƒĸ@Ȯ¼ÈÒʈŚôVXůÆaĠƛÈKƒķšĉôÿ@ğÈĉ™»ÇVn™ĉV›wXĠÝ°šČÿĸwVƒ™¯¯ǵ±™ĉ‚ǫ™ÅÅm»²Ż±ƽIm¥ţÈķ@¯šƧJV»ÞUÝç¯UġºU£ţŽóaÅÅlƒƒ™Ƨī¯K¯Þ݃ğL̑ȍƽ@ōŎōĀƑɜnÞݺX¼ÇĢގUX°xVšʠȤ̏Ǭ¼ÆÒɆĢšŽǫƾUĀóĸ°‚k¼ċĀƑVŹȺōń¯`ÝĮƽŎĉxġNJɱłō¦"],encodeOffsets:[[122097,46379]]}},{type:"Feature",id:"1509",properties:{name:"乌兰察布市",cp:[112.5769,41.77],childNum:11},geometry:{type:"Polygon",coordinates:["@@ʠǠÞĸɲȺƒÒȂƛŎaƙÈĕȘţUÝźǟɆţšÝˌKU»š@U¯ÜÑ@ƒÞ»ôaV—ÞÇÈ@„¯ÜbƨƨÞlĸ@ĊôlôÅĊU„Ýĸmš¦ƒŽ„bm„„„Ċ@n‚ĊxŤÑ@¯‚ƨĖĊ_@›Čwl¯™ƒȭL›Ý„»ƽ¯ķů„Ǔ@ÇǓbċ™ÅÅÆwÿĠÇU£óaƒ¥¯aŎğĠţkw°»¯ůlÝĵkǻݰɱƧǫaóôɱ»Çk¯ŃóƒʇŐŻ›ĉNJŻĢ„Ž¯ÒÈUl°ƒx°n„Ò™Ĭón™Ċğ°ÇŚĉ¦ʵVƒ°°ĬÛżÇJȁńʇʹó˂ƽŎ›Æţ¦"],encodeOffsets:[[112984,43763]]}},{type:"Feature",id:"1522",properties:{name:"兴安盟",cp:[121.3879,46.1426],childNum:6},geometry:{type:"Polygon",coordinates:["@@ÆXnlŎ°@LVLĠþœxĊUȮĊnU„ĠV@żaW¯XIŎġƒ¥Ý@K@w@K@I˺ŻŎ¦ƨƒƨÒŎIÆ@X@VºnX°lŎ@ƾĉˤƒȘǷȘÑÝݚÞbVţĸÿŤxÈĖƐŽêÇKnĸ¥ô@›ķÞUnÒl@UŚaƒīˋƒ¯ÑƧx@±kXřƐƏÛéV™ˋ»lō¯ĉ„ÅÇÓǫޗĖġV@ğ»›°ĵ„ÇÞǓ¼¯m˜ÛÅŃĉĠÇƾb²çƒ™šéż¯VƒƒğÞml»ōÑV痻V¯™¯šĕÆU¯y°k¯¯V»ôDŽѰa@Źk™ġKţšóŽšbƒ„Ź¦ƽȂó„W¤¯b™Ĭ̻ŎW°ÅÈl¼ţ¤ĉI™°ōÒ@¼±¦Å@UŽġ¦ʟŽƽ¼šÞĢÒm¤„êō°ƒ¦Èþƒšl„k¼ĊŰ°JĢńȁĬ„°ƒżn‚ÇbV„ݼ@¼óĸţ¤@°Ånšl"],encodeOffsets:[[122412,48482]]}},{type:"Feature",id:"1502",properties:{name:"包头市",cp:[110.3467,41.4899],childNum:5},geometry:{type:"Polygon",coordinates:["@@źxżĀǔÆǬVȘĀŤ¥œÅƾōôˁʈͳȂŃÈIÜŻ¯ī„¯ōm™¯ɱĖ¯ƒķÒÝIÝ»ÅV™ƒlÅôфġ™ğVmÞnnƒWçkW܁XƝÆwU»Șĕš£ĉÑ𱱚Åk™„ƒK@lÅIō҃UW‚—IǼ¯@m‚kaƒ²™l¯™ǫnǫ±¯zkŽÝVķUô™˜l²ô°ŎwŦxĶĠk¦±ê¯@Ý°U°šbóŤ@š°bôlôǩb›ŎƏȎĊ˜„ĖÞ¼˜ê—ƨÝĊ"],encodeOffsets:[[112017,43465]]}},{type:"Feature",id:"1501",properties:{name:"呼和浩特市",cp:[111.4124,40.4901],childNum:6},geometry:{type:"Polygon",coordinates:["@@ʶUĊ¥ÈřĠ¯šĉômšīƒÑ¯m„wk¯ÇV°ÑƒżġĊljǓɱţǓ›ƝóX¯ƒɛÒóa@nÝÆôƜŚĉĢʉŰĊҙ¤ȗĖV¼ÅxWƞۂlXXèm„ÝmUnšĠƒĢóÒkƚ„ÆUÞ¼ÞJĸÑ°„ɲĕš°Ŏn"],encodeOffsets:[[114098,42312]]}},{type:"Feature",id:"1503",properties:{name:"乌海市",cp:[106.886,39.4739],childNum:1},geometry:{type:"Polygon",coordinates:["@@Ș°ÇīXњŗ@ȍlkƒlUŁ±īĵKō¼VŽÇôXĸ¯Ž@šťê„°ź„k¤„x™œ@Ĭ"],encodeOffsets:[[109317,40799]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/ning_xia_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"6403",properties:{name:"吴忠市",cp:[106.853,37.3755],childNum:4},geometry:{type:"Polygon",coordinates:["@@nLV‚@šVLšaÞbn@@l˜š@bUVlUV„zVx™¤kÞVèšXnš‚@nm°a@UƒÑ„@VŽXnV@Va„UšŽVKUUU@@U‚@@KVa@U²@‚wXkWnk„±lLnU@UmmVKnIVWnI@UK›@UK@@UVKXkmWLWUXmlkVwUyVa@w„w@aVI„K@aVÈw„KlLVV@LnV„VVnU‚ܲ°WÈIUÆ@nÞ¼‚‚@¦™@UÞUVW@UxUxVn„b„K‚b¯ÞU`VbǬ™V@XXÆVVl°InmnUôƒ°¯‚anam£œWVX‚KXmškôaVU@ƒVak@@wmaƒn@K@UÛUWKXUƒÇƒ@UI™b@alW@akLUKV@@Ukw±Iš›nL@kmwkWmk@JUIƒůVmnnU@m@UƒK„VKlkUwkƒƒnVUKmbkI±š—KƒkmVkKƒb@U@aƒVkUmn™`kIlaUK@UUKmbUIݚUa@mUa@aƒ„m@UUULUK@bmKkbWI@WXwlkXƒWa@k@kKƒLVkkK@L@JUVmzUKlwUUnW˜£XVlKUwVU@aXI@aWaUw@W@_nam@¯‚UkWVkUWaU@nwmJkUVkWVUmUkJ@ImbUaƒ@@WÅ_mJknmak@@mƒXƒaUV@„ƒxUšƒ„@‚ƒ„@VUnkVƒ@Vn@`ULUbWLXVW@kbUJ@XW`@ƒnÅĖWJƒ@—m°@xƒxšbnUa‚w²lƒÞ°xŤIVVULۂWbšbkVVXÆ`UbVL„@kx°LlV@Vœ„WbƒJn@bl¤ULV„°@lmL@ƒƒ£U@@aUwmKULVxUVVx@„™@kU™@mK¯LÇa¯@"],encodeOffsets:[[108124,38605]]}},{type:"Feature",id:"6405",properties:{name:"中卫市",cp:[105.4028,36.9525],childNum:3},geometry:{type:"Polygon",coordinates:["@@°@Èb°KnLš@lVš@@ƒUwVUUwVKnLVx@bV@„¤@„nK@k‚¯UƒVKk£@a‚m„IXa›ƒ@UkU¯Klwƒ@UKVaÅ_UWlU™aXa܁VKUUţJ¯w„ݱkxVbmŽ™a„w@wn¯˜„@XIÆĕ„m‚@X_@WVIlaX@WUXKVaVK@_Um„@lUVm@U„ƒ@„ƒV™„w@ƒVUÛwm@@W@ImKUkU@Ua‚aXƒ@wWaUKkw@UVaUamLU™nk@»±`¯@k—W@Ua™ykbƒI„„@VWJkLWUkJƒwU@ƒn¤mL¯wm@Umƒ²XVWbnV@bmxƒVkxUblLUV@kVWKU¼ƒŽkUƒ@mn@JnV@bUnmJUn@„k‚@XlxšLVVnKlLVV@š@LkKULVbk`WL@lkXW@kVƒ@UÞUlÇX™lkaUbmV¯@@L@šƒV@bkb@xƒlW„—bƒbW@—±@UJ@IU@mVk„VxV@@l„Illœn@Vm@ƒVUbl„@JLmKÛXmVkU›KULU`@LĉwƒKUX„lVUl@Vb„JX¦̼bÞxŎxɜĖĠ„Ŏaô@"],encodeOffsets:[[108124,38605]]}},{type:"Feature",id:"6404",properties:{name:"固原市",cp:[106.1389,35.9363],childNum:6},geometry:{type:"MultiPolygon",coordinates:[["@@Vnn@°xnK‚£„mV@„xlIXVlKXI@Uƒƒ„JlašzVbX@l˜°@²_@¼mlVšnKVbUb@VlxVLXb@xW„bVbV@VlnL@J@Xn@Üx„b„W@nl@nblmnIÆ`@X„@Vbna@aVUUWVkƒ@kbWakbU@VwšW@_l@nmn@@alVlk@UkmVak@@a‚UXaƒL@¯@KVa@axWI@KnkVaVJn_lJ@„X@‚m@nVanUVb@mXLlJ„VWnLla„VVaVX@KXVVkVKlknKVa@aVU@KXb@klJUknUmƒ@K@_UW@alIUamaU¯kJma@IUK@U„@@UW@@aXLVƒVJVaXIƒKlaUkUV@ambUUJkIWJ@wUI™V@JU@UwV@@Um@™nU`@UkUmVUxWUUV@aÅb@aWXkKUUƒUUaWK@wnm@IVU@aXwm@UmVaUalk@anKUwlƒUwlkK@wmaƒUkmmIk@VmkUUbW@UVUnW@kV@xkVmbVnU‚™@UbUV@a›k@kkW@„kLW¤@„nV@VU@W_UV™UU`VLUV@IUVõVULU@UUUJ@wmkUJ@šWI@l@bkKkbVVƒbVbUL@UUJ@Vm@@L@xbVVVLVlVwX@Vb@bmUkbk@@JWIUVÅw@Km@UkWKXxWLÅ@UVUnWK@xkVW„@KULwWVXVWzXVVKVXkV›V@VUbV@U„VV@š@LXxVL@V„b‚Ž„LnKVLVxXVmb@l"],["@@@J@aƒU@LWK¯UUxVVn@Ġ„„LUW@UbUUUa@KUX"]],encodeOffsets:[[[108023,37052]],[[108541,36299]]]}},{type:"Feature",id:"6401",properties:{name:"银川市",cp:[106.3586,38.1775],childNum:4},geometry:{type:"Polygon",coordinates:["@@šUšwVK@UVWÞUšbšw„V@knV˜@@KU_VK@K„ƒn@W_XWlL@Vn@Ċw@Ulaœ@Wanamī@aƒ»ŋó@aÆÅɲÿUaV_°ÝaƒLƒaUmVwVwX@VUVݚ@@¥Ý»@mVÅÇJ¯XÛ±VUmƒUmU@KUUkKƒLÇxUŽ@bƒLUJ@bƒx@xUbVzUxklWnXV‚KnXWlUL@V@ŽVLœ@VL@ŽmJUXmJULnn@VmVkKƒ²mlXWlx±@@VUb@L@@VV@VVUL™ƒVUbU@WmUƒ@„Ò@V¯bmn@VŽƒ„@lVnUšnVWŽXVl@¦VVUn@x‚š@‚XL@¦‚lXxš„Vb"],encodeOffsets:[[108563,39803]]}},{type:"Feature",id:"6402",properties:{name:"石嘴山市",cp:[106.4795,39.0015],childNum:2},geometry:{type:"Polygon",coordinates:["@@U¯ķó±ÇÛ¯™ķmbXb›@kb@Vĉxm@@UkKWXX`m@ƒ„@LULV`@L—@mU@lƒU™x™aÝVUX@VUL™x™VkLWVšš@J„nVLXVlŽUV@zl‚VL@V@b„„n@lU²WVLlLVbUŽVxUx@xǀL˜xôҜk‚K²ŽVa‚U@wXa@W™ÈĉUa@‚bÈk„m@¯"],encodeOffsets:[[109542,39938]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/qing_hai_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"6328",properties:{name:"海西蒙古族藏族自治州",cp:[94.9768,37.1118],childNum:7},geometry:{type:"MultiPolygon",coordinates:[["@@„V£°š@laœXô±źwš™ô@„Ulƒża܍n™Kƒw@U„aƒ™ša²L‚mÈLƚÈxlaUa„wÞmÜbÞUšnJ°a„kôƒ‚ÑkwÝVğwÇ@ÝkkV¯¥@ò„»„nŤ¥XImw@mVwša@Åw™mLkaW—wƒ¥l»kçƒó„»@ƒWÑĉŽğ@ĉ„™‚Ń„UwóřVómĵ»™™Ý@VǕ¯kšÝĊÅk™°ÓUklkU±šI„ÇÞkƒ±@šƽJƒ™@UġIk@W¦™VÑșÓÅnťKULnŽ¯X›ƒ@¯mUÛ@WřmóKknōbƒxÝ@ƒŽU@kw@ÿÇLţšÝUkšmwƒŽk™lċVŚU¦™ŽƒLkUWlÅÑ@aƒ@ÅѱUóġŹ¼ƒÈĉmŻ@@wkw™Kl¯U™ġ@—„lÇU™Ó¯_ƒ‚Waĉ²Åló¼VbknƒKǎÅ@ƧĢō°Ý@ğ„W™ÅxUUm@™‚ÝXۂW„ULUè¯@mbUaƒLƒbUWġxIUJWz™a¯b™y™@ōÈóLU`ÇXUl™UĉV¯n›mÛbǕLklƒUĉVƒšóaġ„ƏbġKţnkbÝmmnÝWȭȃŽÝXţWókUÇl¯U¯‚ġUɅĀ@°¯„„š¯„VÆnmJ@ĊķnóJUbÝXUlVškL@lVxnnmb@¤Vzš`ÞÞŤ@„VnÆJV„°b„UôJkzlŽkl@²óš@ÆÇ°kĖƒšÇbÛU@lmb™XV˜kzƒV™ŽɅĀXˢlń„ĬŹ@›éÅ@ĉńÆ°ğbUšlŽɜ_°‚@xŦ˜škbVbƒKĢ„ŤVŎŽ°@żÈźlĊ„ôKôb@nôxŦ„Æ@ôŽŎL@þÆb@šnnšWˌbÈx‚InaŎxlU@Ѳ±ƒğVUĢƒƨbɲ@Þ¥ôUUķWVô¯ĊWʶnôaŤˁ@£nmnIôŽǪK°xUXô@Ŧa°m‚kXÆÞVŎkĊ°ÞLȄôyVašIlwX°UVwĢÑÜKôw@nV@œm°nmŽn„Ü‚ɞ£VbmŽXnƒ°ÜÒ@xx@V‚b²UlbkxVnšJUnVVĊ°KȚm°nxÇnn¤±¦@ŽUXVV@„lV„„bmVVȁŽVxšÒ™°šIšbźaȃšbVwš@šƒVL„™ƾÑ@ƒŦô¯ĊkôÑ"],["@@„@šƒ„@n„òVœa‚w²bVxšxÜaČVô_ĊJšIVmšL„a°@Ŏ¥XlK@ƒšk„l„KVbUb˜@nUĢn‚aÈ@lmǬ»Ġ¯œn‚mnƒƨVy™Ñǖ™Ġ»ɲInŽ‚@@ÅĢƳ@¯°™ôV„KÈbVIÇ¥¯@Ýó„™@ÑnīWKšƒk™‚k@¥š™¯™Åa™Xƒ±VÅw@±Ġ¯@»™š™n™Wmw@ƒ™@¯ƒVƒUUWçƒKĉ„a±VkkƒV¯w™x@šUJ‚x@bknÇb™mÅ@Uw±U¯¦UŽ™Kmš¯I¯Žť¼ğĊ™@ǃŹÈ¯@Ý»ÇnˡJƒbÛèÇnƒ„ÅK¯„ġĠŹW¼Ålm„@¤n²ƒŽÝb@b„š¯lƒ¯@ƒšÅ¤W„™¼nV@x„„°@Vx„@lbUblbX¼W‚œšÇ²lšUŽ@¼ŽV¦@bÇlVxUbVxÞbVšœbm¦ƒVV„"]],encodeOffsets:[[[100452,39719]],[[91980,35742]]]}},{type:"Feature",id:"6327",properties:{name:"玉树藏族自治州",cp:[93.5925,33.9368],childNum:6},geometry:{type:"Polygon",coordinates:["@@ɆÿĢV°°VÈklVôŤXÞW„ȮÇÞXnmÞnlaŤmĢLƐaĢƒôb„™ĊU„VlkǖKÜaœn°mĊUšVVkÈWV_ôKŎǚ@šz°ašbXyVI‚JĢwVX„a„KVbna°@VçVKXƒÜÞWšn@VVÆwXšĠƒÞ@Ŏ¯ƨġÆ@ȍ„LlmUaô»ÆkĊ±Xb„°`šÔV‚kȘƒĢ@Všk°šLlx@xż@Ċn„Çź»ôĢ²VÆ҄@@bÆÒXklV„KšV¥Æ™ČUšk‚l„nxl™çƒ¥ċç@±m¥ƒwÅJƒ@™™™Vƒ„mÈIléÈa°U¥™™@kÞV‚K²ÑWƒ°w²Ñ‚K²ñšyƐ„ÝšVmw„»kkWĉ—JWUƒVÅwƒL™mÅ@@ƒmw„kn¥Vу»°™°@@»„¯„Lla„JônV‚UůƒU@W¯Umѯ¯k@WykU@¯„wV¥ƒkVwţƒk»šwWǜĉĶçšK„ƒÞ™ÇaĉbƒI™lUƒ@kwƒWƒXUƒ°w™±@UšKn£Wĉ—KWxƒkĕVƒšamwXw™@™„Wmnk@aƒVkƒ™bĉLƒl™Imm„wUÇ‚Wx™nÝJn@¥Æ™kwƒaXƒÜĉ™¯ÅV¯¤mkƒx¯kķܙ²VWôŹVUƒƒ@V£™¥@ƒ°wn@™m@¯@UbUôķŽmn@ÆÛ@ÇýVaUÇĊVƒ@Çlğ—¯xÝŤ™lVÈÈVƒx„ƒ¤Vx™„kK@™@ƒx@„kVƒĖġ¥kIWbXŽŎx@nƒxÅUW`ƒ_—@±ŽUa™LUxƒK¯„WbkVlb—bmŽƒLÛÆWIUwƒWkwÝV@kI›ŽéUb›UUk™V¯Km¯k@Umݐ¯m¯›m—L›Þĉ‚ÛUm™ġ£UxkKm°™Lw›šk@kšƒVm„ƒKVUk›@¯a¯Ģ™móKUU™x™ImlÅn™™ÇbXèVVU„°„@ŽšŽ@„‚xXnmš™ššŽ@¼ğ°@²ÆxU‚„²šWÆb°š™š@¦llš™„XLmĬ@҃šÞô°@ȦUJÇaƒLóU¯š@°ġƴ@Ɓ@mɱJğ¼ǕššÒUzƧ‚m„n›mğ°ǫ¼knÇ@bġmmV—@VaUaƒLƒk™l@„kLW‚ō¦¯@ƒb™KUn™JĉIó`ċUÛb™wUw±ax›bñUmƒƒ@™„ƒ@—bƒaƒbǏÅXm˜„ƒÝ„ÅôVbގ™bl„UšÞVޚ„U‚°„VUxƒ@U„V„@l`™¼nL@Ċ„LW„„¤kXķWġXUVVVķ„UbVb@°kVVxÈa‚@ȦĊbšaźJ„U@Ț„„˜Vœƒlš@XkôaWƒĢ™Þ@laĸUÆb²mÞLĠ™ÞÑôbšÒĊa„JVbm¦"],encodeOffsets:[[93285,37030]]}},{type:"Feature",id:"6326",properties:{name:"果洛藏族自治州",cp:[99.3823,34.0466],childNum:6},geometry:{type:"Polygon",coordinates:["@@ÞVŤ™ÈK@ĀlxV@„Þ@„wŎalmôLšnXÆÜ@nV‚°@œ„°WmVKŦLÆmȚԂҚUX¥l@ĢJVš@„ŽƾI@w™W°™™Ån¥›kÅÝVwôƒÈç„@lÑĊĕša„JnaÆLVw°kny°UnkÆVȍĊll¦„Vƾ@@™nUźƒÈǂIn°X„wÞKô¦VWV£„@£°ókċ±I™™am¯Va™»ČĉV¥°™@m„k„¥l@„Ċm@ašU™mwXƒ@wÆxšmĢ_„`VnÆbšKVw„@@ƒnUVğVmVVöIlŽl@@çÛmƒ£UDŽw°@VUƒ¯»m¯ƒJōĖÅLƒa@»ĉĢ±`U_k`ÇçšóƒkX™lK@ƒakÝރš£WċkÝ™kxƒJݯÅw™xķxmIÅx„@k±J@ýŋš›¤UœkŽmV™°ÅÝxkwmġƒnÝVU„š¦ƒŤlmšóXk¤™UKƒç™@mVkK@klīƒ£mš¯VUbƒW¯¼ċb¯ĵam¼mVX„m@k¤ÇX‚ÇbƒUƒ„¯J¯„¯È@˜™bVXVҙ¤V¼kxݚV„@l‚V—„WxÛ¦Wš¯šmKnlŽkŽ‚šU‚@nƑUĉ„Ý@ǺۄċUĉ¥™UƒÞŏ™z±òL±Ò¯xX„±ÒLÝU@lššV¦¯‚ÇbkêÇJƒnU„šš@š„‚ÆI„xn¦‚‚@²Č脦‚è"],encodeOffsets:[[99709,36130]]}},{type:"Feature",id:"6325",properties:{name:"海南藏族自治州",cp:[100.3711,35.9418],childNum:5},geometry:{type:"Polygon",coordinates:["@@VxƒŽńƒš@ĊĠŽĊXÒ°UƾĕÞm°£nb@‚@LUUW„Ûº@nlÆǬšĠ£ÞV°UXb‚VȂǵ„éƒ@kWanm°@™x„z„K°¯ĠVšƒVƒkw™Lnm°kÞxÆa„¥@‚wnĉƏ@™œ_l›š_VwšmĸèŤÅČU@™˜Wn@ÑmKU™nğƒK@ƒ°¯UÿV£nmšLl™„UƒUÛé±óókkmƒnƒakV@Ç°óÝXƒWəÞťIţxmm™VÛUVȂÓnWyȁĉkƒVš°WnkĊa„¥‚_œK°ÿWna@ƒmU¯wƒlÝIU¤UXó¥ÝLƒx¯WmJÇÈŹ„mV@šƽ@ƒUk¥ĉkċŽÅUml¯Vmz¯lUxÅKmbƒI™bĉĖk҃@Çèó„UxÆޜlm¦šÆ¯ššX@x™Ž@Ž„²ÝlƒÈ™JV²klVl¯ÔlšĉƙްlUǖÞ@ššĶ¼nŽUôôŚ"],encodeOffsets:[[101712,37632]]}},{type:"Feature",id:"6322",properties:{name:"海北藏族自治州",cp:[100.3711,37.9138],childNum:4},geometry:{type:"Polygon",coordinates:["@@ōmġxƽUm±Lǿþġԙ@kxmWƒb¯I¯‚mIUx@bƒbŹVǎƒkĵbƒlĉI¯¥ƒUšm@ƒÆ¯È@šašóšUlƒČ»@w›œ»›wXaƒƒó°ţç݄kUƒaV¥ÅbÝw¯lmnšKlxU„™„ğU¯°ƒLƒyšw¯@mnXb‚l„@ƒêȁǶUWa¯VÝUğ¤ǫ™kÅ@mܹXƒVV@K@ma¯¤ÝnƽĖ¯V@„ƒ¼„ôlèk¼„¦˜xXŽlbnKšÆx@Ž™bUx@nnxWJţ¦ƒmƒ¼ñ@Ž°¦lUÞlÈ@ĠxÞUlxÒó„ƒl¯bmI™ŽÝVÛaÝnƒxVbkbÇwřÇKn±K™b„šƒb@V„xšLmŽÛŽŻbk„ƒVó@™šŹxó²›Wkb™@¯U¤ƒźĊ@lUX„°lÆôU„ƒlLX‚aœV°wšxUb°xÜôÈKVkÈmlwškÈKšwšK™™VUŤĉŎ»„»„Il¥na°LV»²¯Üy@wĢƒ°ĸwlwĢw°±„_lVkš@°ƒbƒÆ¯zƒ‚„š„@l_„@Ģ±lŚVlUaރ„LVƒnKlnȏ°IllČa˜wÞÑ°x„UU™@wƒVkmĠLô»„KÞýôaÞ¥ôĀÞmƁ„™‚mUƒŎV¥Èl°²°a²¥V„@@w„amm@Ñn@Æ£żƒVƒĠ£@W„¯Þƒšl@š»@Uk@"],encodeOffsets:[[105087,37992]]}},{type:"Feature",id:"6323",properties:{name:"黄南藏族自治州",cp:[101.5686,35.1178],childNum:4},geometry:{type:"Polygon",coordinates:["@@ôl²ôÜê„VƒVkš™KmnU¤VĀ¯°@„„LmĠVšnLÈL@alb@al@n°Vš_XmWUÈamaVIn@n‚aV£œóVWƒ™U£°ašxÈ¥@™‚aĊwȹ@óša™ƒğbm@k„w@mƒaÆw@ƒ„In¯mmƒ@UkkWƒÑÅ@@kċÅçVkÝJÅkVykŹl¥@¯š™ĢU܃X¥òý—mmX™ÝÅlmU@£™Wly™XW»Åbƒl@aI›»k@klm@UxUUƒVƒ¼¯Xƒl™aUnķ‚ƒI@x™@¯„ƒK™„ĉUU`óšlČ¯ô@¤ƒÞJ„k°xVŽ„n@ŽmbXŽ¯Ā›L`ƒ¦ĉbml¯X™ŽUŽl„ȂĊXzm‚ȁÔU‚ÜVšUnnŤwŦJɚ݄XÞW¯ô@ÈlU„b„mln"],encodeOffsets:[[103984,36344]]}},{type:"Feature",id:"6321",properties:{name:"海东地区",cp:[102.3706,36.2988],childNum:6},geometry:{type:"Polygon",coordinates:["@@@҄bš¤ÆI°ôU¼š°UŽnnWx™š@b¯L@lUUWbXxWl„ƨnxVUllš„XVŽUŽnL@lȀý²KVnƾ‚ĢwV»ƒ@mÞ£nÆƒÞÑmL™ƒKUaVżĕƒWVk²ƒƒÆÝ@ƒXw°@„ô™@a°wóUUmIk™™aVmÞwmknyƒ¹VÿƧnŏm£X»˜™naV±„Ýw@ašb@aƒm¯„ĉVó¦kÝWKUU@WanU™b@ôǺĉxb@šÇ¦™w¯bV¤„šUX›ôU¤bmm@UJnbÇbXVWn™`¯Umk@@bka@bÇK"],encodeOffsets:[[104108,37030]]}},{type:"Feature",id:"6301",properties:{name:"西宁市",cp:[101.4038,36.8207],childNum:4},geometry:{type:"Polygon",coordinates:["@@@kmKVUƒWk™VkUmwƒƧXkWwXaVV@k°K@aš™XwmmV™¯V»¯óÅJ™£ƒamŽ—X@šċVţÆķç™nUx™`kœ›`@šÅmĊx@Žƒ¦U¦„blVރŤèô¯„„Wbœx›¼œŽ@xċ¼k„™V™ô™bÇ@Å°@„™n„V°¦ĊJ„kĶa„lȍźU„a@aVwnJ°°J„anXlwš@ĢÓ"],encodeOffsets:[[104356,38042]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/shang_hai_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"310230",properties:{name:"崇明县",cp:[121.5637,31.5383],childNum:1},geometry:{type:"Polygon",coordinates:["@@uŏu»GPIV±ÐɃŜ{\\qJmC[W\\t„¾ÕjÕp‡nα|ěÔe`²„ †nZzZ~V|B^IpUbU†{bs\\a\\OvQ’Kªs†Mň£RAhQĤ‹lA`GĂA@ĥWĝO“"],encodeOffsets:[[124908,32105]]}},{type:"Feature",id:"310119",properties:{name:"南汇区",cp:[121.8755,30.954],childNum:1},geometry:{type:"Polygon",coordinates:["@@`y”ĉNǕDwǏ»ƒÖLxCdJ`HB@LBTD@CPFXANC@@PGBKNECCBB@EBFHEDDDSNKAUNBDMNqf[HcDCCcF…@EFGLEBa@ACoCCDDD@LGHD@DJFBBJED@BGAEGGFKIGDBDLBAD@FHBEF@RFDMLE@SGANFFJBANPH@@E@FJjRIACDMDOEKLFD@DbDAJI@AP@BGHFBCBGDCC@DCA@CECGH@FKCEHFJGBFDIHACEDNJDCVFBDCRKRLDLITB@CjNJI^DBCfNVDHDFKHAFGDIICDWBIF@@CFAjFJNJBBHD@CJ@AEFJ@@DH@BFBCPDBMFEQGDIFCNDHIP@HDABFACBJFHEBSZC@DP@@JDBƤ~"],encodeOffsets:[[124854,31907]]}},{type:"Feature",id:"310120",properties:{name:"奉贤区",cp:[121.5747,30.8475],childNum:1},geometry:{type:"Polygon",coordinates:["@@~T~JjZdDbLXDLCB_J@@FHFZJJIAGH@HGR@BENBLID@@LFCDF\\FpDBDb@FAHKFE†@dEDDdC\\GreNMACVMLBTMCCFCEGFAA@DAFDLMHA@OD@BMEWDOC@AS@KGAI_DcKw„ÕísƝ‘åĆctKbMBQ@EGEBEJ@@MBKL@BJB@FIBGKE@ABG@@FMFCPL@AjCD@ZOFCJIDICIlKJHNGJALH@@FPDCTJDGDBNCn"],encodeOffsets:[[124274,31722]]}},{type:"Feature",id:"310115",properties:{name:"浦东新区",cp:[121.6928,31.2561],childNum:1},geometry:{type:"Polygon",coordinates:["@@EN@JJLNHjLJNR^GRYVBNZJRBV@PDvbLNDN@LGNER@nCNQNuT_TIVFV\\Z\\XnDrI|[Ʉś²ÏJUHOƣ}CA@IO@@CYDATGFIEDAEBBAGCO@GJMCEDCJRHEFANOCADAEG@@CI@FE@BDIC@AGIAIMiEEB@DE@AJCXJDCJEHGBELGCUCeMAD]CIJiM@DSAKJKCLQDQACUECDMIFCBDJGECHAEIWCK@GLMCCGEACNKCEJG@MMBMC@@CIJUINT@JAJSTEPZZCP"],encodeOffsets:[[124383,31915]]}},{type:"Feature",id:"310116",properties:{name:"金山区",cp:[121.2657,30.8112],childNum:1},geometry:{type:"Polygon",coordinates:["@@L@BIHFN@@EE@@EFBDGDAADVDD@@EF@CA@IIsRE@GDAF@BF@CV@|FBCHBLCNHAFCADBMDCFZXHILBVEEQA@MWFARJJ@DCX@@TEFBLHAAERE@AJABRPBNK\\BrJ\\VHGND@CNADKDADQjGAGNC@GJ@FCFFHC@JF@@dLBDSFADHVG\\DTEPDDHJALIJkJDJCDIPE@YDCBiK@DONE@EH@BAF@HLJA@EIA@ALKNA@@FIFAFHR@NALadsæąyQY@ƒA±DʼnXUVI^BF@FFF@HBJEDFFGFEBSRkVEXGHFBMFIVW@GAEEFOIAIPKABGWEKFSCQLQBSEIBC\\FdBLRR@JGACFDDEF@AWB@LJJYNABBA@CUEGPaO_AIE@MYMFIGAEFECHSAAKAO\\[JEDB@E@MMA@@AGBKMGDFFCDDFEDFJF@NPBAFLHFH@EDDHBADDC@DDCDHHCDDFDABDAD@FEFOBCJ[D@HEDDNJBDDHABJIBBvGLBJAH"],encodeOffsets:[[123901,31695]]}},{type:"Feature",id:"310118",properties:{name:"青浦区",cp:[121.1751,31.1909],childNum:1},geometry:{type:"Polygon",coordinates:["@@RUNKdOFDJCbRFMLAHPLDN@JGL@@APBWYCKN@TU@SHGCEJIDIJKVIZVNM`iNY@CIE@CA@KBOEGEUFCCSADEIEFCDDDIDDHC@CKIeDCG@IG@DHWFEEGCH@@GO@@O]CNpeEQDBFME[JC]DGF@CKOA@QSB@GB@@GW@@ED@AQIJIAAFE@@DO@CFI@KNG@CDACAFEGKGBEGBDCCAIFCCLIECFI@MBCLDHGNAHSF@DMB@EEKBA@@C]DEICFG@ADBHGFKCDAKKHKD@@FHGAANGEEFCHKCECBCKG@ADKCNE\\[A[I@@mGBDQQEO@BCE@AI[AML@JGACLOAFKEMM@EQKC@CUCBCCBCHEA@FF@@FM@GEAJK@GNF@EXPH@FD@M^@HIADJCFDBER@DK@@DE@CAKFOCCBDHIBCNSB@GFC@GQEEOWFICGDUAEJIDBTAHJHEB@DIF@NE@H|HBDBEH@DKBAHEF@HEEUB@FGFGCCCE@AHOB@NH@PRLVNNFBX@RC€PbAvMtBfH@DJF@ELBFA@EH@HNED@FFB@HLC@CJ@@DJ@PIRf@HE@CFF@GPHD@DKE@FFBEFFD@DEFCA@DD@IjCRFBAHFDKD@HF@@PM@H@BlbDJDBFEF@DLXB@HCD@@IFCBIFEJD@FDC@FBALLF@PAACJERACAJCBD@EL@JD"],encodeOffsets:[[124061,32028]]}},{type:"Feature",id:"310117",properties:{name:"松江区",cp:[121.1984,31.0268],childNum:1},geometry:{type:"Polygon",coordinates:["@@@DLDFRN@FNELPBDKHB@INK\\BBJF@ADP@RFCRHA@nJ@B\\[\\MFLDBCH@DLDADFGLEDFFMHBBGH@EC@GLLLCBLDHEAGBCH@DEFJ^C@DB@LAFFA@CNE@GTMBGHKCAD@NEJFDKJDDJEDBCDHAAFLHFHBEBDDCH@LMJ@DEP@@CF@BEJBJIBRC@@FX@@HA@@HTA@RPBDLE@CHD^\\INFAERCfFMo^D@PP@@HG@HDFFXECGH@@JDHfCLJ@DGDCCCJCCEDJFCFTBDDVEHFPFLAB@NBFCFKFC@CHIACNOHWHCAAFIDD@CDAGEI@ACFMF@R@R_@GQED@EGFEQEDE_IAHKAEXCQUOQCUDEN@ZI\\DDmAMHCICDSOC@EG@BKHIGMIBCGOCSF[CUHCGEBCTKA@cE@@IGDEEEDI@@HMDBHiHCRCBCLMB@DMCGH[UqI[AMLOAAQIB@BQFBFGBAKFE@SW@CDI@QIEBNXB@FRUFKAGJYWDENCCADBBEMGKDGAAD{EU@@DAEE@CB@HQFJt@JDBE@@FC@"],encodeOffsets:[[123933,31687]]}},{type:"Feature",id:"310114",properties:{name:"嘉定区",cp:[121.2437,31.3625],childNum:1},geometry:{type:"Polygon",coordinates:["@@F@LI@IDKJADKIEJICADGACFECCJ@HKCAFOHAJI@aCBEE@ICAEB[GFGCKL@FGEIFADMLCAEJM@ELQECEIG@BE^QKKLQCA@EHBIGQ[GEHOMGGDHKH@JOECFCjCBEFDNCACMBCILGTABDLEEOEIG@GFIMM@CGKFBFCDE@@GEAGEEACIcGaHMFITIHDN[AKF@FS@OA@BK@IHM@KCGOKBENaQIDECcPMLQVFHFB@BFBKLGD@FAJOVGIACQ@A`LPCB@JEF@RU@ANS@@RCL\\HIFpRBFRBBDKLLDADJDGBFDABHBEDNF@DGBBBADKDAHC@\\JJFBDEH[DEFDH\\LX@XLBLbT@DNJLDCEL@VJABJNDHB@HBHYFBAA@GNFB@@AFB@AFABFLFBHFCL@HJBAFBLC@DN@HN"],encodeOffsets:[[124213,32254]]}},{type:"Feature",id:"310113",properties:{name:"宝山区",cp:[121.4346,31.4051],childNum:1},geometry:{type:"Polygon",coordinates:["@@ˆmÖoÖiƒ½[s[YEUJU`SCIEBCCWJY_LIICDWU@@FaBCJIB[ICH[@@CDKEE@MK@@IMCAEBCH@AMFI@SMGEFGB@FK@BHCAIFJNQD@FEBDFMBKGACG@ECWH@@CDDTOEEBGEK@GC@EE@GPHFR\\JHGA@FDBKRLL]RAFH@FJFDKR@FINBFKDCNEBFJEHK@DLEH\\HFADB@JFFDA@bIJGBEPDBGLI@DDEFBDCHDBIJJFCLIBCL@JKJE@ADHDBHJ@HIBBDFHBBAEIJ@BJFAVL¢ˆ"],encodeOffsets:[[124300,32302]]}},{type:"Feature",id:"310112",properties:{name:"闵行区",cp:[121.4992,31.0838],childNum:1},geometry:{type:"Polygon",coordinates:["@@T@@ELE\\BCMJGJSNEbGdHDJFBJAFIEIFCEWG@@gMENSFCVJFAxR~B@IH@AIiI@GE@FGEAFQPDRiV[\\DFSGMHAXHDOMCJCDETBBNVJJI@DD@ANNNH@FILDDMFBDHNDHKL@XDFGLD@EHGFD@DDB@CDDHCDAEAHG@ABOJ@BIaC@CECLKPFNCDCJBiQEIF@@@OGBMIAEEBMTHF@NKEC@QFEGA@EBCKAACHCLJHEFHHB@AFCAIEACIC@HG@KCCDC[ECEED@KC@KJMAAFQ@GHG@BHIJYIGE@EI@A`KDWCaKcCiY}I}S[CYJM@CFDVPRRVWDFžLBBG`JCFRFEFFHC@RF@HQ`Q@E@ENBDJ@HFCB@DCCEJBBGDGXMPBDGJ@DEDELEDMA@DJF@DMZ_jMNYUUJILCJIJDFGH@TSVM@DLXZ"],encodeOffsets:[[124165,32010]]}},{type:"Feature",id:"310110",properties:{name:"杨浦区",cp:[121.528,31.2966],childNum:1},geometry:{type:"Polygon",coordinates:["@@V@CXJDKJZ`XIDDFADJvSRMDM@mFQHM@KCMKMuaOCU@BDAJSX@HKJGD@PNJCJWAGT@R"],encodeOffsets:[[124402,32064]]}},{type:"Feature",id:"310107",properties:{name:"普陀区",cp:[121.3879,31.2602],childNum:1},geometry:{type:"Polygon",coordinates:["@@F@@FHDL@HFFAPFCSDC@@XGFDH@BDLHNACEFA@ERCIMJEDBAGL@@EHAFENHHJ\\ONQBQCIBC[MKACKI@GGGH@I_G@CW@[DMHCDIBMTDHN@JNHEH@FJFPKFACSBKHDJNABDMDECAFiDEDFDIPG@GLHCNH"],encodeOffsets:[[124248,32045]]}},{type:"Feature",id:"310104",properties:{name:"徐汇区",cp:[121.4333,31.1607],childNum:1},geometry:{type:"Polygon",coordinates:["@@RADL\\NCPHFfLJaJ@FWLGMGIK@IFMDOYYFOTSBI@IMSAMSACFIDNDCPWGGBHNET[CU\\QjOCERFBEHF@@HjJBJG@@J"],encodeOffsets:[[124327,31941]]}},{type:"Feature",id:"310105",properties:{name:"长宁区",cp:[121.3852,31.2115],childNum:1},geometry:{type:"Polygon",coordinates:["@@HFFB@HF@DCAELENSJADCNG\\CX@@D`H@JHGHHJ@BINBFUGEDO[MCKQB}AwQEBUIEDMTNF@hH@FXEDFJEJIB"],encodeOffsets:[[124250,31987]]}},{type:"Feature",id:"310108",properties:{name:"闸北区",cp:[121.4511,31.2794],childNum:1},geometry:{type:"Polygon",coordinates:["@@CSG@BQGODUPWTOBQAAFMECKBGEMFKEOHADDJARMR[PGI@TEJBNG@ADBFND@JL@@NFFCL@D\\@DG\\JJADI"],encodeOffsets:[[124385,32068]]}},{type:"Feature",id:"310109",properties:{name:"虹口区",cp:[121.4882,31.2788],childNum:1},geometry:{type:"Polygon",coordinates:["@@bA@E@QHSXBDIMI@OHCLI@GTWBIACQAYIOFGCENBBARSPOXCVHPARH@DT"],encodeOffsets:[[124385,32068]]}},{type:"Feature",id:"310101",properties:{name:"黄浦区",cp:[121.4868,31.219],childNum:1},geometry:{type:"Polygon",coordinates:["@@NEHFLAFDHDPEAMZUHQQ]IMKJG@EPERABHBGRUCCNGV"],encodeOffsets:[[124379,31992]]}},{type:"Feature",id:"310103",properties:{name:"卢湾区",cp:[121.4758,31.2074],childNum:1},geometry:{type:"Polygon",coordinates:["@@VDHQGABAFQFOH@LIiKKHEXI@IbAFZB"],encodeOffsets:[[124385,31974]]}},{type:"Feature",id:"310106",properties:{name:"静安区",cp:[121.4484,31.2286],childNum:1},geometry:{type:"Polygon",coordinates:["@@DLLB\\NPGLFHUDMYABEeKEVMAAJ"],encodeOffsets:[[124343,31979]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/shan_dong_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3706",properties:{name:"烟台市",cp:[120.7397,37.5128],childNum:9},geometry:{type:"Polygon",coordinates:["@@ŤLšLllVń²è°xżĢĠÆl҄šŤbœ„V¤ĊXnŽlĢVĊ„Òš„È°ĊŰÞè˜L„±@џn»VUźċ²»ÆkôVɆkĊŃ²kŤVVwUUVmUaƒ@KkU@ƒmUmmk@UwUkmW@UVIXa@ƒmw@a™KULƒaƒx@Uk@UbWU@yULmK¯@kXƒVUwm@@JUUknWKUVƒLUbU@™wWykIƒa@w@mUI@ašUVynIWa„k„@@W„bl@@knmƒK@wnIl™°Kna@V¥ğ@ġUķ»™¥@UōJƒX¯¤k@™wmI¯‚k@mwƒak@@šlX@bUJ@VƒbknWxkLkxlŽšLVlkLmŽšb@bU@ƒbU@VbU`Vb@n„L@Žmb—U@˜VnUVmnU@mm™@kIUWVIUK›VkkUJUnmL@VmLUaVWaXamU@™™U@KUUmVƒU—JƒU™VÇwğn™mƒ@mXĉV@l¯xnô"],encodeOffsets:[[122446,38042]]}},{type:"Feature",id:"3713",properties:{name:"临沂市",cp:[118.3118,35.2936],childNum:10},geometry:{type:"Polygon",coordinates:["@@˜bXlƒl@zlV@lXXmŽkbVVlš„U@Vn@@Vmb@XšKšVX„WJ@XXl@„‚ŽÈbVLšUl`„@XXV@VVUxVbUxVbš¦„@‚WnXVJ@bnVUzl@„°Æx„U„KlU@mUUnUlUVWVUnVV@XX°V@Všll@Vk„aXVl@Ux@bmbXLlKlb@b@bUJn@@„„b@n°x°K@an@@UlLVKVbXb@bVVnK°LVa@UVa@™Xw‚KVxnLšU°@naV@UWUkWƒULmV—wÝKUUla@aó_@mƒK@aUU@ƒWUkwVm@aVI°W„@@IUw@a±¯@¥kUVUm@a‚wkw™@ƒK@kVKk@maXalI@alL„WXblaVLVU„V@LnKš@„l@w˜aXašLlnUl„LšmV@n°J@_VmnIVym£UKmI@WnIVm@anUVmÇ_kġIÅWUXÇm@U@ݯÅ@ƒ™@naWƒ™IVW@IkK@klKn@naWIƒmk@ƒaƒbkKkLWn™WkLWmk_ƒ@UaVƒUKmLUw@mn£WwUmU™ƒaóV@UkUm@UKULUwmJUX@WW@XҙzVblJXŽWXk@UVWK—X‚¤UL@xU@ƒ@ƒVUaU@@XmVkLmWkXUyÝLmKXnVŽ@n@l™x@bWLnVVn™`knULmxUl„„WLXŽVb@VƒK@z¯x¯¼Wx™KUn@bk@ƒlƒVVVz"],encodeOffsets:[[120241,36119]]}},{type:"Feature",id:"3707",properties:{name:"潍坊市",cp:[119.0918,36.524],childNum:9},geometry:{type:"Polygon",coordinates:["@@l@@UšK@Ž@L@bX@@VlL@JƒLUVnX@`ÜXn`V²mJ@bU@@n„b@l°xnnĸVƚ°@„ƒĊ£Þ@lWnÑnkʶJmó°w@kk»V@»ƒ¥k@V@kw@wVm„a˜Å„mšaô£ŎƒXI@mln„Kla@mV_UKƒ@kUkw@alW™IU»™mƒ—@WUIl±UUÅU›bkJƒ@a@wUKUaVIÆmXIWaka@m@Ul£XKVw@ƒUIƒJUkmJ™ƒVkU@a„ƒWK—ImVƒ@UxmL@bX`WXU@U`ÇkUak@@°UblXk‚mLUKmL@VULóƒƒVk@@Vlbn@Ub@ċaUJUbƒIUlVLUVVbVKX„VlVXU@mb¯@™VmKUwLWx@šUb@VUb¯KmLUU@aWaUaULkK@Vm@@b¯L¯w@mƒa@ƒm@UUU@U¦lJUXƒVƒmkb@nm„XVWŽkb™IVxUV@VUbWLXVƒLW`Ux@nk@Vn@x@VkJ@œV`mXkŽ@V„xV@lVššI@VULš˜VU„IV`°bVXXx„V@VWVnL@xV„Ub"],encodeOffsets:[[121332,37840]]}},{type:"Feature",id:"3702",properties:{name:"青岛市",cp:[120.4651,36.3373],childNum:6},geometry:{type:"Polygon",coordinates:["@@„@nU˜JXLƒ„@blVU‚š„nIVl„IVJ@„UxWLk¤@V@nlbXbWJÅnUJVbVL@x@b„ŽlIœaÆVVVk²VJ@X„˜šnV¼šJkX@blxlV„@VLU`@nkbƒLkm@nWJō„ó¤™bƒn—ƃbUn@xlxU@l@„¦@¼UŽl¼ĊUnW„@šnĠmÈxšU„V˜I„VnUVV@LšV@šnVWbXb‚UVbnK@UnKVmVIllœUVLUJVXlJš@nnV@nmVUUm@—˜Vna@ƒK@mUaV_UaV@„aV@@a™anlKUk™KklwlKXwlm„a@UVI@akW@™l@„bnxl@°nJšxl@°£„WŎIUÑn»lašmô¹Ŏ¥VaUUkƒmkġWɱIUUŹ`›@kk@ĉƨřV¥_Ç@™Ĭƒ¤ÝL¯m¯£ƽóķwUW±ī¯kōaĉĕ™kğmó°ƒbW@UKkLUaƒVmz@V@ŽUxVn"],encodeOffsets:[[122389,36580]]}},{type:"Feature",id:"3717",properties:{name:"菏泽市",cp:[115.6201,35.2057],childNum:9},geometry:{type:"Polygon",coordinates:["@@@¥šIVUÈmÞ»@UlU@Un@VW@UVmkk@aVUUKVÝ@UVknK@UV@VVnIVƒ@wnƒmwmKXaWaXI@UV@Vy²blkVKkam™U@kb@Um@VmUkmƒKmkXKWwkU@Ulƒ@UnK@UVUUm‚KXwšUVL„w‚K„U„@@Wl@@wUkV¥—@@I@W@_V@VWUw@UUa@aƒaWa—@@_mKUw™l¯amzmV—@WK™nU@kƒWLķaUKbÝVmV@UWÇbÛ@ƒX™°UbW@XŽm„Vlk²UJUbmLÇxÅWUzl‚¯Ll„@VkK™XUbWJ@bU@¯@™ƒkbƒLmKka™„@l™_WšXºVbUz@J‚n²V@¤lX„Ž„nV°šLn`WbXLôVlKVUšxXn˜lXLlU@bVV@„XJWLUVnVV@„„@n‚l„°nn‚V„KÈbVXÆJU°VnXV„kV@@xVL„@šWlb"],encodeOffsets:[[118654,36726]]}},{type:"Feature",id:"3708",properties:{name:"济宁市",cp:[116.8286,35.3375],childNum:11},geometry:{type:"Polygon",coordinates:["@@nam_nKlVLXa„Il`š_@KVVXI@m@w‚ƒ„@@k@Kšnô@n`VbV@@L„L@KVVn@VX@‚VL„Jl„š@VUUƒU@Uam@Uk„wšKWaXamkJmIUVUÈblašUnV@kVKl@@lXL°kVJ@VÈnVJUX@V‚LXl@xVLnU‚@VK„V@a„IUaV@„bĊU„x„K‚kVJXUlV„ƒ„UVašI@WUI@KlUnw„mWk@WXIWƒ™U™L@Wna@Um@@UƒVk™UUlanWW@kkU@y„kWk—aWVUlÝbUU@kƒJUIU@@ƒ™JmaókƒLKǃUUkKWLk@WbkUUaƒbmKn¯°¥V@XwV@VanaVaU_@Wlk@WÈ@VUÈVVۂm„aklKȯlLVUX@lK@aX@@kV@VmV@VwnJV_UWUwƒX™am@kW@wVUkKVIUUVmU@UV@IVK@aUL@aƒV@Lm„UKmx@ŽômLkUWJ@šnXmlUxUL@Vkn›VUšU„@V™L™`Ub±LkV@kUKÇbÛ@ƒU™Wó_mJƒ@Wk@@Xƒ@ƒVLƒxUK™VWxLVnUV@VmL@Vk„@VlVXxWLnl‚Ln„VlUnn@@VlaV@nšlbULkl±aUzU@@VWJXbWbnLnxm„@xU„mJUUU@@VmLUl@VUÞVLUV@bllUn@VUXm@@VkV@VݼÇnUV™J@¦nnƒlnVlL@„Þb°KVV"],encodeOffsets:[[118834,36844]]}},{type:"Feature",id:"3714",properties:{name:"德州市",cp:[116.6858,37.2107],childNum:11},geometry:{type:"Polygon",coordinates:["@@„¤@VmbVXnVVbVJššX@Žll@z„lVInl@„@bVxUbĠ‚l@Èbla„IšxXVWb@L™@n‚ULWVXXšWWLnL@`@LUVVL@lVn„JšU@UUk‚a„™nš‚Vôô„b°¼V‚ސXš˜‚œIÜbČa˜bôW„XÞWÈzÆmnLVJ°ÈnlV²lbnW@™@UƒUV™šmnwmkkKWƒkla@mVIUKUa™aUwmn™JU@@amIk@@bVlkX@mmUklUUƒƒa@_UaUUƒV@wƒw™WkXmW@I@WUaÝU@UXaWUU@UUVW@UUUWUn¥nUVa@m@k@alU@wk™LWa@UUm@@wnmU™wla@anKn_@alK@ݙ_ƒ@@WUUUmlkaƒIƒyU@UwU_Wa¯yU_mWUwkImm@InWWUk@@UVWV—kW¯U@VƒL@b¯b@l±¦@šVV@lUbV„@škxVnUšl¼XV@b@lV@nIWxnbƒ‚™@UU™LƒxÅxm¯ƒaUƒ™wU@mUÅVÝKULm@bmKUXó@"],encodeOffsets:[[118542,37801]]}},{type:"Feature",id:"3716",properties:{name:"滨州市",cp:[117.8174,37.4963],childNum:7},geometry:{type:"Polygon",coordinates:["@@Vb@`„bV„kVlnV@nlWUk@al@nJ@bV@šInmVxšbVbVLUJ@nkb‚lX„lLnlmx™nUš„V@V@šmXn˜lbĸ@nnVx‚b@lnXV@UJ@nVxšxnxVbÆVn¯ƒĕ‚@@wÈçUÇlķVIœb‚@„Çmk@¥k@UkUK@aWakUóJW_UW@wkkWK@U@Kš@XUƒƒUkmUUalKXala@U@kkWlkÈl@kšV„mVIVmU_‚a„ƒƒwnwVW@wƒwUƒ@wU£ƒwkJWIyUI±bk‚VUJ@nmV™Ukl„Xmx@lnbW„kVƒUkLWŽƒxkKUUmUkb™J±—LÇxUKmkUmkkW™™a„mUaVkšJÆ_²KĠ@U„W@w„U‚¥nUWwK@aÝUkÅVaVK@akLWƒƒƒ¯I@bnbVx¯JW„ñšWbUL@šƒŽnV@VmbkUUV@IÇak@@bWak@WJUœJWL@bXV@„‚@„V„Jlb@zUlUŽUImšnbV‚mz@°UV@V™bV@@V@L@xLmKUnmJVX„J@VkLW@UVUL@b"],encodeOffsets:[[120083,38442]]}},{type:"Feature",id:"3715",properties:{name:"聊城市",cp:[115.9167,36.4032],childNum:8},geometry:{type:"Polygon",coordinates:["@@ô@VWnL‚an@VKÞLÆUnVV@šxV„„bn°Æw„wšKVVš@„maXwmJU@@k@aWUk»V™Umlw@™UƒVa@kUU@™²¥@k°a@a„K@U›ƒU@mmm@ów—ѱ¥¯@@w™Kmw—I›¥kU¯UmakJmIUaƒVkKUkm@VUUa™Uƒ@UaƒKUK¯@™w™UVŽUIUKVw™k™¥™wƒbVŽ@xn„@lWnXxlL@`„XlJX¦l°XxW¦@¦Ul™n@Ž™@@Um@@VXVmx@¯bllUnUJ@VULVn@b„xV‚VL@b„„VlnVVblV„ÈnVlIVJœLô„lJ@xl²„"],encodeOffsets:[[118542,37801]]}},{type:"Feature",id:"3705",properties:{name:"东营市",cp:[118.7073,37.5513],childNum:5},geometry:{type:"Polygon",coordinates:["@@ͬUǪlô@°Uœw°ōĠ¯š»Ģ炻XÇ@w™wƑa™ÇƒkwVƑ¯@řķUmm¯w@kƒa@mV@@anIU±m_ÛW@_mWVU„K@IkK@UW@@a@K@™L@Vk@±U@UV@lm@mUU@kLm„„xV¤@xV„„x@xUXmx„xƒ„bV`UnUJƒn™U@lÇkkllX@l@VkbWbkLVbnVVl„„WV™@@L@VXLll@xVXX`ôIlVXb@bVLVll@@¦nlƒÈ@›aUJkĸVÈÇè@x"],encodeOffsets:[[121005,39066]]}},{type:"Feature",id:"3701",properties:{name:"济南市",cp:[117.1582,36.8701],childNum:5},geometry:{type:"Polygon",coordinates:["@@²¦˜Òôxn@nn‚@V‚œ„°VlXU˜UX@Vl@XVmX@JnnlJVxnXV`°zXbV`VxV@„z„JlbkŽVnVV@X„@š`@ÞkL@bm`mL@bkbšxnVm@xn@VV‚@XbšKl@xkV@b@l@nUbmVm¦XVVV@VUXVVV@XVWb@VÞVVb@X@JnXlWšX„x@x„UVV@aVKVUX@lK@UƒIUWnIVmnL‚K@w@K@UU@ša@UVU@¯nyUman™VJVVk@ykaƒIƒU@@ƒWU@aXK‚IV›XIl@Xb@al@Èb@JVUlVna@UmU„@™VKXaò™Xƒ°IUwma@aU@UU@wVW@фw@a™I±`kbƒUkw™UmJ@UkmÇUUkmKknUVƒ@mJUkaWkƒa@KmKkUƒLmyXa¯_@WmImmbƒLmUkVUbUVƒJ™bƒUkkWJkUƒl™IUm™k™Lƒ›„lK@knaVmkI@mWaƒLUK™UU@@VmLUVLWK@UUUƒWUkkVmx@„Vl™¦"],encodeOffsets:[[119014,37041]]}},{type:"Feature",id:"3709",properties:{name:"泰安市",cp:[117.0264,36.0516],childNum:5},geometry:{type:"Polygon",coordinates:["@@n¼šŽW„nxšL@x°@š¥Uk@ƒnwlUVl„XVV@VXL‚KVUnK@UV@šVVL„KXb@nlJUnmb@lkLƒ‚„œšKšlVnšJ„klVXIll„Vša„IVUValUnV„K‚annnJ@X°`Wbnz„KlVnL‚Ž@L„bXl‚bVlnI„@VUU@UmVƒ@U@Uš¥@VmV@@_Ua@m°@@ƒ„kmUUm@UVmn@nX‚@@a„anJVUVL„mlIVJn@nkVLVa@KVmVLXVVLš@@U°bn@VaV@@K@aVkœbWaXUVymU@aUImWXƒ@™¥UaVwUaVwUUU@WWƒ@k_™VUKÇa@ƒƒnmxkV@LVJ@X™JUbƒVƒ„kUWVUIlƒLƒwĉVƒaU@VbƒJ@bƒUUL@mVUK@wWkK@UVWUIÇm@UUI¯lWK@kk@UL@lmU™VkbÇaUVVnJlIn‚WbXb™LƒxVln@VbV@V„UV™@kƒƒIUK@UWm@UU@LƒK@KU@Uam_ó@™m@L@lƒ@„@x@nWJUU@L™`k_ƒJWbUKkmLn`mb"],encodeOffsets:[[118834,36844]]}},{type:"Feature",id:"3710",properties:{name:"威海市",cp:[121.9482,37.1393],childNum:4},geometry:{type:"Polygon",coordinates:["@@VbUnVVUxĊ¼š¼ô@Þф¯‚WǬLŎUÆW„¹Uǃō¯ÑƒÝkţ™™ţóġ™óL™ł̥U™wm¥kÝmkkKóbÝ@U¦@‚mb¯LkšmJ@x„Lmn@lk@ƒa@Xƒ@ƒlXbmJUz™V@bVJ@n@x„blJXzšxV@Va„KVUXLlmVV@In@Vx„UlW°@nLVK@zXVVal@@V„w„bVKšL@bnx@„WbUJ@VnXVlVxl@nnnV@„lV@L„‚"],encodeOffsets:[[124842,38312]]}},{type:"Feature",id:"3711",properties:{name:"日照市",cp:[119.2786,35.5023],childNum:3},geometry:{type:"Polygon",coordinates:["@@UaVUUKVk„JVaVIČb@Vam@ka@Ul@„Uô„VK@UnKVLnKlkWVa@¯l@VbÈlV_V@XWW_@anKVwUmVw@@Uny„UVblKVLX@„aô¯ó¥mÛĊÿÈ¥š™Þ¹lUīƒ¯Kĉ¼ʟbÇV™U™ŽUŽ™XmakJUnmV@bUnmJ@XnJVLn¤UzmJUn@`¯ImŽU@™nƒKVkkm™KWb—b@xƒk™@mL@KƒUUVUKkbWaƒXkK@bkJWbnbl@UL@l„Lš@lxx@b‚nUVlV@¦²°@bVx@Jƒ@¯XUJ@bUnlxVŽ„X@‚VV@b„L@nô`@bkbVVÞL˜xnU"],encodeOffsets:[[121883,36895]]}},{type:"Feature",id:"3703",properties:{name:"淄博市",cp:[118.0371,36.6064],childNum:4},geometry:{type:"Polygon",coordinates:["@@nƒlKV@nVn@@kVU‚@²VVaUƒ@wmKXU@UƒUWwUW¯aU_ƒJUV™—VK@U™JU™@kUƒw@UlnWU_@›lI@U@wUml@@mVwX_„KWUXKVa@UVUUwšJlaXWUnƒ@mla„n„UVWkIV¥V@VVVI@a@akakLWKna@aVwk@WUƒbUlk@™k@U¯UWWU@mUUVUXkVmVVV@nkVƒLƒVÅwƒ¯k@WVXb›aUl@bV@@b@xkVVXVxkJ@nk@@ŽVLUlVb‚VXUVVUzV‚™LVbUbV„VWVkLmškJ@n±@UxU„VVkV@bƒx@ÒUX@xVVV@°J„„X„lK@bULUblÆÞV@b‚LXxmV¦ƒV@xƒXVŽğ@±LÅ`™IUlVbƒnšbXšllVnnlVLÈw˜K²ŽšIlanVVVlL„wXlK„VlUXƒma@knwƒWlkšVnU@mVIUl²aVJ‚zXJlI"],encodeOffsets:[[121129,37891]]}},{type:"Feature",id:"3704",properties:{name:"枣庄市",cp:[117.323,34.8926],childNum:2},geometry:{type:"Polygon",coordinates:["@@‚yUU„U„kl@@aVmšLXw°»°w@y„L@UUaWXKƒƒVknwVKlmš_UmmUXK@ašw@k@mUWmUL@ƒ@™@£@KƒbÝV@akw™aULmƒƒbUK™LUU@lm@—°mL@nUJVxVXU`mIUxU@UnU@@lW@@bkLW@UVkKÇ°kLlŽƒbnUÜÇUUVÇ@@Xkl@XV`UbmbUbU@WxU@¯¦m°nL„aVblVXal@XKlLVVȄ‚L„KôlnbšI@„V@VJ„I@lVVÞaVkXU"],encodeOffsets:[[120241,36119]]}},{type:"Feature",id:"3712",properties:{name:"莱芜市",cp:[117.6526,36.2714],childNum:1},geometry:{type:"Polygon",coordinates:["@@lmnLVlÈVln@VnIšVlx„Vla²_šJlUUUVƒVw²@@mlIn™lKXU‚UUƒVaUašKUVyUUWVUUaVkUK@l@@mlIUwUWlU@w@aU@@LU@Ubm@¯a@V™@UKWUUKUn@LUbUKmlm@UIkJƒnUKUVmIƒb@b@mWm@Un@VVnnVƒl@„¯@@nVb@`U@Un@Ž™¦@V@VU„VnV@"],encodeOffsets:[[120173,37334]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/shan_xi_1_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"6108",properties:{name:"榆林市",cp:[109.8743,38.205],childNum:12},geometry:{type:"Polygon",coordinates:["@@™ýVƒnIW»ƒW@»kUÇL—݃U¯¥ÇIUWWїUWwX¯mƒ@»n@ÜÈķô™@a±kȱƒw„ÑmwçċmU»ÆkkVyIm™ĉÿ@ƒÝ¹ƒWnwÇVš™Åaƒzmmĉ¦ó™kVmx™xU¼VškVm_UlVlk„°IV‚kmJa›¦k™™LmmV@XmKnšlUô›VXbƒbƒ@UaÇLğܙ™Åwƒ£mKnmċwÅ@UkƒbmaVƒƒƒn@m¯aU™Jm_k˜@kWXyl@@kÅamw™LU™Þ™ƒ™mWÅzUKƒš™Uk±@™b@nnK‚bX¤mzVšŽVxÇn„‚¯„@ÒknWƒƒVUbkķÈÑWkk@Va™™U@„mUkbƒÝÅ@Ý¥ÇbkĬ™XV`kLǍVmalUUa™nV±nwmkƒJ@Inƒ°KVw¯UnÅ@¥™ƒ™U±bUU˜±œmWbÛKWnUm`UƒVK@bmnœm‚Èż@V„L@xƒxmš„Ť°nŽ@VmK™²VlšlKk„ô@„êÜV@VXLlmš¦UššV°Ș¯²ÿ@¥š@ƁĊ˜²IšmĶnnb°b„KVƒĸLl„Þ@UȮš™Ü°IVƒÞÝސlŽœx@ŽķĀWŽ„Ux„èƐ@š°ŽXnšlĊĖ°m„nƒšV„²V°ÒƦ„aބ„˜@zll@bÞĀšlš¼nKĊ¼óȂb²±šIǪÒ¯ĖV@„lxnVlk„JlaXwŌĉ„„@VnŽššlÆĕ„UÆLœèŌŤôxȚlUœ@šxlaUċĕXm„IWmnkšVVƒ„VW_@aÈWUUmk@ƒ¯çVm»™±W¯n¥V™mkXw±ÇVwƒ"],encodeOffsets:[[113592,39645]]}},{type:"Feature",id:"6106",properties:{name:"延安市",cp:[109.1052,36.4252],childNum:13},geometry:{type:"Polygon",coordinates:["@@@kkÇmIšmUwVkUƒƒU²WmšVkm@m`mIĢĕUƒVa@™mXƒƒÿVVkyUýšĕ@l_UmnƒW„KVkţ™™¥™aƒwğ@™@aôƒ„ƒWa„kUmƒa¯¯™a±£kx™mmxUwÝ@xmU™b¯K™wó„Ý@kmm¹Ub@lklVbmnnVUV@x›UknƧJUX@ŽƒLÇWkw™LķƧÅwWJk„ƒLkþĉxWz™JUnǚkš@Ɛk¼ÜÔÈKšè@°lșÆk¦l„n@l¼@l¯L™°UU™VÇ°ƒ¹—`m¼mXk‚™bUaƒV@U¯x@¦™Ç™„UUmlmUVm„nnmlkw™@@šƒ¦Å‚ÇLmx¯Iklš„@¦mÆ°VUx¯Lm„@J„InlmxU²šmVbkV‚bUnȎlKU_šWlīÈaÞ¦Æ@„ÞlanV@ƒšVšUbl@XlÇÒĸlŽVa„UX„lm@Ñ°ƒƒÈmUw‚U™nyW£amL@mša²@lšV„™VLÆynX„šÝšVššKnxÆb@lk@WzXŽ@ll—n`šIV‚°b@n„m„„‚Unb„aVlÆ@ČxmnnL„¤ÆxššĠÛÈKVb„@„aWaœU‚ókVm™nL@W‚UnnšKlšœ¥‚bnIlU¯JlƒUkVkn`lUU™V»šwnwlUôšĊ¥nn„yÆb"],encodeOffsets:[[113074,37862]]}},{type:"Feature",id:"6107",properties:{name:"汉中市",cp:[106.886,33.0139],childNum:11},geometry:{type:"Polygon",coordinates:["@@lKnb@n„lWb°bkxĸwVb@ł„nlŽ„ƒĊ¥šL@XŽl™ÈƒVblÈK‚b„akVwôml²`‚nœ@‚nVKœl˜k²xŎƒ°¦VU„JĊw@çnWçރVkUóÛ@¥kwš™šUmƒX¯WšÑkƒ@UymIUwlUn¥‚mUk²a°¯V»@™ÝVș„ÝċÅÅVl»@l@a°±@_kammÅb™a@ƒƒm@ż™KknõĠ—@mšƒ„¯LÅw›‚—LVxmb@¼kV™@mw¯wVakKW»X±¼¯Vkxƒb„¼WŽ@nx@x±bóakbƒ@ÝmU™@ķÓÛL™kƒVUm™k¯¤ÝLUlÝ@Ýz™š„x@x™°™™™bƒmƒX¯aUJW¯—k@bÇWƒwÛwWxƒ@XWlb@Žƒ„VŽÈUlwšLnl°VlUô¦œU°¤VšUxVXUxlbkVVlƒI„°„ÅVlU°m@k„ÇU¯xUlƒLUlVL@b™°ĠInĠ°ÈnK‚„@xÞa²n‚aUyšXUKVkšWô¼Èa‚z°JXUVÇV_„JVƒšz@Žnb"],encodeOffsets:[[109137,34392]]}},{type:"Feature",id:"6109",properties:{name:"安康市",cp:[109.1162,32.7722],childNum:10},geometry:{type:"Polygon",coordinates:["@@„bĊaƨèšwôô„¼šb°ašXVƒÞVUÞ@‚aXƒm¥kImx¯¯ƒV@anU@UÇéğL@ƒ¯¥V£mƒ@ÝÈb„K‚™„X°wČÿ˜ƒ„b@xÈblxȯĊ„„mÆUVƒ„nÈ@ƨÜLĢ¥ƒŹnƒ°Vnn˜K„aô_ȃšwU‚aXmnW‚¯kl›LXƒÇ™ō¦ÝaÅVmbğUn¥±wÅéVƒan¥ƒ„U„»°am¥„£ƒÝ@ƒ„wVw™¥nU„уUmmVwmķIÅaóVWxkblb@ból@œğÒĉ¤ċXƒ˜¯X™xk„Ç@óÆÅx@š™xķ_kmݎǣkblb@`¯²@bk‚‚@k¼ÆUČƃÞǚÞU@šU¼¯°±bVlnm¦kVVxnJVz@‚l„™ÒXW°n„™V™šlx@¦ôÜVUl݄Xèm@è"],encodeOffsets:[[110644,34521]]}},{type:"Feature",id:"6110",properties:{name:"商洛市",cp:[109.8083,33.761],childNum:7},geometry:{type:"Polygon",coordinates:["@@²nl‚ôbš„°aVwnKÞIš`°wšXôw°VĊ°@ŽÅš„ÞÆV„zÞK@xšŽ@a‚LŚ@b@ŽnLlƒ@šln„mnLVw„a„bVƒ‚VnbU¼„Vƒ°„bl„šbÈ@ĶŦb˜@nÇ@amIyUI@ĠVmôƒU™ƒVwkwlanJ„¯lwó¥@an°Jš_„‚@š™nóƒó@£l¥UwmašÑ@ƒUm±V_ƒJ—£›J—UW¥¯@ƒ_k¯¼mUƒVUè¯b@wmL™»ğVmağI¯¤ċIUW™XƒKĵ¦ķaƒJUb™IƒlUóVmk@WÅÅÇ@ƒmU„ÅVƒnĉƒÇ°kwÇa@wƒa—„ċĀ¯xƒWšƒLÇa@Þn„U¤°¦@„ĠKÈê@VmV@b„U°°nwlJn¦W„bÝ@VŽ"],encodeOffsets:[[111454,34628]]}},{type:"Feature",id:"6103",properties:{name:"宝鸡市",cp:[107.1826,34.3433],childNum:10},geometry:{type:"Polygon",coordinates:["@@@ƒ„£@›°Išb@¯°ynŹƒaUƒlƒU£„Umšĵĉ@@ylUÞ@@£kWU¯WaU£¯ÇV¥ƒ@kb¯wƒn™¥ÇkUÇnUƒ@¯±›kULm›@m±_kŽónUxlŽƒbaÇLkŽUaDŽkšW@™Kĉ¦ƒ„kƒm@ŁUaķxlw¯aXaƒk@mmakL@šmšÛŽ@¼m„@l„XV`ƒn™KUš°°@²š¤UÈ@VxmôƒxKl„VV²aVw„Xla„Vlx@UVnŽÇnk°ƒVVL™lkI™šƒJÇk¯V@šknƘn@lznmlVkzVŽ„VVxš@Ux„z@x±¼VxxU„l‚kb˜@„¼Čk˜VXlĠkôV²w‚LUKlwœJ@a‚IV¥Þƒn¯Ün„‚„@nk˜l²kÆ@š°„aVbnI@™š‚Ťn"],encodeOffsets:[[110408,35815]]}},{type:"Feature",id:"6105",properties:{name:"渭南市",cp:[109.7864,35.0299],childNum:11},geometry:{type:"Polygon",coordinates:["@@@ÈôL„xUŽ°„Þ@mŽÈnl¤nUôL‚wX`@ÞÝL™ŽUšmLô„„ŽôbVbnºlnÞ@ôƒšx°LšanV‚wÞ@Vxnwšnlw²¤šb°°„bVnƒlXbƒ„ó„@bš‚Ġ@„xšbš¦ŤšV™Xġ„£W¥ƽɽƒó@ýóƝÝ»„£X™mƅšĊkUƒ„@™™šó„kťaĵŽÇ@™akƒƒa„¯ƒUV»maUU„ƒaƒbUxmKƒnkm@™k„mK@ƒxó@¯n¯KǦ@ôÅèlxkx°nƒƾ¯KU¯WķL@VÝIUb™yWbX¼Ç°"],encodeOffsets:[[111589,35657]]}},{type:"Feature",id:"6104",properties:{name:"咸阳市",cp:[108.4131,34.8706],childNum:14},geometry:{type:"Polygon",coordinates:["@@šIXyĊwlý„KlƒXIVaķƒ™»a›£„¯aVU@a™‚wÈō‚ašL²»‚VœUln°WȯW»XašzVaÞJ@Uƒ»@¯Ýbğwly@£kÑţ±Wу@ka™IUƒƒnƒ@¯ƒómţU™b™U¯lÇIÝb@¤Ý@kV@zĊ@™ĶnƒVV¤k„V„„bmź¯z@°™a¯J@œƒ¤@„„bUx™bƒ„@`™xUÔ±ºVXœW‚„UnUJ‚LĢ¯ÈKlblmÈXŎ°šU„°LšŽlkÞKš@Èxl_°ĶUÒkblš"],encodeOffsets:[[111229,36394]]}},{type:"Feature",id:"6101",properties:{name:"西安市",cp:[109.1162,34.2004],childNum:5},geometry:{type:"Polygon",coordinates:["@@°²@‚„mVVÈÈlš¦„m°xla„@U¦°ÈV¤XbV°lXÞaÈJ°kšVšaŤVôn°„„@„mV„šJlb„@XÒŤ²lÒ@¤kzĠxÞa@°„¼ĸK°XV‚°L„ƽ¯mlwkwÆç@óÈ¥°L°mô@„w@aƙK@b™@wÝLƒyÅUƒÝƙ@ĉ¯¯Uóx™W¯x™_ÝJmLUx¯b™ƒóak±mÝUU„™W¯b™aƒ»óó™xƧçĉbƒaĉxƒIUV¯¥ō„±w—l"],encodeOffsets:[[110206,34532]]}},{type:"Feature",id:"6102",properties:{name:"铜川市",cp:[109.0393,35.1947],childNum:2},geometry:{type:"Polygon",coordinates:["@@ÆxĸƨšKlxÈX„K@VWƨIlmœV@wVUmUnmUalk@kVaUaóaƒóƒnKV™šÞK@ÝW_xóKmVk£ÇmnÝ@¯ƒVƒwóK@ǯXkm›VU±¼™KbÇŎx‚š@bUV°bƒœ¤‚bš¼ĸ„Ub"],encodeOffsets:[[111477,36192]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/shan_xi_2_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"1409",properties:{name:"忻州市",cp:[112.4561,38.8971],childNum:14},geometry:{type:"Polygon",coordinates:["@@Vx@lnbn¦WlnnUšmš°š²VšV‚VVVnUn„ºlz@l„„@Jƒ@kXWVXl@Lƒa@„ƒKUL„ŽlbnKlLnK‚LnKÆXn°šbVV@bUVl°Un@LnaVJUbW@UX²l‚@ČwlVVIšWnkÆa°„„anV‚Kn°™UW¯@™aVUVk@Un@„aV@ValwUanmWU„k@WVUUanaVwnLVl°@nk@mVU@UVK@w„LVKVU@ƒ„K@UUKVUV@@bnL„a‚V„aôšlIXmlKX_°KVV@bVV„@šzV`kblI„V„Ul‚šL@bnV@V„Ċll„„VlIXW@k„a‚U²blKšVnIlJ„albXXlWVn°JnšnL@l@XlJlaX@„X˜W²@l_VmnKšU„blU@mnkVK„¯@U@ƒma@kX¥VƒmakkƒLƒa@aƒ@WIUUVXWWnk@a°a@kkm@kUUmJm@WUUUIk`m@V—kaWWkX™KmƒXk¯ƒ@WKƒLkak@±bƒw@ƒaƒa@akaƒ@ma¯@ƒL—KÇÅkKWbkmġ™±ÅUƒLUK™VVkƒm¯LUVVbƒ„UwUW¯bm„ƒULƒxWJ—@ƒklmkUm@@KnwVkVK@akwƒ@@a¯bƒKkn›VUI™b¯mmbk@UbmKUL@xUUƒ@klmLUŽlVXI‚VVVUVUœU`mLXVWbXnW`Ų°xmŽxU@mĉƒƒwU@mbU@UƒmbkVW¦kJ™@ƒX@`¯Im@UlUVVnb@bWJXnmbƒJUU™UUaƒ@UamIkaƒxƒ@@x@b"],encodeOffsets:[[113614,39657]]}},{type:"Feature",id:"1411",properties:{name:"吕梁市",cp:[111.3574,37.7325],childNum:13},geometry:{type:"Polygon",coordinates:["@@@a@w„@„wlbnJVb„@VbšVVV„InaWmXI@a‚aUmVUVkn@°J@_„Wš@lIX¥lUnaV„V@naV@„xĊ„n‚V@‚wn¯wƱX_WmXaWUnKV_V›VUUUUWJkUVnKlk¯™@@kmKUaŁ±KkU@WmI@WUIlUUmVwXƒ‚w@ƒUlUVwœV‚@„Lnb‚W@anU@UšaVkô@l»n@na˜JnUÈLVaƃUUVm„VKVƒ²L@mU_lK@UVWkU‚a@a@U¯aUaƒÑóÑUb™„ƒKk@@aƒk¯mVaUwVƒÑkWUmK@UUKmXUWÝwUa™LUU@aWJUUU@Ua݄U@WL@VKVaVI@WnU@alIVKƒƒ@kIƒmIkJ@™m@ƒ™@@_™K@xƒ@kaW@U„@Vmn@ŽUK@mIƒJUXV¤XXWlkKƒkkK@XmJVakImJU@ó™¯LWKUV@nUVƒLkxmKkLma@kXKmmƒLƒab™LmK@V@mXVÆUxƒX@`nL„aV@@VmLUVnLlLš˜„b@„šŽ°²nx@b‚VUxlb@V¯bUV@zV‚XVĊXVx@lVn@VnnmŽUš@LlJXVƒz¯VWVXbšV@bmn™VUVk„Çþń@XVxmbUlV„Uln„W„@„Xl‚@VLXÒ@bÞJ°¦„L˜ò„@nU‚b@°„X@ŽXbmVU„V„nb@x‚x"],encodeOffsets:[[113614,39657]]}},{type:"Feature",id:"1410",properties:{name:"临汾市",cp:[111.4783,36.1615],childNum:17},geometry:{type:"Polygon",coordinates:["@@nW‚@@UnLšK‚a„b„KnnWL@lnblKnLlw„KVU@mVUXL°KôšV@nIlJUbnI@WlL„llLXkWWU£VW„InJ‚@VL@nm@UVƒX@lb„@@wšL@`‚@„šn@V@lw„@n„VmVX„WmwnUlƒœa@_lK„wVlUn°xVKVXXWlUšVVI@K@K„n°KœwlVlU@kna@V_„Wn‚m„UVm@kXml_@m„LlKXw°m@_ôJVUV@X™l@UaV@Va°I„lk»VwUkVmwUmmVn@V¯@KƒU—wmK@U¯wUVÝ@mJƒU—nWK™@@UnKVa„_lykUmKÛnm@™x@ƒUUlwVk™ƒXW@ƒa@Uƒ@@K@ƒkIV™nammVakUlƒ@wX@@kƒ™¯@ƒVVbml@„„°UbULmlVbnbÅK±VƒKVXUJWa@ULWaUU@@U@aWK@UkxUKƒLUUUJ±UkL@V±kk@kam@UV@l@LWl@n@VVUx„LlUUx@VUV™U@aƒIUl™L@°mLU‚ƒbkUUaWUUaUU@aWK—LWJ@bUL@VUVVbU@m@a@kmKmnĉlUK™XƒWUblb—xmIkƒƒU@xWb@lkšVx™LXŽmzVV@bklVVUzm˜@bk„@Vx@xlŽU„@lUbVnl@„Wxnl@n@ŽUbV„mL‚mƒb@`X@lUX@@xlnkLWaUJnnWV™Vn@l„@bULVV@l™V@XnJVX"],encodeOffsets:[[113063,37784]]}},{type:"Feature",id:"1407",properties:{name:"晋中市",cp:[112.7747,37.37],childNum:11},geometry:{type:"Polygon",coordinates:["@@@šlInJ„lJ„@‚„ULkJ@bmV@XUJUb‚L@UXKV@ރVbV@VVXI@bVVšKVbÞxVXnWVL@VnLV‚lX„ÒUŽVxUb°n„l@bl@„LšƒVaô҄ÒVb°b@VnLnnV@lmn@lb„U„V@„‚JœUVV‚Xkl@lUzmJ@xšXkl‚bUn„JVšUb„nU‚lb„V@nlLX@lakšV`Ub°š@XVJnU‚L²KlxnI@KV@lbUbVV„KnVl@„zlm@Uš@nŽšI@WUaVl@@mVU„@XkW@ƒnkVKVƒ„_Vw„y@knwVa‚@XalU„@šVnml@„X@V„L‚KVaÞbnnlJšI„mVKn„VVVInVlU„@„m@™mXK@UmyUI@mWUUakamw@wUwmLkakwVƒmK™w@wUam£y@am_ƒW@™UU@knmm„amU@WUa@knw@ƒUUUUV@nƒJm@mVUkKVUUUkKmwƒKULƒKUImV@lUn™nŽm@mbUK@°™bUnmbUmkkƒWUb@am@UXkK@a±@™V™@ĉř„V‚UXVxUVkLWl¯@@bULUlm@@nm`—XƒlWakIkm›VUbUL@Vm@kIƒ@@Kšm@—VaX‚I@W@aU@kUƒVU_™KƒbƒJkkǎ™b@nkKmL™wÅW@kVUUƒVU@WUIƒJmIXmma@_kyVaUUlkUm@ƒkU›x¯Lƒm@L@LUJ™UkVWXUWUL¯wVmUkƒxkL@`›bk„mVnxƒXUWUnmƒƒ@kxU@"],encodeOffsets:[[114087,37682]]}},{type:"Feature",id:"1408",properties:{name:"运城市",cp:[111.1487,35.2002],childNum:13},geometry:{type:"Polygon",coordinates:["@@„Vl„nJ˜wkaVa„XšWVLĊknmnL‚l@@bn‚V@UaVU@UVK@aXI˜KXL@bVVVbXVVblV„aVnK@¯šKVk„J@bšVVU@UVwkVƒKVwUUm@@Xk@K@kVUn@lbl@²l@UlK²VVIVV„KVLlw@VXL@b@VV@VŽXbVK‚@XbVIUW„L‚U²ÆLmaUankVKVaƒ¯@ƒnkUa„U°@„š‚n@@kWa„UVaXUW@IXKVw@U™ƒ„™WU@W@@UUƒU@mn@ƒ`m@UUULkUmJ™IUƒ@@UƒK@U@›anƒ™ak_@wmKUwmakV™kmK™V™k¯b™wƒ`kwUIÇx¯»ÇaŃmn@@™mƒmUkV@wkKW@kxmL™UkĉLÝk™xÝw¯lóVU„mV@ĀVVX¦W¤kz@`Vx°„²ĸ‚š@„Ul@x„êĸNJ°¤V„VlXLWnXxmV@nUl@„"],encodeOffsets:[[113232,36597]]}},{type:"Feature",id:"1402",properties:{name:"大同市",cp:[113.7854,39.8035],childNum:8},geometry:{type:"Polygon",coordinates:["@@²£šyl@Ȑ˜Ė@bĸŽĢbĸ„˜X„a‚KŤnn@ŎôllÈx„nVnÞDŽV@b‚nXllL°KšbVb@J@b—„‚„@ŽU„„xlKXLlKlXk„@Ulk„JlkUƒVKXUƒÇVIVm@_nǚLšašl‚w„VnU@UUwma@aƒaÝaLmUk@@Wƒ@U@@X™wVWÝUUUk@@VmLƒKV»nwUw™aUL@`mzƒJUIVƒUaUw™KUaVIlJôanÑlLVUn@ša„@VV„@@UUwVK°Vn_lJÆLœéW@UUUÅ@»lm@aÞIVwXW˜UUkkm@U@aƒU@mwU£VWU_kWmƒXwW_°yUkkK@UÇK@kkUVymóK—U@KWIƒbUak@mJ@bkbmLkŽ™UmƒkVU„W¦@lnb@„@Vƒ°ULml@nkVƒa™VmLUnk`±@—XƒWW@kbǦXŽ¯„WxI@xmbmxXlWV„„@bŎUz@J‚b@bÞb™ŽU@Wbk@ƒxk@WX¯VۙƒWÝbÝUkVUU@alI@a@akLWa™m@U¯UUmÇL@K@aU@¯VUkƒKmX@`@œkJ@nV‚Ub@lbVÆXVW„ULU`VbkLUV@XWl@bXJ˜@VbV@Vl"],encodeOffsets:[[115335,41209]]}},{type:"Feature",id:"1404",properties:{name:"长治市",cp:[112.8625,36.4746],childNum:12},geometry:{type:"Polygon",coordinates:["@@Uk™Lky@I‚JVa@mÞaWšy@_W@_WƒXVlUVwš@nw°K@m„UƒVaƒmVkU@mmmnLVUmKXa™U@IlKVUnK@UmWkX@WV_Vƒ@akU@a„KWIXyƒIUVmUn™Ua@WaXUVKVmkUWVkUƒLU@@VƒbƒKbƒIUmƒ@mbVL—x›WUUkn±V¯wƒbÅJUbmLkbmKÅKƒbVnUbƒV™KUb™KUbmLKmƒb™aƒKkUm@UŽnn‚VnxUVlUxl¼ƒk¯JUbU@Vbk@WšU@UVóI@`¯nWxkLƒK@nk`Wn@lUnƒVnm‚ƒXU`@mb@lkV@„VnklVVUblz@`nbWnnJ„IVJ@XUVV„UV@lÆXšxnKlL@mšaȍll„I„ašLV`„UlVV@@b@XJWUb@˜™n@L„@lJn@@UVKVaœUlnlJXb„k˜Wn_@mn@VkVK@a°@XklKVUUwVWUšƒĊƚ@šU²@@blLVWn@@bVa„XllVnnaVmša@¯VLnan@‚šmVm@knUVJ"],encodeOffsets:[[116269,37637]]}},{type:"Feature",id:"1406",properties:{name:"朔州市",cp:[113.0713,39.6991],childNum:5},geometry:{type:"Polygon",coordinates:["@@XXWVXVWnnlnn@èƼ@„„xlš„ŽV„nblšššVŽÈUVl‚š@„blnœL܃ĊmUkU@Ua‚—@WI@aXk@WVUlKUaV_VKXƒWUUÅka@VaU@mlI@›@_nW„LVl°UV@@b@LÈKVn°V@VšnXblK@b@bkJ@bVVlUÞVÞa„Xܚ°UXWl@„wl@XaV@šÝa@aa@IVyƍ@aƒƒXUWknwna@w‚JXw°ƒWÈ¥kI@W@kmKm™¯IUmkXWWkaƒbkImJ™UkL±aVƒb@lWXkJƒUkƒĉkƒ@UmU@a™KkƒVƒUkJlaU_™yƒ@UU@aUU¯LW`kLWnkJó™ƒbUƒbmK@aU@UVVL@VƒL@„UVULƒK@xUL@VUV@nml¯@UkmKUxmbVbUV@XƒlXVmnVbkxUbU@ƒbm@@VUlUVšb°@VX¯šm‚"],encodeOffsets:[[114615,40562]]}},{type:"Feature",id:"1405",properties:{name:"晋城市",cp:[112.7856,35.6342],childNum:6},geometry:{type:"Polygon",coordinates:["@@lV„Lšb„an‚LnKVašLVašL„UVaUm„aÆLnLlanKVaÆI„a°x²UlmVVœX˜wUKna„@Vn„J‚a„L„a@UV@@alUkKVKnkmmVwUk„w@ƒ™@kxWUXƒW@@mƒk@aUa@a¯aƒLkKmwkUm@kL@K@aWIXmƒVƒXƒWkUVakL@UVKƒw@aUK@UUKmLU@¯n™KUwVƒUIWJUWmka™@UXƒJƒk@UkmW@kLWKVƒx@bmI@VUaVU@a¯@UUmVKmX@±`kÝKVxUL±akL@V™bƒLkKmVƒ@XWVUbƒVXb@lm@@lW@@xk„lVUbnnmbUšlJ@„@L„@@V„b@‚WXš„UlkxVV@„šwn@ÜmnLlVkzƒ`UbmL@Vš@XL˜m„VnIÞ@VU°x@VnL˜x„V@LU°"],encodeOffsets:[[115223,36895]]}},{type:"Feature",id:"1401",properties:{name:"太原市",cp:[112.3352,37.9413],childNum:5},geometry:{type:"Polygon",coordinates:["@@„@VV@wVKnLVal@na°nšaVJœUlm„L°a@b„@lx@bULUlmx@Ln@lVkn„l˜@XI„w‚K„Vnƒ°aVXVx„ƒUaVU°K„nUlšUVL„KÆVš²Ģ‚lnXalLÈƘL„KUaVkUanmWU™a@WwkUWU¯y¯Ñ@anIl@@aVU„m„I„ymUƒLUUVakaU@@LmJkw±LKmVUI@W¯™VaU_l™kbW@kK@mƒUkaVƒmVaU™ƒIVmalk™W@wnIVy@klkWUU›VI@ƒƒUƒVkam@knU@mmmK@bblVUX@VkLV`@n±KU„ULƒ‚UnVVńUbÇKmV—Imbm@k¼ó@Ul™b@VmV@bXmaƒK@›UUxkV‚V@„xW„UxVnkVVJ@XnJ@XlV²LƂVbnL@lš@°"],encodeOffsets:[[114503,39134]]}},{type:"Feature",id:"1403",properties:{name:"阳泉市",cp:[113.4778,38.0951],childNum:3},geometry:{type:"Polygon",coordinates:["@@°@nb„@lb@b„b„b‚@„x²al@lb„KXU@m‚kUWkkmUUƒVwV@XUW@™naVklKXblKnL‚ƒnLVanImaXKlL„ašV@U@KUKW„alƒXK@£WKXUV@VU„ƒUUVW„_V™@W@@K„@šƒUƒƒIWmXUmƒULƒn™JkImmÝaUbLƒK@UƒWk@mn™Uƒ@kVWb@Ubmx@lƒzUxƒ`U„ULml@„XWlƒ@UV@nk@U‚Vb@X™Jm™@@Vknƒyk@ƒzƒJƒnUV@bk@mJ@b°Ò°zXVlVXx‚@šbXVmnVbUlVb"],encodeOffsets:[[115864,39336]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/si_chuan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"5133",properties:{name:"甘孜藏族自治州",cp:[99.9207,31.0803],childNum:18},geometry:{type:"Polygon",coordinates:["@@ƒaXamƒ¯wm@±°wUwV@UaVw²Kš™„U@UƒU„¥‚a„ƒ@£Þ™ôx‚Knkm™X¥™IUƒÝUwlk°V„@ƒÈ™‚KUwlkUyV¹„mšx²Xll„ÑW»š„l„w°UŎ„nƒ„„˜Jœƒl¯°V@wôIVÇn™nUllšLšVǚLô¼XW£@±„@¥k_ÇJƒkUéƒkšƒƒwXa@ƒšLlw²™Vx„b‚mš¼ÈxlLȃ„VWÞn¯mǙÑUÝlÛkwlĉmƒULmwUJ™ç@wkm@ÑlUX™ƒÑôġƒVa™ƒUф¯@wķÓkbV„mnU@@y¯IķKƒV@¹šaƒé@k„mÞU°¥@a¯@anKlblU„¥@óğç@Çw@wkla„çݱk¯±@ğÝUÛmݯwƒ@kb±¯akXWÜkXUÆÇUš¤X_Ɛw„V@¤ƒXU‚ƒbUƒŽƒIUlÇUkŽġ@™aXČmlUlèUV@„mVk¦Vxš@¦±š¯ƒƒ¯¯anlWš¯nƒƒÅw@w°KVak£m@klƒKknÇU™»óKšīlaUaV£@™™¯@ƙU™VƒÛÝÇXƒÇl—ÓlŹ„»WUğJ¯£mx™Lĵô›ºX„VlUll²bl„„lŽƒxónn°ÝšU¼mJUš¯nƒƒƒV@êĉ°Uĸ™w™@mƒ@¯kmXamѯaUwÝKU¥„mÅn¥Wmn™ƒ¹n±ƑƆÇôXê±NJnšƒ‚UôlĖkȂVÒ¯¼VnƒȮ¯ĀnƆ˜Ģ@Žk°V°¯ĢVlkšVxm¼X²™Ŏ@ŽVxknWÜ°U‚¯n™Æݜ@`„ôݲÒƒ‚Çzn‚mX@x„è°K°Å„UČĬóĖ݄ƒ˜ó¼ÅêƒÒƒbmšk@V„Ž˜„@ҁl@nĉܛê—x@Ėml՛J¯¦óxȭ°ÝmŽ¯Lĵè›Ā@Ɓ„l°żƒ‚šX@xmŽkV@z@‚„°blŽnÞ°J@bn@ƼUVƒUóŽóLƒ°X°ÝLƒxUn„°ƒĬƒn@lnL@ŽÆ@šn„KÆxnUnV˜InĬmÆnxŎ¼ĊIĢóÞ@ĊƒƨbUƒ‚mV¥lkƒ‚wnL„mšÅÆ¥Xƒ˜wU@w‚wUÞ™@alUUŚU™Vkkm°aU—°Ó°w°U„ƒ„b°aš²K˜¯œĕ˜@ÈbޏĊaš»„XVm°In„‚Ĭk¼Vb„ašJšôš£VĊan™‚k„ů™™nƒÜU@anKnĮ‚bÈmƎš»nI‚霣Ġ™"],encodeOffsets:[[103073,33295]]}},{type:"Feature",id:"5132",properties:{name:"阿坝藏族羌族自治州",cp:[102.4805,32.4536],childNum:13},geometry:{type:"Polygon",coordinates:["@@l@@þ²I@lƒ„VL°wnJ°Uĸ™Ŏè„Ilw„V°¤nĮ™¤Ý„lè„L@„ƒ„@x„l™è²ôĊ_ĊġVÈôJżīlbXšÆÈVŽkxÇVƒ„n°„¦Üb@è@nn@@°šUÈ¥WDŽ_Uala¯¯UǙkƒ»„mVwk»˜k²°VxlL@¤œ_@x‚`ȍ‚Ėöb˜š@l²alX„a@bnK°¦VK@nnWmx@nUnl@@lƒlĉk°l°UXkmW@Unš`k„ÇL„ŽW„ÛÈVxšVVlVk@l„IXb@ylXÈW˜Į„WŤzœy@šmIƒŽ²šJ‚š@nŽ°@V„„J°a„Å@ƒŎkVǚk™aUw„KVw™™Vƒ„@nkm™@±ôkô™ĊJš¼šInÑm±nIššÞ‚XȃĊxĊUÈbÜyÈ£Vkw@kVUV™„m@ša„»ÜbÈmƒUXwÝxƒUn¥@°ġ™Å‚aœJVk™aW¯Û@W¥—UŏĶ™@¯kUƒŃ@ašI@mmanwސ‚W@œ™mw°»Uřk¹±W„xVx¯¦U°ƒzţW™w@°ÇVÑk¯@„y°aš£š@šmšnl¼„ašÝÝakwUƒ±aĉImlĵn@ƒm@kkVƒ¯Ñm™ĸ™°x„l™œ@˜ƒXVÞmlÛݙĉUÅ¥mwÅ¥VaUw›™XġċaVůÛŹlwU¯U™ó±™xÛV±¯¯n¯mċƒLmnĊm‚™@™_kJWaXmwUƒĉK™»™@mwX݃UDŽkKÇw™»nƒaUw±škx™K@„Wb„x™„„lVê„lÈIl`@¦ƒŽ@²X¤Wó»™KUșŽ™KkkmVmšUÈóJ@x¯Uk°›„—Iƒƒm„ōƒ¯Vƒxƒk™ŽX¼ƒÒkk±W™wƒnUºVzklVxLǚ@„ƒŽ¯UklVxސV„šJW¦nšmlLówݚ@¤ƒ„bƒ¦„V@VƒV™š±LUxVbU@Vx¯x@²n‚°xn„Wb„b"],encodeOffsets:[[103073,33295]]}},{type:"Feature",id:"5134",properties:{name:"凉山彝族自治州",cp:[101.9641,27.6746],childNum:17},geometry:{type:"Polygon",coordinates:["@@ĶóšKnw°¤ĠIXVƒ¼kź˜Ôk‚„ÈWŽÞȄÜUVšÅš°@šš‚@U¤Vbkb™ĬôLš¼ÈVlm„Llkn@l¤Ub¯L@xÆx„„°mX™mk°b„°°„²™@¥‚™Uwl¥nU@ƒVUkçVnkWċšbĢ@lÈVVk„J„‚V„aV„W@£ƒUƏxW`™£ÈVVÅlWXÛlW°b²la„@°xnÞVÜĠÞ²@l°Þ²ƒèkblŽ@xÈx@Ġènal£nU‚Dz@‚ÞK„nn¤@¼˜°U¼„nV‚šXU‚šbn™ĠUVbUlVš°LX„@lV„èÜUnK@_ƒyXVyUwmIU»Vƒ„kÇ¥šÿkkV¯m±n@ƒn¯ÜanVVƄz@Ž‚bœwÜb„m@wša@kƒmk»@™a@VUUó„w˜@nb°mš„XŽmnVbގVôanwšJ‚ak£lw„˜šLšÅnÝ@wl¥IÇӃ@U™™Lƒ¼kVǃÅó¯kVmmw@ƒn_‚Vn»°LÅ»@éÇçŹīVÇÝ@ÝğU™ƒaVݙ™š¯ķlŭġlƒ@óÞۂċ@¯nkUӄ—m±™IVġUwóKUn±¯—K›w»ƒKݐV„nl@„óxUwţ›£ĉƒUmŗÇ݃K™„ÝUlmKƒ£UVŽ@ÞȎW¦„Ò@Ĭšnny‚@nÒmœVŽ—¼@°Vbl@VlnUUwl™°a@„œ„@llnk°lbnKWĀnŽU„VxUŽ‚²Å‚m¦Û›ÇŚƒaU„Vbš@¦m`móX™Umm™xÅ@±Þn虲™U¯»m™ƒV—m@wƒU@wݚÝmLƒa@„™VÇUk„l°¯„VlkVƒ¦UšmxƒaULUèVx@„kIUxmWV¼¯VmȯšU„nl›È—@m»Å™ƒVWxÅbÅğW@kƒm@kVV¦mlnn@‚ō„l¦Åƙxkœ"],encodeOffsets:[[102466,28756]]}},{type:"Feature",id:"5107",properties:{name:"绵阳市",cp:[104.7327,31.8713],childNum:8},geometry:{type:"Polygon",coordinates:["@@„ńlV°š@Őĵ˜VX»ÆUĊќJ‚w„@È»m»š£°Kšk@ÇnÑƍš@„w°JUwnw@wšbVbš@VlźLUw„aƒ»„aUklyUUVakwWXwWƒUxkLƒmn¥mšwk™˜UX™lJ„w@aƒIk°X„¥Wƒ²l¥šaU™„IlmkklƒÈL@m°nlWU™aW—š@Vƒ„@UaV¥@ašk@Çk¹ƒK@a™K@kƒKkšÇX@VU@kx±V™èkIWwUVUkkKÇ@ƒa@wkml¯@kUWn£Wa„aVwnaV݃w¯@UaWx—n›JńUxUšma@L@„mbUŽU±VVnkxUƙ„VŽm@kkKW°„X@¤ÇUkÆÇnU¦¯ŽkƒmLVwÅK@UóbÇƁVƒ¦™L@‚±êX¦mVޚkÜÝnWU—„›@kšƒŽ¯wķšnš°ÒU„lln@@„ĶmnkĊJ²bV„lxÞb™Þƒbk»™m™n™@™¤¯bƒz@Žl°UÒ¯È@ŽšxŤX„yV¯°¥Uwƒw²XlºVŚ¯¼nx›š@ŽXݏmxnb@n™J@b"],encodeOffsets:[[106448,33694]]}},{type:"Feature",id:"5117",properties:{name:"达州市",cp:[107.6111,31.333],childNum:7},geometry:{type:"Polygon",coordinates:["@@Uxn°‚bnŽlUnÒƃnn@n‚¤„LnxlU„ššV@„Æl„x°XXxl`XœƒVW‚œL˜è—„±nÈbƒŽ°b@š²x°Kܼ°ĉ„V¦lJnU@¦šÞ‚JÞğ„mšLÞ»šxU„lb„VÆann„alŽ„VƍX@lnŎV„mU™maÅXƒa@aWmœ@‚£@wĉJVƒkk‚kkmƒnk@ƒmna@šal„Kš™‚J@Þwm‚ÅŃ@ambkUƒƒ@™™KUġKU@m‚ak¯±ƒ„a@aĉÑÅaVwšXlwƒ±—V¥l@@a™kƒ›@@£šmƒĉÝónWV@ŽnÝÇÇx—UmbƒaVkkk@m„@m°ƒÝýXm›akÅīƒ@@ƒmb@@xmšnbƒ@mxšŽkWL@ƒ¯b@WUXmWœWKkbm@kx™Xmm@LUl„xlêóK™nUš„all™LƒlLó°m¯JVšU„K„„@x˜K²Āô¦l°"],encodeOffsets:[[109519,31917]]}},{type:"Feature",id:"5108",properties:{name:"广元市",cp:[105.6885,32.2284],childNum:5},geometry:{type:"Polygon",coordinates:["@@ÆL„Ċx°»Ŧ¦˜W„™šLȄ@xÞKÜ°ÞnVxÅĀlÒnJ°a@w„V¯l@XWknKnw˜VȚ°XXa˜lX°VI°b„W„nšaššš¥@ƒw°™n@šyÆ@nkÞ@°¯lJn„°IÈl‚UšlXÅ@ķlUV¥VUUÝޙUUƒ@UwƒJUkĉm@ýƒƒlk™WUwVwWJk@VUK™lUkaVƒUƒmLk„m@ƒƒ@Uƒ›Ik`@„™UmlUkV¯ÇXKÝ_mm¯@Uƒ`kwmƒl¼±KV¯—¯Vk±Vk±kzma™KUnDZ™bk¦±ŽX„ƒ¦¯Wl„J@bƒxkIWš—Vlš™xnŽm¦„nlKVwX„WxXŽlxUbVVkzVlƒb„¼ƒbVxŹKUk™@Ua™a@xmxVx¯Iƒx™@ŎmÒ@șl¯L™¤n¼"],encodeOffsets:[[107146,33452]]}},{type:"Feature",id:"5118",properties:{name:"雅安市",cp:[102.6672,29.8938],childNum:8},geometry:{type:"Polygon",coordinates:["@@ln@xšèVInxVKn„‚ĊklxkÜVޚÒnÈm°nxš@š¼ĊLV„nx‚WXblIš`š@nmĉn‚KȄôÅlUÑmU„K²¹@ÇÅVÓůVýÞW„‚UVmX„ÆbnwšKUÿ‚™@UmmIUb¯¥Uwƒ™¯™Çmš™„çmanUm»UUƒl—kƒ¤ƒa¯bV™U_WĕmÇŚ±ĢUlƒUl™ÛVƒçkUƒ@WŽ¯KU™VkUağVmš™aV™WUƒmV»—¯@»m£ƒmÝLŽ±@ÈmVk¤mb@ôƒ¦kVkamL@b°‚@b¯¦ÝVƒn@l„ê™b@º„UĸL°J@zV@nmUƒlaĸÔ@xƒ°VҚ„Ub„‚óĢ„ÒWškV@Ò"],encodeOffsets:[[104727,30797]]}},{type:"Feature",id:"5115",properties:{name:"宜宾市",cp:[104.6558,28.548],childNum:10},geometry:{type:"Polygon",coordinates:["@@VlÈnl‚XnWLX`m„²nV‚@b°xĢçlnšVm‚nn„@@„°‚UzšlV°nޘÒkxl„w„`UnVb„mšL@albÞKÈۚmܼ°@Xǚ@wmW@ńKĊL„lV„šLVŎçÞL²±‚ğkw@Uƒy@¹lKX™lKVa@w™™Č@‚w@a˜ÇU¯n™@@wġak—™aō‚ƒƒK@Å»VakUWmķwkbğ¥mL™akš™@ġރ°¯xVVÞ@VšxVš—VWx„XlxU‚™@k²WVŃULmèULVĊklĠ„VœJVx±nŃ¯¦mwğ@mƒƒlğkkl±@kšUk@¯±Ç™Kƒ—kxl¤b™Imx"],encodeOffsets:[[106099,29279]]}},{type:"Feature",id:"5111",properties:{name:"乐山市",cp:[103.5791,29.1742],childNum:9},geometry:{type:"Polygon",coordinates:["@@kšVŽk„ššÆkšV²UlºÈIlxƒLXèÜlU„„XU‚mkƒbVè„x°@„@¼°Knnn@m˜ÆIUbnJ@bVI°b°±@nK@mVakkƒKl¯nbšmĸ„èl@VnÈl‚UUw„wmwnm°¥„L„™lLnU@Va™ImbkƒmK„ƒƒnk@mƒb™ƒƒLV„JVUUƒ„VnkVmb@a¯JUaÆkk¥„IW¥„Klw—ÑmÝU¯™kVy¯@ƒƒ@mmn™Ukmġè¯w@aU±mnƒW_XKWmkÇmUkóbUÝUanmW™ƒ¯nma—@ƒxVôUV@šb@‚l¼„n@l™b@xƒnÛa›xa@ƒyUÅmUÛbm°@„m‚n²U°ll™ĀȦƒlU„V¼nJVxUz‚W„z@`mL"],encodeOffsets:[[105480,29993]]}},{type:"Feature",id:"5113",properties:{name:"南充市",cp:[106.2048,31.1517],childNum:7},geometry:{type:"Polygon",coordinates:["@@ȲVmšLnblyl²²UUl˜°U°²L‚»„knlx„_VŽ°@nnÞ`WL°ÈUŽVlnkšV@ƒl_œJV„‚@„„n@lƒnKV£™Çšƒ„UV¯šm„@laX˜U„‚UbVx„@VkôJU°Jn™@™‚wUk°wnUƒV_nJmknmm¯Vwk¯ó¥±ÿ—L@wƒƒƒLVU™kU›bX¯mykI@a±Kk¦ULmaXƒƒVm¯ƒK—z±ƒklUIVbÇJšƒkL¯™l™ƒU™ÿ™UƒlUkJƒUmŽUUkVVklKk@@a™U@„™J„²ƒxƒ¦kĬ@¼±ºXnWb—xƒU@xƒx@lšL@b„Llº@șl@bU¦Vbƒ@U„™@X˜‚bVškX¯m@nÇKk„llknƒJVš"],encodeOffsets:[[107989,32282]]}},{type:"Feature",id:"5119",properties:{name:"巴中市",cp:[107.0618,31.9977],childNum:4},geometry:{type:"Polygon",coordinates:["@@V„U„lbkVšŽVLUŽl@XI‚ŽUxVxšXkl„„@þĊnVl„IVx„@VVݚVÞUVU¦kV@ĸWÆô²š@VÞnš@Vaôb²W@‚K@XUmÑUW°¯°Ina@y„_lWn¼lLUbô¼„Kla@™nkUyô—Æx°@šn£™Ý@¥mVkIU¥Ċƒ‚¯Û»¯L±w@™¯a„Ça²m˜ƒ—ç›KX„UW›k_Ww¯WƒwÅk@ƒ™Uƒ™kVmwƒK£@mmmńmÑkVmamnnlmIU`V„m¯xVlx@šmš¯IV‚óIUlƒ@UwVaƒ—VW‚kbƒ@™nU°ƒV™„šÈU¤"],encodeOffsets:[[108957,32569]]}},{type:"Feature",id:"5105",properties:{name:"泸州市",cp:[105.4578,28.493],childNum:5},geometry:{type:"Polygon",coordinates:["@@VVXwVKn„˜wnVƒn„l@b¯xmKUbVn°°X°@blLšènV„@Vn‚l@U„LnmmUna„VV_ĶV@wnJ„„l@@kkKVólaUwnJm„wUlm@ašUaôKVnJWbޚ@VšwVLX¥VVš_Þ`šw„WƒÞŹmmnIn¥Wƒ@k„WV¯@ƒ°kI™ŽƒLk¼Ç@k¤±Xk˜™nmݯUlÅÛKWV¯kƒlUwkLƒÓ™@U—@ƒ‚w@ġXV„˜WX„š@UbVbšV›š_kÇV™lU°lnwŎ¦ÞaƯnmm¯šU„™m¥nkVmkƒl_ó¥¯UÇl¯@™ƒ™L™kƒ`¯ķLUy¯@mw—¼ķ°ġ_řU°mlšnÇVUޚ„@‚ƒš_ƒJUnV‚UXšbl˜Ģb@x@mšV°—È‚b@‚xċ@šš@xUbkLWškL@º„zV‚@lxĠ±²"],encodeOffsets:[[107674,29639]]}},{type:"Feature",id:"5101",properties:{name:"成都市",cp:[103.9526,30.7617],childNum:11},geometry:{type:"Polygon",coordinates:["@@°n°m²°ÜUšw²ŽôVš°ŽVkxÜźUŰČb‚ŽĢlaÈL„»ƒ@k„wVǂ@„ƒnÛƻșUÝ°Kl_„V°Uš`Vbn@VbÈLšaVU@ƨ»V™nIl™šUUa„±lIk±š@VnKmÅ@WaƒK¦™lVōškK™Ý@maXÇmw¯IU‚@kƒVƒwUmVIƒƒƒç—ÿƒU±ŽÅ@¯È@xƒK@wƒLUbÇKō@mÝ£@yóUóóUxkI@WlIUaƒbƒaŽVĀ™LmxÅaWƒUnVƒÝXUþÆ°UÔÈÆ@±ºƒLnVVÒkóÆ"],encodeOffsets:[[105492,31534]]}},{type:"Feature",id:"5120",properties:{name:"资阳市",cp:[104.9744,30.1575],childNum:4},geometry:{type:"Polygon",coordinates:["@@„è„„UJVn„x„U@lV°JnxWÈnbÞ@šŽlLŎ™Ušk‚¥„LXbÆ@nŽmLU‚@zlbXmlnVynL„çšJVb‚UnómUnamU„an¥lKV_²aValWô„n@nƒ‚bVœK°¯VblW@kkƒlUnlV£°W@w„UXk°KVwƒmVkwVyVI@wkmƒVÅ_Umm@Uÿmbk£™xUaVw±V¼V¤kLWxU@Uk™bƒyƒXšómƒ°V@@zÝÒkKƒn™±U@@_VVkƒÇaVwnLWalm@@kkVVl™¦kIV`±n@w„Kƒƒk²™aƒVUUV¤™nkxmUkVWVnLUbVbƒ`kUU„mLU‚mX@`ÅbǚXbWLXŽ›n"],encodeOffsets:[[106695,31062]]}},{type:"Feature",id:"5104",properties:{name:"攀枝花市",cp:[101.6895,26.7133],childNum:3},geometry:{type:"Polygon",coordinates:["@@„b‚KÞnޙ@x„V@x˜n„Unš°¼šVš±mç²ÝÆ@šwnnšVWŽnôn_@¥‚™UaVƒ„bƙœÈ܎n¥Æ±VUwVƒmXÿmLkal¯km@k›ƒ@ƒ¯bkšVxmVUkk@Ua@¯˜»Un›mс@mz™m@īƒÑX¥Ç@ݙxU¦ƒšÅŽÇUkx@šlb„UWVX„mV@xĵĖ±@@Ž¯xUšÆLnÆm„šx@nXL±lUUVwKWak@WxkbšÞƒŽĉbUn@‚ƒ@@xó¦„Ŏ"],encodeOffsets:[[103602,27816]]}},{type:"Feature",id:"5114",properties:{name:"眉山市",cp:[103.8098,30.0146],childNum:6},geometry:{type:"Polygon",coordinates:["@@„šVx°¦VanJVnš@„b„aVbkJ@XlJVwôôôV@zÞ¤@nƎÈLVa„K@x„L@w°ÇÆ@²„V˜ĀœmWXKWașÆa@_nWVnKVƒlV„_UaVamKXUWwnmmwœÑm£@ynUƒkWƒĉUkWVkkV±çkJmkKƒšƒK¯¦mnnxƒxVxVÇkUmk@ƒçķ™nmak°„LllUb@nmL@‚¯²¯aUJ@amIVaÅJn—m@mm¯L@»ƒŽ¯@ƒwUç„anlVƒWVƒÛkWç„KkwÇJk¹±V™UÅl™™ġV™²ÈƂnXĖV`Uš°a„b„£˜l„kVVn¼mVnbƒè™šÈn°š"],encodeOffsets:[[105683,30685]]}},{type:"Feature",id:"5116",properties:{name:"广安市",cp:[106.6333,30.4376],childNum:5},geometry:{type:"Polygon",coordinates:["@@„VlIV‚„kšVšĀ„Vkš°šlK™„ÈIUaVJlk²„˜y„Ln°„UW„nbVKl¥²L@blJnzW°œalV°Inô¯‚K„kšKkkƒbV™šmôLkéƒwVk@KnnšWlwn@laXL›ŽnXVW@X°a@„XKl™nw„@man™@w‚@na@„„@ƒw™ĕġġ™wUkUWb@mk@™¦ƒ¥mUÛb±yÅn@bml@kV@„ƒlknVbmVnlmš—bÇk¯bWyk@V_UamJ@I—@WaƒVXamIVWkUkbVaƒUUxƒ@VnkVU¼›bkKUxmK™„@WšƒxnV@n"],encodeOffsets:[[108518,31208]]}},{type:"Feature",id:"5106",properties:{name:"德阳市",cp:[104.48,31.1133],childNum:6},geometry:{type:"Polygon",coordinates:["@@nUW¥²é@šK„¥‚UÈÅôa@VÆLUxnKl„°V¥ÈmlÅÈV@£ƒWX¯lLln@UšƒVÅlwUm²U‚VVna@ƒ@KnbV™VwƃœI˜mXwWƒkIVwÝĕVUa™IƒèmKUzkmWnka@y™@l²kJƒ²Vb™VkšmJUšƧ¼@UV™bÇKUam@Ua™_¯VƒUk`¯LVÞǚżm܃„@Uȃx@l„ƒ¼ÇKkbWŽœšVxUbƦnxƦĊV"],encodeOffsets:[[106594,32457]]}},{type:"Feature",id:"5110",properties:{name:"内江市",cp:[104.8535,29.6136],childNum:4},geometry:{type:"Polygon",coordinates:["@@²èlUUllXĊVX„„lmV@zn¤›ÒnxmnXxlUnVlwšmU£VV„Ušbl±„„ƒL@x²mU_lJš¥UklU@ln@‚kXbmKUxÈbl„UU@`V@š²„mlLÞÑ@yU@„¯ôn‚™„W„zšaVlV@XwlKU£‚»—aVaUwm@mwUVUwkƒlVDzLlƒ„KV™m_@ykUmƒ@mU™çkKmxkIU‚Ý„@LUJ@n±„kº‚LXb™¼@mmIXa™@mamnkW™ƒKUƒƒxƒ_U`UklwUw™mUbƒV™²ƒakbƒmkn@`„UmҙšVxUb™I™`UƒaÝÈ"],encodeOffsets:[[106774,30342]]}},{type:"Feature",id:"5109",properties:{name:"遂宁市",cp:[105.5347,30.6683],childNum:4},geometry:{type:"Polygon",coordinates:["@@ÞĖUxlJX„Vb°@„xUÞmbUxƒbXbm¤VX@lk°ln@x„bÈ@lLVlVUXxlJšç²UlwV@@UÈWl™„L„w@w„V˜wXaWm²¹@»lī„¥„wƒ±šI@ƒšV@bl@kLUllUVVn@mmU„wX™ċbVb@VUkbmamšW@kƒa@™™k@ƒlaUa™@¯b@šmmwó@@lkXUa¯°›LU‚am„m@óƒkXUb±bU`kLm¦ƒbnVmbnVmô"],encodeOffsets:[[107595,31270]]}},{type:"Feature",id:"5103",properties:{name:"自贡市",cp:[104.6667,29.2786],childNum:3},geometry:{type:"Polygon",coordinates:["@@lIÞDŽbVŽš_šJVaUwš™nуV@_lm„nla„bš±„UVašnVxkxVlV_„`„wV„„LšlXnmnbš@WbnJ@nš»WaKl¹²ƒ@mVI@KރVlJnw@aW¯¯¯UmVanL°w@aƒk„mmU—xmƒULWxUUÝKōèU™KUƒƒkĉKƒL@ÆnX@x™‚Wȯ@Û»™nÇÜÝLka@b™KƒnUaVmƒ_ƒxkƒLX¦ƒJl¦ÅlVb°I@bnaUŽmlƒUV„UVƒIUŽ„Kš„„a@nml„„ƒŽnLl„našJUbV@"],encodeOffsets:[[106752,30347]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/tai_wan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"7100",properties:{name:"台湾",cp:[121.0295,23.6082],childNum:1},geometry:{type:"Polygon",coordinates:["@@\\sŽ@pS}aekgKSu™SsMß`¡CqZ·be@Q^o@‹gieMp‹‰]}•}Ľc_Kk…{™ù“A¡r‰[uom@эĥJiq©mʼnq¯Bq]ÙYgSåk_gwU­isTE…“‘ĕiqiUEkue_‰OSsZ‹aWKo¡­q“ycY£w}‹ĩ™ĕS§Z©S™N¥SyLÑ¡±Ks^IY‰PdƒY[Uo†Fp}´\\¬\\j]ˆe܍ò‹¤¡–ā a\\bn™U㺹Ìs¼j®[cíȈEŽĝĆ`ļf¶Š®K|VØDdKGpVnU‚FjpH—F`†B’[pMºxÖjbpÎxp€¬‚|ΟÜÒCŠ²®‚ÜAp„ZG~€Šd˜ÞàV¨|¸€`|Œ²tx~\\~|dFf^zG€ĄŚhœdL\\hĸž¼†ŠOªP®lV`p\\]Xpll˜æ¤œCpQ|oF}fMRi†NSon_²qämœM„NM‹\\•"],encodeOffsets:[[124853,25650]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/tian_jin_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"120225",properties:{name:"蓟县",cp:[117.4672,40.004],childNum:1},geometry:{type:"Polygon",coordinates:["@@EUDAEI@WNMNCBFAHFFNACDJDPBD@@GD@DIFFHEFGDBDEQOFG@EI_KG@OcJQM]RMEKBGPG@[LaCIICBWKCEEG@WBQHCDFD@HSLEJI@IHWECFGAAEKCGDBFCBSBIDCKKHEADMJMFABKOKEQAA@IEEG@GIQAEK@OZEESMOL“lu@SLUTYFQCMG@@SQUAYKAACA@IB@BDB@B@DC@@BGAEFAA@BEGKJCC@AGAIHA@@JC@QEIP@@A@EGIDC@O@C@@@@CJCWKABFLBBEBSQGBAAMIEM@AKBcJEN@BEBCFMAEFEF@J@BG@BFABECKFG@AFQ@@F@BEB@@A@@AAAKAE@GFGDECEFEECBKIKDELDFEDYH@EIACDCHKBEB@BAAC@ADBHABKJIAIJICEDGDCD@@A@A@DHCHJHDFEFGBKRKBGIK@GIMHSBCH_BOJECCJCFKKMD@DNJEDEGC@OJCJHRUL@HRJ@H[DCNKDZHCTFDHCFFKR`TANVDFZRDLFARB@HPAPG`ILAR@TERNDFNHDLCLDDCXDYbHF@FEB@LDDVE@JPNfXPINCVDJJD@NJPAJHLXHDNANHhB@DPNLRMTBFRBHHr@`NBFEBOCCBIAQJDHCHLHFA@HSDCRLFTB@HEFLNF@PELBDJALFLTC@EPFLLP@tUHQJDfIHGTB^JTCPDLKAIBATFPADIEGECEMJ@JIAIHGECFEAGDI\\SPOXAFCL@BQTQBBTMZECYGAHA@GJAE@HCAEME@IECFKJADDBABLTHHG@ILEAMNDJCDHEBF@@JNFJELDFKTOT@JETBFFHBHEHKI@@IJEJ@XKEOUMS@AF@CEB"],encodeOffsets:[[120575,41009]]}},{type:"Feature",id:"120114",properties:{name:"武清区",cp:[117.0621,39.4121],childNum:1},geometry:{type:"Polygon",coordinates:["@@FWôµ@IFCLIB@EHNBp]AGEAKAEDMGZKFGBGME@ILGP@HEFB@BXMEAHUGC@IHCLOD@X[NWHWPKAEF[@EKIOL@EKGBNMJ@EIEHKBIC@BAKMIACCFQZCF]DB@ERAKADIHGEIBCGIIECFaGLZO@EFCNGAGDGAKL@BMG@IE@ADSDEH[JGC@CGA@BMDeK@EIACFE@@GG@FIAMM@CCGC@EM@ADE@CFMAAGHBDKIEAJG@DOGCDEKAGIS@KFCHKAEHIE]BeKNO[IFIOELC@A]GMBKVYCDDgGAICARc@MW@AQE@DGI@@AQ@@BKBAIQQYEFW@CEADIGGBCEIiMEMF_LGEKMBBDWEBGRC@E_CHYGCH_IAED@FFBQh@FGJaJ}AHRAREF@bE\\C@CT`FHC@\\BBF@BID@HGDDJ@@FAHKBARECKDAZBJIVNHCTA@EREAMLHDAFFBVFFC@RNRETHD@FOJMACH@CAB@P@DF@@FGDWE@FFSIEMKQDYCCHKb^JADOCIDGNDBdBCFJB@EC\\A@BJEA@JAAAD@HHD@LFBCFF@BERDHNhZQHMBGHOACCEBWEGD@PSJKCGEUD@CINLFGHE@AJK@HDABBHTB@F`DBFLBBHEDARCFG@ABJBAPVFE^FBGLGCFG_BMLEXGAAFE@@JNRVJHFALFBEHQJCTbNDHCF@PlFLJSXCHFHfVBTNJ\\BPJXC^FAVNFCHFB@FFH@JF@\\ABCFD\\BDMCAAJKQBGAILOEGHILECQLWFENJHADC@QxNHFJNLDFA@CBA@D˜UÂmR@FBL@BD"],encodeOffsets:[[119959,40574]]}},{type:"Feature",id:"120115",properties:{name:"宝坻区",cp:[117.4274,39.5913],childNum:1},geometry:{type:"Polygon",coordinates:["@@TZbB@JHD@DODCLM@AP@LL@BNH@ETFN@`E@DNG@CHLBCJA@AICFKDDBKA@\\N@AFNAGRBFjFFFL@DHLBLFQPcXAZMJ]GAVHAIZJFNE@JpDRRDCLFDGXA@EFF@CFFPDfEBDB@DCHCFCJDJIJBLI@I@CB@@ADBB@FALADGDC@@H@BB@FZGFCCE@@FMLALJDAFFFEFDFCB@@AHCF@L@@BBB@BB@FC@E@@R@BEL@HEFD@G@AH@AIB@@@FEFEBALDDEFAFO^IF@JCBBFPNJJ@D@PRDCEKBAXL@BIFD@T@JE@BHHJORFDI@@B@JGH@@B@BDDLIFFHCD@D@DEE@BAAAB@DAF@B@H@NGLJLMRDNMfGIEPMI@GDAKK@KIDIJ@GE@CFDN@FE@GFEPGV@TCDFKHBBF@RW@DD@@ID@TJFKIKLI@EP@IGBCLAEKLEN@KSHIGYACSD@SEAMBBMGEBMQBCMIGKFB[D@HDLPHDBC@IFITDLG@IIIFGVBNJDLN@VIRI@YIAIHIC@CLKZCBEE@JECEIHEAKGDGECBGEEM@@DA@CCCBBEGA[GEDBBoNAAH]MKiIAWKQoIIPMFQAEEDMH@FMSUYIeF@EK@BIOEKJEBICFKaKPFAFSE@LWCCFMHDDEKESBOGBKIEIODLG@CCDEQCEDWEMDIEIB@EHGEEDAEAa@@HqDEJGF[AECCFa@WCEIKAAEQB@FCAE^YDERDDJBLNABD@AJGLJF@FNIAMLH@FPKLJ@FE\\BFOLGXMXW\\C@KPGD@JHDGVFBWN@AEAGFO@KH@JNFAHEHYLNHFCLBFBBHo^MAFGA@KJED@Jó¶EX"],encodeOffsets:[[119959,40574]]}},{type:"Feature",id:"120223",properties:{name:"静海县",cp:[116.9824,38.8312],childNum:1},geometry:{type:"Polygon",coordinates:["@@NGFMDATCNDR@CCbINEHNJA@C\\EEGVE@IhE–[˜w”epc¢·²›^QEKIEKIgiQDkehY£uSDBMkUDOJDHC@GF@CAFBFEN@C‹Q@BeP@@G@HD@@MHQKi@[IGCOCESE@GMA_OcCGDu`aˆ@VZzKDkJBLNXGDqKEWE@cFEFA@ƒISIi@@KMABJGBcMuFEzGVH\\ATSEUBeALCEMG@CEBUHUCGXaBPtUBBFIBFTDFF@DDKBFNGBJPHXDDMDCLJ^mBIHIL@LR\\@LCR[@@z@NFD@LLBNb@RHDBNTPT\\F@BJF@BXCFBHHBDLFB@HODADE@@JHVXCPDHCFTLBBFNCDCCCU@@GAABEHHZHBCAEdEjFDD@GfD@DXFCHF@ERFDLBH@"],encodeOffsets:[[119688,40010]]}},{type:"Feature",id:"120221",properties:{name:"宁河县",cp:[117.6801,39.3853],childNum:1},geometry:{type:"Polygon",coordinates:["@@BFLBFJXDb@DEFD\\BHEFIrC@Gb@FBCBFFGH@FJAJFNCXFFCRDCFDDH@CKJPJFALPHTALFCFGCENDDKXF@ETEBO‚bLELJDFALIPFAJL@@FfEZJTVENG@CNFFRBNEJOpJLRBXjJNLG^BBpMAAFC\\HHBAFDADDB@@CN@FFAHFDCHLHFBJGFCFUNKJJTD\\XUXF\\^F@DDDQXXBRLRCBDFEVCDLVDpUl@LEDJHAPRFGL@CETGPBTCDDVI@CFF@GFDCCVGLKEK[Y@MECISG@BKNSCGCKWEAaEBEKNGFSECO@GGM@GYI@DÅCMLHPTF@DJHAVVNKEGDETJ^[TJNNd@NOAMFYJ@@GFANDPEJB^aOadSTQSI@MHBDIEOKCG@EEFCKCqXO@@DMFENCDDHCCGJ]AKFoDaGGHYFDHKJiCMFGC@EQ@AEHGAC@IEAATKOHGIC@IXIFEoƒGE[JCFCDHNmRADFZMF[EEBMO{GU@AOW@@]ZeHBDEHBKEfQkuIWBs‡@EC@d[@[^EDMTKCEEcI@cDAB@FCBCACmOCG{PYHeBgPwPFDDALFFFCHQGSD@BHFAR[TaFYXMASUiGFL@DQNCJI@@D@PLDN`ETEFIGMCGBCE‘~CAIFDPEHGEQPHJADFJGHCJLB"],encodeOffsets:[[120145,40295]]}},{type:"Feature",id:"120109",properties:{name:"大港区",cp:[117.3875,38.757],childNum:1},geometry:{type:"Polygon",coordinates:["@@JFFL°_`ONJKDDFIFZN xlb~yFVNRŒrdJGzDPVFBCTNND\\UR@E`F@@Ip@IWGUoawOEE@ÏDgK{İEEMFëC—b…™@—KwOCDHHKBDJCDEEEAGHOABFABMCgDLSQ@CFEB‰MgYIDQINE@AUSwSAdYEHQMEyK[KI@GRMLE@@OqOoBOnpJ@BmEAFHL^FDB[C@BBDVFAHFJENB@sNEjQAMYsUgCSBGDJH@\\LjGR@NC@@G@HO@AfR@DŒM@EFEADBE@@HGDICCPlVANTC¤vgZlfRChjLJ"],encodeOffsets:[[120065,39771]]}},{type:"Feature",id:"120107",properties:{name:"塘沽区",cp:[117.6801,38.9987],childNum:1},geometry:{type:"Polygon",coordinates:["@@|ODHnPBDADEDA@CB@ddJFFLDNSFC\\]\\@@cFDˆ@nACOMW@M@ITURBRZNHNWRQšoO•j½f‡cqŸAqeiDÿÍyÓįFL|Ch@ÐFFxPpbHVJXo@@JCTR^BPABQA]^MB@bE@@FQBFVJRH@FXtPNZSBAja@@NƒDTŽLJrQTHFXZFB`"],encodeOffsets:[[120391,40118]]}},{type:"Feature",id:"120111",properties:{name:"西青区",cp:[117.1829,39.0022],childNum:1},geometry:{type:"Polygon",coordinates:["@@@LHAHRHATh`LHNHDG`HDGZ`D@FQDAHXFACNAFLVRTBFOfHDCVBFQH@HSXHEPFB@LDBF[bDbLFKJBFLADBDjLvCPEI]FGEIGCBEUSjcFiBIVWfaHCjN^HtwBBFGPBJGjFBEGECGDONMFAP]TDHQOWCMGAMHKIJEIGQ]aDlUG]VGEGDC„{PEbBZmE@@GH@BCA@FMQCFMYMJECELCMI_P¯`]R±œ¡¸od“f—x•\\gF@JUFFH[F@DIBGMMFaJDDQ@MCSDCBENMH"],encodeOffsets:[[119688,40010]]}},{type:"Feature",id:"120113",properties:{name:"北辰区",cp:[117.1761,39.2548],childNum:1},geometry:{type:"Polygon",coordinates:["@@ROHFFGCOJEDB’}DFHANDJHFEFSM_KC@O@CJ@DIRM@CEKKA…L…FKACHoLSJSIBETDJaEIIE]E]K[MYUYQILC@GF[MGNKEK@A@BCWECAIFEFYAGFOMI[OFuDiKACBCEKIAELaKaCE\\CA@KEAFOWGGTG@ERUACDeGEPSAUQKHE`FNjNFJADHHCJFB@DEXZFRRBJLA@AR@@BJ@CHF@BRX@@NQdDBBJhHCCZDLUNA^H@BKDPFEJ\\JMPfL^AJFFGLBDGLET@HJLBCFHDCPH@BIJFCLGABHNBDEF@BCN@@FHDDDN@BNEJH@@HF@DEJB@FfLNC@AHB@DHD\\IFGTCBCF@@JNH@ALKHBHCHBDMFEP@KYbHDEJF"],encodeOffsets:[[120139,40273]]}},{type:"Feature",id:"120110",properties:{name:"东丽区",cp:[117.4013,39.1223],childNum:1},geometry:{type:"Polygon",coordinates:["@@ZV\\N^L^FJFFJIbSCAFTJTIpKDGLB†E†KLBjHTVNBZWbE\\SBQGE@ATCRHDGEEKECBECxOhOfAZGA_YEEWSGqRKIS„C@Mb@BiTAMYsOEWG@IQEURA@EF@@acUOXQRYCUDCHDTEF[SUEgAYDcVGJM`iAWDWLQRMHUHgDsDBLHJFCFDFGHBFFVEAGHCJN@RJF‡PIhBD\\FENCPWA@LFBAFHBEJUEARCDIAEDQBRNa^"],encodeOffsets:[[120048,40134]]}},{type:"Feature",id:"120108",properties:{name:"汉沽区",cp:[117.8888,39.2191],childNum:1},geometry:{type:"Polygon",coordinates:["@@LMEI\\MTABKN@FCDMH@COAcH[AoēA™M¡Wa[Meq™pQRMXMGQYQASV@J@NNXDPmBAtJXlveRLFGACFGAYf@^X@BPV@|HNPFA\\FNEEYBCnQGMDCDE\\IHFp„EFWJ@JJDGHLPBSFB@JBDGHBFR@@FHDNEjDLICGZEHGbHpCLE^BHIDDCGDCFMNE@CP@rWLDEDFFH@"],encodeOffsets:[[120859,40235]]}},{type:"Feature",id:"120112",properties:{name:"津南区",cp:[117.3958,38.9603],childNum:1},geometry:{type:"Polygon",coordinates:["@@TLv@CNHFFBHGZFETNPhCVGNGRQXKXCjBN_HIdUZChBVF\\TFECSDGVCZDRQPWdVNA^]RBBAAOQ]DSE@F_Q@[VMCSMADUECOHycI‹qMQEU}zkaŸwENRDENB@ADG@@HF@YnaAOFƒ|CDFHUHH^kVbCR^JHIFLJNGHBDNPXGRSCO^EBMNCPDHHFAFiEIHOAEH"],encodeOffsets:[[120045,39982]]}},{type:"Feature",id:"120103",properties:{name:"河西区",cp:[117.2365,39.0804],childNum:1},geometry:{type:"Polygon",coordinates:["@@d@hZNFdcLYXKRCtCMOFSYEGHEAGEDMu@SKAAsx]GMTGt"],encodeOffsets:[[119992,40041]]}},{type:"Feature",id:"120102",properties:{name:"河东区",cp:[117.2571,39.1209],childNum:1},geometry:{type:"Polygon",coordinates:["@@ZBVFFIGABEEA@KXBDOFM[EACJgˆOIE@QIMGDBHUFEEGAEHECEDGIAKQDWLKZcdQPEP@FOFBJTJ@HNORJf@DBCN"],encodeOffsets:[[120063,40098]]}},{type:"Feature",id:"120104",properties:{name:"南开区",cp:[117.1527,39.1065],childNum:1},geometry:{type:"Polygon",coordinates:["@@NMVDCG\\E^B@HlB@YEDS@C…HsNSiMGDebUXAJEjidVTAFHDFJ"],encodeOffsets:[[119940,40093]]}},{type:"Feature",id:"120105",properties:{name:"河北区",cp:[117.2145,39.1615],childNum:1},geometry:{type:"Polygon",coordinates:["@@DBXFADB@L@LFHM\\NHED@JKZRb]QMRAFCJBDCBQYADMCAe@QIMP@GSIAIPE@E[EGH@ZEF]^HJAXK@KF"],encodeOffsets:[[119980,40125]]}},{type:"Feature",id:"120106",properties:{name:"红桥区",cp:[117.1596,39.1663],childNum:1},geometry:{type:"Polygon",coordinates:["@@J\\PNHEZBFEJELEL@BWGI^]FEkA@G]A[FDHUCMNEHJ^"],encodeOffsets:[[119942,40112]]}},{type:"Feature",id:"120101",properties:{name:"和平区",cp:[117.2008,39.1189],childNum:1},geometry:{type:"Polygon",coordinates:["@@D†T@FCHG\\FFOROMEgYc@"],encodeOffsets:[[119992,40041]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/world_geo",[],function(){return{type:"FeatureCollection",offset:{x:170,y:90},features:[{type:"Feature",id:"AFG",properties:{name:"Afghanistan"},geometry:{type:"Polygon",coordinates:["@@ࡪ͇وŐǬϠڐŶӂʮǚڦ۾njƀ̚ІɣʪҴMوǯʲĹ،˒˰Nj˖ϪԈiżŬĘͺβ̈Ҕȏĝʱʪ¡ý۷ͪ˟̊ǰώĊԼϖׂ×ࢀAƬʋӧĥяƹ७ĭࣗǭӫλȤΣĪллΛ–͑ɳ̡ߛ€ͦ։՗ɅΥԕ²ԋ͡ɿ̳þٝŋğɻسDҵӇ‡܍થΓבôǝȁԇņ࠿űටіހހåզُƚßՔ˟ڢάҢιŮɲؒ΂ਸ"],encodeOffsets:[[62680,36506]]}},{type:"Feature",id:"AGO",properties:{name:"Angola"},geometry:{type:"MultiPolygon",coordinates:[["@@ȸصʌԋȘ˕͐ѯ֊æˤŠҬşŲɀɂӨԶ®ƤіHñ̡৴RfՉǞ͕ūԑÖԫ˪̷­ৃȼüκsԴŴϦ¹ĘʹĩСƨϿů̿î́ყZᦵ֤ۋպԽ໳΁᎝Š׋Ж₭—ŵÏԃϞկ~ԉƝЙDžÿՈŜ݊̂ޒªΰ˚ݶȨΆӘռːϐĘج«ӊʣ̜ɡԚȵԎ®Ǩʶͬʭ߼ǣ֚сՐĄǎΌŔʒg̎ĸៜ["],["@@ɉėɣلͼδʪƘ̀˽̩ǯƍɍλ"]],encodeOffsets:[[[16719,-6018]],[[12736,-5820]]]}},{type:"Feature",id:"ALB",properties:{name:"Albania"},geometry:{type:"Polygon",coordinates:["@@Ń˷ŢέΒȳiə˗ŧ»˙ϷСƛÐgȂү˰ñАîֶŖʼƗƂÉˌθаÂƿɨôǴɥȪďȨ̂"],encodeOffsets:[[21085,42860]]}},{type:"Feature",id:"ARE",properties:{name:"United Arab Emirates"},geometry:{type:"Polygon",coordinates:["@@Ƭ¤ŒɱڂƂ۞uԖ{ֺ֪ظՠՎԮdž˹ŖڑѕGçճƪŝϝǑE΅ʓΏuͷǝDZᡋъ͏࡚Ț"],encodeOffsets:[[52818,24828]]}},{type:"Feature",id:"ARG",properties:{name:"Argentina"},geometry:{type:"MultiPolygon",coordinates:[["@@ߗ§ѓ̔ԑx࣑@Aሞ͒ϵрؿનԋ୲ȿϙп"],["@@Ӵ؇͠ڰॠ“ƊǷ໶ോۊŷਆاࡾ͡Ŧχࠡ౧ࡒɭ़ŷڔƈނ٢ƎݐжLjфӝiڣۻҩ֟΁ॅࠃ૭ଧȽڥɣࡹT࠷ǽȇÝիËѫ੨ܙŗ׃Հν§Ч߯ઁఛ҉။ǩउĎǰԅǣػƺщԋ̏ࡱř̪͕߱ɗŜ࠳֨ʧҠˆʢѧޛʻڭԹūࡋȣ҇ߏEڃљʋؿؙࠞߦǝ˿ݭ঳Ӄձটލͧ΅Ͽ˔ࢍ֔ӡΟ¨ީƀ᎓ŒΑӪhؾ֓Ą̃̏óࢺ٤φˈՒĭьѾܔ̬૘ěӲξDŽę̈́ϵǚˢΜϛ͈ȝॺ͸Ǣƙ਀ȠࡲɤݢԊ̨ʭࠐEޚَոo۰ӒࠎDޜɓƶϭฐԬࡺÿࠀ̜ބռ߂צԺʥ͢Ǭ˔ඔࣶд̀ࢎĹɂ۬ݺશȱ"]],encodeOffsets:[[[-67072,-56524]],[[-66524,-22605]]]}},{type:"Feature",id:"ARM",properties:{name:"Armenia"},geometry:{type:"Polygon",coordinates:["@@୞ƀǨə͌ƣǛɁ҄˽ʁˋΦɫϘƏl׋̣}΃ӢHżχCʝɤǩuͧʖرȼĄФƛ̒"],encodeOffsets:[[44629,42079]]}},{type:"Feature",id:"ATF",properties:{name:"French Southern and Antarctic Lands"},geometry:{type:"Polygon",coordinates:["@@ը˃ߐĿˆDžɽϣಇÃq҂ŮΎÊǢ"],encodeOffsets:[[70590,-49792]]}},{type:"Feature",id:"AUS",properties:{name:"Australia"},geometry:{type:"MultiPolygon",coordinates:[["@@ߺ́ҜŘپNJԎÉÐঽ˽́ēگ̉ɰ׍בǧ®ԫ€ԭܘŗֈӝܸtϬռõ"],["@@̢ڇբ̈́˦ΡЖ͟đϋǴܛŸнɄĹɬܕąѥ˖֭࣬ѭצЋ֞λŋȯӔՃࣧ͜ͲȂ;ηȴźƢࢹ׬ԩϸ͋ڀڹʀڭtӏËԳА܋µݓơϵɩݡjӕǕ׻χއثЭ̫ٱ˫гʝܧ͕нɅػʼnׁªˇӕ̇व‰ޡ·ϫ͙ԕέ۟ψԥƪżѬҝǃ݁؉ܩɪӉƄӑÔ߿ʐիԮƻْțьЭ;߱ĸˢРȯزЧ׉ݝƷѮҬŶӞ͘ЬãجہܑԿ˽͏ڛٽΊ~ҀԿ،ѹ̀ǂȘઃԚןz߯Цຓāછ̝ख़˫ߡÈࢻљܯȗljѱ̳Ϳ܉qՅõݑƶ׿ğֽԁ҃ʕœуʁЗˋؕ֛Bࢽ՜ҋDŽlӖкŘƚȒ‡̠ĺאģӼѻࡖƏӒ˜ӎͭնsʚϋͰĽڄӓڔřΪτε˳ެиʑʞ͗aјеڎă˄țʦĠӠǢȸŘрęӮΎ؀Úٕ΢׀ۀˬЦΪٜ̰ϤàɴĻڎ̺ԚĤŶȀɞüҬoࢨʖҚώɊ҆ӲѐœͲvҘט܎ΠܩΦǚ̗Ј˂ТψǻĸٖҠаȮͨцƜ`ɼτĭdɂτŦОŔبϫҲӽՂMՖÿDZҦДڪϜɘſȾκӒԘ̒јıۺǂeі؛ˢ҂Ū֎ȻҀ·ۼɋʈĐԶʵӬʊ͂ñȠNJϬеɡ͉҇ͻ˿ƒĮͱʙп̗ЭÔʁڜҫ٨ˏѠ́؈ӻʂBѰɍŶʷߤ˵ֈ˼ǐҊǠόľҤʰڞŝОÔʔīӔŌنLjǠŽˬȮѾdžҦtʈ̸̾ʂЩÎՃȾķ˜Λ̨ёÚӇ‡̥"]],encodeOffsets:[[[148888,-41771]],[[147008,-14093]]]}},{type:"Feature",id:"AUT",properties:{name:"Austria"},geometry:{type:"Polygon",coordinates:["@@Û΃ӁCǎǻ˧էLJƗܽsщȏۛÞயɐȉ̊ࠧƣĭDžԗŢѕxϝƶźȴƬʪ²ьɹŤɜݎ•׸ƮЖ}ˀǣþƜšո̠ń̒ϰز˓ӀΆ̐ÚٶʱЂªϰǁãŃČ̅"],encodeOffsets:[[17388,49279]]}},{type:"Feature",id:"AZE",properties:{name:"Azerbaijan"},geometry:{type:"MultiPolygon",coordinates:[["@@ʞɣψDGŻ΄ӡֽŒщϰƃ͆Ǫv"],["@@ϊËƞɈԈͺѴѵђ׭ϺŸʸɧۗãƣٵƟ̭̍ȝvзȽ¥ԻѲ̂дʝʚ̿×যإk׌ϗƐΥɬʂˌ҃˾ǜɂ͋ƤǧɚȶƎضʍҐ¹ŘIJбҔɔŚʀ…׀ԙ"]],encodeOffsets:[[[46083,40694]],[[48511,42210]]]}},{type:"Feature",id:"BDI",properties:{name:"Burundi"},geometry:{type:"Polygon",coordinates:["@@Á০ɃϢԜßʲӎҀŸͧǸȏT˗ȹǭ͛ѫ̧̥΍Ÿ"],encodeOffsets:[[30045,-4607]]}},{type:"Feature",id:"BEL",properties:{name:"Belgium"},geometry:{type:"Polygon",coordinates:["@@؜áުǪՐοҦȝħ֧ɕĝһܿϦћßדІϷͶϷ`ũ̒ڪǔ"],encodeOffsets:[[3395,52579]]}},{type:"Feature",id:"BEN",properties:{name:"Benin"},geometry:{type:"Polygon",coordinates:["@@ۛįȹ׆žኞǛǦЮ̇̌ʱʞņѶ̀ĨǠξЪĀȀʤˮʘ̠F٘ә˩ȎӽǓͷĘɧСԳʵʳǁՉt՗µണ"],encodeOffsets:[[2757,6410]]}},{type:"Feature",id:"BFA",properties:{name:"Burkina Faso"},geometry:{type:"Polygon",coordinates:["@@ֹɐϽ‹̍Ƀϗǰƥ˦ϙǾÅӦɮΤo˴ښۢŬּɲȴОœΚǢŘɎٴϖdžˀ޼ΒҦŢɀLJՠJáСŔϣӀչ€НॺȏmֻǿʣЩÿǟν˿ħ݁lϳâ˓ƉωÖร¡qӉŘم"],encodeOffsets:[[-2895,9874]]}},{type:"Feature",id:"BGD",properties:{name:"Bangladesh"},geometry:{type:"Polygon",coordinates:["@@i׽̉ŶÆگʉѬµєDžКΕӨޟ’ü΋˃ҳΧǠũƵʃĠ͗øŽۖ̅لƜԒԫɤȆ̪Հ̼؅Ѽ֮̔ږεВ£ô׏ߞřު^Ӟƛϯ܅ϕµʷӍҢѥƎ՞ɶFѶ೯"],encodeOffsets:[[94897,22571]]}},{type:"Feature",id:"BGR",properties:{name:"Bulgaria"},geometry:{type:"Polygon",coordinates:["@@ʎΉ͚Ö٦ſ௾«иɌবȜ̩ؒӴĕѥΏ̫׹˔ӏܣŒࡥ˃Uлޅÿס̊ڧɱة|Ñ֊сːƒŢĝĴƘˌ͌ˀСδ÷̬ȸȐ"],encodeOffsets:[[23201,45297]]}},{type:"Feature",id:"BHS",properties:{name:"The Bahamas"},geometry:{type:"MultiPolygon",coordinates:[["@@ȵ£ɇӜ̿ʐǾՔʨ‘ۣ̎Jӥ"],["@@ࣷƅÏ̴Ђäֈ{~ɕ"],["@@ƟׯƷņ`ѮϓͪCĪڐϗ"]],encodeOffsets:[[[-79395,24330]],[[-79687,27218]],[[-78848,27229]]]}},{type:"Feature",id:"BIH",properties:{name:"Bosnia and Herzegovina"},geometry:{type:"Polygon",coordinates:["@@̦FȿσМ͓ūЃȡ™ƽû˙țūҥݓ͈ͅΘ͋Ȅϭ̾ǻʺЩϾǬΒ̞ȕǼǨϾnܠƓ׈\\Ϟȅ"],encodeOffsets:[[19462,45937]]}},{type:"Feature",id:"BLR",properties:{name:"Belarus"},geometry:{type:"Polygon",coordinates:["@@߼Mࣰ̈́ȚӄېːÿϔԜƚ͖ࣘࢮɁŢȻѲĴࠒȧĊЁǷɧՄս΂Ƴ»Ʊ֦Ʃʎɡ͝ǿڳˆljÿȠ˧ȸ՝ܝ¹ʵȁÃхͭĆݷ¡əȞ̿ƥ́ŨڍjफȬࡕàٱmҡɩГeϐʷϴԌǢLͰɷ͌™ϊ"],encodeOffsets:[[24048,55207]]}},{type:"Feature",id:"BLZ",properties:{name:"Belize"},geometry:{type:"Polygon",coordinates:["@@OŮĸžƴı̞ԔDŽZHūDŽGaɭƋεôŻĕ̝ÀăīщǓɟƱǓ̅ʣ@àॆPژ"],encodeOffsets:[[-91282,18236]]}},{type:"Feature",id:"BMU",properties:{name:"Bermuda"},geometry:{type:"Polygon",coordinates:["@@OEMA]NOGNG\\Q^McMOI_OK@CQSGa@WNLVWHFLJXVFGJ`ZRTDLeeWKIHGIK@@[MQNi`]VDTBHCJAPBJLVFjT^LV\\RJZRn^RH`TfJjZHHOTTFJP_NOX[EYQQKMEJOLANJH@HQHAARF@ZEPS[U_IcRQXE@EEKKOCGGCQCOGISKYGUC"],encodeOffsets:[[-66334,33083]]}},{type:"Feature",id:"BOL",properties:{name:"Bolivia"},geometry:{type:"Polygon",coordinates:["@@य़”͟گӳ؈વȲ۫ݹ؅ŗ͡୆ҋऺˆ߾ѳ΢ŏ؆ЫֲՌ࣢αۺȖ˰ƭ̶͠рh܎¤נǸ˶ܩഠزíѠnȈʪ݀;Ѷ͂સƚęؽļ͓ãࣰ֛ݫऴƑ̻ͦ֨ǕΐʑՈTӦʟšӟǐʕZγʓa͒এྖ“ūӟĜͧҞɽȤԹƫڋɯρĄӏʿǥaʶ޳јޭ^ัʓЕ݋sҋͥ৕ƉǸ"],encodeOffsets:[[-64354,-22563]]}},{type:"Feature",id:"BRA",properties:{name:"Brazil"},geometry:{type:"Polygon",coordinates:["@@૮ନॆࠄ֠΂ۼҪjڤуӞеLJǒӜŖӼBҦ̡ƴ̿Ƌ̻œį͔ýޔƿʤ֥ɪ΃ǏࢱLjÈଜʝҴˀǦăӐɰςƬڌȣԺҝɾěͨŬӠྕ”͑ঐʔbYδǏʖ™ӠӥʠՇSΏʒ֧ǖ̼ͥळƒ࣯ݬä֜Ļ͔Ěؾષƙѵ́ܿͽȇʩџmرîӃƟϡĪÈ౨ۏӷݏv҄ͅ֏¶DzΰұԞΓݴɜƶA΢ԖʎċҔɊ̈Ôϼ०ֲێNJŔŴݴŸϚᘰpθſӔύ̬LؐӀƒǚē†͐ӯĔYՀ࿖k˦̂ɸˉǐӷǂļҨѻٸÆnjʲشȞΊƐĮΤ׸ʆ¯Ǯ܅ðśՊ’֞ϓɒǀþجŅڜȿʐȤ؀žल̮͎̾ŏʂѪšȜȗʼnσ̀ŵȖϷɷ̏ƅ܏ɌыÔϳԬϿЮ¥Ģǒˆ˜ϠƦ˚ɢҬíȲŠҚçøǢƗǘĎʐͺõЈĒӔDZξǥʺɪȊ•ŘɿДÒ͒͊ʴؤӼޒ˺¢ȺҫҼ฽҈Ƒxׅمەʾʩ๤ƁŠࡃٔր੐̟ඊԡШӱƏҫ঎ʶ࿐ѹఴŽఔ۝੸व٪ʏܖ‘̦˅˸੭Ɣԗͯ൹ёշஅୡՙोثܯȿgɻءÒ༽ɹಓęօˇͧƫ૱࡛઱ƛࢁڹηȟԋ࣯Fೕ͓סύवʗ঩ڝ܅࠯ũطƔҫƽࡓȏЧחҥट๕݉ڗ֯Ͻϥߛ։ӑɷӈψЊӟֲڇҬࡹՠ̹{ࡅٰձę"],encodeOffsets:[[-59008,-30941]]}},{type:"Feature",id:"BRN",properties:{name:"Brunei"},geometry:{type:"Polygon",coordinates:["@@ͬ̾܎Ң›Я·՛Б€ǭ˹ϥѦ"],encodeOffsets:[[116945,4635]]}},{type:"Feature",id:"BTN",properties:{name:"Bhutan"},geometry:{type:"Polygon",coordinates:["@@΂ˍÏԩۇ{ۿÈՇſޅ͊kǚ֌زҒɈ׸șѺqπɥ"],encodeOffsets:[[93898,28439]]}},{type:"Feature",id:"BWA",properties:{name:"Botswana"},geometry:{type:"Polygon",coordinates:["@@ǜƭ˄ӡॎइήĝD̑ʚՑٰŹ՚ϝ஑أݭع˩֓ʧ́ҙãƧГďʽ՝țہ¤БɾΟĸХșȵГЉʧпϑ׻đȇ̐üԠӽߚɧŲAរࠤˆ|Ჾش„ಖ͎̎΍՜ͤʮDӂȎưÙ͔ڣ"],encodeOffsets:[[26265,-18980]]}},{type:"Feature",id:"CAF",properties:{name:"Central African Republic"},geometry:{type:"Polygon",coordinates:["@@ۜÚƺɎƔgȾȏ੔͐Τ͠Ѭ̌ĉ̐ʂüߺ½߆ϴ؊ࣺю;ՐƜĪΫӜԿF΃ƋΓÄʻ̆ʍٖοҢͻT˗֠ѫΖεɆԋغͩƊˉˣęաpكĘ̹ïųȱ˕}ͧDzधнϥĎŗÝʥԕطǐؙĊ՗̴ۓ˸҉˓͛яùדգ²֩Ƙԅѻѯޱėʐ›Ϧϧ˔̳Ѡï̠ЇѮæʢċΞÞٴȬƴц࡜"],encodeOffsets:[[15647,7601]]}},{type:"Feature",id:"CAN",properties:{name:"Canada"},geometry:{type:"MultiPolygon",coordinates:[["@@؎œުxЯ΅̵Å੥Φȿˬ͆ʸ̎С"],["@@Хcઝ˂ޯІ̄î૆Ɂ࡮Η|Ʒ"],["@@хŝൡϢʥ̘ݩ̌Ưʈࡻư͕ҜðȚࢨǿԨŵ߄ė˺̃дЋ࠼΍Όҩ"],["@@։ܿո˴֠ǵ̏̉ݚɱϰȴ࠼ʵʹ؛טƞņѿʼԷΝ݉ϝ‹փǂǾیɻńইܯԅ†צЂ߫Ȳࣙ¹࿅~ŹʠԼ̐λɬ۸Ԓࢄ೾Զӎܲ̂϶™Njɫ҅Չ"],["@@@@@@@@߰äʥ॓ܶگͯDԑϪ̵ϮчʾƻτºˎЂŋ"],["@@͡ѳχîəʢ Î͖ʦΆkɈǣ"],["@@ঝҧץnǿɪزϲ଼SiǍ"],["@@ƼυјżӨɗं˽४ʽöЍؤÞ׶˥ݙ˃ಳȬҽϚ࠭ҁ஡ѣ˿Ӯଗăܴдņڌ˺ޔ؈å"],["@@ष¥ȿЪΦҼޖŜپɷXέħřձʛ"],["@@Է̍ଉʬۃğଫϘ݊ʼטζࢼʃԎƯʦDžԠ͍"],["@@G࡭૰ڄ৐եʡح߾֥࢚؈ؖܨ°ईஞÝఔūૼй¼зس҃פ҇ŃУ࿩חୡŻࢃʨʣуߵ۽ʓοই֩ளÇڏΡÇձ঍Ŀਉڻ࣭ु͙ڏ±উంƕϜ޻ϼّ୲ǔ༞εࡀ͋׺Ѕ੆ɳࢸΟ൶µࣴąƍܫʼࡋ،ळనߗ٨˚ҔࡺѭೢףѶഎЀ॒לҮהç֭֘܌৷لলࢤνݾ˫ಾגȘ෸ɫࡸć۠ɚ޴˵ਚӣʮ͙ຄÛ}۷˪ਜ਼ގſ،ӵ௖Ұߦऔ֌ϸٺݣબੳघ৙͵Յ૤Ӂݰӓംɏբˍͬ܃ټŏͶͅÖऻ؍́׽̏൯̗੏ۑ෇ƋᅛǮుPࢇÍ۱׽ੳω௉૗ॵޡ܌Ɛഘૄᄈ۪సČݔЫߍ֟ˊࣟ˜هતп൸ŨࡆीÎ؍ժ̥ਣսᇷԁ࠯ͽय؁ٓ֍܆ฤ۞഍ƒणĹջӆBନύʐ֛ƛ˧ɚٙىʱٹ̕ϡΥŽˏ¥čȹ໽A౥MϛƷࢵ؃Ŀßˍ͝ޗBࠛGϛƅƊǑøʯeďષлࡽſউ҅Ɂ@˷ƂĥŦnĔȂ̎ЂҦʘӺǙܴǵނ࢕ЂľƬūĺɳ@ǛƆ¥ȤǍēɥ€¾ĊȡĊćɚٵːڹ˪ࠑ͘߁̨ݧʃ˝Sਕɔڻʼnࠁʺ࡫Ɔו¾ʻƜƫҤ˳IE͓჏BᮝA᭯@ᡃ@ᠿ@៙@ᢡ@ࠛ@᠁@ᛷ@őF྽ࠜ׵δຽΐҳݖŤԨ੻ΨƧڴ৭؎iѠҲКwՌෙ՘࡭ॠՁ׾ޑϚ֣ΈѿѢࡇ˕ࠇҹݛւדπࠋɸࠟ|JⷎNᷲ༬ȭ೘Й࢘û݆ΖৰˀఢĹ఼τ൘Ⱦ־ΑظȠȊЄ׈ęෆݫ૦֬ŖّਔƐ͆ʖৰ·౼Λዸ̭ୄƛࠖÄଊэ஁зຶǷᗘIJܒƦࣆԋࣴьࡩΦժ˼৾žڦĎڴȩࡊҗरä๢ϛಬƄ௬oĭԺݞƦದ˵KߑՖڠڰuϞࡊ࣑԰কͺäघশ؎ૌƇࡘχଞॅݗЭ༠ǝ"],["@@нϿሎʬୠщॊіސ˟یࠛфΒ׭ࡰ݊Ŭ࠲Ƈश͹ՆࠉʼץථеະЉĝσൡã՚͓˱ູ̯Ƃฃɪঋ»ཅ˷ᒃű๻āҕІଫɮݙģਛږ֔ĚಘƜஈ›રƦྷȞᅗã஗jѷ̴ዎͲಗ[ืɚ۶ـגͮᖬԠ࡬Nj"],["@@݉ևಹך˸Ş૸’ٔȁ"],["@@öɵࢿ|ࣟjࣿőʑ¼ऍѾ˜̠ИÈነěชң"],["@@ڎԽޤڴᒆΈ෺ࢅůջဒʒߒͮሀыୄЏŊν༚Ȑ࢘՗᎐ܸͩ͹ߐ޻໯ϹጘչೲȁீޙೖÇʽכ้ঋਗά೓߲ઙĿŁӕࢪӥଜϯΌɟմࠩ́׿੕ɪᑏڨஎܣ࢔ԕƎ̉ᗱͲᅩӤ৳Ц̌ʂయќ௥Т`ʑᝡƅ܃˾ֆؤ཈dႸņ˫̜̊оચࠊɳϊ͕˾౿Рၳ˺՞ɆࢷԺ݋´ڏ˸҇ʛ຿ŅᵝȈᄫʚഹŴۥ̐࢞Ϧ஝Hˉ࡚٦ݨࡺ΄ᓪɢأի"],["@@৊ǯຄńɖʑ޷Е౜αƱݳ൝͗߳ê׉͎ᐡٮjˎ႖ĽएռসР"],["@@࣓عय़ŒԽ݆`кѮΨ࠰ɮც‡ྈȱళݟ৉Ǎ"],["@@ᕍЙѷςኹѺήΤ׌ؘܰւࠑԦᭊƀ஬ǧᒰ±ࠄʑࣖΝ੍ɃᏝןਫי@ν"],["@@ҙ͙௝Øৱɖ҂Ϛீɨܼ̬̍ˇ"],["@@ٞϵ€љϣس൱đࣗƈjӬ൝ÝÁٮࣜౌ˺ஂµÜŎ"],["@@̙͢ݠƘࢢ™ƪЩԝЋ᭗Žᑯη౩mŅ˜პϊ④ij୯Ʈପࠐ߈ɾᛄ˳๶ӻฺÛறߨޔ̪ࢄĭ˲Џ"],["@@ढ˓ကFܨˡȑ́८ȍՔȧଊ™௬ë೸ǼႊðീÏ࣒ͅȊ΍ԽɟభǷ੽ĸᜱŻႫcഫļᖁ˔̃ҦĹжࡇξ჋ĺঅʼ͂ΈႾÁ"],["@@ŗ٣٩̇޹£༝Ϋ഍ŹଗǼ@@ුؼႮծಆ[ସŬ"],["@@ϣy༽Âɡɼၜ]מƻĵĩ"],["@@༩ʋఝ˔ڼˎ௮Đஈſ˩ʥ"],["@@৽ǏඉBbŤࡴʦҌદǝ"],["@@కǥۃȚέ͂áΎજ‘ӪÅ৐̇ɫ̣"],["@@͜Ε൏Ĥ൩˘ሏŒߺʠ৫ȮÕ͐࿶ŕᗢ̫ٞЍ"],["@@০˕ଽʟ༇ك๥Óდņࣗ΄^̦ڔɢ໡Oए˨ՑϠ׌ώ׊ʲࡴÎοȖዜ¨੶҅මǵ൞ǃڒև"],["@@ᖢßᅮŅ໤ɫ™ɡᏅη᎙ǟݻȉᆬJጡԙേʃ෯ۇႿƓՙǡᡷěୈĿׇƭ۞бߙ˽ಛʃЋ͡୫ʣŞȏ෬lȳᖟԋᔧɴឿŻధĸཟªĿЖ༊Ȑб؆ԢÐᖤγ଩բഹLjڼ͘๰Ȩʄ̊஋͠ΥѠᘞ—ڒĝ಼̪ቃĬ᰽Á๣˸۩ͼগʘȁ˺దLjঘ‚࿲ƌం̺ਬ©ࣤɽٔҒૐƈບĢᢲ–Ҁĝ᝚ƚᆔÁᆒÁ"]],encodeOffsets:[[[-65192,47668]],[[-63289,50284]],[[-126474,49675]],[[-57481,51904]],[[-135895,55337]],[[-81168,63651]],[[-83863,64216]],[[-87205,67234]],[[-77686,68761]],[[-97943,70767]],[[-92720,71166]],[[-116907,74877]],[[-107008,75183]],[[-78172,74858]],[[-88639,74914]],[[-102764,75617]],[[-95433,74519]],[[-123351,73097]],[[-95859,76780]],[[-100864,78562]],[[-110808,78031]],[[-96956,78949]],[[-118987,79509]],[[-96092,79381]],[[-112831,79562]],[[-112295,80489]],[[-98130,79931]],[[-102461,80205]],[[-89108,81572]],[[-70144,85101]]]}},{type:"Feature",id:"CHE",properties:{name:"Switzerland"},geometry:{type:"Polygon",coordinates:["@@ƫŹȳϞƵіwá΅χƙةŀǻ͹ЏơƄһ˵Л¡αǶ˽ςБſ^ϠؚҾɈϤûɲƞ܎MǦǼ࣒ʱ"],encodeOffsets:[[9825,48666]]}},{type:"Feature",id:"CHL",properties:{name:"Chile"},geometry:{type:"MultiPolygon",coordinates:[["@@Bም࣒@Ԓw˧ͻܛʻЭ‚ӻä؏ʨ࢟ŨੑҸ࡫Ҏୃशۘǭ୼֗૜̟ѢϬ˘ֺޠΎװı"],["@@͢୅؆ŘĺɁ˿ࢍࣵг€ඓǫ˓ʦ͡ץԹջ߁̛ރĀ߿ԫࡹϮฏɔƵCޛӑࠍpۯٍշFޙʮࠏԉ̧ɣݡȟࡱƚ৿ͷǡȞॹϜ͇ˡΛ϶ǙĚ̓νǃĜӱ̫૗ѽܓĮыˇՑ٣υôࢹ̧̐֔ÄgؽΒө᎔őުſݝPЙȷݷ̣Ɖ޹Σoॅ˚१ג@@ਲ਼ӔˁՒʄӰх֒Ņ෤Φ߰ࢴٰౣʔߞݒ˸ඊत̏Ѯგ֝ɠʿ਻ՉŠ˂ல˺༒ϮָʍࠎéूΠ„Ԩപ׈എΤబȗ఼ʤۚĵਞӮਆưྺ˒ნˀሤÕ൘ǩ஄ќɌɦњЬֱŐ؅ѴΡ˅߽Ҍह"]],encodeOffsets:[[[-70281,-53899]],[[-69857,-22010]]]}},{type:"Feature",id:"CHN",properties:{name:"China"},geometry:{type:"MultiPolygon",coordinates:[["@@ԑഓΫۏѷ܂ĩخӶࠜڦَϨʡƣԓ","@@ܩЗۏʺyܢаϠࣾɾӚoȊ͍σσșӟ"],["@@ฬˍ঺ׯͼ߃౨Cܰͨ൸ʜѳݱ͙̭˽ः֡ࠇ৵ƪܝ̑ɜܙť঳ѕwLяթӺͯһಙαƀѹܩŒЍ˂ֽ׭ऑҋۃա୭ʑأϽࣝɭ҂ϴǭ͞ږ֠ѹѲܷ̓ॉ׏ԫթ࠙¡ѓϻѸ֩یƏ„ϕڔʕस׶ݚ͝լuƌѱஓɻϻҏࠇућיࣜҥͦࠝԞޓ֮٥_دՅɯȪ҃ӶʻŻۃɇڗҷ÷ؗࣧڹિޭোିޡୟۻृĩԣύ̃˘Ӈй୭сࢵŹ˻ࢱҭ·ə؎Ȧ͘ૻːЇƍࡍɔЏ΀ƄӜޏƶЙܑ̀҃ࠇīڡJ҉ȳѥūŶ॥҃x÷Ȣ}Ύ؝ʓεƸر͂ʔۤՏǎȧޜࢱƓĴাߔۮ”ۚ{٠νȨ˭ӶӭÙࣟŲ˴ΜϿԺ׳Ν۵ȸॷ՗އسڳĿοɦѹr׷Țґɇ֋رëڌԟǭওĈोȖڿτٵǔ˯ЖҽŦࡓոکʴΑȩଢ଼טࠛՒɽऐ׾ő‚іͭјĐۆࣙঠ൧ͼʝ٦ةϼƫʌųӎˆ͜ԛȔ˟ďɇިʈȔśȠߤЈ׈ǐࢸő͆՜ંIJͮ̚೜ҔŠȐãӐּɔݱฦဘͲјȈ؆ຒဠˡҲϞ¢ࡆۦĀٖ֔͢èɚו۸ѽப̿׆ڱ͕ঙ̢ηূƝଆŝ৪ԻԲġϤޟӲӿऒnჄȉ૤Ŝࠦůఔԛ৮BόʽঐҌബ̈ాŒঘ̒׾҈ך˰Ƌˤˍ͔ѴըӀùࡺǝ࠸Ѿ౲͚؞֊נʆ௠ŐڐĥĠ̘ݿזګː٥̳ࠣžӇŃɏΆר࠾Цو৚̓ஆՎQτݸࢾҲːWҪңȦۜмਰƲ૜vసʡ݈̱԰ࡏ̀α̊ԩ̶ࠕ"]],encodeOffsets:[[[124701,24980],[112988,19127]],[[130722,50955]]]}},{type:"Feature",id:"CIV",properties:{name:"Ivory Coast"},geometry:{type:"Polygon",coordinates:["@@ϣUוǒ՟Wহƥ׍ʍ̯ࠫNjvÞۖĄŀ}ͨΣΚˉÈʕɲǾώčО ʔƄB¸ξÝnjĄŜ̸ĶȹڨȗΎæ˸ǘÞŊúɸųٮOƸʖƢgʎĦžΫȞłΌŰϚǽƦ˥Ϙǯ̎ɄϾŒֺɏɠ஡Ο۷ɕेθܣ›ͧ"],encodeOffsets:[[-2924,5115]]}},{type:"Feature",id:"CMR",properties:{name:"Cameroon"},geometry:{type:"Polygon",coordinates:["@@Ľ°ӻŇԝŒЋÅ൅nŬڒ͟֊ϧƚǟϖɋŦXɶɎתЎ߸ʒRԄӮ͈bҾΉ־˲ĀΔȌͺžь҆ΊǞךDzȊŢѨɜ՚۾ٲ¬˨ĠƲͫͰ‚ˌʂ¶ͮ՟Ê֏‹֏ҜޅҷTʁÏϥČǻЅӸөμƛŠΏˆ׃ſɩх࡛ȫƳÝٳČΝåʡЈѭð̴̟џϨ˓œϥĘʏÓґڛȤڷɜ੗"],encodeOffsets:[[13390,2322]]}},{type:"Feature",id:"COD",properties:{name:"Democratic Republic of the Congo"},geometry:{type:"Polygon",coordinates:["@@»ঙͶŕˑ̗͓ɟ͍ѫǯϷ±ګț͍Oهʍɹ‹ԃŗÝýҟɄϡÂ৥ưޝċѧǘӣӤҹҒ੕ͥĒ૿ƙɣĵʇՙȊχƫষĻࡇɨƫט͝ɲƴìٟࣟR·Ҧ̳ΨٟŠȋѰԣ˅ڧŞ˫ϢՕüϽqµʾ́rϥºԳųιtȻû®ৄ˩̸ÕԬŬԒǝ͖eՊ৳Qò̢ѕG­ƣԵɁӧűȿҫŠˣş։å͏Ѱȗ˖ʋԌȷض៛\\̍ķʑh΋œşʼɊʀμƎɎ̪ǰɚđ˼͐ҜSÄʃ̼ƩӶՄӨШɆːƒ۔θࠆϬўքМĪˌt̰Ǝ̆«ӊŀݖǐԾʦ҈¸Ԕúה͜ѐҊ˔۔˷՘ؚ̳ĉظǏʦԖŘÞϦčनоͨDZ˖~ŴȲ̺ðلėբoˤĚԘۙϘķɤƖϲÅҶDzȦΫ݊֏"],encodeOffsets:[[31574,3594]]}},{type:"Feature",id:"COG",properties:{name:"Republic of the Congo"},geometry:{type:"Polygon",coordinates:["@@̿˾ʩƗͻγۏࢸٖҪ̓֌˾ɂ֦ĺäό҆Зݐ•ʴЈł֒ĝڀЉӺζ঄ȽǘسçɻѢÔξ੘ڸɛڜȣÔҒѰ޲ԆѼ֪Ɨդ±·ԓʥ҇ǏԽĿݕ¬Ӊƍ̅s̯ĩˋփЛϫѝηࠅ„ۓɅˏӧЧӵՃ̻ƪÃʄқT˻͏əĒ"],encodeOffsets:[[13308,-4895]]}},{type:"Feature",id:"COL",properties:{name:"Colombia"},geometry:{type:"Polygon",coordinates:["@@ΫȤЭ˨ʅƅ܉Ŝȱΰƽ_࠿Ӓŕʺ̼ڛтȢ̦иÊΞՆ͐Ѵ̳ȦDŽӦȏސǸɚƃ܄ͻ҄ņТ˔ÑǂʠțӶĺŬѢـהΌĚT˦ƺ܂ӖϸՊfäǪڂéڌъ͞ȊОК̖»ɚɛǍ˱գƕɇп͗ʋʓ̷Ĺ׵ɷӭѢÇņϭȄȁâ͹ij̵ˆǫȸéȨ̉ઊĄӦŃעܡͼĚ؂­ӐĪ̔ƟƱҍȇ˯ß׻ǜ֑ʆʟ†ȉэл̨ȃɠ̋ʰ࠹ǁĻǏӸɷˊ˥́࿕lZԿӰē…͏ǙĔҿƑK؏ώ̫ƀӓoηϙᘯп҂ʣpժࡤٟϾԍị̈ƤҧɝصŀӵࢤϳɐˍІ֑Њɡā"],encodeOffsets:[[-77182,-155]]}},{type:"Feature",id:"CRI",properties:{name:"Costa Rica"},geometry:{type:"Polygon",coordinates:["@@җȆǟǮĬƤ‰ȄɷȪͥǔ́ņÅʖəƮÄʑǗȩȓɸˑĊŗǞLʮŎˆʁŠȖnjŴňֆɝȖŊˊéƔǥʜÇȪDzɈҙ͖ͷЂΩ͗õLͷǪűűıƱëǟ©Ǖ"],encodeOffsets:[[-84956,8423]]}},{type:"Feature",id:"CUB",properties:{name:"Cuba"},geometry:{type:"Polygon",coordinates:["@@ܨÑڊW߄˹̭ͮ޺Ĩ̔ȡ܈ԳԺϛˢ\\ԆǟÕʁئ“ٌ΅ıȟ֑Ń֡¥׃âளą֜Ҷ΁ɔէÈ̃ʐȥӎӃ޵ɦʥǬભž̋ǐ̀ɀࠗ¨׿ѧΏ[ťȳеğΫĂѺʸǼ̤ϞȈіǎَĄȰĢ"],encodeOffsets:[[-84242,23746]]}},{type:"Feature",id:"-99",properties:{name:"Northern Cyprus"},geometry:{type:"Polygon",coordinates:["@@ÐJŨȮ؄Yކʢ֧ΧÔƿęˆLJÙűj¥iĎѾNjVɫïƿ¬"],encodeOffsets:[[33518,35984]]}},{type:"Feature",id:"CYP",properties:{name:"Cyprus"},geometry:{type:"Polygon",coordinates:["@@€ãࡱͿЩŊȟͶЎŒǀ«ɬðnjUÒ½j覎ŲiLjÚ̇"],encodeOffsets:[[34789,35900]]}},{type:"Feature",id:"CZE",properties:{name:"Czech Republic"},geometry:{type:"Polygon",coordinates:["@@ϯǂЁ©ٵʲ̏Ùҿ΅ر˔ӃΰѕȬėΠƧʠؒǾ̸Ⱦ׾ǎɂdžɜīϒĖЊ˓ؼñ¿ɳҘǧŲɒּĥĄʿز»ϮЯʡCŽƯȕ—ÅȑLJ¡wý˹ēϋbšȁ"],encodeOffsets:[[17368,49764]]}},{type:"Feature",id:"DEU",properties:{name:"Germany"},geometry:{type:"Polygon",coordinates:["@@d͗ࡔțS̗ࡢǂҾɰॊͧІˋȞёɹɣ̨̙Ⱥ҅ß́Έ՛ϑĕɛĬɁDž׽Ǎ̷ȽؑǽƨʟĘΟіȫӄί̑ϯ̟ŃŢշýƛʿǤЕ~׷ƭݍ–ţɛыɺʩ±࣑ʲǥǻ܍Nń״ьֺ௅ƸЇɘ´ςǗȐĨ֨ƗࢢԎ@Ɉ͂Ⱦޔƿ˴ǐDz۰°Ƽȃ֮вȓ̀ӈٌōՠŸ"],encodeOffsets:[[10161,56303]]}},{type:"Feature",id:"DJI",properties:{name:"Djibouti"},geometry:{type:"Polygon",coordinates:["@@ȤʹΑӏȩήɯ̱҇ȅƬȭÏҷb_ʮßɶ˴Ѐ̐ϊήñʪȴ"],encodeOffsets:[[44116,13005]]}},{type:"Feature",id:"DNK",properties:{name:"Denmark"},geometry:{type:"MultiPolygon",coordinates:[["@@ԋڹ࢟ӄŝΒ௼˨ˎу"],["@@ȵ̓ʡĞ؁؁ɮХ՟ŷًŎͽҲ}࡬Ɣɪʌʦ݌À̐ɴڮʂƒѝʟ˙ĶɽҘŵ"]],encodeOffsets:[[[12995,56945]],[[11175,57814]]]}},{type:"Feature",id:"DOM",properties:{name:"Dominican Republic"},geometry:{type:"Polygon",coordinates:["@@ŀƞپIӾɏɜtƴ̕Ҡhʡϐ‰Ю̷̯ͿЍǼϫ•ˡ¢ƱƵ͑½ŷȲˣťͳֻɏƆ§ʎjɬɍʦȲƚÞ͒óҜ"],encodeOffsets:[[-73433,20188]]}},{type:"Feature",id:"DZA",properties:{name:"Algeria"},geometry:{type:"Polygon",coordinates:["@@ᮩཽᝩ࿷இϑटćU՘ϵƌԹʊȧЀᬻᆴᬻᆴṕᎠfnj@ÊQ঺ബب࠼Ÿێɦ͎тচͪ˜جӢòϞ̶સƚƸ͜ɛDz̃ࢲ¹Ԟ́ՠ߰ҠࣦƢՌΎ߶ʰ෎Ƭർæшůߊͨ࣌P΀ȝֺ¾ǟћƄߟȡۙԭҵôمۊԃRȯԮ͹Ϊຝ˖ݏ°ϵƧۇÔϥŃҟòՇͫΗӺؓŽέ̘ҵϼƸڒϷςՃ"],encodeOffsets:[[12288,24035]]}},{type:"Feature",id:"ECU",properties:{name:"Ecuador"},geometry:{type:"Polygon",coordinates:["@@҂غǻξ͍ϵԉςǞʀƙބ̎ŴƺԼ͆զÍ΄ҢǸ׀Ͱࡀӑƾ`Ȳί܊śʆƆЮ˧άȣŞٓʽճࣷ࢟য়ͧԥܵǃ֣Ӆ΋ΙъͻĞ΍áw̮ʈȨıΔ"],encodeOffsets:[[-82229,-3486]]}},{type:"Feature",id:"EGY",properties:{name:"Egypt"},geometry:{type:"Polygon",coordinates:["@@ɽͷǹىɫѩȝƥ˩˔ϛϒ׵ஸđùΐࢯԪࡋٌವ̴ҙ˒ӃݮछǗƣ‚ճ঒ݭƨǣΏ@Ὁ@⁩@@ᶶ@Ჴʥڲɐ԰Żά̤Ж૦b߲ɝ࠲ʛϴſ٨ˊΌʊݎêװŃɮеȜ˜ڨȣټ³аɄւ෽"],encodeOffsets:[[35761,30210]]}},{type:"Feature",id:"ERI",properties:{name:"Eritrea"},geometry:{type:"Polygon",coordinates:["@@˻˖ΉӰϋ˒ɏܷ̄ͶֻXȭǬӯȡԛϢʽط঑ǬęʹβఀĊ֒ˆʴؤƐьӒӦঃɴޗҢУବߏҲӍҖӝˀ˿аʧʩȳέò"],encodeOffsets:[[43368,12844]]}},{type:"Feature",id:"ESP",properties:{name:"Spain"},geometry:{type:"Polygon",coordinates:["@@¦״΃θஒ؆ਊƱ૾NࣂƝۦªമƒͰ͛໺ϡ̨ǺीϝআŊ®ӥߓ֓ઁǯõ˱ԩү͕ہ͞ӑӟϑǹճىǗש٥੧_ߟhՃ͍̓ͅЩê̵˴ʃӚ޷žé˦̶̀Śɬ̃ʢɶրͳԌδè’ЈƎŬZپϲɪɻфөˆƝŁӹCɁЬ΃ū̥ɇ"],encodeOffsets:[[-9251,42886]]}},{type:"Feature",id:"EST",properties:{name:"Estonia"},geometry:{type:"Polygon",coordinates:["@@ĮӸ̱ŁՓ̘ñӘਫ਼ɼ੔Ũ࣮Ƒࢂ|Ŵƣׯӝʞ޵ΫˉۙDܡ̸ρļ܏Ʃ"],encodeOffsets:[[24897,59181]]}},{type:"Feature",id:"ETH",properties:{name:"Ethiopia"},geometry:{type:"Polygon",coordinates:["@@ԜϡӰȢȮǫּWܸ͵ɐ̃όˑΊӯ˼˕̏ω˳Ͽàɵ`ʭҸaȮÐȆƫǽ̴̕ҧ̴Й̛͎ᩨঽۺNᛛᡃફ™ݟףաeɯ˅ַB͹˴ލΙʝΓ֕àȃĬȟwˇT੟܌ב@˹ˢ@ҾѧƘӻࣴϥȚƧʹэЦԧÒ˸ӐҀrŲʰ[ݲʞࢠЊɾĎ΄ήٜԔи΀ࠠƆܠ঒ǫʾظ"],encodeOffsets:[[38816,15319]]}},{type:"Feature",id:"FIN",properties:{name:"Finland"},geometry:{type:"Polygon",coordinates:["@@ūיಀ֓ޡى঎ख़֡ܛݴس΅յఘֻ́ѓޭӟᅡੵໃá๑̯ൃǯӡҞ߿ˠȈࠢСݶАӪނՆ኎࣮֖Ǭē΢ୟЈ˳͜uಒ಻ֲ૩ЪԊɞतѻલ¦ࣘȭߠϊЬ؞ಬ˶઄ͯΡכ"],encodeOffsets:[[29279,70723]]}},{type:"Feature",id:"FJI",properties:{name:"Fiji"},geometry:{type:"MultiPolygon",coordinates:[["@@̂ʍƓѭԳŗҩļąτ͖̀ϤĻȼƐ"],["@@՛ǯŅ̼оǤˊ°Ӱˀ@ЧՕȷ"],["@@é­@ШǨžĽЗ"]],encodeOffsets:[[[182655,-17756]],[[183669,-17204]],[[-184235,-16897]]]}},{type:"Feature",id:"FLK",properties:{name:"Falkland Islands"},geometry:{type:"Polygon",coordinates:["@@৘Ԍ܎ȿԌʹڦϙʥ̋ଋʥϙ̌܋ϙпϚ"],encodeOffsets:[[-62668,-53094]]}},{type:"Feature",id:"FRA",properties:{name:"France"},geometry:{type:"MultiPolygon",coordinates:[["@@ˣ٭ϡǠș֢ǜ̺ը͎Ɯܛ"],["@@הЅќà݀ϥȊñʎjЈɗெƷыֹŃ׳ɱƝϣü‚ɇؙҽ]ϟВƀ˾ρ“ʁʚ̿̅ʯɐٱҖŃĩηݿӅစɬ௧˗ĩԑঅʼnिϞ̧ǹ໹Ϣͯ͜ѢԎdžူࢁࢤإю౹͒čؖઠǾථɏˇॎߌέዠپʨێܾǞŪ̑ϸ_ϸ͵"]],encodeOffsets:[[[9790,43165]],[[3675,51589]]]}},{type:"Feature",id:"GAB",properties:{name:"Gabon"},geometry:{type:"Polygon",coordinates:["@@ࡹࡔ։ۚԙࢄ‚˨ǾˎȲؔǜخ˴¶௢SOৠЌÆԞőӼňľ¯ÓνɼѡشèȾǗεঃЊӹĞٿŁ֑ʳЇݏ–҅Иãϋ֥Ĺ˽Ɂ̈́֋ٕҩ"],encodeOffsets:[[11361,-4074]]}},{type:"Feature",id:"GBR",properties:{name:"United Kingdom"},geometry:{type:"MultiPolygon",coordinates:[["@@҉ֽًǦԱ[ǦҊǥ҈۴–ࣔԳ"],["@@࣋ࣧࡦŘऄIɕۅݯݩࢄÃäĕݠ঱ֺƇԬढ़ʈͧৰDžķ՝ѓʗͲѣݱѯ૳Rෝɱϻǒ։ϿޥĪם͍ҁǘ௼ࢨݪǺOBಽƔʃͰ࢜ʺҡҐdžռఢ÷D@ŮӤ֛Ԯ_\\৵ƨȧɬ̨ϒˡɴҍЇ·߶щє̨ࢆٶھڤá০ì"]],encodeOffsets:[[[-5797,55864]],[[-3077,60043]]]}},{type:"Feature",id:"GEO",properties:{name:"Georgia"},geometry:{type:"Polygon",coordinates:["@@Ųάȿִӟ̲ҭĬ̯ʴĺIJ܄ƝఆƋଦЕƦƻԚƂ޶ǭʴ·Նșɓřвғŗıҏºصʎȵƍଢ଼ſ߳Юࣅ¡"],encodeOffsets:[[42552,42533]]}},{type:"Feature",id:"GHA",properties:{name:"Ghana"},geometry:{type:"Polygon",coordinates:["@@೉ӯҳ˽ݳʑݡʆœͨηܤɖैΠ۸ɟ஢ŗنrӊฤ¢ϊÕ˔ƊϴáÕʿΖџC؍Ąڍɂ̫ȅݳäйɢՓȈ̍"],encodeOffsets:[[1086,6072]]}},{type:"Feature",id:"GIN",properties:{name:"Guinea"},geometry:{type:"Polygon",coordinates:["@@ʃtǡͷʁJǏǴÈͶΗԨɕħǵmɳ³V̮Ƈɘ‚ʔǻΜɹ̜ڥDțǁɵoƝǷīɹ҅σρӼ͛͢ɋŊȿǖħϊūȂʓƐώЦʮeɖƘȄDƄŎï˨ĢĖd˶МU؀ȱȄlÚĤҜáŨ´¶̭ƆBɖŒƔƒɸɇάãɲǺ˖ŒȬŠǚuȈȁĴɳΆΙǣɏ˙ǴĊŀį«ʡʲʍǗÝå˷Ș΍Ⱥڧ̷ĵăśÞNj·νƃA"],encodeOffsets:[[-8641,7871]]}},{type:"Feature",id:"GMB",properties:{name:"Gambia"},geometry:{type:"Polygon",coordinates:["@@ņόࣶzȎȦˊ`ͨȷʼIˢƚǞʏεȋιdέǰ̷ȗƭQȫŝއl"],encodeOffsets:[[-17245,13468]]}},{type:"Feature",id:"GNB",properties:{name:"Guinea Bissau"},geometry:{type:"Polygon",coordinates:["@@҅ΘΝÈȕʀLŸʯǴÁǶѼƌ˦ɦĨ༈•c˵ġĕð˧ƃōȃCɕƗʭfύХ"],encodeOffsets:[[-15493,11306]]}},{type:"Feature",id:"GNQ",properties:{name:"Equatorial Guinea"},geometry:{type:"Polygon",coordinates:["@@ƿŴ़̀െmPয়௡T˳µ"],encodeOffsets:[[9721,1035]]}},{type:"Feature",id:"GRC",properties:{name:"Greece"},geometry:{type:"MultiPolygon",coordinates:[["@@Ҡ˱ٺ¶شÑqƣҜĶĿʛ௃íTƒਁǎƺΦ"],["@@ʹՁȥĥԟ|ѫĀৱɓ׌ҿяƋҳAѻўƿȁȊԅрЁ̓ǿҴϯжʑ^ӅޥɠʜѕՓĕ͈ݏ֏Yۍμ̿ڦƧ֒͝ϮљӐÉʆϸТ¼˚˘Ũjɚռö͌ȀҖgƒƦdž„ت{ڨɲע̉ކĀVмЦɝ"]],encodeOffsets:[[[24269,36562]],[[27243,42560]]]}},{type:"Feature",id:"GRL",properties:{name:"Greenland"},geometry:{type:"Polygon",coordinates:["@@ᬜԆ᱒›ੴ̴ᲈĄ䀦Ŀ㉊ڗ༅͕ộ™⭏ćшƫᲐĠᡚ́࿈ʴۦ̝इӧᒞ̺✘͚ᠼNjҾΫ⃝ױӃȕ᧑ơወ¡ছؕگկ€ध৚շಽ“൧ˇ༂ѽȢ܋࣍ýઞܡህÑঈ΁˟̑இŽ୥E੆֩\\Ϗပΐћɣଌȿ઼ԣ͈ڱກlj٫͖ਣӘ˼֭উѵᕖ•୆¯ᖯܵᗿڏឧ́ओIࢅ͓ୟࢱᅵכׅ“૧ȷ஽ȝܛԱ[כыտോڧͺٿϗ۝љࠍஅ½఍ۈဿLࠁҢ֕ࠐฝਲэոŗݮ୓ޢ̢ئ֗̒ࠪচొ̺ͨΘǬڀॡ̕қůݯţਏ˜Éְ͢҂ެ\\႔ɟ෿Քݩ˾࠷ş۫ȼम޴ԝ̺ڗ׈ৡࢼ੯͚XΚᖷӮᄻÖᖟ‘Ꮕ×ইˌวՈᕂ˄ၚ¬≹ɖ቉΄Ś͜ẊИᶎИ̪͘ᗗ̠ܺͰ᯲ז௢ĚΓϘጲɜᣚƂᣖRࣺʽᕺҨፘ̽୺áპ˙ፅҐŘή"],encodeOffsets:[[-47886,84612]]}},{type:"Feature",id:"GTM",properties:{name:"Guatemala"},geometry:{type:"Polygon",coordinates:["@@ћƦԻfϩǖҍΌrʖĮȠšƾКۆ઄Ft˸Ƌ¾ġǺ̵Ț̹ˬϜDBӂ޸BަUOڗßॅʤ@˚ƱòŰʘŃϥ͍ЉɻÏljâǑǧɇȟ½¬ıƿġ˽Ƀ}ŭ"],encodeOffsets:[[-92257,14065]]}},{type:"Feature",id:"GUF",properties:{name:"French Guiana"},geometry:{type:"Polygon",coordinates:["@@͉͑ГÑŗʀȉ–ʹɩνǦɈΪòϤƢή͛ӸáֺѪܠ˸ğؤȥࢸۿƔ·ӻޑʳأ"],encodeOffsets:[[-53817,2565]]}},{type:"Feature",id:"GUY",properties:{name:"Guyana"},geometry:{type:"Polygon",coordinates:["@@ր̯Դյzџ̈́o҈Чͪ̇Ƈݱԛɕ°ȣƹџϊ؏ːAŎӃԢܳȱ‰ҫî˙ɡϟƥ˅—ġǑЭ¦ԫЀÓϴɋьƆܐɸ̐ȕϸ˿ŶŊτțȘѩ™ْ֩ɬɲiϲԬƊȾƾ˽̸ô̬ږӲ"],encodeOffsets:[[-61192,8568]]}},{type:"Feature",id:"HND",properties:{name:"Honduras"},geometry:{type:"Polygon",coordinates:["@@ơˀʭòÐʹŗĞǣÒσij‹ŔʩƈǷǚʛìǨɈáǒÐNJЊɼϦ͎ĔȂƨʊ\\þ垦ϸùϲv˒ĢİĦˎ©ȪÉɘnǖòϨśƄkʲƿʐį̏Źɜɳ˽jśŕ̇ŋɃAȅŃǙœƛźĕ{ŇȩăRaǥ̉ɳƹıđĽʛǞǹɣǫPȟqlЭūQĿȓʽ“"],encodeOffsets:[[-89412,13297]]}},{type:"Feature",id:"HRV",properties:{name:"Croatia"},geometry:{type:"Polygon",coordinates:["@@Ȳ͗ˊʇ͓̓ϝȆׇ[ܟƔϽmǻǧ̝ȖǫΑЪϽǼʹϮ̽͌ȃ͆Ηݔ͇ġƛ߃̶ӣ̢ޑʠ۹ؤǞØϥΞe˲եƄʱγʝˮn̆Šbג…Ƹƚ˸ƍͤgGɼ̈ĒĈͺڞɠˊĻؼέۜlj̼Ų"],encodeOffsets:[[19282,47011]]}},{type:"Feature",id:"HTI",properties:{name:"Haiti"},geometry:{type:"Polygon",coordinates:["@@Ԣ™ܰƁôқÝ͑ȱƙɎʥiɫ֏ƜЅÍԡÔϽƿ҉ʾö˔ޜśيã̢ȈϧθP͎ՋžȌɶ"],encodeOffsets:[[-74946,20394]]}},{type:"Feature",id:"HUN",properties:{name:"Hungary"},geometry:{type:"Polygon",coordinates:["@@˨ըǍǼӂDÜ΄ђɋ̲ğ۸ļäǚͮ~ЦžĜÃЂŀȠȢˠ¼࣒ʭǴĒҲɭÎɣԡǭЉ֫ԕ֭کǁԽš١ə̻űۛNJػήˉļǍ˴ƗV"],encodeOffsets:[[16592,47977]]}},{type:"Feature",id:"IDN",properties:{name:"Indonesia"},geometry:{type:"MultiPolygon",coordinates:[["@@Λe૝ך޴ǒѴʭ̎ʭ»ɩ"],["@@ܙȁijĶø˸ΰԢࠨͬĐǓfʫշع"],["@@̢ɣԲèȼΥॿǛ׉őҍP̀ӚҤPɤ̖"],["@@ūұ౅ʅૣľE̬ښǪՂʥ֔Üݬ̮"],["@@ྔċȂΌ༘З̪կీƵਐӿय़͋ऍ͸ݻwࢍØ޻ưঅ͎؝ČΓŁ໕ΌƣΰޑØּߤ৶·ڴ͡ΒÛŘ̗"],["@@ѝֱćنƬ̠Ǭ˴ȒʗCЏ"],["@@̿˥ׅƸǏΰࡘ¢Ⱦˣ"],["@@̨ٝۿΌۯìӃÅׇˆȦҦਠ”ऎʕ"],["@@ɼയ࢈ԉ۰ࢼ८ԔݜBܘ̉خ̛ࣘLJbᩑbᩑݟې࡟ǜȷʇ੡}ΦۂՈɺɕࣲЕ۸࿃܆ۗêృަʛУ͑óȏ̮GκٛЮ̢ࣞ״gëɠ௵DͩԄݥƺΡдଈȰњ˜ഘ·Ƃ̹"],["@@ڭ࠭كlj߱ǐඓ¥ܽŧţٍݪݛҒϠ༪˸çϯλŪιӯ͙݉ߒ੿Ƶ˿ݲॻQտ҅ʙ̐͡Мی࠙͗ȻɶŊ͖؅ӲØࠌ֕ʭîও”றՓũίʚʌޜŽ߸ΛPʻֺΎվŤښф౎ǮΎ܎ذپʛ੖śॴ–ࠨ؎Ʀȉ"],["@@©ܽџĈŷԝΌѷɽĵ͹Ւʟ੺ǚڤ˨̨ÔҝӸóĀ΃"],["@@सާহį˫ֵšݿַ߱u࠷͕౻ŭ̚ॕϙͫԤ׳´лːৃ̟̩Оս¯ۗĬŹૺнɺЕܘŝ݀ĮުԂ֐Ɩָ֗ӅըǠ՜ÑӪъЖôߒɽۆǶњୠ͔̈̆क़ॲ@ܰƙӍݷآߓơϭ"],["@@छkۻ۰અۊέԚٍۄзؾٕ୴۪݅ʙܠ̳ڀݵՊѭܘمҺࢗऒóђզ‘ಢNjݔࠓٮ֫ҪΓߔࣙࡢ_ۺֹӠ۳٘ϥͳۉӖ̞̅sƜו̊ҵؠõФՏɁ਱‘ಟ"]],encodeOffsets:[[[123613,-10485]],[[127423,-10383]],[[120730,-8289]],[[125854,-8288]],[[111231,-6940]],[[137959,-6363]],[[130304,-3542]],[[133603,-3168]],[[137363,-1179]],[[128247,1454]],[[131777,1160]],[[120705,1872]],[[108358,-5992]]]}},{type:"Feature",id:"IND",properties:{name:"India"},geometry:{type:"Polygon",coordinates:["@@ࣚটďۅͮїѕ׽ŒɾएࠜՑ୞חՑϟ͛޻ࠀͅߊЭરһସʼnӜёٮāৠȝ۪bĪͪŋՖÞβԠǮìڋlǙކ͉Ոƀ܀Çۈ|ÐԪ΁ˎڴŀވشॸ՘۶ȷ״ΞЀԹ˳Λ࣠űÜ͇̍Ʒèԫ׷Ʋછׅ~ӓҩ۵§ХϏۗځȒࢇȏ˹ĚΣгȥѵ೰ɵEƍ՝ҡѦʸӎϖ¶ϰ܆ӝƜީ]ߝŚóאБ¤ڕζ֭̓؆ѻԿ̻ȅ̩Ԭɣƛԑ̆كžەţֱ̫Zਛǩ´ك҃ӻ௃֡ळ঩كՋ࠷ջCϭлȹݳ̝Ͻ«ʥٙǪધ®ۡΣߙI෗ѣ¡ϣٙʰˣދʃ˱֯͵ʍߑ޸ϳ୴͑ࡒ̍Јѿ߰ȻੂơՀޅ଼Α࿀ʣ੾HৰǍ޾௣ԉףĶ઱৲И̤ʝͤড܊֖֔ᇜCǗܞҽюĩ٨ջϘऒࢢঊÙ࢞ࢢՄ࡞ࠄࡈ_״ܒӠڳд֪݂̇̕Ьβ౤ȱपŰߺ۸"],encodeOffsets:[[79706,36346]]}},{type:"Feature",id:"IRL",properties:{name:"Ireland"},geometry:{type:"Polygon",coordinates:["@@ƒ׷ًݣ๯ӹ஑Ŷڼ࢚ѭࡢତڄٌϼǦ҇ǥ҉Բ\\ٌǥ"],encodeOffsets:[[-6346,55161]]}},{type:"Feature",id:"IRN",properties:{name:"Iran"},geometry:{type:"Polygon",coordinates:["@@݈njװӔ֚{τƾװýघэڤğ।ݓظ‰òۻ΁਷ɱؑκŭΫҡˠڡàՓِƙæեݿݿжѵ͸ԓߦυx݉ДƋêϯ௉ѡ̓উཌྷʪࣷȖेŊΧਐЕƪ٣ƭࡑНਇ˦ࡑ٦߳ʈ֗ߘا૪ҍƋՕ˦̻͝ҭѴS҂ˍ@Ɛ،ѝٔ਍Ң׉ߜȜپц̂ÙӬտʨխ৊ҟڨǐʼʿ६ּʈƄͅъϯ־ő̤~রئ̀Øʞʙ́гԼѱȾ¦ˈإߖǩ׎у஠ƟಾɞĄȞ"],encodeOffsets:[[55216,38092]]}},{type:"Feature",id:"IRQ",properties:{name:"Iraq"},geometry:{type:"Polygon",coordinates:["@@րʧÚӫх́țٽ׊ߛ਎ҡўٓƏ؋ˎ@TҁҮѳӿ¤֟ê؝߭༟äᛍၖఫךৡɪ͹৾ᇶ࢔͆৬āؘҢȺјԾΰž঎Ň̐ɉЖƚծ৉"],encodeOffsets:[[46511,36842]]}},{type:"Feature",id:"ISL",properties:{name:"Iceland"},geometry:{type:"Polygon",coordinates:["@@șիॊֵથٙᝓֹܣƵૉŮᚑˈࠠψᆧЪ๪ǎ—ʘᄋȜ֨նౠŰಸ֭౨Ҝ੒ʃൌ҄ආÑ"],encodeOffsets:[[-14856,68051]]}},{type:"Feature",id:"ISR",properties:{name:"Israel"},geometry:{type:"Polygon",coordinates:["@@ƥ˅̣Ŝǫ֓ɂĥɋř—ɛЄŖp͛нഉց෾ʔˢ˶ɞϼǠيŤɆzVˬCþƦɤ\\`·ŕŵhM"],encodeOffsets:[[36578,33495]]}},{type:"Feature",id:"ITA",properties:{name:"Italy"},geometry:{type:"MultiPolygon",coordinates:[["@@̟ڋŲʹǭѝٝ̈́ёĞ୩ѐŞќজûࡪĠْò"],["@@Ԍ׭ş૕ϣÂ΁˫͇ɞ‘২ȓӒҨ¥рʼ"],["@@ரɏĝЯȬΧڝŪہ̗²зĻʇˠё߀чцۛदڱچLȲȃɽǗݪ̥ؠʩܜѫĔƿƽ̛үϼܳƐΝի؈̷ıѫΗ¹҅ܛΕÝHʲǢҊǼǶ͝ӤʱшΑŀʛδգƴεͶثÆٿϜޑմ֯ӜʿࠪйĮہˤϯŕӝϵΓÕĪθҕńɏٲ̆ʰʙ̀”ʂβǵМ¢Ҽ˶ƢƃА€ǼͺتĿψƚâΆԘšĮdžࠨƤȊ̉"]],encodeOffsets:[[[15893,39149]],[[9432,42200]],[[12674,47890]]]}},{type:"Feature",id:"JAM",properties:{name:"Jamaica"},geometry:{type:"Polygon",coordinates:["@@֢÷ҀȫƔɯןeʭƗҹƊӑ̪ĶȔΜÎȒƒ"],encodeOffsets:[[-79431,18935]]}},{type:"Feature",id:"JOR",properties:{name:"Jordan"},geometry:{type:"Polygon",coordinates:["@@Ʀˆपͫ࿪ࣆͺ৽Džų၅у࠸࠿ˣƛƑ˭ٙřȩ̡εʵधƆƒŨоഊo͜Ůʚ@Ԥ"],encodeOffsets:[[36399,33172]]}},{type:"Feature",id:"JPN",properties:{name:"Japan"},geometry:{type:"MultiPolygon",coordinates:[["@@ņ˽ҿԕΉːљțɝӭշʈRЊҬԆӌīΊΜؠǹ"],["@@́ڡƤсѩף੹Ѓ๏½ணॡ͔֡“غษȃষЃঝe࡞أ֗෗իΝН͜ȶݶՏʒͿ־ߐʶѲՈࡌѢ؞ָာʤ࣎ǣࢠ๺֔Б௾ࡀӌ͜ՈਈƟा΢ՎࣀƸҞୗ}ڻޥࡍbࢁ"],["@@נǵרΤȈहఝɯ݁࠱೓ָқँण]ř࠴д٨࣌²ʖ୐ʜټন࢓٤˯"]],encodeOffsets:[[[137870,34969]],[[144360,38034]],[[147365,45235]]]}},{type:"Feature",id:"KAZ",properties:{name:"Kazakhstan"},geometry:{type:"Polygon",coordinates:["@@ӕƹ્דο׹̹KɱЊ੫‚ǡێХNÚࡆ৓ؘ෷ßডũߣݶۋ͆ಥ׼ƽðᓗӹᶽљ£יچ֧ɼॕǩχ˧±ȲȶΖDž̊অ˺ϛݮҩɆ…˜ࠊāŽؘ܎ƎܼűƲࠎƭԲ࠿£܍ȴঃσ޵ǭяƌĐўՙ֘دw܉֬ӞِʕǢڢऊࡺӣŀؘჄࣴಾtᇢ׉঺ͻࢼΠ೰j੺ѥʔʠ୼—ɂЊഷ׀߮Цƿɮ߮ɔ؅ֺϬ˼Ḯ̈ШȺᑆ̴ݰΒຢǹ˄ࢉ࢚Ȳઆ˹éҝ߮´ᑌߎ̭ˁ੶٭ሠᒑ҄ѰୄӛீɎҪƯКӟטNjΨΥ઎ŒѾԣٕ֓ۥÿ¡ࡅұϝဟˢ؅ຑїȇဗͱݲลֻɓäӏԭŬу̠ఝĖඃx̧ġ஥ΞӉǧŽӹ൩̂փşȉρ"],encodeOffsets:[[72666,43281]]}},{type:"Feature",id:"KEN",properties:{name:"Kenya"},geometry:{type:"Polygon",coordinates:["@@ӾۙיͱȹΕ̿Õšףˑ͹Ǐ֑ͷ˥஻ࡀËӤᵁႌƙĢSࢺʊ;а֌̨ؔσ॰įтЉ׎ԬԈ֬ֆѨƗ@ҽ˺ˡג@੠܋ˈSȠxȄī֖ßʞΔގΚͺ˳ָAܽ॑Xᵣ"],encodeOffsets:[[41977,-878]]}},{type:"Feature",id:"KGZ",properties:{name:"Kyrgyzstan"},geometry:{type:"Polygon",coordinates:["@@ȊςքŠ൪́žӺӊǨ஦Ν̨Ģ඄wఞĕф̟Ԯūşȏ೛ғ̙ͭઁıͅ՛ࢷŒׇǏߣЇŜȟʇȓཟŵਡ˘࣫ÝĂӜࣴƕ̮ʸٖĉ੾؂঻ѸױȽإ͂۶ծʟĊ"],encodeOffsets:[[72666,43281]]}},{type:"Feature",id:"KHM",properties:{name:"Cambodia"},geometry:{type:"Polygon",coordinates:["@@΁Ѭыࢄȣ২ՠۨઘdž߀ťۚ͡Ϟׄݖ̱Ȝ֕Ļ৕ඳ٧τԙࢥÓܫͷ۱Ū"],encodeOffsets:[[105982,10888]]}},{type:"Feature",id:"KOR",properties:{name:"South Korea"},geometry:{type:"Polygon",coordinates:["@@ܨযȺխPॷ̓ҥݽljڥΏݳïĥҚƼـχ࢔ذƚֻܘÂúϒ‡͞Ϝצ¢ΨÈŨȮ"],encodeOffsets:[[131431,39539]]}},{type:"Feature",id:"CS-KM",properties:{name:"Kosovo"},geometry:{type:"Polygon",coordinates:["@@›ǣŃPĘ́ȩĐdzɦƾȌȪÒŜ˨ư²Ţşƾ¿ŌƅƒŸǎƻŢLĥȳijij„×ȉӹŻ"],encodeOffsets:[[21261,43062]]}},{type:"Feature",id:"KWT",properties:{name:"Kuwait"},geometry:{type:"Polygon",coordinates:["@@Ǭχõȓ˔هשuȽАݟĆ؞߮֠é"],encodeOffsets:[[49126,30696]]}},{type:"Feature",id:"LAO",properties:{name:"Laos"},geometry:{type:"Polygon",coordinates:["@@˚Ϝœ܆ڹܸ¿ٕࠦھٍÎǛ̉ӯyʣƨࢯԅoݬȸࢮ֧ž³ԎηʸǴ̲ܐնøȡ҄wŵ०ѦŬӮڏϖޅਚO͚ܹ՝ɗʉ̟৔ԉۦ঳Ռ݋َ׏ɄץƵ࠿ݕ̲ϝ׃ۙ͢"],encodeOffsets:[[107745,14616]]}},{type:"Feature",id:"LBN",properties:{name:"Lebanon"},geometry:{type:"Polygon",coordinates:["@@ɣ[ýƥ˫D̘ۄмעfˆϘ§Ɛͣқ̓ȷҟ"],encodeOffsets:[[36681,34077]]}},{type:"Feature",id:"LBR",properties:{name:"Liberia"},geometry:{type:"Polygon",coordinates:["@@ɗQࡽАޅٖ܏Ң֣ըȪː¬ʔϜҘϺϺǶnɖĨΘԧÇ͵ǐdzʂIǢ͸ʄsŸʓĎНǽύʖɱˊÇΤΙ~ͧăĿÝە"],encodeOffsets:[[-7897,4470]]}},{type:"Feature",id:"LBY",properties:{name:"Libya"},geometry:{type:"Polygon",coordinates:["@@ק̷ҿҤ೧βρՄڑϸϻƷ̗ҶήӹؔͬΘñՈńҠÓϦƨۈ¯϶˕ݐШȜðΠėΒ־͔ʶːЦʌ´٦দ́ΜðۮƓ૞ϓЀݛݮǍஆΙࣆйЦɔЖϮț٠˂Ф؄ЀׂŘ଒ǣ˺ϑ̺Iˌƛ࠴ıȲˣ̣ЕżΫɏԯʦڱ@Ჳ@ᶵ@့ॱGYΙ‧ྐ‧ྒࡓҟ"],encodeOffsets:[[15208,23412]]}},{type:"Feature",id:"LKA",properties:{name:"Sri Lanka"},geometry:{type:"Polygon",coordinates:["@@ų࢓ΙʇܵȓЍڜƫீϠ഼׆ұϺסО࢓"],encodeOffsets:[[83751,7704]]}},{type:"Feature",id:"LSO",properties:{name:"Lesotho"},geometry:{type:"Polygon",coordinates:["@@̆ʩʳУƛ˛ҳſƹˍ̛ċؿ٨҄ՐҖ͢ϼǠξʵ"],encodeOffsets:[[29674,-29650]]}},{type:"Feature",id:"LTU",properties:{name:"Lithuania"},geometry:{type:"Polygon",coordinates:["@@ãɊĚɲχƄࢡƨDZ۸२ʴඬÁࠜĊŞǩ҂Ã߲СĀϓۏˏșӃ࣯̓߻NȫʶљĜ"],encodeOffsets:[[23277,55632]]}},{type:"Feature",id:"LUX",properties:{name:"Luxembourg"},geometry:{type:"Polygon",coordinates:["@@ǘȏ³ρʍiȉòĞҼɖŽ"],encodeOffsets:[[6189,51332]]}},{type:"Feature",id:"LVA",properties:{name:"Latvia"},geometry:{type:"Polygon",coordinates:["@@†نЮՆߊ˼ڜعڪhNJ٤ܐƪςĻܢ̷ۚCКȕîС˒ӷ͕ࣗԛƙ߱ТҁÄŝǪࠛĉණÂ१ʳ"],encodeOffsets:[[21562,57376]]}},{type:"Feature",id:"MAR",properties:{name:"Morocco"},geometry:{type:"Polygon",coordinates:["@@ԒΥߜÎࢊȃκU͂՟ºԝ̄ࢱɜDZƷ͛ષƙϝ̵ӡñ—ثঙ͍ͩсۍɥ࠻ŷഫاRহŷ@@@p҉Ա˓ȑϡ@̥Ŋ۹ě˛ٻʿÕЁ੕ୟ࣡ˣୋ΅ϗĵ̡ቅãaD ϶͒ɮ˞ѪÃ˶̀פҴՖ˲ƊɞӬp҂̤Բ̪֔Ւ࡬f\\ц͔ްĢڎָтɠۮۮȿਸ਼͊ܢŔѶդ֨ࡈϦخΐ֘࢈˄ԪؤI"],encodeOffsets:[[-5318,36614]]}},{type:"Feature",id:"MDA",properties:{name:"Moldova"},geometry:{type:"Polygon",coordinates:["@@ȨŮ֒ĊؤʽΊϞɥÑ˵̪ƏŨΗ̊ɇÏűƾčɝ×ӷ|ĉŜǫãÒƭɱˍƥ˽ɁĝƯϦĘΪςӝԂˉΠʹʠʯĈ"],encodeOffsets:[[27259,49379]]}},{type:"Feature",id:"MDG",properties:{name:"Madagascar"},geometry:{type:"Polygon",coordinates:["@@ɠΥȺ։Ɗঢ়ɒϽĉЗƩʙ˷ӰǁʝLjثõΥɵȗ¿܅ͧওб୅ԯཧ͑ୟϛইہȣܻΡӛɊڙ̜ɳѺÇݘ̑ڠù؂Ʈ؄ϰƢD˪Дِø՚șЈǃՌãޠ̊ҺŔՒмŒҶǤ̶Ʋτ\\ӐӎۖԮʦцŗάΦĵҪ׎fԐ˦ϔ̊ί"],encodeOffsets:[[50733,-12769]]}},{type:"Feature",id:"MEX",properties:{name:"Mexico"},geometry:{type:"Polygon",coordinates:["@@͙݅ƥ؁Õ૷ąЧƤқʺЧǚٳ֎سȞӏ͢бࢾɝΐΙ݄ɾٚĎؼưՊƠՖ΂ȨӬè۸Ƣʖ֬ɚࢶȚݔ‡ԚîȬDZ…ЙҋԁȥԝƸƥűγɁٽɅɎǭcǃY̝ԓƳIJķPŭޥV޷AAӁϛC̺˫̶șĢǹƌ½s˷ઃEЙۅŢƽĭȟqʕ्ࣞџ˘ۇɖҷÓګ́чĉץɜؿDŽ޹ϬؿŠ्ϸ۱ВɃɤҹº࡯ˈΓϦࣗӊсՌȧЦ˪ĈđʈȖɔJ̄˱Ϙùͮ˭ъ݋࠴ࡋڀУԼܝ΄ƷȴŸԲѓȞӹФȽהҍæӣѸϿФ™ˀҍو̓٠^͔؇ͬ˫™ӑɴƇͿƔЕĆف̀΋خׁƒȡŸÓŎ˽Ƭ\\ǜթʮɇǴ̕Նё˨ޯʠρɸϿ²ѷКƒͶϡ̨ϑqƭΝ̱ƫJɛԞջӎ؃РїɈ„ؚŵҖЏʺֿϒŏŇɃɖԭȰӷӦÖÚΊ³̸̼ŽϜ٩׶ӱɶ̱Հ̷վϳڦͿݲॖÞ੪ĞÿǑ౔СኀףဪPژ@DΌผ@̪̕јˇԀσ˨ѭȾҥѢʩۤʥՊڒۊhפͱфֹ̄ӯӸӏȂחɾЃپʹ׮ȁ͞|"],encodeOffsets:[[-99471,26491]]}},{type:"Feature",id:"MKD",properties:{name:"Macedonia"},geometry:{type:"Polygon",coordinates:["@@ńOœǤӺżȊ˺¶ϴbтˏÒ։DžƒƑƥҕh͋ǿջõΑȴšήń˸"],encodeOffsets:[[21085,42860]]}},{type:"Feature",id:"MLI",properties:{name:"Mali"},geometry:{type:"Polygon",coordinates:["@@˰ƶƘӶˊpזɻӄǖ͖ÇŴȈ⁚^ȈךƣļЛ⋈Л⋆౾dᬼᆳᬼᆳȨϿԺʉ϶ƋV՗ठĈFካҟ֗íԭݛƃ଩ï̳̗ա՟IȿLjҥš޻ΑDžʿٳϕŗɍΙǡНŔɱȳūֻڙۡp˳ɭΣÆӥ΋ůȝŁŽάʍĥơhƷʕ٭PɷŴʼnùʱʎ¬ʢĿİdzĉ˚Ǥɐ΅ΚijɴȇȂǙvȫş˕őɱǹΫäɷɈƓ„ɕőƅAµ̮žʾí̽͘ʀǓӔԺ"],encodeOffsets:[[-12462,14968]]}},{type:"Feature",id:"MMR",properties:{name:"Myanmar"},geometry:{type:"Polygon",coordinates:["@@ӫηץ›ϥࣥΟƳО݅ՔؗΈօ̭ܵ̃ƹȪу֖ڙĪҷ_ϵ͠ދң޵Сࡷăذʴ٠˯ӼæࣸͽѤ˛৔Ʊਗ਼εۢօуॕ׳ҽöԳȠ̂ਪǫ޾څॺļ̢ӭņ׭ۆÅڰ̊ŵj׾дȦęΤȐ˺Ž࢈ڂȑϐۘ¨ЦҪ۶}Ӕજ׆׸ƱçԬ̎ƸÛ͈ӮÚˮӵξȧ|ٟ“ۙߓۭijঽࢲƔȨޛՐǍʓۣز́ζƷ؞ʔ~΍܏յdẕӓȗ"],encodeOffsets:[[101933,20672]]}},{type:"Feature",id:"MNE",properties:{name:"Montenegro"},geometry:{type:"Polygon",coordinates:["@@ÁǀηЯÊˋǫÞɽ˞εǖĢƜŬҦ˚ȜƾüɠƟŬśˠě͌ǧçïƽȋɧó"],encodeOffsets:[[20277,43521]]}},{type:"Feature",id:"MNG",properties:{name:"Mongolia"},geometry:{type:"Polygon",coordinates:["@@ࢮƢ྄ܤ౬Єܴʳ࢚]֘Ͻ࠼‰ௐɁࠈגͿӶࢊࢊश΍ނįনɍLjؿஜΛߐƺਫ਼ŌࡆōࠖЗԚѕެT੒Ƌޜȼૈƒ௸פԌĝѰ˭ৌêХهק࠽ɐ΅ӈńࠤŽ٦̴ڬˏހוğ̗ڏĦ௟ŏןʅ؝։౱͙࠷ѽࡹǞҿúѳէˎ͓ƌˣי˯׽҇গ̑ఽ‹ഫ̇এҋϋʾ৭AఓԜࠥŰૣśჃȊऑmӱԀϣޠԱĢ৩ԼଅŞুƞ̡θ͖চׅڲன̀۷Ѿəז"],encodeOffsets:[[89858,50481]]}},{type:"Feature",id:"MOZ",properties:{name:"Mozambique"},geometry:{type:"Polygon",coordinates:["@@لæ৞ʁɖńגt̚ʦԌaऀ͜ڞӤƊϕ“࠷ľ݅ಿƨЫʣ׷͙׍՗Եޏ͉ृСॉ͓ࣕƵוׯ΋ȗí׳ЌُǔӱZʣƪ¦{ࠗƋϷȤƝűΓΗ̗ۗ˳য়ҕρ̳ðΟɊÉíѵّRïϊůϖí̠ƬपɓװГஂࢬ॔ɜ؆ŶúĨӶƉʞ˜غǐ׌E੠ѥ˒ЏÔǹȼϳǰ۫gÅ̼āװᢈۘӚЕɴüͨɅ¸͵ǯϷØסոԱʲ׌ζǰíઊΙ؈̣˖̅]ɽદɾٔ"],encodeOffsets:[[35390,-11796]]}},{type:"Feature",id:"MRT",properties:{name:"Mauritania"},geometry:{type:"Polygon",coordinates:["@@և־ԗؤ֍ɞГʚҵUЧǽйð˽ˏïҐɺаŀߊģࠨĵкČмɑЎѵδǾˬᾔMǃ௎ȴќ߀øᒸ᪂©F౞Ṗ᎟౽cМ⋅М⋇ƤĻȇי⁙]ųȇ͕ÈӃǕוɼˉoƗӵ˯Ƶ"],encodeOffsets:[[-12462,14968]]}},{type:"Feature",id:"MWI",properties:{name:"Malawi"},geometry:{type:"Polygon",coordinates:["@@ɽٓɾથ̆^̤˕Κ؇îઉεǯʱ׋շԲ×עǰϸ·ͶͧɆɳûәЖѵɔʮޮ˄̈LJۢǚڼƞɪɉ܌Ѕϐ࠘ƽǜɵ˶Ϲɾଡ"],encodeOffsets:[[35390,-11796]]}},{type:"Feature",id:"MYS",properties:{name:"Malaysia"},geometry:{type:"MultiPolygon",coordinates:[["@@àћֈĶ˞ΈȘýӸԓΜ֛¶֣ęϡĆ˿Öӻ̒ɵͤݑe˳׫Éߑخ঵ښįђӟ֚ś̡۠ҜĠؔȃΤƤƮۈρ"],["@@أ˹ܯƚॱ@̅ॗ͓̇љୟۅǵߑɾЕóөщ՛Òէǟַӆƕ֘؜˽ٮǀǜ܆άǂ৖Ǻ׾ڔЬՐϦѥǮ˺В¸՜œа٪אшڀͼHќыžιֆɻ۬ʧÑ֝͡¥ƮЧ"]],encodeOffsets:[[[103502,6354]],[[121466,4586]]]}},{type:"Feature",id:"NAM",properties:{name:"Namibia"},geometry:{type:"Polygon",coordinates:["@@رٌؖ͡ȃࠊȷ،˯ಒm৒ŅҞ͛Όѡۜѳ৘ǽՆۃࠐ»٢КdžԊƞհ}ԄϝŶÐ₮˜׌Е᎞ş໴΂یȒհµͨȍPéӁȍʭC՛͍ͣΎಕ̍سƒ{Ჽࠣ‡BយA᷋ݣѕҋÕՇDŽϗÔƗάͩɰГг"],encodeOffsets:[[16738,-29262]]}},{type:"Feature",id:"NCL",properties:{name:"New Caledonia"},geometry:{type:"Polygon",coordinates:["@@ېԵѨϭ͉ȫҥɪ׹ϚէѼ։פś˶β[Һ˹φ˷ˎɻ"],encodeOffsets:[[169759,-21585]]}},{type:"Feature",id:"NER",properties:{name:"Niger"},geometry:{type:"Polygon",coordinates:["@@nּॹȐОҿպœϤâТբ̴̘ପðݜƄîԮҠ֘Eኬஈϒᝪ࿸᮪ཾ೨αӀңר̸ȸಯ̾ɓ`ˋΔ˽ǻί͕ၻ«ધੳߋγૉΔ̵CեբmčЃʁµˋƻm֩ंȟ’ځҷٱʔҍ¸ʏşӯ~ӷΧѓq৯ѢЉȵѓb̿͆ࡅ̼ࣗıɕǻşӗʋ͹ÍݣٗӚ̟E˭ʗ"],encodeOffsets:[[2207,12227]]}},{type:"Feature",id:"NGA",properties:{name:"Nigeria"},geometry:{type:"Polygon",coordinates:["@@ࢍ̡͉¬͓ȉڥl҇Ղˡ؊שֆكYݍB¶തs՘ǂՊʶʴТԴėɨǔ͸ȍӾ˪ÎݤʌͺŠӘɖǼࣘIJࡆ̻̀ͅєaЊȶৰѡєrӸΨӰ}ʐŠҎ·ٲʓڂҸȠ‘֪ँƼnͬͯğƱ«˧۽ٱɛՙšѧDZȉǝי҅ΉŽыȋ͹ÿΓֽ˱ҽΊ͇aԃӭʑQЍ߷ɍש"],encodeOffsets:[[8705,4887]]}},{type:"Feature",id:"NIC",properties:{name:"Nicaragua"},geometry:{type:"Polygon",coordinates:["@@̃ˆϽͺȁ˲Ο˄сϜĤžƒŵÚÒʾ”ŀȔŬRkЮȠrǬOǺɤʜǝĒľƺIJ̊ɴbǦĄQňȪĖ|ƜŹǚ›ȆńɄB̈ŌŜŖ˾iïă§ȉĐ̫ȗ˹ěͷυ®ɏtϙŹĉýΫÌɛǣɋ ɩźƏȩDZʛÈƓǦˉêȕʼnօɞųŇ"],encodeOffsets:[[-87769,11355]]}},{type:"Feature",id:"NLD",properties:{name:"Netherlands"},geometry:{type:"Polygon",coordinates:["@@ۦyǀ˳Ƚޓɇ́ԍ@ƘࢡҥȞՏπީǩ؛âѠɲ݀ఆଲΘ"],encodeOffsets:[[6220,54795]]}},{type:"Feature",id:"NOR",properties:{name:"Norway"},geometry:{type:"MultiPolygon",coordinates:[["@@᥆ؙઍɣऄՅෛ͵ڵû΢לઃͰಫ˵Ы؝ߟωࣗȮ઱¥णѼԉɝԷ“ūփནƊɝҵ߭Hևױ࠿झಫ஁̨˹̇ͫ࠯bձ޿¾૟՞э˥ধֻۧυӛ֝Ԫဋঁ૫ȟ୏є̛ࣚˇ኶ޞզᕠ۶ဌࢂ໤୦፺ྴඦلᘼ੊ᇎπ൪­౮ۢ໖›ພǘ"],["@@ም΅๝Ȝ׆ɐԕˎეǚͮ̿ொȍ"],["@@᪖صᑟͥұأ݅ǁЍۡৣᅵԢނ̘ఽʐ࿕܂ٷڄᘎ̜Ң̋஦\\͊˼௾ˆ੖̋"],["@@࿮̏ఝҍ᝱ı៙ƖƫɴஹdँϬᣴɼ௞ȫࡘʤᑺȽ"]],encodeOffsets:[[[28842,72894]],[[25318,79723]],[[18690,81615]],[[26059,82338]]]}},{type:"Feature",id:"NPL",properties:{name:"Nepal"},geometry:{type:"Polygon",coordinates:["@@ÝαŌՕĩͩ۩aয়Ȟ٭ĂӛђଷŊયҼ߉Ю߿͆͜޼ՒϠΒȪڪʳࡔշҾť˰ЕٶǓۀσौȕঔć"],encodeOffsets:[[90236,28546]]}},{type:"Feature",id:"NZL",properties:{name:"New Zealand"},geometry:{type:"MultiPolygon",coordinates:[["@@Ȓ΋װ;ʐΡBΝ̹ϳչإїͷ̴З٭Yܗ̓ɣջӋࡗڇϓнʇޝlխˢࣱÐƗ̰Ҍذ੐ࠦժǀ׾͌ܜѰԎѦώظ͈ɆŰҶלϴȆΧ"],["@@،ࢫlָϜɯŲًڰ˛֨ãӒ͎юĭȯݗʯӫٛjɡʭþαūƻͅҏзֹ٭ͯƟɘΕŨӞ۔˟ҨࣛͲz̦؈̌ƚ٨Ÿլͻ֜vƪБΎڋݔΗת̸àҚұٺɑʂݡ"]],encodeOffsets:[[[177173,-41901]],[[178803,-37024]]]}},{type:"Feature",id:"OMN",properties:{name:"Oman"},geometry:{type:"MultiPolygon",coordinates:[["@@ֹ̻ϟªǩȧƉэļ֗ÿĻϯFԽ̻ćХȓǯԹP͡ɃJͻПɷҩĂ֗˳ϱ³˝טٿ൴ᠾ࠾֖၂ϩתv͸ʔΐFΆϞǒƩŞèմіHϖֵҸ̧؞ŋӼƳϜӕɨ˧̞ŃCȉ̩ԃƅɽΟˏ"],["@@ʼnƳDž˺ʔ˺ľñā΍"]],encodeOffsets:[[[60274,21621]],[[57745,26518]]]}},{type:"Feature",id:"PAK",properties:{name:"Pakistan"},geometry:{type:"Polygon",coordinates:["@@تϻʞ٥൨ͻ߹۷ऩůౣȲЫα̖݁̈֩ڴгܑӟ`׳ࠃࡇՃ࡝࢝ࢡউÚऑࢡռϗĪ٧ҾэǘܝᇛD֓֕؛Ɇʣ؀٭٘໻ǁിeஃŝ̈́ঊொѢéϰГƌw݊ߥφͷԔеѶඨѕࡀŲԈŅǞȂגóદĈ܎ҶӈشCĠɼٞŌ̴ý͢ʀ±ԌΦԖ՘Ɇͥ֊ߜɴ̢•͒мΜĩмȣΤӬμࣘǮ८ĮѐƺӨĦ"],encodeOffsets:[[76962,38025]]}},{type:"Feature",id:"PAN",properties:{name:"Panama"},geometry:{type:"Polygon",coordinates:["@@˫ʎǵҒȺɢɅÎƿˤлɸοÁǝ̇ͻɁǽ‡ĉǩВҗɯŅŧŭϷ©ơԈŋƛˡ¸ǝ͸·ÈɓİέCǻĩŶªǖìǠƲŲIJǩŲK͸͘ö̠̝iDZͲ›ĀæɴȵЮÔΨɄԜǞ˺ʤҬ·‹ĉҶ…ώơ˜ʧ̈́ɵĹūȜӵǁʟ˓ÒŅС"],encodeOffsets:[[-79750,7398]]}},{type:"Feature",id:"PER",properties:{name:"Peru"},geometry:{type:"Polygon",coordinates:["@@ɥљћɋࡅӘñΈရࡊທࣾ٫԰ΏۜƐʎ܅ાࠣ༄ߍီ΅Ϥ˃ؤٷպױͼ˖ϒПߢʼךڢՎIJΓʇȧx̭ΎâͼĝΚщӆΌDŽ֤ԦܶৠͨࣸࢠʾմŝٔɢĂ֒ЉˎЅϴɏӶࢣضĿҨɞ̤ƣԎð٠Ͻթࡣʤoрҁݳ œųۍlj॥ֱÓϻɉ̇ČғԕʍBΡɛƵΔݳҲԝDZί֐µ͆҃ݐuېӸÇ౧ϢĩӄƠܪടǷ˵£ןg܍͟пƮ̵ȕ˯β۹Ջ࣡"],encodeOffsets:[[-71260,-18001]]}},{type:"Feature",id:"PHL",properties:{name:"Philippines"},geometry:{type:"MultiPolygon",coordinates:[["@@Đ֏ºҽ˹ޑ̫ࡨϽэˎإʉϿ঩Ӧɿ؊ʰЎՑЈˁΑЃثҵƑʖ͢۾ՌʀҜ̈́̔ϝٔɰƎϒרv·ٰڼЋêхÐ̱"],["@@̟ˡˁՍ˃ʝԫ׈ǦɤɂɾĢԸҨ¸Ɖ֣جߺāߡ"],["@@ૣߕЬט؈԰Ԏ׊Ѱ࠲Ʈۅևҧѳֿ"],["@@Ԏʹ՘BgΗϳΣՕʧ‡ϸÒєŽА"],["@@ʀभ٫ɞj˭ȶԯЍȋ•עʧªƁԘӶãY͈ԣٜ߮mɴ̻"],["@@ɟܩέоѓ٘ܚ‰̡̈"],["@@ԮʉʶɖüɇƍΑ˼׻ɛۥӷ˥ƁڳȊڝѾġϊIJਾүăҙ˜ȫēϯٻЮ̵Ѵɍ̯՗ԊރůлȆ¨ΎˀɊʣȘŇ̡бӚűμߨͺˡĔೄ˜ހԘA"]],encodeOffsets:[[[129410,8617]],[[126959,10526]],[[121349,9540]],[[124809,12178]],[[128515,12455]],[[124445,13384]],[[124234,18949]]]}},{type:"Feature",id:"PNG",properties:{name:"Papua New Guinea"},geometry:{type:"MultiPolygon",coordinates:[["@@ɽčε͔ρՔǷ٘ŜĆĜʡʬȏРՑЈ˵ŝɽ"],["@@ѯçƃɽҟȱћȟѽBۏʔӑɺêʺݬũҠàŶЖŦrĆѽӐÜʂ˼Ҹ̚ġӸԌfǜƏgү˯ԡ"],["@@ݤտղࢻӖ„‘ω٬ƛʥǁࣀΝġʏ֋ÏȷɔܟĦࡕŴٷ՚ӉҦѧ݀ભπ܇ʇԡˣńإڇ˿һƖࢅ–aᩒaᩒภ׃༊ӓׄїҴхŸӵඔԱȲѽޛěȄ֕"],["@@ʿɡǁӸȝ͘ϝ˞ӍΪ؇ʚɺȮҒɻ˸ȁΜȫʹΛ͊ˏĶѧ"]],encodeOffsets:[[[159622,-6983]],[[155631,-5609]],[[150725,-7565]],[[156816,-4607]]]}},{type:"Feature",id:"POL",properties:{name:"Poland"},geometry:{type:"Polygon",coordinates:["@@·՜à̂ȹ̧҆̚ɺɤȝђָʘ಼ϴ੒˴࠼ƙÚȱ߸Yਚħ໶^њěȬʵšωɸ͋KͯԋǡʸϳfϏцܻěɽзįރۥɒϗǿ¶ߙ͔؁šЇĒӹǵч̖Ήŕ³¼ϭаر¼ăˀֻĦűɑҗǨÀɴػòЉ˔"],encodeOffsets:[[15378,52334]]}},{type:"Feature",id:"PRI",properties:{name:"Puerto Rico"},geometry:{type:"Polygon",coordinates:["@@јõưǕɋɃمLӫ‡·άŢŬیK"],encodeOffsets:[[-67873,18960]]}},{type:"Feature",id:"PRK",properties:{name:"North Korea"},geometry:{type:"Polygon",coordinates:["@@Şƥ͉ºη˵ʣ˷Ž׽ѣȅƫƧ̓ʝ֓ƏηɥηįġͰƋӈσŧȭΧÇץ¡͝ϛϑˆÁùСdžĵƿʙé‡ǀɑüɥƆɰφȤİõƶɆҒÅƎөĠЇɤۄբऒҌ־׮Ўˁܪ‹ſѺಚβͰҼժӹ"],encodeOffsets:[[133776,43413]]}},{type:"Feature",id:"PRT",properties:{name:"Portugal"},geometry:{type:"Polygon",coordinates:["@@̦Ɉ΄ŬɂЫӺDƞłӪ‡ɼуϱɩYٽƍū‘Їγçʹԋɵտ̄ʡřɫ̵̿ê˥ͷɓѷŠџġŸڂÿԬϓþȩ͈äռͰ̨ÒͼǪԎkΤǙ̠™˲"],encodeOffsets:[[-9251,42886]]}},{type:"Feature",id:"PRY",properties:{name:"Paraguay"},geometry:{type:"Polygon",coordinates:["@@ͦ৖tҌЖ݌าʔޮ]޴їbʵʞҳÇଛࢲLJ΄ǐ֦ɩǀʣþޓİ͓̼›̀ƌ̢ƳAҥŕӻǑӛƍݏށ١ړƇऻŸࡑɮࠢ౨ťψࡽ͢ਅبۉŸ໵ൌ"],encodeOffsets:[[-64189,-22783]]}},{type:"Feature",id:"QAT",properties:{name:"Qatar"},geometry:{type:"Polygon",coordinates:["@@ÇؔɨѲɰĜʬˁdӯǽӳɵÑʫǖ"],encodeOffsets:[[52030,25349]]}},{type:"Feature",id:"ROU",properties:{name:"Romania"},geometry:{type:"Polygon",coordinates:["@@δǶԴġՠGϸȳ˺źبĄɄȠΠ@ʰćʺʟˊΟӞԁ€ρėΩưϥϒƹЂƊϠƟpɏПǹʯĀɻ৥ӳĖ̪ؑফțзɋ௽¬٥ƀ͙ÕʍΊƵƦȚƘȷŀ˃ȋөʔßΌԟȢĥˌҕͤڪǂԖ֮Њ֬ԢǮ"],encodeOffsets:[[23256,49032]]}},{type:"Feature",id:"RUS",properties:{name:"Russia"},geometry:{type:"MultiPolygon",coordinates:[["@@ࡌ๫కˤԫ்ࠌࡳyוُԒսٱƻ۸Ĥࠊħ࣢Țٌš૴ӯࠜôରަϮͭϴϐŠɔ։̆ߵuࠟΎࡑ"],["@@໵]ਙĨȒτ୊˚ࢢƧψƃęɱäɉ"],["@@֦Ƚțؐᗸű࿨޻࠭λ൛ēsࠑͳǩ޽~ٗ̊ૣʖȉθ࡟Ǝॗʼnҗ̎Ǽ̸৓ȥϚЃӉΣ@„Ꮪٛᔺ࠳ïԷ"],["@@ः©ƭˌੲΖ@ַ"],["@@ળ»@ָň–܈E௒ʉïŗࡽȩ"],["@@ౡMႣĤƧ¬ߘͪੀþஞ͏ĸə"],["@@ॿͩഉø༛ͨȪ˖༨ųᑔɗ"],["@@ډرᶽzඃȣမղҎ׀૎ǂᕞ™ᴬѽ"],["@@ӹóᩣŊɟώູɦūҒ࡮Ƕ…Ҟသܒޙĺ፨݆ɩϢሤѺ᪪բ᫠ǀ෴̸࿐Ŋאͩ֟ʻᲗз᢭Џᤙߝఫࠍ೉߱Ǡۥྎۏ"],["@@ɨгސȲឤYቈЧڬ̿ȽѧङʝᕅүفʟਬşఖɃݴDŽєաτɔഊƂ᧪ƑȴϽ↲ů´ٜᄼƥഄLബѷϮ՝ӹΙੌڋ೔Ϳ߸ࢦഖϙ෢ɦྼʵؤʀൖş؅ޮૐζ䢀ձܐӿᔲٛ₎DŽာƑ۪΍Ĺؙਜʇ૴Ǥ๰vཚǑཪĢะݛਪˎڷ՞ϐώᧆɻფºᝂБ୲ν@”MKઇσઝÖݶҁԄەϲɧĮΏɑɝ༧Ǿ᚝مݛĭ౽ן௛ԧ̱ϣய׊ᔗڇϣ̸ߵΫ૱Ř˓ց৙߽Šͻड़ȋő௣ޭ‹Ϋ۱Δα฽ѕ̅ॡభȳʥ࡟ே޳ׂ̳έ௬ҵለИ୘܀ԆªϾರȊຊ੒คࡺຢڢڮஆ৷ëԍۗᒉइۍਖᓧ˷ᑃටۚԧሙɕಝēÔ؊ಯŶ਩ЭᢵƠ᪏ʟᨩ࿛ủጝ೚ŁаՃࠄȅ՞оईÃௌऍ†܍ځ࠽ë্ϛഉ్௓˯ׇଙ঑ଇॻթӹ૩ӱՉYՇФૻؙſ˩ŝƦKѐіxŦ঴ɛܚܞ̒৶Ʃ֢ࠈ˾ऄ͚̮Ѵݲ൷ʛܯͧ౧Dͻ߄হװหˎ̵ࠖ̉Ԫ̿βԯࡐ̲݇షʢ૛uਯƱۛлҤȥXҩұˑݷࢻRσஅՍ৙̈́োéѯˮԋĞ௷ףેƑޛȻੑƌޫSԙіࠕИࡅŎ੝ŋߏƹ஛ΜLJـধɎށİवΎࢉࢉ΀ӵࠇב௏ɂ࠻Š֗Ͼ࢙^ܳʴ౫Ѓྃܣࢭơ͡çѽԤઍőΧΦחnjЙӠҩưிɍୃӜ҃ѯሟᒒੵٮ̮˂ᑋߍ߭³êҞઅ˺࢙ȱ˃ࢊມǺݯΑᑅ̳Чȹḭ̇ϫ˻؆ֹ߭ɓǀɭ߭ХസֿɁЉ୻˜ʓʟ੹Ѧ೯iࢻΟহͼᇡ׊ಽsჃࣳĿؗࡹӤڡउʖǡӝُ܊֫ذx՚֗ďѝѐƋϥӽ߿Ƒ࠳ࢁކߕĉ֣ࣼফԇ͹ƝɇωÌֿԚɿ†ՅȚʳΈ޵ǮԙƁƥƼଥЖఅƌ܃ƞĹıੱ܂य़̈́ܩӴؒƈۤ۰ҹͪఌ΄uȀݯƉ‚ώѠɼ߼ÖƄ˪ȅҪ΀ѰWʚఉ˚ӭUԯЀ١ƃ੩̐lǒ̗θڟ¤éʼɀǞ՝ӈࢋąʭ¦Ƀȑ̽”ȷ՞ȟ˨NJĀڴ‡͞Ȁʍɢ֥ƪ¼Ʋ΁ƴՃվǸɨĉЂࠑȨѱijšȼࢭɂˑӸíТЙȖάˊʝ޶װӞųƤक़ҬࢡЎᅢ੶ޮӠ͂єగּΆնݳش֢ܜ঍ग़ޢي౿֔ŬךڶüොͶࢀ̈൦ԕᘨȧṺो٤ЋÆ֓टѳ൏ɡ⏷ٔ؟Ńൌ؛ÂϵÆ࡫ઌʯڂɓňРԑΰ՘͈᎖Թ۾Ȳ֣؜ዦࠖޢµ޸̋Ӫ׀۫ԄЪԊءԶᚠˑӔҹ੡ĻNҳڌ˽ಜǼȶ՚ჶАᰪܞي£ࠣԙਬĕ׼˼༾xఢΐफ़ԏॖ֌ࢡӢѪˤ២ʫ୒ʿᴾॣ֚ѰࡡѺ{ǴৣĈˢЌ҅ټ}ː༄ݾրކزǒᕮɛǬұߕڽԺˋ˒חȏଵऒԧέ֕࿫஝०ŭ̢ͮऎɎɞжܮЎөӌϼֈࣿêȫҲڢࡈણۆຒ֦șװмnѴүͧ߷࣐Ƶϥ؄ඤͦლ¬༈ӏݛ۪ċࣆศǞ፾™ᆘŌہѮংւॲx࿎иᕠŐ˪ɲᕂþیȋሴҀ໲aɶδߤΨጤΈ෸˗ଥȷበŹ"],["@@ⵙ͕ໞીےĦقÃᒈӋʟͿ"],["@@૽ōݱÛśƏঙƑ࣫ȦӐʾል~࿞ƶ౨XǢɧӘȬߊƐఞǿ͗ŷ"],["@@ᆳĿᚉʎඅ͎٣׾଩ǔᔆָᆎȎ࿌чኬ߻ȹݯ"]],encodeOffsets:[[[147096,51966]],[[23277,55632]],[[-179214,68183]],[[184320,72533]],[[-182982,72595]],[[147051,74970]],[[154350,76887]],[[148569,77377]],[[58917,72418]],[[109538,78822]],[[107598,80187]],[[52364,82481]],[[102339,80775]]]}},{type:"Feature",id:"RWA",properties:{name:"Rwanda"},geometry:{type:"Polygon",coordinates:["@@ͬӃµӵʏŁѿÆʱӍԛàþҠŘތԄʎɺȰďԈʸ"],encodeOffsets:[[31150,-1161]]}},{type:"Feature",id:"ESH",properties:{name:"Western Sahara"},geometry:{type:"Polygon",coordinates:["@@oҊŸ@@ÉeNjEౝ᪁ª‚ᒷ޿÷ȳћDŽ்ᾓNǽ˫˜΢bCቆäĶ̢ΆϘˤୌୠ࣢Ђ੖ˀÖ˜ټۺĜ̦ʼnϢ@˔ȒԲ‚"],encodeOffsets:[[-9005,27772]]}},{type:"Feature",id:"SAU",properties:{name:"Saudi Arabia"},geometry:{type:"Polygon",coordinates:["@@ʼnΪʩʨÝͲѡ̞҃۴ʁۆׇ׀ϑƐ֋ߠīא–ӾӕञϿ͠ґǨˡӖ°ȎɹѦʕȊ͝زԟڴѓ־лIžҦœ̌ļͲनƅζʶȪ̢ٚŚƒˮˤƜ࠷ࡀ၆фdžŴৢɩబיᛎၕ༠ãݠąȾЏתv͠ܥаȓƠִ̏Λ¼΍ċ˩ł˯ʎɽŐ˟ŲȵʬǕɶÒdž͍Žș࡙͐ᡌщǞDzϪש֕၁ᠽ࠽ᝑ͑޷ϙ׻ࢥϹƕɁˬ͏§߻ĎƷČॹmɫùΉɔɝЭĒΟρˋ"],encodeOffsets:[[43807,16741]]}},{type:"Feature",id:"SDN",properties:{name:"Sudan"},geometry:{type:"Polygon",coordinates:["@@śhdмĵ̀џͨĵ؄ĶبϳÌÍȇԍ©Ȭʕðԍңңл؅џđ۹Ӫͅǥđʓџǃ…ǥ࠵@řǦ؃†̡ƝɳîѝӬƟɲ؃ŗɱϵɏݣ˿ǁʳğå ̅ʎÃʼƌΔE΄ӛՀĩάZȰ̱ʜUӦǭ͖̍µĎ̰ɒΖħΐˢʴǫȞɞ԰ϨئܦÏ¥ ZΚॲH@း@Ὂ@ῼ@˔ࠗȁƳŪࡻ্̰͌ȷҠ̳ыӑأƏ˅ʳĉ֑α௿ĚͳƅܟͿࠟԓзέٛč΃Љɽʝ࢟Dij"],encodeOffsets:[[34779,9692]]}},{type:"Feature",id:"SDS",properties:{name:"South Sudan"},geometry:{type:"Polygon",coordinates:["@@Xٽűʯѿq˷ӏԨÑюХƨͳϦșӼࣳ֫օԫԇԫϭסFگȟՕȊ΋ɭ݉֐ȥάҵDZϱÆɣƕϗĸԗۚƉˊعͪɅԌΕζ֟ѬS˘ҡͼ֯͠ʴĠ̀ǂɐݤɲ϶؄ŘƠɱўӫɴí̢ƞ؄…Śǥ࠶@†ǦѠDŽĒʔ͆ǦۺөѠĒм؆ҤҤïԎȫʖԎªÎȈϴËĵاĶ؃ѠͧĶ˿cлŜg"],encodeOffsets:[[34779,9692]]}},{type:"Feature",id:"SEN",properties:{name:"Senegal"},geometry:{type:"Polygon",coordinates:["@@΍ٺн̚φDŽРמȦќ˾ːкïШǾҶVДʙ֎ɝԘأֈֽžԹǔӓ̾ɿî͗ʽŧ³қâÙģȃk׿ȲЛV༇–ɥħ˥‚ѻƋƏ٢ވkȬŞƮR̸ȘήǯκcζȌǝʐˡƙʻJͧȸˉ_ȍȥࣵy"],encodeOffsets:[[-17114,13922]]}},{type:"Feature",id:"SLB",properties:{name:"Solomon Islands"},geometry:{type:"MultiPolygon",coordinates:[["@@ɾ˿חN͉ԬԈȯǜ‰"],["@@͝mԧĎǫżÀͮֈƁ˜ǭƎə"],["@@ųƹحܰǫԈ˺@̠ڥʹЗ"],["@@–ǛڅΦҟ̠̿˪ŰĐϮȫېϭȢˉ"],["@@Ǘ³οȒ·Ί¨ƖԈΡͰ˛"]],encodeOffsets:[[[166010,-10734]],[[164713,-10109]],[[165561,-9830]],[[163713,-8537]],[[161320,-7524]]]}},{type:"Feature",id:"SLE",properties:{name:"Sierra Leone"},geometry:{type:"Polygon",coordinates:["@@ɧØ؁ͺѩ҈Ƨ̬Ĺت҆τĬɺƞǸɶpȜǂڦCɺ̛ǼˁʓƈɗṶɴ´ϹϹϛҗ«ʓȩˏ"],encodeOffsets:[[-11713,6949]]}},{type:"Feature",id:"SLV",properties:{name:"El Salvador"},geometry:{type:"Polygon",coordinates:["@@ġȡӡ^̡Ą΍ǘұÀʃǶ~Ů˾ɄǀĢ«IJȠ¾ʜëǸǙʪƇŒœτĴǤÑŘĝÏͳ"],encodeOffsets:[[-89900,13706]]}},{type:"Feature",id:"-99",properties:{name:"Somaliland"},geometry:{type:"Polygon",coordinates:["@@ϛԩד۫۹Mᩧা͍̜̳К̳ҨǾ̖̲҈˚ƹǒΏϜΗкGߊɌࣴĴ݌ʼиÆ̚ƶӎˆKaE΋Aࡑ@ѫ"],encodeOffsets:[[50113,9679]]}},{type:"Feature",id:"SOM",properties:{name:"Somalia"},geometry:{type:"Polygon",coordinates:["@@ѼĎЊ˾͈FpɵýӧHѳǯ̣ʁࣥЙयԱ੷ܝ௷ܓवধ଩ࡁڹష࠯޳ٕँৱȗѷȍȣӽۚWᵤܾ॒ɰˆբfݠפબšᛜᡄה۬ϜԪ@ѬBࡒFΌLbːhϰŰ"],encodeOffsets:[[50923,11857]]}},{type:"Feature",id:"SRB",properties:{name:"Republic of Serbia"},geometry:{type:"Polygon",coordinates:["@@Ԡȡà΋Ӫʓ˄ȌȸĿșƗƶƥȷȏø̫Тγ͋ʿƗˋĞijƑšϳa˹µƒØĴĴĦȴšKǍƼƑ ŋƆƽÀšŠƯ±ś˧ȩÑèð͋Ǩ˟ĜūŜɟƠȢšŬЄЛ͔ɀτ̥Ë͔́ˉʈȱ͘٢ɚԾ™ҖͣĦˋ"],encodeOffsets:[[21376,46507]]}},{type:"Feature",id:"SUR",properties:{name:"Suriname"},geometry:{type:"Polygon",coordinates:["@@৔ǙĞưڶÔࣚɥѩܟâֹͤӽƥίóϩɉΛӓDzЇđ͹öčʏƘǗ÷ǡҙèԡܴōӄˏBωؐƺѠ¯ȤԜɖƈݲ"],encodeOffsets:[[-58518,6117]]}},{type:"Feature",id:"SVK",properties:{name:"Slovakia"},geometry:{type:"Polygon",coordinates:["@@´»ΊŖш̕ӺǶЈđ؂Ţߚ͓ɷɓǏ͹dzđ࣑ʮ˟»ȟȡЁĿěÄХŽͭ}ãǙ۷Ļ̱ĠёɌċ̆äńŢȂόa˺ĔxþLj¢ÆȒȖ˜žưʢD"],encodeOffsets:[[19306,50685]]}},{type:"Feature",id:"SVN",properties:{name:"Slovenia"},geometry:{type:"Polygon",coordinates:["@@ۜÝъȐܾtLjƘƘUǎ˳ڝɟć͹̇đHɻͣh˷ƎƷƙב†ȈúȫΨĞа"],encodeOffsets:[[14138,47626]]}},{type:"Feature",id:"SWE",properties:{name:"Sweden"},geometry:{type:"Polygon",coordinates:["@@ࠁוƀԥ೹ڭྱܡؓஃײףߦүޗॅ࢑ȝ͍තӋ޿৳ĆӅڗঃˉߐ۳॔ٓஐφӜּۨ˦ন՝ю½ૠղ߀࠰ä̧ͬ˺ಬஂࡀञֈײ߮GɞҶཔƉŬքԸ”૪Щ಼ֱv಑˴͛ฃʃ"],encodeOffsets:[[22716,67302]]}},{type:"Feature",id:"SWZ",properties:{name:"Swaziland"},geometry:{type:"Polygon",coordinates:["@@ǡύӭěԅҖS̄ɰ̀ĂʔʐÒшƵŰϕðω"],encodeOffsets:[[32842,-27375]]}},{type:"Feature",id:"SYR",properties:{name:"Syria"},geometry:{type:"Polygon",coordinates:["@@࿩ࣅऩͬgNŖŶ_ΈȸҠҜ̈́Əͤϗ¨ÿٞȶΌɤȀɤȀ°Ҹ˞Ǐऎɺ҂ƿۖFॴ̀Ґaक़žїԽҡȹĂؗͅ৫ᇵ࢓"],encodeOffsets:[[39724,34180]]}},{type:"Feature",id:"TCD",properties:{name:"Chad"},geometry:{type:"Polygon",coordinates:["@@ĎЄաnDզΓ̶δ૊ੴߌ¬ન͖ၼǼΰΓ˾_ˌ̽ɔȷರࡔҠ…ྑ…ྏ¦ ܥÐϧإɝԯǬȝˡʳĨΏɑΕč̯̎¶Ǯ͕Vӥ̲ʛYȯՏƛэͽ؉ࣹ߅ϳ߹¾ʁûĊ̏ѫ̋Σ͟੓͏ȽȐƓhƹɍۛÙƀɪ˅ׄşΐλƜӷӪǼІϦċʂÐҸSқކŒ֐É֐ͭՠ"],encodeOffsets:[[14844,13169]]}},{type:"Feature",id:"TGO",properties:{name:"Togo"},geometry:{type:"Polygon",coordinates:["@@ڱdzȇ̎ɡՔãкȆݴɁ̬ăڎD؎ΕѠÖˀ݂kŅѵʲʝ̈̋ŽЭǜǥኝȺׅ"],encodeOffsets:[[1911,6290]]}},{type:"Feature",id:"THA",properties:{name:"Thailand"},geometry:{type:"Polygon",coordinates:["@@ݭϬܗeŬڈ݉Káऋґ௯˙ݏÌ؋ն΀ދưܭҶӓԚĭѤѧ˝·ևĵßќۇςƣƭͧ͒ƝжҁӄПЌƏӳǃҲĠԾʚ߬ТࡸҤ޶͟ތ`϶ĩҸ֕ښȩф̄ƺ̮ܶ·ֆՓؘН݆ΠƴϦࣦצœӬθӔȘθʷ´ԍ֨ȷࢭpݫࢰԆʤƧӰzǜَ̊ÍٖڽÀࠥںܷ›܅˙ϛ޿ŦગDž՟ۧȤ১"],encodeOffsets:[[105047,12480]]}},{type:"Feature",id:"TJK",properties:{name:"Tajikistan"},geometry:{type:"Polygon",coordinates:["@@̭ʷࣳƖāӛ࣬Þਢ˗འŶɈާˠĐԜȓ‡͛ŴӍࡿBׁØԻϕύĉ̉ǯͩˠþ۸ʩ¢ĞʲғȐα̇ė͹Żūԇj˕ϩ˯nj؋ˑʱĺӀࡘǹض؟ȨɔφۮŸЌҬˌբ૲ȜǩϵŤɹΎv"],encodeOffsets:[[72719,41211]]}},{type:"Feature",id:"TKM",properties:{name:"Turkmenistan"},geometry:{type:"Polygon",coordinates:["@@ñۼطŠॣݔڣĠगюׯþσƽ֙|ׯӓ݇NjƻרŪ࢞ٽ˶Ɏֺ֏¸Ȇ۾ߊȵ݈ˎؓԎʉӔڱɋď؛ʿհψ˨ॖǪ֨ɻךڅњ¤ॆ\\Əцܖ̂۾ӦଆѹĜڡ͐ǣࣦžˮƳаࡽ०ׇոЃ࢞Щ૤Ϋwԥʩ€Ѕɤſ̙۽NjǙڥӁʭڏŵǫϟهŏࡩ͈"],encodeOffsets:[[62680,36506]]}},{type:"Feature",id:"TLS",properties:{name:"East Timor"},geometry:{type:"Polygon",coordinates:["@@IJȤܢȌז†ˀŀ͆Ľ̯ɫ࢕ο۳ʋeʬďǔ"],encodeOffsets:[[127968,-9106]]}},{type:"Feature",id:"TTO",properties:{name:"Trinidad and Tobago"},geometry:{type:"Polygon",coordinates:["@@ӚŊǮ‡‘صۭġƯúʒɲiͪ"],encodeOffsets:[[-63160,11019]]}},{type:"Feature",id:"TUN",properties:{name:"Tunisia"},geometry:{type:"Polygon",coordinates:["@@ΩພԭͺQȰۉԄóنԮҶȢۚƃߠǠќࣶͺךĵ}ы܊̲ÒljпЫMϱ̆ȽōܫփхDŽқѤaɄЍ͊ſ³٥Хʋʵˏֽ͓ĘΑïΟЧț"],encodeOffsets:[[9710,31035]]}},{type:"Feature",id:"TUR",properties:{name:"Turkey"},geometry:{type:"MultiPolygon",coordinates:[["@@஺͗ঐżܤõলѬࣆ¢ߴЭƜ̑ăУزȻͨʕֻʇˀ५ǏʻҠڧЕƙ̏Ɋ঍ňίŽॗŽҏbॳ̿ەEҁǀऍɹ˝ǐ¯ҷɣǿɣǿ̱Ϡ͈͂ԟí۱ȖֿәౣĥڹҊࣟ†ȗΑׇij߻҄ࣻeӽ࠶ؗҰЦٸՓВठߨಒ’Μྀٔŏ৞հ঒ʄർlุף"],["@@۫ҏ˃Ϻ\\ǦȦĦʺՂХɞࡦ˄ܤőĴ͓ܼ˓Ƶȵি±Ωʷ"]],encodeOffsets:[[[37800,42328]],[[27845,41668]]]}},{type:"Feature",id:"TZA",properties:{name:"United Republic of Tanzania"},geometry:{type:"Polygon",coordinates:["@@ƚġᵂႋÌӣ஼࠿ϱਙ¸Ӊՠ̩~ɓɳԓ¶ʭÇГ̌Ճΐ̰ࠡǿڝӣࣿ͛ԋb̙ʥבsɕŃঢ়ʂكåɽଢ˵ϺǛɶࠗƾӉʨՕƘͯƘΗɈґ੖ӣҺǗӤČѨƯޞΎ ̨̦͜ѬȺǮS˘ǷȐ·ͨʐł¶Ӷͫӄ̎Ķऄ[ႎà"],encodeOffsets:[[34718,-972]]}},{type:"Feature",id:"UGA",properties:{name:"Uganda"},geometry:{type:"Polygon",coordinates:["@@ः\\̍ĵԇʷȯĐPوȜ͎²ڬǰϸ͎Ѭ͔ɠ˒̘͵Ŗ¼চΌɮՖȉڰȠעEԬϮЊ׍İсτ९̧ؓЯ֋ʉͽTࢹႍß"],encodeOffsets:[[32631,-1052]]}},{type:"Feature",id:"UKR",properties:{name:"Ukraine"},geometry:{type:"Polygon",coordinates:["@@̾“ɄȒʮ¥ࢌĆ՞Ӈȿǝêʻڠ£̘ηkǑ੪̏٢Ƅ԰ϿӮVఊ˙XʙͿѯȆҩƃ˩߻Õџɻύڡã֑˕޽«ܣ̻¸ԹЪȭࡨ¼Ǐ̛ँơଛӟұǠȄЂࣽʘƨLjߪ˪ʑȔಯɆË̼ީĻ̷ҧٱةϟƠЁƉϑƺɂĞƦ˾ɲˎÑƮǬäĊśӸ{ɞØƽĎÐŲ̉ɈŧΘ̩ƐÒ˶ϝɦΉŽأʾ֑ĉȧŭΟ@Ƀȟاă˹ŹϷȴ՟HԳĢγǵÍɤұɮǐͺɸɔȀµɑϘބۦиİĜɾхܼДҢɪٲnࡖßबȫڎi͂ŧ̀Ʀɚȝݸ¢ͮąÄцʶȂܞº"],encodeOffsets:[[32549,53353]]}},{type:"Feature",id:"URY",properties:{name:"Uruguay"},geometry:{type:"Polygon",coordinates:["@@ղĚࡆٯ̺|ࡺ՟ڈҫӠֱχЉɸӇεՇॉұاǚғěޥΰ֫ԟҬÞլǾȈS࠸ɤࡺȾڦ"],encodeOffsets:[[-59008,-30941]]}},{type:"Feature",id:"USA",properties:{name:"United States of America"},geometry:{type:"MultiPolygon",coordinates:[["@@ũƕȽŤ|ɾƓ̨¦ĤƤƎÍǔ¸þÜe͐ƙƬñƌőɊ̍q¯͟ǵˏſ"],["@@˭ÑƟǮīèQÀĈî̘āɘŹëĵ"],["@@ĝ҉|Úĸа•"],["@@­µÓŻˆŃȒ’ɤŚêÃʐ˥"],["@@ıĉ˱ƴªÖŸĈȘijȝ"],["@@Ƭңʼƛז½࡬ƅࠂʹڼŊਖɓ˞Tݨʄ߂̧ࠒ͗ں˩ٶˏĈəȢĉ½ĉɦǎĔ¦ȣǜƅɴ@ŬĹĽƫ࢖ЁǶށǚܳʗӹЁҥȁ̍mēĦť˸Ɓɂ@ঊ҆ࡾƀસмfĐ÷ʰƉǒϜƆࠜHޘAˎ͞ŀàࢶ؄ϜƸ౦N໾BĎȺː¦Φž̖Ϣʲٺٚي˨ə֜ƜώʏAଧռӅƢ˝࣋Пࡷ̃ࢱʝѻӿƛȋSѽˤѽΒsė̬ʦȇãʇ֥ƋЗhةƥλ¥ӥ¥۫ʏఀǂʠǃ୳ʥ՗C|ĺʭɷʚǹ׽ؑ٧×Ɏȁª˟ɀǪҍȼƭ^ͅˏ͛ҿڡûʺֲѕ͎įۦljεǴՑևƀׂ˓˜ߛʊÍĖ̃ŠࡁՕدࢇʝցӱнÁэ̱ţ˭इձӁЍЅӽŻׯƪ׍ˬܗώשLεЊঅ֥—͛ȿԡʣŃЯĺƁς͋ȖѻܢϹٞű͢Ǥ֐ɽҦٻ۲͟źࡑϡƭ¦СϼՃȺोŁݗĤٙÍΏſƲɟaͽǴǓLJō̵Ů́ǃ؍€طѺܻĿ؏ȚԹÏۻȝއح࠳γҝБȕϗUׅ¨ЕDŽ˹͝{׭ȂٽʺɽЄȁטӷӐ̃ӰуֺףͲۉgՉڑۣʦѡʪȽҦ˧Ѯӿτїˈ̩̖ป@C΋ڗ@ဩOቿפ౓ТĀǒ੩ĝॕÝƙіխӚϻĴğʌһ¦̝ɪޭĊɉƌĹҢࠁࡊ۩ୠˆȚχˤٯ۴řۆ҃ҞȀۢ…ܜˍ٢͠ߊĸނĺނƱૼˇܘʓ϶ĸǐ௒˷҂ߋȺɜƇې˷ێᛸ@᠂@ࠜ@ᢢ@៚@ᡀ@ᡄ@᭰@ᮞBაAF͔˴J"],["@@࠽͋ѕɐŽЀބ̘҆Ÿ֐ÉΤʻܫЍ"],["@@ԧŽսƾԛɮࠦƞښùĂ͑"],["@@԰DžԾĒڸɛ࠲őéĝُDZٕǾ͋Ʋݍµȧôº̈́"],["@@؊ϛώnjහ»¹ȕ౾ƛࡨČᄚ˅ྤā٨ʼn૦Ǝౢʧࣲŝ@@MᷱIⷍࠠ{ࠌɵהρݜցࠈҺࡈ˖Ҁѡ֤·ޒϙՂ׽࡮य़ේ՗xՋұЙҥ͂ݍˌʃܺએںҍߎ߯Ä೷rটʌ჉ࢎߩDŽ฽̜୑í࿻ϬৃΨटǯǦ׏ҫÁঁǫ݉˱झdzťӶϚࠚࣀʶɱɂੱҵֵ֑௅ױؚСߏ׿ࣗΗࡁʱȻωಽѡ˅ϿছΫֽÞ޷ɻ࡝˹ۧ˫෹ʉſƘऀϾࠔʸࣆҠਬĨвΈ୘ԊȈǚب̒ƢْђӸॹʫ˓Ơҕ̧շюɧ̝̽м࠿ͳԩBïԄƲ̮ե̚થLJ܁ЀַȬIӈ٩Ϊ͘ӘۆҸ̚њںÖ־ƇڴМ؎ï٘ʼƻϨҹưج͖ԩWࢻǽʯȃڏȄஏĥ௷ȬΛ͸੟Ӧ୾ΘመШ۔@ŕнᄢŽڽԶਕ͌ױр߫ΨଽˈҺѲ๰‚ਗ਼ϦȨФ࡬ЎࠊĪཪώޜÉಐ҄ౚǭ"]],encodeOffsets:[[[-159275,19542]],[[-159825,21140]],[[-160520,21686]],[[-161436,21834]],[[-163169,22510]],[[-97093,50575]],[[-156678,58487]],[[-169553,61348]],[[-175853,65314]],[[-158789,72856]]]}},{type:"Feature",id:"UZB",properties:{name:"Uzbekistan"},geometry:{type:"Polygon",coordinates:["@@xԦૣά࢝ЪշЄ॥׈Яࡾ˭ƴࣥ͏ǤěڢଅѺ۽ӥܕ́Ɛхॅ[ᶾᓘӺƾïದ׻یͅߤݵঢŪ෸à৔ؗÙࡅЦMǢۍ੬ɲЉ̺Lπ׺૎הӖƺʠĉ۵խئ́ײȾ়ѷ੽؁ٕĊ΍uţɺǪ϶૱țˋաЋҫۭ ɓυؠȧǺصҿࡗهǰҳN"],encodeOffsets:[[68116,38260]]}},{type:"Feature",id:"VEN",properties:{name:"Venezuela"},geometry:{type:"Polygon",coordinates:["@@yȣӱĭ˜ϡYѭυӥ͆ڙδÆȌ؈ʻ̒§َਸ਼΀řІ̎ˆ̞ןל_մҵ˧ݮQ࣌ĔӖϕٞĻҼʾXɄਨ¼৖\\܉ʛ˼Їڦ×ِЯƆڧѬn͢ȣڕӱó̫˾̷ȽƽԫƉjϱɫɱّ֪Őʁ̭͍ऱ̽׿Žʏȣڛɀثņƿýϔɑ‘֝ŜՉ܆ï°ǭ׷ʅĭΣΉƏسȝNjʱٷÅҧѼʯ࠺ɟ̧̌Ȅюм…ȊʅʠǛ֒à׼Ȉ˰ƲҎ̓Ơӏĩ؁®ͻęסܢӥńઉăȧ̊ȷê‡ǬĴ̶áͺȃȂŅϮѡÈɸӮĺ׶ʔ̸͘ʌɈрդƖ"],encodeOffsets:[[-73043,12059]]}},{type:"Feature",id:"VNM",properties:{name:"Vietnam"},geometry:{type:"Polygon",coordinates:["@@૭ܗ۫ߍȁ׍٠ࢭ޺ળނԱԞګϪ།ŕ๓۫փ१եۇ۫਷ޱ̧ՠʀ֬دӌܬ͸ࢦÔσԚප٨ļ৖ț֖ƶࡀɃצٍאՋ݌ۥ঴৓Ԋʊ̠՞ɘ͙ܺਙPϕކӭڐҊȴڢIࠈĬܒ҄К̿ސƵƃӛАͿࡎɓ"],encodeOffsets:[[110644,22070]]}},{type:"Feature",id:"VUT",properties:{name:"Vanuatu"},geometry:{type:"MultiPolygon",coordinates:[["@@ˣō˭ςŒɤՆӗ"],["@@ƌڱɥŀǩ­ťɴi٢Дʵ"]],encodeOffsets:[[[171874,-16861]],[[171119,-15292]]]}},{type:"Feature",id:"PSE",properties:{name:"West Bank"},geometry:{type:"Polygon",coordinates:["@@@ԣŭʙЃŕ˜ɜɌŚɁĦǬ̤֔ś"],encodeOffsets:[[36399,33172]]}},{type:"Feature",id:"YEM",properties:{name:"Yemen"},geometry:{type:"Polygon",coordinates:["@@؉ɥNjύo˹࠷Οഇϻݩףυ±ʥºӭΑ՗lj۷©ɃµǿɛəÕŻɇеlˍœ׉¨ɓӬzҠƍʜǑتʋΊǚ¤đϨĸNJ™ξςˌđΠɞЮΊɓɬúॺnƸċ߼č͐¨ɂ˫ϺƖ׼ࢦ޸Ϛᝒ͒ڀ൳˞ח"],encodeOffsets:[[54384,17051]]}},{type:"Feature",id:"ZAF",properties:{name:"South Africa"},geometry:{type:"Polygon",coordinates:["@@ǏŧΣяɻћӇ׻ोࢁףԋًϣ࢛͙ѓ«ŇɷԛŰеDž࣫NJԙĹΏ¬ࡿͩܓƃԱͅϡoΣ̚˳fαϒŸśŏɦLӰ˙֞˔ƴs٤ս޼х܈AF׽તДдͪɯƘΫϘÓՈǃҌÖݤіB᷌ɨűӾߙûԟȈ̏׼ĒрϒЊʨȶДЦȚΠķВɽۂ£՞ȜĐʾƨДҚäʨ͂˪֔ݮغஒؤ΂UОƛ˲Ķ҂ċД஁ɔׯƫऩî̟чƶʏÑāʓɯ̿T̃ԆҕӮĜǢώْQȿؑıۥɑϛֵщ","@@νʶϻǟҕ҃͡Տـ٧̜ČƺˎҴƀƜ˜ʴФ̅ʪ"],encodeOffsets:[[32278,-29959],[29674,-29650]]}},{type:"Feature",id:"ZMB",properties:{name:"Zambia"},geometry:{type:"Polygon",coordinates:["@@ІϏɊ܋ƝɩǙڻLjۡ˃̇ʭޭѶɓᢇۗĂׯٍřӍͯĹ̛̅ßܵۓҭխ˳o˗ĬऱĠƯÚOêͧȎկ¶ۋȑչԾ֣یžᦶშYí̂Ű̀ƧЀĪТėʺ̂q¶ʽϾrՖûˬϡڨŝԤˆȌѯ٠ş̴ΧΈҥ٠Që࣠ɱƳח͞ɧƬļࡈƬসȉψʈ՚ɤĶ଀ƚͦđΘɇͰƗՖƗӊʧ"],encodeOffsets:[[33546,-9452]]}},{type:"Feature",id:"ZWE",properties:{name:"Zimbabwe"},geometry:{type:"Polygon",coordinates:["@@ҁČ˱ĵНƜ΁VՙϞٯźʙՒC̒έĞ्ई˃ӢǛƮ͓ڤलğ˘ī˴pҮծܶ۔̜àĺ̆ӎͰَŚÆ̻۬hϴǯǺȻАÓѦˑF੟Ǐ׋—عƊʝħӵŵùɛ؅ࢫ॓"],encodeOffsets:[[31941,-22785]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/xiang_gang_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"8100",properties:{name:"香港",cp:[114.2784,22.3057],childNum:1},geometry:{type:"Polygon",coordinates:["@@™@}ScTʟ@cWuJÁ–]„l¦RLj¼BĄà˜ ŽH@TOHCTDDDHDNAT@PEHDDNJLX@BABALHFF@DKHADBBLDHHFBLEJB@GDBBFBADDB@@KFAFBBJJA@BB@@FFDDADFF@FADDDBJC@AFBD@@DDD@DAA@D@DB@DHHBFJBBFEHDFAN@DGDC@DLCBDDCFDlAFBFCBEF@BC@GDAB@FD@DZJ‚X´HĐMja@Ý`p_PCZ@lLnRGSDMFK|a\\Y}­ƒ§™Mën"],encodeOffsets:[[117078,22678]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/xin_jiang_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"6528",properties:{name:"巴音郭楞蒙古自治州",cp:[88.1653,39.6002],childNum:9},geometry:{type:"Polygon",coordinates:["@@˜@ÈÒĊanwŎV„™Ȯ¦ͪŃĢ„ÜōȂçČéƐżLɆóĊ‚ĊaʊŁ±¯²Um»ˌmÈ»V™ʠţWÑůǓ郙ôƑƒğÆīŎī@Ƿ™wô™˺LÞ¯ƨVǪуšĢ™ȘV°wĢŽôk°¯ƒ»΀@Ȃ»ĸŽǔ@΀ƒ͔ôôLɆó̐ÝɜLɲōͪƒƨóŤK@ī@IU܃ÛmȻţǩÝ˹ÛljťǓǫō@Ɲ²¯VçōKͿŁΗÇţ»ƽ™ɅƑLÓŏÅÅɱV@ÝĊU¯ÑĊĭÞLšÞŎJ±̃XȣˌōlƒUÈ¯ŎKÆƅ°™XÑܱnŗġV¯™óaUƒƧUōŁ„Ñ™±„çɲ¥lĉkğ°ƒk¥˜ƒnğţL¯ÝÝUƽĬ΁lķ°@„ō„XÿݯV»ŹLʉÞɱŤĉó°ÝJ™¦ÝKÝ£ţܙÈĉ@ƒxǩUċƑ@ky͓¹™`U²ĉVġ»ğa¯¥ť@ĉ™‚ó@ŻÛÛJƒw¯nó¯ġWƽʩķÝɛwĉĕݼȭÞķō@ó£Å΀ƑŽ¯ôȯÞ¯Ȱ™ÆōèĉXǼó@ݚnºƒĸ„ÞVƜĸȚUʶõˀĵĖɱŎÝĖVࢰӒѢ°˘nϚVˌ™ÈmɼĵŦW¤öʊõʔ@°ÈXVŽ™ènŎȁb¯ǫĉ„±Èğ`ġwōÔğ»mVVŽ„Ý¥ó@™ĸķô@ššbX„ĶmV²²`Þ_˜˜ɴbͪÈ°„ÞWĸÈŌmބškɲŽÈUÆ»n¼ǬVķĸźô¯°n¦ɄǜÈ"],encodeOffsets:[[86986,44534]]}},{type:"Feature",id:"6532",properties:{name:"和田地区",cp:[81.167,36.9855],childNum:8},geometry:{type:"Polygon",coordinates:["@@ƨ¥šèź٨ΘƑᩄbUࢯÞĕɲōĶĕöʿVʵķșUƛƒÝ„ķm¹Þ™ô@È»ĊWŎçšÅ°ȯȰÝ°óƒÆͿĉ»̽çnƒmɱĵƧºóU™™ƽ@±wóL¯°̻L±Æ¯Vƴķb¯VÇ¥ğ²Ǖbk¥ÇKlÅɱġ@у™óK@™ÇaÝXğţxĉČǫķê¯K@уaŹ„ƑKƒ¼¯Vóaónġw™óÞéU™ġbóĉğÇl¹™aUóğKW„Vůn›ÇŋƑ›ķnʇ»óxĉw™çÇ°Åw™°ċ„XŽ™„ób±ƒkÈÇJ—ƒm²ţx@ÒݎšŦǺn„ó¼n°ÇbUÒ±¼XĸĠłƽXmwĉºƒzÈÜmnxmx²ĖmҚbnŽƧêUºĊêÆVóĖóUĉ¼ÅĬƑ°ɆƆŻŚlłÞLš¼nĠƒ¼@ޙšÞź@ŎÞ°VšɄɴжϼِ͈Ŏ„"],encodeOffsets:[[81293,39764]]}},{type:"Feature",id:"6522",properties:{name:"哈密地区",cp:[93.7793,42.9236],childNum:3},geometry:{type:"Polygon",coordinates:["@@WnŐÆĶLĢ¦ţºź„lxÅĸƽŚ‚Ʉ—Į˜è@ô²ÞUĔƐńV°¯ĸX¦Ɛm̐bƒ»Ɇa΀šĢ™ƐLˤ™ȘÑnƒІljĸÿn¯ĶaŎ¯ĢĕȘ¯°΂œla¯¥™ǕǔwˤӱlťО̻nŻmɃĕċţUw°WUóƨÅţķ°ýV±óÅǓéʉ¯ƽŁƒéōǖȁÝƏůǕw˹ǫȗǓƧǕVý™é@ĬţLƧôͩ„ɱŎɛK̏ÞɅôóK@²@°ōؚ¼lŦ¯ŰóƜÛlV¼ķ¼ƒ°kȰ™Ű„ĠƒǬ™ŚÝŎmĖ`@ÇÜn„"],encodeOffsets:[[93387,44539]]}},{type:"Feature",id:"6529",properties:{name:"阿克苏地区",cp:[82.9797,41.0229],childNum:10},geometry:{type:"Polygon",coordinates:["@@VƚxˌŎÞŎƒ°n„ȂÒ°²VĊ¯VğƾˍǬƨÞÞKÈÞĊVźôɆÞĢèŌôWČ²ŤVÞĸʶbl‚¯ôn_VÆĸlmÞnVź_ĸ¼Ȯmǖ„šéĸW°°„ĸJ„kʠ¼Æw°¤ÈƒlxɆzČºĶI²ÆǔUš°ô@Þ¦‚ƒUnUĠ¼ŎÓĢxĠ_²ÇĊƒǬ°ŽȂamōšçUÇW@¯öʓõʉX£ĶťnɻšÇUˋmϙ¯˗ӑѡᩃaΗƒœɜ°xWƴUxɃÒˣ¤Ʌwğ„ʉōóÝŹ±°ȗ@¯„ƃ²¼","@@ō™гwȁ¥Ƨ°ŹÑķV™¼ÞêĊ»‚lĵšm¦ÅW@ĀôÈźaɜxÈbÞÆĶIОŘnIÇŃÛÝĊÑĠƏ"],encodeOffsets:[[80022,41294],[83914,41474]]}},{type:"Feature",id:"6543",properties:{name:"阿勒泰地区",cp:[88.2971,47.0929],childNum:7},geometry:{type:"Polygon",coordinates:["@@ɲˣĊIÈ¥‚ÅU±Ċýkō°ƒĉƽó»ĶƽXóʵʵ™ȯƑÅȁɅ¯ĉ@ÇሗK֛@@ˤV֜ʵрƒǬVĸƑŎ@ƆϯÑóŽķ@ʇ»ķ¦έmlÈĸĊX¼WźÛÞÝѸ‚ĢČþ„ĀĊôάVö¼ĊUƨ°°èŎČUÜƐóôVôôŽ²êȘlˌç°`n²ǬŽĊaš™ƒÛ°±kğmm»š@°ÝɆÛÅÇVaݍVm͔ğôÝÈb‚„@„ƒ™n¯š™ÜUĢÑĊ@źīżWŤÈǖWôŁÆI²ÓƨL@ŽĊX„mmÑÆ»ȰÑkƒĶō@ý°m—¯"],encodeOffsets:[[92656,48460]]}},{type:"Feature",id:"6531",properties:{name:"喀什地区",cp:[77.168,37.8534],childNum:13},geometry:{type:"Polygon",coordinates:["@@Č@°ƒĠ„ôÓô@Ŏĉ@Ƴĸ@Ť£ĢlVôWVóřXĉŤêÞ@ƐÒĢÑlèÈV@šĠIk°ÆŘ@ÈÈĀ@ǶťÒğ@š„@ÒĉlŻ_@šƧĖÅĬōÆ@bźÞnƒƒlVœÝĬšWƼʇ„ƒÝÅ@ÇÅÈwWóĉ±ğz‚ĬČƨƂÝIĉݯbÇÑĉƒ¯ʈV°xUŰĊ¤ƪ_ôÓɚI@lȚXȮ™ŎlɴȘ՘š„¦ɲÆʈ_ɴŽźŽôÞʊŎĠƒɆxˤ£ɄÑVwXƳ¯w›ɛŹ٧™çƧ¦ōƒُ͇еϻɃɳU™Ý¯@ōÝŹš™@݄»mğ™»ÝKkŁżřɅƅƒ¯ÆīĊ»ôVôĕÅUĉéV¹ƨém™anѱĕnwmwnÇۄyĉ¹ŹlŏkĵèķmōÞġKñÔċKÅèĉzƒŽ„ômxȗÿƿI@þÅČÝKÝ°@¼ÈVºš@ÅĢšÆUċłn„ÝÆǕČĵJm£ÝJ¦@ĊƒxV°ƏLċ¼ǩ™@™m@ÅĢómÇÆğ¹Çš™ÆšĖÞKšx„wô¦ÆÑÆL²ÆƾŽU„Ž±ŚÅŻĖ@ĬŤÈñ„@ǔÇx„Èǃ","@@VÇ™ţ°ğUĠ¯mk¯ó¥ķIġÿƏbƒ„ĉa±ÒĸĀlKU„_m»nwšŽ„m@ÈŤ¦ĉbÞ°±Þżł̦°ĢŁVé"],encodeOffsets:[[76624,39196],[81507,40877]]}},{type:"Feature",id:"6542",properties:{name:"塔城地区",cp:[86.6272,45.8514],childNum:7},geometry:{type:"Polygon",coordinates:["@@ήnĸ¥ʈ¼ĸ@ôϰÒ@ƅƒōUķƑǫʶпU֛܃LګK@΋ĸ@Æ£ÞġÅĠċšLV݄»™@Å»Ýnm¯š»nŻĊ@nķŃ@¯ómóÛÝǟ¯aÝóȭ¥ƒšōUmxĉbÇї@›bUº¯X¯ÆƧbVÒĉnǕw¯°ƑŽV„—ŽÇ@kx±Uƒšɱn™ŽÅKƒ„¯ƒĠǠU°ɜL@°ƒxnĬ‚ĀŋŎÇLƒŽğšϱÞέƜkôÅĀǕłƒĸĊŤUŰĢ°„¦ȂϰÜɨ°x@°żǠÆƈČVĠ»ČL°ÇšbĊÑ̐óÞlĶwބɆVÞwǬxǪţȼÜLŐĶˢ@","@@óKĵĀV͈ĉłƾNJÆŤƒzXl°ƒÆL²¼źŽôÈĢǔ™¦l„ô°ɜÞʊĠğŃm»ʵƳƑʝȗīV¥¯ĉ°Ñ@ŃÅI™»ĉmğn™ƒašƒċƨbš™Vğ—w›ġ¯@Uōa™ĉÝJğÑÆŎkŎÞĀlźƒ¦"],encodeOffsets:[[87593,48184],[86884,45760]]}},{type:"Feature",id:"6523",properties:{name:"昌吉回族自治州",cp:[89.6814,44.4507],childNum:7},geometry:{type:"MultiPolygon",coordinates:[["@@መL@È°ĊȂɆƒÆĊ£„ťôWÓɆbĢÅŎƒÆ¦ČÑW¥°ķU¯ƏŃVē±Ý@ó—ç˜ĭɃƾřÆķkwŹƒŤ¹ġ¥ĵKŏÅXmˍщwǓ¤Ƒ@wóōVķ£ɱšġôÛa±Òȁ„óèţIVŽƽ¼k¤ó¹ġJmx—»ÝUƒ²™@ÅƃĸǫŎ„ĊmŎǬ՘"],["@@Þô°bÞǠôÜôn@°ĸń˜Ƕkłƒ¼UޙKğȂÆÝĢŤķ@@ΌڬL܄K@ˣȂ˭lĉńW¥ĵVÆý@ŃÞēUŃȗƅ@ŹƩǕĉ»k»Ç™VğóřX™ŻKƏŽċêȁèÛŎġƒͩń"]],encodeOffsets:[[[90113,46080]],[[87638,44579]]]}},{type:"Feature",id:"6530",properties:{name:"克孜勒苏柯尔克孜自治州",cp:[74.6301,39.5233],childNum:4},geometry:{type:"Polygon",coordinates:["@@ˎǫĠƽ°UUĉ¯±ȁÑmƒ„¯Ýōˋō™wUű»ÅƑ°ƒȘ@²¯ɳʇ`ɱŃ¥՗™ɳȗōkȭšșW@kəJóÔƩ`ĉ£Vů¯wU°ʇĊ„ÈÒ°aĊÞÞJŁċƧīĠyĊ²XôÇxÈÆÆ@„ÞʈƒÅ»™XÞīU›Ƒkm„ŹÝ@aŎÅÆīƨĕ@™ż`Ċk@љƒĠ@ŦÑ@ǵÇÿ@ÇÅŗl¯ğJ@™ÇUkçġÒƏÑÝ@ţéWĊôŚUŽóXUġkţ¤ķ@@ƴōĊó@óÔğƒ¯„ċ@@Қ¤kôˣŰ͓„k»ƒKX¯ċwƧôğɐšÒôIVƙš¯UķǬķšnŽ™¼ôb°ÒȰVVÈÞ°ƒĸó¤V¼°„V°²êƒlĢ҂Uƨ¦ôȰƴĊVV¼ǖIċĊ„ÞɜéšnČW˸Ǹša„řÈw±īšçĸ¤ĊšôšwšŽĸUĢ¦˜éǖĬ„Āô¼lÞkÒ°x°ƆÞx„šÆV²ǔ»„b°wގȘ¥°n„šŎV@°„„ʠè‚ŰȂb"],encodeOffsets:[[80269,42396]]}},{type:"Feature",id:"6521",properties:{name:"吐鲁番地区",cp:[89.6375,42.4127],childNum:3},geometry:{type:"Polygon",coordinates:["@@ôK„ĉǪa²¼lÜô@ʠê°Ĭ™ôȂƒ²ÑÜbĢóɲ™ĸ¤ŎUô@xƒŽǔ£ъxˎmƒÈÛ@‚_nĕÞōšř„ǫƒğšůlȯ„¯ĸ»U»Ükôƛ°ůkť™»Ŏŗ@¯@±͓óͿ„Ǔ@ķȁ¼Ϳ@Ƒ¼¯°ólġ¯xȗUġšƑ™ǩÒƧUÝ°˹Kóššx@ǸōĬÅĬƑĠ󃄚ǔêÆ°XÒʟŤUšÇ¼ˋnn¼±V²°ȂUŌݜbʟǔɅô@żǬaҎÈ"],encodeOffsets:[[90248,44371]]}},{type:"Feature",id:"6540",properties:{name:"伊犁哈萨克自治州",cp:[82.5513,43.5498],childNum:10},geometry:{type:"MultiPolygon",coordinates:[["@@ĉ„ÆŘȁ̐mÞ¯ĀX°±¼@ƾ¯ƴ°ŎÝþŋ¦WÜÞbȂĉźUœÇmwVUȂóô@ȰÝ΀nÆJn™ƾ™ʠ™ŌLČóǪ¯œ¥ǔaǖšŌaôÝĢLšx„ƒÆLšɲm„™²VlwÈ@˜Uƒƒ°¯ǖxĊmUÑƨa°Å°WV¹œa›ÇɃÈm¥°¯ŹóĸķǫUm»Å¼ÇVɱ™l݃ŋnķÇÝX¯ƒͩÇɳa——Ý`±_U±ĵnWƒ™a@™ĸóšķ™¯ǓV±ÅĵJċ¹ɅykwDŽ¯£Åxʟ»ƒlķI¯ƒX¯ķ‚™êǕƒȭnķ»Ź`±„kÞ@Žš„Ýô@Þ°xšŤŎIƨÆUxōš¯²ǔĬǬlUŚ"],["@@ÞĀlźƒ¦¯ĸŤKޙšƒċƨbš™Vğ—w›ġ¯@ţƽJ"]],encodeOffsets:[[[82722,44337]],[[86817,45456]]]}},{type:"Feature",id:"6527",properties:{name:"博尔塔拉蒙古自治州",cp:[81.8481,44.6979],childNum:3},geometry:{type:"Polygon",coordinates:["@@ήƛϲÝĠ™„ÈKŌōÿmī„w@¯ɛKV¯ğǟ°Ƒ™wġKóÞŋbǕ™Ǔb›¦ǩ°ċôŋKʟšƽšmšÅImŽͿŽȯÞó@ȁôUVnx›ÈŹVȁĊÝabŻ£¯°l„óxȂŤĸkĊšÞyĊêĊmĢxV„ƨÈŽĠX„ŽΘÆĠÔź‚Ɇţ°LXƾŤŤb"],encodeOffsets:[[84555,46311]]}},{type:"Feature",id:"6501",properties:{name:"乌鲁木齐市",cp:[87.9236,43.5883],childNum:4},geometry:{type:"Polygon",coordinates:["@@šŽWŽôŚUĠȚl¼Ċ¼ƪǖ@źȘƆ@ýlܚXVŘޙš¦V¼kĖó҃èkĊȁˮ֜@ǫ՗nōƒĉǬō„ķÆŚ@„±ÞV˜¼nwĢIôºl£ƾ»UŤJôçšó¯īʟéó@kÛ±»ǩbƒĊóLҍÇǫb@ŻɆóʠǓ›aŋÞȁVʉłĉbĉɅô"],encodeOffsets:[[88887,44146]]}},{type:"Feature",id:"6502",properties:{name:"克拉玛依市",cp:[85.2869,45.5054],childNum:2},geometry:{type:"MultiPolygon",coordinates:[["@@ɜÞʊĊýVaŃm»ʵƳƑʝȗīV¥¯ĉ°Ñ@ŃÅI™»ĉmğn™ƒaݚţL°ķóKĵĀV͈ĉłƾNJÆŤƒzXl°ƒÆL²¼źŽôÈĢǔ™¦l„ô°"],["@@ƾIŤ@UUwōa™ĉÝJğÑÆŎkŎ"]],encodeOffsets:[[[87424,47245]],[[86817,45456]]]}},{type:"Feature",id:"659002",properties:{name:"阿拉尔市",cp:[81.2769,40.6549],childNum:1},geometry:{type:"Polygon",coordinates:["@@nIÇŃÛÝĊÑĠƏō™гwȁ¥Ƨ°ŹÑķV™¼ÞêĊ»‚lĵšm¦ÅW@ĀôÈźaɜxÈbÞÆĶIОŘ"],encodeOffsets:[[83824,41929]]}},{type:"Feature",id:"659003",properties:{name:"图木舒克市",cp:[79.1345,39.8749],childNum:1},geometry:{type:"Polygon",coordinates:["@@VéVÇ™ţ°ğUĠ¯mk¯ó¥ķIġÿƏbƒ„ĉa±ÒĸĀlKU„_m»nwšŽ„m@ÈŤ¦ĉbÞ°±Þżł̦°ĢŁ"],encodeOffsets:[[81496,40962]]}},{type:"Feature",id:"659004",properties:{name:"五家渠市",cp:[87.5391,44.3024],childNum:1},geometry:{type:"Polygon",coordinates:["@@„çôÑlĕU»™¥ÝšUŗ™WkÛ@þVńÝĔ@ńÅþĶUX¦Æƒ"],encodeOffsets:[[89674,45636]]}},{type:"Feature",id:"659001",properties:{name:"石河子市",cp:[86.0229,44.2914],childNum:1},geometry:{type:"Polygon",coordinates:["@@lŁ—ǵm‚ĉ@mż™¼n°ÞmƼš@"],encodeOffsets:[[88178,45529]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/xi_zang_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"5424",properties:{name:"那曲地区",cp:[88.1982,33.3215],childNum:10},geometry:{type:"Polygon",coordinates:["@@ƨʔĸbܺÞwnxźbÞ°ô@„ĶŽĸIȼĊJŎÈôUšÝƒ¤ǔLސŎ@ĢŽȘblƒôL„ÇźçȤôLš¥ÞIÞ¯Ķxʊťƨ™ƿÑĉXVķŦ¯ȂKÇǕšÑ¯IUš£¯Óƿ£VĕōÞÿÆwƒƑ„£ǖxÞĕ±ÇÝaUÑȃU¯‚UōÈ݃wWŁĵ™±Ý„óĢÿ°IÞ±mÅĢ¯mÿ„¥°UnÑŤĢĕĶwǬŻͪwŎ¼źÇĢ„ĠĕˎŁ°óƨ¼Èa‚m@¥°wǔ„ǖ°ŽƨÇŤœšġƨ„ŎŃôbÈÛŎĊ°@Ġw²ÑÞJƃÆb²ƒ°êĊUނlȲƒV„ÈKĊÒĸĉ›»ÅôťUÅǃk¯@ǂÑklǁÅl™Ģ™VÑóƒ@°@„ÛĸƒV¯ƒÇĊ™n¯Uĕšƽ¯m›¯b™È@Ò°Ĭƒbĵ›¼„‚kxķýÇJk£ÝaUÑÅóĶǟkÓʉnĉƒÝ¼Ƒ„ó»Þmn£m™Č¯@ƒȮÿV¯ĸƒ™k@Ýówƒ»ğ„ġ±ǓLō„ƒšV¼Əèķĉ™è±b@Òţ„UÑóakƒl£™Ó@¯L@™ÇlUóȁš¯aġÈÅĕÝLķ¯Ė¯@WĬ—x‚ÒÈnW°ţôU²ǓÓġ²V°¯ôƒǔÝL—ċšk™š»Ý»Ýš¯ÞƒVƒwۄÝÇōͩÈĉċ»ĉm¯£W¥ţKkóġƏW@¯±kōŽÈ›b@җšÇaƒÆ¯a™„ƒkóŽÛƒÇ¦Ýa¯šÝ™ĉ@ǻۄmƒǓxķƛ¯lVĀÅÞġb™™ÇJUÅV™ĖƑW™zō»ōšƒW™n@è¯ÞóVkwƩnkźÇބҙޯƒƒýğÇUxÆÈnè±bĉÝ»ÈуwšwÞ@m»ÈV@ýÇ°ķ™xƒa„ݯXċ¥ƒÈóW@ôkxlnxVÈóĊkŤġ¼@°¯ŰƑL̻۱ŎÝV—Þ›VƒÇÞŎÇakƞ‚š@èğŎĸżšƾ°ÒšLÞôĠKȰĖźVÈÒĠ„¤™VôšŽU„ÈþťL@ôǬÞlÜÈnÇÒUŚ™@šĊƨW°™°Xƒ‚@ČÇþ„ƴĉÒķ¦@ŽĢôWĀôłUÞĢǬ™ź°¼š@ƒôV°„bUÆnzm¤ƽĸƒÈ"],encodeOffsets:[[88133,36721]]}},{type:"Feature",id:"5425",properties:{name:"阿里地区",cp:[82.3645,32.7667],childNum:7},geometry:{type:"Polygon",coordinates:["@@„Çƾķn£myVŃaU¯„ó™@¯»šŹġǫVÝóŁXÿġó@ĸ¥ĊуƳÈý@ċ„Wš¯X¯ĉƧ‚™š@VřÈÑÇmkÛǫÝ@óŦKÇýVƒ™U󚏃£ğÇÑŹUȯĕğLÝó™K¯Ñ™ƽķŻĠō@灙lƝÈbƍÈ݂„œU˜ÝÞU²ō̼ůƒK°ů@¯UK±—ĊƧbōÇmçÈġƒóšÅób™™źóš¥kīƯól™ç™KôĵUƒÅ„VŃķ¥nÅŏm¯¹Å‚™»@ÑǍóxÝkʇȤU¤ķb@ƒ¯ĊÇx¯ĸĉKm°šĀk¦l„„KnĬȀƾÛ¦WÆŐmNJĉ°ōUţ¤UšŎ°šŎKÞłÆ„Ǔ¦ƒÞ™‚™„ř¯bmUÝl¯Um™ğl¯£șwŎǫaÝnĉĶƒk@¯™K™šō»ĉn™aÞ»ťnkml™ĸ¥UŚŻkÑťƒĉV™ôó°LôīĠU„ÿĉǕÅz±Kƒ¤„²ō¤¯Ė¯UÝ¥Vĵ™óÈťÝwķșÑk¤ó„™ƒWýĵĕ™„VĠƒV󍃎Ǔ„ķ°k±VU±ţ¦UǟÝřJVљ¥XUċUŎlÛƆǕÆȗƆ¯wŏÞÅ@™šĉl݁óŽƒÒ™nUôńlxólÝôێ±™™LÛôÝL@‚ġ¯X¯ÇUżóa󤛼XÒġŎóLk¦‚ôżĸĠ™¼™KġƆô¦„ÆƑÔĉĶ¯ImÒ°¦n°¯Þl˜ÝČn„ƒÒšKĠޚĕkƒlýƾťœšôI‚ĖŤÒnƜm¼¯lnżóÞ@Ůó¦™ôƽĖċŚn°Ý°ôÈUƜƒblÞóŽ@Žǖô°UÈƆ°X„þôŽô‚lѢšŽ²Ėm¦°š@¤™XŽĊblܚzkºƒĖmX„šŎWVšóÞn°lĠxȚa°»żLźƒ„b@Æ°XĠÝȚxĊĕŤaȚ‚°È@„„@èŤ¦Ü¼œW˜ÞkŽÈ@V°lŤkŎ±²¦ƐUšlj°aÈÑŎbĢƒŎbÆ¥ÞIȘlššôVÈU‚™šb„kɲĶn„mnXb̼òƾĖŎ@ĢȂÑôÓĠĖʊšĊÔ"],encodeOffsets:[[88133,36721]]}},{type:"Feature",id:"5423",properties:{name:"日喀则地区",cp:[86.2427,29.5093],childNum:18},geometry:{type:"Polygon",coordinates:["@@ĶĖXþš„ôƒl£šÒĸÇÞxÇŦšôUĶÞ¦°V°ĕŎ£ƒ±„£²LÆyĊǖƒĀğVóĬ¯KóôUš‚ĊŦ„lҙżVÆķ¦kšlnŦmݼšbĊmŎ¼š™šL@°„lĊĵÞmǬbƍȚx°¤Ġknš°VÞkVn°aƒŚš‚š„Ýǔ¥ÅƒÝŁōL¯™ōV™Ť£ŎVĊ¯nljƏXÅÜ¥ǿƽmīƒLkƒl¥™ÿn¯ĊL°ķÈw°ĉ@ƑĸaV£ʈȣÞlôwȎ@Қ¼Æ°ºŐnmÆĸ¦UńƃV„óĶšLšèôkÅ°lĬ™¦Źôššôa™Æ„ôÇĢnèŎÈƨa˜ĉ²‚VLĢ»lţôĉUǂwkmlw@óôX„ÇȦ°WƒÞ„b‚wĸšÈ¯@þÇUn¼Ý@™x„xÇńÞ¼ĊŽ²amçÅÇVwĠȄþ°„šÝƒÑÈÝlŹƪmlxôU°Ý@çšm„XŎ™Ŏ¼šyƒXšĕÆUVÈIššĢaÆÝUÿ°kĸƜǔwn„܃ȼĊ@ޚ°™Þbȥ܄ô„lšƒ°b„ÅÈb˜™@ќa‚ǯUU¯Vġš»ƒ™¯aV¯Ç°Å™mnÑŤçǬVǬ™±ĉ¯¥Vĕ¯Ýk£˜ō—w@±ġÛ°ÇVїƒ@ۘa@ČL™Ƴ™„ƒÇa¯¤ÝIĵ¼U¥ƿōķÅţŻókÝóĕ‚¥¯™U»Æ£X¯ġŃÛkÝ°V°ó¼¯èWôÞĖ„ȎƒŽkĀƧĀówm¥¯JŹÝJݙōVVŁaݐƑ@ƒ˜ğŭǂ¯_ƒ˜ĵ—›VnxŃón›ƒĵxÇĖĉVÝÈğV™Ò󃯐±Żĉ£ķÆÅL™Ljĉý˜ţۃ¯VƒnV¤ÝÈ@°ÅÞݤ™ŰğŁm¦ÝxóKƒ¥ɱÈUĠôêVôÛ¼ÇWÝçĵaō¦óĖƧlÇĢƑŽnŎDŽV¼¼‚ºÛ@m¦ƽ„ĉmm¯ÝKÛç¯bŏłĬ™bƒ¼ÅLmŽ„xť°ÅU™šÝXkŽÝmĉ¦W„¯K„ÒknÝaV„Ýè¯KɅńÝKnÞ¯¼"],encodeOffsets:[[84117,30927]]}},{type:"Feature",id:"5426",properties:{name:"林芝地区",cp:[95.4602,29.1138],childNum:7},geometry:{type:"Polygon",coordinates:["@@‚VÈłVôÈk@š°K@ŽšÔk¤l„ôbVÒŤƒ@ѲašçĸĊƐçU»„™ŎƒǔKĢ²Ġƒ„¼ôx@ޚlƨĬ„Ul¯ÈLV‚šÞJ„°Ünʊ„wÜbXê‚VÞ¯°ššanaU°wƼɴÑWÑ°mÈýÈam¥Þ£Ť@„¥ôblÞĢ„ź¥ôxÈÅmݚ™ƒĕŃV»ĉōŤōnóƒ»ÈīķIUƒĠÑ°ġĸLÞ¯VÒƂ@Ābš¼WôÈ@V¼ôóŤKÈÑU»šwVǫżnWÒÈx™¼‚lŦ£ĊōŤx²¯@ƒÆƒU¯šçÆ@„¤°£„é°k°lšůÈó@¯ŤÇÈĉƒkkÿó¥ÝXķљÜ@ÒóŚÝ¯°ĉówÇ±¦ÅJUÒĉĀķw¯°mĖ¯„±akxÝÅnƒ™»lуK@¯lU™¯UVѯóĊ¯mōğVǓƅƒÞƒWÝÈÛ@ƿô¯ÜġzÅþ¯ólmôʇġĊÅUͿřŏȁˋŁóÇˡōƧƒÇb™w°Ķôk¦šÒƒnUþġҙÔkǔķèó@ƒ²@ŘōńĵyƒzġaݤÅIƒ¤Ƀť¦ğѯ¤ķbóš¯ó±ŽU²°¤ČÜVnÈƂ„ŚŎ°ôĢ„þÆzèVĀǎĀǘƒXŹÑ¯¤ówċķk¦šłUÒġzÇ@ƒ™ÆÝx@²Þ@Ƥ„Uô¦Uš°x„U"],encodeOffsets:[[94737,30809]]}},{type:"Feature",id:"5421",properties:{name:"昌都地区",cp:[97.0203,30.7068],childNum:11},geometry:{type:"Polygon",coordinates:["@@™ŽVĖm°ĉš„ÈU°ķ„ƒÜ¯@@ô„UÒġškš‚ÆkÈlŽÒ@Èl°È„VÆóŦƂœ¼‚a„ÅĢ™Ʉwnōw@¥Ŏ¦°ŹÞmVš°wnÿƒw„wÝw@¯šmÞŗ°wĠ˜ĸkÞğlĔ²¦°@„ĕĸwVóšal@nĢÇĊn°@¦šŽźUXçǔůĸVš™ÆK„ÈÝĠš²ÅĔô@lšŽÈ_m˜„zǖl„šaU¼ôwV°¯¦‚ĬÈa„l@Čǎ„¼™„nŽ˜I„xô»ɜ@ƨ¥ɆŁ„ŃǪȁkƛƨȍʊȡóĭ›@—ÈÇVƒůރĸƅmēƨť™ÅÈʉVǵ°ġVŭÅɧ°ÿnɛš£mƒķ²ŃóÑUĉ°mÇ»¯@mxUĀ¯èţ°ȁÝç„ġU¯ÆÇţÈ@°Çô™Ű¯k¯lƒê¯¤ƒ£Å@™èV°Å„@„±°ţwĉŎť¤kš»ÇwXÑŻmUǬ™xV¼ÇÒţLóôU»Ç@X󙻂a@ÿŁUÑÝ°ķK¯ĢğÒV„ĸJÇĬ„¼môţŎĊŎU¼Æ„„Ė™šnÞÇÆówŹ¦ġƒkÝóaƒ¦ţ@ݤn¦ÇbÇþ¯nXÒɳÒÅ»¯xVmb™b¯™Ý°UWéÛaƒxʉÛmƒ¯ÝI™‚UÇKk°ƒVƧīķ„U°ȭĀ@„ċ°nšm¤Ýnô¼ƒƒÞ»Ċ„ʊmlÔĵǠÆôVÒÞbl¤ÈIĸþlwƒœ»ĶŽ„a¯ī@њǰanœƾ°"],encodeOffsets:[[97302,31917]]}},{type:"Feature",id:"5422",properties:{name:"山南地区",cp:[92.2083,28.3392],childNum:12},geometry:{type:"Polygon",coordinates:["@@°ÞUĖ°¦²ĊôÇÜLǖĀɜŽȘŰÞLĸźêÞ@UÜUŤ°ɞ¯Ü„°WŦĀmŎ„¦ĢyVљŁl¥Čĸôx°£źÒ„Wȗ‚ÿȍUÿ‚çÅyƒýóġō¯ƒřŁmÇÛUċŽ¯£V±²°ôô™ĸa°£ĠÒŦ¥ɄŽ„£ÆJÞ£Ģb„yĶzŎŃ@ŗ„±ô@ĸçlǓšÓĢÑVý„m™Ñl¥ĵó‚¯̻̥™ƛǫÝһÇƧĉyţ¼ҍēVĶĉŎ°ĸmšÞVÝĸ™ÒÛaċ„ó™ŹĖƒèÈÈl¼k¤ÝX@`ސŏ¼Æō¼ÇçĉKUÝÝ£ğ¤@¦ġl¯Òġĉ¯óš™móxÝÞğVšƴċK@—b@ܘ„UÒ¯ÈĢÜ@²˜x—Ŏl¤"],encodeOffsets:[[92363,29672]]}},{type:"Feature",id:"5401",properties:{name:"拉萨市",cp:[91.1865,30.1465],childNum:8},geometry:{type:"Polygon",coordinates:["@@Ŏ²l@°‚XĢƐlôŤLX¦°¤ĊnČ¼ÇĊŎͪÞÈ܃„x„U°Ýޙ޼™¼lšČ™˜ŽÞK„Ǔ°óU¯Ģ±ǔÔV±ŤóX¯ÇmÑ˜wXī°@°ĕĸÞKÆĖĢÇ°bȂ™ÇŁUƒV¯wV™ó¥ƒVÅ£Ý@@±ÞwšÅ‚„È@ƒ¥nōťÿ¯Xۃɝ°ţ¯ÛVVÝ@ŹéķÝKȗůɛǕÿÛKóÈǫšǫUţèmҚn¯Æ°ÈU‚°b„š™¼UĢV°°V"],encodeOffsets:[[92059,30696]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/yun_nan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"5308",properties:{name:"普洱市",cp:[100.7446,23.4229],childNum:10},geometry:{type:"Polygon",coordinates:["@@U‚ô²‚a@Ž²²Ķ¥œV°šĶ²bl¤kVxl‚@œ°‚Ś²@˜„„y„@ô¦¯„@xƒxVxU„VššbVšÜm¼Ŏ„„ĢmºXXWÆ@ĀœšmŽmXU°ÅÒm¼Þx°w„@°‚XêĠ°»nV°U„l@k„@V±ôī@£‚ƒČŃÆ£„KÞý@¥‚k@y„a@—nWV„UVƒšwƒmƒ£Jƒknm@wmkn‚X„˜šX„¥mUUlUnbš¯°ŽnkƒVInlIUw°n™mk@@mlanXlanmšk@wVWUw™_@éĠašnmUaÜ£ƒmXƒ¥¯@@„óUmݯ¯ÞÝlKnxô£š»„»Ġ„J°aV„UÝÿV¥ÛbƒI@wmŽón¯yÛL@ƒWkŎmș`IWa¯K@¯mUnmaXm™bmak„¯ŽƒĢ™ÒÝm¯mV¯KÇb¯KۜWW™X@a™V™knċLUWV™kXóW@k™a@ƒób¯Uƒwmb¥UUlaU¥U£maķšƒKXkƒmÝ@kwmѯk±ċbUUVakaġ¦ƒƒkL@`ƒœ™a¯xƒm™Åƒ™LUWƒ@ċnŎUV°LkL@b°°@¤š²ƒ‚šnôôk„l°kè›ÒÈzV¤È„WôôƒnV@„ƒ¦@¼Ux"],encodeOffsets:[[101903,23637]]}},{type:"Feature",id:"5325",properties:{name:"红河哈尼族彝族自治州",cp:[103.0408,23.6041],childNum:13},geometry:{type:"Polygon",coordinates:["@@°°nÞôV@ƒ°@„¦WŽ„nÛ¤Vbmn™ğb@êš`VxUX@xš„ƏÞUnn˜WÞĸĢƒšÈ@ŽÇè@zÛÜWšÅêlš²„˜KnV¯ĖĊx@bk@@„°JÆ£Èbl„nnm°nlUkVUUwVm„Kn„‚nVŽÞxVLX¥laX@@xl@VzȎVmšk@b°šÈĸmŽV¦`W„XšƒbUb‚bX¼°x@ašVVkn@lþnXUlVxŤÅ„y‚IUƒka‚IŎĊ@lXx@b„z@‚ô„ƒ¥„_V@l‚n@„ôy@al_l`nmƒÈ»@kƒmXwWK™U¯»™a™Å@wƒmUÝKUa™UUƒ™wWƒ@w²»@kƃV£—mm£VKkÑV@@»nwƒ¥™ƒ@kƙnllIVlnLVakalknJšWmnaUaVÑVVލn¥m@ƒ„¯Uÿl™@™™™VçƒaXaV¯UyVLVkš@nJlšXLlŽkxlbla²Òl@nVJVkšx„KlkUaVķÝÑU@Åm¯@±™Uó°ğńķĠmU™Ñ@ǯ¯Å¼@nml@°¯¯`@w™£@¯Çƒk@ƒ»nmċ¯U»™I™Ž¯LÇĶÛn@bó°™U›šwmŽ¯„™Umǯa„™ƒ™ƒI@ykIƒVUŽ¯bƒIğŽƒ¼™¼ó¤mwkLÝÞ"],encodeOffsets:[[104243,23429]]}},{type:"Feature",id:"5326",properties:{name:"文山壮族苗族自治州",cp:[104.8865,23.5712],childNum:8},geometry:{type:"Polygon",coordinates:["@@šwô„š@²¯maUmôUÆxš@Xš˜bÞInlVUVw„JVaU„K°¥„xmÞXnlKlnna°@ĊČ„ÆwUmnkl@°ƒƒ£nyn@VV@Vak™ƒ@@kÞ݄bmx°Vnw°klÞInĖÞVlKl™@Xa°„„KlV„U@šJnx‚U@ÈĢbUKlm@ak_‚wšanWUk°ƒl»„k@Wk@lwU_ƒ@UalóU¥ƒÇnƒ™kJWƒ@mVXx±bƒK@nV±a@™Åa™£ÝK²ƒWknamKknǏk¯ƒaV™™V¯ĀƒU™„™Ò¥ƒI@mm¯¯xōW@@`k@ó»ƒUU¯lm£ÅWlĵ„w@mmwÅmWU@y±U—xmwU„¯Uƒ¥Ý¥¯£m@kŽÇVUV°VbklƒL™wUlUIm‚k@±ÑkbkalwkWKk™mI™@UlUKVzU°Wb„bU蚚@škšVĀƒ°@„n‚m¦ÝŽUUUÒVbmbXn™‚mIkllbUbmKUkkJmkŚ@lš„„¦mx@¼U@lÒULn¤˜nU¤Å„@l±¼@xX„šxV„šVVbÞLVŽ„n@xšÆšb°¼šV"],encodeOffsets:[[106504,25037]]}},{type:"Feature",id:"5303",properties:{name:"曲靖市",cp:[103.9417,25.7025],childNum:9},geometry:{type:"Polygon",coordinates:["@@ȦlKÞĕUV¯Um¯„ÇVUnVVUƒĉn™ĊÇƾLn°°È„JÆw„@lbÞa„¦V„XJ°¯W¯„aÞJVkUša„ƒ@lKnÅmWUk¯a¯»@m±@уkkbWWX_WÓU»_l™kÑm@U»m@l@IWċn¯l@VanV„UV™UVwVx„KȄVmUē‚@„ƒn@VÝÆL„w„VVwnVlmkUVÑÇ°ka@k™ÿÝaÞUl£™›—ċĕX±±ĉƒa@UnVnalónk@wl™UVmkÝJ—aW™™@ÅwóVVnnb±°™@óƒ™xXLWx„n@lǼn„m‚k_k`@bózƒ‚m@kU@ƒ`„¦óƒ@nWš@ÜÅXWw@ƒyƒb¦@ÒlnUb@x™lܐk‚@²Ç@Uƒ¯bmy@kV@bƒb„¦U`lLVx@b—Ll¼Þ¤@„°VVބU@WސUb›J@nnš@lnnm„šxUŽƒUUbƒK@šÇwklkUƒVWakn@ŽlbU@@„ULVxkKUn‚°¯Ò@¼™„kmƒ¦m@kl™Ȱ@lU„l¦„@Vl°wšnnþĊUÆbUx™b„ŽV„šĖU°„a‚nnašV„al@@b"],encodeOffsets:[[106099,27653]]}},{type:"Feature",id:"5323",properties:{name:"楚雄彝族自治州",cp:[101.6016,25.3619],childNum:10},geometry:{type:"Polygon",coordinates:["@@mҁXU`Wnšš™@Xl±¦š„Uxnbl°knmKUx„„ƒxVôUx°¼ôÒȄ°JlnÞKĠœW°¦ƒ„Vx²JVwš_°¥@UV@@wnymknK¯I@‚™²b°ƒš£V¥šwU‚V„¤nLškÆJÈwôô°„l»Č¯ƒġVƒUU@@ƒ°ƒƒÝXl@U»°Å„@U„¯@w±¯VmUUlm@m™„ÑnIVyUwmak£Vwm±—@Çw@nƒ@UxkwlÇnL‚mkř@±Žk™ka@kóJV¯Ç»U£lw¯™Xalbl¥¯UXƒ@a˜™UaÈL@ÇVIVƒkaU¯mm™akLWkUJ¯Umxnšƒ@ƒkUx¯xƒ„mWÅīÝkkbƒŤƒbkxWmXwWk¯wƒKkƒƒLŤċń„@¤óĬU²ƒ@@lƒk¯VmU¯¼@xV@k°l°kbUš°nm‚VnUš@°„š„UVèރÆbUÒÞnU¦›V—¼lô„@Vl"],encodeOffsets:[[103433,26196]]}},{type:"Feature",id:"5329",properties:{name:"大理白族自治州",cp:[99.9536,25.6805],childNum:12},geometry:{type:"Polygon",coordinates:["@@lbœKVIUa˜@²m@b™xôÒÜxXLmbnšl@š„„K°šš¼k„Uô‚xôlV¦nJ„Uš™Ænšm„@šx„ÆwšbXšÆôô„LUVwôK@wlmšaVwœ@WknmƒIUmlnJla@_™@kÝmKUašÑm¯Xw°aUaVl»²JV„bÆJkôĶĀ²VVk„mšbVwUó„wƒƒVwnLlmk¯maVw™ƒ²¥Wkš@™™XmV_‚WnÑUkƒ@k󘻜UV¥ÝmVÑÅa݄UçƒVƒ™@¯V™Umn¯mV™lak¯l¯U@@wğŽW鯁ƒ@¯xÝw¯š¯Jċa¯U¥mLU¤„bÞȤƒbÇLWUwmIUVW¼kbš`U„Vb¯L±ĊÛkƒÿÝKkwƒKţê™UĉþƒÈƒV¯ÞVbUŽ°KVšk²Ý‚mI—ƒmV@kƒm™UkšVxm„¯KXÈķJU¦V°ULWxšL@môƒšb@bkx±LnVUŽVLnkÜWnwlLŃmW@kkJU_ƒV„šWĊ„Þ"],encodeOffsets:[[101408,26770]]}},{type:"Feature",id:"5309",properties:{name:"临沧市",cp:[99.613,24.0546],childNum:8},geometry:{type:"Polygon",coordinates:["@@‚xĢ„l`²X°ŽV„šx@x°Þ°KXašğUњW‚bnIl`X²°b„xl°„„šV@xVxk¦mb„l@xšXV‚ÆzX¤™Æ˜k°„kx@lźêlaX»VUnJVx‚XÈK„aÝȣƒaV£nKV¦°‚Čb°I°™n»ÆÑV¯nWn›™@ÿXÅWWn¹ƒġōƒn»‚ÛU™™aU™VƒUw„w@w°ƒó¥ƒ@ƒz—ƒ±@ř›¯@kUwlk£±aĵŽ¯™›Uĵ¦±±@bó±VÝ@ó¤ƒw¯I@mńóm±XŽ¯IólƒK@š°Ullb™zkKlln@@ԙºƒUmVk²ôҙx™ŎUVóLƒb„ŽmÈnŽmbnl‚a„x@z„@Ǝ„¦kš"],encodeOffsets:[[101251,24734]]}},{type:"Feature",id:"5334",properties:{name:"迪庆藏族自治州",cp:[99.4592,27.9327],childNum:3},geometry:{type:"Polygon",coordinates:["@@W™Xwƒ™@akk@y›—k°īX¥›Uóķ¯w@n»UaVaUۃ¯ƒmV¼k‚™Þċô@n¯xÛÒm„V‚¯Ô@xƒ‚@šk™wm™Åa@ƒUa‚݁¯VŃyV„a@ÿšn»ÝVmank™mmÞÅôƒ@n£±›ğzÇmU¦™Vm„nÜmbn@°nV@xmzÅ@mºV¦k°ln¤š¼õô„n@xkƃIUxUš@Ťƒ¦VšmVkmkXW¤XzVx@ƚx™¼ƒÞ¯b@lVš™ĸގV„m¼XŽm¦V„ŽÞ@Ǝš¹Vón¥ÆKn„‚KX¯x@èĊȱłXšaÆxnlV@UÛlȻkğV¥„m²ljmÅÞĕƒƛm°„ÆmX¤mznƃŽV¦ÞVVb°bnÞWbnŽ°l@V„È@„‚VĵĊ±@ó„InxÆw„¥@£Þ›W¯ĸ£UƒUK‚ƒk±akkkbmWmÈķ„aÆÇU—ȃÆW@wmknmU¯"],encodeOffsets:[[102702,28401]]}},{type:"Feature",id:"5306",properties:{name:"昭通市",cp:[104.0955,27.6031],childNum:11},geometry:{type:"Polygon",coordinates:["@@mƒnK@wmƒUř¥mšóXǓŏmX@Ž—VƒmL@xţ™nk@mlUšŻÒğŋ@ƒL@mmLkm™š@b™XŎW¼ka¯lÇŹ¯aÇ»™ÝÝ_@m„@@a™@UklwUm@ak@ƒb™UmbmƒbV¯™ĕUƒƒšaVwÅaĉVmý™m¯xUkƒ@k¥VƒUXƒ¤VÈm`@„—ńÇÜ@Ākn‚ĔkƞÆĠ„™Þš‚U„VôƆÞI@ŽUxƦn„l@ĊĊnxUÒ°¦Vb¯WUnWŽIml@xn„Ubô¤‚¼ÈxlI„»šKVš„@ÈԂJkšUĖ±ÆVb@nœ„VÜVUVƒšL„wĠl„kn„Ġ@nx°¥Æ„²mUwƒ@m™mÅUl¯UњÑUm„Lll„Il±š@VkwƒW@w°@U»™kUóI°ƒ„»ĢтL„™š`nUĠ²lm„bôV@n„JUxƦX¦l@š‚ŎUƒV„@lV„KVřV£UaÞU™ƒnW@¯VU@ó™"],encodeOffsets:[[107787,28244]]}},{type:"Feature",id:"5301",properties:{name:"昆明市",cp:[102.9199,25.4663],childNum:11},geometry:{type:"Polygon",coordinates:["@@n@Vk‚VUn²°@xƒ°Vƒ@¯ÆV¼k@WŽ„Þ¯„@„@‚VVU„„Ģċ°k¼V„Ċxœ¤Ōœx°mVkƒÑȏšL‚°„x°Xœ°VmĊLVxUĖ°bX¦VW@kšȯlkn@„¥lnšƒ@»°Ñ¯VmlLUwVK@ƒV@ka@lmXb„UlVlkÈx@™„LVa„VV™wnƒmm@km™@mœIVaݏ@XƒVUݯU@ƒÝ£k»˜K@aUwkKV_ƒ¥„a@alU@nz°aV„È@@±lÛšk@wVakm@т¥„a„z‚@XxÆW@ÛX™@m@ƒy@aWw@kōĉJlbV„JƒzţÆUwVkmWkým@Ul™U@b¯wVºƒU™VUêšĠƒXUaUbVĊUŽWXUmkK™™WnUUU™V™ƒƒVV™Ý@kk±‚™¯ƒƒLkƒš±WkXlVklƒ@ƒwXbmLƒ›VUIVmk@Ubma@kkaVKUƒ™kmlXLWn™J¯ÒĊ°@zkºlLUŤn@@n›ô@lƁnmKkÈlxVw„@@mÈx˜@n²Uxl¤nbVxUzmJƒÒnš"],encodeOffsets:[[104828,25999]]}},{type:"Feature",id:"5307",properties:{name:"丽江市",cp:[100.448,26.955],childNum:5},geometry:{type:"Polygon",coordinates:["@@l@™„@w°ÓUnƒÜÑ°w@mČóšÝlU»n°„„VÜUbVbm¼@Ž°xôĸœVW¦¯Ĭlœ˜@zll@b„šWxXš‚a„X@ÆĠÆaXwl@XaƦn¼˜Jn@mnKW¯È»V¯°ak™VanXVwl@VyUĕVU„bÈīlaUk°ƒk¯lƒ²V˜Ukƛô@ƒ„I@mVwĊa„™ƒVaka„™ÆbUŽVLšaXIWKUw™ƒ„aWÑÅKUaVk°ƒ@Uw„ƒ¯¥›XğÝLkm¯Iǃóѯ»™aƒnUl±UĵÿlóÅIƒaU‚±Ik¼UŽVb¯bWxn°™ÒVbnLlޚ@@`kbmIkŽVn„JmnXl›@Ux™bkn@xóLUxVŽƒKóóŐW™™aÅxƒŽ™wƒ@™nÅm™šƒV™„ƒôX„ƒLlVU¤ƒb¦m¼™Ž@ĀƒbU‚„zUƂ°ÞVb@„Æbnššx"],encodeOffsets:[[101937,28227]]}},{type:"Feature",id:"5328",properties:{name:"西双版纳傣族自治州",cp:[100.8984,21.8628],childNum:3},geometry:{type:"Polygon",coordinates:["@@l²°ŽnÒlxÞ@„nWl„Lĸ™nbV¤V¦kbVV‚¦na„x°Vôa@„šb@lôXlWUšVXČKlmššU@bšWXXܛ°LÈa°LnU°‚ÞnšÑ„ġ°lƒnbšaƒ¯¯KWƒœó@kmK@UšĉV@k°„VV¹„a@y‚_ċl_nÓlL@anI@ƒóWl£VU—ƒl™kĕl™šKVw„U@™kVƒam¯ÅL@bƒ‚Ýk@Vn„UbÇbÝwÅ@ċ¥¯lk‚¼ÅŽ™Ò°b@¦nlUn@ŽÇV„mƁbWôU@ÝÅōm™¯ƒaU™™mk™WWw—@±ƒ™n¯U™è™a™Lƒ¯mƒL™škwƒl@°mnÈÒ¯šów@V™xƒĀU¤°Įƒ°Xl"],encodeOffsets:[[102376,22579]]}},{type:"Feature",id:"5305",properties:{name:"保山市",cp:[99.0637,24.9884],childNum:5},geometry:{type:"Polygon",coordinates:["@@X°„Il‚@¦ƒŽÈ¼m¼ÞaÞÅl„ÈxV¼šlVôÈÆlLޣȺlkUƒ‚ƒUw„¯UĕVwĊ@n¦mlnVĸIWÇ°LnƒUwl™šV„n@lnU˜„nJށl±U™¯LVUa°Ý„U„ÇĊýšVŤé„LlxÞL„ĀÜl²ĉ°KUaVƒ™_Źé@klw¯ƒlÅ—šW£ÅyU™W@wƒknal¥Uw@w™Uƒƒk¯ƒw¯aW±k_mJa™XVҙĠWb¯L¯Ý@w™wUƒ¯±Wk_ġƒwƒwōKmb@¤„bk°lĖƒô„UJƒšVnÅlťUš¯°VbnbWxX„m„ÞššWUĀ™L™yWzÛKmbUxVKkn݃kŽVšĀċ¤Ux„@Ž¯Žm@ƒ¦"],encodeOffsets:[[100440,25943]]}},{type:"Feature",id:"5304",properties:{name:"玉溪市",cp:[101.9312,23.8898],childNum:9},geometry:{type:"Polygon",coordinates:["@@l„„L°xXlWxXnlw„a„ţlaÞlÆĬnX„ƒ°wVw„l„@m™nw°VVIXllKšbnnV°lbU„UJ@ÈÇKVb—š@bW„°Vk¦kaWb°škxV¤È¼U°ôI@llblš²š@‚@œó@mm@VţkKl¹@yĉ¯°ÑšIXmWKnkšlV„ULlb@lnbVal@UnVJœU‚„nKWa„x„@lkkUlW²X„™‚l„K°„šl²@lšÞUŽ„U‚„UšVšVVXmššlLVnXWVUĉVaVb„W™ğVéšU„VU¹W»aVa„aW™Xƒ‚_U¥nÇķ¯™@a™lUnǍUyk@@wW@kbW¦UKÝwUmmƒƒLUnVxUVVlk¯mmnƒmkÇaŤ¯I@ƒl@@aĉw°ĕmU—L±ƒk™ÆéX™ÜÛ@yÈç@™Çġ„Ýķ—XmmÝVՙƒ™lmnkbmWkb@nl@nŽmš¯VxkJmUJ„ml¯™°makVVnVƒ¦™Wƒ—Wmnl@xmn„l‚I„¤„n™xU„ƒVUŽmX@˜ƒb@zl@¦Ýþ"],encodeOffsets:[[103703,24874]]}},{type:"Feature",id:"5333",properties:{name:"怒江傈僳族自治州",cp:[99.1516,26.5594],childNum:4},geometry:{type:"Polygon",coordinates:["@@WyX£lWlnnUU™„¥@ţV™Vw„JlÅ@wƒmö󙻂£kml¯U¥n¹Æ@ny@wmU@¯mnamÛnƒšUV¥ÈnĠy²œm¤„@ÆónݚnmlnbÞU‚¥„aV£kU„KWƒ„óšƒmIU¥ókwVólƒ™»¯™ƒL™ƒk@m™naWKÛwóњw@a±n—@VbUJ›LkaƒÝXĉƒ™„UV`lI@lnXÆƑkKmxÛXmlUKVmU²Klw@a™aó„@n™KXwVKU¯V¥mUnkm¥ĉ@UxVĖƒ°Vx„V„klmޙkKWĀkVWšnl°Lnm@°ŽUxlV@nk¦™JVÈ°ŽVÒ@nX°@ÆlUômlnôƒ²nxmłnVV„¯x@Èm°XblVUšl°@xkXU¤WXX‚W„Xƃ„mkÅJmށw±bƒxUīkKmÅVUĖÝèV„kx@š›lX„lnk¤ƒLkŽ‚Ėk¦‚xUššL°‚¯Ė@LnK@b°xVI„¥Ua°Ñ@»nm@¹‚KŎÞÈWln²n"],encodeOffsets:[[101071,28891]]}},{type:"Feature",id:"5331",properties:{name:"德宏傣族景颇族自治州",cp:[98.1299,24.5874],childNum:5},geometry:{type:"Polygon",coordinates:["@@„¥n@°@ƒVwČ£™ÿUlÞ„lmULVwnaÜLXyšzšKVÿ™XݙnƒWƒXwmaUa°¯V™ŦŽÆkUm„™VIƒ„ókĕl¯ƒa@£nama™@¯m¯œó@óyţbġkÅm±ÛammVkƒLwU`Wk@VƒkUmŃlUUKmbkkUVUwƒ¦óŽ°¼šbn°ô¦lºƒz@xšŽ¯„™@UŽ°nƒšU¤ţU„°VƆ@ÈmlnzÞl°¦Æa„xUxƒLkxWƒn@‚š²ŰšW„™‚@°ÈXl°Llx"],encodeOffsets:[[100440,25943]]}}],UTF8Encoding:!0}}),define("echarts/util/mapData/geoJson/zhe_jiang_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3311",properties:{name:"丽水市",cp:[119.5642,28.1854],childNum:9},geometry:{type:"Polygon",coordinates:["@@@V‚bVl@Xn‚UXƒKVŽ@¦nxlUXV‚n„KVmnL‚UV@bn¤lLXK˜²„`nnlJXIVJ‚I„Vnn°KnnVll@VLXWV@UkVaVK„zV@„ƒšVVaUK@U»VUl@@WnUUƒ@wVLn@Vwl@XW°LVbn@VU‚@X„l`@XnKVbkl@XVJlUnlV„„xlL@lnXl„@VšUnV°°„@a„UVLXblWVXn@VVUV@Lš¤VLV„U‚VbnalLUUVX_laVa„WVzXKV@@a@KUmImmXama@kU@yVIUK‚aVa@kXK@aWU@VIUmW@kkVm„Uš@VwUa@K@k@Uƒ`@kUKVk@UV@VaUm²Vy@klUUWUkVmUa@_ƒKVaXa›XmƒU@mUlWkaUXƒ@mmkL@w™JƒnVVÅbWKXa™@@I@aƒJUUÇ@V„UL™W@akLmb@K@a™XXw@mƒVmUVkUy@£@aU@@VkUWm@kUKƒXUWU_mW@wkkmJUUkLWWUXƒW@IkJ@k@mW_kӃ_Ul™Lƒm@I@aUa¯m@kƒa¯LUJƒ@mVVxUb™a@LUKkXƒbm@Uak@@a@Um`ƒIUbUJ@nUVW@@LnVV@lšUbVlUX@`š@blXklW„Ušm„Xlm¦U@@V¯bml@š@nUb@llnn@VbX@lV@ŽUVULmU@JVn„bVbkb™VWxU@@nUVk@"],encodeOffsets:[[121546,28992]]}},{type:"Feature",id:"3301",properties:{name:"杭州市",cp:[119.5313,29.8773],childNum:6},geometry:{type:"Polygon",coordinates:["@@X@l„°KXXlW„b@²„`šššb‚I„šX`l@„@bWl@n@VnLUV@V„@°¦@šl@XVlU@š@xVbUb@Vkb@‚@XVJVz™J@Lޚ@VmLUxUJ@LU„Vx‚b„xXUl@VaÈw„b‚aÞa@Vl@XUVx@V@V„LlbnV„al@lb„Vnn‚LnKnL@VlbVJXalIšb@KUU@mVInJ˜„U„Vl@xUšVLnUš@UÞaV@lkV@UanK„L@UlKVUnbÆmn@@nUlVnVJl@@UXU„L@WVIVJVxVLXV@IÜKnbn@V¥V@@I@ƒƒ„y°b@UUwnk°ÆƨVlUšçXm›£aƒÇ™IkVƒ@WV@@aWIUWUIkb@WW@UnƒK@UU@kaWVkƒVIVVnU@UWVUV@VmVkKkWIkVWaULU`UImJUImm—U@ƒƒwmwUV™IUWVkUamaU@mV—kƒb@KVU@aVU@anKULVJ‚U@kÛU™JUV›kkƒVakU@ƒaVwkW@UWkXmWaULUaUK@XƒJUUmƒVU@UVƒUkJ@ImwmKU@k„@lU„W@@akKm„kamIkWl_UwVm@UkaVUUaƒ@UamakbWlkL@aUalU@mkL@U@U™lmK@XkKm@Ýakb@xƒnXbƒ`ƒnUUU@›™U@™wU@@ƒmKkkƒV¯U@lULUbVbUb@V‚a@L™ºÝb@bLmK™x@VUL@bk@mxULWl"],encodeOffsets:[[121185,30184]]}},{type:"Feature",id:"3303",properties:{name:"温州市",cp:[120.498,27.8119],childNum:9},geometry:{type:"Polygon",coordinates:["@@ll@xnXV`VX„WVL@lXnlV@UV@@b@¤VzUlnV„U@nWxšW@b@LnalK@bšXVKUƒÈ@VV„I@b@Jš@WbXLÆaUU„mšI@xlKnn„@VWlbkXV‚@n„VWnœ‚WbUb„L@`VbUnVlVXkV@lUz±‚VnUbU@@VUlVL@l„_@V@l@LVbV@XLV`VÈlxn@lU@aœaVV‚k„@XJ@nl@@LU`°LVb„L°a@a„UVy@anI@a„a‚nV@²wÜJX@VšVV°k„na@WVk„aWwU@m@™ƒkƒaUĕ™ÝšÝŤnÈa„aóI›»@±X™WkUķ@kV±kw™ƒUkWw„™UƒÝ»ÛkɳlImaUaWóXÿǬk‚UnWVmmk™KţnŏÞğl™„UlUx@XWb„V@JkXƒ°mb@VULVxUVk@@LWWk@WIkšƒUkJmUkVmI@yƒ@Ua™kLm‚U@mUUUkaVk™@mK@UlUU@UmKmbUUUJ@n@KVLUL@VkJWXX`mnULWlkL@JVLVb@°kxkU@LVŽ™V@„VLV`UL@VUX"],encodeOffsets:[[122502,28334]]}},{type:"Feature",id:"3302",properties:{name:"宁波市",cp:[121.5967,29.6466],childNum:6},geometry:{type:"Polygon",coordinates:["@@Ċ¦ĸĀ°‚nXÞVšKškƨƑźÿ°»n„@wô¥ÜbœU°ÆXÞWóçĉݱIUƒÈ¥@U°wÆ»²mm_@aXƒVKÞVlk@akk›̅@£X»VwƏXWa¯aȗb™KƽۃĊ™xƒLóŽk@ƒƒƒ@¯nƒKUL@xkL›ÑkWULUUmJUXVŽU@mŽUX¯@V`mbXbV@@nn¤WXšx@škJ@nVVUVl²UbÝVUVk@Wx@V@„ƒVXzmlaƒL@VlLU`„XUVVVUnl@VbnJlnUVVnƒlUKkbmnn„VxlJnxmbU@UL@KUV™X@xmb@lk@mnVVUš™è"],encodeOffsets:[[123784,30977]]}},{type:"Feature",id:"3309",properties:{name:"舟山市",cp:[122.2559,30.2234],childNum:3},geometry:{type:"Polygon",coordinates:["@@l΢ƒʠþÆVĢLĊƒǬXĊ܄XôV„ÑÆw„ƒlšƏÈóVĭVǓ@ƒĉwɛkmK@ĉXīWaĉUĵÝmƒ¯ĉƒwĉ±±nż¯x@VǦV„²JĊÞôèÝXÅW¯›VÛaó¦@xƒŽmŽ¯¼ŹĀ"],encodeOffsets:[[124437,30983]]}},{type:"Feature",id:"3310",properties:{name:"台州市",cp:[121.1353,28.6688],childNum:7},geometry:{type:"Polygon",coordinates:["@@lV„IVWVz@bXJl@Xal@°„nLll@nVxnV„K@UJVbƒ¦°„k`UIWJXnƚ@bUJ„Xl@lb„Wn@UzVV@bVVšmVnnJVXna‚bšKUKnUVVUnVLlKVLXa„Jm£@mU@WanaU_°@VWnV@UVWnIVVVKlXœÒlK@wVK„L°m„@„„l@ô„Kšw„ĉƾůUƒl£@»UƒVk„m@ƅUƒƒaÛIŏmUk@m„w@a™£ƒWk@ţšƒIm±@ankôUlaU™Uw¯ƒōaƒbÇbţm™ÞšÞVĖ„b„l@š@n‚VXxƒbUl@XmbƒŽ¯lUUU™W@ÛI±xU@mƒb@bmJ@bUzƒV@b¯bƒKUa¯KV_@Kk@@mWIƒ@lUU›b@bkVm@kwUÇU_WKU@Ux™@ƒVUnllX@Vn‚J@UXV@bWL@lUbbVLUJ@z‚V@lnbWbnnnJVŽ@L"],encodeOffsets:[[123312,29526]]}},{type:"Feature",id:"3307",properties:{name:"金华市",cp:[120.0037,29.1028],childNum:8},geometry:{type:"Polygon",coordinates:["@@nbVb„@VbUVlb@VUnVxk`lXnJlbnƒlL@bX@Vƒ@klƒV@nLnx@JlI„V‚U@VUVn„VV„I@WVLVbVKXbWnXl@VlXUx„b@ŽlVUbl„œlVUšIÜVnalKX@@bV@@aUUlUƒwUw„@naWW„UVaUUšaVb„LlxXJVk°ƒUƒlkU¥@k„a@LVlXLVlšVWznVn@lxšJl_@WX_@mVa„a@alU@kVVna„KVLlK„b@UUaVašbnUWmXU@k@yVI@ařWmXIVJl_¯ƒ„¥UaVI@ƒLmUUw@mkkmK¯ƒk@Wbk@WI@aUyUXƒJkU@bU@WLUyƒXUbkbW`UVVkKmbUaVUƒUK™£@KVUUUm@UWkXWaUKƒV@b¯ƒ¯mU™V@UkƒmW@kkKƒwUƒmkkVUI@WlkUamL@Wk_Wƒ@UVm@Ua¯KWXk@Uxm@UK@xV„mV@Xk@UVV¼@‚VLUb™Uƒ„U@ƒyULUbVlU@@XlVUVVbƒU@lXXVW@XUVl@@VUVƒÈn@VVU„@lVa@„U„mL@`X@`WL@VUX@lUL@xlx"],encodeOffsets:[[122119,29948]]}},{type:"Feature",id:"3308",properties:{name:"衢州市",cp:[118.6853,28.8666],childNum:5},geometry:{type:"Polygon",coordinates:["@@XkVKnwl@@aVK@UšwnL‚K@aÞaš¹@Kb@UVaUaVaVK@k°V„UllnL@„V@šxV@œšV@VV„m„_Wa„m@wlaÞbn@lL@WnLšk@V@VlK@nkVVb@blKXklakw@wVK@kVW@UXK@_‚W@_nKVƒ@ƒUb@kVƒUUm@„ÇVU@Uk@VU@WUXWW@k„VUaVUkU@WWXUKk@Ukmm¯LmmƒUJUIWJkImmƒ_—±WLkKm£@aVUmKUnƒLmWUkVmw@¥U„LVWm@WUka@UmmLmm@@bUX™@@WUIm@UVUK@UVUUU™VVJmb@b„Xn‚mVƒ¼nnn¦mJUVƒL„V@VW@UzUlVnUbl`UnVl@XU@kl@bmÈUx™Vk@@J@„ƒ¼W@ÅaVVnzmVƒ„@WJk@kWJ@ƒlXbWbXxmVnšlLXb@°lKVXnWšbWV„„X„mbV@Xl‚bšI@Kn@@x@šVLlm"],encodeOffsets:[[121185,30184]]}},{type:"Feature",id:"3306",properties:{name:"绍兴市",cp:[120.564,29.7565],childNum:6},geometry:{type:"Polygon",coordinates:["@@„x@„˜VnnVJnIVJV_VKXblUXJlŽlLUŽUnU@UVVX@ŽmVUUUJl„XUlbV@@V„LVmX@@XlaVJVXXJ@b‚@XU„@lUšJ„È‚bœ¤Ō„JšçV™UUnml@@kna@wšWVU@LVKV@namwkIUwmƒnmlaVL„kUmVUkmmIUak@VmUUVUƒWV_kK@U„K‚bnkWy„U@ƒ@UXwl@VUÞUVak±VUUU@mlI@™™wXWƒIWbUKkLUKVmUUmVVL™LambUWmIUm™nUU@aUUVym@ƒXkak@ƒW@z@lWVXnmV™aUbVb@VƒakLUKƒLmbUU@lkV@bƒbUb@nW`@Xk`™Ikwm@mUXy™UUkWKUk@Kƒb@lV¦klV„¯„UlWIkwƒKUa™bVVUbƒVXXmbƒ@Vx„xkVVV@bU@@aW@kLmb@lVUIVKmL@bUV@bUV@L„a˜lnUV@nbVbUlVXšJVUnx"],encodeOffsets:[[122997,30561]]}},{type:"Feature",id:"3304",properties:{name:"嘉兴市",cp:[120.9155,30.6354],childNum:6},geometry:{type:"Polygon",coordinates:["@@@blIX@@VÜVUnn@l‚k„lKnI°Þl`²LVKVbnbVaVLUVn@W¦@VkVVb„@VI„`@blLnL‚aX@„VVb@U‚@XlVa„@@kVaUKV»U_lWXUƒƒ@alb„k@VllnLVKn@@UVIUw@y°IVVXU@VV@lw„m@wVkƾaœJ‚LkΡƧƒ™l™LÝUmW¯ķÿĉ¥ƒIŋŽWn™èkVƧU¯ÅmlVx@V¯aƒz„Ž@„@JU@U¦m@@šnVmn@V„LV‚"],encodeOffsets:[[123233,31382]]}},{type:"Feature",id:"3305",properties:{name:"湖州市",cp:[119.8608,30.7782],childNum:4},geometry:{type:"Polygon",coordinates:["@@kLlƒkm@VmÛU@UW@kJ@aUƒK@UnmmU@™maÛL@JWUUKUwUIUJ@XƒKWV@Vk@UIUmVk@mm@ÅnmaUVkL@VƒKmLVbU@klU@ÝbV™@mVUKV™@wUkVƒ—ƒmIUJ@nVV@L™akJWbUIka@UmKmLKmmƒUUVk@@nmLX`WXUV@Ž@nUl™kmlU@Ub„„ƒxVVšIlV„Žšnn„@@n˜„UҚ@„°n@@xmb@„VbnV@šš„@b@`@L@L@x@blVklVbnnV@‚aXb°VlU@W„b°U„LXWVUV™„™VwÈwÜ»ĸaĠnUVw²X@V@lVU@wlaUUVm@knUV›"],encodeOffsets:[[123379,31500]]}}],UTF8Encoding:!0}}),define("echarts/util/shape/HalfSmoothPolygon",["require","zrender/shape/Base","zrender/shape/util/smoothBezier","zrender/tool/util","zrender/shape/Polygon"],function(e){function i(e){t.call(this,e)}var t=e("zrender/shape/Base"),n=e("zrender/shape/util/smoothBezier"),r=e("zrender/tool/util");return i.prototype={type:"half-smooth-polygon",buildPath:function(t,r){var i=r.pointList;if(i.length<2)return;if(r.smooth){var s=n(i.slice(0,-2),r.smooth,!1,r.smoothConstraint);t.moveTo(i[0][0],i[0][1]);var o,u,a,f=i.length;for(var l=0;l0&&this._buildSinglePosition(f,t[f]);this.addShapeList()},_buildSinglePosition:function(e,t){var n=this._mapData(t),r=n.locationMap,i=n.maxDataLength;if(i===0||r.length===0)return;switch(e){case"bottom":case"top":this._buildHorizontal(t,i,r,this.xMarkMap);break;case"left":case"right":this._buildVertical(t,i,r,this.xMarkMap)}for(var s=0,o=t.length;s0&&(this.finalPLMap[s]=this.finalPLMap[s]||[],this.finalPLMap[s].push(g[s]),g[s]=[]);continue}b>=0?(p-=T>0?l.getCoordSize(b):d-l.getCoord(b),h=p):b<0&&(v+=T>0?l.getCoordSize(b):l.getCoord(b)-m,h=v),g[s].push([c,h,w,a.getNameByIndex(w),c,d]),r[s].min>b&&(r[s].min=b,r[s].minY=h,r[s].minX=c),r[s].max0&&(this.finalPLMap[k]=this.finalPLMap[k]||[],this.finalPLMap[k].push(g[k]),g[k]=[]);for(var S=0,x=n.length;S0&&(r[s].average=(r[s].sum/r[s].counter).toFixed(2)-0),h=this.component.yAxis.getAxis(i[s].yAxisIndex||0).getCoord(r[s].average),r[s].averageLine=[[this.component.grid.getX(),h],[this.component.grid.getXend(),h]],r[s].minLine=[[this.component.grid.getX(),r[s].minY],[this.component.grid.getXend(),r[s].minY]],r[s].maxLine=[[this.component.grid.getX(),r[s].maxY],[this.component.grid.getXend(),r[s].maxY]];this._buildBorkenLine(e,this.finalPLMap,a,"horizontal")},_buildVertical:function(e,t,n,r){var i=this.series,s=n[0][0],o=i[s],u=o.yAxisIndex,a=this.component.yAxis.getAxis(u),f,l,c,h,p,d,v,m,g={},y,b;for(var w=0,E=t;w0&&(this.finalPLMap[s]=this.finalPLMap[s]||[],this.finalPLMap[s].push(g[s]),g[s]=[]);continue}b>=0?(p+=T>0?l.getCoordSize(b):l.getCoord(b)-d,c=p):b<0&&(v-=T>0?l.getCoordSize(b):m-l.getCoord(b),c=v),g[s].push([c,h,w,a.getNameByIndex(w),d,h]),r[s].min>b&&(r[s].min=b,r[s].minX=c,r[s].minY=h),r[s].max0&&(this.finalPLMap[k]=this.finalPLMap[k]||[],this.finalPLMap[k].push(g[k]),g[k]=[]);for(var S=0,x=n.length;S0&&(r[s].average=(r[s].sum/r[s].counter).toFixed(2)-0),c=this.component.xAxis.getAxis(i[s].xAxisIndex||0).getCoord(r[s].average),r[s].averageLine=[[c,this.component.grid.getYend()],[c,this.component.grid.getY()]],r[s].minLine=[[r[s].minX,this.component.grid.getYend()],[r[s].minX,this.component.grid.getY()]],r[s].maxLine=[[r[s].maxX,this.component.grid.getYend()],[r[s].maxX,this.component.grid.getY()]];this._buildBorkenLine(e,this.finalPLMap,a,"vertical")},_buildBorkenLine:function(e,t,n,i){var o=this.series,l;for(var c=e.length-1;c>=0;c--){var h=e[c],p=o[h],d=t[h];if(p.type===this.type&&d!=null){var v=this._getBbox(h,i),m=this._sIndex2ColorMap[h],g=this.query(p,"itemStyle.normal.lineStyle.width"),y=this.query(p,"itemStyle.normal.lineStyle.type"),b=this.query(p,"itemStyle.normal.lineStyle.color"),w=this.getItemStyleColor(this.query(p,"itemStyle.normal.color"),h,-1),E=this.query(p,"itemStyle.normal.areaStyle")!=null,S=this.query(p,"itemStyle.normal.areaStyle.color");for(var x=0,T=d.length;x=0;r--){f=this.shapeList[r]._seriesIndex;if(n[f]&&!n[f][3]){if(this.shapeList[r]._main&&this.shapeList[r].style.pointList.length>1){l=this.shapeList[r].style.pointList,o=Math.abs(l[0][0]-l[1][0]),a=Math.abs(l[0][1]-l[1][1]),c=this.shapeList[r]._orient==="horizontal";if(n[f][2]){if(this.shapeList[r].type==="polygon"){var h=l.length;this.shapeList[r].style.pointList[h-3]=l[h-2],c?this.shapeList[r].style.pointList[h-3][0]=l[h-4][0]:this.shapeList[r].style.pointList[h-3][1]=l[h-4][1],this.shapeList[r].style.pointList[h-2]=l[h-1]}this.shapeList[r].style.pointList.pop(),c?(s=o,u=0):(s=0,u=-a)}else{this.shapeList[r].style.pointList.shift();if(this.shapeList[r].type==="polygon"){var p=this.shapeList[r].style.pointList.pop();c?p[0]=l[0][0]:p[1]=l[0][1],this.shapeList[r].style.pointList.push(p)}c?(s=-o,u=0):(s=0,u=a)}this.zr.modShape(this.shapeList[r].id,{style:{pointList:this.shapeList[r].style.pointList}},!0)}else{if(n[f][2]&&this.shapeList[r]._dataIndex===t[f].data.length-1){this.zr.delShape(this.shapeList[r].id);continue}if(!n[f][2]&&this.shapeList[r]._dataIndex===0){this.zr.delShape(this.shapeList[r].id);continue}}this.shapeList[r].position=[0,0],this.zr.animate(this.shapeList[r].id,"").when(500,{position:[s,u]}).start()}}}},i.prototype.iconLibrary.legendLineIcon=c,a.inherits(l,n),a.inherits(l,t),e("../chart").define("line",l),l}),define("echarts/chart/bar",["require","../component/base","./base","zrender/shape/Rectangle","../component/axis","../component/grid","../component/dataZoom","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../chart"],function(e){function a(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this),this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("zrender/shape/Rectangle");e("../component/axis"),e("../component/grid"),e("../component/dataZoom");var i=e("../config"),s=e("../util/ecData"),o=e("zrender/tool/util"),u=e("zrender/tool/color");return a.prototype={type:i.CHART_TYPE_BAR,_buildShape:function(){var e=this.series;this.selectedMap={},this.xMarkMap={},this._sIndex2colorMap={};var t={top:[],bottom:[],left:[],right:[]},n,r,s,o;for(var u=0,a=e.length;u0&&this._buildSinglePosition(f,t[f],this.xMarkMap);this.addShapeList()},_buildSinglePosition:function(e,t,n){var r=this._mapData(t),i=r.locationMap,s=r.maxDataLength;if(s===0||i.length===0)return;switch(e){case"bottom":case"top":this._buildHorizontal(s,i,t,n);break;case"left":case"right":this._buildVertical(s,i,t,n)}},_mapData:function(e){var t=this.series,n,r=0,i={},s="__kener__stack__",o,u,a=this.component.legend,f=[],l=0,c;for(var h=0,p=e.length;h0&&(c.style.x+=1,c.style.y+=1,c.style.width-=2,c.style.height-=2,c.style.strokeColor=c.highlightStyle.strokeColor=n.itemStyle.normal.barBorderColor,c.highlightStyle.lineWidth=3,c.style.brushType="both"),a.setItemShape(u,c))):(this.selectedMap[u]=!0,this._sIndex2colorMap[e[h]]=this.zr.getColor(e[h])),this.selectedMap[u]&&(o=n.stack||s+e[h],i[o]==null?(i[o]=r,f[r]=[e[h]],r++):f[i[o]].push(e[h])),l=Math.max(l,n.data.length);return{locationMap:f,maxDataLength:l}},_buildHorizontal:function(e,t,n,i){var s=this.series,o=t[0][0],u=s[o],a=u.xAxisIndex,f=this.component.xAxis.getAxis(a),l,c,h=this._mapSize(f,t),p=h.gap,d=h.barGap,v=h.barWidthMap,m=h.barWidth,g=h.barMinHeightMap,y,b=h.interval,w,E,S,x,T,N,C,k,L;for(var A=0,O=e;A0?(y=D>0?c.getCoordSize(L):x-c.getCoord(L),P===1&&g[o]>y&&(y=g[o]),S-=y,E=S):L<0?(y=D>0?c.getCoordSize(L):c.getCoord(L)-N,P===1&&g[o]>y&&(y=g[o]),E=T,T+=y):(y=0,S-=y,E=S),i[o][A]=w+(v[o]||m)/2,i[o].min>L&&(i[o].min=L,i[o].minY=E,i[o].minX=i[o][A]),i[o].max0&&(i[o].average=(i[o].sum/i[o].counter).toFixed(2)-0),E=this.component.yAxis.getAxis(s[o].yAxisIndex||0).getCoord(i[o].average),i[o].averageLine=[[this.component.grid.getX(),E],[this.component.grid.getXend(),E]],i[o].minLine=[[this.component.grid.getX(),i[o].minY],[this.component.grid.getXend(),i[o].minY]],i[o].maxLine=[[this.component.grid.getX(),i[o].maxY],[this.component.grid.getXend(),i[o].maxY]],i[o].isHorizontal=!0,this.buildMark(o)},_buildVertical:function(e,t,n,i){var s=this.series,o=t[0][0],u=s[o],a=u.yAxisIndex,f=this.component.yAxis.getAxis(a),l,c,h=this._mapSize(f,t),p=h.gap,d=h.barGap,v=h.barWidthMap,m=h.barWidth,g=h.barMinHeightMap,y,b=h.interval,w,E,S,x,T,N,C,k,L;for(var A=0,O=e;A0?(y=D>0?c.getCoordSize(L):c.getCoord(L)-x,P===1&&g[o]>y&&(y=g[o]),w=S,S+=y):L<0?(y=D>0?c.getCoordSize(L):N-c.getCoord(L),P===1&&g[o]>y&&(y=g[o]),T-=y,w=T):(y=0,w=S,S+=y),i[o][A]=E-(v[o]||m)/2,i[o].min>L&&(i[o].min=L,i[o].minX=w+y,i[o].minY=i[o][A]),i[o].max0&&(i[o].average=(i[o].sum/i[o].counter).toFixed(2)-0),w=this.component.xAxis.getAxis(s[o].xAxisIndex||0).getCoord(i[o].average),i[o].averageLine=[[w,this.component.grid.getYend()],[w,this.component.grid.getY()]],i[o].minLine=[[i[o].minX,this.component.grid.getYend()],[i[o].minX,this.component.grid.getY()]],i[o].maxLine=[[i[o].maxX,this.component.grid.getYend()],[i[o].maxX,this.component.grid.getY()]],i[o].isHorizontal=!1,this.buildMark(o)},_mapSize:function(e,t,n){var r=this.series,i,s={},o={},u,a=0,f=0,l,c,h,p,d=1;for(var v=0,m=t.length;v1?typeof c=="string"&&c.match(/%$/)?Math.floor(e.getGap()*(100-parseFloat(c))/100):e.getGap()-c:f,x=0,l=a>1?Math.floor((S-f)/(a-1)):0;if(l<0)return this._mapSize(e,t,!0)}return{barWidthMap:s,barMinHeightMap:o,gap:S,barWidth:x,barGap:l,interval:d}},_getBarItem:function(e,t,n,r,i,o,a,f){var l=this.series,c,h=l[e],p=h.data[t],d=this._sIndex2colorMap[e],v=[p,h],m=this.deepQuery(v,"itemStyle.normal.color")||d,g=this.deepQuery(v,"itemStyle.emphasis.color"),y=this.deepMerge(v,"itemStyle.normal"),b=y.barBorderWidth,w=this.deepMerge(v,"itemStyle.emphasis");c={zlevel:this._zlevelBase,clickable:this.deepQuery(v,"clickable"),style:{x:r,y:i,width:o,height:a,brushType:"both",color:this.getItemStyleColor(m,e,t,p),radius:y.barBorderRadius,lineWidth:b,strokeColor:y.barBorderColor},highlightStyle:{color:this.getItemStyleColor(g,e,t,p),radius:w.barBorderRadius,lineWidth:w.barBorderWidth,strokeColor:w.barBorderColor},_orient:f},c.highlightStyle.color=c.highlightStyle.color||(typeof c.style.color=="string"?u.lift(c.style.color,-0.3):c.style.color),b>0&&c.style.height>b&&c.style.width>b?(c.style.y+=b/2,c.style.height-=b,c.style.x+=b/2,c.style.width-=b):c.style.brushType="fill",c.highlightStyle.textColor=c.highlightStyle.color,c=this.addLabel(c,h,p,n,f);if(c.style.textPosition==="insideLeft"||c.style.textPosition==="insideRight"||c.style.textPosition==="insideTop"||c.style.textPosition==="insideBottom"){var E=5;switch(c.style.textPosition){case"insideLeft":c.style.textX=c.style.x+E,c.style.textY=c.style.y+c.style.height/2,c.style.textAlign="left",c.style.textBaseline="middle";break;case"insideRight":c.style.textX=c.style.x+c.style.width-E,c.style.textY=c.style.y+c.style.height/2,c.style.textAlign="right",c.style.textBaseline="middle";break;case"insideTop":c.style.textX=c.style.x+c.style.width/2,c.style.textY=c.style.y+E/2,c.style.textAlign="center",c.style.textBaseline="top";break;case"insideBottom":c.style.textX=c.style.x+c.style.width/2,c.style.textY=c.style.y+c.style.height-E/2,c.style.textAlign="center",c.style.textBaseline="bottom"}c.style.textPosition="specific",c.style.textColor=c.style.textColor||"#fff"}return this.deepQuery([p,h,this.option],"calculable")&&(this.setCalculable(c),c.draggable=!0),s.pack(c,l[e],e,l[e].data[t],t,n),c},getMarkCoord:function(e,t){var n=this.series[e],r=this.xMarkMap[e],i=this.component.xAxis.getAxis(n.xAxisIndex),s=this.component.yAxis.getAxis(n.yAxisIndex),o,u;if(!t.type||t.type!=="max"&&t.type!=="min"&&t.type!=="average")if(r.isHorizontal){o=typeof t.xAxis=="string"&&i.getIndexByName?i.getIndexByName(t.xAxis):t.xAxis||0;var a=r[o];a=a!=null?a:typeof t.xAxis!="string"&&i.getCoordByIndex?i.getCoordByIndex(t.xAxis||0):i.getCoord(t.xAxis||0),u=[a,s.getCoord(t.yAxis||0)]}else{o=typeof t.yAxis=="string"&&s.getIndexByName?s.getIndexByName(t.yAxis):t.yAxis||0;var f=r[o];f=f!=null?f:typeof t.yAxis!="string"&&s.getCoordByIndex?s.getCoordByIndex(t.yAxis||0):s.getCoord(t.yAxis||0),u=[i.getCoord(t.xAxis||0),f]}else u=[r[t.type+"X"],r[t.type+"Y"],r[t.type+"Line"],r[t.type]];return u},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},addDataAnimation:function(e){var t=this.series,n={};for(var r=0,i=e.length;r=0;r--){c=s.get(this.shapeList[r],"seriesIndex");if(n[c]&&!n[c][3]&&this.shapeList[r].type==="rectangle"){h=s.get(this.shapeList[r],"dataIndex"),l=t[c];if(n[c][2]&&h===l.data.length-1){this.zr.delShape(this.shapeList[r].id);continue}if(!n[c][2]&&h===0){this.zr.delShape(this.shapeList[r].id);continue}this.shapeList[r]._orient==="horizontal"?(f=this.component.yAxis.getAxis(l.yAxisIndex||0).getGap(),a=n[c][2]?-f:f,o=0):(u=this.component.xAxis.getAxis(l.xAxisIndex||0).getGap(),o=n[c][2]?u:-u,a=0),this.shapeList[r].position=[0,0],this.zr.animate(this.shapeList[r].id,"").when(500,{position:[o,a]}).start()}}}},o.inherits(a,n),o.inherits(a,t),e("../chart").define("bar",a),a}),define("echarts/chart/pie",["require","../component/base","./base","zrender/shape/Text","zrender/shape/Ring","zrender/shape/Circle","zrender/shape/Sector","zrender/shape/BrokenLine","../config","../util/ecData","zrender/tool/util","zrender/tool/math","zrender/tool/color","../chart"],function(e){function p(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this);var u=this;u.shapeHandler.onmouseover=function(e){var t=e.target,n=f.get(t,"seriesIndex"),r=f.get(t,"dataIndex"),i=f.get(t,"special"),s=t._lastAddRadius,o=t.style.startAngle,a=t.style.endAngle,l=t.highlightStyle.color,c=u.getLabel(n,r,i,s,o,a,l,!0);c&&u.zr.addHoverShape(c);var h=u.getLabelLine(n,r,s,t.style.r0,t.style.r,o,a,l,!0);h&&u.zr.addHoverShape(h)},this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("zrender/shape/Text"),i=e("zrender/shape/Ring"),s=e("zrender/shape/Circle"),o=e("zrender/shape/Sector"),u=e("zrender/shape/BrokenLine"),a=e("../config"),f=e("../util/ecData"),l=e("zrender/tool/util"),c=e("zrender/tool/math"),h=e("zrender/tool/color");return p.prototype={type:a.CHART_TYPE_PIE,_buildShape:function(){var e=this.series,t=this.component.legend;this.selectedMap={},this._selected={};var n,r,o;this._selectedMode=!1;var u;for(var l=0,c=e.length;l0&&Math.abs(m-g)<15&&p<4&&this._needLabel(n,r[l],!1)&&this.deepQuery([r[l],n],"itemStyle.normal.label.position")!="center"?d+=h<4?20:-20:d=0,this._buildItem(e,l,h,d,r[l].selected,x,T,m,g,w),v||(m=g)}},_buildItem:function(e,t,n,r,i,s,o,u,a,l){var c=this.series,h=this.getSector(e,t,n,i,s,o,u,a,l);f.pack(h,c[e],e,c[e].data[t],t,c[e].data[t].name,n),h._lastAddRadius=r,this.shapeList.push(h);var p=this.getLabel(e,t,n,r,u,a,l,!1);p&&(f.pack(p,c[e],e,c[e].data[t],t,c[e].data[t].name,n),p._dataIndex=t,this.shapeList.push(p));var d=this.getLabelLine(e,t,r,s,o,u,a,l,!1);d&&(f.pack(d,c[e],e,c[e].data[t],t,c[e].data[t].name,n),d._dataIndex=t,this.shapeList.push(d))},getSector:function(e,t,n,r,i,s,u,a,f){var l=this.series,p=l[e],d=p.data[t],v=[d,p],m=this.parseCenter(this.zr,p.center),g=this.deepMerge(v,"itemStyle.normal")||{},y=this.deepMerge(v,"itemStyle.emphasis")||{},b=this.getItemStyleColor(g.color,e,t,d)||f,w=this.getItemStyleColor(y.color,e,t,d)||(typeof b=="string"?h.lift(b,-0.2):b),E={zlevel:this._zlevelBase,clickable:this.deepQuery(v,"clickable"),style:{x:m[0],y:m[1],r0:i,r:s,startAngle:u,endAngle:a,brushType:"both",color:b,lineWidth:g.borderWidth,strokeColor:g.borderColor,lineJoin:"round"},highlightStyle:{color:w,lineWidth:y.borderWidth,strokeColor:y.borderColor,lineJoin:"round"},_seriesIndex:e,_dataIndex:t};if(r){var S=((E.style.startAngle+E.style.endAngle)/2).toFixed(2)-0;E.style._hasSelected=!0,E.style._x=E.style.x,E.style._y=E.style.y;var x=this.query(p,"selectedOffset");E.style.x+=c.cos(S,!0)*x,E.style.y-=c.sin(S,!0)*x,this._selected[e][t]=!0}else this._selected[e][t]=!1;this._selectedMode&&(E.onclick=this.shapeHandler.onclick),this.deepQuery([d,p,this.option],"calculable")&&(this.setCalculable(E),E.draggable=!0);if(this._needLabel(p,d,!0)||this._needLabelLine(p,d,!0))E.onmouseover=this.shapeHandler.onmouseover;return E=new o(E),E},getLabel:function(e,t,n,i,s,o,u,a){var f=this.series,h=f[e],p=h.data[t];if(!this._needLabel(h,p,a))return;var d=a?"emphasis":"normal",v=l.merge(l.clone(p.itemStyle)||{},h.itemStyle),m=v[d].label,g=m.textStyle||{},y=this.parseCenter(this.zr,h.center),b=y[0],w=y[1],E,S,x=((o+s)/2+360)%360,T=this.parseRadius(this.zr,h.radius),N,C="middle";return m.position=m.position||v.normal.label.position,m.position==="center"?(T=T[1],E=b,S=w,N="center"):m.position==="inner"?(T=(T[0]+T[1])/2+i,E=Math.round(b+T*c.cos(x,!0)),S=Math.round(w-T*c.sin(x,!0)),u="#fff",N="center"):(T=T[1]- -v[d].labelLine.length+i,E=b+T*c.cos(x,!0),S=w-T*c.sin(x,!0),N=x>=90&&x<=270?"right":"left"),m.position!="center"&&m.position!="inner"&&(E+=N==="left"?20:-20),p.__labelX=E-(N==="left"?5:-5),p.__labelY=S,new r({zlevel:this._zlevelBase+1,hoverable:!1,style:{x:E,y:S,color:g.color||u,text:this.getLabelText(e,t,n,d),textAlign:g.align||N,textBaseline:g.baseline||C,textFont:this.getFont(g)},highlightStyle:{brushType:"fill"},_seriesIndex:e,_dataIndex:t})},getLabelText:function(e,t,n,r){var i=this.series,s=i[e],o=s.data[t],u=this.deepQuery([o,s],"itemStyle."+r+".label.formatter");if(!u)return o.name;if(typeof u=="function")return u.call(this.myChart,s.name,o.name,o.value,n);if(typeof u=="string")return u=u.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}").replace("{d}","{d0}"),u=u.replace("{a0}",s.name).replace("{b0}",o.name).replace("{c0}",o.value).replace("{d0}",n),u},getLabelLine:function(e,t,n,r,i,s,o,a,f){var h=this.series,p=h[e],d=p.data[t];if(this._needLabelLine(p,d,f)){var v=f?"emphasis":"normal",m=l.merge(l.clone(d.itemStyle)||{},p.itemStyle),g=m[v].labelLine,y=g.lineStyle||{},b=this.parseCenter(this.zr,p.center),w=b[0],E=b[1],S=i,x=this.parseRadius(this.zr,p.radius)[1]- -g.length+n,T=(o+s)/2%360,N=c.cos(T,!0),C=c.sin(T,!0);return new u({zlevel:this._zlevelBase+1,hoverable:!1,style:{pointList:[[w+S*N,E-S*C],[w+x*N,E-x*C],[d.__labelX,d.__labelY]],strokeColor:y.color||a,lineType:y.type,lineWidth:y.width},_seriesIndex:e,_dataIndex:t})}return},_needLabel:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".label.show")},_needLabelLine:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".labelLine.show")},reformOption:function(e){var t=l.merge;return e=t(e||{},this.ecTheme.pie),e.itemStyle.normal.label.textStyle=t(e.itemStyle.normal.label.textStyle||{},this.ecTheme.textStyle),e.itemStyle.emphasis.label.textStyle=t(e.itemStyle.emphasis.label.textStyle||{},this.ecTheme.textStyle),e},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},addDataAnimation:function(e){var t=this.series,n={};for(var r=0,i=e.length;r{b} : {c}', // 数据孤岛内容格式器 - showDelay: 20, // 显示延迟,添加显示延迟可以避免频繁切换,单位ms - hideDelay: 100, // 隐藏延迟,单位ms - transitionDuration : 0.4, // 动画变换时间,单位s - backgroundColor: 'rgba(0,0,0,0.7)', // 提示背景颜色,默认为透明度为0.7的黑色 - borderColor: '#333', // 提示边框颜色 - borderRadius: 4, // 提示边框圆角,单位px,默认为4 - borderWidth: 0, // 提示边框线宽,单位px,默认为0(无边框) - padding: 5, // 提示内边距,单位px,默认各方向内边距为5, - // 接受数组分别设定上右下左边距,同css - axisPointer : { // 坐标轴指示器,坐标轴触发有效 - type : 'line', // 默认为直线,可选为:'line' | 'shadow' | 'cross' - lineStyle : { // 直线指示器样式设置 - color: '#48b', - width: 2, - type: 'solid' - }, - crossStyle: { - color: '#1e90ff', - width: 1, - type: 'dashed' - }, - shadowStyle : { // 阴影指示器样式设置 - color: 'rgba(150,150,150,0.3)', // 阴影颜色 - width: 'auto', // 阴影大小 - type: 'default' - } - }, - textStyle: { - color: '#fff' - } - }, - - // 区域缩放控制器 - dataZoom: { - show: false, - orient: 'horizontal', // 布局方式,默认为水平布局,可选为: - // 'horizontal' ¦ 'vertical' - // x: {number}, // 水平安放位置,默认为根据grid参数适配,可选为: - // {number}(x坐标,单位px) - // y: {number}, // 垂直安放位置,默认为根据grid参数适配,可选为: - // {number}(y坐标,单位px) - // width: {number}, // 指定宽度,横向布局时默认为根据grid参数适配 - // height: {number}, // 指定高度,纵向布局时默认为根据grid参数适配 - backgroundColor: 'rgba(0,0,0,0)', // 背景颜色 - dataBackgroundColor: '#eee', // 数据背景颜色 - fillerColor: 'rgba(144,197,237,0.2)', // 填充颜色 - handleColor: 'rgba(70,130,180,0.8)', // 手柄颜色 - // xAxisIndex: [], // 默认控制所有横向类目 - // yAxisIndex: [], // 默认控制所有横向类目 - // start: 0, // 默认为0 - // end: 100, // 默认为全部 100% - realtime: true - // zoomLock: false // 是否锁定选择区域大小 - }, - - // 网格 - grid: { - x: 80, - y: 60, - x2: 80, - y2: 60, - // width: {totalWidth} - x - x2, - // height: {totalHeight} - y - y2, - backgroundColor: 'rgba(0,0,0,0)', - borderWidth: 1, - borderColor: '#ccc' - }, - - // 类目轴 - categoryAxis: { - position: 'bottom', // 位置 - name: '', // 坐标轴名字,默认为空 - nameLocation: 'end', // 坐标轴名字位置,支持'start' | 'end' - nameTextStyle: {}, // 坐标轴文字样式,默认取全局样式 - boundaryGap: true, // 类目起始和结束两端空白策略 - axisLine: { // 坐标轴线 - show: true, // 默认显示,属性show控制显示与否 - onZero: true, - lineStyle: { // 属性lineStyle控制线条样式 - color: '#48b', - width: 2, - type: 'solid' - } - }, - axisTick: { // 坐标轴小标记 - show: true, // 属性show控制显示与否,默认不显示 - interval: 'auto', - inside : false, // 控制小标记是否在grid里 - // onGap: null, - length :5, // 属性length控制线长 - lineStyle: { // 属性lineStyle控制线条样式 - color: '#333', - width: 1 - } - }, - axisLabel: { // 坐标轴文本标签,详见axis.axisLabel - show: true, - interval: 'auto', - rotate: 0, - margin: 8, - // clickable: false, - // formatter: null, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#333' - } - }, - splitLine: { // 分隔线 - show: true, // 默认显示,属性show控制显示与否 - // onGap: null, - lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 - color: ['#ccc'], - width: 1, - type: 'solid' - } - }, - splitArea: { // 分隔区域 - show: false, // 默认不显示,属性show控制显示与否 - // onGap: null, - areaStyle: { // 属性areaStyle(详见areaStyle)控制区域样式 - color: ['rgba(250,250,250,0.3)','rgba(200,200,200,0.3)'] - } - } - }, - - // 数值型坐标轴默认参数 - valueAxis: { - position: 'left', // 位置 - name: '', // 坐标轴名字,默认为空 - nameLocation: 'end', // 坐标轴名字位置,支持'start' | 'end' - nameTextStyle: {}, // 坐标轴文字样式,默认取全局样式 - boundaryGap: [0, 0], // 数值起始和结束两端空白策略 - // min: null, // 最小值 - // max: null, // 最大值 - // scale: false, // 脱离0值比例,放大聚焦到最终_min,_max区间 - precision: 0, // 小数精度,默认为0,无小数点 - power: 100, // 整数精度,默认为100,个位和百位为0 - splitNumber: 5, // 分割段数,默认为5 - axisLine: { // 坐标轴线 - show: true, // 默认显示,属性show控制显示与否 - onZero: true, - lineStyle: { // 属性lineStyle控制线条样式 - color: '#48b', - width: 2, - type: 'solid' - } - }, - axisTick: { // 坐标轴小标记 - show: false, // 属性show控制显示与否,默认不显示 - inside : false, // 控制小标记是否在grid里 - length :5, // 属性length控制线长 - lineStyle: { // 属性lineStyle控制线条样式 - color: '#333', - width: 1 - } - }, - axisLabel: { // 坐标轴文本标签,详见axis.axisLabel - show: true, - rotate: 0, - margin: 8, - // clickable: false, - // formatter: null, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#333' - } - }, - splitLine: { // 分隔线 - show: true, // 默认显示,属性show控制显示与否 - lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 - color: ['#ccc'], - width: 1, - type: 'solid' - } - }, - splitArea: { // 分隔区域 - show: false, // 默认不显示,属性show控制显示与否 - areaStyle: { // 属性areaStyle(详见areaStyle)控制区域样式 - color: ['rgba(250,250,250,0.3)','rgba(200,200,200,0.3)'] - } - } - }, - - polar : { - center : ['50%', '50%'], // 默认全局居中 - radius : '75%', - startAngle : 90, - splitNumber : 5, - name : { - show: true, - // formatter: null, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#333' - } - }, - axisLine: { // 坐标轴线 - show: true, // 默认显示,属性show控制显示与否 - lineStyle: { // 属性lineStyle控制线条样式 - color: '#ccc', - width: 1, - type: 'solid' - } - }, - axisLabel: { // 坐标轴文本标签,详见axis.axisLabel - show: false, - // formatter: null, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#333' - } - }, - splitArea : { - show : true, - areaStyle : { - color: ['rgba(250,250,250,0.3)','rgba(200,200,200,0.3)'] - } - }, - splitLine : { - show : true, - lineStyle : { - width : 1, - color : '#ccc' - } - }, - type: 'polygon' - //indicator : [] - }, - - timeline : { - show: true, - type : 'time', // 模式是时间类型,支持 number - notMerge : false, - realtime : true, - x: 80, - // y: {number}, - x2: 80, - y2: 0, - // width: {totalWidth} - x - x2, - height: 50, - backgroundColor: 'rgba(0,0,0,0)', // 时间轴背景颜色 - borderColor : '#ccc', // 时间轴边框颜色 - borderWidth : 0, // 时间轴边框线宽,单位px,默认为0(无边框) - padding : 5, // 时间轴内边距,单位px,默认各方向内边距为5, - controlPosition : 'left', // 'right' | 'none' - autoPlay : false, - loop : true, - playInterval : 2000, // 播放时间间隔,单位ms - lineStyle : { - width : 1, - color : '#666', - type : 'dashed' - }, - label: { // 文本标签 - show: true, - interval: 'auto', - rotate: 0, - // formatter: null, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#333' - } - }, - checkpointStyle : { - symbol : 'auto', - symbolSize : 'auto', - color : 'auto', - borderColor : 'auto', - borderWidth : 'auto', - label: { // 文本标签 - show: false, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: 'auto' - } - } - }, - controlStyle : { - normal : { color : '#333'}, - emphasis : { color : '#1e90ff'} - }, - symbol : 'emptyDiamond', - symbolSize : 4, - currentIndex : 0 - // data : [] - }, - - // 柱形图默认参数 - bar: { - // stack: null - xAxisIndex: 0, - yAxisIndex: 0, - barMinHeight: 0, // 最小高度改为0 - // barWidth: null, // 默认自适应 - barGap: '30%', // 柱间距离,默认为柱形宽度的30%,可设固定值 - barCategoryGap : '20%', // 类目间柱形距离,默认为类目间距的20%,可设固定值 - itemStyle: { - normal: { - // color: '各异', - borderColor: '#fff', // 柱条边线 - borderRadius: 0, // 柱条边线圆角,单位px,默认为0 - borderWidth: 0, // 柱条边线线宽,单位px,默认为1 - label: { - show: false - // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - }, - emphasis: { - // color: '各异', - borderColor: '#fff', // 柱条边线 - borderRadius: 0, // 柱条边线圆角,单位px,默认为0 - borderWidth: 0, // 柱条边线线宽,单位px,默认为1 - label: { - show: false - // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - } - } - }, - - // 折线图默认参数 - line: { - // stack: null - xAxisIndex: 0, - yAxisIndex: 0, - itemStyle: { - normal: { - // color: 各异, - label: { - show: false - // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - lineStyle: { - width: 2, - type: 'solid', - shadowColor : 'rgba(0,0,0,0)', //默认透明 - shadowBlur: 0, - shadowOffsetX: 0, - shadowOffsetY: 0 - } - }, - emphasis: { - // color: 各异, - label: { - show: false - // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - } - }, - //smooth : false, - //symbol: null, // 拐点图形类型 - symbolSize: 2, // 拐点图形大小 - //symbolRotate : null, // 拐点图形旋转控制 - showAllSymbol: false // 标志图形默认只有主轴显示(随主轴标签间隔隐藏策略) - }, - - // K线图默认参数 - k: { - xAxisIndex: 0, - yAxisIndex: 0, - // barWidth : null // 默认自适应 - // barMaxWidth : null // 默认自适应 - itemStyle: { - normal: { - color: '#fff', // 阳线填充颜色 - color0: '#00aa11', // 阴线填充颜色 - lineStyle: { - width: 1, - color: '#ff3200', // 阳线边框颜色 - color0: '#00aa11' // 阴线边框颜色 - } - }, - emphasis: { - // color: 各异, - // color0: 各异 - } - } - }, - - // 散点图默认参数 - scatter: { - xAxisIndex: 0, - yAxisIndex: 0, - //symbol: null, // 图形类型 - symbolSize: 4, // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 - //symbolRotate : null, // 图形旋转控制 - large: false, // 大规模散点图 - largeThreshold: 2000,// 大规模阀值,large为true且数据量>largeThreshold才启用大规模模式 - itemStyle: { - normal: { - // color: 各异, - label: { - show: false, - // 标签文本格式器,同Tooltip.formatter,不支持回调 - formatter : function (a, b, c) { - if (typeof c[2] != 'undefined') { - return c[2]; - } - else { - return c[0] + ' , ' + c[1]; - } - } - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - }, - emphasis: { - // color: '各异' - label: { - show: false, - // 标签文本格式器,同Tooltip.formatter,不支持回调 - formatter : function (a, b, c) { - if (typeof c[2] != 'undefined') { - return c[2]; - } - else { - return c[0] + ' , ' + c[1]; - } - } - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - } - } - }, - - // 雷达图默认参数 - radar : { - polarIndex: 0, - itemStyle: { - normal: { - // color: 各异, - label: { - show: false - }, - lineStyle: { - width: 2, - type: 'solid' - } - }, - emphasis: { - // color: 各异, - label: { - show: false - } - } - }, - //symbol: null, // 拐点图形类型 - symbolSize: 2 // 可计算特性参数,空数据拖拽提示图形大小 - //symbolRotate : null, // 图形旋转控制 - }, - - // 饼图默认参数 - pie: { - center : ['50%', '50%'], // 默认全局居中 - radius : [0, '75%'], - clockWise : true, // 默认顺时针 - startAngle: 90, - minAngle: 0, // 最小角度改为0 - selectedOffset: 10, // 选中是扇区偏移量 - // selectedMode: false, // 选择模式,默认关闭,可选single,multiple - // roseType : null, // 南丁格尔玫瑰图模式,'radius'(半径) | 'area'(面积) - itemStyle: { - normal: { - // color: 各异, - borderColor: 'rgba(0,0,0,0)', - borderWidth: 1, - label: { - show: true, - position: 'outer' - // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - labelLine: { - show: true, - length: 20, - lineStyle: { - // color: 各异, - width: 1, - type: 'solid' - } - } - }, - emphasis: { - // color: 各异, - borderColor: 'rgba(0,0,0,0)', - borderWidth: 1, - label: { - show: false - // position: 'outer' - // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - labelLine: { - show: false, - length: 20, - lineStyle: { - // color: 各异, - width: 1, - type: 'solid' - } - } - } - } - }, - - map: { - mapType: 'china', // 各省的mapType暂时都用中文 - //mapLocation: { - // x : 'center' | 'left' | 'right' | 'x%' | {number}, - // y : 'center' | 'top' | 'bottom' | 'x%' | {number} - // width // 自适应 - // height // 自适应 - //}, - // mapValueCalculation: 'sum', // 数值合并方式,默认加和,可选为: - // 'sum' | 'average' | 'max' | 'min' - mapValuePrecision : 0, // 地图数值计算结果小数精度 - showLegendSymbol : true, // 显示图例颜色标识(系列标识的小圆点),存在legend时生效 - // selectedMode: false, // 选择模式,默认关闭,可选single,multiple - hoverable: true, - // roam : false, // 是否开启缩放及漫游模式 - // scaleLimit : null, - itemStyle: { - normal: { - // color: 各异, - borderColor: 'rgba(0,0,0,0)', - borderWidth: 1, - areaStyle: { - color: '#ccc' - }, - label: { - show: false, - textStyle: { - color: 'rgb(139,69,19)' - } - } - }, - emphasis: { // 也是选中样式 - // color: 各异, - borderColor: 'rgba(0,0,0,0)', - borderWidth: 1, - areaStyle: { - color: 'rgba(255,215,0,0.8)' - }, - label: { - show: false, - textStyle: { - color: 'rgb(100,0,0)' - } - } - } - } - }, - - force : { - // 布局中心 - center: ['50%', '50%'], - - // 布局大小 - size: '100%', - - // 布局冷却因子,值越小结束时间越短,值越大时间越长但是结果也越收敛 - coolDown: 0.99, - - // 数据映射到圆的半径的最小值和最大值 - minRadius : 10, - maxRadius : 20, - - // 是否根据屏幕比例拉伸 - ratioScaling: false, - - // 在 500+ 顶点的图上建议设置 large 为 true, 会使用 Barnes-Hut simulation - // 同时开启 useWorker 并且把 steps 值调大 - // 关于Barnes-Hut simulation: http://en.wikipedia.org/wiki/Barnes–Hut_simulation - large: false, - - // 是否在浏览器支持 worker 的时候使用 web worker - useWorker: false, - // 每一帧 force 迭代的次数,仅在启用webworker的情况下有用 - steps: 1, - - // 布局缩放因子,并不完全精确, 效果跟布局大小类似 - scaling : 1.0, - - // 向心力因子,越大向心力越大( 所有顶点会往 center 的位置收拢 ) - gravity : 1, - - symbol: 'circle', - // symbolSize 为 0 的话使用映射到minRadius-maxRadius后的值 - symbolSize: 0, - - linkSymbol: null, - linkSymbolSize: [10, 15], - draggable: true, - - // 分类里如果有样式会覆盖节点默认样式 - categories : [{ - // itemStyle - // symbol - // symbolSize - // name - }], - itemStyle: { - normal: { - // color: 各异, - label: { - show: false - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - nodeStyle : { - brushType : 'both', - color : '#f08c2e', - strokeColor : '#5182ab', - lineWidth: 1 - }, - linkStyle : { - strokeColor : '#5182ab' - } - }, - emphasis: { - // color: 各异, - label: { - show: false - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - nodeStyle : {}, - linkStyle : { - opacity: 0 - } - } - } - // nodes: [{ - // name: 'xxx', - // value: 1, - // itemStyle: {}, - // initial: [0, 0], - // fixX: false, - // fixY: false, - // ignore: false, - // symbol: 'circle', - // symbolSize: 0 - // }] - // links: [{ - // source: 1, - // target: 2, - // weight: 1, - // itemStyle: {} - // }, { - // source: 'xxx', - // target: 'ooo' - // }] - }, - - chord : { - radius : ['65%', '75%'], - center : ['50%', '50%'], - padding : 2, - sort : 'none', // can be 'none', 'ascending', 'descending' - sortSub : 'none', // can be 'none', 'ascending', 'descending' - startAngle : 90, - clockWise : true, - showScale : false, - showScaleText : false, - itemStyle : { - normal : { - label : { - show : true, - rotate: false, - distance: 10 - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - lineStyle : { - width : 0, - color : '#000' - }, - chordStyle : { - lineStyle : { - width : 1, - color : '#999' - } - } - }, - emphasis : { - lineStyle : { - width : 0, - color : '#000' - }, - chordStyle : { - lineStyle : { - width : 1, - color : '#666' - } - } - } - }, - // Source data matrix - /** - * target - * -1--2--3--4--5- - * 1| x x x x x - * 2| x x x x x - * 3| x x x x x source - * 4| x x x x x - * 5| x x x x x - * - * Relation ship from source to target - * https://github.com/mbostock/d3/wiki/Chord-Layout#wiki-chord - * - * Row based - */ - matrix : [] - }, - - gauge : { - center : ['50%', '50%'], // 默认全局居中 - radius : '75%', - startAngle: 225, - endAngle : -45, - min: 0, // 最小值 - max: 100, // 最大值 - precision: 0, // 小数精度,默认为0,无小数点 - splitNumber: 10, // 分割段数,默认为10 - axisLine: { // 坐标轴线 - show: true, // 默认显示,属性show控制显示与否 - lineStyle: { // 属性lineStyle控制线条样式 - color: [[0.2, '#228b22'],[0.8, '#48b'],[1, '#ff4500']], - width: 30 - } - }, - axisTick: { // 坐标轴小标记 - show: true, // 属性show控制显示与否,默认不显示 - splitNumber: 5, // 每份split细分多少段 - length :8, // 属性length控制线长 - lineStyle: { // 属性lineStyle控制线条样式 - color: '#eee', - width: 1, - type: 'solid' - } - }, - axisLabel: { // 坐标轴文本标签,详见axis.axisLabel - show: true, - // formatter: null, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: 'auto' - } - }, - splitLine: { // 分隔线 - show: true, // 默认显示,属性show控制显示与否 - length :30, // 属性length控制线长 - lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 - color: '#eee', - width: 2, - type: 'solid' - } - }, - pointer : { - show : true, - length : '80%', - width : 8, - color : 'auto' - }, - title : { - show : true, - offsetCenter: [0, '-40%'], // x, y,单位px - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#333', - fontSize : 15 - } - }, - detail : { - show : true, - backgroundColor: 'rgba(0,0,0,0)', - borderWidth: 0, - borderColor: '#ccc', - width: 100, - height: 40, - offsetCenter: [0, '40%'], // x, y,单位px - // formatter: null, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: 'auto', - fontSize : 30 - } - } - }, - - funnel : { - x: 80, - y: 60, - x2: 80, - y2: 60, - // width: {totalWidth} - x - x2, - // height: {totalHeight} - y - y2, - min: 0, - max: 100, - minSize: '0%', - maxSize: '100%', - sort : 'descending', // 'ascending', 'descending' - gap : 0, - itemStyle: { - normal: { - // color: 各异, - borderColor: '#fff', - borderWidth: 1, - label: { - show: true, - position: 'outer' - // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - labelLine: { - show: true, - length: 10, - lineStyle: { - // color: 各异, - width: 1, - type: 'solid' - } - } - }, - emphasis: { - // color: 各异, - borderColor: 'rgba(0,0,0,0)', - borderWidth: 1, - label: { - show: true - }, - labelLine: { - show: true - } - } - } - }, - - island: { - r: 15, - calculateStep: 0.1 // 滚轮可计算步长 0.1 = 10% - }, - - markPoint : { - symbol: 'pin', // 标注类型 - symbolSize: 10, // 标注大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 - //symbolRotate : null, // 标注旋转控制 - large : false, - effect : { - show: false, - loop: true, - period: 15, // 运动周期,无单位,值越大越慢 - scaleSize : 2 // 放大倍数,以markPoint点size为基准 - // color : 'gold', - // shadowColor : 'rgba(255,215,0,0.8)', - // shadowBlur : 0 // 炫光模糊 - }, - itemStyle: { - normal: { - // color: 各异, - // borderColor: 各异, // 标注边线颜色,优先于color - borderWidth: 2, // 标注边线线宽,单位px,默认为1 - label: { - show: true, - // 标签文本格式器,同Tooltip.formatter,不支持回调 - // formatter : null, - position: 'inside' // 可选为'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - }, - emphasis: { - // color: 各异 - label: { - show: true - // 标签文本格式器,同Tooltip.formatter,不支持回调 - // formatter : null, - // position: 'inside' // 'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - } - } - }, - - markLine : { - // 标线起始和结束的symbol介绍类型,如果都一样,可以直接传string - symbol: ['circle', 'arrow'], - // 标线起始和结束的symbol大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 - symbolSize: [2, 4], - // 标线起始和结束的symbol旋转控制 - //symbolRotate : null, - //smooth : false, - large : false, - effect : { - show: false, - loop: true, - period: 15, // 运动周期,无单位,值越大越慢 - scaleSize : 2 // 放大倍数,以markLine线lineWidth为基准 - // color : 'gold', - // shadowColor : 'rgba(255,215,0,0.8)', - // shadowBlur : lineWidth * 2 // 炫光模糊,默认等于scaleSize计算所得 - }, - itemStyle: { - normal: { - // color: 各异, // 标线主色,线色,symbol主色 - // borderColor: 随color, // 标线symbol边框颜色,优先于color - borderWidth: 1.5, // 标线symbol边框线宽,单位px,默认为2 - label: { - show: true, - // 标签文本格式器,同Tooltip.formatter,不支持回调 - // formatter : null, - // 可选为 'start'|'end'|'left'|'right'|'top'|'bottom' - position: 'end' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - lineStyle: { - // color: 随borderColor, // 主色,线色,优先级高于borderColor和color - // width: 随borderWidth, // 优先于borderWidth - type: 'dashed' - // shadowColor : 'rgba(0,0,0,0)', //默认透明 - // shadowBlur: 0, - // shadowOffsetX: 0, - // shadowOffsetY: 0 - } - }, - emphasis: { - // color: 各异 - label: { - show: false - // 标签文本格式器,同Tooltip.formatter,不支持回调 - // formatter : null, - // position: 'inside' // 'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - lineStyle : {} - } - } - }, - - // 主题,主题 - textStyle: { - decoration: 'none', - fontFamily: 'Arial, Verdana, sans-serif', - fontFamily2: '微软雅黑', // IE8- 字体模糊并且,不支持不同字体混排,额外指定一份 - fontSize: 12, - fontStyle: 'normal', - fontWeight: 'normal' - }, - - EVENT: { - // -------全局通用 - REFRESH: 'refresh', - RESTORE: 'restore', - RESIZE: 'resize', - CLICK: 'click', - HOVER: 'hover', - //MOUSEWHEEL: 'mousewheel', - // -------业务交互逻辑 - DATA_CHANGED: 'dataChanged', - DATA_ZOOM: 'dataZoom', - DATA_RANGE: 'dataRange', - LEGEND_SELECTED: 'legendSelected', - MAP_SELECTED: 'mapSelected', - PIE_SELECTED: 'pieSelected', - MAGIC_TYPE_CHANGED: 'magicTypeChanged', - DATA_VIEW_CHANGED: 'dataViewChanged', - TIMELINE_CHANGED: 'timelineChanged', - MAP_ROAM : 'mapRoam', - // -------内部通信 - TOOLTIP_HOVER: 'tooltipHover', - TOOLTIP_IN_GRID: 'tooltipInGrid', - TOOLTIP_OUT_GRID: 'tooltipOutGrid' - }, - DRAG_ENABLE_TIME : 120, // 降低图表内元素拖拽敏感度,单位ms,不建议外部干预 - EFFECT_ZLEVEL : 7, - // 主题,默认标志图形类型列表 - symbolList : [ - 'circle', 'rectangle', 'triangle', 'diamond', - 'emptyCircle', 'emptyRectangle', 'emptyTriangle', 'emptyDiamond' - ], - loadingText : 'Loading...', - // 可计算特性配置,孤岛,提示颜色 - calculable: false, // 默认关闭可计算特性 - calculableColor: 'rgba(255,165,0,0.6)', // 拖拽提示边框颜色 - calculableHolderColor: '#ccc', // 可计算占位提示颜色 - nameConnector: ' & ', - valueConnector: ' : ', - animation: true, - addDataAnimation: true, // 动态数据接口是否开启动画效果 - animationThreshold: 2000, // 动画元素阀值,产生的图形原素超过2000不出动画 - animationDuration: 2000, - animationEasing: 'ExponentialOut' //BounceOut - }; - - return config; -}); -// Copyright 2006 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -// Known Issues: -// -// * Patterns only support repeat. -// * Radial gradient are not implemented. The VML version of these look very -// different from the canvas one. -// * Clipping paths are not implemented. -// * Coordsize. The width and height attribute have higher priority than the -// width and height style values which isn't correct. -// * Painting mode isn't implemented. -// * Canvas width/height should is using content-box by default. IE in -// Quirks mode will draw the canvas using border-box. Either change your -// doctype to HTML5 -// (http://www.whatwg.org/specs/web-apps/current-work/#the-doctype) -// or use Box Sizing Behavior from WebFX -// (http://webfx.eae.net/dhtml/boxsizing/boxsizing.html) -// * Non uniform scaling does not correctly scale strokes. -// * Optimize. There is always room for speed improvements. - -// AMD by kener.linfeng@gmail.com -define('zrender/lib/excanvas',['require'],function(require) { - -// Only add this code if we do not already have a canvas implementation -if (!document.createElement('canvas').getContext) { - -(function() { - - // alias some functions to make (compiled) code shorter - var m = Math; - var mr = m.round; - var ms = m.sin; - var mc = m.cos; - var abs = m.abs; - var sqrt = m.sqrt; - - // this is used for sub pixel precision - var Z = 10; - var Z2 = Z / 2; - - var IE_VERSION = +navigator.userAgent.match(/MSIE ([\d.]+)?/)[1]; - - /** - * This funtion is assigned to the elements as element.getContext(). - * @this {HTMLElement} - * @return {CanvasRenderingContext2D_} - */ - function getContext() { - return this.context_ || - (this.context_ = new CanvasRenderingContext2D_(this)); - } - - var slice = Array.prototype.slice; - - /** - * Binds a function to an object. The returned function will always use the - * passed in {@code obj} as {@code this}. - * - * Example: - * - * g = bind(f, obj, a, b) - * g(c, d) // will do f.call(obj, a, b, c, d) - * - * @param {Function} f The function to bind the object to - * @param {Object} obj The object that should act as this when the function - * is called - * @param {*} var_args Rest arguments that will be used as the initial - * arguments when the function is called - * @return {Function} A new function that has bound this - */ - function bind(f, obj, var_args) { - var a = slice.call(arguments, 2); - return function() { - return f.apply(obj, a.concat(slice.call(arguments))); - }; - } - - function encodeHtmlAttribute(s) { - return String(s).replace(/&/g, '&').replace(/"/g, '"'); - } - - function addNamespace(doc, prefix, urn) { - if (!doc.namespaces[prefix]) { - doc.namespaces.add(prefix, urn, '#default#VML'); - } - } - - function addNamespacesAndStylesheet(doc) { - addNamespace(doc, 'g_vml_', 'urn:schemas-microsoft-com:vml'); - addNamespace(doc, 'g_o_', 'urn:schemas-microsoft-com:office:office'); - - // Setup default CSS. Only add one style sheet per document - if (!doc.styleSheets['ex_canvas_']) { - var ss = doc.createStyleSheet(); - ss.owningElement.id = 'ex_canvas_'; - ss.cssText = 'canvas{display:inline-block;overflow:hidden;' + - // default size is 300x150 in Gecko and Opera - 'text-align:left;width:300px;height:150px}'; - } - } - - // Add namespaces and stylesheet at startup. - addNamespacesAndStylesheet(document); - - var G_vmlCanvasManager_ = { - init: function(opt_doc) { - var doc = opt_doc || document; - // Create a dummy element so that IE will allow canvas elements to be - // recognized. - doc.createElement('canvas'); - doc.attachEvent('onreadystatechange', bind(this.init_, this, doc)); - }, - - init_: function(doc) { - // find all canvas elements - var els = doc.getElementsByTagName('canvas'); - for (var i = 0; i < els.length; i++) { - this.initElement(els[i]); - } - }, - - /** - * Public initializes a canvas element so that it can be used as canvas - * element from now on. This is called automatically before the page is - * loaded but if you are creating elements using createElement you need to - * make sure this is called on the element. - * @param {HTMLElement} el The canvas element to initialize. - * @return {HTMLElement} the element that was created. - */ - initElement: function(el) { - if (!el.getContext) { - el.getContext = getContext; - - // Add namespaces and stylesheet to document of the element. - addNamespacesAndStylesheet(el.ownerDocument); - - // Remove fallback content. There is no way to hide text nodes so we - // just remove all childNodes. We could hide all elements and remove - // text nodes but who really cares about the fallback content. - el.innerHTML = ''; - - // do not use inline function because that will leak memory - el.attachEvent('onpropertychange', onPropertyChange); - el.attachEvent('onresize', onResize); - - var attrs = el.attributes; - if (attrs.width && attrs.width.specified) { - // TODO: use runtimeStyle and coordsize - // el.getContext().setWidth_(attrs.width.nodeValue); - el.style.width = attrs.width.nodeValue + 'px'; - } else { - el.width = el.clientWidth; - } - if (attrs.height && attrs.height.specified) { - // TODO: use runtimeStyle and coordsize - // el.getContext().setHeight_(attrs.height.nodeValue); - el.style.height = attrs.height.nodeValue + 'px'; - } else { - el.height = el.clientHeight; - } - //el.getContext().setCoordsize_() - } - return el; - } - }; - - function onPropertyChange(e) { - var el = e.srcElement; - - switch (e.propertyName) { - case 'width': - el.getContext().clearRect(); - el.style.width = el.attributes.width.nodeValue + 'px'; - // In IE8 this does not trigger onresize. - el.firstChild.style.width = el.clientWidth + 'px'; - break; - case 'height': - el.getContext().clearRect(); - el.style.height = el.attributes.height.nodeValue + 'px'; - el.firstChild.style.height = el.clientHeight + 'px'; - break; - } - } - - function onResize(e) { - var el = e.srcElement; - if (el.firstChild) { - el.firstChild.style.width = el.clientWidth + 'px'; - el.firstChild.style.height = el.clientHeight + 'px'; - } - } - - G_vmlCanvasManager_.init(); - - // precompute "00" to "FF" - var decToHex = []; - for (var i = 0; i < 16; i++) { - for (var j = 0; j < 16; j++) { - decToHex[i * 16 + j] = i.toString(16) + j.toString(16); - } - } - - function createMatrixIdentity() { - return [ - [1, 0, 0], - [0, 1, 0], - [0, 0, 1] - ]; - } - - function matrixMultiply(m1, m2) { - var result = createMatrixIdentity(); - - for (var x = 0; x < 3; x++) { - for (var y = 0; y < 3; y++) { - var sum = 0; - - for (var z = 0; z < 3; z++) { - sum += m1[x][z] * m2[z][y]; - } - - result[x][y] = sum; - } - } - return result; - } - - function copyState(o1, o2) { - o2.fillStyle = o1.fillStyle; - o2.lineCap = o1.lineCap; - o2.lineJoin = o1.lineJoin; - o2.lineWidth = o1.lineWidth; - o2.miterLimit = o1.miterLimit; - o2.shadowBlur = o1.shadowBlur; - o2.shadowColor = o1.shadowColor; - o2.shadowOffsetX = o1.shadowOffsetX; - o2.shadowOffsetY = o1.shadowOffsetY; - o2.strokeStyle = o1.strokeStyle; - o2.globalAlpha = o1.globalAlpha; - o2.font = o1.font; - o2.textAlign = o1.textAlign; - o2.textBaseline = o1.textBaseline; - o2.arcScaleX_ = o1.arcScaleX_; - o2.arcScaleY_ = o1.arcScaleY_; - o2.lineScale_ = o1.lineScale_; - } - - var colorData = { - aliceblue: '#F0F8FF', - antiquewhite: '#FAEBD7', - aquamarine: '#7FFFD4', - azure: '#F0FFFF', - beige: '#F5F5DC', - bisque: '#FFE4C4', - black: '#000000', - blanchedalmond: '#FFEBCD', - blueviolet: '#8A2BE2', - brown: '#A52A2A', - burlywood: '#DEB887', - cadetblue: '#5F9EA0', - chartreuse: '#7FFF00', - chocolate: '#D2691E', - coral: '#FF7F50', - cornflowerblue: '#6495ED', - cornsilk: '#FFF8DC', - crimson: '#DC143C', - cyan: '#00FFFF', - darkblue: '#00008B', - darkcyan: '#008B8B', - darkgoldenrod: '#B8860B', - darkgray: '#A9A9A9', - darkgreen: '#006400', - darkgrey: '#A9A9A9', - darkkhaki: '#BDB76B', - darkmagenta: '#8B008B', - darkolivegreen: '#556B2F', - darkorange: '#FF8C00', - darkorchid: '#9932CC', - darkred: '#8B0000', - darksalmon: '#E9967A', - darkseagreen: '#8FBC8F', - darkslateblue: '#483D8B', - darkslategray: '#2F4F4F', - darkslategrey: '#2F4F4F', - darkturquoise: '#00CED1', - darkviolet: '#9400D3', - deeppink: '#FF1493', - deepskyblue: '#00BFFF', - dimgray: '#696969', - dimgrey: '#696969', - dodgerblue: '#1E90FF', - firebrick: '#B22222', - floralwhite: '#FFFAF0', - forestgreen: '#228B22', - gainsboro: '#DCDCDC', - ghostwhite: '#F8F8FF', - gold: '#FFD700', - goldenrod: '#DAA520', - grey: '#808080', - greenyellow: '#ADFF2F', - honeydew: '#F0FFF0', - hotpink: '#FF69B4', - indianred: '#CD5C5C', - indigo: '#4B0082', - ivory: '#FFFFF0', - khaki: '#F0E68C', - lavender: '#E6E6FA', - lavenderblush: '#FFF0F5', - lawngreen: '#7CFC00', - lemonchiffon: '#FFFACD', - lightblue: '#ADD8E6', - lightcoral: '#F08080', - lightcyan: '#E0FFFF', - lightgoldenrodyellow: '#FAFAD2', - lightgreen: '#90EE90', - lightgrey: '#D3D3D3', - lightpink: '#FFB6C1', - lightsalmon: '#FFA07A', - lightseagreen: '#20B2AA', - lightskyblue: '#87CEFA', - lightslategray: '#778899', - lightslategrey: '#778899', - lightsteelblue: '#B0C4DE', - lightyellow: '#FFFFE0', - limegreen: '#32CD32', - linen: '#FAF0E6', - magenta: '#FF00FF', - mediumaquamarine: '#66CDAA', - mediumblue: '#0000CD', - mediumorchid: '#BA55D3', - mediumpurple: '#9370DB', - mediumseagreen: '#3CB371', - mediumslateblue: '#7B68EE', - mediumspringgreen: '#00FA9A', - mediumturquoise: '#48D1CC', - mediumvioletred: '#C71585', - midnightblue: '#191970', - mintcream: '#F5FFFA', - mistyrose: '#FFE4E1', - moccasin: '#FFE4B5', - navajowhite: '#FFDEAD', - oldlace: '#FDF5E6', - olivedrab: '#6B8E23', - orange: '#FFA500', - orangered: '#FF4500', - orchid: '#DA70D6', - palegoldenrod: '#EEE8AA', - palegreen: '#98FB98', - paleturquoise: '#AFEEEE', - palevioletred: '#DB7093', - papayawhip: '#FFEFD5', - peachpuff: '#FFDAB9', - peru: '#CD853F', - pink: '#FFC0CB', - plum: '#DDA0DD', - powderblue: '#B0E0E6', - rosybrown: '#BC8F8F', - royalblue: '#4169E1', - saddlebrown: '#8B4513', - salmon: '#FA8072', - sandybrown: '#F4A460', - seagreen: '#2E8B57', - seashell: '#FFF5EE', - sienna: '#A0522D', - skyblue: '#87CEEB', - slateblue: '#6A5ACD', - slategray: '#708090', - slategrey: '#708090', - snow: '#FFFAFA', - springgreen: '#00FF7F', - steelblue: '#4682B4', - tan: '#D2B48C', - thistle: '#D8BFD8', - tomato: '#FF6347', - turquoise: '#40E0D0', - violet: '#EE82EE', - wheat: '#F5DEB3', - whitesmoke: '#F5F5F5', - yellowgreen: '#9ACD32' - }; - - - function getRgbHslContent(styleString) { - var start = styleString.indexOf('(', 3); - var end = styleString.indexOf(')', start + 1); - var parts = styleString.substring(start + 1, end).split(','); - // add alpha if needed - if (parts.length != 4 || styleString.charAt(3) != 'a') { - parts[3] = 1; - } - return parts; - } - - function percent(s) { - return parseFloat(s) / 100; - } - - function clamp(v, min, max) { - return Math.min(max, Math.max(min, v)); - } - - function hslToRgb(parts){ - var r, g, b, h, s, l; - h = parseFloat(parts[0]) / 360 % 360; - if (h < 0) - h++; - s = clamp(percent(parts[1]), 0, 1); - l = clamp(percent(parts[2]), 0, 1); - if (s == 0) { - r = g = b = l; // achromatic - } else { - var q = l < 0.5 ? l * (1 + s) : l + s - l * s; - var p = 2 * l - q; - r = hueToRgb(p, q, h + 1 / 3); - g = hueToRgb(p, q, h); - b = hueToRgb(p, q, h - 1 / 3); - } - - return '#' + decToHex[Math.floor(r * 255)] + - decToHex[Math.floor(g * 255)] + - decToHex[Math.floor(b * 255)]; - } - - function hueToRgb(m1, m2, h) { - if (h < 0) - h++; - if (h > 1) - h--; - - if (6 * h < 1) - return m1 + (m2 - m1) * 6 * h; - else if (2 * h < 1) - return m2; - else if (3 * h < 2) - return m1 + (m2 - m1) * (2 / 3 - h) * 6; - else - return m1; - } - - var processStyleCache = {}; - - function processStyle(styleString) { - if (styleString in processStyleCache) { - return processStyleCache[styleString]; - } - - var str, alpha = 1; - - styleString = String(styleString); - if (styleString.charAt(0) == '#') { - str = styleString; - } else if (/^rgb/.test(styleString)) { - var parts = getRgbHslContent(styleString); - var str = '#', n; - for (var i = 0; i < 3; i++) { - if (parts[i].indexOf('%') != -1) { - n = Math.floor(percent(parts[i]) * 255); - } else { - n = +parts[i]; - } - str += decToHex[clamp(n, 0, 255)]; - } - alpha = +parts[3]; - } else if (/^hsl/.test(styleString)) { - var parts = getRgbHslContent(styleString); - str = hslToRgb(parts); - alpha = parts[3]; - } else { - str = colorData[styleString] || styleString; - } - return processStyleCache[styleString] = {color: str, alpha: alpha}; - } - - var DEFAULT_STYLE = { - style: 'normal', - variant: 'normal', - weight: 'normal', - size: 12, //10 - family: '微软雅黑' //'sans-serif' - }; - - // Internal text style cache - var fontStyleCache = {}; - - function processFontStyle(styleString) { - if (fontStyleCache[styleString]) { - return fontStyleCache[styleString]; - } - - var el = document.createElement('div'); - var style = el.style; - var fontFamily; - try { - style.font = styleString; - fontFamily = style.fontFamily.split(',')[0]; - } catch (ex) { - // Ignore failures to set to invalid font. - } - - return fontStyleCache[styleString] = { - style: style.fontStyle || DEFAULT_STYLE.style, - variant: style.fontVariant || DEFAULT_STYLE.variant, - weight: style.fontWeight || DEFAULT_STYLE.weight, - size: style.fontSize || DEFAULT_STYLE.size, - family: fontFamily || DEFAULT_STYLE.family - }; - } - - function getComputedStyle(style, element) { - var computedStyle = {}; - - for (var p in style) { - computedStyle[p] = style[p]; - } - - // Compute the size - var canvasFontSize = parseFloat(element.currentStyle.fontSize), - fontSize = parseFloat(style.size); - - if (typeof style.size == 'number') { - computedStyle.size = style.size; - } else if (style.size.indexOf('px') != -1) { - computedStyle.size = fontSize; - } else if (style.size.indexOf('em') != -1) { - computedStyle.size = canvasFontSize * fontSize; - } else if(style.size.indexOf('%') != -1) { - computedStyle.size = (canvasFontSize / 100) * fontSize; - } else if (style.size.indexOf('pt') != -1) { - computedStyle.size = fontSize / .75; - } else { - computedStyle.size = canvasFontSize; - } - - // Different scaling between normal text and VML text. This was found using - // trial and error to get the same size as non VML text. - //computedStyle.size *= 0.981; - - return computedStyle; - } - - function buildStyle(style) { - return style.style + ' ' + style.variant + ' ' + style.weight + ' ' + - style.size + "px '" + style.family + "'"; - } - - var lineCapMap = { - 'butt': 'flat', - 'round': 'round' - }; - - function processLineCap(lineCap) { - return lineCapMap[lineCap] || 'square'; - } - - /** - * This class implements CanvasRenderingContext2D interface as described by - * the WHATWG. - * @param {HTMLElement} canvasElement The element that the 2D context should - * be associated with - */ - function CanvasRenderingContext2D_(canvasElement) { - this.m_ = createMatrixIdentity(); - - this.mStack_ = []; - this.aStack_ = []; - this.currentPath_ = []; - - // Canvas context properties - this.strokeStyle = '#000'; - this.fillStyle = '#000'; - - this.lineWidth = 1; - this.lineJoin = 'miter'; - this.lineCap = 'butt'; - this.miterLimit = Z * 1; - this.globalAlpha = 1; - // this.font = '10px sans-serif'; - this.font = '12px 微软雅黑'; // 决定还是改这吧,影响代价最小 - this.textAlign = 'left'; - this.textBaseline = 'alphabetic'; - this.canvas = canvasElement; - - var cssText = 'width:' + canvasElement.clientWidth + 'px;height:' + - canvasElement.clientHeight + 'px;overflow:hidden;position:absolute'; - var el = canvasElement.ownerDocument.createElement('div'); - el.style.cssText = cssText; - canvasElement.appendChild(el); - - var overlayEl = el.cloneNode(false); - // Use a non transparent background. - overlayEl.style.backgroundColor = '#fff'; //red, I don't know why, it work! - overlayEl.style.filter = 'alpha(opacity=0)'; - canvasElement.appendChild(overlayEl); - - this.element_ = el; - this.arcScaleX_ = 1; - this.arcScaleY_ = 1; - this.lineScale_ = 1; - } - - var contextPrototype = CanvasRenderingContext2D_.prototype; - contextPrototype.clearRect = function() { - if (this.textMeasureEl_) { - this.textMeasureEl_.removeNode(true); - this.textMeasureEl_ = null; - } - this.element_.innerHTML = ''; - }; - - contextPrototype.beginPath = function() { - // TODO: Branch current matrix so that save/restore has no effect - // as per safari docs. - this.currentPath_ = []; - }; - - contextPrototype.moveTo = function(aX, aY) { - var p = getCoords(this, aX, aY); - this.currentPath_.push({type: 'moveTo', x: p.x, y: p.y}); - this.currentX_ = p.x; - this.currentY_ = p.y; - }; - - contextPrototype.lineTo = function(aX, aY) { - var p = getCoords(this, aX, aY); - this.currentPath_.push({type: 'lineTo', x: p.x, y: p.y}); - - this.currentX_ = p.x; - this.currentY_ = p.y; - }; - - contextPrototype.bezierCurveTo = function(aCP1x, aCP1y, - aCP2x, aCP2y, - aX, aY) { - var p = getCoords(this, aX, aY); - var cp1 = getCoords(this, aCP1x, aCP1y); - var cp2 = getCoords(this, aCP2x, aCP2y); - bezierCurveTo(this, cp1, cp2, p); - }; - - // Helper function that takes the already fixed cordinates. - function bezierCurveTo(self, cp1, cp2, p) { - self.currentPath_.push({ - type: 'bezierCurveTo', - cp1x: cp1.x, - cp1y: cp1.y, - cp2x: cp2.x, - cp2y: cp2.y, - x: p.x, - y: p.y - }); - self.currentX_ = p.x; - self.currentY_ = p.y; - } - - contextPrototype.quadraticCurveTo = function(aCPx, aCPy, aX, aY) { - // the following is lifted almost directly from - // http://developer.mozilla.org/en/docs/Canvas_tutorial:Drawing_shapes - - var cp = getCoords(this, aCPx, aCPy); - var p = getCoords(this, aX, aY); - - var cp1 = { - x: this.currentX_ + 2.0 / 3.0 * (cp.x - this.currentX_), - y: this.currentY_ + 2.0 / 3.0 * (cp.y - this.currentY_) - }; - var cp2 = { - x: cp1.x + (p.x - this.currentX_) / 3.0, - y: cp1.y + (p.y - this.currentY_) / 3.0 - }; - - bezierCurveTo(this, cp1, cp2, p); - }; - - contextPrototype.arc = function(aX, aY, aRadius, - aStartAngle, aEndAngle, aClockwise) { - aRadius *= Z; - var arcType = aClockwise ? 'at' : 'wa'; - - var xStart = aX + mc(aStartAngle) * aRadius - Z2; - var yStart = aY + ms(aStartAngle) * aRadius - Z2; - - var xEnd = aX + mc(aEndAngle) * aRadius - Z2; - var yEnd = aY + ms(aEndAngle) * aRadius - Z2; - - // IE won't render arches drawn counter clockwise if xStart == xEnd. - if (xStart == xEnd && !aClockwise) { - xStart += 0.125; // Offset xStart by 1/80 of a pixel. Use something - // that can be represented in binary - } - - var p = getCoords(this, aX, aY); - var pStart = getCoords(this, xStart, yStart); - var pEnd = getCoords(this, xEnd, yEnd); - - this.currentPath_.push({type: arcType, - x: p.x, - y: p.y, - radius: aRadius, - xStart: pStart.x, - yStart: pStart.y, - xEnd: pEnd.x, - yEnd: pEnd.y}); - - }; - - contextPrototype.rect = function(aX, aY, aWidth, aHeight) { - this.moveTo(aX, aY); - this.lineTo(aX + aWidth, aY); - this.lineTo(aX + aWidth, aY + aHeight); - this.lineTo(aX, aY + aHeight); - this.closePath(); - }; - - contextPrototype.strokeRect = function(aX, aY, aWidth, aHeight) { - var oldPath = this.currentPath_; - this.beginPath(); - - this.moveTo(aX, aY); - this.lineTo(aX + aWidth, aY); - this.lineTo(aX + aWidth, aY + aHeight); - this.lineTo(aX, aY + aHeight); - this.closePath(); - this.stroke(); - - this.currentPath_ = oldPath; - }; - - contextPrototype.fillRect = function(aX, aY, aWidth, aHeight) { - var oldPath = this.currentPath_; - this.beginPath(); - - this.moveTo(aX, aY); - this.lineTo(aX + aWidth, aY); - this.lineTo(aX + aWidth, aY + aHeight); - this.lineTo(aX, aY + aHeight); - this.closePath(); - this.fill(); - - this.currentPath_ = oldPath; - }; - - contextPrototype.createLinearGradient = function(aX0, aY0, aX1, aY1) { - var gradient = new CanvasGradient_('gradient'); - gradient.x0_ = aX0; - gradient.y0_ = aY0; - gradient.x1_ = aX1; - gradient.y1_ = aY1; - return gradient; - }; - - contextPrototype.createRadialGradient = function(aX0, aY0, aR0, - aX1, aY1, aR1) { - var gradient = new CanvasGradient_('gradientradial'); - gradient.x0_ = aX0; - gradient.y0_ = aY0; - gradient.r0_ = aR0; - gradient.x1_ = aX1; - gradient.y1_ = aY1; - gradient.r1_ = aR1; - return gradient; - }; - - contextPrototype.drawImage = function(image, var_args) { - var dx, dy, dw, dh, sx, sy, sw, sh; - - // to find the original width we overide the width and height - var oldRuntimeWidth = image.runtimeStyle.width; - var oldRuntimeHeight = image.runtimeStyle.height; - image.runtimeStyle.width = 'auto'; - image.runtimeStyle.height = 'auto'; - - // get the original size - var w = image.width; - var h = image.height; - - // and remove overides - image.runtimeStyle.width = oldRuntimeWidth; - image.runtimeStyle.height = oldRuntimeHeight; - - if (arguments.length == 3) { - dx = arguments[1]; - dy = arguments[2]; - sx = sy = 0; - sw = dw = w; - sh = dh = h; - } else if (arguments.length == 5) { - dx = arguments[1]; - dy = arguments[2]; - dw = arguments[3]; - dh = arguments[4]; - sx = sy = 0; - sw = w; - sh = h; - } else if (arguments.length == 9) { - sx = arguments[1]; - sy = arguments[2]; - sw = arguments[3]; - sh = arguments[4]; - dx = arguments[5]; - dy = arguments[6]; - dw = arguments[7]; - dh = arguments[8]; - } else { - throw Error('Invalid number of arguments'); - } - - var d = getCoords(this, dx, dy); - - var w2 = sw / 2; - var h2 = sh / 2; - - var vmlStr = []; - - var W = 10; - var H = 10; - - var scaleX = scaleY = 1; - - // For some reason that I've now forgotten, using divs didn't work - vmlStr.push(' '); - - // Draw a special cropping div if needed - if (sx || sy) { - // Apply scales to width and height - vmlStr.push('
'); - } - - - // Apply scales to width and height - vmlStr.push('
'); - - // Close the crop div if necessary - if (sx || sy) vmlStr.push('
'); - - vmlStr.push('
'); - - this.element_.insertAdjacentHTML('BeforeEnd', vmlStr.join('')); - }; - - contextPrototype.stroke = function(aFill) { - var lineStr = []; - var lineOpen = false; - - var W = 10; - var H = 10; - - lineStr.push(''); - - if (!aFill) { - appendStroke(this, lineStr); - } else { - appendFill(this, lineStr, min, max); - } - - lineStr.push(''); - - this.element_.insertAdjacentHTML('beforeEnd', lineStr.join('')); - }; - - function appendStroke(ctx, lineStr) { - var a = processStyle(ctx.strokeStyle); - var color = a.color; - var opacity = a.alpha * ctx.globalAlpha; - var lineWidth = ctx.lineScale_ * ctx.lineWidth; - - // VML cannot correctly render a line if the width is less than 1px. - // In that case, we dilute the color to make the line look thinner. - if (lineWidth < 1) { - opacity *= lineWidth; - } - - lineStr.push( - '' - ); - } - - function appendFill(ctx, lineStr, min, max) { - var fillStyle = ctx.fillStyle; - var arcScaleX = ctx.arcScaleX_; - var arcScaleY = ctx.arcScaleY_; - var width = max.x - min.x; - var height = max.y - min.y; - if (fillStyle instanceof CanvasGradient_) { - // TODO: Gradients transformed with the transformation matrix. - var angle = 0; - var focus = {x: 0, y: 0}; - - // additional offset - var shift = 0; - // scale factor for offset - var expansion = 1; - - if (fillStyle.type_ == 'gradient') { - var x0 = fillStyle.x0_ / arcScaleX; - var y0 = fillStyle.y0_ / arcScaleY; - var x1 = fillStyle.x1_ / arcScaleX; - var y1 = fillStyle.y1_ / arcScaleY; - var p0 = getCoords(ctx, x0, y0); - var p1 = getCoords(ctx, x1, y1); - var dx = p1.x - p0.x; - var dy = p1.y - p0.y; - angle = Math.atan2(dx, dy) * 180 / Math.PI; - - // The angle should be a non-negative number. - if (angle < 0) { - angle += 360; - } - - // Very small angles produce an unexpected result because they are - // converted to a scientific notation string. - if (angle < 1e-6) { - angle = 0; - } - } else { - var p0 = getCoords(ctx, fillStyle.x0_, fillStyle.y0_); - focus = { - x: (p0.x - min.x) / width, - y: (p0.y - min.y) / height - }; - - width /= arcScaleX * Z; - height /= arcScaleY * Z; - var dimension = m.max(width, height); - shift = 2 * fillStyle.r0_ / dimension; - expansion = 2 * fillStyle.r1_ / dimension - shift; - } - - // We need to sort the color stops in ascending order by offset, - // otherwise IE won't interpret it correctly. - var stops = fillStyle.colors_; - stops.sort(function(cs1, cs2) { - return cs1.offset - cs2.offset; - }); - - var length = stops.length; - var color1 = stops[0].color; - var color2 = stops[length - 1].color; - var opacity1 = stops[0].alpha * ctx.globalAlpha; - var opacity2 = stops[length - 1].alpha * ctx.globalAlpha; - - var colors = []; - for (var i = 0; i < length; i++) { - var stop = stops[i]; - colors.push(stop.offset * expansion + shift + ' ' + stop.color); - } - - // When colors attribute is used, the meanings of opacity and o:opacity2 - // are reversed. - lineStr.push(''); - } else if (fillStyle instanceof CanvasPattern_) { - if (width && height) { - var deltaLeft = -min.x; - var deltaTop = -min.y; - lineStr.push(''); - } - } else { - var a = processStyle(ctx.fillStyle); - var color = a.color; - var opacity = a.alpha * ctx.globalAlpha; - lineStr.push(''); - } - } - - contextPrototype.fill = function() { - this.stroke(true); - }; - - contextPrototype.closePath = function() { - this.currentPath_.push({type: 'close'}); - }; - - function getCoords(ctx, aX, aY) { - var m = ctx.m_; - return { - x: Z * (aX * m[0][0] + aY * m[1][0] + m[2][0]) - Z2, - y: Z * (aX * m[0][1] + aY * m[1][1] + m[2][1]) - Z2 - }; - }; - - contextPrototype.save = function() { - var o = {}; - copyState(this, o); - this.aStack_.push(o); - this.mStack_.push(this.m_); - this.m_ = matrixMultiply(createMatrixIdentity(), this.m_); - }; - - contextPrototype.restore = function() { - if (this.aStack_.length) { - copyState(this.aStack_.pop(), this); - this.m_ = this.mStack_.pop(); - } - }; - - function matrixIsFinite(m) { - return isFinite(m[0][0]) && isFinite(m[0][1]) && - isFinite(m[1][0]) && isFinite(m[1][1]) && - isFinite(m[2][0]) && isFinite(m[2][1]); - } - - function setM(ctx, m, updateLineScale) { - if (!matrixIsFinite(m)) { - return; - } - ctx.m_ = m; - - if (updateLineScale) { - // Get the line scale. - // Determinant of this.m_ means how much the area is enlarged by the - // transformation. So its square root can be used as a scale factor - // for width. - var det = m[0][0] * m[1][1] - m[0][1] * m[1][0]; - ctx.lineScale_ = sqrt(abs(det)); - } - } - - contextPrototype.translate = function(aX, aY) { - var m1 = [ - [1, 0, 0], - [0, 1, 0], - [aX, aY, 1] - ]; - - setM(this, matrixMultiply(m1, this.m_), false); - }; - - contextPrototype.rotate = function(aRot) { - var c = mc(aRot); - var s = ms(aRot); - - var m1 = [ - [c, s, 0], - [-s, c, 0], - [0, 0, 1] - ]; - - setM(this, matrixMultiply(m1, this.m_), false); - }; - - contextPrototype.scale = function(aX, aY) { - this.arcScaleX_ *= aX; - this.arcScaleY_ *= aY; - var m1 = [ - [aX, 0, 0], - [0, aY, 0], - [0, 0, 1] - ]; - - setM(this, matrixMultiply(m1, this.m_), true); - }; - - contextPrototype.transform = function(m11, m12, m21, m22, dx, dy) { - var m1 = [ - [m11, m12, 0], - [m21, m22, 0], - [dx, dy, 1] - ]; - - setM(this, matrixMultiply(m1, this.m_), true); - }; - - contextPrototype.setTransform = function(m11, m12, m21, m22, dx, dy) { - var m = [ - [m11, m12, 0], - [m21, m22, 0], - [dx, dy, 1] - ]; - - setM(this, m, true); - }; - - /** - * The text drawing function. - * The maxWidth argument isn't taken in account, since no browser supports - * it yet. - */ - contextPrototype.drawText_ = function(text, x, y, maxWidth, stroke) { - var m = this.m_, - delta = 1000, - left = 0, - right = delta, - offset = {x: 0, y: 0}, - lineStr = []; - - var fontStyle = getComputedStyle(processFontStyle(this.font), - this.element_); - - var fontStyleString = buildStyle(fontStyle); - - var elementStyle = this.element_.currentStyle; - var textAlign = this.textAlign.toLowerCase(); - switch (textAlign) { - case 'left': - case 'center': - case 'right': - break; - case 'end': - textAlign = elementStyle.direction == 'ltr' ? 'right' : 'left'; - break; - case 'start': - textAlign = elementStyle.direction == 'rtl' ? 'right' : 'left'; - break; - default: - textAlign = 'left'; - } - - // 1.75 is an arbitrary number, as there is no info about the text baseline - switch (this.textBaseline) { - case 'hanging': - case 'top': - offset.y = fontStyle.size / 1.75; - break; - case 'middle': - break; - default: - case null: - case 'alphabetic': - case 'ideographic': - case 'bottom': - offset.y = -fontStyle.size / 2.25; - break; - } - - switch(textAlign) { - case 'right': - left = delta; - right = 0.05; - break; - case 'center': - left = right = delta / 2; - break; - } - - var d = getCoords(this, x + offset.x, y + offset.y); - - lineStr.push(''); - - if (stroke) { - appendStroke(this, lineStr); - } else { - // TODO: Fix the min and max params. - appendFill(this, lineStr, {x: -left, y: 0}, - {x: right, y: fontStyle.size}); - } - - var skewM = m[0][0].toFixed(3) + ',' + m[1][0].toFixed(3) + ',' + - m[0][1].toFixed(3) + ',' + m[1][1].toFixed(3) + ',0,0'; - - var skewOffset = mr(d.x / Z) + ',' + mr(d.y / Z); - - lineStr.push('', - '', - ''); - - this.element_.insertAdjacentHTML('beforeEnd', lineStr.join('')); - }; - - contextPrototype.fillText = function(text, x, y, maxWidth) { - this.drawText_(text, x, y, maxWidth, false); - }; - - contextPrototype.strokeText = function(text, x, y, maxWidth) { - this.drawText_(text, x, y, maxWidth, true); - }; - - contextPrototype.measureText = function(text) { - if (!this.textMeasureEl_) { - var s = ''; - this.element_.insertAdjacentHTML('beforeEnd', s); - this.textMeasureEl_ = this.element_.lastChild; - } - var doc = this.element_.ownerDocument; - this.textMeasureEl_.innerHTML = ''; - this.textMeasureEl_.style.font = this.font; - // Don't use innerHTML or innerText because they allow markup/whitespace. - this.textMeasureEl_.appendChild(doc.createTextNode(text)); - return {width: this.textMeasureEl_.offsetWidth}; - }; - - /******** STUBS ********/ - contextPrototype.clip = function() { - // TODO: Implement - }; - - contextPrototype.arcTo = function() { - // TODO: Implement - }; - - contextPrototype.createPattern = function(image, repetition) { - return new CanvasPattern_(image, repetition); - }; - - // Gradient / Pattern Stubs - function CanvasGradient_(aType) { - this.type_ = aType; - this.x0_ = 0; - this.y0_ = 0; - this.r0_ = 0; - this.x1_ = 0; - this.y1_ = 0; - this.r1_ = 0; - this.colors_ = []; - } - - CanvasGradient_.prototype.addColorStop = function(aOffset, aColor) { - aColor = processStyle(aColor); - this.colors_.push({offset: aOffset, - color: aColor.color, - alpha: aColor.alpha}); - }; - - function CanvasPattern_(image, repetition) { - assertImageIsValid(image); - switch (repetition) { - case 'repeat': - case null: - case '': - this.repetition_ = 'repeat'; - break - case 'repeat-x': - case 'repeat-y': - case 'no-repeat': - this.repetition_ = repetition; - break; - default: - throwException('SYNTAX_ERR'); - } - - this.src_ = image.src; - this.width_ = image.width; - this.height_ = image.height; - } - - function throwException(s) { - throw new DOMException_(s); - } - - function assertImageIsValid(img) { - if (!img || img.nodeType != 1 || img.tagName != 'IMG') { - throwException('TYPE_MISMATCH_ERR'); - } - if (img.readyState != 'complete') { - throwException('INVALID_STATE_ERR'); - } - } - - function DOMException_(s) { - this.code = this[s]; - this.message = s +': DOM Exception ' + this.code; - } - var p = DOMException_.prototype = new Error; - p.INDEX_SIZE_ERR = 1; - p.DOMSTRING_SIZE_ERR = 2; - p.HIERARCHY_REQUEST_ERR = 3; - p.WRONG_DOCUMENT_ERR = 4; - p.INVALID_CHARACTER_ERR = 5; - p.NO_DATA_ALLOWED_ERR = 6; - p.NO_MODIFICATION_ALLOWED_ERR = 7; - p.NOT_FOUND_ERR = 8; - p.NOT_SUPPORTED_ERR = 9; - p.INUSE_ATTRIBUTE_ERR = 10; - p.INVALID_STATE_ERR = 11; - p.SYNTAX_ERR = 12; - p.INVALID_MODIFICATION_ERR = 13; - p.NAMESPACE_ERR = 14; - p.INVALID_ACCESS_ERR = 15; - p.VALIDATION_ERR = 16; - p.TYPE_MISMATCH_ERR = 17; - - // set up externs - G_vmlCanvasManager = G_vmlCanvasManager_; - CanvasRenderingContext2D = CanvasRenderingContext2D_; - CanvasGradient = CanvasGradient_; - CanvasPattern = CanvasPattern_; - DOMException = DOMException_; -})(); - -} // if -else { // make the canvas test simple by kener.linfeng@gmail.com - G_vmlCanvasManager = false; -} -return G_vmlCanvasManager; -}); // define; -/** - * zrender: 公共辅助函数 - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * clone:深度克隆 - * merge:合并源对象的属性到目标对象 - * getContext:获取一个自由使用的canvas 2D context,使用原生方法,如isPointInPath,measureText等 - */ -define( - 'zrender/tool/util',['require','../lib/excanvas'],function(require) { - // 用于处理merge时无法遍历Date等对象的问题 - var BUILTIN_OBJECT = { - '[object Function]': 1, - '[object RegExp]': 1, - '[object Date]': 1, - '[object Error]': 1, - '[object CanvasGradient]': 1 - }; - - /** - * 对一个object进行深度拷贝 - * - * @param {Any} source 需要进行拷贝的对象 - * @return {Any} 拷贝后的新对象 - */ - function clone(source) { - if (typeof source == 'object' && source !== null) { - var result = source; - if (source instanceof Array) { - result = []; - for (var i = 0, len = source.length; i < len; i++) { - result[i] = clone(source[i]); - } - } - else if (!BUILTIN_OBJECT[Object.prototype.toString.call(source)]) { - result = {}; - for (var key in source) { - if (source.hasOwnProperty(key)) { - result[key] = clone(source[key]); - } - } - } - - return result; - } - - return source; - } - - function mergeItem(target, source, key, overwrite) { - if (source.hasOwnProperty(key)) { - if (typeof target[key] == 'object' - && !BUILTIN_OBJECT[ Object.prototype.toString.call(target[key]) ] - ) { - // 如果需要递归覆盖,就递归调用merge - merge( - target[key], - source[key], - overwrite - ); - } - else if (overwrite || !(key in target)) { - // 否则只处理overwrite为true,或者在目标对象中没有此属性的情况 - target[key] = source[key]; - } - } - } - - /** - * 合并源对象的属性到目标对象 - * modify from Tangram - * @param {*} target 目标对象 - * @param {*} source 源对象 - * @param {boolean} overwrite 是否覆盖 - */ - function merge(target, source, overwrite) { - for (var i in source) { - mergeItem(target, source, i, overwrite); - } - - return target; - } - - var _ctx; - - function getContext() { - if (!_ctx) { - require('../lib/excanvas'); - if (G_vmlCanvasManager) { - var _div = document.createElement('div'); - _div.style.position = 'absolute'; - _div.style.top = '-1000px'; - document.body.appendChild(_div); - - _ctx = G_vmlCanvasManager.initElement(_div) - .getContext('2d'); - } - else { - _ctx = document.createElement('canvas').getContext('2d'); - } - } - return _ctx; - } - - var _canvas; - var _pixelCtx; - var _width; - var _height; - var _offsetX = 0; - var _offsetY = 0; - - /** - * 获取像素拾取专用的上下文 - * @return {Object} 上下文 - */ - function getPixelContext() { - if (!_pixelCtx) { - _canvas = document.createElement('canvas'); - _width = _canvas.width; - _height = _canvas.height; - _pixelCtx = _canvas.getContext('2d'); - } - return _pixelCtx; - } - - /** - * 如果坐标处在_canvas外部,改变_canvas的大小 - * @param {number} x : 横坐标 - * @param {number} y : 纵坐标 - * 注意 修改canvas的大小 需要重新设置translate - */ - function adjustCanvasSize(x, y) { - // 每次加的长度 - var _v = 100; - var _flag; - - if (x + _offsetX > _width) { - _width = x + _offsetX + _v; - _canvas.width = _width; - _flag = true; - } - - if (y + _offsetY > _height) { - _height = y + _offsetY + _v; - _canvas.height = _height; - _flag = true; - } - - if (x < -_offsetX) { - _offsetX = Math.ceil(-x / _v) * _v; - _width += _offsetX; - _canvas.width = _width; - _flag = true; - } - - if (y < -_offsetY) { - _offsetY = Math.ceil(-y / _v) * _v; - _height += _offsetY; - _canvas.height = _height; - _flag = true; - } - - if (_flag) { - _pixelCtx.translate(_offsetX, _offsetY); - } - } - - /** - * 获取像素canvas的偏移量 - * @return {Object} 偏移量 - */ - function getPixelOffset() { - return { - x : _offsetX, - y : _offsetY - }; - } - - /** - * 查询数组中元素的index - */ - function indexOf(array, value){ - if (array.indexOf) { - return array.indexOf(value); - } - for(var i = 0, len=array.length; i 3) { - args = Array.prototype.slice.call(args, 1); - } - - if(this._handlers[type]) { - var _h = this._handlers[type]; - var len = _h.length; - for (var i = 0; i < len;) { - // Optimize advise from backbone - switch (argLen) { - case 1: - _h[i]['h'].call(_h[i]['ctx']); - break; - case 2: - _h[i]['h'].call(_h[i]['ctx'], args[1]); - break; - case 3: - _h[i]['h'].call(_h[i]['ctx'], args[1], args[2]); - break; - default: - // have more than 2 given arguments - _h[i]['h'].apply(_h[i]['ctx'], args); - break; - } - - if (_h[i]['one']) { - _h.splice(i, 1); - len--; - } else { - i++; - } - } - } - - return this; - }; - - /** - * 带有context的事件分发, 最后一个参数是事件回调的context - * - * @param {string} type : 事件类型 - */ - Dispatcher.prototype.dispatchWithContext = function(type) { - var args = arguments; - var argLen = args.length; - - if (argLen > 4) { - args = Array.prototype.slice.call(args, 1, args.length - 1); - } - var ctx = args[args.length - 1]; - - if(this._handlers[type]) { - var _h = this._handlers[type]; - var len = _h.length; - for (var i = 0; i < len;) { - // Optimize advise from backbone - switch (argLen) { - case 1: - _h[i]['h'].call(ctx); - break; - case 2: - _h[i]['h'].call(ctx, args[1]); - break; - case 3: - _h[i]['h'].call(ctx, args[1], args[2]); - break; - default: - // have more than 2 given arguments - _h[i]['h'].apply(ctx, args); - break; - } - - if (_h[i]['one']) { - _h.splice(i, 1); - len--; - } else { - i++; - } - } - } - - return this; - }; - - return { - getX : getX, - getY : getY, - getDelta : getDelta, - stop : stop, - Dispatcher : Dispatcher - }; - } -); - -/** - * echarts设备环境识别 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author firede[firede@firede.us] - * @desc thanks zepto. - */ -define('zrender/tool/env',[],function() { - // Zepto.js - // (c) 2010-2013 Thomas Fuchs - // Zepto.js may be freely distributed under the MIT license. - - function detect( ua ) { - var os = this.os = {}; - var browser = this.browser = {}; - var webkit = ua.match(/Web[kK]it[\/]{0,1}([\d.]+)/); - var android = ua.match(/(Android);?[\s\/]+([\d.]+)?/); - var ipad = ua.match(/(iPad).*OS\s([\d_]+)/); - var ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/); - var iphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/); - var webos = ua.match(/(webOS|hpwOS)[\s\/]([\d.]+)/); - var touchpad = webos && ua.match(/TouchPad/); - var kindle = ua.match(/Kindle\/([\d.]+)/); - var silk = ua.match(/Silk\/([\d._]+)/); - var blackberry = ua.match(/(BlackBerry).*Version\/([\d.]+)/); - var bb10 = ua.match(/(BB10).*Version\/([\d.]+)/); - var rimtabletos = ua.match(/(RIM\sTablet\sOS)\s([\d.]+)/); - var playbook = ua.match(/PlayBook/); - var chrome = ua.match(/Chrome\/([\d.]+)/) || ua.match(/CriOS\/([\d.]+)/); - var firefox = ua.match(/Firefox\/([\d.]+)/); - var ie = ua.match(/MSIE ([\d.]+)/); - var safari = webkit && ua.match(/Mobile\//) && !chrome; - var webview = ua.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/) && !chrome; - var ie = ua.match(/MSIE\s([\d.]+)/); - - // Todo: clean this up with a better OS/browser seperation: - // - discern (more) between multiple browsers on android - // - decide if kindle fire in silk mode is android or not - // - Firefox on Android doesn't specify the Android version - // - possibly devide in os, device and browser hashes - - if (browser.webkit = !!webkit) browser.version = webkit[1]; - - if (android) os.android = true, os.version = android[2]; - if (iphone && !ipod) os.ios = os.iphone = true, os.version = iphone[2].replace(/_/g, '.'); - if (ipad) os.ios = os.ipad = true, os.version = ipad[2].replace(/_/g, '.'); - if (ipod) os.ios = os.ipod = true, os.version = ipod[3] ? ipod[3].replace(/_/g, '.') : null; - if (webos) os.webos = true, os.version = webos[2]; - if (touchpad) os.touchpad = true; - if (blackberry) os.blackberry = true, os.version = blackberry[2]; - if (bb10) os.bb10 = true, os.version = bb10[2]; - if (rimtabletos) os.rimtabletos = true, os.version = rimtabletos[2]; - if (playbook) browser.playbook = true; - if (kindle) os.kindle = true, os.version = kindle[1]; - if (silk) browser.silk = true, browser.version = silk[1]; - if (!silk && os.android && ua.match(/Kindle Fire/)) browser.silk = true; - if (chrome) browser.chrome = true, browser.version = chrome[1]; - if (firefox) browser.firefox = true, browser.version = firefox[1]; - if (ie) browser.ie = true, browser.version = ie[1]; - if (safari && (ua.match(/Safari/) || !!os.ios)) browser.safari = true; - if (webview) browser.webview = true; - if (ie) browser.ie = true, browser.version = ie[1]; - - os.tablet = !!(ipad || playbook || (android && !ua.match(/Mobile/)) || - (firefox && ua.match(/Tablet/)) || (ie && !ua.match(/Phone/) && ua.match(/Touch/))); - os.phone = !!(!os.tablet && !os.ipod && (android || iphone || webos || blackberry || bb10 || - (chrome && ua.match(/Android/)) || (chrome && ua.match(/CriOS\/([\d.]+)/)) || - (firefox && ua.match(/Mobile/)) || (ie && ua.match(/Touch/)))); - - return { - browser: browser, - os: os, - // 原生canvas支持 - canvasSupported : document.createElement('canvas').getContext - ? true : false - } - } - - return detect( navigator.userAgent ); -}); -/** - * zrender: config默认配置项 - * - * @desc zrender是一个轻量级的Canvas类库,MVC封装,数据驱动,提供类Dom事件模型。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define( - 'zrender/config',{ - EVENT : { // 支持事件列表 - RESIZE : 'resize', // 窗口大小变化 - CLICK : 'click', // 鼠标按钮被(手指)按下,事件对象是:目标图形元素或空 - - MOUSEWHEEL : 'mousewheel', // 鼠标滚轮变化,事件对象是:目标图形元素或空 - MOUSEMOVE : 'mousemove', // 鼠标(手指)被移动,事件对象是:目标图形元素或空 - MOUSEOVER : 'mouseover', // 鼠标移到某图形元素之上,事件对象是:目标图形元素 - MOUSEOUT : 'mouseout', // 鼠标从某图形元素移开,事件对象是:目标图形元素 - MOUSEDOWN : 'mousedown', // 鼠标按钮(手指)被按下,事件对象是:目标图形元素或空 - MOUSEUP : 'mouseup', // 鼠标按键(手指)被松开,事件对象是:目标图形元素或空 - - // - GLOBALOUT : 'globalout', // 全局离开,MOUSEOUT触发比较频繁,一次离开优化绑定 - - // 一次成功元素拖拽的行为事件过程是: - // dragstart > dragenter > dragover [> dragleave] > drop > dragend - DRAGSTART : 'dragstart', // 开始拖拽时触发,事件对象是:被拖拽图形元素 - DRAGEND : 'dragend', // 拖拽完毕时触发(在drop之后触发),事件对象是:被拖拽图形元素 - DRAGENTER : 'dragenter', // 拖拽图形元素进入目标图形元素时触发,事件对象是:目标图形元素 - DRAGOVER : 'dragover', // 拖拽图形元素在目标图形元素上移动时触发,事件对象是:目标图形元素 - DRAGLEAVE : 'dragleave', // 拖拽图形元素离开目标图形元素时触发,事件对象是:目标图形元素 - DROP : 'drop', // 拖拽图形元素放在目标图形元素内时触发,事件对象是:目标图形元素 - - touchClickDelay : 300 // touch end - start < delay is click - }, - - // 是否异常捕获 - catchBrushException: false, - - /** - * debug日志选项:catchBrushException为true下有效 - * 0 : 不生成debug数据,发布用 - * 1 : 异常抛出,调试用 - * 2 : 控制台输出,调试用 - */ - debugMode: 0 - } -); -/** - * zrender: 日志记录 - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - */ - -define( - 'zrender/tool/log',['require','../config'],function (require) { - var config = require('../config'); - - return function() { - if (config.debugMode === 0) { - return; - } - else if (config.debugMode == 1) { - for (var k in arguments) { - throw new Error(arguments[k]); - } - } - else if (config.debugMode > 1) { - for (var k in arguments) { - console.log(arguments[k]); - } - } - }; - - /* for debug - return function(mes) { - document.getElementById('wrong-message').innerHTML = - mes + ' ' + (new Date() - 0) - + '
' - + document.getElementById('wrong-message').innerHTML; - }; - */ - } -); - -/** - * zrender: 生成唯一id - * - * @author errorrik (errorrik@gmail.com) - */ - -define( - 'zrender/tool/guid',[],function() { - var idStart = 0x0907; - - return function () { - return 'zrender__' + (idStart++); - }; - } -); - -/** - * Handler控制模块 - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * errorrik (errorrik@gmail.com) - */ - -define( - 'zrender/Handler',['require','./config','./tool/env','./tool/event','./tool/util'],function (require) { - - - - var config = require('./config'); - var env = require('./tool/env'); - var eventTool = require('./tool/event'); - var util = require('./tool/util'); - var EVENT = config.EVENT; - - var domHandlerNames = [ - 'resize', 'click', - 'mousewheel', 'mousemove', 'mouseout', 'mouseup', 'mousedown', - 'touchstart', 'touchend', 'touchmove' - ]; - - var domHandlers = { - /** - * 窗口大小改变响应函数 - * - * @param {event} event dom事件对象 - */ - resize: function (event) { - event = event || window.event; - this._lastHover = null; - this._isMouseDown = 0; - - // 分发config.EVENT.RESIZE事件,global - this.dispatch(EVENT.RESIZE, event); - }, - - /** - * 点击响应函数 - * - * @param {event} event dom事件对象 - */ - click: function (event) { - event = this._zrenderEventFixed(event); - - //分发config.EVENT.CLICK事件 - var _lastHover = this._lastHover; - if (( _lastHover && _lastHover.clickable ) - || !_lastHover - ) { - this._dispatchAgency(_lastHover, EVENT.CLICK, event); - } - - this._mousemoveHandler(event); - }, - - /** - * 鼠标滚轮响应函数 - * - * @param {event} event dom事件对象 - */ - mousewheel: function (event) { - event = this._zrenderEventFixed(event); - - //分发config.EVENT.MOUSEWHEEL事件 - this._dispatchAgency(this._lastHover, EVENT.MOUSEWHEEL, event); - this._mousemoveHandler(event); - }, - - /** - * 鼠标(手指)移动响应函数 - * - * @param {event} event dom事件对象 - */ - mousemove: function (event) { - if (this.painter.isLoading()) { - return; - } - - event = this._zrenderEventFixed(event); - this._lastX = this._mouseX; - this._lastY = this._mouseY; - this._mouseX = eventTool.getX(event); - this._mouseY = eventTool.getY(event); - - // 可能出现config.EVENT.DRAGSTART事件 - // 避免手抖点击误认为拖拽 - //if (this._mouseX - this._lastX > 1 || this._mouseY - this._lastY > 1) { - this._processDragStart(event); - //} - this._hasfound = 0; - this._event = event; - this.storage.iterShape(this._findHover, { normal: 'down'}); - - // 找到的在迭代函数里做了处理,没找到得在迭代完后处理 - if (!this._hasfound) { - // 过滤首次拖拽产生的mouseout和dragLeave - if (!this._draggingTarget - || (this._lastHover && this._lastHover != this._draggingTarget) - ) { - // 可能出现config.EVENT.MOUSEOUT事件 - this._processOutShape(event); - - // 可能出现config.EVENT.DRAGLEAVE事件 - this._processDragLeave(event); - } - - this._lastHover = null; - this.storage.delHover(); - this.painter.clearHover(); - } - //如果存在拖拽中元素,被拖拽的图形元素最后addHover - if (this._draggingTarget) { - this.storage.drift( - this._draggingTarget.id, - this._mouseX - this._lastX, - this._mouseY - this._lastY - ); - this.storage.addHover(this._draggingTarget); - } - - // set cursor for root element - var cursor = 'default'; - if (this._draggingTarget || (this._hasfound && this._lastHover.draggable)) { - cursor = 'move'; - } - else if (this._hasfound && this._lastHover.clickable) { - cursor = 'pointer'; - } - this.root.style.cursor = cursor; - - // 分发config.EVENT.MOUSEMOVE事件 - this._dispatchAgency(this._lastHover, EVENT.MOUSEMOVE, event); - - if (this._draggingTarget || this._hasfound || this.storage.hasHoverShape()) { - this.painter.refreshHover(); - } - }, - - /** - * 鼠标(手指)离开响应函数 - * - * @param {event} event dom事件对象 - */ - mouseout: function (event) { - event = this._zrenderEventFixed(event); - - var element = event.toElement || event.relatedTarget; - if (element != this.root) { - while (element && element.nodeType != 9) { - // 忽略包含在root中的dom引起的mouseOut - if (element == this.root) { - this._mousemoveHandler(event); - return; - } - - element = element.parentNode; - } - } - - event.zrenderX = this._lastX; - event.zrenderY = this._lastY; - this.root.style.cursor = 'default'; - this._isMouseDown = 0; - - this._processOutShape(event); - this._processDrop(event); - this._processDragEnd(event); - if (!this.painter.isLoading()) { - this.painter.refreshHover(); - } - - this.dispatch(EVENT.GLOBALOUT, event); - }, - - /** - * 鼠标(手指)按下响应函数 - * - * @param {event} event dom事件对象 - */ - mousedown: function (event) { - if (this._lastDownButton == 2) { - this._lastDownButton = event.button; - this._mouseDownTarget = null; - // 仅作为关闭右键菜单使用 - return; - } - - this._lastMouseDownMoment = new Date(); - event = this._zrenderEventFixed(event); - this._isMouseDown = 1; - - //分发config.EVENT.MOUSEDOWN事件 - this._mouseDownTarget = this._lastHover; - this._dispatchAgency(this._lastHover, EVENT.MOUSEDOWN, event); - this._lastDownButton = event.button; - }, - - /** - * 鼠标(手指)抬起响应函数 - * - * @param {event} event dom事件对象 - */ - mouseup:function (event) { - event = this._zrenderEventFixed(event); - this.root.style.cursor = 'default'; - this._isMouseDown = 0; - this._mouseDownTarget = null; - - //分发config.EVENT.MOUSEUP事件 - this._dispatchAgency(this._lastHover, EVENT.MOUSEUP, event); - this._processDrop(event); - this._processDragEnd(event); - }, - - /** - * Touch开始响应函数 - * - * @param {event} event dom事件对象 - */ - touchstart: function (event) { - //eventTool.stop(event);// 阻止浏览器默认事件,重要 - event = this._zrenderEventFixed(event, true); - this._lastTouchMoment = new Date(); - - //平板补充一次findHover - this._mobildFindFixed(event); - this._mousedownHandler(event); - }, - - /** - * Touch移动响应函数 - * - * @param {event} event dom事件对象 - */ - touchmove: function (event) { - event = this._zrenderEventFixed(event, true); - this._mousemoveHandler(event); - if (this._isDragging) { - eventTool.stop(event);// 阻止浏览器默认事件,重要 - } - }, - - /** - * Touch结束响应函数 - * - * @param {event} event dom事件对象 - */ - touchend: function (event) { - //eventTool.stop(event);// 阻止浏览器默认事件,重要 - event = this._zrenderEventFixed(event, true); - this._mouseupHandler(event); - - if (new Date() - this._lastTouchMoment < EVENT.touchClickDelay) { - this._mobildFindFixed(event); - this._clickHandler(event); - } - this.painter.clearHover(); - } - }; - - /** - * bind一个参数的function - * - * @inner - * @param {Function} handler 要bind的function - * @param {Object} context 运行时this环境 - * @return {Function} - */ - function bind1Arg( handler, context ) { - return function ( e ) { - return handler.call( context, e ); - }; - } - - /** - * 为控制类实例初始化dom 事件处理函数 - * - * @inner - * @param {Handler} instance 控制类实例 - */ - function initDomHandler( instance ) { - var len = domHandlerNames.length; - while ( len-- ) { - var name = domHandlerNames[ len ]; - instance[ '_' + name + 'Handler' ] = bind1Arg( domHandlers[ name ], instance ); - } - } - - /** - * 控制类 (C) - * - * @param {HTMLElement} root 绘图区域 - * @param {storage} storage Storage实例 - * @param {painter} painter Painter实例 - * - * 分发事件支持详见config.EVENT - */ - function Handler(root, storage, painter) { - // 添加事件分发器特性 - eventTool.Dispatcher.call(this); - - this.root = root; - this.storage = storage; - this.painter = painter; - - // 各种事件标识的私有变量 - // this._hasfound = false; //是否找到hover图形元素 - // this._lastHover = null; //最后一个hover图形元素 - // this._mouseDownTarget = null; - // this._draggingTarget = null; //当前被拖拽的图形元素 - // this._isMouseDown = false; - // this._isDragging = false; - // this._lastMouseDownMoment; - // this._lastTouchMoment; - // this._lastDownButton; - - this._lastX = - this._lastY = - this._mouseX = - this._mouseY = 0; - - this._findHover = bind1Arg(findHover, this); - this._domHover = painter.getDomHover(); - initDomHandler(this); - - // 初始化,事件绑定,支持的所有事件都由如下原生事件计算得来 - if (window.addEventListener) { - window.addEventListener('resize', this._resizeHandler); - - if (env.os.tablet || env.os.phone) { - // mobile支持 - root.addEventListener('touchstart', this._touchstartHandler); - root.addEventListener('touchmove', this._touchmoveHandler); - root.addEventListener('touchend', this._touchendHandler); - } - else { - // mobile的click/move/up/down自己模拟 - root.addEventListener('click', this._clickHandler); - root.addEventListener('mousewheel', this._mousewheelHandler); - root.addEventListener('mousemove', this._mousemoveHandler); - root.addEventListener('mousedown', this._mousedownHandler); - root.addEventListener('mouseup', this._mouseupHandler); - } - root.addEventListener('DOMMouseScroll', this._mousewheelHandler); - root.addEventListener('mouseout', this._mouseoutHandler); - } - else { - window.attachEvent('onresize', this._resizeHandler); - - root.attachEvent('onclick', this._clickHandler); - root.attachEvent('onmousewheel', this._mousewheelHandler); - root.attachEvent('onmousemove', this._mousemoveHandler); - root.attachEvent('onmouseout', this._mouseoutHandler); - root.attachEvent('onmousedown', this._mousedownHandler); - root.attachEvent('onmouseup', this._mouseupHandler); - } - } - - /** - * 自定义事件绑定 - * @param {string} eventName 事件名称,resize,hover,drag,etc~ - * @param {Function} handler 响应函数 - */ - Handler.prototype.on = function (eventName, handler) { - this.bind(eventName, handler); - return this; - }; - - /** - * 自定义事件解绑 - * @param {string} eventName 事件名称,resize,hover,drag,etc~ - * @param {Function} handler 响应函数 - */ - Handler.prototype.un = function (eventName, handler) { - this.unbind(eventName, handler); - return this; - }; - - /** - * 事件触发 - * @param {string} eventName 事件名称,resize,hover,drag,etc~ - * @param {event=} eventArgs event dom事件对象 - */ - Handler.prototype.trigger = function (eventName, eventArgs) { - switch (eventName) { - case EVENT.RESIZE: - case EVENT.CLICK: - case EVENT.MOUSEWHEEL: - case EVENT.MOUSEMOVE: - case EVENT.MOUSEDOWN: - case EVENT.MOUSEUP: - case EVENT.MOUSEOUT: - this['_' + eventName + 'Handler'](eventArgs); - break; - } - }; - - /** - * 释放 - */ - Handler.prototype.dispose = function () { - var root = this.root; - - if (window.removeEventListener) { - window.removeEventListener('resize', this._resizeHandler); - - if (env.os.tablet || env.os.phone) { - // mobile支持 - root.removeEventListener('touchstart', this._touchstartHandler); - root.removeEventListener('touchmove', this._touchmoveHandler); - root.removeEventListener('touchend', this._touchendHandler); - } - else { - // mobile的click自己模拟 - root.removeEventListener('click', this._clickHandler); - root.removeEventListener('mousewheel', this._mousewheelHandler); - root.removeEventListener('mousemove', this._mousemoveHandler); - root.removeEventListener('mousedown', this._mousedownHandler); - root.removeEventListener('mouseup', this._mouseupHandler); - } - root.removeEventListener('DOMMouseScroll', this._mousewheelHandler); - root.removeEventListener('mouseout', this._mouseoutHandler); - } - else { - window.detachEvent('onresize', this._resizeHandler); - - root.detachEvent('onclick', this._clickHandler); - root.detachEvent('onmousewheel', this._mousewheelHandler); - root.detachEvent('onmousemove', this._mousemoveHandler); - root.detachEvent('onmouseout', this._mouseoutHandler); - root.detachEvent('onmousedown', this._mousedownHandler); - root.detachEvent('onmouseup', this._mouseupHandler); - } - - this.root = - this._domHover = - this.storage = - this.painter = null; - - this.un(); - }; - - /** - * 拖拽开始 - * - * @private - * @param {Object} event 事件对象 - */ - Handler.prototype._processDragStart = function (event) { - var _lastHover = this._lastHover; - - if (this._isMouseDown - && _lastHover - && _lastHover.draggable - && !this._draggingTarget - && this._mouseDownTarget == _lastHover - ) { - // 拖拽点击生效时长阀门,某些场景需要降低拖拽敏感度 - if (_lastHover.dragEnableTime && - new Date() - this._lastMouseDownMoment < _lastHover.dragEnableTime - ) { - return; - } - - var _draggingTarget = _lastHover; - this._draggingTarget = _draggingTarget; - this._isDragging = 1; - - _draggingTarget.invisible = true; - this.storage.mod(_draggingTarget.id); - - //分发config.EVENT.DRAGSTART事件 - this._dispatchAgency( - _draggingTarget, - EVENT.DRAGSTART, - event - ); - this.painter.refresh(); - } - }; - - /** - * 拖拽进入目标元素 - * - * @private - * @param {Object} event 事件对象 - */ - Handler.prototype._processDragEnter = function (event) { - if (this._draggingTarget) { - //分发config.EVENT.DRAGENTER事件 - this._dispatchAgency( - this._lastHover, - EVENT.DRAGENTER, - event, - this._draggingTarget - ); - } - }; - - /** - * 拖拽在目标元素上移动 - * - * @private - * @param {Object} event 事件对象 - */ - Handler.prototype._processDragOver = function (event) { - if (this._draggingTarget) { - //分发config.EVENT.DRAGOVER事件 - this._dispatchAgency( - this._lastHover, - EVENT.DRAGOVER, - event, - this._draggingTarget - ); - } - }; - - /** - * 拖拽离开目标元素 - * - * @private - * @param {Object} event 事件对象 - */ - Handler.prototype._processDragLeave = function (event) { - if (this._draggingTarget) { - //分发config.EVENT.DRAGLEAVE事件 - this._dispatchAgency( - this._lastHover, - EVENT.DRAGLEAVE, - event, - this._draggingTarget - ); - } - }; - - /** - * 拖拽在目标元素上完成 - * - * @private - * @param {Object} event 事件对象 - */ - Handler.prototype._processDrop = function (event) { - if (this._draggingTarget) { - this._draggingTarget.invisible = false; - this.storage.mod(this._draggingTarget.id); - this.painter.refresh(); - - //分发config.EVENT.DROP事件 - this._dispatchAgency( - this._lastHover, - EVENT.DROP, - event, - this._draggingTarget - ); - } - }; - - /** - * 拖拽结束 - * - * @private - * @param {Object} event 事件对象 - */ - Handler.prototype._processDragEnd = function (event) { - if (this._draggingTarget) { - //分发config.EVENT.DRAGEND事件 - this._dispatchAgency( - this._draggingTarget, - EVENT.DRAGEND, - event - ); - - this._lastHover = null; - } - - this._isDragging = 0; - this._draggingTarget = null; - }; - - /** - * 鼠标在某个图形元素上移动 - * - * @private - * @param {Object} event 事件对象 - */ - Handler.prototype._processOverShape = function (event) { - //分发config.EVENT.MOUSEOVER事件 - this._dispatchAgency(this._lastHover, EVENT.MOUSEOVER, event); - }; - - /** - * 鼠标离开某个图形元素 - * - * @private - * @param {Object} event 事件对象 - */ - Handler.prototype._processOutShape = function (event) { - //分发config.EVENT.MOUSEOUT事件 - this._dispatchAgency(this._lastHover, EVENT.MOUSEOUT, event); - }; - - /** - * 事件分发代理 - * - * @private - * @param {Object} targetShape 目标图形元素 - * @param {string} eventName 事件名称 - * @param {Object} event 事件对象 - * @param {Object=} draggedShape 拖拽事件特有,当前被拖拽图形元素 - */ - Handler.prototype._dispatchAgency = function (targetShape, eventName, event, draggedShape) { - var eventHandler = 'on' + eventName; - var eventPacket = { - type : eventName, - event : event, - target : targetShape, - cancelBubble: false - }; - - var el = targetShape; - - if (draggedShape) { - eventPacket.dragged = draggedShape; - } - - while (el) { - el[eventHandler] && el[eventHandler](eventPacket); - el.dispatch(eventName, eventPacket); - - el = el.parent; - - if (eventPacket.cancelBubble) { - break; - } - } - - if (targetShape) { - // 冒泡到顶级 zrender 对象 - if (!eventPacket.cancelBubble) { - this.dispatch(eventName, eventPacket); - } - } - else if (!draggedShape) { - //无hover目标,无拖拽对象,原生事件分发 - this.dispatch(eventName, { - type: eventName, - event: event - }); - } - }; - - // touch指尖错觉的尝试偏移量配置 - var MOBILE_TOUCH_OFFSETS = [ - { x: 10 }, - { x: -20 }, - { x: 10, y: 10}, - { y: -20} - ]; - - // touch有指尖错觉,四向尝试,让touch上的点击更好触发事件 - Handler.prototype._mobildFindFixed = function (event) { - this._lastHover = null; - this._mouseX = event.zrenderX; - this._mouseY = event.zrenderY; - - this._event = event; - this.storage.iterShape(this._findHover, { normal: 'down'}); - for ( var i = 0; !this._lastHover && i < MOBILE_TOUCH_OFFSETS.length ; i++ ) { - var offset = MOBILE_TOUCH_OFFSETS[ i ]; - offset.x && ( this._mouseX += offset.x ); - offset.y && ( this._mouseX += offset.y ); - this.storage.iterShape(this._findHover, { normal: 'down'}); - } - - if (this._lastHover) { - event.zrenderX = this._mouseX; - event.zrenderY = this._mouseY; - } - }; - - /** - * 迭代函数,查找hover到的图形元素并即时做些事件分发 - * - * @private - * @param {Object} e 图形元素 - */ - function findHover(shape) { - if ( - ( this._draggingTarget && this._draggingTarget.id == shape.id ) //迭代到当前拖拽的图形上 - || shape.isSilent() // 打酱油的路过,啥都不响应的shape~ - ) { - return false; - } - - var event = this._event; - if (shape.isCover(this._mouseX, this._mouseY)) { - if (shape.hoverable) { - this.storage.addHover(shape); - } - // 查找是否在 clipShape 中 - var p = shape.parent; - while (p) { - if (p.clipShape && !p.clipShape.isCover(this._mouseX, this._mouseY)) { - // 已经被祖先 clip 掉了 - return false; - } - p = p.parent; - } - - if (this._lastHover != shape) { - this._processOutShape(event); - - //可能出现config.EVENT.DRAGLEAVE事件 - this._processDragLeave(event); - - this._lastHover = shape; - - //可能出现config.EVENT.DRAGENTER事件 - this._processDragEnter(event); - } - - this._processOverShape(event); - - //可能出现config.EVENT.DRAGOVER - this._processDragOver(event); - - this._hasfound = 1; - - return true; //找到则中断迭代查找 - } - - return false; - } - - /** - * 如果存在第三方嵌入的一些dom触发的事件,或touch事件,需要转换一下事件坐标 - * - * @private - */ - Handler.prototype._zrenderEventFixed = function (event, isTouch) { - if ( event.zrenderFixed ) { - return event; - } - - if (!isTouch) { - event = event || window.event; - // 进入对象优先~ - var target = event.toElement - || event.relatedTarget - || event.srcElement - || event.target; - - if (target && target != this._domHover) { - event.zrenderX = (typeof event.offsetX != 'undefined' - ? event.offsetX - : event.layerX) - + target.offsetLeft; - event.zrenderY = (typeof event.offsetY != 'undefined' - ? event.offsetY - : event.layerY) - + target.offsetTop; - } - } - else { - var touch = event.type != 'touchend' - ? event.targetTouches[0] - : event.changedTouches[0]; - if (touch) { - var rBounding = this.root.getBoundingClientRect(); - // touch事件坐标是全屏的~ - event.zrenderX = touch.clientX - rBounding.left; - event.zrenderY = touch.clientY - rBounding.top; - } - } - - event.zrenderFixed = 1; - return event; - }; - - util.merge(Handler.prototype, eventTool.Dispatcher.prototype, true); - - return Handler; - } -); - -/** - * zrender: 3x2矩阵操作类 - * - * author: https://github.com/pissang - */ - -define( - 'zrender/tool/matrix',[],function() { - - var ArrayCtor = typeof Float32Array === 'undefined' - ? Array - : Float32Array; - - var matrix = { - create : function() { - var out = new ArrayCtor(6); - matrix.identity(out); - - return out; - }, - identity : function(out) { - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 1; - out[4] = 0; - out[5] = 0; - }, - copy: function(out, m) { - out[0] = m[0]; - out[1] = m[1]; - out[2] = m[2]; - out[3] = m[3]; - out[4] = m[4]; - out[5] = m[5]; - }, - mul : function(out, m1, m2) { - out[0] = m1[0] * m2[0] + m1[2] * m2[1]; - out[1] = m1[1] * m2[0] + m1[3] * m2[1]; - out[2] = m1[0] * m2[2] + m1[2] * m2[3]; - out[3] = m1[1] * m2[2] + m1[3] * m2[3]; - out[4] = m1[0] * m2[4] + m1[2] * m2[5] + m1[4]; - out[5] = m1[1] * m2[4] + m1[3] * m2[5] + m1[5]; - return out; - }, - translate : function(out, a, v) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4] + v[0]; - out[5] = a[5] + v[1]; - return out; - }, - rotate : function(out, a, rad) { - var aa = a[0], ac = a[2], atx = a[4]; - var ab = a[1], ad = a[3], aty = a[5]; - var st = Math.sin(rad); - var ct = Math.cos(rad); - - out[0] = aa*ct + ab*st; - out[1] = -aa*st + ab*ct; - out[2] = ac*ct + ad*st; - out[3] = -ac*st + ct*ad; - out[4] = ct*atx + st*aty; - out[5] = ct*aty - st*atx; - return out; - }, - scale : function(out, a, v) { - var vx = v[0], vy = v[1]; - out[0] = a[0] * vx; - out[1] = a[1] * vy; - out[2] = a[2] * vx; - out[3] = a[3] * vy; - out[4] = a[4] * vx; - out[5] = a[5] * vy; - return out; - }, - /** - * 求逆矩阵 - */ - invert : function(out, a) { - - var aa = a[0], ac = a[2], atx = a[4]; - var ab = a[1], ad = a[3], aty = a[5]; - - var det = aa * ad - ab * ac; - if(!det){ - return null; - } - det = 1.0 / det; - - out[0] = ad * det; - out[1] = -ab * det; - out[2] = -ac * det; - out[3] = aa * det; - out[4] = (ac * aty - ad * atx) * det; - out[5] = (ab * atx - aa * aty) * det; - return out; - }, - - /** - * 矩阵左乘向量 - */ - mulVector : function(out, a, v) { - var aa = a[0], ac = a[2], atx = a[4]; - var ab = a[1], ad = a[3], aty = a[5]; - - out[0] = v[0] * aa + v[1] * ac + atx; - out[1] = v[0] * ab + v[1] * ad + aty; - - return out; - } - }; - - return matrix; - } -); -define('zrender/shape/mixin/Transformable',['require','../../tool/matrix'],function(require) { - - var matrix = require('../../tool/matrix'); - var origin = [0, 0]; - - var Transformable = function() { - - if (!this.position) { - this.position = [0, 0]; - } - if (typeof(this.rotation) == 'undefined') { - this.rotation = [0, 0, 0]; - } - if (!this.scale) { - this.scale = [1, 1, 0, 0]; - } - - this.needLocalTransform = false; - this.needTransform = false; - }; - - Transformable.prototype = { - - constructor: Transformable, - - updateNeedTransform: function() { - this.needLocalTransform = Math.abs(this.rotation[0]) > 0.0001 - || Math.abs(this.position[0]) > 0.0001 - || Math.abs(this.position[1]) > 0.0001 - || Math.abs(this.scale[0] - 1) > 0.0001 - || Math.abs(this.scale[1] - 1) > 0.0001; - }, - - updateTransform: function() { - - this.updateNeedTransform(); - - if (this.parent) { - this.needTransform = this.needLocalTransform || this.parent.needTransform; - } else { - this.needTransform = this.needLocalTransform; - } - - if (!this.needTransform) { - return; - } - - var m = this.transform || matrix.create(); - matrix.identity(m); - - if (this.needLocalTransform) { - if (this.scale && (this.scale[0] !== 1 || this.scale[1] !== 1)) { - origin[0] = -this.scale[2] || 0; - origin[1] = -this.scale[3] || 0; - if (origin[0] || origin[1]) { - matrix.translate( - m, m, origin - ); - } - matrix.scale(m, m, this.scale); - if (origin[0] || origin[1]) { - origin[0] = -origin[0]; - origin[1] = -origin[1]; - matrix.translate( - m, m, origin - ); - } - } - - if (this.rotation) { - if (this.rotation instanceof Array) { - if (this.rotation[0] !== 0) { - origin[0] = -this.rotation[1] || 0; - origin[1] = -this.rotation[2] || 0; - if (origin[0] || origin[1]) { - matrix.translate( - m, m, origin - ); - } - matrix.rotate(m, m, this.rotation[0]); - if (origin[0] || origin[1]) { - origin[0] = -origin[0]; - origin[1] = -origin[1]; - matrix.translate( - m, m, origin - ); - } - } - } - else { - if (this.rotation !== 0) { - matrix.rotate(m, m, this.rotation); - } - } - } - - if (this.position && (this.position[0] !==0 || this.position[1] !== 0)) { - matrix.translate(m, m, this.position); - } - } - - // 保存这个变换矩阵 - this.transform = m; - - // 应用父节点变换 - if (this.parent && this.parent.needTransform) { - if (this.needLocalTransform) { - matrix.mul(this.transform, this.parent.transform, this.transform); - } else { - matrix.copy(this.transform, this.parent.transform); - } - } - }, - - setTransform: function(ctx) { - if (this.needTransform) { - var m = this.transform; - ctx.transform( - m[0], m[1], - m[2], m[3], - m[4], m[5] - ); - } - } - }; - - return Transformable; -}); -/** - * zrender : 颜色辅助类 - * - * author: CrossDo (chenhuaimu@baidu.com) - * - * getColor:获取色板颜色 - * customPalette : 自定义调色板 - * resetPalette : 重置调色板 - * - * getHighlightColor : 获取默认高亮颜色 - * customHighlight : 自定义默认高亮颜色 - * resetHighlight : 重置默认高亮颜色 - * - * getRadialGradient : 径向渐变 - * getLinearGradient : 线性渐变 - * getGradientColors : 获取颜色之间渐变颜色数组 - * getStepColors : 获取两种颜色之间渐变颜色数组 - * reverse : 颜色翻转 - * mix : 颜色混合 - * lift : 颜色升降 - * trim : 清除空格 - * random : 随机颜色 - * toRGB : 转为RGB格式 - * toRGBA : 转为RGBA格式 - * toHex : 转为#RRGGBB格式 - * toHSL : 转为HSL格式 - * toHSLA : 转为HSLA格式 - * toHSB : 转为HSB格式 - * toHSBA : 转为HSBA格式 - * toHSV : 转为HSV格式 - * toHSVA : 转为HSVA格式 - * toName : 转为颜色名字 - * toColor: 颜色值数组转为指定格式颜色 - * toArray: 返回颜色值数组 - * alpha : 设置颜色的透明度 - **/ -define( 'zrender/tool/color',['require','../tool/util'],function(require) { - var util = require('../tool/util'); - - var _ctx; - - // Color palette is an array containing the default colors for the chart's - // series. - // When all colors are used, new colors are selected from the start again. - // Defaults to: - // 默认色板 - var palette = [ - '#ff9277', ' #dddd00', ' #ffc877', ' #bbe3ff', ' #d5ffbb', - '#bbbbff', ' #ddb000', ' #b0dd00', ' #e2bbff', ' #ffbbe3', - '#ff7777', ' #ff9900', ' #83dd00', ' #77e3ff', ' #778fff', - '#c877ff', ' #ff77ab', ' #ff6600', ' #aa8800', ' #77c7ff', - '#ad77ff', ' #ff77ff', ' #dd0083', ' #777700', ' #00aa00', - '#0088aa', ' #8400dd', ' #aa0088', ' #dd0000', ' #772e00' - ]; - var _palette = palette; - - var highlightColor = 'rgba(255,255,0,0.5)'; - var _highlightColor = highlightColor; - - // 颜色格式 - /*jshint maxlen: 330 */ - var colorRegExp = /^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i; - - var _nameColors = { - aliceblue : '#f0f8ff', - antiquewhite : '#faebd7', - aqua : '#0ff', - aquamarine : '#7fffd4', - azure : '#f0ffff', - beige : '#f5f5dc', - bisque : '#ffe4c4', - black : '#000', - blanchedalmond : '#ffebcd', - blue : '#00f', - blueviolet : '#8a2be2', - brown : '#a52a2a', - burlywood : '#deb887', - cadetblue : '#5f9ea0', - chartreuse : '#7fff00', - chocolate : '#d2691e', - coral : '#ff7f50', - cornflowerblue : '#6495ed', - cornsilk : '#fff8dc', - crimson : '#dc143c', - cyan : '#0ff', - darkblue : '#00008b', - darkcyan : '#008b8b', - darkgoldenrod : '#b8860b', - darkgray : '#a9a9a9', - darkgrey : '#a9a9a9', - darkgreen : '#006400', - darkkhaki : '#bdb76b', - darkmagenta : '#8b008b', - darkolivegreen : '#556b2f', - darkorange : '#ff8c00', - darkorchid : '#9932cc', - darkred : '#8b0000', - darksalmon : '#e9967a', - darkseagreen : '#8fbc8f', - darkslateblue : '#483d8b', - darkslategray : '#2f4f4f', - darkslategrey : '#2f4f4f', - darkturquoise : '#00ced1', - darkviolet : '#9400d3', - deeppink : '#ff1493', - deepskyblue : '#00bfff', - dimgray : '#696969', - dimgrey : '#696969', - dodgerblue : '#1e90ff', - firebrick : '#b22222', - floralwhite : '#fffaf0', - forestgreen : '#228b22', - fuchsia : '#f0f', - gainsboro : '#dcdcdc', - ghostwhite : '#f8f8ff', - gold : '#ffd700', - goldenrod : '#daa520', - gray : '#808080', - grey : '#808080', - green : '#008000', - greenyellow : '#adff2f', - honeydew : '#f0fff0', - hotpink : '#ff69b4', - indianred : '#cd5c5c', - indigo : '#4b0082', - ivory : '#fffff0', - khaki : '#f0e68c', - lavender : '#e6e6fa', - lavenderblush : '#fff0f5', - lawngreen : '#7cfc00', - lemonchiffon : '#fffacd', - lightblue : '#add8e6', - lightcoral : '#f08080', - lightcyan : '#e0ffff', - lightgoldenrodyellow : '#fafad2', - lightgray : '#d3d3d3', - lightgrey : '#d3d3d3', - lightgreen : '#90ee90', - lightpink : '#ffb6c1', - lightsalmon : '#ffa07a', - lightseagreen : '#20b2aa', - lightskyblue : '#87cefa', - lightslategray : '#789', - lightslategrey : '#789', - lightsteelblue : '#b0c4de', - lightyellow : '#ffffe0', - lime : '#0f0', - limegreen : '#32cd32', - linen : '#faf0e6', - magenta : '#f0f', - maroon : '#800000', - mediumaquamarine : '#66cdaa', - mediumblue : '#0000cd', - mediumorchid : '#ba55d3', - mediumpurple : '#9370d8', - mediumseagreen : '#3cb371', - mediumslateblue : '#7b68ee', - mediumspringgreen : '#00fa9a', - mediumturquoise : '#48d1cc', - mediumvioletred : '#c71585', - midnightblue : '#191970', - mintcream : '#f5fffa', - mistyrose : '#ffe4e1', - moccasin : '#ffe4b5', - navajowhite : '#ffdead', - navy : '#000080', - oldlace : '#fdf5e6', - olive : '#808000', - olivedrab : '#6b8e23', - orange : '#ffa500', - orangered : '#ff4500', - orchid : '#da70d6', - palegoldenrod : '#eee8aa', - palegreen : '#98fb98', - paleturquoise : '#afeeee', - palevioletred : '#d87093', - papayawhip : '#ffefd5', - peachpuff : '#ffdab9', - peru : '#cd853f', - pink : '#ffc0cb', - plum : '#dda0dd', - powderblue : '#b0e0e6', - purple : '#800080', - red : '#f00', - rosybrown : '#bc8f8f', - royalblue : '#4169e1', - saddlebrown : '#8b4513', - salmon : '#fa8072', - sandybrown : '#f4a460', - seagreen : '#2e8b57', - seashell : '#fff5ee', - sienna : '#a0522d', - silver : '#c0c0c0', - skyblue : '#87ceeb', - slateblue : '#6a5acd', - slategray : '#708090', - slategrey : '#708090', - snow : '#fffafa', - springgreen : '#00ff7f', - steelblue : '#4682b4', - tan : '#d2b48c', - teal : '#008080', - thistle : '#d8bfd8', - tomato : '#ff6347', - turquoise : '#40e0d0', - violet : '#ee82ee', - wheat : '#f5deb3', - white : '#fff', - whitesmoke : '#f5f5f5', - yellow : '#ff0', - yellowgreen : '#9acd32' - }; - - /** - * 自定义调色板 - */ - function customPalette(userPalete) { - palette = userPalete; - } - - /** - * 复位默认色板 - */ - function resetPalette() { - palette = _palette; - } - - /** - * 获取色板颜色 - * - * @param {number} idx : 色板位置 - * @param {array} [userPalete] : 自定义色板 - * - * @return {color} 颜色#000000~#ffffff - */ - function getColor(idx, userPalete) { - idx = idx | 0; - userPalete = userPalete || palette; - return userPalete[idx % userPalete.length]; - } - - /** - * 自定义默认高亮颜色 - */ - function customHighlight(userHighlightColor) { - highlightColor = userHighlightColor; - } - - /** - * 重置默认高亮颜色 - */ - function resetHighlight() { - _highlightColor = highlightColor; - } - - /** - * 获取默认高亮颜色 - */ - function getHighlightColor() { - return highlightColor; - } - - /** - * 径向渐变 - * - * @param {number} x0 渐变起点 - * @param {number} y0 - * @param {number} r0 - * @param {number} x1 渐变终点 - * @param {number} y1 - * @param {number} r1 - * @param {Array} colorList 颜色列表 - */ - function getRadialGradient(x0, y0, r0, x1, y1, r1, colorList) { - if (!_ctx) { - _ctx = util.getContext(); - } - var gradient = _ctx.createRadialGradient(x0, y0, r0, x1, y1, r1); - for ( var i = 0, l = colorList.length; i < l; i++) { - gradient.addColorStop(colorList[i][0], colorList[i][1]); - } - gradient.__nonRecursion = true; - return gradient; - } - - /** - * 线性渐变 - * @param {Object} x0 渐变起点 - * @param {Object} y0 - * @param {Object} x1 渐变终点 - * @param {Object} y1 - * @param {Array} colorList 颜色列表 - */ - function getLinearGradient(x0, y0, x1, y1, colorList) { - if (!_ctx) { - _ctx = util.getContext(); - } - var gradient = _ctx.createLinearGradient(x0, y0, x1, y1); - for ( var i = 0, l = colorList.length; i < l; i++) { - gradient.addColorStop(colorList[i][0], colorList[i][1]); - } - gradient.__nonRecursion = true; - return gradient; - } - - /** - * 获取两种颜色之间渐变颜色数组 - * @param {color} start 起始颜色 - * @param {color} end 结束颜色 - * @param {number} step 渐变级数 - * @return {Array} 颜色数组 - */ - function getStepColors(start, end, step) { - start = toRGBA(start); - end = toRGBA(end); - start = getData(start); - end = getData(end); - - var colors = []; - var stepR = (end[0] - start[0]) / step; - var stepG = (end[1] - start[1]) / step; - var stepB = (end[2] - start[2]) / step; - // 生成颜色集合 - // fix by linfeng 颜色堆积 - for (var i = 0, r = start[0], g = start[1], b = start[2]; i < step; i++ - ) { - colors[i] = toColor([ - adjust(Math.floor(r), [0, 255]), - adjust(Math.floor(g), [0, 255]), - adjust(Math.floor(b), [0, 255]) - ]); - r += stepR; - g += stepG; - b += stepB; - } - r = end[0]; - g = end[1]; - b = end[2]; - colors[i] = toColor([r, g, b]); - return colors; - } - - /** - * 获取指定级数的渐变颜色数组 - * @param {Array} colors 颜色组 - * @param {number=20} step 渐变级数 - * @return {Array} 颜色数组 - */ - function getGradientColors(colors, step) { - var ret = []; - var len = colors.length; - if (step === undefined) { - step = 20; - } - if (len === 1) { - ret = getStepColors(colors[0], colors[0], step); - } else if (len > 1) { - for ( var i = 0, n = len - 1; i < n; i++) { - var steps = getStepColors(colors[i], colors[i + 1], step); - if (i < n - 1) { - steps.pop(); - } - ret = ret.concat(steps); - } - } - return ret; - } - - /** - * 颜色值数组转为指定格式颜色,例如:
- * data = [60,20,20,0.1] format = 'rgba' - * 返回:rgba(60,20,20,0.1) - * @param {Array} data 颜色值数组 - * @param {string} format 格式,默认rgb - * @return {string} 颜色 - */ - function toColor(data, format) { - format = format || 'rgb'; - if (data && (data.length === 3 || data.length === 4)) { - data = map(data, - function(c) { - return c > 1 ? Math.ceil(c) : c; - }); - - if (format.indexOf('hex') > -1) { - return '#' + ((1 << 24) + (data[0] << 16) + (data[1] << 8) + (+data[2])).toString(16).slice(1); - } else if (format.indexOf('hs') > -1) { - var sx = map(data.slice(1, 3), - function(c) { - return c + '%'; - }); - data[1] = sx[0]; - data[2] = sx[1]; - } - - if (format.indexOf('a') > -1) { - if (data.length === 3) { - data.push(1); - } - data[3] = adjust(data[3], [0, 1]); - return format + '(' + data.slice(0, 4).join(',') + ')'; - } - - return format + '(' + data.slice(0, 3).join(',') + ')'; - } - } - - /** - * 返回颜色值数组 - * - * @param {color} color 颜色 - * @return {Array} 颜色值数组 - */ - function toArray(color) { - color = trim(color); - if (color.indexOf('rgba') < 0) { - color = toRGBA(color); - } - - var data = []; - var i = 0; - color.replace(/[\d.]+/g, function (n) { - if (i < 3) { - n = n | 0; - } else { - // Alpha - n = +n; - } - data[i++] = n; - }); - return data; - } - - /** - * 颜色格式转化 - * - * @param {Array} data 颜色值数组 - * @param {string} format 格式,默认rgb - * @return {string} 颜色 - */ - function convert(color, format) { - var data = getData(color); - var alpha = data[3]; - if(typeof alpha === 'undefined') { - alpha = 1; - } - - if (color.indexOf('hsb') > -1) { - data = _HSV_2_RGB(data); - } else if (color.indexOf('hsl') > -1) { - data = _HSL_2_RGB(data); - } - - if (format.indexOf('hsb') > -1 || format.indexOf('hsv') > -1) { - data = _RGB_2_HSB(data); - } else if (format.indexOf('hsl') > -1) { - data = _RGB_2_HSL(data); - } - - data[3] = alpha; - - return toColor(data, format); - } - - /** - * 转换为rgba格式的颜色 - * - * @param {string} color 颜色 - * @return {string} rgba颜色,rgba(r,g,b,a) - */ - function toRGBA(color) { - return convert(color, 'rgba'); - } - - /** - * 转换为rgb数字格式的颜色 - * - * @param {string} color 颜色 - * @return {string} rgb颜色,rgb(0,0,0)格式 - */ - function toRGB(color) { - return convert(color, 'rgb'); - } - - /** - * 转换为16进制颜色 - * - * @param {string} color 颜色 - * @return {string} 16进制颜色,#rrggbb格式 - */ - function toHex(color) { - return convert(color, 'hex'); - } - - /** - * 转换为HSV颜色 - * - * @param {string} color 颜色 - * @return {string} HSVA颜色,hsva(h,s,v,a) - */ - function toHSVA(color) { - return convert(color, 'hsva'); - } - - /** - * 转换为HSV颜色 - * - * @param {string} color 颜色 - * @return {string} HSV颜色,hsv(h,s,v) - */ - function toHSV(color) { - return convert(color, 'hsv'); - } - - /** - * 转换为HSBA颜色 - * - * @param {string} color 颜色 - * @return {string} HSBA颜色,hsba(h,s,b,a) - */ - function toHSBA(color) { - return convert(color, 'hsba'); - } - - /** - * 转换为HSB颜色 - * - * @param {string} color 颜色 - * @return {string} HSB颜色,hsb(h,s,b) - */ - function toHSB(color) { - return convert(color, 'hsb'); - } - - /** - * 转换为HSLA颜色 - * - * @param {string} color 颜色 - * @return {string} HSLA颜色,hsla(h,s,l,a) - */ - function toHSLA(color) { - return convert(color, 'hsla'); - } - - /** - * 转换为HSL颜色 - * - * @param {string} color 颜色 - * @return {string} HSL颜色,hsl(h,s,l) - */ - function toHSL(color) { - return convert(color, 'hsl'); - } - - /** - * 转换颜色名 - * - * @param {string} color 颜色 - * @return {string} 颜色名 - */ - function toName(color) { - for ( var key in _nameColors) { - if (toHex(_nameColors[key]) === toHex(color)) { - return key; - } - } - return null; - } - - /** - * 移除颜色中多余空格 - * - * @param {string} color 颜色 - * @return {string} 无空格颜色 - */ - function trim(color) { - return String(color).replace(/\s+/g, ''); - } - - /** - * 颜色规范化 - * - * @param {string} color 颜色 - * @return {string} 规范化后的颜色 - */ - function normalize(color) { - // 颜色名 - if (_nameColors[color]) { - color = _nameColors[color]; - } - // 去掉空格 - color = trim(color); - // hsv与hsb等价 - color = color.replace(/hsv/i, 'hsb'); - // rgb转为rrggbb - if (/^#[\da-f]{3}$/i.test(color)) { - color = parseInt(color.slice(1), 16); - var r = (color & 0xf00) << 8; - var g = (color & 0xf0) << 4; - var b = color & 0xf; - - color = '#'+ ((1 << 24) + (r << 4) + r + (g << 4) + g + (b << 4) + b).toString(16).slice(1); - } - // 或者使用以下正则替换,不过 chrome 下性能相对差点 - // color = color.replace(/^#([\da-f])([\da-f])([\da-f])$/i, '#$1$1$2$2$3$3'); - return color; - } - - /** - * 颜色加深或减淡,当level>0加深,当level<0减淡 - * - * @param {string} color 颜色 - * @param {number} level 升降程度,取值区间[-1,1] - * @return {string} 加深或减淡后颜色值 - */ - function lift(color, level) { - var direct = level > 0 ? 1 : -1; - if (typeof level === 'undefined') { - level = 0; - } - level = Math.abs(level) > 1 ? 1 : Math.abs(level); - color = toRGB(color); - var data = getData(color); - for ( var i = 0; i < 3; i++) { - if (direct === 1) { - data[i] = data[i] * (1 - level) | 0; - } else { - data[i] = ((255 - data[i]) * level + data[i]) | 0; - } - } - return 'rgb(' + data.join(',') + ')'; - } - - /** - * 颜色翻转,[255-r,255-g,255-b,1-a] - * - * @param {string} color 颜色 - * @return {string} 翻转颜色 - */ - function reverse(color) { - var data = getData(toRGBA(color)); - data = map(data, - function(c) { - return 255 - c; - }); - return toColor(data, 'rgb'); - } - - /** - * 简单两种颜色混合 - * - * @param {string} color1 第一种颜色 - * @param {string} color2 第二种颜色 - * @param {string} weight 混合权重[0-1] - * @return {string} 结果色,rgb(r,g,b)或rgba(r,g,b,a) - */ - function mix(color1, color2, weight) { - if(typeof weight === 'undefined') { - weight = 0.5; - } - weight = 1 - adjust(weight, [0, 1]); - - var w = weight * 2 - 1; - var data1 = getData(toRGBA(color1)); - var data2 = getData(toRGBA(color2)); - - var d = data1[3] - data2[3]; - - var weight1 = (((w * d === -1) ? w : (w + d) / (1 + w * d)) + 1) / 2; - var weight2 = 1 - weight1; - - var data = []; - - for ( var i = 0; i < 3; i++) { - data[i] = data1[i] * weight1 + data2[i] * weight2; - } - - var alpha = data1[3] * weight + data2[3] * (1 - weight); - alpha = Math.max(0, Math.min(1, alpha)); - - if (data1[3] === 1 && data2[3] === 1) {// 不考虑透明度 - return toColor(data, 'rgb'); - } - data[3] = alpha; - return toColor(data, 'rgba'); - } - - /** - * 随机颜色 - * - * @return {string} 颜色值,#rrggbb格式 - */ - function random() { - return '#' + Math.random().toString(16).slice(2, 8); - } - - /** - * 获取颜色值数组,返回值范围:
- * RGB 范围[0-255]
- * HSL/HSV/HSB 范围[0-1]
- * A透明度范围[0-1] - * 支持格式: - * #rgb - * #rrggbb - * rgb(r,g,b) - * rgb(r%,g%,b%) - * rgba(r,g,b,a) - * hsb(h,s,b) // hsv与hsb等价 - * hsb(h%,s%,b%) - * hsba(h,s,b,a) - * hsl(h,s,l) - * hsl(h%,s%,l%) - * hsla(h,s,l,a) - * - * @param {string} color 颜色 - * @return {Array} 颜色值数组或null - */ - function getData(color) { - color = normalize(color); - var r = color.match(colorRegExp); - if (r === null) { - throw new Error('The color format error'); // 颜色格式错误 - } - var d; - var a; - var data = []; - var rgb; - - if (r[2]) { - // #rrggbb - d = r[2].replace('#', '').split(''); - rgb = [d[0] + d[1], d[2] + d[3], d[4] + d[5]]; - data = map(rgb, - function(c) { - return adjust(parseInt(c, 16), [0, 255]); - }); - - } - else if (r[4]) { - // rgb rgba - var rgba = (r[4]).split(','); - a = rgba[3]; - rgb = rgba.slice(0, 3); - data = map( - rgb, - function(c) { - c = Math.floor( - c.indexOf('%') > 0 ? parseInt(c, 0) * 2.55 : c - ); - return adjust(c, [0, 255]); - } - ); - - if(typeof a !== 'undefined') { - data.push(adjust(parseFloat(a), [0, 1])); - } - } - else if (r[5] || r[6]) { - // hsb hsba hsl hsla - var hsxa = (r[5] || r[6]).split(','); - var h = parseInt(hsxa[0], 0) / 360; - var s = hsxa[1]; - var x = hsxa[2]; - a = hsxa[3]; - data = map([s, x], - function(c) { - return adjust(parseFloat(c) / 100, [0, 1]); - }); - data.unshift(h); - if( typeof a !== 'undefined') { - data.push(adjust(parseFloat(a), [0, 1])); - } - } - return data; - } - - /** - * 设置颜色透明度 - * @param {string} color 颜色 - * @param {number} alpha 透明度,区间[0,1] - * @return {string} rgba颜色值 - */ - function alpha(color, a) { - if (a === null) { - a = 1; - } - var data = getData(toRGBA(color)); - data[3] = adjust(Number(a).toFixed(4), [0, 1]); - - return toColor(data, 'rgba'); - } - - // 数组映射 - function map(array, fun) { - if (typeof fun !== 'function') { - throw new TypeError(); - } - var len = array ? array.length : 0; - for ( var i = 0; i < len; i++) { - array[i] = fun(array[i]); - } - return array; - } - - // 调整值区间 - function adjust(value, region) { - // < to <= & > to >= - // modify by linzhifeng 2014-05-25 because -0 == 0 - if (value <= region[0]) { - value = region[0]; - } - else if (value >= region[1]) { - value = region[1]; - } - return value; - } - - // 参见 http:// www.easyrgb.com/index.php?X=MATH - function _HSV_2_RGB(data) { - var H = data[0]; - var S = data[1]; - var V = data[2]; - // HSV from 0 to 1 - var R, G, B; - if (S === 0) { - R = V * 255; - G = V * 255; - B = V * 255; - } else { - var h = H * 6; - if (h === 6) { - h = 0; - } - var i = h | 0; - var v1 = V * (1 - S); - var v2 = V * (1 - S * (h - i)); - var v3 = V * (1 - S * (1 - (h - i))); - var r = 0; - var g = 0; - var b = 0; - - if (i === 0) { - r = V; - g = v3; - b = v1; - } else if (i === 1) { - r = v2; - g = V; - b = v1; - } else if (i === 2) { - r = v1; - g = V; - b = v3; - } else if (i === 3) { - r = v1; - g = v2; - b = V; - } else if (i === 4) { - r = v3; - g = v1; - b = V; - } else { - r = V; - g = v1; - b = v2; - } - - // RGB results from 0 to 255 - R = r * 255; - G = g * 255; - B = b * 255; - } - return [ R, G, B ]; - } - - function _HSL_2_RGB(data) { - var H = data[0]; - var S = data[1]; - var L = data[2]; - // HSL from 0 to 1 - var R, G, B; - if (S === 0) { - R = L * 255; - G = L * 255; - B = L * 255; - } else { - var v2; - if (L < 0.5) { - v2 = L * (1 + S); - } else { - v2 = (L + S) - (S * L); - } - - var v1 = 2 * L - v2; - - R = 255 * _HUE_2_RGB(v1, v2, H + (1 / 3)); - G = 255 * _HUE_2_RGB(v1, v2, H); - B = 255 * _HUE_2_RGB(v1, v2, H - (1 / 3)); - } - return [ R, G, B ]; - } - - function _HUE_2_RGB(v1, v2, vH) { - if (vH < 0) { - vH += 1; - } - if (vH > 1) { - vH -= 1; - } - if ((6 * vH) < 1) { - return (v1 + (v2 - v1) * 6 * vH); - } - if ((2 * vH) < 1) { - return (v2); - } - if ((3 * vH) < 2) { - return (v1 + (v2 - v1) * ((2 / 3) - vH) * 6); - } - return v1; - } - - function _RGB_2_HSB(data) { - // RGB from 0 to 255 - var R = (data[0] / 255); - var G = (data[1] / 255); - var B = (data[2] / 255); - - var vMin = Math.min(R, G, B); // Min. value of RGB - var vMax = Math.max(R, G, B); // Max. value of RGB - var delta = vMax - vMin; // Delta RGB value - var V = vMax; - var H; - var S; - - // HSV results from 0 to 1 - if (delta === 0) { - H = 0; - S = 0; - } else { - S = delta / vMax; - - var deltaR = (((vMax - R) / 6) + (delta / 2)) / delta; - var deltaG = (((vMax - G) / 6) + (delta / 2)) / delta; - var deltaB = (((vMax - B) / 6) + (delta / 2)) / delta; - - if (R === vMax) { - H = deltaB - deltaG; - } else if (G === vMax) { - H = (1 / 3) + deltaR - deltaB; - } else if (B === vMax) { - H = (2 / 3) + deltaG - deltaR; - } - - if (H < 0) { - H += 1; - } - if (H > 1) { - H -= 1; - } - } - H = H * 360; - S = S * 100; - V = V * 100; - return [ H, S, V ]; - } - - function _RGB_2_HSL(data) { - // RGB from 0 to 255 - var R = (data[0] / 255); - var G = (data[1] / 255); - var B = (data[2] / 255); - - var vMin = Math.min(R, G, B); // Min. value of RGB - var vMax = Math.max(R, G, B); // Max. value of RGB - var delta = vMax - vMin; // Delta RGB value - - var L = (vMax + vMin) / 2; - var H; - var S; - // HSL results from 0 to 1 - if (delta === 0) { - H = 0; - S = 0; - } else { - if (L < 0.5) { - S = delta / (vMax + vMin); - } else { - S = delta / (2 - vMax - vMin); - } - - var deltaR = (((vMax - R) / 6) + (delta / 2)) / delta; - var deltaG = (((vMax - G) / 6) + (delta / 2)) / delta; - var deltaB = (((vMax - B) / 6) + (delta / 2)) / delta; - - if (R === vMax) { - H = deltaB - deltaG; - } else if (G === vMax) { - H = (1 / 3) + deltaR - deltaB; - } else if (B === vMax) { - H = (2 / 3) + deltaG - deltaR; - } - - if (H < 0) { - H += 1; - } - - if (H > 1) { - H -= 1; - } - } - - H = H * 360; - S = S * 100; - L = L * 100; - - return [ H, S, L ]; - } - - return { - customPalette : customPalette, - resetPalette : resetPalette, - getColor : getColor, - getHighlightColor : getHighlightColor, - customHighlight : customHighlight, - resetHighlight : resetHighlight, - getRadialGradient : getRadialGradient, - getLinearGradient : getLinearGradient, - getGradientColors : getGradientColors, - getStepColors : getStepColors, - reverse : reverse, - mix : mix, - lift : lift, - trim : trim, - random : random, - toRGB : toRGB, - toRGBA : toRGBA, - toHex : toHex, - toHSL : toHSL, - toHSLA : toHSLA, - toHSB : toHSB, - toHSBA : toHSBA, - toHSV : toHSV, - toHSVA : toHSVA, - toName : toName, - toColor : toColor, - toArray : toArray, - alpha : alpha, - getData : getData - }; -}); - - -/** - * zrender : shape基类 - * - * desc: zrender是一个轻量级的Canvas类库,MVC封装,数据驱动,提供类Dom事件模型。 - * author: Kener (@Kener-林峰, linzhifeng@baidu.com) - * errorrik (errorrik@gmail.com) - * - * 可配图形属性: - { - // 基础属性,详见各shape - shape : {string}, // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 变换 - position : {array}, // 默认为[0, 0], shape的坐标 - rotation : {number|array}, // 默认为[0, 0, 0],shape绕自身旋转的角度,不被translate 影响 - // 后两个值为旋转的origin - scale : {array}, // 默认为[1, 1, 0, 0], shape纵横缩放比例,不被translate影响 - // 后两个值为缩放的origin - - // 样式属性,详见各shape,默认状态样式属性 - style : {Object}, - - // 样式属性,详见各shape,高亮样式属性,当不存在highlightStyle时使用默认样式扩展显示 - highlightStyle : {Object}, - - // 交互属性,zrender支持,非图形类实现 - hoverable : {boolean}, // 默认为true,可悬浮响应,默认悬浮响应为高亮显示 - // 可在onbrush中捕获并阻塞高亮绘画 - clickable : {boolean}, // 默认为false,可点击响应,影响鼠标hover时图标是否为可点击样式 - // 为false则阻断点击事件抛出,为true可在onclick中捕获 - draggable : {boolean}, // 默认为false,可拖拽响应,默认拖拽响应改变图形位置, - // 可在ondrift中捕获并阻塞默认拖拽行为 - - // 事件属性 - onbrush : {Function}, // 默认为null,当前图形被刷画时回调,可用于实现自定义绘画 - // 回传参数为: - // @param {2D Context} context 当前canvas context - // @param {Object} shape 当前shape - // @param {boolean} isHighlight 是否高亮 - // @return {boolean} 回调返回true则不执行默认绘画 - ondrift : {Function}, // 默认为null,当前图形被拖拽改变位置时回调,可用于限制拖拽范围 - // 回传参数为: - // @param {Object} shape 当前shape - // @param {number} dx x方向变化 - // @param {number} dy y方向变化 - onclick : {Function}, // 默认为null,当前图形点击响应,回传参数为: - // @param {Object} eventPacket 对象内容如下: - // @param {string} eventPacket.type 事件类型,EVENT.CLICK - // @param {event} eventPacket.event 原始dom事件对象 - // @param {Object} eventPacket.target 当前图形shape对象 - // @return {boolean} 回调返回true则阻止抛出全局事件 - - onmousewheel : {Function}, // 默认为null,当前图形上鼠标滚轮触发,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.MOUSEWHEEL - // @return {boolean} 回调返回true则阻止抛出全局事件 - - onmousemove : {Function}, // 默认为null,当前图上形鼠标(或手指)移动触发,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.MOUSEMOVE - // @return {boolean} 回调返回true则阻止抛出全局事件 - - onmouseover : {Function}, // 默认为null,鼠标(或手指)移动到当前图形上触发,回传参数格式同onclick: - // 事件类型为confit.EVENT.MOUSEOVER - // @return {boolean} 回调返回true则阻止抛出全局事件 - - onmouseout : {Function}, // 默认为null,鼠标(或手指)从当前图形移开,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.MOUSEOUT - // @return {boolean} 回调返回true则阻止抛出全局事件 - - onmousedown : {Function}, // 默认为null,鼠标按钮(或手指)按下,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.MOUSEDOWN - // @return {boolean} 回调返回true则阻止抛出全局事件 - - onmouseup : {Function}, // 默认为null,鼠标按钮(或手指)松开,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.MOUSEUP - // @return {boolean} 回调返回true则阻止抛出全局事件 - - ondragstart : {Function}, // 默认为null,开始拖拽时触发,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.DRAGSTART - // @return {boolean} 回调返回true则阻止抛出全局事件 - - ondragend : {Function}, // 默认为null,拖拽完毕时触发,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.DRAGEND - // @return {boolean} 回调返回true则阻止抛出全局事件 - - ondragenter : {Function}, // 默认为null,拖拽图形元素进入目标图形元素时触发 - // 回传参数格式同onclick,其中: - // @param {string} eventPacket.type 事件类型,EVENT.DRAGENTER - // @param {Object} eventPacket.target 目标图形元素shape对象 - // @param {Object} eventPacket.dragged 拖拽图形元素shape对象 - // @return {boolean} 回调返回true则阻止抛出全局事件 - - ondragover : {Function}, // 默认为null,拖拽图形元素在目标图形元素上移动时触发, - // 回传参数格式同onclick,其中: - // @param {string} eventPacket.type 事件类型,EVENT.DRAGOVER - // @param {Object} eventPacket.target 目标图形元素shape对象 - // @param {Object} eventPacket.dragged 拖拽图形元素shape对象 - // @return {boolean} 回调返回true则阻止抛出全局事件 - - ondragleave : {Function}, // 默认为null,拖拽图形元素离开目标图形元素时触发, - // 回传参数格式同onclick,其中: - // @param {string} eventPacket.type 事件类型,EVENT.DRAGLEAVE - // @param {Object} eventPacket.target 目标图形元素shape对象 - // @param {Object} eventPacket.dragged 拖拽图形元素shape对象 - // @return {boolean} 回调返回true则阻止抛出全局事件 - - ondrop : {Function}, // 默认为null,拖拽图形元素放在目标图形元素内时触发, - // 回传参数格式同onclick,其中: - // @param {string} eventPacket.type 事件类型,EVENT.DRAG - // @param {Object} eventPacket.target 目标图形元素shape对象 - // @param {Object} eventPacket.dragged 拖拽图形元素shape对象 - // @return {boolean} 回调返回true则阻止抛出全局事件 - } - */ -define( - 'zrender/shape/Base',['require','../tool/matrix','../tool/guid','../tool/util','./mixin/Transformable','../tool/event','../tool/area','../tool/area','../tool/color','../tool/area'],function(require) { - var matrix = require('../tool/matrix'); - var guid = require('../tool/guid'); - var util = require('../tool/util'); - - var Transformable = require('./mixin/Transformable'); - var Dispatcher = require('../tool/event').Dispatcher; - - function _fillText(ctx, text, x, y, textFont, textAlign, textBaseline) { - if (textFont) { - ctx.font = textFont; - } - ctx.textAlign = textAlign; - ctx.textBaseline = textBaseline; - var rect = _getTextRect( - text, x, y, textFont, textAlign, textBaseline - ); - - text = (text + '').split('\n'); - var lineHeight = require('../tool/area').getTextHeight('国', textFont); - - switch (textBaseline) { - case 'top': - y = rect.y; - break; - case 'bottom': - y = rect.y + lineHeight; - break; - default: - y = rect.y + lineHeight / 2; - } - - for (var i = 0, l = text.length; i < l; i++) { - ctx.fillText(text[i], x, y); - y += lineHeight; - } - } - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * - * @inner - * @param {Object} style - */ - function _getTextRect(text, x, y, textFont, textAlign, textBaseline) { - var area = require('../tool/area'); - var width = area.getTextWidth(text, textFont); - var lineHeight = area.getTextHeight('国', textFont); - - text = (text + '').split('\n'); - - switch (textAlign) { - case 'end': - case 'right': - x -= width; - break; - case 'center': - x -= (width / 2); - break; - } - - switch (textBaseline) { - case 'top': - break; - case 'bottom': - y -= lineHeight * text.length; - break; - default: - y -= lineHeight * text.length / 2; - } - - return { - x : x, - y : y, - width : width, - height : lineHeight * text.length - }; - } - - function Base( options ) { - - options = options || {}; - - this.id = options.id || guid(); - - for ( var key in options ) { - this[ key ] = options[ key ]; - } - - this.style = this.style || {}; - - this.parent = null; - - this.__dirty = true; - - Transformable.call(this); - Dispatcher.call(this); - } - - Base.prototype.invisible = false; - - Base.prototype.ignore = false; - - Base.prototype.zlevel = 0; - - Base.prototype.draggable = false; - - Base.prototype.clickable = false; - - Base.prototype.hoverable = true; - - Base.prototype.z = 0; - - /** - * 画刷 - * - * @param ctx 画布句柄 - * @param isHighlight 是否为高亮状态 - * @param updateCallback 需要异步加载资源的shape可以通过这个callback(e) - * 让painter更新视图,base.brush没用,需要的话重载brush - */ - Base.prototype.brush = function (ctx, isHighlight) { - var style = this.style; - - if (this.brushTypeOnly) { - style.brushType = this.brushTypeOnly; - } - - if (isHighlight) { - // 根据style扩展默认高亮样式 - style = this.getHighlightStyle( - style, - this.highlightStyle || {}, - this.brushTypeOnly - ); - } - - if (this.brushTypeOnly == 'stroke') { - style.strokeColor = style.strokeColor || style.color; - } - - ctx.save(); - - this.setContext(ctx, style); - - // 设置transform - this.setTransform(ctx); - - ctx.beginPath(); - this.buildPath(ctx, style); - if (this.brushTypeOnly != 'stroke') { - ctx.closePath(); - } - - switch (style.brushType) { - case 'both': - ctx.fill(); - case 'stroke': - style.lineWidth > 0 && ctx.stroke(); - break; - default: - ctx.fill(); - } - - this.drawText(ctx, style, this.style); - - ctx.restore(); - }; - - var STYLE_CTX_MAP = [ - ['color', 'fillStyle'], - ['strokeColor', 'strokeStyle'], - ['opacity', 'globalAlpha'], - ['lineCap', 'lineCap'], - ['lineJoin', 'lineJoin'], - ['miterLimit', 'miterLimit'], - ['lineWidth', 'lineWidth'], - ['shadowBlur', 'shadowBlur'], - ['shadowColor', 'shadowColor'], - ['shadowOffsetX', 'shadowOffsetX'], - ['shadowOffsetY', 'shadowOffsetY'] - ]; - - /** - * 画布通用设置 - * - * TODO Performance - * - * @param ctx 画布句柄 - * @param style 通用样式 - */ - Base.prototype.setContext = function (ctx, style) { - for (var i = 0, len = STYLE_CTX_MAP.length; i < len; i++) { - var styleProp = STYLE_CTX_MAP[i][0]; - var styleValue = style[styleProp]; - var ctxProp = STYLE_CTX_MAP[i][1]; - - if (typeof styleValue != 'undefined') { - ctx[ctxProp] = styleValue; - } - } - }; - - /** - * 根据默认样式扩展高亮样式 - * - * @param ctx Canvas 2D上下文 - * @param {Object} style 默认样式 - * @param {Object} highlightStyle 高亮样式 - */ - Base.prototype.getHighlightStyle = function (style, highlightStyle, brushTypeOnly) { - var newStyle = {}; - for (var k in style) { - newStyle[k] = style[k]; - } - - var color = require('../tool/color'); - var highlightColor = color.getHighlightColor(); - // 根据highlightStyle扩展 - if (style.brushType != 'stroke') { - // 带填充则用高亮色加粗边线 - newStyle.strokeColor = highlightColor; - newStyle.lineWidth = (style.lineWidth || 1) - + this.getHighlightZoom(); - newStyle.brushType = 'both'; - } - else { - if (brushTypeOnly != 'stroke') { - // 描边型的则用原色加工高亮 - newStyle.strokeColor = highlightColor; - newStyle.lineWidth = (style.lineWidth || 1) - + this.getHighlightZoom(); - } - else { - // 线型的则用原色加工高亮 - newStyle.strokeColor = highlightStyle.strokeColor - || color.mix( - style.strokeColor, - color.toRGB(highlightColor) - ); - } - } - - // 可自定义覆盖默认值 - for (var k in highlightStyle) { - if (typeof highlightStyle[k] != 'undefined') { - newStyle[k] = highlightStyle[k]; - } - } - - return newStyle; - }; - - /** - * 高亮放大效果参数 - * 当前统一设置为6,如有需要差异设置,通过this.type判断实例类型 - */ - Base.prototype.getHighlightZoom = function () { - return this.type != 'text' ? 6 : 2; - }; - - /** - * 默认漂移 - * - * @param dx 横坐标变化 - * @param dy 纵坐标变化 - */ - Base.prototype.drift = function (dx, dy) { - this.position[0] += dx; - this.position[1] += dy; - }; - - /** - * 获取鼠标坐标变换 - * TODO Performance - */ - Base.prototype.getTansform = (function() { - - var invTransform = []; - - return function (x, y) { - var originPos = [x, y]; - // 对鼠标的坐标也做相同的变换 - if (this.needTransform && this.transform) { - matrix.invert(invTransform, this.transform); - - matrix.mulVector(originPos, invTransform, [x, y, 1]); - - if (x == originPos[0] && y == originPos[1]) { - // 避免外部修改导致的needTransform不准确 - this.updateNeedTransform(); - } - } - return originPos; - }; - })(); - - /** - * 默认区域包含判断 - * - * @param x 横坐标 - * @param y 纵坐标 - */ - Base.prototype.isCover = function (x, y) { - var originPos = this.getTansform(x, y); - x = originPos[0]; - y = originPos[1]; - - // 快速预判并保留判断矩形 - var rect = this.style.__rect; - if (!rect) { - rect = this.style.__rect = this.getRect(this.style); - } - - if (x >= rect.x - && x <= (rect.x + rect.width) - && y >= rect.y - && y <= (rect.y + rect.height) - ) { - // 矩形内 - return require('../tool/area').isInside(this, this.style, x, y); - } - - return false; - }; - - /** - * 附加文本 - * - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - * @param {Object} normalStyle 默认样式,用于定位文字显示 - */ - Base.prototype.drawText = function (ctx, style, normalStyle) { - if (typeof(style.text) == 'undefined' || style.text === false ) { - return; - } - // 字体颜色策略 - var textColor = style.textColor || style.color || style.strokeColor; - ctx.fillStyle = textColor; - - /* - if (style.textPosition == 'inside') { - ctx.shadowColor = 'rgba(0,0,0,0)'; // 内部文字不带shadowColor - } - */ - - // 文本与图形间空白间隙 - var dd = 10; - var al; // 文本水平对齐 - var bl; // 文本垂直对齐 - var tx; // 文本横坐标 - var ty; // 文本纵坐标 - - var textPosition = style.textPosition // 用户定义 - || this.textPosition // shape默认 - || 'top'; // 全局默认 - - switch (textPosition) { - case 'inside': - case 'top': - case 'bottom': - case 'left': - case 'right': - if (this.getRect) { - var rect = (normalStyle || style).__rect - || this.getRect(normalStyle || style); - - switch (textPosition) { - case 'inside': - tx = rect.x + rect.width / 2; - ty = rect.y + rect.height / 2; - al = 'center'; - bl = 'middle'; - if (style.brushType != 'stroke' - && textColor == style.color - ) { - ctx.fillStyle = '#fff'; - } - break; - case 'left': - tx = rect.x - dd; - ty = rect.y + rect.height / 2; - al = 'end'; - bl = 'middle'; - break; - case 'right': - tx = rect.x + rect.width + dd; - ty = rect.y + rect.height / 2; - al = 'start'; - bl = 'middle'; - break; - case 'top': - tx = rect.x + rect.width / 2; - ty = rect.y - dd; - al = 'center'; - bl = 'bottom'; - break; - case 'bottom': - tx = rect.x + rect.width / 2; - ty = rect.y + rect.height + dd; - al = 'center'; - bl = 'top'; - break; - } - } - break; - case 'start': - case 'end': - var xStart; - var xEnd; - var yStart; - var yEnd; - if (typeof style.pointList != 'undefined') { - var pointList = style.pointList; - if (pointList.length < 2) { - // 少于2个点就不画了~ - return; - } - var length = pointList.length; - switch (textPosition) { - case 'start': - xStart = pointList[0][0]; - xEnd = pointList[1][0]; - yStart = pointList[0][1]; - yEnd = pointList[1][1]; - break; - case 'end': - xStart = pointList[length - 2][0]; - xEnd = pointList[length - 1][0]; - yStart = pointList[length - 2][1]; - yEnd = pointList[length - 1][1]; - break; - } - } - else { - xStart = style.xStart || 0; - xEnd = style.xEnd || 0; - yStart = style.yStart || 0; - yEnd = style.yEnd || 0; - } - - switch (textPosition) { - case 'start': - al = xStart < xEnd ? 'end' : 'start'; - bl = yStart < yEnd ? 'bottom' : 'top'; - tx = xStart; - ty = yStart; - break; - case 'end': - al = xStart < xEnd ? 'start' : 'end'; - bl = yStart < yEnd ? 'top' : 'bottom'; - tx = xEnd; - ty = yEnd; - break; - } - dd -= 4; - if (xStart != xEnd) { - tx -= (al == 'end' ? dd : -dd); - } - else { - al = 'center'; - } - - if (yStart != yEnd) { - ty -= (bl == 'bottom' ? dd : -dd); - } - else { - bl = 'middle'; - } - break; - case 'specific': - tx = style.textX || 0; - ty = style.textY || 0; - al = 'start'; - bl = 'middle'; - break; - } - - if (tx != null && ty != null) { - _fillText( - ctx, - style.text, - tx, ty, - style.textFont, - style.textAlign || al, - style.textBaseline || bl - ); - } - }; - // TODO - Base.prototype.isSilent = function () { - return !( - this.hoverable || this.draggable - || this.onmousemove || this.onmouseover || this.onmouseout - || this.onmousedown || this.onmouseup || this.onclick - || this.ondragenter || this.ondragover || this.ondragleave - || this.ondrop - ); - }; - - util.merge(Base.prototype, Transformable.prototype, true); - util.merge(Base.prototype, Dispatcher.prototype, true); - - return Base; - } -); - -/** - * zrender - * - * author: CrossDo (chenhuaimu@baidu.com) - * - * shape类:路径 - * 可配图形属性: - { - // 基础属性 - shape : 'path', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - path : {string},// 必须,路径。例如:M 0 0 L 0 10 L 10 10 Z (一个三角形) - //M = moveto - //L = lineto - //H = horizontal lineto - //V = vertical lineto - //C = curveto - //S = smooth curveto - //Q = quadratic Belzier curve - //T = smooth quadratic Belzier curveto - //Z = closepath - - - x : {number}, // 必须,x轴坐标 - y : {number}, // 必须,y轴坐标 - - - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为top,附加文本位置。 - // inside | left | right | top | bottom - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - - **/ - -define('zrender/shape/Path',['require','./Base','../tool/util'],function (require) { - var Base = require('./Base'); - - function Path(options) { - Base.call(this, options); - } - - Path.prototype = { - type: 'path', - - _parsePathData : function(data) { - if (!data) { - return []; - } - - // command string - var cs = data; - - // command chars - var cc = [ - 'm', 'M', 'l', 'L', 'v', 'V', 'h', 'H', 'z', 'Z', - 'c', 'C', 'q', 'Q', 't', 'T', 's', 'S', 'a', 'A' - ]; - - cs = cs.replace(/-/g, ' -'); - cs = cs.replace(/ /g, ' '); - cs = cs.replace(/ /g, ','); - cs = cs.replace(/,,/g, ','); - - - var n; - // create pipes so that we can split the data - for (n = 0; n < cc.length; n++) { - cs = cs.replace(new RegExp(cc[n], 'g'), '|' + cc[n]); - } - - // create array - var arr = cs.split('|'); - var ca = []; - // init context point - var cpx = 0; - var cpy = 0; - for (n = 1; n < arr.length; n++) { - var str = arr[n]; - var c = str.charAt(0); - str = str.slice(1); - str = str.replace(new RegExp('e,-', 'g'), 'e-'); - - var p = str.split(','); - if (p.length > 0 && p[0] === '') { - p.shift(); - } - - for (var i = 0; i < p.length; i++) { - p[i] = parseFloat(p[i]); - } - while (p.length > 0) { - if (isNaN(p[0])) { - break; - } - var cmd = null; - var points = []; - - var ctlPtx; - var ctlPty; - var prevCmd; - - var rx; - var ry; - var psi; - var fa; - var fs; - - var x1 = cpx; - var y1 = cpy; - - // convert l, H, h, V, and v to L - switch (c) { - case 'l': - cpx += p.shift(); - cpy += p.shift(); - cmd = 'L'; - points.push(cpx, cpy); - break; - case 'L': - cpx = p.shift(); - cpy = p.shift(); - points.push(cpx, cpy); - break; - case 'm': - cpx += p.shift(); - cpy += p.shift(); - cmd = 'M'; - points.push(cpx, cpy); - c = 'l'; - break; - case 'M': - cpx = p.shift(); - cpy = p.shift(); - cmd = 'M'; - points.push(cpx, cpy); - c = 'L'; - break; - - case 'h': - cpx += p.shift(); - cmd = 'L'; - points.push(cpx, cpy); - break; - case 'H': - cpx = p.shift(); - cmd = 'L'; - points.push(cpx, cpy); - break; - case 'v': - cpy += p.shift(); - cmd = 'L'; - points.push(cpx, cpy); - break; - case 'V': - cpy = p.shift(); - cmd = 'L'; - points.push(cpx, cpy); - break; - case 'C': - points.push(p.shift(), p.shift(), p.shift(), p.shift()); - cpx = p.shift(); - cpy = p.shift(); - points.push(cpx, cpy); - break; - case 'c': - points.push( - cpx + p.shift(), cpy + p.shift(), - cpx + p.shift(), cpy + p.shift() - ); - cpx += p.shift(); - cpy += p.shift(); - cmd = 'C'; - points.push(cpx, cpy); - break; - case 'S': - ctlPtx = cpx; - ctlPty = cpy; - prevCmd = ca[ca.length - 1]; - if (prevCmd.command === 'C') { - ctlPtx = cpx + (cpx - prevCmd.points[2]); - ctlPty = cpy + (cpy - prevCmd.points[3]); - } - points.push(ctlPtx, ctlPty, p.shift(), p.shift()); - cpx = p.shift(); - cpy = p.shift(); - cmd = 'C'; - points.push(cpx, cpy); - break; - case 's': - ctlPtx = cpx, ctlPty = cpy; - prevCmd = ca[ca.length - 1]; - if (prevCmd.command === 'C') { - ctlPtx = cpx + (cpx - prevCmd.points[2]); - ctlPty = cpy + (cpy - prevCmd.points[3]); - } - points.push( - ctlPtx, ctlPty, - cpx + p.shift(), cpy + p.shift() - ); - cpx += p.shift(); - cpy += p.shift(); - cmd = 'C'; - points.push(cpx, cpy); - break; - case 'Q': - points.push(p.shift(), p.shift()); - cpx = p.shift(); - cpy = p.shift(); - points.push(cpx, cpy); - break; - case 'q': - points.push(cpx + p.shift(), cpy + p.shift()); - cpx += p.shift(); - cpy += p.shift(); - cmd = 'Q'; - points.push(cpx, cpy); - break; - case 'T': - ctlPtx = cpx, ctlPty = cpy; - prevCmd = ca[ca.length - 1]; - if (prevCmd.command === 'Q') { - ctlPtx = cpx + (cpx - prevCmd.points[0]); - ctlPty = cpy + (cpy - prevCmd.points[1]); - } - cpx = p.shift(); - cpy = p.shift(); - cmd = 'Q'; - points.push(ctlPtx, ctlPty, cpx, cpy); - break; - case 't': - ctlPtx = cpx, ctlPty = cpy; - prevCmd = ca[ca.length - 1]; - if (prevCmd.command === 'Q') { - ctlPtx = cpx + (cpx - prevCmd.points[0]); - ctlPty = cpy + (cpy - prevCmd.points[1]); - } - cpx += p.shift(); - cpy += p.shift(); - cmd = 'Q'; - points.push(ctlPtx, ctlPty, cpx, cpy); - break; - case 'A': - rx = p.shift(); - ry = p.shift(); - psi = p.shift(); - fa = p.shift(); - fs = p.shift(); - - x1 = cpx, y1 = cpy; - cpx = p.shift(), cpy = p.shift(); - cmd = 'A'; - points = this._convertPoint( - x1, y1, cpx, cpy, fa, fs, rx, ry, psi - ); - break; - case 'a': - rx = p.shift(); - ry = p.shift(); - psi = p.shift(); - fa = p.shift(); - fs = p.shift(); - - x1 = cpx, y1 = cpy; - cpx += p.shift(); - cpy += p.shift(); - cmd = 'A'; - points = this._convertPoint( - x1, y1, cpx, cpy, fa, fs, rx, ry, psi - ); - break; - - } - - ca.push({ - command : cmd || c, - points : points - }); - } - - if (c === 'z' || c === 'Z') { - ca.push({ - command : 'z', - points : [] - }); - } - } - - return ca; - - }, - - _convertPoint : function(x1, y1, x2, y2, fa, fs, rx, ry, psiDeg) { - var psi = psiDeg * (Math.PI / 180.0); - var xp = Math.cos(psi) * (x1 - x2) / 2.0 - + Math.sin(psi) * (y1 - y2) / 2.0; - var yp = -1 * Math.sin(psi) * (x1 - x2) / 2.0 - + Math.cos(psi) * (y1 - y2) / 2.0; - - var lambda = (xp * xp) / (rx * rx) + (yp * yp) / (ry * ry); - - if (lambda > 1) { - rx *= Math.sqrt(lambda); - ry *= Math.sqrt(lambda); - } - - var f = Math.sqrt((((rx * rx) * (ry * ry)) - - ((rx * rx) * (yp * yp)) - - ((ry * ry) * (xp * xp))) / ((rx * rx) * (yp * yp) - + (ry * ry) * (xp * xp)) - ); - - if (fa === fs) { - f *= -1; - } - if (isNaN(f)) { - f = 0; - } - - var cxp = f * rx * yp / ry; - var cyp = f * -ry * xp / rx; - - var cx = (x1 + x2) / 2.0 - + Math.cos(psi) * cxp - - Math.sin(psi) * cyp; - var cy = (y1 + y2) / 2.0 - + Math.sin(psi) * cxp - + Math.cos(psi) * cyp; - - var vMag = function(v) { - return Math.sqrt(v[0] * v[0] + v[1] * v[1]); - }; - var vRatio = function(u, v) { - return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v)); - }; - var vAngle = function(u, v) { - return (u[0] * v[1] < u[1] * v[0] ? -1 : 1) - * Math.acos(vRatio(u, v)); - }; - var theta = vAngle([ 1, 0 ], [ (xp - cxp) / rx, (yp - cyp) / ry ]); - var u = [ (xp - cxp) / rx, (yp - cyp) / ry ]; - var v = [ (-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry ]; - var dTheta = vAngle(u, v); - - if (vRatio(u, v) <= -1) { - dTheta = Math.PI; - } - if (vRatio(u, v) >= 1) { - dTheta = 0; - } - if (fs === 0 && dTheta > 0) { - dTheta = dTheta - 2 * Math.PI; - } - if (fs === 1 && dTheta < 0) { - dTheta = dTheta + 2 * Math.PI; - } - return [ cx, cy, rx, ry, theta, dTheta, psi, fs ]; - }, - - /** - * 创建路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - var path = style.path; - - var pathArray = this.pathArray || this._parsePathData(path); - - // 平移坐标 - var x = style.x || 0; - var y = style.y || 0; - - var p; - // 记录边界点,用于判断inside - var pointList = style.pointList = []; - var singlePointList = []; - for (var i = 0, l = pathArray.length; i < l; i++) { - if (pathArray[i].command.toUpperCase() == 'M') { - singlePointList.length > 0 - && pointList.push(singlePointList); - singlePointList = []; - } - p = pathArray[i].points; - for (var j = 0, k = p.length; j < k; j += 2) { - singlePointList.push([p[j] + x, p[j+1] + y]); - } - } - singlePointList.length > 0 && pointList.push(singlePointList); - - var c; - for (var i = 0, l = pathArray.length; i < l; i++) { - c = pathArray[i].command; - p = pathArray[i].points; - // 平移变换 - for (var j = 0, k = p.length; j < k; j++) { - if (j % 2 === 0) { - p[j] += x; - } else { - p[j] += y; - } - } - switch (c) { - case 'L': - ctx.lineTo(p[0], p[1]); - break; - case 'M': - ctx.moveTo(p[0], p[1]); - break; - case 'C': - ctx.bezierCurveTo(p[0], p[1], p[2], p[3], p[4], p[5]); - break; - case 'Q': - ctx.quadraticCurveTo(p[0], p[1], p[2], p[3]); - break; - case 'A': - var cx = p[0]; - var cy = p[1]; - var rx = p[2]; - var ry = p[3]; - var theta = p[4]; - var dTheta = p[5]; - var psi = p[6]; - var fs = p[7]; - var r = (rx > ry) ? rx : ry; - var scaleX = (rx > ry) ? 1 : rx / ry; - var scaleY = (rx > ry) ? ry / rx : 1; - - ctx.translate(cx, cy); - ctx.rotate(psi); - ctx.scale(scaleX, scaleY); - ctx.arc(0, 0, r, theta, theta + dTheta, 1 - fs); - ctx.scale(1 / scaleX, 1 / scaleY); - ctx.rotate(-psi); - ctx.translate(-cx, -cy); - break; - case 'z': - ctx.closePath(); - break; - } - } - - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style 样式 - */ - getRect : function(style) { - if (style.__rect) { - return style.__rect; - } - - var lineWidth; - if (style.brushType == 'stroke' || style.brushType == 'fill') { - lineWidth = style.lineWidth || 1; - } - else { - lineWidth = 0; - } - - var minX = Number.MAX_VALUE; - var maxX = Number.MIN_VALUE; - - var minY = Number.MAX_VALUE; - var maxY = Number.MIN_VALUE; - - // 平移坐标 - var x = style.x || 0; - var y = style.y || 0; - - var pathArray = this.pathArray || this._parsePathData(style.path); - for (var i = 0; i < pathArray.length; i++) { - var p = pathArray[i].points; - - for (var j = 0; j < p.length; j++) { - if (j % 2 === 0) { - if (p[j] + x < minX) { - minX = p[j] + x; - } - if (p[j] + x > maxX) { - maxX = p[j] + x; - } - } - else { - if (p[j] + y < minY) { - minY = p[j] + y; - } - if (p[j] + y > maxY) { - maxY = p[j] + y; - } - } - } - } - - var rect; - if (minX === Number.MAX_VALUE - || maxX === Number.MIN_VALUE - || minY === Number.MAX_VALUE - || maxY === Number.MIN_VALUE - ) { - rect = { - x : 0, - y : 0, - width : 0, - height : 0 - }; - } - else { - rect = { - x : Math.round(minX - lineWidth / 2), - y : Math.round(minY - lineWidth / 2), - width : maxX - minX + lineWidth, - height : maxY - minY + lineWidth - }; - } - style.__rect = rect; - return rect; - } - }; - - require('../tool/util').inherits(Path, Base); - return Path; -}); -/** - * zrender: 图形空间辅助类 - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * isInside:是否在区域内部 - * isOutside:是否在区域外部 - * getTextWidth:测算单行文本宽度 - */ -define( - 'zrender/tool/area',['require','../tool/util','../shape/Path'],function(require) { - var util = require('../tool/util'); - - var _ctx; - - var _textWidthCache = {}; - var _textHeightCache = {}; - var _textWidthCacheCounter = 0; - var _textHeightCacheCounter = 0; - var TEXT_CACHE_MAX = 20000; - - /** - * 包含判断 - * - * @param {Object} shape : 图形 - * @param {Object} area : 目标区域 - * @param {number} x : 横坐标 - * @param {number} y : 纵坐标 - */ - function isInside(shape, area, x, y) { - if (!area || !shape) { - // 无参数或不支持类型 - return false; - } - var zoneType = shape.type; - - _ctx = _ctx || util.getContext(); - - if (!_isInsideRectangle(area.__rect || shape.getRect(area), x, y)) { - // 不在矩形区域内直接返回false - return false; - } - - // 未实现或不可用时(excanvas不支持)则数学运算,主要是line,brokenLine,ring - var _mathReturn = _mathMethod(zoneType, area, x, y); - if (typeof _mathReturn != 'undefined') { - return _mathReturn; - } - - if (zoneType != 'bezier-curve' - && shape.buildPath - && _ctx.isPointInPath - ) { - return _buildPathMethod(shape, _ctx, area, x, y); - } - else if (_ctx.getImageData) { - return _pixelMethod(shape, area, x, y); - } - - // 上面的方法都行不通时 - switch (zoneType) { - case 'heart': //心形---------10 // Todo,不精确 - case 'droplet':// 水滴----------11 // Todo,不精确 - case 'ellipse': // Todo,不精确 - return true; - // 旋轮曲线 不准确 - case 'trochoid': - var _r = area.location == 'out' - ? area.r1 + area.r2 + area.d - : area.r1 - area.r2 + area.d; - return _isInsideCircle(area, x, y, _r); - // 玫瑰线 不准确 - case 'rose' : - return _isInsideCircle(area, x, y, area.maxr); - //路径,椭圆,曲线等-----------------13 - default: - return false; // Todo,暂不支持 - } - } - - /** - * 用数学方法判断,三个方法中最快,但是支持的shape少 - * - * @param {string} zoneType : 图形类型 - * @param {Object} area :目标区域 - * @param {number} x : 横坐标 - * @param {number} y : 纵坐标 - * @return {boolean=} true表示坐标处在图形中 - */ - function _mathMethod(zoneType, area, x, y) { - // 在矩形内则部分图形需要进一步判断 - switch (zoneType) { - //线-----------------------1 - case 'line': - return _isInsideLine(area, x, y); - //折线----------------------2 - case 'broken-line': - return _isInsideBrokenLine(area, x, y); - //文本----------------------3 - case 'text': - return true; - //圆环----------------------4 - case 'ring': - return _isInsideRing(area, x, y); - //矩形----------------------5 - case 'rectangle': - return true; - //圆形----------------------6 - case 'circle': - return _isInsideCircle(area, x, y, area.r); - //扇形----------------------7 - case 'sector': - return _isInsideSector(area, x, y); - //多边形---------------------8 - case 'path': - return _isInsidePath(area, x, y); - case 'polygon': - case 'star': - case 'isogon': - return _isInsidePolygon(area, x, y); - //图片----------------------9 - case 'image': - return true; - } - } - - /** - * 通过buildPath方法来判断,三个方法中较快,但是不支持线条类型的shape, - * 而且excanvas不支持isPointInPath方法 - * - * @param {Object} shape : shape - * @param {Object} context : 上下文 - * @param {Object} area :目标区域 - * @param {number} x : 横坐标 - * @param {number} y : 纵坐标 - * @return {boolean} true表示坐标处在图形中 - */ - function _buildPathMethod(shape, context, area, x, y) { - // 图形类实现路径创建了则用类的path - context.beginPath(); - shape.buildPath(context, area); - context.closePath(); - return context.isPointInPath(x, y); - } - - /** - * 通过像素值来判断,三个方法中最慢,但是支持广,不足之处是excanvas不支持像素处理 - * - * @param {Object} shape shape类 - * @param {Object} area 目标区域 - * @param {number} x 横坐标 - * @param {number} y 纵坐标 - * @return {boolean} true表示坐标处在图形中 - */ - function _pixelMethod(shape, area, x, y) { - var _rect = area.__rect || shape.getRect(area); - var _context = util.getPixelContext(); - var _offset = util.getPixelOffset(); - - util.adjustCanvasSize(x, y); - _context.clearRect(_rect.x, _rect.y, _rect.width, _rect.height); - _context.beginPath(); - shape.brush(_context, {style : area}); - _context.closePath(); - - return _isPainted(_context, x + _offset.x, y + _offset.y); - } - - /** - * 坐标像素值,判断坐标是否被作色 - * - * @param {Object} context : 上下文 - * @param {number} x : 横坐标 - * @param {number} y : 纵坐标 - * @param {number=} unit : 触发的精度,越大越容易触发,可选,缺省是为1 - * @return {boolean} 已经被画过返回true - */ - function _isPainted(context, x, y, unit) { - var pixelsData; - - if (typeof unit != 'undefined') { - unit = (unit || 1 ) >> 1; - pixelsData = context.getImageData( - x - unit, - y - unit, - unit + unit, - unit + unit - ).data; - } - else { - pixelsData = context.getImageData(x, y, 1, 1).data; - } - - var len = pixelsData.length; - while (len--) { - if (pixelsData[len] !== 0) { - return true; - } - } - - return false; - } - - /** - * !isInside - */ - function isOutside(shape, area, x, y) { - return !isInside(shape, area, x, y); - } - - /** - * 线段包含判断 - */ - function _isInsideLine(area, x, y) { - var _x1 = area.xStart; - var _y1 = area.yStart; - var _x2 = area.xEnd; - var _y2 = area.yEnd; - var _l = Math.max(area.lineWidth, 5); - var _a = 0; - var _b = _x1; - - var minX, maxX; - if (_x1 < _x2) { - minX = _x1 - _l; maxX = _x2 + _l; - } else { - minX = _x2 - _l; maxX = _x1 + _l; - } - - var minY, maxY; - if (_y1 < _y2) { - minY = _y1 - _l; maxY = _y2 + _l; - } else { - minY = _y2 - _l; maxY = _y1 + _l; - } - - if (x < minX || x > maxX || y < minY || y > maxY) { - return false; - } - - if (_x1 !== _x2) { - _a = (_y1 - _y2) / (_x1 - _x2); - _b = (_x1 * _y2 - _x2 * _y1) / (_x1 - _x2) ; - } - else { - return Math.abs(x - _x1) <= _l / 2; - } - - var _s = (_a * x - y + _b) * (_a * x - y + _b) / (_a * _a + 1); - return _s <= _l / 2 * _l / 2; - } - - function _isInsideBrokenLine(area, x, y) { - var pointList = area.pointList; - var lineArea = { - xStart : 0, - yStart : 0, - xEnd : 0, - yEnd : 0, - lineWidth : 0 - }; - for (var i = 0, l = pointList.length - 1; i < l; i++) { - lineArea.xStart = pointList[i][0]; - lineArea.yStart = pointList[i][1]; - lineArea.xEnd = pointList[i + 1][0]; - lineArea.yEnd = pointList[i + 1][1]; - lineArea.lineWidth = Math.max(area.lineWidth, 10); - - if (_isInsideLine(lineArea, x, y)) { - return true; - } - } - - return false; - } - - function _isInsideRing(area, x, y) { - return _isInsideCircle(area, x, y, area.r) - && !_isInsideCircle({x: area.x, y: area.y}, x, y, area.r0 || 0); - } - - /** - * 矩形包含判断 - */ - function _isInsideRectangle(area, x, y) { - return x >= area.x - && x <= (area.x + area.width) - && y >= area.y - && y <= (area.y + area.height); - } - - /** - * 圆形包含判断 - */ - function _isInsideCircle(area, x, y, r) { - return (x - area.x) * (x - area.x) + (y - area.y) * (y - area.y) - < r * r; - } - - /** - * 扇形包含判断 - */ - function _isInsideSector(area, x, y) { - if (!_isInsideCircle(area, x, y, area.r) - || (area.r0 > 0 - && _isInsideCircle( - { - x : area.x, - y : area.y - }, - x, y, - area.r0 - ) - ) - ){ - // 大圆外或者小圆内直接false - return false; - } - - // 判断夹角 - if (Math.abs(area.endAngle - area.startAngle) >= 360) { - // 大于360度的扇形,在环内就为true - return true; - } - - var angle = (360 - - Math.atan2(y - area.y, x - area.x) / Math.PI - * 180) - % 360; - var endA = (360 + area.endAngle) % 360; - var startA = (360 + area.startAngle) % 360; - if (endA > startA) { - return (angle >= startA && angle <= endA); - } - - return !(angle >= endA && angle <= startA); - } - - /** - * 多边形包含判断 - * 警告:下面这段代码会很难看,建议跳过~ - */ - function _isInsidePolygon(area, x, y) { - /** - * 射线判别法 - * 如果一个点在多边形内部,任意角度做射线肯定会与多边形要么有一个交点,要么有与多边形边界线重叠 - * 如果一个点在多边形外部,任意角度做射线要么与多边形有一个交点, - * 要么有两个交点,要么没有交点,要么有与多边形边界线重叠。 - */ - var i; - var j; - var polygon = area.pointList; - var N = polygon.length; - var inside = false; - var redo = true; - var v; - - for (i = 0; i < N; ++i) { - // 是否在顶点上 - if (polygon[i][0] == x && polygon[i][1] == y ) { - redo = false; - inside = true; - break; - } - } - - if (redo) { - redo = false; - inside = false; - for (i = 0,j = N - 1; i < N; j = i++) { - if ((polygon[i][1] < y && y < polygon[j][1]) - || (polygon[j][1] < y && y < polygon[i][1]) - ) { - if (x <= polygon[i][0] || x <= polygon[j][0]) { - v = (y - polygon[i][1]) - * (polygon[j][0] - polygon[i][0]) - / (polygon[j][1] - polygon[i][1]) - + polygon[i][0]; - if (x < v) { // 在线的左侧 - inside = !inside; - } - else if (x == v) { // 在线上 - inside = true; - break; - } - } - } - else if (y == polygon[i][1]) { - if (x < polygon[i][0]) { // 交点在顶点上 - polygon[i][1] > polygon[j][1] ? --y : ++y; - //redo = true; - break; - } - } - else if (polygon[i][1] == polygon[j][1] // 在水平的边界线上 - && y == polygon[i][1] - && ((polygon[i][0] < x && x < polygon[j][0]) - || (polygon[j][0] < x && x < polygon[i][0])) - ) { - inside = true; - break; - } - } - } - return inside; - } - - /** - * 路径包含判断,依赖多边形判断 - */ - function _isInsidePath(area, x, y) { - if (!area.pointList) { - require('../shape/Path').prototype.buildPath(_ctx, area); - } - var pointList = area.pointList; - var insideCatch = false; - for (var i = 0, l = pointList.length; i < l; i++) { - insideCatch = _isInsidePolygon( - { pointList : pointList[i] }, x, y - ); - - if (insideCatch) { - break; - } - } - - return insideCatch; - } - - /** - * 测算多行文本宽度 - * @param {Object} text - * @param {Object} textFont - */ - function getTextWidth(text, textFont) { - var key = text+':'+textFont; - if (_textWidthCache[key]) { - return _textWidthCache[key]; - } - _ctx = _ctx || util.getContext(); - _ctx.save(); - - if (textFont) { - _ctx.font = textFont; - } - - text = (text + '').split('\n'); - var width = 0; - for (var i = 0, l = text.length; i < l; i++) { - width = Math.max( - _ctx.measureText(text[i]).width, - width - ); - } - _ctx.restore(); - - _textWidthCache[key] = width; - if (++_textWidthCacheCounter > TEXT_CACHE_MAX) { - // 内存释放 - _textWidthCacheCounter = 0; - _textWidthCache = {}; - } - - return width; - } - - /** - * 测算多行文本高度 - * @param {Object} text - * @param {Object} textFont - */ - function getTextHeight(text, textFont) { - var key = text+':'+textFont; - if (_textHeightCache[key]) { - return _textHeightCache[key]; - } - - _ctx = _ctx || util.getContext(); - - _ctx.save(); - if (textFont) { - _ctx.font = textFont; - } - - text = (text + '').split('\n'); - //比较粗暴 - var height = (_ctx.measureText('国').width + 2) * text.length; - - _ctx.restore(); - - _textHeightCache[key] = height; - if (++_textHeightCacheCounter > TEXT_CACHE_MAX) { - // 内存释放 - _textHeightCacheCounter = 0; - _textHeightCache = {}; - } - return height; - } - - return { - isInside : isInside, - isOutside : isOutside, - getTextWidth : getTextWidth, - getTextHeight : getTextHeight - }; - } -); - -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:文字 - * 可配图形属性: - { - // 基础属性 - shape : 'text', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,横坐标 - y : {number}, // 必须,纵坐标 - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',线条颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 必须,文本内容 - textFont : {string}, // 默认为null,文本文字样式,eg:'bold 18px verdana' - textAlign : {string}, // 默认为start,文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认为middle,文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - maxWidth : {number} // 默认为null,最大宽度 - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'text', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - color : 'red', - text : 'Baidu' - }, - myName : 'kener', //可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - 'zrender/shape/Text',['require','../tool/area','./Base','../tool/util'],function (require) { - var area = require('../tool/area'); - var Base = require('./Base'); - - function Text(options) { - Base.call(this, options); - } - - Text.prototype = { - type: 'text', - - /** - * 画刷,重载基类方法 - * @param {Context2D} ctx Canvas 2D上下文 - * @param isHighlight 是否为高亮状态 - */ - brush : function(ctx, isHighlight) { - var style = this.style; - if (isHighlight) { - // 根据style扩展默认高亮样式 - style = this.getHighlightStyle( - style, this.highlightStyle || {} - ); - } - - if (typeof(style.text) == 'undefined' || style.text === false) { - return; - } - - ctx.save(); - this.setContext(ctx, style); - - // 设置transform - this.setTransform(ctx); - - if (style.textFont) { - ctx.font = style.textFont; - } - ctx.textAlign = style.textAlign || 'start'; - ctx.textBaseline = style.textBaseline || 'middle'; - - var text = (style.text + '').split('\n'); - var lineHeight = area.getTextHeight('国', style.textFont); - var rect = this.getRect(style); - var x = style.x; - var y; - if (style.textBaseline == 'top') { - y = rect.y; - } - else if (style.textBaseline == 'bottom') { - y = rect.y + lineHeight; - } - else { - y = rect.y + lineHeight / 2; - } - - for (var i = 0, l = text.length; i < l; i++) { - if (style.maxWidth) { - switch (style.brushType) { - case 'fill': - ctx.fillText( - text[i], - x, y, style.maxWidth - ); - break; - case 'stroke': - ctx.strokeText( - text[i], - x, y, style.maxWidth - ); - break; - case 'both': - ctx.fillText( - text[i], - x, y, style.maxWidth - ); - ctx.strokeText( - text[i], - x, y, style.maxWidth - ); - break; - default: - ctx.fillText( - text[i], - x, y, style.maxWidth - ); - } - } - else{ - switch (style.brushType) { - case 'fill': - ctx.fillText(text[i], x, y); - break; - case 'stroke': - ctx.strokeText(text[i], x, y); - break; - case 'both': - ctx.fillText(text[i], x, y); - ctx.strokeText(text[i], x, y); - break; - default: - ctx.fillText(text[i], x, y); - } - } - y += lineHeight; - } - - ctx.restore(); - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function(style) { - if (style.__rect) { - return style.__rect; - } - - var width = area.getTextWidth(style.text, style.textFont); - var height = area.getTextHeight(style.text, style.textFont); - - var textX = style.x; //默认start == left - if (style.textAlign == 'end' || style.textAlign == 'right') { - textX -= width; - } - else if (style.textAlign == 'center') { - textX -= (width / 2); - } - - var textY; - if (style.textBaseline == 'top') { - textY = style.y; - } - else if (style.textBaseline == 'bottom') { - textY = style.y - height; - } - else { - // middle - textY = style.y - height / 2; - } - - style.__rect = { - x : textX, - y : textY, - width : width, - height : height - }; - - return style.__rect; - } - }; - - require('../tool/util').inherits(Text, Base); - return Text; - } -); - -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) , - * strwind (@劲风FEI, yaofeifei@baidu.com) - * - * shape类:矩形 - * 可配图形属性: - { - // 基础属性 - shape : 'rectangle', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,左上角横坐标 - y : {number}, // 必须,左上角纵坐标 - width : {number}, // 必须,宽度 - height : {number}, // 必须,高度 - radius : {array}, // 默认为[0],圆角 - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为top,附加文本位置。 - // inside | left | right | top | bottom - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'rectangle', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - width : 150, - height : 50, - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - 'zrender/shape/Rectangle',['require','./Base','../tool/util'],function (require) { - var Base = require('./Base'); - - function Rectangle(options) { - Base.call(this, options); - } - - Rectangle.prototype = { - type: 'rectangle', - - /** - * 绘制圆角矩形 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - _buildRadiusPath: function(ctx, style) { - //左上、右上、右下、左下角的半径依次为r1、r2、r3、r4 - //r缩写为1 相当于 [1, 1, 1, 1] - //r缩写为[1] 相当于 [1, 1, 1, 1] - //r缩写为[1, 2] 相当于 [1, 2, 1, 2] - //r缩写为[1, 2, 3] 相当于 [1, 2, 3, 2] - var x = style.x; - var y = style.y; - var width = style.width; - var height = style.height; - var r = style.radius; - var r1; - var r2; - var r3; - var r4; - - if(typeof r === 'number') { - r1 = r2 = r3 = r4 = r; - } - else if(r instanceof Array) { - if (r.length === 1) { - r1 = r2 = r3 = r4 = r[0]; - } - else if(r.length === 2) { - r1 = r3 = r[0]; - r2 = r4 = r[1]; - } - else if(r.length === 3) { - r1 = r[0]; - r2 = r4 = r[1]; - r3 = r[2]; - } else { - r1 = r[0]; - r2 = r[1]; - r3 = r[2]; - r4 = r[3]; - } - } else { - r1 = r2 = r3 = r4 = 0; - } - ctx.moveTo(x + r1, y); - ctx.lineTo(x + width - r2, y); - r2 !== 0 && ctx.quadraticCurveTo( - x + width, y, x + width, y + r2 - ); - ctx.lineTo(x + width, y + height - r3); - r3 !== 0 && ctx.quadraticCurveTo( - x + width, y + height, x + width - r3, y + height - ); - ctx.lineTo(x + r4, y + height); - r4 !== 0 && ctx.quadraticCurveTo( - x, y + height, x, y + height - r4 - ); - ctx.lineTo(x, y + r1); - r1 !== 0 && ctx.quadraticCurveTo(x, y, x + r1, y); - }, - - /** - * 创建矩形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - if(!style.radius) { - ctx.moveTo(style.x, style.y); - ctx.lineTo(style.x + style.width, style.y); - ctx.lineTo(style.x + style.width, style.y + style.height); - ctx.lineTo(style.x, style.y + style.height); - ctx.lineTo(style.x, style.y); - //ctx.rect(style.x, style.y, style.width, style.height); - } else { - this._buildRadiusPath(ctx, style); - } - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function(style) { - if (style.__rect) { - return style.__rect; - } - - var lineWidth; - if (style.brushType == 'stroke' || style.brushType == 'fill') { - lineWidth = style.lineWidth || 1; - } - else { - lineWidth = 0; - } - style.__rect = { - x : Math.round(style.x - lineWidth / 2), - y : Math.round(style.y - lineWidth / 2), - width : style.width + lineWidth, - height : style.height + lineWidth - }; - - return style.__rect; - } - }; - - require('../tool/util').inherits(Rectangle, Base); - return Rectangle; - } -); -/** - * zrender: loading特效类 - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * errorrik (errorrik@gmail.com) - */ - -define( - 'zrender/loadingEffect/Base',['require','../tool/util','../shape/Text','../shape/Rectangle'],function(require) { - var util = require('../tool/util'); - var TextShape = require('../shape/Text'); - var RectangleShape = require('../shape/Rectangle'); - - - var DEFAULT_TEXT = 'Loading...'; - var DEFAULT_TEXT_FONT = 'normal 16px Arial'; - - /** - * @constructor - * - * @param {Object} options 选项 - * @param {color} options.backgroundColor 背景颜色 - * @param {Object} options.textStyle 文字样式,同shape/text.style - * @param {number=} options.progress 进度参数,部分特效有用 - * @param {Object=} options.effect 特效参数,部分特效有用 - * - * { - * effect, - * //loading话术 - * text:'', - * // 水平安放位置,默认为 'center',可指定x坐标 - * x:'center' || 'left' || 'right' || {number}, - * // 垂直安放位置,默认为'top',可指定y坐标 - * y:'top' || 'bottom' || {number}, - * - * textStyle:{ - * textFont: 'normal 20px Arial' || {textFont}, //文本字体 - * color: {color} - * } - * } - */ - function Base(options) { - this.setOptions(options); - } - - /** - * 创建loading文字图形 - * - * @param {Object} textStyle 文字style,同shape/text.style - */ - Base.prototype.createTextShape = function (textStyle) { - return new TextShape({ - highlightStyle : util.merge( - { - x : this.canvasWidth / 2, - y : this.canvasHeight / 2, - text : DEFAULT_TEXT, - textAlign : 'center', - textBaseline : 'middle', - textFont : DEFAULT_TEXT_FONT, - color: '#333', - brushType : 'fill' - }, - textStyle, - true - ) - }); - }; - - /** - * 获取loading背景图形 - * - * @param {color} color 背景颜色 - */ - Base.prototype.createBackgroundShape = function (color) { - return new RectangleShape({ - highlightStyle : { - x : 0, - y : 0, - width : this.canvasWidth, - height : this.canvasHeight, - brushType : 'fill', - color : color - } - }); - }; - - Base.prototype.start = function (painter) { - this.canvasWidth = painter._width; - this.canvasHeight = painter._height; - - function addShapeHandle(param) { - painter.storage.addHover(param); - } - function refreshHandle() { - painter.refreshHover(); - } - this.loadingTimer = this._start(addShapeHandle, refreshHandle); - }; - - Base.prototype._start = function (/*addShapeHandle, refreshHandle*/) { - return setInterval(function(){}, 10000); - }; - - Base.prototype.stop = function () { - clearInterval(this.loadingTimer); - }; - - Base.prototype.setOptions = function (options) { - this.options = options || {}; - }; - - Base.prototype.adjust = function (value, region) { - if (value <= region[0]) { - value = region[0]; - } - else if (value >= region[1]) { - value = region[1]; - } - return value; - }; - - return Base; - } -); - -/** - * zrender - * - * @author lang( shenyi01@baidu.com ) - * - * shape类:图片 - * 可配图形属性: - { - // 基础属性 - shape : 'image', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,左上角横坐标 - y : {number}, // 必须,左上角纵坐标 - width : {number}, // 可选,宽度 - height : {number}, // 可选,高度 - sx : {number}, // 可选, 从图片中裁剪的x - sy : {number}, // 可选, 从图片中裁剪的y - sWidth : {number}, // 可选, 从图片中裁剪的宽度 - sHeight : {number}, // 可选, 从图片中裁剪的高度 - image : {string|Image} // 必须,图片url或者图片对象 - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为top,附加文本位置。 - // inside | left | right | top | bottom - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'image', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - width : 150, - height : 50, - image : 'tests.jpg', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - 'zrender/shape/Image',['require','./Base','../tool/util'],function (require) { - var _cache = {}; - var _needsRefresh = []; - var _refreshTimeout; - - var Base = require('./Base'); - - function ZImage(options) { - Base.call(this, options); - } - - ZImage.prototype = { - type: 'image', - brush : function(ctx, isHighlight, refresh) { - var style = this.style || {}; - - if (isHighlight) { - // 根据style扩展默认高亮样式 - style = this.getHighlightStyle( - style, this.highlightStyle || {} - ); - } - - var image = style.image; - var me = this; - - if (typeof(image) === 'string') { - var src = image; - if (_cache[src]) { - image = _cache[src]; - } - else { - image = new Image();//document.createElement('image'); - image.onload = function(){ - image.onload = null; - clearTimeout(_refreshTimeout); - _needsRefresh.push( me ); - // 防止因为缓存短时间内触发多次onload事件 - _refreshTimeout = setTimeout(function(){ - refresh && refresh( _needsRefresh ); - // 清空needsRefresh - _needsRefresh = []; - }, 10); - }; - _cache[src] = image; - - image.src = src; - } - } - if (image) { - //图片已经加载完成 - if (image.nodeName.toUpperCase() == 'IMG') { - if (window.ActiveXObject) { - if (image.readyState != 'complete') { - return; - } - } - else { - if (!image.complete) { - return; - } - } - } - // Else is canvas - - var width = style.width || image.width; - var height = style.height || image.height; - var x = style.x; - var y = style.y; - - // 图片加载失败 - if (!image.width || !image.height) { - return; - } - - ctx.save(); - this.setContext(ctx, style); - - // 设置transform - this.setTransform(ctx); - - if (style.sWidth && style.sHeight) { - var sx = style.sx || 0; - var sy = style.sy || 0; - ctx.drawImage( - image, - sx, sy, style.sWidth, style.sHeight, - x, y, width, height - ); - } - else if (style.sx && style.sy) { - var sx = style.sx; - var sy = style.sy; - var sWidth = width - sx; - var sHeight = height - sy; - ctx.drawImage( - image, - sx, sy, sWidth, sHeight, - x, y, width, height - ); - } - else { - ctx.drawImage(image, x, y, width, height); - } - // 如果没设置宽和高的话自动根据图片宽高设置 - style.width = width; - style.height = height; - this.style.width = width; - this.style.height = height; - - - this.drawText(ctx, style, this.style); - - ctx.restore(); - } - }, - - /** - * 创建路径,用于判断hover时调用isPointInPath~ - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - ctx.rect(style.x, style.y, style.width, style.height); - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function(style) { - return { - x : style.x, - y : style.y, - width : style.width, - height : style.height - }; - } - }; - - require('../tool/util').inherits(ZImage, Base); - return ZImage; - } -); -/** - * Painter绘图模块 - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * errorrik (errorrik@gmail.com) - */ - - - -define( - 'zrender/Painter',['require','./config','./tool/util','./tool/log','./tool/matrix','./loadingEffect/Base','./shape/Image'],function (require) { - - - - var config = require('./config'); - var util = require('./tool/util'); - var log = require('./tool/log'); - var matrix = require('./tool/matrix'); - var BaseLoadingEffect = require('./loadingEffect/Base'); - - // retina 屏幕优化 - var devicePixelRatio = window.devicePixelRatio || 1; - devicePixelRatio = Math.max(devicePixelRatio, 1); - var vmlCanvasManager = window.G_vmlCanvasManager; - - /** - * 返回false的方法,用于避免页面被选中 - * - * @inner - */ - function returnFalse() { - return false; - } - - /** - * 什么都不干的空方法 - * - * @inner - */ - function doNothing() {} - - /** - * 绘图类 (V) - * - * @param {HTMLElement} root 绘图区域 - * @param {storage} storage Storage实例 - */ - function Painter(root, storage) { - this.root = root; - this.storage = storage; - - root.innerHTML = ''; - this._width = this._getWidth(); // 宽,缓存记录 - this._height = this._getHeight(); // 高,缓存记录 - - var domRoot = document.createElement('div'); - this._domRoot = domRoot; - - //domRoot.onselectstart = returnFalse; // 避免页面选中的尴尬 - domRoot.style.position = 'relative'; - domRoot.style.overflow = 'hidden'; - domRoot.style.width = this._width + 'px'; - domRoot.style.height = this._height + 'px'; - root.appendChild(domRoot); - - this._layers = {}; - - this._layerConfig = {}; - - this._loadingEffect = new BaseLoadingEffect({}); - this.shapeToImage = this._createShapeToImageProcessor(); - - // 创建各层canvas - // 背景 - this._bgDom = createDom('bg', 'div', this); - domRoot.appendChild(this._bgDom); - - // 高亮 - var hoverLayer = new Layer('_zrender_hover_', this); - this._layers['hover'] = hoverLayer; - domRoot.appendChild(hoverLayer.dom); - hoverLayer.initContext(); - - hoverLayer.onselectstart = returnFalse; - - var me = this; - this.updatePainter = function(shapeList, callback) { - me.update(shapeList, callback); - }; - } - - /** - * 首次绘图,创建各种dom和context - * - * @param {Function=} callback 绘画结束后的回调函数 - */ - Painter.prototype.render = function (callback) { - if (this.isLoading()) { - this.hideLoading(); - } - // TODO - this.refresh(callback, true); - - return this; - }; - - /** - * 刷新 - * - * @param {Function=} callback 刷新结束后的回调函数 - * @param {Boolean} paintAll 强制绘制所有shape - */ - Painter.prototype.refresh = function (callback, paintAll) { - var list = this.storage.getShapeList(true); - this._paintList(list, paintAll); - - if (typeof callback == 'function') { - callback(); - } - - return this; - }; - - Painter.prototype._paintList = function(list, paintAll) { - - if (typeof(paintAll) == 'undefined') { - paintAll = false; - } - - this._updateLayerStatus(list); - - var currentLayer; - var currentZLevel; - var ctx; - - for (var id in this._layers) { - if (id !== 'hover') { - this._layers[id].unusedCount++; - } - } - - var invTransform = []; - - for (var i = 0, l = list.length; i < l; i++) { - var shape = list[i]; - - if (currentZLevel !== shape.zlevel) { - currentLayer = this.getLayer(shape.zlevel, currentLayer); - ctx = currentLayer.ctx; - currentZLevel = shape.zlevel; - - // Reset the count - currentLayer.unusedCount = 0; - - if (currentLayer.dirty || paintAll) { - currentLayer.clear(); - } - } - - // Start group clipping - if (shape.__startClip && !vmlCanvasManager) { - var clipShape = shape.__startClip; - ctx.save(); - // Set transform - if (clipShape.needTransform) { - var m = clipShape.transform; - matrix.invert(invTransform, m); - ctx.transform( - m[0], m[1], - m[2], m[3], - m[4], m[5] - ); - } - - ctx.beginPath(); - clipShape.buildPath(ctx, clipShape.style); - ctx.clip(); - - // Transform back - if (clipShape.needTransform) { - var m = invTransform; - ctx.transform( - m[0], m[1], - m[2], m[3], - m[4], m[5] - ); - } - } - - if ((currentLayer.dirty || paintAll) && !shape.invisible) { - if ( - !shape.onbrush - || (shape.onbrush && !shape.onbrush(ctx, false)) - ) { - if (config.catchBrushException) { - try { - shape.brush(ctx, false, this.updatePainter); - } - catch(error) { - log( - error, - 'brush error of ' + shape.type, - shape - ); - } - } else { - shape.brush(ctx, false, this.updatePainter); - } - } - } - - // Stop group clipping - if (shape.__stopClip && !vmlCanvasManager) { - ctx.restore(); - } - - shape.__dirty = false; - } - - for (var id in this._layers) { - if (id !== 'hover') { - var layer = this._layers[id]; - layer.dirty = false; - // 删除过期的层 - if (layer.unusedCount >= 500) { - delete this._layers[id]; - layer.dom.parentNode.removeChild(layer.dom); - } - else if (layer.unusedCount == 1) { - layer.clear(); - } - } - } - }; - - Painter.prototype.getLayer = function(zlevel, prevLayer) { - // Change draw layer - var currentLayer = this._layers[zlevel]; - if (!currentLayer) { - // Create a new layer - currentLayer = new Layer(zlevel, this); - var prevDom = prevLayer ? prevLayer.dom : this._bgDom; - if (prevDom.nextSibling) { - prevDom.parentNode.insertBefore( - currentLayer.dom, - prevDom.nextSibling - ); - } else { - prevDom.parentNode.appendChild( - currentLayer.dom - ); - } - currentLayer.initContext(); - - this._layers[zlevel] = currentLayer; - - currentLayer.config = this._layerConfig[zlevel]; - } - - return currentLayer; - }; - - Painter.prototype._updateLayerStatus = function(list) { - - var layers = this._layers; - - var elCounts = {}; - for (var z in layers) { - if (z !== 'hover') { - elCounts[z] = layers[z].elCount; - layers[z].elCount = 0; - } - } - - for (var i = 0, l = list.length; i < l; i++) { - var shape = list[i]; - var zlevel = shape.zlevel; - var layer = layers[zlevel]; - if (layer) { - layer.elCount++; - // 已经被标记为需要刷新 - if (layer.dirty) { - continue; - } - layer.dirty = shape.__dirty; - } - } - - // 层中的元素数量有发生变化 - for (var z in layers) { - if (z !== 'hover') { - if (elCounts[z] !== layers[z].elCount) { - layers[z].dirty = true; - } - } - } - }; - - /** - * 视图更新 - * - * @param {Array} shapeList 需要更新的图形元素列表 - * @param {Function} callback 视图更新后回调函数 - */ - Painter.prototype.update = function (shapeList, callback) { - for (var i = 0, l = shapeList.length; i < l; i++) { - var shape = shapeList[i]; - this.storage.mod(shape.id); - } - - this.refresh(callback); - return this; - }; - - /** - * 设置loading特效 - * - * @param {Object} loadingEffect loading特效 - * @return {Painter} - */ - Painter.prototype.setLoadingEffect = function (loadingEffect) { - this._loadingEffect = loadingEffect; - return this; - }; - - /** - * 清除hover层外所有内容 - */ - Painter.prototype.clear = function () { - for (var k in this._layers) { - if (k == 'hover') { - continue; - } - this._layers[k].clear(); - } - - return this; - }; - - /** - * 修改指定zlevel的绘制参数 - */ - Painter.prototype.modLayer = function (zlevel, config) { - if (config) { - if (!this._layerConfig[zlevel]) { - this._layerConfig[zlevel] = config; - } else { - util.merge(this._layerConfig[zlevel], config, true); - } - - var layer = this._layers[zlevel]; - - if (layer) { - layer.config = this._layerConfig[zlevel]; - } - } - }; - - /** - * 刷新hover层 - */ - Painter.prototype.refreshHover = function () { - this.clearHover(); - var list = this.storage.getHoverShapes(true); - for (var i = 0, l = list.length; i < l; i++) { - this._brushHover(list[i]); - } - this.storage.delHover(); - - return this; - }; - - /** - * 清除hover层所有内容 - */ - Painter.prototype.clearHover = function () { - var hover = this._layers.hover; - hover && hover.clear(); - - return this; - }; - - /** - * 显示loading - * - * @param {Object=} loadingEffect loading效果对象 - */ - Painter.prototype.showLoading = function (loadingEffect) { - this._loadingEffect && this._loadingEffect.stop(); - loadingEffect && this.setLoadingEffect(loadingEffect); - this._loadingEffect.start(this); - this.loading = true; - - return this; - }; - - /** - * loading结束 - */ - Painter.prototype.hideLoading = function () { - this._loadingEffect.stop(); - - this.clearHover(); - this.loading = false; - return this; - }; - - /** - * loading结束判断 - */ - Painter.prototype.isLoading = function () { - return this.loading; - }; - - /** - * 区域大小变化后重绘 - */ - Painter.prototype.resize = function () { - var domRoot = this._domRoot; - domRoot.style.display = 'none'; - - var width = this._getWidth(); - var height = this._getHeight(); - - domRoot.style.display = ''; - - // 优化没有实际改变的resize - if (this._width != width || height != this._height){ - this._width = width; - this._height = height; - - domRoot.style.width = width + 'px'; - domRoot.style.height = height + 'px'; - - for (var id in this._layers) { - - this._layers[id].resize(width, height); - } - - this.refresh(null, true); - } - - return this; - }; - - /** - * 清除单独的一个层 - */ - Painter.prototype.clearLayer = function (k) { - var layer = this._layers[k]; - if (layer) { - layer.clear(); - } - }; - - /** - * 释放 - */ - Painter.prototype.dispose = function () { - if (this.isLoading()) { - this.hideLoading(); - } - - this.root.innerHTML = ''; - - this.root = - this.storage = - - this._domRoot = - this._layers = null; - }; - - Painter.prototype.getDomHover = function () { - return this._layers.hover.dom; - }; - - Painter.prototype.toDataURL = function (type, backgroundColor, args) { - if (vmlCanvasManager) { - return null; - } - - var imageDom = createDom('image', 'canvas', this); - this._bgDom.appendChild(imageDom); - var ctx = imageDom.getContext('2d'); - devicePixelRatio != 1 - && ctx.scale(devicePixelRatio, devicePixelRatio); - - ctx.fillStyle = backgroundColor || '#fff'; - ctx.rect( - 0, 0, - this._width * devicePixelRatio, - this._height * devicePixelRatio - ); - ctx.fill(); - - //升序遍历,shape上的zlevel指定绘画图层的z轴层叠 - - this.storage.iterShape( - function (shape) { - if (!shape.invisible) { - if (!shape.onbrush //没有onbrush - //有onbrush并且调用执行返回false或undefined则继续粉刷 - || (shape.onbrush && !shape.onbrush(ctx, false)) - ) { - if (config.catchBrushException) { - try { - shape.brush(ctx, false, this.updatePainter); - } - catch(error) { - log( - error, - 'brush error of ' + shape.type, - shape - ); - } - } - else { - shape.brush(ctx, false, this.updatePainter); - } - } - } - }, - { normal: 'up', update: true } - ); - var image = imageDom.toDataURL(type, args); - ctx = null; - this._bgDom.removeChild(imageDom); - return image; - }; - - /** - * 获取绘图区域宽度 - */ - Painter.prototype.getWidth = function () { - return this._width; - }; - - /** - * 获取绘图区域高度 - */ - Painter.prototype.getHeight = function () { - return this._height; - }; - - Painter.prototype._getWidth = function() { - var root = this.root; - var stl = root.currentStyle - || document.defaultView.getComputedStyle(root); - - return ((root.clientWidth || parseInt(stl.width, 10)) - - parseInt(stl.paddingLeft, 10) // 请原谅我这比较粗暴 - - parseInt(stl.paddingRight, 10)).toFixed(0) - 0; - }; - - Painter.prototype._getHeight = function () { - var root = this.root; - var stl = root.currentStyle - || document.defaultView.getComputedStyle(root); - - return ((root.clientHeight || parseInt(stl.height, 10)) - - parseInt(stl.paddingTop, 10) // 请原谅我这比较粗暴 - - parseInt(stl.paddingBottom, 10)).toFixed(0) - 0; - }; - - /** - * 鼠标悬浮刷画 - */ - Painter.prototype._brushHover = function (shape) { - var ctx = this._layers.hover.ctx; - - if (!shape.onbrush //没有onbrush - //有onbrush并且调用执行返回false或undefined则继续粉刷 - || (shape.onbrush && !shape.onbrush(ctx, true)) - ) { - // Retina 优化 - if (config.catchBrushException) { - try { - shape.brush(ctx, true, this.updatePainter); - } - catch(error) { - log( - error, 'hoverBrush error of ' + shape.type, shape - ); - } - } - else { - shape.brush(ctx, true, this.updatePainter); - } - } - }; - - Painter.prototype._shapeToImage = function ( - id, shape, width, height, devicePixelRatio - ) { - var canvas = document.createElement('canvas'); - var ctx = canvas.getContext('2d'); - var devicePixelRatio = window.devicePixelRatio || 1; - - canvas.style.width = width + 'px'; - canvas.style.height = height + 'px'; - canvas.setAttribute('width', width * devicePixelRatio); - canvas.setAttribute('height', height * devicePixelRatio); - - ctx.clearRect(0, 0, width * devicePixelRatio, height * devicePixelRatio); - - var shapeTransform = { - position : shape.position, - rotation : shape.rotation, - scale : shape.scale - }; - shape.position = [0, 0, 0]; - shape.rotation = 0; - shape.scale = [1, 1]; - if (shape) { - shape.brush(ctx, false); - } - - var ImageShape = require( './shape/Image' ); - var imgShape = new ImageShape({ - id : id, - style : { - x : 0, - y : 0, - image : canvas - } - }); - - if (shapeTransform.position != null) { - imgShape.position = shape.position = shapeTransform.position; - } - - if (shapeTransform.rotation != null) { - imgShape.rotation = shape.rotation = shapeTransform.rotation; - } - - if (shapeTransform.scale != null) { - imgShape.scale = shape.scale = shapeTransform.scale; - } - - return imgShape; - }; - - Painter.prototype._createShapeToImageProcessor = function () { - if (vmlCanvasManager) { - return doNothing; - } - - var painter = this; - - return function (id, e, width, height) { - return painter._shapeToImage( - id, e, width, height, devicePixelRatio - ); - }; - }; - - /** - * 创建dom - * - * @inner - * @param {string} id dom id 待用 - * @param {string} type dom type,such as canvas, div etc. - * @param {Painter} painter painter instance - */ - function createDom(id, type, painter) { - var newDom = document.createElement(type); - var width = painter._width; - var height = painter._height; - - // 没append呢,请原谅我这样写,清晰~ - newDom.style.position = 'absolute'; - newDom.style.left = 0; - newDom.style.top = 0; - newDom.style.width = width + 'px'; - newDom.style.height = height + 'px'; - newDom.setAttribute('width', width * devicePixelRatio); - newDom.setAttribute('height', height * devicePixelRatio); - - // id不作为索引用,避免可能造成的重名,定义为私有属性 - newDom.setAttribute('data-zr-dom-id', id); - return newDom; - } - - /***************************************** - * Layer - *****************************************/ - function Layer(id, painter) { - this.dom = createDom(id, 'canvas', painter); - vmlCanvasManager && vmlCanvasManager.initElement(this.dom); - - this.domBack = null; - this.ctxBack = null; - - this.painter = painter; - - this.unusedCount = 0; - - this.config = null; - - this.dirty = true; - - this.elCount = 0; - } - - Layer.prototype.initContext = function() { - this.ctx = this.dom.getContext('2d'); - if (devicePixelRatio != 1) { - this.ctx.scale(devicePixelRatio, devicePixelRatio); - } - } - - Layer.prototype.createBackBuffer = function() { - if (vmlCanvasManager) { // IE 8- should not support back buffer - return; - } - this.domBack = createDom('back-' + this.id, 'canvas', this.painter); - this.ctxBack = this.domBack.getContext('2d'); - - if (devicePixelRatio != 1) { - this.ctxBack.scale(devicePixelRatio, devicePixelRatio); - } - }; - - Layer.prototype.resize = function(width, height) { - this.dom.style.width = width + 'px'; - this.dom.style.height = height + 'px'; - - this.dom.setAttribute('width', width * devicePixelRatio); - this.dom.setAttribute('height', height * devicePixelRatio); - - if (devicePixelRatio != 1) { - this.ctx.scale(devicePixelRatio, devicePixelRatio); - } - - if (this.domBack) { - this.domBack.setAttribute('width', width * devicePixelRatio); - this.domBack.setAttribute('height', height * devicePixelRatio); - - if (devicePixelRatio != 1) { - this.ctxBack.scale(devicePixelRatio, devicePixelRatio); - } - } - }; - - Layer.prototype.clear = function() { - var config = this.config; - var dom = this.dom; - var ctx = this.ctx; - var width = dom.width; - var height = dom.height; - - if (config) { - var haveClearColor = - typeof(config.clearColor) !== 'undefined' - && !vmlCanvasManager; - var haveMotionBLur = config.motionBlur && !vmlCanvasManager; - var lastFrameAlpha = config.lastFrameAlpha; - if (typeof(lastFrameAlpha) == 'undefined') { - lastFrameAlpha = 0.7; - } - - if (haveMotionBLur) { - if (!this.domBack) { - this.createBackBuffer(); - } - - this.ctxBack.globalCompositeOperation = 'copy'; - this.ctxBack.drawImage( - dom, 0, 0, - width / devicePixelRatio, - height / devicePixelRatio - ); - } - - if (haveClearColor) { - ctx.save(); - ctx.fillStyle = this.config.clearColor; - ctx.fillRect( - 0, 0, - width / devicePixelRatio, - height / devicePixelRatio - ); - ctx.restore(); - } - else { - ctx.clearRect( - 0, 0, - width / devicePixelRatio, - height / devicePixelRatio - ); - } - - if (haveMotionBLur) { - var domBack = this.domBack; - ctx.save(); - ctx.globalAlpha = lastFrameAlpha; - ctx.drawImage( - domBack, 0, 0, - width / devicePixelRatio, - height / devicePixelRatio - ); - ctx.restore(); - } - } - else { - ctx.clearRect( - 0, 0, - width / devicePixelRatio, - height / devicePixelRatio - ); - } - }; - - return Painter; - } -); - -define('zrender/shape/Group',['require','../tool/guid','../tool/util','../tool/event','./mixin/Transformable'],function(require) { - - var guid = require('../tool/guid'); - var util = require('../tool/util'); - - var Dispatcher = require('../tool/event').Dispatcher; - var Transformable = require('./mixin/Transformable'); - - /** - * @constructor zrender.shape.Group - */ - function Group(options) { - - options = options || {}; - - this.id = options.id || guid(); - - for (var key in options) { - this[key] = options[key]; - } - - this.type = 'group'; - - this.clipShape = null; - - this._children = []; - - this._storage = null; - - this.__dirty = true; - - // Mixin - Transformable.call(this); - Dispatcher.call(this); - } - - Group.prototype.ignore = false; - - Group.prototype.children = function() { - return this._children.slice(); - }; - - Group.prototype.childAt = function(idx) { - return this._children[idx]; - }; - - Group.prototype.addChild = function(child) { - if (child == this) { - return; - } - - if (child.parent == this) { - return; - } - if (child.parent) { - child.parent.removeChild(child); - } - - this._children.push(child); - child.parent = this; - - if (this._storage && this._storage !== child._storage) { - - this._storage.addToMap(child); - - if (child instanceof Group) { - child.addChildrenToStorage(this._storage); - } - } - }; - - Group.prototype.removeChild = function(child) { - var idx = util.indexOf(this._children, child); - - this._children.splice(idx, 1); - child.parent = null; - - if (child._storage) { - - this._storage.delFromMap(child.id); - - if (child instanceof Group) { - child.delChildrenFromStorage(child._storage); - } - } - }; - - Group.prototype.each = function(cb, context) { - var haveContext = !!context; - for (var i = 0; i < this._children.length; i++) { - var child = this._children[i]; - if (haveContext) { - cb.call(context, child); - } else { - cb(child); - } - } - }; - - Group.prototype.iterate = function(cb, context) { - var haveContext = !!context; - - for (var i = 0; i < this._children.length; i++) { - var child = this._children[i]; - if (haveContext) { - cb.call(context, child); - } else { - cb(child); - } - - if (child.type === 'group') { - child.iterate(cb, context); - } - } - }; - - Group.prototype.addChildrenToStorage = function(storage) { - for (var i = 0; i < this._children.length; i++) { - var child = this._children[i]; - storage.addToMap(child); - if (child.type === 'group') { - child.addChildrenToStorage(storage); - } - } - }; - - Group.prototype.delChildrenFromStorage = function(storage) { - for (var i = 0; i < this._children.length; i++) { - var child = this._children[i]; - storage.delFromMap(child); - if (child.type === 'group') { - child.delChildrenFromStorage(storage); - } - } - }; - - util.merge(Group.prototype, Transformable.prototype, true); - util.merge(Group.prototype, Dispatcher.prototype, true); - - return Group; -}); -/** - * Storage内容仓库模块 - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * errorrik (errorrik@gmail.com) - */ - - -define( - 'zrender/Storage',['require','./tool/util','./shape/Group'],function (require) { - - - - var util = require('./tool/util'); - - var Group = require('./shape/Group'); - - var defaultIterateOption = { - hover: false, - normal: 'down', - update: false - }; - - function shapeCompareFunc(a, b) { - if (a.zlevel == b.zlevel) { - if (a.z == b.z) { - return a.__renderidx - b.__renderidx; - } - return a.z - b.z; - } - return a.zlevel - b.zlevel; - } - /** - * 内容仓库 (M) - * - */ - function Storage() { - // 所有常规形状,id索引的map - this._elements = {}; - - // 高亮层形状,不稳定,动态增删,数组位置也是z轴方向,靠前显示在下方 - this._hoverElements = []; - - this._roots = []; - - this._shapeList = []; - - this._shapeListOffset = 0; - } - - /** - * 遍历迭代器 - * - * @param {Function} fun 迭代回调函数,return true终止迭代 - * @param {Object=} option 迭代参数,缺省为仅降序遍历常规形状 - * hover : true 是否迭代高亮层数据 - * normal : 'down' | 'up' 是否迭代常规数据,迭代时是否指定及z轴顺序 - * update : false 是否更新shapeList - */ - Storage.prototype.iterShape = function (fun, option) { - if (!option) { - option = defaultIterateOption; - } - - if (option.hover) { - //高亮层数据遍历 - for (var i = 0, l = this._hoverElements.length; i < l; i++) { - var el = this._hoverElements[i]; - el.updateTransform(); - if (fun(el)) { - return this; - } - } - } - - if (option.update) { - this.updateShapeList(); - } - - //遍历: 'down' | 'up' - switch (option.normal) { - case 'down': - // 降序遍历,高层优先 - var l = this._shapeList.length; - while (l--) { - if (fun(this._shapeList[l])) { - return this; - } - } - break; - // case 'up': - default: - //升序遍历,底层优先 - for (var i = 0, l = this._shapeList.length; i < l; i++) { - if (fun(this._shapeList[i])) { - return this; - } - } - break; - } - - return this; - }; - - Storage.prototype.getHoverShapes = function(update) { - if (update) { - for (var i = 0, l = this._hoverElements.length; i < l; i++) { - this._hoverElements[i].updateTransform(); - } - } - return this._hoverElements; - }; - - Storage.prototype.getShapeList = function(update) { - if (update) { - this.updateShapeList(); - } - return this._shapeList; - }; - - - Storage.prototype.updateShapeList = function() { - this._shapeListOffset = 0; - for (var i = 0, len = this._roots.length; i < len; i++) { - var root = this._roots[i]; - this._updateAndAddShape(root); - } - this._shapeList.length = this._shapeListOffset; - - for (var i = 0, len = this._shapeList.length; i < len; i++) { - this._shapeList[i].__renderidx = i; - } - - this._shapeList.sort(shapeCompareFunc); - }; - - Storage.prototype._updateAndAddShape = function(el) { - - if (el.ignore) { - return; - } - - el.updateTransform(); - - if (el.type == 'group') { - - if (el.clipShape) { - // clipShape 的变换是基于 group 的变换 - el.clipShape.parent = el; - el.clipShape.updateTransform(); - - var startClipShape = el._children[0]; - if (startClipShape) { - startClipShape.__startClip = el.clipShape; - } - } - - for (var i = 0; i < el._children.length; i++) { - var child = el._children[i]; - - // Force to mark as dirty if group is dirty - child.__dirty = el.__dirty || child.__dirty; - - this._updateAndAddShape(child); - } - - if (el.clipShape) { - var stopClipShape = this._shapeList[this._shapeListOffset - 1]; - if (stopClipShape) { - stopClipShape.__stopClip = true; - } - } - - // Mark group clean here - el.__dirty = false; - - } else { - this._shapeList[this._shapeListOffset++] = el; - } - }; - - /** - * 修改 - * - * @param {string} idx 唯一标识 - * @param {Object} [params] 参数 - */ - Storage.prototype.mod = function (elId, params) { - var el = this._elements[elId]; - if (el) { - if (!(el instanceof Group)) { - el.style.__rect = null; - } - el.__dirty = true; - - if (params) { - // 如果第二个参数直接使用 shape - // parent, _storage, __startClip 三个属性会有循环引用 - // 主要为了向 1.x 版本兼容,2.x 版本不建议使用第二个参数 - if (params.parent || params._storage || params.__startClip) { - var target = {}; - for (var name in params) { - if ( - name == 'parent' - || name == '_storage' - || name == '__startClip' - ) { - continue; - } - if (params.hasOwnProperty(name)) { - target[name] = params[name]; - } - } - util.merge(el, target, true); - } else { - util.merge(el, params, true); - } - } - } - - return this; - }; - - /** - * 常规形状位置漂移,形状自身定义漂移函数 - * - * @param {string} idx 形状唯一标识 - */ - Storage.prototype.drift = function (shapeId, dx, dy) { - var shape = this._elements[shapeId]; - if (shape) { - shape.needTransform = true; - if (!shape.ondrift //ondrift - //有onbrush并且调用执行返回false或undefined则继续 - || (shape.ondrift && !shape.ondrift(dx, dy)) - ) { - shape.drift(dx, dy); - } - } - - return this; - }; - - /** - * 添加高亮层数据 - * - * @param {Object} params 参数 - */ - Storage.prototype.addHover = function (shape) { - shape.updateNeedTransform(); - this._hoverElements.push(shape); - return this; - }; - - /** - * 删除高亮层数据 - */ - Storage.prototype.delHover = function () { - this._hoverElements = []; - return this; - }; - - Storage.prototype.hasHoverShape = function () { - return this._hoverElements.length > 0; - }; - - /** - * 添加到根节点 - * - * @param {Shape|Group} el 参数 - */ - Storage.prototype.addRoot = function (el) { - if (el instanceof Group) { - el.addChildrenToStorage(this); - } - - this.addToMap(el); - this._roots.push(el); - }; - - Storage.prototype.delRoot = function (elId) { - if (typeof(elId) == 'undefined') { - // 不指定elId清空 - for (var i = 0; i < this._roots.length; i++) { - var root = this._roots[i]; - if (root instanceof Group) { - root.delChildrenFromStorage(this); - } - } - - this._elements = {}; - this._hoverElements = []; - this._roots = []; - - return; - } - - if (elId instanceof Array) { - for (var i = 0, l = elId.length; i < l; i++) { - this.delRoot(elId[i]); - } - return; - } - - var el; - if (typeof(elId) == 'string') { - el = this._elements[elId]; - } else { - el = elId; - } - - var idx = util.indexOf(this._roots, el); - if (idx >= 0) { - this.delFromMap(el.id); - this._roots.splice(idx, 1); - if (el instanceof Group) { - el.delChildrenFromStorage(this); - } - } - }; - - /** - * 添加 - * - * @param {Shape|Group} el 参数 - */ - Storage.prototype.addToMap = function (el) { - if (el instanceof Group) { - el._storage = this; - } else { - el.style.__rect = null; - } - - this._elements[el.id] = el; - - return this; - }; - - /** - * 根据指定的elId获取相应的shape属性 - * - * @param {string=} idx 唯一标识 - */ - Storage.prototype.get = function (elId) { - return this._elements[elId]; - }; - - /** - * 删除,elId不指定则全清空 - * - * @param {string} idx 唯一标识 - */ - Storage.prototype.delFromMap = function (elId) { - var el = this._elements[elId]; - if (el) { - delete this._elements[elId]; - - if (el instanceof Group) { - el._storage = null; - } - } - - return this; - }; - - - /** - * 释放 - */ - Storage.prototype.dispose = function () { - this._elements = - this._renderList = - this._roots = - this._hoverElements = null; - }; - - return Storage; - } -); - -/** - * 缓动代码来自 https://github.com/sole/tween.js/blob/master/src/Tween.js - * author: lang(shenyi01@baidu.com) - */ -define( - 'zrender/animation/easing',[],function() { - var Easing = { - // 线性 - Linear: function(k) { - return k; - }, - - // 二次方的缓动(t^2) - QuadraticIn: function(k) { - return k * k; - }, - QuadraticOut: function(k) { - return k * (2 - k); - }, - QuadraticInOut: function(k) { - if ((k *= 2) < 1) { - return 0.5 * k * k; - } - return - 0.5 * (--k * (k - 2) - 1); - }, - - // 三次方的缓动(t^3) - CubicIn: function(k) { - return k * k * k; - }, - CubicOut: function(k) { - return --k * k * k + 1; - }, - CubicInOut: function(k) { - if ((k *= 2) < 1) { - return 0.5 * k * k * k; - } - return 0.5 * ((k -= 2) * k * k + 2); - }, - - // 四次方的缓动(t^4) - QuarticIn: function(k) { - return k * k * k * k; - }, - QuarticOut: function(k) { - return 1 - (--k * k * k * k); - }, - QuarticInOut: function(k) { - if ((k *= 2) < 1) { - return 0.5 * k * k * k * k; - } - return - 0.5 * ((k -= 2) * k * k * k - 2); - }, - - // 五次方的缓动(t^5) - QuinticIn: function(k) { - return k * k * k * k * k; - }, - - QuinticOut: function(k) { - return --k * k * k * k * k + 1; - }, - QuinticInOut: function(k) { - if ((k *= 2) < 1) { - return 0.5 * k * k * k * k * k; - } - return 0.5 * ((k -= 2) * k * k * k * k + 2); - }, - - // 正弦曲线的缓动(sin(t)) - SinusoidalIn: function(k) { - return 1 - Math.cos(k * Math.PI / 2); - }, - SinusoidalOut: function(k) { - return Math.sin(k * Math.PI / 2); - }, - SinusoidalInOut: function(k) { - return 0.5 * (1 - Math.cos(Math.PI * k)); - }, - - // 指数曲线的缓动(2^t) - ExponentialIn: function(k) { - return k === 0 ? 0 : Math.pow(1024, k - 1); - }, - ExponentialOut: function(k) { - return k === 1 ? 1 : 1 - Math.pow(2, - 10 * k); - }, - ExponentialInOut: function(k) { - if (k === 0) { - return 0; - } - if (k === 1) { - return 1; - } - if ((k *= 2) < 1) { - return 0.5 * Math.pow(1024, k - 1); - } - return 0.5 * (- Math.pow(2, - 10 * (k - 1)) + 2); - }, - - // 圆形曲线的缓动(sqrt(1-t^2)) - CircularIn: function(k) { - return 1 - Math.sqrt(1 - k * k); - }, - CircularOut: function(k) { - return Math.sqrt(1 - (--k * k)); - }, - CircularInOut: function(k) { - if ((k *= 2) < 1) { - return - 0.5 * (Math.sqrt(1 - k * k) - 1); - } - return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1); - }, - - // 创建类似于弹簧在停止前来回振荡的动画 - ElasticIn: function(k) { - var s, a = 0.1, p = 0.4; - if (k === 0) { - return 0; - } - if (k === 1) { - return 1; - } - if (!a || a < 1) { - a = 1; s = p / 4; - }else{ - s = p * Math.asin(1 / a) / (2 * Math.PI); - } - return - (a * Math.pow(2, 10 * (k -= 1)) * - Math.sin((k - s) * (2 * Math.PI) / p)); - }, - ElasticOut: function(k) { - var s, a = 0.1, p = 0.4; - if (k === 0) { - return 0; - } - if (k === 1) { - return 1; - } - if (!a || a < 1) { - a = 1; s = p / 4; - } - else{ - s = p * Math.asin(1 / a) / (2 * Math.PI); - } - return (a * Math.pow(2, - 10 * k) * - Math.sin((k - s) * (2 * Math.PI) / p) + 1); - }, - ElasticInOut: function(k) { - var s, a = 0.1, p = 0.4; - if (k === 0) { - return 0; - } - if (k === 1) { - return 1; - } - if (!a || a < 1) { - a = 1; s = p / 4; - } - else{ - s = p * Math.asin(1 / a) / (2 * Math.PI); - } - if ((k *= 2) < 1) { - return - 0.5 * (a * Math.pow(2, 10 * (k -= 1)) - * Math.sin((k - s) * (2 * Math.PI) / p)); - } - return a * Math.pow(2, -10 * (k -= 1)) - * Math.sin((k - s) * (2 * Math.PI) / p) * 0.5 + 1; - - }, - - // 在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动 - BackIn: function(k) { - var s = 1.70158; - return k * k * ((s + 1) * k - s); - }, - BackOut: function(k) { - var s = 1.70158; - return --k * k * ((s + 1) * k + s) + 1; - }, - BackInOut: function(k) { - var s = 1.70158 * 1.525; - if ((k *= 2) < 1) { - return 0.5 * (k * k * ((s + 1) * k - s)); - } - return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2); - }, - - // 创建弹跳效果 - BounceIn: function(k) { - return 1 - Easing.BounceOut(1 - k); - }, - BounceOut: function(k) { - if (k < (1 / 2.75)) { - return 7.5625 * k * k; - } - else if (k < (2 / 2.75)) { - return 7.5625 * (k -= (1.5 / 2.75)) * k + 0.75; - } else if (k < (2.5 / 2.75)) { - return 7.5625 * (k -= (2.25 / 2.75)) * k + 0.9375; - } else { - return 7.5625 * (k -= (2.625 / 2.75)) * k + 0.984375; - } - }, - BounceInOut: function(k) { - if (k < 0.5) { - return Easing.BounceIn(k * 2) * 0.5; - } - return Easing.BounceOut(k * 2 - 1) * 0.5 + 0.5; - } - }; - - return Easing; - } -); - - -/** - * 动画主控制器 - * @config target 动画对象,可以是数组,如果是数组的话会批量分发onframe等事件 - * @config life(1000) 动画时长 - * @config delay(0) 动画延迟时间 - * @config loop(true) - * @config gap(0) 循环的间隔时间 - * @config onframe - * @config easing(optional) - * @config ondestroy(optional) - * @config onrestart(optional) - */ -define( - 'zrender/animation/Clip',['require','./easing'],function(require) { - - var Easing = require('./easing'); - - function Clip(options) { - - this._targetPool = options.target || {}; - if (!(this._targetPool instanceof Array)) { - this._targetPool = [this._targetPool]; - } - - //生命周期 - this._life = options.life || 1000; - //延时 - this._delay = options.delay || 0; - //开始时间 - this._startTime = new Date().getTime() + this._delay;//单位毫秒 - - //结束时间 - this._endTime = this._startTime + this._life * 1000; - - //是否循环 - this.loop = typeof options.loop == 'undefined' - ? false : options.loop; - - this.gap = options.gap || 0; - - this.easing = options.easing || 'Linear'; - - this.onframe = options.onframe; - this.ondestroy = options.ondestroy; - this.onrestart = options.onrestart; - } - - Clip.prototype = { - step : function (time) { - var percent = (time - this._startTime) / this._life; - - //还没开始 - if (percent < 0) { - return; - } - - percent = Math.min(percent, 1); - - var easingFunc = typeof this.easing == 'string' - ? Easing[this.easing] - : this.easing; - var schedule = typeof easingFunc === 'function' - ? easingFunc(percent) - : percent; - - this.fire('frame', schedule); - - // 结束 - if (percent == 1) { - if (this.loop) { - this.restart(); - // 重新开始周期 - // 抛出而不是直接调用事件直到 stage.update 后再统一调用这些事件 - return 'restart'; - - } - - // 动画完成将这个控制器标识为待删除 - // 在Animation.update中进行批量删除 - this._needsRemove = true; - return 'destroy'; - } - - return null; - }, - restart : function() { - var time = new Date().getTime(); - var remainder = (time - this._startTime) % this._life; - this._startTime = new Date().getTime() - remainder + this.gap; - }, - fire : function(eventType, arg) { - for (var i = 0, len = this._targetPool.length; i < len; i++) { - if (this['on' + eventType]) { - this['on' + eventType](this._targetPool[i], arg); - } - } - }, - constructor: Clip - }; - - return Clip; - } -); - -/** - * 动画主类, 调度和管理所有动画控制器 - * - * @author pissang(https://github.com/pissang) - * - * @class : Animation - * @config : stage(optional) 绘制类, 需要提供update接口 - * @config : onframe(optional) - * @method : add - * @method : remove - * @method : update - * @method : start - * @method : stop - */ -define( - 'zrender/animation/Animation',['require','./Clip','../tool/color','../tool/util','../tool/event'],function(require) { - - - - var Clip = require('./Clip'); - var color = require('../tool/color'); - var util = require('../tool/util'); - var Dispatcher = require('../tool/event').Dispatcher; - - var requestAnimationFrame = window.requestAnimationFrame - || window.msRequestAnimationFrame - || window.mozRequestAnimationFrame - || window.webkitRequestAnimationFrame - || function(func){setTimeout(func, 16);}; - - var arraySlice = Array.prototype.slice; - - function Animation(options) { - - options = options || {}; - - this.stage = options.stage || {}; - - this.onframe = options.onframe || function() {}; - - // private properties - this._clips = []; - - this._running = false; - - this._time = 0; - - Dispatcher.call(this); - } - - Animation.prototype = { - add : function(clip) { - this._clips.push(clip); - }, - remove : function(clip) { - var idx = util.indexOf(this._clips, clip); - if (idx >= 0) { - this._clips.splice(idx, 1); - } - }, - update : function() { - - var time = new Date().getTime(); - var delta = time - this._time; - var clips = this._clips; - var len = clips.length; - - var deferredEvents = []; - var deferredClips = []; - for (var i = 0; i < len; i++) { - var clip = clips[i]; - var e = clip.step(time); - // Throw out the events need to be called after - // stage.update, like destroy - if (e) { - deferredEvents.push(e); - deferredClips.push(clip); - } - } - if (this.stage.update) { - this.stage.update(); - } - - // Remove the finished clip - for (var i = 0; i < len;) { - if (clips[i]._needsRemove) { - clips[i] = clips[len-1]; - clips.pop(); - len--; - } else { - i++; - } - } - - len = deferredEvents.length; - for (var i = 0; i < len; i++) { - deferredClips[i].fire(deferredEvents[i]); - } - - this._time = time; - - this.onframe(delta); - - this.dispatch('frame', delta); - }, - start : function() { - var self = this; - - this._running = true; - - function step() { - if (self._running) { - self.update(); - requestAnimationFrame(step); - } - } - - this._time = new Date().getTime(); - requestAnimationFrame(step); - }, - stop : function() { - this._running = false; - }, - clear : function() { - this._clips = []; - }, - animate : function(target, options) { - options = options || {}; - var deferred = new Deferred( - target, - options.loop, - options.getter, - options.setter - ); - deferred.animation = this; - return deferred; - }, - constructor: Animation - }; - - util.merge(Animation.prototype, Dispatcher.prototype, true); - - function _defaultGetter(target, key) { - return target[key]; - } - - function _defaultSetter(target, key, value) { - target[key] = value; - } - - function _interpolateNumber(p0, p1, percent) { - return (p1 - p0) * percent + p0; - } - - function _interpolateArray(p0, p1, percent, out, arrDim) { - var len = p0.length; - if (arrDim == 1) { - for (var i = 0; i < len; i++) { - out[i] = _interpolateNumber(p0[i], p1[i], percent); - } - } else { - var len2 = p0[0].length; - for (var i = 0; i < len; i++) { - for (var j = 0; j < len2; j++) { - out[i][j] = _interpolateNumber( - p0[i][j], p1[i][j], percent - ); - } - } - } - } - - function _isArrayLike(data) { - switch (typeof data) { - case 'undefined': - case 'string': - return false; - } - - return typeof data.length !== 'undefined'; - } - - function _catmullRomInterpolateArray( - p0, p1, p2, p3, t, t2, t3, out, arrDim - ) { - var len = p0.length; - if (arrDim == 1) { - for (var i = 0; i < len; i++) { - out[i] = _catmullRomInterpolate( - p0[i], p1[i], p2[i], p3[i], t, t2, t3 - ); - } - } else { - var len2 = p0[0].length; - for (var i = 0; i < len; i++) { - for (var j = 0; j < len2; j++) { - out[i][j] = _catmullRomInterpolate( - p0[i][j], p1[i][j], p2[i][j], p3[i][j], - t, t2, t3 - ); - } - } - } - } - - function _catmullRomInterpolate(p0, p1, p2, p3, t, t2, t3) { - var v0 = (p2 - p0) * 0.5; - var v1 = (p3 - p1) * 0.5; - return (2 * (p1 - p2) + v0 + v1) * t3 - + (- 3 * (p1 - p2) - 2 * v0 - v1) * t2 - + v0 * t + p1; - } - - function _cloneValue(value) { - if (_isArrayLike(value)) { - var len = value.length; - if (_isArrayLike(value[0])) { - var ret = []; - for (var i = 0; i < len; i++) { - ret.push(arraySlice.call(value[i])); - } - return ret; - } else { - return arraySlice.call(value); - } - } else { - return value; - } - } - - function rgba2String(rgba) { - rgba[0] = Math.floor(rgba[0]); - rgba[1] = Math.floor(rgba[1]); - rgba[2] = Math.floor(rgba[2]); - - return 'rgba(' + rgba.join(',') + ')'; - } - - function Deferred(target, loop, getter, setter) { - this._tracks = {}; - this._target = target; - - this._loop = loop || false; - - this._getter = getter || _defaultGetter; - this._setter = setter || _defaultSetter; - - this._clipCount = 0; - - this._delay = 0; - - this._doneList = []; - - this._onframeList = []; - - this._clipList = []; - } - - Deferred.prototype = { - when : function(time /* ms */, props) { - for (var propName in props) { - if (! this._tracks[propName]) { - this._tracks[propName] = []; - // If time is 0 - // Then props is given initialize value - // Else - // Initialize value from current prop value - if (time !== 0) { - this._tracks[propName].push({ - time : 0, - value : _cloneValue( - this._getter(this._target, propName) - ) - }); - } - } - this._tracks[propName].push({ - time : parseInt(time, 10), - value : props[propName] - }); - } - return this; - }, - during : function(callback) { - this._onframeList.push(callback); - return this; - }, - start : function(easing) { - - var self = this; - var setter = this._setter; - var getter = this._getter; - var onFrameListLen = self._onframeList.length; - var useSpline = easing === 'spline'; - - var ondestroy = function() { - self._clipCount--; - if (self._clipCount === 0) { - // Clear all tracks - self._tracks = {}; - - var len = self._doneList.length; - for (var i = 0; i < len; i++) { - self._doneList[i].call(self); - } - } - }; - - var createTrackClip = function(keyframes, propName) { - var trackLen = keyframes.length; - if (!trackLen) { - return; - } - // Guess data type - var firstVal = keyframes[0].value; - var isValueArray = _isArrayLike(firstVal); - var isValueColor = false; - - // For vertices morphing - var arrDim = ( - isValueArray - && _isArrayLike(firstVal[0]) - ) - ? 2 : 1; - // Sort keyframe as ascending - keyframes.sort(function(a, b) { - return a.time - b.time; - }); - var trackMaxTime; - if (trackLen) { - trackMaxTime = keyframes[trackLen-1].time; - }else{ - return; - } - // Percents of each keyframe - var kfPercents = []; - // Value of each keyframe - var kfValues = []; - for (var i = 0; i < trackLen; i++) { - kfPercents.push(keyframes[i].time / trackMaxTime); - // Assume value is a color when it is a string - var value = keyframes[i].value; - if (typeof(value) == 'string') { - value = color.toArray(value); - if (value.length === 0) { // Invalid color - value[0] = value[1] = value[2] = 0; - value[3] = 1; - } - isValueColor = true; - } - kfValues.push(value); - } - - // Cache the key of last frame to speed up when - // animation playback is sequency - var cacheKey = 0; - var cachePercent = 0; - var start; - var i, w; - var p0, p1, p2, p3; - - - if (isValueColor) { - var rgba = [0, 0, 0, 0]; - } - - var onframe = function(target, percent) { - // Find the range keyframes - // kf1-----kf2---------current--------kf3 - // find kf2 and kf3 and do interpolation - if (percent < cachePercent) { - // Start from next key - start = Math.min(cacheKey + 1, trackLen - 1); - for (i = start; i >= 0; i--) { - if (kfPercents[i] <= percent) { - break; - } - } - i = Math.min(i, trackLen-2); - } else { - for (i = cacheKey; i < trackLen; i++) { - if (kfPercents[i] > percent) { - break; - } - } - i = Math.min(i-1, trackLen-2); - } - cacheKey = i; - cachePercent = percent; - - var range = (kfPercents[i+1] - kfPercents[i]); - if (range === 0) { - return; - } else { - w = (percent - kfPercents[i]) / range; - } - if (useSpline) { - p1 = kfValues[i]; - p0 = kfValues[i === 0 ? i : i - 1]; - p2 = kfValues[i > trackLen - 2 ? trackLen - 1 : i + 1]; - p3 = kfValues[i > trackLen - 3 ? trackLen - 1 : i + 2]; - if (isValueArray) { - _catmullRomInterpolateArray( - p0, p1, p2, p3, w, w*w, w*w*w, - getter(target, propName), - arrDim - ); - } else { - var value; - if (isValueColor) { - value = _catmullRomInterpolateArray( - p0, p1, p2, p3, w, w*w, w*w*w, - rgba, 1 - ); - value = rgba2String(rgba); - } else { - value = _catmullRomInterpolate( - p0, p1, p2, p3, w, w*w, w*w*w - ); - } - setter( - target, - propName, - value - ); - } - } else { - if (isValueArray) { - _interpolateArray( - kfValues[i], kfValues[i+1], w, - getter(target, propName), - arrDim - ); - } else { - var value; - if (isValueColor) { - _interpolateArray( - kfValues[i], kfValues[i+1], w, - rgba, 1 - ); - value = rgba2String(rgba); - } else { - value = _interpolateNumber(kfValues[i], kfValues[i+1], w); - } - setter( - target, - propName, - value - ); - } - } - - for (i = 0; i < onFrameListLen; i++) { - self._onframeList[i](target, percent); - } - }; - - var clip = new Clip({ - target : self._target, - life : trackMaxTime, - loop : self._loop, - delay : self._delay, - onframe : onframe, - ondestroy : ondestroy - }); - - if (easing && easing !== 'spline') { - clip.easing = easing; - } - self._clipList.push(clip); - self._clipCount++; - self.animation.add(clip); - }; - - for (var propName in this._tracks) { - createTrackClip(this._tracks[propName], propName); - } - return this; - }, - stop : function() { - for (var i = 0; i < this._clipList.length; i++) { - var clip = this._clipList[i]; - this.animation.remove(clip); - } - this._clipList = []; - }, - delay : function(time){ - this._delay = time; - return this; - }, - done : function(func) { - this._doneList.push(func); - return this; - } - }; - - return Animation; - } -); - -/*! - * ZRender, a lightweight canvas library with a MVC architecture, data-driven - * and provides an event model like DOM. - * - * Copyright (c) 2013, Baidu Inc. - * All rights reserved. - * - * LICENSE - * https://github.com/ecomfe/zrender/blob/master/LICENSE.txt - */ - -/** - * zrender: core核心类 - * - * @desc zrender是一个轻量级的Canvas类库,MVC封装,数据驱动,提供类Dom事件模型。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define( - 'zrender/zrender',['require','./lib/excanvas','./tool/util','./tool/log','./tool/guid','./Handler','./Painter','./Storage','./animation/Animation','./tool/env'],function(require) { - /* - * HTML5 Canvas for Internet Explorer! - * Modern browsers like Firefox, Safari, Chrome and Opera support - * the HTML5 canvas tag to allow 2D command-based drawing. - * ExplorerCanvas brings the same functionality to Internet Explorer. - * To use, web developers only need to include a single script tag - * in their existing web pages. - * - * https://code.google.com/p/explorercanvas/ - * http://explorercanvas.googlecode.com/svn/trunk/excanvas.js - */ - // 核心代码会生成一个全局变量 G_vmlCanvasManager,模块改造后借用于快速判断canvas支持 - require('./lib/excanvas'); - - var util = require('./tool/util'); - var log = require('./tool/log'); - var guid = require('./tool/guid'); - - var Handler = require('./Handler'); - var Painter = require('./Painter'); - var Storage = require('./Storage'); - var Animation = require('./animation/Animation'); - - var _instances = {}; //ZRender实例map索引 - - var zrender = {}; - zrender.version = '2.0.2'; - - /** - * zrender初始化 - * 不让外部直接new ZRender实例,为啥? - * 不为啥,提供全局可控同时减少全局污染和降低命名冲突的风险! - * - * @param {HTMLElement} dom dom对象,不帮你做document.getElementById了 - * @param {Object=} params 个性化参数,如自定义shape集合,带进来就好 - * - * @return {ZRender} ZRender实例 - */ - zrender.init = function(dom, params) { - var zi = new ZRender(guid(), dom, params || {}); - _instances[zi.id] = zi; - return zi; - }; - - /** - * zrender实例销毁,记在_instances里的索引也会删除了 - * 管生就得管死,可以通过zrender.dispose(zi)销毁指定ZRender实例 - * 当然也可以直接zi.dispose()自己销毁 - * - * @param {ZRender=} zi ZRender对象,不传则销毁全部 - */ - zrender.dispose = function (zi) { - if (zi) { - zi.dispose(); - } - else { - for (var key in _instances) { - _instances[key].dispose(); - } - _instances = {}; - } - - return zrender; - }; - - /** - * 获取zrender实例 - * - * @param {string} id ZRender对象索引 - */ - zrender.getInstance = function (id) { - return _instances[id]; - }; - - /** - * 删除zrender实例,ZRender实例dispose时会调用, - * 删除后getInstance则返回undefined - * ps: 仅是删除,删除的实例不代表已经dispose了~~ - * 这是一个摆脱全局zrender.dispose()自动销毁的后门, - * take care of yourself~ - * - * @param {string} id ZRender对象索引 - */ - zrender.delInstance = function (id) { - delete _instances[id]; - return zrender; - }; - - function getFrameCallback(zrInstance) { - return function(){ - var animatingShapes = zrInstance.animatingShapes; - for (var i = 0, l = animatingShapes.length; i < l; i++) { - zrInstance.storage.mod(animatingShapes[i].id); - } - - if (animatingShapes.length || zrInstance._needsRefreshNextFrame) { - zrInstance.refresh(); - } - }; - } - - /** - * ZRender接口类,对外可用的所有接口都在这里!! - * storage(M)、painter(V)、handler(C)为内部私有类,外部接口不可见 - * 非get接口统一返回支持链式调用~ - * - * @param {string} id 唯一标识 - * @param {HTMLElement} dom dom对象,不帮你做document.getElementById - * - * @return {ZRender} ZRender实例 - */ - function ZRender(id, dom) { - this.id = id; - this.env = require('./tool/env'); - - this.storage = new Storage(); - this.painter = new Painter(dom, this.storage); - this.handler = new Handler(dom, this.storage, this.painter); - - // 动画控制 - this.animatingShapes = []; - this.animation = new Animation({ - stage : { - update : getFrameCallback(this) - } - }); - this.animation.start(); - - this._needsRefreshNextFrame = false; - } - - /** - * 获取实例唯一标识 - */ - ZRender.prototype.getId = function () { - return this.id; - }; - - /** - * 添加图形形状到根节点 - * - * @param {zrender.shape.Base} shape 形状对象,可用属性全集,详见各shape - */ - ZRender.prototype.addShape = function (shape) { - this.storage.addRoot(shape); - return this; - }; - - /** - * 添加组到根节点 - * - * @param {zrender.shape.Group} group - */ - ZRender.prototype.addGroup = function(group) { - this.storage.addRoot(group); - return this; - }; - - /** - * 从根节点删除图形形状 - * - * @param {string} shapeId 形状对象唯一标识 - */ - ZRender.prototype.delShape = function (shapeId) { - this.storage.delRoot(shapeId); - return this; - }; - - /** - * 从根节点删除组 - * - * @param {string} groupId - */ - ZRender.prototype.delGroup = function (groupId) { - this.storage.delRoot(groupId); - return this; - }; - - /** - * 修改图形形状 - * - * @param {string} shapeId 形状对象唯一标识 - * @param {Object} shape 形状对象 - */ - ZRender.prototype.modShape = function (shapeId, shape) { - this.storage.mod(shapeId, shape); - return this; - }; - - /** - * 修改组 - * - * @param {string} shapeId - * @param {Object} group - */ - ZRender.prototype.modGroup = function (groupId, group) { - this.storage.mod(groupId, group); - return this; - }; - - /** - * 修改指定zlevel的绘制配置项,例如clearColor - * - * @param {string} zLevel - * @param {Object} config 配置对象, 目前支持clearColor - */ - ZRender.prototype.modLayer = function (zLevel, config) { - this.painter.modLayer(zLevel, config); - return this; - }; - - /** - * 添加额外高亮层显示,仅提供添加方法,每次刷新后高亮层图形均被清空 - * - * @param {Object} shape 形状对象 - */ - ZRender.prototype.addHoverShape = function (shape) { - this.storage.addHover(shape); - return this; - }; - - /** - * 渲染 - * - * @param {Function} callback 渲染结束后回调函数 - * todo:增加缓动函数 - */ - ZRender.prototype.render = function (callback) { - this.painter.render(callback); - this._needsRefreshNextFrame = false; - return this; - }; - - /** - * 视图更新 - * - * @param {Function} callback 视图更新后回调函数 - */ - ZRender.prototype.refresh = function (callback) { - this.painter.refresh(callback); - this._needsRefreshNextFrame = false; - return this; - }; - - // TODO - // 好像会有奇怪的问题 - ZRender.prototype.refreshNextFrame = function() { - this._needsRefreshNextFrame = true; - return this; - }; - - /** - * 高亮层更新 - * - * @param {Function} callback 视图更新后回调函数 - */ - ZRender.prototype.refreshHover = function (callback) { - this.painter.refreshHover(callback); - return this; - }; - - /** - * 视图更新 - * - * @param {Array} shapeList 需要更新的图形元素列表 - * @param {Function} callback 视图更新后回调函数 - */ - ZRender.prototype.update = function (shapeList, callback) { - this.painter.update(shapeList, callback); - return this; - }; - - ZRender.prototype.resize = function() { - this.painter.resize(); - return this; - }; - - /** - * 动画 - * - * @param {string} shapeId 形状对象唯一标识 - * @param {string} path 需要添加动画的属性获取路径,可以通过a.b.c来获取深层的属性 - * @param {boolean} loop 动画是否循环 - * @return {Object} 动画的Deferred对象 - * Example: - * zr.animate(circleId, 'style', false) - * .when(1000, { x: 10} ) - * .done(function(){ console.log('Animation done')}) - * .start() - */ - ZRender.prototype.animate = function (shapeId, path, loop) { - var shape = this.storage.get(shapeId); - if (shape) { - var target; - if (path) { - var pathSplitted = path.split('.'); - var prop = shape; - for (var i = 0, l = pathSplitted.length; i < l; i++) { - if (!prop) { - continue; - } - prop = prop[pathSplitted[i]]; - } - if (prop) { - target = prop; - } - } - else { - target = shape; - } - - if (!target) { - log( - 'Property "' - + path - + '" is not existed in shape ' - + shapeId - ); - return; - } - - var animatingShapes = this.animatingShapes; - if (typeof shape.__aniCount === 'undefined') { - // 正在进行的动画记数 - shape.__aniCount = 0; - } - if (shape.__aniCount === 0) { - animatingShapes.push(shape); - } - shape.__aniCount++; - - return this.animation.animate(target, {loop : loop}) - .done(function() { - shape.__aniCount --; - if (shape.__aniCount === 0) { - // 从animatingShapes里移除 - var idx = util.indexOf(animatingShapes, shape); - animatingShapes.splice(idx, 1); - } - }); - } - else { - log('Shape "'+ shapeId + '" not existed'); - } - }; - - /** - * 停止所有动画 - */ - ZRender.prototype.clearAnimation = function () { - this.animation.clear(); - }; - - /** - * loading显示 - * - * @param {Object=} loadingEffect loading效果对象 - */ - ZRender.prototype.showLoading = function (loadingEffect) { - this.painter.showLoading(loadingEffect); - return this; - }; - - /** - * loading结束 - */ - ZRender.prototype.hideLoading = function () { - this.painter.hideLoading(); - return this; - }; - - /** - * 获取视图宽度 - */ - ZRender.prototype.getWidth = function() { - return this.painter.getWidth(); - }; - - /** - * 获取视图高度 - */ - ZRender.prototype.getHeight = function() { - return this.painter.getHeight(); - }; - - /** - * 图像导出 - */ - ZRender.prototype.toDataURL = function(type, backgroundColor, args) { - return this.painter.toDataURL(type, backgroundColor, args); - }; - - /** - * 将常规shape转成image shape - */ - ZRender.prototype.shapeToImage = function(e, width, height) { - var id = guid(); - return this.painter.shapeToImage(id, e, width, height); - }; - - /** - * 事件绑定 - * - * @param {string} eventName 事件名称 - * @param {Function} eventHandler 响应函数 - */ - ZRender.prototype.on = function(eventName, eventHandler) { - this.handler.on(eventName, eventHandler); - return this; - }; - - /** - * 事件解绑定,参数为空则解绑所有自定义事件 - * - * @param {string} eventName 事件名称 - * @param {Function} eventHandler 响应函数 - */ - ZRender.prototype.un = function(eventName, eventHandler) { - this.handler.un(eventName, eventHandler); - return this; - }; - - /** - * 事件触发 - * - * @param {string} event 事件名称,resize,hover,drag,etc~ - * @param {event=} event event dom事件对象 - */ - ZRender.prototype.trigger = function (eventName, event) { - this.handler.trigger(eventName, event); - return this; - }; - - - /** - * 清除当前ZRender下所有类图的数据和显示,clear后MVC和已绑定事件均还存在在,ZRender可用 - */ - ZRender.prototype.clear = function () { - this.storage.delRoot(); - this.painter.clear(); - return this; - }; - - /** - * 释放当前ZR实例(删除包括dom,数据、显示和事件绑定),dispose后ZR不可用 - */ - ZRender.prototype.dispose = function () { - this.animation.stop(); - - this.clear(); - this.storage.dispose(); - this.painter.dispose(); - this.handler.dispose(); - - this.animation = - this.animatingShapes = - this.storage = - this.painter = - this.handler = null; - - //释放后告诉全局删除对自己的索引,没想到啥好方法 - zrender.delInstance(this.id); - }; - - return zrender; - } -); - -define('zrender', ['zrender/zrender'], function (main) { return main; }); - -/** - * echarts层级查找方法 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/util/ecQuery',['zrender/tool/util'],function() { - var zrUtil = require('zrender/tool/util'); - - /** - * 获取嵌套选项的基础方法 - * 返回optionTarget中位于optionLocation上的值,如果没有定义,则返回undefined - */ - function query(optionTarget, optionLocation) { - if (typeof optionTarget == 'undefined') { - return; - } - - if (!optionLocation) { - return optionTarget; - } - - optionLocation = optionLocation.split('.'); - var length = optionLocation.length; - var curIdx = 0; - while (curIdx < length) { - optionTarget = optionTarget[optionLocation[curIdx]]; - if (typeof optionTarget == 'undefined') { - return; - } - curIdx++; - } - - return optionTarget; - } - - /** - * 获取多级控制嵌套属性的基础方法 - * 返回ctrList中优先级最高(最靠前)的非undefined属性,ctrList中均无定义则返回undefined - */ - function deepQuery(ctrList, optionLocation) { - var finalOption; - for (var i = 0, l = ctrList.length; i < l; i++) { - finalOption = query(ctrList[i], optionLocation); - if (typeof finalOption != 'undefined') { - return finalOption; - } - } - } - - /** - * 获取多级控制嵌套属性的基础方法 - * 根据ctrList中优先级合并产出目标属性 - */ - function deepMerge(ctrList, optionLocation) { - var finalOption; - var len = ctrList.length; - while (len--) { - var tempOption = query(ctrList[len], optionLocation); - if (typeof tempOption != 'undefined') { - if (typeof finalOption == 'undefined') { - finalOption = zrUtil.clone(tempOption); - } - else { - zrUtil.merge( - finalOption, tempOption, true - ); - } - } - } - - return finalOption; - } - - return { - query : query, - deepQuery : deepQuery, - deepMerge : deepMerge - }; -}); -/** - * echarts数字运算相关 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/util/number',[],function() { - function _trim(str) { - return str.replace(/^\s+/, '').replace(/\s+$/, ''); - } - - /** - * 百分比计算 - */ - function parsePercent(value, maxValue) { - if (typeof value === 'string') { - if (_trim(value).match(/%$/)) { - return parseFloat(value) / 100 * maxValue; - } - - return parseFloat(value); - } - - return value; - } - - /** - * 获取中心坐标 - */ - function parseCenter(zr, center) { - return [ - parsePercent(center[0], zr.getWidth()), - parsePercent(center[1], zr.getHeight()) - ]; - } - - /** - * 获取自适应半径 - */ - function parseRadius(zr, radius) { - // 传数组实现环形图,[内半径,外半径],传单个则默认为外半径为 - if (!(radius instanceof Array)) { - radius = [0, radius]; - } - var zrSize = Math.min(zr.getWidth(), zr.getHeight()) / 2; - return [ - parsePercent(radius[0], zrSize), - parsePercent(radius[1], zrSize) - ]; - } - - /** - * 每三位默认加,格式化 - */ - function addCommas(x) { - if (isNaN(x)) { - return '-'; - } - x = (x + '').split('.'); - return x[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,'$1,') - + (x.length > 1 ? ('.' + x[1]) : ''); - } - - return { - parsePercent : parsePercent, - parseCenter : parseCenter, - parseRadius : parseRadius, - addCommas : addCommas - }; -}); -/** - * echarts组件基类 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/component/base',['require','../config','../util/ecQuery','../util/number','zrender/tool/util','zrender/tool/env'],function (require) { - var ecConfig = require('../config'); - var ecQuery = require('../util/ecQuery'); - var number = require('../util/number'); - var zrUtil = require('zrender/tool/util'); - - function Base(ecTheme, messageCenter, zr, option, myChart){ - this.ecTheme = ecTheme; - this.messageCenter = messageCenter; - this.zr =zr; - this.option = option; - this.series = option.series; - this.myChart = myChart; - this.component = myChart.component; - - this._zlevelBase = this.getZlevelBase(); - this.shapeList = []; - this.effectList = []; - - var self = this; - self.hoverConnect = function (param) { - var target = (param.target || {}).hoverConnect; - if (target) { - var zlevel = 10; - var shape; - if (!(target instanceof Array)) { - shape = self.getShapeById(target); - if (shape) { - self.zr.addHoverShape(shape); - zlevel = Math.min(zlevel, shape.zlevel); - } - } - else { - for (var i = 0, l = target.length; i < l; i++) { - shape = self.getShapeById(target[i]); - self.zr.addHoverShape(shape); - zlevel = Math.min(zlevel, shape.zlevel); - } - } - if (zlevel < param.target.zlevel) { - self.zr.addHoverShape(param.target); - } - } - }; - } - - /** - * 基类方法 - */ - Base.prototype = { - canvasSupported : require('zrender/tool/env').canvasSupported, - /** - * 获取zlevel基数配置 - * @param {Object} contentType - */ - getZlevelBase : function (contentType) { - contentType = contentType || this.type + ''; - - switch (contentType) { - case ecConfig.COMPONENT_TYPE_GRID : - case ecConfig.COMPONENT_TYPE_AXIS_CATEGORY : - case ecConfig.COMPONENT_TYPE_AXIS_VALUE : - case ecConfig.COMPONENT_TYPE_POLAR : - return 0; - - case ecConfig.CHART_TYPE_LINE : - case ecConfig.CHART_TYPE_BAR : - case ecConfig.CHART_TYPE_SCATTER : - case ecConfig.CHART_TYPE_PIE : - case ecConfig.CHART_TYPE_RADAR : - case ecConfig.CHART_TYPE_MAP : - case ecConfig.CHART_TYPE_K : - case ecConfig.CHART_TYPE_CHORD: - case ecConfig.CHART_TYPE_GUAGE: - case ecConfig.CHART_TYPE_FUNNEL: - return 2; - - case ecConfig.COMPONENT_TYPE_LEGEND : - case ecConfig.COMPONENT_TYPE_DATARANGE: - case ecConfig.COMPONENT_TYPE_DATAZOOM : - case ecConfig.COMPONENT_TYPE_TIMELINE : - return 4; - - case ecConfig.CHART_TYPE_ISLAND : - return 5; - - case ecConfig.COMPONENT_TYPE_TOOLBOX : - case ecConfig.COMPONENT_TYPE_TITLE : - return 6; - - // ecConfig.EFFECT_ZLEVEL = 7; - - case ecConfig.COMPONENT_TYPE_TOOLTIP : - return 8; - - default : - return 0; - } - }, - - /** - * 参数修正&默认值赋值 - * @param {Object} opt 参数 - * - * @return {Object} 修正后的参数 - */ - reformOption : function (opt) { - return zrUtil.merge( - opt || {}, - zrUtil.clone(this.ecTheme[this.type] || {}) - ); - }, - - /** - * css类属性数组补全,如padding,margin等~ - */ - reformCssArray : function (p) { - if (p instanceof Array) { - switch (p.length + '') { - case '4': - return p; - case '3': - return [p[0], p[1], p[2], p[1]]; - case '2': - return [p[0], p[1], p[0], p[1]]; - case '1': - return [p[0], p[0], p[0], p[0]]; - case '0': - return [0, 0, 0, 0]; - } - } - else { - return [p, p, p, p]; - } - }, - - getShapeById : function(id) { - for (var i = 0, l = this.shapeList.length; i < l; i++) { - if (this.shapeList[i].id == id) { - return this.shapeList[i]; - } - } - return null; - }, - - /** - * 获取自定义和默认配置合并后的字体设置 - */ - getFont : function (textStyle) { - var finalTextStyle = zrUtil.merge( - zrUtil.clone(textStyle) || {}, - this.ecTheme.textStyle - ); - return finalTextStyle.fontStyle + ' ' - + finalTextStyle.fontWeight + ' ' - + finalTextStyle.fontSize + 'px ' - + finalTextStyle.fontFamily; - }, - - getItemStyleColor : function (itemColor, seriesIndex, dataIndex, data) { - return typeof itemColor == 'function' - ? itemColor(seriesIndex, dataIndex, data) : itemColor; - - }, - - // 亚像素优化 - subPixelOptimize : function (position, lineWidth) { - if (lineWidth % 2 == 1) { - //position += position == Math.ceil(position) ? 0.5 : 0; - position = Math.floor(position) + 0.5; - } - else { - position = Math.round(position); - } - return position; - }, - - - resize : function () { - this.refresh && this.refresh(); - this.clearEffectShape && this.clearEffectShape(true); - var self = this; - setTimeout(function(){ - self.animationEffect && self.animationEffect(); - },200); - }, - - /** - * 清除图形数据,实例仍可用 - */ - clear :function () { - this.clearEffectShape && this.clearEffectShape(); - this.zr && this.zr.delShape(this.shapeList); - this.shapeList = []; - }, - - /** - * 释放后实例不可用 - */ - dispose : function () { - this.clear(); - this.shapeList = null; - this.effectList = null; - }, - - query : ecQuery.query, - deepQuery : ecQuery.deepQuery, - deepMerge : ecQuery.deepMerge, - - parsePercent : number.parsePercent, - parseCenter : number.parseCenter, - parseRadius : number.parseRadius, - numAddCommas : number.addCommas - }; - - return Base; -}); - -/** - * zrender: 数学辅助类 - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * sin:正弦函数,自动缓存 - * cos:余弦函数,自动缓存 - * degreeToRadian:角度转弧度 - * radianToDegree:弧度转角度 - */ -define( - 'zrender/tool/math',[],function() { - /* - var _cache = { - sin : {}, //sin缓存 - cos : {} //cos缓存 - }; - */ - var _radians = Math.PI / 180; - - /** - * @param angle 弧度(角度)参数 - * @param isDegrees angle参数是否为角度计算,默认为false,angle为以弧度计量的角度 - */ - function sin(angle, isDegrees) { - return Math.sin(isDegrees ? angle * _radians : angle); - /* - angle = (isDegrees ? angle * _radians : angle).toFixed(4); - if(typeof _cache.sin[angle] == 'undefined') { - _cache.sin[angle] = Math.sin(angle); - } - return _cache.sin[angle]; - */ - } - - /** - * @param radians 弧度参数 - */ - function cos(angle, isDegrees) { - return Math.cos(isDegrees ? angle * _radians : angle); - /* - angle = (isDegrees ? angle * _radians : angle).toFixed(4); - if(typeof _cache.cos[angle] == 'undefined') { - _cache.cos[angle] = Math.cos(angle); - } - return _cache.cos[angle]; - */ - } - - /** - * 角度转弧度 - * @param {Object} angle - */ - function degreeToRadian(angle) { - return angle * _radians; - } - - /** - * 弧度转角度 - * @param {Object} angle - */ - function radianToDegree(angle) { - return angle / _radians; - } - - return { - sin : sin, - cos : cos, - degreeToRadian : degreeToRadian, - radianToDegree : radianToDegree - }; - } -); -/** - * zrender - * - * @author sushuang (宿爽, sushuang@baidu.com) - * - * shape类:n角星(n>3) - * 可配图形属性: - { - // 基础属性 - shape : 'star', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,n角星外接圆心横坐标 - y : {number}, // 必须,n角星外接圆心纵坐标 - r : {number}, // 必须,n角星外接圆半径 - r0 : {number}, // n角星内部顶点(凹点)的外接圆半径, - // 如果不指定此参数,则自动计算:取相隔外部顶点连线的交点作内部顶点 - n : {number}, // 必须,指明几角星 - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - lineJoin : {string}, // 默认为miter,线段连接样式。miter | round | bevel - - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为outside,附加文本位置。 - // outside | inside - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'star', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - r : 150, - n : 5, - color : '#eee' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - 'zrender/shape/Star',['require','../tool/math','./Base','../tool/util'],function (require) { - - var math = require('../tool/math'); - var sin = math.sin; - var cos = math.cos; - var PI = Math.PI; - - var Base = require('./Base'); - - function Star(options) { - Base.call(this, options); - } - - Star.prototype = { - type: 'star', - - /** - * 创建n角星(n>3)路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - var n = style.n; - if (!n || n < 2) { return; } - - var x = style.x; - var y = style.y; - var r = style.r; - var r0 = style.r0; - - // 如果未指定内部顶点外接圆半径,则自动计算 - if (r0 == null) { - r0 = n > 4 - // 相隔的外部顶点的连线的交点, - // 被取为内部交点,以此计算r0 - ? r * cos(2 * PI / n) / cos(PI / n) - // 二三四角星的特殊处理 - : r / 3; - } - - var dStep = PI / n; - var deg = -PI / 2; - var xStart = x + r * cos(deg); - var yStart = y + r * sin(deg); - deg += dStep; - - // 记录边界点,用于判断inside - var pointList = style.pointList = []; - pointList.push([xStart, yStart]); - for (var i = 0, end = n * 2 - 1, ri; i < end; i ++) { - ri = i % 2 === 0 ? r0 : r; - pointList.push([x + ri * cos(deg), y + ri * sin(deg)]); - deg += dStep; - } - pointList.push([xStart, yStart]); - - // 绘制 - ctx.moveTo(pointList[0][0], pointList[0][1]); - for (var i = 0; i < pointList.length; i ++) { - ctx.lineTo(pointList[i][0], pointList[i][1]); - } - - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function(style) { - if (style.__rect) { - return style.__rect; - } - - var lineWidth; - if (style.brushType == 'stroke' || style.brushType == 'fill') { - lineWidth = style.lineWidth || 1; - } - else { - lineWidth = 0; - } - style.__rect = { - x : Math.round(style.x - style.r - lineWidth / 2), - y : Math.round(style.y - style.r - lineWidth / 2), - width : style.r * 2 + lineWidth, - height : style.r * 2 + lineWidth - }; - - return style.__rect; - } - }; - - require('../tool/util').inherits(Star, Base); - return Star; - } -); -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:心形 - * 可配图形属性: - { - // 基础属性 - shape : 'heart', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,心形内部尖端横坐标 - y : {number}, // 必须,心形内部尖端纵坐标 - a : {number}, // 必须,心形横宽(中轴线到水平边缘最宽处距离) - b : {number}, // 必须,心形纵高(内尖到外尖距离) - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为outside,附加文本位置。 - // outside | inside - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'heart', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - a : 50, - b : 80, - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - 'zrender/shape/Heart',['require','./Base','../tool/util'],function (require) { - var Base = require('./Base'); - - function Heart(options) { - Base.call(this, options); - } - - Heart.prototype = { - type: 'heart', - - /** - * 创建扇形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - ctx.moveTo(style.x, style.y); - ctx.bezierCurveTo( - style.x + style.a / 2, - style.y - style.b * 2 / 3, - style.x + style.a * 2, - style.y + style.b / 3, - style.x, - style.y + style.b - ); - ctx.bezierCurveTo( - style.x - style.a * 2, - style.y + style.b / 3, - style.x - style.a / 2, - style.y - style.b * 2 / 3, - style.x, - style.y - ); - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function(style) { - if (style.__rect) { - return style.__rect; - } - - var lineWidth; - if (style.brushType == 'stroke' || style.brushType == 'fill') { - lineWidth = style.lineWidth || 1; - } - else { - lineWidth = 0; - } - style.__rect = { - x : Math.round(style.x - style.a - lineWidth / 2), - y : Math.round(style.y - style.b / 4 - lineWidth / 2), - width : style.a * 2 + lineWidth, - height : style.b * 5 / 4 + lineWidth - }; - - return style.__rect; - } - }; - - require('../tool/util').inherits(Heart, Base); - return Heart; - } -); -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:水滴 - * 可配图形属性: - { - // 基础属性 - shape : 'heart', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,水滴中心横坐标 - y : {number}, // 必须,水滴中心纵坐标 - a : {number}, // 必须,水滴横宽(中心到水平边缘最宽处距离) - b : {number}, // 必须,水滴纵高(中心到尖端距离) - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为outside,附加文本位置。 - // outside | inside - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'droplet', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - a : 50, - b : 80, - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - 'zrender/shape/Droplet',['require','./Base','../tool/util'],function (require) { - var Base = require('./Base'); - - function Droplet(options) { - Base.call(this, options); - } - - Droplet.prototype = { - type: 'droplet', - - /** - * 创建扇形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - ctx.moveTo(style.x, style.y + style.a); - ctx.bezierCurveTo( - style.x + style.a, - style.y + style.a, - style.x + style.a * 3 / 2, - style.y - style.a / 3, - style.x, - style.y - style.b - ); - ctx.bezierCurveTo( - style.x - style.a * 3 / 2, - style.y - style.a / 3, - style.x - style.a, - style.y + style.a, - style.x, - style.y + style.a - ); - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function(style) { - if (style.__rect) { - return style.__rect; - } - - var lineWidth; - if (style.brushType == 'stroke' || style.brushType == 'fill') { - lineWidth = style.lineWidth || 1; - } - else { - lineWidth = 0; - } - style.__rect = { - x : Math.round(style.x - style.a - lineWidth / 2), - y : Math.round(style.y - style.b - lineWidth / 2), - width : style.a * 2 + lineWidth, - height : style.a + style.b + lineWidth - }; - - return style.__rect; - } - }; - - require('../tool/util').inherits(Droplet, Base); - return Droplet; - } -); -/** - * echarts扩展zrender shape - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:icon - * 可配图形属性: - { - // 基础属性 - shape : 'icon', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,左上角横坐标 - y : {number}, // 必须,左上角纵坐标 - width : {number}, // 必须,宽度 - height : {number}, // 必须,高度 - iconType : {string}, // 必须,icon类型 - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - */ -define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/Star','zrender/shape/Heart','zrender/shape/Droplet','zrender/shape/Image','zrender/shape/Base'],function (require) { - var zrUtil = require('zrender/tool/util'); - - function _iconMark(ctx, style) { - var dx = style.width / 16; - var dy = style.height / 16; - ctx.moveTo(style.x, style.y + style.height); - ctx.lineTo(style.x + 5 * dx, style.y + 14 * dy); - ctx.lineTo(style.x + style.width, style.y + 3 * dy); - ctx.lineTo(style.x + 13 * dx, style.y); - ctx.lineTo(style.x + 2 * dx, style.y + 11 * dy); - ctx.lineTo(style.x, style.y + style.height); - - ctx.moveTo(style.x + 6 * dx, style.y + 10 * dy); - ctx.lineTo(style.x + 14 * dx, style.y + 2 * dy); - - ctx.moveTo(style.x + 10 * dx, style.y + 13 * dy); - ctx.lineTo(style.x + style.width, style.y + 13 * dy); - - ctx.moveTo(style.x + 13 * dx, style.y + 10 * dy); - ctx.lineTo(style.x + 13 * dx, style.y + style.height); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); - } - - function _iconMarkUndo(ctx, style) { - var dx = style.width / 16; - var dy = style.height / 16; - ctx.moveTo(style.x, style.y + style.height); - ctx.lineTo(style.x + 5 * dx, style.y + 14 * dy); - ctx.lineTo(style.x + style.width, style.y + 3 * dy); - ctx.lineTo(style.x + 13 * dx, style.y); - ctx.lineTo(style.x + 2 * dx, style.y + 11 * dy); - ctx.lineTo(style.x, style.y + style.height); - - ctx.moveTo(style.x + 6 * dx, style.y + 10 * dy); - ctx.lineTo(style.x + 14 * dx, style.y + 2 * dy); - - ctx.moveTo(style.x + 10 * dx, style.y + 13 * dy); - ctx.lineTo(style.x + style.width, style.y + 13 * dy); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); - } - - function _iconMarkClear(ctx, style) { - var dx = style.width / 16; - var dy = style.height / 16; - - ctx.moveTo(style.x + 4 * dx, style.y + 15 * dy); - ctx.lineTo(style.x + 9 * dx, style.y + 13 * dy); - ctx.lineTo(style.x + 14 * dx, style.y + 8 * dy); - ctx.lineTo(style.x + 11 * dx, style.y + 5 * dy); - ctx.lineTo(style.x + 6 * dx, style.y + 10 * dy); - ctx.lineTo(style.x + 4 * dx, style.y + 15 * dy); - - ctx.moveTo(style.x + 5 * dx, style.y); - ctx.lineTo(style.x + 11 * dx, style.y); - ctx.moveTo(style.x + 5 * dx, style.y + dy); - ctx.lineTo(style.x + 11 * dx, style.y + dy); - ctx.moveTo(style.x, style.y + 2 * dy); - ctx.lineTo(style.x + style.width, style.y + 2 * dy); - - ctx.moveTo(style.x, style.y + 5 * dy); - ctx.lineTo(style.x + 3 * dx, style.y + style.height); - ctx.lineTo(style.x + 13 * dx, style.y + style.height); - ctx.lineTo(style.x + style.width, style.y + 5 * dy); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); - } - - function _iconDataZoom(ctx, style) { - var dx = style.width / 16; - var dy = style.height / 16; - - ctx.moveTo(style.x, style.y + 3 * dy); - ctx.lineTo(style.x + 6 * dx, style.y + 3 * dy); - - ctx.moveTo(style.x + 3 * dx, style.y); - ctx.lineTo(style.x + 3 * dx, style.y + 6 * dy); - - ctx.moveTo(style.x + 3 * dx, style.y + 8 * dy); - ctx.lineTo(style.x + 3 * dx, style.y + style.height); - ctx.lineTo(style.x + style.width, style.y + style.height); - ctx.lineTo(style.x + style.width, style.y + 3 * dy); - ctx.lineTo(style.x + 8 * dx, style.y + 3 * dy); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); - } - - function _iconDataZoomReset(ctx, style) { - var dx = style.width / 16; - var dy = style.height / 16; - - ctx.moveTo(style.x + 6 * dx, style.y); - ctx.lineTo(style.x + 2 * dx, style.y + 3 * dy); - ctx.lineTo(style.x + 6 * dx, style.y + 6 * dy); - - ctx.moveTo(style.x + 2 * dx, style.y + 3 * dy); - ctx.lineTo(style.x + 14 * dx, style.y + 3 * dy); - ctx.lineTo(style.x + 14 * dx, style.y + 11 * dy); - - ctx.moveTo(style.x + 2 * dx, style.y + 5 * dy); - ctx.lineTo(style.x + 2 * dx, style.y + 13 * dy); - ctx.lineTo(style.x + 14 * dx, style.y + 13 * dy); - - ctx.moveTo(style.x + 10 * dx, style.y + 10 * dy); - ctx.lineTo(style.x + 14 * dx, style.y + 13 * dy); - ctx.lineTo(style.x + 10 * dx, style.y + style.height); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); - } - - function _iconRestore(ctx, style) { - var dx = style.width / 16; - var dy = style.height / 16; - var r = style.width / 2; - - ctx.lineWidth = 1.5; - - ctx.arc(style.x + r, style.y + r, r - dx, 0, Math.PI * 2 / 3); - ctx.moveTo(style.x + 3 * dx, style.y + style.height); - ctx.lineTo(style.x + 0 * dx, style.y + 12 * dy); - ctx.lineTo(style.x + 5 * dx, style.y + 11 * dy); - - ctx.moveTo(style.x, style.y + 8 * dy); - ctx.arc(style.x + r, style.y + r, r - dx, Math.PI, Math.PI * 5 / 3); - ctx.moveTo(style.x + 13 * dx, style.y); - ctx.lineTo(style.x + style.width, style.y + 4 * dy); - ctx.lineTo(style.x + 11 * dx, style.y + 5 * dy); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); - } - - function _iconLineChart(ctx, style) { - var dx = style.width / 16; - var dy = style.height / 16; - - ctx.moveTo(style.x, style.y); - ctx.lineTo(style.x, style.y + style.height); - ctx.lineTo(style.x + style.width, style.y + style.height); - - ctx.moveTo(style.x + 2 * dx, style.y + 14 * dy); - ctx.lineTo(style.x + 7 * dx, style.y + 6 * dy); - ctx.lineTo(style.x + 11 * dx, style.y + 11 * dy); - ctx.lineTo(style.x + 15 * dx, style.y + 2 * dy); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); - } - - function _iconBarChart(ctx, style) { - var dx = style.width / 16; - var dy = style.height / 16; - - ctx.moveTo(style.x, style.y); - ctx.lineTo(style.x, style.y + style.height); - ctx.lineTo(style.x + style.width, style.y + style.height); - - ctx.moveTo(style.x + 3 * dx, style.y + 14 * dy); - ctx.lineTo(style.x + 3 * dx, style.y + 6 * dy); - ctx.lineTo(style.x + 4 * dx, style.y + 6 * dy); - ctx.lineTo(style.x + 4 * dx, style.y + 14 * dy); - ctx.moveTo(style.x + 7 * dx, style.y + 14 * dy); - ctx.lineTo(style.x + 7 * dx, style.y + 2 * dy); - ctx.lineTo(style.x + 8 * dx, style.y + 2 * dy); - ctx.lineTo(style.x + 8 * dx, style.y + 14 * dy); - ctx.moveTo(style.x + 11 * dx, style.y + 14 * dy); - ctx.lineTo(style.x + 11 * dx, style.y + 9 * dy); - ctx.lineTo(style.x + 12 * dx, style.y + 9 * dy); - ctx.lineTo(style.x + 12 * dx, style.y + 14 * dy); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); - } - - function _iconStackChart(ctx, style) { - var x = style.x; - var y = style.y; - var width = style.width; - var height = style.height; - var dy = Math.round(height / 3); - var len = 3; - while (len--) { - ctx.rect(x, y + dy * len + 2, width, 2); - } - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); - } - - function _iconTiledChart(ctx, style) { - var x = style.x; - var y = style.y; - var width = style.width; - var height = style.height; - var dx = Math.round(width / 3); - var len = 3; - while (len--) { - ctx.rect(x + dx * len, y, 2, height); - } - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); - } - - function _iconDataView(ctx, style) { - var dx = style.width / 16; - - ctx.moveTo(style.x + dx, style.y); - ctx.lineTo(style.x + dx, style.y + style.height); - ctx.lineTo(style.x + 15 * dx, style.y + style.height); - ctx.lineTo(style.x + 15 * dx, style.y); - ctx.lineTo(style.x + dx, style.y); - - ctx.moveTo(style.x + 3 * dx, style.y + 3 * dx); - ctx.lineTo(style.x + 13 * dx, style.y + 3 * dx); - - ctx.moveTo(style.x + 3 * dx, style.y + 6 * dx); - ctx.lineTo(style.x + 13 * dx, style.y + 6 * dx); - - ctx.moveTo(style.x + 3 * dx, style.y + 9 * dx); - ctx.lineTo(style.x + 13 * dx, style.y + 9 * dx); - - ctx.moveTo(style.x + 3 * dx, style.y + 12 * dx); - ctx.lineTo(style.x + 9 * dx, style.y + 12 * dx); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); - } - - function _iconSave(ctx, style) { - var dx = style.width / 16; - var dy = style.height / 16; - - ctx.moveTo(style.x, style.y); - ctx.lineTo(style.x, style.y + style.height); - ctx.lineTo(style.x + style.width, style.y + style.height); - ctx.lineTo(style.x + style.width, style.y); - ctx.lineTo(style.x, style.y); - - ctx.moveTo(style.x + 4 * dx, style.y); - ctx.lineTo(style.x + 4 * dx, style.y + 8 * dy); - ctx.lineTo(style.x + 12 * dx, style.y + 8 * dy); - ctx.lineTo(style.x + 12 * dx, style.y); - - ctx.moveTo(style.x + 6 * dx, style.y + 11 * dy); - ctx.lineTo(style.x + 6 * dx, style.y + 13 * dy); - ctx.lineTo(style.x + 10 * dx, style.y + 13 * dy); - ctx.lineTo(style.x + 10 * dx, style.y + 11 * dy); - ctx.lineTo(style.x + 6 * dx, style.y + 11 * dy); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); - } - - function _iconCross(ctx, style) { - var x = style.x; - var y = style.y; - var width = style.width; - var height = style.height; - ctx.moveTo(x, y + height / 2); - ctx.lineTo(x + width, y + height / 2); - - ctx.moveTo(x + width / 2, y); - ctx.lineTo(x + width / 2, y + height); - } - - function _iconCircle(ctx, style) { - var width = style.width / 2; - var height = style.height / 2; - var r = Math.min(width, height); - ctx.moveTo( - style.x + width + r, - style.y + height - ); - ctx.arc( - style.x + width, - style.y + height, - r, - 0, - Math.PI * 2 - ); - } - - function _iconRectangle(ctx, style) { - ctx.rect(style.x, style.y, style.width, style.height); - } - - function _iconTriangle(ctx, style) { - var width = style.width / 2; - var height = style.height / 2; - var x = style.x + width; - var y = style.y + height; - var symbolSize = Math.min(width, height); - ctx.moveTo(x, y - symbolSize); - ctx.lineTo(x + symbolSize, y + symbolSize); - ctx.lineTo(x - symbolSize, y + symbolSize); - ctx.lineTo(x, y - symbolSize); - } - - function _iconDiamond(ctx, style) { - var width = style.width / 2; - var height = style.height / 2; - var x = style.x + width; - var y = style.y + height; - var symbolSize = Math.min(width, height); - ctx.moveTo(x, y - symbolSize); - ctx.lineTo(x + symbolSize, y); - ctx.lineTo(x, y + symbolSize); - ctx.lineTo(x - symbolSize, y); - ctx.lineTo(x, y - symbolSize); - } - - function _iconArrow(ctx, style) { - var x = style.x; - var y = style.y; - var dx = style.width / 16; - ctx.moveTo(x + 8 * dx, y); - ctx.lineTo(x + dx, y + style.height); - ctx.lineTo(x + 8 * dx, y + style.height / 4 * 3); - ctx.lineTo(x + 15 * dx, y + style.height); - ctx.lineTo(x + 8 * dx, y); - } - - function _iconStar(ctx, style) { - var StarShape = require('zrender/shape/Star'); - var width = style.width / 2; - var height = style.height / 2; - StarShape.prototype.buildPath(ctx, { - x : style.x + width, - y : style.y + height, - r : Math.min(width, height), - n : style.n || 5 - }); - } - - function _iconHeart(ctx, style) { - var HeartShape = require('zrender/shape/Heart'); - HeartShape.prototype.buildPath(ctx, { - x : style.x + style.width / 2, - y : style.y + style.height * 0.2, - a : style.width / 2, - b : style.height * 0.8 - }); - } - - function _iconDroplet(ctx, style) { - var DropletShape = require('zrender/shape/Droplet'); - DropletShape.prototype.buildPath(ctx, { - x : style.x + style.width * 0.5, - y : style.y + style.height * 0.5, - a : style.width * 0.5, - b : style.height * 0.8 - }); - } - - function _iconPin(ctx, style) { - var x = style.x; - var y = style.y - style.height / 2 * 1.5; - var width = style.width / 2; - var height = style.height / 2; - var r = Math.min(width, height); - ctx.arc( - x + width, - y + height, - r, - Math.PI / 5 * 4, - Math.PI / 5 - ); - ctx.lineTo(x + width, y + height + r * 1.5); - } - - function _iconImage(ctx, style) { - setTimeout(function (){ - var ImageShape = require('zrender/shape/Image'); - var itemShape = new ImageShape({ - style : style - }); - itemShape.brush(ctx); - },100); - } - - var Base = require('zrender/shape/Base'); - - function Icon(options) { - Base.call(this, options); - } - - Icon.prototype = { - type : 'icon', - iconLibrary : { - mark : _iconMark, - markUndo : _iconMarkUndo, - markClear : _iconMarkClear, - dataZoom : _iconDataZoom, - dataZoomReset : _iconDataZoomReset, - restore : _iconRestore, - lineChart : _iconLineChart, - barChart : _iconBarChart, - stackChart : _iconStackChart, - tiledChart : _iconTiledChart, - dataView : _iconDataView, - saveAsImage : _iconSave, - - cross : _iconCross, - circle : _iconCircle, - rectangle : _iconRectangle, - triangle : _iconTriangle, - diamond : _iconDiamond, - arrow : _iconArrow, - star : _iconStar, - heart : _iconHeart, - droplet : _iconDroplet, - pin : _iconPin, - image : _iconImage - }, - /** - * 创建矩形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function (ctx, style) { - if (this.iconLibrary[style.iconType]) { - this.iconLibrary[style.iconType](ctx, style); - } - else { - ctx.moveTo(style.x, style.y); - ctx.lineTo(style.x + style.width, style.y); - ctx.lineTo(style.x + style.width, style.y + style.height); - ctx.lineTo(style.x, style.y + style.height); - ctx.lineTo(style.x, style.y); - } - - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function (style) { - if (style.__rect) { - return style.__rect; - } - - // pin比较特殊,让尖端在目标x,y上 - style.__rect = { - x : Math.round(style.x), - y : Math.round(style.y - (style.iconType == 'pin' - ? (style.height / 2 * 1.5) : 0) - ), - width : style.width, - height : style.height - }; - - return style.__rect; - }, - - isCover : function (x, y) { - var originPos = this.getTansform(x, y); - x = originPos[0]; - y = originPos[1]; - - // 快速预判并保留判断矩形 - var rect = this.style.__rect; - if (!rect) { - rect = this.style.__rect = this.getRect(this.style); - } - // 提高交互体验,太小的图形包围盒四向扩大4px - var delta = (rect.height < 8 || rect.width < 8 ) ? 4 : 0; - if (x >= rect.x - delta - && x <= (rect.x + rect.width + delta) - && y >= rect.y - delta - && y <= (rect.y + rect.height + delta) - ) { - // 矩形内 - return true; - } - else { - return false; - } - } - }; - - zrUtil.inherits(Icon, Base); - - return Icon; -}); -/** - * 虚线lineTo - * - * author: Kener (@Kener-林峰, linzhifeng@baidu.com) - * errorrik (errorrik@gmail.com) - */ - -define( - 'zrender/shape/util/dashedLineTo',[],function (/* require */) { - - var dashPattern = [5, 5]; - /** - * 虚线lineTo - */ - return function (ctx, x1, y1, x2, y2, dashLength) { - // http://msdn.microsoft.com/en-us/library/ie/dn265063(v=vs.85).aspx - if (ctx.setLineDash) { - dashPattern[0] = dashPattern[1] = dashLength; - ctx.setLineDash(dashPattern); - ctx.moveTo(x1, y1); - ctx.lineTo(x2, y2); - return; - } - - dashLength = typeof dashLength != 'number' - ? 5 - : dashLength; - - var dx = x2 - x1; - var dy = y2 - y1; - var numDashes = Math.floor( - Math.sqrt(dx * dx + dy * dy) / dashLength - ); - dx = dx / numDashes; - dy = dy / numDashes; - var flag = true; - for (var i = 0; i < numDashes; ++i) { - if (flag) { - ctx.moveTo(x1, y1); - } else { - ctx.lineTo(x1, y1); - } - flag = !flag; - x1 += dx; - y1 += dy; - } - ctx.lineTo(x2, y2); - }; - } -); - -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:直线 - * 可配图形属性: - { - // 基础属性 - shape : 'line', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - xStart : {number}, // 必须,起点横坐标 - yStart : {number}, // 必须,起点纵坐标 - xEnd : {number}, // 必须,终点横坐标 - yEnd : {number}, // 必须,终点纵坐标 - strokeColor : {color}, // 默认为'#000',线条颜色(轮廓),支持rgba - lineType : {string}, // 默认为solid,线条类型,solid | dashed | dotted - lineWidth : {number}, // 默认为1,线条宽度 - lineCap : {string}, // 默认为butt,线帽样式。butt | round | square - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为end,附加文本位置。 - // inside | start | end - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#000' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'line', - id : '123456', - zlevel : 1, - style : { - xStart : 100, - yStart : 100, - xEnd : 200, - yEnd : 200, - strokeColor : '#eee', - lineWidth : 20, - text : 'Baidu' - }, - myName : 'kener', //可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - 'zrender/shape/Line',['require','./Base','./util/dashedLineTo','../tool/util'],function (require) { - var Base = require('./Base'); - var dashedLineTo = require('./util/dashedLineTo'); - - function Line(options) { - this.brushTypeOnly = 'stroke'; //线条只能描边,填充后果自负 - this.textPosition = 'end'; - Base.call(this, options); - } - - Line.prototype = { - type: 'line', - - /** - * 创建线条路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - if (!style.lineType || style.lineType == 'solid') { - //默认为实线 - ctx.moveTo(style.xStart, style.yStart); - ctx.lineTo(style.xEnd, style.yEnd); - } - else if (style.lineType == 'dashed' - || style.lineType == 'dotted' - ) { - var dashLength = (style.lineWidth || 1) - * (style.lineType == 'dashed' ? 5 : 1); - dashedLineTo( - ctx, - style.xStart, style.yStart, - style.xEnd, style.yEnd, - dashLength - ); - } - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function(style) { - if (style.__rect) { - return style.__rect; - } - - var lineWidth = style.lineWidth || 1; - style.__rect = { - x : Math.min(style.xStart, style.xEnd) - lineWidth, - y : Math.min(style.yStart, style.yEnd) - lineWidth, - width : Math.abs(style.xStart - style.xEnd) - + lineWidth, - height : Math.abs(style.yStart - style.yEnd) - + lineWidth - }; - - return style.__rect; - } - }; - - require('../tool/util').inherits(Line, Base); - return Line; - } -); -/** - * zrender: 向量操作类 - * - * author : https://github.com/pissang - */ -define( - 'zrender/tool/vector',[],function() { - var ArrayCtor = typeof Float32Array === 'undefined' - ? Array - : Float32Array; - - var vector = { - create : function(x, y) { - var out = new ArrayCtor(2); - out[0] = x || 0; - out[1] = y || 0; - return out; - }, - copy : function(out, v) { - out[0] = v[0]; - out[1] = v[1]; - }, - set : function(out, a, b) { - out[0] = a; - out[1] = b; - }, - add : function(out, v1, v2) { - out[0] = v1[0] + v2[0]; - out[1] = v1[1] + v2[1]; - return out; - }, - scaleAndAdd : function(out, v1, v2, a) { - out[0] = v1[0] + v2[0] * a; - out[1] = v1[1] + v2[1] * a; - return out; - }, - sub : function(out, v1, v2) { - out[0] = v1[0] - v2[0]; - out[1] = v1[1] - v2[1]; - return out; - }, - length : function(v) { - return Math.sqrt(this.lengthSquare(v)); - }, - lengthSquare : function(v) { - return v[0] * v[0] + v[1] * v[1]; - }, - mul : function(out, v1, v2) { - out[0] = v1[0] * v2[0]; - out[1] = v1[1] * v2[1]; - return out; - }, - dot : function(v1, v2) { - return v1[0] * v2[0] + v1[1] * v2[1]; - }, - scale : function(out, v, s) { - out[0] = v[0] * s; - out[1] = v[1] * s; - return out; - }, - normalize : function(out, v) { - var d = vector.length(v); - if(d === 0){ - out[0] = 0; - out[1] = 0; - }else{ - out[0] = v[0]/d; - out[1] = v[1]/d; - } - return out; - }, - distance : function(v1, v2) { - return Math.sqrt( - (v1[0] - v2[0]) * (v1[0] - v2[0]) + - (v1[1] - v2[1]) * (v1[1] - v2[1]) - ); - }, - negate : function(out, v) { - out[0] = -v[0]; - out[1] = -v[1]; - }, - middle : function(out, v1, v2) { - out[0] = (v1[0] + v2[0])/2; - out[1] = (v1[1] + v2[1])/2; - return out; - }, - applyTransform: function(out, v, m) { - var x = v[0]; - var y = v[1]; - out[0] = m[0] * x + m[2] * y + m[4]; - out[1] = m[1] * x + m[3] * y + m[5]; - return out; - } - }; - - vector.len = vector.length; - vector.dist = vector.distance; - - return vector; - } -); -/** - * 多线段平滑曲线 Catmull-Rom spline - * - * author: Kener (@Kener-林峰, linzhifeng@baidu.com) - * errorrik (errorrik@gmail.com) - */ - - -define( - 'zrender/shape/util/smoothSpline',['require','../../tool/vector'],function ( require ) { - var vector = require('../../tool/vector'); - - /** - * @inner - */ - function interpolate(p0, p1, p2, p3, t, t2, t3) { - var v0 = (p2 - p0) * 0.5; - var v1 = (p3 - p1) * 0.5; - return (2 * (p1 - p2) + v0 + v1) * t3 - + (- 3 * (p1 - p2) - 2 * v0 - v1) * t2 - + v0 * t + p1; - } - - /** - * 多线段平滑曲线 Catmull-Rom spline - */ - return function (points, isLoop) { - var len = points.length; - var ret = []; - - var distance = 0; - for (var i = 1; i < len; i++) { - distance += vector.distance(points[i-1], points[i]); - } - - var segs = distance / 5; - segs = segs < len ? len : segs; - for (var i = 0; i < segs; i++) { - var pos = i / (segs-1) * (isLoop ? len : len - 1); - var idx = Math.floor(pos); - - var w = pos - idx; - - var p0; - var p1 = points[idx % len]; - var p2; - var p3; - if (!isLoop) { - p0 = points[idx === 0 ? idx : idx - 1]; - p2 = points[idx > len - 2 ? len - 1 : idx + 1]; - p3 = points[idx > len - 3 ? len - 1 : idx + 2]; - } else { - p0 = points[(idx -1 + len) % len]; - p2 = points[(idx + 1) % len]; - p3 = points[(idx + 2) % len]; - } - - var w2 = w * w; - var w3 = w * w2; - - ret.push([ - interpolate(p0[0], p1[0], p2[0], p3[0], w, w2, w3), - interpolate(p0[1], p1[1], p2[1], p3[1], w, w2, w3) - ]); - } - return ret; - }; - } -); - -/** - * 贝塞尔平滑曲线 - * - * author: Kener (@Kener-林峰, linzhifeng@baidu.com) - * errorrik (errorrik@gmail.com) - */ - -define( - 'zrender/shape/util/smoothBezier',['require','../../tool/vector'],function ( require ) { - var vector = require('../../tool/vector'); - - /** - * 贝塞尔平滑曲线 - */ - return function (points, smooth, isLoop) { - var cps = []; - - var v = []; - var v1 = []; - var v2 = []; - var prevPoint; - var nextPoint; - - for (var i = 0, len = points.length; i < len; i++) { - var point = points[i]; - var prevPoint; - var nextPoint; - - if (isLoop) { - prevPoint = points[i ? i - 1 : len - 1]; - nextPoint = points[(i + 1) % len]; - } - else { - if (i === 0 || i === len - 1) { - cps.push(points[i]); - continue; - } - else { - prevPoint = points[i - 1]; - nextPoint = points[i + 1]; - } - } - - vector.sub(v, nextPoint, prevPoint); - - //use degree to scale the handle length - vector.scale(v, v, smooth); - - var d0 = vector.distance(point, prevPoint); - var d1 = vector.distance(point, nextPoint); - var sum = d0 + d1; - d0 /= sum; - d1 /= sum; - - vector.scale(v1, v, -d0); - vector.scale(v2, v, d1); - - cps.push(vector.add([], point, v1)); - cps.push(vector.add([], point, v2)); - } - - if (isLoop) { - cps.push(cps.shift()); - } - - return cps; - }; - } -); - -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:多边形 - * 可配图形属性: - { - // 基础属性 - shape : 'polygon', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - pointList : {Array}, // 必须,多边形各个顶角坐标 - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为top,附加文本位置。 - // inside | left | right | top | bottom - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'polygon', - id : '123456', - zlevel : 1, - style : { - pointList : [[10, 10], [300, 20], [298, 400], [50, 450]] - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - 'zrender/shape/Polygon',['require','./Base','./util/smoothSpline','./util/smoothBezier','./util/dashedLineTo','../tool/util'],function (require) { - var Base = require('./Base'); - var smoothSpline = require('./util/smoothSpline'); - var smoothBezier = require('./util/smoothBezier'); - var dashedLineTo = require('./util/dashedLineTo'); - - - function Polygon(options) { - Base.call(this, options); - } - - Polygon.prototype = { - type: 'polygon', - - /** - * 画刷 - * @param ctx 画布句柄 - * @param isHighlight 是否为高亮状态 - * @param updateCallback 需要异步加载资源的shape可以通过这个callback(e) - * 让painter更新视图,base.brush没用,需要的话重载brush - */ - brush : function (ctx, isHighlight) { - var style = this.style; - if (isHighlight) { - // 根据style扩展默认高亮样式 - style = this.getHighlightStyle( - style, - this.highlightStyle || {} - ); - } - - ctx.save(); - this.setContext(ctx, style); - - // 设置transform - this.setTransform(ctx); - - // 先fill再stroke - var hasPath = false; - if (style.brushType == 'fill' - || style.brushType == 'both' - || typeof style.brushType == 'undefined' // 默认为fill - ) { - ctx.beginPath(); - if (style.lineType == 'dashed' - || style.lineType == 'dotted' - ) { - // 特殊处理,虚线围不成path,实线再build一次 - this.buildPath( - ctx, - { - lineType: 'solid', - lineWidth: style.lineWidth, - pointList: style.pointList - } - ); - hasPath = false; // 这个path不能用 - } - else { - this.buildPath(ctx, style); - hasPath = true; // 这个path能用 - } - ctx.closePath(); - ctx.fill(); - } - - if (style.lineWidth > 0 - && (style.brushType == 'stroke' || style.brushType == 'both') - ) { - if (!hasPath) { - ctx.beginPath(); - this.buildPath(ctx, style); - ctx.closePath(); - } - ctx.stroke(); - } - - this.drawText(ctx, style, this.style); - - ctx.restore(); - - return; - }, - - /** - * 创建多边形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - // 虽然能重用brokenLine,但底层图形基于性能考虑,重复代码减少调用吧 - var pointList = style.pointList; - // 开始点和结束点重复 - /* - var start = pointList[0]; - var end = pointList[pointList.length-1]; - - if (start && end) { - if (start[0] == end[0] && - start[1] == end[1]) { - // 移除最后一个点 - pointList.pop(); - } - } - */ - - if (pointList.length < 2) { - // 少于2个点就不画了~ - return; - } - - if (style.smooth && style.smooth !== 'spline') { - var controlPoints = smoothBezier( - pointList, style.smooth, true - ); - - ctx.moveTo(pointList[0][0], pointList[0][1]); - var cp1; - var cp2; - var p; - var len = pointList.length; - for (var i = 0; i < len; i++) { - cp1 = controlPoints[i * 2]; - cp2 = controlPoints[i * 2 + 1]; - p = pointList[(i + 1) % len]; - ctx.bezierCurveTo( - cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1] - ); - } - } - else { - if (style.smooth === 'spline') { - pointList = smoothSpline(pointList, true); - } - - if (!style.lineType || style.lineType == 'solid') { - //默认为实线 - ctx.moveTo(pointList[0][0],pointList[0][1]); - for (var i = 1, l = pointList.length; i < l; i++) { - ctx.lineTo(pointList[i][0],pointList[i][1]); - } - ctx.lineTo(pointList[0][0], pointList[0][1]); - } - else if (style.lineType == 'dashed' - || style.lineType == 'dotted' - ) { - var dashLength = - style._dashLength - || (style.lineWidth || 1) - * (style.lineType == 'dashed' ? 5 : 1); - style._dashLength = dashLength; - ctx.moveTo(pointList[0][0],pointList[0][1]); - for (var i = 1, l = pointList.length; i < l; i++) { - dashedLineTo( - ctx, - pointList[i - 1][0], pointList[i - 1][1], - pointList[i][0], pointList[i][1], - dashLength - ); - } - dashedLineTo( - ctx, - pointList[pointList.length - 1][0], - pointList[pointList.length - 1][1], - pointList[0][0], - pointList[0][1], - dashLength - ); - } - } - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function(style) { - if (style.__rect) { - return style.__rect; - } - - var minX = Number.MAX_VALUE; - var maxX = Number.MIN_VALUE; - var minY = Number.MAX_VALUE; - var maxY = Number.MIN_VALUE; - - var pointList = style.pointList; - for(var i = 0, l = pointList.length; i < l; i++) { - if (pointList[i][0] < minX) { - minX = pointList[i][0]; - } - if (pointList[i][0] > maxX) { - maxX = pointList[i][0]; - } - if (pointList[i][1] < minY) { - minY = pointList[i][1]; - } - if (pointList[i][1] > maxY) { - maxY = pointList[i][1]; - } - } - - var lineWidth; - if (style.brushType == 'stroke' || style.brushType == 'fill') { - lineWidth = style.lineWidth || 1; - } - else { - lineWidth = 0; - } - - style.__rect = { - x : Math.round(minX - lineWidth / 2), - y : Math.round(minY - lineWidth / 2), - width : maxX - minX + lineWidth, - height : maxY - minY + lineWidth - }; - return style.__rect; - } - }; - - require('../tool/util').inherits(Polygon, Base); - return Polygon; - } -); -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:折线 - * 可配图形属性: - { - // 基础属性 - shape : 'brokenLine', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - pointList : {Array}, // 必须,各个顶角坐标 - smooth : {Number}, // 默认为0 - strokeColor : {color}, // 默认为'#000',线条颜色(轮廓),支持rgba - lineType : {string}, // 默认为solid,线条类型,solid | dashed | dotted - lineWidth : {number}, // 默认为1,线条宽度 - lineCap : {string}, // 默认为butt,线帽样式。butt | round | square - lineJoin : {string}, // 默认为miter,线段连接样式。miter | round | bevel - miterLimit : {number}, // 默认为10,最大斜接长度,仅当lineJoin为miter时生效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为end,附加文本位置。 - // start | end - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#000' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'brokenLine', - id : '123456', - zlevel : 1, - style : { - pointList : [[10, 10], [300, 20], [298, 400], [50, 450]], - strokeColor : '#eee', - lineWidth : 20, - text : 'Baidu' - }, - myName : 'kener', //可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - 'zrender/shape/BrokenLine',['require','./Base','./util/smoothSpline','./util/smoothBezier','./util/dashedLineTo','./Polygon','../tool/util'],function (require) { - var Base = require('./Base'); - var smoothSpline = require('./util/smoothSpline'); - var smoothBezier = require('./util/smoothBezier'); - var dashedLineTo = require('./util/dashedLineTo'); - - function BrokenLine( options ) { - this.brushTypeOnly = 'stroke'; //线条只能描边,填充后果自负 - this.textPosition = 'end'; - Base.call(this, options); - } - - BrokenLine.prototype = { - type: 'broken-line', - - /** - * 创建多边形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - var pointList = style.pointList; - if (pointList.length < 2) { - // 少于2个点就不画了~ - return; - } - - var len = Math.min( - style.pointList.length, - Math.round(style.pointListLength || style.pointList.length) - ); - - if (style.smooth && style.smooth !== 'spline') { - var controlPoints = smoothBezier( - pointList, style.smooth - ); - - ctx.moveTo(pointList[0][0], pointList[0][1]); - var cp1; - var cp2; - var p; - for (var i = 0; i < len - 1; i++) { - cp1 = controlPoints[i * 2]; - cp2 = controlPoints[i * 2 + 1]; - p = pointList[i + 1]; - ctx.bezierCurveTo( - cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1] - ); - } - } - else { - if (style.smooth === 'spline') { - pointList = smoothSpline(pointList); - len = pointList.length; - } - if (!style.lineType || style.lineType == 'solid') { - //默认为实线 - ctx.moveTo(pointList[0][0],pointList[0][1]); - for (var i = 1; i < len; i++) { - ctx.lineTo(pointList[i][0],pointList[i][1]); - } - } - else if (style.lineType == 'dashed' - || style.lineType == 'dotted' - ) { - var dashLength = (style.lineWidth || 1) - * (style.lineType == 'dashed' ? 5 : 1); - ctx.moveTo(pointList[0][0],pointList[0][1]); - for (var i = 1; i < len; i++) { - dashedLineTo( - ctx, - pointList[i - 1][0], pointList[i - 1][1], - pointList[i][0], pointList[i][1], - dashLength - ); - } - } - } - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function(style) { - return require('./Polygon').prototype.getRect(style); - } - }; - - require('../tool/util').inherits(BrokenLine, Base); - return BrokenLine; - } -); - -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:标线 - */ -define('echarts/util/shape/MarkLine',['require','zrender/shape/Base','./Icon','zrender/shape/Line','zrender/shape/BrokenLine','zrender/tool/matrix','zrender/tool/area','zrender/shape/util/dashedLineTo','zrender/shape/util/smoothSpline','zrender/tool/util'],function (require) { - var Base = require('zrender/shape/Base'); - var IconShape = require('./Icon'); - var LineShape = require('zrender/shape/Line'); - var lineInstance = new LineShape({}); - var BrokenLineShape = require('zrender/shape/BrokenLine'); - var brokenLineInstance = new BrokenLineShape({}); - - var matrix = require('zrender/tool/matrix'); - var area = require('zrender/tool/area'); - var dashedLineTo = require('zrender/shape/util/dashedLineTo'); - var smoothSpline = require('zrender/shape/util/smoothSpline'); - var zrUtil = require('zrender/tool/util'); - - - function MarkLine(options) { - Base.call(this, options); - } - - MarkLine.prototype = { - type : 'mark-line', - /** - * 画刷 - * @param ctx 画布句柄 - * @param e 形状实体 - * @param isHighlight 是否为高亮状态 - * @param updateCallback 需要异步加载资源的shape可以通过这个callback(e) - * 让painter更新视图,base.brush没用,需要的话重载brush - */ - brush : function (ctx, isHighlight) { - var style = this.style; - - if (isHighlight) { - // 根据style扩展默认高亮样式 - style = this.getHighlightStyle( - style, - this.highlightStyle || {} - ); - } - - ctx.save(); - this.setContext(ctx, style); - - // 设置transform - this.setTransform(ctx); - - ctx.beginPath(); - this.buildLinePath(ctx, style); - ctx.stroke(); - - this.brushSymbol(ctx, style, 0); - this.brushSymbol(ctx, style, 1); - - this.drawText(ctx, style, this.style); - - ctx.restore(); - }, - - /** - * 创建线条路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildLinePath : function (ctx, style) { - var pointList = style.pointList || this.getPointList(style); - style.pointList = pointList; - - var len = Math.min( - style.pointList.length, - Math.round(style.pointListLength || style.pointList.length) - ); - - if (!style.lineType || style.lineType == 'solid') { - //默认为实线 - ctx.moveTo(pointList[0][0],pointList[0][1]); - for (var i = 1; i < len; i++) { - ctx.lineTo(pointList[i][0],pointList[i][1]); - } - } - else if (style.lineType == 'dashed' - || style.lineType == 'dotted' - ) { - if (style.smooth !== 'spline') { - // 直线 - var dashLength = (style.lineWidth || 1) - * (style.lineType == 'dashed' ? 5 : 1); - ctx.moveTo(pointList[0][0],pointList[0][1]); - for (var i = 1; i < len; i++) { - dashedLineTo( - ctx, - pointList[i - 1][0], pointList[i - 1][1], - pointList[i][0], pointList[i][1], - dashLength - ); - } - } - else { - // 曲线 - for (var i = 1; i < len; i += 2) { - ctx.moveTo(pointList[i - 1][0],pointList[i - 1][1]); - ctx.lineTo(pointList[i][0],pointList[i][1]); - } - } - } - }, - - /** - * 标线始末标注 - */ - brushSymbol : function (ctx, style, idx) { - if (style.symbol[idx] == 'none') { - return; - } - ctx.save(); - ctx.beginPath(); - - ctx.lineWidth = style.symbolBorder; - ctx.strokeStyle = style.symbolBorderColor; - // symbol - style.iconType = style.symbol[idx].replace('empty', '') - .toLowerCase(); - if (style.symbol[idx].match('empty')) { - ctx.fillStyle = '#fff'; //'rgba(0, 0, 0, 0)'; - } - - // symbolRotate - var len = Math.min( - style.pointList.length, - Math.round(style.pointListLength || style.pointList.length) - ); - var x = idx === 0 ? style.pointList[0][0] : style.pointList[len - 1][0]; - var y = idx === 0 ? style.pointList[0][1] : style.pointList[len - 1][1]; - var rotate = typeof style.symbolRotate[idx] != 'undefined' - ? (style.symbolRotate[idx] - 0) : 0; - var transform; - if (rotate !== 0) { - transform = matrix.create(); - matrix.identity(transform); - if (x || y ) { - matrix.translate(transform, transform, [-x, -y]); - } - matrix.rotate( - transform, transform, - rotate * Math.PI / 180 - ); - if (x || y ) { - matrix.translate(transform, transform, [x, y]); - } - ctx.transform.apply(ctx, transform); - } - - if (style.iconType == 'arrow' && rotate === 0) { - // 箭头自动旋转,手动画 - this.buildArrawPath(ctx, style, idx); - } - else { - // symbolSize - var symbolSize = style.symbolSize[idx]; - style.x = x - symbolSize; - style.y = y - symbolSize, - style.width = symbolSize * 2; - style.height = symbolSize * 2; - IconShape.prototype.buildPath(ctx, style); - } - - ctx.closePath(); - ctx.fill(); - ctx.stroke(); - ctx.restore(); - }, - - buildArrawPath : function (ctx, style, idx) { - var len = Math.min( - style.pointList.length, - Math.round(style.pointListLength || style.pointList.length) - ); - var symbolSize = style.symbolSize[idx] * 2; - var xStart = style.pointList[0][0]; - var xEnd = style.pointList[len - 1][0]; - var yStart = style.pointList[0][1]; - var yEnd = style.pointList[len - 1][1]; - var delta = 0; - if (style.smooth === 'spline') { - delta = 0.2; // 偏移0.2弧度 - } - // 原谅我吧,这三角函数实在没想明白,只能这么笨了 - var rotate = Math.atan( - Math.abs((yEnd - yStart) / (xStart - xEnd) - )); - if (idx === 0) { - if (xEnd > xStart) { - if (yEnd > yStart) { - rotate = Math.PI * 2 - rotate + delta; - } - else { - rotate += delta; - } - } - else { - if (yEnd > yStart) { - rotate += Math.PI - delta; - } - else { - rotate = Math.PI - rotate - delta; - } - } - } - else { - if (xStart > xEnd) { - if (yStart > yEnd) { - rotate = Math.PI * 2 - rotate + delta; - } - else { - rotate += delta; - } - } - else { - if (yStart > yEnd) { - rotate += Math.PI - delta; - } - else { - rotate = Math.PI - rotate - delta; - } - } - } - - var halfRotate = Math.PI / 8; // 夹角 - var x = idx === 0 ? xStart : xEnd; - var y = idx === 0 ? yStart : yEnd; - var point= [ - [ - x + symbolSize * Math.cos(rotate - halfRotate), - y - symbolSize * Math.sin(rotate - halfRotate) - ], - [ - x + symbolSize * 0.6 * Math.cos(rotate), - y - symbolSize * 0.6 * Math.sin(rotate) - ], - [ - x + symbolSize * Math.cos(rotate + halfRotate), - y - symbolSize * Math.sin(rotate + halfRotate) - ] - ]; - ctx.moveTo(x, y); - for (var i = 0, l = point.length; i = rect.x - && x <= (rect.x + rect.width) - && y >= rect.y - && y <= (rect.y + rect.height) - ) { - // 矩形内 - return this.style.smooth !== 'spline' - ? area.isInside(lineInstance, this.style, x, y) - : area.isInside(brokenLineInstance, this.style, x, y); - } - - return false; - } - }; - - zrUtil.inherits(MarkLine, Base); - - return MarkLine; -}); - -// 由于大多数shape默认的isCover都是相同的逻辑 -// 所以在echarts里临时抽象一个module,用于isCover method -// TODO: 对zrender的isCover和getRect方法进行抽象,重新整理该逻辑 - -define('echarts/util/shape/normalIsCover',[],function () { - return function (x, y) { - var originPos = this.getTansform(x, y); - x = originPos[0]; - y = originPos[1]; - - // 快速预判并保留判断矩形 - var rect = this.style.__rect; - if (!rect) { - rect = this.style.__rect = this.getRect(this.style); - } - - return x >= rect.x - && x <= (rect.x + rect.width) - && y >= rect.y - && y <= (rect.y + rect.height); - }; -}); - -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:大规模散点图图形 - * 可配图形属性: - { - // 基础属性 - shape : 'symbol', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - pointList : {Array}, // 必须,二维数组,二维内容如下 - x : {number}, // 必须,横坐标 - y : {number}, // 必须,纵坐标数组 - size : {number}, // 必须,半宽 - type : {string=}, // 默认为'circle',图形类型 - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - */ -define('echarts/util/shape/Symbol',['require','zrender/shape/Base','zrender/shape/Polygon','zrender/tool/util','./normalIsCover'],function (require) { - var Base = require('zrender/shape/Base'); - var PolygonShape = require('zrender/shape/Polygon'); - var polygonInstance = new PolygonShape({}); - var zrUtil = require('zrender/tool/util'); - - function Symbol(options) { - Base.call(this, options); - } - - Symbol.prototype = { - type : 'symbol', - /** - * 创建矩形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function (ctx, style) { - var pointList = style.pointList; - var len = pointList.length; - if (len === 0) { - return; - } - - var subSize = 10000; - var subSetLength = Math.ceil(len / subSize); - var sub; - var subLen; - var isArray = pointList[0] instanceof Array; - var size = style.size ? style.size : 2; - var curSize = size; - var halfSize = size / 2; - var PI2 = Math.PI * 2; - var percent; - var x; - var y; - for (var j = 0; j < subSetLength; j++) { - ctx.beginPath(); - sub = j * subSize; - subLen = sub + subSize; - subLen = subLen > len ? len : subLen; - for (var i = sub; i < subLen; i++) { - if (style.random) { - percent = style['randomMap' + (i % 20)] / 100; - curSize = size * percent * percent; - halfSize = curSize / 2; - } - if (isArray) { - x = pointList[i][0]; - y = pointList[i][1]; - } - else { - x = pointList[i].x; - y = pointList[i].y; - } - if (curSize < 3) { - // 小于3像素视觉误差 - ctx.rect(x - halfSize, y - halfSize, curSize, curSize); - } - else { - // 大于3像素才考虑图形 - switch (style.iconType) { - case 'circle' : - ctx.moveTo(x, y); - ctx.arc(x, y, halfSize, 0, PI2, true); - break; - case 'diamond' : - ctx.moveTo(x, y - halfSize); - ctx.lineTo(x + halfSize / 3, y - halfSize / 3); - ctx.lineTo(x + halfSize, y); - ctx.lineTo(x + halfSize / 3, y + halfSize / 3); - ctx.lineTo(x, y + halfSize); - ctx.lineTo(x - halfSize / 3, y + halfSize / 3); - ctx.lineTo(x - halfSize, y); - ctx.lineTo(x - halfSize / 3, y - halfSize / 3); - ctx.lineTo(x, y - halfSize); - break; - default : - ctx.rect(x - halfSize, y - halfSize, curSize, curSize); - } - } - } - ctx.closePath(); - if (j < (subSetLength - 1)) { - switch (style.brushType) { - case 'both': - ctx.fill(); - style.lineWidth > 0 && ctx.stroke(); // js hint -_-" - break; - case 'stroke': - style.lineWidth > 0 && ctx.stroke(); - break; - default: - ctx.fill(); - } - } - } - }, - - /* 像素模式 - buildPath : function (ctx, style) { - var pointList = style.pointList; - var rect = this.getRect(style); - var ratio = window.devicePixelRatio || 1; - // console.log(rect) - // var ti = new Date(); - // bbox取整 - rect = { - x : Math.floor(rect.x), - y : Math.floor(rect.y), - width : Math.floor(rect.width), - height : Math.floor(rect.height) - }; - var pixels = ctx.getImageData( - rect.x * ratio, rect.y * ratio, - rect.width * ratio, rect.height * ratio - ); - var data = pixels.data; - var idx; - var zrColor = require('zrender/tool/color'); - var color = zrColor.toArray(style.color); - var r = color[0]; - var g = color[1]; - var b = color[2]; - var width = rect.width; - - for (var i = 1, l = pointList.length; i < l; i++) { - idx = ((Math.floor(pointList[i][0]) - rect.x) * ratio - + (Math.floor(pointList[i][1])- rect.y) * width * ratio * ratio - ) * 4; - data[idx] = r; - data[idx + 1] = g; - data[idx + 2] = b; - data[idx + 3] = 255; - } - ctx.putImageData(pixels, rect.x * ratio, rect.y * ratio); - // console.log(new Date() - ti); - return; - }, - */ - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function (style) { - return style.__rect || polygonInstance.getRect(style); - }, - - isCover : require('./normalIsCover') - }; - - zrUtil.inherits(Symbol, Base); - - return Symbol; -}); - -/** - * echarts通用私有数据服务 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/util/ecData',[],function() { - /** - * 打包私有数据 - * - * @param {shape} shape 修改目标 - * @param {Object} series - * @param {number} seriesIndex - * @param {number | Object} data - * @param {number} dataIndex - * @param {*=} special - * @param {*=} special2 - */ - function pack( - shape, series, seriesIndex, data, dataIndex, name, special, special2 - ) { - var value; - if (typeof data != 'undefined') { - value = data.value == null - ? data - : data.value; - } - - shape._echartsData = { - '_series' : series, - '_seriesIndex' : seriesIndex, - '_data' : data, - '_dataIndex' : dataIndex, - '_name' : name, - '_value' : value, - '_special' : special, - '_special2' : special2 - }; - return shape._echartsData; - } - - /** - * 从私有数据中获取特定项 - * @param {shape} shape - * @param {string} key - */ - function get(shape, key) { - var data = shape._echartsData; - if (!key) { - return data; - } - - switch (key) { - case 'series' : - case 'seriesIndex' : - case 'data' : - case 'dataIndex' : - case 'name' : - case 'value' : - case 'special' : - case 'special2' : - return data && data['_' + key]; - } - - return null; - } - - /** - * 修改私有数据中获取特定项 - * @param {shape} shape - * @param {string} key - * @param {*} value - */ - function set(shape, key, value) { - shape._echartsData = shape._echartsData || {}; - switch (key) { - case 'series' : // 当前系列值 - case 'seriesIndex' : // 系列数组位置索引 - case 'data' : // 当前数据值 - case 'dataIndex' : // 数据数组位置索引 - case 'name' : - case 'value' : - case 'special' : - case 'special2' : - shape._echartsData['_' + key] = value; - break; - } - } - - /** - * 私有数据克隆,把source拷贝到target上 - * @param {shape} source 源 - * @param {shape} target 目标 - */ - function clone(source, target) { - target._echartsData = { - '_series' : source._echartsData._series, - '_seriesIndex' : source._echartsData._seriesIndex, - '_data' : source._echartsData._data, - '_dataIndex' : source._echartsData._dataIndex, - '_name' : source._echartsData._name, - '_value' : source._echartsData._value, - '_special' : source._echartsData._special, - '_special2' : source._echartsData._special2 - }; - } - - return { - pack : pack, - set : set, - get : get, - clone : clone - }; -}); -/** - * echarts图表动画基类 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/util/ecAnimation',['require','zrender/tool/util','zrender/shape/Polygon'],function (require) { - var zrUtil = require('zrender/tool/util'); - - /** - * 折线型动画 - * - * @param {ZRender} zr - * @param {shape} oldShape - * @param {shape} newShape - * @param {number} duration - * @param {tring} easing - */ - function pointList(zr, oldShape, newShape, duration, easing) { - var newPointList = newShape.style.pointList; - var newPointListLen = newPointList.length; - var oldPointList; - - if (!oldShape) { // add - oldPointList = []; - if (newShape._orient != 'vertical') { - var y = newPointList[0][1]; - for (var i = 0; i < newPointListLen; i++) { - oldPointList[i] = [newPointList[i][0], y]; - } - } - else { - var x = newPointList[0][0]; - for (var i = 0; i < newPointListLen; i++) { - oldPointList[i] = [x, newPointList[i][1]]; - } - } - - if (newShape.type == 'half-smooth-polygon') { - oldPointList[newPointListLen - 1] = zrUtil.clone(newPointList[newPointListLen - 1]); - oldPointList[newPointListLen - 2] = zrUtil.clone(newPointList[newPointListLen - 2]); - } - oldShape = {style : {pointList : oldPointList}}; - } - - oldPointList = oldShape.style.pointList; - var oldPointListLen = oldPointList.length; - if (oldPointListLen == newPointListLen) { - newShape.style.pointList = oldPointList; - } - else if (oldPointListLen < newPointListLen) { - // 原来短,新的长,补全 - newShape.style.pointList = oldPointList.concat(newPointList.slice(oldPointListLen)); - } - else { - // 原来长,新的短,截断 - newShape.style.pointList = oldPointList.slice(0, newPointListLen); - } - - zr.addShape(newShape); - zr.animate(newShape.id, 'style') - .when( - duration, - { pointList: newPointList } - ) - .start(easing); - } - - /** - * 复制样式 - * - * @inner - * @param {Object} target 目标对象 - * @param {Object} source 源对象 - * @param {...string} props 复制的属性列表 - */ - function cloneStyle(target, source) { - var len = arguments.length; - for (var i = 2; i < len; i++) { - var prop = arguments[i]; - target.style[prop] = source.style[prop]; - } - } - - /** - * 方型动画 - * - * @param {ZRender} zr - * @param {shape} oldShape - * @param {shape} newShape - * @param {number} duration - * @param {tring} easing - */ - function rectangle(zr, oldShape, newShape, duration, easing) { - var newShapeStyle = newShape.style; - if (!oldShape) { // add - oldShape = { - style : { - x : newShapeStyle.x, - y : newShape._orient == 'vertical' - ? newShapeStyle.y + newShapeStyle.height - : newShapeStyle.y, - width: newShape._orient == 'vertical' - ? newShapeStyle.width : 0, - height: newShape._orient != 'vertical' - ? newShapeStyle.height : 0 - } - }; - } - - var newX = newShapeStyle.x; - var newY = newShapeStyle.y; - var newWidth = newShapeStyle.width; - var newHeight = newShapeStyle.height; - cloneStyle( - newShape, oldShape, - 'x', 'y', 'width', 'height' - ); - - zr.addShape(newShape); - zr.animate(newShape.id, 'style') - .when( - duration, - { - x: newX, - y: newY, - width: newWidth, - height: newHeight - } - ) - .start(easing); - } - - /** - * 蜡烛动画 - * - * @param {ZRender} zr - * @param {shape} oldShape - * @param {shape} newShape - * @param {number} duration - * @param {tring} easing - */ - function candle(zr, oldShape, newShape, duration, easing) { - if (!oldShape) { // add - var y = newShape.style.y; - oldShape = {style : {y : [y[0], y[0], y[0], y[0]]}}; - } - - var newY = newShape.style.y; - newShape.style.y = oldShape.style.y; - zr.addShape(newShape); - zr.animate(newShape.id, 'style') - .when( - duration, - { y: newY } - ) - .start(easing); - } - - /** - * 环型动画 - * - * @param {ZRender} zr - * @param {shape} oldShape - * @param {shape} newShape - * @param {number} duration - * @param {tring} easing - */ - function ring(zr, oldShape, newShape, duration, easing) { - var x = newShape.style.x; - var y = newShape.style.y; - var r0 = newShape.style.r0; - var r = newShape.style.r; - - if (newShape._animationAdd != 'r') { - newShape.style.r0 = 0; - newShape.style.r = 0; - newShape.rotation = [Math.PI*2, x, y]; - - zr.addShape(newShape); - zr.animate(newShape.id, 'style') - .when( - duration, - { - r0 : r0, - r : r - } - ) - .start(easing); - zr.animate(newShape.id, '') - .when( - Math.round(duration / 3 * 2), - { rotation : [0, x, y] } - ) - .start(easing); - } - else { - newShape.style.r0 = newShape.style.r; - - zr.addShape(newShape); - zr.animate(newShape.id, 'style') - .when( - duration, - { - r0 : r0 - } - ) - .start(easing); - } - } - - /** - * 扇形动画 - * - * @param {ZRender} zr - * @param {shape} oldShape - * @param {shape} newShape - * @param {number} duration - * @param {tring} easing - */ - function sector(zr, oldShape, newShape, duration, easing) { - if (!oldShape) { // add - if (newShape._animationAdd != 'r') { - oldShape = { - style : { - startAngle : newShape.style.startAngle, - endAngle : newShape.style.startAngle - } - }; - } - else { - oldShape = {style : {r0 : newShape.style.r}}; - } - } - - var startAngle = newShape.style.startAngle; - var endAngle = newShape.style.endAngle; - - cloneStyle( - newShape, oldShape, - 'startAngle', 'endAngle' - ); - - zr.addShape(newShape); - zr.animate(newShape.id, 'style') - .when( - duration, - { - startAngle : startAngle, - endAngle : endAngle - } - ) - .start(easing); - } - - /** - * 文本动画 - * - * @param {ZRender} zr - * @param {shape} oldShape - * @param {shape} newShape - * @param {number} duration - * @param {tring} easing - */ - function text(zr, oldShape, newShape, duration, easing) { - if (!oldShape) { // add - oldShape = { - style : { - x : newShape.style.textAlign == 'left' - ? newShape.style.x + 100 - : newShape.style.x - 100, - y : newShape.style.y - } - }; - } - - var x = newShape.style.x; - var y = newShape.style.y; - - cloneStyle( - newShape, oldShape, - 'x', 'y' - ); - - zr.addShape(newShape); - zr.animate(newShape.id, 'style') - .when( - duration, - { - x : x, - y : y - } - ) - .start(easing); - } - - /** - * 多边形动画 - * - * @param {ZRender} zr - * @param {shape} oldShape - * @param {shape} newShape - * @param {number} duration - * @param {tring} easing - */ - function polygon(zr, oldShape, newShape, duration, easing) { - var rect = require('zrender/shape/Polygon').prototype.getRect(newShape.style); - var x = rect.x + rect.width / 2; - var y = rect.y + rect.height / 2; - - newShape.scale = [0.1, 0.1, x, y]; - zr.addShape(newShape); - zr.animate(newShape.id, '') - .when( - duration, - { - scale : [1, 1, x, y] - } - ) - .start(easing); - } - - /** - * 和弦动画 - * - * @param {ZRender} zr - * @param {shape} oldShape - * @param {shape} newShape - * @param {number} duration - * @param {tring} easing - */ - function chord(zr, oldShape, newShape, duration, easing) { - if (!oldShape) { // add - oldShape = { - style : { - source0 : 0, - source1 : 360, - target0 : 0, - target1 : 360 - } - }; - } - - var source0 = newShape.style.source0; - var source1 = newShape.style.source1; - var target0 = newShape.style.target0; - var target1 = newShape.style.target1; - - if (oldShape.style) { - cloneStyle( - newShape, oldShape, - 'source0', 'source1', 'target0', 'target1' - ); - } - - zr.addShape(newShape); - zr.animate(newShape.id, 'style') - .when( - duration, - { - source0 : source0, - source1 : source1, - target0 : target0, - target1 : target1 - } - ) - .start(easing); - } - - /** - * gaugePointer动画 - * - * @param {ZRender} zr - * @param {shape} oldShape - * @param {shape} newShape - * @param {number} duration - * @param {tring} easing - */ - function gaugePointer(zr, oldShape, newShape, duration, easing) { - if (!oldShape) { // add - oldShape = { - style : { - angle : newShape.style.startAngle - } - }; - } - - var angle = newShape.style.angle; - newShape.style.angle = oldShape.style.angle; - zr.addShape(newShape); - zr.animate(newShape.id, 'style') - .when( - duration, - { - angle : angle - } - ) - .start(easing); - } - - /** - * icon动画 - * - * @param {ZRender} zr - * @param {shape} oldShape - * @param {shape} newShape - * @param {number} duration - * @param {tring} easing - */ - function icon(zr, oldShape, newShape, duration, easing) { - // 避免markPoint特效取值在动画帧上 - newShape.style._x = newShape.style.x; - newShape.style._y = newShape.style.y; - newShape.style._width = newShape.style.width; - newShape.style._height = newShape.style.height; - - if (!oldShape) { // add - var x = newShape._x || 0; - var y = newShape._y || 0; - newShape.scale = [0, 0, x, y]; - zr.addShape(newShape); - zr.animate(newShape.id, '') - .when( - duration, - {scale : [1, 1, x, y]} - ) - .start(easing || 'QuinticOut'); - } - else { // mod - rectangle(zr, oldShape, newShape, duration, easing); - } - } - - /** - * line动画 - * - * @param {ZRender} zr - * @param {shape} oldShape - * @param {shape} newShape - * @param {number} duration - * @param {tring} easing - */ - function line(zr, oldShape, newShape, duration, easing) { - if (!oldShape) { - oldShape = { - style : { - xEnd : newShape.style.xStart, - yEnd : newShape.style.yStart - } - }; - } - - var xStart = newShape.style.xStart; - var xEnd = newShape.style.xEnd; - var yStart = newShape.style.yStart; - var yEnd = newShape.style.yEnd; - - cloneStyle( - newShape, oldShape, - 'xStart', 'xEnd', 'yStart', 'yEnd' - ); - - zr.addShape(newShape); - zr.animate(newShape.id, 'style') - .when( - duration, - { - xStart: xStart, - xEnd: xEnd, - yStart: yStart, - yEnd: yEnd - } - ) - .start(easing); - } - - /** - * markline动画 - * - * @param {ZRender} zr - * @param {shape} oldShape - * @param {shape} newShape - * @param {number} duration - * @param {tring} easing - */ - function markline(zr, oldShape, newShape, duration, easing) { - if (!newShape.style.smooth) { - newShape.style.pointList = !oldShape - ? [ - [newShape.style.xStart, newShape.style.yStart], - [newShape.style.xStart, newShape.style.yStart] - ] - : oldShape.style.pointList; - zr.addShape(newShape); - zr.animate(newShape.id, 'style') - .when( - duration, - { - pointList : [ - [ - newShape.style.xStart, - newShape.style.yStart - ], - [ - newShape._x || 0, newShape._y || 0 - ] - ] - } - ) - .start(easing || 'QuinticOut'); - } - else { - // 曲线动画 - newShape.style.pointListLength = 1; - zr.addShape(newShape); - newShape.style.pointList = newShape.style.pointList - || newShape.getPointList(newShape.style); - zr.animate(newShape.id, 'style') - .when( - duration, - { - pointListLength : newShape.style.pointList.length - } - ) - .start(easing || 'QuinticOut'); - } - } - - return { - pointList : pointList, - rectangle : rectangle, - candle : candle, - ring : ring, - sector : sector, - text : text, - polygon : polygon, - chord : chord, - gaugePointer : gaugePointer, - icon : icon, - line : line, - markline : markline - }; -}); - -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:圆 - * 可配图形属性: - { - // 基础属性 - shape : 'circle', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,圆心横坐标 - y : {number}, // 必须,圆心纵坐标 - r : {number}, // 必须,圆半径 - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为top,附加文本位置。 - // inside | left | right | top | bottom - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'circle', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - r : 50, - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - 'zrender/shape/Circle',['require','./Base','../tool/util'],function (require) { - var Base = require('./Base'); - - function Circle(options) { - Base.call(this, options); - } - - Circle.prototype = { - type: 'circle', - /** - * 创建圆形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function (ctx, style) { - ctx.arc(style.x, style.y, style.r, 0, Math.PI * 2, true); - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function (style) { - if (style.__rect) { - return style.__rect; - } - - var lineWidth; - if (style.brushType == 'stroke' || style.brushType == 'fill') { - lineWidth = style.lineWidth || 1; - } - else { - lineWidth = 0; - } - style.__rect = { - x : Math.round(style.x - style.r - lineWidth / 2), - y : Math.round(style.y - style.r - lineWidth / 2), - width : style.r * 2 + lineWidth, - height : style.r * 2 + lineWidth - }; - - return style.__rect; - } - }; - - require('../tool/util').inherits(Circle, Base); - return Circle; - } -); -/** - * echarts图表特效基类 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/util/ecEffect',['require','../util/ecData','zrender/shape/Circle','zrender/shape/Image','../util/shape/Icon','../util/shape/Symbol','zrender/tool/env'],function (require) { - var ecData = require('../util/ecData'); - - var CircleShape = require('zrender/shape/Circle'); - var ImageShape = require('zrender/shape/Image'); - var IconShape = require('../util/shape/Icon'); - var SymbolShape = require('../util/shape/Symbol'); - - var canvasSupported = require('zrender/tool/env').canvasSupported; - - function point(zr, effectList, shape, zlevel) { - var effect = shape.effect; - var color = effect.color || shape.style.strokeColor || shape.style.color; - var shadowColor = effect.shadowColor || color; - var size = effect.scaleSize; - var shadowBlur = typeof effect.shadowBlur != 'undefined' - ? effect.shadowBlur : size; - - var effectShape = new IconShape({ - zlevel : zlevel, - style : { - brushType : 'stroke', - iconType : (shape.style.iconType != 'pin' - && shape.style.iconType != 'droplet') - ? shape.style.iconType - : 'circle', - x : shadowBlur + 1, // 线宽 - y : shadowBlur + 1, - n : shape.style.n, - width : shape.style.width * size, - height : shape.style.height * size, - lineWidth : 1, - strokeColor : color, - shadowColor : shadowColor, - shadowBlur : shadowBlur - }, - draggable : false, - hoverable : false - }); - - if (canvasSupported) { // 提高性能,换成image - effectShape.style.image = zr.shapeToImage( - effectShape, - effectShape.style.width + shadowBlur * 2 + 2, - effectShape.style.height + shadowBlur * 2 + 2 - ).style.image; - - effectShape = new ImageShape({ - zlevel : effectShape.zlevel, - style : effectShape.style, - draggable : false, - hoverable : false - }); - } - - ecData.clone(shape, effectShape); - - // 改变坐标,不能移到前面 - effectShape.position = shape.position; - effectList.push(effectShape); - zr.addShape(effectShape); - - var devicePixelRatio = window.devicePixelRatio || 1; - var offset = (effectShape.style.width / devicePixelRatio - shape.style.width) / 2; - effectShape.style.x = shape.style._x - offset; - effectShape.style.y = shape.style._y - offset; - var duration = (effect.period + Math.random() * 10) * 100; - - zr.modShape( - shape.id, - { invisible : true} - ); - - var centerX = effectShape.style.x + (effectShape.style.width) / 2 / devicePixelRatio; - var centerY = effectShape.style.y + (effectShape.style.height) / 2 / devicePixelRatio; - zr.modShape( - effectShape.id, - { - scale : [0.1, 0.1, centerX, centerY] - } - ); - - zr.animate(effectShape.id, '', effect.loop) - .when( - duration, - { - scale : [1, 1, centerX, centerY] - } - ) - .done(function() { - shape.effect.show = false; - zr.delShape(effectShape.id); - }) - .start(); - } - - function largePoint(zr, effectList, shape, zlevel) { - var effect = shape.effect; - var color = effect.color || shape.style.strokeColor || shape.style.color; - var size = effect.scaleSize; - var shadowColor = effect.shadowColor || color; - var shadowBlur = typeof effect.shadowBlur != 'undefined' - ? effect.shadowBlur : (size * 2); - var devicePixelRatio = window.devicePixelRatio || 1; - var effectShape = new SymbolShape({ - zlevel : zlevel, - position : shape.position, - scale : shape.scale, - style : { - pointList : shape.style.pointList, - iconType : shape.style.iconType, - color : color, - strokeColor : color, - shadowColor : shadowColor, - shadowBlur : shadowBlur * devicePixelRatio, - random : true, - brushType: 'fill', - lineWidth:1, - size : shape.style.size - }, - draggable : false, - hoverable : false - }); - - effectList.push(effectShape); - zr.addShape(effectShape); - zr.modShape( - shape.id, - { invisible : true} - ); - - var duration = Math.round(effect.period * 100); - var clip1 = {}; - var clip2 = {}; - for (var i = 0; i < 20; i++) { - effectShape.style['randomMap' + i] = 0; - clip1 = {}; - clip1['randomMap' + i] = 100; - clip2 = {}; - clip2['randomMap' + i] = 0; - effectShape.style['randomMap' + i] = Math.random() * 100; - zr.animate(effectShape.id, 'style', true) - .when(duration, clip1) - .when(duration * 2, clip2) - .when(duration * 3, clip1) - .when(duration * 4, clip1) - .delay(Math.random() * duration * i) - //.delay(duration / 15 * (15 - i + 1)) - .start(); - - } - } - - function line(zr, effectList, shape, zlevel) { - var effect = shape.effect; - var color = effect.color || shape.style.strokeColor || shape.style.color; - var shadowColor = effect.shadowColor || shape.style.strokeColor || color; - var size = shape.style.lineWidth * effect.scaleSize; - var shadowBlur = typeof effect.shadowBlur != 'undefined' - ? effect.shadowBlur : size; - - var effectShape = new CircleShape({ - zlevel : zlevel, - style : { - x : shadowBlur, - y : shadowBlur, - r : size, - color : color, - shadowColor : shadowColor, - shadowBlur : shadowBlur - }, - draggable : false, - hoverable : false - }); - - var offset; - if (canvasSupported) { // 提高性能,换成image - effectShape.style.image = zr.shapeToImage( - effectShape, - (size + shadowBlur) * 2, - (size + shadowBlur) * 2 - ).style.image; - effectShape = new ImageShape({ - zlevel : effectShape.zlevel, - style : effectShape.style, - draggable : false, - hoverable : false - }); - offset = shadowBlur; - } - else { - offset = 0; - } - - ecData.clone(shape, effectShape); - - // 改变坐标, 不能移到前面 - effectShape.position = shape.position; - effectList.push(effectShape); - zr.addShape(effectShape); - - effectShape.style.x = shape.style.xStart - offset; - effectShape.style.y = shape.style.yStart - offset; - var distance = (shape.style.xStart - shape.style.xEnd) - * (shape.style.xStart - shape.style.xEnd) - + - (shape.style.yStart - shape.style.yEnd) - * (shape.style.yStart - shape.style.yEnd); - var duration = Math.round(Math.sqrt(Math.round( - distance * effect.period * effect.period - ))); - if (!shape.style.smooth) { - // 直线 - zr.animate(effectShape.id, 'style', effect.loop) - .when( - duration, - { - x : shape._x - offset, - y : shape._y - offset - } - ) - .done(function() { - shape.effect.show = false; - zr.delShape(effectShape.id); - }) - .start(); - } - else { - // 曲线 - var pointList = shape.style.pointList || shape.getPointList(shape.style); - var len = pointList.length; - duration = Math.round(duration / len); - var deferred = zr.animate(effectShape.id, 'style', effect.loop); - var step = Math.ceil(len / 8); - for (var j = 0; j < len - step; j+= step) { - deferred.when( - duration * (j + 1), - { - x : pointList[j][0] - offset, - y : pointList[j][1] - offset - } - ); - } - deferred.when( - duration * len, - { - x : pointList[len - 1][0] - offset, - y : pointList[len - 1][1] - offset - } - ); - deferred.done(function() { - shape.effect.show = false; - zr.delShape(effectShape.id); - }); - deferred.start('spline'); - } - } - - return { - point : point, - largePoint : largePoint, - line : line - }; -}); - -/** - * 高精度数学运算 - */ -define('echarts/util/accMath',[],function() { - // 除法函数,用来得到精确的除法结果 - // 说明:javascript的除法结果会有误差,在两个浮点数相除的时候会比较明显。这个函数返回较为精确的除法结果。 - // 调用:accDiv(arg1,arg2) - // 返回值:arg1除以arg2的精确结果 - function accDiv(arg1, arg2) { - return accMul(arg1, 1 / arg2); - } - - // 乘法函数,用来得到精确的乘法结果 - // 说明:javascript的乘法结果会有误差,在两个浮点数相乘的时候会比较明显。这个函数返回较为精确的乘法结果。 - // 调用:accMul(arg1,arg2) - // 返回值:arg1乘以arg2的精确结果 - function accMul(arg1, arg2) { - var m = 0; - var s1 = arg1.toString(); - var s2 = arg2.toString(); - try { - m += s1.split('.')[1].length; - } - catch(e) {} - - try { - m += s2.split('.')[1].length; - } - catch(e){} - - return (s1.replace('.', '') - 0) * (s2.replace('.', '') - 0) / Math.pow(10, m); - } - - // 加法函数,用来得到精确的加法结果 - // 说明:javascript的加法结果会有误差,在两个浮点数相加的时候会比较明显。这个函数返回较为精确的加法结果。 - // 调用:accAdd(arg1,arg2) - // 返回值:arg1加上arg2的精确结果 - function accAdd(arg1, arg2) { - var r1 = 0; - var r2 = 0; - - try { - r1 = arg1.toString().split('.')[1].length; - } - catch(e) {} - - try { - r2 = arg2.toString().split('.')[1].length; - } - catch(e) {} - - var m = Math.pow(10, Math.max(r1, r2)); - return (Math.round(arg1 * m) + Math.round(arg2 * m)) / m; - } - - //减法函数,用来得到精确的减法结果 - //说明:javascript的减法结果会有误差,在两个浮点数减法的时候会比较明显。这个函数返回较为精确的减法结果。 - //调用:accSub(arg1,arg2) - //返回值:arg1减法arg2的精确结果 - function accSub(arg1,arg2) { - return accAdd(arg1, -arg2); - } - - return { - accDiv : accDiv, - accMul : accMul, - accAdd : accAdd, - accSub : accSub - }; -}); -/** - * echarts图表基类 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon','../util/shape/MarkLine','../util/shape/Symbol','../config','../util/ecData','../util/ecAnimation','../util/ecEffect','../util/accMath','zrender/tool/util','zrender/tool/area'],function (require) { - // 图形依赖 - var ImageShape = require('zrender/shape/Image'); - var IconShape = require('../util/shape/Icon'); - var MarkLineShape = require('../util/shape/MarkLine'); - var SymbolShape = require('../util/shape/Symbol'); - - var ecConfig = require('../config'); - var ecData = require('../util/ecData'); - var ecAnimation = require('../util/ecAnimation'); - var ecEffect = require('../util/ecEffect'); - var accMath = require('../util/accMath'); - var zrUtil = require('zrender/tool/util'); - var zrArea = require('zrender/tool/area'); - - function Base(){ - var self = this; - this.selectedMap = {}; - this.lastShapeList = []; - this.shapeHandler = { - onclick : function () { - self.isClick = true; - }, - - ondragover : function (param) { - // 返回触发可计算特性的图形提示 - var calculableShape = param.target; - calculableShape.highlightStyle = calculableShape.highlightStyle || {}; - - // 备份特出特性 - var highlightStyle = calculableShape.highlightStyle; - var brushType = highlightStyle.brushTyep; - var strokeColor = highlightStyle.strokeColor; - var lineWidth = highlightStyle.lineWidth; - - highlightStyle.brushType = 'stroke'; - highlightStyle.strokeColor = self.ecTheme.calculableColor; - highlightStyle.lineWidth = calculableShape.type == 'icon' ? 30 : 10; - - self.zr.addHoverShape(calculableShape); - - setTimeout(function (){ - // 复位 - if (calculableShape.highlightStyle) { - calculableShape.highlightStyle.brushType = brushType; - calculableShape.highlightStyle.strokeColor = strokeColor; - calculableShape.highlightStyle.lineWidth = lineWidth; - } - },20); - }, - - ondrop : function (param) { - // 排除一些非数据的拖拽进入 - if (typeof ecData.get(param.dragged, 'data') != 'undefined') { - self.isDrop = true; - } - }, - - ondragend : function () { - self.isDragend = true; - } - }; - } - - /** - * 基类方法 - */ - Base.prototype = { - /** - * 图形拖拽特性 - */ - setCalculable : function (shape) { - shape.dragEnableTime = this.ecTheme.DRAG_ENABLE_TIME; - shape.ondragover = this.shapeHandler.ondragover; - shape.ondragend = this.shapeHandler.ondragend; - shape.ondrop = this.shapeHandler.ondrop; - return shape; - }, - - /** - * 数据项被拖拽进来 - */ - ondrop : function (param, status) { - if (!this.isDrop || !param.target) { - // 没有在当前实例上发生拖拽行为则直接返回 - return; - } - var target = param.target; // 拖拽安放目标 - var dragged = param.dragged; // 当前被拖拽的图形对象 - - var seriesIndex = ecData.get(target, 'seriesIndex'); - var dataIndex = ecData.get(target, 'dataIndex'); - - var series = this.series; - var data; - var legend = this.component.legend; - if (dataIndex == -1) { - // 落到calculableCase上,数据被拖拽进某个饼图|雷达|漏斗,增加数据 - data = { - value : ecData.get(dragged, 'value'), - name : ecData.get(dragged, 'name') - }; - - // 修饼图数值不为负值 - if (this.type == ecConfig.CHART_TYPE_PIE && data.value < 0) { - data.value = 0; - } - - var hasFind = false; - var sData = series[seriesIndex].data; - for (var i = 0, l = sData.length; i < l; i++) { - if (sData[i].name == data.name && sData[i].value == '-') { - series[seriesIndex].data[i].value = data.value; - hasFind = true; - } - } - !hasFind && series[seriesIndex].data.push(data); - - legend && legend.add( - data.name, - dragged.style.color || dragged.style.strokeColor - ); - } - else { - // 落到数据item上,数据被拖拽到某个数据项上,数据修改 - data = this.option.series[seriesIndex].data[dataIndex] || '-'; - if (typeof data.value != 'undefined') { - if (data.value != '-') { - this.option.series[seriesIndex].data[dataIndex].value = - accMath.accAdd( - this.option.series[seriesIndex].data[dataIndex].value, - ecData.get(dragged, 'value') - ); - } - else { - this.option.series[seriesIndex].data[dataIndex].value = - ecData.get(dragged, 'value'); - } - - if (this.type == ecConfig.CHART_TYPE_FUNNEL - || this.type == ecConfig.CHART_TYPE_PIE - ) { - legend && legend.getRelatedAmount(data.name) == 1 - && this.component.legend.del(data.name); - data.name += this.option.nameConnector + ecData.get(dragged, 'name'); - legend && legend.add( - data.name, - dragged.style.color || dragged.style.strokeColor - ); - } - } - else { - if (data != '-') { - this.option.series[seriesIndex].data[dataIndex] = - accMath.accAdd( - this.option.series[seriesIndex].data[dataIndex], - ecData.get(dragged, 'value') - ); - } - else { - this.option.series[seriesIndex].data[dataIndex] = - ecData.get(dragged, 'value'); - } - } - } - - // 别status = {}赋值啊!! - status.dragIn = status.dragIn || true; - - // 处理完拖拽事件后复位 - this.isDrop = false; - - var self = this; - setTimeout(function(){ - self.zr.trigger('mousemove', param.event); - }, 300); - - return; - }, - - /** - * 数据项被拖拽出去 - */ - ondragend : function (param, status) { - if (!this.isDragend || !param.target) { - // 没有在当前实例上发生拖拽行为则直接返回 - return; - } - var target = param.target; // 被拖拽图形元素 - - var seriesIndex = ecData.get(target, 'seriesIndex'); - var dataIndex = ecData.get(target, 'dataIndex'); - - var series = this.series; - - // 删除被拖拽走的数据 - if (typeof series[seriesIndex].data[dataIndex].value != 'undefined') { - series[seriesIndex].data[dataIndex].value = '-'; - // 清理可能有且唯一的legend data - var name = series[seriesIndex].data[dataIndex].name; - if (this.component.legend - && this.component.legend.getRelatedAmount(name) === 0 - ) { - this.component.legend.del(name); - } - } - else { - series[seriesIndex].data[dataIndex] = '-'; - } - - // 别status = {}赋值啊!! - status.dragOut = true; - status.needRefresh = true; - - // 处理完拖拽事件后复位 - this.isDragend = false; - - return; - }, - - /** - * 图例选择 - */ - onlegendSelected : function (param, status) { - var legendSelected = param.selected; - for (var itemName in this.selectedMap) { - if (this.selectedMap[itemName] != legendSelected[itemName]) { - // 有一项不一致都需要重绘 - status.needRefresh = true; - } - this.selectedMap[itemName] = legendSelected[itemName]; - } - return; - }, - - /** - * 添加文本 - */ - addLabel : function (tarShape, serie, data, name, orient) { - // 多级控制 - var queryTarget = [data, serie]; - var nLabel = this.deepMerge(queryTarget, 'itemStyle.normal.label'); - var eLabel = this.deepMerge(queryTarget, 'itemStyle.emphasis.label'); - - var nTextStyle = nLabel.textStyle || {}; - var eTextStyle = eLabel.textStyle || {}; - - if (nLabel.show) { - tarShape.style.text = this._getLabelText( - serie, data, name, 'normal' - ); - tarShape.style.textPosition = typeof nLabel.position == 'undefined' - ? (orient == 'horizontal' ? 'right' : 'top') - : nLabel.position; - tarShape.style.textColor = nTextStyle.color; - tarShape.style.textFont = this.getFont(nTextStyle); - } - if (eLabel.show) { - tarShape.highlightStyle.text = this._getLabelText( - serie, data, name, 'emphasis' - ); - tarShape.highlightStyle.textPosition = nLabel.show - ? tarShape.style.textPosition - : (typeof eLabel.position == 'undefined' - ? (orient == 'horizontal' ? 'right' : 'top') - : eLabel.position); - tarShape.highlightStyle.textColor = eTextStyle.color; - tarShape.highlightStyle.textFont = this.getFont(eTextStyle); - } - - return tarShape; - }, - - /** - * 根据lable.format计算label text - */ - _getLabelText : function (serie, data, name, status) { - var formatter = this.deepQuery( - [data, serie], - 'itemStyle.' + status + '.label.formatter' - ); - if (!formatter && status == 'emphasis') { - // emphasis时需要看看normal下是否有formatter - formatter = this.deepQuery( - [data, serie], - 'itemStyle.normal.label.formatter' - ); - } - - var value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; - - if (formatter) { - if (typeof formatter == 'function') { - return formatter.call( - this.myChart, - serie.name, - name, - value - ); - } - else if (typeof formatter == 'string') { - formatter = formatter.replace('{a}','{a0}') - .replace('{b}','{b0}') - .replace('{c}','{c0}'); - formatter = formatter.replace('{a0}', serie.name) - .replace('{b0}', name) - .replace('{c0}', value); - - return formatter; - } - } - else { - return value; - } - }, - - /** - * 标线标注 - */ - buildMark : function (seriesIndex) { - var serie = this.series[seriesIndex]; - if (this.selectedMap[serie.name]) { - serie.markPoint && this._buildMarkPoint(seriesIndex); - serie.markLine && this._buildMarkLine(seriesIndex); - } - }, - - /** - * 标注逻辑 - */ - _buildMarkPoint : function (seriesIndex) { - var attachStyle = (this.markAttachStyle || {})[seriesIndex]; - var serie = this.series[seriesIndex]; - var _zlevelBase = this.getZlevelBase(); - var mpData; - var pos; - var markPoint = zrUtil.clone(serie.markPoint); - for (var i = 0, l = markPoint.data.length; i < l; i++) { - mpData = markPoint.data[i]; - pos = this.getMarkCoord(seriesIndex, mpData); - markPoint.data[i].x = typeof mpData.x != 'undefined' - ? mpData.x : pos[0]; - markPoint.data[i].y = typeof mpData.y != 'undefined' - ? mpData.y : pos[1]; - if (mpData.type - && (mpData.type == 'max' || mpData.type == 'min') - ) { - // 特殊值内置支持 - markPoint.data[i].value = pos[3]; - markPoint.data[i].name = mpData.name || mpData.type; - markPoint.data[i].symbolSize = markPoint.data[i].symbolSize - || (zrArea.getTextWidth(pos[3], this.getFont()) / 2 + 5); - } - } - - var shapeList = this._markPoint(seriesIndex, markPoint); - - for (var i = 0, l = shapeList.length; i < l; i++) { - shapeList[i].zlevel = _zlevelBase + 1; - for (var key in attachStyle) { - shapeList[i][key] = zrUtil.clone(attachStyle[key]); - } - this.shapeList.push(shapeList[i]); - } - // 个别特殊图表需要自己addShape - if (this.type == ecConfig.CHART_TYPE_FORCE - || this.type == ecConfig.CHART_TYPE_CHORD - ) { - for (var i = 0, l = shapeList.length; i < l; i++) { - this.zr.addShape(shapeList[i]); - } - } - }, - - /** - * 标线逻辑 - */ - _buildMarkLine : function (seriesIndex) { - var attachStyle = (this.markAttachStyle || {})[seriesIndex]; - var serie = this.series[seriesIndex]; - var _zlevelBase = this.getZlevelBase(); - var mlData; - var pos; - var markLine = zrUtil.clone(serie.markLine); - for (var i = 0, l = markLine.data.length; i < l; i++) { - mlData = markLine.data[i]; - if (mlData.type - && (mlData.type == 'max' || mlData.type == 'min' || mlData.type == 'average') - ) { - // 特殊值内置支持 - pos = this.getMarkCoord(seriesIndex, mlData); - markLine.data[i] = [zrUtil.clone(mlData), {}]; - markLine.data[i][0].name = mlData.name || mlData.type; - markLine.data[i][0].value = pos[3]; - pos = pos[2]; - mlData = [{},{}]; - } - else { - pos = [ - this.getMarkCoord(seriesIndex, mlData[0]), - this.getMarkCoord(seriesIndex, mlData[1]) - ]; - } - - markLine.data[i][0].x = typeof mlData[0].x != 'undefined' - ? mlData[0].x : pos[0][0]; - markLine.data[i][0].y = typeof mlData[0].y != 'undefined' - ? mlData[0].y : pos[0][1]; - markLine.data[i][1].x = typeof mlData[1].x != 'undefined' - ? mlData[1].x : pos[1][0]; - markLine.data[i][1].y = typeof mlData[1].y != 'undefined' - ? mlData[1].y : pos[1][1]; - } - - var shapeList = this._markLine(seriesIndex, markLine); - - for (var i = 0, l = shapeList.length; i < l; i++) { - shapeList[i].zlevel = _zlevelBase + 1; - for (var key in attachStyle) { - shapeList[i][key] = zrUtil.clone(attachStyle[key]); - } - this.shapeList.push(shapeList[i]); - } - // 个别特殊图表需要自己addShape - if (this.type == ecConfig.CHART_TYPE_FORCE - || this.type == ecConfig.CHART_TYPE_CHORD - ) { - for (var i = 0, l = shapeList.length; i < l; i++) { - this.zr.addShape(shapeList[i]); - } - } - }, - - /** - * 标注多级控制构造 - */ - _markPoint : function (seriesIndex, mpOption) { - var serie = this.series[seriesIndex]; - var component = this.component; - zrUtil.merge( - mpOption, - this.ecTheme.markPoint - ); - mpOption.name = serie.name; - - var pList = []; - var data = mpOption.data; - var itemShape; - - var dataRange = component.dataRange; - var legend = component.legend; - var color; - var value; - var queryTarget; - var nColor; - var eColor; - var effect; - var zrWidth = this.zr.getWidth(); - var zrHeight = this.zr.getHeight(); - - if (!mpOption.large) { - for (var i = 0, l = data.length; i < l; i++) { - value = typeof data[i] != 'undefined' && typeof data[i].value != 'undefined' - ? data[i].value - : ''; - // 图例 - if (legend) { - color = legend.getColor(serie.name); - } - // 值域 - if (dataRange) { - color = isNaN(value) ? color : dataRange.getColor(value); - - queryTarget = [data[i], mpOption]; - nColor = this.deepQuery( - queryTarget, 'itemStyle.normal.color' - ) || color; - eColor = this.deepQuery( - queryTarget, 'itemStyle.emphasis.color' - ) || nColor; - // 有值域,并且值域返回null且用户没有自己定义颜色,则隐藏这个mark - if (nColor == null && eColor == null) { - continue; - } - } - - // 标准化一些参数 - data[i].tooltip = data[i].tooltip - || {trigger:'item'}; // tooltip.trigger指定为item - data[i].name = typeof data[i].name != 'undefined' - ? data[i].name : ''; - data[i].value = value; - - // 复用getSymbolShape - itemShape = this.getSymbolShape( - mpOption, seriesIndex, // 系列 - data[i], i, data[i].name, // 数据 - this.parsePercent(data[i].x, zrWidth), // 坐标 - this.parsePercent(data[i].y, zrHeight), // 坐标 - 'pin', color, // 默认symbol和color - 'rgba(0,0,0,0)', - 'horizontal' // 走向,用于默认文字定位 - ); - itemShape._mark = 'point'; - - effect = this.deepMerge( - [data[i], mpOption], - 'effect' - ); - if (effect.show) { - itemShape.effect = effect; - } - - if (serie.type == ecConfig.CHART_TYPE_MAP) { - itemShape._geo = this.getMarkGeo(data[i]); - } - - // 重新pack一下数据 - ecData.pack( - itemShape, - serie, seriesIndex, - data[i], i, - data[i].name, - value - ); - pList.push(itemShape); - } - } - else { - // 大规模MarkPoint - itemShape = this.getLargeMarkPoingShape(seriesIndex, mpOption); - itemShape._mark = 'largePoint'; - itemShape && pList.push(itemShape); - } - return pList; - }, - - /** - * 标线多级控制构造 - */ - _markLine : function (seriesIndex, mlOption) { - var serie = this.series[seriesIndex]; - var component = this.component; - zrUtil.merge( - mlOption, - this.ecTheme.markLine - ); - // 标准化一些同时支持Array和String的参数 - mlOption.symbol = mlOption.symbol instanceof Array - ? mlOption.symbol.length > 1 - ? mlOption.symbol - : [mlOption.symbol[0], mlOption.symbol[0]] - : [mlOption.symbol, mlOption.symbol]; - mlOption.symbolSize = mlOption.symbolSize instanceof Array - ? mlOption.symbolSize.length > 1 - ? mlOption.symbolSize - : [mlOption.symbolSize[0], mlOption.symbolSize[0]] - : [mlOption.symbolSize, mlOption.symbolSize]; - mlOption.symbolRotate = mlOption.symbolRotate instanceof Array - ? mlOption.symbolRotate.length > 1 - ? mlOption.symbolRotate - : [mlOption.symbolRotate[0], mlOption.symbolRotate[0]] - : [mlOption.symbolRotate, mlOption.symbolRotate]; - - mlOption.name = serie.name; - - var pList = []; - var data = mlOption.data; - var itemShape; - - var dataRange = component.dataRange; - var legend = component.legend; - var color; - var value; - var queryTarget; - var nColor; - var eColor; - var effect; - var zrWidth = this.zr.getWidth(); - var zrHeight = this.zr.getHeight(); - var mergeData; - for (var i = 0, l = data.length; i < l; i++) { - // 图例 - if (legend) { - color = legend.getColor(serie.name); - } - // 组装一个mergeData - mergeData = this.deepMerge(data[i]); - value = typeof mergeData != 'undefined' && typeof mergeData.value != 'undefined' - ? mergeData.value - : ''; - // 值域 - if (dataRange) { - color = isNaN(value) ? color : dataRange.getColor(value); - - queryTarget = [mergeData, mlOption]; - nColor = this.deepQuery( - queryTarget, 'itemStyle.normal.color' - ) || color; - eColor = this.deepQuery( - queryTarget, 'itemStyle.emphasis.color' - ) || nColor; - // 有值域,并且值域返回null且用户没有自己定义颜色,则隐藏这个mark - if (nColor == null && eColor == null) { - continue; - } - } - - // 标准化一些参数 - data[i][0].tooltip = mergeData.tooltip - || {trigger:'item'}; // tooltip.trigger指定为item - data[i][0].name = typeof data[i][0].name != 'undefined' - ? data[i][0].name : ''; - data[i][1].name = typeof data[i][1].name != 'undefined' - ? data[i][1].name : ''; - data[i][0].value = typeof data[i][0].value != 'undefined' - ? data[i][0].value : ''; - - itemShape = this.getLineMarkShape( - mlOption, // markLine - seriesIndex, - data[i], // 数据 - i, - this.parsePercent(data[i][0].x, zrWidth), // 坐标 - this.parsePercent(data[i][0].y, zrHeight), // 坐标 - this.parsePercent(data[i][1].x, zrWidth), // 坐标 - this.parsePercent(data[i][1].y, zrHeight), // 坐标 - color // 默认symbol和color - ); - itemShape._mark = 'line'; - - effect = this.deepMerge( - [mergeData, mlOption], - 'effect' - ); - if (effect.show) { - itemShape.effect = effect; - } - - if (serie.type == ecConfig.CHART_TYPE_MAP) { - itemShape._geo = [ - this.getMarkGeo(data[i][0]), - this.getMarkGeo(data[i][1]) - ]; - } - - // 重新pack一下数据 - ecData.pack( - itemShape, - serie, seriesIndex, - data[i][0], i, - data[i][0].name + (data[i][1].name !== '' - ? (' > ' + data[i][1].name) - : ''), - value - ); - pList.push(itemShape); - } - //console.log(pList); - return pList; - }, - - getMarkCoord : function () { - // 无转换位置 - return [0, 0]; - }, - - /** - * symbol构造器 - */ - getSymbolShape : function ( - serie, seriesIndex, // 系列 - data, dataIndex, name, // 数据 - x, y, // 坐标 - symbol, color, // 默认symbol和color,来自legend或dataRange全局分配 - emptyColor, // 折线的emptySymbol用白色填充 - orient // 走向,用于默认文字定位 - ) { - var queryTarget = [data, serie]; - var value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; - - symbol = this.deepQuery(queryTarget, 'symbol') || symbol; - var symbolSize = this.deepQuery(queryTarget, 'symbolSize'); - symbolSize = typeof symbolSize == 'function' - ? symbolSize(value) - : symbolSize; - var symbolRotate = this.deepQuery(queryTarget, 'symbolRotate'); - - var normal = this.deepMerge( - queryTarget, - 'itemStyle.normal' - ); - var emphasis = this.deepMerge( - queryTarget, - 'itemStyle.emphasis' - ); - var nBorderWidth = typeof normal.borderWidth != 'undefined' - ? normal.borderWidth - : (normal.lineStyle && normal.lineStyle.width); - if (typeof nBorderWidth == 'undefined') { - nBorderWidth = symbol.match('empty') ? 2 : 0; - } - var eBorderWidth = typeof emphasis.borderWidth != 'undefined' - ? emphasis.borderWidth - : (emphasis.lineStyle && emphasis.lineStyle.width); - if (typeof eBorderWidth == 'undefined') { - eBorderWidth = nBorderWidth + 2; - } - - var itemShape = new IconShape({ - style : { - iconType : symbol.replace('empty', '').toLowerCase(), - x : x - symbolSize, - y : y - symbolSize, - width : symbolSize * 2, - height : symbolSize * 2, - brushType : 'both', - color : symbol.match('empty') - ? emptyColor - : (this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) - || color), - strokeColor : normal.borderColor - || this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) - || color, - lineWidth: nBorderWidth - }, - highlightStyle : { - color : symbol.match('empty') - ? emptyColor - : this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data), - strokeColor : emphasis.borderColor - || normal.borderColor - || this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) - || color, - lineWidth: eBorderWidth - }, - clickable : true - }); - - if (symbol.match('image')) { - itemShape.style.image = - symbol.replace(new RegExp('^image:\\/\\/'), ''); - itemShape = new ImageShape({ - style : itemShape.style, - highlightStyle : itemShape.highlightStyle, - clickable : true - }); - } - - if (typeof symbolRotate != 'undefined') { - itemShape.rotation = [ - symbolRotate * Math.PI / 180, x, y - ]; - } - - if (symbol.match('star')) { - itemShape.style.iconType = 'star'; - itemShape.style.n = - (symbol.replace('empty', '').replace('star','') - 0) || 5; - } - - if (symbol == 'none') { - itemShape.invisible = true; - itemShape.hoverable = false; - } - - /* - if (this.deepQuery([data, serie, option], 'calculable')) { - this.setCalculable(itemShape); - itemShape.draggable = true; - } - */ - - itemShape = this.addLabel( - itemShape, - serie, data, name, - orient - ); - - if (symbol.match('empty')) { - if (typeof itemShape.style.textColor == 'undefined') { - itemShape.style.textColor = itemShape.style.strokeColor; - } - if (typeof itemShape.highlightStyle.textColor == 'undefined') { - itemShape.highlightStyle.textColor = - itemShape.highlightStyle.strokeColor; - } - } - - ecData.pack( - itemShape, - serie, seriesIndex, - data, dataIndex, - name - ); - - itemShape._x = x; - itemShape._y = y; - - itemShape._dataIndex = dataIndex; - itemShape._seriesIndex = seriesIndex; - - return itemShape; - }, - - /** - * 标线构造器 - */ - getLineMarkShape : function ( - mlOption, // 系列 - seriesIndex, // 系列索引 - data, // 数据 - dataIndex, // 数据索引 - xStart, yStart, // 坐标 - xEnd, yEnd, // 坐标 - color // 默认color,来自legend或dataRange全局分配 - ) { - var value0 = typeof data[0] != 'undefined' - ? (typeof data[0].value != 'undefined' - ? data[0].value - : data[0]) - : '-'; - var value1 = typeof data[1] != 'undefined' - ? (typeof data[1].value != 'undefined' - ? data[1].value - : data[1]) - : '-'; - var symbol = [ - this.query(data[0], 'symbol') || mlOption.symbol[0], - this.query(data[1], 'symbol') || mlOption.symbol[1] - ]; - var symbolSize = [ - this.query(data[0], 'symbolSize') || mlOption.symbolSize[0], - this.query(data[1], 'symbolSize') || mlOption.symbolSize[1] - ]; - symbolSize[0] = typeof symbolSize[0] == 'function' - ? symbolSize[0](value0) - : symbolSize[0]; - symbolSize[1] = typeof symbolSize[1] == 'function' - ? symbolSize[1](value1) - : symbolSize[1]; - var symbolRotate = [ - this.query(data[0], 'symbolRotate') || mlOption.symbolRotate[0], - this.query(data[1], 'symbolRotate') || mlOption.symbolRotate[1] - ]; - //console.log(symbol, symbolSize, symbolRotate); - - var queryTarget = [data[0], mlOption]; - var normal = this.deepMerge( - queryTarget, - 'itemStyle.normal' - ); - normal.color = this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data); - var emphasis = this.deepMerge( - queryTarget, - 'itemStyle.emphasis' - ); - emphasis.color = this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data); - - var nlineStyle = normal.lineStyle; - var elineStyle = emphasis.lineStyle; - - var nBorderWidth = nlineStyle.width; - if (typeof nBorderWidth == 'undefined') { - nBorderWidth = normal.borderWidth; - } - var eBorderWidth = elineStyle.width; - if (typeof eBorderWidth == 'undefined') { - if (typeof emphasis.borderWidth != 'undefined') { - eBorderWidth = emphasis.borderWidth; - } - else { - eBorderWidth = nBorderWidth + 2; - } - } - - var itemShape = new MarkLineShape({ - style : { - smooth : mlOption.smooth ? 'spline' : false, - symbol : symbol, - symbolSize : symbolSize, - symbolRotate : symbolRotate, - //data : [data[0].name,data[1].name], - xStart : xStart, - yStart : yStart, // 坐标 - xEnd : xEnd, - yEnd : yEnd, // 坐标 - brushType : 'both', - lineType : nlineStyle.type, - shadowColor : nlineStyle.shadowColor - || nlineStyle.color - || normal.borderColor - || normal.color - || color, - shadowBlur: nlineStyle.shadowBlur, - shadowOffsetX: nlineStyle.shadowOffsetX, - shadowOffsetY: nlineStyle.shadowOffsetY, - color : normal.color || color, - strokeColor : nlineStyle.color - || normal.borderColor - || normal.color - || color, - lineWidth: nBorderWidth, - symbolBorderColor: normal.borderColor - || normal.color - || color, - symbolBorder: normal.borderWidth - }, - highlightStyle : { - shadowColor : elineStyle.shadowColor, - shadowBlur: elineStyle.shadowBlur, - shadowOffsetX: elineStyle.shadowOffsetX, - shadowOffsetY: elineStyle.shadowOffsetY, - color : emphasis.color|| normal.color || color, - strokeColor : elineStyle.color - || nlineStyle.color - || emphasis.borderColor - || normal.borderColor - || emphasis.color - || normal.color - || color, - lineWidth: eBorderWidth, - symbolBorderColor: emphasis.borderColor - || normal.borderColor - || emphasis.color - || normal.color - || color, - symbolBorder: typeof emphasis.borderWidth == 'undefined' - ? (normal.borderWidth + 2) - : (emphasis.borderWidth) - }, - clickable : true - }); - - itemShape = this.addLabel( - itemShape, - mlOption, - data[0], - data[0].name + ' : ' + data[1].name - ); - - itemShape._x = xEnd; - itemShape._y = yEnd; - - return itemShape; - }, - - /** - * 大规模标注构造器 - */ - getLargeMarkPoingShape : function(seriesIndex, mpOption) { - var serie = this.series[seriesIndex]; - var component = this.component; - var data = mpOption.data; - var itemShape; - - var dataRange = component.dataRange; - var legend = component.legend; - var color; - var value; - var queryTarget = [data[0], mpOption]; - var nColor; - var eColor; - var effect; - - // 图例 - if (legend) { - color = legend.getColor(serie.name); - } - // 值域 - if (dataRange) { - value = typeof data[0] != 'undefined' - ? (typeof data[0].value != 'undefined' - ? data[0].value - : data[0]) - : '-'; - color = isNaN(value) ? color : dataRange.getColor(value); - - nColor = this.deepQuery( - queryTarget, 'itemStyle.normal.color' - ) || color; - eColor = this.deepQuery( - queryTarget, 'itemStyle.emphasis.color' - ) || nColor; - // 有值域,并且值域返回null且用户没有自己定义颜色,则隐藏这个mark - if (nColor == null && eColor == null) { - return; - } - } - color = this.deepMerge(queryTarget, 'itemStyle.normal').color - || color; - - var symbol = this.deepQuery(queryTarget, 'symbol') || 'circle'; - symbol = symbol.replace('empty', '').replace(/\d/g, ''); - - effect = this.deepMerge( - [data[0], mpOption], - 'effect' - ); - - var devicePixelRatio = window.devicePixelRatio || 1; - - //console.log(data) - itemShape = new SymbolShape({ - style : { - pointList : data, - color : color, - strokeColor: color, - shadowColor : effect.shadowColor || color, - shadowBlur : (typeof effect.shadowBlur != 'undefined' ? effect.shadowBlur : 8) - * devicePixelRatio, - size : this.deepQuery(queryTarget, 'symbolSize'), - iconType : symbol, - brushType: 'fill', - lineWidth:1 - }, - draggable : false, - hoverable : false - }); - - if (effect.show) { - itemShape.effect = effect; - } - - return itemShape; - }, - - backupShapeList : function () { - if (this.shapeList && this.shapeList.length > 0) { - this.lastShapeList = this.shapeList; - this.shapeList = []; - } - else { - this.lastShapeList = []; - } - }, - - addShapeList : function () { - var maxLenth = this.option.animationThreshold / (this.canvasSupported ? 2 : 4); - var lastShapeList = this.lastShapeList; - var shapeList = this.shapeList; - var duration = lastShapeList.length > 0 - ? 500 : this.query(this.option, 'animationDuration'); - var easing = this.query(this.option, 'animationEasing'); - var key; - var oldMap = {}; - var newMap = {}; - if (this.option.animation - && !this.option.renderAsImage - && shapeList.length < maxLenth - && !this.motionlessOnce - ) { - // 通过已有的shape做动画过渡 - for (var i = 0, l = lastShapeList.length; i < l; i++) { - key = this._getAnimationKey(lastShapeList[i]); - if (key.match('undefined')) { - this.zr.delShape(lastShapeList[i].id); // 非关键元素直接删除 - } - else { - key += lastShapeList[i].type; - oldMap[key] = lastShapeList[i]; - } - } - for (var i = 0, l = shapeList.length; i < l; i++) { - key = this._getAnimationKey(shapeList[i]); - if (key.match('undefined')) { - this.zr.addShape(shapeList[i]); // 非关键元素直接添加 - } - else { - key += shapeList[i].type; - newMap[key] = shapeList[i]; - } - } - - for (key in oldMap) { - if (!newMap[key]) { - // 新的没有 删除 - this.zr.delShape(oldMap[key].id); - } - } - for (key in newMap) { - if (oldMap[key]) { - // 新旧都有 动画过渡 - this.zr.delShape(oldMap[key].id); - this._animateMod(oldMap[key], newMap[key], duration, easing); - } - else { - // 新有旧没有 添加并动画过渡 - //this._animateAdd(newMap[key], duration, easing); - this._animateMod(false, newMap[key], duration, easing); - } - } - this.zr.refresh(); - this.animationEffect(); - } - else { - this.motionlessOnce = false; - // clear old - this.zr.delShape(lastShapeList); - // 直接添加 - for (var i = 0, l = shapeList.length; i < l; i++) { - this.zr.addShape(shapeList[i]); - } - } - }, - - _getAnimationKey : function(shape) { - if (this.type != ecConfig.CHART_TYPE_MAP) { - return ecData.get(shape, 'seriesIndex') + '_' - + ecData.get(shape, 'dataIndex') - + (shape._mark ? shape._mark : '') - + (this.type == ecConfig.CHART_TYPE_RADAR - ? ecData.get(shape, 'special') : ''); - } - else { - return ecData.get(shape, 'seriesIndex') + '_' - + ecData.get(shape, 'dataIndex') - + (shape._mark ? shape._mark : 'undefined'); - } - }, - - /** - * 动画过渡 - */ - _animateMod : function (oldShape, newShape, duration, easing) { - switch (newShape.type) { - case 'broken-line' : - case 'half-smooth-polygon' : - ecAnimation.pointList(this.zr, oldShape, newShape, duration, easing); - break; - case 'rectangle' : - ecAnimation.rectangle(this.zr, oldShape, newShape, duration, easing); - break; - case 'icon' : - ecAnimation.icon(this.zr, oldShape, newShape, duration, easing); - break; - case 'candle' : - if (duration > 500) { - ecAnimation.candle(this.zr, oldShape, newShape, duration, easing); - } - else { - this.zr.addShape(newShape); - } - break; - case 'ring' : - case 'sector' : - case 'circle' : - if (duration > 500) { - // 进入动画,加旋转 - ecAnimation.ring( - this.zr, - oldShape, - newShape, - duration + ((ecData.get(newShape, 'dataIndex') || 0) % 20 * 100), - easing - ); - } - else if (newShape.type == 'sector') { - ecAnimation.sector(this.zr, oldShape, newShape, duration, easing); - } - else { - this.zr.addShape(newShape); - } - break; - case 'text' : - ecAnimation.text(this.zr, oldShape, newShape, duration, easing); - break; - case 'polygon' : - if (duration > 500) { - ecAnimation.polygon(this.zr, oldShape, newShape, duration, easing); - } - else { - ecAnimation.pointList(this.zr, oldShape, newShape, duration, easing); - } - break; - case 'chord' : - ecAnimation.chord(this.zr, oldShape, newShape, duration, easing); - break; - case 'gauge-pointer' : - ecAnimation.gaugePointer(this.zr, oldShape, newShape, duration, easing); - break; - case 'mark-line' : - ecAnimation.markline(this.zr, oldShape, newShape, duration, easing); - break; - case 'line' : - ecAnimation.line(this.zr, oldShape, newShape, duration, easing); - break; - default : - this.zr.addShape(newShape); - break; - } - }, - - /** - * 标注动画 - * @param {number} duration 时长 - * @param {string=} easing 缓动效果 - * @param {Array=} addShapeList 指定特效对象,不知道默认使用this.shapeList - */ - animationMark : function (duration , easing, addShapeList) { - var shapeList = addShapeList || this.shapeList; - for (var i = 0, l = shapeList.length; i < l; i++) { - if (!shapeList[i]._mark) { - continue; - } - this._animateMod(false, shapeList[i], duration, easing); - } - this.animationEffect(addShapeList); - }, - - /** - * 特效动画 - * @param {Array=} addShapeList 指定特效对象,不知道默认使用this.shapeList - */ - animationEffect : function (addShapeList) { - !addShapeList && this.clearEffectShape(); - var shapeList = addShapeList || this.shapeList; - var zlevel = ecConfig.EFFECT_ZLEVEL; - if (this.canvasSupported) { - this.zr.modLayer( - zlevel, - { - motionBlur : true, - lastFrameAlpha : 0.95 - } - ); - } - var shape; - for (var i = 0, l = shapeList.length; i < l; i++) { - shape = shapeList[i]; - if (!(shape._mark && shape.effect && shape.effect.show && ecEffect[shape._mark]) - ) { - continue; - } - ecEffect[shape._mark](this.zr, this.effectList, shape, zlevel); - this.effectList[this.effectList.length - 1]._mark = shape._mark; - } - }, - - clearEffectShape : function (clearMotionBlur) { - if (this.zr && this.effectList && this.effectList.length > 0) { - clearMotionBlur && this.zr.modLayer( - ecConfig.EFFECT_ZLEVEL, - { motionBlur : false} - ); - this.zr.delShape(this.effectList); - } - this.effectList = []; - }, - - /** - * 动态标线标注添加 - * @param {number} seriesIndex 系列索引 - * @param {Object} markData 标线标注对象,支持多个 - * @param {string} markType 标线标注类型 - */ - addMark : function (seriesIndex, markData, markType) { - var serie = this.series[seriesIndex]; - if (this.selectedMap[serie.name]) { - var duration = 500; - var easing = this.query(this.option, 'animationEasing'); - // 备份,复用_buildMarkX - var oriMarkData = serie[markType].data; - var lastLength = this.shapeList.length; - - serie[markType].data = markData.data; - this['_build' + markType.replace('m', 'M')](seriesIndex); - for (var i = lastLength, l = this.shapeList.length; i < l; i++) { - this.zr.addShape(this.shapeList[i]); - } - this.zr.refresh(); - - if (this.option.animation && !this.option.renderAsImage) { - this.animationMark(duration, easing, this.shapeList.slice(lastLength)); - } - // 还原,复用_buildMarkX - serie[markType].data = oriMarkData; - } - }, - - /** - * 动态标线标注删除 - * @param {number} seriesIndex 系列索引 - * @param {string} markName 标线标注名称 - * @param {string} markType 标线标注类型 - */ - delMark : function (seriesIndex, markName, markType) { - markType = markType.replace('mark', '').replace('large', '').toLowerCase(); - var serie = this.series[seriesIndex]; - if (this.selectedMap[serie.name]) { - var needRefresh = false; - var shapeList = [this.shapeList, this.effectList]; - var len = 2; - while(len--) { - for (var i = 0, l = shapeList[len].length; i < l; i++) { - if (shapeList[len][i]._mark == markType - && ecData.get(shapeList[len][i], 'seriesIndex') == seriesIndex - && ecData.get(shapeList[len][i], 'name') == markName - ) { - this.zr.delShape(shapeList[len][i].id); - shapeList[len].splice(i, 1); - needRefresh = true; - break; - } - } - } - - needRefresh && this.zr.refresh(); - } - } - }; - - return Base; -}); - -/** - * echart图表库 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - */ -define('echarts/chart',[],function (/*require*/) { //chart - var self = {}; - - var _chartLibrary = {}; //echart图表库 - - /** - * 定义图形实现 - * @param {Object} name - * @param {Object} clazz 图形实现 - */ - self.define = function (name, clazz) { - _chartLibrary[name] = clazz; - return self; - }; - - /** - * 获取图形实现 - * @param {Object} name - */ - self.get = function (name) { - return _chartLibrary[name]; - }; - - return self; -}); -/** - * echarts组件:孤岛数据 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/chart/island',['require','../component/base','./base','zrender/shape/Circle','../config','../util/ecData','zrender/tool/util','zrender/tool/event','zrender/tool/color','../util/accMath','../chart'],function (require) { - var ComponentBase = require('../component/base'); - var ChartBase = require('./base'); - - // 图形依赖 - var CircleShape = require('zrender/shape/Circle'); - - var ecConfig = require('../config'); - var ecData = require('../util/ecData'); - var zrUtil = require('zrender/tool/util'); - var zrEvent = require('zrender/tool/event'); - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} option 图表选项 - */ - function Island(ecTheme, messageCenter, zr, option, myChart) { - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, {}, myChart); - // 图表基类 - ChartBase.call(this); - - this._nameConnector; - this._valueConnector; - this._zrHeight = this.zr.getHeight(); - this._zrWidth = this.zr.getWidth(); - - var self = this; - /** - * 滚轮改变孤岛数据值 - */ - self.shapeHandler.onmousewheel = function (param) { - var shape = param.target; - - var event = param.event; - var delta = zrEvent.getDelta(event); - delta = delta > 0 ? (-1) : 1; - shape.style.r -= delta; - shape.style.r = shape.style.r < 5 ? 5 : shape.style.r; - - var value = ecData.get(shape, 'value'); - var dvalue = value * self.option.island.calculateStep; - if (dvalue > 1) { - value = Math.round(value - dvalue * delta); - } - else { - value = (value - dvalue * delta).toFixed(2) - 0; - } - - var name = ecData.get(shape, 'name'); - shape.style.text = name + ':' + value; - - ecData.set(shape, 'value', value); - ecData.set(shape, 'name', name); - - self.zr.modShape(shape.id); - self.zr.refresh(); - zrEvent.stop(event); - }; - } - - Island.prototype = { - type : ecConfig.CHART_TYPE_ISLAND, - /** - * 孤岛合并 - * - * @param {string} tarShapeIndex 目标索引 - * @param {Object} srcShape 源目标,合入目标后删除 - */ - _combine : function (tarShape, srcShape) { - var zrColor = require('zrender/tool/color'); - var accMath = require('../util/accMath'); - var value = accMath.accAdd( - ecData.get(tarShape, 'value'), - ecData.get(srcShape, 'value') - ); - var name = ecData.get(tarShape, 'name') - + this._nameConnector - + ecData.get(srcShape, 'name'); - - tarShape.style.text = name + this._valueConnector + value; - - ecData.set(tarShape, 'value', value); - ecData.set(tarShape, 'name', name); - tarShape.style.r = this.option.island.r; - tarShape.style.color = zrColor.mix( - tarShape.style.color, - srcShape.style.color - ); - }, - - /** - * 刷新 - */ - refresh : function (newOption) { - if (newOption) { - newOption.island = this.reformOption(newOption.island); - this.option = newOption; - - this._nameConnector = this.option.nameConnector; - this._valueConnector = this.option.valueConnector; - } - }, - - getOption : function () { - return this.option; - }, - - resize : function () { - var newWidth = this.zr.getWidth(); - var newHieght = this.zr.getHeight(); - var xScale = newWidth / (this._zrWidth || newWidth); - var yScale = newHieght / (this._zrHeight || newHieght); - if (xScale == 1 && yScale == 1) { - return; - } - this._zrWidth = newWidth; - this._zrHeight = newHieght; - for (var i = 0, l = this.shapeList.length; i < l; i++) { - this.zr.modShape( - this.shapeList[i].id, - { - style: { - x: Math.round(this.shapeList[i].style.x * xScale), - y: Math.round(this.shapeList[i].style.y * yScale) - } - } - ); - } - }, - - add : function (shape) { - var name = ecData.get(shape, 'name'); - var value = ecData.get(shape, 'value'); - var seriesName = typeof ecData.get(shape, 'series') != 'undefined' - ? ecData.get(shape, 'series').name - : ''; - var font = this.getFont(this.option.island.textStyle); - var islandShape = { - zlevel : this._zlevelBase, - style : { - x : shape.style.x, - y : shape.style.y, - r : this.option.island.r, - color : shape.style.color || shape.style.strokeColor, - text : name + this._valueConnector + value, - textFont : font - }, - draggable : true, - hoverable : true, - onmousewheel : this.shapeHandler.onmousewheel, - _type : 'island' - }; - if (islandShape.style.color == '#fff') { - islandShape.style.color = shape.style.strokeColor; - } - this.setCalculable(islandShape); - islandShape.dragEnableTime = 0; - ecData.pack( - islandShape, - {name:seriesName}, -1, - value, -1, - name - ); - islandShape = new CircleShape(islandShape); - this.shapeList.push(islandShape); - this.zr.addShape(islandShape); - }, - - del : function (shape) { - this.zr.delShape(shape.id); - var newShapeList = []; - for (var i = 0, l = this.shapeList.length; i < l; i++) { - if (this.shapeList[i].id != shape.id) { - newShapeList.push(this.shapeList[i]); - } - } - this.shapeList = newShapeList; - }, - - /** - * 数据项被拖拽进来, 重载基类方法 - */ - ondrop : function (param, status) { - if (!this.isDrop || !param.target) { - // 没有在当前实例上发生拖拽行为则直接返回 - return; - } - // 拖拽产生孤岛数据合并 - var target = param.target; // 拖拽安放目标 - var dragged = param.dragged; // 当前被拖拽的图形对象 - - this._combine(target, dragged); - this.zr.modShape(target.id); - - status.dragIn = true; - - // 处理完拖拽事件后复位 - this.isDrop = false; - - return; - }, - - /** - * 数据项被拖拽出去, 重载基类方法 - */ - ondragend : function (param, status) { - var target = param.target; // 拖拽安放目标 - if (!this.isDragend) { - // 拖拽的不是孤岛数据,如果没有图表接受孤岛数据,需要新增孤岛数据 - if (!status.dragIn) { - target.style.x = zrEvent.getX(param.event); - target.style.y = zrEvent.getY(param.event); - this.add(target); - status.needRefresh = true; - } - } - else { - // 拖拽的是孤岛数据,如果有图表接受了孤岛数据,需要删除孤岛数据 - if (status.dragIn) { - this.del(target); - status.needRefresh = true; - } - } - - // 处理完拖拽事件后复位 - this.isDragend = false; - - return; - } - }; - - zrUtil.inherits(Island, ChartBase); - zrUtil.inherits(Island, ComponentBase); - - // 图表注册 - require('../chart').define('island', Island); - - return Island; -}); -/** - * echart组件库 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/component',[],function (/*require*/) { // component - var self = {}; - - var _componentLibrary = {}; // echart组件库 - - /** - * 定义图形实现 - * @param {Object} name - * @param {Object} clazz 图形实现 - */ - self.define = function (name, clazz) { - _componentLibrary[name] = clazz; - return self; - }; - - /** - * 获取图形实现 - * @param {Object} name - */ - self.get = function (name) { - return _componentLibrary[name]; - }; - - return self; -}); -/** - * echarts组件:提示框 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/component/dataView',['require','./base','../config','zrender/tool/util','../component'],function (require) { - var Base = require('./base'); - - var ecConfig = require('../config'); - var zrUtil = require('zrender/tool/util'); - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} option 提示框参数 - * @param {HtmlElement} dom 目标对象 - */ - function DataView(ecTheme, messageCenter, zr, option, myChart) { - Base.call(this, ecTheme, messageCenter, zr, option, myChart); - - this.dom = myChart.dom; - - // dataview dom & css - this._tDom = document.createElement('div'); - this._textArea = document.createElement('textArea'); - this._buttonRefresh = document.createElement('button'); - this._buttonClose = document.createElement('button'); - this._hasShow = false; - - // 缓存一些高宽数据 - this._zrHeight = zr.getHeight(); - this._zrWidth = zr.getWidth(); - - this._tDom.className = 'echarts-dataview', - this.hide(); - this.dom.firstChild.appendChild(this._tDom); - - if (window.addEventListener) { - this._tDom.addEventListener('click', this._stop); - this._tDom.addEventListener('mousewheel', this._stop); - this._tDom.addEventListener('mousemove', this._stop); - this._tDom.addEventListener('mousedown', this._stop); - this._tDom.addEventListener('mouseup', this._stop); - - // mobile支持 - this._tDom.addEventListener('touchstart', this._stop); - this._tDom.addEventListener('touchmove', this._stop); - this._tDom.addEventListener('touchend', this._stop); - } - else { - this._tDom.attachEvent('onclick', this._stop); - this._tDom.attachEvent('onmousewheel', this._stop); - this._tDom.attachEvent('onmousemove', this._stop); - this._tDom.attachEvent('onmousedown', this._stop); - this._tDom.attachEvent('onmouseup', this._stop); - } - } - - DataView.prototype = { - type : ecConfig.COMPONENT_TYPE_DATAVIEW, - _lang : ['Data View', 'close', 'refresh'], - // 通用样式 - _gCssText : 'position:absolute;' - + 'display:block;' - + 'overflow:hidden;' - + 'transition:height 0.8s,background-color 1s;' - + '-moz-transition:height 0.8s,background-color 1s;' - + '-webkit-transition:height 0.8s,background-color 1s;' - + '-o-transition:height 0.8s,background-color 1s;' - + 'z-index:1;' - + 'left:0;' - + 'top:0;', - hide : function () { - this._sizeCssText = 'width:' + this._zrWidth + 'px;' - + 'height:' + 0 + 'px;' - + 'background-color:#f0ffff;'; - this._tDom.style.cssText = this._gCssText + this._sizeCssText; - // 这是个很恶心的事情 - /* - this.dom.onselectstart = function () { - return false; - }; - */ - }, - - show : function (newOption) { - this._hasShow = true; - var lang = this.query(this.option, 'toolbox.feature.dataView.lang') - || this._lang; - - this.option = newOption; - - this._tDom.innerHTML = '

' - + (lang[0] || this._lang[0]) - + '

'; - - this._textArea.style.cssText = - 'display:block;margin:0 0 8px 0;padding:4px 6px;overflow:auto;' - + 'width:' + (this._zrWidth - 15) + 'px;' - + 'height:' + (this._zrHeight - 100) + 'px;'; - var customContent = this.query( - this.option, 'toolbox.feature.dataView.optionToContent' - ); - if (typeof customContent != 'function') { - this._textArea.value = this._optionToContent(); - } - else { - this._textArea.value = customContent(this.option); - } - this._tDom.appendChild(this._textArea); - - this._buttonClose.style.cssText = 'float:right;padding:1px 6px;'; - this._buttonClose.innerHTML = lang[1] || this._lang[1]; - var self = this; - this._buttonClose.onclick = function (){ - self.hide(); - }; - this._tDom.appendChild(this._buttonClose); - - if (this.query(this.option, 'toolbox.feature.dataView.readOnly') - === false - ) { - this._buttonRefresh.style.cssText = - 'float:right;margin-right:10px;padding:1px 6px;'; - this._buttonRefresh.innerHTML = lang[2] || this._lang[2]; - this._buttonRefresh.onclick = function (){ - self._save(); - }; - this._tDom.appendChild(this._buttonRefresh); - this._textArea.readOnly = false; - this._textArea.style.cursor = 'default'; - } - else { - this._textArea.readOnly = true; - this._textArea.style.cursor = 'text'; - } - - this._sizeCssText = 'width:' + this._zrWidth + 'px;' - + 'height:' + this._zrHeight + 'px;' - + 'background-color:#fff;'; - this._tDom.style.cssText = this._gCssText + this._sizeCssText; - // 这是个很恶心的事情 - /* - this.dom.onselectstart = function () { - return true; - }; - */ - }, - - _optionToContent : function () { - var i; - var j; - var k; - var len; - var data; - var valueList; - var axisList = []; - var content = ''; - if (this.option.xAxis) { - if (this.option.xAxis instanceof Array) { - axisList = this.option.xAxis; - } else { - axisList = [this.option.xAxis]; - } - for (i = 0, len = axisList.length; i < len; i++) { - // 横纵默认为类目 - if ((axisList[i].type || 'category') == 'category') { - valueList = []; - for (j = 0, k = axisList[i].data.length; j < k; j++) { - data = axisList[i].data[j]; - valueList.push( - typeof data.value != 'undefined' - ? data.value : data - ); - } - content += valueList.join(', ') + '\n\n'; - } - } - } - - if (this.option.yAxis) { - if (this.option.yAxis instanceof Array) { - axisList = this.option.yAxis; - } else { - axisList = [this.option.yAxis]; - } - for (i = 0, len = axisList.length; i < len; i++) { - if (axisList[i].type == 'category') { - valueList = []; - for (j = 0, k = axisList[i].data.length; j < k; j++) { - data = axisList[i].data[j]; - valueList.push( - typeof data.value != 'undefined' - ? data.value : data - ); - } - content += valueList.join(', ') + '\n\n'; - } - } - } - - var series = this.option.series; - var itemName; - for (i = 0, len = series.length; i < len; i++) { - valueList = []; - for (j = 0, k = series[i].data.length; j < k; j++) { - data = series[i].data[j]; - if (series[i].type == ecConfig.CHART_TYPE_PIE - || series[i].type == ecConfig.CHART_TYPE_MAP - ) { - itemName = (data.name || '-') + ':'; - } - else { - itemName = ''; - } - - if (series[i].type == ecConfig.CHART_TYPE_SCATTER) { - data = typeof data.value != 'undefined' - ? data.value - : data; - data = data.join(', '); - } - valueList.push( - itemName - + (typeof data.value != 'undefined' ? data.value : data) - ); - } - content += (series[i].name || '-') + ' : \n'; - content += valueList.join( - series[i].type == ecConfig.CHART_TYPE_SCATTER ? '\n': ', ' - ); - content += '\n\n'; - } - - return content; - }, - - _save : function () { - var text = this._textArea.value; - var customContent = this.query( - this.option, 'toolbox.feature.dataView.contentToOption' - ); - if (typeof customContent != 'function') { - text = text.split('\n'); - var content = []; - for (var i = 0, l = text.length; i < l; i++) { - text[i] = this._trim(text[i]); - if (text[i] !== '') { - content.push(text[i]); - } - } - this._contentToOption(content); - } - else { - customContent(text, this.option); - } - - this.hide(); - - var self = this; - setTimeout( - function (){ - self.messageCenter && self.messageCenter.dispatch( - ecConfig.EVENT.DATA_VIEW_CHANGED, - null, - {option : self.option}, - self.myChart - ); - }, - // 有动画,所以高级浏览器时间更长点 - self.canvasSupported ? 800 : 100 - ); - }, - - _contentToOption : function (content) { - var i; - var j; - var k; - var len; - var data; - var axisList = []; - - var contentIdx = 0; - var contentValueList; - var value; - - if (this.option.xAxis) { - if (this.option.xAxis instanceof Array) { - axisList = this.option.xAxis; - } else { - axisList = [this.option.xAxis]; - } - for (i = 0, len = axisList.length; i < len; i++) { - // 横纵默认为类目 - if ((axisList[i].type || 'category') == 'category' - ) { - contentValueList = content[contentIdx].split(','); - for (j = 0, k = axisList[i].data.length; j < k; j++) { - value = this._trim(contentValueList[j] || ''); - data = axisList[i].data[j]; - if (typeof axisList[i].data[j].value != 'undefined' - ) { - axisList[i].data[j].value = value; - } - else { - axisList[i].data[j] = value; - } - } - contentIdx++; - } - } - } - - if (this.option.yAxis) { - if (this.option.yAxis instanceof Array) { - axisList = this.option.yAxis; - } else { - axisList = [this.option.yAxis]; - } - for (i = 0, len = axisList.length; i < len; i++) { - if (axisList[i].type == 'category') { - contentValueList = content[contentIdx].split(','); - for (j = 0, k = axisList[i].data.length; j < k; j++) { - value = this._trim(contentValueList[j] || ''); - data = axisList[i].data[j]; - if (typeof axisList[i].data[j].value != 'undefined' - ) { - axisList[i].data[j].value = value; - } - else { - axisList[i].data[j] = value; - } - } - contentIdx++; - } - } - } - - var series = this.option.series; - for (i = 0, len = series.length; i < len; i++) { - contentIdx++; - if (series[i].type == ecConfig.CHART_TYPE_SCATTER) { - for (var j = 0, k = series[i].data.length; j < k; j++) { - contentValueList = content[contentIdx]; - value = contentValueList.replace(' ','').split(','); - if (typeof series[i].data[j].value != 'undefined' - ) { - series[i].data[j].value = value; - } - else { - series[i].data[j] = value; - } - contentIdx++; - } - } - else { - contentValueList = content[contentIdx].split(','); - for (var j = 0, k = series[i].data.length; j < k; j++) { - value = (contentValueList[j] || '').replace(/.*:/,''); - value = this._trim(value); - value = (value != '-' && value !== '') - ? (value - 0) - : '-'; - if (typeof series[i].data[j].value != 'undefined' - ) { - series[i].data[j].value = value; - } - else { - series[i].data[j] = value; - } - } - contentIdx++; - } - } - }, - - _trim : function (str){ - var trimer = new RegExp( - '(^[\\s\\t\\xa0\\u3000]+)|([\\u3000\\xa0\\s\\t]+\x24)', 'g' - ); - return str.replace(trimer, ''); - }, - - // 阻塞zrender事件 - _stop : function (e){ - e = e || window.event; - if (e.stopPropagation) { - e.stopPropagation(); - } - else { - e.cancelBubble = true; - } - }, - - /** - * zrender事件响应:窗口大小改变 - */ - resize : function () { - this._zrHeight = this.zr.getHeight(); - this._zrWidth = this.zr.getWidth(); - if (this._tDom.offsetHeight > 10) { - this._sizeCssText = 'width:' + this._zrWidth + 'px;' - + 'height:' + this._zrHeight + 'px;' - + 'background-color:#fff;'; - this._tDom.style.cssText = this._gCssText + this._sizeCssText; - this._textArea.style.cssText = 'display:block;margin:0 0 8px 0;' - + 'padding:4px 6px;overflow:auto;' - + 'width:' + (this._zrWidth - 15) + 'px;' - + 'height:' + (this._zrHeight - 100) + 'px;'; - } - }, - - /** - * 释放后实例不可用,重载基类方法 - */ - dispose : function () { - if (window.removeEventListener) { - this._tDom.removeEventListener('click', this._stop); - this._tDom.removeEventListener('mousewheel', this._stop); - this._tDom.removeEventListener('mousemove', this._stop); - this._tDom.removeEventListener('mousedown', this._stop); - this._tDom.removeEventListener('mouseup', this._stop); - - // mobile支持 - this._tDom.removeEventListener('touchstart', this._stop); - this._tDom.removeEventListener('touchmove', this._stop); - this._tDom.removeEventListener('touchend', this._stop); - } - else { - this._tDom.detachEvent('onclick', this._stop); - this._tDom.detachEvent('onmousewheel', this._stop); - this._tDom.detachEvent('onmousemove', this._stop); - this._tDom.detachEvent('onmousedown', this._stop); - this._tDom.detachEvent('onmouseup', this._stop); - } - - this._buttonRefresh.onclick = null; - this._buttonClose.onclick = null; - - if (this._hasShow) { - this._tDom.removeChild(this._textArea); - this._tDom.removeChild(this._buttonRefresh); - this._tDom.removeChild(this._buttonClose); - } - - this._textArea = null; - this._buttonRefresh = null; - this._buttonClose = null; - - this.dom.firstChild.removeChild(this._tDom); - this._tDom = null; - } - }; - - zrUtil.inherits(DataView, Base); - - require('../component').define('dataView', DataView); - - return DataView; -}); -/** - * echarts组件:工具箱 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zrender/shape/Image','zrender/shape/Rectangle','../util/shape/Icon','../config','zrender/tool/util','zrender/config','zrender/tool/event','./dataView','../component'],function (require) { - var Base = require('./base'); - - // 图形依赖 - var LineShape = require('zrender/shape/Line'); - var ImageShape = require('zrender/shape/Image'); - var RectangleShape = require('zrender/shape/Rectangle'); - var IconShape = require('../util/shape/Icon'); - - var ecConfig = require('../config'); - var zrUtil = require('zrender/tool/util'); - var zrConfig = require('zrender/config'); - var zrEvent = require('zrender/tool/event'); - - var _MAGICTYPE_STACK = 'stack'; - var _MAGICTYPE_TILED = 'tiled'; - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {HtmlElement} dom 目标对象 - * @param {ECharts} myChart 当前图表实例 - */ - function Toolbox(ecTheme, messageCenter, zr, option, myChart) { - Base.call(this, ecTheme, messageCenter, zr, option, myChart); - - this.dom = myChart.dom; - - this._magicType = {}; - //this._magicMap; - this._isSilence = false; - - this._iconList; - this._iconShapeMap = {}; - //this._itemGroupLocation; - this._featureTitle = {}; // 文字 - this._featureIcon = {}; // 图标 - this._featureColor = {}; // 颜色 - this._enableColor = 'red'; - this._disableColor = '#ccc'; - // this._markStart; - // this._marking; - // this._markShape; - // this._zoomStart; - // this._zooming; - // this._zoomShape; - // this._zoomQueue; - // this._dataView; - this._markShapeList = []; - var self = this; - self._onMark = function (param) { - self.__onMark(param); - }; - self._onMarkUndo = function (param) { - self.__onMarkUndo(param); - }; - self._onMarkClear = function (param) { - self.__onMarkClear(param); - }; - self._onDataZoom = function (param) { - self.__onDataZoom(param); - }; - self._onDataZoomReset = function (param) { - self.__onDataZoomReset(param); - }; - self._onDataView = function (param) { - self.__onDataView(param); - }; - self._onRestore = function (param) { - self.__onRestore(param); - }; - self._onSaveAsImage = function (param) { - self.__onSaveAsImage(param); - }; - self._onMagicType = function (param) { - self.__onMagicType(param); - }; - self._onCustomHandler = function (param) { - self.__onCustomHandler(param); - }; - self._onmousemove = function (param) { - return self.__onmousemove(param); - }; - - self._onmousedown = function (param) { - return self.__onmousedown(param); - }; - - self._onmouseup = function (param) { - return self.__onmouseup(param); - }; - - self._onclick = function (param) { - return self.__onclick(param); - }; - } - - Toolbox.prototype = { - type : ecConfig.COMPONENT_TYPE_TOOLBOX, - _buildShape : function () { - this._iconList = []; - var toolboxOption = this.option.toolbox; - this._enableColor = toolboxOption.effectiveColor; - this._disableColor = toolboxOption.disableColor; - var feature = toolboxOption.feature; - var iconName = []; - for (var key in feature){ - if (feature[key].show) { - switch (key) { - case 'mark' : - iconName.push({key : key, name : 'mark'}); - iconName.push({key : key, name : 'markUndo'}); - iconName.push({key : key, name : 'markClear'}); - break; - case 'magicType' : - for (var i = 0, l = feature[key].type.length; i < l; i++) { - feature[key].title[feature[key].type[i] + 'Chart'] - = feature[key].title[feature[key].type[i]]; - iconName.push({key : key, name : feature[key].type[i] + 'Chart'}); - } - break; - case 'dataZoom' : - iconName.push({key : key, name : 'dataZoom'}); - iconName.push({key : key, name : 'dataZoomReset'}); - break; - case 'saveAsImage' : - if (this.canvasSupported) { - iconName.push({key : key, name : 'saveAsImage'}); - } - break; - default : - iconName.push({key : key, name : key}); - break; - } - } - } - if (iconName.length > 0) { - var name; - var key; - for (var i = 0, l = iconName.length; i < l; i++) { - name = iconName[i].name; - key = iconName[i].key; - this._iconList.push(name); - this._featureTitle[name] = feature[key].title[name] || feature[key].title; - if (feature[key].icon) { - this._featureIcon[name] = feature[key].icon[name] || feature[key].icon; - } - if (feature[key].color) { - this._featureColor[name] = feature[key].color[name] || feature[key].color; - } - } - this._itemGroupLocation = this._getItemGroupLocation(); - - this._buildBackground(); - this._buildItem(); - - for (var i = 0, l = this.shapeList.length; i < l; i++) { - this.zr.addShape(this.shapeList[i]); - } - if (this._iconShapeMap['mark']) { - this._iconDisable(this._iconShapeMap['markUndo']); - this._iconDisable(this._iconShapeMap['markClear']); - } - if (this._iconShapeMap['dataZoomReset'] && this._zoomQueue.length === 0) { - this._iconDisable(this._iconShapeMap['dataZoomReset']); - } - } - }, - - /** - * 构建所有图例元素 - */ - _buildItem : function () { - var toolboxOption = this.option.toolbox; - var iconLength = this._iconList.length; - var lastX = this._itemGroupLocation.x; - var lastY = this._itemGroupLocation.y; - var itemSize = toolboxOption.itemSize; - var itemGap = toolboxOption.itemGap; - var itemShape; - - var color = toolboxOption.color instanceof Array - ? toolboxOption.color : [toolboxOption.color]; - - var textFont = this.getFont(toolboxOption.textStyle); - var textPosition; - var textAlign; - var textBaseline; - if (toolboxOption.orient == 'horizontal') { - textPosition = this._itemGroupLocation.y / this.zr.getHeight() < 0.5 - ? 'bottom' : 'top'; - textAlign = this._itemGroupLocation.x / this.zr.getWidth() < 0.5 - ? 'left' : 'right'; - textBaseline = this._itemGroupLocation.y / this.zr.getHeight() < 0.5 - ? 'top' : 'bottom'; - } - else { - textPosition = this._itemGroupLocation.x / this.zr.getWidth() < 0.5 - ? 'right' : 'left'; - /* - textAlign = this._itemGroupLocation.x / this.zr.getWidth() < 0.5 - ? 'right' : 'left'; - textBaseline = 'top'; - */ - } - - this._iconShapeMap = {}; - var self = this; - - for (var i = 0; i < iconLength; i++) { - // 图形 - itemShape = { - type : 'icon', - zlevel : this._zlevelBase, - style : { - x : lastX, - y : lastY, - width : itemSize, - height : itemSize, - iconType : this._iconList[i], - lineWidth : 1, - strokeColor : this._featureColor[this._iconList[i]] - || color[i % color.length], - brushType: 'stroke' - }, - highlightStyle : { - lineWidth : 1, - text : toolboxOption.showTitle - ? this._featureTitle[this._iconList[i]] - : undefined, - textFont : textFont, - textPosition : textPosition, - strokeColor : this._featureColor[this._iconList[i]] - || color[i % color.length] - }, - hoverable : true, - clickable : true - }; - - if (this._featureIcon[this._iconList[i]]) { - itemShape.style.image = this._featureIcon[this._iconList[i]].replace( - new RegExp('^image:\\/\\/'), '' - ); - itemShape.style.opacity = 0.8; - itemShape.highlightStyle.opacity = 1; - itemShape.type = 'image'; - } - - if (toolboxOption.orient == 'horizontal') { - // 修正左对齐第一个或右对齐最后一个 - if (i === 0 && textAlign == 'left') { - itemShape.highlightStyle.textPosition = 'specific'; - itemShape.highlightStyle.textAlign = textAlign; - itemShape.highlightStyle.textBaseline = textBaseline; - itemShape.highlightStyle.textX = lastX; - itemShape.highlightStyle.textY = textBaseline == 'top' - ? lastY + itemSize + 10 - : lastY - 10; - } - if (i == iconLength - 1 && textAlign == 'right') { - itemShape.highlightStyle.textPosition = 'specific'; - itemShape.highlightStyle.textAlign = textAlign; - itemShape.highlightStyle.textBaseline = textBaseline; - itemShape.highlightStyle.textX = lastX + itemSize; - itemShape.highlightStyle.textY = textBaseline == 'top' - ? lastY + itemSize + 10 - : lastY - 10; - } - } - - switch(this._iconList[i]) { - case 'mark': - itemShape.onclick = self._onMark; - break; - case 'markUndo': - itemShape.onclick = self._onMarkUndo; - break; - case 'markClear': - itemShape.onclick = self._onMarkClear; - break; - case 'dataZoom': - itemShape.onclick = self._onDataZoom; - break; - case 'dataZoomReset': - itemShape.onclick = self._onDataZoomReset; - break; - case 'dataView' : - if (!this._dataView) { - var DataView = require('./dataView'); - this._dataView = new DataView( - this.ecTheme, this.messageCenter, this.zr, this.option, this.myChart - ); - } - itemShape.onclick = self._onDataView; - break; - case 'restore': - itemShape.onclick = self._onRestore; - break; - case 'saveAsImage': - itemShape.onclick = self._onSaveAsImage; - break; - default: - if (this._iconList[i].match('Chart')) { - itemShape._name = this._iconList[i].replace('Chart', ''); - /* - if (this._magicType[itemShape._name]) { - itemShape.style.strokeColor = this._enableColor; - } - */ - itemShape.onclick = self._onMagicType; - } - else { - itemShape.onclick = self._onCustomHandler; - } - break; - } - - if (itemShape.type == 'icon') { - itemShape = new IconShape(itemShape); - } - else if (itemShape.type == 'image') { - itemShape = new ImageShape(itemShape); - } - this.shapeList.push(itemShape); - this._iconShapeMap[this._iconList[i]] = itemShape; - - if (toolboxOption.orient == 'horizontal') { - lastX += itemSize + itemGap; - } - else { - lastY += itemSize + itemGap; - } - } - }, - - _buildBackground : function () { - var toolboxOption = this.option.toolbox; - var pTop = toolboxOption.padding[0]; - var pRight = toolboxOption.padding[1]; - var pBottom = toolboxOption.padding[2]; - var pLeft = toolboxOption.padding[3]; - - this.shapeList.push(new RectangleShape({ - zlevel : this._zlevelBase, - hoverable :false, - style : { - x : this._itemGroupLocation.x - pLeft, - y : this._itemGroupLocation.y - pTop, - width : this._itemGroupLocation.width + pLeft + pRight, - height : this._itemGroupLocation.height + pTop + pBottom, - brushType : toolboxOption.borderWidth === 0 - ? 'fill' : 'both', - color : toolboxOption.backgroundColor, - strokeColor : toolboxOption.borderColor, - lineWidth : toolboxOption.borderWidth - } - })); - }, - - /** - * 根据选项计算图例实体的位置坐标 - */ - _getItemGroupLocation : function () { - var toolboxOption = this.option.toolbox; - var iconLength = this._iconList.length; - var itemGap = toolboxOption.itemGap; - var itemSize = toolboxOption.itemSize; - var totalWidth = 0; - var totalHeight = 0; - - if (toolboxOption.orient == 'horizontal') { - // 水平布局,计算总宽度,别忘减去最后一个的itemGap - totalWidth = (itemSize + itemGap) * iconLength - itemGap; - totalHeight = itemSize; - } - else { - // 垂直布局,计算总高度 - totalHeight = (itemSize + itemGap) * iconLength - itemGap; - totalWidth = itemSize; - } - - var x; - var zrWidth = this.zr.getWidth(); - switch (toolboxOption.x) { - case 'center' : - x = Math.floor((zrWidth - totalWidth) / 2); - break; - case 'left' : - x = toolboxOption.padding[3] + toolboxOption.borderWidth; - break; - case 'right' : - x = zrWidth - - totalWidth - - toolboxOption.padding[1] - - toolboxOption.borderWidth; - break; - default : - x = toolboxOption.x - 0; - x = isNaN(x) ? 0 : x; - break; - } - - var y; - var zrHeight = this.zr.getHeight(); - switch (toolboxOption.y) { - case 'top' : - y = toolboxOption.padding[0] + toolboxOption.borderWidth; - break; - case 'bottom' : - y = zrHeight - - totalHeight - - toolboxOption.padding[2] - - toolboxOption.borderWidth; - break; - case 'center' : - y = Math.floor((zrHeight - totalHeight) / 2); - break; - default : - y = toolboxOption.y - 0; - y = isNaN(y) ? 0 : y; - break; - } - - return { - x : x, - y : y, - width : totalWidth, - height : totalHeight - }; - }, - - __onmousemove : function (param) { - if (this._marking) { - this._markShape.style.xEnd = zrEvent.getX(param.event); - this._markShape.style.yEnd = zrEvent.getY(param.event); - this.zr.addHoverShape(this._markShape); - } - if (this._zooming) { - this._zoomShape.style.width = - zrEvent.getX(param.event) - this._zoomShape.style.x; - this._zoomShape.style.height = - zrEvent.getY(param.event) - this._zoomShape.style.y; - this.zr.addHoverShape(this._zoomShape); - this.dom.style.cursor = 'crosshair'; - } - if (this._zoomStart - && (this.dom.style.cursor != 'pointer' && this.dom.style.cursor != 'move') - ) { - this.dom.style.cursor = 'crosshair'; - } - }, - - __onmousedown : function (param) { - if (param.target) { - return; - } - this._zooming = true; - var x = zrEvent.getX(param.event); - var y = zrEvent.getY(param.event); - var zoomOption = this.option.dataZoom || {}; - this._zoomShape = new RectangleShape({ - zlevel : this._zlevelBase, - style : { - x : x, - y : y, - width : 1, - height : 1, - brushType: 'both' - }, - highlightStyle : { - lineWidth : 2, - color: zoomOption.fillerColor - || ecConfig.dataZoom.fillerColor, - strokeColor : zoomOption.handleColor - || ecConfig.dataZoom.handleColor, - brushType: 'both' - } - }); - this.zr.addHoverShape(this._zoomShape); - return true; // 阻塞全局事件 - }, - - __onmouseup : function (/*param*/) { - if (!this._zoomShape - || Math.abs(this._zoomShape.style.width) < 10 - || Math.abs(this._zoomShape.style.height) < 10 - ) { - this._zooming = false; - return true; - } - if (this._zooming && this.component.dataZoom) { - this._zooming = false; - - var zoom = this.component.dataZoom.rectZoom(this._zoomShape.style); - if (zoom) { - this._zoomQueue.push({ - start : zoom.start, - end : zoom.end, - start2 : zoom.start2, - end2 : zoom.end2 - }); - this._iconEnable(this._iconShapeMap['dataZoomReset']); - this.zr.refresh(); - } - } - return true; // 阻塞全局事件 - }, - - __onclick : function (param) { - if (param.target) { - return; - } - if (this._marking) { - this._marking = false; - this._markShapeList.push(this._markShape); - this._iconEnable(this._iconShapeMap['markUndo']); - this._iconEnable(this._iconShapeMap['markClear']); - this.zr.addShape(this._markShape); - this.zr.refresh(); - } - else if (this._markStart) { - this._marking = true; - var x = zrEvent.getX(param.event); - var y = zrEvent.getY(param.event); - this._markShape = new LineShape({ - zlevel : this._zlevelBase, - style : { - xStart : x, - yStart : y, - xEnd : x, - yEnd : y, - lineWidth : this.query( - this.option, - 'toolbox.feature.mark.lineStyle.width' - ), - strokeColor : this.query( - this.option, - 'toolbox.feature.mark.lineStyle.color' - ), - lineType : this.query( - this.option, - 'toolbox.feature.mark.lineStyle.type' - ) - } - }); - this.zr.addHoverShape(this._markShape); - } - }, - - __onMark : function (param) { - var target = param.target; - if (this._marking || this._markStart) { - // 取消 - this._resetMark(); - this.zr.refresh(); - } - else { - // 启用Mark - this._resetZoom(); // mark与dataZoom互斥 - - this.zr.modShape(target.id, {style: {strokeColor: this._enableColor}}); - this.zr.refresh(); - this._markStart = true; - var self = this; - setTimeout(function (){ - self.zr - && self.zr.on(zrConfig.EVENT.CLICK, self._onclick) - && self.zr.on(zrConfig.EVENT.MOUSEMOVE, self._onmousemove); - }, 10); - } - return true; // 阻塞全局事件 - }, - - __onMarkUndo : function () { - if (this._marking) { - this._marking = false; - } else { - var len = this._markShapeList.length; - if (len >= 1) { - var target = this._markShapeList[len - 1]; - this.zr.delShape(target.id); - this.zr.refresh(); - this._markShapeList.pop(); - if (len == 1) { - this._iconDisable(this._iconShapeMap['markUndo']); - this._iconDisable(this._iconShapeMap['markClear']); - } - } - } - return true; - }, - - __onMarkClear : function () { - if (this._marking) { - this._marking = false; - } - var len = this._markShapeList.length; - if (len > 0) { - while(len--) { - this.zr.delShape(this._markShapeList.pop().id); - } - this._iconDisable(this._iconShapeMap['markUndo']); - this._iconDisable(this._iconShapeMap['markClear']); - this.zr.refresh(); - } - return true; - }, - - __onDataZoom : function (param) { - var target = param.target; - if (this._zooming || this._zoomStart) { - // 取消 - this._resetZoom(); - this.zr.refresh(); - this.dom.style.cursor = 'default'; - } - else { - // 启用Zoom - this._resetMark(); // mark与dataZoom互斥 - - this.zr.modShape(target.id, {style: {strokeColor: this._enableColor}}); - this.zr.refresh(); - this._zoomStart = true; - var self = this; - setTimeout(function (){ - self.zr - && self.zr.on(zrConfig.EVENT.MOUSEDOWN, self._onmousedown) - && self.zr.on(zrConfig.EVENT.MOUSEUP, self._onmouseup) - && self.zr.on(zrConfig.EVENT.MOUSEMOVE, self._onmousemove); - }, 10); - - this.dom.style.cursor = 'crosshair'; - } - return true; // 阻塞全局事件 - }, - - __onDataZoomReset : function () { - if (this._zooming) { - this._zooming = false; - } - this._zoomQueue.pop(); - //console.log(this._zoomQueue) - if (this._zoomQueue.length > 0) { - this.component.dataZoom.absoluteZoom( - this._zoomQueue[this._zoomQueue.length - 1] - ); - } - else { - this.component.dataZoom.rectZoom(); - this._iconDisable(this._iconShapeMap['dataZoomReset']); - this.zr.refresh(); - } - - return true; - }, - - _resetMark : function () { - this._marking = false; - if (this._markStart) { - this._markStart = false; - if (this._iconShapeMap['mark']) { - // 还原图标为未生效状态 - this.zr.modShape( - this._iconShapeMap['mark'].id, - { - style: { - strokeColor: this._iconShapeMap['mark'] - .highlightStyle - .strokeColor - } - } - ); - } - - this.zr.un(zrConfig.EVENT.CLICK, this._onclick); - this.zr.un(zrConfig.EVENT.MOUSEMOVE, this._onmousemove); - } - }, - - _resetZoom : function () { - this._zooming = false; - if (this._zoomStart) { - this._zoomStart = false; - if (this._iconShapeMap['dataZoom']) { - // 还原图标为未生效状态 - this.zr.modShape( - this._iconShapeMap['dataZoom'].id, - { - style: { - strokeColor: this._iconShapeMap['dataZoom'] - .highlightStyle - .strokeColor - } - } - ); - } - - this.zr.un(zrConfig.EVENT.MOUSEDOWN, this._onmousedown); - this.zr.un(zrConfig.EVENT.MOUSEUP, this._onmouseup); - this.zr.un(zrConfig.EVENT.MOUSEMOVE, this._onmousemove); - } - }, - - _iconDisable : function (target) { - if (target.type != 'image') { - this.zr.modShape(target.id, { - hoverable : false, - clickable : false, - style : { - strokeColor : this._disableColor - } - }); - } - else { - this.zr.modShape(target.id, { - hoverable : false, - clickable : false, - style : { - opacity : 0.3 - } - }); - } - }, - - _iconEnable : function (target) { - if (target.type != 'image') { - this.zr.modShape(target.id, { - hoverable : true, - clickable : true, - style : { - strokeColor : target.highlightStyle.strokeColor - } - }); - } - else { - this.zr.modShape(target.id, { - hoverable : true, - clickable : true, - style : { - opacity : 0.8 - } - }); - } - }, - - __onDataView : function () { - this._dataView.show(this.option); - return true; - }, - - __onRestore : function (){ - this._resetMark(); - this._resetZoom(); - this.messageCenter.dispatch(ecConfig.EVENT.RESTORE, null, null, this.myChart); - return true; - }, - - __onSaveAsImage : function () { - var saveOption = this.option.toolbox.feature.saveAsImage; - var imgType = saveOption.type || 'png'; - if (imgType != 'png' && imgType != 'jpeg') { - imgType = 'png'; - } - - var image; - if (!this.myChart.isConnected()) { - image = this.zr.toDataURL( - 'image/' + imgType, - this.option.backgroundColor - && this.option.backgroundColor.replace(' ','') == 'rgba(0,0,0,0)' - ? '#fff' : this.option.backgroundColor - ); - } - else { - image = this.myChart.getConnectedDataURL(imgType); - } - - var downloadDiv = document.createElement('div'); - downloadDiv.id = '__echarts_download_wrap__'; - downloadDiv.style.cssText = 'position:fixed;' - + 'z-index:99999;' - + 'display:block;' - + 'top:0;left:0;' - + 'background-color:rgba(33,33,33,0.5);' - + 'text-align:center;' - + 'width:100%;' - + 'height:100%;' - + 'line-height:' - + document.documentElement.clientHeight + 'px;'; - - var downloadLink = document.createElement('a'); - //downloadLink.onclick = _saveImageForIE; - downloadLink.href = image; - downloadLink.setAttribute( - 'download', - (saveOption.name - ? saveOption.name - : (this.option.title && (this.option.title.text || this.option.title.subtext)) - ? (this.option.title.text || this.option.title.subtext) - : 'ECharts') - + '.' + imgType - ); - downloadLink.innerHTML = ''; - - downloadDiv.appendChild(downloadLink); - document.body.appendChild(downloadDiv); - downloadLink = null; - downloadDiv = null; - - setTimeout(function (){ - var _d = document.getElementById('__echarts_download_wrap__'); - if (_d) { - _d.onclick = function () { - var d = document.getElementById( - '__echarts_download_wrap__' - ); - d.onclick = null; - d.innerHTML = ''; - document.body.removeChild(d); - d = null; - }; - _d = null; - } - }, 500); - - /* - function _saveImageForIE() { - window.win = window.open(image); - win.document.execCommand("SaveAs"); - win.close() - } - */ - return; - }, - - __onMagicType : function (param) { - this._resetMark(); - var itemName = param.target._name; - if (!this._magicType[itemName]) { - // 启用 - this._magicType[itemName] = true; - // 折柱互斥 - if (itemName == ecConfig.CHART_TYPE_LINE) { - this._magicType[ecConfig.CHART_TYPE_BAR] = false; - } - else if (itemName == ecConfig.CHART_TYPE_BAR) { - this._magicType[ecConfig.CHART_TYPE_LINE] = false; - } - // 堆积平铺互斥 - if (itemName == _MAGICTYPE_STACK) { - this._magicType[_MAGICTYPE_TILED] = false; - } - else if (itemName == _MAGICTYPE_TILED) { - this._magicType[_MAGICTYPE_STACK] = false; - } - this.messageCenter.dispatch( - ecConfig.EVENT.MAGIC_TYPE_CHANGED, - param.event, - {magicType : this._magicType}, - this.myChart - ); - } - - return true; - }, - - setMagicType : function (magicType) { - this._resetMark(); - this._magicType = magicType; - - !this._isSilence && this.messageCenter.dispatch( - ecConfig.EVENT.MAGIC_TYPE_CHANGED, - null, - {magicType : this._magicType}, - this.myChart - ); - }, - - // 用户自定义扩展toolbox方法 - __onCustomHandler : function (param) { - var target = param.target.style.iconType; - var featureHandler = this.option.toolbox.feature[target].onclick; - if (typeof featureHandler === 'function') { - featureHandler(this.option); - } - }, - - // 重置备份还原状态等 - reset : function (newOption, isRestore) { - isRestore && this.clear(); - - if (this.query(newOption, 'toolbox.show') - && this.query(newOption, 'toolbox.feature.magicType.show') - ) { - var magicType = newOption.toolbox.feature.magicType.type; - var len = magicType.length; - this._magicMap = {}; // 标识可控类型 - while (len--) { - this._magicMap[magicType[len]] = true; - } - - len = newOption.series.length; - var oriType; // 备份还原可控类型 - var axis; - while (len--) { - oriType = newOption.series[len].type; - if (this._magicMap[oriType]) { - axis = newOption.xAxis instanceof Array - ? newOption.xAxis[newOption.series[len].xAxisIndex || 0] - : newOption.xAxis; - if (axis && (axis.type || 'category') == 'category') { - axis.__boundaryGap = typeof axis.boundaryGap != 'undefined' - ? axis.boundaryGap : true; - } - axis = newOption.yAxis instanceof Array - ? newOption.yAxis[newOption.series[len].yAxisIndex || 0] - : newOption.yAxis; - if (axis && axis.type == 'category') { - axis.__boundaryGap = typeof axis.boundaryGap != 'undefined' - ? axis.boundaryGap : true; - } - newOption.series[len].__type = oriType; - // 避免不同类型图表类型的样式污染 - newOption.series[len].__itemStyle = zrUtil.clone( - newOption.series[len].itemStyle || {} - ); - } - - if (this._magicMap[_MAGICTYPE_STACK] || this._magicMap[_MAGICTYPE_TILED]) { - newOption.series[len].__stack = newOption.series[len].stack; - } - } - } - - this._magicType = isRestore ? {} : (this._magicType || {}); - for (var itemName in this._magicType) { - if (this._magicType[itemName]) { - this.option = newOption; - this.getMagicOption(); - break; - } - } - - // 框选缩放 - var zoomOption = newOption.dataZoom; - if (zoomOption && zoomOption.show) { - var start = typeof zoomOption.start != 'undefined' - && zoomOption.start >= 0 - && zoomOption.start <= 100 - ? zoomOption.start : 0; - var end = typeof zoomOption.end != 'undefined' - && zoomOption.end >= 0 - && zoomOption.end <= 100 - ? zoomOption.end : 100; - if (start > end) { - // 大小颠倒自动翻转 - start = start + end; - end = start - end; - start = start - end; - } - this._zoomQueue = [{ - start : start, - end : end, - start2 : 0, - end2 : 100 - }]; - } - else { - this._zoomQueue = []; - } - }, - - getMagicOption : function (){ - var axis; - if (this._magicType[ecConfig.CHART_TYPE_LINE] - || this._magicType[ecConfig.CHART_TYPE_BAR] - ) { - // 图表类型有切换 - var boundaryGap = this._magicType[ecConfig.CHART_TYPE_LINE] ? false : true; - for (var i = 0, l = this.option.series.length; i < l; i++) { - if (this._magicMap[this.option.series[i].type]) { - this.option.series[i].type = this._magicType[ecConfig.CHART_TYPE_LINE] - ? ecConfig.CHART_TYPE_LINE - : ecConfig.CHART_TYPE_BAR; - // 避免不同类型图表类型的样式污染 - this.option.series[i].itemStyle = zrUtil.clone( - this.option.series[i].__itemStyle - ); - - axis = this.option.xAxis instanceof Array - ? this.option.xAxis[this.option.series[i].xAxisIndex || 0] - : this.option.xAxis; - if (axis && (axis.type || 'category') == 'category') { - axis.boundaryGap = boundaryGap ? true : axis.__boundaryGap; - } - axis = this.option.yAxis instanceof Array - ? this.option.yAxis[this.option.series[i].yAxisIndex || 0] - : this.option.yAxis; - if (axis && axis.type == 'category') { - axis.boundaryGap = boundaryGap ? true : axis.__boundaryGap; - } - } - } - } - - if (this._magicType[_MAGICTYPE_STACK] || this._magicType[_MAGICTYPE_TILED]) { - // 有堆积平铺切换 - for (var i = 0, l = this.option.series.length; i < l; i++) { - if (this._magicType[_MAGICTYPE_STACK]) { - // 启用堆积 - this.option.series[i].stack = '_ECHARTS_STACK_KENER_2014_'; - } - else if (this._magicType[_MAGICTYPE_TILED]) { - // 启用平铺 - this.option.series[i].stack = null; - } - } - } - - return this.option; - }, - - silence : function (s) { - this._isSilence = s; - }, - - resize : function () { - this._resetMark(); - this.clear(); - if (this.option && this.option.toolbox && this.option.toolbox.show) { - this._buildShape(); - } - if (this._dataView) { - this._dataView.resize(); - } - }, - - hideDataView : function () { - if (this._dataView) { - this._dataView.hide(); - } - }, - - clear : function(notMark) { - if (this.zr) { - this.zr.delShape(this.shapeList); - this.shapeList = []; - - if (!notMark) { - this.zr.delShape(this._markShapeList); - this._markShapeList = []; - } - } - }, - - /** - * 释放后实例不可用 - */ - dispose : function () { - if (this._dataView) { - this._dataView.dispose(); - this._dataView = null; - } - this.clear(); - this.shapeList = null; - this._markShapeList = null; - }, - - /** - * 刷新 - */ - refresh : function (newOption) { - if (newOption) { - this._resetMark(); - this._resetZoom(); - - newOption.toolbox = this.reformOption(newOption.toolbox); - // 补全padding属性 - newOption.toolbox.padding = this.reformCssArray( - newOption.toolbox.padding - ); - this.option = newOption; - - this.clear(true); - - if (newOption.toolbox.show) { - this._buildShape(); - } - - this.hideDataView(); - } - } - }; - - zrUtil.inherits(Toolbox, Base); - - require('../component').define('toolbox', Toolbox); - - return Toolbox; -}); - -/** - * echarts组件:图表标题 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/component/title',['require','./base','zrender/shape/Text','zrender/shape/Rectangle','../config','zrender/tool/util','zrender/tool/area','zrender/tool/color','../component'],function (require) { - var Base = require('./base'); - - // 图形依赖 - var TextShape = require('zrender/shape/Text'); - var RectangleShape = require('zrender/shape/Rectangle'); - - var ecConfig = require('../config'); - var zrUtil = require('zrender/tool/util'); - var zrArea = require('zrender/tool/area'); - var zrColor = require('zrender/tool/color'); - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} option 图表参数 - */ - function Title(ecTheme, messageCenter, zr, option, myChart) { - Base.call(this, ecTheme, messageCenter, zr, option, myChart); - - this.refresh(option); - } - - Title.prototype = { - type : ecConfig.COMPONENT_TYPE_TITLE, - _buildShape : function () { - // 标题元素组的位置参数,通过计算所得x, y, width, height - this._itemGroupLocation = this._getItemGroupLocation(); - - this._buildBackground(); - this._buildItem(); - - for (var i = 0, l = this.shapeList.length; i < l; i++) { - this.zr.addShape(this.shapeList[i]); - } - }, - - /** - * 构建所有标题元素 - */ - _buildItem : function () { - var text = this.titleOption.text; - var link = this.titleOption.link; - var target = this.titleOption.target; - var subtext = this.titleOption.subtext; - var sublink = this.titleOption.sublink; - var subtarget = this.titleOption.subtarget; - var font = this.getFont(this.titleOption.textStyle); - var subfont = this.getFont(this.titleOption.subtextStyle); - - var x = this._itemGroupLocation.x; - var y = this._itemGroupLocation.y; - var width = this._itemGroupLocation.width; - var height = this._itemGroupLocation.height; - - var textShape = { - zlevel : this._zlevelBase, - style : { - y : y, - color : this.titleOption.textStyle.color, - text: text, - textFont: font, - textBaseline: 'top' - }, - highlightStyle: { - color : zrColor.lift(this.titleOption.textStyle.color, 1), - brushType: 'fill' - }, - hoverable: false - }; - if (link) { - textShape.hoverable = true; - textShape.clickable = true; - textShape.onclick = function (){ - if (!target || target != 'self') { - window.open(link); - } - else { - window.location = link; - } - }; - } - - var subtextShape = { - zlevel : this._zlevelBase, - style : { - y : y + height, - color : this.titleOption.subtextStyle.color, - text: subtext, - textFont: subfont, - textBaseline: 'bottom' - }, - highlightStyle: { - color : zrColor.lift(this.titleOption.subtextStyle.color, 1), - brushType: 'fill' - }, - hoverable: false - }; - if (sublink) { - subtextShape.hoverable = true; - subtextShape.clickable = true; - subtextShape.onclick = function (){ - if (!subtarget || subtarget != 'self') { - window.open(sublink); - } - else { - window.location = sublink; - } - }; - } - - switch (this.titleOption.x) { - case 'center' : - textShape.style.x = subtextShape.style.x = x + width / 2; - textShape.style.textAlign = subtextShape.style.textAlign - = 'center'; - break; - case 'left' : - textShape.style.x = subtextShape.style.x = x; - textShape.style.textAlign = subtextShape.style.textAlign - = 'left'; - break; - case 'right' : - textShape.style.x = subtextShape.style.x = x + width; - textShape.style.textAlign = subtextShape.style.textAlign - = 'right'; - break; - default : - x = this.titleOption.x - 0; - x = isNaN(x) ? 0 : x; - textShape.style.x = subtextShape.style.x = x; - break; - } - - if (this.titleOption.textAlign) { - textShape.style.textAlign = subtextShape.style.textAlign - = this.titleOption.textAlign; - } - - this.shapeList.push(new TextShape(textShape)); - subtext !== '' && this.shapeList.push(new TextShape(subtextShape)); - }, - - _buildBackground : function () { - var pTop = this.titleOption.padding[0]; - var pRight = this.titleOption.padding[1]; - var pBottom = this.titleOption.padding[2]; - var pLeft = this.titleOption.padding[3]; - - this.shapeList.push(new RectangleShape({ - zlevel : this._zlevelBase, - hoverable :false, - style : { - x : this._itemGroupLocation.x - pLeft, - y : this._itemGroupLocation.y - pTop, - width : this._itemGroupLocation.width + pLeft + pRight, - height : this._itemGroupLocation.height + pTop + pBottom, - brushType : this.titleOption.borderWidth === 0 - ? 'fill' : 'both', - color : this.titleOption.backgroundColor, - strokeColor : this.titleOption.borderColor, - lineWidth : this.titleOption.borderWidth - } - })); - }, - - /** - * 根据选项计算标题实体的位置坐标 - */ - _getItemGroupLocation : function () { - var text = this.titleOption.text; - var subtext = this.titleOption.subtext; - var font = this.getFont(this.titleOption.textStyle); - var subfont = this.getFont(this.titleOption.subtextStyle); - - var totalWidth = Math.max( - zrArea.getTextWidth(text, font), - zrArea.getTextWidth(subtext, subfont) - ); - var totalHeight = zrArea.getTextHeight(text, font) - + (subtext === '' - ? 0 - : (this.titleOption.itemGap - + zrArea.getTextHeight(subtext, subfont)) - ); - - var x; - var zrWidth = this.zr.getWidth(); - switch (this.titleOption.x) { - case 'center' : - x = Math.floor((zrWidth - totalWidth) / 2); - break; - case 'left' : - x = this.titleOption.padding[3] + this.titleOption.borderWidth; - break; - case 'right' : - x = zrWidth - - totalWidth - - this.titleOption.padding[1] - - this.titleOption.borderWidth; - break; - default : - x = this.titleOption.x - 0; - x = isNaN(x) ? 0 : x; - break; - } - - var y; - var zrHeight = this.zr.getHeight(); - switch (this.titleOption.y) { - case 'top' : - y = this.titleOption.padding[0] + this.titleOption.borderWidth; - break; - case 'bottom' : - y = zrHeight - - totalHeight - - this.titleOption.padding[2] - - this.titleOption.borderWidth; - break; - case 'center' : - y = Math.floor((zrHeight - totalHeight) / 2); - break; - default : - y = this.titleOption.y - 0; - y = isNaN(y) ? 0 : y; - break; - } - - return { - x : x, - y : y, - width : totalWidth, - height : totalHeight - }; - }, - - /** - * 刷新 - */ - refresh : function (newOption) { - if (newOption) { - this.option = newOption; - - this.option.title = this.reformOption(this.option.title); - // 补全padding属性 - this.option.title.padding = this.reformCssArray( - this.option.title.padding - ); - - this.titleOption = this.option.title; - this.titleOption.textStyle = zrUtil.merge( - this.titleOption.textStyle, - this.ecTheme.textStyle - ); - this.titleOption.subtextStyle = zrUtil.merge( - this.titleOption.subtextStyle, - this.ecTheme.textStyle - ); - } - - this.clear(); - this._buildShape(); - } - }; - - zrUtil.inherits(Title, Base); - - require('../component').define('title', Title); - - return Title; -}); - - - -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:十字准星 - * 可配图形属性: - { - // 基础属性 - shape : 'cross', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - rect : {Object}, // 必须,对角框 - x : {number}, // 必须,横坐标 - y : {number}, // 必须,纵坐标 - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - */ -define('echarts/util/shape/Cross',['require','zrender/shape/Base','zrender/shape/Line','zrender/tool/util','./normalIsCover'],function (require) { - var Base = require('zrender/shape/Base'); - var LineShape = require('zrender/shape/Line'); - var zrUtil = require('zrender/tool/util'); - - function Cross(options) { - Base.call(this, options); - } - - Cross.prototype = { - type : 'cross', - - /** - * 创建矩形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function (ctx, style) { - var rect = style.rect; - style.xStart = rect.x; - style.xEnd = rect.x + rect.width; - style.yStart = style.yEnd = style.y; - LineShape.prototype.buildPath(ctx, style); - style.xStart = style.xEnd = style.x; - style.yStart = rect.y; - style.yEnd = rect.y + rect.height; - LineShape.prototype.buildPath(ctx, style); - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function (style) { - return style.rect; - }, - - isCover : require('./normalIsCover') - }; - - zrUtil.inherits(Cross, Base); - - return Cross; -}); - -/** - * echarts组件:提示框 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zrender/shape/Line','zrender/shape/Rectangle','../config','../util/ecData','zrender/config','zrender/tool/event','zrender/tool/area','zrender/tool/color','zrender/tool/util','zrender/shape/Base','../component'],function (require) { - var Base = require('./base'); - - // 图形依赖 - var CrossShape = require('../util/shape/Cross'); - var LineShape = require('zrender/shape/Line'); - var RectangleShape = require('zrender/shape/Rectangle'); - var rectangleInstance = new RectangleShape({}); - - var ecConfig = require('../config'); - var ecData = require('../util/ecData'); - var zrConfig = require('zrender/config'); - var zrEvent = require('zrender/tool/event'); - var zrArea = require('zrender/tool/area'); - var zrColor = require('zrender/tool/color'); - var zrUtil = require('zrender/tool/util'); - var zrShapeBase = require('zrender/shape/Base'); - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} option 提示框参数 - * @param {HtmlElement} dom 目标对象 - * @param {ECharts} myChart 当前图表实例 - */ - function Tooltip(ecTheme, messageCenter, zr, option, myChart) { - Base.call(this, ecTheme, messageCenter, zr, option, myChart); - - this.dom = myChart.dom; - - var self = this; - self._onmousemove = function (param) { - return self.__onmousemove(param); - }; - self._onglobalout = function (param) { - return self.__onglobalout(param); - }; - - this.zr.on(zrConfig.EVENT.MOUSEMOVE, self._onmousemove); - this.zr.on(zrConfig.EVENT.GLOBALOUT, self._onglobalout); - - self._hide = function (param) { - return self.__hide(param); - }; - self._tryShow = function(param) { - return self.__tryShow(param); - }; - self._refixed = function(param) { - return self.__refixed(param); - }; - - self._setContent = function(ticket, res) { - return self.__setContent(ticket, res); - }; - - this._tDom = this._tDom || document.createElement('div'); - // 避免拖拽时页面选中的尴尬 - this._tDom.onselectstart = function() { - return false; - }; - this._tDom.style.position = 'absolute'; // 不是多余的,别删! - this.hasAppend = false; - - this._axisLineShape && this.zr.delShape(this._axisLineShape.id); - this._axisLineShape = new LineShape({ - zlevel: this._zlevelBase, - invisible : true, - hoverable: false - }); - this.shapeList.push(this._axisLineShape); - this.zr.addShape(this._axisLineShape); - - this._axisShadowShape && this.zr.delShape(this._axisShadowShape.id); - this._axisShadowShape = new LineShape({ - zlevel: 1, // grid上,chart下 - invisible : true, - hoverable: false - }); - this.shapeList.push(this._axisShadowShape); - this.zr.addShape(this._axisShadowShape); - - this._axisCrossShape && this.zr.delShape(this._axisCrossShape.id); - this._axisCrossShape = new CrossShape({ - zlevel: this._zlevelBase, - invisible : true, - hoverable: false - }); - this.shapeList.push(this._axisCrossShape); - this.zr.addShape(this._axisCrossShape); - - this.showing = false; - this.refresh(option); - } - - Tooltip.prototype = { - type : ecConfig.COMPONENT_TYPE_TOOLTIP, - // 通用样式 - _gCssText : 'position:absolute;' - + 'display:block;' - + 'border-style:solid;' - + 'white-space:nowrap;', - /** - * 根据配置设置dom样式 - */ - _style : function (opt) { - if (!opt) { - return ''; - } - var cssText = []; - if (opt.transitionDuration) { - var transitionText = 'left ' + opt.transitionDuration + 's,' - + 'top ' + opt.transitionDuration + 's'; - cssText.push( - 'transition:' + transitionText - ); - cssText.push( - '-moz-transition:' + transitionText - ); - cssText.push( - '-webkit-transition:' + transitionText - ); - cssText.push( - '-o-transition:' + transitionText - ); - } - - if (opt.backgroundColor) { - // for sb ie~ - cssText.push( - 'background-Color:' + zrColor.toHex( - opt.backgroundColor - ) - ); - cssText.push('filter:alpha(opacity=70)'); - cssText.push('background-Color:' + opt.backgroundColor); - } - - if (typeof opt.borderWidth != 'undefined') { - cssText.push('border-width:' + opt.borderWidth + 'px'); - } - - if (typeof opt.borderColor != 'undefined') { - cssText.push('border-color:' + opt.borderColor); - } - - if (typeof opt.borderRadius != 'undefined') { - cssText.push( - 'border-radius:' + opt.borderRadius + 'px' - ); - cssText.push( - '-moz-border-radius:' + opt.borderRadius + 'px' - ); - cssText.push( - '-webkit-border-radius:' + opt.borderRadius + 'px' - ); - cssText.push( - '-o-border-radius:' + opt.borderRadius + 'px' - ); - } - - var textStyle = opt.textStyle; - if (textStyle) { - textStyle.color && cssText.push('color:' + textStyle.color); - textStyle.decoration && cssText.push( - 'text-decoration:' + textStyle.decoration - ); - textStyle.align && cssText.push( - 'text-align:' + textStyle.align - ); - textStyle.fontFamily && cssText.push( - 'font-family:' + textStyle.fontFamily - ); - textStyle.fontSize && cssText.push( - 'font-size:' + textStyle.fontSize + 'px' - ); - textStyle.fontSize && cssText.push( - 'line-height:' + Math.round(textStyle.fontSize*3/2) + 'px' - ); - textStyle.fontStyle && cssText.push( - 'font-style:' + textStyle.fontStyle - ); - textStyle.fontWeight && cssText.push( - 'font-weight:' + textStyle.fontWeight - ); - } - - - var padding = opt.padding; - if (typeof padding != 'undefined') { - padding = this.reformCssArray(padding); - cssText.push( - 'padding:' + padding[0] + 'px ' - + padding[1] + 'px ' - + padding[2] + 'px ' - + padding[3] + 'px' - ); - } - - cssText = cssText.join(';') + ';'; - - return cssText; - }, - - __hide : function () { - if (this._tDom) { - this._tDom.style.display = 'none'; - } - var needRefresh = false; - if (!this._axisLineShape.invisible) { - this._axisLineShape.invisible = true; - this.zr.modShape(this._axisLineShape.id); - needRefresh = true; - } - if (!this._axisShadowShape.invisible) { - this._axisShadowShape.invisible = true; - this.zr.modShape(this._axisShadowShape.id); - needRefresh = true; - } - if (!this._axisCrossShape.invisible) { - this._axisCrossShape.invisible = true; - this.zr.modShape(this._axisCrossShape.id); - needRefresh = true; - } - if (this._lastTipShape && this._lastTipShape.tipShape.length > 0) { - this.zr.delShape(this._lastTipShape.tipShape); - this._lastTipShape = false; - this.shapeList.length = 2; - } - needRefresh && this.zr.refresh(); - this.showing = false; - }, - - _show : function (position, x, y, specialCssText) { - var domHeight = this._tDom.offsetHeight; - var domWidth = this._tDom.offsetWidth; - if (position) { - if (typeof position == 'function') { - position = position([x, y]); - } - if (position instanceof Array) { - x = position[0]; - y = position[1]; - } - } - if (x + domWidth > this._zrWidth) { - // 太靠右 - //x = this._zrWidth - domWidth; - x -= (domWidth + 40); - } - if (y + domHeight > this._zrHeight) { - // 太靠下 - //y = this._zrHeight - domHeight; - y -= (domHeight - 20); - } - if (y < 20) { - y = 0; - } - this._tDom.style.cssText = this._gCssText - + this._defaultCssText - + (specialCssText ? specialCssText : '') - + 'left:' + x + 'px;top:' + y + 'px;'; - - if (domHeight < 10 || domWidth < 10) { - // this._zrWidth - x < 100 || this._zrHeight - y < 100 - setTimeout(this._refixed, 20); - } - this.showing = true; - }, - - __refixed : function () { - if (this._tDom) { - var cssText = ''; - var domHeight = this._tDom.offsetHeight; - var domWidth = this._tDom.offsetWidth; - if (this._tDom.offsetLeft + domWidth > this._zrWidth) { - cssText += 'left:' + (this._zrWidth - domWidth - 20) + 'px;'; - } - if (this._tDom.offsetTop + domHeight > this._zrHeight) { - cssText += 'top:' + (this._zrHeight - domHeight - 10) + 'px;'; - } - if (cssText !== '') { - this._tDom.style.cssText += cssText; - } - } - }, - - __tryShow : function () { - var needShow; - var trigger; - if (!this._curTarget) { - // 坐标轴事件 - this._findPolarTrigger() || this._findAxisTrigger(); - } - else { - // 数据项事件 - if (this._curTarget._type == 'island' && this.option.tooltip.show) { - this._showItemTrigger(); - return; - } - var serie = ecData.get(this._curTarget, 'series'); - var data = ecData.get(this._curTarget, 'data'); - needShow = this.deepQuery( - [data, serie, this.option], - 'tooltip.show' - ); - if (typeof serie == 'undefined' - || typeof data == 'undefined' - || needShow === false - ) { - // 不响应tooltip的数据对象延时隐藏 - clearTimeout(this._hidingTicket); - clearTimeout(this._showingTicket); - this._hidingTicket = setTimeout(this._hide, this._hideDelay); - } - else { - trigger = this.deepQuery( - [data, serie, this.option], - 'tooltip.trigger' - ); - - trigger == 'axis' - ? this._showAxisTrigger( - serie.xAxisIndex, serie.yAxisIndex, - ecData.get(this._curTarget, 'dataIndex') - ) - : this._showItemTrigger(); - } - } - }, - - /** - * 直角系 - */ - _findAxisTrigger : function () { - if (!this.component.xAxis || !this.component.yAxis) { - this._hidingTicket = setTimeout(this._hide, this._hideDelay); - return; - } - var series = this.option.series; - var xAxisIndex; - var yAxisIndex; - for (var i = 0, l = series.length; i < l; i++) { - // 找到第一个axis触发tooltip的系列 - if (this.deepQuery( - [series[i], this.option], 'tooltip.trigger' - ) == 'axis' - ) { - xAxisIndex = series[i].xAxisIndex || 0; - yAxisIndex = series[i].yAxisIndex || 0; - if (this.component.xAxis.getAxis(xAxisIndex) - && this.component.xAxis.getAxis(xAxisIndex).type - == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY - ) { - // 横轴为类目轴 - this._showAxisTrigger(xAxisIndex, yAxisIndex, - this._getNearestDataIndex( - 'x', this.component.xAxis.getAxis(xAxisIndex) - ) - ); - return; - } - else if (this.component.yAxis.getAxis(yAxisIndex) - && this.component.yAxis.getAxis(yAxisIndex).type - == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY - ) { - // 纵轴为类目轴 - this._showAxisTrigger(xAxisIndex, yAxisIndex, - this._getNearestDataIndex( - 'y', this.component.yAxis.getAxis(yAxisIndex) - ) - ); - return; - } - else { - // 双数值轴 - this._showAxisTrigger(xAxisIndex, yAxisIndex, -1); - return; - } - } - } - if (this.option.tooltip.axisPointer.type == 'cross') { - this._showAxisTrigger(-1, -1, -1); - } - }, - - /** - * 极坐标 - */ - _findPolarTrigger : function () { - if (!this.component.polar) { - return false; - } - var x = zrEvent.getX(this._event); - var y = zrEvent.getY(this._event); - var polarIndex = this.component.polar.getNearestIndex([x, y]); - var valueIndex; - if (polarIndex) { - valueIndex = polarIndex.valueIndex; - polarIndex = polarIndex.polarIndex; - } - else { - polarIndex = -1; - } - - if (polarIndex != -1) { - return this._showPolarTrigger(polarIndex, valueIndex); - } - - return false; - }, - - /** - * 根据坐标轴事件带的属性获取最近的axisDataIndex - */ - _getNearestDataIndex : function (direction, categoryAxis) { - var dataIndex = -1; - var x = zrEvent.getX(this._event); - var y = zrEvent.getY(this._event); - if (direction == 'x') { - // 横轴为类目轴 - var left; - var right; - var xEnd = this.component.grid.getXend(); - var curCoord = categoryAxis.getCoordByIndex(dataIndex); - while (curCoord < xEnd) { - if (curCoord <= x) { - left = curCoord; - } - if (curCoord >= x) { - break; - } - curCoord = categoryAxis.getCoordByIndex(++dataIndex); - right = curCoord; - } - if (x - left < right - x) { - dataIndex -= dataIndex !== 0 ? 1 : 0; - } - else { - // 离右边近,看是否为最后一个 - if (typeof categoryAxis.getNameByIndex(dataIndex) - == 'undefined' - ) { - dataIndex -= 1; - } - } - return dataIndex; - } - else { - // 纵轴为类目轴 - var top; - var bottom; - var yStart = this.component.grid.getY(); - var curCoord = categoryAxis.getCoordByIndex(dataIndex); - while (curCoord > yStart) { - if (curCoord >= y) { - bottom = curCoord; - } - if (curCoord <= y) { - break; - } - curCoord = categoryAxis.getCoordByIndex(++dataIndex); - top = curCoord; - } - - if (y - top > bottom - y) { - dataIndex -= dataIndex !== 0 ? 1 : 0; - } - else { - // 离上方边近,看是否为最后一个 - if (typeof categoryAxis.getNameByIndex(dataIndex) - == 'undefined' - ) { - dataIndex -= 1; - } - } - return dataIndex; - } - return -1; - }, - - /** - * 直角系 - */ - _showAxisTrigger : function (xAxisIndex, yAxisIndex, dataIndex) { - !this._event.connectTrigger && this.messageCenter.dispatch( - ecConfig.EVENT.TOOLTIP_IN_GRID, - this._event, - null, - this.myChart - ); - if (typeof this.component.xAxis == 'undefined' - || typeof this.component.yAxis == 'undefined' - || typeof xAxisIndex == 'undefined' - || typeof yAxisIndex == 'undefined' - // || dataIndex < 0 - ) { - // 不响应tooltip的数据对象延时隐藏 - clearTimeout(this._hidingTicket); - clearTimeout(this._showingTicket); - this._hidingTicket = setTimeout(this._hide, this._hideDelay); - return; - } - var series = this.option.series; - var seriesArray = []; - var seriesIndex = []; - var categoryAxis; - var x; - var y; - - var formatter; - var position; - var showContent; - var specialCssText = ''; - if (this.option.tooltip.trigger == 'axis') { - if (this.option.tooltip.show === false) { - return; - } - formatter = this.option.tooltip.formatter; - position = this.option.tooltip.position; - } - - if (xAxisIndex != -1 - && this.component.xAxis.getAxis(xAxisIndex).type - == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY - ) { - // 横轴为类目轴,找到所有用这条横轴并且axis触发的系列数据 - categoryAxis = this.component.xAxis.getAxis(xAxisIndex); - for (var i = 0, l = series.length; i < l; i++) { - if (!this._isSelected(series[i].name)) { - continue; - } - if (series[i].xAxisIndex == xAxisIndex - && this.deepQuery([series[i], this.option], 'tooltip.trigger') == 'axis' - ) { - showContent = this.query(series[i], 'tooltip.showContent') - || showContent; - formatter = this.query(series[i], 'tooltip.formatter') - || formatter; - position = this.query(series[i], 'tooltip.position') - || position; - - specialCssText += this._style(this.query(series[i], 'tooltip')); - seriesArray.push(series[i]); - seriesIndex.push(i); - } - } - // 寻找高亮元素 - this.messageCenter.dispatch( - ecConfig.EVENT.TOOLTIP_HOVER, - this._event, - { - seriesIndex : seriesIndex, - dataIndex : dataIndex - }, - this.myChart - ); - y = zrEvent.getY(this._event); - x = this.subPixelOptimize( - categoryAxis.getCoordByIndex(dataIndex), - this._axisLineWidth - ); - this._styleAxisPointer( - seriesArray, - x, this.component.grid.getY(), - x, this.component.grid.getYend(), - categoryAxis.getGap(), x, y - ); - } - else if (yAxisIndex != -1 - && this.component.yAxis.getAxis(yAxisIndex).type - == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY - ) { - // 纵轴为类目轴,找到所有用这条纵轴并且axis触发的系列数据 - categoryAxis = this.component.yAxis.getAxis(yAxisIndex); - for (var i = 0, l = series.length; i < l; i++) { - if (!this._isSelected(series[i].name)) { - continue; - } - if (series[i].yAxisIndex == yAxisIndex - && this.deepQuery([series[i], this.option], 'tooltip.trigger') == 'axis' - ) { - showContent = this.query(series[i], 'tooltip.showContent') - || showContent; - formatter = this.query(series[i], 'tooltip.formatter') - || formatter; - position = this.query(series[i], 'tooltip.position') - || position; - specialCssText += this._style(this.query(series[i], 'tooltip')); - seriesArray.push(series[i]); - seriesIndex.push(i); - } - } - // 寻找高亮元素 - this.messageCenter.dispatch( - ecConfig.EVENT.TOOLTIP_HOVER, - this._event, - { - seriesIndex : seriesIndex, - dataIndex : dataIndex - }, - this.myChart - ); - x = zrEvent.getX(this._event); - y = this.subPixelOptimize( - categoryAxis.getCoordByIndex(dataIndex), - this._axisLineWidth - ); - this._styleAxisPointer( - seriesArray, - this.component.grid.getX(), y, - this.component.grid.getXend(), y, - categoryAxis.getGap(), x, y - ); - } - else { - // 双数值轴 - x = zrEvent.getX(this._event); - y = zrEvent.getY(this._event); - this._styleAxisPointer( - series, - this.component.grid.getX(), y, - this.component.grid.getXend(), y, - 0, x, y - ); - if (dataIndex >= 0) { - this._showItemTrigger(); - } - else { - clearTimeout(this._hidingTicket); - clearTimeout(this._showingTicket); - this._tDom.style.display = 'none'; - } - } - - if (seriesArray.length > 0) { - var data; - if (typeof formatter == 'function') { - var params = []; - for (var i = 0, l = seriesArray.length; i < l; i++) { - data = seriesArray[i].data[dataIndex]; - data = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; - - params.push([ - seriesArray[i].name || '', - categoryAxis.getNameByIndex(dataIndex), - data - ]); - } - this._curTicket = 'axis:' + dataIndex; - this._tDom.innerHTML = formatter.call( - this.myChart, params, this._curTicket, this._setContent - ); - } - else if (typeof formatter == 'string') { - this._curTicket = NaN; - formatter = formatter.replace('{a}','{a0}') - .replace('{b}','{b0}') - .replace('{c}','{c0}'); - for (var i = 0, l = seriesArray.length; i < l; i++) { - formatter = formatter.replace( - '{a' + i + '}', - this._encodeHTML(seriesArray[i].name || '') - ); - formatter = formatter.replace( - '{b' + i + '}', - this._encodeHTML(categoryAxis.getNameByIndex(dataIndex)) - ); - data = seriesArray[i].data[dataIndex]; - data = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; - formatter = formatter.replace( - '{c' + i + '}', - data instanceof Array - ? data : this.numAddCommas(data) - ); - } - this._tDom.innerHTML = formatter; - } - else { - this._curTicket = NaN; - formatter = this._encodeHTML( - categoryAxis.getNameByIndex(dataIndex) - ); - - for (var i = 0, l = seriesArray.length; i < l; i++) { - formatter += '
' - + this._encodeHTML(seriesArray[i].name || '') - + ' : '; - data = seriesArray[i].data[dataIndex]; - data = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; - formatter += data instanceof Array - ? data : this.numAddCommas(data); - } - this._tDom.innerHTML = formatter; - } - - if (showContent === false || !this.option.tooltip.showContent) { - // 只用tooltip的行为,不显示主体 - return; - } - - if (!this.hasAppend) { - this._tDom.style.left = this._zrWidth / 2 + 'px'; - this._tDom.style.top = this._zrHeight / 2 + 'px'; - this.dom.firstChild.appendChild(this._tDom); - this.hasAppend = true; - } - this._show(position, x + 10, y + 10, specialCssText); - } - }, - - /** - * 极坐标 - */ - _showPolarTrigger : function (polarIndex, dataIndex) { - if (typeof this.component.polar == 'undefined' - || typeof polarIndex == 'undefined' - || typeof dataIndex == 'undefined' - || dataIndex < 0 - ) { - return false; - } - var series = this.option.series; - var seriesArray = []; - - var formatter; - var position; - var showContent; - var specialCssText = ''; - if (this.option.tooltip.trigger == 'axis') { - if (this.option.tooltip.show === false) { - return false; - } - formatter = this.option.tooltip.formatter; - position = this.option.tooltip.position; - } - var indicatorName = this.option.polar[polarIndex].indicator[dataIndex].text; - - // 找到所有用这个极坐标并且axis触发的系列数据 - for (var i = 0, l = series.length; i < l; i++) { - if (!this._isSelected(series[i].name)) { - continue; - } - if (series[i].polarIndex == polarIndex - && this.deepQuery([series[i], this.option], 'tooltip.trigger') == 'axis' - ) { - showContent = this.query(series[i], 'tooltip.showContent') - || showContent; - formatter = this.query(series[i], 'tooltip.formatter') - || formatter; - position = this.query(series[i], 'tooltip.position') - || position; - specialCssText += this._style(this.query(series[i], 'tooltip')); - seriesArray.push(series[i]); - } - } - if (seriesArray.length > 0) { - var polarData; - var data; - var params = []; - - for (var i = 0, l = seriesArray.length; i < l; i++) { - polarData = seriesArray[i].data; - for (var j = 0, k = polarData.length; j < k; j++) { - data = polarData[j]; - if (!this._isSelected(data.name)) { - continue; - } - data = typeof data != 'undefined' - ? data - : {name:'', value: {dataIndex:'-'}}; - - params.push([ - seriesArray[i].name || '', - data.name, - typeof data.value[dataIndex].value != 'undefined' - ? data.value[dataIndex].value : data.value[dataIndex], - indicatorName - ]); - } - } - if (params.length <= 0) { - return; - } - if (typeof formatter == 'function') { - this._curTicket = 'axis:' + dataIndex; - this._tDom.innerHTML = formatter.call( - this.myChart, params, this._curTicket, this._setContent - ); - } - else if (typeof formatter == 'string') { - formatter = formatter.replace('{a}','{a0}') - .replace('{b}','{b0}') - .replace('{c}','{c0}') - .replace('{d}','{d0}'); - for (var i = 0, l = params.length; i < l; i++) { - formatter = formatter.replace( - '{a' + i + '}', - this._encodeHTML(params[i][0]) - ); - formatter = formatter.replace( - '{b' + i + '}', - this._encodeHTML(params[i][1]) - ); - formatter = formatter.replace( - '{c' + i + '}', - this.numAddCommas(params[i][2]) - ); - formatter = formatter.replace( - '{d' + i + '}', - this._encodeHTML(params[i][3]) - ); - } - this._tDom.innerHTML = formatter; - } - else { - formatter = this._encodeHTML(params[0][1]) + '
' - + this._encodeHTML(params[0][3]) + ' : ' - + this.numAddCommas(params[0][2]); - for (var i = 1, l = params.length; i < l; i++) { - formatter += '
' + this._encodeHTML(params[i][1]) - + '
'; - formatter += this._encodeHTML(params[i][3]) + ' : ' - + this.numAddCommas(params[i][2]); - } - this._tDom.innerHTML = formatter; - } - - if (showContent === false || !this.option.tooltip.showContent) { - // 只用tooltip的行为,不显示主体 - return; - } - - if (!this.hasAppend) { - this._tDom.style.left = this._zrWidth / 2 + 'px'; - this._tDom.style.top = this._zrHeight / 2 + 'px'; - this.dom.firstChild.appendChild(this._tDom); - this.hasAppend = true; - } - this._show( - position, - zrEvent.getX(this._event), - zrEvent.getY(this._event), - specialCssText - ); - return true; - } - }, - - _showItemTrigger : function () { - if (!this._curTarget) { - return; - } - var serie = ecData.get(this._curTarget, 'series'); - var data = ecData.get(this._curTarget, 'data'); - var name = ecData.get(this._curTarget, 'name'); - var value = ecData.get(this._curTarget, 'value'); - var special = ecData.get(this._curTarget, 'special'); - var special2 = ecData.get(this._curTarget, 'special2'); - // 从低优先级往上找到trigger为item的formatter和样式 - var formatter; - var position; - var showContent; - var specialCssText = ''; - var indicator; - var html = ''; - if (this._curTarget._type != 'island') { - // 全局 - if (this.option.tooltip.trigger == 'item') { - formatter = this.option.tooltip.formatter; - position = this.option.tooltip.position; - } - // 系列 - if (this.query(serie, 'tooltip.trigger') == 'item') { - showContent = this.query(serie, 'tooltip.showContent') - || showContent; - formatter = this.query(serie, 'tooltip.formatter') - || formatter; - position = this.query(serie, 'tooltip.position') - || position; - specialCssText += this._style(this.query(serie, 'tooltip')); - } - // 数据项 - showContent = this.query(data, 'tooltip.showContent') - || showContent; - formatter = this.query(data, 'tooltip.formatter') - || formatter; - position = this.query(data, 'tooltip.position') - || position; - specialCssText += this._style(this.query(data, 'tooltip')); - } - else { - showContent = this.deepQuery([data, serie, this.option], 'tooltip.showContent'); - formatter = this.deepQuery([data, serie, this.option], 'tooltip.islandFormatter'); - position = this.deepQuery([data, serie, this.option], 'tooltip.islandPosition'); - } - - if (typeof formatter == 'function') { - this._curTicket = (serie.name || '') - + ':' - + ecData.get(this._curTarget, 'dataIndex'); - this._tDom.innerHTML = formatter.call( - this.myChart, - [ - serie.name || '', - name, - value, - special, - special2, - data - ], - this._curTicket, - this._setContent - ); - } - else if (typeof formatter == 'string') { - this._curTicket = NaN; - formatter = formatter.replace('{a}','{a0}') - .replace('{b}','{b0}') - .replace('{c}','{c0}'); - formatter = formatter.replace('{a0}', this._encodeHTML(serie.name || '')) - .replace('{b0}', this._encodeHTML(name)) - .replace( - '{c0}', - value instanceof Array ? value : this.numAddCommas(value) - ); - - formatter = formatter.replace('{d}','{d0}') - .replace('{d0}', special || ''); - formatter = formatter.replace('{e}','{e0}') - .replace('{e0}', ecData.get(this._curTarget, 'special2') || ''); - - this._tDom.innerHTML = formatter; - } - else { - this._curTicket = NaN; - if (serie.type == ecConfig.CHART_TYPE_SCATTER) { - this._tDom.innerHTML = (typeof serie.name != 'undefined' - ? (this._encodeHTML(serie.name) + '
') - : '' - ) - + (name === '' ? '' : (this._encodeHTML(name) + ' : ')) - + value - + (typeof special == 'undefined' - ? '' : (' (' + special + ')') - ); - } - else if (serie.type == ecConfig.CHART_TYPE_RADAR && special) { - indicator = special; - html += this._encodeHTML(name === '' ? (serie.name || '') : name); - html += html === '' ? '' : '
'; - for (var i = 0 ; i < indicator.length; i ++) { - html += this._encodeHTML(indicator[i].text) + ' : ' - + this.numAddCommas(value[i]) + '
'; - } - this._tDom.innerHTML = html; - } - else if (serie.type == ecConfig.CHART_TYPE_CHORD) { - if (typeof special2 == 'undefined') { - // 外环上 - this._tDom.innerHTML = this._encodeHTML(name) + ' (' - + this.numAddCommas(value) + ')'; - } - else { - var name1 = this._encodeHTML(name); - var name2 = this._encodeHTML(special); - // 内部弦上 - this._tDom.innerHTML = (typeof serie.name != 'undefined' - ? (this._encodeHTML(serie.name) + '
') : '' - ) - + name1 + ' -> ' + name2 - + ' (' + this.numAddCommas(value) + ')' - + '
' - + name2 + ' -> ' + name1 - + ' (' + this.numAddCommas(special2) + ')'; - } - } - else { - this._tDom.innerHTML = (typeof serie.name != 'undefined' - ? (this._encodeHTML(serie.name) + '
') : '' - ) - + this._encodeHTML(name) + ' : ' - + this.numAddCommas(value) + - (typeof special == 'undefined' - ? '' : (' ('+ this.numAddCommas(special) +')') - ); - } - } - - if (!this._axisLineShape.invisible - || !this._axisShadowShape.invisible - ) { - this._axisLineShape.invisible = true; - this.zr.modShape(this._axisLineShape.id); - this._axisShadowShape.invisible = true; - this.zr.modShape(this._axisShadowShape.id); - this.zr.refresh(); - } - - if (showContent === false || !this.option.tooltip.showContent) { - // 只用tooltip的行为,不显示主体 - return; - } - - if (!this.hasAppend) { - this._tDom.style.left = this._zrWidth / 2 + 'px'; - this._tDom.style.top = this._zrHeight / 2 + 'px'; - this.dom.firstChild.appendChild(this._tDom); - this.hasAppend = true; - } - - this._show( - position, - zrEvent.getX(this._event) + 20, - zrEvent.getY(this._event) - 20, - specialCssText - ); - }, - - /** - * 设置坐标轴指示器样式 - */ - _styleAxisPointer : function (seriesArray, xStart, yStart, xEnd, yEnd, gap, x, y) { - if (seriesArray.length > 0) { - var queryTarget; - var curType; - var axisPointer = this.option.tooltip.axisPointer; - var pointType = axisPointer.type; - var style = { - line : {}, - cross : {}, - shadow : {} - }; - for (var pType in style) { - style[pType].color = axisPointer[pType + 'Style'].color; - style[pType].width = axisPointer[pType + 'Style'].width; - style[pType].type = axisPointer[pType + 'Style'].type; - } - for (var i = 0, l = seriesArray.length; i < l; i++) { - if (this.deepQuery( - [seriesArray[i], this.option], 'tooltip.trigger' - ) == 'axis' - ) { - queryTarget = seriesArray[i]; - curType = this.query(queryTarget, 'tooltip.axisPointer.type'); - pointType = curType || pointType; - if (curType) { - style[curType].color = this.query( - queryTarget, - 'tooltip.axisPointer.' + curType + 'Style.color' - ) || style[curType].color; - style[curType].width = this.query( - queryTarget, - 'tooltip.axisPointer.' + curType + 'Style.width' - ) || style[curType].width; - style[curType].type = this.query( - queryTarget, - 'tooltip.axisPointer.' + curType + 'Style.type' - ) || style[curType].type; - } - } - } - - if (pointType == 'line') { - this._axisLineShape.style = { - xStart : xStart, - yStart : yStart, - xEnd : xEnd, - yEnd : yEnd, - strokeColor : style.line.color, - lineWidth : style.line.width, - lineType : style.line.type - }; - this._axisLineShape.invisible = false; - this.zr.modShape(this._axisLineShape.id); - } - else if (pointType == 'cross') { - this._axisCrossShape.style = { - brushType: 'stroke', - rect : this.component.grid.getArea(), - x : x, - y : y, - text : ('( ' - + this.component.xAxis.getAxis(0).getValueFromCoord(x) - + ' , ' - + this.component.yAxis.getAxis(0).getValueFromCoord(y) - + ' )' - ).replace(' , ', ' ').replace(' , ', ' '), - textPosition : 'specific', - strokeColor : style.cross.color, - lineWidth : style.cross.width, - lineType : style.cross.type - }; - if (this.component.grid.getXend() - x > 100) { // 右侧有空间 - this._axisCrossShape.style.textAlign = 'left'; - this._axisCrossShape.style.textX = x + 10; - } - else { - this._axisCrossShape.style.textAlign = 'right'; - this._axisCrossShape.style.textX = x - 10; - } - if (y - this.component.grid.getY() > 50) { // 上方有空间 - this._axisCrossShape.style.textBaseline = 'bottom'; - this._axisCrossShape.style.textY = y - 10; - } - else { - this._axisCrossShape.style.textBaseline = 'top'; - this._axisCrossShape.style.textY = y + 10; - } - this._axisCrossShape.invisible = false; - this.zr.modShape(this._axisCrossShape.id); - } - else if (pointType == 'shadow') { - if (typeof style.shadow.width == 'undefined' - || style.shadow.width == 'auto' - || isNaN(style.shadow.width) - ) { - style.shadow.width = gap; - } - if (xStart == xEnd) { - // 纵向 - if (Math.abs(this.component.grid.getX() - xStart) < 2) { - // 最左边 - style.shadow.width /= 2; - xStart = xEnd = xEnd + style.shadow.width / 2; - } - else if (Math.abs(this.component.grid.getXend() - xStart) < 2) { - // 最右边 - style.shadow.width /= 2; - xStart = xEnd = xEnd - style.shadow.width / 2; - } - } - else if (yStart == yEnd) { - // 横向 - if (Math.abs(this.component.grid.getY() - yStart) < 2) { - // 最上边 - style.shadow.width /= 2; - yStart = yEnd = yEnd + style.shadow.width / 2; - } - else if (Math.abs(this.component.grid.getYend() - yStart) < 2) { - // 最右边 - style.shadow.width /= 2; - yStart = yEnd = yEnd - style.shadow.width / 2; - } - } - this._axisShadowShape.style = { - xStart : xStart, - yStart : yStart, - xEnd : xEnd, - yEnd : yEnd, - strokeColor : style.shadow.color, - lineWidth : style.shadow.width - }; - this._axisShadowShape.invisible = false; - this.zr.modShape(this._axisShadowShape.id); - } - this.zr.refresh(); - } - }, - - __onmousemove : function (param) { - clearTimeout(this._hidingTicket); - clearTimeout(this._showingTicket); - var target = param.target; - var mx = zrEvent.getX(param.event); - var my = zrEvent.getY(param.event); - if (!target) { - // 判断是否落到直角系里,axis触发的tooltip - this._curTarget = false; - this._event = param.event; - // this._event._target = this._event.target || this._event.toElement; - this._event.zrenderX = mx; - this._event.zrenderY = my; - if (this._needAxisTrigger - && this.component.grid - && zrArea.isInside(rectangleInstance, this.component.grid.getArea(), mx, my) - ) { - this._showingTicket = setTimeout(this._tryShow, this._showDelay); - } - else if (this._needAxisTrigger - && this.component.polar - && this.component.polar.isInside([mx, my]) != -1 - ) { - this._showingTicket = setTimeout(this._tryShow, this._showDelay); - } - else { - !this._event.connectTrigger && this.messageCenter.dispatch( - ecConfig.EVENT.TOOLTIP_OUT_GRID, - this._event, - null, - this.myChart - ); - this._hidingTicket = setTimeout(this._hide, this._hideDelay); - } - } - else { - this._curTarget = target; - this._event = param.event; - // this._event._target = this._event.target || this._event.toElement; - this._event.zrenderX = mx; - this._event.zrenderY = my; - var polarIndex; - if (this._needAxisTrigger - && this.component.polar - && (polarIndex = this.component.polar.isInside([mx, my])) != -1 - ) { - // 看用这个polar的系列数据是否是axis触发,如果是设置_curTarget为nul - var series = this.option.series; - for (var i = 0, l = series.length; i < l; i++) { - if (series[i].polarIndex == polarIndex - && this.deepQuery( - [series[i], this.option], 'tooltip.trigger' - ) == 'axis' - ) { - this._curTarget = null; - break; - } - } - - } - this._showingTicket = setTimeout(this._tryShow, this._showDelay); - } - }, - - /** - * zrender事件响应:鼠标离开绘图区域 - */ - __onglobalout : function () { - clearTimeout(this._hidingTicket); - clearTimeout(this._showingTicket); - this._hidingTicket = setTimeout(this._hide, this._hideDelay); - }, - - /** - * 异步回调填充内容 - */ - __setContent : function (ticket, content) { - if (!this._tDom) { - return; - } - if (ticket == this._curTicket) { - this._tDom.innerHTML = content; - } - - setTimeout(this._refixed, 20); - }, - - ontooltipHover : function (param, tipShape) { - if (!this._lastTipShape // 不存在或者存在但dataIndex发生变化才需要重绘 - || (this._lastTipShape && this._lastTipShape.dataIndex != param.dataIndex) - ) { - if (this._lastTipShape && this._lastTipShape.tipShape.length > 0) { - this.zr.delShape(this._lastTipShape.tipShape); - this.shapeList.length = 2; - } - for (var i = 0, l = tipShape.length; i < l; i++) { - tipShape[i].zlevel = this._zlevelBase; - tipShape[i].style = zrShapeBase.prototype.getHighlightStyle( - tipShape[i].style, - tipShape[i].highlightStyle - ); - tipShape[i].draggable = false; - tipShape[i].hoverable = false; - tipShape[i].clickable = false; - tipShape[i].ondragend = null; - tipShape[i].ondragover = null; - tipShape[i].ondrop = null; - this.shapeList.push(tipShape[i]); - this.zr.addShape(tipShape[i]); - } - this._lastTipShape = { - dataIndex : param.dataIndex, - tipShape : tipShape - }; - } - }, - - ondragend : function () { - this._hide(); - }, - - /** - * 图例选择 - */ - onlegendSelected : function (param) { - this._selectedMap = param.selected; - }, - - _setSelectedMap : function () { - if (this.component.legend) { - this._selectedMap = zrUtil.clone(this.component.legend.getSelectedMap()); - } - else { - this._selectedMap = {}; - } - }, - - _isSelected : function (itemName) { - if (typeof this._selectedMap[itemName] != 'undefined') { - return this._selectedMap[itemName]; - } - else { - return true; // 没在legend里定义的都为true啊~ - } - }, - - /** - * 模拟tooltip hover方法 - * {object} params 参数 - * {seriesIndex: 0, seriesName:'', dataInex:0} line、bar、scatter、k、radar - * {seriesIndex: 0, seriesName:'', name:''} map、pie、chord - */ - showTip : function (params) { - if (!params) { - return; - } - - var seriesIndex; - var series = this.option.series; - if (typeof params.seriesIndex != 'undefined') { - seriesIndex = params.seriesIndex; - } - else { - var seriesName = params.seriesName; - for (var i = 0, l = series.length; i < l; i++) { - if (series[i].name == seriesName) { - seriesIndex = i; - break; - } - } - } - - var serie = series[seriesIndex]; - if (typeof serie == 'undefined') { - return; - } - var chart = this.myChart.chart[serie.type]; - var isAxisTrigger = this.deepQuery( - [serie, this.option], 'tooltip.trigger' - ) == 'axis'; - - if (!chart) { - return; - } - - if (isAxisTrigger) { - // axis trigger - var dataIndex = params.dataIndex; - switch (chart.type) { - case ecConfig.CHART_TYPE_LINE : - case ecConfig.CHART_TYPE_BAR : - case ecConfig.CHART_TYPE_K : - if (typeof this.component.xAxis == 'undefined' - || typeof this.component.yAxis == 'undefined' - || serie.data.length <= dataIndex - ) { - return; - } - var xAxisIndex = serie.xAxisIndex || 0; - var yAxisIndex = serie.yAxisIndex || 0; - if (this.component.xAxis.getAxis(xAxisIndex).type - == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY - ) { - // 横轴是类目 - this._event = { - zrenderX : this.component.xAxis.getAxis(xAxisIndex) - .getCoordByIndex(dataIndex), - zrenderY : this.component.grid.getY() - + (this.component.grid.getYend() - - this.component.grid.getY() - ) / 4 - }; - } - else { - // 纵轴是类目 - this._event = { - zrenderX : this.component.grid.getX() - + (this.component.grid.getXend() - - this.component.grid.getX() - ) / 4, - zrenderY : this.component.yAxis.getAxis(yAxisIndex) - .getCoordByIndex(dataIndex) - }; - } - this._showAxisTrigger( - xAxisIndex, - yAxisIndex, - dataIndex - ); - break; - case ecConfig.CHART_TYPE_RADAR : - if (typeof this.component.polar == 'undefined' - || serie.data[0].value.length <= dataIndex - ) { - return; - } - var polarIndex = serie.polarIndex || 0; - var vector = this.component.polar.getVector( - polarIndex, dataIndex, 'max' - ); - this._event = { - zrenderX : vector[0], - zrenderY : vector[1] - }; - this._showPolarTrigger( - polarIndex, - dataIndex - ); - break; - } - } - else { - // item trigger - var shapeList = chart.shapeList; - var x; - var y; - switch (chart.type) { - case ecConfig.CHART_TYPE_LINE : - case ecConfig.CHART_TYPE_BAR : - case ecConfig.CHART_TYPE_K : - case ecConfig.CHART_TYPE_SCATTER : - var dataIndex = params.dataIndex; - for (var i = 0, l = shapeList.length; i < l; i++) { - if (ecData.get(shapeList[i], 'seriesIndex') == seriesIndex - && ecData.get(shapeList[i], 'dataIndex') == dataIndex - ) { - this._curTarget = shapeList[i]; - x = shapeList[i].style.x; - y = chart.type != ecConfig.CHART_TYPE_K - ? shapeList[i].style.y : shapeList[i].style.y[0]; - break; - } - } - break; - case ecConfig.CHART_TYPE_RADAR : - var dataIndex = params.dataIndex; - for (var i = 0, l = shapeList.length; i < l; i++) { - if (shapeList[i].type == 'polygon' - && ecData.get(shapeList[i], 'seriesIndex') == seriesIndex - && ecData.get(shapeList[i], 'dataIndex') == dataIndex - ) { - this._curTarget = shapeList[i]; - var vector = this.component.polar.getCenter( - serie.polarIndex || 0 - ); - x = vector[0]; - y = vector[1]; - break; - } - } - break; - case ecConfig.CHART_TYPE_PIE : - var name = params.name; - for (var i = 0, l = shapeList.length; i < l; i++) { - if (shapeList[i].type == 'sector' - && ecData.get(shapeList[i], 'seriesIndex') == seriesIndex - && ecData.get(shapeList[i], 'name') == name - ) { - this._curTarget = shapeList[i]; - var style = this._curTarget.style; - var midAngle = (style.startAngle + style.endAngle) - / 2 * Math.PI / 180; - x = this._curTarget.style.x + Math.cos(midAngle) * style.r / 1.5; - y = this._curTarget.style.y - Math.sin(midAngle) * style.r / 1.5; - break; - } - } - break; - case ecConfig.CHART_TYPE_MAP : - var name = params.name; - var mapType = serie.mapType; - for (var i = 0, l = shapeList.length; i < l; i++) { - if (shapeList[i].type == 'text' - && shapeList[i]._mapType == mapType - && shapeList[i].style._name == name - ) { - this._curTarget = shapeList[i]; - x = this._curTarget.style.x + this._curTarget.position[0]; - y = this._curTarget.style.y + this._curTarget.position[1]; - break; - } - } - break; - case ecConfig.CHART_TYPE_CHORD: - var name = params.name; - for (var i = 0, l = shapeList.length; i < l; i++) { - if (shapeList[i].type == 'sector' - && ecData.get(shapeList[i], 'name') == name - ) { - this._curTarget = shapeList[i]; - var style = this._curTarget.style; - var midAngle = (style.startAngle + style.endAngle) - / 2 * Math.PI / 180; - x = this._curTarget.style.x + Math.cos(midAngle) * (style.r - 2); - y = this._curTarget.style.y - Math.sin(midAngle) * (style.r - 2); - this.zr.trigger( - zrConfig.EVENT.MOUSEMOVE, - { - zrenderX : x, - zrenderY : y - } - ); - return; - } - } - break; - case ecConfig.CHART_TYPE_FORCE: - var name = params.name; - for (var i = 0, l = shapeList.length; i < l; i++) { - if (shapeList[i].type == 'circle' - && ecData.get(shapeList[i], 'name') == name - ) { - this._curTarget = shapeList[i]; - x = this._curTarget.position[0]; - y = this._curTarget.position[1]; - break; - } - } - break; - } - if (typeof x != 'undefined' && typeof y != 'undefined') { - this._event = { - zrenderX : x, - zrenderY : y - }; - this.zr.addHoverShape(this._curTarget); - this.zr.refreshHover(); - this._showItemTrigger(); - } - } - }, - - /** - * 关闭,公开接口 - */ - hideTip : function () { - this._hide(); - }, - - /** - * 刷新 - */ - refresh : function (newOption) { - // this._selectedMap; - // this._defaultCssText; // css样式缓存 - // this._needAxisTrigger; // 坐标轴触发 - // this._curTarget; - // this._event; - // this._curTicket; // 异步回调标识,用来区分多个请求 - - // 缓存一些高宽数据 - this._zrHeight = this.zr.getHeight(); - this._zrWidth = this.zr.getWidth(); - - if (this._lastTipShape && this._lastTipShape.tipShape.length > 0) { - this.zr.delShape(this._lastTipShape.tipShape); - } - this._lastTipShape = false; - this.shapeList.length = 2; - - if (newOption) { - this.option = newOption; - this.option.tooltip = this.reformOption(this.option.tooltip); - this.option.tooltip.textStyle = zrUtil.merge( - this.option.tooltip.textStyle, - this.ecTheme.textStyle - ); - // 补全padding属性 - this.option.tooltip.padding = this.reformCssArray( - this.option.tooltip.padding - ); - - this._needAxisTrigger = false; - if (this.option.tooltip.trigger == 'axis') { - this._needAxisTrigger = true; - } - - var series = this.option.series; - for (var i = 0, l = series.length; i < l; i++) { - if (this.query(series[i], 'tooltip.trigger') == 'axis') { - this._needAxisTrigger = true; - break; - } - } - // this._hidingTicket; - // this._showingTicket; - this._showDelay = this.option.tooltip.showDelay; // 显示延迟 - this._hideDelay = this.option.tooltip.hideDelay; // 隐藏延迟 - this._defaultCssText = this._style(this.option.tooltip); - - this._setSelectedMap(); - this._axisLineWidth = this.option.tooltip.axisPointer.lineStyle.width; - } - if (this.showing) { - this._tryShow(); - } - }, - - /** - * 释放后实例不可用,重载基类方法 - */ - dispose : function () { - if (this._lastTipShape && this._lastTipShape.tipShape.length > 0) { - this.zr.delShape(this._lastTipShape.tipShape); - } - this.clear(); - this.shapeList = null; - - clearTimeout(this._hidingTicket); - clearTimeout(this._showingTicket); - this.zr.un(zrConfig.EVENT.MOUSEMOVE, this._onmousemove); - this.zr.un(zrConfig.EVENT.GLOBALOUT, this._onglobalout); - - if (this.hasAppend) { - this.dom.firstChild.removeChild(this._tDom); - } - this._tDom = null; - }, - - /** - * html转码的方法 - */ - _encodeHTML : function (source) { - return String(source) - .replace(/&/g, '&') - .replace(//g, '>') - .replace(/"/g, '"') - .replace(/'/g, '''); - } - }; - - zrUtil.inherits(Tooltip, Base); - - require('../component').define('tooltip', Tooltip); - - return Tooltip; -}); -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:圆环 - * 可配图形属性: - { - // 基础属性 - shape : 'ring', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,圆心横坐标 - y : {number}, // 必须,圆心纵坐标 - r0 : {number}, // 必须,内圆半径 - r : {number}, // 必须,外圆半径 - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为outside,附加文本位置。 - // outside | inside - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'ring', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - r : 50, - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - 'zrender/shape/Ring',['require','./Base','../tool/util'],function (require) { - var Base = require('./Base'); - - function Ring(options) { - Base.call(this, options); - } - - Ring.prototype = { - type: 'ring', - - /** - * 创建圆环路径,依赖扇形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - // 非零环绕填充优化 - ctx.arc(style.x, style.y, style.r, 0, Math.PI * 2, false); - ctx.moveTo(style.x + style.r0, style.y); - ctx.arc(style.x, style.y, style.r0, 0, Math.PI * 2, true); - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function(style) { - if (style.__rect) { - return style.__rect; - } - - var lineWidth; - if (style.brushType == 'stroke' || style.brushType == 'fill') { - lineWidth = style.lineWidth || 1; - } - else { - lineWidth = 0; - } - style.__rect = { - x : Math.round(style.x - style.r - lineWidth / 2), - y : Math.round(style.y - style.r - lineWidth / 2), - width : style.r * 2 + lineWidth, - height : style.r * 2 + lineWidth - }; - - return style.__rect; - } - }; - - require('../tool/util').inherits(Ring, Base); - return Ring; - } -); -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:扇形 - * 可配图形属性: - { - // 基础属性 - shape : 'sector', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,圆心横坐标 - y : {number}, // 必须,圆心纵坐标 - r0 : {number}, // 默认为0,内圆半径,指定后将出现内弧,同时扇边长度 = r - r0 - r : {number}, // 必须,外圆半径 - startAngle : {number}, // 必须,起始角度[0, 360) - endAngle : {number}, // 必须,结束角度(0, 360] - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为outside,附加文本位置。 - // outside | inside - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'sector', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - r : 50, - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - 'zrender/shape/Sector',['require','../tool/math','./Base','./Ring','./Polygon','../tool/util'],function (require) { - var math = require('../tool/math'); - var Base = require('./Base'); - - function Sector(options) { - Base.call(this, options); - } - - Sector.prototype = { - type: 'sector', - - /** - * 创建扇形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - var x = style.x; // 圆心x - var y = style.y; // 圆心y - var r0 = typeof style.r0 == 'undefined' // 形内半径[0,r) - ? 0 : style.r0; - var r = style.r; // 扇形外半径(0,r] - var startAngle = style.startAngle; // 起始角度[0,360) - var endAngle = style.endAngle; // 结束角度(0,360] - - if (Math.abs(endAngle - startAngle) >= 360) { - // 大于360度的扇形简化为圆环画法 - ctx.arc(x, y, r, 0, Math.PI * 2, false); - if (r0 !== 0) { - ctx.moveTo(x + r0, y); - ctx.arc(x, y, r0, 0, Math.PI * 2, true); - } - return; - } - - startAngle = math.degreeToRadian(startAngle); - endAngle = math.degreeToRadian(endAngle); - - var PI2 = Math.PI * 2; - var cosStartAngle = math.cos(startAngle); - var sinStartAngle = math.sin(startAngle); - ctx.moveTo( - cosStartAngle * r0 + x, - y - sinStartAngle * r0 - ); - - ctx.lineTo( - cosStartAngle * r + x, - y - sinStartAngle * r - ); - - ctx.arc(x, y, r, PI2 - startAngle, PI2 - endAngle, true); - - ctx.lineTo( - math.cos(endAngle) * r0 + x, - y - math.sin(endAngle) * r0 - ); - - if (r0 !== 0) { - ctx.arc(x, y, r0, PI2 - endAngle, PI2 - startAngle, false); - } - - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function(style) { - if (style.__rect) { - return style.__rect; - } - - var x = style.x; // 圆心x - var y = style.y; // 圆心y - var r0 = typeof style.r0 == 'undefined' // 形内半径[0,r) - ? 0 : style.r0; - var r = style.r; // 扇形外半径(0,r] - var startAngle = style.startAngle; // 起始角度[0,360) - var endAngle = style.endAngle; // 结束角度(0,360] - - if (Math.abs(endAngle - startAngle) >= 360) { - // 大于360度的扇形简化为圆环bbox - style.__rect = require('./Ring').prototype.getRect(style); - return style.__rect; - } - - startAngle = (720 + startAngle) % 360; - endAngle = (720 + endAngle) % 360; - if (endAngle <= startAngle) { - endAngle += 360; - } - var pointList = []; - if (startAngle <= 90 && endAngle >= 90) { - pointList.push([ - x, y - r - ]); - } - if (startAngle <= 180 && endAngle >= 180) { - pointList.push([ - x - r, y - ]); - } - if (startAngle <= 270 && endAngle >= 270) { - pointList.push([ - x, y + r - ]); - } - if (startAngle <= 360 && endAngle >= 360) { - pointList.push([ - x + r, y - ]); - } - - startAngle = math.degreeToRadian(startAngle); - endAngle = math.degreeToRadian(endAngle); - - - pointList.push([ - math.cos(startAngle) * r0 + x, - y - math.sin(startAngle) * r0 - ]); - - pointList.push([ - math.cos(startAngle) * r + x, - y - math.sin(startAngle) * r - ]); - - pointList.push([ - math.cos(endAngle) * r + x, - y - math.sin(endAngle) * r - ]); - - pointList.push([ - math.cos(endAngle) * r0 + x, - y - math.sin(endAngle) * r0 - ]); - - style.__rect = require('./Polygon').prototype.getRect({ - brushType : style.brushType, - lineWidth : style.lineWidth, - pointList : pointList - }); - - return style.__rect; - } - }; - - - require('../tool/util').inherits(Sector, Base); - return Sector; - } -); -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:蜡烛 - * 可配图形属性: - { - // 基础属性 - shape : 'candle', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,横坐标 - y : {Array}, // 必须,纵坐标数组 - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'candle', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : [100,123,90,125], - width : 150, - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function (eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define('echarts/util/shape/Candle',['require','zrender/shape/Base','zrender/tool/util','./normalIsCover'],function (require) { - var Base = require('zrender/shape/Base'); - var zrUtil = require('zrender/tool/util'); - - function Candle(options) { - Base.call(this, options); - } - - Candle.prototype = { - type: 'candle', - _numberOrder : function (a, b) { - return b - a; - }, - - /** - * 创建矩形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function (ctx, style) { - var yList = zrUtil.clone(style.y).sort(this._numberOrder); - - ctx.moveTo(style.x, yList[3]); - ctx.lineTo(style.x, yList[2]); - ctx.moveTo(style.x - style.width / 2, yList[2]); - ctx.rect( - style.x - style.width / 2, - yList[2], - style.width, - yList[1] - yList[2] - ); - ctx.moveTo(style.x, yList[1]); - ctx.lineTo(style.x, yList[0]); - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function (style) { - if (!style.__rect) { - var lineWidth = 0; - if (style.brushType == 'stroke' || style.brushType == 'fill') { - lineWidth = style.lineWidth || 1; - } - - var yList = zrUtil.clone(style.y).sort(this._numberOrder); - style.__rect = { - x : Math.round(style.x - style.width / 2 - lineWidth / 2), - y : Math.round(yList[3] - lineWidth / 2), - width : style.width + lineWidth, - height : yList[0] - yList[3] + lineWidth - }; - } - - return style.__rect; - }, - - - isCover : require('./normalIsCover') - }; - - zrUtil.inherits(Candle, Base); - - return Candle; -}); - -/** - * echarts组件:图例 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/component/legend',['require','./base','zrender/shape/Text','zrender/shape/Rectangle','zrender/shape/Sector','../util/shape/Icon','../util/shape/Candle','../config','zrender/tool/util','zrender/tool/area','../component'],function (require) { - var Base = require('./base'); - - // 图形依赖 - var TextShape = require('zrender/shape/Text'); - var RectangleShape = require('zrender/shape/Rectangle'); - var SectorShape = require('zrender/shape/Sector'); - //var BeziercurveShape = require('zrender/shape/Beziercurve'); - var IconShape = require('../util/shape/Icon'); - var CandleShape = require('../util/shape/Candle'); - - var ecConfig = require('../config'); - var zrUtil = require('zrender/tool/util'); - var zrArea = require('zrender/tool/area'); - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} option 图表参数 - */ - function Legend(ecTheme, messageCenter, zr, option, myChart) { - if (!this.query(option, 'legend.data')) { - console.error('option.legend.data has not been defined.'); - return; - } - - Base.call(this, ecTheme, messageCenter, zr, option, myChart); - - var self = this; - self._legendSelected = function (param) { - self.__legendSelected(param); - }; - - this._colorIndex = 0; - this._colorMap = {}; - this._selectedMap = {}; - - this.refresh(option); - } - - Legend.prototype = { - type : ecConfig.COMPONENT_TYPE_LEGEND, - _buildShape : function () { - // 图例元素组的位置参数,通过计算所得x, y, width, height - this._itemGroupLocation = this._getItemGroupLocation(); - - this._buildBackground(); - this._buildItem(); - - for (var i = 0, l = this.shapeList.length; i < l; i++) { - this.zr.addShape(this.shapeList[i]); - } - }, - - /** - * 构建所有图例元素 - */ - _buildItem : function () { - var data = this.legendOption.data; - var dataLength = data.length; - var itemName; - var itemType; - var itemShape; - var textShape; - var textStyle = this.legendOption.textStyle; - var dataTextStyle; - var dataFont; - var formattedName; - - var zrWidth = this.zr.getWidth(); - var zrHeight = this.zr.getHeight(); - var lastX = this._itemGroupLocation.x; - var lastY = this._itemGroupLocation.y; - var itemWidth = this.legendOption.itemWidth; - var itemHeight = this.legendOption.itemHeight; - var itemGap = this.legendOption.itemGap; - var color; - - if (this.legendOption.orient == 'vertical' && this.legendOption.x == 'right') { - lastX = this._itemGroupLocation.x - + this._itemGroupLocation.width - - itemWidth; - } - - for (var i = 0; i < dataLength; i++) { - dataTextStyle = zrUtil.merge( - data[i].textStyle || {}, - textStyle - ); - dataFont = this.getFont(dataTextStyle); - - itemName = this._getName(data[i]); - formattedName = this._getFormatterName(itemName); - if (itemName === '') { - if (this.legendOption.orient == 'horizontal') { - lastX = this._itemGroupLocation.x; - lastY += itemHeight + itemGap; - } - else { - this.legendOption.x == 'right' - ? lastX -= this._itemGroupLocation.maxWidth + itemGap - : lastX += this._itemGroupLocation.maxWidth + itemGap; - lastY = this._itemGroupLocation.y; - } - continue; - } - itemType = data[i].icon || this._getSomethingByName(itemName).type; - - color = this.getColor(itemName); - - if (this.legendOption.orient == 'horizontal') { - if (zrWidth - lastX < 200 // 最后200px做分行预判 - && (itemWidth + 5 + zrArea.getTextWidth(formattedName, dataFont) - // 分行的最后一个不用算itemGap - + (i == dataLength - 1 || data[i+1] === '' ? 0 : itemGap) - ) >= zrWidth - lastX - ) { - lastX = this._itemGroupLocation.x; - lastY += itemHeight + itemGap; - } - } - else { - if (zrHeight - lastY < 200 // 最后200px做分行预判 - && (itemHeight - // 分行的最后一个不用算itemGap - + (i == dataLength - 1 || data[i+1] === '' ? 0 : itemGap) - ) >= zrHeight - lastY - ) { - this.legendOption.x == 'right' - ? lastX -= this._itemGroupLocation.maxWidth + itemGap - : lastX += this._itemGroupLocation.maxWidth + itemGap; - lastY = this._itemGroupLocation.y; - } - } - - // 图形 - itemShape = this._getItemShapeByType( - lastX, lastY, - itemWidth, itemHeight, - (this._selectedMap[itemName] ? color : '#ccc'), - itemType, - color - ); - itemShape._name = itemName; - itemShape = new IconShape(itemShape); - - // 文字 - textShape = { - // shape : 'text', - zlevel : this._zlevelBase, - style : { - x : lastX + itemWidth + 5, - y : lastY + itemHeight / 2, - color : this._selectedMap[itemName] - ? (dataTextStyle.color === 'auto' ? color : dataTextStyle.color) - : '#ccc', - text: formattedName, - textFont: dataFont, - textBaseline: 'middle' - }, - highlightStyle : { - color : color, - brushType: 'fill' - }, - hoverable : !!this.legendOption.selectedMode, - clickable : !!this.legendOption.selectedMode - }; - - if (this.legendOption.orient == 'vertical' - && this.legendOption.x == 'right' - ) { - textShape.style.x -= (itemWidth + 10); - textShape.style.textAlign = 'right'; - } - - textShape._name = itemName; - textShape = new TextShape(textShape); - - if (this.legendOption.selectedMode) { - itemShape.onclick = textShape.onclick = this._legendSelected; - itemShape.onmouseover = textShape.onmouseover = this.hoverConnect; - itemShape.hoverConnect = textShape.id; - textShape.hoverConnect = itemShape.id; - } - this.shapeList.push(itemShape); - this.shapeList.push(textShape); - - if (this.legendOption.orient == 'horizontal') { - lastX += itemWidth + 5 - + zrArea.getTextWidth(formattedName, dataFont) - + itemGap; - } - else { - lastY += itemHeight + itemGap; - } - } - - if (this.legendOption.orient == 'horizontal' - && this.legendOption.x == 'center' - && lastY != this._itemGroupLocation.y - ) { - // 多行橫排居中优化 - this._mLineOptimize(); - } - }, - - _getName : function(data) { - return typeof data.name != 'undefined' ? data.name : data; - }, - - _getFormatterName: function(itemName) { - var formatter = this.legendOption.formatter; - var formattedName; - if (typeof formatter == 'function') { - formattedName = formatter.call(this.myChart, itemName); - } - else if (typeof formatter == 'string') { - formattedName = formatter.replace('{name}', itemName); - } - else { - formattedName = itemName; - } - return formattedName; - }, - - _getFormatterNameFromData: function(data) { - var itemName = this._getName(data); - return this._getFormatterName(itemName); - }, - - // 多行橫排居中优化 - _mLineOptimize : function () { - var lineOffsetArray = []; // 每行宽度 - var lastX = this._itemGroupLocation.x; - for (var i = 2, l = this.shapeList.length; i < l; i++) { - if (this.shapeList[i].style.x == lastX) { - lineOffsetArray.push( - ( - this._itemGroupLocation.width - - ( - this.shapeList[i - 1].style.x - + zrArea.getTextWidth( - this.shapeList[i - 1].style.text, - this.shapeList[i - 1].style.textFont - ) - - lastX - ) - ) / 2 - ); - } - else if (i == l - 1) { - lineOffsetArray.push( - ( - this._itemGroupLocation.width - - ( - this.shapeList[i].style.x - + zrArea.getTextWidth( - this.shapeList[i].style.text, - this.shapeList[i].style.textFont - ) - - lastX - ) - ) / 2 - ); - } - } - var curLineIndex = -1; - for (var i = 1, l = this.shapeList.length; i < l; i++) { - if (this.shapeList[i].style.x == lastX) { - curLineIndex++; - } - if (lineOffsetArray[curLineIndex] === 0) { - continue; - } - else { - this.shapeList[i].style.x += lineOffsetArray[curLineIndex]; - } - } - }, - - _buildBackground : function () { - var pTop = this.legendOption.padding[0]; - var pRight = this.legendOption.padding[1]; - var pBottom = this.legendOption.padding[2]; - var pLeft = this.legendOption.padding[3]; - - this.shapeList.push(new RectangleShape({ - zlevel : this._zlevelBase, - hoverable :false, - style : { - x : this._itemGroupLocation.x - pLeft, - y : this._itemGroupLocation.y - pTop, - width : this._itemGroupLocation.width + pLeft + pRight, - height : this._itemGroupLocation.height + pTop + pBottom, - brushType : this.legendOption.borderWidth === 0 ? 'fill' : 'both', - color : this.legendOption.backgroundColor, - strokeColor : this.legendOption.borderColor, - lineWidth : this.legendOption.borderWidth - } - })); - }, - - /** - * 根据选项计算图例实体的位置坐标 - */ - _getItemGroupLocation : function () { - var data = this.legendOption.data; - var dataLength = data.length; - var itemGap = this.legendOption.itemGap; - var itemWidth = this.legendOption.itemWidth + 5; // 5px是图形和文字的间隔,不可配 - var itemHeight = this.legendOption.itemHeight; - var textStyle = this.legendOption.textStyle; - var font = this.getFont(textStyle); - var totalWidth = 0; - var totalHeight = 0; - var padding = this.legendOption.padding; - var zrWidth = this.zr.getWidth() - padding[1] - padding[3]; - var zrHeight = this.zr.getHeight() - padding[0] - padding[2]; - - var temp = 0; // 宽高计算,用于多行判断 - var maxWidth = 0; // 垂直布局有用 - if (this.legendOption.orient == 'horizontal') { - // 水平布局,计算总宽度 - totalHeight = itemHeight; - for (var i = 0; i < dataLength; i++) { - if (this._getName(data[i]) === '') { - temp -= itemGap; - if (temp > zrWidth) { - totalWidth = zrWidth; - totalHeight += itemHeight + itemGap; - } - else { - totalWidth = Math.max(totalWidth, temp); - } - totalHeight += itemHeight + itemGap; - temp = 0; - continue; - } - temp += itemWidth - + zrArea.getTextWidth( - this._getFormatterNameFromData(data[i]), - data[i].textStyle - ? this.getFont(zrUtil.merge( - data[i].textStyle || {}, - textStyle - )) - : font - ) - + itemGap; - } - totalHeight = Math.max(totalHeight, itemHeight); - temp -= itemGap; // 减去最后一个的itemGap - if (temp > zrWidth) { - totalWidth = zrWidth; - totalHeight += itemHeight + itemGap; - } else { - totalWidth = Math.max(totalWidth, temp); - } - } - else { - // 垂直布局,计算总高度 - for (var i = 0; i < dataLength; i++) { - maxWidth = Math.max( - maxWidth, - zrArea.getTextWidth( - this._getFormatterNameFromData(data[i]), - data[i].textStyle - ? this.getFont(zrUtil.merge( - data[i].textStyle || {}, - textStyle - )) - : font - ) - ); - } - maxWidth += itemWidth; - totalWidth = maxWidth; - for (var i = 0; i < dataLength; i++) { - if (this._getName(data[i]) === '') { - temp -= itemGap; - if (temp > zrHeight) { - totalHeight = zrHeight; - totalWidth += maxWidth + itemGap; - } - else { - totalHeight = Math.max(totalHeight, temp); - } - totalWidth += maxWidth + itemGap; - temp = 0; - continue; - } - temp += itemHeight + itemGap; - } - totalWidth = Math.max(totalWidth, maxWidth); - temp -= itemGap; // 减去最后一个的itemGap - if (temp > zrHeight) { - totalHeight = zrHeight; - totalWidth += maxWidth + itemGap; - } else { - totalHeight = Math.max(totalHeight, temp); - } - } - - zrWidth = this.zr.getWidth(); - zrHeight = this.zr.getHeight(); - var x; - switch (this.legendOption.x) { - case 'center' : - x = Math.floor((zrWidth - totalWidth) / 2); - break; - case 'left' : - x = this.legendOption.padding[3] + this.legendOption.borderWidth; - break; - case 'right' : - x = zrWidth - - totalWidth - - this.legendOption.padding[1] - - this.legendOption.padding[3] - - this.legendOption.borderWidth * 2; - break; - default : - x = this.parsePercent(this.legendOption.x, zrWidth); - break; - } - - var y; - switch (this.legendOption.y) { - case 'top' : - y = this.legendOption.padding[0] + this.legendOption.borderWidth; - break; - case 'bottom' : - y = zrHeight - - totalHeight - - this.legendOption.padding[0] - - this.legendOption.padding[2] - - this.legendOption.borderWidth * 2; - break; - case 'center' : - y = Math.floor((zrHeight - totalHeight) / 2); - break; - default : - y = this.parsePercent(this.legendOption.y, zrHeight); - break; - } - - return { - x : x, - y : y, - width : totalWidth, - height : totalHeight, - maxWidth : maxWidth - }; - }, - - /** - * 根据名称返回series数据或data - */ - _getSomethingByName : function (name) { - var series = this.option.series; - var data; - for (var i = 0, l = series.length; i < l; i++) { - if (series[i].name == name) { - // 系列名称优先 - return { - type : series[i].type, - series : series[i], - seriesIndex : i, - data : null, - dataIndex : -1 - }; - } - - if ( - series[i].type == ecConfig.CHART_TYPE_PIE - || series[i].type == ecConfig.CHART_TYPE_RADAR - || series[i].type == ecConfig.CHART_TYPE_CHORD - || series[i].type == ecConfig.CHART_TYPE_FORCE - || series[i].type == ecConfig.CHART_TYPE_FUNNEL - ) { - data = series[i].type != ecConfig.CHART_TYPE_FORCE - ? series[i].data // 饼图、雷达图、和弦图得查找里面的数据名字 - : series[i].categories; // 力导布局查找categories配置 - for (var j = 0, k = data.length; j < k; j++) { - if (data[j].name == name) { - return { - type : series[i].type, - series : series[i], - seriesIndex : i, - data : data[j], - dataIndex : j - }; - } - } - } - } - return { - type : 'bar', - series : null, - seriesIndex : -1, - data : null, - dataIndex : -1 - }; - }, - - _getItemShapeByType : function (x, y, width, height, color, itemType, defaultColor) { - var highlightColor = color === '#ccc' ? defaultColor : color; - var itemShape = { - zlevel : this._zlevelBase, - style : { - iconType : 'legendicon' + itemType, - x : x, - y : y, - width : width, - height : height, - color : color, - strokeColor : color, - lineWidth : 2 - }, - highlightStyle: { - color : highlightColor, - strokeColor : highlightColor, - lineWidth : 1 - }, - hoverable : this.legendOption.selectedMode, - clickable : this.legendOption.selectedMode - }; - - var imageLocation; - if (itemType.match('image')) { - var imageLocation = itemType.replace( - new RegExp('^image:\\/\\/'), '' - ); - itemType = 'image'; - } - // 特殊设置 - switch (itemType) { - case 'line' : - itemShape.style.brushType = 'stroke'; - itemShape.highlightStyle.lineWidth = 3; - break; - case 'radar' : - case 'scatter' : - itemShape.highlightStyle.lineWidth = 3; - break; - case 'k' : - itemShape.style.brushType = 'both'; - itemShape.highlightStyle.lineWidth = 3; - itemShape.highlightStyle.color = - itemShape.style.color = this.query(this.ecTheme, 'k.itemStyle.normal.color') - || '#fff'; - itemShape.style.strokeColor = color != '#ccc' - ? (this.query(this.ecTheme, 'k.itemStyle.normal.lineStyle.color') - || '#ff3200') - : color; - break; - case 'image' : - itemShape.style.iconType = 'image'; - itemShape.style.image = imageLocation; - if (color === '#ccc') { - itemShape.style.opacity = 0.5; - } - break; - } - return itemShape; - }, - - __legendSelected : function (param) { - var itemName = param.target._name; - if (this.legendOption.selectedMode === 'single') { - for (var k in this._selectedMap) { - this._selectedMap[k] = false; - } - } - this._selectedMap[itemName] = !this._selectedMap[itemName]; - this.messageCenter.dispatch( - ecConfig.EVENT.LEGEND_SELECTED, - param.event, - { - selected : this._selectedMap, - target : itemName - }, - this.myChart - ); - }, - - /** - * 刷新 - */ - refresh : function (newOption) { - if (newOption) { - this.option = newOption || this.option; - this.option.legend = this.reformOption(this.option.legend); - // 补全padding属性 - this.option.legend.padding = this.reformCssArray( - this.option.legend.padding - ); - this.legendOption = this.option.legend; - - var data = this.legendOption.data || []; - var itemName; - var something; - var color; - var queryTarget; - if (this.legendOption.selected) { - for (var k in this.legendOption.selected) { - this._selectedMap[k] = typeof this._selectedMap[k] != 'undefined' - ? this._selectedMap[k] - : this.legendOption.selected[k]; - } - } - for (var i = 0, dataLength = data.length; i < dataLength; i++) { - itemName = this._getName(data[i]); - if (itemName === '') { - continue; - } - something = this._getSomethingByName(itemName); - if (!something.series) { - this._selectedMap[itemName] = false; - } - else { - if (something.data - && (something.type == ecConfig.CHART_TYPE_PIE - || something.type == ecConfig.CHART_TYPE_FORCE - || something.type == ecConfig.CHART_TYPE_FUNNEL) - ) { - queryTarget = [something.data, something.series]; - } - else { - queryTarget = [something.series]; - } - - color = this.getItemStyleColor( - this.deepQuery(queryTarget, 'itemStyle.normal.color'), - something.seriesIndex, - something.dataIndex, - something.data - ); - if (color && something.type != ecConfig.CHART_TYPE_K) { - this.setColor(itemName, color); - } - this._selectedMap[itemName] = - typeof this._selectedMap[itemName] != 'undefined' - ? this._selectedMap[itemName] : true; - } - } - } - this.clear(); - this._buildShape(); - }, - - getRelatedAmount : function(name) { - var amount = 0; - var series = this.option.series; - var data; - for (var i = 0, l = series.length; i < l; i++) { - if (series[i].name == name) { - // 系列名称优先 - amount++; - } - - if ( - series[i].type == ecConfig.CHART_TYPE_PIE - || series[i].type == ecConfig.CHART_TYPE_RADAR - || series[i].type == ecConfig.CHART_TYPE_CHORD - || series[i].type == ecConfig.CHART_TYPE_FORCE - || series[i].type == ecConfig.CHART_TYPE_FUNNEL - ) { - data = series[i].type != ecConfig.CHART_TYPE_FORCE - ? series[i].data // 饼图、雷达图、和弦图得查找里面的数据名字 - : series[i].categories; // 力导布局查找categories配置 - for (var j = 0, k = data.length; j < k; j++) { - if (data[j].name == name && data[j].value != '-') { - amount++; - } - } - } - } - return amount; - }, - - setColor : function (legendName, color) { - this._colorMap[legendName] = color; - }, - - getColor : function (legendName) { - if (!this._colorMap[legendName]) { - this._colorMap[legendName] = this.zr.getColor(this._colorIndex++); - } - return this._colorMap[legendName]; - }, - - hasColor : function (legendName) { - return this._colorMap[legendName] ? this._colorMap[legendName] : false; - }, - - add : function (name, color){ - var data = this.legendOption.data; - for (var i = 0, dataLength = data.length; i < dataLength; i++) { - if (this._getName(data[i]) == name) { - // 已有就不重复加了 - return; - } - } - this.legendOption.data.push(name); - this.setColor(name,color); - this._selectedMap[name] = true; - }, - - del : function (name){ - var data = this.legendOption.data; - for (var i = 0, dataLength = data.length; i < dataLength; i++) { - if (this._getName(data[i]) == name) { - return this.legendOption.data.splice(i, 1); - } - } - }, - - /** - * 特殊图形元素回调设置 - * @param {Object} name - * @param {Object} itemShape - */ - getItemShape : function (name) { - if (typeof name == 'undefined') { - return; - } - var shape; - for (var i = 0, l = this.shapeList.length; i < l; i++) { - shape = this.shapeList[i]; - if (shape._name == name && shape.type != 'text') { - return shape; - } - } - }, - - /** - * 特殊图形元素回调设置 - * @param {Object} name - * @param {Object} itemShape - */ - setItemShape : function (name, itemShape) { - var shape; - for (var i = 0, l = this.shapeList.length; i < l; i++) { - shape = this.shapeList[i]; - if (shape._name == name && shape.type != 'text') { - if (!this._selectedMap[name]) { - itemShape.style.color = '#ccc'; - itemShape.style.strokeColor = '#ccc'; - } - this.zr.modShape(shape.id, itemShape); - } - } - }, - - isSelected : function (itemName) { - if (typeof this._selectedMap[itemName] != 'undefined') { - return this._selectedMap[itemName]; - } - else { - // 没在legend里定义的都为true啊~ - return true; - } - }, - - getSelectedMap : function () { - return this._selectedMap; - }, - - setSelected : function(itemName, selectStatus) { - if (this.legendOption.selectedMode === 'single') { - for (var k in this._selectedMap) { - this._selectedMap[k] = false; - } - } - this._selectedMap[itemName] = selectStatus; - this.messageCenter.dispatch( - ecConfig.EVENT.LEGEND_SELECTED, - null, - { - selected : this._selectedMap, - target : itemName - }, - this.myChart - ); - }, - - /** - * 图例选择 - */ - onlegendSelected : function (param, status) { - var legendSelected = param.selected; - for (var itemName in legendSelected) { - if (this._selectedMap[itemName] != legendSelected[itemName]) { - // 有一项不一致都需要重绘 - status.needRefresh = true; - } - this._selectedMap[itemName] = legendSelected[itemName]; - } - return; - } - }; - - var legendIcon = { - line : function (ctx, style) { - var dy = style.height / 2; - ctx.moveTo(style.x, style.y + dy); - ctx.lineTo(style.x + style.width,style.y + dy); - }, - - pie : function (ctx, style) { - var x = style.x; - var y = style.y; - var width = style.width; - var height = style.height; - SectorShape.prototype.buildPath(ctx, { - x : x + width / 2, - y : y + height + 2, - r : height + 2, - r0 : 6, - startAngle : 45, - endAngle : 135 - }); - }, - /* - chord : function (ctx, style) { - var x = style.x; - var y = style.y; - var width = style.width; - var height = style.height; - ctx.moveTo(x, y + height); - BeziercurveShape.prototype.buildPath(ctx, { - xStart : x, - yStart : y + height, - cpX1 : x + width, - cpY1 : y + height, - cpX2 : x, - cpY2 : y + 4, - xEnd : x + width, - yEnd : y + 4 - }); - ctx.lineTo(x + width, y); - BeziercurveShape.prototype.buildPath(ctx, { - xStart : x + width, - yStart : y, - cpX1 : x, - cpY1 : y, - cpX2 : x + width, - cpY2 : y + height - 4, - xEnd : x, - yEnd : y + height - 4 - }); - ctx.lineTo(x, y + height); - }, - */ - k : function (ctx, style) { - var x = style.x; - var y = style.y; - var width = style.width; - var height = style.height; - CandleShape.prototype.buildPath(ctx, { - x : x + width / 2, - y : [y + 1, y + 1, y + height - 6, y + height], - width : width - 6 - }); - }, - - bar : function (ctx, style) { - var x = style.x; - var y = style.y +1; - var width = style.width; - var height = style.height - 2; - var r = 3; - - ctx.moveTo(x + r, y); - ctx.lineTo(x + width - r, y); - ctx.quadraticCurveTo( - x + width, y, x + width, y + r - ); - ctx.lineTo(x + width, y + height - r); - ctx.quadraticCurveTo( - x + width, y + height, x + width - r, y + height - ); - ctx.lineTo(x + r, y + height); - ctx.quadraticCurveTo( - x, y + height, x, y + height - r - ); - ctx.lineTo(x, y + r); - ctx.quadraticCurveTo(x, y, x + r, y); - }, - - force : function (ctx, style) { - IconShape.prototype.iconLibrary.circle(ctx, style); - }, - - radar: function (ctx, style) { - var n = 6; - var x = style.x + style.width / 2; - var y = style.y + style.height / 2; - var r = style.height / 2; - - var dStep = 2 * Math.PI / n; - var deg = -Math.PI / 2; - var xStart = x + r * Math.cos(deg); - var yStart = y + r * Math.sin(deg); - - ctx.moveTo(xStart, yStart); - deg += dStep; - for (var i = 0, end = n - 1; i < end; i ++) { - ctx.lineTo(x + r * Math.cos(deg), y + r * Math.sin(deg)); - deg += dStep; - } - ctx.lineTo(xStart, yStart); - } - }; - legendIcon.chord = legendIcon.pie; - legendIcon.map = legendIcon.bar; - - for (var k in legendIcon) { - IconShape.prototype.iconLibrary['legendicon' + k] = legendIcon[k]; - } - - zrUtil.inherits(Legend, Base); - - require('../component').define('legend', Legend); - - return Legend; -}); - - - -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:时间轴线 - */ -define('echarts/util/shape/Chain',['require','zrender/shape/Base','./Icon','zrender/shape/util/dashedLineTo','zrender/tool/util','zrender/tool/matrix'],function (require) { - var Base = require('zrender/shape/Base'); - var IconShape = require('./Icon'); - - var dashedLineTo = require('zrender/shape/util/dashedLineTo'); - var zrUtil = require('zrender/tool/util'); - var matrix = require('zrender/tool/matrix'); - - function Chain(options) { - Base.call(this, options); - } - - Chain.prototype = { - type : 'chain', - - /** - * 画刷 - * @param ctx 画布句柄 - * @param e 形状实体 - * @param isHighlight 是否为高亮状态 - * @param updateCallback 需要异步加载资源的shape可以通过这个callback(e) - * 让painter更新视图,base.brush没用,需要的话重载brush - */ - brush : function (ctx, isHighlight) { - var style = this.style; - - if (isHighlight) { - // 根据style扩展默认高亮样式 - style = this.getHighlightStyle( - style, - this.highlightStyle || {} - ); - } - - ctx.save(); - this.setContext(ctx, style); - - // 设置transform - this.setTransform(ctx); - - ctx.beginPath(); - this.buildLinePath(ctx, style); - ctx.stroke(); - - this.brushSymbol(ctx, style); - - ctx.restore(); - return; - }, - - /** - * 创建线条路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildLinePath : function (ctx, style) { - var x = style.x; - var y = style.y + 5; - var width = style.width; - var height = style.height / 2 - 10; - - ctx.moveTo(x, y); - ctx.lineTo(x, y + height); - ctx.moveTo(x + width, y); - ctx.lineTo(x + width, y + height); - - ctx.moveTo(x, y + height / 2); - if (!style.lineType || style.lineType == 'solid') { - ctx.lineTo(x + width, y + height / 2); - } - else if (style.lineType == 'dashed' || style.lineType == 'dotted') { - var dashLength = (style.lineWidth || 1) - * (style.lineType == 'dashed' ? 5 : 1); - dashedLineTo(ctx, x, y + height / 2, x + width, y + height / 2, dashLength); - } - }, - - /** - * 标线始末标注 - */ - brushSymbol : function (ctx, style) { - var y = style.y + style.height / 4; - ctx.save(); - - var chainPoint = style.chainPoint; - var curPoint; - for (var idx = 0, l = chainPoint.length; idx < l; idx++) { - curPoint = chainPoint[idx]; - if (curPoint.symbol != 'none') { - ctx.beginPath(); - var symbolSize = curPoint.symbolSize; - IconShape.prototype.buildPath( - ctx, - { - iconType : curPoint.symbol, - x : curPoint.x - symbolSize, - y : y - symbolSize, - width : symbolSize * 2, - height : symbolSize * 2, - n : curPoint.n - } - ); - ctx.fillStyle = curPoint.isEmpty ? '#fff' : style.strokeColor; - ctx.closePath(); - ctx.fill(); - ctx.stroke(); - } - - if (curPoint.showLabel) { - ctx.font = curPoint.textFont; - ctx.fillStyle = curPoint.textColor; - ctx.textAlign = curPoint.textAlign; - ctx.textBaseline = curPoint.textBaseline; - if (curPoint.rotation) { - ctx.save(); - this._updateTextTransform(ctx, curPoint.rotation); - ctx.fillText(curPoint.name, curPoint.textX, curPoint.textY); - ctx.restore(); - } - else { - ctx.fillText(curPoint.name, curPoint.textX, curPoint.textY); - } - } - } - - ctx.restore(); - }, - - _updateTextTransform : function (ctx, rotation) { - var _transform = matrix.create(); - matrix.identity(_transform); - - if (rotation[0] !== 0) { - var originX = rotation[1] || 0; - var originY = rotation[2] || 0; - if (originX || originY) { - matrix.translate( - _transform, _transform, [-originX, -originY] - ); - } - matrix.rotate(_transform, _transform, rotation[0]); - if (originX || originY) { - matrix.translate( - _transform, _transform, [originX, originY] - ); - } - } - - // 保存这个变换矩阵 - ctx.transform.apply(ctx, _transform); - }, - - isCover : function (x, y) { - var rect = this.style; - if (x >= rect.x - && x <= (rect.x + rect.width) - && y >= rect.y - && y <= (rect.y + rect.height) - ) { - // 矩形内 - return true; - } - else { - return false; - } - } - }; - - zrUtil.inherits(Chain, Base); - - return Chain; -}); - -/** - * echarts组件:时间轴组件 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle','../util/shape/Icon','../util/shape/Chain','../config','zrender/tool/util','zrender/tool/area','zrender/tool/event','../component'],function (require) { - var Base = require('./base'); - - // 图形依赖 - var RectangleShape = require('zrender/shape/Rectangle'); - var IconShape = require('../util/shape/Icon'); - var ChainShape = require('../util/shape/Chain'); - - var ecConfig = require('../config'); - var zrUtil = require('zrender/tool/util'); - var zrArea = require('zrender/tool/area'); - var zrEvent = require('zrender/tool/event'); - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} option 图表参数 - */ - function Timeline(ecTheme, messageCenter, zr, option, myChart) { - Base.call(this, ecTheme, messageCenter, zr, option, myChart); - - var self = this; - self._onclick = function(param) { - return self.__onclick(param); - }; - self._ondrift = function (dx, dy) { - return self.__ondrift(this, dx, dy); - }; - self._ondragend = function () { - return self.__ondragend(); - }; - self._setCurrentOption = function() { - var timelineOption = self.timelineOption; - self.currentIndex %= timelineOption.data.length; - // console.log(self.currentIndex); - var curOption = self.options[self.currentIndex] || {}; - self.myChart.setOption(curOption, timelineOption.notMerge); - - self.messageCenter.dispatch( - ecConfig.EVENT.TIMELINE_CHANGED, - null, - { - currentIndex: self.currentIndex, - data : typeof timelineOption.data[self.currentIndex].name != 'undefined' - ? timelineOption.data[self.currentIndex].name - : timelineOption.data[self.currentIndex] - }, - self.myChart - ); - }; - self._onFrame = function() { - self._setCurrentOption(); - self._syncHandleShape(); - - if (self.timelineOption.autoPlay) { - self.playTicket = setTimeout( - function() { - self.currentIndex += 1; - if (!self.timelineOption.loop - && self.currentIndex >= self.timelineOption.data.length - ) { - self.currentIndex = self.timelineOption.data.length - 1; - self.stop(); - return; - } - self._onFrame(); - }, - self.timelineOption.playInterval - ); - } - }; - - this.setTheme(false); - this.options = this.option.options; - this.currentIndex = this.timelineOption.currentIndex % this.timelineOption.data.length; - - if (!this.timelineOption.notMerge && this.currentIndex !== 0) { - /* - for (var i = 1, l = this.timelineOption.data.length; i < l; i++) { - this.options[i] = zrUtil.merge( - this.options[i], this.options[i - 1] - ); - } - */ - this.options[this.currentIndex] = zrUtil.merge( - this.options[this.currentIndex], this.options[0] - ); - } - - if (this.timelineOption.show) { - this._buildShape(); - this._syncHandleShape(); - } - - this._setCurrentOption(); - - if (this.timelineOption.autoPlay) { - var self = this; - this.playTicket = setTimeout( - function() { - self.play(); - }, - this.ecTheme.animationDuration - ); - } - } - - Timeline.prototype = { - type : ecConfig.COMPONENT_TYPE_TIMELINE, - _buildShape : function () { - // 位置参数,通过计算所得x, y, width, height - this._location = this._getLocation(); - this._buildBackground(); - this._buildControl(); - this._chainPoint = this._getChainPoint(); - if (this.timelineOption.label.show) { - // 标签显示的挑选间隔 - var interval = this._getInterval(); - for (var i = 0, len = this._chainPoint.length; i < len; i += interval) { - this._chainPoint[i].showLabel = true; - } - } - this._buildChain(); - this._buildHandle(); - - for (var i = 0, l = this.shapeList.length; i < l; i++) { - this.zr.addShape(this.shapeList[i]); - } - }, - - /** - * 根据选项计算实体的位置坐标 - */ - _getLocation : function () { - var timelineOption = this.timelineOption; - var padding = timelineOption.padding; - - // 水平布局 - var zrWidth = this.zr.getWidth(); - var x = this.parsePercent(timelineOption.x, zrWidth); - var x2 = this.parsePercent(timelineOption.x2, zrWidth); - var width; - if (typeof timelineOption.width == 'undefined') { - width = zrWidth - x - x2; - x2 = zrWidth - x2; - } - else { - width = this.parsePercent(timelineOption.width, zrWidth); - x2 = x + width; - } - - var zrHeight = this.zr.getHeight(); - var height = this.parsePercent(timelineOption.height, zrHeight); - var y; - var y2; - if (typeof timelineOption.y != 'undefined') { - y = this.parsePercent(timelineOption.y, zrHeight); - y2 = y + height; - } - else { - y2 = zrHeight - this.parsePercent(timelineOption.y2, zrHeight); - y = y2 - height; - } - - return { - x : x + padding[3], - y : y + padding[0], - x2 : x2 - padding[1], - y2 : y2 - padding[2], - width : width - padding[1] - padding[3], - height : height - padding[0] - padding[2] - }; - }, - - _getReformedLabel : function (idx) { - var timelineOption = this.timelineOption; - var data = typeof timelineOption.data[idx].name != 'undefined' - ? timelineOption.data[idx].name - : timelineOption.data[idx]; - var formatter = timelineOption.data[idx].formatter - || timelineOption.label.formatter; - if (formatter) { - if (typeof formatter == 'function') { - data = formatter.call(this.myChart, data); - } - else if (typeof formatter == 'string') { - data = formatter.replace('{value}', data); - } - } - return data; - }, - - /** - * 计算标签显示挑选间隔 - */ - _getInterval : function () { - var chainPoint = this._chainPoint; - var timelineOption = this.timelineOption; - var interval = timelineOption.label.interval; - if (interval == 'auto') { - // 麻烦的自适应计算 - var fontSize = timelineOption.label.textStyle.fontSize; - var data = timelineOption.data; - var dataLength = timelineOption.data.length; - - // 横向 - if (dataLength > 3) { - var isEnough = false; - var labelSpace; - var labelSize; - interval = 0; - while (!isEnough && interval < dataLength) { - interval++; - isEnough = true; - for (var i = interval; i < dataLength; i += interval) { - labelSpace = chainPoint[i].x - chainPoint[i - interval].x; - if (timelineOption.label.rotate !== 0) { - // 有旋转 - labelSize = fontSize; - } - else if (data[i].textStyle) { - labelSize = zrArea.getTextWidth( - chainPoint[i].name, - chainPoint[i].textFont - ); - } - else { - // 不定义data级特殊文本样式,用fontSize优化getTextWidth - var label = chainPoint[i].name + ''; - var wLen = (label.match(/\w/g) || '').length; - var oLen = label.length - wLen; - labelSize = wLen * fontSize * 2 / 3 + oLen * fontSize; - } - - if (labelSpace < labelSize) { - // 放不下,中断循环让interval++ - isEnough = false; - break; - } - } - } - } - else { - // 少于3个则全部显示 - interval = 1; - } - } - else { - // 用户自定义间隔 - interval = interval - 0 + 1; - } - - return interval; - }, - - /** - * 根据选项计算时间链条上的坐标及symbolList - */ - _getChainPoint : function() { - var timelineOption = this.timelineOption; - var symbol = timelineOption.symbol.toLowerCase(); - var symbolSize = timelineOption.symbolSize; - var rotate = timelineOption.label.rotate; - var textStyle = timelineOption.label.textStyle; - var textFont = this.getFont(textStyle); - var dataTextStyle; - var data = timelineOption.data; - var x = this._location.x; - var y = this._location.y + this._location.height / 4 * 3; - var width = this._location.x2 - this._location.x; - var len = data.length; - - function _getName(i) { - return typeof data[i].name != 'undefined' ? data[i].name : data[i]; - } - var xList = []; - if (len > 1) { - var boundaryGap = width / len; - boundaryGap = boundaryGap > 50 ? 50 : (boundaryGap < 20 ? 5 : boundaryGap); - width -= boundaryGap * 2; - if (timelineOption.type == 'number') { - // 平均分布 - for (var i = 0; i < len; i++) { - xList.push(x + boundaryGap + width / (len - 1) * i); - } - } - else { - // 时间比例 - xList[0] = new Date(_getName(0).replace(/-/g, '/')); - xList[len - 1] = new Date(_getName(len - 1).replace(/-/g, '/')) - xList[0]; - for (var i = 1; i < len; i++) { - xList[i] = x + boundaryGap - + width - * (new Date(_getName(i).replace(/-/g, '/')) - xList[0]) - / xList[len - 1]; - } - xList[0] = x + boundaryGap; - } - } - else { - xList.push(x + width / 2); - } - - var list = []; - var curSymbol; - var n; - var isEmpty; - var textAlign; - var rotation; - for (var i = 0; i < len; i++) { - x = xList[i]; - curSymbol = (data[i].symbol && data[i].symbol.toLowerCase()) || symbol; - if (curSymbol.match('empty')) { - curSymbol = curSymbol.replace('empty', ''); - isEmpty = true; - } - else { - isEmpty = false; - } - if (curSymbol.match('star')) { - n = (curSymbol.replace('star','') - 0) || 5; - curSymbol = 'star'; - } - - dataTextStyle = data[i].textStyle - ? zrUtil.merge(data[i].textStyle || {}, textStyle) - : textStyle; - - textAlign = dataTextStyle.align || 'center'; - - if (rotate) { - textAlign = rotate > 0 ? 'right' : 'left'; - rotation = [rotate * Math.PI / 180, x, y - 5]; - } - else { - rotation = false; - } - - list.push({ - x : x, - n : n, - isEmpty : isEmpty, - symbol : curSymbol, - symbolSize : data[i].symbolSize || symbolSize, - color : data[i].color, - borderColor : data[i].borderColor, - borderWidth : data[i].borderWidth, - name : this._getReformedLabel(i), - textColor : dataTextStyle.color, - textAlign : textAlign, - textBaseline : dataTextStyle.baseline || 'middle', - textX : x, - textY : y - (rotate ? 5 : 0), - textFont : data[i].textStyle ? this.getFont(dataTextStyle) : textFont, - rotation : rotation, - showLabel : false - }); - } - - return list; - }, - - _buildBackground : function () { - var timelineOption = this.timelineOption; - var padding = timelineOption.padding; - var width = this._location.width; - var height = this._location.height; - - if (timelineOption.borderWidth !== 0 - || timelineOption.backgroundColor.replace(/\s/g,'') != 'rgba(0,0,0,0)' - ) { - // 背景 - this.shapeList.push(new RectangleShape({ - zlevel : this._zlevelBase, - hoverable :false, - style : { - x : this._location.x - padding[3], - y : this._location.y - padding[0], - width : width + padding[1] + padding[3], - height : height + padding[0] + padding[2], - brushType : timelineOption.borderWidth === 0 - ? 'fill' : 'both', - color : timelineOption.backgroundColor, - strokeColor : timelineOption.borderColor, - lineWidth : timelineOption.borderWidth - } - })); - } - }, - - _buildControl : function() { - var self = this; - var timelineOption = this.timelineOption; - var lineStyle = timelineOption.lineStyle; - var controlStyle = timelineOption.controlStyle; - if (timelineOption.controlPosition == 'none') { - return; - } - var iconSize = 15; - var iconGap = 5; - var x; - if (timelineOption.controlPosition == 'left') { - x = this._location.x; - this._location.x += (iconSize + iconGap) * 3; - } - else { - x = this._location.x2 - ((iconSize + iconGap) * 3 - iconGap); - this._location.x2 -= (iconSize + iconGap) * 3; - } - - var y = this._location.y; - var iconStyle = { - zlevel : this._zlevelBase + 1, - style : { - iconType : 'timelineControl', - symbol : 'last', - x : x, - y : y, - width : iconSize, - height : iconSize, - brushType : 'stroke', - color: controlStyle.normal.color, - strokeColor : controlStyle.normal.color, - lineWidth : lineStyle.width - }, - highlightStyle : { - color : controlStyle.emphasis.color, - strokeColor : controlStyle.emphasis.color, - lineWidth : lineStyle.width + 1 - }, - clickable : true - }; - - this._ctrLastShape = new IconShape(iconStyle); - this._ctrLastShape.onclick = function() { - self.last(); - }; - this.shapeList.push(this._ctrLastShape); - - x += iconSize + iconGap; - this._ctrPlayShape = new IconShape(zrUtil.clone(iconStyle)); - this._ctrPlayShape.style.brushType = 'fill'; - this._ctrPlayShape.style.symbol = 'play'; - this._ctrPlayShape.style.status = this.timelineOption.autoPlay ? 'playing' : 'stop'; - this._ctrPlayShape.style.x = x; - this._ctrPlayShape.onclick = function() { - if (self._ctrPlayShape.style.status == 'stop') { - self.play(); - } - else { - self.stop(); - } - }; - this.shapeList.push(this._ctrPlayShape); - - x += iconSize + iconGap; - this._ctrNextShape = new IconShape(zrUtil.clone(iconStyle)); - this._ctrNextShape.style.symbol = 'next'; - this._ctrNextShape.style.x = x; - this._ctrNextShape.onclick = function() { - self.next(); - }; - this.shapeList.push(this._ctrNextShape); - }, - - /** - * 构建时间轴 - */ - _buildChain : function () { - var timelineOption = this.timelineOption; - var lineStyle = timelineOption.lineStyle; - this._timelineShae = { - zlevel : this._zlevelBase, - style : { - x : this._location.x, - y : this.subPixelOptimize(this._location.y, lineStyle.width), - width : this._location.x2 - this._location.x, - height : this._location.height, - chainPoint : this._chainPoint, - brushType:'both', - strokeColor : lineStyle.color, - lineWidth : lineStyle.width, - lineType : lineStyle.type - }, - hoverable : false, - clickable : true, - onclick : this._onclick - }; - - this._timelineShae = new ChainShape(this._timelineShae); - this.shapeList.push(this._timelineShae); - }, - - /** - * 构建拖拽手柄 - */ - _buildHandle : function () { - var curPoint = this._chainPoint[this.currentIndex]; - var symbolSize = curPoint.symbolSize + 1; - symbolSize = symbolSize < 5 ? 5 : symbolSize; - - this._handleShape = { - zlevel : this._zlevelBase + 1, - hoverable : false, - draggable : true, - style : { - iconType : 'diamond', - n : curPoint.n, - x : curPoint.x - symbolSize, - y : this._location.y + this._location.height / 4 - symbolSize, - width : symbolSize * 2, - height : symbolSize * 2, - brushType:'both', - textPosition : 'specific', - textX : curPoint.x, - textY : this._location.y - this._location.height / 4, - textAlign : 'center', - textBaseline : 'middle' - }, - highlightStyle : {}, - ondrift : this._ondrift, - ondragend : this._ondragend - }; - - this._handleShape = new IconShape(this._handleShape); - this.shapeList.push(this._handleShape); - }, - - /** - * 同步拖拽图形样式 - */ - _syncHandleShape : function() { - if (!this.timelineOption.show) { - return; - } - - var timelineOption = this.timelineOption; - var cpStyle = timelineOption.checkpointStyle; - var curPoint = this._chainPoint[this.currentIndex]; - - this._handleShape.style.text = cpStyle.label.show ? curPoint.name : ''; - this._handleShape.style.textFont = curPoint.textFont; - - this._handleShape.style.n = curPoint.n; - if (cpStyle.symbol == 'auto') { - this._handleShape.style.iconType = curPoint.symbol != 'none' - ? curPoint.symbol : 'diamond'; - } - else { - this._handleShape.style.iconType = cpStyle.symbol; - if (cpStyle.symbol.match('star')) { - this._handleShape.style.n = (cpStyle.symbol.replace('star','') - 0) || 5; - this._handleShape.style.iconType = 'star'; - } - } - - var symbolSize; - if (cpStyle.symbolSize == 'auto') { - symbolSize = curPoint.symbolSize + 2; - symbolSize = symbolSize < 5 ? 5 : symbolSize; - } - else { - symbolSize = cpStyle.symbolSize - 0; - } - - this._handleShape.style.color = cpStyle.color == 'auto' - ? (curPoint.color - ? curPoint.color - : timelineOption.controlStyle.emphasis.color - ) - : cpStyle.color; - this._handleShape.style.textColor = cpStyle.label.textStyle.color == 'auto' - ? this._handleShape.style.color - : cpStyle.label.textStyle.color; - this._handleShape.highlightStyle.strokeColor = - this._handleShape.style.strokeColor = cpStyle.borderColor == 'auto' - ? (curPoint.borderColor ? curPoint.borderColor : '#fff') - : cpStyle.borderColor; - this._handleShape.style.lineWidth = cpStyle.borderWidth == 'auto' - ? (curPoint.borderWidth ? curPoint.borderWidth : 0) - : (cpStyle.borderWidth - 0); - this._handleShape.highlightStyle.lineWidth = this._handleShape.style.lineWidth + 1; - - this.zr.animate(this._handleShape.id, 'style') - .when( - 500, - { - x : curPoint.x - symbolSize, - textX : curPoint.x, - y : this._location.y + this._location.height / 4 - symbolSize, - width : symbolSize * 2, - height : symbolSize * 2 - } - ) - .start('ExponentialOut'); - }, - - _findChainIndex : function(x) { - var chainPoint = this._chainPoint; - var len = chainPoint.length; - if (x <= chainPoint[0].x) { - return 0; - } - else if (x >= chainPoint[len - 1].x) { - return len - 1; - } - for (var i = 0; i < len - 1; i++) { - if (x >= chainPoint[i].x && x <= chainPoint[i + 1].x) { - // catch you! - return (Math.abs(x - chainPoint[i].x) < Math.abs(x - chainPoint[i + 1].x)) - ? i : (i + 1); - } - } - }, - - __onclick : function(param) { - var x = zrEvent.getX(param.event); - var newIndex = this._findChainIndex(x); - if (newIndex == this.currentIndex) { - return true; // 啥事都没发生 - } - - this.currentIndex = newIndex; - this.timelineOption.autoPlay && this.stop(); // 停止自动播放 - clearTimeout(this.playTicket); - this._onFrame(); - }, - - /** - * 拖拽范围控制 - */ - __ondrift : function (shape, dx) { - this.timelineOption.autoPlay && this.stop(); // 停止自动播放 - - var chainPoint = this._chainPoint; - var len = chainPoint.length; - var newIndex; - if (shape.style.x + dx <= chainPoint[0].x - chainPoint[0].symbolSize) { - shape.style.x = chainPoint[0].x - chainPoint[0].symbolSize; - newIndex = 0; - } - else if (shape.style.x + dx >= chainPoint[len - 1].x - chainPoint[len - 1].symbolSize) { - shape.style.x = chainPoint[len - 1].x - chainPoint[len - 1].symbolSize; - newIndex = len - 1; - } - else { - shape.style.x += dx; - newIndex = this._findChainIndex(shape.style.x); - } - var curPoint = chainPoint[newIndex]; - var symbolSize = curPoint.symbolSize + 2; - shape.style.iconType = curPoint.symbol; - shape.style.n = curPoint.n; - shape.style.textX = shape.style.x + symbolSize / 2; - shape.style.y = this._location.y + this._location.height / 4 - symbolSize; - shape.style.width = symbolSize * 2; - shape.style.height = symbolSize * 2; - shape.style.text = curPoint.name; - - //console.log(newIndex) - if (newIndex == this.currentIndex) { - return true; // 啥事都没发生 - } - - this.currentIndex = newIndex; - if (this.timelineOption.realtime) { - clearTimeout(this.playTicket); - var self = this; - this.playTicket = setTimeout(function() { - self._setCurrentOption(); - },200); - } - - return true; - }, - - __ondragend : function () { - this.isDragend = true; - }, - - /** - * 数据项被拖拽出去 - */ - ondragend : function (param, status) { - if (!this.isDragend || !param.target) { - // 没有在当前实例上发生拖拽行为则直接返回 - return; - } - !this.timelineOption.realtime && this._setCurrentOption(); - - // 别status = {}赋值啊!! - status.dragOut = true; - status.dragIn = true; - status.needRefresh = false; // 会有消息触发fresh,不用再刷一遍 - // 处理完拖拽事件后复位 - this.isDragend = false; - this._syncHandleShape(); - return; - }, - - last : function () { - this.timelineOption.autoPlay && this.stop(); // 停止自动播放 - - this.currentIndex -= 1; - if (this.currentIndex < 0) { - this.currentIndex = this.timelineOption.data.length - 1; - } - this._onFrame(); - - return this.currentIndex; - }, - - next : function () { - this.timelineOption.autoPlay && this.stop(); // 停止自动播放 - - this.currentIndex += 1; - if (this.currentIndex >= this.timelineOption.data.length) { - this.currentIndex = 0; - } - this._onFrame(); - - return this.currentIndex; - }, - - play : function (targetIndex, autoPlay) { - if (this._ctrPlayShape && this._ctrPlayShape.style.status != 'playing') { - this._ctrPlayShape.style.status = 'playing'; - this.zr.modShape(this._ctrPlayShape.id); - this.zr.refresh(); - } - - - this.timelineOption.autoPlay = typeof autoPlay != 'undefined' - ? autoPlay : true; - - if (!this.timelineOption.autoPlay) { - clearTimeout(this.playTicket); - } - - this.currentIndex = typeof targetIndex != 'undefined' - ? targetIndex : (this.currentIndex + 1); - if (this.currentIndex >= this.timelineOption.data.length) { - this.currentIndex = 0; - } - this._onFrame(); - - return this.currentIndex; - }, - - stop : function () { - if (this._ctrPlayShape && this._ctrPlayShape.style.status != 'stop') { - this._ctrPlayShape.style.status = 'stop'; - this.zr.modShape(this._ctrPlayShape.id); - this.zr.refresh(); - } - - this.timelineOption.autoPlay = false; - - clearTimeout(this.playTicket); - - return this.currentIndex; - }, - - /** - * 避免dataZoom带来两次refresh,不设refresh接口,resize重复一下buildshape逻辑 - */ - resize : function () { - if (this.timelineOption.show) { - this.clear(); - this._buildShape(); - this._syncHandleShape(); - } - }, - - setTheme : function(needRefresh) { - this.timelineOption = this.reformOption(zrUtil.clone(this.option.timeline)); - // 补全padding属性 - this.timelineOption.padding = this.reformCssArray( - this.timelineOption.padding - ); - // 通用字体设置 - this.timelineOption.label.textStyle = zrUtil.merge( - this.timelineOption.label.textStyle || {}, - this.ecTheme.textStyle - ); - this.timelineOption.checkpointStyle.label.textStyle = zrUtil.merge( - this.timelineOption.checkpointStyle.label.textStyle || {}, - this.ecTheme.textStyle - ); - - if (this.timelineOption.show && needRefresh) { - this.clear(); - this._buildShape(); - this._syncHandleShape(); - } - }, - - /** - * 释放后实例不可用,重载基类方法 - */ - dispose : function () { - this.clear(); - this.shapeList = null; - - clearTimeout(this.playTicket); - } - }; - - function timelineControl(ctx, style) { - var lineWidth = 2;//style.lineWidth; - var x = style.x + lineWidth; - var y = style.y + lineWidth + 2; - var width = style.width - lineWidth; - var height = style.height - lineWidth; - - - var symbol = style.symbol; - if (symbol == 'last') { - ctx.moveTo(x + width - 2, y + height / 3); - ctx.lineTo(x + width - 2, y); - ctx.lineTo(x + 2, y + height / 2); - ctx.lineTo(x + width - 2, y + height); - ctx.lineTo(x + width - 2, y + height / 3 * 2); - ctx.moveTo(x, y); - ctx.lineTo(x, y); - } - else if (symbol == 'next') { - ctx.moveTo(x + 2, y + height / 3); - ctx.lineTo(x + 2, y); - ctx.lineTo(x + width - 2, y + height / 2); - ctx.lineTo(x + 2, y + height); - ctx.lineTo(x + 2, y + height / 3 * 2); - ctx.moveTo(x, y); - ctx.lineTo(x, y); - } - else if (symbol == 'play') { - if (style.status == 'stop') { - ctx.moveTo(x + 2, y); - ctx.lineTo(x + width - 2, y + height / 2); - ctx.lineTo(x + 2, y + height); - ctx.lineTo(x + 2, y); - } - else { - var delta = style.brushType == 'both' ? 2 : 3; - ctx.rect(x + 2, y, delta, height); - ctx.rect(x + width - delta - 2, y, delta, height); - } - } - else if (symbol.match('image')) { - var imageLocation = ''; - imageLocation = symbol.replace( - new RegExp('^image:\\/\\/'), '' - ); - symbol = IconShape.prototype.iconLibrary.image; - symbol(ctx, { - x : x, - y : y, - width : width, - height : height, - image : imageLocation - }); - } - } - IconShape.prototype.iconLibrary['timelineControl'] = timelineControl; - - zrUtil.inherits(Timeline, Base); - - require('../component').define('timeline', Timeline); - - return Timeline; -}); - -define( - 'zrender/loadingEffect/Bar',['require','./Base','../tool/util','../tool/color','../shape/Rectangle'],function (require) { - var Base = require('./Base'); - var util = require('../tool/util'); - var zrColor = require('../tool/color'); - var RectangleShape = require('../shape/Rectangle'); - - function Bar(options) { - Base.call(this, options); - } - util.inherits(Bar, Base); - - - /** - * 进度条 - * - * @param {Object} addShapeHandle - * @param {Object} refreshHandle - */ - Bar.prototype._start = function (addShapeHandle, refreshHandle) { - // 特效默认配置 - var options = util.merge( - this.options, - { - textStyle : { - color : '#888' - }, - backgroundColor : 'rgba(250, 250, 250, 0.8)', - effectOption : { - x : 0, - y : this.canvasHeight / 2 - 30, - width : this.canvasWidth, - height : 5, - brushType : 'fill', - timeInterval : 100 - } - } - ); - - var textShape = this.createTextShape(options.textStyle); - var background = this.createBackgroundShape(options.backgroundColor); - - var effectOption = options.effectOption; - - // 初始化动画元素 - var barShape = new RectangleShape({ - highlightStyle : util.clone(effectOption) - }); - - barShape.highlightStyle.color = - effectOption.color - || zrColor.getLinearGradient( - effectOption.x, - effectOption.y, - effectOption.x + effectOption.width, - effectOption.y + effectOption.height, - [[0, '#ff6400'], [0.5, '#ffe100'], [1, '#b1ff00']] - ); - - if (options.progress != null) { - // 指定进度 - addShapeHandle(background); - - barShape.highlightStyle.width = - this.adjust(options.progress, [0,1]) - * options.effectOption.width; - - addShapeHandle(barShape); - addShapeHandle(textShape); - - refreshHandle(); - return; - } - else { - // 循环显示 - barShape.highlightStyle.width = 0; - return setInterval( - function() { - addShapeHandle(background); - - if (barShape.highlightStyle.width < effectOption.width) { - barShape.highlightStyle.width += 8; - } - else { - barShape.highlightStyle.width = 0; - } - addShapeHandle(barShape); - addShapeHandle(textShape); - refreshHandle(); - }, - effectOption.timeInterval - ); - } - }; - - return Bar; - } -); - - -define( - 'zrender/loadingEffect/Bubble',['require','./Base','../tool/util','../tool/color','../shape/Circle'],function (require) { - var Base = require('./Base'); - var util = require('../tool/util'); - var zrColor = require('../tool/color'); - var CircleShape = require('../shape/Circle'); - - function Bubble(options) { - Base.call(this, options); - } - util.inherits(Bubble, Base); - - /** - * 泡泡 - * - * @param {Object} addShapeHandle - * @param {Object} refreshHandle - */ - Bubble.prototype._start = function (addShapeHandle, refreshHandle) { - - // 特效默认配置 - var options = util.merge( - this.options, - { - textStyle : { - color : '#888' - }, - backgroundColor : 'rgba(250, 250, 250, 0.8)', - effect : { - n : 50, - lineWidth : 2, - brushType : 'stroke', - color : 'random', - timeInterval : 100 - } - } - ); - - var textShape = this.createTextShape(options.textStyle); - var background = this.createBackgroundShape(options.backgroundColor); - - var effectOption = options.effect; - var n = effectOption.n; - var brushType = effectOption.brushType; - var lineWidth = effectOption.lineWidth; - - var shapeList = []; - var canvasWidth = this.canvasWidth; - var canvasHeight = this.canvasHeight; - - // 初始化动画元素 - for(var i = 0; i < n; i++) { - var color = effectOption.color == 'random' - ? zrColor.alpha(zrColor.random(), 0.3) - : effectOption.color; - - shapeList[i] = new CircleShape({ - highlightStyle : { - x : Math.ceil(Math.random() * canvasWidth), - y : Math.ceil(Math.random() * canvasHeight), - r : Math.ceil(Math.random() * 40), - brushType : brushType, - color : color, - strokeColor : color, - lineWidth : lineWidth - }, - animationY : Math.ceil(Math.random() * 20) - }); - } - - return setInterval( - function () { - addShapeHandle(background); - - for(var i = 0; i < n; i++) { - var style = shapeList[i].highlightStyle; - - if (style.y - shapeList[i].animationY + style.r <= 0){ - shapeList[i].highlightStyle.y = canvasHeight + style.r; - shapeList[i].highlightStyle.x = Math.ceil( - Math.random() * canvasWidth - ); - } - shapeList[i].highlightStyle.y -= - shapeList[i].animationY; - - addShapeHandle(shapeList[i]); - } - - addShapeHandle(textShape); - refreshHandle(); - }, - effectOption.timeInterval - ); - }; - - return Bubble; - } -); - - -define( - 'zrender/loadingEffect/DynamicLine',['require','./Base','../tool/util','../tool/color','../shape/Line'],function (require) { - var Base = require('./Base'); - var util = require('../tool/util'); - var zrColor = require('../tool/color'); - var LineShape = require('../shape/Line'); - - function DynamicLine(options) { - Base.call(this, options); - } - util.inherits(DynamicLine, Base); - - - /** - * 动态线 - * - * @param {Object} addShapeHandle - * @param {Object} refreshHandle - */ - DynamicLine.prototype._start = function (addShapeHandle, refreshHandle) { - // 特效默认配置 - var options = util.merge( - this.options, - { - textStyle : { - color : '#fff' - }, - backgroundColor : 'rgba(0, 0, 0, 0.8)', - effectOption : { - n : 30, - lineWidth : 1, - color : 'random', - timeInterval : 100 - } - } - ); - - var textShape = this.createTextShape(options.textStyle); - var background = this.createBackgroundShape(options.backgroundColor); - - var effectOption = options.effectOption; - var n = effectOption.n; - var lineWidth = effectOption.lineWidth; - - var shapeList = []; - var canvasWidth = this.canvasWidth; - var canvasHeight = this.canvasHeight; - - // 初始化动画元素 - for(var i = 0; i < n; i++) { - var xStart = -Math.ceil(Math.random() * 1000); - var len = Math.ceil(Math.random() * 400); - var pos = Math.ceil(Math.random() * canvasHeight); - - var color = effectOption.color == 'random' - ? zrColor.random() - : effectOption.color; - - shapeList[i] = new LineShape({ - highlightStyle : { - xStart : xStart, - yStart : pos, - xEnd : xStart + len, - yEnd : pos, - strokeColor : color, - lineWidth : lineWidth - }, - animationX : Math.ceil(Math.random() * 100), - len : len - }); - } - - return setInterval( - function() { - addShapeHandle(background); - - for(var i = 0; i < n; i++) { - var style = shapeList[i].highlightStyle; - - if (style.xStart >= canvasWidth){ - - shapeList[i].len = Math.ceil(Math.random() * 400); - style.xStart = -400; - style.xEnd = -400 + shapeList[i].len; - style.yStart = Math.ceil(Math.random() * canvasHeight); - style.yEnd = style.yStart; - } - - style.xStart += shapeList[i].animationX; - style.xEnd += shapeList[i].animationX; - - addShapeHandle(shapeList[i]); - } - - addShapeHandle(textShape); - refreshHandle(); - }, - effectOption.timeInterval - ); - }; - - return DynamicLine; - } -); - - -define( - 'zrender/loadingEffect/Ring',['require','./Base','../tool/util','../tool/color','../shape/Ring','../shape/Sector'],function (require) { - var Base = require('./Base'); - var util = require('../tool/util'); - var zrColor = require('../tool/color'); - var RingShape = require('../shape/Ring'); - var SectorShape = require('../shape/Sector'); - - function Ring(options) { - Base.call(this, options); - } - util.inherits(Ring, Base); - - - /** - * 圆环 - * - * @param {Object} addShapeHandle - * @param {Object} refreshHandle - */ - Ring.prototype._start = function (addShapeHandle, refreshHandle) { - - // 特效默认配置 - var options = util.merge( - this.options, - { - textStyle : { - color : '#07a' - }, - backgroundColor : 'rgba(250, 250, 250, 0.8)', - effect : { - x : this.canvasWidth / 2, - y : this.canvasHeight / 2, - r0 : 60, - r : 100, - color : '#bbdcff', - brushType: 'fill', - textPosition : 'inside', - textFont : 'normal 30px verdana', - textColor : 'rgba(30, 144, 255, 0.6)', - timeInterval : 100 - } - } - ); - - var effectOption = options.effect; - - var textStyle = options.textStyle; - if (textStyle.x == null) { - textStyle.x = effectOption.x; - } - if (textStyle.y == null) { - textStyle.y = (effectOption.y + (effectOption.r0 + effectOption.r) / 2 - 5); - } - - var textShape = this.createTextShape(options.textStyle); - var background = this.createBackgroundShape(options.backgroundColor); - - var x = effectOption.x; - var y = effectOption.y; - var r0 = effectOption.r0 + 6; - var r = effectOption.r - 6; - var color = effectOption.color; - var darkColor = zrColor.lift(color, 0.1); - - var shapeRing = new RingShape({ - highlightStyle : util.clone(effectOption) - }); - - // 初始化动画元素 - var shapeList = []; - var clolrList = zrColor.getGradientColors( - ['#ff6400', '#ffe100', '#97ff00'], 25 - ); - var preAngle = 15; - var endAngle = 240; - - for(var i = 0; i < 16; i++) { - shapeList.push(new SectorShape({ - highlightStyle : { - x : x, - y : y, - r0 : r0, - r : r, - startAngle : endAngle - preAngle, - endAngle : endAngle, - brushType: 'fill', - color : darkColor - }, - _color : zrColor.getLinearGradient( - x + r0 * Math.cos(endAngle, true), - y - r0 * Math.sin(endAngle, true), - x + r0 * Math.cos(endAngle - preAngle, true), - y - r0 * Math.sin(endAngle - preAngle, true), - [ - [0, clolrList[i * 2]], - [1, clolrList[i * 2 + 1]] - ] - ) - })); - endAngle -= preAngle; - } - endAngle = 360; - for(var i = 0; i < 4; i++) { - shapeList.push(new SectorShape({ - highlightStyle : { - x : x, - y : y, - r0 : r0, - r : r, - startAngle : endAngle - preAngle, - endAngle : endAngle, - brushType: 'fill', - color : darkColor - }, - _color : zrColor.getLinearGradient( - x + r0 * Math.cos(endAngle, true), - y - r0 * Math.sin(endAngle, true), - x + r0 * Math.cos(endAngle - preAngle, true), - y - r0 * Math.sin(endAngle - preAngle, true), - [ - [0, clolrList[i * 2 + 32]], - [1, clolrList[i * 2 + 33]] - ] - ) - })); - endAngle -= preAngle; - } - - var n = 0; - if (options.progress != null) { - // 指定进度 - addShapeHandle(background); - - n = this.adjust(options.progress, [0,1]).toFixed(2) * 100 / 5; - shapeRing.highlightStyle.text = n * 5 + '%'; - addShapeHandle(shapeRing); - - for(var i = 0; i < 20; i++) { - shapeList[i].highlightStyle.color = i < n - ? shapeList[i]._color : darkColor; - addShapeHandle(shapeList[i]); - } - - addShapeHandle(textShape); - refreshHandle(); - return; - } - - // 循环显示 - return setInterval( - function() { - addShapeHandle(background); - - n += n >= 20 ? -20 : 1; - - //shapeRing.highlightStyle.text = n * 5 + '%'; - addShapeHandle(shapeRing); - - for(var i = 0; i < 20; i++) { - shapeList[i].highlightStyle.color = i < n - ? shapeList[i]._color : darkColor; - addShapeHandle(shapeList[i]); - } - - addShapeHandle(textShape); - refreshHandle(); - }, - effectOption.timeInterval - ); - }; - - return Ring; - } -); - - -define( - 'zrender/loadingEffect/Spin',['require','./Base','../tool/util','../tool/color','../shape/Sector'],function (require) { - var Base = require('./Base'); - var util = require('../tool/util'); - var zrColor = require('../tool/color'); - var SectorShape = require('../shape/Sector'); - - function Spin(options) { - Base.call(this, options); - } - util.inherits(Spin, Base); - - /** - * 旋转 - * - * @param {Object} addShapeHandle - * @param {Object} refreshHandle - */ - Spin.prototype._start = function (addShapeHandle, refreshHandle) { - // 特效默认配置 - var effectOption = util.merge( - this.options.effect || {}, - { - x : this.canvasWidth / 2 - 80, - y : this.canvasHeight / 2, - r0 : 9, - r : 15, - n : 18, - color : '#fff', - timeInterval : 100 - } - ); - - var options = util.merge( - this.options, - { - textStyle : { - color : '#fff', - x : effectOption.x + effectOption.r + 10, - y : effectOption.y, - textAlign : 'start' - }, - backgroundColor : 'rgba(0, 0, 0, 0.8)' - } - ); - - var textShape = this.createTextShape(options.textStyle); - var background = this.createBackgroundShape(options.backgroundColor); - - var n = effectOption.n; - var x = effectOption.x; - var y = effectOption.y; - var r0 = effectOption.r0; - var r = effectOption.r; - var color = effectOption.color; - - // 初始化动画元素 - var shapeList = []; - var preAngle = Math.round(180 / n); - for(var i = 0; i < n; i++) { - shapeList[i] = new SectorShape({ - highlightStyle : { - x : x, - y : y, - r0 : r0, - r : r, - startAngle : preAngle * i * 2, - endAngle : preAngle * i * 2 + preAngle, - color : zrColor.alpha(color, (i + 1) / n), - brushType: 'fill' - } - }); - } - - var pos = [0, x, y]; - - return setInterval( - function() { - addShapeHandle(background); - pos[0] -= 0.3; - for(var i = 0; i < n; i++) { - shapeList[i].rotation = pos; - addShapeHandle(shapeList[i]); - } - - addShapeHandle(textShape); - refreshHandle(); - }, - effectOption.timeInterval - ); - }; - - return Spin; - } -); - - -define( - 'zrender/loadingEffect/Whirling',['require','./Base','../tool/util','../shape/Ring','../shape/Droplet','../shape/Circle'],function (require) { - var Base = require('./Base'); - var util = require('../tool/util'); - var RingShape = require('../shape/Ring'); - var DropletShape = require('../shape/Droplet'); - var CircleShape = require('../shape/Circle'); - - function Whirling(options) { - Base.call(this, options); - } - util.inherits(Whirling, Base); - - /** - * 旋转水滴 - * - * @param {Object} addShapeHandle - * @param {Object} refreshHandle - */ - Whirling.prototype._start = function (addShapeHandle, refreshHandle) { - // 特效默认配置 - var effectOption = util.merge( - this.options.effect || {}, - { - x : this.canvasWidth / 2 - 80, - y : this.canvasHeight / 2, - r : 18, - colorIn : '#fff', - colorOut : '#555', - colorWhirl : '#6cf', - timeInterval : 50 - } - ); - - var options = util.merge( - this.options, - { - textStyle : { - color : '#888', - x : effectOption.x + effectOption.r + 10, - y : effectOption.y, - textAlign : 'start' - }, - backgroundColor : 'rgba(250, 250, 250, 0.8)' - } - ); - - var textShape = this.createTextShape(options.textStyle); - var background = this.createBackgroundShape(options.backgroundColor); - - // 初始化动画元素 - var droplet = new DropletShape({ - highlightStyle : { - a : Math.round(effectOption.r / 2), - b : Math.round(effectOption.r - effectOption.r / 6), - brushType : 'fill', - color : effectOption.colorWhirl - } - }); - var circleIn = new CircleShape({ - highlightStyle : { - r : Math.round(effectOption.r / 6), - brushType : 'fill', - color : effectOption.colorIn - } - }); - var circleOut = new RingShape({ - highlightStyle : { - r0 : Math.round(effectOption.r - effectOption.r / 3), - r : effectOption.r, - brushType : 'fill', - color : effectOption.colorOut - } - }); - - var pos = [0, effectOption.x, effectOption.y]; - - droplet.highlightStyle.x - = circleIn.highlightStyle.x - = circleOut.highlightStyle.x - = pos[1]; - droplet.highlightStyle.y - = circleIn.highlightStyle.y - = circleOut.highlightStyle.y - = pos[2]; - - return setInterval( - function() { - addShapeHandle(background); - addShapeHandle(circleOut); - pos[0] -= 0.3; - droplet.rotation = pos; - addShapeHandle(droplet); - addShapeHandle(circleIn); - addShapeHandle(textShape); - refreshHandle(); - }, - effectOption.timeInterval - ); - }; - - return Whirling; - } -); - -/** - * echarts默认主题,开发中 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/theme/default',[],function() { - var config = { - }; - - return config; -}); -/*! - * ECharts, a javascript interactive chart library. - * - * Copyright (c) 2014, Baidu Inc. - * All rights reserved. - * - * LICENSE - * https://github.com/ecomfe/echarts/blob/master/LICENSE.txt - */ - -/** - * echarts - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool/event','zrender/tool/env','zrender','zrender/config','zrender','./chart/island','./component/toolbox','./component','./component/title','./component/tooltip','./component/legend','./util/ecData','./chart','./component','zrender/tool/color','./component/timeline','zrender','zrender/shape/Image','zrender/loadingEffect/Bar','zrender/loadingEffect/Bubble','zrender/loadingEffect/DynamicLine','zrender/loadingEffect/Ring','zrender/loadingEffect/Spin','zrender/loadingEffect/Whirling','./theme/default'],function (require) { - var ecConfig = require('./config'); - var zrUtil = require('zrender/tool/util'); - var zrEvent = require('zrender/tool/event'); - - var self = {}; - - var _canvasSupported = require('zrender/tool/env').canvasSupported; - var _idBase = new Date() - 0; - var _instances = {}; // ECharts实例map索引 - var DOM_ATTRIBUTE_KEY = '_echarts_instance_'; - - self.version = '2.0.2'; - self.dependencies = { - zrender : '2.0.2' - }; - /** - * 入口方法 - */ - self.init = function (dom, theme) { - var zrender = require('zrender'); - if (((zrender.version || '1.0.3').replace('.', '') - 0) - < (self.dependencies.zrender.replace('.', '') - 0) - ) { - console.error( - 'ZRender ' + (zrender.version || '1.0.3-') - + ' is too old for ECharts ' + self.version - + '. Current version need ZRender ' - + self.dependencies.zrender + '+' - ); - } - - dom = dom instanceof Array ? dom[0] : dom; - - // dom与echarts实例映射索引 - var key = dom.getAttribute(DOM_ATTRIBUTE_KEY); - if (!key) { - key = _idBase++; - dom.setAttribute(DOM_ATTRIBUTE_KEY, key); - } - - if (_instances[key]) { - // 同一个dom上多次init,自动释放已有实例 - _instances[key].dispose(); - } - _instances[key] = new Echarts(dom); - _instances[key].id = key; - _instances[key].setTheme(theme); - - return _instances[key]; - }; - - /** - * 通过id获得ECharts实例,id可在实例化后读取 - */ - self.getInstanceById = function (key) { - return _instances[key]; - }; - - /** - * 消息中心 - */ - function MessageCenter() { - zrEvent.Dispatcher.call(this); - } - zrUtil.merge(MessageCenter.prototype, zrEvent.Dispatcher.prototype, true); - - /** - * 基于zrender实现Echarts接口层 - * @param {HtmlElement} dom 必要 - */ - function Echarts(dom) { - this._themeConfig = zrUtil.clone(ecConfig); - - this.dom = dom; - // this._zr; - // this._option; // curOption clone - // this._optionRestore; // for restore; - // this._island; - // this._toolbox; - // this._timeline; - // this._refreshInside; // 内部刷新标志位 - - this._connected = false; - this._status = { // 用于图表间通信 - dragIn : false, - dragOut : false, - needRefresh : false - }; - this._curEventType = false; // 破循环信号灯 - this._chartList = []; // 图表实例 - - this._messageCenter = new MessageCenter(); - - this._messageCenterOutSide = new MessageCenter(); // Echarts层的外部消息中心,做Echarts层的消息转发 - - // resize方法经常被绑定到window.resize上,闭包一个this - this.resize = this.resize(); - - // 初始化::构造函数 - this._init(); - } - - /** - * ZRender EVENT - * - * @inner - * @const - * @type {Object} - */ - var ZR_EVENT = require('zrender/config').EVENT; - - /** - * 要绑定监听的zrender事件列表 - * - * @const - * @inner - * @type {Array} - */ - var ZR_EVENT_LISTENS = [ - 'CLICK', 'MOUSEOVER', - 'DRAGSTART', 'DRAGEND', 'DRAGENTER', 'DRAGOVER', 'DRAGLEAVE', 'DROP' - ]; - - /** - * 对echarts的实例中的chartList属性成员,逐个进行方法调用,遍历顺序为逆序 - * 由于在事件触发的默认行为处理中,多次用到相同逻辑,所以抽象了该方法 - * 由于所有的调用场景里,最多只有两个参数,基于性能和体积考虑,这里就不使用call或者apply了 - * - * @inner - * @param {ECharts} ecInstance ECharts实例 - * @param {string} methodName 要调用的方法名 - * @param {*} arg0 调用参数1 - * @param {*} arg1 调用参数2 - * @param {*} arg2 调用参数3 - */ - function callChartListMethodReverse(ecInstance, methodName, arg0, arg1, arg2) { - var chartList = ecInstance._chartList; - var len = chartList.length; - - while (len--) { - var chart = chartList[len]; - if (typeof chart[methodName] === 'function') { - chart[methodName](arg0, arg1, arg2); - } - } - } - - Echarts.prototype = { - /** - * 初始化::构造函数 - */ - _init : function () { - var self = this; - var _zr = require('zrender').init(this.dom); - this._zr = _zr; - - // wrap: n,e,d,t for name event data this - this._messageCenter.dispatch = function(type, event, eventPackage, that) { - eventPackage = eventPackage || {}; - eventPackage.type = type; - eventPackage.event = event; - - self._messageCenter.dispatchWithContext(type, eventPackage, that); - if (type != 'HOVER') { - setTimeout(function(){ - self._messageCenterOutSide.dispatchWithContext( - type, eventPackage, that - ); - },50); - } - else { - self._messageCenterOutSide.dispatchWithContext( - type, eventPackage, that - ); - } - }; - - this._onevent = function(param){ - return self.__onevent(param); - }; - for (var e in ecConfig.EVENT) { - if (e != 'CLICK' && e != 'HOVER' && e != 'MAP_ROAM') { - this._messageCenter.bind(ecConfig.EVENT[e], this._onevent, this); - } - } - - - var eventBehaviors = {}; - this._onzrevent = function (param) { - return self[eventBehaviors[ param.type ]](param); - }; - - // 挂载关心的事件 - for (var i = 0, len = ZR_EVENT_LISTENS.length; i < len; i++) { - var eventName = ZR_EVENT_LISTENS[i]; - var eventValue = ZR_EVENT[eventName]; - eventBehaviors[eventValue] = '_on' + eventName.toLowerCase(); - _zr.on(eventValue, this._onzrevent); - } - - this.chart = {}; // 图表索引 - this.component = {}; // 组件索引 - - // 内置图表 - // 孤岛 - var Island = require('./chart/island'); - this._island = new Island(this._themeConfig, this._messageCenter, _zr, {}, this); - this.chart.island = this._island; - - // 内置通用组件 - // 工具箱 - var Toolbox = require('./component/toolbox'); - this._toolbox = new Toolbox(this._themeConfig, this._messageCenter, _zr, {}, this); - this.component.toolbox = this._toolbox; - - var componentLibrary = require('./component'); - componentLibrary.define('title', require('./component/title')); - componentLibrary.define('tooltip', require('./component/tooltip')); - componentLibrary.define('legend', require('./component/legend')); - }, - - /** - * ECharts事件处理中心 - */ - __onevent : function (param){ - param.__echartsId = param.__echartsId || this.id; - - // 来自其他联动图表的事件 - var fromMyself = (param.__echartsId == this.id); - - if (!this._curEventType) { - this._curEventType = param.type; - } - - switch (param.type) { - case ecConfig.EVENT.LEGEND_SELECTED : - this._onlegendSelected(param); - break; - case ecConfig.EVENT.DATA_ZOOM : - if (!fromMyself) { - var dz = this.component.dataZoom; - if (dz) { - dz.silence(true); - dz.absoluteZoom(param.zoom); - dz.silence(false); - } - } - this._ondataZoom(param); - break; - case ecConfig.EVENT.DATA_RANGE : - fromMyself && this._ondataRange(param); - break; - case ecConfig.EVENT.MAGIC_TYPE_CHANGED : - if (!fromMyself) { - var tb = this.component.toolbox; - if (tb) { - tb.silence(true); - tb.setMagicType(param.magicType); - tb.silence(false); - } - } - this._onmagicTypeChanged(param); - break; - case ecConfig.EVENT.DATA_VIEW_CHANGED : - fromMyself && this._ondataViewChanged(param); - break; - case ecConfig.EVENT.TOOLTIP_HOVER : - fromMyself && this._tooltipHover(param); - break; - case ecConfig.EVENT.RESTORE : - this._onrestore(); - break; - case ecConfig.EVENT.REFRESH : - fromMyself && this._onrefresh(param); - break; - // 鼠标同步 - case ecConfig.EVENT.TOOLTIP_IN_GRID : - case ecConfig.EVENT.TOOLTIP_OUT_GRID : - if (!fromMyself) { - // 只处理来自外部的鼠标同步 - var grid = this.component.grid; - if (grid) { - this._zr.trigger( - 'mousemove', - { - connectTrigger : true, - zrenderX : grid.getX() + param.x * grid.getWidth(), - zrenderY : grid.getY() + param.y * grid.getHeight() - } - ); - } - } - else if (this._connected) { - // 来自自己,并且存在多图联动,空间坐标映射修改参数分发 - var grid = this.component.grid; - if (grid) { - param.x = (param.event.zrenderX - grid.getX()) / grid.getWidth(); - param.y = (param.event.zrenderY - grid.getY()) / grid.getHeight(); - } - } - break; - /* - case ecConfig.EVENT.RESIZE : - case ecConfig.EVENT.DATA_CHANGED : - case ecConfig.EVENT.PIE_SELECTED : - case ecConfig.EVENT.MAP_SELECTED : - break; - */ - } - - // 多图联动,只做自己的一级事件分发,避免级联事件循环 - if (this._connected && fromMyself && this._curEventType == param.type) { - for (var c in this._connected) { - this._connected[c].connectedEventHandler(param); - } - // 分发完毕后复位 - this._curEventType = null; - } - - if (!fromMyself || (!this._connected && fromMyself)) { // 处理了完联动事件复位 - this._curEventType = null; - } - }, - - /** - * 点击事件,响应zrender事件,包装后分发到Echarts层 - */ - _onclick : function (param) { - callChartListMethodReverse(this, 'onclick', param); - - if (param.target) { - var ecData = this._eventPackage(param.target); - if (ecData && ecData.seriesIndex != null) { - this._messageCenter.dispatch( - ecConfig.EVENT.CLICK, - param.event, - ecData, - this - ); - } - } - }, - - /** - * 鼠标移入事件,响应zrender事件,包装后分发到Echarts层 - */ - _onmouseover : function (param) { - if (param.target) { - var ecData = this._eventPackage(param.target); - if (ecData && ecData.seriesIndex != null) { - this._messageCenter.dispatch( - ecConfig.EVENT.HOVER, - param.event, - ecData, - this - ); - } - } - }, - - /** - * dragstart回调,可计算特性实现 - */ - _ondragstart : function (param) { - // 复位用于图表间通信拖拽标识 - this._status = { - dragIn : false, - dragOut : false, - needRefresh : false - }; - - callChartListMethodReverse(this, 'ondragstart', param); - }, - - /** - * dragging回调,可计算特性实现 - */ - _ondragenter : function (param) { - callChartListMethodReverse(this, 'ondragenter', param); - }, - - /** - * dragstart回调,可计算特性实现 - */ - _ondragover : function (param) { - callChartListMethodReverse(this, 'ondragover', param); - }, - - /** - * dragstart回调,可计算特性实现 - */ - _ondragleave : function (param) { - callChartListMethodReverse(this, 'ondragleave', param); - }, - - /** - * dragstart回调,可计算特性实现 - */ - _ondrop : function (param) { - callChartListMethodReverse(this, 'ondrop', param, this._status); - this._island.ondrop(param, this._status); - }, - - /** - * dragdone回调 ,可计算特性实现 - */ - _ondragend : function (param) { - callChartListMethodReverse(this, 'ondragend', param, this._status); - - this._timeline && this._timeline.ondragend(param, this._status); - this._island.ondragend(param, this._status); - - // 发生过重计算 - if (this._status.needRefresh) { - this._syncBackupData(this._option); - - var messageCenter = this._messageCenter; - messageCenter.dispatch( - ecConfig.EVENT.DATA_CHANGED, - param.event, - this._eventPackage(param.target), - this - ); - messageCenter.dispatch(ecConfig.EVENT.REFRESH, null, null, this); - } - }, - - /** - * 图例选择响应 - */ - _onlegendSelected : function (param) { - // 用于图表间通信 - this._status.needRefresh = false; - callChartListMethodReverse(this, 'onlegendSelected', param, this._status); - - if (this._status.needRefresh) { - this._messageCenter.dispatch(ecConfig.EVENT.REFRESH, null, null, this); - } - }, - - /** - * 数据区域缩放响应 - */ - _ondataZoom : function (param) { - // 用于图表间通信 - this._status.needRefresh = false; - callChartListMethodReverse(this, 'ondataZoom', param, this._status); - - if (this._status.needRefresh) { - this._messageCenter.dispatch(ecConfig.EVENT.REFRESH, null, null, this); - } - }, - - /** - * 值域漫游响应 - */ - _ondataRange : function (param) { - this._clearEffect(); - // 用于图表间通信 - this._status.needRefresh = false; - callChartListMethodReverse(this, 'ondataRange', param, this._status); - - // 没有相互影响,直接刷新即可 - if (this._status.needRefresh) { - this._zr.refresh(); - } - }, - - /** - * 动态类型切换响应 - */ - _onmagicTypeChanged : function () { - this._clearEffect(); - this._render(this._toolbox.getMagicOption()); - }, - - /** - * 数据视图修改响应 - */ - _ondataViewChanged : function (param) { - this._syncBackupData(param.option); - this._messageCenter.dispatch( - ecConfig.EVENT.DATA_CHANGED, - null, - param, - this - ); - this._messageCenter.dispatch(ecConfig.EVENT.REFRESH, null, null, this); - }, - - /** - * tooltip与图表间通信 - */ - _tooltipHover : function (param) { - var tipShape = []; - callChartListMethodReverse(this, 'ontooltipHover', param, tipShape); - }, - - /** - * 还原 - */ - _onrestore : function () { - this.restore(); - }, - - /** - * 刷新 - */ - _onrefresh : function (param) { - this._refreshInside = true; - this.refresh(param); - this._refreshInside = false; - }, - - /** - * 数据修改后的反向同步dataZoom持有的备份数据 - */ - _syncBackupData : function (curOption) { - this.component.dataZoom && this.component.dataZoom.syncBackupData(curOption); - }, - - /** - * 打包Echarts层的事件附件 - */ - _eventPackage : function (target) { - if (target) { - var ecData = require('./util/ecData'); - - var seriesIndex = ecData.get(target, 'seriesIndex'); - var dataIndex = ecData.get(target, 'dataIndex'); - - dataIndex = seriesIndex != -1 && this.component.dataZoom - ? this.component.dataZoom.getRealDataIndex( - seriesIndex, - dataIndex - ) - : dataIndex; - return { - seriesIndex : seriesIndex, - dataIndex : dataIndex, - data : ecData.get(target, 'data'), - name : ecData.get(target, 'name'), - value : ecData.get(target, 'value'), - special : ecData.get(target, 'special') - }; - } - return; - }, - - /** - * 图表渲染 - */ - _render : function (magicOption) { - this._mergeGlobalConifg(magicOption); - - var bgColor = magicOption.backgroundColor; - if (bgColor) { - if (!_canvasSupported - && bgColor.indexOf('rgba') != -1 - ) { - // IE6~8对RGBA的处理,filter会带来其他颜色的影响 - var cList = bgColor.split(','); - this.dom.style.filter = 'alpha(opacity=' + - cList[3].substring(0, cList[3].lastIndexOf(')')) * 100 - + ')'; - cList.length = 3; - cList[0] = cList[0].replace('a', ''); - this.dom.style.backgroundColor = cList.join(',') + ')'; - } - else { - this.dom.style.backgroundColor = bgColor; - } - } - - this._zr.clearAnimation(); - this._chartList = []; - - var chartLibrary = require('./chart'); - var componentLibrary = require('./component'); - - if (magicOption.xAxis || magicOption.yAxis) { - magicOption.grid = magicOption.grid || {}; - magicOption.dataZoom = magicOption.dataZoom || {}; - } - - var componentList = [ - 'title', 'legend', 'tooltip', 'dataRange', - 'grid', 'dataZoom', 'xAxis', 'yAxis', 'polar' - ]; - - var ComponentClass; - var componentType; - var component; - for (var i = 0, l = componentList.length; i < l; i++) { - componentType = componentList[i]; - component = this.component[componentType]; - - if (magicOption[componentType]) { - if (component) { - component.refresh && component.refresh(magicOption); - } - else { - ComponentClass = componentLibrary.get( - /^[xy]Axis$/.test(componentType) ? 'axis' : componentType - ); - component = new ComponentClass( - this._themeConfig, this._messageCenter, this._zr, - magicOption, this, componentType - ); - this.component[componentType] = component; - } - this._chartList.push(component); - } - else if (component) { - component.dispose(); - this.component[componentType] = null; - delete this.component[componentType]; - } - } - - var ChartClass; - var chartType; - var chart; - var chartMap = {}; // 记录已经初始化的图表 - for (var i = 0, l = magicOption.series.length; i < l; i++) { - chartType = magicOption.series[i].type; - if (!chartType) { - console.error('series[' + i + '] chart type has not been defined.'); - continue; - } - - if (!chartMap[chartType]) { - chartMap[chartType] = true; - ChartClass = chartLibrary.get(chartType); - if (ChartClass) { - if (this.chart[chartType]) { - chart = this.chart[chartType]; - chart.refresh(magicOption); - } - else { - chart = new ChartClass( - this._themeConfig, this._messageCenter, this._zr, - magicOption, this - ); - } - this._chartList.push(chart); - this.chart[chartType] = chart; - } - else { - console.error(chartType + ' has not been required.'); - } - } - } - - // 已有实例但新option不带这类图表的实例释放 - for (chartType in this.chart) { - if (chartType != ecConfig.CHART_TYPE_ISLAND && !chartMap[chartType]) { - this.chart[chartType].dispose(); - this.chart[chartType] = null; - delete this.chart[chartType]; - } - } - - this.component.grid && this.component.grid.refixAxisShape(this.component); - - this._island.refresh(magicOption); - this._toolbox.refresh(magicOption); - - magicOption.animation && !magicOption.renderAsImage - ? this._zr.refresh() - : this._zr.render(); - - var imgId = 'IMG' + this.id; - var img = document.getElementById(imgId); - if (magicOption.renderAsImage && _canvasSupported) { - // IE8- 不支持图片渲染形式 - if (img) { - // 已经渲染过则更新显示 - img.src = this.getDataURL(magicOption.renderAsImage); - } - else { - // 没有渲染过插入img dom - img = this.getImage(magicOption.renderAsImage); - img.id = imgId; - img.style.position = 'absolute'; - img.style.left = 0; - img.style.top = 0; - this.dom.firstChild.appendChild(img); - } - this.un(); - this._zr.un(); - this._disposeChartList(); - this._zr.clear(); - } - else if (img) { - // 删除可能存在的img - img.parentNode.removeChild(img); - } - img = null; - - this._option = magicOption; - }, - - /** - * 还原 - */ - restore : function () { - this._clearEffect(); - this._option = zrUtil.clone(this._optionRestore); - this._disposeChartList(); - this._island.clear(); - this._toolbox.reset(this._option, true); - this._render(this._option); - }, - - /** - * 刷新 - * @param {Object=} param,可选参数,用于附带option,内部同步用,外部不建议带入数据修改,无法同步 - */ - refresh : function (param) { - this._clearEffect(); - param = param || {}; - var magicOption = param.option; - - // 外部调用的refresh且有option带入 - if (!this._refreshInside && magicOption) { - // 做简单的差异合并去同步内部持有的数据克隆,不建议带入数据 - // 开启数据区域缩放、拖拽重计算、数据视图可编辑模式情况下,当用户产生了数据变化后无法同步 - // 如有带入option存在数据变化,请重新setOption - magicOption = this.getOption(); - zrUtil.merge(magicOption, param.option, true); - zrUtil.merge(this._optionRestore, param.option, true); - this._toolbox.reset(magicOption); - } - - this._island.refresh(magicOption); - this._toolbox.refresh(magicOption); - - // 停止动画 - this._zr.clearAnimation(); - // 先来后到,安顺序刷新各种图表,图表内部refresh优化检查magicOption,无需更新则不更新~ - for (var i = 0, l = this._chartList.length; i < l; i++) { - this._chartList[i].refresh && this._chartList[i].refresh(magicOption); - } - this.component.grid && this.component.grid.refixAxisShape(this.component); - this._zr.refresh(); - }, - - /** - * 释放图表实例 - */ - _disposeChartList : function () { - this._clearEffect(); - - // 停止动画 - this._zr.clearAnimation(); - - var len = this._chartList.length; - while (len--) { - var chart = this._chartList[len]; - - if (chart) { - var chartType = chart.type; - this.chart[chartType] && delete this.chart[chartType]; - this.component[chartType] && delete this.component[chartType]; - chart.dispose && chart.dispose(); - } - } - - this._chartList = []; - }, - - /** - * 非图表全局属性merge~~ - */ - _mergeGlobalConifg : function (magicOption) { - var mergeList = [ - // 背景颜色 - 'backgroundColor', - - // 拖拽重计算相关 - 'calculable', 'calculableColor', 'calculableHolderColor', - - // 孤岛显示连接符 - 'nameConnector', 'valueConnector', - - // 动画相关 - 'animation', 'animationThreshold', 'animationDuration', - 'animationEasing', 'addDataAnimation', - - // 默认标志图形类型列表 - 'symbolList', - - // 降低图表内元素拖拽敏感度,单位ms,不建议外部干预 - 'DRAG_ENABLE_TIME' - ]; - - var len = mergeList.length; - while (len--) { - var mergeItem = mergeList[len]; - if (magicOption[mergeItem] == null) { - magicOption[mergeItem] = this._themeConfig[mergeItem]; - } - } - - // 数值系列的颜色列表,不传则采用内置颜色,可配数组,借用zrender实例注入,会有冲突风险,先这样 - var themeColor = magicOption.color; - if (!(themeColor && themeColor.length)) { - themeColor = this._themeConfig.color; - } - - this._zr.getColor = function (idx) { - var zrColor = require('zrender/tool/color'); - return zrColor.getColor(idx, themeColor); - }; - }, - - /** - * 万能接口,配置图表实例任何可配置选项,多次调用时option选项做merge处理 - * @param {Object} option - * @param {boolean=} notMerge 多次调用时option选项是默认是合并(merge)的, - * 如果不需求,可以通过notMerger参数为true阻止与上次option的合并 - */ - setOption : function (option, notMerge) { - if (!option.timeline) { - return this._setOption(option, notMerge); - } - else { - return this._setTimelineOption(option); - } - }, - - /** - * 万能接口,配置图表实例任何可配置选项,多次调用时option选项做merge处理 - * @param {Object} option - * @param {boolean=} notMerge 多次调用时option选项是默认是合并(merge)的, - * 如果不需求,可以通过notMerger参数为true阻止与上次option的合并 - */ - _setOption : function (option, notMerge) { - if (!notMerge && this._option) { - this._option = zrUtil.merge( - this.getOption(), - zrUtil.clone(option), - true - ); - } - else { - this._option = zrUtil.clone(option); - } - - this._optionRestore = zrUtil.clone(this._option); - - if (!this._option.series || this._option.series.length === 0) { - this._zr.clear(); - return; - } - - if (this.component.dataZoom // 存在dataZoom控件 - && (this._option.dataZoom // 并且新option也存在 - || (this._option.toolbox - && this._option.toolbox.feature - && this._option.toolbox.feature.dataZoom - && this._option.toolbox.feature.dataZoom.show - ) - ) - ) { - // dataZoom同步数据 - this.component.dataZoom.syncOption(this._option); - } - this._toolbox.reset(this._option); - this._render(this._option); - return this; - }, - - /** - * 返回内部持有的当前显示option克隆 - */ - getOption : function () { - var magicOption = zrUtil.clone(this._option); - - var self = this; - function restoreOption(prop) { - var restoreSource = self._optionRestore[prop]; - - if (restoreSource) { - if (restoreSource instanceof Array) { - var len = restoreSource.length; - while (len--) { - magicOption[prop][len].data = zrUtil.clone( - restoreSource[len].data - ); - } - } - else { - magicOption[prop].data = zrUtil.clone(restoreSource.data); - } - } - } - - // 横轴数据还原 - restoreOption('xAxis'); - - // 纵轴数据还原 - restoreOption('yAxis'); - - // 系列数据还原 - restoreOption('series'); - - return magicOption; - }, - - /** - * 数据设置快捷接口 - * @param {Array} series - * @param {boolean=} notMerge 多次调用时option选项是默认是合并(merge)的, - * 如果不需求,可以通过notMerger参数为true阻止与上次option的合并。 - */ - setSeries : function (series, notMerge) { - if (!notMerge) { - this.setOption({series: series}); - } - else { - this._option.series = series; - this.setOption(this._option, notMerge); - } - return this; - }, - - /** - * 返回内部持有的当前显示series克隆 - */ - getSeries : function () { - return this.getOption().series; - }, - - /** - * timelineOption接口,配置图表实例任何可配置选项 - * @param {Object} option - */ - _setTimelineOption : function(option) { - this._timeline && this._timeline.dispose(); - var Timeline = require('./component/timeline'); - var timeline = new Timeline( - this._themeConfig, this._messageCenter, this._zr, option, this - ); - this._timeline = timeline; - this.component.timeline = this._timeline; - - return this; - }, - - /** - * 动态数据添加 - * 形参为单组数据参数,多组时为数据,内容同[seriesIdx, data, isShift, additionData] - * @param {number} seriesIdx 系列索引 - * @param {number | Object} data 增加数据 - * @param {boolean=} isHead 是否队头加入,默认,不指定或false时为队尾插入 - * @param {boolean=} dataGrow 是否增长数据队列长度,默认,不指定或false时移出目标数组对位数据 - * @param {string=} additionData 是否增加类目轴(饼图为图例)数据,附加操作同isHead和dataGrow - */ - addData : function (seriesIdx, data, isHead, dataGrow, additionData) { - var params = seriesIdx instanceof Array - ? seriesIdx - : [[seriesIdx, data, isHead, dataGrow, additionData]]; - - //this._optionRestore 和 magicOption 都要同步 - var magicOption = this.getOption(); - var optionRestore = this._optionRestore; - for (var i = 0, l = params.length; i < l; i++) { - seriesIdx = params[i][0]; - data = params[i][1]; - isHead = params[i][2]; - dataGrow = params[i][3]; - additionData = params[i][4]; - - - var seriesItem = optionRestore.series[seriesIdx]; - var inMethod = isHead ? 'unshift' : 'push'; - var outMethod = isHead ? 'pop' : 'shift'; - if (seriesItem) { - var seriesItemData = seriesItem.data; - var mSeriesItemData = magicOption.series[seriesIdx].data; - - seriesItemData[inMethod](data); - mSeriesItemData[inMethod](data); - if (!dataGrow) { - seriesItemData[outMethod](); - data = mSeriesItemData[outMethod](); - } - - - if (additionData != null) { - var legend; - var legendData; - - if (seriesItem.type == ecConfig.CHART_TYPE_PIE - && (legend = optionRestore.legend) - && (legendData = legend.data) - ) { - var mLegendData = magicOption.legend.data; - legendData[inMethod](additionData); - mLegendData[inMethod](additionData); - - if (!dataGrow) { - var legendDataIdx = zrUtil.indexOf(legendData, data.name); - legendDataIdx != -1 && legendData.splice(legendDataIdx, 1); - - legendDataIdx = zrUtil.indexOf(mLegendData, data.name); - legendDataIdx != -1 && mLegendData.splice(legendDataIdx, 1); - } - } - else if (optionRestore.xAxis != null && optionRestore.yAxis != null) { - // x轴类目 - var axisData; - var mAxisData; - var axisIdx = seriesItem.xAxisIndex || 0; - - if (typeof optionRestore.xAxis[axisIdx].type == 'undefined' - || optionRestore.xAxis[axisIdx].type == 'category' - ) { - axisData = optionRestore.xAxis[axisIdx].data; - mAxisData = magicOption.xAxis[axisIdx].data; - - axisData[inMethod](additionData); - mAxisData[inMethod](additionData); - if (!dataGrow) { - axisData[outMethod](); - mAxisData[outMethod](); - } - } - - // y轴类目 - axisIdx = seriesItem.yAxisIndex || 0; - if (optionRestore.yAxis[axisIdx].type == 'category') { - axisData = optionRestore.yAxis[axisIdx].data; - mAxisData = magicOption.yAxis[axisIdx].data; - - axisData[inMethod](additionData); - mAxisData[inMethod](additionData); - if (!dataGrow) { - axisData[outMethod](); - mAxisData[outMethod](); - } - } - } - } - - // 同步图表内状态,动画需要 - this._option.series[seriesIdx].data = magicOption.series[seriesIdx].data; - } - } - - this._zr.clearAnimation(); - var chartList = this._chartList; - for (var i = 0, l = chartList.length; i < l; i++) { - if (magicOption.addDataAnimation && chartList[i].addDataAnimation) { - chartList[i].addDataAnimation(params); - } - } - - // dataZoom同步数据 - this.component.dataZoom && this.component.dataZoom.syncOption(magicOption); - - this._option = magicOption; - var self = this; - setTimeout(function (){ - if (!self._zr) { - return; // 已经被释放 - } - self._zr.clearAnimation(); - for (var i = 0, l = chartList.length; i < l; i++) { - // 有addData动画就去掉过渡动画 - chartList[i].motionlessOnce = - magicOption.addDataAnimation && chartList[i].addDataAnimation; - } - self._messageCenter.dispatch( - ecConfig.EVENT.REFRESH, - null, - {option: magicOption}, - self - ); - }, magicOption.addDataAnimation ? 500 : 0); - return this; - }, - - /** - * 动态[标注 | 标线]添加 - * @param {number} seriesIdx 系列索引 - * @param {Object} markData [标注 | 标线]对象,支持多个 - */ - addMarkPoint : function (seriesIdx, markData) { - return this._addMark(seriesIdx, markData, 'markPoint'); - }, - - addMarkLine : function (seriesIdx, markData) { - return this._addMark(seriesIdx, markData, 'markLine'); - }, - - _addMark : function (seriesIdx, markData, markType) { - var series = this._option.series; - var seriesItem; - - if (series && (seriesItem = series[seriesIdx])) { - var seriesR = this._optionRestore.series; - var seriesRItem = seriesR[seriesIdx]; - var markOpt = seriesItem[markType]; - var markOptR = seriesRItem[markType]; - - markOpt = seriesItem[markType] = markOpt || {data: []}; - markOptR = seriesRItem[markType] = markOptR || {data: []}; - - for (var key in markData) { - if (key == 'data') { - // 数据concat - markOpt.data = markOpt.data.concat(markData.data); - markOptR.data = markOptR.data.concat(markData.data); - } - else if (typeof markData[key] != 'object' - || typeof markOpt[key] == 'undefined' - ) { - // 简单类型或新值直接赋值 - markOpt[key] = markOptR[key] = markData[key]; - } - else { - // 非数据的复杂对象merge - zrUtil.merge(markOpt[key], markData[key], true); - zrUtil.merge(markOptR[key], markData[key], true); - } - } - - var chart = this.chart[seriesItem.type]; - chart && chart.addMark(seriesIdx, markData, markType); - } - - return this; - }, - - /** - * 动态[标注 | 标线]删除 - * @param {number} seriesIdx 系列索引 - * @param {string} markName [标注 | 标线]名称 - */ - delMarkPoint : function (seriesIdx, markName) { - return this._delMark(seriesIdx, markName, 'markPoint'); - }, - - delMarkLine : function (seriesIdx, markName) { - return this._delMark(seriesIdx, markName, 'markLine'); - }, - - _delMark : function (seriesIdx, markName, markType) { - var series = this._option.series; - var seriesItem; - var mark; - var dataArray; - - if (!( - series - && (seriesItem = series[seriesIdx]) - && (mark = seriesItem[markType]) - && (dataArray = mark.data) - ) - ) { - return this; - } - - markName = markName.split(' > '); - var targetIndex = -1; - - for (var i = 0, l = dataArray.length; i < l; i++) { - var dataItem = dataArray[i]; - if (dataItem instanceof Array) { - if (dataItem[0].name == markName[0] - && dataItem[1].name == markName[1] - ) { - targetIndex = i; - break; - } - } - else if (dataItem.name == markName[0]) { - targetIndex = i; - break; - } - } - - if (targetIndex > -1) { - dataArray.splice(targetIndex, 1); - this._optionRestore.series[seriesIdx][markType].data.splice(targetIndex, 1); - - var chart = this.chart[seriesItem.type]; - chart && chart.delMark(seriesIdx, markName.join(' > '), markType); - } - - return this; - }, - - /** - * 获取当前dom - */ - getDom : function () { - return this.dom; - }, - - /** - * 获取当前zrender实例,可用于添加额为的shape和深度控制 - */ - getZrender : function () { - return this._zr; - }, - - /** - * 获取Base64图片dataURL - * @param {string} imgType 图片类型,支持png|jpeg,默认为png - * @return imgDataURL - */ - getDataURL : function (imgType) { - if (!_canvasSupported) { - return ''; - } - - if (this._chartList.length === 0) { - // 渲染为图片 - var imgId = 'IMG' + this.id; - var img = document.getElementById(imgId); - if (img) { - return img.src; - } - } - - // 清除可能存在的tooltip元素 - var tooltip = this.component.tooltip; - tooltip && tooltip.hideTip(); - - switch (imgType) { - case 'jpeg': - break; - default: - imgType = 'png'; - } - - var bgColor = this._option.backgroundColor; - if (bgColor && bgColor.replace(' ','') == 'rgba(0,0,0,0)') { - bgColor = '#fff'; - } - - return this._zr.toDataURL('image/' + imgType, bgColor); - }, - - /** - * 获取img - * @param {string} imgType 图片类型,支持png|jpeg,默认为png - * @return img dom - */ - getImage : function (imgType) { - var title = this._optionRestore.title; - var imgDom = document.createElement('img'); - imgDom.src = this.getDataURL(imgType); - imgDom.title = (title && title.text) || 'ECharts'; - return imgDom; - }, - - /** - * 获取多图联动的Base64图片dataURL - * @param {string} imgType 图片类型,支持png|jpeg,默认为png - * @return imgDataURL - */ - getConnectedDataURL : function (imgType) { - if (!this.isConnected()) { - return this.getDataURL(imgType); - } - - var tempDom = this.dom; - var imgList = { - 'self' : { - img : this.getDataURL(imgType), - left : tempDom.offsetLeft, - top : tempDom.offsetTop, - right : tempDom.offsetLeft + tempDom.offsetWidth, - bottom : tempDom.offsetTop + tempDom.offsetHeight - } - }; - - var minLeft = imgList.self.left; - var minTop = imgList.self.top; - var maxRight = imgList.self.right; - var maxBottom = imgList.self.bottom; - - for (var c in this._connected) { - tempDom = this._connected[c].getDom(); - imgList[c] = { - img : this._connected[c].getDataURL(imgType), - left : tempDom.offsetLeft, - top : tempDom.offsetTop, - right : tempDom.offsetLeft + tempDom.offsetWidth, - bottom : tempDom.offsetTop + tempDom.offsetHeight - }; - - minLeft = Math.min(minLeft, imgList[c].left); - minTop = Math.min(minTop, imgList[c].top); - maxRight = Math.max(maxRight, imgList[c].right); - maxBottom = Math.max(maxBottom, imgList[c].bottom); - } - - var zrDom = document.createElement('div'); - zrDom.style.position = 'absolute'; - zrDom.style.left = '-4000px'; - zrDom.style.width = (maxRight - minLeft) + 'px'; - zrDom.style.height = (maxBottom - minTop) + 'px'; - document.body.appendChild(zrDom); - - var zrImg = require('zrender').init(zrDom); - - var ImageShape = require('zrender/shape/Image'); - for (var c in imgList) { - zrImg.addShape(new ImageShape({ - style : { - x : imgList[c].left - minLeft, - y : imgList[c].top - minTop, - image : imgList[c].img - } - })); - } - - zrImg.render(); - var bgColor = this._option.backgroundColor; - if (bgColor && bgColor.replace(/ /g, '') == 'rgba(0,0,0,0)') { - bgColor = '#fff'; - } - - var image = zrImg.toDataURL('image/png', bgColor); - - setTimeout(function () { - zrImg.dispose(); - zrDom.parentNode.removeChild(zrDom); - zrDom = null; - }, 100); - - return image; - }, - - /** - * 获取多图联动的img - * @param {string} imgType 图片类型,支持png|jpeg,默认为png - * @return img dom - */ - getConnectedImage : function (imgType) { - var title = this._optionRestore.title; - var imgDom = document.createElement('img'); - imgDom.src = this.getConnectedDataURL(imgType); - imgDom.title = (title && title.text) || 'ECharts'; - return imgDom; - }, - - /** - * 外部接口绑定事件 - * @param {Object} eventName 事件名称 - * @param {Object} eventListener 事件响应函数 - */ - on : function (eventName, eventListener) { - this._messageCenterOutSide.bind(eventName, eventListener, this); - return this; - }, - - /** - * 外部接口解除事件绑定 - * @param {Object} eventName 事件名称 - * @param {Object} eventListener 事件响应函数 - */ - un : function (eventName, eventListener) { - this._messageCenterOutSide.unbind(eventName, eventListener); - return this; - }, - - /** - * 多图联动 - * @param connectTarget{ECharts | Array } connectTarget 联动目标 - */ - connect : function (connectTarget) { - if (!connectTarget) { - return this; - } - - if (!this._connected) { - this._connected = {}; - } - - if (connectTarget instanceof Array) { - for (var i = 0, l = connectTarget.length; i < l; i++) { - this._connected[connectTarget[i].id] = connectTarget[i]; - } - } - else { - this._connected[connectTarget.id] = connectTarget; - } - - return this; - }, - - /** - * 解除多图联动 - * @param connectTarget{ECharts | Array } connectTarget 解除联动目标 - */ - disConnect : function (connectTarget) { - if (!connectTarget || !this._connected) { - return this; - } - - if (connectTarget instanceof Array) { - for (var i = 0, l = connectTarget.length; i < l; i++) { - delete this._connected[connectTarget[i].id]; - } - } - else { - delete this._connected[connectTarget.id]; - } - - for (var k in this._connected) { - return k, this; // 非空 - } - - // 空,转为标志位 - this._connected = false; - return this; - }, - - /** - * 联动事件响应 - */ - connectedEventHandler : function (param) { - if (param.__echartsId != this.id) { - // 来自其他联动图表的事件 - this._onevent(param); - } - }, - - /** - * 是否存在多图联动 - */ - isConnected : function () { - return !!this._connected; - }, - - /** - * 显示loading过渡 - * @param {Object} loadingOption - */ - showLoading : function (loadingOption) { - var effectList = { - bar : require('zrender/loadingEffect/Bar'), - bubble : require('zrender/loadingEffect/Bubble'), - dynamicLine : require('zrender/loadingEffect/DynamicLine'), - ring : require('zrender/loadingEffect/Ring'), - spin : require('zrender/loadingEffect/Spin'), - whirling : require('zrender/loadingEffect/Whirling') - }; - this._toolbox.hideDataView(); - - loadingOption = loadingOption || {}; - - var textStyle = loadingOption.textStyle || {}; - loadingOption.textStyle = textStyle; - - var finalTextStyle = zrUtil.merge( - zrUtil.clone(textStyle), - this._themeConfig.textStyle - ); - textStyle.textFont = finalTextStyle.fontStyle + ' ' - + finalTextStyle.fontWeight + ' ' - + finalTextStyle.fontSize + 'px ' - + finalTextStyle.fontFamily; - - textStyle.text = loadingOption.text || this._themeConfig.loadingText; - - if (loadingOption.x != null) { - textStyle.x = loadingOption.x; - } - if (loadingOption.y != null) { - textStyle.y = loadingOption.y; - } - - loadingOption.effectOption = loadingOption.effectOption || {}; - loadingOption.effectOption.textStyle = textStyle; - - var Effect = loadingOption.effect; - if (typeof Effect == 'string' || Effect == null) { - Effect = effectList[loadingOption.effect || 'spin']; - } - this._zr.showLoading(new Effect(loadingOption.effectOption)); - return this; - }, - - /** - * 隐藏loading过渡 - */ - hideLoading : function () { - this._zr.hideLoading(); - return this; - }, - - /** - * 主题设置 - */ - setTheme : function (theme) { - if (theme) { - if (typeof theme === 'string') { - // 默认主题 - switch (theme) { - // case 'themename': - // theme = require('./theme/themename'); - default: - theme = require('./theme/default'); - } - } - else { - theme = theme || {}; - } - - // 复位默认配置 - // this._themeConfig会被别的对象引用持有 - // 所以不能改成this._themeConfig = {}; - for (var key in this._themeConfig) { - delete this._themeConfig[key]; - } - for (var key in ecConfig) { - this._themeConfig[key] = zrUtil.clone(ecConfig[key]); - } - - // 颜色数组随theme,不merge - theme.color && (this._themeConfig.color = []); - - // 默认标志图形类型列表,不merge - theme.symbolList && (this._themeConfig.symbolList = []); - - // 应用新主题 - zrUtil.merge(this._themeConfig, zrUtil.clone(theme), true); - } - - if (!_canvasSupported) { // IE8- - this._themeConfig.textStyle.fontFamily = this._themeConfig.textStyle.fontFamily2; - } - - this._timeline && this._timeline.setTheme(true); - this._optionRestore && this.restore(); - }, - - /** - * 视图区域大小变化更新,不默认绑定,供使用方按需调用 - */ - resize : function () { - var self = this; - return function(){ - self._clearEffect(); - self._zr.resize(); - if (self._option && self._option.renderAsImage && _canvasSupported) { - // 渲染为图片重走render模式 - self._render(self._option); - return self; - } - // 停止动画 - self._zr.clearAnimation(); - self._island.resize(); - self._toolbox.resize(); - self._timeline && self._timeline.resize(); - // 先来后到,不能仅刷新自己,也不能在上一个循环中刷新,如坐标系数据改变会影响其他图表的大小 - // 所以安顺序刷新各种图表,图表内部refresh优化无需更新则不更新~ - for (var i = 0, l = self._chartList.length; i < l; i++) { - self._chartList[i].resize && self._chartList[i].resize(); - } - self.component.grid && self.component.grid.refixAxisShape(self.component); - self._zr.refresh(); - self._messageCenter.dispatch(ecConfig.EVENT.RESIZE, null, null, self); - return self; - }; - }, - - _clearEffect : function() { - this._zr.modLayer(ecConfig.EFFECT_ZLEVEL, {motionBlur : false}); - this._zr.painter.clearLayer(ecConfig.EFFECT_ZLEVEL); - }, - - /** - * 清除已渲染内容 ,clear后echarts实例可用 - */ - clear : function () { - this._disposeChartList(); - this._zr.clear(); - this._option = {}; - this._optionRestore = {}; - return this; - }, - - /** - * 释放,dispose后echarts实例不可用 - */ - dispose : function () { - var key = this.dom.getAttribute(DOM_ATTRIBUTE_KEY); - key && delete _instances[key]; - - this._island.dispose(); - this._toolbox.dispose(); - this._timeline && this._timeline.dispose(); - this._messageCenter.unbind(); - this.clear(); - this._zr.dispose(); - this._zr = null; - } - }; - - return self; -}); -define('echarts', ['echarts/echarts'], function (main) { return main; }); - -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:仪表盘指针 - * 可配图形属性: - { - // 基础属性 - shape : 'gauge-pointer', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - xStart : {number}, // 必须,起点横坐标 - yStart : {number}, // 必须,起点纵坐标 - xEnd : {number}, // 必须,终点横坐标 - yEnd : {number}, // 必须,终点纵坐标 - strokeColor : {color}, // 默认为'#000',线条颜色(轮廓),支持rgba - lineWidth : {number}, // 线条宽度 - }, - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - */ -define('echarts/util/shape/GaugePointer',['require','zrender/shape/Base','zrender/tool/util','./normalIsCover'],function (require) { - var Base = require('zrender/shape/Base'); - var zrUtil = require('zrender/tool/util'); - - function GaugePointer(options) { - Base.call(this, options); - } - - GaugePointer.prototype = { - type: 'gauge-pointer', - /** - * 创建矩形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function (ctx, style) { - var r = style.r; - var width = style.width; - var angle = style.angle; - var x = style.x - Math.cos(angle) * width * (width >= r / 3 ? 1 : 2); - var y = style.y + Math.sin(angle) * width * (width >= r / 3 ? 1 : 2); - - angle = style.angle - Math.PI / 2; - ctx.moveTo(x, y); - ctx.lineTo( - style.x + Math.cos(angle) * width, - style.y - Math.sin(angle) * width - ); - ctx.lineTo( - style.x + Math.cos(style.angle) * r, - style.y - Math.sin(style.angle) * r - ); - ctx.lineTo( - style.x - Math.cos(angle) * width, - style.y + Math.sin(angle) * width - ); - ctx.lineTo(x, y); - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function(style) { - if (style.__rect) { - return style.__rect; - } - - var width = style.width * 2; - var xStart = style.x; - var yStart = style.y; - var xEnd = xStart + Math.cos(style.angle) * style.r; - var yEnd = yStart - Math.sin(style.angle) * style.r; - - style.__rect = { - x : Math.min(xStart, xEnd) - width, - y : Math.min(yStart, yEnd) - width, - width : Math.abs(xStart - xEnd) + width, - height : Math.abs(yStart - yEnd) + width - }; - return style.__rect; - }, - - isCover : require('./normalIsCover') - }; - - zrUtil.inherits(GaugePointer, Base); - - return GaugePointer; -}); - -/** - * echarts图表类:仪表盘 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/chart/gauge',['require','../component/base','./base','../util/shape/GaugePointer','zrender/shape/Text','zrender/shape/Line','zrender/shape/Rectangle','zrender/shape/Circle','zrender/shape/Sector','../config','../util/ecData','../util/accMath','zrender/tool/util','../chart'],function (require) { - var ComponentBase = require('../component/base'); - var ChartBase = require('./base'); - - // 图形依赖 - var GaugePointerShape = require('../util/shape/GaugePointer'); - var TextShape = require('zrender/shape/Text'); - var LineShape = require('zrender/shape/Line'); - var RectangleShape = require('zrender/shape/Rectangle'); - var CircleShape = require('zrender/shape/Circle'); - var SectorShape = require('zrender/shape/Sector'); - - var ecConfig = require('../config'); - var ecData = require('../util/ecData'); - var accMath = require('../util/accMath'); - var zrUtil = require('zrender/tool/util'); - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} series 数据 - * @param {Object} component 组件 - */ - function Gauge(ecTheme, messageCenter, zr, option, myChart){ - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); - // 图表基类 - ChartBase.call(this); - this.refresh(option); - } - - Gauge.prototype = { - type : ecConfig.CHART_TYPE_GAUGE, - /** - * 绘制图形 - */ - _buildShape : function () { - var series = this.series; - // 复用参数索引 - this._paramsMap = {}; - for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type == ecConfig.CHART_TYPE_GAUGE) { - series[i] = this.reformOption(series[i]); - this._buildSingleGauge(i); - this.buildMark(i); - } - } - - this.addShapeList(); - }, - - /** - * 构建单个仪表盘 - * - * @param {number} seriesIndex 系列索引 - */ - _buildSingleGauge : function (seriesIndex) { - var serie = this.series[seriesIndex]; - - this._paramsMap[seriesIndex] = { - center : this.parseCenter(this.zr, serie.center), - radius : this.parseRadius(this.zr, serie.radius), - startAngle : serie.startAngle.toFixed(2) - 0, - endAngle : serie.endAngle.toFixed(2) - 0 - }; - this._paramsMap[seriesIndex].totalAngle = this._paramsMap[seriesIndex].startAngle - - this._paramsMap[seriesIndex].endAngle; - - this._colorMap(seriesIndex); - - this._buildAxisLine(seriesIndex); - - this._buildSplitLine(seriesIndex); - - this._buildAxisTick(seriesIndex); - - this._buildAxisLabel(seriesIndex); - - this._buildPointer(seriesIndex); - - this._buildTitle(seriesIndex); - - this._buildDetail(seriesIndex); - }, - - // 轴线 - _buildAxisLine : function (seriesIndex) { - var serie = this.series[seriesIndex]; - if (!serie.axisLine.show) { - return; - } - var min = serie.min; - var total = serie.max - min; - var params = this._paramsMap[seriesIndex]; - var center = params.center; - var startAngle = params.startAngle; - var totalAngle = params.totalAngle; - var colorArray = params.colorArray; - var lineStyle = serie.axisLine.lineStyle; - var lineWidth = this.parsePercent(lineStyle.width, params.radius[1]); - var r = params.radius[1]; - var r0 = r - lineWidth; - - var sectorShape; - var lastAngle = startAngle; - var newAngle; - for (var i = 0, l = colorArray.length; i < l; i++) { - newAngle = startAngle - totalAngle * (colorArray[i][0] - min) / total; - sectorShape = this._getSector( - center, r0, r, - newAngle, // startAngle - lastAngle, // endAngle - colorArray[i][1], // color - lineStyle - ); - lastAngle = newAngle; - sectorShape._animationAdd = 'r'; - ecData.set(sectorShape, 'seriesIndex', seriesIndex); - ecData.set(sectorShape, 'dataIndex', i); - this.shapeList.push(sectorShape); - } - }, - - // 坐标轴分割线 - _buildSplitLine : function (seriesIndex) { - var serie = this.series[seriesIndex]; - if (!serie.splitLine.show) { - return; - } - - var params = this._paramsMap[seriesIndex]; - var splitNumber = serie.splitNumber; - var min = serie.min; - var total = serie.max - min; - var splitLine = serie.splitLine; - var length = this.parsePercent( - splitLine.length, params.radius[1] - ); - var lineStyle = splitLine.lineStyle; - var color = lineStyle.color; - var center = params.center; - var startAngle = params.startAngle * Math.PI / 180; - var totalAngle = params.totalAngle * Math.PI / 180; - var r = params.radius[1]; - var r0 = r - length; - - var angle; - var sinAngle; - var cosAngle; - for (var i = 0; i <= splitNumber; i++) { - angle = startAngle - totalAngle / splitNumber * i; - sinAngle = Math.sin(angle); - cosAngle = Math.cos(angle); - this.shapeList.push(new LineShape({ - zlevel : this._zlevelBase + 1, - hoverable : false, - style : { - xStart : center[0] + cosAngle * r, - yStart : center[1] - sinAngle * r, - xEnd : center[0] + cosAngle * r0, - yEnd : center[1] - sinAngle * r0, - strokeColor : color == 'auto' - ? this._getColor(seriesIndex, min + total / splitNumber * i) - : color, - lineType : lineStyle.type, - lineWidth : lineStyle.width, - shadowColor : lineStyle.shadowColor, - shadowBlur: lineStyle.shadowBlur, - shadowOffsetX: lineStyle.shadowOffsetX, - shadowOffsetY: lineStyle.shadowOffsetY - } - })); - } - }, - - // 小标记 - _buildAxisTick : function (seriesIndex) { - var serie = this.series[seriesIndex]; - if (!serie.axisTick.show) { - return; - } - - var params = this._paramsMap[seriesIndex]; - var splitNumber = serie.splitNumber; - var min = serie.min; - var total = serie.max - min; - var axisTick = serie.axisTick; - var tickSplit = axisTick.splitNumber; - var length = this.parsePercent( - axisTick.length, params.radius[1] - ); - var lineStyle = axisTick.lineStyle; - var color = lineStyle.color; - - var center = params.center; - var startAngle = params.startAngle * Math.PI / 180; - var totalAngle = params.totalAngle * Math.PI / 180; - var r = params.radius[1]; - var r0 = r - length; - - var angle; - var sinAngle; - var cosAngle; - for (var i = 0, l = splitNumber * tickSplit; i <= l; i++) { - if (i % tickSplit === 0) { // 同splitLine - continue; - } - angle = startAngle - totalAngle / l * i; - sinAngle = Math.sin(angle); - cosAngle = Math.cos(angle); - this.shapeList.push(new LineShape({ - zlevel : this._zlevelBase + 1, - hoverable : false, - style : { - xStart : center[0] + cosAngle * r, - yStart : center[1] - sinAngle * r, - xEnd : center[0] + cosAngle * r0, - yEnd : center[1] - sinAngle * r0, - strokeColor : color == 'auto' - ? this._getColor(seriesIndex, min + total / l * i) - : color, - lineType : lineStyle.type, - lineWidth : lineStyle.width, - shadowColor : lineStyle.shadowColor, - shadowBlur: lineStyle.shadowBlur, - shadowOffsetX: lineStyle.shadowOffsetX, - shadowOffsetY: lineStyle.shadowOffsetY - } - })); - } - }, - - // 坐标轴文本 - _buildAxisLabel : function (seriesIndex) { - var serie = this.series[seriesIndex]; - if (!serie.axisLabel.show) { - return; - } - - var splitNumber = serie.splitNumber; - var min = serie.min; - var total = serie.max - min; - var textStyle = serie.axisLabel.textStyle; - var textFont = this.getFont(textStyle); - var color = textStyle.color; - - var params = this._paramsMap[seriesIndex]; - var center = params.center; - var startAngle = params.startAngle; - var totalAngle = params.totalAngle; - var r0 = params.radius[1] - - this.parsePercent( - serie.splitLine.length, params.radius[1] - ) - 10; - - var angle; - var sinAngle; - var cosAngle; - var value; - for (var i = 0; i <= splitNumber; i++) { - value = min + accMath.accMul(accMath.accDiv(total , splitNumber) , i); - angle = startAngle - totalAngle / splitNumber * i; - sinAngle = Math.sin(angle * Math.PI / 180); - cosAngle = Math.cos(angle * Math.PI / 180); - angle = (angle + 360) % 360; - this.shapeList.push(new TextShape({ - zlevel : this._zlevelBase + 1, - hoverable : false, - style : { - x : center[0] + cosAngle * r0, - y : center[1] - sinAngle * r0, - color : color == 'auto' ? this._getColor(seriesIndex, value) : color, - text : this._getLabelText(serie.axisLabel.formatter, value), - textAlign : (angle >= 110 && angle <= 250) - ? 'left' - : (angle <= 70 || angle >= 290) - ? 'right' - : 'center', - textBaseline : (angle >= 10 && angle <= 170) - ? 'top' - : (angle >= 190 && angle <= 350) - ? 'bottom' - : 'middle', - textFont : textFont, - shadowColor : textStyle.shadowColor, - shadowBlur: textStyle.shadowBlur, - shadowOffsetX: textStyle.shadowOffsetX, - shadowOffsetY: textStyle.shadowOffsetY - } - })); - } - }, - - _buildPointer : function (seriesIndex) { - var serie = this.series[seriesIndex]; - if (!serie.pointer.show) { - return; - } - var total = serie.max - serie.min; - var pointer = serie.pointer; - - var params = this._paramsMap[seriesIndex]; - var length = this.parsePercent(pointer.length, params.radius[1]); - var width = this.parsePercent(pointer.width, params.radius[1]); - var center = params.center; - var value = this._getValue(seriesIndex); - value = value < serie.max ? value : serie.max; - - var angle = (params.startAngle - params.totalAngle / total * (value - serie.min)) * Math.PI / 180; - var color = pointer.color == 'auto' - ? this._getColor(seriesIndex, value) : pointer.color; - - var pointShape = new GaugePointerShape({ - zlevel : this._zlevelBase + 1, - style : { - x : center[0], - y : center[1], - r : length, - startAngle : params.startAngle * Math.PI / 180, - angle : angle, - color : color, - width : width, - shadowColor : pointer.shadowColor, - shadowBlur: pointer.shadowBlur, - shadowOffsetX: pointer.shadowOffsetX, - shadowOffsetY: pointer.shadowOffsetY - }, - highlightStyle : { - brushType : 'fill', - width : width > 2 ? 2 : (width / 2), - color : '#fff' - } - }); - ecData.pack( - pointShape, - this.series[seriesIndex], seriesIndex, - this.series[seriesIndex].data[0], 0, - this.series[seriesIndex].data[0].name, - value - ); - this.shapeList.push(pointShape); - - this.shapeList.push(new CircleShape({ - zlevel : this._zlevelBase + 2, - hoverable : false, - style : { - x : center[0], - y : center[1], - r : pointer.width / 2.5, - color : '#fff' - } - })); - }, - - _buildTitle : function(seriesIndex) { - var serie = this.series[seriesIndex]; - if (!serie.title.show) { - return; - } - - var data = serie.data[0]; - var name = typeof data.name != 'undefined' ? data.name : ''; - if (name !== '') { - var title = serie.title; - var offsetCenter = title.offsetCenter; - var textStyle = title.textStyle; - var textColor = textStyle.color; - var params = this._paramsMap[seriesIndex]; - var x = params.center[0] + this.parsePercent(offsetCenter[0], params.radius[1]); - var y = params.center[1] + this.parsePercent(offsetCenter[1], params.radius[1]); - this.shapeList.push(new TextShape({ - zlevel : this._zlevelBase - + (Math.abs(x - params.center[0]) + Math.abs(y - params.center[1])) - < textStyle.fontSize * 2 ? 2 : 1, - hoverable : false, - style : { - x : x, - y : y, - color: textColor == 'auto' ? this._getColor(seriesIndex) : textColor, - text: name, - textAlign: 'center', - textFont : this.getFont(textStyle), - shadowColor : textStyle.shadowColor, - shadowBlur: textStyle.shadowBlur, - shadowOffsetX: textStyle.shadowOffsetX, - shadowOffsetY: textStyle.shadowOffsetY - } - })); - } - }, - - _buildDetail : function(seriesIndex) { - var serie = this.series[seriesIndex]; - if (!serie.detail.show) { - return; - } - - var detail = serie.detail; - var offsetCenter = detail.offsetCenter; - var color = detail.backgroundColor; - var textStyle = detail.textStyle; - var textColor = textStyle.color; - - var params = this._paramsMap[seriesIndex]; - var value = this._getValue(seriesIndex); - var x = params.center[0] - detail.width / 2 - + this.parsePercent(offsetCenter[0], params.radius[1]); - var y = params.center[1] - + this.parsePercent(offsetCenter[1], params.radius[1]); - this.shapeList.push(new RectangleShape({ - zlevel : this._zlevelBase - + (Math.abs(x+detail.width/2 - params.center[0]) - + Math.abs(y+detail.height/2 - params.center[1])) - < textStyle.fontSize ? 2 : 1, - hoverable : false, - style : { - x : x, - y : y, - width : detail.width, - height : detail.height, - brushType: 'both', - color: color == 'auto' ? this._getColor(seriesIndex, value) : color, - lineWidth : detail.borderWidth, - strokeColor : detail.borderColor, - - shadowColor : detail.shadowColor, - shadowBlur: detail.shadowBlur, - shadowOffsetX: detail.shadowOffsetX, - shadowOffsetY: detail.shadowOffsetY, - - text: this._getLabelText(detail.formatter, value), - textFont: this.getFont(textStyle), - textPosition: 'inside', - textColor : textColor == 'auto' ? this._getColor(seriesIndex, value) : textColor - } - })); - }, - - _getValue : function(seriesIndex) { - var data = this.series[seriesIndex].data[0]; - return typeof data.value != 'undefined' ? data.value : data; - }, - - /** - * 颜色索引 - */ - _colorMap : function (seriesIndex) { - var serie = this.series[seriesIndex]; - var min = serie.min; - var total = serie.max - min; - var color = serie.axisLine.lineStyle.color; - if (!(color instanceof Array)) { - color = [[1, color]]; - } - var colorArray = []; - for (var i = 0, l = color.length; i < l; i++) { - colorArray.push([color[i][0] * total + min, color[i][1]]); - } - this._paramsMap[seriesIndex].colorArray = colorArray; - }, - - /** - * 自动颜色 - */ - _getColor : function (seriesIndex, value) { - if (typeof value == 'undefined') { - value = this._getValue(seriesIndex); - } - - var colorArray = this._paramsMap[seriesIndex].colorArray; - for (var i = 0, l = colorArray.length; i < l; i++) { - if (colorArray[i][0] >= value) { - return colorArray[i][1]; - } - } - return colorArray[colorArray.length - 1][1]; - }, - - /** - * 构建扇形 - */ - _getSector : function (center, r0, r, startAngle, endAngle, color, lineStyle) { - return new SectorShape ({ - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : center[0], // 圆心横坐标 - y : center[1], // 圆心纵坐标 - r0 : r0, // 圆环内半径 - r : r, // 圆环外半径 - startAngle : startAngle, - endAngle : endAngle, - brushType : 'fill', - color : color, - shadowColor : lineStyle.shadowColor, - shadowBlur: lineStyle.shadowBlur, - shadowOffsetX: lineStyle.shadowOffsetX, - shadowOffsetY: lineStyle.shadowOffsetY - } - }); - }, - - /** - * 根据lable.format计算label text - */ - _getLabelText : function (formatter, value) { - if (formatter) { - if (typeof formatter == 'function') { - return formatter.call(this.myChart, value); - } - else if (typeof formatter == 'string') { - return formatter.replace('{value}', value); - } - } - return value; - }, - - /** - * 刷新 - */ - refresh : function (newOption) { - if (newOption) { - this.option = newOption; - this.series = newOption.series; - } - - this.backupShapeList(); - this._buildShape(); - } - }; - - zrUtil.inherits(Gauge, ChartBase); - zrUtil.inherits(Gauge, ComponentBase); - - // 图表注册 - require('../chart').define('gauge', Gauge); - - return Gauge; -}); -/** - * echarts图表类:漏斗图 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/chart/funnel',['require','../component/base','./base','zrender/shape/Text','zrender/shape/Line','zrender/shape/Polygon','../config','../util/ecData','../util/number','zrender/tool/util','zrender/tool/color','zrender/tool/area','../chart'],function (require) { - var ComponentBase = require('../component/base'); - var ChartBase = require('./base'); - - // 图形依赖 - var TextShape = require('zrender/shape/Text'); - var LineShape = require('zrender/shape/Line'); - var PolygonShape = require('zrender/shape/Polygon'); - - var ecConfig = require('../config'); - var ecData = require('../util/ecData'); - var number = require('../util/number'); - var zrUtil = require('zrender/tool/util'); - var zrColor = require('zrender/tool/color'); - var zrArea = require('zrender/tool/area'); - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} series 数据 - * @param {Object} component 组件 - */ - function Funnel(ecTheme, messageCenter, zr, option, myChart){ - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); - // 图表基类 - ChartBase.call(this); - this.refresh(option); - } - - Funnel.prototype = { - type : ecConfig.CHART_TYPE_FUNNEL, - /** - * 绘制图形 - */ - _buildShape : function () { - var series = this.series; - var legend = this.component.legend; - // 复用参数索引 - this._paramsMap = {}; - this._selected = {}; - this.selectedMap = {}; - - var serieName; - for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type == ecConfig.CHART_TYPE_FUNNEL) { - series[i] = this.reformOption(series[i]); - serieName = series[i].name || ''; - // 系列图例开关 - this.selectedMap[serieName] = - legend ? legend.isSelected(serieName) : true; - if (!this.selectedMap[serieName]) { - continue; - } - this._buildSingleFunnel(i); - this.buildMark(i); - } - } - - this.addShapeList(); - }, - - /** - * 构建单个仪表盘 - * - * @param {number} seriesIndex 系列索引 - */ - _buildSingleFunnel : function (seriesIndex) { - var legend = this.component.legend; - var serie = this.series[seriesIndex]; - var data = this._mapData(seriesIndex); - var location = this._getLocation(seriesIndex); - this._paramsMap[seriesIndex] = { - location : location, - data : data - }; - - var itemName; - var total = 0; - var selectedData = []; - // 计算需要显示的个数和总值 - for (var i = 0, l = data.length; i < l; i++) { - itemName = data[i].name; - if (legend){ - this.selectedMap[itemName] = legend.isSelected(itemName); - } else { - this.selectedMap[itemName] = true; - } - if (this.selectedMap[itemName] && !isNaN(data[i].value)) { - selectedData.push(data[i]); - total++; - } - } - if (total === 0) { - return; - } - // 可计算箱子 - var funnelCase = this._buildFunnelCase(seriesIndex); - var gap = serie.gap; - var height = total > 1 - ? (location.height - (total - 1) * gap) / total : location.height; - var width; - var lastY = location.y; - var lastWidth = serie.sort == 'descending' - ? this._getItemWidth(seriesIndex, selectedData[0].value) - : number.parsePercent(serie.minSize, location.width); - var next = serie.sort == 'descending' ? 1 : 0; - var centerX = location.centerX; - var pointList = [ - [ - centerX - lastWidth / 2 - (lastWidth === 0 ? 0 : 10), - lastY - (lastWidth === 0 ? 10 : 5) - ], - [ - centerX + lastWidth / 2 + (lastWidth === 0 ? 0 : 10), - lastY - (lastWidth === 0 ? 10 : 5) - ] - ]; - for (var i = 0, l = selectedData.length; i < l; i++) { - itemName = selectedData[i].name; - if (this.selectedMap[itemName] && !isNaN(selectedData[i].value)) { - width = i <= l - 2 - ? this._getItemWidth(seriesIndex, selectedData[i + next].value) - : serie.sort == 'descending' - ? number.parsePercent(serie.minSize, location.width) - : number.parsePercent(serie.maxSize, location.width); - this._buildItem( - seriesIndex, selectedData[i]._index, - legend - ? legend.getColor(itemName) : this.zr.getColor(selectedData[i]._index), - centerX - lastWidth / 2, lastY, - lastWidth, width, height - ); - lastY += height + gap; - lastWidth = width; - pointList.unshift([centerX - lastWidth / 2 - 10, lastY]); - pointList.push([centerX + lastWidth / 2 + 10, lastY]); - } - } - if (funnelCase) { - if (lastWidth === 0) { - pointList.pop(); - pointList[0][0] +=10; - pointList[0][1] +=10; - } - else { - pointList[pointList.length - 1][1] +=5; - pointList[0][1] +=5; - } - funnelCase.style.pointList = pointList; - } - }, - - _buildFunnelCase : function(seriesIndex) { - var serie = this.series[seriesIndex]; - if (this.deepQuery([serie, this.option], 'calculable')) { - var location = this._paramsMap[seriesIndex].location; - var gap = 10; - var funnelCase = { - hoverable : false, - style : { - pointListd : [ - [location.x - gap, location.y - gap], - [location.x + location.width + gap, location.y - gap], - [location.x + location.width + gap, location.y + location.height + gap], - [location.x - gap, location.y + location.height + gap] - ], - brushType : 'stroke', - lineWidth : 1, - strokeColor : serie.calculableHolderColor - || this.ecTheme.calculableHolderColor - } - }; - ecData.pack(funnelCase, serie, seriesIndex, undefined, -1); - this.setCalculable(funnelCase); - funnelCase = new PolygonShape(funnelCase); - this.shapeList.push(funnelCase); - return funnelCase; - } - }, - - _getLocation: function (seriesIndex) { - var gridOption = this.series[seriesIndex]; - var zrWidth = this.zr.getWidth(); - var zrHeight = this.zr.getHeight(); - var x = this.parsePercent(gridOption.x, zrWidth); - var y = this.parsePercent(gridOption.y, zrHeight); - - var width; - if (typeof gridOption.width == 'undefined') { - width = zrWidth - x - this.parsePercent(gridOption.x2, zrWidth); - } - else { - width = this.parsePercent(gridOption.width, zrWidth); - } - - var height; - if (typeof gridOption.height == 'undefined') { - height = zrHeight - y - this.parsePercent(gridOption.y2, zrHeight); - } - else { - height = this.parsePercent(gridOption.height, zrHeight); - } - - return { - x : x, - y : y, - width : width, - height : height, - centerX : x + width / 2 - }; - }, - - _mapData : function(seriesIndex) { - var serie = this.series[seriesIndex]; - var funnelData = zrUtil.clone(serie.data); - for (var i = 0, l = funnelData.length; i < l; i++) { - funnelData[i]._index = i; - } - function numDescending (a, b) { - if (a.value == '-') { - return 1; - } - else if (b.value == '-') { - return -1; - } - return b.value - a.value; - } - function numAscending (a, b) { - return -numDescending(a, b); - } - if (serie.sort != 'none') { - funnelData.sort(serie.sort == 'descending' ? numDescending : numAscending); - } - - return funnelData; - }, - - /** - * 构建单个扇形及指标 - */ - _buildItem : function ( - seriesIndex, dataIndex, defaultColor, - x, y, topWidth, bottomWidth, height - ) { - var series = this.series; - var serie = series[seriesIndex]; - var data = serie.data[dataIndex]; - // 漏斗 - var polygon = this.getPolygon( - seriesIndex, dataIndex, defaultColor, - x, y, topWidth, bottomWidth, height - ); - ecData.pack( - polygon, - series[seriesIndex], seriesIndex, - series[seriesIndex].data[dataIndex], dataIndex, - series[seriesIndex].data[dataIndex].name - ); - this.shapeList.push(polygon); - - // 文本标签 - var label = this.getLabel( - seriesIndex, dataIndex, defaultColor, - x, y, topWidth, bottomWidth, height - ); - ecData.pack( - label, - series[seriesIndex], seriesIndex, - series[seriesIndex].data[dataIndex], dataIndex, - series[seriesIndex].data[dataIndex].name - ); - this.shapeList.push(label); - // 特定状态下是否需要显示文本标签 - if (!this._needLabel(serie, data,false)) { - label.invisible = true; - } - - // 文本标签视觉引导线 - var labelLine = this.getLabelLine( - seriesIndex, dataIndex, defaultColor, - x, y, topWidth, bottomWidth, height - ); - this.shapeList.push(labelLine); - // 特定状态下是否需要显示文本标签引导线 - if (!this._needLabelLine(serie, data,false)) { - labelLine.invisible = true; - } - - var polygonHoverConnect = []; - var labelHoverConnect = []; - if (this._needLabelLine(serie, data, true)) { - polygonHoverConnect.push(labelLine.id); - labelHoverConnect.push(labelLine.id); - } - if (this._needLabel(serie, data, true)) { - polygonHoverConnect.push(label.id); - labelHoverConnect.push(polygon.id); - } - polygon.hoverConnect = polygonHoverConnect; - label.hoverConnect = labelHoverConnect; - polygon.onmouseover = label.onmouseover = this.hoverConnect; - }, - - /** - * 根据值计算宽度 - */ - _getItemWidth : function (seriesIndex, value) { - var serie = this.series[seriesIndex]; - var location = this._paramsMap[seriesIndex].location; - var min = serie.min; - var max = serie.max; - var minSize = number.parsePercent(serie.minSize, location.width); - var maxSize = number.parsePercent(serie.maxSize, location.width); - return value * (maxSize - minSize) / (max - min); - }, - - /** - * 构建扇形 - */ - getPolygon : function ( - seriesIndex, dataIndex, defaultColor, - x, y, topWidth, bottomWidth, height - ) { - var serie = this.series[seriesIndex]; - var data = serie.data[dataIndex]; - var queryTarget = [data, serie]; - - // 多级控制 - var normal = this.deepMerge( - queryTarget, - 'itemStyle.normal' - ) || {}; - var emphasis = this.deepMerge( - queryTarget, - 'itemStyle.emphasis' - ) || {}; - var normalColor = this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) - || defaultColor; - - var emphasisColor = this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data) - || (typeof normalColor == 'string' - ? zrColor.lift(normalColor, -0.2) - : normalColor - ); - - var polygon = { - zlevel : this._zlevelBase, - clickable : true, - style : { - pointList : [ - [x, y], - [x + topWidth, y], - [x + topWidth - (topWidth - bottomWidth) / 2, y + height], - [x + (topWidth - bottomWidth) / 2, y + height] - ], - brushType : 'both', - color : normalColor, - lineWidth : normal.borderWidth, - strokeColor : normal.borderColor - }, - highlightStyle : { - color : emphasisColor, - lineWidth : emphasis.borderWidth, - strokeColor : emphasis.borderColor - } - }; - - if (this.deepQuery([data, serie, this.option], 'calculable')) { - this.setCalculable(polygon); - polygon.draggable = true; - } - - return new PolygonShape(polygon); - }, - - /** - * 需要显示则会有返回构建好的shape,否则返回undefined - */ - getLabel : function ( - seriesIndex, dataIndex, defaultColor, - x, y, topWidth, bottomWidth, height - ) { - var serie = this.series[seriesIndex]; - var data = serie.data[dataIndex]; - var location = this._paramsMap[seriesIndex].location; - // serie里有默认配置,放心大胆的用! - var itemStyle = zrUtil.merge( - zrUtil.clone(data.itemStyle) || {}, - serie.itemStyle - ); - var status = 'normal'; - // label配置 - var labelControl = itemStyle[status].label; - var textStyle = labelControl.textStyle || {}; - var lineLength = itemStyle[status].labelLine.length; - - var text = this.getLabelText(seriesIndex, dataIndex, status); - var textFont = this.getFont(textStyle); - var textAlign; - var textX; - var textColor = defaultColor; - labelControl.position = labelControl.position - || itemStyle.normal.label.position; - if (labelControl.position == 'inner' || labelControl.position == 'inside') { - // 内部 - textAlign = 'center'; - textX = x + topWidth / 2; - if (Math.max(topWidth, bottomWidth) / 2 > zrArea.getTextWidth(text, textFont)) { - textColor = '#fff'; - } - else { - textColor = zrColor.reverse(defaultColor); - } - } - else if (labelControl.position == 'left'){ - // 左侧显示 - textAlign = 'right'; - textX = lineLength == 'auto' - ? (location.x - 10) - : (location.centerX - Math.max(topWidth, bottomWidth) / 2 - lineLength); - } - else { - // 右侧显示,默认 labelControl.position == 'outer' || 'right) - textAlign = 'left'; - textX = lineLength == 'auto' - ? (location.x + location.width + 10) - : (location.centerX + Math.max(topWidth, bottomWidth) / 2 + lineLength); - } - - var textShape = { - zlevel : this._zlevelBase + 1, - style : { - x : textX, - y : y + height / 2, - color : textStyle.color || textColor, - text : text, - textAlign : textStyle.align || textAlign, - textBaseline : textStyle.baseline || 'middle', - textFont : textFont - } - }; - - //----------高亮 - status = 'emphasis'; - // label配置 - labelControl = itemStyle[status].label || labelControl; - textStyle = labelControl.textStyle || textStyle; - lineLength = itemStyle[status].labelLine.length || lineLength; - labelControl.position = labelControl.position || itemStyle.normal.label.position; - text = this.getLabelText(seriesIndex, dataIndex, status); - textFont = this.getFont(textStyle); - textColor = defaultColor; - if (labelControl.position == 'inner' || labelControl.position == 'inside') { - // 内部 - textAlign = 'center'; - textX = x + topWidth / 2; - if (Math.max(topWidth, bottomWidth) / 2 > zrArea.getTextWidth(text, textFont)) { - textColor = '#fff'; - } - else { - textColor = zrColor.reverse(defaultColor); - } - } - else if (labelControl.position == 'left'){ - // 左侧显示 - textAlign = 'right'; - textX = lineLength == 'auto' - ? (location.x - 10) - : (location.centerX - Math.max(topWidth, bottomWidth) / 2 - lineLength); - } - else { - // 右侧显示,默认 labelControl.position == 'outer' || 'right) - textAlign = 'left'; - textX = lineLength == 'auto' - ? (location.x + location.width + 10) - : (location.centerX + Math.max(topWidth, bottomWidth) / 2 + lineLength); - } - textShape.highlightStyle = { - x : textX, - color : textStyle.color || textColor, - text : text, - textAlign : textStyle.align || textAlign, - textFont : textFont, - brushType : 'fill' - }; - - return new TextShape(textShape); - }, - - /** - * 根据lable.format计算label text - */ - getLabelText : function (seriesIndex, dataIndex, status) { - var series = this.series; - var serie = series[seriesIndex]; - var data = serie.data[dataIndex]; - var formatter = this.deepQuery( - [data, serie], - 'itemStyle.' + status + '.label.formatter' - ); - - if (formatter) { - if (typeof formatter == 'function') { - return formatter.call( - this.myChart, - serie.name, - data.name, - data.value - ); - } - else if (typeof formatter == 'string') { - formatter = formatter.replace('{a}','{a0}') - .replace('{b}','{b0}') - .replace('{c}','{c0}'); - formatter = formatter.replace('{a0}', serie.name) - .replace('{b0}', data.name) - .replace('{c0}', data.value); - - return formatter; - } - } - else { - return data.name; - } - }, - - /** - * 需要显示则会有返回构建好的shape,否则返回undefined - */ - getLabelLine : function ( - seriesIndex, dataIndex, defaultColor, - x, y, topWidth, bottomWidth, height - ) { - var serie = this.series[seriesIndex]; - var data = serie.data[dataIndex]; - var location = this._paramsMap[seriesIndex].location; - - // serie里有默认配置,放心大胆的用! - var itemStyle = zrUtil.merge( - zrUtil.clone(data.itemStyle) || {}, - serie.itemStyle - ); - var status = 'normal'; - // labelLine配置 - var labelLineControl = itemStyle[status].labelLine; - var lineLength = itemStyle[status].labelLine.length; - var lineStyle = labelLineControl.lineStyle || {}; - - var labelControl = itemStyle[status].label; - labelControl.position = labelControl.position - || itemStyle.normal.label.position; - var xEnd; - if (labelControl.position == 'inner' || labelControl.position == 'inside') { - // 内部 - xEnd = x + topWidth / 2; - } - else if (labelControl.position == 'left'){ - // 左侧显示 - xEnd = lineLength == 'auto' - ? (location.x - 10) - : (location.centerX - Math.max(topWidth, bottomWidth) / 2 - lineLength); - } - else { - // 右侧显示,默认 labelControl.position == 'outer' || 'right) - xEnd = lineLength == 'auto' - ? (location.x + location.width + 10) - : (location.centerX + Math.max(topWidth, bottomWidth) / 2 + lineLength); - } - var lineShape = { - zlevel : this._zlevelBase + 1, - hoverable : false, - style : { - xStart : location.centerX, - yStart : y + height / 2, - xEnd : xEnd, - yEnd : y + height / 2, - strokeColor : lineStyle.color || defaultColor, - lineType : lineStyle.type, - lineWidth : lineStyle.width - } - }; - - status = 'emphasis'; - // labelLine配置 - labelLineControl = itemStyle[status].labelLine || labelLineControl; - lineLength = itemStyle[status].labelLine.length || lineLength; - lineStyle = labelLineControl.lineStyle || lineStyle; - - labelControl = itemStyle[status].label || labelControl; - labelControl.position = labelControl.position; - if (labelControl.position == 'inner' || labelControl.position == 'inside') { - // 内部 - xEnd = x + topWidth / 2; - } - else if (labelControl.position == 'left'){ - // 左侧显示 - xEnd = lineLength == 'auto' - ? (location.x - 10) - : (location.centerX - Math.max(topWidth, bottomWidth) / 2 - lineLength); - } - else { - // 右侧显示,默认 labelControl.position == 'outer' || 'right) - xEnd = lineLength == 'auto' - ? (location.x + location.width + 10) - : (location.centerX + Math.max(topWidth, bottomWidth) / 2 + lineLength); - } - lineShape.highlightStyle = { - xEnd : xEnd, - strokeColor : lineStyle.color || defaultColor, - lineType : lineStyle.type, - lineWidth : lineStyle.width - }; - - return new LineShape(lineShape); - }, - - /** - * 返回特定状态(normal or emphasis)下是否需要显示label标签文本 - * @param {Object} serie - * @param {Object} data - * @param {boolean} isEmphasis true is 'emphasis' and false is 'normal' - */ - _needLabel : function (serie, data, isEmphasis) { - return this.deepQuery( - [data, serie], - 'itemStyle.' - + (isEmphasis ? 'emphasis' : 'normal') - + '.label.show' - ); - }, - - /** - * 返回特定状态(normal or emphasis)下是否需要显示labelLine标签视觉引导线 - * @param {Object} serie - * @param {Object} data - * @param {boolean} isEmphasis true is 'emphasis' and false is 'normal' - */ - _needLabelLine : function (serie, data, isEmphasis) { - return this.deepQuery( - [data, serie], - 'itemStyle.' - + (isEmphasis ? 'emphasis' : 'normal') - +'.labelLine.show' - ); - }, - - /** - * 刷新 - */ - refresh : function (newOption) { - if (newOption) { - this.option = newOption; - this.series = newOption.series; - } - - this.backupShapeList(); - this._buildShape(); - } - }; - - zrUtil.inherits(Funnel, ChartBase); - zrUtil.inherits(Funnel, ComponentBase); - - // 图表注册 - require('../chart').define('funnel', Funnel); - - return Funnel; -}); -/** - * echarts组件: 类目轴 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/component/categoryAxis',['require','./base','zrender/shape/Text','zrender/shape/Line','zrender/shape/Rectangle','../config','zrender/tool/util','zrender/tool/area','../component'],function (require) { - var Base = require('./base'); - - // 图形依赖 - var TextShape = require('zrender/shape/Text'); - var LineShape = require('zrender/shape/Line'); - var RectangleShape = require('zrender/shape/Rectangle'); - - var ecConfig = require('../config'); - var zrUtil = require('zrender/tool/util'); - var zrArea = require('zrender/tool/area'); - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} option 类目轴参数 - * @param {Grid} component 组件 - */ - function CategoryAxis(ecTheme, messageCenter, zr, option, myChart, axisBase) { - if (option.data.length < 1) { - console.error('option.data.length < 1.'); - return; - } - - Base.call(this, ecTheme, messageCenter, zr, option, myChart); - - this.grid = this.component.grid; - - for (var method in axisBase) { - this[method] = axisBase[method]; - } - - this.refresh(option); - } - - CategoryAxis.prototype = { - type : ecConfig.COMPONENT_TYPE_AXIS_CATEGORY, - _getReformedLabel : function (idx) { - var data = typeof this.option.data[idx].value != 'undefined' - ? this.option.data[idx].value - : this.option.data[idx]; - var formatter = this.option.data[idx].formatter - || this.option.axisLabel.formatter; - if (formatter) { - if (typeof formatter == 'function') { - data = formatter.call(this.myChart, data); - } - else if (typeof formatter == 'string') { - data = formatter.replace('{value}', data); - } - } - return data; - }, - - /** - * 计算标签显示挑选间隔 - */ - _getInterval : function () { - var interval = this.option.axisLabel.interval; - if (interval == 'auto') { - // 麻烦的自适应计算 - var fontSize = this.option.axisLabel.textStyle.fontSize; - var data = this.option.data; - var dataLength = this.option.data.length; - - if (this.isHorizontal()) { - // 横向 - if (dataLength > 3) { - var gap = this.getGap(); - var isEnough = false; - var labelSpace; - var labelSize; - var step = Math.floor(0.5 / gap); - step = step < 1 ? 1 : step; - interval = Math.floor(15 / gap); - while (!isEnough && interval < dataLength) { - interval += step; - isEnough = true; - labelSpace = Math.floor(gap * interval); // 标签左右至少间隔为3px - for (var i = Math.floor((dataLength - 1)/ interval) * interval; - i >= 0; i -= interval - ) { - if (this.option.axisLabel.rotate !== 0) { - // 有旋转 - labelSize = fontSize; - } - else if (data[i].textStyle) { - labelSize = zrArea.getTextWidth( - this._getReformedLabel(i), - this.getFont( - zrUtil.merge( - data[i].textStyle, - this.option.axisLabel.textStyle - ) - ) - ); - } - else { - /* - labelSize = zrArea.getTextWidth( - this._getReformedLabel(i), - font - ); - */ - // 不定义data级特殊文本样式,用fontSize优化getTextWidth - var label = this._getReformedLabel(i) + ''; - var wLen = (label.match(/\w/g) || '').length; - var oLen = label.length - wLen; - labelSize = wLen * fontSize * 2 / 3 + oLen * fontSize; - } - - if (labelSpace < labelSize) { - // 放不下,中断循环让interval++ - isEnough = false; - break; - } - } - } - } - else { - // 少于3个则全部显示 - interval = 1; - } - } - else { - // 纵向 - if (dataLength > 3) { - var gap = this.getGap(); - interval = Math.floor(11 / gap); - // 标签上下至少间隔为3px - while ((gap * interval - 6) < fontSize - && interval < dataLength - ) { - interval++; - } - } - else { - // 少于3个则全部显示 - interval = 1; - } - } - } - else { - // 用户自定义间隔 - interval = interval - 0 + 1; - } - - return interval; - }, - - /** - * 绘制图形 - */ - _buildShape : function () { - // 标签显示的挑选间隔 - this._interval = this._getInterval(); - - this.option.splitArea.show && this._buildSplitArea(); - this.option.splitLine.show && this._buildSplitLine(); - this.option.axisLine.show && this._buildAxisLine(); - this.option.axisTick.show && this._buildAxisTick(); - this.option.axisLabel.show && this._buildAxisLabel(); - - for (var i = 0, l = this.shapeList.length; i < l; i++) { - this.zr.addShape(this.shapeList[i]); - } - }, - - // 小标记 - _buildAxisTick : function () { - var axShape; - //var data = this.option.data; - var dataLength = this.option.data.length; - var tickOption = this.option.axisTick; - var length = tickOption.length; - var color = tickOption.lineStyle.color; - var lineWidth = tickOption.lineStyle.width; - var interval = tickOption.interval == 'auto' - ? this._interval : (tickOption.interval - 0 + 1); - var onGap = tickOption.onGap; - var optGap = onGap - ? (this.getGap() / 2) - : typeof onGap == 'undefined' - ? (this.option.boundaryGap ? (this.getGap() / 2) : 0) - : 0; - var startIndex = optGap > 0 ? -interval : 0; - if (this.isHorizontal()) { - // 横向 - var yPosition = this.option.position == 'bottom' - ? (tickOption.inside - ? (this.grid.getYend() - length - 1) : (this.grid.getYend() + 1)) - : (tickOption.inside - ? (this.grid.getY() + 1) : (this.grid.getY() - length - 1)); - var x; - for (var i = startIndex; i < dataLength; i += interval) { - // 亚像素优化 - x = this.subPixelOptimize( - this.getCoordByIndex(i) + (i >= 0 ? optGap : 0), lineWidth - ); - axShape = { - _axisShape : 'axisTick', - zlevel : this._zlevelBase, - hoverable : false, - style : { - xStart : x, - yStart : yPosition, - xEnd : x, - yEnd : yPosition + length, - strokeColor : color, - lineWidth : lineWidth - } - }; - this.shapeList.push(new LineShape(axShape)); - } - } - else { - // 纵向 - var xPosition = this.option.position == 'left' - ? (tickOption.inside - ? (this.grid.getX() + 1) : (this.grid.getX() - length - 1)) - : (tickOption.inside - ? (this.grid.getXend() - length - 1) : (this.grid.getXend() + 1)); - - var y; - for (var i = startIndex; i < dataLength; i += interval) { - // 亚像素优化 - y = this.subPixelOptimize( - this.getCoordByIndex(i) - (i >= 0 ? optGap : 0), lineWidth - ); - axShape = { - _axisShape : 'axisTick', - zlevel : this._zlevelBase, - hoverable : false, - style : { - xStart : xPosition, - yStart : y, - xEnd : xPosition + length, - yEnd : y, - strokeColor : color, - lineWidth : lineWidth - } - }; - this.shapeList.push(new LineShape(axShape)); - } - } - }, - - // 坐标轴文本 - _buildAxisLabel : function () { - var axShape; - var data = this.option.data; - var dataLength = this.option.data.length; - var rotate = this.option.axisLabel.rotate; - var margin = this.option.axisLabel.margin; - var clickable = this.option.axisLabel.clickable; - var textStyle = this.option.axisLabel.textStyle; - var dataTextStyle; - - if (this.isHorizontal()) { - // 横向 - var yPosition; - var baseLine; - if (this.option.position == 'bottom') { - yPosition = this.grid.getYend() + margin; - baseLine = 'top'; - } - else { - yPosition = this.grid.getY() - margin; - baseLine = 'bottom'; - } - - for (var i = 0; i < dataLength; i += this._interval) { - if (this._getReformedLabel(i) === '') { - // 空文本优化 - continue; - } - dataTextStyle = zrUtil.merge( - data[i].textStyle || {}, - textStyle - ); - axShape = { - // shape : 'text', - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : this.getCoordByIndex(i), - y : yPosition, - color : dataTextStyle.color, - text : this._getReformedLabel(i), - textFont : this.getFont(dataTextStyle), - textAlign : dataTextStyle.align || 'center', - textBaseline : dataTextStyle.baseline || baseLine - } - }; - if (rotate) { - axShape.style.textAlign = rotate > 0 - ? (this.option.position == 'bottom' - ? 'right' : 'left') - : (this.option.position == 'bottom' - ? 'left' : 'right'); - axShape.rotation = [ - rotate * Math.PI / 180, - axShape.style.x, - axShape.style.y - ]; - } - this.shapeList.push(new TextShape( - this._axisLabelClickable(clickable, axShape) - )); - } - } - else { - // 纵向 - var xPosition; - var align; - if (this.option.position == 'left') { - xPosition = this.grid.getX() - margin; - align = 'right'; - } - else { - xPosition = this.grid.getXend() + margin; - align = 'left'; - } - - for (var i = 0; i < dataLength; i += this._interval) { - if (this._getReformedLabel(i) === '') { - // 空文本优化 - continue; - } - dataTextStyle = zrUtil.merge( - data[i].textStyle || {}, - textStyle - ); - axShape = { - // shape : 'text', - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : xPosition, - y : this.getCoordByIndex(i), - color : dataTextStyle.color, - text : this._getReformedLabel(i), - textFont : this.getFont(dataTextStyle), - textAlign : dataTextStyle.align || align, - textBaseline : dataTextStyle.baseline - || (i === 0 && this.option.name !== '') - ? 'bottom' - : (i == (dataLength - 1) - && this.option.name !== '') - ? 'top' - : 'middle' - } - }; - - if (rotate) { - axShape.rotation = [ - rotate * Math.PI / 180, - axShape.style.x, - axShape.style.y - ]; - } - this.shapeList.push(new TextShape( - this._axisLabelClickable(clickable, axShape) - )); - } - } - }, - - _buildSplitLine : function () { - var axShape; - //var data = this.option.data; - var dataLength = this.option.data.length; - var sLineOption = this.option.splitLine; - var lineType = sLineOption.lineStyle.type; - var lineWidth = sLineOption.lineStyle.width; - var color = sLineOption.lineStyle.color; - color = color instanceof Array ? color : [color]; - var colorLength = color.length; - - var onGap = sLineOption.onGap; - var optGap = onGap - ? (this.getGap() / 2) - : typeof onGap == 'undefined' - ? (this.option.boundaryGap ? (this.getGap() / 2) : 0) - : 0; - dataLength -= (onGap || (typeof onGap == 'undefined' && this.option.boundaryGap)) - ? 1 : 0; - if (this.isHorizontal()) { - // 横向 - var sy = this.grid.getY(); - var ey = this.grid.getYend(); - var x; - - for (var i = 0; i < dataLength; i += this._interval) { - // 亚像素优化 - x = this.subPixelOptimize( - this.getCoordByIndex(i) + optGap, lineWidth - ); - axShape = { - // shape : 'line', - zlevel : this._zlevelBase, - hoverable : false, - style : { - xStart : x, - yStart : sy, - xEnd : x, - yEnd : ey, - strokeColor : color[(i / this._interval) % colorLength], - lineType : lineType, - lineWidth : lineWidth - } - }; - this.shapeList.push(new LineShape(axShape)); - } - - } - else { - // 纵向 - var sx = this.grid.getX(); - var ex = this.grid.getXend(); - var y; - - for (var i = 0; i < dataLength; i += this._interval) { - // 亚像素优化 - y = this.subPixelOptimize( - this.getCoordByIndex(i) - optGap, lineWidth - ); - axShape = { - // shape : 'line', - zlevel : this._zlevelBase, - hoverable : false, - style : { - xStart : sx, - yStart : y, - xEnd : ex, - yEnd : y, - strokeColor : color[(i / this._interval) % colorLength], - linetype : lineType, - lineWidth : lineWidth - } - }; - this.shapeList.push(new LineShape(axShape)); - } - } - }, - - _buildSplitArea : function () { - var axShape; - var sAreaOption = this.option.splitArea; - var color = sAreaOption.areaStyle.color; - if (!(color instanceof Array)) { - // 非数组一律认为是单一颜色的字符串,单一颜色则用一个背景,颜色错误不负责啊!!! - axShape = { - // shape : 'rectangle', - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : this.grid.getX(), - y : this.grid.getY(), - width : this.grid.getWidth(), - height : this.grid.getHeight(), - color : color - // type : this.option.splitArea.areaStyle.type, - } - }; - this.shapeList.push(new RectangleShape(axShape)); - } - else { - // 多颜色 - var colorLength = color.length; - var dataLength = this.option.data.length; - - var onGap = sAreaOption.onGap; - var optGap = onGap - ? (this.getGap() / 2) - : typeof onGap == 'undefined' - ? (this.option.boundaryGap ? (this.getGap() / 2) : 0) - : 0; - if (this.isHorizontal()) { - // 横向 - var y = this.grid.getY(); - var height = this.grid.getHeight(); - var lastX = this.grid.getX(); - var curX; - - for (var i = 0; i <= dataLength; i += this._interval) { - curX = i < dataLength - ? (this.getCoordByIndex(i) + optGap) - : this.grid.getXend(); - axShape = { - // shape : 'rectangle', - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : lastX, - y : y, - width : curX - lastX, - height : height, - color : color[(i / this._interval) % colorLength] - // type : this.option.splitArea.areaStyle.type, - } - }; - this.shapeList.push(new RectangleShape(axShape)); - lastX = curX; - } - } - else { - // 纵向 - var x = this.grid.getX(); - var width = this.grid.getWidth(); - var lastYend = this.grid.getYend(); - var curY; - - for (var i = 0; i <= dataLength; i += this._interval) { - curY = i < dataLength - ? (this.getCoordByIndex(i) - optGap) - : this.grid.getY(); - axShape = { - // shape : 'rectangle', - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : x, - y : curY, - width : width, - height : lastYend - curY, - color : color[(i / this._interval) % colorLength] - // type : this.option.splitArea.areaStyle.type - } - }; - this.shapeList.push(new RectangleShape(axShape)); - lastYend = curY; - } - } - } - }, - - /** - * 刷新 - */ - refresh : function (newOption) { - if (newOption) { - this.option = this.reformOption(newOption); - // 通用字体设置 - this.option.axisLabel.textStyle = zrUtil.merge( - this.option.axisLabel.textStyle || {}, - this.ecTheme.textStyle - ); - } - this.clear(); - this._buildShape(); - }, - - /** - * 返回间隔 - */ - getGap : function () { - var dataLength = this.option.data.length; - var total = this.isHorizontal() - ? this.grid.getWidth() - : this.grid.getHeight(); - if (this.option.boundaryGap) { // 留空 - return total / dataLength; - } - else { // 顶头 - return total / (dataLength > 1 ? (dataLength - 1) : 1); - } - }, - - // 根据值换算位置 - getCoord : function (value) { - var data = this.option.data; - var dataLength = data.length; - var gap = this.getGap(); - var position = this.option.boundaryGap ? (gap / 2) : 0; - - for (var i = 0; i < dataLength; i++) { - if (data[i] == value - || (typeof data[i].value != 'undefined' - && data[i].value == value) - ) { - if (this.isHorizontal()) { - // 横向 - position = this.grid.getX() + position; - } - else { - // 纵向 - position = this.grid.getYend() - position; - } - - return position; - // Math.floor可能引起一些偏差,但性能会更好 - /* 准确更重要 - return (i === 0 || i == dataLength - 1) - ? position - : Math.floor(position); - */ - } - position += gap; - } - }, - - // 根据类目轴数据索引换算位置 - getCoordByIndex : function (dataIndex) { - if (dataIndex < 0) { - if (this.isHorizontal()) { - return this.grid.getX(); - } - else { - return this.grid.getYend(); - } - } - else if (dataIndex > this.option.data.length - 1) { - if (this.isHorizontal()) { - return this.grid.getXend(); - } - else { - return this.grid.getY(); - } - } - else { - var gap = this.getGap(); - var position = this.option.boundaryGap ? (gap / 2) : 0; - position += dataIndex * gap; - - if (this.isHorizontal()) { - // 横向 - position = this.grid.getX() + position; - } - else { - // 纵向 - position = this.grid.getYend() - position; - } - - return position; - /* 准确更重要 - return (dataIndex === 0 || dataIndex == this.option.data.length - 1) - ? position - : Math.floor(position); - */ - } - }, - - // 根据类目轴数据索引换算类目轴名称 - getNameByIndex : function (dataIndex) { - var data = this.option.data[dataIndex]; - if (typeof data != 'undefined' && typeof data.value != 'undefined') - { - return data.value; - } - else { - return data; - } - }, - - // 根据类目轴名称换算类目轴数据索引 - getIndexByName : function (name) { - var data = this.option.data; - var dataLength = data.length; - - for (var i = 0; i < dataLength; i++) { - if (data[i] == name - || (typeof data[i].value != 'undefined' - && data[i].value == name) - ) { - return i; - } - } - - return -1; - }, - - // 根据位置换算值 - getValueFromCoord : function() { - return ''; - }, - - /** - * 根据类目轴数据索引返回是否为主轴线 - * @param {number} dataIndex 类目轴数据索引 - * @return {boolean} 是否为主轴 - */ - isMainAxis : function (dataIndex) { - return dataIndex % this._interval === 0; - } - }; - - zrUtil.inherits(CategoryAxis, Base); - - require('../component').define('categoryAxis', CategoryAxis); - - return CategoryAxis; -}); -/** - * echarts组件: 数值轴 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','zrender/shape/Line','zrender/shape/Rectangle','../config','zrender/tool/util','../component'],function (require) { - var Base = require('./base'); - - // 图形依赖 - var TextShape = require('zrender/shape/Text'); - var LineShape = require('zrender/shape/Line'); - var RectangleShape = require('zrender/shape/Rectangle'); - - var ecConfig = require('../config'); - var zrUtil = require('zrender/tool/util'); - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} option 类目轴参数 - * @param {Object} component 组件 - * @param {Array} series 数据对象 - */ - function ValueAxis(ecTheme, messageCenter, zr, option, myChart, axisBase, series) { - if (!series || series.length === 0) { - console.err('option.series.length == 0.'); - return; - } - - Base.call(this, ecTheme, messageCenter, zr, option, myChart); - - this.series = series; - this.grid = this.component.grid; - - for (var method in axisBase) { - this[method] = axisBase[method]; - } - - this.refresh(option, series); - } - - ValueAxis.prototype = { - type : ecConfig.COMPONENT_TYPE_AXIS_VALUE, - _buildShape : function () { - this._hasData = false; - this._calculateValue(); - if (!this._hasData) { - return; - } - this.option.splitArea.show && this._buildSplitArea(); - this.option.splitLine.show && this._buildSplitLine(); - this.option.axisLine.show && this._buildAxisLine(); - this.option.axisTick.show && this._buildAxisTick(); - this.option.axisLabel.show && this._buildAxisLabel(); - - for (var i = 0, l = this.shapeList.length; i < l; i++) { - this.zr.addShape(this.shapeList[i]); - } - }, - - // 小标记 - _buildAxisTick : function () { - var axShape; - var data = this._valueList; - var dataLength = this._valueList.length; - var tickOption = this.option.axisTick; - var length = tickOption.length; - var color = tickOption.lineStyle.color; - var lineWidth = tickOption.lineStyle.width; - - if (this.isHorizontal()) { - // 横向 - var yPosition = this.option.position == 'bottom' - ? (tickOption.inside - ? (this.grid.getYend() - length - 1) : (this.grid.getYend()) + 1) - : (tickOption.inside - ? (this.grid.getY() + 1) : (this.grid.getY() - length - 1)); - var x; - for (var i = 0; i < dataLength; i++) { - // 亚像素优化 - x = this.subPixelOptimize(this.getCoord(data[i]), lineWidth); - axShape = { - _axisShape : 'axisTick', - zlevel : this._zlevelBase, - hoverable : false, - style : { - xStart : x, - yStart : yPosition, - xEnd : x, - yEnd : yPosition + length, - strokeColor : color, - lineWidth : lineWidth - } - }; - this.shapeList.push(new LineShape(axShape)); - } - } - else { - // 纵向 - var xPosition = this.option.position == 'left' - ? (tickOption.inside - ? (this.grid.getX() + 1) : (this.grid.getX() - length - 1)) - : (tickOption.inside - ? (this.grid.getXend() - length - 1) : (this.grid.getXend() + 1)); - - var y; - for (var i = 0; i < dataLength; i++) { - // 亚像素优化 - y = this.subPixelOptimize(this.getCoord(data[i]), lineWidth); - axShape = { - _axisShape : 'axisTick', - zlevel : this._zlevelBase, - hoverable : false, - style : { - xStart : xPosition, - yStart : y, - xEnd : xPosition + length, - yEnd : y, - strokeColor : color, - lineWidth : lineWidth - } - }; - this.shapeList.push(new LineShape(axShape)); - } - } - }, - - // 坐标轴文本 - _buildAxisLabel : function () { - var axShape; - var data = this._valueList; - var dataLength = this._valueList.length; - var rotate = this.option.axisLabel.rotate; - var margin = this.option.axisLabel.margin; - var clickable = this.option.axisLabel.clickable; - var textStyle = this.option.axisLabel.textStyle; - - if (this.isHorizontal()) { - // 横向 - var yPosition; - var baseLine; - if (this.option.position == 'bottom') { - yPosition = this.grid.getYend() + margin; - baseLine = 'top'; - } - else { - yPosition = this.grid.getY() - margin; - baseLine = 'bottom'; - } - - for (var i = 0; i < dataLength; i++) { - axShape = { - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : this.getCoord(data[i]), - y : yPosition, - color : typeof textStyle.color == 'function' - ? textStyle.color(data[i]) : textStyle.color, - text : this._valueLabel[i], - textFont : this.getFont(textStyle), - textAlign : textStyle.align || 'center', - textBaseline : textStyle.baseline || baseLine - } - }; - if (rotate) { - axShape.style.textAlign = rotate > 0 - ? (this.option.position == 'bottom' - ? 'right' : 'left') - : (this.option.position == 'bottom' - ? 'left' : 'right'); - axShape.rotation = [ - rotate * Math.PI / 180, - axShape.style.x, - axShape.style.y - ]; - } - this.shapeList.push(new TextShape( - this._axisLabelClickable(clickable, axShape) - )); - } - } - else { - // 纵向 - var xPosition; - var align; - if (this.option.position == 'left') { - xPosition = this.grid.getX() - margin; - align = 'right'; - } - else { - xPosition = this.grid.getXend() + margin; - align = 'left'; - } - - for (var i = 0; i < dataLength; i++) { - axShape = { - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : xPosition, - y : this.getCoord(data[i]), - color : typeof textStyle.color == 'function' - ? textStyle.color(data[i]) : textStyle.color, - text : this._valueLabel[i], - textFont : this.getFont(textStyle), - textAlign : textStyle.align || align, - textBaseline : textStyle.baseline - || (i === 0 && this.option.name !== '') - ? 'bottom' - : (i == (dataLength - 1) - && this.option.name !== '') - ? 'top' - : 'middle' - } - }; - - if (rotate) { - axShape.rotation = [ - rotate * Math.PI / 180, - axShape.style.x, - axShape.style.y - ]; - } - this.shapeList.push(new TextShape( - this._axisLabelClickable(clickable, axShape) - )); - } - } - }, - - _buildSplitLine : function () { - var axShape; - var data = this._valueList; - var dataLength = this._valueList.length; - var sLineOption = this.option.splitLine; - var lineType = sLineOption.lineStyle.type; - var lineWidth = sLineOption.lineStyle.width; - var color = sLineOption.lineStyle.color; - color = color instanceof Array ? color : [color]; - var colorLength = color.length; - - if (this.isHorizontal()) { - // 横向 - var sy = this.grid.getY(); - var ey = this.grid.getYend(); - var x; - - for (var i = 0; i < dataLength; i++) { - // 亚像素优化 - x = this.subPixelOptimize(this.getCoord(data[i]), lineWidth); - axShape = { - zlevel : this._zlevelBase, - hoverable : false, - style : { - xStart : x, - yStart : sy, - xEnd : x, - yEnd : ey, - strokeColor : color[i % colorLength], - lineType : lineType, - lineWidth : lineWidth - } - }; - this.shapeList.push(new LineShape(axShape)); - } - - } - else { - // 纵向 - var sx = this.grid.getX(); - var ex = this.grid.getXend(); - var y; - - for (var i = 0; i < dataLength; i++) { - // 亚像素优化 - y = this.subPixelOptimize(this.getCoord(data[i]), lineWidth); - axShape = { - zlevel : this._zlevelBase, - hoverable : false, - style : { - xStart : sx, - yStart : y, - xEnd : ex, - yEnd : y, - strokeColor : color[i % colorLength], - lineType : lineType, - lineWidth : lineWidth - } - }; - this.shapeList.push(new LineShape(axShape)); - } - } - }, - - _buildSplitArea : function () { - var axShape; - var color = this.option.splitArea.areaStyle.color; - - if (!(color instanceof Array)) { - // 非数组一律认为是单一颜色的字符串,单一颜色则用一个背景,颜色错误不负责啊!!! - axShape = { - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : this.grid.getX(), - y : this.grid.getY(), - width : this.grid.getWidth(), - height : this.grid.getHeight(), - color : color - // type : this.option.splitArea.areaStyle.type, - } - }; - this.shapeList.push(new RectangleShape(axShape)); - } - else { - // 多颜色 - var colorLength = color.length; - var data = this._valueList; - var dataLength = this._valueList.length; - - if (this.isHorizontal()) { - // 横向 - var y = this.grid.getY(); - var height = this.grid.getHeight(); - var lastX = this.grid.getX(); - var curX; - - for (var i = 0; i <= dataLength; i++) { - curX = i < dataLength - ? this.getCoord(data[i]) - : this.grid.getXend(); - axShape = { - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : lastX, - y : y, - width : curX - lastX, - height : height, - color : color[i % colorLength] - // type : this.option.splitArea.areaStyle.type, - } - }; - this.shapeList.push(new RectangleShape(axShape)); - lastX = curX; - } - } - else { - // 纵向 - var x = this.grid.getX(); - var width = this.grid.getWidth(); - var lastYend = this.grid.getYend(); - var curY; - - for (var i = 0; i <= dataLength; i++) { - curY = i < dataLength - ? this.getCoord(data[i]) - : this.grid.getY(); - axShape = { - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : x, - y : curY, - width : width, - height : lastYend - curY, - color : color[i % colorLength] - // type : this.option.splitArea.areaStyle.type - } - }; - this.shapeList.push(new RectangleShape(axShape)); - lastYend = curY; - } - } - } - }, - - /** - * 极值计算 - */ - _calculateValue : function () { - if (isNaN(this.option.min - 0) || isNaN(this.option.max - 0)) { - // 有一个没指定都得算 - // 数据整形 - var oriData; // 原始数据 - var data = {}; // 整形后数据抽取 - var value; - var xIdx; - var yIdx; - var legend = this.component.legend; - for (var i = 0, l = this.series.length; i < l; i++) { - if (this.series[i].type != ecConfig.CHART_TYPE_LINE - && this.series[i].type != ecConfig.CHART_TYPE_BAR - && this.series[i].type != ecConfig.CHART_TYPE_SCATTER - && this.series[i].type != ecConfig.CHART_TYPE_K - ) { - // 非坐标轴支持的不算极值 - continue; - } - // 请允许我写开,跟上面一个不是一样东西 - if (legend && !legend.isSelected(this.series[i].name)){ - continue; - } - - // 不指定默认为第一轴线 - xIdx = this.series[i].xAxisIndex || 0; - yIdx = this.series[i].yAxisIndex || 0; - if ((this.option.xAxisIndex != xIdx) - && (this.option.yAxisIndex != yIdx) - ) { - // 不是自己的数据不计算极值 - continue; - } - - var key = this.series[i].name || 'kener'; - if (!this.series[i].stack) { - data[key] = data[key] || []; - oriData = this.series[i].data; - for (var j = 0, k = oriData.length; j < k; j++) { - value = typeof oriData[j].value != 'undefined' - ? oriData[j].value - : oriData[j]; - if (this.series[i].type == ecConfig.CHART_TYPE_SCATTER) { - if (this.option.xAxisIndex != -1) { - data[key].push(value[0]); - } - if (this.option.yAxisIndex != -1) { - data[key].push(value[1]); - } - } - else if (this.series[i].type == ecConfig.CHART_TYPE_K) { - data[key].push(value[0]); - data[key].push(value[1]); - data[key].push(value[2]); - data[key].push(value[3]); - } - else { - data[key].push(value); - } - } - } - else { - // 堆积数据,需要区分正负向堆积 - var keyP = '__Magic_Key_Positive__' + this.series[i].stack; - var keyN = '__Magic_Key_Negative__' + this.series[i].stack; - data[keyP] = data[keyP] || []; - data[keyN] = data[keyN] || []; - data[key] = data[key] || []; // scale下还需要记录每一个量 - oriData = this.series[i].data; - for (var j = 0, k = oriData.length; j < k; j++) { - value = typeof oriData[j].value != 'undefined' - ? oriData[j].value - : oriData[j]; - if (value == '-') { - continue; - } - value = value - 0; - if (value >= 0) { - if (typeof data[keyP][j] != 'undefined') { - data[keyP][j] += value; - } - else { - data[keyP][j] = value; - } - } - else { - if (typeof data[keyN][j] != 'undefined') { - data[keyN][j] += value; - } - else { - data[keyN][j] = value; - } - } - if (this.option.scale) { - data[key].push(value); - } - } - } - } - // 找极值 - for (var i in data){ - oriData = data[i]; - for (var j = 0, k = oriData.length; j < k; j++) { - if (!isNaN(oriData[j])){ - this._hasData = true; - this._min = oriData[j]; - this._max = oriData[j]; - break; - } - } - if (this._hasData) { - break; - } - } - for (var i in data){ - oriData = data[i]; - for (var j = 0, k = oriData.length; j < k; j++) { - if (!isNaN(oriData[j])){ - this._min = Math.min(this._min, oriData[j]); - this._max = Math.max(this._max, oriData[j]); - } - } - } - - //console.log(this._min,this._max,'vvvvv111111') - this._min = isNaN(this.option.min - 0) - ? (this._min - Math.abs(this._min * this.option.boundaryGap[0])) - : (this.option.min - 0); // 指定min忽略boundaryGay[0] - - this._max = isNaN(this.option.max - 0) - ? (this._max + Math.abs(this._max * this.option.boundaryGap[1])) - : (this.option.max - 0); // 指定max忽略boundaryGay[1] - if (this._min == this._max) { - if (this._max === 0) { - // 修复全0数据 - this._max = this.option.power > 0 ? this.option.power : 1; - } - // 修复最大值==最小值时数据整形 - else if (this._max > 0) { - this._min = this._max / this.option.splitNumber; - } - else { // this._max < 0 - this._max = this._max / this.option.splitNumber; - } - } - this._reformValue(this.option.scale); - } - else { - this._hasData = true; - // 用户指定min max就不多管闲事了 - this._min = this.option.min - 0; // 指定min忽略boundaryGay[0] - this._max = this.option.max - 0; // 指定max忽略boundaryGay[1] - this._customerValue(); - } - }, - - /** - * 找到原始数据的极值后根据选项整形最终 this._min / this._max / this._valueList - * 如果你不知道这个“整形”的用义,请不要试图去理解和修改这个方法!找我也没用,我相信我已经记不起来! - * 如果你有更简洁的数学推导欢迎重写,后果自负~ - * 一旦你不得不遇到了需要修改或重写的厄运,希望下面的脚手架能帮助你 - * ps:其实我是想说别搞砸了!升级后至少得保证这些case通过!! - * - * by linzhifeng@baidu.com 2013-1-8 - * -------- - this._valueList = []; - this.option = {splitNumber:5,power:100,precision:0}; - this._min = 1; this._max = 123; console.log(this._min, this._max); this._reformValue(); - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : 0 150 [0, 30, 60, 90, 120, 150]', - (this._min == 0 && this._max == 150) ? 'success' : 'failed'); - - this._min = 10; this._max = 1923; console.log(this._min, this._max); this._reformValue(); - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : 0 2000 [0, 400, 800, 1200, 1600, 2000]', - (this._min == 0 && this._max == 2000) ? 'success' : 'failed'); - - this._min = 10; this._max = 78; console.log(this._min, this._max); this._reformValue(); - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : 0 100 [0, 20, 40, 60, 80, 100]', - (this._min == 0 && this._max == 100) ? 'success' : 'failed'); - - this._min = -31; this._max = -3; console.log(this._min, this._max); this._reformValue(); - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : -35 0 [-35, -28, -21, -14, -7, 0]', - (this._min == -35 && this._max == 0) ? 'success' : 'failed'); - - this._min = -51; this._max = 203; console.log(this._min, this._max); this._reformValue(); - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : -60 240 [-60, 0, 60, 120, 180, 240]', - (this._min == -60 && this._max == 240) ? 'success' : 'failed'); - - this._min = -251; this._max = 23; console.log(this._min, this._max); this._reformValue(); - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : -280 70 [-280, -210, -140, -70, 0, 70]', - (this._min == -280 && this._max == 70) ? 'success' : 'failed'); - - this.option.precision = 2; - this._min = 0.23; this._max = 0.78; console.log(this._min, this._max); this._reformValue(); - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : 0.00 1.00' - + '["0.00", "0.20", "0.40", "0.60", "0.80", "1.00"]', - (this._min == 0.00 && this._max == 1.00) ? 'success' : 'failed'); - - this._min = -12.23; this._max = -0.78; console.log(this._min, this._max); - this._reformValue(); - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : -15.00 0.00' - + '["-15.00", "-12.00", "-9.00", "-6.00", "-3.00", "0.00"]', - (this._min == -15.00 && this._max == 0.00) ? 'success' : 'failed'); - - this._min = -0.23; this._max = 0.78; console.log(this._min, this._max); this._reformValue() - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : -0.30 1.20' - + '["-0.30", "0.00", "0.30", "0.60", "0.90", "1.20"]', - (this._min == -0.30 && this._max == 1.20) ? 'success' : 'failed'); - - this._min = -1.23; this._max = 0.78; console.log(this._min, this._max); _reformValue(); - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : -1.50 1.00' - + '["-1.50", "-1.00", "-0.50", "0.00", "0.50", "1.00"]', - (this._min == -1.50 && this._max == 1.00) ? 'success' : 'failed'); - - this.option.precision = 1; - this._min = -2.3; this._max = 0.5; console.log(this._min, this._max); _reformValue(); - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : -2.4 0.6' - + '["-2.4", "-1.8", "-1.2", "-0.6", "0.0", "0.6"]', - (this._min == -2.4 && this._max == 0.6) ? 'success' : 'failed'); - * -------- - */ - _reformValue : function (scale) { - var splitNumber = this.option.splitNumber; - var precision = this.option.precision; - var splitGap; - var power; - if (precision === 0) { // 整数 - power = this.option.power > 1 ? this.option.power : 1; - } - else { // 小数 - // 放大倍数后复用整数逻辑,最后再缩小回去 - power = Math.pow(10, precision); - this._min *= power; - this._max *= power; - power = this.option.power; - } - // console.log(this._min,this._max) - var total; - if (this._min >= 0 && this._max >= 0) { - // 双正 - if (!scale) { - // power自动降级 - while ((this._max / power < splitNumber) && power != 1) { - power = power / 10; - } - this._min = 0; - } - else { - // power自动降级 - while (this._min < power && power != 1) { - power = power / 10; - } - if (precision === 0) { // 整数 - // 满足power - this._min = Math.floor(this._min / power) * power; - this._max = Math.ceil(this._max / power) * power; - } - } - power = power > 1 ? power / 10 : 1; - total = this._max - this._min; - splitGap = Math.ceil((total / splitNumber) / power) * power; - this._max = this._min + splitGap * splitNumber; - } - else if (this._min <= 0 && this._max <= 0) { - // 双负 - power = -power; - if (!scale) { - // power自动降级 - while ((this._min / power < splitNumber) && power != -1) { - power = power / 10; - } - this._max = 0; - } - else { - // power自动降级 - while (this._max > power && power != -1) { - power = power / 10; - } - if (precision === 0) { // 整数 - // 满足power - this._min = Math.ceil(this._min / power) * power; - this._max = Math.floor(this._max / power) * power; - } - } - power = power < -1 ? power / 10 : -1; - total = this._min - this._max; - splitGap = -Math.ceil((total / splitNumber) / power) * power; - this._min = -splitGap * splitNumber + this._max; - } - else { - // 一正一负,确保0被选中 - total = this._max - this._min; - // power自动降级 - while ((total / power < splitNumber) && power != 1) { - power = power/10; - } - // 正数部分的分隔数 - var partSplitNumber = Math.round(this._max / total * splitNumber); - // 修正数据范围极度偏正向,留给负数一个 - partSplitNumber -= (partSplitNumber == splitNumber ? 1 : 0); - // 修正数据范围极度偏负向,留给正数一个 - partSplitNumber += partSplitNumber === 0 ? 1 : 0; - splitGap = (Math.ceil(Math.max( - this._max / partSplitNumber, - this._min / (partSplitNumber - splitNumber) - ) - / power)) - * power; - - this._max = splitGap * partSplitNumber; - this._min = splitGap * (partSplitNumber - splitNumber); - } - //console.log(this._min,this._max,'vvvvvrrrrrr') - this._valueList = []; - for (var i = 0; i <= splitNumber; i++) { - this._valueList.push(this._min + splitGap * i); - } - - if (precision !== 0) { // 小数 - // 放大倍数后复用整数逻辑,最后再缩小回去 - power = Math.pow(10, precision); - this._min = (this._min / power).toFixed(precision) - 0; - this._max = (this._max / power).toFixed(precision) - 0; - for (var i = 0; i <= splitNumber; i++) { - this._valueList[i] = - (this._valueList[i] / power).toFixed(precision) - 0; - } - } - this._reformLabelData(); - }, - - _customerValue : function () { - var splitNumber = this.option.splitNumber; - var precision = this.option.precision; - var splitGap = (this._max - this._min) / splitNumber; - - this._valueList = []; - for (var i = 0; i <= splitNumber; i++) { - this._valueList.push((this._min + splitGap * i).toFixed(precision) - 0); - } - this._reformLabelData(); - }, - - _reformLabelData : function () { - this._valueLabel = []; - var formatter = this.option.axisLabel.formatter; - if (formatter) { - for (var i = 0, l = this._valueList.length; i < l; i++) { - if (typeof formatter == 'function') { - this._valueLabel.push(formatter.call(this.myChart, this._valueList[i])); - } - else if (typeof formatter == 'string') { - this._valueLabel.push( - formatter.replace('{value}',this._valueList[i]) - ); - } - } - } - else { - // 每三位默认加,格式化 - for (var i = 0, l = this._valueList.length; i < l; i++) { - this._valueLabel.push(this.numAddCommas(this._valueList[i])); - } - } - - }, - - getExtremum : function () { - this._calculateValue(); - return { - min: this._min, - max: this._max - }; - }, - - /** - * 刷新 - */ - refresh : function (newOption, newSeries) { - if (newOption) { - this.option = this.reformOption(newOption); - // 通用字体设置 - this.option.axisLabel.textStyle = zrUtil.merge( - this.option.axisLabel.textStyle || {}, - this.ecTheme.textStyle - ); - this.series = newSeries; - } - if (this.zr) { // 数值轴的另外一个功能只是用来计算极值 - this.clear(); - this._buildShape(); - } - }, - - // 根据值换算位置 - getCoord : function (value) { - value = value < this._min ? this._min : value; - value = value > this._max ? this._max : value; - - var result; - if (!this.isHorizontal()) { - // 纵向 - result = this.grid.getYend() - - (value - this._min) - / (this._max - this._min) - * this.grid.getHeight(); - } - else { - // 横向 - result = this.grid.getX() - + (value - this._min) - / (this._max - this._min) - * this.grid.getWidth(); - } - - return result; - // Math.floor可能引起一些偏差,但性能会更好 - /* 准确更重要 - return (value == this._min || value == this._max) - ? result - : Math.floor(result); - */ - }, - - // 根据值换算绝对大小 - getCoordSize : function (value) { - if (!this.isHorizontal()) { - // 纵向 - return Math.abs(value / (this._max - this._min) * this.grid.getHeight()); - } - else { - // 横向 - return Math.abs(value / (this._max - this._min) * this.grid.getWidth()); - } - }, - - // 根据位置换算值 - getValueFromCoord : function(coord) { - var result; - if (!this.isHorizontal()) { - // 纵向 - coord = coord < this.grid.getY() ? this.grid.getY() : coord; - coord = coord > this.grid.getYend() ? this.grid.getYend() : coord; - result = this._max - - (coord - this.grid.getY()) - / this.grid.getHeight() - * (this._max - this._min); - } - else { - // 横向 - coord = coord < this.grid.getX() ? this.grid.getX() : coord; - coord = coord > this.grid.getXend() ? this.grid.getXend() : coord; - result = this._min - + (coord - this.grid.getX()) - / this.grid.getWidth() - * (this._max - this._min); - } - - return result.toFixed(2) - 0; - } - }; - - zrUtil.inherits(ValueAxis, Base); - - require('../component').define('valueAxis', ValueAxis); - - return ValueAxis; -}); - - -/** - * echarts组件类: 坐标轴 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * 直角坐标系中坐标轴数组,数组中每一项代表一条横轴(纵轴)坐标轴。 - * 标准(1.0)中规定最多同时存在2条横轴和2条纵轴 - * 单条横轴时可指定安放于grid的底部(默认)或顶部,2条同时存在时则默认第一条安放于底部,第二天安放于顶部 - * 单条纵轴时可指定安放于grid的左侧(默认)或右侧,2条同时存在时则默认第一条安放于左侧,第二天安放于右侧。 - * 坐标轴有两种类型,类目型和数值型(区别详见axis): - * 横轴通常为类目型,但条形图时则横轴为数值型,散点图时则横纵均为数值型 - * 纵轴通常为数值型,但条形图时则纵轴为类目型。 - * - */ -define('echarts/component/axis',['require','./base','zrender/shape/Line','../config','../util/ecData','zrender/tool/util','zrender/tool/color','./categoryAxis','./valueAxis','../component'],function (require) { - var Base = require('./base'); - - var LineShape = require('zrender/shape/Line'); - - var ecConfig = require('../config'); - var ecData = require('../util/ecData'); - var zrUtil = require('zrender/tool/util'); - var zrColor = require('zrender/tool/color'); - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} option 图表选项 - * @param {string=} option.xAxis.type 坐标轴类型,横轴默认为类目型'category' - * @param {string=} option.yAxis.type 坐标轴类型,纵轴默认为类目型'value' - * @param {Object} component 组件 - * @param {string} axisType 横走or纵轴 - */ - function Axis(ecTheme, messageCenter, zr, option, myChart, axisType) { - Base.call(this, ecTheme, messageCenter, zr, option, myChart); - - this.axisType = axisType; - this._axisList = []; - - this.refresh(option); - } - - Axis.prototype = { - type : ecConfig.COMPONENT_TYPE_AXIS, - axisBase : { - // 轴线 - _buildAxisLine : function () { - var lineWidth = this.option.axisLine.lineStyle.width; - var halfLineWidth = lineWidth / 2; - var axShape = { - _axisShape : 'axisLine', - zlevel : this._zlevelBase + 1, - hoverable : false - }; - switch (this.option.position) { - case 'left' : - axShape.style = { - xStart : this.grid.getX() - halfLineWidth, - yStart : this.grid.getYend(), - xEnd : this.grid.getX() - halfLineWidth, - yEnd : this.grid.getY(), - lineCap : 'round' - }; - break; - case 'right' : - axShape.style = { - xStart : this.grid.getXend() + halfLineWidth, - yStart : this.grid.getYend(), - xEnd : this.grid.getXend() + halfLineWidth, - yEnd : this.grid.getY(), - lineCap : 'round' - }; - break; - case 'bottom' : - axShape.style = { - xStart : this.grid.getX(), - yStart : this.grid.getYend() + halfLineWidth, - xEnd : this.grid.getXend(), - yEnd : this.grid.getYend() + halfLineWidth, - lineCap : 'round' - }; - break; - case 'top' : - axShape.style = { - xStart : this.grid.getX(), - yStart : this.grid.getY() - halfLineWidth, - xEnd : this.grid.getXend(), - yEnd : this.grid.getY() - halfLineWidth, - lineCap : 'round' - }; - break; - } - if (this.option.name !== '') { - axShape.style.text = this.option.name; - axShape.style.textPosition = this.option.nameLocation; - axShape.style.textFont = this.getFont(this.option.nameTextStyle); - if (this.option.nameTextStyle.align) { - axShape.style.textAlign = this.option.nameTextStyle.align; - } - if (this.option.nameTextStyle.baseline) { - axShape.style.textBaseline = this.option.nameTextStyle.baseline; - } - if (this.option.nameTextStyle.color) { - axShape.style.textColor = this.option.nameTextStyle.color; - } - } - axShape.style.strokeColor = this.option.axisLine.lineStyle.color; - - axShape.style.lineWidth = lineWidth; - // 亚像素优化 - if (this.isHorizontal()) { - // 横向布局,优化y - axShape.style.yStart - = axShape.style.yEnd - = this.subPixelOptimize(axShape.style.yEnd, lineWidth); - } - else { - // 纵向布局,优化x - axShape.style.xStart - = axShape.style.xEnd - = this.subPixelOptimize(axShape.style.xEnd, lineWidth); - } - - axShape.style.lineType = this.option.axisLine.lineStyle.type; - - axShape = new LineShape(axShape); - this.shapeList.push(axShape); - }, - - _axisLabelClickable : function(clickable, axShape) { - if (clickable) { - ecData.pack( - axShape, undefined, -1, undefined, -1, axShape.style.text - ); - axShape.hoverable = true; - axShape.clickable = true; - axShape.highlightStyle = { - color : zrColor.lift(axShape.style.color, 1), - brushType: 'fill' - }; - return axShape; - } - else { - return axShape; - } - }, - - refixAxisShape : function(zeroX, zeroY) { - if (!this.option.axisLine.onZero) { - return; - } - var tickLength; - if (this.isHorizontal() && typeof zeroY != 'undefined') { - // 横向布局调整纵向y - for (var i = 0, l = this.shapeList.length; i < l; i++) { - if (this.shapeList[i]._axisShape == 'axisLine') { - this.shapeList[i].style.yStart - = this.shapeList[i].style.yEnd - = this.subPixelOptimize( - zeroY, this.shapeList[i].stylelineWidth - ); - this.zr.modShape(this.shapeList[i].id); - } - else if (this.shapeList[i]._axisShape == 'axisTick') { - tickLength = this.shapeList[i].style.yEnd - - this.shapeList[i].style.yStart; - this.shapeList[i].style.yStart = zeroY - tickLength; - this.shapeList[i].style.yEnd = zeroY; - this.zr.modShape(this.shapeList[i].id); - } - } - } - if (!this.isHorizontal() && typeof zeroX != 'undefined') { - // 纵向布局调整横向x - for (var i = 0, l = this.shapeList.length; i < l; i++) { - if (this.shapeList[i]._axisShape == 'axisLine') { - this.shapeList[i].style.xStart - = this.shapeList[i].style.xEnd - = this.subPixelOptimize( - zeroX, this.shapeList[i].stylelineWidth - ); - this.zr.modShape(this.shapeList[i].id); - } - else if (this.shapeList[i]._axisShape == 'axisTick') { - tickLength = this.shapeList[i].style.xEnd - - this.shapeList[i].style.xStart; - this.shapeList[i].style.xStart = zeroX; - this.shapeList[i].style.xEnd = zeroX + tickLength; - this.zr.modShape(this.shapeList[i].id); - } - } - } - }, - - getPosition : function () { - return this.option.position; - }, - - isHorizontal : function() { - return this.option.position == 'bottom' || this.option.position == 'top'; - } - }, - /** - * 参数修正&默认值赋值,重载基类方法 - * @param {Object} opt 参数 - */ - reformOption : function (opt) { - // 不写或传了个空数值默认为数值轴 - if (!opt || (opt instanceof Array && opt.length === 0)) { - opt = [{type : ecConfig.COMPONENT_TYPE_AXIS_VALUE}]; - } - else if (!(opt instanceof Array)){ - opt = [opt]; - } - - // 最多两条,其他参数忽略 - if (opt.length > 2) { - opt = [opt[0],opt[1]]; - } - - if (this.axisType == 'xAxis') { - // 横轴位置默认配置 - if (!opt[0].position // 没配置或配置错 - || (opt[0].position != 'bottom' - && opt[0].position != 'top') - ) { - opt[0].position = 'bottom'; - } - if (opt.length > 1) { - opt[1].position = opt[0].position == 'bottom' - ? 'top' : 'bottom'; - } - - for (var i = 0, l = opt.length; i < l; i++) { - // 坐标轴类型,横轴默认为类目型'category' - opt[i].type = opt[i].type || 'category'; - // 标识轴类型&索引 - opt[i].xAxisIndex = i; - opt[i].yAxisIndex = -1; - } - } - else { - // 纵轴位置默认配置 - if (!opt[0].position // 没配置或配置错 - || (opt[0].position != 'left' - && opt[0].position != 'right') - ) { - opt[0].position = 'left'; - } - - if (opt.length > 1) { - opt[1].position = opt[0].position == 'left' - ? 'right' : 'left'; - } - - for (var i = 0, l = opt.length; i < l; i++) { - // 坐标轴类型,纵轴默认为数值型'value' - opt[i].type = opt[i].type || 'value'; - // 标识轴类型&索引 - opt[i].xAxisIndex = -1; - opt[i].yAxisIndex = i; - } - } - - return opt; - }, - - /** - * 刷新 - */ - refresh : function (newOption) { - var axisOption; - if (newOption) { - this.option = newOption; - if (this.axisType == 'xAxis') { - this.option.xAxis = this.reformOption(newOption.xAxis); - axisOption = this.option.xAxis; - } - else { - this.option.yAxis = this.reformOption(newOption.yAxis); - axisOption = this.option.yAxis; - } - this.series = newOption.series; - } - - var CategoryAxis = require('./categoryAxis'); - var ValueAxis = require('./valueAxis'); - var len = Math.max((axisOption && axisOption.length || 0), this._axisList.length); - for (var i = 0; i < len; i++) { - if (this._axisList[i] // 已有实例 - && newOption // 非空刷新 - && (!axisOption[i] || this._axisList[i].type != axisOption[i].type) // 类型不匹配 - ) { - this._axisList[i].dispose && this._axisList[i].dispose(); - this._axisList[i] = false; - } - - if (this._axisList[i]) { - this._axisList[i].refresh && this._axisList[i].refresh( - axisOption ? axisOption[i] : false, - this.series - ); - } - else if (axisOption && axisOption[i]) { - this._axisList[i] = axisOption[i].type == 'category' - ? new CategoryAxis( - this.ecTheme, this.messageCenter, this.zr, - axisOption[i], this.myChart, this.axisBase - ) - : new ValueAxis( - this.ecTheme, this.messageCenter, this.zr, - axisOption[i], this.myChart, this.axisBase, - this.series - ); - - } - } - }, - - /** - * 根据值换算位置 - * @param {number} idx 坐标轴索引0~1 - */ - getAxis : function (idx) { - return this._axisList[idx]; - }, - - clear : function () { - for (var i = 0, l = this._axisList.length; i < l; i++) { - this._axisList[i].dispose && this._axisList[i].dispose(); - } - this._axisList = []; - } - }; - - zrUtil.inherits(Axis, Base); - - require('../component').define('axis', Axis); - - return Axis; -}); -/** - * echarts组件: 网格 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/component/grid',['require','./base','zrender/shape/Rectangle','../config','zrender/tool/util','../component'],function (require) { - var Base = require('./base'); - - // 图形依赖 - var RectangleShape = require('zrender/shape/Rectangle'); - - var ecConfig = require('../config'); - var zrUtil = require('zrender/tool/util'); - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} option 图表选项 - * @param {number=} option.grid.x 直角坐标系内绘图网格起始横坐标,数值单位px - * @param {number=} option.grid.y 直角坐标系内绘图网格起始纵坐标,数值单位px - * @param {number=} option.grid.width 直角坐标系内绘图网格宽度,数值单位px - * @param {number=} option.grid.height 直角坐标系内绘图网格高度,数值单位px - */ - function Grid(ecTheme, messageCenter, zr, option, myChart) { - Base.call(this, ecTheme, messageCenter, zr, option, myChart); - - this.refresh(option); - } - - Grid.prototype = { - type : ecConfig.COMPONENT_TYPE_GRID, - - getX : function () { - return this._x; - }, - - getY : function () { - return this._y; - }, - - getWidth : function () { - return this._width; - }, - - getHeight : function () { - return this._height; - }, - - getXend : function () { - return this._x + this._width; - }, - - getYend : function () { - return this._y + this._height; - }, - - getArea : function () { - return { - x : this._x, - y : this._y, - width : this._width, - height : this._height - }; - }, - - /** - * 实在找不到合适的地方做了,各种粗暴的写法~ -_- - */ - refixAxisShape : function(component) { - var zeroX; - var zeroY; - var axisList = component.xAxis._axisList.concat(component.yAxis._axisList); - var len = axisList.length; - var axis; - while (len--) { - axis = axisList[len]; - if (axis.type == ecConfig.COMPONENT_TYPE_AXIS_VALUE - && axis._min < 0 - && axis._max >= 0 - ) { - axis.isHorizontal() - ? (zeroX = axis.getCoord(0)) - : (zeroY = axis.getCoord(0)); - } - } - if (typeof zeroX != 'undefined' || typeof zeroY != 'undefined') { - len = axisList.length; - while (len--) { - axisList[len].refixAxisShape(zeroX, zeroY); - } - } - }, - - refresh : function (newOption) { - if (newOption - || this._zrWidth != this.zr.getWidth() - || this._zrHeight != this.zr.getHeight() - ) { - this.clear(); - this.option = newOption || this.option; - this.option.grid = this.reformOption(this.option.grid); - - var gridOption = this.option.grid; - this._zrWidth = this.zr.getWidth(); - this._zrHeight = this.zr.getHeight(); - this._x = this.parsePercent(gridOption.x, this._zrWidth); - this._y = this.parsePercent(gridOption.y, this._zrHeight); - var x2 = this.parsePercent(gridOption.x2, this._zrWidth); - var y2 = this.parsePercent(gridOption.y2, this._zrHeight); - - - if (typeof gridOption.width == 'undefined') { - this._width = this._zrWidth - this._x - x2; - } - else { - this._width = this.parsePercent(gridOption.width, this._zrWidth); - } - - if (typeof gridOption.height == 'undefined') { - this._height = this._zrHeight - this._y - y2; - } - else { - this._height = this.parsePercent(gridOption.height, this._zrHeight); - } - - this._x = this.subPixelOptimize(this._x, gridOption.borderWidth); - this._y = this.subPixelOptimize(this._y, gridOption.borderWidth); - - this.shapeList.push(new RectangleShape({ - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : this._x, - y : this._y, - width : this._width, - height : this._height, - brushType : gridOption.borderWidth > 0 ? 'both' : 'fill', - color : gridOption.backgroundColor, - strokeColor: gridOption.borderColor, - lineWidth : gridOption.borderWidth - // type : this.option.splitArea.areaStyle.type, - } - })); - this.zr.addShape(this.shapeList[0]); - } - } - }; - - zrUtil.inherits(Grid, Base); - - require('../component').define('grid', Grid); - - return Grid; -}); -/** - * echarts组件:数据区域缩放 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/component/dataZoom',['require','./base','zrender/shape/Rectangle','zrender/shape/Polygon','../util/shape/Icon','../config','zrender/tool/util','../component','../component'],function (require) { - var Base = require('./base'); - - // 图形依赖 - var RectangleShape = require('zrender/shape/Rectangle'); - var PolygonShape = require('zrender/shape/Polygon'); - var IconShape = require('../util/shape/Icon'); - - var ecConfig = require('../config'); - var zrUtil = require('zrender/tool/util'); - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} option 图表参数 - * @param {Object} component 组件 - */ - function DataZoom(ecTheme, messageCenter, zr, option, myChart) { - Base.call(this, ecTheme, messageCenter, zr, option, myChart); - - var self = this; - self._ondrift = function (dx, dy) { - return self.__ondrift(this, dx, dy); - }; - self._ondragend = function () { - return self.__ondragend(); - }; - - this._fillerSize = 28; // 控件大小,水平布局为高,纵向布局为宽 - this._handleSize = 8; // 手柄大小 - // this._fillerShae; // 填充 - // this._startShape; // 起始手柄 - // this._endShape; // 结束手柄 - // this._startFrameShape; // 起始特效边框 - // this._endFrameShape; // 结束特效边框 - // this._syncTicket; - this._isSilence = false; - this._zoom = {}; - // this._originalData; - - this.option.dataZoom = this.reformOption(this.option.dataZoom); - this.zoomOption = this.option.dataZoom; - - // 位置参数,通过计算所得x, y, width, height - this._location = this._getLocation(); - // 缩放参数 - this._zoom = this._getZoom(); - this._backupData(); - - if (this.option.dataZoom.show) { - this._buildShape(); - } - this._syncData(); - } - - DataZoom.prototype = { - type : ecConfig.COMPONENT_TYPE_DATAZOOM, - _buildShape : function () { - this._buildBackground(); - this._buildFiller(); - this._buildHandle(); - this._buildFrame(); - - for (var i = 0, l = this.shapeList.length; i < l; i++) { - this.zr.addShape(this.shapeList[i]); - } - this._syncFrameShape(); - }, - - /** - * 根据选项计算实体的位置坐标 - */ - _getLocation : function () { - var x; - var y; - var width; - var height; - var grid = this.component.grid; - - // 不指定则根据grid适配 - if (this.zoomOption.orient == 'horizontal') { - // 水平布局 - width = this.zoomOption.width || grid.getWidth(); - height = this.zoomOption.height || this._fillerSize; - x = typeof this.zoomOption.x != 'undefined' - ? this.zoomOption.x : grid.getX(); - y = typeof this.zoomOption.y != 'undefined' - ? this.zoomOption.y : (this.zr.getHeight() - height - 2); - } - else { - // 垂直布局 - width = this.zoomOption.width || this._fillerSize; - height = this.zoomOption.height || grid.getHeight(); - x = typeof this.zoomOption.x != 'undefined' - ? this.zoomOption.x : 2; - y = typeof this.zoomOption.y != 'undefined' - ? this.zoomOption.y : grid.getY(); - } - - return { - x : x, - y : y, - width : width, - height : height - }; - }, - - /** - * 计算缩放参数 - * 修正单坐标轴只传对象为数组。 - */ - _getZoom : function () { - var series = this.option.series; - var xAxis = this.option.xAxis; - if (xAxis && !(xAxis instanceof Array)) { - xAxis = [xAxis]; - this.option.xAxis = xAxis; - } - var yAxis = this.option.yAxis; - if (yAxis && !(yAxis instanceof Array)) { - yAxis = [yAxis]; - this.option.yAxis = yAxis; - } - - var zoomSeriesIndex = []; - var xAxisIndex; - var yAxisIndex; - - var zOptIdx = this.zoomOption.xAxisIndex; - if (xAxis && typeof zOptIdx == 'undefined') { - xAxisIndex = []; - for (var i = 0, l = xAxis.length; i < l; i++) { - // 横纵默认为类目轴 - if (xAxis[i].type == 'category' - || typeof xAxis[i].type == 'undefined' - ) { - xAxisIndex.push(i); - } - } - } - else { - if (zOptIdx instanceof Array) { - xAxisIndex = zOptIdx; - } - else if (typeof zOptIdx != 'undefined') { - xAxisIndex = [zOptIdx]; - } - else { - xAxisIndex = []; - } - } - - zOptIdx = this.zoomOption.yAxisIndex; - if (yAxis && typeof zOptIdx == 'undefined') { - yAxisIndex = []; - for (var i = 0, l = yAxis.length; i < l; i++) { - if (yAxis[i].type == 'category') { - yAxisIndex.push(i); - } - } - } - else { - if (zOptIdx instanceof Array) { - yAxisIndex = zOptIdx; - } - else if (typeof zOptIdx != 'undefined') { - yAxisIndex = [zOptIdx]; - } - else { - yAxisIndex = []; - } - } - - // 找到缩放控制的所有series - for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type != ecConfig.CHART_TYPE_LINE - && series[i].type != ecConfig.CHART_TYPE_BAR - && series[i].type != ecConfig.CHART_TYPE_SCATTER - && series[i].type != ecConfig.CHART_TYPE_K - ) { - continue; - } - for (var j = 0, k = xAxisIndex.length; j < k; j++) { - if (xAxisIndex[j] == (series[i].xAxisIndex || 0)) { - zoomSeriesIndex.push(i); - break; - } - } - for (var j = 0, k = yAxisIndex.length; j < k; j++) { - if (yAxisIndex[j] == (series[i].yAxisIndex || 0)) { - zoomSeriesIndex.push(i); - break; - } - } - // 不指定接管坐标轴,则散点图被纳入接管范围 - if (series[i].type == ecConfig.CHART_TYPE_SCATTER - && typeof this.zoomOption.xAxisIndex == 'undefined' - && typeof this.zoomOption.yAxisIndex == 'undefined' - ) { - zoomSeriesIndex.push(i); - } - } - - var start = typeof this._zoom.start != 'undefined' - ? this._zoom.start - : (typeof this.zoomOption.start != 'undefined' ? this.zoomOption.start : 0); - var end = typeof this._zoom.end != 'undefined' - ? this._zoom.end - : (typeof this.zoomOption.end != 'undefined' ? this.zoomOption.end : 100); - /* - var start = typeof this.zoomOption.start != 'undefined' - && this.zoomOption.start >= 0 - && this.zoomOption.start <= 100 - ? this.zoomOption.start : 0; - var end = typeof this.zoomOption.end != 'undefined' - && this.zoomOption.end >= 0 - && this.zoomOption.end <= 100 - ? this.zoomOption.end : 100; - */ - if (start > end) { - // 大小颠倒自动翻转 - start = start + end; - end = start - end; - start = start - end; - } - var size = Math.round( - (end - start) / 100 - * (this.zoomOption.orient == 'horizontal' - ? this._location.width : this._location.height) - ); - return { - start : start, - end : end, - start2 : 0, - end2 : 100, - size : size, - xAxisIndex : xAxisIndex, - yAxisIndex : yAxisIndex, - seriesIndex : zoomSeriesIndex, - scatterMap : this._zoom.scatterMap || {} - }; - }, - - _backupData : function () { - this._originalData = { - xAxis : {}, - yAxis : {}, - series : {} - }; - var xAxis = this.option.xAxis; - var xAxisIndex = this._zoom.xAxisIndex; - for (var i = 0, l = xAxisIndex.length; i < l; i++) { - this._originalData.xAxis[xAxisIndex[i]] = xAxis[xAxisIndex[i]].data; - } - - var yAxis = this.option.yAxis; - var yAxisIndex = this._zoom.yAxisIndex; - for (var i = 0, l = yAxisIndex.length; i < l; i++) { - this._originalData.yAxis[yAxisIndex[i]] = yAxis[yAxisIndex[i]].data; - } - - var series = this.option.series; - var seriesIndex = this._zoom.seriesIndex; - var serie; - for (var i = 0, l = seriesIndex.length; i < l; i++) { - serie = series[seriesIndex[i]]; - this._originalData.series[seriesIndex[i]] = serie.data; - if (serie.type == ecConfig.CHART_TYPE_SCATTER) { - this._calculScatterMap(seriesIndex[i]); - } - } - }, - - _calculScatterMap : function (seriesIndex) { - this._zoom.scatterMap = this._zoom.scatterMap || {}; - this._zoom.scatterMap[seriesIndex] = this._zoom.scatterMap[seriesIndex] || {}; - var componentLibrary = require('../component'); - // x轴极值 - var Axis = componentLibrary.get('axis'); - var axisOption = zrUtil.clone(this.option.xAxis); - if (axisOption instanceof Array) { - axisOption[0].type = 'value'; - axisOption[0].boundary = [0, 0]; - axisOption[1] && (axisOption[1].type = 'value', axisOption[1].boundary = [0, 0]); - } - else { - axisOption.type = 'value'; - axisOption.boundary = [0, 0]; - } - var vAxis = new Axis( - this.ecTheme, - null, // messageCenter - false, // this.zr - { - xAxis: axisOption, - series : this.option.series - }, - this, - 'xAxis' - ); - var axisIndex = this.option.series[seriesIndex].xAxisIndex || 0; - this._zoom.scatterMap[seriesIndex].x = vAxis.getAxis(axisIndex).getExtremum(); - vAxis.dispose(); - - // y轴极值 - axisOption = zrUtil.clone(this.option.yAxis); - if (axisOption instanceof Array) { - axisOption[0].type = 'value'; - axisOption[1] && (axisOption[1].type = 'value', axisOption[1].boundary = [0, 0]); - } - else { - axisOption.type = 'value'; - axisOption.boundary = [0, 0]; - } - vAxis = new Axis( - this.ecTheme, - null, // messageCenter - false, // this.zr - { - yAxis: axisOption, - series : this.option.series - }, - this, - 'yAxis' - ); - axisIndex = this.option.series[seriesIndex].yAxisIndex || 0; - this._zoom.scatterMap[seriesIndex].y = vAxis.getAxis(axisIndex).getExtremum(); - vAxis.dispose(); - // console.log(this._zoom.scatterMap); - }, - - _buildBackground : function () { - var width = this._location.width; - var height = this._location.height; - - // 背景 - this.shapeList.push(new RectangleShape({ - zlevel : this._zlevelBase, - hoverable :false, - style : { - x : this._location.x, - y : this._location.y, - width : width, - height : height, - color : this.zoomOption.backgroundColor - } - })); - - // 数据阴影 - var maxLength = 0; - var xAxis = this._originalData.xAxis; - var xAxisIndex = this._zoom.xAxisIndex; - for (var i = 0, l = xAxisIndex.length; i < l; i++) { - maxLength = Math.max( - maxLength, xAxis[xAxisIndex[i]].length - ); - } - var yAxis = this._originalData.yAxis; - var yAxisIndex = this._zoom.yAxisIndex; - for (var i = 0, l = yAxisIndex.length; i < l; i++) { - maxLength = Math.max( - maxLength, yAxis[yAxisIndex[i]].length - ); - } - - var seriesIndex = this._zoom.seriesIndex[0]; - var data = this._originalData.series[seriesIndex]; - var maxValue = Number.MIN_VALUE; - var minValue = Number.MAX_VALUE; - var value; - for (var i = 0, l = data.length; i < l; i++) { - value = typeof data[i] != 'undefined' - ? (typeof data[i].value != 'undefined' ? data[i].value : data[i]) - : 0; - if (this.option.series[seriesIndex].type == ecConfig.CHART_TYPE_K) { - value = value[1]; // 收盘价 - } - if (isNaN(value)) { - value = 0; - } - maxValue = Math.max(maxValue, value); - minValue = Math.min(minValue, value); - } - var valueRange = maxValue - minValue; - - var pointList = []; - var x = width / (maxLength - (maxLength > 1 ? 1 : 0)); - var y = height / (maxLength - (maxLength > 1 ? 1 : 0)); - var step = 1; - if (this.zoomOption.orient == 'horizontal' && x < 1) { - step = Math.floor(maxLength * 3 / width); - } - else if (this.zoomOption.orient == 'vertical' && y < 1){ - step = Math.floor(maxLength * 3 / height); - } - - for (var i = 0, l = maxLength; i < l; i += step) { - value = typeof data[i] != 'undefined' - ? (typeof data[i].value != 'undefined' - ? data[i].value : data[i]) - : 0; - if (this.option.series[seriesIndex].type == ecConfig.CHART_TYPE_K) { - value = value[1]; // 收盘价 - } - if (isNaN(value)) { - value = 0; - } - if (this.zoomOption.orient == 'horizontal') { - pointList.push([ - this._location.x + x * i, - this._location.y + height - 1 - Math.round( - (value - minValue) / valueRange * (height - 10) - ) - ]); - } - else { - pointList.push([ - this._location.x + 1 + Math.round( - (value - minValue) / valueRange * (width - 10) - ), - this._location.y + y * i - ]); - } - } - if (this.zoomOption.orient == 'horizontal') { - pointList.push([ - this._location.x + width, - this._location.y + height - ]); - pointList.push([ - this._location.x, this._location.y + height - ]); - } - else { - pointList.push([ - this._location.x, this._location.y + height - ]); - pointList.push([ - this._location.x, this._location.y - ]); - } - - this.shapeList.push(new PolygonShape({ - zlevel : this._zlevelBase, - style : { - pointList : pointList, - color : this.zoomOption.dataBackgroundColor - }, - hoverable : false - })); - }, - - /** - * 构建填充物 - */ - _buildFiller : function () { - this._fillerShae = { - zlevel : this._zlevelBase, - draggable : true, - ondrift : this._ondrift, - ondragend : this._ondragend, - _type : 'filler' - }; - - if (this.zoomOption.orient == 'horizontal') { - // 横向 - this._fillerShae.style = { - x : this._location.x - + Math.round(this._zoom.start / 100 * this._location.width) - + this._handleSize, - y : this._location.y, - width : this._zoom.size - this._handleSize * 2, - height : this._location.height, - color : this.zoomOption.fillerColor, - // strokeColor : '#fff', // this.zoomOption.handleColor, - // lineWidth: 2, - text : ':::', - textPosition : 'inside' - }; - } - else { - // 纵向 - this._fillerShae.style ={ - x : this._location.x, - y : this._location.y - + Math.round(this._zoom.start / 100 * this._location.height) - + this._handleSize, - width : this._location.width, - height : this._zoom.size - this._handleSize * 2, - color : this.zoomOption.fillerColor, - // strokeColor : '#fff', // this.zoomOption.handleColor, - // lineWidth: 2, - text : '::', - textPosition : 'inside' - }; - } - - this._fillerShae.highlightStyle = { - brushType: 'fill', - color : 'rgba(0,0,0,0)' - /* - color : require('zrender/tool/color').alpha( - this._fillerShae.style.color, 0 - ) - */ - }; - this._fillerShae = new RectangleShape(this._fillerShae); - this.shapeList.push(this._fillerShae); - }, - - /** - * 构建拖拽手柄 - */ - _buildHandle : function () { - this._startShape = { - zlevel : this._zlevelBase, - draggable : true, - style : { - iconType: 'rectangle', - x : this._location.x, - y : this._location.y, - width : this._handleSize, - height : this._handleSize, - color : this.zoomOption.handleColor, - text : '=', - textPosition : 'inside' - }, - highlightStyle : { - brushType: 'fill' - }, - ondrift : this._ondrift, - ondragend : this._ondragend - }; - - if (this.zoomOption.orient == 'horizontal') { - this._startShape.style.height = this._location.height; - this._endShape = zrUtil.clone(this._startShape); - - this._startShape.style.x = this._fillerShae.style.x - this._handleSize, - this._endShape.style.x = this._fillerShae.style.x - + this._fillerShae.style.width; - } - else { - this._startShape.style.width = this._location.width; - this._endShape = zrUtil.clone(this._startShape); - - this._startShape.style.y = this._fillerShae.style.y - this._handleSize; - this._endShape.style.y = this._fillerShae.style.y - + this._fillerShae.style.height; - } - this._startShape = new IconShape(this._startShape); - this._endShape = new IconShape(this._endShape); - this.shapeList.push(this._startShape); - this.shapeList.push(this._endShape); - }, - - /** - * 构建特效边框 - */ - _buildFrame : function () { - // 特效框线,亚像素优化 - var x = this.subPixelOptimize(this._location.x, 1); - var y = this.subPixelOptimize(this._location.y, 1); - this._startFrameShape = { - zlevel : this._zlevelBase, - hoverable :false, - style : { - x : x, - y : y, - width : this._location.width - (x > this._location.x ? 1 : 0), - height : this._location.height - (y > this._location.y ? 1 : 0), - lineWidth: 1, - brushType: 'stroke', - strokeColor : this.zoomOption.handleColor - } - }; - this._endFrameShape = zrUtil.clone(this._startFrameShape); - - this._startFrameShape = new RectangleShape(this._startFrameShape); - this._endFrameShape = new RectangleShape(this._endFrameShape); - this.shapeList.push(this._startFrameShape); - this.shapeList.push(this._endFrameShape); - return; - }, - - _syncHandleShape : function () { - if (this.zoomOption.orient == 'horizontal') { - this._startShape.style.x = this._fillerShae.style.x - this._handleSize; - this._endShape.style.x = this._fillerShae.style.x - + this._fillerShae.style.width; - - this._zoom.start = Math.floor( - (this._startShape.style.x - this._location.x) - / this._location.width * 100 - ); - this._zoom.end = Math.ceil( - (this._endShape.style.x + this._handleSize - this._location.x) - / this._location.width * 100 - ); - } - else { - this._startShape.style.y = this._fillerShae.style.y - this._handleSize; - this._endShape.style.y = this._fillerShae.style.y - + this._fillerShae.style.height; - this._zoom.start = Math.floor( - (this._startShape.style.y - this._location.y) - / this._location.height * 100 - ); - this._zoom.end = Math.ceil( - (this._endShape.style.y + this._handleSize - this._location.y) - / this._location.height * 100 - ); - } - - this.zr.modShape(this._startShape.id); - this.zr.modShape(this._endShape.id); - - // 同步边框 - this._syncFrameShape(); - - this.zr.refresh(); - }, - - _syncFillerShape : function () { - var a; - var b; - if (this.zoomOption.orient == 'horizontal') { - a = this._startShape.style.x; - b = this._endShape.style.x; - this._fillerShae.style.x = Math.min(a, b) + this._handleSize; - this._fillerShae.style.width = Math.abs(a - b) - this._handleSize; - this._zoom.start = Math.floor( - (Math.min(a, b) - this._location.x) - / this._location.width * 100 - ); - this._zoom.end = Math.ceil( - (Math.max(a, b) + this._handleSize - this._location.x) - / this._location.width * 100 - ); - } - else { - a = this._startShape.style.y; - b = this._endShape.style.y; - this._fillerShae.style.y = Math.min(a, b) + this._handleSize; - this._fillerShae.style.height = Math.abs(a - b) - this._handleSize; - this._zoom.start = Math.floor( - (Math.min(a, b) - this._location.y) - / this._location.height * 100 - ); - this._zoom.end = Math.ceil( - (Math.max(a, b) + this._handleSize - this._location.y) - / this._location.height * 100 - ); - } - - this.zr.modShape(this._fillerShae.id); - - // 同步边框 - this._syncFrameShape(); - - this.zr.refresh(); - }, - - _syncFrameShape : function () { - if (this.zoomOption.orient == 'horizontal') { - this._startFrameShape.style.width = - this._fillerShae.style.x - this._location.x; - this._endFrameShape.style.x = - this._fillerShae.style.x + this._fillerShae.style.width; - this._endFrameShape.style.width = - this._location.x + this._location.width - this._endFrameShape.style.x; - } - else { - this._startFrameShape.style.height = - this._fillerShae.style.y - this._location.y; - this._endFrameShape.style.y = - this._fillerShae.style.y + this._fillerShae.style.height; - this._endFrameShape.style.height = - this._location.y + this._location.height - this._endFrameShape.style.y; - } - - this.zr.modShape(this._startFrameShape.id); - this.zr.modShape(this._endFrameShape.id); - }, - - _syncShape : function () { - if (!this.zoomOption.show) { - // 没有伸缩控件 - return; - } - if (this.zoomOption.orient == 'horizontal') { - this._startShape.style.x = this._location.x - + this._zoom.start / 100 * this._location.width; - this._endShape.style.x = this._location.x - + this._zoom.end / 100 * this._location.width - - this._handleSize; - - this._fillerShae.style.x = this._startShape.style.x + this._handleSize; - this._fillerShae.style.width = this._endShape.style.x - - this._startShape.style.x - - this._handleSize; - } - else { - this._startShape.style.y = this._location.y - + this._zoom.start / 100 * this._location.height; - this._endShape.style.y = this._location.y - + this._zoom.end / 100 * this._location.height - - this._handleSize; - - this._fillerShae.style.y = this._startShape.style.y + this._handleSize; - this._fillerShae.style.height = this._endShape.style.y - - this._startShape.style.y - - this._handleSize; - } - - this.zr.modShape(this._startShape.id); - this.zr.modShape(this._endShape.id); - this.zr.modShape(this._fillerShae.id); - // 同步边框 - this._syncFrameShape(); - this.zr.refresh(); - }, - - _syncData : function (dispatchNow) { - var target; - var start; - var end; - var length; - var data; - - for (var key in this._originalData) { - target = this._originalData[key]; - for (var idx in target) { - data = target[idx]; - if (typeof data == 'undefined') { - continue; - } - length = data.length; - start = Math.floor(this._zoom.start / 100 * length); - end = Math.ceil(this._zoom.end / 100 * length); - if (this.option[key][idx].type != ecConfig.CHART_TYPE_SCATTER) { - this.option[key][idx].data = data.slice(start, end); - } - else { - // 散点图特殊处理 - this.option[key][idx].data = this._synScatterData(idx, data); - } - } - } - - if (!this._isSilence && (this.zoomOption.realtime || dispatchNow)) { - this.messageCenter.dispatch( - ecConfig.EVENT.DATA_ZOOM, - null, - {zoom: this._zoom}, - this.myChart - ); - } - - //this.zoomOption.start = this._zoom.start; - //this.zoomOption.end = this._zoom.end; - }, - - _synScatterData : function (seriesIndex, data) { - if (this._zoom.start === 0 - && this._zoom.end == 100 - && this._zoom.start2 === 0 - && this._zoom.end2 == 100 - ) { - return data; - } - var newData = []; - var scale = this._zoom.scatterMap[seriesIndex]; - var total; - var xStart; - var xEnd; - var yStart; - var yEnd; - - if (this.zoomOption.orient == 'horizontal') { - total = scale.x.max - scale.x.min; - xStart = this._zoom.start / 100 * total + scale.x.min; - xEnd = this._zoom.end / 100 * total + scale.x.min; - - total = scale.y.max - scale.y.min; - yStart = this._zoom.start2 / 100 * total + scale.y.min; - yEnd = this._zoom.end2 / 100 * total + scale.y.min; - } - else { - total = scale.x.max - scale.x.min; - xStart = this._zoom.start2 / 100 * total + scale.x.min; - xEnd = this._zoom.end2 / 100 * total + scale.x.min; - - total = scale.y.max - scale.y.min; - yStart = this._zoom.start / 100 * total + scale.y.min; - yEnd = this._zoom.end / 100 * total + scale.y.min; - } - - // console.log(xStart,xEnd,yStart,yEnd); - var value; - for (var i = 0, l = data.length; i < l; i++) { - value = data[i].value || data[i]; - if (value[0] >= xStart - && value[0] <= xEnd - && value[1] >= yStart - && value[1] <= yEnd - ) { - newData.push(data[i]); - } - } - - return newData; - }, - /** - * 拖拽范围控制 - */ - __ondrift : function (shape, dx, dy) { - if (this.zoomOption.zoomLock) { - // zoomLock时把handle转成filler的拖拽 - shape = this._fillerShae; - } - - var detailSize = shape._type == 'filler' ? this._handleSize : 0; - if (this.zoomOption.orient == 'horizontal') { - if (shape.style.x + dx - detailSize <= this._location.x) { - shape.style.x = this._location.x + detailSize; - } - else if (shape.style.x + dx + shape.style.width + detailSize - >= this._location.x + this._location.width - ) { - shape.style.x = this._location.x + this._location.width - - shape.style.width - detailSize; - } - else { - shape.style.x += dx; - } - } - else { - if (shape.style.y + dy - detailSize <= this._location.y) { - shape.style.y = this._location.y + detailSize; - } - else if (shape.style.y + dy + shape.style.height + detailSize - >= this._location.y + this._location.height - ) { - shape.style.y = this._location.y + this._location.height - - shape.style.height - detailSize; - } - else { - shape.style.y += dy; - } - } - - if (shape._type == 'filler') { - this._syncHandleShape(); - } - else { - this._syncFillerShape(); - } - - if (this.zoomOption.realtime) { - this._syncData(); - } - - return true; - }, - - __ondragend : function () { - this.isDragend = true; - }, - - /** - * 数据项被拖拽出去 - */ - ondragend : function (param, status) { - if (!this.isDragend || !param.target) { - // 没有在当前实例上发生拖拽行为则直接返回 - return; - } - - !this.zoomOption.realtime && this._syncData(); - - // 别status = {}赋值啊!! - status.dragOut = true; - status.dragIn = true; - if (!this._isSilence && !this.zoomOption.realtime) { - this.messageCenter.dispatch( - ecConfig.EVENT.DATA_ZOOM, - null, - {zoom: this._zoom}, - this.myChart - ); - } - status.needRefresh = false; // 会有消息触发fresh,不用再刷一遍 - // 处理完拖拽事件后复位 - this.isDragend = false; - - return; - }, - - ondataZoom : function (param, status) { - status.needRefresh = true; - return; - }, - - absoluteZoom : function (param) { - //this.zoomOption.start = - this._zoom.start = param.start; - //this.zoomOption.end = - this._zoom.end = param.end; - //this.zoomOption.start2 = - this._zoom.start2 = param.start2; - //this.zoomOption.end2 = - this._zoom.end2 = param.end2; - this._syncShape(); - this._syncData(true); - return; - }, - - rectZoom : function (param) { - if (!param) { - // 重置拖拽 - //this.zoomOption.start = - //this.zoomOption.start2 = - this._zoom.start = - this._zoom.start2 = 0; - - //this.zoomOption.end = - //this.zoomOption.end2 = - this._zoom.end = - this._zoom.end2 = 100; - - this._syncShape(); - this._syncData(true); - return this._zoom; - } - var gridArea = this.component.grid.getArea(); - var rect = { - x : param.x, - y : param.y, - width : param.width, - height : param.height - }; - // 修正方向框选 - if (rect.width < 0) { - rect.x += rect.width; - rect.width = -rect.width; - } - if (rect.height < 0) { - rect.y += rect.height; - rect.height = -rect.height; - } - // console.log(rect,this._zoom); - - // 剔除无效缩放 - if (rect.x > gridArea.x + gridArea.width - || rect.y > gridArea.y + gridArea.height - ) { - return false; // 无效缩放 - } - - // 修正框选超出 - if (rect.x < gridArea.x) { - rect.x = gridArea.x; - } - if (rect.x + rect.width > gridArea.x + gridArea.width) { - rect.width = gridArea.x + gridArea.width - rect.x; - } - if (rect.y + rect.height > gridArea.y + gridArea.height) { - rect.height = gridArea.y + gridArea.height - rect.y; - } - - var total; - var sdx = (rect.x - gridArea.x) / gridArea.width; - var edx = 1 - (rect.x + rect.width - gridArea.x) / gridArea.width; - var sdy = 1 - (rect.y + rect.height - gridArea.y) / gridArea.height; - var edy = (rect.y - gridArea.y) / gridArea.height; - //console.log('this',sdy,edy,this._zoom.start,this._zoom.end) - if (this.zoomOption.orient == 'horizontal') { - total = this._zoom.end - this._zoom.start; - this._zoom.start += total * sdx; - this._zoom.end -= total * edx; - - total = this._zoom.end2 - this._zoom.start2; - this._zoom.start2 += total * sdy; - this._zoom.end2 -= total * edy; - } - else { - total = this._zoom.end - this._zoom.start; - this._zoom.start += total * sdy; - this._zoom.end -= total * edy; - - total = this._zoom.end2 - this._zoom.start2; - this._zoom.start2 += total * sdx; - this._zoom.end2 -= total * edx; - } - //console.log(this._zoom.start,this._zoom.end,this._zoom.start2,this._zoom.end2) - //this.zoomOption.start = this._zoom.start; - //this.zoomOption.end = this._zoom.end; - //this.zoomOption.start2 = this._zoom.start2; - //this.zoomOption.end2 = this._zoom.end2; - //console.log(rect,gridArea,this._zoom,total) - this._syncShape(); - this._syncData(true); - return this._zoom; - }, - - syncBackupData : function (curOption) { - var start; - var target = this._originalData['series']; - var curSeries = curOption.series; - var curData; - for (var i = 0, l = curSeries.length; i < l; i++) { - curData = curSeries[i].data; - if (target[i]) { - // dataZoom接管的 - start = Math.floor(this._zoom.start / 100 * target[i].length); - } - else { - // 非dataZoom接管 - start = 0; - } - for (var j = 0, k = curData.length; j < k; j++) { - //optionBackup.series[i].data[j + start] = curData[j]; - if (target[i]) { - // 同步内部备份 - target[i][j + start] = curData[j]; - } - } - } - }, - - syncOption : function(magicOption) { - this.silence(true); - this.option = magicOption; - - this.clear(); - // 位置参数,通过计算所得x, y, width, height - this._location = this._getLocation(); - // 缩放参数 - this._zoom = this._getZoom(); - - this._backupData(); - if (this.option.dataZoom && this.option.dataZoom.show) { - this._buildShape(); - } - this._syncData(); - - this.silence(false); - }, - - silence : function (s) { - this._isSilence = s; - }, - - getRealDataIndex : function (sIdx, dIdx) { - if (!this._originalData || (this._zoom.start === 0 && this._zoom.end == 100)) { - return dIdx; - } - var sreies = this._originalData.series; - if (sreies[sIdx]) { - return Math.floor(this._zoom.start / 100 * sreies[sIdx].length) + dIdx; - } - return -1; - }, - - /** - * 避免dataZoom带来两次refresh,不设refresh接口,resize重复一下buildshape逻辑 - */ - resize : function () { - this.clear(); - - // 位置参数,通过计算所得x, y, width, height - this._location = this._getLocation(); - // 缩放参数 - this._zoom = this._getZoom(); - - if (this.option.dataZoom.show) { - this._buildShape(); - } - } - }; - - zrUtil.inherits(DataZoom, Base); - - require('../component').define('dataZoom', DataZoom); - - return DataZoom; -}); -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:handlePolygon,dataRange手柄 - */ -define('echarts/util/shape/HandlePolygon',['require','zrender/shape/Base','zrender/shape/Polygon','zrender/tool/util'],function (require) { - var Base = require('zrender/shape/Base'); - var PolygonShape = require('zrender/shape/Polygon'); - var zrUtil = require('zrender/tool/util'); - - function HandlePolygon(options) { - Base.call(this, options); - } - - HandlePolygon.prototype = { - type : 'handle-polygon', - /** - * 创建多边形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function (ctx, style) { - PolygonShape.prototype.buildPath( - ctx, style - ); - }, - isCover : function (x, y) { - var originPos = this.getTansform(x, y); - x = originPos[0]; - y = originPos[1]; - - // 不能缓存rect! - var rect = this.style.rect; - if (x >= rect.x - && x <= (rect.x + rect.width) - && y >= rect.y - && y <= (rect.y + rect.height) - ) { - // 矩形内 - return true; - } - else { - return false; - } - } - }; - zrUtil.inherits(HandlePolygon, Base); - - return HandlePolygon; -}); - -/** - * echarts组件:值域 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/component/dataRange',['require','./base','zrender/shape/Text','zrender/shape/Rectangle','../util/shape/HandlePolygon','../config','zrender/tool/util','zrender/tool/area','zrender/tool/color','zrender/tool/color','../component'],function (require) { - var Base = require('./base'); - - // 图形依赖 - var TextShape = require('zrender/shape/Text'); - var RectangleShape = require('zrender/shape/Rectangle'); - var HandlePolygonShape = require('../util/shape/HandlePolygon'); - - var ecConfig = require('../config'); - var zrUtil = require('zrender/tool/util'); - var zrArea = require('zrender/tool/area'); - var zrColor = require('zrender/tool/color'); - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} option 图表参数 - * @param {Object=} selected 用于状态保持 - */ - function DataRange(ecTheme, messageCenter, zr, option, myChart) { - if (typeof this.query(option, 'dataRange.min') == 'undefined' - || typeof this.query(option, 'dataRange.max') == 'undefined' - ) { - console.error('option.dataRange.min or option.dataRange.max has not been defined.'); - return; - } - - Base.call(this, ecTheme, messageCenter, zr, option, myChart); - - var self = this; - self._ondrift = function(dx, dy) { - return self.__ondrift(this, dx, dy); - }; - self._ondragend = function() { - return self.__ondragend(); - }; - self._dataRangeSelected = function(param) { - return self.__dataRangeSelected(param); - }; - this._selectedMap = {}; - this._range = {}; - - this.refresh(option); - } - - DataRange.prototype = { - type : ecConfig.COMPONENT_TYPE_DATARANGE, - _textGap : 10, // 非值文字间隔 - _buildShape : function () { - // 值域元素组的位置参数,通过计算所得x, y, width, height - this._itemGroupLocation = this._getItemGroupLocation(); - this._buildBackground(); - if (this.dataRangeOption.splitNumber <= 0 - || this.dataRangeOption.calculable - ) { - this._buildGradient(); - } - else { - this._buildItem(); - } - - for (var i = 0, l = this.shapeList.length; i < l; i++) { - this.zr.addShape(this.shapeList[i]); - } - - this._syncShapeFromRange(); - }, - - /** - * 构建图例型的值域元素 - */ - _buildItem : function () { - var data = this._valueTextList; - var dataLength = data.length; - var itemName; - var itemShape; - var textShape; - var font = this.getFont(this.dataRangeOption.textStyle); - - var lastX = this._itemGroupLocation.x; - var lastY = this._itemGroupLocation.y; - var itemWidth = this.dataRangeOption.itemWidth; - var itemHeight = this.dataRangeOption.itemHeight; - var itemGap = this.dataRangeOption.itemGap; - var textHeight = zrArea.getTextHeight('国', font); - var color; - - if (this.dataRangeOption.orient == 'vertical' - && this.dataRangeOption.x == 'right' - ) { - lastX = this._itemGroupLocation.x - + this._itemGroupLocation.width - - itemWidth; - } - var needValueText = true; - if (this.dataRangeOption.text) { - needValueText = false; - // 第一个文字 - if (this.dataRangeOption.text[0]) { - textShape = this._getTextShape( - lastX, lastY, this.dataRangeOption.text[0] - ); - if (this.dataRangeOption.orient == 'horizontal') { - lastX += zrArea.getTextWidth( - this.dataRangeOption.text[0], - font - ) - + this._textGap; - } - else { - lastY += textHeight + this._textGap; - textShape.style.y += textHeight / 2 + this._textGap; - textShape.style.textBaseline = 'bottom'; - } - this.shapeList.push(new TextShape(textShape)); - } - } - - for (var i = 0; i < dataLength; i++) { - itemName = data[i]; - color = this.getColor((dataLength - i) * this._gap + this.dataRangeOption.min); - // 图形 - itemShape = this._getItemShape( - lastX, lastY, - itemWidth, itemHeight, - (this._selectedMap[i] ? color : '#ccc') - ); - itemShape._idx = i; - itemShape.onclick = this._dataRangeSelected; - this.shapeList.push(new RectangleShape(itemShape)); - - if (needValueText) { - // 文字 - textShape = { - zlevel : this._zlevelBase, - style : { - x : lastX + itemWidth + 5, - y : lastY, - color : this._selectedMap[i] - ? this.dataRangeOption.textStyle.color - : '#ccc', - text: data[i], - textFont: font, - textBaseline: 'top' - }, - highlightStyle:{ - brushType: 'fill' - }, - clickable : true - }; - if (this.dataRangeOption.orient == 'vertical' - && this.dataRangeOption.x == 'right' - ) { - textShape.style.x -= (itemWidth + 10); - textShape.style.textAlign = 'right'; - } - textShape._idx = i; - textShape.onclick = this._dataRangeSelected; - this.shapeList.push(new TextShape(textShape)); - } - - if (this.dataRangeOption.orient == 'horizontal') { - lastX += itemWidth - + (needValueText ? 5 : 0) - + (needValueText - ? zrArea.getTextWidth(itemName, font) - : 0) - + itemGap; - } - else { - lastY += itemHeight + itemGap; - } - } - - if (!needValueText && this.dataRangeOption.text[1]) { - if (this.dataRangeOption.orient == 'horizontal') { - lastX = lastX - itemGap + this._textGap; - } - else { - lastY = lastY - itemGap + this._textGap; - } - // 最后一个文字 - textShape = this._getTextShape( - lastX, lastY, this.dataRangeOption.text[1] - ); - - if (this.dataRangeOption.orient != 'horizontal') { - textShape.style.y -= 5; - textShape.style.textBaseline = 'top'; - } - - this.shapeList.push(new TextShape(textShape)); - } - }, - - /** - * 构建渐变型的值域元素 - */ - _buildGradient : function () { - var itemShape; - var textShape; - var font = this.getFont(this.dataRangeOption.textStyle); - - var lastX = this._itemGroupLocation.x; - var lastY = this._itemGroupLocation.y; - var itemWidth = this.dataRangeOption.itemWidth; - var itemHeight = this.dataRangeOption.itemHeight; - var textHeight = zrArea.getTextHeight('国', font); - - - var needValueText = true; - if (this.dataRangeOption.text) { - needValueText = false; - // 第一个文字 - if (this.dataRangeOption.text[0]) { - textShape = this._getTextShape( - lastX, lastY, this.dataRangeOption.text[0] - ); - if (this.dataRangeOption.orient == 'horizontal') { - lastX += zrArea.getTextWidth( - this.dataRangeOption.text[0], - font - ) - + this._textGap; - } - else { - lastY += textHeight + this._textGap; - textShape.style.y += textHeight / 2 + this._textGap; - textShape.style.textBaseline = 'bottom'; - } - this.shapeList.push(new TextShape(textShape)); - } - } - - var zrColor = require('zrender/tool/color'); - var per = 1 / (this.dataRangeOption.color.length - 1); - var colorList = []; - for (var i = 0, l = this.dataRangeOption.color.length; i < l; i++) { - colorList.push([i * per, this.dataRangeOption.color[i]]); - } - if (this.dataRangeOption.orient == 'horizontal') { - itemShape = { - zlevel : this._zlevelBase, - style : { - x : lastX, - y : lastY, - width : itemWidth * 10, - height : itemHeight, - color : zrColor.getLinearGradient( - lastX, lastY, lastX + itemWidth * 10, lastY, - colorList - ) - }, - hoverable : false - }; - lastX += itemWidth * 10 + this._textGap; - } - else { - itemShape = { - zlevel : this._zlevelBase, - style : { - x : lastX, - y : lastY, - width : itemWidth, - height : itemHeight * 10, - color : zrColor.getLinearGradient( - lastX, lastY, lastX, lastY + itemHeight * 10, - colorList - ) - }, - hoverable : false - }; - lastY += itemHeight * 10 + this._textGap; - } - this.shapeList.push(new RectangleShape(itemShape)); - if (this.dataRangeOption.calculable) { - // 可计算元素的位置缓存 - this._calculableLocation = itemShape.style; - this._buildFiller(); - this._bulidMask(); - this._bulidHandle(); - } - - if (!needValueText && this.dataRangeOption.text[1]) { - // 最后一个文字 - textShape = this._getTextShape( - lastX, lastY, this.dataRangeOption.text[1] - ); - - this.shapeList.push(new TextShape(textShape)); - } - }, - - /** - * 构建填充物 - */ - _buildFiller : function () { - this._fillerShae = { - zlevel : this._zlevelBase + 1, - style : { - x : this._calculableLocation.x, - y : this._calculableLocation.y, - width : this._calculableLocation.width, - height : this._calculableLocation.height, - color : 'rgba(255,255,255,0)' - }, - highlightStyle : { - strokeColor : 'rgba(255,255,255,0.5)', - lineWidth : 1 - }, - draggable : true, - ondrift : this._ondrift, - ondragend : this._ondragend, - _type : 'filler' - }; - this._fillerShae = new RectangleShape(this._fillerShae); - this.shapeList.push(this._fillerShae); - }, - - /** - * 构建拖拽手柄 - */ - _bulidHandle : function () { - var x = this._calculableLocation.x; - var y = this._calculableLocation.y; - var width = this._calculableLocation.width; - var height = this._calculableLocation.height; - - var font = this.getFont(this.dataRangeOption.textStyle); - var textHeight = zrArea.getTextHeight('国', font); - var textWidth = Math.max( - zrArea.getTextWidth(this._textFormat(this.dataRangeOption.max), font), - zrArea.getTextWidth(this._textFormat(this.dataRangeOption.min), font) - ) + 2; - - var pointListStart; - var textXStart; - var textYStart; - var coverRectStart; - var pointListEnd; - var textXEnd; - var textYEnd; - var coverRectEnd; - if (this.dataRangeOption.orient == 'horizontal') { - // 水平 - if (this.dataRangeOption.y != 'bottom') { - // 手柄统统在下方 - pointListStart = [ - [x, y], - [x, y + height + textHeight], - [x - textHeight, y + height + textHeight], - [x - 1, y + height], - [x - 1, y] - - ]; - textXStart = x - textWidth / 2 - textHeight; - textYStart = y + height + textHeight / 2 + 2; - coverRectStart = { - x : x - textWidth - textHeight, - y : y + height, - width : textWidth + textHeight, - height : textHeight - }; - - pointListEnd = [ - [x + width, y], - [x + width, y + height + textHeight], - [x + width + textHeight, y + height + textHeight], - [x + width + 1, y + height], - [x + width + 1, y] - ]; - textXEnd = x + width + textWidth / 2 + textHeight; - textYEnd = textYStart; - coverRectEnd = { - x : x + width, - y : y + height, - width : textWidth + textHeight, - height : textHeight - }; - } - else { - // 手柄在上方 - pointListStart = [ - [x, y + height], - [x, y - textHeight], - [x - textHeight, y - textHeight], - [x - 1, y], - [x - 1, y + height] - - ]; - textXStart = x - textWidth / 2 - textHeight; - textYStart = y - textHeight / 2 - 2; - coverRectStart = { - x : x - textWidth - textHeight, - y : y - textHeight, - width : textWidth + textHeight, - height : textHeight - }; - - pointListEnd = [ - [x + width, y + height], - [x + width, y - textHeight], - [x + width + textHeight, y - textHeight], - [x + width + 1, y], - [x + width + 1, y + height] - ]; - textXEnd = x + width + textWidth / 2 + textHeight; - textYEnd = textYStart; - coverRectEnd = { - x : x + width, - y : y - textHeight, - width : textWidth + textHeight, - height : textHeight - }; - } - } - else { - textWidth += textHeight; - // 垂直 - if (this.dataRangeOption.x != 'right') { - // 手柄统统在右侧 - pointListStart = [ - [x, y], - [x + width + textHeight, y], - [x + width + textHeight, y - textHeight], - [x + width, y - 1], - [x, y - 1] - ]; - textXStart = x + width + textWidth / 2 + textHeight / 2; - textYStart = y - textHeight / 2; - coverRectStart = { - x : x + width, - y : y - textHeight, - width : textWidth + textHeight, - height : textHeight - }; - - pointListEnd = [ - [x, y + height], - [x + width + textHeight, y + height], - [x + width + textHeight, y + textHeight + height], - [x + width, y + 1 + height], - [x, y + height + 1] - ]; - textXEnd = textXStart; - textYEnd = y + height + textHeight / 2; - coverRectEnd = { - x : x + width, - y : y + height, - width : textWidth + textHeight, - height : textHeight - }; - } - else { - // 手柄在左侧 - pointListStart = [ - [x + width, y], - [x - textHeight, y], - [x - textHeight, y - textHeight], - [x, y - 1], - [x + width, y - 1] - ]; - textXStart = x - textWidth / 2 - textHeight / 2; - textYStart = y - textHeight / 2; - coverRectStart = { - x : x - textWidth - textHeight, - y : y - textHeight, - width : textWidth + textHeight, - height : textHeight - }; - - pointListEnd = [ - [x + width, y + height], - [x - textHeight, y + height], - [x - textHeight, y + textHeight + height], - [x, y + 1 + height], - [x + width, y + height + 1] - ]; - textXEnd = textXStart; - textYEnd = y + height + textHeight / 2; - coverRectEnd = { - x : x - textWidth - textHeight, - y : y + height, - width : textWidth + textHeight, - height : textHeight - }; - } - } - - this._startShape = { - style : { - pointList : pointListStart, - text : this._textFormat(this.dataRangeOption.max), - textX : textXStart, - textY : textYStart, - color : this.getColor(this.dataRangeOption.max), - rect : coverRectStart, - x : pointListStart[0][0], - y : pointListStart[0][1], - _x : pointListStart[0][0], // 拖拽区域控制缓存 - _y : pointListStart[0][1] - } - }; - this._startShape.highlightStyle = { - strokeColor : this._startShape.style.color, - lineWidth : 1 - }; - - this._endShape = { - style : { - pointList : pointListEnd, - text : this._textFormat(this.dataRangeOption.min), - textX : textXEnd, - textY : textYEnd, - color : this.getColor(this.dataRangeOption.min), - rect : coverRectEnd, - x : pointListEnd[0][0], - y : pointListEnd[0][1], - _x : pointListEnd[0][0], // 拖拽区域控制缓存 - _y : pointListEnd[0][1] - } - }; - this._endShape.highlightStyle = { - strokeColor : this._endShape.style.color, - lineWidth : 1 - }; - - // 统一参数 - this._startShape.zlevel = this._endShape.zlevel = this._zlevelBase + 1; - this._startShape.draggable = this._endShape.draggable = true; - this._startShape.ondrift = this._endShape.ondrift = this._ondrift; - this._startShape.ondragend = this._endShape.ondragend = this._ondragend; - - this._startShape.style.textColor = this._endShape.style.textColor - = this.dataRangeOption.textStyle.color; - this._startShape.style.textAlign = this._endShape.style.textAlign = 'center'; - this._startShape.style.textPosition = this._endShape.style.textPosition = 'specific'; - this._startShape.style.textBaseline = this._endShape.style.textBaseline = 'middle'; - // for ondrif计算统一 - this._startShape.style.width = this._endShape.style.width = 0; - this._startShape.style.height = this._endShape.style.height = 0; - this._startShape.style.textPosition = this._endShape.style.textPosition = 'specific'; - - this._startShape = new HandlePolygonShape(this._startShape); - this._endShape = new HandlePolygonShape(this._endShape); - this.shapeList.push(this._startShape); - this.shapeList.push(this._endShape); - }, - - _bulidMask : function () { - var x = this._calculableLocation.x; - var y = this._calculableLocation.y; - var width = this._calculableLocation.width; - var height = this._calculableLocation.height; - this._startMask = { - zlevel : this._zlevelBase + 1, - style : { - x : x, - y : y, - width : this.dataRangeOption.orient == 'horizontal' - ? 0 : width, - height : this.dataRangeOption.orient == 'horizontal' - ? height : 0, - color : '#ccc' - }, - hoverable:false - }; - this._endMask = { - zlevel : this._zlevelBase + 1, - style : { - x : this.dataRangeOption.orient == 'horizontal' - ? x + width : x, - y : this.dataRangeOption.orient == 'horizontal' - ? y : y + height, - width : this.dataRangeOption.orient == 'horizontal' - ? 0 : width, - height : this.dataRangeOption.orient == 'horizontal' - ? height : 0, - color : '#ccc' - }, - hoverable:false - }; - this._startMask = new RectangleShape(this._startMask); - this._endMask = new RectangleShape(this._endMask); - this.shapeList.push(this._startMask); - this.shapeList.push(this._endMask); - }, - - _buildBackground : function () { - var pTop = this.dataRangeOption.padding[0]; - var pRight = this.dataRangeOption.padding[1]; - var pBottom = this.dataRangeOption.padding[2]; - var pLeft = this.dataRangeOption.padding[3]; - - this.shapeList.push(new RectangleShape({ - zlevel : this._zlevelBase, - hoverable :false, - style : { - x : this._itemGroupLocation.x - pLeft, - y : this._itemGroupLocation.y - pTop, - width : this._itemGroupLocation.width + pLeft + pRight, - height : this._itemGroupLocation.height + pTop + pBottom, - brushType : this.dataRangeOption.borderWidth === 0 - ? 'fill' : 'both', - color : this.dataRangeOption.backgroundColor, - strokeColor : this.dataRangeOption.borderColor, - lineWidth : this.dataRangeOption.borderWidth - } - })); - }, - - /** - * 根据选项计算值域实体的位置坐标 - */ - _getItemGroupLocation : function () { - var data = this._valueTextList; - var dataLength = data.length; - var itemGap = this.dataRangeOption.itemGap; - var itemWidth = this.dataRangeOption.itemWidth; - var itemHeight = this.dataRangeOption.itemHeight; - var totalWidth = 0; - var totalHeight = 0; - var font = this.getFont(this.dataRangeOption.textStyle); - var textHeight = zrArea.getTextHeight('国', font); - - if (this.dataRangeOption.orient == 'horizontal') { - // 水平布局,计算总宽度 - if (this.dataRangeOption.text - || this.dataRangeOption.splitNumber <= 0 - || this.dataRangeOption.calculable - ) { - // 指定文字或线性渐变 - totalWidth = - ((this.dataRangeOption.splitNumber <= 0 - || this.dataRangeOption.calculable) - ? (itemWidth * 10 + itemGap) - : dataLength * (itemWidth + itemGap)) - + (this.dataRangeOption.text - && typeof this.dataRangeOption.text[0] != 'undefined' - ? (zrArea.getTextWidth( - this.dataRangeOption.text[0], - font - ) + this._textGap) - : 0) - + (this.dataRangeOption.text - && typeof this.dataRangeOption.text[1] != 'undefined' - ? (zrArea.getTextWidth( - this.dataRangeOption.text[1], - font - ) + this._textGap) - : 0); - } - else { - // 值标签 - itemWidth += 5; - for (var i = 0; i < dataLength; i++) { - totalWidth += itemWidth - + zrArea.getTextWidth( - data[i], - font - ) - + itemGap; - } - } - totalWidth -= itemGap; // 减去最后一个的itemGap - totalHeight = Math.max(textHeight, itemHeight); - } - else { - // 垂直布局,计算总高度 - var maxWidth; - if (this.dataRangeOption.text - || this.dataRangeOption.splitNumber <= 0 - || this.dataRangeOption.calculable - ) { - // 指定文字或线性渐变 - totalHeight = - ((this.dataRangeOption.splitNumber <= 0 - || this.dataRangeOption.calculable) - ? (itemHeight * 10 + itemGap) - : dataLength * (itemHeight + itemGap)) - + (this.dataRangeOption.text - && typeof this.dataRangeOption.text[0] != 'undefined' - ? (this._textGap + textHeight) - : 0) - + (this.dataRangeOption.text - && typeof this.dataRangeOption.text[1] != 'undefined' - ? (this._textGap + textHeight) - : 0); - - maxWidth = Math.max( - zrArea.getTextWidth( - (this.dataRangeOption.text && this.dataRangeOption.text[0]) - || '', - font - ), - zrArea.getTextWidth( - (this.dataRangeOption.text && this.dataRangeOption.text[1]) - || '', - font - ) - ); - totalWidth = Math.max(itemWidth, maxWidth); - } - else { - totalHeight = (itemHeight + itemGap) * dataLength; - // 值标签 - itemWidth += 5; - maxWidth = 0; - for (var i = 0; i < dataLength; i++) { - maxWidth = Math.max( - maxWidth, - zrArea.getTextWidth( - data[i], - font - ) - ); - } - totalWidth = itemWidth + maxWidth; - } - totalHeight -= itemGap; // 减去最后一个的itemGap; - } - - var x; - var zrWidth = this.zr.getWidth(); - switch (this.dataRangeOption.x) { - case 'center' : - x = Math.floor((zrWidth - totalWidth) / 2); - break; - case 'left' : - x = this.dataRangeOption.padding[3] - + this.dataRangeOption.borderWidth; - break; - case 'right' : - x = zrWidth - - totalWidth - - this.dataRangeOption.padding[1] - - this.dataRangeOption.borderWidth; - break; - default : - x = this.parsePercent(this.dataRangeOption.x, zrWidth); - x = isNaN(x) ? 0 : x; - break; - } - - var y; - var zrHeight = this.zr.getHeight(); - switch (this.dataRangeOption.y) { - case 'top' : - y = this.dataRangeOption.padding[0] - + this.dataRangeOption.borderWidth; - break; - case 'bottom' : - y = zrHeight - - totalHeight - - this.dataRangeOption.padding[2] - - this.dataRangeOption.borderWidth; - break; - case 'center' : - y = Math.floor((zrHeight - totalHeight) / 2); - break; - default : - y = this.parsePercent(this.dataRangeOption.y, zrHeight); - y = isNaN(y) ? 0 : y; - break; - } - - if (this.dataRangeOption.calculable) { - // 留出手柄控件 - var handlerWidth = Math.max( - zrArea.getTextWidth(this.dataRangeOption.max, font), - zrArea.getTextWidth(this.dataRangeOption.min, font) - ) + textHeight; - if (this.dataRangeOption.orient == 'horizontal') { - if (x < handlerWidth) { - x = handlerWidth; - } - if (x + totalWidth + handlerWidth > zrWidth) { - x -= handlerWidth; - } - } - else { - if (y < textHeight) { - y = textHeight; - } - if (y + totalHeight + textHeight > zrHeight) { - y -= textHeight; - } - } - } - - return { - x : x, - y : y, - width : totalWidth, - height : totalHeight - }; - }, - - // 指定文本 - _getTextShape : function (x, y, text) { - return { - zlevel : this._zlevelBase, - style : { - x : (this.dataRangeOption.orient == 'horizontal' - ? x - : this._itemGroupLocation.x - + this._itemGroupLocation.width / 2 - ), - y : (this.dataRangeOption.orient == 'horizontal' - ? this._itemGroupLocation.y - + this._itemGroupLocation.height / 2 - : y - ), - color : this.dataRangeOption.textStyle.color, - text: text, - textFont: this.getFont(this.dataRangeOption.textStyle), - textBaseline: (this.dataRangeOption.orient == 'horizontal' - ? 'middle' : 'top'), - textAlign: (this.dataRangeOption.orient == 'horizontal' - ? 'left' : 'center') - }, - hoverable : false - }; - }, - - // 色尺legend item shape - _getItemShape : function (x, y, width, height, color) { - return { - zlevel : this._zlevelBase, - style : { - x : x, - y : y + 1, - width : width, - height : height - 2, - color : color - }, - highlightStyle: { - strokeColor: color, - lineWidth : 1 - }, - clickable : true - }; - }, - - /** - * 拖拽范围控制 - */ - __ondrift : function (shape, dx, dy) { - var x = this._calculableLocation.x; - var y = this._calculableLocation.y; - var width = this._calculableLocation.width; - var height = this._calculableLocation.height; - - if (this.dataRangeOption.orient == 'horizontal') { - if (shape.style.x + dx <= x) { - shape.style.x = x; - } - else if (shape.style.x + dx + shape.style.width >= x + width) { - shape.style.x = x + width - shape.style.width; - } - else { - shape.style.x += dx; - } - } - else { - if (shape.style.y + dy <= y) { - shape.style.y = y; - } - else if (shape.style.y + dy + shape.style.height >= y + height) { - shape.style.y = y + height - shape.style.height; - } - else { - shape.style.y += dy; - } - } - - if (shape._type == 'filler') { - this._syncHandleShape(); - } - else { - this._syncFillerShape(shape); - } - - if (this.dataRangeOption.realtime) { - this._syncData(); - } - - return true; - }, - - __ondragend : function () { - this.isDragend = true; - }, - - /** - * 数据项被拖拽出去 - */ - ondragend : function (param, status) { - if (!this.isDragend || !param.target) { - // 没有在当前实例上发生拖拽行为则直接返回 - return; - } - - !this.dataRangeOption.realtime && this._syncData(); - - // 别status = {}赋值啊!! - status.dragOut = true; - status.dragIn = true; - - if (!this.dataRangeOption.realtime && false) { - this.messageCenter.dispatch( - ecConfig.EVENT.DATA_RANGE, - null, - { - range : { - start : this._range.end, - end : this._range.start - } - }, - this.myChart - ); - } - - status.needRefresh = false; // 会有消息触发fresh,不用再刷一遍 - // 处理完拖拽事件后复位 - this.isDragend = false; - - return; - }, - - // 外部传入range - _syncShapeFromRange : function () { - var range = this.dataRangeOption.range || {}; - // 做一个反转 - this._range.end = typeof this._range.end != 'undefined' - ? this._range.end - : (typeof range.start != 'undefined' ? range.start : 0); - this._range.start = typeof this._range.start != 'undefined' - ? this._range.start - : (typeof range.end != 'undefined' ? range.end : 100); - - if (this._range.start != 100 || this._range.end !== 0) { - // 非默认满值同步一下图形 - if (this.dataRangeOption.orient == 'horizontal') { - // 横向 - var width = this._fillerShae.style.width; - this._fillerShae.style.x += - width * (100 - this._range.start) / 100; - this._fillerShae.style.width = - width * (this._range.start - this._range.end) / 100; - } - else { - // 纵向 - var height = this._fillerShae.style.height; - this._fillerShae.style.y += - height * (100 - this._range.start) / 100; - this._fillerShae.style.height = - height * (this._range.start - this._range.end) / 100; - } - this.zr.modShape(this._fillerShae.id); - this._syncHandleShape(); - } - }, - - _syncHandleShape : function () { - var x = this._calculableLocation.x; - var y = this._calculableLocation.y; - var width = this._calculableLocation.width; - var height = this._calculableLocation.height; - - if (this.dataRangeOption.orient == 'horizontal') { - this._startShape.style.x = this._fillerShae.style.x; - this._startMask.style.width = this._startShape.style.x - x; - - this._endShape.style.x = this._fillerShae.style.x - + this._fillerShae.style.width; - this._endMask.style.x = this._endShape.style.x; - this._endMask.style.width = x + width - this._endShape.style.x; - - this._range.start = Math.ceil( - 100 - (this._startShape.style.x - x) / width * 100 - ); - this._range.end = Math.floor( - 100 - (this._endShape.style.x - x) / width * 100 - ); - } - else { - this._startShape.style.y = this._fillerShae.style.y; - this._startMask.style.height = this._startShape.style.y - y; - - this._endShape.style.y = this._fillerShae.style.y - + this._fillerShae.style.height; - this._endMask.style.y = this._endShape.style.y; - this._endMask.style.height = y + height - this._endShape.style.y; - - this._range.start = Math.ceil( - 100 - (this._startShape.style.y - y) / height * 100 - ); - this._range.end = Math.floor( - 100 - (this._endShape.style.y - y) / height * 100 - ); - } - - this._syncShape(); - }, - - _syncFillerShape : function (e) { - var x = this._calculableLocation.x; - var y = this._calculableLocation.y; - var width = this._calculableLocation.width; - var height = this._calculableLocation.height; - - var a; - var b; - if (this.dataRangeOption.orient == 'horizontal') { - a = this._startShape.style.x; - b = this._endShape.style.x; - if (e.id == this._startShape.id && a >= b) { - // _startShape触发 - b = a; - this._endShape.style.x = a; - } - else if (e.id == this._endShape.id && a >= b) { - // _endShape触发 - a = b; - this._startShape.style.x = a; - } - this._fillerShae.style.x = a; - this._fillerShae.style.width = b - a; - this._startMask.style.width = a - x; - this._endMask.style.x = b; - this._endMask.style.width = x + width - b; - - this._range.start = Math.ceil(100 - (a - x) / width * 100); - this._range.end = Math.floor(100 - (b - x) / width * 100); - } - else { - a = this._startShape.style.y; - b = this._endShape.style.y; - if (e.id == this._startShape.id && a >= b) { - // _startShape触发 - b = a; - this._endShape.style.y = a; - } - else if (e.id == this._endShape.id && a >= b) { - // _endShape触发 - a = b; - this._startShape.style.y = a; - } - this._fillerShae.style.y = a; - this._fillerShae.style.height = b - a; - this._startMask.style.height = a - y; - this._endMask.style.y = b; - this._endMask.style.height = y + height - b; - - this._range.start = Math.ceil(100 - (a - y) / height * 100); - this._range.end = Math.floor(100 - (b - y) / height * 100); - } - - this._syncShape(); - }, - - _syncShape : function () { - this._startShape.position = [ - this._startShape.style.x - this._startShape.style._x, - this._startShape.style.y - this._startShape.style._y - ]; - - this._startShape.style.text = this._textFormat( - this._gap * this._range.start + this.dataRangeOption.min - ); - - this._startShape.style.color - = this._startShape.highlightStyle.strokeColor - = this.getColor( - this._gap * this._range.start + this.dataRangeOption.min - ); - - this._endShape.position = [ - this._endShape.style.x - this._endShape.style._x, - this._endShape.style.y - this._endShape.style._y - ]; - - this._endShape.style.text = this._textFormat( - this._gap * this._range.end + this.dataRangeOption.min - ); - - this._endShape.style.color - = this._endShape.highlightStyle.strokeColor - = this.getColor( - this._gap * this._range.end + this.dataRangeOption.min - ); - - this.zr.modShape(this._startShape.id); - this.zr.modShape(this._endShape.id); - this.zr.modShape(this._startMask.id); - this.zr.modShape(this._endMask.id); - this.zr.modShape(this._fillerShae.id); - this.zr.refresh(); - }, - - _syncData : function () { - if (this.dataRangeOption.realtime) { - this.messageCenter.dispatch( - ecConfig.EVENT.DATA_RANGE, - null, - { - range : { - start : this._range.end, - end : this._range.start - } - }, - this.myChart - ); - } - }, - - - __dataRangeSelected : function (param) { - var idx = param.target._idx; - this._selectedMap[idx] = !this._selectedMap[idx]; - this.messageCenter.dispatch(ecConfig.EVENT.REFRESH, null, null, this.myChart); - }, - - _textFormat : function(valueStart, valueEnd) { - valueStart = valueStart.toFixed(this.dataRangeOption.precision); - valueEnd = typeof valueEnd != 'undefined' - ? valueEnd.toFixed(this.dataRangeOption.precision) : ''; - if (this.dataRangeOption.formatter) { - if (typeof this.dataRangeOption.formatter == 'string') { - return this.dataRangeOption.formatter.replace('{value}', valueStart) - .replace('{value2}', valueEnd); - } - else if (typeof this.dataRangeOption.formatter == 'function') { - return this.dataRangeOption.formatter.call( - this.myChart, valueStart, valueEnd - ); - } - } - - if (valueEnd !== '') { - return valueStart + ' - ' + valueEnd; - } - - return valueStart; - }, - - /** - * 刷新 - */ - refresh : function (newOption) { - if (newOption) { - this.option = newOption; - this.option.dataRange = this.reformOption(this.option.dataRange); - // 补全padding属性 - this.option.dataRange.padding = this.reformCssArray( - this.option.dataRange.padding - ); - this.dataRangeOption = this.option.dataRange; - - var splitNumber = this.dataRangeOption.splitNumber <= 0 - || this.dataRangeOption.calculable - ? 100 - : this.dataRangeOption.splitNumber; - this._colorList = zrColor.getGradientColors( - this.dataRangeOption.color, - Math.max( - (splitNumber - this.dataRangeOption.color.length) - / (this.dataRangeOption.color.length - 1), - 0 - ) + 1 - ); - - if (this._colorList.length > splitNumber) { - var len = this._colorList.length; - var newColorList = [this._colorList[0]]; - var step = len / (splitNumber - 1); - for (var i = 1; i < splitNumber - 1; i++) { - newColorList.push(this._colorList[Math.floor(i * step)]); - } - newColorList.push(this._colorList[len - 1]); - this._colorList = newColorList; - } - // console.log(this._colorList.length) - - var precision = this.dataRangeOption.precision; - this._gap = (this.dataRangeOption.max - this.dataRangeOption.min) / splitNumber; - while (this._gap.toFixed(precision) - 0 != this._gap && precision < 5) { - // 精度自适应 - precision++; - } - this.dataRangeOption.precision = precision; - - this._gap = ( - (this.dataRangeOption.max - this.dataRangeOption.min) / splitNumber - ).toFixed(precision) - 0; - - this._valueTextList = []; - for (var i = 0; i < splitNumber; i++) { - this._selectedMap[i] = true; - this._valueTextList.unshift( - this._textFormat( - i * this._gap + this.dataRangeOption.min, - (i + 1) * this._gap + this.dataRangeOption.min - ) - ); - } - } - - this.clear(); - this._buildShape(); - }, - - getColor : function (value) { - if (isNaN(value)) { - return null; - } - - if (value < this.dataRangeOption.min) { - value = this.dataRangeOption.min; - } - else if (value > this.dataRangeOption.max) { - value = this.dataRangeOption.max; - } - - if (this.dataRangeOption.calculable) { - if (value - (this._gap * this._range.start + this.dataRangeOption.min) > 0.00005 - || value - (this._gap * this._range.end + this.dataRangeOption.min) < -0.00005) { - return null; - } - } - - var idx = this._colorList.length - Math.ceil( - (value - this.dataRangeOption.min) - / (this.dataRangeOption.max - this.dataRangeOption.min) - * this._colorList.length - ); - if (idx == this._colorList.length) { - idx--; - } - //console.log(value, idx,this._colorList[idx]) - if (this._selectedMap[idx]) { - return this._colorList[idx]; - } - else { - return null; - } - } - }; - - zrUtil.inherits(DataRange, Base); - - require('../component').define('dataRange', DataRange); - - return DataRange; -}); - - - -/** - * echarts图表类:散点图 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/chart/scatter',['require','../component/base','./base','../util/shape/Symbol','../component/axis','../component/grid','../component/dataZoom','../component/dataRange','../config','zrender/tool/util','zrender/tool/color','../chart'],function (require) { - var ComponentBase = require('../component/base'); - var ChartBase = require('./base'); - - // 图形依赖 - var SymbolShape = require('../util/shape/Symbol'); - // 组件依赖 - require('../component/axis'); - require('../component/grid'); - require('../component/dataZoom'); - require('../component/dataRange'); - - var ecConfig = require('../config'); - var zrUtil = require('zrender/tool/util'); - var zrColor = require('zrender/tool/color'); - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} series 数据 - * @param {Object} component 组件 - */ - function Scatter(ecTheme, messageCenter, zr, option, myChart){ - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); - // 图表基类 - ChartBase.call(this); - - this.refresh(option); - } - - Scatter.prototype = { - type : ecConfig.CHART_TYPE_SCATTER, - /** - * 绘制图形 - */ - _buildShape : function () { - var series = this.series; - this._sIndex2ColorMap = {}; // series默认颜色索引,seriesIndex索引到color - this._symbol = this.option.symbolList; - this._sIndex2ShapeMap = {}; // series图形类型,seriesIndex索引到_symbol - - this.selectedMap = {}; - this.xMarkMap = {}; - - var legend = this.component.legend; - var seriesArray = []; - var serie; // 临时映射变量 - var serieName; // 临时映射变量 - var iconShape; - var iconType; - for (var i = 0, l = series.length; i < l; i++) { - serie = series[i]; - serieName = serie.name; - if (serie.type == ecConfig.CHART_TYPE_SCATTER) { - series[i] = this.reformOption(series[i]); - this._sIndex2ShapeMap[i] = this.query(serie, 'symbol') - || this._symbol[i % this._symbol.length]; - if (legend){ - this.selectedMap[serieName] = legend.isSelected(serieName); - - this._sIndex2ColorMap[i] = zrColor.alpha(legend.getColor(serieName), 0.5); - - iconShape = legend.getItemShape(serieName); - if (iconShape) { - // 回调legend,换一个更形象的icon - var iconType = this._sIndex2ShapeMap[i]; - iconShape.style.brushType = iconType.match('empty') ? 'stroke' : 'both'; - iconType = iconType.replace('empty', '').toLowerCase(); - - if (iconType.match('rectangle')) { - iconShape.style.x += Math.round( - (iconShape.style.width - iconShape.style.height) / 2 - ); - iconShape.style.width = iconShape.style.height; - } - - if (iconType.match('star')) { - iconShape.style.n = (iconType.replace('star','') - 0) || 5; - iconType = 'star'; - } - - if (iconType.match('image')) { - iconShape.style.image = iconType.replace( - new RegExp('^image:\\/\\/'), '' - ); - iconShape.style.x += Math.round( - (iconShape.style.width - iconShape.style.height) / 2 - ); - iconShape.style.width = iconShape.style.height; - iconType = 'image'; - } - - iconShape.style.iconType = iconType; - legend.setItemShape(serieName, iconShape); - } - } - else { - this.selectedMap[serieName] = true; - this._sIndex2ColorMap[i] = this.zr.getColor(i); - } - - if (this.selectedMap[serieName]) { - seriesArray.push(i); - } - } - } - - this._buildSeries(seriesArray); - - this.addShapeList(); - }, - - /** - * 构建类目轴为水平方向的散点图系列 - */ - _buildSeries : function (seriesArray) { - if (seriesArray.length === 0) { - return; - } - var series = this.series; - var seriesIndex; - var serie; - var data; - var value; - var xAxis; - var yAxis; - - var pointList = {}; - var x; - var y; - for (var j = 0, k = seriesArray.length; j < k; j++) { - seriesIndex = seriesArray[j]; - serie = series[seriesIndex]; - if (serie.data.length === 0) { - continue; - } - - xAxis = this.component.xAxis.getAxis(serie.xAxisIndex || 0); - yAxis = this.component.yAxis.getAxis(serie.yAxisIndex || 0); - - pointList[seriesIndex] = []; - for (var i = 0, l = serie.data.length; i < l; i++) { - data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; - if (value == '-' || value.length < 2) { - // 数据格式不符 - continue; - } - x = xAxis.getCoord(value[0]); - y = yAxis.getCoord(value[1]); - pointList[seriesIndex].push([ - x, // 横坐标 - y, // 纵坐标 - i, // 数据index - data.name || '' // 名称 - ]); - - } - this.xMarkMap[seriesIndex] = this._markMap( - xAxis, yAxis, serie.data, pointList[seriesIndex] - ); - this.buildMark(seriesIndex); - } - - // console.log(pointList) - this._buildPointList(pointList); - }, - - _markMap : function (xAxis, yAxis, data, pointList) { - var xMarkMap = { - min0 : Number.POSITIVE_INFINITY, - max0 : Number.NEGATIVE_INFINITY, - sum0 : 0, - counter0 : 0, - average0 : 0, - min1 : Number.POSITIVE_INFINITY, - max1 : Number.NEGATIVE_INFINITY, - sum1 : 0, - counter1 : 0, - average1 : 0 - }; - var value; - for (var i = 0, l = pointList.length; i < l; i++) { - /** - x, // 横坐标 - y, // 纵坐标 - i, // 数据index - data.name || '' // 名称 - */ - value = data[pointList[i][2]].value || data[pointList[i][2]]; - // 横轴 - if (xMarkMap.min0 > value[0]) { - xMarkMap.min0 = value[0]; - xMarkMap.minY0 = pointList[i][1]; - xMarkMap.minX0 = pointList[i][0]; - } - if (xMarkMap.max0 < value[0]) { - xMarkMap.max0 = value[0]; - xMarkMap.maxY0 = pointList[i][1]; - xMarkMap.maxX0 = pointList[i][0]; - } - xMarkMap.sum0 += value[0]; - xMarkMap.counter0++; - - // 纵轴 - if (xMarkMap.min1 > value[1]) { - xMarkMap.min1 = value[1]; - xMarkMap.minY1 = pointList[i][1]; - xMarkMap.minX1 = pointList[i][0]; - } - if (xMarkMap.max1 < value[1]) { - xMarkMap.max1 = value[1]; - xMarkMap.maxY1 = pointList[i][1]; - xMarkMap.maxX1 = pointList[i][0]; - } - xMarkMap.sum1 += value[1]; - xMarkMap.counter1++; - } - - var gridX = this.component.grid.getX(); - var gridXend = this.component.grid.getXend(); - var gridY = this.component.grid.getY(); - var gridYend = this.component.grid.getYend(); - - xMarkMap.average0 = (xMarkMap.sum0 / xMarkMap.counter0).toFixed(2) - 0; - var x = xAxis.getCoord(xMarkMap.average0); - // 横轴平均纵向 - xMarkMap.averageLine0 = [ - [x, gridYend], - [x, gridY] - ]; - xMarkMap.minLine0 = [ - [xMarkMap.minX0, gridYend], - [xMarkMap.minX0, gridY] - ]; - xMarkMap.maxLine0 = [ - [xMarkMap.maxX0, gridYend], - [xMarkMap.maxX0, gridY] - ]; - - xMarkMap.average1 = (xMarkMap.sum1 / xMarkMap.counter1).toFixed(2) - 0; - var y = yAxis.getCoord(xMarkMap.average1); - // 纵轴平均横向 - xMarkMap.averageLine1 = [ - [gridX, y], - [gridXend, y] - ]; - xMarkMap.minLine1 = [ - [gridX, xMarkMap.minY1], - [gridXend, xMarkMap.minY1] - ]; - xMarkMap.maxLine1 = [ - [gridX, xMarkMap.maxY1], - [gridXend, xMarkMap.maxY1] - ]; - - return xMarkMap; - }, - - /** - * 生成折线和折线上的拐点 - */ - _buildPointList : function (pointList) { - var series = this.series; - var serie; - var seriesPL; - var singlePoint; - var shape; - for (var seriesIndex in pointList) { - serie = series[seriesIndex]; - seriesPL = pointList[seriesIndex]; - if (serie.large && serie.data.length > serie.largeThreshold) { - this.shapeList.push(this._getLargeSymbol( - seriesPL, - this.getItemStyleColor( - this.query( - serie, 'itemStyle.normal.color' - ), - seriesIndex, - -1 - ) || this._sIndex2ColorMap[seriesIndex] - )); - continue; - } - - /* - * pointlist=[ - * 0 x, - * 1 y, - * 2 数据index - * 3 名称 - * ] - */ - - for (var i = 0, l = seriesPL.length; i < l; i++) { - singlePoint = seriesPL[i]; - shape = this._getSymbol( - seriesIndex, // seriesIndex - singlePoint[2], // dataIndex - singlePoint[3], // name - singlePoint[0], // x - singlePoint[1] // y - ); - shape && this.shapeList.push(shape); - } - } - // console.log(this.shapeList) - }, - - /** - * 生成折线图上的拐点图形 - */ - _getSymbol : function (seriesIndex, dataIndex, name, x, y) { - var series = this.series; - var serie = series[seriesIndex]; - var data = serie.data[dataIndex]; - - var dataRange = this.component.dataRange; - var rangColor; - if (dataRange) { - rangColor = isNaN(data[2]) - ? this._sIndex2ColorMap[seriesIndex] - : dataRange.getColor(data[2]); - if (!rangColor) { - return null; - } - } - else { - rangColor = this._sIndex2ColorMap[seriesIndex]; - } - - var itemShape = this.getSymbolShape( - serie, seriesIndex, data, dataIndex, name, - x, y, - this._sIndex2ShapeMap[seriesIndex], - rangColor, - 'rgba(0,0,0,0)', - 'vertical' - ); - itemShape.zlevel = this._zlevelBase; - itemShape._main = true; - return itemShape; - }, - - _getLargeSymbol : function (pointList, nColor) { - return new SymbolShape({ - zlevel : this._zlevelBase, - _main : true, - hoverable: false, - style : { - pointList : pointList, - color : nColor, - strokeColor : nColor - }, - highlightStyle : { - pointList : [] - } - }); - }, - - // 位置转换 - getMarkCoord : function (seriesIndex, mpData) { - var serie = this.series[seriesIndex]; - var xMarkMap = this.xMarkMap[seriesIndex]; - var xAxis = this.component.xAxis.getAxis(serie.xAxisIndex); - var yAxis = this.component.yAxis.getAxis(serie.yAxisIndex); - var pos; - - if (mpData.type - && (mpData.type == 'max' || mpData.type == 'min' || mpData.type == 'average') - ) { - // 特殊值内置支持 - // 默认取纵值 - var valueIndex = typeof mpData.valueIndex != 'undefined' - ? mpData.valueIndex : 1; - pos = [ - xMarkMap[mpData.type + 'X' + valueIndex], - xMarkMap[mpData.type + 'Y' + valueIndex], - xMarkMap[mpData.type + 'Line' + valueIndex], - xMarkMap[mpData.type + valueIndex] - ]; - } - else { - pos = [ - typeof mpData.xAxis != 'string' && xAxis.getCoordByIndex - ? xAxis.getCoordByIndex(mpData.xAxis || 0) - : xAxis.getCoord(mpData.xAxis || 0), - - typeof mpData.yAxis != 'string' && yAxis.getCoordByIndex - ? yAxis.getCoordByIndex(mpData.yAxis || 0) - : yAxis.getCoord(mpData.yAxis || 0) - ]; - } - - return pos; - }, - - /** - * 刷新 - */ - refresh : function (newOption) { - if (newOption) { - this.option = newOption; - this.series = newOption.series; - } - - this.backupShapeList(); - this._buildShape(); - }, - - /** - * 值域响应 - * @param {Object} param - * @param {Object} status - */ - ondataRange : function (param, status) { - if (this.component.dataRange) { - this.refresh(); - status.needRefresh = true; - } - return; - } - }; - - zrUtil.inherits(Scatter, ChartBase); - zrUtil.inherits(Scatter, ComponentBase); - - // 图表注册 - require('../chart').define('scatter', Scatter); - - return Scatter; -}); -/** - * echarts图表类:K线图 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/chart/k',['require','../component/base','./base','../util/shape/Candle','../component/axis','../component/grid','../component/dataZoom','../config','../util/ecData','zrender/tool/util','../chart'],function (require) { - var ComponentBase = require('../component/base'); - var ChartBase = require('./base'); - - // 图形依赖 - var CandleShape = require('../util/shape/Candle'); - // 组件依赖 - require('../component/axis'); - require('../component/grid'); - require('../component/dataZoom'); - - var ecConfig = require('../config'); - var ecData = require('../util/ecData'); - var zrUtil = require('zrender/tool/util'); - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} series 数据 - * @param {Object} component 组件 - */ - function K(ecTheme, messageCenter, zr, option, myChart){ - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); - // 图表基类 - ChartBase.call(this); - - this.refresh(option); - } - - K.prototype = { - type : ecConfig.CHART_TYPE_K, - /** - * 绘制图形 - */ - _buildShape : function () { - var series = this.series; - this.selectedMap = {}; - - // 水平垂直双向series索引 ,position索引到seriesIndex - var _position2sIndexMap = { - top : [], - bottom : [] - }; - var xAxis; - for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type == ecConfig.CHART_TYPE_K) { - series[i] = this.reformOption(series[i]); - xAxis = this.component.xAxis.getAxis(series[i].xAxisIndex); - if (xAxis.type == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY - ) { - _position2sIndexMap[xAxis.getPosition()].push(i); - } - } - } - //console.log(_position2sIndexMap) - for (var position in _position2sIndexMap) { - if (_position2sIndexMap[position].length > 0) { - this._buildSinglePosition( - position, _position2sIndexMap[position] - ); - } - } - - this.addShapeList(); - }, - - /** - * 构建单个方向上的K线图 - * - * @param {number} seriesIndex 系列索引 - */ - _buildSinglePosition : function (position, seriesArray) { - var mapData = this._mapData(seriesArray); - var locationMap = mapData.locationMap; - var maxDataLength = mapData.maxDataLength; - - if (maxDataLength === 0 || locationMap.length === 0) { - return; - } - this._buildHorizontal(seriesArray, maxDataLength, locationMap); - - for (var i = 0, l = seriesArray.length; i < l; i++) { - this.buildMark(seriesArray[i]); - } - }, - - /** - * 数据整形 - * 数组位置映射到系列索引 - */ - _mapData : function (seriesArray) { - var series = this.series; - var serie; // 临时映射变量 - var serieName; // 临时映射变量 - var legend = this.component.legend; - var locationMap = []; // 需要返回的东西:数组位置映射到系列索引 - var maxDataLength = 0; // 需要返回的东西:最大数据长度 - // 计算需要显示的个数和分配位置并记在下面这个结构里 - for (var i = 0, l = seriesArray.length; i < l; i++) { - serie = series[seriesArray[i]]; - serieName = serie.name; - if (legend){ - this.selectedMap[serieName] = legend.isSelected(serieName); - } else { - this.selectedMap[serieName] = true; - } - - if (this.selectedMap[serieName]) { - locationMap.push(seriesArray[i]); - } - // 兼职帮算一下最大长度 - maxDataLength = Math.max(maxDataLength, serie.data.length); - } - return { - locationMap : locationMap, - maxDataLength : maxDataLength - }; - }, - - /** - * 构建类目轴为水平方向的K线图系列 - */ - _buildHorizontal : function (seriesArray, maxDataLength, locationMap) { - var series = this.series; - // 确定类目轴和数值轴,同一方向随便找一个即可 - var seriesIndex; - var serie; - var xAxisIndex; - var categoryAxis; - var yAxisIndex; // 数值轴各异 - var valueAxis; // 数值轴各异 - - var pointList = {}; - var candleWidth; - var data; - var value; - var barMaxWidth; - for (var j = 0, k = locationMap.length; j < k; j++) { - seriesIndex = locationMap[j]; - serie = series[seriesIndex]; - - xAxisIndex = serie.xAxisIndex || 0; - categoryAxis = this.component.xAxis.getAxis(xAxisIndex); - candleWidth = serie.barWidth - || Math.floor(categoryAxis.getGap() / 2); - barMaxWidth = serie.barMaxWidth; - if (barMaxWidth && barMaxWidth < candleWidth) { - candleWidth = barMaxWidth; - } - yAxisIndex = serie.yAxisIndex || 0; - valueAxis = this.component.yAxis.getAxis(yAxisIndex); - - pointList[seriesIndex] = []; - for (var i = 0, l = maxDataLength; i < l; i++) { - if (typeof categoryAxis.getNameByIndex(i) == 'undefined') { - // 系列数据超出类目轴长度 - break; - } - - data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; - if (value == '-' || value.length != 4) { - // 数据格式不符 - continue; - } - pointList[seriesIndex].push([ - categoryAxis.getCoordByIndex(i), // 横坐标 - candleWidth, - valueAxis.getCoord(value[0]), // 纵坐标:开盘 - valueAxis.getCoord(value[1]), // 纵坐标:收盘 - valueAxis.getCoord(value[2]), // 纵坐标:最低 - valueAxis.getCoord(value[3]), // 纵坐标:最高 - i, // 数据index - categoryAxis.getNameByIndex(i) // 类目名称 - ]); - } - } - // console.log(pointList) - this._buildKLine(seriesArray, pointList); - }, - - /** - * 生成K线 - */ - _buildKLine : function (seriesArray, pointList) { - var series = this.series; - // normal: - var nLineWidth; - var nLineColor; - var nLineColor0; // 阴线 - var nColor; - var nColor0; // 阴线 - - // emphasis: - var eLineWidth; - var eLineColor; - var eLineColor0; - var eColor; - var eColor0; - - var serie; - var queryTarget; - var data; - var seriesPL; - var singlePoint; - var candleType; - - var seriesIndex; - for (var sIdx = 0, len = seriesArray.length; sIdx < len; sIdx++) { - seriesIndex = seriesArray[sIdx]; - serie = series[seriesIndex]; - seriesPL = pointList[seriesIndex]; - - if (this._isLarge(seriesPL)) { - seriesPL = this._getLargePointList(seriesPL); - } - - if (serie.type == ecConfig.CHART_TYPE_K - && typeof seriesPL != 'undefined' - ) { - // 多级控制 - queryTarget = serie; - nLineWidth = this.query( - queryTarget, 'itemStyle.normal.lineStyle.width' - ); - nLineColor = this.query( - queryTarget, 'itemStyle.normal.lineStyle.color' - ); - nLineColor0 = this.query( - queryTarget, 'itemStyle.normal.lineStyle.color0' - ); - nColor = this.query( - queryTarget, 'itemStyle.normal.color' - ); - nColor0 = this.query( - queryTarget, 'itemStyle.normal.color0' - ); - - eLineWidth = this.query( - queryTarget, 'itemStyle.emphasis.lineStyle.width' - ); - eLineColor = this.query( - queryTarget, 'itemStyle.emphasis.lineStyle.color' - ); - eLineColor0 = this.query( - queryTarget, 'itemStyle.emphasis.lineStyle.color0' - ); - eColor = this.query( - queryTarget, 'itemStyle.emphasis.color' - ); - eColor0 = this.query( - queryTarget, 'itemStyle.emphasis.color0' - ); - - /* - * pointlist=[ - * 0 x, - * 1 width, - * 2 y0, - * 3 y1, - * 4 y2, - * 5 y3, - * 6 dataIndex, - * 7 categoryName - * ] - */ - for (var i = 0, l = seriesPL.length; i < l; i++) { - singlePoint = seriesPL[i]; - data = serie.data[singlePoint[6]]; - queryTarget = data; - candleType = singlePoint[3] < singlePoint[2]; - this.shapeList.push(this._getCandle( - seriesIndex, // seriesIndex - singlePoint[6], // dataIndex - singlePoint[7], // name - - singlePoint[0], // x - singlePoint[1], // width - singlePoint[2], // y开盘 - singlePoint[3], // y收盘 - singlePoint[4], // y最低 - singlePoint[5], // y最高 - - // 填充颜色 - candleType - ? (this.query( // 阳 - queryTarget, 'itemStyle.normal.color' - ) || nColor) - : (this.query( // 阴 - queryTarget, 'itemStyle.normal.color0' - ) || nColor0), - - // 线宽 - this.query( - queryTarget, 'itemStyle.normal.lineStyle.width' - ) || nLineWidth, - - // 线色 - candleType - ? (this.query( // 阳 - queryTarget, - 'itemStyle.normal.lineStyle.color' - ) || nLineColor) - : (this.query( // 阴 - queryTarget, - 'itemStyle.normal.lineStyle.color0' - ) || nLineColor0), - - //------------高亮 - - // 填充颜色 - candleType - ? (this.query( // 阳 - queryTarget, 'itemStyle.emphasis.color' - ) || eColor || nColor) - : (this.query( // 阴 - queryTarget, 'itemStyle.emphasis.color0' - ) || eColor0 || nColor0), - - // 线宽 - this.query( - queryTarget, 'itemStyle.emphasis.lineStyle.width' - ) || eLineWidth || nLineWidth, - - // 线色 - candleType - ? (this.query( // 阳 - queryTarget, - 'itemStyle.emphasis.lineStyle.color' - ) || eLineColor || nLineColor) - : (this.query( // 阴 - queryTarget, - 'itemStyle.emphasis.lineStyle.color0' - ) || eLineColor0 || nLineColor0) - )); - } - } - } - // console.log(this.shapeList) - }, - - _isLarge : function(singlePL) { - return singlePL[0][1] < 0.5; - }, - - /** - * 大规模pointList优化 - */ - _getLargePointList : function(singlePL) { - var total = this.component.grid.getWidth(); - var len = singlePL.length; - var newList = []; - for (var i = 0; i < total; i++) { - newList[i] = singlePL[Math.floor(len / total * i)]; - } - return newList; - }, - - /** - * 生成K线图上的图形 - */ - _getCandle : function ( - seriesIndex, dataIndex, name, - x, width, y0, y1, y2, y3, - nColor, nLinewidth, nLineColor, - eColor, eLinewidth, eLineColor - ) { - var series = this.series; - var itemShape = { - zlevel : this._zlevelBase, - clickable: true, - style : { - x : x, - y : [y0, y1, y2, y3], - width : width, - color : nColor, - strokeColor : nLineColor, - lineWidth : nLinewidth, - brushType : 'both' - }, - highlightStyle : { - color : eColor, - strokeColor : eLineColor, - lineWidth : eLinewidth - }, - _seriesIndex: seriesIndex - }; - ecData.pack( - itemShape, - series[seriesIndex], seriesIndex, - series[seriesIndex].data[dataIndex], dataIndex, - name - ); - - itemShape = new CandleShape(itemShape); - return itemShape; - }, - - // 位置转换 - getMarkCoord : function (seriesIndex, mpData) { - var serie = this.series[seriesIndex]; - var xAxis = this.component.xAxis.getAxis(serie.xAxisIndex); - var yAxis = this.component.yAxis.getAxis(serie.yAxisIndex); - - return [ - typeof mpData.xAxis != 'string' && xAxis.getCoordByIndex - ? xAxis.getCoordByIndex(mpData.xAxis || 0) - : xAxis.getCoord(mpData.xAxis || 0), - - typeof mpData.yAxis != 'string' && yAxis.getCoordByIndex - ? yAxis.getCoordByIndex(mpData.yAxis || 0) - : yAxis.getCoord(mpData.yAxis || 0) - ]; - }, - - /** - * 刷新 - */ - refresh : function (newOption) { - if (newOption) { - this.option = newOption; - this.series = newOption.series; - } - - this.backupShapeList(); - this._buildShape(); - }, - - /** - * 动画设定 - */ - addDataAnimation : function (params) { - var series = this.series; - var aniMap = {}; // seriesIndex索引参数 - for (var i = 0, l = params.length; i < l; i++) { - aniMap[params[i][0]] = params[i]; - } - var x; - var dx; - var y; - var serie; - var seriesIndex; - var dataIndex; - for (var i = 0, l = this.shapeList.length; i < l; i++) { - seriesIndex = this.shapeList[i]._seriesIndex; - if (aniMap[seriesIndex] && !aniMap[seriesIndex][3]) { - // 有数据删除才有移动的动画 - if (this.shapeList[i].type == 'candle') { - dataIndex = ecData.get(this.shapeList[i], 'dataIndex'); - serie = series[seriesIndex]; - if (aniMap[seriesIndex][2] - && dataIndex == serie.data.length - 1 - ) { - // 队头加入删除末尾 - this.zr.delShape(this.shapeList[i].id); - continue; - } - else if (!aniMap[seriesIndex][2] && dataIndex === 0) { - // 队尾加入删除头部 - this.zr.delShape(this.shapeList[i].id); - continue; - } - dx = this.component.xAxis.getAxis( - serie.xAxisIndex || 0 - ).getGap(); - x = aniMap[seriesIndex][2] ? dx : -dx; - y = 0; - this.zr.animate(this.shapeList[i].id, '') - .when( - 500, - {position : [x, y]} - ) - .start(); - } - } - } - } - }; - - zrUtil.inherits(K, ChartBase); - zrUtil.inherits(K, ComponentBase); - - // 图表注册 - require('../chart').define('k', K); - - return K; -}); -/** - * echarts坐标处理方法 - * - * @author Neil (杨骥, yangji01@baidu.com) - */ - -define( - 'echarts/util/coordinates',['require','zrender/tool/math'],function (require) { - var zrMath = require('zrender/tool/math'); - - /** - * 极坐标转直角坐标 - * - * @param {number} 半径 - * @param {number} 角度 - * - * @return {Array.} 直角坐标[x,y] - */ - function polar2cartesian(r, theta) { - return [r * zrMath.sin(theta), r*zrMath.cos(theta)]; - } - - /** - * 直角坐标转极坐标 - * - * @param {number} 横坐标 - * @param {number} 纵坐标 - * - * @return {Array.} 极坐标[r,theta] - */ - function cartesian2polar(x, y) { - return [Math.sqrt(x * x + y * y), Math.atan(y / x)]; - } - - return { - polar2cartesian : polar2cartesian, - cartesian2polar : cartesian2polar - }; - } -); -/** - * echarts组件类:极坐标 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Neil (杨骥, yangji01@baidu.com) - * - */ -define('echarts/component/polar',['require','./base','zrender/shape/Text','zrender/shape/Line','zrender/shape/Polygon','zrender/shape/Circle','zrender/shape/Ring','../config','zrender/tool/util','../util/coordinates','../component'],function (require) { - var Base = require('./base'); - - // 图形依赖 - var TextShape = require('zrender/shape/Text'); - var LineShape = require('zrender/shape/Line'); - var PolygonShape = require('zrender/shape/Polygon'); - var Circle = require('zrender/shape/Circle'); - var Ring = require('zrender/shape/Ring'); - - var ecConfig = require('../config'); - var zrUtil = require('zrender/tool/util'); - var ecCoordinates = require('../util/coordinates'); - - function Polar(ecTheme, messageCenter, zr, option, myChart) { - Base.call(this, ecTheme, messageCenter, zr, option, myChart); - - this.refresh(option); - } - - Polar.prototype = { - type : ecConfig.COMPONENT_TYPE_POLAR, - - /** - * 绘制图形 - */ - _buildShape : function () { - for (var i = 0; i < this.polar.length; i ++) { - this._index = i; - this.reformOption(this.polar[i]); - - this._queryTarget = [this.polar[i], this.option]; - this._createVector(i); - this._buildSpiderWeb(i); - - this._buildText(i); - - this._adjustIndicatorValue(i); - this._addAxisLabel(i); - } - - for (var i = 0; i < this.shapeList.length; i ++) { - this.zr.addShape(this.shapeList[i]); - } - }, - - /** - * 生成蜘蛛网顶点坐标 - * @param {number} polar的index - */ - _createVector : function (index) { - var item = this.polar[index]; - var indicator = this.deepQuery(this._queryTarget, 'indicator'); - var length = indicator.length; - var startAngle = item.startAngle ; - var dStep = 2 * Math.PI / length; - var radius = this._getRadius(); - var __ecIndicator = item.__ecIndicator = []; - var vector; - - for (var i = 0 ;i < length ; i ++) { - vector = ecCoordinates.polar2cartesian( - radius, startAngle * Math.PI / 180 + dStep * i - ); - __ecIndicator.push({ - // 将图形翻转 - vector : [vector[1], -vector[0]] - }); - } - }, - - /** - * 获取外圈的半径 - * - * @return {number} - */ - _getRadius : function () { - var item = this.polar[this._index]; - return this.parsePercent( - item.radius, - Math.min(this.zr.getWidth(), this.zr.getHeight()) / 2 - ); - }, - - /** - * 构建蜘蛛网 - * @param {number} polar的index - */ - _buildSpiderWeb : function (index) { - var item = this.polar[index]; - var __ecIndicator = item.__ecIndicator; - var splitArea = item.splitArea; - var splitLine = item.splitLine; - - var center = this.getCenter(index); - var splitNumber = item.splitNumber; - - var strokeColor = splitLine.lineStyle.color; - var lineWidth = splitLine.lineStyle.width; - var show = splitLine.show; - - var axisLine = this.deepQuery(this._queryTarget, 'axisLine'); - - this._addArea( - __ecIndicator, splitNumber, center, - splitArea, strokeColor, lineWidth, show - ); - - axisLine.show && this._addLine( - __ecIndicator, center, axisLine - ); - }, - - /** - * 绘制axisLabel - */ - _addAxisLabel : function (index) { - var item = this.polar[index]; - var indicator = this.deepQuery(this._queryTarget, 'indicator'); - var __ecIndicator = item.__ecIndicator; - var axisLabel; - var vector; - var style; - var newStyle; - var splitNumber = this.deepQuery(this._queryTarget, 'splitNumber'); - var center = this.getCenter(index); - var vector; - var value; - var text; - var theta; - // var startAngle = this.deepQuery(this._queryTarget, 'startAngle'); - var offset; - var precision = this.deepQuery(this._queryTarget, 'precision'); - var interval; - - for (var i = 0; i < indicator.length; i ++) { - axisLabel = this.deepQuery( - [indicator[i], item, this.option], 'axisLabel' - ); - - if (axisLabel.show) { - style = {}; - style.textFont = this.getFont(); - //Todo: bug fix - style = zrUtil.merge(style, axisLabel); - style.lineWidth = style.width; - - vector = __ecIndicator[i].vector; - value = __ecIndicator[i].value; - theta = i / indicator.length * 2 * Math.PI; - offset = axisLabel.offset || 10; - interval = axisLabel.interval || 0; - - for (var j = 1 ; j <= splitNumber; j += interval + 1) { - newStyle = zrUtil.merge({}, style); - text = - j * (value.max - value.min) / splitNumber - + value.min; - if (precision) { - text = text.toFixed(precision); - } - newStyle.text = this.numAddCommas(text); - newStyle.x = j * vector[0] / splitNumber - + Math.cos(theta) * offset + center[0]; - newStyle.y = j * vector[1] / splitNumber - + Math.sin(theta) * offset + center[1]; - - this.shapeList.push(new TextShape({ - zlevel : this._zlevelBase, - style : newStyle, - draggable : false, - hoverable : false - })); - } - } - } - }, - - /** - * 绘制坐标头的文字 - * @param {number} polar的index - */ - _buildText : function (index) { - var item = this.polar[index]; - var __ecIndicator = item.__ecIndicator; - var vector; - var indicator = this.deepQuery(this._queryTarget, 'indicator'); - var center = this.getCenter(index); - var style; - var textAlign; - var name; - var rotation; - var x = 0; - var y = 0; - var margin; - var textStyle; - - for (var i = 0; i < indicator.length; i ++) { - name = this.deepQuery( - [indicator[i], item, this.option], 'name' - ); - - if (!name.show) { - continue; - } - textStyle = this.deepQuery( - [name, item, this.option], - 'textStyle' - ); - - style = {}; - - style.textFont = this.getFont(textStyle); - style.color = textStyle.color; - - if (typeof name.formatter == 'function') { - style.text = name.formatter.call(this.myChart, indicator[i].text, i); - } - else if (typeof name.formatter == 'string'){ - style.text = name.formatter.replace( - '{value}', indicator[i].text - ); - } - else { - style.text = indicator[i].text; - } - __ecIndicator[i].text = style.text; - - vector = __ecIndicator[i].vector; - - if (Math.round(vector[0]) > 0) { - textAlign = 'left'; - } - else if (Math.round(vector[0]) < 0) { - textAlign = 'right'; - } - else { - textAlign = 'center'; - } - - if (!name.margin) { - vector = this._mapVector(vector, center, 1.2); - } - else { - margin = name.margin; - x = vector[0] > 0 ? margin : - margin; - y = vector[1] > 0 ? margin : - margin; - - x = vector[0] === 0 ? 0 : x; - y = vector[1] === 0 ? 0 : y; - vector = this._mapVector(vector, center, 1); - } - - - style.textAlign = textAlign; - style.x = vector[0] + x; - style.y = vector[1] + y; - - if (name.rotate) { - rotation = [ - name.rotate / 180 * Math.PI, - vector[0], vector[1] - ]; - } - else { - rotation = [0, 0, 0]; - } - - this.shapeList.push(new TextShape({ - zlevel : this._zlevelBase, - style : style, - draggable : false, - hoverable : false, - rotation : rotation - })); - } - }, - - getIndicatorText : function(polarIndex, indicatorIndex) { - return this.polar[polarIndex] - && this.polar[polarIndex].__ecIndicator[indicatorIndex] - && this.polar[polarIndex].__ecIndicator[indicatorIndex].text; - }, - - /** - * 添加一个隐形的盒子 当做drop的容器 暴露给外部的图形类使用 - * @param {number} polar的index - * @return {Object} 添加的盒子图形 - */ - getDropBox : function (index) { - var index = index || 0; - var item = this.polar[index]; - var center = this.getCenter(index); - var __ecIndicator = item.__ecIndicator; - var len = __ecIndicator.length; - var pointList = []; - var vector; - var shape; - var type = item.type; - - if (type == 'polygon') { - for (var i = 0; i < len; i ++) { - vector = __ecIndicator[i].vector; - pointList.push(this._mapVector(vector, center, 1.2)); - } - shape = this._getShape( - pointList, 'fill', 'rgba(0,0,0,0)', '', 1 - ); - } else if (type == 'circle') { - shape = this._getCircle( - '', 1, 1.2, center, 'fill', 'rgba(0,0,0,0)' - ); - } - - return shape; - }, - - /** - * 绘制蜘蛛网的正n变形 - * - * @param {Array} 指标数组 - * @param {number} 分割线数量 - * @param {Array} 中点坐标 - * @param {Object} 分割区域对象 - * @param {string} 线条颜色 - * @param {number} 线条宽度 - */ - _addArea : function ( - __ecIndicator, splitNumber, center, - splitArea, strokeColor, lineWidth, show - ) { - var shape; - var scale; - var scale1; - var pointList; - var type = this.deepQuery(this._queryTarget, 'type'); - - for (var i = 0; i < splitNumber ; i ++ ) { - scale = (splitNumber - i) / splitNumber; - - if (show) { - if (type == 'polygon') { - pointList = this._getPointList( - __ecIndicator, scale, center); - shape = this._getShape( - pointList, 'stroke', '', strokeColor, lineWidth - ); - } else if (type == 'circle') { - shape = this._getCircle( - strokeColor, lineWidth, scale, center, 'stroke' - ); - } - - this.shapeList.push(shape); - } - - if (splitArea.show) { - scale1 = (splitNumber - i - 1) / splitNumber; - this._addSplitArea( - __ecIndicator, splitArea, scale, scale1, center, i - ); - } - } - }, - - /** - * 绘制圆 - * - * @param {string} strokeColor - * @param {number} lineWidth - * @param {number} scale - * @param {Array.} center - * @param {string} brushType - * @param {string} color - * @return {Circle} - */ - _getCircle : function ( - strokeColor, lineWidth, scale, center, brushType, color - ) { - var radius = this._getRadius(); - return new Circle({ - zlevel : this._zlevelBase, - style: { - x: center[0], - y: center[1], - r: radius * scale, - brushType: brushType, - strokeColor: strokeColor, - lineWidth: lineWidth, - color: color - }, - hoverable : false, - draggable : false - }); - }, - - /** - * 绘制圆环 - * - * @param {string} color 间隔颜色 - * @param {number} scale0 小圆的scale - * @param {number} scale1 大圆的scale - * @param {Array.} center 圆点 - * @return {Ring} - */ - _getRing : function (color, scale0, scale1, center) { - var radius = this._getRadius(); - return new Ring({ - zlevel : this._zlevelBase, - style : { - x : center[0], - y : center[1], - r : scale0 * radius, - r0 : scale1 * radius, - color : color, - brushType : 'fill' - }, - hoverable : false, - draggable : false - }); - }, - - /** - * 获取需要绘制的多边形的点集 - * @param {Object} serie的指标参数 - * @param {number} 缩小的系数 - * @param {Array} 中点坐标 - * - * @return {Array>} 返回绘制的点集 - */ - _getPointList : function (__ecIndicator, scale, center) { - var pointList = []; - var len = __ecIndicator.length; - var vector; - - for (var i = 0 ; i < len ; i ++ ) { - vector = __ecIndicator[i].vector; - - pointList.push(this._mapVector(vector, center, scale)); - } - return pointList; - }, - - /** - * 获取绘制的图形 - * @param {Array>} 绘制的点集 - * @param {string} 绘制方式 stroke | fill | both 描边 | 填充 | 描边 + 填充 - * @param {string} 颜色 - * @param {string} 描边颜色 - * @param {number} 线条宽度 - * @return {Object} 绘制的图形对象 - */ - _getShape : function ( - pointList, brushType, color, strokeColor, lineWidth - ) { - return new PolygonShape({ - zlevel : this._zlevelBase, - style : { - pointList : pointList, - brushType : brushType, - color : color, - strokeColor : strokeColor, - lineWidth : lineWidth - }, - hoverable : false, - draggable : false - }); - }, - - /** - * 绘制填充区域 - */ - _addSplitArea : function ( - __ecIndicator, splitArea, scale, scale1, center, colorInd - ) { - var indLen = __ecIndicator.length; - var color; - var colorArr = splitArea.areaStyle.color; - var colorLen; - - var vector; - var vector1; - var pointList = []; - var indLen = __ecIndicator.length; - var shape; - - var type = this.deepQuery(this._queryTarget, 'type'); - - if (typeof colorArr == 'string') { - colorArr = [colorArr]; - } - colorLen = colorArr.length; - color = colorArr[ colorInd % colorLen]; - - if (type == 'polygon') { - for (var i = 0; i < indLen ; i ++) { - pointList = []; - vector = __ecIndicator[i].vector; - vector1 = __ecIndicator[(i + 1) % indLen].vector; - - pointList.push(this._mapVector(vector, center, scale)); - pointList.push(this._mapVector(vector, center, scale1)); - pointList.push(this._mapVector(vector1, center, scale1)); - pointList.push(this._mapVector(vector1, center, scale)); - - shape = this._getShape( - pointList, 'fill', color, '', 1 - ); - this.shapeList.push(shape); - } - } else if (type == 'circle') { - shape = this._getRing(color, scale, scale1, center); - this.shapeList.push(shape); - } - }, - - /** - * 转换坐标 - * - * @param {Array} 原始坐标 - * @param {Array} 中点坐标 - * @param {number} 缩小的倍数 - * - * @return {Array} 转换后的坐标 - */ - _mapVector : function (vector, center, scale) { - return [ - vector[0] * scale + center[0], - vector[1] * scale + center[1] - ]; - }, - - /** - * 获取中心点位置 暴露给外部图形类使用 - * @param {number} polar的index - */ - getCenter : function (index) { - var index = index || 0; - return this.parseCenter(this.zr, this.polar[index].center); - }, - - /** - * 绘制从中点出发的线 - * - * @param {Array} 指标对象 - * @param {Array} 中点坐标 - * @param {string} 线条颜色 - * @param {number} 线条宽度 - * @param {string} 线条绘制类型 - * solid | dotted | dashed 实线 | 点线 | 虚线 - */ - _addLine : function ( - __ecIndicator, center, axisLine - ) { - var indLen = __ecIndicator.length; - var line; - var vector; - var lineStyle = axisLine.lineStyle; - var strokeColor = lineStyle.color; - var lineWidth = lineStyle.width; - var lineType = lineStyle.type; - - for (var i = 0; i < indLen ; i ++ ) { - vector = __ecIndicator[i].vector; - line = this._getLine( - center[0], center[1], - vector[0] + center[0], - vector[1] + center[1], - strokeColor, lineWidth, lineType - ); - this.shapeList.push(line); - } - }, - - /** - * 获取线条对象 - * @param {number} 出发点横坐标 - * @param {number} 出发点纵坐标 - * @param {number} 终点横坐标 - * @param {number} 终点纵坐标 - * @param {string} 线条颜色 - * @param {number} 线条宽度 - * @param {string} 线条类型 - * - * @return {Object} 线条对象 - */ - _getLine : function ( - xStart, yStart, xEnd, yEnd, strokeColor, lineWidth, lineType - ) { - return new LineShape({ - zlevel : this._zlevelBase, - style : { - xStart : xStart, - yStart : yStart, - xEnd : xEnd, - yEnd : yEnd, - strokeColor : strokeColor, - lineWidth : lineWidth, - lineType : lineType - }, - hoverable : false - }); - }, - - /** - * 调整指标的值,当indicator中存在max时设置为固定值 - * @param {number} polar的index - */ - _adjustIndicatorValue : function (index) { - var item = this.polar[index]; - var indicator = this.deepQuery(this._queryTarget, 'indicator'); - var len = indicator.length; - var __ecIndicator = item.__ecIndicator; - var value; - var max; - var min; - var data = this._getSeriesData(index); - var splitNumber = item.splitNumber; - - var boundaryGap = this.deepQuery(this._queryTarget, 'boundaryGap'); - var precision = this.deepQuery(this._queryTarget, 'precision'); - var power = this.deepQuery(this._queryTarget, 'power'); - var scale = this.deepQuery(this._queryTarget, 'scale'); - - for (var i = 0; i < len ; i ++ ) { - if (typeof indicator[i].max == 'number') { - max = indicator[i].max; - min = indicator[i].min || 0; - value = { - max : max, - min : min - }; - } - else { - value = this._findValue( - data, i, splitNumber, - boundaryGap, precision, power, scale - ); - } - - __ecIndicator[i].value = value; - } - }, - - /** - * 将series中的数据拿出来,如果没有polarIndex属性,默认为零 - * @param {number} polar 的index - * @param {Array} 需要处理的数据 - */ - _getSeriesData : function (index) { - var data = []; - var serie; - var serieData; - var legend = this.component.legend; - var polarIndex; - - for (var i = 0; i < this.series.length; i ++) { - serie = this.series[i]; - if (serie.type != ecConfig.CHART_TYPE_RADAR) { - continue; - } - serieData = serie.data || []; - for (var j = 0; j < serieData.length; j ++) { - polarIndex = this.deepQuery( - [serieData[j], serie, this.option], 'polarIndex' - ) || 0; - if (polarIndex == index - && (!legend || legend.isSelected(serieData[j].name)) - ) { - data.push(serieData[j]); - } - } - } - return data; - }, - - /** - * 查找指标合适的值 - * - * 如果只有一组数据以数据中的最大值作为最大值 0为最小值 - * 如果是多组,使用同一维度的进行比较 选出最大值最小值 - * 对它们进行处理 - * @param {Object} serie 的 data - * @param {number} 指标的序号 - * @param {boolean} boundaryGap 两端留白 - * @param {number} precision 小数精度 - * @param {number} power 整数精度 - * @return {Object} 指标的最大值最小值 - */ - _findValue : function ( - data, index, splitNumber, boundaryGap, precision, power, scale - ) { - var max; - var min; - var value; - var delta; - var str; - var len = 0; - var max0; - var min0; - var one; - - if (!data || data.length === 0) { - return; - } - - function _compare(item) { - (item > max || max === undefined) && (max = item); - (item < min || min === undefined) && (min = item); - } - - if (data.length == 1) { - min = 0; - } - if (data.length != 1) { - for (var i = 0; i < data.length; i ++) { - value = typeof data[i].value[index].value != 'undefined' - ? data[i].value[index].value : data[i].value[index]; - _compare(value); - } - } - else { - one = data[0]; - for (var i = 0; i < one.value.length; i ++) { - _compare( - typeof one.value[i].value != 'undefined' - ? one.value[i].value : one.value[i] - ); - } - } - - if (data.length != 1) { - if (scale) { - delta = this._getDelta( - max, min, splitNumber, precision, power - ); - - if (delta >= 1) { - min = Math.floor(min / delta) * delta - delta; - } - else if (delta === 0) { - if (max > 0) { - min0 = 0; - max0 = 2 * max; - } - else if (max === 0) { - min0 = 0; - max0 = 100; - } - else { - max0 = 0; - min0 = 2 * min; - } - - return { - max : max0, - min : min0 - }; - } - else { - str = (delta + '').split('.')[1]; - len = str.length; - min = Math.floor( - min * Math.pow(10, len)) / Math.pow(10, len - ) - delta; - } - - if (Math.abs(min) <= delta) { - min = 0; - } - - max = min + Math.floor(delta * Math.pow(10, len) - * (splitNumber + 1)) / Math.pow(10, len) ; - } - else { - min = min > 0 ? 0 : min; - } - } - - if (boundaryGap) { - max = max > 0 ? max * 1.2 : max * 0.8; - min = min > 0 ? min * 0.8 : min * 1.2; - } - - return { - max : max, - min : min - }; - }, - - /** - * 获取最大值与最小值中间比较合适的差值 - * @param {number} max; - * @param {number} min - * @param {number} precision 小数精度 - * @param {number} power 整数精度 - * @return {number} delta - */ - _getDelta : function (max , min, splitNumber, precision, power) { - var delta = (max - min) / splitNumber; - var str; - var n; - - if (delta > 1) { - if (!power) { - str = (delta + '').split('.')[0]; - n = str.length; - if (str.charAt(0) >= 5) { - return Math.pow(10, n); - } - else { - return (str.charAt(0) - 0 + 1 ) * Math.pow(10, n - 1); - } - } - else { - delta = Math.ceil(delta); - if (delta % power > 0) { - return (Math.ceil(delta / power) + 1) * power; - } - else { - return delta; - } - } - } - else if (delta == 1) { - return 1; - } - else if (delta === 0) { - return 0; - } - else { - if (!precision) { - str = (delta + '').split('.')[1]; - n = 0; - while (str[n] == '0') { - n ++ ; - } - - if (str[n] >= 5) { - return '0.' + str.substring(0, n + 1) - 0 - + 1 / Math.pow(10, n); - } - else { - return '0.' + str.substring(0, n + 1) - 0 - + 1 / Math.pow(10, n + 1); - } - } - else { - return Math.ceil(delta * Math.pow(10, precision)) - / Math.pow(10, precision); - } - } - }, - - /** - * 获取每个指标上某个value对应的坐标 - * @param {number} polarIndex - * @param {number} indicatorIndex - * @param {number} value - * @return {Array} 对应坐标 - */ - getVector : function (polarIndex, indicatorIndex, value) { - polarIndex = polarIndex || 0; - indicatorIndex = indicatorIndex || 0; - var __ecIndicator = this.polar[polarIndex].__ecIndicator; - - if (indicatorIndex >= __ecIndicator.length) { - return ; - } - - var indicator = this.polar[polarIndex].__ecIndicator[indicatorIndex]; - var center = this.getCenter(polarIndex); - var vector = indicator.vector; - var max = indicator.value.max; - var min = indicator.value.min; - var alpha; - - if (typeof value == 'undefined') { - return center; - } - - switch (value) { - case 'min' : - value = min; - break; - case 'max' : - value = max; - break; - case 'center' : - value = (max + min) / 2; - break; - } - - if (max != min) { - alpha = (value - min) / (max - min); - } - else { - alpha = 0.5; - } - - return this._mapVector(vector, center, alpha); - }, - - /** - * 判断一个点是否在网内 - * @param {Array} 坐标 - * @return {number} 返回polarindex 返回-1表示不在任何polar - */ - isInside : function (vector) { - var polar = this.getNearestIndex(vector); - - if (polar) { - return polar.polarIndex; - } - return -1; - }, - - /** - * 如果一个点在网内,返回离它最近的数据轴的index - * @param {Array} 坐标 - * @return {Object} | false - * polarIndex - * valueIndex - */ - getNearestIndex : function (vector) { - var item; - var center; - var radius; - var polarVector; - var startAngle; - var indicator; - var len; - var angle; - var finalAngle; - for (var i = 0 ; i < this.polar.length; i ++) { - item = this.polar[i]; - center = this.getCenter(i); - if (vector[0] == center[0] && vector[1] == center[1]) { - return { - polarIndex : i, - valueIndex : 0 - }; - } - radius = this._getRadius(); - startAngle = item.startAngle; - indicator = item.indicator; - len = indicator.length; - angle = 2 * Math.PI / len; - // 注意y轴的翻转 - polarVector = ecCoordinates.cartesian2polar( - vector[0] - center[0], center[1] - vector[1] - ); - if (vector[0] - center[0] < 0) { - polarVector[1] += Math.PI; - } - if (polarVector[1] < 0) { - polarVector[1] += 2 * Math.PI; - } - - - // 减去startAngle的偏移量 再加2PI变成正数 - finalAngle = polarVector[1] - - startAngle / 180 * Math.PI + Math.PI * 2; - - if (Math.abs(Math.cos(finalAngle % (angle / 2))) * radius - > polarVector[0]) - { - return { - polarIndex : i, - valueIndex : Math.floor( - (finalAngle + angle / 2 ) / angle - ) % len - }; - } - } - }, - - /** - * 获取指标信息 - * @param {number} polarIndex - * @return {Array} indicator - */ - getIndicator : function (index) { - var index = index || 0; - return this.polar[index].indicator; - }, - - /** - * 刷新 - */ - refresh : function (newOption) { - if (newOption) { - this.option = newOption; - this.polar = this.option.polar; - this.series = this.option.series; - } - this.clear(); - this._buildShape(); - } - }; - - zrUtil.inherits(Polar, Base); - - require('../component').define('polar', Polar); - - return Polar; -}); -/** - * echarts图表类:雷达图 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Neil (杨骥, yangji01@baidu.com) - * - */ - - define('echarts/chart/radar',['require','../component/base','./base','zrender/shape/Polygon','../component/polar','../config','../util/ecData','zrender/tool/util','zrender/tool/color','../util/accMath','../chart'],function (require) { - var ComponentBase = require('../component/base'); - var ChartBase = require('./base'); - - // 图形依赖 - var PolygonShape = require('zrender/shape/Polygon'); - // 组件依赖 - require('../component/polar'); - - var ecConfig = require('../config'); - var ecData = require('../util/ecData'); - var zrUtil = require('zrender/tool/util'); - var zrColor = require('zrender/tool/color'); - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} series 数据 - * @param {Object} component 组件 - */ - function Radar(ecTheme, messageCenter, zr, option, myChart) { - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); - // 图表基类 - ChartBase.call(this); - - this.refresh(option); - } - - Radar.prototype = { - type : ecConfig.CHART_TYPE_RADAR, - /** - * 绘制图形 - */ - _buildShape : function () { - this.selectedMap = {}; - this._symbol = this.option.symbolList; - this._queryTarget; - this._dropBoxList = []; - this._radarDataCounter = 0; - - var series = this.series; - var legend = this.component.legend; - var serieName; - for (var i = 0, l = series.length; i < l ; i ++) { - if (series[i].type == ecConfig.CHART_TYPE_RADAR) { - this.serie = this.reformOption(series[i]); - serieName = this.serie.name || ''; - // 系列图例开关 - this.selectedMap[serieName] = - legend ? legend.isSelected(serieName) : true; - - if (this.selectedMap[serieName]) { - this._queryTarget = [this.serie, this.option]; - - // 添加可拖拽提示框,多系列共用一个极坐标,第一个优先 - if (this.deepQuery(this._queryTarget, 'calculable')) { - this._addDropBox(i); - } - this._buildSingleRadar(i); - this.buildMark(i); - } - } - } - - this.addShapeList(); - }, - - /** - * 构建数据图形 - * @param {number} 序列的index - */ - _buildSingleRadar : function (index) { - var legend = this.component.legend; - var iconShape; - var data = this.serie.data; - var defaultColor; - var name; - var pointList; - var calculable = this.deepQuery(this._queryTarget, 'calculable'); - - for (var i = 0; i < data.length; i ++) { - name = data[i].name || ''; - - // 图例开关 - this.selectedMap[name] = legend - ? legend.isSelected(name) - : true; - if (!this.selectedMap[name]) { - continue; - } - - // 默认颜色策略 - if (legend) { - // 有图例则从图例中获取颜色定义 - defaultColor = legend.getColor(name); - iconShape = legend.getItemShape(name); - if (iconShape) { - // 回调legend,换一个更形象的icon - iconShape.style.brushType = this.deepQuery( - [data[i], this.serie], 'itemStyle.normal.areaStyle' - ) ? 'both' : 'stroke'; - legend.setItemShape(name, iconShape); - } - } - else { - // 全局颜色定义 - defaultColor = this.zr.getColor(i); - } - - pointList = this._getPointList(this.serie.polarIndex, data[i]); - // 添加拐点形状 - this._addSymbol(pointList, defaultColor, i, index, this.serie.polarIndex); - // 添加数据形状 - this._addDataShape( - pointList, defaultColor, data[i], - index, i, calculable - ); - this._radarDataCounter++; - } - }, - - /** - * 获取数据的点集 - * @param {number} polarIndex - * @param {Array} 处理的数据 - * @return {Array>} 点集 - */ - _getPointList : function (polarIndex, dataArr) { - var pointList = []; - var vector; - var polar = this.component.polar; - - for (var i = 0, l = dataArr.value.length; i < l; i++) { - vector = polar.getVector( - polarIndex, - i, - typeof dataArr.value[i].value != 'undefined' - ? dataArr.value[i].value : dataArr.value[i] - ); - if (vector) { - pointList.push(vector); - } - } - return pointList; - }, - - /** - * 添加拐点 - * @param {Array>} pointList 点集 - * @param {string} defaultColor 默认填充颜色 - * @param {object} data 数据 - * @param {number} serieIndex - */ - _addSymbol : function (pointList, defaultColor, dataIndex, seriesIndex, polarIndex) { - var series = this.series; - var itemShape; - var polar = this.component.polar; - - for (var i = 0, l = pointList.length; i < l; i++) { - itemShape = this.getSymbolShape( - this.deepMerge( - [series[seriesIndex].data[dataIndex], series[seriesIndex]] - ), - seriesIndex, - series[seriesIndex].data[dataIndex].value[i], i, - polar.getIndicatorText(polarIndex, i), - pointList[i][0], // x - pointList[i][1], // y - this._symbol[this._radarDataCounter % this._symbol.length], - defaultColor, - '#fff', - 'vertical' - ); - itemShape.zlevel = this._zlevelBase + 1; - ecData.set(itemShape, 'data', series[seriesIndex].data[dataIndex]); - ecData.set(itemShape, 'value', series[seriesIndex].data[dataIndex].value); - ecData.set(itemShape, 'dataIndex', dataIndex); - ecData.set(itemShape, 'special', i); - this.shapeList.push(itemShape); - } - }, - - /** - * 添加数据图形 - * @param {Array>} pointList 点集 - * @param {string} defaultColor 默认填充颜色 - * @param {object} data 数据 - * @param {number} serieIndex - * @param {number} dataIndex - * @param {boolean} calcalable - */ - _addDataShape : function ( - pointList, defaultColor, data, - seriesIndex, dataIndex, calculable - ) { - var series = this.series; - // 多级控制 - var queryTarget = [data, this.serie]; - var nColor = this.getItemStyleColor( - this.deepQuery( - queryTarget, 'itemStyle.normal.color' - ), - seriesIndex, - dataIndex, - data - ); - var nLineWidth = this.deepQuery( - queryTarget, 'itemStyle.normal.lineStyle.width' - ); - var nLineType = this.deepQuery( - queryTarget, 'itemStyle.normal.lineStyle.type' - ); - var nAreaColor = this.deepQuery( - queryTarget, 'itemStyle.normal.areaStyle.color' - ); - var nIsAreaFill = this.deepQuery( - queryTarget, 'itemStyle.normal.areaStyle' - ); - var shape = { - zlevel : this._zlevelBase, - style : { - pointList : pointList, - brushType : nIsAreaFill ? 'both' : 'stroke', - color : nAreaColor - || nColor - || zrColor.alpha(defaultColor,0.5), - strokeColor : nColor || defaultColor, - lineWidth : nLineWidth, - lineType : nLineType - }, - highlightStyle : { - brushType : this.deepQuery( - queryTarget, - 'itemStyle.emphasis.areaStyle' - ) || nIsAreaFill - ? 'both' : 'stroke', - color : this.deepQuery( - queryTarget, - 'itemStyle.emphasis.areaStyle.color' - ) - || nAreaColor - || nColor - || zrColor.alpha(defaultColor,0.5), - strokeColor : this.getItemStyleColor( - this.deepQuery( - queryTarget, 'itemStyle.emphasis.color' - ), - seriesIndex, - dataIndex, - data - ) - || nColor || defaultColor, - lineWidth : this.deepQuery( - queryTarget, - 'itemStyle.emphasis.lineStyle.width' - ) || nLineWidth, - lineType : this.deepQuery( - queryTarget, - 'itemStyle.emphasis.lineStyle.type' - ) || nLineType - } - }; - ecData.pack( - shape, - series[seriesIndex], // 系列 - seriesIndex, // 系列索引 - data, // 数据 - dataIndex, // 数据索引 - data.name, // 数据名称 - // 附加指标信息 - this.component.polar.getIndicator(series[seriesIndex].polarIndex) - ); - if (calculable) { - shape.draggable = true; - this.setCalculable(shape); - } - - shape = new PolygonShape(shape); - this.shapeList.push(shape); - }, - - /** - * 增加外围接受框 - * @param {number} serie的序列 - */ - _addDropBox : function (index) { - var series = this.series; - var polarIndex = this.deepQuery( - this._queryTarget, 'polarIndex' - ); - if (!this._dropBoxList[polarIndex]) { - var shape = this.component.polar.getDropBox(polarIndex); - shape.zlevel = this._zlevelBase; - this.setCalculable(shape); - ecData.pack(shape, series, index, undefined, -1); - this.shapeList.push(shape); - this._dropBoxList[polarIndex] = true; - } - }, - - /** - * 数据项被拖拽出去,重载基类方法 - */ - ondragend : function (param, status) { - var series = this.series; - if (!this.isDragend || !param.target) { - // 没有在当前实例上发生拖拽行为则直接返回 - return; - } - - var target = param.target; // 被拖拽图形元素 - - var seriesIndex = ecData.get(target, 'seriesIndex'); - var dataIndex = ecData.get(target, 'dataIndex'); - - // 被拖拽的图形是饼图sector,删除被拖拽走的数据 - this.component.legend && this.component.legend.del( - series[seriesIndex].data[dataIndex].name - ); - - series[seriesIndex].data.splice(dataIndex, 1); - - // 别status = {}赋值啊!! - status.dragOut = true; - status.needRefresh = true; - - // 处理完拖拽事件后复位 - this.isDragend = false; - - return; - }, - - /** - * 数据项被拖拽进来, 重载基类方法 - */ - ondrop : function (param, status) { - var series = this.series; - if (!this.isDrop || !param.target) { - // 没有在当前实例上发生拖拽行为则直接返回 - return; - } - - var target = param.target; // 拖拽安放目标 - var dragged = param.dragged; // 当前被拖拽的图形对象 - - var seriesIndex = ecData.get(target, 'seriesIndex'); - var dataIndex = ecData.get(target, 'dataIndex'); - - var data; - var legend = this.component.legend; - var value; - - if (dataIndex == -1) { - data = { - value : ecData.get(dragged, 'value'), - name : ecData.get(dragged, 'name') - }; - - series[seriesIndex].data.push(data); - - legend && legend.add( - data.name, - dragged.style.color || dragged.style.strokeColor - ); - } - else { - // 数据被拖拽到某个数据项上,数据修改 - var accMath = require('../util/accMath'); - data = series[seriesIndex].data[dataIndex]; - legend && legend.del(data.name); - data.name += this.option.nameConnector - + ecData.get(dragged, 'name'); - value = ecData.get(dragged, 'value'); - for (var i = 0 ; i < value.length; i ++) { - data.value[i] = accMath.accAdd(data.value[i], value[i]); - } - - legend && legend.add( - data.name, - dragged.style.color || dragged.style.strokeColor - ); - } - - // 别status = {}赋值啊!! - status.dragIn = status.dragIn || true; - - // 处理完拖拽事件后复位 - this.isDrop = false; - - return; - }, - - /** - * 刷新 - */ - refresh : function (newOption) { - if (newOption) { - this.option = newOption; - this.series = newOption.series; - } - - this.backupShapeList(); - this._buildShape(); - } - }; - - zrUtil.inherits(Radar, ChartBase); - zrUtil.inherits(Radar, ComponentBase); - - // 图表注册 - require('../chart').define('radar', Radar); - - return Radar; -}); -/** - * zrender - * - * @author pissang (https://github.com/pissang) - * - * shape类:chord - * 可配图形属性: - { - // 基础属性 - shape : 'chord', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - center : {array}, - source0 : {number}, - source1 : {number}, - target0 : {number}, - target1 : {number}, - r : {number}, - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - */ -define('echarts/util/shape/Chord',['require','zrender/shape/Base','zrender/tool/util'],function (require) { - var Base = require('zrender/shape/Base'); - var zrUtil = require('zrender/tool/util'); - var _ctx = zrUtil.getContext(); - - function ChordShape(options) { - Base.call(this, options); - } - - ChordShape.prototype = { - type : 'chord', - - // center, source0, source1, target0, target1, r - buildPath : function (ctx, style) { - var PI2 = Math.PI * 2; - var cx = style.center[0]; - var cy = style.center[1]; - var r = style.r; - var s0 = style.source0 / 180 * Math.PI; - var s1 = style.source1 / 180 * Math.PI; - var t0 = style.target0 / 180 * Math.PI; - var t1 = style.target1 / 180 * Math.PI; - var sx0 = cx + Math.cos(PI2 - s0) * r; - var sy0 = cy - Math.sin(PI2 - s0) * r; - var sx1 = cx + Math.cos(PI2 - s1) * r; - var sy1 = cy - Math.sin(PI2 - s1) * r; - var tx0 = cx + Math.cos(PI2 - t0) * r; - var ty0 = cy - Math.sin(PI2 - t0) * r; - var tx1 = cx + Math.cos(PI2 - t1) * r; - var ty1 = cy - Math.sin(PI2 - t1) * r; - - ctx.moveTo(sx0, sy0); - ctx.arc(cx, cy, style.r, s0, s1, false); - ctx.bezierCurveTo( - (cx - sx1) * 0.70 + sx1, - (cy - sy1) * 0.70 + sy1, - (cx - tx0) * 0.70 + tx0, - (cy - ty0) * 0.70 + ty0, - tx0, ty0 - ); - // Chord to self - if (style.source0 === style.target0 && - style.source1 === style.target1) { - return; - } - ctx.arc(cx, cy, style.r, t0, t1, false); - ctx.bezierCurveTo( - (cx - tx1) * 0.70 + tx1, - (cy - ty1) * 0.70 + ty1, - (cx - sx0) * 0.70 + sx0, - (cy - sy0) * 0.70 + sy0, - sx0, sy0 - ); - }, - - getRect : function (){ - return { - x : 0, - y : 0, - width : 0, - height : 0 - }; - }, - - isCover : function (x, y) { - if (!_ctx.isPointInPath) { // In ie - return false; - } - var originPos = this.getTansform(x, y); - x = originPos[0]; - y = originPos[1]; - - _ctx.beginPath(); - ChordShape.prototype.buildPath.call(null, _ctx, this.style); - _ctx.closePath(); - - return _ctx.isPointInPath(x, y); - } - }; - - zrUtil.inherits(ChordShape, Base); - - return ChordShape; -}); -define('echarts/util/kwargs',[],function (){ - function kwargs(func, defaults) { - /*jshint maxlen : 200*/ - var removeComments = new RegExp('(\\/\\*[\\w\\\'\\,\\(\\)\\s\\r\\n\\*]*\\*\\/)|(\\/\\/[\\w\\s\\\'][^\\n\\r]*$)|(\\/]*>)', 'gim'); - var removeWhitespc = new RegExp('\\s+', 'gim'); - var matchSignature = new RegExp('function.*?\\((.*?)\\)', 'i'); - // get the argument names from function source - var names = func.toString() - .replace(removeComments, '') - .replace(removeWhitespc, '') - .match(matchSignature)[1] - .split(','); - - // Check the existance of default, if not create an object - if(defaults !== Object(defaults)){ - defaults = {}; - } - - return function () { - var args = Array.prototype.slice.call(arguments); - var kwargs = args[args.length - 1]; - - // Check the existance of the kwargs - if (kwargs && kwargs.constructor === Object) { - args.pop(); - } - else{ - kwargs = {}; - } - - // Fill the arguments and apply them - for (var i = 0; i < names.length; i++) { - var name = names[i]; - if (name in kwargs) { - args[i] = kwargs[name]; - } - else if(name in defaults && args[i] == null){ - args[i] = defaults[name]; - } - } - - return func.apply(this, args); - }; - } - // As function prototype - // Function.prototype.kwargs = kwargs; - return kwargs; -}); -/** - * Numpy like n-dimensional array proccessing class - * http://docs.scipy.org/doc/numpy/reference/arrays.ndarray.html - * - * @author pissang (https://github.com/pissang/) - */ -define('echarts/util/ndarray',['require','./kwargs'],function (require) { - - - -var kwargs = require('./kwargs'); - -var ArraySlice = Array.prototype.slice; - -// Polyfill of Typed Array -this.Int32Array = window.Int32Array || Array; -this.Int16Array = window.Int16Array || Array; -this.Int8Array = window.Int8Array || Array; -this.Uint32Array = window.Uint32Array || Array; -this.Uint16Array = window.Uint16Array || Array; -this.Uint8Array = window.Uint8Array || Array; -this.Float32Array = window.Float32Array || Array; -this.Float64Array = window.Float64Array || Array; - -// Map of numpy dtype and typed array -// http://docs.scipy.org/doc/numpy/reference/arrays.dtypes.html#arrays-dtypes -// http://www.khronos.org/registry/typedarray/specs/latest/ -var ArrayConstructor = { - 'int32' : this.Int32Array, - 'int16' : this.Int16Array, - 'int8' : this.Int8Array, - 'uint32' : this.Uint32Array, - 'uint16' : this.Uint16Array, - 'uint8' : this.Uint8Array, - // 'uint8c' is not existed in numpy - 'uint8c' : this.Uint8ClampedArray, - 'float32' : this.Float32Array, - 'float64' : this.Float64Array, - 'number' : Array -}; - -var dTypeStrideMap = { - 'int32' : 4, - 'int16' : 2, - 'int8' : 1, - 'uint32' : 4, - 'uint16' : 2, - 'uint8' : 1, - 'uint8c' : 1, - 'float32' : 4, - 'float64' : 8, - // Consider array stride is 1 - 'number' : 1 -}; - -var E_ADD = 0; -var E_SUB = 1; -var E_MUL = 2; -var E_DIV = 3; -var E_MOD = 4; -var E_AND = 5; -var E_OR = 6; -var E_XOR = 7; -var E_EQL = 8; - -function guessDataType(arr) { - if (typeof(arr) === 'undefined') { - return 'number'; - } - switch(Object.prototype.toString.call(arr)) { - case '[object Int32Array]': - return 'int32'; - case '[object Int16Array]': - return 'int16'; - case '[object Int8Array]': - return 'int8'; - case '[object Uint32Array]': - return 'uint32'; - case '[object Uint16Array]': - return 'uint16'; - case '[object Uint8Array]': - return 'uint8'; - case '[object Uint8ClampedArray]': - return 'uint8c'; - case '[object Float32Array]': - return 'float32'; - case '[object Float64Array]': - return 'float64'; - default: - return 'number'; - } -} - -/** - * NDArray - * @param {Array|NDArray} array - * @param {String} dtype - */ -var NDArray = function (array) { - // Last argument describe the data type of ndarray - var dtype = arguments[arguments.length-1]; - if (typeof(dtype) == 'string') { - this._dtype = dtype; - } else { - // Normal array - this._dtype = guessDataType(array); - } - - if (array && typeof(array) !== 'string') { - if (array instanceof NDArray) { - array._dtype = this._dtype; - return array; - } else if (typeof(array.length) !== 'undefined') { - // Init from array - this.initFromArray(array); - } else if(typeof(array) === 'number') { - // Init from shape - this.initFromShape.apply(this, arguments); - } - } else { - /** - * _array - * Initialized with an empty array - * Data is continuous one-dimensional array, row-major - * A [2, 2] dim empty array is stored like - * [0,0, 0,0] - * TODO : Consider column majors ? - * @type {ArrayConstructor} - */ - this._array = new ArrayConstructor[this._dtype](); - /** - * _shape - * a tuple array describe the dimension and size of each dimension - * [10, 10] means a 10x10 array - * @type {Array} - */ - this._shape = [0]; - /** - * _size - * size of the storage array length - * @type {Number} - */ - this._size = 0; - } -}; - -NDArray.prototype = { - /** - * Initialize from a normal js array. - * - * @param {Array} input - * @return {NDArray} this - */ - initFromArray : function (input) { - var dim = getDimension(input); - var cursor = 0; - function flatten(axis, _out, _in) { - var len = _in.length; - for (var i = 0; i < len; i++) { - if (axis < dim-1) { - flatten(axis+1, _out, _in[i]); - } else { - _out[cursor++] = _in[i]; - } - } - } - var shape = getShape(input); - var size = getSize(shape); - this._array = new ArrayConstructor[this._dtype](size); - - flatten(0, this._array, input); - this._shape = shape; - this._size = size; - - return this; - }, - - /** - * Initialize from the given shape description. - * @param {Array} shape - * @return {NDArray} this - */ - initFromShape : function (shape) { - if (typeof(shape) == 'number') { - shape = Array.prototype.slice.call(arguments); - } - if(shape) { - var size = getSize(shape); - if (this._dtype === 'number') { - this._array = []; - var data = this._array; - for (var i = 0; i < size; i++) { - data[i] = 0; - } - } else { - this._array = new ArrayConstructor[this._dtype](size); - } - } - this._shape = shape; - this._size = getSize(shape); - - return this; - }, - /** - * Fill the array with the given value. - * @param {Number} value - * @return {NDArray} this - */ - fill : function (value) { - var data = this._array; - for (var i = 0; i < data.length; i++) { - data[i] = value; - } - return this; - }, - - /** - * Get ndarray shape copy. - * @return {Array} - */ - shape : function () { - // Create a copy - return this._shape.slice(); - }, - - /** - * Get array size - * @return {Number} - */ - size : function () { - return this._size; - }, - - /** - * Get array data type. - * 'int32' - * 'int16' - * 'int8' - * 'uint32' - * 'uint16' - * 'uint8' - * 'float32' - * 'float64' - * @return {String} - */ - dtype : function () { - return this._dtype; - }, - - /** - * Get array dimension. - * @return {[type]} [description] - */ - dimension : function () { - return this._shape.length; - }, - - /** - * Tuple of bytes to step in each dimension when traversing an array. - * @return {Array} - */ - strides : function () { - var strides = calculateDimStrides(this._shape); - var dTypeStride = dTypeStrideMap[this._dtype]; - for (var i = 0; i < strides.length; i++) { - strides[i] *= dTypeStride; - } - return strides; - }, - /** - * Gives a new shape to an array without changing its data. - * @param {Array} shape - * @return {NDArray} - */ - reshape : function (shape) { - if (typeof(shape) == 'number') { - shape = Array.prototype.slice.call(arguments); - } - if (this._isShapeValid(shape)) { - this._shape = shape; - } else { - throw new Error('Total size of new array must be unchanged'); - } - return this; - }, - - _isShapeValid : function (shape) { - return getSize(shape) === this._size; - }, - - /** - * Change shape and size of array in-place. - * @param {Array} shape - * @return {NDArray} - */ - resize : function (shape) { - if (typeof(shape) == 'number') { - shape = Array.prototype.slice.call(arguments); - } - - var len = getSize(shape); - if (len < this._size) { - if (this._dtype === 'number') { - this._array.length = len; - } - } else { - if (this._dtype === 'number') { - for (var i = this._array.length; i < len; i++) { - // Fill the rest with zero - this._array[i] = 0; - } - } else { - // Reallocate new buffer - var newArr = new ArrayConstructor[this._dtype](len); - var originArr = this._array; - - // Copy data - for (var i = 0; i < originArr.length; i++) { - newArr[i] = originArr[i]; - } - this._array = newArr; - } - } - this._shape = shape; - this._size = len; - - return this; - - }, - - /** - * Returns a new array with axes transposed. - * @param {Array} [axes] - * @param {NDArray} [out] - * @return {NDArray} - */ - transpose : kwargs(function (axes, out) { - var originAxes = []; - for (var i = 0; i < this._shape.length; i++) { - originAxes.push(i); - } - if (typeof(axes) === 'undefined') { - axes = originAxes.slice(); - } - // Check if any axis is out of bounds - for (var i = 0; i < axes.length; i++) { - if (axes[i] >= this._shape.length) { - throw new Error(axisOutofBoundsErrorMsg(axes[i])); - } - } - // Has no effect on 1-D transpose - if (axes.length <= 1) { - return this; - } - - var targetAxes = originAxes.slice(); - for (var i = 0; i < Math.floor(axes.length / 2); i++) { - for (var j = axes.length-1; j >= Math.ceil(axes.length / 2) ; j--) { - // Swap axes - targetAxes[axes[i]] = axes[j]; - targetAxes[axes[j]] = axes[i]; - } - } - - return this._transposelike(targetAxes, out); - - }), - - /** - * Return a new array with axis1 and axis2 interchanged. - * @param {Number} axis1 - * @param {Number} axis2 - * @param {NDArray} out - * @return {NDArray} - */ - swapaxes : kwargs(function (axis1, axis2, out) { - return this.transpose([axis1, axis2], out); - }), - - /** - * Roll the specified axis backwards, until it lies in a given position. - * @param {Number} axis - * @param {Number} [start=0] - * @param {NDArray} out - * @return {NDArray} - */ - rollaxis : kwargs(function (axis, start, out) { - if (axis >= this._shape.length) { - throw new Error(axisOutofBoundsErrorMsg(axis)); - } - - var axes = []; - for (var i = 0; i < this._shape.length; i++) { - axes.push(i); - } - axes.splice(axis, 1); - axes.splice(start, 0, axis); - - return this._transposelike(axes, out); - - }, { start : 0}), - - // Base function for transpose-like operations - _transposelike : function (axes, out) { - var source = this._array; - var shape = this._shape.slice(); - var strides = calculateDimStrides(this._shape); - var dim = shape.length; - - // Swap - var tmpStrides = []; - var tmpShape = []; - for (var i = 0; i < axes.length; i++) { - var axis = axes[i]; - // swap to target axis - tmpShape[i] = shape[axis]; - tmpStrides[i] = strides[axis]; - } - strides = tmpStrides; - shape = tmpShape; - - this._shape = shape; - var transposedStrides = calculateDimStrides(this._shape); - - if (!out) { - out = new NDArray(); - out._shape = this._shape.slice(); - out._dtype = this._dtype; - out._size = this._size; - } - // FIXME in-place transpose? - var transposedData = new ArrayConstructor[this._dtype](this._size); - out._array = transposedData; - // @param Item offset in current axis offset of the original array - // @param Item offset in current axis offset of the transposed array - function transpose(axis, offset, transposedOffset) { - var size = shape[axis]; - // strides in orginal array - var stride = strides[axis]; - // strides in transposed array - var transposedStride = transposedStrides[axis]; - - if (axis < dim-1) { - for (var i = 0; i < size; i++) { - transpose( - axis+1, - offset + stride * i, - transposedOffset + transposedStride * i - ); - } - } else { - for (var i = 0; i < size; i++) { - // offset + stride * i is the index of the original array - // transposedOffset + i is the index of the transposed array - transposedData[transposedOffset + i] - = source[offset + stride * i]; - } - } - } - - transpose(0, 0, 0); - - return out; - }, - - /** - * Repeat elements of an array along axis - * @param {Number} repeats - * The number of repetitions for each element. - * repeats is broadcasted to fit the shape of the given axis. - * @param {Number} [axis] - * The axis along which to repeat values. - * By default, use the flattened input array, - * and return a flat output array. - * @param {NDArray} [out] - * @return {NDArray} - */ - repeat : kwargs(function (repeats, axis, out) { - var shape; - // flattened input array - if (typeof(axis) === 'undefined') { - shape = [this._size]; - axis = 0; - } else { - shape = this._shape.slice(); - } - var originShape = shape.slice(); - - shape[axis] *= repeats; - if (!out) { - out = new NDArray(this._dtype); - out.initFromShape(shape); - } else { - if (!arrayEqual(shape, out._shape)) { - throw new Error(broadcastErrorMsg(shape, out._shape)); - } - } - var data = out._array; - - var stride = calculateDimStride(originShape, axis); - var axisSize = originShape[axis]; - var source = this._array; - - var offsetStride = stride * axisSize; - - for (var offset = 0; offset < this._size; offset+=offsetStride) { - for (var k = 0; k < stride; k++) { - var idx = offset + k; - var idxRepeated = offset * repeats + k; - for (var i = 0; i < axisSize; i++) { - for (var j = 0; j < repeats; j++) { - data[idxRepeated] = source[idx]; - idxRepeated += stride; - } - idx += stride; - } - } - } - - return out; - }), - - choose : function () { - console.warn('TODO'); - }, - - take : function () { - console.warn('TODO'); - }, - - tile : function () { - console.warn('TODO'); - }, - - /** - * Preprocess for array calculation - * max, min, argmax, argmin, sum, ptp, val, mean - * Which will reduce one axis if the axis is given - * - * @param {Number} axis - * @param {NDArray} out - * @param {Function} funcWithAxis - * @param {Function} funcFlatten - * @return {Number|NDArray} - */ - _withPreprocess1 : function (axis, out, funcWithAxis, funcFlatten) { - var source = this._array; - if (!this._size) { - return; - } - - if (typeof(axis)!=='undefined') { - if (axis < 0) { - axis = this._shape.length + axis; - } - if (axis >= this._shape.length || axis < 0) { - throw new Error(axisOutofBoundsErrorMsg(axis)); - } - - var shape = this._shape.slice(); - shape.splice(axis, 1); - if (out && !arrayEqual(shape, out._shape)) { - throw new Error(broadcastErrorMsg(shape, out._shape)); - } - - if (!out) { - out = new NDArray(this._dtype); - out.initFromShape(shape); - } - var data = out._array; - - var stride = calculateDimStride(this._shape, axis); - var axisSize = this._shape[axis]; - var offsetStride = stride * axisSize; - - funcWithAxis.call( - this, data, source, offsetStride, axisSize, stride - ); - - return out; - } else { - return funcFlatten.call(this, source); - } - }, - - /** - * Preprocess for array calculation cumsum, cumprod - * Which will keep the shape if axis is given - * and flatten if axis is undefined - * @param {Number} axis - * @param {NDArray} out - * @param {Function} funcWithAxis - * @param {Function} funcFlatten - * @return {NDArray} - */ - _withPreprocess2 : function (axis, out, funcWithAxis, funcFlatten) { - var source = this._array; - if (!this._size) { - return; - } - if (out && !arrayEqual(this._shape, out._shape)) { - throw new Error(broadcastErrorMsg(this._shape, out._shape)); - } - if (!out) { - out = new NDArray(this._dtype); - out.initFromShape(this._shape); - } - - var data = out._array; - - if (typeof(axis)!=='undefined') { - if (axis < 0) { - axis = this._shape.length + axis; - } - if (axis >= this._shape.length || axis < 0) { - throw new Error(axisOutofBoundsErrorMsg(axis)); - } - - if (axis >= this._shape.length) { - throw new Error(axisOutofBoundsErrorMsg(axis)); - } - - var stride = calculateDimStride(this._shape, axis); - var axisSize = this._shape[axis]; - var offsetStride = stride * axisSize; - - funcWithAxis.call( - this, data, source, offsetStride, axisSize, stride - ); - } else { - out.reshape([this._size]); - funcFlatten.call(this, data, source); - } - - return out; - }, - - /** - * Get the max value of ndarray - * If the axis is given, the max is only calculate in this dimension - * Example, for the given ndarray - * [[3, 9], - * [4, 8]] - * >>> max(0) - * [4, 9] - * >>> max(1) - * [9, 8] - * - * @param {Number} [axis] - * @param {NDArray} out - * @return {NDArray} - */ - max : kwargs((function () { - function withAxis(data, source, offsetStride, axisSize, stride) { - var cursor = 0; - for (var offset = 0; offset < this._size; offset+=offsetStride) { - for (var i = 0; i < stride; i++) { - var idx = i + offset; - var max = source[idx]; - for (var j = 0; j < axisSize; j++) { - var d = source[idx]; - if (d > max) { - max = d; - } - idx += stride; - } - data[cursor++] = max; - } - } - } - function withFlatten(source) { - var max = source[0]; - for (var i = 1; i < this._size; i++) { - if (source[i] > max) { - max = source[i]; - } - } - return max; - } - return function (axis, out) { - return this._withPreprocess1( - axis, out, - withAxis, withFlatten - ); - }; - })()), - - - /** - * Return the minimum of an array or minimum along an axis. - * @param {Number} [axis] - * @param {NDArray} out - * @return {NDArray} - */ - min : kwargs((function () { - function withAxis(data, source, offsetStride, axisSize, stride) { - var cursor = 0; - for (var offset = 0; offset < this._size; offset+=offsetStride) { - for (var i = 0; i < stride; i++) { - var idx = i + offset; - var min = source[idx]; - for (var j = 0; j < axisSize; j++) { - var d = source[idx]; - if (d < min) { - min = d; - } - idx += stride; - } - data[cursor++] = min; - } - } - } - function withFlatten(source) { - var min = source[0]; - for (var i = 1; i < this._size; i++) { - if (source[i] < min) { - min = source[i]; - } - } - return min; - } - return function (axis, out) { - return this._withPreprocess1( - axis, out, - withAxis, withFlatten - ); - }; - })()), - - /** - * Return indices of the maximum values along an axis. - * @param {Number} [axis] - * @param {NDArray} out - * @return {NDArray} - */ - argmax : kwargs((function () { - function withAxis(data, source, offsetStride, axisSize, stride) { - var cursor = 0; - for (var offset = 0; offset < this._size; offset+=offsetStride) { - for (var i = 0; i < stride; i++) { - var dataIdx = 0; - var idx = i + offset; - var max = source[idx]; - for (var j = 0; j < axisSize; j++) { - var d = source[idx]; - if (d > max) { - max = d; - dataIdx = j; - } - idx += stride; - } - data[cursor++] = dataIdx; - } - } - } - function withFlatten(source) { - var max = source[0]; - var idx = 0; - for (var i = 1; i < this._size; i++) { - if (source[i] > max) { - idx = i; - max = source[i]; - } - } - return idx; - } - return function (axis, out) { - return this._withPreprocess1( - axis, out, - withAxis, withFlatten - ); - }; - })()), - - /** - * Indices of the minimum values along an axis. - * @param {Number} [axis] - * @param {NDArray} out - * @return {NDArray} - */ - argmin : kwargs((function () { - function withAxis(data, source, offsetStride, axisSize, stride) { - var cursor = 0; - for (var offset = 0; offset < this._size; offset+=offsetStride) { - for (var i = 0; i < stride; i++) { - var dataIdx = 0; - var idx = i + offset; - var min = source[idx]; - for (var j = 0; j < axisSize; j++) { - var d = source[idx]; - if (d < min) { - min = d; - dataIdx = j; - } - idx += stride; - } - data[cursor++] = dataIdx; - } - } - } - function withFlatten(source) { - var min = source[0]; - var idx = 0; - for (var i = 1; i < this._size; i++) { - if (source[i] < min) { - idx = i; - min = source[i]; - } - } - return idx; - } - return function (axis, out) { - return this._withPreprocess1( - axis, out, - withAxis, withFlatten - ); - }; - })()), - - /** - * Return the sum of the array elements over the given axis. - * @param {Number} [axis] - * @param {NDArray} out - * @return {NDArray} - */ - sum : kwargs((function () { - function withAxis(data, source, offsetStride, axisSize, stride) { - var cursor = 0; - for (var offset = 0; offset < this._size; offset+=offsetStride) { - for (var i = 0; i < stride; i++) { - var sum = 0; - var idx = i + offset; - for (var j = 0; j < axisSize; j++) { - sum += source[idx]; - idx += stride; - } - data[cursor++] = sum; - } - } - } - function withFlatten(source) { - var sum = 0; - for (var i = 0; i < this._size; i++) { - sum += source[i]; - } - return sum; - } - return function (axis, out) { - return this._withPreprocess1( - axis, out, - withAxis, withFlatten - ); - }; - })()), - - /** - * Return the product of the array elements over the given axis. - * @param {Number} [axis] - * @param {NDArray} out - * @return {NDArray} - */ - prod : kwargs((function () { - function withAxis(data, source, offsetStride, axisSize, stride) { - var cursor = 0; - for (var offset = 0; offset < this._size; offset+=offsetStride) { - for (var i = 0; i < stride; i++) { - var prod = 1; - var idx = i + offset; - for (var j = 0; j < axisSize; j++) { - prod *= source[idx]; - idx += stride; - } - data[cursor++] = prod; - } - } - } - function withFlatten(source) { - var prod = 1; - for (var i = 0; i < this._size; i++) { - prod *= source[i]; - } - return prod; - } - return function (axis, out) { - return this._withPreprocess1( - axis, out, - withAxis, withFlatten - ); - }; - })()), - - /** - * Returns the average of the array elements along given axis. - * @param {Number} [axis] - * @param {NDArray} out - * @return {NDArray} - */ - mean : kwargs((function () { - function withAxis(data, source, offsetStride, axisSize, stride) { - var cursor = 0; - for (var offset = 0; offset < this._size; offset+=offsetStride) { - for (var i = 0; i < stride; i++) { - var sum = 0; - var idx = i + offset; - for (var j = 0; j < axisSize; j++) { - sum += source[idx]; - idx += stride; - } - var mean = sum / axisSize; - data[cursor++] = mean; - } - } - } - function withFlatten(source) { - var sum = 0; - var len = source.length; - for (var i = 0; i < len; i++) { - sum += source[i]; - } - var mean = sum / len; - return mean; - } - return function (axis, out) { - return this._withPreprocess1( - axis, out, - withAxis, withFlatten - ); - }; - })()), - - /** - * Return the variance of the array elements over the given axis. - * @param {Number} [axis] - * @param {NDArray} out - * @return {NDArray} - */ - 'var' : kwargs((function () { - function withAxis(data, source, offsetStride, axisSize, stride) { - var cursor = 0; - for (var offset = 0; offset < this._size; offset+=offsetStride) { - for (var i = 0; i < stride; i++) { - var sum = 0; - var idx = i + offset; - for (var j = 0; j < axisSize; j++) { - sum += source[idx]; - idx += stride; - } - var mean = sum / axisSize; - var moments = 0; - idx = i + offset; - for (var j = 0; j < axisSize; j++) { - var diff = source[idx] - mean; - moments += diff * diff; - idx += stride; - } - data[cursor++] = moments / axisSize; - } - } - } - function withFlatten(source) { - var sum = 0; - var len = source.length; - for (var i = 0; i < len; i++) { - sum += source[i]; - } - var mean = sum / len; - var moments = 0; - for (var i = 0; i < len; i++) { - var diff = source[i] - mean; - moments += diff * diff; - } - return moments / len; - } - return function (axis, out) { - return this._withPreprocess1( - axis, out, - withAxis, withFlatten - ); - }; - })()), - - /** - * Return the standard derivatione of the array elements - * over the given axis. - * @param {Number} [axis] - * @param {NDArray} out - * @return {NDArray} - */ - std : kwargs((function () { - function withAxis(data, source, offsetStride, axisSize, stride) { - var cursor = 0; - for (var offset = 0; offset < this._size; offset+=offsetStride) { - for (var i = 0; i < stride; i++) { - var sum = 0; - var idx = i + offset; - for (var j = 0; j < axisSize; j++) { - sum += source[idx]; - idx += stride; - } - var mean = sum / axisSize; - var moments = 0; - idx = i + offset; - for (var j = 0; j < axisSize; j++) { - var diff = source[idx] - mean; - moments += diff * diff; - idx += stride; - } - data[cursor++] = Math.sqrt(moments / axisSize); - } - } - } - function withFlatten(source) { - var sum = 0; - var len = source.length; - for (var i = 0; i < len; i++) { - sum += source[i]; - } - var mean = sum / len; - var moments = 0; - for (var i = 0; i < len; i++) { - var diff = source[i] - mean; - moments += diff * diff; - } - return Math.sqrt(moments / len); - } - return function (axis, out) { - return this._withPreprocess1( - axis, out, - withAxis, withFlatten - ); - }; - })()), - - /** - * Peak to peak (maximum - minimum) value along a given axis. - * @param {Number} [axis] - * @param {NDArray} out - * @return {NDArray} - */ - ptp : kwargs((function () { - function withAxis(data, source, offsetStride, axisSize, stride) { - var cursor = 0; - for (var offset = 0; offset < this._size; offset+=offsetStride) { - for (var i = 0; i < stride; i++) { - var idx = offset + i; - var min = source[idx]; - var max = source[idx]; - for (var j = 0; j < axisSize; j++) { - var d = source[idx]; - if (d < min) { - min = d; - } - if (d > max) { - max = d; - } - idx += stride; - } - data[cursor++] = max - min; - } - } - } - function withFlatten(source) { - var min = source[0]; - var max = source[0]; - for (var i = 1; i < this._size; i++) { - if (source[i] < min) { - min = source[i]; - } - if (source[i] > max) { - max = source[i]; - } - } - return max - min; - } - return function (axis, out) { - return this._withPreprocess1( - axis, out, - withAxis, withFlatten - ); - }; - })()), - - /** - * - * @param {Number} [axis=-1] - * @param {string} [order='ascending'] - * 'ascending' | 'descending' - * @return {NDArray} - */ - // FIXME : V8 is quick sort, firefox and safari is merge sort - // order : ascending or desc - sort : kwargs(function (axis, order) { - if (axis < 0) { - axis = this._shape.length + axis; - } - var compareFunc; - if (order === 'ascending') { - compareFunc = function (a, b) { - return a - b; - }; - } else if( order === 'descending') { - compareFunc = function (a, b) { - return b - a; - }; - } - - var source = this._array; - var stride = calculateDimStride(this._shape, axis); - var axisSize = this._shape[axis]; - - var offsetStride = stride * axisSize; - - var tmp = new Array(axisSize); - - for (var offset = 0; offset < this._size; offset+=offsetStride) { - - for (var i = 0; i < stride; i++) { - var idx = offset + i; - for (var j = 0; j < axisSize; j++) { - tmp[j] = source[idx]; - idx += stride; - } - tmp.sort(compareFunc); - var idx = offset + i; - // Copy back - for (var j = 0; j < axisSize; j++) { - source[idx] = tmp[j]; - idx += stride; - } - } - } - - return this; - - }, {axis : -1, order : 'ascending'}), - - /** - * - * @param {Number} [axis=-1] - * @param {string} [order='ascending'] - * 'ascending' | 'descending' - * @param {NDArray} [out] - * @return {NDArray} - */ - argsort : kwargs(function (axis, order, out) { - if (axis < 0) { - axis = this._shape.length + axis; - } - if (!this._size) { - return; - } - if (out && !arrayEqual(this._shape, out._shape)) { - throw new Error(broadcastErrorMsg(this._shape, out._shape)); - } - if (!out) { - out = new NDArray(this._dtype); - out.initFromShape(this._shape); - } - var data = out._array; - - var compareFunc; - if (order === 'ascending') { - compareFunc = function (a, b) { - return tmp[a] - tmp[b]; - }; - } else if( order === 'descending') { - compareFunc = function (a, b) { - return tmp[b] - tmp[a]; - }; - } - - var source = this._array; - var stride = calculateDimStride(this._shape, axis); - var axisSize = this._shape[axis]; - var offsetStride = stride * axisSize; - - var tmp = new Array(axisSize); - var indexList = new Array(axisSize); - - for (var offset = 0; offset < this._size; offset+=offsetStride) { - for (var i = 0; i < stride; i++) { - var idx = offset + i; - for (var j = 0; j < axisSize; j++) { - tmp[j] = source[idx]; - indexList[j] = j; - idx += stride; - } - indexList.sort(compareFunc); - // Copy back - var idx = offset + i; - for (var j = 0; j < axisSize; j++) { - data[idx] = indexList[j]; - idx += stride; - } - } - } - - return out; - - }, {axis : -1, order : 'ascending'}), - - /** - * Return the cumulative sum of the elements along the given axis. - * @param {Number} [axis] - * @param {NDArray} out - * @return {NDArray} - */ - cumsum : kwargs((function () { - function withAxis(data, source, offsetStride, axisSize, stride) { - for (var offset = 0; offset < this._size; offset+=offsetStride) { - for (var i = 0; i < stride; i++) { - var idx = offset + i; - var prevIdx = idx; - data[idx] = source[idx]; - for (var j = 1; j < axisSize; j++) { - prevIdx = idx; - idx += stride; - data[idx] = data[prevIdx] + source[idx]; - } - - } - } - } - function withFlatten(data, source) { - data[0] = source[0]; - for (var i = 1; i < data.length; i++) { - data[i] = data[i-1] + source[i]; - } - } - return function (axis, out) { - return this._withPreprocess2( - axis, out, - withAxis, withFlatten - ); - }; - })()), - - /** - * Return the cumulative product of the elements along the given axis. - * @param {Number} [axis] - * @param {NDArray} out - * @return {NDArray} - */ - cumprod : kwargs((function () { - function withAxis(data, source, offsetStride, axisSize, stride) { - for (var offset = 0; offset < this._size; offset+=offsetStride) { - for (var i = 0; i < stride; i++) { - var idx = offset + i; - var prevIdx = idx; - data[idx] = source[idx]; - for (var j = 1; j < axisSize; j++) { - prevIdx = idx; - idx += stride; - data[idx] = data[prevIdx] * source[idx]; - } - - } - } - } - function withFlatten(data, source) { - data[0] = source[0]; - for (var i = 1; i < data.length; i++) { - data[i] = data[i-1] * source[i]; - } - } - return function (axis, out) { - return this._withPreprocess2( - axis, out, - withAxis, withFlatten - ); - }; - })()), - - /** - * Dot product of two arrays. - * - * @param {NDArray|Number} b - * @param {NDArray} [out] - * @return {NDArray|Number} - */ - dot : function () { - console.warn('TODO'); - }, - - /** - * Mapped to region [min, max] - * @param {Number} mappedMin - * @param {Number} mappedMax - */ - map : function (mappedMin, mappedMax) { - var input = this._array; - var output = this._array; - - var min = input[0]; - var max = input[0]; - var l = this._size; - for (var i = 1; i < l; i++) { - var val = input[i]; - if (val < min) { - min = val; - } - if (val > max) { - max = val; - } - } - var range = max - min; - var mappedRange = mappedMax - mappedMin; - for (var i = 0; i < l; i++) { - if (range === 0) { - output[i] = mappedMin; - } else { - var val = input[i]; - var percent = (val - min) / range; - output[i] = mappedRange * percent + mappedMin; - } - } - return this; - }, - - /** - * Add - */ - add : function (rightOperand, out) { - return this.binaryOperation( - this, rightOperand, E_ADD, out - ); - }, - - /** - * Substract - */ - sub : function (rightOperand, out) { - return this.binaryOperation( - this, rightOperand, E_SUB, out - ); - }, - - /** - * Multiply - */ - mul : function (rightOperand, out) { - return this.binaryOperation( - this, rightOperand, E_MUL, out - ); - }, - - /** - * Divide - */ - div : function (rightOperand, out) { - return this.binaryOperation( - this, rightOperand, E_DIV, out - ); - }, - /** - * mod - */ - mod : function (rightOperand, out) { - return this.binaryOperation( - this, rightOperand, E_MOD, out - ); - }, - /** - * and - */ - and : function (rightOperand, out) { - return this.binaryOperation( - this, rightOperand, E_AND, out - ); - }, - /** - * or - */ - or : function (rightOperand, out) { - return this.binaryOperation( - this, rightOperand, E_OR, out - ); - }, - /** - * xor - */ - xor : function (rightOperand, out) { - return this.binaryOperation( - this, rightOperand, E_XOR, out - ); - }, - /** - * equal - */ - equal : function (rightOperand, out) { - return this.binaryOperation( - this, rightOperand, E_EQL, out - ); - }, - - binaryOperation : function (lo, ro, op, out) { - // Broadcasting - // http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html - var shape = []; - var isLoScalar = typeof(lo) === 'number'; - var isRoScalar = typeof(ro) === 'number'; - if (isLoScalar) { - shape = ro._shape.slice(); - } else if (isRoScalar) { - shape = lo._shape.slice(); - } else { - // Starts with the trailing dimensions - var cl = lo._shape.length-1; - var cr = ro._shape.length-1; - var loBroadCasted = lo; - var roBroadCasted = ro; - while (cl >= 0 && cr >= 0) { - if (lo._shape[cl] == 1) { - shape.unshift(ro._shape[cr]); - loBroadCasted = lo.repeat(ro._shape[cr], cl); - } else if(ro._shape[cr] == 1) { - shape.unshift(lo._shape[cl]); - roBroadCasted = ro.repeat(lo._shape[cl], cr); - } else if(ro._shape[cr] == lo._shape[cl]) { - shape.unshift(lo._shape[cl]); - } else { - throw new Error(broadcastErrorMsg(lo._shape, ro._shape)); - } - cl --; - cr --; - } - for (var i = cl; i >= 0; i--) { - shape.unshift(lo._shape[i]); - } - for (var i = cr; i >= 0; i--) { - shape.unshift(ro._shape[i]); - } - lo = loBroadCasted; - ro = roBroadCasted; - } - if (!out) { - out = new NDArray(this._dtype); - out.initFromShape(shape); - } else { - if (! arrayEqual(shape, out._shape)) { - throw new Error(broadcastErrorMsg(shape, out._shape)); - } - } - var outData = out._array; - - var diffAxis; - var isLoLarger; - var loData; - var roData; - if (isLoScalar) { - diffAxis = ro._shape.length-1; - isLoLarger = false; - loData = lo; - roData = ro._array; - } else if(isRoScalar) { - diffAxis = lo._shape.length-1; - isLoLarger = true; - roData = ro; - loData = lo._array; - } else { - diffAxis = Math.abs(lo._shape.length - ro._shape.length); - isLoLarger = lo._shape.length >= ro._shape.length; - loData = lo._array; - roData = ro._array; - } - var stride = calculateDimStride(shape, diffAxis); - var axisSize = shape[diffAxis]; - - var offsetStride = stride * axisSize; - var offsetRepeats = out._size / offsetStride; - - var _a, _b, res; - var idx = 0; - if (isLoLarger) { - if(isRoScalar) { - for (var c = 0; c < offsetRepeats; c++) { - for (var i = 0; i < offsetStride; i++) { - _a = loData[idx]; _b = roData; - switch (op) { - case E_ADD: res = _a + _b; break; - case E_SUB: res = _a - _b; break; - case E_MUL: res = _a * _b; break; - case E_DIV: res = _a / _b; break; - case E_MOD: res = _a % _b; break; - case E_AND: res = _a & _b; break; - case E_OR: res = _a | _b; break; - case E_XOR: res = _a ^ _b; break; - case E_EQL: res = _a == _b; break; - default: throw new Error('Unkown operation ' + op); - } - outData[idx] = res; - idx ++; - } - } - } else { - for (var c = 0; c < offsetRepeats; c++) { - for (var i = 0; i < offsetStride; i++) { - _a = loData[idx]; _b = roData[i]; - switch (op) { - case E_ADD: res = _a + _b; break; - case E_SUB: res = _a - _b; break; - case E_MUL: res = _a * _b; break; - case E_DIV: res = _a / _b; break; - case E_MOD: res = _a % _b; break; - case E_AND: res = _a & _b; break; - case E_OR: res = _a | _b; break; - case E_XOR: res = _a ^ _b; break; - case E_EQL: res = _a == _b; break; - default: throw new Error('Unkown operation ' + op); - } - outData[idx] = res; - idx ++; - } - } - } - } else { - if (isLoScalar) { - for (var c = 0; c < offsetRepeats; c++) { - for (var i = 0; i < offsetStride; i++) { - _a = loData; _b = roData[idx]; - switch (op) { - case E_ADD: res = _a + _b; break; - case E_SUB: res = _a - _b; break; - case E_MUL: res = _a * _b; break; - case E_DIV: res = _a / _b; break; - case E_MOD: res = _a % _b; break; - case E_AND: res = _a & _b; break; - case E_OR: res = _a | _b; break; - case E_XOR: res = _a ^ _b; break; - case E_EQL: res = _a == _b; break; - default: throw new Error('Unkown operation ' + op); - } - outData[idx] = res; - idx ++; - } - } - } else { - for (var c = 0; c < offsetRepeats; c++) { - for (var i = 0; i < offsetStride; i++) { - _a = loData[idx]; _b = roData[i]; - switch (op) { - case E_ADD: res = _a + _b; break; - case E_SUB: res = _a - _b; break; - case E_MUL: res = _a * _b; break; - case E_DIV: res = _a / _b; break; - case E_MOD: res = _a % _b; break; - case E_AND: res = _a & _b; break; - case E_OR: res = _a | _b; break; - case E_XOR: res = _a ^ _b; break; - case E_EQL: res = _a == _b; break; - default: throw new Error('Unkown operation ' + op); - } - outData[idx] = res; - idx ++; - } - } - } - } - return out; - }, - - /** - * negtive - */ - neg : function () { - var data = this._array; - for (var i = 0; i < this._size; i++) { - data[i] = -data[i]; - } - return this; - }, - - /** - * @return {NDArray} this - */ - sin : function () { - return this._mathAdapter(Math.sin); - }, - - /** - * @return {NDArray} this - */ - cos : function () { - return this._mathAdapter(Math.cos); - }, - - /** - * @return {NDArray} this - */ - tan : function () { - return this._mathAdapter(Math.tan); - }, - - /** - * @return {NDArray} this - */ - abs : function () { - return this._mathAdapter(Math.abs); - }, - - /** - * @return {NDArray} this - */ - log : function () { - return this._mathAdapter(Math.log); - }, - - /** - * @return {NDArray} this - */ - sqrt : function () { - return this._mathAdapter(Math.sqrt); - }, - - /** - * @return {NDArray} this - */ - ceil : function () { - return this._mathAdapter(Math.ceil); - }, - - /** - * @return {NDArray} this - */ - floor : function () { - return this._mathAdapter(Math.floor); - }, - - /** - * @return {NDArray} this - */ - pow : function (exp) { - var data = this._array; - for (var i = 0; i < this._size; i++) { - data[i] = Math.pow(data[i], exp); - } - return this; - }, - - _mathAdapter : function (mathFunc) { - var data = this._array; - for (var i = 0; i < this._size; i++) { - data[i] = mathFunc(data[i]); - } - return this; - }, - - /** - * @param {Number} decimals - * @return {NDArray} this - */ - round : function (decimals) { - decimals = Math.floor(decimals || 0); - var offset = Math.pow(10, decimals); - var data = this._array; - if (decimals === 0) { - for (var i = 0; i < this._size; i++) { - data[i] = Math.round(data[i]); - } - } else { - for (var i = 0; i < this._size; i++) { - data[i] = Math.round(data[i] * offset) / offset; - } - } - return this; - }, - /** - * @param {Number} min - * @param {Number} max - * Clip to [min, max] - */ - clip : function (min, max) { - // TODO : Support array_like param - var data = this._array; - for (var i = 0; i < this._size; i++) { - data[i] = Math.max(Math.min(data[i], max), min); - } - return this; - }, - - /** - * Indexing array, support range indexing - * @param {string} index - * Index syntax can be an integer 1, 2, 3 - * Or more complex range indexing - * '1:2' - * '1:2, 1:2' - * '1:2, :' - * More about the indexing syntax can check the doc of numpy ndarray - * @param {NDArray} [out] - * @return {NDArray} New created sub array, or out if given - */ - get : function (index, out) { - if (typeof(index) == 'number') { - index = index.toString(); - } - var strides = calculateDimStrides(this._shape); - var res = this._parseRanges(index); - var ranges = res[0]; - var shape = res[1]; - - if (ranges.length > this._shape.length) { - throw new Error('Too many indices'); - } - // Get data - var len = ranges.length; - var data; - if (shape.length) { - out = new NDArray(this._dtype); - out.initFromShape(shape); - data = out._array; - } else { - data = []; - } - - var source = this._array; - var cursor = 0; - function getPiece(axis, offset) { - var range = ranges[axis]; - var stride = strides[axis]; - if (axis < len-1) { - if (range[2] > 0) { - for (var i = range[0]; i < range[1]; i += range[2]) { - getPiece(axis+1, offset + stride * i); - } - } else { - for (var i = range[0]; i > range[1]; i += range[2]) { - getPiece(axis+1, offset + stride * i); - } - } - } else { - if (range[2] > 0) { - for (var i = range[0]; i < range[1]; i += range[2]) { - for (var j = 0; j < stride; j++) { - data[cursor++] = source[i*stride + j + offset]; - } - } - } else { - for (var i = range[0]; i > range[1]; i += range[2]) { - for (var j = 0; j < stride; j++) { - data[cursor++] = source[i*stride + j + offset]; - } - } - } - } - } - - getPiece(0, 0); - - if (shape.length) { - // Return scalar - return out; - } else { - return data[0]; - } - - }, - - /** - * - * @param {string} index - * index syntax can be an integer 1, 2, 3 - * Or more complex range indexing - * '1:2' - * '1:2, 1:2' - * '1:2, :' - * More about the indexing syntax can check the doc of numpy ndarray - * @param {NDArray} ndarray Ndarray data source - * @return {NDArray} this - */ - set : function (index, narray) { - if (typeof(index) == 'number') { - index = index.toString(); - } - var strides = calculateDimStrides(this._shape); - var res = this._parseRanges(index); - var ranges = res[0]; - var shape = res[1]; - - if (ranges.length > this._shape.length) { - throw new Error('Too many indices'); - } - var isScalar = typeof(narray) == 'number'; - var len = ranges.length; - var data = this._array; - if (isScalar) { - // Set with a single scalar - var source = narray; - } else { - if (!arrayEqual(shape, narray.shape())) { - throw new Error(broadcastErrorMsg(shape, narray.shape())); - } - var source = narray._array; - } - var cursor = 0; - var setPiece = function (axis, offset) { - var range = ranges[axis]; - var stride = strides[axis]; - if (axis < len-1) { - if (range[2] > 0) { - for (var i = range[0]; i < range[1]; i += range[2]) { - setPiece(axis+1, offset + stride * i); - } - } else { - for (var i = range[0]; i > range[1]; i += range[2]) { - setPiece(axis+1, offset + stride * i); - } - } - } else { - if (range[2] > 0) { - for (var i = range[0]; i < range[1]; i += range[2]) { - for (var j = 0; j < stride; j++) { - if (isScalar) { - data[i*stride + j + offset] = source; - } else { - data[i*stride + j + offset] = source[cursor++]; - } - } - } - } else { - for (var i = range[0]; i > range[1]; i += range[2]) { - for (var j = 0; j < stride; j++) { - if (isScalar) { - data[i*stride + j + offset] = source; - } else { - data[i*stride + j + offset] = source[cursor++]; - } - } - } - } - } - }; - - setPiece(0, 0); - - return this; - }, - - /** - * Insert values along the given axis before the given indices. - * @param {Number|Array} obj - * Object that defines the index or indices before - * which values is inserted. - * @param {Number|Array|NDArray} values - * Values to insert - * @param {Number} [axis] - * @return {NDArray} this - */ - insert : kwargs(function (obj, values, axis) { - var data = this._array; - var isObjScalar = false; - if (typeof(obj) === 'number') { - obj = [obj]; - isObjScalar = true; - } - if (typeof(values) === 'number') { - values = new NDArray([values]); - } else if (values instanceof Array) { - values = new NDArray(values); - } - - if (typeof(axis) === 'undefined') { - this._shape = [this._size]; - axis = 0; - } - // Checking if indices is valid - var prev = obj[0]; - var axisSize = this._shape[axis]; - for (var i = 0; i < obj.length; i++) { - if (obj[i] < 0) { - obj[i] = axisSize + obj[i]; - } - if (obj[i] > axisSize) { - throw new Error(indexOutofBoundsErrorMsg(obj[i])); - } - if (obj[i] < prev) { - throw new Error('Index must be in ascending order'); - } - prev = obj[i]; - } - // Broadcasting - var targetShape = this._shape.slice(); - if (isObjScalar) { - targetShape.splice(axis, 1); - } else { - targetShape[axis] = obj.length; - } - - var sourceShape = values._shape; - var cs = sourceShape.length - 1; - var ct = targetShape.length - 1; - - var valueBroadcasted = values; - while (cs >= 0 && ct >= 0) { - if (sourceShape[cs] === 1) { - valueBroadcasted = values.repeat(targetShape[ct], cs); - } else if(sourceShape[cs] !== targetShape[ct]) { - throw new Error(broadcastErrorMsg(sourceShape, targetShape)); - } - cs --; - ct --; - } - values = valueBroadcasted; - - // Calculate indices to insert - var stride = calculateDimStride(this._shape, axis); - var axisSize = this._shape[axis]; - var offsetStride = axisSize * stride; - var offsetRepeats = this._size / offsetStride; - - var objLen = obj.length; - var indices = new Uint32Array(offsetRepeats * objLen); - - var cursor = 0; - for (var offset = 0; offset < this._size; offset += offsetStride) { - for (var i = 0; i < objLen; i++) { - var objIdx = obj[i]; - indices[cursor++] = offset + objIdx * stride; - } - } - - var resShape = this._shape.slice(); - resShape[axis] += obj.length; - var resSize = getSize(resShape); - if (this._array.length < resSize) { - var data = new ArrayConstructor[this._dtype](resSize); - } else { - var data = this._array; - } - var source = this._array; - var valuesArr = values._array; - - var idxCursor = indices.length - 1; - var end = this._size; - var start = indices[idxCursor]; - var dataCursor = resSize - 1; - var valueCursor = values._size - 1; - while (idxCursor >= 0) { - // Copy source data; - for (var i = end - 1; i >= start; i--) { - data[dataCursor--] = source[i]; - } - end = start; - start = indices[--idxCursor]; - // Copy inserted data; - for (var i = 0; i < stride; i++) { - if (valueCursor < 0) { - valueCursor = values._size - 1; - } - data[dataCursor--] = valuesArr[valueCursor--]; - } - } - // Copy the rest - for (var i = end - 1; i >= 0; i--) { - data[dataCursor--] = source[i]; - } - - this._array = data; - this._shape = resShape; - this._size = resSize; - - return this; - }), - - append : function () { - console.warn('TODO'); - }, - - /** - * Delete values along the axis - * @param {Array|Number} obj - * @param {Number} [axis] - * @return {NDArray} this - */ - 'delete' : kwargs(function (obj, axis) { - var data = this._array; - if (typeof(obj) === 'number') { - obj = [obj]; - } - var size = this._size; - - if (typeof(axis) === 'undefined') { - this._shape = [size]; - axis = 0; - } - - var stride = calculateDimStride(this._shape, axis); - var axisSize = this._shape[axis]; - - var offsetStride = stride * axisSize; - var cursor = 0; - for (var offset = 0; offset < size; offset += offsetStride) { - var start = 0; - var end = obj[0]; - var objCursor = 0; - while(objCursor < obj.length) { - if (end < 0) { - end = end + axisSize; - } - if (end > axisSize) { - throw new Error(indexOutofBoundsErrorMsg(end)); - } - if (end < start) { - throw new Error('Index must be in ascending order'); - } - for (var i = start; i < end; i++) { - for (var j = 0; j < stride; j++) { - data[cursor++] = data[i * stride + j + offset]; - } - } - start = end + 1; - end = obj[++objCursor]; - } - // Copy the rest - for (var i = start; i < axisSize; i++) { - for (var j = 0; j < stride; j++) { - data[cursor++] = data[i * stride + j + offset]; - } - } - } - this._shape[axis] -= obj.length; - this._size = getSize(this._shape); - - return this; - }), - - _parseRanges : function (index) { - var rangesStr = index.split(/\s*,\s*/); - - // Parse range of each axis - var ranges = []; - var shape = []; - var j = 0; - for (var i = 0; i < rangesStr.length; i++) { - if (rangesStr[i] === '...') { - var end = this._shape.length - (rangesStr.length - i); - while (j <= end) { - ranges.push([0, this._shape[j], 1]); - shape.push(this._shape[j]); - j++; - } - } else { - var range = parseRange(rangesStr[i], this._shape[j]); - ranges.push(range); - if(rangesStr[i].indexOf(':') >= 0) { - var size = Math.floor((range[1] - range[0]) / range[2]); - size = size < 0 ? 0 : size; - // Get a range not a item - shape.push(size); - } - j++; - } - } - // Copy the lower dimension size - for (; j < this._shape.length; j++) { - shape.push(this._shape[j]); - } - - return [ranges, shape]; - }, - - /** - * Export normal js array - * @return {Array} - */ - toArray : function () { - var data = this._array; - var cursor = 0; - - var shape = this._shape; - var dim = shape.length; - - function create(axis, out) { - var len = shape[axis]; - for (var i = 0; i < len; i++) { - if (axis < dim-1) { - create(axis+1, out[i] = []); - } else { - out[i] = data[cursor++]; - } - } - } - - var output = []; - create(0, output); - - return output; - }, - - /** - * Create a copy of self - * @return {NDArray} - */ - copy : function () { - var numArr = new NDArray(); - numArr._array = ArraySlice.call(this._array); - numArr._shape = this._shape.slice(); - numArr._dtype = this._dtype; - numArr._size = this._size; - - return numArr; - }, - - constructor : NDArray -}; - -/** - * - * @param {Number} [min=0] - * @param {Number} max - * @param {Number} [step=1] - * @param {string} [dtype] - * @return {NDArray} - */ -NDArray.range = kwargs(function (min, max, step, dtype) { - var args = ArraySlice.call(arguments); - // Last argument describe the data type of ndarray - var lastArg = args[args.length-1]; - if (typeof(lastArg) == 'string') { - var dtype = lastArg; - args.pop(); - } - if (args.length === 1) { - max = args[0]; - step = 1; - min = 0; - } else if(args.length == 2) { - step = 1; - } - dtype = dtype || 'number'; - - var array = new ArrayConstructor[dtype](Math.ceil((max - min)/step)); - var cursor = 0; - for (var i = min; i < max; i+=step) { - array[cursor++] = i; - } - var ndarray = new NDArray(); - ndarray._array = array; - ndarray._shape = [array.length]; - ndarray._dtype = dtype; - ndarray._size = array.length; - - return ndarray; - -}); - -/** - * - * @param {Array} shape - * @param {String} [dtype] - * @return {NDArray} - */ -NDArray.zeros = kwargs(function (shape, dtype) { - var ret = new NDArray(dtype); - ret.initFromShape(shape); - return ret; -}); - -/** - * Python like array indexing - * http://www.python.org/dev/peps/pep-0204/ - * - * @param {string} index - * index can be a simple integer 1,2,3, - * or a range 2:10, 2:10:1 - * example : - * 2:10 => [2, 10, 1], - * 10:2:-2 => [10, 2, -2], - * : => [0, dimSize, 1], - * ::-1 => [dimSize-1, -1, -1], - * @param {number} dimSize - * @return {Array} a tuple array [startOffset, endOffset, sliceStep] - */ -function parseRange(index, dimSize) { - if (index.indexOf(':') >= 0) { - // Range indexing; - var res = index.split(/\s*:\s*/); - - var step = parseInt(res[2] || 1, 10); - var start, end; - if (step === 0) { - throw new Error('Slice step cannot be zero'); - } - else if (step > 0) { - start = parseInt(res[0] || 0, 10); - end = parseInt(res[1] || dimSize, 10); - } - else { - start = parseInt(res[0] || dimSize - 1, 10); - end = parseInt(res[1] || -1, 10); - } - // Negtive offset - if (start < 0) { - start = dimSize + start; - } - // Negtive offset - if (end < 0 && res[1]) { - end = dimSize + end; - } - if (step > 0) { - // Clamp to [0-dimSize] - start = Math.max(Math.min(dimSize, start), 0); - // Clamp to [0-dimSize] - end = Math.max(Math.min(dimSize, end), 0); - } else { - // Clamp to [0-dimSize) - start = Math.max(Math.min(dimSize-1, start), -1); - // Clamp to [0-dimSize) - end = Math.max(Math.min(dimSize-1, end), -1); - } - return [start, end, step]; - } else { - var start = parseInt(index, 10); - // Negtive offset - if (start < 0) { - start = dimSize + start; - } - if (start < 0 || start > dimSize) { - throw new Error(indexOutofBoundsErrorMsg(index)); - } - // Clamp to [0-dimSize) - start = Math.max(Math.min(dimSize-1, start), 0); - return [start, start+1, 1]; - } -} - -function getSize(shape) { - var size = shape[0]; - for (var i = 1; i < shape.length; i++) { - size *= shape[i]; - } - return size; -} - -function getDimension(array) { - var dim = 1; - var el = array[0]; - while (el instanceof Array) { - el = el[0]; - dim ++; - } - return dim; -} - -function getShape(array) { - var shape = [array.length]; - var el = array[0]; - while (el instanceof Array) { - shape.push(el.length); - el = el[0]; - } - return shape; -} - -function calculateDimStride(shape, axis) { - if (axis == shape.length-1) { - return 1; - } - var stride = shape[axis+1]; - for (var i = axis+2; i < shape.length; i++) { - stride *= shape[i]; - } - return stride; -} - -function calculateDimStrides(shape) { - // Calculate stride of each axis - var strides = []; - var tmp = 1; - var len = getSize(shape); - for (var i = 0; i < shape.length; i++) { - tmp *= shape[i]; - strides.push(len / tmp); - } - - return strides; -} - -function arrayEqual(arr1, arr2) { - if (arr1.length !== arr2.length) { - return false; - } - for (var i = 0; i 0) { - sector.style.brushType = 'both'; - } - if (sector.highlightStyle.lineWidth > 0) { - sector.highlightStyle.brushType = 'both'; - } - ecData.pack( - sector, - this.chordSeries[0], - 0, - data[i], i, - group.name - ); - if (showLabel) { - var halfAngle = [_start + _end] / 2; - halfAngle %= 360; // Constrain to [0,360] - var isRightSide = halfAngle <= 90 - || halfAngle >= 270; - halfAngle = halfAngle * Math.PI / 180; - var v = [Math.cos(halfAngle), -Math.sin(halfAngle)]; - - var distance = this.showScaleText ? 35 + labelDistance : labelDistance; - var start = vec2.scale([], v, this.outerRadius + distance); - vec2.add(start, start, this.center); - - var labelShape = { - zlevel : this._zlevelBase - 1, - hoverable : false, - style : { - text : group.name, - textAlign : isRightSide ? 'left' : 'right', - color : labelColor - } - }; - if (rotateLabel) { - labelShape.rotation = isRightSide ? halfAngle : Math.PI + halfAngle; - if (isRightSide) { - labelShape.style.x = this.outerRadius + distance; - } else { - labelShape.style.x = -this.outerRadius - distance; - } - labelShape.style.y = 0; - labelShape.position = this.center; - } else { - labelShape.style.x = start[0]; - labelShape.style.y = start[1]; - } - labelShape.style.textColor = this.deepQuery( - [group, this.chordSerieSample], - 'itemStyle.normal.label.textStyle.color' - ) || '#fff'; - labelShape.style.textFont = this.getFont(this.deepQuery( - [group, this.chordSerieSample], - 'itemStyle.normal.label.textStyle' - )); - labelShape = new TextShape(labelShape); - this.shapeList.push(labelShape); - } - - sector.onmouseover = createMouseOver(i); - sector.onmouseout = createMouseOut(); - - sector = new SectorShape(sector); - this.shapeList.push(sector); - this.sectorShapes.push(sector); - } - }, - - _buildChords : function (angles, dataArr) { - var len = angles.length; - if (!len) { - return; - } - var len2 = angles[0][0].length; - - var chordLineStyle - = this.chordSerieSample.itemStyle.normal.chordStyle.lineStyle; - var chordLineStyleEmphsis - = this.chordSerieSample.itemStyle.emphasis.chordStyle.lineStyle; - - for (var i = 0; i < len; i++) { - for (var j = 0; j < len; j++) { - for (var k = 0; k < len2; k++) { - if (this.chordShapes[j][i][k]) { - continue; - } - - var angleIJ0 = angles[i][j][k][0]; - var angleJI0 = angles[j][i][k][0]; - - var angleIJ1 = angles[i][j][k][1]; - var angleJI1 = angles[j][i][k][1]; - - if (angleIJ0 - angleJI1 === 0 || - angleJI0 - angleJI1 === 0) { - this.chordShapes[i][j][k] = null; - continue; - } - - var color; - if (len2 === 1) { - if (angleIJ1 - angleIJ0 <= angleJI1 - angleJI0) { - color = this.getColor(this.groups[i].name); - } else { - color = this.getColor(this.groups[j].name); - } - } else { - color = this.getColor(this.chordSeries[k].name); - } - var s0 = !this.clockWise ? (360 - angleIJ1) : angleIJ0; - var s1 = !this.clockWise ? (360 - angleIJ0) : angleIJ1; - var t0 = !this.clockWise ? (360 - angleJI1) : angleJI0; - var t1 = !this.clockWise ? (360 - angleJI0) : angleJI1; - var chord = { - zlevel : this._zlevelBase, - style : { - center : this.center, - r : this.innerRadius, - source0 : s0 - this.startAngle, - source1 : s1 - this.startAngle, - target0 : t0 - this.startAngle, - target1 : t1 - this.startAngle, - brushType : 'both', - opacity : 0.5, - color : color, - lineWidth : chordLineStyle.width, - strokeColor : chordLineStyle.color - }, - clickable: true, - highlightStyle : { - brushType : 'both', - lineWidth : chordLineStyleEmphsis.width, - strokeColor : chordLineStyleEmphsis.color - } - }; - - ecData.pack( - chord, - this.chordSeries[k], - k, - dataArr[i][j][k], i + '-' +j, - this.groups[i].name, - this.groups[j].name, - dataArr[j][i][k] - ); - - chord = new ChordShape(chord); - this.chordShapes[i][j][k] = chord; - this.shapeList.push(chord); - } - } - } - }, - - _buildScales : function ( - values, - unitPostfix, - angles, - unitValue - ) { - for (var i = 0; i < angles.length; i++) { - var subStartAngle = angles[i][0]; - var subEndAngle = angles[i][1]; - - var scaleAngle = subStartAngle; - while (scaleAngle < subEndAngle) { - var thelta = ((this.clockWise ? (360 - scaleAngle) : scaleAngle) - + this.startAngle) / 180 * Math.PI; - var v = [ - Math.cos(thelta), - -Math.sin(thelta) - ]; - var start = vec2.scale([], v, this.outerRadius + 1); - vec2.add(start, start, this.center); - var end = vec2.scale([], v, this.outerRadius + this.scaleLineLength); - vec2.add(end, end, this.center); - var scaleShape = { - zlevel : this._zlevelBase - 1, - hoverable : false, - style : { - xStart : start[0], - yStart : start[1], - xEnd : end[0], - yEnd : end[1], - lineCap : 'round', - brushType : 'stroke', - strokeColor : '#666', - lineWidth: 1 - } - }; - - scaleShape = new LineShape(scaleShape); - this.shapeList.push(scaleShape); - - scaleAngle += this.scaleUnitAngle; - } - if (!this.showScaleText) { - continue; - } - - var scaleTextAngle = subStartAngle; - var step = unitValue * 5 * this.scaleUnitAngle; - var scaleValues = NDArray.range(0, values[i], step).toArray(); - while (scaleTextAngle < subEndAngle) { - var thelta = this.clockWise - ? (360 - scaleTextAngle) : scaleTextAngle; - thelta = (thelta + this.startAngle) % 360; - var isRightSide = thelta <= 90 - || thelta >= 270; - var textShape = { - zlevel : this._zlevelBase - 1, - hoverable : false, - style : { - x : isRightSide - ? this.outerRadius + this.scaleLineLength + 4 - : -this.outerRadius - this.scaleLineLength - 4, - y : 0, - text : Math.round(scaleValues.shift()*10)/10 - + unitPostfix, - textAlign : isRightSide ? 'left' : 'right' - }, - position : this.center.slice(), - rotation : isRightSide - ? [thelta / 180 * Math.PI, 0, 0] - : [ - (thelta + 180) / 180 * Math.PI, - 0, 0 - ] - }; - - textShape = new TextShape(textShape); - this.shapeList.push(textShape); - scaleTextAngle += this.scaleUnitAngle * 5; - } - } - }, - - normalizeValue : function (values) { - var result = []; - var max = new NDArray(values).max(); - var unitPostfix, unitScale; - if (max > 10000) { - unitPostfix = 'k'; - unitScale = 1 / 1000; - } else if (max > 10000000) { - unitPostfix = 'm'; - unitScale = 1 / 1000000; - } else if (max > 10000000000) { - unitPostfix = 'b'; - unitScale = 1 / 1000000000; - } else { - unitPostfix = ''; - unitScale = 1; - } - - for (var i = 0; i < values.length; i++) { - result[i] = values[i] * unitScale; - } - return [result, unitPostfix]; - }, - - refresh : function (newOption) { - if (newOption) { - this.option = newOption; - this.series = newOption.series; - } - - /* - this.legend; - this.getColor; - this.isSelected; - this.chordSerieSample; - */ - // Config - this.chordSeries = []; - /* - this.groups; - this.startAngle; - this.clockWise; - this.innerRadius; - this.outerRadius; - this.padding; - this.sortGroups; - this.sortSubGroups; - this.center; - this.showScale; - this.showScaleText; - this.dataMat; - */ - this.strokeFix = 0; - // Adjacency matrix - this.sectorShapes = []; - this.chordShapes = []; - - this.scaleLineLength = 4; - this.scaleUnitAngle = 4; - - this.legend = this.component.legend; - if (this.legend) { - this.getColor = function(param) { - return this.legend.getColor(param); - }; - this.isSelected = function(param) { - return this.legend.isSelected(param); - }; - } else { - var colorIndices = {}; - var colorMap = {}; - var count = 0; - this.getColor = function (key) { - if (colorMap[key]) { - return colorMap[key]; - } - if (colorIndices[key] === undefined) { - colorIndices[key] = count++; - } - // key is serie name - for (var i = 0; i < this.chordSeries.length; i++) { - if (this.chordSeries[i].name === key) { - colorMap[key] = this.query( - this.chordSeries[i], - 'itemStyle.normal.color' - ); - break; - } - } - if (!colorMap[key]) { - var len = this.groups.length; - // key is group name - for (var i = 0; i < len; i++) { - if (this.groups[i].name === key) { - colorMap[key] = this.query( - this.groups[i], - 'itemStyle.normal.color' - ); - break; - } - } - } - if (!colorMap[key]) { - colorMap[key] = this.zr.getColor(colorIndices[key]); - } - - return colorMap[key]; - }; - this.isSelected = function () { - return true; - }; - } - - this.backupShapeList(); - this._buildShape(); - }, - - reformOption : function (opt) { - var _merge = zrUtil.merge; - opt = _merge( - opt || {}, - this.ecTheme.chord - ); - opt.itemStyle.normal.label.textStyle = _merge( - opt.itemStyle.normal.label.textStyle || {}, - this.ecTheme.textStyle - ); - } - }; - - zrUtil.inherits(Chord, ChartBase); - zrUtil.inherits(Chord, ComponentBase); - - // 图表注册 - require('../chart').define('chord', Chord); - - return Chord; -}); -// 1. Graph Drawing by Force-directed Placement -// 2. http://webatlas.fr/tempshare/ForceAtlas2_Paper.pdf -define('echarts/chart/forceLayoutWorker',['require','zrender/tool/vector'],function __echartsForceLayoutWorker(require) { - - - - var vec2; - // In web worker - var inWorker = typeof(window) === 'undefined' && typeof(require) === 'undefined'; - if (inWorker) { - vec2 = { - create: function(x, y) { - var out = new Float32Array(2); - out[0] = x || 0; - out[1] = y || 0; - return out; - }, - dist: function(a, b) { - var x = b[0] - a[0]; - var y = b[1] - a[1]; - return Math.sqrt(x*x + y*y); - }, - len: function(a) { - var x = a[0]; - var y = a[1]; - return Math.sqrt(x*x + y*y); - }, - scaleAndAdd: function(out, a, b, scale) { - out[0] = a[0] + b[0] * scale; - out[1] = a[1] + b[1] * scale; - return out; - }, - scale: function(out, a, b) { - out[0] = a[0] * b; - out[1] = a[1] * b; - return out; - }, - add: function(out, a, b) { - out[0] = a[0] + b[0]; - out[1] = a[1] + b[1]; - return out; - }, - sub: function(out, a, b) { - out[0] = a[0] - b[0]; - out[1] = a[1] - b[1]; - return out; - }, - normalize: function(out, a) { - var x = a[0]; - var y = a[1]; - var len = x*x + y*y; - if (len > 0) { - //TODO: evaluate use of glm_invsqrt here? - len = 1 / Math.sqrt(len); - out[0] = a[0] * len; - out[1] = a[1] * len; - } - return out; - }, - negate: function(out, a) { - out[0] = -a[0]; - out[1] = -a[1]; - return out; - }, - copy: function(out, a) { - out[0] = a[0]; - out[1] = a[1]; - return out; - }, - set: function(out, x, y) { - out[0] = x; - out[1] = y; - return out; - } - }; - } else { - vec2 = require('zrender/tool/vector'); - } - var ArrayCtor = typeof(Float32Array) == 'undefined' ? Array : Float32Array; - - /**************************** - * Class: Region - ***************************/ - - function Region() { - - this.subRegions = []; - - this.nSubRegions = 0; - - this.node = null; - - this.mass = 0; - - this.centerOfMass = null; - - this.bbox = new ArrayCtor(4); - - this.size = 0; - } - - // Reset before update - Region.prototype.beforeUpdate = function() { - for (var i = 0; i < this.nSubRegions; i++) { - this.subRegions[i].beforeUpdate(); - } - this.mass = 0; - if (this.centerOfMass) { - this.centerOfMass[0] = 0; - this.centerOfMass[1] = 0; - } - this.nSubRegions = 0; - this.node = null; - }; - // Clear after update - Region.prototype.afterUpdate = function() { - this.subRegions.length = this.nSubRegions; - for (var i = 0; i < this.nSubRegions; i++) { - this.subRegions[i].afterUpdate(); - } - }; - - Region.prototype.addNode = function(node) { - if (this.nSubRegions === 0) { - if (this.node == null) { - this.node = node; - return; - } else { - this._addNodeToSubRegion(this.node); - this.node = null; - } - } - this._addNodeToSubRegion(node); - - this._updateCenterOfMass(node); - }; - - Region.prototype.findSubRegion = function(x, y) { - for (var i = 0; i < this.nSubRegions; i++) { - var region = this.subRegions[i]; - if (region.contain(x, y)) { - return region; - } - } - }; - - Region.prototype.contain = function(x, y) { - return this.bbox[0] <= x - && this.bbox[2] >= x - && this.bbox[1] <= y - && this.bbox[3] >= y; - }; - - Region.prototype.setBBox = function(minX, minY, maxX, maxY) { - // Min - this.bbox[0] = minX; - this.bbox[1] = minY; - // Max - this.bbox[2] = maxX; - this.bbox[3] = maxY; - - this.size = (maxX - minX + maxY - minY) / 2; - }; - - Region.prototype._newSubRegion = function() { - var subRegion = this.subRegions[this.nSubRegions]; - if (!subRegion) { - subRegion = new Region(); - this.subRegions[this.nSubRegions] = subRegion; - } - this.nSubRegions++; - return subRegion; - }; - - Region.prototype._addNodeToSubRegion = function(node) { - var subRegion = this.findSubRegion(node.position[0], node.position[1]); - var bbox = this.bbox; - if (!subRegion) { - var cx = (bbox[0] + bbox[2]) / 2; - var cy = (bbox[1] + bbox[3]) / 2; - var w = (bbox[2] - bbox[0]) / 2; - var h = (bbox[3] - bbox[1]) / 2; - - var xi = node.position[0] >= cx ? 1 : 0; - var yi = node.position[1] >= cy ? 1 : 0; - - var subRegion = this._newSubRegion(); - // Min - subRegion.setBBox( - // Min - xi * w + bbox[0], - yi * h + bbox[1], - // Max - (xi + 1) * w + bbox[0], - (yi + 1) * h + bbox[1] - ); - } - - subRegion.addNode(node); - }; - - Region.prototype._updateCenterOfMass = function(node) { - // Incrementally update - if (this.centerOfMass == null) { - this.centerOfMass = vec2.create(); - } - var x = this.centerOfMass[0] * this.mass; - var y = this.centerOfMass[1] * this.mass; - x += node.position[0] * node.mass; - y += node.position[1] * node.mass; - this.mass += node.mass; - this.centerOfMass[0] = x / this.mass; - this.centerOfMass[1] = y / this.mass; - }; - - /**************************** - * Class: Graph Node - ***************************/ - function GraphNode() { - this.position = vec2.create(); - - this.force = vec2.create(); - this.forcePrev = vec2.create(); - - this.speed = vec2.create(); - this.speedPrev = vec2.create(); - - // If repulsionByDegree is true - // mass = inDegree + outDegree + 1 - // Else - // mass is manually set - this.mass = 1; - - this.inDegree = 0; - this.outDegree = 0; - } - - /**************************** - * Class: Graph Edge - ***************************/ - function GraphEdge(source, target) { - this.source = source; - this.target = target; - - this.weight = 1; - } - - /**************************** - * Class: ForceLayout - ***************************/ - function ForceLayout() { - - this.barnesHutOptimize = false; - this.barnesHutTheta = 1.5; - - this.repulsionByDegree = false; - - this.preventOverlap = false; - this.strongGravity = true; - - this.gravity = 1.0; - this.scaling = 1.0; - - this.edgeWeightInfluence = 1.0; - - this.center = [0, 0]; - this.width = 500; - this.height = 500; - - this.maxSpeedIncrease = 1.0; - - this.nodes = []; - this.edges = []; - - this.bbox = new ArrayCtor(4); - - this._rootRegion = new Region(); - this._rootRegion.centerOfMass = vec2.create(); - - this._massArr = null; - - this._k = 0; - } - - ForceLayout.prototype.initNodes = function(positionArr, massArr, sizeArr) { - - this.temperature = 1.0; - - var nNodes = positionArr.length / 2; - this.nodes.length = 0; - var haveSize = typeof(sizeArr) !== 'undefined'; - - for (var i = 0; i < nNodes; i++) { - var node = new GraphNode(); - node.position[0] = positionArr[i * 2]; - node.position[1] = positionArr[i * 2 + 1]; - node.mass = massArr[i]; - if (haveSize) { - node.size = sizeArr[i]; - } - this.nodes.push(node); - } - - this._massArr = massArr; - if (haveSize) { - this._sizeArr = sizeArr; - } - }; - - ForceLayout.prototype.initEdges = function(edgeArr, edgeWeightArr) { - var nEdges = edgeArr.length / 2; - this.edges.length = 0; - var edgeHaveWeight = typeof(edgeWeightArr) !== 'undefined'; - - for (var i = 0; i < nEdges; i++) { - var sIdx = edgeArr[i * 2]; - var tIdx = edgeArr[i * 2 + 1]; - var sNode = this.nodes[sIdx]; - var tNode = this.nodes[tIdx]; - - if (!sNode || !tNode) { - continue; - } - sNode.outDegree++; - tNode.inDegree++; - var edge = new GraphEdge(sNode, tNode); - - if (edgeHaveWeight) { - edge.weight = edgeWeightArr[i]; - } - - this.edges.push(edge); - } - }; - - ForceLayout.prototype.update = function() { - - var nNodes = this.nodes.length; - - this.updateBBox(); - - this._k = 0.4 * this.scaling * Math.sqrt(this.width * this.height / nNodes); - - if (this.barnesHutOptimize) { - this._rootRegion.setBBox( - this.bbox[0], this.bbox[1], - this.bbox[2], this.bbox[3] - ); - this._rootRegion.beforeUpdate(); - for (var i = 0; i < nNodes; i++) { - this._rootRegion.addNode(this.nodes[i]); - } - this._rootRegion.afterUpdate(); - } else { - // Update center of mass of whole graph - var mass = 0; - var centerOfMass = this._rootRegion.centerOfMass; - vec2.set(centerOfMass, 0, 0); - for (var i = 0; i < nNodes; i++) { - var node = this.nodes[i]; - mass += node.mass; - vec2.scaleAndAdd(centerOfMass, centerOfMass, node.position, node.mass); - } - vec2.scale(centerOfMass, centerOfMass, 1 / mass); - } - - // Reset forces - for (var i = 0; i < nNodes; i++) { - var node = this.nodes[i]; - vec2.copy(node.forcePrev, node.force); - vec2.copy(node.speedPrev, node.speed); - vec2.set(node.force, 0, 0); - } - - // Compute forces - // Repulsion - for (var i = 0; i < nNodes; i++) { - var na = this.nodes[i]; - if (this.barnesHutOptimize) { - this.applyRegionToNodeRepulsion(this._rootRegion, na); - } else { - for (var j = i + 1; j < nNodes; j++) { - var nb = this.nodes[j]; - this.applyNodeToNodeRepulsion(na, nb, false); - } - } - - // Gravity - if (this.gravity > 0) { - this.applyNodeGravity(na); - } - } - - // Attraction - for (var i = 0; i < this.edges.length; i++) { - this.applyEdgeAttraction(this.edges[i]); - } - - // Apply forces - // var speed = vec2.create(); - var v = vec2.create(); - for (var i = 0; i < nNodes; i++) { - var node = this.nodes[i]; - var speed = node.speed; - - // var swing = vec2.dist(node.force, node.forcePrev); - // // var swing = 30; - // vec2.scale(node.force, node.force, 1 / (1 + Math.sqrt(swing))); - vec2.scale(node.force, node.force, 1 / 30); - - // contraint force - var df = vec2.len(node.force) + 0.1; - var scale = Math.min(df, 500.0) / df; - vec2.scale(node.force, node.force, scale); - - vec2.add(speed, speed, node.force); - - vec2.scale(speed, speed, this.temperature); - - // Prevent swinging - // Limited the increase of speed up to 100% each step - // TODO adjust by nodes number - vec2.sub(v, speed, node.speedPrev); - var swing = vec2.len(v); - if (swing > 0) { - vec2.scale(v, v, 1 / swing); - var base = vec2.len(node.speedPrev); - if (base > 0) { - swing = Math.min(swing / base, this.maxSpeedIncrease) * base; - vec2.scaleAndAdd(speed, node.speedPrev, v, swing); - } - } - - // constraint speed - var ds = vec2.len(speed); - var scale = Math.min(ds, 100.0) / (ds + 0.1); - vec2.scale(speed, speed, scale); - - vec2.add(node.position, node.position, speed); - } - }; - - ForceLayout.prototype.applyRegionToNodeRepulsion = (function() { - var v = vec2.create(); - return function applyRegionToNodeRepulsion(region, node) { - if (region.node) { // Region is a leaf - this.applyNodeToNodeRepulsion(region.node, node, true); - } else { - vec2.sub(v, node.position, region.centerOfMass); - var d2 = v[0] * v[0] + v[1] * v[1]; - if (d2 > this.barnesHutTheta * region.size * region.size) { - var factor = this._k * this._k * (node.mass + region.mass) / (d2 + 1); - vec2.scaleAndAdd(node.force, node.force, v, factor * 2); - } else { - for (var i = 0; i < region.nSubRegions; i++) { - this.applyRegionToNodeRepulsion(region.subRegions[i], node); - } - } - } - }; - })(); - - ForceLayout.prototype.applyNodeToNodeRepulsion = (function() { - var v = vec2.create(); - return function applyNodeToNodeRepulsion(na, nb, oneWay) { - if (na == nb) { - return; - } - vec2.sub(v, na.position, nb.position); - var d2 = v[0] * v[0] + v[1] * v[1]; - - // PENDING - if (d2 === 0) { - return; - } - - var factor; - var k2 = this._k * this._k; - var mass = na.mass + nb.mass; - - if (this.preventOverlap) { - var d = Math.sqrt(d2); - d = d - na.size - nb.size; - if (d > 0) { - factor = k2 * mass / (d * d); - } else if (d <= 0) { - // A stronger repulsion if overlap - factor = k2 * 10 * mass; - } - } else { - // Divide factor by an extra `d` to normalize the `v` - factor = k2 * mass / d2; - } - - if (!oneWay) { - vec2.scaleAndAdd(na.force, na.force, v, factor * 2); - } - vec2.scaleAndAdd(nb.force, nb.force, v, -factor * 2); - }; - })(); - - ForceLayout.prototype.applyEdgeAttraction = (function() { - var v = vec2.create(); - return function applyEdgeAttraction(edge) { - var na = edge.source; - var nb = edge.target; - - vec2.sub(v, na.position, nb.position); - var d = vec2.len(v); - - var w; - if (this.edgeWeightInfluence === 0) { - w = 1; - } else if (this.edgeWeightInfluence == 1) { - w = edge.weight; - } else { - w = Math.pow(edge.weight, this.edgeWeightInfluence); - } - - var factor; - - if (this.preventOverlap) { - d = d - na.size - nb.size; - if (d <= 0) { - // No attraction - return; - } - } - - var factor = -w * d / this._k; - - vec2.scaleAndAdd(na.force, na.force, v, factor); - vec2.scaleAndAdd(nb.force, nb.force, v, -factor); - }; - })(); - - ForceLayout.prototype.applyNodeGravity = (function() { - var v = vec2.create(); - return function(node) { - // PENDING Move to centerOfMass or [0, 0] ? - // vec2.sub(v, this._rootRegion.centerOfMass, node.position); - // vec2.negate(v, node.position); - vec2.sub(v, this.center, node.position); - if (this.width > this.height) { - // Stronger gravity on y axis - v[1] *= this.width / this.height; - } else { - // Stronger gravity on x axis - v[0] *= this.height / this.width; - } - var d = vec2.len(v) / 100; - - if (this.strongGravity) { - vec2.scaleAndAdd(node.force, node.force, v, d * this.gravity * node.mass); - } else { - vec2.scaleAndAdd(node.force, node.force, v, this.gravity * node.mass / (d + 1)); - } - }; - })(); - - ForceLayout.prototype.updateBBox = function() { - var minX = Infinity; - var minY = Infinity; - var maxX = -Infinity; - var maxY = -Infinity; - for (var i = 0; i < this.nodes.length; i++) { - var pos = this.nodes[i].position; - minX = Math.min(minX, pos[0]); - minY = Math.min(minY, pos[1]); - maxX = Math.max(maxX, pos[0]); - maxY = Math.max(maxY, pos[1]); - } - this.bbox[0] = minX; - this.bbox[1] = minY; - this.bbox[2] = maxX; - this.bbox[3] = maxY; - }; - - ForceLayout.getWorkerCode = function() { - var str = __echartsForceLayoutWorker.toString(); - return str.slice(str.indexOf('{') + 1, str.lastIndexOf('return')); - }; - - /**************************** - * Main process - ***************************/ - - if (inWorker) { - var forceLayout = null; - - self.onmessage = function(e) { - // Position read back - if (e.data instanceof ArrayBuffer) { - if (!forceLayout) { - return; - } - var positionArr = new Float32Array(e.data); - var nNodes = (positionArr.length - 1) / 2; - for (var i = 0; i < nNodes; i++) { - var node = forceLayout.nodes[i]; - node.position[0] = positionArr[i * 2 + 1]; - node.position[1] = positionArr[i * 2 + 2]; - } - return; - } - - switch(e.data.cmd) { - case 'init': - if (!forceLayout) { - forceLayout = new ForceLayout(); - } - forceLayout.initNodes(e.data.nodesPosition, e.data.nodesMass, e.data.nodesSize); - forceLayout.initEdges(e.data.edges, e.data.edgesWeight); - forceLayout._token = e.data.token; - break; - case 'updateConfig': - if (forceLayout) { - for (var name in e.data.config) { - forceLayout[name] = e.data.config[name]; - } - } - break; - case 'update': - var steps = e.data.steps; - - if (forceLayout) { - var nNodes = forceLayout.nodes.length; - var positionArr = new Float32Array(nNodes * 2 + 1); - - forceLayout.temperature = e.data.temperature; - - if (e.data.temperature > 0.01) { - for (var i = 0; i < steps; i++) { - forceLayout.update(); - forceLayout.temperature *= e.data.coolDown; - } - // Callback - for (var i = 0; i < nNodes; i++) { - var node = forceLayout.nodes[i]; - positionArr[i * 2 + 1] = node.position[0]; - positionArr[i * 2 + 2] = node.position[1]; - } - - positionArr[0] = forceLayout._token; - } - - self.postMessage(positionArr.buffer, [positionArr.buffer]); - } else { - // Not initialzied yet - var emptyArr = new Float32Array(); - // Post transfer object - self.postMessage(emptyArr.buffer, [emptyArr.buffer]); - } - break; - } - }; - } - - return ForceLayout; -}); -/** - * echarts图表类:力导向图 - * - * @author pissang (https://github.com/pissang/) - * - */ - -define('echarts/chart/force',['require','../component/base','./base','./forceLayoutWorker','zrender/shape/Line','../util/shape/Icon','../config','../util/ecData','zrender/tool/util','zrender/config','zrender/tool/vector','../util/ndarray','../chart'],function (require) { - - - var ComponentBase = require('../component/base'); - var ChartBase = require('./base'); - - var ForceLayout = require('./forceLayoutWorker'); - - // 图形依赖 - var LineShape = require('zrender/shape/Line'); - var IconShape = require('../util/shape/Icon'); - - var ecConfig = require('../config'); - var ecData = require('../util/ecData'); - var zrUtil = require('zrender/tool/util'); - var zrConfig = require('zrender/config'); - var vec2 = require('zrender/tool/vector'); - - var NDArray = require('../util/ndarray'); - var ArrayCtor = typeof(Float32Array) == 'undefined' ? Array : Float32Array; - - var requestAnimationFrame = window.requestAnimationFrame - || window.msRequestAnimationFrame - || window.mozRequestAnimationFrame - || window.webkitRequestAnimationFrame - || function (func){setTimeout(func, 16);}; - - // Use inline web worker - var workerUrl; - if ( - typeof(Worker) !== 'undefined' && - typeof(Blob) !== 'undefined' - ) { - try { - var blob = new Blob([ForceLayout.getWorkerCode()]); - workerUrl = window.URL.createObjectURL(blob); - } catch(e) { - workerUrl = ''; - } - } - - function getToken() { - return Math.round(new Date().getTime() / 100) % 10000000; - } - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} series 数据 - * @param {Object} component 组件 - */ - function Force(ecTheme, messageCenter, zr, option, myChart) { - var self = this; - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); - // 图表基类 - ChartBase.call(this); - - // 保存节点的位置,改变数据时能够有更好的动画效果 - // TODO - this.__nodePositionMap = {}; - - this._nodeShapes = []; - this._linkShapes = []; - - this._updating = true; - - this._filteredNodes = null; - this._filteredLinks = null; - this._rawNodes = null; - this._rawLinks = null; - - this._steps = 1; - this._coolDown = 0.99; - - // 关闭可拖拽属性 - this.ondragstart = function() { - ondragstart.apply(self, arguments); - }; - this.ondragend = function() { - ondragend.apply(self, arguments); - }; - this.ondrop = function() {}; - this.shapeHandler.ondragstart = function() { - self.isDragstart = true; - }; - this.onmousemove = function() { - onmousemove.apply(self, arguments); - }; - this._init(); - } - - /** - * 绘制图形 - */ - Force.prototype = { - - constructor: Force, - - type : ecConfig.CHART_TYPE_FORCE, - - _init: function() { - var self = this; - - this.clear(); - - this._updating = true; - - this._buildShape(); - - if (this._layoutWorker) { - this._layoutWorker.onmessage = function(e) { - if (self._temperature < 0.01) { - requestAnimationFrame(function() { - self._step.call(self, e); - }); - } else { - self._step.call(self, e); - } - }; - - this._layoutWorker.postMessage({ - cmd: 'update', - steps: this._steps, - temperature: this._temperature, - coolDown: this._coolDown - }); - } - else { - var cb = function() { - if (self._updating) { - self._step(); - requestAnimationFrame(cb); - } - }; - - requestAnimationFrame(cb); - } - }, - - _buildShape: function() { - var legend = this.component.legend; - var series = this.series; - var serieName; - - this._temperature = 1; - - this.shapeList.length = 0; - - for (var i = 0, l = series.length; i < l; i++) { - var serie = series[i]; - if (serie.type === ecConfig.CHART_TYPE_FORCE) { - series[i] = this.reformOption(series[i]); - serieName = series[i].name || ''; - - if (workerUrl && serie.useWorker) { - try { - if (!this._layoutWorker) { - this._layoutWorker = new Worker(workerUrl); - } - this._layout = null; - } catch(e) { // IE10-11 will throw security error when using blog url - this._layoutWorker = null; - if (!this._layout) { - this._layout = new ForceLayout(); - } - } - } else { - if (!this._layout) { - this._layout = new ForceLayout(); - } - if (this._layoutWorker) { - this._layoutWorker.terminate(); - this._layoutWorker = null; - } - } - - // 系列图例开关 - this.selectedMap[serieName] = - legend ? legend.isSelected(serieName) : true; - if (!this.selectedMap[serieName]) { - continue; - } - - this.buildMark(i); - - // 同步selected状态 - var categories = serie.categories; - for (var j = 0, len = categories.length; j < len; j++) { - if (categories[j].name) { - if (legend){ - this.selectedMap[j] = - legend.isSelected(categories[j].name); - } else { - this.selectedMap[j] = true; - } - } - } - - this._preProcessData(serie); - - this._nodeShapes.length = 0; - this._linkShapes.length = 0; - - this._buildLinkShapes(serie); - this._buildNodeShapes(serie); - - this._initLayout(serie); - - this._updateLinkShapes(); - - // TODO 多个 force - this._forceSerie = serie; - break; - } - } - }, - - _preProcessData: function(serie) { - this._rawNodes = this.query(serie, 'nodes'); - this._rawLinks = zrUtil.clone(this.query(serie, 'links')); - - var filteredNodeList = []; - var filteredNodeMap = {}; - var cursor = 0; - var self = this; - this._filteredNodes = _filter(this._rawNodes, function (node, i) { - if (!node) { - return; - } - if (node.ignore) { - return; - } - var idx = -1; - if ( - typeof(node.category) == 'undefined' - || self.selectedMap[node.category] - ) { - idx = cursor++; - } - if (node.name) { - filteredNodeMap[node.name] = idx; - } - filteredNodeList[i] = idx; - - return idx >= 0; - }); - var source; - var target; - this._filteredLinks = _filter(this._rawLinks, function (link, i){ - source = link.source; - target = link.target; - var ret = true; - var idx = typeof(source) === 'string' - ? filteredNodeMap[source] // source 用 node id 表示 - : filteredNodeList[source]; // source 用 node index 表示 - if (typeof(idx) == 'undefined') { - idx = -1; - } - - if (idx >= 0) { - link.source = idx; - } else { - ret = false; - } - - var idx = typeof(target) === 'string' - ? filteredNodeMap[target] // target 用 node id 表示 - : filteredNodeList[target]; // target 用 node index 表示 - if (typeof(idx) == 'undefined') { - idx = -1; - } - - if (idx >= 0) { - link.target = idx; - } else { - ret = false; - } - // 保存原始链接中的index - link.rawIndex = i; - - return ret; - }); - }, - - _initLayout: function(serie) { - - var nodes = this._filteredNodes; - var links = this._filteredLinks; - var shapes = this._nodeShapes; - var len = nodes.length; - - var minRadius = this.query(serie, 'minRadius'); - var maxRadius = this.query(serie, 'maxRadius'); - this._steps = serie.steps || 1; - this._coolDown = serie.coolDown || 0.99; - - var center = this.parseCenter(this.zr, serie.center); - var width = this.parsePercent(serie.size, this.zr.getWidth()); - var height = this.parsePercent(serie.size, this.zr.getHeight()); - var size = Math.min(width, height); - - // 将值映射到minRadius-maxRadius的范围上 - var radius = []; - for (var i = 0; i < len; i++) { - var node = nodes[i]; - radius.push(node.value || 1); - } - - var arr = new NDArray(radius); - radius = arr.map(minRadius, maxRadius).toArray(); - var max = arr.max(); - if (max === 0) { - return; - } - var massArr = arr.mul(1/max, arr).toArray(); - var positionArr = new ArrayCtor(len * 2); - - for (var i = 0; i < len; i++) { - var initPos; - var node = nodes[i]; - if (typeof(this.__nodePositionMap[node.name]) !== 'undefined') { - initPos = vec2.create(); - vec2.copy(initPos, this.__nodePositionMap[node.name]); - } else if (typeof(node.initial) !== 'undefined') { - initPos = Array.prototype.slice.call(node.initial); - } else { - initPos = _randomInSquare( - center[0], center[1], size * 0.8 - ); - } - var style = shapes[i].style; - style.width = style.width || (radius[i] * 2); - style.height = style.height || (radius[i] * 2); - style.x = -style.width / 2; - style.y = -style.height / 2; - shapes[i].position = initPos; - - positionArr[i * 2] = initPos[0]; - positionArr[i * 2 + 1] = initPos[1]; - } - - len = links.length; - var edgeArr = new ArrayCtor(len * 2); - var edgeWeightArr = new ArrayCtor(len); - for (var i = 0; i < len; i++) { - var link = links[i]; - edgeArr[i * 2] = link.source; - edgeArr[i * 2 + 1] = link.target; - edgeWeightArr[i] = link.weight || 1; - } - - arr = new NDArray(edgeWeightArr); - var max = arr.max(); - if (max === 0) { - return; - } - var edgeWeightArr = arr.mul(1 / max, arr)._array; - - var config = { - center: center, - width: serie.ratioScaling ? width : size, - height: serie.ratioScaling ? height : size, - scaling: serie.scaling || 1.0, - gravity: serie.gravity || 1.0, - barnesHutOptimize: serie.large - }; - - if (this._layoutWorker) { - - this._token = getToken(); - - this._layoutWorker.postMessage({ - cmd: 'init', - nodesPosition: positionArr, - nodesMass: massArr, - nodesSize: radius, - edges: edgeArr, - edgesWeight: edgeWeightArr, - token: this._token - }); - - this._layoutWorker.postMessage({ - cmd: 'updateConfig', - config: config - }); - - } else { - - zrUtil.merge(this._layout, config, true); - this._layout.initNodes(positionArr, massArr, radius); - this._layout.initEdges(edgeArr, edgeWeightArr); - } - }, - - _buildNodeShapes: function(serie) { - var categories = this.query(serie, 'categories'); - var nodes = this._filteredNodes; - var len = nodes.length; - var legend = this.component.legend; - - for (var i = 0; i < len; i++) { - var node = nodes[i]; - - var shape = new IconShape({ - style : { - x : 0, - y : 0 - }, - clickable : true, - highlightStyle : {} - }); - - var queryTarget = []; - var shapeNormalStyle = []; - var shapeEmphasisStyle = []; - - queryTarget.push(node); - if (node.itemStyle) { - shapeNormalStyle.push(node.itemStyle.normal); - shapeEmphasisStyle.push(node.itemStyle.emphasis); - } - if (typeof(node.category) !== 'undefined') { - var category = categories[node.category]; - if (category) { - // 使用 Legend.getColor 配置默认 category 的默认颜色 - category.itemStyle = category.itemStyle || {}; - category.itemStyle.normal = category.itemStyle.normal || {}; - category.itemStyle.normal.color = category.itemStyle.normal.color - || legend.getColor(category.name); - - queryTarget.push(category); - shapeNormalStyle.unshift(category.itemStyle.normal); - shapeEmphasisStyle.unshift(category.itemStyle.emphasis); - } - } - queryTarget.push(serie); - shapeNormalStyle.unshift(serie.itemStyle.normal.nodeStyle); - shapeEmphasisStyle.unshift(serie.itemStyle.emphasis.nodeStyle); - - shape.style.iconType = this.deepQuery(queryTarget, 'symbol'); - // 强制设定节点大小,否则默认映射到 minRadius 到 maxRadius 后的值 - shape.style.width = shape.style.height - = (this.deepQuery(queryTarget, 'symbolSize') || 0) * 2; - - // 节点样式 - for (var k = 0; k < shapeNormalStyle.length; k++) { - if (shapeNormalStyle[k]) { - zrUtil.merge(shape.style, shapeNormalStyle[k], true); - } - } - // 节点高亮样式 - for (var k = 0; k < shapeEmphasisStyle.length; k++) { - if (shapeEmphasisStyle[k]) { - zrUtil.merge(shape.highlightStyle, shapeEmphasisStyle[k], true); - } - } - - // 节点标签样式 - if (this.deepQuery(queryTarget, 'itemStyle.normal.label.show')) { - shape.style.text = node.name; - shape.style.textPosition = 'inside'; - var labelStyle = this.deepQuery( - queryTarget, 'itemStyle.normal.label.textStyle' - ) || {}; - shape.style.textColor = labelStyle.color || '#fff'; - shape.style.textAlign = labelStyle.align || 'center'; - shape.style.textBaseline = labelStyle.baseline || 'middle'; - shape.style.textFont = this.getFont(labelStyle); - } - - if (this.deepQuery(queryTarget, 'itemStyle.emphasis.label.show')) { - shape.highlightStyle.text = node.name; - shape.highlightStyle.textPosition = 'inside'; - var labelStyle = this.deepQuery( - queryTarget, 'itemStyle.emphasis.label.textStyle' - ) || {}; - shape.highlightStyle.textColor = labelStyle.color || '#fff'; - shape.highlightStyle.textAlign = labelStyle.align || 'center'; - shape.highlightStyle.textBaseline = labelStyle.baseline || 'middle'; - shape.highlightStyle.textFont = this.getFont(labelStyle); - } - - // 拖拽特性 - if (this.deepQuery(queryTarget, 'draggable')) { - this.setCalculable(shape); - shape.dragEnableTime = 0; - shape.draggable = true; - shape.ondragstart = this.shapeHandler.ondragstart; - shape.ondragover = null; - } - - var categoryName = ''; - if (typeof(node.category) !== 'undefined') { - var category = categories[node.category]; - categoryName = (category && category.name) || ''; - } - // !!Pack data before addShape - ecData.pack( - shape, - // category - { - name : categoryName - }, - // series index - 0, - // data - node, - // data index - zrUtil.indexOf(this._rawNodes, node), - // name - node.name || '', - // value - node.value - ); - - this._nodeShapes.push(shape); - this.shapeList.push(shape); - this.zr.addShape(shape); - } - }, - - _buildLinkShapes: function(serie) { - - var nodes = this._filteredNodes; - var links = this._filteredLinks; - var len = links.length; - - for (var i = 0; i < len; i++) { - var link = links[i]; - var source = nodes[link.source]; - var target = nodes[link.target]; - - var linkShape = new LineShape({ - style : { - xStart : 0, - yStart : 0, - xEnd : 0, - yEnd : 0, - lineWidth : 1 - }, - clickable : true, - highlightStyle : {} - }); - - zrUtil.merge( - linkShape.style, - this.query(serie, 'itemStyle.normal.linkStyle'), - true - ); - zrUtil.merge( - linkShape.highlightStyle, - this.query(serie, 'itemStyle.emphasis.linkStyle'), - true - ); - if (typeof(link.itemStyle) !== 'undefined') { - if(link.itemStyle.normal){ - zrUtil.merge(linkShape.style, link.itemStyle.normal, true); - } - if(link.itemStyle.emphasis){ - zrUtil.merge( - linkShape.highlightStyle, - link.itemStyle.emphasis, - true - ); - } - } - - var link = this._rawLinks[link.rawIndex]; - ecData.pack( - linkShape, - // serie - serie, - // serie index - 0, - // link data - { - source : link.source, - target : link.target, - weight : link.weight || 0 - }, - // link data index - link.rawIndex, - // source name - target name - source.name + ' - ' + target.name, - // link weight - link.weight || 0, - // special - // 这一项只是为了表明这是条边 - true - ); - - this._linkShapes.push(linkShape); - this.shapeList.push(linkShape); - this.zr.addShape(linkShape); - - // Arrow shape - if (serie.linkSymbol && serie.linkSymbol !== 'none') { - var symbolShape = new IconShape({ - style: { - x: -5, - y: 0, - width: serie.linkSymbolSize[0], - height: serie.linkSymbolSize[1], - iconType: serie.linkSymbol, - brushType: 'fill', - // Use same style with link shape - color: linkShape.style.strokeColor, - opacity: linkShape.style.opacity, - shadowBlur: linkShape.style.shadowBlur, - shadowColor: linkShape.style.shadowColor, - shadowOffsetX: linkShape.style.shadowOffsetX, - shadowOffsetY: linkShape.style.shadowOffsetY - }, - highlightStyle: { - brushType: 'fill' - }, - position: [0, 0], - rotation: 0 - }); - linkShape._symbolShape = symbolShape; - this.shapeList.push(symbolShape); - this.zr.addShape(symbolShape); - } - } - }, - - _updateLinkShapes: function() { - var v = vec2.create(); - var links = this._filteredLinks; - for (var i = 0, len = links.length; i < len; i++) { - var link = links[i]; - var linkShape = this._linkShapes[i]; - var sourceShape = this._nodeShapes[link.source]; - var targetShape = this._nodeShapes[link.target]; - - linkShape.style.xStart = sourceShape.position[0]; - linkShape.style.yStart = sourceShape.position[1]; - linkShape.style.xEnd = targetShape.position[0]; - linkShape.style.yEnd = targetShape.position[1]; - - this.zr.modShape(linkShape.id); - - if (linkShape._symbolShape) { - var symbolShape = linkShape._symbolShape; - vec2.copy(symbolShape.position, targetShape.position); - - vec2.sub(v, sourceShape.position, targetShape.position); - vec2.normalize(v, v); - - vec2.scaleAndAdd( - symbolShape.position, symbolShape.position, - v, targetShape.style.width / 2 + 2 - ); - - var angle; - if (v[1] < 0) { - angle = 2 * Math.PI - Math.acos(-v[0]); - } else { - angle = Math.acos(-v[0]); - } - symbolShape.rotation = angle - Math.PI / 2; - - this.zr.modShape(symbolShape.id); - } - } - }, - - _update: function(e) { - - this._layout.temperature = this._temperature; - this._layout.update(); - - for (var i = 0; i < this._layout.nodes.length; i++) { - var position = this._layout.nodes[i].position; - var shape = this._nodeShapes[i]; - var node = this._filteredNodes[i]; - if (shape.fixed || (node.fixX && node.fixY)) { - vec2.copy(position, shape.position); - } else if (node.fixX) { - position[0] = shape.position[0]; - shape.position[1] = position[1]; - } else if (node.fixY) { - position[1] = shape.position[1]; - shape.position[0] = position[0]; - } else { - vec2.copy(shape.position, position); - } - - var nodeName = node.name; - if (nodeName) { - var gPos = this.__nodePositionMap[nodeName]; - if (!gPos) { - gPos = this.__nodePositionMap[nodeName] = vec2.create(); - } - vec2.copy(gPos, position); - } - } - - this._temperature *= this._coolDown; - }, - - _updateWorker: function(e) { - if (!this._updating) { - return; - } - - var positionArr = new Float32Array(e.data); - var token = positionArr[0]; - var ret = token === this._token; - // If token is from current layout instance - if (ret) { - var nNodes = (positionArr.length - 1) / 2; - - for (var i = 0; i < nNodes; i++) { - var shape = this._nodeShapes[i]; - var node = this._filteredNodes[i]; - - var x = positionArr[i * 2 + 1]; - var y = positionArr[i * 2 + 2]; - - if (shape.fixed || (node.fixX && node.fixY)) { - positionArr[i * 2 + 1] = shape.position[0]; - positionArr[i * 2 + 2] = shape.position[1]; - } else if (node.fixX) { - positionArr[i * 2 + 1] = shape.position[0]; - shape.position[1] = y; - } else if (node.fixY) { - positionArr[i * 2 + 2] = shape.position[1]; - shape.position[0] = x; - } else { - shape.position[0] = x; - shape.position[1] = y; - } - - var nodeName = node.name; - if (nodeName) { - var gPos = this.__nodePositionMap[nodeName]; - if (!gPos) { - gPos = this.__nodePositionMap[nodeName] = vec2.create(); - } - vec2.copy(gPos, shape.position); - } - } - - this._layoutWorker.postMessage(positionArr.buffer, [positionArr.buffer]); - } - - var self = this; - self._layoutWorker.postMessage({ - cmd: 'update', - steps: this._steps, - temperature: this._temperature, - coolDown: this._coolDown - }); - - for (var i = 0; i < this._steps; i++) { - this._temperature *= this._coolDown; - } - - return ret; - }, - - _step: function(e){ - if (this._layoutWorker) { - var res = this._updateWorker(e); - if (!res) { - return; - } - } else { - if (this._temperature < 0.01) { - return; - } - this._update(); - } - - this._updateLinkShapes(); - - for (var i = 0; i < this._nodeShapes.length; i++) { - this.zr.modShape(this._nodeShapes[i].id); - } - - this.zr.refresh(); - }, - - refresh: function(newOption) { - if (newOption) { - this.option = newOption; - this.series = this.option.series; - } - this.clear(); - this._buildShape(); - }, - - dispose: function(){ - this._updating = false; - this.clear(); - this.shapeList = null; - this.effectList = null; - - if (this._layoutWorker) { - this._layoutWorker.terminate(); - } - this._layoutWorker = null; - - this.__nodePositionMap = {}; - } - }; - - /** - * 拖拽开始 - */ - function ondragstart(param) { - if (!this.isDragstart || !param.target) { - // 没有在当前实例上发生拖拽行为则直接返回 - return; - } - - var shape = param.target; - shape.fixed = true; - - // 处理完拖拽事件后复位 - this.isDragstart = false; - - this.zr.on(zrConfig.EVENT.MOUSEMOVE, this.onmousemove); - } - - function onmousemove() { - this._temperature = 0.8; - } - - /** - * 数据项被拖拽出去,重载基类方法 - */ - function ondragend(param, status) { - if (!this.isDragend || !param.target) { - // 没有在当前实例上发生拖拽行为则直接返回 - return; - } - var shape = param.target; - shape.fixed = false; - - // 别status = {}赋值啊!! - status.dragIn = true; - //你自己refresh的话把他设为false,设true就会重新调refresh接口 - status.needRefresh = false; - - // 处理完拖拽事件后复位 - this.isDragend = false; - - this.zr.un(zrConfig.EVENT.MOUSEMOVE, this.onmousemove); - } - - function _randomInSquare(x, y, size) { - return [ - (Math.random() - 0.5) * size + x, - (Math.random() - 0.5) * size + y - ]; - } - - function _filter(array, callback){ - var len = array.length; - var result = []; - for(var i = 0; i < len; i++){ - if(callback(array[i], i)){ - result.push(array[i]); - } - } - return result; - } - - zrUtil.inherits(Force, ChartBase); - zrUtil.inherits(Force, ComponentBase); - - // 图表注册 - require('../chart').define('force', Force); - - return Force; +/** + * echarts默认配置项 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/config',[],function() { + // 请原谅我这样写,这显然可以直接返回个对象,但那样的话outline就显示不出来了~~ + var config = { + // 图表类型 + CHART_TYPE_LINE: 'line', + CHART_TYPE_BAR: 'bar', + CHART_TYPE_SCATTER: 'scatter', + CHART_TYPE_PIE: 'pie', + CHART_TYPE_RADAR: 'radar', + CHART_TYPE_MAP: 'map', + CHART_TYPE_K: 'k', + CHART_TYPE_ISLAND: 'island', + CHART_TYPE_FORCE: 'force', + CHART_TYPE_CHORD: 'chord', + CHART_TYPE_GAUGE: 'gauge', + CHART_TYPE_FUNNEL: 'funnel', + + // 组件类型 + COMPONENT_TYPE_TITLE: 'title', + COMPONENT_TYPE_LEGEND: 'legend', + COMPONENT_TYPE_DATARANGE: 'dataRange', + COMPONENT_TYPE_DATAVIEW: 'dataView', + COMPONENT_TYPE_DATAZOOM: 'dataZoom', + COMPONENT_TYPE_TOOLBOX: 'toolbox', + COMPONENT_TYPE_TOOLTIP: 'tooltip', + COMPONENT_TYPE_GRID: 'grid', + COMPONENT_TYPE_AXIS: 'axis', + COMPONENT_TYPE_POLAR: 'polar', + COMPONENT_TYPE_X_AXIS: 'xAxis', + COMPONENT_TYPE_Y_AXIS: 'yAxis', + COMPONENT_TYPE_AXIS_CATEGORY: 'categoryAxis', + COMPONENT_TYPE_AXIS_VALUE: 'valueAxis', + COMPONENT_TYPE_TIMELINE: 'timeline', + COMPONENT_TYPE_ROAMCONTROLLER: 'roamController', + + // 全图默认背景 + backgroundColor: 'rgba(0,0,0,0)', + + // 默认色板 + color: ['#ff7f50','#87cefa','#da70d6','#32cd32','#6495ed', + '#ff69b4','#ba55d3','#cd5c5c','#ffa500','#40e0d0', + '#1e90ff','#ff6347','#7b68ee','#00fa9a','#ffd700', + '#6699FF','#ff6666','#3cb371','#b8860b','#30e0e0'], + + // 图表标题 + title: { + text: '', + // link: null, // 超链接跳转 + // target: null, // 仅支持self | blank + subtext: '', + // sublink: null, // 超链接跳转 + // subtarget: null, // 仅支持self | blank + x: 'left', // 水平安放位置,默认为左对齐,可选为: + // 'center' ¦ 'left' ¦ 'right' + // ¦ {number}(x坐标,单位px) + y: 'top', // 垂直安放位置,默认为全图顶端,可选为: + // 'top' ¦ 'bottom' ¦ 'center' + // ¦ {number}(y坐标,单位px) + //textAlign: null // 水平对齐方式,默认根据x设置自动调整 + backgroundColor: 'rgba(0,0,0,0)', + borderColor: '#ccc', // 标题边框颜色 + borderWidth: 0, // 标题边框线宽,单位px,默认为0(无边框) + padding: 5, // 标题内边距,单位px,默认各方向内边距为5, + // 接受数组分别设定上右下左边距,同css + itemGap: 5, // 主副标题纵向间隔,单位px,默认为10, + textStyle: { + fontSize: 18, + fontWeight: 'bolder', + color: '#333' // 主标题文字颜色 + }, + subtextStyle: { + color: '#aaa' // 副标题文字颜色 + } + }, + + // 图例 + legend: { + orient: 'horizontal', // 布局方式,默认为水平布局,可选为: + // 'horizontal' ¦ 'vertical' + x: 'center', // 水平安放位置,默认为全图居中,可选为: + // 'center' ¦ 'left' ¦ 'right' + // ¦ {number}(x坐标,单位px) + y: 'top', // 垂直安放位置,默认为全图顶端,可选为: + // 'top' ¦ 'bottom' ¦ 'center' + // ¦ {number}(y坐标,单位px) + backgroundColor: 'rgba(0,0,0,0)', + borderColor: '#ccc', // 图例边框颜色 + borderWidth: 0, // 图例边框线宽,单位px,默认为0(无边框) + padding: 5, // 图例内边距,单位px,默认各方向内边距为5, + // 接受数组分别设定上右下左边距,同css + itemGap: 10, // 各个item之间的间隔,单位px,默认为10, + // 横向布局时为水平间隔,纵向布局时为纵向间隔 + itemWidth: 20, // 图例图形宽度 + itemHeight: 14, // 图例图形高度 + textStyle: { + color: '#333' // 图例文字颜色 + }, + selectedMode: true // 选择模式,默认开启图例开关 + // selected: null, // 配置默认选中状态,可配合LEGEND.SELECTED事件做动态数据载入 + // data: [], // 图例内容(详见legend.data,数组中每一项代表一个item + }, + + // 值域 + dataRange: { + orient: 'vertical', // 布局方式,默认为垂直布局,可选为: + // 'horizontal' ¦ 'vertical' + x: 'left', // 水平安放位置,默认为全图左对齐,可选为: + // 'center' ¦ 'left' ¦ 'right' + // ¦ {number}(x坐标,单位px) + y: 'bottom', // 垂直安放位置,默认为全图底部,可选为: + // 'top' ¦ 'bottom' ¦ 'center' + // ¦ {number}(y坐标,单位px) + backgroundColor: 'rgba(0,0,0,0)', + borderColor: '#ccc', // 值域边框颜色 + borderWidth: 0, // 值域边框线宽,单位px,默认为0(无边框) + padding: 5, // 值域内边距,单位px,默认各方向内边距为5, + // 接受数组分别设定上右下左边距,同css + itemGap: 10, // 各个item之间的间隔,单位px,默认为10, + // 横向布局时为水平间隔,纵向布局时为纵向间隔 + itemWidth: 20, // 值域图形宽度,线性渐变水平布局宽度为该值 * 10 + itemHeight: 14, // 值域图形高度,线性渐变垂直布局高度为该值 * 10 + // min: null, // 最小值 + // max: null, // 最大值 + precision: 0, // 小数精度,默认为0,无小数点 + splitNumber: 5, // 分割段数,默认为5,为0时为线性渐变 + calculable: false, // 是否值域漫游,启用后无视splitNumber,线性渐变 + realtime: true, + color:['#006edd','#e0ffff'],//颜色 + // formatter: null, + // text:['高','低'], // 文本,默认为数值文本 + textStyle: { + color: '#333' // 值域文字颜色 + } + }, + + toolbox: { + show: false, + orient: 'horizontal', // 布局方式,默认为水平布局,可选为: + // 'horizontal' ¦ 'vertical' + x: 'right', // 水平安放位置,默认为全图右对齐,可选为: + // 'center' ¦ 'left' ¦ 'right' + // ¦ {number}(x坐标,单位px) + y: 'top', // 垂直安放位置,默认为全图顶端,可选为: + // 'top' ¦ 'bottom' ¦ 'center' + // ¦ {number}(y坐标,单位px) + color: ['#1e90ff','#22bb22','#4b0082','#d2691e'], + disableColor: '#ddd', + effectiveColor: 'red', + backgroundColor: 'rgba(0,0,0,0)', // 工具箱背景颜色 + borderColor: '#ccc', // 工具箱边框颜色 + borderWidth: 0, // 工具箱边框线宽,单位px,默认为0(无边框) + padding: 5, // 工具箱内边距,单位px,默认各方向内边距为5, + // 接受数组分别设定上右下左边距,同css + itemGap: 10, // 各个item之间的间隔,单位px,默认为10, + // 横向布局时为水平间隔,纵向布局时为纵向间隔 + itemSize: 16, // 工具箱图形宽度 + showTitle: true, + // textStyle: { }, + feature: { + mark: { + show: false, + title: { + mark: '辅助线开关', + markUndo: '删除辅助线', + markClear: '清空辅助线' + }, + lineStyle: { + width: 1, + color: '#1e90ff', + type: 'dashed' + } + }, + dataZoom: { + show: false, + title: { + dataZoom: '区域缩放', + dataZoomReset: '区域缩放后退' + } + }, + dataView: { + show: false, + title: '数据视图', + readOnly: false, + lang: ['Data View', 'close', 'refresh'] + }, + magicType: { + show: false, + title: { + line: '折线图切换', + bar: '柱形图切换', + stack: '堆积', + tiled: '平铺' + }, + type: [ ] // 'line', 'bar', 'stack', 'tiled' + }, + restore: { + show: false, + title: '还原' + }, + saveAsImage: { + show: false, + title: '保存为图片', + type: 'png', + lang: ['点击保存'] + } + } + }, + + // 提示框 + tooltip: { + show: true, + showContent: true, // tooltip主体内容 + trigger: 'item', // 触发类型,默认数据触发,见下图,可选为:'item' ¦ 'axis' + // position: null // 位置 {Array} | {Function} + // formatter: null // 内容格式器:{string}(Template) ¦ {Function} + islandFormatter: '{a}
{b} : {c}', // 数据孤岛内容格式器 + showDelay: 20, // 显示延迟,添加显示延迟可以避免频繁切换,单位ms + hideDelay: 100, // 隐藏延迟,单位ms + transitionDuration: 0.4, // 动画变换时间,单位s + backgroundColor: 'rgba(0,0,0,0.7)', // 提示背景颜色,默认为透明度为0.7的黑色 + borderColor: '#333', // 提示边框颜色 + borderRadius: 4, // 提示边框圆角,单位px,默认为4 + borderWidth: 0, // 提示边框线宽,单位px,默认为0(无边框) + padding: 5, // 提示内边距,单位px,默认各方向内边距为5, + // 接受数组分别设定上右下左边距,同css + axisPointer: { // 坐标轴指示器,坐标轴触发有效 + type: 'line', // 默认为直线,可选为:'line' | 'shadow' | 'cross' + lineStyle: { // 直线指示器样式设置 + color: '#48b', + width: 2, + type: 'solid' + }, + crossStyle: { + color: '#1e90ff', + width: 1, + type: 'dashed' + }, + shadowStyle: { // 阴影指示器样式设置 + color: 'rgba(150,150,150,0.3)', // 阴影颜色 + width: 'auto', // 阴影大小 + type: 'default' + } + }, + textStyle: { + color: '#fff' + } + }, + + // 区域缩放控制器 + dataZoom: { + show: false, + orient: 'horizontal', // 布局方式,默认为水平布局,可选为: + // 'horizontal' ¦ 'vertical' + // x: {number}, // 水平安放位置,默认为根据grid参数适配,可选为: + // {number}(x坐标,单位px) + // y: {number}, // 垂直安放位置,默认为根据grid参数适配,可选为: + // {number}(y坐标,单位px) + // width: {number}, // 指定宽度,横向布局时默认为根据grid参数适配 + // height: {number}, // 指定高度,纵向布局时默认为根据grid参数适配 + backgroundColor: 'rgba(0,0,0,0)', // 背景颜色 + dataBackgroundColor: '#eee', // 数据背景颜色 + fillerColor: 'rgba(144,197,237,0.2)', // 填充颜色 + handleColor: 'rgba(70,130,180,0.8)', // 手柄颜色 + // xAxisIndex: [], // 默认控制所有横向类目 + // yAxisIndex: [], // 默认控制所有横向类目 + // start: 0, // 默认为0 + // end: 100, // 默认为全部 100% + realtime: true + // zoomLock: false // 是否锁定选择区域大小 + }, + + // 网格 + grid: { + x: 80, + y: 60, + x2: 80, + y2: 60, + // width: {totalWidth} - x - x2, + // height: {totalHeight} - y - y2, + backgroundColor: 'rgba(0,0,0,0)', + borderWidth: 1, + borderColor: '#ccc' + }, + + // 类目轴 + categoryAxis: { + position: 'bottom', // 位置 + name: '', // 坐标轴名字,默认为空 + nameLocation: 'end', // 坐标轴名字位置,支持'start' | 'end' + nameTextStyle: {}, // 坐标轴文字样式,默认取全局样式 + boundaryGap: true, // 类目起始和结束两端空白策略 + axisLine: { // 坐标轴线 + show: true, // 默认显示,属性show控制显示与否 + onZero: true, + lineStyle: { // 属性lineStyle控制线条样式 + color: '#48b', + width: 2, + type: 'solid' + } + }, + axisTick: { // 坐标轴小标记 + show: true, // 属性show控制显示与否,默认不显示 + interval: 'auto', + inside: false, // 控制小标记是否在grid里 + // onGap: null, + length :5, // 属性length控制线长 + lineStyle: { // 属性lineStyle控制线条样式 + color: '#333', + width: 1 + } + }, + axisLabel: { // 坐标轴文本标签,详见axis.axisLabel + show: true, + interval: 'auto', + rotate: 0, + margin: 8, + // clickable: false, + // formatter: null, + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: '#333' + } + }, + splitLine: { // 分隔线 + show: true, // 默认显示,属性show控制显示与否 + // onGap: null, + lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 + color: ['#ccc'], + width: 1, + type: 'solid' + } + }, + splitArea: { // 分隔区域 + show: false, // 默认不显示,属性show控制显示与否 + // onGap: null, + areaStyle: { // 属性areaStyle(详见areaStyle)控制区域样式 + color: ['rgba(250,250,250,0.3)','rgba(200,200,200,0.3)'] + } + } + }, + + // 数值型坐标轴默认参数 + valueAxis: { + position: 'left', // 位置 + name: '', // 坐标轴名字,默认为空 + nameLocation: 'end', // 坐标轴名字位置,支持'start' | 'end' + nameTextStyle: {}, // 坐标轴文字样式,默认取全局样式 + boundaryGap: [0, 0], // 数值起始和结束两端空白策略 + // min: null, // 最小值 + // max: null, // 最大值 + // scale: false, // 脱离0值比例,放大聚焦到最终_min,_max区间 + precision: 0, // 小数精度,默认为0,无小数点 + power: 100, // 整数精度,默认为100,个位和百位为0 + splitNumber: 5, // 分割段数,默认为5 + axisLine: { // 坐标轴线 + show: true, // 默认显示,属性show控制显示与否 + onZero: true, + lineStyle: { // 属性lineStyle控制线条样式 + color: '#48b', + width: 2, + type: 'solid' + } + }, + axisTick: { // 坐标轴小标记 + show: false, // 属性show控制显示与否,默认不显示 + inside: false, // 控制小标记是否在grid里 + length :5, // 属性length控制线长 + lineStyle: { // 属性lineStyle控制线条样式 + color: '#333', + width: 1 + } + }, + axisLabel: { // 坐标轴文本标签,详见axis.axisLabel + show: true, + rotate: 0, + margin: 8, + // clickable: false, + // formatter: null, + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: '#333' + } + }, + splitLine: { // 分隔线 + show: true, // 默认显示,属性show控制显示与否 + lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 + color: ['#ccc'], + width: 1, + type: 'solid' + } + }, + splitArea: { // 分隔区域 + show: false, // 默认不显示,属性show控制显示与否 + areaStyle: { // 属性areaStyle(详见areaStyle)控制区域样式 + color: ['rgba(250,250,250,0.3)','rgba(200,200,200,0.3)'] + } + } + }, + + polar: { + center: ['50%', '50%'], // 默认全局居中 + radius: '75%', + startAngle: 90, + splitNumber: 5, + name: { + show: true, + // formatter: null, + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: '#333' + } + }, + axisLine: { // 坐标轴线 + show: true, // 默认显示,属性show控制显示与否 + lineStyle: { // 属性lineStyle控制线条样式 + color: '#ccc', + width: 1, + type: 'solid' + } + }, + axisLabel: { // 坐标轴文本标签,详见axis.axisLabel + show: false, + // formatter: null, + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: '#333' + } + }, + splitArea: { + show: true, + areaStyle: { + color: ['rgba(250,250,250,0.3)','rgba(200,200,200,0.3)'] + } + }, + splitLine: { + show: true, + lineStyle: { + width: 1, + color: '#ccc' + } + }, + type: 'polygon' + // indicator: [ ] + }, + + timeline: { + show: true, + type: 'time', // 模式是时间类型,支持 number + notMerge: false, + realtime: true, + x: 80, + // y: {number}, + x2: 80, + y2: 0, + // width: {totalWidth} - x - x2, + height: 50, + backgroundColor: 'rgba(0,0,0,0)', // 时间轴背景颜色 + borderColor: '#ccc', // 时间轴边框颜色 + borderWidth: 0, // 时间轴边框线宽,单位px,默认为0(无边框) + padding: 5, // 时间轴内边距,单位px,默认各方向内边距为5, + controlPosition: 'left', // 'right' | 'none' + autoPlay: false, + loop: true, + playInterval: 2000, // 播放时间间隔,单位ms + lineStyle: { + width: 1, + color: '#666', + type: 'dashed' + }, + label: { // 文本标签 + show: true, + interval: 'auto', + rotate: 0, + // formatter: null, + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: '#333' + } + }, + checkpointStyle: { + symbol: 'auto', + symbolSize: 'auto', + color: 'auto', + borderColor: 'auto', + borderWidth: 'auto', + label: { // 文本标签 + show: false, + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: 'auto' + } + } + }, + controlStyle: { + normal: { color: '#333'}, + emphasis: { color: '#1e90ff'} + }, + symbol: 'emptyDiamond', + symbolSize: 4, + currentIndex: 0 + // data: [] + }, + + roamController: { + show: false, + x: 'left', // 水平安放位置,默认为全图左对齐,可选为: + // 'center' ¦ 'left' ¦ 'right' + // ¦ {number}(x坐标,单位px) + y: 'top', // 垂直安放位置,默认为全图顶端,可选为: + // 'top' ¦ 'bottom' ¦ 'center' + // ¦ {number}(y坐标,单位px) + width: 80, + height: 120, + backgroundColor: 'rgba(0,0,0,0)', + borderColor: '#ccc', // 图例边框颜色 + borderWidth: 0, // 图例边框线宽,单位px,默认为0(无边框) + padding: 5, // 图例内边距,单位px,默认各方向内边距为5, + // 接受数组分别设定上右下左边距,同css + handlerColor: '#6495ed', + fillerColor: '#fff', + step: 15, // 移动幅度 + mapTypeControl: null + }, + + // 柱形图默认参数 + bar: { + clickable: true, + // stack: null + xAxisIndex: 0, + yAxisIndex: 0, + barMinHeight: 0, // 最小高度改为0 + // barWidth: null, // 默认自适应 + barGap: '30%', // 柱间距离,默认为柱形宽度的30%,可设固定值 + barCategoryGap: '20%', // 类目间柱形距离,默认为类目间距的20%,可设固定值 + itemStyle: { + normal: { + // color: '各异', + barBorderColor: '#fff', // 柱条边线 + barBorderRadius: 0, // 柱条边线圆角,单位px,默认为0 + barBorderWidth: 0, // 柱条边线线宽,单位px,默认为1 + label: { + show: false + // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 + // 'inside'|'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + } + }, + emphasis: { + // color: '各异', + barBorderColor: '#fff', // 柱条边线 + barBorderRadius: 0, // 柱条边线圆角,单位px,默认为0 + barBorderWidth: 0, // 柱条边线线宽,单位px,默认为1 + label: { + show: false + // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 + // 'inside'|'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + } + } + } + }, + + // 折线图默认参数 + line: { + clickable: true, + // stack: null + xAxisIndex: 0, + yAxisIndex: 0, + itemStyle: { + normal: { + // color: 各异, + label: { + show: false + // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 + // 'inside'|'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + }, + lineStyle: { + width: 2, + type: 'solid', + shadowColor: 'rgba(0,0,0,0)', //默认透明 + shadowBlur: 0, + shadowOffsetX: 0, + shadowOffsetY: 0 + } + }, + emphasis: { + // color: 各异, + label: { + show: false + // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 + // 'inside'|'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + } + } + }, + // smooth: false, + // symbol: null, // 拐点图形类型 + symbolSize: 2, // 拐点图形大小 + // symbolRotate: null, // 拐点图形旋转控制 + showAllSymbol: false // 标志图形默认只有主轴显示(随主轴标签间隔隐藏策略) + }, + + // K线图默认参数 + k: { + clickable: true, + xAxisIndex: 0, + yAxisIndex: 0, + // barWidth: null // 默认自适应 + // barMaxWidth: null // 默认自适应 + itemStyle: { + normal: { + color: '#fff', // 阳线填充颜色 + color0: '#00aa11', // 阴线填充颜色 + lineStyle: { + width: 1, + color: '#ff3200', // 阳线边框颜色 + color0: '#00aa11' // 阴线边框颜色 + } + }, + emphasis: { + // color: 各异, + // color0: 各异 + } + } + }, + + // 散点图默认参数 + scatter: { + clickable: true, + xAxisIndex: 0, + yAxisIndex: 0, + // symbol: null, // 图形类型 + symbolSize: 4, // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 + // symbolRotate: null, // 图形旋转控制 + large: false, // 大规模散点图 + largeThreshold: 2000, // 大规模阀值,large为true且数据量>largeThreshold才启用大规模模式 + itemStyle: { + normal: { + // color: 各异, + label: { + show: false, + // 标签文本格式器,同Tooltip.formatter,不支持回调 + formatter: function (a, b, c) { + if (typeof c[2] != 'undefined') { + return c[2]; + } + else { + return c[0] + ' , ' + c[1]; + } + } + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 + // 'inside'|'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + } + }, + emphasis: { + // color: '各异' + label: { + show: false, + // 标签文本格式器,同Tooltip.formatter,不支持回调 + formatter: function (a, b, c) { + if (typeof c[2] != 'undefined') { + return c[2]; + } + else { + return c[0] + ' , ' + c[1]; + } + } + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 + // 'inside'|'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + } + } + } + }, + + // 雷达图默认参数 + radar: { + clickable: true, + polarIndex: 0, + itemStyle: { + normal: { + // color: 各异, + label: { + show: false + }, + lineStyle: { + width: 2, + type: 'solid' + } + }, + emphasis: { + // color: 各异, + label: { + show: false + } + } + }, + // symbol: null, // 拐点图形类型 + symbolSize: 2 // 可计算特性参数,空数据拖拽提示图形大小 + // symbolRotate: null, // 图形旋转控制 + }, + + // 饼图默认参数 + pie: { + clickable: true, + center: ['50%', '50%'], // 默认全局居中 + radius: [0, '75%'], + clockWise: true, // 默认顺时针 + startAngle: 90, + minAngle: 0, // 最小角度改为0 + selectedOffset: 10, // 选中是扇区偏移量 + // selectedMode: false, // 选择模式,默认关闭,可选single,multiple + // roseType: null, // 南丁格尔玫瑰图模式,'radius'(半径) | 'area'(面积) + itemStyle: { + normal: { + // color: 各异, + borderColor: 'rgba(0,0,0,0)', + borderWidth: 1, + label: { + show: true, + position: 'outer' + // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + }, + labelLine: { + show: true, + length: 20, + lineStyle: { + // color: 各异, + width: 1, + type: 'solid' + } + } + }, + emphasis: { + // color: 各异, + borderColor: 'rgba(0,0,0,0)', + borderWidth: 1, + label: { + show: false + // position: 'outer' + // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + }, + labelLine: { + show: false, + length: 20, + lineStyle: { + // color: 各异, + width: 1, + type: 'solid' + } + } + } + } + }, + + map: { + mapType: 'china', // 各省的mapType暂时都用中文 + //mapLocation: { + // x: 'center' | 'left' | 'right' | 'x%' | {number}, + // y: 'center' | 'top' | 'bottom' | 'x%' | {number} + // width // 自适应 + // height // 自适应 + //}, + // mapValueCalculation: 'sum', // 数值合并方式,默认加和,可选为: + // 'sum' | 'average' | 'max' | 'min' + mapValuePrecision: 0, // 地图数值计算结果小数精度 + showLegendSymbol: true, // 显示图例颜色标识(系列标识的小圆点),存在legend时生效 + // selectedMode: false, // 选择模式,默认关闭,可选single,multiple + hoverable: true, + clickable: true, + // roam: false, // 是否开启缩放及漫游模式 + // scaleLimit: null, + itemStyle: { + normal: { + // color: 各异, + borderColor: 'rgba(0,0,0,0)', + borderWidth: 1, + areaStyle: { + color: '#ccc' + }, + label: { + show: false, + textStyle: { + color: 'rgb(139,69,19)' + } + } + }, + emphasis: { // 也是选中样式 + // color: 各异, + borderColor: 'rgba(0,0,0,0)', + borderWidth: 1, + areaStyle: { + color: 'rgba(255,215,0,0.8)' + }, + label: { + show: false, + textStyle: { + color: 'rgb(100,0,0)' + } + } + } + } + }, + + force: { + // 布局中心 + center: ['50%', '50%'], + + // 布局大小 + size: '100%', + + // 布局冷却因子,值越小结束时间越短,值越大时间越长但是结果也越收敛 + coolDown: 0.99, + + // 数据映射到圆的半径的最小值和最大值 + minRadius: 10, + maxRadius: 20, + + // 是否根据屏幕比例拉伸 + ratioScaling: false, + + // 在 500+ 顶点的图上建议设置 large 为 true, 会使用 Barnes-Hut simulation + // 同时开启 useWorker 并且把 steps 值调大 + // 关于Barnes-Hut simulation: http://en.wikipedia.org/wiki/Barnes–Hut_simulation + large: false, + + // 是否在浏览器支持 worker 的时候使用 web worker + useWorker: false, + // 每一帧 force 迭代的次数,仅在启用webworker的情况下有用 + steps: 1, + + // 布局缩放因子,并不完全精确, 效果跟布局大小类似 + scaling: 1.0, + + // 向心力因子,越大向心力越大( 所有顶点会往 center 的位置收拢 ) + gravity: 1, + + symbol: 'circle', + // symbolSize 为 0 的话使用映射到minRadius-maxRadius后的值 + symbolSize: 0, + + linkSymbol: null, + linkSymbolSize: [10, 15], + draggable: true, + clickable: true, + + // 分类里如果有样式会覆盖节点默认样式 + categories: [{ + // itemStyle + // symbol + // symbolSize + // name + }], + itemStyle: { + normal: { + // color: 各异, + label: { + show: false + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + }, + nodeStyle: { + brushType: 'both', + color: '#f08c2e', + strokeColor: '#5182ab', + lineWidth: 1 + }, + linkStyle: { + strokeColor: '#5182ab' + } + }, + emphasis: { + // color: 各异, + label: { + show: false + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + }, + nodeStyle: {}, + linkStyle: { + opacity: 0 + } + } + } + // nodes: [{ + // name: 'xxx', + // value: 1, + // itemStyle: {}, + // initial: [0, 0], + // fixX: false, + // fixY: false, + // ignore: false, + // symbol: 'circle', + // symbolSize: 0 + // }] + // links: [{ + // source: 1, + // target: 2, + // weight: 1, + // itemStyle: {} + // }, { + // source: 'xxx', + // target: 'ooo' + // }] + }, + + chord: { + clickable: true, + radius: ['65%', '75%'], + center: ['50%', '50%'], + padding: 2, + sort: 'none', // can be 'none', 'ascending', 'descending' + sortSub: 'none', // can be 'none', 'ascending', 'descending' + startAngle: 90, + clockWise: true, + showScale: false, + showScaleText: false, + itemStyle: { + normal: { + label: { + show: true, + rotate: false, + distance: 10 + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + }, + lineStyle: { + width: 0, + color: '#000' + }, + chordStyle: { + lineStyle: { + width: 1, + color: '#999' + } + } + }, + emphasis: { + lineStyle: { + width: 0, + color: '#000' + }, + chordStyle: { + lineStyle: { + width: 1, + color: '#666' + } + } + } + }, + // Source data matrix + /** + * target + * -1--2--3--4--5- + * 1| x x x x x + * 2| x x x x x + * 3| x x x x x source + * 4| x x x x x + * 5| x x x x x + * + * Relation ship from source to target + * https://github.com/mbostock/d3/wiki/Chord-Layout#wiki-chord + * + * Row based + */ + matrix: [ ] + }, + + gauge: { + center: ['50%', '50%'], // 默认全局居中 + radius: '75%', + startAngle: 225, + endAngle: -45, + min: 0, // 最小值 + max: 100, // 最大值 + precision: 0, // 小数精度,默认为0,无小数点 + splitNumber: 10, // 分割段数,默认为10 + axisLine: { // 坐标轴线 + show: true, // 默认显示,属性show控制显示与否 + lineStyle: { // 属性lineStyle控制线条样式 + color: [[0.2, '#228b22'],[0.8, '#48b'],[1, '#ff4500']], + width: 30 + } + }, + axisTick: { // 坐标轴小标记 + show: true, // 属性show控制显示与否,默认不显示 + splitNumber: 5, // 每份split细分多少段 + length :8, // 属性length控制线长 + lineStyle: { // 属性lineStyle控制线条样式 + color: '#eee', + width: 1, + type: 'solid' + } + }, + axisLabel: { // 坐标轴文本标签,详见axis.axisLabel + show: true, + // formatter: null, + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: 'auto' + } + }, + splitLine: { // 分隔线 + show: true, // 默认显示,属性show控制显示与否 + length :30, // 属性length控制线长 + lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 + color: '#eee', + width: 2, + type: 'solid' + } + }, + pointer: { + show: true, + length: '80%', + width: 8, + color: 'auto' + }, + title: { + show: true, + offsetCenter: [0, '-40%'], // x, y,单位px + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: '#333', + fontSize: 15 + } + }, + detail: { + show: true, + backgroundColor: 'rgba(0,0,0,0)', + borderWidth: 0, + borderColor: '#ccc', + width: 100, + height: 40, + offsetCenter: [0, '40%'], // x, y,单位px + // formatter: null, + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: 'auto', + fontSize: 30 + } + } + }, + + funnel: { + clickable: true, + x: 80, + y: 60, + x2: 80, + y2: 60, + // width: {totalWidth} - x - x2, + // height: {totalHeight} - y - y2, + min: 0, + max: 100, + minSize: '0%', + maxSize: '100%', + sort: 'descending', // 'ascending', 'descending' + gap: 0, + itemStyle: { + normal: { + // color: 各异, + borderColor: '#fff', + borderWidth: 1, + label: { + show: true, + position: 'outer' + // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + }, + labelLine: { + show: true, + length: 10, + lineStyle: { + // color: 各异, + width: 1, + type: 'solid' + } + } + }, + emphasis: { + // color: 各异, + borderColor: 'rgba(0,0,0,0)', + borderWidth: 1, + label: { + show: true + }, + labelLine: { + show: true + } + } + } + }, + + island: { + r: 15, + calculateStep: 0.1 // 滚轮可计算步长 0.1 = 10% + }, + + markPoint: { + clickable: true, + symbol: 'pin', // 标注类型 + symbolSize: 10, // 标注大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 + // symbolRotate: null, // 标注旋转控制 + large: false, + effect: { + show: false, + loop: true, + period: 15, // 运动周期,无单位,值越大越慢 + scaleSize: 2 // 放大倍数,以markPoint点size为基准 + // color: 'gold', + // shadowColor: 'rgba(255,215,0,0.8)', + // shadowBlur: 0 // 炫光模糊 + }, + itemStyle: { + normal: { + // color: 各异, + // borderColor: 各异, // 标注边线颜色,优先于color + borderWidth: 2, // 标注边线线宽,单位px,默认为1 + label: { + show: true, + // 标签文本格式器,同Tooltip.formatter,不支持回调 + // formatter: null, + position: 'inside' // 可选为'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + } + }, + emphasis: { + // color: 各异 + label: { + show: true + // 标签文本格式器,同Tooltip.formatter,不支持回调 + // formatter: null, + // position: 'inside' // 'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + } + } + } + }, + + markLine: { + clickable: true, + // 标线起始和结束的symbol介绍类型,如果都一样,可以直接传string + symbol: ['circle', 'arrow'], + // 标线起始和结束的symbol大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 + symbolSize: [2, 4], + // 标线起始和结束的symbol旋转控制 + //symbolRotate: null, + //smooth: false, + large: false, + effect: { + show: false, + loop: true, + period: 15, // 运动周期,无单位,值越大越慢 + scaleSize: 2 // 放大倍数,以markLine线lineWidth为基准 + // color: 'gold', + // shadowColor: 'rgba(255,215,0,0.8)', + // shadowBlur: lineWidth * 2 // 炫光模糊,默认等于scaleSize计算所得 + }, + itemStyle: { + normal: { + // color: 各异, // 标线主色,线色,symbol主色 + // borderColor: 随color, // 标线symbol边框颜色,优先于color + borderWidth: 1.5, // 标线symbol边框线宽,单位px,默认为2 + label: { + show: true, + // 标签文本格式器,同Tooltip.formatter,不支持回调 + // formatter: null, + // 可选为 'start'|'end'|'left'|'right'|'top'|'bottom' + position: 'end' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + }, + lineStyle: { + // color: 随borderColor, // 主色,线色,优先级高于borderColor和color + // width: 随borderWidth, // 优先于borderWidth + type: 'dashed' + // shadowColor: 'rgba(0,0,0,0)', //默认透明 + // shadowBlur: 0, + // shadowOffsetX: 0, + // shadowOffsetY: 0 + } + }, + emphasis: { + // color: 各异 + label: { + show: false + // 标签文本格式器,同Tooltip.formatter,不支持回调 + // formatter: null, + // position: 'inside' // 'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + }, + lineStyle: {} + } + } + }, + + // 主题,主题 + textStyle: { + decoration: 'none', + fontFamily: 'Arial, Verdana, sans-serif', + fontFamily2: '微软雅黑', // IE8- 字体模糊并且,不支持不同字体混排,额外指定一份 + fontSize: 12, + fontStyle: 'normal', + fontWeight: 'normal' + }, + + EVENT: { + // -------全局通用 + REFRESH: 'refresh', + RESTORE: 'restore', + RESIZE: 'resize', + CLICK: 'click', + DBLCLICK: 'dblclick', + HOVER: 'hover', + MOUSEOUT: 'mouseout', + //MOUSEWHEEL: 'mousewheel', + // -------业务交互逻辑 + DATA_CHANGED: 'dataChanged', + DATA_ZOOM: 'dataZoom', + DATA_RANGE: 'dataRange', + LEGEND_SELECTED: 'legendSelected', + MAP_SELECTED: 'mapSelected', + PIE_SELECTED: 'pieSelected', + MAGIC_TYPE_CHANGED: 'magicTypeChanged', + DATA_VIEW_CHANGED: 'dataViewChanged', + TIMELINE_CHANGED: 'timelineChanged', + MAP_ROAM: 'mapRoam', + // -------内部通信 + TOOLTIP_HOVER: 'tooltipHover', + TOOLTIP_IN_GRID: 'tooltipInGrid', + TOOLTIP_OUT_GRID: 'tooltipOutGrid', + ROAMCONTROLLER: 'roamController' + }, + DRAG_ENABLE_TIME: 120, // 降低图表内元素拖拽敏感度,单位ms,不建议外部干预 + EFFECT_ZLEVEL: 7, + // 主题,默认标志图形类型列表 + symbolList: [ + 'circle', 'rectangle', 'triangle', 'diamond', + 'emptyCircle', 'emptyRectangle', 'emptyTriangle', 'emptyDiamond' + ], + loadingText: 'Loading...', + // 可计算特性配置,孤岛,提示颜色 + calculable: false, // 默认关闭可计算特性 + calculableColor: 'rgba(255,165,0,0.6)', // 拖拽提示边框颜色 + calculableHolderColor: '#ccc', // 可计算占位提示颜色 + nameConnector: ' & ', + valueConnector: ': ', + animation: true, // 过渡动画是否开启 + addDataAnimation: true, // 动态数据接口是否开启动画效果 + animationThreshold: 2000, // 动画元素阀值,产生的图形原素超过2000不出动画 + animationDuration: 2000, + animationEasing: 'ExponentialOut' //BounceOut + }; + + return config; }); +// Copyright 2006 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +// Known Issues: +// +// * Patterns only support repeat. +// * Radial gradient are not implemented. The VML version of these look very +// different from the canvas one. +// * Clipping paths are not implemented. +// * Coordsize. The width and height attribute have higher priority than the +// width and height style values which isn't correct. +// * Painting mode isn't implemented. +// * Canvas width/height should is using content-box by default. IE in +// Quirks mode will draw the canvas using border-box. Either change your +// doctype to HTML5 +// (http://www.whatwg.org/specs/web-apps/current-work/#the-doctype) +// or use Box Sizing Behavior from WebFX +// (http://webfx.eae.net/dhtml/boxsizing/boxsizing.html) +// * Non uniform scaling does not correctly scale strokes. +// * Optimize. There is always room for speed improvements. + +// AMD by kener.linfeng@gmail.com +define('zrender/dep/excanvas',['require'],function(require) { + +// Only add this code if we do not already have a canvas implementation +if (!document.createElement('canvas').getContext) { + +(function() { + + // alias some functions to make (compiled) code shorter + var m = Math; + var mr = m.round; + var ms = m.sin; + var mc = m.cos; + var abs = m.abs; + var sqrt = m.sqrt; + + // this is used for sub pixel precision + var Z = 10; + var Z2 = Z / 2; + + var IE_VERSION = +navigator.userAgent.match(/MSIE ([\d.]+)?/)[1]; + + /** + * This funtion is assigned to the elements as element.getContext(). + * @this {HTMLElement} + * @return {CanvasRenderingContext2D_} + */ + function getContext() { + return this.context_ || + (this.context_ = new CanvasRenderingContext2D_(this)); + } + + var slice = Array.prototype.slice; + + /** + * Binds a function to an object. The returned function will always use the + * passed in {@code obj} as {@code this}. + * + * Example: + * + * g = bind(f, obj, a, b) + * g(c, d) // will do f.call(obj, a, b, c, d) + * + * @param {Function} f The function to bind the object to + * @param {Object} obj The object that should act as this when the function + * is called + * @param {*} var_args Rest arguments that will be used as the initial + * arguments when the function is called + * @return {Function} A new function that has bound this + */ + function bind(f, obj, var_args) { + var a = slice.call(arguments, 2); + return function() { + return f.apply(obj, a.concat(slice.call(arguments))); + }; + } + + function encodeHtmlAttribute(s) { + return String(s).replace(/&/g, '&').replace(/"/g, '"'); + } + + function addNamespace(doc, prefix, urn) { + if (!doc.namespaces[prefix]) { + doc.namespaces.add(prefix, urn, '#default#VML'); + } + } + + function addNamespacesAndStylesheet(doc) { + addNamespace(doc, 'g_vml_', 'urn:schemas-microsoft-com:vml'); + addNamespace(doc, 'g_o_', 'urn:schemas-microsoft-com:office:office'); + + // Setup default CSS. Only add one style sheet per document + if (!doc.styleSheets['ex_canvas_']) { + var ss = doc.createStyleSheet(); + ss.owningElement.id = 'ex_canvas_'; + ss.cssText = 'canvas{display:inline-block;overflow:hidden;' + + // default size is 300x150 in Gecko and Opera + 'text-align:left;width:300px;height:150px}'; + } + } + + // Add namespaces and stylesheet at startup. + addNamespacesAndStylesheet(document); + + var G_vmlCanvasManager_ = { + init: function(opt_doc) { + var doc = opt_doc || document; + // Create a dummy element so that IE will allow canvas elements to be + // recognized. + doc.createElement('canvas'); + doc.attachEvent('onreadystatechange', bind(this.init_, this, doc)); + }, + + init_: function(doc) { + // find all canvas elements + var els = doc.getElementsByTagName('canvas'); + for (var i = 0; i < els.length; i++) { + this.initElement(els[i]); + } + }, + + /** + * Public initializes a canvas element so that it can be used as canvas + * element from now on. This is called automatically before the page is + * loaded but if you are creating elements using createElement you need to + * make sure this is called on the element. + * @param {HTMLElement} el The canvas element to initialize. + * @return {HTMLElement} the element that was created. + */ + initElement: function(el) { + if (!el.getContext) { + el.getContext = getContext; + + // Add namespaces and stylesheet to document of the element. + addNamespacesAndStylesheet(el.ownerDocument); + + // Remove fallback content. There is no way to hide text nodes so we + // just remove all childNodes. We could hide all elements and remove + // text nodes but who really cares about the fallback content. + el.innerHTML = ''; + + // do not use inline function because that will leak memory + el.attachEvent('onpropertychange', onPropertyChange); + el.attachEvent('onresize', onResize); + + var attrs = el.attributes; + if (attrs.width && attrs.width.specified) { + // TODO: use runtimeStyle and coordsize + // el.getContext().setWidth_(attrs.width.nodeValue); + el.style.width = attrs.width.nodeValue + 'px'; + } else { + el.width = el.clientWidth; + } + if (attrs.height && attrs.height.specified) { + // TODO: use runtimeStyle and coordsize + // el.getContext().setHeight_(attrs.height.nodeValue); + el.style.height = attrs.height.nodeValue + 'px'; + } else { + el.height = el.clientHeight; + } + //el.getContext().setCoordsize_() + } + return el; + } + }; + + function onPropertyChange(e) { + var el = e.srcElement; + + switch (e.propertyName) { + case 'width': + el.getContext().clearRect(); + el.style.width = el.attributes.width.nodeValue + 'px'; + // In IE8 this does not trigger onresize. + el.firstChild.style.width = el.clientWidth + 'px'; + break; + case 'height': + el.getContext().clearRect(); + el.style.height = el.attributes.height.nodeValue + 'px'; + el.firstChild.style.height = el.clientHeight + 'px'; + break; + } + } + + function onResize(e) { + var el = e.srcElement; + if (el.firstChild) { + el.firstChild.style.width = el.clientWidth + 'px'; + el.firstChild.style.height = el.clientHeight + 'px'; + } + } + + G_vmlCanvasManager_.init(); + + // precompute "00" to "FF" + var decToHex = []; + for (var i = 0; i < 16; i++) { + for (var j = 0; j < 16; j++) { + decToHex[i * 16 + j] = i.toString(16) + j.toString(16); + } + } + + function createMatrixIdentity() { + return [ + [1, 0, 0], + [0, 1, 0], + [0, 0, 1] + ]; + } + + function matrixMultiply(m1, m2) { + var result = createMatrixIdentity(); + + for (var x = 0; x < 3; x++) { + for (var y = 0; y < 3; y++) { + var sum = 0; + + for (var z = 0; z < 3; z++) { + sum += m1[x][z] * m2[z][y]; + } + + result[x][y] = sum; + } + } + return result; + } + + function copyState(o1, o2) { + o2.fillStyle = o1.fillStyle; + o2.lineCap = o1.lineCap; + o2.lineJoin = o1.lineJoin; + o2.lineWidth = o1.lineWidth; + o2.miterLimit = o1.miterLimit; + o2.shadowBlur = o1.shadowBlur; + o2.shadowColor = o1.shadowColor; + o2.shadowOffsetX = o1.shadowOffsetX; + o2.shadowOffsetY = o1.shadowOffsetY; + o2.strokeStyle = o1.strokeStyle; + o2.globalAlpha = o1.globalAlpha; + o2.font = o1.font; + o2.textAlign = o1.textAlign; + o2.textBaseline = o1.textBaseline; + o2.arcScaleX_ = o1.arcScaleX_; + o2.arcScaleY_ = o1.arcScaleY_; + o2.lineScale_ = o1.lineScale_; + } + + var colorData = { + aliceblue: '#F0F8FF', + antiquewhite: '#FAEBD7', + aquamarine: '#7FFFD4', + azure: '#F0FFFF', + beige: '#F5F5DC', + bisque: '#FFE4C4', + black: '#000000', + blanchedalmond: '#FFEBCD', + blueviolet: '#8A2BE2', + brown: '#A52A2A', + burlywood: '#DEB887', + cadetblue: '#5F9EA0', + chartreuse: '#7FFF00', + chocolate: '#D2691E', + coral: '#FF7F50', + cornflowerblue: '#6495ED', + cornsilk: '#FFF8DC', + crimson: '#DC143C', + cyan: '#00FFFF', + darkblue: '#00008B', + darkcyan: '#008B8B', + darkgoldenrod: '#B8860B', + darkgray: '#A9A9A9', + darkgreen: '#006400', + darkgrey: '#A9A9A9', + darkkhaki: '#BDB76B', + darkmagenta: '#8B008B', + darkolivegreen: '#556B2F', + darkorange: '#FF8C00', + darkorchid: '#9932CC', + darkred: '#8B0000', + darksalmon: '#E9967A', + darkseagreen: '#8FBC8F', + darkslateblue: '#483D8B', + darkslategray: '#2F4F4F', + darkslategrey: '#2F4F4F', + darkturquoise: '#00CED1', + darkviolet: '#9400D3', + deeppink: '#FF1493', + deepskyblue: '#00BFFF', + dimgray: '#696969', + dimgrey: '#696969', + dodgerblue: '#1E90FF', + firebrick: '#B22222', + floralwhite: '#FFFAF0', + forestgreen: '#228B22', + gainsboro: '#DCDCDC', + ghostwhite: '#F8F8FF', + gold: '#FFD700', + goldenrod: '#DAA520', + grey: '#808080', + greenyellow: '#ADFF2F', + honeydew: '#F0FFF0', + hotpink: '#FF69B4', + indianred: '#CD5C5C', + indigo: '#4B0082', + ivory: '#FFFFF0', + khaki: '#F0E68C', + lavender: '#E6E6FA', + lavenderblush: '#FFF0F5', + lawngreen: '#7CFC00', + lemonchiffon: '#FFFACD', + lightblue: '#ADD8E6', + lightcoral: '#F08080', + lightcyan: '#E0FFFF', + lightgoldenrodyellow: '#FAFAD2', + lightgreen: '#90EE90', + lightgrey: '#D3D3D3', + lightpink: '#FFB6C1', + lightsalmon: '#FFA07A', + lightseagreen: '#20B2AA', + lightskyblue: '#87CEFA', + lightslategray: '#778899', + lightslategrey: '#778899', + lightsteelblue: '#B0C4DE', + lightyellow: '#FFFFE0', + limegreen: '#32CD32', + linen: '#FAF0E6', + magenta: '#FF00FF', + mediumaquamarine: '#66CDAA', + mediumblue: '#0000CD', + mediumorchid: '#BA55D3', + mediumpurple: '#9370DB', + mediumseagreen: '#3CB371', + mediumslateblue: '#7B68EE', + mediumspringgreen: '#00FA9A', + mediumturquoise: '#48D1CC', + mediumvioletred: '#C71585', + midnightblue: '#191970', + mintcream: '#F5FFFA', + mistyrose: '#FFE4E1', + moccasin: '#FFE4B5', + navajowhite: '#FFDEAD', + oldlace: '#FDF5E6', + olivedrab: '#6B8E23', + orange: '#FFA500', + orangered: '#FF4500', + orchid: '#DA70D6', + palegoldenrod: '#EEE8AA', + palegreen: '#98FB98', + paleturquoise: '#AFEEEE', + palevioletred: '#DB7093', + papayawhip: '#FFEFD5', + peachpuff: '#FFDAB9', + peru: '#CD853F', + pink: '#FFC0CB', + plum: '#DDA0DD', + powderblue: '#B0E0E6', + rosybrown: '#BC8F8F', + royalblue: '#4169E1', + saddlebrown: '#8B4513', + salmon: '#FA8072', + sandybrown: '#F4A460', + seagreen: '#2E8B57', + seashell: '#FFF5EE', + sienna: '#A0522D', + skyblue: '#87CEEB', + slateblue: '#6A5ACD', + slategray: '#708090', + slategrey: '#708090', + snow: '#FFFAFA', + springgreen: '#00FF7F', + steelblue: '#4682B4', + tan: '#D2B48C', + thistle: '#D8BFD8', + tomato: '#FF6347', + turquoise: '#40E0D0', + violet: '#EE82EE', + wheat: '#F5DEB3', + whitesmoke: '#F5F5F5', + yellowgreen: '#9ACD32' + }; + + + function getRgbHslContent(styleString) { + var start = styleString.indexOf('(', 3); + var end = styleString.indexOf(')', start + 1); + var parts = styleString.substring(start + 1, end).split(','); + // add alpha if needed + if (parts.length != 4 || styleString.charAt(3) != 'a') { + parts[3] = 1; + } + return parts; + } + + function percent(s) { + return parseFloat(s) / 100; + } + + function clamp(v, min, max) { + return Math.min(max, Math.max(min, v)); + } + + function hslToRgb(parts){ + var r, g, b, h, s, l; + h = parseFloat(parts[0]) / 360 % 360; + if (h < 0) + h++; + s = clamp(percent(parts[1]), 0, 1); + l = clamp(percent(parts[2]), 0, 1); + if (s == 0) { + r = g = b = l; // achromatic + } else { + var q = l < 0.5 ? l * (1 + s) : l + s - l * s; + var p = 2 * l - q; + r = hueToRgb(p, q, h + 1 / 3); + g = hueToRgb(p, q, h); + b = hueToRgb(p, q, h - 1 / 3); + } + + return '#' + decToHex[Math.floor(r * 255)] + + decToHex[Math.floor(g * 255)] + + decToHex[Math.floor(b * 255)]; + } + + function hueToRgb(m1, m2, h) { + if (h < 0) + h++; + if (h > 1) + h--; + + if (6 * h < 1) + return m1 + (m2 - m1) * 6 * h; + else if (2 * h < 1) + return m2; + else if (3 * h < 2) + return m1 + (m2 - m1) * (2 / 3 - h) * 6; + else + return m1; + } + + var processStyleCache = {}; + + function processStyle(styleString) { + if (styleString in processStyleCache) { + return processStyleCache[styleString]; + } + + var str, alpha = 1; + + styleString = String(styleString); + if (styleString.charAt(0) == '#') { + str = styleString; + } else if (/^rgb/.test(styleString)) { + var parts = getRgbHslContent(styleString); + var str = '#', n; + for (var i = 0; i < 3; i++) { + if (parts[i].indexOf('%') != -1) { + n = Math.floor(percent(parts[i]) * 255); + } else { + n = +parts[i]; + } + str += decToHex[clamp(n, 0, 255)]; + } + alpha = +parts[3]; + } else if (/^hsl/.test(styleString)) { + var parts = getRgbHslContent(styleString); + str = hslToRgb(parts); + alpha = parts[3]; + } else { + str = colorData[styleString] || styleString; + } + return processStyleCache[styleString] = {color: str, alpha: alpha}; + } + + var DEFAULT_STYLE = { + style: 'normal', + variant: 'normal', + weight: 'normal', + size: 12, //10 + family: '微软雅黑' //'sans-serif' + }; + + // Internal text style cache + var fontStyleCache = {}; + + function processFontStyle(styleString) { + if (fontStyleCache[styleString]) { + return fontStyleCache[styleString]; + } + + var el = document.createElement('div'); + var style = el.style; + var fontFamily; + try { + style.font = styleString; + fontFamily = style.fontFamily.split(',')[0]; + } catch (ex) { + // Ignore failures to set to invalid font. + } + + return fontStyleCache[styleString] = { + style: style.fontStyle || DEFAULT_STYLE.style, + variant: style.fontVariant || DEFAULT_STYLE.variant, + weight: style.fontWeight || DEFAULT_STYLE.weight, + size: style.fontSize || DEFAULT_STYLE.size, + family: fontFamily || DEFAULT_STYLE.family + }; + } + + function getComputedStyle(style, element) { + var computedStyle = {}; + + for (var p in style) { + computedStyle[p] = style[p]; + } + + // Compute the size + var canvasFontSize = parseFloat(element.currentStyle.fontSize), + fontSize = parseFloat(style.size); + + if (typeof style.size == 'number') { + computedStyle.size = style.size; + } else if (style.size.indexOf('px') != -1) { + computedStyle.size = fontSize; + } else if (style.size.indexOf('em') != -1) { + computedStyle.size = canvasFontSize * fontSize; + } else if(style.size.indexOf('%') != -1) { + computedStyle.size = (canvasFontSize / 100) * fontSize; + } else if (style.size.indexOf('pt') != -1) { + computedStyle.size = fontSize / .75; + } else { + computedStyle.size = canvasFontSize; + } + + // Different scaling between normal text and VML text. This was found using + // trial and error to get the same size as non VML text. + //computedStyle.size *= 0.981; + + return computedStyle; + } + + function buildStyle(style) { + return style.style + ' ' + style.variant + ' ' + style.weight + ' ' + + style.size + "px '" + style.family + "'"; + } + + var lineCapMap = { + 'butt': 'flat', + 'round': 'round' + }; + + function processLineCap(lineCap) { + return lineCapMap[lineCap] || 'square'; + } + + /** + * This class implements CanvasRenderingContext2D interface as described by + * the WHATWG. + * @param {HTMLElement} canvasElement The element that the 2D context should + * be associated with + */ + function CanvasRenderingContext2D_(canvasElement) { + this.m_ = createMatrixIdentity(); + + this.mStack_ = []; + this.aStack_ = []; + this.currentPath_ = []; + + // Canvas context properties + this.strokeStyle = '#000'; + this.fillStyle = '#000'; + + this.lineWidth = 1; + this.lineJoin = 'miter'; + this.lineCap = 'butt'; + this.miterLimit = Z * 1; + this.globalAlpha = 1; + // this.font = '10px sans-serif'; + this.font = '12px 微软雅黑'; // 决定还是改这吧,影响代价最小 + this.textAlign = 'left'; + this.textBaseline = 'alphabetic'; + this.canvas = canvasElement; + + var cssText = 'width:' + canvasElement.clientWidth + 'px;height:' + + canvasElement.clientHeight + 'px;overflow:hidden;position:absolute'; + var el = canvasElement.ownerDocument.createElement('div'); + el.style.cssText = cssText; + canvasElement.appendChild(el); + + var overlayEl = el.cloneNode(false); + // Use a non transparent background. + overlayEl.style.backgroundColor = '#fff'; //red, I don't know why, it work! + overlayEl.style.filter = 'alpha(opacity=0)'; + canvasElement.appendChild(overlayEl); + + this.element_ = el; + this.arcScaleX_ = 1; + this.arcScaleY_ = 1; + this.lineScale_ = 1; + } + + var contextPrototype = CanvasRenderingContext2D_.prototype; + contextPrototype.clearRect = function() { + if (this.textMeasureEl_) { + this.textMeasureEl_.removeNode(true); + this.textMeasureEl_ = null; + } + this.element_.innerHTML = ''; + }; + + contextPrototype.beginPath = function() { + // TODO: Branch current matrix so that save/restore has no effect + // as per safari docs. + this.currentPath_ = []; + }; + + contextPrototype.moveTo = function(aX, aY) { + var p = getCoords(this, aX, aY); + this.currentPath_.push({type: 'moveTo', x: p.x, y: p.y}); + this.currentX_ = p.x; + this.currentY_ = p.y; + }; + + contextPrototype.lineTo = function(aX, aY) { + var p = getCoords(this, aX, aY); + this.currentPath_.push({type: 'lineTo', x: p.x, y: p.y}); + + this.currentX_ = p.x; + this.currentY_ = p.y; + }; + + contextPrototype.bezierCurveTo = function(aCP1x, aCP1y, + aCP2x, aCP2y, + aX, aY) { + var p = getCoords(this, aX, aY); + var cp1 = getCoords(this, aCP1x, aCP1y); + var cp2 = getCoords(this, aCP2x, aCP2y); + bezierCurveTo(this, cp1, cp2, p); + }; + + // Helper function that takes the already fixed cordinates. + function bezierCurveTo(self, cp1, cp2, p) { + self.currentPath_.push({ + type: 'bezierCurveTo', + cp1x: cp1.x, + cp1y: cp1.y, + cp2x: cp2.x, + cp2y: cp2.y, + x: p.x, + y: p.y + }); + self.currentX_ = p.x; + self.currentY_ = p.y; + } + + contextPrototype.quadraticCurveTo = function(aCPx, aCPy, aX, aY) { + // the following is lifted almost directly from + // http://developer.mozilla.org/en/docs/Canvas_tutorial:Drawing_shapes + + var cp = getCoords(this, aCPx, aCPy); + var p = getCoords(this, aX, aY); + + var cp1 = { + x: this.currentX_ + 2.0 / 3.0 * (cp.x - this.currentX_), + y: this.currentY_ + 2.0 / 3.0 * (cp.y - this.currentY_) + }; + var cp2 = { + x: cp1.x + (p.x - this.currentX_) / 3.0, + y: cp1.y + (p.y - this.currentY_) / 3.0 + }; + + bezierCurveTo(this, cp1, cp2, p); + }; + + contextPrototype.arc = function(aX, aY, aRadius, + aStartAngle, aEndAngle, aClockwise) { + aRadius *= Z; + var arcType = aClockwise ? 'at' : 'wa'; + + var xStart = aX + mc(aStartAngle) * aRadius - Z2; + var yStart = aY + ms(aStartAngle) * aRadius - Z2; + + var xEnd = aX + mc(aEndAngle) * aRadius - Z2; + var yEnd = aY + ms(aEndAngle) * aRadius - Z2; + + // IE won't render arches drawn counter clockwise if xStart == xEnd. + if (xStart == xEnd && !aClockwise) { + xStart += 0.125; // Offset xStart by 1/80 of a pixel. Use something + // that can be represented in binary + } + + var p = getCoords(this, aX, aY); + var pStart = getCoords(this, xStart, yStart); + var pEnd = getCoords(this, xEnd, yEnd); + + this.currentPath_.push({type: arcType, + x: p.x, + y: p.y, + radius: aRadius, + xStart: pStart.x, + yStart: pStart.y, + xEnd: pEnd.x, + yEnd: pEnd.y}); + + }; + + contextPrototype.rect = function(aX, aY, aWidth, aHeight) { + this.moveTo(aX, aY); + this.lineTo(aX + aWidth, aY); + this.lineTo(aX + aWidth, aY + aHeight); + this.lineTo(aX, aY + aHeight); + this.closePath(); + }; + + contextPrototype.strokeRect = function(aX, aY, aWidth, aHeight) { + var oldPath = this.currentPath_; + this.beginPath(); + + this.moveTo(aX, aY); + this.lineTo(aX + aWidth, aY); + this.lineTo(aX + aWidth, aY + aHeight); + this.lineTo(aX, aY + aHeight); + this.closePath(); + this.stroke(); + + this.currentPath_ = oldPath; + }; + + contextPrototype.fillRect = function(aX, aY, aWidth, aHeight) { + var oldPath = this.currentPath_; + this.beginPath(); + + this.moveTo(aX, aY); + this.lineTo(aX + aWidth, aY); + this.lineTo(aX + aWidth, aY + aHeight); + this.lineTo(aX, aY + aHeight); + this.closePath(); + this.fill(); + + this.currentPath_ = oldPath; + }; + + contextPrototype.createLinearGradient = function(aX0, aY0, aX1, aY1) { + var gradient = new CanvasGradient_('gradient'); + gradient.x0_ = aX0; + gradient.y0_ = aY0; + gradient.x1_ = aX1; + gradient.y1_ = aY1; + return gradient; + }; + + contextPrototype.createRadialGradient = function(aX0, aY0, aR0, + aX1, aY1, aR1) { + var gradient = new CanvasGradient_('gradientradial'); + gradient.x0_ = aX0; + gradient.y0_ = aY0; + gradient.r0_ = aR0; + gradient.x1_ = aX1; + gradient.y1_ = aY1; + gradient.r1_ = aR1; + return gradient; + }; + + contextPrototype.drawImage = function(image, var_args) { + var dx, dy, dw, dh, sx, sy, sw, sh; + + // to find the original width we overide the width and height + var oldRuntimeWidth = image.runtimeStyle.width; + var oldRuntimeHeight = image.runtimeStyle.height; + image.runtimeStyle.width = 'auto'; + image.runtimeStyle.height = 'auto'; + + // get the original size + var w = image.width; + var h = image.height; + + // and remove overides + image.runtimeStyle.width = oldRuntimeWidth; + image.runtimeStyle.height = oldRuntimeHeight; + + if (arguments.length == 3) { + dx = arguments[1]; + dy = arguments[2]; + sx = sy = 0; + sw = dw = w; + sh = dh = h; + } else if (arguments.length == 5) { + dx = arguments[1]; + dy = arguments[2]; + dw = arguments[3]; + dh = arguments[4]; + sx = sy = 0; + sw = w; + sh = h; + } else if (arguments.length == 9) { + sx = arguments[1]; + sy = arguments[2]; + sw = arguments[3]; + sh = arguments[4]; + dx = arguments[5]; + dy = arguments[6]; + dw = arguments[7]; + dh = arguments[8]; + } else { + throw Error('Invalid number of arguments'); + } + + var d = getCoords(this, dx, dy); + + var w2 = sw / 2; + var h2 = sh / 2; + + var vmlStr = []; + + var W = 10; + var H = 10; + + var scaleX = scaleY = 1; + + // For some reason that I've now forgotten, using divs didn't work + vmlStr.push(' '); + + // Draw a special cropping div if needed + if (sx || sy) { + // Apply scales to width and height + vmlStr.push('
'); + } + + + // Apply scales to width and height + vmlStr.push('
'); + + // Close the crop div if necessary + if (sx || sy) vmlStr.push('
'); + + vmlStr.push('
'); + + this.element_.insertAdjacentHTML('BeforeEnd', vmlStr.join('')); + }; + + contextPrototype.stroke = function(aFill) { + var lineStr = []; + var lineOpen = false; + + var W = 10; + var H = 10; + + lineStr.push(''); + + if (!aFill) { + appendStroke(this, lineStr); + } else { + appendFill(this, lineStr, min, max); + } + + lineStr.push(''); + + this.element_.insertAdjacentHTML('beforeEnd', lineStr.join('')); + }; + + function appendStroke(ctx, lineStr) { + var a = processStyle(ctx.strokeStyle); + var color = a.color; + var opacity = a.alpha * ctx.globalAlpha; + var lineWidth = ctx.lineScale_ * ctx.lineWidth; + + // VML cannot correctly render a line if the width is less than 1px. + // In that case, we dilute the color to make the line look thinner. + if (lineWidth < 1) { + opacity *= lineWidth; + } + + lineStr.push( + '' + ); + } + + function appendFill(ctx, lineStr, min, max) { + var fillStyle = ctx.fillStyle; + var arcScaleX = ctx.arcScaleX_; + var arcScaleY = ctx.arcScaleY_; + var width = max.x - min.x; + var height = max.y - min.y; + if (fillStyle instanceof CanvasGradient_) { + // TODO: Gradients transformed with the transformation matrix. + var angle = 0; + var focus = {x: 0, y: 0}; + + // additional offset + var shift = 0; + // scale factor for offset + var expansion = 1; + + if (fillStyle.type_ == 'gradient') { + var x0 = fillStyle.x0_ / arcScaleX; + var y0 = fillStyle.y0_ / arcScaleY; + var x1 = fillStyle.x1_ / arcScaleX; + var y1 = fillStyle.y1_ / arcScaleY; + var p0 = getCoords(ctx, x0, y0); + var p1 = getCoords(ctx, x1, y1); + var dx = p1.x - p0.x; + var dy = p1.y - p0.y; + angle = Math.atan2(dx, dy) * 180 / Math.PI; + + // The angle should be a non-negative number. + if (angle < 0) { + angle += 360; + } + + // Very small angles produce an unexpected result because they are + // converted to a scientific notation string. + if (angle < 1e-6) { + angle = 0; + } + } else { + var p0 = getCoords(ctx, fillStyle.x0_, fillStyle.y0_); + focus = { + x: (p0.x - min.x) / width, + y: (p0.y - min.y) / height + }; + + width /= arcScaleX * Z; + height /= arcScaleY * Z; + var dimension = m.max(width, height); + shift = 2 * fillStyle.r0_ / dimension; + expansion = 2 * fillStyle.r1_ / dimension - shift; + } + + // We need to sort the color stops in ascending order by offset, + // otherwise IE won't interpret it correctly. + var stops = fillStyle.colors_; + stops.sort(function(cs1, cs2) { + return cs1.offset - cs2.offset; + }); + + var length = stops.length; + var color1 = stops[0].color; + var color2 = stops[length - 1].color; + var opacity1 = stops[0].alpha * ctx.globalAlpha; + var opacity2 = stops[length - 1].alpha * ctx.globalAlpha; + + var colors = []; + for (var i = 0; i < length; i++) { + var stop = stops[i]; + colors.push(stop.offset * expansion + shift + ' ' + stop.color); + } + + // When colors attribute is used, the meanings of opacity and o:opacity2 + // are reversed. + lineStr.push(''); + } else if (fillStyle instanceof CanvasPattern_) { + if (width && height) { + var deltaLeft = -min.x; + var deltaTop = -min.y; + lineStr.push(''); + } + } else { + var a = processStyle(ctx.fillStyle); + var color = a.color; + var opacity = a.alpha * ctx.globalAlpha; + lineStr.push(''); + } + } + + contextPrototype.fill = function() { + this.stroke(true); + }; + + contextPrototype.closePath = function() { + this.currentPath_.push({type: 'close'}); + }; + + function getCoords(ctx, aX, aY) { + var m = ctx.m_; + return { + x: Z * (aX * m[0][0] + aY * m[1][0] + m[2][0]) - Z2, + y: Z * (aX * m[0][1] + aY * m[1][1] + m[2][1]) - Z2 + }; + }; + + contextPrototype.save = function() { + var o = {}; + copyState(this, o); + this.aStack_.push(o); + this.mStack_.push(this.m_); + this.m_ = matrixMultiply(createMatrixIdentity(), this.m_); + }; + + contextPrototype.restore = function() { + if (this.aStack_.length) { + copyState(this.aStack_.pop(), this); + this.m_ = this.mStack_.pop(); + } + }; + + function matrixIsFinite(m) { + return isFinite(m[0][0]) && isFinite(m[0][1]) && + isFinite(m[1][0]) && isFinite(m[1][1]) && + isFinite(m[2][0]) && isFinite(m[2][1]); + } + + function setM(ctx, m, updateLineScale) { + if (!matrixIsFinite(m)) { + return; + } + ctx.m_ = m; + + if (updateLineScale) { + // Get the line scale. + // Determinant of this.m_ means how much the area is enlarged by the + // transformation. So its square root can be used as a scale factor + // for width. + var det = m[0][0] * m[1][1] - m[0][1] * m[1][0]; + ctx.lineScale_ = sqrt(abs(det)); + } + } + + contextPrototype.translate = function(aX, aY) { + var m1 = [ + [1, 0, 0], + [0, 1, 0], + [aX, aY, 1] + ]; + + setM(this, matrixMultiply(m1, this.m_), false); + }; + + contextPrototype.rotate = function(aRot) { + var c = mc(aRot); + var s = ms(aRot); + + var m1 = [ + [c, s, 0], + [-s, c, 0], + [0, 0, 1] + ]; + + setM(this, matrixMultiply(m1, this.m_), false); + }; + + contextPrototype.scale = function(aX, aY) { + this.arcScaleX_ *= aX; + this.arcScaleY_ *= aY; + var m1 = [ + [aX, 0, 0], + [0, aY, 0], + [0, 0, 1] + ]; + + setM(this, matrixMultiply(m1, this.m_), true); + }; + + contextPrototype.transform = function(m11, m12, m21, m22, dx, dy) { + var m1 = [ + [m11, m12, 0], + [m21, m22, 0], + [dx, dy, 1] + ]; + + setM(this, matrixMultiply(m1, this.m_), true); + }; + + contextPrototype.setTransform = function(m11, m12, m21, m22, dx, dy) { + var m = [ + [m11, m12, 0], + [m21, m22, 0], + [dx, dy, 1] + ]; + + setM(this, m, true); + }; + + /** + * The text drawing function. + * The maxWidth argument isn't taken in account, since no browser supports + * it yet. + */ + contextPrototype.drawText_ = function(text, x, y, maxWidth, stroke) { + var m = this.m_, + delta = 1000, + left = 0, + right = delta, + offset = {x: 0, y: 0}, + lineStr = []; + + var fontStyle = getComputedStyle(processFontStyle(this.font), + this.element_); + + var fontStyleString = buildStyle(fontStyle); + + var elementStyle = this.element_.currentStyle; + var textAlign = this.textAlign.toLowerCase(); + switch (textAlign) { + case 'left': + case 'center': + case 'right': + break; + case 'end': + textAlign = elementStyle.direction == 'ltr' ? 'right' : 'left'; + break; + case 'start': + textAlign = elementStyle.direction == 'rtl' ? 'right' : 'left'; + break; + default: + textAlign = 'left'; + } + + // 1.75 is an arbitrary number, as there is no info about the text baseline + switch (this.textBaseline) { + case 'hanging': + case 'top': + offset.y = fontStyle.size / 1.75; + break; + case 'middle': + break; + default: + case null: + case 'alphabetic': + case 'ideographic': + case 'bottom': + offset.y = -fontStyle.size / 2.25; + break; + } + + switch(textAlign) { + case 'right': + left = delta; + right = 0.05; + break; + case 'center': + left = right = delta / 2; + break; + } + + var d = getCoords(this, x + offset.x, y + offset.y); + + lineStr.push(''); + + if (stroke) { + appendStroke(this, lineStr); + } else { + // TODO: Fix the min and max params. + appendFill(this, lineStr, {x: -left, y: 0}, + {x: right, y: fontStyle.size}); + } + + var skewM = m[0][0].toFixed(3) + ',' + m[1][0].toFixed(3) + ',' + + m[0][1].toFixed(3) + ',' + m[1][1].toFixed(3) + ',0,0'; + + var skewOffset = mr(d.x / Z) + ',' + mr(d.y / Z); + + lineStr.push('', + '', + ''); + + this.element_.insertAdjacentHTML('beforeEnd', lineStr.join('')); + }; + + contextPrototype.fillText = function(text, x, y, maxWidth) { + this.drawText_(text, x, y, maxWidth, false); + }; + + contextPrototype.strokeText = function(text, x, y, maxWidth) { + this.drawText_(text, x, y, maxWidth, true); + }; + + contextPrototype.measureText = function(text) { + if (!this.textMeasureEl_) { + var s = ''; + this.element_.insertAdjacentHTML('beforeEnd', s); + this.textMeasureEl_ = this.element_.lastChild; + } + var doc = this.element_.ownerDocument; + this.textMeasureEl_.innerHTML = ''; + this.textMeasureEl_.style.font = this.font; + // Don't use innerHTML or innerText because they allow markup/whitespace. + this.textMeasureEl_.appendChild(doc.createTextNode(text)); + return {width: this.textMeasureEl_.offsetWidth}; + }; + + /******** STUBS ********/ + contextPrototype.clip = function() { + // TODO: Implement + }; + + contextPrototype.arcTo = function() { + // TODO: Implement + }; + + contextPrototype.createPattern = function(image, repetition) { + return new CanvasPattern_(image, repetition); + }; + + // Gradient / Pattern Stubs + function CanvasGradient_(aType) { + this.type_ = aType; + this.x0_ = 0; + this.y0_ = 0; + this.r0_ = 0; + this.x1_ = 0; + this.y1_ = 0; + this.r1_ = 0; + this.colors_ = []; + } + + CanvasGradient_.prototype.addColorStop = function(aOffset, aColor) { + aColor = processStyle(aColor); + this.colors_.push({offset: aOffset, + color: aColor.color, + alpha: aColor.alpha}); + }; + + function CanvasPattern_(image, repetition) { + assertImageIsValid(image); + switch (repetition) { + case 'repeat': + case null: + case '': + this.repetition_ = 'repeat'; + break + case 'repeat-x': + case 'repeat-y': + case 'no-repeat': + this.repetition_ = repetition; + break; + default: + throwException('SYNTAX_ERR'); + } + + this.src_ = image.src; + this.width_ = image.width; + this.height_ = image.height; + } + + function throwException(s) { + throw new DOMException_(s); + } + + function assertImageIsValid(img) { + if (!img || img.nodeType != 1 || img.tagName != 'IMG') { + throwException('TYPE_MISMATCH_ERR'); + } + if (img.readyState != 'complete') { + throwException('INVALID_STATE_ERR'); + } + } + + function DOMException_(s) { + this.code = this[s]; + this.message = s +': DOM Exception ' + this.code; + } + var p = DOMException_.prototype = new Error; + p.INDEX_SIZE_ERR = 1; + p.DOMSTRING_SIZE_ERR = 2; + p.HIERARCHY_REQUEST_ERR = 3; + p.WRONG_DOCUMENT_ERR = 4; + p.INVALID_CHARACTER_ERR = 5; + p.NO_DATA_ALLOWED_ERR = 6; + p.NO_MODIFICATION_ALLOWED_ERR = 7; + p.NOT_FOUND_ERR = 8; + p.NOT_SUPPORTED_ERR = 9; + p.INUSE_ATTRIBUTE_ERR = 10; + p.INVALID_STATE_ERR = 11; + p.SYNTAX_ERR = 12; + p.INVALID_MODIFICATION_ERR = 13; + p.NAMESPACE_ERR = 14; + p.INVALID_ACCESS_ERR = 15; + p.VALIDATION_ERR = 16; + p.TYPE_MISMATCH_ERR = 17; + + // set up externs + G_vmlCanvasManager = G_vmlCanvasManager_; + CanvasRenderingContext2D = CanvasRenderingContext2D_; + CanvasGradient = CanvasGradient_; + CanvasPattern = CanvasPattern_; + DOMException = DOMException_; +})(); + +} // if +else { // make the canvas test simple by kener.linfeng@gmail.com + G_vmlCanvasManager = false; +} +return G_vmlCanvasManager; +}); // define; +/** + * zrender: 公共辅助函数 + * + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + * clone:深度克隆 + * merge:合并源对象的属性到目标对象 + * getContext:获取一个自由使用的canvas 2D context,使用原生方法,如isPointInPath,measureText等 + */ +define( + 'zrender/tool/util',['require','../dep/excanvas'],function(require) { + // 用于处理merge时无法遍历Date等对象的问题 + var BUILTIN_OBJECT = { + '[object Function]': 1, + '[object RegExp]': 1, + '[object Date]': 1, + '[object Error]': 1, + '[object CanvasGradient]': 1 + }; + + /** + * 对一个object进行深度拷贝 + * + * @param {Any} source 需要进行拷贝的对象 + * @return {Any} 拷贝后的新对象 + */ + function clone(source) { + if (typeof source == 'object' && source !== null) { + var result = source; + if (source instanceof Array) { + result = []; + for (var i = 0, len = source.length; i < len; i++) { + result[i] = clone(source[i]); + } + } + else if (!BUILTIN_OBJECT[Object.prototype.toString.call(source)]) { + result = {}; + for (var key in source) { + if (source.hasOwnProperty(key)) { + result[key] = clone(source[key]); + } + } + } + + return result; + } + + return source; + } + + function mergeItem(target, source, key, overwrite) { + if (source.hasOwnProperty(key)) { + if (typeof target[key] == 'object' + && !BUILTIN_OBJECT[ Object.prototype.toString.call(target[key]) ] + ) { + // 如果需要递归覆盖,就递归调用merge + merge( + target[key], + source[key], + overwrite + ); + } + else if (overwrite || !(key in target)) { + // 否则只处理overwrite为true,或者在目标对象中没有此属性的情况 + target[key] = source[key]; + } + } + } + + /** + * 合并源对象的属性到目标对象 + * modify from Tangram + * @param {*} target 目标对象 + * @param {*} source 源对象 + * @param {boolean} overwrite 是否覆盖 + */ + function merge(target, source, overwrite) { + for (var i in source) { + mergeItem(target, source, i, overwrite); + } + + return target; + } + + var _ctx; + + function getContext() { + if (!_ctx) { + require('../dep/excanvas'); + /* jshint ignore:start */ + if (G_vmlCanvasManager) { + var _div = document.createElement('div'); + _div.style.position = 'absolute'; + _div.style.top = '-1000px'; + document.body.appendChild(_div); + + _ctx = G_vmlCanvasManager.initElement(_div) + .getContext('2d'); + } + else { + _ctx = document.createElement('canvas').getContext('2d'); + } + /* jshint ignore:end */ + } + return _ctx; + } + + var _canvas; + var _pixelCtx; + var _width; + var _height; + var _offsetX = 0; + var _offsetY = 0; + + /** + * 获取像素拾取专用的上下文 + * @return {Object} 上下文 + */ + function getPixelContext() { + if (!_pixelCtx) { + _canvas = document.createElement('canvas'); + _width = _canvas.width; + _height = _canvas.height; + _pixelCtx = _canvas.getContext('2d'); + } + return _pixelCtx; + } + + /** + * 如果坐标处在_canvas外部,改变_canvas的大小 + * @param {number} x : 横坐标 + * @param {number} y : 纵坐标 + * 注意 修改canvas的大小 需要重新设置translate + */ + function adjustCanvasSize(x, y) { + // 每次加的长度 + var _v = 100; + var _flag; + + if (x + _offsetX > _width) { + _width = x + _offsetX + _v; + _canvas.width = _width; + _flag = true; + } + + if (y + _offsetY > _height) { + _height = y + _offsetY + _v; + _canvas.height = _height; + _flag = true; + } + + if (x < -_offsetX) { + _offsetX = Math.ceil(-x / _v) * _v; + _width += _offsetX; + _canvas.width = _width; + _flag = true; + } + + if (y < -_offsetY) { + _offsetY = Math.ceil(-y / _v) * _v; + _height += _offsetY; + _canvas.height = _height; + _flag = true; + } + + if (_flag) { + _pixelCtx.translate(_offsetX, _offsetY); + } + } + + /** + * 获取像素canvas的偏移量 + * @return {Object} 偏移量 + */ + function getPixelOffset() { + return { + x : _offsetX, + y : _offsetY + }; + } + + /** + * 查询数组中元素的index + */ + function indexOf(array, value) { + if (array.indexOf) { + return array.indexOf(value); + } + for (var i = 0, len = array.length; i < len; i++) { + if (array[i] === value) { + return i; + } + } + return -1; + } + + /** + * 构造类继承关系 + * + * @param {Function} clazz 源类 + * @param {Function} baseClazz 基类 + */ + function inherits(clazz, baseClazz) { + var clazzPrototype = clazz.prototype; + function F() {} + F.prototype = baseClazz.prototype; + clazz.prototype = new F(); + + for (var prop in clazzPrototype) { + clazz.prototype[prop] = clazzPrototype[prop]; + } + clazz.constructor = clazz; + } + + return { + inherits: inherits, + clone : clone, + merge : merge, + getContext : getContext, + getPixelContext : getPixelContext, + getPixelOffset : getPixelOffset, + adjustCanvasSize : adjustCanvasSize, + indexOf : indexOf + }; + } +); + +/** + * 事件扩展 + * @module zrender/mixin/Eventful + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * pissang (https://www.github.com/pissang) + */ +define('zrender/mixin/Eventful',['require'],function (require) { + + /** + * 事件分发器 + * @alias module:zrender/mixin/Eventful + * @constructor + */ + var Eventful = function () { + this._handlers = {}; + }; + /** + * 单次触发绑定,dispatch后销毁 + * + * @param {string} event 事件名 + * @param {Function} handler 响应函数 + * @param {Object} context + */ + Eventful.prototype.one = function (event, handler, context) { + var _h = this._handlers; + + if (!handler || !event) { + return this; + } + + if (!_h[event]) { + _h[event] = []; + } + + _h[event].push({ + h : handler, + one : true, + ctx: context || this + }); + + return this; + }; + + /** + * 绑定事件 + * @param {string} event 事件名 + * @param {Function} handler 事件处理函数 + * @param {Object} context + */ + Eventful.prototype.bind = function (event, handler, context) { + var _h = this._handlers; + + if (!handler || !event) { + return this; + } + + if (!_h[event]) { + _h[event] = []; + } + + _h[event].push({ + h : handler, + one : false, + ctx: context || this + }); + + return this; + }; + + /** + * 解绑事件 + * @param {string} event 事件名 + * @param {Function} [handler] 事件处理函数 + */ + Eventful.prototype.unbind = function (event, handler) { + var _h = this._handlers; + + if (!event) { + this._handlers = {}; + return this; + } + + if (handler) { + if (_h[event]) { + var newList = []; + for (var i = 0, l = _h[event].length; i < l; i++) { + if (_h[event][i]['h'] != handler) { + newList.push(_h[event][i]); + } + } + _h[event] = newList; + } + + if (_h[event] && _h[event].length === 0) { + delete _h[event]; + } + } + else { + delete _h[event]; + } + + return this; + }; + + /** + * 事件分发 + * + * @param {string} type 事件类型 + */ + Eventful.prototype.dispatch = function (type) { + if (this._handlers[type]) { + var args = arguments; + var argLen = args.length; + + if (argLen > 3) { + args = Array.prototype.slice.call(args, 1); + } + + var _h = this._handlers[type]; + var len = _h.length; + for (var i = 0; i < len;) { + // Optimize advise from backbone + switch (argLen) { + case 1: + _h[i]['h'].call(_h[i]['ctx']); + break; + case 2: + _h[i]['h'].call(_h[i]['ctx'], args[1]); + break; + case 3: + _h[i]['h'].call(_h[i]['ctx'], args[1], args[2]); + break; + default: + // have more than 2 given arguments + _h[i]['h'].apply(_h[i]['ctx'], args); + break; + } + + if (_h[i]['one']) { + _h.splice(i, 1); + len--; + } + else { + i++; + } + } + } + + return this; + }; + + /** + * 带有context的事件分发, 最后一个参数是事件回调的context + * @param {string} type 事件类型 + */ + Eventful.prototype.dispatchWithContext = function (type) { + if (this._handlers[type]) { + var args = arguments; + var argLen = args.length; + + if (argLen > 4) { + args = Array.prototype.slice.call(args, 1, args.length - 1); + } + var ctx = args[args.length - 1]; + + var _h = this._handlers[type]; + var len = _h.length; + for (var i = 0; i < len;) { + // Optimize advise from backbone + switch (argLen) { + case 1: + _h[i]['h'].call(ctx); + break; + case 2: + _h[i]['h'].call(ctx, args[1]); + break; + case 3: + _h[i]['h'].call(ctx, args[1], args[2]); + break; + default: + // have more than 2 given arguments + _h[i]['h'].apply(ctx, args); + break; + } + + if (_h[i]['one']) { + _h.splice(i, 1); + len--; + } + else { + i++; + } + } + } + + return this; + }; + + // 对象可以通过 onxxxx 绑定事件 + /** + * @event module:zrender/mixin/Eventful#onclick + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#onmouseover + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#onmouseout + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#onmousemove + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#onmousewheel + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#onmousedown + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#onmouseup + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#ondragstart + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#ondragend + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#ondragenter + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#ondragleave + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#ondragover + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#ondrop + * @type {Function} + * @default null + */ + + return Eventful; +}); + +/** + * 事件辅助类 + * @module zrender/tool/event + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + */ +define( + 'zrender/tool/event',['require','../mixin/Eventful'],function(require) { + + + + var Eventful = require('../mixin/Eventful'); + + /** + * 提取鼠标(手指)x坐标 + * @memberOf module:zrender/tool/event + * @param {Event} e 事件. + * @return {number} 鼠标(手指)x坐标. + */ + function getX(e) { + return typeof e.zrenderX != 'undefined' && e.zrenderX + || typeof e.offsetX != 'undefined' && e.offsetX + || typeof e.layerX != 'undefined' && e.layerX + || typeof e.clientX != 'undefined' && e.clientX; + } + + /** + * 提取鼠标y坐标 + * @memberOf module:zrender/tool/event + * @param {Event} e 事件. + * @return {number} 鼠标(手指)y坐标. + */ + function getY(e) { + return typeof e.zrenderY != 'undefined' && e.zrenderY + || typeof e.offsetY != 'undefined' && e.offsetY + || typeof e.layerY != 'undefined' && e.layerY + || typeof e.clientY != 'undefined' && e.clientY; + } + + /** + * 提取鼠标滚轮变化 + * @memberOf module:zrender/tool/event + * @param {Event} e 事件. + * @return {number} 滚轮变化,正值说明滚轮是向上滚动,如果是负值说明滚轮是向下滚动 + */ + function getDelta(e) { + return typeof e.zrenderDelta != 'undefined' && e.zrenderDelta + || typeof e.wheelDelta != 'undefined' && e.wheelDelta + || typeof e.detail != 'undefined' && -e.detail; + } + + /** + * 停止冒泡和阻止默认行为 + * @memberOf module:zrender/tool/event + * @method + * @param {Event} e : event对象 + */ + var stop = typeof window.addEventListener === 'function' + ? function (e) { + e.preventDefault(); + e.stopPropagation(); + e.cancelBubble = true; + } + : function (e) { + e.returnValue = false; + e.cancelBubble = true; + }; + + return { + getX : getX, + getY : getY, + getDelta : getDelta, + stop : stop, + // 做向上兼容 + Dispatcher : Eventful + }; + } +); + +/** + * echarts设备环境识别 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author firede[firede@firede.us] + * @desc thanks zepto. + */ +define('zrender/tool/env',[],function() { + // Zepto.js + // (c) 2010-2013 Thomas Fuchs + // Zepto.js may be freely distributed under the MIT license. + + function detect(ua) { + var os = this.os = {}; + var browser = this.browser = {}; + var webkit = ua.match(/Web[kK]it[\/]{0,1}([\d.]+)/); + var android = ua.match(/(Android);?[\s\/]+([\d.]+)?/); + var ipad = ua.match(/(iPad).*OS\s([\d_]+)/); + var ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/); + var iphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/); + var webos = ua.match(/(webOS|hpwOS)[\s\/]([\d.]+)/); + var touchpad = webos && ua.match(/TouchPad/); + var kindle = ua.match(/Kindle\/([\d.]+)/); + var silk = ua.match(/Silk\/([\d._]+)/); + var blackberry = ua.match(/(BlackBerry).*Version\/([\d.]+)/); + var bb10 = ua.match(/(BB10).*Version\/([\d.]+)/); + var rimtabletos = ua.match(/(RIM\sTablet\sOS)\s([\d.]+)/); + var playbook = ua.match(/PlayBook/); + var chrome = ua.match(/Chrome\/([\d.]+)/) || ua.match(/CriOS\/([\d.]+)/); + var firefox = ua.match(/Firefox\/([\d.]+)/); + var ie = ua.match(/MSIE ([\d.]+)/); + var safari = webkit && ua.match(/Mobile\//) && !chrome; + var webview = ua.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/) && !chrome; + var ie = ua.match(/MSIE\s([\d.]+)/); + + // Todo: clean this up with a better OS/browser seperation: + // - discern (more) between multiple browsers on android + // - decide if kindle fire in silk mode is android or not + // - Firefox on Android doesn't specify the Android version + // - possibly devide in os, device and browser hashes + + if (browser.webkit = !!webkit) browser.version = webkit[1]; + + if (android) os.android = true, os.version = android[2]; + if (iphone && !ipod) os.ios = os.iphone = true, os.version = iphone[2].replace(/_/g, '.'); + if (ipad) os.ios = os.ipad = true, os.version = ipad[2].replace(/_/g, '.'); + if (ipod) os.ios = os.ipod = true, os.version = ipod[3] ? ipod[3].replace(/_/g, '.') : null; + if (webos) os.webos = true, os.version = webos[2]; + if (touchpad) os.touchpad = true; + if (blackberry) os.blackberry = true, os.version = blackberry[2]; + if (bb10) os.bb10 = true, os.version = bb10[2]; + if (rimtabletos) os.rimtabletos = true, os.version = rimtabletos[2]; + if (playbook) browser.playbook = true; + if (kindle) os.kindle = true, os.version = kindle[1]; + if (silk) browser.silk = true, browser.version = silk[1]; + if (!silk && os.android && ua.match(/Kindle Fire/)) browser.silk = true; + if (chrome) browser.chrome = true, browser.version = chrome[1]; + if (firefox) browser.firefox = true, browser.version = firefox[1]; + if (ie) browser.ie = true, browser.version = ie[1]; + if (safari && (ua.match(/Safari/) || !!os.ios)) browser.safari = true; + if (webview) browser.webview = true; + if (ie) browser.ie = true, browser.version = ie[1]; + + os.tablet = !!(ipad || playbook || (android && !ua.match(/Mobile/)) || + (firefox && ua.match(/Tablet/)) || (ie && !ua.match(/Phone/) && ua.match(/Touch/))); + os.phone = !!(!os.tablet && !os.ipod && (android || iphone || webos || blackberry || bb10 || + (chrome && ua.match(/Android/)) || (chrome && ua.match(/CriOS\/([\d.]+)/)) || + (firefox && ua.match(/Mobile/)) || (ie && ua.match(/Touch/)))); + + return { + browser: browser, + os: os, + // 原生canvas支持 + canvasSupported : document.createElement('canvas').getContext + ? true : false + }; + } + + return detect(navigator.userAgent); +}); +define('zrender/config',[],function () { + /** + * config默认配置项 + * @exports zrender/config + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + */ + var config = { + /** + * @namespace module:zrender/config.EVENT + */ + EVENT : { + /** + * 窗口大小变化 + * @type {string} + */ + RESIZE : 'resize', + /** + * 鼠标按钮被(手指)按下,事件对象是:目标图形元素或空 + * @type {string} + */ + CLICK : 'click', + /** + * 双击事件 + * @type {string} + */ + DBLCLICK : 'dblclick', + /** + * 鼠标滚轮变化,事件对象是:目标图形元素或空 + * @type {string} + */ + MOUSEWHEEL : 'mousewheel', + /** + * 鼠标(手指)被移动,事件对象是:目标图形元素或空 + * @type {string} + */ + MOUSEMOVE : 'mousemove', + /** + * 鼠标移到某图形元素之上,事件对象是:目标图形元素 + * @type {string} + */ + MOUSEOVER : 'mouseover', + /** + * 鼠标从某图形元素移开,事件对象是:目标图形元素 + * @type {string} + */ + MOUSEOUT : 'mouseout', + /** + * 鼠标按钮(手指)被按下,事件对象是:目标图形元素或空 + * @type {string} + */ + MOUSEDOWN : 'mousedown', + /** + * 鼠标按键(手指)被松开,事件对象是:目标图形元素或空 + * @type {string} + */ + MOUSEUP : 'mouseup', + /** + * 全局离开,MOUSEOUT触发比较频繁,一次离开优化绑定 + * @type {string} + */ + GLOBALOUT : 'globalout', // + + // 一次成功元素拖拽的行为事件过程是: + // dragstart > dragenter > dragover [> dragleave] > drop > dragend + /** + * 开始拖拽时触发,事件对象是:被拖拽图形元素 + * @type {string} + */ + DRAGSTART : 'dragstart', + /** + * 拖拽完毕时触发(在drop之后触发),事件对象是:被拖拽图形元素 + * @type {string} + */ + DRAGEND : 'dragend', + /** + * 拖拽图形元素进入目标图形元素时触发,事件对象是:目标图形元素 + * @type {string} + */ + DRAGENTER : 'dragenter', + /** + * 拖拽图形元素在目标图形元素上移动时触发,事件对象是:目标图形元素 + * @type {string} + */ + DRAGOVER : 'dragover', + /** + * 拖拽图形元素离开目标图形元素时触发,事件对象是:目标图形元素 + * @type {string} + */ + DRAGLEAVE : 'dragleave', + /** + * 拖拽图形元素放在目标图形元素内时触发,事件对象是:目标图形元素 + * @type {string} + */ + DROP : 'drop', + /** + * touch end - start < delay is click + * @type {number} + */ + touchClickDelay : 300 + }, + + // 是否异常捕获 + catchBrushException: false, + + /** + * debug日志选项:catchBrushException为true下有效 + * 0 : 不生成debug数据,发布用 + * 1 : 异常抛出,调试用 + * 2 : 控制台输出,调试用 + */ + debugMode: 0 + }; + return config; +}); + + +define( + 'zrender/tool/log',['require','../config'],function (require) { + var config = require('../config'); + + /** + * @exports zrender/tool/log + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + */ + return function() { + if (config.debugMode === 0) { + return; + } + else if (config.debugMode == 1) { + for (var k in arguments) { + throw new Error(arguments[k]); + } + } + else if (config.debugMode > 1) { + for (var k in arguments) { + console.log(arguments[k]); + } + } + }; + + /* for debug + return function(mes) { + document.getElementById('wrong-message').innerHTML = + mes + ' ' + (new Date() - 0) + + '
' + + document.getElementById('wrong-message').innerHTML; + }; + */ + } +); + +/** + * zrender: 生成唯一id + * + * @author errorrik (errorrik@gmail.com) + */ + +define( + 'zrender/tool/guid',[],function() { + var idStart = 0x0907; + + return function () { + return 'zrender__' + (idStart++); + }; + } +); + +define( + 'zrender/tool/vector',[],function () { + var ArrayCtor = typeof Float32Array === 'undefined' + ? Array + : Float32Array; + /** + * 二维向量类 + * @exports zrender/tool/vector + */ + var vector = { + /** + * 创建一个向量 + * @param {number} [x=0] + * @param {number} [y=0] + * @return {Float32Array|Array.} + */ + create: function (x, y) { + var out = new ArrayCtor(2); + out[0] = x || 0; + out[1] = y || 0; + return out; + }, + + /** + * 复制一个向量 + * @return {Float32Array|Array.} out + * @return {Float32Array|Array.} v + */ + copy: function (out, v) { + out[0] = v[0]; + out[1] = v[1]; + return out; + }, + + /** + * 设置向量的两个项 + * @param {Float32Array|Array.} out + * @param {number} a + * @param {number} b + * @return {Float32Array|Array.} 结果 + */ + set: function (out, a, b) { + out[0] = a; + out[1] = b; + return out; + }, + + /** + * 向量相加 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + */ + add: function (out, v1, v2) { + out[0] = v1[0] + v2[0]; + out[1] = v1[1] + v2[1]; + return out; + }, + + /** + * 向量缩放后相加 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + * @param {number} a + */ + scaleAndAdd: function (out, v1, v2, a) { + out[0] = v1[0] + v2[0] * a; + out[1] = v1[1] + v2[1] * a; + return out; + }, + + /** + * 向量相减 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + */ + sub: function (out, v1, v2) { + out[0] = v1[0] - v2[0]; + out[1] = v1[1] - v2[1]; + return out; + }, + + /** + * 向量长度 + * @param {Float32Array|Array.} v + * @return {number} + */ + len: function (v) { + return Math.sqrt(this.lenSquare(v)); + }, + + /** + * 向量长度平方 + * @param {Float32Array|Array.} v + * @return {number} + */ + lenSquare: function (v) { + return v[0] * v[0] + v[1] * v[1]; + }, + + /** + * 向量乘法 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + */ + mul: function (out, v1, v2) { + out[0] = v1[0] * v2[0]; + out[1] = v1[1] * v2[1]; + return out; + }, + + /** + * 向量除法 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + */ + div: function (out, v1, v2) { + out[0] = v1[0] / v2[0]; + out[1] = v1[1] / v2[1]; + return out; + }, + + /** + * 向量点乘 + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + * @return {number} + */ + dot: function (v1, v2) { + return v1[0] * v2[0] + v1[1] * v2[1]; + }, + + /** + * 向量缩放 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v + * @param {number} s + */ + scale: function (out, v, s) { + out[0] = v[0] * s; + out[1] = v[1] * s; + return out; + }, + + /** + * 向量归一化 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v + */ + normalize: function (out, v) { + var d = vector.len(v); + if (d === 0) { + out[0] = 0; + out[1] = 0; + } + else { + out[0] = v[0] / d; + out[1] = v[1] / d; + } + return out; + }, + + /** + * 计算向量间距离 + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + * @return {number} + */ + distance: function (v1, v2) { + return Math.sqrt( + (v1[0] - v2[0]) * (v1[0] - v2[0]) + + (v1[1] - v2[1]) * (v1[1] - v2[1]) + ); + }, + + /** + * 向量距离平方 + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + * @return {number} + */ + distanceSquare: function (v1, v2) { + return (v1[0] - v2[0]) * (v1[0] - v2[0]) + + (v1[1] - v2[1]) * (v1[1] - v2[1]); + }, + + /** + * 求负向量 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v + */ + negate: function (out, v) { + out[0] = -v[0]; + out[1] = -v[1]; + return out; + }, + + /** + * 插值两个点 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + * @param {number} t + */ + lerp: function (out, v1, v2, t) { + // var ax = v1[0]; + // var ay = v1[1]; + out[0] = v1[0] + t * (v2[0] - v1[0]); + out[1] = v1[1] + t * (v2[1] - v1[1]); + return out; + }, + + /** + * 矩阵左乘向量 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v + * @param {Float32Array|Array.} m + */ + applyTransform: function (out, v, m) { + var x = v[0]; + var y = v[1]; + out[0] = m[0] * x + m[2] * y + m[4]; + out[1] = m[1] * x + m[3] * y + m[5]; + return out; + }, + /** + * 求两个向量最小值 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + */ + min: function (out, v1, v2) { + out[0] = Math.min(v1[0], v2[0]); + out[1] = Math.min(v1[1], v2[1]); + return out; + }, + /** + * 求两个向量最大值 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + */ + max: function (out, v1, v2) { + out[0] = Math.max(v1[0], v2[0]); + out[1] = Math.max(v1[1], v2[1]); + return out; + } + }; + + vector.length = vector.len; + vector.lengthSquare = vector.lenSquare; + vector.dist = vector.distance; + vector.distSquare = vector.distanceSquare; + + return vector; + } +); + +define( + 'zrender/tool/matrix',[],function () { + + var ArrayCtor = typeof Float32Array === 'undefined' + ? Array + : Float32Array; + /** + * 3x2矩阵操作类 + * @exports zrender/tool/matrix + */ + var matrix = { + /** + * 创建一个单位矩阵 + * @return {Float32Array|Array.} + */ + create : function() { + var out = new ArrayCtor(6); + matrix.identity(out); + + return out; + }, + /** + * 设置矩阵为单位矩阵 + * @param {Float32Array|Array.} out + */ + identity : function(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = 0; + out[5] = 0; + return out; + }, + /** + * 复制矩阵 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} m + */ + copy: function(out, m) { + out[0] = m[0]; + out[1] = m[1]; + out[2] = m[2]; + out[3] = m[3]; + out[4] = m[4]; + out[5] = m[5]; + return out; + }, + /** + * 矩阵相乘 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} m1 + * @param {Float32Array|Array.} m2 + */ + mul : function (out, m1, m2) { + out[0] = m1[0] * m2[0] + m1[2] * m2[1]; + out[1] = m1[1] * m2[0] + m1[3] * m2[1]; + out[2] = m1[0] * m2[2] + m1[2] * m2[3]; + out[3] = m1[1] * m2[2] + m1[3] * m2[3]; + out[4] = m1[0] * m2[4] + m1[2] * m2[5] + m1[4]; + out[5] = m1[1] * m2[4] + m1[3] * m2[5] + m1[5]; + return out; + }, + /** + * 平移变换 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} a + * @param {Float32Array|Array.} v + */ + translate : function(out, a, v) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4] + v[0]; + out[5] = a[5] + v[1]; + return out; + }, + /** + * 旋转变换 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} a + * @param {number} rad + */ + rotate : function(out, a, rad) { + var aa = a[0]; + var ac = a[2]; + var atx = a[4]; + var ab = a[1]; + var ad = a[3]; + var aty = a[5]; + var st = Math.sin(rad); + var ct = Math.cos(rad); + + out[0] = aa * ct + ab * st; + out[1] = -aa * st + ab * ct; + out[2] = ac * ct + ad * st; + out[3] = -ac * st + ct * ad; + out[4] = ct * atx + st * aty; + out[5] = ct * aty - st * atx; + return out; + }, + /** + * 缩放变换 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} a + * @param {Float32Array|Array.} v + */ + scale : function(out, a, v) { + var vx = v[0]; + var vy = v[1]; + out[0] = a[0] * vx; + out[1] = a[1] * vy; + out[2] = a[2] * vx; + out[3] = a[3] * vy; + out[4] = a[4] * vx; + out[5] = a[5] * vy; + return out; + }, + /** + * 求逆矩阵 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} a + */ + invert : function(out, a) { + + var aa = a[0]; + var ac = a[2]; + var atx = a[4]; + var ab = a[1]; + var ad = a[3]; + var aty = a[5]; + + var det = aa * ad - ab * ac; + if (!det) { + return null; + } + det = 1.0 / det; + + out[0] = ad * det; + out[1] = -ab * det; + out[2] = -ac * det; + out[3] = aa * det; + out[4] = (ac * aty - ad * atx) * det; + out[5] = (ab * atx - aa * aty) * det; + return out; + }, + + /** + * 矩阵左乘向量 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} a + * @param {Float32Array|Array.} v + */ + mulVector : function(out, a, v) { + var aa = a[0]; + var ac = a[2]; + var atx = a[4]; + var ab = a[1]; + var ad = a[3]; + var aty = a[5]; + + out[0] = v[0] * aa + v[1] * ac + atx; + out[1] = v[0] * ab + v[1] * ad + aty; + + return out; + } + }; + + return matrix; + } +); + +/** + * Handler控制模块 + * @module zrender/Handler + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * errorrik (errorrik@gmail.com) + */ + +define( + 'zrender/Handler',['require','./config','./tool/env','./tool/event','./tool/util','./tool/vector','./tool/matrix','./mixin/Eventful'],function (require) { + + + + var config = require('./config'); + var env = require('./tool/env'); + var eventTool = require('./tool/event'); + var util = require('./tool/util'); + var vec2 = require('./tool/vector'); + var mat2d = require('./tool/matrix'); + var EVENT = config.EVENT; + + var Eventful = require('./mixin/Eventful'); + + var domHandlerNames = [ + 'resize', 'click', 'dblclick', + 'mousewheel', 'mousemove', 'mouseout', 'mouseup', 'mousedown', + 'touchstart', 'touchend', 'touchmove' + ]; + + var domHandlers = { + /** + * 窗口大小改变响应函数 + * @inner + * @param {Event} event + */ + resize: function (event) { + event = event || window.event; + this._lastHover = null; + this._isMouseDown = 0; + + // 分发config.EVENT.RESIZE事件,global + this.dispatch(EVENT.RESIZE, event); + }, + + /** + * 点击响应函数 + * @inner + * @param {Event} event + */ + click: function (event) { + event = this._zrenderEventFixed(event); + + // 分发config.EVENT.CLICK事件 + var _lastHover = this._lastHover; + if ((_lastHover && _lastHover.clickable) + || !_lastHover + ) { + this._dispatchAgency(_lastHover, EVENT.CLICK, event); + } + + this._mousemoveHandler(event); + }, + + /** + * 双击响应函数 + * @inner + * @param {Event} event + */ + dblclick: function (event) { + event = this._zrenderEventFixed(event); + + // 分发config.EVENT.DBLCLICK事件 + var _lastHover = this._lastHover; + if ((_lastHover && _lastHover.clickable) + || !_lastHover + ) { + this._dispatchAgency(_lastHover, EVENT.DBLCLICK, event); + } + + this._mousemoveHandler(event); + }, + + + /** + * 鼠标滚轮响应函数 + * @inner + * @param {Event} event + */ + mousewheel: function (event) { + event = this._zrenderEventFixed(event); + + // http://www.sitepoint.com/html5-javascript-mouse-wheel/ + // https://developer.mozilla.org/en-US/docs/DOM/DOM_event_reference/mousewheel + var delta = event.wheelDelta // Webkit + || -event.detail; // Firefox + var scale = delta > 0 ? 1.1 : 1 / 1.1; + + var layers = this.painter.getLayers(); + + var needsRefresh = false; + for (var z in layers) { + if (z !== 'hover') { + var layer = layers[z]; + var pos = layer.position; + if (layer.zoomable) { + layer.__zoom = layer.__zoom || 1; + var newZoom = layer.__zoom; + newZoom *= scale; + newZoom = Math.max( + Math.min(layer.maxZoom, newZoom), + layer.minZoom + ); + scale = newZoom / layer.__zoom; + layer.__zoom = newZoom; + // Keep the mouse center when scaling + pos[0] -= (this._mouseX - pos[0]) * (scale - 1); + pos[1] -= (this._mouseY - pos[1]) * (scale - 1); + layer.scale[0] *= scale; + layer.scale[1] *= scale; + layer.dirty = true; + needsRefresh = true; + } + } + } + if (needsRefresh) { + this.painter.refresh(); + } + + // 分发config.EVENT.MOUSEWHEEL事件 + this._dispatchAgency(this._lastHover, EVENT.MOUSEWHEEL, event); + this._mousemoveHandler(event); + }, + + /** + * 鼠标(手指)移动响应函数 + * @inner + * @param {Event} event + */ + mousemove: function (event) { + if (this.painter.isLoading()) { + return; + } + + event = this._zrenderEventFixed(event); + this._lastX = this._mouseX; + this._lastY = this._mouseY; + this._mouseX = eventTool.getX(event); + this._mouseY = eventTool.getY(event); + var dx = this._mouseX - this._lastX; + var dy = this._mouseY - this._lastY; + + // 可能出现config.EVENT.DRAGSTART事件 + // 避免手抖点击误认为拖拽 + // if (this._mouseX - this._lastX > 1 || this._mouseY - this._lastY > 1) { + this._processDragStart(event); + // } + this._hasfound = 0; + this._event = event; + + this._iterateAndFindHover(); + + // 找到的在迭代函数里做了处理,没找到得在迭代完后处理 + if (!this._hasfound) { + // 过滤首次拖拽产生的mouseout和dragLeave + if (!this._draggingTarget + || (this._lastHover && this._lastHover != this._draggingTarget) + ) { + // 可能出现config.EVENT.MOUSEOUT事件 + this._processOutShape(event); + + // 可能出现config.EVENT.DRAGLEAVE事件 + this._processDragLeave(event); + } + + this._lastHover = null; + this.storage.delHover(); + this.painter.clearHover(); + } + + // set cursor for root element + var cursor = 'default'; + + // 如果存在拖拽中元素,被拖拽的图形元素最后addHover + if (this._draggingTarget) { + this.storage.drift(this._draggingTarget.id, dx, dy); + this.storage.addHover(this._draggingTarget); + } + else if (this._isMouseDown) { + // Layer dragging + var layers = this.painter.getLayers(); + + var needsRefresh = false; + for (var z in layers) { + if (z !== 'hover') { + var layer = layers[z]; + if (layer.panable) { + // PENDING + cursor = 'move'; + // Keep the mouse center when scaling + layer.position[0] += dx; + layer.position[1] += dy; + needsRefresh = true; + layer.dirty = true; + } + } + } + if (needsRefresh) { + this.painter.refresh(); + } + } + + if (this._draggingTarget || (this._hasfound && this._lastHover.draggable)) { + cursor = 'move'; + } + else if (this._hasfound && this._lastHover.clickable) { + cursor = 'pointer'; + } + this.root.style.cursor = cursor; + + // 分发config.EVENT.MOUSEMOVE事件 + this._dispatchAgency(this._lastHover, EVENT.MOUSEMOVE, event); + + if (this._draggingTarget || this._hasfound || this.storage.hasHoverShape()) { + this.painter.refreshHover(); + } + }, + + /** + * 鼠标(手指)离开响应函数 + * @inner + * @param {Event} event + */ + mouseout: function (event) { + event = this._zrenderEventFixed(event); + + var element = event.toElement || event.relatedTarget; + if (element != this.root) { + while (element && element.nodeType != 9) { + // 忽略包含在root中的dom引起的mouseOut + if (element == this.root) { + this._mousemoveHandler(event); + return; + } + + element = element.parentNode; + } + } + + event.zrenderX = this._lastX; + event.zrenderY = this._lastY; + this.root.style.cursor = 'default'; + this._isMouseDown = 0; + + this._processOutShape(event); + this._processDrop(event); + this._processDragEnd(event); + if (!this.painter.isLoading()) { + this.painter.refreshHover(); + } + + this.dispatch(EVENT.GLOBALOUT, event); + }, + + /** + * 鼠标(手指)按下响应函数 + * @inner + * @param {Event} event + */ + mousedown: function (event) { + if (this._lastDownButton == 2) { + this._lastDownButton = event.button; + this._mouseDownTarget = null; + // 仅作为关闭右键菜单使用 + return; + } + + this._lastMouseDownMoment = new Date(); + event = this._zrenderEventFixed(event); + this._isMouseDown = 1; + + // 分发config.EVENT.MOUSEDOWN事件 + this._mouseDownTarget = this._lastHover; + this._dispatchAgency(this._lastHover, EVENT.MOUSEDOWN, event); + this._lastDownButton = event.button; + }, + + /** + * 鼠标(手指)抬起响应函数 + * @inner + * @param {Event} event + */ + mouseup: function (event) { + event = this._zrenderEventFixed(event); + this.root.style.cursor = 'default'; + this._isMouseDown = 0; + this._mouseDownTarget = null; + + // 分发config.EVENT.MOUSEUP事件 + this._dispatchAgency(this._lastHover, EVENT.MOUSEUP, event); + this._processDrop(event); + this._processDragEnd(event); + }, + + /** + * Touch开始响应函数 + * @inner + * @param {Event} event + */ + touchstart: function (event) { + // eventTool.stop(event);// 阻止浏览器默认事件,重要 + event = this._zrenderEventFixed(event, true); + this._lastTouchMoment = new Date(); + + // 平板补充一次findHover + this._mobildFindFixed(event); + this._mousedownHandler(event); + }, + + /** + * Touch移动响应函数 + * @inner + * @param {Event} event + */ + touchmove: function (event) { + event = this._zrenderEventFixed(event, true); + this._mousemoveHandler(event); + if (this._isDragging) { + eventTool.stop(event);// 阻止浏览器默认事件,重要 + } + }, + + /** + * Touch结束响应函数 + * @inner + * @param {Event} event + */ + touchend: function (event) { + // eventTool.stop(event);// 阻止浏览器默认事件,重要 + event = this._zrenderEventFixed(event, true); + this._mouseupHandler(event); + + var now = new Date(); + if (now - this._lastTouchMoment < EVENT.touchClickDelay) { + this._mobildFindFixed(event); + this._clickHandler(event); + if (now - this._lastClickMoment < EVENT.touchClickDelay / 2) { + this._dblclickHandler(event); + if (this._lastHover && this._lastHover.clickable) { + eventTool.stop(event);// 阻止浏览器默认事件,重要 + } + } + this._lastClickMoment = now; + } + this.painter.clearHover(); + } + }; + + /** + * bind一个参数的function + * + * @inner + * @param {Function} handler 要bind的function + * @param {Object} context 运行时this环境 + * @return {Function} + */ + function bind1Arg(handler, context) { + return function (e) { + return handler.call(context, e); + }; + } + /**function bind2Arg(handler, context) { + return function (arg1, arg2) { + return handler.call(context, arg1, arg2); + }; + }*/ + + function bind3Arg(handler, context) { + return function (arg1, arg2, arg3) { + return handler.call(context, arg1, arg2, arg3); + }; + } + /** + * 为控制类实例初始化dom 事件处理函数 + * + * @inner + * @param {module:zrender/Handler} instance 控制类实例 + */ + function initDomHandler(instance) { + var len = domHandlerNames.length; + while (len--) { + var name = domHandlerNames[len]; + instance['_' + name + 'Handler'] = bind1Arg(domHandlers[name], instance); + } + } + + /** + * @alias module:zrender/Handler + * @constructor + * @extends module:zrender/mixin/Eventful + * @param {HTMLElement} root 绘图区域 + * @param {module:zrender/Storage} storage Storage实例 + * @param {module:zrender/Painter} painter Painter实例 + */ + var Handler = function(root, storage, painter) { + // 添加事件分发器特性 + Eventful.call(this); + + this.root = root; + this.storage = storage; + this.painter = painter; + + // 各种事件标识的私有变量 + // this._hasfound = false; //是否找到hover图形元素 + // this._lastHover = null; //最后一个hover图形元素 + // this._mouseDownTarget = null; + // this._draggingTarget = null; //当前被拖拽的图形元素 + // this._isMouseDown = false; + // this._isDragging = false; + // this._lastMouseDownMoment; + // this._lastTouchMoment; + // this._lastDownButton; + + this._lastX = + this._lastY = + this._mouseX = + this._mouseY = 0; + + this._findHover = bind3Arg(findHover, this); + this._domHover = painter.getDomHover(); + initDomHandler(this); + + // 初始化,事件绑定,支持的所有事件都由如下原生事件计算得来 + if (window.addEventListener) { + window.addEventListener('resize', this._resizeHandler); + + if (env.os.tablet || env.os.phone) { + // mobile支持 + root.addEventListener('touchstart', this._touchstartHandler); + root.addEventListener('touchmove', this._touchmoveHandler); + root.addEventListener('touchend', this._touchendHandler); + } + else { + // mobile的click/move/up/down自己模拟 + root.addEventListener('click', this._clickHandler); + root.addEventListener('dblclick', this._dblclickHandler); + root.addEventListener('mousewheel', this._mousewheelHandler); + root.addEventListener('mousemove', this._mousemoveHandler); + root.addEventListener('mousedown', this._mousedownHandler); + root.addEventListener('mouseup', this._mouseupHandler); + } + root.addEventListener('DOMMouseScroll', this._mousewheelHandler); + root.addEventListener('mouseout', this._mouseoutHandler); + } + else { + window.attachEvent('onresize', this._resizeHandler); + + root.attachEvent('onclick', this._clickHandler); + root.attachEvent('ondblclick ', this._dblclickHandler); + root.attachEvent('onmousewheel', this._mousewheelHandler); + root.attachEvent('onmousemove', this._mousemoveHandler); + root.attachEvent('onmouseout', this._mouseoutHandler); + root.attachEvent('onmousedown', this._mousedownHandler); + root.attachEvent('onmouseup', this._mouseupHandler); + } + }; + + /** + * 自定义事件绑定 + * @param {string} eventName 事件名称,resize,hover,drag,etc~ + * @param {Function} handler 响应函数 + */ + Handler.prototype.on = function (eventName, handler) { + this.bind(eventName, handler); + return this; + }; + + /** + * 自定义事件解绑 + * @param {string} eventName 事件名称,resize,hover,drag,etc~ + * @param {Function} handler 响应函数 + */ + Handler.prototype.un = function (eventName, handler) { + this.unbind(eventName, handler); + return this; + }; + + /** + * 事件触发 + * @param {string} eventName 事件名称,resize,hover,drag,etc~ + * @param {event=} eventArgs event dom事件对象 + */ + Handler.prototype.trigger = function (eventName, eventArgs) { + switch (eventName) { + case EVENT.RESIZE: + case EVENT.CLICK: + case EVENT.DBLCLICK: + case EVENT.MOUSEWHEEL: + case EVENT.MOUSEMOVE: + case EVENT.MOUSEDOWN: + case EVENT.MOUSEUP: + case EVENT.MOUSEOUT: + this['_' + eventName + 'Handler'](eventArgs); + break; + } + }; + + /** + * 释放,解绑所有事件 + */ + Handler.prototype.dispose = function () { + var root = this.root; + + if (window.removeEventListener) { + window.removeEventListener('resize', this._resizeHandler); + + if (env.os.tablet || env.os.phone) { + // mobile支持 + root.removeEventListener('touchstart', this._touchstartHandler); + root.removeEventListener('touchmove', this._touchmoveHandler); + root.removeEventListener('touchend', this._touchendHandler); + } + else { + // mobile的click自己模拟 + root.removeEventListener('click', this._clickHandler); + root.removeEventListener('dblclick', this._dblclickHandler); + root.removeEventListener('mousewheel', this._mousewheelHandler); + root.removeEventListener('mousemove', this._mousemoveHandler); + root.removeEventListener('mousedown', this._mousedownHandler); + root.removeEventListener('mouseup', this._mouseupHandler); + } + root.removeEventListener('DOMMouseScroll', this._mousewheelHandler); + root.removeEventListener('mouseout', this._mouseoutHandler); + } + else { + window.detachEvent('onresize', this._resizeHandler); + + root.detachEvent('onclick', this._clickHandler); + root.detachEvent('dblclick', this._dblclickHandler); + root.detachEvent('onmousewheel', this._mousewheelHandler); + root.detachEvent('onmousemove', this._mousemoveHandler); + root.detachEvent('onmouseout', this._mouseoutHandler); + root.detachEvent('onmousedown', this._mousedownHandler); + root.detachEvent('onmouseup', this._mouseupHandler); + } + + this.root = + this._domHover = + this.storage = + this.painter = null; + + this.un(); + }; + + /** + * 拖拽开始 + * + * @private + * @param {Object} event 事件对象 + */ + Handler.prototype._processDragStart = function (event) { + var _lastHover = this._lastHover; + + if (this._isMouseDown + && _lastHover + && _lastHover.draggable + && !this._draggingTarget + && this._mouseDownTarget == _lastHover + ) { + // 拖拽点击生效时长阀门,某些场景需要降低拖拽敏感度 + if (_lastHover.dragEnableTime && + new Date() - this._lastMouseDownMoment < _lastHover.dragEnableTime + ) { + return; + } + + var _draggingTarget = _lastHover; + this._draggingTarget = _draggingTarget; + this._isDragging = 1; + + _draggingTarget.invisible = true; + this.storage.mod(_draggingTarget.id); + + // 分发config.EVENT.DRAGSTART事件 + this._dispatchAgency( + _draggingTarget, + EVENT.DRAGSTART, + event + ); + this.painter.refresh(); + } + }; + + /** + * 拖拽进入目标元素 + * + * @private + * @param {Object} event 事件对象 + */ + Handler.prototype._processDragEnter = function (event) { + if (this._draggingTarget) { + // 分发config.EVENT.DRAGENTER事件 + this._dispatchAgency( + this._lastHover, + EVENT.DRAGENTER, + event, + this._draggingTarget + ); + } + }; + + /** + * 拖拽在目标元素上移动 + * + * @private + * @param {Object} event 事件对象 + */ + Handler.prototype._processDragOver = function (event) { + if (this._draggingTarget) { + // 分发config.EVENT.DRAGOVER事件 + this._dispatchAgency( + this._lastHover, + EVENT.DRAGOVER, + event, + this._draggingTarget + ); + } + }; + + /** + * 拖拽离开目标元素 + * + * @private + * @param {Object} event 事件对象 + */ + Handler.prototype._processDragLeave = function (event) { + if (this._draggingTarget) { + // 分发config.EVENT.DRAGLEAVE事件 + this._dispatchAgency( + this._lastHover, + EVENT.DRAGLEAVE, + event, + this._draggingTarget + ); + } + }; + + /** + * 拖拽在目标元素上完成 + * + * @private + * @param {Object} event 事件对象 + */ + Handler.prototype._processDrop = function (event) { + if (this._draggingTarget) { + this._draggingTarget.invisible = false; + this.storage.mod(this._draggingTarget.id); + this.painter.refresh(); + + // 分发config.EVENT.DROP事件 + this._dispatchAgency( + this._lastHover, + EVENT.DROP, + event, + this._draggingTarget + ); + } + }; + + /** + * 拖拽结束 + * + * @private + * @param {Object} event 事件对象 + */ + Handler.prototype._processDragEnd = function (event) { + if (this._draggingTarget) { + // 分发config.EVENT.DRAGEND事件 + this._dispatchAgency( + this._draggingTarget, + EVENT.DRAGEND, + event + ); + + this._lastHover = null; + } + + this._isDragging = 0; + this._draggingTarget = null; + }; + + /** + * 鼠标在某个图形元素上移动 + * + * @private + * @param {Object} event 事件对象 + */ + Handler.prototype._processOverShape = function (event) { + // 分发config.EVENT.MOUSEOVER事件 + this._dispatchAgency(this._lastHover, EVENT.MOUSEOVER, event); + }; + + /** + * 鼠标离开某个图形元素 + * + * @private + * @param {Object} event 事件对象 + */ + Handler.prototype._processOutShape = function (event) { + // 分发config.EVENT.MOUSEOUT事件 + this._dispatchAgency(this._lastHover, EVENT.MOUSEOUT, event); + }; + + /** + * 事件分发代理 + * + * @private + * @param {Object} targetShape 目标图形元素 + * @param {string} eventName 事件名称 + * @param {Object} event 事件对象 + * @param {Object=} draggedShape 拖拽事件特有,当前被拖拽图形元素 + */ + Handler.prototype._dispatchAgency = function (targetShape, eventName, event, draggedShape) { + var eventHandler = 'on' + eventName; + var eventPacket = { + type : eventName, + event : event, + target : targetShape, + cancelBubble: false + }; + + var el = targetShape; + + if (draggedShape) { + eventPacket.dragged = draggedShape; + } + + while (el) { + el[eventHandler] + && (eventPacket.cancelBubble = el[eventHandler](eventPacket)); + el.dispatch(eventName, eventPacket); + + el = el.parent; + + if (eventPacket.cancelBubble) { + break; + } + } + + if (targetShape) { + // 冒泡到顶级 zrender 对象 + if (!eventPacket.cancelBubble) { + this.dispatch(eventName, eventPacket); + } + } + else if (!draggedShape) { + // 无hover目标,无拖拽对象,原生事件分发 + this.dispatch(eventName, { + type: eventName, + event: event + }); + } + }; + + /** + * 迭代寻找hover shape + * @private + * @method + */ + Handler.prototype._iterateAndFindHover = (function() { + var invTransform = mat2d.create(); + return function() { + var list = this.storage.getShapeList(); + var currentZLevel; + var currentLayer; + var tmp = [ 0, 0 ]; + for (var i = list.length - 1; i >= 0 ; i--) { + var shape = list[i]; + + if (currentZLevel !== shape.zlevel) { + currentLayer = this.painter.getLayer(shape.zlevel, currentLayer); + tmp[0] = this._mouseX; + tmp[1] = this._mouseY; + + if (currentLayer.needTransform) { + mat2d.invert(invTransform, currentLayer.transform); + vec2.applyTransform(tmp, tmp, invTransform); + } + } + + if (this._findHover(shape, tmp[0], tmp[1])) { + break; + } + } + }; + })(); + + // touch指尖错觉的尝试偏移量配置 + var MOBILE_TOUCH_OFFSETS = [ + { x: 10 }, + { x: -20 }, + { x: 10, y: 10 }, + { y: -20 } + ]; + + // touch有指尖错觉,四向尝试,让touch上的点击更好触发事件 + Handler.prototype._mobildFindFixed = function (event) { + this._lastHover = null; + this._mouseX = event.zrenderX; + this._mouseY = event.zrenderY; + + this._event = event; + + this._iterateAndFindHover(); + + for (var i = 0; !this._lastHover && i < MOBILE_TOUCH_OFFSETS.length ; i++) { + var offset = MOBILE_TOUCH_OFFSETS[ i ]; + offset.x && (this._mouseX += offset.x); + offset.y && (this._mouseX += offset.y); + + this._iterateAndFindHover(); + } + + if (this._lastHover) { + event.zrenderX = this._mouseX; + event.zrenderY = this._mouseY; + } + }; + + /** + * 迭代函数,查找hover到的图形元素并即时做些事件分发 + * + * @inner + * @param {Object} shape 图形元素 + * @param {number} x + * @param {number} y + */ + function findHover(shape, x, y) { + if ( + (this._draggingTarget && this._draggingTarget.id == shape.id) // 迭代到当前拖拽的图形上 + || shape.isSilent() // 打酱油的路过,啥都不响应的shape~ + ) { + return false; + } + + var event = this._event; + if (shape.isCover(x, y)) { + if (shape.hoverable) { + this.storage.addHover(shape); + } + // 查找是否在 clipShape 中 + var p = shape.parent; + while (p) { + if (p.clipShape && !p.clipShape.isCover(this._mouseX, this._mouseY)) { + // 已经被祖先 clip 掉了 + return false; + } + p = p.parent; + } + + if (this._lastHover != shape) { + this._processOutShape(event); + + // 可能出现config.EVENT.DRAGLEAVE事件 + this._processDragLeave(event); + + this._lastHover = shape; + + // 可能出现config.EVENT.DRAGENTER事件 + this._processDragEnter(event); + } + + this._processOverShape(event); + + // 可能出现config.EVENT.DRAGOVER + this._processDragOver(event); + + this._hasfound = 1; + + return true; // 找到则中断迭代查找 + } + + return false; + } + + /** + * 如果存在第三方嵌入的一些dom触发的事件,或touch事件,需要转换一下事件坐标 + * + * @private + */ + Handler.prototype._zrenderEventFixed = function (event, isTouch) { + if (event.zrenderFixed) { + return event; + } + + if (!isTouch) { + event = event || window.event; + // 进入对象优先~ + var target = event.toElement + || event.relatedTarget + || event.srcElement + || event.target; + + if (target && target != this._domHover) { + event.zrenderX = (typeof event.offsetX != 'undefined' + ? event.offsetX + : event.layerX) + + target.offsetLeft; + event.zrenderY = (typeof event.offsetY != 'undefined' + ? event.offsetY + : event.layerY) + + target.offsetTop; + } + } + else { + var touch = event.type != 'touchend' + ? event.targetTouches[0] + : event.changedTouches[0]; + if (touch) { + var rBounding = this.root.getBoundingClientRect(); + // touch事件坐标是全屏的~ + event.zrenderX = touch.clientX - rBounding.left; + event.zrenderY = touch.clientY - rBounding.top; + } + } + + event.zrenderFixed = 1; + return event; + }; + + util.merge(Handler.prototype, Eventful.prototype, true); + + return Handler; + } +); + +/** + * @module zrender/tool/curve + * @author pissang(https://www.github.com/pissang) + */ +define('zrender/tool/curve',['require','./vector'],function(require) { + + var vector = require('./vector'); + + + + var EPSILON = 1e-4; + + var THREE_SQRT = Math.sqrt(3); + var ONE_THIRD = 1 / 3; + + // 临时变量 + var _v0 = vector.create(); + var _v1 = vector.create(); + var _v2 = vector.create(); + // var _v3 = vector.create(); + + function isAroundZero(val) { + return val > -EPSILON && val < EPSILON; + } + function isNotAroundZero(val) { + return val > EPSILON || val < -EPSILON; + } + /* + function evalCubicCoeff(a, b, c, d, t) { + return ((a * t + b) * t + c) * t + d; + } + */ + + /** + * 计算三次贝塞尔值 + * @memberOf module:zrender/tool/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} p3 + * @param {number} t + * @return {number} + */ + function cubicAt(p0, p1, p2, p3, t) { + var onet = 1 - t; + return onet * onet * (onet * p0 + 3 * t * p1) + + t * t * (t * p3 + 3 * onet * p2); + } + + /** + * 计算三次贝塞尔导数值 + * @memberOf module:zrender/tool/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} p3 + * @param {number} t + * @return {number} + */ + function cubicDerivativeAt(p0, p1, p2, p3, t) { + var onet = 1 - t; + return 3 * ( + ((p1 - p0) * onet + 2 * (p2 - p1) * t) * onet + + (p3 - p2) * t * t + ); + } + + /** + * 计算三次贝塞尔方程根,使用盛金公式 + * @memberOf module:zrender/tool/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} p3 + * @param {number} val + * @param {Array.} roots + * @return {number} 有效根数目 + */ + function cubicRootAt(p0, p1, p2, p3, val, roots) { + // Evaluate roots of cubic functions + var a = p3 + 3 * (p1 - p2) - p0; + var b = 3 * (p2 - p1 * 2 + p0); + var c = 3 * (p1 - p0); + var d = p0 - val; + + var A = b * b - 3 * a * c; + var B = b * c - 9 * a * d; + var C = c * c - 3 * b * d; + + var n = 0; + + if (isAroundZero(A) && isAroundZero(B)) { + if (isAroundZero(b)) { + roots[0] = 0; + } + else { + var t1 = -c / b; //t1, t2, t3, b is not zero + if (t1 >=0 && t1 <= 1) { + roots[n++] = t1; + } + } + } + else { + var disc = B * B - 4 * A * C; + + if (isAroundZero(disc)) { + var K = B / A; + var t1 = -b / a + K; // t1, a is not zero + var t2 = -K / 2; // t2, t3 + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + if (t2 >= 0 && t2 <= 1) { + roots[n++] = t2; + } + } + else if (disc > 0) { + var discSqrt = Math.sqrt(disc); + var Y1 = A * b + 1.5 * a * (-B + discSqrt); + var Y2 = A * b + 1.5 * a * (-B - discSqrt); + if (Y1 < 0) { + Y1 = -Math.pow(-Y1, ONE_THIRD); + } + else { + Y1 = Math.pow(Y1, ONE_THIRD); + } + if (Y2 < 0) { + Y2 = -Math.pow(-Y2, ONE_THIRD); + } + else { + Y2 = Math.pow(Y2, ONE_THIRD); + } + var t1 = (-b - (Y1 + Y2)) / (3 * a); + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + } + else { + var T = (2 * A * b - 3 * a * B) / (2 * Math.sqrt(A * A * A)); + var theta = Math.acos(T) / 3; + var ASqrt = Math.sqrt(A); + var tmp = Math.cos(theta); + + var t1 = (-b - 2 * ASqrt * tmp) / (3 * a); + var t2 = (-b + ASqrt * (tmp + THREE_SQRT * Math.sin(theta))) / (3 * a); + var t3 = (-b + ASqrt * (tmp - THREE_SQRT * Math.sin(theta))) / (3 * a); + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + if (t2 >= 0 && t2 <= 1) { + roots[n++] = t2; + } + if (t3 >= 0 && t3 <= 1) { + roots[n++] = t3; + } + } + } + return n; + } + + /** + * 计算三次贝塞尔方程极限值的位置 + * @memberOf module:zrender/tool/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} p3 + * @param {Array.} extrema + * @return {number} 有效数目 + */ + function cubicExtrema(p0, p1, p2, p3, extrema) { + var b = 6 * p2 - 12 * p1 + 6 * p0; + var a = 9 * p1 + 3 * p3 - 3 * p0 - 9 * p2; + var c = 3 * p1 - 3 * p0; + + var n = 0; + if (isAroundZero(a)) { + if (isNotAroundZero(b)) { + var t1 = -c / b; + if (t1 >= 0 && t1 <=1) { + extrema[n++] = t1; + } + } + } + else { + var disc = b * b - 4 * a * c; + if (isAroundZero(disc)) { + extrema[0] = -b / (2 * a); + } + else if (disc > 0) { + var discSqrt = Math.sqrt(disc); + var t1 = (-b + discSqrt) / (2 * a); + var t2 = (-b - discSqrt) / (2 * a); + if (t1 >= 0 && t1 <= 1) { + extrema[n++] = t1; + } + if (t2 >= 0 && t2 <= 1) { + extrema[n++] = t2; + } + } + } + return n; + } + + /** + * 细分三次贝塞尔曲线 + * @memberOf module:zrender/tool/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} p3 + * @param {number} t + * @param {Array.} out + */ + function cubicSubdivide(p0, p1, p2, p3, t, out) { + var p01 = (p1 - p0) * t + p0; + var p12 = (p2 - p1) * t + p1; + var p23 = (p3 - p2) * t + p2; + + var p012 = (p12 - p01) * t + p01; + var p123 = (p23 - p12) * t + p12; + + var p0123 = (p123 - p012) * t + p012; + // Seg0 + out[0] = p0; + out[1] = p01; + out[2] = p012; + out[3] = p0123; + // Seg1 + out[4] = p0123; + out[5] = p123; + out[6] = p23; + out[7] = p3; + } + + /** + * 投射点到三次贝塞尔曲线上,返回投射距离。 + * 投射点有可能会有一个或者多个,这里只返回其中距离最短的一个。 + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @param {number} x3 + * @param {number} y3 + * @param {number} x + * @param {number} y + * @param {Array.} [out] 投射点 + * @return {number} + */ + function cubicProjectPoint( + x0, y0, x1, y1, x2, y2, x3, y3, + x, y, out + ) { + // http://pomax.github.io/bezierinfo/#projections + var t; + var interval = 0.005; + var d = Infinity; + + _v0[0] = x; + _v0[1] = y; + + // 先粗略估计一下可能的最小距离的 t 值 + // PENDING + for (var _t = 0; _t < 1; _t += 0.05) { + _v1[0] = cubicAt(x0, x1, x2, x3, _t); + _v1[1] = cubicAt(y0, y1, y2, y3, _t); + var d1 = vector.distSquare(_v0, _v1); + if (d1 < d) { + t = _t; + d = d1; + } + } + d = Infinity; + + // At most 32 iteration + for (var i = 0; i < 32; i++) { + if (interval < EPSILON) { + break; + } + var prev = t - interval; + var next = t + interval; + // t - interval + _v1[0] = cubicAt(x0, x1, x2, x3, prev); + _v1[1] = cubicAt(y0, y1, y2, y3, prev); + + var d1 = vector.distSquare(_v1, _v0); + + if (prev >= 0 && d1 < d) { + t = prev; + d = d1; + } + else { + // t + interval + _v2[0] = cubicAt(x0, x1, x2, x3, next); + _v2[1] = cubicAt(y0, y1, y2, y3, next); + var d2 = vector.distSquare(_v2, _v0); + + if (next <= 1 && d2 < d) { + t = next; + d = d2; + } + else { + interval *= 0.5; + } + } + } + // t + if (out) { + out[0] = cubicAt(x0, x1, x2, x3, t); + out[1] = cubicAt(y0, y1, y2, y3, t); + } + // console.log(interval, i); + return Math.sqrt(d); + } + + /** + * 计算二次方贝塞尔值 + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} t + * @return {number} + */ + function quadraticAt(p0, p1, p2, t) { + var onet = 1 - t; + return onet * (onet * p0 + 2 * t * p1) + t * t * p2; + } + + /** + * 计算二次方贝塞尔导数值 + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} t + * @return {number} + */ + function quadraticDerivativeAt(p0, p1, p2, t) { + return 2 * ((1 - t) * (p1 - p0) + t * (p2 - p1)); + } + + /** + * 计算二次方贝塞尔方程根 + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} t + * @param {Array.} roots + * @return {number} 有效根数目 + */ + function quadraticRootAt(p0, p1, p2, val, roots) { + var a = p0 - 2 * p1 + p2; + var b = 2 * (p1 - p0); + var c = p0 - val; + + var n = 0; + if (isAroundZero(a)) { + if (isNotAroundZero(b)) { + var t1 = -c / b; + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + } + } + else { + var disc = b * b - 4 * a * c; + if (isAroundZero(disc)) { + var t1 = -b / (2 * a); + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + } + else if (disc > 0) { + var discSqrt = Math.sqrt(disc); + var t1 = (-b + discSqrt) / (2 * a); + var t2 = (-b - discSqrt) / (2 * a); + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + if (t2 >= 0 && t2 <= 1) { + roots[n++] = t2; + } + } + } + return n; + } + + /** + * 计算二次贝塞尔方程极限值 + * @memberOf module:zrender/tool/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @return {number} + */ + function quadraticExtremum(p0, p1, p2) { + var divider = p0 + p2 - 2 * p1; + if (divider === 0) { + // p1 is center of p0 and p2 + return 0.5; + } + else { + return (p0 - p1) / divider; + } + } + + /** + * 投射点到二次贝塞尔曲线上,返回投射距离。 + * 投射点有可能会有一个或者多个,这里只返回其中距离最短的一个。 + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @param {number} x + * @param {number} y + * @param {Array.} out 投射点 + * @return {number} + */ + function quadraticProjectPoint( + x0, y0, x1, y1, x2, y2, + x, y, out + ) { + // http://pomax.github.io/bezierinfo/#projections + var t; + var interval = 0.005; + var d = Infinity; + + _v0[0] = x; + _v0[1] = y; + + // 先粗略估计一下可能的最小距离的 t 值 + // PENDING + for (var _t = 0; _t < 1; _t += 0.05) { + _v1[0] = quadraticAt(x0, x1, x2, _t); + _v1[1] = quadraticAt(y0, y1, y2, _t); + var d1 = vector.distSquare(_v0, _v1); + if (d1 < d) { + t = _t; + d = d1; + } + } + d = Infinity; + + // At most 32 iteration + for (var i = 0; i < 32; i++) { + if (interval < EPSILON) { + break; + } + var prev = t - interval; + var next = t + interval; + // t - interval + _v1[0] = quadraticAt(x0, x1, x2, prev); + _v1[1] = quadraticAt(y0, y1, y2, prev); + + var d1 = vector.distSquare(_v1, _v0); + + if (prev >= 0 && d1 < d) { + t = prev; + d = d1; + } + else { + // t + interval + _v2[0] = quadraticAt(x0, x1, x2, next); + _v2[1] = quadraticAt(y0, y1, y2, next); + var d2 = vector.distSquare(_v2, _v0); + if (next <= 1 && d2 < d) { + t = next; + d = d2; + } + else { + interval *= 0.5; + } + } + } + // t + if (out) { + out[0] = quadraticAt(x0, x1, x2, t); + out[1] = quadraticAt(y0, y1, y2, t); + } + // console.log(interval, i); + return Math.sqrt(d); + } + + return { + + cubicAt: cubicAt, + + cubicDerivativeAt: cubicDerivativeAt, + + cubicRootAt: cubicRootAt, + + cubicExtrema: cubicExtrema, + + cubicSubdivide: cubicSubdivide, + + cubicProjectPoint: cubicProjectPoint, + + quadraticAt: quadraticAt, + + quadraticDerivativeAt: quadraticDerivativeAt, + + quadraticRootAt: quadraticRootAt, + + quadraticExtremum: quadraticExtremum, + + quadraticProjectPoint: quadraticProjectPoint + }; +}); +/** + * zrender: 图形空间辅助类 + * + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * pissang (https://www.github.com/pissang) + * + * isInside:是否在区域内部 + * isOutside:是否在区域外部 + * getTextWidth:测算单行文本宽度 + */ +define( + 'zrender/tool/area',['require','./util','./curve'],function (require) { + + + + var util = require('./util'); + var curve = require('./curve'); + + var _ctx; + + var _textWidthCache = {}; + var _textHeightCache = {}; + var _textWidthCacheCounter = 0; + var _textHeightCacheCounter = 0; + var TEXT_CACHE_MAX = 5000; + + var PI2 = Math.PI * 2; + + function normalizeRadian(angle) { + angle %= PI2; + if (angle < 0) { + angle += PI2; + } + return angle; + } + /** + * 包含判断 + * + * @param {Object} shape : 图形 + * @param {Object} area : 目标区域 + * @param {number} x : 横坐标 + * @param {number} y : 纵坐标 + */ + function isInside(shape, area, x, y) { + if (!area || !shape) { + // 无参数或不支持类型 + return false; + } + var zoneType = shape.type; + + _ctx = _ctx || util.getContext(); + + // 未实现或不可用时(excanvas不支持)则数学运算,主要是line,brokenLine,ring + var _mathReturn = _mathMethod(shape, area, x, y); + if (typeof _mathReturn != 'undefined') { + return _mathReturn; + } + + if (shape.buildPath && _ctx.isPointInPath) { + return _buildPathMethod(shape, _ctx, area, x, y); + } + + // 上面的方法都行不通时 + switch (zoneType) { + case 'heart': // 心形---------10 // Todo,不精确 + case 'droplet':// 水滴----------11 // Todo,不精确 + case 'ellipse': // Todo,不精确 + return true; + // 旋轮曲线 不准确 + case 'trochoid': + var _r = area.location == 'out' + ? area.r1 + area.r2 + area.d + : area.r1 - area.r2 + area.d; + return isInsideCircle(area, x, y, _r); + // 玫瑰线 不准确 + case 'rose' : + return isInsideCircle(area, x, y, area.maxr); + // 路径,椭圆,曲线等-----------------13 + default: + return false; // Todo,暂不支持 + } + } + + /** + * 用数学方法判断,三个方法中最快,但是支持的shape少 + * + * @param {Object} shape : 图形 + * @param {Object} area :目标区域 + * @param {number} x : 横坐标 + * @param {number} y : 纵坐标 + * @return {boolean=} true表示坐标处在图形中 + */ + function _mathMethod(shape, area, x, y) { + var zoneType = shape.type; + // 在矩形内则部分图形需要进一步判断 + switch (zoneType) { + // 贝塞尔曲线 + case 'bezier-curve': + if (typeof(area.cpX2) === 'undefined') { + return isInsideQuadraticStroke( + area.xStart, area.yStart, + area.cpX1, area.cpY1, + area.xEnd, area.yEnd, + area.lineWidth, x, y + ); + } + return isInsideCubicStroke( + area.xStart, area.yStart, + area.cpX1, area.cpY1, + area.cpX2, area.cpY2, + area.xEnd, area.yEnd, + area.lineWidth, x, y + ); + // 线 + case 'line': + return isInsideLine( + area.xStart, area.yStart, + area.xEnd, area.yEnd, + area.lineWidth, x, y + ); + // 折线 + case 'broken-line': + return isInsideBrokenLine( + area.pointList, area.lineWidth, x, y + ); + // 圆环 + case 'ring': + return isInsideRing( + area.x, area.y, area.r0, area.r, x, y + ); + // 圆形 + case 'circle': + return isInsideCircle( + area.x, area.y, area.r, x, y + ); + // 扇形 + case 'sector': + return isInsideSector(area, x, y); + // 多边形 + case 'path': + return isInsidePath( + area.pathArray, Math.max(area.lineWidth, 5), + area.brushType, x, y + ); + case 'polygon': + case 'star': + case 'isogon': + return isInsidePolygon(area.pointList, x, y); + // 文本 + case 'text': + var rect = area.__rect || shape.getRect(area); + return isInsideRect( + rect.x, rect.y, rect.width, rect.height, x, y + ); + // 矩形 + case 'rectangle': + // 图片 + case 'image': + return isInsideRect( + area.x, area.y, area.width, area.height, x, y + ); + } + } + + /** + * 通过buildPath方法来判断,三个方法中较快,但是不支持线条类型的shape, + * 而且excanvas不支持isPointInPath方法 + * + * @param {Object} shape : shape + * @param {Object} context : 上下文 + * @param {Object} area :目标区域 + * @param {number} x : 横坐标 + * @param {number} y : 纵坐标 + * @return {boolean} true表示坐标处在图形中 + */ + function _buildPathMethod(shape, context, area, x, y) { + // 图形类实现路径创建了则用类的path + context.beginPath(); + shape.buildPath(context, area); + context.closePath(); + return context.isPointInPath(x, y); + } + + /** + * !isInside + */ + function isOutside(shape, area, x, y) { + return !isInside(shape, area, x, y); + } + + /** + * 线段包含判断 + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @param {number} lineWidth + * @param {number} x + * @param {number} y + * @return {boolean} + */ + function isInsideLine(x0, y0, x1, y1, lineWidth, x, y) { + if (lineWidth === 0) { + return false; + } + var _l = Math.max(lineWidth, 5); + var _a = 0; + var _b = x0; + // Quick reject + if ( + (y > y0 + _l && y > y1 + _l) + || (y < y0 - _l && y < y1 - _l) + || (x > x0 + _l && x > x1 + _l) + || (x < x0 - _l && x < x1 - _l) + ) { + return false; + } + + if (x0 !== x1) { + _a = (y0 - y1) / (x0 - x1); + _b = (x0 * y1 - x1 * y0) / (x0 - x1) ; + } + else { + return Math.abs(x - x0) <= _l / 2; + } + var tmp = _a * x - y + _b; + var _s = tmp * tmp / (_a * _a + 1); + return _s <= _l / 2 * _l / 2; + } + + /** + * 三次贝塞尔曲线描边包含判断 + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @param {number} x3 + * @param {number} y3 + * @param {number} lineWidth + * @param {number} x + * @param {number} y + * @return {boolean} + */ + function isInsideCubicStroke( + x0, y0, x1, y1, x2, y2, x3, y3, + lineWidth, x, y + ) { + if (lineWidth === 0) { + return false; + } + var _l = Math.max(lineWidth, 5); + // Quick reject + if ( + (y > y0 + _l && y > y1 + _l && y > y2 + _l && y > y3 + _l) + || (y < y0 - _l && y < y1 - _l && y < y2 - _l && y < y3 - _l) + || (x > x0 + _l && x > x1 + _l && x > x2 + _l && x > x3 + _l) + || (x < x0 - _l && x < x1 - _l && x < x2 - _l && x < x3 - _l) + ) { + return false; + } + var d = curve.cubicProjectPoint( + x0, y0, x1, y1, x2, y2, x3, y3, + x, y, null + ); + return d <= _l / 2; + } + + /** + * 二次贝塞尔曲线描边包含判断 + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @param {number} lineWidth + * @param {number} x + * @param {number} y + * @return {boolean} + */ + function isInsideQuadraticStroke( + x0, y0, x1, y1, x2, y2, + lineWidth, x, y + ) { + if (lineWidth === 0) { + return false; + } + var _l = Math.max(lineWidth, 5); + // Quick reject + if ( + (y > y0 + _l && y > y1 + _l && y > y2 + _l) + || (y < y0 - _l && y < y1 - _l && y < y2 - _l) + || (x > x0 + _l && x > x1 + _l && x > x2 + _l) + || (x < x0 - _l && x < x1 - _l && x < x2 - _l) + ) { + return false; + } + var d = curve.quadraticProjectPoint( + x0, y0, x1, y1, x2, y2, + x, y, null + ); + return d <= _l / 2; + } + + /** + * 圆弧描边包含判断 + * @param {number} cx + * @param {number} cy + * @param {number} r + * @param {number} startAngle + * @param {number} endAngle + * @param {boolean} anticlockwise + * @param {number} lineWidth + * @param {number} x + * @param {number} y + * @return {Boolean} + */ + function isInsideArcStroke( + cx, cy, r, startAngle, endAngle, anticlockwise, + lineWidth, x, y + ) { + if (lineWidth === 0) { + return false; + } + var _l = Math.max(lineWidth, 5); + + x -= cx; + y -= cy; + var d = Math.sqrt(x * x + y * y); + if ((d - _l > r) || (d + _l < r)) { + return false; + } + if (anticlockwise) { + startAngle = normalizeRadian(endAngle); + endAngle = normalizeRadian(startAngle); + } else { + startAngle = normalizeRadian(startAngle); + endAngle = normalizeRadian(endAngle); + } + if (startAngle > endAngle) { + endAngle += PI2; + } + + var angle = Math.atan2(y, x); + if (angle < 0) { + angle += PI2; + } + return (angle >= startAngle && angle <= endAngle) + || (angle + PI2 >= startAngle && angle + PI2 <= endAngle); + } + + function isInsideBrokenLine(points, lineWidth, x, y) { + var lineWidth = Math.max(lineWidth, 10); + for (var i = 0, l = points.length - 1; i < l; i++) { + var x0 = points[i][0]; + var y0 = points[i][1]; + var x1 = points[i + 1][0]; + var y1 = points[i + 1][1]; + + if (isInsideLine(x0, y0, x1, y1, lineWidth, x, y)) { + return true; + } + } + + return false; + } + + function isInsideRing(cx, cy, r0, r, x, y) { + var d = (x - cx) * (x - cx) + (y - cy) * (y - cy); + return (d < r * r) && (d > r0 * r0); + } + + /** + * 矩形包含判断 + */ + function isInsideRect(x0, y0, width, height, x, y) { + return x >= x0 && x <= (x0 + width) + && y >= y0 && y <= (y0 + height); + } + + /** + * 圆形包含判断 + */ + function isInsideCircle(x0, y0, r, x, y) { + return (x - x0) * (x - x0) + (y - y0) * (y - y0) + < r * r; + } + + /** + * 扇形包含判断 + */ + function isInsideSector(area, x, y) { + if (!isInsideRing(area.x, area.y, area.r0 || 0, area.r, x, y)) { + // 大圆外或者小圆内直接false + return false; + } + + // 判断夹角 + if (Math.abs(area.endAngle - area.startAngle) >= 360) { + // 大于360度的扇形,在环内就为true + return true; + } + + var angle = (360 + - Math.atan2(y - area.y, x - area.x) / Math.PI + * 180) + % 360; + var endA = (360 + area.endAngle) % 360; + var startA = (360 + area.startAngle) % 360; + if (endA > startA) { + return (angle >= startA && angle <= endA); + } + + return !(angle >= endA && angle <= startA); + } + + /** + * 多边形包含判断 + * 与 canvas 一样采用 non-zero winding rule + */ + function isInsidePolygon(points, x, y) { + var N = points.length; + var w = 0; + + for (var i = 0, j = N - 1; i < N; i++) { + var x0 = points[j][0]; + var y0 = points[j][1]; + var x1 = points[i][0]; + var y1 = points[i][1]; + w += windingLine(x0, y0, x1, y1, x, y); + j = i; + } + return w !== 0; + } + + function windingLine(x0, y0, x1, y1, x, y) { + if ((y > y0 && y > y1) || (y < y0 && y < y1)) { + return 0; + } + if (y1 == y0) { + return 0; + } + var dir = y1 < y0 ? 1 : -1; + var t = (y - y0) / (y1 - y0); + var x_ = t * (x1 - x0) + x0; + + return x_ > x ? dir : 0; + } + + // 临时数组 + var roots = [-1, -1, -1]; + var extrema = [-1, -1]; + + function swapExtrema() { + var tmp = extrema[0]; + extrema[0] = extrema[1]; + extrema[1] = tmp; + } + function windingCubic(x0, y0, x1, y1, x2, y2, x3, y3, x, y) { + // Quick reject + if ( + (y > y0 && y > y1 && y > y2 && y > y3) + || (y < y0 && y < y1 && y < y2 && y < y3) + ) { + return 0; + } + var nRoots = curve.cubicRootAt(y0, y1, y2, y3, y, roots); + if (nRoots === 0) { + return 0; + } + else { + var w = 0; + var nExtrema = -1; + var y0_, y1_; + for (var i = 0; i < nRoots; i++) { + var t = roots[i]; + var x_ = curve.cubicAt(x0, x1, x2, x3, t); + if (x_ < x) { // Quick reject + continue; + } + if (nExtrema < 0) { + nExtrema = curve.cubicExtrema(y0, y1, y2, y3, extrema); + if (extrema[1] < extrema[0] && nExtrema > 1) { + swapExtrema(); + } + y0_ = curve.cubicAt(y0, y1, y2, y3, extrema[0]); + if (nExtrema > 1) { + y1_ = curve.cubicAt(y0, y1, y2, y3, extrema[1]); + } + } + if (nExtrema == 2) { + // 分成三段单调函数 + if (t < extrema[0]) { + w += y0_ < y0 ? 1 : -1; + } + else if (t < extrema[1]) { + w += y1_ < y0_ ? 1 : -1; + } + else { + w += y3 < y1_ ? 1 : -1; + } + } + else { + // 分成两段单调函数 + if (t < extrema[0]) { + w += y0_ < y0 ? 1 : -1; + } + else { + w += y3 < y0_ ? 1 : -1; + } + } + } + return w; + } + } + + function windingQuadratic(x0, y0, x1, y1, x2, y2, x, y) { + // Quick reject + if ( + (y > y0 && y > y1 && y > y2) + || (y < y0 && y < y1 && y < y2) + ) { + return 0; + } + var nRoots = curve.quadraticRootAt(y0, y1, y2, y, roots); + if (nRoots === 0) { + return 0; + } + else { + var t = curve.quadraticExtremum(y0, y1, y2); + if (t >=0 && t <= 1) { + var w = 0; + var y_ = curve.quadraticAt(y0, y1, y2, t); + for (var i = 0; i < nRoots; i++) { + var x_ = curve.quadraticAt(x0, x1, x2, roots[i]); + if (x_ > x) { + continue; + } + if (roots[i] < t) { + w += y_ < y0 ? 1 : -1; + } + else { + w += y2 < y_ ? 1 : -1; + } + } + return w; + } + else { + var x_ = curve.quadraticAt(x0, x1, x2, roots[0]); + if (x_ > x) { + return 0; + } + return y2 < y0 ? 1 : -1; + } + } + } + + // TODO + // Arc 旋转 + function windingArc( + cx, cy, r, startAngle, endAngle, anticlockwise, x, y + ) { + y -= cy; + if (y > r || y < -r) { + return 0; + } + var tmp = Math.sqrt(r * r - y * y); + roots[0] = -tmp; + roots[1] = tmp; + + if (anticlockwise) { + startAngle = normalizeRadian(endAngle); + endAngle = normalizeRadian(startAngle); + } else { + startAngle = normalizeRadian(startAngle); + endAngle = normalizeRadian(endAngle); + } + if (startAngle > endAngle) { + endAngle += PI2; + } + + var w = 0; + for (var i = 0; i < 2; i++) { + var x_ = roots[i]; + if (x_ + cx > x) { + var angle = Math.atan2(y, x_); + var dir = anticlockwise ? 1 : -1; + if (angle < 0) { + angle = PI2 + angle; + } + if ( + (angle >= startAngle && angle <= endAngle) + || (angle + PI2 >= startAngle && angle + PI2 <= endAngle) + ) { + if (angle > Math.PI / 2 && angle < Math.PI * 1.5) { + dir = -dir; + } + w += dir; + } + } + } + return w; + } + + /** + * 路径包含判断 + * 与 canvas 一样采用 non-zero winding rule + */ + function isInsidePath(pathArray, lineWidth, brushType, x, y) { + var w = 0; + var xi = 0; + var yi = 0; + var x0 = 0; + var y0 = 0; + var beginSubpath = true; + + var hasStroke = brushType === 'stroke' || brushType === 'both'; + var hasFill = brushType === 'fill' || brushType === 'both'; + + // var roots = [-1, -1, -1]; + for (var i = 0; i < pathArray.length; i++) { + var seg = pathArray[i]; + var p = seg.points; + // Begin a new subpath + if (beginSubpath || seg.command === 'M') { + if (i > 0) { + // Close previous subpath + if (hasFill) { + w += windingLine(xi, yi, x0, y0, x, y); + } + if (w !== 0) { + return true; + } + } + x0 = p[p.length - 2]; + y0 = p[p.length - 1]; + beginSubpath = false; + } + switch (seg.command) { + case 'M': + xi = p[0]; + yi = p[1]; + break; + case 'L': + if (hasStroke) { + if (isInsideLine( + xi, yi, p[0], p[1], lineWidth, x, y + )) { + return true; + } + } + if (hasFill) { + w += windingLine(xi, yi, p[0], p[1], x, y); + } + xi = p[0]; + yi = p[1]; + break; + case 'C': + if (hasStroke) { + if (isInsideCubicStroke( + xi, yi, p[0], p[1], p[2], p[3], p[4], p[5], + lineWidth, x, y + )) { + return true; + } + } + if (hasFill) { + w += windingCubic( + xi, yi, p[0], p[1], p[2], p[3], p[4], p[5], x, y + ); + } + xi = p[4]; + yi = p[5]; + break; + case 'Q': + if (hasStroke) { + if (isInsideQuadraticStroke( + xi, yi, p[0], p[1], p[2], p[3], + lineWidth, x, y + )) { + return true; + } + } + if (hasFill) { + w += windingQuadratic( + xi, yi, p[0], p[1], p[2], p[3], x, y + ); + } + xi = p[2]; + yi = p[3]; + break; + case 'A': + // TODO Arc 旋转 + // TODO Arc 判断的开销比较大 + var cx = p[0]; + var cy = p[1]; + var rx = p[2]; + var ry = p[3]; + var theta = p[4]; + var dTheta = p[5]; + var x1 = Math.cos(theta) * rx + cx; + var y1 = Math.sin(theta) * ry + cy; + w += windingLine(xi, yi, x1, y1); + // zr 使用scale来模拟椭圆, 这里也对x做一定的缩放 + var _x = (x - cx) * ry / rx + cx; + if (hasStroke) { + if (isInsideArcStroke( + cx, cy, ry, theta, theta + dTheta, 1 - p[7], + lineWidth, _x, y + )) { + return true; + } + } + if (hasFill) { + w += windingArc( + cx, cy, ry, theta, theta + dTheta, 1 - p[7], + _x, y + ); + } + xi = Math.cos(theta + dTheta) * rx + cx; + yi = Math.sin(theta + dTheta) * ry + cy; + break; + case 'z': + if (hasStroke) { + if (isInsideLine( + xi, yi, x0, y0, lineWidth, x, y + )) { + return true; + } + } + beginSubpath = true; + break; + } + } + if (hasFill) { + w += windingLine(xi, yi, x0, y0, x, y); + } + return w !== 0; + } + + /** + * 测算多行文本宽度 + * @param {Object} text + * @param {Object} textFont + */ + function getTextWidth(text, textFont) { + var key = text + ':' + textFont; + if (_textWidthCache[key]) { + return _textWidthCache[key]; + } + _ctx = _ctx || util.getContext(); + _ctx.save(); + + if (textFont) { + _ctx.font = textFont; + } + + text = (text + '').split('\n'); + var width = 0; + for (var i = 0, l = text.length; i < l; i++) { + width = Math.max( + _ctx.measureText(text[i]).width, + width + ); + } + _ctx.restore(); + + _textWidthCache[key] = width; + if (++_textWidthCacheCounter > TEXT_CACHE_MAX) { + // 内存释放 + _textWidthCacheCounter = 0; + _textWidthCache = {}; + } + + return width; + } + + /** + * 测算多行文本高度 + * @param {Object} text + * @param {Object} textFont + */ + function getTextHeight(text, textFont) { + var key = text + ':' + textFont; + if (_textHeightCache[key]) { + return _textHeightCache[key]; + } + + _ctx = _ctx || util.getContext(); + + _ctx.save(); + if (textFont) { + _ctx.font = textFont; + } + + text = (text + '').split('\n'); + // 比较粗暴 + var height = (_ctx.measureText('国').width + 2) * text.length; + + _ctx.restore(); + + _textHeightCache[key] = height; + if (++_textHeightCacheCounter > TEXT_CACHE_MAX) { + // 内存释放 + _textHeightCacheCounter = 0; + _textHeightCache = {}; + } + return height; + } + + return { + isInside : isInside, + isOutside : isOutside, + getTextWidth : getTextWidth, + getTextHeight : getTextHeight, + + isInsidePath: isInsidePath, + isInsidePolygon: isInsidePolygon, + isInsideSector: isInsideSector, + isInsideCircle: isInsideCircle, + isInsideLine: isInsideLine, + isInsideRect: isInsideRect, + isInsideBrokenLine: isInsideBrokenLine + }; + } +); + +/** + * 提供变换扩展 + * @module zrender/mixin/Transformable + * @author pissang (https://www.github.com/pissang) + */ +define('zrender/mixin/Transformable',['require','../tool/matrix','../tool/vector'],function (require) { + + + + var matrix = require('../tool/matrix'); + var vector = require('../tool/vector'); + var origin = [ 0, 0 ]; + + var EPSILON = 5e-5; + + function isAroundZero(val) { + return val > -EPSILON && val < EPSILON; + } + function isNotAroundZero(val) { + return val > EPSILON || val < -EPSILON; + } + + /** + * @alias module:zrender/mixin/Transformable + * @constructor + */ + var Transformable = function () { + + if (!this.position) { + /** + * 平移 + * @type {Array.} + * @default [0, 0] + */ + this.position = [ 0, 0 ]; + } + if (typeof(this.rotation) == 'undefined') { + /** + * 旋转,可以通过数组二三项指定旋转的原点 + * @type {Array.} + * @default [0, 0, 0] + */ + this.rotation = [ 0, 0, 0 ]; + } + if (!this.scale) { + /** + * 缩放,可以通过数组三四项指定缩放的原点 + * @type {Array.} + * @default [1, 1, 0, 0] + */ + this.scale = [ 1, 1, 0, 0 ]; + } + + this.needLocalTransform = false; + + /** + * 是否有坐标变换 + * @type {boolean} + * @readOnly + */ + this.needTransform = false; + }; + + Transformable.prototype = { + + constructor: Transformable, + + updateNeedTransform: function () { + this.needLocalTransform = isNotAroundZero(this.rotation[0]) + || isNotAroundZero(this.position[0]) + || isNotAroundZero(this.position[1]) + || isNotAroundZero(this.scale[0] - 1) + || isNotAroundZero(this.scale[1] - 1); + }, + + /** + * 判断是否需要有坐标变换,更新needTransform属性。 + * 如果有坐标变换, 则从position, rotation, scale以及父节点的transform计算出自身的transform矩阵 + */ + updateTransform: function () { + + this.updateNeedTransform(); + + if (this.parent) { + this.needTransform = this.needLocalTransform || this.parent.needTransform; + } + else { + this.needTransform = this.needLocalTransform; + } + + if (!this.needTransform) { + return; + } + + var m = this.transform || matrix.create(); + matrix.identity(m); + + if (this.needLocalTransform) { + if ( + isNotAroundZero(this.scale[0]) + || isNotAroundZero(this.scale[1]) + ) { + origin[0] = -this.scale[2] || 0; + origin[1] = -this.scale[3] || 0; + var haveOrigin = isNotAroundZero(origin[0]) + || isNotAroundZero(origin[1]); + if (haveOrigin) { + matrix.translate( + m, m, origin + ); + } + matrix.scale(m, m, this.scale); + if (haveOrigin) { + origin[0] = -origin[0]; + origin[1] = -origin[1]; + matrix.translate( + m, m, origin + ); + } + } + + if (this.rotation instanceof Array) { + if (this.rotation[0] !== 0) { + origin[0] = -this.rotation[1] || 0; + origin[1] = -this.rotation[2] || 0; + var haveOrigin = isNotAroundZero(origin[0]) + || isNotAroundZero(origin[1]); + if (haveOrigin) { + matrix.translate( + m, m, origin + ); + } + matrix.rotate(m, m, this.rotation[0]); + if (haveOrigin) { + origin[0] = -origin[0]; + origin[1] = -origin[1]; + matrix.translate( + m, m, origin + ); + } + } + } + else { + if (this.rotation !== 0) { + matrix.rotate(m, m, this.rotation); + } + } + + if ( + isNotAroundZero(this.position[0]) || isNotAroundZero(this.position[1]) + ) { + matrix.translate(m, m, this.position); + } + } + + // 保存这个变换矩阵 + this.transform = m; + + // 应用父节点变换 + if (this.parent && this.parent.needTransform) { + if (this.needLocalTransform) { + matrix.mul(this.transform, this.parent.transform, this.transform); + } + else { + matrix.copy(this.transform, this.parent.transform); + } + } + }, + /** + * 将自己的transform应用到context上 + * @param {Context2D} ctx + */ + setTransform: function (ctx) { + if (this.needTransform) { + var m = this.transform; + ctx.transform( + m[0], m[1], + m[2], m[3], + m[4], m[5] + ); + } + }, + /** + * 设置图形的朝向 + * @param {Array.|Float32Array} target + * @method + */ + lookAt: (function () { + var v = vector.create(); + return function(target) { + if (!this.transform) { + this.transform = matrix.create(); + } + var m = this.transform; + vector.sub(v, target, this.position); + if (isAroundZero(v[0]) && isAroundZero(v[1])) { + return; + } + vector.normalize(v, v); + // Y Axis + // TODO Scale origin ? + m[2] = v[0] * this.scale[1]; + m[3] = v[1] * this.scale[1]; + // X Axis + m[0] = v[1] * this.scale[0]; + m[1] = -v[0] * this.scale[0]; + // Position + m[4] = this.position[0]; + m[5] = this.position[1]; + + this.decomposeTransform(); + }; + })(), + /** + * 分解`transform`矩阵到`position`, `rotation`, `scale` + */ + decomposeTransform: function () { + if (!this.transform) { + return; + } + var m = this.transform; + var sx = m[0] * m[0] + m[1] * m[1]; + var position = this.position; + var scale = this.scale; + var rotation = this.rotation; + if (isNotAroundZero(sx - 1)) { + sx = Math.sqrt(sx); + } + var sy = m[2] * m[2] + m[3] * m[3]; + if (isNotAroundZero(sy - 1)) { + sy = Math.sqrt(sy); + } + position[0] = m[4]; + position[1] = m[5]; + scale[0] = sx; + scale[1] = sy; + scale[2] = scale[3] = 0; + rotation[0] = Math.atan2(-m[1] / sy, m[0] / sx); + rotation[1] = rotation[2] = 0; + } + }; + + return Transformable; +}); + +/** + * 颜色辅助类 + * @module zrender/tool/color + * @author CrossDo (chenhuaimu@baidu.com) + */ +define('zrender/tool/color',['require','../tool/util'],function(require) { + var util = require('../tool/util'); + + var _ctx; + + // Color palette is an array containing the default colors for the chart's + // series. + // When all colors are used, new colors are selected from the start again. + // Defaults to: + // 默认色板 + var palette = [ + '#ff9277', ' #dddd00', ' #ffc877', ' #bbe3ff', ' #d5ffbb', + '#bbbbff', ' #ddb000', ' #b0dd00', ' #e2bbff', ' #ffbbe3', + '#ff7777', ' #ff9900', ' #83dd00', ' #77e3ff', ' #778fff', + '#c877ff', ' #ff77ab', ' #ff6600', ' #aa8800', ' #77c7ff', + '#ad77ff', ' #ff77ff', ' #dd0083', ' #777700', ' #00aa00', + '#0088aa', ' #8400dd', ' #aa0088', ' #dd0000', ' #772e00' + ]; + var _palette = palette; + + var highlightColor = 'rgba(255,255,0,0.5)'; + var _highlightColor = highlightColor; + + // 颜色格式 + /*jshint maxlen: 330 */ + var colorRegExp = /^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i; + + var _nameColors = { + aliceblue : '#f0f8ff', + antiquewhite : '#faebd7', + aqua : '#0ff', + aquamarine : '#7fffd4', + azure : '#f0ffff', + beige : '#f5f5dc', + bisque : '#ffe4c4', + black : '#000', + blanchedalmond : '#ffebcd', + blue : '#00f', + blueviolet : '#8a2be2', + brown : '#a52a2a', + burlywood : '#deb887', + cadetblue : '#5f9ea0', + chartreuse : '#7fff00', + chocolate : '#d2691e', + coral : '#ff7f50', + cornflowerblue : '#6495ed', + cornsilk : '#fff8dc', + crimson : '#dc143c', + cyan : '#0ff', + darkblue : '#00008b', + darkcyan : '#008b8b', + darkgoldenrod : '#b8860b', + darkgray : '#a9a9a9', + darkgrey : '#a9a9a9', + darkgreen : '#006400', + darkkhaki : '#bdb76b', + darkmagenta : '#8b008b', + darkolivegreen : '#556b2f', + darkorange : '#ff8c00', + darkorchid : '#9932cc', + darkred : '#8b0000', + darksalmon : '#e9967a', + darkseagreen : '#8fbc8f', + darkslateblue : '#483d8b', + darkslategray : '#2f4f4f', + darkslategrey : '#2f4f4f', + darkturquoise : '#00ced1', + darkviolet : '#9400d3', + deeppink : '#ff1493', + deepskyblue : '#00bfff', + dimgray : '#696969', + dimgrey : '#696969', + dodgerblue : '#1e90ff', + firebrick : '#b22222', + floralwhite : '#fffaf0', + forestgreen : '#228b22', + fuchsia : '#f0f', + gainsboro : '#dcdcdc', + ghostwhite : '#f8f8ff', + gold : '#ffd700', + goldenrod : '#daa520', + gray : '#808080', + grey : '#808080', + green : '#008000', + greenyellow : '#adff2f', + honeydew : '#f0fff0', + hotpink : '#ff69b4', + indianred : '#cd5c5c', + indigo : '#4b0082', + ivory : '#fffff0', + khaki : '#f0e68c', + lavender : '#e6e6fa', + lavenderblush : '#fff0f5', + lawngreen : '#7cfc00', + lemonchiffon : '#fffacd', + lightblue : '#add8e6', + lightcoral : '#f08080', + lightcyan : '#e0ffff', + lightgoldenrodyellow : '#fafad2', + lightgray : '#d3d3d3', + lightgrey : '#d3d3d3', + lightgreen : '#90ee90', + lightpink : '#ffb6c1', + lightsalmon : '#ffa07a', + lightseagreen : '#20b2aa', + lightskyblue : '#87cefa', + lightslategray : '#789', + lightslategrey : '#789', + lightsteelblue : '#b0c4de', + lightyellow : '#ffffe0', + lime : '#0f0', + limegreen : '#32cd32', + linen : '#faf0e6', + magenta : '#f0f', + maroon : '#800000', + mediumaquamarine : '#66cdaa', + mediumblue : '#0000cd', + mediumorchid : '#ba55d3', + mediumpurple : '#9370d8', + mediumseagreen : '#3cb371', + mediumslateblue : '#7b68ee', + mediumspringgreen : '#00fa9a', + mediumturquoise : '#48d1cc', + mediumvioletred : '#c71585', + midnightblue : '#191970', + mintcream : '#f5fffa', + mistyrose : '#ffe4e1', + moccasin : '#ffe4b5', + navajowhite : '#ffdead', + navy : '#000080', + oldlace : '#fdf5e6', + olive : '#808000', + olivedrab : '#6b8e23', + orange : '#ffa500', + orangered : '#ff4500', + orchid : '#da70d6', + palegoldenrod : '#eee8aa', + palegreen : '#98fb98', + paleturquoise : '#afeeee', + palevioletred : '#d87093', + papayawhip : '#ffefd5', + peachpuff : '#ffdab9', + peru : '#cd853f', + pink : '#ffc0cb', + plum : '#dda0dd', + powderblue : '#b0e0e6', + purple : '#800080', + red : '#f00', + rosybrown : '#bc8f8f', + royalblue : '#4169e1', + saddlebrown : '#8b4513', + salmon : '#fa8072', + sandybrown : '#f4a460', + seagreen : '#2e8b57', + seashell : '#fff5ee', + sienna : '#a0522d', + silver : '#c0c0c0', + skyblue : '#87ceeb', + slateblue : '#6a5acd', + slategray : '#708090', + slategrey : '#708090', + snow : '#fffafa', + springgreen : '#00ff7f', + steelblue : '#4682b4', + tan : '#d2b48c', + teal : '#008080', + thistle : '#d8bfd8', + tomato : '#ff6347', + turquoise : '#40e0d0', + violet : '#ee82ee', + wheat : '#f5deb3', + white : '#fff', + whitesmoke : '#f5f5f5', + yellow : '#ff0', + yellowgreen : '#9acd32' + }; + + /** + * 自定义调色板 + */ + function customPalette(userPalete) { + palette = userPalete; + } + + /** + * 复位默认色板 + */ + function resetPalette() { + palette = _palette; + } + + /** + * 获取色板颜色 + * @memberOf module:zrender/tool/color + * @param {number} idx 色板位置 + * @param {Array.} [userPalete] 自定义色板 + * @return {string} 颜色 + */ + function getColor(idx, userPalete) { + idx = idx | 0; + userPalete = userPalete || palette; + return userPalete[idx % userPalete.length]; + } + + /** + * 自定义默认高亮颜色 + */ + function customHighlight(userHighlightColor) { + highlightColor = userHighlightColor; + } + + /** + * 重置默认高亮颜色 + */ + function resetHighlight() { + _highlightColor = highlightColor; + } + + /** + * 获取默认高亮颜色 + */ + function getHighlightColor() { + return highlightColor; + } + + /** + * 径向渐变 + * @memberOf module:zrender/tool/color + * @param {number} x0 渐变起点 + * @param {number} y0 + * @param {number} r0 + * @param {number} x1 渐变终点 + * @param {number} y1 + * @param {number} r1 + * @param {Array} colorList 颜色列表 + * @return {CanvasGradient} + */ + function getRadialGradient(x0, y0, r0, x1, y1, r1, colorList) { + if (!_ctx) { + _ctx = util.getContext(); + } + var gradient = _ctx.createRadialGradient(x0, y0, r0, x1, y1, r1); + for (var i = 0, l = colorList.length; i < l; i++) { + gradient.addColorStop(colorList[i][0], colorList[i][1]); + } + gradient.__nonRecursion = true; + return gradient; + } + + /** + * 线性渐变 + * @param {Object} x0 渐变起点 + * @param {Object} y0 + * @param {Object} x1 渐变终点 + * @param {Object} y1 + * @param {Array} colorList 颜色列表 + */ + function getLinearGradient(x0, y0, x1, y1, colorList) { + if (!_ctx) { + _ctx = util.getContext(); + } + var gradient = _ctx.createLinearGradient(x0, y0, x1, y1); + for (var i = 0, l = colorList.length; i < l; i++) { + gradient.addColorStop(colorList[i][0], colorList[i][1]); + } + gradient.__nonRecursion = true; + return gradient; + } + + /** + * 获取两种颜色之间渐变颜色数组 + * @param {color} start 起始颜色 + * @param {color} end 结束颜色 + * @param {number} step 渐变级数 + * @return {Array} 颜色数组 + */ + function getStepColors(start, end, step) { + start = toRGBA(start); + end = toRGBA(end); + start = getData(start); + end = getData(end); + + var colors = []; + var stepR = (end[0] - start[0]) / step; + var stepG = (end[1] - start[1]) / step; + var stepB = (end[2] - start[2]) / step; + // 生成颜色集合 + // fix by linfeng 颜色堆积 + for (var i = 0, r = start[0], g = start[1], b = start[2]; i < step; i++ + ) { + colors[i] = toColor([ + adjust(Math.floor(r), [ 0, 255 ]), + adjust(Math.floor(g), [ 0, 255 ]), + adjust(Math.floor(b), [ 0, 255 ]) + ]); + r += stepR; + g += stepG; + b += stepB; + } + r = end[0]; + g = end[1]; + b = end[2]; + colors[i] = toColor([ r, g, b ]); + return colors; + } + + /** + * 获取指定级数的渐变颜色数组 + * @memberOf module:zrender/tool/color + * @param {Array.} colors 颜色组 + * @param {number} [step=20] 渐变级数 + * @return {Array.} 颜色数组 + */ + function getGradientColors(colors, step) { + var ret = []; + var len = colors.length; + if (step === undefined) { + step = 20; + } + if (len === 1) { + ret = getStepColors(colors[0], colors[0], step); + } + else if (len > 1) { + for (var i = 0, n = len - 1; i < n; i++) { + var steps = getStepColors(colors[i], colors[i + 1], step); + if (i < n - 1) { + steps.pop(); + } + ret = ret.concat(steps); + } + } + return ret; + } + + /** + * 颜色值数组转为指定格式颜色,例如:
+ * data = [60,20,20,0.1] format = 'rgba' + * 返回:rgba(60,20,20,0.1) + * @param {Array} data 颜色值数组 + * @param {string} format 格式,默认rgb + * @return {string} 颜色 + */ + function toColor(data, format) { + format = format || 'rgb'; + if (data && (data.length === 3 || data.length === 4)) { + data = map(data, + function(c) { + return c > 1 ? Math.ceil(c) : c; + } + ); + + if (format.indexOf('hex') > -1) { + return '#' + ((1 << 24) + (data[0] << 16) + (data[1] << 8) + (+data[2])).toString(16).slice(1); + } + else if (format.indexOf('hs') > -1) { + var sx = map(data.slice(1, 3), + function(c) { + return c + '%'; + } + ); + data[1] = sx[0]; + data[2] = sx[1]; + } + + if (format.indexOf('a') > -1) { + if (data.length === 3) { + data.push(1); + } + data[3] = adjust(data[3], [ 0, 1 ]); + return format + '(' + data.slice(0, 4).join(',') + ')'; + } + + return format + '(' + data.slice(0, 3).join(',') + ')'; + } + } + + /** + * 颜色字符串转换为rgba数组 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {Array.} 颜色值数组 + */ + function toArray(color) { + color = trim(color); + if (color.indexOf('rgba') < 0) { + color = toRGBA(color); + } + + var data = []; + var i = 0; + color.replace(/[\d.]+/g, function (n) { + if (i < 3) { + n = n | 0; + } + else { + // Alpha + n = +n; + } + data[i++] = n; + }); + return data; + } + + /** + * 颜色格式转化 + * + * @param {string} color 颜色值数组 + * @param {string} format 格式,默认rgb + * @return {string} 颜色 + */ + function convert(color, format) { + var data = getData(color); + var alpha = data[3]; + if (typeof alpha === 'undefined') { + alpha = 1; + } + + if (color.indexOf('hsb') > -1) { + data = _HSV_2_RGB(data); + } + else if (color.indexOf('hsl') > -1) { + data = _HSL_2_RGB(data); + } + + if (format.indexOf('hsb') > -1 || format.indexOf('hsv') > -1) { + data = _RGB_2_HSB(data); + } + else if (format.indexOf('hsl') > -1) { + data = _RGB_2_HSL(data); + } + + data[3] = alpha; + + return toColor(data, format); + } + + /** + * 转换为rgba格式的颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} rgba颜色,rgba(r,g,b,a) + */ + function toRGBA(color) { + return convert(color, 'rgba'); + } + + /** + * 转换为rgb数字格式的颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} rgb颜色,rgb(0,0,0)格式 + */ + function toRGB(color) { + return convert(color, 'rgb'); + } + + /** + * 转换为16进制颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} 16进制颜色,#rrggbb格式 + */ + function toHex(color) { + return convert(color, 'hex'); + } + + /** + * 转换为HSV颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} HSVA颜色,hsva(h,s,v,a) + */ + function toHSVA(color) { + return convert(color, 'hsva'); + } + + /** + * 转换为HSV颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} HSV颜色,hsv(h,s,v) + */ + function toHSV(color) { + return convert(color, 'hsv'); + } + + /** + * 转换为HSBA颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} HSBA颜色,hsba(h,s,b,a) + */ + function toHSBA(color) { + return convert(color, 'hsba'); + } + + /** + * 转换为HSB颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} HSB颜色,hsb(h,s,b) + */ + function toHSB(color) { + return convert(color, 'hsb'); + } + + /** + * 转换为HSLA颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} HSLA颜色,hsla(h,s,l,a) + */ + function toHSLA(color) { + return convert(color, 'hsla'); + } + + /** + * 转换为HSL颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} HSL颜色,hsl(h,s,l) + */ + function toHSL(color) { + return convert(color, 'hsl'); + } + + /** + * 转换颜色名 + * + * @param {string} color 颜色 + * @return {string} 颜色名 + */ + function toName(color) { + for (var key in _nameColors) { + if (toHex(_nameColors[key]) === toHex(color)) { + return key; + } + } + return null; + } + + /** + * 移除颜色中多余空格 + * + * @param {string} color 颜色 + * @return {string} 无空格颜色 + */ + function trim(color) { + return String(color).replace(/\s+/g, ''); + } + + /** + * 颜色规范化 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} 规范化后的颜色 + */ + function normalize(color) { + // 颜色名 + if (_nameColors[color]) { + color = _nameColors[color]; + } + // 去掉空格 + color = trim(color); + // hsv与hsb等价 + color = color.replace(/hsv/i, 'hsb'); + // rgb转为rrggbb + if (/^#[\da-f]{3}$/i.test(color)) { + color = parseInt(color.slice(1), 16); + var r = (color & 0xf00) << 8; + var g = (color & 0xf0) << 4; + var b = color & 0xf; + + color = '#' + ((1 << 24) + (r << 4) + r + (g << 4) + g + (b << 4) + b).toString(16).slice(1); + } + // 或者使用以下正则替换,不过 chrome 下性能相对差点 + // color = color.replace(/^#([\da-f])([\da-f])([\da-f])$/i, '#$1$1$2$2$3$3'); + return color; + } + + /** + * 颜色加深或减淡,当level>0加深,当level<0减淡 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @param {number} level 升降程度,取值区间[-1,1] + * @return {string} 加深或减淡后颜色值 + */ + function lift(color, level) { + var direct = level > 0 ? 1 : -1; + if (typeof level === 'undefined') { + level = 0; + } + level = Math.abs(level) > 1 ? 1 : Math.abs(level); + color = toRGB(color); + var data = getData(color); + for (var i = 0; i < 3; i++) { + if (direct === 1) { + data[i] = data[i] * (1 - level) | 0; + } + else { + data[i] = ((255 - data[i]) * level + data[i]) | 0; + } + } + return 'rgb(' + data.join(',') + ')'; + } + + /** + * 颜色翻转,[255-r,255-g,255-b,1-a] + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} 翻转颜色 + */ + function reverse(color) { + var data = getData(toRGBA(color)); + data = map(data, + function(c) { + return 255 - c; + } + ); + return toColor(data, 'rgb'); + } + + /** + * 简单两种颜色混合 + * @memberOf module:zrender/tool/color + * @param {string} color1 第一种颜色 + * @param {string} color2 第二种颜色 + * @param {number} weight 混合权重[0-1] + * @return {string} 结果色,rgb(r,g,b)或rgba(r,g,b,a) + */ + function mix(color1, color2, weight) { + if (typeof weight === 'undefined') { + weight = 0.5; + } + weight = 1 - adjust(weight, [ 0, 1 ]); + + var w = weight * 2 - 1; + var data1 = getData(toRGBA(color1)); + var data2 = getData(toRGBA(color2)); + + var d = data1[3] - data2[3]; + + var weight1 = (((w * d === -1) ? w : (w + d) / (1 + w * d)) + 1) / 2; + var weight2 = 1 - weight1; + + var data = []; + + for (var i = 0; i < 3; i++) { + data[i] = data1[i] * weight1 + data2[i] * weight2; + } + + var alpha = data1[3] * weight + data2[3] * (1 - weight); + alpha = Math.max(0, Math.min(1, alpha)); + + if (data1[3] === 1 && data2[3] === 1) {// 不考虑透明度 + return toColor(data, 'rgb'); + } + data[3] = alpha; + return toColor(data, 'rgba'); + } + + /** + * 随机颜色 + * + * @return {string} 颜色值,#rrggbb格式 + */ + function random() { + return '#' + Math.random().toString(16).slice(2, 8); + } + + /** + * 获取颜色值数组,返回值范围:
+ * RGB 范围[0-255]
+ * HSL/HSV/HSB 范围[0-1]
+ * A透明度范围[0-1] + * 支持格式: + * #rgb + * #rrggbb + * rgb(r,g,b) + * rgb(r%,g%,b%) + * rgba(r,g,b,a) + * hsb(h,s,b) // hsv与hsb等价 + * hsb(h%,s%,b%) + * hsba(h,s,b,a) + * hsl(h,s,l) + * hsl(h%,s%,l%) + * hsla(h,s,l,a) + * + * @param {string} color 颜色 + * @return {Array.} 颜色值数组或null + */ + function getData(color) { + color = normalize(color); + var r = color.match(colorRegExp); + if (r === null) { + throw new Error('The color format error'); // 颜色格式错误 + } + var d; + var a; + var data = []; + var rgb; + + if (r[2]) { + // #rrggbb + d = r[2].replace('#', '').split(''); + rgb = [ d[0] + d[1], d[2] + d[3], d[4] + d[5] ]; + data = map(rgb, + function(c) { + return adjust(parseInt(c, 16), [ 0, 255 ]); + } + ); + + } + else if (r[4]) { + // rgb rgba + var rgba = (r[4]).split(','); + a = rgba[3]; + rgb = rgba.slice(0, 3); + data = map( + rgb, + function(c) { + c = Math.floor( + c.indexOf('%') > 0 ? parseInt(c, 0) * 2.55 : c + ); + return adjust(c, [ 0, 255 ]); + } + ); + + if (typeof a !== 'undefined') { + data.push(adjust(parseFloat(a), [ 0, 1 ])); + } + } + else if (r[5] || r[6]) { + // hsb hsba hsl hsla + var hsxa = (r[5] || r[6]).split(','); + var h = parseInt(hsxa[0], 0) / 360; + var s = hsxa[1]; + var x = hsxa[2]; + a = hsxa[3]; + data = map([ s, x ], + function(c) { + return adjust(parseFloat(c) / 100, [ 0, 1 ]); + } + ); + data.unshift(h); + if (typeof a !== 'undefined') { + data.push(adjust(parseFloat(a), [ 0, 1 ])); + } + } + return data; + } + + /** + * 设置颜色透明度 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @param {number} a 透明度,区间[0,1] + * @return {string} rgba颜色值 + */ + function alpha(color, a) { + if (a === null) { + a = 1; + } + var data = getData(toRGBA(color)); + data[3] = adjust(Number(a).toFixed(4), [ 0, 1 ]); + + return toColor(data, 'rgba'); + } + + // 数组映射 + function map(array, fun) { + if (typeof fun !== 'function') { + throw new TypeError(); + } + var len = array ? array.length : 0; + for (var i = 0; i < len; i++) { + array[i] = fun(array[i]); + } + return array; + } + + // 调整值区间 + function adjust(value, region) { + // < to <= & > to >= + // modify by linzhifeng 2014-05-25 because -0 == 0 + if (value <= region[0]) { + value = region[0]; + } + else if (value >= region[1]) { + value = region[1]; + } + return value; + } + + // 参见 http:// www.easyrgb.com/index.php?X=MATH + function _HSV_2_RGB(data) { + var H = data[0]; + var S = data[1]; + var V = data[2]; + // HSV from 0 to 1 + var R; + var G; + var B; + if (S === 0) { + R = V * 255; + G = V * 255; + B = V * 255; + } + else { + var h = H * 6; + if (h === 6) { + h = 0; + } + var i = h | 0; + var v1 = V * (1 - S); + var v2 = V * (1 - S * (h - i)); + var v3 = V * (1 - S * (1 - (h - i))); + var r = 0; + var g = 0; + var b = 0; + + if (i === 0) { + r = V; + g = v3; + b = v1; + } + else if (i === 1) { + r = v2; + g = V; + b = v1; + } + else if (i === 2) { + r = v1; + g = V; + b = v3; + } + else if (i === 3) { + r = v1; + g = v2; + b = V; + } + else if (i === 4) { + r = v3; + g = v1; + b = V; + } + else { + r = V; + g = v1; + b = v2; + } + + // RGB results from 0 to 255 + R = r * 255; + G = g * 255; + B = b * 255; + } + return [ R, G, B ]; + } + + function _HSL_2_RGB(data) { + var H = data[0]; + var S = data[1]; + var L = data[2]; + // HSL from 0 to 1 + var R; + var G; + var B; + if (S === 0) { + R = L * 255; + G = L * 255; + B = L * 255; + } + else { + var v2; + if (L < 0.5) { + v2 = L * (1 + S); + } + else { + v2 = (L + S) - (S * L); + } + + var v1 = 2 * L - v2; + + R = 255 * _HUE_2_RGB(v1, v2, H + (1 / 3)); + G = 255 * _HUE_2_RGB(v1, v2, H); + B = 255 * _HUE_2_RGB(v1, v2, H - (1 / 3)); + } + return [ R, G, B ]; + } + + function _HUE_2_RGB(v1, v2, vH) { + if (vH < 0) { + vH += 1; + } + if (vH > 1) { + vH -= 1; + } + if ((6 * vH) < 1) { + return (v1 + (v2 - v1) * 6 * vH); + } + if ((2 * vH) < 1) { + return (v2); + } + if ((3 * vH) < 2) { + return (v1 + (v2 - v1) * ((2 / 3) - vH) * 6); + } + return v1; + } + + function _RGB_2_HSB(data) { + // RGB from 0 to 255 + var R = (data[0] / 255); + var G = (data[1] / 255); + var B = (data[2] / 255); + + var vMin = Math.min(R, G, B); // Min. value of RGB + var vMax = Math.max(R, G, B); // Max. value of RGB + var delta = vMax - vMin; // Delta RGB value + var V = vMax; + var H; + var S; + + // HSV results from 0 to 1 + if (delta === 0) { + H = 0; + S = 0; + } + else { + S = delta / vMax; + + var deltaR = (((vMax - R) / 6) + (delta / 2)) / delta; + var deltaG = (((vMax - G) / 6) + (delta / 2)) / delta; + var deltaB = (((vMax - B) / 6) + (delta / 2)) / delta; + + if (R === vMax) { + H = deltaB - deltaG; + } + else if (G === vMax) { + H = (1 / 3) + deltaR - deltaB; + } + else if (B === vMax) { + H = (2 / 3) + deltaG - deltaR; + } + + if (H < 0) { + H += 1; + } + if (H > 1) { + H -= 1; + } + } + H = H * 360; + S = S * 100; + V = V * 100; + return [ H, S, V ]; + } + + function _RGB_2_HSL(data) { + // RGB from 0 to 255 + var R = (data[0] / 255); + var G = (data[1] / 255); + var B = (data[2] / 255); + + var vMin = Math.min(R, G, B); // Min. value of RGB + var vMax = Math.max(R, G, B); // Max. value of RGB + var delta = vMax - vMin; // Delta RGB value + + var L = (vMax + vMin) / 2; + var H; + var S; + // HSL results from 0 to 1 + if (delta === 0) { + H = 0; + S = 0; + } + else { + if (L < 0.5) { + S = delta / (vMax + vMin); + } + else { + S = delta / (2 - vMax - vMin); + } + + var deltaR = (((vMax - R) / 6) + (delta / 2)) / delta; + var deltaG = (((vMax - G) / 6) + (delta / 2)) / delta; + var deltaB = (((vMax - B) / 6) + (delta / 2)) / delta; + + if (R === vMax) { + H = deltaB - deltaG; + } + else if (G === vMax) { + H = (1 / 3) + deltaR - deltaB; + } + else if (B === vMax) { + H = (2 / 3) + deltaG - deltaR; + } + + if (H < 0) { + H += 1; + } + + if (H > 1) { + H -= 1; + } + } + + H = H * 360; + S = S * 100; + L = L * 100; + + return [ H, S, L ]; + } + + return { + customPalette : customPalette, + resetPalette : resetPalette, + getColor : getColor, + getHighlightColor : getHighlightColor, + customHighlight : customHighlight, + resetHighlight : resetHighlight, + getRadialGradient : getRadialGradient, + getLinearGradient : getLinearGradient, + getGradientColors : getGradientColors, + getStepColors : getStepColors, + reverse : reverse, + mix : mix, + lift : lift, + trim : trim, + random : random, + toRGB : toRGB, + toRGBA : toRGBA, + toHex : toHex, + toHSL : toHSL, + toHSLA : toHSLA, + toHSB : toHSB, + toHSBA : toHSBA, + toHSV : toHSV, + toHSVA : toHSVA, + toName : toName, + toColor : toColor, + toArray : toArray, + alpha : alpha, + getData : getData + }; +}); + + +/** + * shape基类 + * @module zrender/shape/Base + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * errorrik (errorrik@gmail.com) + */ + +/** + * @typedef {Object} IBaseShapeStyle + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ + +/** + * @typedef {Object} module:zrender/shape/Base~IBoundingRect + * @property {number} x 左上角顶点x轴坐标 + * @property {number} y 左上角顶点y轴坐标 + * @property {number} width 包围盒矩形宽度 + * @property {number} height 包围盒矩形高度 + */ + +define( + 'zrender/shape/Base',['require','../tool/matrix','../tool/guid','../tool/util','../tool/log','../mixin/Transformable','../mixin/Eventful','../tool/area','../tool/area','../tool/color','../tool/area'],function(require) { + var matrix = require('../tool/matrix'); + var guid = require('../tool/guid'); + var util = require('../tool/util'); + var log = require('../tool/log'); + + var Transformable = require('../mixin/Transformable'); + var Eventful = require('../mixin/Eventful'); + + function _fillText(ctx, text, x, y, textFont, textAlign, textBaseline) { + if (textFont) { + ctx.font = textFont; + } + ctx.textAlign = textAlign; + ctx.textBaseline = textBaseline; + var rect = _getTextRect( + text, x, y, textFont, textAlign, textBaseline + ); + + text = (text + '').split('\n'); + var lineHeight = require('../tool/area').getTextHeight('国', textFont); + + switch (textBaseline) { + case 'top': + y = rect.y; + break; + case 'bottom': + y = rect.y + lineHeight; + break; + default: + y = rect.y + lineHeight / 2; + } + + for (var i = 0, l = text.length; i < l; i++) { + ctx.fillText(text[i], x, y); + y += lineHeight; + } + } + + /** + * 返回矩形区域,用于局部刷新和文字定位 + * @inner + * @param {string} text + * @param {number} x + * @param {number} y + * @param {string} textFont + * @param {string} textAlign + * @param {string} textBaseline + */ + function _getTextRect(text, x, y, textFont, textAlign, textBaseline) { + var area = require('../tool/area'); + var width = area.getTextWidth(text, textFont); + var lineHeight = area.getTextHeight('国', textFont); + + text = (text + '').split('\n'); + + switch (textAlign) { + case 'end': + case 'right': + x -= width; + break; + case 'center': + x -= (width / 2); + break; + } + + switch (textBaseline) { + case 'top': + break; + case 'bottom': + y -= lineHeight * text.length; + break; + default: + y -= lineHeight * text.length / 2; + } + + return { + x : x, + y : y, + width : width, + height : lineHeight * text.length + }; + } + + /** + * @alias module:zrender/shape/Base + * @constructor + * @extends module:zrender/mixin/Transformable + * @extends module:zrender/mixin/Eventful + * @param {Object} options 关于shape的配置项,可以是shape的自有属性,也可以是自定义的属性。 + */ + var Base = function(options) { + + options = options || {}; + + /** + * Shape id, 全局唯一 + * @type {string} + */ + this.id = options.id || guid(); + + for (var key in options) { + this[key] = options[key]; + } + + /** + * 基础绘制样式 + * @type {module:zrender/shape/Base~IBaseShapeStyle} + */ + this.style = this.style || {}; + + /** + * 高亮样式 + * @type {module:zrender/shape/Base~IBaseShapeStyle} + */ + this.highlightStyle = this.highlightStyle || null; + + /** + * 父节点 + * @readonly + * @type {module:zrender/Group} + * @default null + */ + this.parent = null; + + this.__dirty = true; + + Transformable.call(this); + Eventful.call(this); + }; + /** + * 图形是否可见,为true时不绘制图形,但是仍能触发鼠标事件 + * @name module:zrender/shape/Base#invisible + * @type {boolean} + * @default false + */ + Base.prototype.invisible = false; + + /** + * 图形是否忽略,为true时忽略图形的绘制以及事件触发 + * @name module:zrender/shape/Base#ignore + * @type {boolean} + * @default false + */ + Base.prototype.ignore = false; + + /** + * z层level,决定绘画在哪层canvas中 + * @name module:zrender/shape/Base#zlevel + * @type {number} + * @default 0 + */ + Base.prototype.zlevel = 0; + + /** + * 是否可拖拽 + * @name module:zrender/shape/Base#draggable + * @type {boolean} + * @default false + */ + Base.prototype.draggable = false; + + /** + * 是否可点击 + * @name module:zrender/shape/Base#clickable + * @type {boolean} + * @default false + */ + Base.prototype.clickable = false; + + /** + * 是否可以hover + * @name module:zrender/shape/Base#hoverable + * @type {boolean} + * @default true + */ + Base.prototype.hoverable = true; + + /** + * z值,跟zlevel一样影响shape绘制的前后顺序,z值大的shape会覆盖在z值小的上面, + * 但是并不会创建新的canvas,所以优先级低于zlevel,而且频繁改动的开销比zlevel小很多。 + * + * @name module:zrender/shape/Base#z + * @type {number} + * @default 0 + */ + Base.prototype.z = 0; + + /** + * 绘制图形 + * + * @param {CanvasRenderingContext2D} ctx + * @param {boolean} [isHighlight=false] 是否使用高亮属性 + * @param {Function} [updateCallback] + * 需要异步加载资源的shape可以通过这个callback(e), + * 让painter更新视图,base.brush没用,需要的话重载brush + */ + Base.prototype.brush = function (ctx, isHighlight) { + var style = this.style; + + if (this.brushTypeOnly) { + style.brushType = this.brushTypeOnly; + } + + if (isHighlight) { + // 根据style扩展默认高亮样式 + style = this.getHighlightStyle( + style, + this.highlightStyle || {}, + this.brushTypeOnly + ); + } + + if (this.brushTypeOnly == 'stroke') { + style.strokeColor = style.strokeColor || style.color; + } + + ctx.save(); + + this.setContext(ctx, style); + + // 设置transform + this.setTransform(ctx); + + ctx.beginPath(); + this.buildPath(ctx, style); + + switch (style.brushType) { + /* jshint ignore:start */ + case 'both': + ctx.fill(); + case 'stroke': + style.lineWidth > 0 && ctx.stroke(); + break; + /* jshint ignore:end */ + default: + ctx.fill(); + } + + this.drawText(ctx, style, this.style); + + ctx.restore(); + }; + + var STYLE_CTX_MAP = [ + [ 'color', 'fillStyle' ], + [ 'strokeColor', 'strokeStyle' ], + [ 'opacity', 'globalAlpha' ], + [ 'lineCap', 'lineCap' ], + [ 'lineJoin', 'lineJoin' ], + [ 'miterLimit', 'miterLimit' ], + [ 'lineWidth', 'lineWidth' ], + [ 'shadowBlur', 'shadowBlur' ], + [ 'shadowColor', 'shadowColor' ], + [ 'shadowOffsetX', 'shadowOffsetX' ], + [ 'shadowOffsetY', 'shadowOffsetY' ] + ]; + + /** + * 设置 fillStyle, strokeStyle, shadow 等通用绘制样式 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Base~IBaseShapeStyle} style + */ + Base.prototype.setContext = function (ctx, style) { + for (var i = 0, len = STYLE_CTX_MAP.length; i < len; i++) { + var styleProp = STYLE_CTX_MAP[i][0]; + var styleValue = style[styleProp]; + var ctxProp = STYLE_CTX_MAP[i][1]; + + if (typeof styleValue != 'undefined') { + ctx[ctxProp] = styleValue; + } + } + }; + + /** + * 根据默认样式扩展高亮样式 + * + * @param {module:zrender/shape/Base~IBaseShapeStyle} style 默认样式 + * @param {module:zrender/shape/Base~IBaseShapeStyle} highlightStyle 高亮样式 + * @param {string} brushTypeOnly + */ + Base.prototype.getHighlightStyle = function (style, highlightStyle, brushTypeOnly) { + var newStyle = {}; + for (var k in style) { + newStyle[k] = style[k]; + } + + var color = require('../tool/color'); + var highlightColor = color.getHighlightColor(); + // 根据highlightStyle扩展 + if (style.brushType != 'stroke') { + // 带填充则用高亮色加粗边线 + newStyle.strokeColor = highlightColor; + newStyle.lineWidth = (style.lineWidth || 1) + + this.getHighlightZoom(); + newStyle.brushType = 'both'; + } + else { + if (brushTypeOnly != 'stroke') { + // 描边型的则用原色加工高亮 + newStyle.strokeColor = highlightColor; + newStyle.lineWidth = (style.lineWidth || 1) + + this.getHighlightZoom(); + } + else { + // 线型的则用原色加工高亮 + newStyle.strokeColor = highlightStyle.strokeColor + || color.mix( + style.strokeColor, + color.toRGB(highlightColor) + ); + } + } + + // 可自定义覆盖默认值 + for (var k in highlightStyle) { + if (typeof highlightStyle[k] != 'undefined') { + newStyle[k] = highlightStyle[k]; + } + } + + return newStyle; + }; + + // 高亮放大效果参数 + // 当前统一设置为6,如有需要差异设置,通过this.type判断实例类型 + Base.prototype.getHighlightZoom = function () { + return this.type != 'text' ? 6 : 2; + }; + + /** + * 移动位置 + * @param {number} dx 横坐标变化 + * @param {number} dy 纵坐标变化 + */ + Base.prototype.drift = function (dx, dy) { + this.position[0] += dx; + this.position[1] += dy; + }; + + /** + * 变换鼠标位置到 shape 的局部坐标空间 + * @method + * @param {number} x + * @param {number} y + * @return {Array.} + */ + Base.prototype.getTansform = (function() { + + var invTransform = []; + + return function (x, y) { + var originPos = [ x, y ]; + // 对鼠标的坐标也做相同的变换 + if (this.needTransform && this.transform) { + matrix.invert(invTransform, this.transform); + + matrix.mulVector(originPos, invTransform, [ x, y, 1 ]); + + if (x == originPos[0] && y == originPos[1]) { + // 避免外部修改导致的needTransform不准确 + this.updateNeedTransform(); + } + } + return originPos; + }; + })(); + + /** + * 构建绘制的Path + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Base~IBaseShapeStyle} style + */ + Base.prototype.buildPath = function (ctx, style) { + log('buildPath not implemented in ' + this.type); + }; + + /** + * 计算返回包围盒矩形 + * @param {module:zrender/shape/Base~IBaseShapeStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + Base.prototype.getRect = function (style) { + log('getRect not implemented in ' + this.type); + }; + + /** + * 判断鼠标位置是否在图形内 + * @param {number} x + * @param {number} y + * @return {boolean} + */ + Base.prototype.isCover = function (x, y) { + var originPos = this.getTansform(x, y); + x = originPos[0]; + y = originPos[1]; + + // 快速预判并保留判断矩形 + var rect = this.style.__rect; + if (!rect) { + rect = this.style.__rect = this.getRect(this.style); + } + + if (x >= rect.x + && x <= (rect.x + rect.width) + && y >= rect.y + && y <= (rect.y + rect.height) + ) { + // 矩形内 + return require('../tool/area').isInside(this, this.style, x, y); + } + + return false; + }; + + /** + * 绘制附加文本 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Base~IBaseShapeStyle} style 样式 + * @param {module:zrender/shape/Base~IBaseShapeStyle} normalStyle 默认样式,用于定位文字显示 + */ + Base.prototype.drawText = function (ctx, style, normalStyle) { + if (typeof(style.text) == 'undefined' || style.text === false) { + return; + } + // 字体颜色策略 + var textColor = style.textColor || style.color || style.strokeColor; + ctx.fillStyle = textColor; + + // 文本与图形间空白间隙 + var dd = 10; + var al; // 文本水平对齐 + var bl; // 文本垂直对齐 + var tx; // 文本横坐标 + var ty; // 文本纵坐标 + + var textPosition = style.textPosition // 用户定义 + || this.textPosition // shape默认 + || 'top'; // 全局默认 + + switch (textPosition) { + case 'inside': + case 'top': + case 'bottom': + case 'left': + case 'right': + if (this.getRect) { + var rect = (normalStyle || style).__rect + || this.getRect(normalStyle || style); + + switch (textPosition) { + case 'inside': + tx = rect.x + rect.width / 2; + ty = rect.y + rect.height / 2; + al = 'center'; + bl = 'middle'; + if (style.brushType != 'stroke' + && textColor == style.color + ) { + ctx.fillStyle = '#fff'; + } + break; + case 'left': + tx = rect.x - dd; + ty = rect.y + rect.height / 2; + al = 'end'; + bl = 'middle'; + break; + case 'right': + tx = rect.x + rect.width + dd; + ty = rect.y + rect.height / 2; + al = 'start'; + bl = 'middle'; + break; + case 'top': + tx = rect.x + rect.width / 2; + ty = rect.y - dd; + al = 'center'; + bl = 'bottom'; + break; + case 'bottom': + tx = rect.x + rect.width / 2; + ty = rect.y + rect.height + dd; + al = 'center'; + bl = 'top'; + break; + } + } + break; + case 'start': + case 'end': + var xStart; + var xEnd; + var yStart; + var yEnd; + if (typeof style.pointList != 'undefined') { + var pointList = style.pointList; + if (pointList.length < 2) { + // 少于2个点就不画了~ + return; + } + var length = pointList.length; + switch (textPosition) { + case 'start': + xStart = pointList[0][0]; + xEnd = pointList[1][0]; + yStart = pointList[0][1]; + yEnd = pointList[1][1]; + break; + case 'end': + xStart = pointList[length - 2][0]; + xEnd = pointList[length - 1][0]; + yStart = pointList[length - 2][1]; + yEnd = pointList[length - 1][1]; + break; + } + } + else { + xStart = style.xStart || 0; + xEnd = style.xEnd || 0; + yStart = style.yStart || 0; + yEnd = style.yEnd || 0; + } + + switch (textPosition) { + case 'start': + al = xStart < xEnd ? 'end' : 'start'; + bl = yStart < yEnd ? 'bottom' : 'top'; + tx = xStart; + ty = yStart; + break; + case 'end': + al = xStart < xEnd ? 'start' : 'end'; + bl = yStart < yEnd ? 'top' : 'bottom'; + tx = xEnd; + ty = yEnd; + break; + } + dd -= 4; + if (xStart != xEnd) { + tx -= (al == 'end' ? dd : -dd); + } + else { + al = 'center'; + } + + if (yStart != yEnd) { + ty -= (bl == 'bottom' ? dd : -dd); + } + else { + bl = 'middle'; + } + break; + case 'specific': + tx = style.textX || 0; + ty = style.textY || 0; + al = 'start'; + bl = 'middle'; + break; + } + + if (tx != null && ty != null) { + _fillText( + ctx, + style.text, + tx, ty, + style.textFont, + style.textAlign || al, + style.textBaseline || bl + ); + } + }; + + Base.prototype.modSelf = function() { + this.__dirty = true; + if (this.style) { + this.style.__rect = null; + } + }; + + /** + * 图形是否会触发事件 + * @return {boolean} + */ + // TODO, 通过 bind 绑定的事件 + Base.prototype.isSilent = function () { + return !( + this.hoverable || this.draggable || this.clickable + || this.onmousemove || this.onmouseover || this.onmouseout + || this.onmousedown || this.onmouseup || this.onclick + || this.ondragenter || this.ondragover || this.ondragleave + || this.ondrop + ); + }; + + util.merge(Base.prototype, Transformable.prototype, true); + util.merge(Base.prototype, Eventful.prototype, true); + + return Base; + } +); + +/** + * @module zrender/shape/Text + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @example + * var Text = require('zrender/shape/Text'); + * var shape = new Text({ + * style: { + * text: 'Label', + * x: 100, + * y: 100, + * textFont: '14px Arial' + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} ITextStyle + * @property {number} x 横坐标 + * @property {number} y 纵坐标 + * @property {string} text 文本内容 + * @property {number} [maxWidth=null] 最大宽度限制 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + */ + +define( + 'zrender/shape/Text',['require','../tool/area','./Base','../tool/util'],function (require) { + var area = require('../tool/area'); + var Base = require('./Base'); + + /** + * @alias module:zrender/shape/Text + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var Text = function (options) { + Base.call(this, options); + /** + * 文字绘制样式 + * @name module:zrender/shape/Text#style + * @type {module:zrender/shape/Text~ITextStyle} + */ + /** + * 文字高亮绘制样式 + * @name module:zrender/shape/Text#highlightStyle + * @type {module:zrender/shape/Text~ITextStyle} + */ + }; + + Text.prototype = { + type: 'text', + + brush : function (ctx, isHighlight) { + var style = this.style; + if (isHighlight) { + // 根据style扩展默认高亮样式 + style = this.getHighlightStyle( + style, this.highlightStyle || {} + ); + } + + if (typeof(style.text) == 'undefined' || style.text === false) { + return; + } + + ctx.save(); + this.setContext(ctx, style); + + // 设置transform + this.setTransform(ctx); + + if (style.textFont) { + ctx.font = style.textFont; + } + ctx.textAlign = style.textAlign || 'start'; + ctx.textBaseline = style.textBaseline || 'middle'; + + var text = (style.text + '').split('\n'); + var lineHeight = area.getTextHeight('国', style.textFont); + var rect = this.getRect(style); + var x = style.x; + var y; + if (style.textBaseline == 'top') { + y = rect.y; + } + else if (style.textBaseline == 'bottom') { + y = rect.y + lineHeight; + } + else { + y = rect.y + lineHeight / 2; + } + + for (var i = 0, l = text.length; i < l; i++) { + if (style.maxWidth) { + switch (style.brushType) { + case 'fill': + ctx.fillText( + text[i], + x, y, style.maxWidth + ); + break; + case 'stroke': + ctx.strokeText( + text[i], + x, y, style.maxWidth + ); + break; + case 'both': + ctx.fillText( + text[i], + x, y, style.maxWidth + ); + ctx.strokeText( + text[i], + x, y, style.maxWidth + ); + break; + default: + ctx.fillText( + text[i], + x, y, style.maxWidth + ); + } + } + else { + switch (style.brushType) { + case 'fill': + ctx.fillText(text[i], x, y); + break; + case 'stroke': + ctx.strokeText(text[i], x, y); + break; + case 'both': + ctx.fillText(text[i], x, y); + ctx.strokeText(text[i], x, y); + break; + default: + ctx.fillText(text[i], x, y); + } + } + y += lineHeight; + } + + ctx.restore(); + return; + }, + + /** + * 返回文字包围盒矩形 + * @param {module:zrender/shape/Text~ITextStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function (style) { + if (style.__rect) { + return style.__rect; + } + + var width = area.getTextWidth(style.text, style.textFont); + var height = area.getTextHeight(style.text, style.textFont); + + var textX = style.x; // 默认start == left + if (style.textAlign == 'end' || style.textAlign == 'right') { + textX -= width; + } + else if (style.textAlign == 'center') { + textX -= (width / 2); + } + + var textY; + if (style.textBaseline == 'top') { + textY = style.y; + } + else if (style.textBaseline == 'bottom') { + textY = style.y - height; + } + else { + // middle + textY = style.y - height / 2; + } + + style.__rect = { + x : textX, + y : textY, + width : width, + height : height + }; + + return style.__rect; + } + }; + + require('../tool/util').inherits(Text, Base); + return Text; + } +); + + +/** + * 矩形 + * @module zrender/shape/Rectangle + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) , + * strwind (@劲风FEI, yaofeifei@baidu.com) + * @example + * var Rectangle = require('zrender/shape/Rectangle'); + * var shape = new Rectangle({ + * style: { + * x: 0, + * y: 0, + * width: 100, + * height: 100, + * radius: 20 + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} IRectangleStyle + * @property {number} x 左上角x坐标 + * @property {number} y 左上角y坐标 + * @property {number} width 宽度 + * @property {number} height 高度 + * @property {number|Array.} radius 矩形圆角,可以用数组分别指定四个角的圆角 + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ +define( + 'zrender/shape/Rectangle',['require','./Base','../tool/util'],function (require) { + var Base = require('./Base'); + + /** + * @alias module:zrender/shape/Rectangle + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var Rectangle = function (options) { + Base.call(this, options); + /** + * 矩形绘制样式 + * @name module:zrender/shape/Rectangle#style + * @type {module:zrender/shape/Rectangle~IRectangleStyle} + */ + /** + * 矩形高亮绘制样式 + * @name module:zrender/shape/Rectangle#highlightStyle + * @type {module:zrender/shape/Rectangle~IRectangleStyle} + */ + }; + + Rectangle.prototype = { + type: 'rectangle', + + _buildRadiusPath: function (ctx, style) { + // 左上、右上、右下、左下角的半径依次为r1、r2、r3、r4 + // r缩写为1 相当于 [1, 1, 1, 1] + // r缩写为[1] 相当于 [1, 1, 1, 1] + // r缩写为[1, 2] 相当于 [1, 2, 1, 2] + // r缩写为[1, 2, 3] 相当于 [1, 2, 3, 2] + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + var r = style.radius; + var r1; + var r2; + var r3; + var r4; + + if (typeof r === 'number') { + r1 = r2 = r3 = r4 = r; + } + else if (r instanceof Array) { + if (r.length === 1) { + r1 = r2 = r3 = r4 = r[0]; + } + else if (r.length === 2) { + r1 = r3 = r[0]; + r2 = r4 = r[1]; + } + else if (r.length === 3) { + r1 = r[0]; + r2 = r4 = r[1]; + r3 = r[2]; + } + else { + r1 = r[0]; + r2 = r[1]; + r3 = r[2]; + r4 = r[3]; + } + } + else { + r1 = r2 = r3 = r4 = 0; + } + + var total; + if (r1 + r2 > width) { + total = r1 + r2; + r1 *= width / total; + r2 *= width / total; + } + if (r3 + r4 > width) { + total = r3 + r4; + r3 *= width / total; + r4 *= width / total; + } + if (r2 + r3 > height) { + total = r2 + r3; + r2 *= height / total; + r3 *= height / total; + } + if (r1 + r4 > height) { + total = r1 + r4; + r1 *= height / total; + r4 *= height / total; + } + ctx.moveTo(x + r1, y); + ctx.lineTo(x + width - r2, y); + r2 !== 0 && ctx.quadraticCurveTo( + x + width, y, x + width, y + r2 + ); + ctx.lineTo(x + width, y + height - r3); + r3 !== 0 && ctx.quadraticCurveTo( + x + width, y + height, x + width - r3, y + height + ); + ctx.lineTo(x + r4, y + height); + r4 !== 0 && ctx.quadraticCurveTo( + x, y + height, x, y + height - r4 + ); + ctx.lineTo(x, y + r1); + r1 !== 0 && ctx.quadraticCurveTo(x, y, x + r1, y); + }, + + /** + * 创建矩形路径 + * @param {CanvasRenderingContext2D} ctx + * @param {Object} style + */ + buildPath : function (ctx, style) { + if (!style.radius) { + ctx.moveTo(style.x, style.y); + ctx.lineTo(style.x + style.width, style.y); + ctx.lineTo(style.x + style.width, style.y + style.height); + ctx.lineTo(style.x, style.y + style.height); + ctx.lineTo(style.x, style.y); + // ctx.rect(style.x, style.y, style.width, style.height); + } + else { + this._buildRadiusPath(ctx, style); + } + ctx.closePath(); + return; + }, + + /** + * 计算返回矩形包围盒矩阵 + * @param {module:zrender/shape/Rectangle~IRectangleStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function(style) { + if (style.__rect) { + return style.__rect; + } + + var lineWidth; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } + else { + lineWidth = 0; + } + style.__rect = { + x : Math.round(style.x - lineWidth / 2), + y : Math.round(style.y - lineWidth / 2), + width : style.width + lineWidth, + height : style.height + lineWidth + }; + + return style.__rect; + } + }; + + require('../tool/util').inherits(Rectangle, Base); + return Rectangle; + } +); + +/** + * zrender: loading特效类 + * + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * errorrik (errorrik@gmail.com) + */ + +define( + 'zrender/loadingEffect/Base',['require','../tool/util','../shape/Text','../shape/Rectangle'],function(require) { + var util = require('../tool/util'); + var TextShape = require('../shape/Text'); + var RectangleShape = require('../shape/Rectangle'); + + + var DEFAULT_TEXT = 'Loading...'; + var DEFAULT_TEXT_FONT = 'normal 16px Arial'; + + /** + * @constructor + * + * @param {Object} options 选项 + * @param {color} options.backgroundColor 背景颜色 + * @param {Object} options.textStyle 文字样式,同shape/text.style + * @param {number=} options.progress 进度参数,部分特效有用 + * @param {Object=} options.effect 特效参数,部分特效有用 + * + * { + * effect, + * //loading话术 + * text:'', + * // 水平安放位置,默认为 'center',可指定x坐标 + * x:'center' || 'left' || 'right' || {number}, + * // 垂直安放位置,默认为'top',可指定y坐标 + * y:'top' || 'bottom' || {number}, + * + * textStyle:{ + * textFont: 'normal 20px Arial' || {textFont}, //文本字体 + * color: {color} + * } + * } + */ + function Base(options) { + this.setOptions(options); + } + + /** + * 创建loading文字图形 + * + * @param {Object} textStyle 文字style,同shape/text.style + */ + Base.prototype.createTextShape = function (textStyle) { + return new TextShape({ + highlightStyle : util.merge( + { + x : this.canvasWidth / 2, + y : this.canvasHeight / 2, + text : DEFAULT_TEXT, + textAlign : 'center', + textBaseline : 'middle', + textFont : DEFAULT_TEXT_FONT, + color: '#333', + brushType : 'fill' + }, + textStyle, + true + ) + }); + }; + + /** + * 获取loading背景图形 + * + * @param {color} color 背景颜色 + */ + Base.prototype.createBackgroundShape = function (color) { + return new RectangleShape({ + highlightStyle : { + x : 0, + y : 0, + width : this.canvasWidth, + height : this.canvasHeight, + brushType : 'fill', + color : color + } + }); + }; + + Base.prototype.start = function (painter) { + this.canvasWidth = painter._width; + this.canvasHeight = painter._height; + + function addShapeHandle(param) { + painter.storage.addHover(param); + } + function refreshHandle() { + painter.refreshHover(); + } + this.loadingTimer = this._start(addShapeHandle, refreshHandle); + }; + + Base.prototype._start = function (/*addShapeHandle, refreshHandle*/) { + return setInterval(function () { + }, 10000); + }; + + Base.prototype.stop = function () { + clearInterval(this.loadingTimer); + }; + + Base.prototype.setOptions = function (options) { + this.options = options || {}; + }; + + Base.prototype.adjust = function (value, region) { + if (value <= region[0]) { + value = region[0]; + } + else if (value >= region[1]) { + value = region[1]; + } + return value; + }; + + Base.prototype.getLocation = function(loc, totalWidth, totalHeight) { + var x = loc.x != null ? loc.x : 'center'; + switch (x) { + case 'center' : + x = Math.floor((this.canvasWidth - totalWidth) / 2); + break; + case 'left' : + x = 0; + break; + case 'right' : + x = this.canvasWidth - totalWidth; + break; + } + var y = loc.y != null ? loc.y : 'center'; + switch (y) { + case 'center' : + y = Math.floor((this.canvasHeight - totalHeight) / 2); + break; + case 'top' : + y = 0; + break; + case 'bottom' : + y = this.canvasHeight - totalHeight; + break; + } + return { + x : x, + y : y, + width : totalWidth, + height : totalHeight + }; + }; + + return Base; + } +); + +/** + * 图片绘制 + * @module zrender/shape/Image + * @author pissang(https://www.github.com/pissang) + * @example + * var ImageShape = require('zrender/shape/Image'); + * var image = new ImageShape({ + * style: { + * image: 'test.jpg', + * x: 100, + * y: 100 + * } + * }); + * zr.addShape(image); + */ + +/** + * @typedef {Object} IImageStyle + * @property {string|HTMLImageElement|HTMLCanvasElement} image 图片url或者图片对象 + * @property {number} x 左上角横坐标 + * @property {number} y 左上角纵坐标 + * @property {number} [width] 绘制到画布上的宽度,默认为图片宽度 + * @property {number} [height] 绘制到画布上的高度,默认为图片高度 + * @property {number} [sx=0] 从图片中裁剪的左上角横坐标 + * @property {number} [sy=0] 从图片中裁剪的左上角纵坐标 + * @property {number} [sWidth] 从图片中裁剪的宽度,默认为图片高度 + * @property {number} [sHeight] 从图片中裁剪的高度,默认为图片高度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ +define( + 'zrender/shape/Image',['require','./Base','../tool/util'],function (require) { + + var _needsRefresh = []; + var _refreshTimeout; + + var Base = require('./Base'); + + /** + * @alias zrender/shape/Image + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var ZImage = function(options) { + Base.call(this, options); + + this._imageCache = {}; + /** + * 图片绘制样式 + * @name module:zrender/shape/Image#style + * @type {module:zrender/shape/Image~IImageStyle} + */ + /** + * 图片高亮绘制样式 + * @name module:zrender/shape/Image#highlightStyle + * @type {module:zrender/shape/Image~IImageStyle} + */ + }; + + ZImage.prototype = { + + type: 'image', + + brush : function(ctx, isHighlight, refresh) { + var style = this.style || {}; + + if (isHighlight) { + // 根据style扩展默认高亮样式 + style = this.getHighlightStyle( + style, this.highlightStyle || {} + ); + } + + var image = style.image; + var me = this; + + if (typeof(image) === 'string') { + var src = image; + if (this._imageCache[src]) { + image = this._imageCache[src]; + } else { + image = new Image(); + image.onload = function () { + image.onload = null; + clearTimeout(_refreshTimeout); + _needsRefresh.push(me); + // 防止因为缓存短时间内触发多次onload事件 + _refreshTimeout = setTimeout(function () { + refresh && refresh(_needsRefresh); + // 清空needsRefresh + _needsRefresh = []; + }, 10); + }; + + image.src = src; + this._imageCache[src] = image; + } + } + if (image) { + // 图片已经加载完成 + if (image.nodeName.toUpperCase() == 'IMG') { + if (window.ActiveXObject) { + if (image.readyState != 'complete') { + return; + } + } + else { + if (!image.complete) { + return; + } + } + } + // Else is canvas + var width = style.width || image.width; + var height = style.height || image.height; + var x = style.x; + var y = style.y; + + // 图片加载失败 + if (!image.width || !image.height) { + return; + } + + ctx.save(); + this.setContext(ctx, style); + + // 设置transform + this.setTransform(ctx); + + if (style.sWidth && style.sHeight) { + var sx = style.sx || 0; + var sy = style.sy || 0; + ctx.drawImage( + image, + sx, sy, style.sWidth, style.sHeight, + x, y, width, height + ); + } + else if (style.sx && style.sy) { + var sx = style.sx; + var sy = style.sy; + var sWidth = width - sx; + var sHeight = height - sy; + ctx.drawImage( + image, + sx, sy, sWidth, sHeight, + x, y, width, height + ); + } + else { + ctx.drawImage(image, x, y, width, height); + } + // 如果没设置宽和高的话自动根据图片宽高设置 + if (!style.width) { + style.width = width; + } + if (!style.height) { + style.height = height; + } + if (!this.style.width) { + this.style.width = width; + } + if (!this.style.height) { + this.style.height = height; + } + + this.drawText(ctx, style, this.style); + + ctx.restore(); + } + }, + + /** + * 计算返回图片的包围盒矩形 + * @param {module:zrender/shape/Image~IImageStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect: function(style) { + return { + x : style.x, + y : style.y, + width : style.width, + height : style.height + }; + }, + + clearCache: function() { + this._imageCache = {}; + } + }; + + require('../tool/util').inherits(ZImage, Base); + return ZImage; + } +); + +/** + * Painter绘图模块 + * @module zrender/Painter + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * errorrik (errorrik@gmail.com) + * pissang (https://www.github.com/pissang) + */ + define( + 'zrender/Painter',['require','./config','./tool/util','./tool/log','./tool/matrix','./loadingEffect/Base','./mixin/Transformable','./shape/Image'],function (require) { + + + var config = require('./config'); + var util = require('./tool/util'); + // var vec2 = require('./tool/vector'); + var log = require('./tool/log'); + var matrix = require('./tool/matrix'); + var BaseLoadingEffect = require('./loadingEffect/Base'); + var Transformable = require('./mixin/Transformable'); + + // retina 屏幕优化 + var devicePixelRatio = window.devicePixelRatio || 1; + devicePixelRatio = Math.max(devicePixelRatio, 1); + var vmlCanvasManager = window['G_vmlCanvasManager']; + + + // 返回false的方法,用于避免页面被选中 + function returnFalse() { + return false; + } + + // 什么都不干的空方法 + function doNothing() {} + + /** + * @alias module:zrender/Painter + * @constructor + * @param {HTMLElement} root 绘图容器 + * @param {module:zrender/Storage} storage + */ + var Painter = function (root, storage) { + /** + * 绘图容器 + * @type {HTMLElement} + */ + this.root = root; + /** + * @type {module:zrender/Storage} + */ + this.storage = storage; + + root.innerHTML = ''; + this._width = this._getWidth(); // 宽,缓存记录 + this._height = this._getHeight(); // 高,缓存记录 + + var domRoot = document.createElement('div'); + this._domRoot = domRoot; + + // domRoot.onselectstart = returnFalse; // 避免页面选中的尴尬 + domRoot.style.position = 'relative'; + domRoot.style.overflow = 'hidden'; + domRoot.style.width = this._width + 'px'; + domRoot.style.height = this._height + 'px'; + root.appendChild(domRoot); + + this._layers = {}; + + this._layerConfig = {}; + + this._loadingEffect = new BaseLoadingEffect({}); + this.shapeToImage = this._createShapeToImageProcessor(); + + // 创建各层canvas + // 背景 + this._bgDom = createDom('bg', 'div', this); + domRoot.appendChild(this._bgDom); + this._bgDom.onselectstart = returnFalse; + this._bgDom.style['-webkit-user-select'] = 'none'; + this._bgDom.style['user-select'] = 'none'; + // this._bgDom.style[' -webkit-touch-callout'] = 'none'; + + // 高亮 + var hoverLayer = new Layer('_zrender_hover_', this); + this._layers['hover'] = hoverLayer; + domRoot.appendChild(hoverLayer.dom); + hoverLayer.initContext(); + + hoverLayer.dom.onselectstart = returnFalse; + hoverLayer.dom.style['-webkit-user-select'] = 'none'; + hoverLayer.dom.style['user-select'] = 'none'; + // hoverLayer.dom.style[' -webkit-touch-callout'] = 'none'; + + var me = this; + this.updatePainter = function (shapeList, callback) { + me.refreshShapes(shapeList, callback); + }; + }; + + /** + * 首次绘图,创建各种dom和context + * + * @param {Function} callback 绘画结束后的回调函数 + */ + Painter.prototype.render = function (callback) { + if (this.isLoading()) { + this.hideLoading(); + } + // TODO + this.refresh(callback, true); + + return this; + }; + + /** + * 刷新 + * @param {Function} callback 刷新结束后的回调函数 + * @param {boolean} paintAll 强制绘制所有shape + */ + Painter.prototype.refresh = function (callback, paintAll) { + var list = this.storage.getShapeList(true); + this._paintList(list, paintAll); + + if (typeof callback == 'function') { + callback(); + } + + return this; + }; + + Painter.prototype._paintList = function (list, paintAll) { + + if (typeof(paintAll) == 'undefined') { + paintAll = false; + } + + this._updateLayerStatus(list); + + var currentLayer; + var currentZLevel; + var ctx; + + for (var id in this._layers) { + if (id !== 'hover') { + this._layers[id].unusedCount++; + this._layers[id].updateTransform(); + } + } + + var invTransform = []; + + for (var i = 0, l = list.length; i < l; i++) { + var shape = list[i]; + + if (currentZLevel !== shape.zlevel) { + if (currentLayer && currentLayer.needTransform) { + ctx.restore(); + } + + currentLayer = this.getLayer(shape.zlevel, currentLayer); + ctx = currentLayer.ctx; + currentZLevel = shape.zlevel; + + // Reset the count + currentLayer.unusedCount = 0; + + if (currentLayer.dirty || paintAll) { + currentLayer.clear(); + } + + if (currentLayer.needTransform) { + ctx.save(); + currentLayer.setTransform(ctx); + } + } + + // Start group clipping + if (shape.__startClip && !vmlCanvasManager) { + var clipShape = shape.__startClip; + ctx.save(); + // Set transform + if (clipShape.needTransform) { + var m = clipShape.transform; + matrix.invert(invTransform, m); + ctx.transform( + m[0], m[1], + m[2], m[3], + m[4], m[5] + ); + } + + ctx.beginPath(); + clipShape.buildPath(ctx, clipShape.style); + ctx.clip(); + + // Transform back + if (clipShape.needTransform) { + var m = invTransform; + ctx.transform( + m[0], m[1], + m[2], m[3], + m[4], m[5] + ); + } + } + + if ((currentLayer.dirty || paintAll) && !shape.invisible) { + if ( + !shape.onbrush + || (shape.onbrush && !shape.onbrush(ctx, false)) + ) { + if (config.catchBrushException) { + try { + shape.brush(ctx, false, this.updatePainter); + } + catch (error) { + log( + error, + 'brush error of ' + shape.type, + shape + ); + } + } + else { + shape.brush(ctx, false, this.updatePainter); + } + } + } + + // Stop group clipping + if (shape.__stopClip && !vmlCanvasManager) { + ctx.restore(); + } + + shape.__dirty = false; + } + + if (currentLayer && currentLayer.needTransform) { + ctx.restore(); + } + + for (var id in this._layers) { + if (id !== 'hover') { + var layer = this._layers[id]; + layer.dirty = false; + // 删除过期的层 + // PENDING + // if (layer.unusedCount >= 500) { + // this.delLayer(id); + // } + if (layer.unusedCount == 1) { + layer.clear(); + } + } + } + }; + + /** + * 获取 zlevel 所在层,如果不存在则会创建一个新的层 + * @param {number} zlevel + * @param {module:zrender/Painter~Layer} [prevLayer] + * 在需要创建新的层时需要使用,新创建层的dom节点会插在该层后面 + */ + Painter.prototype.getLayer = function (zlevel, prevLayer) { + // Change draw layer + var currentLayer = this._layers[zlevel]; + if (!currentLayer) { + // Create a new layer + currentLayer = new Layer(zlevel, this); + var prevDom = prevLayer ? prevLayer.dom : this._bgDom; + if (prevDom.nextSibling) { + prevDom.parentNode.insertBefore( + currentLayer.dom, + prevDom.nextSibling + ); + } + else { + prevDom.parentNode.appendChild( + currentLayer.dom + ); + } + currentLayer.initContext(); + + this._layers[zlevel] = currentLayer; + + if (this._layerConfig[zlevel]) { + util.merge(currentLayer, this._layerConfig[zlevel], true); + } + + currentLayer.updateTransform(); + } + + return currentLayer; + }; + + /** + * 获取所有已创建的层 + * @param {Array.} [prevLayer] + */ + Painter.prototype.getLayers = function () { + return this._layers; + }; + + Painter.prototype._updateLayerStatus = function (list) { + + var layers = this._layers; + + var elCounts = {}; + for (var z in layers) { + if (z !== 'hover') { + elCounts[z] = layers[z].elCount; + layers[z].elCount = 0; + } + } + + for (var i = 0, l = list.length; i < l; i++) { + var shape = list[i]; + var zlevel = shape.zlevel; + var layer = layers[zlevel]; + if (layer) { + layer.elCount++; + // 已经被标记为需要刷新 + if (layer.dirty) { + continue; + } + layer.dirty = shape.__dirty; + } + } + + // 层中的元素数量有发生变化 + for (var z in layers) { + if (z !== 'hover') { + if (elCounts[z] !== layers[z].elCount) { + layers[z].dirty = true; + } + } + } + }; + + /** + * 指定的图形列表 + * @param {Array.} shapeList 需要更新的图形元素列表 + * @param {Function} [callback] 视图更新后回调函数 + */ + Painter.prototype.refreshShapes = function (shapeList, callback) { + for (var i = 0, l = shapeList.length; i < l; i++) { + var shape = shapeList[i]; + this.storage.mod(shape.id); + } + + this.refresh(callback); + return this; + }; + + /** + * 设置loading特效 + * + * @param {Object} loadingEffect loading特效 + * @return {Painter} + */ + Painter.prototype.setLoadingEffect = function (loadingEffect) { + this._loadingEffect = loadingEffect; + return this; + }; + + /** + * 清除hover层外所有内容 + */ + Painter.prototype.clear = function () { + for (var k in this._layers) { + if (k == 'hover') { + continue; + } + this._layers[k].clear(); + } + + return this; + }; + + /** + * 修改指定zlevel的绘制参数 + * + * @param {string} zlevel + * @param {Object} config 配置对象 + * @param {string} [config.clearColor=0] 每次清空画布的颜色 + * @param {string} [config.motionBlur=false] 是否开启动态模糊 + * @param {number} [config.lastFrameAlpha=0.7] + * 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显 + * @param {Array.} [position] 层的平移 + * @param {Array.} [rotation] 层的旋转 + * @param {Array.} [scale] 层的缩放 + * @param {boolean} [zoomable=false] 层是否支持鼠标缩放操作 + * @param {boolean} [panable=false] 层是否支持鼠标平移操作 + */ + Painter.prototype.modLayer = function (zlevel, config) { + if (config) { + if (!this._layerConfig[zlevel]) { + this._layerConfig[zlevel] = config; + } + else { + util.merge(this._layerConfig[zlevel], config, true); + } + + var layer = this._layers[zlevel]; + + if (layer) { + util.merge(layer, this._layerConfig[zlevel], true); + } + } + }; + + /** + * 删除指定层 + * @param {number} zlevel 层所在的zlevel + */ + Painter.prototype.delLayer = function (zlevel) { + var layer = this._layers[zlevel]; + if (!layer) { + return; + } + // Save config + this.modLayer(zlevel, { + position: layer.position, + rotation: layer.rotation, + scale: layer.scale + }); + layer.dom.parentNode.removeChild(layer.dom); + delete this._layers[zlevel]; + }; + + /** + * 刷新hover层 + */ + Painter.prototype.refreshHover = function () { + this.clearHover(); + var list = this.storage.getHoverShapes(true); + for (var i = 0, l = list.length; i < l; i++) { + this._brushHover(list[i]); + } + this.storage.delHover(); + + return this; + }; + + /** + * 清除hover层所有内容 + */ + Painter.prototype.clearHover = function () { + var hover = this._layers.hover; + hover && hover.clear(); + + return this; + }; + + /** + * 显示loading + * + * @param {Object=} loadingEffect loading效果对象 + */ + Painter.prototype.showLoading = function (loadingEffect) { + this._loadingEffect && this._loadingEffect.stop(); + loadingEffect && this.setLoadingEffect(loadingEffect); + this._loadingEffect.start(this); + this.loading = true; + + return this; + }; + + /** + * loading结束 + */ + Painter.prototype.hideLoading = function () { + this._loadingEffect.stop(); + + this.clearHover(); + this.loading = false; + return this; + }; + + /** + * loading结束判断 + */ + Painter.prototype.isLoading = function () { + return this.loading; + }; + + /** + * 区域大小变化后重绘 + */ + Painter.prototype.resize = function () { + var domRoot = this._domRoot; + domRoot.style.display = 'none'; + + var width = this._getWidth(); + var height = this._getHeight(); + + domRoot.style.display = ''; + + // 优化没有实际改变的resize + if (this._width != width || height != this._height) { + this._width = width; + this._height = height; + + domRoot.style.width = width + 'px'; + domRoot.style.height = height + 'px'; + + for (var id in this._layers) { + + this._layers[id].resize(width, height); + } + + this.refresh(null, true); + } + + return this; + }; + + /** + * 清除单独的一个层 + * @param {number} zLevel + */ + Painter.prototype.clearLayer = function (zLevel) { + var layer = this._layers[zLevel]; + if (layer) { + layer.clear(); + } + }; + + /** + * 释放 + */ + Painter.prototype.dispose = function () { + if (this.isLoading()) { + this.hideLoading(); + } + + this.root.innerHTML = ''; + + this.root = + this.storage = + + this._domRoot = + this._layers = null; + }; + + Painter.prototype.getDomHover = function () { + return this._layers.hover.dom; + }; + + /** + * 图像导出 + * @param {string} type + * @param {string} [backgroundColor='#fff'] 背景色 + * @return {string} 图片的Base64 url + */ + Painter.prototype.toDataURL = function (type, backgroundColor, args) { + if (vmlCanvasManager) { + return null; + } + + var imageDom = createDom('image', 'canvas', this); + this._bgDom.appendChild(imageDom); + var ctx = imageDom.getContext('2d'); + devicePixelRatio != 1 + && ctx.scale(devicePixelRatio, devicePixelRatio); + + ctx.fillStyle = backgroundColor || '#fff'; + ctx.rect( + 0, 0, + this._width * devicePixelRatio, + this._height * devicePixelRatio + ); + ctx.fill(); + + var self = this; + // 升序遍历,shape上的zlevel指定绘画图层的z轴层叠 + + this.storage.iterShape( + function (shape) { + if (!shape.invisible) { + if (!shape.onbrush // 没有onbrush + // 有onbrush并且调用执行返回false或undefined则继续粉刷 + || (shape.onbrush && !shape.onbrush(ctx, false)) + ) { + if (config.catchBrushException) { + try { + shape.brush(ctx, false, self.updatePainter); + } + catch (error) { + log( + error, + 'brush error of ' + shape.type, + shape + ); + } + } + else { + shape.brush(ctx, false, self.updatePainter); + } + } + } + }, + { normal: 'up', update: true } + ); + var image = imageDom.toDataURL(type, args); + ctx = null; + this._bgDom.removeChild(imageDom); + return image; + }; + + /** + * 获取绘图区域宽度 + */ + Painter.prototype.getWidth = function () { + return this._width; + }; + + /** + * 获取绘图区域高度 + */ + Painter.prototype.getHeight = function () { + return this._height; + }; + + Painter.prototype._getWidth = function () { + var root = this.root; + var stl = root.currentStyle + || document.defaultView.getComputedStyle(root); + + return ((root.clientWidth || parseInt(stl.width, 10)) + - parseInt(stl.paddingLeft, 10) // 请原谅我这比较粗暴 + - parseInt(stl.paddingRight, 10)).toFixed(0) - 0; + }; + + Painter.prototype._getHeight = function () { + var root = this.root; + var stl = root.currentStyle + || document.defaultView.getComputedStyle(root); + + return ((root.clientHeight || parseInt(stl.height, 10)) + - parseInt(stl.paddingTop, 10) // 请原谅我这比较粗暴 + - parseInt(stl.paddingBottom, 10)).toFixed(0) - 0; + }; + + Painter.prototype._brushHover = function (shape) { + var ctx = this._layers.hover.ctx; + + if (!shape.onbrush // 没有onbrush + // 有onbrush并且调用执行返回false或undefined则继续粉刷 + || (shape.onbrush && !shape.onbrush(ctx, true)) + ) { + var layer = this.getLayer(shape.zlevel); + if (layer.needTransform) { + ctx.save(); + layer.setTransform(ctx); + } + // Retina 优化 + if (config.catchBrushException) { + try { + shape.brush(ctx, true, this.updatePainter); + } + catch (error) { + log( + error, 'hoverBrush error of ' + shape.type, shape + ); + } + } + else { + shape.brush(ctx, true, this.updatePainter); + } + if (layer.needTransform) { + ctx.restore(); + } + } + }; + + Painter.prototype._shapeToImage = function ( + id, shape, width, height, devicePixelRatio + ) { + var canvas = document.createElement('canvas'); + var ctx = canvas.getContext('2d'); + var devicePixelRatio = window.devicePixelRatio || 1; + + canvas.style.width = width + 'px'; + canvas.style.height = height + 'px'; + canvas.setAttribute('width', width * devicePixelRatio); + canvas.setAttribute('height', height * devicePixelRatio); + + ctx.clearRect(0, 0, width * devicePixelRatio, height * devicePixelRatio); + + var shapeTransform = { + position : shape.position, + rotation : shape.rotation, + scale : shape.scale + }; + shape.position = [ 0, 0, 0 ]; + shape.rotation = 0; + shape.scale = [ 1, 1 ]; + if (shape) { + shape.brush(ctx, false); + } + + var ImageShape = require('./shape/Image'); + var imgShape = new ImageShape({ + id : id, + style : { + x : 0, + y : 0, + image : canvas + } + }); + + if (shapeTransform.position != null) { + imgShape.position = shape.position = shapeTransform.position; + } + + if (shapeTransform.rotation != null) { + imgShape.rotation = shape.rotation = shapeTransform.rotation; + } + + if (shapeTransform.scale != null) { + imgShape.scale = shape.scale = shapeTransform.scale; + } + + return imgShape; + }; + + Painter.prototype._createShapeToImageProcessor = function () { + if (vmlCanvasManager) { + return doNothing; + } + + var me = this; + + return function (id, e, width, height) { + return me._shapeToImage( + id, e, width, height, devicePixelRatio + ); + }; + }; + + /** + * 创建dom + * + * @inner + * @param {string} id dom id 待用 + * @param {string} type dom type,such as canvas, div etc. + * @param {Painter} painter painter instance + */ + function createDom(id, type, painter) { + var newDom = document.createElement(type); + var width = painter._width; + var height = painter._height; + + // 没append呢,请原谅我这样写,清晰~ + newDom.style.position = 'absolute'; + newDom.style.left = 0; + newDom.style.top = 0; + newDom.style.width = width + 'px'; + newDom.style.height = height + 'px'; + newDom.setAttribute('width', width * devicePixelRatio); + newDom.setAttribute('height', height * devicePixelRatio); + + // id不作为索引用,避免可能造成的重名,定义为私有属性 + newDom.setAttribute('data-zr-dom-id', id); + return newDom; + } + + /** + * @alias module:zrender/Painter~Layer + * @constructor + * @extends module:zrender/mixin/Transformable + * @param {string} id + * @param {module:zrender/Painter} painter + */ + var Layer = function(id, painter) { + this.dom = createDom(id, 'canvas', painter); + this.dom.onselectstart = returnFalse; // 避免页面选中的尴尬 + this.dom.style['-webkit-user-select'] = 'none'; + this.dom.style['user-select'] = 'none'; + // this.dom.style[' -webkit-touch-callout'] = 'none'; + vmlCanvasManager && vmlCanvasManager.initElement(this.dom); + + this.domBack = null; + this.ctxBack = null; + + this.painter = painter; + + this.unusedCount = 0; + + this.config = null; + + this.dirty = true; + + this.elCount = 0; + + // Configs + /** + * 每次清空画布的颜色 + * @type {string} + * @default 0 + */ + this.clearColor = 0; + /** + * 是否开启动态模糊 + * @type {boolean} + * @default false + */ + this.motionBlur = false; + /** + * 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显 + * @type {number} + * @default 0.7 + */ + this.lastFrameAlpha = 0.7; + /** + * 层是否支持鼠标平移操作 + * @type {boolean} + * @default false + */ + this.zoomable = false; + /** + * 层是否支持鼠标缩放操作 + * @type {boolean} + * @default false + */ + this.panable = false; + + this.maxZoom = Infinity; + this.minZoom = 0; + + Transformable.call(this); + }; + + Layer.prototype.initContext = function () { + this.ctx = this.dom.getContext('2d'); + if (devicePixelRatio != 1) { + this.ctx.scale(devicePixelRatio, devicePixelRatio); + } + }; + + Layer.prototype.createBackBuffer = function () { + if (vmlCanvasManager) { // IE 8- should not support back buffer + return; + } + this.domBack = createDom('back-' + this.id, 'canvas', this.painter); + this.ctxBack = this.domBack.getContext('2d'); + + if (devicePixelRatio != 1) { + this.ctxBack.scale(devicePixelRatio, devicePixelRatio); + } + }; + + /** + * @param {number} width + * @param {number} height + */ + Layer.prototype.resize = function (width, height) { + this.dom.style.width = width + 'px'; + this.dom.style.height = height + 'px'; + + this.dom.setAttribute('width', width * devicePixelRatio); + this.dom.setAttribute('height', height * devicePixelRatio); + + if (devicePixelRatio != 1) { + this.ctx.scale(devicePixelRatio, devicePixelRatio); + } + + if (this.domBack) { + this.domBack.setAttribute('width', width * devicePixelRatio); + this.domBack.setAttribute('height', height * devicePixelRatio); + + if (devicePixelRatio != 1) { + this.ctxBack.scale(devicePixelRatio, devicePixelRatio); + } + } + }; + + /** + * 清空该层画布 + */ + Layer.prototype.clear = function () { + var dom = this.dom; + var ctx = this.ctx; + var width = dom.width; + var height = dom.height; + + var haveClearColor = this.clearColor && !vmlCanvasManager; + var haveMotionBLur = this.motionBlur && !vmlCanvasManager; + var lastFrameAlpha = this.lastFrameAlpha; + + if (haveMotionBLur) { + if (!this.domBack) { + this.createBackBuffer(); + } + + this.ctxBack.globalCompositeOperation = 'copy'; + this.ctxBack.drawImage( + dom, 0, 0, + width / devicePixelRatio, + height / devicePixelRatio + ); + } + + if (haveClearColor) { + ctx.save(); + ctx.fillStyle = this.config.clearColor; + ctx.fillRect( + 0, 0, + width / devicePixelRatio, + height / devicePixelRatio + ); + ctx.restore(); + } + else { + ctx.clearRect( + 0, 0, + width / devicePixelRatio, + height / devicePixelRatio + ); + } + + if (haveMotionBLur) { + var domBack = this.domBack; + ctx.save(); + ctx.globalAlpha = lastFrameAlpha; + ctx.drawImage( + domBack, 0, 0, + width / devicePixelRatio, + height / devicePixelRatio + ); + ctx.restore(); + } + }; + + util.merge(Layer.prototype, Transformable.prototype); + + return Painter; + } +); + +/** + * Group是一个容器,可以插入子节点,Group的变换也会被应用到子节点上 + * @module zrender/Group + * @example + * var Group = require('zrender/Group'); + * var Circle = require('zrender/shape/Circle'); + * var g = new Group(); + * g.position[0] = 100; + * g.position[1] = 100; + * g.addChild(new Circle({ + * style: { + * x: 100, + * y: 100, + * r: 20, + * brushType: 'fill' + * } + * })); + * zr.addGroup(g); + */ +define('zrender/Group',['require','./tool/guid','./tool/util','./mixin/Transformable','./mixin/Eventful'],function(require) { + + var guid = require('./tool/guid'); + var util = require('./tool/util'); + + var Transformable = require('./mixin/Transformable'); + var Eventful = require('./mixin/Eventful'); + + /** + * @alias module:zrender/Group + * @constructor + * @extends module:zrender/mixin/Transformable + * @extends module:zrender/mixin/Eventful + */ + var Group = function(options) { + + options = options || {}; + + /** + * Group id + * @type {string} + */ + this.id = options.id || guid(); + + for (var key in options) { + this[key] = options[key]; + } + + /** + * @type {string} + */ + this.type = 'group'; + + /** + * 用于裁剪的图形(shape),所有 Group 内的图形在绘制时都会被这个图形裁剪 + * 该图形会继承Group的变换 + * @type {module:zrender/shape/Base} + * @see http://www.w3.org/TR/2dcontext/#clipping-region + */ + this.clipShape = null; + + this._children = []; + + this._storage = null; + + this.__dirty = true; + + // Mixin + Transformable.call(this); + Eventful.call(this); + }; + + /** + * 是否忽略该 Group 及其所有子节点 + * @type {boolean} + * @default false + */ + Group.prototype.ignore = false; + + /** + * 复制并返回一份新的包含所有儿子节点的数组 + * @return {Array.} + */ + Group.prototype.children = function() { + return this._children.slice(); + }; + + /** + * 获取指定 index 的儿子节点 + * @param {number} idx + * @return {module:zrender/Group|module:zrender/shape/Base} + */ + Group.prototype.childAt = function(idx) { + return this._children[idx]; + }; + + /** + * 添加子节点,可以是Shape或者Group + * @param {module:zrender/Group|module:zrender/shape/Base} child + */ + Group.prototype.addChild = function(child) { + if (child == this) { + return; + } + + if (child.parent == this) { + return; + } + if (child.parent) { + child.parent.removeChild(child); + } + + this._children.push(child); + child.parent = this; + + if (this._storage && this._storage !== child._storage) { + + this._storage.addToMap(child); + + if (child instanceof Group) { + child.addChildrenToStorage(this._storage); + } + } + }; + + /** + * 移除子节点 + * @param {module:zrender/Group|module:zrender/shape/Base} child + */ + Group.prototype.removeChild = function(child) { + var idx = util.indexOf(this._children, child); + + this._children.splice(idx, 1); + child.parent = null; + + if (child._storage) { + + this._storage.delFromMap(child.id); + + if (child instanceof Group) { + child.delChildrenFromStorage(child._storage); + } + } + }; + + /** + * 遍历所有子节点 + * @param {Function} cb + * @param {} context + */ + Group.prototype.eachChild = function(cb, context) { + var haveContext = !!context; + for (var i = 0; i < this._children.length; i++) { + var child = this._children[i]; + if (haveContext) { + cb.call(context, child); + } else { + cb(child); + } + } + }; + + /** + * 深度优先遍历所有子孙节点 + * @param {Function} cb + * @param {} context + */ + Group.prototype.traverse = function(cb, context) { + var haveContext = !!context; + for (var i = 0; i < this._children.length; i++) { + var child = this._children[i]; + if (haveContext) { + cb.call(context, child); + } else { + cb(child); + } + + if (child.type === 'group') { + child.traverse(cb, context); + } + } + }; + + Group.prototype.addChildrenToStorage = function(storage) { + for (var i = 0; i < this._children.length; i++) { + var child = this._children[i]; + storage.addToMap(child); + if (child.type === 'group') { + child.addChildrenToStorage(storage); + } + } + }; + + Group.prototype.delChildrenFromStorage = function(storage) { + for (var i = 0; i < this._children.length; i++) { + var child = this._children[i]; + storage.delFromMap(child.id); + if (child.type === 'group') { + child.delChildrenFromStorage(storage); + } + } + }; + + Group.prototype.modSelf = function() { + this.__dirty = true; + }; + + util.merge(Group.prototype, Transformable.prototype, true); + util.merge(Group.prototype, Eventful.prototype, true); + + return Group; +}); +/** + * Storage内容仓库模块 + * @module zrender/Storage + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author errorrik (errorrik@gmail.com) + * @author pissang (https://github.com/pissang/) + */ +define( + 'zrender/Storage',['require','./tool/util','./Group'],function (require) { + + + + var util = require('./tool/util'); + + var Group = require('./Group'); + + var defaultIterateOption = { + hover: false, + normal: 'down', + update: false + }; + + function shapeCompareFunc(a, b) { + if (a.zlevel == b.zlevel) { + if (a.z == b.z) { + return a.__renderidx - b.__renderidx; + } + return a.z - b.z; + } + return a.zlevel - b.zlevel; + } + /** + * 内容仓库 (M) + * @alias module:zrender/Storage + * @constructor + */ + var Storage = function () { + // 所有常规形状,id索引的map + this._elements = {}; + + // 高亮层形状,不稳定,动态增删,数组位置也是z轴方向,靠前显示在下方 + this._hoverElements = []; + + this._roots = []; + + this._shapeList = []; + + this._shapeListOffset = 0; + }; + + /** + * 遍历迭代器 + * + * @param {Function} fun 迭代回调函数,return true终止迭代 + * @param {Object} [option] 迭代参数,缺省为仅降序遍历普通层图形 + * @param {boolean} [option.hover=true] 是否是高亮层图形 + * @param {string} [option.normal='up'] 是否是普通层图形,迭代时是否指定及z轴顺序 + * @param {boolean} [option.update=false] 是否在迭代前更新形状列表 + * + */ + Storage.prototype.iterShape = function (fun, option) { + if (!option) { + option = defaultIterateOption; + } + + if (option.hover) { + // 高亮层数据遍历 + for (var i = 0, l = this._hoverElements.length; i < l; i++) { + var el = this._hoverElements[i]; + el.updateTransform(); + if (fun(el)) { + return this; + } + } + } + + if (option.update) { + this.updateShapeList(); + } + + // 遍历: 'down' | 'up' + switch (option.normal) { + case 'down': + // 降序遍历,高层优先 + var l = this._shapeList.length; + while (l--) { + if (fun(this._shapeList[l])) { + return this; + } + } + break; + // case 'up': + default: + // 升序遍历,底层优先 + for (var i = 0, l = this._shapeList.length; i < l; i++) { + if (fun(this._shapeList[i])) { + return this; + } + } + break; + } + + return this; + }; + + /** + * 返回hover层的形状数组 + * @param {boolean} [update=false] 是否在返回前更新图形的变换 + * @return {Array.} + */ + Storage.prototype.getHoverShapes = function (update) { + if (update) { + for (var i = 0, l = this._hoverElements.length; i < l; i++) { + this._hoverElements[i].updateTransform(); + } + } + return this._hoverElements; + }; + + /** + * 返回所有图形的绘制队列 + * @param {boolean} [update=false] 是否在返回前更新该数组 + * 详见{@link module:zrender/shape/Base.prototype.updateShapeList} + * @return {Array.} + */ + Storage.prototype.getShapeList = function (update) { + if (update) { + this.updateShapeList(); + } + return this._shapeList; + }; + + /** + * 更新图形的绘制队列。 + * 每次绘制前都会调用,该方法会先深度优先遍历整个树,更新所有Group和Shape的变换并且把所有可见的Shape保存到数组中, + * 最后根据绘制的优先级(zlevel > z > 插入顺序)排序得到绘制队列 + */ + Storage.prototype.updateShapeList = function () { + this._shapeListOffset = 0; + for (var i = 0, len = this._roots.length; i < len; i++) { + var root = this._roots[i]; + this._updateAndAddShape(root); + } + this._shapeList.length = this._shapeListOffset; + + for (var i = 0, len = this._shapeList.length; i < len; i++) { + this._shapeList[i].__renderidx = i; + } + + this._shapeList.sort(shapeCompareFunc); + }; + + Storage.prototype._updateAndAddShape = function (el) { + + if (el.ignore) { + return; + } + + el.updateTransform(); + + if (el.type == 'group') { + + if (el.clipShape) { + // clipShape 的变换是基于 group 的变换 + el.clipShape.parent = el; + el.clipShape.updateTransform(); + + var startClipShape = el._children[0]; + if (startClipShape) { + startClipShape.__startClip = el.clipShape; + } + } + + for (var i = 0; i < el._children.length; i++) { + var child = el._children[i]; + + // Force to mark as dirty if group is dirty + child.__dirty = el.__dirty || child.__dirty; + + this._updateAndAddShape(child); + } + + if (el.clipShape) { + var stopClipShape = this._shapeList[this._shapeListOffset - 1]; + if (stopClipShape) { + stopClipShape.__stopClip = true; + } + } + + // Mark group clean here + el.__dirty = false; + + } + else { + this._shapeList[this._shapeListOffset++] = el; + } + }; + + /** + * 修改图形(Shape)或者组(Group) + * + * @param {string} elId 唯一标识 + * @param {Object} [params] 参数 + */ + Storage.prototype.mod = function (elId, params) { + var el = this._elements[elId]; + if (el) { + + el.modSelf(); + + if (params) { + // 如果第二个参数直接使用 shape + // parent, _storage, __startClip 三个属性会有循环引用 + // 主要为了向 1.x 版本兼容,2.x 版本不建议使用第二个参数 + if (params.parent || params._storage || params.__startClip) { + var target = {}; + for (var name in params) { + if ( + name == 'parent' + || name == '_storage' + || name == '__startClip' + ) { + continue; + } + if (params.hasOwnProperty(name)) { + target[name] = params[name]; + } + } + util.merge(el, target, true); + } + else { + util.merge(el, params, true); + } + } + } + + return this; + }; + + /** + * 移动指定的图形(Shape)或者组(Group)的位置 + * @param {string} shapeId 形状唯一标识 + * @param {number} dx + * @param {number} dy + */ + Storage.prototype.drift = function (shapeId, dx, dy) { + var shape = this._elements[shapeId]; + if (shape) { + shape.needTransform = true; + if (!shape.ondrift // ondrift + // 有onbrush并且调用执行返回false或undefined则继续 + || (shape.ondrift && !shape.ondrift(dx, dy)) + ) { + shape.drift(dx, dy); + } + } + + return this; + }; + + /** + * 添加高亮层数据 + * + * @param {module:zrender/shape/Base} shape + */ + Storage.prototype.addHover = function (shape) { + shape.updateNeedTransform(); + this._hoverElements.push(shape); + return this; + }; + + /** + * 清空高亮层数据 + */ + Storage.prototype.delHover = function () { + this._hoverElements = []; + return this; + }; + + /** + * 是否有图形在高亮层里 + * @return {boolean} + */ + Storage.prototype.hasHoverShape = function () { + return this._hoverElements.length > 0; + }; + + /** + * 添加图形(Shape)或者组(Group)到根节点 + * @param {module:zrender/shape/Shape|module:zrender/Group} el + */ + Storage.prototype.addRoot = function (el) { + if (el instanceof Group) { + el.addChildrenToStorage(this); + } + + this.addToMap(el); + this._roots.push(el); + }; + + /** + * 删除指定的图形(Shape)或者组(Group) + * @param {string|Array.} [elId] 如果为空清空整个Storage + */ + Storage.prototype.delRoot = function (elId) { + if (typeof(elId) == 'undefined') { + // 不指定elId清空 + for (var i = 0; i < this._roots.length; i++) { + var root = this._roots[i]; + if (root instanceof Group) { + root.delChildrenFromStorage(this); + } + } + + this._elements = {}; + this._hoverElements = []; + this._roots = []; + + return; + } + + if (elId instanceof Array) { + for (var i = 0, l = elId.length; i < l; i++) { + this.delRoot(elId[i]); + } + return; + } + + var el; + if (typeof(elId) == 'string') { + el = this._elements[elId]; + } + else { + el = elId; + } + + var idx = util.indexOf(this._roots, el); + if (idx >= 0) { + this.delFromMap(el.id); + this._roots.splice(idx, 1); + if (el instanceof Group) { + el.delChildrenFromStorage(this); + } + } + }; + + Storage.prototype.addToMap = function (el) { + if (el instanceof Group) { + el._storage = this; + } + el.modSelf(); + + this._elements[el.id] = el; + + return this; + }; + + Storage.prototype.get = function (elId) { + return this._elements[elId]; + }; + + Storage.prototype.delFromMap = function (elId) { + var el = this._elements[elId]; + if (el) { + delete this._elements[elId]; + + if (el instanceof Group) { + el._storage = null; + } + } + + return this; + }; + + + /** + * 清空并且释放Storage + */ + Storage.prototype.dispose = function () { + this._elements = + this._renderList = + this._roots = + this._hoverElements = null; + }; + + return Storage; + } +); + +define( + 'zrender/animation/easing',[],function() { + /** + * 缓动代码来自 https://github.com/sole/tween.js/blob/master/src/Tween.js + * @see http://sole.github.io/tween.js/examples/03_graphs.html + * @exports zrender/animation/easing + */ + var easing = { + // 线性 + /** + * @param {number} k + * @return {number} + */ + Linear: function (k) { + return k; + }, + + // 二次方的缓动(t^2) + /** + * @param {number} k + * @return {number} + */ + QuadraticIn: function (k) { + return k * k; + }, + /** + * @param {number} k + * @return {number} + */ + QuadraticOut: function (k) { + return k * (2 - k); + }, + /** + * @param {number} k + * @return {number} + */ + QuadraticInOut: function (k) { + if ((k *= 2) < 1) { + return 0.5 * k * k; + } + return -0.5 * (--k * (k - 2) - 1); + }, + + // 三次方的缓动(t^3) + /** + * @param {number} k + * @return {number} + */ + CubicIn: function (k) { + return k * k * k; + }, + /** + * @param {number} k + * @return {number} + */ + CubicOut: function (k) { + return --k * k * k + 1; + }, + /** + * @param {number} k + * @return {number} + */ + CubicInOut: function (k) { + if ((k *= 2) < 1) { + return 0.5 * k * k * k; + } + return 0.5 * ((k -= 2) * k * k + 2); + }, + + // 四次方的缓动(t^4) + /** + * @param {number} k + * @return {number} + */ + QuarticIn: function (k) { + return k * k * k * k; + }, + /** + * @param {number} k + * @return {number} + */ + QuarticOut: function (k) { + return 1 - (--k * k * k * k); + }, + /** + * @param {number} k + * @return {number} + */ + QuarticInOut: function (k) { + if ((k *= 2) < 1) { + return 0.5 * k * k * k * k; + } + return -0.5 * ((k -= 2) * k * k * k - 2); + }, + + // 五次方的缓动(t^5) + /** + * @param {number} k + * @return {number} + */ + QuinticIn: function (k) { + return k * k * k * k * k; + }, + /** + * @param {number} k + * @return {number} + */ + QuinticOut: function (k) { + return --k * k * k * k * k + 1; + }, + /** + * @param {number} k + * @return {number} + */ + QuinticInOut: function (k) { + if ((k *= 2) < 1) { + return 0.5 * k * k * k * k * k; + } + return 0.5 * ((k -= 2) * k * k * k * k + 2); + }, + + // 正弦曲线的缓动(sin(t)) + /** + * @param {number} k + * @return {number} + */ + SinusoidalIn: function (k) { + return 1 - Math.cos(k * Math.PI / 2); + }, + /** + * @param {number} k + * @return {number} + */ + SinusoidalOut: function (k) { + return Math.sin(k * Math.PI / 2); + }, + /** + * @param {number} k + * @return {number} + */ + SinusoidalInOut: function (k) { + return 0.5 * (1 - Math.cos(Math.PI * k)); + }, + + // 指数曲线的缓动(2^t) + /** + * @param {number} k + * @return {number} + */ + ExponentialIn: function (k) { + return k === 0 ? 0 : Math.pow(1024, k - 1); + }, + /** + * @param {number} k + * @return {number} + */ + ExponentialOut: function (k) { + return k === 1 ? 1 : 1 - Math.pow(2, -10 * k); + }, + /** + * @param {number} k + * @return {number} + */ + ExponentialInOut: function (k) { + if (k === 0) { + return 0; + } + if (k === 1) { + return 1; + } + if ((k *= 2) < 1) { + return 0.5 * Math.pow(1024, k - 1); + } + return 0.5 * (-Math.pow(2, -10 * (k - 1)) + 2); + }, + + // 圆形曲线的缓动(sqrt(1-t^2)) + /** + * @param {number} k + * @return {number} + */ + CircularIn: function (k) { + return 1 - Math.sqrt(1 - k * k); + }, + /** + * @param {number} k + * @return {number} + */ + CircularOut: function (k) { + return Math.sqrt(1 - (--k * k)); + }, + /** + * @param {number} k + * @return {number} + */ + CircularInOut: function (k) { + if ((k *= 2) < 1) { + return -0.5 * (Math.sqrt(1 - k * k) - 1); + } + return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1); + }, + + // 创建类似于弹簧在停止前来回振荡的动画 + /** + * @param {number} k + * @return {number} + */ + ElasticIn: function (k) { + var s; + var a = 0.1; + var p = 0.4; + if (k === 0) { + return 0; + } + if (k === 1) { + return 1; + } + if (!a || a < 1) { + a = 1; s = p / 4; + } + else { + s = p * Math.asin(1 / a) / (2 * Math.PI); + } + return -(a * Math.pow(2, 10 * (k -= 1)) * + Math.sin((k - s) * (2 * Math.PI) / p)); + }, + /** + * @param {number} k + * @return {number} + */ + ElasticOut: function (k) { + var s; + var a = 0.1; + var p = 0.4; + if (k === 0) { + return 0; + } + if (k === 1) { + return 1; + } + if (!a || a < 1) { + a = 1; s = p / 4; + } + else { + s = p * Math.asin(1 / a) / (2 * Math.PI); + } + return (a * Math.pow(2, -10 * k) * + Math.sin((k - s) * (2 * Math.PI) / p) + 1); + }, + /** + * @param {number} k + * @return {number} + */ + ElasticInOut: function (k) { + var s; + var a = 0.1; + var p = 0.4; + if (k === 0) { + return 0; + } + if (k === 1) { + return 1; + } + if (!a || a < 1) { + a = 1; s = p / 4; + } + else { + s = p * Math.asin(1 / a) / (2 * Math.PI); + } + if ((k *= 2) < 1) { + return -0.5 * (a * Math.pow(2, 10 * (k -= 1)) + * Math.sin((k - s) * (2 * Math.PI) / p)); + } + return a * Math.pow(2, -10 * (k -= 1)) + * Math.sin((k - s) * (2 * Math.PI) / p) * 0.5 + 1; + + }, + + // 在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动 + /** + * @param {number} k + * @return {number} + */ + BackIn: function (k) { + var s = 1.70158; + return k * k * ((s + 1) * k - s); + }, + /** + * @param {number} k + * @return {number} + */ + BackOut: function (k) { + var s = 1.70158; + return --k * k * ((s + 1) * k + s) + 1; + }, + /** + * @param {number} k + * @return {number} + */ + BackInOut: function (k) { + var s = 1.70158 * 1.525; + if ((k *= 2) < 1) { + return 0.5 * (k * k * ((s + 1) * k - s)); + } + return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2); + }, + + // 创建弹跳效果 + /** + * @param {number} k + * @return {number} + */ + BounceIn: function (k) { + return 1 - easing.BounceOut(1 - k); + }, + /** + * @param {number} k + * @return {number} + */ + BounceOut: function (k) { + if (k < (1 / 2.75)) { + return 7.5625 * k * k; + } + else if (k < (2 / 2.75)) { + return 7.5625 * (k -= (1.5 / 2.75)) * k + 0.75; + } + else if (k < (2.5 / 2.75)) { + return 7.5625 * (k -= (2.25 / 2.75)) * k + 0.9375; + } + else { + return 7.5625 * (k -= (2.625 / 2.75)) * k + 0.984375; + } + }, + /** + * @param {number} k + * @return {number} + */ + BounceInOut: function (k) { + if (k < 0.5) { + return easing.BounceIn(k * 2) * 0.5; + } + return easing.BounceOut(k * 2 - 1) * 0.5 + 0.5; + } + }; + + return easing; + } +); + + +/** + * 动画主控制器 + * @config target 动画对象,可以是数组,如果是数组的话会批量分发onframe等事件 + * @config life(1000) 动画时长 + * @config delay(0) 动画延迟时间 + * @config loop(true) + * @config gap(0) 循环的间隔时间 + * @config onframe + * @config easing(optional) + * @config ondestroy(optional) + * @config onrestart(optional) + */ +define( + 'zrender/animation/Clip',['require','./easing'],function(require) { + + var Easing = require('./easing'); + + function Clip(options) { + + this._targetPool = options.target || {}; + if (!(this._targetPool instanceof Array)) { + this._targetPool = [ this._targetPool ]; + } + + // 生命周期 + this._life = options.life || 1000; + // 延时 + this._delay = options.delay || 0; + // 开始时间 + this._startTime = new Date().getTime() + this._delay;// 单位毫秒 + + // 结束时间 + this._endTime = this._startTime + this._life * 1000; + + // 是否循环 + this.loop = typeof options.loop == 'undefined' + ? false : options.loop; + + this.gap = options.gap || 0; + + this.easing = options.easing || 'Linear'; + + this.onframe = options.onframe; + this.ondestroy = options.ondestroy; + this.onrestart = options.onrestart; + } + + Clip.prototype = { + step : function (time) { + var percent = (time - this._startTime) / this._life; + + // 还没开始 + if (percent < 0) { + return; + } + + percent = Math.min(percent, 1); + + var easingFunc = typeof this.easing == 'string' + ? Easing[this.easing] + : this.easing; + var schedule = typeof easingFunc === 'function' + ? easingFunc(percent) + : percent; + + this.fire('frame', schedule); + + // 结束 + if (percent == 1) { + if (this.loop) { + this.restart(); + // 重新开始周期 + // 抛出而不是直接调用事件直到 stage.update 后再统一调用这些事件 + return 'restart'; + + } + + // 动画完成将这个控制器标识为待删除 + // 在Animation.update中进行批量删除 + this._needsRemove = true; + return 'destroy'; + } + + return null; + }, + restart : function() { + var time = new Date().getTime(); + var remainder = (time - this._startTime) % this._life; + this._startTime = new Date().getTime() - remainder + this.gap; + }, + fire : function(eventType, arg) { + for (var i = 0, len = this._targetPool.length; i < len; i++) { + if (this['on' + eventType]) { + this['on' + eventType](this._targetPool[i], arg); + } + } + }, + constructor: Clip + }; + + return Clip; + } +); + +/** + * 动画主类, 调度和管理所有动画控制器 + * + * @module zrender/animation/Animation + * @author pissang(https://github.com/pissang) + */ +define( + 'zrender/animation/Animation',['require','./Clip','../tool/color','../tool/util','../tool/event'],function(require) { + + + + var Clip = require('./Clip'); + var color = require('../tool/color'); + var util = require('../tool/util'); + var Dispatcher = require('../tool/event').Dispatcher; + + var requestAnimationFrame = window.requestAnimationFrame + || window.msRequestAnimationFrame + || window.mozRequestAnimationFrame + || window.webkitRequestAnimationFrame + || function (func) { + setTimeout(func, 16); + }; + + var arraySlice = Array.prototype.slice; + + /** + * @typedef {Object} IZRenderStage + * @property {Function} update + */ + + /** + * @alias module:zrender/animation/Animation + * @constructor + * @param {Object} [options] + * @param {Function} [options.onframe] + * @param {IZRenderStage} [options.stage] + * @example + * var animation = new Animation(); + * var obj = { + * x: 100, + * y: 100 + * }; + * animation.animate(node.position) + * .when(1000, { + * x: 500, + * y: 500 + * }) + * .when(2000, { + * x: 100, + * y: 100 + * }) + * .start('spline'); + */ + var Animation = function (options) { + + options = options || {}; + + this.stage = options.stage || {}; + + this.onframe = options.onframe || function() {}; + + // private properties + this._clips = []; + + this._running = false; + + this._time = 0; + + Dispatcher.call(this); + }; + + Animation.prototype = { + /** + * 添加动画片段 + * @param {module:zrender/animation/Clip} clip + */ + add: function(clip) { + this._clips.push(clip); + }, + /** + * 删除动画片段 + * @param {module:zrender/animation/Clip} clip + */ + remove: function(clip) { + var idx = util.indexOf(this._clips, clip); + if (idx >= 0) { + this._clips.splice(idx, 1); + } + }, + _update: function() { + + var time = new Date().getTime(); + var delta = time - this._time; + var clips = this._clips; + var len = clips.length; + + var deferredEvents = []; + var deferredClips = []; + for (var i = 0; i < len; i++) { + var clip = clips[i]; + var e = clip.step(time); + // Throw out the events need to be called after + // stage.update, like destroy + if (e) { + deferredEvents.push(e); + deferredClips.push(clip); + } + } + if (this.stage.update) { + this.stage.update(); + } + + // Remove the finished clip + for (var i = 0; i < len;) { + if (clips[i]._needsRemove) { + clips[i] = clips[len - 1]; + clips.pop(); + len--; + } + else { + i++; + } + } + + len = deferredEvents.length; + for (var i = 0; i < len; i++) { + deferredClips[i].fire(deferredEvents[i]); + } + + this._time = time; + + this.onframe(delta); + + this.dispatch('frame', delta); + }, + /** + * 开始运行动画 + */ + start: function () { + var self = this; + + this._running = true; + + function step() { + if (self._running) { + self._update(); + requestAnimationFrame(step); + } + } + + this._time = new Date().getTime(); + requestAnimationFrame(step); + }, + /** + * 停止运行动画 + */ + stop: function () { + this._running = false; + }, + /** + * 清除所有动画片段 + */ + clear : function () { + this._clips = []; + }, + /** + * 对一个目标创建一个animator对象,可以指定目标中的属性使用动画 + * @param {Object} target + * @param {Object} options + * @param {boolean} [options.loop=false] 是否循环播放动画 + * @param {Function} [options.getter=null] + * 如果指定getter函数,会通过getter函数取属性值 + * @param {Function} [options.setter=null] + * 如果指定setter函数,会通过setter函数设置属性值 + * @return {module:zrender/animation/Animation~Animator} + */ + animate : function (target, options) { + options = options || {}; + var deferred = new Animator( + target, + options.loop, + options.getter, + options.setter + ); + deferred.animation = this; + return deferred; + }, + constructor: Animation + }; + + util.merge(Animation.prototype, Dispatcher.prototype, true); + + function _defaultGetter(target, key) { + return target[key]; + } + + function _defaultSetter(target, key, value) { + target[key] = value; + } + + function _interpolateNumber(p0, p1, percent) { + return (p1 - p0) * percent + p0; + } + + function _interpolateArray(p0, p1, percent, out, arrDim) { + var len = p0.length; + if (arrDim == 1) { + for (var i = 0; i < len; i++) { + out[i] = _interpolateNumber(p0[i], p1[i], percent); + } + } + else { + var len2 = p0[0].length; + for (var i = 0; i < len; i++) { + for (var j = 0; j < len2; j++) { + out[i][j] = _interpolateNumber( + p0[i][j], p1[i][j], percent + ); + } + } + } + } + + function _isArrayLike(data) { + switch (typeof data) { + case 'undefined': + case 'string': + return false; + } + + return typeof data.length !== 'undefined'; + } + + function _catmullRomInterpolateArray( + p0, p1, p2, p3, t, t2, t3, out, arrDim + ) { + var len = p0.length; + if (arrDim == 1) { + for (var i = 0; i < len; i++) { + out[i] = _catmullRomInterpolate( + p0[i], p1[i], p2[i], p3[i], t, t2, t3 + ); + } + } + else { + var len2 = p0[0].length; + for (var i = 0; i < len; i++) { + for (var j = 0; j < len2; j++) { + out[i][j] = _catmullRomInterpolate( + p0[i][j], p1[i][j], p2[i][j], p3[i][j], + t, t2, t3 + ); + } + } + } + } + + function _catmullRomInterpolate(p0, p1, p2, p3, t, t2, t3) { + var v0 = (p2 - p0) * 0.5; + var v1 = (p3 - p1) * 0.5; + return (2 * (p1 - p2) + v0 + v1) * t3 + + (-3 * (p1 - p2) - 2 * v0 - v1) * t2 + + v0 * t + p1; + } + + function _cloneValue(value) { + if (_isArrayLike(value)) { + var len = value.length; + if (_isArrayLike(value[0])) { + var ret = []; + for (var i = 0; i < len; i++) { + ret.push(arraySlice.call(value[i])); + } + return ret; + } + else { + return arraySlice.call(value); + } + } + else { + return value; + } + } + + function rgba2String(rgba) { + rgba[0] = Math.floor(rgba[0]); + rgba[1] = Math.floor(rgba[1]); + rgba[2] = Math.floor(rgba[2]); + + return 'rgba(' + rgba.join(',') + ')'; + } + + /** + * @alias module:zrender/animation/Animation~Animator + * @constructor + * @param {Object} target + * @param {boolean} loop + * @param {Function} getter + * @param {Function} setter + */ + var Animator = function(target, loop, getter, setter) { + this._tracks = {}; + this._target = target; + + this._loop = loop || false; + + this._getter = getter || _defaultGetter; + this._setter = setter || _defaultSetter; + + this._clipCount = 0; + + this._delay = 0; + + this._doneList = []; + + this._onframeList = []; + + this._clipList = []; + }; + + Animator.prototype = { + /** + * 设置动画关键帧 + * @param {number} time 关键帧时间,单位是ms + * @param {Object} props 关键帧的属性值,key-value表示 + * @return {module:zrender/animation/Animation~Animator} + */ + when : function(time /* ms */, props) { + for (var propName in props) { + if (!this._tracks[propName]) { + this._tracks[propName] = []; + // If time is 0 + // Then props is given initialize value + // Else + // Initialize value from current prop value + if (time !== 0) { + this._tracks[propName].push({ + time : 0, + value : _cloneValue( + this._getter(this._target, propName) + ) + }); + } + } + this._tracks[propName].push({ + time : parseInt(time, 10), + value : props[propName] + }); + } + return this; + }, + /** + * 添加动画每一帧的回调函数 + * @param {Function} callback + * @return {module:zrender/animation/Animation~Animator} + */ + during: function (callback) { + this._onframeList.push(callback); + return this; + }, + /** + * 开始执行动画 + * @param {string|Function} easing + * 动画缓动函数,详见{@link module:zrender/animation/easing} + * @return {module:zrender/animation/Animation~Animator} + */ + start: function (easing) { + + var self = this; + var setter = this._setter; + var getter = this._getter; + var onFrameListLen = self._onframeList.length; + var useSpline = easing === 'spline'; + + var ondestroy = function() { + self._clipCount--; + if (self._clipCount === 0) { + // Clear all tracks + self._tracks = {}; + + var len = self._doneList.length; + for (var i = 0; i < len; i++) { + self._doneList[i].call(self); + } + } + }; + + var createTrackClip = function (keyframes, propName) { + var trackLen = keyframes.length; + if (!trackLen) { + return; + } + // Guess data type + var firstVal = keyframes[0].value; + var isValueArray = _isArrayLike(firstVal); + var isValueColor = false; + + // For vertices morphing + var arrDim = ( + isValueArray + && _isArrayLike(firstVal[0]) + ) + ? 2 : 1; + // Sort keyframe as ascending + keyframes.sort(function(a, b) { + return a.time - b.time; + }); + var trackMaxTime; + if (trackLen) { + trackMaxTime = keyframes[trackLen - 1].time; + } + else { + return; + } + // Percents of each keyframe + var kfPercents = []; + // Value of each keyframe + var kfValues = []; + for (var i = 0; i < trackLen; i++) { + kfPercents.push(keyframes[i].time / trackMaxTime); + // Assume value is a color when it is a string + var value = keyframes[i].value; + if (typeof(value) == 'string') { + value = color.toArray(value); + if (value.length === 0) { // Invalid color + value[0] = value[1] = value[2] = 0; + value[3] = 1; + } + isValueColor = true; + } + kfValues.push(value); + } + + // Cache the key of last frame to speed up when + // animation playback is sequency + var cacheKey = 0; + var cachePercent = 0; + var start; + var i; + var w; + var p0; + var p1; + var p2; + var p3; + + + if (isValueColor) { + var rgba = [ 0, 0, 0, 0 ]; + } + + var onframe = function (target, percent) { + // Find the range keyframes + // kf1-----kf2---------current--------kf3 + // find kf2 and kf3 and do interpolation + if (percent < cachePercent) { + // Start from next key + start = Math.min(cacheKey + 1, trackLen - 1); + for (i = start; i >= 0; i--) { + if (kfPercents[i] <= percent) { + break; + } + } + i = Math.min(i, trackLen - 2); + } + else { + for (i = cacheKey; i < trackLen; i++) { + if (kfPercents[i] > percent) { + break; + } + } + i = Math.min(i - 1, trackLen - 2); + } + cacheKey = i; + cachePercent = percent; + + var range = (kfPercents[i + 1] - kfPercents[i]); + if (range === 0) { + return; + } + else { + w = (percent - kfPercents[i]) / range; + } + if (useSpline) { + p1 = kfValues[i]; + p0 = kfValues[i === 0 ? i : i - 1]; + p2 = kfValues[i > trackLen - 2 ? trackLen - 1 : i + 1]; + p3 = kfValues[i > trackLen - 3 ? trackLen - 1 : i + 2]; + if (isValueArray) { + _catmullRomInterpolateArray( + p0, p1, p2, p3, w, w * w, w * w * w, + getter(target, propName), + arrDim + ); + } + else { + var value; + if (isValueColor) { + value = _catmullRomInterpolateArray( + p0, p1, p2, p3, w, w * w, w * w * w, + rgba, 1 + ); + value = rgba2String(rgba); + } + else { + value = _catmullRomInterpolate( + p0, p1, p2, p3, w, w * w, w * w * w + ); + } + setter( + target, + propName, + value + ); + } + } + else { + if (isValueArray) { + _interpolateArray( + kfValues[i], kfValues[i + 1], w, + getter(target, propName), + arrDim + ); + } + else { + var value; + if (isValueColor) { + _interpolateArray( + kfValues[i], kfValues[i + 1], w, + rgba, 1 + ); + value = rgba2String(rgba); + } + else { + value = _interpolateNumber(kfValues[i], kfValues[i + 1], w); + } + setter( + target, + propName, + value + ); + } + } + + for (i = 0; i < onFrameListLen; i++) { + self._onframeList[i](target, percent); + } + }; + + var clip = new Clip({ + target : self._target, + life : trackMaxTime, + loop : self._loop, + delay : self._delay, + onframe : onframe, + ondestroy : ondestroy + }); + + if (easing && easing !== 'spline') { + clip.easing = easing; + } + self._clipList.push(clip); + self._clipCount++; + self.animation.add(clip); + }; + + for (var propName in this._tracks) { + createTrackClip(this._tracks[propName], propName); + } + return this; + }, + /** + * 停止动画 + */ + stop : function() { + for (var i = 0; i < this._clipList.length; i++) { + var clip = this._clipList[i]; + this.animation.remove(clip); + } + this._clipList = []; + }, + /** + * 设置动画延迟开始的时间 + * @param {number} time 单位ms + * @return {module:zrender/animation/Animation~Animator} + */ + delay : function (time) { + this._delay = time; + return this; + }, + /** + * 添加动画结束的回调 + * @param {Function} cb + * @return {module:zrender/animation/Animation~Animator} + */ + done : function(cb) { + this._doneList.push(cb); + return this; + } + }; + + return Animation; + } +); + +/*! + * ZRender, a high performance canvas library. + * + * Copyright (c) 2013, Baidu Inc. + * All rights reserved. + * + * LICENSE + * https://github.com/ecomfe/zrender/blob/master/LICENSE.txt + */ +define( + 'zrender/zrender',['require','./dep/excanvas','./tool/util','./tool/log','./tool/guid','./Handler','./Painter','./Storage','./animation/Animation','./tool/env'],function(require) { + /* + * HTML5 Canvas for Internet Explorer! + * Modern browsers like Firefox, Safari, Chrome and Opera support + * the HTML5 canvas tag to allow 2D command-based drawing. + * ExplorerCanvas brings the same functionality to Internet Explorer. + * To use, web developers only need to include a single script tag + * in their existing web pages. + * + * https://code.google.com/p/explorercanvas/ + * http://explorercanvas.googlecode.com/svn/trunk/excanvas.js + */ + // 核心代码会生成一个全局变量 G_vmlCanvasManager,模块改造后借用于快速判断canvas支持 + require('./dep/excanvas'); + + var util = require('./tool/util'); + var log = require('./tool/log'); + var guid = require('./tool/guid'); + + var Handler = require('./Handler'); + var Painter = require('./Painter'); + var Storage = require('./Storage'); + var Animation = require('./animation/Animation'); + + var _instances = {}; // ZRender实例map索引 + + /** + * @exports zrender + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * pissang (https://www.github.com/pissang) + */ + var zrender = {}; + /** + * @type {string} + */ + zrender.version = '2.0.4'; + + /** + * 创建zrender实例 + * + * @param {HTMLElement} dom 绘图容器 + * @return {module:zrender~ZRender} ZRender实例 + */ + // 不让外部直接new ZRender实例,为啥? + // 不为啥,提供全局可控同时减少全局污染和降低命名冲突的风险! + zrender.init = function(dom) { + var zr = new ZRender(guid(), dom); + _instances[zr.id] = zr; + return zr; + }; + + /** + * zrender实例销毁 + * @param {module:zrender~ZRender} zr ZRender对象,不传则销毁全部 + */ + // 在_instances里的索引也会删除了 + // 管生就得管死,可以通过zrender.dispose(zr)销毁指定ZRender实例 + // 当然也可以直接zr.dispose()自己销毁 + zrender.dispose = function (zr) { + if (zr) { + zr.dispose(); + } + else { + for (var key in _instances) { + _instances[key].dispose(); + } + _instances = {}; + } + + return zrender; + }; + + /** + * 获取zrender实例 + * @param {string} id ZRender对象索引 + * @return {module:zrender~ZRender} + */ + zrender.getInstance = function (id) { + return _instances[id]; + }; + + /** + * 删除zrender实例,ZRender实例dispose时会调用, + * 删除后getInstance则返回undefined + * ps: 仅是删除,删除的实例不代表已经dispose了~~ + * 这是一个摆脱全局zrender.dispose()自动销毁的后门, + * take care of yourself~ + * + * @param {string} id ZRender对象索引 + */ + zrender.delInstance = function (id) { + delete _instances[id]; + return zrender; + }; + + function getFrameCallback(zrInstance) { + return function () { + var animatingElements = zrInstance.animatingElements; + for (var i = 0, l = animatingElements.length; i < l; i++) { + zrInstance.storage.mod(animatingElements[i].id); + } + + if (animatingElements.length || zrInstance._needsRefreshNextFrame) { + zrInstance.refresh(); + } + }; + } + + /** + * ZRender接口类,对外可用的所有接口都在这里 + * 非get接口统一返回支持链式调用 + * + * @constructor + * @alias module:zrender~ZRender + * @param {string} id 唯一标识 + * @param {HTMLElement} dom dom对象,不帮你做document.getElementById + * @return {ZRender} ZRender实例 + */ + var ZRender = function(id, dom) { + /** + * 实例 id + * @type {string} + */ + this.id = id; + this.env = require('./tool/env'); + + this.storage = new Storage(); + this.painter = new Painter(dom, this.storage); + this.handler = new Handler(dom, this.storage, this.painter); + + // 动画控制 + this.animatingElements = []; + /** + * @type {module:zrender/animation/Animation} + */ + this.animation = new Animation({ + stage: { + update: getFrameCallback(this) + } + }); + this.animation.start(); + + this._needsRefreshNextFrame = false; + }; + + /** + * 获取实例唯一标识 + * @return {string} + */ + ZRender.prototype.getId = function () { + return this.id; + }; + + /** + * 添加图形形状到根节点 + * + * @param {module:zrender/shape/Base} shape 形状对象,可用属性全集,详见各shape + */ + ZRender.prototype.addShape = function (shape) { + this.storage.addRoot(shape); + return this; + }; + + /** + * 添加组到根节点 + * + * @param {module:zrender/Group} group + */ + ZRender.prototype.addGroup = function(group) { + this.storage.addRoot(group); + return this; + }; + + /** + * 从根节点删除图形形状 + * + * @param {string} shapeId 形状对象唯一标识 + */ + ZRender.prototype.delShape = function (shapeId) { + this.storage.delRoot(shapeId); + return this; + }; + + /** + * 从根节点删除组 + * + * @param {string} groupId + */ + ZRender.prototype.delGroup = function (groupId) { + this.storage.delRoot(groupId); + return this; + }; + + /** + * 修改图形形状 + * + * @param {string} shapeId 形状对象唯一标识 + * @param {Object} shape 形状对象 + */ + ZRender.prototype.modShape = function (shapeId, shape) { + this.storage.mod(shapeId, shape); + return this; + }; + + /** + * 修改组 + * + * @param {string} groupId + * @param {Object} group + */ + ZRender.prototype.modGroup = function (groupId, group) { + this.storage.mod(groupId, group); + return this; + }; + + /** + * 修改指定zlevel的绘制配置项 + * + * @param {string} zLevel + * @param {Object} config 配置对象 + * @param {string} [config.clearColor=0] 每次清空画布的颜色 + * @param {string} [config.motionBlur=false] 是否开启动态模糊 + * @param {number} [config.lastFrameAlpha=0.7] + * 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显 + * @param {Array.} [config.position] 层的平移 + * @param {Array.} [config.rotation] 层的旋转 + * @param {Array.} [config.scale] 层的缩放 + * @param {boolean} [config.zoomable=false] 层是否支持鼠标缩放操作 + * @param {boolean} [config.panable=false] 层是否支持鼠标平移操作 + */ + ZRender.prototype.modLayer = function (zLevel, config) { + this.painter.modLayer(zLevel, config); + return this; + }; + + /** + * 添加额外高亮层显示,仅提供添加方法,每次刷新后高亮层图形均被清空 + * + * @param {Object} shape 形状对象 + */ + ZRender.prototype.addHoverShape = function (shape) { + this.storage.addHover(shape); + return this; + }; + + /** + * 渲染 + * + * @param {Function} callback 渲染结束后回调函数 + */ + ZRender.prototype.render = function (callback) { + this.painter.render(callback); + this._needsRefreshNextFrame = false; + return this; + }; + + /** + * 视图更新 + * + * @param {Function} callback 视图更新后回调函数 + */ + ZRender.prototype.refresh = function (callback) { + this.painter.refresh(callback); + this._needsRefreshNextFrame = false; + return this; + }; + + /** + * 标记视图在浏览器下一帧需要绘制 + */ + ZRender.prototype.refreshNextFrame = function() { + this._needsRefreshNextFrame = true; + return this; + }; + + /** + * 绘制高亮层 + * @param {Function} callback 视图更新后回调函数 + */ + ZRender.prototype.refreshHover = function (callback) { + this.painter.refreshHover(callback); + return this; + }; + + /** + * 视图更新 + * + * @param {Array.} shapeList 需要更新的图形列表 + * @param {Function} callback 视图更新后回调函数 + */ + ZRender.prototype.refreshShapes = function (shapeList, callback) { + this.painter.refreshShapes(shapeList, callback); + return this; + }; + + /** + * 调整视图大小 + */ + ZRender.prototype.resize = function() { + this.painter.resize(); + return this; + }; + + /** + * 动画 + * + * @param {string|module:zrender/Group|module:zrender/shape/Base} el 动画对象 + * @param {string} path 需要添加动画的属性获取路径,可以通过a.b.c来获取深层的属性 + * @param {boolean} [loop] 动画是否循环 + * @return {module:zrender/animation/Animation~Animator} + * @example: + * zr.animate(circle.id, 'style', false) + * .when(1000, {x: 10} ) + * .done(function(){ // Animation done }) + * .start() + */ + ZRender.prototype.animate = function (el, path, loop) { + if (typeof(el) === 'string') { + el = this.storage.get(el); + } + if (el) { + var target; + if (path) { + var pathSplitted = path.split('.'); + var prop = el; + for (var i = 0, l = pathSplitted.length; i < l; i++) { + if (!prop) { + continue; + } + prop = prop[pathSplitted[i]]; + } + if (prop) { + target = prop; + } + } + else { + target = el; + } + + if (!target) { + log( + 'Property "' + + path + + '" is not existed in element ' + + el.id + ); + return; + } + + var animatingElements = this.animatingElements; + if (typeof el.__aniCount === 'undefined') { + // 正在进行的动画记数 + el.__aniCount = 0; + } + if (el.__aniCount === 0) { + animatingElements.push(el); + } + el.__aniCount++; + + return this.animation.animate(target, { loop: loop }) + .done(function () { + el.__aniCount--; + if (el.__aniCount === 0) { + // 从animatingElements里移除 + var idx = util.indexOf(animatingElements, el); + animatingElements.splice(idx, 1); + } + }); + } + else { + log('Element not existed'); + } + }; + + /** + * 停止所有动画 + */ + ZRender.prototype.clearAnimation = function () { + this.animation.clear(); + }; + + /** + * loading显示 + * + * @param {Object=} loadingEffect loading效果对象 + */ + ZRender.prototype.showLoading = function (loadingEffect) { + this.painter.showLoading(loadingEffect); + return this; + }; + + /** + * loading结束 + */ + ZRender.prototype.hideLoading = function () { + this.painter.hideLoading(); + return this; + }; + + /** + * 获取视图宽度 + */ + ZRender.prototype.getWidth = function() { + return this.painter.getWidth(); + }; + + /** + * 获取视图高度 + */ + ZRender.prototype.getHeight = function() { + return this.painter.getHeight(); + }; + + /** + * 图像导出 + * @param {string} type + * @param {string} [backgroundColor='#fff'] 背景色 + * @return {string} 图片的Base64 url + */ + ZRender.prototype.toDataURL = function(type, backgroundColor, args) { + return this.painter.toDataURL(type, backgroundColor, args); + }; + + /** + * 将常规shape转成image shape + * @param {module:zrender/shape/Base} e + * @param {number} width + * @param {number} height + */ + ZRender.prototype.shapeToImage = function(e, width, height) { + var id = guid(); + return this.painter.shapeToImage(id, e, width, height); + }; + + /** + * 事件绑定 + * + * @param {string} eventName 事件名称 + * @param {Function} eventHandler 响应函数 + */ + ZRender.prototype.on = function(eventName, eventHandler) { + this.handler.on(eventName, eventHandler); + return this; + }; + + /** + * 事件解绑定,参数为空则解绑所有自定义事件 + * + * @param {string} eventName 事件名称 + * @param {Function} eventHandler 响应函数 + */ + ZRender.prototype.un = function(eventName, eventHandler) { + this.handler.un(eventName, eventHandler); + return this; + }; + + /** + * 事件触发 + * + * @param {string} eventName 事件名称,resize,hover,drag,etc + * @param {event=} event event dom事件对象 + */ + ZRender.prototype.trigger = function (eventName, event) { + this.handler.trigger(eventName, event); + return this; + }; + + + /** + * 清除当前ZRender下所有类图的数据和显示,clear后MVC和已绑定事件均还存在在,ZRender可用 + */ + ZRender.prototype.clear = function () { + this.storage.delRoot(); + this.painter.clear(); + return this; + }; + + /** + * 释放当前ZR实例(删除包括dom,数据、显示和事件绑定),dispose后ZR不可用 + */ + ZRender.prototype.dispose = function () { + this.animation.stop(); + + this.clear(); + this.storage.dispose(); + this.painter.dispose(); + this.handler.dispose(); + + this.animation = + this.animatingElements = + this.storage = + this.painter = + this.handler = null; + + // 释放后告诉全局删除对自己的索引,没想到啥好方法 + zrender.delInstance(this.id); + }; + + return zrender; + } +); -/** - * zrender - * - * author: loutongbing@baidu.com - * - * shape类:椭圆 - * Todo:excanvas bug ~ 连续scale保持?? IE8下不建议使用 - * 可配图形属性: - { - // 基础属性 - shape : 'ellipse', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,椭圆心横坐标 - y : {number}, // 必须,椭圆心纵坐标 - a : {number}, // 必须,椭圆横轴半径 - b : {number}, // 必须,椭圆纵轴半径 - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为top,附加文本位置。 - // inside | left | right | top | bottom - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'ellipse', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - a : 100, - b : 50, - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - 'zrender/shape/Ellipse',['require','./Base','../tool/util'],function (require) { - var Base = require('./Base'); - - function Ellipse(options) { - Base.call(this, options); - } - - Ellipse.prototype = { - type: 'ellipse', - - /** - * 创建圆形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - var k = 0.5522848; - var x = style.x; - var y = style.y; - var a =style.a; - var b = style.b; - var ox = a * k; // 水平控制点偏移量 - var oy = b * k; // 垂直控制点偏移量 - //从椭圆的左端点开始顺时针绘制四条三次贝塞尔曲线 - ctx.moveTo(x - a, y); - ctx.bezierCurveTo(x - a, y - oy, x - ox, y - b, x, y - b); - ctx.bezierCurveTo(x + ox, y - b, x + a, y - oy, x + a, y); - ctx.bezierCurveTo(x + a, y + oy, x + ox, y + b, x, y + b); - ctx.bezierCurveTo(x - ox, y + b, x - a, y + oy, x - a, y); - }, +define('zrender', ['zrender/zrender'], function (main) { return main; }); - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function(style) { - if (style.__rect) { - return style.__rect; - } - - var lineWidth; - if (style.brushType == 'stroke' || style.brushType == 'fill') { - lineWidth = style.lineWidth || 1; - } - else { - lineWidth = 0; - } - style.__rect = { - x : Math.round(style.x - style.a - lineWidth / 2), - y : Math.round(style.y - style.b - lineWidth / 2), - width : style.a * 2 + lineWidth, - height : style.b * 2 + lineWidth - }; - - return style.__rect; - } - }; +/** + * echarts层级查找方法 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/util/ecQuery',['zrender/tool/util'],function() { + var zrUtil = require('zrender/tool/util'); + + /** + * 获取嵌套选项的基础方法 + * 返回optionTarget中位于optionLocation上的值,如果没有定义,则返回undefined + */ + function query(optionTarget, optionLocation) { + if (typeof optionTarget == 'undefined') { + return; + } + + if (!optionLocation) { + return optionTarget; + } + + optionLocation = optionLocation.split('.'); + var length = optionLocation.length; + var curIdx = 0; + while (curIdx < length) { + optionTarget = optionTarget[optionLocation[curIdx]]; + if (typeof optionTarget == 'undefined') { + return; + } + curIdx++; + } + + return optionTarget; + } + + /** + * 获取多级控制嵌套属性的基础方法 + * 返回ctrList中优先级最高(最靠前)的非undefined属性,ctrList中均无定义则返回undefined + */ + function deepQuery(ctrList, optionLocation) { + var finalOption; + for (var i = 0, l = ctrList.length; i < l; i++) { + finalOption = query(ctrList[i], optionLocation); + if (typeof finalOption != 'undefined') { + return finalOption; + } + } + } + + /** + * 获取多级控制嵌套属性的基础方法 + * 根据ctrList中优先级合并产出目标属性 + */ + function deepMerge(ctrList, optionLocation) { + var finalOption; + var len = ctrList.length; + while (len--) { + var tempOption = query(ctrList[len], optionLocation); + if (typeof tempOption != 'undefined') { + if (typeof finalOption == 'undefined') { + finalOption = zrUtil.clone(tempOption); + } + else { + zrUtil.merge( + finalOption, tempOption, true + ); + } + } + } + + return finalOption; + } + + return { + query : query, + deepQuery : deepQuery, + deepMerge : deepMerge + }; +}); +/** + * echarts数字运算相关 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/util/number',[],function() { + function _trim(str) { + return str.replace(/^\s+/, '').replace(/\s+$/, ''); + } + + /** + * 百分比计算 + */ + function parsePercent(value, maxValue) { + if (typeof value === 'string') { + if (_trim(value).match(/%$/)) { + return parseFloat(value) / 100 * maxValue; + } + + return parseFloat(value); + } + + return value; + } + + /** + * 获取中心坐标 + */ + function parseCenter(zr, center) { + return [ + parsePercent(center[0], zr.getWidth()), + parsePercent(center[1], zr.getHeight()) + ]; + } + + /** + * 获取自适应半径 + */ + function parseRadius(zr, radius) { + // 传数组实现环形图,[内半径,外半径],传单个则默认为外半径为 + if (!(radius instanceof Array)) { + radius = [0, radius]; + } + var zrSize = Math.min(zr.getWidth(), zr.getHeight()) / 2; + return [ + parsePercent(radius[0], zrSize), + parsePercent(radius[1], zrSize) + ]; + } + + /** + * 每三位默认加,格式化 + */ + function addCommas(x) { + if (isNaN(x)) { + return '-'; + } + x = (x + '').split('.'); + return x[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,'$1,') + + (x.length > 1 ? ('.' + x[1]) : ''); + } + + return { + parsePercent : parsePercent, + parseCenter : parseCenter, + parseRadius : parseRadius, + addCommas : addCommas + }; +}); +/** + * echarts组件基类 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/component/base',['require','../config','../util/ecQuery','../util/number','zrender/tool/util','zrender/tool/env'],function (require) { + var ecConfig = require('../config'); + var ecQuery = require('../util/ecQuery'); + var number = require('../util/number'); + var zrUtil = require('zrender/tool/util'); + + function Base(ecTheme, messageCenter, zr, option, myChart){ + this.ecTheme = ecTheme; + this.messageCenter = messageCenter; + this.zr =zr; + this.option = option; + this.series = option.series; + this.myChart = myChart; + this.component = myChart.component; + + this._zlevelBase = this.getZlevelBase(); + this.shapeList = []; + this.effectList = []; + + var self = this; + self.hoverConnect = function (param) { + var target = (param.target || {}).hoverConnect; + if (target) { + var zlevel = 10; + var shape; + if (!(target instanceof Array)) { + shape = self.getShapeById(target); + if (shape) { + self.zr.addHoverShape(shape); + zlevel = Math.min(zlevel, shape.zlevel); + } + } + else { + for (var i = 0, l = target.length; i < l; i++) { + shape = self.getShapeById(target[i]); + self.zr.addHoverShape(shape); + zlevel = Math.min(zlevel, shape.zlevel); + } + } + if (zlevel < param.target.zlevel) { + self.zr.addHoverShape(param.target); + } + } + }; + } + + /** + * 基类方法 + */ + Base.prototype = { + canvasSupported: require('zrender/tool/env').canvasSupported, + /** + * 获取zlevel基数配置 + * @param {Object} contentType + */ + getZlevelBase: function (contentType) { + contentType = contentType || this.type + ''; + + switch (contentType) { + case ecConfig.COMPONENT_TYPE_GRID : + case ecConfig.COMPONENT_TYPE_AXIS_CATEGORY : + case ecConfig.COMPONENT_TYPE_AXIS_VALUE : + case ecConfig.COMPONENT_TYPE_POLAR : + return 0; + + case ecConfig.CHART_TYPE_LINE : + case ecConfig.CHART_TYPE_BAR : + case ecConfig.CHART_TYPE_SCATTER : + case ecConfig.CHART_TYPE_PIE : + case ecConfig.CHART_TYPE_RADAR : + case ecConfig.CHART_TYPE_MAP : + case ecConfig.CHART_TYPE_K : + case ecConfig.CHART_TYPE_CHORD: + case ecConfig.CHART_TYPE_GUAGE: + case ecConfig.CHART_TYPE_FUNNEL: + return 2; + + case ecConfig.COMPONENT_TYPE_LEGEND : + case ecConfig.COMPONENT_TYPE_DATARANGE: + case ecConfig.COMPONENT_TYPE_DATAZOOM : + case ecConfig.COMPONENT_TYPE_TIMELINE : + case ecConfig.COMPONENT_TYPE_ROAMCONTROLLER : + return 4; + + case ecConfig.CHART_TYPE_ISLAND : + return 5; + + case ecConfig.COMPONENT_TYPE_TOOLBOX : + case ecConfig.COMPONENT_TYPE_TITLE : + return 6; + + // ecConfig.EFFECT_ZLEVEL = 7; + + case ecConfig.COMPONENT_TYPE_TOOLTIP : + return 8; + + default : + return 0; + } + }, + + /** + * 参数修正&默认值赋值 + * @param {Object} opt 参数 + * + * @return {Object} 修正后的参数 + */ + reformOption: function (opt) { + return zrUtil.merge( + opt || {}, + zrUtil.clone(this.ecTheme[this.type] || {}) + ); + }, + + /** + * css类属性数组补全,如padding,margin等~ + */ + reformCssArray: function (p) { + if (p instanceof Array) { + switch (p.length + '') { + case '4': + return p; + case '3': + return [p[0], p[1], p[2], p[1]]; + case '2': + return [p[0], p[1], p[0], p[1]]; + case '1': + return [p[0], p[0], p[0], p[0]]; + case '0': + return [0, 0, 0, 0]; + } + } + else { + return [p, p, p, p]; + } + }, + + getShapeById: function(id) { + for (var i = 0, l = this.shapeList.length; i < l; i++) { + if (this.shapeList[i].id === id) { + return this.shapeList[i]; + } + } + return null; + }, + + /** + * 获取自定义和默认配置合并后的字体设置 + */ + getFont: function (textStyle) { + var finalTextStyle = zrUtil.merge( + zrUtil.clone(textStyle) || {}, + this.ecTheme.textStyle + ); + return finalTextStyle.fontStyle + ' ' + + finalTextStyle.fontWeight + ' ' + + finalTextStyle.fontSize + 'px ' + + finalTextStyle.fontFamily; + }, + + getItemStyleColor: function (itemColor, seriesIndex, dataIndex, data) { + return typeof itemColor === 'function' + ? itemColor(seriesIndex, dataIndex, data) : itemColor; + + }, + + // 亚像素优化 + subPixelOptimize: function (position, lineWidth) { + if (lineWidth % 2 === 1) { + //position += position === Math.ceil(position) ? 0.5 : 0; + position = Math.floor(position) + 0.5; + } + else { + position = Math.round(position); + } + return position; + }, + + + resize: function () { + this.refresh && this.refresh(); + this.clearEffectShape && this.clearEffectShape(true); + var self = this; + setTimeout(function(){ + self.animationEffect && self.animationEffect(); + },200); + }, + + /** + * 清除图形数据,实例仍可用 + */ + clear :function () { + this.clearEffectShape && this.clearEffectShape(); + this.zr && this.zr.delShape(this.shapeList); + this.shapeList = []; + }, + + /** + * 释放后实例不可用 + */ + dispose: function () { + this.clear(); + this.shapeList = null; + this.effectList = null; + }, + + query: ecQuery.query, + deepQuery: ecQuery.deepQuery, + deepMerge: ecQuery.deepMerge, + + parsePercent: number.parsePercent, + parseCenter: number.parseCenter, + parseRadius: number.parseRadius, + numAddCommas: number.addCommas + }; + + return Base; +}); + +/** + * zrender: 数学辅助类 + * + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + * sin:正弦函数 + * cos:余弦函数 + * degreeToRadian:角度转弧度 + * radianToDegree:弧度转角度 + */ +define( + 'zrender/tool/math',[],function () { + + var _radians = Math.PI / 180; + + /** + * @param {number} angle 弧度(角度)参数 + * @param {boolean} isDegrees angle参数是否为角度计算,默认为false,angle为以弧度计量的角度 + */ + function sin(angle, isDegrees) { + return Math.sin(isDegrees ? angle * _radians : angle); + } + + /** + * @param {number} angle 弧度(角度)参数 + * @param {boolean} isDegrees angle参数是否为角度计算,默认为false,angle为以弧度计量的角度 + */ + function cos(angle, isDegrees) { + return Math.cos(isDegrees ? angle * _radians : angle); + } + + /** + * 角度转弧度 + * @param {Object} angle + */ + function degreeToRadian(angle) { + return angle * _radians; + } + + /** + * 弧度转角度 + * @param {Object} angle + */ + function radianToDegree(angle) { + return angle / _radians; + } + + return { + sin : sin, + cos : cos, + degreeToRadian : degreeToRadian, + radianToDegree : radianToDegree + }; + } +); + +/** + * n角星(n>3) + * @module zrender/shape/Star + * @author sushuang (宿爽, sushuang@baidu.com) + * @example + * var Star = require('zrender/shape/Star'); + * var shape = new Star({ + * style: { + * x: 200, + * y: 100, + * r: 150, + * n: 5, + * text: '五角星' + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} IStarStyle + * @property {number} x n角星外接圆心x坐标 + * @property {number} y n角星外接圆心y坐标 + * @property {number} r n角星外接圆半径 + * @property {number} [r0] n角星内部顶点(凹点)的外接圆半径。 + * 如果不指定此参数,则自动计算:取相隔外部顶点连线的交点作内部顶点。 + * @property {number} n 指明几角星 + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ + +define( + 'zrender/shape/Star',['require','../tool/math','./Base','../tool/util'],function (require) { + + var math = require('../tool/math'); + var sin = math.sin; + var cos = math.cos; + var PI = Math.PI; + + var Base = require('./Base'); + + /** + * @alias module:zrender/shape/Star + * @param {Object} options + * @constructor + * @extends module:zrender/shape/Base + */ + var Star = function(options) { + Base.call(this, options); + /** + * n角星绘制样式 + * @name module:zrender/shape/Star#style + * @type {module:zrender/shape/Star~IStarStyle} + */ + /** + * n角星高亮绘制样式 + * @name module:zrender/shape/Star#highlightStyle + * @type {module:zrender/shape/Star~IStarStyle} + */ + }; + + Star.prototype = { + type: 'star', + + /** + * 创建n角星(n>3)路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Star~IStarStyle} style + */ + buildPath : function(ctx, style) { + var n = style.n; + if (!n || n < 2) { + return; + } + + var x = style.x; + var y = style.y; + var r = style.r; + var r0 = style.r0; + + // 如果未指定内部顶点外接圆半径,则自动计算 + if (r0 == null) { + r0 = n > 4 + // 相隔的外部顶点的连线的交点, + // 被取为内部交点,以此计算r0 + ? r * cos(2 * PI / n) / cos(PI / n) + // 二三四角星的特殊处理 + : r / 3; + } + + var dStep = PI / n; + var deg = -PI / 2; + var xStart = x + r * cos(deg); + var yStart = y + r * sin(deg); + deg += dStep; + + // 记录边界点,用于判断inside + var pointList = style.pointList = []; + pointList.push([ xStart, yStart ]); + for (var i = 0, end = n * 2 - 1, ri; i < end; i++) { + ri = i % 2 === 0 ? r0 : r; + pointList.push([ x + ri * cos(deg), y + ri * sin(deg) ]); + deg += dStep; + } + pointList.push([ xStart, yStart ]); + + // 绘制 + ctx.moveTo(pointList[0][0], pointList[0][1]); + for (var i = 0; i < pointList.length; i++) { + ctx.lineTo(pointList[i][0], pointList[i][1]); + } + + ctx.closePath(); + + return; + }, + + /** + * 返回n角星包围盒矩形 + * @param {module:zrender/shape/Star~IStarStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function(style) { + if (style.__rect) { + return style.__rect; + } + + var lineWidth; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } + else { + lineWidth = 0; + } + style.__rect = { + x : Math.round(style.x - style.r - lineWidth / 2), + y : Math.round(style.y - style.r - lineWidth / 2), + width : style.r * 2 + lineWidth, + height : style.r * 2 + lineWidth + }; + + return style.__rect; + } + }; + + require('../tool/util').inherits(Star, Base); + return Star; + } +); + +/** + * @module zrender/shape/Heart + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @example + * var Heart = require('zrender/shape/Heart'); + * var shape = new Heart({ + * style: { + * x: 100, + * y: 100, + * a: 40, + * b: 40, + * brushType: 'both', + * color: 'blue', + * strokeColor: 'red', + * lineWidth: 3, + * text: 'Heart' + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} IHeartStyle + * @property {number} x 心形内部尖端横坐标 + * @property {number} y 心形内部尖端纵坐标 + * @property {number} a 心形横宽(中轴线到水平边缘最宽处距离) + * @property {number} b 心形纵高(内尖到外尖距离) + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ +define( + 'zrender/shape/Heart',['require','./Base','../tool/util'],function (require) { + + + var Base = require('./Base'); + + /** + * @alias module:zrender/shape/Heart + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var Heart = function (options) { + Base.call(this, options); + /** + * 心形绘制样式 + * @name module:zrender/shape/Heart#style + * @type {module:zrender/shape/Heart~IHeartStyle} + */ + /** + * 心形高亮绘制样式 + * @name module:zrender/shape/Heart#highlightStyle + * @type {module:zrender/shape/Heart~IHeartStyle} + */ + }; + + Heart.prototype = { + type: 'heart', + + /** + * 创建扇形路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Heart~IHeartStyle} style + */ + buildPath : function (ctx, style) { + ctx.moveTo(style.x, style.y); + ctx.bezierCurveTo( + style.x + style.a / 2, + style.y - style.b * 2 / 3, + style.x + style.a * 2, + style.y + style.b / 3, + style.x, + style.y + style.b + ); + ctx.bezierCurveTo( + style.x - style.a * 2, + style.y + style.b / 3, + style.x - style.a / 2, + style.y - style.b * 2 / 3, + style.x, + style.y + ); + ctx.closePath(); + return; + }, + + /** + * 计算返回心形的包围盒矩形 + * @param {module:zrender/shape/Heart~IHeartStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function (style) { + if (style.__rect) { + return style.__rect; + } + + var lineWidth; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } + else { + lineWidth = 0; + } + style.__rect = { + x : Math.round(style.x - style.a - lineWidth / 2), + y : Math.round(style.y - style.b / 4 - lineWidth / 2), + width : style.a * 2 + lineWidth, + height : style.b * 5 / 4 + lineWidth + }; + + return style.__rect; + } + }; + + require('../tool/util').inherits(Heart, Base); + return Heart; + } +); + +/** + * 水滴形状 + * @module zrender/shape/Droplet + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @example + * var Droplet = require('zrender/shape/Droplet'); + * var shape = new Droplet({ + * style: { + * x: 100, + * y: 100, + * a: 40, + * b: 40, + * brushType: 'both', + * color: 'blue', + * strokeColor: 'red', + * lineWidth: 3, + * text: 'Droplet' + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} IDropletStyle + * @property {number} x 水滴中心x坐标 + * @property {number} y 水滴中心y坐标 + * @property {number} a 水滴横宽(中心到水平边缘最宽处距离) + * @property {number} b 水滴纵高(中心到尖端距离) + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ +define( + 'zrender/shape/Droplet',['require','./Base','../tool/util'],function (require) { + + + var Base = require('./Base'); + + /** + * @alias module:zrender/shape/Droplet + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var Droplet = function(options) { + Base.call(this, options); + /** + * 水滴绘制样式 + * @name module:zrender/shape/Droplet#style + * @type {module:zrender/shape/Droplet~IDropletStyle} + */ + /** + * 水滴高亮绘制样式 + * @name module:zrender/shape/Droplet#highlightStyle + * @type {module:zrender/shape/Droplet~IDropletStyle} + */ + }; + + Droplet.prototype = { + type: 'droplet', + + /** + * 创建水滴路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Droplet~IDropletStyle} style + */ + buildPath : function(ctx, style) { + ctx.moveTo(style.x, style.y + style.a); + ctx.bezierCurveTo( + style.x + style.a, + style.y + style.a, + style.x + style.a * 3 / 2, + style.y - style.a / 3, + style.x, + style.y - style.b + ); + ctx.bezierCurveTo( + style.x - style.a * 3 / 2, + style.y - style.a / 3, + style.x - style.a, + style.y + style.a, + style.x, + style.y + style.a + ); + ctx.closePath(); + }, + + /** + * 计算返回水滴的包围盒矩形 + * @param {module:zrender/shape/Droplet~IDropletStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function(style) { + if (style.__rect) { + return style.__rect; + } + + var lineWidth; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } + else { + lineWidth = 0; + } + style.__rect = { + x : Math.round(style.x - style.a - lineWidth / 2), + y : Math.round(style.y - style.b - lineWidth / 2), + width : style.a * 2 + lineWidth, + height : style.a + style.b + lineWidth + }; + + return style.__rect; + } + }; + + require('../tool/util').inherits(Droplet, Base); + return Droplet; + } +); + +/** + * echarts扩展zrender shape + * + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + * shape类:icon + * 可配图形属性: + { + // 基础属性 + shape : 'icon', // 必须,shape类标识,需要显式指定 + id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 + zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 + invisible : {boolean}, // 默认为false,是否可见 + + // 样式属性,默认状态样式样式属性 + style : { + x : {number}, // 必须,左上角横坐标 + y : {number}, // 必须,左上角纵坐标 + width : {number}, // 必须,宽度 + height : {number}, // 必须,高度 + iconType : {string}, // 必须,icon类型 + }, + + // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 + highlightStyle : { + // 同style + } + + // 交互属性,详见shape.Base + + // 事件属性,详见shape.Base + } + */ +define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/Star','zrender/shape/Heart','zrender/shape/Droplet','zrender/shape/Image','zrender/shape/Base'],function (require) { + var zrUtil = require('zrender/tool/util'); + + function _iconMark(ctx, style) { + var dx = style.width / 16; + var dy = style.height / 16; + ctx.moveTo(style.x, style.y + style.height); + ctx.lineTo(style.x + 5 * dx, style.y + 14 * dy); + ctx.lineTo(style.x + style.width, style.y + 3 * dy); + ctx.lineTo(style.x + 13 * dx, style.y); + ctx.lineTo(style.x + 2 * dx, style.y + 11 * dy); + ctx.lineTo(style.x, style.y + style.height); + + ctx.moveTo(style.x + 6 * dx, style.y + 10 * dy); + ctx.lineTo(style.x + 14 * dx, style.y + 2 * dy); + + ctx.moveTo(style.x + 10 * dx, style.y + 13 * dy); + ctx.lineTo(style.x + style.width, style.y + 13 * dy); + + ctx.moveTo(style.x + 13 * dx, style.y + 10 * dy); + ctx.lineTo(style.x + 13 * dx, style.y + style.height); + } + + function _iconMarkUndo(ctx, style) { + var dx = style.width / 16; + var dy = style.height / 16; + ctx.moveTo(style.x, style.y + style.height); + ctx.lineTo(style.x + 5 * dx, style.y + 14 * dy); + ctx.lineTo(style.x + style.width, style.y + 3 * dy); + ctx.lineTo(style.x + 13 * dx, style.y); + ctx.lineTo(style.x + 2 * dx, style.y + 11 * dy); + ctx.lineTo(style.x, style.y + style.height); + + ctx.moveTo(style.x + 6 * dx, style.y + 10 * dy); + ctx.lineTo(style.x + 14 * dx, style.y + 2 * dy); + + ctx.moveTo(style.x + 10 * dx, style.y + 13 * dy); + ctx.lineTo(style.x + style.width, style.y + 13 * dy); + } + + function _iconMarkClear(ctx, style) { + var dx = style.width / 16; + var dy = style.height / 16; + + ctx.moveTo(style.x + 4 * dx, style.y + 15 * dy); + ctx.lineTo(style.x + 9 * dx, style.y + 13 * dy); + ctx.lineTo(style.x + 14 * dx, style.y + 8 * dy); + ctx.lineTo(style.x + 11 * dx, style.y + 5 * dy); + ctx.lineTo(style.x + 6 * dx, style.y + 10 * dy); + ctx.lineTo(style.x + 4 * dx, style.y + 15 * dy); + + ctx.moveTo(style.x + 5 * dx, style.y); + ctx.lineTo(style.x + 11 * dx, style.y); + ctx.moveTo(style.x + 5 * dx, style.y + dy); + ctx.lineTo(style.x + 11 * dx, style.y + dy); + ctx.moveTo(style.x, style.y + 2 * dy); + ctx.lineTo(style.x + style.width, style.y + 2 * dy); + + ctx.moveTo(style.x, style.y + 5 * dy); + ctx.lineTo(style.x + 3 * dx, style.y + style.height); + ctx.lineTo(style.x + 13 * dx, style.y + style.height); + ctx.lineTo(style.x + style.width, style.y + 5 * dy); + } + + function _iconDataZoom(ctx, style) { + var dx = style.width / 16; + var dy = style.height / 16; + + ctx.moveTo(style.x, style.y + 3 * dy); + ctx.lineTo(style.x + 6 * dx, style.y + 3 * dy); + + ctx.moveTo(style.x + 3 * dx, style.y); + ctx.lineTo(style.x + 3 * dx, style.y + 6 * dy); + + ctx.moveTo(style.x + 3 * dx, style.y + 8 * dy); + ctx.lineTo(style.x + 3 * dx, style.y + style.height); + ctx.lineTo(style.x + style.width, style.y + style.height); + ctx.lineTo(style.x + style.width, style.y + 3 * dy); + ctx.lineTo(style.x + 8 * dx, style.y + 3 * dy); + } + + function _iconDataZoomReset(ctx, style) { + var dx = style.width / 16; + var dy = style.height / 16; + + ctx.moveTo(style.x + 6 * dx, style.y); + ctx.lineTo(style.x + 2 * dx, style.y + 3 * dy); + ctx.lineTo(style.x + 6 * dx, style.y + 6 * dy); + + ctx.moveTo(style.x + 2 * dx, style.y + 3 * dy); + ctx.lineTo(style.x + 14 * dx, style.y + 3 * dy); + ctx.lineTo(style.x + 14 * dx, style.y + 11 * dy); + + ctx.moveTo(style.x + 2 * dx, style.y + 5 * dy); + ctx.lineTo(style.x + 2 * dx, style.y + 13 * dy); + ctx.lineTo(style.x + 14 * dx, style.y + 13 * dy); + + ctx.moveTo(style.x + 10 * dx, style.y + 10 * dy); + ctx.lineTo(style.x + 14 * dx, style.y + 13 * dy); + ctx.lineTo(style.x + 10 * dx, style.y + style.height); + } + + function _iconRestore(ctx, style) { + var dx = style.width / 16; + var dy = style.height / 16; + var r = style.width / 2; + + ctx.lineWidth = 1.5; + + ctx.arc(style.x + r, style.y + r, r - dx, 0, Math.PI * 2 / 3); + ctx.moveTo(style.x + 3 * dx, style.y + style.height); + ctx.lineTo(style.x + 0 * dx, style.y + 12 * dy); + ctx.lineTo(style.x + 5 * dx, style.y + 11 * dy); + + ctx.moveTo(style.x, style.y + 8 * dy); + ctx.arc(style.x + r, style.y + r, r - dx, Math.PI, Math.PI * 5 / 3); + ctx.moveTo(style.x + 13 * dx, style.y); + ctx.lineTo(style.x + style.width, style.y + 4 * dy); + ctx.lineTo(style.x + 11 * dx, style.y + 5 * dy); + } + + function _iconLineChart(ctx, style) { + var dx = style.width / 16; + var dy = style.height / 16; + + ctx.moveTo(style.x, style.y); + ctx.lineTo(style.x, style.y + style.height); + ctx.lineTo(style.x + style.width, style.y + style.height); + + ctx.moveTo(style.x + 2 * dx, style.y + 14 * dy); + ctx.lineTo(style.x + 7 * dx, style.y + 6 * dy); + ctx.lineTo(style.x + 11 * dx, style.y + 11 * dy); + ctx.lineTo(style.x + 15 * dx, style.y + 2 * dy); + } + + function _iconBarChart(ctx, style) { + var dx = style.width / 16; + var dy = style.height / 16; + + ctx.moveTo(style.x, style.y); + ctx.lineTo(style.x, style.y + style.height); + ctx.lineTo(style.x + style.width, style.y + style.height); + + ctx.moveTo(style.x + 3 * dx, style.y + 14 * dy); + ctx.lineTo(style.x + 3 * dx, style.y + 6 * dy); + ctx.lineTo(style.x + 4 * dx, style.y + 6 * dy); + ctx.lineTo(style.x + 4 * dx, style.y + 14 * dy); + ctx.moveTo(style.x + 7 * dx, style.y + 14 * dy); + ctx.lineTo(style.x + 7 * dx, style.y + 2 * dy); + ctx.lineTo(style.x + 8 * dx, style.y + 2 * dy); + ctx.lineTo(style.x + 8 * dx, style.y + 14 * dy); + ctx.moveTo(style.x + 11 * dx, style.y + 14 * dy); + ctx.lineTo(style.x + 11 * dx, style.y + 9 * dy); + ctx.lineTo(style.x + 12 * dx, style.y + 9 * dy); + ctx.lineTo(style.x + 12 * dx, style.y + 14 * dy); + } + + function _iconStackChart(ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + var dy = Math.round(height / 3); + var len = 3; + while (len--) { + ctx.rect(x, y + dy * len + 2, width, 2); + } + } + + function _iconTiledChart(ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + var dx = Math.round(width / 3); + var len = 3; + while (len--) { + ctx.rect(x + dx * len, y, 2, height); + } + } + + function _iconDataView(ctx, style) { + var dx = style.width / 16; + + ctx.moveTo(style.x + dx, style.y); + ctx.lineTo(style.x + dx, style.y + style.height); + ctx.lineTo(style.x + 15 * dx, style.y + style.height); + ctx.lineTo(style.x + 15 * dx, style.y); + ctx.lineTo(style.x + dx, style.y); + + ctx.moveTo(style.x + 3 * dx, style.y + 3 * dx); + ctx.lineTo(style.x + 13 * dx, style.y + 3 * dx); + + ctx.moveTo(style.x + 3 * dx, style.y + 6 * dx); + ctx.lineTo(style.x + 13 * dx, style.y + 6 * dx); + + ctx.moveTo(style.x + 3 * dx, style.y + 9 * dx); + ctx.lineTo(style.x + 13 * dx, style.y + 9 * dx); + + ctx.moveTo(style.x + 3 * dx, style.y + 12 * dx); + ctx.lineTo(style.x + 9 * dx, style.y + 12 * dx); + } + + function _iconSave(ctx, style) { + var dx = style.width / 16; + var dy = style.height / 16; + + ctx.moveTo(style.x, style.y); + ctx.lineTo(style.x, style.y + style.height); + ctx.lineTo(style.x + style.width, style.y + style.height); + ctx.lineTo(style.x + style.width, style.y); + ctx.lineTo(style.x, style.y); + + ctx.moveTo(style.x + 4 * dx, style.y); + ctx.lineTo(style.x + 4 * dx, style.y + 8 * dy); + ctx.lineTo(style.x + 12 * dx, style.y + 8 * dy); + ctx.lineTo(style.x + 12 * dx, style.y); + + ctx.moveTo(style.x + 6 * dx, style.y + 11 * dy); + ctx.lineTo(style.x + 6 * dx, style.y + 13 * dy); + ctx.lineTo(style.x + 10 * dx, style.y + 13 * dy); + ctx.lineTo(style.x + 10 * dx, style.y + 11 * dy); + ctx.lineTo(style.x + 6 * dx, style.y + 11 * dy); + } + + function _iconCross(ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + ctx.moveTo(x, y + height / 2); + ctx.lineTo(x + width, y + height / 2); + + ctx.moveTo(x + width / 2, y); + ctx.lineTo(x + width / 2, y + height); + } + + function _iconCircle(ctx, style) { + var width = style.width / 2; + var height = style.height / 2; + var r = Math.min(width, height); + ctx.moveTo( + style.x + width + r, + style.y + height + ); + ctx.arc( + style.x + width, + style.y + height, + r, + 0, + Math.PI * 2 + ); + ctx.closePath(); + } + + function _iconRectangle(ctx, style) { + ctx.rect(style.x, style.y, style.width, style.height); + ctx.closePath(); + } + + function _iconTriangle(ctx, style) { + var width = style.width / 2; + var height = style.height / 2; + var x = style.x + width; + var y = style.y + height; + var symbolSize = Math.min(width, height); + ctx.moveTo(x, y - symbolSize); + ctx.lineTo(x + symbolSize, y + symbolSize); + ctx.lineTo(x - symbolSize, y + symbolSize); + ctx.lineTo(x, y - symbolSize); + ctx.closePath(); + } + + function _iconDiamond(ctx, style) { + var width = style.width / 2; + var height = style.height / 2; + var x = style.x + width; + var y = style.y + height; + var symbolSize = Math.min(width, height); + ctx.moveTo(x, y - symbolSize); + ctx.lineTo(x + symbolSize, y); + ctx.lineTo(x, y + symbolSize); + ctx.lineTo(x - symbolSize, y); + ctx.lineTo(x, y - symbolSize); + ctx.closePath(); + } + + function _iconArrow(ctx, style) { + var x = style.x; + var y = style.y; + var dx = style.width / 16; + ctx.moveTo(x + 8 * dx, y); + ctx.lineTo(x + dx, y + style.height); + ctx.lineTo(x + 8 * dx, y + style.height / 4 * 3); + ctx.lineTo(x + 15 * dx, y + style.height); + ctx.lineTo(x + 8 * dx, y); + ctx.closePath(); + } + + function _iconStar(ctx, style) { + var StarShape = require('zrender/shape/Star'); + var width = style.width / 2; + var height = style.height / 2; + StarShape.prototype.buildPath(ctx, { + x : style.x + width, + y : style.y + height, + r : Math.min(width, height), + n : style.n || 5 + }); + } + + function _iconHeart(ctx, style) { + var HeartShape = require('zrender/shape/Heart'); + HeartShape.prototype.buildPath(ctx, { + x : style.x + style.width / 2, + y : style.y + style.height * 0.2, + a : style.width / 2, + b : style.height * 0.8 + }); + } + + function _iconDroplet(ctx, style) { + var DropletShape = require('zrender/shape/Droplet'); + DropletShape.prototype.buildPath(ctx, { + x : style.x + style.width * 0.5, + y : style.y + style.height * 0.5, + a : style.width * 0.5, + b : style.height * 0.8 + }); + } + + function _iconPin(ctx, style) { + var x = style.x; + var y = style.y - style.height / 2 * 1.5; + var width = style.width / 2; + var height = style.height / 2; + var r = Math.min(width, height); + ctx.arc( + x + width, + y + height, + r, + Math.PI / 5 * 4, + Math.PI / 5 + ); + ctx.lineTo(x + width, y + height + r * 1.5); + ctx.closePath(); + } + + function _iconImage(ctx, style) { + setTimeout(function (){ + var ImageShape = require('zrender/shape/Image'); + var itemShape = new ImageShape({ + style : style + }); + itemShape.brush(ctx); + },100); + } + + var Base = require('zrender/shape/Base'); + + function Icon(options) { + Base.call(this, options); + } + + Icon.prototype = { + type : 'icon', + iconLibrary : { + mark : _iconMark, + markUndo : _iconMarkUndo, + markClear : _iconMarkClear, + dataZoom : _iconDataZoom, + dataZoomReset : _iconDataZoomReset, + restore : _iconRestore, + lineChart : _iconLineChart, + barChart : _iconBarChart, + stackChart : _iconStackChart, + tiledChart : _iconTiledChart, + dataView : _iconDataView, + saveAsImage : _iconSave, + + cross : _iconCross, + circle : _iconCircle, + rectangle : _iconRectangle, + triangle : _iconTriangle, + diamond : _iconDiamond, + arrow : _iconArrow, + star : _iconStar, + heart : _iconHeart, + droplet : _iconDroplet, + pin : _iconPin, + image : _iconImage + }, + /** + * 创建矩形路径 + * @param {Context2D} ctx Canvas 2D上下文 + * @param {Object} style 样式 + */ + buildPath : function (ctx, style) { + if (this.iconLibrary[style.iconType]) { + this.iconLibrary[style.iconType](ctx, style); + } + else { + ctx.moveTo(style.x, style.y); + ctx.lineTo(style.x + style.width, style.y); + ctx.lineTo(style.x + style.width, style.y + style.height); + ctx.lineTo(style.x, style.y + style.height); + ctx.lineTo(style.x, style.y); + ctx.closePath(); + } + + return; + }, + + /** + * 返回矩形区域,用于局部刷新和文字定位 + * @param {Object} style + */ + getRect : function (style) { + if (style.__rect) { + return style.__rect; + } + + // pin比较特殊,让尖端在目标x,y上 + style.__rect = { + x : Math.round(style.x), + y : Math.round(style.y - (style.iconType == 'pin' + ? (style.height / 2 * 1.5) : 0) + ), + width : style.width, + height : style.height + }; + + return style.__rect; + }, + + isCover : function (x, y) { + var originPos = this.getTansform(x, y); + x = originPos[0]; + y = originPos[1]; + + // 快速预判并保留判断矩形 + var rect = this.style.__rect; + if (!rect) { + rect = this.style.__rect = this.getRect(this.style); + } + // 提高交互体验,太小的图形包围盒四向扩大4px + var delta = (rect.height < 8 || rect.width < 8 ) ? 4 : 0; + if (x >= rect.x - delta + && x <= (rect.x + rect.width + delta) + && y >= rect.y - delta + && y <= (rect.y + rect.height + delta) + ) { + // 矩形内 + return true; + } + else { + return false; + } + } + }; + + zrUtil.inherits(Icon, Base); + + return Icon; +}); +/** + * 虚线lineTo + * + * author: Kener (@Kener-林峰, linzhifeng@baidu.com) + * errorrik (errorrik@gmail.com) + */ +define( + 'zrender/shape/util/dashedLineTo',[],function (/* require */) { + + var dashPattern = [ 5, 5 ]; + /** + * 虚线lineTo + */ + return function (ctx, x1, y1, x2, y2, dashLength) { + // http://msdn.microsoft.com/en-us/library/ie/dn265063(v=vs.85).aspx + if (ctx.setLineDash) { + dashPattern[0] = dashPattern[1] = dashLength; + ctx.setLineDash(dashPattern); + ctx.moveTo(x1, y1); + ctx.lineTo(x2, y2); + return; + } + + dashLength = typeof dashLength != 'number' + ? 5 + : dashLength; + + var dx = x2 - x1; + var dy = y2 - y1; + var numDashes = Math.floor( + Math.sqrt(dx * dx + dy * dy) / dashLength + ); + dx = dx / numDashes; + dy = dy / numDashes; + var flag = true; + for (var i = 0; i < numDashes; ++i) { + if (flag) { + ctx.moveTo(x1, y1); + } + else { + ctx.lineTo(x1, y1); + } + flag = !flag; + x1 += dx; + y1 += dy; + } + ctx.lineTo(x2, y2); + }; + } +); + +/** + * 直线 + * @module zrender/shape/Line + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @example + * var Line = require('zrender/shape/Line'); + * var shape = new Line({ + * style: { + * xStart: 0, + * yStart: 0, + * xEnd: 100, + * yEnd: 100, + * strokeColor: '#000', + * lineWidth: 10 + * } + * }); + * zr.addShape(line); + */ +/** + * @typedef {Object} ILineStyle + * @property {number} xStart 起点x坐标 + * @property {number} yStart 起点y坐标 + * @property {number} xEnd 终止点x坐标 + * @property {number} yEnd 终止点y坐标 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ +define( + 'zrender/shape/Line',['require','./Base','./util/dashedLineTo','../tool/util'],function (require) { + var Base = require('./Base'); + var dashedLineTo = require('./util/dashedLineTo'); + + /** + * @alias module:zrender/shape/Line + * @param {Object} options + * @constructor + * @extends module:zrender/shape/Base + */ + var Line = function (options) { + this.brushTypeOnly = 'stroke'; // 线条只能描边,填充后果自负 + this.textPosition = 'end'; + Base.call(this, options); + + /** + * 直线绘制样式 + * @name module:zrender/shape/Line#style + * @type {module:zrender/shape/Line~ILineStyle} + */ + /** + * 直线高亮绘制样式 + * @name module:zrender/shape/Line#highlightStyle + * @type {module:zrender/shape/Line~ILineStyle} + */ + }; + + Line.prototype = { + type: 'line', + + /** + * 创建线条路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Line~ILineStyle} style + */ + buildPath : function (ctx, style) { + if (!style.lineType || style.lineType == 'solid') { + // 默认为实线 + ctx.moveTo(style.xStart, style.yStart); + ctx.lineTo(style.xEnd, style.yEnd); + } + else if (style.lineType == 'dashed' + || style.lineType == 'dotted' + ) { + var dashLength = (style.lineWidth || 1) + * (style.lineType == 'dashed' ? 5 : 1); + dashedLineTo( + ctx, + style.xStart, style.yStart, + style.xEnd, style.yEnd, + dashLength + ); + } + }, + + /** + * 计算返回线条的包围盒矩形 + * @param {module:zrender/shape/Line~ILineStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function (style) { + if (style.__rect) { + return style.__rect; + } + + var lineWidth = style.lineWidth || 1; + style.__rect = { + x : Math.min(style.xStart, style.xEnd) - lineWidth, + y : Math.min(style.yStart, style.yEnd) - lineWidth, + width : Math.abs(style.xStart - style.xEnd) + + lineWidth, + height : Math.abs(style.yStart - style.yEnd) + + lineWidth + }; + + return style.__rect; + } + }; + + require('../tool/util').inherits(Line, Base); + return Line; + } +); + +/** + * Catmull-Rom spline 插值折线 + * @module zrender/shape/util/smoothSpline + * @author pissang (https://www.github.com/pissang) + * Kener (@Kener-林峰, linzhifeng@baidu.com) + * errorrik (errorrik@gmail.com) + */ +define( + 'zrender/shape/util/smoothSpline',['require','../../tool/vector'],function (require) { + var vector = require('../../tool/vector'); + + /** + * @inner + */ + function interpolate(p0, p1, p2, p3, t, t2, t3) { + var v0 = (p2 - p0) * 0.5; + var v1 = (p3 - p1) * 0.5; + return (2 * (p1 - p2) + v0 + v1) * t3 + + (-3 * (p1 - p2) - 2 * v0 - v1) * t2 + + v0 * t + p1; + } + + /** + * @alias module:zrender/shape/util/smoothSpline + * @param {Array} points 线段顶点数组 + * @param {boolean} isLoop + * @param {Array} constraint + * @return {Array} + */ + return function (points, isLoop, constraint) { + var len = points.length; + var ret = []; + + var distance = 0; + for (var i = 1; i < len; i++) { + distance += vector.distance(points[i - 1], points[i]); + } + + var segs = distance / 5; + segs = segs < len ? len : segs; + for (var i = 0; i < segs; i++) { + var pos = i / (segs - 1) * (isLoop ? len : len - 1); + var idx = Math.floor(pos); + + var w = pos - idx; + + var p0; + var p1 = points[idx % len]; + var p2; + var p3; + if (!isLoop) { + p0 = points[idx === 0 ? idx : idx - 1]; + p2 = points[idx > len - 2 ? len - 1 : idx + 1]; + p3 = points[idx > len - 3 ? len - 1 : idx + 2]; + } + else { + p0 = points[(idx - 1 + len) % len]; + p2 = points[(idx + 1) % len]; + p3 = points[(idx + 2) % len]; + } + + var w2 = w * w; + var w3 = w * w2; + + ret.push([ + interpolate(p0[0], p1[0], p2[0], p3[0], w, w2, w3), + interpolate(p0[1], p1[1], p2[1], p3[1], w, w2, w3) + ]); + } + return ret; + }; + } +); + +/** + * 贝塞尔平滑曲线 + * @module zrender/shape/util/smoothBezier + * @author pissang (https://www.github.com/pissang) + * Kener (@Kener-林峰, linzhifeng@baidu.com) + * errorrik (errorrik@gmail.com) + */ +define( + 'zrender/shape/util/smoothBezier',['require','../../tool/vector'],function (require) { + var vector = require('../../tool/vector'); + + /** + * 贝塞尔平滑曲线 + * @alias module:zrender/shape/util/smoothBezier + * @param {Array} points 线段顶点数组 + * @param {number} smooth 平滑等级, 0-1 + * @param {boolean} isLoop + * @param {Array} constraint 将计算出来的控制点约束在一个包围盒内 + * 比如 [[0, 0], [100, 100]], 这个包围盒会与 + * 整个折线的包围盒做一个并集用来约束控制点。 + * @param {Array} 计算出来的控制点数组 + */ + return function (points, smooth, isLoop, constraint) { + var cps = []; + + var v = []; + var v1 = []; + var v2 = []; + var prevPoint; + var nextPoint; + + var hasConstraint = !!constraint; + var min, max; + if (hasConstraint) { + min = [Infinity, Infinity]; + max = [-Infinity, -Infinity]; + for (var i = 0, len = points.length; i < len; i++) { + vector.min(min, min, points[i]); + vector.max(max, max, points[i]); + } + // 与指定的包围盒做并集 + vector.min(min, min, constraint[0]); + vector.max(max, max, constraint[1]); + } + + for (var i = 0, len = points.length; i < len; i++) { + var point = points[i]; + var prevPoint; + var nextPoint; + + if (isLoop) { + prevPoint = points[i ? i - 1 : len - 1]; + nextPoint = points[(i + 1) % len]; + } + else { + if (i === 0 || i === len - 1) { + cps.push(points[i]); + continue; + } + else { + prevPoint = points[i - 1]; + nextPoint = points[i + 1]; + } + } + + vector.sub(v, nextPoint, prevPoint); + + // use degree to scale the handle length + vector.scale(v, v, smooth); + + var d0 = vector.distance(point, prevPoint); + var d1 = vector.distance(point, nextPoint); + var sum = d0 + d1; + if (sum !== 0) { + d0 /= sum; + d1 /= sum; + } + + vector.scale(v1, v, -d0); + vector.scale(v2, v, d1); + var cp0 = vector.add([], point, v1); + var cp1 = vector.add([], point, v2); + if (hasConstraint) { + vector.max(cp0, cp0, min); + vector.min(cp0, cp0, max); + vector.max(cp1, cp1, min); + vector.min(cp1, cp1, max); + } + cps.push(cp0); + cps.push(cp1); + } + + if (isLoop) { + cps.push(cps.shift()); + } + + return cps; + }; + } +); + +/** + * 多边形 + * @module zrender/shape/Polygon + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @example + * var Polygon = require('zrender/shape/Polygon'); + * var shape = new Polygon({ + * style: { + * // 100x100的正方形 + * pointList: [[0, 0], [100, 0], [100, 100], [0, 100]], + * color: 'blue' + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} IPolygonStyle + * @property {string} pointList 多边形顶点数组 + * @property {string} [smooth=''] 是否做平滑插值, 平滑算法可以选择 bezier, spline + * @property {number} [smoothConstraint] 平滑约束 + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ +define( + 'zrender/shape/Polygon',['require','./Base','./util/smoothSpline','./util/smoothBezier','./util/dashedLineTo','../tool/util'],function (require) { + var Base = require('./Base'); + var smoothSpline = require('./util/smoothSpline'); + var smoothBezier = require('./util/smoothBezier'); + var dashedLineTo = require('./util/dashedLineTo'); + + /** + * @alias module:zrender/shape/Polygon + * @param {Object} options + * @constructor + * @extends module:zrender/shape/Base + */ + var Polygon = function (options) { + Base.call(this, options); + /** + * 多边形绘制样式 + * @name module:zrender/shape/Polygon#style + * @type {module:zrender/shape/Polygon~IPolygonStyle} + */ + /** + * 多边形高亮绘制样式 + * @name module:zrender/shape/Polygon#highlightStyle + * @type {module:zrender/shape/Polygon~IPolygonStyle} + */ + }; + + Polygon.prototype = { + type: 'polygon', + + brush : function (ctx, isHighlight) { + var style = this.style; + if (isHighlight) { + // 根据style扩展默认高亮样式 + style = this.getHighlightStyle( + style, + this.highlightStyle || {} + ); + } + + ctx.save(); + this.setContext(ctx, style); + + // 设置transform + this.setTransform(ctx); + + // 先fill再stroke + var hasPath = false; + if (style.brushType == 'fill' + || style.brushType == 'both' + || typeof style.brushType == 'undefined' // 默认为fill + ) { + ctx.beginPath(); + if (style.lineType == 'dashed' + || style.lineType == 'dotted' + ) { + // 特殊处理,虚线围不成path,实线再build一次 + this.buildPath( + ctx, + { + lineType: 'solid', + lineWidth: style.lineWidth, + pointList: style.pointList + } + ); + hasPath = false; // 这个path不能用 + } + else { + this.buildPath(ctx, style); + hasPath = true; // 这个path能用 + } + ctx.closePath(); + ctx.fill(); + } + + if (style.lineWidth > 0 + && (style.brushType == 'stroke' || style.brushType == 'both') + ) { + if (!hasPath) { + ctx.beginPath(); + this.buildPath(ctx, style); + } + ctx.stroke(); + } + + this.drawText(ctx, style, this.style); + + ctx.restore(); + + return; + }, + + /** + * 创建多边形路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Polygon~IPolygonStyle} style + */ + buildPath : function (ctx, style) { + // 虽然能重用brokenLine,但底层图形基于性能考虑,重复代码减少调用吧 + var pointList = style.pointList; + // 开始点和结束点重复 + /* + var start = pointList[0]; + var end = pointList[pointList.length-1]; + + if (start && end) { + if (start[0] == end[0] && + start[1] == end[1]) { + // 移除最后一个点 + pointList.pop(); + } + } + */ + + if (pointList.length < 2) { + // 少于2个点就不画了~ + return; + } + + if (style.smooth && style.smooth !== 'spline') { + var controlPoints = smoothBezier( + pointList, style.smooth, true, style.smoothConstraint + ); + + ctx.moveTo(pointList[0][0], pointList[0][1]); + var cp1; + var cp2; + var p; + var len = pointList.length; + for (var i = 0; i < len; i++) { + cp1 = controlPoints[i * 2]; + cp2 = controlPoints[i * 2 + 1]; + p = pointList[(i + 1) % len]; + ctx.bezierCurveTo( + cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1] + ); + } + } + else { + if (style.smooth === 'spline') { + pointList = smoothSpline(pointList, true); + } + + if (!style.lineType || style.lineType == 'solid') { + // 默认为实线 + ctx.moveTo(pointList[0][0], pointList[0][1]); + for (var i = 1, l = pointList.length; i < l; i++) { + ctx.lineTo(pointList[i][0], pointList[i][1]); + } + ctx.lineTo(pointList[0][0], pointList[0][1]); + } + else if (style.lineType == 'dashed' + || style.lineType == 'dotted' + ) { + var dashLength = + style._dashLength + || (style.lineWidth || 1) + * (style.lineType == 'dashed' ? 5 : 1); + style._dashLength = dashLength; + ctx.moveTo(pointList[0][0], pointList[0][1]); + for (var i = 1, l = pointList.length; i < l; i++) { + dashedLineTo( + ctx, + pointList[i - 1][0], pointList[i - 1][1], + pointList[i][0], pointList[i][1], + dashLength + ); + } + dashedLineTo( + ctx, + pointList[pointList.length - 1][0], + pointList[pointList.length - 1][1], + pointList[0][0], + pointList[0][1], + dashLength + ); + } + } + return; + }, + + /** + * 计算返回多边形包围盒矩阵 + * @param {module:zrender/shape/Polygon~IPolygonStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function (style) { + if (style.__rect) { + return style.__rect; + } + + var minX = Number.MAX_VALUE; + var maxX = Number.MIN_VALUE; + var minY = Number.MAX_VALUE; + var maxY = Number.MIN_VALUE; + + var pointList = style.pointList; + for (var i = 0, l = pointList.length; i < l; i++) { + if (pointList[i][0] < minX) { + minX = pointList[i][0]; + } + if (pointList[i][0] > maxX) { + maxX = pointList[i][0]; + } + if (pointList[i][1] < minY) { + minY = pointList[i][1]; + } + if (pointList[i][1] > maxY) { + maxY = pointList[i][1]; + } + } + + var lineWidth; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } + else { + lineWidth = 0; + } + + style.__rect = { + x : Math.round(minX - lineWidth / 2), + y : Math.round(minY - lineWidth / 2), + width : maxX - minX + lineWidth, + height : maxY - minY + lineWidth + }; + return style.__rect; + } + }; + + require('../tool/util').inherits(Polygon, Base); + return Polygon; + } +); + + +/** + * 折线 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @module zrender/shape/BrokenLine + * @example + * var BrokenLine = require('zrender/shape/BrokenLine'); + * var shape = new BrokenLine({ + * style: { + * pointList: [[0, 0], [100, 100], [100, 0]], + * smooth: 'bezier', + * strokeColor: 'purple' + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} IBrokenLineStyle + * @property {Array.} pointList 顶点坐标数组 + * @property {string} [smooth=''] 是否做平滑插值, 平滑算法可以选择 bezier, spline + * @property {number} [smoothConstraint] 平滑约束 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {string} [lineJoin='miter'] 线段连接样式,可以是 miter, round, bevel + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ +define( + 'zrender/shape/BrokenLine',['require','./Base','./util/smoothSpline','./util/smoothBezier','./util/dashedLineTo','./Polygon','../tool/util'],function (require) { + var Base = require('./Base'); + var smoothSpline = require('./util/smoothSpline'); + var smoothBezier = require('./util/smoothBezier'); + var dashedLineTo = require('./util/dashedLineTo'); + + /** + * @alias module:zrender/shape/BrokenLine + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var BrokenLine = function(options) { + this.brushTypeOnly = 'stroke'; // 线条只能描边,填充后果自负 + this.textPosition = 'end'; + Base.call(this, options); + /** + * 贝赛尔曲线绘制样式 + * @name module:zrender/shape/BrokenLine#style + * @type {module:zrender/shape/BrokenLine~IBrokenLineStyle} + */ + /** + * 贝赛尔曲线高亮绘制样式 + * @name module:zrender/shape/BrokenLine#highlightStyle + * @type {module:zrender/shape/BrokenLine~IBrokenLineStyle} + */ + }; + + BrokenLine.prototype = { + type: 'broken-line', + + /** + * 创建多边形路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/BrokenLine~IBrokenLineStyle} style + */ + buildPath : function(ctx, style) { + var pointList = style.pointList; + if (pointList.length < 2) { + // 少于2个点就不画了~ + return; + } + + var len = Math.min( + style.pointList.length, + Math.round(style.pointListLength || style.pointList.length) + ); + + if (style.smooth && style.smooth !== 'spline') { + var controlPoints = smoothBezier( + pointList, style.smooth, false, style.smoothConstraint + ); + + ctx.moveTo(pointList[0][0], pointList[0][1]); + var cp1; + var cp2; + var p; + for (var i = 0; i < len - 1; i++) { + cp1 = controlPoints[i * 2]; + cp2 = controlPoints[i * 2 + 1]; + p = pointList[i + 1]; + ctx.bezierCurveTo( + cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1] + ); + } + } + else { + if (style.smooth === 'spline') { + pointList = smoothSpline(pointList); + len = pointList.length; + } + if (!style.lineType || style.lineType == 'solid') { + // 默认为实线 + ctx.moveTo(pointList[0][0], pointList[0][1]); + for (var i = 1; i < len; i++) { + ctx.lineTo(pointList[i][0], pointList[i][1]); + } + } + else if (style.lineType == 'dashed' + || style.lineType == 'dotted' + ) { + var dashLength = (style.lineWidth || 1) + * (style.lineType == 'dashed' ? 5 : 1); + ctx.moveTo(pointList[0][0], pointList[0][1]); + for (var i = 1; i < len; i++) { + dashedLineTo( + ctx, + pointList[i - 1][0], pointList[i - 1][1], + pointList[i][0], pointList[i][1], + dashLength + ); + } + } + } + return; + }, + + /** + * 计算返回折线包围盒矩形。 + * @param {IZRenderBezierCurveStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function(style) { + return require('./Polygon').prototype.getRect(style); + } + }; + + require('../tool/util').inherits(BrokenLine, Base); + return BrokenLine; + } +); + +/** + * zrender + * + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + * shape类:标线 + */ +define('echarts/util/shape/MarkLine',['require','zrender/shape/Base','./Icon','zrender/shape/Line','zrender/shape/BrokenLine','zrender/tool/matrix','zrender/tool/area','zrender/shape/util/dashedLineTo','zrender/shape/util/smoothSpline','zrender/tool/util'],function (require) { + var Base = require('zrender/shape/Base'); + var IconShape = require('./Icon'); + var LineShape = require('zrender/shape/Line'); + var lineInstance = new LineShape({}); + var BrokenLineShape = require('zrender/shape/BrokenLine'); + var brokenLineInstance = new BrokenLineShape({}); + + var matrix = require('zrender/tool/matrix'); + var area = require('zrender/tool/area'); + var dashedLineTo = require('zrender/shape/util/dashedLineTo'); + var smoothSpline = require('zrender/shape/util/smoothSpline'); + var zrUtil = require('zrender/tool/util'); + + + function MarkLine(options) { + Base.call(this, options); + } + + MarkLine.prototype = { + type : 'mark-line', + /** + * 画刷 + * @param ctx 画布句柄 + * @param e 形状实体 + * @param isHighlight 是否为高亮状态 + * @param updateCallback 需要异步加载资源的shape可以通过这个callback(e) + * 让painter更新视图,base.brush没用,需要的话重载brush + */ + brush : function (ctx, isHighlight) { + var style = this.style; + + if (isHighlight) { + // 根据style扩展默认高亮样式 + style = this.getHighlightStyle( + style, + this.highlightStyle || {} + ); + } + + ctx.save(); + this.setContext(ctx, style); + + // 设置transform + this.setTransform(ctx); + + ctx.save(); + ctx.beginPath(); + this.buildLinePath(ctx, style); + ctx.stroke(); + ctx.restore(); + + this.brushSymbol(ctx, style, 0); + this.brushSymbol(ctx, style, 1); + + this.drawText(ctx, style, this.style); + + ctx.restore(); + }, + + /** + * 创建线条路径 + * @param {Context2D} ctx Canvas 2D上下文 + * @param {Object} style 样式 + */ + buildLinePath : function (ctx, style) { + var pointList = style.pointList || this.getPointList(style); + style.pointList = pointList; + + var len = Math.min( + style.pointList.length, + Math.round(style.pointListLength || style.pointList.length) + ); + + if (!style.lineType || style.lineType == 'solid') { + //默认为实线 + ctx.moveTo(pointList[0][0],pointList[0][1]); + for (var i = 1; i < len; i++) { + ctx.lineTo(pointList[i][0],pointList[i][1]); + } + } + else if (style.lineType == 'dashed' + || style.lineType == 'dotted' + ) { + if (style.smooth !== 'spline') { + // 直线 + var dashLength = (style.lineWidth || 1) + * (style.lineType == 'dashed' ? 5 : 1); + ctx.moveTo(pointList[0][0],pointList[0][1]); + for (var i = 1; i < len; i++) { + dashedLineTo( + ctx, + pointList[i - 1][0], pointList[i - 1][1], + pointList[i][0], pointList[i][1], + dashLength + ); + } + } + else { + // 曲线 + for (var i = 1; i < len; i += 2) { + ctx.moveTo(pointList[i - 1][0],pointList[i - 1][1]); + ctx.lineTo(pointList[i][0],pointList[i][1]); + } + } + } + }, + + /** + * 标线始末标注 + */ + brushSymbol : function (ctx, style, idx) { + if (style.symbol[idx] == 'none') { + return; + } + ctx.save(); + ctx.beginPath(); + + ctx.lineWidth = style.symbolBorder; + ctx.strokeStyle = style.symbolBorderColor; + // symbol + style.iconType = style.symbol[idx].replace('empty', '') + .toLowerCase(); + if (style.symbol[idx].match('empty')) { + ctx.fillStyle = '#fff'; //'rgba(0, 0, 0, 0)'; + } + + // symbolRotate + var len = Math.min( + style.pointList.length, + Math.round(style.pointListLength || style.pointList.length) + ); + var x = idx === 0 ? style.pointList[0][0] : style.pointList[len - 1][0]; + var y = idx === 0 ? style.pointList[0][1] : style.pointList[len - 1][1]; + var rotate = typeof style.symbolRotate[idx] != 'undefined' + ? (style.symbolRotate[idx] - 0) : 0; + var transform; + if (rotate !== 0) { + transform = matrix.create(); + matrix.identity(transform); + if (x || y ) { + matrix.translate(transform, transform, [-x, -y]); + } + matrix.rotate( + transform, transform, + rotate * Math.PI / 180 + ); + if (x || y ) { + matrix.translate(transform, transform, [x, y]); + } + ctx.transform.apply(ctx, transform); + } + + if (style.iconType == 'arrow' && rotate === 0) { + // 箭头自动旋转,手动画 + this.buildArrawPath(ctx, style, idx); + } + else { + // symbolSize + var symbolSize = style.symbolSize[idx]; + style.x = x - symbolSize; + style.y = y - symbolSize, + style.width = symbolSize * 2; + style.height = symbolSize * 2; + IconShape.prototype.buildPath(ctx, style); + } + + ctx.closePath(); + ctx.fill(); + ctx.stroke(); + ctx.restore(); + }, + + buildArrawPath : function (ctx, style, idx) { + var len = Math.min( + style.pointList.length, + Math.round(style.pointListLength || style.pointList.length) + ); + var symbolSize = style.symbolSize[idx] * 2; + var xStart = style.pointList[0][0]; + var xEnd = style.pointList[len - 1][0]; + var yStart = style.pointList[0][1]; + var yEnd = style.pointList[len - 1][1]; + var delta = 0; + if (style.smooth === 'spline') { + delta = 0.2; // 偏移0.2弧度 + } + // 原谅我吧,这三角函数实在没想明白,只能这么笨了 + var rotate = Math.atan( + Math.abs((yEnd - yStart) / (xStart - xEnd) + )); + if (idx === 0) { + if (xEnd > xStart) { + if (yEnd > yStart) { + rotate = Math.PI * 2 - rotate + delta; + } + else { + rotate += delta; + } + } + else { + if (yEnd > yStart) { + rotate += Math.PI - delta; + } + else { + rotate = Math.PI - rotate - delta; + } + } + } + else { + if (xStart > xEnd) { + if (yStart > yEnd) { + rotate = Math.PI * 2 - rotate + delta; + } + else { + rotate += delta; + } + } + else { + if (yStart > yEnd) { + rotate += Math.PI - delta; + } + else { + rotate = Math.PI - rotate - delta; + } + } + } + + var halfRotate = Math.PI / 8; // 夹角 + var x = idx === 0 ? xStart : xEnd; + var y = idx === 0 ? yStart : yEnd; + var point= [ + [ + x + symbolSize * Math.cos(rotate - halfRotate), + y - symbolSize * Math.sin(rotate - halfRotate) + ], + [ + x + symbolSize * 0.6 * Math.cos(rotate), + y - symbolSize * 0.6 * Math.sin(rotate) + ], + [ + x + symbolSize * Math.cos(rotate + halfRotate), + y - symbolSize * Math.sin(rotate + halfRotate) + ] + ]; + ctx.moveTo(x, y); + for (var i = 0, l = point.length; i = rect.x + && x <= (rect.x + rect.width) + && y >= rect.y + && y <= (rect.y + rect.height) + ) { + // 矩形内 + return this.style.smooth !== 'spline' + ? area.isInside(lineInstance, this.style, x, y) + : area.isInside(brokenLineInstance, this.style, x, y); + } + + return false; + } + }; + + zrUtil.inherits(MarkLine, Base); + + return MarkLine; +}); + +// 由于大多数shape默认的isCover都是相同的逻辑 +// 所以在echarts里临时抽象一个module,用于isCover method +// TODO: 对zrender的isCover和getRect方法进行抽象,重新整理该逻辑 + +define('echarts/util/shape/normalIsCover',[],function () { + return function (x, y) { + var originPos = this.getTansform(x, y); + x = originPos[0]; + y = originPos[1]; + + // 快速预判并保留判断矩形 + var rect = this.style.__rect; + if (!rect) { + rect = this.style.__rect = this.getRect(this.style); + } + + return x >= rect.x + && x <= (rect.x + rect.width) + && y >= rect.y + && y <= (rect.y + rect.height); + }; +}); + +/** + * zrender + * + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + * shape类:大规模散点图图形 + * 可配图形属性: + { + // 基础属性 + shape : 'symbol', // 必须,shape类标识,需要显式指定 + id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 + zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 + invisible : {boolean}, // 默认为false,是否可见 + + // 样式属性,默认状态样式样式属性 + style : { + pointList : {Array}, // 必须,二维数组,二维内容如下 + x : {number}, // 必须,横坐标 + y : {number}, // 必须,纵坐标数组 + size : {number}, // 必须,半宽 + type : {string=}, // 默认为'circle',图形类型 + }, + + // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 + highlightStyle : { + // 同style + } + + // 交互属性,详见shape.Base + + // 事件属性,详见shape.Base + } + */ +define('echarts/util/shape/Symbol',['require','zrender/shape/Base','zrender/shape/Polygon','zrender/tool/util','./normalIsCover'],function (require) { + var Base = require('zrender/shape/Base'); + var PolygonShape = require('zrender/shape/Polygon'); + var polygonInstance = new PolygonShape({}); + var zrUtil = require('zrender/tool/util'); + + function Symbol(options) { + Base.call(this, options); + } + + Symbol.prototype = { + type : 'symbol', + /** + * 创建矩形路径 + * @param {Context2D} ctx Canvas 2D上下文 + * @param {Object} style 样式 + */ + buildPath : function (ctx, style) { + var pointList = style.pointList; + var len = pointList.length; + if (len === 0) { + return; + } + + var subSize = 10000; + var subSetLength = Math.ceil(len / subSize); + var sub; + var subLen; + var isArray = pointList[0] instanceof Array; + var size = style.size ? style.size : 2; + var curSize = size; + var halfSize = size / 2; + var PI2 = Math.PI * 2; + var percent; + var x; + var y; + for (var j = 0; j < subSetLength; j++) { + ctx.beginPath(); + sub = j * subSize; + subLen = sub + subSize; + subLen = subLen > len ? len : subLen; + for (var i = sub; i < subLen; i++) { + if (style.random) { + percent = style['randomMap' + (i % 20)] / 100; + curSize = size * percent * percent; + halfSize = curSize / 2; + } + if (isArray) { + x = pointList[i][0]; + y = pointList[i][1]; + } + else { + x = pointList[i].x; + y = pointList[i].y; + } + if (curSize < 3) { + // 小于3像素视觉误差 + ctx.rect(x - halfSize, y - halfSize, curSize, curSize); + } + else { + // 大于3像素才考虑图形 + switch (style.iconType) { + case 'circle' : + ctx.moveTo(x, y); + ctx.arc(x, y, halfSize, 0, PI2, true); + break; + case 'diamond' : + ctx.moveTo(x, y - halfSize); + ctx.lineTo(x + halfSize / 3, y - halfSize / 3); + ctx.lineTo(x + halfSize, y); + ctx.lineTo(x + halfSize / 3, y + halfSize / 3); + ctx.lineTo(x, y + halfSize); + ctx.lineTo(x - halfSize / 3, y + halfSize / 3); + ctx.lineTo(x - halfSize, y); + ctx.lineTo(x - halfSize / 3, y - halfSize / 3); + ctx.lineTo(x, y - halfSize); + break; + default : + ctx.rect(x - halfSize, y - halfSize, curSize, curSize); + } + } + } + ctx.closePath(); + if (j < (subSetLength - 1)) { + switch (style.brushType) { + case 'both': + ctx.fill(); + style.lineWidth > 0 && ctx.stroke(); // js hint -_-" + break; + case 'stroke': + style.lineWidth > 0 && ctx.stroke(); + break; + default: + ctx.fill(); + } + } + } + }, + + /* 像素模式 + buildPath : function (ctx, style) { + var pointList = style.pointList; + var rect = this.getRect(style); + var ratio = window.devicePixelRatio || 1; + // console.log(rect) + // var ti = new Date(); + // bbox取整 + rect = { + x : Math.floor(rect.x), + y : Math.floor(rect.y), + width : Math.floor(rect.width), + height : Math.floor(rect.height) + }; + var pixels = ctx.getImageData( + rect.x * ratio, rect.y * ratio, + rect.width * ratio, rect.height * ratio + ); + var data = pixels.data; + var idx; + var zrColor = require('zrender/tool/color'); + var color = zrColor.toArray(style.color); + var r = color[0]; + var g = color[1]; + var b = color[2]; + var width = rect.width; + + for (var i = 1, l = pointList.length; i < l; i++) { + idx = ((Math.floor(pointList[i][0]) - rect.x) * ratio + + (Math.floor(pointList[i][1])- rect.y) * width * ratio * ratio + ) * 4; + data[idx] = r; + data[idx + 1] = g; + data[idx + 2] = b; + data[idx + 3] = 255; + } + ctx.putImageData(pixels, rect.x * ratio, rect.y * ratio); + // console.log(new Date() - ti); + return; + }, + */ + + /** + * 返回矩形区域,用于局部刷新和文字定位 + * @param {Object} style + */ + getRect : function (style) { + return style.__rect || polygonInstance.getRect(style); + }, + + isCover : require('./normalIsCover') + }; + + zrUtil.inherits(Symbol, Base); + + return Symbol; +}); + +/** + * echarts通用私有数据服务 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/util/ecData',[],function() { + /** + * 打包私有数据 + * + * @param {shape} shape 修改目标 + * @param {Object} series + * @param {number} seriesIndex + * @param {number | Object} data + * @param {number} dataIndex + * @param {*=} special + * @param {*=} special2 + */ + function pack( + shape, series, seriesIndex, data, dataIndex, name, special, special2 + ) { + var value; + if (typeof data != 'undefined') { + value = data.value == null + ? data + : data.value; + } + + shape._echartsData = { + '_series' : series, + '_seriesIndex' : seriesIndex, + '_data' : data, + '_dataIndex' : dataIndex, + '_name' : name, + '_value' : value, + '_special' : special, + '_special2' : special2 + }; + return shape._echartsData; + } + + /** + * 从私有数据中获取特定项 + * @param {shape} shape + * @param {string} key + */ + function get(shape, key) { + var data = shape._echartsData; + if (!key) { + return data; + } + + switch (key) { + case 'series' : + case 'seriesIndex' : + case 'data' : + case 'dataIndex' : + case 'name' : + case 'value' : + case 'special' : + case 'special2' : + return data && data['_' + key]; + } + + return null; + } + + /** + * 修改私有数据中获取特定项 + * @param {shape} shape + * @param {string} key + * @param {*} value + */ + function set(shape, key, value) { + shape._echartsData = shape._echartsData || {}; + switch (key) { + case 'series' : // 当前系列值 + case 'seriesIndex' : // 系列数组位置索引 + case 'data' : // 当前数据值 + case 'dataIndex' : // 数据数组位置索引 + case 'name' : + case 'value' : + case 'special' : + case 'special2' : + shape._echartsData['_' + key] = value; + break; + } + } + + /** + * 私有数据克隆,把source拷贝到target上 + * @param {shape} source 源 + * @param {shape} target 目标 + */ + function clone(source, target) { + target._echartsData = { + '_series' : source._echartsData._series, + '_seriesIndex' : source._echartsData._seriesIndex, + '_data' : source._echartsData._data, + '_dataIndex' : source._echartsData._dataIndex, + '_name' : source._echartsData._name, + '_value' : source._echartsData._value, + '_special' : source._echartsData._special, + '_special2' : source._echartsData._special2 + }; + } + + return { + pack : pack, + set : set, + get : get, + clone : clone + }; +}); +/** + * echarts图表动画基类 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/util/ecAnimation',['require','zrender/tool/util','zrender/shape/Polygon'],function (require) { + var zrUtil = require('zrender/tool/util'); + + /** + * 折线型动画 + * + * @param {ZRender} zr + * @param {shape} oldShape + * @param {shape} newShape + * @param {number} duration + * @param {tring} easing + */ + function pointList(zr, oldShape, newShape, duration, easing) { + var newPointList = newShape.style.pointList; + var newPointListLen = newPointList.length; + var oldPointList; + + if (!oldShape) { // add + oldPointList = []; + if (newShape._orient != 'vertical') { + var y = newPointList[0][1]; + for (var i = 0; i < newPointListLen; i++) { + oldPointList[i] = [newPointList[i][0], y]; + } + } + else { + var x = newPointList[0][0]; + for (var i = 0; i < newPointListLen; i++) { + oldPointList[i] = [x, newPointList[i][1]]; + } + } + + if (newShape.type == 'half-smooth-polygon') { + oldPointList[newPointListLen - 1] = zrUtil.clone(newPointList[newPointListLen - 1]); + oldPointList[newPointListLen - 2] = zrUtil.clone(newPointList[newPointListLen - 2]); + } + oldShape = {style : {pointList : oldPointList}}; + } + + oldPointList = oldShape.style.pointList; + var oldPointListLen = oldPointList.length; + if (oldPointListLen == newPointListLen) { + newShape.style.pointList = oldPointList; + } + else if (oldPointListLen < newPointListLen) { + // 原来短,新的长,补全 + newShape.style.pointList = oldPointList.concat(newPointList.slice(oldPointListLen)); + } + else { + // 原来长,新的短,截断 + newShape.style.pointList = oldPointList.slice(0, newPointListLen); + } + + zr.addShape(newShape); + zr.animate(newShape.id, 'style') + .when( + duration, + { pointList: newPointList } + ) + .start(easing); + } + + /** + * 复制样式 + * + * @inner + * @param {Object} target 目标对象 + * @param {Object} source 源对象 + * @param {...string} props 复制的属性列表 + */ + function cloneStyle(target, source) { + var len = arguments.length; + for (var i = 2; i < len; i++) { + var prop = arguments[i]; + target.style[prop] = source.style[prop]; + } + } + + /** + * 方型动画 + * + * @param {ZRender} zr + * @param {shape} oldShape + * @param {shape} newShape + * @param {number} duration + * @param {tring} easing + */ + function rectangle(zr, oldShape, newShape, duration, easing) { + var newShapeStyle = newShape.style; + if (!oldShape) { // add + oldShape = { + style : { + x : newShapeStyle.x, + y : newShape._orient == 'vertical' + ? newShapeStyle.y + newShapeStyle.height + : newShapeStyle.y, + width: newShape._orient == 'vertical' + ? newShapeStyle.width : 0, + height: newShape._orient != 'vertical' + ? newShapeStyle.height : 0 + } + }; + } + + var newX = newShapeStyle.x; + var newY = newShapeStyle.y; + var newWidth = newShapeStyle.width; + var newHeight = newShapeStyle.height; + cloneStyle( + newShape, oldShape, + 'x', 'y', 'width', 'height' + ); + + zr.addShape(newShape); + zr.animate(newShape.id, 'style') + .when( + duration, + { + x: newX, + y: newY, + width: newWidth, + height: newHeight + } + ) + .start(easing); + } + + /** + * 蜡烛动画 + * + * @param {ZRender} zr + * @param {shape} oldShape + * @param {shape} newShape + * @param {number} duration + * @param {tring} easing + */ + function candle(zr, oldShape, newShape, duration, easing) { + if (!oldShape) { // add + var y = newShape.style.y; + oldShape = {style : {y : [y[0], y[0], y[0], y[0]]}}; + } + + var newY = newShape.style.y; + newShape.style.y = oldShape.style.y; + zr.addShape(newShape); + zr.animate(newShape.id, 'style') + .when( + duration, + { y: newY } + ) + .start(easing); + } + + /** + * 环型动画 + * + * @param {ZRender} zr + * @param {shape} oldShape + * @param {shape} newShape + * @param {number} duration + * @param {tring} easing + */ + function ring(zr, oldShape, newShape, duration, easing) { + var x = newShape.style.x; + var y = newShape.style.y; + var r0 = newShape.style.r0; + var r = newShape.style.r; + + if (newShape._animationAdd != 'r') { + newShape.style.r0 = 0; + newShape.style.r = 0; + newShape.rotation = [Math.PI*2, x, y]; + + zr.addShape(newShape); + zr.animate(newShape.id, 'style') + .when( + duration, + { + r0 : r0, + r : r + } + ) + .start(easing); + zr.animate(newShape.id, '') + .when( + Math.round(duration / 3 * 2), + { rotation : [0, x, y] } + ) + .start(easing); + } + else { + newShape.style.r0 = newShape.style.r; + + zr.addShape(newShape); + zr.animate(newShape.id, 'style') + .when( + duration, + { + r0 : r0 + } + ) + .start(easing); + } + } + + /** + * 扇形动画 + * + * @param {ZRender} zr + * @param {shape} oldShape + * @param {shape} newShape + * @param {number} duration + * @param {tring} easing + */ + function sector(zr, oldShape, newShape, duration, easing) { + if (!oldShape) { // add + if (newShape._animationAdd != 'r') { + oldShape = { + style : { + startAngle : newShape.style.startAngle, + endAngle : newShape.style.startAngle + } + }; + } + else { + oldShape = {style : {r0 : newShape.style.r}}; + } + } + + var startAngle = newShape.style.startAngle; + var endAngle = newShape.style.endAngle; + + cloneStyle( + newShape, oldShape, + 'startAngle', 'endAngle' + ); + + zr.addShape(newShape); + zr.animate(newShape.id, 'style') + .when( + duration, + { + startAngle : startAngle, + endAngle : endAngle + } + ) + .start(easing); + } + + /** + * 文本动画 + * + * @param {ZRender} zr + * @param {shape} oldShape + * @param {shape} newShape + * @param {number} duration + * @param {tring} easing + */ + function text(zr, oldShape, newShape, duration, easing) { + if (!oldShape) { // add + oldShape = { + style : { + x : newShape.style.textAlign == 'left' + ? newShape.style.x + 100 + : newShape.style.x - 100, + y : newShape.style.y + } + }; + } + + var x = newShape.style.x; + var y = newShape.style.y; + + cloneStyle( + newShape, oldShape, + 'x', 'y' + ); + + zr.addShape(newShape); + zr.animate(newShape.id, 'style') + .when( + duration, + { + x : x, + y : y + } + ) + .start(easing); + } + + /** + * 多边形动画 + * + * @param {ZRender} zr + * @param {shape} oldShape + * @param {shape} newShape + * @param {number} duration + * @param {tring} easing + */ + function polygon(zr, oldShape, newShape, duration, easing) { + var rect = require('zrender/shape/Polygon').prototype.getRect(newShape.style); + var x = rect.x + rect.width / 2; + var y = rect.y + rect.height / 2; + + newShape.scale = [0.1, 0.1, x, y]; + zr.addShape(newShape); + zr.animate(newShape.id, '') + .when( + duration, + { + scale : [1, 1, x, y] + } + ) + .start(easing); + } + + /** + * 和弦动画 + * + * @param {ZRender} zr + * @param {shape} oldShape + * @param {shape} newShape + * @param {number} duration + * @param {tring} easing + */ + function chord(zr, oldShape, newShape, duration, easing) { + if (!oldShape) { // add + oldShape = { + style : { + source0 : 0, + source1 : 360, + target0 : 0, + target1 : 360 + } + }; + } + + var source0 = newShape.style.source0; + var source1 = newShape.style.source1; + var target0 = newShape.style.target0; + var target1 = newShape.style.target1; + + if (oldShape.style) { + cloneStyle( + newShape, oldShape, + 'source0', 'source1', 'target0', 'target1' + ); + } + + zr.addShape(newShape); + zr.animate(newShape.id, 'style') + .when( + duration, + { + source0 : source0, + source1 : source1, + target0 : target0, + target1 : target1 + } + ) + .start(easing); + } + + /** + * gaugePointer动画 + * + * @param {ZRender} zr + * @param {shape} oldShape + * @param {shape} newShape + * @param {number} duration + * @param {tring} easing + */ + function gaugePointer(zr, oldShape, newShape, duration, easing) { + if (!oldShape) { // add + oldShape = { + style : { + angle : newShape.style.startAngle + } + }; + } + + var angle = newShape.style.angle; + newShape.style.angle = oldShape.style.angle; + zr.addShape(newShape); + zr.animate(newShape.id, 'style') + .when( + duration, + { + angle : angle + } + ) + .start(easing); + } + + /** + * icon动画 + * + * @param {ZRender} zr + * @param {shape} oldShape + * @param {shape} newShape + * @param {number} duration + * @param {tring} easing + */ + function icon(zr, oldShape, newShape, duration, easing) { + // 避免markPoint特效取值在动画帧上 + newShape.style._x = newShape.style.x; + newShape.style._y = newShape.style.y; + newShape.style._width = newShape.style.width; + newShape.style._height = newShape.style.height; + + if (!oldShape) { // add + var x = newShape._x || 0; + var y = newShape._y || 0; + newShape.scale = [0, 0, x, y]; + zr.addShape(newShape); + zr.animate(newShape.id, '') + .when( + duration, + {scale : [1, 1, x, y]} + ) + .start(easing || 'QuinticOut'); + } + else { // mod + rectangle(zr, oldShape, newShape, duration, easing); + } + } + + /** + * line动画 + * + * @param {ZRender} zr + * @param {shape} oldShape + * @param {shape} newShape + * @param {number} duration + * @param {tring} easing + */ + function line(zr, oldShape, newShape, duration, easing) { + if (!oldShape) { + oldShape = { + style : { + xEnd : newShape.style.xStart, + yEnd : newShape.style.yStart + } + }; + } + + var xStart = newShape.style.xStart; + var xEnd = newShape.style.xEnd; + var yStart = newShape.style.yStart; + var yEnd = newShape.style.yEnd; + + cloneStyle( + newShape, oldShape, + 'xStart', 'xEnd', 'yStart', 'yEnd' + ); + + zr.addShape(newShape); + zr.animate(newShape.id, 'style') + .when( + duration, + { + xStart: xStart, + xEnd: xEnd, + yStart: yStart, + yEnd: yEnd + } + ) + .start(easing); + } + + /** + * markline动画 + * + * @param {ZRender} zr + * @param {shape} oldShape + * @param {shape} newShape + * @param {number} duration + * @param {tring} easing + */ + function markline(zr, oldShape, newShape, duration, easing) { + if (!newShape.style.smooth) { + newShape.style.pointList = !oldShape + ? [ + [newShape.style.xStart, newShape.style.yStart], + [newShape.style.xStart, newShape.style.yStart] + ] + : oldShape.style.pointList; + zr.addShape(newShape); + zr.animate(newShape.id, 'style') + .when( + duration, + { + pointList : [ + [ + newShape.style.xStart, + newShape.style.yStart + ], + [ + newShape._x || 0, newShape._y || 0 + ] + ] + } + ) + .start(easing || 'QuinticOut'); + } + else { + // 曲线动画 + newShape.style.pointListLength = 1; + zr.addShape(newShape); + newShape.style.pointList = newShape.style.pointList + || newShape.getPointList(newShape.style); + zr.animate(newShape.id, 'style') + .when( + duration, + { + pointListLength : newShape.style.pointList.length + } + ) + .start(easing || 'QuinticOut'); + } + } + + return { + pointList : pointList, + rectangle : rectangle, + candle : candle, + ring : ring, + sector : sector, + text : text, + polygon : polygon, + chord : chord, + gaugePointer : gaugePointer, + icon : icon, + line : line, + markline : markline + }; +}); + +/** + * 圆形 + * @module zrender/shape/Circle + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @example + * var Circle = require('zrender/shape/Circle'); + * var shape = new Circle({ + * style: { + * x: 100, + * y: 100, + * r: 40, + * brushType: 'both', + * color: 'blue', + * strokeColor: 'red', + * lineWidth: 3, + * text: 'Circle' + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} ICircleStyle + * @property {number} x 圆心x坐标 + * @property {number} y 圆心y坐标 + * @property {number} r 半径 + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ +define( + 'zrender/shape/Circle',['require','./Base','../tool/util'],function (require) { + + + var Base = require('./Base'); + + /** + * @alias module:zrender/shape/Circle + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var Circle = function(options) { + Base.call(this, options); + /** + * 圆形绘制样式 + * @name module:zrender/shape/Circle#style + * @type {module:zrender/shape/Circle~ICircleStyle} + */ + /** + * 圆形高亮绘制样式 + * @name module:zrender/shape/Circle#highlightStyle + * @type {module:zrender/shape/Circle~ICircleStyle} + */ + }; + + Circle.prototype = { + type: 'circle', + /** + * 创建圆形路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Circle~ICircleStyle} style + */ + buildPath : function (ctx, style) { + ctx.arc(style.x, style.y, style.r, 0, Math.PI * 2, true); + return; + }, + + /** + * 计算返回圆形的包围盒矩形 + * @param {module:zrender/shape/Circle~ICircleStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function (style) { + if (style.__rect) { + return style.__rect; + } + + var lineWidth; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } + else { + lineWidth = 0; + } + style.__rect = { + x : Math.round(style.x - style.r - lineWidth / 2), + y : Math.round(style.y - style.r - lineWidth / 2), + width : style.r * 2 + lineWidth, + height : style.r * 2 + lineWidth + }; + + return style.__rect; + } + }; + + require('../tool/util').inherits(Circle, Base); + return Circle; + } +); + +/** + * echarts图表特效基类 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/util/ecEffect',['require','../util/ecData','zrender/shape/Circle','zrender/shape/Image','../util/shape/Icon','../util/shape/Symbol','zrender/tool/env'],function (require) { + var ecData = require('../util/ecData'); + + var CircleShape = require('zrender/shape/Circle'); + var ImageShape = require('zrender/shape/Image'); + var IconShape = require('../util/shape/Icon'); + var SymbolShape = require('../util/shape/Symbol'); + + var canvasSupported = require('zrender/tool/env').canvasSupported; + + function point(zr, effectList, shape, zlevel) { + var effect = shape.effect; + var color = effect.color || shape.style.strokeColor || shape.style.color; + var shadowColor = effect.shadowColor || color; + var size = effect.scaleSize; + var shadowBlur = typeof effect.shadowBlur != 'undefined' + ? effect.shadowBlur : size; + + var effectShape = new IconShape({ + zlevel : zlevel, + style : { + brushType : 'stroke', + iconType : (shape.style.iconType != 'pin' + && shape.style.iconType != 'droplet') + ? shape.style.iconType + : 'circle', + x : shadowBlur + 1, // 线宽 + y : shadowBlur + 1, + n : shape.style.n, + width : shape.style.width * size, + height : shape.style.height * size, + lineWidth : 1, + strokeColor : color, + shadowColor : shadowColor, + shadowBlur : shadowBlur + }, + draggable : false, + hoverable : false + }); + + if (canvasSupported) { // 提高性能,换成image + effectShape.style.image = zr.shapeToImage( + effectShape, + effectShape.style.width + shadowBlur * 2 + 2, + effectShape.style.height + shadowBlur * 2 + 2 + ).style.image; + + effectShape = new ImageShape({ + zlevel : effectShape.zlevel, + style : effectShape.style, + draggable : false, + hoverable : false + }); + } + + ecData.clone(shape, effectShape); + + // 改变坐标,不能移到前面 + effectShape.position = shape.position; + effectList.push(effectShape); + zr.addShape(effectShape); + + var devicePixelRatio = window.devicePixelRatio || 1; + var offset = (effectShape.style.width / devicePixelRatio - shape.style.width) / 2; + effectShape.style.x = shape.style._x - offset; + effectShape.style.y = shape.style._y - offset; + var duration = (effect.period + Math.random() * 10) * 100; + + zr.modShape( + shape.id, + { invisible : true} + ); + + var centerX = effectShape.style.x + (effectShape.style.width) / 2 / devicePixelRatio; + var centerY = effectShape.style.y + (effectShape.style.height) / 2 / devicePixelRatio; + zr.modShape( + effectShape.id, + { + scale : [0.1, 0.1, centerX, centerY] + } + ); + + zr.animate(effectShape.id, '', effect.loop) + .when( + duration, + { + scale : [1, 1, centerX, centerY] + } + ) + .done(function() { + shape.effect.show = false; + zr.delShape(effectShape.id); + }) + .start(); + } + + function largePoint(zr, effectList, shape, zlevel) { + var effect = shape.effect; + var color = effect.color || shape.style.strokeColor || shape.style.color; + var size = effect.scaleSize; + var shadowColor = effect.shadowColor || color; + var shadowBlur = typeof effect.shadowBlur != 'undefined' + ? effect.shadowBlur : (size * 2); + var devicePixelRatio = window.devicePixelRatio || 1; + var effectShape = new SymbolShape({ + zlevel : zlevel, + position : shape.position, + scale : shape.scale, + style : { + pointList : shape.style.pointList, + iconType : shape.style.iconType, + color : color, + strokeColor : color, + shadowColor : shadowColor, + shadowBlur : shadowBlur * devicePixelRatio, + random : true, + brushType: 'fill', + lineWidth:1, + size : shape.style.size + }, + draggable : false, + hoverable : false + }); + + effectList.push(effectShape); + zr.addShape(effectShape); + zr.modShape( + shape.id, + { invisible : true} + ); + + var duration = Math.round(effect.period * 100); + var clip1 = {}; + var clip2 = {}; + for (var i = 0; i < 20; i++) { + effectShape.style['randomMap' + i] = 0; + clip1 = {}; + clip1['randomMap' + i] = 100; + clip2 = {}; + clip2['randomMap' + i] = 0; + effectShape.style['randomMap' + i] = Math.random() * 100; + zr.animate(effectShape.id, 'style', true) + .when(duration, clip1) + .when(duration * 2, clip2) + .when(duration * 3, clip1) + .when(duration * 4, clip1) + .delay(Math.random() * duration * i) + //.delay(duration / 15 * (15 - i + 1)) + .start(); + + } + } + + function line(zr, effectList, shape, zlevel) { + var effect = shape.effect; + var color = effect.color || shape.style.strokeColor || shape.style.color; + var shadowColor = effect.shadowColor || shape.style.strokeColor || color; + var size = shape.style.lineWidth * effect.scaleSize; + var shadowBlur = typeof effect.shadowBlur != 'undefined' + ? effect.shadowBlur : size; + + var effectShape = new CircleShape({ + zlevel : zlevel, + style : { + x : shadowBlur, + y : shadowBlur, + r : size, + color : color, + shadowColor : shadowColor, + shadowBlur : shadowBlur + }, + draggable : false, + hoverable : false + }); + + var offset; + if (canvasSupported) { // 提高性能,换成image + effectShape.style.image = zr.shapeToImage( + effectShape, + (size + shadowBlur) * 2, + (size + shadowBlur) * 2 + ).style.image; + effectShape = new ImageShape({ + zlevel : effectShape.zlevel, + style : effectShape.style, + draggable : false, + hoverable : false + }); + offset = shadowBlur; + } + else { + offset = 0; + } + + ecData.clone(shape, effectShape); + + // 改变坐标, 不能移到前面 + effectShape.position = shape.position; + effectList.push(effectShape); + zr.addShape(effectShape); + + effectShape.style.x = shape.style.xStart - offset; + effectShape.style.y = shape.style.yStart - offset; + var distance = (shape.style.xStart - shape.style.xEnd) + * (shape.style.xStart - shape.style.xEnd) + + + (shape.style.yStart - shape.style.yEnd) + * (shape.style.yStart - shape.style.yEnd); + var duration = Math.round(Math.sqrt(Math.round( + distance * effect.period * effect.period + ))); + if (!shape.style.smooth) { + // 直线 + zr.animate(effectShape.id, 'style', effect.loop) + .when( + duration, + { + x : shape._x - offset, + y : shape._y - offset + } + ) + .done(function() { + shape.effect.show = false; + zr.delShape(effectShape.id); + }) + .start(); + } + else { + // 曲线 + var pointList = shape.style.pointList || shape.getPointList(shape.style); + var len = pointList.length; + duration = Math.round(duration / len); + var deferred = zr.animate(effectShape.id, 'style', effect.loop); + var step = Math.ceil(len / 8); + for (var j = 0; j < len - step; j+= step) { + deferred.when( + duration * (j + 1), + { + x : pointList[j][0] - offset, + y : pointList[j][1] - offset + } + ); + } + deferred.when( + duration * len, + { + x : pointList[len - 1][0] - offset, + y : pointList[len - 1][1] - offset + } + ); + deferred.done(function() { + shape.effect.show = false; + zr.delShape(effectShape.id); + }); + deferred.start('spline'); + } + } + + return { + point : point, + largePoint : largePoint, + line : line + }; +}); + +/** + * 高精度数学运算 + */ +define('echarts/util/accMath',[],function() { + // 除法函数,用来得到精确的除法结果 + // 说明:javascript的除法结果会有误差,在两个浮点数相除的时候会比较明显。这个函数返回较为精确的除法结果。 + // 调用:accDiv(arg1,arg2) + // 返回值:arg1除以arg2的精确结果 + function accDiv(arg1,arg2){ + var s1 = arg1.toString(); + var s2 = arg2.toString(); + var m = 0; + try { + m = s2.split('.')[1].length; + } + catch(e) {} + try { + m -= s1.split('.')[1].length; + } + catch(e) {} + + return (s1.replace('.', '') - 0) / (s2.replace('.', '') - 0) * Math.pow(10, m); + } + + // 乘法函数,用来得到精确的乘法结果 + // 说明:javascript的乘法结果会有误差,在两个浮点数相乘的时候会比较明显。这个函数返回较为精确的乘法结果。 + // 调用:accMul(arg1,arg2) + // 返回值:arg1乘以arg2的精确结果 + function accMul(arg1, arg2) { + var s1 = arg1.toString(); + var s2 = arg2.toString(); + var m = 0; + try { + m += s1.split('.')[1].length; + } + catch(e) {} + try { + m += s2.split('.')[1].length; + } + catch(e) {} + + return (s1.replace('.', '') - 0) * (s2.replace('.', '') - 0) / Math.pow(10, m); + } + + // 加法函数,用来得到精确的加法结果 + // 说明:javascript的加法结果会有误差,在两个浮点数相加的时候会比较明显。这个函数返回较为精确的加法结果。 + // 调用:accAdd(arg1,arg2) + // 返回值:arg1加上arg2的精确结果 + function accAdd(arg1, arg2) { + var r1 = 0; + var r2 = 0; + try { + r1 = arg1.toString().split('.')[1].length; + } + catch(e) {} + try { + r2 = arg2.toString().split('.')[1].length; + } + catch(e) {} + + var m = Math.pow(10, Math.max(r1, r2)); + return (Math.round(arg1 * m) + Math.round(arg2 * m)) / m; + } + + //减法函数,用来得到精确的减法结果 + //说明:javascript的减法结果会有误差,在两个浮点数减法的时候会比较明显。这个函数返回较为精确的减法结果。 + //调用:accSub(arg1,arg2) + //返回值:arg1减法arg2的精确结果 + function accSub(arg1,arg2) { + return accAdd(arg1, -arg2); + } + + return { + accDiv : accDiv, + accMul : accMul, + accAdd : accAdd, + accSub : accSub + }; +}); +/** + * echarts图表基类 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon','../util/shape/MarkLine','../util/shape/Symbol','../config','../util/ecData','../util/ecAnimation','../util/ecEffect','../util/accMath','zrender/tool/util','zrender/tool/area'],function (require) { + // 图形依赖 + var ImageShape = require('zrender/shape/Image'); + var IconShape = require('../util/shape/Icon'); + var MarkLineShape = require('../util/shape/MarkLine'); + var SymbolShape = require('../util/shape/Symbol'); + + var ecConfig = require('../config'); + var ecData = require('../util/ecData'); + var ecAnimation = require('../util/ecAnimation'); + var ecEffect = require('../util/ecEffect'); + var accMath = require('../util/accMath'); + var zrUtil = require('zrender/tool/util'); + var zrArea = require('zrender/tool/area'); + + function Base(){ + var self = this; + this.selectedMap = {}; + this.lastShapeList = []; + this.shapeHandler = { + onclick: function () { + self.isClick = true; + }, + + ondragover: function (param) { + // 返回触发可计算特性的图形提示 + var calculableShape = param.target; + calculableShape.highlightStyle = calculableShape.highlightStyle || {}; + + // 备份特出特性 + var highlightStyle = calculableShape.highlightStyle; + var brushType = highlightStyle.brushTyep; + var strokeColor = highlightStyle.strokeColor; + var lineWidth = highlightStyle.lineWidth; + + highlightStyle.brushType = 'stroke'; + highlightStyle.strokeColor = self.ecTheme.calculableColor; + highlightStyle.lineWidth = calculableShape.type === 'icon' ? 30 : 10; + + self.zr.addHoverShape(calculableShape); + + setTimeout(function (){ + // 复位 + if (calculableShape.highlightStyle) { + calculableShape.highlightStyle.brushType = brushType; + calculableShape.highlightStyle.strokeColor = strokeColor; + calculableShape.highlightStyle.lineWidth = lineWidth; + } + },20); + }, + + ondrop: function (param) { + // 排除一些非数据的拖拽进入 + if (ecData.get(param.dragged, 'data') != null) { + self.isDrop = true; + } + }, + + ondragend: function () { + self.isDragend = true; + } + }; + } + + /** + * 基类方法 + */ + Base.prototype = { + /** + * 图形拖拽特性 + */ + setCalculable: function (shape) { + shape.dragEnableTime = this.ecTheme.DRAG_ENABLE_TIME; + shape.ondragover = this.shapeHandler.ondragover; + shape.ondragend = this.shapeHandler.ondragend; + shape.ondrop = this.shapeHandler.ondrop; + return shape; + }, + + /** + * 数据项被拖拽进来 + */ + ondrop: function (param, status) { + if (!this.isDrop || !param.target) { + // 没有在当前实例上发生拖拽行为则直接返回 + return; + } + var target = param.target; // 拖拽安放目标 + var dragged = param.dragged; // 当前被拖拽的图形对象 + + var seriesIndex = ecData.get(target, 'seriesIndex'); + var dataIndex = ecData.get(target, 'dataIndex'); + + var series = this.series; + var data; + var legend = this.component.legend; + if (dataIndex === -1) { + // 落到calculableCase上,数据被拖拽进某个饼图|雷达|漏斗,增加数据 + data = { + value: ecData.get(dragged, 'value'), + name: ecData.get(dragged, 'name') + }; + + // 修饼图数值不为负值 + if (this.type === ecConfig.CHART_TYPE_PIE && data.value < 0) { + data.value = 0; + } + + var hasFind = false; + var sData = series[seriesIndex].data; + for (var i = 0, l = sData.length; i < l; i++) { + if (sData[i].name === data.name && sData[i].value === '-') { + series[seriesIndex].data[i].value = data.value; + hasFind = true; + } + } + !hasFind && series[seriesIndex].data.push(data); + + legend && legend.add( + data.name, + dragged.style.color || dragged.style.strokeColor + ); + } + else { + // 落到数据item上,数据被拖拽到某个数据项上,数据修改 + data = this.option.series[seriesIndex].data[dataIndex] || '-'; + if (data.value != null) { + if (data.value != '-') { + this.option.series[seriesIndex].data[dataIndex].value = + accMath.accAdd( + this.option.series[seriesIndex].data[dataIndex].value, + ecData.get(dragged, 'value') + ); + } + else { + this.option.series[seriesIndex].data[dataIndex].value = + ecData.get(dragged, 'value'); + } + + if (this.type === ecConfig.CHART_TYPE_FUNNEL + || this.type === ecConfig.CHART_TYPE_PIE + ) { + legend && legend.getRelatedAmount(data.name) === 1 + && this.component.legend.del(data.name); + data.name += this.option.nameConnector + ecData.get(dragged, 'name'); + legend && legend.add( + data.name, + dragged.style.color || dragged.style.strokeColor + ); + } + } + else { + if (data != '-') { + this.option.series[seriesIndex].data[dataIndex] = + accMath.accAdd( + this.option.series[seriesIndex].data[dataIndex], + ecData.get(dragged, 'value') + ); + } + else { + this.option.series[seriesIndex].data[dataIndex] = + ecData.get(dragged, 'value'); + } + } + } + + // 别status = {}赋值啊!! + status.dragIn = status.dragIn || true; + + // 处理完拖拽事件后复位 + this.isDrop = false; + + var self = this; + setTimeout(function(){ + self.zr.trigger('mousemove', param.event); + }, 300); + + return; + }, + + /** + * 数据项被拖拽出去 + */ + ondragend: function (param, status) { + if (!this.isDragend || !param.target) { + // 没有在当前实例上发生拖拽行为则直接返回 + return; + } + var target = param.target; // 被拖拽图形元素 + + var seriesIndex = ecData.get(target, 'seriesIndex'); + var dataIndex = ecData.get(target, 'dataIndex'); + + var series = this.series; + + // 删除被拖拽走的数据 + if (series[seriesIndex].data[dataIndex].value != null) { + series[seriesIndex].data[dataIndex].value = '-'; + // 清理可能有且唯一的legend data + var name = series[seriesIndex].data[dataIndex].name; + if (this.component.legend + && this.component.legend.getRelatedAmount(name) === 0 + ) { + this.component.legend.del(name); + } + } + else { + series[seriesIndex].data[dataIndex] = '-'; + } + + // 别status = {}赋值啊!! + status.dragOut = true; + status.needRefresh = true; + + // 处理完拖拽事件后复位 + this.isDragend = false; + + return; + }, + + /** + * 图例选择 + */ + onlegendSelected: function (param, status) { + var legendSelected = param.selected; + for (var itemName in this.selectedMap) { + if (this.selectedMap[itemName] != legendSelected[itemName]) { + // 有一项不一致都需要重绘 + status.needRefresh = true; + } + this.selectedMap[itemName] = legendSelected[itemName]; + } + return; + }, + + /** + * 添加文本 + */ + addLabel: function (tarShape, serie, data, name, orient) { + // 多级控制 + var queryTarget = [data, serie]; + var nLabel = this.deepMerge(queryTarget, 'itemStyle.normal.label'); + var eLabel = this.deepMerge(queryTarget, 'itemStyle.emphasis.label'); + + var nTextStyle = nLabel.textStyle || {}; + var eTextStyle = eLabel.textStyle || {}; + + if (nLabel.show) { + tarShape.style.text = this._getLabelText( + serie, data, name, 'normal' + ); + tarShape.style.textPosition = nLabel.position == null + ? (orient === 'horizontal' ? 'right' : 'top') + : nLabel.position; + tarShape.style.textColor = nTextStyle.color; + tarShape.style.textFont = this.getFont(nTextStyle); + } + if (eLabel.show) { + tarShape.highlightStyle.text = this._getLabelText( + serie, data, name, 'emphasis' + ); + tarShape.highlightStyle.textPosition = nLabel.show + ? tarShape.style.textPosition + : (eLabel.position == null + ? (orient === 'horizontal' ? 'right' : 'top') + : eLabel.position); + tarShape.highlightStyle.textColor = eTextStyle.color; + tarShape.highlightStyle.textFont = this.getFont(eTextStyle); + } + + return tarShape; + }, + + /** + * 根据lable.format计算label text + */ + _getLabelText: function (serie, data, name, status) { + var formatter = this.deepQuery( + [data, serie], + 'itemStyle.' + status + '.label.formatter' + ); + if (!formatter && status === 'emphasis') { + // emphasis时需要看看normal下是否有formatter + formatter = this.deepQuery( + [data, serie], + 'itemStyle.normal.label.formatter' + ); + } + + var value = data != null + ? (data.value != null + ? data.value + : data) + : '-'; + + if (formatter) { + if (typeof formatter === 'function') { + return formatter.call( + this.myChart, + serie.name, + name, + value + ); + } + else if (typeof formatter === 'string') { + formatter = formatter.replace('{a}','{a0}') + .replace('{b}','{b0}') + .replace('{c}','{c0}'); + formatter = formatter.replace('{a0}', serie.name) + .replace('{b0}', name) + .replace('{c0}', value); + + return formatter; + } + } + else { + return value; + } + }, + + /** + * 标线标注 + */ + buildMark: function (seriesIndex) { + var serie = this.series[seriesIndex]; + if (this.selectedMap[serie.name]) { + serie.markPoint && this._buildMarkPoint(seriesIndex); + serie.markLine && this._buildMarkLine(seriesIndex); + } + }, + + /** + * 标注逻辑 + */ + _buildMarkPoint: function (seriesIndex) { + var attachStyle = (this.markAttachStyle || {})[seriesIndex]; + var serie = this.series[seriesIndex]; + var _zlevelBase = this.getZlevelBase(); + var mpData; + var pos; + var markPoint = zrUtil.clone(serie.markPoint); + for (var i = 0, l = markPoint.data.length; i < l; i++) { + mpData = markPoint.data[i]; + pos = this.getMarkCoord(seriesIndex, mpData); + markPoint.data[i].x = mpData.x != null ? mpData.x : pos[0]; + markPoint.data[i].y = mpData.y != null ? mpData.y : pos[1]; + if (mpData.type + && (mpData.type === 'max' || mpData.type === 'min') + ) { + // 特殊值内置支持 + markPoint.data[i].value = pos[3]; + markPoint.data[i].name = mpData.name || mpData.type; + markPoint.data[i].symbolSize = markPoint.data[i].symbolSize + || (zrArea.getTextWidth(pos[3], this.getFont()) / 2 + 5); + } + } + + var shapeList = this._markPoint(seriesIndex, markPoint); + + for (var i = 0, l = shapeList.length; i < l; i++) { + shapeList[i].zlevel = _zlevelBase + 1; + for (var key in attachStyle) { + shapeList[i][key] = zrUtil.clone(attachStyle[key]); + } + this.shapeList.push(shapeList[i]); + } + // 个别特殊图表需要自己addShape + if (this.type === ecConfig.CHART_TYPE_FORCE + || this.type === ecConfig.CHART_TYPE_CHORD + ) { + for (var i = 0, l = shapeList.length; i < l; i++) { + this.zr.addShape(shapeList[i]); + } + } + }, + + /** + * 标线逻辑 + */ + _buildMarkLine: function (seriesIndex) { + var attachStyle = (this.markAttachStyle || {})[seriesIndex]; + var serie = this.series[seriesIndex]; + var _zlevelBase = this.getZlevelBase(); + var mlData; + var pos; + var markLine = zrUtil.clone(serie.markLine); + for (var i = 0, l = markLine.data.length; i < l; i++) { + mlData = markLine.data[i]; + if (mlData.type + && (mlData.type === 'max' || mlData.type === 'min' || mlData.type === 'average') + ) { + // 特殊值内置支持 + pos = this.getMarkCoord(seriesIndex, mlData); + markLine.data[i] = [zrUtil.clone(mlData), {}]; + markLine.data[i][0].name = mlData.name || mlData.type; + markLine.data[i][0].value = pos[3]; + pos = pos[2]; + mlData = [{},{}]; + } + else { + pos = [ + this.getMarkCoord(seriesIndex, mlData[0]), + this.getMarkCoord(seriesIndex, mlData[1]) + ]; + } + + markLine.data[i][0].x = mlData[0].x != null ? mlData[0].x : pos[0][0]; + markLine.data[i][0].y = mlData[0].y != null ? mlData[0].y : pos[0][1]; + markLine.data[i][1].x = mlData[1].x != null ? mlData[1].x : pos[1][0]; + markLine.data[i][1].y = mlData[1].y != null ? mlData[1].y : pos[1][1]; + } + + var shapeList = this._markLine(seriesIndex, markLine); + + for (var i = 0, l = shapeList.length; i < l; i++) { + shapeList[i].zlevel = _zlevelBase + 1; + for (var key in attachStyle) { + shapeList[i][key] = zrUtil.clone(attachStyle[key]); + } + this.shapeList.push(shapeList[i]); + } + // 个别特殊图表需要自己addShape + if (this.type === ecConfig.CHART_TYPE_FORCE + || this.type === ecConfig.CHART_TYPE_CHORD + ) { + for (var i = 0, l = shapeList.length; i < l; i++) { + this.zr.addShape(shapeList[i]); + } + } + }, + + /** + * 标注多级控制构造 + */ + _markPoint: function (seriesIndex, mpOption) { + var serie = this.series[seriesIndex]; + var component = this.component; + zrUtil.merge( + mpOption, + this.ecTheme.markPoint + ); + mpOption.name = serie.name; + + var pList = []; + var data = mpOption.data; + var itemShape; + + var dataRange = component.dataRange; + var legend = component.legend; + var color; + var value; + var queryTarget; + var nColor; + var eColor; + var effect; + var zrWidth = this.zr.getWidth(); + var zrHeight = this.zr.getHeight(); + + if (!mpOption.large) { + for (var i = 0, l = data.length; i < l; i++) { + if (data[i].x == null || data[i].y == null) { + continue; + } + value = data[i] != null && data[i].value != null + ? data[i].value + : ''; + // 图例 + if (legend) { + color = legend.getColor(serie.name); + } + // 值域 + if (dataRange) { + color = isNaN(value) ? color : dataRange.getColor(value); + + queryTarget = [data[i], mpOption]; + nColor = this.deepQuery( + queryTarget, 'itemStyle.normal.color' + ) || color; + eColor = this.deepQuery( + queryTarget, 'itemStyle.emphasis.color' + ) || nColor; + // 有值域,并且值域返回null且用户没有自己定义颜色,则隐藏这个mark + if (nColor == null && eColor == null) { + continue; + } + } + + // 标准化一些参数 + data[i].tooltip = data[i].tooltip + || {trigger:'item'}; // tooltip.trigger指定为item + data[i].name = data[i].name != null ? data[i].name : ''; + data[i].value = value; + + // 复用getSymbolShape + itemShape = this.getSymbolShape( + mpOption, seriesIndex, // 系列 + data[i], i, data[i].name, // 数据 + this.parsePercent(data[i].x, zrWidth), // 坐标 + this.parsePercent(data[i].y, zrHeight), // 坐标 + 'pin', color, // 默认symbol和color + 'rgba(0,0,0,0)', + 'horizontal' // 走向,用于默认文字定位 + ); + itemShape._mark = 'point'; + + effect = this.deepMerge( + [data[i], mpOption], + 'effect' + ); + if (effect.show) { + itemShape.effect = effect; + } + + if (serie.type === ecConfig.CHART_TYPE_MAP) { + itemShape._geo = this.getMarkGeo(data[i]); + } + + // 重新pack一下数据 + ecData.pack( + itemShape, + serie, seriesIndex, + data[i], i, + data[i].name, + value + ); + pList.push(itemShape); + } + } + else { + // 大规模MarkPoint + itemShape = this.getLargeMarkPoingShape(seriesIndex, mpOption); + itemShape._mark = 'largePoint'; + itemShape && pList.push(itemShape); + } + return pList; + }, + + /** + * 标线多级控制构造 + */ + _markLine: function (seriesIndex, mlOption) { + var serie = this.series[seriesIndex]; + var component = this.component; + zrUtil.merge( + mlOption, + this.ecTheme.markLine + ); + // 标准化一些同时支持Array和String的参数 + mlOption.symbol = mlOption.symbol instanceof Array + ? mlOption.symbol.length > 1 + ? mlOption.symbol + : [mlOption.symbol[0], mlOption.symbol[0]] + : [mlOption.symbol, mlOption.symbol]; + mlOption.symbolSize = mlOption.symbolSize instanceof Array + ? mlOption.symbolSize.length > 1 + ? mlOption.symbolSize + : [mlOption.symbolSize[0], mlOption.symbolSize[0]] + : [mlOption.symbolSize, mlOption.symbolSize]; + mlOption.symbolRotate = mlOption.symbolRotate instanceof Array + ? mlOption.symbolRotate.length > 1 + ? mlOption.symbolRotate + : [mlOption.symbolRotate[0], mlOption.symbolRotate[0]] + : [mlOption.symbolRotate, mlOption.symbolRotate]; + + mlOption.name = serie.name; + + var pList = []; + var data = mlOption.data; + var itemShape; + + var dataRange = component.dataRange; + var legend = component.legend; + var color; + var value; + var queryTarget; + var nColor; + var eColor; + var effect; + var zrWidth = this.zr.getWidth(); + var zrHeight = this.zr.getHeight(); + var mergeData; + for (var i = 0, l = data.length; i < l; i++) { + if (data[i][0].x == null + || data[i][0].y == null + || data[i][1].x == null + || data[i][1].y == null + ) { + continue; + } + + // 图例 + if (legend) { + color = legend.getColor(serie.name); + } + // 组装一个mergeData + mergeData = this.deepMerge(data[i]); + value = mergeData != null && mergeData.value != null + ? mergeData.value + : ''; + // 值域 + if (dataRange) { + color = isNaN(value) ? color : dataRange.getColor(value); + + queryTarget = [mergeData, mlOption]; + nColor = this.deepQuery( + queryTarget, 'itemStyle.normal.color' + ) || color; + eColor = this.deepQuery( + queryTarget, 'itemStyle.emphasis.color' + ) || nColor; + // 有值域,并且值域返回null且用户没有自己定义颜色,则隐藏这个mark + if (nColor == null && eColor == null) { + continue; + } + } + + // 标准化一些参数 + data[i][0].tooltip = mergeData.tooltip + || {trigger:'item'}; // tooltip.trigger指定为item + data[i][0].name = data[i][0].name != null ? data[i][0].name : ''; + data[i][1].name = data[i][1].name != null ? data[i][1].name : ''; + data[i][0].value = data[i][0].value != null ? data[i][0].value : ''; + + itemShape = this.getLineMarkShape( + mlOption, // markLine + seriesIndex, + data[i], // 数据 + i, + this.parsePercent(data[i][0].x, zrWidth), // 坐标 + this.parsePercent(data[i][0].y, zrHeight), // 坐标 + this.parsePercent(data[i][1].x, zrWidth), // 坐标 + this.parsePercent(data[i][1].y, zrHeight), // 坐标 + color // 默认symbol和color + ); + itemShape._mark = 'line'; + + effect = this.deepMerge( + [mergeData, mlOption], + 'effect' + ); + if (effect.show) { + itemShape.effect = effect; + } + + if (serie.type === ecConfig.CHART_TYPE_MAP) { + itemShape._geo = [ + this.getMarkGeo(data[i][0]), + this.getMarkGeo(data[i][1]) + ]; + } + + // 重新pack一下数据 + ecData.pack( + itemShape, + serie, seriesIndex, + data[i][0], i, + data[i][0].name + (data[i][1].name !== '' // 不要帮我代码规范 + ? (' > ' + data[i][1].name) + : ''), + value + ); + pList.push(itemShape); + } + //console.log(pList); + return pList; + }, + + getMarkCoord: function () { + // 无转换位置 + return [0, 0]; + }, + + /** + * symbol构造器 + */ + getSymbolShape: function ( + serie, seriesIndex, // 系列 + data, dataIndex, name, // 数据 + x, y, // 坐标 + symbol, color, // 默认symbol和color,来自legend或dataRange全局分配 + emptyColor, // 折线的emptySymbol用白色填充 + orient // 走向,用于默认文字定位 + ) { + var queryTarget = [data, serie]; + var value = data != null + ? (data.value != null + ? data.value + : data) + : '-'; + + symbol = this.deepQuery(queryTarget, 'symbol') || symbol; + var symbolSize = this.deepQuery(queryTarget, 'symbolSize'); + symbolSize = typeof symbolSize === 'function' + ? symbolSize(value) + : symbolSize; + var symbolRotate = this.deepQuery(queryTarget, 'symbolRotate'); + + var normal = this.deepMerge( + queryTarget, + 'itemStyle.normal' + ); + var emphasis = this.deepMerge( + queryTarget, + 'itemStyle.emphasis' + ); + var nBorderWidth = normal.borderWidth != null + ? normal.borderWidth + : (normal.lineStyle && normal.lineStyle.width); + if (nBorderWidth == null) { + nBorderWidth = symbol.match('empty') ? 2 : 0; + } + var eBorderWidth = emphasis.borderWidth != null + ? emphasis.borderWidth + : (emphasis.lineStyle && emphasis.lineStyle.width); + if (eBorderWidth == null) { + eBorderWidth = nBorderWidth + 2; + } + + var itemShape = new IconShape({ + style: { + iconType: symbol.replace('empty', '').toLowerCase(), + x: x - symbolSize, + y: y - symbolSize, + width: symbolSize * 2, + height: symbolSize * 2, + brushType: 'both', + color: symbol.match('empty') + ? emptyColor + : (this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) + || color), + strokeColor: normal.borderColor + || this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) + || color, + lineWidth: nBorderWidth + }, + highlightStyle: { + color: symbol.match('empty') + ? emptyColor + : this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data), + strokeColor: emphasis.borderColor + || normal.borderColor + || this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) + || color, + lineWidth: eBorderWidth + }, + clickable: this.deepQuery(queryTarget, 'clickable') + }); + + if (symbol.match('image')) { + itemShape.style.image = + symbol.replace(new RegExp('^image:\\/\\/'), ''); + itemShape = new ImageShape({ + style: itemShape.style, + highlightStyle: itemShape.highlightStyle, + clickable: this.deepQuery(queryTarget, 'clickable') + }); + } + + if (symbolRotate != null) { + itemShape.rotation = [ + symbolRotate * Math.PI / 180, x, y + ]; + } + + if (symbol.match('star')) { + itemShape.style.iconType = 'star'; + itemShape.style.n = + (symbol.replace('empty', '').replace('star','') - 0) || 5; + } + + if (symbol === 'none') { + itemShape.invisible = true; + itemShape.hoverable = false; + } + + /* + if (this.deepQuery([data, serie, option], 'calculable')) { + this.setCalculable(itemShape); + itemShape.draggable = true; + } + */ + + itemShape = this.addLabel( + itemShape, + serie, data, name, + orient + ); + + if (symbol.match('empty')) { + if (itemShape.style.textColor == null) { + itemShape.style.textColor = itemShape.style.strokeColor; + } + if (itemShape.highlightStyle.textColor == null) { + itemShape.highlightStyle.textColor = + itemShape.highlightStyle.strokeColor; + } + } + + ecData.pack( + itemShape, + serie, seriesIndex, + data, dataIndex, + name + ); + + itemShape._x = x; + itemShape._y = y; + + itemShape._dataIndex = dataIndex; + itemShape._seriesIndex = seriesIndex; + + return itemShape; + }, + + /** + * 标线构造器 + */ + getLineMarkShape: function ( + mlOption, // 系列 + seriesIndex, // 系列索引 + data, // 数据 + dataIndex, // 数据索引 + xStart, yStart, // 坐标 + xEnd, yEnd, // 坐标 + color // 默认color,来自legend或dataRange全局分配 + ) { + var value0 = data[0] != null + ? (data[0].value != null + ? data[0].value + : data[0]) + : '-'; + var value1 = data[1] != null + ? (data[1].value != null + ? data[1].value + : data[1]) + : '-'; + var symbol = [ + this.query(data[0], 'symbol') || mlOption.symbol[0], + this.query(data[1], 'symbol') || mlOption.symbol[1] + ]; + var symbolSize = [ + this.query(data[0], 'symbolSize') || mlOption.symbolSize[0], + this.query(data[1], 'symbolSize') || mlOption.symbolSize[1] + ]; + symbolSize[0] = typeof symbolSize[0] === 'function' + ? symbolSize[0](value0) + : symbolSize[0]; + symbolSize[1] = typeof symbolSize[1] === 'function' + ? symbolSize[1](value1) + : symbolSize[1]; + var symbolRotate = [ + this.query(data[0], 'symbolRotate') || mlOption.symbolRotate[0], + this.query(data[1], 'symbolRotate') || mlOption.symbolRotate[1] + ]; + //console.log(symbol, symbolSize, symbolRotate); + + var queryTarget = [data[0], mlOption]; + var normal = this.deepMerge( + queryTarget, + 'itemStyle.normal' + ); + normal.color = this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data); + var emphasis = this.deepMerge( + queryTarget, + 'itemStyle.emphasis' + ); + emphasis.color = this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data); + + var nlineStyle = normal.lineStyle; + var elineStyle = emphasis.lineStyle; + + var nBorderWidth = nlineStyle.width; + if (nBorderWidth == null) { + nBorderWidth = normal.borderWidth; + } + var eBorderWidth = elineStyle.width; + if (eBorderWidth == null) { + eBorderWidth = emphasis.borderWidth != null + ? emphasis.borderWidth + : (nBorderWidth + 2); + } + + var itemShape = new MarkLineShape({ + style: { + smooth: mlOption.smooth ? 'spline' : false, + symbol: symbol, + symbolSize: symbolSize, + symbolRotate: symbolRotate, + // data: [data[0].name,data[1].name], + xStart: xStart, + yStart: yStart, // 坐标 + xEnd: xEnd, + yEnd: yEnd, // 坐标 + brushType: 'both', + lineType: nlineStyle.type, + shadowColor: nlineStyle.shadowColor + || nlineStyle.color + || normal.borderColor + || normal.color + || color, + shadowBlur: nlineStyle.shadowBlur, + shadowOffsetX: nlineStyle.shadowOffsetX, + shadowOffsetY: nlineStyle.shadowOffsetY, + color: normal.color || color, + strokeColor: nlineStyle.color + || normal.borderColor + || normal.color + || color, + lineWidth: nBorderWidth, + symbolBorderColor: normal.borderColor + || normal.color + || color, + symbolBorder: normal.borderWidth + }, + highlightStyle: { + shadowColor: elineStyle.shadowColor, + shadowBlur: elineStyle.shadowBlur, + shadowOffsetX: elineStyle.shadowOffsetX, + shadowOffsetY: elineStyle.shadowOffsetY, + color: emphasis.color|| normal.color || color, + strokeColor: elineStyle.color + || nlineStyle.color + || emphasis.borderColor + || normal.borderColor + || emphasis.color + || normal.color + || color, + lineWidth: eBorderWidth, + symbolBorderColor: emphasis.borderColor + || normal.borderColor + || emphasis.color + || normal.color + || color, + symbolBorder: emphasis.borderWidth == null + ? (normal.borderWidth + 2) + : (emphasis.borderWidth) + }, + clickable: this.deepQuery(queryTarget, 'clickable') + }); + + itemShape = this.addLabel( + itemShape, + mlOption, + data[0], + data[0].name + ' : ' + data[1].name + ); + + itemShape._x = xEnd; + itemShape._y = yEnd; + + return itemShape; + }, + + /** + * 大规模标注构造器 + */ + getLargeMarkPoingShape: function(seriesIndex, mpOption) { + var serie = this.series[seriesIndex]; + var component = this.component; + var data = mpOption.data; + var itemShape; + + var dataRange = component.dataRange; + var legend = component.legend; + var color; + var value; + var queryTarget = [data[0], mpOption]; + var nColor; + var eColor; + var effect; + + // 图例 + if (legend) { + color = legend.getColor(serie.name); + } + // 值域 + if (dataRange) { + value = data[0] != null + ? (data[0].value != null + ? data[0].value + : data[0]) + : '-'; + color = isNaN(value) ? color : dataRange.getColor(value); + + nColor = this.deepQuery( + queryTarget, 'itemStyle.normal.color' + ) || color; + eColor = this.deepQuery( + queryTarget, 'itemStyle.emphasis.color' + ) || nColor; + // 有值域,并且值域返回null且用户没有自己定义颜色,则隐藏这个mark + if (nColor == null && eColor == null) { + return; + } + } + color = this.deepMerge(queryTarget, 'itemStyle.normal').color + || color; + + var symbol = this.deepQuery(queryTarget, 'symbol') || 'circle'; + symbol = symbol.replace('empty', '').replace(/\d/g, ''); + + effect = this.deepMerge( + [data[0], mpOption], + 'effect' + ); + + var devicePixelRatio = window.devicePixelRatio || 1; + + //console.log(data) + itemShape = new SymbolShape({ + style: { + pointList: data, + color: color, + strokeColor: color, + shadowColor: effect.shadowColor || color, + shadowBlur: (effect.shadowBlur != null ? effect.shadowBlur : 8) + * devicePixelRatio, + size: this.deepQuery(queryTarget, 'symbolSize'), + iconType: symbol, + brushType: 'fill', + lineWidth:1 + }, + draggable: false, + hoverable: false + }); + + if (effect.show) { + itemShape.effect = effect; + } + + return itemShape; + }, + + backupShapeList: function () { + if (this.shapeList && this.shapeList.length > 0) { + this.lastShapeList = this.shapeList; + this.shapeList = []; + } + else { + this.lastShapeList = []; + } + }, + + addShapeList: function () { + var maxLenth = this.option.animationThreshold / (this.canvasSupported ? 2 : 4); + var lastShapeList = this.lastShapeList; + var shapeList = this.shapeList; + var duration = lastShapeList.length > 0 + ? 500 : this.query(this.option, 'animationDuration'); + var easing = this.query(this.option, 'animationEasing'); + var key; + var oldMap = {}; + var newMap = {}; + if (this.option.animation + && !this.option.renderAsImage + && shapeList.length < maxLenth + && !this.motionlessOnce + ) { + // 通过已有的shape做动画过渡 + for (var i = 0, l = lastShapeList.length; i < l; i++) { + key = this._getAnimationKey(lastShapeList[i]); + if (key.match('undefined')) { + this.zr.delShape(lastShapeList[i].id); // 非关键元素直接删除 + } + else { + key += lastShapeList[i].type; + oldMap[key] = lastShapeList[i]; + } + } + for (var i = 0, l = shapeList.length; i < l; i++) { + key = this._getAnimationKey(shapeList[i]); + if (key.match('undefined')) { + this.zr.addShape(shapeList[i]); // 非关键元素直接添加 + } + else { + key += shapeList[i].type; + newMap[key] = shapeList[i]; + } + } + + for (key in oldMap) { + if (!newMap[key]) { + // 新的没有 删除 + this.zr.delShape(oldMap[key].id); + } + } + for (key in newMap) { + if (oldMap[key]) { + // 新旧都有 动画过渡 + this.zr.delShape(oldMap[key].id); + this._animateMod(oldMap[key], newMap[key], duration, easing); + } + else { + // 新有旧没有 添加并动画过渡 + //this._animateAdd(newMap[key], duration, easing); + this._animateMod(false, newMap[key], duration, easing); + } + } + this.zr.refresh(); + this.animationEffect(); + } + else { + this.motionlessOnce = false; + // clear old + this.zr.delShape(lastShapeList); + // 直接添加 + for (var i = 0, l = shapeList.length; i < l; i++) { + this.zr.addShape(shapeList[i]); + } + } + }, + + _getAnimationKey: function(shape) { + if (this.type != ecConfig.CHART_TYPE_MAP) { + return ecData.get(shape, 'seriesIndex') + '_' + + ecData.get(shape, 'dataIndex') + + (shape._mark ? shape._mark : '') + + (this.type === ecConfig.CHART_TYPE_RADAR + ? ecData.get(shape, 'special') : ''); + } + else { + return ecData.get(shape, 'seriesIndex') + '_' + + ecData.get(shape, 'dataIndex') + + (shape._mark ? shape._mark : 'undefined'); + } + }, + + /** + * 动画过渡 + */ + _animateMod: function (oldShape, newShape, duration, easing) { + switch (newShape.type) { + case 'broken-line' : + case 'half-smooth-polygon' : + ecAnimation.pointList(this.zr, oldShape, newShape, duration, easing); + break; + case 'rectangle' : + ecAnimation.rectangle(this.zr, oldShape, newShape, duration, easing); + break; + case 'icon' : + ecAnimation.icon(this.zr, oldShape, newShape, duration, easing); + break; + case 'candle' : + if (duration > 500) { + ecAnimation.candle(this.zr, oldShape, newShape, duration, easing); + } + else { + this.zr.addShape(newShape); + } + break; + case 'ring' : + case 'sector' : + case 'circle' : + if (duration > 500) { + // 进入动画,加旋转 + ecAnimation.ring( + this.zr, + oldShape, + newShape, + duration + ((ecData.get(newShape, 'dataIndex') || 0) % 20 * 100), + easing + ); + } + else if (newShape.type === 'sector') { + ecAnimation.sector(this.zr, oldShape, newShape, duration, easing); + } + else { + this.zr.addShape(newShape); + } + break; + case 'text' : + ecAnimation.text(this.zr, oldShape, newShape, duration, easing); + break; + case 'polygon' : + if (duration > 500) { + ecAnimation.polygon(this.zr, oldShape, newShape, duration, easing); + } + else { + ecAnimation.pointList(this.zr, oldShape, newShape, duration, easing); + } + break; + case 'chord' : + ecAnimation.chord(this.zr, oldShape, newShape, duration, easing); + break; + case 'gauge-pointer' : + ecAnimation.gaugePointer(this.zr, oldShape, newShape, duration, easing); + break; + case 'mark-line' : + ecAnimation.markline(this.zr, oldShape, newShape, duration, easing); + break; + case 'line' : + ecAnimation.line(this.zr, oldShape, newShape, duration, easing); + break; + default : + this.zr.addShape(newShape); + break; + } + }, + + /** + * 标注动画 + * @param {number} duration 时长 + * @param {string=} easing 缓动效果 + * @param {Array=} addShapeList 指定特效对象,不知道默认使用this.shapeList + */ + animationMark: function (duration , easing, addShapeList) { + var shapeList = addShapeList || this.shapeList; + for (var i = 0, l = shapeList.length; i < l; i++) { + if (!shapeList[i]._mark) { + continue; + } + this._animateMod(false, shapeList[i], duration, easing); + } + this.animationEffect(addShapeList); + }, + + /** + * 特效动画 + * @param {Array=} addShapeList 指定特效对象,不知道默认使用this.shapeList + */ + animationEffect: function (addShapeList) { + !addShapeList && this.clearEffectShape(); + var shapeList = addShapeList || this.shapeList; + var zlevel = ecConfig.EFFECT_ZLEVEL; + if (this.canvasSupported) { + this.zr.modLayer( + zlevel, + { + motionBlur: true, + lastFrameAlpha: 0.95 + } + ); + } + var shape; + for (var i = 0, l = shapeList.length; i < l; i++) { + shape = shapeList[i]; + if (!(shape._mark && shape.effect && shape.effect.show && ecEffect[shape._mark]) + ) { + continue; + } + ecEffect[shape._mark](this.zr, this.effectList, shape, zlevel); + this.effectList[this.effectList.length - 1]._mark = shape._mark; + } + }, + + clearEffectShape: function (clearMotionBlur) { + if (this.zr && this.effectList && this.effectList.length > 0) { + clearMotionBlur && this.zr.modLayer( + ecConfig.EFFECT_ZLEVEL, + { motionBlur: false } + ); + this.zr.delShape(this.effectList); + } + this.effectList = []; + }, + + /** + * 动态标线标注添加 + * @param {number} seriesIndex 系列索引 + * @param {Object} markData 标线标注对象,支持多个 + * @param {string} markType 标线标注类型 + */ + addMark: function (seriesIndex, markData, markType) { + var serie = this.series[seriesIndex]; + if (this.selectedMap[serie.name]) { + var duration = 500; + var easing = this.query(this.option, 'animationEasing'); + // 备份,复用_buildMarkX + var oriMarkData = serie[markType].data; + var lastLength = this.shapeList.length; + + serie[markType].data = markData.data; + this['_build' + markType.replace('m', 'M')](seriesIndex); + if (this.option.animation && !this.option.renderAsImage) { + // animationMark就会addShape + this.animationMark(duration, easing, this.shapeList.slice(lastLength)); + } + else { + for (var i = lastLength, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + this.zr.refresh(); + } + // 还原,复用_buildMarkX + serie[markType].data = oriMarkData; + } + }, + + /** + * 动态标线标注删除 + * @param {number} seriesIndex 系列索引 + * @param {string} markName 标线标注名称 + * @param {string} markType 标线标注类型 + */ + delMark: function (seriesIndex, markName, markType) { + markType = markType.replace('mark', '').replace('large', '').toLowerCase(); + var serie = this.series[seriesIndex]; + if (this.selectedMap[serie.name]) { + var needRefresh = false; + var shapeList = [this.shapeList, this.effectList]; + var len = 2; + while(len--) { + for (var i = 0, l = shapeList[len].length; i < l; i++) { + if (shapeList[len][i]._mark === markType + && ecData.get(shapeList[len][i], 'seriesIndex') === seriesIndex + && ecData.get(shapeList[len][i], 'name') === markName + ) { + this.zr.delShape(shapeList[len][i].id); + shapeList[len].splice(i, 1); + needRefresh = true; + break; + } + } + } + + needRefresh && this.zr.refresh(); + } + } + }; + + return Base; +}); + +/** + * echart图表库 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + */ +define('echarts/chart',[],function (/*require*/) { //chart + var self = {}; + + var _chartLibrary = {}; //echart图表库 + + /** + * 定义图形实现 + * @param {Object} name + * @param {Object} clazz 图形实现 + */ + self.define = function (name, clazz) { + _chartLibrary[name] = clazz; + return self; + }; + + /** + * 获取图形实现 + * @param {Object} name + */ + self.get = function (name) { + return _chartLibrary[name]; + }; + + return self; +}); +/** + * echarts组件:孤岛数据 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/chart/island',['require','../component/base','./base','zrender/shape/Circle','../config','../util/ecData','zrender/tool/util','zrender/tool/event','zrender/tool/color','../util/accMath','../chart'],function (require) { + var ComponentBase = require('../component/base'); + var ChartBase = require('./base'); + + // 图形依赖 + var CircleShape = require('zrender/shape/Circle'); + + var ecConfig = require('../config'); + var ecData = require('../util/ecData'); + var zrUtil = require('zrender/tool/util'); + var zrEvent = require('zrender/tool/event'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} option 图表选项 + */ + function Island(ecTheme, messageCenter, zr, option, myChart) { + // 基类 + ComponentBase.call(this, ecTheme, messageCenter, zr, {}, myChart); + // 图表基类 + ChartBase.call(this); + + this._nameConnector; + this._valueConnector; + this._zrHeight = this.zr.getHeight(); + this._zrWidth = this.zr.getWidth(); + + var self = this; + /** + * 滚轮改变孤岛数据值 + */ + self.shapeHandler.onmousewheel = function (param) { + var shape = param.target; + + var event = param.event; + var delta = zrEvent.getDelta(event); + delta = delta > 0 ? (-1) : 1; + shape.style.r -= delta; + shape.style.r = shape.style.r < 5 ? 5 : shape.style.r; + + var value = ecData.get(shape, 'value'); + var dvalue = value * self.option.island.calculateStep; + if (dvalue > 1) { + value = Math.round(value - dvalue * delta); + } + else { + value = (value - dvalue * delta).toFixed(2) - 0; + } + + var name = ecData.get(shape, 'name'); + shape.style.text = name + ':' + value; + + ecData.set(shape, 'value', value); + ecData.set(shape, 'name', name); + + self.zr.modShape(shape.id); + self.zr.refresh(); + zrEvent.stop(event); + }; + } + + Island.prototype = { + type: ecConfig.CHART_TYPE_ISLAND, + /** + * 孤岛合并 + * + * @param {string} tarShapeIndex 目标索引 + * @param {Object} srcShape 源目标,合入目标后删除 + */ + _combine: function (tarShape, srcShape) { + var zrColor = require('zrender/tool/color'); + var accMath = require('../util/accMath'); + var value = accMath.accAdd( + ecData.get(tarShape, 'value'), + ecData.get(srcShape, 'value') + ); + var name = ecData.get(tarShape, 'name') + + this._nameConnector + + ecData.get(srcShape, 'name'); + + tarShape.style.text = name + this._valueConnector + value; + + ecData.set(tarShape, 'value', value); + ecData.set(tarShape, 'name', name); + tarShape.style.r = this.option.island.r; + tarShape.style.color = zrColor.mix( + tarShape.style.color, + srcShape.style.color + ); + }, + + /** + * 刷新 + */ + refresh: function (newOption) { + if (newOption) { + newOption.island = this.reformOption(newOption.island); + this.option = newOption; + + this._nameConnector = this.option.nameConnector; + this._valueConnector = this.option.valueConnector; + } + }, + + getOption: function () { + return this.option; + }, + + resize: function () { + var newWidth = this.zr.getWidth(); + var newHieght = this.zr.getHeight(); + var xScale = newWidth / (this._zrWidth || newWidth); + var yScale = newHieght / (this._zrHeight || newHieght); + if (xScale === 1 && yScale === 1) { + return; + } + this._zrWidth = newWidth; + this._zrHeight = newHieght; + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.modShape( + this.shapeList[i].id, + { + style: { + x: Math.round(this.shapeList[i].style.x * xScale), + y: Math.round(this.shapeList[i].style.y * yScale) + } + } + ); + } + }, + + add: function (shape) { + var name = ecData.get(shape, 'name'); + var value = ecData.get(shape, 'value'); + var seriesName = ecData.get(shape, 'series') != null + ? ecData.get(shape, 'series').name + : ''; + var font = this.getFont(this.option.island.textStyle); + var islandShape = { + zlevel: this._zlevelBase, + style: { + x: shape.style.x, + y: shape.style.y, + r: this.option.island.r, + color: shape.style.color || shape.style.strokeColor, + text: name + this._valueConnector + value, + textFont: font + }, + draggable: true, + hoverable: true, + onmousewheel: this.shapeHandler.onmousewheel, + _type: 'island' + }; + if (islandShape.style.color === '#fff') { + islandShape.style.color = shape.style.strokeColor; + } + this.setCalculable(islandShape); + islandShape.dragEnableTime = 0; + ecData.pack( + islandShape, + {name:seriesName}, -1, + value, -1, + name + ); + islandShape = new CircleShape(islandShape); + this.shapeList.push(islandShape); + this.zr.addShape(islandShape); + }, + + del: function (shape) { + this.zr.delShape(shape.id); + var newShapeList = []; + for (var i = 0, l = this.shapeList.length; i < l; i++) { + if (this.shapeList[i].id != shape.id) { + newShapeList.push(this.shapeList[i]); + } + } + this.shapeList = newShapeList; + }, + + /** + * 数据项被拖拽进来, 重载基类方法 + */ + ondrop: function (param, status) { + if (!this.isDrop || !param.target) { + // 没有在当前实例上发生拖拽行为则直接返回 + return; + } + // 拖拽产生孤岛数据合并 + var target = param.target; // 拖拽安放目标 + var dragged = param.dragged; // 当前被拖拽的图形对象 + + this._combine(target, dragged); + this.zr.modShape(target.id); + + status.dragIn = true; + + // 处理完拖拽事件后复位 + this.isDrop = false; + + return; + }, + + /** + * 数据项被拖拽出去, 重载基类方法 + */ + ondragend: function (param, status) { + var target = param.target; // 拖拽安放目标 + if (!this.isDragend) { + // 拖拽的不是孤岛数据,如果没有图表接受孤岛数据,需要新增孤岛数据 + if (!status.dragIn) { + target.style.x = zrEvent.getX(param.event); + target.style.y = zrEvent.getY(param.event); + this.add(target); + status.needRefresh = true; + } + } + else { + // 拖拽的是孤岛数据,如果有图表接受了孤岛数据,需要删除孤岛数据 + if (status.dragIn) { + this.del(target); + status.needRefresh = true; + } + } + + // 处理完拖拽事件后复位 + this.isDragend = false; + + return; + } + }; + + zrUtil.inherits(Island, ChartBase); + zrUtil.inherits(Island, ComponentBase); + + // 图表注册 + require('../chart').define('island', Island); + + return Island; +}); +/** + * echart组件库 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/component',[],function (/*require*/) { // component + var self = {}; + + var _componentLibrary = {}; // echart组件库 + + /** + * 定义图形实现 + * @param {Object} name + * @param {Object} clazz 图形实现 + */ + self.define = function (name, clazz) { + _componentLibrary[name] = clazz; + return self; + }; + + /** + * 获取图形实现 + * @param {Object} name + */ + self.get = function (name) { + return _componentLibrary[name]; + }; + + return self; +}); +/** + * echarts组件:提示框 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/component/dataView',['require','./base','../config','zrender/tool/util','../component'],function (require) { + var Base = require('./base'); + + var ecConfig = require('../config'); + var zrUtil = require('zrender/tool/util'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} option 提示框参数 + * @param {HtmlElement} dom 目标对象 + */ + function DataView(ecTheme, messageCenter, zr, option, myChart) { + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + + this.dom = myChart.dom; + + // dataview dom & css + this._tDom = document.createElement('div'); + this._textArea = document.createElement('textArea'); + this._buttonRefresh = document.createElement('button'); + this._buttonClose = document.createElement('button'); + this._hasShow = false; + + // 缓存一些高宽数据 + this._zrHeight = zr.getHeight(); + this._zrWidth = zr.getWidth(); + + this._tDom.className = 'echarts-dataview', + this.hide(); + this.dom.firstChild.appendChild(this._tDom); + + if (window.addEventListener) { + this._tDom.addEventListener('click', this._stop); + this._tDom.addEventListener('mousewheel', this._stop); + this._tDom.addEventListener('mousemove', this._stop); + this._tDom.addEventListener('mousedown', this._stop); + this._tDom.addEventListener('mouseup', this._stop); + + // mobile支持 + this._tDom.addEventListener('touchstart', this._stop); + this._tDom.addEventListener('touchmove', this._stop); + this._tDom.addEventListener('touchend', this._stop); + } + else { + this._tDom.attachEvent('onclick', this._stop); + this._tDom.attachEvent('onmousewheel', this._stop); + this._tDom.attachEvent('onmousemove', this._stop); + this._tDom.attachEvent('onmousedown', this._stop); + this._tDom.attachEvent('onmouseup', this._stop); + } + } + + DataView.prototype = { + type : ecConfig.COMPONENT_TYPE_DATAVIEW, + _lang : ['Data View', 'close', 'refresh'], + // 通用样式 + _gCssText : 'position:absolute;' + + 'display:block;' + + 'overflow:hidden;' + + 'transition:height 0.8s,background-color 1s;' + + '-moz-transition:height 0.8s,background-color 1s;' + + '-webkit-transition:height 0.8s,background-color 1s;' + + '-o-transition:height 0.8s,background-color 1s;' + + 'z-index:1;' + + 'left:0;' + + 'top:0;', + hide : function () { + this._sizeCssText = 'width:' + this._zrWidth + 'px;' + + 'height:' + 0 + 'px;' + + 'background-color:#f0ffff;'; + this._tDom.style.cssText = this._gCssText + this._sizeCssText; + // 这是个很恶心的事情 + /* + this.dom.onselectstart = function () { + return false; + }; + */ + }, + + show : function (newOption) { + this._hasShow = true; + var lang = this.query(this.option, 'toolbox.feature.dataView.lang') + || this._lang; + + this.option = newOption; + + this._tDom.innerHTML = '

' + + (lang[0] || this._lang[0]) + + '

'; + + this._textArea.style.cssText = + 'display:block;margin:0 0 8px 0;padding:4px 6px;overflow:auto;' + + 'width:' + (this._zrWidth - 15) + 'px;' + + 'height:' + (this._zrHeight - 100) + 'px;'; + var customContent = this.query( + this.option, 'toolbox.feature.dataView.optionToContent' + ); + if (typeof customContent != 'function') { + this._textArea.value = this._optionToContent(); + } + else { + this._textArea.value = customContent(this.option); + } + this._tDom.appendChild(this._textArea); + + this._buttonClose.style.cssText = 'float:right;padding:1px 6px;'; + this._buttonClose.innerHTML = lang[1] || this._lang[1]; + var self = this; + this._buttonClose.onclick = function (){ + self.hide(); + }; + this._tDom.appendChild(this._buttonClose); + + if (this.query(this.option, 'toolbox.feature.dataView.readOnly') + === false + ) { + this._buttonRefresh.style.cssText = + 'float:right;margin-right:10px;padding:1px 6px;'; + this._buttonRefresh.innerHTML = lang[2] || this._lang[2]; + this._buttonRefresh.onclick = function (){ + self._save(); + }; + this._tDom.appendChild(this._buttonRefresh); + this._textArea.readOnly = false; + this._textArea.style.cursor = 'default'; + } + else { + this._textArea.readOnly = true; + this._textArea.style.cursor = 'text'; + } + + this._sizeCssText = 'width:' + this._zrWidth + 'px;' + + 'height:' + this._zrHeight + 'px;' + + 'background-color:#fff;'; + this._tDom.style.cssText = this._gCssText + this._sizeCssText; + // 这是个很恶心的事情 + /* + this.dom.onselectstart = function () { + return true; + }; + */ + }, + + _optionToContent : function () { + var i; + var j; + var k; + var len; + var data; + var valueList; + var axisList = []; + var content = ''; + if (this.option.xAxis) { + if (this.option.xAxis instanceof Array) { + axisList = this.option.xAxis; + } else { + axisList = [this.option.xAxis]; + } + for (i = 0, len = axisList.length; i < len; i++) { + // 横纵默认为类目 + if ((axisList[i].type || 'category') == 'category') { + valueList = []; + for (j = 0, k = axisList[i].data.length; j < k; j++) { + data = axisList[i].data[j]; + valueList.push( + typeof data.value != 'undefined' + ? data.value : data + ); + } + content += valueList.join(', ') + '\n\n'; + } + } + } + + if (this.option.yAxis) { + if (this.option.yAxis instanceof Array) { + axisList = this.option.yAxis; + } else { + axisList = [this.option.yAxis]; + } + for (i = 0, len = axisList.length; i < len; i++) { + if (axisList[i].type == 'category') { + valueList = []; + for (j = 0, k = axisList[i].data.length; j < k; j++) { + data = axisList[i].data[j]; + valueList.push( + typeof data.value != 'undefined' + ? data.value : data + ); + } + content += valueList.join(', ') + '\n\n'; + } + } + } + + var series = this.option.series; + var itemName; + for (i = 0, len = series.length; i < len; i++) { + valueList = []; + for (j = 0, k = series[i].data.length; j < k; j++) { + data = series[i].data[j]; + if (series[i].type == ecConfig.CHART_TYPE_PIE + || series[i].type == ecConfig.CHART_TYPE_MAP + ) { + itemName = (data.name || '-') + ':'; + } + else { + itemName = ''; + } + + if (series[i].type == ecConfig.CHART_TYPE_SCATTER) { + data = typeof data.value != 'undefined' + ? data.value + : data; + data = data.join(', '); + } + valueList.push( + itemName + + (typeof data.value != 'undefined' ? data.value : data) + ); + } + content += (series[i].name || '-') + ' : \n'; + content += valueList.join( + series[i].type == ecConfig.CHART_TYPE_SCATTER ? '\n': ', ' + ); + content += '\n\n'; + } + + return content; + }, + + _save : function () { + var text = this._textArea.value; + var customContent = this.query( + this.option, 'toolbox.feature.dataView.contentToOption' + ); + if (typeof customContent != 'function') { + text = text.split('\n'); + var content = []; + for (var i = 0, l = text.length; i < l; i++) { + text[i] = this._trim(text[i]); + if (text[i] !== '') { + content.push(text[i]); + } + } + this._contentToOption(content); + } + else { + customContent(text, this.option); + } + + this.hide(); + + var self = this; + setTimeout( + function (){ + self.messageCenter && self.messageCenter.dispatch( + ecConfig.EVENT.DATA_VIEW_CHANGED, + null, + {option : self.option}, + self.myChart + ); + }, + // 有动画,所以高级浏览器时间更长点 + self.canvasSupported ? 800 : 100 + ); + }, + + _contentToOption : function (content) { + var i; + var j; + var k; + var len; + var data; + var axisList = []; + + var contentIdx = 0; + var contentValueList; + var value; + + if (this.option.xAxis) { + if (this.option.xAxis instanceof Array) { + axisList = this.option.xAxis; + } else { + axisList = [this.option.xAxis]; + } + for (i = 0, len = axisList.length; i < len; i++) { + // 横纵默认为类目 + if ((axisList[i].type || 'category') == 'category' + ) { + contentValueList = content[contentIdx].split(','); + for (j = 0, k = axisList[i].data.length; j < k; j++) { + value = this._trim(contentValueList[j] || ''); + data = axisList[i].data[j]; + if (typeof axisList[i].data[j].value != 'undefined' + ) { + axisList[i].data[j].value = value; + } + else { + axisList[i].data[j] = value; + } + } + contentIdx++; + } + } + } + + if (this.option.yAxis) { + if (this.option.yAxis instanceof Array) { + axisList = this.option.yAxis; + } else { + axisList = [this.option.yAxis]; + } + for (i = 0, len = axisList.length; i < len; i++) { + if (axisList[i].type == 'category') { + contentValueList = content[contentIdx].split(','); + for (j = 0, k = axisList[i].data.length; j < k; j++) { + value = this._trim(contentValueList[j] || ''); + data = axisList[i].data[j]; + if (typeof axisList[i].data[j].value != 'undefined' + ) { + axisList[i].data[j].value = value; + } + else { + axisList[i].data[j] = value; + } + } + contentIdx++; + } + } + } + + var series = this.option.series; + for (i = 0, len = series.length; i < len; i++) { + contentIdx++; + if (series[i].type == ecConfig.CHART_TYPE_SCATTER) { + for (var j = 0, k = series[i].data.length; j < k; j++) { + contentValueList = content[contentIdx]; + value = contentValueList.replace(' ','').split(','); + if (typeof series[i].data[j].value != 'undefined' + ) { + series[i].data[j].value = value; + } + else { + series[i].data[j] = value; + } + contentIdx++; + } + } + else { + contentValueList = content[contentIdx].split(','); + for (var j = 0, k = series[i].data.length; j < k; j++) { + value = (contentValueList[j] || '').replace(/.*:/,''); + value = this._trim(value); + value = (value != '-' && value !== '') + ? (value - 0) + : '-'; + if (typeof series[i].data[j].value != 'undefined' + ) { + series[i].data[j].value = value; + } + else { + series[i].data[j] = value; + } + } + contentIdx++; + } + } + }, + + _trim : function (str){ + var trimer = new RegExp( + '(^[\\s\\t\\xa0\\u3000]+)|([\\u3000\\xa0\\s\\t]+\x24)', 'g' + ); + return str.replace(trimer, ''); + }, + + // 阻塞zrender事件 + _stop : function (e){ + e = e || window.event; + if (e.stopPropagation) { + e.stopPropagation(); + } + else { + e.cancelBubble = true; + } + }, + + /** + * zrender事件响应:窗口大小改变 + */ + resize : function () { + this._zrHeight = this.zr.getHeight(); + this._zrWidth = this.zr.getWidth(); + if (this._tDom.offsetHeight > 10) { + this._sizeCssText = 'width:' + this._zrWidth + 'px;' + + 'height:' + this._zrHeight + 'px;' + + 'background-color:#fff;'; + this._tDom.style.cssText = this._gCssText + this._sizeCssText; + this._textArea.style.cssText = 'display:block;margin:0 0 8px 0;' + + 'padding:4px 6px;overflow:auto;' + + 'width:' + (this._zrWidth - 15) + 'px;' + + 'height:' + (this._zrHeight - 100) + 'px;'; + } + }, + + /** + * 释放后实例不可用,重载基类方法 + */ + dispose : function () { + if (window.removeEventListener) { + this._tDom.removeEventListener('click', this._stop); + this._tDom.removeEventListener('mousewheel', this._stop); + this._tDom.removeEventListener('mousemove', this._stop); + this._tDom.removeEventListener('mousedown', this._stop); + this._tDom.removeEventListener('mouseup', this._stop); + + // mobile支持 + this._tDom.removeEventListener('touchstart', this._stop); + this._tDom.removeEventListener('touchmove', this._stop); + this._tDom.removeEventListener('touchend', this._stop); + } + else { + this._tDom.detachEvent('onclick', this._stop); + this._tDom.detachEvent('onmousewheel', this._stop); + this._tDom.detachEvent('onmousemove', this._stop); + this._tDom.detachEvent('onmousedown', this._stop); + this._tDom.detachEvent('onmouseup', this._stop); + } + + this._buttonRefresh.onclick = null; + this._buttonClose.onclick = null; + + if (this._hasShow) { + this._tDom.removeChild(this._textArea); + this._tDom.removeChild(this._buttonRefresh); + this._tDom.removeChild(this._buttonClose); + } + + this._textArea = null; + this._buttonRefresh = null; + this._buttonClose = null; + + this.dom.firstChild.removeChild(this._tDom); + this._tDom = null; + } + }; + + zrUtil.inherits(DataView, Base); + + require('../component').define('dataView', DataView); + + return DataView; +}); +/** + * echarts组件:工具箱 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zrender/shape/Image','zrender/shape/Rectangle','../util/shape/Icon','../config','zrender/tool/util','zrender/config','zrender/tool/event','./dataView','../component'],function (require) { + var Base = require('./base'); + + // 图形依赖 + var LineShape = require('zrender/shape/Line'); + var ImageShape = require('zrender/shape/Image'); + var RectangleShape = require('zrender/shape/Rectangle'); + var IconShape = require('../util/shape/Icon'); + + var ecConfig = require('../config'); + var zrUtil = require('zrender/tool/util'); + var zrConfig = require('zrender/config'); + var zrEvent = require('zrender/tool/event'); + + var _MAGICTYPE_STACK = 'stack'; + var _MAGICTYPE_TILED = 'tiled'; + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {HtmlElement} dom 目标对象 + * @param {ECharts} myChart 当前图表实例 + */ + function Toolbox(ecTheme, messageCenter, zr, option, myChart) { + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + + this.dom = myChart.dom; + + this._magicType = {}; + this._magicMap = {}; + this._isSilence = false; + + this._iconList; + this._iconShapeMap = {}; + //this._itemGroupLocation; + this._featureTitle = {}; // 文字 + this._featureIcon = {}; // 图标 + this._featureColor = {}; // 颜色 + this._enableColor = 'red'; + this._disableColor = '#ccc'; + // this._markStart; + // this._marking; + // this._markShape; + // this._zoomStart; + // this._zooming; + // this._zoomShape; + // this._zoomQueue; + // this._dataView; + this._markShapeList = []; + var self = this; + self._onMark = function (param) { + self.__onMark(param); + }; + self._onMarkUndo = function (param) { + self.__onMarkUndo(param); + }; + self._onMarkClear = function (param) { + self.__onMarkClear(param); + }; + self._onDataZoom = function (param) { + self.__onDataZoom(param); + }; + self._onDataZoomReset = function (param) { + self.__onDataZoomReset(param); + }; + self._onDataView = function (param) { + self.__onDataView(param); + }; + self._onRestore = function (param) { + self.__onRestore(param); + }; + self._onSaveAsImage = function (param) { + self.__onSaveAsImage(param); + }; + self._onMagicType = function (param) { + self.__onMagicType(param); + }; + self._onCustomHandler = function (param) { + self.__onCustomHandler(param); + }; + self._onmousemove = function (param) { + return self.__onmousemove(param); + }; + + self._onmousedown = function (param) { + return self.__onmousedown(param); + }; + + self._onmouseup = function (param) { + return self.__onmouseup(param); + }; + + self._onclick = function (param) { + return self.__onclick(param); + }; + } + + Toolbox.prototype = { + type: ecConfig.COMPONENT_TYPE_TOOLBOX, + _buildShape: function () { + this._iconList = []; + var toolboxOption = this.option.toolbox; + this._enableColor = toolboxOption.effectiveColor; + this._disableColor = toolboxOption.disableColor; + var feature = toolboxOption.feature; + var iconName = []; + for (var key in feature){ + if (feature[key].show) { + switch (key) { + case 'mark' : + iconName.push({ key: key, name: 'mark' }); + iconName.push({ key: key, name: 'markUndo' }); + iconName.push({ key: key, name: 'markClear' }); + break; + case 'magicType' : + for (var i = 0, l = feature[key].type.length; i < l; i++) { + feature[key].title[feature[key].type[i] + 'Chart'] + = feature[key].title[feature[key].type[i]]; + iconName.push({ key: key, name: feature[key].type[i] + 'Chart' }); + } + break; + case 'dataZoom' : + iconName.push({ key: key, name: 'dataZoom' }); + iconName.push({ key: key, name: 'dataZoomReset' }); + break; + case 'saveAsImage' : + if (this.canvasSupported) { + iconName.push({ key: key, name: 'saveAsImage' }); + } + break; + default : + iconName.push({ key: key, name: key }); + break; + } + } + } + if (iconName.length > 0) { + var name; + var key; + for (var i = 0, l = iconName.length; i < l; i++) { + name = iconName[i].name; + key = iconName[i].key; + this._iconList.push(name); + this._featureTitle[name] = feature[key].title[name] || feature[key].title; + if (feature[key].icon) { + this._featureIcon[name] = feature[key].icon[name] || feature[key].icon; + } + if (feature[key].color) { + this._featureColor[name] = feature[key].color[name] || feature[key].color; + } + } + this._itemGroupLocation = this._getItemGroupLocation(); + + this._buildBackground(); + this._buildItem(); + + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + if (this._iconShapeMap['mark']) { + this._iconDisable(this._iconShapeMap['markUndo']); + this._iconDisable(this._iconShapeMap['markClear']); + } + if (this._iconShapeMap['dataZoomReset'] && this._zoomQueue.length === 0) { + this._iconDisable(this._iconShapeMap['dataZoomReset']); + } + } + }, + + /** + * 构建所有图例元素 + */ + _buildItem: function () { + var toolboxOption = this.option.toolbox; + var iconLength = this._iconList.length; + var lastX = this._itemGroupLocation.x; + var lastY = this._itemGroupLocation.y; + var itemSize = toolboxOption.itemSize; + var itemGap = toolboxOption.itemGap; + var itemShape; + + var color = toolboxOption.color instanceof Array + ? toolboxOption.color : [toolboxOption.color]; + + var textFont = this.getFont(toolboxOption.textStyle); + var textPosition; + var textAlign; + var textBaseline; + if (toolboxOption.orient === 'horizontal') { + textPosition = this._itemGroupLocation.y / this.zr.getHeight() < 0.5 + ? 'bottom' : 'top'; + textAlign = this._itemGroupLocation.x / this.zr.getWidth() < 0.5 + ? 'left' : 'right'; + textBaseline = this._itemGroupLocation.y / this.zr.getHeight() < 0.5 + ? 'top' : 'bottom'; + } + else { + textPosition = this._itemGroupLocation.x / this.zr.getWidth() < 0.5 + ? 'right' : 'left'; + /* + textAlign = this._itemGroupLocation.x / this.zr.getWidth() < 0.5 + ? 'right' : 'left'; + textBaseline = 'top'; + */ + } + + this._iconShapeMap = {}; + var self = this; + + for (var i = 0; i < iconLength; i++) { + // 图形 + itemShape = { + type: 'icon', + zlevel: this._zlevelBase, + style: { + x: lastX, + y: lastY, + width: itemSize, + height: itemSize, + iconType: this._iconList[i], + lineWidth: 1, + strokeColor: this._featureColor[this._iconList[i]] + || color[i % color.length], + brushType: 'stroke' + }, + highlightStyle: { + lineWidth: 1, + text: toolboxOption.showTitle + ? this._featureTitle[this._iconList[i]] + : undefined, + textFont: textFont, + textPosition: textPosition, + strokeColor: this._featureColor[this._iconList[i]] + || color[i % color.length] + }, + hoverable: true, + clickable: true + }; + + if (this._featureIcon[this._iconList[i]]) { + itemShape.style.image = this._featureIcon[this._iconList[i]].replace( + new RegExp('^image:\\/\\/'), '' + ); + itemShape.style.opacity = 0.8; + itemShape.highlightStyle.opacity = 1; + itemShape.type = 'image'; + } + + if (toolboxOption.orient === 'horizontal') { + // 修正左对齐第一个或右对齐最后一个 + if (i === 0 && textAlign === 'left') { + itemShape.highlightStyle.textPosition = 'specific'; + itemShape.highlightStyle.textAlign = textAlign; + itemShape.highlightStyle.textBaseline = textBaseline; + itemShape.highlightStyle.textX = lastX; + itemShape.highlightStyle.textY = textBaseline === 'top' + ? lastY + itemSize + 10 + : lastY - 10; + } + if (i === iconLength - 1 && textAlign === 'right') { + itemShape.highlightStyle.textPosition = 'specific'; + itemShape.highlightStyle.textAlign = textAlign; + itemShape.highlightStyle.textBaseline = textBaseline; + itemShape.highlightStyle.textX = lastX + itemSize; + itemShape.highlightStyle.textY = textBaseline === 'top' + ? lastY + itemSize + 10 + : lastY - 10; + } + } + + switch(this._iconList[i]) { + case 'mark': + itemShape.onclick = self._onMark; + break; + case 'markUndo': + itemShape.onclick = self._onMarkUndo; + break; + case 'markClear': + itemShape.onclick = self._onMarkClear; + break; + case 'dataZoom': + itemShape.onclick = self._onDataZoom; + break; + case 'dataZoomReset': + itemShape.onclick = self._onDataZoomReset; + break; + case 'dataView' : + if (!this._dataView) { + var DataView = require('./dataView'); + this._dataView = new DataView( + this.ecTheme, this.messageCenter, this.zr, this.option, this.myChart + ); + } + itemShape.onclick = self._onDataView; + break; + case 'restore': + itemShape.onclick = self._onRestore; + break; + case 'saveAsImage': + itemShape.onclick = self._onSaveAsImage; + break; + default: + if (this._iconList[i].match('Chart')) { + itemShape._name = this._iconList[i].replace('Chart', ''); + /* + if (this._magicType[itemShape._name]) { + itemShape.style.strokeColor = this._enableColor; + } + */ + itemShape.onclick = self._onMagicType; + } + else { + itemShape.onclick = self._onCustomHandler; + } + break; + } + + if (itemShape.type === 'icon') { + itemShape = new IconShape(itemShape); + } + else if (itemShape.type === 'image') { + itemShape = new ImageShape(itemShape); + } + this.shapeList.push(itemShape); + this._iconShapeMap[this._iconList[i]] = itemShape; + + if (toolboxOption.orient === 'horizontal') { + lastX += itemSize + itemGap; + } + else { + lastY += itemSize + itemGap; + } + } + }, + + _buildBackground: function () { + var toolboxOption = this.option.toolbox; + var pTop = toolboxOption.padding[0]; + var pRight = toolboxOption.padding[1]; + var pBottom = toolboxOption.padding[2]; + var pLeft = toolboxOption.padding[3]; + + this.shapeList.push(new RectangleShape({ + zlevel: this._zlevelBase, + hoverable :false, + style: { + x: this._itemGroupLocation.x - pLeft, + y: this._itemGroupLocation.y - pTop, + width: this._itemGroupLocation.width + pLeft + pRight, + height: this._itemGroupLocation.height + pTop + pBottom, + brushType: toolboxOption.borderWidth === 0 ? 'fill' : 'both', + color: toolboxOption.backgroundColor, + strokeColor: toolboxOption.borderColor, + lineWidth: toolboxOption.borderWidth + } + })); + }, + + /** + * 根据选项计算图例实体的位置坐标 + */ + _getItemGroupLocation: function () { + var toolboxOption = this.option.toolbox; + var iconLength = this._iconList.length; + var itemGap = toolboxOption.itemGap; + var itemSize = toolboxOption.itemSize; + var totalWidth = 0; + var totalHeight = 0; + + if (toolboxOption.orient === 'horizontal') { + // 水平布局,计算总宽度,别忘减去最后一个的itemGap + totalWidth = (itemSize + itemGap) * iconLength - itemGap; + totalHeight = itemSize; + } + else { + // 垂直布局,计算总高度 + totalHeight = (itemSize + itemGap) * iconLength - itemGap; + totalWidth = itemSize; + } + + var x; + var zrWidth = this.zr.getWidth(); + switch (toolboxOption.x) { + case 'center' : + x = Math.floor((zrWidth - totalWidth) / 2); + break; + case 'left' : + x = toolboxOption.padding[3] + toolboxOption.borderWidth; + break; + case 'right' : + x = zrWidth + - totalWidth + - toolboxOption.padding[1] + - toolboxOption.borderWidth; + break; + default : + x = toolboxOption.x - 0; + x = isNaN(x) ? 0 : x; + break; + } + + var y; + var zrHeight = this.zr.getHeight(); + switch (toolboxOption.y) { + case 'top' : + y = toolboxOption.padding[0] + toolboxOption.borderWidth; + break; + case 'bottom' : + y = zrHeight + - totalHeight + - toolboxOption.padding[2] + - toolboxOption.borderWidth; + break; + case 'center' : + y = Math.floor((zrHeight - totalHeight) / 2); + break; + default : + y = toolboxOption.y - 0; + y = isNaN(y) ? 0 : y; + break; + } + + return { + x: x, + y: y, + width: totalWidth, + height: totalHeight + }; + }, + + __onmousemove: function (param) { + if (this._marking) { + this._markShape.style.xEnd = zrEvent.getX(param.event); + this._markShape.style.yEnd = zrEvent.getY(param.event); + this.zr.addHoverShape(this._markShape); + } + if (this._zooming) { + this._zoomShape.style.width = + zrEvent.getX(param.event) - this._zoomShape.style.x; + this._zoomShape.style.height = + zrEvent.getY(param.event) - this._zoomShape.style.y; + this.zr.addHoverShape(this._zoomShape); + this.dom.style.cursor = 'crosshair'; + } + if (this._zoomStart + && (this.dom.style.cursor != 'pointer' && this.dom.style.cursor != 'move') + ) { + this.dom.style.cursor = 'crosshair'; + } + }, + + __onmousedown: function (param) { + if (param.target) { + return; + } + this._zooming = true; + var x = zrEvent.getX(param.event); + var y = zrEvent.getY(param.event); + var zoomOption = this.option.dataZoom || {}; + this._zoomShape = new RectangleShape({ + zlevel: this._zlevelBase, + style: { + x: x, + y: y, + width: 1, + height: 1, + brushType: 'both' + }, + highlightStyle: { + lineWidth: 2, + color: zoomOption.fillerColor + || ecConfig.dataZoom.fillerColor, + strokeColor: zoomOption.handleColor + || ecConfig.dataZoom.handleColor, + brushType: 'both' + } + }); + this.zr.addHoverShape(this._zoomShape); + return true; // 阻塞全局事件 + }, + + __onmouseup: function (/*param*/) { + if (!this._zoomShape + || Math.abs(this._zoomShape.style.width) < 10 + || Math.abs(this._zoomShape.style.height) < 10 + ) { + this._zooming = false; + return true; + } + if (this._zooming && this.component.dataZoom) { + this._zooming = false; + + var zoom = this.component.dataZoom.rectZoom(this._zoomShape.style); + if (zoom) { + this._zoomQueue.push({ + start: zoom.start, + end: zoom.end, + start2: zoom.start2, + end2: zoom.end2 + }); + this._iconEnable(this._iconShapeMap['dataZoomReset']); + this.zr.refresh(); + } + } + return true; // 阻塞全局事件 + }, + + __onclick: function (param) { + if (param.target) { + return; + } + if (this._marking) { + this._marking = false; + this._markShapeList.push(this._markShape); + this._iconEnable(this._iconShapeMap['markUndo']); + this._iconEnable(this._iconShapeMap['markClear']); + this.zr.addShape(this._markShape); + this.zr.refresh(); + } + else if (this._markStart) { + this._marking = true; + var x = zrEvent.getX(param.event); + var y = zrEvent.getY(param.event); + this._markShape = new LineShape({ + zlevel: this._zlevelBase, + style: { + xStart: x, + yStart: y, + xEnd: x, + yEnd: y, + lineWidth: this.query( + this.option, + 'toolbox.feature.mark.lineStyle.width' + ), + strokeColor: this.query( + this.option, + 'toolbox.feature.mark.lineStyle.color' + ), + lineType: this.query( + this.option, + 'toolbox.feature.mark.lineStyle.type' + ) + } + }); + this.zr.addHoverShape(this._markShape); + } + }, + + __onMark: function (param) { + var target = param.target; + if (this._marking || this._markStart) { + // 取消 + this._resetMark(); + this.zr.refresh(); + } + else { + // 启用Mark + this._resetZoom(); // mark与dataZoom互斥 + + this.zr.modShape(target.id, {style: {strokeColor: this._enableColor}}); + this.zr.refresh(); + this._markStart = true; + var self = this; + setTimeout(function (){ + self.zr + && self.zr.on(zrConfig.EVENT.CLICK, self._onclick) + && self.zr.on(zrConfig.EVENT.MOUSEMOVE, self._onmousemove); + }, 10); + } + return true; // 阻塞全局事件 + }, + + __onMarkUndo: function () { + if (this._marking) { + this._marking = false; + } else { + var len = this._markShapeList.length; + if (len >= 1) { + var target = this._markShapeList[len - 1]; + this.zr.delShape(target.id); + this.zr.refresh(); + this._markShapeList.pop(); + if (len === 1) { + this._iconDisable(this._iconShapeMap['markUndo']); + this._iconDisable(this._iconShapeMap['markClear']); + } + } + } + return true; + }, + + __onMarkClear: function () { + if (this._marking) { + this._marking = false; + } + var len = this._markShapeList.length; + if (len > 0) { + while(len--) { + this.zr.delShape(this._markShapeList.pop().id); + } + this._iconDisable(this._iconShapeMap['markUndo']); + this._iconDisable(this._iconShapeMap['markClear']); + this.zr.refresh(); + } + return true; + }, + + __onDataZoom: function (param) { + var target = param.target; + if (this._zooming || this._zoomStart) { + // 取消 + this._resetZoom(); + this.zr.refresh(); + this.dom.style.cursor = 'default'; + } + else { + // 启用Zoom + this._resetMark(); // mark与dataZoom互斥 + + this.zr.modShape(target.id, {style: {strokeColor: this._enableColor}}); + this.zr.refresh(); + this._zoomStart = true; + var self = this; + setTimeout(function (){ + self.zr + && self.zr.on(zrConfig.EVENT.MOUSEDOWN, self._onmousedown) + && self.zr.on(zrConfig.EVENT.MOUSEUP, self._onmouseup) + && self.zr.on(zrConfig.EVENT.MOUSEMOVE, self._onmousemove); + }, 10); + + this.dom.style.cursor = 'crosshair'; + } + return true; // 阻塞全局事件 + }, + + __onDataZoomReset: function () { + if (this._zooming) { + this._zooming = false; + } + this._zoomQueue.pop(); + //console.log(this._zoomQueue) + if (this._zoomQueue.length > 0) { + this.component.dataZoom.absoluteZoom( + this._zoomQueue[this._zoomQueue.length - 1] + ); + } + else { + this.component.dataZoom.rectZoom(); + this._iconDisable(this._iconShapeMap['dataZoomReset']); + this.zr.refresh(); + } + + return true; + }, + + _resetMark: function () { + this._marking = false; + if (this._markStart) { + this._markStart = false; + if (this._iconShapeMap['mark']) { + // 还原图标为未生效状态 + this.zr.modShape( + this._iconShapeMap['mark'].id, + { + style: { + strokeColor: this._iconShapeMap['mark'] + .highlightStyle + .strokeColor + } + } + ); + } + + this.zr.un(zrConfig.EVENT.CLICK, this._onclick); + this.zr.un(zrConfig.EVENT.MOUSEMOVE, this._onmousemove); + } + }, + + _resetZoom: function () { + this._zooming = false; + if (this._zoomStart) { + this._zoomStart = false; + if (this._iconShapeMap['dataZoom']) { + // 还原图标为未生效状态 + this.zr.modShape( + this._iconShapeMap['dataZoom'].id, + { + style: { + strokeColor: this._iconShapeMap['dataZoom'] + .highlightStyle + .strokeColor + } + } + ); + } + + this.zr.un(zrConfig.EVENT.MOUSEDOWN, this._onmousedown); + this.zr.un(zrConfig.EVENT.MOUSEUP, this._onmouseup); + this.zr.un(zrConfig.EVENT.MOUSEMOVE, this._onmousemove); + } + }, + + _iconDisable: function (target) { + if (target.type != 'image') { + this.zr.modShape(target.id, { + hoverable: false, + clickable: false, + style: { + strokeColor: this._disableColor + } + }); + } + else { + this.zr.modShape(target.id, { + hoverable: false, + clickable: false, + style: { + opacity: 0.3 + } + }); + } + }, + + _iconEnable: function (target) { + if (target.type != 'image') { + this.zr.modShape(target.id, { + hoverable: true, + clickable: true, + style: { + strokeColor: target.highlightStyle.strokeColor + } + }); + } + else { + this.zr.modShape(target.id, { + hoverable: true, + clickable: true, + style: { + opacity: 0.8 + } + }); + } + }, + + __onDataView: function () { + this._dataView.show(this.option); + return true; + }, + + __onRestore: function (){ + this._resetMark(); + this._resetZoom(); + this.messageCenter.dispatch(ecConfig.EVENT.RESTORE, null, null, this.myChart); + return true; + }, + + __onSaveAsImage: function () { + var saveOption = this.option.toolbox.feature.saveAsImage; + var imgType = saveOption.type || 'png'; + if (imgType != 'png' && imgType != 'jpeg') { + imgType = 'png'; + } + + var image; + if (!this.myChart.isConnected()) { + image = this.zr.toDataURL( + 'image/' + imgType, + this.option.backgroundColor + && this.option.backgroundColor.replace(' ','') === 'rgba(0,0,0,0)' + ? '#fff' : this.option.backgroundColor + ); + } + else { + image = this.myChart.getConnectedDataURL(imgType); + } + + var downloadDiv = document.createElement('div'); + downloadDiv.id = '__echarts_download_wrap__'; + downloadDiv.style.cssText = 'position:fixed;' + + 'z-index:99999;' + + 'display:block;' + + 'top:0;left:0;' + + 'background-color:rgba(33,33,33,0.5);' + + 'text-align:center;' + + 'width:100%;' + + 'height:100%;' + + 'line-height:' + + document.documentElement.clientHeight + 'px;'; + + var downloadLink = document.createElement('a'); + //downloadLink.onclick = _saveImageForIE; + downloadLink.href = image; + downloadLink.setAttribute( + 'download', + (saveOption.name + ? saveOption.name + : (this.option.title && (this.option.title.text || this.option.title.subtext)) + ? (this.option.title.text || this.option.title.subtext) + : 'ECharts') + + '.' + imgType + ); + downloadLink.innerHTML = ''; + + downloadDiv.appendChild(downloadLink); + document.body.appendChild(downloadDiv); + downloadLink = null; + downloadDiv = null; + + setTimeout(function (){ + var _d = document.getElementById('__echarts_download_wrap__'); + if (_d) { + _d.onclick = function () { + var d = document.getElementById( + '__echarts_download_wrap__' + ); + d.onclick = null; + d.innerHTML = ''; + document.body.removeChild(d); + d = null; + }; + _d = null; + } + }, 500); + + /* + function _saveImageForIE() { + window.win = window.open(image); + win.document.execCommand("SaveAs"); + win.close() + } + */ + return; + }, + + __onMagicType: function (param) { + this._resetMark(); + var itemName = param.target._name; + if (!this._magicType[itemName]) { + // 启用 + this._magicType[itemName] = true; + // 折柱互斥 + if (itemName === ecConfig.CHART_TYPE_LINE) { + this._magicType[ecConfig.CHART_TYPE_BAR] = false; + } + else if (itemName === ecConfig.CHART_TYPE_BAR) { + this._magicType[ecConfig.CHART_TYPE_LINE] = false; + } + // 堆积平铺互斥 + if (itemName === _MAGICTYPE_STACK) { + this._magicType[_MAGICTYPE_TILED] = false; + } + else if (itemName === _MAGICTYPE_TILED) { + this._magicType[_MAGICTYPE_STACK] = false; + } + this.messageCenter.dispatch( + ecConfig.EVENT.MAGIC_TYPE_CHANGED, + param.event, + { magicType: this._magicType }, + this.myChart + ); + } + + return true; + }, + + setMagicType: function (magicType) { + this._resetMark(); + this._magicType = magicType; + + !this._isSilence && this.messageCenter.dispatch( + ecConfig.EVENT.MAGIC_TYPE_CHANGED, + null, + { magicType: this._magicType }, + this.myChart + ); + }, + + // 用户自定义扩展toolbox方法 + __onCustomHandler: function (param) { + var target = param.target.style.iconType; + var featureHandler = this.option.toolbox.feature[target].onclick; + if (typeof featureHandler === 'function') { + featureHandler.call(this, this.option); + } + }, + + // 重置备份还原状态等 + reset: function (newOption, isRestore) { + isRestore && this.clear(); + + if (this.query(newOption, 'toolbox.show') + && this.query(newOption, 'toolbox.feature.magicType.show') + ) { + var magicType = newOption.toolbox.feature.magicType.type; + var len = magicType.length; + this._magicMap = {}; // 标识可控类型 + while (len--) { + this._magicMap[magicType[len]] = true; + } + + len = newOption.series.length; + var oriType; // 备份还原可控类型 + var axis; + while (len--) { + oriType = newOption.series[len].type; + if (this._magicMap[oriType]) { + axis = newOption.xAxis instanceof Array + ? newOption.xAxis[newOption.series[len].xAxisIndex || 0] + : newOption.xAxis; + if (axis && (axis.type || 'category') === 'category') { + axis.__boundaryGap = axis.boundaryGap != null + ? axis.boundaryGap : true; + } + axis = newOption.yAxis instanceof Array + ? newOption.yAxis[newOption.series[len].yAxisIndex || 0] + : newOption.yAxis; + if (axis && axis.type === 'category') { + axis.__boundaryGap = axis.boundaryGap != null + ? axis.boundaryGap : true; + } + newOption.series[len].__type = oriType; + // 避免不同类型图表类型的样式污染 + newOption.series[len].__itemStyle = zrUtil.clone( + newOption.series[len].itemStyle || {} + ); + } + + if (this._magicMap[_MAGICTYPE_STACK] || this._magicMap[_MAGICTYPE_TILED]) { + newOption.series[len].__stack = newOption.series[len].stack; + } + } + } + + this._magicType = isRestore ? {} : (this._magicType || {}); + for (var itemName in this._magicType) { + if (this._magicType[itemName]) { + this.option = newOption; + this.getMagicOption(); + break; + } + } + + // 框选缩放 + var zoomOption = newOption.dataZoom; + if (zoomOption && zoomOption.show) { + var start = zoomOption.start != null + && zoomOption.start >= 0 + && zoomOption.start <= 100 + ? zoomOption.start : 0; + var end = zoomOption.end != null + && zoomOption.end >= 0 + && zoomOption.end <= 100 + ? zoomOption.end : 100; + if (start > end) { + // 大小颠倒自动翻转 + start = start + end; + end = start - end; + start = start - end; + } + this._zoomQueue = [{ + start: start, + end: end, + start2: 0, + end2: 100 + }]; + } + else { + this._zoomQueue = []; + } + }, + + getMagicOption: function (){ + var axis; + if (this._magicType[ecConfig.CHART_TYPE_LINE] + || this._magicType[ecConfig.CHART_TYPE_BAR] + ) { + // 图表类型有切换 + var boundaryGap = this._magicType[ecConfig.CHART_TYPE_LINE] ? false : true; + for (var i = 0, l = this.option.series.length; i < l; i++) { + if (this._magicMap[this.option.series[i].type]) { + this.option.series[i].type = this._magicType[ecConfig.CHART_TYPE_LINE] + ? ecConfig.CHART_TYPE_LINE + : ecConfig.CHART_TYPE_BAR; + // 避免不同类型图表类型的样式污染 + this.option.series[i].itemStyle = zrUtil.clone( + this.option.series[i].__itemStyle + ); + + axis = this.option.xAxis instanceof Array + ? this.option.xAxis[this.option.series[i].xAxisIndex || 0] + : this.option.xAxis; + if (axis && (axis.type || 'category') === 'category') { + axis.boundaryGap = boundaryGap ? true : axis.__boundaryGap; + } + axis = this.option.yAxis instanceof Array + ? this.option.yAxis[this.option.series[i].yAxisIndex || 0] + : this.option.yAxis; + if (axis && axis.type === 'category') { + axis.boundaryGap = boundaryGap ? true : axis.__boundaryGap; + } + } + } + } + + if (this._magicType[_MAGICTYPE_STACK] || this._magicType[_MAGICTYPE_TILED]) { + // 有堆积平铺切换 + for (var i = 0, l = this.option.series.length; i < l; i++) { + if (this._magicType[_MAGICTYPE_STACK]) { + // 启用堆积 + this.option.series[i].stack = '_ECHARTS_STACK_KENER_2014_'; + } + else if (this._magicType[_MAGICTYPE_TILED]) { + // 启用平铺 + this.option.series[i].stack = null; + } + } + } + + return this.option; + }, + + silence: function (s) { + this._isSilence = s; + }, + + resize: function () { + this._resetMark(); + this.clear(); + if (this.option && this.option.toolbox && this.option.toolbox.show) { + this._buildShape(); + } + if (this._dataView) { + this._dataView.resize(); + } + }, + + hideDataView: function () { + if (this._dataView) { + this._dataView.hide(); + } + }, + + clear: function(notMark) { + if (this.zr) { + this.zr.delShape(this.shapeList); + this.shapeList = []; + + if (!notMark) { + this.zr.delShape(this._markShapeList); + this._markShapeList = []; + } + } + }, + + /** + * 释放后实例不可用 + */ + dispose: function () { + if (this._dataView) { + this._dataView.dispose(); + this._dataView = null; + } + this.clear(); + this.shapeList = null; + this._markShapeList = null; + }, + + /** + * 刷新 + */ + refresh: function (newOption) { + if (newOption) { + this._resetMark(); + this._resetZoom(); + + newOption.toolbox = this.reformOption(newOption.toolbox); + // 补全padding属性 + newOption.toolbox.padding = this.reformCssArray( + newOption.toolbox.padding + ); + this.option = newOption; + + this.clear(true); + + if (newOption.toolbox.show) { + this._buildShape(); + } + + this.hideDataView(); + } + } + }; + + zrUtil.inherits(Toolbox, Base); + + require('../component').define('toolbox', Toolbox); + + return Toolbox; +}); + +/** + * echarts组件:图表标题 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/component/title',['require','./base','zrender/shape/Text','zrender/shape/Rectangle','../config','zrender/tool/util','zrender/tool/area','zrender/tool/color','../component'],function (require) { + var Base = require('./base'); + + // 图形依赖 + var TextShape = require('zrender/shape/Text'); + var RectangleShape = require('zrender/shape/Rectangle'); + + var ecConfig = require('../config'); + var zrUtil = require('zrender/tool/util'); + var zrArea = require('zrender/tool/area'); + var zrColor = require('zrender/tool/color'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} option 图表参数 + */ + function Title(ecTheme, messageCenter, zr, option, myChart) { + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + + this.refresh(option); + } + + Title.prototype = { + type: ecConfig.COMPONENT_TYPE_TITLE, + _buildShape: function () { + // 标题元素组的位置参数,通过计算所得x, y, width, height + this._itemGroupLocation = this._getItemGroupLocation(); + + this._buildBackground(); + this._buildItem(); + + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + }, + + /** + * 构建所有标题元素 + */ + _buildItem: function () { + var text = this.titleOption.text; + var link = this.titleOption.link; + var target = this.titleOption.target; + var subtext = this.titleOption.subtext; + var sublink = this.titleOption.sublink; + var subtarget = this.titleOption.subtarget; + var font = this.getFont(this.titleOption.textStyle); + var subfont = this.getFont(this.titleOption.subtextStyle); + + var x = this._itemGroupLocation.x; + var y = this._itemGroupLocation.y; + var width = this._itemGroupLocation.width; + var height = this._itemGroupLocation.height; + + var textShape = { + zlevel: this._zlevelBase, + style: { + y: y, + color: this.titleOption.textStyle.color, + text: text, + textFont: font, + textBaseline: 'top' + }, + highlightStyle: { + color: zrColor.lift(this.titleOption.textStyle.color, 1), + brushType: 'fill' + }, + hoverable: false + }; + if (link) { + textShape.hoverable = true; + textShape.clickable = true; + textShape.onclick = function (){ + if (!target || target != 'self') { + window.open(link); + } + else { + window.location = link; + } + }; + } + + var subtextShape = { + zlevel: this._zlevelBase, + style: { + y: y + height, + color: this.titleOption.subtextStyle.color, + text: subtext, + textFont: subfont, + textBaseline: 'bottom' + }, + highlightStyle: { + color: zrColor.lift(this.titleOption.subtextStyle.color, 1), + brushType: 'fill' + }, + hoverable: false + }; + if (sublink) { + subtextShape.hoverable = true; + subtextShape.clickable = true; + subtextShape.onclick = function (){ + if (!subtarget || subtarget != 'self') { + window.open(sublink); + } + else { + window.location = sublink; + } + }; + } + + switch (this.titleOption.x) { + case 'center' : + textShape.style.x = subtextShape.style.x = x + width / 2; + textShape.style.textAlign = subtextShape.style.textAlign + = 'center'; + break; + case 'left' : + textShape.style.x = subtextShape.style.x = x; + textShape.style.textAlign = subtextShape.style.textAlign + = 'left'; + break; + case 'right' : + textShape.style.x = subtextShape.style.x = x + width; + textShape.style.textAlign = subtextShape.style.textAlign + = 'right'; + break; + default : + x = this.titleOption.x - 0; + x = isNaN(x) ? 0 : x; + textShape.style.x = subtextShape.style.x = x; + break; + } + + if (this.titleOption.textAlign) { + textShape.style.textAlign = subtextShape.style.textAlign + = this.titleOption.textAlign; + } + + this.shapeList.push(new TextShape(textShape)); + subtext !== '' && this.shapeList.push(new TextShape(subtextShape)); + }, + + _buildBackground: function () { + var pTop = this.titleOption.padding[0]; + var pRight = this.titleOption.padding[1]; + var pBottom = this.titleOption.padding[2]; + var pLeft = this.titleOption.padding[3]; + + this.shapeList.push(new RectangleShape({ + zlevel: this._zlevelBase, + hoverable :false, + style: { + x: this._itemGroupLocation.x - pLeft, + y: this._itemGroupLocation.y - pTop, + width: this._itemGroupLocation.width + pLeft + pRight, + height: this._itemGroupLocation.height + pTop + pBottom, + brushType: this.titleOption.borderWidth === 0 ? 'fill' : 'both', + color: this.titleOption.backgroundColor, + strokeColor: this.titleOption.borderColor, + lineWidth: this.titleOption.borderWidth + } + })); + }, + + /** + * 根据选项计算标题实体的位置坐标 + */ + _getItemGroupLocation: function () { + var text = this.titleOption.text; + var subtext = this.titleOption.subtext; + var font = this.getFont(this.titleOption.textStyle); + var subfont = this.getFont(this.titleOption.subtextStyle); + + var totalWidth = Math.max( + zrArea.getTextWidth(text, font), + zrArea.getTextWidth(subtext, subfont) + ); + var totalHeight = zrArea.getTextHeight(text, font) + + (subtext === '' + ? 0 + : (this.titleOption.itemGap + + zrArea.getTextHeight(subtext, subfont)) + ); + + var x; + var zrWidth = this.zr.getWidth(); + switch (this.titleOption.x) { + case 'center' : + x = Math.floor((zrWidth - totalWidth) / 2); + break; + case 'left' : + x = this.titleOption.padding[3] + this.titleOption.borderWidth; + break; + case 'right' : + x = zrWidth + - totalWidth + - this.titleOption.padding[1] + - this.titleOption.borderWidth; + break; + default : + x = this.titleOption.x - 0; + x = isNaN(x) ? 0 : x; + break; + } + + var y; + var zrHeight = this.zr.getHeight(); + switch (this.titleOption.y) { + case 'top' : + y = this.titleOption.padding[0] + this.titleOption.borderWidth; + break; + case 'bottom' : + y = zrHeight + - totalHeight + - this.titleOption.padding[2] + - this.titleOption.borderWidth; + break; + case 'center' : + y = Math.floor((zrHeight - totalHeight) / 2); + break; + default : + y = this.titleOption.y - 0; + y = isNaN(y) ? 0 : y; + break; + } + + return { + x: x, + y: y, + width: totalWidth, + height: totalHeight + }; + }, + + /** + * 刷新 + */ + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + + this.option.title = this.reformOption(this.option.title); + // 补全padding属性 + this.option.title.padding = this.reformCssArray( + this.option.title.padding + ); + + this.titleOption = this.option.title; + this.titleOption.textStyle = zrUtil.merge( + this.titleOption.textStyle, + this.ecTheme.textStyle + ); + this.titleOption.subtextStyle = zrUtil.merge( + this.titleOption.subtextStyle, + this.ecTheme.textStyle + ); + } + + this.clear(); + this._buildShape(); + } + }; + + zrUtil.inherits(Title, Base); + + require('../component').define('title', Title); + + return Title; +}); + + + +/** + * zrender + * + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + * shape类:十字准星 + * 可配图形属性: + { + // 基础属性 + shape : 'cross', // 必须,shape类标识,需要显式指定 + id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 + zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 + invisible : {boolean}, // 默认为false,是否可见 + + // 样式属性,默认状态样式样式属性 + style : { + rect : {Object}, // 必须,对角框 + x : {number}, // 必须,横坐标 + y : {number}, // 必须,纵坐标 + }, + + // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 + highlightStyle : { + // 同style + } + + // 交互属性,详见shape.Base + + // 事件属性,详见shape.Base + } + */ +define('echarts/util/shape/Cross',['require','zrender/shape/Base','zrender/shape/Line','zrender/tool/util','./normalIsCover'],function (require) { + var Base = require('zrender/shape/Base'); + var LineShape = require('zrender/shape/Line'); + var zrUtil = require('zrender/tool/util'); + + function Cross(options) { + Base.call(this, options); + } + + Cross.prototype = { + type : 'cross', + + /** + * 创建矩形路径 + * @param {Context2D} ctx Canvas 2D上下文 + * @param {Object} style 样式 + */ + buildPath : function (ctx, style) { + var rect = style.rect; + style.xStart = rect.x; + style.xEnd = rect.x + rect.width; + style.yStart = style.yEnd = style.y; + LineShape.prototype.buildPath(ctx, style); + style.xStart = style.xEnd = style.x; + style.yStart = rect.y; + style.yEnd = rect.y + rect.height; + LineShape.prototype.buildPath(ctx, style); + }, + + /** + * 返回矩形区域,用于局部刷新和文字定位 + * @param {Object} style + */ + getRect : function (style) { + return style.rect; + }, + + isCover : require('./normalIsCover') + }; + + zrUtil.inherits(Cross, Base); + + return Cross; +}); + +/** + * echarts组件:提示框 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zrender/shape/Line','zrender/shape/Rectangle','../config','../util/ecData','zrender/config','zrender/tool/event','zrender/tool/area','zrender/tool/color','zrender/tool/util','zrender/shape/Base','../component'],function (require) { + var Base = require('./base'); + + // 图形依赖 + var CrossShape = require('../util/shape/Cross'); + var LineShape = require('zrender/shape/Line'); + var RectangleShape = require('zrender/shape/Rectangle'); + var rectangleInstance = new RectangleShape({}); + + var ecConfig = require('../config'); + var ecData = require('../util/ecData'); + var zrConfig = require('zrender/config'); + var zrEvent = require('zrender/tool/event'); + var zrArea = require('zrender/tool/area'); + var zrColor = require('zrender/tool/color'); + var zrUtil = require('zrender/tool/util'); + var zrShapeBase = require('zrender/shape/Base'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} option 提示框参数 + * @param {HtmlElement} dom 目标对象 + * @param {ECharts} myChart 当前图表实例 + */ + function Tooltip(ecTheme, messageCenter, zr, option, myChart) { + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + + this.dom = myChart.dom; + + var self = this; + self._onmousemove = function (param) { + return self.__onmousemove(param); + }; + self._onglobalout = function (param) { + return self.__onglobalout(param); + }; + + this.zr.on(zrConfig.EVENT.MOUSEMOVE, self._onmousemove); + this.zr.on(zrConfig.EVENT.GLOBALOUT, self._onglobalout); + + self._hide = function (param) { + return self.__hide(param); + }; + self._tryShow = function(param) { + return self.__tryShow(param); + }; + self._refixed = function(param) { + return self.__refixed(param); + }; + + self._setContent = function(ticket, res) { + return self.__setContent(ticket, res); + }; + + this._tDom = this._tDom || document.createElement('div'); + // 避免拖拽时页面选中的尴尬 + this._tDom.onselectstart = function() { + return false; + }; + this._tDom.style.position = 'absolute'; // 不是多余的,别删! + this.hasAppend = false; + + this._axisLineShape && this.zr.delShape(this._axisLineShape.id); + this._axisLineShape = new LineShape({ + zlevel: this._zlevelBase, + invisible: true, + hoverable: false + }); + this.shapeList.push(this._axisLineShape); + this.zr.addShape(this._axisLineShape); + + this._axisShadowShape && this.zr.delShape(this._axisShadowShape.id); + this._axisShadowShape = new LineShape({ + zlevel: 1, // grid上,chart下 + invisible: true, + hoverable: false + }); + this.shapeList.push(this._axisShadowShape); + this.zr.addShape(this._axisShadowShape); + + this._axisCrossShape && this.zr.delShape(this._axisCrossShape.id); + this._axisCrossShape = new CrossShape({ + zlevel: this._zlevelBase, + invisible: true, + hoverable: false + }); + this.shapeList.push(this._axisCrossShape); + this.zr.addShape(this._axisCrossShape); + + this.showing = false; + this.refresh(option); + } + + Tooltip.prototype = { + type: ecConfig.COMPONENT_TYPE_TOOLTIP, + // 通用样式 + _gCssText: 'position:absolute;display:block;border-style:solid;white-space:nowrap;', + /** + * 根据配置设置dom样式 + */ + _style: function (opt) { + if (!opt) { + return ''; + } + var cssText = []; + if (opt.transitionDuration) { + var transitionText = 'left ' + opt.transitionDuration + 's,' + + 'top ' + opt.transitionDuration + 's'; + cssText.push( + 'transition:' + transitionText + ); + cssText.push( + '-moz-transition:' + transitionText + ); + cssText.push( + '-webkit-transition:' + transitionText + ); + cssText.push( + '-o-transition:' + transitionText + ); + } + + if (opt.backgroundColor) { + // for sb ie~ + cssText.push( + 'background-Color:' + zrColor.toHex( + opt.backgroundColor + ) + ); + cssText.push('filter:alpha(opacity=70)'); + cssText.push('background-Color:' + opt.backgroundColor); + } + + if (opt.borderWidth != null) { + cssText.push('border-width:' + opt.borderWidth + 'px'); + } + + if (opt.borderColor != null) { + cssText.push('border-color:' + opt.borderColor); + } + + if (opt.borderRadius != null) { + cssText.push( + 'border-radius:' + opt.borderRadius + 'px' + ); + cssText.push( + '-moz-border-radius:' + opt.borderRadius + 'px' + ); + cssText.push( + '-webkit-border-radius:' + opt.borderRadius + 'px' + ); + cssText.push( + '-o-border-radius:' + opt.borderRadius + 'px' + ); + } + + var textStyle = opt.textStyle; + if (textStyle) { + textStyle.color && cssText.push('color:' + textStyle.color); + textStyle.decoration && cssText.push( + 'text-decoration:' + textStyle.decoration + ); + textStyle.align && cssText.push( + 'text-align:' + textStyle.align + ); + textStyle.fontFamily && cssText.push( + 'font-family:' + textStyle.fontFamily + ); + textStyle.fontSize && cssText.push( + 'font-size:' + textStyle.fontSize + 'px' + ); + textStyle.fontSize && cssText.push( + 'line-height:' + Math.round(textStyle.fontSize*3/2) + 'px' + ); + textStyle.fontStyle && cssText.push( + 'font-style:' + textStyle.fontStyle + ); + textStyle.fontWeight && cssText.push( + 'font-weight:' + textStyle.fontWeight + ); + } + + + var padding = opt.padding; + if (padding != null) { + padding = this.reformCssArray(padding); + cssText.push( + 'padding:' + padding[0] + 'px ' + + padding[1] + 'px ' + + padding[2] + 'px ' + + padding[3] + 'px' + ); + } + + cssText = cssText.join(';') + ';'; + + return cssText; + }, + + __hide: function () { + if (this._tDom) { + this._tDom.style.display = 'none'; + } + var needRefresh = false; + if (!this._axisLineShape.invisible) { + this._axisLineShape.invisible = true; + this.zr.modShape(this._axisLineShape.id); + needRefresh = true; + } + if (!this._axisShadowShape.invisible) { + this._axisShadowShape.invisible = true; + this.zr.modShape(this._axisShadowShape.id); + needRefresh = true; + } + if (!this._axisCrossShape.invisible) { + this._axisCrossShape.invisible = true; + this.zr.modShape(this._axisCrossShape.id); + needRefresh = true; + } + if (this._lastTipShape && this._lastTipShape.tipShape.length > 0) { + this.zr.delShape(this._lastTipShape.tipShape); + this._lastTipShape = false; + this.shapeList.length = 2; + } + needRefresh && this.zr.refresh(); + this.showing = false; + }, + + _show: function (position, x, y, specialCssText) { + var domHeight = this._tDom.offsetHeight; + var domWidth = this._tDom.offsetWidth; + if (position) { + if (typeof position === 'function') { + position = position([x, y]); + } + if (position instanceof Array) { + x = position[0]; + y = position[1]; + } + } + if (x + domWidth > this._zrWidth) { + // 太靠右 + //x = this._zrWidth - domWidth; + x -= (domWidth + 40); + } + if (y + domHeight > this._zrHeight) { + // 太靠下 + //y = this._zrHeight - domHeight; + y -= (domHeight - 20); + } + if (y < 20) { + y = 0; + } + this._tDom.style.cssText = this._gCssText + + this._defaultCssText + + (specialCssText ? specialCssText : '') + + 'left:' + x + 'px;top:' + y + 'px;'; + + if (domHeight < 10 || domWidth < 10) { + // this._zrWidth - x < 100 || this._zrHeight - y < 100 + setTimeout(this._refixed, 20); + } + this.showing = true; + }, + + __refixed: function () { + if (this._tDom) { + var cssText = ''; + var domHeight = this._tDom.offsetHeight; + var domWidth = this._tDom.offsetWidth; + if (this._tDom.offsetLeft + domWidth > this._zrWidth) { + cssText += 'left:' + (this._zrWidth - domWidth - 20) + 'px;'; + } + if (this._tDom.offsetTop + domHeight > this._zrHeight) { + cssText += 'top:' + (this._zrHeight - domHeight - 10) + 'px;'; + } + if (cssText !== '') { + this._tDom.style.cssText += cssText; + } + } + }, + + __tryShow: function () { + var needShow; + var trigger; + if (!this._curTarget) { + // 坐标轴事件 + this._findPolarTrigger() || this._findAxisTrigger(); + } + else { + // 数据项事件 + if (this._curTarget._type === 'island' && this.option.tooltip.show) { + this._showItemTrigger(); + return; + } + var serie = ecData.get(this._curTarget, 'series'); + var data = ecData.get(this._curTarget, 'data'); + needShow = this.deepQuery( + [data, serie, this.option], + 'tooltip.show' + ); + if (serie == null || data == null || !needShow) { + // 不响应tooltip的数据对象延时隐藏 + clearTimeout(this._hidingTicket); + clearTimeout(this._showingTicket); + this._hidingTicket = setTimeout(this._hide, this._hideDelay); + } + else { + trigger = this.deepQuery( + [data, serie, this.option], + 'tooltip.trigger' + ); + + trigger === 'axis' + ? this._showAxisTrigger( + serie.xAxisIndex, serie.yAxisIndex, + ecData.get(this._curTarget, 'dataIndex') + ) + : this._showItemTrigger(); + } + } + }, + + /** + * 直角系 + */ + _findAxisTrigger: function () { + if (!this.component.xAxis || !this.component.yAxis) { + this._hidingTicket = setTimeout(this._hide, this._hideDelay); + return; + } + var series = this.option.series; + var xAxisIndex; + var yAxisIndex; + for (var i = 0, l = series.length; i < l; i++) { + // 找到第一个axis触发tooltip的系列 + if (this.deepQuery([series[i], this.option], 'tooltip.trigger') === 'axis') { + xAxisIndex = series[i].xAxisIndex || 0; + yAxisIndex = series[i].yAxisIndex || 0; + if (this.component.xAxis.getAxis(xAxisIndex) + && this.component.xAxis.getAxis(xAxisIndex).type + === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + ) { + // 横轴为类目轴 + this._showAxisTrigger(xAxisIndex, yAxisIndex, + this._getNearestDataIndex( + 'x', this.component.xAxis.getAxis(xAxisIndex) + ) + ); + return; + } + else if (this.component.yAxis.getAxis(yAxisIndex) + && this.component.yAxis.getAxis(yAxisIndex).type + === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + ) { + // 纵轴为类目轴 + this._showAxisTrigger(xAxisIndex, yAxisIndex, + this._getNearestDataIndex( + 'y', this.component.yAxis.getAxis(yAxisIndex) + ) + ); + return; + } + else { + // 双数值轴 + this._showAxisTrigger(xAxisIndex, yAxisIndex, -1); + return; + } + } + } + if (this.option.tooltip.axisPointer.type === 'cross') { + this._showAxisTrigger(-1, -1, -1); + } + }, + + /** + * 极坐标 + */ + _findPolarTrigger: function () { + if (!this.component.polar) { + return false; + } + var x = zrEvent.getX(this._event); + var y = zrEvent.getY(this._event); + var polarIndex = this.component.polar.getNearestIndex([x, y]); + var valueIndex; + if (polarIndex) { + valueIndex = polarIndex.valueIndex; + polarIndex = polarIndex.polarIndex; + } + else { + polarIndex = -1; + } + + if (polarIndex != -1) { + return this._showPolarTrigger(polarIndex, valueIndex); + } + + return false; + }, + + /** + * 根据坐标轴事件带的属性获取最近的axisDataIndex + */ + _getNearestDataIndex: function (direction, categoryAxis) { + var dataIndex = -1; + var x = zrEvent.getX(this._event); + var y = zrEvent.getY(this._event); + if (direction === 'x') { + // 横轴为类目轴 + var left; + var right; + var xEnd = this.component.grid.getXend(); + var curCoord = categoryAxis.getCoordByIndex(dataIndex); + while (curCoord < xEnd) { + right = curCoord; + if (curCoord <= x) { + left = curCoord; + } + else { + break; + } + curCoord = categoryAxis.getCoordByIndex(++dataIndex); + } + if (dataIndex <= 0) { + dataIndex = 0; + } + else if (x - left <= right - x) { + dataIndex -= 1; + } + else { + // 离右边近,看是否为最后一个 + if (categoryAxis.getNameByIndex(dataIndex) == null) { + dataIndex -= 1; + } + } + return dataIndex; + } + else { + // 纵轴为类目轴 + var top; + var bottom; + var yStart = this.component.grid.getY(); + var curCoord = categoryAxis.getCoordByIndex(dataIndex); + while (curCoord > yStart) { + top = curCoord; + if (curCoord >= y) { + bottom = curCoord; + } + else { + break; + } + curCoord = categoryAxis.getCoordByIndex(++dataIndex); + } + + if (dataIndex <= 0) { + dataIndex = 0; + } + else if (y - top >= bottom - y) { + dataIndex -= 1; + } + else { + // 离上方边近,看是否为最后一个 + if (categoryAxis.getNameByIndex(dataIndex) == null) { + dataIndex -= 1; + } + } + return dataIndex; + } + return -1; + }, + + /** + * 直角系 + */ + _showAxisTrigger: function (xAxisIndex, yAxisIndex, dataIndex) { + !this._event.connectTrigger && this.messageCenter.dispatch( + ecConfig.EVENT.TOOLTIP_IN_GRID, + this._event, + null, + this.myChart + ); + if (this.component.xAxis == null + || this.component.yAxis == null + || xAxisIndex == null + || yAxisIndex == null + // || dataIndex < 0 + ) { + // 不响应tooltip的数据对象延时隐藏 + clearTimeout(this._hidingTicket); + clearTimeout(this._showingTicket); + this._hidingTicket = setTimeout(this._hide, this._hideDelay); + return; + } + var series = this.option.series; + var seriesArray = []; + var seriesIndex = []; + var categoryAxis; + var x; + var y; + + var formatter; + var position; + var showContent; + var specialCssText = ''; + if (this.option.tooltip.trigger === 'axis') { + if (!this.option.tooltip.show) { + return; + } + formatter = this.option.tooltip.formatter; + position = this.option.tooltip.position; + } + + if (xAxisIndex != -1 + && this.component.xAxis.getAxis(xAxisIndex).type + === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + ) { + // 横轴为类目轴,找到所有用这条横轴并且axis触发的系列数据 + categoryAxis = this.component.xAxis.getAxis(xAxisIndex); + for (var i = 0, l = series.length; i < l; i++) { + if (!this._isSelected(series[i].name)) { + continue; + } + if (series[i].xAxisIndex === xAxisIndex + && this.deepQuery([series[i], this.option], 'tooltip.trigger') === 'axis' + ) { + showContent = this.query(series[i], 'tooltip.showContent') + || showContent; + formatter = this.query(series[i], 'tooltip.formatter') + || formatter; + position = this.query(series[i], 'tooltip.position') + || position; + + specialCssText += this._style(this.query(series[i], 'tooltip')); + if (series[i].stack != null) { + seriesArray.unshift(series[i]); + seriesIndex.unshift(i); + } + else { + seriesArray.push(series[i]); + seriesIndex.push(i); + } + } + } + + // 寻找高亮元素 + this.messageCenter.dispatch( + ecConfig.EVENT.TOOLTIP_HOVER, + this._event, + { + seriesIndex: seriesIndex, + dataIndex: dataIndex + }, + this.myChart + ); + y = zrEvent.getY(this._event); + x = this.subPixelOptimize( + categoryAxis.getCoordByIndex(dataIndex), + this._axisLineWidth + ); + this._styleAxisPointer( + seriesArray, + x, this.component.grid.getY(), + x, this.component.grid.getYend(), + categoryAxis.getGap(), x, y + ); + } + else if (yAxisIndex != -1 + && this.component.yAxis.getAxis(yAxisIndex).type + === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + ) { + // 纵轴为类目轴,找到所有用这条纵轴并且axis触发的系列数据 + categoryAxis = this.component.yAxis.getAxis(yAxisIndex); + for (var i = 0, l = series.length; i < l; i++) { + if (!this._isSelected(series[i].name)) { + continue; + } + if (series[i].yAxisIndex === yAxisIndex + && this.deepQuery([series[i], this.option], 'tooltip.trigger') === 'axis' + ) { + showContent = this.query(series[i], 'tooltip.showContent') + || showContent; + formatter = this.query(series[i], 'tooltip.formatter') + || formatter; + position = this.query(series[i], 'tooltip.position') + || position; + specialCssText += this._style(this.query(series[i], 'tooltip')); + seriesArray.push(series[i]); + seriesIndex.push(i); + } + } + // 寻找高亮元素 + this.messageCenter.dispatch( + ecConfig.EVENT.TOOLTIP_HOVER, + this._event, + { + seriesIndex: seriesIndex, + dataIndex: dataIndex + }, + this.myChart + ); + x = zrEvent.getX(this._event); + y = this.subPixelOptimize( + categoryAxis.getCoordByIndex(dataIndex), + this._axisLineWidth + ); + this._styleAxisPointer( + seriesArray, + this.component.grid.getX(), y, + this.component.grid.getXend(), y, + categoryAxis.getGap(), x, y + ); + } + else { + // 双数值轴 + x = zrEvent.getX(this._event); + y = zrEvent.getY(this._event); + this._styleAxisPointer( + series, + this.component.grid.getX(), y, + this.component.grid.getXend(), y, + 0, x, y + ); + if (dataIndex >= 0) { + this._showItemTrigger(); + } + else { + clearTimeout(this._hidingTicket); + clearTimeout(this._showingTicket); + this._tDom.style.display = 'none'; + } + } + + if (seriesArray.length > 0) { + var data; + if (typeof formatter === 'function') { + var params = []; + for (var i = 0, l = seriesArray.length; i < l; i++) { + data = seriesArray[i].data[dataIndex]; + data = data != null + ? (data.value != null + ? data.value + : data) + : '-'; + + params.push([ + seriesArray[i].name || '', + categoryAxis.getNameByIndex(dataIndex), + data + ]); + } + this._curTicket = 'axis:' + dataIndex; + this._tDom.innerHTML = formatter.call( + this.myChart, params, this._curTicket, this._setContent + ); + } + else if (typeof formatter === 'string') { + this._curTicket = NaN; + formatter = formatter.replace('{a}','{a0}') + .replace('{b}','{b0}') + .replace('{c}','{c0}'); + for (var i = 0, l = seriesArray.length; i < l; i++) { + formatter = formatter.replace( + '{a' + i + '}', + this._encodeHTML(seriesArray[i].name || '') + ); + formatter = formatter.replace( + '{b' + i + '}', + this._encodeHTML(categoryAxis.getNameByIndex(dataIndex)) + ); + data = seriesArray[i].data[dataIndex]; + data = data != null + ? (data.value != null + ? data.value + : data) + : '-'; + formatter = formatter.replace( + '{c' + i + '}', + data instanceof Array + ? data : this.numAddCommas(data) + ); + } + this._tDom.innerHTML = formatter; + } + else { + this._curTicket = NaN; + formatter = this._encodeHTML( + categoryAxis.getNameByIndex(dataIndex) + ); + + for (var i = 0, l = seriesArray.length; i < l; i++) { + formatter += '
' + + this._encodeHTML(seriesArray[i].name || '') + + ' : '; + data = seriesArray[i].data[dataIndex]; + data = data != null + ? (data.value != null + ? data.value + : data) + : '-'; + formatter += data instanceof Array + ? data : this.numAddCommas(data); + } + this._tDom.innerHTML = formatter; + } + + // don't modify, just false, showContent == undefined == true + if (showContent === false || !this.option.tooltip.showContent) { + // 只用tooltip的行为,不显示主体 + return; + } + + if (!this.hasAppend) { + this._tDom.style.left = this._zrWidth / 2 + 'px'; + this._tDom.style.top = this._zrHeight / 2 + 'px'; + this.dom.firstChild.appendChild(this._tDom); + this.hasAppend = true; + } + this._show(position, x + 10, y + 10, specialCssText); + } + }, + + /** + * 极坐标 + */ + _showPolarTrigger: function (polarIndex, dataIndex) { + if (this.component.polar == null + || polarIndex == null + || dataIndex == null + || dataIndex < 0 + ) { + return false; + } + var series = this.option.series; + var seriesArray = []; + + var formatter; + var position; + var showContent; + var specialCssText = ''; + if (this.option.tooltip.trigger === 'axis') { + if (!this.option.tooltip.show) { + return false; + } + formatter = this.option.tooltip.formatter; + position = this.option.tooltip.position; + } + var indicatorName = this.option.polar[polarIndex].indicator[dataIndex].text; + + // 找到所有用这个极坐标并且axis触发的系列数据 + for (var i = 0, l = series.length; i < l; i++) { + if (!this._isSelected(series[i].name)) { + continue; + } + if (series[i].polarIndex === polarIndex + && this.deepQuery([series[i], this.option], 'tooltip.trigger') === 'axis' + ) { + showContent = this.query(series[i], 'tooltip.showContent') + || showContent; + formatter = this.query(series[i], 'tooltip.formatter') + || formatter; + position = this.query(series[i], 'tooltip.position') + || position; + specialCssText += this._style(this.query(series[i], 'tooltip')); + seriesArray.push(series[i]); + } + } + if (seriesArray.length > 0) { + var polarData; + var data; + var params = []; + + for (var i = 0, l = seriesArray.length; i < l; i++) { + polarData = seriesArray[i].data; + for (var j = 0, k = polarData.length; j < k; j++) { + data = polarData[j]; + if (!this._isSelected(data.name)) { + continue; + } + data = data != null + ? data + : {name:'', value: {dataIndex:'-'}}; + + params.push([ + seriesArray[i].name || '', + data.name, + data.value[dataIndex].value != null + ? data.value[dataIndex].value : data.value[dataIndex], + indicatorName + ]); + } + } + if (params.length <= 0) { + return; + } + if (typeof formatter === 'function') { + this._curTicket = 'axis:' + dataIndex; + this._tDom.innerHTML = formatter.call( + this.myChart, params, this._curTicket, this._setContent + ); + } + else if (typeof formatter === 'string') { + formatter = formatter.replace('{a}','{a0}') + .replace('{b}','{b0}') + .replace('{c}','{c0}') + .replace('{d}','{d0}'); + for (var i = 0, l = params.length; i < l; i++) { + formatter = formatter.replace( + '{a' + i + '}', + this._encodeHTML(params[i][0]) + ); + formatter = formatter.replace( + '{b' + i + '}', + this._encodeHTML(params[i][1]) + ); + formatter = formatter.replace( + '{c' + i + '}', + this.numAddCommas(params[i][2]) + ); + formatter = formatter.replace( + '{d' + i + '}', + this._encodeHTML(params[i][3]) + ); + } + this._tDom.innerHTML = formatter; + } + else { + formatter = this._encodeHTML(params[0][1]) + '
' + + this._encodeHTML(params[0][3]) + ' : ' + + this.numAddCommas(params[0][2]); + for (var i = 1, l = params.length; i < l; i++) { + formatter += '
' + this._encodeHTML(params[i][1]) + + '
'; + formatter += this._encodeHTML(params[i][3]) + ' : ' + + this.numAddCommas(params[i][2]); + } + this._tDom.innerHTML = formatter; + } + + // don't modify, just false, showContent == undefined == true + if (showContent === false || !this.option.tooltip.showContent) { + // 只用tooltip的行为,不显示主体 + return; + } + + if (!this.hasAppend) { + this._tDom.style.left = this._zrWidth / 2 + 'px'; + this._tDom.style.top = this._zrHeight / 2 + 'px'; + this.dom.firstChild.appendChild(this._tDom); + this.hasAppend = true; + } + this._show( + position, + zrEvent.getX(this._event), + zrEvent.getY(this._event), + specialCssText + ); + return true; + } + }, + + _showItemTrigger: function () { + if (!this._curTarget) { + return; + } + var serie = ecData.get(this._curTarget, 'series'); + var data = ecData.get(this._curTarget, 'data'); + var name = ecData.get(this._curTarget, 'name'); + var value = ecData.get(this._curTarget, 'value'); + var special = ecData.get(this._curTarget, 'special'); + var special2 = ecData.get(this._curTarget, 'special2'); + // 从低优先级往上找到trigger为item的formatter和样式 + var formatter; + var position; + var showContent; + var specialCssText = ''; + var indicator; + var html = ''; + if (this._curTarget._type != 'island') { + // 全局 + if (this.option.tooltip.trigger === 'item') { + formatter = this.option.tooltip.formatter; + position = this.option.tooltip.position; + } + // 系列 + if (this.query(serie, 'tooltip.trigger') === 'item') { + showContent = this.query(serie, 'tooltip.showContent') + || showContent; + formatter = this.query(serie, 'tooltip.formatter') + || formatter; + position = this.query(serie, 'tooltip.position') + || position; + specialCssText += this._style(this.query(serie, 'tooltip')); + } + // 数据项 + showContent = this.query(data, 'tooltip.showContent') + || showContent; + formatter = this.query(data, 'tooltip.formatter') + || formatter; + position = this.query(data, 'tooltip.position') + || position; + specialCssText += this._style(this.query(data, 'tooltip')); + } + else { + showContent = this.deepQuery([data, serie, this.option], 'tooltip.showContent'); + formatter = this.deepQuery([data, serie, this.option], 'tooltip.islandFormatter'); + position = this.deepQuery([data, serie, this.option], 'tooltip.islandPosition'); + } + + if (typeof formatter === 'function') { + this._curTicket = (serie.name || '') + + ':' + + ecData.get(this._curTarget, 'dataIndex'); + this._tDom.innerHTML = formatter.call( + this.myChart, + [ + serie.name || '', + name, + value, + special, + special2, + data + ], + this._curTicket, + this._setContent + ); + } + else if (typeof formatter === 'string') { + this._curTicket = NaN; + formatter = formatter.replace('{a}','{a0}') + .replace('{b}','{b0}') + .replace('{c}','{c0}'); + formatter = formatter.replace('{a0}', this._encodeHTML(serie.name || '')) + .replace('{b0}', this._encodeHTML(name)) + .replace( + '{c0}', + value instanceof Array ? value : this.numAddCommas(value) + ); + + formatter = formatter.replace('{d}','{d0}') + .replace('{d0}', special || ''); + formatter = formatter.replace('{e}','{e0}') + .replace('{e0}', ecData.get(this._curTarget, 'special2') || ''); + + this._tDom.innerHTML = formatter; + } + else { + this._curTicket = NaN; + if (serie.type === ecConfig.CHART_TYPE_SCATTER) { + this._tDom.innerHTML = '' + + (serie.name != null ? (this._encodeHTML(serie.name) + '
') : '') + + (name === '' ? '' : (this._encodeHTML(name) + ' : ')) + + value + + (special == null ? '' : (' (' + special + ')')); + } + else if (serie.type === ecConfig.CHART_TYPE_RADAR && special) { + indicator = special; + html += this._encodeHTML(name === '' ? (serie.name || '') : name); + html += html === '' ? '' : '
'; + for (var i = 0 ; i < indicator.length; i ++) { + html += this._encodeHTML(indicator[i].text) + ' : ' + + this.numAddCommas(value[i]) + '
'; + } + this._tDom.innerHTML = html; + } + else if (serie.type === ecConfig.CHART_TYPE_CHORD) { + if (special2 == null) { + // 外环上 + this._tDom.innerHTML = this._encodeHTML(name) + ' (' + + this.numAddCommas(value) + ')'; + } + else { + var name1 = this._encodeHTML(name); + var name2 = this._encodeHTML(special); + // 内部弦上 + this._tDom.innerHTML = '' + + (serie.name != null ? (this._encodeHTML(serie.name) + '
') : '') + + name1 + ' -> ' + name2 + + ' (' + this.numAddCommas(value) + ')' + + '
' + + name2 + ' -> ' + name1 + + ' (' + this.numAddCommas(special2) + ')'; + } + } + else { + this._tDom.innerHTML = '' + + (serie.name != null ? (this._encodeHTML(serie.name) + '
') : '') + + this._encodeHTML(name) + ' : ' + + this.numAddCommas(value) + + (special == null ? '' : (' ('+ this.numAddCommas(special) +')')); + } + } + + if (!this._axisLineShape.invisible + || !this._axisShadowShape.invisible + ) { + this._axisLineShape.invisible = true; + this.zr.modShape(this._axisLineShape.id); + this._axisShadowShape.invisible = true; + this.zr.modShape(this._axisShadowShape.id); + this.zr.refresh(); + } + + // don't modify, just false, showContent == undefined == true + if (showContent === false || !this.option.tooltip.showContent) { + // 只用tooltip的行为,不显示主体 + return; + } + + if (!this.hasAppend) { + this._tDom.style.left = this._zrWidth / 2 + 'px'; + this._tDom.style.top = this._zrHeight / 2 + 'px'; + this.dom.firstChild.appendChild(this._tDom); + this.hasAppend = true; + } + + this._show( + position, + zrEvent.getX(this._event) + 20, + zrEvent.getY(this._event) - 20, + specialCssText + ); + }, + + /** + * 设置坐标轴指示器样式 + */ + _styleAxisPointer: function (seriesArray, xStart, yStart, xEnd, yEnd, gap, x, y) { + if (seriesArray.length > 0) { + var queryTarget; + var curType; + var axisPointer = this.option.tooltip.axisPointer; + var pointType = axisPointer.type; + var style = { + line: { }, + cross: { }, + shadow: { } + }; + for (var pType in style) { + style[pType].color = axisPointer[pType + 'Style'].color; + style[pType].width = axisPointer[pType + 'Style'].width; + style[pType].type = axisPointer[pType + 'Style'].type; + } + for (var i = 0, l = seriesArray.length; i < l; i++) { + if (this.deepQuery( + [seriesArray[i], this.option], 'tooltip.trigger' + ) === 'axis' + ) { + queryTarget = seriesArray[i]; + curType = this.query(queryTarget, 'tooltip.axisPointer.type'); + pointType = curType || pointType; + if (curType) { + style[curType].color = this.query( + queryTarget, + 'tooltip.axisPointer.' + curType + 'Style.color' + ) || style[curType].color; + style[curType].width = this.query( + queryTarget, + 'tooltip.axisPointer.' + curType + 'Style.width' + ) || style[curType].width; + style[curType].type = this.query( + queryTarget, + 'tooltip.axisPointer.' + curType + 'Style.type' + ) || style[curType].type; + } + } + } + + if (pointType === 'line') { + this._axisLineShape.style = { + xStart: xStart, + yStart: yStart, + xEnd: xEnd, + yEnd: yEnd, + strokeColor: style.line.color, + lineWidth: style.line.width, + lineType: style.line.type + }; + this._axisLineShape.invisible = false; + this.zr.modShape(this._axisLineShape.id); + } + else if (pointType === 'cross') { + this._axisCrossShape.style = { + brushType: 'stroke', + rect: this.component.grid.getArea(), + x: x, + y: y, + text: ('( ' + + this.component.xAxis.getAxis(0).getValueFromCoord(x) + + ' , ' + + this.component.yAxis.getAxis(0).getValueFromCoord(y) + + ' )' + ).replace(' , ', ' ').replace(' , ', ' '), + textPosition: 'specific', + strokeColor: style.cross.color, + lineWidth: style.cross.width, + lineType: style.cross.type + }; + if (this.component.grid.getXend() - x > 100) { // 右侧有空间 + this._axisCrossShape.style.textAlign = 'left'; + this._axisCrossShape.style.textX = x + 10; + } + else { + this._axisCrossShape.style.textAlign = 'right'; + this._axisCrossShape.style.textX = x - 10; + } + if (y - this.component.grid.getY() > 50) { // 上方有空间 + this._axisCrossShape.style.textBaseline = 'bottom'; + this._axisCrossShape.style.textY = y - 10; + } + else { + this._axisCrossShape.style.textBaseline = 'top'; + this._axisCrossShape.style.textY = y + 10; + } + this._axisCrossShape.invisible = false; + this.zr.modShape(this._axisCrossShape.id); + } + else if (pointType === 'shadow') { + if (style.shadow.width == null + || style.shadow.width === 'auto' + || isNaN(style.shadow.width) + ) { + style.shadow.width = gap; + } + if (xStart === xEnd) { + // 纵向 + if (Math.abs(this.component.grid.getX() - xStart) < 2) { + // 最左边 + style.shadow.width /= 2; + xStart = xEnd = xEnd + style.shadow.width / 2; + } + else if (Math.abs(this.component.grid.getXend() - xStart) < 2) { + // 最右边 + style.shadow.width /= 2; + xStart = xEnd = xEnd - style.shadow.width / 2; + } + } + else if (yStart === yEnd) { + // 横向 + if (Math.abs(this.component.grid.getY() - yStart) < 2) { + // 最上边 + style.shadow.width /= 2; + yStart = yEnd = yEnd + style.shadow.width / 2; + } + else if (Math.abs(this.component.grid.getYend() - yStart) < 2) { + // 最右边 + style.shadow.width /= 2; + yStart = yEnd = yEnd - style.shadow.width / 2; + } + } + this._axisShadowShape.style = { + xStart: xStart, + yStart: yStart, + xEnd: xEnd, + yEnd: yEnd, + strokeColor: style.shadow.color, + lineWidth: style.shadow.width + }; + this._axisShadowShape.invisible = false; + this.zr.modShape(this._axisShadowShape.id); + } + this.zr.refresh(); + } + }, + + __onmousemove: function (param) { + clearTimeout(this._hidingTicket); + clearTimeout(this._showingTicket); + var target = param.target; + var mx = zrEvent.getX(param.event); + var my = zrEvent.getY(param.event); + if (!target) { + // 判断是否落到直角系里,axis触发的tooltip + this._curTarget = false; + this._event = param.event; + // this._event._target = this._event.target || this._event.toElement; + this._event.zrenderX = mx; + this._event.zrenderY = my; + if (this._needAxisTrigger + && this.component.grid + && zrArea.isInside(rectangleInstance, this.component.grid.getArea(), mx, my) + ) { + this._showingTicket = setTimeout(this._tryShow, this._showDelay); + } + else if (this._needAxisTrigger + && this.component.polar + && this.component.polar.isInside([mx, my]) != -1 + ) { + this._showingTicket = setTimeout(this._tryShow, this._showDelay); + } + else { + !this._event.connectTrigger && this.messageCenter.dispatch( + ecConfig.EVENT.TOOLTIP_OUT_GRID, + this._event, + null, + this.myChart + ); + this._hidingTicket = setTimeout(this._hide, this._hideDelay); + } + } + else { + this._curTarget = target; + this._event = param.event; + // this._event._target = this._event.target || this._event.toElement; + this._event.zrenderX = mx; + this._event.zrenderY = my; + var polarIndex; + if (this._needAxisTrigger + && this.component.polar + && (polarIndex = this.component.polar.isInside([mx, my])) != -1 + ) { + // 看用这个polar的系列数据是否是axis触发,如果是设置_curTarget为nul + var series = this.option.series; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].polarIndex === polarIndex + && this.deepQuery( + [series[i], this.option], 'tooltip.trigger' + ) === 'axis' + ) { + this._curTarget = null; + break; + } + } + + } + this._showingTicket = setTimeout(this._tryShow, this._showDelay); + } + }, + + /** + * zrender事件响应:鼠标离开绘图区域 + */ + __onglobalout: function () { + clearTimeout(this._hidingTicket); + clearTimeout(this._showingTicket); + this._hidingTicket = setTimeout(this._hide, this._hideDelay); + }, + + /** + * 异步回调填充内容 + */ + __setContent: function (ticket, content) { + if (!this._tDom) { + return; + } + if (ticket === this._curTicket) { + this._tDom.innerHTML = content; + } + + setTimeout(this._refixed, 20); + }, + + ontooltipHover: function (param, tipShape) { + if (!this._lastTipShape // 不存在或者存在但dataIndex发生变化才需要重绘 + || (this._lastTipShape && this._lastTipShape.dataIndex != param.dataIndex) + ) { + if (this._lastTipShape && this._lastTipShape.tipShape.length > 0) { + this.zr.delShape(this._lastTipShape.tipShape); + this.shapeList.length = 2; + } + for (var i = 0, l = tipShape.length; i < l; i++) { + tipShape[i].zlevel = this._zlevelBase; + tipShape[i].style = zrShapeBase.prototype.getHighlightStyle( + tipShape[i].style, + tipShape[i].highlightStyle + ); + tipShape[i].draggable = false; + tipShape[i].hoverable = false; + tipShape[i].clickable = false; + tipShape[i].ondragend = null; + tipShape[i].ondragover = null; + tipShape[i].ondrop = null; + this.shapeList.push(tipShape[i]); + this.zr.addShape(tipShape[i]); + } + this._lastTipShape = { + dataIndex: param.dataIndex, + tipShape: tipShape + }; + } + }, + + ondragend: function () { + this._hide(); + }, + + /** + * 图例选择 + */ + onlegendSelected: function (param) { + this._selectedMap = param.selected; + }, + + _setSelectedMap: function () { + if (this.component.legend) { + this._selectedMap = zrUtil.clone(this.component.legend.getSelectedMap()); + } + else { + this._selectedMap = {}; + } + }, + + _isSelected: function (itemName) { + if (this._selectedMap[itemName] != null) { + return this._selectedMap[itemName]; + } + else { + return true; // 没在legend里定义的都为true啊~ + } + }, + + /** + * 模拟tooltip hover方法 + * {object} params 参数 + * {seriesIndex: 0, seriesName:'', dataInex:0} line、bar、scatter、k、radar + * {seriesIndex: 0, seriesName:'', name:''} map、pie、chord + */ + showTip: function (params) { + if (!params) { + return; + } + + var seriesIndex; + var series = this.option.series; + if (params.seriesIndex != null) { + seriesIndex = params.seriesIndex; + } + else { + var seriesName = params.seriesName; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].name === seriesName) { + seriesIndex = i; + break; + } + } + } + + var serie = series[seriesIndex]; + if (serie == null) { + return; + } + var chart = this.myChart.chart[serie.type]; + var isAxisTrigger = this.deepQuery( + [serie, this.option], 'tooltip.trigger' + ) === 'axis'; + + if (!chart) { + return; + } + + if (isAxisTrigger) { + // axis trigger + var dataIndex = params.dataIndex; + switch (chart.type) { + case ecConfig.CHART_TYPE_LINE : + case ecConfig.CHART_TYPE_BAR : + case ecConfig.CHART_TYPE_K : + if (this.component.xAxis == null + || this.component.yAxis == null + || serie.data.length <= dataIndex + ) { + return; + } + var xAxisIndex = serie.xAxisIndex || 0; + var yAxisIndex = serie.yAxisIndex || 0; + if (this.component.xAxis.getAxis(xAxisIndex).type + === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + ) { + // 横轴是类目 + this._event = { + zrenderX: this.component.xAxis.getAxis(xAxisIndex) + .getCoordByIndex(dataIndex), + zrenderY: this.component.grid.getY() + + (this.component.grid.getYend() + - this.component.grid.getY() + ) / 4 + }; + } + else { + // 纵轴是类目 + this._event = { + zrenderX: this.component.grid.getX() + + (this.component.grid.getXend() + - this.component.grid.getX() + ) / 4, + zrenderY: this.component.yAxis.getAxis(yAxisIndex) + .getCoordByIndex(dataIndex) + }; + } + this._showAxisTrigger( + xAxisIndex, + yAxisIndex, + dataIndex + ); + break; + case ecConfig.CHART_TYPE_RADAR : + if (this.component.polar == null + || serie.data[0].value.length <= dataIndex + ) { + return; + } + var polarIndex = serie.polarIndex || 0; + var vector = this.component.polar.getVector( + polarIndex, dataIndex, 'max' + ); + this._event = { + zrenderX: vector[0], + zrenderY: vector[1] + }; + this._showPolarTrigger( + polarIndex, + dataIndex + ); + break; + } + } + else { + // item trigger + var shapeList = chart.shapeList; + var x; + var y; + switch (chart.type) { + case ecConfig.CHART_TYPE_LINE : + case ecConfig.CHART_TYPE_BAR : + case ecConfig.CHART_TYPE_K : + case ecConfig.CHART_TYPE_SCATTER : + var dataIndex = params.dataIndex; + for (var i = 0, l = shapeList.length; i < l; i++) { + if (ecData.get(shapeList[i], 'seriesIndex') === seriesIndex + && ecData.get(shapeList[i], 'dataIndex') === dataIndex + ) { + this._curTarget = shapeList[i]; + x = shapeList[i].style.x; + y = chart.type != ecConfig.CHART_TYPE_K + ? shapeList[i].style.y : shapeList[i].style.y[0]; + break; + } + } + break; + case ecConfig.CHART_TYPE_RADAR : + var dataIndex = params.dataIndex; + for (var i = 0, l = shapeList.length; i < l; i++) { + if (shapeList[i].type === 'polygon' + && ecData.get(shapeList[i], 'seriesIndex') === seriesIndex + && ecData.get(shapeList[i], 'dataIndex') === dataIndex + ) { + this._curTarget = shapeList[i]; + var vector = this.component.polar.getCenter( + serie.polarIndex || 0 + ); + x = vector[0]; + y = vector[1]; + break; + } + } + break; + case ecConfig.CHART_TYPE_PIE : + var name = params.name; + for (var i = 0, l = shapeList.length; i < l; i++) { + if (shapeList[i].type === 'sector' + && ecData.get(shapeList[i], 'seriesIndex') === seriesIndex + && ecData.get(shapeList[i], 'name') === name + ) { + this._curTarget = shapeList[i]; + var style = this._curTarget.style; + var midAngle = (style.startAngle + style.endAngle) + / 2 * Math.PI / 180; + x = this._curTarget.style.x + Math.cos(midAngle) * style.r / 1.5; + y = this._curTarget.style.y - Math.sin(midAngle) * style.r / 1.5; + break; + } + } + break; + case ecConfig.CHART_TYPE_MAP : + var name = params.name; + var mapType = serie.mapType; + for (var i = 0, l = shapeList.length; i < l; i++) { + if (shapeList[i].type === 'text' + && shapeList[i]._mapType === mapType + && shapeList[i].style._name === name + ) { + this._curTarget = shapeList[i]; + x = this._curTarget.style.x + this._curTarget.position[0]; + y = this._curTarget.style.y + this._curTarget.position[1]; + break; + } + } + break; + case ecConfig.CHART_TYPE_CHORD: + var name = params.name; + for (var i = 0, l = shapeList.length; i < l; i++) { + if (shapeList[i].type === 'sector' + && ecData.get(shapeList[i], 'name') === name + ) { + this._curTarget = shapeList[i]; + var style = this._curTarget.style; + var midAngle = (style.startAngle + style.endAngle) + / 2 * Math.PI / 180; + x = this._curTarget.style.x + Math.cos(midAngle) * (style.r - 2); + y = this._curTarget.style.y - Math.sin(midAngle) * (style.r - 2); + this.zr.trigger( + zrConfig.EVENT.MOUSEMOVE, + { + zrenderX: x, + zrenderY: y + } + ); + return; + } + } + break; + case ecConfig.CHART_TYPE_FORCE: + var name = params.name; + for (var i = 0, l = shapeList.length; i < l; i++) { + if (shapeList[i].type === 'circle' + && ecData.get(shapeList[i], 'name') === name + ) { + this._curTarget = shapeList[i]; + x = this._curTarget.position[0]; + y = this._curTarget.position[1]; + break; + } + } + break; + } + if (x != null && y != null) { + this._event = { + zrenderX: x, + zrenderY: y + }; + this.zr.addHoverShape(this._curTarget); + this.zr.refreshHover(); + this._showItemTrigger(); + } + } + }, + + /** + * 关闭,公开接口 + */ + hideTip: function () { + this._hide(); + }, + + /** + * 刷新 + */ + refresh: function (newOption) { + // this._selectedMap; + // this._defaultCssText; // css样式缓存 + // this._needAxisTrigger; // 坐标轴触发 + // this._curTarget; + // this._event; + // this._curTicket; // 异步回调标识,用来区分多个请求 + + // 缓存一些高宽数据 + this._zrHeight = this.zr.getHeight(); + this._zrWidth = this.zr.getWidth(); + + if (this._lastTipShape && this._lastTipShape.tipShape.length > 0) { + this.zr.delShape(this._lastTipShape.tipShape); + } + this._lastTipShape = false; + this.shapeList.length = 2; + + if (newOption) { + this.option = newOption; + this.option.tooltip = this.reformOption(this.option.tooltip); + this.option.tooltip.textStyle = zrUtil.merge( + this.option.tooltip.textStyle, + this.ecTheme.textStyle + ); + // 补全padding属性 + this.option.tooltip.padding = this.reformCssArray( + this.option.tooltip.padding + ); + + this._needAxisTrigger = false; + if (this.option.tooltip.trigger === 'axis') { + this._needAxisTrigger = true; + } + + var series = this.option.series; + for (var i = 0, l = series.length; i < l; i++) { + if (this.query(series[i], 'tooltip.trigger') === 'axis') { + this._needAxisTrigger = true; + break; + } + } + // this._hidingTicket; + // this._showingTicket; + this._showDelay = this.option.tooltip.showDelay; // 显示延迟 + this._hideDelay = this.option.tooltip.hideDelay; // 隐藏延迟 + this._defaultCssText = this._style(this.option.tooltip); + + this._setSelectedMap(); + this._axisLineWidth = this.option.tooltip.axisPointer.lineStyle.width; + } + if (this.showing) { + var self = this; + setTimeout(function(){ + self.zr.trigger(zrConfig.EVENT.MOUSEMOVE, self.zr.handler._event); + },50); + } + }, + + /** + * 释放后实例不可用,重载基类方法 + */ + dispose: function () { + if (this._lastTipShape && this._lastTipShape.tipShape.length > 0) { + this.zr.delShape(this._lastTipShape.tipShape); + } + this.clear(); + this.shapeList = null; + + clearTimeout(this._hidingTicket); + clearTimeout(this._showingTicket); + this.zr.un(zrConfig.EVENT.MOUSEMOVE, this._onmousemove); + this.zr.un(zrConfig.EVENT.GLOBALOUT, this._onglobalout); + + if (this.hasAppend) { + this.dom.firstChild.removeChild(this._tDom); + } + this._tDom = null; + }, + + /** + * html转码的方法 + */ + _encodeHTML: function (source) { + return String(source) + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"') + .replace(/'/g, '''); + } + }; + + zrUtil.inherits(Tooltip, Base); + + require('../component').define('tooltip', Tooltip); + + return Tooltip; +}); +/** + * 圆环 + * @module zrender/shape/Ring + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + * @example + * var Ring = require('zrender/shape/Ring'); + * var shape = new Ring({ + * style: { + * x: 100, + * y: 100, + * r0: 30, + * r: 50 + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} IRingStyle + * @property {number} x 圆心x坐标 + * @property {number} y 圆心y坐标 + * @property {number} r0 内圆半径 + * @property {number} r 外圆半径 + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ +define( + 'zrender/shape/Ring',['require','./Base','../tool/util'],function (require) { + var Base = require('./Base'); + + /** + * @alias module:zrender/shape/Ring + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var Ring = function (options) { + Base.call(this, options); + /** + * 圆环绘制样式 + * @name module:zrender/shape/Ring#style + * @type {module:zrender/shape/Ring~IRingStyle} + */ + /** + * 圆环高亮绘制样式 + * @name module:zrender/shape/Ring#highlightStyle + * @type {module:zrender/shape/Ring~IRingStyle} + */ + }; + + Ring.prototype = { + type: 'ring', + + /** + * 创建圆环路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Ring~IRingStyle} style + */ + buildPath : function (ctx, style) { + // 非零环绕填充优化 + ctx.arc(style.x, style.y, style.r, 0, Math.PI * 2, false); + ctx.moveTo(style.x + style.r0, style.y); + ctx.arc(style.x, style.y, style.r0, 0, Math.PI * 2, true); + return; + }, + + /** + * 计算返回圆环包围盒矩阵 + * @param {module:zrender/shape/Ring~IRingStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function (style) { + if (style.__rect) { + return style.__rect; + } + + var lineWidth; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } + else { + lineWidth = 0; + } + style.__rect = { + x : Math.round(style.x - style.r - lineWidth / 2), + y : Math.round(style.y - style.r - lineWidth / 2), + width : style.r * 2 + lineWidth, + height : style.r * 2 + lineWidth + }; + + return style.__rect; + } + }; + + require('../tool/util').inherits(Ring, Base); + return Ring; + } +); + +/** + * 扇形 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @module zrender/shape/Sector + * @example + * var Sector = require('zrender/shape/Sector'); + * var shape = new Sector({ + * style: { + * x: 100, + * y: 100, + * r: 60, + * r0: 30, + * startAngle: 0, + * endEngle: 180 + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} ISectorStyle + * @property {number} x 圆心x坐标 + * @property {number} y 圆心y坐标 + * @property {number} r 外圆半径 + * @property {number} [r0=0] 内圆半径,指定后将出现内弧,同时扇边长度为`r - r0` + * @property {number} startAngle 起始角度,`[0, 360)` + * @property {number} endAngle 结束角度,`(0, 360]` + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ + +define( + 'zrender/shape/Sector',['require','../tool/math','./Base','./Ring','./Polygon','../tool/util'],function (require) { + var math = require('../tool/math'); + var Base = require('./Base'); + + /** + * @alias module:zrender/shape/Sector + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var Sector = function (options) { + Base.call(this, options); + /** + * 扇形绘制样式 + * @name module:zrender/shape/Sector#style + * @type {module:zrender/shape/Sector~ISectorStyle} + */ + /** + * 扇形高亮绘制样式 + * @name module:zrender/shape/Sector#highlightStyle + * @type {module:zrender/shape/Sector~ISectorStyle} + */ + }; + + Sector.prototype = { + type: 'sector', + + /** + * 创建扇形路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Sector~ISectorStyle} style + */ + buildPath : function (ctx, style) { + var x = style.x; // 圆心x + var y = style.y; // 圆心y + var r0 = typeof style.r0 == 'undefined' // 形内半径[0,r) + ? 0 : style.r0; + var r = style.r; // 扇形外半径(0,r] + var startAngle = style.startAngle; // 起始角度[0,360) + var endAngle = style.endAngle; // 结束角度(0,360] + + if (Math.abs(endAngle - startAngle) >= 360) { + // 大于360度的扇形简化为圆环画法 + ctx.arc(x, y, r, 0, Math.PI * 2, false); + if (r0 !== 0) { + ctx.moveTo(x + r0, y); + ctx.arc(x, y, r0, 0, Math.PI * 2, true); + } + return; + } + + startAngle = math.degreeToRadian(startAngle); + endAngle = math.degreeToRadian(endAngle); + + var PI2 = Math.PI * 2; + var cosStartAngle = math.cos(startAngle); + var sinStartAngle = math.sin(startAngle); + ctx.moveTo( + cosStartAngle * r0 + x, + y - sinStartAngle * r0 + ); + + ctx.lineTo( + cosStartAngle * r + x, + y - sinStartAngle * r + ); + + ctx.arc(x, y, r, PI2 - startAngle, PI2 - endAngle, true); + + ctx.lineTo( + math.cos(endAngle) * r0 + x, + y - math.sin(endAngle) * r0 + ); + + if (r0 !== 0) { + ctx.arc(x, y, r0, PI2 - endAngle, PI2 - startAngle, false); + } + + ctx.closePath(); + + return; + }, + + /** + * 返回扇形包围盒矩形 + * @param {module:zrender/shape/Sector~ISectorStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function (style) { + if (style.__rect) { + return style.__rect; + } + + var x = style.x; // 圆心x + var y = style.y; // 圆心y + var r0 = typeof style.r0 == 'undefined' // 形内半径[0,r) + ? 0 : style.r0; + var r = style.r; // 扇形外半径(0,r] + var startAngle = style.startAngle; // 起始角度[0,360) + var endAngle = style.endAngle; // 结束角度(0,360] + + if (Math.abs(endAngle - startAngle) >= 360) { + // 大于360度的扇形简化为圆环bbox + style.__rect = require('./Ring').prototype.getRect(style); + return style.__rect; + } + + startAngle = (720 + startAngle) % 360; + endAngle = (720 + endAngle) % 360; + if (endAngle <= startAngle) { + endAngle += 360; + } + var pointList = []; + if (startAngle <= 90 && endAngle >= 90) { + pointList.push([ + x, y - r + ]); + } + if (startAngle <= 180 && endAngle >= 180) { + pointList.push([ + x - r, y + ]); + } + if (startAngle <= 270 && endAngle >= 270) { + pointList.push([ + x, y + r + ]); + } + if (startAngle <= 360 && endAngle >= 360) { + pointList.push([ + x + r, y + ]); + } + + startAngle = math.degreeToRadian(startAngle); + endAngle = math.degreeToRadian(endAngle); + + + pointList.push([ + math.cos(startAngle) * r0 + x, + y - math.sin(startAngle) * r0 + ]); + + pointList.push([ + math.cos(startAngle) * r + x, + y - math.sin(startAngle) * r + ]); + + pointList.push([ + math.cos(endAngle) * r + x, + y - math.sin(endAngle) * r + ]); + + pointList.push([ + math.cos(endAngle) * r0 + x, + y - math.sin(endAngle) * r0 + ]); + + style.__rect = require('./Polygon').prototype.getRect({ + brushType : style.brushType, + lineWidth : style.lineWidth, + pointList : pointList + }); + + return style.__rect; + } + }; + + + require('../tool/util').inherits(Sector, Base); + return Sector; + } +); + +/** + * zrender + * + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + * shape类:蜡烛 + * 可配图形属性: + { + // 基础属性 + shape : 'candle', // 必须,shape类标识,需要显式指定 + id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 + zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 + invisible : {boolean}, // 默认为false,是否可见 + + // 样式属性,默认状态样式样式属性 + style : { + x : {number}, // 必须,横坐标 + y : {Array}, // 必须,纵坐标数组 + }, + + // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 + highlightStyle : { + // 同style + } + + // 交互属性,详见shape.Base + + // 事件属性,详见shape.Base + } + 例子: + { + shape : 'candle', + id : '123456', + zlevel : 1, + style : { + x : 200, + y : [100,123,90,125], + width : 150, + color : '#eee', + text : 'Baidu' + }, + myName : 'kener', // 可自带任何有效自定义属性 + + clickable : true, + onClick : function (eventPacket) { + alert(eventPacket.target.myName); + } + } + */ +define('echarts/util/shape/Candle',['require','zrender/shape/Base','zrender/tool/util','./normalIsCover'],function (require) { + var Base = require('zrender/shape/Base'); + var zrUtil = require('zrender/tool/util'); + + function Candle(options) { + Base.call(this, options); + } + + Candle.prototype = { + type: 'candle', + _numberOrder : function (a, b) { + return b - a; + }, + + /** + * 创建矩形路径 + * @param {Context2D} ctx Canvas 2D上下文 + * @param {Object} style 样式 + */ + buildPath : function (ctx, style) { + var yList = zrUtil.clone(style.y).sort(this._numberOrder); + + ctx.moveTo(style.x, yList[3]); + ctx.lineTo(style.x, yList[2]); + ctx.moveTo(style.x - style.width / 2, yList[2]); + ctx.rect( + style.x - style.width / 2, + yList[2], + style.width, + yList[1] - yList[2] + ); + ctx.moveTo(style.x, yList[1]); + ctx.lineTo(style.x, yList[0]); + }, + + /** + * 返回矩形区域,用于局部刷新和文字定位 + * @param {Object} style + */ + getRect : function (style) { + if (!style.__rect) { + var lineWidth = 0; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } + + var yList = zrUtil.clone(style.y).sort(this._numberOrder); + style.__rect = { + x : Math.round(style.x - style.width / 2 - lineWidth / 2), + y : Math.round(yList[3] - lineWidth / 2), + width : style.width + lineWidth, + height : yList[0] - yList[3] + lineWidth + }; + } + + return style.__rect; + }, + + + isCover : require('./normalIsCover') + }; + + zrUtil.inherits(Candle, Base); + + return Candle; +}); + +/** + * echarts组件:图例 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/component/legend',['require','./base','zrender/shape/Text','zrender/shape/Rectangle','zrender/shape/Sector','../util/shape/Icon','../util/shape/Candle','../config','zrender/tool/util','zrender/tool/area','../component'],function (require) { + var Base = require('./base'); + + // 图形依赖 + var TextShape = require('zrender/shape/Text'); + var RectangleShape = require('zrender/shape/Rectangle'); + var SectorShape = require('zrender/shape/Sector'); + //var BeziercurveShape = require('zrender/shape/Beziercurve'); + var IconShape = require('../util/shape/Icon'); + var CandleShape = require('../util/shape/Candle'); + + var ecConfig = require('../config'); + var zrUtil = require('zrender/tool/util'); + var zrArea = require('zrender/tool/area'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} option 图表参数 + */ + function Legend(ecTheme, messageCenter, zr, option, myChart) { + if (!this.query(option, 'legend.data')) { + console.error('option.legend.data has not been defined.'); + return; + } + + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + + var self = this; + self._legendSelected = function (param) { + self.__legendSelected(param); + }; + + this._colorIndex = 0; + this._colorMap = {}; + this._selectedMap = {}; + + this.refresh(option); + } + + Legend.prototype = { + type: ecConfig.COMPONENT_TYPE_LEGEND, + _buildShape: function () { + // 图例元素组的位置参数,通过计算所得x, y, width, height + this._itemGroupLocation = this._getItemGroupLocation(); + + this._buildBackground(); + this._buildItem(); + + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + }, + + /** + * 构建所有图例元素 + */ + _buildItem: function () { + var data = this.legendOption.data; + var dataLength = data.length; + var itemName; + var itemType; + var itemShape; + var textShape; + var textStyle = this.legendOption.textStyle; + var dataTextStyle; + var dataFont; + var formattedName; + + var zrWidth = this.zr.getWidth(); + var zrHeight = this.zr.getHeight(); + var lastX = this._itemGroupLocation.x; + var lastY = this._itemGroupLocation.y; + var itemWidth = this.legendOption.itemWidth; + var itemHeight = this.legendOption.itemHeight; + var itemGap = this.legendOption.itemGap; + var color; + + if (this.legendOption.orient === 'vertical' && this.legendOption.x === 'right') { + lastX = this._itemGroupLocation.x + + this._itemGroupLocation.width + - itemWidth; + } + + for (var i = 0; i < dataLength; i++) { + dataTextStyle = zrUtil.merge( + data[i].textStyle || {}, + textStyle + ); + dataFont = this.getFont(dataTextStyle); + + itemName = this._getName(data[i]); + formattedName = this._getFormatterName(itemName); + if (itemName === '') { // 别帮我代码优化 + if (this.legendOption.orient === 'horizontal') { + lastX = this._itemGroupLocation.x; + lastY += itemHeight + itemGap; + } + else { + this.legendOption.x === 'right' + ? lastX -= this._itemGroupLocation.maxWidth + itemGap + : lastX += this._itemGroupLocation.maxWidth + itemGap; + lastY = this._itemGroupLocation.y; + } + continue; + } + itemType = data[i].icon || this._getSomethingByName(itemName).type; + + color = this.getColor(itemName); + + if (this.legendOption.orient === 'horizontal') { + if (zrWidth - lastX < 200 // 最后200px做分行预判 + && (itemWidth + 5 + zrArea.getTextWidth(formattedName, dataFont) + // 分行的最后一个不用算itemGap + + (i === dataLength - 1 || data[i + 1] === '' ? 0 : itemGap) + ) >= zrWidth - lastX + ) { + lastX = this._itemGroupLocation.x; + lastY += itemHeight + itemGap; + } + } + else { + if (zrHeight - lastY < 200 // 最后200px做分行预判 + && (itemHeight + // 分行的最后一个不用算itemGap + + (i === dataLength - 1 || data[i + 1] === '' ? 0 : itemGap) + ) + >= zrHeight - lastY + ) { + this.legendOption.x === 'right' + ? lastX -= this._itemGroupLocation.maxWidth + itemGap + : lastX += this._itemGroupLocation.maxWidth + itemGap; + lastY = this._itemGroupLocation.y; + } + } + + // 图形 + itemShape = this._getItemShapeByType( + lastX, lastY, + itemWidth, itemHeight, + (this._selectedMap[itemName] ? color : '#ccc'), + itemType, + color + ); + itemShape._name = itemName; + itemShape = new IconShape(itemShape); + + // 文字 + textShape = { + // shape: 'text', + zlevel: this._zlevelBase, + style: { + x: lastX + itemWidth + 5, + y: lastY + itemHeight / 2, + color: this._selectedMap[itemName] + ? (dataTextStyle.color === 'auto' ? color : dataTextStyle.color) + : '#ccc', + text: formattedName, + textFont: dataFont, + textBaseline: 'middle' + }, + highlightStyle: { + color: color, + brushType: 'fill' + }, + hoverable: !!this.legendOption.selectedMode, + clickable: !!this.legendOption.selectedMode + }; + + if (this.legendOption.orient === 'vertical' + && this.legendOption.x === 'right' + ) { + textShape.style.x -= (itemWidth + 10); + textShape.style.textAlign = 'right'; + } + + textShape._name = itemName; + textShape = new TextShape(textShape); + + if (this.legendOption.selectedMode) { + itemShape.onclick = textShape.onclick = this._legendSelected; + itemShape.onmouseover = textShape.onmouseover = this.hoverConnect; + itemShape.hoverConnect = textShape.id; + textShape.hoverConnect = itemShape.id; + } + this.shapeList.push(itemShape); + this.shapeList.push(textShape); + + if (this.legendOption.orient === 'horizontal') { + lastX += itemWidth + 5 + + zrArea.getTextWidth(formattedName, dataFont) + + itemGap; + } + else { + lastY += itemHeight + itemGap; + } + } + + if (this.legendOption.orient === 'horizontal' + && this.legendOption.x === 'center' + && lastY != this._itemGroupLocation.y + ) { + // 多行橫排居中优化 + this._mLineOptimize(); + } + }, + + _getName: function(data) { + return typeof data.name != 'undefined' ? data.name : data; + }, + + _getFormatterName: function(itemName) { + var formatter = this.legendOption.formatter; + var formattedName; + if (typeof formatter === 'function') { + formattedName = formatter.call(this.myChart, itemName); + } + else if (typeof formatter === 'string') { + formattedName = formatter.replace('{name}', itemName); + } + else { + formattedName = itemName; + } + return formattedName; + }, + + _getFormatterNameFromData: function(data) { + var itemName = this._getName(data); + return this._getFormatterName(itemName); + }, + + // 多行橫排居中优化 + _mLineOptimize: function () { + var lineOffsetArray = []; // 每行宽度 + var lastX = this._itemGroupLocation.x; + for (var i = 2, l = this.shapeList.length; i < l; i++) { + if (this.shapeList[i].style.x === lastX) { + lineOffsetArray.push( + ( + this._itemGroupLocation.width + - ( + this.shapeList[i - 1].style.x + + zrArea.getTextWidth( + this.shapeList[i - 1].style.text, + this.shapeList[i - 1].style.textFont + ) + - lastX + ) + ) / 2 + ); + } + else if (i === l - 1) { + lineOffsetArray.push( + ( + this._itemGroupLocation.width + - ( + this.shapeList[i].style.x + + zrArea.getTextWidth( + this.shapeList[i].style.text, + this.shapeList[i].style.textFont + ) + - lastX + ) + ) / 2 + ); + } + } + var curLineIndex = -1; + for (var i = 1, l = this.shapeList.length; i < l; i++) { + if (this.shapeList[i].style.x === lastX) { + curLineIndex++; + } + if (lineOffsetArray[curLineIndex] === 0) { + continue; + } + else { + this.shapeList[i].style.x += lineOffsetArray[curLineIndex]; + } + } + }, + + _buildBackground: function () { + var pTop = this.legendOption.padding[0]; + var pRight = this.legendOption.padding[1]; + var pBottom = this.legendOption.padding[2]; + var pLeft = this.legendOption.padding[3]; + + this.shapeList.push(new RectangleShape({ + zlevel: this._zlevelBase, + hoverable :false, + style: { + x: this._itemGroupLocation.x - pLeft, + y: this._itemGroupLocation.y - pTop, + width: this._itemGroupLocation.width + pLeft + pRight, + height: this._itemGroupLocation.height + pTop + pBottom, + brushType: this.legendOption.borderWidth === 0 ? 'fill' : 'both', + color: this.legendOption.backgroundColor, + strokeColor: this.legendOption.borderColor, + lineWidth: this.legendOption.borderWidth + } + })); + }, + + /** + * 根据选项计算图例实体的位置坐标 + */ + _getItemGroupLocation: function () { + var data = this.legendOption.data; + var dataLength = data.length; + var itemGap = this.legendOption.itemGap; + var itemWidth = this.legendOption.itemWidth + 5; // 5px是图形和文字的间隔,不可配 + var itemHeight = this.legendOption.itemHeight; + var textStyle = this.legendOption.textStyle; + var font = this.getFont(textStyle); + var totalWidth = 0; + var totalHeight = 0; + var padding = this.legendOption.padding; + var zrWidth = this.zr.getWidth() - padding[1] - padding[3]; + var zrHeight = this.zr.getHeight() - padding[0] - padding[2]; + + var temp = 0; // 宽高计算,用于多行判断 + var maxWidth = 0; // 垂直布局有用 + if (this.legendOption.orient === 'horizontal') { + // 水平布局,计算总宽度 + totalHeight = itemHeight; + for (var i = 0; i < dataLength; i++) { + if (this._getName(data[i]) === '') { + temp -= itemGap; + if (temp > zrWidth) { + totalWidth = zrWidth; + totalHeight += itemHeight + itemGap; + } + else { + totalWidth = Math.max(totalWidth, temp); + } + totalHeight += itemHeight + itemGap; + temp = 0; + continue; + } + temp += itemWidth + + zrArea.getTextWidth( + this._getFormatterNameFromData(data[i]), + data[i].textStyle + ? this.getFont(zrUtil.merge( + data[i].textStyle || {}, + textStyle + )) + : font + ) + + itemGap; + } + totalHeight = Math.max(totalHeight, itemHeight); + temp -= itemGap; // 减去最后一个的itemGap + if (temp > zrWidth) { + totalWidth = zrWidth; + totalHeight += itemHeight + itemGap; + } else { + totalWidth = Math.max(totalWidth, temp); + } + } + else { + // 垂直布局,计算总高度 + for (var i = 0; i < dataLength; i++) { + maxWidth = Math.max( + maxWidth, + zrArea.getTextWidth( + this._getFormatterNameFromData(data[i]), + data[i].textStyle + ? this.getFont(zrUtil.merge( + data[i].textStyle || {}, + textStyle + )) + : font + ) + ); + } + maxWidth += itemWidth; + totalWidth = maxWidth; + for (var i = 0; i < dataLength; i++) { + if (this._getName(data[i]) === '') { + temp -= itemGap; + if (temp > zrHeight) { + totalHeight = zrHeight; + totalWidth += maxWidth + itemGap; + } + else { + totalHeight = Math.max(totalHeight, temp); + } + totalWidth += maxWidth + itemGap; + temp = 0; + continue; + } + temp += itemHeight + itemGap; + } + totalWidth = Math.max(totalWidth, maxWidth); + temp -= itemGap; // 减去最后一个的itemGap + if (temp > zrHeight) { + totalHeight = zrHeight; + totalWidth += maxWidth + itemGap; + } else { + totalHeight = Math.max(totalHeight, temp); + } + } + + zrWidth = this.zr.getWidth(); + zrHeight = this.zr.getHeight(); + var x; + switch (this.legendOption.x) { + case 'center' : + x = Math.floor((zrWidth - totalWidth) / 2); + break; + case 'left' : + x = this.legendOption.padding[3] + this.legendOption.borderWidth; + break; + case 'right' : + x = zrWidth + - totalWidth + - this.legendOption.padding[1] + - this.legendOption.padding[3] + - this.legendOption.borderWidth * 2; + break; + default : + x = this.parsePercent(this.legendOption.x, zrWidth); + break; + } + + var y; + switch (this.legendOption.y) { + case 'top' : + y = this.legendOption.padding[0] + this.legendOption.borderWidth; + break; + case 'bottom' : + y = zrHeight + - totalHeight + - this.legendOption.padding[0] + - this.legendOption.padding[2] + - this.legendOption.borderWidth * 2; + break; + case 'center' : + y = Math.floor((zrHeight - totalHeight) / 2); + break; + default : + y = this.parsePercent(this.legendOption.y, zrHeight); + break; + } + + return { + x: x, + y: y, + width: totalWidth, + height: totalHeight, + maxWidth: maxWidth + }; + }, + + /** + * 根据名称返回series数据或data + */ + _getSomethingByName: function (name) { + var series = this.option.series; + var data; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].name === name) { + // 系列名称优先 + return { + type: series[i].type, + series: series[i], + seriesIndex: i, + data: null, + dataIndex: -1 + }; + } + + if ( + series[i].type === ecConfig.CHART_TYPE_PIE + || series[i].type === ecConfig.CHART_TYPE_RADAR + || series[i].type === ecConfig.CHART_TYPE_CHORD + || series[i].type === ecConfig.CHART_TYPE_FORCE + || series[i].type === ecConfig.CHART_TYPE_FUNNEL + ) { + data = series[i].type != ecConfig.CHART_TYPE_FORCE + ? series[i].data // 饼图、雷达图、和弦图得查找里面的数据名字 + : series[i].categories; // 力导布局查找categories配置 + for (var j = 0, k = data.length; j < k; j++) { + if (data[j].name === name) { + return { + type: series[i].type, + series: series[i], + seriesIndex: i, + data: data[j], + dataIndex: j + }; + } + } + } + } + return { + type: 'bar', + series: null, + seriesIndex: -1, + data: null, + dataIndex: -1 + }; + }, + + _getItemShapeByType: function (x, y, width, height, color, itemType, defaultColor) { + var highlightColor = color === '#ccc' ? defaultColor : color; + var itemShape = { + zlevel: this._zlevelBase, + style: { + iconType: 'legendicon' + itemType, + x: x, + y: y, + width: width, + height: height, + color: color, + strokeColor: color, + lineWidth: 2 + }, + highlightStyle: { + color: highlightColor, + strokeColor: highlightColor, + lineWidth: 1 + }, + hoverable: this.legendOption.selectedMode, + clickable: this.legendOption.selectedMode + }; + + var imageLocation; + if (itemType.match('image')) { + var imageLocation = itemType.replace( + new RegExp('^image:\\/\\/'), '' + ); + itemType = 'image'; + } + // 特殊设置 + switch (itemType) { + case 'line': + itemShape.style.brushType = 'stroke'; + itemShape.highlightStyle.lineWidth = 3; + break; + case 'radar': + case 'scatter': + itemShape.highlightStyle.lineWidth = 3; + break; + case 'k': + itemShape.style.brushType = 'both'; + itemShape.highlightStyle.lineWidth = 3; + itemShape.highlightStyle.color = + itemShape.style.color = this.query(this.ecTheme, 'k.itemStyle.normal.color') + || '#fff'; + itemShape.style.strokeColor = color != '#ccc' + ? (this.query(this.ecTheme, 'k.itemStyle.normal.lineStyle.color') + || '#ff3200') + : color; + break; + case 'image': + itemShape.style.iconType = 'image'; + itemShape.style.image = imageLocation; + if (color === '#ccc') { + itemShape.style.opacity = 0.5; + } + break; + } + return itemShape; + }, + + __legendSelected: function (param) { + var itemName = param.target._name; + if (this.legendOption.selectedMode === 'single') { + for (var k in this._selectedMap) { + this._selectedMap[k] = false; + } + } + this._selectedMap[itemName] = !this._selectedMap[itemName]; + this.messageCenter.dispatch( + ecConfig.EVENT.LEGEND_SELECTED, + param.event, + { + selected: this._selectedMap, + target: itemName + }, + this.myChart + ); + }, + + /** + * 刷新 + */ + refresh: function (newOption) { + if (newOption) { + this.option = newOption || this.option; + this.option.legend = this.reformOption(this.option.legend); + // 补全padding属性 + this.option.legend.padding = this.reformCssArray( + this.option.legend.padding + ); + this.legendOption = this.option.legend; + + var data = this.legendOption.data || []; + var itemName; + var something; + var color; + var queryTarget; + if (this.legendOption.selected) { + for (var k in this.legendOption.selected) { + this._selectedMap[k] = typeof this._selectedMap[k] != 'undefined' + ? this._selectedMap[k] + : this.legendOption.selected[k]; + } + } + for (var i = 0, dataLength = data.length; i < dataLength; i++) { + itemName = this._getName(data[i]); + if (itemName === '') { + continue; + } + something = this._getSomethingByName(itemName); + if (!something.series) { + this._selectedMap[itemName] = false; + } + else { + if (something.data + && (something.type === ecConfig.CHART_TYPE_PIE + || something.type === ecConfig.CHART_TYPE_FORCE + || something.type === ecConfig.CHART_TYPE_FUNNEL) + ) { + queryTarget = [something.data, something.series]; + } + else { + queryTarget = [something.series]; + } + + color = this.getItemStyleColor( + this.deepQuery(queryTarget, 'itemStyle.normal.color'), + something.seriesIndex, + something.dataIndex, + something.data + ); + if (color && something.type != ecConfig.CHART_TYPE_K) { + this.setColor(itemName, color); + } + this._selectedMap[itemName] = + typeof this._selectedMap[itemName] != 'undefined' + ? this._selectedMap[itemName] : true; + } + } + } + this.clear(); + this._buildShape(); + }, + + getRelatedAmount: function(name) { + var amount = 0; + var series = this.option.series; + var data; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].name === name) { + // 系列名称优先 + amount++; + } + + if ( + series[i].type === ecConfig.CHART_TYPE_PIE + || series[i].type === ecConfig.CHART_TYPE_RADAR + || series[i].type === ecConfig.CHART_TYPE_CHORD + || series[i].type === ecConfig.CHART_TYPE_FORCE + || series[i].type === ecConfig.CHART_TYPE_FUNNEL + ) { + data = series[i].type != ecConfig.CHART_TYPE_FORCE + ? series[i].data // 饼图、雷达图、和弦图得查找里面的数据名字 + : series[i].categories; // 力导布局查找categories配置 + for (var j = 0, k = data.length; j < k; j++) { + if (data[j].name === name && data[j].value != '-') { + amount++; + } + } + } + } + return amount; + }, + + setColor: function (legendName, color) { + this._colorMap[legendName] = color; + }, + + getColor: function (legendName) { + if (!this._colorMap[legendName]) { + this._colorMap[legendName] = this.zr.getColor(this._colorIndex++); + } + return this._colorMap[legendName]; + }, + + hasColor: function (legendName) { + return this._colorMap[legendName] ? this._colorMap[legendName] : false; + }, + + add: function (name, color){ + var data = this.legendOption.data; + for (var i = 0, dataLength = data.length; i < dataLength; i++) { + if (this._getName(data[i]) === name) { + // 已有就不重复加了 + return; + } + } + this.legendOption.data.push(name); + this.setColor(name,color); + this._selectedMap[name] = true; + }, + + del: function (name){ + var data = this.legendOption.data; + for (var i = 0, dataLength = data.length; i < dataLength; i++) { + if (this._getName(data[i]) === name) { + return this.legendOption.data.splice(i, 1); + } + } + }, + + /** + * 特殊图形元素回调设置 + * @param {Object} name + * @param {Object} itemShape + */ + getItemShape: function (name) { + if (name == null) { + return; + } + var shape; + for (var i = 0, l = this.shapeList.length; i < l; i++) { + shape = this.shapeList[i]; + if (shape._name === name && shape.type != 'text') { + return shape; + } + } + }, + + /** + * 特殊图形元素回调设置 + * @param {Object} name + * @param {Object} itemShape + */ + setItemShape: function (name, itemShape) { + var shape; + for (var i = 0, l = this.shapeList.length; i < l; i++) { + shape = this.shapeList[i]; + if (shape._name === name && shape.type != 'text') { + if (!this._selectedMap[name]) { + itemShape.style.color = '#ccc'; + itemShape.style.strokeColor = '#ccc'; + } + this.zr.modShape(shape.id, itemShape); + } + } + }, + + isSelected: function (itemName) { + if (typeof this._selectedMap[itemName] != 'undefined') { + return this._selectedMap[itemName]; + } + else { + // 没在legend里定义的都为true啊~ + return true; + } + }, + + getSelectedMap: function () { + return this._selectedMap; + }, + + setSelected: function(itemName, selectStatus) { + if (this.legendOption.selectedMode === 'single') { + for (var k in this._selectedMap) { + this._selectedMap[k] = false; + } + } + this._selectedMap[itemName] = selectStatus; + this.messageCenter.dispatch( + ecConfig.EVENT.LEGEND_SELECTED, + null, + { + selected: this._selectedMap, + target: itemName + }, + this.myChart + ); + }, + + /** + * 图例选择 + */ + onlegendSelected: function (param, status) { + var legendSelected = param.selected; + for (var itemName in legendSelected) { + if (this._selectedMap[itemName] != legendSelected[itemName]) { + // 有一项不一致都需要重绘 + status.needRefresh = true; + } + this._selectedMap[itemName] = legendSelected[itemName]; + } + return; + } + }; + + var legendIcon = { + line: function (ctx, style) { + var dy = style.height / 2; + ctx.moveTo(style.x, style.y + dy); + ctx.lineTo(style.x + style.width,style.y + dy); + }, + + pie: function (ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + SectorShape.prototype.buildPath(ctx, { + x: x + width / 2, + y: y + height + 2, + r: height + 2, + r0: 6, + startAngle: 45, + endAngle: 135 + }); + }, + /* + chord: function (ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + ctx.moveTo(x, y + height); + BeziercurveShape.prototype.buildPath(ctx, { + xStart: x, + yStart: y + height, + cpX1: x + width, + cpY1: y + height, + cpX2: x, + cpY2: y + 4, + xEnd: x + width, + yEnd: y + 4 + }); + ctx.lineTo(x + width, y); + BeziercurveShape.prototype.buildPath(ctx, { + xStart: x + width, + yStart: y, + cpX1: x, + cpY1: y, + cpX2: x + width, + cpY2: y + height - 4, + xEnd: x, + yEnd: y + height - 4 + }); + ctx.lineTo(x, y + height); + }, + */ + k: function (ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + CandleShape.prototype.buildPath(ctx, { + x: x + width / 2, + y: [y + 1, y + 1, y + height - 6, y + height], + width: width - 6 + }); + }, + + bar: function (ctx, style) { + var x = style.x; + var y = style.y +1; + var width = style.width; + var height = style.height - 2; + var r = 3; + + ctx.moveTo(x + r, y); + ctx.lineTo(x + width - r, y); + ctx.quadraticCurveTo( + x + width, y, x + width, y + r + ); + ctx.lineTo(x + width, y + height - r); + ctx.quadraticCurveTo( + x + width, y + height, x + width - r, y + height + ); + ctx.lineTo(x + r, y + height); + ctx.quadraticCurveTo( + x, y + height, x, y + height - r + ); + ctx.lineTo(x, y + r); + ctx.quadraticCurveTo(x, y, x + r, y); + }, + + force: function (ctx, style) { + IconShape.prototype.iconLibrary.circle(ctx, style); + }, + + radar: function (ctx, style) { + var n = 6; + var x = style.x + style.width / 2; + var y = style.y + style.height / 2; + var r = style.height / 2; + + var dStep = 2 * Math.PI / n; + var deg = -Math.PI / 2; + var xStart = x + r * Math.cos(deg); + var yStart = y + r * Math.sin(deg); + + ctx.moveTo(xStart, yStart); + deg += dStep; + for (var i = 0, end = n - 1; i < end; i ++) { + ctx.lineTo(x + r * Math.cos(deg), y + r * Math.sin(deg)); + deg += dStep; + } + ctx.lineTo(xStart, yStart); + } + }; + legendIcon.chord = legendIcon.pie; + legendIcon.map = legendIcon.bar; + + for (var k in legendIcon) { + IconShape.prototype.iconLibrary['legendicon' + k] = legendIcon[k]; + } + + zrUtil.inherits(Legend, Base); + + require('../component').define('legend', Legend); + + return Legend; +}); + + + +/** + * zrender + * + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + * shape类:时间轴线 + */ +define('echarts/util/shape/Chain',['require','zrender/shape/Base','./Icon','zrender/shape/util/dashedLineTo','zrender/tool/util','zrender/tool/matrix'],function (require) { + var Base = require('zrender/shape/Base'); + var IconShape = require('./Icon'); + + var dashedLineTo = require('zrender/shape/util/dashedLineTo'); + var zrUtil = require('zrender/tool/util'); + var matrix = require('zrender/tool/matrix'); + + function Chain(options) { + Base.call(this, options); + } + + Chain.prototype = { + type : 'chain', + + /** + * 画刷 + * @param ctx 画布句柄 + * @param e 形状实体 + * @param isHighlight 是否为高亮状态 + * @param updateCallback 需要异步加载资源的shape可以通过这个callback(e) + * 让painter更新视图,base.brush没用,需要的话重载brush + */ + brush : function (ctx, isHighlight) { + var style = this.style; + + if (isHighlight) { + // 根据style扩展默认高亮样式 + style = this.getHighlightStyle( + style, + this.highlightStyle || {} + ); + } + + ctx.save(); + this.setContext(ctx, style); + + // 设置transform + this.setTransform(ctx); + + ctx.save(); + ctx.beginPath(); + this.buildLinePath(ctx, style); + ctx.stroke(); + ctx.restore(); + + this.brushSymbol(ctx, style); + + ctx.restore(); + return; + }, + + /** + * 创建线条路径 + * @param {Context2D} ctx Canvas 2D上下文 + * @param {Object} style 样式 + */ + buildLinePath : function (ctx, style) { + var x = style.x; + var y = style.y + 5; + var width = style.width; + var height = style.height / 2 - 10; + + ctx.moveTo(x, y); + ctx.lineTo(x, y + height); + ctx.moveTo(x + width, y); + ctx.lineTo(x + width, y + height); + + ctx.moveTo(x, y + height / 2); + if (!style.lineType || style.lineType == 'solid') { + ctx.lineTo(x + width, y + height / 2); + } + else if (style.lineType == 'dashed' || style.lineType == 'dotted') { + var dashLength = (style.lineWidth || 1) + * (style.lineType == 'dashed' ? 5 : 1); + dashedLineTo(ctx, x, y + height / 2, x + width, y + height / 2, dashLength); + } + }, + + /** + * 标线始末标注 + */ + brushSymbol : function (ctx, style) { + var y = style.y + style.height / 4; + ctx.save(); + + var chainPoint = style.chainPoint; + var curPoint; + for (var idx = 0, l = chainPoint.length; idx < l; idx++) { + curPoint = chainPoint[idx]; + if (curPoint.symbol != 'none') { + ctx.beginPath(); + var symbolSize = curPoint.symbolSize; + IconShape.prototype.buildPath( + ctx, + { + iconType : curPoint.symbol, + x : curPoint.x - symbolSize, + y : y - symbolSize, + width : symbolSize * 2, + height : symbolSize * 2, + n : curPoint.n + } + ); + ctx.fillStyle = curPoint.isEmpty ? '#fff' : style.strokeColor; + ctx.closePath(); + ctx.fill(); + ctx.stroke(); + } + + if (curPoint.showLabel) { + ctx.font = curPoint.textFont; + ctx.fillStyle = curPoint.textColor; + ctx.textAlign = curPoint.textAlign; + ctx.textBaseline = curPoint.textBaseline; + if (curPoint.rotation) { + ctx.save(); + this._updateTextTransform(ctx, curPoint.rotation); + ctx.fillText(curPoint.name, curPoint.textX, curPoint.textY); + ctx.restore(); + } + else { + ctx.fillText(curPoint.name, curPoint.textX, curPoint.textY); + } + } + } + + ctx.restore(); + }, + + _updateTextTransform : function (ctx, rotation) { + var _transform = matrix.create(); + matrix.identity(_transform); + + if (rotation[0] !== 0) { + var originX = rotation[1] || 0; + var originY = rotation[2] || 0; + if (originX || originY) { + matrix.translate( + _transform, _transform, [-originX, -originY] + ); + } + matrix.rotate(_transform, _transform, rotation[0]); + if (originX || originY) { + matrix.translate( + _transform, _transform, [originX, originY] + ); + } + } + + // 保存这个变换矩阵 + ctx.transform.apply(ctx, _transform); + }, + + isCover : function (x, y) { + var rect = this.style; + if (x >= rect.x + && x <= (rect.x + rect.width) + && y >= rect.y + && y <= (rect.y + rect.height) + ) { + // 矩形内 + return true; + } + else { + return false; + } + } + }; + + zrUtil.inherits(Chain, Base); + + return Chain; +}); + +/** + * echarts组件:时间轴组件 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle','../util/shape/Icon','../util/shape/Chain','../config','zrender/tool/util','zrender/tool/area','zrender/tool/event','../component'],function (require) { + var Base = require('./base'); + + // 图形依赖 + var RectangleShape = require('zrender/shape/Rectangle'); + var IconShape = require('../util/shape/Icon'); + var ChainShape = require('../util/shape/Chain'); + + var ecConfig = require('../config'); + var zrUtil = require('zrender/tool/util'); + var zrArea = require('zrender/tool/area'); + var zrEvent = require('zrender/tool/event'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} option 图表参数 + */ + function Timeline(ecTheme, messageCenter, zr, option, myChart) { + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + + var self = this; + self._onclick = function(param) { + return self.__onclick(param); + }; + self._ondrift = function (dx, dy) { + return self.__ondrift(this, dx, dy); + }; + self._ondragend = function () { + return self.__ondragend(); + }; + self._setCurrentOption = function() { + var timelineOption = self.timelineOption; + self.currentIndex %= timelineOption.data.length; + // console.log(self.currentIndex); + var curOption = self.options[self.currentIndex] || {}; + self.myChart.setOption(curOption, timelineOption.notMerge); + + self.messageCenter.dispatch( + ecConfig.EVENT.TIMELINE_CHANGED, + null, + { + currentIndex: self.currentIndex, + data: timelineOption.data[self.currentIndex].name != null + ? timelineOption.data[self.currentIndex].name + : timelineOption.data[self.currentIndex] + }, + self.myChart + ); + }; + self._onFrame = function() { + self._setCurrentOption(); + self._syncHandleShape(); + + if (self.timelineOption.autoPlay) { + self.playTicket = setTimeout( + function() { + self.currentIndex += 1; + if (!self.timelineOption.loop + && self.currentIndex >= self.timelineOption.data.length + ) { + self.currentIndex = self.timelineOption.data.length - 1; + self.stop(); + return; + } + self._onFrame(); + }, + self.timelineOption.playInterval + ); + } + }; + + this.setTheme(false); + this.options = this.option.options; + this.currentIndex = this.timelineOption.currentIndex % this.timelineOption.data.length; + + if (!this.timelineOption.notMerge && this.currentIndex !== 0) { + /* + for (var i = 1, l = this.timelineOption.data.length; i < l; i++) { + this.options[i] = zrUtil.merge( + this.options[i], this.options[i - 1] + ); + } + */ + this.options[this.currentIndex] = zrUtil.merge( + this.options[this.currentIndex], this.options[0] + ); + } + + if (this.timelineOption.show) { + this._buildShape(); + this._syncHandleShape(); + } + + this._setCurrentOption(); + + if (this.timelineOption.autoPlay) { + var self = this; + this.playTicket = setTimeout( + function() { + self.play(); + }, + this.ecTheme.animationDuration + ); + } + } + + Timeline.prototype = { + type: ecConfig.COMPONENT_TYPE_TIMELINE, + _buildShape: function () { + // 位置参数,通过计算所得x, y, width, height + this._location = this._getLocation(); + this._buildBackground(); + this._buildControl(); + this._chainPoint = this._getChainPoint(); + if (this.timelineOption.label.show) { + // 标签显示的挑选间隔 + var interval = this._getInterval(); + for (var i = 0, len = this._chainPoint.length; i < len; i += interval) { + this._chainPoint[i].showLabel = true; + } + } + this._buildChain(); + this._buildHandle(); + + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + }, + + /** + * 根据选项计算实体的位置坐标 + */ + _getLocation: function () { + var timelineOption = this.timelineOption; + var padding = timelineOption.padding; + + // 水平布局 + var zrWidth = this.zr.getWidth(); + var x = this.parsePercent(timelineOption.x, zrWidth); + var x2 = this.parsePercent(timelineOption.x2, zrWidth); + var width; + if (timelineOption.width == null) { + width = zrWidth - x - x2; + x2 = zrWidth - x2; + } + else { + width = this.parsePercent(timelineOption.width, zrWidth); + x2 = x + width; + } + + var zrHeight = this.zr.getHeight(); + var height = this.parsePercent(timelineOption.height, zrHeight); + var y; + var y2; + if (timelineOption.y != null) { + y = this.parsePercent(timelineOption.y, zrHeight); + y2 = y + height; + } + else { + y2 = zrHeight - this.parsePercent(timelineOption.y2, zrHeight); + y = y2 - height; + } + + return { + x: x + padding[3], + y: y + padding[0], + x2: x2 - padding[1], + y2: y2 - padding[2], + width: width - padding[1] - padding[3], + height: height - padding[0] - padding[2] + }; + }, + + _getReformedLabel: function (idx) { + var timelineOption = this.timelineOption; + var data = timelineOption.data[idx].name != null + ? timelineOption.data[idx].name + : timelineOption.data[idx]; + var formatter = timelineOption.data[idx].formatter + || timelineOption.label.formatter; + if (formatter) { + if (typeof formatter === 'function') { + data = formatter.call(this.myChart, data); + } + else if (typeof formatter === 'string') { + data = formatter.replace('{value}', data); + } + } + return data; + }, + + /** + * 计算标签显示挑选间隔 + */ + _getInterval: function () { + var chainPoint = this._chainPoint; + var timelineOption = this.timelineOption; + var interval = timelineOption.label.interval; + if (interval === 'auto') { + // 麻烦的自适应计算 + var fontSize = timelineOption.label.textStyle.fontSize; + var data = timelineOption.data; + var dataLength = timelineOption.data.length; + + // 横向 + if (dataLength > 3) { + var isEnough = false; + var labelSpace; + var labelSize; + interval = 0; + while (!isEnough && interval < dataLength) { + interval++; + isEnough = true; + for (var i = interval; i < dataLength; i += interval) { + labelSpace = chainPoint[i].x - chainPoint[i - interval].x; + if (timelineOption.label.rotate !== 0) { + // 有旋转 + labelSize = fontSize; + } + else if (data[i].textStyle) { + labelSize = zrArea.getTextWidth( + chainPoint[i].name, + chainPoint[i].textFont + ); + } + else { + // 不定义data级特殊文本样式,用fontSize优化getTextWidth + var label = chainPoint[i].name + ''; + var wLen = (label.match(/\w/g) || '').length; + var oLen = label.length - wLen; + labelSize = wLen * fontSize * 2 / 3 + oLen * fontSize; + } + + if (labelSpace < labelSize) { + // 放不下,中断循环让interval++ + isEnough = false; + break; + } + } + } + } + else { + // 少于3个则全部显示 + interval = 1; + } + } + else { + // 用户自定义间隔 + interval = interval - 0 + 1; + } + + return interval; + }, + + /** + * 根据选项计算时间链条上的坐标及symbolList + */ + _getChainPoint: function() { + var timelineOption = this.timelineOption; + var symbol = timelineOption.symbol.toLowerCase(); + var symbolSize = timelineOption.symbolSize; + var rotate = timelineOption.label.rotate; + var textStyle = timelineOption.label.textStyle; + var textFont = this.getFont(textStyle); + var dataTextStyle; + var data = timelineOption.data; + var x = this._location.x; + var y = this._location.y + this._location.height / 4 * 3; + var width = this._location.x2 - this._location.x; + var len = data.length; + + function _getName(i) { + return data[i].name != null ? data[i].name : data[i]; + } + var xList = []; + if (len > 1) { + var boundaryGap = width / len; + boundaryGap = boundaryGap > 50 ? 50 : (boundaryGap < 20 ? 5 : boundaryGap); + width -= boundaryGap * 2; + if (timelineOption.type === 'number') { + // 平均分布 + for (var i = 0; i < len; i++) { + xList.push(x + boundaryGap + width / (len - 1) * i); + } + } + else { + // 时间比例 + xList[0] = new Date(_getName(0).replace(/-/g, '/')); + xList[len - 1] = new Date(_getName(len - 1).replace(/-/g, '/')) - xList[0]; + for (var i = 1; i < len; i++) { + xList[i] = x + boundaryGap + + width + * (new Date(_getName(i).replace(/-/g, '/')) - xList[0]) + / xList[len - 1]; + } + xList[0] = x + boundaryGap; + } + } + else { + xList.push(x + width / 2); + } + + var list = []; + var curSymbol; + var n; + var isEmpty; + var textAlign; + var rotation; + for (var i = 0; i < len; i++) { + x = xList[i]; + curSymbol = (data[i].symbol && data[i].symbol.toLowerCase()) || symbol; + if (curSymbol.match('empty')) { + curSymbol = curSymbol.replace('empty', ''); + isEmpty = true; + } + else { + isEmpty = false; + } + if (curSymbol.match('star')) { + n = (curSymbol.replace('star','') - 0) || 5; + curSymbol = 'star'; + } + + dataTextStyle = data[i].textStyle + ? zrUtil.merge(data[i].textStyle || {}, textStyle) + : textStyle; + + textAlign = dataTextStyle.align || 'center'; + + if (rotate) { + textAlign = rotate > 0 ? 'right' : 'left'; + rotation = [rotate * Math.PI / 180, x, y - 5]; + } + else { + rotation = false; + } + + list.push({ + x: x, + n: n, + isEmpty: isEmpty, + symbol: curSymbol, + symbolSize: data[i].symbolSize || symbolSize, + color: data[i].color, + borderColor: data[i].borderColor, + borderWidth: data[i].borderWidth, + name: this._getReformedLabel(i), + textColor: dataTextStyle.color, + textAlign: textAlign, + textBaseline: dataTextStyle.baseline || 'middle', + textX: x, + textY: y - (rotate ? 5 : 0), + textFont: data[i].textStyle ? this.getFont(dataTextStyle) : textFont, + rotation: rotation, + showLabel: false + }); + } + + return list; + }, + + _buildBackground: function () { + var timelineOption = this.timelineOption; + var padding = timelineOption.padding; + var width = this._location.width; + var height = this._location.height; + + if (timelineOption.borderWidth !== 0 + || timelineOption.backgroundColor.replace(/\s/g,'') != 'rgba(0,0,0,0)' + ) { + // 背景 + this.shapeList.push(new RectangleShape({ + zlevel: this._zlevelBase, + hoverable :false, + style: { + x: this._location.x - padding[3], + y: this._location.y - padding[0], + width: width + padding[1] + padding[3], + height: height + padding[0] + padding[2], + brushType: timelineOption.borderWidth === 0 ? 'fill' : 'both', + color: timelineOption.backgroundColor, + strokeColor: timelineOption.borderColor, + lineWidth: timelineOption.borderWidth + } + })); + } + }, + + _buildControl: function() { + var self = this; + var timelineOption = this.timelineOption; + var lineStyle = timelineOption.lineStyle; + var controlStyle = timelineOption.controlStyle; + if (timelineOption.controlPosition === 'none') { + return; + } + var iconSize = 15; + var iconGap = 5; + var x; + if (timelineOption.controlPosition === 'left') { + x = this._location.x; + this._location.x += (iconSize + iconGap) * 3; + } + else { + x = this._location.x2 - ((iconSize + iconGap) * 3 - iconGap); + this._location.x2 -= (iconSize + iconGap) * 3; + } + + var y = this._location.y; + var iconStyle = { + zlevel: this._zlevelBase + 1, + style: { + iconType: 'timelineControl', + symbol: 'last', + x: x, + y: y, + width: iconSize, + height: iconSize, + brushType: 'stroke', + color: controlStyle.normal.color, + strokeColor: controlStyle.normal.color, + lineWidth: lineStyle.width + }, + highlightStyle: { + color: controlStyle.emphasis.color, + strokeColor: controlStyle.emphasis.color, + lineWidth: lineStyle.width + 1 + }, + clickable: true + }; + + this._ctrLastShape = new IconShape(iconStyle); + this._ctrLastShape.onclick = function() { + self.last(); + }; + this.shapeList.push(this._ctrLastShape); + + x += iconSize + iconGap; + this._ctrPlayShape = new IconShape(zrUtil.clone(iconStyle)); + this._ctrPlayShape.style.brushType = 'fill'; + this._ctrPlayShape.style.symbol = 'play'; + this._ctrPlayShape.style.status = this.timelineOption.autoPlay ? 'playing' : 'stop'; + this._ctrPlayShape.style.x = x; + this._ctrPlayShape.onclick = function() { + if (self._ctrPlayShape.style.status === 'stop') { + self.play(); + } + else { + self.stop(); + } + }; + this.shapeList.push(this._ctrPlayShape); + + x += iconSize + iconGap; + this._ctrNextShape = new IconShape(zrUtil.clone(iconStyle)); + this._ctrNextShape.style.symbol = 'next'; + this._ctrNextShape.style.x = x; + this._ctrNextShape.onclick = function() { + self.next(); + }; + this.shapeList.push(this._ctrNextShape); + }, + + /** + * 构建时间轴 + */ + _buildChain: function () { + var timelineOption = this.timelineOption; + var lineStyle = timelineOption.lineStyle; + this._timelineShae = { + zlevel: this._zlevelBase, + style: { + x: this._location.x, + y: this.subPixelOptimize(this._location.y, lineStyle.width), + width: this._location.x2 - this._location.x, + height: this._location.height, + chainPoint: this._chainPoint, + brushType:'both', + strokeColor: lineStyle.color, + lineWidth: lineStyle.width, + lineType: lineStyle.type + }, + hoverable: false, + clickable: true, + onclick: this._onclick + }; + + this._timelineShae = new ChainShape(this._timelineShae); + this.shapeList.push(this._timelineShae); + }, + + /** + * 构建拖拽手柄 + */ + _buildHandle: function () { + var curPoint = this._chainPoint[this.currentIndex]; + var symbolSize = curPoint.symbolSize + 1; + symbolSize = symbolSize < 5 ? 5 : symbolSize; + + this._handleShape = { + zlevel: this._zlevelBase + 1, + hoverable: false, + draggable: true, + style: { + iconType: 'diamond', + n: curPoint.n, + x: curPoint.x - symbolSize, + y: this._location.y + this._location.height / 4 - symbolSize, + width: symbolSize * 2, + height: symbolSize * 2, + brushType:'both', + textPosition: 'specific', + textX: curPoint.x, + textY: this._location.y - this._location.height / 4, + textAlign: 'center', + textBaseline: 'middle' + }, + highlightStyle: {}, + ondrift: this._ondrift, + ondragend: this._ondragend + }; + + this._handleShape = new IconShape(this._handleShape); + this.shapeList.push(this._handleShape); + }, + + /** + * 同步拖拽图形样式 + */ + _syncHandleShape: function() { + if (!this.timelineOption.show) { + return; + } + + var timelineOption = this.timelineOption; + var cpStyle = timelineOption.checkpointStyle; + var curPoint = this._chainPoint[this.currentIndex]; + + this._handleShape.style.text = cpStyle.label.show ? curPoint.name : ''; + this._handleShape.style.textFont = curPoint.textFont; + + this._handleShape.style.n = curPoint.n; + if (cpStyle.symbol === 'auto') { + this._handleShape.style.iconType = curPoint.symbol != 'none' + ? curPoint.symbol : 'diamond'; + } + else { + this._handleShape.style.iconType = cpStyle.symbol; + if (cpStyle.symbol.match('star')) { + this._handleShape.style.n = (cpStyle.symbol.replace('star','') - 0) || 5; + this._handleShape.style.iconType = 'star'; + } + } + + var symbolSize; + if (cpStyle.symbolSize === 'auto') { + symbolSize = curPoint.symbolSize + 2; + symbolSize = symbolSize < 5 ? 5 : symbolSize; + } + else { + symbolSize = cpStyle.symbolSize - 0; + } + + this._handleShape.style.color = cpStyle.color === 'auto' + ? (curPoint.color + ? curPoint.color + : timelineOption.controlStyle.emphasis.color + ) + : cpStyle.color; + this._handleShape.style.textColor = cpStyle.label.textStyle.color === 'auto' + ? this._handleShape.style.color + : cpStyle.label.textStyle.color; + this._handleShape.highlightStyle.strokeColor = + this._handleShape.style.strokeColor = cpStyle.borderColor === 'auto' + ? (curPoint.borderColor ? curPoint.borderColor : '#fff') + : cpStyle.borderColor; + this._handleShape.style.lineWidth = cpStyle.borderWidth === 'auto' + ? (curPoint.borderWidth ? curPoint.borderWidth : 0) + : (cpStyle.borderWidth - 0); + this._handleShape.highlightStyle.lineWidth = this._handleShape.style.lineWidth + 1; + + this.zr.animate(this._handleShape.id, 'style') + .when( + 500, + { + x: curPoint.x - symbolSize, + textX: curPoint.x, + y: this._location.y + this._location.height / 4 - symbolSize, + width: symbolSize * 2, + height: symbolSize * 2 + } + ) + .start('ExponentialOut'); + }, + + _findChainIndex: function(x) { + var chainPoint = this._chainPoint; + var len = chainPoint.length; + if (x <= chainPoint[0].x) { + return 0; + } + else if (x >= chainPoint[len - 1].x) { + return len - 1; + } + for (var i = 0; i < len - 1; i++) { + if (x >= chainPoint[i].x && x <= chainPoint[i + 1].x) { + // catch you! + return (Math.abs(x - chainPoint[i].x) < Math.abs(x - chainPoint[i + 1].x)) + ? i : (i + 1); + } + } + }, + + __onclick: function(param) { + var x = zrEvent.getX(param.event); + var newIndex = this._findChainIndex(x); + if (newIndex === this.currentIndex) { + return true; // 啥事都没发生 + } + + this.currentIndex = newIndex; + this.timelineOption.autoPlay && this.stop(); // 停止自动播放 + clearTimeout(this.playTicket); + this._onFrame(); + }, + + /** + * 拖拽范围控制 + */ + __ondrift: function (shape, dx) { + this.timelineOption.autoPlay && this.stop(); // 停止自动播放 + + var chainPoint = this._chainPoint; + var len = chainPoint.length; + var newIndex; + if (shape.style.x + dx <= chainPoint[0].x - chainPoint[0].symbolSize) { + shape.style.x = chainPoint[0].x - chainPoint[0].symbolSize; + newIndex = 0; + } + else if (shape.style.x + dx >= chainPoint[len - 1].x - chainPoint[len - 1].symbolSize) { + shape.style.x = chainPoint[len - 1].x - chainPoint[len - 1].symbolSize; + newIndex = len - 1; + } + else { + shape.style.x += dx; + newIndex = this._findChainIndex(shape.style.x); + } + var curPoint = chainPoint[newIndex]; + var symbolSize = curPoint.symbolSize + 2; + shape.style.iconType = curPoint.symbol; + shape.style.n = curPoint.n; + shape.style.textX = shape.style.x + symbolSize / 2; + shape.style.y = this._location.y + this._location.height / 4 - symbolSize; + shape.style.width = symbolSize * 2; + shape.style.height = symbolSize * 2; + shape.style.text = curPoint.name; + + //console.log(newIndex) + if (newIndex === this.currentIndex) { + return true; // 啥事都没发生 + } + + this.currentIndex = newIndex; + if (this.timelineOption.realtime) { + clearTimeout(this.playTicket); + var self = this; + this.playTicket = setTimeout(function() { + self._setCurrentOption(); + },200); + } + + return true; + }, + + __ondragend: function () { + this.isDragend = true; + }, + + /** + * 数据项被拖拽出去 + */ + ondragend: function (param, status) { + if (!this.isDragend || !param.target) { + // 没有在当前实例上发生拖拽行为则直接返回 + return; + } + !this.timelineOption.realtime && this._setCurrentOption(); + + // 别status = {}赋值啊!! + status.dragOut = true; + status.dragIn = true; + status.needRefresh = false; // 会有消息触发fresh,不用再刷一遍 + // 处理完拖拽事件后复位 + this.isDragend = false; + this._syncHandleShape(); + return; + }, + + last: function () { + this.timelineOption.autoPlay && this.stop(); // 停止自动播放 + + this.currentIndex -= 1; + if (this.currentIndex < 0) { + this.currentIndex = this.timelineOption.data.length - 1; + } + this._onFrame(); + + return this.currentIndex; + }, + + next: function () { + this.timelineOption.autoPlay && this.stop(); // 停止自动播放 + + this.currentIndex += 1; + if (this.currentIndex >= this.timelineOption.data.length) { + this.currentIndex = 0; + } + this._onFrame(); + + return this.currentIndex; + }, + + play: function (targetIndex, autoPlay) { + if (this._ctrPlayShape && this._ctrPlayShape.style.status != 'playing') { + this._ctrPlayShape.style.status = 'playing'; + this.zr.modShape(this._ctrPlayShape.id); + this.zr.refresh(); + } + + + this.timelineOption.autoPlay = autoPlay != null ? autoPlay : true; + + if (!this.timelineOption.autoPlay) { + clearTimeout(this.playTicket); + } + + this.currentIndex = targetIndex != null ? targetIndex : (this.currentIndex + 1); + if (this.currentIndex >= this.timelineOption.data.length) { + this.currentIndex = 0; + } + this._onFrame(); + + return this.currentIndex; + }, + + stop: function () { + if (this._ctrPlayShape && this._ctrPlayShape.style.status != 'stop') { + this._ctrPlayShape.style.status = 'stop'; + this.zr.modShape(this._ctrPlayShape.id); + this.zr.refresh(); + } + + this.timelineOption.autoPlay = false; + + clearTimeout(this.playTicket); + + return this.currentIndex; + }, + + /** + * 避免dataZoom带来两次refresh,不设refresh接口,resize重复一下buildshape逻辑 + */ + resize: function () { + if (this.timelineOption.show) { + this.clear(); + this._buildShape(); + this._syncHandleShape(); + } + }, + + setTheme: function(needRefresh) { + this.timelineOption = this.reformOption(zrUtil.clone(this.option.timeline)); + // 补全padding属性 + this.timelineOption.padding = this.reformCssArray( + this.timelineOption.padding + ); + // 通用字体设置 + this.timelineOption.label.textStyle = zrUtil.merge( + this.timelineOption.label.textStyle || {}, + this.ecTheme.textStyle + ); + this.timelineOption.checkpointStyle.label.textStyle = zrUtil.merge( + this.timelineOption.checkpointStyle.label.textStyle || {}, + this.ecTheme.textStyle + ); + + if (this.timelineOption.show && needRefresh) { + this.clear(); + this._buildShape(); + this._syncHandleShape(); + } + }, + + /** + * 释放后实例不可用,重载基类方法 + */ + dispose: function () { + this.clear(); + this.shapeList = null; + + clearTimeout(this.playTicket); + } + }; + + function timelineControl(ctx, style) { + var lineWidth = 2;//style.lineWidth; + var x = style.x + lineWidth; + var y = style.y + lineWidth + 2; + var width = style.width - lineWidth; + var height = style.height - lineWidth; + + + var symbol = style.symbol; + if (symbol === 'last') { + ctx.moveTo(x + width - 2, y + height / 3); + ctx.lineTo(x + width - 2, y); + ctx.lineTo(x + 2, y + height / 2); + ctx.lineTo(x + width - 2, y + height); + ctx.lineTo(x + width - 2, y + height / 3 * 2); + ctx.moveTo(x, y); + ctx.lineTo(x, y); + } + else if (symbol === 'next') { + ctx.moveTo(x + 2, y + height / 3); + ctx.lineTo(x + 2, y); + ctx.lineTo(x + width - 2, y + height / 2); + ctx.lineTo(x + 2, y + height); + ctx.lineTo(x + 2, y + height / 3 * 2); + ctx.moveTo(x, y); + ctx.lineTo(x, y); + } + else if (symbol === 'play') { + if (style.status === 'stop') { + ctx.moveTo(x + 2, y); + ctx.lineTo(x + width - 2, y + height / 2); + ctx.lineTo(x + 2, y + height); + ctx.lineTo(x + 2, y); + } + else { + var delta = style.brushType === 'both' ? 2 : 3; + ctx.rect(x + 2, y, delta, height); + ctx.rect(x + width - delta - 2, y, delta, height); + } + } + else if (symbol.match('image')) { + var imageLocation = ''; + imageLocation = symbol.replace( + new RegExp('^image:\\/\\/'), '' + ); + symbol = IconShape.prototype.iconLibrary.image; + symbol(ctx, { + x: x, + y: y, + width: width, + height: height, + image: imageLocation + }); + } + } + IconShape.prototype.iconLibrary['timelineControl'] = timelineControl; + + zrUtil.inherits(Timeline, Base); + + require('../component').define('timeline', Timeline); + + return Timeline; +}); + +define( + 'zrender/loadingEffect/Bar',['require','./Base','../tool/util','../tool/color','../shape/Rectangle'],function (require) { + var Base = require('./Base'); + var util = require('../tool/util'); + var zrColor = require('../tool/color'); + var RectangleShape = require('../shape/Rectangle'); + + function Bar(options) { + Base.call(this, options); + } + util.inherits(Bar, Base); + + + /** + * 进度条 + * + * @param {Object} addShapeHandle + * @param {Object} refreshHandle + */ + Bar.prototype._start = function (addShapeHandle, refreshHandle) { + // 特效默认配置 + var options = util.merge( + this.options, + { + textStyle : { + color : '#888' + }, + backgroundColor : 'rgba(250, 250, 250, 0.8)', + effectOption : { + x : 0, + y : this.canvasHeight / 2 - 30, + width : this.canvasWidth, + height : 5, + brushType : 'fill', + timeInterval : 100 + } + } + ); + + var textShape = this.createTextShape(options.textStyle); + var background = this.createBackgroundShape(options.backgroundColor); + + var effectOption = options.effectOption; + + // 初始化动画元素 + var barShape = new RectangleShape({ + highlightStyle : util.clone(effectOption) + }); + + barShape.highlightStyle.color = + effectOption.color + || zrColor.getLinearGradient( + effectOption.x, + effectOption.y, + effectOption.x + effectOption.width, + effectOption.y + effectOption.height, + [ [ 0, '#ff6400' ], [ 0.5, '#ffe100' ], [ 1, '#b1ff00' ] ] + ); + + if (options.progress != null) { + // 指定进度 + addShapeHandle(background); + + barShape.highlightStyle.width = + this.adjust(options.progress, [ 0, 1 ]) + * options.effectOption.width; + + addShapeHandle(barShape); + addShapeHandle(textShape); + + refreshHandle(); + return; + } + else { + // 循环显示 + barShape.highlightStyle.width = 0; + return setInterval( + function () { + addShapeHandle(background); + + if (barShape.highlightStyle.width < effectOption.width) { + barShape.highlightStyle.width += 8; + } + else { + barShape.highlightStyle.width = 0; + } + addShapeHandle(barShape); + addShapeHandle(textShape); + refreshHandle(); + }, + effectOption.timeInterval + ); + } + }; + + return Bar; + } +); + + +define( + 'zrender/loadingEffect/Bubble',['require','./Base','../tool/util','../tool/color','../shape/Circle'],function (require) { + var Base = require('./Base'); + var util = require('../tool/util'); + var zrColor = require('../tool/color'); + var CircleShape = require('../shape/Circle'); + + function Bubble(options) { + Base.call(this, options); + } + util.inherits(Bubble, Base); + + /** + * 泡泡 + * + * @param {Object} addShapeHandle + * @param {Object} refreshHandle + */ + Bubble.prototype._start = function (addShapeHandle, refreshHandle) { + + // 特效默认配置 + var options = util.merge( + this.options, + { + textStyle : { + color : '#888' + }, + backgroundColor : 'rgba(250, 250, 250, 0.8)', + effect : { + n : 50, + lineWidth : 2, + brushType : 'stroke', + color : 'random', + timeInterval : 100 + } + } + ); + + var textShape = this.createTextShape(options.textStyle); + var background = this.createBackgroundShape(options.backgroundColor); + + var effectOption = options.effect; + var n = effectOption.n; + var brushType = effectOption.brushType; + var lineWidth = effectOption.lineWidth; + + var shapeList = []; + var canvasWidth = this.canvasWidth; + var canvasHeight = this.canvasHeight; + + // 初始化动画元素 + for (var i = 0; i < n; i++) { + var color = effectOption.color == 'random' + ? zrColor.alpha(zrColor.random(), 0.3) + : effectOption.color; + + shapeList[i] = new CircleShape({ + highlightStyle : { + x : Math.ceil(Math.random() * canvasWidth), + y : Math.ceil(Math.random() * canvasHeight), + r : Math.ceil(Math.random() * 40), + brushType : brushType, + color : color, + strokeColor : color, + lineWidth : lineWidth + }, + animationY : Math.ceil(Math.random() * 20) + }); + } + + return setInterval( + function () { + addShapeHandle(background); + + for (var i = 0; i < n; i++) { + var style = shapeList[i].highlightStyle; + + if (style.y - shapeList[i].animationY + style.r <= 0) { + shapeList[i].highlightStyle.y = canvasHeight + style.r; + shapeList[i].highlightStyle.x = Math.ceil( + Math.random() * canvasWidth + ); + } + shapeList[i].highlightStyle.y -= + shapeList[i].animationY; + + addShapeHandle(shapeList[i]); + } + + addShapeHandle(textShape); + refreshHandle(); + }, + effectOption.timeInterval + ); + }; + + return Bubble; + } +); + + +define( + 'zrender/loadingEffect/DynamicLine',['require','./Base','../tool/util','../tool/color','../shape/Line'],function (require) { + var Base = require('./Base'); + var util = require('../tool/util'); + var zrColor = require('../tool/color'); + var LineShape = require('../shape/Line'); + + function DynamicLine(options) { + Base.call(this, options); + } + util.inherits(DynamicLine, Base); + + + /** + * 动态线 + * + * @param {Object} addShapeHandle + * @param {Object} refreshHandle + */ + DynamicLine.prototype._start = function (addShapeHandle, refreshHandle) { + // 特效默认配置 + var options = util.merge( + this.options, + { + textStyle : { + color : '#fff' + }, + backgroundColor : 'rgba(0, 0, 0, 0.8)', + effectOption : { + n : 30, + lineWidth : 1, + color : 'random', + timeInterval : 100 + } + } + ); + + var textShape = this.createTextShape(options.textStyle); + var background = this.createBackgroundShape(options.backgroundColor); + + var effectOption = options.effectOption; + var n = effectOption.n; + var lineWidth = effectOption.lineWidth; + + var shapeList = []; + var canvasWidth = this.canvasWidth; + var canvasHeight = this.canvasHeight; + + // 初始化动画元素 + for (var i = 0; i < n; i++) { + var xStart = -Math.ceil(Math.random() * 1000); + var len = Math.ceil(Math.random() * 400); + var pos = Math.ceil(Math.random() * canvasHeight); + + var color = effectOption.color == 'random' + ? zrColor.random() + : effectOption.color; + + shapeList[i] = new LineShape({ + highlightStyle : { + xStart : xStart, + yStart : pos, + xEnd : xStart + len, + yEnd : pos, + strokeColor : color, + lineWidth : lineWidth + }, + animationX : Math.ceil(Math.random() * 100), + len : len + }); + } + + return setInterval( + function() { + addShapeHandle(background); + + for (var i = 0; i < n; i++) { + var style = shapeList[i].highlightStyle; + + if (style.xStart >= canvasWidth) { + + shapeList[i].len = Math.ceil(Math.random() * 400); + style.xStart = -400; + style.xEnd = -400 + shapeList[i].len; + style.yStart = Math.ceil(Math.random() * canvasHeight); + style.yEnd = style.yStart; + } + + style.xStart += shapeList[i].animationX; + style.xEnd += shapeList[i].animationX; + + addShapeHandle(shapeList[i]); + } + + addShapeHandle(textShape); + refreshHandle(); + }, + effectOption.timeInterval + ); + }; + + return DynamicLine; + } +); + + +define( + 'zrender/loadingEffect/Ring',['require','./Base','../tool/util','../tool/color','../shape/Ring','../shape/Sector'],function (require) { + var Base = require('./Base'); + var util = require('../tool/util'); + var zrColor = require('../tool/color'); + var RingShape = require('../shape/Ring'); + var SectorShape = require('../shape/Sector'); + + function Ring(options) { + Base.call(this, options); + } + util.inherits(Ring, Base); + + + /** + * 圆环 + * + * @param {Object} addShapeHandle + * @param {Object} refreshHandle + */ + Ring.prototype._start = function (addShapeHandle, refreshHandle) { + + // 特效默认配置 + var options = util.merge( + this.options, + { + textStyle : { + color : '#07a' + }, + backgroundColor : 'rgba(250, 250, 250, 0.8)', + effect : { + x : this.canvasWidth / 2, + y : this.canvasHeight / 2, + r0 : 60, + r : 100, + color : '#bbdcff', + brushType: 'fill', + textPosition : 'inside', + textFont : 'normal 30px verdana', + textColor : 'rgba(30, 144, 255, 0.6)', + timeInterval : 100 + } + } + ); + + var effectOption = options.effect; + + var textStyle = options.textStyle; + if (textStyle.x == null) { + textStyle.x = effectOption.x; + } + if (textStyle.y == null) { + textStyle.y = (effectOption.y + (effectOption.r0 + effectOption.r) / 2 - 5); + } + + var textShape = this.createTextShape(options.textStyle); + var background = this.createBackgroundShape(options.backgroundColor); + + var x = effectOption.x; + var y = effectOption.y; + var r0 = effectOption.r0 + 6; + var r = effectOption.r - 6; + var color = effectOption.color; + var darkColor = zrColor.lift(color, 0.1); + + var shapeRing = new RingShape({ + highlightStyle : util.clone(effectOption) + }); + + // 初始化动画元素 + var shapeList = []; + var clolrList = zrColor.getGradientColors( + [ '#ff6400', '#ffe100', '#97ff00' ], 25 + ); + var preAngle = 15; + var endAngle = 240; + + for (var i = 0; i < 16; i++) { + shapeList.push(new SectorShape({ + highlightStyle : { + x : x, + y : y, + r0 : r0, + r : r, + startAngle : endAngle - preAngle, + endAngle : endAngle, + brushType: 'fill', + color : darkColor + }, + _color : zrColor.getLinearGradient( + x + r0 * Math.cos(endAngle, true), + y - r0 * Math.sin(endAngle, true), + x + r0 * Math.cos(endAngle - preAngle, true), + y - r0 * Math.sin(endAngle - preAngle, true), + [ + [ 0, clolrList[i * 2] ], + [ 1, clolrList[i * 2 + 1] ] + ] + ) + })); + endAngle -= preAngle; + } + endAngle = 360; + for (var i = 0; i < 4; i++) { + shapeList.push(new SectorShape({ + highlightStyle : { + x : x, + y : y, + r0 : r0, + r : r, + startAngle : endAngle - preAngle, + endAngle : endAngle, + brushType: 'fill', + color : darkColor + }, + _color : zrColor.getLinearGradient( + x + r0 * Math.cos(endAngle, true), + y - r0 * Math.sin(endAngle, true), + x + r0 * Math.cos(endAngle - preAngle, true), + y - r0 * Math.sin(endAngle - preAngle, true), + [ + [ 0, clolrList[i * 2 + 32] ], + [ 1, clolrList[i * 2 + 33] ] + ] + ) + })); + endAngle -= preAngle; + } + + var n = 0; + if (options.progress != null) { + // 指定进度 + addShapeHandle(background); + + n = this.adjust(options.progress, [ 0, 1 ]).toFixed(2) * 100 / 5; + shapeRing.highlightStyle.text = n * 5 + '%'; + addShapeHandle(shapeRing); + + for (var i = 0; i < 20; i++) { + shapeList[i].highlightStyle.color = i < n + ? shapeList[i]._color : darkColor; + addShapeHandle(shapeList[i]); + } + + addShapeHandle(textShape); + refreshHandle(); + return; + } + + // 循环显示 + return setInterval( + function() { + addShapeHandle(background); + + n += n >= 20 ? -20 : 1; + + // shapeRing.highlightStyle.text = n * 5 + '%'; + addShapeHandle(shapeRing); + + for (var i = 0; i < 20; i++) { + shapeList[i].highlightStyle.color = i < n + ? shapeList[i]._color : darkColor; + addShapeHandle(shapeList[i]); + } + + addShapeHandle(textShape); + refreshHandle(); + }, + effectOption.timeInterval + ); + }; + + return Ring; + } +); + + +define( + 'zrender/loadingEffect/Spin',['require','./Base','../tool/util','../tool/color','../tool/area','../shape/Sector'],function (require) { + var Base = require('./Base'); + var util = require('../tool/util'); + var zrColor = require('../tool/color'); + var zrArea = require('../tool/area'); + var SectorShape = require('../shape/Sector'); + + function Spin(options) { + Base.call(this, options); + } + util.inherits(Spin, Base); + + /** + * 旋转 + * + * @param {Object} addShapeHandle + * @param {Object} refreshHandle + */ + Spin.prototype._start = function (addShapeHandle, refreshHandle) { + var options = util.merge( + this.options, + { + textStyle : { + color : '#fff', + textAlign : 'start' + }, + backgroundColor : 'rgba(0, 0, 0, 0.8)' + } + ); + var textShape = this.createTextShape(options.textStyle); + + var textGap = 10; + var textWidth = zrArea.getTextWidth( + textShape.highlightStyle.text, textShape.highlightStyle.textFont + ); + var textHeight = zrArea.getTextHeight( + textShape.highlightStyle.text, textShape.highlightStyle.textFont + ); + + // 特效默认配置 + var effectOption = util.merge( + this.options.effect || {}, + { + r0 : 9, + r : 15, + n : 18, + color : '#fff', + timeInterval : 100 + } + ); + + var location = this.getLocation( + this.options.textStyle, + textWidth + textGap + effectOption.r * 2, + Math.max(effectOption.r * 2, textHeight) + ); + effectOption.x = location.x + effectOption.r; + effectOption.y = textShape.highlightStyle.y = location.y + location.height / 2; + textShape.highlightStyle.x = effectOption.x + effectOption.r + textGap; + + var background = this.createBackgroundShape(options.backgroundColor); + var n = effectOption.n; + var x = effectOption.x; + var y = effectOption.y; + var r0 = effectOption.r0; + var r = effectOption.r; + var color = effectOption.color; + + // 初始化动画元素 + var shapeList = []; + var preAngle = Math.round(180 / n); + for (var i = 0; i < n; i++) { + shapeList[i] = new SectorShape({ + highlightStyle : { + x : x, + y : y, + r0 : r0, + r : r, + startAngle : preAngle * i * 2, + endAngle : preAngle * i * 2 + preAngle, + color : zrColor.alpha(color, (i + 1) / n), + brushType: 'fill' + } + }); + } + + var pos = [ 0, x, y ]; + + return setInterval( + function() { + addShapeHandle(background); + pos[0] -= 0.3; + for (var i = 0; i < n; i++) { + shapeList[i].rotation = pos; + addShapeHandle(shapeList[i]); + } + + addShapeHandle(textShape); + refreshHandle(); + }, + effectOption.timeInterval + ); + }; + + return Spin; + } +); + + +define( + 'zrender/loadingEffect/Whirling',['require','./Base','../tool/util','../tool/area','../shape/Ring','../shape/Droplet','../shape/Circle'],function (require) { + var Base = require('./Base'); + var util = require('../tool/util'); + var zrArea = require('../tool/area'); + var RingShape = require('../shape/Ring'); + var DropletShape = require('../shape/Droplet'); + var CircleShape = require('../shape/Circle'); + + function Whirling(options) { + Base.call(this, options); + } + util.inherits(Whirling, Base); + + /** + * 旋转水滴 + * + * @param {Object} addShapeHandle + * @param {Object} refreshHandle + */ + Whirling.prototype._start = function (addShapeHandle, refreshHandle) { + var options = util.merge( + this.options, + { + textStyle : { + color : '#888', + textAlign : 'start' + }, + backgroundColor : 'rgba(250, 250, 250, 0.8)' + } + ); + var textShape = this.createTextShape(options.textStyle); + + var textGap = 10; + var textWidth = zrArea.getTextWidth( + textShape.highlightStyle.text, textShape.highlightStyle.textFont + ); + var textHeight = zrArea.getTextHeight( + textShape.highlightStyle.text, textShape.highlightStyle.textFont + ); + + // 特效默认配置 + var effectOption = util.merge( + this.options.effect || {}, + { + r : 18, + colorIn : '#fff', + colorOut : '#555', + colorWhirl : '#6cf', + timeInterval : 50 + } + ); + + var location = this.getLocation( + this.options.textStyle, + textWidth + textGap + effectOption.r * 2, + Math.max(effectOption.r * 2, textHeight) + ); + effectOption.x = location.x + effectOption.r; + effectOption.y = textShape.highlightStyle.y = location.y + location.height / 2; + textShape.highlightStyle.x = effectOption.x + effectOption.r + textGap; + + var background = this.createBackgroundShape(options.backgroundColor); + // 初始化动画元素 + var droplet = new DropletShape({ + highlightStyle : { + a : Math.round(effectOption.r / 2), + b : Math.round(effectOption.r - effectOption.r / 6), + brushType : 'fill', + color : effectOption.colorWhirl + } + }); + var circleIn = new CircleShape({ + highlightStyle : { + r : Math.round(effectOption.r / 6), + brushType : 'fill', + color : effectOption.colorIn + } + }); + var circleOut = new RingShape({ + highlightStyle : { + r0 : Math.round(effectOption.r - effectOption.r / 3), + r : effectOption.r, + brushType : 'fill', + color : effectOption.colorOut + } + }); + + var pos = [ 0, effectOption.x, effectOption.y ]; + + droplet.highlightStyle.x + = circleIn.highlightStyle.x + = circleOut.highlightStyle.x + = pos[1]; + droplet.highlightStyle.y + = circleIn.highlightStyle.y + = circleOut.highlightStyle.y + = pos[2]; + + return setInterval( + function() { + addShapeHandle(background); + addShapeHandle(circleOut); + pos[0] -= 0.3; + droplet.rotation = pos; + addShapeHandle(droplet); + addShapeHandle(circleIn); + addShapeHandle(textShape); + refreshHandle(); + }, + effectOption.timeInterval + ); + }; + + return Whirling; + } +); + +/** + * echarts默认主题,开发中 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/theme/default',[],function() { + var config = { + }; + + return config; +}); +/*! + * ECharts, a javascript interactive chart library. + * + * Copyright (c) 2014, Baidu Inc. + * All rights reserved. + * + * LICENSE + * https://github.com/ecomfe/echarts/blob/master/LICENSE.txt + */ + +/** + * echarts + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool/event','zrender/tool/env','zrender','zrender/config','zrender','./chart/island','./component/toolbox','./component','./component/title','./component/tooltip','./component/legend','./util/ecData','./chart','./component','zrender/tool/color','./component/timeline','zrender','zrender/shape/Image','zrender/loadingEffect/Bar','zrender/loadingEffect/Bubble','zrender/loadingEffect/DynamicLine','zrender/loadingEffect/Ring','zrender/loadingEffect/Spin','zrender/loadingEffect/Whirling','./theme/default'],function (require) { + var ecConfig = require('./config'); + var zrUtil = require('zrender/tool/util'); + var zrEvent = require('zrender/tool/event'); + + var self = { }; + + var _canvasSupported = require('zrender/tool/env').canvasSupported; + var _idBase = new Date() - 0; + var _instances = { }; // ECharts实例map索引 + var DOM_ATTRIBUTE_KEY = '_echarts_instance_'; + + self.version = '2.0.4'; + self.dependencies = { + zrender: '2.0.4' + }; + /** + * 入口方法 + */ + self.init = function (dom, theme) { + var zrender = require('zrender'); + if (((zrender.version || '1.0.3').replace('.', '') - 0) + < (self.dependencies.zrender.replace('.', '') - 0) + ) { + console.error( + 'ZRender ' + (zrender.version || '1.0.3-') + + ' is too old for ECharts ' + self.version + + '. Current version need ZRender ' + + self.dependencies.zrender + '+' + ); + } + + dom = dom instanceof Array ? dom[0] : dom; + + // dom与echarts实例映射索引 + var key = dom.getAttribute(DOM_ATTRIBUTE_KEY); + if (!key) { + key = _idBase++; + dom.setAttribute(DOM_ATTRIBUTE_KEY, key); + } + + if (_instances[key]) { + // 同一个dom上多次init,自动释放已有实例 + _instances[key].dispose(); + } + _instances[key] = new Echarts(dom); + _instances[key].id = key; + _instances[key].setTheme(theme); + + return _instances[key]; + }; + + /** + * 通过id获得ECharts实例,id可在实例化后读取 + */ + self.getInstanceById = function (key) { + return _instances[key]; + }; + + /** + * 消息中心 + */ + function MessageCenter() { + zrEvent.Dispatcher.call(this); + } + zrUtil.merge(MessageCenter.prototype, zrEvent.Dispatcher.prototype, true); + + /** + * 基于zrender实现Echarts接口层 + * @param {HtmlElement} dom 必要 + */ + function Echarts(dom) { + this._themeConfig = zrUtil.clone(ecConfig); + + this.dom = dom; + // this._zr; + // this._option; // curOption clone + // this._optionRestore; // for restore; + // this._island; + // this._toolbox; + // this._timeline; + // this._refreshInside; // 内部刷新标志位 + + this._connected = false; + this._status = { // 用于图表间通信 + dragIn: false, + dragOut: false, + needRefresh: false + }; + this._curEventType = false; // 破循环信号灯 + this._chartList = [ ]; // 图表实例 + + this._messageCenter = new MessageCenter(); + + this._messageCenterOutSide = new MessageCenter(); // Echarts层的外部消息中心,做Echarts层的消息转发 + + // resize方法经常被绑定到window.resize上,闭包一个this + this.resize = this.resize(); + + // 初始化::构造函数 + this._init(); + } + + /** + * ZRender EVENT + * + * @inner + * @const + * @type {Object} + */ + var ZR_EVENT = require('zrender/config').EVENT; + + /** + * 要绑定监听的zrender事件列表 + * + * @const + * @inner + * @type {Array} + */ + var ZR_EVENT_LISTENS = [ + 'CLICK', 'DBLCLICK', 'MOUSEOVER', 'MOUSEOUT', + 'DRAGSTART', 'DRAGEND', 'DRAGENTER', 'DRAGOVER', 'DRAGLEAVE', 'DROP' + ]; + + /** + * 对echarts的实例中的chartList属性成员,逐个进行方法调用,遍历顺序为逆序 + * 由于在事件触发的默认行为处理中,多次用到相同逻辑,所以抽象了该方法 + * 由于所有的调用场景里,最多只有两个参数,基于性能和体积考虑,这里就不使用call或者apply了 + * + * @inner + * @param {ECharts} ecInstance ECharts实例 + * @param {string} methodName 要调用的方法名 + * @param {*} arg0 调用参数1 + * @param {*} arg1 调用参数2 + * @param {*} arg2 调用参数3 + */ + function callChartListMethodReverse(ecInstance, methodName, arg0, arg1, arg2) { + var chartList = ecInstance._chartList; + var len = chartList.length; + + while (len--) { + var chart = chartList[len]; + if (typeof chart[methodName] === 'function') { + chart[methodName](arg0, arg1, arg2); + } + } + } + + Echarts.prototype = { + /** + * 初始化::构造函数 + */ + _init: function () { + var self = this; + var _zr = require('zrender').init(this.dom); + this._zr = _zr; + + // wrap: n,e,d,t for name event data this + this._messageCenter.dispatch = function(type, event, eventPackage, that) { + eventPackage = eventPackage || { }; + eventPackage.type = type; + eventPackage.event = event; + + self._messageCenter.dispatchWithContext(type, eventPackage, that); + if (type != 'HOVER' && type != 'MOUSEOUT') { // 频繁事件直接抛出 + setTimeout(function(){ + self._messageCenterOutSide.dispatchWithContext( + type, eventPackage, that + ); + },50); + } + else { + self._messageCenterOutSide.dispatchWithContext( + type, eventPackage, that + ); + } + }; + + this._onevent = function(param){ + return self.__onevent(param); + }; + for (var e in ecConfig.EVENT) { + if (e != 'CLICK' && e != 'DBLCLICK' + && e != 'HOVER' && e != 'MOUSEOUT' && e != 'MAP_ROAM' + ) { + this._messageCenter.bind(ecConfig.EVENT[e], this._onevent, this); + } + } + + + var eventBehaviors = { }; + this._onzrevent = function (param) { + return self[eventBehaviors[ param.type ]](param); + }; + + // 挂载关心的事件 + for (var i = 0, len = ZR_EVENT_LISTENS.length; i < len; i++) { + var eventName = ZR_EVENT_LISTENS[i]; + var eventValue = ZR_EVENT[eventName]; + eventBehaviors[eventValue] = '_on' + eventName.toLowerCase(); + _zr.on(eventValue, this._onzrevent); + } + + this.chart = { }; // 图表索引 + this.component = { }; // 组件索引 + + // 内置图表 + // 孤岛 + var Island = require('./chart/island'); + this._island = new Island(this._themeConfig, this._messageCenter, _zr, { }, this); + this.chart.island = this._island; + + // 内置通用组件 + // 工具箱 + var Toolbox = require('./component/toolbox'); + this._toolbox = new Toolbox(this._themeConfig, this._messageCenter, _zr, { }, this); + this.component.toolbox = this._toolbox; + + var componentLibrary = require('./component'); + componentLibrary.define('title', require('./component/title')); + componentLibrary.define('tooltip', require('./component/tooltip')); + componentLibrary.define('legend', require('./component/legend')); + + if (_zr.getWidth() === 0 || _zr.getHeight() === 0) { + console.error('Dom’s width & height should be ready before init.'); + } + }, + + /** + * ECharts事件处理中心 + */ + __onevent: function (param){ + param.__echartsId = param.__echartsId || this.id; + + // 来自其他联动图表的事件 + var fromMyself = (param.__echartsId === this.id); + + if (!this._curEventType) { + this._curEventType = param.type; + } + + switch (param.type) { + case ecConfig.EVENT.LEGEND_SELECTED : + this._onlegendSelected(param); + break; + case ecConfig.EVENT.DATA_ZOOM : + if (!fromMyself) { + var dz = this.component.dataZoom; + if (dz) { + dz.silence(true); + dz.absoluteZoom(param.zoom); + dz.silence(false); + } + } + this._ondataZoom(param); + break; + case ecConfig.EVENT.DATA_RANGE : + fromMyself && this._ondataRange(param); + break; + case ecConfig.EVENT.MAGIC_TYPE_CHANGED : + if (!fromMyself) { + var tb = this.component.toolbox; + if (tb) { + tb.silence(true); + tb.setMagicType(param.magicType); + tb.silence(false); + } + } + this._onmagicTypeChanged(param); + break; + case ecConfig.EVENT.DATA_VIEW_CHANGED : + fromMyself && this._ondataViewChanged(param); + break; + case ecConfig.EVENT.TOOLTIP_HOVER : + fromMyself && this._tooltipHover(param); + break; + case ecConfig.EVENT.RESTORE : + this._onrestore(); + break; + case ecConfig.EVENT.REFRESH : + fromMyself && this._onrefresh(param); + break; + // 鼠标同步 + case ecConfig.EVENT.TOOLTIP_IN_GRID : + case ecConfig.EVENT.TOOLTIP_OUT_GRID : + if (!fromMyself) { + // 只处理来自外部的鼠标同步 + var grid = this.component.grid; + if (grid) { + this._zr.trigger( + 'mousemove', + { + connectTrigger: true, + zrenderX: grid.getX() + param.x * grid.getWidth(), + zrenderY: grid.getY() + param.y * grid.getHeight() + } + ); + } + } + else if (this._connected) { + // 来自自己,并且存在多图联动,空间坐标映射修改参数分发 + var grid = this.component.grid; + if (grid) { + param.x = (param.event.zrenderX - grid.getX()) / grid.getWidth(); + param.y = (param.event.zrenderY - grid.getY()) / grid.getHeight(); + } + } + break; + /* + case ecConfig.EVENT.RESIZE : + case ecConfig.EVENT.DATA_CHANGED : + case ecConfig.EVENT.PIE_SELECTED : + case ecConfig.EVENT.MAP_SELECTED : + break; + */ + } + + // 多图联动,只做自己的一级事件分发,避免级联事件循环 + if (this._connected && fromMyself && this._curEventType === param.type) { + for (var c in this._connected) { + this._connected[c].connectedEventHandler(param); + } + // 分发完毕后复位 + this._curEventType = null; + } + + if (!fromMyself || (!this._connected && fromMyself)) { // 处理了完联动事件复位 + this._curEventType = null; + } + }, + + /** + * 点击事件,响应zrender事件,包装后分发到Echarts层 + */ + _onclick: function (param) { + callChartListMethodReverse(this, 'onclick', param); + + if (param.target) { + var ecData = this._eventPackage(param.target); + if (ecData && ecData.seriesIndex != null) { + this._messageCenter.dispatch( + ecConfig.EVENT.CLICK, + param.event, + ecData, + this + ); + } + } + }, + + /** + * 双击事件,响应zrender事件,包装后分发到Echarts层 + */ + _ondblclick: function (param) { + callChartListMethodReverse(this, 'ondblclick', param); + + if (param.target) { + var ecData = this._eventPackage(param.target); + if (ecData && ecData.seriesIndex != null) { + this._messageCenter.dispatch( + ecConfig.EVENT.DBLCLICK, + param.event, + ecData, + this + ); + } + } + }, + + /** + * 鼠标移入事件,响应zrender事件,包装后分发到Echarts层 + */ + _onmouseover: function (param) { + if (param.target) { + var ecData = this._eventPackage(param.target); + if (ecData && ecData.seriesIndex != null) { + this._messageCenter.dispatch( + ecConfig.EVENT.HOVER, + param.event, + ecData, + this + ); + } + } + }, + + /** + * 鼠标移出事件,响应zrender事件,包装后分发到Echarts层 + */ + _onmouseout: function (param) { + if (param.target) { + var ecData = this._eventPackage(param.target); + if (ecData && ecData.seriesIndex != null) { + this._messageCenter.dispatch( + ecConfig.EVENT.MOUSEOUT, + param.event, + ecData, + this + ); + } + } + }, + + /** + * dragstart回调,可计算特性实现 + */ + _ondragstart: function (param) { + // 复位用于图表间通信拖拽标识 + this._status = { + dragIn: false, + dragOut: false, + needRefresh: false + }; + + callChartListMethodReverse(this, 'ondragstart', param); + }, + + /** + * dragging回调,可计算特性实现 + */ + _ondragenter: function (param) { + callChartListMethodReverse(this, 'ondragenter', param); + }, + + /** + * dragstart回调,可计算特性实现 + */ + _ondragover: function (param) { + callChartListMethodReverse(this, 'ondragover', param); + }, + + /** + * dragstart回调,可计算特性实现 + */ + _ondragleave: function (param) { + callChartListMethodReverse(this, 'ondragleave', param); + }, + + /** + * dragstart回调,可计算特性实现 + */ + _ondrop: function (param) { + callChartListMethodReverse(this, 'ondrop', param, this._status); + this._island.ondrop(param, this._status); + }, + + /** + * dragdone回调 ,可计算特性实现 + */ + _ondragend: function (param) { + callChartListMethodReverse(this, 'ondragend', param, this._status); + + this._timeline && this._timeline.ondragend(param, this._status); + this._island.ondragend(param, this._status); + + // 发生过重计算 + if (this._status.needRefresh) { + this._syncBackupData(this._option); + + var messageCenter = this._messageCenter; + messageCenter.dispatch( + ecConfig.EVENT.DATA_CHANGED, + param.event, + this._eventPackage(param.target), + this + ); + messageCenter.dispatch(ecConfig.EVENT.REFRESH, null, null, this); + } + }, + + /** + * 图例选择响应 + */ + _onlegendSelected: function (param) { + // 用于图表间通信 + this._status.needRefresh = false; + callChartListMethodReverse(this, 'onlegendSelected', param, this._status); + + if (this._status.needRefresh) { + this._messageCenter.dispatch(ecConfig.EVENT.REFRESH, null, null, this); + } + }, + + /** + * 数据区域缩放响应 + */ + _ondataZoom: function (param) { + // 用于图表间通信 + this._status.needRefresh = false; + callChartListMethodReverse(this, 'ondataZoom', param, this._status); + + if (this._status.needRefresh) { + this._messageCenter.dispatch(ecConfig.EVENT.REFRESH, null, null, this); + } + }, + + /** + * 值域漫游响应 + */ + _ondataRange: function (param) { + this._clearEffect(); + // 用于图表间通信 + this._status.needRefresh = false; + callChartListMethodReverse(this, 'ondataRange', param, this._status); + + // 没有相互影响,直接刷新即可 + if (this._status.needRefresh) { + this._zr.refresh(); + } + }, + + /** + * 动态类型切换响应 + */ + _onmagicTypeChanged: function () { + this._clearEffect(); + this._render(this._toolbox.getMagicOption()); + }, + + /** + * 数据视图修改响应 + */ + _ondataViewChanged: function (param) { + this._syncBackupData(param.option); + this._messageCenter.dispatch( + ecConfig.EVENT.DATA_CHANGED, + null, + param, + this + ); + this._messageCenter.dispatch(ecConfig.EVENT.REFRESH, null, null, this); + }, + + /** + * tooltip与图表间通信 + */ + _tooltipHover: function (param) { + var tipShape = [ ]; + callChartListMethodReverse(this, 'ontooltipHover', param, tipShape); + }, + + /** + * 还原 + */ + _onrestore: function () { + this.restore(); + }, + + /** + * 刷新 + */ + _onrefresh: function (param) { + this._refreshInside = true; + this.refresh(param); + this._refreshInside = false; + }, + + /** + * 数据修改后的反向同步dataZoom持有的备份数据 + */ + _syncBackupData: function (curOption) { + this.component.dataZoom && this.component.dataZoom.syncBackupData(curOption); + }, + + /** + * 打包Echarts层的事件附件 + */ + _eventPackage: function (target) { + if (target) { + var ecData = require('./util/ecData'); + + var seriesIndex = ecData.get(target, 'seriesIndex'); + var dataIndex = ecData.get(target, 'dataIndex'); + + dataIndex = seriesIndex != -1 && this.component.dataZoom + ? this.component.dataZoom.getRealDataIndex( + seriesIndex, + dataIndex + ) + : dataIndex; + return { + seriesIndex: seriesIndex, + seriesName: (ecData.get(target, 'series') || { }).name, + dataIndex: dataIndex, + data: ecData.get(target, 'data'), + name: ecData.get(target, 'name'), + value: ecData.get(target, 'value'), + special: ecData.get(target, 'special') + }; + } + return; + }, + + /** + * 图表渲染 + */ + _render: function (magicOption) { + this._mergeGlobalConifg(magicOption); + + var bgColor = magicOption.backgroundColor; + if (bgColor) { + if (!_canvasSupported + && bgColor.indexOf('rgba') != -1 + ) { + // IE6~8对RGBA的处理,filter会带来其他颜色的影响 + var cList = bgColor.split(','); + this.dom.style.filter = 'alpha(opacity=' + + cList[3].substring(0, cList[3].lastIndexOf(')')) * 100 + + ')'; + cList.length = 3; + cList[0] = cList[0].replace('a', ''); + this.dom.style.backgroundColor = cList.join(',') + ')'; + } + else { + this.dom.style.backgroundColor = bgColor; + } + } + + this._zr.clearAnimation(); + this._chartList = [ ]; + + var chartLibrary = require('./chart'); + var componentLibrary = require('./component'); + + if (magicOption.xAxis || magicOption.yAxis) { + magicOption.grid = magicOption.grid || { }; + magicOption.dataZoom = magicOption.dataZoom || { }; + } + + var componentList = [ + 'title', 'legend', 'tooltip', 'dataRange', 'roamController', + 'grid', 'dataZoom', 'xAxis', 'yAxis', 'polar' + ]; + + var ComponentClass; + var componentType; + var component; + for (var i = 0, l = componentList.length; i < l; i++) { + componentType = componentList[i]; + component = this.component[componentType]; + + if (magicOption[componentType]) { + if (component) { + component.refresh && component.refresh(magicOption); + } + else { + ComponentClass = componentLibrary.get( + /^[xy]Axis$/.test(componentType) ? 'axis' : componentType + ); + component = new ComponentClass( + this._themeConfig, this._messageCenter, this._zr, + magicOption, this, componentType + ); + this.component[componentType] = component; + } + this._chartList.push(component); + } + else if (component) { + component.dispose(); + this.component[componentType] = null; + delete this.component[componentType]; + } + } + + var ChartClass; + var chartType; + var chart; + var chartMap = { }; // 记录已经初始化的图表 + for (var i = 0, l = magicOption.series.length; i < l; i++) { + chartType = magicOption.series[i].type; + if (!chartType) { + console.error('series[' + i + '] chart type has not been defined.'); + continue; + } + + if (!chartMap[chartType]) { + chartMap[chartType] = true; + ChartClass = chartLibrary.get(chartType); + if (ChartClass) { + if (this.chart[chartType]) { + chart = this.chart[chartType]; + chart.refresh(magicOption); + } + else { + chart = new ChartClass( + this._themeConfig, this._messageCenter, this._zr, + magicOption, this + ); + } + this._chartList.push(chart); + this.chart[chartType] = chart; + } + else { + console.error(chartType + ' has not been required.'); + } + } + } + + // 已有实例但新option不带这类图表的实例释放 + for (chartType in this.chart) { + if (chartType != ecConfig.CHART_TYPE_ISLAND && !chartMap[chartType]) { + this.chart[chartType].dispose(); + this.chart[chartType] = null; + delete this.chart[chartType]; + } + } + + this.component.grid && this.component.grid.refixAxisShape(this.component); + + this._island.refresh(magicOption); + this._toolbox.refresh(magicOption); + + magicOption.animation && !magicOption.renderAsImage + ? this._zr.refresh() + : this._zr.render(); + + var imgId = 'IMG' + this.id; + var img = document.getElementById(imgId); + if (magicOption.renderAsImage && _canvasSupported) { + // IE8- 不支持图片渲染形式 + if (img) { + // 已经渲染过则更新显示 + img.src = this.getDataURL(magicOption.renderAsImage); + } + else { + // 没有渲染过插入img dom + img = this.getImage(magicOption.renderAsImage); + img.id = imgId; + img.style.position = 'absolute'; + img.style.left = 0; + img.style.top = 0; + this.dom.firstChild.appendChild(img); + } + this.un(); + this._zr.un(); + this._disposeChartList(); + this._zr.clear(); + } + else if (img) { + // 删除可能存在的img + img.parentNode.removeChild(img); + } + img = null; + + this._option = magicOption; + }, + + /** + * 还原 + */ + restore: function () { + this._clearEffect(); + this._option = zrUtil.clone(this._optionRestore); + this._disposeChartList(); + this._island.clear(); + this._toolbox.reset(this._option, true); + this._render(this._option); + }, + + /** + * 刷新 + * @param {Object=} param,可选参数,用于附带option,内部同步用,外部不建议带入数据修改,无法同步 + */ + refresh: function (param) { + this._clearEffect(); + param = param || { }; + var magicOption = param.option; + + // 外部调用的refresh且有option带入 + if (!this._refreshInside && magicOption) { + // 做简单的差异合并去同步内部持有的数据克隆,不建议带入数据 + // 开启数据区域缩放、拖拽重计算、数据视图可编辑模式情况下,当用户产生了数据变化后无法同步 + // 如有带入option存在数据变化,请重新setOption + magicOption = this.getOption(); + zrUtil.merge(magicOption, param.option, true); + zrUtil.merge(this._optionRestore, param.option, true); + this._toolbox.reset(magicOption); + } + + this._island.refresh(magicOption); + this._toolbox.refresh(magicOption); + + // 停止动画 + this._zr.clearAnimation(); + // 先来后到,安顺序刷新各种图表,图表内部refresh优化检查magicOption,无需更新则不更新~ + for (var i = 0, l = this._chartList.length; i < l; i++) { + this._chartList[i].refresh && this._chartList[i].refresh(magicOption); + } + this.component.grid && this.component.grid.refixAxisShape(this.component); + this._zr.refresh(); + }, + + /** + * 释放图表实例 + */ + _disposeChartList: function () { + this._clearEffect(); + + // 停止动画 + this._zr.clearAnimation(); + + var len = this._chartList.length; + while (len--) { + var chart = this._chartList[len]; + + if (chart) { + var chartType = chart.type; + this.chart[chartType] && delete this.chart[chartType]; + this.component[chartType] && delete this.component[chartType]; + chart.dispose && chart.dispose(); + } + } + + this._chartList = [ ]; + }, + + /** + * 非图表全局属性merge~~ + */ + _mergeGlobalConifg: function (magicOption) { + var mergeList = [ + // 背景颜色 + 'backgroundColor', + + // 拖拽重计算相关 + 'calculable', 'calculableColor', 'calculableHolderColor', + + // 孤岛显示连接符 + 'nameConnector', 'valueConnector', + + // 动画相关 + 'animation', 'animationThreshold', 'animationDuration', + 'animationEasing', 'addDataAnimation', + + // 默认标志图形类型列表 + 'symbolList', + + // 降低图表内元素拖拽敏感度,单位ms,不建议外部干预 + 'DRAG_ENABLE_TIME' + ]; + + var len = mergeList.length; + while (len--) { + var mergeItem = mergeList[len]; + if (magicOption[mergeItem] == null) { + magicOption[mergeItem] = this._themeConfig[mergeItem]; + } + } + + // 数值系列的颜色列表,不传则采用内置颜色,可配数组,借用zrender实例注入,会有冲突风险,先这样 + var themeColor = magicOption.color; + if (!(themeColor && themeColor.length)) { + themeColor = this._themeConfig.color; + } + + this._zr.getColor = function (idx) { + var zrColor = require('zrender/tool/color'); + return zrColor.getColor(idx, themeColor); + }; + }, + + /** + * 万能接口,配置图表实例任何可配置选项,多次调用时option选项做merge处理 + * @param {Object} option + * @param {boolean=} notMerge 多次调用时option选项是默认是合并(merge)的, + * 如果不需求,可以通过notMerger参数为true阻止与上次option的合并 + */ + setOption: function (option, notMerge) { + if (!option.timeline) { + return this._setOption(option, notMerge); + } + else { + return this._setTimelineOption(option); + } + }, + + /** + * 万能接口,配置图表实例任何可配置选项,多次调用时option选项做merge处理 + * @param {Object} option + * @param {boolean=} notMerge 多次调用时option选项是默认是合并(merge)的, + * 如果不需求,可以通过notMerger参数为true阻止与上次option的合并 + */ + _setOption: function (option, notMerge) { + if (!notMerge && this._option) { + this._option = zrUtil.merge( + this.getOption(), + zrUtil.clone(option), + true + ); + } + else { + this._option = zrUtil.clone(option); + } + + this._optionRestore = zrUtil.clone(this._option); + + if (!this._option.series || this._option.series.length === 0) { + this._zr.clear(); + return; + } + + if (this.component.dataZoom // 存在dataZoom控件 + && (this._option.dataZoom // 并且新option也存在 + || (this._option.toolbox + && this._option.toolbox.feature + && this._option.toolbox.feature.dataZoom + && this._option.toolbox.feature.dataZoom.show + ) + ) + ) { + // dataZoom同步数据 + this.component.dataZoom.syncOption(this._option); + } + this._toolbox.reset(this._option); + this._render(this._option); + return this; + }, + + /** + * 返回内部持有的当前显示option克隆 + */ + getOption: function () { + var magicOption = zrUtil.clone(this._option); + + var self = this; + function restoreOption(prop) { + var restoreSource = self._optionRestore[prop]; + + if (restoreSource) { + if (restoreSource instanceof Array) { + var len = restoreSource.length; + while (len--) { + magicOption[prop][len].data = zrUtil.clone( + restoreSource[len].data + ); + } + } + else { + magicOption[prop].data = zrUtil.clone(restoreSource.data); + } + } + } + + // 横轴数据还原 + restoreOption('xAxis'); + + // 纵轴数据还原 + restoreOption('yAxis'); + + // 系列数据还原 + restoreOption('series'); + + return magicOption; + }, + + /** + * 数据设置快捷接口 + * @param {Array} series + * @param {boolean=} notMerge 多次调用时option选项是默认是合并(merge)的, + * 如果不需求,可以通过notMerger参数为true阻止与上次option的合并。 + */ + setSeries: function (series, notMerge) { + if (!notMerge) { + this.setOption({series: series}); + } + else { + this._option.series = series; + this.setOption(this._option, notMerge); + } + return this; + }, + + /** + * 返回内部持有的当前显示series克隆 + */ + getSeries: function () { + return this.getOption().series; + }, + + /** + * timelineOption接口,配置图表实例任何可配置选项 + * @param {Object} option + */ + _setTimelineOption: function(option) { + this._timeline && this._timeline.dispose(); + var Timeline = require('./component/timeline'); + var timeline = new Timeline( + this._themeConfig, this._messageCenter, this._zr, option, this + ); + this._timeline = timeline; + this.component.timeline = this._timeline; + + return this; + }, + + /** + * 动态数据添加 + * 形参为单组数据参数,多组时为数据,内容同[seriesIdx, data, isShift, additionData] + * @param {number} seriesIdx 系列索引 + * @param {number | Object} data 增加数据 + * @param {boolean=} isHead 是否队头加入,默认,不指定或false时为队尾插入 + * @param {boolean=} dataGrow 是否增长数据队列长度,默认,不指定或false时移出目标数组对位数据 + * @param {string=} additionData 是否增加类目轴(饼图为图例)数据,附加操作同isHead和dataGrow + */ + addData: function (seriesIdx, data, isHead, dataGrow, additionData) { + var params = seriesIdx instanceof Array + ? seriesIdx + : [[seriesIdx, data, isHead, dataGrow, additionData]]; + + //this._optionRestore 和 magicOption 都要同步 + var magicOption = this.getOption(); + var optionRestore = this._optionRestore; + for (var i = 0, l = params.length; i < l; i++) { + seriesIdx = params[i][0]; + data = params[i][1]; + isHead = params[i][2]; + dataGrow = params[i][3]; + additionData = params[i][4]; + + + var seriesItem = optionRestore.series[seriesIdx]; + var inMethod = isHead ? 'unshift' : 'push'; + var outMethod = isHead ? 'pop' : 'shift'; + if (seriesItem) { + var seriesItemData = seriesItem.data; + var mSeriesItemData = magicOption.series[seriesIdx].data; + + seriesItemData[inMethod](data); + mSeriesItemData[inMethod](data); + if (!dataGrow) { + seriesItemData[outMethod](); + data = mSeriesItemData[outMethod](); + } + + + if (additionData != null) { + var legend; + var legendData; + + if (seriesItem.type === ecConfig.CHART_TYPE_PIE + && (legend = optionRestore.legend) + && (legendData = legend.data) + ) { + var mLegendData = magicOption.legend.data; + legendData[inMethod](additionData); + mLegendData[inMethod](additionData); + + if (!dataGrow) { + var legendDataIdx = zrUtil.indexOf(legendData, data.name); + legendDataIdx != -1 && legendData.splice(legendDataIdx, 1); + + legendDataIdx = zrUtil.indexOf(mLegendData, data.name); + legendDataIdx != -1 && mLegendData.splice(legendDataIdx, 1); + } + } + else if (optionRestore.xAxis != null && optionRestore.yAxis != null) { + // x轴类目 + var axisData; + var mAxisData; + var axisIdx = seriesItem.xAxisIndex || 0; + + if (optionRestore.xAxis[axisIdx].type == null + || optionRestore.xAxis[axisIdx].type === 'category' + ) { + axisData = optionRestore.xAxis[axisIdx].data; + mAxisData = magicOption.xAxis[axisIdx].data; + + axisData[inMethod](additionData); + mAxisData[inMethod](additionData); + if (!dataGrow) { + axisData[outMethod](); + mAxisData[outMethod](); + } + } + + // y轴类目 + axisIdx = seriesItem.yAxisIndex || 0; + if (optionRestore.yAxis[axisIdx].type === 'category') { + axisData = optionRestore.yAxis[axisIdx].data; + mAxisData = magicOption.yAxis[axisIdx].data; + + axisData[inMethod](additionData); + mAxisData[inMethod](additionData); + if (!dataGrow) { + axisData[outMethod](); + mAxisData[outMethod](); + } + } + } + } + + // 同步图表内状态,动画需要 + this._option.series[seriesIdx].data = magicOption.series[seriesIdx].data; + } + } + + this._zr.clearAnimation(); + var chartList = this._chartList; + for (var i = 0, l = chartList.length; i < l; i++) { + if (magicOption.addDataAnimation && chartList[i].addDataAnimation) { + chartList[i].addDataAnimation(params); + } + } + + // dataZoom同步数据 + this.component.dataZoom && this.component.dataZoom.syncOption(magicOption); + + this._option = magicOption; + var self = this; + setTimeout(function (){ + if (!self._zr) { + return; // 已经被释放 + } + self._zr.clearAnimation(); + for (var i = 0, l = chartList.length; i < l; i++) { + // 有addData动画就去掉过渡动画 + chartList[i].motionlessOnce = + magicOption.addDataAnimation && chartList[i].addDataAnimation; + } + self._messageCenter.dispatch( + ecConfig.EVENT.REFRESH, + null, + {option: magicOption}, + self + ); + }, magicOption.addDataAnimation ? 500 : 0); + return this; + }, + + /** + * 动态[标注 | 标线]添加 + * @param {number} seriesIdx 系列索引 + * @param {Object} markData [标注 | 标线]对象,支持多个 + */ + addMarkPoint: function (seriesIdx, markData) { + return this._addMark(seriesIdx, markData, 'markPoint'); + }, + + addMarkLine: function (seriesIdx, markData) { + return this._addMark(seriesIdx, markData, 'markLine'); + }, + + _addMark: function (seriesIdx, markData, markType) { + var series = this._option.series; + var seriesItem; + + if (series && (seriesItem = series[seriesIdx])) { + var seriesR = this._optionRestore.series; + var seriesRItem = seriesR[seriesIdx]; + var markOpt = seriesItem[markType]; + var markOptR = seriesRItem[markType]; + + markOpt = seriesItem[markType] = markOpt || {data: [ ]}; + markOptR = seriesRItem[markType] = markOptR || {data: [ ]}; + + for (var key in markData) { + if (key === 'data') { + // 数据concat + markOpt.data = markOpt.data.concat(markData.data); + markOptR.data = markOptR.data.concat(markData.data); + } + else if (typeof markData[key] != 'object' || markOpt[key] == null) { + // 简单类型或新值直接赋值 + markOpt[key] = markOptR[key] = markData[key]; + } + else { + // 非数据的复杂对象merge + zrUtil.merge(markOpt[key], markData[key], true); + zrUtil.merge(markOptR[key], markData[key], true); + } + } + + var chart = this.chart[seriesItem.type]; + chart && chart.addMark(seriesIdx, markData, markType); + } + + return this; + }, + + /** + * 动态[标注 | 标线]删除 + * @param {number} seriesIdx 系列索引 + * @param {string} markName [标注 | 标线]名称 + */ + delMarkPoint: function (seriesIdx, markName) { + return this._delMark(seriesIdx, markName, 'markPoint'); + }, + + delMarkLine: function (seriesIdx, markName) { + return this._delMark(seriesIdx, markName, 'markLine'); + }, + + _delMark: function (seriesIdx, markName, markType) { + var series = this._option.series; + var seriesItem; + var mark; + var dataArray; + + if (!( + series + && (seriesItem = series[seriesIdx]) + && (mark = seriesItem[markType]) + && (dataArray = mark.data) + ) + ) { + return this; + } + + markName = markName.split(' > '); + var targetIndex = -1; + + for (var i = 0, l = dataArray.length; i < l; i++) { + var dataItem = dataArray[i]; + if (dataItem instanceof Array) { + if (dataItem[0].name === markName[0] + && dataItem[1].name === markName[1] + ) { + targetIndex = i; + break; + } + } + else if (dataItem.name === markName[0]) { + targetIndex = i; + break; + } + } + + if (targetIndex > -1) { + dataArray.splice(targetIndex, 1); + this._optionRestore.series[seriesIdx][markType].data.splice(targetIndex, 1); + + var chart = this.chart[seriesItem.type]; + chart && chart.delMark(seriesIdx, markName.join(' > '), markType); + } + + return this; + }, + + /** + * 获取当前dom + */ + getDom: function () { + return this.dom; + }, + + /** + * 获取当前zrender实例,可用于添加额为的shape和深度控制 + */ + getZrender: function () { + return this._zr; + }, + + /** + * 获取Base64图片dataURL + * @param {string} imgType 图片类型,支持png|jpeg,默认为png + * @return imgDataURL + */ + getDataURL: function (imgType) { + if (!_canvasSupported) { + return ''; + } + + if (this._chartList.length === 0) { + // 渲染为图片 + var imgId = 'IMG' + this.id; + var img = document.getElementById(imgId); + if (img) { + return img.src; + } + } + + // 清除可能存在的tooltip元素 + var tooltip = this.component.tooltip; + tooltip && tooltip.hideTip(); + + switch (imgType) { + case 'jpeg': + break; + default: + imgType = 'png'; + } + + var bgColor = this._option.backgroundColor; + if (bgColor && bgColor.replace(' ','') === 'rgba(0,0,0,0)') { + bgColor = '#fff'; + } + + return this._zr.toDataURL('image/' + imgType, bgColor); + }, + + /** + * 获取img + * @param {string} imgType 图片类型,支持png|jpeg,默认为png + * @return img dom + */ + getImage: function (imgType) { + var title = this._optionRestore.title; + var imgDom = document.createElement('img'); + imgDom.src = this.getDataURL(imgType); + imgDom.title = (title && title.text) || 'ECharts'; + return imgDom; + }, + + /** + * 获取多图联动的Base64图片dataURL + * @param {string} imgType 图片类型,支持png|jpeg,默认为png + * @return imgDataURL + */ + getConnectedDataURL: function (imgType) { + if (!this.isConnected()) { + return this.getDataURL(imgType); + } + + var tempDom = this.dom; + var imgList = { + 'self': { + img: this.getDataURL(imgType), + left: tempDom.offsetLeft, + top: tempDom.offsetTop, + right: tempDom.offsetLeft + tempDom.offsetWidth, + bottom: tempDom.offsetTop + tempDom.offsetHeight + } + }; + + var minLeft = imgList.self.left; + var minTop = imgList.self.top; + var maxRight = imgList.self.right; + var maxBottom = imgList.self.bottom; + + for (var c in this._connected) { + tempDom = this._connected[c].getDom(); + imgList[c] = { + img: this._connected[c].getDataURL(imgType), + left: tempDom.offsetLeft, + top: tempDom.offsetTop, + right: tempDom.offsetLeft + tempDom.offsetWidth, + bottom: tempDom.offsetTop + tempDom.offsetHeight + }; + + minLeft = Math.min(minLeft, imgList[c].left); + minTop = Math.min(minTop, imgList[c].top); + maxRight = Math.max(maxRight, imgList[c].right); + maxBottom = Math.max(maxBottom, imgList[c].bottom); + } + + var zrDom = document.createElement('div'); + zrDom.style.position = 'absolute'; + zrDom.style.left = '-4000px'; + zrDom.style.width = (maxRight - minLeft) + 'px'; + zrDom.style.height = (maxBottom - minTop) + 'px'; + document.body.appendChild(zrDom); + + var zrImg = require('zrender').init(zrDom); + + var ImageShape = require('zrender/shape/Image'); + for (var c in imgList) { + zrImg.addShape(new ImageShape({ + style: { + x: imgList[c].left - minLeft, + y: imgList[c].top - minTop, + image: imgList[c].img + } + })); + } + + zrImg.render(); + var bgColor = this._option.backgroundColor; + if (bgColor && bgColor.replace(/ /g, '') === 'rgba(0,0,0,0)') { + bgColor = '#fff'; + } + + var image = zrImg.toDataURL('image/png', bgColor); + + setTimeout(function () { + zrImg.dispose(); + zrDom.parentNode.removeChild(zrDom); + zrDom = null; + }, 100); + + return image; + }, + + /** + * 获取多图联动的img + * @param {string} imgType 图片类型,支持png|jpeg,默认为png + * @return img dom + */ + getConnectedImage: function (imgType) { + var title = this._optionRestore.title; + var imgDom = document.createElement('img'); + imgDom.src = this.getConnectedDataURL(imgType); + imgDom.title = (title && title.text) || 'ECharts'; + return imgDom; + }, + + /** + * 外部接口绑定事件 + * @param {Object} eventName 事件名称 + * @param {Object} eventListener 事件响应函数 + */ + on: function (eventName, eventListener) { + this._messageCenterOutSide.bind(eventName, eventListener, this); + return this; + }, + + /** + * 外部接口解除事件绑定 + * @param {Object} eventName 事件名称 + * @param {Object} eventListener 事件响应函数 + */ + un: function (eventName, eventListener) { + this._messageCenterOutSide.unbind(eventName, eventListener); + return this; + }, + + /** + * 多图联动 + * @param connectTarget{ECharts | Array } connectTarget 联动目标 + */ + connect: function (connectTarget) { + if (!connectTarget) { + return this; + } + + if (!this._connected) { + this._connected = { }; + } + + if (connectTarget instanceof Array) { + for (var i = 0, l = connectTarget.length; i < l; i++) { + this._connected[connectTarget[i].id] = connectTarget[i]; + } + } + else { + this._connected[connectTarget.id] = connectTarget; + } + + return this; + }, + + /** + * 解除多图联动 + * @param connectTarget{ECharts | Array } connectTarget 解除联动目标 + */ + disConnect: function (connectTarget) { + if (!connectTarget || !this._connected) { + return this; + } + + if (connectTarget instanceof Array) { + for (var i = 0, l = connectTarget.length; i < l; i++) { + delete this._connected[connectTarget[i].id]; + } + } + else { + delete this._connected[connectTarget.id]; + } + + for (var k in this._connected) { + return k, this; // 非空 + } + + // 空,转为标志位 + this._connected = false; + return this; + }, + + /** + * 联动事件响应 + */ + connectedEventHandler: function (param) { + if (param.__echartsId != this.id) { + // 来自其他联动图表的事件 + this._onevent(param); + } + }, + + /** + * 是否存在多图联动 + */ + isConnected: function () { + return !!this._connected; + }, + + /** + * 显示loading过渡 + * @param {Object} loadingOption + */ + showLoading: function (loadingOption) { + var effectList = { + bar: require('zrender/loadingEffect/Bar'), + bubble: require('zrender/loadingEffect/Bubble'), + dynamicLine: require('zrender/loadingEffect/DynamicLine'), + ring: require('zrender/loadingEffect/Ring'), + spin: require('zrender/loadingEffect/Spin'), + whirling: require('zrender/loadingEffect/Whirling') + }; + this._toolbox.hideDataView(); + + loadingOption = loadingOption || { }; + + var textStyle = loadingOption.textStyle || { }; + loadingOption.textStyle = textStyle; + + var finalTextStyle = zrUtil.merge( + zrUtil.clone(textStyle), + this._themeConfig.textStyle + ); + textStyle.textFont = finalTextStyle.fontStyle + ' ' + + finalTextStyle.fontWeight + ' ' + + finalTextStyle.fontSize + 'px ' + + finalTextStyle.fontFamily; + + textStyle.text = loadingOption.text || this._themeConfig.loadingText; + + if (loadingOption.x != null) { + textStyle.x = loadingOption.x; + } + if (loadingOption.y != null) { + textStyle.y = loadingOption.y; + } + + loadingOption.effectOption = loadingOption.effectOption || { }; + loadingOption.effectOption.textStyle = textStyle; + + var Effect = loadingOption.effect; + if (typeof Effect === 'string' || Effect == null) { + Effect = effectList[loadingOption.effect || 'spin']; + } + this._zr.showLoading(new Effect(loadingOption.effectOption)); + return this; + }, + + /** + * 隐藏loading过渡 + */ + hideLoading: function () { + this._zr.hideLoading(); + return this; + }, + + /** + * 主题设置 + */ + setTheme: function (theme) { + if (theme) { + if (typeof theme === 'string') { + // 默认主题 + switch (theme) { + // case 'themename': + // theme = require('./theme/themename'); + default: + theme = require('./theme/default'); + } + } + else { + theme = theme || { }; + } + + // 复位默认配置 + // this._themeConfig会被别的对象引用持有 + // 所以不能改成this._themeConfig = { }; + for (var key in this._themeConfig) { + delete this._themeConfig[key]; + } + for (var key in ecConfig) { + this._themeConfig[key] = zrUtil.clone(ecConfig[key]); + } + + // 颜色数组随theme,不merge + theme.color && (this._themeConfig.color = [ ]); + + // 默认标志图形类型列表,不merge + theme.symbolList && (this._themeConfig.symbolList = [ ]); + + // 应用新主题 + zrUtil.merge(this._themeConfig, zrUtil.clone(theme), true); + } + + if (!_canvasSupported) { // IE8- + this._themeConfig.textStyle.fontFamily = this._themeConfig.textStyle.fontFamily2; + } + + this._timeline && this._timeline.setTheme(true); + this._optionRestore && this.restore(); + }, + + /** + * 视图区域大小变化更新,不默认绑定,供使用方按需调用 + */ + resize: function () { + var self = this; + return function(){ + self._clearEffect(); + self._zr.resize(); + if (self._option && self._option.renderAsImage && _canvasSupported) { + // 渲染为图片重走render模式 + self._render(self._option); + return self; + } + // 停止动画 + self._zr.clearAnimation(); + self._island.resize(); + self._toolbox.resize(); + self._timeline && self._timeline.resize(); + // 先来后到,不能仅刷新自己,也不能在上一个循环中刷新,如坐标系数据改变会影响其他图表的大小 + // 所以安顺序刷新各种图表,图表内部refresh优化无需更新则不更新~ + for (var i = 0, l = self._chartList.length; i < l; i++) { + self._chartList[i].resize && self._chartList[i].resize(); + } + self.component.grid && self.component.grid.refixAxisShape(self.component); + self._zr.refresh(); + self._messageCenter.dispatch(ecConfig.EVENT.RESIZE, null, null, self); + return self; + }; + }, + + _clearEffect: function() { + this._zr.modLayer(ecConfig.EFFECT_ZLEVEL, { motionBlur: false }); + this._zr.painter.clearLayer(ecConfig.EFFECT_ZLEVEL); + }, + + /** + * 清除已渲染内容 ,clear后echarts实例可用 + */ + clear: function () { + this._disposeChartList(); + this._zr.clear(); + this._option = { }; + this._optionRestore = { }; + return this; + }, + + /** + * 释放,dispose后echarts实例不可用 + */ + dispose: function () { + var key = this.dom.getAttribute(DOM_ATTRIBUTE_KEY); + key && delete _instances[key]; + + this._island.dispose(); + this._toolbox.dispose(); + this._timeline && this._timeline.dispose(); + this._messageCenter.unbind(); + this.clear(); + this._zr.dispose(); + this._zr = null; + } + }; + + return self; +}); +define('echarts', ['echarts/echarts'], function (main) { return main; }); - require('../tool/util').inherits(Ellipse, Base); - return Ellipse; - } +/** + * zrender + * + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + * shape类:仪表盘指针 + * 可配图形属性: + { + // 基础属性 + shape : 'gauge-pointer', // 必须,shape类标识,需要显式指定 + id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 + zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 + invisible : {boolean}, // 默认为false,是否可见 + + // 样式属性,默认状态样式样式属性 + style : { + xStart : {number}, // 必须,起点横坐标 + yStart : {number}, // 必须,起点纵坐标 + xEnd : {number}, // 必须,终点横坐标 + yEnd : {number}, // 必须,终点纵坐标 + strokeColor : {color}, // 默认为'#000',线条颜色(轮廓),支持rgba + lineWidth : {number}, // 线条宽度 + }, + + // 交互属性,详见shape.Base + + // 事件属性,详见shape.Base + } + */ +define('echarts/util/shape/GaugePointer',['require','zrender/shape/Base','zrender/tool/util','./normalIsCover'],function (require) { + var Base = require('zrender/shape/Base'); + var zrUtil = require('zrender/tool/util'); + + function GaugePointer(options) { + Base.call(this, options); + } + + GaugePointer.prototype = { + type: 'gauge-pointer', + /** + * 创建矩形路径 + * @param {Context2D} ctx Canvas 2D上下文 + * @param {Object} style 样式 + */ + buildPath : function (ctx, style) { + var r = style.r; + var width = style.width; + var angle = style.angle; + var x = style.x - Math.cos(angle) * width * (width >= r / 3 ? 1 : 2); + var y = style.y + Math.sin(angle) * width * (width >= r / 3 ? 1 : 2); + + angle = style.angle - Math.PI / 2; + ctx.moveTo(x, y); + ctx.lineTo( + style.x + Math.cos(angle) * width, + style.y - Math.sin(angle) * width + ); + ctx.lineTo( + style.x + Math.cos(style.angle) * r, + style.y - Math.sin(style.angle) * r + ); + ctx.lineTo( + style.x - Math.cos(angle) * width, + style.y + Math.sin(angle) * width + ); + ctx.lineTo(x, y); + return; + }, + + /** + * 返回矩形区域,用于局部刷新和文字定位 + * @param {Object} style + */ + getRect : function(style) { + if (style.__rect) { + return style.__rect; + } + + var width = style.width * 2; + var xStart = style.x; + var yStart = style.y; + var xEnd = xStart + Math.cos(style.angle) * style.r; + var yEnd = yStart - Math.sin(style.angle) * style.r; + + style.__rect = { + x : Math.min(xStart, xEnd) - width, + y : Math.min(yStart, yEnd) - width, + width : Math.abs(xStart - xEnd) + width, + height : Math.abs(yStart - yEnd) + width + }; + return style.__rect; + }, + + isCover : require('./normalIsCover') + }; + + zrUtil.inherits(GaugePointer, Base); + + return GaugePointer; +}); + +/** + * echarts图表类:仪表盘 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/chart/gauge',['require','../component/base','./base','../util/shape/GaugePointer','zrender/shape/Text','zrender/shape/Line','zrender/shape/Rectangle','zrender/shape/Circle','zrender/shape/Sector','../config','../util/ecData','../util/accMath','zrender/tool/util','../chart'],function (require) { + var ComponentBase = require('../component/base'); + var ChartBase = require('./base'); + + // 图形依赖 + var GaugePointerShape = require('../util/shape/GaugePointer'); + var TextShape = require('zrender/shape/Text'); + var LineShape = require('zrender/shape/Line'); + var RectangleShape = require('zrender/shape/Rectangle'); + var CircleShape = require('zrender/shape/Circle'); + var SectorShape = require('zrender/shape/Sector'); + + var ecConfig = require('../config'); + var ecData = require('../util/ecData'); + var accMath = require('../util/accMath'); + var zrUtil = require('zrender/tool/util'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} series 数据 + * @param {Object} component 组件 + */ + function Gauge(ecTheme, messageCenter, zr, option, myChart){ + // 基类 + ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); + // 图表基类 + ChartBase.call(this); + this.refresh(option); + } + + Gauge.prototype = { + type: ecConfig.CHART_TYPE_GAUGE, + /** + * 绘制图形 + */ + _buildShape: function () { + var series = this.series; + // 复用参数索引 + this._paramsMap = {}; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type === ecConfig.CHART_TYPE_GAUGE) { + series[i] = this.reformOption(series[i]); + this._buildSingleGauge(i); + this.buildMark(i); + } + } + + this.addShapeList(); + }, + + /** + * 构建单个仪表盘 + * + * @param {number} seriesIndex 系列索引 + */ + _buildSingleGauge: function (seriesIndex) { + var serie = this.series[seriesIndex]; + + this._paramsMap[seriesIndex] = { + center: this.parseCenter(this.zr, serie.center), + radius: this.parseRadius(this.zr, serie.radius), + startAngle: serie.startAngle.toFixed(2) - 0, + endAngle: serie.endAngle.toFixed(2) - 0 + }; + this._paramsMap[seriesIndex].totalAngle = this._paramsMap[seriesIndex].startAngle + - this._paramsMap[seriesIndex].endAngle; + + this._colorMap(seriesIndex); + + this._buildAxisLine(seriesIndex); + + this._buildSplitLine(seriesIndex); + + this._buildAxisTick(seriesIndex); + + this._buildAxisLabel(seriesIndex); + + this._buildPointer(seriesIndex); + + this._buildTitle(seriesIndex); + + this._buildDetail(seriesIndex); + }, + + // 轴线 + _buildAxisLine: function (seriesIndex) { + var serie = this.series[seriesIndex]; + if (!serie.axisLine.show) { + return; + } + var min = serie.min; + var total = serie.max - min; + var params = this._paramsMap[seriesIndex]; + var center = params.center; + var startAngle = params.startAngle; + var totalAngle = params.totalAngle; + var colorArray = params.colorArray; + var lineStyle = serie.axisLine.lineStyle; + var lineWidth = this.parsePercent(lineStyle.width, params.radius[1]); + var r = params.radius[1]; + var r0 = r - lineWidth; + + var sectorShape; + var lastAngle = startAngle; + var newAngle; + for (var i = 0, l = colorArray.length; i < l; i++) { + newAngle = startAngle - totalAngle * (colorArray[i][0] - min) / total; + sectorShape = this._getSector( + center, r0, r, + newAngle, // startAngle + lastAngle, // endAngle + colorArray[i][1], // color + lineStyle + ); + lastAngle = newAngle; + sectorShape._animationAdd = 'r'; + ecData.set(sectorShape, 'seriesIndex', seriesIndex); + ecData.set(sectorShape, 'dataIndex', i); + this.shapeList.push(sectorShape); + } + }, + + // 坐标轴分割线 + _buildSplitLine: function (seriesIndex) { + var serie = this.series[seriesIndex]; + if (!serie.splitLine.show) { + return; + } + + var params = this._paramsMap[seriesIndex]; + var splitNumber = serie.splitNumber; + var min = serie.min; + var total = serie.max - min; + var splitLine = serie.splitLine; + var length = this.parsePercent( + splitLine.length, params.radius[1] + ); + var lineStyle = splitLine.lineStyle; + var color = lineStyle.color; + var center = params.center; + var startAngle = params.startAngle * Math.PI / 180; + var totalAngle = params.totalAngle * Math.PI / 180; + var r = params.radius[1]; + var r0 = r - length; + + var angle; + var sinAngle; + var cosAngle; + for (var i = 0; i <= splitNumber; i++) { + angle = startAngle - totalAngle / splitNumber * i; + sinAngle = Math.sin(angle); + cosAngle = Math.cos(angle); + this.shapeList.push(new LineShape({ + zlevel: this._zlevelBase + 1, + hoverable: false, + style: { + xStart: center[0] + cosAngle * r, + yStart: center[1] - sinAngle * r, + xEnd: center[0] + cosAngle * r0, + yEnd: center[1] - sinAngle * r0, + strokeColor: color === 'auto' + ? this._getColor(seriesIndex, min + total / splitNumber * i) + : color, + lineType: lineStyle.type, + lineWidth: lineStyle.width, + shadowColor: lineStyle.shadowColor, + shadowBlur: lineStyle.shadowBlur, + shadowOffsetX: lineStyle.shadowOffsetX, + shadowOffsetY: lineStyle.shadowOffsetY + } + })); + } + }, + + // 小标记 + _buildAxisTick: function (seriesIndex) { + var serie = this.series[seriesIndex]; + if (!serie.axisTick.show) { + return; + } + + var params = this._paramsMap[seriesIndex]; + var splitNumber = serie.splitNumber; + var min = serie.min; + var total = serie.max - min; + var axisTick = serie.axisTick; + var tickSplit = axisTick.splitNumber; + var length = this.parsePercent( + axisTick.length, params.radius[1] + ); + var lineStyle = axisTick.lineStyle; + var color = lineStyle.color; + + var center = params.center; + var startAngle = params.startAngle * Math.PI / 180; + var totalAngle = params.totalAngle * Math.PI / 180; + var r = params.radius[1]; + var r0 = r - length; + + var angle; + var sinAngle; + var cosAngle; + for (var i = 0, l = splitNumber * tickSplit; i <= l; i++) { + if (i % tickSplit === 0) { // 同splitLine + continue; + } + angle = startAngle - totalAngle / l * i; + sinAngle = Math.sin(angle); + cosAngle = Math.cos(angle); + this.shapeList.push(new LineShape({ + zlevel: this._zlevelBase + 1, + hoverable: false, + style: { + xStart: center[0] + cosAngle * r, + yStart: center[1] - sinAngle * r, + xEnd: center[0] + cosAngle * r0, + yEnd: center[1] - sinAngle * r0, + strokeColor: color === 'auto' + ? this._getColor(seriesIndex, min + total / l * i) + : color, + lineType: lineStyle.type, + lineWidth: lineStyle.width, + shadowColor: lineStyle.shadowColor, + shadowBlur: lineStyle.shadowBlur, + shadowOffsetX: lineStyle.shadowOffsetX, + shadowOffsetY: lineStyle.shadowOffsetY + } + })); + } + }, + + // 坐标轴文本 + _buildAxisLabel: function (seriesIndex) { + var serie = this.series[seriesIndex]; + if (!serie.axisLabel.show) { + return; + } + + var splitNumber = serie.splitNumber; + var min = serie.min; + var total = serie.max - min; + var textStyle = serie.axisLabel.textStyle; + var textFont = this.getFont(textStyle); + var color = textStyle.color; + + var params = this._paramsMap[seriesIndex]; + var center = params.center; + var startAngle = params.startAngle; + var totalAngle = params.totalAngle; + var r0 = params.radius[1] + - this.parsePercent( + serie.splitLine.length, params.radius[1] + ) - 10; + + var angle; + var sinAngle; + var cosAngle; + var value; + for (var i = 0; i <= splitNumber; i++) { + value = accMath.accAdd( + min , accMath.accMul(accMath.accDiv(total , splitNumber), i) + ); + angle = startAngle - totalAngle / splitNumber * i; + sinAngle = Math.sin(angle * Math.PI / 180); + cosAngle = Math.cos(angle * Math.PI / 180); + angle = (angle + 360) % 360; + this.shapeList.push(new TextShape({ + zlevel: this._zlevelBase + 1, + hoverable: false, + style: { + x: center[0] + cosAngle * r0, + y: center[1] - sinAngle * r0, + color: color === 'auto' ? this._getColor(seriesIndex, value) : color, + text: this._getLabelText(serie.axisLabel.formatter, value), + textAlign: (angle >= 110 && angle <= 250) + ? 'left' + : (angle <= 70 || angle >= 290) + ? 'right' + : 'center', + textBaseline: (angle >= 10 && angle <= 170) + ? 'top' + : (angle >= 190 && angle <= 350) + ? 'bottom' + : 'middle', + textFont: textFont, + shadowColor: textStyle.shadowColor, + shadowBlur: textStyle.shadowBlur, + shadowOffsetX: textStyle.shadowOffsetX, + shadowOffsetY: textStyle.shadowOffsetY + } + })); + } + }, + + _buildPointer: function (seriesIndex) { + var serie = this.series[seriesIndex]; + if (!serie.pointer.show) { + return; + } + var total = serie.max - serie.min; + var pointer = serie.pointer; + + var params = this._paramsMap[seriesIndex]; + var length = this.parsePercent(pointer.length, params.radius[1]); + var width = this.parsePercent(pointer.width, params.radius[1]); + var center = params.center; + var value = this._getValue(seriesIndex); + value = value < serie.max ? value : serie.max; + + var angle = (params.startAngle - params.totalAngle / total * (value - serie.min)) * Math.PI / 180; + var color = pointer.color === 'auto' + ? this._getColor(seriesIndex, value) : pointer.color; + + var pointShape = new GaugePointerShape({ + zlevel: this._zlevelBase + 1, + style: { + x: center[0], + y: center[1], + r: length, + startAngle: params.startAngle * Math.PI / 180, + angle: angle, + color: color, + width: width, + shadowColor: pointer.shadowColor, + shadowBlur: pointer.shadowBlur, + shadowOffsetX: pointer.shadowOffsetX, + shadowOffsetY: pointer.shadowOffsetY + }, + highlightStyle: { + brushType: 'fill', + width: width > 2 ? 2 : (width / 2), + color: '#fff' + } + }); + ecData.pack( + pointShape, + this.series[seriesIndex], seriesIndex, + this.series[seriesIndex].data[0], 0, + this.series[seriesIndex].data[0].name, + value + ); + this.shapeList.push(pointShape); + + this.shapeList.push(new CircleShape({ + zlevel: this._zlevelBase + 2, + hoverable: false, + style: { + x: center[0], + y: center[1], + r: pointer.width / 2.5, + color: '#fff' + } + })); + }, + + _buildTitle: function(seriesIndex) { + var serie = this.series[seriesIndex]; + if (!serie.title.show) { + return; + } + + var data = serie.data[0]; + var name = data.name != null ? data.name : ''; + if (name !== '') { // 不要帮我代码规范 + var title = serie.title; + var offsetCenter = title.offsetCenter; + var textStyle = title.textStyle; + var textColor = textStyle.color; + var params = this._paramsMap[seriesIndex]; + var x = params.center[0] + this.parsePercent(offsetCenter[0], params.radius[1]); + var y = params.center[1] + this.parsePercent(offsetCenter[1], params.radius[1]); + this.shapeList.push(new TextShape({ + zlevel: this._zlevelBase + + (Math.abs(x - params.center[0]) + Math.abs(y - params.center[1])) + < textStyle.fontSize * 2 ? 2 : 1, + hoverable: false, + style: { + x: x, + y: y, + color: textColor === 'auto' ? this._getColor(seriesIndex) : textColor, + text: name, + textAlign: 'center', + textFont: this.getFont(textStyle), + shadowColor: textStyle.shadowColor, + shadowBlur: textStyle.shadowBlur, + shadowOffsetX: textStyle.shadowOffsetX, + shadowOffsetY: textStyle.shadowOffsetY + } + })); + } + }, + + _buildDetail: function(seriesIndex) { + var serie = this.series[seriesIndex]; + if (!serie.detail.show) { + return; + } + + var detail = serie.detail; + var offsetCenter = detail.offsetCenter; + var color = detail.backgroundColor; + var textStyle = detail.textStyle; + var textColor = textStyle.color; + + var params = this._paramsMap[seriesIndex]; + var value = this._getValue(seriesIndex); + var x = params.center[0] - detail.width / 2 + + this.parsePercent(offsetCenter[0], params.radius[1]); + var y = params.center[1] + + this.parsePercent(offsetCenter[1], params.radius[1]); + this.shapeList.push(new RectangleShape({ + zlevel: this._zlevelBase + + (Math.abs(x+detail.width/2 - params.center[0]) + + Math.abs(y+detail.height/2 - params.center[1])) < textStyle.fontSize + ? 2 : 1, + hoverable: false, + style: { + x: x, + y: y, + width: detail.width, + height: detail.height, + brushType: 'both', + color: color === 'auto' ? this._getColor(seriesIndex, value) : color, + lineWidth: detail.borderWidth, + strokeColor: detail.borderColor, + + shadowColor: detail.shadowColor, + shadowBlur: detail.shadowBlur, + shadowOffsetX: detail.shadowOffsetX, + shadowOffsetY: detail.shadowOffsetY, + + text: this._getLabelText(detail.formatter, value), + textFont: this.getFont(textStyle), + textPosition: 'inside', + textColor: textColor === 'auto' ? this._getColor(seriesIndex, value) : textColor + } + })); + }, + + _getValue: function(seriesIndex) { + var data = this.series[seriesIndex].data[0]; + return data.value != null ? data.value : data; + }, + + /** + * 颜色索引 + */ + _colorMap: function (seriesIndex) { + var serie = this.series[seriesIndex]; + var min = serie.min; + var total = serie.max - min; + var color = serie.axisLine.lineStyle.color; + if (!(color instanceof Array)) { + color = [[1, color]]; + } + var colorArray = []; + for (var i = 0, l = color.length; i < l; i++) { + colorArray.push([color[i][0] * total + min, color[i][1]]); + } + this._paramsMap[seriesIndex].colorArray = colorArray; + }, + + /** + * 自动颜色 + */ + _getColor: function (seriesIndex, value) { + if (value == null) { + value = this._getValue(seriesIndex); + } + + var colorArray = this._paramsMap[seriesIndex].colorArray; + for (var i = 0, l = colorArray.length; i < l; i++) { + if (colorArray[i][0] >= value) { + return colorArray[i][1]; + } + } + return colorArray[colorArray.length - 1][1]; + }, + + /** + * 构建扇形 + */ + _getSector: function (center, r0, r, startAngle, endAngle, color, lineStyle) { + return new SectorShape ({ + zlevel: this._zlevelBase, + hoverable: false, + style: { + x: center[0], // 圆心横坐标 + y: center[1], // 圆心纵坐标 + r0: r0, // 圆环内半径 + r: r, // 圆环外半径 + startAngle: startAngle, + endAngle: endAngle, + brushType: 'fill', + color: color, + shadowColor: lineStyle.shadowColor, + shadowBlur: lineStyle.shadowBlur, + shadowOffsetX: lineStyle.shadowOffsetX, + shadowOffsetY: lineStyle.shadowOffsetY + } + }); + }, + + /** + * 根据lable.format计算label text + */ + _getLabelText: function (formatter, value) { + if (formatter) { + if (typeof formatter === 'function') { + return formatter.call(this.myChart, value); + } + else if (typeof formatter === 'string') { + return formatter.replace('{value}', value); + } + } + return value; + }, + + /** + * 刷新 + */ + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + + this.backupShapeList(); + this._buildShape(); + } + }; + + zrUtil.inherits(Gauge, ChartBase); + zrUtil.inherits(Gauge, ComponentBase); + + // 图表注册 + require('../chart').define('gauge', Gauge); + + return Gauge; +}); +/** + * echarts图表类:漏斗图 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/chart/funnel',['require','../component/base','./base','zrender/shape/Text','zrender/shape/Line','zrender/shape/Polygon','../config','../util/ecData','../util/number','zrender/tool/util','zrender/tool/color','zrender/tool/area','../chart'],function (require) { + var ComponentBase = require('../component/base'); + var ChartBase = require('./base'); + + // 图形依赖 + var TextShape = require('zrender/shape/Text'); + var LineShape = require('zrender/shape/Line'); + var PolygonShape = require('zrender/shape/Polygon'); + + var ecConfig = require('../config'); + var ecData = require('../util/ecData'); + var number = require('../util/number'); + var zrUtil = require('zrender/tool/util'); + var zrColor = require('zrender/tool/color'); + var zrArea = require('zrender/tool/area'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} series 数据 + * @param {Object} component 组件 + */ + function Funnel(ecTheme, messageCenter, zr, option, myChart){ + // 基类 + ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); + // 图表基类 + ChartBase.call(this); + this.refresh(option); + } + + Funnel.prototype = { + type: ecConfig.CHART_TYPE_FUNNEL, + /** + * 绘制图形 + */ + _buildShape: function () { + var series = this.series; + var legend = this.component.legend; + // 复用参数索引 + this._paramsMap = {}; + this._selected = {}; + this.selectedMap = {}; + + var serieName; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type === ecConfig.CHART_TYPE_FUNNEL) { + series[i] = this.reformOption(series[i]); + serieName = series[i].name || ''; + // 系列图例开关 + this.selectedMap[serieName] = legend ? legend.isSelected(serieName) : true; + if (!this.selectedMap[serieName]) { + continue; + } + this._buildSingleFunnel(i); + this.buildMark(i); + } + } + + this.addShapeList(); + }, + + /** + * 构建单个仪表盘 + * + * @param {number} seriesIndex 系列索引 + */ + _buildSingleFunnel: function (seriesIndex) { + var legend = this.component.legend; + var serie = this.series[seriesIndex]; + var data = this._mapData(seriesIndex); + var location = this._getLocation(seriesIndex); + this._paramsMap[seriesIndex] = { + location: location, + data: data + }; + + var itemName; + var total = 0; + var selectedData = []; + // 计算需要显示的个数和总值 + for (var i = 0, l = data.length; i < l; i++) { + itemName = data[i].name; + if (legend){ + this.selectedMap[itemName] = legend.isSelected(itemName); + } else { + this.selectedMap[itemName] = true; + } + if (this.selectedMap[itemName] && !isNaN(data[i].value)) { + selectedData.push(data[i]); + total++; + } + } + if (total === 0) { + return; + } + // 可计算箱子 + var funnelCase = this._buildFunnelCase(seriesIndex); + var gap = serie.gap; + var height = total > 1 + ? (location.height - (total - 1) * gap) / total : location.height; + var width; + var lastY = location.y; + var lastWidth = serie.sort === 'descending' + ? this._getItemWidth(seriesIndex, selectedData[0].value) + : number.parsePercent(serie.minSize, location.width); + var next = serie.sort === 'descending' ? 1 : 0; + var centerX = location.centerX; + var pointList = [ + [ + centerX - lastWidth / 2 - (lastWidth === 0 ? 0 : 10), + lastY - (lastWidth === 0 ? 10 : 5) + ], + [ + centerX + lastWidth / 2 + (lastWidth === 0 ? 0 : 10), + lastY - (lastWidth === 0 ? 10 : 5) + ] + ]; + for (var i = 0, l = selectedData.length; i < l; i++) { + itemName = selectedData[i].name; + if (this.selectedMap[itemName] && !isNaN(selectedData[i].value)) { + width = i <= l - 2 + ? this._getItemWidth(seriesIndex, selectedData[i + next].value) + : serie.sort === 'descending' + ? number.parsePercent(serie.minSize, location.width) + : number.parsePercent(serie.maxSize, location.width); + this._buildItem( + seriesIndex, selectedData[i]._index, + legend + ? legend.getColor(itemName) : this.zr.getColor(selectedData[i]._index), + centerX - lastWidth / 2, lastY, + lastWidth, width, height + ); + lastY += height + gap; + lastWidth = width; + pointList.unshift([centerX - lastWidth / 2 - 10, lastY]); + pointList.push([centerX + lastWidth / 2 + 10, lastY]); + } + } + if (funnelCase) { + if (lastWidth === 0) { + pointList.pop(); + pointList[0][0] +=10; + pointList[0][1] +=10; + } + else { + pointList[pointList.length - 1][1] +=5; + pointList[0][1] +=5; + } + funnelCase.style.pointList = pointList; + } + }, + + _buildFunnelCase: function(seriesIndex) { + var serie = this.series[seriesIndex]; + if (this.deepQuery([serie, this.option], 'calculable')) { + var location = this._paramsMap[seriesIndex].location; + var gap = 10; + var funnelCase = { + hoverable: false, + style: { + pointListd: [ + [location.x - gap, location.y - gap], + [location.x + location.width + gap, location.y - gap], + [location.x + location.width + gap, location.y + location.height + gap], + [location.x - gap, location.y + location.height + gap] + ], + brushType: 'stroke', + lineWidth: 1, + strokeColor: serie.calculableHolderColor + || this.ecTheme.calculableHolderColor + } + }; + ecData.pack(funnelCase, serie, seriesIndex, undefined, -1); + this.setCalculable(funnelCase); + funnelCase = new PolygonShape(funnelCase); + this.shapeList.push(funnelCase); + return funnelCase; + } + }, + + _getLocation: function (seriesIndex) { + var gridOption = this.series[seriesIndex]; + var zrWidth = this.zr.getWidth(); + var zrHeight = this.zr.getHeight(); + var x = this.parsePercent(gridOption.x, zrWidth); + var y = this.parsePercent(gridOption.y, zrHeight); + + var width; + if (gridOption.width == null) { + width = zrWidth - x - this.parsePercent(gridOption.x2, zrWidth); + } + else { + width = this.parsePercent(gridOption.width, zrWidth); + } + + var height; + if (gridOption.height == null) { + height = zrHeight - y - this.parsePercent(gridOption.y2, zrHeight); + } + else { + height = this.parsePercent(gridOption.height, zrHeight); + } + + return { + x: x, + y: y, + width: width, + height: height, + centerX: x + width / 2 + }; + }, + + _mapData: function(seriesIndex) { + var serie = this.series[seriesIndex]; + var funnelData = zrUtil.clone(serie.data); + for (var i = 0, l = funnelData.length; i < l; i++) { + funnelData[i]._index = i; + } + function numDescending (a, b) { + if (a.value === '-') { + return 1; + } + else if (b.value === '-') { + return -1; + } + return b.value - a.value; + } + function numAscending (a, b) { + return -numDescending(a, b); + } + if (serie.sort != 'none') { + funnelData.sort(serie.sort === 'descending' ? numDescending : numAscending); + } + + return funnelData; + }, + + /** + * 构建单个扇形及指标 + */ + _buildItem: function ( + seriesIndex, dataIndex, defaultColor, + x, y, topWidth, bottomWidth, height + ) { + var series = this.series; + var serie = series[seriesIndex]; + var data = serie.data[dataIndex]; + // 漏斗 + var polygon = this.getPolygon( + seriesIndex, dataIndex, defaultColor, + x, y, topWidth, bottomWidth, height + ); + ecData.pack( + polygon, + series[seriesIndex], seriesIndex, + series[seriesIndex].data[dataIndex], dataIndex, + series[seriesIndex].data[dataIndex].name + ); + this.shapeList.push(polygon); + + // 文本标签 + var label = this.getLabel( + seriesIndex, dataIndex, defaultColor, + x, y, topWidth, bottomWidth, height + ); + ecData.pack( + label, + series[seriesIndex], seriesIndex, + series[seriesIndex].data[dataIndex], dataIndex, + series[seriesIndex].data[dataIndex].name + ); + this.shapeList.push(label); + // 特定状态下是否需要显示文本标签 + if (!this._needLabel(serie, data,false)) { + label.invisible = true; + } + + // 文本标签视觉引导线 + var labelLine = this.getLabelLine( + seriesIndex, dataIndex, defaultColor, + x, y, topWidth, bottomWidth, height + ); + this.shapeList.push(labelLine); + // 特定状态下是否需要显示文本标签引导线 + if (!this._needLabelLine(serie, data,false)) { + labelLine.invisible = true; + } + + var polygonHoverConnect = []; + var labelHoverConnect = []; + if (this._needLabelLine(serie, data, true)) { + polygonHoverConnect.push(labelLine.id); + labelHoverConnect.push(labelLine.id); + } + if (this._needLabel(serie, data, true)) { + polygonHoverConnect.push(label.id); + labelHoverConnect.push(polygon.id); + } + polygon.hoverConnect = polygonHoverConnect; + label.hoverConnect = labelHoverConnect; + polygon.onmouseover = label.onmouseover = this.hoverConnect; + }, + + /** + * 根据值计算宽度 + */ + _getItemWidth: function (seriesIndex, value) { + var serie = this.series[seriesIndex]; + var location = this._paramsMap[seriesIndex].location; + var min = serie.min; + var max = serie.max; + var minSize = number.parsePercent(serie.minSize, location.width); + var maxSize = number.parsePercent(serie.maxSize, location.width); + return value * (maxSize - minSize) / (max - min); + }, + + /** + * 构建扇形 + */ + getPolygon: function ( + seriesIndex, dataIndex, defaultColor, + x, y, topWidth, bottomWidth, height + ) { + var serie = this.series[seriesIndex]; + var data = serie.data[dataIndex]; + var queryTarget = [data, serie]; + + // 多级控制 + var normal = this.deepMerge( + queryTarget, + 'itemStyle.normal' + ) || {}; + var emphasis = this.deepMerge( + queryTarget, + 'itemStyle.emphasis' + ) || {}; + var normalColor = this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) + || defaultColor; + + var emphasisColor = this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data) + || (typeof normalColor === 'string' + ? zrColor.lift(normalColor, -0.2) + : normalColor + ); + + var polygon = { + zlevel: this._zlevelBase, + clickable: this.deepQuery(queryTarget, 'clickable'), + style: { + pointList: [ + [x, y], + [x + topWidth, y], + [x + topWidth - (topWidth - bottomWidth) / 2, y + height], + [x + (topWidth - bottomWidth) / 2, y + height] + ], + brushType: 'both', + color: normalColor, + lineWidth: normal.borderWidth, + strokeColor: normal.borderColor + }, + highlightStyle: { + color: emphasisColor, + lineWidth: emphasis.borderWidth, + strokeColor: emphasis.borderColor + } + }; + + if (this.deepQuery([data, serie, this.option], 'calculable')) { + this.setCalculable(polygon); + polygon.draggable = true; + } + + return new PolygonShape(polygon); + }, + + /** + * 需要显示则会有返回构建好的shape,否则返回undefined + */ + getLabel: function ( + seriesIndex, dataIndex, defaultColor, + x, y, topWidth, bottomWidth, height + ) { + var serie = this.series[seriesIndex]; + var data = serie.data[dataIndex]; + var location = this._paramsMap[seriesIndex].location; + // serie里有默认配置,放心大胆的用! + var itemStyle = zrUtil.merge( + zrUtil.clone(data.itemStyle) || {}, + serie.itemStyle + ); + var status = 'normal'; + // label配置 + var labelControl = itemStyle[status].label; + var textStyle = labelControl.textStyle || {}; + var lineLength = itemStyle[status].labelLine.length; + + var text = this.getLabelText(seriesIndex, dataIndex, status); + var textFont = this.getFont(textStyle); + var textAlign; + var textX; + var textColor = defaultColor; + labelControl.position = labelControl.position + || itemStyle.normal.label.position; + if (labelControl.position === 'inner' || labelControl.position === 'inside') { + // 内部 + textAlign = 'center'; + textX = x + topWidth / 2; + if (Math.max(topWidth, bottomWidth) / 2 > zrArea.getTextWidth(text, textFont)) { + textColor = '#fff'; + } + else { + textColor = zrColor.reverse(defaultColor); + } + } + else if (labelControl.position === 'left'){ + // 左侧显示 + textAlign = 'right'; + textX = lineLength === 'auto' + ? (location.x - 10) + : (location.centerX - Math.max(topWidth, bottomWidth) / 2 - lineLength); + } + else { + // 右侧显示,默认 labelControl.position === 'outer' || 'right) + textAlign = 'left'; + textX = lineLength === 'auto' + ? (location.x + location.width + 10) + : (location.centerX + Math.max(topWidth, bottomWidth) / 2 + lineLength); + } + + var textShape = { + zlevel: this._zlevelBase + 1, + style: { + x: textX, + y: y + height / 2, + color: textStyle.color || textColor, + text: text, + textAlign: textStyle.align || textAlign, + textBaseline: textStyle.baseline || 'middle', + textFont: textFont + } + }; + + //----------高亮 + status = 'emphasis'; + // label配置 + labelControl = itemStyle[status].label || labelControl; + textStyle = labelControl.textStyle || textStyle; + lineLength = itemStyle[status].labelLine.length || lineLength; + labelControl.position = labelControl.position || itemStyle.normal.label.position; + text = this.getLabelText(seriesIndex, dataIndex, status); + textFont = this.getFont(textStyle); + textColor = defaultColor; + if (labelControl.position === 'inner' || labelControl.position === 'inside') { + // 内部 + textAlign = 'center'; + textX = x + topWidth / 2; + if (Math.max(topWidth, bottomWidth) / 2 > zrArea.getTextWidth(text, textFont)) { + textColor = '#fff'; + } + else { + textColor = zrColor.reverse(defaultColor); + } + } + else if (labelControl.position === 'left'){ + // 左侧显示 + textAlign = 'right'; + textX = lineLength === 'auto' + ? (location.x - 10) + : (location.centerX - Math.max(topWidth, bottomWidth) / 2 - lineLength); + } + else { + // 右侧显示,默认 labelControl.position === 'outer' || 'right) + textAlign = 'left'; + textX = lineLength === 'auto' + ? (location.x + location.width + 10) + : (location.centerX + Math.max(topWidth, bottomWidth) / 2 + lineLength); + } + textShape.highlightStyle = { + x: textX, + color: textStyle.color || textColor, + text: text, + textAlign: textStyle.align || textAlign, + textFont: textFont, + brushType: 'fill' + }; + + return new TextShape(textShape); + }, + + /** + * 根据lable.format计算label text + */ + getLabelText: function (seriesIndex, dataIndex, status) { + var series = this.series; + var serie = series[seriesIndex]; + var data = serie.data[dataIndex]; + var formatter = this.deepQuery( + [data, serie], + 'itemStyle.' + status + '.label.formatter' + ); + + if (formatter) { + if (typeof formatter === 'function') { + return formatter.call( + this.myChart, + serie.name, + data.name, + data.value + ); + } + else if (typeof formatter === 'string') { + formatter = formatter.replace('{a}','{a0}') + .replace('{b}','{b0}') + .replace('{c}','{c0}'); + formatter = formatter.replace('{a0}', serie.name) + .replace('{b0}', data.name) + .replace('{c0}', data.value); + + return formatter; + } + } + else { + return data.name; + } + }, + + /** + * 需要显示则会有返回构建好的shape,否则返回undefined + */ + getLabelLine: function ( + seriesIndex, dataIndex, defaultColor, + x, y, topWidth, bottomWidth, height + ) { + var serie = this.series[seriesIndex]; + var data = serie.data[dataIndex]; + var location = this._paramsMap[seriesIndex].location; + + // serie里有默认配置,放心大胆的用! + var itemStyle = zrUtil.merge( + zrUtil.clone(data.itemStyle) || {}, + serie.itemStyle + ); + var status = 'normal'; + // labelLine配置 + var labelLineControl = itemStyle[status].labelLine; + var lineLength = itemStyle[status].labelLine.length; + var lineStyle = labelLineControl.lineStyle || {}; + + var labelControl = itemStyle[status].label; + labelControl.position = labelControl.position + || itemStyle.normal.label.position; + var xEnd; + if (labelControl.position === 'inner' || labelControl.position === 'inside') { + // 内部 + xEnd = x + topWidth / 2; + } + else if (labelControl.position === 'left'){ + // 左侧显示 + xEnd = lineLength === 'auto' + ? (location.x - 10) + : (location.centerX - Math.max(topWidth, bottomWidth) / 2 - lineLength); + } + else { + // 右侧显示,默认 labelControl.position === 'outer' || 'right) + xEnd = lineLength === 'auto' + ? (location.x + location.width + 10) + : (location.centerX + Math.max(topWidth, bottomWidth) / 2 + lineLength); + } + var lineShape = { + zlevel: this._zlevelBase + 1, + hoverable: false, + style: { + xStart: location.centerX, + yStart: y + height / 2, + xEnd: xEnd, + yEnd: y + height / 2, + strokeColor: lineStyle.color || defaultColor, + lineType: lineStyle.type, + lineWidth: lineStyle.width + } + }; + + status = 'emphasis'; + // labelLine配置 + labelLineControl = itemStyle[status].labelLine || labelLineControl; + lineLength = itemStyle[status].labelLine.length || lineLength; + lineStyle = labelLineControl.lineStyle || lineStyle; + + labelControl = itemStyle[status].label || labelControl; + labelControl.position = labelControl.position; + if (labelControl.position === 'inner' || labelControl.position === 'inside') { + // 内部 + xEnd = x + topWidth / 2; + } + else if (labelControl.position === 'left'){ + // 左侧显示 + xEnd = lineLength === 'auto' + ? (location.x - 10) + : (location.centerX - Math.max(topWidth, bottomWidth) / 2 - lineLength); + } + else { + // 右侧显示,默认 labelControl.position === 'outer' || 'right) + xEnd = lineLength === 'auto' + ? (location.x + location.width + 10) + : (location.centerX + Math.max(topWidth, bottomWidth) / 2 + lineLength); + } + lineShape.highlightStyle = { + xEnd: xEnd, + strokeColor: lineStyle.color || defaultColor, + lineType: lineStyle.type, + lineWidth: lineStyle.width + }; + + return new LineShape(lineShape); + }, + + /** + * 返回特定状态(normal or emphasis)下是否需要显示label标签文本 + * @param {Object} serie + * @param {Object} data + * @param {boolean} isEmphasis true is 'emphasis' and false is 'normal' + */ + _needLabel: function (serie, data, isEmphasis) { + return this.deepQuery( + [data, serie], + 'itemStyle.' + + (isEmphasis ? 'emphasis' : 'normal') + + '.label.show' + ); + }, + + /** + * 返回特定状态(normal or emphasis)下是否需要显示labelLine标签视觉引导线 + * @param {Object} serie + * @param {Object} data + * @param {boolean} isEmphasis true is 'emphasis' and false is 'normal' + */ + _needLabelLine: function (serie, data, isEmphasis) { + return this.deepQuery( + [data, serie], + 'itemStyle.' + + (isEmphasis ? 'emphasis' : 'normal') + +'.labelLine.show' + ); + }, + + /** + * 刷新 + */ + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + + this.backupShapeList(); + this._buildShape(); + } + }; + + zrUtil.inherits(Funnel, ChartBase); + zrUtil.inherits(Funnel, ComponentBase); + + // 图表注册 + require('../chart').define('funnel', Funnel); + + return Funnel; +}); +/** + * echarts组件: 类目轴 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/component/categoryAxis',['require','./base','zrender/shape/Text','zrender/shape/Line','zrender/shape/Rectangle','../config','zrender/tool/util','zrender/tool/area','../component'],function (require) { + var Base = require('./base'); + + // 图形依赖 + var TextShape = require('zrender/shape/Text'); + var LineShape = require('zrender/shape/Line'); + var RectangleShape = require('zrender/shape/Rectangle'); + + var ecConfig = require('../config'); + var zrUtil = require('zrender/tool/util'); + var zrArea = require('zrender/tool/area'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} option 类目轴参数 + * @param {Grid} component 组件 + */ + function CategoryAxis(ecTheme, messageCenter, zr, option, myChart, axisBase) { + if (option.data.length < 1) { + console.error('option.data.length < 1.'); + return; + } + + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + + this.grid = this.component.grid; + + for (var method in axisBase) { + this[method] = axisBase[method]; + } + + this.refresh(option); + } + + CategoryAxis.prototype = { + type : ecConfig.COMPONENT_TYPE_AXIS_CATEGORY, + _getReformedLabel : function (idx) { + var data = typeof this.option.data[idx].value != 'undefined' + ? this.option.data[idx].value + : this.option.data[idx]; + var formatter = this.option.data[idx].formatter + || this.option.axisLabel.formatter; + if (formatter) { + if (typeof formatter == 'function') { + data = formatter.call(this.myChart, data); + } + else if (typeof formatter == 'string') { + data = formatter.replace('{value}', data); + } + } + return data; + }, + + /** + * 计算标签显示挑选间隔 + */ + _getInterval : function () { + var interval = this.option.axisLabel.interval; + if (interval == 'auto') { + // 麻烦的自适应计算 + var fontSize = this.option.axisLabel.textStyle.fontSize; + var data = this.option.data; + var dataLength = this.option.data.length; + + if (this.isHorizontal()) { + // 横向 + if (dataLength > 3) { + var gap = this.getGap(); + var isEnough = false; + var labelSpace; + var labelSize; + var step = Math.floor(0.5 / gap); + step = step < 1 ? 1 : step; + interval = Math.floor(15 / gap); + while (!isEnough && interval < dataLength) { + interval += step; + isEnough = true; + labelSpace = Math.floor(gap * interval); // 标签左右至少间隔为3px + for (var i = Math.floor((dataLength - 1)/ interval) * interval; + i >= 0; i -= interval + ) { + if (this.option.axisLabel.rotate !== 0) { + // 有旋转 + labelSize = fontSize; + } + else if (data[i].textStyle) { + labelSize = zrArea.getTextWidth( + this._getReformedLabel(i), + this.getFont( + zrUtil.merge( + data[i].textStyle, + this.option.axisLabel.textStyle + ) + ) + ); + } + else { + /* + labelSize = zrArea.getTextWidth( + this._getReformedLabel(i), + font + ); + */ + // 不定义data级特殊文本样式,用fontSize优化getTextWidth + var label = this._getReformedLabel(i) + ''; + var wLen = (label.match(/\w/g) || '').length; + var oLen = label.length - wLen; + labelSize = wLen * fontSize * 2 / 3 + oLen * fontSize; + } + + if (labelSpace < labelSize) { + // 放不下,中断循环让interval++ + isEnough = false; + break; + } + } + } + } + else { + // 少于3个则全部显示 + interval = 1; + } + } + else { + // 纵向 + if (dataLength > 3) { + var gap = this.getGap(); + interval = Math.floor(11 / gap); + // 标签上下至少间隔为3px + while ((gap * interval - 6) < fontSize + && interval < dataLength + ) { + interval++; + } + } + else { + // 少于3个则全部显示 + interval = 1; + } + } + } + else { + // 用户自定义间隔 + interval = interval - 0 + 1; + } + + return interval; + }, + + /** + * 绘制图形 + */ + _buildShape : function () { + // 标签显示的挑选间隔 + this._interval = this._getInterval(); + + this.option.splitArea.show && this._buildSplitArea(); + this.option.splitLine.show && this._buildSplitLine(); + this.option.axisLine.show && this._buildAxisLine(); + this.option.axisTick.show && this._buildAxisTick(); + this.option.axisLabel.show && this._buildAxisLabel(); + + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + }, + + // 小标记 + _buildAxisTick : function () { + var axShape; + //var data = this.option.data; + var dataLength = this.option.data.length; + var tickOption = this.option.axisTick; + var length = tickOption.length; + var color = tickOption.lineStyle.color; + var lineWidth = tickOption.lineStyle.width; + var interval = tickOption.interval == 'auto' + ? this._interval : (tickOption.interval - 0 + 1); + var onGap = tickOption.onGap; + var optGap = onGap + ? (this.getGap() / 2) + : typeof onGap == 'undefined' + ? (this.option.boundaryGap ? (this.getGap() / 2) : 0) + : 0; + var startIndex = optGap > 0 ? -interval : 0; + if (this.isHorizontal()) { + // 横向 + var yPosition = this.option.position == 'bottom' + ? (tickOption.inside + ? (this.grid.getYend() - length - 1) : (this.grid.getYend() + 1)) + : (tickOption.inside + ? (this.grid.getY() + 1) : (this.grid.getY() - length - 1)); + var x; + for (var i = startIndex; i < dataLength; i += interval) { + // 亚像素优化 + x = this.subPixelOptimize( + this.getCoordByIndex(i) + (i >= 0 ? optGap : 0), lineWidth + ); + axShape = { + _axisShape : 'axisTick', + zlevel : this._zlevelBase, + hoverable : false, + style : { + xStart : x, + yStart : yPosition, + xEnd : x, + yEnd : yPosition + length, + strokeColor : color, + lineWidth : lineWidth + } + }; + this.shapeList.push(new LineShape(axShape)); + } + } + else { + // 纵向 + var xPosition = this.option.position == 'left' + ? (tickOption.inside + ? (this.grid.getX() + 1) : (this.grid.getX() - length - 1)) + : (tickOption.inside + ? (this.grid.getXend() - length - 1) : (this.grid.getXend() + 1)); + + var y; + for (var i = startIndex; i < dataLength; i += interval) { + // 亚像素优化 + y = this.subPixelOptimize( + this.getCoordByIndex(i) - (i >= 0 ? optGap : 0), lineWidth + ); + axShape = { + _axisShape : 'axisTick', + zlevel : this._zlevelBase, + hoverable : false, + style : { + xStart : xPosition, + yStart : y, + xEnd : xPosition + length, + yEnd : y, + strokeColor : color, + lineWidth : lineWidth + } + }; + this.shapeList.push(new LineShape(axShape)); + } + } + }, + + // 坐标轴文本 + _buildAxisLabel : function () { + var axShape; + var data = this.option.data; + var dataLength = this.option.data.length; + var rotate = this.option.axisLabel.rotate; + var margin = this.option.axisLabel.margin; + var clickable = this.option.axisLabel.clickable; + var textStyle = this.option.axisLabel.textStyle; + var dataTextStyle; + + if (this.isHorizontal()) { + // 横向 + var yPosition; + var baseLine; + if (this.option.position == 'bottom') { + yPosition = this.grid.getYend() + margin; + baseLine = 'top'; + } + else { + yPosition = this.grid.getY() - margin; + baseLine = 'bottom'; + } + + for (var i = 0; i < dataLength; i += this._interval) { + if (this._getReformedLabel(i) === '') { + // 空文本优化 + continue; + } + dataTextStyle = zrUtil.merge( + data[i].textStyle || {}, + textStyle + ); + axShape = { + // shape : 'text', + zlevel : this._zlevelBase, + hoverable : false, + style : { + x : this.getCoordByIndex(i), + y : yPosition, + color : dataTextStyle.color, + text : this._getReformedLabel(i), + textFont : this.getFont(dataTextStyle), + textAlign : dataTextStyle.align || 'center', + textBaseline : dataTextStyle.baseline || baseLine + } + }; + if (rotate) { + axShape.style.textAlign = rotate > 0 + ? (this.option.position == 'bottom' + ? 'right' : 'left') + : (this.option.position == 'bottom' + ? 'left' : 'right'); + axShape.rotation = [ + rotate * Math.PI / 180, + axShape.style.x, + axShape.style.y + ]; + } + this.shapeList.push(new TextShape( + this._axisLabelClickable(clickable, axShape) + )); + } + } + else { + // 纵向 + var xPosition; + var align; + if (this.option.position == 'left') { + xPosition = this.grid.getX() - margin; + align = 'right'; + } + else { + xPosition = this.grid.getXend() + margin; + align = 'left'; + } + + for (var i = 0; i < dataLength; i += this._interval) { + if (this._getReformedLabel(i) === '') { + // 空文本优化 + continue; + } + dataTextStyle = zrUtil.merge( + data[i].textStyle || {}, + textStyle + ); + axShape = { + // shape : 'text', + zlevel : this._zlevelBase, + hoverable : false, + style : { + x : xPosition, + y : this.getCoordByIndex(i), + color : dataTextStyle.color, + text : this._getReformedLabel(i), + textFont : this.getFont(dataTextStyle), + textAlign : dataTextStyle.align || align, + textBaseline : dataTextStyle.baseline + || (i === 0 && this.option.name !== '') + ? 'bottom' + : (i == (dataLength - 1) + && this.option.name !== '') + ? 'top' + : 'middle' + } + }; + + if (rotate) { + axShape.rotation = [ + rotate * Math.PI / 180, + axShape.style.x, + axShape.style.y + ]; + } + this.shapeList.push(new TextShape( + this._axisLabelClickable(clickable, axShape) + )); + } + } + }, + + _buildSplitLine : function () { + var axShape; + //var data = this.option.data; + var dataLength = this.option.data.length; + var sLineOption = this.option.splitLine; + var lineType = sLineOption.lineStyle.type; + var lineWidth = sLineOption.lineStyle.width; + var color = sLineOption.lineStyle.color; + color = color instanceof Array ? color : [color]; + var colorLength = color.length; + + var onGap = sLineOption.onGap; + var optGap = onGap + ? (this.getGap() / 2) + : typeof onGap == 'undefined' + ? (this.option.boundaryGap ? (this.getGap() / 2) : 0) + : 0; + dataLength -= (onGap || (typeof onGap == 'undefined' && this.option.boundaryGap)) + ? 1 : 0; + if (this.isHorizontal()) { + // 横向 + var sy = this.grid.getY(); + var ey = this.grid.getYend(); + var x; + + for (var i = 0; i < dataLength; i += this._interval) { + // 亚像素优化 + x = this.subPixelOptimize( + this.getCoordByIndex(i) + optGap, lineWidth + ); + axShape = { + // shape : 'line', + zlevel : this._zlevelBase, + hoverable : false, + style : { + xStart : x, + yStart : sy, + xEnd : x, + yEnd : ey, + strokeColor : color[(i / this._interval) % colorLength], + lineType : lineType, + lineWidth : lineWidth + } + }; + this.shapeList.push(new LineShape(axShape)); + } + + } + else { + // 纵向 + var sx = this.grid.getX(); + var ex = this.grid.getXend(); + var y; + + for (var i = 0; i < dataLength; i += this._interval) { + // 亚像素优化 + y = this.subPixelOptimize( + this.getCoordByIndex(i) - optGap, lineWidth + ); + axShape = { + // shape : 'line', + zlevel : this._zlevelBase, + hoverable : false, + style : { + xStart : sx, + yStart : y, + xEnd : ex, + yEnd : y, + strokeColor : color[(i / this._interval) % colorLength], + linetype : lineType, + lineWidth : lineWidth + } + }; + this.shapeList.push(new LineShape(axShape)); + } + } + }, + + _buildSplitArea : function () { + var axShape; + var sAreaOption = this.option.splitArea; + var color = sAreaOption.areaStyle.color; + if (!(color instanceof Array)) { + // 非数组一律认为是单一颜色的字符串,单一颜色则用一个背景,颜色错误不负责啊!!! + axShape = { + // shape : 'rectangle', + zlevel : this._zlevelBase, + hoverable : false, + style : { + x : this.grid.getX(), + y : this.grid.getY(), + width : this.grid.getWidth(), + height : this.grid.getHeight(), + color : color + // type : this.option.splitArea.areaStyle.type, + } + }; + this.shapeList.push(new RectangleShape(axShape)); + } + else { + // 多颜色 + var colorLength = color.length; + var dataLength = this.option.data.length; + + var onGap = sAreaOption.onGap; + var optGap = onGap + ? (this.getGap() / 2) + : typeof onGap == 'undefined' + ? (this.option.boundaryGap ? (this.getGap() / 2) : 0) + : 0; + if (this.isHorizontal()) { + // 横向 + var y = this.grid.getY(); + var height = this.grid.getHeight(); + var lastX = this.grid.getX(); + var curX; + + for (var i = 0; i <= dataLength; i += this._interval) { + curX = i < dataLength + ? (this.getCoordByIndex(i) + optGap) + : this.grid.getXend(); + axShape = { + // shape : 'rectangle', + zlevel : this._zlevelBase, + hoverable : false, + style : { + x : lastX, + y : y, + width : curX - lastX, + height : height, + color : color[(i / this._interval) % colorLength] + // type : this.option.splitArea.areaStyle.type, + } + }; + this.shapeList.push(new RectangleShape(axShape)); + lastX = curX; + } + } + else { + // 纵向 + var x = this.grid.getX(); + var width = this.grid.getWidth(); + var lastYend = this.grid.getYend(); + var curY; + + for (var i = 0; i <= dataLength; i += this._interval) { + curY = i < dataLength + ? (this.getCoordByIndex(i) - optGap) + : this.grid.getY(); + axShape = { + // shape : 'rectangle', + zlevel : this._zlevelBase, + hoverable : false, + style : { + x : x, + y : curY, + width : width, + height : lastYend - curY, + color : color[(i / this._interval) % colorLength] + // type : this.option.splitArea.areaStyle.type + } + }; + this.shapeList.push(new RectangleShape(axShape)); + lastYend = curY; + } + } + } + }, + + /** + * 刷新 + */ + refresh : function (newOption) { + if (newOption) { + this.option = this.reformOption(newOption); + // 通用字体设置 + this.option.axisLabel.textStyle = zrUtil.merge( + this.option.axisLabel.textStyle || {}, + this.ecTheme.textStyle + ); + } + this.clear(); + this._buildShape(); + }, + + /** + * 返回间隔 + */ + getGap : function () { + var dataLength = this.option.data.length; + var total = this.isHorizontal() + ? this.grid.getWidth() + : this.grid.getHeight(); + if (this.option.boundaryGap) { // 留空 + return total / dataLength; + } + else { // 顶头 + return total / (dataLength > 1 ? (dataLength - 1) : 1); + } + }, + + // 根据值换算位置 + getCoord : function (value) { + var data = this.option.data; + var dataLength = data.length; + var gap = this.getGap(); + var position = this.option.boundaryGap ? (gap / 2) : 0; + + for (var i = 0; i < dataLength; i++) { + if (data[i] == value + || (typeof data[i].value != 'undefined' + && data[i].value == value) + ) { + if (this.isHorizontal()) { + // 横向 + position = this.grid.getX() + position; + } + else { + // 纵向 + position = this.grid.getYend() - position; + } + + return position; + // Math.floor可能引起一些偏差,但性能会更好 + /* 准确更重要 + return (i === 0 || i == dataLength - 1) + ? position + : Math.floor(position); + */ + } + position += gap; + } + }, + + // 根据类目轴数据索引换算位置 + getCoordByIndex : function (dataIndex) { + if (dataIndex < 0) { + if (this.isHorizontal()) { + return this.grid.getX(); + } + else { + return this.grid.getYend(); + } + } + else if (dataIndex > this.option.data.length - 1) { + if (this.isHorizontal()) { + return this.grid.getXend(); + } + else { + return this.grid.getY(); + } + } + else { + var gap = this.getGap(); + var position = this.option.boundaryGap ? (gap / 2) : 0; + position += dataIndex * gap; + + if (this.isHorizontal()) { + // 横向 + position = this.grid.getX() + position; + } + else { + // 纵向 + position = this.grid.getYend() - position; + } + + return position; + /* 准确更重要 + return (dataIndex === 0 || dataIndex == this.option.data.length - 1) + ? position + : Math.floor(position); + */ + } + }, + + // 根据类目轴数据索引换算类目轴名称 + getNameByIndex : function (dataIndex) { + var data = this.option.data[dataIndex]; + if (typeof data != 'undefined' && typeof data.value != 'undefined') + { + return data.value; + } + else { + return data; + } + }, + + // 根据类目轴名称换算类目轴数据索引 + getIndexByName : function (name) { + var data = this.option.data; + var dataLength = data.length; + + for (var i = 0; i < dataLength; i++) { + if (data[i] == name + || (typeof data[i].value != 'undefined' + && data[i].value == name) + ) { + return i; + } + } + + return -1; + }, + + // 根据位置换算值 + getValueFromCoord : function() { + return ''; + }, + + /** + * 根据类目轴数据索引返回是否为主轴线 + * @param {number} dataIndex 类目轴数据索引 + * @return {boolean} 是否为主轴 + */ + isMainAxis : function (dataIndex) { + return dataIndex % this._interval === 0; + } + }; + + zrUtil.inherits(CategoryAxis, Base); + + require('../component').define('categoryAxis', CategoryAxis); + + return CategoryAxis; +}); +/** + * echarts组件: 数值轴 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','zrender/shape/Line','zrender/shape/Rectangle','../config','zrender/tool/util','../component'],function (require) { + var Base = require('./base'); + + // 图形依赖 + var TextShape = require('zrender/shape/Text'); + var LineShape = require('zrender/shape/Line'); + var RectangleShape = require('zrender/shape/Rectangle'); + + var ecConfig = require('../config'); + var zrUtil = require('zrender/tool/util'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} option 类目轴参数 + * @param {Object} component 组件 + * @param {Array} series 数据对象 + */ + function ValueAxis(ecTheme, messageCenter, zr, option, myChart, axisBase, series) { + if (!series || series.length === 0) { + console.err('option.series.length == 0.'); + return; + } + + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + + this.series = series; + this.grid = this.component.grid; + + for (var method in axisBase) { + this[method] = axisBase[method]; + } + + this.refresh(option, series); + } + + ValueAxis.prototype = { + type: ecConfig.COMPONENT_TYPE_AXIS_VALUE, + _buildShape: function () { + this._hasData = false; + this._calculateValue(); + if (!this._hasData) { + return; + } + this.option.splitArea.show && this._buildSplitArea(); + this.option.splitLine.show && this._buildSplitLine(); + this.option.axisLine.show && this._buildAxisLine(); + this.option.axisTick.show && this._buildAxisTick(); + this.option.axisLabel.show && this._buildAxisLabel(); + + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + }, + + // 小标记 + _buildAxisTick: function () { + var axShape; + var data = this._valueList; + var dataLength = this._valueList.length; + var tickOption = this.option.axisTick; + var length = tickOption.length; + var color = tickOption.lineStyle.color; + var lineWidth = tickOption.lineStyle.width; + + if (this.isHorizontal()) { + // 横向 + var yPosition = this.option.position === 'bottom' + ? (tickOption.inside + ? (this.grid.getYend() - length - 1) : (this.grid.getYend()) + 1) + : (tickOption.inside + ? (this.grid.getY() + 1) : (this.grid.getY() - length - 1)); + var x; + for (var i = 0; i < dataLength; i++) { + // 亚像素优化 + x = this.subPixelOptimize(this.getCoord(data[i]), lineWidth); + axShape = { + _axisShape: 'axisTick', + zlevel: this._zlevelBase, + hoverable: false, + style: { + xStart: x, + yStart: yPosition, + xEnd: x, + yEnd: yPosition + length, + strokeColor: color, + lineWidth: lineWidth + } + }; + this.shapeList.push(new LineShape(axShape)); + } + } + else { + // 纵向 + var xPosition = this.option.position === 'left' + ? (tickOption.inside + ? (this.grid.getX() + 1) : (this.grid.getX() - length - 1)) + : (tickOption.inside + ? (this.grid.getXend() - length - 1) : (this.grid.getXend() + 1)); + + var y; + for (var i = 0; i < dataLength; i++) { + // 亚像素优化 + y = this.subPixelOptimize(this.getCoord(data[i]), lineWidth); + axShape = { + _axisShape: 'axisTick', + zlevel: this._zlevelBase, + hoverable: false, + style: { + xStart: xPosition, + yStart: y, + xEnd: xPosition + length, + yEnd: y, + strokeColor: color, + lineWidth: lineWidth + } + }; + this.shapeList.push(new LineShape(axShape)); + } + } + }, + + // 坐标轴文本 + _buildAxisLabel: function () { + var axShape; + var data = this._valueList; + var dataLength = this._valueList.length; + var rotate = this.option.axisLabel.rotate; + var margin = this.option.axisLabel.margin; + var clickable = this.option.axisLabel.clickable; + var textStyle = this.option.axisLabel.textStyle; + + if (this.isHorizontal()) { + // 横向 + var yPosition; + var baseLine; + if (this.option.position === 'bottom') { + yPosition = this.grid.getYend() + margin; + baseLine = 'top'; + } + else { + yPosition = this.grid.getY() - margin; + baseLine = 'bottom'; + } + + for (var i = 0; i < dataLength; i++) { + axShape = { + zlevel: this._zlevelBase, + hoverable: false, + style: { + x: this.getCoord(data[i]), + y: yPosition, + color: typeof textStyle.color === 'function' + ? textStyle.color(data[i]) : textStyle.color, + text: this._valueLabel[i], + textFont: this.getFont(textStyle), + textAlign: textStyle.align || 'center', + textBaseline: textStyle.baseline || baseLine + } + }; + if (rotate) { + axShape.style.textAlign = rotate > 0 + ? (this.option.position === 'bottom' + ? 'right' : 'left') + : (this.option.position === 'bottom' + ? 'left' : 'right'); + axShape.rotation = [ + rotate * Math.PI / 180, + axShape.style.x, + axShape.style.y + ]; + } + this.shapeList.push(new TextShape( + this._axisLabelClickable(clickable, axShape) + )); + } + } + else { + // 纵向 + var xPosition; + var align; + if (this.option.position === 'left') { + xPosition = this.grid.getX() - margin; + align = 'right'; + } + else { + xPosition = this.grid.getXend() + margin; + align = 'left'; + } + + for (var i = 0; i < dataLength; i++) { + axShape = { + zlevel: this._zlevelBase, + hoverable: false, + style: { + x: xPosition, + y: this.getCoord(data[i]), + color: typeof textStyle.color === 'function' + ? textStyle.color(data[i]) : textStyle.color, + text: this._valueLabel[i], + textFont: this.getFont(textStyle), + textAlign: textStyle.align || align, + textBaseline: textStyle.baseline + || (i === 0 && this.option.name !== '') + ? 'bottom' + : (i === (dataLength - 1) + && this.option.name !== '') + ? 'top' + : 'middle' + } + }; + + if (rotate) { + axShape.rotation = [ + rotate * Math.PI / 180, + axShape.style.x, + axShape.style.y + ]; + } + this.shapeList.push(new TextShape( + this._axisLabelClickable(clickable, axShape) + )); + } + } + }, + + _buildSplitLine: function () { + var axShape; + var data = this._valueList; + var dataLength = this._valueList.length; + var sLineOption = this.option.splitLine; + var lineType = sLineOption.lineStyle.type; + var lineWidth = sLineOption.lineStyle.width; + var color = sLineOption.lineStyle.color; + color = color instanceof Array ? color : [color]; + var colorLength = color.length; + + if (this.isHorizontal()) { + // 横向 + var sy = this.grid.getY(); + var ey = this.grid.getYend(); + var x; + + for (var i = 0; i < dataLength; i++) { + // 亚像素优化 + x = this.subPixelOptimize(this.getCoord(data[i]), lineWidth); + axShape = { + zlevel: this._zlevelBase, + hoverable: false, + style: { + xStart: x, + yStart: sy, + xEnd: x, + yEnd: ey, + strokeColor: color[i % colorLength], + lineType: lineType, + lineWidth: lineWidth + } + }; + this.shapeList.push(new LineShape(axShape)); + } + + } + else { + // 纵向 + var sx = this.grid.getX(); + var ex = this.grid.getXend(); + var y; + + for (var i = 0; i < dataLength; i++) { + // 亚像素优化 + y = this.subPixelOptimize(this.getCoord(data[i]), lineWidth); + axShape = { + zlevel: this._zlevelBase, + hoverable: false, + style: { + xStart: sx, + yStart: y, + xEnd: ex, + yEnd: y, + strokeColor: color[i % colorLength], + lineType: lineType, + lineWidth: lineWidth + } + }; + this.shapeList.push(new LineShape(axShape)); + } + } + }, + + _buildSplitArea: function () { + var axShape; + var color = this.option.splitArea.areaStyle.color; + + if (!(color instanceof Array)) { + // 非数组一律认为是单一颜色的字符串,单一颜色则用一个背景,颜色错误不负责啊!!! + axShape = { + zlevel: this._zlevelBase, + hoverable: false, + style: { + x: this.grid.getX(), + y: this.grid.getY(), + width: this.grid.getWidth(), + height: this.grid.getHeight(), + color: color + // type: this.option.splitArea.areaStyle.type, + } + }; + this.shapeList.push(new RectangleShape(axShape)); + } + else { + // 多颜色 + var colorLength = color.length; + var data = this._valueList; + var dataLength = this._valueList.length; + + if (this.isHorizontal()) { + // 横向 + var y = this.grid.getY(); + var height = this.grid.getHeight(); + var lastX = this.grid.getX(); + var curX; + + for (var i = 0; i <= dataLength; i++) { + curX = i < dataLength + ? this.getCoord(data[i]) + : this.grid.getXend(); + axShape = { + zlevel: this._zlevelBase, + hoverable: false, + style: { + x: lastX, + y: y, + width: curX - lastX, + height: height, + color: color[i % colorLength] + // type: this.option.splitArea.areaStyle.type, + } + }; + this.shapeList.push(new RectangleShape(axShape)); + lastX = curX; + } + } + else { + // 纵向 + var x = this.grid.getX(); + var width = this.grid.getWidth(); + var lastYend = this.grid.getYend(); + var curY; + + for (var i = 0; i <= dataLength; i++) { + curY = i < dataLength + ? this.getCoord(data[i]) + : this.grid.getY(); + axShape = { + zlevel: this._zlevelBase, + hoverable: false, + style: { + x: x, + y: curY, + width: width, + height: lastYend - curY, + color: color[i % colorLength] + // type: this.option.splitArea.areaStyle.type + } + }; + this.shapeList.push(new RectangleShape(axShape)); + lastYend = curY; + } + } + } + }, + + /** + * 极值计算 + */ + _calculateValue: function () { + if (isNaN(this.option.min - 0) || isNaN(this.option.max - 0)) { + // 有一个没指定都得算 + // 数据整形 + var oriData; // 原始数据 + var data = {}; // 整形后数据抽取 + var value; + var xIdx; + var yIdx; + var legend = this.component.legend; + for (var i = 0, l = this.series.length; i < l; i++) { + if (this.series[i].type != ecConfig.CHART_TYPE_LINE + && this.series[i].type != ecConfig.CHART_TYPE_BAR + && this.series[i].type != ecConfig.CHART_TYPE_SCATTER + && this.series[i].type != ecConfig.CHART_TYPE_K + ) { + // 非坐标轴支持的不算极值 + continue; + } + // 请允许我写开,跟上面一个不是一样东西 + if (legend && !legend.isSelected(this.series[i].name)){ + continue; + } + + // 不指定默认为第一轴线 + xIdx = this.series[i].xAxisIndex || 0; + yIdx = this.series[i].yAxisIndex || 0; + if ((this.option.xAxisIndex != xIdx) + && (this.option.yAxisIndex != yIdx) + ) { + // 不是自己的数据不计算极值 + continue; + } + + var key = this.series[i].name || 'kener'; + if (!this.series[i].stack) { + data[key] = data[key] || []; + oriData = this.series[i].data; + for (var j = 0, k = oriData.length; j < k; j++) { + value = oriData[j].value != null + ? oriData[j].value + : oriData[j]; + if (this.series[i].type === ecConfig.CHART_TYPE_SCATTER) { + if (this.option.xAxisIndex != -1) { + data[key].push(value[0]); + } + if (this.option.yAxisIndex != -1) { + data[key].push(value[1]); + } + } + else if (this.series[i].type === ecConfig.CHART_TYPE_K) { + data[key].push(value[0]); + data[key].push(value[1]); + data[key].push(value[2]); + data[key].push(value[3]); + } + else { + data[key].push(value); + } + } + } + else { + // 堆积数据,需要区分正负向堆积 + var keyP = '__Magic_Key_Positive__' + this.series[i].stack; + var keyN = '__Magic_Key_Negative__' + this.series[i].stack; + data[keyP] = data[keyP] || []; + data[keyN] = data[keyN] || []; + data[key] = data[key] || []; // scale下还需要记录每一个量 + oriData = this.series[i].data; + for (var j = 0, k = oriData.length; j < k; j++) { + value = oriData[j].value != null + ? oriData[j].value + : oriData[j]; + if (value === '-') { + continue; + } + value = value - 0; + if (value >= 0) { + if (data[keyP][j] != null) { + data[keyP][j] += value; + } + else { + data[keyP][j] = value; + } + } + else { + if (data[keyN][j] != null) { + data[keyN][j] += value; + } + else { + data[keyN][j] = value; + } + } + if (this.option.scale) { + data[key].push(value); + } + } + } + } + // 找极值 + for (var i in data){ + oriData = data[i]; + for (var j = 0, k = oriData.length; j < k; j++) { + if (!isNaN(oriData[j])){ + this._hasData = true; + this._min = oriData[j]; + this._max = oriData[j]; + break; + } + } + if (this._hasData) { + break; + } + } + for (var i in data){ + oriData = data[i]; + for (var j = 0, k = oriData.length; j < k; j++) { + if (!isNaN(oriData[j])){ + this._min = Math.min(this._min, oriData[j]); + this._max = Math.max(this._max, oriData[j]); + } + } + } + + //console.log(this._min,this._max,'vvvvv111111') + var gap = Math.abs(this._max - this._min); + this._min = isNaN(this.option.min - 0) + ? (this._min - Math.abs(gap * this.option.boundaryGap[0])) + : (this.option.min - 0); // 指定min忽略boundaryGay[0] + + this._max = isNaN(this.option.max - 0) + ? (this._max + Math.abs(gap * this.option.boundaryGap[1])) + : (this.option.max - 0); // 指定max忽略boundaryGay[1] + if (this._min === this._max) { + if (this._max === 0) { + // 修复全0数据 + this._max = this.option.power > 0 ? this.option.power : 1; + } + // 修复最大值==最小值时数据整形 + else if (this._max > 0) { + this._min = this._max / this.option.splitNumber; + } + else { // this._max < 0 + this._max = this._max / this.option.splitNumber; + } + } + this._reformValue(this.option.scale); + } + else { + this._hasData = true; + // 用户指定min max就不多管闲事了 + this._min = this.option.min - 0; // 指定min忽略boundaryGay[0] + this._max = this.option.max - 0; // 指定max忽略boundaryGay[1] + this._customerValue(); + } + }, + + /** + * 找到原始数据的极值后根据选项整形最终 this._min / this._max / this._valueList + * 如果你不知道这个“整形”的用义,请不要试图去理解和修改这个方法!找我也没用,我相信我已经记不起来! + * 如果你有更简洁的数学推导欢迎重写,后果自负~ + * 一旦你不得不遇到了需要修改或重写的厄运,希望下面的脚手架能帮助你 + * ps:其实我是想说别搞砸了!升级后至少得保证这些case通过!! + * + * by linzhifeng@baidu.com 2013-1-8 + * -------- + this._valueList = []; + this.option = {splitNumber:5,power:100,precision:0}; + this._min = 1; this._max = 123; console.log(this._min, this._max); this._reformValue(); + console.log('result is :', this._min, this._max, this._valueList); + console.log('should be : 0 150 [0, 30, 60, 90, 120, 150]', + (this._min == 0 && this._max == 150) ? 'success' : 'failed'); + + this._min = 10; this._max = 1923; console.log(this._min, this._max); this._reformValue(); + console.log('result is :', this._min, this._max, this._valueList); + console.log('should be : 0 2000 [0, 400, 800, 1200, 1600, 2000]', + (this._min == 0 && this._max == 2000) ? 'success' : 'failed'); + + this._min = 10; this._max = 78; console.log(this._min, this._max); this._reformValue(); + console.log('result is :', this._min, this._max, this._valueList); + console.log('should be : 0 100 [0, 20, 40, 60, 80, 100]', + (this._min == 0 && this._max == 100) ? 'success' : 'failed'); + + this._min = -31; this._max = -3; console.log(this._min, this._max); this._reformValue(); + console.log('result is :', this._min, this._max, this._valueList); + console.log('should be : -35 0 [-35, -28, -21, -14, -7, 0]', + (this._min == -35 && this._max == 0) ? 'success' : 'failed'); + + this._min = -51; this._max = 203; console.log(this._min, this._max); this._reformValue(); + console.log('result is :', this._min, this._max, this._valueList); + console.log('should be : -60 240 [-60, 0, 60, 120, 180, 240]', + (this._min == -60 && this._max == 240) ? 'success' : 'failed'); + + this._min = -251; this._max = 23; console.log(this._min, this._max); this._reformValue(); + console.log('result is :', this._min, this._max, this._valueList); + console.log('should be : -280 70 [-280, -210, -140, -70, 0, 70]', + (this._min == -280 && this._max == 70) ? 'success' : 'failed'); + + this.option.precision = 2; + this._min = 0.23; this._max = 0.78; console.log(this._min, this._max); this._reformValue(); + console.log('result is :', this._min, this._max, this._valueList); + console.log('should be : 0.00 1.00' + + '["0.00", "0.20", "0.40", "0.60", "0.80", "1.00"]', + (this._min == 0.00 && this._max == 1.00) ? 'success' : 'failed'); + + this._min = -12.23; this._max = -0.78; console.log(this._min, this._max); + this._reformValue(); + console.log('result is :', this._min, this._max, this._valueList); + console.log('should be : -15.00 0.00' + + '["-15.00", "-12.00", "-9.00", "-6.00", "-3.00", "0.00"]', + (this._min == -15.00 && this._max == 0.00) ? 'success' : 'failed'); + + this._min = -0.23; this._max = 0.78; console.log(this._min, this._max); this._reformValue() + console.log('result is :', this._min, this._max, this._valueList); + console.log('should be : -0.30 1.20' + + '["-0.30", "0.00", "0.30", "0.60", "0.90", "1.20"]', + (this._min == -0.30 && this._max == 1.20) ? 'success' : 'failed'); + + this._min = -1.23; this._max = 0.78; console.log(this._min, this._max); _reformValue(); + console.log('result is :', this._min, this._max, this._valueList); + console.log('should be : -1.50 1.00' + + '["-1.50", "-1.00", "-0.50", "0.00", "0.50", "1.00"]', + (this._min == -1.50 && this._max == 1.00) ? 'success' : 'failed'); + + this.option.precision = 1; + this._min = -2.3; this._max = 0.5; console.log(this._min, this._max); _reformValue(); + console.log('result is :', this._min, this._max, this._valueList); + console.log('should be : -2.4 0.6' + + '["-2.4", "-1.8", "-1.2", "-0.6", "0.0", "0.6"]', + (this._min == -2.4 && this._max == 0.6) ? 'success' : 'failed'); + * -------- + */ + _reformValue: function (scale) { + var splitNumber = this.option.splitNumber; + var precision = this.option.precision; + var splitGap; + var power; + if (precision === 0) { // 整数 + power = this.option.power > 1 ? this.option.power : 1; + } + else { // 小数 + // 放大倍数后复用整数逻辑,最后再缩小回去 + power = Math.pow(10, precision); + this._min *= power; + this._max *= power; + power = this.option.power; + } + // console.log(this._min,this._max) + var total; + if (this._min >= 0 && this._max >= 0) { + // 双正 + if (!scale) { + // power自动降级 + while ((this._max / power < splitNumber) && power != 1) { + power = power / 10; + } + this._min = 0; + } + else { + // power自动降级 + while (this._min < power && power != 1) { + power = power / 10; + } + if (precision === 0) { // 整数 + // 满足power + this._min = Math.floor(this._min / power) * power; + this._max = Math.ceil(this._max / power) * power; + } + } + power = power > 1 ? power / 10 : 1; + total = this._max - this._min; + splitGap = Math.ceil((total / splitNumber) / power) * power; + this._max = this._min + splitGap * splitNumber; + } + else if (this._min <= 0 && this._max <= 0) { + // 双负 + power = -power; + if (!scale) { + // power自动降级 + while ((this._min / power < splitNumber) && power != -1) { + power = power / 10; + } + this._max = 0; + } + else { + // power自动降级 + while (this._max > power && power != -1) { + power = power / 10; + } + if (precision === 0) { // 整数 + // 满足power + this._min = Math.ceil(this._min / power) * power; + this._max = Math.floor(this._max / power) * power; + } + } + power = power < -1 ? power / 10 : -1; + total = this._min - this._max; + splitGap = -Math.ceil((total / splitNumber) / power) * power; + this._min = -splitGap * splitNumber + this._max; + } + else { + // 一正一负,确保0被选中 + total = this._max - this._min; + // power自动降级 + while ((total / power < splitNumber) && power != 1) { + power = power/10; + } + // 正数部分的分隔数 + var partSplitNumber = Math.round(this._max / total * splitNumber); + // 修正数据范围极度偏正向,留给负数一个 + partSplitNumber -= (partSplitNumber === splitNumber ? 1 : 0); + // 修正数据范围极度偏负向,留给正数一个 + partSplitNumber += partSplitNumber === 0 ? 1 : 0; + splitGap = (Math.ceil(Math.max( + this._max / partSplitNumber, + this._min / (partSplitNumber - splitNumber) + ) + / power)) + * power; + + this._max = splitGap * partSplitNumber; + this._min = splitGap * (partSplitNumber - splitNumber); + } + //console.log(this._min,this._max,'vvvvvrrrrrr') + this._valueList = []; + for (var i = 0; i <= splitNumber; i++) { + this._valueList.push(this._min + splitGap * i); + } + + if (precision !== 0) { // 小数 + // 放大倍数后复用整数逻辑,最后再缩小回去 + power = Math.pow(10, precision); + this._min = (this._min / power).toFixed(precision) - 0; + this._max = (this._max / power).toFixed(precision) - 0; + for (var i = 0; i <= splitNumber; i++) { + this._valueList[i] = + (this._valueList[i] / power).toFixed(precision) - 0; + } + } + this._reformLabelData(); + }, + + _customerValue: function () { + var splitNumber = this.option.splitNumber; + var precision = this.option.precision; + var splitGap = (this._max - this._min) / splitNumber; + + this._valueList = []; + for (var i = 0; i <= splitNumber; i++) { + this._valueList.push((this._min + splitGap * i).toFixed(precision) - 0); + } + this._reformLabelData(); + }, + + _reformLabelData: function () { + this._valueLabel = []; + var formatter = this.option.axisLabel.formatter; + if (formatter) { + for (var i = 0, l = this._valueList.length; i < l; i++) { + if (typeof formatter === 'function') { + this._valueLabel.push(formatter.call(this.myChart, this._valueList[i])); + } + else if (typeof formatter === 'string') { + this._valueLabel.push( + formatter.replace('{value}',this._valueList[i]) + ); + } + } + } + else { + // 每三位默认加,格式化 + for (var i = 0, l = this._valueList.length; i < l; i++) { + this._valueLabel.push(this.numAddCommas(this._valueList[i])); + } + } + + }, + + getExtremum: function () { + this._calculateValue(); + return { + min: this._min, + max: this._max + }; + }, + + /** + * 刷新 + */ + refresh: function (newOption, newSeries) { + if (newOption) { + this.option = this.reformOption(newOption); + // 通用字体设置 + this.option.axisLabel.textStyle = zrUtil.merge( + this.option.axisLabel.textStyle || {}, + this.ecTheme.textStyle + ); + this.series = newSeries; + } + if (this.zr) { // 数值轴的另外一个功能只是用来计算极值 + this.clear(); + this._buildShape(); + } + }, + + // 根据值换算位置 + getCoord: function (value) { + value = value < this._min ? this._min : value; + value = value > this._max ? this._max : value; + + var result; + if (!this.isHorizontal()) { + // 纵向 + result = this.grid.getYend() + - (value - this._min) + / (this._max - this._min) + * this.grid.getHeight(); + } + else { + // 横向 + result = this.grid.getX() + + (value - this._min) + / (this._max - this._min) + * this.grid.getWidth(); + } + + return result; + // Math.floor可能引起一些偏差,但性能会更好 + /* 准确更重要 + return (value === this._min || value === this._max) + ? result + : Math.floor(result); + */ + }, + + // 根据值换算绝对大小 + getCoordSize: function (value) { + if (!this.isHorizontal()) { + // 纵向 + return Math.abs(value / (this._max - this._min) * this.grid.getHeight()); + } + else { + // 横向 + return Math.abs(value / (this._max - this._min) * this.grid.getWidth()); + } + }, + + // 根据位置换算值 + getValueFromCoord: function(coord) { + var result; + if (!this.isHorizontal()) { + // 纵向 + coord = coord < this.grid.getY() ? this.grid.getY() : coord; + coord = coord > this.grid.getYend() ? this.grid.getYend() : coord; + result = this._max + - (coord - this.grid.getY()) + / this.grid.getHeight() + * (this._max - this._min); + } + else { + // 横向 + coord = coord < this.grid.getX() ? this.grid.getX() : coord; + coord = coord > this.grid.getXend() ? this.grid.getXend() : coord; + result = this._min + + (coord - this.grid.getX()) + / this.grid.getWidth() + * (this._max - this._min); + } + + return result.toFixed(2) - 0; + } + }; + + zrUtil.inherits(ValueAxis, Base); + + require('../component').define('valueAxis', ValueAxis); + + return ValueAxis; +}); + + +/** + * echarts组件类: 坐标轴 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + * 直角坐标系中坐标轴数组,数组中每一项代表一条横轴(纵轴)坐标轴。 + * 标准(1.0)中规定最多同时存在2条横轴和2条纵轴 + * 单条横轴时可指定安放于grid的底部(默认)或顶部,2条同时存在时则默认第一条安放于底部,第二天安放于顶部 + * 单条纵轴时可指定安放于grid的左侧(默认)或右侧,2条同时存在时则默认第一条安放于左侧,第二天安放于右侧。 + * 坐标轴有两种类型,类目型和数值型(区别详见axis): + * 横轴通常为类目型,但条形图时则横轴为数值型,散点图时则横纵均为数值型 + * 纵轴通常为数值型,但条形图时则纵轴为类目型。 + * + */ +define('echarts/component/axis',['require','./base','zrender/shape/Line','../config','../util/ecData','zrender/tool/util','zrender/tool/color','./categoryAxis','./valueAxis','../component'],function (require) { + var Base = require('./base'); + + var LineShape = require('zrender/shape/Line'); + + var ecConfig = require('../config'); + var ecData = require('../util/ecData'); + var zrUtil = require('zrender/tool/util'); + var zrColor = require('zrender/tool/color'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} option 图表选项 + * @param {string=} option.xAxis.type 坐标轴类型,横轴默认为类目型'category' + * @param {string=} option.yAxis.type 坐标轴类型,纵轴默认为类目型'value' + * @param {Object} component 组件 + * @param {string} axisType 横走or纵轴 + */ + function Axis(ecTheme, messageCenter, zr, option, myChart, axisType) { + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + + this.axisType = axisType; + this._axisList = []; + + this.refresh(option); + } + + Axis.prototype = { + type: ecConfig.COMPONENT_TYPE_AXIS, + axisBase: { + // 轴线 + _buildAxisLine: function () { + var lineWidth = this.option.axisLine.lineStyle.width; + var halfLineWidth = lineWidth / 2; + var axShape = { + _axisShape: 'axisLine', + zlevel: this._zlevelBase + 1, + hoverable: false + }; + switch (this.option.position) { + case 'left' : + axShape.style = { + xStart: this.grid.getX() - halfLineWidth, + yStart: this.grid.getYend(), + xEnd: this.grid.getX() - halfLineWidth, + yEnd: this.grid.getY(), + lineCap: 'round' + }; + break; + case 'right' : + axShape.style = { + xStart: this.grid.getXend() + halfLineWidth, + yStart: this.grid.getYend(), + xEnd: this.grid.getXend() + halfLineWidth, + yEnd: this.grid.getY(), + lineCap: 'round' + }; + break; + case 'bottom' : + axShape.style = { + xStart: this.grid.getX(), + yStart: this.grid.getYend() + halfLineWidth, + xEnd: this.grid.getXend(), + yEnd: this.grid.getYend() + halfLineWidth, + lineCap: 'round' + }; + break; + case 'top' : + axShape.style = { + xStart: this.grid.getX(), + yStart: this.grid.getY() - halfLineWidth, + xEnd: this.grid.getXend(), + yEnd: this.grid.getY() - halfLineWidth, + lineCap: 'round' + }; + break; + } + if (this.option.name !== '') { // 别帮我代码规范 + axShape.style.text = this.option.name; + axShape.style.textPosition = this.option.nameLocation; + axShape.style.textFont = this.getFont(this.option.nameTextStyle); + if (this.option.nameTextStyle.align) { + axShape.style.textAlign = this.option.nameTextStyle.align; + } + if (this.option.nameTextStyle.baseline) { + axShape.style.textBaseline = this.option.nameTextStyle.baseline; + } + if (this.option.nameTextStyle.color) { + axShape.style.textColor = this.option.nameTextStyle.color; + } + } + axShape.style.strokeColor = this.option.axisLine.lineStyle.color; + + axShape.style.lineWidth = lineWidth; + // 亚像素优化 + if (this.isHorizontal()) { + // 横向布局,优化y + axShape.style.yStart + = axShape.style.yEnd + = this.subPixelOptimize(axShape.style.yEnd, lineWidth); + } + else { + // 纵向布局,优化x + axShape.style.xStart + = axShape.style.xEnd + = this.subPixelOptimize(axShape.style.xEnd, lineWidth); + } + + axShape.style.lineType = this.option.axisLine.lineStyle.type; + + axShape = new LineShape(axShape); + this.shapeList.push(axShape); + }, + + _axisLabelClickable: function(clickable, axShape) { + if (clickable) { + ecData.pack( + axShape, undefined, -1, undefined, -1, axShape.style.text + ); + axShape.hoverable = true; + axShape.clickable = true; + axShape.highlightStyle = { + color: zrColor.lift(axShape.style.color, 1), + brushType: 'fill' + }; + return axShape; + } + else { + return axShape; + } + }, + + refixAxisShape: function(zeroX, zeroY) { + if (!this.option.axisLine.onZero) { + return; + } + var tickLength; + if (this.isHorizontal() && zeroY != null) { + // 横向布局调整纵向y + for (var i = 0, l = this.shapeList.length; i < l; i++) { + if (this.shapeList[i]._axisShape === 'axisLine') { + this.shapeList[i].style.yStart + = this.shapeList[i].style.yEnd + = this.subPixelOptimize( + zeroY, this.shapeList[i].stylelineWidth + ); + this.zr.modShape(this.shapeList[i].id); + } + else if (this.shapeList[i]._axisShape === 'axisTick') { + tickLength = this.shapeList[i].style.yEnd + - this.shapeList[i].style.yStart; + this.shapeList[i].style.yStart = zeroY - tickLength; + this.shapeList[i].style.yEnd = zeroY; + this.zr.modShape(this.shapeList[i].id); + } + } + } + if (!this.isHorizontal() && zeroX != null) { + // 纵向布局调整横向x + for (var i = 0, l = this.shapeList.length; i < l; i++) { + if (this.shapeList[i]._axisShape === 'axisLine') { + this.shapeList[i].style.xStart + = this.shapeList[i].style.xEnd + = this.subPixelOptimize( + zeroX, this.shapeList[i].stylelineWidth + ); + this.zr.modShape(this.shapeList[i].id); + } + else if (this.shapeList[i]._axisShape === 'axisTick') { + tickLength = this.shapeList[i].style.xEnd + - this.shapeList[i].style.xStart; + this.shapeList[i].style.xStart = zeroX; + this.shapeList[i].style.xEnd = zeroX + tickLength; + this.zr.modShape(this.shapeList[i].id); + } + } + } + }, + + getPosition: function () { + return this.option.position; + }, + + isHorizontal: function() { + return this.option.position === 'bottom' || this.option.position === 'top'; + } + }, + /** + * 参数修正&默认值赋值,重载基类方法 + * @param {Object} opt 参数 + */ + reformOption: function (opt) { + // 不写或传了个空数值默认为数值轴 + if (!opt || (opt instanceof Array && opt.length === 0)) { + opt = [ { type: ecConfig.COMPONENT_TYPE_AXIS_VALUE } ]; + } + else if (!(opt instanceof Array)){ + opt = [opt]; + } + + // 最多两条,其他参数忽略 + if (opt.length > 2) { + opt = [opt[0],opt[1]]; + } + + if (this.axisType === 'xAxis') { + // 横轴位置默认配置 + if (!opt[0].position // 没配置或配置错 + || (opt[0].position != 'bottom' + && opt[0].position != 'top') + ) { + opt[0].position = 'bottom'; + } + if (opt.length > 1) { + opt[1].position = opt[0].position === 'bottom' ? 'top' : 'bottom'; + } + + for (var i = 0, l = opt.length; i < l; i++) { + // 坐标轴类型,横轴默认为类目型'category' + opt[i].type = opt[i].type || 'category'; + // 标识轴类型&索引 + opt[i].xAxisIndex = i; + opt[i].yAxisIndex = -1; + } + } + else { + // 纵轴位置默认配置 + if (!opt[0].position // 没配置或配置错 + || (opt[0].position != 'left' + && opt[0].position != 'right') + ) { + opt[0].position = 'left'; + } + + if (opt.length > 1) { + opt[1].position = opt[0].position === 'left' ? 'right' : 'left'; + } + + for (var i = 0, l = opt.length; i < l; i++) { + // 坐标轴类型,纵轴默认为数值型'value' + opt[i].type = opt[i].type || 'value'; + // 标识轴类型&索引 + opt[i].xAxisIndex = -1; + opt[i].yAxisIndex = i; + } + } + + return opt; + }, + + /** + * 刷新 + */ + refresh: function (newOption) { + var axisOption; + if (newOption) { + this.option = newOption; + if (this.axisType === 'xAxis') { + this.option.xAxis = this.reformOption(newOption.xAxis); + axisOption = this.option.xAxis; + } + else { + this.option.yAxis = this.reformOption(newOption.yAxis); + axisOption = this.option.yAxis; + } + this.series = newOption.series; + } + + var CategoryAxis = require('./categoryAxis'); + var ValueAxis = require('./valueAxis'); + var len = Math.max((axisOption && axisOption.length || 0), this._axisList.length); + for (var i = 0; i < len; i++) { + if (this._axisList[i] // 已有实例 + && newOption // 非空刷新 + && (!axisOption[i] || this._axisList[i].type != axisOption[i].type) // 类型不匹配 + ) { + this._axisList[i].dispose && this._axisList[i].dispose(); + this._axisList[i] = false; + } + + if (this._axisList[i]) { + this._axisList[i].refresh && this._axisList[i].refresh( + axisOption ? axisOption[i] : false, + this.series + ); + } + else if (axisOption && axisOption[i]) { + this._axisList[i] = axisOption[i].type === 'category' + ? new CategoryAxis( + this.ecTheme, this.messageCenter, this.zr, + axisOption[i], this.myChart, this.axisBase + ) + : new ValueAxis( + this.ecTheme, this.messageCenter, this.zr, + axisOption[i], this.myChart, this.axisBase, + this.series + ); + + } + } + }, + + /** + * 根据值换算位置 + * @param {number} idx 坐标轴索引0~1 + */ + getAxis: function (idx) { + return this._axisList[idx]; + }, + + clear: function () { + for (var i = 0, l = this._axisList.length; i < l; i++) { + this._axisList[i].dispose && this._axisList[i].dispose(); + } + this._axisList = []; + } + }; + + zrUtil.inherits(Axis, Base); + + require('../component').define('axis', Axis); + + return Axis; +}); +/** + * echarts组件: 网格 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/component/grid',['require','./base','zrender/shape/Rectangle','../config','zrender/tool/util','../component'],function (require) { + var Base = require('./base'); + + // 图形依赖 + var RectangleShape = require('zrender/shape/Rectangle'); + + var ecConfig = require('../config'); + var zrUtil = require('zrender/tool/util'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} option 图表选项 + * @param {number=} option.grid.x 直角坐标系内绘图网格起始横坐标,数值单位px + * @param {number=} option.grid.y 直角坐标系内绘图网格起始纵坐标,数值单位px + * @param {number=} option.grid.width 直角坐标系内绘图网格宽度,数值单位px + * @param {number=} option.grid.height 直角坐标系内绘图网格高度,数值单位px + */ + function Grid(ecTheme, messageCenter, zr, option, myChart) { + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + + this.refresh(option); + } + + Grid.prototype = { + type: ecConfig.COMPONENT_TYPE_GRID, + + getX: function () { + return this._x; + }, + + getY: function () { + return this._y; + }, + + getWidth: function () { + return this._width; + }, + + getHeight: function () { + return this._height; + }, + + getXend: function () { + return this._x + this._width; + }, + + getYend: function () { + return this._y + this._height; + }, + + getArea: function () { + return { + x: this._x, + y: this._y, + width: this._width, + height: this._height + }; + }, + + getBbox: function() { + return [ + [ this._x, this._y ], + [ this.getXend(), this.getYend() ] + ]; + }, + + /** + * 实在找不到合适的地方做了,各种粗暴的写法~ -_- + */ + refixAxisShape: function(component) { + var zeroX; + var zeroY; + var axisList = component.xAxis._axisList.concat(component.yAxis._axisList); + var len = axisList.length; + var axis; + while (len--) { + axis = axisList[len]; + if (axis.type == ecConfig.COMPONENT_TYPE_AXIS_VALUE + && axis._min < 0 + && axis._max >= 0 + ) { + axis.isHorizontal() + ? (zeroX = axis.getCoord(0)) + : (zeroY = axis.getCoord(0)); + } + } + if (typeof zeroX != 'undefined' || typeof zeroY != 'undefined') { + len = axisList.length; + while (len--) { + axisList[len].refixAxisShape(zeroX, zeroY); + } + } + }, + + refresh: function (newOption) { + if (newOption + || this._zrWidth != this.zr.getWidth() + || this._zrHeight != this.zr.getHeight() + ) { + this.clear(); + this.option = newOption || this.option; + this.option.grid = this.reformOption(this.option.grid); + + var gridOption = this.option.grid; + this._zrWidth = this.zr.getWidth(); + this._zrHeight = this.zr.getHeight(); + this._x = this.parsePercent(gridOption.x, this._zrWidth); + this._y = this.parsePercent(gridOption.y, this._zrHeight); + var x2 = this.parsePercent(gridOption.x2, this._zrWidth); + var y2 = this.parsePercent(gridOption.y2, this._zrHeight); + + + if (typeof gridOption.width == 'undefined') { + this._width = this._zrWidth - this._x - x2; + } + else { + this._width = this.parsePercent(gridOption.width, this._zrWidth); + } + this._width = this._width <= 0 ? 10 : this._width; + + if (typeof gridOption.height == 'undefined') { + this._height = this._zrHeight - this._y - y2; + } + else { + this._height = this.parsePercent(gridOption.height, this._zrHeight); + } + this._height = this._height <= 0 ? 10 : this._height; + + this._x = this.subPixelOptimize(this._x, gridOption.borderWidth); + this._y = this.subPixelOptimize(this._y, gridOption.borderWidth); + + this.shapeList.push(new RectangleShape({ + zlevel: this._zlevelBase, + hoverable: false, + style: { + x: this._x, + y: this._y, + width: this._width, + height: this._height, + brushType: gridOption.borderWidth > 0 ? 'both' : 'fill', + color: gridOption.backgroundColor, + strokeColor: gridOption.borderColor, + lineWidth: gridOption.borderWidth + // type: this.option.splitArea.areaStyle.type, + } + })); + this.zr.addShape(this.shapeList[0]); + } + } + }; + + zrUtil.inherits(Grid, Base); + + require('../component').define('grid', Grid); + + return Grid; +}); +/** + * echarts组件:数据区域缩放 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/component/dataZoom',['require','./base','zrender/shape/Rectangle','zrender/shape/Polygon','../util/shape/Icon','../config','zrender/tool/util','../component','../component'],function (require) { + var Base = require('./base'); + + // 图形依赖 + var RectangleShape = require('zrender/shape/Rectangle'); + var PolygonShape = require('zrender/shape/Polygon'); + var IconShape = require('../util/shape/Icon'); + + var ecConfig = require('../config'); + var zrUtil = require('zrender/tool/util'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} option 图表参数 + * @param {Object} component 组件 + */ + function DataZoom(ecTheme, messageCenter, zr, option, myChart) { + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + + var self = this; + self._ondrift = function (dx, dy) { + return self.__ondrift(this, dx, dy); + }; + self._ondragend = function () { + return self.__ondragend(); + }; + + this._fillerSize = 28; // 控件大小,水平布局为高,纵向布局为宽 + this._handleSize = 8; // 手柄大小 + // this._fillerShae; // 填充 + // this._startShape; // 起始手柄 + // this._endShape; // 结束手柄 + // this._startFrameShape; // 起始特效边框 + // this._endFrameShape; // 结束特效边框 + // this._syncTicket; + this._isSilence = false; + this._zoom = {}; + // this._originalData; + + this.option.dataZoom = this.reformOption(this.option.dataZoom); + this.zoomOption = this.option.dataZoom; + + // 位置参数,通过计算所得x, y, width, height + this._location = this._getLocation(); + // 缩放参数 + this._zoom = this._getZoom(); + this._backupData(); + + if (this.option.dataZoom.show) { + this._buildShape(); + } + this._syncData(); + } + + DataZoom.prototype = { + type : ecConfig.COMPONENT_TYPE_DATAZOOM, + _buildShape : function () { + this._buildBackground(); + this._buildFiller(); + this._buildHandle(); + this._buildFrame(); + + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + this._syncFrameShape(); + }, + + /** + * 根据选项计算实体的位置坐标 + */ + _getLocation : function () { + var x; + var y; + var width; + var height; + var grid = this.component.grid; + + // 不指定则根据grid适配 + if (this.zoomOption.orient == 'horizontal') { + // 水平布局 + width = this.zoomOption.width || grid.getWidth(); + height = this.zoomOption.height || this._fillerSize; + x = typeof this.zoomOption.x != 'undefined' + ? this.zoomOption.x : grid.getX(); + y = typeof this.zoomOption.y != 'undefined' + ? this.zoomOption.y : (this.zr.getHeight() - height - 2); + } + else { + // 垂直布局 + width = this.zoomOption.width || this._fillerSize; + height = this.zoomOption.height || grid.getHeight(); + x = typeof this.zoomOption.x != 'undefined' + ? this.zoomOption.x : 2; + y = typeof this.zoomOption.y != 'undefined' + ? this.zoomOption.y : grid.getY(); + } + + return { + x : x, + y : y, + width : width, + height : height + }; + }, + + /** + * 计算缩放参数 + * 修正单坐标轴只传对象为数组。 + */ + _getZoom : function () { + var series = this.option.series; + var xAxis = this.option.xAxis; + if (xAxis && !(xAxis instanceof Array)) { + xAxis = [xAxis]; + this.option.xAxis = xAxis; + } + var yAxis = this.option.yAxis; + if (yAxis && !(yAxis instanceof Array)) { + yAxis = [yAxis]; + this.option.yAxis = yAxis; + } + + var zoomSeriesIndex = []; + var xAxisIndex; + var yAxisIndex; + + var zOptIdx = this.zoomOption.xAxisIndex; + if (xAxis && typeof zOptIdx == 'undefined') { + xAxisIndex = []; + for (var i = 0, l = xAxis.length; i < l; i++) { + // 横纵默认为类目轴 + if (xAxis[i].type == 'category' + || typeof xAxis[i].type == 'undefined' + ) { + xAxisIndex.push(i); + } + } + } + else { + if (zOptIdx instanceof Array) { + xAxisIndex = zOptIdx; + } + else if (typeof zOptIdx != 'undefined') { + xAxisIndex = [zOptIdx]; + } + else { + xAxisIndex = []; + } + } + + zOptIdx = this.zoomOption.yAxisIndex; + if (yAxis && typeof zOptIdx == 'undefined') { + yAxisIndex = []; + for (var i = 0, l = yAxis.length; i < l; i++) { + if (yAxis[i].type == 'category') { + yAxisIndex.push(i); + } + } + } + else { + if (zOptIdx instanceof Array) { + yAxisIndex = zOptIdx; + } + else if (typeof zOptIdx != 'undefined') { + yAxisIndex = [zOptIdx]; + } + else { + yAxisIndex = []; + } + } + + // 找到缩放控制的所有series + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type != ecConfig.CHART_TYPE_LINE + && series[i].type != ecConfig.CHART_TYPE_BAR + && series[i].type != ecConfig.CHART_TYPE_SCATTER + && series[i].type != ecConfig.CHART_TYPE_K + ) { + continue; + } + for (var j = 0, k = xAxisIndex.length; j < k; j++) { + if (xAxisIndex[j] == (series[i].xAxisIndex || 0)) { + zoomSeriesIndex.push(i); + break; + } + } + for (var j = 0, k = yAxisIndex.length; j < k; j++) { + if (yAxisIndex[j] == (series[i].yAxisIndex || 0)) { + zoomSeriesIndex.push(i); + break; + } + } + // 不指定接管坐标轴,则散点图被纳入接管范围 + if (series[i].type == ecConfig.CHART_TYPE_SCATTER + && typeof this.zoomOption.xAxisIndex == 'undefined' + && typeof this.zoomOption.yAxisIndex == 'undefined' + ) { + zoomSeriesIndex.push(i); + } + } + + var start = typeof this._zoom.start != 'undefined' + ? this._zoom.start + : (typeof this.zoomOption.start != 'undefined' ? this.zoomOption.start : 0); + var end = typeof this._zoom.end != 'undefined' + ? this._zoom.end + : (typeof this.zoomOption.end != 'undefined' ? this.zoomOption.end : 100); + /* + var start = typeof this.zoomOption.start != 'undefined' + && this.zoomOption.start >= 0 + && this.zoomOption.start <= 100 + ? this.zoomOption.start : 0; + var end = typeof this.zoomOption.end != 'undefined' + && this.zoomOption.end >= 0 + && this.zoomOption.end <= 100 + ? this.zoomOption.end : 100; + */ + if (start > end) { + // 大小颠倒自动翻转 + start = start + end; + end = start - end; + start = start - end; + } + var size = Math.round( + (end - start) / 100 + * (this.zoomOption.orient == 'horizontal' + ? this._location.width : this._location.height) + ); + return { + start : start, + end : end, + start2 : 0, + end2 : 100, + size : size, + xAxisIndex : xAxisIndex, + yAxisIndex : yAxisIndex, + seriesIndex : zoomSeriesIndex, + scatterMap : this._zoom.scatterMap || {} + }; + }, + + _backupData : function () { + this._originalData = { + xAxis : {}, + yAxis : {}, + series : {} + }; + var xAxis = this.option.xAxis; + var xAxisIndex = this._zoom.xAxisIndex; + for (var i = 0, l = xAxisIndex.length; i < l; i++) { + this._originalData.xAxis[xAxisIndex[i]] = xAxis[xAxisIndex[i]].data; + } + + var yAxis = this.option.yAxis; + var yAxisIndex = this._zoom.yAxisIndex; + for (var i = 0, l = yAxisIndex.length; i < l; i++) { + this._originalData.yAxis[yAxisIndex[i]] = yAxis[yAxisIndex[i]].data; + } + + var series = this.option.series; + var seriesIndex = this._zoom.seriesIndex; + var serie; + for (var i = 0, l = seriesIndex.length; i < l; i++) { + serie = series[seriesIndex[i]]; + this._originalData.series[seriesIndex[i]] = serie.data; + if (serie.type == ecConfig.CHART_TYPE_SCATTER) { + this._calculScatterMap(seriesIndex[i]); + } + } + }, + + _calculScatterMap : function (seriesIndex) { + this._zoom.scatterMap = this._zoom.scatterMap || {}; + this._zoom.scatterMap[seriesIndex] = this._zoom.scatterMap[seriesIndex] || {}; + var componentLibrary = require('../component'); + // x轴极值 + var Axis = componentLibrary.get('axis'); + var axisOption = zrUtil.clone(this.option.xAxis); + if (axisOption instanceof Array) { + axisOption[0].type = 'value'; + axisOption[0].scale = true; + axisOption[0].boundary = [0, 0]; + axisOption[1] && (axisOption[1].type = 'value', axisOption[1].boundary = [0, 0]); + } + else { + axisOption.type = 'value'; + axisOption.scale = true; + axisOption.boundary = [0, 0]; + } + var vAxis = new Axis( + this.ecTheme, + null, // messageCenter + false, // this.zr + { + xAxis: axisOption, + series : this.option.series + }, + this, + 'xAxis' + ); + var axisIndex = this.option.series[seriesIndex].xAxisIndex || 0; + this._zoom.scatterMap[seriesIndex].x = vAxis.getAxis(axisIndex).getExtremum(); + vAxis.dispose(); + + // y轴极值 + axisOption = zrUtil.clone(this.option.yAxis); + if (axisOption instanceof Array) { + axisOption[0].type = 'value'; + axisOption[0].scale = true; + axisOption[1] && (axisOption[1].type = 'value', axisOption[1].boundary = [0, 0]); + } + else { + axisOption.type = 'value'; + axisOption.scale = true; + axisOption.boundary = [0, 0]; + } + vAxis = new Axis( + this.ecTheme, + null, // messageCenter + false, // this.zr + { + yAxis: axisOption, + series : this.option.series + }, + this, + 'yAxis' + ); + axisIndex = this.option.series[seriesIndex].yAxisIndex || 0; + this._zoom.scatterMap[seriesIndex].y = vAxis.getAxis(axisIndex).getExtremum(); + vAxis.dispose(); + // console.log(this._zoom.scatterMap); + }, + + _buildBackground : function () { + var width = this._location.width; + var height = this._location.height; + + // 背景 + this.shapeList.push(new RectangleShape({ + zlevel : this._zlevelBase, + hoverable :false, + style : { + x : this._location.x, + y : this._location.y, + width : width, + height : height, + color : this.zoomOption.backgroundColor + } + })); + + // 数据阴影 + var maxLength = 0; + var xAxis = this._originalData.xAxis; + var xAxisIndex = this._zoom.xAxisIndex; + for (var i = 0, l = xAxisIndex.length; i < l; i++) { + maxLength = Math.max( + maxLength, xAxis[xAxisIndex[i]].length + ); + } + var yAxis = this._originalData.yAxis; + var yAxisIndex = this._zoom.yAxisIndex; + for (var i = 0, l = yAxisIndex.length; i < l; i++) { + maxLength = Math.max( + maxLength, yAxis[yAxisIndex[i]].length + ); + } + + var seriesIndex = this._zoom.seriesIndex[0]; + var data = this._originalData.series[seriesIndex]; + var maxValue = Number.MIN_VALUE; + var minValue = Number.MAX_VALUE; + var value; + for (var i = 0, l = data.length; i < l; i++) { + value = typeof data[i] != 'undefined' + ? (typeof data[i].value != 'undefined' ? data[i].value : data[i]) + : 0; + if (this.option.series[seriesIndex].type == ecConfig.CHART_TYPE_K) { + value = value[1]; // 收盘价 + } + if (isNaN(value)) { + value = 0; + } + maxValue = Math.max(maxValue, value); + minValue = Math.min(minValue, value); + } + var valueRange = maxValue - minValue; + + var pointList = []; + var x = width / (maxLength - (maxLength > 1 ? 1 : 0)); + var y = height / (maxLength - (maxLength > 1 ? 1 : 0)); + var step = 1; + if (this.zoomOption.orient == 'horizontal' && x < 1) { + step = Math.floor(maxLength * 3 / width); + } + else if (this.zoomOption.orient == 'vertical' && y < 1){ + step = Math.floor(maxLength * 3 / height); + } + + for (var i = 0, l = maxLength; i < l; i += step) { + value = typeof data[i] != 'undefined' + ? (typeof data[i].value != 'undefined' + ? data[i].value : data[i]) + : 0; + if (this.option.series[seriesIndex].type == ecConfig.CHART_TYPE_K) { + value = value[1]; // 收盘价 + } + if (isNaN(value)) { + value = 0; + } + if (this.zoomOption.orient == 'horizontal') { + pointList.push([ + this._location.x + x * i, + this._location.y + height - 1 - Math.round( + (value - minValue) / valueRange * (height - 10) + ) + ]); + } + else { + pointList.push([ + this._location.x + 1 + Math.round( + (value - minValue) / valueRange * (width - 10) + ), + this._location.y + y * i + ]); + } + } + if (this.zoomOption.orient == 'horizontal') { + pointList.push([ + this._location.x + width, + this._location.y + height + ]); + pointList.push([ + this._location.x, this._location.y + height + ]); + } + else { + pointList.push([ + this._location.x, this._location.y + height + ]); + pointList.push([ + this._location.x, this._location.y + ]); + } + + this.shapeList.push(new PolygonShape({ + zlevel : this._zlevelBase, + style : { + pointList : pointList, + color : this.zoomOption.dataBackgroundColor + }, + hoverable : false + })); + }, + + /** + * 构建填充物 + */ + _buildFiller : function () { + this._fillerShae = { + zlevel : this._zlevelBase, + draggable : true, + ondrift : this._ondrift, + ondragend : this._ondragend, + _type : 'filler' + }; + + if (this.zoomOption.orient == 'horizontal') { + // 横向 + this._fillerShae.style = { + x : this._location.x + + Math.round(this._zoom.start / 100 * this._location.width) + + this._handleSize, + y : this._location.y, + width : this._zoom.size - this._handleSize * 2, + height : this._location.height, + color : this.zoomOption.fillerColor, + // strokeColor : '#fff', // this.zoomOption.handleColor, + // lineWidth: 2, + text : ':::', + textPosition : 'inside' + }; + } + else { + // 纵向 + this._fillerShae.style ={ + x : this._location.x, + y : this._location.y + + Math.round(this._zoom.start / 100 * this._location.height) + + this._handleSize, + width : this._location.width, + height : this._zoom.size - this._handleSize * 2, + color : this.zoomOption.fillerColor, + // strokeColor : '#fff', // this.zoomOption.handleColor, + // lineWidth: 2, + text : '::', + textPosition : 'inside' + }; + } + + this._fillerShae.highlightStyle = { + brushType: 'fill', + color : 'rgba(0,0,0,0)' + /* + color : require('zrender/tool/color').alpha( + this._fillerShae.style.color, 0 + ) + */ + }; + this._fillerShae = new RectangleShape(this._fillerShae); + this.shapeList.push(this._fillerShae); + }, + + /** + * 构建拖拽手柄 + */ + _buildHandle : function () { + this._startShape = { + zlevel : this._zlevelBase, + draggable : true, + style : { + iconType: 'rectangle', + x : this._location.x, + y : this._location.y, + width : this._handleSize, + height : this._handleSize, + color : this.zoomOption.handleColor, + text : '=', + textPosition : 'inside' + }, + highlightStyle : { + brushType: 'fill' + }, + ondrift : this._ondrift, + ondragend : this._ondragend + }; + + if (this.zoomOption.orient == 'horizontal') { + this._startShape.style.height = this._location.height; + this._endShape = zrUtil.clone(this._startShape); + + this._startShape.style.x = this._fillerShae.style.x - this._handleSize, + this._endShape.style.x = this._fillerShae.style.x + + this._fillerShae.style.width; + } + else { + this._startShape.style.width = this._location.width; + this._endShape = zrUtil.clone(this._startShape); + + this._startShape.style.y = this._fillerShae.style.y - this._handleSize; + this._endShape.style.y = this._fillerShae.style.y + + this._fillerShae.style.height; + } + this._startShape = new IconShape(this._startShape); + this._endShape = new IconShape(this._endShape); + this.shapeList.push(this._startShape); + this.shapeList.push(this._endShape); + }, + + /** + * 构建特效边框 + */ + _buildFrame : function () { + // 特效框线,亚像素优化 + var x = this.subPixelOptimize(this._location.x, 1); + var y = this.subPixelOptimize(this._location.y, 1); + this._startFrameShape = { + zlevel : this._zlevelBase, + hoverable :false, + style : { + x : x, + y : y, + width : this._location.width - (x > this._location.x ? 1 : 0), + height : this._location.height - (y > this._location.y ? 1 : 0), + lineWidth: 1, + brushType: 'stroke', + strokeColor : this.zoomOption.handleColor + } + }; + this._endFrameShape = zrUtil.clone(this._startFrameShape); + + this._startFrameShape = new RectangleShape(this._startFrameShape); + this._endFrameShape = new RectangleShape(this._endFrameShape); + this.shapeList.push(this._startFrameShape); + this.shapeList.push(this._endFrameShape); + return; + }, + + _syncHandleShape : function () { + if (this.zoomOption.orient == 'horizontal') { + this._startShape.style.x = this._fillerShae.style.x - this._handleSize; + this._endShape.style.x = this._fillerShae.style.x + + this._fillerShae.style.width; + + this._zoom.start = Math.floor( + (this._startShape.style.x - this._location.x) + / this._location.width * 100 + ); + this._zoom.end = Math.ceil( + (this._endShape.style.x + this._handleSize - this._location.x) + / this._location.width * 100 + ); + } + else { + this._startShape.style.y = this._fillerShae.style.y - this._handleSize; + this._endShape.style.y = this._fillerShae.style.y + + this._fillerShae.style.height; + this._zoom.start = Math.floor( + (this._startShape.style.y - this._location.y) + / this._location.height * 100 + ); + this._zoom.end = Math.ceil( + (this._endShape.style.y + this._handleSize - this._location.y) + / this._location.height * 100 + ); + } + + this.zr.modShape(this._startShape.id); + this.zr.modShape(this._endShape.id); + + // 同步边框 + this._syncFrameShape(); + + this.zr.refresh(); + }, + + _syncFillerShape : function () { + var a; + var b; + if (this.zoomOption.orient == 'horizontal') { + a = this._startShape.style.x; + b = this._endShape.style.x; + this._fillerShae.style.x = Math.min(a, b) + this._handleSize; + this._fillerShae.style.width = Math.abs(a - b) - this._handleSize; + this._zoom.start = Math.floor( + (Math.min(a, b) - this._location.x) + / this._location.width * 100 + ); + this._zoom.end = Math.ceil( + (Math.max(a, b) + this._handleSize - this._location.x) + / this._location.width * 100 + ); + } + else { + a = this._startShape.style.y; + b = this._endShape.style.y; + this._fillerShae.style.y = Math.min(a, b) + this._handleSize; + this._fillerShae.style.height = Math.abs(a - b) - this._handleSize; + this._zoom.start = Math.floor( + (Math.min(a, b) - this._location.y) + / this._location.height * 100 + ); + this._zoom.end = Math.ceil( + (Math.max(a, b) + this._handleSize - this._location.y) + / this._location.height * 100 + ); + } + + this.zr.modShape(this._fillerShae.id); + + // 同步边框 + this._syncFrameShape(); + + this.zr.refresh(); + }, + + _syncFrameShape : function () { + if (this.zoomOption.orient == 'horizontal') { + this._startFrameShape.style.width = + this._fillerShae.style.x - this._location.x; + this._endFrameShape.style.x = + this._fillerShae.style.x + this._fillerShae.style.width; + this._endFrameShape.style.width = + this._location.x + this._location.width - this._endFrameShape.style.x; + } + else { + this._startFrameShape.style.height = + this._fillerShae.style.y - this._location.y; + this._endFrameShape.style.y = + this._fillerShae.style.y + this._fillerShae.style.height; + this._endFrameShape.style.height = + this._location.y + this._location.height - this._endFrameShape.style.y; + } + + this.zr.modShape(this._startFrameShape.id); + this.zr.modShape(this._endFrameShape.id); + }, + + _syncShape : function () { + if (!this.zoomOption.show) { + // 没有伸缩控件 + return; + } + if (this.zoomOption.orient == 'horizontal') { + this._startShape.style.x = this._location.x + + this._zoom.start / 100 * this._location.width; + this._endShape.style.x = this._location.x + + this._zoom.end / 100 * this._location.width + - this._handleSize; + + this._fillerShae.style.x = this._startShape.style.x + this._handleSize; + this._fillerShae.style.width = this._endShape.style.x + - this._startShape.style.x + - this._handleSize; + } + else { + this._startShape.style.y = this._location.y + + this._zoom.start / 100 * this._location.height; + this._endShape.style.y = this._location.y + + this._zoom.end / 100 * this._location.height + - this._handleSize; + + this._fillerShae.style.y = this._startShape.style.y + this._handleSize; + this._fillerShae.style.height = this._endShape.style.y + - this._startShape.style.y + - this._handleSize; + } + + this.zr.modShape(this._startShape.id); + this.zr.modShape(this._endShape.id); + this.zr.modShape(this._fillerShae.id); + // 同步边框 + this._syncFrameShape(); + this.zr.refresh(); + }, + + _syncData : function (dispatchNow) { + var target; + var start; + var end; + var length; + var data; + + for (var key in this._originalData) { + target = this._originalData[key]; + for (var idx in target) { + data = target[idx]; + if (typeof data == 'undefined') { + continue; + } + length = data.length; + start = Math.floor(this._zoom.start / 100 * length); + end = Math.ceil(this._zoom.end / 100 * length); + if (this.option[key][idx].type != ecConfig.CHART_TYPE_SCATTER) { + this.option[key][idx].data = data.slice(start, end); + } + else { + // 散点图特殊处理 + this.option[key][idx].data = this._synScatterData(idx, data); + } + } + } + + if (!this._isSilence && (this.zoomOption.realtime || dispatchNow)) { + this.messageCenter.dispatch( + ecConfig.EVENT.DATA_ZOOM, + null, + {zoom: this._zoom}, + this.myChart + ); + } + + //this.zoomOption.start = this._zoom.start; + //this.zoomOption.end = this._zoom.end; + }, + + _synScatterData : function (seriesIndex, data) { + if (this._zoom.start === 0 + && this._zoom.end == 100 + && this._zoom.start2 === 0 + && this._zoom.end2 == 100 + ) { + return data; + } + var newData = []; + var scale = this._zoom.scatterMap[seriesIndex]; + var total; + var xStart; + var xEnd; + var yStart; + var yEnd; + + if (this.zoomOption.orient == 'horizontal') { + total = scale.x.max - scale.x.min; + xStart = this._zoom.start / 100 * total + scale.x.min; + xEnd = this._zoom.end / 100 * total + scale.x.min; + + total = scale.y.max - scale.y.min; + yStart = this._zoom.start2 / 100 * total + scale.y.min; + yEnd = this._zoom.end2 / 100 * total + scale.y.min; + } + else { + total = scale.x.max - scale.x.min; + xStart = this._zoom.start2 / 100 * total + scale.x.min; + xEnd = this._zoom.end2 / 100 * total + scale.x.min; + + total = scale.y.max - scale.y.min; + yStart = this._zoom.start / 100 * total + scale.y.min; + yEnd = this._zoom.end / 100 * total + scale.y.min; + } + + // console.log(xStart,xEnd,yStart,yEnd); + var value; + for (var i = 0, l = data.length; i < l; i++) { + value = data[i].value || data[i]; + if (value[0] >= xStart + && value[0] <= xEnd + && value[1] >= yStart + && value[1] <= yEnd + ) { + newData.push(data[i]); + } + } + + return newData; + }, + /** + * 拖拽范围控制 + */ + __ondrift : function (shape, dx, dy) { + if (this.zoomOption.zoomLock) { + // zoomLock时把handle转成filler的拖拽 + shape = this._fillerShae; + } + + var detailSize = shape._type == 'filler' ? this._handleSize : 0; + if (this.zoomOption.orient == 'horizontal') { + if (shape.style.x + dx - detailSize <= this._location.x) { + shape.style.x = this._location.x + detailSize; + } + else if (shape.style.x + dx + shape.style.width + detailSize + >= this._location.x + this._location.width + ) { + shape.style.x = this._location.x + this._location.width + - shape.style.width - detailSize; + } + else { + shape.style.x += dx; + } + } + else { + if (shape.style.y + dy - detailSize <= this._location.y) { + shape.style.y = this._location.y + detailSize; + } + else if (shape.style.y + dy + shape.style.height + detailSize + >= this._location.y + this._location.height + ) { + shape.style.y = this._location.y + this._location.height + - shape.style.height - detailSize; + } + else { + shape.style.y += dy; + } + } + + if (shape._type == 'filler') { + this._syncHandleShape(); + } + else { + this._syncFillerShape(); + } + + if (this.zoomOption.realtime) { + this._syncData(); + } + + return true; + }, + + __ondragend : function () { + this.isDragend = true; + }, + + /** + * 数据项被拖拽出去 + */ + ondragend : function (param, status) { + if (!this.isDragend || !param.target) { + // 没有在当前实例上发生拖拽行为则直接返回 + return; + } + + !this.zoomOption.realtime && this._syncData(); + + // 别status = {}赋值啊!! + status.dragOut = true; + status.dragIn = true; + if (!this._isSilence && !this.zoomOption.realtime) { + this.messageCenter.dispatch( + ecConfig.EVENT.DATA_ZOOM, + null, + {zoom: this._zoom}, + this.myChart + ); + } + status.needRefresh = false; // 会有消息触发fresh,不用再刷一遍 + // 处理完拖拽事件后复位 + this.isDragend = false; + + return; + }, + + ondataZoom : function (param, status) { + status.needRefresh = true; + return; + }, + + absoluteZoom : function (param) { + //this.zoomOption.start = + this._zoom.start = param.start; + //this.zoomOption.end = + this._zoom.end = param.end; + //this.zoomOption.start2 = + this._zoom.start2 = param.start2; + //this.zoomOption.end2 = + this._zoom.end2 = param.end2; + this._syncShape(); + this._syncData(true); + return; + }, + + rectZoom : function (param) { + if (!param) { + // 重置拖拽 + //this.zoomOption.start = + //this.zoomOption.start2 = + this._zoom.start = + this._zoom.start2 = 0; + + //this.zoomOption.end = + //this.zoomOption.end2 = + this._zoom.end = + this._zoom.end2 = 100; + + this._syncShape(); + this._syncData(true); + return this._zoom; + } + var gridArea = this.component.grid.getArea(); + var rect = { + x : param.x, + y : param.y, + width : param.width, + height : param.height + }; + // 修正方向框选 + if (rect.width < 0) { + rect.x += rect.width; + rect.width = -rect.width; + } + if (rect.height < 0) { + rect.y += rect.height; + rect.height = -rect.height; + } + // console.log(rect,this._zoom); + + // 剔除无效缩放 + if (rect.x > gridArea.x + gridArea.width + || rect.y > gridArea.y + gridArea.height + ) { + return false; // 无效缩放 + } + + // 修正框选超出 + if (rect.x < gridArea.x) { + rect.x = gridArea.x; + } + if (rect.x + rect.width > gridArea.x + gridArea.width) { + rect.width = gridArea.x + gridArea.width - rect.x; + } + if (rect.y + rect.height > gridArea.y + gridArea.height) { + rect.height = gridArea.y + gridArea.height - rect.y; + } + + var total; + var sdx = (rect.x - gridArea.x) / gridArea.width; + var edx = 1 - (rect.x + rect.width - gridArea.x) / gridArea.width; + var sdy = 1 - (rect.y + rect.height - gridArea.y) / gridArea.height; + var edy = (rect.y - gridArea.y) / gridArea.height; + //console.log('this',sdy,edy,this._zoom.start,this._zoom.end) + if (this.zoomOption.orient == 'horizontal') { + total = this._zoom.end - this._zoom.start; + this._zoom.start += total * sdx; + this._zoom.end -= total * edx; + + total = this._zoom.end2 - this._zoom.start2; + this._zoom.start2 += total * sdy; + this._zoom.end2 -= total * edy; + } + else { + total = this._zoom.end - this._zoom.start; + this._zoom.start += total * sdy; + this._zoom.end -= total * edy; + + total = this._zoom.end2 - this._zoom.start2; + this._zoom.start2 += total * sdx; + this._zoom.end2 -= total * edx; + } + //console.log(this._zoom.start,this._zoom.end,this._zoom.start2,this._zoom.end2) + //this.zoomOption.start = this._zoom.start; + //this.zoomOption.end = this._zoom.end; + //this.zoomOption.start2 = this._zoom.start2; + //this.zoomOption.end2 = this._zoom.end2; + //console.log(rect,gridArea,this._zoom,total) + this._syncShape(); + this._syncData(true); + return this._zoom; + }, + + syncBackupData : function (curOption) { + var start; + var target = this._originalData['series']; + var curSeries = curOption.series; + var curData; + for (var i = 0, l = curSeries.length; i < l; i++) { + curData = curSeries[i].data; + if (target[i]) { + // dataZoom接管的 + start = Math.floor(this._zoom.start / 100 * target[i].length); + } + else { + // 非dataZoom接管 + start = 0; + } + for (var j = 0, k = curData.length; j < k; j++) { + //optionBackup.series[i].data[j + start] = curData[j]; + if (target[i]) { + // 同步内部备份 + target[i][j + start] = curData[j]; + } + } + } + }, + + syncOption : function(magicOption) { + this.silence(true); + this.option = magicOption; + + this.clear(); + // 位置参数,通过计算所得x, y, width, height + this._location = this._getLocation(); + // 缩放参数 + this._zoom = this._getZoom(); + + this._backupData(); + if (this.option.dataZoom && this.option.dataZoom.show) { + this._buildShape(); + } + this._syncData(); + + this.silence(false); + }, + + silence : function (s) { + this._isSilence = s; + }, + + getRealDataIndex : function (sIdx, dIdx) { + if (!this._originalData || (this._zoom.start === 0 && this._zoom.end == 100)) { + return dIdx; + } + var sreies = this._originalData.series; + if (sreies[sIdx]) { + return Math.floor(this._zoom.start / 100 * sreies[sIdx].length) + dIdx; + } + return -1; + }, + + /** + * 避免dataZoom带来两次refresh,不设refresh接口,resize重复一下buildshape逻辑 + */ + resize : function () { + this.clear(); + + // 位置参数,通过计算所得x, y, width, height + this._location = this._getLocation(); + // 缩放参数 + this._zoom = this._getZoom(); + + if (this.option.dataZoom.show) { + this._buildShape(); + } + } + }; + + zrUtil.inherits(DataZoom, Base); + + require('../component').define('dataZoom', DataZoom); + + return DataZoom; +}); +/** + * zrender + * + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + * shape类:handlePolygon,dataRange手柄 + */ +define('echarts/util/shape/HandlePolygon',['require','zrender/shape/Base','zrender/shape/Polygon','zrender/tool/util'],function (require) { + var Base = require('zrender/shape/Base'); + var PolygonShape = require('zrender/shape/Polygon'); + var zrUtil = require('zrender/tool/util'); + + function HandlePolygon(options) { + Base.call(this, options); + } + + HandlePolygon.prototype = { + type : 'handle-polygon', + /** + * 创建多边形路径 + * @param {Context2D} ctx Canvas 2D上下文 + * @param {Object} style 样式 + */ + buildPath : function (ctx, style) { + PolygonShape.prototype.buildPath( + ctx, style + ); + }, + isCover : function (x, y) { + var originPos = this.getTansform(x, y); + x = originPos[0]; + y = originPos[1]; + + // 不能缓存rect! + var rect = this.style.rect; + if (x >= rect.x + && x <= (rect.x + rect.width) + && y >= rect.y + && y <= (rect.y + rect.height) + ) { + // 矩形内 + return true; + } + else { + return false; + } + } + }; + zrUtil.inherits(HandlePolygon, Base); + + return HandlePolygon; +}); + +/** + * echarts组件:值域 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/component/dataRange',['require','./base','zrender/shape/Text','zrender/shape/Rectangle','../util/shape/HandlePolygon','../config','zrender/tool/util','zrender/tool/area','zrender/tool/color','zrender/tool/color','../component'],function (require) { + var Base = require('./base'); + + // 图形依赖 + var TextShape = require('zrender/shape/Text'); + var RectangleShape = require('zrender/shape/Rectangle'); + var HandlePolygonShape = require('../util/shape/HandlePolygon'); + + var ecConfig = require('../config'); + var zrUtil = require('zrender/tool/util'); + var zrArea = require('zrender/tool/area'); + var zrColor = require('zrender/tool/color'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} option 图表参数 + * @param {Object=} selected 用于状态保持 + */ + function DataRange(ecTheme, messageCenter, zr, option, myChart) { + if (typeof this.query(option, 'dataRange.min') == 'undefined' + || typeof this.query(option, 'dataRange.max') == 'undefined' + ) { + console.error('option.dataRange.min or option.dataRange.max has not been defined.'); + return; + } + + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + + var self = this; + self._ondrift = function(dx, dy) { + return self.__ondrift(this, dx, dy); + }; + self._ondragend = function() { + return self.__ondragend(); + }; + self._dataRangeSelected = function(param) { + return self.__dataRangeSelected(param); + }; + this._selectedMap = {}; + this._range = {}; + + this.refresh(option); + } + + DataRange.prototype = { + type : ecConfig.COMPONENT_TYPE_DATARANGE, + _textGap : 10, // 非值文字间隔 + _buildShape : function () { + // 值域元素组的位置参数,通过计算所得x, y, width, height + this._itemGroupLocation = this._getItemGroupLocation(); + this._buildBackground(); + if (this.dataRangeOption.splitNumber <= 0 + || this.dataRangeOption.calculable + ) { + this._buildGradient(); + } + else { + this._buildItem(); + } + + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + + this._syncShapeFromRange(); + }, + + /** + * 构建图例型的值域元素 + */ + _buildItem : function () { + var data = this._valueTextList; + var dataLength = data.length; + var itemName; + var itemShape; + var textShape; + var font = this.getFont(this.dataRangeOption.textStyle); + + var lastX = this._itemGroupLocation.x; + var lastY = this._itemGroupLocation.y; + var itemWidth = this.dataRangeOption.itemWidth; + var itemHeight = this.dataRangeOption.itemHeight; + var itemGap = this.dataRangeOption.itemGap; + var textHeight = zrArea.getTextHeight('国', font); + var color; + + if (this.dataRangeOption.orient == 'vertical' + && this.dataRangeOption.x == 'right' + ) { + lastX = this._itemGroupLocation.x + + this._itemGroupLocation.width + - itemWidth; + } + var needValueText = true; + if (this.dataRangeOption.text) { + needValueText = false; + // 第一个文字 + if (this.dataRangeOption.text[0]) { + textShape = this._getTextShape( + lastX, lastY, this.dataRangeOption.text[0] + ); + if (this.dataRangeOption.orient == 'horizontal') { + lastX += zrArea.getTextWidth( + this.dataRangeOption.text[0], + font + ) + + this._textGap; + } + else { + lastY += textHeight + this._textGap; + textShape.style.y += textHeight / 2 + this._textGap; + textShape.style.textBaseline = 'bottom'; + } + this.shapeList.push(new TextShape(textShape)); + } + } + + for (var i = 0; i < dataLength; i++) { + itemName = data[i]; + color = this.getColor((dataLength - i) * this._gap + this.dataRangeOption.min); + // 图形 + itemShape = this._getItemShape( + lastX, lastY, + itemWidth, itemHeight, + (this._selectedMap[i] ? color : '#ccc') + ); + itemShape._idx = i; + itemShape.onclick = this._dataRangeSelected; + this.shapeList.push(new RectangleShape(itemShape)); + + if (needValueText) { + // 文字 + textShape = { + zlevel : this._zlevelBase, + style : { + x : lastX + itemWidth + 5, + y : lastY, + color : this._selectedMap[i] + ? this.dataRangeOption.textStyle.color + : '#ccc', + text: data[i], + textFont: font, + textBaseline: 'top' + }, + highlightStyle:{ + brushType: 'fill' + }, + clickable : true + }; + if (this.dataRangeOption.orient == 'vertical' + && this.dataRangeOption.x == 'right' + ) { + textShape.style.x -= (itemWidth + 10); + textShape.style.textAlign = 'right'; + } + textShape._idx = i; + textShape.onclick = this._dataRangeSelected; + this.shapeList.push(new TextShape(textShape)); + } + + if (this.dataRangeOption.orient == 'horizontal') { + lastX += itemWidth + + (needValueText ? 5 : 0) + + (needValueText + ? zrArea.getTextWidth(itemName, font) + : 0) + + itemGap; + } + else { + lastY += itemHeight + itemGap; + } + } + + if (!needValueText && this.dataRangeOption.text[1]) { + if (this.dataRangeOption.orient == 'horizontal') { + lastX = lastX - itemGap + this._textGap; + } + else { + lastY = lastY - itemGap + this._textGap; + } + // 最后一个文字 + textShape = this._getTextShape( + lastX, lastY, this.dataRangeOption.text[1] + ); + + if (this.dataRangeOption.orient != 'horizontal') { + textShape.style.y -= 5; + textShape.style.textBaseline = 'top'; + } + + this.shapeList.push(new TextShape(textShape)); + } + }, + + /** + * 构建渐变型的值域元素 + */ + _buildGradient : function () { + var itemShape; + var textShape; + var font = this.getFont(this.dataRangeOption.textStyle); + + var lastX = this._itemGroupLocation.x; + var lastY = this._itemGroupLocation.y; + var itemWidth = this.dataRangeOption.itemWidth; + var itemHeight = this.dataRangeOption.itemHeight; + var textHeight = zrArea.getTextHeight('国', font); + + + var needValueText = true; + if (this.dataRangeOption.text) { + needValueText = false; + // 第一个文字 + if (this.dataRangeOption.text[0]) { + textShape = this._getTextShape( + lastX, lastY, this.dataRangeOption.text[0] + ); + if (this.dataRangeOption.orient == 'horizontal') { + lastX += zrArea.getTextWidth( + this.dataRangeOption.text[0], + font + ) + + this._textGap; + } + else { + lastY += textHeight + this._textGap; + textShape.style.y += textHeight / 2 + this._textGap; + textShape.style.textBaseline = 'bottom'; + } + this.shapeList.push(new TextShape(textShape)); + } + } + + var zrColor = require('zrender/tool/color'); + var per = 1 / (this.dataRangeOption.color.length - 1); + var colorList = []; + for (var i = 0, l = this.dataRangeOption.color.length; i < l; i++) { + colorList.push([i * per, this.dataRangeOption.color[i]]); + } + if (this.dataRangeOption.orient == 'horizontal') { + itemShape = { + zlevel : this._zlevelBase, + style : { + x : lastX, + y : lastY, + width : itemWidth * 10, + height : itemHeight, + color : zrColor.getLinearGradient( + lastX, lastY, lastX + itemWidth * 10, lastY, + colorList + ) + }, + hoverable : false + }; + lastX += itemWidth * 10 + this._textGap; + } + else { + itemShape = { + zlevel : this._zlevelBase, + style : { + x : lastX, + y : lastY, + width : itemWidth, + height : itemHeight * 10, + color : zrColor.getLinearGradient( + lastX, lastY, lastX, lastY + itemHeight * 10, + colorList + ) + }, + hoverable : false + }; + lastY += itemHeight * 10 + this._textGap; + } + this.shapeList.push(new RectangleShape(itemShape)); + if (this.dataRangeOption.calculable) { + // 可计算元素的位置缓存 + this._calculableLocation = itemShape.style; + this._buildFiller(); + this._bulidMask(); + this._bulidHandle(); + } + + if (!needValueText && this.dataRangeOption.text[1]) { + // 最后一个文字 + textShape = this._getTextShape( + lastX, lastY, this.dataRangeOption.text[1] + ); + + this.shapeList.push(new TextShape(textShape)); + } + }, + + /** + * 构建填充物 + */ + _buildFiller : function () { + this._fillerShae = { + zlevel : this._zlevelBase + 1, + style : { + x : this._calculableLocation.x, + y : this._calculableLocation.y, + width : this._calculableLocation.width, + height : this._calculableLocation.height, + color : 'rgba(255,255,255,0)' + }, + highlightStyle : { + strokeColor : 'rgba(255,255,255,0.5)', + lineWidth : 1 + }, + draggable : true, + ondrift : this._ondrift, + ondragend : this._ondragend, + _type : 'filler' + }; + this._fillerShae = new RectangleShape(this._fillerShae); + this.shapeList.push(this._fillerShae); + }, + + /** + * 构建拖拽手柄 + */ + _bulidHandle : function () { + var x = this._calculableLocation.x; + var y = this._calculableLocation.y; + var width = this._calculableLocation.width; + var height = this._calculableLocation.height; + + var font = this.getFont(this.dataRangeOption.textStyle); + var textHeight = zrArea.getTextHeight('国', font); + var textWidth = Math.max( + zrArea.getTextWidth(this._textFormat(this.dataRangeOption.max), font), + zrArea.getTextWidth(this._textFormat(this.dataRangeOption.min), font) + ) + 2; + + var pointListStart; + var textXStart; + var textYStart; + var coverRectStart; + var pointListEnd; + var textXEnd; + var textYEnd; + var coverRectEnd; + if (this.dataRangeOption.orient == 'horizontal') { + // 水平 + if (this.dataRangeOption.y != 'bottom') { + // 手柄统统在下方 + pointListStart = [ + [x, y], + [x, y + height + textHeight], + [x - textHeight, y + height + textHeight], + [x - 1, y + height], + [x - 1, y] + + ]; + textXStart = x - textWidth / 2 - textHeight; + textYStart = y + height + textHeight / 2 + 2; + coverRectStart = { + x : x - textWidth - textHeight, + y : y + height, + width : textWidth + textHeight, + height : textHeight + }; + + pointListEnd = [ + [x + width, y], + [x + width, y + height + textHeight], + [x + width + textHeight, y + height + textHeight], + [x + width + 1, y + height], + [x + width + 1, y] + ]; + textXEnd = x + width + textWidth / 2 + textHeight; + textYEnd = textYStart; + coverRectEnd = { + x : x + width, + y : y + height, + width : textWidth + textHeight, + height : textHeight + }; + } + else { + // 手柄在上方 + pointListStart = [ + [x, y + height], + [x, y - textHeight], + [x - textHeight, y - textHeight], + [x - 1, y], + [x - 1, y + height] + + ]; + textXStart = x - textWidth / 2 - textHeight; + textYStart = y - textHeight / 2 - 2; + coverRectStart = { + x : x - textWidth - textHeight, + y : y - textHeight, + width : textWidth + textHeight, + height : textHeight + }; + + pointListEnd = [ + [x + width, y + height], + [x + width, y - textHeight], + [x + width + textHeight, y - textHeight], + [x + width + 1, y], + [x + width + 1, y + height] + ]; + textXEnd = x + width + textWidth / 2 + textHeight; + textYEnd = textYStart; + coverRectEnd = { + x : x + width, + y : y - textHeight, + width : textWidth + textHeight, + height : textHeight + }; + } + } + else { + textWidth += textHeight; + // 垂直 + if (this.dataRangeOption.x != 'right') { + // 手柄统统在右侧 + pointListStart = [ + [x, y], + [x + width + textHeight, y], + [x + width + textHeight, y - textHeight], + [x + width, y - 1], + [x, y - 1] + ]; + textXStart = x + width + textWidth / 2 + textHeight / 2; + textYStart = y - textHeight / 2; + coverRectStart = { + x : x + width, + y : y - textHeight, + width : textWidth + textHeight, + height : textHeight + }; + + pointListEnd = [ + [x, y + height], + [x + width + textHeight, y + height], + [x + width + textHeight, y + textHeight + height], + [x + width, y + 1 + height], + [x, y + height + 1] + ]; + textXEnd = textXStart; + textYEnd = y + height + textHeight / 2; + coverRectEnd = { + x : x + width, + y : y + height, + width : textWidth + textHeight, + height : textHeight + }; + } + else { + // 手柄在左侧 + pointListStart = [ + [x + width, y], + [x - textHeight, y], + [x - textHeight, y - textHeight], + [x, y - 1], + [x + width, y - 1] + ]; + textXStart = x - textWidth / 2 - textHeight / 2; + textYStart = y - textHeight / 2; + coverRectStart = { + x : x - textWidth - textHeight, + y : y - textHeight, + width : textWidth + textHeight, + height : textHeight + }; + + pointListEnd = [ + [x + width, y + height], + [x - textHeight, y + height], + [x - textHeight, y + textHeight + height], + [x, y + 1 + height], + [x + width, y + height + 1] + ]; + textXEnd = textXStart; + textYEnd = y + height + textHeight / 2; + coverRectEnd = { + x : x - textWidth - textHeight, + y : y + height, + width : textWidth + textHeight, + height : textHeight + }; + } + } + + this._startShape = { + style : { + pointList : pointListStart, + text : this._textFormat(this.dataRangeOption.max), + textX : textXStart, + textY : textYStart, + color : this.getColor(this.dataRangeOption.max), + rect : coverRectStart, + x : pointListStart[0][0], + y : pointListStart[0][1], + _x : pointListStart[0][0], // 拖拽区域控制缓存 + _y : pointListStart[0][1] + } + }; + this._startShape.highlightStyle = { + strokeColor : this._startShape.style.color, + lineWidth : 1 + }; + + this._endShape = { + style : { + pointList : pointListEnd, + text : this._textFormat(this.dataRangeOption.min), + textX : textXEnd, + textY : textYEnd, + color : this.getColor(this.dataRangeOption.min), + rect : coverRectEnd, + x : pointListEnd[0][0], + y : pointListEnd[0][1], + _x : pointListEnd[0][0], // 拖拽区域控制缓存 + _y : pointListEnd[0][1] + } + }; + this._endShape.highlightStyle = { + strokeColor : this._endShape.style.color, + lineWidth : 1 + }; + + // 统一参数 + this._startShape.zlevel = this._endShape.zlevel = this._zlevelBase + 1; + this._startShape.draggable = this._endShape.draggable = true; + this._startShape.ondrift = this._endShape.ondrift = this._ondrift; + this._startShape.ondragend = this._endShape.ondragend = this._ondragend; + + this._startShape.style.textColor = this._endShape.style.textColor + = this.dataRangeOption.textStyle.color; + this._startShape.style.textAlign = this._endShape.style.textAlign = 'center'; + this._startShape.style.textPosition = this._endShape.style.textPosition = 'specific'; + this._startShape.style.textBaseline = this._endShape.style.textBaseline = 'middle'; + // for ondrif计算统一 + this._startShape.style.width = this._endShape.style.width = 0; + this._startShape.style.height = this._endShape.style.height = 0; + this._startShape.style.textPosition = this._endShape.style.textPosition = 'specific'; + + this._startShape = new HandlePolygonShape(this._startShape); + this._endShape = new HandlePolygonShape(this._endShape); + this.shapeList.push(this._startShape); + this.shapeList.push(this._endShape); + }, + + _bulidMask : function () { + var x = this._calculableLocation.x; + var y = this._calculableLocation.y; + var width = this._calculableLocation.width; + var height = this._calculableLocation.height; + this._startMask = { + zlevel : this._zlevelBase + 1, + style : { + x : x, + y : y, + width : this.dataRangeOption.orient == 'horizontal' + ? 0 : width, + height : this.dataRangeOption.orient == 'horizontal' + ? height : 0, + color : '#ccc' + }, + hoverable:false + }; + this._endMask = { + zlevel : this._zlevelBase + 1, + style : { + x : this.dataRangeOption.orient == 'horizontal' + ? x + width : x, + y : this.dataRangeOption.orient == 'horizontal' + ? y : y + height, + width : this.dataRangeOption.orient == 'horizontal' + ? 0 : width, + height : this.dataRangeOption.orient == 'horizontal' + ? height : 0, + color : '#ccc' + }, + hoverable:false + }; + this._startMask = new RectangleShape(this._startMask); + this._endMask = new RectangleShape(this._endMask); + this.shapeList.push(this._startMask); + this.shapeList.push(this._endMask); + }, + + _buildBackground : function () { + var pTop = this.dataRangeOption.padding[0]; + var pRight = this.dataRangeOption.padding[1]; + var pBottom = this.dataRangeOption.padding[2]; + var pLeft = this.dataRangeOption.padding[3]; + + this.shapeList.push(new RectangleShape({ + zlevel : this._zlevelBase, + hoverable :false, + style : { + x : this._itemGroupLocation.x - pLeft, + y : this._itemGroupLocation.y - pTop, + width : this._itemGroupLocation.width + pLeft + pRight, + height : this._itemGroupLocation.height + pTop + pBottom, + brushType : this.dataRangeOption.borderWidth === 0 + ? 'fill' : 'both', + color : this.dataRangeOption.backgroundColor, + strokeColor : this.dataRangeOption.borderColor, + lineWidth : this.dataRangeOption.borderWidth + } + })); + }, + + /** + * 根据选项计算值域实体的位置坐标 + */ + _getItemGroupLocation : function () { + var data = this._valueTextList; + var dataLength = data.length; + var itemGap = this.dataRangeOption.itemGap; + var itemWidth = this.dataRangeOption.itemWidth; + var itemHeight = this.dataRangeOption.itemHeight; + var totalWidth = 0; + var totalHeight = 0; + var font = this.getFont(this.dataRangeOption.textStyle); + var textHeight = zrArea.getTextHeight('国', font); + + if (this.dataRangeOption.orient == 'horizontal') { + // 水平布局,计算总宽度 + if (this.dataRangeOption.text + || this.dataRangeOption.splitNumber <= 0 + || this.dataRangeOption.calculable + ) { + // 指定文字或线性渐变 + totalWidth = + ((this.dataRangeOption.splitNumber <= 0 + || this.dataRangeOption.calculable) + ? (itemWidth * 10 + itemGap) + : dataLength * (itemWidth + itemGap)) + + (this.dataRangeOption.text + && typeof this.dataRangeOption.text[0] != 'undefined' + ? (zrArea.getTextWidth( + this.dataRangeOption.text[0], + font + ) + this._textGap) + : 0) + + (this.dataRangeOption.text + && typeof this.dataRangeOption.text[1] != 'undefined' + ? (zrArea.getTextWidth( + this.dataRangeOption.text[1], + font + ) + this._textGap) + : 0); + } + else { + // 值标签 + itemWidth += 5; + for (var i = 0; i < dataLength; i++) { + totalWidth += itemWidth + + zrArea.getTextWidth( + data[i], + font + ) + + itemGap; + } + } + totalWidth -= itemGap; // 减去最后一个的itemGap + totalHeight = Math.max(textHeight, itemHeight); + } + else { + // 垂直布局,计算总高度 + var maxWidth; + if (this.dataRangeOption.text + || this.dataRangeOption.splitNumber <= 0 + || this.dataRangeOption.calculable + ) { + // 指定文字或线性渐变 + totalHeight = + ((this.dataRangeOption.splitNumber <= 0 + || this.dataRangeOption.calculable) + ? (itemHeight * 10 + itemGap) + : dataLength * (itemHeight + itemGap)) + + (this.dataRangeOption.text + && typeof this.dataRangeOption.text[0] != 'undefined' + ? (this._textGap + textHeight) + : 0) + + (this.dataRangeOption.text + && typeof this.dataRangeOption.text[1] != 'undefined' + ? (this._textGap + textHeight) + : 0); + + maxWidth = Math.max( + zrArea.getTextWidth( + (this.dataRangeOption.text && this.dataRangeOption.text[0]) + || '', + font + ), + zrArea.getTextWidth( + (this.dataRangeOption.text && this.dataRangeOption.text[1]) + || '', + font + ) + ); + totalWidth = Math.max(itemWidth, maxWidth); + } + else { + totalHeight = (itemHeight + itemGap) * dataLength; + // 值标签 + itemWidth += 5; + maxWidth = 0; + for (var i = 0; i < dataLength; i++) { + maxWidth = Math.max( + maxWidth, + zrArea.getTextWidth( + data[i], + font + ) + ); + } + totalWidth = itemWidth + maxWidth; + } + totalHeight -= itemGap; // 减去最后一个的itemGap; + } + + var x; + var zrWidth = this.zr.getWidth(); + switch (this.dataRangeOption.x) { + case 'center' : + x = Math.floor((zrWidth - totalWidth) / 2); + break; + case 'left' : + x = this.dataRangeOption.padding[3] + + this.dataRangeOption.borderWidth; + break; + case 'right' : + x = zrWidth + - totalWidth + - this.dataRangeOption.padding[1] + - this.dataRangeOption.borderWidth; + break; + default : + x = this.parsePercent(this.dataRangeOption.x, zrWidth); + x = isNaN(x) ? 0 : x; + break; + } + + var y; + var zrHeight = this.zr.getHeight(); + switch (this.dataRangeOption.y) { + case 'top' : + y = this.dataRangeOption.padding[0] + + this.dataRangeOption.borderWidth; + break; + case 'bottom' : + y = zrHeight + - totalHeight + - this.dataRangeOption.padding[2] + - this.dataRangeOption.borderWidth; + break; + case 'center' : + y = Math.floor((zrHeight - totalHeight) / 2); + break; + default : + y = this.parsePercent(this.dataRangeOption.y, zrHeight); + y = isNaN(y) ? 0 : y; + break; + } + + if (this.dataRangeOption.calculable) { + // 留出手柄控件 + var handlerWidth = Math.max( + zrArea.getTextWidth(this.dataRangeOption.max, font), + zrArea.getTextWidth(this.dataRangeOption.min, font) + ) + textHeight; + if (this.dataRangeOption.orient == 'horizontal') { + if (x < handlerWidth) { + x = handlerWidth; + } + if (x + totalWidth + handlerWidth > zrWidth) { + x -= handlerWidth; + } + } + else { + if (y < textHeight) { + y = textHeight; + } + if (y + totalHeight + textHeight > zrHeight) { + y -= textHeight; + } + } + } + + return { + x : x, + y : y, + width : totalWidth, + height : totalHeight + }; + }, + + // 指定文本 + _getTextShape : function (x, y, text) { + return { + zlevel : this._zlevelBase, + style : { + x : (this.dataRangeOption.orient == 'horizontal' + ? x + : this._itemGroupLocation.x + + this._itemGroupLocation.width / 2 + ), + y : (this.dataRangeOption.orient == 'horizontal' + ? this._itemGroupLocation.y + + this._itemGroupLocation.height / 2 + : y + ), + color : this.dataRangeOption.textStyle.color, + text: text, + textFont: this.getFont(this.dataRangeOption.textStyle), + textBaseline: (this.dataRangeOption.orient == 'horizontal' + ? 'middle' : 'top'), + textAlign: (this.dataRangeOption.orient == 'horizontal' + ? 'left' : 'center') + }, + hoverable : false + }; + }, + + // 色尺legend item shape + _getItemShape : function (x, y, width, height, color) { + return { + zlevel : this._zlevelBase, + style : { + x : x, + y : y + 1, + width : width, + height : height - 2, + color : color + }, + highlightStyle: { + strokeColor: color, + lineWidth : 1 + }, + clickable : true + }; + }, + + /** + * 拖拽范围控制 + */ + __ondrift : function (shape, dx, dy) { + var x = this._calculableLocation.x; + var y = this._calculableLocation.y; + var width = this._calculableLocation.width; + var height = this._calculableLocation.height; + + if (this.dataRangeOption.orient == 'horizontal') { + if (shape.style.x + dx <= x) { + shape.style.x = x; + } + else if (shape.style.x + dx + shape.style.width >= x + width) { + shape.style.x = x + width - shape.style.width; + } + else { + shape.style.x += dx; + } + } + else { + if (shape.style.y + dy <= y) { + shape.style.y = y; + } + else if (shape.style.y + dy + shape.style.height >= y + height) { + shape.style.y = y + height - shape.style.height; + } + else { + shape.style.y += dy; + } + } + + if (shape._type == 'filler') { + this._syncHandleShape(); + } + else { + this._syncFillerShape(shape); + } + + if (this.dataRangeOption.realtime) { + this._syncData(); + } + + return true; + }, + + __ondragend : function () { + this.isDragend = true; + }, + + /** + * 数据项被拖拽出去 + */ + ondragend : function (param, status) { + if (!this.isDragend || !param.target) { + // 没有在当前实例上发生拖拽行为则直接返回 + return; + } + + !this.dataRangeOption.realtime && this._syncData(); + + // 别status = {}赋值啊!! + status.dragOut = true; + status.dragIn = true; + + if (!this.dataRangeOption.realtime && false) { + this.messageCenter.dispatch( + ecConfig.EVENT.DATA_RANGE, + null, + { + range : { + start : this._range.end, + end : this._range.start + } + }, + this.myChart + ); + } + + status.needRefresh = false; // 会有消息触发fresh,不用再刷一遍 + // 处理完拖拽事件后复位 + this.isDragend = false; + + return; + }, + + // 外部传入range + _syncShapeFromRange : function () { + var range = this.dataRangeOption.range || {}; + // 做一个反转 + this._range.end = typeof this._range.end != 'undefined' + ? this._range.end + : (typeof range.start != 'undefined' ? range.start : 0); + this._range.start = typeof this._range.start != 'undefined' + ? this._range.start + : (typeof range.end != 'undefined' ? range.end : 100); + + if (this._range.start != 100 || this._range.end !== 0) { + // 非默认满值同步一下图形 + if (this.dataRangeOption.orient == 'horizontal') { + // 横向 + var width = this._fillerShae.style.width; + this._fillerShae.style.x += + width * (100 - this._range.start) / 100; + this._fillerShae.style.width = + width * (this._range.start - this._range.end) / 100; + } + else { + // 纵向 + var height = this._fillerShae.style.height; + this._fillerShae.style.y += + height * (100 - this._range.start) / 100; + this._fillerShae.style.height = + height * (this._range.start - this._range.end) / 100; + } + this.zr.modShape(this._fillerShae.id); + this._syncHandleShape(); + } + }, + + _syncHandleShape : function () { + var x = this._calculableLocation.x; + var y = this._calculableLocation.y; + var width = this._calculableLocation.width; + var height = this._calculableLocation.height; + + if (this.dataRangeOption.orient == 'horizontal') { + this._startShape.style.x = this._fillerShae.style.x; + this._startMask.style.width = this._startShape.style.x - x; + + this._endShape.style.x = this._fillerShae.style.x + + this._fillerShae.style.width; + this._endMask.style.x = this._endShape.style.x; + this._endMask.style.width = x + width - this._endShape.style.x; + + this._range.start = Math.ceil( + 100 - (this._startShape.style.x - x) / width * 100 + ); + this._range.end = Math.floor( + 100 - (this._endShape.style.x - x) / width * 100 + ); + } + else { + this._startShape.style.y = this._fillerShae.style.y; + this._startMask.style.height = this._startShape.style.y - y; + + this._endShape.style.y = this._fillerShae.style.y + + this._fillerShae.style.height; + this._endMask.style.y = this._endShape.style.y; + this._endMask.style.height = y + height - this._endShape.style.y; + + this._range.start = Math.ceil( + 100 - (this._startShape.style.y - y) / height * 100 + ); + this._range.end = Math.floor( + 100 - (this._endShape.style.y - y) / height * 100 + ); + } + + this._syncShape(); + }, + + _syncFillerShape : function (e) { + var x = this._calculableLocation.x; + var y = this._calculableLocation.y; + var width = this._calculableLocation.width; + var height = this._calculableLocation.height; + + var a; + var b; + if (this.dataRangeOption.orient == 'horizontal') { + a = this._startShape.style.x; + b = this._endShape.style.x; + if (e.id == this._startShape.id && a >= b) { + // _startShape触发 + b = a; + this._endShape.style.x = a; + } + else if (e.id == this._endShape.id && a >= b) { + // _endShape触发 + a = b; + this._startShape.style.x = a; + } + this._fillerShae.style.x = a; + this._fillerShae.style.width = b - a; + this._startMask.style.width = a - x; + this._endMask.style.x = b; + this._endMask.style.width = x + width - b; + + this._range.start = Math.ceil(100 - (a - x) / width * 100); + this._range.end = Math.floor(100 - (b - x) / width * 100); + } + else { + a = this._startShape.style.y; + b = this._endShape.style.y; + if (e.id == this._startShape.id && a >= b) { + // _startShape触发 + b = a; + this._endShape.style.y = a; + } + else if (e.id == this._endShape.id && a >= b) { + // _endShape触发 + a = b; + this._startShape.style.y = a; + } + this._fillerShae.style.y = a; + this._fillerShae.style.height = b - a; + this._startMask.style.height = a - y; + this._endMask.style.y = b; + this._endMask.style.height = y + height - b; + + this._range.start = Math.ceil(100 - (a - y) / height * 100); + this._range.end = Math.floor(100 - (b - y) / height * 100); + } + + this._syncShape(); + }, + + _syncShape : function () { + this._startShape.position = [ + this._startShape.style.x - this._startShape.style._x, + this._startShape.style.y - this._startShape.style._y + ]; + + this._startShape.style.text = this._textFormat( + this._gap * this._range.start + this.dataRangeOption.min + ); + + this._startShape.style.color + = this._startShape.highlightStyle.strokeColor + = this.getColor( + this._gap * this._range.start + this.dataRangeOption.min + ); + + this._endShape.position = [ + this._endShape.style.x - this._endShape.style._x, + this._endShape.style.y - this._endShape.style._y + ]; + + this._endShape.style.text = this._textFormat( + this._gap * this._range.end + this.dataRangeOption.min + ); + + this._endShape.style.color + = this._endShape.highlightStyle.strokeColor + = this.getColor( + this._gap * this._range.end + this.dataRangeOption.min + ); + + this.zr.modShape(this._startShape.id); + this.zr.modShape(this._endShape.id); + this.zr.modShape(this._startMask.id); + this.zr.modShape(this._endMask.id); + this.zr.modShape(this._fillerShae.id); + this.zr.refresh(); + }, + + _syncData : function () { + if (this.dataRangeOption.realtime) { + this.messageCenter.dispatch( + ecConfig.EVENT.DATA_RANGE, + null, + { + range : { + start : this._range.end, + end : this._range.start + } + }, + this.myChart + ); + } + }, + + + __dataRangeSelected : function (param) { + var idx = param.target._idx; + this._selectedMap[idx] = !this._selectedMap[idx]; + this.messageCenter.dispatch(ecConfig.EVENT.REFRESH, null, null, this.myChart); + }, + + _textFormat : function(valueStart, valueEnd) { + valueStart = valueStart.toFixed(this.dataRangeOption.precision); + valueEnd = typeof valueEnd != 'undefined' + ? valueEnd.toFixed(this.dataRangeOption.precision) : ''; + if (this.dataRangeOption.formatter) { + if (typeof this.dataRangeOption.formatter == 'string') { + return this.dataRangeOption.formatter.replace('{value}', valueStart) + .replace('{value2}', valueEnd); + } + else if (typeof this.dataRangeOption.formatter == 'function') { + return this.dataRangeOption.formatter.call( + this.myChart, valueStart, valueEnd + ); + } + } + + if (valueEnd !== '') { + return valueStart + ' - ' + valueEnd; + } + + return valueStart; + }, + + /** + * 刷新 + */ + refresh : function (newOption) { + if (newOption) { + this.option = newOption; + this.option.dataRange = this.reformOption(this.option.dataRange); + // 补全padding属性 + this.option.dataRange.padding = this.reformCssArray( + this.option.dataRange.padding + ); + this.dataRangeOption = this.option.dataRange; + + var splitNumber = this.dataRangeOption.splitNumber <= 0 + || this.dataRangeOption.calculable + ? 100 + : this.dataRangeOption.splitNumber; + this._colorList = zrColor.getGradientColors( + this.dataRangeOption.color, + Math.max( + (splitNumber - this.dataRangeOption.color.length) + / (this.dataRangeOption.color.length - 1), + 0 + ) + 1 + ); + + if (this._colorList.length > splitNumber) { + var len = this._colorList.length; + var newColorList = [this._colorList[0]]; + var step = len / (splitNumber - 1); + for (var i = 1; i < splitNumber - 1; i++) { + newColorList.push(this._colorList[Math.floor(i * step)]); + } + newColorList.push(this._colorList[len - 1]); + this._colorList = newColorList; + } + // console.log(this._colorList.length) + + var precision = this.dataRangeOption.precision; + this._gap = (this.dataRangeOption.max - this.dataRangeOption.min) / splitNumber; + while (this._gap.toFixed(precision) - 0 != this._gap && precision < 5) { + // 精度自适应 + precision++; + } + this.dataRangeOption.precision = precision; + + this._gap = ( + (this.dataRangeOption.max - this.dataRangeOption.min) / splitNumber + ).toFixed(precision) - 0; + + this._valueTextList = []; + for (var i = 0; i < splitNumber; i++) { + this._selectedMap[i] = true; + this._valueTextList.unshift( + this._textFormat( + i * this._gap + this.dataRangeOption.min, + (i + 1) * this._gap + this.dataRangeOption.min + ) + ); + } + } + + this.clear(); + this._buildShape(); + }, + + getColor : function (value) { + if (isNaN(value)) { + return null; + } + + if (value < this.dataRangeOption.min) { + value = this.dataRangeOption.min; + } + else if (value > this.dataRangeOption.max) { + value = this.dataRangeOption.max; + } + + if (this.dataRangeOption.calculable) { + if (value - (this._gap * this._range.start + this.dataRangeOption.min) > 0.00005 + || value - (this._gap * this._range.end + this.dataRangeOption.min) < -0.00005) { + return null; + } + } + + var idx = this._colorList.length - Math.ceil( + (value - this.dataRangeOption.min) + / (this.dataRangeOption.max - this.dataRangeOption.min) + * this._colorList.length + ); + if (idx == this._colorList.length) { + idx--; + } + //console.log(value, idx,this._colorList[idx]) + if (this._selectedMap[idx]) { + return this._colorList[idx]; + } + else { + return null; + } + } + }; + + zrUtil.inherits(DataRange, Base); + + require('../component').define('dataRange', DataRange); + + return DataRange; +}); + + + +/** + * echarts图表类:散点图 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/chart/scatter',['require','../component/base','./base','../util/shape/Symbol','../component/axis','../component/grid','../component/dataZoom','../component/dataRange','../config','zrender/tool/util','zrender/tool/color','../chart'],function (require) { + var ComponentBase = require('../component/base'); + var ChartBase = require('./base'); + + // 图形依赖 + var SymbolShape = require('../util/shape/Symbol'); + // 组件依赖 + require('../component/axis'); + require('../component/grid'); + require('../component/dataZoom'); + require('../component/dataRange'); + + var ecConfig = require('../config'); + var zrUtil = require('zrender/tool/util'); + var zrColor = require('zrender/tool/color'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} series 数据 + * @param {Object} component 组件 + */ + function Scatter(ecTheme, messageCenter, zr, option, myChart){ + // 基类 + ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); + // 图表基类 + ChartBase.call(this); + + this.refresh(option); + } + + Scatter.prototype = { + type: ecConfig.CHART_TYPE_SCATTER, + /** + * 绘制图形 + */ + _buildShape: function () { + var series = this.series; + this._sIndex2ColorMap = {}; // series默认颜色索引,seriesIndex索引到color + this._symbol = this.option.symbolList; + this._sIndex2ShapeMap = {}; // series图形类型,seriesIndex索引到_symbol + + this.selectedMap = {}; + this.xMarkMap = {}; + + var legend = this.component.legend; + var seriesArray = []; + var serie; // 临时映射变量 + var serieName; // 临时映射变量 + var iconShape; + var iconType; + for (var i = 0, l = series.length; i < l; i++) { + serie = series[i]; + serieName = serie.name; + if (serie.type === ecConfig.CHART_TYPE_SCATTER) { + series[i] = this.reformOption(series[i]); + this._sIndex2ShapeMap[i] = this.query(serie, 'symbol') + || this._symbol[i % this._symbol.length]; + if (legend){ + this.selectedMap[serieName] = legend.isSelected(serieName); + + this._sIndex2ColorMap[i] = zrColor.alpha(legend.getColor(serieName), 0.5); + + iconShape = legend.getItemShape(serieName); + if (iconShape) { + // 回调legend,换一个更形象的icon + var iconType = this._sIndex2ShapeMap[i]; + iconShape.style.brushType = iconType.match('empty') ? 'stroke' : 'both'; + iconType = iconType.replace('empty', '').toLowerCase(); + + if (iconType.match('rectangle')) { + iconShape.style.x += Math.round( + (iconShape.style.width - iconShape.style.height) / 2 + ); + iconShape.style.width = iconShape.style.height; + } + + if (iconType.match('star')) { + iconShape.style.n = (iconType.replace('star','') - 0) || 5; + iconType = 'star'; + } + + if (iconType.match('image')) { + iconShape.style.image = iconType.replace( + new RegExp('^image:\\/\\/'), '' + ); + iconShape.style.x += Math.round( + (iconShape.style.width - iconShape.style.height) / 2 + ); + iconShape.style.width = iconShape.style.height; + iconType = 'image'; + } + + iconShape.style.iconType = iconType; + legend.setItemShape(serieName, iconShape); + } + } + else { + this.selectedMap[serieName] = true; + this._sIndex2ColorMap[i] = this.zr.getColor(i); + } + + if (this.selectedMap[serieName]) { + seriesArray.push(i); + } + } + } + + this._buildSeries(seriesArray); + + this.addShapeList(); + }, + + /** + * 构建类目轴为水平方向的散点图系列 + */ + _buildSeries: function (seriesArray) { + if (seriesArray.length === 0) { + return; + } + var series = this.series; + var seriesIndex; + var serie; + var data; + var value; + var xAxis; + var yAxis; + + var pointList = {}; + var x; + var y; + for (var j = 0, k = seriesArray.length; j < k; j++) { + seriesIndex = seriesArray[j]; + serie = series[seriesIndex]; + if (serie.data.length === 0) { + continue; + } + + xAxis = this.component.xAxis.getAxis(serie.xAxisIndex || 0); + yAxis = this.component.yAxis.getAxis(serie.yAxisIndex || 0); + + pointList[seriesIndex] = []; + for (var i = 0, l = serie.data.length; i < l; i++) { + data = serie.data[i]; + value = data != null + ? (data.value != null + ? data.value + : data) + : '-'; + if (value === '-' || value.length < 2) { + // 数据格式不符 + continue; + } + x = xAxis.getCoord(value[0]); + y = yAxis.getCoord(value[1]); + pointList[seriesIndex].push([ + x, // 横坐标 + y, // 纵坐标 + i, // 数据index + data.name || '' // 名称 + ]); + + } + this.xMarkMap[seriesIndex] = this._markMap( + xAxis, yAxis, serie.data, pointList[seriesIndex] + ); + this.buildMark(seriesIndex); + } + + // console.log(pointList) + this._buildPointList(pointList); + }, + + _markMap: function (xAxis, yAxis, data, pointList) { + var xMarkMap = { + min0: Number.POSITIVE_INFINITY, + max0: Number.NEGATIVE_INFINITY, + sum0: 0, + counter0: 0, + average0: 0, + min1: Number.POSITIVE_INFINITY, + max1: Number.NEGATIVE_INFINITY, + sum1: 0, + counter1: 0, + average1: 0 + }; + var value; + for (var i = 0, l = pointList.length; i < l; i++) { + /** + x, // 横坐标 + y, // 纵坐标 + i, // 数据index + data.name || '' // 名称 + */ + value = data[pointList[i][2]].value || data[pointList[i][2]]; + // 横轴 + if (xMarkMap.min0 > value[0]) { + xMarkMap.min0 = value[0]; + xMarkMap.minY0 = pointList[i][1]; + xMarkMap.minX0 = pointList[i][0]; + } + if (xMarkMap.max0 < value[0]) { + xMarkMap.max0 = value[0]; + xMarkMap.maxY0 = pointList[i][1]; + xMarkMap.maxX0 = pointList[i][0]; + } + xMarkMap.sum0 += value[0]; + xMarkMap.counter0++; + + // 纵轴 + if (xMarkMap.min1 > value[1]) { + xMarkMap.min1 = value[1]; + xMarkMap.minY1 = pointList[i][1]; + xMarkMap.minX1 = pointList[i][0]; + } + if (xMarkMap.max1 < value[1]) { + xMarkMap.max1 = value[1]; + xMarkMap.maxY1 = pointList[i][1]; + xMarkMap.maxX1 = pointList[i][0]; + } + xMarkMap.sum1 += value[1]; + xMarkMap.counter1++; + } + + var gridX = this.component.grid.getX(); + var gridXend = this.component.grid.getXend(); + var gridY = this.component.grid.getY(); + var gridYend = this.component.grid.getYend(); + + xMarkMap.average0 = (xMarkMap.sum0 / xMarkMap.counter0).toFixed(2) - 0; + var x = xAxis.getCoord(xMarkMap.average0); + // 横轴平均纵向 + xMarkMap.averageLine0 = [ + [x, gridYend], + [x, gridY] + ]; + xMarkMap.minLine0 = [ + [xMarkMap.minX0, gridYend], + [xMarkMap.minX0, gridY] + ]; + xMarkMap.maxLine0 = [ + [xMarkMap.maxX0, gridYend], + [xMarkMap.maxX0, gridY] + ]; + + xMarkMap.average1 = (xMarkMap.sum1 / xMarkMap.counter1).toFixed(2) - 0; + var y = yAxis.getCoord(xMarkMap.average1); + // 纵轴平均横向 + xMarkMap.averageLine1 = [ + [gridX, y], + [gridXend, y] + ]; + xMarkMap.minLine1 = [ + [gridX, xMarkMap.minY1], + [gridXend, xMarkMap.minY1] + ]; + xMarkMap.maxLine1 = [ + [gridX, xMarkMap.maxY1], + [gridXend, xMarkMap.maxY1] + ]; + + return xMarkMap; + }, + + /** + * 生成折线和折线上的拐点 + */ + _buildPointList: function (pointList) { + var series = this.series; + var serie; + var seriesPL; + var singlePoint; + var shape; + for (var seriesIndex in pointList) { + serie = series[seriesIndex]; + seriesPL = pointList[seriesIndex]; + if (serie.large && serie.data.length > serie.largeThreshold) { + this.shapeList.push(this._getLargeSymbol( + seriesPL, + this.getItemStyleColor( + this.query( + serie, 'itemStyle.normal.color' + ), + seriesIndex, + -1 + ) || this._sIndex2ColorMap[seriesIndex] + )); + continue; + } + + /* + * pointlist=[ + * 0 x, + * 1 y, + * 2 数据index + * 3 名称 + * ] + */ + + for (var i = 0, l = seriesPL.length; i < l; i++) { + singlePoint = seriesPL[i]; + shape = this._getSymbol( + seriesIndex, // seriesIndex + singlePoint[2], // dataIndex + singlePoint[3], // name + singlePoint[0], // x + singlePoint[1] // y + ); + shape && this.shapeList.push(shape); + } + } + // console.log(this.shapeList) + }, + + /** + * 生成折线图上的拐点图形 + */ + _getSymbol: function (seriesIndex, dataIndex, name, x, y) { + var series = this.series; + var serie = series[seriesIndex]; + var data = serie.data[dataIndex]; + + var dataRange = this.component.dataRange; + var rangColor; + if (dataRange) { + rangColor = isNaN(data[2]) + ? this._sIndex2ColorMap[seriesIndex] + : dataRange.getColor(data[2]); + if (!rangColor) { + return null; + } + } + else { + rangColor = this._sIndex2ColorMap[seriesIndex]; + } + + var itemShape = this.getSymbolShape( + serie, seriesIndex, data, dataIndex, name, + x, y, + this._sIndex2ShapeMap[seriesIndex], + rangColor, + 'rgba(0,0,0,0)', + 'vertical' + ); + itemShape.zlevel = this._zlevelBase; + itemShape._main = true; + return itemShape; + }, + + _getLargeSymbol: function (pointList, nColor) { + return new SymbolShape({ + zlevel: this._zlevelBase, + _main: true, + hoverable: false, + style: { + pointList: pointList, + color: nColor, + strokeColor: nColor + }, + highlightStyle: { + pointList: [ ] + } + }); + }, + + // 位置转换 + getMarkCoord: function (seriesIndex, mpData) { + var serie = this.series[seriesIndex]; + var xMarkMap = this.xMarkMap[seriesIndex]; + var xAxis = this.component.xAxis.getAxis(serie.xAxisIndex); + var yAxis = this.component.yAxis.getAxis(serie.yAxisIndex); + var pos; + + if (mpData.type + && (mpData.type === 'max' || mpData.type === 'min' || mpData.type === 'average') + ) { + // 特殊值内置支持 + // 默认取纵值 + var valueIndex = mpData.valueIndex != null ? mpData.valueIndex : 1; + pos = [ + xMarkMap[mpData.type + 'X' + valueIndex], + xMarkMap[mpData.type + 'Y' + valueIndex], + xMarkMap[mpData.type + 'Line' + valueIndex], + xMarkMap[mpData.type + valueIndex] + ]; + } + else { + pos = [ + typeof mpData.xAxis != 'string' && xAxis.getCoordByIndex + ? xAxis.getCoordByIndex(mpData.xAxis || 0) + : xAxis.getCoord(mpData.xAxis || 0), + + typeof mpData.yAxis != 'string' && yAxis.getCoordByIndex + ? yAxis.getCoordByIndex(mpData.yAxis || 0) + : yAxis.getCoord(mpData.yAxis || 0) + ]; + } + + return pos; + }, + + /** + * 刷新 + */ + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + + this.backupShapeList(); + this._buildShape(); + }, + + /** + * 值域响应 + * @param {Object} param + * @param {Object} status + */ + ondataRange: function (param, status) { + if (this.component.dataRange) { + this.refresh(); + status.needRefresh = true; + } + return; + } + }; + + zrUtil.inherits(Scatter, ChartBase); + zrUtil.inherits(Scatter, ComponentBase); + + // 图表注册 + require('../chart').define('scatter', Scatter); + + return Scatter; +}); +/** + * echarts图表类:K线图 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/chart/k',['require','../component/base','./base','../util/shape/Candle','../component/axis','../component/grid','../component/dataZoom','../config','../util/ecData','zrender/tool/util','../chart'],function (require) { + var ComponentBase = require('../component/base'); + var ChartBase = require('./base'); + + // 图形依赖 + var CandleShape = require('../util/shape/Candle'); + // 组件依赖 + require('../component/axis'); + require('../component/grid'); + require('../component/dataZoom'); + + var ecConfig = require('../config'); + var ecData = require('../util/ecData'); + var zrUtil = require('zrender/tool/util'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} series 数据 + * @param {Object} component 组件 + */ + function K(ecTheme, messageCenter, zr, option, myChart){ + // 基类 + ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); + // 图表基类 + ChartBase.call(this); + + this.refresh(option); + } + + K.prototype = { + type: ecConfig.CHART_TYPE_K, + /** + * 绘制图形 + */ + _buildShape: function () { + var series = this.series; + this.selectedMap = {}; + + // 水平垂直双向series索引 ,position索引到seriesIndex + var _position2sIndexMap = { + top: [ ], + bottom: [ ] + }; + var xAxis; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type === ecConfig.CHART_TYPE_K) { + series[i] = this.reformOption(series[i]); + xAxis = this.component.xAxis.getAxis(series[i].xAxisIndex); + if (xAxis.type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + ) { + _position2sIndexMap[xAxis.getPosition()].push(i); + } + } + } + //console.log(_position2sIndexMap) + for (var position in _position2sIndexMap) { + if (_position2sIndexMap[position].length > 0) { + this._buildSinglePosition( + position, _position2sIndexMap[position] + ); + } + } + + this.addShapeList(); + }, + + /** + * 构建单个方向上的K线图 + * + * @param {number} seriesIndex 系列索引 + */ + _buildSinglePosition: function (position, seriesArray) { + var mapData = this._mapData(seriesArray); + var locationMap = mapData.locationMap; + var maxDataLength = mapData.maxDataLength; + + if (maxDataLength === 0 || locationMap.length === 0) { + return; + } + this._buildHorizontal(seriesArray, maxDataLength, locationMap); + + for (var i = 0, l = seriesArray.length; i < l; i++) { + this.buildMark(seriesArray[i]); + } + }, + + /** + * 数据整形 + * 数组位置映射到系列索引 + */ + _mapData: function (seriesArray) { + var series = this.series; + var serie; // 临时映射变量 + var serieName; // 临时映射变量 + var legend = this.component.legend; + var locationMap = []; // 需要返回的东西:数组位置映射到系列索引 + var maxDataLength = 0; // 需要返回的东西:最大数据长度 + // 计算需要显示的个数和分配位置并记在下面这个结构里 + for (var i = 0, l = seriesArray.length; i < l; i++) { + serie = series[seriesArray[i]]; + serieName = serie.name; + if (legend){ + this.selectedMap[serieName] = legend.isSelected(serieName); + } else { + this.selectedMap[serieName] = true; + } + + if (this.selectedMap[serieName]) { + locationMap.push(seriesArray[i]); + } + // 兼职帮算一下最大长度 + maxDataLength = Math.max(maxDataLength, serie.data.length); + } + return { + locationMap: locationMap, + maxDataLength: maxDataLength + }; + }, + + /** + * 构建类目轴为水平方向的K线图系列 + */ + _buildHorizontal: function (seriesArray, maxDataLength, locationMap) { + var series = this.series; + // 确定类目轴和数值轴,同一方向随便找一个即可 + var seriesIndex; + var serie; + var xAxisIndex; + var categoryAxis; + var yAxisIndex; // 数值轴各异 + var valueAxis; // 数值轴各异 + + var pointList = {}; + var candleWidth; + var data; + var value; + var barMaxWidth; + for (var j = 0, k = locationMap.length; j < k; j++) { + seriesIndex = locationMap[j]; + serie = series[seriesIndex]; + + xAxisIndex = serie.xAxisIndex || 0; + categoryAxis = this.component.xAxis.getAxis(xAxisIndex); + candleWidth = serie.barWidth + || Math.floor(categoryAxis.getGap() / 2); + barMaxWidth = serie.barMaxWidth; + if (barMaxWidth && barMaxWidth < candleWidth) { + candleWidth = barMaxWidth; + } + yAxisIndex = serie.yAxisIndex || 0; + valueAxis = this.component.yAxis.getAxis(yAxisIndex); + + pointList[seriesIndex] = []; + for (var i = 0, l = maxDataLength; i < l; i++) { + if (categoryAxis.getNameByIndex(i) == null) { + // 系列数据超出类目轴长度 + break; + } + + data = serie.data[i]; + value = data != null + ? (data.value != null + ? data.value + : data) + : '-'; + if (value === '-' || value.length != 4) { + // 数据格式不符 + continue; + } + pointList[seriesIndex].push([ + categoryAxis.getCoordByIndex(i), // 横坐标 + candleWidth, + valueAxis.getCoord(value[0]), // 纵坐标:开盘 + valueAxis.getCoord(value[1]), // 纵坐标:收盘 + valueAxis.getCoord(value[2]), // 纵坐标:最低 + valueAxis.getCoord(value[3]), // 纵坐标:最高 + i, // 数据index + categoryAxis.getNameByIndex(i) // 类目名称 + ]); + } + } + // console.log(pointList) + this._buildKLine(seriesArray, pointList); + }, + + /** + * 生成K线 + */ + _buildKLine: function (seriesArray, pointList) { + var series = this.series; + // normal: + var nLineWidth; + var nLineColor; + var nLineColor0; // 阴线 + var nColor; + var nColor0; // 阴线 + + // emphasis: + var eLineWidth; + var eLineColor; + var eLineColor0; + var eColor; + var eColor0; + + var serie; + var queryTarget; + var data; + var seriesPL; + var singlePoint; + var candleType; + + var seriesIndex; + for (var sIdx = 0, len = seriesArray.length; sIdx < len; sIdx++) { + seriesIndex = seriesArray[sIdx]; + serie = series[seriesIndex]; + seriesPL = pointList[seriesIndex]; + + if (this._isLarge(seriesPL)) { + seriesPL = this._getLargePointList(seriesPL); + } + + if (serie.type === ecConfig.CHART_TYPE_K && seriesPL != null) { + // 多级控制 + queryTarget = serie; + nLineWidth = this.query( + queryTarget, 'itemStyle.normal.lineStyle.width' + ); + nLineColor = this.query( + queryTarget, 'itemStyle.normal.lineStyle.color' + ); + nLineColor0 = this.query( + queryTarget, 'itemStyle.normal.lineStyle.color0' + ); + nColor = this.query( + queryTarget, 'itemStyle.normal.color' + ); + nColor0 = this.query( + queryTarget, 'itemStyle.normal.color0' + ); + + eLineWidth = this.query( + queryTarget, 'itemStyle.emphasis.lineStyle.width' + ); + eLineColor = this.query( + queryTarget, 'itemStyle.emphasis.lineStyle.color' + ); + eLineColor0 = this.query( + queryTarget, 'itemStyle.emphasis.lineStyle.color0' + ); + eColor = this.query( + queryTarget, 'itemStyle.emphasis.color' + ); + eColor0 = this.query( + queryTarget, 'itemStyle.emphasis.color0' + ); + + /* + * pointlist=[ + * 0 x, + * 1 width, + * 2 y0, + * 3 y1, + * 4 y2, + * 5 y3, + * 6 dataIndex, + * 7 categoryName + * ] + */ + for (var i = 0, l = seriesPL.length; i < l; i++) { + singlePoint = seriesPL[i]; + data = serie.data[singlePoint[6]]; + queryTarget = data; + candleType = singlePoint[3] < singlePoint[2]; + this.shapeList.push(this._getCandle( + seriesIndex, // seriesIndex + singlePoint[6], // dataIndex + singlePoint[7], // name + + singlePoint[0], // x + singlePoint[1], // width + singlePoint[2], // y开盘 + singlePoint[3], // y收盘 + singlePoint[4], // y最低 + singlePoint[5], // y最高 + + // 填充颜色 + candleType + ? (this.query( // 阳 + queryTarget, 'itemStyle.normal.color' + ) || nColor) + : (this.query( // 阴 + queryTarget, 'itemStyle.normal.color0' + ) || nColor0), + + // 线宽 + this.query( + queryTarget, 'itemStyle.normal.lineStyle.width' + ) || nLineWidth, + + // 线色 + candleType + ? (this.query( // 阳 + queryTarget, + 'itemStyle.normal.lineStyle.color' + ) || nLineColor) + : (this.query( // 阴 + queryTarget, + 'itemStyle.normal.lineStyle.color0' + ) || nLineColor0), + + //------------高亮 + + // 填充颜色 + candleType + ? (this.query( // 阳 + queryTarget, 'itemStyle.emphasis.color' + ) || eColor || nColor) + : (this.query( // 阴 + queryTarget, 'itemStyle.emphasis.color0' + ) || eColor0 || nColor0), + + // 线宽 + this.query( + queryTarget, 'itemStyle.emphasis.lineStyle.width' + ) || eLineWidth || nLineWidth, + + // 线色 + candleType + ? (this.query( // 阳 + queryTarget, + 'itemStyle.emphasis.lineStyle.color' + ) || eLineColor || nLineColor) + : (this.query( // 阴 + queryTarget, + 'itemStyle.emphasis.lineStyle.color0' + ) || eLineColor0 || nLineColor0) + )); + } + } + } + // console.log(this.shapeList) + }, + + _isLarge: function(singlePL) { + return singlePL[0][1] < 0.5; + }, + + /** + * 大规模pointList优化 + */ + _getLargePointList: function(singlePL) { + var total = this.component.grid.getWidth(); + var len = singlePL.length; + var newList = []; + for (var i = 0; i < total; i++) { + newList[i] = singlePL[Math.floor(len / total * i)]; + } + return newList; + }, + + /** + * 生成K线图上的图形 + */ + _getCandle: function ( + seriesIndex, dataIndex, name, + x, width, y0, y1, y2, y3, + nColor, nLinewidth, nLineColor, + eColor, eLinewidth, eLineColor + ) { + var series = this.series; + var itemShape = { + zlevel: this._zlevelBase, + clickable: this.deepQuery( + [series[seriesIndex].data[dataIndex], series[seriesIndex]], 'clickable' + ), + style: { + x: x, + y: [y0, y1, y2, y3], + width: width, + color: nColor, + strokeColor: nLineColor, + lineWidth: nLinewidth, + brushType: 'both' + }, + highlightStyle: { + color: eColor, + strokeColor: eLineColor, + lineWidth: eLinewidth + }, + _seriesIndex: seriesIndex + }; + ecData.pack( + itemShape, + series[seriesIndex], seriesIndex, + series[seriesIndex].data[dataIndex], dataIndex, + name + ); + + itemShape = new CandleShape(itemShape); + return itemShape; + }, + + // 位置转换 + getMarkCoord: function (seriesIndex, mpData) { + var serie = this.series[seriesIndex]; + var xAxis = this.component.xAxis.getAxis(serie.xAxisIndex); + var yAxis = this.component.yAxis.getAxis(serie.yAxisIndex); + + return [ + typeof mpData.xAxis != 'string' && xAxis.getCoordByIndex + ? xAxis.getCoordByIndex(mpData.xAxis || 0) + : xAxis.getCoord(mpData.xAxis || 0), + + typeof mpData.yAxis != 'string' && yAxis.getCoordByIndex + ? yAxis.getCoordByIndex(mpData.yAxis || 0) + : yAxis.getCoord(mpData.yAxis || 0) + ]; + }, + + /** + * 刷新 + */ + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + + this.backupShapeList(); + this._buildShape(); + }, + + /** + * 动画设定 + */ + addDataAnimation: function (params) { + var series = this.series; + var aniMap = {}; // seriesIndex索引参数 + for (var i = 0, l = params.length; i < l; i++) { + aniMap[params[i][0]] = params[i]; + } + var x; + var dx; + var y; + var serie; + var seriesIndex; + var dataIndex; + for (var i = 0, l = this.shapeList.length; i < l; i++) { + seriesIndex = this.shapeList[i]._seriesIndex; + if (aniMap[seriesIndex] && !aniMap[seriesIndex][3]) { + // 有数据删除才有移动的动画 + if (this.shapeList[i].type === 'candle') { + dataIndex = ecData.get(this.shapeList[i], 'dataIndex'); + serie = series[seriesIndex]; + if (aniMap[seriesIndex][2] + && dataIndex === serie.data.length - 1 + ) { + // 队头加入删除末尾 + this.zr.delShape(this.shapeList[i].id); + continue; + } + else if (!aniMap[seriesIndex][2] && dataIndex === 0) { + // 队尾加入删除头部 + this.zr.delShape(this.shapeList[i].id); + continue; + } + dx = this.component.xAxis.getAxis( + serie.xAxisIndex || 0 + ).getGap(); + x = aniMap[seriesIndex][2] ? dx : -dx; + y = 0; + this.zr.animate(this.shapeList[i].id, '') + .when( + 500, + { position: [ x, y ] } + ) + .start(); + } + } + } + } + }; + + zrUtil.inherits(K, ChartBase); + zrUtil.inherits(K, ComponentBase); + + // 图表注册 + require('../chart').define('k', K); + + return K; +}); +/** + * echarts坐标处理方法 + * + * @author Neil (杨骥, yangji01@baidu.com) + */ + +define( + 'echarts/util/coordinates',['require','zrender/tool/math'],function (require) { + var zrMath = require('zrender/tool/math'); + + /** + * 极坐标转直角坐标 + * + * @param {number} 半径 + * @param {number} 角度 + * + * @return {Array.} 直角坐标[x,y] + */ + function polar2cartesian(r, theta) { + return [r * zrMath.sin(theta), r*zrMath.cos(theta)]; + } + + /** + * 直角坐标转极坐标 + * + * @param {number} 横坐标 + * @param {number} 纵坐标 + * + * @return {Array.} 极坐标[r,theta] + */ + function cartesian2polar(x, y) { + return [Math.sqrt(x * x + y * y), Math.atan(y / x)]; + } + + return { + polar2cartesian : polar2cartesian, + cartesian2polar : cartesian2polar + }; + } ); -/** - * 地图参数 - * key为地图类型: { - * getGeoJson: 地图数据加载 - * } - */ -define('echarts/util/mapData/params',['require'],function (require) { - function decode(json) { - if (!json.UTF8Encoding) { - return json; - } - var features = json.features; - - for (var f = 0; f < features.length; f++) { - var feature = features[f]; - var coordinates = feature.geometry.coordinates; - var encodeOffsets = feature.geometry.encodeOffsets; - - for (var c = 0; c < coordinates.length; c++) { - var coordinate = coordinates[c]; - - if (feature.geometry.type === 'Polygon') { - coordinates[c] = decodePolygon( - coordinate, - encodeOffsets[c] - ); - } else if (feature.geometry.type === 'MultiPolygon') { - for (var c2 = 0; c2 < coordinate.length; c2++) { - var polygon = coordinate[c2]; - coordinate[c2] = decodePolygon( - polygon, - encodeOffsets[c][c2] - ); - } - } - } - } - // Has been decoded - json.UTF8Encoding = false; - return json; - } - - function decodePolygon(coordinate, encodeOffsets) { - var result = []; - var prevX = encodeOffsets[0]; - var prevY = encodeOffsets[1]; - - for (var i = 0; i < coordinate.length; i+=2) { - var x = coordinate.charCodeAt(i) - 64; - var y = coordinate.charCodeAt(i+1) - 64; - // ZigZag decoding - x = (x >> 1) ^ (-(x & 1)); - y = (y >> 1) ^ (-(y & 1)); - // Delta deocding - x += prevX; - y += prevY; - - prevX = x; - prevY = y; - // Dequantize - result.push([x / 1024, y / 1024]); - } - - return result; - } - - var mapParams = { - 'world': { - getGeoJson: function (callback) { - require(['./geoJson/world_geo'], function (md){ - callback(decode(md)); - }); - } - }, - 'china': { - getGeoJson: function (callback) { - require(['./geoJson/china_geo'], function (md){ - callback(decode(md)); - }); - } - }, - '南海诸岛' : { - textCoord : [126, 25], - getPath : function (leftTop, scale) { - // scale.x : width = 10.51 : 64 - var pList = [ - [ - [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] - ] - ]; - var str = ''; - var left = leftTop[0]; - var top = leftTop[1]; - for (var i = 0, l = pList.length; i < l; i++) { - str += 'M ' - + ((pList[i][0][0] * scale+ left).toFixed(2) - 0) - + ' ' - + ((pList[i][0][1] * scale + top).toFixed(2) - 0) - + ' '; - for (var j = 1, k = pList[i].length; j < k; j++) { - str += 'L ' - + ((pList[i][j][0] * scale + left).toFixed(2) - 0) - + ' ' - + ((pList[i][j][1] * scale + top).toFixed(2) - 0) - + ' '; - } - } - return str + ' Z'; - } - }, - '新疆': { - getGeoJson: function (callback) { - require(['./geoJson/xin_jiang_geo'], function (md){ - callback(decode(md)); - }); - } - }, - '西藏': { - getGeoJson: function (callback) { - require(['./geoJson/xi_zang_geo'], function (md){ - callback(decode(md)); - }); - } - }, - '内蒙古': { - getGeoJson: function (callback) { - require(['./geoJson/nei_meng_gu_geo'], function (md){ - callback(decode(md)); - }); - } - }, - '青海': { - getGeoJson: function (callback) { - require(['./geoJson/qing_hai_geo'], function (md){ - callback(decode(md)); - }); - } - }, - '四川': { - getGeoJson: function (callback) { - require(['./geoJson/si_chuan_geo'], function (md){ - callback(decode(md)); - }); - } - }, - '黑龙江': { - getGeoJson: function (callback) { - require(['./geoJson/hei_long_jiang_geo'], function (md){ - callback(decode(md)); - }); - } - }, - '甘肃': { - getGeoJson: function (callback) { - require(['./geoJson/gan_su_geo'], function (md){ - callback(decode(md)); - }); - } - }, - '云南': { - getGeoJson: function (callback) { - require(['./geoJson/yun_nan_geo'], function (md){ - callback(decode(md)); - }); - } - }, - '广西': { - getGeoJson: function (callback) { - require(['./geoJson/guang_xi_geo'], function (md){ - callback(decode(md)); - }); - } - }, - '湖南': { - getGeoJson: function (callback) { - require(['./geoJson/hu_nan_geo'], function (md){ - callback(decode(md)); - }); - } - }, - '陕西': { - getGeoJson: function (callback) { - require(['./geoJson/shan_xi_1_geo'], function (md){ - callback(decode(md)); - }); - } - }, - '广东': { - getGeoJson: function (callback) { - require(['./geoJson/guang_dong_geo'], function (md){ - callback(decode(md)); - }); - } - }, - '吉林': { - getGeoJson: function (callback) { - require(['./geoJson/ji_lin_geo'], function (md){ - callback(decode(md)); - }); - } - }, - '河北': { - getGeoJson: function (callback) { - require(['./geoJson/he_bei_geo'], function (md){ - callback(decode(md)); - }); - } - }, - '湖北': { - getGeoJson: function (callback) { - require(['./geoJson/hu_bei_geo'], function (md){ - callback(decode(md)); - }); - } - }, - '贵州': { - getGeoJson: function (callback) { - require(['./geoJson/gui_zhou_geo'], function (md){ - callback(decode(md)); - }); - } - }, - '山东': { - getGeoJson: function (callback) { - require(['./geoJson/shan_dong_geo'], function (md){ - callback(decode(md)); - }); - } - }, - '江西': { - getGeoJson: function (callback) { - require(['./geoJson/jiang_xi_geo'], function (md){ - callback(decode(md)); - }); - } - }, - '河南': { - getGeoJson: function (callback) { - require(['./geoJson/he_nan_geo'], function (md){ - callback(decode(md)); - }); - } - }, - '辽宁': { - getGeoJson: function (callback) { - require(['./geoJson/liao_ning_geo'], function (md){ - callback(decode(md)); - }); - } - }, - '山西': { - getGeoJson: function (callback) { - require(['./geoJson/shan_xi_2_geo'], function (md){ - callback(decode(md)); - }); - } - }, - '安徽': { - getGeoJson: function (callback) { - require(['./geoJson/an_hui_geo'], function (md){ - callback(decode(md)); - }); - } - }, - '福建': { - getGeoJson: function (callback) { - require(['./geoJson/fu_jian_geo'], function (md){ - callback(decode(md)); - }); - } - }, - '浙江': { - getGeoJson: function (callback) { - require(['./geoJson/zhe_jiang_geo'], function (md){ - callback(decode(md)); - }); - } - }, - '江苏': { - getGeoJson: function (callback) { - require(['./geoJson/jiang_su_geo'], function (md){ - callback(decode(md)); - }); - } - }, - '重庆': { - getGeoJson: function (callback) { - require(['./geoJson/chong_qing_geo'], function (md){ - callback(decode(md)); - }); - } - }, - '宁夏': { - getGeoJson: function (callback) { - require(['./geoJson/ning_xia_geo'], function (md){ - callback(decode(md)); - }); - } - }, - '海南': { - getGeoJson: function (callback) { - require(['./geoJson/hai_nan_geo'], function (md){ - callback(decode(md)); - }); - } - }, - '台湾': { - getGeoJson: function (callback) { - require(['./geoJson/tai_wan_geo'], function (md){ - callback(decode(md)); - }); - } - }, - '北京': { - getGeoJson: function (callback) { - require(['./geoJson/bei_jing_geo'], function (md){ - callback(decode(md)); - }); - } - }, - '天津': { - getGeoJson: function (callback) { - require(['./geoJson/tian_jin_geo'], function (md){ - callback(decode(md)); - }); - } - }, - '上海': { - getGeoJson: function (callback) { - require(['./geoJson/shang_hai_geo'], function (md){ - callback(decode(md)); - }); - } - }, - '香港': { - getGeoJson: function (callback) { - require(['./geoJson/xiang_gang_geo'], function (md){ - callback(decode(md)); - }); - } - }, - '澳门': { - getGeoJson: function (callback) { - require(['./geoJson/ao_men_geo'], function (md){ - callback(decode(md)); - }); - } - } - }; - - return { - decode : decode, - params : mapParams - }; +/** + * echarts组件类:极坐标 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Neil (杨骥, yangji01@baidu.com) + * + */ +define('echarts/component/polar',['require','./base','zrender/shape/Text','zrender/shape/Line','zrender/shape/Polygon','zrender/shape/Circle','zrender/shape/Ring','../config','zrender/tool/util','../util/coordinates','../component'],function (require) { + var Base = require('./base'); + + // 图形依赖 + var TextShape = require('zrender/shape/Text'); + var LineShape = require('zrender/shape/Line'); + var PolygonShape = require('zrender/shape/Polygon'); + var Circle = require('zrender/shape/Circle'); + var Ring = require('zrender/shape/Ring'); + + var ecConfig = require('../config'); + var zrUtil = require('zrender/tool/util'); + var ecCoordinates = require('../util/coordinates'); + + function Polar(ecTheme, messageCenter, zr, option, myChart) { + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + + this.refresh(option); + } + + Polar.prototype = { + type : ecConfig.COMPONENT_TYPE_POLAR, + + /** + * 绘制图形 + */ + _buildShape : function () { + for (var i = 0; i < this.polar.length; i ++) { + this._index = i; + this.reformOption(this.polar[i]); + + this._queryTarget = [this.polar[i], this.option]; + this._createVector(i); + this._buildSpiderWeb(i); + + this._buildText(i); + + this._adjustIndicatorValue(i); + this._addAxisLabel(i); + } + + for (var i = 0; i < this.shapeList.length; i ++) { + this.zr.addShape(this.shapeList[i]); + } + }, + + /** + * 生成蜘蛛网顶点坐标 + * @param {number} polar的index + */ + _createVector : function (index) { + var item = this.polar[index]; + var indicator = this.deepQuery(this._queryTarget, 'indicator'); + var length = indicator.length; + var startAngle = item.startAngle ; + var dStep = 2 * Math.PI / length; + var radius = this._getRadius(); + var __ecIndicator = item.__ecIndicator = []; + var vector; + + for (var i = 0 ;i < length ; i ++) { + vector = ecCoordinates.polar2cartesian( + radius, startAngle * Math.PI / 180 + dStep * i + ); + __ecIndicator.push({ + // 将图形翻转 + vector : [vector[1], -vector[0]] + }); + } + }, + + /** + * 获取外圈的半径 + * + * @return {number} + */ + _getRadius : function () { + var item = this.polar[this._index]; + return this.parsePercent( + item.radius, + Math.min(this.zr.getWidth(), this.zr.getHeight()) / 2 + ); + }, + + /** + * 构建蜘蛛网 + * @param {number} polar的index + */ + _buildSpiderWeb : function (index) { + var item = this.polar[index]; + var __ecIndicator = item.__ecIndicator; + var splitArea = item.splitArea; + var splitLine = item.splitLine; + + var center = this.getCenter(index); + var splitNumber = item.splitNumber; + + var strokeColor = splitLine.lineStyle.color; + var lineWidth = splitLine.lineStyle.width; + var show = splitLine.show; + + var axisLine = this.deepQuery(this._queryTarget, 'axisLine'); + + this._addArea( + __ecIndicator, splitNumber, center, + splitArea, strokeColor, lineWidth, show + ); + + axisLine.show && this._addLine( + __ecIndicator, center, axisLine + ); + }, + + /** + * 绘制axisLabel + */ + _addAxisLabel : function (index) { + var item = this.polar[index]; + var indicator = this.deepQuery(this._queryTarget, 'indicator'); + var __ecIndicator = item.__ecIndicator; + var axisLabel; + var vector; + var style; + var newStyle; + var splitNumber = this.deepQuery(this._queryTarget, 'splitNumber'); + var center = this.getCenter(index); + var vector; + var value; + var text; + var theta; + // var startAngle = this.deepQuery(this._queryTarget, 'startAngle'); + var offset; + var precision = this.deepQuery(this._queryTarget, 'precision'); + var interval; + + for (var i = 0; i < indicator.length; i ++) { + axisLabel = this.deepQuery( + [indicator[i], item, this.option], 'axisLabel' + ); + + if (axisLabel.show) { + style = {}; + style.textFont = this.getFont(); + + style = zrUtil.merge(style, axisLabel); + style.lineWidth = style.width; + + vector = __ecIndicator[i].vector; + value = __ecIndicator[i].value; + theta = i / indicator.length * 2 * Math.PI; + offset = axisLabel.offset || 10; + interval = axisLabel.interval || 0; + + if (!value) { + return; + } + + for (var j = 1 ; j <= splitNumber; j += interval + 1) { + newStyle = zrUtil.merge({}, style); + text = + j * (value.max - value.min) / splitNumber + + value.min; + if (precision) { + text = text.toFixed(precision); + } + newStyle.text = this.numAddCommas(text); + newStyle.x = j * vector[0] / splitNumber + + Math.cos(theta) * offset + center[0]; + newStyle.y = j * vector[1] / splitNumber + + Math.sin(theta) * offset + center[1]; + + this.shapeList.push(new TextShape({ + zlevel : this._zlevelBase, + style : newStyle, + draggable : false, + hoverable : false + })); + } + } + } + }, + + /** + * 绘制坐标头的文字 + * @param {number} polar的index + */ + _buildText : function (index) { + var item = this.polar[index]; + var __ecIndicator = item.__ecIndicator; + var vector; + var indicator = this.deepQuery(this._queryTarget, 'indicator'); + var center = this.getCenter(index); + var style; + var textAlign; + var name; + var rotation; + var x = 0; + var y = 0; + var margin; + var textStyle; + + for (var i = 0; i < indicator.length; i ++) { + name = this.deepQuery( + [indicator[i], item, this.option], 'name' + ); + + if (!name.show) { + continue; + } + textStyle = this.deepQuery( + [name, item, this.option], + 'textStyle' + ); + + style = {}; + + style.textFont = this.getFont(textStyle); + style.color = textStyle.color; + + if (typeof name.formatter == 'function') { + style.text = name.formatter.call(this.myChart, indicator[i].text, i); + } + else if (typeof name.formatter == 'string'){ + style.text = name.formatter.replace( + '{value}', indicator[i].text + ); + } + else { + style.text = indicator[i].text; + } + __ecIndicator[i].text = style.text; + + vector = __ecIndicator[i].vector; + + if (Math.round(vector[0]) > 0) { + textAlign = 'left'; + } + else if (Math.round(vector[0]) < 0) { + textAlign = 'right'; + } + else { + textAlign = 'center'; + } + + if (!name.margin) { + vector = this._mapVector(vector, center, 1.2); + } + else { + margin = name.margin; + x = vector[0] > 0 ? margin : - margin; + y = vector[1] > 0 ? margin : - margin; + + x = vector[0] === 0 ? 0 : x; + y = vector[1] === 0 ? 0 : y; + vector = this._mapVector(vector, center, 1); + } + + + style.textAlign = textAlign; + style.x = vector[0] + x; + style.y = vector[1] + y; + + if (name.rotate) { + rotation = [ + name.rotate / 180 * Math.PI, + vector[0], vector[1] + ]; + } + else { + rotation = [0, 0, 0]; + } + + this.shapeList.push(new TextShape({ + zlevel : this._zlevelBase, + style : style, + draggable : false, + hoverable : false, + rotation : rotation + })); + } + }, + + getIndicatorText : function(polarIndex, indicatorIndex) { + return this.polar[polarIndex] + && this.polar[polarIndex].__ecIndicator[indicatorIndex] + && this.polar[polarIndex].__ecIndicator[indicatorIndex].text; + }, + + /** + * 添加一个隐形的盒子 当做drop的容器 暴露给外部的图形类使用 + * @param {number} polar的index + * @return {Object} 添加的盒子图形 + */ + getDropBox : function (index) { + var index = index || 0; + var item = this.polar[index]; + var center = this.getCenter(index); + var __ecIndicator = item.__ecIndicator; + var len = __ecIndicator.length; + var pointList = []; + var vector; + var shape; + var type = item.type; + + if (type == 'polygon') { + for (var i = 0; i < len; i ++) { + vector = __ecIndicator[i].vector; + pointList.push(this._mapVector(vector, center, 1.2)); + } + shape = this._getShape( + pointList, 'fill', 'rgba(0,0,0,0)', '', 1 + ); + } else if (type == 'circle') { + shape = this._getCircle( + '', 1, 1.2, center, 'fill', 'rgba(0,0,0,0)' + ); + } + + return shape; + }, + + /** + * 绘制蜘蛛网的正n变形 + * + * @param {Array} 指标数组 + * @param {number} 分割线数量 + * @param {Array} 中点坐标 + * @param {Object} 分割区域对象 + * @param {string} 线条颜色 + * @param {number} 线条宽度 + */ + _addArea : function ( + __ecIndicator, splitNumber, center, + splitArea, strokeColor, lineWidth, show + ) { + var shape; + var scale; + var scale1; + var pointList; + var type = this.deepQuery(this._queryTarget, 'type'); + + for (var i = 0; i < splitNumber ; i ++ ) { + scale = (splitNumber - i) / splitNumber; + + if (show) { + if (type == 'polygon') { + pointList = this._getPointList( + __ecIndicator, scale, center); + shape = this._getShape( + pointList, 'stroke', '', strokeColor, lineWidth + ); + } else if (type == 'circle') { + shape = this._getCircle( + strokeColor, lineWidth, scale, center, 'stroke' + ); + } + + this.shapeList.push(shape); + } + + if (splitArea.show) { + scale1 = (splitNumber - i - 1) / splitNumber; + this._addSplitArea( + __ecIndicator, splitArea, scale, scale1, center, i + ); + } + } + }, + + /** + * 绘制圆 + * + * @param {string} strokeColor + * @param {number} lineWidth + * @param {number} scale + * @param {Array.} center + * @param {string} brushType + * @param {string} color + * @return {Circle} + */ + _getCircle : function ( + strokeColor, lineWidth, scale, center, brushType, color + ) { + var radius = this._getRadius(); + return new Circle({ + zlevel : this._zlevelBase, + style: { + x: center[0], + y: center[1], + r: radius * scale, + brushType: brushType, + strokeColor: strokeColor, + lineWidth: lineWidth, + color: color + }, + hoverable : false, + draggable : false + }); + }, + + /** + * 绘制圆环 + * + * @param {string} color 间隔颜色 + * @param {number} scale0 小圆的scale + * @param {number} scale1 大圆的scale + * @param {Array.} center 圆点 + * @return {Ring} + */ + _getRing : function (color, scale0, scale1, center) { + var radius = this._getRadius(); + return new Ring({ + zlevel : this._zlevelBase, + style : { + x : center[0], + y : center[1], + r : scale0 * radius, + r0 : scale1 * radius, + color : color, + brushType : 'fill' + }, + hoverable : false, + draggable : false + }); + }, + + /** + * 获取需要绘制的多边形的点集 + * @param {Object} serie的指标参数 + * @param {number} 缩小的系数 + * @param {Array} 中点坐标 + * + * @return {Array>} 返回绘制的点集 + */ + _getPointList : function (__ecIndicator, scale, center) { + var pointList = []; + var len = __ecIndicator.length; + var vector; + + for (var i = 0 ; i < len ; i ++ ) { + vector = __ecIndicator[i].vector; + + pointList.push(this._mapVector(vector, center, scale)); + } + return pointList; + }, + + /** + * 获取绘制的图形 + * @param {Array>} 绘制的点集 + * @param {string} 绘制方式 stroke | fill | both 描边 | 填充 | 描边 + 填充 + * @param {string} 颜色 + * @param {string} 描边颜色 + * @param {number} 线条宽度 + * @return {Object} 绘制的图形对象 + */ + _getShape : function ( + pointList, brushType, color, strokeColor, lineWidth + ) { + return new PolygonShape({ + zlevel : this._zlevelBase, + style : { + pointList : pointList, + brushType : brushType, + color : color, + strokeColor : strokeColor, + lineWidth : lineWidth + }, + hoverable : false, + draggable : false + }); + }, + + /** + * 绘制填充区域 + */ + _addSplitArea : function ( + __ecIndicator, splitArea, scale, scale1, center, colorInd + ) { + var indLen = __ecIndicator.length; + var color; + var colorArr = splitArea.areaStyle.color; + var colorLen; + + var vector; + var vector1; + var pointList = []; + var indLen = __ecIndicator.length; + var shape; + + var type = this.deepQuery(this._queryTarget, 'type'); + + if (typeof colorArr == 'string') { + colorArr = [colorArr]; + } + colorLen = colorArr.length; + color = colorArr[ colorInd % colorLen]; + + if (type == 'polygon') { + for (var i = 0; i < indLen ; i ++) { + pointList = []; + vector = __ecIndicator[i].vector; + vector1 = __ecIndicator[(i + 1) % indLen].vector; + + pointList.push(this._mapVector(vector, center, scale)); + pointList.push(this._mapVector(vector, center, scale1)); + pointList.push(this._mapVector(vector1, center, scale1)); + pointList.push(this._mapVector(vector1, center, scale)); + + shape = this._getShape( + pointList, 'fill', color, '', 1 + ); + this.shapeList.push(shape); + } + } else if (type == 'circle') { + shape = this._getRing(color, scale, scale1, center); + this.shapeList.push(shape); + } + }, + + /** + * 转换坐标 + * + * @param {Array} 原始坐标 + * @param {Array} 中点坐标 + * @param {number} 缩小的倍数 + * + * @return {Array} 转换后的坐标 + */ + _mapVector : function (vector, center, scale) { + return [ + vector[0] * scale + center[0], + vector[1] * scale + center[1] + ]; + }, + + /** + * 获取中心点位置 暴露给外部图形类使用 + * @param {number} polar的index + */ + getCenter : function (index) { + var index = index || 0; + return this.parseCenter(this.zr, this.polar[index].center); + }, + + /** + * 绘制从中点出发的线 + * + * @param {Array} 指标对象 + * @param {Array} 中点坐标 + * @param {string} 线条颜色 + * @param {number} 线条宽度 + * @param {string} 线条绘制类型 + * solid | dotted | dashed 实线 | 点线 | 虚线 + */ + _addLine : function ( + __ecIndicator, center, axisLine + ) { + var indLen = __ecIndicator.length; + var line; + var vector; + var lineStyle = axisLine.lineStyle; + var strokeColor = lineStyle.color; + var lineWidth = lineStyle.width; + var lineType = lineStyle.type; + + for (var i = 0; i < indLen ; i ++ ) { + vector = __ecIndicator[i].vector; + line = this._getLine( + center[0], center[1], + vector[0] + center[0], + vector[1] + center[1], + strokeColor, lineWidth, lineType + ); + this.shapeList.push(line); + } + }, + + /** + * 获取线条对象 + * @param {number} 出发点横坐标 + * @param {number} 出发点纵坐标 + * @param {number} 终点横坐标 + * @param {number} 终点纵坐标 + * @param {string} 线条颜色 + * @param {number} 线条宽度 + * @param {string} 线条类型 + * + * @return {Object} 线条对象 + */ + _getLine : function ( + xStart, yStart, xEnd, yEnd, strokeColor, lineWidth, lineType + ) { + return new LineShape({ + zlevel : this._zlevelBase, + style : { + xStart : xStart, + yStart : yStart, + xEnd : xEnd, + yEnd : yEnd, + strokeColor : strokeColor, + lineWidth : lineWidth, + lineType : lineType + }, + hoverable : false + }); + }, + + /** + * 调整指标的值,当indicator中存在max时设置为固定值 + * @param {number} polar的index + */ + _adjustIndicatorValue : function (index) { + var item = this.polar[index]; + var indicator = this.deepQuery(this._queryTarget, 'indicator'); + var len = indicator.length; + var __ecIndicator = item.__ecIndicator; + var value; + var max; + var min; + var data = this._getSeriesData(index); + var splitNumber = item.splitNumber; + + var boundaryGap = this.deepQuery(this._queryTarget, 'boundaryGap'); + var precision = this.deepQuery(this._queryTarget, 'precision'); + var power = this.deepQuery(this._queryTarget, 'power'); + var scale = this.deepQuery(this._queryTarget, 'scale'); + + for (var i = 0; i < len ; i ++ ) { + if (typeof indicator[i].max == 'number') { + max = indicator[i].max; + min = indicator[i].min || 0; + value = { + max : max, + min : min + }; + } + else { + value = this._findValue( + data, i, splitNumber, + boundaryGap, precision, power, scale + ); + } + + __ecIndicator[i].value = value; + } + }, + + /** + * 将series中的数据拿出来,如果没有polarIndex属性,默认为零 + * @param {number} polar 的index + * @param {Array} 需要处理的数据 + */ + _getSeriesData : function (index) { + var data = []; + var serie; + var serieData; + var legend = this.component.legend; + var polarIndex; + + for (var i = 0; i < this.series.length; i ++) { + serie = this.series[i]; + if (serie.type != ecConfig.CHART_TYPE_RADAR) { + continue; + } + serieData = serie.data || []; + for (var j = 0; j < serieData.length; j ++) { + polarIndex = this.deepQuery( + [serieData[j], serie, this.option], 'polarIndex' + ) || 0; + if (polarIndex == index + && (!legend || legend.isSelected(serieData[j].name)) + ) { + data.push(serieData[j]); + } + } + } + return data; + }, + + /** + * 查找指标合适的值 + * + * 如果只有一组数据以数据中的最大值作为最大值 0为最小值 + * 如果是多组,使用同一维度的进行比较 选出最大值最小值 + * 对它们进行处理 + * @param {Object} serie 的 data + * @param {number} 指标的序号 + * @param {boolean} boundaryGap 两端留白 + * @param {number} precision 小数精度 + * @param {number} power 整数精度 + * @return {Object} 指标的最大值最小值 + */ + _findValue : function ( + data, index, splitNumber, boundaryGap, precision, power, scale + ) { + var max; + var min; + var value; + var delta; + var str; + var len = 0; + var max0; + var min0; + var one; + + if (!data || data.length === 0) { + return; + } + + function _compare(item) { + (item > max || max === undefined) && (max = item); + (item < min || min === undefined) && (min = item); + } + + if (data.length == 1) { + min = 0; + } + if (data.length != 1) { + for (var i = 0; i < data.length; i ++) { + value = typeof data[i].value[index].value != 'undefined' + ? data[i].value[index].value : data[i].value[index]; + _compare(value); + } + } + else { + one = data[0]; + for (var i = 0; i < one.value.length; i ++) { + _compare( + typeof one.value[i].value != 'undefined' + ? one.value[i].value : one.value[i] + ); + } + } + + if (data.length != 1) { + if (scale) { + delta = this._getDelta( + max, min, splitNumber, precision, power + ); + + if (delta >= 1) { + min = Math.floor(min / delta) * delta - delta; + } + else if (delta === 0) { + if (max > 0) { + min0 = 0; + max0 = 2 * max; + } + else if (max === 0) { + min0 = 0; + max0 = 100; + } + else { + max0 = 0; + min0 = 2 * min; + } + + return { + max : max0, + min : min0 + }; + } + else { + str = (delta + '').split('.')[1]; + len = str.length; + min = Math.floor( + min * Math.pow(10, len)) / Math.pow(10, len + ) - delta; + } + + if (Math.abs(min) <= delta) { + min = 0; + } + + max = min + Math.floor(delta * Math.pow(10, len) + * (splitNumber + 1)) / Math.pow(10, len) ; + } + else { + min = min > 0 ? 0 : min; + } + } + + if (boundaryGap) { + max = max > 0 ? max * 1.2 : max * 0.8; + min = min > 0 ? min * 0.8 : min * 1.2; + } + + return { + max : max, + min : min + }; + }, + + /** + * 获取最大值与最小值中间比较合适的差值 + * @param {number} max; + * @param {number} min + * @param {number} precision 小数精度 + * @param {number} power 整数精度 + * @return {number} delta + */ + _getDelta : function (max , min, splitNumber, precision, power) { + var delta = (max - min) / splitNumber; + var str; + var n; + + if (delta > 1) { + if (!power) { + str = (delta + '').split('.')[0]; + n = str.length; + if (str.charAt(0) >= 5) { + return Math.pow(10, n); + } + else { + return (str.charAt(0) - 0 + 1 ) * Math.pow(10, n - 1); + } + } + else { + delta = Math.ceil(delta); + if (delta % power > 0) { + return (Math.ceil(delta / power) + 1) * power; + } + else { + return delta; + } + } + } + else if (delta == 1) { + return 1; + } + else if (delta === 0) { + return 0; + } + else { + if (!precision) { + str = (delta + '').split('.')[1]; + n = 0; + while (str[n] == '0') { + n ++ ; + } + + if (str[n] >= 5) { + return '0.' + str.substring(0, n + 1) - 0 + + 1 / Math.pow(10, n); + } + else { + return '0.' + str.substring(0, n + 1) - 0 + + 1 / Math.pow(10, n + 1); + } + } + else { + return Math.ceil(delta * Math.pow(10, precision)) + / Math.pow(10, precision); + } + } + }, + + /** + * 获取每个指标上某个value对应的坐标 + * @param {number} polarIndex + * @param {number} indicatorIndex + * @param {number} value + * @return {Array} 对应坐标 + */ + getVector : function (polarIndex, indicatorIndex, value) { + polarIndex = polarIndex || 0; + indicatorIndex = indicatorIndex || 0; + var __ecIndicator = this.polar[polarIndex].__ecIndicator; + + if (indicatorIndex >= __ecIndicator.length) { + return ; + } + + var indicator = this.polar[polarIndex].__ecIndicator[indicatorIndex]; + var center = this.getCenter(polarIndex); + var vector = indicator.vector; + var max = indicator.value.max; + var min = indicator.value.min; + var alpha; + + if (typeof value == 'undefined') { + return center; + } + + switch (value) { + case 'min' : + value = min; + break; + case 'max' : + value = max; + break; + case 'center' : + value = (max + min) / 2; + break; + } + + if (max != min) { + alpha = (value - min) / (max - min); + } + else { + alpha = 0.5; + } + + return this._mapVector(vector, center, alpha); + }, + + /** + * 判断一个点是否在网内 + * @param {Array} 坐标 + * @return {number} 返回polarindex 返回-1表示不在任何polar + */ + isInside : function (vector) { + var polar = this.getNearestIndex(vector); + + if (polar) { + return polar.polarIndex; + } + return -1; + }, + + /** + * 如果一个点在网内,返回离它最近的数据轴的index + * @param {Array} 坐标 + * @return {Object} | false + * polarIndex + * valueIndex + */ + getNearestIndex : function (vector) { + var item; + var center; + var radius; + var polarVector; + var startAngle; + var indicator; + var len; + var angle; + var finalAngle; + for (var i = 0 ; i < this.polar.length; i ++) { + item = this.polar[i]; + center = this.getCenter(i); + if (vector[0] == center[0] && vector[1] == center[1]) { + return { + polarIndex : i, + valueIndex : 0 + }; + } + radius = this._getRadius(); + startAngle = item.startAngle; + indicator = item.indicator; + len = indicator.length; + angle = 2 * Math.PI / len; + // 注意y轴的翻转 + polarVector = ecCoordinates.cartesian2polar( + vector[0] - center[0], center[1] - vector[1] + ); + if (vector[0] - center[0] < 0) { + polarVector[1] += Math.PI; + } + if (polarVector[1] < 0) { + polarVector[1] += 2 * Math.PI; + } + + + // 减去startAngle的偏移量 再加2PI变成正数 + finalAngle = polarVector[1] - + startAngle / 180 * Math.PI + Math.PI * 2; + + if (Math.abs(Math.cos(finalAngle % (angle / 2))) * radius + > polarVector[0]) + { + return { + polarIndex : i, + valueIndex : Math.floor( + (finalAngle + angle / 2 ) / angle + ) % len + }; + } + } + }, + + /** + * 获取指标信息 + * @param {number} polarIndex + * @return {Array} indicator + */ + getIndicator : function (index) { + var index = index || 0; + return this.polar[index].indicator; + }, + + /** + * 刷新 + */ + refresh : function (newOption) { + if (newOption) { + this.option = newOption; + this.polar = this.option.polar; + this.series = this.option.series; + } + this.clear(); + this._buildShape(); + } + }; + + zrUtil.inherits(Polar, Base); + + require('../component').define('polar', Polar); + + return Polar; }); -/** - * 地图文本位置修正 - */ -define('echarts/util/mapData/textFixed',[],function() { - // fix = [xFixed, yFixed, scale] - // textX += fix[0]; - // textY += fix[1]; - return { - //'南海诸岛' : [32, 83], - // 全国 - '广东': [0, -10], - '香港': [10, 10], - '澳门': [-10, 18], - '黑龙江' : [0, 20], - //'北京': [-10, 0], - '天津': [5, 5], - // 广东 - '深圳市': [-35, 0], - // 云南 - '红河哈尼族彝族自治州' : [0, 20], - '楚雄彝族自治州': [-5, 15], - // 新疆 - '石河子市': [-5, 5], - '五家渠市': [0, -10], - '昌吉回族自治州': [10, 10], - // 海南 - '昌江黎族自治县': [0,20], - '陵水黎族自治县': [0,20], - '东方市': [0,20], - // 陕西 - '渭南市': [0,20] - }; +/** + * echarts图表类:雷达图 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Neil (杨骥, yangji01@baidu.com) + */ + + define('echarts/chart/radar',['require','../component/base','./base','zrender/shape/Polygon','../component/polar','../config','../util/ecData','zrender/tool/util','zrender/tool/color','../util/accMath','../chart'],function (require) { + var ComponentBase = require('../component/base'); + var ChartBase = require('./base'); + + // 图形依赖 + var PolygonShape = require('zrender/shape/Polygon'); + // 组件依赖 + require('../component/polar'); + + var ecConfig = require('../config'); + var ecData = require('../util/ecData'); + var zrUtil = require('zrender/tool/util'); + var zrColor = require('zrender/tool/color'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} series 数据 + * @param {Object} component 组件 + * @constructor + * @exports Radar + */ + function Radar(ecTheme, messageCenter, zr, option, myChart) { + // 基类 + ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); + // 图表基类 + ChartBase.call(this); + + this.refresh(option); + } + + Radar.prototype = { + type : ecConfig.CHART_TYPE_RADAR, + /** + * 绘制图形 + */ + _buildShape : function () { + this.selectedMap = {}; + this._symbol = this.option.symbolList; + this._queryTarget; + this._dropBoxList = []; + this._radarDataCounter = 0; + + var series = this.series; + var legend = this.component.legend; + var serieName; + for (var i = 0, l = series.length; i < l ; i++) { + if (series[i].type === ecConfig.CHART_TYPE_RADAR) { + this.serie = this.reformOption(series[i]); + serieName = this.serie.name || ''; + // 系列图例开关 + this.selectedMap[serieName] = + legend ? legend.isSelected(serieName) : true; + + if (this.selectedMap[serieName]) { + this._queryTarget = [this.serie, this.option]; + + // 添加可拖拽提示框,多系列共用一个极坐标,第一个优先 + if (this.deepQuery(this._queryTarget, 'calculable')) { + this._addDropBox(i); + } + this._buildSingleRadar(i); + this.buildMark(i); + } + } + } + + this.addShapeList(); + }, + + /** + * 构建数据图形 + * @param {number} 序列的index + */ + _buildSingleRadar : function (index) { + var legend = this.component.legend; + var iconShape; + var data = this.serie.data; + var defaultColor; + var name; + var pointList; + var calculable = this.deepQuery(this._queryTarget, 'calculable'); + + for (var i = 0; i < data.length; i++) { + name = data[i].name || ''; + + // 图例开关 + this.selectedMap[name] = legend + ? legend.isSelected(name) : true; + if (!this.selectedMap[name]) { + continue; + } + + // 默认颜色策略 + if (legend) { + // 有图例则从图例中获取颜色定义 + defaultColor = legend.getColor(name); + iconShape = legend.getItemShape(name); + if (iconShape) { + // 回调legend,换一个更形象的icon + iconShape.style.brushType = this.deepQuery( + [data[i], this.serie], 'itemStyle.normal.areaStyle' + ) ? 'both' : 'stroke'; + legend.setItemShape(name, iconShape); + } + } + else { + // 全局颜色定义 + defaultColor = this.zr.getColor(i); + } + + pointList = this._getPointList(this.serie.polarIndex, data[i]); + // 添加拐点形状 + this._addSymbol( + pointList, defaultColor, i, index, this.serie.polarIndex); + // 添加数据形状 + this._addDataShape( + pointList, defaultColor, data[i], + index, i, calculable + ); + this._radarDataCounter++; + } + }, + + /** + * 获取数据的点集 + * @param {number} polarIndex + * @param {Array} 处理的数据 + * @return {Array>} 点集 + */ + _getPointList : function (polarIndex, dataArr) { + var pointList = []; + var vector; + var polar = this.component.polar; + + for (var i = 0, l = dataArr.value.length; i < l; i++) { + vector = polar.getVector( + polarIndex, + i, + typeof dataArr.value[i].value != 'undefined' + ? dataArr.value[i].value : dataArr.value[i] + ); + if (vector) { + pointList.push(vector); + } + } + return pointList; + }, + + /** + * 添加拐点 + * @param {Array>} pointList 点集 + * @param {string} defaultColor 默认填充颜色 + * @param {object} data 数据 + * @param {number} serieIndex + */ + _addSymbol :function (pointList, defaultColor, dataIndex, seriesIndex, polarIndex) { + var series = this.series; + var itemShape; + var polar = this.component.polar; + + for (var i = 0, l = pointList.length; i < l; i++) { + itemShape = this.getSymbolShape( + this.deepMerge( + [series[seriesIndex].data[dataIndex], series[seriesIndex]] + ), + seriesIndex, + series[seriesIndex].data[dataIndex].value[i], i, + polar.getIndicatorText(polarIndex, i), + pointList[i][0], // x + pointList[i][1], // y + this._symbol[this._radarDataCounter % this._symbol.length], + defaultColor, + '#fff', + 'vertical' + ); + itemShape.zlevel = this._zlevelBase + 1; + ecData.set(itemShape, 'data', series[seriesIndex].data[dataIndex]); + ecData.set(itemShape, 'value', series[seriesIndex].data[dataIndex].value); + ecData.set(itemShape, 'dataIndex', dataIndex); + ecData.set(itemShape, 'special', i); + this.shapeList.push(itemShape); + } + }, + + /** + * 添加数据图形 + * @param {Array>} pointList 点集 + * @param {string} defaultColor 默认填充颜色 + * @param {object} data 数据 + * @param {number} serieIndex + * @param {number} dataIndex + * @param {boolean} calcalable + */ + _addDataShape : function ( + pointList, defaultColor, data, + seriesIndex, dataIndex, calculable + ) { + var series = this.series; + // 多级控制 + var queryTarget = [data, this.serie]; + var nColor = this.getItemStyleColor( + this.deepQuery( + queryTarget, 'itemStyle.normal.color' + ), + seriesIndex, + dataIndex, + data + ); + var nLineWidth = this.deepQuery( + queryTarget, 'itemStyle.normal.lineStyle.width' + ); + var nLineType = this.deepQuery( + queryTarget, 'itemStyle.normal.lineStyle.type' + ); + var nAreaColor = this.deepQuery( + queryTarget, 'itemStyle.normal.areaStyle.color' + ); + var nIsAreaFill = this.deepQuery( + queryTarget, 'itemStyle.normal.areaStyle' + ); + var shape = { + zlevel : this._zlevelBase, + style : { + pointList : pointList, + brushType : nIsAreaFill ? 'both' : 'stroke', + color : nAreaColor + || nColor + || (typeof defaultColor === 'string' + ? zrColor.alpha(defaultColor,0.5) : defaultColor), + strokeColor : nColor || defaultColor, + lineWidth : nLineWidth, + lineType : nLineType + }, + highlightStyle : { + brushType : this.deepQuery( + queryTarget, + 'itemStyle.emphasis.areaStyle' + ) || nIsAreaFill + ? 'both' : 'stroke', + color : this.deepQuery( + queryTarget, + 'itemStyle.emphasis.areaStyle.color' + ) + || nAreaColor + || nColor + || (typeof defaultColor === 'string' + ? zrColor.alpha(defaultColor,0.5) : defaultColor), + strokeColor : this.getItemStyleColor( + this.deepQuery( + queryTarget, 'itemStyle.emphasis.color' + ), + seriesIndex, + dataIndex, + data + ) + || nColor || defaultColor, + lineWidth : this.deepQuery( + queryTarget, + 'itemStyle.emphasis.lineStyle.width' + ) || nLineWidth, + lineType : this.deepQuery( + queryTarget, + 'itemStyle.emphasis.lineStyle.type' + ) || nLineType + } + }; + ecData.pack( + shape, + series[seriesIndex], // 系列 + seriesIndex, // 系列索引 + data, // 数据 + dataIndex, // 数据索引 + data.name, // 数据名称 + // 附加指标信息 + this.component.polar.getIndicator(series[seriesIndex].polarIndex) + ); + if (calculable) { + shape.draggable = true; + this.setCalculable(shape); + } + + shape = new PolygonShape(shape); + this.shapeList.push(shape); + }, + + /** + * 增加外围接受框 + * @param {number} serie的序列 + */ + _addDropBox : function (index) { + var series = this.series; + var polarIndex = this.deepQuery( + this._queryTarget, 'polarIndex' + ); + if (!this._dropBoxList[polarIndex]) { + var shape = this.component.polar.getDropBox(polarIndex); + shape.zlevel = this._zlevelBase; + this.setCalculable(shape); + ecData.pack(shape, series, index, undefined, -1); + this.shapeList.push(shape); + this._dropBoxList[polarIndex] = true; + } + }, + + /** + * 数据项被拖拽出去,重载基类方法 + */ + ondragend : function (param, status) { + var series = this.series; + if (!this.isDragend || !param.target) { + // 没有在当前实例上发生拖拽行为则直接返回 + return; + } + + // 被拖拽图形元素 + var target = param.target; + + var seriesIndex = ecData.get(target, 'seriesIndex'); + var dataIndex = ecData.get(target, 'dataIndex'); + + // 被拖拽的图形是饼图sector,删除被拖拽走的数据 + this.component.legend && this.component.legend.del( + series[seriesIndex].data[dataIndex].name + ); + + series[seriesIndex].data.splice(dataIndex, 1); + + // 别status = {}赋值啊!! + status.dragOut = true; + status.needRefresh = true; + + // 处理完拖拽事件后复位 + this.isDragend = false; + + return; + }, + + /** + * 数据项被拖拽进来, 重载基类方法 + */ + ondrop : function (param, status) { + var series = this.series; + if (!this.isDrop || !param.target) { + // 没有在当前实例上发生拖拽行为则直接返回 + return; + } + + var target = param.target; // 拖拽安放目标 + var dragged = param.dragged; // 当前被拖拽的图形对象 + + var seriesIndex = ecData.get(target, 'seriesIndex'); + var dataIndex = ecData.get(target, 'dataIndex'); + + var data; + var legend = this.component.legend; + var value; + + if (dataIndex === -1) { + data = { + value : ecData.get(dragged, 'value'), + name : ecData.get(dragged, 'name') + }; + + series[seriesIndex].data.push(data); + + legend && legend.add( + data.name, + dragged.style.color || dragged.style.strokeColor + ); + } + else { + // 数据被拖拽到某个数据项上,数据修改 + var accMath = require('../util/accMath'); + data = series[seriesIndex].data[dataIndex]; + legend && legend.del(data.name); + data.name += this.option.nameConnector + + ecData.get(dragged, 'name'); + value = ecData.get(dragged, 'value'); + for (var i = 0 ; i < value.length; i++) { + data.value[i] = accMath.accAdd(data.value[i], value[i]); + } + + legend && legend.add( + data.name, + dragged.style.color || dragged.style.strokeColor + ); + } + + // 别status = {}赋值啊!! + status.dragIn = status.dragIn || true; + + // 处理完拖拽事件后复位 + this.isDrop = false; + + return; + }, + + /** + * 刷新 + */ + refresh : function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + + this.backupShapeList(); + this._buildShape(); + } + }; + + zrUtil.inherits(Radar, ChartBase); + zrUtil.inherits(Radar, ComponentBase); + + // 图表注册 + require('../chart').define('radar', Radar); + + return Radar; }); -/** - * 经纬度坐标,优先于自定计算 - */ -define('echarts/util/mapData/geoCoord',[],function() { - return { - 'Russia' : [100, 60], - 'United States of America' : [-99, 38] - }; +/** + * Path 代理,可以在`buildPath`中用于替代`ctx`, 会保存每个path操作的命令到pathCommands属性中 + * 可以用于 isInsidePath 判断以及获取boundingRect + * + * @module zrender/shape/util/PathProxy + * @author pissang (http://www.github.com/pissang) + * + * @example + * var SomeShape = function() { + * this._pathProxy = new PathProxy(); + * ... + * } + * SomeShape.prototype.buildPath = function(ctx, style) { + * this._pathProxy.begin(ctx); + * .moveTo(style.x, style.y); + * .lineTo(style.x1, style.y1); + * ... + * .closePath(); + * }, + * SomeShape.prototype.getRect = function(style) { + * if (!style._rect) { + * // 这里必须要在 buildPath 之后才能调用 + * style._rect = this._pathProxy.fastBoundingRect(); + * } + * return this.style._rect; + * }, + * SomeShape.prototype.isCover = function(x, y) { + * var rect = this.getRect(this.style); + * if (x >= rect.x + * && x <= (rect.x + rect.width) + * && y >= rect.y + * && y <= (rect.y + rect.height) + * ) { + * return area.isInsidePath( + * this._pathProxy.pathCommands, 0, 'fill', x, y + * ); + * } + * } + */ +define('zrender/shape/util/PathProxy',['require','../../tool/vector'],function (require) { + + var vector = require('../../tool/vector'); + // var computeBoundingBox = require('../../tool/computeBoundingBox'); + + var PathSegment = function(command, points) { + this.command = command; + this.points = points || null; + }; + + /** + * @alias module:zrender/shape/tool/PathProxy + * @constructor + */ + var PathProxy = function () { + + /** + * Path描述的数组,用于`isInsidePath`的判断 + * @type {Array.} + */ + this.pathCommands = []; + + this._ctx = null; + + this._min = []; + this._max = []; + }; + + /** + * 快速计算Path包围盒(并不是最小包围盒) + * @return {Object} + */ + PathProxy.prototype.fastBoundingRect = function () { + var min = this._min; + var max = this._max; + min[0] = min[1] = Infinity; + max[0] = max[1] = -Infinity; + for (var i = 0; i < this.pathCommands.length; i++) { + var seg = this.pathCommands[i]; + var p = seg.points; + switch (seg.command) { + case 'M': + vector.min(min, min, p); + vector.max(max, max, p); + break; + case 'L': + vector.min(min, min, p); + vector.max(max, max, p); + break; + case 'C': + for (var j = 0; j < 6; j += 2) { + min[0] = Math.min(min[0], min[0], p[j]); + min[1] = Math.min(min[1], min[1], p[j + 1]); + max[0] = Math.max(max[0], max[0], p[j]); + max[1] = Math.max(max[1], max[1], p[j + 1]); + } + break; + case 'Q': + for (var j = 0; j < 4; j += 2) { + min[0] = Math.min(min[0], min[0], p[j]); + min[1] = Math.min(min[1], min[1], p[j + 1]); + max[0] = Math.max(max[0], max[0], p[j]); + max[1] = Math.max(max[1], max[1], p[j + 1]); + } + break; + case 'A': + var cx = p[0]; + var cy = p[1]; + var rx = p[2]; + var ry = p[3]; + min[0] = Math.min(min[0], min[0], cx - rx); + min[1] = Math.min(min[1], min[1], cy - ry); + max[0] = Math.max(max[0], max[0], cx + rx); + max[1] = Math.max(max[1], max[1], cy + ry); + break; + } + } + + return { + x: min[0], + y: min[1], + width: max[0] - min[0], + height: max[1] - min[1] + }; + }; + + /** + * @param {CanvasRenderingContext2D} ctx + * @return {PathProxy} + */ + PathProxy.prototype.begin = function (ctx) { + this._ctx = ctx || null; + // 清空pathCommands + this.pathCommands.length = 0; + + return this; + }; + + /** + * @param {number} x + * @param {number} y + * @return {PathProxy} + */ + PathProxy.prototype.moveTo = function (x, y) { + this.pathCommands.push(new PathSegment('M', [x, y])); + if (this._ctx) { + this._ctx.moveTo(x, y); + } + return this; + }; + + /** + * @param {number} x + * @param {number} y + * @return {PathProxy} + */ + PathProxy.prototype.lineTo = function (x, y) { + this.pathCommands.push(new PathSegment('L', [x, y])); + if (this._ctx) { + this._ctx.lineTo(x, y); + } + return this; + }; + + /** + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @param {number} x3 + * @param {number} y3 + * @return {PathProxy} + */ + PathProxy.prototype.bezierCurveTo = function (x1, y1, x2, y2, x3, y3) { + this.pathCommands.push(new PathSegment('C', [x1, y1, x2, y2, x3, y3])); + if (this._ctx) { + this._ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3); + } + return this; + }; + + /** + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @return {PathProxy} + */ + PathProxy.prototype.quadraticCurveTo = function (x1, y1, x2, y2) { + this.pathCommands.push(new PathSegment('A', [x1, y1, x2, y2])); + if (this._ctx) { + this._ctx.quadraticCurveTo(x1, y1, x2, y2); + } + return this; + }; + + /** + * @param {number} cx + * @param {number} cy + * @param {number} r + * @param {number} startAngle + * @param {number} endAngle + * @param {boolean} anticlockwise + * @return {PathProxy} + */ + PathProxy.prototype.arc = function (cx, cy, r, startAngle, endAngle, anticlockwise) { + this.pathCommands.push(new PathSegment( + 'A', [cx, cy, r, r, startAngle, endAngle - startAngle, 0, anticlockwise ? 0 : 1] + )); + if (this._ctx) { + this._ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise); + } + return this; + }; + + // TODO + PathProxy.prototype.arcTo = function (x1, y1, x2, y2, radius) { + if (this._ctx) { + this._ctx.arcTo(x1, y1, x2, y2, radius); + } + return this; + }; + + // TODO + PathProxy.prototype.rect = function (x, y, w, h) { + if (this._ctx) { + this._ctx.rect(x, y, w, h); + } + return this; + }; + + /** + * @return {PathProxy} + */ + PathProxy.prototype.closePath = function () { + this.pathCommands.push(new PathSegment('z')); + if (this._ctx) { + this._ctx.closePath(); + } + return this; + }; + + /** + * 是否没有Path命令 + * @return {boolean} + */ + PathProxy.prototype.isEmpty = function() { + return this.pathCommands.length === 0; + }; + + PathProxy.PathSegment = PathSegment; + + return PathProxy; }); -/** - * echarts地图一般投射算法 - * modify from GeoMap v0.5.3 https://github.com/x6doooo/GeoMap - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/util/projection/svg',['require','zrender/shape/Path'],function(require) { - - var PathShape = require('zrender/shape/Path'); - function toFloat(str) { - return parseFloat(str || 0); - } - - function getBbox(root) { - var svgNode = root.firstChild; - // Find the svg node - while (!(svgNode.nodeName.toLowerCase() == 'svg' && svgNode.nodeType == 1)) { - svgNode = svgNode.nextSibling; - } - - var x = toFloat(svgNode.getAttribute('x')); - var y = toFloat(svgNode.getAttribute('y')); - var width = toFloat(svgNode.getAttribute('width')); - var height = toFloat(svgNode.getAttribute('height')); - return { - left : x, - top : y, - width : width, - height : height - }; - } - - function geoJson2Path(root, transform) { - var scale = [transform.scale.x, transform.scale.y]; - var elList = []; - function _getShape(root) { - var tagName = root.tagName; - if (shapeBuilders[tagName]) { - var obj = shapeBuilders[tagName](root, scale); - - if (obj) { - // Common attributes - obj.scale = scale; - obj.properties = { - name : root.getAttribute('name') || '' - }; - obj.id = root.id; - extendCommonAttributes(obj, root); - - elList.push(obj); - } - } - var shapes = root.childNodes; - for (var i = 0, len = shapes.length; i < len; i++) { - _getShape(shapes[i]); - } - } - _getShape(root); - return elList; - } - - /** - * 平面坐标转经纬度 - * @param {Array} p - */ - function pos2geo(obj, p) { - var point = p instanceof Array ? [p[0] * 1, p[1] * 1] : [p.x * 1, p.y * 1]; - return [point[0] / obj.scale.x, point[1] / obj.scale.y]; - } - - /** - * 经纬度转平面坐标 - * @param {Array | Object} p - */ - function geo2pos(obj, p) { - var point = p instanceof Array ? [p[0] * 1, p[1] * 1] : [p.x * 1, p.y * 1]; - return [point[0] * obj.scale.x, point[1] * obj.scale.y]; - } - - function trim(str) { - return str.replace(/^\s\s*/, '').replace(/\s\s*$/, ''); - } - - function extendCommonAttributes(obj, xmlNode) { - - var color = xmlNode.getAttribute('fill'); - var strokeColor = xmlNode.getAttribute('stroke'); - var lineWidth = xmlNode.getAttribute('stroke-width'); - var opacity = xmlNode.getAttribute('opacity'); - - if (color && color != 'none') { - obj.color = color; - if (strokeColor) { - obj.brushType = 'both'; - obj.strokeColor = strokeColor; - } else { - obj.brushType = 'fill'; - } - } else if (strokeColor && strokeColor != 'none') { - obj.strokeColor = strokeColor; - obj.brushType = 'stroke'; - } - if (lineWidth && lineWidth != 'none') { - obj.lineWidth = parseFloat(lineWidth); - } - if (opacity && opacity != 'none') { - obj.opacity = parseFloat(opacity); - } - } - - function parsePoints(str) { - var list = trim(str).replace(/,/g, ' ').split(/\s+/); - var points = []; - - for (var i = 0; i < list.length;) { - var x = parseFloat(list[i++]); - var y = parseFloat(list[i++]); - points.push([x, y]); - } - return points; - } - - // Regular svg shapes - var shapeBuilders = { - path: function(xmlNode, scale) { - var path = xmlNode.getAttribute('d'); - var rect = PathShape.prototype.getRect({path : path}); - return { - shapeType: 'path', - path : path, - cp : [ - (rect.x + rect.width / 2) * scale[0], - (rect.y + rect.height / 2) * scale[1] - ] - }; - }, - - rect: function(xmlNode, scale) { - var x = toFloat(xmlNode.getAttribute('x')); - var y = toFloat(xmlNode.getAttribute('y')); - var width = toFloat(xmlNode.getAttribute('width')); - var height = toFloat(xmlNode.getAttribute('height')); - - return { - shapeType: 'rectangle', - x: x, - y: y, - width: width, - height: height, - cp : [ - (x + width / 2) * scale[0], - (y + height / 2) * scale[1] - ] - }; - }, - - line: function(xmlNode, scale) { - var x1 = toFloat(xmlNode.getAttribute('x1')); - var y1 = toFloat(xmlNode.getAttribute('y1')); - var x2 = toFloat(xmlNode.getAttribute('x2')); - var y2 = toFloat(xmlNode.getAttribute('y2')); - - return { - shapeType: 'line', - xStart: x1, - yStart: y1, - xEnd: x2, - yEnd: y2, - cp : [ - (x1 + x2) * 0.5 * scale[0], - (y1 + y2) * 0.5 * scale[1] - ] - }; - }, - - circle: function(xmlNode, scale) { - var cx = toFloat(xmlNode.getAttribute('cx')); - var cy = toFloat(xmlNode.getAttribute('cy')); - var r = toFloat(xmlNode.getAttribute('r')); - - return { - shapeType: 'circle', - x: cx, - y: cy, - r: r, - cp: [ - cx * scale[0], - cy * scale[1] - ] - }; - }, - - ellipse: function(xmlNode, scale) { - var cx = parseFloat(xmlNode.getAttribute('cx') || 0); - var cy = parseFloat(xmlNode.getAttribute('cy') || 0); - var rx = parseFloat(xmlNode.getAttribute('rx') || 0); - var ry = parseFloat(xmlNode.getAttribute('ry') || 0); - - return { - shapeType: 'ellipse', - x: cx, - y: cy, - a: rx, - b: ry, - cp: [ - cx * scale[0], - cy * scale[1] - ] - }; - }, - - polygon: function(xmlNode, scale) { - var points = xmlNode.getAttribute('points'); - var min = [Infinity, Infinity]; - var max = [-Infinity, -Infinity]; - if (points) { - points = parsePoints(points); - - for (var i = 0; i < points.length; i++) { - var p = points[i]; - - min[0] = Math.min(p[0], min[0]); - min[1] = Math.min(p[1], min[1]); - - max[0] = Math.max(p[0], max[0]); - max[1] = Math.max(p[1], max[1]); - - } - return { - shapeType: 'polygon', - pointList: points, - cp : [ - (min[0] + max[0]) / 2 * scale[0], - (min[1] + max[1]) / 2 * scale[0] - ] - }; - } - }, - - polyline: function(xmlNode, scale) { - var obj = shapeBuilders.polygon(xmlNode, scale); - return obj; - } - }; - - return { - getBbox : getBbox, - geoJson2Path : geoJson2Path, - pos2geo : pos2geo, - geo2pos : geo2pos - }; +/** + * @module echarts/util/shape/Ribbon + * @author pissang (https://github.com/pissang) + */ +/** + * @typedef {Object} IRibbonStyle + * @property {number} x + * @property {number} y + * @property {number} source0 + * @property {number} source1 + * @property {number} target0 + * @property {number} target1 + * @property {number} r + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ +define('echarts/util/shape/Ribbon',['require','zrender/shape/Base','zrender/shape/util/PathProxy','zrender/tool/util','zrender/tool/area'],function (require) { + var Base = require('zrender/shape/Base'); + var PathProxy = require('zrender/shape/util/PathProxy'); + var zrUtil = require('zrender/tool/util'); + var area = require('zrender/tool/area'); + + // var _ctx = zrUtil.getContext(); + + function RibbonShape(options) { + Base.call(this, options); + + this._pathProxy = new PathProxy(); + } + + RibbonShape.prototype = { + type : 'chord', + + // center, source0, source1, target0, target1, r + buildPath : function (ctx, style) { + + var path = this._pathProxy; + path.begin(ctx); + + var PI2 = Math.PI * 2; + var cx = style.x; + var cy = style.y; + var r = style.r; + var s0 = style.source0 / 180 * Math.PI; + var s1 = style.source1 / 180 * Math.PI; + var t0 = style.target0 / 180 * Math.PI; + var t1 = style.target1 / 180 * Math.PI; + var sx0 = cx + Math.cos(PI2 - s0) * r; + var sy0 = cy - Math.sin(PI2 - s0) * r; + var sx1 = cx + Math.cos(PI2 - s1) * r; + var sy1 = cy - Math.sin(PI2 - s1) * r; + var tx0 = cx + Math.cos(PI2 - t0) * r; + var ty0 = cy - Math.sin(PI2 - t0) * r; + var tx1 = cx + Math.cos(PI2 - t1) * r; + var ty1 = cy - Math.sin(PI2 - t1) * r; + + path.moveTo(sx0, sy0); + path.arc(cx, cy, style.r, s0, s1, false); + path.bezierCurveTo( + (cx - sx1) * 0.70 + sx1, + (cy - sy1) * 0.70 + sy1, + (cx - tx0) * 0.70 + tx0, + (cy - ty0) * 0.70 + ty0, + tx0, ty0 + ); + // Chord to self + if (style.source0 === style.target0 + && style.source1 === style.target1 + ) { + return; + } + path.arc(cx, cy, style.r, t0, t1, false); + path.bezierCurveTo( + (cx - tx1) * 0.70 + tx1, + (cy - ty1) * 0.70 + ty1, + (cx - sx0) * 0.70 + sx0, + (cy - sy0) * 0.70 + sy0, + sx0, sy0 + ); + }, + + getRect : function (style) { + if (style.__rect) { + return style.__rect; + } + if (!this._pathProxy.isEmpty()) { + this.buildPath(null, style); + } + return this._pathProxy.fastBoundingRect(); + }, + + isCover : function (x, y) { + var rect = this.getRect(this.style); + if (x >= rect.x + && x <= (rect.x + rect.width) + && y >= rect.y + && y <= (rect.y + rect.height) + ) { + return area.isInsidePath( + this._pathProxy.pathCommands, 0, 'fill', x, y + ); + } + } + }; + + zrUtil.inherits(RibbonShape, Base); + + return RibbonShape; +}); +define('echarts/util/kwargs',[],function (){ + function kwargs(func, defaults) { + /*jshint maxlen : 200*/ + var removeComments = new RegExp('(\\/\\*[\\w\\\'\\,\\(\\)\\s\\r\\n\\*]*\\*\\/)|(\\/\\/[\\w\\s\\\'][^\\n\\r]*$)|(\\/]*>)', 'gim'); + var removeWhitespc = new RegExp('\\s+', 'gim'); + var matchSignature = new RegExp('function.*?\\((.*?)\\)', 'i'); + // get the argument names from function source + var names = func.toString() + .replace(removeComments, '') + .replace(removeWhitespc, '') + .match(matchSignature)[1] + .split(','); + + // Check the existance of default, if not create an object + if(defaults !== Object(defaults)){ + defaults = {}; + } + + return function () { + var args = Array.prototype.slice.call(arguments); + var kwargs = args[args.length - 1]; + + // Check the existance of the kwargs + if (kwargs && kwargs.constructor === Object) { + args.pop(); + } + else{ + kwargs = {}; + } + + // Fill the arguments and apply them + for (var i = 0; i < names.length; i++) { + var name = names[i]; + if (name in kwargs) { + args[i] = kwargs[name]; + } + else if(name in defaults && args[i] == null){ + args[i] = defaults[name]; + } + } + + return func.apply(this, args); + }; + } + // As function prototype + // Function.prototype.kwargs = kwargs; + return kwargs; +}); +/** + * Numpy like n-dimensional array proccessing class + * http://docs.scipy.org/doc/numpy/reference/arrays.ndarray.html + * + * @author pissang (https://github.com/pissang/) + */ +define('echarts/util/ndarray',['require','./kwargs'],function (require) { + + + +var kwargs = require('./kwargs'); + +var ArraySlice = Array.prototype.slice; + +// Polyfill of Typed Array +this.Int32Array = window.Int32Array || Array; +this.Int16Array = window.Int16Array || Array; +this.Int8Array = window.Int8Array || Array; +this.Uint32Array = window.Uint32Array || Array; +this.Uint16Array = window.Uint16Array || Array; +this.Uint8Array = window.Uint8Array || Array; +this.Float32Array = window.Float32Array || Array; +this.Float64Array = window.Float64Array || Array; + +// Map of numpy dtype and typed array +// http://docs.scipy.org/doc/numpy/reference/arrays.dtypes.html#arrays-dtypes +// http://www.khronos.org/registry/typedarray/specs/latest/ +var ArrayConstructor = { + 'int32' : this.Int32Array, + 'int16' : this.Int16Array, + 'int8' : this.Int8Array, + 'uint32' : this.Uint32Array, + 'uint16' : this.Uint16Array, + 'uint8' : this.Uint8Array, + // 'uint8c' is not existed in numpy + 'uint8c' : this.Uint8ClampedArray, + 'float32' : this.Float32Array, + 'float64' : this.Float64Array, + 'number' : Array +}; + +var dTypeStrideMap = { + 'int32' : 4, + 'int16' : 2, + 'int8' : 1, + 'uint32' : 4, + 'uint16' : 2, + 'uint8' : 1, + 'uint8c' : 1, + 'float32' : 4, + 'float64' : 8, + // Consider array stride is 1 + 'number' : 1 +}; + +var E_ADD = 0; +var E_SUB = 1; +var E_MUL = 2; +var E_DIV = 3; +var E_MOD = 4; +var E_AND = 5; +var E_OR = 6; +var E_XOR = 7; +var E_EQL = 8; + +function guessDataType(arr) { + if (typeof(arr) === 'undefined') { + return 'number'; + } + switch(Object.prototype.toString.call(arr)) { + case '[object Int32Array]': + return 'int32'; + case '[object Int16Array]': + return 'int16'; + case '[object Int8Array]': + return 'int8'; + case '[object Uint32Array]': + return 'uint32'; + case '[object Uint16Array]': + return 'uint16'; + case '[object Uint8Array]': + return 'uint8'; + case '[object Uint8ClampedArray]': + return 'uint8c'; + case '[object Float32Array]': + return 'float32'; + case '[object Float64Array]': + return 'float64'; + default: + return 'number'; + } +} + +/** + * NDArray + * @param {Array|NDArray} array + * @param {String} dtype + */ +var NDArray = function (array) { + // Last argument describe the data type of ndarray + var dtype = arguments[arguments.length-1]; + if (typeof(dtype) == 'string') { + this._dtype = dtype; + } else { + // Normal array + this._dtype = guessDataType(array); + } + + if (array && typeof(array) !== 'string') { + if (array instanceof NDArray) { + array._dtype = this._dtype; + return array; + } else if (typeof(array.length) !== 'undefined') { + // Init from array + this.initFromArray(array); + } else if(typeof(array) === 'number') { + // Init from shape + this.initFromShape.apply(this, arguments); + } + } else { + /** + * _array + * Initialized with an empty array + * Data is continuous one-dimensional array, row-major + * A [2, 2] dim empty array is stored like + * [0,0, 0,0] + * TODO : Consider column majors ? + * @type {ArrayConstructor} + */ + this._array = new ArrayConstructor[this._dtype](); + /** + * _shape + * a tuple array describe the dimension and size of each dimension + * [10, 10] means a 10x10 array + * @type {Array} + */ + this._shape = [0]; + /** + * _size + * size of the storage array length + * @type {Number} + */ + this._size = 0; + } +}; + +NDArray.prototype = { + /** + * Initialize from a normal js array. + * + * @param {Array} input + * @return {NDArray} this + */ + initFromArray : function (input) { + var dim = getDimension(input); + var cursor = 0; + function flatten(axis, _out, _in) { + var len = _in.length; + for (var i = 0; i < len; i++) { + if (axis < dim-1) { + flatten(axis+1, _out, _in[i]); + } else { + _out[cursor++] = _in[i]; + } + } + } + var shape = getShape(input); + var size = getSize(shape); + this._array = new ArrayConstructor[this._dtype](size); + + flatten(0, this._array, input); + this._shape = shape; + this._size = size; + + return this; + }, + + /** + * Initialize from the given shape description. + * @param {Array} shape + * @return {NDArray} this + */ + initFromShape : function (shape) { + if (typeof(shape) == 'number') { + shape = Array.prototype.slice.call(arguments); + } + if(shape) { + var size = getSize(shape); + if (this._dtype === 'number') { + this._array = []; + var data = this._array; + for (var i = 0; i < size; i++) { + data[i] = 0; + } + } else { + this._array = new ArrayConstructor[this._dtype](size); + } + } + this._shape = shape; + this._size = getSize(shape); + + return this; + }, + /** + * Fill the array with the given value. + * @param {Number} value + * @return {NDArray} this + */ + fill : function (value) { + var data = this._array; + for (var i = 0; i < data.length; i++) { + data[i] = value; + } + return this; + }, + + /** + * Get ndarray shape copy. + * @return {Array} + */ + shape : function () { + // Create a copy + return this._shape.slice(); + }, + + /** + * Get array size + * @return {Number} + */ + size : function () { + return this._size; + }, + + /** + * Get array data type. + * 'int32' + * 'int16' + * 'int8' + * 'uint32' + * 'uint16' + * 'uint8' + * 'float32' + * 'float64' + * @return {String} + */ + dtype : function () { + return this._dtype; + }, + + /** + * Get array dimension. + * @return {[type]} [description] + */ + dimension : function () { + return this._shape.length; + }, + + /** + * Tuple of bytes to step in each dimension when traversing an array. + * @return {Array} + */ + strides : function () { + var strides = calculateDimStrides(this._shape); + var dTypeStride = dTypeStrideMap[this._dtype]; + for (var i = 0; i < strides.length; i++) { + strides[i] *= dTypeStride; + } + return strides; + }, + /** + * Gives a new shape to an array without changing its data. + * @param {Array} shape + * @return {NDArray} + */ + reshape : function (shape) { + if (typeof(shape) == 'number') { + shape = Array.prototype.slice.call(arguments); + } + if (this._isShapeValid(shape)) { + this._shape = shape; + } else { + throw new Error('Total size of new array must be unchanged'); + } + return this; + }, + + _isShapeValid : function (shape) { + return getSize(shape) === this._size; + }, + + /** + * Change shape and size of array in-place. + * @param {Array} shape + * @return {NDArray} + */ + resize : function (shape) { + if (typeof(shape) == 'number') { + shape = Array.prototype.slice.call(arguments); + } + + var len = getSize(shape); + if (len < this._size) { + if (this._dtype === 'number') { + this._array.length = len; + } + } else { + if (this._dtype === 'number') { + for (var i = this._array.length; i < len; i++) { + // Fill the rest with zero + this._array[i] = 0; + } + } else { + // Reallocate new buffer + var newArr = new ArrayConstructor[this._dtype](len); + var originArr = this._array; + + // Copy data + for (var i = 0; i < originArr.length; i++) { + newArr[i] = originArr[i]; + } + this._array = newArr; + } + } + this._shape = shape; + this._size = len; + + return this; + + }, + + /** + * Returns a new array with axes transposed. + * @param {Array} [axes] + * @param {NDArray} [out] + * @return {NDArray} + */ + transpose : kwargs(function (axes, out) { + var originAxes = []; + for (var i = 0; i < this._shape.length; i++) { + originAxes.push(i); + } + if (typeof(axes) === 'undefined') { + axes = originAxes.slice(); + } + // Check if any axis is out of bounds + for (var i = 0; i < axes.length; i++) { + if (axes[i] >= this._shape.length) { + throw new Error(axisOutofBoundsErrorMsg(axes[i])); + } + } + // Has no effect on 1-D transpose + if (axes.length <= 1) { + return this; + } + + var targetAxes = originAxes.slice(); + for (var i = 0; i < Math.floor(axes.length / 2); i++) { + for (var j = axes.length-1; j >= Math.ceil(axes.length / 2) ; j--) { + // Swap axes + targetAxes[axes[i]] = axes[j]; + targetAxes[axes[j]] = axes[i]; + } + } + + return this._transposelike(targetAxes, out); + + }), + + /** + * Return a new array with axis1 and axis2 interchanged. + * @param {Number} axis1 + * @param {Number} axis2 + * @param {NDArray} out + * @return {NDArray} + */ + swapaxes : kwargs(function (axis1, axis2, out) { + return this.transpose([axis1, axis2], out); + }), + + /** + * Roll the specified axis backwards, until it lies in a given position. + * @param {Number} axis + * @param {Number} [start=0] + * @param {NDArray} out + * @return {NDArray} + */ + rollaxis : kwargs(function (axis, start, out) { + if (axis >= this._shape.length) { + throw new Error(axisOutofBoundsErrorMsg(axis)); + } + + var axes = []; + for (var i = 0; i < this._shape.length; i++) { + axes.push(i); + } + axes.splice(axis, 1); + axes.splice(start, 0, axis); + + return this._transposelike(axes, out); + + }, { start : 0}), + + // Base function for transpose-like operations + _transposelike : function (axes, out) { + var source = this._array; + var shape = this._shape.slice(); + var strides = calculateDimStrides(this._shape); + var dim = shape.length; + + // Swap + var tmpStrides = []; + var tmpShape = []; + for (var i = 0; i < axes.length; i++) { + var axis = axes[i]; + // swap to target axis + tmpShape[i] = shape[axis]; + tmpStrides[i] = strides[axis]; + } + strides = tmpStrides; + shape = tmpShape; + + this._shape = shape; + var transposedStrides = calculateDimStrides(this._shape); + + if (!out) { + out = new NDArray(); + out._shape = this._shape.slice(); + out._dtype = this._dtype; + out._size = this._size; + } + // FIXME in-place transpose? + var transposedData = new ArrayConstructor[this._dtype](this._size); + out._array = transposedData; + // @param Item offset in current axis offset of the original array + // @param Item offset in current axis offset of the transposed array + function transpose(axis, offset, transposedOffset) { + var size = shape[axis]; + // strides in orginal array + var stride = strides[axis]; + // strides in transposed array + var transposedStride = transposedStrides[axis]; + + if (axis < dim-1) { + for (var i = 0; i < size; i++) { + transpose( + axis+1, + offset + stride * i, + transposedOffset + transposedStride * i + ); + } + } else { + for (var i = 0; i < size; i++) { + // offset + stride * i is the index of the original array + // transposedOffset + i is the index of the transposed array + transposedData[transposedOffset + i] + = source[offset + stride * i]; + } + } + } + + transpose(0, 0, 0); + + return out; + }, + + /** + * Repeat elements of an array along axis + * @param {Number} repeats + * The number of repetitions for each element. + * repeats is broadcasted to fit the shape of the given axis. + * @param {Number} [axis] + * The axis along which to repeat values. + * By default, use the flattened input array, + * and return a flat output array. + * @param {NDArray} [out] + * @return {NDArray} + */ + repeat : kwargs(function (repeats, axis, out) { + var shape; + // flattened input array + if (typeof(axis) === 'undefined') { + shape = [this._size]; + axis = 0; + } else { + shape = this._shape.slice(); + } + var originShape = shape.slice(); + + shape[axis] *= repeats; + if (!out) { + out = new NDArray(this._dtype); + out.initFromShape(shape); + } else { + if (!arrayEqual(shape, out._shape)) { + throw new Error(broadcastErrorMsg(shape, out._shape)); + } + } + var data = out._array; + + var stride = calculateDimStride(originShape, axis); + var axisSize = originShape[axis]; + var source = this._array; + + var offsetStride = stride * axisSize; + + for (var offset = 0; offset < this._size; offset+=offsetStride) { + for (var k = 0; k < stride; k++) { + var idx = offset + k; + var idxRepeated = offset * repeats + k; + for (var i = 0; i < axisSize; i++) { + for (var j = 0; j < repeats; j++) { + data[idxRepeated] = source[idx]; + idxRepeated += stride; + } + idx += stride; + } + } + } + + return out; + }), + + choose : function () { + console.warn('TODO'); + }, + + take : function () { + console.warn('TODO'); + }, + + tile : function () { + console.warn('TODO'); + }, + + /** + * Preprocess for array calculation + * max, min, argmax, argmin, sum, ptp, val, mean + * Which will reduce one axis if the axis is given + * + * @param {Number} axis + * @param {NDArray} out + * @param {Function} funcWithAxis + * @param {Function} funcFlatten + * @return {Number|NDArray} + */ + _withPreprocess1 : function (axis, out, funcWithAxis, funcFlatten) { + var source = this._array; + if (!this._size) { + return; + } + + if (typeof(axis)!=='undefined') { + if (axis < 0) { + axis = this._shape.length + axis; + } + if (axis >= this._shape.length || axis < 0) { + throw new Error(axisOutofBoundsErrorMsg(axis)); + } + + var shape = this._shape.slice(); + shape.splice(axis, 1); + if (out && !arrayEqual(shape, out._shape)) { + throw new Error(broadcastErrorMsg(shape, out._shape)); + } + + if (!out) { + out = new NDArray(this._dtype); + out.initFromShape(shape); + } + var data = out._array; + + var stride = calculateDimStride(this._shape, axis); + var axisSize = this._shape[axis]; + var offsetStride = stride * axisSize; + + funcWithAxis.call( + this, data, source, offsetStride, axisSize, stride + ); + + return out; + } else { + return funcFlatten.call(this, source); + } + }, + + /** + * Preprocess for array calculation cumsum, cumprod + * Which will keep the shape if axis is given + * and flatten if axis is undefined + * @param {Number} axis + * @param {NDArray} out + * @param {Function} funcWithAxis + * @param {Function} funcFlatten + * @return {NDArray} + */ + _withPreprocess2 : function (axis, out, funcWithAxis, funcFlatten) { + var source = this._array; + if (!this._size) { + return; + } + if (out && !arrayEqual(this._shape, out._shape)) { + throw new Error(broadcastErrorMsg(this._shape, out._shape)); + } + if (!out) { + out = new NDArray(this._dtype); + out.initFromShape(this._shape); + } + + var data = out._array; + + if (typeof(axis)!=='undefined') { + if (axis < 0) { + axis = this._shape.length + axis; + } + if (axis >= this._shape.length || axis < 0) { + throw new Error(axisOutofBoundsErrorMsg(axis)); + } + + if (axis >= this._shape.length) { + throw new Error(axisOutofBoundsErrorMsg(axis)); + } + + var stride = calculateDimStride(this._shape, axis); + var axisSize = this._shape[axis]; + var offsetStride = stride * axisSize; + + funcWithAxis.call( + this, data, source, offsetStride, axisSize, stride + ); + } else { + out.reshape([this._size]); + funcFlatten.call(this, data, source); + } + + return out; + }, + + /** + * Get the max value of ndarray + * If the axis is given, the max is only calculate in this dimension + * Example, for the given ndarray + * [[3, 9], + * [4, 8]] + * >>> max(0) + * [4, 9] + * >>> max(1) + * [9, 8] + * + * @param {Number} [axis] + * @param {NDArray} out + * @return {NDArray} + */ + max : kwargs((function () { + function withAxis(data, source, offsetStride, axisSize, stride) { + var cursor = 0; + for (var offset = 0; offset < this._size; offset+=offsetStride) { + for (var i = 0; i < stride; i++) { + var idx = i + offset; + var max = source[idx]; + for (var j = 0; j < axisSize; j++) { + var d = source[idx]; + if (d > max) { + max = d; + } + idx += stride; + } + data[cursor++] = max; + } + } + } + function withFlatten(source) { + var max = source[0]; + for (var i = 1; i < this._size; i++) { + if (source[i] > max) { + max = source[i]; + } + } + return max; + } + return function (axis, out) { + return this._withPreprocess1( + axis, out, + withAxis, withFlatten + ); + }; + })()), + + + /** + * Return the minimum of an array or minimum along an axis. + * @param {Number} [axis] + * @param {NDArray} out + * @return {NDArray} + */ + min : kwargs((function () { + function withAxis(data, source, offsetStride, axisSize, stride) { + var cursor = 0; + for (var offset = 0; offset < this._size; offset+=offsetStride) { + for (var i = 0; i < stride; i++) { + var idx = i + offset; + var min = source[idx]; + for (var j = 0; j < axisSize; j++) { + var d = source[idx]; + if (d < min) { + min = d; + } + idx += stride; + } + data[cursor++] = min; + } + } + } + function withFlatten(source) { + var min = source[0]; + for (var i = 1; i < this._size; i++) { + if (source[i] < min) { + min = source[i]; + } + } + return min; + } + return function (axis, out) { + return this._withPreprocess1( + axis, out, + withAxis, withFlatten + ); + }; + })()), + + /** + * Return indices of the maximum values along an axis. + * @param {Number} [axis] + * @param {NDArray} out + * @return {NDArray} + */ + argmax : kwargs((function () { + function withAxis(data, source, offsetStride, axisSize, stride) { + var cursor = 0; + for (var offset = 0; offset < this._size; offset+=offsetStride) { + for (var i = 0; i < stride; i++) { + var dataIdx = 0; + var idx = i + offset; + var max = source[idx]; + for (var j = 0; j < axisSize; j++) { + var d = source[idx]; + if (d > max) { + max = d; + dataIdx = j; + } + idx += stride; + } + data[cursor++] = dataIdx; + } + } + } + function withFlatten(source) { + var max = source[0]; + var idx = 0; + for (var i = 1; i < this._size; i++) { + if (source[i] > max) { + idx = i; + max = source[i]; + } + } + return idx; + } + return function (axis, out) { + return this._withPreprocess1( + axis, out, + withAxis, withFlatten + ); + }; + })()), + + /** + * Indices of the minimum values along an axis. + * @param {Number} [axis] + * @param {NDArray} out + * @return {NDArray} + */ + argmin : kwargs((function () { + function withAxis(data, source, offsetStride, axisSize, stride) { + var cursor = 0; + for (var offset = 0; offset < this._size; offset+=offsetStride) { + for (var i = 0; i < stride; i++) { + var dataIdx = 0; + var idx = i + offset; + var min = source[idx]; + for (var j = 0; j < axisSize; j++) { + var d = source[idx]; + if (d < min) { + min = d; + dataIdx = j; + } + idx += stride; + } + data[cursor++] = dataIdx; + } + } + } + function withFlatten(source) { + var min = source[0]; + var idx = 0; + for (var i = 1; i < this._size; i++) { + if (source[i] < min) { + idx = i; + min = source[i]; + } + } + return idx; + } + return function (axis, out) { + return this._withPreprocess1( + axis, out, + withAxis, withFlatten + ); + }; + })()), + + /** + * Return the sum of the array elements over the given axis. + * @param {Number} [axis] + * @param {NDArray} out + * @return {NDArray} + */ + sum : kwargs((function () { + function withAxis(data, source, offsetStride, axisSize, stride) { + var cursor = 0; + for (var offset = 0; offset < this._size; offset+=offsetStride) { + for (var i = 0; i < stride; i++) { + var sum = 0; + var idx = i + offset; + for (var j = 0; j < axisSize; j++) { + sum += source[idx]; + idx += stride; + } + data[cursor++] = sum; + } + } + } + function withFlatten(source) { + var sum = 0; + for (var i = 0; i < this._size; i++) { + sum += source[i]; + } + return sum; + } + return function (axis, out) { + return this._withPreprocess1( + axis, out, + withAxis, withFlatten + ); + }; + })()), + + /** + * Return the product of the array elements over the given axis. + * @param {Number} [axis] + * @param {NDArray} out + * @return {NDArray} + */ + prod : kwargs((function () { + function withAxis(data, source, offsetStride, axisSize, stride) { + var cursor = 0; + for (var offset = 0; offset < this._size; offset+=offsetStride) { + for (var i = 0; i < stride; i++) { + var prod = 1; + var idx = i + offset; + for (var j = 0; j < axisSize; j++) { + prod *= source[idx]; + idx += stride; + } + data[cursor++] = prod; + } + } + } + function withFlatten(source) { + var prod = 1; + for (var i = 0; i < this._size; i++) { + prod *= source[i]; + } + return prod; + } + return function (axis, out) { + return this._withPreprocess1( + axis, out, + withAxis, withFlatten + ); + }; + })()), + + /** + * Returns the average of the array elements along given axis. + * @param {Number} [axis] + * @param {NDArray} out + * @return {NDArray} + */ + mean : kwargs((function () { + function withAxis(data, source, offsetStride, axisSize, stride) { + var cursor = 0; + for (var offset = 0; offset < this._size; offset+=offsetStride) { + for (var i = 0; i < stride; i++) { + var sum = 0; + var idx = i + offset; + for (var j = 0; j < axisSize; j++) { + sum += source[idx]; + idx += stride; + } + var mean = sum / axisSize; + data[cursor++] = mean; + } + } + } + function withFlatten(source) { + var sum = 0; + var len = source.length; + for (var i = 0; i < len; i++) { + sum += source[i]; + } + var mean = sum / len; + return mean; + } + return function (axis, out) { + return this._withPreprocess1( + axis, out, + withAxis, withFlatten + ); + }; + })()), + + /** + * Return the variance of the array elements over the given axis. + * @param {Number} [axis] + * @param {NDArray} out + * @return {NDArray} + */ + 'var' : kwargs((function () { + function withAxis(data, source, offsetStride, axisSize, stride) { + var cursor = 0; + for (var offset = 0; offset < this._size; offset+=offsetStride) { + for (var i = 0; i < stride; i++) { + var sum = 0; + var idx = i + offset; + for (var j = 0; j < axisSize; j++) { + sum += source[idx]; + idx += stride; + } + var mean = sum / axisSize; + var moments = 0; + idx = i + offset; + for (var j = 0; j < axisSize; j++) { + var diff = source[idx] - mean; + moments += diff * diff; + idx += stride; + } + data[cursor++] = moments / axisSize; + } + } + } + function withFlatten(source) { + var sum = 0; + var len = source.length; + for (var i = 0; i < len; i++) { + sum += source[i]; + } + var mean = sum / len; + var moments = 0; + for (var i = 0; i < len; i++) { + var diff = source[i] - mean; + moments += diff * diff; + } + return moments / len; + } + return function (axis, out) { + return this._withPreprocess1( + axis, out, + withAxis, withFlatten + ); + }; + })()), + + /** + * Return the standard derivatione of the array elements + * over the given axis. + * @param {Number} [axis] + * @param {NDArray} out + * @return {NDArray} + */ + std : kwargs((function () { + function withAxis(data, source, offsetStride, axisSize, stride) { + var cursor = 0; + for (var offset = 0; offset < this._size; offset+=offsetStride) { + for (var i = 0; i < stride; i++) { + var sum = 0; + var idx = i + offset; + for (var j = 0; j < axisSize; j++) { + sum += source[idx]; + idx += stride; + } + var mean = sum / axisSize; + var moments = 0; + idx = i + offset; + for (var j = 0; j < axisSize; j++) { + var diff = source[idx] - mean; + moments += diff * diff; + idx += stride; + } + data[cursor++] = Math.sqrt(moments / axisSize); + } + } + } + function withFlatten(source) { + var sum = 0; + var len = source.length; + for (var i = 0; i < len; i++) { + sum += source[i]; + } + var mean = sum / len; + var moments = 0; + for (var i = 0; i < len; i++) { + var diff = source[i] - mean; + moments += diff * diff; + } + return Math.sqrt(moments / len); + } + return function (axis, out) { + return this._withPreprocess1( + axis, out, + withAxis, withFlatten + ); + }; + })()), + + /** + * Peak to peak (maximum - minimum) value along a given axis. + * @param {Number} [axis] + * @param {NDArray} out + * @return {NDArray} + */ + ptp : kwargs((function () { + function withAxis(data, source, offsetStride, axisSize, stride) { + var cursor = 0; + for (var offset = 0; offset < this._size; offset+=offsetStride) { + for (var i = 0; i < stride; i++) { + var idx = offset + i; + var min = source[idx]; + var max = source[idx]; + for (var j = 0; j < axisSize; j++) { + var d = source[idx]; + if (d < min) { + min = d; + } + if (d > max) { + max = d; + } + idx += stride; + } + data[cursor++] = max - min; + } + } + } + function withFlatten(source) { + var min = source[0]; + var max = source[0]; + for (var i = 1; i < this._size; i++) { + if (source[i] < min) { + min = source[i]; + } + if (source[i] > max) { + max = source[i]; + } + } + return max - min; + } + return function (axis, out) { + return this._withPreprocess1( + axis, out, + withAxis, withFlatten + ); + }; + })()), + + /** + * + * @param {Number} [axis=-1] + * @param {string} [order='ascending'] + * 'ascending' | 'descending' + * @return {NDArray} + */ + // FIXME : V8 is quick sort, firefox and safari is merge sort + // order : ascending or desc + sort : kwargs(function (axis, order) { + if (axis < 0) { + axis = this._shape.length + axis; + } + var compareFunc; + if (order === 'ascending') { + compareFunc = function (a, b) { + return a - b; + }; + } else if( order === 'descending') { + compareFunc = function (a, b) { + return b - a; + }; + } + + var source = this._array; + var stride = calculateDimStride(this._shape, axis); + var axisSize = this._shape[axis]; + + var offsetStride = stride * axisSize; + + var tmp = new Array(axisSize); + + for (var offset = 0; offset < this._size; offset+=offsetStride) { + + for (var i = 0; i < stride; i++) { + var idx = offset + i; + for (var j = 0; j < axisSize; j++) { + tmp[j] = source[idx]; + idx += stride; + } + tmp.sort(compareFunc); + var idx = offset + i; + // Copy back + for (var j = 0; j < axisSize; j++) { + source[idx] = tmp[j]; + idx += stride; + } + } + } + + return this; + + }, {axis : -1, order : 'ascending'}), + + /** + * + * @param {Number} [axis=-1] + * @param {string} [order='ascending'] + * 'ascending' | 'descending' + * @param {NDArray} [out] + * @return {NDArray} + */ + argsort : kwargs(function (axis, order, out) { + if (axis < 0) { + axis = this._shape.length + axis; + } + if (!this._size) { + return; + } + if (out && !arrayEqual(this._shape, out._shape)) { + throw new Error(broadcastErrorMsg(this._shape, out._shape)); + } + if (!out) { + out = new NDArray(this._dtype); + out.initFromShape(this._shape); + } + var data = out._array; + + var compareFunc; + if (order === 'ascending') { + compareFunc = function (a, b) { + return tmp[a] - tmp[b]; + }; + } else if( order === 'descending') { + compareFunc = function (a, b) { + return tmp[b] - tmp[a]; + }; + } + + var source = this._array; + var stride = calculateDimStride(this._shape, axis); + var axisSize = this._shape[axis]; + var offsetStride = stride * axisSize; + + var tmp = new Array(axisSize); + var indexList = new Array(axisSize); + + for (var offset = 0; offset < this._size; offset+=offsetStride) { + for (var i = 0; i < stride; i++) { + var idx = offset + i; + for (var j = 0; j < axisSize; j++) { + tmp[j] = source[idx]; + indexList[j] = j; + idx += stride; + } + indexList.sort(compareFunc); + // Copy back + var idx = offset + i; + for (var j = 0; j < axisSize; j++) { + data[idx] = indexList[j]; + idx += stride; + } + } + } + + return out; + + }, {axis : -1, order : 'ascending'}), + + /** + * Return the cumulative sum of the elements along the given axis. + * @param {Number} [axis] + * @param {NDArray} out + * @return {NDArray} + */ + cumsum : kwargs((function () { + function withAxis(data, source, offsetStride, axisSize, stride) { + for (var offset = 0; offset < this._size; offset+=offsetStride) { + for (var i = 0; i < stride; i++) { + var idx = offset + i; + var prevIdx = idx; + data[idx] = source[idx]; + for (var j = 1; j < axisSize; j++) { + prevIdx = idx; + idx += stride; + data[idx] = data[prevIdx] + source[idx]; + } + + } + } + } + function withFlatten(data, source) { + data[0] = source[0]; + for (var i = 1; i < data.length; i++) { + data[i] = data[i-1] + source[i]; + } + } + return function (axis, out) { + return this._withPreprocess2( + axis, out, + withAxis, withFlatten + ); + }; + })()), + + /** + * Return the cumulative product of the elements along the given axis. + * @param {Number} [axis] + * @param {NDArray} out + * @return {NDArray} + */ + cumprod : kwargs((function () { + function withAxis(data, source, offsetStride, axisSize, stride) { + for (var offset = 0; offset < this._size; offset+=offsetStride) { + for (var i = 0; i < stride; i++) { + var idx = offset + i; + var prevIdx = idx; + data[idx] = source[idx]; + for (var j = 1; j < axisSize; j++) { + prevIdx = idx; + idx += stride; + data[idx] = data[prevIdx] * source[idx]; + } + + } + } + } + function withFlatten(data, source) { + data[0] = source[0]; + for (var i = 1; i < data.length; i++) { + data[i] = data[i-1] * source[i]; + } + } + return function (axis, out) { + return this._withPreprocess2( + axis, out, + withAxis, withFlatten + ); + }; + })()), + + /** + * Dot product of two arrays. + * + * @param {NDArray|Number} b + * @param {NDArray} [out] + * @return {NDArray|Number} + */ + dot : function () { + console.warn('TODO'); + }, + + /** + * Mapped to region [min, max] + * @param {Number} mappedMin + * @param {Number} mappedMax + */ + map : function (mappedMin, mappedMax) { + var input = this._array; + var output = this._array; + + var min = input[0]; + var max = input[0]; + var l = this._size; + for (var i = 1; i < l; i++) { + var val = input[i]; + if (val < min) { + min = val; + } + if (val > max) { + max = val; + } + } + var range = max - min; + var mappedRange = mappedMax - mappedMin; + for (var i = 0; i < l; i++) { + if (range === 0) { + output[i] = mappedMin; + } else { + var val = input[i]; + var percent = (val - min) / range; + output[i] = mappedRange * percent + mappedMin; + } + } + return this; + }, + + /** + * Add + */ + add : function (rightOperand, out) { + return this.binaryOperation( + this, rightOperand, E_ADD, out + ); + }, + + /** + * Substract + */ + sub : function (rightOperand, out) { + return this.binaryOperation( + this, rightOperand, E_SUB, out + ); + }, + + /** + * Multiply + */ + mul : function (rightOperand, out) { + return this.binaryOperation( + this, rightOperand, E_MUL, out + ); + }, + + /** + * Divide + */ + div : function (rightOperand, out) { + return this.binaryOperation( + this, rightOperand, E_DIV, out + ); + }, + /** + * mod + */ + mod : function (rightOperand, out) { + return this.binaryOperation( + this, rightOperand, E_MOD, out + ); + }, + /** + * and + */ + and : function (rightOperand, out) { + return this.binaryOperation( + this, rightOperand, E_AND, out + ); + }, + /** + * or + */ + or : function (rightOperand, out) { + return this.binaryOperation( + this, rightOperand, E_OR, out + ); + }, + /** + * xor + */ + xor : function (rightOperand, out) { + return this.binaryOperation( + this, rightOperand, E_XOR, out + ); + }, + /** + * equal + */ + equal : function (rightOperand, out) { + return this.binaryOperation( + this, rightOperand, E_EQL, out + ); + }, + + binaryOperation : function (lo, ro, op, out) { + // Broadcasting + // http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html + var shape = []; + var isLoScalar = typeof(lo) === 'number'; + var isRoScalar = typeof(ro) === 'number'; + if (isLoScalar) { + shape = ro._shape.slice(); + } else if (isRoScalar) { + shape = lo._shape.slice(); + } else { + // Starts with the trailing dimensions + var cl = lo._shape.length-1; + var cr = ro._shape.length-1; + var loBroadCasted = lo; + var roBroadCasted = ro; + while (cl >= 0 && cr >= 0) { + if (lo._shape[cl] == 1) { + shape.unshift(ro._shape[cr]); + loBroadCasted = lo.repeat(ro._shape[cr], cl); + } else if(ro._shape[cr] == 1) { + shape.unshift(lo._shape[cl]); + roBroadCasted = ro.repeat(lo._shape[cl], cr); + } else if(ro._shape[cr] == lo._shape[cl]) { + shape.unshift(lo._shape[cl]); + } else { + throw new Error(broadcastErrorMsg(lo._shape, ro._shape)); + } + cl --; + cr --; + } + for (var i = cl; i >= 0; i--) { + shape.unshift(lo._shape[i]); + } + for (var i = cr; i >= 0; i--) { + shape.unshift(ro._shape[i]); + } + lo = loBroadCasted; + ro = roBroadCasted; + } + if (!out) { + out = new NDArray(this._dtype); + out.initFromShape(shape); + } else { + if (! arrayEqual(shape, out._shape)) { + throw new Error(broadcastErrorMsg(shape, out._shape)); + } + } + var outData = out._array; + + var diffAxis; + var isLoLarger; + var loData; + var roData; + if (isLoScalar) { + diffAxis = ro._shape.length-1; + isLoLarger = false; + loData = lo; + roData = ro._array; + } else if(isRoScalar) { + diffAxis = lo._shape.length-1; + isLoLarger = true; + roData = ro; + loData = lo._array; + } else { + diffAxis = Math.abs(lo._shape.length - ro._shape.length); + isLoLarger = lo._shape.length >= ro._shape.length; + loData = lo._array; + roData = ro._array; + } + var stride = calculateDimStride(shape, diffAxis); + var axisSize = shape[diffAxis]; + + var offsetStride = stride * axisSize; + var offsetRepeats = out._size / offsetStride; + + var _a, _b, res; + var idx = 0; + if (isLoLarger) { + if(isRoScalar) { + for (var c = 0; c < offsetRepeats; c++) { + for (var i = 0; i < offsetStride; i++) { + _a = loData[idx]; _b = roData; + switch (op) { + case E_ADD: res = _a + _b; break; + case E_SUB: res = _a - _b; break; + case E_MUL: res = _a * _b; break; + case E_DIV: res = _a / _b; break; + case E_MOD: res = _a % _b; break; + case E_AND: res = _a & _b; break; + case E_OR: res = _a | _b; break; + case E_XOR: res = _a ^ _b; break; + case E_EQL: res = _a == _b; break; + default: throw new Error('Unkown operation ' + op); + } + outData[idx] = res; + idx ++; + } + } + } else { + for (var c = 0; c < offsetRepeats; c++) { + for (var i = 0; i < offsetStride; i++) { + _a = loData[idx]; _b = roData[i]; + switch (op) { + case E_ADD: res = _a + _b; break; + case E_SUB: res = _a - _b; break; + case E_MUL: res = _a * _b; break; + case E_DIV: res = _a / _b; break; + case E_MOD: res = _a % _b; break; + case E_AND: res = _a & _b; break; + case E_OR: res = _a | _b; break; + case E_XOR: res = _a ^ _b; break; + case E_EQL: res = _a == _b; break; + default: throw new Error('Unkown operation ' + op); + } + outData[idx] = res; + idx ++; + } + } + } + } else { + if (isLoScalar) { + for (var c = 0; c < offsetRepeats; c++) { + for (var i = 0; i < offsetStride; i++) { + _a = loData; _b = roData[idx]; + switch (op) { + case E_ADD: res = _a + _b; break; + case E_SUB: res = _a - _b; break; + case E_MUL: res = _a * _b; break; + case E_DIV: res = _a / _b; break; + case E_MOD: res = _a % _b; break; + case E_AND: res = _a & _b; break; + case E_OR: res = _a | _b; break; + case E_XOR: res = _a ^ _b; break; + case E_EQL: res = _a == _b; break; + default: throw new Error('Unkown operation ' + op); + } + outData[idx] = res; + idx ++; + } + } + } else { + for (var c = 0; c < offsetRepeats; c++) { + for (var i = 0; i < offsetStride; i++) { + _a = loData[idx]; _b = roData[i]; + switch (op) { + case E_ADD: res = _a + _b; break; + case E_SUB: res = _a - _b; break; + case E_MUL: res = _a * _b; break; + case E_DIV: res = _a / _b; break; + case E_MOD: res = _a % _b; break; + case E_AND: res = _a & _b; break; + case E_OR: res = _a | _b; break; + case E_XOR: res = _a ^ _b; break; + case E_EQL: res = _a == _b; break; + default: throw new Error('Unkown operation ' + op); + } + outData[idx] = res; + idx ++; + } + } + } + } + return out; + }, + + /** + * negtive + */ + neg : function () { + var data = this._array; + for (var i = 0; i < this._size; i++) { + data[i] = -data[i]; + } + return this; + }, + + /** + * @return {NDArray} this + */ + sin : function () { + return this._mathAdapter(Math.sin); + }, + + /** + * @return {NDArray} this + */ + cos : function () { + return this._mathAdapter(Math.cos); + }, + + /** + * @return {NDArray} this + */ + tan : function () { + return this._mathAdapter(Math.tan); + }, + + /** + * @return {NDArray} this + */ + abs : function () { + return this._mathAdapter(Math.abs); + }, + + /** + * @return {NDArray} this + */ + log : function () { + return this._mathAdapter(Math.log); + }, + + /** + * @return {NDArray} this + */ + sqrt : function () { + return this._mathAdapter(Math.sqrt); + }, + + /** + * @return {NDArray} this + */ + ceil : function () { + return this._mathAdapter(Math.ceil); + }, + + /** + * @return {NDArray} this + */ + floor : function () { + return this._mathAdapter(Math.floor); + }, + + /** + * @return {NDArray} this + */ + pow : function (exp) { + var data = this._array; + for (var i = 0; i < this._size; i++) { + data[i] = Math.pow(data[i], exp); + } + return this; + }, + + _mathAdapter : function (mathFunc) { + var data = this._array; + for (var i = 0; i < this._size; i++) { + data[i] = mathFunc(data[i]); + } + return this; + }, + + /** + * @param {Number} decimals + * @return {NDArray} this + */ + round : function (decimals) { + decimals = Math.floor(decimals || 0); + var offset = Math.pow(10, decimals); + var data = this._array; + if (decimals === 0) { + for (var i = 0; i < this._size; i++) { + data[i] = Math.round(data[i]); + } + } else { + for (var i = 0; i < this._size; i++) { + data[i] = Math.round(data[i] * offset) / offset; + } + } + return this; + }, + /** + * @param {Number} min + * @param {Number} max + * Clip to [min, max] + */ + clip : function (min, max) { + // TODO : Support array_like param + var data = this._array; + for (var i = 0; i < this._size; i++) { + data[i] = Math.max(Math.min(data[i], max), min); + } + return this; + }, + + /** + * Indexing array, support range indexing + * @param {string} index + * Index syntax can be an integer 1, 2, 3 + * Or more complex range indexing + * '1:2' + * '1:2, 1:2' + * '1:2, :' + * More about the indexing syntax can check the doc of numpy ndarray + * @param {NDArray} [out] + * @return {NDArray} New created sub array, or out if given + */ + get : function (index, out) { + if (typeof(index) == 'number') { + index = index.toString(); + } + var strides = calculateDimStrides(this._shape); + var res = this._parseRanges(index); + var ranges = res[0]; + var shape = res[1]; + + if (ranges.length > this._shape.length) { + throw new Error('Too many indices'); + } + // Get data + var len = ranges.length; + var data; + if (shape.length) { + out = new NDArray(this._dtype); + out.initFromShape(shape); + data = out._array; + } else { + data = []; + } + + var source = this._array; + var cursor = 0; + function getPiece(axis, offset) { + var range = ranges[axis]; + var stride = strides[axis]; + if (axis < len-1) { + if (range[2] > 0) { + for (var i = range[0]; i < range[1]; i += range[2]) { + getPiece(axis+1, offset + stride * i); + } + } else { + for (var i = range[0]; i > range[1]; i += range[2]) { + getPiece(axis+1, offset + stride * i); + } + } + } else { + if (range[2] > 0) { + for (var i = range[0]; i < range[1]; i += range[2]) { + for (var j = 0; j < stride; j++) { + data[cursor++] = source[i*stride + j + offset]; + } + } + } else { + for (var i = range[0]; i > range[1]; i += range[2]) { + for (var j = 0; j < stride; j++) { + data[cursor++] = source[i*stride + j + offset]; + } + } + } + } + } + + getPiece(0, 0); + + if (shape.length) { + // Return scalar + return out; + } else { + return data[0]; + } + + }, + + /** + * + * @param {string} index + * index syntax can be an integer 1, 2, 3 + * Or more complex range indexing + * '1:2' + * '1:2, 1:2' + * '1:2, :' + * More about the indexing syntax can check the doc of numpy ndarray + * @param {NDArray} ndarray Ndarray data source + * @return {NDArray} this + */ + set : function (index, narray) { + if (typeof(index) == 'number') { + index = index.toString(); + } + var strides = calculateDimStrides(this._shape); + var res = this._parseRanges(index); + var ranges = res[0]; + var shape = res[1]; + + if (ranges.length > this._shape.length) { + throw new Error('Too many indices'); + } + var isScalar = typeof(narray) == 'number'; + var len = ranges.length; + var data = this._array; + if (isScalar) { + // Set with a single scalar + var source = narray; + } else { + if (!arrayEqual(shape, narray.shape())) { + throw new Error(broadcastErrorMsg(shape, narray.shape())); + } + var source = narray._array; + } + var cursor = 0; + var setPiece = function (axis, offset) { + var range = ranges[axis]; + var stride = strides[axis]; + if (axis < len-1) { + if (range[2] > 0) { + for (var i = range[0]; i < range[1]; i += range[2]) { + setPiece(axis+1, offset + stride * i); + } + } else { + for (var i = range[0]; i > range[1]; i += range[2]) { + setPiece(axis+1, offset + stride * i); + } + } + } else { + if (range[2] > 0) { + for (var i = range[0]; i < range[1]; i += range[2]) { + for (var j = 0; j < stride; j++) { + if (isScalar) { + data[i*stride + j + offset] = source; + } else { + data[i*stride + j + offset] = source[cursor++]; + } + } + } + } else { + for (var i = range[0]; i > range[1]; i += range[2]) { + for (var j = 0; j < stride; j++) { + if (isScalar) { + data[i*stride + j + offset] = source; + } else { + data[i*stride + j + offset] = source[cursor++]; + } + } + } + } + } + }; + + setPiece(0, 0); + + return this; + }, + + /** + * Insert values along the given axis before the given indices. + * @param {Number|Array} obj + * Object that defines the index or indices before + * which values is inserted. + * @param {Number|Array|NDArray} values + * Values to insert + * @param {Number} [axis] + * @return {NDArray} this + */ + insert : kwargs(function (obj, values, axis) { + var data = this._array; + var isObjScalar = false; + if (typeof(obj) === 'number') { + obj = [obj]; + isObjScalar = true; + } + if (typeof(values) === 'number') { + values = new NDArray([values]); + } else if (values instanceof Array) { + values = new NDArray(values); + } + + if (typeof(axis) === 'undefined') { + this._shape = [this._size]; + axis = 0; + } + // Checking if indices is valid + var prev = obj[0]; + var axisSize = this._shape[axis]; + for (var i = 0; i < obj.length; i++) { + if (obj[i] < 0) { + obj[i] = axisSize + obj[i]; + } + if (obj[i] > axisSize) { + throw new Error(indexOutofBoundsErrorMsg(obj[i])); + } + if (obj[i] < prev) { + throw new Error('Index must be in ascending order'); + } + prev = obj[i]; + } + // Broadcasting + var targetShape = this._shape.slice(); + if (isObjScalar) { + targetShape.splice(axis, 1); + } else { + targetShape[axis] = obj.length; + } + + var sourceShape = values._shape; + var cs = sourceShape.length - 1; + var ct = targetShape.length - 1; + + var valueBroadcasted = values; + while (cs >= 0 && ct >= 0) { + if (sourceShape[cs] === 1) { + valueBroadcasted = values.repeat(targetShape[ct], cs); + } else if(sourceShape[cs] !== targetShape[ct]) { + throw new Error(broadcastErrorMsg(sourceShape, targetShape)); + } + cs --; + ct --; + } + values = valueBroadcasted; + + // Calculate indices to insert + var stride = calculateDimStride(this._shape, axis); + var axisSize = this._shape[axis]; + var offsetStride = axisSize * stride; + var offsetRepeats = this._size / offsetStride; + + var objLen = obj.length; + var indices = new Uint32Array(offsetRepeats * objLen); + + var cursor = 0; + for (var offset = 0; offset < this._size; offset += offsetStride) { + for (var i = 0; i < objLen; i++) { + var objIdx = obj[i]; + indices[cursor++] = offset + objIdx * stride; + } + } + + var resShape = this._shape.slice(); + resShape[axis] += obj.length; + var resSize = getSize(resShape); + if (this._array.length < resSize) { + var data = new ArrayConstructor[this._dtype](resSize); + } else { + var data = this._array; + } + var source = this._array; + var valuesArr = values._array; + + var idxCursor = indices.length - 1; + var end = this._size; + var start = indices[idxCursor]; + var dataCursor = resSize - 1; + var valueCursor = values._size - 1; + while (idxCursor >= 0) { + // Copy source data; + for (var i = end - 1; i >= start; i--) { + data[dataCursor--] = source[i]; + } + end = start; + start = indices[--idxCursor]; + // Copy inserted data; + for (var i = 0; i < stride; i++) { + if (valueCursor < 0) { + valueCursor = values._size - 1; + } + data[dataCursor--] = valuesArr[valueCursor--]; + } + } + // Copy the rest + for (var i = end - 1; i >= 0; i--) { + data[dataCursor--] = source[i]; + } + + this._array = data; + this._shape = resShape; + this._size = resSize; + + return this; + }), + + append : function () { + console.warn('TODO'); + }, + + /** + * Delete values along the axis + * @param {Array|Number} obj + * @param {Number} [axis] + * @return {NDArray} this + */ + 'delete' : kwargs(function (obj, axis) { + var data = this._array; + if (typeof(obj) === 'number') { + obj = [obj]; + } + var size = this._size; + + if (typeof(axis) === 'undefined') { + this._shape = [size]; + axis = 0; + } + + var stride = calculateDimStride(this._shape, axis); + var axisSize = this._shape[axis]; + + var offsetStride = stride * axisSize; + var cursor = 0; + for (var offset = 0; offset < size; offset += offsetStride) { + var start = 0; + var end = obj[0]; + var objCursor = 0; + while(objCursor < obj.length) { + if (end < 0) { + end = end + axisSize; + } + if (end > axisSize) { + throw new Error(indexOutofBoundsErrorMsg(end)); + } + if (end < start) { + throw new Error('Index must be in ascending order'); + } + for (var i = start; i < end; i++) { + for (var j = 0; j < stride; j++) { + data[cursor++] = data[i * stride + j + offset]; + } + } + start = end + 1; + end = obj[++objCursor]; + } + // Copy the rest + for (var i = start; i < axisSize; i++) { + for (var j = 0; j < stride; j++) { + data[cursor++] = data[i * stride + j + offset]; + } + } + } + this._shape[axis] -= obj.length; + this._size = getSize(this._shape); + + return this; + }), + + _parseRanges : function (index) { + var rangesStr = index.split(/\s*,\s*/); + + // Parse range of each axis + var ranges = []; + var shape = []; + var j = 0; + for (var i = 0; i < rangesStr.length; i++) { + if (rangesStr[i] === '...') { + var end = this._shape.length - (rangesStr.length - i); + while (j <= end) { + ranges.push([0, this._shape[j], 1]); + shape.push(this._shape[j]); + j++; + } + } else { + var range = parseRange(rangesStr[i], this._shape[j]); + ranges.push(range); + if(rangesStr[i].indexOf(':') >= 0) { + var size = Math.floor((range[1] - range[0]) / range[2]); + size = size < 0 ? 0 : size; + // Get a range not a item + shape.push(size); + } + j++; + } + } + // Copy the lower dimension size + for (; j < this._shape.length; j++) { + shape.push(this._shape[j]); + } + + return [ranges, shape]; + }, + + /** + * Export normal js array + * @return {Array} + */ + toArray : function () { + var data = this._array; + var cursor = 0; + + var shape = this._shape; + var dim = shape.length; + + function create(axis, out) { + var len = shape[axis]; + for (var i = 0; i < len; i++) { + if (axis < dim-1) { + create(axis+1, out[i] = []); + } else { + out[i] = data[cursor++]; + } + } + } + + var output = []; + create(0, output); + + return output; + }, + + /** + * Create a copy of self + * @return {NDArray} + */ + copy : function () { + var numArr = new NDArray(); + numArr._array = ArraySlice.call(this._array); + numArr._shape = this._shape.slice(); + numArr._dtype = this._dtype; + numArr._size = this._size; + + return numArr; + }, + + constructor : NDArray +}; + +/** + * + * @param {Number} [min=0] + * @param {Number} max + * @param {Number} [step=1] + * @param {string} [dtype] + * @return {NDArray} + */ +NDArray.range = kwargs(function (min, max, step, dtype) { + var args = ArraySlice.call(arguments); + // Last argument describe the data type of ndarray + var lastArg = args[args.length-1]; + if (typeof(lastArg) == 'string') { + var dtype = lastArg; + args.pop(); + } + if (args.length === 1) { + max = args[0]; + step = 1; + min = 0; + } else if(args.length == 2) { + step = 1; + } + dtype = dtype || 'number'; + + var array = new ArrayConstructor[dtype](Math.ceil((max - min)/step)); + var cursor = 0; + for (var i = min; i < max; i+=step) { + array[cursor++] = i; + } + var ndarray = new NDArray(); + ndarray._array = array; + ndarray._shape = [array.length]; + ndarray._dtype = dtype; + ndarray._size = array.length; + + return ndarray; + +}); + +/** + * + * @param {Array} shape + * @param {String} [dtype] + * @return {NDArray} + */ +NDArray.zeros = kwargs(function (shape, dtype) { + var ret = new NDArray(dtype); + ret.initFromShape(shape); + return ret; +}); + +/** + * Python like array indexing + * http://www.python.org/dev/peps/pep-0204/ + * + * @param {string} index + * index can be a simple integer 1,2,3, + * or a range 2:10, 2:10:1 + * example : + * 2:10 => [2, 10, 1], + * 10:2:-2 => [10, 2, -2], + * : => [0, dimSize, 1], + * ::-1 => [dimSize-1, -1, -1], + * @param {number} dimSize + * @return {Array} a tuple array [startOffset, endOffset, sliceStep] + */ +function parseRange(index, dimSize) { + if (index.indexOf(':') >= 0) { + // Range indexing; + var res = index.split(/\s*:\s*/); + + var step = parseInt(res[2] || 1, 10); + var start, end; + if (step === 0) { + throw new Error('Slice step cannot be zero'); + } + else if (step > 0) { + start = parseInt(res[0] || 0, 10); + end = parseInt(res[1] || dimSize, 10); + } + else { + start = parseInt(res[0] || dimSize - 1, 10); + end = parseInt(res[1] || -1, 10); + } + // Negtive offset + if (start < 0) { + start = dimSize + start; + } + // Negtive offset + if (end < 0 && res[1]) { + end = dimSize + end; + } + if (step > 0) { + // Clamp to [0-dimSize] + start = Math.max(Math.min(dimSize, start), 0); + // Clamp to [0-dimSize] + end = Math.max(Math.min(dimSize, end), 0); + } else { + // Clamp to [0-dimSize) + start = Math.max(Math.min(dimSize-1, start), -1); + // Clamp to [0-dimSize) + end = Math.max(Math.min(dimSize-1, end), -1); + } + return [start, end, step]; + } else { + var start = parseInt(index, 10); + // Negtive offset + if (start < 0) { + start = dimSize + start; + } + if (start < 0 || start > dimSize) { + throw new Error(indexOutofBoundsErrorMsg(index)); + } + // Clamp to [0-dimSize) + start = Math.max(Math.min(dimSize-1, start), 0); + return [start, start+1, 1]; + } +} + +function getSize(shape) { + var size = shape[0]; + for (var i = 1; i < shape.length; i++) { + size *= shape[i]; + } + return size; +} + +function getDimension(array) { + var dim = 1; + var el = array[0]; + while (el instanceof Array) { + el = el[0]; + dim ++; + } + return dim; +} + +function getShape(array) { + var shape = [array.length]; + var el = array[0]; + while (el instanceof Array) { + shape.push(el.length); + el = el[0]; + } + return shape; +} + +function calculateDimStride(shape, axis) { + if (axis == shape.length-1) { + return 1; + } + var stride = shape[axis+1]; + for (var i = axis+2; i < shape.length; i++) { + stride *= shape[i]; + } + return stride; +} + +function calculateDimStrides(shape) { + // Calculate stride of each axis + var strides = []; + var tmp = 1; + var len = getSize(shape); + for (var i = 0; i < shape.length; i++) { + tmp *= shape[i]; + strides.push(len / tmp); + } + + return strides; +} + +function arrayEqual(arr1, arr2) { + if (arr1.length !== arr2.length) { + return false; + } + for (var i = 0; i 0) { + sector.style.brushType = 'both'; + } + if (sector.highlightStyle.lineWidth > 0) { + sector.highlightStyle.brushType = 'both'; + } + ecData.pack( + sector, + this.chordSeries[0], + 0, + data[i], i, + group.name + ); + if (showLabel) { + var halfAngle = [_start + _end] / 2; + halfAngle %= 360; // Constrain to [0,360] + var isRightSide = halfAngle <= 90 + || halfAngle >= 270; + halfAngle = halfAngle * Math.PI / 180; + var v = [Math.cos(halfAngle), -Math.sin(halfAngle)]; + + var distance = this.showScaleText ? 35 + labelDistance : labelDistance; + var start = vec2.scale([], v, this.outerRadius + distance); + vec2.add(start, start, this.center); + + var labelShape = { + zlevel: this._zlevelBase - 1, + hoverable: false, + style: { + text: group.name, + textAlign: isRightSide ? 'left' : 'right', + color: labelColor + } + }; + if (rotateLabel) { + labelShape.rotation = isRightSide ? halfAngle : Math.PI + halfAngle; + if (isRightSide) { + labelShape.style.x = this.outerRadius + distance; + } else { + labelShape.style.x = -this.outerRadius - distance; + } + labelShape.style.y = 0; + labelShape.position = this.center; + } else { + labelShape.style.x = start[0]; + labelShape.style.y = start[1]; + } + labelShape.style.textColor = this.deepQuery( + [group, this.chordSerieSample], + 'itemStyle.normal.label.textStyle.color' + ) || '#fff'; + labelShape.style.textFont = this.getFont(this.deepQuery( + [group, this.chordSerieSample], + 'itemStyle.normal.label.textStyle' + )); + labelShape = new TextShape(labelShape); + this.shapeList.push(labelShape); + } + + sector.onmouseover = createMouseOver(i); + sector.onmouseout = createMouseOut(); + + sector = new SectorShape(sector); + this.shapeList.push(sector); + this.sectorShapes.push(sector); + } + }, + + _buildChords : function (angles, dataArr) { + var len = angles.length; + if (!len) { + return; + } + var len2 = angles[0][0].length; + + var ribbonLineStyle + = this.chordSerieSample.itemStyle.normal.chordStyle.lineStyle; + var ribbonLineStyleEmphsis + = this.chordSerieSample.itemStyle.emphasis.chordStyle.lineStyle; + + for (var i = 0; i < len; i++) { + for (var j = 0; j < len; j++) { + for (var k = 0; k < len2; k++) { + if (this.chordShapes[j][i][k]) { + continue; + } + + var angleIJ0 = angles[i][j][k][0]; + var angleJI0 = angles[j][i][k][0]; + + var angleIJ1 = angles[i][j][k][1]; + var angleJI1 = angles[j][i][k][1]; + + if ( + angleIJ0 - angleJI1 === 0 + || angleJI0 - angleJI1 === 0 + ) { + this.chordShapes[i][j][k] = null; + continue; + } + + var color; + if (len2 === 1) { + if (angleIJ1 - angleIJ0 <= angleJI1 - angleJI0) { + color = this.getColor(this.groups[i].name); + } else { + color = this.getColor(this.groups[j].name); + } + } else { + color = this.getColor(this.chordSeries[k].name); + } + var s0 = !this.clockWise ? (360 - angleIJ1) : angleIJ0; + var s1 = !this.clockWise ? (360 - angleIJ0) : angleIJ1; + var t0 = !this.clockWise ? (360 - angleJI1) : angleJI0; + var t1 = !this.clockWise ? (360 - angleJI0) : angleJI1; + var chord = { + zlevel: this._zlevelBase, + style: { + x: this.center[0], + y: this.center[1], + r: this.innerRadius, + source0: s0 - this.startAngle, + source1: s1 - this.startAngle, + target0: t0 - this.startAngle, + target1: t1 - this.startAngle, + brushType: 'both', + opacity: 0.5, + color: color, + lineWidth: ribbonLineStyle.width, + strokeColor: ribbonLineStyle.color + }, + clickable: this.chordSerieSample.clickable, + highlightStyle: { + brushType: 'both', + lineWidth: ribbonLineStyleEmphsis.width, + strokeColor: ribbonLineStyleEmphsis.color + } + }; + + ecData.pack( + chord, + this.chordSeries[k], + k, + dataArr[i][j][k], i + '-' +j, + this.groups[i].name, + this.groups[j].name, + dataArr[j][i][k] + ); + + chord = new RibbonShape(chord); + this.chordShapes[i][j][k] = chord; + this.shapeList.push(chord); + } + } + } + }, + + _buildScales : function ( + values, + unitPostfix, + angles, + unitValue + ) { + for (var i = 0; i < angles.length; i++) { + var subStartAngle = angles[i][0]; + var subEndAngle = angles[i][1]; + + var scaleAngle = subStartAngle; + while (scaleAngle < subEndAngle) { + var thelta = ((this.clockWise ? (360 - scaleAngle) : scaleAngle) + + this.startAngle) / 180 * Math.PI; + var v = [ + Math.cos(thelta), + -Math.sin(thelta) + ]; + var start = vec2.scale([], v, this.outerRadius + 1); + vec2.add(start, start, this.center); + var end = vec2.scale([], v, this.outerRadius + this.scaleLineLength); + vec2.add(end, end, this.center); + var scaleShape = { + zlevel: this._zlevelBase - 1, + hoverable: false, + style: { + xStart: start[0], + yStart: start[1], + xEnd: end[0], + yEnd: end[1], + lineCap: 'round', + brushType: 'stroke', + strokeColor: '#666', + lineWidth: 1 + } + }; + + scaleShape = new LineShape(scaleShape); + this.shapeList.push(scaleShape); + + scaleAngle += this.scaleUnitAngle; + } + if (!this.showScaleText) { + continue; + } + + var scaleTextAngle = subStartAngle; + var step = unitValue * 5 * this.scaleUnitAngle; + var scaleValues = NDArray.range(0, values[i], step).toArray(); + while (scaleTextAngle < subEndAngle) { + var thelta = this.clockWise + ? (360 - scaleTextAngle) : scaleTextAngle; + thelta = (thelta + this.startAngle) % 360; + var isRightSide = thelta <= 90 + || thelta >= 270; + var textShape = { + zlevel: this._zlevelBase - 1, + hoverable: false, + style: { + x: isRightSide + ? this.outerRadius + this.scaleLineLength + 4 + : -this.outerRadius - this.scaleLineLength - 4, + y: 0, + text: Math.round(scaleValues.shift()*10)/10 + + unitPostfix, + textAlign: isRightSide ? 'left' : 'right' + }, + position: this.center.slice(), + rotation: isRightSide + ? [thelta / 180 * Math.PI, 0, 0] + : [ + (thelta + 180) / 180 * Math.PI, + 0, 0 + ] + }; + + textShape = new TextShape(textShape); + this.shapeList.push(textShape); + scaleTextAngle += this.scaleUnitAngle * 5; + } + } + }, + + normalizeValue : function (values) { + var result = []; + var max = new NDArray(values).max(); + var unitPostfix, unitScale; + if (max > 10000) { + unitPostfix = 'k'; + unitScale = 1 / 1000; + } else if (max > 10000000) { + unitPostfix = 'm'; + unitScale = 1 / 1000000; + } else if (max > 10000000000) { + unitPostfix = 'b'; + unitScale = 1 / 1000000000; + } else { + unitPostfix = ''; + unitScale = 1; + } + + for (var i = 0; i < values.length; i++) { + result[i] = values[i] * unitScale; + } + return [result, unitPostfix]; + }, + + refresh : function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + + // Config + this.chordSeries = []; + + this.strokeFix = 0; + // Adjacency matrix + this.sectorShapes = []; + this.chordShapes = []; + + this.scaleLineLength = 4; + this.scaleUnitAngle = 4; + + this.legend = this.component.legend; + if (this.legend) { + this.getColor = function(param) { + return this.legend.getColor(param); + }; + this.isSelected = function(param) { + return this.legend.isSelected(param); + }; + } else { + var colorIndices = {}; + var colorMap = {}; + var count = 0; + this.getColor = function (key) { + if (colorMap[key]) { + return colorMap[key]; + } + if (colorIndices[key] === undefined) { + colorIndices[key] = count++; + } + // key is serie name + for (var i = 0; i < this.chordSeries.length; i++) { + if (this.chordSeries[i].name === key) { + colorMap[key] = this.query( + this.chordSeries[i], + 'itemStyle.normal.color' + ); + break; + } + } + if (!colorMap[key]) { + var len = this.groups.length; + // key is group name + for (var i = 0; i < len; i++) { + if (this.groups[i].name === key) { + colorMap[key] = this.query( + this.groups[i], + 'itemStyle.normal.color' + ); + break; + } + } + } + if (!colorMap[key]) { + colorMap[key] = this.zr.getColor(colorIndices[key]); + } + + return colorMap[key]; + }; + this.isSelected = function () { + return true; + }; + } + + this.backupShapeList(); + this._buildShape(); + }, + + reformOption : function (opt) { + var _merge = zrUtil.merge; + opt = _merge( + opt || {}, + this.ecTheme.chord + ); + opt.itemStyle.normal.label.textStyle = _merge( + opt.itemStyle.normal.label.textStyle || {}, + this.ecTheme.textStyle + ); + } + }; + + zrUtil.inherits(Chord, ChartBase); + zrUtil.inherits(Chord, ComponentBase); + + // 图表注册 + require('../chart').define('chord', Chord); + + return Chord; +}); +/** + * 图数据结构 + * @module echarts/data/Graph + * @author pissang(http://www.github.com/pissang) + */ +define('echarts/data/Graph',['require','zrender/tool/util'],function(require) { + + var util = require('zrender/tool/util'); + + + + /** + * @alias module:echarts/data/Graph + * @constructor + * @param {boolean} directed + */ + var Graph = function(directed) { + /** + * 是否是有向图 + * @type {boolean} + * @private + */ + this._directed = directed || false; + + /** + * [nodes description] + * @type {Array} + */ + this.nodes = []; + this.edges = []; + + this._nodesMap = {}; + this._edgesMap = {}; + }; + + /** + * 添加一个新的节点 + * @param {string} name 节点名称 + * @param {*} [data] 存储的数据 + */ + Graph.prototype.addNode = function(name, data) { + if (this._nodesMap[name]) { + return this._nodesMap[name]; + } + + var node = new Graph.Node(name, data); + + this.nodes.push(node); + + this._nodesMap[name] = node; + return node; + }; + + /** + * 获取节点 + * @param {string} name + * @return {module:echarts/data/Graph~Node} + */ + Graph.prototype.getNodeByName = function(name) { + return this._nodesMap[name]; + }; + + /** + * 添加边 + * @param {string|module:echarts/data/Graph~Node} n1 + * @param {string|module:echarts/data/Graph~Node} n2 + * @param {*} data + * @return {module:echarts/data/Graph~Edge} + */ + Graph.prototype.addEdge = function(n1, n2, data) { + if (typeof(n1) == 'string') { + n1 = this._nodesMap[n1]; + } + if (typeof(n2) == 'string') { + n2 = this._nodesMap[n2]; + } + if (!n1 || !n2) { + return; + } + + var key = n1.name + '-' + n2.name; + if (this._edgesMap[key]) { + return this._edgesMap[key]; + } + + var edge = new Graph.Edge(n1, n2, data); + + if (this._directed) { + n1.outEdges.push(edge); + n2.inEdges.push(edge); + } + n1.edges.push(edge); + n2.edges.push(edge); + + this.edges.push(edge); + this._edgesMap[key] = edge; + + return edge; + }; + + /** + * 移除边 + * @param {module:echarts/data/Graph~Edge} edge + */ + Graph.prototype.removeEdge = function(edge) { + var n1 = edge.node1; + var n2 = edge.node2; + var key = n1.name + '-' + n2.name; + if (this._directed) { + n1.outEdges.splice(util.indexOf(n1.outEdges, edge), 1); + n2.inEdges.splice(util.indexOf(n2.inEdges, edge), 1); + } + n1.edges.splice(util.indexOf(n1.edges, edge), 1); + n2.edges.splice(util.indexOf(n2.edges, edge), 1); + + delete this._edgesMap[key]; + this.edges.splice(util.indexOf(this.edges, edge), 1); + }; + + /** + * 移除节点(及其邻接边) + * @param {module:echarts/data/Graph~Node|string} node + */ + Graph.prototype.removeNode = function(node) { + if (typeof(node) === 'string') { + node = this._nodesMap[node]; + if (!node) { + return; + } + } + + delete this._nodesMap[node.name]; + this.nodes.splice(util.indexOf(this.nodes, node), 1); + + for (var i = 0; i < this.edges.length;) { + var edge = this.edges[i]; + if (edge.node1 == node || edge.node2 == node) { + this.removeEdge(edge); + } else { + i++; + } + } + }; + + /** + * 线性遍历所有节点 + * @param {Function} cb + * @param {*} context + */ + Graph.prototype.eachNode = function(cb, context) { + for (var i = 0; i < this.nodes.length; i++) { + cb.call(context, this.nodes[i]); + } + }; + + /** + * 线性遍历所有边 + * @param {Function} cb + * @param {*} context + */ + Graph.prototype.eachEdge = function(cb, context) { + for (var i = 0; i < this.edges.length; i++) { + cb.call(context, this.edges[i]); + } + }; + + /** + * 清空图 + */ + Graph.prototype.clear = function() { + this.nodes.length = 0; + this.edges.length = 0; + + this._nodesMap = {}; + this._edgesMap = {}; + }; + + /** + * 图节点 + * @alias module:echarts/data/Graph~Node + * @param {string} name + * @param {*} [data] + */ + var Node = function(name, data) { + /** + * 节点名称 + * @type {string} + */ + this.name = name; + /** + * 节点存储的数据 + * @type {*} + */ + this.data = data || null; + /** + * 入边,只在有向图上有效 + * @type {Array.} + */ + this.inEdges = []; + /** + * 出边,只在有向图上有效 + * @type {Array.} + */ + this.outEdges = []; + /** + * 邻接边 + * @type {Array.} + */ + this.edges = []; + }; + + /** + * 度 + * @return {number} + */ + Node.prototype.degree = function() { + return this.edges.length; + }; + + /** + * 入度,只在有向图上有效 + * @return {number} + */ + Node.prototype.inDegree = function() { + return this.inEdges.length; + }; + + /** + * 出度,只在有向图上有效 + * @return {number} + */ + Node.prototype.outDegree = function() { + return this.outEdges.length; + }; + + /** + * 图边 + * @alias module:echarts/data/Graph~Edge + * @param {module:echarts/data/Graph~Node} node1 + * @param {module:echarts/data/Graph~Node} node2 + * @param {extra} data + */ + var Edge = function(node1, node2, data) { + /** + * 节点1,如果是有向图则为源节点 + * @type {module:echarts/data/Graph~Node} + */ + this.node1 = node1; + /** + * 节点2,如果是有向图则为目标节点 + * @type {module:echarts/data/Graph~Node} + */ + this.node2 = node2; + + /** + * 边存储的数据 + * @type {*} + */ + this.data = data || null; + }; + + Graph.Node = Node; + Graph.Edge = Edge; + + /** + * 从邻接矩阵生成 + * ``` + * TARGET + * -1--2--3--4--5- + * 1| x x x x x + * 2| x x x x x + * 3| x x x x x SOURCE + * 4| x x x x x + * 5| x x x x x + * ``` + * 节点的行列总和会被写到`node.data.value` + * 对于有向图会计算每一行的和写到`node.data.outValue`, + * 计算每一列的和写到`node.data.inValue`。 + * 边的权重会被然后写到`edge.data.weight`。 + * 如果是有向图被写到`edge.data.sourceWeight`和`edge.data.targetWeight` + * + * @method module:echarts/data/Graph.fromMatrix + * @param {Array.} nodesData 节点信息,必须有`name`属性 + * @param {Array} matrix 邻接矩阵 + * @param {boolean} directed 是否是有向图 + * @return {module:echarts/data/Graph} + */ + Graph.fromMatrix = function(nodesData, matrix, directed) { + if ( + !matrix || !matrix.length + || (matrix[0].length !== matrix.length) + || (nodesData.length !== matrix.length) + ) { + // Not a valid data + return; + } + + var size = matrix.length; + var graph = new Graph(directed); + + for (var i = 0; i < size; i++) { + var node = graph.addNode(nodesData[i].name, {}); + node.data.value = 0; + if (directed) { + node.data.outValue = node.data.inValue = 0; + } + } + for (var i = 0; i < size; i++) { + for (var j = 0; j < size; j++) { + var item = matrix[i][j]; + if (directed) { + graph.nodes[i].outValue += item; + graph.nodes[j].inValue += item; + } + graph.nodes[i].value += item; + graph.nodes[j].value += item; + } + } + + for (var i = 0; i < size; i++) { + for (var j = i; j < size; j++) { + var item = matrix[i][j]; + if (item === 0) { + continue; + } + var n1 = graph.nodes[i]; + var n2 = graph.nodes[j]; + var edge = graph.addEdge(n1, n2, {}); + if (directed) { + edge.data.sourceWeight = item; + edge.data.targetWeight = matrix[j][i]; + } + edge.data.weight = item; + if (i !== j) { + if (directed) { + var inEdge = graph.addEdge(n2, n1, {}); + inEdge.sourceWeight = matrix[j][i]; + inEdge.targetWeight = item; + } + edge.data.weight += matrix[j][i]; + } + } + } + }; + + return Graph; +}); +// 1. Graph Drawing by Force-directed Placement +// 2. http://webatlas.fr/tempshare/ForceAtlas2_Paper.pdf +define('echarts/layout/forceLayoutWorker',['require','zrender/tool/vector'],function __echartsForceLayoutWorker(require) { + + + + var vec2; + // In web worker + var inWorker = typeof(window) === 'undefined' && typeof(require) === 'undefined'; + if (inWorker) { + vec2 = { + create: function(x, y) { + var out = new Float32Array(2); + out[0] = x || 0; + out[1] = y || 0; + return out; + }, + dist: function(a, b) { + var x = b[0] - a[0]; + var y = b[1] - a[1]; + return Math.sqrt(x*x + y*y); + }, + len: function(a) { + var x = a[0]; + var y = a[1]; + return Math.sqrt(x*x + y*y); + }, + scaleAndAdd: function(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + return out; + }, + scale: function(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + return out; + }, + add: function(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + return out; + }, + sub: function(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + return out; + }, + normalize: function(out, a) { + var x = a[0]; + var y = a[1]; + var len = x*x + y*y; + if (len > 0) { + //TODO: evaluate use of glm_invsqrt here? + len = 1 / Math.sqrt(len); + out[0] = a[0] * len; + out[1] = a[1] * len; + } + return out; + }, + negate: function(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + return out; + }, + copy: function(out, a) { + out[0] = a[0]; + out[1] = a[1]; + return out; + }, + set: function(out, x, y) { + out[0] = x; + out[1] = y; + return out; + } + }; + } + else { + vec2 = require('zrender/tool/vector'); + } + var ArrayCtor = typeof(Float32Array) == 'undefined' ? Array : Float32Array; + + /**************************** + * Class: Region + ***************************/ + + function Region() { + + this.subRegions = []; + + this.nSubRegions = 0; + + this.node = null; + + this.mass = 0; + + this.centerOfMass = null; + + this.bbox = new ArrayCtor(4); + + this.size = 0; + } + + // Reset before update + Region.prototype.beforeUpdate = function() { + for (var i = 0; i < this.nSubRegions; i++) { + this.subRegions[i].beforeUpdate(); + } + this.mass = 0; + if (this.centerOfMass) { + this.centerOfMass[0] = 0; + this.centerOfMass[1] = 0; + } + this.nSubRegions = 0; + this.node = null; + }; + // Clear after update + Region.prototype.afterUpdate = function() { + this.subRegions.length = this.nSubRegions; + for (var i = 0; i < this.nSubRegions; i++) { + this.subRegions[i].afterUpdate(); + } + }; + + Region.prototype.addNode = function(node) { + if (this.nSubRegions === 0) { + if (this.node == null) { + this.node = node; + return; + } + else { + this._addNodeToSubRegion(this.node); + this.node = null; + } + } + this._addNodeToSubRegion(node); + + this._updateCenterOfMass(node); + }; + + Region.prototype.findSubRegion = function(x, y) { + for (var i = 0; i < this.nSubRegions; i++) { + var region = this.subRegions[i]; + if (region.contain(x, y)) { + return region; + } + } + }; + + Region.prototype.contain = function(x, y) { + return this.bbox[0] <= x + && this.bbox[2] >= x + && this.bbox[1] <= y + && this.bbox[3] >= y; + }; + + Region.prototype.setBBox = function(minX, minY, maxX, maxY) { + // Min + this.bbox[0] = minX; + this.bbox[1] = minY; + // Max + this.bbox[2] = maxX; + this.bbox[3] = maxY; + + this.size = (maxX - minX + maxY - minY) / 2; + }; + + Region.prototype._newSubRegion = function() { + var subRegion = this.subRegions[this.nSubRegions]; + if (!subRegion) { + subRegion = new Region(); + this.subRegions[this.nSubRegions] = subRegion; + } + this.nSubRegions++; + return subRegion; + }; + + Region.prototype._addNodeToSubRegion = function(node) { + var subRegion = this.findSubRegion(node.position[0], node.position[1]); + var bbox = this.bbox; + if (!subRegion) { + var cx = (bbox[0] + bbox[2]) / 2; + var cy = (bbox[1] + bbox[3]) / 2; + var w = (bbox[2] - bbox[0]) / 2; + var h = (bbox[3] - bbox[1]) / 2; + + var xi = node.position[0] >= cx ? 1 : 0; + var yi = node.position[1] >= cy ? 1 : 0; + + var subRegion = this._newSubRegion(); + // Min + subRegion.setBBox( + // Min + xi * w + bbox[0], + yi * h + bbox[1], + // Max + (xi + 1) * w + bbox[0], + (yi + 1) * h + bbox[1] + ); + } + + subRegion.addNode(node); + }; + + Region.prototype._updateCenterOfMass = function(node) { + // Incrementally update + if (this.centerOfMass == null) { + this.centerOfMass = vec2.create(); + } + var x = this.centerOfMass[0] * this.mass; + var y = this.centerOfMass[1] * this.mass; + x += node.position[0] * node.mass; + y += node.position[1] * node.mass; + this.mass += node.mass; + this.centerOfMass[0] = x / this.mass; + this.centerOfMass[1] = y / this.mass; + }; + + /**************************** + * Class: Graph Node + ***************************/ + function GraphNode() { + this.position = vec2.create(); + + this.force = vec2.create(); + this.forcePrev = vec2.create(); + + this.speed = vec2.create(); + this.speedPrev = vec2.create(); + + // If repulsionByDegree is true + // mass = inDegree + outDegree + 1 + // Else + // mass is manually set + this.mass = 1; + + this.inDegree = 0; + this.outDegree = 0; + } + + /**************************** + * Class: Graph Edge + ***************************/ + function GraphEdge(node1, node2) { + this.node1 = node1; + this.node2 = node2; + + this.weight = 1; + } + + /**************************** + * Class: ForceLayout + ***************************/ + function ForceLayout() { + + this.barnesHutOptimize = false; + this.barnesHutTheta = 1.5; + + this.repulsionByDegree = false; + + this.preventOverlap = false; + this.strongGravity = true; + + this.gravity = 1.0; + this.scaling = 1.0; + + this.edgeWeightInfluence = 1.0; + + this.center = [0, 0]; + this.width = 500; + this.height = 500; + + this.maxSpeedIncrease = 1.0; + + this.nodes = []; + this.edges = []; + + this.bbox = new ArrayCtor(4); + + this._rootRegion = new Region(); + this._rootRegion.centerOfMass = vec2.create(); + + this._massArr = null; + + this._k = 0; + } + + ForceLayout.prototype.initNodes = function(positionArr, massArr, sizeArr) { + + this.temperature = 1.0; + + var nNodes = positionArr.length / 2; + this.nodes.length = 0; + var haveSize = typeof(sizeArr) !== 'undefined'; + + for (var i = 0; i < nNodes; i++) { + var node = new GraphNode(); + node.position[0] = positionArr[i * 2]; + node.position[1] = positionArr[i * 2 + 1]; + node.mass = massArr[i]; + if (haveSize) { + node.size = sizeArr[i]; + } + this.nodes.push(node); + } + + this._massArr = massArr; + if (haveSize) { + this._sizeArr = sizeArr; + } + }; + + ForceLayout.prototype.initEdges = function(edgeArr, edgeWeightArr) { + var nEdges = edgeArr.length / 2; + this.edges.length = 0; + var edgeHaveWeight = typeof(edgeWeightArr) !== 'undefined'; + + for (var i = 0; i < nEdges; i++) { + var sIdx = edgeArr[i * 2]; + var tIdx = edgeArr[i * 2 + 1]; + var sNode = this.nodes[sIdx]; + var tNode = this.nodes[tIdx]; + + if (!sNode || !tNode) { + continue; + } + sNode.outDegree++; + tNode.inDegree++; + var edge = new GraphEdge(sNode, tNode); + + if (edgeHaveWeight) { + edge.weight = edgeWeightArr[i]; + } + + this.edges.push(edge); + } + }; + + ForceLayout.prototype.update = function() { + + var nNodes = this.nodes.length; + + this.updateBBox(); + + this._k = 0.4 * this.scaling * Math.sqrt(this.width * this.height / nNodes); + + if (this.barnesHutOptimize) { + this._rootRegion.setBBox( + this.bbox[0], this.bbox[1], + this.bbox[2], this.bbox[3] + ); + this._rootRegion.beforeUpdate(); + for (var i = 0; i < nNodes; i++) { + this._rootRegion.addNode(this.nodes[i]); + } + this._rootRegion.afterUpdate(); + } + else { + // Update center of mass of whole graph + var mass = 0; + var centerOfMass = this._rootRegion.centerOfMass; + vec2.set(centerOfMass, 0, 0); + for (var i = 0; i < nNodes; i++) { + var node = this.nodes[i]; + mass += node.mass; + vec2.scaleAndAdd(centerOfMass, centerOfMass, node.position, node.mass); + } + vec2.scale(centerOfMass, centerOfMass, 1 / mass); + } + + // Reset forces + for (var i = 0; i < nNodes; i++) { + var node = this.nodes[i]; + vec2.copy(node.forcePrev, node.force); + vec2.copy(node.speedPrev, node.speed); + vec2.set(node.force, 0, 0); + } + + // Compute forces + // Repulsion + for (var i = 0; i < nNodes; i++) { + var na = this.nodes[i]; + if (this.barnesHutOptimize) { + this.applyRegionToNodeRepulsion(this._rootRegion, na); + } + else { + for (var j = i + 1; j < nNodes; j++) { + var nb = this.nodes[j]; + this.applyNodeToNodeRepulsion(na, nb, false); + } + } + + // Gravity + if (this.gravity > 0) { + this.applyNodeGravity(na); + } + } + + // Attraction + for (var i = 0; i < this.edges.length; i++) { + this.applyEdgeAttraction(this.edges[i]); + } + + // Apply forces + // var speed = vec2.create(); + var v = vec2.create(); + for (var i = 0; i < nNodes; i++) { + var node = this.nodes[i]; + var speed = node.speed; + + // var swing = vec2.dist(node.force, node.forcePrev); + // // var swing = 30; + // vec2.scale(node.force, node.force, 1 / (1 + Math.sqrt(swing))); + vec2.scale(node.force, node.force, 1 / 30); + + // contraint force + var df = vec2.len(node.force) + 0.1; + var scale = Math.min(df, 500.0) / df; + vec2.scale(node.force, node.force, scale); + + vec2.add(speed, speed, node.force); + + vec2.scale(speed, speed, this.temperature); + + // Prevent swinging + // Limited the increase of speed up to 100% each step + // TODO adjust by nodes number + vec2.sub(v, speed, node.speedPrev); + var swing = vec2.len(v); + if (swing > 0) { + vec2.scale(v, v, 1 / swing); + var base = vec2.len(node.speedPrev); + if (base > 0) { + swing = Math.min(swing / base, this.maxSpeedIncrease) * base; + vec2.scaleAndAdd(speed, node.speedPrev, v, swing); + } + } + + // constraint speed + var ds = vec2.len(speed); + var scale = Math.min(ds, 100.0) / (ds + 0.1); + vec2.scale(speed, speed, scale); + + vec2.add(node.position, node.position, speed); + } + }; + + ForceLayout.prototype.applyRegionToNodeRepulsion = (function() { + var v = vec2.create(); + return function applyRegionToNodeRepulsion(region, node) { + if (region.node) { // Region is a leaf + this.applyNodeToNodeRepulsion(region.node, node, true); + } + else { + vec2.sub(v, node.position, region.centerOfMass); + var d2 = v[0] * v[0] + v[1] * v[1]; + if (d2 > this.barnesHutTheta * region.size * region.size) { + var factor = this._k * this._k * (node.mass + region.mass) / (d2 + 1); + vec2.scaleAndAdd(node.force, node.force, v, factor * 2); + } + else { + for (var i = 0; i < region.nSubRegions; i++) { + this.applyRegionToNodeRepulsion(region.subRegions[i], node); + } + } + } + }; + })(); + + ForceLayout.prototype.applyNodeToNodeRepulsion = (function() { + var v = vec2.create(); + return function applyNodeToNodeRepulsion(na, nb, oneWay) { + if (na == nb) { + return; + } + vec2.sub(v, na.position, nb.position); + var d2 = v[0] * v[0] + v[1] * v[1]; + + // PENDING + if (d2 === 0) { + return; + } + + var factor; + var k2 = this._k * this._k; + var mass = na.mass + nb.mass; + + if (this.preventOverlap) { + var d = Math.sqrt(d2); + d = d - na.size - nb.size; + if (d > 0) { + factor = k2 * mass / (d * d); + } + else if (d <= 0) { + // A stronger repulsion if overlap + factor = k2 * 10 * mass; + } + } + else { + // Divide factor by an extra `d` to normalize the `v` + factor = k2 * mass / d2; + } + + if (!oneWay) { + vec2.scaleAndAdd(na.force, na.force, v, factor * 2); + } + vec2.scaleAndAdd(nb.force, nb.force, v, -factor * 2); + }; + })(); + + ForceLayout.prototype.applyEdgeAttraction = (function() { + var v = vec2.create(); + return function applyEdgeAttraction(edge) { + var na = edge.node1; + var nb = edge.node2; + + vec2.sub(v, na.position, nb.position); + var d = vec2.len(v); + + var w; + if (this.edgeWeightInfluence === 0) { + w = 1; + } + else if (this.edgeWeightInfluence == 1) { + w = edge.weight; + } + else { + w = Math.pow(edge.weight, this.edgeWeightInfluence); + } + + var factor; + + if (this.preventOverlap) { + d = d - na.size - nb.size; + if (d <= 0) { + // No attraction + return; + } + } + + var factor = -w * d / this._k; + + vec2.scaleAndAdd(na.force, na.force, v, factor); + vec2.scaleAndAdd(nb.force, nb.force, v, -factor); + }; + })(); + + ForceLayout.prototype.applyNodeGravity = (function() { + var v = vec2.create(); + return function(node) { + // PENDING Move to centerOfMass or [0, 0] ? + // vec2.sub(v, this._rootRegion.centerOfMass, node.position); + // vec2.negate(v, node.position); + vec2.sub(v, this.center, node.position); + if (this.width > this.height) { + // Stronger gravity on y axis + v[1] *= this.width / this.height; + } + else { + // Stronger gravity on x axis + v[0] *= this.height / this.width; + } + var d = vec2.len(v) / 100; + + if (this.strongGravity) { + vec2.scaleAndAdd(node.force, node.force, v, d * this.gravity * node.mass); + } + else { + vec2.scaleAndAdd(node.force, node.force, v, this.gravity * node.mass / (d + 1)); + } + }; + })(); + + ForceLayout.prototype.updateBBox = function() { + var minX = Infinity; + var minY = Infinity; + var maxX = -Infinity; + var maxY = -Infinity; + for (var i = 0; i < this.nodes.length; i++) { + var pos = this.nodes[i].position; + minX = Math.min(minX, pos[0]); + minY = Math.min(minY, pos[1]); + maxX = Math.max(maxX, pos[0]); + maxY = Math.max(maxY, pos[1]); + } + this.bbox[0] = minX; + this.bbox[1] = minY; + this.bbox[2] = maxX; + this.bbox[3] = maxY; + }; + + ForceLayout.getWorkerCode = function() { + var str = __echartsForceLayoutWorker.toString(); + return str.slice(str.indexOf('{') + 1, str.lastIndexOf('return')); + }; + + ForceLayout.prototype.setToken = function(token) { + this._token = token; + }; + + ForceLayout.prototype.tokenMatch = function(token) { + return token === this._token; + }; + + /**************************** + * Main process + ***************************/ + + /* jshint ignore:start */ + if (inWorker) { + var forceLayout = null; + + self.onmessage = function(e) { + // Position read back + if (e.data instanceof ArrayBuffer) { + if (!forceLayout) { + return; + } + var positionArr = new Float32Array(e.data); + var nNodes = (positionArr.length - 1) / 2; + for (var i = 0; i < nNodes; i++) { + var node = forceLayout.nodes[i]; + node.position[0] = positionArr[i * 2 + 1]; + node.position[1] = positionArr[i * 2 + 2]; + } + return; + } + + switch(e.data.cmd) { + case 'init': + if (!forceLayout) { + forceLayout = new ForceLayout(); + } + forceLayout.initNodes(e.data.nodesPosition, e.data.nodesMass, e.data.nodesSize); + forceLayout.initEdges(e.data.edges, e.data.edgesWeight); + forceLayout._token = e.data.token; + break; + case 'updateConfig': + if (forceLayout) { + for (var name in e.data.config) { + forceLayout[name] = e.data.config[name]; + } + } + break; + case 'update': + var steps = e.data.steps; + + if (forceLayout) { + var nNodes = forceLayout.nodes.length; + var positionArr = new Float32Array(nNodes * 2 + 1); + + forceLayout.temperature = e.data.temperature; + + for (var i = 0; i < steps; i++) { + forceLayout.update(); + forceLayout.temperature *= e.data.coolDown; + } + // Callback + for (var i = 0; i < nNodes; i++) { + var node = forceLayout.nodes[i]; + positionArr[i * 2 + 1] = node.position[0]; + positionArr[i * 2 + 2] = node.position[1]; + } + + positionArr[0] = forceLayout._token; + + self.postMessage(positionArr.buffer, [positionArr.buffer]); + } + else { + // Not initialzied yet + var emptyArr = new Float32Array(); + // Post transfer object + self.postMessage(emptyArr.buffer, [emptyArr.buffer]); + } + break; + } + }; + } + /* jshint ignore:end */ + + return ForceLayout; +}); +/** + * 力导向布局 + * @module echarts/layout/Force + * @author pissang(http://github.com/pissang) + */ +define('echarts/layout/Force',['require','./forceLayoutWorker','zrender/tool/vector'],function(require) { + + var ForceLayoutWorker = require('./forceLayoutWorker'); + var vec2 = require('zrender/tool/vector'); + + var requestAnimationFrame = window.requestAnimationFrame + || window.msRequestAnimationFrame + || window.mozRequestAnimationFrame + || window.webkitRequestAnimationFrame + || function (func) {setTimeout(func, 16);}; + var ArrayCtor = typeof(Float32Array) == 'undefined' ? Array : Float32Array; + + var workerUrl; + + function getToken() { + return Math.round(Date.now() / 100) % 10000000; + } + + function createWorkerUrl() { + if ( + typeof(Worker) !== 'undefined' && + typeof(Blob) !== 'undefined' + ) { + try { + var blob = new Blob([ForceLayoutWorker.getWorkerCode()]); + workerUrl = window.URL.createObjectURL(blob); + } + catch (e) { + workerUrl = ''; + } + } + + return workerUrl; + } + + var ForceLayout = function(opts) { + + if (typeof(workerUrl) === 'undefined') { + createWorkerUrl(); + } + opts = opts || {}; + // 配置项 + this.width = opts.width || 500; + this.height = opts.height || 500; + this.center = opts.center || [this.width / 2, this.height / 2]; + this.ratioScaling = opts.ratioScaling || false; + this.scaling = opts.scaling || 1; + this.gravity = typeof(opts.gravity) !== 'undefined' + ? opts.gravity : 1; + this.large = opts.large || false; + + this.onupdate = opts.onupdate || function () {}; + this.temperature = opts.temperature || 1; + this.coolDown = opts.coolDown || 0.99; + + this._layout = null; + this._layoutWorker = null; + + this._token = 0; + + var self = this; + var _$onupdate = this._$onupdate; + this._$onupdate = function(e) { + _$onupdate.call(self, e); + }; + }; + + ForceLayout.prototype.updateConfig = function () { + var width = this.width; + var height = this.height; + var size = Math.min(width, height); + + var config = { + center: this.center, + width: this.ratioScaling ? width : size, + height: this.ratioScaling ? height : size, + scaling: this.scaling || 1.0, + gravity: this.gravity || 1.0, + barnesHutOptimize: this.large + }; + + if (this._layoutWorker) { + this._layoutWorker.postMessage({ + cmd: 'updateConfig', + config: config + }); + } + else { + for (var name in config) { + this._layout[name] = config[name]; + } + } + }; + + ForceLayout.prototype.init = function(graph, useWorker) { + if (workerUrl && useWorker) { + try { + if (!this._layoutWorker) { + this._layoutWorker = new Worker(workerUrl); + this._layoutWorker.onmessage = this._$onupdate; + } + this._layout = null; + } + catch (e) { // IE10-11 will throw security error when using blog url + this._layoutWorker = null; + if (!this._layout) { + this._layout = new ForceLayoutWorker(); + } + } + } + else { + if (!this._layout) { + this._layout = new ForceLayoutWorker(); + } + if (this._layoutWorker) { + this._layoutWorker.terminate(); + this._layoutWorker = null; + } + } + + this.temperature = 1; + + this.graph = graph; + + // 节点数据 + var len = graph.nodes.length; + var positionArr = new ArrayCtor(len * 2); + var massArr = new ArrayCtor(len); + var radiusArr = new ArrayCtor(len); + + for (var i = 0; i < len; i++) { + var n = graph.nodes[i]; + positionArr[i * 2] = n.layout.position[0]; + positionArr[i * 2 + 1] = n.layout.position[1]; + massArr[i] = n.layout.mass; + radiusArr[i] = n.layout.radius; + + n.layout.__index = i; + } + // 边数据 + len = graph.edges.length; + var edgeArr = new ArrayCtor(len * 2); + var edgeWeightArr = new ArrayCtor(len); + for (var i = 0; i < len; i++) { + var edge = graph.edges[i]; + edgeArr[i * 2] = edge.node1.layout.__index; + edgeArr[i * 2 + 1] = edge.node2.layout.__index; + edgeWeightArr[i] = edge.layout.weight || 1; + } + + this._token = getToken(); + + if (this._layoutWorker) { + + this._layoutWorker.postMessage({ + cmd: 'init', + nodesPosition: positionArr, + nodesMass: massArr, + nodesSize: radiusArr, + edges: edgeArr, + edgesWeight: edgeWeightArr, + token: this._token + }); + } + else { + this._layout.setToken(this._token); + this._layout.initNodes(positionArr, massArr, radiusArr); + this._layout.initEdges(edgeArr, edgeWeightArr); + } + + this.updateConfig(); + }; + + ForceLayout.prototype.step = function (steps) { + var nodes = this.graph.nodes; + if (this._layoutWorker) { + // Sync back + var positionArr = new ArrayCtor(nodes.length * 2 + 1); + for (var i = 0; i < nodes.length; i++) { + var n = nodes[i]; + positionArr[i * 2 + 1] = n.layout.position[0]; + positionArr[i * 2 + 2] = n.layout.position[1]; + } + this._layoutWorker.postMessage(positionArr.buffer, [positionArr.buffer]); + + this._layoutWorker.postMessage({ + cmd: 'update', + steps: steps, + temperature: this.temperature, + coolDown: this.coolDown + }); + for (var i = 0; i < steps; i++) { + this.temperature *= this.coolDown; + } + } + else { + + requestAnimationFrame(this._$onupdate); + + for (var i = 0; i < nodes.length; i++) { + var n = nodes[i]; + vec2.copy(this._layout.nodes[i].position, n.layout.position); + } + for (var i = 0; i < steps; i++) { + this._layout.temperature = this.temperature; + this._layout.update(); + this.temperature *= this.coolDown; + } + } + }; + + ForceLayout.prototype._$onupdate = function (e) { + if (this._layoutWorker) { + var positionArr = new Float32Array(e.data); + var token = positionArr[0]; + // If token is from current layout instance + if (token === this._token) { + for (var i = 0; i < this.graph.nodes.length; i++) { + var n = this.graph.nodes[i]; + n.layout.position[0] = positionArr[i * 2 + 1]; + n.layout.position[1] = positionArr[i * 2 + 2]; + } + this.onupdate && this.onupdate(); + } + } + else if (this._layout) { + if (this._layout.tokenMatch(this._token)) { + for (var i = 0; i < this.graph.nodes.length; i++) { + var n = this.graph.nodes[i]; + vec2.copy(n.layout.position, this._layout.nodes[i].position); + } + this.onupdate && this.onupdate(); + } + } + }; + + ForceLayout.prototype.dispose = function() { + if (this._layoutWorker) { + this._layoutWorker.terminate(); + } + this._layoutWorker = null; + this._layout = null; + this._token = 0; + }; + + return ForceLayout; +}); +/** + * echarts图表类:力导向图 + * + * @author pissang (https://github.com/pissang/) + * + */ + +define('echarts/chart/force',['require','../component/base','./base','../data/Graph','../layout/Force','zrender/shape/Line','zrender/shape/Image','../util/shape/Icon','../config','../util/ecData','zrender/tool/util','zrender/config','zrender/tool/vector','../chart'],function (require) { + + + var ComponentBase = require('../component/base'); + var ChartBase = require('./base'); + + var Graph = require('../data/Graph'); + var ForceLayout = require('../layout/Force'); + + // 图形依赖 + var LineShape = require('zrender/shape/Line'); + var ImageShape = require('zrender/shape/Image'); + var IconShape = require('../util/shape/Icon'); + + var ecConfig = require('../config'); + var ecData = require('../util/ecData'); + var zrUtil = require('zrender/tool/util'); + var zrConfig = require('zrender/config'); + var vec2 = require('zrender/tool/vector'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} series 数据 + * @param {Object} component 组件 + */ + function Force(ecTheme, messageCenter, zr, option, myChart) { + var self = this; + // 基类 + ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); + // 图表基类 + ChartBase.call(this); + + // 保存节点的位置,改变数据时能够有更好的动画效果 + this.__nodePositionMap = {}; + + this._graph = new Graph(true); + this._layout = new ForceLayout(); + + this._layout.onupdate = function() { + self._step(); + }; + + this._steps = 1; + + // 关闭可拖拽属性 + this.ondragstart = function() { + ondragstart.apply(self, arguments); + }; + this.ondragend = function() { + ondragend.apply(self, arguments); + }; + this.ondrop = function() {}; + this.shapeHandler.ondragstart = function() { + self.isDragstart = true; + }; + this.onmousemove = function() { + onmousemove.apply(self, arguments); + }; + this._init(); + } + + /** + * 绘制图形 + */ + Force.prototype = { + + constructor: Force, + + type : ecConfig.CHART_TYPE_FORCE, + + _init: function() { + // var self = this; + var legend = this.component.legend; + var series = this.series; + var serieName; + + this.clear(); + + for (var i = 0, l = series.length; i < l; i++) { + var serie = series[i]; + if (serie.type === ecConfig.CHART_TYPE_FORCE) { + series[i] = this.reformOption(series[i]); + serieName = series[i].name || ''; + + // 系列图例开关 + this.selectedMap[serieName] = + legend ? legend.isSelected(serieName) : true; + if (!this.selectedMap[serieName]) { + continue; + } + + this.buildMark(i); + + // 同步selected状态 + var categories = serie.categories; + for (var j = 0, len = categories.length; j < len; j++) { + if (categories[j].name) { + if (legend){ + this.selectedMap[j] = + legend.isSelected(categories[j].name); + } else { + this.selectedMap[j] = true; + } + } + } + + // TODO 多个 force + this._forceSerie = serie; + + this._initSerie(serie); + break; + } + } + }, + + _initSerie: function(serie) { + this._temperature = 1; + + var graph = this._graph; + graph.clear(); + + for (var i = 0, len = serie.nodes.length; i < len; i++) { + var n = serie.nodes[i]; + if ( + !n || n.ignore + || (n.category && !this.selectedMap[n.category]) + ) { + continue; + } + var node = graph.addNode(n.name, n); + node.rawIndex = i; + } + for (var i = 0, len = serie.links.length; i < len; i++) { + var e = serie.links[i]; + var n1 = e.source; + var n2 = e.target; + if (typeof(n1) === 'number') { + n1 = serie.nodes[n1]; + if (n1) { + n1 = n1.name; + } + } + if (typeof(n2) === 'number') { + n2 = serie.nodes[n2]; + if (n2) { + n2 = n2.name; + } + } + var edge = graph.addEdge(n1, n2, e); + if (edge) { + edge.rawIndex = i; + } + } + + this._buildLinkShapes(serie); + this._buildNodeShapes(serie); + + this._initLayout(serie); + + this._step(); + }, + + _initLayout: function(serie) { + var graph = this._graph; + var len = graph.nodes.length; + + var minRadius = this.query(serie, 'minRadius'); + var maxRadius = this.query(serie, 'maxRadius'); + + this._steps = serie.steps || 1; + + this._layout.center = this.parseCenter(this.zr, serie.center); + this._layout.width = this.parsePercent(serie.size, this.zr.getWidth()); + this._layout.height = this.parsePercent(serie.size, this.zr.getHeight()); + + this._layout.large = serie.large; + this._layout.scaling = serie.scaling; + this._layout.ratioScaling = serie.ratioScaling; + this._layout.gravity = serie.gravity; + this._layout.temperature = 1; + this._layout.coolDown = serie.coolDown; + + // 将值映射到minRadius-maxRadius的范围上 + var min = Infinity; var max = -Infinity; + for (var i = 0; i < len; i++) { + var gNode = graph.nodes[i]; + gNode.layout = { + radius: gNode.data.value || 1, + mass: 0 + }; + max = Math.max(gNode.data.value, max); + min = Math.min(gNode.data.value, min); + } + var divider = max - min; + for (var i = 0; i < len; i++) { + var gNode = graph.nodes[i]; + if (divider > 0) { + gNode.layout.radius = + (gNode.layout.radius - min) * (maxRadius - minRadius) / divider + + minRadius; + // 节点质量是归一的 + gNode.layout.mass = gNode.layout.radius / maxRadius; + } else { + gNode.layout.radius = (maxRadius - minRadius) / 2; + gNode.layout.mass = 0.5; + } + } + + for (var i = 0; i < len; i++) { + // var initPos; + var gNode = graph.nodes[i]; + if (typeof(this.__nodePositionMap[gNode.name]) !== 'undefined') { + gNode.layout.position = vec2.create(); + vec2.copy(gNode.layout.position, this.__nodePositionMap[gNode.name]); + } + else if (typeof(gNode.data.initial) !== 'undefined') { + gNode.layout.position = vec2.create(); + vec2.copy(gNode.layout.position, gNode.data.initial); + } + else { + var center = this._layout.center; + var size = Math.min(this._layout.width, this._layout.height); + gNode.layout.position = _randomInSquare( + center[0], center[1], size * 0.8 + ); + } + var style = gNode.shape.style; + var radius = gNode.layout.radius; + style.width = style.width || (radius * 2); + style.height = style.height || (radius * 2); + style.x = -style.width / 2; + style.y = -style.height / 2; + vec2.copy(gNode.shape.position, gNode.layout.position); + } + + // 边 + len = graph.edges.length; + max = -Infinity; + for (var i = 0; i < len; i++) { + var e = graph.edges[i]; + e.layout = { + weight: e.data.weight || 1 + }; + if (e.layout.weight > max) { + max = e.layout.weight; + } + } + // 权重归一 + for (var i = 0; i < len; i++) { + var e = graph.edges[i]; + e.layout.weight /= max; + } + + this._layout.init(graph, serie.useWorker); + }, + + _buildNodeShapes: function(serie) { + var graph = this._graph; + + var categories = this.query(serie, 'categories'); + var len = graph.nodes.length; + var legend = this.component.legend; + + for (var i = 0; i < len; i++) { + var gNode = graph.nodes[i]; + var node = gNode.data; + + var shape = new IconShape({ + style : { + x : 0, + y : 0 + }, + clickable: this.query(serie, 'clickable'), + highlightStyle : {} + }); + + var queryTarget = []; + var shapeNormalStyle = []; + var shapeEmphasisStyle = []; + + queryTarget.push(node); + if (node.itemStyle) { + shapeNormalStyle.push(node.itemStyle.normal); + shapeEmphasisStyle.push(node.itemStyle.emphasis); + } + if (typeof(node.category) !== 'undefined') { + var category = categories[node.category]; + if (category) { + // 使用 Legend.getColor 配置默认 category 的默认颜色 + category.itemStyle = category.itemStyle || {}; + category.itemStyle.normal = category.itemStyle.normal || {}; + category.itemStyle.normal.color = category.itemStyle.normal.color + || legend.getColor(category.name); + + queryTarget.push(category); + shapeNormalStyle.unshift(category.itemStyle.normal); + shapeEmphasisStyle.unshift(category.itemStyle.emphasis); + } + } + queryTarget.push(serie); + shapeNormalStyle.unshift(serie.itemStyle.normal.nodeStyle); + shapeEmphasisStyle.unshift(serie.itemStyle.emphasis.nodeStyle); + + shape.style.iconType = this.deepQuery(queryTarget, 'symbol'); + // 强制设定节点大小,否则默认映射到 minRadius 到 maxRadius 后的值 + shape.style.width = shape.style.height + = (this.deepQuery(queryTarget, 'symbolSize') || 0) * 2; + + if (shape.style.iconType.match('image')) { + shape.style.image = shape.style.iconType.replace( + new RegExp('^image:\\/\\/'), '' + ); + shape = new ImageShape({ + style: shape.style, + highlightStyle: shape.highlightStyle, + clickable: shape.clickable + }); + } + + // 节点样式 + for (var k = 0; k < shapeNormalStyle.length; k++) { + if (shapeNormalStyle[k]) { + zrUtil.merge(shape.style, shapeNormalStyle[k], true); + } + } + // 节点高亮样式 + for (var k = 0; k < shapeEmphasisStyle.length; k++) { + if (shapeEmphasisStyle[k]) { + zrUtil.merge(shape.highlightStyle, shapeEmphasisStyle[k], true); + } + } + + // 节点标签样式 + if (this.deepQuery(queryTarget, 'itemStyle.normal.label.show')) { + shape.style.text = node.name; + shape.style.textPosition = 'inside'; + var labelStyle = this.deepQuery( + queryTarget, 'itemStyle.normal.label.textStyle' + ) || {}; + shape.style.textColor = labelStyle.color || '#fff'; + shape.style.textAlign = labelStyle.align || 'center'; + shape.style.textBaseline = labelStyle.baseline || 'middle'; + shape.style.textFont = this.getFont(labelStyle); + } + + if (this.deepQuery(queryTarget, 'itemStyle.emphasis.label.show')) { + shape.highlightStyle.text = node.name; + shape.highlightStyle.textPosition = 'inside'; + var labelStyle = this.deepQuery( + queryTarget, 'itemStyle.emphasis.label.textStyle' + ) || {}; + shape.highlightStyle.textColor = labelStyle.color || '#fff'; + shape.highlightStyle.textAlign = labelStyle.align || 'center'; + shape.highlightStyle.textBaseline = labelStyle.baseline || 'middle'; + shape.highlightStyle.textFont = this.getFont(labelStyle); + } + + // 拖拽特性 + if (this.deepQuery(queryTarget, 'draggable')) { + this.setCalculable(shape); + shape.dragEnableTime = 0; + shape.draggable = true; + shape.ondragstart = this.shapeHandler.ondragstart; + shape.ondragover = null; + } + + var categoryName = ''; + if (typeof(node.category) !== 'undefined') { + var category = categories[node.category]; + categoryName = (category && category.name) || ''; + } + // !!Pack data before addShape + ecData.pack( + shape, + // category + { + name : categoryName + }, + // series index + 0, + // data + node, + // data index + gNode.rawIndex, + // name + node.name || '', + // value + node.value + ); + + this.shapeList.push(shape); + this.zr.addShape(shape); + + gNode.shape = shape; + } + }, + + _buildLinkShapes: function(serie) { + var graph = this._graph; + var len = graph.edges.length; + + for (var i = 0; i < len; i++) { + var gEdge = graph.edges[i]; + var link = gEdge.data; + var source = gEdge.node1; + var target = gEdge.node2; + + var linkShape = new LineShape({ + style : { + xStart : 0, + yStart : 0, + xEnd : 0, + yEnd : 0, + lineWidth : 1 + }, + clickable: this.query(serie, 'clickable'), + highlightStyle : {} + }); + + zrUtil.merge( + linkShape.style, + this.query(serie, 'itemStyle.normal.linkStyle'), + true + ); + zrUtil.merge( + linkShape.highlightStyle, + this.query(serie, 'itemStyle.emphasis.linkStyle'), + true + ); + if (typeof(link.itemStyle) !== 'undefined') { + if(link.itemStyle.normal){ + zrUtil.merge(linkShape.style, link.itemStyle.normal, true); + } + if(link.itemStyle.emphasis){ + zrUtil.merge( + linkShape.highlightStyle, + link.itemStyle.emphasis, + true + ); + } + } + + ecData.pack( + linkShape, + // serie + serie, + // serie index + 0, + // link data + { + source : source.data, + target : target.data, + weight : gEdge.data.weight || 0 + }, + // link data index + gEdge.rawIndex, + // source name - target name + source.name + ' - ' + target.name, + // link weight + gEdge.data.weight || 0, + // special + // 这一项只是为了表明这是条边 + true + ); + + this.shapeList.push(linkShape); + this.zr.addShape(linkShape); + gEdge.shape = linkShape; + + // Arrow shape + if (serie.linkSymbol && serie.linkSymbol !== 'none') { + var symbolShape = new IconShape({ + style: { + x: -5, + y: 0, + width: serie.linkSymbolSize[0], + height: serie.linkSymbolSize[1], + iconType: serie.linkSymbol, + brushType: 'fill', + // Use same style with link shape + color: linkShape.style.strokeColor, + opacity: linkShape.style.opacity, + shadowBlur: linkShape.style.shadowBlur, + shadowColor: linkShape.style.shadowColor, + shadowOffsetX: linkShape.style.shadowOffsetX, + shadowOffsetY: linkShape.style.shadowOffsetY + }, + highlightStyle: { + brushType: 'fill' + }, + position: [0, 0], + rotation: 0 + }); + linkShape._symbolShape = symbolShape; + this.shapeList.push(symbolShape); + this.zr.addShape(symbolShape); + } + } + }, + + _updateLinkShapes: function() { + var v = vec2.create(); + var edges = this._graph.edges; + for (var i = 0, len = edges.length; i < len; i++) { + var edge = edges[i]; + var sourceShape = edge.node1.shape; + var targetShape = edge.node2.shape; + + edge.shape.style.xStart = sourceShape.position[0]; + edge.shape.style.yStart = sourceShape.position[1]; + edge.shape.style.xEnd = targetShape.position[0]; + edge.shape.style.yEnd = targetShape.position[1]; + + this.zr.modShape(edge.shape.id); + + if (edge.shape._symbolShape) { + var symbolShape = edge.shape._symbolShape; + vec2.copy(symbolShape.position, targetShape.position); + + vec2.sub(v, sourceShape.position, targetShape.position); + vec2.normalize(v, v); + + vec2.scaleAndAdd( + symbolShape.position, symbolShape.position, + v, targetShape.style.width / 2 + 2 + ); + + var angle; + if (v[1] < 0) { + angle = 2 * Math.PI - Math.acos(-v[0]); + } + else { + angle = Math.acos(-v[0]); + } + symbolShape.rotation = angle - Math.PI / 2; + + this.zr.modShape(symbolShape.id); + } + } + }, + + _syncNodePositions: function() { + var graph = this._graph; + for (var i = 0; i < graph.nodes.length; i++) { + var gNode = graph.nodes[i]; + var position = gNode.layout.position; + var node = gNode.data; + var shape = gNode.shape; + if (shape.fixed || (node.fixX && node.fixY)) { + vec2.copy(position, shape.position); + } + else if (node.fixX) { + position[0] = shape.position[0]; + shape.position[1] = position[1]; + } + else if (node.fixY) { + position[1] = shape.position[1]; + shape.position[0] = position[0]; + } + else { + vec2.copy(shape.position, position); + } + + var nodeName = node.name; + if (nodeName) { + var gPos = this.__nodePositionMap[nodeName]; + if (!gPos) { + gPos = this.__nodePositionMap[nodeName] = vec2.create(); + } + vec2.copy(gPos, position); + } + + this.zr.modShape(shape.id); + } + }, + + _step: function(e) { + this._syncNodePositions(); + + this._updateLinkShapes(); + + this.zr.refreshNextFrame(); + + if (this._layout.temperature > 0.01) { + this._layout.step(this._steps); + } + }, + + refresh: function(newOption) { + if (newOption) { + this.option = newOption; + this.series = this.option.series; + } + this._init(); + }, + + dispose: function(){ + this.clear(); + this.shapeList = null; + this.effectList = null; + + this._layout.dispose(); + this._layout = null; + + this.__nodePositionMap = {}; + } + }; + + /** + * 拖拽开始 + */ + function ondragstart(param) { + if (!this.isDragstart || !param.target) { + // 没有在当前实例上发生拖拽行为则直接返回 + return; + } + + var shape = param.target; + shape.fixed = true; + + // 处理完拖拽事件后复位 + this.isDragstart = false; + + this.zr.on(zrConfig.EVENT.MOUSEMOVE, this.onmousemove); + } + + function onmousemove() { + this._layout.temperature = 0.8; + this._step(); + } + + /** + * 数据项被拖拽出去,重载基类方法 + */ + function ondragend(param, status) { + if (!this.isDragend || !param.target) { + // 没有在当前实例上发生拖拽行为则直接返回 + return; + } + var shape = param.target; + shape.fixed = false; + + // 别status = {}赋值啊!! + status.dragIn = true; + //你自己refresh的话把他设为false,设true就会重新调refresh接口 + status.needRefresh = false; + + // 处理完拖拽事件后复位 + this.isDragend = false; + + this.zr.un(zrConfig.EVENT.MOUSEMOVE, this.onmousemove); + } + + function _randomInSquare(x, y, size) { + var v = vec2.create(); + v[0] = (Math.random() - 0.5) * size + x; + v[1] = (Math.random() - 0.5) * size + y; + return v; + } + + /* + function _filter(array, callback){ + var len = array.length; + var result = []; + for(var i = 0; i < len; i++){ + if(callback(array[i], i)){ + result.push(array[i]); + } + } + return result; + } + */ + + zrUtil.inherits(Force, ChartBase); + zrUtil.inherits(Force, ComponentBase); + + // 图表注册 + require('../chart').define('force', Force); + + return Force; +}); + +/** + * SVG Path + * @module zrender/shape/Path + * @see http://www.w3.org/TR/2011/REC-SVG11-20110816/paths.html#PathData + * @author: CrossDo (chenhuaimu@baidu.com) + */ + +/** + * @typedef {Object} IPathStyle + * @property {string} path path描述数据, 详见 {@link http://www.w3.org/TR/2011/REC-SVG11-20110816/paths.html#PathData} + * @property {number} x x轴位移 + * @property {number} y y轴位移 + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ +define('zrender/shape/Path',['require','./Base','./util/PathProxy','../tool/util'],function (require) { + + var Base = require('./Base'); + var PathProxy = require('./util/PathProxy'); + var PathSegment = PathProxy.PathSegment; + + var vMag = function(v) { + return Math.sqrt(v[0] * v[0] + v[1] * v[1]); + }; + var vRatio = function(u, v) { + return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v)); + }; + var vAngle = function(u, v) { + return (u[0] * v[1] < u[1] * v[0] ? -1 : 1) + * Math.acos(vRatio(u, v)); + }; + /** + * @alias module:zrender/shape/Path + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var Path = function (options) { + Base.call(this, options); + /** + * Path绘制样式 + * @name module:zrender/shape/Path#style + * @type {module:zrender/shape/Path~IPathStyle} + */ + /** + * Path高亮绘制样式 + * @name module:zrender/shape/Path#highlightStyle + * @type {module:zrender/shape/Path~IPathStyle} + */ + }; + + Path.prototype = { + type: 'path', + + buildPathArray : function (data, x, y) { + if (!data) { + return []; + } + + // 平移 + x = x || 0; + y = y || 0; + // command string + var cs = data; + + // command chars + var cc = [ + 'm', 'M', 'l', 'L', 'v', 'V', 'h', 'H', 'z', 'Z', + 'c', 'C', 'q', 'Q', 't', 'T', 's', 'S', 'a', 'A' + ]; + + cs = cs.replace(/-/g, ' -'); + cs = cs.replace(/ /g, ' '); + cs = cs.replace(/ /g, ','); + cs = cs.replace(/,,/g, ','); + + var n; + // create pipes so that we can split the data + for (n = 0; n < cc.length; n++) { + cs = cs.replace(new RegExp(cc[n], 'g'), '|' + cc[n]); + } + + // create array + var arr = cs.split('|'); + var ca = []; + // init context point + var cpx = 0; + var cpy = 0; + for (n = 1; n < arr.length; n++) { + var str = arr[n]; + var c = str.charAt(0); + str = str.slice(1); + str = str.replace(new RegExp('e,-', 'g'), 'e-'); + + var p = str.split(','); + if (p.length > 0 && p[0] === '') { + p.shift(); + } + + for (var i = 0; i < p.length; i++) { + p[i] = parseFloat(p[i]); + } + while (p.length > 0) { + if (isNaN(p[0])) { + break; + } + var cmd = null; + var points = []; + + var ctlPtx; + var ctlPty; + var prevCmd; + + var rx; + var ry; + var psi; + var fa; + var fs; + + var x1 = cpx; + var y1 = cpy; + + // convert l, H, h, V, and v to L + switch (c) { + case 'l': + cpx += p.shift(); + cpy += p.shift(); + cmd = 'L'; + points.push(cpx, cpy); + break; + case 'L': + cpx = p.shift(); + cpy = p.shift(); + points.push(cpx, cpy); + break; + case 'm': + cpx += p.shift(); + cpy += p.shift(); + cmd = 'M'; + points.push(cpx, cpy); + c = 'l'; + break; + case 'M': + cpx = p.shift(); + cpy = p.shift(); + cmd = 'M'; + points.push(cpx, cpy); + c = 'L'; + break; + + case 'h': + cpx += p.shift(); + cmd = 'L'; + points.push(cpx, cpy); + break; + case 'H': + cpx = p.shift(); + cmd = 'L'; + points.push(cpx, cpy); + break; + case 'v': + cpy += p.shift(); + cmd = 'L'; + points.push(cpx, cpy); + break; + case 'V': + cpy = p.shift(); + cmd = 'L'; + points.push(cpx, cpy); + break; + case 'C': + points.push(p.shift(), p.shift(), p.shift(), p.shift()); + cpx = p.shift(); + cpy = p.shift(); + points.push(cpx, cpy); + break; + case 'c': + points.push( + cpx + p.shift(), cpy + p.shift(), + cpx + p.shift(), cpy + p.shift() + ); + cpx += p.shift(); + cpy += p.shift(); + cmd = 'C'; + points.push(cpx, cpy); + break; + case 'S': + ctlPtx = cpx; + ctlPty = cpy; + prevCmd = ca[ca.length - 1]; + if (prevCmd.command === 'C') { + ctlPtx = cpx + (cpx - prevCmd.points[2]); + ctlPty = cpy + (cpy - prevCmd.points[3]); + } + points.push(ctlPtx, ctlPty, p.shift(), p.shift()); + cpx = p.shift(); + cpy = p.shift(); + cmd = 'C'; + points.push(cpx, cpy); + break; + case 's': + ctlPtx = cpx, ctlPty = cpy; + prevCmd = ca[ca.length - 1]; + if (prevCmd.command === 'C') { + ctlPtx = cpx + (cpx - prevCmd.points[2]); + ctlPty = cpy + (cpy - prevCmd.points[3]); + } + points.push( + ctlPtx, ctlPty, + cpx + p.shift(), cpy + p.shift() + ); + cpx += p.shift(); + cpy += p.shift(); + cmd = 'C'; + points.push(cpx, cpy); + break; + case 'Q': + points.push(p.shift(), p.shift()); + cpx = p.shift(); + cpy = p.shift(); + points.push(cpx, cpy); + break; + case 'q': + points.push(cpx + p.shift(), cpy + p.shift()); + cpx += p.shift(); + cpy += p.shift(); + cmd = 'Q'; + points.push(cpx, cpy); + break; + case 'T': + ctlPtx = cpx, ctlPty = cpy; + prevCmd = ca[ca.length - 1]; + if (prevCmd.command === 'Q') { + ctlPtx = cpx + (cpx - prevCmd.points[0]); + ctlPty = cpy + (cpy - prevCmd.points[1]); + } + cpx = p.shift(); + cpy = p.shift(); + cmd = 'Q'; + points.push(ctlPtx, ctlPty, cpx, cpy); + break; + case 't': + ctlPtx = cpx, ctlPty = cpy; + prevCmd = ca[ca.length - 1]; + if (prevCmd.command === 'Q') { + ctlPtx = cpx + (cpx - prevCmd.points[0]); + ctlPty = cpy + (cpy - prevCmd.points[1]); + } + cpx += p.shift(); + cpy += p.shift(); + cmd = 'Q'; + points.push(ctlPtx, ctlPty, cpx, cpy); + break; + case 'A': + rx = p.shift(); + ry = p.shift(); + psi = p.shift(); + fa = p.shift(); + fs = p.shift(); + + x1 = cpx, y1 = cpy; + cpx = p.shift(), cpy = p.shift(); + cmd = 'A'; + points = this._convertPoint( + x1, y1, cpx, cpy, fa, fs, rx, ry, psi + ); + break; + case 'a': + rx = p.shift(); + ry = p.shift(); + psi = p.shift(); + fa = p.shift(); + fs = p.shift(); + + x1 = cpx, y1 = cpy; + cpx += p.shift(); + cpy += p.shift(); + cmd = 'A'; + points = this._convertPoint( + x1, y1, cpx, cpy, fa, fs, rx, ry, psi + ); + break; + } + + // 平移变换 + for (var j = 0, l = points.length; j < l; j += 2) { + points[j] += x; + points[j + 1] += y; + } + ca.push(new PathSegment( + cmd || c, points + )); + } + + if (c === 'z' || c === 'Z') { + ca.push(new PathSegment('z', [])); + } + } + + return ca; + }, + + _convertPoint : function (x1, y1, x2, y2, fa, fs, rx, ry, psiDeg) { + var psi = psiDeg * (Math.PI / 180.0); + var xp = Math.cos(psi) * (x1 - x2) / 2.0 + + Math.sin(psi) * (y1 - y2) / 2.0; + var yp = -1 * Math.sin(psi) * (x1 - x2) / 2.0 + + Math.cos(psi) * (y1 - y2) / 2.0; + + var lambda = (xp * xp) / (rx * rx) + (yp * yp) / (ry * ry); + + if (lambda > 1) { + rx *= Math.sqrt(lambda); + ry *= Math.sqrt(lambda); + } + + var f = Math.sqrt((((rx * rx) * (ry * ry)) + - ((rx * rx) * (yp * yp)) + - ((ry * ry) * (xp * xp))) / ((rx * rx) * (yp * yp) + + (ry * ry) * (xp * xp)) + ); + + if (fa === fs) { + f *= -1; + } + if (isNaN(f)) { + f = 0; + } + + var cxp = f * rx * yp / ry; + var cyp = f * -ry * xp / rx; + + var cx = (x1 + x2) / 2.0 + + Math.cos(psi) * cxp + - Math.sin(psi) * cyp; + var cy = (y1 + y2) / 2.0 + + Math.sin(psi) * cxp + + Math.cos(psi) * cyp; + + var theta = vAngle([ 1, 0 ], [ (xp - cxp) / rx, (yp - cyp) / ry ]); + var u = [ (xp - cxp) / rx, (yp - cyp) / ry ]; + var v = [ (-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry ]; + var dTheta = vAngle(u, v); + + if (vRatio(u, v) <= -1) { + dTheta = Math.PI; + } + if (vRatio(u, v) >= 1) { + dTheta = 0; + } + if (fs === 0 && dTheta > 0) { + dTheta = dTheta - 2 * Math.PI; + } + if (fs === 1 && dTheta < 0) { + dTheta = dTheta + 2 * Math.PI; + } + return [ cx, cy, rx, ry, theta, dTheta, psi, fs ]; + }, + + /** + * 创建路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Path~IPathStyle} style + */ + buildPath : function (ctx, style) { + var path = style.path; + + // 平移坐标 + var x = style.x || 0; + var y = style.y || 0; + + style.pathArray = style.pathArray || this.buildPathArray(path, x, y); + var pathArray = style.pathArray; + + // 记录边界点,用于判断inside + var pointList = style.pointList = []; + var singlePointList = []; + for (var i = 0, l = pathArray.length; i < l; i++) { + if (pathArray[i].command.toUpperCase() == 'M') { + singlePointList.length > 0 + && pointList.push(singlePointList); + singlePointList = []; + } + var p = pathArray[i].points; + for (var j = 0, k = p.length; j < k; j += 2) { + singlePointList.push([p[j], p[j + 1]]); + } + } + singlePointList.length > 0 && pointList.push(singlePointList); + + for (var i = 0, l = pathArray.length; i < l; i++) { + var c = pathArray[i].command; + var p = pathArray[i].points; + switch (c) { + case 'L': + ctx.lineTo(p[0], p[1]); + break; + case 'M': + ctx.moveTo(p[0], p[1]); + break; + case 'C': + ctx.bezierCurveTo(p[0], p[1], p[2], p[3], p[4], p[5]); + break; + case 'Q': + ctx.quadraticCurveTo(p[0], p[1], p[2], p[3]); + break; + case 'A': + var cx = p[0]; + var cy = p[1]; + var rx = p[2]; + var ry = p[3]; + var theta = p[4]; + var dTheta = p[5]; + var psi = p[6]; + var fs = p[7]; + var r = (rx > ry) ? rx : ry; + var scaleX = (rx > ry) ? 1 : rx / ry; + var scaleY = (rx > ry) ? ry / rx : 1; + + ctx.translate(cx, cy); + ctx.rotate(psi); + ctx.scale(scaleX, scaleY); + ctx.arc(0, 0, r, theta, theta + dTheta, 1 - fs); + ctx.scale(1 / scaleX, 1 / scaleY); + ctx.rotate(-psi); + ctx.translate(-cx, -cy); + break; + case 'z': + ctx.closePath(); + break; + } + } + + return; + }, + + /** + * 计算返回Path包围盒矩形。 + * @param {module:zrender/shape/Path~IPathStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function (style) { + if (style.__rect) { + return style.__rect; + } + + var lineWidth; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } + else { + lineWidth = 0; + } + + var minX = Number.MAX_VALUE; + var maxX = Number.MIN_VALUE; + + var minY = Number.MAX_VALUE; + var maxY = Number.MIN_VALUE; + + // 平移坐标 + var x = style.x || 0; + var y = style.y || 0; + + var pathArray = style.pathArray || this.buildPathArray(style.path); + for (var i = 0; i < pathArray.length; i++) { + var p = pathArray[i].points; + + for (var j = 0; j < p.length; j++) { + if (j % 2 === 0) { + if (p[j] + x < minX) { + minX = p[j]; + } + if (p[j] + x > maxX) { + maxX = p[j]; + } + } + else { + if (p[j] + y < minY) { + minY = p[j]; + } + if (p[j] + y > maxY) { + maxY = p[j]; + } + } + } + } + + var rect; + if (minX === Number.MAX_VALUE + || maxX === Number.MIN_VALUE + || minY === Number.MAX_VALUE + || maxY === Number.MIN_VALUE + ) { + rect = { + x : 0, + y : 0, + width : 0, + height : 0 + }; + } + else { + rect = { + x : Math.round(minX - lineWidth / 2), + y : Math.round(minY - lineWidth / 2), + width : maxX - minX + lineWidth, + height : maxY - minY + lineWidth + }; + } + style.__rect = rect; + return rect; + } + }; + + require('../tool/util').inherits(Path, Base); + return Path; +}); + +/** + * 水滴形状 + * @module zrender/shape/Ellipse + * @author loutongbing@baidu.com + * @example + * var Ellipse = require('zrender/shape/Ellipse'); + * var shape = new Ellipse({ + * style: { + * x: 100, + * y: 100, + * a: 40, + * b: 20, + * brushType: 'both', + * color: 'blue', + * strokeColor: 'red', + * lineWidth: 3, + * text: 'Ellipse' + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} IEllipseStyle + * @property {number} x 圆心x坐标 + * @property {number} y 圆心y坐标 + * @property {number} a 横轴半径 + * @property {number} b 纵轴半径 + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ +define( + 'zrender/shape/Ellipse',['require','./Base','../tool/util'],function (require) { + var Base = require('./Base'); + + /** + * @alias module:zrender/shape/Ellipse + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var Ellipse = function(options) { + Base.call(this, options); + /** + * 椭圆绘制样式 + * @name module:zrender/shape/Ellipse#style + * @type {module:zrender/shape/Ellipse~IEllipseStyle} + */ + /** + * 椭圆高亮绘制样式 + * @name module:zrender/shape/Ellipse#highlightStyle + * @type {module:zrender/shape/Ellipse~IEllipseStyle} + */ + }; + + Ellipse.prototype = { + type: 'ellipse', + + /** + * 构建椭圆的Path + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Ellipse~IEllipseStyle} style + */ + buildPath : function(ctx, style) { + var k = 0.5522848; + var x = style.x; + var y = style.y; + var a = style.a; + var b = style.b; + var ox = a * k; // 水平控制点偏移量 + var oy = b * k; // 垂直控制点偏移量 + // 从椭圆的左端点开始顺时针绘制四条三次贝塞尔曲线 + ctx.moveTo(x - a, y); + ctx.bezierCurveTo(x - a, y - oy, x - ox, y - b, x, y - b); + ctx.bezierCurveTo(x + ox, y - b, x + a, y - oy, x + a, y); + ctx.bezierCurveTo(x + a, y + oy, x + ox, y + b, x, y + b); + ctx.bezierCurveTo(x - ox, y + b, x - a, y + oy, x - a, y); + ctx.closePath(); + }, + + /** + /** + * 计算返回椭圆包围盒矩形。 + * @param {module:zrender/shape/Ellipse~IEllipseStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function(style) { + if (style.__rect) { + return style.__rect; + } + + var lineWidth; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } + else { + lineWidth = 0; + } + style.__rect = { + x : Math.round(style.x - style.a - lineWidth / 2), + y : Math.round(style.y - style.b - lineWidth / 2), + width : style.a * 2 + lineWidth, + height : style.b * 2 + lineWidth + }; + + return style.__rect; + } + }; + + require('../tool/util').inherits(Ellipse, Base); + return Ellipse; + } +); + +/** + * echarts组件:漫游控制器 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/component/roamController',['require','./base','zrender/shape/Rectangle','zrender/shape/Sector','zrender/shape/Circle','../config','zrender/tool/util','zrender/tool/color','zrender/tool/event','../component'],function (require) { + var Base = require('./base'); + + // 图形依赖 + var RectangleShape = require('zrender/shape/Rectangle'); + var SectorShape = require('zrender/shape/Sector'); + var CircleShape = require('zrender/shape/Circle'); + + var ecConfig = require('../config'); + var zrUtil = require('zrender/tool/util'); + var zrColor = require('zrender/tool/color'); + var zrEvent = require('zrender/tool/event'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} option 图表参数 + */ + function RoamController(ecTheme, messageCenter, zr, option, myChart) { + if (!option.roamController || !option.roamController.show) { + return; + } + if (!option.roamController.mapTypeControl) { + console.error('option.roamController.mapTypeControl has not been defined.'); + return; + } + + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + + this.rcOption = option.roamController; + + var self = this; + this._drictionMouseDown = function(params) { + return self.__drictionMouseDown(params); + }; + this._drictionMouseUp = function(params) { + return self.__drictionMouseUp(params); + }; + this._drictionMouseMove = function(params) { + return self.__drictionMouseMove(params); + }; + this._drictionMouseOut = function(params) { + return self.__drictionMouseOut(params); + }; + this._scaleHandler = function(params) { + return self.__scaleHandler(params); + }; + this.refresh(option); + } + + RoamController.prototype = { + type: ecConfig.COMPONENT_TYPE_ROAMCONTROLLER, + _buildShape: function () { + // 元素组的位置参数,通过计算所得x, y, width, height + this._itemGroupLocation = this._getItemGroupLocation(); + + this._buildBackground(); + this._buildItem(); + + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + }, + + /** + * 构建所有漫游控制器元素 + */ + _buildItem: function () { + this.shapeList.push(this._getDirectionShape('up')); + this.shapeList.push(this._getDirectionShape('down')); + this.shapeList.push(this._getDirectionShape('left')); + this.shapeList.push(this._getDirectionShape('right')); + this.shapeList.push(this._getScaleShape('scaleUp')); + this.shapeList.push(this._getScaleShape('scaleDown')); + }, + + _getDirectionShape: function(direction) { + var r = this._itemGroupLocation.r; + var x = this._itemGroupLocation.x + r; + var y = this._itemGroupLocation.y + r; + + var sectorShape = { + zlevel: this._zlevelBase, + style: { + x: x, // 圆心横坐标 + y: y, // 圆心纵坐标 + r: r, // 圆环外半径 + startAngle: -45, + endAngle: 45, + color: this.rcOption.handlerColor, + text: '>', + textX: x + r / 2 + 4, + textY: y - 0.5, + textAlign: 'center', + textBaseline: 'middle', + textPosition: 'specific', + textColor: this.rcOption.fillerColor, + textFont: Math.floor(r / 2) + 'px arial' + }, + highlightStyle: { + color: zrColor.lift(this.rcOption.handlerColor, -0.2), + brushType: 'fill' + }, + clickable: true + }; + switch (direction) { + case 'up': + sectorShape.rotation = [Math.PI / 2, x, y]; + break; + case 'left': + sectorShape.rotation = [Math.PI, x, y]; + break; + case 'down': + sectorShape.rotation = [-Math.PI / 2, x, y]; + break; + } + + sectorShape = new SectorShape(sectorShape); + sectorShape._roamType = direction; + sectorShape.onmousedown = this._drictionMouseDown; + sectorShape.onmouseup = this._drictionMouseUp; + sectorShape.onmousemove = this._drictionMouseMove; + sectorShape.onmouseout = this._drictionMouseOut; + + return sectorShape; + }, + + _getScaleShape: function(text) { + var width = this._itemGroupLocation.width; + var height = this._itemGroupLocation.height - width; + height = height < 0 ? 20 : height; // 确保height不为负 + + var r = Math.min(width / 2 - 5, height) / 2; + var x = this._itemGroupLocation.x + + (text === 'scaleDown' ? (width - r) : r); + var y = this._itemGroupLocation.y + this._itemGroupLocation.height - r; + + var scaleShape = { + zlevel: this._zlevelBase, + style: { + x: x, + y: y, + r: r, + color: this.rcOption.handlerColor, + text: text === 'scaleDown' ? '-' : '+', + textX: x, + textY: y - 2, + textAlign: 'center', + textBaseline: 'middle', + textPosition: 'specific', + textColor: this.rcOption.fillerColor, + textFont: Math.floor(r) + 'px verdana' + }, + highlightStyle: { + color: zrColor.lift(this.rcOption.handlerColor, -0.2), + brushType: 'fill' + }, + clickable: true + }; + + scaleShape = new CircleShape(scaleShape); + scaleShape._roamType = text; + scaleShape.onmousedown = this._scaleHandler; + + return scaleShape; + }, + + _buildBackground: function () { + var pTop = this.rcOption.padding[0]; + var pRight = this.rcOption.padding[1]; + var pBottom = this.rcOption.padding[2]; + var pLeft = this.rcOption.padding[3]; + + this.shapeList.push(new RectangleShape({ + zlevel: this._zlevelBase, + hoverable :false, + style: { + x: this._itemGroupLocation.x - pLeft, + y: this._itemGroupLocation.y - pTop, + width: this._itemGroupLocation.width + pLeft + pRight, + height: this._itemGroupLocation.height + pTop + pBottom, + brushType: this.rcOption.borderWidth === 0 ? 'fill' : 'both', + color: this.rcOption.backgroundColor, + strokeColor: this.rcOption.borderColor, + lineWidth: this.rcOption.borderWidth + } + })); + }, + + /** + * 根据选项计算漫游控制器实体的位置坐标 + */ + _getItemGroupLocation: function () { + var padding = this.rcOption.padding; + var width = this.rcOption.width; + var height = this.rcOption.height; + + var zrWidth = this.zr.getWidth(); + var zrHeight = this.zr.getHeight(); + var x; + switch (this.rcOption.x) { + case 'center' : + x = Math.floor((zrWidth - width) / 2); + break; + case 'left' : + x = padding[3] + this.rcOption.borderWidth; + break; + case 'right' : + x = zrWidth + - width + - padding[1] + - padding[3] + - this.rcOption.borderWidth * 2; + break; + default : + x = this.parsePercent(this.rcOption.x, zrWidth); + break; + } + + var y; + switch (this.rcOption.y) { + case 'top' : + y = padding[0] + this.rcOption.borderWidth; + break; + case 'bottom' : + y = zrHeight + - height + - padding[0] + - padding[2] + - this.rcOption.borderWidth * 2; + break; + case 'center' : + y = Math.floor((zrHeight - height) / 2); + break; + default : + y = this.parsePercent(this.rcOption.y, zrHeight); + break; + } + + return { + x: x, + y: y, + r: width / 2, + width: width, + height: height + }; + }, + + __drictionMouseDown: function(params) { + this.mousedown = true; + this._drictionHandlerOn(params); + }, + + __drictionMouseUp: function(params) { + this.mousedown = false; + this._drictionHandlerOff(params); + }, + + __drictionMouseMove: function(params) { + if (this.mousedown) { + this._drictionHandlerOn(params); + } + }, + + __drictionMouseOut: function(params) { + this._drictionHandlerOff(params); + }, + + _drictionHandlerOn: function(params) { + this._dispatchEvent(params.event, params.target._roamType); + clearInterval(this.dircetionTimer); + var self = this; + this.dircetionTimer = setInterval(function() { + self._dispatchEvent(params.event, params.target._roamType); + }, 100); + zrEvent.stop(params.event); + }, + + _drictionHandlerOff: function(params) { + clearInterval(this.dircetionTimer); + }, + + __scaleHandler: function(params) { + this._dispatchEvent(params.event, params.target._roamType); + zrEvent.stop(params.event); + }, + + _dispatchEvent: function(event, roamType){ + this.messageCenter.dispatch( + ecConfig.EVENT.ROAMCONTROLLER, + event, + { + roamType: roamType, + mapTypeControl: this.rcOption.mapTypeControl, + step: this.rcOption.step + }, + this.myChart + ); + }, + /** + * 刷新 + */ + refresh: function (newOption) { + if (newOption) { + this.option = newOption || this.option; + this.option.roamController = this.reformOption(this.option.roamController); + // 补全padding属性 + this.option.roamController.padding = this.reformCssArray( + this.option.roamController.padding + ); + this.rcOption = this.option.roamController; + } + this.clear(); + this._buildShape(); + } + }; + + + zrUtil.inherits(RoamController, Base); + + require('../component').define('roamController', RoamController); + + return RoamController; +}); + + + +/** + * 地图参数 + * key为地图类型: { + * getGeoJson: 地图数据加载 + * } + */ +define('echarts/util/mapData/params',['require'],function (require) { + function decode(json) { + if (!json.UTF8Encoding) { + return json; + } + var features = json.features; + + for (var f = 0; f < features.length; f++) { + var feature = features[f]; + var coordinates = feature.geometry.coordinates; + var encodeOffsets = feature.geometry.encodeOffsets; + + for (var c = 0; c < coordinates.length; c++) { + var coordinate = coordinates[c]; + + if (feature.geometry.type === 'Polygon') { + coordinates[c] = decodePolygon( + coordinate, + encodeOffsets[c] + ); + } else if (feature.geometry.type === 'MultiPolygon') { + for (var c2 = 0; c2 < coordinate.length; c2++) { + var polygon = coordinate[c2]; + coordinate[c2] = decodePolygon( + polygon, + encodeOffsets[c][c2] + ); + } + } + } + } + // Has been decoded + json.UTF8Encoding = false; + return json; + } + + function decodePolygon(coordinate, encodeOffsets) { + var result = []; + var prevX = encodeOffsets[0]; + var prevY = encodeOffsets[1]; + + for (var i = 0; i < coordinate.length; i+=2) { + var x = coordinate.charCodeAt(i) - 64; + var y = coordinate.charCodeAt(i+1) - 64; + // ZigZag decoding + x = (x >> 1) ^ (-(x & 1)); + y = (y >> 1) ^ (-(y & 1)); + // Delta deocding + x += prevX; + y += prevY; + + prevX = x; + prevY = y; + // Dequantize + result.push([x / 1024, y / 1024]); + } + + return result; + } + + var mapParams = { + 'none': { + getGeoJson: function(callback) { + callback({ + type: 'FeatureCollection', + features: [{ + type: 'Feature', + geometry: { + coordinates: [], + encodeOffsets: [], + type: 'Polygon' + }, + properties: { + + } + }] + }); + } + }, + 'world': { + getGeoJson: function (callback) { + require(['./geoJson/world_geo'], function (md){ + callback(decode(md)); + }); + } + }, + 'china': { + getGeoJson: function (callback) { + require(['./geoJson/china_geo'], function (md){ + callback(decode(md)); + }); + } + }, + '南海诸岛': { + textCoord: [126, 25], + getPath: function (leftTop, scale) { + // scale.x: width = 10.51 : 64 + var pList = [ + [ + [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] + ] + ]; + var str = ''; + var left = leftTop[0]; + var top = leftTop[1]; + for (var i = 0, l = pList.length; i < l; i++) { + str += 'M ' + + ((pList[i][0][0] * scale+ left).toFixed(2) - 0) + + ' ' + + ((pList[i][0][1] * scale + top).toFixed(2) - 0) + + ' '; + for (var j = 1, k = pList[i].length; j < k; j++) { + str += 'L ' + + ((pList[i][j][0] * scale + left).toFixed(2) - 0) + + ' ' + + ((pList[i][j][1] * scale + top).toFixed(2) - 0) + + ' '; + } + } + return str + ' Z'; + } + }, + '新疆': { + getGeoJson: function (callback) { + require(['./geoJson/xin_jiang_geo'], function (md){ + callback(decode(md)); + }); + } + }, + '西藏': { + getGeoJson: function (callback) { + require(['./geoJson/xi_zang_geo'], function (md){ + callback(decode(md)); + }); + } + }, + '内蒙古': { + getGeoJson: function (callback) { + require(['./geoJson/nei_meng_gu_geo'], function (md){ + callback(decode(md)); + }); + } + }, + '青海': { + getGeoJson: function (callback) { + require(['./geoJson/qing_hai_geo'], function (md){ + callback(decode(md)); + }); + } + }, + '四川': { + getGeoJson: function (callback) { + require(['./geoJson/si_chuan_geo'], function (md){ + callback(decode(md)); + }); + } + }, + '黑龙江': { + getGeoJson: function (callback) { + require(['./geoJson/hei_long_jiang_geo'], function (md){ + callback(decode(md)); + }); + } + }, + '甘肃': { + getGeoJson: function (callback) { + require(['./geoJson/gan_su_geo'], function (md){ + callback(decode(md)); + }); + } + }, + '云南': { + getGeoJson: function (callback) { + require(['./geoJson/yun_nan_geo'], function (md){ + callback(decode(md)); + }); + } + }, + '广西': { + getGeoJson: function (callback) { + require(['./geoJson/guang_xi_geo'], function (md){ + callback(decode(md)); + }); + } + }, + '湖南': { + getGeoJson: function (callback) { + require(['./geoJson/hu_nan_geo'], function (md){ + callback(decode(md)); + }); + } + }, + '陕西': { + getGeoJson: function (callback) { + require(['./geoJson/shan_xi_1_geo'], function (md){ + callback(decode(md)); + }); + } + }, + '广东': { + getGeoJson: function (callback) { + require(['./geoJson/guang_dong_geo'], function (md){ + callback(decode(md)); + }); + } + }, + '吉林': { + getGeoJson: function (callback) { + require(['./geoJson/ji_lin_geo'], function (md){ + callback(decode(md)); + }); + } + }, + '河北': { + getGeoJson: function (callback) { + require(['./geoJson/he_bei_geo'], function (md){ + callback(decode(md)); + }); + } + }, + '湖北': { + getGeoJson: function (callback) { + require(['./geoJson/hu_bei_geo'], function (md){ + callback(decode(md)); + }); + } + }, + '贵州': { + getGeoJson: function (callback) { + require(['./geoJson/gui_zhou_geo'], function (md){ + callback(decode(md)); + }); + } + }, + '山东': { + getGeoJson: function (callback) { + require(['./geoJson/shan_dong_geo'], function (md){ + callback(decode(md)); + }); + } + }, + '江西': { + getGeoJson: function (callback) { + require(['./geoJson/jiang_xi_geo'], function (md){ + callback(decode(md)); + }); + } + }, + '河南': { + getGeoJson: function (callback) { + require(['./geoJson/he_nan_geo'], function (md){ + callback(decode(md)); + }); + } + }, + '辽宁': { + getGeoJson: function (callback) { + require(['./geoJson/liao_ning_geo'], function (md){ + callback(decode(md)); + }); + } + }, + '山西': { + getGeoJson: function (callback) { + require(['./geoJson/shan_xi_2_geo'], function (md){ + callback(decode(md)); + }); + } + }, + '安徽': { + getGeoJson: function (callback) { + require(['./geoJson/an_hui_geo'], function (md){ + callback(decode(md)); + }); + } + }, + '福建': { + getGeoJson: function (callback) { + require(['./geoJson/fu_jian_geo'], function (md){ + callback(decode(md)); + }); + } + }, + '浙江': { + getGeoJson: function (callback) { + require(['./geoJson/zhe_jiang_geo'], function (md){ + callback(decode(md)); + }); + } + }, + '江苏': { + getGeoJson: function (callback) { + require(['./geoJson/jiang_su_geo'], function (md){ + callback(decode(md)); + }); + } + }, + '重庆': { + getGeoJson: function (callback) { + require(['./geoJson/chong_qing_geo'], function (md){ + callback(decode(md)); + }); + } + }, + '宁夏': { + getGeoJson: function (callback) { + require(['./geoJson/ning_xia_geo'], function (md){ + callback(decode(md)); + }); + } + }, + '海南': { + getGeoJson: function (callback) { + require(['./geoJson/hai_nan_geo'], function (md){ + callback(decode(md)); + }); + } + }, + '台湾': { + getGeoJson: function (callback) { + require(['./geoJson/tai_wan_geo'], function (md){ + callback(decode(md)); + }); + } + }, + '北京': { + getGeoJson: function (callback) { + require(['./geoJson/bei_jing_geo'], function (md){ + callback(decode(md)); + }); + } + }, + '天津': { + getGeoJson: function (callback) { + require(['./geoJson/tian_jin_geo'], function (md){ + callback(decode(md)); + }); + } + }, + '上海': { + getGeoJson: function (callback) { + require(['./geoJson/shang_hai_geo'], function (md){ + callback(decode(md)); + }); + } + }, + '香港': { + getGeoJson: function (callback) { + require(['./geoJson/xiang_gang_geo'], function (md){ + callback(decode(md)); + }); + } + }, + '澳门': { + getGeoJson: function (callback) { + require(['./geoJson/ao_men_geo'], function (md){ + callback(decode(md)); + }); + } + } + }; + + return { + decode: decode, + params: mapParams + }; +}); +/** + * 地图文本位置修正 + */ +define('echarts/util/mapData/textFixed',[],function() { + // fix = [xFixed, yFixed, scale] + // textX += fix[0]; + // textY += fix[1]; + return { + //'南海诸岛' : [32, 83], + // 全国 + '广东': [0, -10], + '香港': [10, 10], + '澳门': [-10, 18], + '黑龙江' : [0, 20], + //'北京': [-10, 0], + '天津': [5, 5], + // 广东 + '深圳市': [-35, 0], + // 云南 + '红河哈尼族彝族自治州' : [0, 20], + '楚雄彝族自治州': [-5, 15], + // 新疆 + '石河子市': [-5, 5], + '五家渠市': [0, -10], + '昌吉回族自治州': [10, 10], + // 海南 + '昌江黎族自治县': [0,20], + '陵水黎族自治县': [0,20], + '东方市': [0,20], + // 陕西 + '渭南市': [0,20] + }; +}); +/** + * 经纬度坐标,优先于自定计算 + */ +define('echarts/util/mapData/geoCoord',[],function() { + return { + 'Russia': [ 100, 60 ], + 'United States of America': [ -99, 38 ] + }; +}); +/** + * echarts地图一般投射算法 + * modify from GeoMap v0.5.3 https://github.com/x6doooo/GeoMap + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/util/projection/svg',['require','zrender/shape/Path'],function(require) { + + var PathShape = require('zrender/shape/Path'); + function toFloat(str) { + return parseFloat(str || 0); + } + + function getBbox(root) { + var svgNode = root.firstChild; + // Find the svg node + while (!(svgNode.nodeName.toLowerCase() == 'svg' && svgNode.nodeType == 1)) { + svgNode = svgNode.nextSibling; + } + + var x = toFloat(svgNode.getAttribute('x')); + var y = toFloat(svgNode.getAttribute('y')); + var width = toFloat(svgNode.getAttribute('width')); + var height = toFloat(svgNode.getAttribute('height')); + return { + left: x, + top: y, + width: width, + height: height + }; + } + + function geoJson2Path(root, transform) { + var scale = [transform.scale.x, transform.scale.y]; + var elList = []; + function _getShape(root) { + var tagName = root.tagName; + if (shapeBuilders[tagName]) { + var obj = shapeBuilders[tagName](root, scale); + + if (obj) { + // Common attributes + obj.scale = scale; + obj.properties = { + name: root.getAttribute('name') || '' + }; + obj.id = root.id; + extendCommonAttributes(obj, root); + + elList.push(obj); + } + } + var shapes = root.childNodes; + for (var i = 0, len = shapes.length; i < len; i++) { + _getShape(shapes[i]); + } + } + _getShape(root); + return elList; + } + + /** + * 平面坐标转经纬度 + * @param {Array} p + */ + function pos2geo(obj, p) { + var point = p instanceof Array ? [p[0] * 1, p[1] * 1] : [p.x * 1, p.y * 1]; + return [point[0] / obj.scale.x, point[1] / obj.scale.y]; + } + + /** + * 经纬度转平面坐标 + * @param {Array | Object} p + */ + function geo2pos(obj, p) { + var point = p instanceof Array ? [p[0] * 1, p[1] * 1] : [p.x * 1, p.y * 1]; + return [point[0] * obj.scale.x, point[1] * obj.scale.y]; + } + + function trim(str) { + return str.replace(/^\s\s*/, '').replace(/\s\s*$/, ''); + } + + function extendCommonAttributes(obj, xmlNode) { + + var color = xmlNode.getAttribute('fill'); + var strokeColor = xmlNode.getAttribute('stroke'); + var lineWidth = xmlNode.getAttribute('stroke-width'); + var opacity = xmlNode.getAttribute('opacity'); + + if (color && color != 'none') { + obj.color = color; + if (strokeColor) { + obj.brushType = 'both'; + obj.strokeColor = strokeColor; + } else { + obj.brushType = 'fill'; + } + } else if (strokeColor && strokeColor != 'none') { + obj.strokeColor = strokeColor; + obj.brushType = 'stroke'; + } + if (lineWidth && lineWidth != 'none') { + obj.lineWidth = parseFloat(lineWidth); + } + if (opacity && opacity != 'none') { + obj.opacity = parseFloat(opacity); + } + } + + function parsePoints(str) { + var list = trim(str).replace(/,/g, ' ').split(/\s+/); + var points = []; + + for (var i = 0; i < list.length;) { + var x = parseFloat(list[i++]); + var y = parseFloat(list[i++]); + points.push([x, y]); + } + return points; + } + + // Regular svg shapes + var shapeBuilders = { + path: function(xmlNode, scale) { + var path = xmlNode.getAttribute('d'); + var rect = PathShape.prototype.getRect({ path : path }); + return { + shapeType: 'path', + path: path, + cp: [ + (rect.x + rect.width / 2) * scale[0], + (rect.y + rect.height / 2) * scale[1] + ] + }; + }, + + rect: function(xmlNode, scale) { + var x = toFloat(xmlNode.getAttribute('x')); + var y = toFloat(xmlNode.getAttribute('y')); + var width = toFloat(xmlNode.getAttribute('width')); + var height = toFloat(xmlNode.getAttribute('height')); + + return { + shapeType: 'rectangle', + x: x, + y: y, + width: width, + height: height, + cp: [ + (x + width / 2) * scale[0], + (y + height / 2) * scale[1] + ] + }; + }, + + line: function(xmlNode, scale) { + var x1 = toFloat(xmlNode.getAttribute('x1')); + var y1 = toFloat(xmlNode.getAttribute('y1')); + var x2 = toFloat(xmlNode.getAttribute('x2')); + var y2 = toFloat(xmlNode.getAttribute('y2')); + + return { + shapeType: 'line', + xStart: x1, + yStart: y1, + xEnd: x2, + yEnd: y2, + cp: [ + (x1 + x2) * 0.5 * scale[0], + (y1 + y2) * 0.5 * scale[1] + ] + }; + }, + + circle: function(xmlNode, scale) { + var cx = toFloat(xmlNode.getAttribute('cx')); + var cy = toFloat(xmlNode.getAttribute('cy')); + var r = toFloat(xmlNode.getAttribute('r')); + + return { + shapeType: 'circle', + x: cx, + y: cy, + r: r, + cp: [ + cx * scale[0], + cy * scale[1] + ] + }; + }, + + ellipse: function(xmlNode, scale) { + var cx = parseFloat(xmlNode.getAttribute('cx') || 0); + var cy = parseFloat(xmlNode.getAttribute('cy') || 0); + var rx = parseFloat(xmlNode.getAttribute('rx') || 0); + var ry = parseFloat(xmlNode.getAttribute('ry') || 0); + + return { + shapeType: 'ellipse', + x: cx, + y: cy, + a: rx, + b: ry, + cp: [ + cx * scale[0], + cy * scale[1] + ] + }; + }, + + polygon: function(xmlNode, scale) { + var points = xmlNode.getAttribute('points'); + var min = [Infinity, Infinity]; + var max = [-Infinity, -Infinity]; + if (points) { + points = parsePoints(points); + + for (var i = 0; i < points.length; i++) { + var p = points[i]; + + min[0] = Math.min(p[0], min[0]); + min[1] = Math.min(p[1], min[1]); + + max[0] = Math.max(p[0], max[0]); + max[1] = Math.max(p[1], max[1]); + + } + return { + shapeType: 'polygon', + pointList: points, + cp: [ + (min[0] + max[0]) / 2 * scale[0], + (min[1] + max[1]) / 2 * scale[0] + ] + }; + } + }, + + polyline: function(xmlNode, scale) { + var obj = shapeBuilders.polygon(xmlNode, scale); + return obj; + } + }; + + return { + getBbox: getBbox, + geoJson2Path: geoJson2Path, + pos2geo: pos2geo, + geo2pos: geo2pos + }; }); -/** - * echarts地图一般投射算法 - * modify from GeoMap v0.5.3 https://github.com/x6doooo/GeoMap - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/util/projection/normal',[],function() { - function getBbox(json, specialArea) { - specialArea = specialArea || {}; - if (!json.srcSize) { - parseSrcSize(json, specialArea); - } - - return json.srcSize; - } - - function parseSrcSize(json, specialArea) { - specialArea = specialArea || {}; - convertorParse.xmin = 360; - convertorParse.xmax = -360; - convertorParse.ymin = 180; - convertorParse.ymax = -180; - - var shapes = json.features; - var geometries; - var shape; - for (var i = 0, len = shapes.length; i < len; i++) { - shape = shapes[i]; - if (shape.properties.name && specialArea[shape.properties.name]) { - continue; - } - - switch (shape.type) { - case 'Feature': - convertorParse[shape.geometry.type](shape.geometry.coordinates); - break; - case 'GeometryCollection' : - geometries = shape.geometries; - for (var j = 0, len2 = geometries.length; j < len2; j++) { - convertorParse[geometries[j].type]( - geometries[j].coordinates - ); - } - break; - } - } - - json.srcSize = { - left : convertorParse.xmin.toFixed(4)*1, - top : convertorParse.ymin.toFixed(4)*1, - width : (convertorParse.xmax - convertorParse.xmin).toFixed(4)*1, - height : (convertorParse.ymax - convertorParse.ymin).toFixed(4)*1 - }; - - return json; - } - - var convertor = { - //调整俄罗斯东部到地图右侧与俄罗斯相连 - formatPoint : function (p) { - return [ - ((p[0] < -168.5 && p[1] > 63.8) ? p[0] + 360 : p[0]) + 168.5, - 90 - p[1] - ]; - }, - makePoint : function (p) { - var self = this; - var point = self.formatPoint(p); - // for cp - if (self._bbox.xmin > p[0]) { self._bbox.xmin = p[0]; } - if (self._bbox.xmax < p[0]) { self._bbox.xmax = p[0]; } - if (self._bbox.ymin > p[1]) { self._bbox.ymin = p[1]; } - if (self._bbox.ymax < p[1]) { self._bbox.ymax = p[1]; } - var x = (point[0] - convertor.offset.x) * convertor.scale.x - + convertor.offset.left; - var y = (point[1] - convertor.offset.y) * convertor.scale.y - + convertor.offset.top; - return [x, y]; - }, - Point : function (coordinates) { - coordinates = this.makePoint(coordinates); - return coordinates.join(','); - }, - LineString : function (coordinates) { - var str = ''; - var point; - for (var i = 0, len = coordinates.length; i < len; i++) { - point = convertor.makePoint(coordinates[i]); - if (i === 0) { - str = 'M' + point.join(','); - } else { - str = str + 'L' + point.join(','); - } - } - return str; - }, - Polygon : function (coordinates) { - var str = ''; - for (var i = 0, len = coordinates.length; i < len; i++) { - str = str + convertor.LineString(coordinates[i]) + 'z'; - } - return str; - }, - MultiPoint : function (coordinates) { - var arr = []; - for (var i = 0, len = coordinates.length; i < len; i++) { - arr.push(convertor.Point(coordinates[i])); - } - return arr; - }, - MultiLineString : function (coordinates) { - var str = ''; - for (var i = 0, len = coordinates.length; i < len; i++) { - str += convertor.LineString(coordinates[i]); - } - return str; - }, - MultiPolygon : function (coordinates) { - var str = ''; - for (var i = 0, len = coordinates.length; i < len; i++) { - str += convertor.Polygon(coordinates[i]); - } - return str; - } - }; - - var convertorParse = { - formatPoint : convertor.formatPoint, - - makePoint : function (p) { - var self = this; - var point = self.formatPoint(p); - var x = point[0]; - var y = point[1]; - if (self.xmin > x) { self.xmin = x; } - if (self.xmax < x) { self.xmax = x; } - if (self.ymin > y) { self.ymin = y; } - if (self.ymax < y) { self.ymax = y; } - }, - Point : function (coordinates) { - this.makePoint(coordinates); - }, - LineString : function (coordinates) { - for (var i = 0, len = coordinates.length; i < len; i++) { - this.makePoint(coordinates[i]); - } - }, - Polygon : function (coordinates) { - for (var i = 0, len = coordinates.length; i < len; i++) { - this.LineString(coordinates[i]); - } - }, - MultiPoint : function (coordinates) { - for (var i = 0, len = coordinates.length; i < len; i++) { - this.Point(coordinates[i]); - } - }, - MultiLineString : function (coordinates) { - for (var i = 0, len = coordinates.length; i < len; i++) { - this.LineString(coordinates[i]); - } - }, - MultiPolygon : function (coordinates) { - for (var i = 0, len = coordinates.length; i < len; i++) { - this.Polygon(coordinates[i]); - } - } - }; - - function geoJson2Path(json, transform, specialArea) { - specialArea = specialArea || {}; - convertor.scale = null; - convertor.offset = null; - - if (!json.srcSize) { - parseSrcSize(json, specialArea); - } - - transform.offset = { - x : json.srcSize.left, - y : json.srcSize.top, - left : transform.OffsetLeft || 0, - top : transform.OffsetTop || 0 - }; - - convertor.scale = transform.scale; - convertor.offset = transform.offset; - - var shapes = json.features; - var geometries; - var pathArray = []; - var val; - var shape; - for (var i = 0, len = shapes.length; i < len; i++) { - shape = shapes[i]; - if (shape.properties.name && specialArea[shape.properties.name]) { - // 忽略specialArea - continue; - } - if (shape.type == 'Feature') { - pushApath(shape.geometry, shape); - } - else if (shape.type == 'GeometryCollection') { - geometries = shape.geometries; - for (var j = 0, len2 = geometries.length; j < len2; j++) { - val = geometries[j]; - pushApath(val, val); - } - } - } - - var shapeType; - var shapeCoordinates; - var str; - function pushApath(gm, shape) { - shapeType = gm.type; - shapeCoordinates = gm.coordinates; - convertor._bbox = { - xmin : 360, - xmax : -360, - ymin : 180, - ymax : -180 - }; - str = convertor[shapeType](shapeCoordinates); - pathArray.push({ - //type : shapeType, - path : str, - cp : shape.properties.cp - ? convertor.makePoint(shape.properties.cp) - : convertor.makePoint([ - (convertor._bbox.xmin + convertor._bbox.xmax) / 2, - (convertor._bbox.ymin + convertor._bbox.ymax) / 2 - ]), - properties : shape.properties, - id : shape.id - }); - } - - return pathArray; - } - - /** - * 平面坐标转经纬度 - * @param {Array} p - */ - function pos2geo(obj, p) { - var x; - var y; - if (p instanceof Array) { - x = p[0] * 1; - y = p[1] * 1; - } - else { - x = p.x * 1; - y = p.y * 1; - } - - x = x / obj.scale.x + obj.offset.x - 168.5; - x = x > 180 ? x - 360 : x; - y = 90 - (y / obj.scale.y + obj.offset.y); - return [x, y]; - } - - /** - * 经纬度转平面坐标 - * @param {Array | Object} p - */ - function geo2pos(obj, p) { - convertor.offset = obj.offset; - convertor.scale = obj.scale; - return p instanceof Array - ? convertor.makePoint([p[0] * 1, p[1] * 1]) - : convertor.makePoint([p.x * 1, p.y * 1]); - } - - return { - getBbox : getBbox, - geoJson2Path : geoJson2Path, - pos2geo : pos2geo, - geo2pos : geo2pos - }; +/** + * echarts地图一般投射算法 + * modify from GeoMap v0.5.3 https://github.com/x6doooo/GeoMap + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/util/projection/normal',[],function() { + function getBbox(json, specialArea) { + specialArea = specialArea || {}; + if (!json.srcSize) { + parseSrcSize(json, specialArea); + } + + return json.srcSize; + } + + function parseSrcSize(json, specialArea) { + specialArea = specialArea || {}; + convertorParse.xmin = 360; + convertorParse.xmax = -360; + convertorParse.ymin = 180; + convertorParse.ymax = -180; + + var shapes = json.features; + var geometries; + var shape; + for (var i = 0, len = shapes.length; i < len; i++) { + shape = shapes[i]; + if (shape.properties.name && specialArea[shape.properties.name]) { + continue; + } + + switch (shape.type) { + case 'Feature': + convertorParse[shape.geometry.type](shape.geometry.coordinates); + break; + case 'GeometryCollection' : + geometries = shape.geometries; + for (var j = 0, len2 = geometries.length; j < len2; j++) { + convertorParse[geometries[j].type]( + geometries[j].coordinates + ); + } + break; + } + } + + json.srcSize = { + left: convertorParse.xmin.toFixed(4)*1, + top: convertorParse.ymin.toFixed(4)*1, + width: (convertorParse.xmax - convertorParse.xmin).toFixed(4)*1, + height: (convertorParse.ymax - convertorParse.ymin).toFixed(4)*1 + }; + + return json; + } + + var convertor = { + //调整俄罗斯东部到地图右侧与俄罗斯相连 + formatPoint: function (p) { + return [ + ((p[0] < -168.5 && p[1] > 63.8) ? p[0] + 360 : p[0]) + 168.5, + 90 - p[1] + ]; + }, + makePoint: function (p) { + var self = this; + var point = self.formatPoint(p); + // for cp + if (self._bbox.xmin > p[0]) { self._bbox.xmin = p[0]; } + if (self._bbox.xmax < p[0]) { self._bbox.xmax = p[0]; } + if (self._bbox.ymin > p[1]) { self._bbox.ymin = p[1]; } + if (self._bbox.ymax < p[1]) { self._bbox.ymax = p[1]; } + var x = (point[0] - convertor.offset.x) * convertor.scale.x + + convertor.offset.left; + var y = (point[1] - convertor.offset.y) * convertor.scale.y + + convertor.offset.top; + return [x, y]; + }, + Point: function (coordinates) { + coordinates = this.makePoint(coordinates); + return coordinates.join(','); + }, + LineString: function (coordinates) { + var str = ''; + var point; + for (var i = 0, len = coordinates.length; i < len; i++) { + point = convertor.makePoint(coordinates[i]); + if (i === 0) { + str = 'M' + point.join(','); + } else { + str = str + 'L' + point.join(','); + } + } + return str; + }, + Polygon: function (coordinates) { + var str = ''; + for (var i = 0, len = coordinates.length; i < len; i++) { + str = str + convertor.LineString(coordinates[i]) + 'z'; + } + return str; + }, + MultiPoint: function (coordinates) { + var arr = []; + for (var i = 0, len = coordinates.length; i < len; i++) { + arr.push(convertor.Point(coordinates[i])); + } + return arr; + }, + MultiLineString: function (coordinates) { + var str = ''; + for (var i = 0, len = coordinates.length; i < len; i++) { + str += convertor.LineString(coordinates[i]); + } + return str; + }, + MultiPolygon: function (coordinates) { + var str = ''; + for (var i = 0, len = coordinates.length; i < len; i++) { + str += convertor.Polygon(coordinates[i]); + } + return str; + } + }; + + var convertorParse = { + formatPoint: convertor.formatPoint, + + makePoint: function (p) { + var self = this; + var point = self.formatPoint(p); + var x = point[0]; + var y = point[1]; + if (self.xmin > x) { self.xmin = x; } + if (self.xmax < x) { self.xmax = x; } + if (self.ymin > y) { self.ymin = y; } + if (self.ymax < y) { self.ymax = y; } + }, + Point: function (coordinates) { + this.makePoint(coordinates); + }, + LineString: function (coordinates) { + for (var i = 0, len = coordinates.length; i < len; i++) { + this.makePoint(coordinates[i]); + } + }, + Polygon: function (coordinates) { + for (var i = 0, len = coordinates.length; i < len; i++) { + this.LineString(coordinates[i]); + } + }, + MultiPoint: function (coordinates) { + for (var i = 0, len = coordinates.length; i < len; i++) { + this.Point(coordinates[i]); + } + }, + MultiLineString: function (coordinates) { + for (var i = 0, len = coordinates.length; i < len; i++) { + this.LineString(coordinates[i]); + } + }, + MultiPolygon: function (coordinates) { + for (var i = 0, len = coordinates.length; i < len; i++) { + this.Polygon(coordinates[i]); + } + } + }; + + function geoJson2Path(json, transform, specialArea) { + specialArea = specialArea || {}; + convertor.scale = null; + convertor.offset = null; + + if (!json.srcSize) { + parseSrcSize(json, specialArea); + } + + transform.offset = { + x: json.srcSize.left, + y: json.srcSize.top, + left: transform.OffsetLeft || 0, + top: transform.OffsetTop || 0 + }; + + convertor.scale = transform.scale; + convertor.offset = transform.offset; + + var shapes = json.features; + var geometries; + var pathArray = []; + var val; + var shape; + for (var i = 0, len = shapes.length; i < len; i++) { + shape = shapes[i]; + if (shape.properties.name && specialArea[shape.properties.name]) { + // 忽略specialArea + continue; + } + if (shape.type == 'Feature') { + pushApath(shape.geometry, shape); + } + else if (shape.type == 'GeometryCollection') { + geometries = shape.geometries; + for (var j = 0, len2 = geometries.length; j < len2; j++) { + val = geometries[j]; + pushApath(val, val); + } + } + } + + var shapeType; + var shapeCoordinates; + var str; + function pushApath(gm, shape) { + shapeType = gm.type; + shapeCoordinates = gm.coordinates; + convertor._bbox = { + xmin: 360, + xmax: -360, + ymin: 180, + ymax: -180 + }; + str = convertor[shapeType](shapeCoordinates); + pathArray.push({ + // type: shapeType, + path: str, + cp: shape.properties.cp + ? convertor.makePoint(shape.properties.cp) + : convertor.makePoint([ + (convertor._bbox.xmin + convertor._bbox.xmax) / 2, + (convertor._bbox.ymin + convertor._bbox.ymax) / 2 + ]), + properties: shape.properties, + id: shape.id + }); + } + + return pathArray; + } + + /** + * 平面坐标转经纬度 + * @param {Array} p + */ + function pos2geo(obj, p) { + var x; + var y; + if (p instanceof Array) { + x = p[0] * 1; + y = p[1] * 1; + } + else { + x = p.x * 1; + y = p.y * 1; + } + + x = x / obj.scale.x + obj.offset.x - 168.5; + x = x > 180 ? x - 360 : x; + y = 90 - (y / obj.scale.y + obj.offset.y); + return [x, y]; + } + + /** + * 经纬度转平面坐标 + * @param {Array | Object} p + */ + function geo2pos(obj, p) { + convertor.offset = obj.offset; + convertor.scale = obj.scale; + return p instanceof Array + ? convertor.makePoint([p[0] * 1, p[1] * 1]) + : convertor.makePoint([p.x * 1, p.y * 1]); + } + + return { + getBbox: getBbox, + geoJson2Path: geoJson2Path, + pos2geo: pos2geo, + geo2pos: geo2pos + }; }); -/** - * echarts图表类:地图 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/chart/map',['require','../component/base','./base','zrender/shape/Text','zrender/shape/Path','zrender/shape/Circle','zrender/shape/Rectangle','zrender/shape/Line','zrender/shape/Polygon','zrender/shape/Ellipse','../component/dataRange','../config','../util/ecData','zrender/tool/util','zrender/config','zrender/tool/event','../util/mapData/params','../util/mapData/textFixed','../util/mapData/geoCoord','../util/projection/svg','../util/projection/normal','../util/projection/normal','../chart'],function (require) { - var ComponentBase = require('../component/base'); - var ChartBase = require('./base'); - - // 图形依赖 - var TextShape = require('zrender/shape/Text'); - var PathShape = require('zrender/shape/Path'); - var CircleShape = require('zrender/shape/Circle'); - var RectangleShape = require('zrender/shape/Rectangle'); - var LineShape = require('zrender/shape/Line'); - var PolygonShape = require('zrender/shape/Polygon'); - var EllipseShape = require('zrender/shape/Ellipse'); - // 组件依赖 - require('../component/dataRange'); - - var ecConfig = require('../config'); - var ecData = require('../util/ecData'); - var zrUtil = require('zrender/tool/util'); - var zrConfig = require('zrender/config'); - var zrEvent = require('zrender/tool/event'); - - var _mapParams = require('../util/mapData/params').params; - var _textFixed = require('../util/mapData/textFixed'); - var _geoCoord = require('../util/mapData/geoCoord'); - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} series 数据 - * @param {Object} component 组件 - */ - function Map(ecTheme, messageCenter, zr, option, myChart){ - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); - // 图表基类 - ChartBase.call(this); - - var self = this; - self._onmousewheel = function(param){ - return self.__onmousewheel(param); - }; - self._onmousedown = function(param){ - return self.__onmousedown(param); - }; - self._onmousemove = function(param){ - return self.__onmousemove(param); - }; - self._onmouseup = function(param){ - return self.__onmouseup(param); - }; - - this._isAlive = true; // 活着标记 - this._selectedMode = {}; // 选择模式 - this._hoverable = {}; // 悬浮高亮模式,索引到图表 - this._showLegendSymbol = {}; // 显示图例颜色标识 - this._selected = {}; // 地图选择状态 - this._mapTypeMap = {}; // 图例类型索引 - this._mapDataMap = {}; // 根据地图类型索引bbox,transform,path - this._nameMap = {}; // 个性化地名 - this._specialArea = {}; // 特殊 - this._refreshDelayTicket; // 滚轮缩放时让refresh飞一会 - this._mapDataRequireCounter; // 异步回调计数器 - this._markAnimation = false; - - // 漫游相关信息 - this._roamMap = {}; - this._scaleLimitMap = {}; - this._needRoam; - this._mx; - this._my; - this._mousedown; - this._justMove; // 避免移动响应点击 - this._curMapType; // 当前移动的地图类型 - - this.refresh(option); - if (this._needRoam) { - this.zr.on(zrConfig.EVENT.MOUSEWHEEL, this._onmousewheel); - this.zr.on(zrConfig.EVENT.MOUSEDOWN, this._onmousedown); - } - } - - Map.prototype = { - type : ecConfig.CHART_TYPE_MAP, - /** - * 绘制图形 - */ - _buildShape : function () { - var series = this.series; - this.selectedMap = {}; // 系列 - this._activeMapType = {}; // 当前活跃的地图类型 - - var legend = this.component.legend; - var seriesName; - var valueData = {}; - var mapType; - var data; - var name; - var mapSeries = {}; - var mapValuePrecision = {}; - var valueCalculation = {}; - this._needRoam = false; - for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type == ecConfig.CHART_TYPE_MAP) { // map - series[i] = this.reformOption(series[i]); - mapType = series[i].mapType; - mapSeries[mapType] = mapSeries[mapType] || {}; - mapSeries[mapType][i] = true; - mapValuePrecision[mapType] = mapValuePrecision[mapType] - || series[i].mapValuePrecision; - this._scaleLimitMap[mapType] = this._scaleLimitMap[mapType] || {}; - series[i].scaleLimit - && zrUtil.merge(this._scaleLimitMap[mapType], series[i].scaleLimit, true); - - this._roamMap[mapType] = series[i].roam || this._roamMap[mapType]; - this._needRoam = this._needRoam || this._roamMap[mapType]; - - this._nameMap[mapType] = this._nameMap[mapType] || {}; - series[i].nameMap - && zrUtil.merge(this._nameMap[mapType], series[i].nameMap, true); - this._activeMapType[mapType] = true; - - if (series[i].textFixed) { - zrUtil.merge( - _textFixed, series[i].textFixed, true - ); - } - if (series[i].geoCoord) { - zrUtil.merge( - _geoCoord, series[i].geoCoord, true - ); - } - - this._selectedMode[mapType] = this._selectedMode[mapType] - || series[i].selectedMode; - if (typeof this._hoverable[mapType] == 'undefined' - || this._hoverable[mapType] // false 1票否决 - ) { - this._hoverable[mapType] = series[i].hoverable; - } - if (typeof this._showLegendSymbol[mapType] == 'undefined' - || this._showLegendSymbol[mapType] // false 1票否决 - ) { - this._showLegendSymbol[mapType] = series[i].showLegendSymbol; - } - - valueCalculation[mapType] = valueCalculation[mapType] - || series[i].mapValueCalculation; - - seriesName = series[i].name; - this.selectedMap[seriesName] = legend - ? legend.isSelected(seriesName) - : true; - if (this.selectedMap[seriesName]) { - valueData[mapType] = valueData[mapType] || {}; - data = series[i].data; - for (var j = 0, k = data.length; j < k; j++) { - name = this._nameChange(mapType, data[j].name); - valueData[mapType][name] = valueData[mapType][name] - || {seriesIndex : []}; - for (var key in data[j]) { - if (key != 'value') { - valueData[mapType][name][key] = - data[j][key]; - } - else if (!isNaN(data[j].value)) { - typeof valueData[mapType][name].value - == 'undefined' - && (valueData[mapType][name].value = 0); - - valueData[mapType][name].value += - data[j].value; - } - } - //索引有该区域的系列样式 - valueData[mapType][name].seriesIndex.push(i); - } - } - } - } - - this._mapDataRequireCounter = 0; - for (var mt in valueData) { - this._mapDataRequireCounter++; - } - //清空 - this._clearSelected(); - if (this._mapDataRequireCounter === 0) { - this.clear(); - this.zr && this.zr.delShape(this.lastShapeList); - this.lastShapeList = []; - } - for (var mt in valueData) { - if (valueCalculation[mt] && valueCalculation[mt] == 'average') { - for (var k in valueData[mt]) { - valueData[mt][k].value = - (valueData[mt][k].value / valueData[mt][k].seriesIndex.length) - .toFixed( - mapValuePrecision[mt] - ) - 0; - } - } - - this._mapDataMap[mt] = this._mapDataMap[mt] || {}; - - if (this._mapDataMap[mt].mapData) { - // 已经缓存了则直接用 - this._mapDataCallback(mt, valueData[mt], mapSeries[mt])( - this._mapDataMap[mt].mapData - ); - } - else if (_mapParams[mt.replace(/\|.*/, '')].getGeoJson) { - // 特殊区域 - this._specialArea[mt] = - _mapParams[mt.replace(/\|.*/, '')].specialArea - || this._specialArea[mt]; - _mapParams[mt.replace(/\|.*/, '')].getGeoJson( - this._mapDataCallback(mt, valueData[mt], mapSeries[mt]) - ); - } - } - }, - - /** - * @param {string} mt mapType - * @parma {Object} vd valueData - * @param {Object} ms mapSeries - */ - _mapDataCallback : function (mt, vd, ms) { - var self = this; - return function (md) { - if (!self._isAlive) { - // 异步地图数据回调时有可能实例已经被释放 - return; - } - // 缓存这份数据 - if (mt.indexOf('|') != -1) { - // 子地图,加工一份新的mapData - md = self._getSubMapData(mt, md); - } - self._mapDataMap[mt].mapData = md; - - if (md.firstChild) { - self._mapDataMap[mt].rate = 1; - self._mapDataMap[mt].projection = require('../util/projection/svg'); - } - else { - self._mapDataMap[mt].rate = 0.75; - self._mapDataMap[mt].projection = require('../util/projection/normal'); - } - - self._buildMap( - mt, // 类型 - self._getProjectionData(mt, md, ms), // 地图数据 - vd, // 用户数据 - ms // 系列 - ); - self._buildMark(mt, ms); - if (--self._mapDataRequireCounter <= 0) { - self.addShapeList(); - self.zr.refresh(); - } - }; - }, - - _clearSelected : function() { - for (var k in this._selected) { - if (!this._activeMapType[this._mapTypeMap[k]]) { - delete this._selected[k]; - delete this._mapTypeMap[k]; - } - } - }, - - _getSubMapData : function (mapType, mapData) { - var subType = mapType.replace(/^.*\|/, ''); - var features = mapData.features; - for (var i = 0, l = features.length; i < l; i++) { - if (features[i].properties - && features[i].properties.name == subType - ) { - features = features[i]; - if (subType == 'United States of America' - && features.geometry.coordinates.length > 1 // 未被简化 - ) { - features = { - geometry: { - coordinates: features.geometry - .coordinates.slice(5,6), - type: features.geometry.type - }, - id: features.id, - properties: features.properties, - type: features.type - }; - } - break; - } - } - return { - 'type' : 'FeatureCollection', - 'features':[ - features - ] - }; - }, - - /** - * 按需加载相关地图 - */ - _getProjectionData : function (mapType, mapData, mapSeries) { - var normalProjection = this._mapDataMap[mapType].projection; - var province = []; - - // bbox永远不变 - var bbox = this._mapDataMap[mapType].bbox - || normalProjection.getBbox( - mapData, this._specialArea[mapType] - ); - //console.log(bbox) - - var transform; - //console.log(1111,transform) - if (!this._mapDataMap[mapType].hasRoam) { - // 第一次或者发生了resize,需要判断 - transform = this._getTransform( - bbox, - mapSeries, - this._mapDataMap[mapType].rate - ); - } - else { - //经过用户漫游不再响应resize - transform = this._mapDataMap[mapType].transform; - } - //console.log(bbox,transform) - var lastTransform = this._mapDataMap[mapType].lastTransform - || {scale:{}}; - - var pathArray; - if (transform.left != lastTransform.left - || transform.top != lastTransform.top - || transform.scale.x != lastTransform.scale.x - || transform.scale.y != lastTransform.scale.y - ) { - // 发生过变化,需要重新生成pathArray - // 一般投射 - //console.log(transform) - pathArray = normalProjection.geoJson2Path( - mapData, transform, this._specialArea[mapType] - ); - lastTransform = zrUtil.clone(transform); - } - else { - transform = this._mapDataMap[mapType].transform; - pathArray = this._mapDataMap[mapType].pathArray; - } - - this._mapDataMap[mapType].bbox = bbox; - this._mapDataMap[mapType].transform = transform; - this._mapDataMap[mapType].lastTransform = lastTransform; - this._mapDataMap[mapType].pathArray = pathArray; - - //console.log(pathArray) - var position = [transform.left, transform.top]; - for (var i = 0, l = pathArray.length; i < l; i++) { - /* for test - console.log( - mapData.features[i].properties.cp, // 经纬度度 - pathArray[i].cp // 平面坐标 - ); - console.log( - this.pos2geo(mapType, pathArray[i].cp), // 平面坐标转经纬度 - this.geo2pos(mapType, mapData.features[i].properties.cp) - ) - */ - province.push(this._getSingleProvince( - mapType, pathArray[i], position - )); - } - - if (this._specialArea[mapType]) { - for (var area in this._specialArea[mapType]) { - province.push(this._getSpecialProjectionData( - mapType, mapData, - area, this._specialArea[mapType][area], - position - )); - } - - } - - // 中国地图加入南海诸岛 - if (mapType == 'china') { - var leftTop = this.geo2pos( - mapType, - _geoCoord['南海诸岛'] || _mapParams['南海诸岛'].textCoord - ); - // scale.x : width = 10.51 : 64 - var scale = transform.scale.x / 10.5; - var textPosition = [ - 32 * scale + leftTop[0], - 83 * scale + leftTop[1] - ]; - if (_textFixed['南海诸岛']) { - textPosition[0] += _textFixed['南海诸岛'][0]; - textPosition[1] += _textFixed['南海诸岛'][1]; - } - province.push({ - name : this._nameChange(mapType, '南海诸岛'), - path : _mapParams['南海诸岛'].getPath(leftTop, scale), - position : position, - textX : textPosition[0], - textY : textPosition[1] - }); - - } - //console.log(JSON.stringify(province)); - //console.log(JSON.stringify(this._mapDataMap[mapType].transform)); - return province; - }, - - /** - * 特殊地区投射数据 - */ - _getSpecialProjectionData : function (mapType, mapData, areaName, mapSize, position) { - //console.log('_getSpecialProjectionData--------------') - // 构造单独的geoJson地图数据 - mapData = this._getSubMapData('x|' + areaName, mapData); - - // bbox - var normalProjection = require('../util/projection/normal'); - var bbox = normalProjection.getBbox(mapData); - //console.log('bbox', bbox) - - // transform - var leftTop = this.geo2pos( - mapType, - [mapSize.left, mapSize.top] - ); - var rightBottom = this.geo2pos( - mapType, - [mapSize.left + mapSize.width, mapSize.top + mapSize.height] - ); - //console.log('leftright' , leftTop, rightBottom); - var width = Math.abs(rightBottom[0] - leftTop[0]); - var height = Math.abs(rightBottom[1] - leftTop[1]); - var mapWidth = bbox.width; - var mapHeight = bbox.height; - //var minScale; - var xScale = (width / 0.75) / mapWidth; - var yScale = height / mapHeight; - if (xScale > yScale) { - xScale = yScale * 0.75; - width = mapWidth * xScale; - } - else { - yScale = xScale; - xScale = yScale * 0.75; - height = mapHeight * yScale; - } - var transform = { - OffsetLeft : leftTop[0], - OffsetTop : leftTop[1], - //width: width, - //height: height, - scale : { - x : xScale, - y : yScale - } - }; - - //console.log('**',areaName, transform) - var pathArray = normalProjection.geoJson2Path( - mapData, transform - ); - - //console.log(pathArray) - return this._getSingleProvince( - mapType, pathArray[0], position - ); - }, - - _getSingleProvince : function (mapType, path, position) { - var textPosition; - var name = path.properties.name; - var textFixed = _textFixed[name] || [0, 0]; - if (_geoCoord[name]) { - // 经纬度直接定位不加textFixed - textPosition = this.geo2pos( - mapType, - _geoCoord[name] - ); - } - else if (path.cp) { - textPosition = [ - path.cp[0] + textFixed[0], - path.cp[1] + textFixed[1] - ]; - } - else { - var bbox = this._mapDataMap[mapType].bbox; - textPosition = this.geo2pos( - mapType, - [bbox.left + bbox.width / 2, bbox.top + bbox.height / 2] - ); - textPosition[0] += textFixed[0]; - textPosition[1] += textFixed[1]; - } - - //console.log(textPosition) - path.name = this._nameChange(mapType, name); - path.position = position; - path.textX = textPosition[0]; - path.textY = textPosition[1]; - return path; - }, - - /** - * 获取缩放 - */ - _getTransform : function (bbox, mapSeries, rate) { - var series = this.series; - var mapLocation; - var x; - var cusX; - var y; - var cusY; - var width; - var height; - var zrWidth = this.zr.getWidth(); - var zrHeight = this.zr.getHeight(); - //上下左右留空 - var padding = Math.round(Math.min(zrWidth, zrHeight) * 0.02); - for (var key in mapSeries) { - mapLocation = series[key].mapLocation || {}; - cusX = mapLocation.x || cusX; - cusY = mapLocation.y || cusY; - width = mapLocation.width || width; - height = mapLocation.height || height; - } - - //x = isNaN(cusX) ? padding : cusX; - x = this.parsePercent(cusX, zrWidth); - x = isNaN(x) ? padding : x; - //y = isNaN(cusY) ? padding : cusY; - y = this.parsePercent(cusY, zrHeight); - y = isNaN(y) ? padding : y; - if (typeof width == 'undefined') { - width = zrWidth - x - 2 * padding; - } - else { - width = this.parsePercent(width, zrWidth); - } - - if (typeof height == 'undefined') { - height = zrHeight - y - 2 * padding; - } - else { - height = this.parsePercent(height, zrHeight); - } - - var mapWidth = bbox.width; - var mapHeight = bbox.height; - //var minScale; - var xScale = (width / rate) / mapWidth; - var yScale = height / mapHeight; - if (xScale > yScale) { - //minScale = yScale; - xScale = yScale * rate; - width = mapWidth * xScale; - } - else { - //minScale = xScale; - yScale = xScale; - xScale = yScale * rate; - height = mapHeight * yScale; - } - //console.log(minScale) - //width = mapWidth * minScale; - //height = mapHeight * minScale; - - if (isNaN(cusX)) { - cusX = cusX || 'center'; - switch (cusX + '') { - case 'center' : - x = Math.floor((zrWidth - width) / 2); - break; - case 'right' : - x = zrWidth - width; - break; - //case 'left' : - //x = padding; - } - } - //console.log(cusX,x,zrWidth,width,'kener') - if (isNaN(cusY)) { - cusY = cusY || 'center'; - switch (cusY + '') { - case 'center' : - y = Math.floor((zrHeight - height) / 2); - break; - case 'bottom' : - y = zrHeight - height; - break; - //case 'top' : - //y = padding; - } - } - //console.log(x,y,width,height) - return { - left : x, - top : y, - width: width, - height: height, - //scale : minScale * 50, // wtf 50 - baseScale : 1, - scale : { - x : xScale, - y : yScale - } - //translate : [x + width / 2, y + height / 2] - }; - }, - - /** - * 构建地图 - * @param {Object} mapData 图形数据 - * @param {Object} valueData 用户数据 - */ - _buildMap : function (mapType, mapData, valueData, mapSeries) { - var series = this.series; - var legend = this.component.legend; - var dataRange = this.component.dataRange; - var seriesName; - var name; - var data; - var value; - var queryTarget; - var defaultOption = this.ecTheme.map; - - var color; - var font; - var style; - var highlightStyle; - - var shape; - var textShape; - for (var i = 0, l = mapData.length; i < l; i++) { - style = zrUtil.clone(mapData[i]); - highlightStyle = { - name : style.name, - path : style.path, - position : zrUtil.clone(style.position) - }; - name = style.name; - data = valueData[name]; // 多系列合并后的数据 - if (data) { - queryTarget = [data]; // level 3 - seriesName = ''; - for (var j = 0, k = data.seriesIndex.length; j < k; j++) { - // level 2 - queryTarget.push(series[data.seriesIndex[j]]); - seriesName += series[data.seriesIndex[j]].name + ' '; - if (legend - && this._showLegendSymbol[mapType] - && legend.hasColor(series[data.seriesIndex[j]].name) - ) { - this.shapeList.push(new CircleShape({ - zlevel : this._zlevelBase + 1, - position : zrUtil.clone(style.position), - _mapType : mapType, - /* - _geo : this.pos2geo( - mapType, [style.textX + 3 + j * 7, style.textY - 10] - ), - */ - style : { - x : style.textX + 3 + j * 7, - y : style.textY - 10, - r : 3, - color : legend.getColor( - series[data.seriesIndex[j]].name - ) - }, - hoverable : false - })); - } - } - queryTarget.push(defaultOption); // level 1 - value = data.value; - } - else { - data = '-'; - seriesName = ''; - queryTarget = []; - for (var key in mapSeries) { - queryTarget.push(series[key]); - } - queryTarget.push(defaultOption); - value = '-'; - } - - // 值域控件控制 - color = (dataRange && !isNaN(value)) - ? dataRange.getColor(value) - : null; - - // 常规设置 - style.color = style.color - || color - || this.getItemStyleColor( - this.deepQuery(queryTarget, 'itemStyle.normal.color'), - data.seriesIndex, -1, data - ) - || this.deepQuery( - queryTarget, 'itemStyle.normal.areaStyle.color' - ); - style.strokeColor = style.strokeColor - || this.deepQuery(queryTarget, 'itemStyle.normal.borderColor'); - style.lineWidth = style.lineWidth - || this.deepQuery(queryTarget, 'itemStyle.normal.borderWidth'); - - // 高亮 - highlightStyle.color = this.getItemStyleColor( - this.deepQuery(queryTarget, 'itemStyle.emphasis.color'), - data.seriesIndex, -1, data - ) - || this.deepQuery( - queryTarget, 'itemStyle.emphasis.areaStyle.color' - ) - || style.color; - highlightStyle.strokeColor = this.deepQuery( - queryTarget, 'itemStyle.emphasis.borderColor' - ) - || style.strokeColor; - highlightStyle.lineWidth = this.deepQuery( - queryTarget, 'itemStyle.emphasis.borderWidth' - ) - || style.lineWidth; - - style.brushType = highlightStyle.brushType = style.brushType || 'both'; - style.lineJoin = highlightStyle.lineJoin = 'round'; - style._name = highlightStyle._name = name; - - font = this.deepQuery(queryTarget, 'itemStyle.normal.label.textStyle'); - // 文字标签避免覆盖单独一个shape - textShape = { - zlevel : this._zlevelBase + 1, - hoverable: this._hoverable[mapType], - position : zrUtil.clone(style.position), - _mapType : mapType, - _geo : this.pos2geo( - mapType, [style.textX, style.textY] - ), - style : { - brushType : 'fill', - x : style.textX, - y : style.textY, - text : this.getLabelText(name, value, queryTarget, 'normal'), - _name : name, - textAlign : 'center', - color : this.deepQuery(queryTarget, 'itemStyle.normal.label.show') - ? this.deepQuery( - queryTarget, - 'itemStyle.normal.label.textStyle.color' - ) - : 'rgba(0,0,0,0)', - textFont : this.getFont(font) - } - }; - textShape._style = zrUtil.clone(textShape.style); - - textShape.highlightStyle = zrUtil.clone(textShape.style); - if (this.deepQuery(queryTarget, 'itemStyle.emphasis.label.show')) { - textShape.highlightStyle.text = this.getLabelText( - name, value, queryTarget, 'emphasis' - ); - textShape.highlightStyle.color = this.deepQuery( - queryTarget, - 'itemStyle.emphasis.label.textStyle.color' - ) || textShape.style.color; - font = this.deepQuery( - queryTarget, - 'itemStyle.emphasis.label.textStyle' - ) || font; - textShape.highlightStyle.textFont = this.getFont(font); - } - else { - textShape.highlightStyle.color = 'rgba(0,0,0,0)'; - } - - shape = { - zlevel : this._zlevelBase, - hoverable: this._hoverable[mapType], - position : zrUtil.clone(style.position), - style : style, - highlightStyle : highlightStyle, - _style: zrUtil.clone(style), - _mapType: mapType - }; - if (typeof style.scale != 'undefined') { - shape.scale = zrUtil.clone(style.scale); - } - - textShape = new TextShape(textShape); - switch (shape.style.shapeType) { - case 'rectangle' : - shape = new RectangleShape(shape); - break; - case 'line' : - shape = new LineShape(shape); - break; - case 'circle' : - shape = new CircleShape(shape); - break; - case 'polygon' : - shape = new PolygonShape(shape); - break; - case 'ellipse': - shape = new EllipseShape(shape); - break; - default : - shape = new PathShape(shape); - shape.pathArray = shape._parsePathData(shape.style.path); - break; - } - - if (this._selectedMode[mapType] && - this._selected[name] - || (data.selected && this._selected[name] !== false) - ) { - textShape.style = textShape.highlightStyle; - shape.style = shape.highlightStyle; - } - - if (this._selectedMode[mapType]) { - this._selected[name] = typeof this._selected[name] != 'undefined' - ? this._selected[name] - : data.selected; - this._mapTypeMap[name] = mapType; - - if (typeof data.selectable == 'undefined' || data.selectable) { - shape.clickable = textShape.clickable = true; - shape.onclick = textShape.onclick = this.shapeHandler.onclick; - } - } - - if (this._hoverable[mapType] - && (typeof data.hoverable == 'undefined' || data.hoverable) - ) { - textShape.hoverable = shape.hoverable = true; - shape.hoverConnect = textShape.id; - textShape.hoverConnect = shape.id; - shape.onmouseover = textShape.onmouseover = this.hoverConnect; - } - else { - textShape.hoverable = shape.hoverable = false; - } - - // console.log(name,shape); - ecData.pack( - textShape, - { - name: seriesName, - tooltip: this.deepQuery(queryTarget, 'tooltip') - }, - 0, - data, 0, - name - ); - this.shapeList.push(textShape); - - ecData.pack( - shape, - { - name: seriesName, - tooltip: this.deepQuery(queryTarget, 'tooltip') - }, - 0, - data, 0, - name - ); - this.shapeList.push(shape); - } - //console.log(this._selected); - }, - - // 添加标注 - _buildMark : function (mapType, mapSeries) { - this._seriesIndexToMapType = this._seriesIndexToMapType || {}; - this.markAttachStyle = this.markAttachStyle || {}; - var position = [ - this._mapDataMap[mapType].transform.left, - this._mapDataMap[mapType].transform.top - ]; - for (var sIdx in mapSeries) { - this._seriesIndexToMapType[sIdx] = mapType; - this.markAttachStyle[sIdx] = { - position : position, - _mapType : mapType - }; - this.buildMark(sIdx); - } - }, - - // 位置转换 - getMarkCoord : function (seriesIndex, mpData) { - return (mpData.geoCoord || _geoCoord[mpData.name]) - ? this.geo2pos( - this._seriesIndexToMapType[seriesIndex], - mpData.geoCoord || _geoCoord[mpData.name] - ) - : [0, 0]; - }, - - getMarkGeo : function(mpData) { - return mpData.geoCoord || _geoCoord[mpData.name]; - }, - - _nameChange : function (mapType, name) { - return this._nameMap[mapType][name] || name; - }, - - /** - * 根据lable.format计算label text - */ - getLabelText : function (name, value, queryTarget, status) { - var formatter = this.deepQuery( - queryTarget, - 'itemStyle.' + status + '.label.formatter' - ); - if (formatter) { - if (typeof formatter == 'function') { - return formatter.call( - this.myChart, - name, - value - ); - } - else if (typeof formatter == 'string') { - formatter = formatter.replace('{a}','{a0}') - .replace('{b}','{b0}'); - formatter = formatter.replace('{a0}', name) - .replace('{b0}', value); - return formatter; - } - } - else { - return name; - } - }, - - _findMapTypeByPos : function (mx, my) { - var transform; - var left; - var top; - var width; - var height; - for (var mapType in this._mapDataMap) { - transform = this._mapDataMap[mapType].transform; - if (!transform || !this._roamMap[mapType]) { - continue; - } - left = transform.left; - top = transform.top; - width = transform.width; - height = transform.height; - if (mx >= left - && mx <= (left + width) - && my >= top - && my <= (top + height) - ) { - return mapType; - } - } - return; - }, - - /** - * 滚轮缩放 - */ - __onmousewheel : function (param) { - if (this.shapeList.length <= 0) { - return; - } - var event = param.event; - var mx = zrEvent.getX(event); - var my = zrEvent.getY(event); - var delta = zrEvent.getDelta(event); - //delta = delta > 0 ? (-1) : 1; - var mapType = this._findMapTypeByPos(mx, my); - if (mapType) { - zrEvent.stop(event); - var transform = this._mapDataMap[mapType].transform; - var left = transform.left; - var top = transform.top; - var width = transform.width; - var height = transform.height; - // 位置转经纬度 - var geoAndPos = this.pos2geo(mapType, [mx - left, my - top]); - if (delta > 0) { - delta = 1.2; // 放大 - if (typeof this._scaleLimitMap[mapType].max != 'undefined' - && transform.baseScale >= this._scaleLimitMap[mapType].max - ) { - return; // 缩放限制 - } - } - else { - delta = 1 / 1.2; // 缩小 - if (typeof this._scaleLimitMap[mapType].min != 'undefined' - && transform.baseScale <= this._scaleLimitMap[mapType].min - ) { - return; // 缩放限制 - } - } - transform.baseScale *= delta; - transform.scale.x *= delta; - transform.scale.y *= delta; - transform.width = width * delta; - transform.height = height * delta; - - this._mapDataMap[mapType].hasRoam = true; - this._mapDataMap[mapType].transform = transform; - // 经纬度转位置 - geoAndPos = this.geo2pos(mapType, geoAndPos); - // 保持视觉中心 - transform.left -= geoAndPos[0] - (mx - left); - transform.top -= geoAndPos[1] - (my - top); - this._mapDataMap[mapType].transform = transform; - - this.clearEffectShape(true); - for (var i = 0, l = this.shapeList.length; i < l; i++) { - if(this.shapeList[i]._mapType == mapType) { - this.shapeList[i].position[0] = transform.left; - this.shapeList[i].position[1] = transform.top; - if (this.shapeList[i].type == 'path' - || this.shapeList[i].type == 'symbol' - || this.shapeList[i].type == 'circle' - || this.shapeList[i].type == 'rectangle' - || this.shapeList[i].type == 'polygon' - || this.shapeList[i].type == 'line' - || this.shapeList[i].type == 'ellipse' - ) { - this.shapeList[i].scale[0] *= delta; - this.shapeList[i].scale[1] *= delta; - } - else if (this.shapeList[i].type == 'mark-line') { - this.shapeList[i].style.pointListLength = undefined; - this.shapeList[i].style.pointList = false; - geoAndPos = this.geo2pos(mapType, this.shapeList[i]._geo[0]); - this.shapeList[i].style.xStart = geoAndPos[0]; - this.shapeList[i].style.yStart = geoAndPos[1]; - geoAndPos = this.geo2pos(mapType, this.shapeList[i]._geo[1]); - this.shapeList[i]._x = this.shapeList[i].style.xEnd = geoAndPos[0]; - this.shapeList[i]._y = this.shapeList[i].style.yEnd = geoAndPos[1]; - } - else if (this.shapeList[i].type == 'icon') { - geoAndPos = this.geo2pos(mapType, this.shapeList[i]._geo); - this.shapeList[i].style.x = this.shapeList[i].style._x = - geoAndPos[0] - this.shapeList[i].style.width / 2; - this.shapeList[i].style.y = this.shapeList[i].style._y = - geoAndPos[1] - this.shapeList[i].style.height / 2; - } - else { - geoAndPos = this.geo2pos(mapType, this.shapeList[i]._geo); - this.shapeList[i].style.x = geoAndPos[0]; - this.shapeList[i].style.y = geoAndPos[1]; - if (this.shapeList[i].type == 'text') { - this.shapeList[i]._style.x = this.shapeList[i].highlightStyle.x - = geoAndPos[0]; - this.shapeList[i]._style.y = this.shapeList[i].highlightStyle.y - = geoAndPos[1]; - } - } - - this.zr.modShape(this.shapeList[i].id); - } - } - - this.zr.refresh(); - - var self = this; - clearTimeout(this._refreshDelayTicket); - this._refreshDelayTicket = setTimeout( - function(){ - self && self.shapeList && self.animationEffect(); - }, - 100 - ); - - this.messageCenter.dispatch( - ecConfig.EVENT.MAP_ROAM, - param.event, - {type : 'scale'}, - this.myChart - ); - } - }, - - __onmousedown : function (param) { - if (this.shapeList.length <= 0) { - return; - } - var target = param.target; - if (target && target.draggable) { - return; - } - var event = param.event; - var mx = zrEvent.getX(event); - var my = zrEvent.getY(event); - var mapType = this._findMapTypeByPos(mx, my); - if (mapType) { - this._mousedown = true; - this._mx = mx; - this._my = my; - this._curMapType = mapType; - - this.zr.on(zrConfig.EVENT.MOUSEUP, this._onmouseup); - var self = this; - setTimeout(function (){ - self.zr.on(zrConfig.EVENT.MOUSEMOVE, self._onmousemove); - },100); - } - - }, - - __onmousemove : function (param) { - if (!this._mousedown || !this._isAlive) { - return; - } - var event = param.event; - var mx = zrEvent.getX(event); - var my = zrEvent.getY(event); - var transform = this._mapDataMap[this._curMapType].transform; - transform.hasRoam = true; - transform.left -= this._mx - mx; - transform.top -= this._my - my; - this._mx = mx; - this._my = my; - this._mapDataMap[this._curMapType].transform = transform; - - for (var i = 0, l = this.shapeList.length; i < l; i++) { - if(this.shapeList[i]._mapType == this._curMapType) { - this.shapeList[i].position[0] = transform.left; - this.shapeList[i].position[1] = transform.top; - this.zr.modShape(this.shapeList[i].id); - } - } - - this.messageCenter.dispatch( - ecConfig.EVENT.MAP_ROAM, - param.event, - {type : 'move'}, - this.myChart - ); - - this.clearEffectShape(true); - this.zr.refresh(); - - this._justMove = true; - zrEvent.stop(event); - }, - - __onmouseup : function (param) { - var event = param.event; - this._mx = zrEvent.getX(event); - this._my = zrEvent.getY(event); - this._mousedown = false; - var self = this; - setTimeout(function (){ - self._justMove && self.animationEffect(); - self._justMove = false; - self.zr.un(zrConfig.EVENT.MOUSEMOVE, self._onmousemove); - self.zr.un(zrConfig.EVENT.MOUSEUP, self._onmouseup); - },120); - }, - - /** - * 点击响应 - */ - onclick : function (param) { - if (!this.isClick || !param.target || this._justMove || param.target.type == 'icon') { - // 没有在当前实例上发生点击直接返回 - return; - } - this.isClick = false; - - var target = param.target; - var name = target.style._name; - var len = this.shapeList.length; - var mapType = target._mapType || ''; - - if (this._selectedMode[mapType] == 'single') { - for (var p in this._selected) { - // 同一地图类型 - if (this._selected[p] && this._mapTypeMap[p] == mapType) { - // 复位那些生效shape(包括文字) - for (var i = 0; i < len; i++) { - if (this.shapeList[i].style._name == p - && this.shapeList[i]._mapType == mapType - ) { - this.shapeList[i].style = this.shapeList[i]._style; - this.zr.modShape(this.shapeList[i].id); - } - } - p != name && (this._selected[p] = false); - } - } - } - - this._selected[name] = !this._selected[name]; - - // 更新当前点击shape(包括文字) - for (var i = 0; i < len; i++) { - if (this.shapeList[i].style._name == name - && this.shapeList[i]._mapType == mapType - ) { - if (this._selected[name]) { - this.shapeList[i].style = this.shapeList[i].highlightStyle; - } - else { - this.shapeList[i].style = this.shapeList[i]._style; - } - this.zr.modShape(this.shapeList[i].id); - } - } - this.messageCenter.dispatch( - ecConfig.EVENT.MAP_SELECTED, - param.event, - { - selected : this._selected, - target : name - }, - this.myChart - ); - this.zr.refresh(); - - var self = this; - setTimeout(function(){ - self.zr.trigger( - zrConfig.EVENT.MOUSEMOVE, - param.event - ); - },100); - }, - - /** - * 刷新 - */ - refresh : function (newOption) { - if (newOption) { - this.option = newOption; - this.series = newOption.series; - } - - if (this._mapDataRequireCounter > 0) { - this.clear(); - } - else { - this.backupShapeList(); - } - this._buildShape(); - this.zr.refreshHover(); - }, - - /** - * 值域响应 - * @param {Object} param - * @param {Object} status - */ - ondataRange : function (param, status) { - if (this.component.dataRange) { - this.refresh(); - status.needRefresh = true; - } - return; - }, - - /** - * 平面坐标转经纬度 - */ - pos2geo : function (mapType, p) { - if (!this._mapDataMap[mapType].transform) { - return null; - } - return this._mapDataMap[mapType].projection.pos2geo( - this._mapDataMap[mapType].transform, p - ); - }, - - /** - * 公开接口 : 平面坐标转经纬度 - */ - getGeoByPos : function (mapType, p) { - if (!this._mapDataMap[mapType].transform) { - return null; - } - var position = [ - this._mapDataMap[mapType].transform.left, - this._mapDataMap[mapType].transform.top - ]; - if (p instanceof Array) { - p[0] -= position[0]; - p[1] -= position[1]; - } - else { - p.x -= position[0]; - p.y -= position[1]; - } - return this.pos2geo(mapType, p); - }, - - /** - * 经纬度转平面坐标 - * @param {Object} p - */ - geo2pos : function (mapType, p) { - if (!this._mapDataMap[mapType].transform) { - return null; - } - return this._mapDataMap[mapType].projection.geo2pos( - this._mapDataMap[mapType].transform, p - ); - }, - - /** - * 公开接口 : 经纬度转平面坐标 - */ - getPosByGeo : function (mapType, p) { - if (!this._mapDataMap[mapType].transform) { - return null; - } - var pos = this.geo2pos(mapType, p); - pos[0] += this._mapDataMap[mapType].transform.left; - pos[1] += this._mapDataMap[mapType].transform.top; - return pos; - }, - - /** - * 公开接口 : 地图参考坐标 - */ - getMapPosition : function (mapType) { - if (!this._mapDataMap[mapType].transform) { - return null; - } - return [ - this._mapDataMap[mapType].transform.left, - this._mapDataMap[mapType].transform.top - ]; - }, - - /* - appendShape : function (mapType, shapeList) { - shapeList = shapeList instanceof Array - ? shapeList : [shapeList]; - for (var i = 0, l = shapeList.length; i < l; i++) { - if (typeof shapeList[i].zlevel == 'undefined') { - shapeList[i].zlevel = this._zlevelBase + 1; - } - shapeList[i]._mapType = mapType; - this.shapeList.push(shapeList[i]); - this.zr.addShape(shapeList[i]); - } - this.zr.refresh(); - }, - */ - - /** - * 释放后实例不可用 - */ - dispose : function () { - this.clear(); - this.shapeList = null; - this.effectList = null; - this._isAlive = false; - if (this._needRoam) { - this.zr.un(zrConfig.EVENT.MOUSEWHEEL, this._onmousewheel); - this.zr.un(zrConfig.EVENT.MOUSEDOWN, this._onmousedown); - } - } - }; - - zrUtil.inherits(Map, ChartBase); - zrUtil.inherits(Map, ComponentBase); - - // 图表注册 - require('../chart').define('map', Map); - - return Map; +/** + * echarts图表类:地图 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/chart/map',['require','../component/base','./base','zrender/shape/Text','zrender/shape/Path','zrender/shape/Circle','zrender/shape/Rectangle','zrender/shape/Line','zrender/shape/Polygon','zrender/shape/Ellipse','../component/dataRange','../component/roamController','../config','../util/ecData','zrender/tool/util','zrender/config','zrender/tool/event','../util/mapData/params','../util/mapData/textFixed','../util/mapData/geoCoord','../util/projection/svg','../util/projection/normal','../util/projection/normal','../chart'],function (require) { + var ComponentBase = require('../component/base'); + var ChartBase = require('./base'); + + // 图形依赖 + var TextShape = require('zrender/shape/Text'); + var PathShape = require('zrender/shape/Path'); + var CircleShape = require('zrender/shape/Circle'); + var RectangleShape = require('zrender/shape/Rectangle'); + var LineShape = require('zrender/shape/Line'); + var PolygonShape = require('zrender/shape/Polygon'); + var EllipseShape = require('zrender/shape/Ellipse'); + // 组件依赖 + require('../component/dataRange'); + require('../component/roamController'); + + var ecConfig = require('../config'); + var ecData = require('../util/ecData'); + var zrUtil = require('zrender/tool/util'); + var zrConfig = require('zrender/config'); + var zrEvent = require('zrender/tool/event'); + + var _mapParams = require('../util/mapData/params').params; + var _textFixed = require('../util/mapData/textFixed'); + var _geoCoord = require('../util/mapData/geoCoord'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} series 数据 + * @param {Object} component 组件 + */ + function Map(ecTheme, messageCenter, zr, option, myChart){ + // 基类 + ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); + // 图表基类 + ChartBase.call(this); + + var self = this; + self._onmousewheel = function(params) { + return self.__onmousewheel(params); + }; + self._onmousedown = function(params) { + return self.__onmousedown(params); + }; + self._onmousemove = function(params) { + return self.__onmousemove(params); + }; + self._onmouseup = function(params) { + return self.__onmouseup(params); + }; + self._onroamcontroller = function(params) { + return self.__onroamcontroller(params); + }; + + this._isAlive = true; // 活着标记 + this._selectedMode = {}; // 选择模式 + this._activeMapType = {}; // 当前活跃的地图类型 + this._clickable = {}; // 悬浮高亮模式,索引到图表 + this._hoverable = {}; // 悬浮高亮模式,索引到图表 + this._showLegendSymbol = {}; // 显示图例颜色标识 + this._selected = {}; // 地图选择状态 + this._mapTypeMap = {}; // 图例类型索引 + this._mapDataMap = {}; // 根据地图类型索引bbox,transform,path + this._nameMap = {}; // 个性化地名 + this._specialArea = {}; // 特殊 + this._refreshDelayTicket; // 滚轮缩放时让refresh飞一会 + this._mapDataRequireCounter; // 异步回调计数器 + this._markAnimation = false; + + // 漫游相关信息 + this._roamMap = {}; + this._scaleLimitMap = {}; + this._mx; + this._my; + this._mousedown; + this._justMove; // 避免移动响应点击 + this._curMapType; // 当前移动的地图类型 + + this.refresh(option); + + this.zr.on(zrConfig.EVENT.MOUSEWHEEL, this._onmousewheel); + this.zr.on(zrConfig.EVENT.MOUSEDOWN, this._onmousedown); + messageCenter.bind(ecConfig.EVENT.ROAMCONTROLLER, this._onroamcontroller); + } + + Map.prototype = { + type : ecConfig.CHART_TYPE_MAP, + /** + * 绘制图形 + */ + _buildShape : function () { + var series = this.series; + this.selectedMap = {}; // 系列 + this._activeMapType = {}; // 当前活跃的地图类型 + + var legend = this.component.legend; + var seriesName; + var valueData = {}; + var mapType; + var data; + var name; + var mapSeries = {}; + var mapValuePrecision = {}; + var valueCalculation = {}; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type == ecConfig.CHART_TYPE_MAP) { // map + series[i] = this.reformOption(series[i]); + mapType = series[i].mapType; + mapSeries[mapType] = mapSeries[mapType] || {}; + mapSeries[mapType][i] = true; + mapValuePrecision[mapType] = mapValuePrecision[mapType] + || series[i].mapValuePrecision; + this._scaleLimitMap[mapType] = this._scaleLimitMap[mapType] || {}; + series[i].scaleLimit + && zrUtil.merge(this._scaleLimitMap[mapType], series[i].scaleLimit, true); + + this._roamMap[mapType] = series[i].roam || this._roamMap[mapType]; + + this._nameMap[mapType] = this._nameMap[mapType] || {}; + series[i].nameMap + && zrUtil.merge(this._nameMap[mapType], series[i].nameMap, true); + this._activeMapType[mapType] = true; + + if (series[i].textFixed) { + zrUtil.merge( + _textFixed, series[i].textFixed, true + ); + } + if (series[i].geoCoord) { + zrUtil.merge( + _geoCoord, series[i].geoCoord, true + ); + } + + this._selectedMode[mapType] = this._selectedMode[mapType] + || series[i].selectedMode; + if (this._hoverable[mapType] == null || this._hoverable[mapType]) { + // false 1票否决 + this._hoverable[mapType] = series[i].hoverable; + } + if (this._clickable[mapType] == null || this._clickable[mapType]) { + // false 1票否决 + this._clickable[mapType] = series[i].clickable; + } + if (this._showLegendSymbol[mapType] == null + || this._showLegendSymbol[mapType] + ) { + // false 1票否决 + this._showLegendSymbol[mapType] = series[i].showLegendSymbol; + } + + valueCalculation[mapType] = valueCalculation[mapType] + || series[i].mapValueCalculation; + + seriesName = series[i].name; + this.selectedMap[seriesName] = legend + ? legend.isSelected(seriesName) + : true; + if (this.selectedMap[seriesName]) { + valueData[mapType] = valueData[mapType] || {}; + data = series[i].data; + for (var j = 0, k = data.length; j < k; j++) { + name = this._nameChange(mapType, data[j].name); + valueData[mapType][name] = valueData[mapType][name] + || {seriesIndex : []}; + for (var key in data[j]) { + if (key != 'value') { + valueData[mapType][name][key] = + data[j][key]; + } + else if (!isNaN(data[j].value)) { + valueData[mapType][name].value == null + && (valueData[mapType][name].value = 0); + + valueData[mapType][name].value += data[j].value; + } + } + //索引有该区域的系列样式 + valueData[mapType][name].seriesIndex.push(i); + } + } + } + } + + this._mapDataRequireCounter = 0; + for (var mt in valueData) { + this._mapDataRequireCounter++; + } + //清空 + this._clearSelected(); + if (this._mapDataRequireCounter === 0) { + this.clear(); + this.zr && this.zr.delShape(this.lastShapeList); + this.lastShapeList = []; + } + for (var mt in valueData) { + if (valueCalculation[mt] && valueCalculation[mt] == 'average') { + for (var k in valueData[mt]) { + valueData[mt][k].value = + (valueData[mt][k].value / valueData[mt][k].seriesIndex.length) + .toFixed( + mapValuePrecision[mt] + ) - 0; + } + } + + this._mapDataMap[mt] = this._mapDataMap[mt] || {}; + + if (this._mapDataMap[mt].mapData) { + // 已经缓存了则直接用 + this._mapDataCallback(mt, valueData[mt], mapSeries[mt])( + this._mapDataMap[mt].mapData + ); + } + else if (_mapParams[mt.replace(/\|.*/, '')].getGeoJson) { + // 特殊区域 + this._specialArea[mt] = + _mapParams[mt.replace(/\|.*/, '')].specialArea + || this._specialArea[mt]; + _mapParams[mt.replace(/\|.*/, '')].getGeoJson( + this._mapDataCallback(mt, valueData[mt], mapSeries[mt]) + ); + } + } + }, + + /** + * @param {string} mt mapType + * @parma {Object} vd valueData + * @param {Object} ms mapSeries + */ + _mapDataCallback : function (mt, vd, ms) { + var self = this; + return function (md) { + if (!self._isAlive) { + // 异步地图数据回调时有可能实例已经被释放 + return; + } + // 缓存这份数据 + if (mt.indexOf('|') != -1) { + // 子地图,加工一份新的mapData + md = self._getSubMapData(mt, md); + } + self._mapDataMap[mt].mapData = md; + + if (md.firstChild) { + self._mapDataMap[mt].rate = 1; + self._mapDataMap[mt].projection = require('../util/projection/svg'); + } + else { + self._mapDataMap[mt].rate = 0.75; + self._mapDataMap[mt].projection = require('../util/projection/normal'); + } + + self._buildMap( + mt, // 类型 + self._getProjectionData(mt, md, ms), // 地图数据 + vd, // 用户数据 + ms // 系列 + ); + self._buildMark(mt, ms); + if (--self._mapDataRequireCounter <= 0) { + self.addShapeList(); + self.zr.refresh(); + } + }; + }, + + _clearSelected : function() { + for (var k in this._selected) { + if (!this._activeMapType[this._mapTypeMap[k]]) { + delete this._selected[k]; + delete this._mapTypeMap[k]; + } + } + }, + + _getSubMapData : function (mapType, mapData) { + var subType = mapType.replace(/^.*\|/, ''); + var features = mapData.features; + for (var i = 0, l = features.length; i < l; i++) { + if (features[i].properties + && features[i].properties.name == subType + ) { + features = features[i]; + if (subType == 'United States of America' + && features.geometry.coordinates.length > 1 // 未被简化 + ) { + features = { + geometry: { + coordinates: features.geometry + .coordinates.slice(5,6), + type: features.geometry.type + }, + id: features.id, + properties: features.properties, + type: features.type + }; + } + break; + } + } + return { + 'type' : 'FeatureCollection', + 'features':[ + features + ] + }; + }, + + /** + * 按需加载相关地图 + */ + _getProjectionData : function (mapType, mapData, mapSeries) { + var normalProjection = this._mapDataMap[mapType].projection; + var province = []; + + // bbox永远不变 + var bbox = this._mapDataMap[mapType].bbox + || normalProjection.getBbox( + mapData, this._specialArea[mapType] + ); + //console.log(bbox) + + var transform; + //console.log(1111,transform) + if (!this._mapDataMap[mapType].hasRoam) { + // 第一次或者发生了resize,需要判断 + transform = this._getTransform( + bbox, + mapSeries, + this._mapDataMap[mapType].rate + ); + } + else { + //经过用户漫游不再响应resize + transform = this._mapDataMap[mapType].transform; + } + //console.log(bbox,transform) + var lastTransform = this._mapDataMap[mapType].lastTransform + || {scale:{}}; + + var pathArray; + if (transform.left != lastTransform.left + || transform.top != lastTransform.top + || transform.scale.x != lastTransform.scale.x + || transform.scale.y != lastTransform.scale.y + ) { + // 发生过变化,需要重新生成pathArray + // 一般投射 + //console.log(transform) + pathArray = normalProjection.geoJson2Path( + mapData, transform, this._specialArea[mapType] + ); + lastTransform = zrUtil.clone(transform); + } + else { + transform = this._mapDataMap[mapType].transform; + pathArray = this._mapDataMap[mapType].pathArray; + } + + this._mapDataMap[mapType].bbox = bbox; + this._mapDataMap[mapType].transform = transform; + this._mapDataMap[mapType].lastTransform = lastTransform; + this._mapDataMap[mapType].pathArray = pathArray; + + //console.log(pathArray) + var position = [transform.left, transform.top]; + for (var i = 0, l = pathArray.length; i < l; i++) { + /* for test + console.log( + mapData.features[i].properties.cp, // 经纬度度 + pathArray[i].cp // 平面坐标 + ); + console.log( + this.pos2geo(mapType, pathArray[i].cp), // 平面坐标转经纬度 + this.geo2pos(mapType, mapData.features[i].properties.cp) + ) + */ + province.push(this._getSingleProvince( + mapType, pathArray[i], position + )); + } + + if (this._specialArea[mapType]) { + for (var area in this._specialArea[mapType]) { + province.push(this._getSpecialProjectionData( + mapType, mapData, + area, this._specialArea[mapType][area], + position + )); + } + + } + + // 中国地图加入南海诸岛 + if (mapType == 'china') { + var leftTop = this.geo2pos( + mapType, + _geoCoord['南海诸岛'] || _mapParams['南海诸岛'].textCoord + ); + // scale.x : width = 10.51 : 64 + var scale = transform.scale.x / 10.5; + var textPosition = [ + 32 * scale + leftTop[0], + 83 * scale + leftTop[1] + ]; + if (_textFixed['南海诸岛']) { + textPosition[0] += _textFixed['南海诸岛'][0]; + textPosition[1] += _textFixed['南海诸岛'][1]; + } + province.push({ + name : this._nameChange(mapType, '南海诸岛'), + path : _mapParams['南海诸岛'].getPath(leftTop, scale), + position : position, + textX : textPosition[0], + textY : textPosition[1] + }); + + } + //console.log(JSON.stringify(province)); + //console.log(JSON.stringify(this._mapDataMap[mapType].transform)); + return province; + }, + + /** + * 特殊地区投射数据 + */ + _getSpecialProjectionData : function (mapType, mapData, areaName, mapSize, position) { + //console.log('_getSpecialProjectionData--------------') + // 构造单独的geoJson地图数据 + mapData = this._getSubMapData('x|' + areaName, mapData); + + // bbox + var normalProjection = require('../util/projection/normal'); + var bbox = normalProjection.getBbox(mapData); + //console.log('bbox', bbox) + + // transform + var leftTop = this.geo2pos( + mapType, + [mapSize.left, mapSize.top] + ); + var rightBottom = this.geo2pos( + mapType, + [mapSize.left + mapSize.width, mapSize.top + mapSize.height] + ); + //console.log('leftright' , leftTop, rightBottom); + var width = Math.abs(rightBottom[0] - leftTop[0]); + var height = Math.abs(rightBottom[1] - leftTop[1]); + var mapWidth = bbox.width; + var mapHeight = bbox.height; + //var minScale; + var xScale = (width / 0.75) / mapWidth; + var yScale = height / mapHeight; + if (xScale > yScale) { + xScale = yScale * 0.75; + width = mapWidth * xScale; + } + else { + yScale = xScale; + xScale = yScale * 0.75; + height = mapHeight * yScale; + } + var transform = { + OffsetLeft : leftTop[0], + OffsetTop : leftTop[1], + //width: width, + //height: height, + scale : { + x : xScale, + y : yScale + } + }; + + //console.log('**',areaName, transform) + var pathArray = normalProjection.geoJson2Path( + mapData, transform + ); + + //console.log(pathArray) + return this._getSingleProvince( + mapType, pathArray[0], position + ); + }, + + _getSingleProvince : function (mapType, path, position) { + var textPosition; + var name = path.properties.name; + var textFixed = _textFixed[name] || [0, 0]; + if (_geoCoord[name]) { + // 经纬度直接定位不加textFixed + textPosition = this.geo2pos( + mapType, + _geoCoord[name] + ); + } + else if (path.cp) { + textPosition = [ + path.cp[0] + textFixed[0], + path.cp[1] + textFixed[1] + ]; + } + else { + var bbox = this._mapDataMap[mapType].bbox; + textPosition = this.geo2pos( + mapType, + [bbox.left + bbox.width / 2, bbox.top + bbox.height / 2] + ); + textPosition[0] += textFixed[0]; + textPosition[1] += textFixed[1]; + } + + //console.log(textPosition) + path.name = this._nameChange(mapType, name); + path.position = position; + path.textX = textPosition[0]; + path.textY = textPosition[1]; + return path; + }, + + /** + * 获取缩放 + */ + _getTransform : function (bbox, mapSeries, rate) { + var series = this.series; + var mapLocation; + var x; + var cusX; + var y; + var cusY; + var width; + var height; + var zrWidth = this.zr.getWidth(); + var zrHeight = this.zr.getHeight(); + //上下左右留空 + var padding = Math.round(Math.min(zrWidth, zrHeight) * 0.02); + for (var key in mapSeries) { + mapLocation = series[key].mapLocation || {}; + cusX = mapLocation.x || cusX; + cusY = mapLocation.y || cusY; + width = mapLocation.width || width; + height = mapLocation.height || height; + } + + //x = isNaN(cusX) ? padding : cusX; + x = this.parsePercent(cusX, zrWidth); + x = isNaN(x) ? padding : x; + //y = isNaN(cusY) ? padding : cusY; + y = this.parsePercent(cusY, zrHeight); + y = isNaN(y) ? padding : y; + + width = width == null + ? (zrWidth - x - 2 * padding) + : (this.parsePercent(width, zrWidth)); + height = height == null + ? (zrHeight - y - 2 * padding) + : (this.parsePercent(height, zrHeight)); + + var mapWidth = bbox.width; + var mapHeight = bbox.height; + //var minScale; + var xScale = (width / rate) / mapWidth; + var yScale = height / mapHeight; + if (xScale > yScale) { + //minScale = yScale; + xScale = yScale * rate; + width = mapWidth * xScale; + } + else { + //minScale = xScale; + yScale = xScale; + xScale = yScale * rate; + height = mapHeight * yScale; + } + //console.log(minScale) + //width = mapWidth * minScale; + //height = mapHeight * minScale; + + if (isNaN(cusX)) { + cusX = cusX || 'center'; + switch (cusX + '') { + case 'center' : + x = Math.floor((zrWidth - width) / 2); + break; + case 'right' : + x = zrWidth - width; + break; + //case 'left' : + //x = padding; + } + } + //console.log(cusX,x,zrWidth,width,'kener') + if (isNaN(cusY)) { + cusY = cusY || 'center'; + switch (cusY + '') { + case 'center' : + y = Math.floor((zrHeight - height) / 2); + break; + case 'bottom' : + y = zrHeight - height; + break; + //case 'top' : + //y = padding; + } + } + //console.log(x,y,width,height) + return { + left : x, + top : y, + width: width, + height: height, + //scale : minScale * 50, // wtf 50 + baseScale : 1, + scale : { + x : xScale, + y : yScale + } + //translate : [x + width / 2, y + height / 2] + }; + }, + + /** + * 构建地图 + * @param {Object} mapData 图形数据 + * @param {Object} valueData 用户数据 + */ + _buildMap : function (mapType, mapData, valueData, mapSeries) { + var series = this.series; + var legend = this.component.legend; + var dataRange = this.component.dataRange; + var seriesName; + var name; + var data; + var value; + var queryTarget; + var defaultOption = this.ecTheme.map; + + var color; + var font; + var style; + var highlightStyle; + + var shape; + var textShape; + for (var i = 0, l = mapData.length; i < l; i++) { + style = zrUtil.clone(mapData[i]); + highlightStyle = { + name : style.name, + path : style.path, + position : zrUtil.clone(style.position) + }; + name = style.name; + data = valueData[name]; // 多系列合并后的数据 + if (data) { + queryTarget = [data]; // level 3 + seriesName = ''; + for (var j = 0, k = data.seriesIndex.length; j < k; j++) { + // level 2 + queryTarget.push(series[data.seriesIndex[j]]); + seriesName += series[data.seriesIndex[j]].name + ' '; + if (legend + && this._showLegendSymbol[mapType] + && legend.hasColor(series[data.seriesIndex[j]].name) + ) { + this.shapeList.push(new CircleShape({ + zlevel : this._zlevelBase + 1, + position : zrUtil.clone(style.position), + _mapType : mapType, + /* + _geo : this.pos2geo( + mapType, [style.textX + 3 + j * 7, style.textY - 10] + ), + */ + style : { + x : style.textX + 3 + j * 7, + y : style.textY - 10, + r : 3, + color : legend.getColor( + series[data.seriesIndex[j]].name + ) + }, + hoverable : false + })); + } + } + queryTarget.push(defaultOption); // level 1 + value = data.value; + } + else { + data = '-'; + seriesName = ''; + queryTarget = []; + for (var key in mapSeries) { + queryTarget.push(series[key]); + } + queryTarget.push(defaultOption); + value = '-'; + } + + // 值域控件控制 + color = (dataRange && !isNaN(value)) + ? dataRange.getColor(value) + : null; + + // 常规设置 + style.color = style.color + || color + || this.getItemStyleColor( + this.deepQuery(queryTarget, 'itemStyle.normal.color'), + data.seriesIndex, -1, data + ) + || this.deepQuery( + queryTarget, 'itemStyle.normal.areaStyle.color' + ); + style.strokeColor = style.strokeColor + || this.deepQuery(queryTarget, 'itemStyle.normal.borderColor'); + style.lineWidth = style.lineWidth + || this.deepQuery(queryTarget, 'itemStyle.normal.borderWidth'); + + // 高亮 + highlightStyle.color = this.getItemStyleColor( + this.deepQuery(queryTarget, 'itemStyle.emphasis.color'), + data.seriesIndex, -1, data + ) + || this.deepQuery( + queryTarget, 'itemStyle.emphasis.areaStyle.color' + ) + || style.color; + highlightStyle.strokeColor = this.deepQuery( + queryTarget, 'itemStyle.emphasis.borderColor' + ) + || style.strokeColor; + highlightStyle.lineWidth = this.deepQuery( + queryTarget, 'itemStyle.emphasis.borderWidth' + ) + || style.lineWidth; + + style.brushType = highlightStyle.brushType = style.brushType || 'both'; + style.lineJoin = highlightStyle.lineJoin = 'round'; + style._name = highlightStyle._name = name; + + font = this.deepQuery(queryTarget, 'itemStyle.normal.label.textStyle'); + // 文字标签避免覆盖单独一个shape + textShape = { + zlevel : this._zlevelBase + 1, + //hoverable: this._hoverable[mapType], + //clickable: this._clickable[mapType], + position : zrUtil.clone(style.position), + _mapType : mapType, + _geo : this.pos2geo( + mapType, [style.textX, style.textY] + ), + style : { + brushType : 'fill', + x : style.textX, + y : style.textY, + text : this.getLabelText(name, value, queryTarget, 'normal'), + _name : name, + textAlign : 'center', + color : this.deepQuery(queryTarget, 'itemStyle.normal.label.show') + ? this.deepQuery( + queryTarget, + 'itemStyle.normal.label.textStyle.color' + ) + : 'rgba(0,0,0,0)', + textFont : this.getFont(font) + } + }; + textShape._style = zrUtil.clone(textShape.style); + + textShape.highlightStyle = zrUtil.clone(textShape.style); + if (this.deepQuery(queryTarget, 'itemStyle.emphasis.label.show')) { + textShape.highlightStyle.text = this.getLabelText( + name, value, queryTarget, 'emphasis' + ); + textShape.highlightStyle.color = this.deepQuery( + queryTarget, + 'itemStyle.emphasis.label.textStyle.color' + ) || textShape.style.color; + font = this.deepQuery( + queryTarget, + 'itemStyle.emphasis.label.textStyle' + ) || font; + textShape.highlightStyle.textFont = this.getFont(font); + } + else { + textShape.highlightStyle.color = 'rgba(0,0,0,0)'; + } + + shape = { + zlevel : this._zlevelBase, + //hoverable: this._hoverable[mapType], + //clickable: this._clickable[mapType], + position : zrUtil.clone(style.position), + style : style, + highlightStyle : highlightStyle, + _style: zrUtil.clone(style), + _mapType: mapType + }; + if (style.scale != null) { + shape.scale = zrUtil.clone(style.scale); + } + + textShape = new TextShape(textShape); + switch (shape.style.shapeType) { + case 'rectangle' : + shape = new RectangleShape(shape); + break; + case 'line' : + shape = new LineShape(shape); + break; + case 'circle' : + shape = new CircleShape(shape); + break; + case 'polygon' : + shape = new PolygonShape(shape); + break; + case 'ellipse': + shape = new EllipseShape(shape); + break; + default : + shape = new PathShape(shape); + if (shape.buildPathArray) { + shape.style.pathArray = shape.buildPathArray(shape.style.path); + } + break; + } + + if (this._selectedMode[mapType] && + this._selected[name] + || (data.selected && this._selected[name] !== false) + ) { + textShape.style = textShape.highlightStyle; + shape.style = shape.highlightStyle; + } + + textShape.clickable = shape.clickable = + this._clickable[mapType] + && (data.clickable == null || data.clickable); + + if (this._selectedMode[mapType]) { + this._selected[name] = this._selected[name] != null + ? this._selected[name] + : data.selected; + this._mapTypeMap[name] = mapType; + + if (data.selectable == null || data.selectable) { + shape.clickable = textShape.clickable = true; + shape.onclick = textShape.onclick = this.shapeHandler.onclick; + } + } + + if (this._hoverable[mapType] + && (data.hoverable == null || data.hoverable) + ) { + textShape.hoverable = shape.hoverable = true; + shape.hoverConnect = textShape.id; + textShape.hoverConnect = shape.id; + shape.onmouseover = textShape.onmouseover = this.hoverConnect; + } + else { + textShape.hoverable = shape.hoverable = false; + } + + // console.log(name,shape); + ecData.pack( + textShape, + { + name: seriesName, + tooltip: this.deepQuery(queryTarget, 'tooltip') + }, + 0, + data, 0, + name + ); + this.shapeList.push(textShape); + + ecData.pack( + shape, + { + name: seriesName, + tooltip: this.deepQuery(queryTarget, 'tooltip') + }, + 0, + data, 0, + name + ); + this.shapeList.push(shape); + } + //console.log(this._selected); + }, + + // 添加标注 + _buildMark : function (mapType, mapSeries) { + this._seriesIndexToMapType = this._seriesIndexToMapType || {}; + this.markAttachStyle = this.markAttachStyle || {}; + var position = [ + this._mapDataMap[mapType].transform.left, + this._mapDataMap[mapType].transform.top + ]; + if (mapType == 'none') { + position = [0, 0]; + } + for (var sIdx in mapSeries) { + this._seriesIndexToMapType[sIdx] = mapType; + this.markAttachStyle[sIdx] = { + position : position, + _mapType : mapType + }; + this.buildMark(sIdx); + } + }, + + // 位置转换 + getMarkCoord : function (seriesIndex, mpData) { + return (mpData.geoCoord || _geoCoord[mpData.name]) + ? this.geo2pos( + this._seriesIndexToMapType[seriesIndex], + mpData.geoCoord || _geoCoord[mpData.name] + ) + : [0, 0]; + }, + + getMarkGeo : function(mpData) { + return mpData.geoCoord || _geoCoord[mpData.name]; + }, + + _nameChange : function (mapType, name) { + return this._nameMap[mapType][name] || name; + }, + + /** + * 根据lable.format计算label text + */ + getLabelText : function (name, value, queryTarget, status) { + var formatter = this.deepQuery( + queryTarget, + 'itemStyle.' + status + '.label.formatter' + ); + if (formatter) { + if (typeof formatter == 'function') { + return formatter.call( + this.myChart, + name, + value + ); + } + else if (typeof formatter == 'string') { + formatter = formatter.replace('{a}','{a0}') + .replace('{b}','{b0}'); + formatter = formatter.replace('{a0}', name) + .replace('{b0}', value); + return formatter; + } + } + else { + return name; + } + }, + + _findMapTypeByPos : function (mx, my) { + var transform; + var left; + var top; + var width; + var height; + for (var mapType in this._mapDataMap) { + transform = this._mapDataMap[mapType].transform; + if (!transform || !this._roamMap[mapType] || !this._activeMapType[mapType]) { + continue; + } + + left = transform.left; + top = transform.top; + width = transform.width; + height = transform.height; + if (mx >= left + && mx <= (left + width) + && my >= top + && my <= (top + height) + ) { + return mapType; + } + } + return; + }, + + /** + * 滚轮缩放 + */ + __onmousewheel : function (params) { + if (this.shapeList.length <= 0) { + return; + } + + var event = params.event; + var mx = zrEvent.getX(event); + var my = zrEvent.getY(event); + var delta = zrEvent.getDelta(event); + //delta = delta > 0 ? (-1) : 1; + var mapType; + var mapTypeControl = params.mapTypeControl; + if (!mapTypeControl) { + mapTypeControl = {}; + mapType = this._findMapTypeByPos(mx, my); + if (mapType && this._roamMap[mapType] && this._roamMap[mapType] != 'move') { + mapTypeControl[mapType] = true; + } + } + + var haveScale = false; + for (mapType in mapTypeControl) { + if (mapTypeControl[mapType]) { + haveScale = true; + var transform = this._mapDataMap[mapType].transform; + var left = transform.left; + var top = transform.top; + var width = transform.width; + var height = transform.height; + // 位置转经纬度 + var geoAndPos = this.pos2geo(mapType, [mx - left, my - top]); + if (delta > 0) { + delta = 1.2; // 放大 + if (this._scaleLimitMap[mapType].max != null + && transform.baseScale >= this._scaleLimitMap[mapType].max + ) { + return; // 缩放限制 + } + } + else { + delta = 1 / 1.2; // 缩小 + if (this._scaleLimitMap[mapType].min != null + && transform.baseScale <= this._scaleLimitMap[mapType].min + ) { + return; // 缩放限制 + } + } + + transform.baseScale *= delta; + transform.scale.x *= delta; + transform.scale.y *= delta; + transform.width = width * delta; + transform.height = height * delta; + + this._mapDataMap[mapType].hasRoam = true; + this._mapDataMap[mapType].transform = transform; + // 经纬度转位置 + geoAndPos = this.geo2pos(mapType, geoAndPos); + // 保持视觉中心 + transform.left -= geoAndPos[0] - (mx - left); + transform.top -= geoAndPos[1] - (my - top); + this._mapDataMap[mapType].transform = transform; + + this.clearEffectShape(true); + for (var i = 0, l = this.shapeList.length; i < l; i++) { + if(this.shapeList[i]._mapType == mapType) { + this.shapeList[i].position[0] = transform.left; + this.shapeList[i].position[1] = transform.top; + if (this.shapeList[i].type == 'path' + || this.shapeList[i].type == 'symbol' + || this.shapeList[i].type == 'circle' + || this.shapeList[i].type == 'rectangle' + || this.shapeList[i].type == 'polygon' + || this.shapeList[i].type == 'line' + || this.shapeList[i].type == 'ellipse' + ) { + this.shapeList[i].scale[0] *= delta; + this.shapeList[i].scale[1] *= delta; + } + else if (this.shapeList[i].type == 'mark-line') { + this.shapeList[i].style.pointListLength = undefined; + this.shapeList[i].style.pointList = false; + geoAndPos = this.geo2pos(mapType, this.shapeList[i]._geo[0]); + this.shapeList[i].style.xStart = geoAndPos[0]; + this.shapeList[i].style.yStart = geoAndPos[1]; + geoAndPos = this.geo2pos(mapType, this.shapeList[i]._geo[1]); + this.shapeList[i]._x = this.shapeList[i].style.xEnd = geoAndPos[0]; + this.shapeList[i]._y = this.shapeList[i].style.yEnd = geoAndPos[1]; + } + else if (this.shapeList[i].type == 'icon') { + geoAndPos = this.geo2pos(mapType, this.shapeList[i]._geo); + this.shapeList[i].style.x = this.shapeList[i].style._x = + geoAndPos[0] - this.shapeList[i].style.width / 2; + this.shapeList[i].style.y = this.shapeList[i].style._y = + geoAndPos[1] - this.shapeList[i].style.height / 2; + } + else { + geoAndPos = this.geo2pos(mapType, this.shapeList[i]._geo); + this.shapeList[i].style.x = geoAndPos[0]; + this.shapeList[i].style.y = geoAndPos[1]; + if (this.shapeList[i].type == 'text') { + this.shapeList[i]._style.x = this.shapeList[i].highlightStyle.x + = geoAndPos[0]; + this.shapeList[i]._style.y = this.shapeList[i].highlightStyle.y + = geoAndPos[1]; + } + } + + this.zr.modShape(this.shapeList[i].id); + } + } + } + } + if (haveScale) { + zrEvent.stop(event); + this.zr.refresh(); + + var self = this; + clearTimeout(this._refreshDelayTicket); + this._refreshDelayTicket = setTimeout( + function(){ + self && self.shapeList && self.animationEffect(); + }, + 100 + ); + + this.messageCenter.dispatch( + ecConfig.EVENT.MAP_ROAM, + params.event, + {type : 'scale'}, + this.myChart + ); + } + }, + + __onmousedown : function (params) { + if (this.shapeList.length <= 0) { + return; + } + var target = params.target; + if (target && target.draggable) { + return; + } + var event = params.event; + var mx = zrEvent.getX(event); + var my = zrEvent.getY(event); + var mapType = this._findMapTypeByPos(mx, my); + if (mapType && this._roamMap[mapType] && this._roamMap[mapType] != 'scale') { + this._mousedown = true; + this._mx = mx; + this._my = my; + this._curMapType = mapType; + this.zr.on(zrConfig.EVENT.MOUSEUP, this._onmouseup); + var self = this; + setTimeout(function (){ + self.zr.on(zrConfig.EVENT.MOUSEMOVE, self._onmousemove); + },100); + } + + }, + + __onmousemove : function (params) { + if (!this._mousedown || !this._isAlive) { + return; + } + var event = params.event; + var mx = zrEvent.getX(event); + var my = zrEvent.getY(event); + var transform = this._mapDataMap[this._curMapType].transform; + transform.hasRoam = true; + transform.left -= this._mx - mx; + transform.top -= this._my - my; + this._mx = mx; + this._my = my; + this._mapDataMap[this._curMapType].transform = transform; + + for (var i = 0, l = this.shapeList.length; i < l; i++) { + if(this.shapeList[i]._mapType == this._curMapType) { + this.shapeList[i].position[0] = transform.left; + this.shapeList[i].position[1] = transform.top; + this.zr.modShape(this.shapeList[i].id); + } + } + + this.messageCenter.dispatch( + ecConfig.EVENT.MAP_ROAM, + params.event, + {type : 'move'}, + this.myChart + ); + + this.clearEffectShape(true); + this.zr.refresh(); + + this._justMove = true; + zrEvent.stop(event); + }, + + __onmouseup : function (params) { + var event = params.event; + this._mx = zrEvent.getX(event); + this._my = zrEvent.getY(event); + this._mousedown = false; + var self = this; + setTimeout(function (){ + self._justMove && self.animationEffect(); + self._justMove = false; + self.zr.un(zrConfig.EVENT.MOUSEMOVE, self._onmousemove); + self.zr.un(zrConfig.EVENT.MOUSEUP, self._onmouseup); + },120); + }, + + __onroamcontroller: function(params) { + var event = params.event; + event.zrenderX = this.zr.getWidth() / 2; + event.zrenderY = this.zr.getHeight() / 2; + var mapTypeControl = params.mapTypeControl; + var top = 0; + var left = 0; + var step = params.step; + + switch(params.roamType) { + case 'scaleUp': + event.zrenderDelta = 1; + this.__onmousewheel({ + event: event, + mapTypeControl: mapTypeControl + }); + return; + case 'scaleDown': + event.zrenderDelta = -1; + this.__onmousewheel({ + event: event, + mapTypeControl: mapTypeControl + }); + return; + case 'up': + top = -step; + break; + case 'down': + top = step; + break; + case 'left': + left = -step; + break; + case 'right': + left = step; + break; + } + + var transform; + var curMapType; + for (curMapType in mapTypeControl) { + if (!this._mapDataMap[curMapType] || !this._activeMapType[curMapType]) { + continue; + } + transform = this._mapDataMap[curMapType].transform; + transform.hasRoam = true; + transform.left -= left; + transform.top -= top; + this._mapDataMap[curMapType].transform = transform; + } + for (var i = 0, l = this.shapeList.length; i < l; i++) { + curMapType = this.shapeList[i]._mapType; + if (!mapTypeControl[curMapType] || !this._activeMapType[curMapType]) { + continue; + } + transform = this._mapDataMap[curMapType].transform; + this.shapeList[i].position[0] = transform.left; + this.shapeList[i].position[1] = transform.top; + this.zr.modShape(this.shapeList[i].id); + } + + this.messageCenter.dispatch( + ecConfig.EVENT.MAP_ROAM, + params.event, + {type : 'move'}, + this.myChart + ); + + this.clearEffectShape(true); + this.zr.refresh(); + + clearTimeout(this.dircetionTimer); + var self = this; + this.dircetionTimer = setTimeout(function() { + self.animationEffect(); + }, 150); + }, + + /** + * 点击响应 + */ + onclick : function (params) { + if (!this.isClick || !params.target || this._justMove || params.target.type == 'icon') { + // 没有在当前实例上发生点击直接返回 + return; + } + this.isClick = false; + + var target = params.target; + var name = target.style._name; + var len = this.shapeList.length; + var mapType = target._mapType || ''; + + if (this._selectedMode[mapType] == 'single') { + for (var p in this._selected) { + // 同一地图类型 + if (this._selected[p] && this._mapTypeMap[p] == mapType) { + // 复位那些生效shape(包括文字) + for (var i = 0; i < len; i++) { + if (this.shapeList[i].style._name == p + && this.shapeList[i]._mapType == mapType + ) { + this.shapeList[i].style = this.shapeList[i]._style; + this.zr.modShape(this.shapeList[i].id); + } + } + p != name && (this._selected[p] = false); + } + } + } + + this._selected[name] = !this._selected[name]; + + // 更新当前点击shape(包括文字) + for (var i = 0; i < len; i++) { + if (this.shapeList[i].style._name == name + && this.shapeList[i]._mapType == mapType + ) { + if (this._selected[name]) { + this.shapeList[i].style = this.shapeList[i].highlightStyle; + } + else { + this.shapeList[i].style = this.shapeList[i]._style; + } + this.zr.modShape(this.shapeList[i].id); + } + } + this.messageCenter.dispatch( + ecConfig.EVENT.MAP_SELECTED, + params.event, + { + selected : this._selected, + target : name + }, + this.myChart + ); + this.zr.refresh(); + + var self = this; + setTimeout(function(){ + self.zr.trigger( + zrConfig.EVENT.MOUSEMOVE, + params.event + ); + },100); + }, + + /** + * 刷新 + */ + refresh : function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + + if (this._mapDataRequireCounter > 0) { + this.clear(); + } + else { + this.backupShapeList(); + } + this._buildShape(); + this.zr.refreshHover(); + }, + + /** + * 值域响应 + * @param {Object} param + * @param {Object} status + */ + ondataRange : function (param, status) { + if (this.component.dataRange) { + this.refresh(); + status.needRefresh = true; + } + return; + }, + + /** + * 平面坐标转经纬度 + */ + pos2geo : function (mapType, p) { + if (!this._mapDataMap[mapType].transform) { + return null; + } + return this._mapDataMap[mapType].projection.pos2geo( + this._mapDataMap[mapType].transform, p + ); + }, + + /** + * 公开接口 : 平面坐标转经纬度 + */ + getGeoByPos : function (mapType, p) { + if (!this._mapDataMap[mapType].transform) { + return null; + } + var position = [ + this._mapDataMap[mapType].transform.left, + this._mapDataMap[mapType].transform.top + ]; + if (p instanceof Array) { + p[0] -= position[0]; + p[1] -= position[1]; + } + else { + p.x -= position[0]; + p.y -= position[1]; + } + return this.pos2geo(mapType, p); + }, + + /** + * 经纬度转平面坐标 + * @param {Object} p + */ + geo2pos : function (mapType, p) { + if (!this._mapDataMap[mapType].transform) { + return null; + } + return this._mapDataMap[mapType].projection.geo2pos( + this._mapDataMap[mapType].transform, p + ); + }, + + /** + * 公开接口 : 经纬度转平面坐标 + */ + getPosByGeo : function (mapType, p) { + if (!this._mapDataMap[mapType].transform) { + return null; + } + var pos = this.geo2pos(mapType, p); + pos[0] += this._mapDataMap[mapType].transform.left; + pos[1] += this._mapDataMap[mapType].transform.top; + return pos; + }, + + /** + * 公开接口 : 地图参考坐标 + */ + getMapPosition : function (mapType) { + if (!this._mapDataMap[mapType].transform) { + return null; + } + return [ + this._mapDataMap[mapType].transform.left, + this._mapDataMap[mapType].transform.top + ]; + }, + + /* + appendShape : function (mapType, shapeList) { + shapeList = shapeList instanceof Array + ? shapeList : [shapeList]; + for (var i = 0, l = shapeList.length; i < l; i++) { + if (typeof shapeList[i].zlevel == 'undefined') { + shapeList[i].zlevel = this._zlevelBase + 1; + } + shapeList[i]._mapType = mapType; + this.shapeList.push(shapeList[i]); + this.zr.addShape(shapeList[i]); + } + this.zr.refresh(); + }, + */ + + /** + * 释放后实例不可用 + */ + dispose : function () { + this.clear(); + this.shapeList = null; + this.effectList = null; + this._isAlive = false; + this.zr.un(zrConfig.EVENT.MOUSEWHEEL, this._onmousewheel); + this.zr.un(zrConfig.EVENT.MOUSEDOWN, this._onmousedown); + this.messageCenter.unbind( + ecConfig.EVENT.ROAMCONTROLLER, this._onroamcontroller + ); + } + }; + + zrUtil.inherits(Map, ChartBase); + zrUtil.inherits(Map, ComponentBase); + + // 图表注册 + require('../chart').define('map', Map); + + return Map; }); -define('echarts/util/mapData/geoJson/an_hui_geo',[],function() { - return {"type":"FeatureCollection","features":[{"type":"Feature","id":"3415","properties":{"name":"六安市","cp":[116.3123,31.8329],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@„„nJ‚UXUVƒ°U„ÑnU@mlLVaVln@@bn@VU@xlb@lšLnKlšƒVI„JšUVxnI@lVL@b„Ž°VX@˜b„x„nVVUnVVnU‚›@kX@VwV@„al¥UUnUWa@ƒ@wĸU„LU¥lKUa@aUI@alLVaUƒ¯anƒWkUKm@XV@VaXlW@aU_UWVUƒI¯@ma¯W¯™™I@UU@WWU@U@@UU@VkV@@WUUm@UaU@„lK@IUK„L@KWmXUWaXI@ƒ@a@a@U@U@KV¥lw„k°b²JVIVKlV@UX„la„Ul`œUVLVVVUšJ„U@Lnm@_VK@KUIW@™J@Xk@WW@U—ƒmm™XmWk@kK@aUUƒVmmkUwUmWL™@WmU@™UJmUULkKWakLWVkIƒlƒwULƒW@X°lUJ@°ULƒWV—wmJ@bmb¯Vkm@@WkWm¯wƒL@lkXƒWmXym¯UImJUbkV™@Vn¯„@V@lUbƒ@mk@maUxmlUbULWn@J—LmKUkWKkwUKƒbm„X„WxkVUKmLkVV@JUUWL@xkJUUƒV@X@VVlUbVX@xk¤šx‚¼œxWxn„‚nn@Þ¼„JVb°aVn„@šmlnXU„JlbVlkz@‚lUŽlXJmxVxXnWxXÈWlUŽ@šUxU@VX@xUL@šUÆmLnV@lWXk@@JlbXblnlJ"],"encodeOffsets":[[118710,33351]]}},{"type":"Feature","id":"3408","properties":{"name":"安庆市","cp":[116.7517,30.5255],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@n°‚znW„XlW@k„K°xXn‚l@Xn@l‚°Una@anI˜xXU„ŽVK@¯VIkW¯X@‚„VK„x„klJXUlKXblLVKnVVIšŽV@Xn‚@šŽXKVnVxlŽnn„UlmV@²óUkV™lW„b„lƒšƒn@VVVIn@lw@WVIXblV„@Èx‚aUaVIVVnKVLšK„ƒln@b²K@»U£ƒÑķƒġÝÅb™K™a@Im@ۍ„@kWÓkkmKÅnóJƒUÅ£›W@w„ĕ@wĉţ¯¯ƒUkK±l¯Uƒ¥UÑkÝUķ»Ý¥¯™JƒIUŽVbUl¯ÈV¼VJU¼Vb@bkLUl@„VJ@bUXǚ@lkVmXmKkLVxš‚Ž„VƒL@VkVVVlzW˜kbmLUUUbVbUV™šlÒnJlUnLllUL@bU„Vx„l‚LXVƦÈVU¦WJ"],"encodeOffsets":[[118834,31759]]}},{"type":"Feature","id":"3411","properties":{"name":"滁州市","cp":[118.1909,32.536],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@š„@`nnl@„xšK@X°KXV˜IXVlbXVWnX‚lL@šÈ»‚LVan@VJ„êVVn@‚X@laÞbVaƒyn@„_‚xnWVXnWl@VnUVkI@l‚nXKVLVV@V@kW@LlVô„@J@bVnnKnkVa@»lç@ƒnwšKma™UUUVњ@n™mWXalI@alVn@VwUaVU„@„nlaôJnU„VVXlJšaXXVK@UšV@VWx@nXVWšXVšUlLUbV‚ULVVnUVbUbVbš@@a„KÆnnKVK@U@UU@@a„@Vƒ°¯ÈJVIlķ@aa˜UaVKU_@mkxUI@aƒUlyU@@™wkKWmUbUnUVWbkJW_J@bƒn@Vm@@KULk@V@@bVbÅm@LW@UVVbkK@UkKWL@VULUKWIUJUbkK@_WVXU›Jka@XƒVa@kšy@aVIUUW@@m„UlLœKWÑUKVan@UkVmmIXKƒaVaUwVU@UmykU¯@±UUL@WUIVUU@KkIWaƒaU@kUUaǃUó»mKƒk¯@y@kWK@bkI¯`mn™l¯XWlkVUzUJlbUbVJl@nnm„@VULV`XnWƗbmUUn™JmUknƒJ¯km@ƒyk@kU›xL@VUbmnn¤lX@`™z@JmaULUVl@Xn@xllkXWa—aW@UVmUbƒ@mVXšWxXbWbUŽƒÒnVVnVVUL"],"encodeOffsets":[[120004,33520]]}},{"type":"Feature","id":"3418","properties":{"name":"宣城市","cp":[118.8062,30.6244],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@Vb@„XL˜JXxlIXxlVlV@I²¤šnlUnVšU@VULWVUJ@Lnb@lV@UnV@@VVVlLnbnJ‚UVkUUVWn@@anUVnVJVIV‚@@nUJVbUb‚„@VUbVK@bn@VbnIlxkllXVlXKWUXUlL°¤UVVb@bš„UlkXW‚ƒxXz@‚„Ila„UlƒnUlJVInVÆJ„U„LVUnV„K°@VnlVnxV@XLlK@wVL@KnUlJXU˜bnKVLX„lUw@VWlLXKm@@a„@VLnmlIVVnKn@škVašVlwk@@a@k@ƒVIUa™@maUa@wna@kmWƒ™UUmVUIVǗ@aƒKm™aƒ™kU™J@InmUUaVa„k‚lX@Vk@m@VU@wnK@alKVUkUkKƒbmUkmƒ@U£WVk@@UÝbbƒaÇx@b@WVUa¯ƒ@wVwUUV@VwnK@KWaŁ@KšIUyUI@WmXó™UbWaKm™@km@IUyƒIUaWKƒx@zUKUL@llVUnkLVVkJWX@VUKUVƒIkVWakb@VWb@n@JkXUlmL@xkL@`VxšLUÈUJ@Vm@@bmIUlUL@VUVVbknm@mKUw™KVÈ@J@LV±kkJUIƒl"],"encodeOffsets":[[120803,31247]]}},{"type":"Feature","id":"3412","properties":{"name":"阜阳市","cp":[115.7629,32.9919],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@V™nƒš@ša„k°aš±@‚¥@UUI@aUmlwUUx›b@¥XU@mmI@a@Kn@@_W@@W„I@mšUVVXUl@XaV@‚K@I@a„LX@aVI°K@KVL„UUw‚yXkšK@kšKÆbXnlK@k@a„JlU@w@U@»@aXKWƒn_‚JXkVKnƒ@°LlKXƒW@¯Uƒ@aUK@kmJUw™VƒIUJ™„kŽmL™K@kka@wUVm@@am@UkUbkK@nmVƒÒ¯VU„WVVmIƒƒULk@ƒƒma@kkKƒƒ@nUbUamU™`UUVUkKVkkƒW@@bkmƒnƒmUXVKXVƒL@VƒbU„m‚™bVXJ@nmKÅI@KWKUXVJUL@VUKUX@KUKWL@LUJmaXXm@kVVV@L@VUL@VlK@L@V@LUK@VUb@UUU@°@nVxU`‚Lkn@`@XVJ@X™Vm„k@UKmV¯LVVn±Wm@Ub@JlLUl„@VLk„@lmVVn@bnV@V°IV™šaVJXI°K°V@XXVlVVU„nšKVlUš„bWXnV@bV`U„„@@m@@‚ƒ@nxmn@bXVlL@¤nb„Ul¦šVVUnJVU„Vl@@bÞL"],"encodeOffsets":[[118418,34392]]}},{"type":"Feature","id":"3413","properties":{"name":"宿州市","cp":[117.5208,33.6841],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@@UWU@bkW@aWU@aUIkWV™lLXb„lVIUVV@‚mn@V_n@VaUK@I‚@UašanJVU„@lV„UVnnKVVlaUa„I@wnK‚Lnll@nVlk@wVKXkl@@b„bUJ@V‚U@U„UUyVk@aVUXwlWXX‚WU¹@aU™@WUI@mlUšn„J@Il@šaXbV@VKl@XxVL@W„IšJlb„@„al@„IUUm@@aVK@¥¯—@mUķ¯bWƒk£Vm@akm@VaÅ@UVWaƒ@UJWkƒJ—UƒbWbU@UlƒXk@ƒamV@K¯nk@ƒlU@Uxmz@bU`ÇbUbÅVm£U@Ww™x@akLUK@UlakwUJWVkLmaUal@n_ƒmVUnKVUUmÅXWa™@kJmx@XUJ@bVLXxl@VVUVV„UbkLWbU@@lUVV„VVX„›K@XkJ@nU@@bV@VxUVlb„U@xXLWŽn@UxVbVĊ„V@b@XV`mnkJ@kUKmbƒaU@VbnbÆx@XU@@`k@@bl„™@@bkL@WƒakXWaU@Vmkx@XWW@@wUUUbƒJ™U¯V™@¯ÞU@WxXŽlL@bkb@ŽlVlnb™JW@kkU@mbkaWJ—IVlmz¯`UnU@mb™@@„ƒ`@bkVlœnV@b@šV@„aVxn@Vx‚KXnl@nbVK„bVK@a„_V@Vƒ„w@W„LlwnK@UmIU@VWš@šUÈ@lKnal„wš@@V°@šaUmlUUw@„ƒV@@UXK"],"encodeOffsets":[[119836,35061]]}},{"type":"Feature","id":"3410","properties":{"name":"黄山市","cp":[118.0481,29.9542],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@lXnlWX@VUJVnUJVzXJVx„kVJlI²l‚U@K@IUǚLVxnLn@lmUaVU@UVKVknJ@an@@UVIVǙKUw@_lK@wnKVklW@I@mXa@UlaXblU„JVUVL@UXWlIUUlKVmkU@kVKVL@y„wXLVb„JVz@Jlnš@nŽ‚LXbVaôšnW@la@UVWUa@@a@mk@WIk@VwUa¯¥m@UUVK@ImK@aX£ƒkK›ÅV™a™™ƒ_@±ƒakXWW—LƒƒƒnU@@a@¯mK@L™JUWwUV™VmbXX@lWLn`mzUJUb™Lƒ„k@makVWmkX™ambkKknƒaƒ@ƒaƒb@‚U@Unm@—ƒWVƒ@VbUbUJWIk@@lmL@°UVUVm„nš™@@kmWkb@xƒ_m@@aU@b@JlŽUz™lWxXn„@‚b²@l`„IVl„UlL@VšK„nVbUl@VlIn@@b„bVWUk‚@@bX@Valb@bnb°Vn@„xVKlbVnV@V‚x„L@ln@UXVV‚L˜"],"encodeOffsets":[[120747,31095]]}},{"type":"Feature","id":"3414","properties":{"name":"巢湖市","cp":[117.7734,31.4978],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@VV@blL@ŽXlWnnšnŽ˜„@VXXl@@WšIX@VJ@LšxŎxlnšŽ@bXJVblX@VVbUVn@VbUVlb@LnJVbVLV‚XLšÒVL„ÒšV„bVIVylUXk°Wšknm°_lJ@aXL@l‚z°@„lnLô¼V‚È„VUUaVKU@WW@@UUa@knmVLlaV@„a@kšak±@UmwkKmk™lj™ÝUUkL@mlIVmnÝWkkUÝ@KƑĉ™a@»ƒmma@mX™¤¯Uƒw@ƒ@UU@bU±±L@akmƒ„™LUKmLUUUJVbbÇwƒ@kUWaUJ@Xkxm@UJUUm@™„k„ƒ‚ƒakXUšVl±ôU@kn"],"encodeOffsets":[[119847,32007]]}},{"type":"Feature","id":"3416","properties":{"name":"亳州市","cp":[116.1914,33.4698],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@lU@Un@@anUlw@KVmUwlaX_lKna@KU@@kWKUU@ankW™XK˜@@V²VVIÈU@al@VaÈamK@wU™@klaUƒV@XƒVUU»WUUbkmUkVmk@aÈw@mWU@VkIkVWKUÑķXȭºU¯lƒ@kkLWmÅa™L@l™LWlzVxƒVUK@L¯LUJ@bWƒK@b@JLU@Wbk@WVUU™V@nƒJ@XX@@`m@@L@bnJ@nWV@¦œa‚wVVkxVn@bVJ@V¦@Ž™²¯bƒl™b™@m„UšUŽƒŽ@¼ƒ¦Xb‚UV`@nnxUxWLkUkVWKkV@XV@@VVL@VX„@lVV@L@blL@`šL@xXKVL‚@„VnUš@lwnU@ml@XnV@@UVW°LnalƒUI@aUK@a‚a@U„kXW@I@mWL@UXK@UVW@U‚@@k„Wn‚@@V„@XblaVxšL@bVKXb„IlJ"],"encodeOffsets":[[119183,34594]]}},{"type":"Feature","id":"3417","properties":{"name":"池州市","cp":[117.3889,30.2014],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@„V°°ĊŤ@xƒĖ@xœXƤ„VôIÆmnLllXÔ@lƒÜŽn@@JšbšLÆaĢÞĸ„°VVUUKVanK@UV@VL„VVn„ln@‚xnklxXamk@WV@Xa˜@naVk„Klk™@mkUWwkJWw—IWK@ƒUaUwWIUyVIUmVI@UXWmkkW‚—KUUVWm@@kƒKw@U‚UUmkaULƒwm@¯Uma@akaUbW@@a@VlUXƒa@am@kJ@UVkUaƒm™L@UkKƒVUkƒJk_±@aƒ@WmXwÇkkaVaUa±ƒœwV@VkƒwnyUaW@UU¯amLk@m™@kmmU™™¯K@L@lUX¯ƒWlkXƒŽVb„bƒVUL@J@LVKnlJXnlb@`nXlalV@bnL@Vnb˜¼@lXbWlkL™K@zUJmIUxUVUVmX","@@llUL@VlxšL@a@UƒwXa¯@"],"encodeOffsets":[[119543,30781],[120061,31152]]}},{"type":"Feature","id":"3401","properties":{"name":"合肥市","cp":[117.29,32.0581],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@„L„xV‚ĊLÞkšVlVVXaWaXwW™nU„@‚anVVUX@˜bXblWkk@wWmk@VUVKnb@Išy@_kWm£nmVa@U‚KœwlVl@„zn@°l„IlmnVšIVmnV˜aXÅWmU_VK@Unƒmmk@UIVakaƒa™UƒÑUK™ÑWKUUKUamI@KkaVUUam@VUUa@UkWUaWI@a™kmōw™wUL@`mn@KƒV™IUVUUUK›Vk_ƒVkbWƒ@VkUULUJ±I¯aƒlkxU¦@L@V@V@b@b@„WJXbWVXn@LƒKVL@JkLƒŽV@Vbn@VV@XU@UlV@@VV@V@XXV@@VšJ°š°Xnb°@„JUVVXV`@bkXWŽUbU@WŽn@VLXlm„°bV„UbkK@bVJ@bVbkLV¦ƒKķV@x@„XbmVVVk¦"],"encodeOffsets":[[119678,33323]]}},{"type":"Feature","id":"3403","properties":{"name":"蚌埠市","cp":[117.4109,33.1073],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@VÒXLlUlJ@UXV@nÇx@bnlUVllnVaXVV¼UVW„U@V„²wVV@Vl@„VnwlIš@XbÆWVnUVmLUV„nm`k@VbnblKXUVIlxkb@VVLlK@bšwXxV@n¤ÆUVaÈaV_@anyVwV@„kl@°m@LnU„bl@„WVkV@Xa„a˜V„IXl‚IV‚„@XbVUÆ@XKWwUkmW@_UmnIlJXkWKXmV@‚w@_XV@Kl@kU@KlX@@UUUUKWLm@klJVUUmk@mXUWmXwƒ`m@„zUbÝakbW@m@UUƒéUIm@UbKǼ@™kKWXmWUkaWU—JWU¯L@W™Lƒwk@mm@_™ƒÅl™UVkmWUnV@VWLUb™bƑĬ¯l"],"encodeOffsets":[[119543,33722]]}},{"type":"Feature","id":"3402","properties":{"name":"芜湖市","cp":[118.3557,31.0858],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@„bVaV@XllLXU°ŽlL@V@VUnVl¯Ikš›VUVU@@b@lUXUWmb„n@¼šbƒĊ‚LÞ@lVXlmÞUnkJ@nlKVVšÞXklWVaVI@aUKn»lL@Kn@‚XXwlm@mn°@„V@Wy„wXlWVk™ƒ@aUaVU¯£kKWVXVWLUkkWlkkwmJUam@@aULVa@UƒVaUaVI@m‚@UUJUIUmmV@bm@UXVVUlVmImakKUU@UU@VmU@@kma@KVIXUVK@U™VmUkV™m±£@JkU@nlšk‚ƒLUlmb—@WbU@@XnlWb"],"encodeOffsets":[[120814,31585]]}},{"type":"Feature","id":"3406","properties":{"name":"淮北市","cp":[116.6968,33.6896],"childNum":3},"geometry":{"type":"MultiPolygon","coordinates":[["@@lnnK@¦n@@V‚V„@@VV@nIV„V@VW²a@b@bVnUVVV@V™z@lš@°UšV„IVaVV@x@ŽXX@WlwUnV@XblW„b@XlK@aš@kƒ@al@@_V@@WÅwmaUaV@„bnaVL@llInmU_@W@aƒUUĉUaVwm@XWK@wƒVkaVUUwU@@aV@@mlI@WœLWƒUUUƒVU@kV@XalKVaUƒVUUUk@WwUK@aVI@WƒUk@@UUU±xkb@lVš@xnLÇbUbk@@bÇVUJ±U@U—@WLXšml@bVVXL@lV@@LmbkLW`kbVxUn@LkxmV@bm@@VkV"],["@@VVVkV@¥@UV@U@VUUJƒkWakKUšlXVJ@bXV@blX@aXV@V"]],"encodeOffsets":[[[119183,34594]],[[119836,35061]]]}},{"type":"Feature","id":"3404","properties":{"name":"淮南市","cp":[116.7847,32.7722],"childNum":2},"geometry":{"type":"Polygon","coordinates":["@@°kƒīšaVaXK@U‚UVmnXUlšVÆkVKUUUmmU„ÑkU™UÝlĉKUƒwƒKƒbU@UxW@@lœmVUUVmUUƒmƒw—aW„kL¯K@Žm„ULWlIm`X„WL@b@¼@V@xkVƒI@b@l@lk„V°Ȯ¹ĸW"],"encodeOffsets":[[119543,33722]]}},{"type":"Feature","id":"3405","properties":{"name":"马鞍山市","cp":[118.6304,31.5363],"childNum":2},"geometry":{"type":"Polygon","coordinates":["@@šNJnllLnxV@laXLVKma„aXbVI„bVKVVVIVyn@n_ƒƒW@@ƒ„UnJlUVVXlLnaUWlV@VV„IXW@_W@XK@K@UVUUwVamÑXmmwƒw™KUnUK™çU@ƒJƒU¯@mŽ@nknWxWm@@LkKm¼VL@bUJUbkXWl"],"encodeOffsets":[[121219,32288]]}},{"type":"Feature","id":"3407","properties":{"name":"铜陵市","cp":[117.9382,30.9375],"childNum":3},"geometry":{"type":"MultiPolygon","coordinates":[["@@„ÒV¤@¼V²@aVV@Ž@„„x°Vš£nW‚@nbnaVXVW@k@aV@VUœUl™°JUkVm@U@UkK¯WVkKWkU@Ubƒakwmlwm@ƒkUmƒUUKU@@VmLUbVLUV¯U"],["@@LllUL@VlxšL@a@UƒwXamK"]],"encodeOffsets":[[[120522,31529]],[[120094,31146]]]}}],"UTF8Encoding":true}; +define('echarts/util/mapData/geoJson/an_hui_geo',[],function() { + return {"type":"FeatureCollection","features":[{"type":"Feature","id":"3415","properties":{"name":"六安市","cp":[116.3123,31.8329],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@„„nJ‚UXUVƒ°U„ÑnU@mlLVaVln@@bn@VU@xlb@lšLnKlšƒVI„JšUVxnI@lVL@b„Ž°VX@˜b„x„nVVUnVVnU‚›@kX@VwV@„al¥UUnUWa@ƒ@wĸU„LU¥lKUa@aUI@alLVaUƒ¯anƒWkUKm@XV@VaXlW@aU_UWVUƒI¯@ma¯W¯™™I@UU@WWU@U@@UU@VkV@@WUUm@UaU@„lK@IUK„L@KWmXUWaXI@ƒ@a@a@U@U@KV¥lw„k°b²JVIVKlV@UX„la„Ul`œUVLVVVUšJ„U@Lnm@_VK@KUIW@™J@Xk@WW@U—ƒmm™XmWk@kK@aUUƒVmmkUwUmWL™@WmU@™UJmUULkKWakLWVkIƒlƒwULƒW@X°lUJ@°ULƒWV—wmJ@bmb¯Vkm@@WkWm¯wƒL@lkXƒWmXym¯UImJUbkV™@Vn¯„@V@lUbƒ@mk@maUxmlUbULWn@J—LmKUkWKkwUKƒbm„X„WxkVUKmLkVV@JUUWL@xkJUUƒV@X@VVlUbVX@xk¤šx‚¼œxWxn„‚nn@Þ¼„JVb°aVn„@šmlnXU„JlbVlkz@‚lUŽlXJmxVxXnWxXÈWlUŽ@šUxU@VX@xUL@šUÆmLnV@lWXk@@JlbXblnlJ"],"encodeOffsets":[[118710,33351]]}},{"type":"Feature","id":"3408","properties":{"name":"安庆市","cp":[116.7517,30.5255],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@n°‚znW„XlW@k„K°xXn‚l@Xn@l‚°Una@anI˜xXU„ŽVK@¯VIkW¯X@‚„VK„x„klJXUlKXblLVKnVVIšŽV@Xn‚@šŽXKVnVxlŽnn„UlmV@²óUkV™lW„b„lƒšƒn@VVVIn@lw@WVIXblV„@Èx‚aUaVIVVnKVLšK„ƒln@b²K@»U£ƒÑķƒġÝÅb™K™a@Im@ۍ„@kWÓkkmKÅnóJƒUÅ£›W@w„ĕ@wĉţ¯¯ƒUkK±l¯Uƒ¥UÑkÝUķ»Ý¥¯™JƒIUŽVbUl¯ÈV¼VJU¼Vb@bkLUl@„VJ@bUXǚ@lkVmXmKkLVxš‚Ž„VƒL@VkVVVlzW˜kbmLUUUbVbUV™šlÒnJlUnLllUL@bU„Vx„l‚LXVƦÈVU¦WJ"],"encodeOffsets":[[118834,31759]]}},{"type":"Feature","id":"3411","properties":{"name":"滁州市","cp":[118.1909,32.536],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@š„@`nnl@„xšK@X°KXV˜IXVlbXVWnX‚lL@šÈ»‚LVan@VJ„êVVn@‚X@laÞbVaƒyn@„_‚xnWVXnWl@VnUVkI@l‚nXKVLVV@V@kW@LlVô„@J@bVnnKnkVa@»lç@ƒnwšKma™UUUVњ@n™mWXalI@alVn@VwUaVU„@„nlaôJnU„VVXlJšaXXVK@UšV@VWx@nXVWšXVšUlLUbV‚ULVVnUVbUbVbš@@a„KÆnnKVK@U@UU@@a„@Vƒ°¯ÈJVIlķ@aa˜UaVKU_@mkxUI@aƒUlyU@@™wkKWmUbUnUVWbkJW_J@bƒn@Vm@@KULk@V@@bVbÅm@LW@UVVbkK@UkKWL@VULUKWIUJUbkK@_WVXU›Jka@XƒVa@kšy@aVIUUW@@m„UlLœKWÑUKVan@UkVmmIXKƒaVaUwVU@UmykU¯@±UUL@WUIVUU@KkIWaƒaU@kUUaǃUó»mKƒk¯@y@kWK@bkI¯`mn™l¯XWlkVUzUJlbUbVJl@nnm„@VULV`XnWƗbmUUn™JmUknƒJ¯km@ƒyk@kU›xL@VUbmnn¤lX@`™z@JmaULUVl@Xn@xllkXWa—aW@UVmUbƒ@mVXšWxXbWbUŽƒÒnVVnVVUL"],"encodeOffsets":[[120004,33520]]}},{"type":"Feature","id":"3418","properties":{"name":"宣城市","cp":[118.8062,30.6244],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@Vb@„XL˜JXxlIXxlVlV@I²¤šnlUnVšU@VULWVUJ@Lnb@lV@UnV@@VVVlLnbnJ‚UVkUUVWn@@anUVnVJVIV‚@@nUJVbUb‚„@VUbVK@bn@VbnIlxkllXVlXKWUXUlL°¤UVVb@bš„UlkXW‚ƒxXz@‚„Ila„UlƒnUlJVInVÆJ„U„LVUnV„K°@VnlVnxV@XLlK@wVL@KnUlJXU˜bnKVLX„lUw@VWlLXKm@@a„@VLnmlIVVnKn@škVašVlwk@@a@k@ƒVIUa™@maUa@wna@kmWƒ™UUmVUIVǗ@aƒKm™aƒ™kU™J@InmUUaVa„k‚lX@Vk@m@VU@wnK@alKVUkUkKƒbmUkmƒ@U£WVk@@UÝbbƒaÇx@b@WVUa¯ƒ@wVwUUV@VwnK@KWaŁ@KšIUyUI@WmXó™UbWaKm™@km@IUyƒIUaWKƒx@zUKUL@llVUnkLVVkJWX@VUKUVƒIkVWakb@VWb@n@JkXUlmL@xkL@`VxšLUÈUJ@Vm@@bmIUlUL@VUVVbknm@mKUw™KVÈ@J@LV±kkJUIƒl"],"encodeOffsets":[[120803,31247]]}},{"type":"Feature","id":"3412","properties":{"name":"阜阳市","cp":[115.7629,32.9919],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@V™nƒš@ša„k°aš±@‚¥@UUI@aUmlwUUx›b@¥XU@mmI@a@Kn@@_W@@W„I@mšUVVXUl@XaV@‚K@I@a„LX@aVI°K@KVL„UUw‚yXkšK@kšKÆbXnlK@k@a„JlU@w@U@»@aXKWƒn_‚JXkVKnƒ@°LlKXƒW@¯Uƒ@aUK@kmJUw™VƒIUJ™„kŽmL™K@kka@wUVm@@am@UkUbkK@nmVƒÒ¯VU„WVVmIƒƒULk@ƒƒma@kkKƒƒ@nUbUamU™`UUVUkKVkkƒW@@bkmƒnƒmUXVKXVƒL@VƒbU„m‚™bVXJ@nmKÅI@KWKUXVJUL@VUKUX@KUKWL@LUJmaXXm@kVVV@L@VUL@VlK@L@V@LUK@VUb@UUU@°@nVxU`‚Lkn@`@XVJ@X™Vm„k@UKmV¯LVVn±Wm@Ub@JlLUl„@VLk„@lmVVn@bnV@V°IV™šaVJXI°K°V@XXVlVVU„nšKVlUš„bWXnV@bV`U„„@@m@@‚ƒ@nxmn@bXVlL@¤nb„Ul¦šVVUnJVU„Vl@@bÞL"],"encodeOffsets":[[118418,34392]]}},{"type":"Feature","id":"3413","properties":{"name":"宿州市","cp":[117.5208,33.6841],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@@UWU@bkW@aWU@aUIkWV™lLXb„lVIUVV@‚mn@V_n@VaUK@I‚@UašanJVU„@lV„UVnnKVVlaUa„I@wnK‚Lnll@nVlk@wVKXkl@@b„bUJ@V‚U@U„UUyVk@aVUXwlWXX‚WU¹@aU™@WUI@mlUšn„J@Il@šaXbV@VKl@XxVL@W„IšJlb„@„al@„IUUm@@aVK@¥¯—@mUķ¯bWƒk£Vm@akm@VaÅ@UVWaƒ@UJWkƒJ—UƒbWbU@UlƒXk@ƒamV@K¯nk@ƒlU@Uxmz@bU`ÇbUbÅVm£U@Ww™x@akLUK@UlakwUJWVkLmaUal@n_ƒmVUnKVUUmÅXWa™@kJmx@XUJ@bVLXxl@VVUVV„UbkLWbU@@lUVV„VVX„›K@XkJ@nU@@bV@VxUVlb„U@xXLWŽn@UxVbVĊ„V@b@XV`mnkJ@kUKmbƒaU@VbnbÆx@XU@@`k@@bl„™@@bkL@WƒakXWaU@Vmkx@XWW@@wUUUbƒJ™U¯V™@¯ÞU@WxXŽlL@bkb@ŽlVlnb™JW@kkU@mbkaWJ—IVlmz¯`UnU@mb™@@„ƒ`@bkVlœnV@b@šV@„aVxn@Vx‚KXnl@nbVK„bVK@a„_V@Vƒ„w@W„LlwnK@UmIU@VWš@šUÈ@lKnal„wš@@V°@šaUmlUUw@„ƒV@@UXK"],"encodeOffsets":[[119836,35061]]}},{"type":"Feature","id":"3410","properties":{"name":"黄山市","cp":[118.0481,29.9542],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@lXnlWX@VUJVnUJVzXJVx„kVJlI²l‚U@K@IUǚLVxnLn@lmUaVU@UVKVknJ@an@@UVIVǙKUw@_lK@wnKVklW@I@mXa@UlaXblU„JVUVL@UXWlIUUlKVmkU@kVKVL@y„wXLVb„JVz@Jlnš@nŽ‚LXbVaôšnW@la@UVWUa@@a@mk@WIk@VwUa¯¥m@UUVK@ImK@aX£ƒkK›ÅV™a™™ƒ_@±ƒakXWW—LƒƒƒnU@@a@¯mK@L™JUWwUV™VmbXX@lWLn`mzUJUb™Lƒ„k@makVWmkX™ambkKknƒaƒ@ƒaƒb@‚U@Unm@—ƒWVƒ@VbUbUJWIk@@lmL@°UVUVm„nš™@@kmWkb@xƒ_m@@aU@b@JlŽUz™lWxXn„@‚b²@l`„IVl„UlL@VšK„nVbUl@VlIn@@b„bVWUk‚@@bX@Valb@bnb°Vn@„xVKlbVnV@V‚x„L@ln@UXVV‚L˜"],"encodeOffsets":[[120747,31095]]}},{"type":"Feature","id":"3414","properties":{"name":"巢湖市","cp":[117.7734,31.4978],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@VV@blL@ŽXlWnnšnŽ˜„@VXXl@@WšIX@VJ@LšxŎxlnšŽ@bXJVblX@VVbUVn@VbUVlb@LnJVbVLV‚XLšÒVL„ÒšV„bVIVylUXk°Wšknm°_lJ@aXL@l‚z°@„lnLô¼V‚È„VUUaVKU@WW@@UUa@knmVLlaV@„a@kšak±@UmwkKmk™lj™ÝUUkL@mlIVmnÝWkkUÝ@KƑĉ™a@»ƒmma@mX™¤¯Uƒw@ƒ@UU@bU±±L@akmƒ„™LUKmLUUUJVbbÇwƒ@kUWaUJ@Xkxm@UJUUm@™„k„ƒ‚ƒakXUšVl±ôU@kn"],"encodeOffsets":[[119847,32007]]}},{"type":"Feature","id":"3416","properties":{"name":"亳州市","cp":[116.1914,33.4698],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@lU@Un@@anUlw@KVmUwlaX_lKna@KU@@kWKUU@ankW™XK˜@@V²VVIÈU@al@VaÈamK@wU™@klaUƒV@XƒVUU»WUUbkmUkVmk@aÈw@mWU@VkIkVWKUÑķXȭºU¯lƒ@kkLWmÅa™L@l™LWlzVxƒVUK@L¯LUJ@bWƒK@b@JLU@Wbk@WVUU™V@nƒJ@XX@@`m@@L@bnJ@nWV@¦œa‚wVVkxVn@bVJ@V¦@Ž™²¯bƒl™b™@m„UšUŽƒŽ@¼ƒ¦Xb‚UV`@nnxUxWLkUkVWKkV@XV@@VVL@VX„@lVV@L@blL@`šL@xXKVL‚@„VnUš@lwnU@ml@XnV@@UVW°LnalƒUI@aUK@a‚a@U„kXW@I@mWL@UXK@UVW@U‚@@k„Wn‚@@V„@XblaVxšL@bVKXb„IlJ"],"encodeOffsets":[[119183,34594]]}},{"type":"Feature","id":"3417","properties":{"name":"池州市","cp":[117.3889,30.2014],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@„V°°ĊŤ@xƒĖ@xœXƤ„VôIÆmnLllXÔ@lƒÜŽn@@JšbšLÆaĢÞĸ„°VVUUKVanK@UV@VL„VVn„ln@‚xnklxXamk@WV@Xa˜@naVk„Klk™@mkUWwkJWw—IWK@ƒUaUwWIUyVIUmVI@UXWmkkW‚—KUUVWm@@kƒKw@U‚UUmkaULƒwm@¯Uma@akaUbW@@a@VlUXƒa@am@kJ@UVkUaƒm™L@UkKƒVUkƒJk_±@aƒ@WmXwÇkkaVaUa±ƒœwV@VkƒwnyUaW@UU¯amLk@m™@kmmU™™¯K@L@lUX¯ƒWlkXƒŽVb„bƒVUL@J@LVKnlJXnlb@`nXlalV@bnL@Vnb˜¼@lXbWlkL™K@zUJmIUxUVUVmX","@@llUL@VlxšL@a@UƒwXa¯@"],"encodeOffsets":[[119543,30781],[120061,31152]]}},{"type":"Feature","id":"3401","properties":{"name":"合肥市","cp":[117.29,32.0581],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@„L„xV‚ĊLÞkšVlVVXaWaXwW™nU„@‚anVVUX@˜bXblWkk@wWmk@VUVKnb@Išy@_kWm£nmVa@U‚KœwlVl@„zn@°l„IlmnVšIVmnV˜aXÅWmU_VK@Unƒmmk@UIVakaƒa™UƒÑUK™ÑWKUUKUamI@KkaVUUam@VUUa@UkWUaWI@a™kmōw™wUL@`mn@KƒV™IUVUUUK›Vk_ƒVkbWƒ@VkUULUJ±I¯aƒlkxU¦@L@V@V@b@b@„WJXbWVXn@LƒKVL@JkLƒŽV@Vbn@VV@XU@UlV@@VV@V@XXV@@VšJ°š°Xnb°@„JUVVXV`@bkXWŽUbU@WŽn@VLXlm„°bV„UbkK@bVJ@bVbkLV¦ƒKķV@x@„XbmVVVk¦"],"encodeOffsets":[[119678,33323]]}},{"type":"Feature","id":"3403","properties":{"name":"蚌埠市","cp":[117.4109,33.1073],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@VÒXLlUlJ@UXV@nÇx@bnlUVllnVaXVV¼UVW„U@V„²wVV@Vl@„VnwlIš@XbÆWVnUVmLUV„nm`k@VbnblKXUVIlxkb@VVLlK@bšwXxV@n¤ÆUVaÈaV_@anyVwV@„kl@°m@LnU„bl@„WVkV@Xa„a˜V„IXl‚IV‚„@XbVUÆ@XKWwUkmW@_UmnIlJXkWKXmV@‚w@_XV@Kl@kU@KlX@@UUUUKWLm@klJVUUmk@mXUWmXwƒ`m@„zUbÝakbW@m@UUƒéUIm@UbKǼ@™kKWXmWUkaWU—JWU¯L@W™Lƒwk@mm@_™ƒÅl™UVkmWUnV@VWLUb™bƑĬ¯l"],"encodeOffsets":[[119543,33722]]}},{"type":"Feature","id":"3402","properties":{"name":"芜湖市","cp":[118.3557,31.0858],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@„bVaV@XllLXU°ŽlL@V@VUnVl¯Ikš›VUVU@@b@lUXUWmb„n@¼šbƒĊ‚LÞ@lVXlmÞUnkJ@nlKVVšÞXklWVaVI@aUKn»lL@Kn@‚XXwlm@mn°@„V@Wy„wXlWVk™ƒ@aUaVU¯£kKWVXVWLUkkWlkkwmJUam@@aULVa@UƒVaUaVI@m‚@UUJUIUmmV@bm@UXVVUlVmImakKUU@UU@VmU@@kma@KVIXUVK@U™VmUkV™m±£@JkU@nlšk‚ƒLUlmb—@WbU@@XnlWb"],"encodeOffsets":[[120814,31585]]}},{"type":"Feature","id":"3406","properties":{"name":"淮北市","cp":[116.6968,33.6896],"childNum":3},"geometry":{"type":"MultiPolygon","coordinates":[["@@lnnK@¦n@@V‚V„@@VV@nIV„V@VW²a@b@bVnUVVV@V™z@lš@°UšV„IVaVV@x@ŽXX@WlwUnV@XblW„b@XlK@aš@kƒ@al@@_V@@WÅwmaUaV@„bnaVL@llInmU_@W@aƒUUĉUaVwm@XWK@wƒVkaVUUwU@@aV@@mlI@WœLWƒUUUƒVU@kV@XalKVaUƒVUUUk@WwUK@aVI@WƒUk@@UUU±xkb@lVš@xnLÇbUbk@@bÇVUJ±U@U—@WLXšml@bVVXL@lV@@LmbkLW`kbVxUn@LkxmV@bm@@VkV"],["@@VVVkV@¥@UV@U@VUUJƒkWakKUšlXVJ@bXV@blX@aXV@V"]],"encodeOffsets":[[[119183,34594]],[[119836,35061]]]}},{"type":"Feature","id":"3404","properties":{"name":"淮南市","cp":[116.7847,32.7722],"childNum":2},"geometry":{"type":"Polygon","coordinates":["@@°kƒīšaVaXK@U‚UVmnXUlšVÆkVKUUUmmU„ÑkU™UÝlĉKUƒwƒKƒbU@UxW@@lœmVUUVmUUƒmƒw—aW„kL¯K@Žm„ULWlIm`X„WL@b@¼@V@xkVƒI@b@l@lk„V°Ȯ¹ĸW"],"encodeOffsets":[[119543,33722]]}},{"type":"Feature","id":"3405","properties":{"name":"马鞍山市","cp":[118.6304,31.5363],"childNum":2},"geometry":{"type":"Polygon","coordinates":["@@šNJnllLnxV@laXLVKma„aXbVI„bVKVVVIVyn@n_ƒƒW@@ƒ„UnJlUVVXlLnaUWlV@VV„IXW@_W@XK@K@UVUUwVamÑXmmwƒw™KUnUK™çU@ƒJƒU¯@mŽ@nknWxWm@@LkKm¼VL@bUJUbkXWl"],"encodeOffsets":[[121219,32288]]}},{"type":"Feature","id":"3407","properties":{"name":"铜陵市","cp":[117.9382,30.9375],"childNum":3},"geometry":{"type":"MultiPolygon","coordinates":[["@@„ÒV¤@¼V²@aVV@Ž@„„x°Vš£nW‚@nbnaVXVW@k@aV@VUœUl™°JUkVm@U@UkK¯WVkKWkU@Ubƒakwmlwm@ƒkUmƒUUKU@@VmLUbVLUV¯U"],["@@LllUL@VlxšL@a@UƒwXamK"]],"encodeOffsets":[[[120522,31529]],[[120094,31146]]]}}],"UTF8Encoding":true}; }); -define('echarts/util/mapData/geoJson/ao_men_geo',[],function() { - return {"type":"FeatureCollection","features":[{"type":"Feature","id":"8200","properties":{"name":"澳门","cp":[113.5715,22.1583],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@HQFMDIDGBI@E@EEKEGCEIGGEKEMGSEU@CBEDAJAP@F@LBT@JCHMPOdADCFADAB@LFLDFFP@DAB@@AF@D@B@@FBD@FADHBBHAD@FAJ@JEDCJI`gFIJW"],"encodeOffsets":[[116325,22699]]}}],"UTF8Encoding":true}; +define('echarts/util/mapData/geoJson/ao_men_geo',[],function() { + return {"type":"FeatureCollection","features":[{"type":"Feature","id":"8200","properties":{"name":"澳门","cp":[113.5715,22.1583],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@HQFMDIDGBI@E@EEKEGCEIGGEKEMGSEU@CBEDAJAP@F@LBT@JCHMPOdADCFADAB@LFLDFFP@DAB@@AF@D@B@@FBD@FADHBBHAD@FAJ@JEDCJI`gFIJW"],"encodeOffsets":[[116325,22699]]}}],"UTF8Encoding":true}; }); -define('echarts/util/mapData/geoJson/bei_jing_geo',[],function() { - return {"type":"FeatureCollection","features":[{"type":"Feature","id":"110228","properties":{"name":"密云县","cp":[117.0923,40.5121],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@vIHZDZQtDLNMXIbHRCXXITbJ@H`LGPRDDJNCLHTOCWFGvGBUJMKGFO^IHWXITQCI’Y^AXGfRˆDXF`DJOLB~G\\DZIHHpErUVMhHb]\\M†BVF@FTP`@zTbD\\@~M\\K`H^EVODWICAakAQXoIcCOCIgGYNWFWNGGKKGaJEGMEIKYJUT_J_Go@_SyQaSFMEGTcYOQLIIi@EKAUPCV[EEXQCW|aMUMAaYCYNIDGGACIMGGSKDQGaF_C[GaB@GOIiOKAYL“mI@CN]F[SWWAcKKI@HMUimEKbeYQYISNUOcBKPIFBNgvDPGZYFSf]CMSIWGEUFgDIQ[MeDMJS@RR@LphFPCHaBAJKF@J]IBJO@HlO@@RKAMPJHCNDJTHFP@ZGNANBRFH@J_fM^ONJNF\\VTDJHDON@XRND\\XRCPVETCLBVKDFJINHRGPRV@\\CLJN@VbXbLVT"],"encodeOffsets":[[119561,41684]]}},{"type":"Feature","id":"110116","properties":{"name":"怀柔区","cp":[116.6377,40.6219],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@JHTVHXCHPfnDJGHNDJSB[JSBGVSAOH@PMPuDEHHXZN@PHF@ZLJ@LHVYJA\\OFWP]BMtMBSRGV[JeVAPQVIFENMD¡–@^NV\\JH@NNL@NM\\kTQ\\I^FNIpBHGTBFFAZQfKDIXQTLXFXNNVMVHRGpCFLlRLEVBBH`IVO\\G`RDPAXLXBXORHZEHTDLLN@VGTMrQNFPeASKG@GMOAKBYMK@GTUHUXSHMVDNMOUEOZMJML@^KRACMZEZMRQLUHE@OFENPR@DI\\ChMHIDG\\GJMDWHCKGMDCIQCHO_K@GaIJSWWQDaGWJMNCKRsCYGYuJUSaKaW@UIMDK@[QUHOGQJMEILCAUDKFSOUQD[WMC‚Q@WPMGCCIUSE[IMPMN]`e@IEGAQBMHM@YEOSGCIDMIGNOLB@QP@GkP@AI^J@ILEBIbADGEOog@KQQWSekWQQUOFKZLF@PUNmIaHIUeBCTSHENcJa@_IWSaGu`GLSBKJQFOXGDXVQVOBIHcDSJWBEFGTMH[^mLaXcHiKElTRKtFXZ`MHMPCNRDxZˆB\\ICIHK@KŽHbIVFZ@BPnGTGbDXRDJaZKRiGEFSFEJhjFNZFjn"],"encodeOffsets":[[119314,41552]]}},{"type":"Feature","id":"110111","properties":{"name":"房山区","cp":[115.8453,39.7163],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@h@bl@HRJDZ``TA\\VVD^H`\\pF\\JŒ`JGv@ZO\\GPSTEjPTR`FnEbDTDHEhLFMTK@ETSPULKEI@OVISKSJACEQNQbV˜IXGDIN@dMB[IIBcN]ZHNLP@XOWCFWŠCNRHTpATD@^NVNLED@Rh@jCEF}E[OOHUEW]W@QGGDIQSH_MmFmCUT_K]i@MHCMW—FCF‹E{BMHMPOHKS]CFNGBELDH_@BcAKOACESAOBELaXAROB@FODMEDWJAG[aE@UM@DImEWJMC@OeCA{aE[@{L@MINUCQXKfUJORCHqJBF@TCXWNQX]M[EAJO@@KMBQJIC]EWMCCUBEBFHKDOTMBGNGF]MWDBRDdMDQVyE@LPVHDCP@JVVMTG~HNSH[CmRUvHPHBbA\\PTNRC\\YNJ€PRARPJDDR"],"encodeOffsets":[[118343,40770]]}},{"type":"Feature","id":"110229","properties":{"name":"延庆县","cp":[116.1543,40.5286],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@^AXOPEB[ZIGU@KKI@YGE@OYMGWFGvCNO@OPGTBHUTA\\ITACIGMIHmCOeDGGWSUIGimYEEMgiFITEFEjHLQbYCIWQaCSHmHAOY@UEaJG@LGLDJ[J‡AwYQCDMNONGY_EWLsSQFkMO[NWAIGaIYL@HMBOKiOQDWEUDMQSF_QIUBWdg@[NaAKQ@M]OQ@WhgLUMMFYQDIRCEUZOOCIOJ[KIUMKL@HIDKVEBM`HJAJSJUdBLGNEdMBMO[BYEWJSNKNaD]PE\\SjOT_RQVEZPpƒNQXfŠNA~lNG`@PNLp¼RFLfbdKbATUh@FSNWjGFZVLFHVA~X¨PPROfFJbNJPLFbENJPrEFNPFRHDDJdENJLVEPBJTVTHGHFRFH@PXP\\ORQHW\\BjWFDERLPPBbB\\E`B\\D\\L`@F]FCnJ^AZL"],"encodeOffsets":[[119262,41751]]}},{"type":"Feature","id":"110109","properties":{"name":"门头沟区","cp":[115.8,39.9957],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@V@XMnGPY²‰JQNEhH\\AZMPDVTTDZCPiJkHSHCjIdFtEHITCNITQEKUAMCEIKCECABYESKFWAKBEIIHABGDCKCAIHMHALKEI\\CFIBILIJQZS]BBEECS@E@@C]COKI@CABAAEEDMGƒCH]A[M@CJWH—JaUMRFRBDTITLUJ@PFJKLOVST@FSLENgKGFSCaCmF_ESQiOSFOT[HYPu@IH‹_[IoE_[]GUC[USB__CYQI@Gakg@qZeHQNMNV\\FVLPgJAFJPRLCH[XcPELUT[JiV_EELFTADBXRTRLJC@fHXHHbPd`fR@NfT`@TLplHMpCEJHJBVLFŽ@JT‚VnG^KXDXHNVGRLRXFJVdDHSNWLGfEzA"],"encodeOffsets":[[118635,41113]]}},{"type":"Feature","id":"110114","properties":{"name":"昌平区","cp":[116.1777,40.2134],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@VNLJI\\JPPDYPFVQDCJZRNEVNhKXgR@^P@NLRbB\\Mh@XcVARJE`RTCNFV€XRCjPPLNA@GZKbJJHXB\\MNPjLdGbWnK\\]NGHSFEXATIdCJGPARUWUHCPWRELITAHKv_E@iYCaW_BQ\\Y@QIO@QDCIGZCEMWGFMFAFgHEDOCSqKCCFGAMKEAC@ODGCGs@WH@KQA@EE@CE@GEA@EH@GGUEEJEAYD@JM@@DAA@FHD@FTJEHUC@JUBKCKG@G[CIIQReAYhO@OXGDO@@FF@IHJFCPEBACBIAAKDOABXARHPNEHGbQAAKQFGIAM[C@WHKaGiCEGOA‹HUKCIokSCUSOCYN[BgGMFIR±ŠOZmHWNU@ShbbXDHVXXGJ^lZ@PZ\\Nb@\\FHJAD"],"encodeOffsets":[[118750,41232]]}},{"type":"Feature","id":"110115","properties":{"name":"大兴区","cp":[116.4716,39.6352],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@F\\E~DFN@BDFEpHFCHBBEGCDCJBHUDSBB@ELCPbF@B\\J@BJVAFJ\\ADKTCBGECFMT@BMN@@FH@DaNBEnvB@FPBATK@FHEFIAKFBFL@@PKBFJHC@FXBRAFCDMPDTOL@JIVFDHH@DDH@BGRFCDLD@N^@@CNA@KNOAEBCECFEGCFGMGFIPMOEJOLBADBBHGG@GCHIECY@INC@DMGS\\AIOZAAEYA@GT@KKMBEETCGMVINFxA@MJADB@FlA@HJA@NND@DFA@DVAZBBOFKH_JA@K^GBC@EFE„G@gAENMXKJigC@IbSJMqGOP£RGSMGE@kbQFDPEFiBSGGSBK]I{CDWCIDOic[C_G@SuSO@EWKCO@MNY@\\uZOPENQD[LKESSKGBKEG@EJGAGHoH¥CqhifeJkX_XFFGHFNEDFPENKHM^IFIVL^S`DVEnNnG`RTCJHH@R^XFXGVPP"],"encodeOffsets":[[119042,40704]]}},{"type":"Feature","id":"110113","properties":{"name":"顺义区","cp":[116.7242,40.1619],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@EhEBENXHFNYDJHCD@RJP@R[ZARX`DbjZF@bHXT`Jb@dIFMTGDSfAJVbGnJVM@OKELYPERVXRflXTT@NIfC\\NJRhCVEHFJXNT^DTeZEHYCOhuAMJELOdAVPTMOWBWNMNEJgl]@WGUFIC[T{EEDEHGCIGMI@SECUQI[D{A{GQESPUH]CsiMCmHUeoHENcAaDGCMDGMQCACCBaCGLMAHB@DIEQLOAAEEJ@CW@CDINGAAGKQOCgV@LG@BEGDKNeREFBNCFIDOPKD[@YRW@GFWDAFE@EHDDrLDTCPGF","@@KrJEH[\\B@FF@CHFBHUN‹AJKADGECBCMAG^E@EbI@BEGP"],"encodeOffsets":[[119283,41084],[119377,41046]]}},{"type":"Feature","id":"110117","properties":{"name":"平谷区","cp":[117.1706,40.2052],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@ZJZRafFLjn€VGNJ@LLBdXX\\T^EDMJ@”nZKLBjPPJ@HbA\\H`DbERHLCFK^BZaFWXQLAGMHa\\OLO@SBIpBdCLƒVQfElO@GSAKEDQTC@GEBKG@ORIJBDAPDFA@CaOq@GGQAAEJK@KMUGAAGEAa@MGMBGCGSIIW@WSUCMDOJeWOM@IUF{WMWaDIMgIoRoCOKeEOEAG_I[cg@wLIFENQFDVTFJ@HNDJGHCFFFS|D\\EJHV@Xk^IhMFMNAXPX"],"encodeOffsets":[[119748,41190]]}},{"type":"Feature","id":"110112","properties":{"name":"通州区","cp":[116.7297,39.8131],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@FDAJTGDNDCTDDEDBBE@DT@@EHCDGJ@EIZ@@FDBR@ATFBBVFFE@@HNA\\VE@CLIFNJFNJBCP]A@LJFA@HJEDD\\C@DBCHLAEPF@@DH@APHAERDF\\GIxDTM@CFLBBFJ@CNUPMHECGDBF]BMFPDLRBHHBJMDCX@@DFIBFPBRKJF@CGANBHKbDDABDRDHNNCHDbCdBFMpGHiOYMefKJMC}HWAUNW\\NNBNA„kNU|]HMTMN@MZBLFFF@RIRUT‘BMFIEGaAGGAOIIUGTSFcYKS@MSLYPKRUBU]EWDOI]CKGASgW@MTWKIMCS@uMAKKADMECGAKVUTSDy@IjWLMNBF@hƒHEF@FAD]H@LIBG`ELAPYAUB@CEB@CMC@MIB@GkB@ECAIB@NwBMEUJHNSDFFNALLS@@HZBBFYBJP[BHTCND@JMZ@FDGJHDH@GHAABCKAIPPFONEJNHEHHDEFFDADBFMP@L"],"encodeOffsets":[[119329,40782]]}},{"type":"Feature","id":"110105","properties":{"name":"朝阳区","cp":[116.4977,39.949],"childNum":2},"geometry":{"type":"MultiPolygon","coordinates":[["@@bFGHBHFBFIVFHHG@@FFB@HDFF@@FRB@LXGt@DHCH@PBDLFBNF@BEXCHEX@ZQ\\@LCPOJCDEAMFEfQLMHCAFH@@KhUNE^AAEHCFDNGVODMI@AEKADEN@CSJw[HCEFQGBBOG@@CE@FOKBDGCAD@C[FCGIB@IE@K^BDOIAEMMIJEDKF@[UMB@GF@EEAUEABSQ@CA@EY@FJI@CHGD@FS@@CAFCACFSCCDCMSHBIECMB@D]@@MKCDCQEAHG@CCG@CGUEIJK@SPOCCNEDQBDNDB@DJCDLFCBBALJB@BVGPBKVO@KHCCCD@FE@BNA@FNCTDDJA@FGB@NBDW@CL@hT@@ZHHQDDDAFSAANBC@HG@EFS@@DE@@PCB@Ue@CADNJB@FCBWA@LI^ix@FIHrH"],["@@HUN‹AJKADGECBCMAG^E@EbI@BEGPKrJEH[\\B@FF@CHFB"]],"encodeOffsets":[[[119169,40992]],[[119398,41063]]]}},{"type":"Feature","id":"110108","properties":{"name":"海淀区","cp":[116.2202,40.0239],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@plDJVLŒGPBFHjDbHGL@X\\DBNHJREBLRBHaFGŽMGOBQAWPBLCBBAJBDFADOIEJGE@@EP@HCPWP@ZgfBRQJJ\\D@HLHLDVA@IVDFGSI@EGC@EBB@CN@@IZCAGHGaEqGJG@EjwJ]@K@GSA@e_I@NE@CA@Kg@KC@ENCFƒAKQAW@WIMK@V‹@I@@F@^EDFB@HcIaDYCBRRDCHD@EFLN@FE@CJUPEJOJMTBPEDIFCMIAKNOGMRFJNDVBFLSRMJSDGJsFcEiJGDGTIlOjYD"],"encodeOffsets":[[118834,41050]]}},{"type":"Feature","id":"110106","properties":{"name":"丰台区","cp":[116.2683,39.8309],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@hMN@NFTQCFRCBJFA@HJ@@HJ@HJ\\FTACDŒ@@UNLXJX@@MA@@IECAQlDFEHBDI~D@GXCFMVDFCH@@NF@ANJC@FnAB@AMF@@EDCDDLGP@LUOAUH@AIABKAAEDCKID@CCACMWA@EGDEILA@OK@AELEJBFEEGL@BSOA@EuAFmMACbG@@EM@ANS@ENFDAHSDCL[BEIUBAII@A[E@OaKD@FAACTGVIACDHDAFGAEDoGEFACM@i€g@@QFCMKMU@]SCoBGSMQ‰DEXXDWPO@MKYGM^AdJJA\\cNB\\G^„DNHFCBFABDBJ@PL^D@DF@T@FDAF^A"],"encodeOffsets":[[118958,40846]]}},{"type":"Feature","id":"110107","properties":{"name":"石景山区","cp":[116.1887,39.9346],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@NQPHLMJBDNJEFCAONSPIFIVODIF@@EKMFEC@DGQCAQZDbCdJ@GEAFC@]@EJ@DCSB[EGII@@GI@@GEBAIQDDESRMEM@gNYTIRKJAJEJ[DFJKLGBGNBJLDCDAHGBJJAFBLEXTLZFBAFDLD"],"encodeOffsets":[[118940,40953]]}},{"type":"Feature","id":"110102","properties":{"name":"西城区","cp":[116.3631,39.9353],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@XBDA@EIACM@IJAD]BC@SFABISAD]H@@OAEDQEW@BLE„MD@FLDh@@LDBF@@M`J@fTB@H"],"encodeOffsets":[[119175,40932]]}},{"type":"Feature","id":"110101","properties":{"name":"东城区","cp":[116.418,39.9367],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@DBf@@VDA@OF@@CT@FEH@@GADBMTBBECCRCGG@YS@@gDK@A‘C@PG@C^TBAJEB@TADC^IB@J"],"encodeOffsets":[[119182,40921]]}},{"type":"Feature","id":"110104","properties":{"name":"宣武区","cp":[116.3603,39.8852],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@RBX@RFFCŽBFU@aK@WA}CCJGAEFkCBRFD@JB@@N"],"encodeOffsets":[[119118,40855]]}},{"type":"Feature","id":"110103","properties":{"name":"崇文区","cp":[116.4166,39.8811],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@XBL@@bEV’D@BX@AC@MHA@EIBCCDSEMmB@EIDBME@@MG@EDUCENWD@H"],"encodeOffsets":[[119175,40829]]}}],"UTF8Encoding":true}; +define('echarts/util/mapData/geoJson/bei_jing_geo',[],function() { + return {"type":"FeatureCollection","features":[{"type":"Feature","id":"110228","properties":{"name":"密云县","cp":[117.0923,40.5121],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@vIHZDZQtDLNMXIbHRCXXITbJ@H`LGPRDDJNCLHTOCWFGvGBUJMKGFO^IHWXITQCI’Y^AXGfRˆDXF`DJOLB~G\\DZIHHpErUVMhHb]\\M†BVF@FTP`@zTbD\\@~M\\K`H^EVODWICAakAQXoIcCOCIgGYNWFWNGGKKGaJEGMEIKYJUT_J_Go@_SyQaSFMEGTcYOQLIIi@EKAUPCV[EEXQCW|aMUMAaYCYNIDGGACIMGGSKDQGaF_C[GaB@GOIiOKAYL“mI@CN]F[SWWAcKKI@HMUimEKbeYQYISNUOcBKPIFBNgvDPGZYFSf]CMSIWGEUFgDIQ[MeDMJS@RR@LphFPCHaBAJKF@J]IBJO@HlO@@RKAMPJHCNDJTHFP@ZGNANBRFH@J_fM^ONJNF\\VTDJHDON@XRND\\XRCPVETCLBVKDFJINHRGPRV@\\CLJN@VbXbLVT"],"encodeOffsets":[[119561,41684]]}},{"type":"Feature","id":"110116","properties":{"name":"怀柔区","cp":[116.6377,40.6219],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@JHTVHXCHPfnDJGHNDJSB[JSBGVSAOH@PMPuDEHHXZN@PHF@ZLJ@LHVYJA\\OFWP]BMtMBSRGV[JeVAPQVIFENMD¡–@^NV\\JH@NNL@NM\\kTQ\\I^FNIpBHGTBFFAZQfKDIXQTLXFXNNVMVHRGpCFLlRLEVBBH`IVO\\G`RDPAXLXBXORHZEHTDLLN@VGTMrQNFPeASKG@GMOAKBYMK@GTUHUXSHMVDNMOUEOZMJML@^KRACMZEZMRQLUHE@OFENPR@DI\\ChMHIDG\\GJMDWHCKGMDCIQCHO_K@GaIJSWWQDaGWJMNCKRsCYGYuJUSaKaW@UIMDK@[QUHOGQJMEILCAUDKFSOUQD[WMC‚Q@WPMGCCIUSE[IMPMN]`e@IEGAQBMHM@YEOSGCIDMIGNOLB@QP@GkP@AI^J@ILEBIbADGEOog@KQQWSekWQQUOFKZLF@PUNmIaHIUeBCTSHENcJa@_IWSaGu`GLSBKJQFOXGDXVQVOBIHcDSJWBEFGTMH[^mLaXcHiKElTRKtFXZ`MHMPCNRDxZˆB\\ICIHK@KŽHbIVFZ@BPnGTGbDXRDJaZKRiGEFSFEJhjFNZFjn"],"encodeOffsets":[[119314,41552]]}},{"type":"Feature","id":"110111","properties":{"name":"房山区","cp":[115.8453,39.7163],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@h@bl@HRJDZ``TA\\VVD^H`\\pF\\JŒ`JGv@ZO\\GPSTEjPTR`FnEbDTDHEhLFMTK@ETSPULKEI@OVISKSJACEQNQbV˜IXGDIN@dMB[IIBcN]ZHNLP@XOWCFWŠCNRHTpATD@^NVNLED@Rh@jCEF}E[OOHUEW]W@QGGDIQSH_MmFmCUT_K]i@MHCMW—FCF‹E{BMHMPOHKS]CFNGBELDH_@BcAKOACESAOBELaXAROB@FODMEDWJAG[aE@UM@DImEWJMC@OeCA{aE[@{L@MINUCQXKfUJORCHqJBF@TCXWNQX]M[EAJO@@KMBQJIC]EWMCCUBEBFHKDOTMBGNGF]MWDBRDdMDQVyE@LPVHDCP@JVVMTG~HNSH[CmRUvHPHBbA\\PTNRC\\YNJ€PRARPJDDR"],"encodeOffsets":[[118343,40770]]}},{"type":"Feature","id":"110229","properties":{"name":"延庆县","cp":[116.1543,40.5286],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@^AXOPEB[ZIGU@KKI@YGE@OYMGWFGvCNO@OPGTBHUTA\\ITACIGMIHmCOeDGGWSUIGimYEEMgiFITEFEjHLQbYCIWQaCSHmHAOY@UEaJG@LGLDJ[J‡AwYQCDMNONGY_EWLsSQFkMO[NWAIGaIYL@HMBOKiOQDWEUDMQSF_QIUBWdg@[NaAKQ@M]OQ@WhgLUMMFYQDIRCEUZOOCIOJ[KIUMKL@HIDKVEBM`HJAJSJUdBLGNEdMBMO[BYEWJSNKNaD]PE\\SjOT_RQVEZPpƒNQXfŠNA~lNG`@PNLp¼RFLfbdKbATUh@FSNWjGFZVLFHVA~X¨PPROfFJbNJPLFbENJPrEFNPFRHDDJdENJLVEPBJTVTHGHFRFH@PXP\\ORQHW\\BjWFDERLPPBbB\\E`B\\D\\L`@F]FCnJ^AZL"],"encodeOffsets":[[119262,41751]]}},{"type":"Feature","id":"110109","properties":{"name":"门头沟区","cp":[115.8,39.9957],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@V@XMnGPY²‰JQNEhH\\AZMPDVTTDZCPiJkHSHCjIdFtEHITCNITQEKUAMCEIKCECABYESKFWAKBEIIHABGDCKCAIHMHALKEI\\CFIBILIJQZS]BBEECS@E@@C]COKI@CABAAEEDMGƒCH]A[M@CJWH—JaUMRFRBDTITLUJ@PFJKLOVST@FSLENgKGFSCaCmF_ESQiOSFOT[HYPu@IH‹_[IoE_[]GUC[USB__CYQI@Gakg@qZeHQNMNV\\FVLPgJAFJPRLCH[XcPELUT[JiV_EELFTADBXRTRLJC@fHXHHbPd`fR@NfT`@TLplHMpCEJHJBVLFŽ@JT‚VnG^KXDXHNVGRLRXFJVdDHSNWLGfEzA"],"encodeOffsets":[[118635,41113]]}},{"type":"Feature","id":"110114","properties":{"name":"昌平区","cp":[116.1777,40.2134],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@VNLJI\\JPPDYPFVQDCJZRNEVNhKXgR@^P@NLRbB\\Mh@XcVARJE`RTCNFV€XRCjPPLNA@GZKbJJHXB\\MNPjLdGbWnK\\]NGHSFEXATIdCJGPARUWUHCPWRELITAHKv_E@iYCaW_BQ\\Y@QIO@QDCIGZCEMWGFMFAFgHEDOCSqKCCFGAMKEAC@ODGCGs@WH@KQA@EE@CE@GEA@EH@GGUEEJEAYD@JM@@DAA@FHD@FTJEHUC@JUBKCKG@G[CIIQReAYhO@OXGDO@@FF@IHJFCPEBACBIAAKDOABXARHPNEHGbQAAKQFGIAM[C@WHKaGiCEGOA‹HUKCIokSCUSOCYN[BgGMFIR±ŠOZmHWNU@ShbbXDHVXXGJ^lZ@PZ\\Nb@\\FHJAD"],"encodeOffsets":[[118750,41232]]}},{"type":"Feature","id":"110115","properties":{"name":"大兴区","cp":[116.4716,39.6352],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@F\\E~DFN@BDFEpHFCHBBEGCDCJBHUDSBB@ELCPbF@B\\J@BJVAFJ\\ADKTCBGECFMT@BMN@@FH@DaNBEnvB@FPBATK@FHEFIAKFBFL@@PKBFJHC@FXBRAFCDMPDTOL@JIVFDHH@DDH@BGRFCDLD@N^@@CNA@KNOAEBCECFEGCFGMGFIPMOEJOLBADBBHGG@GCHIECY@INC@DMGS\\AIOZAAEYA@GT@KKMBEETCGMVINFxA@MJADB@FlA@HJA@NND@DFA@DVAZBBOFKH_JA@K^GBC@EFE„G@gAENMXKJigC@IbSJMqGOP£RGSMGE@kbQFDPEFiBSGGSBK]I{CDWCIDOic[C_G@SuSO@EWKCO@MNY@\\uZOPENQD[LKESSKGBKEG@EJGAGHoH¥CqhifeJkX_XFFGHFNEDFPENKHM^IFIVL^S`DVEnNnG`RTCJHH@R^XFXGVPP"],"encodeOffsets":[[119042,40704]]}},{"type":"Feature","id":"110113","properties":{"name":"顺义区","cp":[116.7242,40.1619],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@EhEBENXHFNYDJHCD@RJP@R[ZARX`DbjZF@bHXT`Jb@dIFMTGDSfAJVbGnJVM@OKELYPERVXRflXTT@NIfC\\NJRhCVEHFJXNT^DTeZEHYCOhuAMJELOdAVPTMOWBWNMNEJgl]@WGUFIC[T{EEDEHGCIGMI@SECUQI[D{A{GQESPUH]CsiMCmHUeoHENcAaDGCMDGMQCACCBaCGLMAHB@DIEQLOAAEEJ@CW@CDINGAAGKQOCgV@LG@BEGDKNeREFBNCFIDOPKD[@YRW@GFWDAFE@EHDDrLDTCPGF","@@KrJEH[\\B@FF@CHFBHUN‹AJKADGECBCMAG^E@EbI@BEGP"],"encodeOffsets":[[119283,41084],[119377,41046]]}},{"type":"Feature","id":"110117","properties":{"name":"平谷区","cp":[117.1706,40.2052],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@ZJZRafFLjn€VGNJ@LLBdXX\\T^EDMJ@”nZKLBjPPJ@HbA\\H`DbERHLCFK^BZaFWXQLAGMHa\\OLO@SBIpBdCLƒVQfElO@GSAKEDQTC@GEBKG@ORIJBDAPDFA@CaOq@GGQAAEJK@KMUGAAGEAa@MGMBGCGSIIW@WSUCMDOJeWOM@IUF{WMWaDIMgIoRoCOKeEOEAG_I[cg@wLIFENQFDVTFJ@HNDJGHCFFFS|D\\EJHV@Xk^IhMFMNAXPX"],"encodeOffsets":[[119748,41190]]}},{"type":"Feature","id":"110112","properties":{"name":"通州区","cp":[116.7297,39.8131],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@FDAJTGDNDCTDDEDBBE@DT@@EHCDGJ@EIZ@@FDBR@ATFBBVFFE@@HNA\\VE@CLIFNJFNJBCP]A@LJFA@HJEDD\\C@DBCHLAEPF@@DH@APHAERDF\\GIxDTM@CFLBBFJ@CNUPMHECGDBF]BMFPDLRBHHBJMDCX@@DFIBFPBRKJF@CGANBHKbDDABDRDHNNCHDbCdBFMpGHiOYMefKJMC}HWAUNW\\NNBNA„kNU|]HMTMN@MZBLFFF@RIRUT‘BMFIEGaAGGAOIIUGTSFcYKS@MSLYPKRUBU]EWDOI]CKGASgW@MTWKIMCS@uMAKKADMECGAKVUTSDy@IjWLMNBF@hƒHEF@FAD]H@LIBG`ELAPYAUB@CEB@CMC@MIB@GkB@ECAIB@NwBMEUJHNSDFFNALLS@@HZBBFYBJP[BHTCND@JMZ@FDGJHDH@GHAABCKAIPPFONEJNHEHHDEFFDADBFMP@L"],"encodeOffsets":[[119329,40782]]}},{"type":"Feature","id":"110105","properties":{"name":"朝阳区","cp":[116.4977,39.949],"childNum":2},"geometry":{"type":"MultiPolygon","coordinates":[["@@bFGHBHFBFIVFHHG@@FFB@HDFF@@FRB@LXGt@DHCH@PBDLFBNF@BEXCHEX@ZQ\\@LCPOJCDEAMFEfQLMHCAFH@@KhUNE^AAEHCFDNGVODMI@AEKADEN@CSJw[HCEFQGBBOG@@CE@FOKBDGCAD@C[FCGIB@IE@K^BDOIAEMMIJEDKF@[UMB@GF@EEAUEABSQ@CA@EY@FJI@CHGD@FS@@CAFCACFSCCDCMSHBIECMB@D]@@MKCDCQEAHG@CCG@CGUEIJK@SPOCCNEDQBDNDB@DJCDLFCBBALJB@BVGPBKVO@KHCCCD@FE@BNA@FNCTDDJA@FGB@NBDW@CL@hT@@ZHHQDDDAFSAANBC@HG@EFS@@DE@@PCB@Ue@CADNJB@FCBWA@LI^ix@FIHrH"],["@@HUN‹AJKADGECBCMAG^E@EbI@BEGPKrJEH[\\B@FF@CHFB"]],"encodeOffsets":[[[119169,40992]],[[119398,41063]]]}},{"type":"Feature","id":"110108","properties":{"name":"海淀区","cp":[116.2202,40.0239],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@plDJVLŒGPBFHjDbHGL@X\\DBNHJREBLRBHaFGŽMGOBQAWPBLCBBAJBDFADOIEJGE@@EP@HCPWP@ZgfBRQJJ\\D@HLHLDVA@IVDFGSI@EGC@EBB@CN@@IZCAGHGaEqGJG@EjwJ]@K@GSA@e_I@NE@CA@Kg@KC@ENCFƒAKQAW@WIMK@V‹@I@@F@^EDFB@HcIaDYCBRRDCHD@EFLN@FE@CJUPEJOJMTBPEDIFCMIAKNOGMRFJNDVBFLSRMJSDGJsFcEiJGDGTIlOjYD"],"encodeOffsets":[[118834,41050]]}},{"type":"Feature","id":"110106","properties":{"name":"丰台区","cp":[116.2683,39.8309],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@hMN@NFTQCFRCBJFA@HJ@@HJ@HJ\\FTACDŒ@@UNLXJX@@MA@@IECAQlDFEHBDI~D@GXCFMVDFCH@@NF@ANJC@FnAB@AMF@@EDCDDLGP@LUOAUH@AIABKAAEDCKID@CCACMWA@EGDEILA@OK@AELEJBFEEGL@BSOA@EuAFmMACbG@@EM@ANS@ENFDAHSDCL[BEIUBAII@A[E@OaKD@FAACTGVIACDHDAFGAEDoGEFACM@i€g@@QFCMKMU@]SCoBGSMQ‰DEXXDWPO@MKYGM^AdJJA\\cNB\\G^„DNHFCBFABDBJ@PL^D@DF@T@FDAF^A"],"encodeOffsets":[[118958,40846]]}},{"type":"Feature","id":"110107","properties":{"name":"石景山区","cp":[116.1887,39.9346],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@NQPHLMJBDNJEFCAONSPIFIVODIF@@EKMFEC@DGQCAQZDbCdJ@GEAFC@]@EJ@DCSB[EGII@@GI@@GEBAIQDDESRMEM@gNYTIRKJAJEJ[DFJKLGBGNBJLDCDAHGBJJAFBLEXTLZFBAFDLD"],"encodeOffsets":[[118940,40953]]}},{"type":"Feature","id":"110102","properties":{"name":"西城区","cp":[116.3631,39.9353],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@XBDA@EIACM@IJAD]BC@SFABISAD]H@@OAEDQEW@BLE„MD@FLDh@@LDBF@@M`J@fTB@H"],"encodeOffsets":[[119175,40932]]}},{"type":"Feature","id":"110101","properties":{"name":"东城区","cp":[116.418,39.9367],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@DBf@@VDA@OF@@CT@FEH@@GADBMTBBECCRCGG@YS@@gDK@A‘C@PG@C^TBAJEB@TADC^IB@J"],"encodeOffsets":[[119182,40921]]}},{"type":"Feature","id":"110104","properties":{"name":"宣武区","cp":[116.3603,39.8852],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@RBX@RFFCŽBFU@aK@WA}CCJGAEFkCBRFD@JB@@N"],"encodeOffsets":[[119118,40855]]}},{"type":"Feature","id":"110103","properties":{"name":"崇文区","cp":[116.4166,39.8811],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@XBL@@bEV’D@BX@AC@MHA@EIBCCDSEMmB@EIDBME@@MG@EDUCENWD@H"],"encodeOffsets":[[119175,40829]]}}],"UTF8Encoding":true}; }); -define('echarts/util/mapData/geoJson/china_geo',[],function() { - return {"type":"FeatureCollection","features":[{"type":"Feature","id":"xin_jiang","properties":{"name":"新疆","cp":[84.9023,41.748],"childNum":18},"geometry":{"type":"Polygon","coordinates":["@@@›ρȁôƧƦóəʵסʵóƪԫʵѵͩƧͩړ›υࡓɛʵ@ȃ@óᇑѵƨɝɚôóНѺͩɜ̏ԭʵôƧɞñ@υƩ—݇ȂóƩƧ@ѵȂυœƥŌਗ—॥ɛóʵѵƧѹ˜݇̍ࢯ˜əɞυ˜ρͩ̏óਙƨƧŋôōóš̍ͩóʵן›óŋړͪƧѶ@ɜԭ—ԫƦɛȄ̍›ɝȄöςƩȂ̏œñȀ̏œƩóóŎə˜@Ő̎@ɞȀɝŎôƨóנѵȄƧ@óŏɝœóɜôŎ̍ͨςŎ@ƨóôƨɞ݈ʶóƨφó̎Ȁƨ̍ԮòѸԮמ@ѺȀ@ƪၬֆòȂñ̐òȂɜ˜óƨ̒Ŏ̑߼@φρȀ@Ő๐ς̎Ƨφ@ɝφڔ೦Ԯǿࢰ@ƦŏԮƨƨȄƧ۬ɜʶڔŐɚɚóŐôƨ߼˜ôƧƧó̐ƥóŏѺǿƦȁφƧς˜ƨƧ̒@ɜƥƦυ̐ɛƪͩƩəƪʷ̑ə@ȃƨʵנŋྸōਚԭԪ—@ɝƨŋ̒օςʵôƧ"],"encodeOffsets":[[98730,43786]]}},{"type":"Feature","id":"xi_zang","properties":{"name":"西藏","cp":[88.7695,31.6846],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@ôŌנœôʶ̎ͪô™óŎƨŌਚƧ̐ôςͪφ—ɚɝࢰ—݈̎Ѻ—Ѷƨôʶ०ɜਘ˜Ʀŋφ›Ѷȁ̍—ôŏɚŋ@̑ə—@ŏò̍ɜ›óƥôʷƧ̍φѹԪ̍ע@Ѹʷɜ@ôñנ@Ѷɛɞô̐ŏѶƨѸƧƥōƦœôŏô—@ƧôƩ̒ŋƨŌƦǿô̎ɜȁ̒—óʶѶôôО̒›ςƥɜНφσɛȁ̎υƨఱƧŏ@ʵƥœ@ŌóóóͩƨƧóŋ̑õóɞóɝԩͪɝρôƧ̍ƧѹͨڑŎ̑ōóƧࢭͩ̏ѵɝóఱóóԪυô@̒ƥŌ̏Ƨ̑Ȅ݇ŎƧ›ѵӏ@ɛõŏɛȄôӒƧŌѵǿɝ˜Ƨŋԫ@̏ʴƥ@óǿ̑Ȁóǿ̍ςóóυô@ʶɛñρƦƩŐó̎óœѵó̑ͪࢯОóɜן˜Ƨ̏ƥȄ߻̎̏̐ןŎɝɜöɞƩȀôöɛȀóͪ̐ƨƪ̍̎ȂƥԪυО@φɞ˜ôƪ"],"encodeOffsets":[[80911,35146]]}},{"type":"Feature","id":"nei_meng_gu","properties":{"name":"内蒙古","cp":[117.5977,44.3408],"childNum":12},"geometry":{"type":"Polygon","coordinates":["@@ኊȁ૊ö߼ƩɜɛנñԮɛѶóԮô@ȁѸóמ̎ගѺၬ@߼ʶԮӒ߼̎@ŐѹӒ̒Ԫƨöග̑ѶȄ̒ς।œѶɚöɞɜʴڔôôȂ̎—ѺȀς—ƨ˜ƪóԪ—ɜôɛОਕڔԭ˜ѵ̍ѹȂԫ›ɛƥ̍Ȃóɜ̎ô@ʶ݊ੲࢮʵږͪנƨôȂƧ˜̐ͪ@ŐƦƨφԬѶɜôƦ@ŐƧôôƦəŐ̏›@ŐڒѶԬô̐ʳԩНςōôŏɞ@ƨȂѶəóƧ̒ػ̎ó̐Őנóƨô̒@ƨɚɚ@עԫɛɛ@ȁυͩƥʳòևρ—̑ࡗƧͪ༃ॣԮփ̎Ʀ@ôô@ôō@š@ȁѵóƨ̍υȃóʵɛƨƥóυȂóəƪ›̐ρƧͩɜԭڔȄ̎عƧȁ̐ŏó̍ɛ›ƥƧ̑óρŐ@Ƨ̏˜ɝəɛ˜߻ͩ̍ͩɝО̍ƪƧóóӓƨóƧʳ݇@ɝςƪœ@ʴƩ—ƧƦôƨɛȄə›Ƨŋυ›óͩѵ@ɝǿóŌן̍ɛ˜óО̍œ̑̏ôȁ̍ŏòȁñóƦͩ@ǿə@ɛƧ̑˜ρȁυô̍օѹœóȃə™@ȂσʵѷƪòƩ̍—ôó߻ۯôʳƧ™óšõʵѵóѹɜ̍ȂѹôɛŌφֈƩͨρóυӑóޟఱ̑݇ͪóƪƨŌóȄڔԬƩςםñ̑ȃѵŐԭŏƨȁɛǿρôõɚɛóƧОə@ѹ̐ѵöԪͨôͪɛ̒ןŏƧƥóôƥƧɛŌôóɝó@̒݇Ӓ̒Ō@Ŏԭࢰ"],"encodeOffsets":[[99540,43830]]}},{"type":"Feature","id":"qing_hai","properties":{"name":"青海","cp":[96.2402,35.4199],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@ƨ@ôƪ݈ȁƪ˜@φɝòóƨԮʶɛ̐ѹͪôОəóƧɞᇒѶ@ôږô@ǿѶ›ƪȁςœɜͩφ˜ςŋɞôѶɛƨŌɞ—@ɚςŐñԪॢͩƨȂɞóƨŐ̎ŏעӏ̎óƧƦôœ̒ȁɜ›ςͩ̒œɚɛƨôƨɝφɛóȁƨŋóóɚͩƨóóƩ@ƧəŋƦƩ̍@ƧƧôǿυ̑@ȁɞǿõŏρƥסɚƧóτԫɞœôƧƦ@ñȃòñƥóυôôѹѵ—@ŏ̏Ȅɝó@ȂəŌóəѹƦ@Ő̍Ōυ݈ԩŐƧóôƧ̑›ôʵɞƧ̑ѵôƩɞƧ̑œóНѵóôʵ̑˜ɛȂó̍ƥȀƧŋ̑Ōóƪ@ƨó˜óŐƥ›ƦŎѷƨѵƧ̏Őɝóѵɜן@óòɛ@ѷʸס@ԩ̎υѺƨ̎óʸôƦɛœñ̎@Őɚ˜@̒əŌóŐ̎˜"],"encodeOffsets":[[91890,36945]]}},{"type":"Feature","id":"si_chuan","properties":{"name":"四川","cp":[102.9199,30.1904],"childNum":21},"geometry":{"type":"Polygon","coordinates":["@@ô˜ôŋó̑Ԯ̒ɛОמͪƨōöͫ߼ƥôȃƨóóñôƧóƧôōڔŏƨŐ@Ŏô˜òƥѺŎ@ōɜóנ˜ôǿô›ƦôԮ̍ɜôɚ›Ƨ—ñɛɚȁ̍Ƨɛևυ@óóôŋρԭɝ@Ƨʸ̍ŏυɜƧƧóƧƨȁρ̍ƨȃɚ—ôʵφóô̑̏Ȃ̑ʵɜʵɞ@ƨʳסƩóŎə—óɜƧôƩƧρ˜óôôô@ŎƧƨƨƪѹ˜ó̍̍Ʃ@̏ѹНôޟ̍Ʃóƪυɝɛ—əƨôŎɛȀ@Ȃ@ñɝʶ@Ōρנ̏—õóɛͨƨȂѵОɛʵ@̏ƩŐó߼Ƨల̍φɜȂυτɛОρƦɝƨóƪ̒Ѷɝƨóʶ̒œóƨƨôԪŏφ݇̎ŋ@ŏѺƥôɚɚŋ@ȁɞô̐ȃ@ŐѶ˜óѺφóƦôñòòȄ"],"encodeOffsets":[[104220,34336]]}},{"type":"Feature","id":"hei_long_jiang","properties":{"name":"黑龙江","cp":[128.1445,48.5156],"childNum":13},"geometry":{"type":"Polygon","coordinates":["@@ᇔȂਚНƨŐѶŏöƥςŏñƧƦóƨȁ@óƨ—óȁφӑóóƨ˜óǿ̎̑ôНɞ—ó̑ɜə߼›̎ǿ̒ôڒӑφ@Ƨȁ̎̏ƥƩ̎ρశ˜ôȂςƨφ@נɞ݈˜̑ƥƧɛƨʵƧȃƥ@Ƨƥ@ŏ̑ԩôɝρρóɛƧ›ƩͩƧó߻ʸ̍ʷѹƥɞڕõ̍öɝυ—̍ȂƧ̐̑ŏóƨñŋѹóóȁ̍›̏Ԭõʸ̏ŏ@ǿ̍@ƧОυ@ñƨòȀƥŎ̑ŐѵóɛŌóȂԫōƧŎѹñ̍ʶóОן@Ƨ̎Ѷô@Ȃ@™óŎó@@ó̍ƥԭք༄।ƨͩ̒ࡘς˜ñֈƦʴφͪ@ȂɜɜסԬə@Ƨə̑@Ƨóןô̏ŏ̍ô̑ؼôƨѵɚƧȁɝ@óŐρŎԪО̏ʴ"],"encodeOffsets":[[124380,54630]]}},{"type":"Feature","id":"gan_su","properties":{"name":"甘肃","cp":[95.7129,40.166],"childNum":14},"geometry":{"type":"Polygon","coordinates":["@@ڔôԮࢯ@ō̑ŋ݈ӑ@̑ɞôóôɜŋƦƨôóƨƦנŐɜ̑óͩԩͧѶõѺ̏ɚ@ƨНɜôöəςóɜȀƧȂԮŐѶŏ̒ȄמòƪρړԫôȃƧŋôƩ݈ͩɚ@@ǿɜ@φͩóŏɜӑƧōôǿ̎›ôƥƪóõ›ö@ô—ƨ˜ôƧƦôó̒ɜ@ɞŌõʶ̏Ő@ȀóôƨȂ@ʶע@@ƥ୾ӑó̑óŋôʵóɛړ@@ƩöóƩóρ—ɛƨ̑@óʷƥƥ̎ɛƧ›ôōƧǿôͩѵôɝȃɞȁõƧρóó—@ōƧŏړŐóŎôƨóƨôòƧôóȄ߻ƦõͬƧŎםͩɜНԭ̑ô̒óŌó—ƥ@óƨɝ›σԬƨôעəςƦöŐɝȀ@Ȃφ̒óȀƨƨ̎@ƥƪɚŌ@ƨôƪƧôəͪôôƧŌôȂυɜƧɞƧóəɜ̑›ρͪɛœ̑Ȃó›ƨƥ̍ôסӐ̍ŐƧŏɝôƧȁॡͪòԩρŏ@əɝ˜ƧŋѵɜɝóρŌυ—ɛͪρ›ƩȂѵœ@Ȁڕó@ȄɜʶφࡔڔœƨͪѶͪԬʶôƩעʶɚʶƥôóƨςȂ"],"encodeOffsets":[[98730,43740]]}},{"type":"Feature","id":"yun_nan","properties":{"name":"云南","cp":[101.8652,25.1807],"childNum":16},"geometry":{"type":"Polygon","coordinates":["@@ôɞôɝ̒öôŌƧƨôͪôô@ŋƦ›@ʶƨŐô߻ƪŏ@̐ɜʶѶНƧȁɜͧöô̐˜ςן@ŋɞʵ@ò@ȁɜǿóōɚƧɜ˜φɞôƩ̎ƪóޠѺО@̐̎ƪô̎Ѻ—ƧƩƨƧ@ōóóôóς—ƪƨƨóôɛó̑ԭ—ƥŌɛǿɝƨɛͩô›@ǿƨȁѺŌɚɛ̍ןѶНɛƧôóƥȁƦͩôŎɞ—ƨ̑ɜ—òôφ@ƨʵ@ɛѹōóȃəƨυǿóʵρƧƧŌƩɛ̏ȄñƧƧȀɝ̍ԩʶƧ̑υ—óŌƥʳɚӑóНƥô̑›óӒѵʵѹœƧӐןôƪφõŌƪ̒ԫŌƧؼƨƨס›ρȁƧœƨȂóʶó@@ʴƨôôφ̎Ŏ@Ȁƨ—ƪɚƨœóƨôôôςóޤƧŌƩŋƧԪ"],"encodeOffsets":[[100530,28800]]}},{"type":"Feature","id":"guang_xi","properties":{"name":"广西","cp":[108.2813,23.6426],"childNum":14},"geometry":{"type":"Polygon","coordinates":["@@ƦŋѺ̎ڔʵƨŐ@ƦמȄƪôóȂɜŌɚͩɜ@öóɜôôȂƦôɜȁ@ɞφ›óȄ̎›ƨʶɞŋƨʴɚǿ̐̎Ԭ@ôñ@̏ƨ›ρ۫ô›ɚƨƨНƪŐ̎›ƥóƦʵƥŋ@ȃóƥƧ@@ŏɝǿôυƧȁѵɛ@əóŏ̑@@ə̍›óƧó—@ȁƩ˜ρóòНƥô@Ӓ̑@óŎ̍ƥσŎυ@̍ƨ@Ō̑ôóͪƨ̒óŌړœ̏Ŏ@ŌôȄѺŎ@ɜƧʶυ@ñóɛ˜Ƨ̒ɝ˜óōƥͪ"],"encodeOffsets":[[107011,25335]]}},{"type":"Feature","id":"hu_nan","properties":{"name":"湖南","cp":[111.5332,27.3779],"childNum":14},"geometry":{"type":"Polygon","coordinates":["@@@քɜОƨ@öŐמóƪôƩɚ̒Ő߼ȁςͩɜòƪ—ɜȀò—ñɝò—Ѻͪ@ŏƨŋóɝôǿƨ™ɚȃóəƨȃѵͩó̍@ȃƨóóƥƨƧ@ʵƦ›óͩɜ—ɛóñԭɛōυȂ̍ƧƦō@ɛƥ—ɛȀ̑œóʷóō̍œƩŏƧОəƧóœς۬Ƨœ@̐óòԫ@̏̍əȀƧʳɝŌóɞƧ˜ƨɜóŐƨò@ȄƧŌρŋóôԪОóʶ@̎óȄ"],"encodeOffsets":[[111870,29161]]}},{"type":"Feature","id":"shan_xi_1","properties":{"name":"陕西","cp":[109.5996,35.6396],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@ςôöƨɝȂɞȄѶóóͪƨȀóŎƨœ̍ɜƦƦôʸ̒@ɜƧς˜ƪôõô@ƪڔ@ôɜóʶôŌô̒୽Ӓ@Ʀ@Ѻ̎ɜѺɛѶôöʶô™ƨšóʴ߼۰óô̎˜ñƪѸƩτʶ@ȁòŋəѹóǿ̑ʵ@ȁ̒ʷυփô݉ôН̏ط@ȁƨóô̏ƪõ@ʳ̐ʵ@ɝɛŋƩŌɛóןôƧŋ̒ó@ŏ̐ƥ@ŏυ@ƧƧôן̏@ƥȂѹɜəœɛóԭ̎ƥóóœóȀן—ɛô@ŎѹōñƦ"],"encodeOffsets":[[108001,33705]]}},{"type":"Feature","id":"guang_dong","properties":{"name":"广东","cp":[113.4668,22.8076],"childNum":21},"geometry":{"type":"Polygon","coordinates":["@@@Ȃô˜ôƨ̎œ@ɚ̒@ôŐ@ɚѶɜƨȂóφɞȀ@Őƨ@ôƦ@ȄƦŌƥʶƦôôŎôʸ̒›ɜǿƦ˜@ɜƥŎ̎ƨφȁɜŎòƥԮŎƨōóŏɛƧɝəɞƧ߼ɜςȃñȄƦŎ̒ōôòƨəƨ˜ɚН@əƨ̏ƪʵυŌəɛóəԭŏəœóŏѹœρʵɝƦ̏™ƥʳѶ›öō̑óóŋρȀυƧƥɛѹōƧôן—ɛŏѵ@óŋôʵɝ›ƪԩõ@Ƨō̍@Ƨ@@ƦɝԮƪО@@","@@X¯aWĀ„@l"],"encodeOffsets":[[112411,21916],[116325,22697]]}},{"type":"Feature","id":"ji_lin","properties":{"name":"吉林","cp":[126.4746,43.5938],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@נ@ôН̎ʵѺòƨōԬŎôȁɜŋѶô̒ŏƦōñǿòƧφ@ƨН̎@@Ȁ̐Őöʷ̐ԫ̎œôȂѺôòŌôƧ̒Őƨ̏̎ȁφ˜@ŋƩͩםȃƨ—@ȁ̑ʶ@Ōóôɛœƥѹ̑—συ݇@ɜρƧȃࢯƨôœəȂɛōƩɛ̏υρóõœƪʴυφ@ʶôŌóœρք@ɜƧ@ɝǿƧͪρȀƩó̏ŐƨȂ̍غړȃɛԮƨͪ̏ςƩœôɚφȁƦôɜƧôʶφȄ"],"encodeOffsets":[[126181,47341]]}},{"type":"Feature","id":"he_bei","properties":{"name":"河北","cp":[115.4004,37.9688],"childNum":11},"geometry":{"type":"MultiPolygon","coordinates":[["@@Ʃ̒̏ŌѺ̒Ʃ˜óȄƧŌƥͪòôñȂ̎ŐóȂ̒̐̎›ôНɜ—נ̎ôŋɞȀѶ@ôͪφœƨŌɚœɜȃóƧƨƥƪ˜@ʳƩ›ɞρ݈@υНφʵɜ˜ƦρƨƧ̍ɝóɛѹ̍ρŏ̑ôóƨ@œƧƦôƨɛ@ƥƨ@ȂƦ@@ôəŐƧʶƨŌυœ̍̎ɛŋôōɝ@óƧ̍›ƦʵѵʳôʵɜŏςôƪŋƨŌɚ@ôНƥƧ@ōѸɛ̐ô̎ʵѵНԭ@̍̍Ƨò@ȁɝ@əρυͩƪ̏ƩõƧŎƧōóšॡȄɛʶɜȀ@ɞςѶƧœƥςɛŐ@ɚɜɜ@Ŏôôςœƪς"],["@@õə@Ƨɛ˜@ŐóƦφô"]],"encodeOffsets":[[[117271,40455]],[[120061,41040]]]}},{"type":"Feature","id":"hu_bei","properties":{"name":"湖北","cp":[112.2363,31.1572],"childNum":17},"geometry":{"type":"Polygon","coordinates":["@@ñȄυƦöŐƩ˜óנƨƨφ@@Ő̏Ʀ@Ő̑ôƨŌנóɜôƪŋɜŌѶօڔə݈òɞōɜŎôӏƦóƨô̒óôȃƨó̎ŐôƧƪ@ƨȁςƧə̑̎Н@̍Ƨŏρôԭͩԫ—̍ʵƧšóȀôɞƧŌ@Őѹͩñ˜òɞñ˜ɛǿƩ˜ɛñρͪ߻Ȃ̑ŏƪəƩóםôõŏƧ@ɛНƥȄó›̑ѺƧ›ôφóƨƨƦƪóɜŐôóòôƨóφ̐ƨóƦ̎"],"encodeOffsets":[[112860,31905]]}},{"type":"Feature","id":"gui_zhou","properties":{"name":"贵州","cp":[106.6113,26.9385],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@ɜȀƦŋԮ˜ô̒ɚ˜ôōעƪƧʴɝ@ɛʶ̒ʶ̐ȁƦœóȂô@ôŏ@ōô—ƨʶѸô@ʶƨ˜ɞó@ōτöòυƨ@@əƨô@ɛ̒@Ʀɜôȃ@̍ôʵԩНôóςŌƨŋ@ȃƧñôŏƧɛƨ—ôɝƧʵ̍œôȃυœ@ɝɛȂƥóóȁɛóõôɛ@əͪɛŋôȁƩóםȃ@ƥƧŏړʶѹ̍ƥŌƦȂóôɜƨѵО̎נəɜѹŋƧȂ@ȀóœɜͪɞƧ"],"encodeOffsets":[[106651,27901]]}},{"type":"Feature","id":"shan_dong","properties":{"name":"山东","cp":[118.7402,36.4307],"childNum":17},"geometry":{"type":"Polygon","coordinates":["@@Ʃ̐φͪɚςɞ@@Ȃƨñ̎̎Ԯ@ѶОƨƧڔ@φН̑ŋ@Ʃ̒ǿ̎@ƨɜԬςôʶ̐ʶöԫƨƧנƥɜŎôō̎@ôŏóρƧŏԫôóƧԩó@ƥɜƧԭóƨʵɛƨ߻ӑɜНԩ˜óô̑óƧʳə™óɛƧ@õȀƧœ̍ȃɛŐóŏυО̍—óɝƩ—ԩ@ƧɚԫȄɚʶƨ˜ɞʶԪ̐ړɛƪ̒"],"encodeOffsets":[[118261,37036]]}},{"type":"Feature","id":"jiang_xi","properties":{"name":"江西","cp":[116.0156,27.29],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@ƧȄôɚəȄ̎ʶԬ˜ԮͪςóƨŐƪ›τɞƦōƥƧ@ŏςôóŐôô̒ʷѶ—ƪƩƩǿ@ō̒ɛôυ@—Ƨȁѹɛəƨѹ̑ƨ̏óƥѵʷô̍ɛȁôŏɝǿƧԫƧ›ôʳƥōòȃρȄ߻ɛɝƨɞɚɜƨôŐƧŎԭōñƦòԮɜôɛ˜ôͪƥœ@ʶƧƨôƦƧô@Ȅô̎Ѷͪ"],"encodeOffsets":[[117000,29025]]}},{"type":"Feature","id":"he_nan","properties":{"name":"河南","cp":[113.4668,33.8818],"childNum":17},"geometry":{"type":"Polygon","coordinates":["@@φ˜̎ƪ̐˜ɞȄɚ@@Ȃעó̎ŌѺ̒ôֆॢȃô™ƨŎƨōƪöƩ̑ڔɜԩ̏ɝʵƧ—əʵԬȃƨəԪ@@Ƨ̒ŏô̍υȁƧɚ̍ôóŋ@ɝƧŋõ̑σ—@ŏɜŋôɝ̒ƧɚôôطρóóɛƩ@óƨ̍ŏƧôóȄ̑ôƧóƥôóӐɛōɝŎ݇ñړɚѵֆ@ɞ̏ʶ@ʴƩöó̐"],"encodeOffsets":[[113040,35416]]}},{"type":"Feature","id":"liao_ning","properties":{"name":"辽宁","cp":[122.3438,41.0889],"childNum":14},"geometry":{"type":"Polygon","coordinates":["@@ƨʴƧôôӔƨô̎ƩɞН̎ͪ߼ͪɜ—ɞɚ̐—@ƨςŏ̒ôƦƨɜœô̎ƪôςǿƨͩɞȀƨ@@ɛςփô›óŋ@ʵφυƩʳö›॥փρѹס@əɛ@ͩࢯ@ѹʵρ—ƩʶφȀƧ݈̒۬óʸɝŎѵ@ԭԫןɛƧƨƥςɛ—υʶφО"],"encodeOffsets":[[122131,42301]]}},{"type":"Feature","id":"shan_xi_2","properties":{"name":"山西","cp":[112.4121,37.6611],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@ɚѺñŌɚšôȄѺ›̎ֆφóςȂ̒—ɜƨɚ@@Ȁƨŋôȃƪ—ѹ̑̐ŋƪ̑Ʃρρ›óó@ōɛɛ@əɜŏƦρƨ›ρѵ@ɝɛǿɜʵóօѹ̑̍ŋסô@ȁə@ɝȃ̏—̍Ʃυ—Ƨô@Ȃ̐ظóОó݊φք̑ʸ@Ȃ̒ʶôȀ"],"encodeOffsets":[[113581,39645]]}},{"type":"Feature","id":"an_hui","properties":{"name":"安徽","cp":[117.2461,32.0361],"childNum":17},"geometry":{"type":"Polygon","coordinates":["@@ó̎̑Ő@ƨƪ˜Ѷǿɜ̑φ—Ʀʵ̐˜Ƨѵôóƪôôυς—ƨȂɞŏ@̍ԫôò̑ƥ—óȃѶͩƧƥôŏѺœôŏƦ—@›ƥͩƧ—ôȁυó@̑ƧɛѵʵƩƪѵ˜̑ʸóóôŏρó@ŐƦƨƥŎσɝƩœ@̎̍Оɚ̒ρƨƧȂôɜςôóظəó̑ƨóɞɛŌ@Őτ˜ö̒ƨŌ@ɞôŌ̎óƨəφȂ"],"encodeOffsets":[[119431,34741]]}},{"type":"Feature","id":"fu_jian","properties":{"name":"福建","cp":[118.3008,25.9277],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@̎›óȁƨӑ̒—̎ɚƨͩφŐƨɝ̎ŋóŏρ—@ōƨ›òʳəóƨō̏˜õɛƧ@ƨѵƧōəŏóŋƧô̑ɝɛʳƥ@@óɛõ@Ƨ̑ƧóȁəƧ̑—Ƨ̐@ɚəОƧ—Ƨɚóñ̑ŎóʴƨœƨԬɞȀóŐɜȂó̎ѶʸôƦƧ̐Ѻ̒ɚƧѺɜƨȂ"],"encodeOffsets":[[121321,28981]]}},{"type":"Feature","id":"zhe_jiang","properties":{"name":"浙江","cp":[120.498,29.0918],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@Ѷʶƨɜ@̒φôóȂƨ˜Ʀͪ@œ̐˜Ѹ̍τȂ̒̑נŐמôƪƧôӑ̑›@ƥρͩƨօ̏@@υɝó@ŋɛ@ôƩəóƧѵυó@ƩɜŋƧ@̍ŌƧɞυŏƧͪ̍ə̑˜ƧӒôȂ̍œ@˜óφ̑ɜ@ŎƪȀ"],"encodeOffsets":[[121051,30105]]}},{"type":"Feature","id":"jiang_su","properties":{"name":"江苏","cp":[120.0586,32.915],"childNum":13},"geometry":{"type":"Polygon","coordinates":["@@ôɞ̎˜φНôŐɜŏ̎Ȅƨ›öǿƨ@ôɜɚšƨʴ̒ôôó@Ƨ̎əԮȃԪૉöͩ̐ƧòʵφƧôʵ@óړɜóŏɜǿƧ›ɝρσȁѷ̎̏—ƥ˜óŐѹ›óŐƨƦѵͪôȄƦ˜ñ̒Ԭó@̎ɝŐƧȁρ˜óφƩóóôƨѶ̏—ƥʶυ˜ɛ̒ѵȀ"],"encodeOffsets":[[119161,35460]]}},{"type":"Feature","id":"chong_qing","properties":{"name":"重庆","cp":[107.7539,30.1904],"childNum":40},"geometry":{"type":"Polygon","coordinates":["@@əȂòɜƨ˜ѺɛƦȁ̐@ƪ—õŏφƥòȃƥ̍Ƨôυ̏ƧôñóóôɛŏƩôƧƥôƧóυƨœ̒ѹôœƦȃ@փƥɛ̑@@ɜƧó@ɚƧ@ñφσõ@ŎɝôƧ—@ʵѷóƧʵó˜@ŎóŐó@ôȁƥ›ó̒υôóʶə˜ƧȄς̎ƧȂôƨƨƨφɛ̎Őƨʷɞ@ςԮóŌôôφ@ɜֈ̎ƨ"],"encodeOffsets":[[111150,32446]]}},{"type":"Feature","id":"ning_xia","properties":{"name":"宁夏","cp":[105.9961,37.3096],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@ల̒ôޠφӒςôƪͧυևɜŋѺó̎ȁ̍ɛ@ѹס@@ʵƧȁôó@ǿ̐ŏöʵɝŋɛ@ô̑ƥóóƨƧ—ó˜ôœó@ƩôóƦ̍œóȀƨŎɛӒôŐυͪɛ@@Ȁə@"],"encodeOffsets":[[106831,38340]]}},{"type":"Feature","id":"hai_nan","properties":{"name":"海南","cp":[109.9512,19.2041],"childNum":18},"geometry":{"type":"Polygon","coordinates":["@@φɜƦʶ̐ôφô̎@ƨŎö@τʵƦ˜ԩ۫õН̏óƥȃƧ@Ʃəםƨ̑Ʀ@ޤ"],"encodeOffsets":[[111240,19846]]}},{"type":"Feature","id":"tai_wan","properties":{"name":"台湾","cp":[121.0254,23.5986],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@ô—ƩɝöƧɝѵəޣ̏ρƩԭóōóͪρɞƧОôԪ݈ଦѶɜ̒ɛ"],"encodeOffsets":[[124831,25650]]}},{"type":"Feature","id":"bei_jing","properties":{"name":"北京","cp":[116.4551,40.2539],"childNum":19},"geometry":{"type":"Polygon","coordinates":["@@óóó›υóôƥ@ŏóóə@ƧŋƩŌρóɛŐóʶѶʴƥʶ̎œôƨɞ@óŎɜŌ̎̍φ›Ƨŋƨʵ"],"encodeOffsets":[[120241,41176]]}},{"type":"Feature","id":"tian_jin","properties":{"name":"天津","cp":[117.4219,39.4189],"childNum":18},"geometry":{"type":"Polygon","coordinates":["@@ôôɜ—@ƨöɚôœôôɚŏ@óƥ@@ȁƦƧɜ@óƧƨƥ@›ƧóəН̏óѷɜ@ŎƦƨóО"],"encodeOffsets":[[119610,40545]]}},{"type":"Feature","id":"shang_hai","properties":{"name":"上海","cp":[121.4648,31.2891],"childNum":19},"geometry":{"type":"Polygon","coordinates":["@@ɞςƨœɛȀôŐڔɛóυô̍ןŏ̑̒"],"encodeOffsets":[[123840,31771]]}},{"type":"Feature","id":"xiang_gang","properties":{"name":"香港","cp":[114.2578,22.3242],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@óɛƩ@ρ@óœôȀɚŎƨ@ö@@ōƨ@"],"encodeOffsets":[[117361,22950]]}},{"type":"Feature","id":"ao_men","properties":{"name":"澳门","cp":[113.5547,22.1484],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@X¯aWĀ„@l"],"encodeOffsets":[[116325,22697]]}}],"UTF8Encoding":true}; +define('echarts/util/mapData/geoJson/china_geo',[],function() { + return {"type":"FeatureCollection","features":[{"type":"Feature","id":"xin_jiang","properties":{"name":"新疆","cp":[84.9023,41.748],"childNum":18},"geometry":{"type":"Polygon","coordinates":["@@@›ρȁôƧƦóəʵסʵóƪԫʵѵͩƧͩړ›υࡓɛʵ@ȃ@óᇑѵƨɝɚôóНѺͩɜ̏ԭʵôƧɞñ@υƩ—݇ȂóƩƧ@ѵȂυœƥŌਗ—॥ɛóʵѵƧѹ˜݇̍ࢯ˜əɞυ˜ρͩ̏óਙƨƧŋôōóš̍ͩóʵן›óŋړͪƧѶ@ɜԭ—ԫƦɛȄ̍›ɝȄöςƩȂ̏œñȀ̏œƩóóŎə˜@Ő̎@ɞȀɝŎôƨóנѵȄƧ@óŏɝœóɜôŎ̍ͨςŎ@ƨóôƨɞ݈ʶóƨφó̎Ȁƨ̍ԮòѸԮמ@ѺȀ@ƪၬֆòȂñ̐òȂɜ˜óƨ̒Ŏ̑߼@φρȀ@Ő๐ς̎Ƨφ@ɝφڔ೦Ԯǿࢰ@ƦŏԮƨƨȄƧ۬ɜʶڔŐɚɚóŐôƨ߼˜ôƧƧó̐ƥóŏѺǿƦȁφƧς˜ƨƧ̒@ɜƥƦυ̐ɛƪͩƩəƪʷ̑ə@ȃƨʵנŋྸōਚԭԪ—@ɝƨŋ̒օςʵôƧ"],"encodeOffsets":[[98730,43786]]}},{"type":"Feature","id":"xi_zang","properties":{"name":"西藏","cp":[88.7695,31.6846],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@ôŌנœôʶ̎ͪô™óŎƨŌਚƧ̐ôςͪφ—ɚɝࢰ—݈̎Ѻ—Ѷƨôʶ०ɜਘ˜Ʀŋφ›Ѷȁ̍—ôŏɚŋ@̑ə—@ŏò̍ɜ›óƥôʷƧ̍φѹԪ̍ע@Ѹʷɜ@ôñנ@Ѷɛɞô̐ŏѶƨѸƧƥōƦœôŏô—@ƧôƩ̒ŋƨŌƦǿô̎ɜȁ̒—óʶѶôôО̒›ςƥɜНφσɛȁ̎υƨఱƧŏ@ʵƥœ@ŌóóóͩƨƧóŋ̑õóɞóɝԩͪɝρôƧ̍ƧѹͨڑŎ̑ōóƧࢭͩ̏ѵɝóఱóóԪυô@̒ƥŌ̏Ƨ̑Ȅ݇ŎƧ›ѵӏ@ɛõŏɛȄôӒƧŌѵǿɝ˜Ƨŋԫ@̏ʴƥ@óǿ̑Ȁóǿ̍ςóóυô@ʶɛñρƦƩŐó̎óœѵó̑ͪࢯОóɜן˜Ƨ̏ƥȄ߻̎̏̐ןŎɝɜöɞƩȀôöɛȀóͪ̐ƨƪ̍̎ȂƥԪυО@φɞ˜ôƪ"],"encodeOffsets":[[80911,35146]]}},{"type":"Feature","id":"nei_meng_gu","properties":{"name":"内蒙古","cp":[117.5977,44.3408],"childNum":12},"geometry":{"type":"Polygon","coordinates":["@@ኊȁ૊ö߼ƩɜɛנñԮɛѶóԮô@ȁѸóמ̎ගѺၬ@߼ʶԮӒ߼̎@ŐѹӒ̒Ԫƨöග̑ѶȄ̒ς।œѶɚöɞɜʴڔôôȂ̎—ѺȀς—ƨ˜ƪóԪ—ɜôɛОਕڔԭ˜ѵ̍ѹȂԫ›ɛƥ̍Ȃóɜ̎ô@ʶ݊ੲࢮʵږͪנƨôȂƧ˜̐ͪ@ŐƦƨφԬѶɜôƦ@ŐƧôôƦəŐ̏›@ŐڒѶԬô̐ʳԩНςōôŏɞ@ƨȂѶəóƧ̒ػ̎ó̐Őנóƨô̒@ƨɚɚ@עԫɛɛ@ȁυͩƥʳòևρ—̑ࡗƧͪ༃ॣԮփ̎Ʀ@ôô@ôō@š@ȁѵóƨ̍υȃóʵɛƨƥóυȂóəƪ›̐ρƧͩɜԭڔȄ̎عƧȁ̐ŏó̍ɛ›ƥƧ̑óρŐ@Ƨ̏˜ɝəɛ˜߻ͩ̍ͩɝО̍ƪƧóóӓƨóƧʳ݇@ɝςƪœ@ʴƩ—ƧƦôƨɛȄə›Ƨŋυ›óͩѵ@ɝǿóŌן̍ɛ˜óО̍œ̑̏ôȁ̍ŏòȁñóƦͩ@ǿə@ɛƧ̑˜ρȁυô̍օѹœóȃə™@ȂσʵѷƪòƩ̍—ôó߻ۯôʳƧ™óšõʵѵóѹɜ̍ȂѹôɛŌφֈƩͨρóυӑóޟఱ̑݇ͪóƪƨŌóȄڔԬƩςםñ̑ȃѵŐԭŏƨȁɛǿρôõɚɛóƧОə@ѹ̐ѵöԪͨôͪɛ̒ןŏƧƥóôƥƧɛŌôóɝó@̒݇Ӓ̒Ō@Ŏԭࢰ"],"encodeOffsets":[[99540,43830]]}},{"type":"Feature","id":"qing_hai","properties":{"name":"青海","cp":[96.2402,35.4199],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@ƨ@ôƪ݈ȁƪ˜@φɝòóƨԮʶɛ̐ѹͪôОəóƧɞᇒѶ@ôږô@ǿѶ›ƪȁςœɜͩφ˜ςŋɞôѶɛƨŌɞ—@ɚςŐñԪॢͩƨȂɞóƨŐ̎ŏעӏ̎óƧƦôœ̒ȁɜ›ςͩ̒œɚɛƨôƨɝφɛóȁƨŋóóɚͩƨóóƩ@ƧəŋƦƩ̍@ƧƧôǿυ̑@ȁɞǿõŏρƥסɚƧóτԫɞœôƧƦ@ñȃòñƥóυôôѹѵ—@ŏ̏Ȅɝó@ȂəŌóəѹƦ@Ő̍Ōυ݈ԩŐƧóôƧ̑›ôʵɞƧ̑ѵôƩɞƧ̑œóНѵóôʵ̑˜ɛȂó̍ƥȀƧŋ̑Ōóƪ@ƨó˜óŐƥ›ƦŎѷƨѵƧ̏Őɝóѵɜן@óòɛ@ѷʸס@ԩ̎υѺƨ̎óʸôƦɛœñ̎@Őɚ˜@̒əŌóŐ̎˜"],"encodeOffsets":[[91890,36945]]}},{"type":"Feature","id":"si_chuan","properties":{"name":"四川","cp":[102.9199,30.1904],"childNum":21},"geometry":{"type":"Polygon","coordinates":["@@ô˜ôŋó̑Ԯ̒ɛОמͪƨōöͫ߼ƥôȃƨóóñôƧóƧôōڔŏƨŐ@Ŏô˜òƥѺŎ@ōɜóנ˜ôǿô›ƦôԮ̍ɜôɚ›Ƨ—ñɛɚȁ̍Ƨɛևυ@óóôŋρԭɝ@Ƨʸ̍ŏυɜƧƧóƧƨȁρ̍ƨȃɚ—ôʵφóô̑̏Ȃ̑ʵɜʵɞ@ƨʳסƩóŎə—óɜƧôƩƧρ˜óôôô@ŎƧƨƨƪѹ˜ó̍̍Ʃ@̏ѹНôޟ̍Ʃóƪυɝɛ—əƨôŎɛȀ@Ȃ@ñɝʶ@Ōρנ̏—õóɛͨƨȂѵОɛʵ@̏ƩŐó߼Ƨల̍φɜȂυτɛОρƦɝƨóƪ̒Ѷɝƨóʶ̒œóƨƨôԪŏφ݇̎ŋ@ŏѺƥôɚɚŋ@ȁɞô̐ȃ@ŐѶ˜óѺφóƦôñòòȄ"],"encodeOffsets":[[104220,34336]]}},{"type":"Feature","id":"hei_long_jiang","properties":{"name":"黑龙江","cp":[128.1445,48.5156],"childNum":13},"geometry":{"type":"Polygon","coordinates":["@@ᇔȂਚНƨŐѶŏöƥςŏñƧƦóƨȁ@óƨ—óȁφӑóóƨ˜óǿ̎̑ôНɞ—ó̑ɜə߼›̎ǿ̒ôڒӑφ@Ƨȁ̎̏ƥƩ̎ρశ˜ôȂςƨφ@נɞ݈˜̑ƥƧɛƨʵƧȃƥ@Ƨƥ@ŏ̑ԩôɝρρóɛƧ›ƩͩƧó߻ʸ̍ʷѹƥɞڕõ̍öɝυ—̍ȂƧ̐̑ŏóƨñŋѹóóȁ̍›̏Ԭõʸ̏ŏ@ǿ̍@ƧОυ@ñƨòȀƥŎ̑ŐѵóɛŌóȂԫōƧŎѹñ̍ʶóОן@Ƨ̎Ѷô@Ȃ@™óŎó@@ó̍ƥԭք༄।ƨͩ̒ࡘς˜ñֈƦʴφͪ@ȂɜɜסԬə@Ƨə̑@Ƨóןô̏ŏ̍ô̑ؼôƨѵɚƧȁɝ@óŐρŎԪО̏ʴ"],"encodeOffsets":[[124380,54630]]}},{"type":"Feature","id":"gan_su","properties":{"name":"甘肃","cp":[95.7129,40.166],"childNum":14},"geometry":{"type":"Polygon","coordinates":["@@ڔôԮࢯ@ō̑ŋ݈ӑ@̑ɞôóôɜŋƦƨôóƨƦנŐɜ̑óͩԩͧѶõѺ̏ɚ@ƨНɜôöəςóɜȀƧȂԮŐѶŏ̒ȄמòƪρړԫôȃƧŋôƩ݈ͩɚ@@ǿɜ@φͩóŏɜӑƧōôǿ̎›ôƥƪóõ›ö@ô—ƨ˜ôƧƦôó̒ɜ@ɞŌõʶ̏Ő@ȀóôƨȂ@ʶע@@ƥ୾ӑó̑óŋôʵóɛړ@@ƩöóƩóρ—ɛƨ̑@óʷƥƥ̎ɛƧ›ôōƧǿôͩѵôɝȃɞȁõƧρóó—@ōƧŏړŐóŎôƨóƨôòƧôóȄ߻ƦõͬƧŎםͩɜНԭ̑ô̒óŌó—ƥ@óƨɝ›σԬƨôעəςƦöŐɝȀ@Ȃφ̒óȀƨƨ̎@ƥƪɚŌ@ƨôƪƧôəͪôôƧŌôȂυɜƧɞƧóəɜ̑›ρͪɛœ̑Ȃó›ƨƥ̍ôסӐ̍ŐƧŏɝôƧȁॡͪòԩρŏ@əɝ˜ƧŋѵɜɝóρŌυ—ɛͪρ›ƩȂѵœ@Ȁڕó@ȄɜʶφࡔڔœƨͪѶͪԬʶôƩעʶɚʶƥôóƨςȂ"],"encodeOffsets":[[98730,43740]]}},{"type":"Feature","id":"yun_nan","properties":{"name":"云南","cp":[101.8652,25.1807],"childNum":16},"geometry":{"type":"Polygon","coordinates":["@@ôɞôɝ̒öôŌƧƨôͪôô@ŋƦ›@ʶƨŐô߻ƪŏ@̐ɜʶѶНƧȁɜͧöô̐˜ςן@ŋɞʵ@ò@ȁɜǿóōɚƧɜ˜φɞôƩ̎ƪóޠѺО@̐̎ƪô̎Ѻ—ƧƩƨƧ@ōóóôóς—ƪƨƨóôɛó̑ԭ—ƥŌɛǿɝƨɛͩô›@ǿƨȁѺŌɚɛ̍ןѶНɛƧôóƥȁƦͩôŎɞ—ƨ̑ɜ—òôφ@ƨʵ@ɛѹōóȃəƨυǿóʵρƧƧŌƩɛ̏ȄñƧƧȀɝ̍ԩʶƧ̑υ—óŌƥʳɚӑóНƥô̑›óӒѵʵѹœƧӐןôƪφõŌƪ̒ԫŌƧؼƨƨס›ρȁƧœƨȂóʶó@@ʴƨôôφ̎Ŏ@Ȁƨ—ƪɚƨœóƨôôôςóޤƧŌƩŋƧԪ"],"encodeOffsets":[[100530,28800]]}},{"type":"Feature","id":"guang_xi","properties":{"name":"广西","cp":[108.2813,23.6426],"childNum":14},"geometry":{"type":"Polygon","coordinates":["@@ƦŋѺ̎ڔʵƨŐ@ƦמȄƪôóȂɜŌɚͩɜ@öóɜôôȂƦôɜȁ@ɞφ›óȄ̎›ƨʶɞŋƨʴɚǿ̐̎Ԭ@ôñ@̏ƨ›ρ۫ô›ɚƨƨНƪŐ̎›ƥóƦʵƥŋ@ȃóƥƧ@@ŏɝǿôυƧȁѵɛ@əóŏ̑@@ə̍›óƧó—@ȁƩ˜ρóòНƥô@Ӓ̑@óŎ̍ƥσŎυ@̍ƨ@Ō̑ôóͪƨ̒óŌړœ̏Ŏ@ŌôȄѺŎ@ɜƧʶυ@ñóɛ˜Ƨ̒ɝ˜óōƥͪ"],"encodeOffsets":[[107011,25335]]}},{"type":"Feature","id":"hu_nan","properties":{"name":"湖南","cp":[111.5332,27.3779],"childNum":14},"geometry":{"type":"Polygon","coordinates":["@@@քɜОƨ@öŐמóƪôƩɚ̒Ő߼ȁςͩɜòƪ—ɜȀò—ñɝò—Ѻͪ@ŏƨŋóɝôǿƨ™ɚȃóəƨȃѵͩó̍@ȃƨóóƥƨƧ@ʵƦ›óͩɜ—ɛóñԭɛōυȂ̍ƧƦō@ɛƥ—ɛȀ̑œóʷóō̍œƩŏƧОəƧóœς۬Ƨœ@̐óòԫ@̏̍əȀƧʳɝŌóɞƧ˜ƨɜóŐƨò@ȄƧŌρŋóôԪОóʶ@̎óȄ"],"encodeOffsets":[[111870,29161]]}},{"type":"Feature","id":"shan_xi_1","properties":{"name":"陕西","cp":[109.5996,35.6396],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@ςôöƨɝȂɞȄѶóóͪƨȀóŎƨœ̍ɜƦƦôʸ̒@ɜƧς˜ƪôõô@ƪڔ@ôɜóʶôŌô̒୽Ӓ@Ʀ@Ѻ̎ɜѺɛѶôöʶô™ƨšóʴ߼۰óô̎˜ñƪѸƩτʶ@ȁòŋəѹóǿ̑ʵ@ȁ̒ʷυփô݉ôН̏ط@ȁƨóô̏ƪõ@ʳ̐ʵ@ɝɛŋƩŌɛóןôƧŋ̒ó@ŏ̐ƥ@ŏυ@ƧƧôן̏@ƥȂѹɜəœɛóԭ̎ƥóóœóȀן—ɛô@ŎѹōñƦ"],"encodeOffsets":[[108001,33705]]}},{"type":"Feature","id":"guang_dong","properties":{"name":"广东","cp":[113.4668,22.8076],"childNum":21},"geometry":{"type":"Polygon","coordinates":["@@@Ȃô˜ôƨ̎œ@ɚ̒@ôŐ@ɚѶɜƨȂóφɞȀ@Őƨ@ôƦ@ȄƦŌƥʶƦôôŎôʸ̒›ɜǿƦ˜@ɜƥŎ̎ƨφȁɜŎòƥԮŎƨōóŏɛƧɝəɞƧ߼ɜςȃñȄƦŎ̒ōôòƨəƨ˜ɚН@əƨ̏ƪʵυŌəɛóəԭŏəœóŏѹœρʵɝƦ̏™ƥʳѶ›öō̑óóŋρȀυƧƥɛѹōƧôן—ɛŏѵ@óŋôʵɝ›ƪԩõ@Ƨō̍@Ƨ@@ƦɝԮƪО@@","@@X¯aWĀ„@l"],"encodeOffsets":[[112411,21916],[116325,22697]]}},{"type":"Feature","id":"ji_lin","properties":{"name":"吉林","cp":[126.4746,43.5938],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@נ@ôН̎ʵѺòƨōԬŎôȁɜŋѶô̒ŏƦōñǿòƧφ@ƨН̎@@Ȁ̐Őöʷ̐ԫ̎œôȂѺôòŌôƧ̒Őƨ̏̎ȁφ˜@ŋƩͩםȃƨ—@ȁ̑ʶ@Ōóôɛœƥѹ̑—συ݇@ɜρƧȃࢯƨôœəȂɛōƩɛ̏υρóõœƪʴυφ@ʶôŌóœρք@ɜƧ@ɝǿƧͪρȀƩó̏ŐƨȂ̍غړȃɛԮƨͪ̏ςƩœôɚφȁƦôɜƧôʶφȄ"],"encodeOffsets":[[126181,47341]]}},{"type":"Feature","id":"he_bei","properties":{"name":"河北","cp":[115.4004,37.9688],"childNum":11},"geometry":{"type":"MultiPolygon","coordinates":[["@@Ʃ̒̏ŌѺ̒Ʃ˜óȄƧŌƥͪòôñȂ̎ŐóȂ̒̐̎›ôНɜ—נ̎ôŋɞȀѶ@ôͪφœƨŌɚœɜȃóƧƨƥƪ˜@ʳƩ›ɞρ݈@υНφʵɜ˜ƦρƨƧ̍ɝóɛѹ̍ρŏ̑ôóƨ@œƧƦôƨɛ@ƥƨ@ȂƦ@@ôəŐƧʶƨŌυœ̍̎ɛŋôōɝ@óƧ̍›ƦʵѵʳôʵɜŏςôƪŋƨŌɚ@ôНƥƧ@ōѸɛ̐ô̎ʵѵНԭ@̍̍Ƨò@ȁɝ@əρυͩƪ̏ƩõƧŎƧōóšॡȄɛʶɜȀ@ɞςѶƧœƥςɛŐ@ɚɜɜ@Ŏôôςœƪς"],["@@õə@Ƨɛ˜@ŐóƦφô"]],"encodeOffsets":[[[117271,40455]],[[120061,41040]]]}},{"type":"Feature","id":"hu_bei","properties":{"name":"湖北","cp":[112.2363,31.1572],"childNum":17},"geometry":{"type":"Polygon","coordinates":["@@ñȄυƦöŐƩ˜óנƨƨφ@@Ő̏Ʀ@Ő̑ôƨŌנóɜôƪŋɜŌѶօڔə݈òɞōɜŎôӏƦóƨô̒óôȃƨó̎ŐôƧƪ@ƨȁςƧə̑̎Н@̍Ƨŏρôԭͩԫ—̍ʵƧšóȀôɞƧŌ@Őѹͩñ˜òɞñ˜ɛǿƩ˜ɛñρͪ߻Ȃ̑ŏƪəƩóםôõŏƧ@ɛНƥȄó›̑ѺƧ›ôφóƨƨƦƪóɜŐôóòôƨóφ̐ƨóƦ̎"],"encodeOffsets":[[112860,31905]]}},{"type":"Feature","id":"gui_zhou","properties":{"name":"贵州","cp":[106.6113,26.9385],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@ɜȀƦŋԮ˜ô̒ɚ˜ôōעƪƧʴɝ@ɛʶ̒ʶ̐ȁƦœóȂô@ôŏ@ōô—ƨʶѸô@ʶƨ˜ɞó@ōτöòυƨ@@əƨô@ɛ̒@Ʀɜôȃ@̍ôʵԩНôóςŌƨŋ@ȃƧñôŏƧɛƨ—ôɝƧʵ̍œôȃυœ@ɝɛȂƥóóȁɛóõôɛ@əͪɛŋôȁƩóםȃ@ƥƧŏړʶѹ̍ƥŌƦȂóôɜƨѵО̎נəɜѹŋƧȂ@ȀóœɜͪɞƧ"],"encodeOffsets":[[106651,27901]]}},{"type":"Feature","id":"shan_dong","properties":{"name":"山东","cp":[118.7402,36.4307],"childNum":17},"geometry":{"type":"Polygon","coordinates":["@@Ʃ̐φͪɚςɞ@@Ȃƨñ̎̎Ԯ@ѶОƨƧڔ@φН̑ŋ@Ʃ̒ǿ̎@ƨɜԬςôʶ̐ʶöԫƨƧנƥɜŎôō̎@ôŏóρƧŏԫôóƧԩó@ƥɜƧԭóƨʵɛƨ߻ӑɜНԩ˜óô̑óƧʳə™óɛƧ@õȀƧœ̍ȃɛŐóŏυО̍—óɝƩ—ԩ@ƧɚԫȄɚʶƨ˜ɞʶԪ̐ړɛƪ̒"],"encodeOffsets":[[118261,37036]]}},{"type":"Feature","id":"jiang_xi","properties":{"name":"江西","cp":[116.0156,27.29],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@ƧȄôɚəȄ̎ʶԬ˜ԮͪςóƨŐƪ›τɞƦōƥƧ@ŏςôóŐôô̒ʷѶ—ƪƩƩǿ@ō̒ɛôυ@—Ƨȁѹɛəƨѹ̑ƨ̏óƥѵʷô̍ɛȁôŏɝǿƧԫƧ›ôʳƥōòȃρȄ߻ɛɝƨɞɚɜƨôŐƧŎԭōñƦòԮɜôɛ˜ôͪƥœ@ʶƧƨôƦƧô@Ȅô̎Ѷͪ"],"encodeOffsets":[[117000,29025]]}},{"type":"Feature","id":"he_nan","properties":{"name":"河南","cp":[113.4668,33.8818],"childNum":17},"geometry":{"type":"Polygon","coordinates":["@@φ˜̎ƪ̐˜ɞȄɚ@@Ȃעó̎ŌѺ̒ôֆॢȃô™ƨŎƨōƪöƩ̑ڔɜԩ̏ɝʵƧ—əʵԬȃƨəԪ@@Ƨ̒ŏô̍υȁƧɚ̍ôóŋ@ɝƧŋõ̑σ—@ŏɜŋôɝ̒ƧɚôôطρóóɛƩ@óƨ̍ŏƧôóȄ̑ôƧóƥôóӐɛōɝŎ݇ñړɚѵֆ@ɞ̏ʶ@ʴƩöó̐"],"encodeOffsets":[[113040,35416]]}},{"type":"Feature","id":"liao_ning","properties":{"name":"辽宁","cp":[122.3438,41.0889],"childNum":14},"geometry":{"type":"Polygon","coordinates":["@@ƨʴƧôôӔƨô̎ƩɞН̎ͪ߼ͪɜ—ɞɚ̐—@ƨςŏ̒ôƦƨɜœô̎ƪôςǿƨͩɞȀƨ@@ɛςփô›óŋ@ʵφυƩʳö›॥փρѹס@əɛ@ͩࢯ@ѹʵρ—ƩʶφȀƧ݈̒۬óʸɝŎѵ@ԭԫןɛƧƨƥςɛ—υʶφО"],"encodeOffsets":[[122131,42301]]}},{"type":"Feature","id":"shan_xi_2","properties":{"name":"山西","cp":[112.4121,37.6611],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@ɚѺñŌɚšôȄѺ›̎ֆφóςȂ̒—ɜƨɚ@@Ȁƨŋôȃƪ—ѹ̑̐ŋƪ̑Ʃρρ›óó@ōɛɛ@əɜŏƦρƨ›ρѵ@ɝɛǿɜʵóօѹ̑̍ŋסô@ȁə@ɝȃ̏—̍Ʃυ—Ƨô@Ȃ̐ظóОó݊φք̑ʸ@Ȃ̒ʶôȀ"],"encodeOffsets":[[113581,39645]]}},{"type":"Feature","id":"an_hui","properties":{"name":"安徽","cp":[117.2461,32.0361],"childNum":17},"geometry":{"type":"Polygon","coordinates":["@@ó̎̑Ő@ƨƪ˜Ѷǿɜ̑φ—Ʀʵ̐˜Ƨѵôóƪôôυς—ƨȂɞŏ@̍ԫôò̑ƥ—óȃѶͩƧƥôŏѺœôŏƦ—@›ƥͩƧ—ôȁυó@̑ƧɛѵʵƩƪѵ˜̑ʸóóôŏρó@ŐƦƨƥŎσɝƩœ@̎̍Оɚ̒ρƨƧȂôɜςôóظəó̑ƨóɞɛŌ@Őτ˜ö̒ƨŌ@ɞôŌ̎óƨəφȂ"],"encodeOffsets":[[119431,34741]]}},{"type":"Feature","id":"fu_jian","properties":{"name":"福建","cp":[118.3008,25.9277],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@̎›óȁƨӑ̒—̎ɚƨͩφŐƨɝ̎ŋóŏρ—@ōƨ›òʳəóƨō̏˜õɛƧ@ƨѵƧōəŏóŋƧô̑ɝɛʳƥ@@óɛõ@Ƨ̑ƧóȁəƧ̑—Ƨ̐@ɚəОƧ—Ƨɚóñ̑ŎóʴƨœƨԬɞȀóŐɜȂó̎ѶʸôƦƧ̐Ѻ̒ɚƧѺɜƨȂ"],"encodeOffsets":[[121321,28981]]}},{"type":"Feature","id":"zhe_jiang","properties":{"name":"浙江","cp":[120.498,29.0918],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@Ѷʶƨɜ@̒φôóȂƨ˜Ʀͪ@œ̐˜Ѹ̍τȂ̒̑נŐמôƪƧôӑ̑›@ƥρͩƨօ̏@@υɝó@ŋɛ@ôƩəóƧѵυó@ƩɜŋƧ@̍ŌƧɞυŏƧͪ̍ə̑˜ƧӒôȂ̍œ@˜óφ̑ɜ@ŎƪȀ"],"encodeOffsets":[[121051,30105]]}},{"type":"Feature","id":"jiang_su","properties":{"name":"江苏","cp":[120.0586,32.915],"childNum":13},"geometry":{"type":"Polygon","coordinates":["@@ôɞ̎˜φНôŐɜŏ̎Ȅƨ›öǿƨ@ôɜɚšƨʴ̒ôôó@Ƨ̎əԮȃԪૉöͩ̐ƧòʵφƧôʵ@óړɜóŏɜǿƧ›ɝρσȁѷ̎̏—ƥ˜óŐѹ›óŐƨƦѵͪôȄƦ˜ñ̒Ԭó@̎ɝŐƧȁρ˜óφƩóóôƨѶ̏—ƥʶυ˜ɛ̒ѵȀ"],"encodeOffsets":[[119161,35460]]}},{"type":"Feature","id":"chong_qing","properties":{"name":"重庆","cp":[107.7539,30.1904],"childNum":40},"geometry":{"type":"Polygon","coordinates":["@@əȂòɜƨ˜ѺɛƦȁ̐@ƪ—õŏφƥòȃƥ̍Ƨôυ̏ƧôñóóôɛŏƩôƧƥôƧóυƨœ̒ѹôœƦȃ@փƥɛ̑@@ɜƧó@ɚƧ@ñφσõ@ŎɝôƧ—@ʵѷóƧʵó˜@ŎóŐó@ôȁƥ›ó̒υôóʶə˜ƧȄς̎ƧȂôƨƨƨφɛ̎Őƨʷɞ@ςԮóŌôôφ@ɜֈ̎ƨ"],"encodeOffsets":[[111150,32446]]}},{"type":"Feature","id":"ning_xia","properties":{"name":"宁夏","cp":[105.9961,37.3096],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@ల̒ôޠφӒςôƪͧυևɜŋѺó̎ȁ̍ɛ@ѹס@@ʵƧȁôó@ǿ̐ŏöʵɝŋɛ@ô̑ƥóóƨƧ—ó˜ôœó@ƩôóƦ̍œóȀƨŎɛӒôŐυͪɛ@@Ȁə@"],"encodeOffsets":[[106831,38340]]}},{"type":"Feature","id":"hai_nan","properties":{"name":"海南","cp":[109.9512,19.2041],"childNum":18},"geometry":{"type":"Polygon","coordinates":["@@φɜƦʶ̐ôφô̎@ƨŎö@τʵƦ˜ԩ۫õН̏óƥȃƧ@Ʃəםƨ̑Ʀ@ޤ"],"encodeOffsets":[[111240,19846]]}},{"type":"Feature","id":"tai_wan","properties":{"name":"台湾","cp":[121.0254,23.5986],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@ô—ƩɝöƧɝѵəޣ̏ρƩԭóōóͪρɞƧОôԪ݈ଦѶɜ̒ɛ"],"encodeOffsets":[[124831,25650]]}},{"type":"Feature","id":"bei_jing","properties":{"name":"北京","cp":[116.4551,40.2539],"childNum":19},"geometry":{"type":"Polygon","coordinates":["@@óóó›υóôƥ@ŏóóə@ƧŋƩŌρóɛŐóʶѶʴƥʶ̎œôƨɞ@óŎɜŌ̎̍φ›Ƨŋƨʵ"],"encodeOffsets":[[120241,41176]]}},{"type":"Feature","id":"tian_jin","properties":{"name":"天津","cp":[117.4219,39.4189],"childNum":18},"geometry":{"type":"Polygon","coordinates":["@@ôôɜ—@ƨöɚôœôôɚŏ@óƥ@@ȁƦƧɜ@óƧƨƥ@›ƧóəН̏óѷɜ@ŎƦƨóО"],"encodeOffsets":[[119610,40545]]}},{"type":"Feature","id":"shang_hai","properties":{"name":"上海","cp":[121.4648,31.2891],"childNum":19},"geometry":{"type":"Polygon","coordinates":["@@ɞςƨœɛȀôŐڔɛóυô̍ןŏ̑̒"],"encodeOffsets":[[123840,31771]]}},{"type":"Feature","id":"xiang_gang","properties":{"name":"香港","cp":[114.2578,22.3242],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@óɛƩ@ρ@óœôȀɚŎƨ@ö@@ōƨ@"],"encodeOffsets":[[117361,22950]]}},{"type":"Feature","id":"ao_men","properties":{"name":"澳门","cp":[113.5547,22.1484],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@X¯aWĀ„@l"],"encodeOffsets":[[116325,22697]]}}],"UTF8Encoding":true}; }); -define('echarts/util/mapData/geoJson/chong_qing_geo',[],function() { - return {"type":"FeatureCollection","features":[{"type":"Feature","id":"500242","properties":{"name":"酉阳土家族苗族自治县","cp":[108.8196,28.8666],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@XJ°œlJX@lbl@XbV@VLnJlxnbšƒUU@IVK@lVIVwnJlU@n@J@L@Jn@l_nWVLVln@@blLšmV@@xœÔ‚`nœ™xV‚ÈLlx„LVxVVšƒV_U»VWn_m¥XwVmnX°ƒlmUUVwÞaVƒk@a@mmIUa@™mwk@™ƒm@@U¯a@UV@@K™@ykkmwkV@kU@ƒÑƒVkKWLÅamaUm@kyU@WkU@Ua™IUašVaUUmUUa@aVLXKWa¯UUbmJXnWnX`l@@xkzWÆ@V„LU¦‚x@b@JkIkJ@LmbUamJwm@óxƒnk@V„@x„ŽVnUVmVUVŽUbVlUbkXWŽ"],"encodeOffsets":[[110914,29695]]}},{"type":"Feature","id":"500236","properties":{"name":"奉节县","cp":[109.3909,30.9265],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@WVXb‚UnK@x@b‚²kxmKkl¯_ƒVV°™VU@bnKVVV@@nkŽ@n›bn‚@š°@VLČUš@°WV@V™nU@InKVl@nU„b˜KnX„WlknLlKUwnalLša„VlUXmWk@UU@UWWIUyķ¹XaWW@X™ƒKUIVm„U@W@UVU@KV@n»VkUkÇmUmVIUmULUbm@ƒwUaƒKkkm¯ÑUL@bWVnx@VmxUI@„klmkkK@aƒK@IlJ@I¯ƒk@mak@mnkJVL@bV@Ub„„W`UUUV™I@VƒU@VVbUJVLUVVbUX„VVxk¦VJUnVxnVVUšJV@Ubl@@bXV@L"],"encodeOffsets":[[111781,31658]]}},{"type":"Feature","id":"500238","properties":{"name":"巫溪县","cp":[109.3359,31.4813],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@nLWbX‚VLVU„V@KšIVl@b„@lbšU„VnU@JÆU@V@n°KĢUl@VbÞKšVš@„_„V‚KXU‚U@KXƒ@wlkkU@mWKUU@UôJ@XV@œaVmÞIVaVLƒƒ@»kmƒ@ƒUkL™U@aU@WWƒLUUU™™KkbƒwWa@KU@kaƒXmW—LƒamVk@UmL@JmVUšU@¯X™@ċVUK¯@ÅnWK™LkKULWK@UXK@wW@™LkV@bVLƒlXn›`¯xU„°LnŽlV@n°Lnl"],"encodeOffsets":[[111488,32361]]}},{"type":"Feature","id":"500234","properties":{"name":"开县","cp":[108.4131,31.2561],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@n@na‚I„wš@@VVK„LVbVxnVÆUnanKWXamKmk¯K@mkUm¯KVƒ°w@Wm@UIUUlKUU@a¯KWanwmUXamKkUWUnU@KƒkUwWKXaWLUWkImaUUUƒƒKka±k@lƒ¯w™wmbUƒ™ƒkXm@UJkIW‚XXƒbƒmƒ„UJ™XUV@°šKlšlVXV@xmbnV@blV@VšœU`UL@V™a@bULlb°VXbܚ@V@bƒL@J„xnLVb@lVb@V@@z˜bXWšX„KVLV‚š@@bUVVL@b„„lVna@ll@„zl@@J"],"encodeOffsets":[[111150,32434]]}},{"type":"Feature","id":"500243","properties":{"name":"彭水苗族土家族自治县","cp":[108.2043,29.3994],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@„Jlb@nVV@bXb@ÆlL„Ul`nVKU¼VxkbW„nlUxlXX‚@°°WnnJ@VUn@J„k°L@VlV@nUJ„x@bVVVz@VnLla„KnalVlIUŽ„¼@nV@@anKUwVal@UlJœƒlI@akU@UWXKVI‚¯Uak@@KmkXWÜkXWykIWwXw@laXamkVUUym_XmlkkmmakwmIUKU@Wak@kaW@kI¯›WIk¦VŽƒUUƒmaUV@XkVUV±aUb¯b¯¥m@@ImJ—@mƒmL@kUKUkkJƒbV¦"],"encodeOffsets":[[110408,29729]]}},{"type":"Feature","id":"500235","properties":{"name":"云阳县","cp":[108.8306,31.0089],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@lb„LV„VVnblJVXXKWbXLVx„l@LmVXVVl‚nLWbnVmxXb°L@bVVkLVVVJn@@X‚‚œ_Wm„kUK@alUšKX@@xWL@VXLVKlLšKXLÆm@™mœa@ml@mU@UUmL@aVšUU¯„U°`lknLlw±@a@wmLVWaXU@KWU@ak@VaU@™IUVmUUwVmUIl¥UwƒUVWUaVUUKVIUa@UUUUJƒUUm™kƒ„nl@„@VWV@L¯aUb™Ulxƒ@@b@VULUx@VUxVV™U@bU@mxU„U@mUVŽklkkƒ@WxknlxK@amLƒKU„K"],"encodeOffsets":[[111016,31742]]}},{"type":"Feature","id":"500101","properties":{"name":"万州区","cp":[108.3911,30.6958],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@ĸĊVI„ƒ„n„aWWXlJVIn@lWš„V„našx°xk„l@²Ž‚LVƒ„LnK@b‚LkwlmXw„@lllkUnVV@VƒnwV@@ašVUUVw@UVwVK@U@a„@kwšVVa°b@KXU@U@ƒmk„ƒÇсaml™kUVmn@VULU˜m@kUVkUaƒwUWm@Uw¯„mKUUmVUUULUKU„W@XbWVkaWwkUU™ƒ™k@maUbmbVlk¦ƒxUVUIWVU„kJVVkL@UmJ™UUVU@lLUVU„lx„@@VbƒJ™U™L¯¤@Vƒ„"],"encodeOffsets":[[110464,31551]]}},{"type":"Feature","id":"500229","properties":{"name":"城口县","cp":[108.7756,31.9098],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@VK@w¯L@m@UÅV@ImVƒU™Vkaƒ@@aUk™J@LƒUUVUKmLmbÅVmUUwUaƒKUL@U™@ƒxJmbm@nVJ@X@VkV‚n™lƒLXx™@ƒb@bUVƒLU`UnƒbU@@ŽmVVX@JX@VLVVšklV—„‚`@bUL@V„LVKn@‚U@„UJkn@lmLmK@X@Jn@mb„nÞWVXnJ‚k„KČÑÆ@VK@knaÜmXlUČW°kôÇƁ@a@yÞ_VmƒUnU@K"],"encodeOffsets":[[111893,32513]]}},{"type":"Feature","id":"500116","properties":{"name":"江津区","cp":[106.2158,28.9874],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@„InWUUlU@LVašlX@°²lÒXxlK@Ul@@Un@UaVJ@I@W@UƒUUVUwVIUKUa‚UUVwn@Üx@XUlnn‚bœJ@¥VklKUUlk@ynU@kVƒUUVWnI@¥V£VWVIUKU@UVƒa@n@Vm@@nlUaVkUwƒJ@blLkLW@XWmXkmmLn™@m@U@UVm@™„UVUUlakUVa„ƒVkV@@wnaWUk@VwkƒlmVIkUUxmJ@U„™@KƒIkx±V@IUm@K@IUKkbWKUbn„m„@bmVnbmb@xkxUJ@ULW`@bX@WVXL@Vƒš¯„mk¯@UJ@VmLUaWnX@WJ@nkKkxW@UIV@@KkImmkK@UW@XaWIU@U‚ƒIkbWb„xXŽlLVbnV@bWlX@VxVLnl@nÆÞVÜ"],"encodeOffsets":[[108585,30032]]}},{"type":"Feature","id":"500240","properties":{"name":"石柱土家族自治县","cp":[108.2813,30.1025],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@„š@kl@š¼UbmVXJ@bV@nxVIVJULVVk@@LWbnJVU@bVbUJ@blLXnWV—@mbnV‚@V„„bn@VJVLnaVanbl@„šVšlVXxlbXUWaX@VƒUUVwUUVm@I@WmI@a„mlLœ™lK@alwnUV@kóVaƒÝk@UlbVK@™VU»VUUVWUƒ@U`ULkwm@@KmU@knKƒ»VkJkUmbƒLkbmK@UUyUU@aƒwm@@XXJ@VVLVVUbVnUJVX@K„„k`WXXJWXUbmW@bkL™Um`Xnƒb@JVL@LU@™°VVXKVnUxVLUbmJ"],"encodeOffsets":[[110588,30769]]}},{"type":"Feature","id":"500237","properties":{"name":"巫山县","cp":[109.8853,31.1188],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@kVƒU™bkKmbVxkLmKkllbV@@LXb„xlašLVšVV„KXXV@@bšVlK„V„@ln@¼°KXa„U@Ulw°JXalIUa„ÝWXW@kVU@ƒVUVWUUUamUw@aVamwn@VUUƒlLXWm£@wÇĉkKklmLUÒ¯ƒWn™@ğ±kwmaWm¼U@@LUV@V@XƒVUnVJ„LWš@‚XXWbĸºVzXJVXV@@VXlWn"],"encodeOffsets":[[112399,31917]]}},{"type":"Feature","id":"500102","properties":{"name":"涪陵区","cp":[107.3364,29.6796],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@nèVblĖVVnLšŽ„@šx‚V„n@nšJ@L„UVVX@lbUJV@@nn@VVVK@z„˜V@nzVJVUlmX@@_VVVbnaVal@@knW@wnaƒVK@aVI„J@£kUVW@‚wXUVJ„amƒ@Ikƒƒƒƒ_X¥ƒ@WwkKkwmŽ™šƒkUxƒnÅmm¥™WV@Um@UlVL@JU@@Xƒ@UVkKVk™KVk™Kkb@bmJVXU„VVUbU@@`W_UV¯b"],"encodeOffsets":[[109508,30207]]}},{"type":"Feature","id":"500230","properties":{"name":"丰都县","cp":[107.8418,29.9048],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@Þè@XUK@LlV@blbUJ@„„V@bnV‚@VVVXU@ƒlbXal@VXnKV@maXUރ@amk@aVKXV‚anbš£°mnIVaUKVwUmWLUUš¯V@@KUK@I„aWmn_šVlK@anXVaXWWIXWl_ƒƒ@LUWVIUmVaUUUK@UWI@Wn@VI@mkU@U¯Kƒl@ImVÅLƒwU¤óbUU@wWXkmm@LU@@VUIWVUL@JUnƒaƒx@Jn„ƒbUIWVx@ŽUXlV@¤ƒIUJ@bUL„Žmb@xmX@lk@UbmbUaUU@`W@kn"],"encodeOffsets":[[110048,30713]]}},{"type":"Feature","id":"500232","properties":{"name":"武隆县","cp":[107.655,29.35],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@l„„w„bVm@IVKXUVJ@UV@@KnnWlX@xVVôaV£„xÆKnUVm@UmIXm¯¯@WkWVwmkXƒlaUwV»ULmk_ƒVkK@ÅWa@aUU@mkaƒIƒb@‚n¼ƒnm‚_@mmK@UƒLUVVmI@aUJ@XWJ@U`UIkm±kk@@lULmUmKUnVšnlUVmI@VkVlx™bkIƒVmLUxkKUŽ‚Xš‚n¦Æn„mVw„lš™nlxlLXx„@W¦„`„„"],"encodeOffsets":[[110262,30291]]}},{"type":"Feature","id":"500119","properties":{"name":"南川区","cp":[107.1716,29.1302],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@VšUbVJVUn@VLX@WVXVVI@VUVWxU@mš@ĊX@@¼V°aVUX`@_V@VaUUVƒUWnI@alašLUlšLUllLVU„@@WV@@IUKVkn@@VlLVwnK„UlJšakwlU@UnJVUmkU™VmXa@wVK@UUw™@VƒVI@akƒ@alInwlKXUmaUW@wWLk™™KVak_ÇaUƒƒV@šXbƒLVxUlWIk@UK@V™@ƒkU@VbUVUlVnƒLUV@lVXmxkV@L@V@Vk@WbUwmL@JUI@xVxkx"],"encodeOffsets":[[109463,29830]]}},{"type":"Feature","id":"500241","properties":{"name":"秀山土家族苗族自治县","cp":[109.0173,28.5205],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@XlV@lzn@VŽnbÆbXKlL„U„ÒV@@llUnxll@zšŽ@LU@@V°b@Vn@š„l@VÑUƒnK@UšU@aUaƒkVm@K¯wƒklmnn„Ul`nI@almkIUwmWVkUaƒkkJmUUa@K@aU@@_m@@wUyVUUa@Umƒ@awl@Wka±„UkUykIWV™b@bUVk@›aU@UXU‚UIWakUWmUxUV@nUVWbšŽ@XXVVŽmXXŽ@VƒbVLkVWx"],"encodeOffsets":[[111330,29183]]}},{"type":"Feature","id":"500114","properties":{"name":"黔江区","cp":[108.7207,29.4708],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@VX@V@LV@VJUL@lVnnxlb@VXV‚XV@@W„@UIVK@kUKna@£VWUaVUUalIVJVIUW„_lm@bXKV@mn@J„UUw@KnIVll@VanLVmUkVKXLVKUIVamw@UaU_lw„KlwUWV_Ua@aUa@KUšwm›_›Ó@wU@™nkK@am@UkUKmXk`m@@I@K@I@mkVmIUxUJ@kUL@JVV™„lnklWnn`VzUVnlWbkb@WxXxlJXzWŽÛlWXnl@Ll@Vb°UJWLX@VlV@bkJ"],"encodeOffsets":[[111106,30420]]}},{"type":"Feature","id":"500117","properties":{"name":"合川区","cp":[106.3257,30.108],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@XKVXlK„ƒVL@UnV@aValXXK„U@WVwUaVU@IV@@aVW„L@U@anVV@@bVK@UVL@bnJWL@VnUnb˜@@JnIlVl‚@@bXIWbn@UKVLVKXLlaV@VVnK@bVL„m„IVƒ@KmknUUWVI@aVJ@_„WU_VmUwƒU@K™ƒVak@am¯mJU_UJUkU@WkIV`UI@JV@LmmU@@mƒbUzś™@„VK@nUKƒ„ƒb™akb@UWK@bkVVbV„Û@@`ƒXk@WŽ@n@lXL@bmb@VVJUn@JnUlnUlmX@`XLlbkJW@kzlb@`@b@b"],"encodeOffsets":[[108529,31101]]}},{"type":"Feature","id":"500222","properties":{"name":"綦江县","cp":[106.6553,28.8171],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@@¦‚@X„lVX@@UVKl„VUX@lanVlUVbXWVXVƒ„VVUnKVUlwUwU@UJ@nmVkUV™lwXam@VaUUUw@W@kk»mV@UmKkwVKVUU@@LUKVI@mV@XVWxnXVKUUUK@wWU@UUWnUlLXa‚mUI„am@wI@K@amIm‚UUkI@m‚akUkKWUUanƒ@wƒamLVxk@UVmUUL@Vm@kV@I@ak@@bWVXJlLVbVL@š@bn@@`Un„@WbUKULWVXbƒ@UVmbX„WVƒb@bVmxUKUƒV@šUn@V@V@nmšnKlnnWWXX@lKkK@a„IVxUlVb‚k@mn@@U@m„bVUV@VLUJUXU¤"],"encodeOffsets":[[109137,29779]]}},{"type":"Feature","id":"500233","properties":{"name":"忠县","cp":[107.8967,30.3223],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@VLÞĊ„U@Wš@¼V‚„@lk@w²mlšVUœ„llšVnI@VlKUUlIVƒXUVJVU„wl¥UkUKUIm@ƒaUƒ@mUna˜@XUWmkK@aVIUa@aUVmIXa@Kl@UUVKUIUJmwU@@aWInUVa™»k@@lƒ™¯n™¤mabWUUL@bnl@b݄WVnbU@mLUWk@Wbka@„WVUU@UmUmVkUULV„lVUx„l@L@VƒbÈÒlb"],"encodeOffsets":[[110239,31146]]}},{"type":"Feature","id":"500228","properties":{"name":"梁平县","cp":[107.7429,30.6519],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@XLV@VV@b°°nšƒnkb@bƒšnJWVXblIUVšxWnUJnVVLVU„JlUnLVK@UnUVJš²nKVbVKla@aXlJ„k„Klb„ƒ@U°£šKšV„IUa@ƒ@kwVƒVUkKV@VUkk›ƒUVk™±n@xklƒ@U@»™‚@XƒVÝĉUJnxWb@UX›KkVUbUKWUkVmkkLU`›b"],"encodeOffsets":[[109980,31247]]}},{"type":"Feature","id":"500113","properties":{"name":"巴南区","cp":[106.7322,29.4214],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@nxnVlJlUXLƒ¦@x@Vl@nKVVX@V_V@@KlVXU„@lKlxXIl@ÈĊ@Vl@n_VJlŽnVlnb„²VVVJVVmUUkĕUamçU@»W@@ĉn™V@XwVU@UUJWUXUW@UKm@UVUIVaU™UVmLUVƒUU„UWWXUakVmUkbW@UVkƒUL@VW@kUWƒ@mJUXVVU„@lmV@zklVVkLUl@¦›I"],"encodeOffsets":[[108990,30061]]}},{"type":"Feature","id":"500223","properties":{"name":"潼南县","cp":[105.7764,30.1135],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@@a@a@_kalyX@lIkaWK@_nWVkkmmV@IVmUI@Una@aWK@k@mkbWaknmJUk@mk@@kUal@Uaš@Wa@aXLlwUKlkkƒ@KmI@VUJ@Lk@@VUUmL@amJU£kKUaWakLmU@bVVUbnbWV@xkL@bUb‚xUxVbXJVbUVWIUVU@kLWxkKWV@n¯VUbU@@VVX@VmaUL@VUK@VVbn@lVnI‚@@lnLULm@Ub@Žl@na„@lK@XVVkJ@b@zl@@VnV@bVb@J@bnXV`lXXmVI@W@InbV@@aVKUblKVLUanLlmnLlK"],"encodeOffsets":[[108529,31101]]}},{"type":"Feature","id":"500118","properties":{"name":"永川区","cp":[105.8643,29.2566],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@@b܄nWVLX„lxV„VxXxlVn@@bVblK@a@UnLVJV@@UnLVU@VXaVKVXš@n`WUÿ@IUKlaUUUkWyUÛÅÝ@mmkUKUwW@Xk@amUUakKWƒwXaƒK@VVLklƒXVlkxV„UL@bm@Vxn`ƒIVxUVkLVšUšl@@lkXmmƒVUn@VV@Xb"],"encodeOffsets":[[108192,30038]]}},{"type":"Feature","id":"500231","properties":{"name":"垫江县","cp":[107.4573,30.2454],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@šĊ°¤nҘ¼œaV_lKnllUXVVLValUœLVW‚@XamwVIUKkaÇфa@U@KƒkVwkUUƒVKlVnU@aƒU@ƒVIka@akU@KVL@WÝçUV@Vmbů@L™KƒnnJW„ƒVkxlL@VX@VxmnXVWxUb@bkn"],"encodeOffsets":[[109812,30961]]}},{"type":"Feature","id":"500112","properties":{"name":"渝北区","cp":[106.7212,29.8499],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@@bVVXL‚a@lnbWn@L„@XVlK@VVLUVlbkLUKVVVL@VšnX‚VL@VV@UbVb@x@¦UxVb@bUJƒL@L„VVxlK@™nk@U@W„UVLlKXV„@VblU@UUKVU@wn@VJVanLlkX@VaVK™¯@a@U@U@ƒVaUK„kUUƒ±maUkm@UUkbm@@Vk@@JƒwU@Ub@I@JmwUL@aƒ@@KkVÇLkƒWkƒ@kUU@@xUVmKUnllUb"],"encodeOffsets":[[109013,30381]]}},{"type":"Feature","id":"500115","properties":{"name":"长寿区","cp":[107.1606,29.9762],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@VVšU„bX‚lX„¥l@XnVmlxUx„@@blVnnôĀlm@aVaXwWUnmUwW@@UkKlw„UXƒmI„mšL@KÆ°na@UUImyU@ƒ—@yULUUm@@mU@VIkaW@UUƒV@K™I@mƒmU™wƒ@™mKUnU‚UIƒlVLUb@„@V@V@bš°ULUbW@klmKUbUIm@@xUVVL"],"encodeOffsets":[[109429,30747]]}},{"type":"Feature","id":"500225","properties":{"name":"大足县","cp":[105.7544,29.6136],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@XUmaVaUU@anVlKXbValU@aV@@IXKš@@bV@VxVK@UXLlUšJXa@_‚@@aVK—ÅWVkwWaƒƒwUa@am@kUWLU@kWmX@ykI@W@UV@na@LlLV@UƒkwWƒUKmXX`mIVl@bXLWVkbkkƒx@`VXm@@J@U@UUKUxk@WbUIVl@VXLW„ƒJUkUlUImxXlmb@X@VUJUnVbšW@UV@@VVX@bnW@LVxUnlJUV@n„@VxVIn@l`„UVVVL"],"encodeOffsets":[[108270,30578]]}},{"type":"Feature","id":"500224","properties":{"name":"铜梁县","cp":[106.0291,29.8059],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@VblLV¤nI@bnKVV@Ul@@KVI@UnJ@Ll„klVLkxWK@bXb™@Vbk@Vb@ll@@nVlnIlmXblaXl@„W@_Ü@UƒUalU@aXL@Vlašb„a„ƒVL@mUL@ƒUUƒƒÇXUW›X_WaƒƒUƒ»m_™@UWULWb@UUVmK@VU@UImK@V@bkL„x‚„XblxXU˜ÆUL@b@@`Wb™IkVWK@VULUwU@@a™@WL@JU@@bkVUb"],"encodeOffsets":[[108316,30527]]}},{"type":"Feature","id":"500226","properties":{"name":"荣昌县","cp":[105.5127,29.4708],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@VI@U@WnaWknwVJVkVl„IXƒWK@UUkVJXal@VwVL@V@V@In@UW@_„wlllaXUWK@aUknJW_ۃ@aWaU@@UVm„UUaUImJVnÅUmVUm`kUUVWLnVU@VVmXƒK@„nxmŽULkx™ImJ@nU`@X@Vkn@`@nlV@nVJVaX„VLnK@bVV@nV@lbXWš@"],"encodeOffsets":[[108012,30392]]}},{"type":"Feature","id":"500227","properties":{"name":"璧山县","cp":[106.2048,29.5807],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@XzVlVVkbVL@JVĀXŽ‚¼V„„„XbW`XœWVȎ„„VVšŽVkV@@UXa@alK@IƒƒU@UKWUyUI@wVUUWVak@VUkƒW¹@WXI@yVIUK@kWwkѯ±W@™kUb@KkVVVmXƒJ"],"encodeOffsets":[[108585,30032]]}},{"type":"Feature","id":"500109","properties":{"name":"北碚区","cp":[106.5674,29.8883],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@X‚VLV@„„@JkL@bWb@VU@UlƜVy„a@nV@nn@KU@IVJU_lJXV@VlVIV`nIn°@b‚lUbš„„KVI@aUaVw@¥@wUaVaU@@UUKW™m@UUKUUVLlKkaVUUK@UkLWUƒ@@KXmma@kbWKUU@aUamLnÞ@VWLk@@Wm@ULU@@U™KUVWI"],"encodeOffsets":[[108855,30449]]}},{"type":"Feature","id":"500110","properties":{"name":"万盛区","cp":[106.908,28.9325],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@VIV@@wVJ@InKVxXal@@U@U@KlUnwUW@kVU„KUmVkUa@I@KW@@bk@@mƒU@m@k@a@aƒIUxmJk@ƒwULƒwkKmVVX@VXV@xVLVVULmWXwWUU@@nUJVL@KV@UVULlxnL@VnUl¼@l@XVxVVUbn@WbkxUšlVnU@m"],"encodeOffsets":[[109452,29779]]}},{"type":"Feature","id":"500107","properties":{"name":"九龙坡区","cp":[106.3586,29.4049],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@XK‚L@Vš@XbV@lW@UV@@VXIV@U™VKlL@KnnJ@VV@VU@I„@@mVUVWUUmL@V¯LUK@UV@UU@a@U@yU@WLUK@X@KUVmL@ƒ@aXI@w@ammVk@WÛwm@UxVVVbVLUJVxVU„V@V@X@JUIVbm@@Vk@@VkL@lVLUJ@zWJ@X"],"encodeOffsets":[[108799,30241]]}},{"type":"Feature","id":"500106","properties":{"name":"沙坪坝区","cp":[106.3696,29.6191],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@Xºl„UVl@UbVXUV@xVJVzXJVUšL@VV@VKn@@Xl@XK@UmÝnKVbVakkVm@k„ƒUK@UmIm@LkKULVšU@WJ@UU@@VkXU@Wa™@@UKWL"],"encodeOffsets":[[108799,30241]]}},{"type":"Feature","id":"500108","properties":{"name":"南岸区","cp":[106.6663,29.5367],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@VV„JVL@bUVVnl`XIlwXJlw°nnl‚IXW@UÇĉk@WJkwkLƒ@WVkU@LU@U`W@UXUV@n"],"encodeOffsets":[[109092,30241]]}},{"type":"Feature","id":"500105","properties":{"name":"江北区","cp":[106.8311,29.6191],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@nLVU@wV@lV„@Xll„ÈKlU@L„@@bVKnx@I@JVaV@„x@Il@@Un@laVVn@mkUIm`k@WXJmk¯mkxWIkxWJk_UmVUUKƒ@UU™@ƒ„@l"],"encodeOffsets":[[109013,30319]]}},{"type":"Feature","id":"500104","properties":{"name":"大渡口区","cp":[106.4905,29.4214],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@k@@U@w„¥WKkVkImUmwa@b@xWJ@b@„nKVU@L@WVLXKV@@z@V@bVVU@@VVL°K@U"],"encodeOffsets":[[109080,30190]]}},{"type":"Feature","id":"500111","properties":{"name":"双桥区","cp":[105.7874,29.4928],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@WwUwU@kK@KmbU@@V@XlJ@znWlXV@XK"],"encodeOffsets":[[108372,30235]]}},{"type":"Feature","id":"500103","properties":{"name":"渝中区","cp":[106.5344,29.5477],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@VLš@VV„@VL@aUKƒIUUƒ@@JUVU@"],"encodeOffsets":[[109036,30257]]}}],"UTF8Encoding":true}; +define('echarts/util/mapData/geoJson/chong_qing_geo',[],function() { + return {"type":"FeatureCollection","features":[{"type":"Feature","id":"500242","properties":{"name":"酉阳土家族苗族自治县","cp":[108.8196,28.8666],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@XJ°œlJX@lbl@XbV@VLnJlxnbšƒUU@IVK@lVIVwnJlU@n@J@L@Jn@l_nWVLVln@@blLšmV@@xœÔ‚`nœ™xV‚ÈLlx„LVxVVšƒV_U»VWn_m¥XwVmnX°ƒlmUUVwÞaVƒk@a@mmIUa@™mwk@™ƒm@@U¯a@UV@@K™@ykkmwkV@kU@ƒÑƒVkKWLÅamaUm@kyU@WkU@Ua™IUašVaUUmUUa@aVLXKWa¯UUbmJXnWnX`l@@xkzWÆ@V„LU¦‚x@b@JkIkJ@LmbUamJwm@óxƒnk@V„@x„ŽVnUVmVUVŽUbVlUbkXWŽ"],"encodeOffsets":[[110914,29695]]}},{"type":"Feature","id":"500236","properties":{"name":"奉节县","cp":[109.3909,30.9265],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@WVXb‚UnK@x@b‚²kxmKkl¯_ƒVV°™VU@bnKVVV@@nkŽ@n›bn‚@š°@VLČUš@°WV@V™nU@InKVl@nU„b˜KnX„WlknLlKUwnalLša„VlUXmWk@UU@UWWIUyķ¹XaWW@X™ƒKUIVm„U@W@UVU@KV@n»VkUkÇmUmVIUmULUbm@ƒwUaƒKkkm¯ÑUL@bWVnx@VmxUI@„klmkkK@aƒK@IlJ@I¯ƒk@mak@mnkJVL@bV@Ub„„W`UUUV™I@VƒU@VVbUJVLUVVbUX„VVxk¦VJUnVxnVVUšJV@Ubl@@bXV@L"],"encodeOffsets":[[111781,31658]]}},{"type":"Feature","id":"500238","properties":{"name":"巫溪县","cp":[109.3359,31.4813],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@nLWbX‚VLVU„V@KšIVl@b„@lbšU„VnU@JÆU@V@n°KĢUl@VbÞKšVš@„_„V‚KXU‚U@KXƒ@wlkkU@mWKUU@UôJ@XV@œaVmÞIVaVLƒƒ@»kmƒ@ƒUkL™U@aU@WWƒLUUU™™KkbƒwWa@KU@kaƒXmW—LƒamVk@UmL@JmVUšU@¯X™@ċVUK¯@ÅnWK™LkKULWK@UXK@wW@™LkV@bVLƒlXn›`¯xU„°LnŽlV@n°Lnl"],"encodeOffsets":[[111488,32361]]}},{"type":"Feature","id":"500234","properties":{"name":"开县","cp":[108.4131,31.2561],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@n@na‚I„wš@@VVK„LVbVxnVÆUnanKWXamKmk¯K@mkUm¯KVƒ°w@Wm@UIUUlKUU@a¯KWanwmUXamKkUWUnU@KƒkUwWKXaWLUWkImaUUUƒƒKka±k@lƒ¯w™wmbUƒ™ƒkXm@UJkIW‚XXƒbƒmƒ„UJ™XUV@°šKlšlVXV@xmbnV@blV@VšœU`UL@V™a@bULlb°VXbܚ@V@bƒL@J„xnLVb@lVb@V@@z˜bXWšX„KVLV‚š@@bUVVL@b„„lVna@ll@„zl@@J"],"encodeOffsets":[[111150,32434]]}},{"type":"Feature","id":"500243","properties":{"name":"彭水苗族土家族自治县","cp":[108.2043,29.3994],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@„Jlb@nVV@bXb@ÆlL„Ul`nVKU¼VxkbW„nlUxlXX‚@°°WnnJ@VUn@J„k°L@VlV@nUJ„x@bVVVz@VnLla„KnalVlIUŽ„¼@nV@@anKUwVal@UlJœƒlI@akU@UWXKVI‚¯Uak@@KmkXWÜkXWykIWwXw@laXamkVUUym_XmlkkmmakwmIUKU@Wak@kaW@kI¯›WIk¦VŽƒUUƒmaUV@XkVUV±aUb¯b¯¥m@@ImJ—@mƒmL@kUKUkkJƒbV¦"],"encodeOffsets":[[110408,29729]]}},{"type":"Feature","id":"500235","properties":{"name":"云阳县","cp":[108.8306,31.0089],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@lb„LV„VVnblJVXXKWbXLVx„l@LmVXVVl‚nLWbnVmxXb°L@bVVkLVVVJn@@X‚‚œ_Wm„kUK@alUšKX@@xWL@VXLVKlLšKXLÆm@™mœa@ml@mU@UUmL@aVšUU¯„U°`lknLlw±@a@wmLVWaXU@KWU@ak@VaU@™IUVmUUwVmUIl¥UwƒUVWUaVUUKVIUa@UUUUJƒUUm™kƒ„nl@„@VWV@L¯aUb™Ulxƒ@@b@VULUx@VUxVV™U@bU@mxU„U@mUVŽklkkƒ@WxknlxK@amLƒKU„K"],"encodeOffsets":[[111016,31742]]}},{"type":"Feature","id":"500101","properties":{"name":"万州区","cp":[108.3911,30.6958],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@ĸĊVI„ƒ„n„aWWXlJVIn@lWš„V„našx°xk„l@²Ž‚LVƒ„LnK@b‚LkwlmXw„@lllkUnVV@VƒnwV@@ašVUUVw@UVwVK@U@a„@kwšVVa°b@KXU@U@ƒmk„ƒÇсaml™kUVmn@VULU˜m@kUVkUaƒwUWm@Uw¯„mKUUmVUUULUKU„W@XbWVkaWwkUU™ƒ™k@maUbmbVlk¦ƒxUVUIWVU„kJVVkL@UmJ™UUVU@lLUVU„lx„@@VbƒJ™U™L¯¤@Vƒ„"],"encodeOffsets":[[110464,31551]]}},{"type":"Feature","id":"500229","properties":{"name":"城口县","cp":[108.7756,31.9098],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@VK@w¯L@m@UÅV@ImVƒU™Vkaƒ@@aUk™J@LƒUUVUKmLmbÅVmUUwUaƒKUL@U™@ƒxJmbm@nVJ@X@VkV‚n™lƒLXx™@ƒb@bUVƒLU`UnƒbU@@ŽmVVX@JX@VLVVšklV—„‚`@bUL@V„LVKn@‚U@„UJkn@lmLmK@X@Jn@mb„nÞWVXnJ‚k„KČÑÆ@VK@knaÜmXlUČW°kôÇƁ@a@yÞ_VmƒUnU@K"],"encodeOffsets":[[111893,32513]]}},{"type":"Feature","id":"500116","properties":{"name":"江津区","cp":[106.2158,28.9874],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@„InWUUlU@LVašlX@°²lÒXxlK@Ul@@Un@UaVJ@I@W@UƒUUVUwVIUKUa‚UUVwn@Üx@XUlnn‚bœJ@¥VklKUUlk@ynU@kVƒUUVWnI@¥V£VWVIUKU@UVƒa@n@Vm@@nlUaVkUwƒJ@blLkLW@XWmXkmmLn™@m@U@UVm@™„UVUUlakUVa„ƒVkV@@wnaWUk@VwkƒlmVIkUUxmJ@U„™@KƒIkx±V@IUm@K@IUKkbWKUbn„m„@bmVnbmb@xkxUJ@ULW`@bX@WVXL@Vƒš¯„mk¯@UJ@VmLUaWnX@WJ@nkKkxW@UIV@@KkImmkK@UW@XaWIU@U‚ƒIkbWb„xXŽlLVbnV@bWlX@VxVLnl@nÆÞVÜ"],"encodeOffsets":[[108585,30032]]}},{"type":"Feature","id":"500240","properties":{"name":"石柱土家族自治县","cp":[108.2813,30.1025],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@„š@kl@š¼UbmVXJ@bV@nxVIVJULVVk@@LWbnJVU@bVbUJ@blLXnWV—@mbnV‚@V„„bn@VJVLnaVanbl@„šVšlVXxlbXUWaX@VƒUUVwUUVm@I@WmI@a„mlLœ™lK@alwnUV@kóVaƒÝk@UlbVK@™VU»VUUVWUƒ@U`ULkwm@@KmU@knKƒ»VkJkUmbƒLkbmK@UUyUU@aƒwm@@XXJ@VVLVVUbVnUJVX@K„„k`WXXJWXUbmW@bkL™Um`Xnƒb@JVL@LU@™°VVXKVnUxVLUbmJ"],"encodeOffsets":[[110588,30769]]}},{"type":"Feature","id":"500237","properties":{"name":"巫山县","cp":[109.8853,31.1188],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@kVƒU™bkKmbVxkLmKkllbV@@LXb„xlašLVšVV„KXXV@@bšVlK„V„@ln@¼°KXa„U@Ulw°JXalIUa„ÝWXW@kVU@ƒVUVWUUUamUw@aVamwn@VUUƒlLXWm£@wÇĉkKklmLUÒ¯ƒWn™@ğ±kwmaWm¼U@@LUV@V@XƒVUnVJ„LWš@‚XXWbĸºVzXJVXV@@VXlWn"],"encodeOffsets":[[112399,31917]]}},{"type":"Feature","id":"500102","properties":{"name":"涪陵区","cp":[107.3364,29.6796],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@nèVblĖVVnLšŽ„@šx‚V„n@nšJ@L„UVVX@lbUJV@@nn@VVVK@z„˜V@nzVJVUlmX@@_VVVbnaVal@@knW@wnaƒVK@aVI„J@£kUVW@‚wXUVJ„amƒ@Ikƒƒƒƒ_X¥ƒ@WwkKkwmŽ™šƒkUxƒnÅmm¥™WV@Um@UlVL@JU@@Xƒ@UVkKVk™KVk™Kkb@bmJVXU„VVUbU@@`W_UV¯b"],"encodeOffsets":[[109508,30207]]}},{"type":"Feature","id":"500230","properties":{"name":"丰都县","cp":[107.8418,29.9048],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@Þè@XUK@LlV@blbUJ@„„V@bnV‚@VVVXU@ƒlbXal@VXnKV@maXUރ@amk@aVKXV‚anbš£°mnIVaUKVwUmWLUUš¯V@@KUK@I„aWmn_šVlK@anXVaXWWIXWl_ƒƒ@LUWVIUmVaUUUK@UWI@Wn@VI@mkU@U¯Kƒl@ImVÅLƒwU¤óbUU@wWXkmm@LU@@VUIWVUL@JUnƒaƒx@Jn„ƒbUIWVx@ŽUXlV@¤ƒIUJ@bUL„Žmb@xmX@lk@UbmbUaUU@`W@kn"],"encodeOffsets":[[110048,30713]]}},{"type":"Feature","id":"500232","properties":{"name":"武隆县","cp":[107.655,29.35],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@l„„w„bVm@IVKXUVJ@UV@@KnnWlX@xVVôaV£„xÆKnUVm@UmIXm¯¯@WkWVwmkXƒlaUwV»ULmk_ƒVkK@ÅWa@aUU@mkaƒIƒb@‚n¼ƒnm‚_@mmK@UƒLUVVmI@aUJ@XWJ@U`UIkm±kk@@lULmUmKUnVšnlUVmI@VkVlx™bkIƒVmLUxkKUŽ‚Xš‚n¦Æn„mVw„lš™nlxlLXx„@W¦„`„„"],"encodeOffsets":[[110262,30291]]}},{"type":"Feature","id":"500119","properties":{"name":"南川区","cp":[107.1716,29.1302],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@VšUbVJVUn@VLX@WVXVVI@VUVWxU@mš@ĊX@@¼V°aVUX`@_V@VaUUVƒUWnI@alašLUlšLUllLVU„@@WV@@IUKVkn@@VlLVwnK„UlJšakwlU@UnJVUmkU™VmXa@wVK@UUw™@VƒVI@akƒ@alInwlKXUmaUW@wWLk™™KVak_ÇaUƒƒV@šXbƒLVxUlWIk@UK@V™@ƒkU@VbUVUlVnƒLUV@lVXmxkV@L@V@Vk@WbUwmL@JUI@xVxkx"],"encodeOffsets":[[109463,29830]]}},{"type":"Feature","id":"500241","properties":{"name":"秀山土家族苗族自治县","cp":[109.0173,28.5205],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@XlV@lzn@VŽnbÆbXKlL„U„ÒV@@llUnxll@zšŽ@LU@@V°b@Vn@š„l@VÑUƒnK@UšU@aUaƒkVm@K¯wƒklmnn„Ul`nI@almkIUwmWVkUaƒkkJmUUa@K@aU@@_m@@wUyVUUa@Umƒ@awl@Wka±„UkUykIWV™b@bUVk@›aU@UXU‚UIWakUWmUxUV@nUVWbšŽ@XXVVŽmXXŽ@VƒbVLkVWx"],"encodeOffsets":[[111330,29183]]}},{"type":"Feature","id":"500114","properties":{"name":"黔江区","cp":[108.7207,29.4708],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@VX@V@LV@VJUL@lVnnxlb@VXV‚XV@@W„@UIVK@kUKna@£VWUaVUUalIVJVIUW„_lm@bXKV@mn@J„UUw@KnIVll@VanLVmUkVKXLVKUIVamw@UaU_lw„KlwUWV_Ua@aUa@KUšwm›_›Ó@wU@™nkK@am@UkUKmXk`m@@I@K@I@mkVmIUxUJ@kUL@JVV™„lnklWnn`VzUVnlWbkb@WxXxlJXzWŽÛlWXnl@Ll@Vb°UJWLX@VlV@bkJ"],"encodeOffsets":[[111106,30420]]}},{"type":"Feature","id":"500117","properties":{"name":"合川区","cp":[106.3257,30.108],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@XKVXlK„ƒVL@UnV@aValXXK„U@WVwUaVU@IV@@aVW„L@U@anVV@@bVK@UVL@bnJWL@VnUnb˜@@JnIlVl‚@@bXIWbn@UKVLVKXLlaV@VVnK@bVL„m„IVƒ@KmknUUWVI@aVJ@_„WU_VmUwƒU@K™ƒVak@am¯mJU_UJUkU@WkIV`UI@JV@LmmU@@mƒbUzś™@„VK@nUKƒ„ƒb™akb@UWK@bkVVbV„Û@@`ƒXk@WŽ@n@lXL@bmb@VVJUn@JnUlnUlmX@`XLlbkJW@kzlb@`@b@b"],"encodeOffsets":[[108529,31101]]}},{"type":"Feature","id":"500222","properties":{"name":"綦江县","cp":[106.6553,28.8171],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@@¦‚@X„lVX@@UVKl„VUX@lanVlUVbXWVXVƒ„VVUnKVUlwUwU@UJ@nmVkUV™lwXam@VaUUUw@W@kk»mV@UmKkwVKVUU@@LUKVI@mV@XVWxnXVKUUUK@wWU@UUWnUlLXa‚mUI„am@wI@K@amIm‚UUkI@m‚akUkKWUUanƒ@wƒamLVxk@UVmUUL@Vm@kV@I@ak@@bWVXJlLVbVL@š@bn@@`Un„@WbUKULWVXbƒ@UVmbX„WVƒb@bVmxUKUƒV@šUn@V@V@nmšnKlnnWWXX@lKkK@a„IVxUlVb‚k@mn@@U@m„bVUV@VLUJUXU¤"],"encodeOffsets":[[109137,29779]]}},{"type":"Feature","id":"500233","properties":{"name":"忠县","cp":[107.8967,30.3223],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@VLÞĊ„U@Wš@¼V‚„@lk@w²mlšVUœ„llšVnI@VlKUUlIVƒXUVJVU„wl¥UkUKUIm@ƒaUƒ@mUna˜@XUWmkK@aVIUa@aUVmIXa@Kl@UUVKUIUJmwU@@aWInUVa™»k@@lƒ™¯n™¤mabWUUL@bnl@b݄WVnbU@mLUWk@Wbka@„WVUU@UmUmVkUULV„lVUx„l@L@VƒbÈÒlb"],"encodeOffsets":[[110239,31146]]}},{"type":"Feature","id":"500228","properties":{"name":"梁平县","cp":[107.7429,30.6519],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@XLV@VV@b°°nšƒnkb@bƒšnJWVXblIUVšxWnUJnVVLVU„JlUnLVK@UnUVJš²nKVbVKla@aXlJ„k„Klb„ƒ@U°£šKšV„IUa@ƒ@kwVƒVUkKV@VUkk›ƒUVk™±n@xklƒ@U@»™‚@XƒVÝĉUJnxWb@UX›KkVUbUKWUkVmkkLU`›b"],"encodeOffsets":[[109980,31247]]}},{"type":"Feature","id":"500113","properties":{"name":"巴南区","cp":[106.7322,29.4214],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@nxnVlJlUXLƒ¦@x@Vl@nKVVX@V_V@@KlVXU„@lKlxXIl@ÈĊ@Vl@n_VJlŽnVlnb„²VVVJVVmUUkĕUamçU@»W@@ĉn™V@XwVU@UUJWUXUW@UKm@UVUIVaU™UVmLUVƒUU„UWWXUakVmUkbW@UVkƒUL@VW@kUWƒ@mJUXVVU„@lmV@zklVVkLUl@¦›I"],"encodeOffsets":[[108990,30061]]}},{"type":"Feature","id":"500223","properties":{"name":"潼南县","cp":[105.7764,30.1135],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@@a@a@_kalyX@lIkaWK@_nWVkkmmV@IVmUI@Una@aWK@k@mkbWaknmJUk@mk@@kUal@Uaš@Wa@aXLlwUKlkkƒ@KmI@VUJ@Lk@@VUUmL@amJU£kKUaWakLmU@bVVUbnbWV@xkL@bUb‚xUxVbXJVbUVWIUVU@kLWxkKWV@n¯VUbU@@VVX@VmaUL@VUK@VVbn@lVnI‚@@lnLULm@Ub@Žl@na„@lK@XVVkJ@b@zl@@VnV@bVb@J@bnXV`lXXmVI@W@InbV@@aVKUblKVLUanLlmnLlK"],"encodeOffsets":[[108529,31101]]}},{"type":"Feature","id":"500118","properties":{"name":"永川区","cp":[105.8643,29.2566],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@@b܄nWVLX„lxV„VxXxlVn@@bVblK@a@UnLVJV@@UnLVU@VXaVKVXš@n`WUÿ@IUKlaUUUkWyUÛÅÝ@mmkUKUwW@Xk@amUUakKWƒwXaƒK@VVLklƒXVlkxV„UL@bm@Vxn`ƒIVxUVkLVšUšl@@lkXmmƒVUn@VV@Xb"],"encodeOffsets":[[108192,30038]]}},{"type":"Feature","id":"500231","properties":{"name":"垫江县","cp":[107.4573,30.2454],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@šĊ°¤nҘ¼œaV_lKnllUXVVLValUœLVW‚@XamwVIUKkaÇфa@U@KƒkVwkUUƒVKlVnU@aƒU@ƒVIka@akU@KVL@WÝçUV@Vmbů@L™KƒnnJW„ƒVkxlL@VX@VxmnXVWxUb@bkn"],"encodeOffsets":[[109812,30961]]}},{"type":"Feature","id":"500112","properties":{"name":"渝北区","cp":[106.7212,29.8499],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@@bVVXL‚a@lnbWn@L„@XVlK@VVLUVlbkLUKVVVL@VšnX‚VL@VV@UbVb@x@¦UxVb@bUJƒL@L„VVxlK@™nk@U@W„UVLlKXV„@VblU@UUKVU@wn@VJVanLlkX@VaVK™¯@a@U@U@ƒVaUK„kUUƒ±maUkm@UUkbm@@Vk@@JƒwU@Ub@I@JmwUL@aƒ@@KkVÇLkƒWkƒ@kUU@@xUVmKUnllUb"],"encodeOffsets":[[109013,30381]]}},{"type":"Feature","id":"500115","properties":{"name":"长寿区","cp":[107.1606,29.9762],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@VVšU„bX‚lX„¥l@XnVmlxUx„@@blVnnôĀlm@aVaXwWUnmUwW@@UkKlw„UXƒmI„mšL@KÆ°na@UUImyU@ƒ—@yULUUm@@mU@VIkaW@UUƒV@K™I@mƒmU™wƒ@™mKUnU‚UIƒlVLUb@„@V@V@bš°ULUbW@klmKUbUIm@@xUVVL"],"encodeOffsets":[[109429,30747]]}},{"type":"Feature","id":"500225","properties":{"name":"大足县","cp":[105.7544,29.6136],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@XUmaVaUU@anVlKXbValU@aV@@IXKš@@bV@VxVK@UXLlUšJXa@_‚@@aVK—ÅWVkwWaƒƒwUa@am@kUWLU@kWmX@ykI@W@UV@na@LlLV@UƒkwWƒUKmXX`mIVl@bXLWVkbkkƒx@`VXm@@J@U@UUKUxk@WbUIVl@VXLW„ƒJUkUlUImxXlmb@X@VUJUnVbšW@UV@@VVX@bnW@LVxUnlJUV@n„@VxVIn@l`„UVVVL"],"encodeOffsets":[[108270,30578]]}},{"type":"Feature","id":"500224","properties":{"name":"铜梁县","cp":[106.0291,29.8059],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@VblLV¤nI@bnKVV@Ul@@KVI@UnJ@Ll„klVLkxWK@bXb™@Vbk@Vb@ll@@nVlnIlmXblaXl@„W@_Ü@UƒUalU@aXL@Vlašb„a„ƒVL@mUL@ƒUUƒƒÇXUW›X_WaƒƒUƒ»m_™@UWULWb@UUVmK@VU@UImK@V@bkL„x‚„XblxXU˜ÆUL@b@@`Wb™IkVWK@VULUwU@@a™@WL@JU@@bkVUb"],"encodeOffsets":[[108316,30527]]}},{"type":"Feature","id":"500226","properties":{"name":"荣昌县","cp":[105.5127,29.4708],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@VI@U@WnaWknwVJVkVl„IXƒWK@UUkVJXal@VwVL@V@V@In@UW@_„wlllaXUWK@aUknJW_ۃ@aWaU@@UVm„UUaUImJVnÅUmVUm`kUUVWLnVU@VVmXƒK@„nxmŽULkx™ImJ@nU`@X@Vkn@`@nlV@nVJVaX„VLnK@bVV@nV@lbXWš@"],"encodeOffsets":[[108012,30392]]}},{"type":"Feature","id":"500227","properties":{"name":"璧山县","cp":[106.2048,29.5807],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@XzVlVVkbVL@JVĀXŽ‚¼V„„„XbW`XœWVȎ„„VVšŽVkV@@UXa@alK@IƒƒU@UKWUyUI@wVUUWVak@VUkƒW¹@WXI@yVIUK@kWwkѯ±W@™kUb@KkVVVmXƒJ"],"encodeOffsets":[[108585,30032]]}},{"type":"Feature","id":"500109","properties":{"name":"北碚区","cp":[106.5674,29.8883],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@X‚VLV@„„@JkL@bWb@VU@UlƜVy„a@nV@nn@KU@IVJU_lJXV@VlVIV`nIn°@b‚lUbš„„KVI@aUaVw@¥@wUaVaU@@UUKW™m@UUKUUVLlKkaVUUK@UkLWUƒ@@KXmma@kbWKUU@aUamLnÞ@VWLk@@Wm@ULU@@U™KUVWI"],"encodeOffsets":[[108855,30449]]}},{"type":"Feature","id":"500110","properties":{"name":"万盛区","cp":[106.908,28.9325],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@VIV@@wVJ@InKVxXal@@U@U@KlUnwUW@kVU„KUmVkUa@I@KW@@bk@@mƒU@m@k@a@aƒIUxmJk@ƒwULƒwkKmVVX@VXV@xVLVVULmWXwWUU@@nUJVL@KV@UVULlxnL@VnUl¼@l@XVxVVUbn@WbkxUšlVnU@m"],"encodeOffsets":[[109452,29779]]}},{"type":"Feature","id":"500107","properties":{"name":"九龙坡区","cp":[106.3586,29.4049],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@XK‚L@Vš@XbV@lW@UV@@VXIV@U™VKlL@KnnJ@VV@VU@I„@@mVUVWUUmL@V¯LUK@UV@UU@a@U@yU@WLUK@X@KUVmL@ƒ@aXI@w@ammVk@WÛwm@UxVVVbVLUJVxVU„V@V@X@JUIVbm@@Vk@@VkL@lVLUJ@zWJ@X"],"encodeOffsets":[[108799,30241]]}},{"type":"Feature","id":"500106","properties":{"name":"沙坪坝区","cp":[106.3696,29.6191],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@Xºl„UVl@UbVXUV@xVJVzXJVUšL@VV@VKn@@Xl@XK@UmÝnKVbVakkVm@k„ƒUK@UmIm@LkKULVšU@WJ@UU@@VkXU@Wa™@@UKWL"],"encodeOffsets":[[108799,30241]]}},{"type":"Feature","id":"500108","properties":{"name":"南岸区","cp":[106.6663,29.5367],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@VV„JVL@bUVVnl`XIlwXJlw°nnl‚IXW@UÇĉk@WJkwkLƒ@WVkU@LU@U`W@UXUV@n"],"encodeOffsets":[[109092,30241]]}},{"type":"Feature","id":"500105","properties":{"name":"江北区","cp":[106.8311,29.6191],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@nLVU@wV@lV„@Xll„ÈKlU@L„@@bVKnx@I@JVaV@„x@Il@@Un@laVVn@mkUIm`k@WXJmk¯mkxWIkxWJk_UmVUUKƒ@UU™@ƒ„@l"],"encodeOffsets":[[109013,30319]]}},{"type":"Feature","id":"500104","properties":{"name":"大渡口区","cp":[106.4905,29.4214],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@k@@U@w„¥WKkVkImUmwa@b@xWJ@b@„nKVU@L@WVLXKV@@z@V@bVVU@@VVL°K@U"],"encodeOffsets":[[109080,30190]]}},{"type":"Feature","id":"500111","properties":{"name":"双桥区","cp":[105.7874,29.4928],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@WwUwU@kK@KmbU@@V@XlJ@znWlXV@XK"],"encodeOffsets":[[108372,30235]]}},{"type":"Feature","id":"500103","properties":{"name":"渝中区","cp":[106.5344,29.5477],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@VLš@VV„@VL@aUKƒIUUƒ@@JUVU@"],"encodeOffsets":[[109036,30257]]}}],"UTF8Encoding":true}; }); -define('echarts/util/mapData/geoJson/fu_jian_geo',[],function() { - return {"type":"FeatureCollection","features":[{"type":"Feature","id":"3507","properties":{"name":"南平市","cp":[118.136,27.2845],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@@knyƒk@ƒKU¥šwV@nkƒWƒzUmk@@lKUa@aVI@UƒKUamKUUVaUI‚@Xƒ@UV@K±IUVVlUbUbUL@KWUXmWk@KkXmmkŃKUƒ™a@amUƒbkUkKWUnwUƒÇwV™UUƒÝUKV£U™@ƒnKWwXLVKm¥@wUXkmWk@ƒ@wX@lU„@šyVImaXwVƒƒ@kŽƒnU@mbk@mlUXƒmU@mV@n@bnW@bUIWJ—ImVUKWbUK@nkKƒaU@W_VUUmWmL@UU@™bUWUL@V@bmVUz@`mUUVVbXL@V™L@lmLUxmVamXkW@xWbU„VbUxkU±@ÅUmmkLUbW@@`kLknVlV@lbXxlVUXVV™ŽU„U@UbWŽkIWVUUUJkI@llbUxVL@V™VƒUU°ULUmWXUV@VULWb@™xm@UaVLVKUa@ƒw@V›bkmVambUUm@@VkK@„@b„xlxX@‚„n¤@Xƒ@@lkLWV@Žn„V„kb@bWJXLWx@nkxmm™bXn@VWVUn@VnJ@bVXl@„™VJXnWbX`lL„UlJVI@Žœ@VXV@Vl@bn@@Æmn@VšxXU@mVIlxšVššnI„l@nVJ‚aXI@mlU@aXkVm°klmnVV_naš°@V@xܦXK„V‚nnUlVXbVK‚LXKV@naV@@VVl@@lXblXšWnLlbVK²nš@@‚VLUnlV@lƒXxô°‚V@UnaUUlKXLVUVVUbVVlUnJVX„@VW@an@lb„@nl@VU@anƒšUVW@kƒaUm@InVVKVU@kUW@Uam@km@kVa@a@™nwšU@WlI@mVI@WXaW_nƒ@™nƒlkkW@U‚¥@kV@Uw@wUƒ@@IXK‚¥VIn@nU@`@Xl@VV„LnašW‚bVaUwnU„@VIšKlV"],"encodeOffsets":[[122119,28086]]}},{"type":"Feature","id":"3504","properties":{"name":"三明市","cp":[117.5317,26.3013],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@lL@Un@VVna‚bnUlœa@U‚x@„VbULUKVbn@šw‚@XaVK@UVUXWVnVKV¯„VšU@UUKVwka@klJVIVVXUlJXVaV@VƒšUUVWkUWwkaU@UklmlK@_X@ValKnnÆV²@lVVwUaVƒXa@wlXnW‚bnUVwnK@kšK@UWKUaVUnV@_VynU@a@UVKVXšaV@@VnKnXVV‚UX`V@„blL@mVLXaVLnU˜JXIVJ@amX@a@mnUV@„nVWnkl@naV@„ml„@@KmKUam@UU@ƒ@UlKU™Vk™U™K@aVaUwV™U¥UIkJ@wmI@‚mbkwkVW@UXƒKULU`™IVKUa@LƒkkVmUU@WlULUWÅU@I@ƒWW™nU@@w@a@ƒUam_XyVIVWkkƒ@mwVKXUV@nw˜VXkWƒÅ™U@ƒaƒU¯KUnƒK@ƒ¯šmUƒLXŽVLnWVbVbUVm@Ub¯¼W@amƒ`kb™amLUUUƒ™aUXV`@x@XmJ@n@L@xkJUU@kU@mWm@kUUwUUVWl@VUkIƒy@kkaVUUm™IWVXbWxU@k„mVkK@nWVX¦WxU@@bkx@VU@WŽk@™kUbmJUUmkUW@_kKWKƒ@knV¤kIUKWLUbV‚@Wbk@@VWL@VkI@lUXVxUVU@@mWIƒV@a¯nUaƒaUV@„ƒJ™b@bÞ°VbUš@X™aUVmL@‚VXblŽnV„°˜n@Vnx„@VUUUlK@InJVb@„Vlnn@V™L@VWJU„x@XlJUVVVl@LUUUJ@Lƒ„@lUL°¦k˜V„VnV@„xV„„l@blLnlšLVaXll@šnVUn@‚xn@nml°‚X@lb"],"encodeOffsets":[[119858,27754]]}},{"type":"Feature","id":"3508","properties":{"name":"龙岩市","cp":[116.8066,25.2026],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@ša„I@ƒVU„bVb°m@b„UXJ@nV@VUUwVW@klJ@UXK@Ul@Xa‚@UVaXKVLlJU£lm„@XLlL@`VXnlVVnIVašll@XV@@Ulw@aV@XwW¥XU@mlLnUlƒV@XwWaXUšJVnUVlb@l„zlJUVk@UXVVVxlVn@nXV@@lVVlI@w@K@mnI@W@wU_VWšbV„VVnKšbla„_n‚bX@°»Van@VUUaUamXUKW„K@a@Ukƒ@wWkXƒWW@wUU™Kw@_lyƒwUkU@@Uƒ@kamVmƒXašUVUka@Wk@»UUUVƒKkbWU™VUbk@mkƒxkƒƒKnIVUmW@kUKmXUmVaU@kU@m@KUWVkIWJ@ŽU@UI@wUUUa@KW»nU@mVkUmm@XwWU@ƒUUmL@ƒw@mnƒVUU@aWak@@amxU@UxULWVXbVLU`mbUImVU„ƒbn‚V@@bVn@bnVWxLmyUbƒIUKƒ@aƒVm™akbV‚UXW„UlKWbkV@„WLUlk@@nšbƒb@lkKmU@ƒUIWJkw¯UUVVxm@@XkbWx—›XKƒlUzWJkUUL@bmKkVƒ@@VUIUlWV@X„K@VkbWx°xUb@LUbk@@VWb@LXJ@VWXU@@bUVV„VVn@VVlLn„@l„@‚xk¦Vx@bVJXbƒn@JlnXxV@@„nJ@X@V@lmx„bUn@xVL@VVKlL@l„„nLVaVL@xkl@LƒxVl°š„X„WVX„Vl„œJWnxlJ"],"encodeOffsets":[[119194,26657]]}},{"type":"Feature","id":"3509","properties":{"name":"宁德市","cp":[119.6521,26.9824],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@@LVKVaVaUkVU²J@LVU„@@W‚VJUbVVnLVb„L@VUJ@bVbkL@Žl@Vn„y„XmlU@™xV¦„L@Ž„lmz@lnL@bVVšbVb@l„nšKVk„Vl¤@zXV@šl@XJVLVKnXVK‚VnU@wUm@šKUƒ@UlVlw@U@U@ƒUaUKlU@kXKlmXIWKXaVIVUVK@KU@@k„JVUnLVJUL@V‚IVa@VnLšKUnl`Vb„V„V@š‚Vbn@Vzn@lKnVlI„VVKUalkXJl@XXVWVLVUUmVU@Unm„£lK@Uk@WUXK@U@WVwVkšƒĠkĢÇ°aUÅUwmaţƒɱUÇa™w„±V¹XalKôx„@„UVaÜʓͿVóbÅLƒJm„¯Vk¦ƒŽk@mamXkKUƒUL›akbk@mV@LkJWb@Vk„mXk@UVmaUV@amLUKUamI@KUaU@WbU@UUUƒUIWJUkm@šƒw™Kk„VJm@kxǁVƒUK@mUVUkmlkkVm@amwƒLVWU@UbVLkšUbƒ@VƒmK@XaVWU_VJnwV@@kUmWakxƒ@kwWakIWxnbUJ™zƒ@kVW@@x@„XllnVW@xn¦ULWKXxmL@„VšU¤VL„ÞVVUšÈxV„mxXVlLlV„anV@bšbV„„LlÆnnlW@LXlWnXV"],"encodeOffsets":[[121816,27816]]}},{"type":"Feature","id":"3501","properties":{"name":"福州市","cp":[119.4543,25.9222],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@lxna@nJ@xlIVJV¦UšVxUb@bšLšVUlVškL@V@„VVn@Vb‚Ln‚@LU„lJXblx„@lwXbVn@lU@mxUIV`UXWb@‚nLU„„@Val™UKVaV@UX„Knx‚bn@lUkllnUVnV‚@VLU„È‚lwn@UIlƒšL„x‚™n@VlXIVJV„VVV@XaV@Vb@LnJVbVLnK@bVUnbVUl@nWlƒ@UXalI@KnUl@laœbVKV„lLnWnbl@„l¥°Unƒ„IÆKôa΀U„a@UUwÇWǓIUWUÅVkƨm@ƒ@£@KmLU¤ULˣJ™kUƒVǟUUķ@ĉVƒKUk@Ñ°wôǚç@īšé@Åţ¥mīÛkm¼Å@ƒVķVó°ō¦U°ƒn@bVJXVVL@bUŽƒakLmx@xmxXzW`XbWnXV@bWLÛ@™aƒ@ƒaXbWVkaÝwU@mlWKkLWWkLUKULW@kVmVUU݁UamV—¤›n@xUVUzkJV¦lJU„"],"encodeOffsets":[[121253,26511]]}},{"type":"Feature","id":"3506","properties":{"name":"漳州市","cp":[117.5757,24.3732],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@@bl@Xb@bVVUŽm„@n„x‚@nKVV@„XVWxn@VnUl@nmVX¼@LVbVV@xVJV@@XIlJXU‚V@Ln‚@lVV@UbVnnWVL@lnXUVmJ„Ll„„wnll@VašUXVla„LVUVV@¼Xl@lbUV™VWbn„nUlb„@@VV@„aVUšmlUašUny@kU@Wkk@WaUVk@@ammk@@U@UlU@aUa@wl@šmXLllnL‚U@anVnU@L@VVV@KlXnWVnVanUšw@w@wm›nÅ@wƒaUam@Uk„mUl@@a„a@U@¥škôK‚wȯ°w@ŻkwǕaK›ÑÛk@ĕōřċ£ĵƒUKW»kÅŻLU@Ulġw@¤Vz™VUbkKUbmLmlULU¼UxmbXl@bWVƒb@bUnV‚UšVbULU@@VkbVL@`U@WX@ŽXV@b°„@b¯š@¤@Xm@@b@`U„VVUL"],"encodeOffsets":[[119712,24953]]}},{"type":"Feature","id":"3505","properties":{"name":"泉州市","cp":[118.3228,25.1147],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@Vl„xkz@`‚xšLVV@xXXW„Xl@xl„@V@bnV°™@„„LVm°L„V„bV@ƚX„Wl—UmxU@WVULnx„@llUXUJWzn`Vb@„@b@xV@šmXX@„@JÆVVXVKXkV@nVlU„l@KVbULšJV_VK„LVWX@lUVƒkIU¥lIVyVU@wœm˜£nUVWU@aƒm@UmWw@UX@@am™VUn@@aUUlUVanaWUXWmUnkšK@VšUlVVUUwš@XLWWX™ma@knm‚bVb„VXbVL‚@XJlInlšL„w˜mXóšw@çV»ÇçŋaķƧóƅóKġ°nÅUķƑUÇW@—¯xÇ°öÆlV„n@llšaš@„Lšbƒ`™@™„VšXVƒVx@V@bULVJUk‚Ç@ƒ¼ƒXUKk@mmULkaWbk@ƒx@UkL@a@K@U@UmKmbU@kV@UmVUbUmmXkW@LUU@U@KmVmU@bVmKkkWK™nk@@xVb@bkV@V@Vl@nn@bl@VUXbl@XlV@@lmz™VVbkŽ™nUVƒb"],"encodeOffsets":[[120398,25797]]}},{"type":"Feature","id":"3503","properties":{"name":"莆田市","cp":[119.0918,25.3455],"childNum":2},"geometry":{"type":"Polygon","coordinates":["@@VbނVVnUlUX@VKVLlKXXlKXL‚‚nkV@ÞxlbXUWa„b„@šbÜ@XK@aWUXmWaX_Wynw@wnwlK„bV@aUKWUUI@a„mV¯Ŏ¥ô¯ĸU„UÆ@n»¯aƿé@ţ¯nĉĬÝK™óó@™ÑU¼@è™xWô—nƒx™KmkkJWI@UKWaƒUUaamn@lnbWšXXWK™@VxUVkU™V@U™LmlnVWXXVmbUbkVVV@bm@UVnš@bW@@VXx‚n@V„n@bV‚UX"],"encodeOffsets":[[121388,26264]]}},{"type":"Feature","id":"3502","properties":{"name":"厦门市","cp":[118.1689,24.6478],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@@VlUV@nanL@V@V@L@blK@V„wl@XalbVKnnl@VL„W„»È@lVUIVK@a@UUw„WUU™šƒš@„_™aƒK™@™bkkm@UƒkõŁxóL™l@¦@Vƒb@bk@VŽƒnVln@Vb„b@xmÆnœ@x@x™x"],"encodeOffsets":[[120747,25465]]}}],"UTF8Encoding":true}; +define('echarts/util/mapData/geoJson/fu_jian_geo',[],function() { + return {"type":"FeatureCollection","features":[{"type":"Feature","id":"3507","properties":{"name":"南平市","cp":[118.136,27.2845],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@@knyƒk@ƒKU¥šwV@nkƒWƒzUmk@@lKUa@aVI@UƒKUamKUUVaUI‚@Xƒ@UV@K±IUVVlUbUbUL@KWUXmWk@KkXmmkŃKUƒ™a@amUƒbkUkKWUnwUƒÇwV™UUƒÝUKV£U™@ƒnKWwXLVKm¥@wUXkmWk@ƒ@wX@lU„@šyVImaXwVƒƒ@kŽƒnU@mbk@mlUXƒmU@mV@n@bnW@bUIWJ—ImVUKWbUK@nkKƒaU@W_VUUmWmL@UU@™bUWUL@V@bmVUz@`mUUVVbXL@V™L@lmLUxmVamXkW@xWbU„VbUxkU±@ÅUmmkLUbW@@`kLknVlV@lbXxlVUXVV™ŽU„U@UbWŽkIWVUUUJkI@llbUxVL@V™VƒUU°ULUmWXUV@VULWb@™xm@UaVLVKUa@ƒw@V›bkmVambUUm@@VkK@„@b„xlxX@‚„n¤@Xƒ@@lkLWV@Žn„V„kb@bWJXLWx@nkxmm™bXn@VWVUn@VnJ@bVXl@„™VJXnWbX`lL„UlJVI@Žœ@VXV@Vl@bn@@Æmn@VšxXU@mVIlxšVššnI„l@nVJ‚aXI@mlU@aXkVm°klmnVV_naš°@V@xܦXK„V‚nnUlVXbVK‚LXKV@naV@@VVl@@lXblXšWnLlbVK²nš@@‚VLUnlV@lƒXxô°‚V@UnaUUlKXLVUVVUbVVlUnJVX„@VW@an@lb„@nl@VU@anƒšUVW@kƒaUm@InVVKVU@kUW@Uam@km@kVa@a@™nwšU@WlI@mVI@WXaW_nƒ@™nƒlkkW@U‚¥@kV@Uw@wUƒ@@IXK‚¥VIn@nU@`@Xl@VV„LnašW‚bVaUwnU„@VIšKlV"],"encodeOffsets":[[122119,28086]]}},{"type":"Feature","id":"3504","properties":{"name":"三明市","cp":[117.5317,26.3013],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@lL@Un@VVna‚bnUlœa@U‚x@„VbULUKVbn@šw‚@XaVK@UVUXWVnVKV¯„VšU@UUKVwka@klJVIVVXUlJXVaV@VƒšUUVWkUWwkaU@UklmlK@_X@ValKnnÆV²@lVVwUaVƒXa@wlXnW‚bnUVwnK@kšK@UWKUaVUnV@_VynU@a@UVKVXšaV@@VnKnXVV‚UX`V@„blL@mVLXaVLnU˜JXIVJ@amX@a@mnUV@„nVWnkl@naV@„ml„@@KmKUam@UU@ƒ@UlKU™Vk™U™K@aVaUwV™U¥UIkJ@wmI@‚mbkwkVW@UXƒKULU`™IVKUa@LƒkkVmUU@WlULUWÅU@I@ƒWW™nU@@w@a@ƒUam_XyVIVWkkƒ@mwVKXUV@nw˜VXkWƒÅ™U@ƒaƒU¯KUnƒK@ƒ¯šmUƒLXŽVLnWVbVbUVm@Ub¯¼W@amƒ`kb™amLUUUƒ™aUXV`@x@XmJ@n@L@xkJUU@kU@mWm@kUUwUUVWl@VUkIƒy@kkaVUUm™IWVXbWxU@k„mVkK@nWVX¦WxU@@bkx@VU@WŽk@™kUbmJUUmkUW@_kKWKƒ@knV¤kIUKWLUbV‚@Wbk@@VWL@VkI@lUXVxUVU@@mWIƒV@a¯nUaƒaUV@„ƒJ™b@bÞ°VbUš@X™aUVmL@‚VXblŽnV„°˜n@Vnx„@VUUUlK@InJVb@„Vlnn@V™L@VWJU„x@XlJUVVVl@LUUUJ@Lƒ„@lUL°¦k˜V„VnV@„xV„„l@blLnlšLVaXll@šnVUn@‚xn@nml°‚X@lb"],"encodeOffsets":[[119858,27754]]}},{"type":"Feature","id":"3508","properties":{"name":"龙岩市","cp":[116.8066,25.2026],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@ša„I@ƒVU„bVb°m@b„UXJ@nV@VUUwVW@klJ@UXK@Ul@Xa‚@UVaXKVLlJU£lm„@XLlL@`VXnlVVnIVašll@XV@@Ulw@aV@XwW¥XU@mlLnUlƒV@XwWaXUšJVnUVlb@l„zlJUVk@UXVVVxlVn@nXV@@lVVlI@w@K@mnI@W@wU_VWšbV„VVnKšbla„_n‚bX@°»Van@VUUaUamXUKW„K@a@Ukƒ@wWkXƒWW@wUU™Kw@_lyƒwUkU@@Uƒ@kamVmƒXašUVUka@Wk@»UUUVƒKkbWU™VUbk@mkƒxkƒƒKnIVUmW@kUKmXUmVaU@kU@m@KUWVkIWJ@ŽU@UI@wUUUa@KW»nU@mVkUmm@XwWU@ƒUUmL@ƒw@mnƒVUU@aWak@@amxU@UxULWVXbVLU`mbUImVU„ƒbn‚V@@bVn@bnVWxLmyUbƒIUKƒ@aƒVm™akbV‚UXW„UlKWbkV@„WLUlk@@nšbƒb@lkKmU@ƒUIWJkw¯UUVVxm@@XkbWx—›XKƒlUzWJkUUL@bmKkVƒ@@VUIUlWV@X„K@VkbWx°xUb@LUbk@@VWb@LXJ@VWXU@@bUVV„VVn@VVlLn„@l„@‚xk¦Vx@bVJXbƒn@JlnXxV@@„nJ@X@V@lmx„bUn@xVL@VVKlL@l„„nLVaVL@xkl@LƒxVl°š„X„WVX„Vl„œJWnxlJ"],"encodeOffsets":[[119194,26657]]}},{"type":"Feature","id":"3509","properties":{"name":"宁德市","cp":[119.6521,26.9824],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@@LVKVaVaUkVU²J@LVU„@@W‚VJUbVVnLVb„L@VUJ@bVbkL@Žl@Vn„y„XmlU@™xV¦„L@Ž„lmz@lnL@bVVšbVb@l„nšKVk„Vl¤@zXV@šl@XJVLVKnXVK‚VnU@wUm@šKUƒ@UlVlw@U@U@ƒUaUKlU@kXKlmXIWKXaVIVUVK@KU@@k„JVUnLVJUL@V‚IVa@VnLšKUnl`Vb„V„V@š‚Vbn@Vzn@lKnVlI„VVKUalkXJl@XXVWVLVUUmVU@Unm„£lK@Uk@WUXK@U@WVwVkšƒĠkĢÇ°aUÅUwmaţƒɱUÇa™w„±V¹XalKôx„@„UVaÜʓͿVóbÅLƒJm„¯Vk¦ƒŽk@mamXkKUƒUL›akbk@mV@LkJWb@Vk„mXk@UVmaUV@amLUKUamI@KUaU@WbU@UUUƒUIWJUkm@šƒw™Kk„VJm@kxǁVƒUK@mUVUkmlkkVm@amwƒLVWU@UbVLkšUbƒ@VƒmK@XaVWU_VJnwV@@kUmWakxƒ@kwWakIWxnbUJ™zƒ@kVW@@x@„XllnVW@xn¦ULWKXxmL@„VšU¤VL„ÞVVUšÈxV„mxXVlLlV„anV@bšbV„„LlÆnnlW@LXlWnXV"],"encodeOffsets":[[121816,27816]]}},{"type":"Feature","id":"3501","properties":{"name":"福州市","cp":[119.4543,25.9222],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@lxna@nJ@xlIVJV¦UšVxUb@bšLšVUlVškL@V@„VVn@Vb‚Ln‚@LU„lJXblx„@lwXbVn@lU@mxUIV`UXWb@‚nLU„„@Val™UKVaV@UX„Knx‚bn@lUkllnUVnV‚@VLU„È‚lwn@UIlƒšL„x‚™n@VlXIVJV„VVV@XaV@Vb@LnJVbVLnK@bVUnbVUl@nWlƒ@UXalI@KnUl@laœbVKV„lLnWnbl@„l¥°Unƒ„IÆKôa΀U„a@UUwÇWǓIUWUÅVkƨm@ƒ@£@KmLU¤ULˣJ™kUƒVǟUUķ@ĉVƒKUk@Ñ°wôǚç@īšé@Åţ¥mīÛkm¼Å@ƒVķVó°ō¦U°ƒn@bVJXVVL@bUŽƒakLmx@xmxXzW`XbWnXV@bWLÛ@™aƒ@ƒaXbWVkaÝwU@mlWKkLWWkLUKULW@kVmVUU݁UamV—¤›n@xUVUzkJV¦lJU„"],"encodeOffsets":[[121253,26511]]}},{"type":"Feature","id":"3506","properties":{"name":"漳州市","cp":[117.5757,24.3732],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@@bl@Xb@bVVUŽm„@n„x‚@nKVV@„XVWxn@VnUl@nmVX¼@LVbVV@xVJV@@XIlJXU‚V@Ln‚@lVV@UbVnnWVL@lnXUVmJ„Ll„„wnll@VašUXVla„LVUVV@¼Xl@lbUV™VWbn„nUlb„@@VV@„aVUšmlUašUny@kU@Wkk@WaUVk@@ammk@@U@UlU@aUa@wl@šmXLllnL‚U@anVnU@L@VVV@KlXnWVnVanUšw@w@wm›nÅ@wƒaUam@Uk„mUl@@a„a@U@¥škôK‚wȯ°w@ŻkwǕaK›ÑÛk@ĕōřċ£ĵƒUKW»kÅŻLU@Ulġw@¤Vz™VUbkKUbmLmlULU¼UxmbXl@bWVƒb@bUnV‚UšVbULU@@VkbVL@`U@WX@ŽXV@b°„@b¯š@¤@Xm@@b@`U„VVUL"],"encodeOffsets":[[119712,24953]]}},{"type":"Feature","id":"3505","properties":{"name":"泉州市","cp":[118.3228,25.1147],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@Vl„xkz@`‚xšLVV@xXXW„Xl@xl„@V@bnV°™@„„LVm°L„V„bV@ƚX„Wl—UmxU@WVULnx„@llUXUJWzn`Vb@„@b@xV@šmXX@„@JÆVVXVKXkV@nVlU„l@KVbULšJV_VK„LVWX@lUVƒkIU¥lIVyVU@wœm˜£nUVWU@aƒm@UmWw@UX@@am™VUn@@aUUlUVanaWUXWmUnkšK@VšUlVVUUwš@XLWWX™ma@knm‚bVb„VXbVL‚@XJlInlšL„w˜mXóšw@çV»ÇçŋaķƧóƅóKġ°nÅUķƑUÇW@—¯xÇ°öÆlV„n@llšaš@„Lšbƒ`™@™„VšXVƒVx@V@bULVJUk‚Ç@ƒ¼ƒXUKk@mmULkaWbk@ƒx@UkL@a@K@U@UmKmbU@kV@UmVUbUmmXkW@LUU@U@KmVmU@bVmKkkWK™nk@@xVb@bkV@V@Vl@nn@bl@VUXbl@XlV@@lmz™VVbkŽ™nUVƒb"],"encodeOffsets":[[120398,25797]]}},{"type":"Feature","id":"3503","properties":{"name":"莆田市","cp":[119.0918,25.3455],"childNum":2},"geometry":{"type":"Polygon","coordinates":["@@VbނVVnUlUX@VKVLlKXXlKXL‚‚nkV@ÞxlbXUWa„b„@šbÜ@XK@aWUXmWaX_Wynw@wnwlK„bV@aUKWUUI@a„mV¯Ŏ¥ô¯ĸU„UÆ@n»¯aƿé@ţ¯nĉĬÝK™óó@™ÑU¼@è™xWô—nƒx™KmkkJWI@UKWaƒUUaamn@lnbWšXXWK™@VxUVkU™V@U™LmlnVWXXVmbUbkVVV@bm@UVnš@bW@@VXx‚n@V„n@bV‚UX"],"encodeOffsets":[[121388,26264]]}},{"type":"Feature","id":"3502","properties":{"name":"厦门市","cp":[118.1689,24.6478],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@@VlUV@nanL@V@V@L@blK@V„wl@XalbVKnnl@VL„W„»È@lVUIVK@a@UUw„WUU™šƒš@„_™aƒK™@™bkkm@UƒkõŁxóL™l@¦@Vƒb@bk@VŽƒnVln@Vb„b@xmÆnœ@x@x™x"],"encodeOffsets":[[120747,25465]]}}],"UTF8Encoding":true}; }); -define('echarts/util/mapData/geoJson/gan_su_geo',[],function() { - return {"type":"FeatureCollection","features":[{"type":"Feature","id":"6209","properties":{"name":"酒泉市","cp":[96.2622,40.4517],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@ÇnÅaĉ@ƒU¯¥›UŹ‚ƒ£™WUýUU±JkkUw‚yÞIČxĊĕĊ¯š¥ÆUkţ™UÅÓ±¼™IUx¯UƒÒƑ‚ݐŰƒKÝnğ°ÅU@Žƒ@Vn@þš¼¯šWnŎ°XLWlnVnbWnƒVXxmbƒa—bóUƒlǕUUa™IUmlU™ƒš¥™kƒ¥ĉwkkƒÝɛa@¯™™U¯°mVƒkVnKlƒōÑÇÑU@kl™UġŽkUŻnUW™@š¯ƒk»šmWV£UKnUƒmUw‚w@ƒUIVaX™šwm»Èmmwn¯ċ™¯LĉŽUƒJUalka±Va@U‚k@ƒÛф¯WmnUaɝ¤Ûmƒn¯m±x@wóxÛLġÒUx¯VƒÈ™JUbóz݃ÇKĉ¯ōlÝUŎWl¯nťbÝ@¯ǩLġmV@ƯĢkÆm™ĊkVťLɃmÝXó°@„ĢbVŽóVݦɱ@Ƨaġ„UV„ĠÇÈV¼UVţwmbJÇwˋa™XmǯKkkmŽƒbXšm¼V¼ǬŚ²¤ôŰÆƴô̐ŤǪnɆӨ¼ɆLÆłUĊšxŎƞȘǔˎǬǪnƨŮǬö°»šġ„„ÞÜÆĸÒĊ„ǀbƾèôÈ@¼¯þŤĸƧ°VĀ¯b@lÈĊ‚šʠń̐„ȘKǀŽֲॗţÿǕý@ʊǓƨóÆÑǖŃôw@΋ʈƆÅÈVVĊV„óĊÅ@ÞƒĬV@Þīš@°Ž„V@ĸĢƒ°XτƜĠ@ÈaÜ¥Őƅ‚™nğóĕVġUůƿŋ—ĕƒa±V—UťÇğÑ"],"encodeOffsets":[[101892,40821]]}},{"type":"Feature","id":"6207","properties":{"name":"张掖市","cp":[99.7998,38.7433],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@ÈÒŎÒk„mLUŽlŽU„¯nV°šš@°ɜb„ÞĠaÈ»ĸl‚š„LVUÈ@Ċ@ýUm„@@ÆVĠ¯Þm„LƯޏƒ„Ñ°VVwšJ²»ÆԚVlŤÅV™¦ĉ°ĉĖċwÝJzVxll²IVVVþšX„¤źœV°¦„VĊ@ÆbÈmǔLĸĠ¯Ģaô¯ĸmÆÛUƒlÇĸk°XyĊUǔV„ǩnmV»ƒa@ýnK°n@l¥@»ż„Ċ¤m皃@£ČU@mƒmVkÞUƐ±²¹°‚ĠwÅƑŃU¯™›V¯aÈŁšƒÇ»™ġn_°xŎKlxœklx„@Þw‚„„@Æm²b‚DzLlkšWXať¯ĊaœÑšK±w@wƒUÅçV±Uk™@@„¯š¯xƒU™±±UU°ōxVxÅÔō°ó¯UÝ¦óbÝþƒ@ĉÈóUV‚Ux„„@VŽUVÝwÅÈǎóVkk¯JǐkmmL@„™KÇx@bkš™@U°ķ²ó`ƒš™šmn¯°ƒUwlÅkUƒ`™¦ɛô™Žķz@ŽÅnÇ°U¼¯KmVk²ƒJƒ¼ƏÞķôš¤ULƒ@mnğ`™šÇnUxÇ@Ûÿ™U@ƒƒkŻŽ@x@móJkŃ¥VŹĉóÒĉlċ°ķ„Uƽ܃@›x"],"encodeOffsets":[[99720,40090]]}},{"type":"Feature","id":"6230","properties":{"name":"甘南藏族自治州","cp":[102.9199,34.6893],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@ލš™nKlnšwX¥WÝXk˜xÞUnƒ°aĊVnUUKlÞĶWXnĠ¥ô»„™@nmVL@¤°™Vz„JšanU@aÆwna@k›ƒU¯šyX_›aĉb™ƒ„wƒéXkWwÅaš¯V¥mƒ¯UƒƒI@ƒš@„mšb°aÈçšUš¥@»‚knwɜƇ°I°ÑÈmVU™¯Xa@w‚W@wšV¯Č¥l¯Uwnm@k˜aUaóKkk@™Ça™b@ŽÒWa¯IÇxÛam¼™VUƒxÒl‚@zÝÒ¯bÝaĉVĉwDŽW›zJ™mJn²mܯUƒ¯ĉ@ġ¤Åb@²nšmlƒ@@Ž„„U„ƒLVxšV™„U¼Ålma™b@ƒ°™l@WIUƒ¯@mƒ™@™™ó„™„@U›zţyƒXÇU™ÇVUUVLkbWakVWmUbkkƒKUÆ»nƒ°Knk@aƒUVmšnk»l¯Ģ›lw@_kKVU@ƒnaƒ@lUk@¯¥mV@kmbW™b¯Åõa@mkU@kƒÇŽkU@›`@™óó—bl¼Uxƒn„¼šlVȄx@blVkVVnƒ`XÈġÈ@ǃK£ÝJmUUnUĖmlU„mKUn™VÅaUw›Uĉ`¯n¯wW¼nxVŽ™š@bĉnƒ‚kIċŘkXUŽ±Ò™xšÈ@ŽX°`l„œV˜IȯĊV„ƒšVVan@VašUVażVmšblkÈW„ƒWIXa„alL@wVb„„V„¦lL@lĠ™n҄U‚nk‚šL@ÆÞkšÞšK‚bñþW¦Û„ċVƒ„ULUºkÈlŎUxÆxÞUUxšÒ‚x„@XbšL@lÆ@„ÒlXVln@„bm¼ƒJ@„Ån„šƒx@bnšĠm„xVXmbÈè@ŽĊ£ČW˜w"],"encodeOffsets":[[105210,36349]]}},{"type":"Feature","id":"6206","properties":{"name":"武威市","cp":[103.0188,38.1061],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@±¯¥@klwU»ƒƒÞÝmwKm¯™™ç@™kVÇUL¯lVUKġ„ġm@a@U„@X£°l°LŎÇ@aōVÝw™ÔƒKUŽÅš„WJ¯lm@ÛVWa™@klĉUmaƒLUanaƒ™ƒk¯J„™™±KkXóÜÅxƒ²Ç‚@„„nUÒĊb°@™ÆkL™Ž™XÇÆ@xÝn—xWxţ„¯¤ƒI@Æn„ƒVV„VlU²Æè„V@x²x™L›ÒĉbŦ°Wb™Xklބš@l¤šXĊ`„wl@ĢÈŎm@bšnV‚Ubƒ„@șÆÛLƒèǚUÒŦlĸ™`°ĮʟÆǓbĉôϚĊƚĢnŤé΀ÑĸĀĊ¦„@@l°lœ¦Ȯ¦ɆÞĊKŤ™ĵĸů„»mŁyġ™ķŭ@Çɱȭ¯mƧUĊķnŁŻ»UaU™˜ƛɞÝƨů"],"encodeOffsets":[[106336,38543]]}},{"type":"Feature","id":"6212","properties":{"name":"陇南市","cp":[105.304,33.5632],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@šÈÞ@l`UmVƒ¼œŽ‚@nnÆwVlnVVa„LVƒÈ_‚ÿރ@n„a„xÆ@„lš_š@VxnK@llLnxmÈŎJnbUxšI°Žl@n¦‚lÈIlmX¥„k°@šk‚J„k²é˜@klaUaVaU@@ÝnIWnmnx‚k„ºÞ„„aV™°„V@nw‚KšxôbÞ£šVšU„bšþšLn»mƒVw„IšJ°Ž@„nb@°°I„ġUkÇKVƒ™™@ů»lƒ„Lnmƒ£@anK@Ñ܍n@»mL@£™yk„UUmbUÞÝ@kyÇbó»™XUxƒWVzb±mÝbXaƒwUamL¯»@wUKVwm¯ĵJ°ÅUWVk„KVk°wÈVšVуlUšƒ¥škmVamknƒUw¯¯ƒbċ¥ÅKƒk™Kk„™VċVk£kKVw‚Ñ„a@kóyÛ¯ÇVk™ów›š—Xō¥Ç¼ów™Ž¯U±‚k„ƒ@x›IĉÒÅVmÈnšÜ@n°„bUbÝV‚ŽUnnJ¯Į@‚m¦nV܃@„„L°JXb‚Ñ@šaÈb@šllôLVb—b@lmnVxk°ċ¦U°™Ž@xX@xWbš°UVÇn¯Ò¯Jɛƈmxl@¼"],"encodeOffsets":[[106527,34943]]}},{"type":"Feature","id":"6210","properties":{"name":"庆阳市","cp":[107.5342,36.2],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@kw‚ĉ—»VamƒƒV¯wƒIóVkl¯™Km™Vō¯ÝWkL@bÝKō¦@Ž™„@š™Lx›@b@l™a@km@@l¯nm@UaÅ@ƒ„óWUXm¥™nƒw`@UUxķôÇ°ğ¦@„VJš_n‚‚IVŽnalxkX„JWn¯šnVƒLšxl¤nnVbklVX@xnxmV@bUK@nm@@xƒV—°±aÅnƒŽkUWnUaƒx@m™n@ƒ¯LƒššmUĀlU@lV@blLUblxklkIÇx¯°‚UXbšaVŽUnšV@°‚LUlnbšX@`°nVmbnÆmV‚kLmK™¦UŽ@X„y@kl@U„°K@¼XbW„ƒš@b„WnLVa„VšƒVz@xlVČ¥lbUxލlV„U@nÆWôn²™VJlU„Ƨ„LnmÜLXa˜n@mœw@wlUlV²mšblwšVȃlLލ„±@lVnUlxnkma@mškšJ@kXV‚U@mn@š¼VXUƒVƒlLnmVbôaVnWV»ÈUl°È¯ÆIn›ÆU@kk»mKkÆġk¯@»mƒk—¯@óÇlÇ@—Vykkl™Uml¯Þ™@w"],"encodeOffsets":[[111229,36383]]}},{"type":"Feature","id":"6204","properties":{"name":"白银市","cp":[104.8645,36.5076],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@VKUȚl@šè°šnŽ‚LnxÝބ„V¼kx@l‚¦²°ĊóĠ„™Ċ»š@ÈxšaĊxlwÈVŤa@¯²aÇ£ƒJk£lƒnUÞ@°šô™@y„wl»lIX¥Ǫnw@ÑÞWla„ÅlL@ƒUwĉakƒl@ƒš¯mwna°J„V¯nUVÓÞÑm£²óWaUƒÇ@óÝUçV»ÈkkW@¯‚xV@XlK@wX@Vmm_@wÈݙKU¯ÇwVwÅK¯VƒkƒJ™™™XkWVaƒImŽ¯Uk„ÇlVšœĀV°mxóšk„@¼ó„WxĉÜU@Ub‚zÛJÇk@‚ÆnVlԙ@kŽ„x™ô@ĬWL¯ƒƒK@aÛImm™@ƒIUaƒ@™™UŽÇêU¤VÒÇx¯ÒV„šš™lk@Wbĉ¦UbkWV_‚y¯Lƒaó„kŽ@b@nmbkx„°"],"encodeOffsets":[[106077,37885]]}},{"type":"Feature","id":"6211","properties":{"name":"定西市","cp":[104.5569,35.0848],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@„a‚V²wVJV_@„LlanÅllŦçÜӚ_šlnƒWaôk„xUš„bmV@È°lèšnk°l¦„`@nnL‚@ÈlÜIyVaV@ĊÛXwôƒ@»lƒô™nwU¯›ÿU™Èklƒ°Vn„JUblXšWšš„I„l°U„ƒVƒš—@aVVVmnL@„lƒ„UUw‚mkƒš£„bV¥VUVwۂƒlaÇÝރmk£ƒLUy¯L@WlkKW_XaWƒ—mƒ„ġU@a™k™‚ƒakXkmVwmŹVƒU™b™WƒónmwnWW£„KÈnV¥ƒ¥„ƒÆ_k™lW„bU¯„V°aôbnaVwmaōInÇmwkK@kmLUw™@™`ƒkÅ@ƒwƒb@m݄ĀÇ`U„ƒKUbmUUkÅxmm@›„»nUVk_Ý@™Ç™¦™VÇè¯b™aƒn™@@„„JV„°Žn„U¦™°ÆbXxWl„êƒxš„ĊaœbW`™zV°œ„@lmbÅx@bmV™bƒI™`™¦@ÒUVUI@ƃL@bš¼@ššŽ@„šlmxnL„°ULƒŽƒÞğޛ°kLUŽƒL™°™xVŽ„n„KVƒl@šzX@"],"encodeOffsets":[[106122,36794]]}},{"type":"Feature","id":"6205","properties":{"name":"天水市","cp":[105.6445,34.6289],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@UyȍVƒVUnn@ƒVU„`UblzšJnk‚@Vb„KU„°l„wš„„W°„nkVŽ‚UÈlš£°V@n¥šV„kl™kU˜±U„ƒn™ƒlw¯UkwmKUlmkUmnkym@ō@U„mWÈU°l°anlJškUKlU„¯Èm@kmWV»kkÝLUWUx±b™@¯ma@ƒ¯™IƒJUxn„m¼™K™ýƒa™V™Uݤóa™wLmxU@¯ƒUšƒb݃ƒ¹lmwmnXŽmJ@ÞV@UbVbkblŽ—@±êƒlI™l¯@ƒlW¦knÇJkm¥k@¯™Jmbóa¯bƒUV°ƒakXlšÅ`ƒ„„¦U¦ÇmƒLX¤mXnxm‚„ôšXša„VźUnŽUxlnlW„bššl@bĢV„ƒ˜nX„WbX`lLXk@Ž°KVz„Kl¤„nÞ݂Èkb„‚܁"],"encodeOffsets":[[108180,35984]]}},{"type":"Feature","id":"6201","properties":{"name":"兰州市","cp":[103.5901,36.3043],"childNum":5},"geometry":{"type":"MultiPolygon","coordinates":[["@@lW²LššƒŽ°I„l„šmbVb„KnbĊVlkš@XbÜU@Žkn°‚XIƒÆ™V„LšÓÞxŎUlôƒ„b°KzU`lXVaĊ¥Xal@šk™™Uƒ°ÑÈwUтV£ÈéVšš„@Vb„Jš@nnÜJ@b„L°„XK@īšóƒwlš@kÓmUÅmK@mƒ_k¥l¯™mkçǯ@nUƒaV™ƒwólXbm„™k™`ÛÔťèkkmÆkbƒK@U`UI±xUƒbWlX„mbVbÅÒólkƒƒIWJkšƒ@ƒz—KŻ¼™@™xUx󎃄¯LWb@ŽÅ҄„±¦U`nbťĀUšVb„LšŽ„U"],["@@ƒ¯lwna@mōȯK¯kW¤ƒ@@V@bĢnĢƒVLU‚°k"]],"encodeOffsets":[[[105188,37649]],[[106077,37885]]]}},{"type":"Feature","id":"6208","properties":{"name":"平凉市","cp":[107.0728,35.321],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@ÆLUxÈxV°šLÇÞ@xn`Ü@X@nĊŽÆwnJmwUx‚aUkšw@V@w„aVmlLXÝl@X‚VĢmV°@nl@UUUWK@w„ÿVI²Òlmš@nÝĊýVV@nšJ°„„šUłm@kV¼nK›ĢȤôK„blnKllVk²aĠ¥È¯ĸóVw@V‚_„xšmn¦VWôX„ƒÆ@Vbn@°m@kn@@lšb@k‚aœ@‚wšK@™šƒ@UlKVaƒWX™W²¹lӄw@_°›n@@_lKōķW™@ŽmLUWƒn™»Û@›l_Ç`ƒÛmm°ÅbWb@š—VWbƒUUKDŽÅaġlmkUġlƒ»—Lƒl™Um¦@Ž¯U™¤ÇkVUml¯ƒƒX™ƒƒx¯kVƒƒLUa@ml™IkyVaƒ_UV@„mmUVU„ÇŽVzUxUVU¦ƒa™¤l„nVxƒVk„@ƒmKUnUU@b™˜U„ƒ„","@@@Žż@™mlkƒġk"],"encodeOffsets":[[107877,36338],[108439,36265]]}},{"type":"Feature","id":"6229","properties":{"name":"临夏回族自治州","cp":[103.2715,35.5737],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@š@ż»˜L„y„@l™XI„Jl„ôkÆÑUanaWƒXkW@™yk@U„ƒLƒmUšwš¯„KVlKœ¯Ġ݄݄VKƒ¯mKnw™k@ƒ™@™™»@a„K@ÅVJVU@њ¥š_Uy¯š@£UKmn@‚ƒšó¼ğ¦WmĵXݎkŽVLmVĉU¯bm„ÝV—wWlXÞW¦™xkmmL™šÝŽœ„±U@Vގ™š@„ÅÈW°X„ܼƨyUĮnŽWŽnXÝxUx°lVXJlôV"],"encodeOffsets":[[105548,37075]]}},{"type":"Feature","id":"6203","properties":{"name":"金昌市","cp":[102.074,38.5126],"childNum":2},"geometry":{"type":"Polygon","coordinates":["@@šĢȼ™„Çł°bœU°šV‚ƒń‚ÆǖŰnšÆ„ōĬǔaʠůĭš_kķÆ¥VÑș„çÜKšÅ@DŽƒVaU™m@aōnġÇk@ƒxĉ_™Wk£™@݃±KÈ±aÅnƒ@ƒÝxƒ@kw›lkwōL¯wm`"],"encodeOffsets":[[103849,38970]]}},{"type":"Feature","id":"6202","properties":{"name":"嘉峪关市","cp":[98.1738,39.8035],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@llĊx„¦šl™¦š„kVVnšJVbǖV„kôV˜a„bnaWw„UXmmamUXkWKō¯Xm°™™»ĉÇ@UVƒK™ķkǼğb"],"encodeOffsets":[[100182,40664]]}}],"UTF8Encoding":true}; +define('echarts/util/mapData/geoJson/gan_su_geo',[],function() { + return {"type":"FeatureCollection","features":[{"type":"Feature","id":"6209","properties":{"name":"酒泉市","cp":[96.2622,40.4517],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@ÇnÅaĉ@ƒU¯¥›UŹ‚ƒ£™WUýUU±JkkUw‚yÞIČxĊĕĊ¯š¥ÆUkţ™UÅÓ±¼™IUx¯UƒÒƑ‚ݐŰƒKÝnğ°ÅU@Žƒ@Vn@þš¼¯šWnŎ°XLWlnVnbWnƒVXxmbƒa—bóUƒlǕUUa™IUmlU™ƒš¥™kƒ¥ĉwkkƒÝɛa@¯™™U¯°mVƒkVnKlƒōÑÇÑU@kl™UġŽkUŻnUW™@š¯ƒk»šmWV£UKnUƒmUw‚w@ƒUIVaX™šwm»Èmmwn¯ċ™¯LĉŽUƒJUalka±Va@U‚k@ƒÛф¯WmnUaɝ¤Ûmƒn¯m±x@wóxÛLġÒUx¯VƒÈ™JUbóz݃ÇKĉ¯ōlÝUŎWl¯nťbÝ@¯ǩLġmV@ƯĢkÆm™ĊkVťLɃmÝXó°@„ĢbVŽóVݦɱ@Ƨaġ„UV„ĠÇÈV¼UVţwmbJÇwˋa™XmǯKkkmŽƒbXšm¼V¼ǬŚ²¤ôŰÆƴô̐ŤǪnɆӨ¼ɆLÆłUĊšxŎƞȘǔˎǬǪnƨŮǬö°»šġ„„ÞÜÆĸÒĊ„ǀbƾèôÈ@¼¯þŤĸƧ°VĀ¯b@lÈĊ‚šʠń̐„ȘKǀŽֲॗţÿǕý@ʊǓƨóÆÑǖŃôw@΋ʈƆÅÈVVĊV„óĊÅ@ÞƒĬV@Þīš@°Ž„V@ĸĢƒ°XτƜĠ@ÈaÜ¥Őƅ‚™nğóĕVġUůƿŋ—ĕƒa±V—UťÇğÑ"],"encodeOffsets":[[101892,40821]]}},{"type":"Feature","id":"6207","properties":{"name":"张掖市","cp":[99.7998,38.7433],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@ÈÒŎÒk„mLUŽlŽU„¯nV°šš@°ɜb„ÞĠaÈ»ĸl‚š„LVUÈ@Ċ@ýUm„@@ÆVĠ¯Þm„LƯޏƒ„Ñ°VVwšJ²»ÆԚVlŤÅV™¦ĉ°ĉĖċwÝJzVxll²IVVVþšX„¤źœV°¦„VĊ@ÆbÈmǔLĸĠ¯Ģaô¯ĸmÆÛUƒlÇĸk°XyĊUǔV„ǩnmV»ƒa@ýnK°n@l¥@»ż„Ċ¤m皃@£ČU@mƒmVkÞUƐ±²¹°‚ĠwÅƑŃU¯™›V¯aÈŁšƒÇ»™ġn_°xŎKlxœklx„@Þw‚„„@Æm²b‚DzLlkšWXať¯ĊaœÑšK±w@wƒUÅçV±Uk™@@„¯š¯xƒU™±±UU°ōxVxÅÔō°ó¯UÝ¦óbÝþƒ@ĉÈóUV‚Ux„„@VŽUVÝwÅÈǎóVkk¯JǐkmmL@„™KÇx@bkš™@U°ķ²ó`ƒš™šmn¯°ƒUwlÅkUƒ`™¦ɛô™Žķz@ŽÅnÇ°U¼¯KmVk²ƒJƒ¼ƏÞķôš¤ULƒ@mnğ`™šÇnUxÇ@Ûÿ™U@ƒƒkŻŽ@x@móJkŃ¥VŹĉóÒĉlċ°ķ„Uƽ܃@›x"],"encodeOffsets":[[99720,40090]]}},{"type":"Feature","id":"6230","properties":{"name":"甘南藏族自治州","cp":[102.9199,34.6893],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@ލš™nKlnšwX¥WÝXk˜xÞUnƒ°aĊVnUUKlÞĶWXnĠ¥ô»„™@nmVL@¤°™Vz„JšanU@aÆwna@k›ƒU¯šyX_›aĉb™ƒ„wƒéXkWwÅaš¯V¥mƒ¯UƒƒI@ƒš@„mšb°aÈçšUš¥@»‚knwɜƇ°I°ÑÈmVU™¯Xa@w‚W@wšV¯Č¥l¯Uwnm@k˜aUaóKkk@™Ça™b@ŽÒWa¯IÇxÛam¼™VUƒxÒl‚@zÝÒ¯bÝaĉVĉwDŽW›zJ™mJn²mܯUƒ¯ĉ@ġ¤Åb@²nšmlƒ@@Ž„„U„ƒLVxšV™„U¼Ålma™b@ƒ°™l@WIUƒ¯@mƒ™@™™ó„™„@U›zţyƒXÇU™ÇVUUVLkbWakVWmUbkkƒKUÆ»nƒ°Knk@aƒUVmšnk»l¯Ģ›lw@_kKVU@ƒnaƒ@lUk@¯¥mV@kmbW™b¯Åõa@mkU@kƒÇŽkU@›`@™óó—bl¼Uxƒn„¼šlVȄx@blVkVVnƒ`XÈġÈ@ǃK£ÝJmUUnUĖmlU„mKUn™VÅaUw›Uĉ`¯n¯wW¼nxVŽ™š@bĉnƒ‚kIċŘkXUŽ±Ò™xšÈ@ŽX°`l„œV˜IȯĊV„ƒšVVan@VašUVażVmšblkÈW„ƒWIXa„alL@wVb„„V„¦lL@lĠ™n҄U‚nk‚šL@ÆÞkšÞšK‚bñþW¦Û„ċVƒ„ULUºkÈlŎUxÆxÞUUxšÒ‚x„@XbšL@lÆ@„ÒlXVln@„bm¼ƒJ@„Ån„šƒx@bnšĠm„xVXmbÈè@ŽĊ£ČW˜w"],"encodeOffsets":[[105210,36349]]}},{"type":"Feature","id":"6206","properties":{"name":"武威市","cp":[103.0188,38.1061],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@±¯¥@klwU»ƒƒÞÝmwKm¯™™ç@™kVÇUL¯lVUKġ„ġm@a@U„@X£°l°LŎÇ@aōVÝw™ÔƒKUŽÅš„WJ¯lm@ÛVWa™@klĉUmaƒLUanaƒ™ƒk¯J„™™±KkXóÜÅxƒ²Ç‚@„„nUÒĊb°@™ÆkL™Ž™XÇÆ@xÝn—xWxţ„¯¤ƒI@Æn„ƒVV„VlU²Æè„V@x²x™L›ÒĉbŦ°Wb™Xklބš@l¤šXĊ`„wl@ĢÈŎm@bšnV‚Ubƒ„@șÆÛLƒèǚUÒŦlĸ™`°ĮʟÆǓbĉôϚĊƚĢnŤé΀ÑĸĀĊ¦„@@l°lœ¦Ȯ¦ɆÞĊKŤ™ĵĸů„»mŁyġ™ķŭ@Çɱȭ¯mƧUĊķnŁŻ»UaU™˜ƛɞÝƨů"],"encodeOffsets":[[106336,38543]]}},{"type":"Feature","id":"6212","properties":{"name":"陇南市","cp":[105.304,33.5632],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@šÈÞ@l`UmVƒ¼œŽ‚@nnÆwVlnVVa„LVƒÈ_‚ÿރ@n„a„xÆ@„lš_š@VxnK@llLnxmÈŎJnbUxšI°Žl@n¦‚lÈIlmX¥„k°@šk‚J„k²é˜@klaUaVaU@@ÝnIWnmnx‚k„ºÞ„„aV™°„V@nw‚KšxôbÞ£šVšU„bšþšLn»mƒVw„IšJ°Ž@„nb@°°I„ġUkÇKVƒ™™@ů»lƒ„Lnmƒ£@anK@Ñ܍n@»mL@£™yk„UUmbUÞÝ@kyÇbó»™XUxƒWVzb±mÝbXaƒwUamL¯»@wUKVwm¯ĵJ°ÅUWVk„KVk°wÈVšVуlUšƒ¥škmVamknƒUw¯¯ƒbċ¥ÅKƒk™Kk„™VċVk£kKVw‚Ñ„a@kóyÛ¯ÇVk™ów›š—Xō¥Ç¼ów™Ž¯U±‚k„ƒ@x›IĉÒÅVmÈnšÜ@n°„bUbÝV‚ŽUnnJ¯Į@‚m¦nV܃@„„L°JXb‚Ñ@šaÈb@šllôLVb—b@lmnVxk°ċ¦U°™Ž@xX@xWbš°UVÇn¯Ò¯Jɛƈmxl@¼"],"encodeOffsets":[[106527,34943]]}},{"type":"Feature","id":"6210","properties":{"name":"庆阳市","cp":[107.5342,36.2],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@kw‚ĉ—»VamƒƒV¯wƒIóVkl¯™Km™Vō¯ÝWkL@bÝKō¦@Ž™„@š™Lx›@b@l™a@km@@l¯nm@UaÅ@ƒ„óWUXm¥™nƒw`@UUxķôÇ°ğ¦@„VJš_n‚‚IVŽnalxkX„JWn¯šnVƒLšxl¤nnVbklVX@xnxmV@bUK@nm@@xƒV—°±aÅnƒŽkUWnUaƒx@m™n@ƒ¯LƒššmUĀlU@lV@blLUblxklkIÇx¯°‚UXbšaVŽUnšV@°‚LUlnbšX@`°nVmbnÆmV‚kLmK™¦UŽ@X„y@kl@U„°K@¼XbW„ƒš@b„WnLVa„VšƒVz@xlVČ¥lbUxލlV„U@nÆWôn²™VJlU„Ƨ„LnmÜLXa˜n@mœw@wlUlV²mšblwšVȃlLލ„±@lVnUlxnkma@mškšJ@kXV‚U@mn@š¼VXUƒVƒlLnmVbôaVnWV»ÈUl°È¯ÆIn›ÆU@kk»mKkÆġk¯@»mƒk—¯@óÇlÇ@—Vykkl™Uml¯Þ™@w"],"encodeOffsets":[[111229,36383]]}},{"type":"Feature","id":"6204","properties":{"name":"白银市","cp":[104.8645,36.5076],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@VKUȚl@šè°šnŽ‚LnxÝބ„V¼kx@l‚¦²°ĊóĠ„™Ċ»š@ÈxšaĊxlwÈVŤa@¯²aÇ£ƒJk£lƒnUÞ@°šô™@y„wl»lIX¥Ǫnw@ÑÞWla„ÅlL@ƒUwĉakƒl@ƒš¯mwna°J„V¯nUVÓÞÑm£²óWaUƒÇ@óÝUçV»ÈkkW@¯‚xV@XlK@wX@Vmm_@wÈݙKU¯ÇwVwÅK¯VƒkƒJ™™™XkWVaƒImŽ¯Uk„ÇlVšœĀV°mxóšk„@¼ó„WxĉÜU@Ub‚zÛJÇk@‚ÆnVlԙ@kŽ„x™ô@ĬWL¯ƒƒK@aÛImm™@ƒIUaƒ@™™UŽÇêU¤VÒÇx¯ÒV„šš™lk@Wbĉ¦UbkWV_‚y¯Lƒaó„kŽ@b@nmbkx„°"],"encodeOffsets":[[106077,37885]]}},{"type":"Feature","id":"6211","properties":{"name":"定西市","cp":[104.5569,35.0848],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@„a‚V²wVJV_@„LlanÅllŦçÜӚ_šlnƒWaôk„xUš„bmV@È°lèšnk°l¦„`@nnL‚@ÈlÜIyVaV@ĊÛXwôƒ@»lƒô™nwU¯›ÿU™Èklƒ°Vn„JUblXšWšš„I„l°U„ƒVƒš—@aVVVmnL@„lƒ„UUw‚mkƒš£„bV¥VUVwۂƒlaÇÝރmk£ƒLUy¯L@WlkKW_XaWƒ—mƒ„ġU@a™k™‚ƒakXkmVwmŹVƒU™b™WƒónmwnWW£„KÈnV¥ƒ¥„ƒÆ_k™lW„bU¯„V°aôbnaVwmaōInÇmwkK@kmLUw™@™`ƒkÅ@ƒwƒb@m݄ĀÇ`U„ƒKUbmUUkÅxmm@›„»nUVk_Ý@™Ç™¦™VÇè¯b™aƒn™@@„„JV„°Žn„U¦™°ÆbXxWl„êƒxš„ĊaœbW`™zV°œ„@lmbÅx@bmV™bƒI™`™¦@ÒUVUI@ƃL@bš¼@ššŽ@„šlmxnL„°ULƒŽƒÞğޛ°kLUŽƒL™°™xVŽ„n„KVƒl@šzX@"],"encodeOffsets":[[106122,36794]]}},{"type":"Feature","id":"6205","properties":{"name":"天水市","cp":[105.6445,34.6289],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@UyȍVƒVUnn@ƒVU„`UblzšJnk‚@Vb„KU„°l„wš„„W°„nkVŽ‚UÈlš£°V@n¥šV„kl™kU˜±U„ƒn™ƒlw¯UkwmKUlmkUmnkym@ō@U„mWÈU°l°anlJškUKlU„¯Èm@kmWV»kkÝLUWUx±b™@¯ma@ƒ¯™IƒJUxn„m¼™K™ýƒa™V™Uݤóa™wLmxU@¯ƒUšƒb݃ƒ¹lmwmnXŽmJ@ÞV@UbVbkblŽ—@±êƒlI™l¯@ƒlW¦knÇJkm¥k@¯™Jmbóa¯bƒUV°ƒakXlšÅ`ƒ„„¦U¦ÇmƒLX¤mXnxm‚„ôšXša„VźUnŽUxlnlW„bššl@bĢV„ƒ˜nX„WbX`lLXk@Ž°KVz„Kl¤„nÞ݂Èkb„‚܁"],"encodeOffsets":[[108180,35984]]}},{"type":"Feature","id":"6201","properties":{"name":"兰州市","cp":[103.5901,36.3043],"childNum":5},"geometry":{"type":"MultiPolygon","coordinates":[["@@lW²LššƒŽ°I„l„šmbVb„KnbĊVlkš@XbÜU@Žkn°‚XIƒÆ™V„LšÓÞxŎUlôƒ„b°KzU`lXVaĊ¥Xal@šk™™Uƒ°ÑÈwUтV£ÈéVšš„@Vb„Jš@nnÜJ@b„L°„XK@īšóƒwlš@kÓmUÅmK@mƒ_k¥l¯™mkçǯ@nUƒaV™ƒwólXbm„™k™`ÛÔťèkkmÆkbƒK@U`UI±xUƒbWlX„mbVbÅÒólkƒƒIWJkšƒ@ƒz—KŻ¼™@™xUx󎃄¯LWb@ŽÅ҄„±¦U`nbťĀUšVb„LšŽ„U"],["@@ƒ¯lwna@mōȯK¯kW¤ƒ@@V@bĢnĢƒVLU‚°k"]],"encodeOffsets":[[[105188,37649]],[[106077,37885]]]}},{"type":"Feature","id":"6208","properties":{"name":"平凉市","cp":[107.0728,35.321],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@ÆLUxÈxV°šLÇÞ@xn`Ü@X@nĊŽÆwnJmwUx‚aUkšw@V@w„aVmlLXÝl@X‚VĢmV°@nl@UUUWK@w„ÿVI²Òlmš@nÝĊýVV@nšJ°„„šUłm@kV¼nK›ĢȤôK„blnKllVk²aĠ¥È¯ĸóVw@V‚_„xšmn¦VWôX„ƒÆ@Vbn@°m@kn@@lšb@k‚aœ@‚wšK@™šƒ@UlKVaƒWX™W²¹lӄw@_°›n@@_lKōķW™@ŽmLUWƒn™»Û@›l_Ç`ƒÛmm°ÅbWb@š—VWbƒUUKDŽÅaġlmkUġlƒ»—Lƒl™Um¦@Ž¯U™¤ÇkVUml¯ƒƒX™ƒƒx¯kVƒƒLUa@ml™IkyVaƒ_UV@„mmUVU„ÇŽVzUxUVU¦ƒa™¤l„nVxƒVk„@ƒmKUnUU@b™˜U„ƒ„","@@@Žż@™mlkƒġk"],"encodeOffsets":[[107877,36338],[108439,36265]]}},{"type":"Feature","id":"6229","properties":{"name":"临夏回族自治州","cp":[103.2715,35.5737],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@š@ż»˜L„y„@l™XI„Jl„ôkÆÑUanaWƒXkW@™yk@U„ƒLƒmUšwš¯„KVlKœ¯Ġ݄݄VKƒ¯mKnw™k@ƒ™@™™»@a„K@ÅVJVU@њ¥š_Uy¯š@£UKmn@‚ƒšó¼ğ¦WmĵXݎkŽVLmVĉU¯bm„ÝV—wWlXÞW¦™xkmmL™šÝŽœ„±U@Vގ™š@„ÅÈW°X„ܼƨyUĮnŽWŽnXÝxUx°lVXJlôV"],"encodeOffsets":[[105548,37075]]}},{"type":"Feature","id":"6203","properties":{"name":"金昌市","cp":[102.074,38.5126],"childNum":2},"geometry":{"type":"Polygon","coordinates":["@@šĢȼ™„Çł°bœU°šV‚ƒń‚ÆǖŰnšÆ„ōĬǔaʠůĭš_kķÆ¥VÑș„çÜKšÅ@DŽƒVaU™m@aōnġÇk@ƒxĉ_™Wk£™@݃±KÈ±aÅnƒ@ƒÝxƒ@kw›lkwōL¯wm`"],"encodeOffsets":[[103849,38970]]}},{"type":"Feature","id":"6202","properties":{"name":"嘉峪关市","cp":[98.1738,39.8035],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@llĊx„¦šl™¦š„kVVnšJVbǖV„kôV˜a„bnaWw„UXmmamUXkWKō¯Xm°™™»ĉÇ@UVƒK™ķkǼğb"],"encodeOffsets":[[100182,40664]]}}],"UTF8Encoding":true}; }); -define('echarts/util/mapData/geoJson/guang_dong_geo',[],function() { - return {"type":"FeatureCollection","features":[{"type":"Feature","id":"4418","properties":{"name":"清远市","cp":[112.9175,24.3292],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@lǯkÿƒaV¯™VaÈU„¥ÆDŽIlxšmnb‚Uœxl™„Uôl°kš„„Wl„š@ô™VwUanUl@„xVkšaX¥‚kU»„aš¯±@kka@ƒUwmUkwƒJk™˜„±k@ƒ™™L@ÝWUwV݃—xÇU¯ŽÇX@m™Åƒ@@yĉ£VmUwȗ»ÇšUn„lUnWU¯`Ukƒ@@„™x„Ž@bÇxX¼ƒVVš¯LšĀk‚ÝLƒ„¯@VŽƒĀ¯lnĊW¦kVÇôkUDŽUK@ţ™U@a™™ó܃UU»ƒ@™¦k@Vx„KVb„n‚š@„Æ™„l„@xšƒbWšnlU„lxÈlV„È°Æ„@¼™„@x„šWxœŎ‚V„šK°„š¥ššnƒÆkŎ@ÈÑm™„K@¥šk@™ô@„nôV"],"encodeOffsets":[[115707,25527]]}},{"type":"Feature","id":"4402","properties":{"name":"韶关市","cp":[113.7964,24.7028],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@W™Xk±Ñ@ƒUw™mUwĉwlmn@Æwn£mkIš¥ÇÅ@¥šaƒón£nWWwš£V`Þ@šnVml@xô¼„IV¥ƒkUmkamUkVWwÛ»móƒ£UVÅKmn@x™@kbmm¯a™Xka›VĉaUb݃ƒ²—‚lš„IlxnVVx@„lb@l²™°ƒbV¼lW¦™bUlƒwk@mVVbUxóš™@kƒƒX™ƒ¯lókƒVkš›wVma™nkwƒJÅȃ¦ÇVUbšŽU°„blĀ°ŽkÈ@x™¦Æܙ°@„°„¦óa™VUôlUlbXl@nÜV„„nKlŽnIVÞ°Wš„°U@bnm@¥šIVƒ²Ulƒ°VnalzXyl_Vyƒ¦lƒœLlxš„@ŽÞbšKm„knVWanwƒÑVwČº˜@n_ÞV„aVŽÜIœl@„˜KȚ„VJ@aš£È@˜™@km™„aV¯W@_ƒa¯KmbkÇkLmwƒ@Å¥"],"encodeOffsets":[[117147,25549]]}},{"type":"Feature","id":"4408","properties":{"name":"湛江市","cp":[110.3577,20.9894],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@@ƒkXƒ™@a„UUċlk„Jƒk„™@wVJXUWk°W@nKnwlUlš²ƒ„blU@‚lI„l@„XbW„šxnm@lW@w„wU‚JX¯VU°`ŎóˋkÝÝkÅ@ÇmğÈřmw™aĵV›xUہ»°™ĠǷnýmóX¥ɅĵҏÇ@°²ĊUĖ±ĮU¤Ç°™Ā¯ɐnżUĊĊĬV@脎@ԃÒU¼l¤nƒĠb„êVĠ°Èy„zVaV‚nUÆL„ašbVl„wÆ@"],"encodeOffsets":[[113040,22416]]}},{"type":"Feature","id":"4414","properties":{"name":"梅州市","cp":[116.1255,24.1534],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@„‚nԚlW¼x‚¦@lœVl™lLkè„a@zš¤ƒĖ„¼UxlnUKUbÝlU¼lb@„Vx„V„klJÈwV¯š@ĠlÛĖšnƒbkšÆźÞƒUÈôklmšL„¥‚LœW˜„„™nKUkVa°V„x@IVV@x°bUk„a™a@mV@„@y„w‚L„ÑUwVUšV„‚„U‚bÞVVann‚@XwÇÿš¯²aVamkXaÆ»@»nw@¥›UXaƒkbWa¯KUw@¥m@kwmLU»UU™J@kmU@UUWUƒ@ƒyƒanwmçÛl¯ƒŽ¯UƒmKUmƒwVkmÝXbW@XWÝbƒk¯@±‚w@»U@W¯Å@ƒÇ¥UƒU@ƒƒ™IU™ƒakJƒĀ„ꃰšþƒXkamŽ@Žƒ_J°m‚@X"],"encodeOffsets":[[118125,24419]]}},{"type":"Feature","id":"4416","properties":{"name":"河源市","cp":[114.917,23.9722],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@°VlmX¹laĢÒlm„@„„šVš£‚‚@¦Ģklynn¼lW°z„W„„°VbÈV@lÆbnn‚JškX„šVÆašÅ„W@™ƒUUw@ƒkaV»ÞkVaVLkmVwƒ»„ĕ™£@yƒblçkKkš›U@k¥‚wX»™kmӃ@Wn¯‚I„`@nlb„W™ý„¯ƒé„ÿlI@™XUmWUwƒ@@UJU„Ç„mKUV@x™„ţk¯¯LWƒƒnUxK@ű»Vwa¯š@¤WX@ŽÛ¦@¤ÇIȼWxXŽƒ@Wx—w›ŽUnVbÅèmVa±²UWl@Žk„lȄ¤nôܼXxlUnVlbVn„lU¦ƒJó»@wnkmU™‚Ý@U_™¤XxmXm¤„ô™b@¦Èƙ¦lJn"],"encodeOffsets":[[117057,25167]]}},{"type":"Feature","id":"4412","properties":{"name":"肇庆市","cp":[112.1265,23.5822],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@l@š¥„@V¼„Vôۚš@bšV@ŤVLȃlVÈólUX¥mĉ°k„ÿU°@„ƒÞKl™ÿ°KU™„UW»Èw@aƒšw@ƒ„@nm@w›£kÓVUVn„Kš™k¥™£Vamƒ@nkKkbÆǫma—kmLU¥™UmƒÛwmVU™mUƒJ—ÇaUxÇIn`mb@Þ¯b@„nJ@nl„U‚V„lVU„L›W¯—Û`Ç_¯`mš¯I™bĉWċzx±J™xš¯ÆUƒƒ_k@™šƒJ@Umb„šXôlLš˜n¦@¼ĊxlUXŽ˜xUbL‚Ġ„UnVĊwlšUš„b@lW„X„‚m²˜@ÞWxXš‚Unb"],"encodeOffsets":[[114627,24818]]}},{"type":"Feature","id":"4413","properties":{"name":"惠州市","cp":[114.6204,23.1647],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@lbšW°bnnlaš@@wnmÆLVUkÇlƒ@Xk‚V²±‚bnUÆçUaVmœ˜xXw„@WXwÇ»ÈJ@£Ü¥@XW@£°™‚bUx²¼@ƂLVw„mX„°K°Ťlšƒ@wVUnLȃVƒVIky±wkƒKU¯ƒÅkƒ™XġÑۃlwUwlm@m„nKWašÅm›¯óÇmğb¯alĉUwķbmb@lÞÒVn—šmĀŹ@VŽƒbVŽUnmakLm`@xĉkklVÔVJVn—lV„UnmJmaLUbl‚™zmŽkL™a™‚ō@@zš‚V¦UŽV²kJ„nÜU@˜VXUŽL@„lJƒL@bݤUnVŽ—b@xVnlK²„Vx°V„xlI„lkVl²k¤@n"],"encodeOffsets":[[116776,24492]]}},{"type":"Feature","id":"4409","properties":{"name":"茂名市","cp":[111.0059,22.0221],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@‚LnÇlk„KnkÆL„ƒUm™ÈxlUœJló°n@ššanŽš„„a@ƒ˜@X_@mÝóóU@a™aU¯mL¯ƒƒkV¯™ÇVwkw@V±Ŏ£@™™@šalw±Vk@m„Åm¯™ÿŃƧIÇ`ōô¯_UVW°IV‚ƒx@xkX@Žmn™wXƒWa@ƒƒkkJ@kVƒa±„k™kVmxmL@‚¯XXlWVUI@xƒš„lƒIklVȃV@b„šlW@„@nUxVblVxkôlx™n„‚y„šnIƻư„aXwlK„bVnƒŽXb‚L„¤„k‚L—èƒVV¼ƒŽ²IlĠVX„ynz°KVx°@VlœLlblKœš"],"encodeOffsets":[[113761,23237]]}},{"type":"Feature","id":"4407","properties":{"name":"江门市","cp":[112.6318,22.1484],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@lUXx°JWnnƚXVš„W„X@„šºVLV¯nU‚Vnb™ô„x‚aXmW™XIšŽUb°xlK„l¯œK˜xXÞ°ŽšXÈ¥Ü@„ĉޏU™‚çš»nóƒVma—x‚¯UÅU¥Ý¯@ƒƒç@ș@çĉÅUmU籃ĉKÝxÝ_ÅJƒk¯»ó¯nmèkǀšŽWxœ¼mnUÜġ°@¦@ƒxƒLkŽÇaVnUxV„™šVlnIlbnÆÆKX¦"],"encodeOffsets":[[114852,22928]]}},{"type":"Feature","id":"4417","properties":{"name":"阳江市","cp":[111.8298,22.0715],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@°„nKV°šb@bôVÞô@n„VlÒôÆUnlnn@lmkmVkƒaÈkÆƄ™k¥‚ÅÞ»ÆKXkW¥ÅLmÅkamJUkš™UƒVwUmÈbl„K„w‚@@¥Ģ¯VÛnm›»Xw™lƿ™@kbW™—aʵ@óL›l¯ƽ@™ƒƒLn°ƒÆ@nUl‚²kx™b@‚š@šō¤U²@ŽlxUxšÈU°lŽ„"],"encodeOffsets":[[114053,22782]]}},{"type":"Feature","id":"4453","properties":{"name":"云浮市","cp":[111.7859,22.8516],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@@V„Iš™l@„`V„°Å™šw²I‚wČyĊXša°Jn™°_È`Ü_°˜œX‚KVƒkUUƒVkƒ@mmI@ƒ°a@Ýnam_ÈJVwlĉX@„šlUšómaUmVU°UK™¹@ƒƒWƒXU™™WmÅXm¯IWwkVWlÅLݼÆl¦ƒšÅÅÇl„bUllnknm@kmVmóÅkуUW`—@@„ƒb™ƒm™b@™¯mkô›IkVÇwnš„VƒÅKmlƒLklmȁKƒšVĊK°²„`n˜¤n„U„bWl„xVx™LUx@°nXm`VklVxmnnx"],"encodeOffsets":[[114053,23873]]}},{"type":"Feature","id":"4401","properties":{"name":"广州市","cp":[113.5107,23.2196],"childNum":13},"geometry":{"type":"Polygon","coordinates":["@@Ș¼VxUnĊ¤@z„@šÆ@nÈW°ÈV˜w„ŽUÞVxÞX@ŽšK„šl@ބVaĊbœU@ml£k±lUƒkkJƒw¯UUw±ƒkLUm@w˜aUVmÞ£@a„KkI@ƒ‚KVUW@—ÛVƒmlIU±VU¥™@yğzƧǃƒšƽĠřšÅnī±m@ƒ²¯lƒ°@nÝÆóUll@XnÝVU¦mVV°—„V¼™Jƒn„b@°mbn„ƒ‚@²¯‚¯wVwƒ@@nmxX¤¯L@ŽVLU„m@@l"],"encodeOffsets":[[115673,24019]]}},{"type":"Feature","id":"4415","properties":{"name":"汕尾市","cp":[115.5762,23.0438],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@@‚„@VxnXWV@š„bVššJ„„V@ÞÅU¥Ċxš£UWU‚wÅUU¥WVUkĊÇnkV`°LV™„wƒƒnU@™„ƒlbĊ¯„Vnalšš@@çkUÝ¥ġaó¯ÅaÅLŻÆUýmy¯ó@ĉÆó„ȯw™ÆXbmLƒ‚@nknVxkx܄ĢҚW„Æl„V°„Ll‚²xlz"],"encodeOffsets":[[118193,23806]]}},{"type":"Feature","id":"4452","properties":{"name":"揭阳市","cp":[116.1255,23.313],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@V„Ȧ„Æ@X°V@@¼‚x²°@„lÞaWXX@‚aÞWlnUŽ„xVnnL„‚°V„@k‚mĢl@„ak™@mlk°aXƒ±„nwm±™²¯JV²@ƒwW˜—_mƒa„V»ƒU@m¯ĉUф™šJl™„ašbVn„lĸLlƅÛDZwÝ@ĉxó@è™@k™mbƒUĉ°kaƒ„@šmV„„ƒxUš¯KU_mlĉÈVlXUV¦ÆVxVŽVX™¤ĉwV¦ÝÆ"],"encodeOffsets":[[118384,24036]]}},{"type":"Feature","id":"4404","properties":{"name":"珠海市","cp":[113.7305,22.1155],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@„è@„Þ°V¦VƁ°˜wnb„UÆ»nçƏ@nxܤ²llU°VnÈJސ°UôéšķUklƒô£VVˌKÞV°£n¥ƒ£ȗ™Ýy¯¯mÅkw¯bÇĔğ@Ýn¯ĊƒVğōŁŻƒķJ@Ț","@@X¯kmèVbnJ‚™"],"encodeOffsets":[[115774,22602],[116325,22697]]}},{"type":"Feature","id":"4406","properties":{"name":"佛山市","cp":[112.8955,23.1097],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@Èb˜Ž„InVVšnUÜxn„šVV¦nK˜lnbÅǬlalL@mn„Ubš¤l¦™šƒLUmUVlԜ¤@xmnVl°_XVVmƒkVmș@kn@VƒUK@°KW£nw@m„@Ux°x°@±„mƒna@¯ƒa„mšIU»˜ƒU¯nUV¥ÞUWmk@Vk¯™Ukn›ÑWݐƒĊÛ@Ǧ™W¯Wݗw›Lk°ƒkL¯wVa™WJXšWnbƒwkVƒ™W@kĊ"],"encodeOffsets":[[115088,23316]]}},{"type":"Feature","id":"4451","properties":{"name":"潮州市","cp":[116.7847,23.8293],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@°ŽÜknèmx„b„z„@V‚VX@VnV@lšIVVV¼nKlxn@@¦Vx°LXbla„ŽWbœV°£¯™W@nW@™‚aUñVœwWš»@¥ŤÅUÝǓÝóV@ńǎkUVmƒIUwÅVWÇX¹›—@W„¯bkl@nlšƒb@‚kġŽn@l"],"encodeOffsets":[[119161,24306]]}},{"type":"Feature","id":"4405","properties":{"name":"汕头市","cp":[117.1692,23.3405],"childNum":2},"geometry":{"type":"Polygon","coordinates":["@@‚@U±°Iš±n²mx²ƒ˜@œWºXÈÆUVx„JUnlVȍ@ŃôUǔÞVçn»VyĢÛVm@»kaÝUǼóšÛÈķKċ¥X„¥Wwğk™ƒ¯@ƒwķKƒkUm™aƒbkš™IƒšVÒ°Ċ@n„VU¼ƒ‚„bn˜`X—„x"],"encodeOffsets":[[119251,24059]]}},{"type":"Feature","id":"4403","properties":{"name":"深圳市","cp":[114.5435,22.5439],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@ÞLš„@xšbV„šVšK°™X°Kô¥Vw@anU„胐š‚lkĊl@wn_lKnbVmU„aUź@nÿ˜™UmÝѯUƒbk„@ÆkxŻ@™aÇX—wƒJƒƒ¯LķÝUĕ™ó™ĸóêWº@b²nmĬ™Æ"],"encodeOffsets":[[116404,23265]]}},{"type":"Feature","id":"4419","properties":{"name":"东莞市","cp":[113.8953,22.901],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@Ŏ@ššblKnšykVa‚KnbnIVmUƒ˜kUmUIUә„ƒçmV@bUxó¦¯LW‚¯š™L™UUƒ™a@w™ƒÝKğŚ™ƾ„„ƨÈĠy"],"encodeOffsets":[[116573,23670]]}},{"type":"Feature","id":"4420","properties":{"name":"中山市","cp":[113.4229,22.478],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@‚XœÒlmšV°ôÞÅ@m„¯°k„±‚@@aX¹¯VݏÇIUmV¯kk‚±Û£mw@‚Őmèżmô™¼èVš"],"encodeOffsets":[[115887,23209]]}}],"UTF8Encoding":true}; +define('echarts/util/mapData/geoJson/guang_dong_geo',[],function() { + return {"type":"FeatureCollection","features":[{"type":"Feature","id":"4418","properties":{"name":"清远市","cp":[112.9175,24.3292],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@lǯkÿƒaV¯™VaÈU„¥ÆDŽIlxšmnb‚Uœxl™„Uôl°kš„„Wl„š@ô™VwUanUl@„xVkšaX¥‚kU»„aš¯±@kka@ƒUwmUkwƒJk™˜„±k@ƒ™™L@ÝWUwV݃—xÇU¯ŽÇX@m™Åƒ@@yĉ£VmUwȗ»ÇšUn„lUnWU¯`Ukƒ@@„™x„Ž@bÇxX¼ƒVVš¯LšĀk‚ÝLƒ„¯@VŽƒĀ¯lnĊW¦kVÇôkUDŽUK@ţ™U@a™™ó܃UU»ƒ@™¦k@Vx„KVb„n‚š@„Æ™„l„@xšƒbWšnlU„lxÈlV„È°Æ„@¼™„@x„šWxœŎ‚V„šK°„š¥ššnƒÆkŎ@ÈÑm™„K@¥šk@™ô@„nôV"],"encodeOffsets":[[115707,25527]]}},{"type":"Feature","id":"4402","properties":{"name":"韶关市","cp":[113.7964,24.7028],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@W™Xk±Ñ@ƒUw™mUwĉwlmn@Æwn£mkIš¥ÇÅ@¥šaƒón£nWWwš£V`Þ@šnVml@xô¼„IV¥ƒkUmkamUkVWwÛ»móƒ£UVÅKmn@x™@kbmm¯a™Xka›VĉaUb݃ƒ²—‚lš„IlxnVVx@„lb@l²™°ƒbV¼lW¦™bUlƒwk@mVVbUxóš™@kƒƒX™ƒ¯lókƒVkš›wVma™nkwƒJÅȃ¦ÇVUbšŽU°„blĀ°ŽkÈ@x™¦Æܙ°@„°„¦óa™VUôlUlbXl@nÜV„„nKlŽnIVÞ°Wš„°U@bnm@¥šIVƒ²Ulƒ°VnalzXyl_Vyƒ¦lƒœLlxš„@ŽÞbšKm„knVWanwƒÑVwČº˜@n_ÞV„aVŽÜIœl@„˜KȚ„VJ@aš£È@˜™@km™„aV¯W@_ƒa¯KmbkÇkLmwƒ@Å¥"],"encodeOffsets":[[117147,25549]]}},{"type":"Feature","id":"4408","properties":{"name":"湛江市","cp":[110.3577,20.9894],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@@ƒkXƒ™@a„UUċlk„Jƒk„™@wVJXUWk°W@nKnwlUlš²ƒ„blU@‚lI„l@„XbW„šxnm@lW@w„wU‚JX¯VU°`ŎóˋkÝÝkÅ@ÇmğÈřmw™aĵV›xUہ»°™ĠǷnýmóX¥ɅĵҏÇ@°²ĊUĖ±ĮU¤Ç°™Ā¯ɐnżUĊĊĬV@脎@ԃÒU¼l¤nƒĠb„êVĠ°Èy„zVaV‚nUÆL„ašbVl„wÆ@"],"encodeOffsets":[[113040,22416]]}},{"type":"Feature","id":"4414","properties":{"name":"梅州市","cp":[116.1255,24.1534],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@„‚nԚlW¼x‚¦@lœVl™lLkè„a@zš¤ƒĖ„¼UxlnUKUbÝlU¼lb@„Vx„V„klJÈwV¯š@ĠlÛĖšnƒbkšÆźÞƒUÈôklmšL„¥‚LœW˜„„™nKUkVa°V„x@IVV@x°bUk„a™a@mV@„@y„w‚L„ÑUwVUšV„‚„U‚bÞVVann‚@XwÇÿš¯²aVamkXaÆ»@»nw@¥›UXaƒkbWa¯KUw@¥m@kwmLU»UU™J@kmU@UUWUƒ@ƒyƒanwmçÛl¯ƒŽ¯UƒmKUmƒwVkmÝXbW@XWÝbƒk¯@±‚w@»U@W¯Å@ƒÇ¥UƒU@ƒƒ™IU™ƒakJƒĀ„ꃰšþƒXkamŽ@Žƒ_J°m‚@X"],"encodeOffsets":[[118125,24419]]}},{"type":"Feature","id":"4416","properties":{"name":"河源市","cp":[114.917,23.9722],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@°VlmX¹laĢÒlm„@„„šVš£‚‚@¦Ģklynn¼lW°z„W„„°VbÈV@lÆbnn‚JškX„šVÆašÅ„W@™ƒUUw@ƒkaV»ÞkVaVLkmVwƒ»„ĕ™£@yƒblçkKkš›U@k¥‚wX»™kmӃ@Wn¯‚I„`@nlb„W™ý„¯ƒé„ÿlI@™XUmWUwƒ@@UJU„Ç„mKUV@x™„ţk¯¯LWƒƒnUxK@ű»Vwa¯š@¤WX@ŽÛ¦@¤ÇIȼWxXŽƒ@Wx—w›ŽUnVbÅèmVa±²UWl@Žk„lȄ¤nôܼXxlUnVlbVn„lU¦ƒJó»@wnkmU™‚Ý@U_™¤XxmXm¤„ô™b@¦Èƙ¦lJn"],"encodeOffsets":[[117057,25167]]}},{"type":"Feature","id":"4412","properties":{"name":"肇庆市","cp":[112.1265,23.5822],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@l@š¥„@V¼„Vôۚš@bšV@ŤVLȃlVÈólUX¥mĉ°k„ÿU°@„ƒÞKl™ÿ°KU™„UW»Èw@aƒšw@ƒ„@nm@w›£kÓVUVn„Kš™k¥™£Vamƒ@nkKkbÆǫma—kmLU¥™UmƒÛwmVU™mUƒJ—ÇaUxÇIn`mb@Þ¯b@„nJ@nl„U‚V„lVU„L›W¯—Û`Ç_¯`mš¯I™bĉWċzx±J™xš¯ÆUƒƒ_k@™šƒJ@Umb„šXôlLš˜n¦@¼ĊxlUXŽ˜xUbL‚Ġ„UnVĊwlšUš„b@lW„X„‚m²˜@ÞWxXš‚Unb"],"encodeOffsets":[[114627,24818]]}},{"type":"Feature","id":"4413","properties":{"name":"惠州市","cp":[114.6204,23.1647],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@lbšW°bnnlaš@@wnmÆLVUkÇlƒ@Xk‚V²±‚bnUÆçUaVmœ˜xXw„@WXwÇ»ÈJ@£Ü¥@XW@£°™‚bUx²¼@ƂLVw„mX„°K°Ťlšƒ@wVUnLȃVƒVIky±wkƒKU¯ƒÅkƒ™XġÑۃlwUwlm@m„nKWašÅm›¯óÇmğb¯alĉUwķbmb@lÞÒVn—šmĀŹ@VŽƒbVŽUnmakLm`@xĉkklVÔVJVn—lV„UnmJmaLUbl‚™zmŽkL™a™‚ō@@zš‚V¦UŽV²kJ„nÜU@˜VXUŽL@„lJƒL@bݤUnVŽ—b@xVnlK²„Vx°V„xlI„lkVl²k¤@n"],"encodeOffsets":[[116776,24492]]}},{"type":"Feature","id":"4409","properties":{"name":"茂名市","cp":[111.0059,22.0221],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@‚LnÇlk„KnkÆL„ƒUm™ÈxlUœJló°n@ššanŽš„„a@ƒ˜@X_@mÝóóU@a™aU¯mL¯ƒƒkV¯™ÇVwkw@V±Ŏ£@™™@šalw±Vk@m„Åm¯™ÿŃƧIÇ`ōô¯_UVW°IV‚ƒx@xkX@Žmn™wXƒWa@ƒƒkkJ@kVƒa±„k™kVmxmL@‚¯XXlWVUI@xƒš„lƒIklVȃV@b„šlW@„@nUxVblVxkôlx™n„‚y„šnIƻư„aXwlK„bVnƒŽXb‚L„¤„k‚L—èƒVV¼ƒŽ²IlĠVX„ynz°KVx°@VlœLlblKœš"],"encodeOffsets":[[113761,23237]]}},{"type":"Feature","id":"4407","properties":{"name":"江门市","cp":[112.6318,22.1484],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@lUXx°JWnnƚXVš„W„X@„šºVLV¯nU‚Vnb™ô„x‚aXmW™XIšŽUb°xlK„l¯œK˜xXÞ°ŽšXÈ¥Ü@„ĉޏU™‚çš»nóƒVma—x‚¯UÅU¥Ý¯@ƒƒç@ș@çĉÅUmU籃ĉKÝxÝ_ÅJƒk¯»ó¯nmèkǀšŽWxœ¼mnUÜġ°@¦@ƒxƒLkŽÇaVnUxV„™šVlnIlbnÆÆKX¦"],"encodeOffsets":[[114852,22928]]}},{"type":"Feature","id":"4417","properties":{"name":"阳江市","cp":[111.8298,22.0715],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@°„nKV°šb@bôVÞô@n„VlÒôÆUnlnn@lmkmVkƒaÈkÆƄ™k¥‚ÅÞ»ÆKXkW¥ÅLmÅkamJUkš™UƒVwUmÈbl„K„w‚@@¥Ģ¯VÛnm›»Xw™lƿ™@kbW™—aʵ@óL›l¯ƽ@™ƒƒLn°ƒÆ@nUl‚²kx™b@‚š@šō¤U²@ŽlxUxšÈU°lŽ„"],"encodeOffsets":[[114053,22782]]}},{"type":"Feature","id":"4453","properties":{"name":"云浮市","cp":[111.7859,22.8516],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@@V„Iš™l@„`V„°Å™šw²I‚wČyĊXša°Jn™°_È`Ü_°˜œX‚KVƒkUUƒVkƒ@mmI@ƒ°a@Ýnam_ÈJVwlĉX@„šlUšómaUmVU°UK™¹@ƒƒWƒXU™™WmÅXm¯IWwkVWlÅLݼÆl¦ƒšÅÅÇl„bUllnknm@kmVmóÅkуUW`—@@„ƒb™ƒm™b@™¯mkô›IkVÇwnš„VƒÅKmlƒLklmȁKƒšVĊK°²„`n˜¤n„U„bWl„xVx™LUx@°nXm`VklVxmnnx"],"encodeOffsets":[[114053,23873]]}},{"type":"Feature","id":"4401","properties":{"name":"广州市","cp":[113.5107,23.2196],"childNum":13},"geometry":{"type":"Polygon","coordinates":["@@Ș¼VxUnĊ¤@z„@šÆ@nÈW°ÈV˜w„ŽUÞVxÞX@ŽšK„šl@ބVaĊbœU@ml£k±lUƒkkJƒw¯UUw±ƒkLUm@w˜aUVmÞ£@a„KkI@ƒ‚KVUW@—ÛVƒmlIU±VU¥™@yğzƧǃƒšƽĠřšÅnī±m@ƒ²¯lƒ°@nÝÆóUll@XnÝVU¦mVV°—„V¼™Jƒn„b@°mbn„ƒ‚@²¯‚¯wVwƒ@@nmxX¤¯L@ŽVLU„m@@l"],"encodeOffsets":[[115673,24019]]}},{"type":"Feature","id":"4415","properties":{"name":"汕尾市","cp":[115.5762,23.0438],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@@‚„@VxnXWV@š„bVššJ„„V@ÞÅU¥Ċxš£UWU‚wÅUU¥WVUkĊÇnkV`°LV™„wƒƒnU@™„ƒlbĊ¯„Vnalšš@@çkUÝ¥ġaó¯ÅaÅLŻÆUýmy¯ó@ĉÆó„ȯw™ÆXbmLƒ‚@nknVxkx܄ĢҚW„Æl„V°„Ll‚²xlz"],"encodeOffsets":[[118193,23806]]}},{"type":"Feature","id":"4452","properties":{"name":"揭阳市","cp":[116.1255,23.313],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@V„Ȧ„Æ@X°V@@¼‚x²°@„lÞaWXX@‚aÞWlnUŽ„xVnnL„‚°V„@k‚mĢl@„ak™@mlk°aXƒ±„nwm±™²¯JV²@ƒwW˜—_mƒa„V»ƒU@m¯ĉUф™šJl™„ašbVn„lĸLlƅÛDZwÝ@ĉxó@è™@k™mbƒUĉ°kaƒ„@šmV„„ƒxUš¯KU_mlĉÈVlXUV¦ÆVxVŽVX™¤ĉwV¦ÝÆ"],"encodeOffsets":[[118384,24036]]}},{"type":"Feature","id":"4404","properties":{"name":"珠海市","cp":[113.7305,22.1155],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@„è@„Þ°V¦VƁ°˜wnb„UÆ»nçƏ@nxܤ²llU°VnÈJސ°UôéšķUklƒô£VVˌKÞV°£n¥ƒ£ȗ™Ýy¯¯mÅkw¯bÇĔğ@Ýn¯ĊƒVğōŁŻƒķJ@Ț","@@X¯kmèVbnJ‚™"],"encodeOffsets":[[115774,22602],[116325,22697]]}},{"type":"Feature","id":"4406","properties":{"name":"佛山市","cp":[112.8955,23.1097],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@Èb˜Ž„InVVšnUÜxn„šVV¦nK˜lnbÅǬlalL@mn„Ubš¤l¦™šƒLUmUVlԜ¤@xmnVl°_XVVmƒkVmș@kn@VƒUK@°KW£nw@m„@Ux°x°@±„mƒna@¯ƒa„mšIU»˜ƒU¯nUV¥ÞUWmk@Vk¯™Ukn›ÑWݐƒĊÛ@Ǧ™W¯Wݗw›Lk°ƒkL¯wVa™WJXšWnbƒwkVƒ™W@kĊ"],"encodeOffsets":[[115088,23316]]}},{"type":"Feature","id":"4451","properties":{"name":"潮州市","cp":[116.7847,23.8293],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@°ŽÜknèmx„b„z„@V‚VX@VnV@lšIVVV¼nKlxn@@¦Vx°LXbla„ŽWbœV°£¯™W@nW@™‚aUñVœwWš»@¥ŤÅUÝǓÝóV@ńǎkUVmƒIUwÅVWÇX¹›—@W„¯bkl@nlšƒb@‚kġŽn@l"],"encodeOffsets":[[119161,24306]]}},{"type":"Feature","id":"4405","properties":{"name":"汕头市","cp":[117.1692,23.3405],"childNum":2},"geometry":{"type":"Polygon","coordinates":["@@‚@U±°Iš±n²mx²ƒ˜@œWºXÈÆUVx„JUnlVȍ@ŃôUǔÞVçn»VyĢÛVm@»kaÝUǼóšÛÈķKċ¥X„¥Wwğk™ƒ¯@ƒwķKƒkUm™aƒbkš™IƒšVÒ°Ċ@n„VU¼ƒ‚„bn˜`X—„x"],"encodeOffsets":[[119251,24059]]}},{"type":"Feature","id":"4403","properties":{"name":"深圳市","cp":[114.5435,22.5439],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@ÞLš„@xšbV„šVšK°™X°Kô¥Vw@anU„胐š‚lkĊl@wn_lKnbVmU„aUź@nÿ˜™UmÝѯUƒbk„@ÆkxŻ@™aÇX—wƒJƒƒ¯LķÝUĕ™ó™ĸóêWº@b²nmĬ™Æ"],"encodeOffsets":[[116404,23265]]}},{"type":"Feature","id":"4419","properties":{"name":"东莞市","cp":[113.8953,22.901],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@Ŏ@ššblKnšykVa‚KnbnIVmUƒ˜kUmUIUә„ƒçmV@bUxó¦¯LW‚¯š™L™UUƒ™a@w™ƒÝKğŚ™ƾ„„ƨÈĠy"],"encodeOffsets":[[116573,23670]]}},{"type":"Feature","id":"4420","properties":{"name":"中山市","cp":[113.4229,22.478],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@‚XœÒlmšV°ôÞÅ@m„¯°k„±‚@@aX¹¯VݏÇIUmV¯kk‚±Û£mw@‚Őmèżmô™¼èVš"],"encodeOffsets":[[115887,23209]]}}],"UTF8Encoding":true}; }); -define('echarts/util/mapData/geoJson/guang_xi_geo',[],function() { - return {"type":"FeatureCollection","features":[{"type":"Feature","id":"4510","properties":{"name":"百色市","cp":[106.6003,23.9227],"childNum":12},"geometry":{"type":"Polygon","coordinates":["@@lklWXL@VšI‚l@XnJn@VUUalk@mK@kny@UlU@a°™„ƒUU@VmaU@Ua@UWw@ƒn@KmLm@alkšmnI‚m@an@VIUamWÅImwU@@a@K„X@JVL„UVmUaVkUa@m„@@Ulmkk°ƒUaVUlKXbVwVIkaVmUk@KVk@a„aW¯m@w„¥laœX@KmaškVmnUl@nxVKšInU@yVaVIV@na°KlxX@@_lmXšUV`VIV™V@„n@lšbn@@WUkValK@²yl@„„VUV@@K°L@KU@@UVaXIVVV@naVkVa@K@UUK@UUa™LWa—w@m@K@UVVƒ@mVUUVKnL„mVL„K‚bVK@UUIk›mI@mUIVK@IUK@VkLƒ@WU@mU@WmUk@ƒI@VƒJk@WwX_@amK@UUWkIƒ„ƒK@LVb@mVmakL@J@bU@Ux@xƒbmI@`ƒIwm@UbmKUaUWa¯UkJWV@XƒJUU¯LUmV@ma@kkamKwƒLUUmWVkkm@aVUUkVKnVVUmXK@UW@km@Ukkm@@W@U™kUy@I@aUUmbƒ¤U@kUmL@bmJU@Ua@wkLWWkL@Uƒ@VaU@ƒLUakKWbkUWVkKkLVLUV@JVbƒz@Vƒ„@ƒVmUU@kVmK¯@VƒU_™VWakVmIUKUaU@@bml@XU@@V@LmKUV„mVUKƒƒKƒbkaUXƒKUL@x@V@l@„mxU¦„V@ŽlL@V@Ln@@VV@„nlKUaV@nLUbmJnL@VWLkbmV„@@L„W‚„XLlx„VVIVV@x@V²blUVm„LVUœK@kWWXUlV@Xl`„LX„l@@VšŽƒn@VnbVš@lVUVUÈVbš@@`UXU`l@@XUVm@kš@xmVknUJVXUbmKULmbx@VlJ@LVbkKUbVLÇUUVƒUVmU@VaUkUKƒVUwmLkUUVVlƒbka™XmwƒKUšVVU@@V±Uk@VWUUm»XamU™bƒKk™`ƒ„™U@UnWW_kKmbUVUVmnUV@„nJVUlšUbU@UV@n@JmI@VmbnVUXlx¯ŽkKmnVV@L@V™bkV™Umm™@Ub¯LmlUƒL@VWLkmkLmmn£WmnKU_mW™š™bnbmxƒ@U¦UJU„@Xmlk¦@‚mnUUm@@Jn@lV„ÔVJnIVW„I@a„ƒÆK@I@aVK„IlŽÞnnl@nl`nbÆX²l@xV„@llbVn²ŽVVl@nn„V@IlW@Un@@kVa°KšnÈmVaVXUlaVƒÈU„VlwôUlynIVašan@lVXb‚Iš@n¥la@Kš_n‚@bÆx@XnJV„nKVz@`VXVšU`@bƒ¦UV@VšIlx„UnV‚K„XÈbšVllšbVbnVn@"],"encodeOffsets":[[109126,25684]]}},{"type":"Feature","id":"4512","properties":{"name":"河池市","cp":[107.8638,24.5819],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@lLVl„bVV@nXVlI@JVX„mšn„W°b„IVV@‚ln„@nalVUb„nW‚@kVkÒlbVKn²°bUŽlV²@˜X@`nb„aUI@ƒ°wlU@aXJVI@aVK@wUamIXm‚@XUV@@bV@Vm„ImnUUwVaVKXU‚nVK@akƒVwV@nL@UV`n@@X‚lnIUJl@X¦˜V@aUIVm@anƒV@UwnL@VlbVL@KVVXUWƒ„wUUVUka@UVJnUlbnalbVVn@°„„LV`Þ@šXVxV@@bVlUVVbXnWlXnmlš@XXWVXJmbUI@V„llUVkn@@VWV@Vnb„@VXUJVnn`lLVk„a„»lVšLnw@WV@lInw@WnU@U@m‚knUVó„K‚wUmUXUƒU@@wVJVIl@XKVVVbVI„J@Un@lŽVLnm„b@U@Ul@nUš°VUVJnnVJV@„@mVU@ƒ@wkUVwkKWk™yUUkU@alkÈ@lJ@x„Ilƒ@UUWVkUw@Kn@@kmaƒVUl™UUL™ÇƒUUKl@UUmL@aXU@mlUUwmKkUUVKVUƒaƒKUnK@U@Vl@XUWU„KlwX@šb@K‚@XkV@UwWJka@aUwmV@U™@@U@wUm@»kLWVkIWŽXnmV@VkbmKƒLUbk™Va@aƒa@@aVU@aVak£@ƒ±UkVU¯V™UUƒJVƒUIƒ@kxmUmWUbL›w@K@aU@@aVU@Kma@aka@_VWkk@UWVUKULWKULUš@KUnƒwVaUKƒxU@UmaƒL—m@kVmVa@UkƒmI@ƒ@KmIkxU@@K™U@mmakI@VƒLkmWkkJ™_U‚@V@L@n˜xXbšKVb@VVL@V@LUbUlmbU@UUWJUb@VV@@L¯K@LU@UVƒƒk@±z@‚kLUbVl@Xm@™akm@ƒU@UšUJU_™VWŽkn@`W@kw¯LmbU@UJUb@zmV™JULmwk@mVUn™lnb@L›Wkbƒ¦@x°nXŽƒb@bUl@LVlUnlbUJUxWakLUVVb¯„llkn@Vƒ@@nVbUlVbUnƒVUK@IƒW@L@bV@nxÆJnXVbUJm@@bnmJ™nkl@b‚nnK@L„m‚@Xx@VVbV@nb@UVVƒ„¯š@bkV@Vmz@lnLl@kŽVbUVm@mI@Wk™J@UWKkXkl"],"encodeOffsets":[[109126,25684]]}},{"type":"Feature","id":"4503","properties":{"name":"桂林市","cp":[110.5554,25.318],"childNum":13},"geometry":{"type":"Polygon","coordinates":["@@nU@J‚X@`XLm¦Vb`lšVXXWš@VblČnVšŽlanLnmVLšK@_Vaƒ¥@kUa„@VmVb„aV@XVVzlVVK@knKVmX£VKšLlbnš@b@llL@xĊôXaV@°È@¤„bn„V@@Wl_„V„U@W„nVamw„wVbn@„K‚VšLX@VmVUxlV@šnVV_nK@m‚I@Wn@@IšUĊ@@wVWX@@I°VVm@wmU@m@IUƒV™kƒlkUmmkÅV@@aV@@Wn_UKla@kšaV„šlVanb@k„@@KlVn@@aV@nIWW™UUaVU@™kKmwU@UImKk@UU@w@W@‚™k@™UkWƒ@mk_W@Ua@a™ƒƒ@—¯ƒmV£@mƒUUam@—kWakƒVama@UUm@nw@alaUmnUlVlIœV‚™šLVyk£Vm@k@UUJkƒK@kmKUw™KkWK@UXImyVwnI@m‚ƒkUlkUKkUVmƒw@kkJWUÈm@_k@@aƒaW@U„UJUwU@@IWKkƒmUUV@nVl@bVb@bU‚UXƒakw@ƒWUkbkKƒbm@™xUlkLm@@wmKUX@‚™UaVW™XVmU@@UUUƒxkmWXkKkUWaUaUb™L@`UL@LV`UXmK@VmakLVbkL‚xUJUIVbUVVb¯KƒV@Xnl@lVXbmÒnV@L@VWKkVUIWJkIƒŽUamUUbm@U„kU@JUbW@X„WxUam@kbVVUnUJmUUV@bƒU@UUV™@ƒVk@ƒbƒmULV¦U@V„U`VLUL@xVbn@UJ@nWJXXVŽVV@bkxVbUx‚Lšš@x„¦@šU‚lXUVVlULV@@šnŽU„ƒb@xl„nJVnlVknUlVUbmŽU@ƒbVš„x"],"encodeOffsets":[[112399,26500]]}},{"type":"Feature","id":"4501","properties":{"name":"南宁市","cp":[108.479,23.1152],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@lKnbnU‚@Ua@K„L„ƒlJVX@VnL@bW`Xxl@„I@U„Jl@nV@X‚V@nXV„@lK@UVL@JULVJ@nnJlœVJ@VULaƒLUKƒnmKULVVUŽ@nU„š`lIXlln„K@UlJnb@nšV@LV@lwnJ@L@„nJl„@VUbUn@l˜n„KnbVŽV@„wVLUb„xVm@LV™VKXLVKVLXU@VllUX@`lb@bnb‚L@ŽUV@bV@@b@Lœx‚KVanXVƒUUmVUUUaVUky‚UUa„ImK@mUUVUkKU_@W@UVVVIUW„UVaVU@UUKnƒ@k@al@ll@bnL@b„VUV˜X@Vœ@@b‚Knblmn@V_@aUalL@a@akK@kVKUKlwUUnV¥VmU_VWVIVaX@Va„alńK@LVJnalL@LnK„wlVUw‚mX@VXšƒlLUVnblaUmVUVwXU@Wm¯Va@ÞKnw@w™mšk„»‚UVW²a@_mW@U@I„y„LVUUKW@@™„LX@VUV@@yVU@UV@nwUUmJka@IU@ƒmƒVkaW@UwUX@`ƒ@kLWUk@mƒkUUm@k‚UUWkUƒkWxk@@VƒK@nV@UVaƒUUJmIkVƒ@UamLUbkVmamLka™@ƒ‚kmL¯WI@wJmwƒx@akU@aUKmbkaW_nW@_U@Wm@a@wkwUKmƒk@ƒbkb›w@mKUkkU@J@bW@kVWz@bVUa›VUx@„ULkJWbXVVXƒ`@œmJUVU@@Lk@WbU@UJlnXlm„Vx@Ln@‚b@K„LX„WJUUW@kƒaUVUbmV@nnV@n@lVLƒVmLX‚mXkV±@kxÅL›šUbJWIÅJ@I‚mXalkUamKkškL±aVwKƒUU@mÞnbWJX„m„@lbmKULWUUVkaƒbnn@Vl@VVV@VƒbVbnLWLXJWxXLV@@VV"],"encodeOffsets":[[109958,23806]]}},{"type":"Feature","id":"4502","properties":{"name":"柳州市","cp":[109.3799,24.9774],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@ƒwU™„aV@nVaUVklmkUUmmIkƒ@w„aVƒm@™U@VKUkVUkWV@™ƒ¥@w™™KVwUalw@aUUUWWXI@mVIm@Ua@wVKUKV_UƒV@U¥VK„n„al@„Uš@VU@V„V@aVUnVVIVmUUlan@VbXwWƒX@Va@IlVVƒn@VanVVb„lJXIVJlUXL@U@KmUnÑWakU@mkƒJUI@mk™@wUmmUV@JXaWIXWmaUIƒJƒkk@W„nJ@„ƒaUak@›kkJ@kUKU_ƒ@myUóWUkm¥kUmL@KUKm@k_UmVa@ƒk@@UmU@mm_—JWIUVUŽWLUlbVUJÇVUIVwƒKUVk@mU@n@lUL@Km@@l@L™VƒzJmUU¤m@UbV²U`U@@¼Vn@x@Vš@@VnUVx@blbXIVxU@Wl@@L™aW@kxƒLXVWVk@@U@VmLVŽ„L„bUVULVV‚lnLVxkV@nWV@bnKVVk@VL„VšÈVKšVVk„Unb@lm@@LVxUlVX@Vk„ƒJ@wkIÇ@kl@blVVVšzXllLUxlV@x@„UV@nƒ‚U@UImmUIUV™¯mVk@@V@VƒamnUKkm@@VƒIUJUaUUWLk@UJUI@xV@V„VWVnxƒLUômVV„@VkVVVUnV@UVkL@VVV@bVxla@bkXVJVn„`nU@bƒb@bVL@VnJ@„l@šV„aU@@_lW@UUU@Unƒlll@XLl@@UX@°bVWVanLlknVV@VVX@VVƒnUŽVLmbXJ@nllXX@`VXƒlmaXVWk@Wkƒw—J@„VL@J‚bnU@bn@@bVKUnVJVIVVVL²a@bV@@Vl@nUVakalmš„UL@VUL@V‚a@mXl@nK@UlK„L@Vl@@nkllb@š„Vnn@‚šnV„™V°l„šVInwlKXxlU°Žn@@ƒ‚I@UnVlakUJWkUK@anUWK@_ÞJ@U"],"encodeOffsets":[[112399,26500]]}},{"type":"Feature","id":"4514","properties":{"name":"崇左市","cp":[107.3364,22.4725],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@@JVzšl@V@Xn@ll@VlnX@@VWLnŽUVmUULVlUV@blnUlnXVV„K‚xnLlb@lnbU@Vn°KVV„I@WXUlI°VXb‚VVbnLVan@‚x„J@_nJ„a@wVwV@@a@IU@UU@WKXwWIXKmKUa„a@U‚UUUk@@Umm„albVUXVVKnL‚a@knƒWƒXImanÝV@„V‚LUx²blKl™nLVbklWbn@JÆIXJ‚IVaœ™ÆKlw²@lUnWWnK„UUK@k@mmU@mnUVaVU„b@lVXVXIWƒƒK@Lam@@KUwnƒWkkmVIV@Xal@@KV@VUnI@›„_UWWUkam@kkm@ka@mƒk@wkJWIUU@WXkW™XkWWLUUƒ@UakLƒW™XV±VIVWUU@anUWaUK@IU@Vak@@UUKWaƒ@m@ak@@wUkla@mUaUklakwVƒ¯¯@WWUkLkKmaƒ™kLUnV`UxWX@Jkn@bmlƒakkk@ƒb@l¯bm„ƒbJ›b@VXn„bVV@„ƒbƒJUkkKWVU@mœÛVUUW@UVUJWXkVkKmUL@WW@U„Vl@XXKW„XJ@XVlmbUxnnm@UlVnV@XVm¦VJb@šmLkKÇbXblVkn@l@bWnX`V@@IVV@ŽV„V°n@@_naÆVVbUVVbUJnzlVUl‚XkV@Vlx@X„VnxƒbƒKUK@b¯VVUV™L"],"encodeOffsets":[[109227,23440]]}},{"type":"Feature","id":"4513","properties":{"name":"来宾市","cp":[109.7095,23.8403],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@nVlw„@VJU„„IVVUšV°lU²V@„l¤Ub@bUV@b‚@„b@bUblšVa„KnLla@UnUWmXlJXUlKV@V_U±Van@V£nV‚I„yšU@K@kn@@LVK@k@mnVl@VU„LUxVJÈUVIU‚aVkXKVVUXJ˜In`@nnV@Vl@@„UbVnl`n@VL@LnKlVn¦VlôXV‚nz„@V`VL@llIœll@Vb„b@ƒmIXƒl@„l„IVJnbWXXJWb@IU‚nVVn@xlš@nVJ„I@W„U°LUaVUUaVJVIwlKUalKnb@UnLVWU_@KVK@_šKVa„@VKU¯VLVKn@la„aUkU@maVU„J@k™@Um@XmbkyVaUIUU@KV@laVn@KXKWUkUk@ƒaW™UUVw@aXKmƒVaUUkšmIƒlUU@wUa™xUmmU™¯™U@WƒLUmVIUym@UVmUa@wmw@çm@aWLU„™JUIUamKmL@™aƒx¯¥ƒkU¥U@±„k„UVmKU_mJUbkKm„ƒLÅǙ_@WWUXUmaVUkK™„UWW@nVxkUƒxmL@KkKmbUI@KƒLkƃbUbW@UbUJUXV`UnU¦mŽVVkxVLUL@llL@b@bkKVb@bU`m@knmaL@a›@@U—WVUƒU@amK@akkk@@b@lm„VL@VUVUbƒVVXUJUU@V@XV`lLUVVV@nnLƒJVbVlzUVVbVVnUVVU„"],"encodeOffsets":[[111083,24599]]}},{"type":"Feature","id":"4509","properties":{"name":"玉林市","cp":[110.2148,22.3792],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@VJUXVVXlWX@V™xVnX@@`ššULWŽUXÅbWK@mULUUmJ@n¯b@l@VULVx„x‚XU`VXXJVI„V@nm`@nUŽVXn@lWVn@b@Jn@nU@Lm`@Xn@WJƒ¦U@@VnL„lV@@Xl`nIlJnkVL„w@KVK@UšaVL@bVKX™lUUKVK@I„VšL„a@U@WšLUlVL@bU@@blb@VlbUxVbXUVJ@xVL„U„lV@VU„bVLnKl„XJ@L‚b@an@VanL@`VLšKV_UWl@U_„a@WVInlVUUUVm@I@W@wVakIWm@U@ƒXwlaVbnI@ƒm»Va@aXaVLšU„»@aVa@k™KkL@KmU@WƒzUK@wU@VWUUVUUKUa@mKmbUK@_nWVaUkVaUaVUVLXKVƒVUVmVI@UkKkLm`UkW@UwWW_„UaU@WakXmK@xUXƒJkƒUUWUk@Wl—mJ@km@@aUKzmyVk„a@kkWVUU¯lmU@@w‚kkmV@Vk@mÅIƒ‚Ukƒaƒ@Ub@m@UUU`mUbWaWmb™X™XKWIXUWm@љ@y@UkIUJUUWLUWƒL@UkVUxW@kaWbKWnXxW¦n„m`XLVlUbVbUx™I@JmLUKUb@VW@@bkL@b@VlU@xkš@L@lƒxXxWXX°V@VVVbUVV@UVVbULVnVJUb²b‚aUb@VVVVInlV@VnXaVUšlI„VUb"],"encodeOffsets":[[112478,22872]]}},{"type":"Feature","id":"4504","properties":{"name":"梧州市","cp":[110.9949,23.5052],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@VbXblVlLXWln„wVV@VV@UnšWUXVbš‚@VWXa@kVK„UaVaVkšUlyX@Vaƒ—VmUwUaVU@UÈymI@aU°@š™nWV@VaVaw@IV@VmnLVK@kmmna@™„™VbVI@aV@XbW`U„„LUVVx„@VbUV@bl@VLXblJn¦lL„°°@n™@K@UlLnK„a°LWbnJ„¦UÒV„UllLlVnKnbWnn„V`„w‚@@Xa±™n™l@XKV_„WVkVa@kVyUa@wU£UW@UIVW‚@@a—wWaX_WKkVmUULmak@UJUI@±m»™—k@m»VyUIm™nmmwnkUmVaVIUn_mW@»Vk„@VwkmmUXa@IƒaVm—mƒ@Wm_U@mIUWóLmUk@laXmmkUK@UmKULUUmWULƒ@VakU™@Ub@bƒ¼™VUKWb@bUbn¼@„mJUakbWx@„@VXnlJUb@x@X@JUnVVUVmkUJ@XƒbV`k@VXU`™LUK@_mKUbm@@b@„U`@nlV@b„UnbVbn@@`VbUbVV¯bm@@mJXb@bVnUllVXUlbUl@LU¦VVmŽkLVb@b™l@V@XlK@V@nUJUz„°mŽwmLmlXbWVU@UUUlƒIU@VVmV@@¦‚bXbWxX„WlXVWL@LUmkbU@@LVVVJUblzna@WVnš@@lƒIUVnbV@Vlƒbkbm@ULUKV°ULƒ@"],"encodeOffsets":[[112973,24863]]}},{"type":"Feature","id":"4511","properties":{"name":"贺州市","cp":[111.3135,24.4006],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@nL@xn@lKVkšwn@„alLlaXV@„lx„bVWV@aUa@aUk@mVUnVl„XL@JV@VxVIVƒX@„b@bl@@`ÇnXVlI@l„xUnlVVLkllV„@nmJUxnzWJ@VXLlŽšLVxnL@l„LlŽVI@V@lUnl¤Uz™Kš@„Vl@š„L‚l„Lnš‚b@VnVVU@k„a‚Knxn@VkVJ@ńUlakmWIUaVanm@_UK@UVWUa@klXam™U@Vmƒ™VIXW„@lUVknVlKVLXŽVXšW@b@VlšnnVL@KXL‚Kn@lb@UnW°@Va„X„WVb°aVa@I¯aUkUaVKVwƒaXk@a„a‚™@wkm@alanUVw@alK@Umkw@UƒaUmU@WXUaUK@UW@UaVWI@¥Xa@w@WWšVƒXwƒU@mKUXUWVU@a¯kl@akU@UULmK¯VUVW@U_m`U@@xVbUz@lUbUlƒXU`WLk@mš²šWb@Ž@ƒxU_mƒXmmamLkUkKVkUƒVу¥mIXa¯KƒbmLkK@V@Lmš¯@ƒ¯kKm¥kIWaUKk@@aVUUaƒ@UwVUƒKVƒX_WaU@@bUJUaƒš@šmbnn@lULmKUnU@@J‚xUbUbU@mX™š¯@VŽ@bnJÇz@VUVVbVxUn„˜UbW@kz™VUlUbVbƒŽUL@lWb"],"encodeOffsets":[[113220,24947]]}},{"type":"Feature","id":"4507","properties":{"name":"钦州市","cp":[109.0283,22.0935],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@@IlVVlnL‚@œxla„al@n„VLlx@x@bXnV@@`mXX`lbnaVL@blV@b„wnx‚I@xXJ°nK‚l„š@lbnKnblUVanKVb„@lUnJVI„VUb@V‚U@m„L@Ul@Xw„llVVXV@lVnlVn„l@XVlK„@@_VWVxX@lb„U„nV@@JlbnIlmnVV@UwVK@U@k°a@mnIVVVK@nXLÆaVWXVK™™@_W@Umšw@UXWWkUUVWUIVaƒUkJ™UVWbUmU@mkUJUU@UVab±aVaUIUmVKUaVUU@VUUaUUU@W¯XWWw„w@k@Kl™@wkV@U@alK@aX@@UmIUWUIƒ@mmkXU`U_WJUnUJmUk@@amLU@UVW@UkU@@VƒbUWVUk@@wmKkUWLUWX@JmIƒlUkkKWKkLWU@UKWa@bU@@a@_UKWƒUUUmJmw@nV_@ġğKóLmbU¼VÆ@xUXƒ@Um@wklVnUn›lkaUV@„lV²WVklWXXbWlkVkIm`UUƒLƒUU@UWƒx@XU@@lWLU@kbUbV`UXllUV@bmb@LnKVbULm‚šnVVIV`X@"],"encodeOffsets":[[110881,22742]]}},{"type":"Feature","id":"4508","properties":{"name":"贵港市","cp":[109.9402,23.3459],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@n@VzUJ‚nVŽ„K@XšVš°nVVnšwVb@xVV„knJl™VVUbn„WL@bUxVVXš„bl@lVXkWƒXwWaa@¥‚@nUUUV@„JVkVVV@XUWanknK‚xnƒ¯VyVI@m@UkL@W@Ušk@aUalKnUUV¥@KVkkaWVkUVkUm@aWanI@n@°aUUVaUa@_m@UamaƒV@akU@mV_@ƒa@KWIkƒmLUKƒaUVU@ƒkƒVUK@wUIWVUaVwka@Uka@aV@@aUKVk™K@X@Vƒb™KƒU@JULVLkVWšUL@aUK™b@VUL@LƒxUKmlkImJk_@WU@ƒkmK@UV@„¥XIm@@Wn_@KmVm@@I@aUmkXm@UWV@mn_@mƒUUJWIUWV_WƒwU@mUknVVmxU@@VUV@zU@UVW@ƒK@šX@VLUVƒKƒz@J@VnX@`±bUXVƒ¼™lšn@xmxÝL@‚Ubn°@XWVUxUVVnkbWVXV@Xš`ÆȄKnƒlLVanIV`nLVUlƒ²ƒV@V¦„l°¦„w‚b@šnKnLVbVJšIVƒXK@b‚n@ènx@xVbUnV‚"],"encodeOffsets":[[112568,24255]]}},{"type":"Feature","id":"4506","properties":{"name":"防城港市","cp":[108.0505,21.9287],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@XV@X°°U„lxkbVlVb@nkbVl@xl@@b@n„‚XbVL@Vl@UbV@@JVLXbmV@bVVUXUJU²šW„XlKVb„@VVXKlXšWlXXWV@VXJlI@x„l@nlbn@lln@lbXalIVK@ƒVwœUVb‚U@aXylUX@@aW@U_UJmU™nVKUamL@Kna@aVUkkVWU_ValaV@XK@kV@@W„wVXV@„V„KVVn_lJlUXkWaXWlkXU‚±kU@ƒVUlbœkVmUmlk™¯Ý™™W@mb@¦VxULm™kJUU@ma¯wƒmkX@VóJ±bUVUXÝWk™lWXXlƒxUaƒbƒIğ™Ç@U@mVUKkkm@UJm@XnWV@x"],"encodeOffsets":[[110070,22174]]}},{"type":"Feature","id":"4505","properties":{"name":"北海市","cp":[109.314,21.6211],"childNum":2},"geometry":{"type":"Polygon","coordinates":["@@VaVLnK@IšJVwUaVaUkWKn_mƒX¥WwXm‚LXalbU£UyV„Å@ݙwm@™°l›LÅUƒmk™mwÛaƑLÝUUm@ȣƃV_„Ó@£UƒƒUVƒ„™¼U°W̄™ÞVbXbôx@b@bmV@ǃ™UÝ@@ĢU`m@ŽnxnIVV‚VX„VL@`@bV@@aXbVL‚@XVlKXLlLVl„knJ@I‚WVXXKlVnL@xl@UVVX„a@UV@VlX@VUV@nK@bl@nVVIVmXIV`V_lWnn„@VJVXnJ"],"encodeOffsets":[[112242,22444]]}}],"UTF8Encoding":true}; +define('echarts/util/mapData/geoJson/guang_xi_geo',[],function() { + return {"type":"FeatureCollection","features":[{"type":"Feature","id":"4510","properties":{"name":"百色市","cp":[106.6003,23.9227],"childNum":12},"geometry":{"type":"Polygon","coordinates":["@@lklWXL@VšI‚l@XnJn@VUUalk@mK@kny@UlU@a°™„ƒUU@VmaU@Ua@UWw@ƒn@KmLm@alkšmnI‚m@an@VIUamWÅImwU@@a@K„X@JVL„UVmUaVkUa@m„@@Ulmkk°ƒUaVUlKXbVwVIkaVmUk@KVk@a„aW¯m@w„¥laœX@KmaškVmnUl@nxVKšInU@yVaVIV@na°KlxX@@_lmXšUV`VIV™V@„n@lšbn@@WUkValK@²yl@„„VUV@@K°L@KU@@UVaXIVVV@naVkVa@K@UUK@UUa™LWa—w@m@K@UVVƒ@mVUUVKnL„mVL„K‚bVK@UUIk›mI@mUIVK@IUK@VkLƒ@WU@mU@WmUk@ƒI@VƒJk@WwX_@amK@UUWkIƒ„ƒK@LVb@mVmakL@J@bU@Ux@xƒbmI@`ƒIwm@UbmKUaUWa¯UkJWV@XƒJUU¯LUmV@ma@kkamKwƒLUUmWVkkm@aVUUkVKnVVUmXK@UW@km@Ukkm@@W@U™kUy@I@aUUmbƒ¤U@kUmL@bmJU@Ua@wkLWWkL@Uƒ@VaU@ƒLUakKWbkUWVkKkLVLUV@JVbƒz@Vƒ„@ƒVmUU@kVmK¯@VƒU_™VWakVmIUKUaU@@bml@XU@@V@LmKUV„mVUKƒƒKƒbkaUXƒKUL@x@V@l@„mxU¦„V@ŽlL@V@Ln@@VV@„nlKUaV@nLUbmJnL@VWLkbmV„@@L„W‚„XLlx„VVIVV@x@V²blUVm„LVUœK@kWWXUlV@Xl`„LX„l@@VšŽƒn@VnbVš@lVUVUÈVbš@@`UXU`l@@XUVm@kš@xmVknUJVXUbmKULmbx@VlJ@LVbkKUbVLÇUUVƒUVmU@VaUkUKƒVUwmLkUUVVlƒbka™XmwƒKUšVVU@@V±Uk@VWUUm»XamU™bƒKk™`ƒ„™U@UnWW_kKmbUVUVmnUV@„nJVUlšUbU@UV@n@JmI@VmbnVUXlx¯ŽkKmnVV@L@V™bkV™Umm™@Ub¯LmlUƒL@VWLkmkLmmn£WmnKU_mW™š™bnbmxƒ@U¦UJU„@Xmlk¦@‚mnUUm@@Jn@lV„ÔVJnIVW„I@a„ƒÆK@I@aVK„IlŽÞnnl@nl`nbÆX²l@xV„@llbVn²ŽVVl@nn„V@IlW@Un@@kVa°KšnÈmVaVXUlaVƒÈU„VlwôUlynIVašan@lVXb‚Iš@n¥la@Kš_n‚@bÆx@XnJV„nKVz@`VXVšU`@bƒ¦UV@VšIlx„UnV‚K„XÈbšVllšbVbnVn@"],"encodeOffsets":[[109126,25684]]}},{"type":"Feature","id":"4512","properties":{"name":"河池市","cp":[107.8638,24.5819],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@lLVl„bVV@nXVlI@JVX„mšn„W°b„IVV@‚ln„@nalVUb„nW‚@kVkÒlbVKn²°bUŽlV²@˜X@`nb„aUI@ƒ°wlU@aXJVI@aVK@wUamIXm‚@XUV@@bV@Vm„ImnUUwVaVKXU‚nVK@akƒVwV@nL@UV`n@@X‚lnIUJl@X¦˜V@aUIVm@anƒV@UwnL@VlbVL@KVVXUWƒ„wUUVUka@UVJnUlbnalbVVn@°„„LV`Þ@šXVxV@@bVlUVVbXnWlXnmlš@XXWVXJmbUI@V„llUVkn@@VWV@Vnb„@VXUJVnn`lLVk„a„»lVšLnw@WV@lInw@WnU@U@m‚knUVó„K‚wUmUXUƒU@@wVJVIl@XKVVVbVI„J@Un@lŽVLnm„b@U@Ul@nUš°VUVJnnVJV@„@mVU@ƒ@wkUVwkKWk™yUUkU@alkÈ@lJ@x„Ilƒ@UUWVkUw@Kn@@kmaƒVUl™UUL™ÇƒUUKl@UUmL@aXU@mlUUwmKkUUVKVUƒaƒKUnK@U@Vl@XUWU„KlwX@šb@K‚@XkV@UwWJka@aUwmV@U™@@U@wUm@»kLWVkIWŽXnmV@VkbmKƒLUbk™Va@aƒa@@aVU@aVak£@ƒ±UkVU¯V™UUƒJVƒUIƒ@kxmUmWUbL›w@K@aU@@aVU@Kma@aka@_VWkk@UWVUKULWKULUš@KUnƒwVaUKƒxU@UmaƒL—m@kVmVa@UkƒmI@ƒ@KmIkxU@@K™U@mmakI@VƒLkmWkkJ™_U‚@V@L@n˜xXbšKVb@VVL@V@LUbUlmbU@UUWJUb@VV@@L¯K@LU@UVƒƒk@±z@‚kLUbVl@Xm@™akm@ƒU@UšUJU_™VWŽkn@`W@kw¯LmbU@UJUb@zmV™JULmwk@mVUn™lnb@L›Wkbƒ¦@x°nXŽƒb@bUl@LVlUnlbUJUxWakLUVVb¯„llkn@Vƒ@@nVbUlVbUnƒVUK@IƒW@L@bV@nxÆJnXVbUJm@@bnmJ™nkl@b‚nnK@L„m‚@Xx@VVbV@nb@UVVƒ„¯š@bkV@Vmz@lnLl@kŽVbUVm@mI@Wk™J@UWKkXkl"],"encodeOffsets":[[109126,25684]]}},{"type":"Feature","id":"4503","properties":{"name":"桂林市","cp":[110.5554,25.318],"childNum":13},"geometry":{"type":"Polygon","coordinates":["@@nU@J‚X@`XLm¦Vb`lšVXXWš@VblČnVšŽlanLnmVLšK@_Vaƒ¥@kUa„@VmVb„aV@XVVzlVVK@knKVmX£VKšLlbnš@b@llL@xĊôXaV@°È@¤„bn„V@@Wl_„V„U@W„nVamw„wVbn@„K‚VšLX@VmVUxlV@šnVV_nK@m‚I@Wn@@IšUĊ@@wVWX@@I°VVm@wmU@m@IUƒV™kƒlkUmmkÅV@@aV@@Wn_UKla@kšaV„šlVanb@k„@@KlVn@@aV@nIWW™UUaVU@™kKmwU@UImKk@UU@w@W@‚™k@™UkWƒ@mk_W@Ua@a™ƒƒ@—¯ƒmV£@mƒUUam@—kWakƒVama@UUm@nw@alaUmnUlVlIœV‚™šLVyk£Vm@k@UUJkƒK@kmKUw™KkWK@UXImyVwnI@m‚ƒkUlkUKkUVmƒw@kkJWUÈm@_k@@aƒaW@U„UJUwU@@IWKkƒmUUV@nVl@bVb@bU‚UXƒakw@ƒWUkbkKƒbm@™xUlkLm@@wmKUX@‚™UaVW™XVmU@@UUUƒxkmWXkKkUWaUaUb™L@`UL@LV`UXmK@VmakLVbkL‚xUJUIVbUVVb¯KƒV@Xnl@lVXbmÒnV@L@VWKkVUIWJkIƒŽUamUUbm@U„kU@JUbW@X„WxUam@kbVVUnUJmUUV@bƒU@UUV™@ƒVk@ƒbƒmULV¦U@V„U`VLUL@xVbn@UJ@nWJXXVŽVV@bkxVbUx‚Lšš@x„¦@šU‚lXUVVlULV@@šnŽU„ƒb@xl„nJVnlVknUlVUbmŽU@ƒbVš„x"],"encodeOffsets":[[112399,26500]]}},{"type":"Feature","id":"4501","properties":{"name":"南宁市","cp":[108.479,23.1152],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@lKnbnU‚@Ua@K„L„ƒlJVX@VnL@bW`Xxl@„I@U„Jl@nV@X‚V@nXV„@lK@UVL@JULVJ@nnJlœVJ@VULaƒLUKƒnmKULVVUŽ@nU„š`lIXlln„K@UlJnb@nšV@LV@lwnJ@L@„nJl„@VUbUn@l˜n„KnbVŽV@„wVLUb„xVm@LV™VKXLVKVLXU@VllUX@`lb@bnb‚L@ŽUV@bV@@b@Lœx‚KVanXVƒUUmVUUUaVUky‚UUa„ImK@mUUVUkKU_@W@UVVVIUW„UVaVU@UUKnƒ@k@al@ll@bnL@b„VUV˜X@Vœ@@b‚Knblmn@V_@aUalL@a@akK@kVKUKlwUUnV¥VmU_VWVIVaX@Va„alńK@LVJnalL@LnK„wlVUw‚mX@VXšƒlLUVnblaUmVUVwXU@Wm¯Va@ÞKnw@w™mšk„»‚UVW²a@_mW@U@I„y„LVUUKW@@™„LX@VUV@@yVU@UV@nwUUmJka@IU@ƒmƒVkaW@UwUX@`ƒ@kLWUk@mƒkUUm@k‚UUWkUƒkWxk@@VƒK@nV@UVaƒUUJmIkVƒ@UamLUbkVmamLka™@ƒ‚kmL¯WI@wJmwƒx@akU@aUKmbkaW_nW@_U@Wm@a@wkwUKmƒk@ƒbkb›w@mKUkkU@J@bW@kVWz@bVUa›VUx@„ULkJWbXVVXƒ`@œmJUVU@@Lk@WbU@UJlnXlm„Vx@Ln@‚b@K„LX„WJUUW@kƒaUVUbmV@nnV@n@lVLƒVmLX‚mXkV±@kxÅL›šUbJWIÅJ@I‚mXalkUamKkškL±aVwKƒUU@mÞnbWJX„m„@lbmKULWUUVkaƒbnn@Vl@VVV@VƒbVbnLWLXJWxXLV@@VV"],"encodeOffsets":[[109958,23806]]}},{"type":"Feature","id":"4502","properties":{"name":"柳州市","cp":[109.3799,24.9774],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@ƒwU™„aV@nVaUVklmkUUmmIkƒ@w„aVƒm@™U@VKUkVUkWV@™ƒ¥@w™™KVwUalw@aUUUWWXI@mVIm@Ua@wVKUKV_UƒV@U¥VK„n„al@„Uš@VU@V„V@aVUnVVIVmUUlan@VbXwWƒX@Va@IlVVƒn@VanVVb„lJXIVJlUXL@U@KmUnÑWakU@mkƒJUI@mk™@wUmmUV@JXaWIXWmaUIƒJƒkk@W„nJ@„ƒaUak@›kkJ@kUKU_ƒ@myUóWUkm¥kUmL@KUKm@k_UmVa@ƒk@@UmU@mm_—JWIUVUŽWLUlbVUJÇVUIVwƒKUVk@mU@n@lUL@Km@@l@L™VƒzJmUU¤m@UbV²U`U@@¼Vn@x@Vš@@VnUVx@blbXIVxU@Wl@@L™aW@kxƒLXVWVk@@U@VmLVŽ„L„bUVULVV‚lnLVxkV@nWV@bnKVVk@VL„VšÈVKšVVk„Unb@lm@@LVxUlVX@Vk„ƒJ@wkIÇ@kl@blVVVšzXllLUxlV@x@„UV@nƒ‚U@UImmUIUV™¯mVk@@V@VƒamnUKkm@@VƒIUJUaUUWLk@UJUI@xV@V„VWVnxƒLUômVV„@VkVVVUnV@UVkL@VVV@bVxla@bkXVJVn„`nU@bƒb@bVL@VnJ@„l@šV„aU@@_lW@UUU@Unƒlll@XLl@@UX@°bVWVanLlknVV@VVX@VVƒnUŽVLmbXJ@nllXX@`VXƒlmaXVWk@Wkƒw—J@„VL@J‚bnU@bn@@bVKUnVJVIVVVL²a@bV@@Vl@nUVakalmš„UL@VUL@V‚a@mXl@nK@UlK„L@Vl@@nkllb@š„Vnn@‚šnV„™V°l„šVInwlKXxlU°Žn@@ƒ‚I@UnVlakUJWkUK@anUWK@_ÞJ@U"],"encodeOffsets":[[112399,26500]]}},{"type":"Feature","id":"4514","properties":{"name":"崇左市","cp":[107.3364,22.4725],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@@JVzšl@V@Xn@ll@VlnX@@VWLnŽUVmUULVlUV@blnUlnXVV„K‚xnLlb@lnbU@Vn°KVV„I@WXUlI°VXb‚VVbnLVan@‚x„J@_nJ„a@wVwV@@a@IU@UU@WKXwWIXKmKUa„a@U‚UUUk@@Umm„albVUXVVKnL‚a@knƒWƒXImanÝV@„V‚LUx²blKl™nLVbklWbn@JÆIXJ‚IVaœ™ÆKlw²@lUnWWnK„UUK@k@mmU@mnUVaVU„b@lVXVXIWƒƒK@Lam@@KUwnƒWkkmVIV@Xal@@KV@VUnI@›„_UWWUkam@kkm@ka@mƒk@wkJWIUU@WXkW™XkWWLUUƒ@UakLƒW™XV±VIVWUU@anUWaUK@IU@Vak@@UUKWaƒ@m@ak@@wUkla@mUaUklakwVƒ¯¯@WWUkLkKmaƒ™kLUnV`UxWX@Jkn@bmlƒakkk@ƒb@l¯bm„ƒbJ›b@VXn„bVV@„ƒbƒJUkkKWVU@mœÛVUUW@UVUJWXkVkKmUL@WW@U„Vl@XXKW„XJ@XVlmbUxnnm@UlVnV@XVm¦VJb@šmLkKÇbXblVkn@l@bWnX`V@@IVV@ŽV„V°n@@_naÆVVbUVVbUJnzlVUl‚XkV@Vlx@X„VnxƒbƒKUK@b¯VVUV™L"],"encodeOffsets":[[109227,23440]]}},{"type":"Feature","id":"4513","properties":{"name":"来宾市","cp":[109.7095,23.8403],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@nVlw„@VJU„„IVVUšV°lU²V@„l¤Ub@bUV@b‚@„b@bUblšVa„KnLla@UnUWmXlJXUlKV@V_U±Van@V£nV‚I„yšU@K@kn@@LVK@k@mnVl@VU„LUxVJÈUVIU‚aVkXKVVUXJ˜In`@nnV@Vl@@„UbVnl`n@VL@LnKlVn¦VlôXV‚nz„@V`VL@llIœll@Vb„b@ƒmIXƒl@„l„IVJnbWXXJWb@IU‚nVVn@xlš@nVJ„I@W„U°LUaVUUaVJVIwlKUalKnb@UnLVWU_@KVK@_šKVa„@VKU¯VLVKn@la„aUkU@maVU„J@k™@Um@XmbkyVaUIUU@KV@laVn@KXKWUkUk@ƒaW™UUVw@aXKmƒVaUUkšmIƒlUU@wUa™xUmmU™¯™U@WƒLUmVIUym@UVmUa@wmw@çm@aWLU„™JUIUamKmL@™aƒx¯¥ƒkU¥U@±„k„UVmKU_mJUbkKm„ƒLÅǙ_@WWUXUmaVUkK™„UWW@nVxkUƒxmL@KkKmbUI@KƒLkƃbUbW@UbUJUXV`UnU¦mŽVVkxVLUL@llL@b@bkKVb@bU`m@knmaL@a›@@U—WVUƒU@amK@akkk@@b@lm„VL@VUVUbƒVVXUJUU@V@XV`lLUVVV@nnLƒJVbVlzUVVbVVnUVVU„"],"encodeOffsets":[[111083,24599]]}},{"type":"Feature","id":"4509","properties":{"name":"玉林市","cp":[110.2148,22.3792],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@VJUXVVXlWX@V™xVnX@@`ššULWŽUXÅbWK@mULUUmJ@n¯b@l@VULVx„x‚XU`VXXJVI„V@nm`@nUŽVXn@lWVn@b@Jn@nU@Lm`@Xn@WJƒ¦U@@VnL„lV@@Xl`nIlJnkVL„w@KVK@UšaVL@bVKX™lUUKVK@I„VšL„a@U@WšLUlVL@bU@@blb@VlbUxVbXUVJ@xVL„U„lV@VU„bVLnKl„XJ@L‚b@an@VanL@`VLšKV_UWl@U_„a@WVInlVUUUVm@I@W@wVakIWm@U@ƒXwlaVbnI@ƒm»Va@aXaVLšU„»@aVa@k™KkL@KmU@WƒzUK@wU@VWUUVUUKUa@mKmbUK@_nWVaUkVaUaVUVLXKVƒVUVmVI@UkKkLm`UkW@UwWW_„UaU@WakXmK@xUXƒJkƒUUWUk@Wl—mJ@km@@aUKzmyVk„a@kkWVUU¯lmU@@w‚kkmV@Vk@mÅIƒ‚Ukƒaƒ@Ub@m@UUU`mUbWaWmb™X™XKWIXUWm@љ@y@UkIUJUUWLUWƒL@UkVUxW@kaWbKWnXxW¦n„m`XLVlUbVbUx™I@JmLUKUb@VW@@bkL@b@VlU@xkš@L@lƒxXxWXX°V@VVVbUVV@UVVbULVnVJUb²b‚aUb@VVVVInlV@VnXaVUšlI„VUb"],"encodeOffsets":[[112478,22872]]}},{"type":"Feature","id":"4504","properties":{"name":"梧州市","cp":[110.9949,23.5052],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@VbXblVlLXWln„wVV@VV@UnšWUXVbš‚@VWXa@kVK„UaVaVkšUlyX@Vaƒ—VmUwUaVU@UÈymI@aU°@š™nWV@VaVaw@IV@VmnLVK@kmmna@™„™VbVI@aV@XbW`U„„LUVVx„@VbUV@bl@VLXblJn¦lL„°°@n™@K@UlLnK„a°LWbnJ„¦UÒV„UllLlVnKnbWnn„V`„w‚@@Xa±™n™l@XKV_„WVkVa@kVyUa@wU£UW@UIVW‚@@a—wWaX_WKkVmUULmak@UJUI@±m»™—k@m»VyUIm™nmmwnkUmVaVIUn_mW@»Vk„@VwkmmUXa@IƒaVm—mƒ@Wm_U@mIUWóLmUk@laXmmkUK@UmKULUUmWULƒ@VakU™@Ub@bƒ¼™VUKWb@bUbn¼@„mJUakbWx@„@VXnlJUb@x@X@JUnVVUVmkUJ@XƒbV`k@VXU`™LUK@_mKUbm@@b@„U`@nlV@b„UnbVbn@@`VbUbVV¯bm@@mJXb@bVnUllVXUlbUl@LU¦VVmŽkLVb@b™l@V@XlK@V@nUJUz„°mŽwmLmlXbWVU@UUUlƒIU@VVmV@@¦‚bXbWxX„WlXVWL@LUmkbU@@LVVVJUblzna@WVnš@@lƒIUVnbV@Vlƒbkbm@ULUKV°ULƒ@"],"encodeOffsets":[[112973,24863]]}},{"type":"Feature","id":"4511","properties":{"name":"贺州市","cp":[111.3135,24.4006],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@nL@xn@lKVkšwn@„alLlaXV@„lx„bVWV@aUa@aUk@mVUnVl„XL@JV@VxVIVƒX@„b@bl@@`ÇnXVlI@l„xUnlVVLkllV„@nmJUxnzWJ@VXLlŽšLVxnL@l„LlŽVI@V@lUnl¤Uz™Kš@„Vl@š„L‚l„Lnš‚b@VnVVU@k„a‚Knxn@VkVJ@ńUlakmWIUaVanm@_UK@UVWUa@klXam™U@Vmƒ™VIXW„@lUVknVlKVLXŽVXšW@b@VlšnnVL@KXL‚Kn@lb@UnW°@Va„X„WVb°aVa@I¯aUkUaVKVwƒaXk@a„a‚™@wkm@alanUVw@alK@Umkw@UƒaUmU@WXUaUK@UW@UaVWI@¥Xa@w@WWšVƒXwƒU@mKUXUWVU@a¯kl@akU@UULmK¯VUVW@U_m`U@@xVbUz@lUbUlƒXU`WLk@mš²šWb@Ž@ƒxU_mƒXmmamLkUkKVkUƒVу¥mIXa¯KƒbmLkK@V@Lmš¯@ƒ¯kKm¥kIWaUKk@@aVUUaƒ@UwVUƒKVƒX_WaU@@bUJUaƒš@šmbnn@lULmKUnU@@J‚xUbUbU@mX™š¯@VŽ@bnJÇz@VUVVbVxUn„˜UbW@kz™VUlUbVbƒŽUL@lWb"],"encodeOffsets":[[113220,24947]]}},{"type":"Feature","id":"4507","properties":{"name":"钦州市","cp":[109.0283,22.0935],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@@IlVVlnL‚@œxla„al@n„VLlx@x@bXnV@@`mXX`lbnaVL@blV@b„wnx‚I@xXJ°nK‚l„š@lbnKnblUVanKVb„@lUnJVI„VUb@V‚U@m„L@Ul@Xw„llVVXV@lVnlVn„l@XVlK„@@_VWVxX@lb„U„nV@@JlbnIlmnVV@UwVK@U@k°a@mnIVVVK@nXLÆaVWXVK™™@_W@Umšw@UXWWkUUVWUIVaƒUkJ™UVWbUmU@mkUJUU@UVab±aVaUIUmVKUaVUU@VUUaUUU@W¯XWWw„w@k@Kl™@wkV@U@alK@aX@@UmIUWUIƒ@mmkXU`U_WJUnUJmUk@@amLU@UVW@UkU@@VƒbUWVUk@@wmKkUWLUWX@JmIƒlUkkKWKkLWU@UKWa@bU@@a@_UKWƒUUUmJmw@nV_@ġğKóLmbU¼VÆ@xUXƒ@Um@wklVnUn›lkaUV@„lV²WVklWXXbWlkVkIm`UUƒLƒUU@UWƒx@XU@@lWLU@kbUbV`UXllUV@bmb@LnKVbULm‚šnVVIV`X@"],"encodeOffsets":[[110881,22742]]}},{"type":"Feature","id":"4508","properties":{"name":"贵港市","cp":[109.9402,23.3459],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@n@VzUJ‚nVŽ„K@XšVš°nVVnšwVb@xVV„knJl™VVUbn„WL@bUxVVXš„bl@lVXkWƒXwWaa@¥‚@nUUUV@„JVkVVV@XUWanknK‚xnƒ¯VyVI@m@UkL@W@Ušk@aUalKnUUV¥@KVkkaWVkUVkUm@aWanI@n@°aUUVaUa@_m@UamaƒV@akU@mV_@ƒa@KWIkƒmLUKƒaUVU@ƒkƒVUK@wUIWVUaVwka@Uka@aV@@aUKVk™K@X@Vƒb™KƒU@JULVLkVWšUL@aUK™b@VUL@LƒxUKmlkImJk_@WU@ƒkmK@UV@„¥XIm@@Wn_@KmVm@@I@aUmkXm@UWV@mn_@mƒUUJWIUWV_WƒwU@mUknVVmxU@@VUV@zU@UVW@ƒK@šX@VLUVƒKƒz@J@VnX@`±bUXVƒ¼™lšn@xmxÝL@‚Ubn°@XWVUxUVVnkbWVXV@Xš`ÆȄKnƒlLVanIV`nLVUlƒ²ƒV@V¦„l°¦„w‚b@šnKnLVbVJšIVƒXK@b‚n@ènx@xVbUnV‚"],"encodeOffsets":[[112568,24255]]}},{"type":"Feature","id":"4506","properties":{"name":"防城港市","cp":[108.0505,21.9287],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@XV@X°°U„lxkbVlVb@nkbVl@xl@@b@n„‚XbVL@Vl@UbV@@JVLXbmV@bVVUXUJU²šW„XlKVb„@VVXKlXšWlXXWV@VXJlI@x„l@nlbn@lln@lbXalIVK@ƒVwœUVb‚U@aXylUX@@aW@U_UJmU™nVKUamL@Kna@aVUkkVWU_ValaV@XK@kV@@W„wVXV@„V„KVVn_lJlUXkWaXWlkXU‚±kU@ƒVUlbœkVmUmlk™¯Ý™™W@mb@¦VxULm™kJUU@ma¯wƒmkX@VóJ±bUVUXÝWk™lWXXlƒxUaƒbƒIğ™Ç@U@mVUKkkm@UJm@XnWV@x"],"encodeOffsets":[[110070,22174]]}},{"type":"Feature","id":"4505","properties":{"name":"北海市","cp":[109.314,21.6211],"childNum":2},"geometry":{"type":"Polygon","coordinates":["@@VaVLnK@IšJVwUaVaUkWKn_mƒX¥WwXm‚LXalbU£UyV„Å@ݙwm@™°l›LÅUƒmk™mwÛaƑLÝUUm@ȣƃV_„Ó@£UƒƒUVƒ„™¼U°W̄™ÞVbXbôx@b@bmV@ǃ™UÝ@@ĢU`m@ŽnxnIVV‚VX„VL@`@bV@@aXbVL‚@XVlKXLlLVl„knJ@I‚WVXXKlVnL@xl@UVVX„a@UV@VlX@VUV@nK@bl@nVVIVmXIV`V_lWnn„@VJVXnJ"],"encodeOffsets":[[112242,22444]]}}],"UTF8Encoding":true}; }); -define('echarts/util/mapData/geoJson/gui_zhou_geo',[],function() { - return {"type":"FeatureCollection","features":[{"type":"Feature","id":"5203","properties":{"name":"遵义市","cp":[106.908,28.1744],"childNum":14},"geometry":{"type":"MultiPolygon","coordinates":[["@@@UnUlJn„w‚JU°VL@bnVšU„wlJ@XƒŽXVlU@klVUJknl„UllL@bUJ@xULUlƒ„UblVkblbnw‚UXmla@„wV@VK@L@UXaVKVLXWƒUVa@U@Im@@W@£UKUakKWIXU@al@@llUnL@W@Un@@VlUV@VIUanKl@Xb@lmxVb@b°bb@nlJVVnnJ@b@L‚V@ln„@LmV@Vx@blnVK„nlJXIlw„J@҄b@nlK@Un@UL@VVVVUUUVK„l„@VUVL„J@UVUUw„@Wm@™„UV„ÈVlbUb@JšLlŽX@@x„„ƒLmŽk@@nlx@bUJUzVJ„@@LVxUV@bWxnLnVVK@_‚K²xVbV@n¥@aVI@b„@l@Va„Knb@n‚`n„mmý„W@ƒU_šwV@VlVV@Vn@n„˜@nI@Jn@°¦VaUU@™„mVVWVaUńU@aVKnƒVbVUmmU@a@kUw™m@aUUmUUJ¯lakU‚aXaWUUaVƒkk„amkmUnVlULƒVlJ@XU@UJWUUw„k@aU@WbkWƒL@U@WU@@XUKmV@aUVwUĕUJUamUUVUÑm™nIVJ@kl@XalJVn@KVLœ¥@UWIXWmU@mVUKnUWLUKUaWUUKVU@U@anUny@UlUkK@w@a@aVUƒ»UkVw@Wmk—JƒÅmUUVmwXalLXWWUnam@XkƒJ@UVU@U@W„@@U@I@Wl@Ènlw@KXLWb„lVUkalKUU„VVaV@@wnIlaUmkUƒKWU@KkUkLWaƒKUUWUn@VƒK@LnnWJUIƒVkUWVnV@V™@@XƒK@VUIUJ@IWJkX@VVJ™IƒVkK@I@UVaUWk@m„@wnUWKk@mxk@@„lV@b„xmb@x@VUmLkUƒJ@nVV@b@VkLVbU`¯I›l@™U_UW@UU@™™ƒK¯wm@™xƒL¯¥kIƒ™ƒ‚@bkbƒ@Ua@ƒm@kkW@XVbmV@ŽkV@bWbUbV@„¦ƒxXlmVk@ƒ¦™bkaWL@KUImK@wUK@VUI™b@bmK@LÅy@akXW@kbWlXblL@ŽULUbƒ`@U™kUymX¯@mšUJUUJƒL@Lm@@WX@lU„VlšXll„@l@Èk°V°Ž„X@VU@UVll@XUJVXUVm@@VXLWlnV@Xƒšk@mVULnxV@@bm‚kL@VWLUbU@UVm@ƒb@ķ¥UnmJ@UUVƒkkJUšlÔU`UIW@ƒ°kLUlUI@WVI™U@mWKkXk@ƒ‚WU@bXšW„@J@xX@l@LVl@xšLVxXX@x‚KnxVknb‚KVV@U„L„WlXU`@nUlšX@llVXšVU„KlkUKlI@anKVLXKVaUIVWV_VK@VnLlU„»VKVL„m"],["@@@KlKkUUVVX"]],"encodeOffsets":[[[108799,29239]],[[110532,27822]]]}},{"type":"Feature","id":"5226","properties":{"name":"黔东南苗族侗族自治州","cp":[108.4241,26.4166],"childNum":17},"geometry":{"type":"MultiPolygon","coordinates":[["@@VV@XkV@bUbWJU¼Vb@Vnb@bš„@J@bƒL@LV@UVƒlUI@a™KULVb@bkJmx„šlLVxknVJk„‚xnKmnnL@bn`WIXlWLU@UxVbUVmKV„XI@JVIVJ@U„L@Wš@@UmUXUlV„UVJXImm@K„L@UVmVXV‚„LXblKlV@LXV„LlVVnkbmJ@xnXl@šbXa‚@Vana„ÒšL„m‚VnIl‚Þ¦°k@b„@@lV„nJlUnš‚VX_„@lVlK„šV„UUxVLVWVIXJšUlnnWlI@KUaUUVKn@VaVXV@na@ƒmw¯@mUkJUamI@lk@@am@@I„ƒUmVImUUw˜™@anUVaUU@LU@WaWUXWW„wV@VwnU@L@ynbl@@X@a„J@nW@@Vn@„lVLlxnI„lš@@UWKUƒnIlJXIVllIVVš¼XK@aVI„V‚@@bn@VKXLVKVVVInw„J@UWI@mX@WKnI@KmU„UVJUL@V„KW@@k„@aU@@W@InJWUXwWI@Wƒ@¯wkaVaUIl@nŽValIXWWI@UUm@anwWkXWWIUbk@UJmIUamKVUUUVVama¯VkIVVUlKnXVwX@@WVaUUVa@IlƒaVmƒkna›wk™UU@ƒU@mUVƒšUVwœl°LVbnJVU™¯la@mX@@UWKXU@aV_V@@JlkUƒ¯@V™nK@km¯k„U@ƒWUW@mmƒU@™kmlU@wkL@WƒUkL@VmLƒJ@b@V@bknUUVK@UVKUK@Uk@Wa@LUVVnUbmVk@@UU@@aƒV¯K@U@UU@WmUL@aU@WV—w@ƒ˜I„xXll@UX‚K@KXXVJna@wWaƒ£naUKV„m@UU@mUmalm@@XkVm@U@VƒLmWU@kkWxU@@bVV@VkXVlƒVƒ@UUk@@ƒmI@KUw„m@UmVƒUUwU@lwkV@IUa@mUaVIVKVa@w@U@™UJkb@n@bmJ@XmlVUxWXkJmUkUUVW™xUlU@ƒaULUšmbU@@‚WXkmƒL@xUV@nUxÇm@„XLWbnlƒnV‚nnUV˜U‚nVVz„@lbUVVlULVb@V@nUJkwm@Ux@bWbUK@UULka›JbƒU™U@U@lUK@XUJmn™J@bU@UwWa™x@zkJWnUJUUVšVV@bXn@xVb@J™L™m@X™w@`@bkb@VmXUV¯L@mW@@n@V@‚ƒL@K—IW@@aƒaUx¯@U„m@XbW@@L„V@bnVWVkKUzlV@bÆa@lnI@VV@@LnVVKUaV_VJVbnU@bn@‚‚nX@yVIVxXKVLlUVaXU°J","@@@KlKkUUVVX"],["@@UUVUkUmV@ln@VXVK@K"]],"encodeOffsets":[[[110318,27214],[110532,27822]],[[112219,27394]]]}},{"type":"Feature","id":"5224","properties":{"name":"毕节地区","cp":[105.1611,27.0648],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@UkVƒ@k‚W@Xn@@K„KVIVVIn™°@nWVzšl@V„_VaVK@kKWaXklaX@lW@bÆz@KnL@ašaVJ@UVL@xnLVJ@LXKlbša„¥l@nUWk„wƒ¥U@VaXa@amLkUƒKmƒ¯kƒmkIUaƒKUIWƒkKm@anw@mlwXIƒmƒUk¯@a@amUƒ`kkKWVkxmUUak_mJmw@w„mXUW¯X›_@WnI@aVwkWWýŃU@WLkU™aUbVV@lUVVnm@kUmV¯™kK™LƒwmVUUaWV™aaWw¯wƒÈ@VULUVUUƒK@nWJkI™l@Umxnbm@kbUJƒa¯bUbVxmLUV™aU@VUUWxkVVV@bUV@XWbnlUbƒbUJlbUV¯b@z„`WbXnmbƒaƒwUwVWUƒbUxmbU@Uam™@Vƒk™VaƒwVaUƒWI@mUKóz@lUlÅ@WIƒb@xXxml@XklULWKUmwUa¯KUXWJkaULmKkLWbkKUVƒImƒƒWa@kUaULƒW¯LƒK¯@kbƒL@b™x@J@bmnnlUšlzU`U@@Uƒb@„m‚n¦°bU„Vx@bkVm¼mx@mk™mVV@bkxVn„aVV@bU@mL@b²`lIVV@lXLlš„bVxn@@bl@XllIVšnbVšn°°wlbXw@mVa°lVnU@mš™VLVbn@@b„@@WVnUV@Xlxn`VznJVb@L@bV`V@šUnwšU„@WUXKV@UUlmUUlaXalLšm„bšIVbnJVIlVVaUUnWVXn‚VL‚k@ƒnWnblnlb²x„xVKVXlVXLVW„LlUVJna@wVL„¼@JVX@`@nnx@nWJU@Vx@XXKšŽUblxUš°„LVKVVlL@KnbVUnJ„IlUšƒnKl£VW„x„IlJ@nšVÞUVVnb‚VX@V_°lnK","@@@UmWUwkU@Um@@VkL@V@„„‚V„VkV@nbVa@ƒ"],"encodeOffsets":[[108552,28412],[107213,27445]]}},{"type":"Feature","id":"5227","properties":{"name":"黔南布依族苗族自治州","cp":[107.2485,25.8398],"childNum":12},"geometry":{"type":"Polygon","coordinates":["@@‚V@IöalK@UV@@KUaVIVVœLlaVbVWnX@‚@LnUlxl@naVLXVVaVU„J@lUUanWWI„@VlV@Xbƒb@V„n@VmVVbk@kU@V›V@X„J@zn`ULW@kK@_WVUK@LUb@Jlxn@nnWlU@@b„x@XVVU@UbVb‚@n`VI@VVLUlUIUV@KmL@VV@XIV@@lVLVmXV„@WLXLW@U`šnkb@Vl@UL@VVV„L„llX@`lIXb„J˜IXW„L‚aVL@ŽXXW‚Ģ™b@bmK@L@°@Vnxmxšn„K@xVn@VkL@V™Lƒakbl`VnnxVnUlššV@@VVXV`@šœk°JV_UalK@U@aUU@m„IlVnK‚V@U@wnaƒw@akU@ƒl@nwl@XLmV@xnƒl@VXUb@V@JlL„UšJUI@UlWUƒnLVUUaVwV@XKWkXJm_@amKnmmLwlƒUIlmUwkKƒ™nwlI@aUaVKšL@bVJ„kVUU@@K„K@a@I™ƒ@ama@UUaV»XIVa@alU@WUU¯IWVUbkVUKWLUwUJ@zmWm@@amVUaUIU`VbULmU@KU@@UmJ@kÅb@akUVylLXUmU@aƒU@KX@Wan@Vƒ°@Vw„b@bX@˜J@L„K@@U@mX@@n°KVUnW@Ula@a@_šx@WšnšK@IUa@wWm@aUUU™VVVIXmlI@yšwXbVxV@@ašInmVI@WVL@k@VšV„V‚aœIlbVK@VVLXa@aVwn@lxVI@m@UUaVKUkVUkaƒ@UymUV—VUmmU„mmkXaWK@ƒÈnVw@mVU@w„KlnXW@V@naV™VKUk@KVIUWƒ@mk@KXU@Um@@lVƒk@UVJna@UWaƒL@a@ƒXa@kmmVUUk@mkkƒamJ—ImJUUmIm±aUUkambkamVUU@VlbUbVVƒxX„WVUU@VUakU@UmUV‚U@mnUVVnUbVJ@b—UW¥kLVamVkUaWJU_UVWKk@@nl„UVVJUXm@Vm@UnVlmbnmJUbULU@@UUKWVIWxnJVb@xUL@bUJWIkxƒbkb@xVJƒbmU@kW±LkKUkVa@a¯am¥ULkalÑlKXUWƒXƒaVakImVƒ@ka@UUƒJ¯aƒX™mmb—KWU@wUUƒaUa™KmU@UXlWb—¼WLUKUb°„UlVbkbVL@VƒšƒJ@nVlUbUXmJ@VX@lbUbU@@bWb@VnLVJ@bVVUz„ŽVL@lnL@b™VVVULmKUk™Jkbm@ƒxVb@V—kƒKVnnV@b@ŽWXU‚„nV„l‚VVXVJUXlVXbWV@VU@Ubk@@KWbUUmL@JnXV°XJ@_‚`UbkXVVlÆkbƒ@VLXVV@‚V@k„KXX@`V@@n"],"encodeOffsets":[[108912,26905]]}},{"type":"Feature","id":"5222","properties":{"name":"铜仁地区","cp":[108.6218,28.0096],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@°a@aÈbVUlU@aVKnVV„VUlyX¹lWVa@U™VƒnUVU@m™@mUl@„mÞw„@‚xnIVbna@KVI‚J@kwV¥ƒUXÇVkVW@kkKWU@aXUWmnIVa°VXbmL@VVbnVVVUb™VbšJVbVKXkVKVanU@aWnWUWa@U™nk@mVIVK@wXxlLXbVJVlKœbl@VI@mšaXalVV„VbX@@ašalnkx@b@V‚b@Vnx@bVVUXn¤WXn@Vl@Vlzn@š`@I@KUU@ƒV£namVkXa@aVK‚nnU@anVlKƒa@UUU@amk@»kƒU¯@aš„VWnkWmkImU@akaVm@»VUV@UKnkW¯XWlkUKnIWaš@nmlIXmWUnwUwWm@wULmaUJkIUaƒaWa—klwkwmJmU@bkJ@XUJ¯W@XbWbUKUkWJUUVKnn@UmmXUWa@mU@@UI@WmXVykwm@kaULWwU@¯ƒlKUUVU@mU@UkmaUbmV@b—š‚xVnVUJVnƒ„@Jn@@bl@@knJVblInV°@nx@„mbU@UWUbm@ULVVVb@LkJmXkm™VWIUJUXUKVwƒV™UƒŽkLkUƒ@W`Um™kVmIUƒ@kƒ@@a¯lÝ¥kmJUƒn™KƒÑmbUb@Wb™ak@mWU@UbƒUVVkLlbUVƒkXaWK@LkxÇmk@@X@J@Vƒ@@X@VUV@V„IWln@mbXVWXkKWbnxVUnV„ƘInl@XUxVl„¼UV@b@b@xlLkV@VmzmV@b@VUVVLXVVbVLXKmVVLU‚@nnVWXXJ@V›¦UK@LUmkIWbk@@lUImJnšVÒVUnVVbVIVĖUxV‚@bnUVL@WV@@X@V„KlXXaV@@bƒlVxXVVIV@@WkI„UVKUkVmlnnŽƒbllU„VbXVWbblVkb°ŽVInVVV@bšnVx@l@bnVVnUŽUam„UL@bƒVVÆUbUXU‚ƒn@šVVUb"],"encodeOffsets":[[110667,29785]]}},{"type":"Feature","id":"5223","properties":{"name":"黔西南布依族苗族自治州","cp":[105.5347,25.3949],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@VL@Vl@@IXW@kVUVbnW@XlKVVnU„VlL@b„aVbƒb@xX‚°ÔUxV@kbm@VxkxWJœ„V¦ƒŽ@ÈnšVKšxWXJmV@n„Ò@xVbn@@blLk`VX@bššla²JVUlnn@U±lw@wnw@mlwVIX@@m@klKnk‚a„KnwmmXkƍVm„Uš¥l@nb°n@„aVwVmVIVnI@a„¯@mšU°ƒl@@VnI@JV@UV@b@IUbVJmXöºƒzllUbVa@aXUl@„U@llLnKVaUa@UmK@UšwV„bnKV@VwVK@UXƒV@Vbn@‚w@U„WnX‚@„a@m„I„™@UUKlaUaVk¯ƒVaVLXK˜»XaWk¯mƒkğwmW@mIƒVkwƒJUIšÇVwU™UkVKkƒm@UkmU@WÅwm£Vƒ„m¤¯IkJWa™_™lUbmJzÝJk„ƒUÇVU„ƒ‚@bU„Ýn™m¯LUb@`mL@VkL@VƒUmmk@UU±Umka@kUƒ@ķymUkk@mmkÝmUaUakImV@V@VÅLƒ¦ƒJUXmJXšWb@n°Æœx‚¼nV@LlbUŽUbmL¯@ÞbV¤nbVx@bUVlblIœ™@KVVUnVJUn@VlLUlmLUUUxmK@I@@VW@@bU@UJmUkLVVUl@b@V"],"encodeOffsets":[[107157,25965]]}},{"type":"Feature","id":"5202","properties":{"name":"六盘水市","cp":[104.7546,26.0925],"childNum":5},"geometry":{"type":"MultiPolygon","coordinates":[["@@ôyVL@nXJV„Ub„x‚bUŽlšU„@ŽšnŽVbV@naVw„a‚VUXVx„x„bnaWmXaƒ_@y°aVUkaVI„aVamkXa@WVU@aUUlUXwVV@UVšbVUnKUwVa°a„bVIlan@manw@VšklJXI@m„LVVVUVK@U„ǃk@KUa@UkaVU@UVWV_XWVXVWlLXKlLXaÆKšwVL@akKm@Uwƒ@@XUVk@VUI@wWK@aUV™I@UkK@ƒmL™Wƒ@kImJƒUÅVmkXUW@UJkx@nmx@xkxV²m@kmUV±Ikb™™@aUWl_kK@am@Ua@wƒÑ@mnUWIX™wULm™@DŽU¥›ƒXIlwUwn@laU@Vw¯ÓW@w„aUaƒb@akKƒUmVUUkL@WmXUaUV@lWX@Jk@@UUKULmLUJmzkKmVX°VšUnWKUL™ƒƒL@mU@UnVJ@b@„UV@Xƒ`m_@l@@bmbXJmnnš@°˜wnn@ŽVLX@V‚@nVl@nk@@b‚l@nn°WlXzW`XXVKnUlxVbUb@‚V„Xb@Ž‚VxÈbVlnbmn@ŽkVUL@„ƒŽmLUVVL"],["@@@ƒ@UmWUwkU@Um@@VkL@V@„„‚@„V@VkV@nbVa"]],"encodeOffsets":[[[107089,27181]],[[107213,27479]]]}},{"type":"Feature","id":"5204","properties":{"name":"安顺市","cp":[105.9082,25.9882],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@lL@bUK™xÅLWbkKWLkKUXUWWXU`UX@VUVlb@VVb@L„l°xXx‚bšbXUVb‚VnU„xšKlL°šnUlVn@UmVU@kUUVašblVXKV@ƄXþlXUxnU@mVK@_@ml@UU„@šblU@KnLVyUw„@@UmkšWVw@UVK@VXzVK@n„VVUUW@kVJnlaš@nKW™kaWL@U—™õb@JU@mU@@_WWƒL@lUU@WUUK„@lakÅUUlWVa_@`WIU¯mW@InKVVXa@Ll@VaV@@UXUWakUVWUIUW‚UkUƒƒmVXW@@amUUm„L˜l@UUa„wn@lašIVlnLVKUUšU@amK@kUKƒVyUU@aUImK@UXa@aV@VakaW@@UnIVWVaUkƒb@mWƒX@Vxm@UaU@W„@VULUxU@mLƒaUŽ™x@VnL@VVbUbmLkK@kƒVk@WV@bUbVakk„yõ¹nWUIVa@J@aVUU@@ImJ@Uk@¯„™V@nƒ°@bmJUUJUnUxƒbm@¯Žmak@™¦ƒVUnŎWlnnmxƒLbmlkL@l@nWVnlÆU„VnIlJ„@šXnK@„lL@VšJVU@bXL@xVJUl@VU@W„@Vxn@"],"encodeOffsets":[[108237,26792]]}},{"type":"Feature","id":"5201","properties":{"name":"贵阳市","cp":[106.6992,26.7682],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@nŽlLX„VJ„LVblJ„n°ln„„LlVnKlU@nUUa@WlX@l„n@‚Vb„@la@a„„šlJ°¦„Kšwn@°x„LVkUmmwUmk_la„bšK@UlK@UUm@wƒL™mnwmw@U@¯@KnL@aša‚ġXWW@UKbƒKWX—JƒIWakJ@_kWƒkƒKUU@UVKk@@Ula™mV_X@WKXKƒ@WUUnUK@kU@WJU@@UnK@LVUVJVkUK@UUJm_@UaVaV@UU@Wƒw@aV@Xkmmm@kw@IVa@KVLXU@`lLX@VKm_@yƒI@WœU@UlVl@UanU@Uƒm@U„aWaU@Ukƒ@XJmXVbkV@ŽƒIUVUbWUUKmbk@kwmV@K@mWUXUakb›KUUUJVb@LU@@VkL˜š@VXKlbXšmL™@kbm‚UI@lVXUVƒU@mULWy@UUL@VUx™Xnl@Vƒ@VxUzmK@LkV™aƒ@VVk@@n@`UL@nmV@bmJ@Xœ`WX°WVƒn@xnxnIl`VbnVlwXUlLl‚„_nV@b@bl°„V„nWJkx@nmx@b"],"encodeOffsets":[[108945,27760]]}}],"UTF8Encoding":true}; +define('echarts/util/mapData/geoJson/gui_zhou_geo',[],function() { + return {"type":"FeatureCollection","features":[{"type":"Feature","id":"5203","properties":{"name":"遵义市","cp":[106.908,28.1744],"childNum":14},"geometry":{"type":"MultiPolygon","coordinates":[["@@@UnUlJn„w‚JU°VL@bnVšU„wlJ@XƒŽXVlU@klVUJknl„UllL@bUJ@xULUlƒ„UblVkblbnw‚UXmla@„wV@VK@L@UXaVKVLXWƒUVa@U@Im@@W@£UKUakKWIXU@al@@llUnL@W@Un@@VlUV@VIUanKl@Xb@lmxVb@b°bb@nlJVVnnJ@b@L‚V@ln„@LmV@Vx@blnVK„nlJXIlw„J@҄b@nlK@Un@UL@VVVVUUUVK„l„@VUVL„J@UVUUw„@Wm@™„UV„ÈVlbUb@JšLlŽX@@x„„ƒLmŽk@@nlx@bUJUzVJ„@@LVxUV@bWxnLnVVK@_‚K²xVbV@n¥@aVI@b„@l@Va„Knb@n‚`n„mmý„W@ƒU_šwV@VlVV@Vn@n„˜@nI@Jn@°¦VaUU@™„mVVWVaUńU@aVKnƒVbVUmmU@a@kUw™m@aUUmUUJ¯lakU‚aXaWUUaVƒkk„amkmUnVlULƒVlJ@XU@UJWUUw„k@aU@WbkWƒL@U@WU@@XUKmV@aUVwUĕUJUamUUVUÑm™nIVJ@kl@XalJVn@KVLœ¥@UWIXWmU@mVUKnUWLUKUaWUUKVU@U@anUny@UlUkK@w@a@aVUƒ»UkVw@Wmk—JƒÅmUUVmwXalLXWWUnam@XkƒJ@UVU@U@W„@@U@I@Wl@Ènlw@KXLWb„lVUkalKUU„VVaV@@wnIlaUmkUƒKWU@KkUkLWaƒKUUWUn@VƒK@LnnWJUIƒVkUWVnV@V™@@XƒK@VUIUJ@IWJkX@VVJ™IƒVkK@I@UVaUWk@m„@wnUWKk@mxk@@„lV@b„xmb@x@VUmLkUƒJ@nVV@b@VkLVbU`¯I›l@™U_UW@UU@™™ƒK¯wm@™xƒL¯¥kIƒ™ƒ‚@bkbƒ@Ua@ƒm@kkW@XVbmV@ŽkV@bWbUbV@„¦ƒxXlmVk@ƒ¦™bkaWL@KUImK@wUK@VUI™b@bmK@LÅy@akXW@kbWlXblL@ŽULUbƒ`@U™kUymX¯@mšUJUUJƒL@Lm@@WX@lU„VlšXll„@l@Èk°V°Ž„X@VU@UVll@XUJVXUVm@@VXLWlnV@Xƒšk@mVULnxV@@bm‚kL@VWLUbU@UVm@ƒb@ķ¥UnmJ@UUVƒkkJUšlÔU`UIW@ƒ°kLUlUI@WVI™U@mWKkXk@ƒ‚WU@bXšW„@J@xX@l@LVl@xšLVxXX@x‚KnxVknb‚KVV@U„L„WlXU`@nUlšX@llVXšVU„KlkUKlI@anKVLXKVaUIVWV_VK@VnLlU„»VKVL„m"],["@@@KlKkUUVVX"]],"encodeOffsets":[[[108799,29239]],[[110532,27822]]]}},{"type":"Feature","id":"5226","properties":{"name":"黔东南苗族侗族自治州","cp":[108.4241,26.4166],"childNum":17},"geometry":{"type":"MultiPolygon","coordinates":[["@@VV@XkV@bUbWJU¼Vb@Vnb@bš„@J@bƒL@LV@UVƒlUI@a™KULVb@bkJmx„šlLVxknVJk„‚xnKmnnL@bn`WIXlWLU@UxVbUVmKV„XI@JVIVJ@U„L@Wš@@UmUXUlV„UVJXImm@K„L@UVmVXV‚„LXblKlV@LXV„LlVVnkbmJ@xnXl@šbXa‚@Vana„ÒšL„m‚VnIl‚Þ¦°k@b„@@lV„nJlUnš‚VX_„@lVlK„šV„UUxVLVWVIXJšUlnnWlI@KUaUUVKn@VaVXV@na@ƒmw¯@mUkJUamI@lk@@am@@I„ƒUmVImUUw˜™@anUVaUU@LU@WaWUXWW„wV@VwnU@L@ynbl@@X@a„J@nW@@Vn@„lVLlxnI„lš@@UWKUƒnIlJXIVllIVVš¼XK@aVI„V‚@@bn@VKXLVKVVVInw„J@UWI@mX@WKnI@KmU„UVJUL@V„KW@@k„@aU@@W@InJWUXwWI@Wƒ@¯wkaVaUIl@nŽValIXWWI@UUm@anwWkXWWIUbk@UJmIUamKVUUUVVama¯VkIVVUlKnXVwX@@WVaUUVa@IlƒaVmƒkna›wk™UU@ƒU@mUVƒšUVwœl°LVbnJVU™¯la@mX@@UWKXU@aV_V@@JlkUƒ¯@V™nK@km¯k„U@ƒWUW@mmƒU@™kmlU@wkL@WƒUkL@VmLƒJ@b@V@bknUUVK@UVKUK@Uk@Wa@LUVVnUbmVk@@UU@@aƒV¯K@U@UU@WmUL@aU@WV—w@ƒ˜I„xXll@UX‚K@KXXVJna@wWaƒ£naUKV„m@UU@mUmalm@@XkVm@U@VƒLmWU@kkWxU@@bVV@VkXVlƒVƒ@UUk@@ƒmI@KUw„m@UmVƒUUwU@lwkV@IUa@mUaVIVKVa@w@U@™UJkb@n@bmJ@XmlVUxWXkJmUkUUVW™xUlU@ƒaULUšmbU@@‚WXkmƒL@xUV@nUxÇm@„XLWbnlƒnV‚nnUV˜U‚nVVz„@lbUVVlULVb@V@nUJkwm@Ux@bWbUK@UULka›JbƒU™U@U@lUK@XUJmn™J@bU@UwWa™x@zkJWnUJUUVšVV@bXn@xVb@J™L™m@X™w@`@bkb@VmXUV¯L@mW@@n@V@‚ƒL@K—IW@@aƒaUx¯@U„m@XbW@@L„V@bnVWVkKUzlV@bÆa@lnI@VV@@LnVVKUaV_VJVbnU@bn@‚‚nX@yVIVxXKVLlUVaXU°J","@@@KlKkUUVVX"],["@@UUVUkUmV@ln@VXVK@K"]],"encodeOffsets":[[[110318,27214],[110532,27822]],[[112219,27394]]]}},{"type":"Feature","id":"5224","properties":{"name":"毕节地区","cp":[105.1611,27.0648],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@UkVƒ@k‚W@Xn@@K„KVIVVIn™°@nWVzšl@V„_VaVK@kKWaXklaX@lW@bÆz@KnL@ašaVJ@UVL@xnLVJ@LXKlbša„¥l@nUWk„wƒ¥U@VaXa@amLkUƒKmƒ¯kƒmkIUaƒKUIWƒkKm@anw@mlwXIƒmƒUk¯@a@amUƒ`kkKWVkxmUUak_mJmw@w„mXUW¯X›_@WnI@aVwkWWýŃU@WLkU™aUbVV@lUVVnm@kUmV¯™kK™LƒwmVUUaWV™aaWw¯wƒÈ@VULUVUUƒK@nWJkI™l@Umxnbm@kbUJƒa¯bUbVxmLUV™aU@VUUWxkVVV@bUV@XWbnlUbƒbUJlbUV¯b@z„`WbXnmbƒaƒwUwVWUƒbUxmbU@Uam™@Vƒk™VaƒwVaUƒWI@mUKóz@lUlÅ@WIƒb@xXxml@XklULWKUmwUa¯KUXWJkaULmKkLWbkKUVƒImƒƒWa@kUaULƒW¯LƒK¯@kbƒL@b™x@J@bmnnlUšlzU`U@@Uƒb@„m‚n¦°bU„Vx@bkVm¼mx@mk™mVV@bkxVn„aVV@bU@mL@b²`lIVV@lXLlš„bVxn@@bl@XllIVšnbVšn°°wlbXw@mVa°lVnU@mš™VLVbn@@b„@@WVnUV@Xlxn`VznJVb@L@bV`V@šUnwšU„@WUXKV@UUlmUUlaXalLšm„bšIVbnJVIlVVaUUnWVXn‚VL‚k@ƒnWnblnlb²x„xVKVXlVXLVW„LlUVJna@wVL„¼@JVX@`@nnx@nWJU@Vx@XXKšŽUblxUš°„LVKVVlL@KnbVUnJ„IlUšƒnKl£VW„x„IlJ@nšVÞUVVnb‚VX@V_°lnK","@@@UmWUwkU@Um@@VkL@V@„„‚V„VkV@nbVa@ƒ"],"encodeOffsets":[[108552,28412],[107213,27445]]}},{"type":"Feature","id":"5227","properties":{"name":"黔南布依族苗族自治州","cp":[107.2485,25.8398],"childNum":12},"geometry":{"type":"Polygon","coordinates":["@@‚V@IöalK@UV@@KUaVIVVœLlaVbVWnX@‚@LnUlxl@naVLXVVaVU„J@lUUanWWI„@VlV@Xbƒb@V„n@VmVVbk@kU@V›V@X„J@zn`ULW@kK@_WVUK@LUb@Jlxn@nnWlU@@b„x@XVVU@UbVb‚@n`VI@VVLUlUIUV@KmL@VV@XIV@@lVLVmXV„@WLXLW@U`šnkb@Vl@UL@VVV„L„llX@`lIXb„J˜IXW„L‚aVL@ŽXXW‚Ģ™b@bmK@L@°@Vnxmxšn„K@xVn@VkL@V™Lƒakbl`VnnxVnUlššV@@VVXV`@šœk°JV_UalK@U@aUU@m„IlVnK‚V@U@wnaƒw@akU@ƒl@nwl@XLmV@xnƒl@VXUb@V@JlL„UšJUI@UlWUƒnLVUUaVwV@XKWkXJm_@amKnmmLwlƒUIlmUwkKƒ™nwlI@aUaVKšL@bVJ„kVUU@@K„K@a@I™ƒ@ama@UUaV»XIVa@alU@WUU¯IWVUbkVUKWLUwUJ@zmWm@@amVUaUIU`VbULmU@KU@@UmJ@kÅb@akUVylLXUmU@aƒU@KX@Wan@Vƒ°@Vw„b@bX@˜J@L„K@@U@mX@@n°KVUnW@Ula@a@_šx@WšnšK@IUa@wWm@aUUU™VVVIXmlI@yšwXbVxV@@ašInmVI@WVL@k@VšV„V‚aœIlbVK@VVLXa@aVwn@lxVI@m@UUaVKUkVUkaƒ@UymUV—VUmmU„mmkXaWK@ƒÈnVw@mVU@w„KlnXW@V@naV™VKUk@KVIUWƒ@mk@KXU@Um@@lVƒk@UVJna@UWaƒL@a@ƒXa@kmmVUUk@mkkƒamJ—ImJUUmIm±aUUkambkamVUU@VlbUbVVƒxX„WVUU@VUakU@UmUV‚U@mnUVVnUbVJ@b—UW¥kLVamVkUaWJU_UVWKk@@nl„UVVJUXm@Vm@UnVlmbnmJUbULU@@UUKWVIWxnJVb@xUL@bUJWIkxƒbkb@xVJƒbmU@kW±LkKUkVa@a¯am¥ULkalÑlKXUWƒXƒaVakImVƒ@ka@UUƒJ¯aƒX™mmb—KWU@wUUƒaUa™KmU@UXlWb—¼WLUKUb°„UlVbkbVL@VƒšƒJ@nVlUbUXmJ@VX@lbUbU@@bWb@VnLVJ@bVVUz„ŽVL@lnL@b™VVVULmKUk™Jkbm@ƒxVb@V—kƒKVnnV@b@ŽWXU‚„nV„l‚VVXVJUXlVXbWV@VU@Ubk@@KWbUUmL@JnXV°XJ@_‚`UbkXVVlÆkbƒ@VLXVV@‚V@k„KXX@`V@@n"],"encodeOffsets":[[108912,26905]]}},{"type":"Feature","id":"5222","properties":{"name":"铜仁地区","cp":[108.6218,28.0096],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@°a@aÈbVUlU@aVKnVV„VUlyX¹lWVa@U™VƒnUVU@m™@mUl@„mÞw„@‚xnIVbna@KVI‚J@kwV¥ƒUXÇVkVW@kkKWU@aXUWmnIVa°VXbmL@VVbnVVVUb™VbšJVbVKXkVKVanU@aWnWUWa@U™nk@mVIVK@wXxlLXbVJVlKœbl@VI@mšaXalVV„VbX@@ašalnkx@b@V‚b@Vnx@bVVUXn¤WXn@Vl@Vlzn@š`@I@KUU@ƒV£namVkXa@aVK‚nnU@anVlKƒa@UUU@amk@»kƒU¯@aš„VWnkWmkImU@akaVm@»VUV@UKnkW¯XWlkUKnIWaš@nmlIXmWUnwUwWm@wULmaUJkIUaƒaWa—klwkwmJmU@bkJ@XUJ¯W@XbWbUKUkWJUUVKnn@UmmXUWa@mU@@UI@WmXVykwm@kaULWwU@¯ƒlKUUVU@mU@UkmaUbmV@b—š‚xVnVUJVnƒ„@Jn@@bl@@knJVblInV°@nx@„mbU@UWUbm@ULVVVb@LkJmXkm™VWIUJUXUKVwƒV™UƒŽkLkUƒ@W`Um™kVmIUƒ@kƒ@@a¯lÝ¥kmJUƒn™KƒÑmbUb@Wb™ak@mWU@UbƒUVVkLlbUVƒkXaWK@LkxÇmk@@X@J@Vƒ@@X@VUV@V„IWln@mbXVWXkKWbnxVUnV„ƘInl@XUxVl„¼UV@b@b@xlLkV@VmzmV@b@VUVVLXVVbVLXKmVVLU‚@nnVWXXJ@V›¦UK@LUmkIWbk@@lUImJnšVÒVUnVVbVIVĖUxV‚@bnUVL@WV@@X@V„KlXXaV@@bƒlVxXVVIV@@WkI„UVKUkVmlnnŽƒbllU„VbXVWbblVkb°ŽVInVVV@bšnVx@l@bnVVnUŽUam„UL@bƒVVÆUbUXU‚ƒn@šVVUb"],"encodeOffsets":[[110667,29785]]}},{"type":"Feature","id":"5223","properties":{"name":"黔西南布依族苗族自治州","cp":[105.5347,25.3949],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@VL@Vl@@IXW@kVUVbnW@XlKVVnU„VlL@b„aVbƒb@xX‚°ÔUxV@kbm@VxkxWJœ„V¦ƒŽ@ÈnšVKšxWXJmV@n„Ò@xVbn@@blLk`VX@bššla²JVUlnn@U±lw@wnw@mlwVIX@@m@klKnk‚a„KnwmmXkƍVm„Uš¥l@nb°n@„aVwVmVIVnI@a„¯@mšU°ƒl@@VnI@JV@UV@b@IUbVJmXöºƒzllUbVa@aXUl@„U@llLnKVaUa@UmK@UšwV„bnKV@VwVK@UXƒV@Vbn@‚w@U„WnX‚@„a@m„I„™@UUKlaUaVk¯ƒVaVLXK˜»XaWk¯mƒkğwmW@mIƒVkwƒJUIšÇVwU™UkVKkƒm@UkmU@WÅwm£Vƒ„m¤¯IkJWa™_™lUbmJzÝJk„ƒUÇVU„ƒ‚@bU„Ýn™m¯LUb@`mL@VkL@VƒUmmk@UU±Umka@kUƒ@ķymUkk@mmkÝmUaUakImV@V@VÅLƒ¦ƒJUXmJXšWb@n°Æœx‚¼nV@LlbUŽUbmL¯@ÞbV¤nbVx@bUVlblIœ™@KVVUnVJUn@VlLUlmLUUUxmK@I@@VW@@bU@UJmUkLVVUl@b@V"],"encodeOffsets":[[107157,25965]]}},{"type":"Feature","id":"5202","properties":{"name":"六盘水市","cp":[104.7546,26.0925],"childNum":5},"geometry":{"type":"MultiPolygon","coordinates":[["@@ôyVL@nXJV„Ub„x‚bUŽlšU„@ŽšnŽVbV@naVw„a‚VUXVx„x„bnaWmXaƒ_@y°aVUkaVI„aVamkXa@WVU@aUUlUXwVV@UVšbVUnKUwVa°a„bVIlan@manw@VšklJXI@m„LVVVUVK@U„ǃk@KUa@UkaVU@UVWV_XWVXVWlLXKlLXaÆKšwVL@akKm@Uwƒ@@XUVk@VUI@wWK@aUV™I@UkK@ƒmL™Wƒ@kImJƒUÅVmkXUW@UJkx@nmx@xkxV²m@kmUV±Ikb™™@aUWl_kK@am@Ua@wƒÑ@mnUWIX™wULm™@DŽU¥›ƒXIlwUwn@laU@Vw¯ÓW@w„aUaƒb@akKƒUmVUUkL@WmXUaUV@lWX@Jk@@UUKULmLUJmzkKmVX°VšUnWKUL™ƒƒL@mU@UnVJ@b@„UV@Xƒ`m_@l@@bmbXJmnnš@°˜wnn@ŽVLX@V‚@nVl@nk@@b‚l@nn°WlXzW`XXVKnUlxVbUb@‚V„Xb@Ž‚VxÈbVlnbmn@ŽkVUL@„ƒŽmLUVVL"],["@@@ƒ@UmWUwkU@Um@@VkL@V@„„‚@„V@VkV@nbVa"]],"encodeOffsets":[[[107089,27181]],[[107213,27479]]]}},{"type":"Feature","id":"5204","properties":{"name":"安顺市","cp":[105.9082,25.9882],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@lL@bUK™xÅLWbkKWLkKUXUWWXU`UX@VUVlb@VVb@L„l°xXx‚bšbXUVb‚VnU„xšKlL°šnUlVn@UmVU@kUUVašblVXKV@ƄXþlXUxnU@mVK@_@ml@UU„@šblU@KnLVyUw„@@UmkšWVw@UVK@VXzVK@n„VVUUW@kVJnlaš@nKW™kaWL@U—™õb@JU@mU@@_WWƒL@lUU@WUUK„@lakÅUUlWVa_@`WIU¯mW@InKVVXa@Ll@VaV@@UXUWakUVWUIUW‚UkUƒƒmVXW@@amUUm„L˜l@UUa„wn@lašIVlnLVKUUšU@amK@kUKƒVyUU@aUImK@UXa@aV@VakaW@@UnIVWVaUkƒb@mWƒX@Vxm@UaU@W„@VULUxU@mLƒaUŽ™x@VnL@VVbUbmLkK@kƒVk@WV@bUbVakk„yõ¹nWUIVa@J@aVUU@@ImJ@Uk@¯„™V@nƒ°@bmJUUJUnUxƒbm@¯Žmak@™¦ƒVUnŎWlnnmxƒLbmlkL@l@nWVnlÆU„VnIlJ„@šXnK@„lL@VšJVU@bXL@xVJUl@VU@W„@Vxn@"],"encodeOffsets":[[108237,26792]]}},{"type":"Feature","id":"5201","properties":{"name":"贵阳市","cp":[106.6992,26.7682],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@nŽlLX„VJ„LVblJ„n°ln„„LlVnKlU@nUUa@WlX@l„n@‚Vb„@la@a„„šlJ°¦„Kšwn@°x„LVkUmmwUmk_la„bšK@UlK@UUm@wƒL™mnwmw@U@¯@KnL@aša‚ġXWW@UKbƒKWX—JƒIWakJ@_kWƒkƒKUU@UVKk@@Ula™mV_X@WKXKƒ@WUUnUK@kU@WJU@@UnK@LVUVJVkUK@UUJm_@UaVaV@UU@Wƒw@aV@Xkmmm@kw@IVa@KVLXU@`lLX@VKm_@yƒI@WœU@UlVl@UanU@Uƒm@U„aWaU@Ukƒ@XJmXVbkV@ŽƒIUVUbWUUKmbk@kwmV@K@mWUXUakb›KUUUJVb@LU@@VkL˜š@VXKlbXšmL™@kbm‚UI@lVXUVƒU@mULWy@UUL@VUx™Xnl@Vƒ@VxUzmK@LkV™aƒ@VVk@@n@`UL@nmV@bmJ@Xœ`WX°WVƒn@xnxnIl`VbnVlwXUlLl‚„_nV@b@bl°„V„nWJkx@nmx@b"],"encodeOffsets":[[108945,27760]]}}],"UTF8Encoding":true}; }); -define('echarts/util/mapData/geoJson/hai_nan_geo',[],function() { - return {"type":"FeatureCollection","features":[{"type":"Feature","id":"469003","properties":{"name":"儋州市","cp":[109.3291,19.5653],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@஼jpnr’``ŽpRVHʘ̤žZt^JÖA˜[†CâlTébQhRPOhMBcRSQiROE[FYdGNOEIH]MgEAMLLIAG_WMCSL@ED]PCLYC[ZIHgjSxJTMbHNEFCMEE_HSDFHSLECRNSFDRICHNADGPI\\RZGIJTIAHLDQOHG`GTNCOIC@eIGDWHIS[kiE[FMbECZS@KKS[FDWsCeRuU_DUQNOE[LKGUBM¨EDQP@HWHGDImXƒCog_~‹I_fGDG|QDUWKBC\\ore|}[KLsISBHVXHCN`lNdQLOnFJSXcUEJMCKSHOUMDIm_‹DI`kNDIGEYFM\\YPEEIPMSGLIKOVAU_EBGQ@CIk`WGGDUM_XcIOLCJphHT_NCISG_R@V]\\OjSGAQSAKF]@q^mGFKSW^cQUC[]T}SGD@^_ˆaRUTO@OHATŸ”"],"encodeOffsets":[[111506,20018]]}},{"type":"Feature","id":"469005","properties":{"name":"文昌市","cp":[110.8905,19.7823],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@€hIJ¤Ī¯LQDaFßL[VQìw€G‚F~Z^Ab[€¹ZYöpFº lN®D´INQQk]U‘[GSU©S_­c‹}aoSiA£cŁ¡©EiQeU­qWoESKSSOmwŸćõWkàmJMAAMMCWHGoM]gA[FGZLZCTURFNBncVOXCdGB@TSbk\\gDOKMNKWQHIvXDJ\\VDTXPERHJMFNj@OwX@LOTGzL^GHN^@RPHPE^KTDhhtBjZL[Pg@MNGLEdHV[HbRb@JHEV_NKLBRTPZhERHJcH^HDRlZJOPGdDJPOpXTETaV[GOZXTARQTRLBLWDa^QAF`ENUPBP…\\Eji`yºEvåà"],"encodeOffsets":[[113115,20665]]}},{"type":"Feature","id":"469033","properties":{"name":"乐东黎族自治县","cp":[109.0283,18.6301],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@ªVLP`@PEdNRAHOPEAKHEVL`GZBJfvdTAXNNTZJFPrHHNpKTD\\ILHbEVd^J‚OHLh@NNBnHP`\\xH@NBRLJTlŽNv_^CTLd@bNDVFbxdFV€UPBTKOGEOUO@OEBXQP[H_EI\\EbeYa@UO_J‹MEJ_IEDKJUGMDcNUd_FMTEJSGoZ]EIYGO[YW‘gEQ]a@WHEDQKUSDUGAbYBUpSCYNiWqOSQEoF[UcQISWWNMSDe_cLQ_UBiKQOOASQAWgS­ā]ZaŽSPÝZ]XMXSŒ[^oVËNgNKlE RôEø"],"encodeOffsets":[[111263,19164]]}},{"type":"Feature","id":"4602","properties":{"name":"三亚市","cp":[109.3716,18.3698],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@®ĂhTBXTRPBRPjLVAR`dKf`TC‚NXMTXRJVdE\\FpTRrPjXZMTDVoZABaVHTCLVCRGF@X^bFR’hZXP\\ZHHMA[^wBWXJlW¤EJ[bCTOF‹WWMm@ILMGWQ@DQ^QNWFSHEbF`OXNbO„VNKTEPDTLTCCVTREfvfEHNbRAENH^RJXCFHNFRpVGHWISDOTMVCZeGamaLoLÛD¹¹ėgsia{OųE—Tt‰lɂwr}jŸR±E{L}j]HąKÃT[P"],"encodeOffsets":[[111547,18737]]}},{"type":"Feature","id":"469036","properties":{"name":"琼中黎族苗族自治县","cp":[109.8413,19.0736],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@bRFnHNbHŒgN@NPEnbXP@bND`NT\\@\\QZb@`@J]V@XhžDpW„nCJGHGXO@CR§FANHVKLF\\MPVR`CvVfQtDPKpGHG@S`WJP~^dSTHWX\\RHTFACQTIAUPOU@MG__IaYSFQK‘NSbORHXCZeTFJg„B`YBMNMFi~IVDV[tGJWXGDQRGF]ˆJrALgESLSAYDGIaFeXQLS\\MKSLSQYJY}eKO[EHiGSaK[Yw[bmdURgEK^_kcSGEOHKIAS]aFSU@Y]IWFUTYlkP_CUOUEkmYbSQK@EMWUuAU\\M@EpK^_ZMDQ^OXwC_ZODBrERURGVVZ\\DTXcFWNIAWJWAYUUFYEWLQQaCIZeDM`cLKRGpanJZQd"],"encodeOffsets":[[112153,19488]]}},{"type":"Feature","id":"469007","properties":{"name":"东方市","cp":[108.8498,19.0414],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@ºŸx‹JYZQ”IŠYXLl@dR\\WZEn]bA\\S~F`KXaDeTiNO^EEKWEDQXITBXaWaDQMUJOIaTWf@NJV@dSxGZ‰Fu_@WMKAUˆ}AQ@MwG_[GOAmMMg@GKP]IUcaFKG[JSCoLGMqGEOYIMSWMSBucIeYA_HUKGFBLOFGPQBcMOF_@KO©UAtERadwZQ\\@ÊJÒgòUĪRlR°KĮVŽLJ"],"encodeOffsets":[[111208,19833]]}},{"type":"Feature","id":"4601","properties":{"name":"海口市","cp":[110.3893,19.8516],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@ńZƂtĢ¬æßFuz¹j_Fi†[AOVOFME_RBb]XCAKQKRSBQWSPY\\HbUFSWSPoIOcCOHIPkYCQ]GdGGIFQYgSOAQLK`MFUIGa@aQ\\GGUFcHKNMh@\\OYKAigsCgLSF]GOQO]@GM]HyKSHKPW@Pxi@EMINYREXWRQ@MQcFGWIAwXGRH\\yDI`KJIdOCGRNPNtd\\UTMbQYi@]JeYOWaL[EcICMUJqWGDNZEXGJWFEXNbZRELFV]XQbAZFrYVUBCLNFCHmJaMIDDHXHEhQNXZ_TARFHVB@DTQIRR@YHAJVnAbKFUEMLd\\c^ÍÞ"],"encodeOffsets":[[112711,20572]]}},{"type":"Feature","id":"469006","properties":{"name":"万宁市","cp":[110.3137,18.8388],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@^J@ZTVbET^JBGLFPTHld]`FLQhcVanx\\\\ZbLHTGj\\FLP~fIZRZPVTQFSVAFJE^NDLEE[~LjsxVTG\\NZZNGlLRRGLJTV@hPZANN^@T\\NEPPbDZXO`d^HSvcJDIV\\XZAJUFCLNP@PQ¤@[ïKLÑIÏ]ÇE±I{uƒ­YśUćFcYUmsVeBSVgB[RO@aYYPO^]@UVaNeDShMLG\\EfFVE\\F`"],"encodeOffsets":[[112657,19182]]}},{"type":"Feature","id":"469027","properties":{"name":"澄迈县","cp":[109.9937,19.7314],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@T\\GJCXJH@fJDDPNCNJENN^NLHBNSx@DDYbBLLDRbjZTj@`XXTlG^Xr@PJLW\\WLTlWR@HDJTD@X_PO@STMDNTMVV@NLDM`M\\XM\\JNBH[PYZ‡úYzŸ`Ċ\\ÎÝd]c[NKVFLEBaUmBIZGQ@JQSR@CUAEGBQ`SWYRMFgWGCGJCbNnIDGMEDKVAZUEqBYRa^WEUFKYQMaFWXEHIFWMYHCrXVIIiaK@aMCUYNSIISTwXALKH@XWXIEIJQCG[IEQDE_XSBaa[AIPW@]RS[FWS[CD]PEBYNGFSaSyJG]@ugEUDQlGHiBKHUIoNSKqHFaPMICK]UUHIPDJMuCA[SCPIDIOILGAEmU[POPBVSJDREBGS[QXWSGcT}]IO_X@TGHoHOLCX\\ELT@LYTD‚aFENF\\lj"],"encodeOffsets":[[112385,19987]]}},{"type":"Feature","id":"469030","properties":{"name":"白沙黎族自治县","cp":[109.3703,19.211],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@D\\RV]dTXELnHr]^@LETBBRTHPi^[@U`QTHDJ`MGSogDIPKdJ`WVNHCXHl_DJR@AH`FBVPUJLHKNTJOFFZON[ZEHFCJlMJ_ŒCn`CJVNGPLTNDFIdVTWEIPmRKMc_kDMWGGUTAtJLK~\\f{pqD[LAVXRCH{HC`eŒJ`}@W^U@I@_Ya[R[@MSC_aMO@aWFmMOM@‹haGGMEmaQ[@MESHaIQJQ……MckBIw[AOSKKAMPSDSLOAV_@@`KJRbKRDfMdHZERgAWVsDMTUHqOUr@VQXTT@Tƒfg‚L^NH\\@heTCZaESNObHPƒHeZF\\X^ElM^F^"],"encodeOffsets":[[111665,19890]]}},{"type":"Feature","id":"469002","properties":{"name":"琼海市","cp":[110.4208,19.224],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@TP\\pATHTGlZDJGAQjE\\Rb@jVBDCN`JZ[NCNHNXbULPrP\\KNbMTLjJJRFP`“pNLZz^FLRHjVPZ@hxVKbHBHMNNJFRlLzGPnNHhIrHHADcPWdUAmEMVQDSKYHY\\EhBN^HpXGNDBNNBnIß‹Å_g{³So]ã@ORO@KMEDIVYB[WJUICudGTc]P_YWaCOOMFS[]@MMYBgOU@ISHKQQkKMHYY[MSHwUit}KF\\KFMCF]EIUBETSROUKTLT[NKTWREfJbCHBZKTFTKh"],"encodeOffsets":[[112763,19595]]}},{"type":"Feature","id":"469031","properties":{"name":"昌江黎族自治县","cp":[109.0407,19.2137],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@`ZĤd–`òüˆ˜ “BSPGP@VSbQ`‡@]HC~T^SE]N]FkW]E[fY„GGOPaTMbFDYfS@g[MGK]h„e@SSSRW@UVqrPVGNStCXUhBFQGYNcCeLQQaLI@_`@EUwcEaCUaMc@SK]Du`MSkKI‡~BVNL@X`‚EvYŠwHcTU@MIe@SXJbIPNVCRXbWbSAWJCRXFFL]FMPSjCfWb_L}E[TaBm^YF[XcQk@WK‰Z“JYRIZwŒ¹ "],"encodeOffsets":[[111208,19833]]}},{"type":"Feature","id":"469028","properties":{"name":"临高县","cp":[109.6957,19.8063],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@jD`hNd\\^dZädĒH´Op@ˆùZY\\OAGIMN[[W_NCNMKU@NUMSNCTSP@`O@WSCCI@GXQSkXKX[IK@OWqH]SkWW@_SiiYQaKCAKZaCCw@MTGAMKM]FMMIMDSM_HGHRPKCBGSJJIYH[QOJCHMBDGQJECMTDQKFGTCEGTF`NFEDMFaGSNwIiTGhYJD\\KZODC^@FTKND`XBHKJNKFBNhG^FJMPcHEZF\\QPRjQTAdgNOPgQaRSê"],"encodeOffsets":[[112122,20431]]}},{"type":"Feature","id":"469034","properties":{"name":"陵水黎族自治县","cp":[109.9924,18.5415],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@R]NC`YL]FoN@V[vBXVFNL@TRZalnVFVP`DlOZkVSXEE_F[EUFeH[NKTgfCbMVU^@P]ZObZP@\\QhATUfAtUasñiāEoI]eYǯ@aKmaeƒWuCºKÜKpnbHbYfUDSNCPJTRAHJTDJSfDNLHXC``VBNGTYCQDIXMDSP@xLNEFRNXBIpVNLXah@RgF@`qOML@LJNSPLbaHAh@Jdj"],"encodeOffsets":[[112409,19261]]}},{"type":"Feature","id":"469026","properties":{"name":"屯昌县","cp":[110.0377,19.362],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@\\OnVBFKHPJCJOJTDB\\vDINOCGJVVL^JDONEbrGTLpMVJLGjAHGRkVChF@vH^zIbTETMHAZOFC^\\DXT\\EffAP\\PdAV@UIYfS|S@YPICMeM@sC[_A]VQEwyHSMuNcAUlQJMVGMS@mVBZPFO\\CSFQK[LqDMACiUa@[QiFBRIHYCHkGSBS[oSOqB‡IE^QHCRWHIXsHU\\UC}JEjMNAN_ZƒAIhSEYfWDQGaPMTL’ERZTJb``NHV@"],"encodeOffsets":[[112513,19852]]}},{"type":"Feature","id":"469025","properties":{"name":"定安县","cp":[110.3384,19.4698],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@JjDNdJ\\FbKPXfZ^Ij@RZNaVSc[MsMOHQPDJcLIJ_zCG[HQxWJBHXdENRR@XQFWZQQGOFSWUCI[WCJuRGLXNMPLhCl[Ta@SqGgJMGOmyHkKEQMINMAGaGULgwY@UOGiKQ]EYyMK”oO_QEIIKiNSMa[LqOKOaVMWMGMDY\\_IKrL\\ERT[DEPYOUA@nNTUHINkRBVMdNvGTxzRF^U`BD\\@tfNDNOJ@Z{TeTJZ@VU€cB[OBOeeQT@^OXBJb\\AbWTF`RCJFH\\RDJIJFXW@WLGBKxWTSJJMTVZND@bbL"],"encodeOffsets":[[112903,20139]]}},{"type":"Feature","id":"469035","properties":{"name":"保亭黎族苗族自治县","cp":[109.6284,18.6108],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@FJp@fxpQ\\ApN\\GNPNBM`HLMrXLXj\\PEHnI@WUCEM\\GTc\\GZYHTPBHRCPTd€H\\K\\@HXi–BJILJJAVNTOZJNtFPC`YxDPWci@IBgbGKaTOIM@KNKrP@_hE@QbgKWUMJoWAQMFEKM@wTONCJWRCZDHSAM_UD_GWMKeCITSCGIQBGXUHQoMEEGWDQIG]FMQBMaFGueFeSQDUSDSKOCSFMLƒUaPWM_PaEGFETMX]RCRR@HXKN@JNnXXEŒSPaDI\\£FkXWIAX]xB\\GN"],"encodeOffsets":[[112031,19071]]}},{"type":"Feature","id":"469001","properties":{"name":"五指山市","cp":[109.5282,18.8299],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@TCNOLBTLBPx\\AJdl†NR†RIbJTGNF\\@RcIYbmHoLQdKN_fCJYbDRRXKZFVEZVXBXIJBXMdESW[CUYHUVQFQAqsEIMPYMSBUIIJKAIj•GW[@[LGScDOGQOAGSYZ[HSd[HFNVD@XmJFG[OWiWKNqGKN_MAMO[HoM[BoRewo@Y^HpITSFENc`MVCdHNIVCLJFI`NFIŒP`@VZbaf[FFJG`O\\WRFA@PVPFPPH"],"encodeOffsets":[[111973,19401]]}}],"UTF8Encoding":true}; +define('echarts/util/mapData/geoJson/hai_nan_geo',[],function() { + return {"type":"FeatureCollection","features":[{"type":"Feature","id":"469003","properties":{"name":"儋州市","cp":[109.3291,19.5653],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@஼jpnr’``ŽpRVHʘ̤žZt^JÖA˜[†CâlTébQhRPOhMBcRSQiROE[FYdGNOEIH]MgEAMLLIAG_WMCSL@ED]PCLYC[ZIHgjSxJTMbHNEFCMEE_HSDFHSLECRNSFDRICHNADGPI\\RZGIJTIAHLDQOHG`GTNCOIC@eIGDWHIS[kiE[FMbECZS@KKS[FDWsCeRuU_DUQNOE[LKGUBM¨EDQP@HWHGDImXƒCog_~‹I_fGDG|QDUWKBC\\ore|}[KLsISBHVXHCN`lNdQLOnFJSXcUEJMCKSHOUMDIm_‹DI`kNDIGEYFM\\YPEEIPMSGLIKOVAU_EBGQ@CIk`WGGDUM_XcIOLCJphHT_NCISG_R@V]\\OjSGAQSAKF]@q^mGFKSW^cQUC[]T}SGD@^_ˆaRUTO@OHATŸ”"],"encodeOffsets":[[111506,20018]]}},{"type":"Feature","id":"469005","properties":{"name":"文昌市","cp":[110.8905,19.7823],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@€hIJ¤Ī¯LQDaFßL[VQìw€G‚F~Z^Ab[€¹ZYöpFº lN®D´INQQk]U‘[GSU©S_­c‹}aoSiA£cŁ¡©EiQeU­qWoESKSSOmwŸćõWkàmJMAAMMCWHGoM]gA[FGZLZCTURFNBncVOXCdGB@TSbk\\gDOKMNKWQHIvXDJ\\VDTXPERHJMFNj@OwX@LOTGzL^GHN^@RPHPE^KTDhhtBjZL[Pg@MNGLEdHV[HbRb@JHEV_NKLBRTPZhERHJcH^HDRlZJOPGdDJPOpXTETaV[GOZXTARQTRLBLWDa^QAF`ENUPBP…\\Eji`yºEvåà"],"encodeOffsets":[[113115,20665]]}},{"type":"Feature","id":"469033","properties":{"name":"乐东黎族自治县","cp":[109.0283,18.6301],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@ªVLP`@PEdNRAHOPEAKHEVL`GZBJfvdTAXNNTZJFPrHHNpKTD\\ILHbEVd^J‚OHLh@NNBnHP`\\xH@NBRLJTlŽNv_^CTLd@bNDVFbxdFV€UPBTKOGEOUO@OEBXQP[H_EI\\EbeYa@UO_J‹MEJ_IEDKJUGMDcNUd_FMTEJSGoZ]EIYGO[YW‘gEQ]a@WHEDQKUSDUGAbYBUpSCYNiWqOSQEoF[UcQISWWNMSDe_cLQ_UBiKQOOASQAWgS­ā]ZaŽSPÝZ]XMXSŒ[^oVËNgNKlE RôEø"],"encodeOffsets":[[111263,19164]]}},{"type":"Feature","id":"4602","properties":{"name":"三亚市","cp":[109.3716,18.3698],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@®ĂhTBXTRPBRPjLVAR`dKf`TC‚NXMTXRJVdE\\FpTRrPjXZMTDVoZABaVHTCLVCRGF@X^bFR’hZXP\\ZHHMA[^wBWXJlW¤EJ[bCTOF‹WWMm@ILMGWQ@DQ^QNWFSHEbF`OXNbO„VNKTEPDTLTCCVTREfvfEHNbRAENH^RJXCFHNFRpVGHWISDOTMVCZeGamaLoLÛD¹¹ėgsia{OųE—Tt‰lɂwr}jŸR±E{L}j]HąKÃT[P"],"encodeOffsets":[[111547,18737]]}},{"type":"Feature","id":"469036","properties":{"name":"琼中黎族苗族自治县","cp":[109.8413,19.0736],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@bRFnHNbHŒgN@NPEnbXP@bND`NT\\@\\QZb@`@J]V@XhžDpW„nCJGHGXO@CR§FANHVKLF\\MPVR`CvVfQtDPKpGHG@S`WJP~^dSTHWX\\RHTFACQTIAUPOU@MG__IaYSFQK‘NSbORHXCZeTFJg„B`YBMNMFi~IVDV[tGJWXGDQRGF]ˆJrALgESLSAYDGIaFeXQLS\\MKSLSQYJY}eKO[EHiGSaK[Yw[bmdURgEK^_kcSGEOHKIAS]aFSU@Y]IWFUTYlkP_CUOUEkmYbSQK@EMWUuAU\\M@EpK^_ZMDQ^OXwC_ZODBrERURGVVZ\\DTXcFWNIAWJWAYUUFYEWLQQaCIZeDM`cLKRGpanJZQd"],"encodeOffsets":[[112153,19488]]}},{"type":"Feature","id":"469007","properties":{"name":"东方市","cp":[108.8498,19.0414],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@ºŸx‹JYZQ”IŠYXLl@dR\\WZEn]bA\\S~F`KXaDeTiNO^EEKWEDQXITBXaWaDQMUJOIaTWf@NJV@dSxGZ‰Fu_@WMKAUˆ}AQ@MwG_[GOAmMMg@GKP]IUcaFKG[JSCoLGMqGEOYIMSWMSBucIeYA_HUKGFBLOFGPQBcMOF_@KO©UAtERadwZQ\\@ÊJÒgòUĪRlR°KĮVŽLJ"],"encodeOffsets":[[111208,19833]]}},{"type":"Feature","id":"4601","properties":{"name":"海口市","cp":[110.3893,19.8516],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@ńZƂtĢ¬æßFuz¹j_Fi†[AOVOFME_RBb]XCAKQKRSBQWSPY\\HbUFSWSPoIOcCOHIPkYCQ]GdGGIFQYgSOAQLK`MFUIGa@aQ\\GGUFcHKNMh@\\OYKAigsCgLSF]GOQO]@GM]HyKSHKPW@Pxi@EMINYREXWRQ@MQcFGWIAwXGRH\\yDI`KJIdOCGRNPNtd\\UTMbQYi@]JeYOWaL[EcICMUJqWGDNZEXGJWFEXNbZRELFV]XQbAZFrYVUBCLNFCHmJaMIDDHXHEhQNXZ_TARFHVB@DTQIRR@YHAJVnAbKFUEMLd\\c^ÍÞ"],"encodeOffsets":[[112711,20572]]}},{"type":"Feature","id":"469006","properties":{"name":"万宁市","cp":[110.3137,18.8388],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@^J@ZTVbET^JBGLFPTHld]`FLQhcVanx\\\\ZbLHTGj\\FLP~fIZRZPVTQFSVAFJE^NDLEE[~LjsxVTG\\NZZNGlLRRGLJTV@hPZANN^@T\\NEPPbDZXO`d^HSvcJDIV\\XZAJUFCLNP@PQ¤@[ïKLÑIÏ]ÇE±I{uƒ­YśUćFcYUmsVeBSVgB[RO@aYYPO^]@UVaNeDShMLG\\EfFVE\\F`"],"encodeOffsets":[[112657,19182]]}},{"type":"Feature","id":"469027","properties":{"name":"澄迈县","cp":[109.9937,19.7314],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@T\\GJCXJH@fJDDPNCNJENN^NLHBNSx@DDYbBLLDRbjZTj@`XXTlG^Xr@PJLW\\WLTlWR@HDJTD@X_PO@STMDNTMVV@NLDM`M\\XM\\JNBH[PYZ‡úYzŸ`Ċ\\ÎÝd]c[NKVFLEBaUmBIZGQ@JQSR@CUAEGBQ`SWYRMFgWGCGJCbNnIDGMEDKVAZUEqBYRa^WEUFKYQMaFWXEHIFWMYHCrXVIIiaK@aMCUYNSIISTwXALKH@XWXIEIJQCG[IEQDE_XSBaa[AIPW@]RS[FWS[CD]PEBYNGFSaSyJG]@ugEUDQlGHiBKHUIoNSKqHFaPMICK]UUHIPDJMuCA[SCPIDIOILGAEmU[POPBVSJDREBGS[QXWSGcT}]IO_X@TGHoHOLCX\\ELT@LYTD‚aFENF\\lj"],"encodeOffsets":[[112385,19987]]}},{"type":"Feature","id":"469030","properties":{"name":"白沙黎族自治县","cp":[109.3703,19.211],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@D\\RV]dTXELnHr]^@LETBBRTHPi^[@U`QTHDJ`MGSogDIPKdJ`WVNHCXHl_DJR@AH`FBVPUJLHKNTJOFFZON[ZEHFCJlMJ_ŒCn`CJVNGPLTNDFIdVTWEIPmRKMc_kDMWGGUTAtJLK~\\f{pqD[LAVXRCH{HC`eŒJ`}@W^U@I@_Ya[R[@MSC_aMO@aWFmMOM@‹haGGMEmaQ[@MESHaIQJQ……MckBIw[AOSKKAMPSDSLOAV_@@`KJRbKRDfMdHZERgAWVsDMTUHqOUr@VQXTT@Tƒfg‚L^NH\\@heTCZaESNObHPƒHeZF\\X^ElM^F^"],"encodeOffsets":[[111665,19890]]}},{"type":"Feature","id":"469002","properties":{"name":"琼海市","cp":[110.4208,19.224],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@TP\\pATHTGlZDJGAQjE\\Rb@jVBDCN`JZ[NCNHNXbULPrP\\KNbMTLjJJRFP`“pNLZz^FLRHjVPZ@hxVKbHBHMNNJFRlLzGPnNHhIrHHADcPWdUAmEMVQDSKYHY\\EhBN^HpXGNDBNNBnIß‹Å_g{³So]ã@ORO@KMEDIVYB[WJUICudGTc]P_YWaCOOMFS[]@MMYBgOU@ISHKQQkKMHYY[MSHwUit}KF\\KFMCF]EIUBETSROUKTLT[NKTWREfJbCHBZKTFTKh"],"encodeOffsets":[[112763,19595]]}},{"type":"Feature","id":"469031","properties":{"name":"昌江黎族自治县","cp":[109.0407,19.2137],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@`ZĤd–`òüˆ˜ “BSPGP@VSbQ`‡@]HC~T^SE]N]FkW]E[fY„GGOPaTMbFDYfS@g[MGK]h„e@SSSRW@UVqrPVGNStCXUhBFQGYNcCeLQQaLI@_`@EUwcEaCUaMc@SK]Du`MSkKI‡~BVNL@X`‚EvYŠwHcTU@MIe@SXJbIPNVCRXbWbSAWJCRXFFL]FMPSjCfWb_L}E[TaBm^YF[XcQk@WK‰Z“JYRIZwŒ¹ "],"encodeOffsets":[[111208,19833]]}},{"type":"Feature","id":"469028","properties":{"name":"临高县","cp":[109.6957,19.8063],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@jD`hNd\\^dZädĒH´Op@ˆùZY\\OAGIMN[[W_NCNMKU@NUMSNCTSP@`O@WSCCI@GXQSkXKX[IK@OWqH]SkWW@_SiiYQaKCAKZaCCw@MTGAMKM]FMMIMDSM_HGHRPKCBGSJJIYH[QOJCHMBDGQJECMTDQKFGTCEGTF`NFEDMFaGSNwIiTGhYJD\\KZODC^@FTKND`XBHKJNKFBNhG^FJMPcHEZF\\QPRjQTAdgNOPgQaRSê"],"encodeOffsets":[[112122,20431]]}},{"type":"Feature","id":"469034","properties":{"name":"陵水黎族自治县","cp":[109.9924,18.5415],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@R]NC`YL]FoN@V[vBXVFNL@TRZalnVFVP`DlOZkVSXEE_F[EUFeH[NKTgfCbMVU^@P]ZObZP@\\QhATUfAtUasñiāEoI]eYǯ@aKmaeƒWuCºKÜKpnbHbYfUDSNCPJTRAHJTDJSfDNLHXC``VBNGTYCQDIXMDSP@xLNEFRNXBIpVNLXah@RgF@`qOML@LJNSPLbaHAh@Jdj"],"encodeOffsets":[[112409,19261]]}},{"type":"Feature","id":"469026","properties":{"name":"屯昌县","cp":[110.0377,19.362],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@\\OnVBFKHPJCJOJTDB\\vDINOCGJVVL^JDONEbrGTLpMVJLGjAHGRkVChF@vH^zIbTETMHAZOFC^\\DXT\\EffAP\\PdAV@UIYfS|S@YPICMeM@sC[_A]VQEwyHSMuNcAUlQJMVGMS@mVBZPFO\\CSFQK[LqDMACiUa@[QiFBRIHYCHkGSBS[oSOqB‡IE^QHCRWHIXsHU\\UC}JEjMNAN_ZƒAIhSEYfWDQGaPMTL’ERZTJb``NHV@"],"encodeOffsets":[[112513,19852]]}},{"type":"Feature","id":"469025","properties":{"name":"定安县","cp":[110.3384,19.4698],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@JjDNdJ\\FbKPXfZ^Ij@RZNaVSc[MsMOHQPDJcLIJ_zCG[HQxWJBHXdENRR@XQFWZQQGOFSWUCI[WCJuRGLXNMPLhCl[Ta@SqGgJMGOmyHkKEQMINMAGaGULgwY@UOGiKQ]EYyMK”oO_QEIIKiNSMa[LqOKOaVMWMGMDY\\_IKrL\\ERT[DEPYOUA@nNTUHINkRBVMdNvGTxzRF^U`BD\\@tfNDNOJ@Z{TeTJZ@VU€cB[OBOeeQT@^OXBJb\\AbWTF`RCJFH\\RDJIJFXW@WLGBKxWTSJJMTVZND@bbL"],"encodeOffsets":[[112903,20139]]}},{"type":"Feature","id":"469035","properties":{"name":"保亭黎族苗族自治县","cp":[109.6284,18.6108],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@FJp@fxpQ\\ApN\\GNPNBM`HLMrXLXj\\PEHnI@WUCEM\\GTc\\GZYHTPBHRCPTd€H\\K\\@HXi–BJILJJAVNTOZJNtFPC`YxDPWci@IBgbGKaTOIM@KNKrP@_hE@QbgKWUMJoWAQMFEKM@wTONCJWRCZDHSAM_UD_GWMKeCITSCGIQBGXUHQoMEEGWDQIG]FMQBMaFGueFeSQDUSDSKOCSFMLƒUaPWM_PaEGFETMX]RCRR@HXKN@JNnXXEŒSPaDI\\£FkXWIAX]xB\\GN"],"encodeOffsets":[[112031,19071]]}},{"type":"Feature","id":"469001","properties":{"name":"五指山市","cp":[109.5282,18.8299],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@TCNOLBTLBPx\\AJdl†NR†RIbJTGNF\\@RcIYbmHoLQdKN_fCJYbDRRXKZFVEZVXBXIJBXMdESW[CUYHUVQFQAqsEIMPYMSBUIIJKAIj•GW[@[LGScDOGQOAGSYZ[HSd[HFNVD@XmJFG[OWiWKNqGKN_MAMO[HoM[BoRewo@Y^HpITSFENc`MVCdHNIVCLJFI`NFIŒP`@VZbaf[FFJG`O\\WRFA@PVPFPPH"],"encodeOffsets":[[111973,19401]]}}],"UTF8Encoding":true}; }); -define('echarts/util/mapData/geoJson/hei_long_jiang_geo',[],function() { - return {"type":"FeatureCollection","features":[{"type":"Feature","id":"2311","properties":{"name":"黑河市","cp":[127.1448,49.2957],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@VÈÞ@Žkx˜nXŽ°VÈa°V@kôw„b‚š„JVškXlVUx„„@ŽlL@xkVV°ƒ„VbxlVUnVxk@ƒ„ƒKkŽVb„Il„@°kVl„@„™lÆnkll@@V„VXƒŽš@V„²bUlƒVlV„U„VÇn@nkJšŽlkVbœ@›x²V@n°VUnlKU„n`@n°bWLnVUblVUVVbknV`°kkŽl@@V°@nz„J@XšxlWXb°n@bƒĠlbXb™bVbƒJ@Všb„a@„„@lbUbšVmnœ@lšVmnIW‚œ@WbÞ@„n@x°@š„ĢaƐéϚnœ„‚lČ¯ĠŻÈwm@ôçU™mm£Xy°UV™›@wÈ£Ǫ¯kõÝçUњ™Uķ‚ƒĢkVфÆšÞU°nŎ¥ČUĊx°m°¦żVƐœx°ƒÇ£@y„UônރÆ@Èĉ°Kô¦šW„kWU—bÇ»@™ÈĕWÇÈ£ŤU@›n£ÆUUKVamanwŃmÝJ¯k@JƒIkaVaUUÇbkaÆÑkWmÝUۙ™Ý@™ƒwnU±ƒ@kkV¯KUkƒJƒ¼U¦ƒšÅ@ówķaķůV¥Uaó@Åwmƒƒ_kVƒwĉ‚ĉmmn_V»™a@U™ƒVwķóƒ‚U¦LǫéóXÇmōLǓÇķxÝkƒƒĉ™kmakbUĶ°@W¼„@bƒšÈÆ@Ė™L„l@„°J¯„mkl¯L݃±L—amJ@¼ƒ„™VƧUó„™UX˜ċb¯ńVbkÆÝI@llx„k°V²šV@Uxގ˜L@b„@b™`ƒšÇzkókݤ@ğ¯Wƒ™LĉǙLmmnċVkbUaƒL@Ž¯„‚bU°ğL݂Ý@"],"encodeOffsets":[[127744,50102]]}},{"type":"Feature","id":"2327","properties":{"name":"大兴安岭地区","cp":[124.1016,52.2345],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@k›ƒϙmƏêġb™ƒ¯@@wƒmÝ@XV@IlŽl@bUxl¯VlV™bV@ULVlUV™_kx™VVV™ÈÝJ@„¯šU„™lm¯x@xóÒĉ¼m„¯Wƒxţ@Uz¯ƒWwnUwťƒ@knƒWƒ£óVƒUUwğyó¦WI—Vmm™I@±kwÇ@@bƒ@ĉ¼ó@¯wó@¯aó¼›KՃaUwmWUwÅI@aƒKó@Ua™LƒaƒVÅwō¼UUÝl±I—¤VxÇx@zkJmnn‚mbnz™xlŽƒl¯ČkJl™°@„kb„Žmx@x™@kêmVnŽWxôXšxU°„bWLóJnÇWĵ„V¦™ŽƒUUb™b™ÆġK™šk¯™VU±aXmċÑUwĉKġ„k„™ŽVxk„ÇKkbƒIƒ‚ÛXWl¯bƒŽ™X¯K™bĊš„„ÞVƚnŽĸ²lxUŽ°n°òÈb‚¦—xVbƒŽƒ@¯„Vx@¯VķÞČlĊ°KĸŽȘI°¤ČIôŽò»ƨnȰKǬ¦ôWŎÈƨwlƒnKVXmbX`lbšwkVW‚XXŽ„L°a„ƾaĊ£nƒ°@°¥ŎzÞ¥‚»œalwôkƒJ„a@ĶK„£„bU°ĊxźVÈUĠ¥ƨ™VI@XU°x°Ln¥šw°UmwXm݁V¥ĢŽ°@nU@mÆ£š¯lKœšÜw@aÅU‚¥UaÝIkmV²‚nn@Ķ»@Uk¥VKÞ@ÞÛ@ƒkVmĢa@_ƒJómƒǖ¯Æw—óÇa@alƒUwšwĢřšk@wÆWXUWXƒWa™m@_ƒ»ÇéXaĸwVa@ÝKkUWkX‚kšKXxƒn@lĊV@¯m¯nřÆwš¥"],"encodeOffsets":[[130084,52206]]}},{"type":"Feature","id":"2301","properties":{"name":"哈尔滨市","cp":[127.9688,45.368],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@°`„_šJlUšŽ@„„@V¦°JUšŽnLôlnŤ@@šÈaUÒVbkbl¤ƒzk°ÇVÛô°IlVUVôU„xÆU„Ž@bźĀ„º@¦šb@l²‚UVlœ@°ÒĠxšnXxÆVô¼Þ@Üx²KލlƒVÑ°UȰôlwô@²ƒĸ°„lanV@„šVŎUll@bÈnÜm„wĢ@la@ÝÞb°UXb˜lŎ²ÆškšV‚I@ŽnJnĠŽ°knƒÜbĢwna@a˜kÞKƒĀ„a‚™œ‚‚IVbU¥wĠwkô˜xnLƒċVçkaUƒ±IUmnġW„°WôĉšalƒÞÅĵ¯@W¹XÝaƒb¯a±X¯ºLƒaVƒmkLóƒƒbkaƒVUKVkkKV_@aÝykk±L@ƒÅU@yV_™aU¥ówÇx™@UkVƒn@lƒkÅlwšWVwUkĉmkklW@šašbVwnWWƒ—wWL™™@Ušƒ™UƒÇLšÇmƒ„@wƒJĉƒL¥@ƒÝ_@a¯y„UWw¯ƒ¯Uġx¯aÝXVmaU£ó±›¯nwƒa¯óÅVƒXman™„Uƒ›lUXkWa@mkI„›ğaƒm™IklÇU™„kĊƒƒzkKƒš„lU„ōĬlš™„@ŽnX°@llUxŹ²mKĉVWwk@UbUK@bmVmI—ƒVmwaWxXlWȁšmºšÞÆbUxV@ĵńWÆĉLkWUbƒaWzkbĉ`U„±LklōwUVÝ£™UW`Uwk@mk¯VkaõVX@WbL™K@XƧºWzxƒK@lmX@bkVVÆk¼Vbk@Vn"],"encodeOffsets":[[128712,46604]]}},{"type":"Feature","id":"2302","properties":{"name":"齐齐哈尔市","cp":[124.541,47.5818],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@Þ@ށĠKV¯a°ƒ@„KVblaČU‚mnnšKĊȚKX„°ŽĠ@Þ£ôllÈy„™š_@a‚ƒ@a—KݍVwU@±™¯Uƒlkw@kÞJlÅUa°ŃČaW—šVôƒƨVšU„ƒ@»nI˜b²Kބ°Klkn°ƒ¯I@ƒƒkšK@ĕÇń™@aƒX»¯@VĵlaÿVamI@aÅÝउýƒĊȗJƒôȁÅkmƑۃ@kxġ@@l™aVk¯»ƒīŹaƒkƒ¥Å¯™JUaWU@@w™aƒ»„KUkÆkUm„UmwÛ±±UUbUŽUXƒwWwÆÝk™lkUanaWwnKl™kal¯ka™ƽa›kÅx™a¯@™amb¯V™lÇwÛĀ™V@x™šmêVƜVV‚aôV„wÈx@šˌx„¦VÞ¯VšlmX@‚ƒL@¯Ua¯LmV@„„°X„ċK™V™ƒ@UƒÈ@‚¥@w—ƒġIU™km¥Źwƒ¦¯lmn@°kxVV@¦óam„n¦l@nx™lĉVóšmx™n™ÒĉĀĊ¼„þ„šǔêÞ°ˌĠÞÒ°ĀɲĀƨźˤȤƨĊ°w@£nymwnkUUV¥ôÑVmkÆmUUVa™mVIkmô„lxkXÞþƒbl„ƒl@kV„ƆƒV„xV@š¼VÒ@šŽUŽšnnނJ"],"encodeOffsets":[[127744,50102]]}},{"type":"Feature","id":"2310","properties":{"name":"牡丹江市","cp":[129.7815,44.7089],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@U`lLUlVL„Ulb„aô„lKnŽU„„b‚K°¹²W°b„aÞb˜knyUlUkamř²L@m°@lšmš²n`ôÅlK„x„ÜKnxV@„l@œƒ›ÅXyW_k@™wm™ŹĕmƒX™»‚ƒÛ™l°ƒôšÈ„»š—ô˜ô_WW@Uœal»šwU@@wšUVƒš@VƒXI@w‚Ģ͑ÞȻ›aU_@mUkly@¯óV»XmWUXUWmnm¥nUUaWLk»Æ²IÇa™wÅaÝ°¯nUa±a™ƒ™@¦õÆğ„@„™@Åb›xU܁nÇłlb¯¦„ôó»mƒ—@±ƒUk@Wwƒa¯xU„V°ƒxXbǎŁUV™™ƒK@¹ƒKUaȯ@ōݙXƒal™ƒlÛkalÇUǫÇńÇakbÝƆ¯nlš¯Ž@¼™VUx@x¯W¼™Æ¯šmĖ„Ĭ¯ČƒVk‚ķÅmxœ°ô²V¤‚bUnÞW°bĢw°V°„XxƒV°z@bÞ`@„‚¦„KĊŽ„I@xƒŽn„™ÈÈK‚„šV™„@VššXK˜xX„mXUx™a™b@‚kXllĊnVlUx™XkxlÆk„m@U„Vlš@ÈwôxV¦šbU`@zÆV@„²KllÞz@b"],"encodeOffsets":[[132672,46936]]}},{"type":"Feature","id":"2312","properties":{"name":"绥化市","cp":[126.7163,46.8018],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@ऊþÆÞ@bnJUb‚ĀnblŽĊš„„ÞlĸwǔÈŎKÈnôWǬê‚KV¥„ĸôUxš„@VšbU¼m`nnĊŽĊ„xlUšmkaVÿšLšwš@°»UmbKmݙUšwUmVknKUUl¯ƒKU™ƒUȃ‚™nK@ĠkX±lX„°„L@¯¥@wV_m›ĵ¯Ww™L¯ƒUkōƒÇVU™l›w—V󁱃¯aƒVka°wVk°mÞ¯Ŧřƙl™²™Ŏk™U@ƒmUkb¯ƒķŽ±„ó@kxȯó¯VUÒk„ÝŽ±LÛwÝ@ó»ÅUWw™mğw¯Ñ›@UkV±@k™a@¥ƒ¹Źÿ@aƒÅVƒwóVVUkU¯JÜóÈUl¯„yk£laUaVÑÇb@™ţ@kmómK™V¯IU¥ƒ@@ƒ™kV™Iƒ`@ô™¼„blU„lƒ™bÈb@xÇKkĢɳaÅɆō@ƒŽVƒK@z™@@¥ÆKnÜ@@aۏUw›wnU‚ķ@ƒ_ƒV°Ž@„klVššnULVVÞbVl@°™@nx™n°LŚÆlV„ȃmU²@VmĠLƒx„n¯xkWƒzšJ‚wnLmbXbW°šÆ‚™²™@™Žšx@JVx„L‚Ā²Æ°I¯º‚È@ÒnÈ"],"encodeOffsets":[[128352,48421]]}},{"type":"Feature","id":"2307","properties":{"name":"伊春市","cp":[129.1992,47.9608],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@ƒKƒ¯kWW²ğl@ŽmLšÇ„„VVš„Lk°VVmLUlVn™xšVnނLnaVŽ¯¼™@™x™KUĀlb™n„`n„Æxô@VbU¦ĸŰĸbôxÆ@„™V¥„»„IVl°LUŽll@²„mV„x@ššÞܚÞVnŽlXÅÒlbÈaVVUblb„J@I°lÞIn‚Æ„mxnbUbVLÅVm¤@œţVǤXÈÇĖ@šÈ¼˜aXVÜaXbWŽnzŎašř„KôbšUlw@¯naÆKnUU¯Üa@mkkVUĊm„™żÝ‚ǖŽ‚K„™°L²lÆI@ƒ¯¥ĉƛVaÞk@ÝVaĠlnUVwƒœómaƒ@™wĉ@™a™VƒxamX@aƒ@UaÅLƒaVWƒ_nWm£nWm_ÅV¯ƒm@m„󤁚ݦƒ¯ÅalmX£ƒ™VWUŚw™mÇ@@IV™„WUw@ašI@„k@wŎ»Wƒ„ƒ™ÅVaœK›Ika@¥lUkUlwÅwVyÈwWU@a¯U°m—Ç@UçƒaVa¯mV»ÅwÝUlƒUk™V@k„mUk‚X£šw°@@ǃaÝIƒƒam™Ûam„¯lğmmI@J™U™l±ÅōŽ—kWa¯VÝa@Þkbġ@ƒxÛnÇm@akkōVōl±škšÅšťŚÝ°¯nUl¯xlb„U°b²„ô‚˜Uœxšk‚VÈUŎ„Vl°„šKXxĶ°nœU`@x°¦@"],"encodeOffsets":[[131637,48556]]}},{"type":"Feature","id":"2308","properties":{"name":"佳木斯市","cp":[133.0005,47.5763],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@nš„b‚„ÞJ„b@ȯ@™xW¤Vlƒn@lšUVlk„ÞVÆxU¼°nUb„bVèÈ@˜ŽnIn‚@šĢmlUw°™żƒ‚VUn@lnL@VôbšwĊ‚lœ„JķĸĢl„wôwƨxVVUƒŦšxšLź™Èš°`nnĠwŎJސĶwôJ„@¤Xn܄ĸlšn°¼È°lŽ„„Uš‚b„xš@„l@ÞÞÈm°„lôwšL°¼ĸ‚°Þ²nĠ@ôwÞ`ŤI„V„ÒĠU„„@„VJĸbƄ²@°ŽĊKšœ„JĶaĢȰ@ô¥°nš¤‚bČUš@Vx„mUw@a݁ţƒÇ™ķƒ@ĕķīU¯²@ÆmVÑô¯X¥ċç@™ĉ»U¥ÝţKWVÅkUVÝŎUmǍÝx¯aķxÛUóL¯a±óōb¯™ƒÑŃVÿƒ_Åķ„a@UƒK@wm@Van@UmmLVa—@VImmXUWƒÝUřƒKUwÝUUƒkVƒk@l¯X›‚Å_ƒJ¯k™Jm„ÅLƒa@¥U@¯Vƒz¯@ƒ`@¼šmxƥšŏKÛk@±laÛ@@Xm@™ƒ@xƽ@WŎnšˣĕÅ@@aÅ@@nÝbǏ¯@ƒ_U›kUWƒkb™wÝU@ç„Wlw@anIƒ¯lyœX°m°VšašÛšm@„mVwÞK°ƒšXlaXmm_ƒ@UƒkwÝK@ƒVI™ƒXmV»ƒI@aƒ¯ğW™bġaU_¯JU¯ġŽƒ„ĉ„k„ō`±nÝÆk„™bóĊ¯Xƒ‚ĢX‚mVn²JV„lbUè„ČmK—wlóğx‚xV¦UaJ›šƒbƑÿÝL—l@bmbġx"],"encodeOffsets":[[132615,47740]]}},{"type":"Feature","id":"2303","properties":{"name":"鸡西市","cp":[132.7917,45.7361],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@‚LšKVVnkšbVšÈb‚²U°VnklVlaÈL@anU°ÜmXV`œnôLƒèšxlŽšLX„˜L²ašVVmÈX@ķ˜lnU„Èl`ȹš@ŤŽ°U@x„KnnV„mlnnUl‚lVnnaŎwlVÞ҄@n¦šLVŽ°lšwVk„Lšaގl„n҄š@xmLÞ¤Wnœ¼‚WÈLVVUxlÈô„„WVaU_VKšKXUÆbn™‚nôK„bÞw°bÆWXamVwœK˜™Uw¯WUk„UlJUwVUa™@@kmyzm›ĉw@kVwškƒW¯ÅKU_Vmƒƒ™xU@aW@@kK@w„a@Kƒ@@kVUƒaky°_Vm™kna¯K@™ƒL™wġk@@IÇóX™ƒwVakmV@mwXUWanƒlĉ@ǙUw™KƒƒóšܛNJۄm°@›w—Å@ƒ±b¯Wƒ¹„WVwŹĕ¯kVmōb¯w@aƒwmV™UUb™V™IkaVwķ™xk¼›b@VXXó`󗙘ƒ¼Çó™¯„kŽÜš„š¼WŽn„źĖnššxl@X`WzœÆ"],"encodeOffsets":[[133921,46716]]}},{"type":"Feature","id":"2305","properties":{"name":"双鸭山市","cp":[133.5938,46.7523],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@™UƒƒUwó™mÑÞÑUÝÝUkmmŃyV¯ī„¥ƒUÿĉ¯mÇkaWbÅX¯aÝxƒaóLmmšÅaWV™LULV`UbƒXóƒkÇVwUUÇKX›»XmÝ£nK@wƒ™mÑkƒÝ™bƒKUl™x¯kU™Km¥ƒ@ÝÑkUōxmbUmkVkmmnkUƒmmƒL@w¯Vţ™@Ǻk_ƒÇmV—k@ĸVx‚VÈ°lLkllšUbōwƒnVW¼nlUx¯XmWUnÝ@™xÝUó¼¯J@LVbkJWnkb™W¯„ÝLUxƒn@‚™n™Ü™b¯U¯n›Wkz„°mJ@bkxƒX@èÞVšxlaX„lVVœ„`°@ȐÞa@mÆ@@bÆ@ˤĖm™Xōƾ@@wš„n@@WÜ@kb@²ÜlŐLƦ™nw™@»„_°@„y°UV@@¦„bÆKnƒšI°l„IÆ`œ°W@k„llUV„ÞVVx„LƚÞVX„WVnnUJ˜@UbnKVnm@Ubn@@x„L@VƒbÆĸ„`UĀƄ„Ò°šŎa²ô°bôKÜVĸw°bÞwȎVnÞōVUÆlXU"],"encodeOffsets":[[137577,48578]]}},{"type":"Feature","id":"2306","properties":{"name":"大庆市","cp":[124.7717,46.4282],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@mÇ@сǰ¹¯J±ÅÿƒKUw‚I@™wšš@š±Å‚™X¯WanamKx™I„ylX°wƒm„wğKUn±@nVDŽUƒÅkƙ¯Kšmmwš@@¯UkÝaUUVK™mU™lk@ƒ¯„U„`ĸ@V‚mœxVxܐ@bÛ@m‚ÅL@¦š@@y„L‚U„Ŏ@ÆɅɴblġÈL@wÇaša„ƒkkVƒaš»@ó¯_ÝJ™wÇaÅXny›U¯¥Å„@w™bÝa™Lmm@@ƒVUŽlbğVmš™¯Xƒm_ƒ`¯_Ux™m™L™a¯b@mƒaó¦Çk™¤V„@bóJknVx™VXx±aƒLUbVxkLVlLWlƒ@nX@VÅbWlÈnƒx„bWšÅbmŽ@xœbml°b™„XbW„XVmnn`ƒLmšnbmb@šk@mwU@@š¯Jlbk°lbkšmLXxmbVbkllšÅނxX„xVWVVa²VܲnxƒVVnÅlVlƒL„¼šb@xV@XŽVbšIÆ°„¦„lźb„Ĭ°¼Ulšb@kĢ@lw„@ƒÜlnȂƄóȘI„ĉ"],"encodeOffsets":[[128352,48421]]}},{"type":"Feature","id":"2304","properties":{"name":"鹤岗市","cp":[130.4407,47.7081],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@Þ¥‚™ô£nƒn@°„ÆUn`mXn¤mX„`UX„bÆKVb„@@bnW‚b„wšUšbĊ@šx„@nbšWVmƒ_mm@ó»Um„ŘWXkĠ»²¯‚¯nķšwŎ@ĊšŎK°bĸUnјKȦĠÈbÆknJššÆUĢV°IšŽšVƾƒwaV™ƒƒkÇ¯¯»™mķkۃWm@£ƒóIĵxݏōIğxmm¯_ǙŹš™K™wťŽ„UVUŽƧwóxƒxġkĸķƒIk›ĉ™xóa@UmK@kVmUŻ„¯šVxkŽġn™‚@mmJ¯n°V@bXVÇxUzÆxkxlVkV@¦lbœJ›LUbšÆƒ„X„ō¼@xƒl@™J@bVxƒXUš@JÈ@šn™xVÆUXš‚„W¤knÆb„°"],"encodeOffsets":[[132998,49478]]}},{"type":"Feature","id":"2309","properties":{"name":"七台河市","cp":[131.2756,45.9558],"childNum":2},"geometry":{"type":"Polygon","coordinates":["@@²mŎ_lƒĊƒ„ƒĢV°°IV`ĢbšaĠX„°@b„JU¼Wnš„UJ@„ÞLlxV„„@n`lIUa@K°Iô»ÞVšwÞ@VmnX°WVwmkX»‚U„mŎxVak™lkkKǯUUwÇWUn™U±b—KWƒ™Kk™w„çóK›mU_nW¯ÛmV@bÇKkbkUml¯U±VÇaU™™amlUU™LK›„k@ƒU@mwÛLƒŽƒwkLóÆm_™±™nkŽ¯@@n±KnŚlbkVV‚mz—lWXº@Ķ°"],"encodeOffsets":[[133369,47228]]}}],"UTF8Encoding":true}; +define('echarts/util/mapData/geoJson/hei_long_jiang_geo',[],function() { + return {"type":"FeatureCollection","features":[{"type":"Feature","id":"2311","properties":{"name":"黑河市","cp":[127.1448,49.2957],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@VÈÞ@Žkx˜nXŽ°VÈa°V@kôw„b‚š„JVškXlVUx„„@ŽlL@xkVV°ƒ„VbxlVUnVxk@ƒ„ƒKkŽVb„Il„@°kVl„@„™lÆnkll@@V„VXƒŽš@V„²bUlƒVlV„U„VÇn@nkJšŽlkVbœ@›x²V@n°VUnlKU„n`@n°bWLnVUblVUVVbknV`°kkŽl@@V°@nz„J@XšxlWXb°n@bƒĠlbXb™bVbƒJ@Všb„a@„„@lbUbšVmnœ@lšVmnIW‚œ@WbÞ@„n@x°@š„ĢaƐéϚnœ„‚lČ¯ĠŻÈwm@ôçU™mm£Xy°UV™›@wÈ£Ǫ¯kõÝçUњ™Uķ‚ƒĢkVфÆšÞU°nŎ¥ČUĊx°m°¦żVƐœx°ƒÇ£@y„UônރÆ@Èĉ°Kô¦šW„kWU—bÇ»@™ÈĕWÇÈ£ŤU@›n£ÆUUKVamanwŃmÝJ¯k@JƒIkaVaUUÇbkaÆÑkWmÝUۙ™Ý@™ƒwnU±ƒ@kkV¯KUkƒJƒ¼U¦ƒšÅ@ówķaķůV¥Uaó@Åwmƒƒ_kVƒwĉ‚ĉmmn_V»™a@U™ƒVwķóƒ‚U¦LǫéóXÇmōLǓÇķxÝkƒƒĉ™kmakbUĶ°@W¼„@bƒšÈÆ@Ė™L„l@„°J¯„mkl¯L݃±L—amJ@¼ƒ„™VƧUó„™UX˜ċb¯ńVbkÆÝI@llx„k°V²šV@Uxގ˜L@b„@b™`ƒšÇzkókݤ@ğ¯Wƒ™LĉǙLmmnċVkbUaƒL@Ž¯„‚bU°ğL݂Ý@"],"encodeOffsets":[[127744,50102]]}},{"type":"Feature","id":"2327","properties":{"name":"大兴安岭地区","cp":[124.1016,52.2345],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@k›ƒϙmƏêġb™ƒ¯@@wƒmÝ@XV@IlŽl@bUxl¯VlV™bV@ULVlUV™_kx™VVV™ÈÝJ@„¯šU„™lm¯x@xóÒĉ¼m„¯Wƒxţ@Uz¯ƒWwnUwťƒ@knƒWƒ£óVƒUUwğyó¦WI—Vmm™I@±kwÇ@@bƒ@ĉ¼ó@¯wó@¯aó¼›KՃaUwmWUwÅI@aƒKó@Ua™LƒaƒVÅwō¼UUÝl±I—¤VxÇx@zkJmnn‚mbnz™xlŽƒl¯ČkJl™°@„kb„Žmx@x™@kêmVnŽWxôXšxU°„bWLóJnÇWĵ„V¦™ŽƒUUb™b™ÆġK™šk¯™VU±aXmċÑUwĉKġ„k„™ŽVxk„ÇKkbƒIƒ‚ÛXWl¯bƒŽ™X¯K™bĊš„„ÞVƚnŽĸ²lxUŽ°n°òÈb‚¦—xVbƒŽƒ@¯„Vx@¯VķÞČlĊ°KĸŽȘI°¤ČIôŽò»ƨnȰKǬ¦ôWŎÈƨwlƒnKVXmbX`lbšwkVW‚XXŽ„L°a„ƾaĊ£nƒ°@°¥ŎzÞ¥‚»œalwôkƒJ„a@ĶK„£„bU°ĊxźVÈUĠ¥ƨ™VI@XU°x°Ln¥šw°UmwXm݁V¥ĢŽ°@nU@mÆ£š¯lKœšÜw@aÅU‚¥UaÝIkmV²‚nn@Ķ»@Uk¥VKÞ@ÞÛ@ƒkVmĢa@_ƒJómƒǖ¯Æw—óÇa@alƒUwšwĢřšk@wÆWXUWXƒWa™m@_ƒ»ÇéXaĸwVa@ÝKkUWkX‚kšKXxƒn@lĊV@¯m¯nřÆwš¥"],"encodeOffsets":[[130084,52206]]}},{"type":"Feature","id":"2301","properties":{"name":"哈尔滨市","cp":[127.9688,45.368],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@°`„_šJlUšŽ@„„@V¦°JUšŽnLôlnŤ@@šÈaUÒVbkbl¤ƒzk°ÇVÛô°IlVUVôU„xÆU„Ž@bźĀ„º@¦šb@l²‚UVlœ@°ÒĠxšnXxÆVô¼Þ@Üx²KލlƒVÑ°UȰôlwô@²ƒĸ°„lanV@„šVŎUll@bÈnÜm„wĢ@la@ÝÞb°UXb˜lŎ²ÆškšV‚I@ŽnJnĠŽ°knƒÜbĢwna@a˜kÞKƒĀ„a‚™œ‚‚IVbU¥wĠwkô˜xnLƒċVçkaUƒ±IUmnġW„°WôĉšalƒÞÅĵ¯@W¹XÝaƒb¯a±X¯ºLƒaVƒmkLóƒƒbkaƒVUKVkkKV_@aÝykk±L@ƒÅU@yV_™aU¥ówÇx™@UkVƒn@lƒkÅlwšWVwUkĉmkklW@šašbVwnWWƒ—wWL™™@Ušƒ™UƒÇLšÇmƒ„@wƒJĉƒL¥@ƒÝ_@a¯y„UWw¯ƒ¯Uġx¯aÝXVmaU£ó±›¯nwƒa¯óÅVƒXman™„Uƒ›lUXkWa@mkI„›ğaƒm™IklÇU™„kĊƒƒzkKƒš„lU„ōĬlš™„@ŽnX°@llUxŹ²mKĉVWwk@UbUK@bmVmI—ƒVmwaWxXlWȁšmºšÞÆbUxV@ĵńWÆĉLkWUbƒaWzkbĉ`U„±LklōwUVÝ£™UW`Uwk@mk¯VkaõVX@WbL™K@XƧºWzxƒK@lmX@bkVVÆk¼Vbk@Vn"],"encodeOffsets":[[128712,46604]]}},{"type":"Feature","id":"2302","properties":{"name":"齐齐哈尔市","cp":[124.541,47.5818],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@Þ@ށĠKV¯a°ƒ@„KVblaČU‚mnnšKĊȚKX„°ŽĠ@Þ£ôllÈy„™š_@a‚ƒ@a—KݍVwU@±™¯Uƒlkw@kÞJlÅUa°ŃČaW—šVôƒƨVšU„ƒ@»nI˜b²Kބ°Klkn°ƒ¯I@ƒƒkšK@ĕÇń™@aƒX»¯@VĵlaÿVamI@aÅÝउýƒĊȗJƒôȁÅkmƑۃ@kxġ@@l™aVk¯»ƒīŹaƒkƒ¥Å¯™JUaWU@@w™aƒ»„KUkÆkUm„UmwÛ±±UUbUŽUXƒwWwÆÝk™lkUanaWwnKl™kal¯ka™ƽa›kÅx™a¯@™amb¯V™lÇwÛĀ™V@x™šmêVƜVV‚aôV„wÈx@šˌx„¦VÞ¯VšlmX@‚ƒL@¯Ua¯LmV@„„°X„ċK™V™ƒ@UƒÈ@‚¥@w—ƒġIU™km¥Źwƒ¦¯lmn@°kxVV@¦óam„n¦l@nx™lĉVóšmx™n™ÒĉĀĊ¼„þ„šǔêÞ°ˌĠÞÒ°ĀɲĀƨźˤȤƨĊ°w@£nymwnkUUV¥ôÑVmkÆmUUVa™mVIkmô„lxkXÞþƒbl„ƒl@kV„ƆƒV„xV@š¼VÒ@šŽUŽšnnނJ"],"encodeOffsets":[[127744,50102]]}},{"type":"Feature","id":"2310","properties":{"name":"牡丹江市","cp":[129.7815,44.7089],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@U`lLUlVL„Ulb„aô„lKnŽU„„b‚K°¹²W°b„aÞb˜knyUlUkamř²L@m°@lšmš²n`ôÅlK„x„ÜKnxV@„l@œƒ›ÅXyW_k@™wm™ŹĕmƒX™»‚ƒÛ™l°ƒôšÈ„»š—ô˜ô_WW@Uœal»šwU@@wšUVƒš@VƒXI@w‚Ģ͑ÞȻ›aU_@mUkly@¯óV»XmWUXUWmnm¥nUUaWLk»Æ²IÇa™wÅaÝ°¯nUa±a™ƒ™@¦õÆğ„@„™@Åb›xU܁nÇłlb¯¦„ôó»mƒ—@±ƒUk@Wwƒa¯xU„V°ƒxXbǎŁUV™™ƒK@¹ƒKUaȯ@ōݙXƒal™ƒlÛkalÇUǫÇńÇakbÝƆ¯nlš¯Ž@¼™VUx@x¯W¼™Æ¯šmĖ„Ĭ¯ČƒVk‚ķÅmxœ°ô²V¤‚bUnÞW°bĢw°V°„XxƒV°z@bÞ`@„‚¦„KĊŽ„I@xƒŽn„™ÈÈK‚„šV™„@VššXK˜xX„mXUx™a™b@‚kXllĊnVlUx™XkxlÆk„m@U„Vlš@ÈwôxV¦šbU`@zÆV@„²KllÞz@b"],"encodeOffsets":[[132672,46936]]}},{"type":"Feature","id":"2312","properties":{"name":"绥化市","cp":[126.7163,46.8018],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@ऊþÆÞ@bnJUb‚ĀnblŽĊš„„ÞlĸwǔÈŎKÈnôWǬê‚KV¥„ĸôUxš„@VšbU¼m`nnĊŽĊ„xlUšmkaVÿšLšwš@°»UmbKmݙUšwUmVknKUUl¯ƒKU™ƒUȃ‚™nK@ĠkX±lX„°„L@¯¥@wV_m›ĵ¯Ww™L¯ƒUkōƒÇVU™l›w—V󁱃¯aƒVka°wVk°mÞ¯Ŧřƙl™²™Ŏk™U@ƒmUkb¯ƒķŽ±„ó@kxȯó¯VUÒk„ÝŽ±LÛwÝ@ó»ÅUWw™mğw¯Ñ›@UkV±@k™a@¥ƒ¹Źÿ@aƒÅVƒwóVVUkU¯JÜóÈUl¯„yk£laUaVÑÇb@™ţ@kmómK™V¯IU¥ƒ@@ƒ™kV™Iƒ`@ô™¼„blU„lƒ™bÈb@xÇKkĢɳaÅɆō@ƒŽVƒK@z™@@¥ÆKnÜ@@aۏUw›wnU‚ķ@ƒ_ƒV°Ž@„klVššnULVVÞbVl@°™@nx™n°LŚÆlV„ȃmU²@VmĠLƒx„n¯xkWƒzšJ‚wnLmbXbW°šÆ‚™²™@™Žšx@JVx„L‚Ā²Æ°I¯º‚È@ÒnÈ"],"encodeOffsets":[[128352,48421]]}},{"type":"Feature","id":"2307","properties":{"name":"伊春市","cp":[129.1992,47.9608],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@ƒKƒ¯kWW²ğl@ŽmLšÇ„„VVš„Lk°VVmLUlVn™xšVnނLnaVŽ¯¼™@™x™KUĀlb™n„`n„Æxô@VbU¦ĸŰĸbôxÆ@„™V¥„»„IVl°LUŽll@²„mV„x@ššÞܚÞVnŽlXÅÒlbÈaVVUblb„J@I°lÞIn‚Æ„mxnbUbVLÅVm¤@œţVǤXÈÇĖ@šÈ¼˜aXVÜaXbWŽnzŎašř„KôbšUlw@¯naÆKnUU¯Üa@mkkVUĊm„™żÝ‚ǖŽ‚K„™°L²lÆI@ƒ¯¥ĉƛVaÞk@ÝVaĠlnUVwƒœómaƒ@™wĉ@™a™VƒxamX@aƒ@UaÅLƒaVWƒ_nWm£nWm_ÅV¯ƒm@m„󤁚ݦƒ¯ÅalmX£ƒ™VWUŚw™mÇ@@IV™„WUw@ašI@„k@wŎ»Wƒ„ƒ™ÅVaœK›Ika@¥lUkUlwÅwVyÈwWU@a¯U°m—Ç@UçƒaVa¯mV»ÅwÝUlƒUk™V@k„mUk‚X£šw°@@ǃaÝIƒƒam™Ûam„¯lğmmI@J™U™l±ÅōŽ—kWa¯VÝa@Þkbġ@ƒxÛnÇm@akkōVōl±škšÅšťŚÝ°¯nUl¯xlb„U°b²„ô‚˜Uœxšk‚VÈUŎ„Vl°„šKXxĶ°nœU`@x°¦@"],"encodeOffsets":[[131637,48556]]}},{"type":"Feature","id":"2308","properties":{"name":"佳木斯市","cp":[133.0005,47.5763],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@nš„b‚„ÞJ„b@ȯ@™xW¤Vlƒn@lšUVlk„ÞVÆxU¼°nUb„bVèÈ@˜ŽnIn‚@šĢmlUw°™żƒ‚VUn@lnL@VôbšwĊ‚lœ„JķĸĢl„wôwƨxVVUƒŦšxšLź™Èš°`nnĠwŎJސĶwôJ„@¤Xn܄ĸlšn°¼È°lŽ„„Uš‚b„xš@„l@ÞÞÈm°„lôwšL°¼ĸ‚°Þ²nĠ@ôwÞ`ŤI„V„ÒĠU„„@„VJĸbƄ²@°ŽĊKšœ„JĶaĢȰ@ô¥°nš¤‚bČUš@Vx„mUw@a݁ţƒÇ™ķƒ@ĕķīU¯²@ÆmVÑô¯X¥ċç@™ĉ»U¥ÝţKWVÅkUVÝŎUmǍÝx¯aķxÛUóL¯a±óōb¯™ƒÑŃVÿƒ_Åķ„a@UƒK@wm@Van@UmmLVa—@VImmXUWƒÝUřƒKUwÝUUƒkVƒk@l¯X›‚Å_ƒJ¯k™Jm„ÅLƒa@¥U@¯Vƒz¯@ƒ`@¼šmxƥšŏKÛk@±laÛ@@Xm@™ƒ@xƽ@WŎnšˣĕÅ@@aÅ@@nÝbǏ¯@ƒ_U›kUWƒkb™wÝU@ç„Wlw@anIƒ¯lyœX°m°VšašÛšm@„mVwÞK°ƒšXlaXmm_ƒ@UƒkwÝK@ƒVI™ƒXmV»ƒI@aƒ¯ğW™bġaU_¯JU¯ġŽƒ„ĉ„k„ō`±nÝÆk„™bóĊ¯Xƒ‚ĢX‚mVn²JV„lbUè„ČmK—wlóğx‚xV¦UaJ›šƒbƑÿÝL—l@bmbġx"],"encodeOffsets":[[132615,47740]]}},{"type":"Feature","id":"2303","properties":{"name":"鸡西市","cp":[132.7917,45.7361],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@‚LšKVVnkšbVšÈb‚²U°VnklVlaÈL@anU°ÜmXV`œnôLƒèšxlŽšLX„˜L²ašVVmÈX@ķ˜lnU„Èl`ȹš@ŤŽ°U@x„KnnV„mlnnUl‚lVnnaŎwlVÞ҄@n¦šLVŽ°lšwVk„Lšaގl„n҄š@xmLÞ¤Wnœ¼‚WÈLVVUxlÈô„„WVaU_VKšKXUÆbn™‚nôK„bÞw°bÆWXamVwœK˜™Uw¯WUk„UlJUwVUa™@@kmyzm›ĉw@kVwškƒW¯ÅKU_Vmƒƒ™xU@aW@@kK@w„a@Kƒ@@kVUƒaky°_Vm™kna¯K@™ƒL™wġk@@IÇóX™ƒwVakmV@mwXUWanƒlĉ@ǙUw™KƒƒóšܛNJۄm°@›w—Å@ƒ±b¯Wƒ¹„WVwŹĕ¯kVmōb¯w@aƒwmV™UUb™V™IkaVwķ™xk¼›b@VXXó`󗙘ƒ¼Çó™¯„kŽÜš„š¼WŽn„źĖnššxl@X`WzœÆ"],"encodeOffsets":[[133921,46716]]}},{"type":"Feature","id":"2305","properties":{"name":"双鸭山市","cp":[133.5938,46.7523],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@™UƒƒUwó™mÑÞÑUÝÝUkmmŃyV¯ī„¥ƒUÿĉ¯mÇkaWbÅX¯aÝxƒaóLmmšÅaWV™LULV`UbƒXóƒkÇVwUUÇKX›»XmÝ£nK@wƒ™mÑkƒÝ™bƒKUl™x¯kU™Km¥ƒ@ÝÑkUōxmbUmkVkmmnkUƒmmƒL@w¯Vţ™@Ǻk_ƒÇmV—k@ĸVx‚VÈ°lLkllšUbōwƒnVW¼nlUx¯XmWUnÝ@™xÝUó¼¯J@LVbkJWnkb™W¯„ÝLUxƒn@‚™n™Ü™b¯U¯n›Wkz„°mJ@bkxƒX@èÞVšxlaX„lVVœ„`°@ȐÞa@mÆ@@bÆ@ˤĖm™Xōƾ@@wš„n@@WÜ@kb@²ÜlŐLƦ™nw™@»„_°@„y°UV@@¦„bÆKnƒšI°l„IÆ`œ°W@k„llUV„ÞVVx„LƚÞVX„WVnnUJ˜@UbnKVnm@Ubn@@x„L@VƒbÆĸ„`UĀƄ„Ò°šŎa²ô°bôKÜVĸw°bÞwȎVnÞōVUÆlXU"],"encodeOffsets":[[137577,48578]]}},{"type":"Feature","id":"2306","properties":{"name":"大庆市","cp":[124.7717,46.4282],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@mÇ@сǰ¹¯J±ÅÿƒKUw‚I@™wšš@š±Å‚™X¯WanamKx™I„ylX°wƒm„wğKUn±@nVDŽUƒÅkƙ¯Kšmmwš@@¯UkÝaUUVK™mU™lk@ƒ¯„U„`ĸ@V‚mœxVxܐ@bÛ@m‚ÅL@¦š@@y„L‚U„Ŏ@ÆɅɴblġÈL@wÇaša„ƒkkVƒaš»@ó¯_ÝJ™wÇaÅXny›U¯¥Å„@w™bÝa™Lmm@@ƒVUŽlbğVmš™¯Xƒm_ƒ`¯_Ux™m™L™a¯b@mƒaó¦Çk™¤V„@bóJknVx™VXx±aƒLUbVxkLVlLWlƒ@nX@VÅbWlÈnƒx„bWšÅbmŽ@xœbml°b™„XbW„XVmnn`ƒLmšnbmb@šk@mwU@@š¯Jlbk°lbkšmLXxmbVbkllšÅނxX„xVWVVa²VܲnxƒVVnÅlVlƒL„¼šb@xV@XŽVbšIÆ°„¦„lźb„Ĭ°¼Ulšb@kĢ@lw„@ƒÜlnȂƄóȘI„ĉ"],"encodeOffsets":[[128352,48421]]}},{"type":"Feature","id":"2304","properties":{"name":"鹤岗市","cp":[130.4407,47.7081],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@Þ¥‚™ô£nƒn@°„ÆUn`mXn¤mX„`UX„bÆKVb„@@bnW‚b„wšUšbĊ@šx„@nbšWVmƒ_mm@ó»Um„ŘWXkĠ»²¯‚¯nķšwŎ@ĊšŎK°bĸUnјKȦĠÈbÆknJššÆUĢV°IšŽšVƾƒwaV™ƒƒkÇ¯¯»™mķkۃWm@£ƒóIĵxݏōIğxmm¯_ǙŹš™K™wťŽ„UVUŽƧwóxƒxġkĸķƒIk›ĉ™xóa@UmK@kVmUŻ„¯šVxkŽġn™‚@mmJ¯n°V@bXVÇxUzÆxkxlVkV@¦lbœJ›LUbšÆƒ„X„ō¼@xƒl@™J@bVxƒXUš@JÈ@šn™xVÆUXš‚„W¤knÆb„°"],"encodeOffsets":[[132998,49478]]}},{"type":"Feature","id":"2309","properties":{"name":"七台河市","cp":[131.2756,45.9558],"childNum":2},"geometry":{"type":"Polygon","coordinates":["@@²mŎ_lƒĊƒ„ƒĢV°°IV`ĢbšaĠX„°@b„JU¼Wnš„UJ@„ÞLlxV„„@n`lIUa@K°Iô»ÞVšwÞ@VmnX°WVwmkX»‚U„mŎxVak™lkkKǯUUwÇWUn™U±b—KWƒ™Kk™w„çóK›mU_nW¯ÛmV@bÇKkbkUml¯U±VÇaU™™amlUU™LK›„k@ƒU@mwÛLƒŽƒwkLóÆm_™±™nkŽ¯@@n±KnŚlbkVV‚mz—lWXº@Ķ°"],"encodeOffsets":[[133369,47228]]}}],"UTF8Encoding":true}; }); -define('echarts/util/mapData/geoJson/he_bei_geo',[],function() { - return {"type":"FeatureCollection","features":[{"type":"Feature","id":"1308","properties":{"name":"承德市","cp":[117.5757,41.4075],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@lLnlmxn„„IVVlUnb@VVxXJWL@LގVnnV„J˜_@wkmšK„b‚x„wXk˜WXXšKlb²K@nVVVb„L@WlU²„lKVnUJVz@VVb@lżmVUVnbôaVX@°Ub@lWbXš@b@bVb°x„@VxÈLVlšaÆ@Þb²k°@lVUŽ@Xn@VW‚LXb@¤VXšKVVVLnm°_ƨ¤@aUIVa„alkX›°k„™V@„alwUVy„U@k󙰃na°UVUUmUÆw@mkLVUƒWVI„WšLnn@xlVnK„myU@ƒU°UXaV@U¥ƒU@Uƙ@aVUkWU¯ƒaU@WLUV@bkbmKULmKkUVUkmVIUwlWV²™Uml°U@W„LUwVm@UUK@_ƒKUUÜaXw@ƒVKUU@mVIUUlmnIVVVbÈVlKnbVKš@nI˜@nVnwVLVK„K„„˜Vnb@aUIVW@In™°@lVnIš@lWĢ@°UVL@b„@VyUUƒa@w@WUnU@Wǯ™K@UkkJWaÛbmk@mVaÞU@amkWƒ@mXUKkÿƒ£@a„kl@Um°UXwla„al@nmlXnW°znW@aƒwV™@ƒakbĉ¥VmU@ƒIƒVƒUƒJkUmWU™KbmkUaƒKkUVU@KV@@klw—™WaU@kmƒXVènbmlUUƒKƒX¯JkbƒI@JmIUWU@ƒLml@XkJ@U™kƒK@aVKwWa—IWwƒmUƒ@mU@J@UaċU™aUUƒVkI±ƒk@UUƒ@UbVVm@UVKƒLƒlkIWaULUWƒXUJU„ƒ@WbUb@lkXUxm@@JVn@J@b„nƒb@Vkx@bšLU‚Æn„JšaVXnKVVmzX‚°V@_lJXxWXƒK¯bÅamUƒ@lUI›bñJ@LÇKkIÇ`kxWL@„ƒ@@bUVUb¯xWKk„Å„VlULW@ƒŽn¦Ul@I™lmUUUVm@kWƒnkKma¯XUKWmnwVwÝL„mŽ™VUbUVWb@Lnxm„xVŽmbXx›¦@„nb@`™„ƒVƒ@kbƒLU„mVUlkbVXkºmnm@@xk¦šbĢÜlš"],"encodeOffsets":[[118868,42784]]}},{"type":"Feature","id":"1307","properties":{"name":"张家口市","cp":[115.1477,40.8527],"childNum":15},"geometry":{"type":"Polygon","coordinates":["@@k™ġۙal¥@wn@nml¹UWlaVknUVƒ„Kla„@„Ušƒ@_ma@ƒœ¥WwnaU‚wnƒmw@KXaVUVašUnmWUk°™lƒnUVUXWVw™IWVóKUI@WXƒxUU@mma@kUKWLkw@yk@ƒaVkUUċaUU@Wk@Unm@UVmLm±IUƒkJ™kWƒ@a„I@m@U„ƒVƒ„Ula„@VXVƒXmVwnkWKƒKU_k@m¥ƒmX_™JmnU@km@U@KmU™VƒU@U™@Umk@@LƒmW@Û£Wƒka@wk™@aƒI@mmk@mUa@UmUƒIƒwW@aWUƒbU@kbÇ@kwƒ@makVUk™U@aƒm@aU@mxkUƒbƒKUXUƒ±KXVWLUK@wkU@V™@WXUa@WbUxƒJIƒŽ@¦VèVVX@±ê¯KUIƒ`¯UULVx@Vƒ@UKƒIƒVkLmVkKmš@nUJÝbkIUJVXšVVxVbU„VJ„Un™°bV„mlU°„XnK@Ul@lVÈVUXšx@W„@VXšV‚KÞb„n@VnbV„m`ƒUx™kW@UVkL™Km¼@lUnUJVnV„XV@Vm@@LV„klƒIkl@VƒWlŽULWKUL@mJ„@blbUVUlmzUJUxm@UUbċÜk@Ub@VšLVV„¦ôbVŽmšUKUkU@m„„@VlVn¼WbUJ¯@@„°šnIllÈl˜@nXšWlLœk‚J@bkxlxkxlXUlklJƒšXL@bW„n`@nƎXxlL@xl@Xb‚LœKlVlIXblVUbUJW@lX@VL@VVŽšXšJšw„n@WnL°K„bVbl@VI@K„@U@nmVmV@XUWI@aXm@™VUUkWmn@lmUUk@mUmK@UnwVĉ@ƒƒmU_V@XJôVVUšLVUn@šllUnJl_n@šml@XŽlLlw²LVJUL@VmbVblVXmVnlš@Ť¦„nn@܎@bšl„@@XV`„Unb@VlLVb²J‚Xn¥ÆÑ@¥Þ@"],"encodeOffsets":[[118868,42784]]}},{"type":"Feature","id":"1306","properties":{"name":"保定市","cp":[115.0488,39.0948],"childNum":23},"geometry":{"type":"Polygon","coordinates":["@@VbXWš@@UlV@xVLXKWU²LV„VW„L„alVnwV@@b„n@bšVVllUnb„@lxÈ@laV@„aXV@b‚X„x„J‚nV@VVb@nnl@n„J@blšl@„ašƒU_VWUwVUškUm™Ukb±mVwœU@VIUW@UWk„@VU@ynL„m@IV@‚bnK„LVaVmnIlaXwV@@WVL°@@xnX„@V`V@VbUVVLVKnwnL@ll@@_V@VVnaÆ@œKVXÆ@nƒ@wƒKmU—™Wm@km@kÜKXU@ÑW±nIUwVƒ„Kla@I°wU±kškmm¯mƒ_ƒJnƒaƒwW@IVaUama@wƒUƒmU@mVw@aXk@mWa@£km@aƒ_kVmUnWW@¯bƒkUmk@ƒVÇm@@kUU™KUU™@UVUamVUaWIkb@xU@@amUkKƒVkam@@kVUkUWmKmUkLUb@xmJƒ™U@UImVÛVmnUwƒJƒU@VƒX@UWm@Ub°¦UšmxklmX@`ULU@@UW@@xkn¯@makV™UmxUb™°ƒlUšƒbUbƒnUJƒUUVƒa™LkbUU›JUU@mUUUƒJkaƒ@™xUIWJƒUnƒJ@V™zƒ@kb@`@bln@l™bƒŽ@X@š@š„@Xl‚bnbVb„@„„VJlInlšbVw@U„K„l@lbnan@Vb‚JôLn‚UzlV@lÈLVbVK@LVx—VWXX`WxXz‚bV`UXV¤nx@„bVlVnVlUL"],"encodeOffsets":[[117304,40512]]}},{"type":"Feature","id":"1302","properties":{"name":"唐山市","cp":[118.4766,39.6826],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@„@VVl@²„lJ„UVVšbČVVb‚@@InV„@‚V„nXx˜JXb‚xUL@b„Lšl@VlI@Wnk„KV@VXnJ@I„Jla°I„W„LVVnkmaUç„WVkôaܯ„@nV°wnJlaV@VUnUUaW¯wXWWwna@£UaWKU¯ƒ¯@aVUkKUamUUƒn»‚an™„IVwUWlkš@„LlWVakU@K„_lƒšbÞU°@šy°n„@„KÈkWW™ţ¥ĉōƒkġWUw¯£¯ƒÇwţwƒ@kK@kƒ¥ÝwÅbǤېťV™lW°@ĸ™x@VVVULVLkl@V@Xƒ`Ub@Xm@UWbƒk@ÆVbnLWV@lnXUbl‚@X¯lmU™VkKWLkK@_UK@U@UmmUxmVXLWVULkU@`W@ULUK@XlJXzV@@xml@VU@UX@Kk@WbUK@Xn`ƒXmJnšmškxUVbUVlVVxUbV@nKlL„kVKÞbVKXI°KVšmVUIUKULVxVJVLkV@Vƒ@UbU@WUU@UbUK@b@nƒV@VkLmb@b"],"encodeOffsets":[[120398,41159]]}},{"type":"Feature","id":"1309","properties":{"name":"沧州市","cp":[116.8286,38.2104],"childNum":15},"geometry":{"type":"Polygon","coordinates":["@@@ln@UȄŽl@Vn„l°aX@mXnVlU„`@bln@¤Xb@nWl@bUx@nnV‚„„V@xnbVbUb@J‚X„x„b‚mXa@k„UVwlW„k„KôVm@w™kkK@kl»Èƒm™VKXkla°@XVV@VI@ml@@Vn@VX@V@J„@VxUzVVšš²blVk¦@šĠ@@»š@VK@VÈLlK@XnJ@alIUl„a„VVbš@„n@a„U@WUIV@mUn@mKXml@lL@LnWšb@XV@@a„VVb„V„@VV„IVWÈb˜IÈ»ƒǟlWšaVUÅUƒƒ™Um@kVU™WVkaUwmaóUƒJUU¯ÑU¥mk™¯UaƒKÅnÇyóXmWÛX¯aċbÛa›J—W™ÝU¯»ƒaóóUm@IƒšVVl@bƒLUJWLX@@xšXUxl¤V@V„nVUV„XVbVš@Ž„@@VVn„°VŽ@ţU¯VƒUmƒUWV@mUXƒaƒbUKUwUaÇKn„ƒVk¦Wb@VnLmV@bkV@n„xW`Å_UVƒV@bƒUklVX@VmlUƒx@VVL@x—VWVL@VW@UUm@"],"encodeOffsets":[[118485,39280]]}},{"type":"Feature","id":"1301","properties":{"name":"石家庄市","cp":[114.4995,38.1006],"childNum":19},"geometry":{"type":"Polygon","coordinates":["@@la„@šy@U„I‚m„VXIVJšw„@lb„IVVnV‚@VVœIVVlašK„bVU„VVI„mVa„aV™„kš¯VanwšVlUnb°@lm@wX@@VV@VK@_nWlknwV™¯¥Van@VX‚@„W@U„V„IVxnmÜUnUVJV@„šnI@wValKnV@k‚mU£na@mVk°K„LVa@UU@UƒmknWWkXU@aWW@@km@UaU@@klK@UkaWaUnamm@U„a¯wWU@UkƒL@ŽUn@x™V™lUXVJUb™LmU@aUWUkmKkLUUm@mW—XƒaƒmmkkWUm@@U¯JUUm™kU¯@mKĉxÝwÝ¥LƒUóŽmwkUUUWVkKm™kKmLX„lxVLVxXJ@nVJnz@VWL@`nX@šƒxƒ@kVUUmJmIXx„JV„ƒnUVƒ@UVV„@LUšƒ`UXVVƒ„ƒlXL@l@b@VmX@b™xn°™UƒbkKWLXlW@@bƒK„mKULmakLUlmb@šXb@xmXU`V„b@`lLx@nWVXL@‚°WlXnlb„KVK„XVb@˜X@l_lJ@V@XnŽ„I"],"encodeOffsets":[[116562,39691]]}},{"type":"Feature","id":"1305","properties":{"name":"邢台市","cp":[114.8071,37.2821],"childNum":18},"geometry":{"type":"Polygon","coordinates":["@@nKlLnšlLXUVVlVnxô„V‚KÞ¦ÞxĊwnL°@lVnšVV°I@Vn@V‚lXnl„n„b˜WnXn@VVlKnLVlVX@bnVšKVaUIVWškšU@wVm@¯@U¥VmU_°lšK„k‚w@LX‚Va„U@wšUƒUUKlUóW@UVUœUlƒ°K„wlKU_na„KVnlKkkšWWa@IœJVa@IlJnU@„KVUUmVlaXUl@lm@kXWÝÑnkƒ™±™k@wğ›@@U@mKĉLmVJ@zmlnŽWLUÝJU_ƒ@@šmJkXUVlbklÝ@Ýa™b¯@¯±JÅwġaUU@ƒkU™@mVI±bUKƒL™WUXƒJkaƒLóKULWbUVkKmnk@@bmLUŽƒl@b@mnmJkUULƒaƒbnŽmn@lVV@¦n@„l@b‚znx@`Vz@b„xnV@xl„lbnKVx"],"encodeOffsets":[[116764,38346]]}},{"type":"Feature","id":"1304","properties":{"name":"邯郸市","cp":[114.4775,36.535],"childNum":18},"geometry":{"type":"Polygon","coordinates":["@@„bVKlVnInm‚@@a„kVnK@al@nmlLVUXaVKôL„Klb„IVWšX„KVL²a‚JnUš@lV@„VVĢbÆx²I°Ž°@šaÞbÞ@lkkaVUlWnI@™„@V`ÞI‚VXKmnk@y‚InUĊKƒÇkUUamUUkƒƒ@aU@U™ƒk@WUwVkVJVkkw°a@„mK@UX@VV„LVW@wšwVa@¯Xm@@lUIWaU@UWkXWmU@UwmUkKmn@lkVƒ²™VƒaULUVmJUUUwƒLma@™UmkIUm›L—mVšmx@b™LUamKÅL@VmbkU¯KÝamzkJUb±Vkb™L@lU@WIkJƒzkKmKƒnUalWkkKW@@nkbk@WW¯XUVUJ@XlJ@Xƒ@XlWLkUƒ`VUnaWa„UV@UVIƒaUxUUmVƒK@I@W@DŽU@@U@bƒ‚@nmKXmx™@UxkVWUX„@`VLlL@`™zX‚Ýb@b‚„@VUVkIUJVz°KVlnLlKnL„xlLVVUVlXUJ@nn‚„I@mVUlbn@@Žm„@bV„nV"],"encodeOffsets":[[116528,37885]]}},{"type":"Feature","id":"1303","properties":{"name":"秦皇岛市","cp":[119.2126,40.0232],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@lnV@Xb˜škx@lU@@LUVlV„LVbnl‚ašLXVVn‚l„I„V„U„JV@UnĊ¦la„bš@nJ°UmƒV@„wn@VU„JVI°bnWlXnWVLVK²b‚akk„lI@aUaVƒUwVUUalaVwnUVak¥šX@W‚kœLVÓm„mUK@_lWš@n_UK@alÅ@ğÅƑŃݍmƒ@їţÇlƒLƒ@¯m™z¯@ÝV™ak„ƒ`@LlVUbkXƒK™@klVXUxƒJmšbm¼V„nVVblLUV@b„°V°XLVb@¤mbXxWX°xXŽVbmVUVU@kbmI¯xmUƒ@Û°óbUl"],"encodeOffsets":[[121411,41254]]}},{"type":"Feature","id":"1311","properties":{"name":"衡水市","cp":[115.8838,37.7161],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@„KVlV@X°xƒb@VnnmbVŽXblb@VkL@lV@Vbn@@l‚@XX@bWVXlmXnlV„V@@VUbƒK¯LUl@nmbV¤n@l‚LXnlVUV@ln@lb„UlLnV@bV@@wlaXJVbnUVbVUš@VVšLVVn@VVX@@U‚KXU˜U@wUK@U„wVnk@UUWlk„V@a„UVUÆ`X_ƒw@mlU@anUmK@UXal¥„UmƒÈLVbVxVL„a„bVW@nXU‚Vn„„V°UŤV@Uƒ¯Um@Uƒ@@U™UaƒWVUmUUƒU@k£Vw™W@wW@XKƒIUa@wU@@al@UK@_mKXKƒbUU@aVKmš@Xmƒƒ±@kbÇakLğVaUw@a@ƒmkUJƒk@ykw@£ƒWX@lknk@WVkbUŽVnUVƒL@‚mVkI@JUb›I@JXb™XllkLUmƒLmbV`kLƒx¯Lk„›VUV@VôXkVVL„V™V@xƒVUbW@Kxƒl™L¯kV`UnV¦°@"],"encodeOffsets":[[118024,38549]]}},{"type":"Feature","id":"1310","properties":{"name":"廊坊市","cp":[116.521,39.0509],"childNum":9},"geometry":{"type":"MultiPolygon","coordinates":[["@@la„Ušš@šUnL@VWbklWxnIVV„V@X„JlbUlšXVbn@@K„mV@@X°WVInJmn²@lmVbnL@amKV_kwlmX@@LVamaXaƒaVU@UnJVanLlUkaW@UaVakK@IlKUU@an@ln@alKUƒkIVa@a@klaUKUV@UkUV¯šKVƒV@kUmƒU@@a¯ImJUU@VV@UL@Uƒ@@WXUWa@Ukwm™@ƒX@@w@al@@aVIUmVUUUVWUknK@I@™l¥kU±a™™UUVyUwƒ@@I@UUWm@@Uk@@nUJU@WU¯@kbWlULnšÇ„k¼@llLšl@xUnóŽƒLƒlkXUxƒV@lWb„I„`°nnn™llŽV²¯x@JkbƒLU„VxmJX²@ÒWVÛL@lln@‚Xn˜šnV„L"],["@@@kX@Valaa@KWI@UXW@WanaUIW@UaUKķŽk_W@UVUKUš@bƒ@UamxVXnJUbWVXLVbn@W°kb@U@Wó¼mIU¼k`V„@bVbl@„lX@lUôVlUœIV`lX„Vn@lUlVn@„l@UVaƒIUWl£Um™VWU@@UUKlUUUnƒVL@KšUnLVWUa›@™U"]],"encodeOffsets":[[[119037,40467]],[[119970,40776]]]}}],"UTF8Encoding":true}; +define('echarts/util/mapData/geoJson/he_bei_geo',[],function() { + return {"type":"FeatureCollection","features":[{"type":"Feature","id":"1308","properties":{"name":"承德市","cp":[117.5757,41.4075],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@lLnlmxn„„IVVlUnb@VVxXJWL@LގVnnV„J˜_@wkmšK„b‚x„wXk˜WXXšKlb²K@nVVVb„L@WlU²„lKVnUJVz@VVb@lżmVUVnbôaVX@°Ub@lWbXš@b@bVb°x„@VxÈLVlšaÆ@Þb²k°@lVUŽ@Xn@VW‚LXb@¤VXšKVVVLnm°_ƨ¤@aUIVa„alkX›°k„™V@„alwUVy„U@k󙰃na°UVUUmUÆw@mkLVUƒWVI„WšLnn@xlVnK„myU@ƒU°UXaV@U¥ƒU@Uƙ@aVUkWU¯ƒaU@WLUV@bkbmKULmKkUVUkmVIUwlWV²™Uml°U@W„LUwVm@UUK@_ƒKUUÜaXw@ƒVKUU@mVIUUlmnIVVVbÈVlKnbVKš@nI˜@nVnwVLVK„K„„˜Vnb@aUIVW@In™°@lVnIš@lWĢ@°UVL@b„@VyUUƒa@w@WUnU@Wǯ™K@UkkJWaÛbmk@mVaÞU@amkWƒ@mXUKkÿƒ£@a„kl@Um°UXwla„al@nmlXnW°znW@aƒwV™@ƒakbĉ¥VmU@ƒIƒVƒUƒJkUmWU™KbmkUaƒKkUVU@KV@@klw—™WaU@kmƒXVènbmlUUƒKƒX¯JkbƒI@JmIUWU@ƒLml@XkJ@U™kƒK@aVKwWa—IWwƒmUƒ@mU@J@UaċU™aUUƒVkI±ƒk@UUƒ@UbVVm@UVKƒLƒlkIWaULUWƒXUJU„ƒ@WbUb@lkXUxm@@JVn@J@b„nƒb@Vkx@bšLU‚Æn„JšaVXnKVVmzX‚°V@_lJXxWXƒK¯bÅamUƒ@lUI›bñJ@LÇKkIÇ`kxWL@„ƒ@@bUVUb¯xWKk„Å„VlULW@ƒŽn¦Ul@I™lmUUUVm@kWƒnkKma¯XUKWmnwVwÝL„mŽ™VUbUVWb@Lnxm„xVŽmbXx›¦@„nb@`™„ƒVƒ@kbƒLU„mVUlkbVXkºmnm@@xk¦šbĢÜlš"],"encodeOffsets":[[118868,42784]]}},{"type":"Feature","id":"1307","properties":{"name":"张家口市","cp":[115.1477,40.8527],"childNum":15},"geometry":{"type":"Polygon","coordinates":["@@k™ġۙal¥@wn@nml¹UWlaVknUVƒ„Kla„@„Ušƒ@_ma@ƒœ¥WwnaU‚wnƒmw@KXaVUVašUnmWUk°™lƒnUVUXWVw™IWVóKUI@WXƒxUU@mma@kUKWLkw@yk@ƒaVkUUċaUU@Wk@Unm@UVmLm±IUƒkJ™kWƒ@a„I@m@U„ƒVƒ„Ula„@VXVƒXmVwnkWKƒKU_k@m¥ƒmX_™JmnU@km@U@KmU™VƒU@U™@Umk@@LƒmW@Û£Wƒka@wk™@aƒI@mmk@mUa@UmUƒIƒwW@aWUƒbU@kbÇ@kwƒ@makVUk™U@aƒm@aU@mxkUƒbƒKUXUƒ±KXVWLUK@wkU@V™@WXUa@WbUxƒJIƒŽ@¦VèVVX@±ê¯KUIƒ`¯UULVx@Vƒ@UKƒIƒVkLmVkKmš@nUJÝbkIUJVXšVVxVbU„VJ„Un™°bV„mlU°„XnK@Ul@lVÈVUXšx@W„@VXšV‚KÞb„n@VnbV„m`ƒUx™kW@UVkL™Km¼@lUnUJVnV„XV@Vm@@LV„klƒIkl@VƒWlŽULWKUL@mJ„@blbUVUlmzUJUxm@UUbċÜk@Ub@VšLVV„¦ôbVŽmšUKUkU@m„„@VlVn¼WbUJ¯@@„°šnIllÈl˜@nXšWlLœk‚J@bkxlxkxlXUlklJƒšXL@bW„n`@nƎXxlL@xl@Xb‚LœKlVlIXblVUbUJW@lX@VL@VVŽšXšJšw„n@WnL°K„bVbl@VI@K„@U@nmVmV@XUWI@aXm@™VUUkWmn@lmUUk@mUmK@UnwVĉ@ƒƒmU_V@XJôVVUšLVUn@šllUnJl_n@šml@XŽlLlw²LVJUL@VmbVblVXmVnlš@Ť¦„nn@܎@bšl„@@XV`„Unb@VlLVb²J‚Xn¥ÆÑ@¥Þ@"],"encodeOffsets":[[118868,42784]]}},{"type":"Feature","id":"1306","properties":{"name":"保定市","cp":[115.0488,39.0948],"childNum":23},"geometry":{"type":"Polygon","coordinates":["@@VbXWš@@UlV@xVLXKWU²LV„VW„L„alVnwV@@b„n@bšVVllUnb„@lxÈ@laV@„aXV@b‚X„x„J‚nV@VVb@nnl@n„J@blšl@„ašƒU_VWUwVUškUm™Ukb±mVwœU@VIUW@UWk„@VU@ynL„m@IV@‚bnK„LVaVmnIlaXwV@@WVL°@@xnX„@V`V@VbUVVLVKnwnL@ll@@_V@VVnaÆ@œKVXÆ@nƒ@wƒKmU—™Wm@km@kÜKXU@ÑW±nIUwVƒ„Kla@I°wU±kškmm¯mƒ_ƒJnƒaƒwW@IVaUama@wƒUƒmU@mVw@aXk@mWa@£km@aƒ_kVmUnWW@¯bƒkUmk@ƒVÇm@@kUU™KUU™@UVUamVUaWIkb@xU@@amUkKƒVkam@@kVUkUWmKmUkLUb@xmJƒ™U@UImVÛVmnUwƒJƒU@VƒX@UWm@Ub°¦UšmxklmX@`ULU@@UW@@xkn¯@makV™UmxUb™°ƒlUšƒbUbƒnUJƒUUVƒa™LkbUU›JUU@mUUUƒJkaƒ@™xUIWJƒUnƒJ@V™zƒ@kb@`@bln@l™bƒŽ@X@š@š„@Xl‚bnbVb„@„„VJlInlšbVw@U„K„l@lbnan@Vb‚JôLn‚UzlV@lÈLVbVK@LVx—VWXX`WxXz‚bV`UXV¤nx@„bVlVnVlUL"],"encodeOffsets":[[117304,40512]]}},{"type":"Feature","id":"1302","properties":{"name":"唐山市","cp":[118.4766,39.6826],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@„@VVl@²„lJ„UVVšbČVVb‚@@InV„@‚V„nXx˜JXb‚xUL@b„Lšl@VlI@Wnk„KV@VXnJ@I„Jla°I„W„LVVnkmaUç„WVkôaܯ„@nV°wnJlaV@VUnUUaW¯wXWWwna@£UaWKU¯ƒ¯@aVUkKUamUUƒn»‚an™„IVwUWlkš@„LlWVakU@K„_lƒšbÞU°@šy°n„@„KÈkWW™ţ¥ĉōƒkġWUw¯£¯ƒÇwţwƒ@kK@kƒ¥ÝwÅbǤېťV™lW°@ĸ™x@VVVULVLkl@V@Xƒ`Ub@Xm@UWbƒk@ÆVbnLWV@lnXUbl‚@X¯lmU™VkKWLkK@_UK@U@UmmUxmVXLWVULkU@`W@ULUK@XlJXzV@@xml@VU@UX@Kk@WbUK@Xn`ƒXmJnšmškxUVbUVlVVxUbV@nKlL„kVKÞbVKXI°KVšmVUIUKULVxVJVLkV@Vƒ@UbU@WUU@UbUK@b@nƒV@VkLmb@b"],"encodeOffsets":[[120398,41159]]}},{"type":"Feature","id":"1309","properties":{"name":"沧州市","cp":[116.8286,38.2104],"childNum":15},"geometry":{"type":"Polygon","coordinates":["@@@ln@UȄŽl@Vn„l°aX@mXnVlU„`@bln@¤Xb@nWl@bUx@nnV‚„„V@xnbVbUb@J‚X„x„b‚mXa@k„UVwlW„k„KôVm@w™kkK@kl»Èƒm™VKXkla°@XVV@VI@ml@@Vn@VX@V@J„@VxUzVVšš²blVk¦@šĠ@@»š@VK@VÈLlK@XnJ@alIUl„a„VVbš@„n@a„U@WUIV@mUn@mKXml@lL@LnWšb@XV@@a„VVb„V„@VV„IVWÈb˜IÈ»ƒǟlWšaVUÅUƒƒ™Um@kVU™WVkaUwmaóUƒJUU¯ÑU¥mk™¯UaƒKÅnÇyóXmWÛX¯aċbÛa›J—W™ÝU¯»ƒaóóUm@IƒšVVl@bƒLUJWLX@@xšXUxl¤V@V„nVUV„XVbVš@Ž„@@VVn„°VŽ@ţU¯VƒUmƒUWV@mUXƒaƒbUKUwUaÇKn„ƒVk¦Wb@VnLmV@bkV@n„xW`Å_UVƒV@bƒUklVX@VmlUƒx@VVL@x—VWVL@VW@UUm@"],"encodeOffsets":[[118485,39280]]}},{"type":"Feature","id":"1301","properties":{"name":"石家庄市","cp":[114.4995,38.1006],"childNum":19},"geometry":{"type":"Polygon","coordinates":["@@la„@šy@U„I‚m„VXIVJšw„@lb„IVVnV‚@VVœIVVlašK„bVU„VVI„mVa„aV™„kš¯VanwšVlUnb°@lm@wX@@VV@VK@_nWlknwV™¯¥Van@VX‚@„W@U„V„IVxnmÜUnUVJV@„šnI@wValKnV@k‚mU£na@mVk°K„LVa@UU@UƒmknWWkXU@aWW@@km@UaU@@klK@UkaWaUnamm@U„a¯wWU@UkƒL@ŽUn@x™V™lUXVJUb™LmU@aUWUkmKkLUUm@mW—XƒaƒmmkkWUm@@U¯JUUm™kU¯@mKĉxÝwÝ¥LƒUóŽmwkUUUWVkKm™kKmLX„lxVLVxXJ@nVJnz@VWL@`nX@šƒxƒ@kVUUmJmIXx„JV„ƒnUVƒ@UVV„@LUšƒ`UXVVƒ„ƒlXL@l@b@VmX@b™xn°™UƒbkKWLXlW@@bƒK„mKULmakLUlmb@šXb@xmXU`V„b@`lLx@nWVXL@‚°WlXnlb„KVK„XVb@˜X@l_lJ@V@XnŽ„I"],"encodeOffsets":[[116562,39691]]}},{"type":"Feature","id":"1305","properties":{"name":"邢台市","cp":[114.8071,37.2821],"childNum":18},"geometry":{"type":"Polygon","coordinates":["@@nKlLnšlLXUVVlVnxô„V‚KÞ¦ÞxĊwnL°@lVnšVV°I@Vn@V‚lXnl„n„b˜WnXn@VVlKnLVlVX@bnVšKVaUIVWškšU@wVm@¯@U¥VmU_°lšK„k‚w@LX‚Va„U@wšUƒUUKlUóW@UVUœUlƒ°K„wlKU_na„KVnlKkkšWWa@IœJVa@IlJnU@„KVUUmVlaXUl@lm@kXWÝÑnkƒ™±™k@wğ›@@U@mKĉLmVJ@zmlnŽWLUÝJU_ƒ@@šmJkXUVlbklÝ@Ýa™b¯@¯±JÅwġaUU@ƒkU™@mVI±bUKƒL™WUXƒJkaƒLóKULWbUVkKmnk@@bmLUŽƒl@b@mnmJkUULƒaƒbnŽmn@lVV@¦n@„l@b‚znx@`Vz@b„xnV@xl„lbnKVx"],"encodeOffsets":[[116764,38346]]}},{"type":"Feature","id":"1304","properties":{"name":"邯郸市","cp":[114.4775,36.535],"childNum":18},"geometry":{"type":"Polygon","coordinates":["@@„bVKlVnInm‚@@a„kVnK@al@nmlLVUXaVKôL„Klb„IVWšX„KVL²a‚JnUš@lV@„VVĢbÆx²I°Ž°@šaÞbÞ@lkkaVUlWnI@™„@V`ÞI‚VXKmnk@y‚InUĊKƒÇkUUamUUkƒƒ@aU@U™ƒk@WUwVkVJVkkw°a@„mK@UX@VV„LVW@wšwVa@¯Xm@@lUIWaU@UWkXWmU@UwmUkKmn@lkVƒ²™VƒaULUVmJUUUwƒLma@™UmkIUm›L—mVšmx@b™LUamKÅL@VmbkU¯KÝamzkJUb±Vkb™L@lU@WIkJƒzkKmKƒnUalWkkKW@@nkbk@WW¯XUVUJ@XlJ@Xƒ@XlWLkUƒ`VUnaWa„UV@UVIƒaUxUUmVƒK@I@W@DŽU@@U@bƒ‚@nmKXmx™@UxkVWUX„@`VLlL@`™zX‚Ýb@b‚„@VUVkIUJVz°KVlnLlKnL„xlLVVUVlXUJ@nn‚„I@mVUlbn@@Žm„@bV„nV"],"encodeOffsets":[[116528,37885]]}},{"type":"Feature","id":"1303","properties":{"name":"秦皇岛市","cp":[119.2126,40.0232],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@lnV@Xb˜škx@lU@@LUVlV„LVbnl‚ašLXVVn‚l„I„V„U„JV@UnĊ¦la„bš@nJ°UmƒV@„wn@VU„JVI°bnWlXnWVLVK²b‚akk„lI@aUaVƒUwVUUalaVwnUVak¥šX@W‚kœLVÓm„mUK@_lWš@n_UK@alÅ@ğÅƑŃݍmƒ@їţÇlƒLƒ@¯m™z¯@ÝV™ak„ƒ`@LlVUbkXƒK™@klVXUxƒJmšbm¼V„nVVblLUV@b„°V°XLVb@¤mbXxWX°xXŽVbmVUVU@kbmI¯xmUƒ@Û°óbUl"],"encodeOffsets":[[121411,41254]]}},{"type":"Feature","id":"1311","properties":{"name":"衡水市","cp":[115.8838,37.7161],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@„KVlV@X°xƒb@VnnmbVŽXblb@VkL@lV@Vbn@@l‚@XX@bWVXlmXnlV„V@@VUbƒK¯LUl@nmbV¤n@l‚LXnlVUV@ln@lb„UlLnV@bV@@wlaXJVbnUVbVUš@VVšLVVn@VVX@@U‚KXU˜U@wUK@U„wVnk@UUWlk„V@a„UVUÆ`X_ƒw@mlU@anUmK@UXal¥„UmƒÈLVbVxVL„a„bVW@nXU‚Vn„„V°UŤV@Uƒ¯Um@Uƒ@@U™UaƒWVUmUUƒU@k£Vw™W@wW@XKƒIUa@wU@@al@UK@_mKXKƒbUU@aVKmš@Xmƒƒ±@kbÇakLğVaUw@a@ƒmkUJƒk@ykw@£ƒWX@lknk@WVkbUŽVnUVƒL@‚mVkI@JUb›I@JXb™XllkLUmƒLmbV`kLƒx¯Lk„›VUV@VôXkVVL„V™V@xƒVUbW@Kxƒl™L¯kV`UnV¦°@"],"encodeOffsets":[[118024,38549]]}},{"type":"Feature","id":"1310","properties":{"name":"廊坊市","cp":[116.521,39.0509],"childNum":9},"geometry":{"type":"MultiPolygon","coordinates":[["@@la„Ušš@šUnL@VWbklWxnIVV„V@X„JlbUlšXVbn@@K„mV@@X°WVInJmn²@lmVbnL@amKV_kwlmX@@LVamaXaƒaVU@UnJVanLlUkaW@UaVakK@IlKUU@an@ln@alKUƒkIVa@a@klaUKUV@UkUV¯šKVƒV@kUmƒU@@a¯ImJUU@VV@UL@Uƒ@@WXUWa@Ukwm™@ƒX@@w@al@@aVIUmVUUUVWUknK@I@™l¥kU±a™™UUVyUwƒ@@I@UUWm@@Uk@@nUJU@WU¯@kbWlULnšÇ„k¼@llLšl@xUnóŽƒLƒlkXUxƒV@lWb„I„`°nnn™llŽV²¯x@JkbƒLU„VxmJX²@ÒWVÛL@lln@‚Xn˜šnV„L"],["@@@kX@Valaa@KWI@UXW@WanaUIW@UaUKķŽk_W@UVUKUš@bƒ@UamxVXnJUbWVXLVbn@W°kb@U@Wó¼mIU¼k`V„@bVbl@„lX@lUôVlUœIV`lX„Vn@lUlVn@„l@UVaƒIUWl£Um™VWU@@UUKlUUUnƒVL@KšUnLVWUa›@™U"]],"encodeOffsets":[[[119037,40467]],[[119970,40776]]]}}],"UTF8Encoding":true}; }); -define('echarts/util/mapData/geoJson/he_nan_geo',[],function() { - return {"type":"FeatureCollection","features":[{"type":"Feature","id":"4113","properties":{"name":"南阳市","cp":[112.4011,33.0359],"childNum":12},"geometry":{"type":"Polygon","coordinates":["@@lKl@nVV@„bn„@VVnm‚nL‚LXx@š„‚VLlKVU„IXWÜ@șlbl@XUĊUlwnW„LÞw‚m@ÞUVmnVl@nX‚JXLm@VnnJla„I@VkxVb„@VŽln„J@knKVn„@°aVanal@XK°b„‚@š¯VJXIš„VK@al@nV„k‚@nK„a‚b„@XL@blVVKVLXK„@VaVI°mVaX@V_@a@yUkVw„VšIVašJ°™@anIlaV@nKnXÆm@wUUV±UUWUKnaWwXUWmŁ¯Vƒam@kakImƒUKƒ»lan@VXXa˜W@@UlUUa@a@UlwUƒV@Xal@@anIVaUK@V™XmwVmUmV„LXl‚@nalLnal@„šnKlkV@@UnJ‚UXnl@nVl¦V@@VnJ@nUVVVVIn@Va„JƗn@@K@m„kƒa@kmWVaUI@a@™k@@aUL@mmaVIUKUVƒ@@IU@mƒUmmL@K@UUUU@mW@@nU@ğ»mVmbk@klW@UXnV@LƒJm„™lUnUJ™UUUWƒƒ@UnkKƒxmLa@ƒ@@lUU™bmUVWk@@nkUmam@UakJU_ƒVm@ÅlÇLUVmVUwULƒKU@ƒk@UƒVUlU@@Uƒ@UaUUWaŎƒzJƒaWLkl™b@bmL@„kKƒabWŽUVƒ_@mV@b¯JmXUbUK™¤ÇLUU@b@JkLWmkUWIkJ@VmX@JUbVXU`¯VV¯blK@LXKl„UV@Um@@Uk@kxWŽkbƒL@KkbmL@‚UXmaU@@l@x@blX@xUJ@bULUlULÇ@@VšnU`W@@nÛ¼U@@VmKUkm@VVX@@xǚ@bUbVb@VX@@x‚LUb@lƒ¼XLlbUlVVU„Ub@n"],"encodeOffsets":[[113671,34364]]}},{"type":"Feature","id":"4115","properties":{"name":"信阳市","cp":[114.8291,32.0197],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@VllInJlknJVkVU@mXlUÞ`VnV™VU@U@y„@nXlKV„nJVkXKWaXI‚b@yVk„VUkVwn@‚K@nW@k„KlUXVVUlbnUV`n@V_V@llX@@V„b@bV@@nlVUb¯‚WLnbmb@ŽnLnK˜b„U„bVWnLlaX@VVUX@Vln@`kL@ll@VXVJÈIVl@XÞJ°Una„LlylU@UXKlnn@lanLWWnbVI@KXKVL@LVWVL@UVKUIVWX@@XÆJ@In`@lJVI@a„WšÛnK@UlK@UU@VK„nlm„nXal„UllLUbVVšknJ@nV@Vm@a„l@@xnV„„lJVUU@™w@aƒk„@XW@_mWnUlŁUmVKV@VXwW»XƒWaUwnkWUkVUƒU@@@WlaUkkaƒIWVkm¯xmIUmƒLUVƒaUIó»m@mmwXk@a›mk¯¯l™@wƒmkLmmU@UbkUWJ@XUbƒJ@b@l@znÆmK@Xk@Ub@lm@ƒI@akmVKUUVUkU@U±JUbkƒ@IWmkxƒa@UUV™UWVkIUaW@UlLWn@VkJƒI@VkK@L@bmKƒkJmUUaUKWXk¼VxnJ@„V@@VULV¼ƒ@@UkaUlWL@U@W@IkKmL@KULUWULWKUXUJmIƒb—KƒŽƒ²UW™nWKUUkLUƒmUUam@UU™@ƒmUL@xkV@„VV@bmV@Vk@mwkUƒVUx@mbX‚ÇnVb„‚UL¯šWŽnUVLVb@xnlWnU@UVUVVUbVVlVkn@llVUXUWUXVbUJ@bmLUJnb@nVK@bl@@š@bVJUbnX@l„b"],"encodeOffsets":[[116551,33385]]}},{"type":"Feature","id":"4103","properties":{"name":"洛阳市","cp":[112.0605,34.3158],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@VVUllLXl@LWn@J„@bƒKUVmnL@`VblLnbV@„b@JmL@LnV@VV@¯„VJVnXL˜@nm@aÞ@‚a„k@m„IšmVbXL‚ynLšk°@°aVJnUV@UVVXk@WJ@VXLlUnJVnnƒ°U@»°U„wl@šb„WmUXƒÆ@VLXU@m@U„a@I›mkb™a@naWW@_@WXUV@@U‚ƒ²@„K@I±U@¥kKWLóLlƒa@£Um@kWKXU@mlLXUVKUU±J¯_@`UL¯Wmk@Wa„kkƒlUnƒVUVaU@KUU@mmK@_ƒa@KX@VaUIm±™k„aVKVUkw™@kaƒƒW@kbkL±UUaƒK@UUKVak£ƒ@UmmL@lƒIkmUƒ@Ualw@UƒJkbmIUmn@WKImWk@mUUnÝV@ŽnÝxƒKmXkxĉVWVk@kaċšÛ@WXƒJUV@zŽm„VWnbUbVbšLlUnŽ‚lUÒnWV—VWnk@@Vm@kxm@Un™l@Ll@@V@šXnƒškJV„šV@nlVXx˜U@l„n@aš@VLnWĊ¦nxš@lbVKXLl@ރVLƒ„XJl@XXl`lIXVl@Xl‚XUVšK„wV@lanx„zUbVJ@VVX@b"],"encodeOffsets":[[114683,35551]]}},{"type":"Feature","id":"4117","properties":{"name":"驻马店市","cp":[114.1589,32.9041],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@n@„b°UƂXnVlnLÜ@VLœm@n˜@na@J„„m@k„@lVšVxXX@„V`lLV„XVV@VVÞLVV°„²@lašbnxV@@b„Lšmlm„_VWnIWUna@lšLšbnV°ƒVL@KšV„LVUVaVLXK@mÆXna@wVm„a‚@Xw@KlL@a„@Va@wUkaWnIVƒla@Kn@Vn@VUl@nKVn„J@LnK@aVkVUUWƒ@VakUVanI‚²X‚W@UUU°KnUVLl@XaVK@ašU@KUI@W@_lm@KkLUKV_Uƒ@»@UVJ@XV@@mVL@K@U@Kk@VwUUm@kmWL@VkVkzƒKmb¯VÝI@WUkÇJUIUWk@@klK@_km@UVWUUW@kbmKUXƒaƒV—amLmK@namaXK°VakU@mU@@aƒa@UW@kkU@U`m@U_mVkaUVWUkVƒL@lmX@ŽLm@UxVlƒUUl@zaWJXbWLUlmIUƒkLmWƒ@@z@VUVUšUmÝ_kVWŽ@nUVUlmIklmIkJUkƒl@n@Lm@؃IUbm@UJUUVU@mmI@UU@k¥mUk@WmVmI@VU@klmLƒ™k@mbkKmb@WkƒKUŽVnUnnxšW@UVLUbmJ@bk@WbU@V„kx@V@bVbkV@V‚@‚—XWbUWm@kb„¼VLn„lJlb"],"encodeOffsets":[[115920,33863]]}},{"type":"Feature","id":"4116","properties":{"name":"周口市","cp":[114.873,33.6951],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@lšnb@xlJ@UnLlKXUlJl_„KnV@xVL@bkbVVUè@šWb@„Ubmš„ŽkšVšmbX„VJnUl@„a°@@b„LVbƒlXx˜InmnLVw‚anJÆw²IlmnXVl°VVbÈaVb„@lkn@VWnLlUVmÞUUklƒkƒVkUaVaVaUw™K@kkaVWmw„_„‚l@nU„VVb@b„aV@VV@zXJl@@kl@šlœk°WVnÆbnbUšVJ„Iš@VKVm@k™K@_kK@a@aU@@wW@@k@aUW@IUWVUnLlUlVXKVwmk@W@—VWa„¥@k@lnƒUIÇKUaU@ƒUUVmIUV™Uk¥ƒVma@¯k@Wanwmƒ„@@n@@m@UIVƒkUVamUXWƒaV™U_™@ƒmUVUImW@aUIĉK@VmI™b@lU@@n™JƒkU™@KƒIUmmLk@UVm@UŽm@@LkbU„mJXlbV‚@xUbƒ@@bkK@LWx@ƒbUn@xmbÅW@nWLUKUbUVƒK™U@LUK¯„mU@šVV@xULUŽVL@bU`WšUz¯aUamKUaƒ@@xkX@x"],"encodeOffsets":[[116832,34527]]}},{"type":"Feature","id":"4114","properties":{"name":"商丘市","cp":[115.741,34.2828],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@XVl@lLȃ„@VkV@V»UanƒWX@VaÆÇô@ÈaVX@xVJXUÞU‚aVLĸbXKl„V@šm°Vn_ny˜XX»mUk¥lK@a„_@yšInaVKVa°_@WXI@ƒ@K‚VnIlbnaV@„l„@‚a@_w@ƒlwUKm™Xa@UV@š»Vƒšw@kUKVUUm@w±VUXUKUwmJUUƒ@km@@±mXkmUI™@mm™KUwkbWakLWaUIkJmŽƒX@l@@VUX@JWbX@VbULWbƒlUVULknlV@bVJk„mb¯KknWmk@@nmVkx™@ƒVmU¯KUnUL™@ƒJUIV™maÅaUm¯X›l™kk@@lk@WI@yUUU@ƒb@aUaƒUmVk@ƒƒ`nxUXlb@lšLVxUbUbVbUll„k„VlÝVUnkVmKUXm@klƒ@ƒnUx@xnxƒn@`VX@V²x@V@b@„Wl@zU`VUVVb„L@Vƒb™W@bkXllkLWV@V„@VVÈwlVœ@@X˜K²Llb„WnnÆL@VnJWn"],"encodeOffsets":[[118024,35680]]}},{"type":"Feature","id":"4112","properties":{"name":"三门峡市","cp":[110.8301,34.3158],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@WKUmUI°ƒU@@UmU@KnK@IƒaU@makKUa@_‚KnmVU„L@a‚ƒ@IXm@KWkkKVkUU@aUW@UUIVaƒymwkbU@ƒx™LVUWWkk@WUkJk_WWk@WI„ƒUK݄k@WKULka™@mwĉ¥mXUK™@@bƒm@k—VWwkU@m™UUƒlI„™Wm@™@Uk@@KškVmn@lwn@@Ul@Xm˜UXUmVсkmkV™KUaVamaUXnƒ‚@ykLUKƒ@™WwKmKnUm@UmƒƒaU@mUk@kL@lƒxċxUnkVmnXxWb@`kzWJ@V—LmVUn™lmUL@lW@Ub@VšXUbš`VLUbUJ@nmnUlUUm@@bUJlnU„š‚U@lxkbƒ@@XƒJUnƒ@kb¯VVVmlXXlJlzn@VlkVW@bkK™bmškŽUbVb„lƒXVxšKÈnšwÞlĊKlšVnKlwX@lL@xlUnVn„@šl@lmX@ƄÈb°¼ÈwVJlx„_°xšašlšUÈxlUnbVxnL@lllšbm„n@nb‚@@V„L@V„@@„VLšJnIVVlKnV„_"],"encodeOffsets":[[114661,35911]]}},{"type":"Feature","id":"4107","properties":{"name":"新乡市","cp":[114.2029,35.3595],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@XVlL„K°bUblbUbšl@nX@W„XVVKVkš@@Žmb@„Ubn„W`kL„LƒV@VVLnKlVXIlVš@@a„@l£nWlƒkVa„@°bnUlLVlna‚bnUVUXKlU@ƒ@lk@a„I°y„@ôkUU@wšmôšnkWakml™UkVmkUlmUUm@nkUKWanamU„LXW@U‚VnUln„`l„œblL°KXV@ĠJ@L°„šJšUVw„anK@UUImmƒkK@¯±Um@IVmUmmÅnWaUK¯aUk„w@W±kVƒx™U™VƒwƒnÅJUIWaÝJóI—bm`ÝbÅImJUI¯¥¯@mU¯UƒJmnUVóUkl±V@zXl„bWVXL@bm„mº@@XmJUXU°llk„@nWJk@U„@¦U`m¯ŽWx"],"encodeOffsets":[[116100,36349]]}},{"type":"Feature","id":"4104","properties":{"name":"平顶山市","cp":[112.9724,33.739],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@l¤UbVL@V„LVb²VlKlaX@„„lbš@lxUVULƒbšln²VJUbW@@L„b@`nL@nVV@LVŽUbUVm„kVl„ƒlXbl@Xn°ŽVK@_°`²IVVV@VUVJnInaWK@Uš@„K„LÆ@nmlXXWVUUw@klKVa@knyVkVanI‚JXUl@XbVUl@@aša@mXk‚bnK@UlK@UUUVaXaWmkUm¥n—WmXaWaœkl@VmÞb„KVL@aVI@mUwVm„@KōméUL™KVaUk@kUK@U˜WXI@VlKXU‚@VVnInVV@VLlK@UUƒkKU_@ƒWWUwU™@klƒn@ƒƒ@Imb—@@m›nUKÛ@mKUkWVXxmbVLXŽVVU²VV@xÅnmWmLU@kbmJ@b¯š™IUb™JƒUUxVl@z@bU`W@Ub¯nUJUbƒ@WLUKULkU@aWKƒ@aƒbmL@ƒlmUk@@bUL™ƒWJUI™°@ƒŽ¯aWLk@mbUb¯b"],"encodeOffsets":[[114942,34527]]}},{"type":"Feature","id":"4101","properties":{"name":"郑州市","cp":[113.4668,34.6234],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@@nWVUKÅ@W„nVnI‚ŽV@œkƂšwV@šnn@lxÞlnôJ˜zXJl@nalUČVlƒl@²UlkôVVUnm„I°VnV°@°¦VJnIÆJÞan_VmU@ama™@kU˜¥kaUklw@UIV¥kVUI@ƒmmUÅmUlƒwVU@amU—JWbUakVƒ—Vé¯Im`ƒk—@ƒwVWmLkU¯ŽƒXkWmLmx@UUƒbm@@x™J@LbW@UUVWUkVKƒ@ka™IUamKUkkmmLƒUkJUVWXkWmnÅ@ƒKƒL™@@VXLmbmJUIUVU@ULWVkK@nWVXL@lVn@¤„b‚kôKXKlL@¦²V@JƒL±@„@VU@WV@X@`XXmb@Žšblaœn@Jƒb@V"],"encodeOffsets":[[115617,35584]]}},{"type":"Feature","id":"4105","properties":{"name":"安阳市","cp":[114.5325,36.0022],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@°kVaV¥kVmUkWkWVkVKUwkkmKUU@a„wWWXWakKWkXmlašIVmX¥ƒU@a„@WnK@kƒƒ™V™I¯ƒ@KğI@WU¯LkK›akƒƒ_kmmVU@VWXƒKnVmbXbVLmln@VVknlVUnVlkšlnXbmlmlXblnÈlWbn@@nšK@V„L„bVV°VVzšlnš@V™xƒI™b™ŽU@WLUa¯V™UkWõ@¯kkmxk¼l‚„XUlVbVLnlULmU@lƒLkVUlƒX@xW@¯mUƒ@UmIUW™L@aXa˜kU™¯anƒWk°@k™kKmmUIWaambUkkKmV¯aƒ@UblŽk„mXk¤ƒ@@b™@UbULWVnb@lUVVnmšnVVU„J@bWXX@WJkL@blVU°UV@XlWnXUbW@UVkVšVWbnLUJWLUK@Lnn@blVU‚„nUblxVUVJXU„a˜@Ub„LnUVV@mVIVVn@UbV@‚XbmbUV„_lVXUWanJVI@WkI@WVIVU°WXXl@la@mX@lLXl‚kVbœm‚X„ylIXJV@@kšKla²UVa„IVyÞb°LlVna@UÆKnLVbšK@anwU™"],"encodeOffsets":[[117676,36917]]}},{"type":"Feature","id":"4102","properties":{"name":"开封市","cp":[114.5764,34.6124],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@lUVbXa˜InV@bUV„x‚knVVÆnn@„VJlUU¦VJ@kxVllb—¦lVš@nb@bVŽUn˜aôJÞIXbVJÆI„m„xšUšV„w‚U²l@XƒxVl°bVLXb‚`XklUnmVblLœ@lmšx°LVK@UXIVašWlL@Ukƒ°KkVaVUXmmI@UÅKmmƒXka±K—L@W›@kUÇxUUƒ@@UXUlKkklW@ašX„a@UƒKUaVUUV_@yXk@ƒ@a@U±w@UUW@_„mmw@wVw„mUaÇbUa¯UUkmWkn±JÅxmIbUxmKmn—JWw„kUaƒK@a¯@ƒbk@mVUIWƒ—Lmwm@Ua@WJUb@LUl™@UUmLUbWJ@VL@VmXWWzUJUꄘ"],"encodeOffsets":[[116641,35280]]}},{"type":"Feature","id":"4108","properties":{"name":"焦作市","cp":[112.8406,35.1508],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@V@VL@x@bXŽWV@XkššlUŽWX@J„@nI@KlL„KšUVaV@œJlL@KUk@KÞL‚l²_‚@nWlL„UVVš@nLWVUJVn@anV@a„wÞUVLVx„b„@lW„@lbXn‚Vn@@¼šL°mšKVn@bnl@nVK@blb„L„W„U@VWLXV@nlKn@lVVbXw°nV_@¥Vƒl@XI@mlƒkkV¯VWnI@W‚@n¹nƒ@aWKXUƒaWk@yk@k„ċUkVmbk@WI—yóImÝkkwm@™mU@™xŁ›lU@mJƒX™ak@ƒx¯V@¼¯Vm„UmmIkVWK@UXIl@UWVUU@mVUI¯b¯@™lmKzWKUa™nƒJ@nƒlbÝ@@b"],"encodeOffsets":[[114728,35888]]}},{"type":"Feature","id":"4110","properties":{"name":"许昌市","cp":[113.6975,34.0466],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@lI„VnKlnVlnLVbšJlb„@ULVlUXVVX@‚a@KšI@wn@„aVV‚@nwnKlX„W°lVnKUX„x˜@„ln_°JVIXy‚XnW@U‚K@UXIVanKVVš@Vk@KVaXI‚@Vbn@nx˜KnaU™l™ƒn™Va@ƒXa@™VçUUla@aUK@wmUƒLk`kIWVkLmK@V@XUlƒn@JXV@nm„™bU‚óIƒmUa±@@ÑóVUUk@UlKVU@akWVUUlUUaUK@UUKWbUkÅJ@XWaƒ@XbmJ@nUJ@bUKƒLÝaUnk@›lXbWbXnm˜n¦lVXnWbUbVV@VkL@VmLaWl@n™b@bk@UVWak@WVImJUbUlmz@lUbkL@lVx"],"encodeOffsets":[[115797,35089]]}},{"type":"Feature","id":"4109","properties":{"name":"濮阳市","cp":[115.1917,35.799],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@lLXbW‚XXƒx@bVVnLllVxULUl‚XXlVlUnlŽU¦Ub¯l˜nœK@V‚bVb@šXbVL„KVxVVnIlašb„a„¥lU@wnalLnVVlVLXnlWVXn@@lVI@WnU@mƒÅW¥—aW_k@WwXy@kmƒ@wU„mš„š¦šlUxVLV@UwšJ°xš@VX„@Vb„@š`VX@VX@llšIVbnJlI„bšV„l„˜J@ƒmѯLóa@ƒƒKUa„k™ƒ™Xƒ@UK@wU@ƒlWUUݯImW¯aƒLUKU@ƒkƒ»k@mƒwƒa@UnKWI@ƒUU@akVWK—k@a±ƒbóUWKXUmk™KUmLƒbUx„„@lmLXŽƒ@@b„VW¦Un™JkbWnXl"],"encodeOffsets":[[117642,36501]]}},{"type":"Feature","id":"4111","properties":{"name":"漯河市","cp":[113.8733,33.6951],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@@Lƒ‚UnVxnIWa„@Xb@WÆIVlXaVL@VVLVbkVVŽUVlX@bUVkLV‚l@VVôU@Ò²@Vb„nôJVšanƒ@mWU@I„mVk@WkI@wmak™@wlW@w„@VbnLVb°bVyX™V_@aUKVVK@wUU@™™a™K@kmbXVmJUXƒ`kn™nƒK@aU@mw™akb±@¯ƒUUÝKUUU@WU@VkLUKU@mUmJUU@WVkL@UWJ—X@VVL@lVlUbšLVKnêƎ"],"encodeOffsets":[[116348,34431]]}},{"type":"Feature","id":"4106","properties":{"name":"鹤壁市","cp":[114.3787,35.744],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@ó™™n@xVVólƒ@¯zƒJ@bkl@@„kVWLUVmVXbVJnnlLlš¯@Xlm„°bVš—lWb@bšKVXnJ@VV„°nX@@w„WVklU„K@knVVKmkUKUaVkƒWkl»nwlŽ°lö@lXšV°UVbXKV@šša„Jšw@Um™™kUy¯UUUƒaƒK@U™L@mm@XaÇkkmWank"],"encodeOffsets":[[117158,36338]]}}],"UTF8Encoding":true}; +define('echarts/util/mapData/geoJson/he_nan_geo',[],function() { + return {"type":"FeatureCollection","features":[{"type":"Feature","id":"4113","properties":{"name":"南阳市","cp":[112.4011,33.0359],"childNum":12},"geometry":{"type":"Polygon","coordinates":["@@lKl@nVV@„bn„@VVnm‚nL‚LXx@š„‚VLlKVU„IXWÜ@șlbl@XUĊUlwnW„LÞw‚m@ÞUVmnVl@nX‚JXLm@VnnJla„I@VkxVb„@VŽln„J@knKVn„@°aVanal@XK°b„‚@š¯VJXIš„VK@al@nV„k‚@nK„a‚b„@XL@blVVKVLXK„@VaVI°mVaX@V_@a@yUkVw„VšIVašJ°™@anIlaV@nKnXÆm@wUUV±UUWUKnaWwXUWmŁ¯Vƒam@kakImƒUKƒ»lan@VXXa˜W@@UlUUa@a@UlwUƒV@Xal@@anIVaUK@V™XmwVmUmV„LXl‚@nalLnal@„šnKlkV@@UnJ‚UXnl@nVl¦V@@VnJ@nUVVVVIn@Va„JƗn@@K@m„kƒa@kmWVaUI@a@™k@@aUL@mmaVIUKUVƒ@@IU@mƒUmmL@K@UUUU@mW@@nU@ğ»mVmbk@klW@UXnV@LƒJm„™lUnUJ™UUUWƒƒ@UnkKƒxmLa@ƒ@@lUU™bmUVWk@@nkUmam@UakJU_ƒVm@ÅlÇLUVmVUwULƒKU@ƒk@UƒVUlU@@Uƒ@UaUUWaŎƒzJƒaWLkl™b@bmL@„kKƒabWŽUVƒ_@mV@b¯JmXUbUK™¤ÇLUU@b@JkLWmkUWIkJ@VmX@JUbVXU`¯VV¯blK@LXKl„UV@Um@@Uk@kxWŽkbƒL@KkbmL@‚UXmaU@@l@x@blX@xUJ@bULUlULÇ@@VšnU`W@@nÛ¼U@@VmKUkm@VVX@@xǚ@bUbVb@VX@@x‚LUb@lƒ¼XLlbUlVVU„Ub@n"],"encodeOffsets":[[113671,34364]]}},{"type":"Feature","id":"4115","properties":{"name":"信阳市","cp":[114.8291,32.0197],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@VllInJlknJVkVU@mXlUÞ`VnV™VU@U@y„@nXlKV„nJVkXKWaXI‚b@yVk„VUkVwn@‚K@nW@k„KlUXVVUlbnUV`n@V_V@llX@@V„b@bV@@nlVUb¯‚WLnbmb@ŽnLnK˜b„U„bVWnLlaX@VVUX@Vln@`kL@ll@VXVJÈIVl@XÞJ°Una„LlylU@UXKlnn@lanLWWnbVI@KXKVL@LVWVL@UVKUIVWX@@XÆJ@In`@lJVI@a„WšÛnK@UlK@UU@VK„nlm„nXal„UllLUbVVšknJ@nV@Vm@a„l@@xnV„„lJVUU@™w@aƒk„@XW@_mWnUlŁUmVKV@VXwW»XƒWaUwnkWUkVUƒU@@@WlaUkkaƒIWVkm¯xmIUmƒLUVƒaUIó»m@mmwXk@a›mk¯¯l™@wƒmkLmmU@UbkUWJ@XUbƒJ@b@l@znÆmK@Xk@Ub@lm@ƒI@akmVKUUVUkU@U±JUbkƒ@IWmkxƒa@UUV™UWVkIUaW@UlLWn@VkJƒI@VkK@L@bmKƒkJmUUaUKWXk¼VxnJ@„V@@VULV¼ƒ@@UkaUlWL@U@W@IkKmL@KULUWULWKUXUJmIƒb—KƒŽƒ²UW™nWKUUkLUƒmUUam@UU™@ƒmUL@xkV@„VV@bmV@Vk@mwkUƒVUx@mbX‚ÇnVb„‚UL¯šWŽnUVLVb@xnlWnU@UVUVVUbVVlVkn@llVUXUWUXVbUJ@bmLUJnb@nVK@bl@@š@bVJUbnX@l„b"],"encodeOffsets":[[116551,33385]]}},{"type":"Feature","id":"4103","properties":{"name":"洛阳市","cp":[112.0605,34.3158],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@VVUllLXl@LWn@J„@bƒKUVmnL@`VblLnbV@„b@JmL@LnV@VV@¯„VJVnXL˜@nm@aÞ@‚a„k@m„IšmVbXL‚ynLšk°@°aVJnUV@UVVXk@WJ@VXLlUnJVnnƒ°U@»°U„wl@šb„WmUXƒÆ@VLXU@m@U„a@I›mkb™a@naWW@_@WXUV@@U‚ƒ²@„K@I±U@¥kKWLóLlƒa@£Um@kWKXU@mlLXUVKUU±J¯_@`UL¯Wmk@Wa„kkƒlUnƒVUVaU@KUU@mmK@_ƒa@KX@VaUIm±™k„aVKVUkw™@kaƒƒW@kbkL±UUaƒK@UUKVak£ƒ@UmmL@lƒIkmUƒ@Ualw@UƒJkbmIUmn@WKImWk@mUUnÝV@ŽnÝxƒKmXkxĉVWVk@kaċšÛ@WXƒJUV@zŽm„VWnbUbVbšLlUnŽ‚lUÒnWV—VWnk@@Vm@kxm@Un™l@Ll@@V@šXnƒškJV„šV@nlVXx˜U@l„n@aš@VLnWĊ¦nxš@lbVKXLl@ރVLƒ„XJl@XXl`lIXVl@Xl‚XUVšK„wV@lanx„zUbVJ@VVX@b"],"encodeOffsets":[[114683,35551]]}},{"type":"Feature","id":"4117","properties":{"name":"驻马店市","cp":[114.1589,32.9041],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@n@„b°UƂXnVlnLÜ@VLœm@n˜@na@J„„m@k„@lVšVxXX@„V`lLV„XVV@VVÞLVV°„²@lašbnxV@@b„Lšmlm„_VWnIWUna@lšLšbnV°ƒVL@KšV„LVUVaVLXK@mÆXna@wVm„a‚@Xw@KlL@a„@Va@wUkaWnIVƒla@Kn@Vn@VUl@nKVn„J@LnK@aVkVUUWƒ@VakUVanI‚²X‚W@UUU°KnUVLl@XaVK@ašU@KUI@W@_lm@KkLUKV_Uƒ@»@UVJ@XV@@mVL@K@U@Kk@VwUUm@kmWL@VkVkzƒKmb¯VÝI@WUkÇJUIUWk@@klK@_km@UVWUUW@kbmKUXƒaƒV—amLmK@namaXK°VakU@mU@@aƒa@UW@kkU@U`m@U_mVkaUVWUkVƒL@lmX@ŽLm@UxVlƒUUl@zaWJXbWLUlmIUƒkLmWƒ@@z@VUVUšUmÝ_kVWŽ@nUVUlmIklmIkJUkƒl@n@Lm@؃IUbm@UJUUVU@mmI@UU@k¥mUk@WmVmI@VU@klmLƒ™k@mbkKmb@WkƒKUŽVnUnnxšW@UVLUbmJ@bk@WbU@V„kx@V@bVbkV@V‚@‚—XWbUWm@kb„¼VLn„lJlb"],"encodeOffsets":[[115920,33863]]}},{"type":"Feature","id":"4116","properties":{"name":"周口市","cp":[114.873,33.6951],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@lšnb@xlJ@UnLlKXUlJl_„KnV@xVL@bkbVVUè@šWb@„Ubmš„ŽkšVšmbX„VJnUl@„a°@@b„LVbƒlXx˜InmnLVw‚anJÆw²IlmnXVl°VVbÈaVb„@lkn@VWnLlUVmÞUUklƒkƒVkUaVaVaUw™K@kkaVWmw„_„‚l@nU„VVb@b„aV@VV@zXJl@@kl@šlœk°WVnÆbnbUšVJ„Iš@VKVm@k™K@_kK@a@aU@@wW@@k@aUW@IUWVUnLlUlVXKVwmk@W@—VWa„¥@k@lnƒUIÇKUaU@ƒUUVmIUV™Uk¥ƒVma@¯k@Wanwmƒ„@@n@@m@UIVƒkUVamUXWƒaV™U_™@ƒmUVUImW@aUIĉK@VmI™b@lU@@n™JƒkU™@KƒIUmmLk@UVm@UŽm@@LkbU„mJXlbV‚@xUbƒ@@bkK@LWx@ƒbUn@xmbÅW@nWLUKUbUVƒK™U@LUK¯„mU@šVV@xULUŽVL@bU`WšUz¯aUamKUaƒ@@xkX@x"],"encodeOffsets":[[116832,34527]]}},{"type":"Feature","id":"4114","properties":{"name":"商丘市","cp":[115.741,34.2828],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@XVl@lLȃ„@VkV@V»UanƒWX@VaÆÇô@ÈaVX@xVJXUÞU‚aVLĸbXKl„V@šm°Vn_ny˜XX»mUk¥lK@a„_@yšInaVKVa°_@WXI@ƒ@K‚VnIlbnaV@„l„@‚a@_w@ƒlwUKm™Xa@UV@š»Vƒšw@kUKVUUm@w±VUXUKUwmJUUƒ@km@@±mXkmUI™@mm™KUwkbWakLWaUIkJmŽƒX@l@@VUX@JWbX@VbULWbƒlUVULknlV@bVJk„mb¯KknWmk@@nmVkx™@ƒVmU¯KUnUL™@ƒJUIV™maÅaUm¯X›l™kk@@lk@WI@yUUU@ƒb@aUaƒUmVk@ƒƒ`nxUXlb@lšLVxUbUbVbUll„k„VlÝVUnkVmKUXm@klƒ@ƒnUx@xnxƒn@`VX@V²x@V@b@„Wl@zU`VUVVb„L@Vƒb™W@bkXllkLWV@V„@VVÈwlVœ@@X˜K²Llb„WnnÆL@VnJWn"],"encodeOffsets":[[118024,35680]]}},{"type":"Feature","id":"4112","properties":{"name":"三门峡市","cp":[110.8301,34.3158],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@WKUmUI°ƒU@@UmU@KnK@IƒaU@makKUa@_‚KnmVU„L@a‚ƒ@IXm@KWkkKVkUU@aUW@UUIVaƒymwkbU@ƒx™LVUWWkk@WUkJk_WWk@WI„ƒUK݄k@WKULka™@mwĉ¥mXUK™@@bƒm@k—VWwkU@m™UUƒlI„™Wm@™@Uk@@KškVmn@lwn@@Ul@Xm˜UXUmVсkmkV™KUaVamaUXnƒ‚@ykLUKƒ@™WwKmKnUm@UmƒƒaU@mUk@kL@lƒxċxUnkVmnXxWb@`kzWJ@V—LmVUn™lmUL@lW@Ub@VšXUbš`VLUbUJ@nmnUlUUm@@bUJlnU„š‚U@lxkbƒ@@XƒJUnƒ@kb¯VVVmlXXlJlzn@VlkVW@bkK™bmškŽUbVb„lƒXVxšKÈnšwÞlĊKlšVnKlwX@lL@xlUnVn„@šl@lmX@ƄÈb°¼ÈwVJlx„_°xšašlšUÈxlUnbVxnL@lllšbm„n@nb‚@@V„L@V„@@„VLšJnIVVlKnV„_"],"encodeOffsets":[[114661,35911]]}},{"type":"Feature","id":"4107","properties":{"name":"新乡市","cp":[114.2029,35.3595],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@XVlL„K°bUblbUbšl@nX@W„XVVKVkš@@Žmb@„Ubn„W`kL„LƒV@VVLnKlVXIlVš@@a„@l£nWlƒkVa„@°bnUlLVlna‚bnUVUXKlU@ƒ@lk@a„I°y„@ôkUU@wšmôšnkWakml™UkVmkUlmUUm@nkUKWanamU„LXW@U‚VnUln„`l„œblL°KXV@ĠJ@L°„šJšUVw„anK@UUImmƒkK@¯±Um@IVmUmmÅnWaUK¯aUk„w@W±kVƒx™U™VƒwƒnÅJUIWaÝJóI—bm`ÝbÅImJUI¯¥¯@mU¯UƒJmnUVóUkl±V@zXl„bWVXL@bm„mº@@XmJUXU°llk„@nWJk@U„@¦U`m¯ŽWx"],"encodeOffsets":[[116100,36349]]}},{"type":"Feature","id":"4104","properties":{"name":"平顶山市","cp":[112.9724,33.739],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@l¤UbVL@V„LVb²VlKlaX@„„lbš@lxUVULƒbšln²VJUbW@@L„b@`nL@nVV@LVŽUbUVm„kVl„ƒlXbl@Xn°ŽVK@_°`²IVVV@VUVJnInaWK@Uš@„K„LÆ@nmlXXWVUUw@klKVa@knyVkVanI‚JXUl@XbVUl@@aša@mXk‚bnK@UlK@UUUVaXaWmkUm¥n—WmXaWaœkl@VmÞb„KVL@aVI@mUwVm„@KōméUL™KVaUk@kUK@U˜WXI@VlKXU‚@VVnInVV@VLlK@UUƒkKU_@ƒWWUwU™@klƒn@ƒƒ@Imb—@@m›nUKÛ@mKUkWVXxmbVLXŽVVU²VV@xÅnmWmLU@kbmJ@b¯š™IUb™JƒUUxVl@z@bU`W@Ub¯nUJUbƒ@WLUKULkU@aWKƒ@aƒbmL@ƒlmUk@@bUL™ƒWJUI™°@ƒŽ¯aWLk@mbUb¯b"],"encodeOffsets":[[114942,34527]]}},{"type":"Feature","id":"4101","properties":{"name":"郑州市","cp":[113.4668,34.6234],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@@nWVUKÅ@W„nVnI‚ŽV@œkƂšwV@šnn@lxÞlnôJ˜zXJl@nalUČVlƒl@²UlkôVVUnm„I°VnV°@°¦VJnIÆJÞan_VmU@ama™@kU˜¥kaUklw@UIV¥kVUI@ƒmmUÅmUlƒwVU@amU—JWbUakVƒ—Vé¯Im`ƒk—@ƒwVWmLkU¯ŽƒXkWmLmx@UUƒbm@@x™J@LbW@UUVWUkVKƒ@ka™IUamKUkkmmLƒUkJUVWXkWmnÅ@ƒKƒL™@@VXLmbmJUIUVU@ULWVkK@nWVXL@lVn@¤„b‚kôKXKlL@¦²V@JƒL±@„@VU@WV@X@`XXmb@Žšblaœn@Jƒb@V"],"encodeOffsets":[[115617,35584]]}},{"type":"Feature","id":"4105","properties":{"name":"安阳市","cp":[114.5325,36.0022],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@°kVaV¥kVmUkWkWVkVKUwkkmKUU@a„wWWXWakKWkXmlašIVmX¥ƒU@a„@WnK@kƒƒ™V™I¯ƒ@KğI@WU¯LkK›akƒƒ_kmmVU@VWXƒKnVmbXbVLmln@VVknlVUnVlkšlnXbmlmlXblnÈlWbn@@nšK@V„L„bVV°VVzšlnš@V™xƒI™b™ŽU@WLUa¯V™UkWõ@¯kkmxk¼l‚„XUlVbVLnlULmU@lƒLkVUlƒX@xW@¯mUƒ@UmIUW™L@aXa˜kU™¯anƒWk°@k™kKmmUIWaambUkkKmV¯aƒ@UblŽk„mXk¤ƒ@@b™@UbULWVnb@lUVVnmšnVVU„J@bWXX@WJkL@blVU°UV@XlWnXUbW@UVkVšVWbnLUJWLUK@Lnn@blVU‚„nUblxVUVJXU„a˜@Ub„LnUVV@mVIVVn@UbV@‚XbmbUV„_lVXUWanJVI@WkI@WVIVU°WXXl@la@mX@lLXl‚kVbœm‚X„ylIXJV@@kšKla²UVa„IVyÞb°LlVna@UÆKnLVbšK@anwU™"],"encodeOffsets":[[117676,36917]]}},{"type":"Feature","id":"4102","properties":{"name":"开封市","cp":[114.5764,34.6124],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@lUVbXa˜InV@bUV„x‚knVVÆnn@„VJlUU¦VJ@kxVllb—¦lVš@nb@bVŽUn˜aôJÞIXbVJÆI„m„xšUšV„w‚U²l@XƒxVl°bVLXb‚`XklUnmVblLœ@lmšx°LVK@UXIVašWlL@Ukƒ°KkVaVUXmmI@UÅKmmƒXka±K—L@W›@kUÇxUUƒ@@UXUlKkklW@ašX„a@UƒKUaVUUV_@yXk@ƒ@a@U±w@UUW@_„mmw@wVw„mUaÇbUa¯UUkmWkn±JÅxmIbUxmKmn—JWw„kUaƒK@a¯@ƒbk@mVUIWƒ—Lmwm@Ua@WJUb@LUl™@UUmLUbWJ@VL@VmXWWzUJUꄘ"],"encodeOffsets":[[116641,35280]]}},{"type":"Feature","id":"4108","properties":{"name":"焦作市","cp":[112.8406,35.1508],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@V@VL@x@bXŽWV@XkššlUŽWX@J„@nI@KlL„KšUVaV@œJlL@KUk@KÞL‚l²_‚@nWlL„UVVš@nLWVUJVn@anV@a„wÞUVLVx„b„@lW„@lbXn‚Vn@@¼šL°mšKVn@bnl@nVK@blb„L„W„U@VWLXV@nlKn@lVVbXw°nV_@¥Vƒl@XI@mlƒkkV¯VWnI@W‚@n¹nƒ@aWKXUƒaWk@yk@k„ċUkVmbk@WI—yóImÝkkwm@™mU@™xŁ›lU@mJƒX™ak@ƒx¯V@¼¯Vm„UmmIkVWK@UXIl@UWVUU@mVUI¯b¯@™lmKzWKUa™nƒJ@nƒlbÝ@@b"],"encodeOffsets":[[114728,35888]]}},{"type":"Feature","id":"4110","properties":{"name":"许昌市","cp":[113.6975,34.0466],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@lI„VnKlnVlnLVbšJlb„@ULVlUXVVX@‚a@KšI@wn@„aVV‚@nwnKlX„W°lVnKUX„x˜@„ln_°JVIXy‚XnW@U‚K@UXIVanKVVš@Vk@KVaXI‚@Vbn@nx˜KnaU™l™ƒn™Va@ƒXa@™VçUUla@aUK@wmUƒLk`kIWVkLmK@V@XUlƒn@JXV@nm„™bU‚óIƒmUa±@@ÑóVUUk@UlKVU@akWVUUlUUaUK@UUKWbUkÅJ@XWaƒ@XbmJ@nUJ@bUKƒLÝaUnk@›lXbWbXnm˜n¦lVXnWbUbVV@VkL@VmLaWl@n™b@bk@UVWak@WVImJUbUlmz@lUbkL@lVx"],"encodeOffsets":[[115797,35089]]}},{"type":"Feature","id":"4109","properties":{"name":"濮阳市","cp":[115.1917,35.799],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@lLXbW‚XXƒx@bVVnLllVxULUl‚XXlVlUnlŽU¦Ub¯l˜nœK@V‚bVb@šXbVL„KVxVVnIlašb„a„¥lU@wnalLnVVlVLXnlWVXn@@lVI@WnU@mƒÅW¥—aW_k@WwXy@kmƒ@wU„mš„š¦šlUxVLV@UwšJ°xš@VX„@Vb„@š`VX@VX@llšIVbnJlI„bšV„l„˜J@ƒmѯLóa@ƒƒKUa„k™ƒ™Xƒ@UK@wU@ƒlWUUݯImW¯aƒLUKU@ƒkƒ»k@mƒwƒa@UnKWI@ƒUU@akVWK—k@a±ƒbóUWKXUmk™KUmLƒbUx„„@lmLXŽƒ@@b„VW¦Un™JkbWnXl"],"encodeOffsets":[[117642,36501]]}},{"type":"Feature","id":"4111","properties":{"name":"漯河市","cp":[113.8733,33.6951],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@@Lƒ‚UnVxnIWa„@Xb@WÆIVlXaVL@VVLVbkVVŽUVlX@bUVkLV‚l@VVôU@Ò²@Vb„nôJVšanƒ@mWU@I„mVk@WkI@wmak™@wlW@w„@VbnLVb°bVyX™V_@aUKVVK@wUU@™™a™K@kmbXVmJUXƒ`kn™nƒK@aU@mw™akb±@¯ƒUUÝKUUU@WU@VkLUKU@mUmJUU@WVkL@UWJ—X@VVL@lVlUbšLVKnêƎ"],"encodeOffsets":[[116348,34431]]}},{"type":"Feature","id":"4106","properties":{"name":"鹤壁市","cp":[114.3787,35.744],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@ó™™n@xVVólƒ@¯zƒJ@bkl@@„kVWLUVmVXbVJnnlLlš¯@Xlm„°bVš—lWb@bšKVXnJ@VV„°nX@@w„WVklU„K@knVVKmkUKUaVkƒWkl»nwlŽ°lö@lXšV°UVbXKV@šša„Jšw@Um™™kUy¯UUUƒaƒK@U™L@mm@XaÇkkmWank"],"encodeOffsets":[[117158,36338]]}}],"UTF8Encoding":true}; }); -define('echarts/util/mapData/geoJson/hu_bei_geo',[],function() { - return {"type":"FeatureCollection","features":[{"type":"Feature","id":"4228","properties":{"name":"恩施土家族苗族自治州","cp":[109.5007,30.2563],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@VK‚bX@lbUVnL°„@VlVnUl@VUX@„aVƒmaXƒlašUUU@wmaVUn@Vƒnmmk@m™U@kna™aU¥Vam™X_@WƒU™mW@_kƒVaVKnL‚lœ@VVal@k¥@kUW@kUKVUlUVсW@kÇaU»ValmkUVUVak™@aƒV¯_@W‚UkmVUlU@aœƒƒalI@akkVWUaWXUWwœWVbÆ@„„l„alIVK@U™m@UU„W@al²a‚¯UağÇm@ƒbkk@wƒ@@W™aULmxƒIU‚™ƒb¯@U`UX™JmL¯aƒKX›WUL@aknmK™@aWUXaWm@I@UÅmVU@™™aUV@b™VƒI@WkU›bXkm@VakwUKULWKXmJ@XUK@ƒmL@KUwVaUI@KU@mmn™mXka@»V@@UUaƒw¯yVk@ƒUUVmmkÛÈU@mWUnmx„šmlUbV¦UlbWVUL@UUƒ™IUmÇKV„VbUVVxkn™LUxV`VX@š„„kJVVUXWaUVVlUnmKUbkI@WULmK@L@LVlƒLnmUIWV@aknƒ`VXUJIVlUVVbUX@¤mbnLm‚m@UXk@mm@Ukaƒ¥@kV@@KkU@aUKWbkLWVkIVŽk@UbVlmX@bU@@mmL@bn`@Ln@llVLVk„@XVVU@`VXUš‚¼k`VULka@VllVIn¤VU@@bl܃bkx@bkL›škKƒn@bn@@b@JUnV`UnVbVKlVXUlbn@°ƒVx„@@b„nVbUllVn@V—VK@UnW@UVUšlnk‚VÈޚxVb„VVI„xVaÆ@@aka@UVaU@@a„k@Wl@nbVIƎ@Jk@„L@VlXnlla@VJnw@UmwXU@aVK°ÒnllnLlb„xnKVaV@l¦²nVl@llL„x@XVVœ‚Ķš@našx@U@al™XUVa‚LÈþV°XxWXkK@šmLnlUb@b‚xnLVlVVkb@UJ@xWXXš"],"encodeOffsets":[[112816,32052]]}},{"type":"Feature","id":"4203","properties":{"name":"十堰市","cp":[110.5115,32.3877],"childNum":9},"geometry":{"type":"MultiPolygon","coordinates":[["@@@a@w@kV@nbVK@ƒnUla„@la„Ål@nlVakwWX@WkLšaVmšwV@anK@UlIXmWkk@@mmLkWlwk@U_mKXwWK@U¯K@UU@ƒVUa™kmƒkI™yUUVUmanU@mlwkƒ@_mWXaƒUWU@ǃ@U@aUaVwUKUIƒVkK@UWIXƒmaV@k@Vm@UnwlƒUamk@V@„ULUamxUJkU@Iƒ`WkkK¯XWak@@W@IUV™LWJkXkaÇVUKƒ@kUmbmUUƒUKƒbkKWUkI@ƒkKÝ@@aƒUm»nI@mƒU@UnWV_@aUmWbkLUl¯b@a›kkk@WkkJm_k@UV±@J@b›nU@@WÝIUJVbXL@nlJkx@„Wn@VkJmb—LmUƒ`VbUL@xVn„@XVƒŽ@„mVVnnJVbU„ƒx@„V„nVUbVVƒx@šn„™bUK@bƒ„@bƒJ„šm²„VU‚lbXzVJV„„JVbn@@Xmb@V@bVJÈ@‚Vnkn@°aVVV@šX„KnalLVmšUnnVKVlnLWlXX„Klk°š™šXŽWškLUVVV@nU@ml¯nmbk@W`Å@mb—LWm¯UƒxnêVèk@mbƒVƒnUK™@kKmXk@@JUI›lÛLllnbVnlJ@LULnlÆaVLnŽV@nkVJ„@lkô@²bÆm°w„L„WV@VXšKšVXI@W°ÆVšK„b°U„JVIVV„¦XKVL@l‚InaVÝnUl@@bX@‚™nmVL@lVL„lVLVUnbVW@xXn˜bœU°¤V@š™„a@kWKUUn@VlnL@UV@Ü»@mX@V_ƒakaÞ@VK‚¯@kkW"],["@@mUkUUm@nllVKXXVK"]],"encodeOffsets":[[[113918,33739]],[[113817,32811]]]}},{"type":"Feature","id":"4205","properties":{"name":"宜昌市","cp":[111.1707,30.7617],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@°`„U@blšUbUVlVkn‚ŽUbV¼Èb@l‚XUÒkVUVVL@lVX@ll¦k@UbU‚›@kmKULUbl„@`nXšŽ„V@XW`nšUbV¦šbmb@lšV@nnlmnU„m@UVnb@xVV™VkbW„nb‚VnVa@an@UaVU‚JXnWlXX@l„¦@ŽlKÆX„bX‚V@VV„@°¯°xXx‚XV@nV°UVWU_VWXkmaVnWVkn@lln@lb@UVLXWlnX@˜aXUmaVK@UXU„U@WVI‚W„XXV‚U@¥VKœ@‚Uގ„„‚a²LlV@kV@UanKma@UVUnK@UVLXyVL‚knJ@UV@@UXKWUXaV@Vb@mVLnKW„m@aUUm@@UkK@Ula„LXKWaXI@alKlmUk@wVKXL@m@WWn@UVa@K@wna@aW_XWWkXbVW@k@U¯WWwka@UUaVIVƒkU@m±@U@@wVKkaš_@VV@XUVwU¥‚šyUkm@V±ÈUKk»ÇL„m˜mLk@ó£kmWwƒm@U„IkWKXwWU@ƒkLƒwkbmaƒbkK@VƒLkmWIUKkUUƒÇIǫJ™XÅJULVŽÇLUVƒ@UK™@kI@WVI@UaƒWmXVVUL`±kÅLmKkƒƒkƒÅ@Ua›XXxWVXŽVbUXll@bkJ„b›„@bkVUVlnV@X"],"encodeOffsets":[[112906,30961]]}},{"type":"Feature","id":"4206","properties":{"name":"襄樊市","cp":[111.9397,31.9263],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@@Xl@Xb°WlLXl„_@JlVVInwVbVK@ƒ@UnlVbk„mx@VUnl@U@nbW„XJ@VlL„UVJVLUxVb@b@VȄ‚@XV„VWbnX@`l„kx@nmVnbUVVVšzlJn„šlVb„UV@@V°L@VXLWxnLV`l@kxlXnK@nl@XlWn„`Xnl@@UVa@VÈKš£VLVanW°U@UVU„@„`VIn‚mV@„nV@Xa@aVW@UšalkXKšblI„yƍXnlJXbl@@VV@nklU@`„nVK„LVKVb@V„U@UÈK„UVKšIlUX@V`lIVbn@nblVVmV@@XXJšUVV@knKVn@`@X‚VnK„wlLVmUUU@ƒU@aXL@WlU@UUW@UmU@KkLWaXkWmXUWm@U@ƒnk@UmK@U@UaUVUUKV_@al@namWUI@KUƒK@aV@WUIƒbƒ¥ULUJkIm™ƒK@U@K™V@U@a@UkU@K@wVaUwlU@mUƒULmKUkV@@anIWmUK@I¯„mKkl@LUb±lUakLmk@WwUKÝVUIm`¯n@Uk@makJU_@ƒƒJma¯ImwUVkKƒb™aUÅ@wWaU@VU@mXIVmmUkJkwm@mIlUKWzUK@VmLUV@VnbmLVbU@@lkU±KbƒƒÝV›@UL@¦VWUƒWXUJ@XƒVWV@VULnbWV—bW@kmWXUK@Vkam@kkm@UlmXUŽnbWlUXV`UX¯VmUU@Ul@Lll@nnJ@LƒnWmbmš@b™`ƒš","@@kUUm@nllVKXXVKmU"],"encodeOffsets":[[113423,32597],[113794,32800]]}},{"type":"Feature","id":"4211","properties":{"name":"黄冈市","cp":[115.2686,30.6628],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@VVUnWVXnVJ@„‚U@V@VXŽV@@IVJUnŽ@V@L@KlIVlVanLVbnVlI„ƒn@@a@Kl@@I„JlI@aXU@KlK„kVblJXU„VlU@V„bVkVKXn@VlxVa²I@VlVUxln@bšJXklaVWnLmÅ@y@k@ašI@W@aXIlVVaV@nnlKnLVW@IUa@a@K„UVVlI@wXKVV@IUƒla„@lUXwWƒnƒnalLlxXLll°@XwVKVaXIl™nb˜@nln@Va@U@k°ƒUmÆUVaXI„JV¯ÇUmmkU@WaKmakVm@U@aVKkkmKkVmIkÇ°£@aUUVaVVnKlkX‚mkƒ@ƒlUVaX@@Um@‚™UmlUXV„UVU@w‚K²¥Ua@I@UV™l@U™V±UIUÇ°»VkUmVI@a@U™m™ĉ™¯V±bŹĖğaÇL¯lmŽkX@‚óĀ@ŽmšÝêb±WkLƒn@xXx@Ž@b@V@LW@UbƒlţXƒ`kxWnXô¯¦ÆV@L@JVLƒxkK@V@bkz°l‚lXz@J„UlVla@XUV„bVKXnW`XXV@laVV@V„X@V¯xƒx@xULVbUJ@n@LU@VmmakbUK@b™IWWUUVkUmkLm@VJkb@nUJƒ@`V@kX™aUaVmmLkUmJ@Uk@U„±lkzmJUb@b„VUxVXU¤ƒL@JƒX@VlL@JkLUVU@mnUl„¦@V"],"encodeOffsets":[[117181,32063]]}},{"type":"Feature","id":"4210","properties":{"name":"荆州市","cp":[113.291,30.0092],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@ÈJV„lVVLXJln„K@UlL„anbla„xlK@„XVWxXLlƒJ@V„nXxlnô¤l@nKn—‚ƒÈKl¼VL²Ç‚Un@Vl™zŽV¦UxWVU@@U™`lbUL@xV@²@@nlVU„UJVb@VlbXx°XVWX_VKUwVKVa@UVKUUVk@KnblaUU@wnWl@UX@lÆ@@a„IVmUk„™šxVJ„U„bܙ@Uk@WWnk@Vƒ„™Vm@I@m@Un@m™XUlVlUnJ@knJVU°@@aÆLX@ƒllL@¦nJV@XblLVa²U@UlWš@VX@`@LV@@bXJlIXml_lJœU°b„KÆLnVVl‚@ö—Vƒ‚mXaVIĢllUlVnLVlX@@b‚ašnnxšV„L‚bn@°ÆXmmkĉƒ¯w±™™™Uċ@KÝÅƧŃÝ癙Uw¯ƒm™¯k@W‚kV@¯UIUJW¼kb™Uƒwk@W`@¦Uônb@VƚlÈ@VU@ƒƒ£UWWnUÆUnmJkUÇ£VWUI@aUU@WkI@Uƒa@JW@k£kaWVUKmnkKƒb™kkVWb—VmUUmwU@kk›@UakUUa@V@nlx@lUb±lUbnnWLUyk@UamœUK™@mlk@Wb@VXL@x@xWI@a¯Ž¯V@bVn@LkKmL@`XmKmVU@@bkL@V±bk@Uaƒa™L™KUVƒIƒ„™W™XamVVbUK@b@Lm@UWkxULWVUnm@UlUX"],"encodeOffsets":[[113918,30764]]}},{"type":"Feature","id":"4208","properties":{"name":"荆门市","cp":[112.6758,30.9979],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@n@lxlInVUnWJ@nUVV@Xb@xVƚb„alLVUnx°Jnb„I@„V`lInbl@@V°mn_VJÞUVLXx‚@nllKVb²kVa@KlknL°ƒ@JVLXnmJ@bU@VlnLVKV„@nX@lUšKVaXal@VKn@¥°L@Unw˜bnašV@KV@VUX@lVXI@KW@@IXWV@laVL„„KlaXUVVnkVWV@lwXblIXWVkVmšaU£VaUmVIkU@y@WakKUamU@UUK@kmK@w@@mK@LƒV¯™U@WwkmULƒamVVUU@ƒƒIƒbUKUa™kmƒm@UakLmxU@UÒWlULţÿmwkIUm@a‚kÈblW@UVƒUUk@JW@XkWWUkUKUIlw@aUWknWUUmnIWƒ™aUwVaۚƒaƒVUI™wƒšVlUnƒJ@bÅ@@kVWk@mX@xVVkbma@LUlVVUL@VUbULVxULW`UX@V@lUXWaXlWXX`@bmb@x@LUb@VmŽXX@‚@nWKUL@xVlknkL@bWJXbWLƒKkb@VlL@Vn@VV@bƒnX‚mLUK@nUaU@WbXVWL@VU@@V"],"encodeOffsets":[[114548,31984]]}},{"type":"Feature","id":"4212","properties":{"name":"咸宁市","cp":[114.2578,29.6631],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@ÞƂLČ@šV‚š²š°xĊ„nlWnŎ¯m@aƒK@„„°‚n„Jšwn™VIUaÆJšÅ@wšwV™XW@aV_l@²V°lĊwlaXLšwlUkalVVaX@lVXI@a˜UXJ@U°UU¥VIVKVklanLVa@VÈIVV@nk@aVa@mV_@a„K@klKUa@UnKWk@@lU@@UW@@nUWUwmaVIXƒ„lV@mLXblJ@kV@kk@KU@WƒkUWVÅwkLmW@UmL@lUL™KULƒak@maUUÝwUJƒIb›KUUƒ@š™aWK@kUWVkUwVw@™mÝ@™I@wkW@a›ww@LU¥™kƒJ@nVJƒIkVVnkV›UkyUIUl@xWUkaW@@°kz„ŽWxkLUWmzk@@bVVVš„b@‚@XlVœ@Vl@bVbUn™`Wn—@Wb„VVI@`„LVbXLV`mnU@@lƒL@LUŽƒak@ƒLk@WbUJn¦@lVb@xVb@n"],"encodeOffsets":[[116303,30567]]}},{"type":"Feature","id":"4213","properties":{"name":"随州市","cp":[113.4338,31.8768],"childNum":2},"geometry":{"type":"Polygon","coordinates":["@@„@nš`lw„k„ƒ„UmUVWX@lk„@VanUĠ¼V@@mX@@nVV‚VXLmJVLnK@b„V@@J„@VUn@VaVUUUVWVLV@@Kk_@almaVkUU@WVƒVUVLXmmk@wUaUKUV@°™@kmaUaÈmW„mUƒVklaX@lVnxl@@UnaUk@ƒVUVwVK„nš@VVn@VbVJUknUmmVmk_Vw„KUUm™Vak¥@UVKVIkW@UmIVWkIVƒkmmLkwmVUƒ@LƒUU@VVXL@JmLUbmK@UUKmkKUUmVUaUnÇlk¯™mJUnmLUaUJUaWL@UkJ™ƒUƒ@ƒaklkU@¯@KWLUmUUWVkbƒLƒŽUKkbU@WX@JX@@LWJkUW@UVU@@L™Umb—amx@V¯K@¦mŽULk@WbUb™LkVW@kVVxUb@x@LlV@V@b@VšU@L@V„LnšlJVIVK„¦„aVJ@XUŽ@b„LV‚@LVJnXmbk@@bU`VLUVV‚b@V@VnL@Vml@„@VXnWVXnWlXblK@LnV@VVX@VkV@XWK@b„VV@VV"],"encodeOffsets":[[115830,33154]]}},{"type":"Feature","id":"4209","properties":{"name":"孝感市","cp":[113.9502,31.1188],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@VnXK@L@°lVlk„b„@„VšlI@VXKVbVIVbnKVmnI°šlŽÈkVmVbnUVVlLnVL@VnLVanK@IWKUUV@„V@KV„nUlxnKlnU„lJUXnJ@VlXUJUL@Vl¦UbnšVVƒLUxl`UnnnmVVlnVK„bšmVX@a°Ý°LšaXJV@VUnKVXVK@LnKlLUbVVX@VwVJVn„@@UU¥V@@UUK@ƒmaUVUkkJ@L@K@UmVUI@JU@W@U@UV@ƒUIWmXUVmUUÇ@UVmIlmnmakK@akaW@UwVUkKVnUlKVwk™ƒVU_WKUkVW@UXaWkUa@w@VU@XaW±@IkbƒKƒb¯L@WƒXkWƒ@UakL@UV@UmVUmL@UXWVL@ašUƒVUUUVU@yUUƒIUa@wUKWVU@kƒ™™Wk¯UkwVKƒLUx™K@nVxUlUUWVUmw@wƒUUyXWlX¦WbUV@„U‚@blbUVVbXXƒl@lVL@bk@lxkVVnVx™¦ƒ`UnkL@V@L@Ž‚@@xnL@lVL@VnVVblLXb@‚@zlVUJVnUbV¤™bUnUlWXkJWakxU@UXml"],"encodeOffsets":[[116033,32091]]}},{"type":"Feature","id":"4201","properties":{"name":"武汉市","cp":[114.3896,30.6628],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@nbnm‚knJVUÈ@@Uƒ¥VknmV@VUlK@IkK@U„W@I„KV£UWVwƒU@aVanIly²kVƒl@@VnIlVnKUnVbšblWU@@_„‚VI@mlaUIn@lKVnUlVVXXšJ@aVLlanbUnV@@K@mVIUaVK@w„w°w@UƒW@UUUkbU@WWX_WmULƒaVU@WkbkUƒV@IWyk¯kly@a@UlL„wUK@I@KÅUW@ѱUm@wl¥kaƒ@@_Vw@ķƒa@akw@ƒkKW£XVUVwVwUaU@VUU™™xWKkbĉx¯k±Uk@U`@bWXUš™x@x™ÆÅIVbUJmš™xƒImƒ¯@ƒ™Umx™nUVVbnJV„@Lƒ@@ŽkV@bVnƒ@UVULlx°VXlššl„V@XUVL@xVb„JVV@zUVVVUV„™V@bUKWX@VnKUVVnU@@VlKVb„@lX„W@X°K„a„Lla@JX²Wb@ŽUV@@xVbXlWb@VUXVlXLV`Uš„lŽUxkLmVUŽlLUVVxX@lb@blL"],"encodeOffsets":[[117000,32097]]}},{"type":"Feature","id":"4202","properties":{"name":"黄石市","cp":[115.0159,29.9213],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@VšUVV@VbUx„aWUœblUVmnKlX@bXJVIlVUxVVVIU‚zlx¯š@‚VbnL@x‚x@UVaXK„b˜@Xk‚WU_Vm²klW„XVK„Žl@nXV@@w„mlK²X‚aÞén™@ôÿ@lWn°kUKmmUљUmm@ƒwkImWU@UakL@bVLUVċ@™bUK@alIXKWK@™nXnKmkUVwƒ@¯b@L„lUL±W™n@KULUaW@kL@lƒL@bU`@nUb@bmlU@UÇJ@UUbmKkblŽUULUJV¦¯V@VWI—V@bWJkUW@UbkUlbkV"],"encodeOffsets":[[117282,30685]]}},{"type":"Feature","id":"429021","properties":{"name":"神农架林区","cp":[110.4565,31.5802],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@n`lIXll@lœl@b°aVklKXaVn@bU`mX@V„V@nmJn¼„V@bÞ@lL@„lJXVlL„aVLV„nVnalV„@VLÈUlblWXIšKVU@J„™š_‚@an™na‚X„m@KmI@mkk@KVkWWw¯w¯°ƒ@UUU@WƒaÅWkL@ƒ¥@kWWXkWmIUVVbm@@bUbmUU„ƒbW@UVk@mVkU@U¯ƒmKVUkaW@aULƒÆVbƒb@VÅ@Un@VƒLWl¯Lš„"],"encodeOffsets":[[112624,32266]]}},{"type":"Feature","id":"429006","properties":{"name":"天门市","cp":[113.0273,30.6409],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@@K@UlKVm„_š¥UwUmlUkwl@@aUK@k„kWWUaVUka@aV@ƒVUXaW¥Xk@WWIklm@ÅxmI™VÝUkxkaƒ„@bWJaUL@„W@™l¯UULU‚ƒbƒkV™Ua¯bm¤UnÇUkmUšUx˜b@VkXÇal@bVnlJnxŤĀVKXkVÑV@nwlKVbn@n„šlVbVL„a„J@„VV‚UnU„bVKlnXxV@°š„U@KnL"],"encodeOffsets":[[116056,31636]]}},{"type":"Feature","id":"429004","properties":{"name":"仙桃市","cp":[113.3789,30.3003],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@VK°VškX@@ƒVK‚bXI@a„ƒlblwÞVšUnJÆwn@lkXJ@X‚WVz„V@xnx‚VXUVVVkUw@mšLVw„KVU„@Um@alU@„@@KUƒmIUaVUšmnwmw™mb@aW@UkmKkUkVġkUJWbnU„õ˜@UkmUÅKƒL¯a›VkIk`WnkJƒ@xVLUVVbUbk@WlXbm„VxnxUblbUV™@@VUV@nVL"],"encodeOffsets":[[115662,31259]]}},{"type":"Feature","id":"429005","properties":{"name":"潜江市","cp":[112.7637,30.3607],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@UbVxšbX„mJVnXVlmVX@bkxVJVLVlXXWlX@@IVl„V‚U—aVwV™lnÈVVmn£°aVbUš„l„aVUK@mVU@Uš@VUkaVamwUwnƒWaXkl@VaUaVUUK@w„WI@aU@@K@_UW™@kX@V±VUbkKWaU@mI@¥kK„kW@ÅK@b¯@UVmI@lmIkVkUWVnšm@@V@n@JUnƒšU„@ŽmlXXl@@V"],"encodeOffsets":[[115234,31118]]}},{"type":"Feature","id":"4207","properties":{"name":"鄂州市","cp":[114.7302,30.4102],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@°¥WóXmlw„_ŤW„kVaX@@K@U@a@WwU@mWk@ƒULƒWkX±lUnV`XWl—@ƒaWLUb@Vw@wmKUa@°™kw‚yVUJUUVwkUUJWI@akWmLUnkV›aXVƒbUxUVWX¤lL@„lx@b„b@ĸUx@`„@lbk¦@x‚n²VƄX@"],"encodeOffsets":[[117541,31349]]}}],"UTF8Encoding":true}; +define('echarts/util/mapData/geoJson/hu_bei_geo',[],function() { + return {"type":"FeatureCollection","features":[{"type":"Feature","id":"4228","properties":{"name":"恩施土家族苗族自治州","cp":[109.5007,30.2563],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@VK‚bX@lbUVnL°„@VlVnUl@VUX@„aVƒmaXƒlašUUU@wmaVUn@Vƒnmmk@m™U@kna™aU¥Vam™X_@WƒU™mW@_kƒVaVKnL‚lœ@VVal@k¥@kUW@kUKVUlUVсW@kÇaU»ValmkUVUVak™@aƒV¯_@W‚UkmVUlU@aœƒƒalI@akkVWUaWXUWwœWVbÆ@„„l„alIVK@U™m@UU„W@al²a‚¯UağÇm@ƒbkk@wƒ@@W™aULmxƒIU‚™ƒb¯@U`UX™JmL¯aƒKX›WUL@aknmK™@aWUXaWm@I@UÅmVU@™™aUV@b™VƒI@WkU›bXkm@VakwUKULWKXmJ@XUK@ƒmL@KUwVaUI@KU@mmn™mXka@»V@@UUaƒw¯yVk@ƒUUVmmkÛÈU@mWUnmx„šmlUbV¦UlbWVUL@UUƒ™IUmÇKV„VbUVVxkn™LUxV`VX@š„„kJVVUXWaUVVlUnmKUbkI@WULmK@L@LVlƒLnmUIWV@aknƒ`VXUJIVlUVVbUX@¤mbnLm‚m@UXk@mm@Ukaƒ¥@kV@@KkU@aUKWbkLWVkIVŽk@UbVlmX@bU@@mmL@bn`@Ln@llVLVk„@XVVU@`VXUš‚¼k`VULka@VllVIn¤VU@@bl܃bkx@bkL›škKƒn@bn@@b@JUnV`UnVbVKlVXUlbn@°ƒVx„@@b„nVbUllVn@V—VK@UnW@UVUšlnk‚VÈޚxVb„VVI„xVaÆ@@aka@UVaU@@a„k@Wl@nbVIƎ@Jk@„L@VlXnlla@VJnw@UmwXU@aVK°ÒnllnLlb„xnKVaV@l¦²nVl@llL„x@XVVœ‚Ķš@našx@U@al™XUVa‚LÈþV°XxWXkK@šmLnlUb@b‚xnLVlVVkb@UJ@xWXXš"],"encodeOffsets":[[112816,32052]]}},{"type":"Feature","id":"4203","properties":{"name":"十堰市","cp":[110.5115,32.3877],"childNum":9},"geometry":{"type":"MultiPolygon","coordinates":[["@@@a@w@kV@nbVK@ƒnUla„@la„Ål@nlVakwWX@WkLšaVmšwV@anK@UlIXmWkk@@mmLkWlwk@U_mKXwWK@U¯K@UU@ƒVUa™kmƒkI™yUUVUmanU@mlwkƒ@_mWXaƒUWU@ǃ@U@aUaVwUKUIƒVkK@UWIXƒmaV@k@Vm@UnwlƒUamk@V@„ULUamxUJkU@Iƒ`WkkK¯XWak@@W@IUV™LWJkXkaÇVUKƒ@kUmbmUUƒUKƒbkKWUkI@ƒkKÝ@@aƒUm»nI@mƒU@UnWV_@aUmWbkLUl¯b@a›kkk@WkkJm_k@UV±@J@b›nU@@WÝIUJVbXL@nlJkx@„Wn@VkJmb—LmUƒ`VbUL@xVn„@XVƒŽ@„mVVnnJVbU„ƒx@„V„nVUbVVƒx@šn„™bUK@bƒ„@bƒJ„šm²„VU‚lbXzVJV„„JVbn@@Xmb@V@bVJÈ@‚Vnkn@°aVVV@šX„KnalLVmšUnnVKVlnLWlXX„Klk°š™šXŽWškLUVVV@nU@ml¯nmbk@W`Å@mb—LWm¯UƒxnêVèk@mbƒVƒnUK™@kKmXk@@JUI›lÛLllnbVnlJ@LULnlÆaVLnŽV@nkVJ„@lkô@²bÆm°w„L„WV@VXšKšVXI@W°ÆVšK„b°U„JVIVV„¦XKVL@l‚InaVÝnUl@@bX@‚™nmVL@lVL„lVLVUnbVW@xXn˜bœU°¤V@š™„a@kWKUUn@VlnL@UV@Ü»@mX@V_ƒakaÞ@VK‚¯@kkW"],["@@mUkUUm@nllVKXXVK"]],"encodeOffsets":[[[113918,33739]],[[113817,32811]]]}},{"type":"Feature","id":"4205","properties":{"name":"宜昌市","cp":[111.1707,30.7617],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@°`„U@blšUbUVlVkn‚ŽUbV¼Èb@l‚XUÒkVUVVL@lVX@ll¦k@UbU‚›@kmKULUbl„@`nXšŽ„V@XW`nšUbV¦šbmb@lšV@nnlmnU„m@UVnb@xVV™VkbW„nb‚VnVa@an@UaVU‚JXnWlXX@l„¦@ŽlKÆX„bX‚V@VV„@°¯°xXx‚XV@nV°UVWU_VWXkmaVnWVkn@lln@lb@UVLXWlnX@˜aXUmaVK@UXU„U@WVI‚W„XXV‚U@¥VKœ@‚Uގ„„‚a²LlV@kV@UanKma@UVUnK@UVLXyVL‚knJ@UV@@UXKWUXaV@Vb@mVLnKW„m@aUUm@@UkK@Ula„LXKWaXI@alKlmUk@wVKXL@m@WWn@UVa@K@wna@aW_XWWkXbVW@k@U¯WWwka@UUaVIVƒkU@m±@U@@wVKkaš_@VV@XUVwU¥‚šyUkm@V±ÈUKk»ÇL„m˜mLk@ó£kmWwƒm@U„IkWKXwWU@ƒkLƒwkbmaƒbkK@VƒLkmWIUKkUUƒÇIǫJ™XÅJULVŽÇLUVƒ@UK™@kI@WVI@UaƒWmXVVUL`±kÅLmKkƒƒkƒÅ@Ua›XXxWVXŽVbUXll@bkJ„b›„@bkVUVlnV@X"],"encodeOffsets":[[112906,30961]]}},{"type":"Feature","id":"4206","properties":{"name":"襄樊市","cp":[111.9397,31.9263],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@@Xl@Xb°WlLXl„_@JlVVInwVbVK@ƒ@UnlVbk„mx@VUnl@U@nbW„XJ@VlL„UVJVLUxVb@b@VȄ‚@XV„VWbnX@`l„kx@nmVnbUVVVšzlJn„šlVb„UV@@V°L@VXLWxnLV`l@kxlXnK@nl@XlWn„`Xnl@@UVa@VÈKš£VLVanW°U@UVU„@„`VIn‚mV@„nV@Xa@aVW@UšalkXKšblI„yƍXnlJXbl@@VV@nklU@`„nVK„LVKVb@V„U@UÈK„UVKšIlUX@V`lIVbn@nblVVmV@@XXJšUVV@knKVn@`@X‚VnK„wlLVmUUU@ƒU@aXL@WlU@UUW@UmU@KkLWaXkWmXUWm@U@ƒnk@UmK@U@UaUVUUKV_@al@namWUI@KUƒK@aV@WUIƒbƒ¥ULUJkIm™ƒK@U@K™V@U@a@UkU@K@wVaUwlU@mUƒULmKUkV@@anIWmUK@I¯„mKkl@LUb±lUakLmk@WwUKÝVUIm`¯n@Uk@makJU_@ƒƒJma¯ImwUVkKƒb™aUÅ@wWaU@VU@mXIVmmUkJkwm@mIlUKWzUK@VmLUV@VnbmLVbU@@lkU±KbƒƒÝV›@UL@¦VWUƒWXUJ@XƒVWV@VULnbWV—bW@kmWXUK@Vkam@kkm@UlmXUŽnbWlUXV`UX¯VmUU@Ul@Lll@nnJ@LƒnWmbmš@b™`ƒš","@@kUUm@nllVKXXVKmU"],"encodeOffsets":[[113423,32597],[113794,32800]]}},{"type":"Feature","id":"4211","properties":{"name":"黄冈市","cp":[115.2686,30.6628],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@VVUnWVXnVJ@„‚U@V@VXŽV@@IVJUnŽ@V@L@KlIVlVanLVbnVlI„ƒn@@a@Kl@@I„JlI@aXU@KlK„kVblJXU„VlU@V„bVkVKXn@VlxVa²I@VlVUxln@bšJXklaVWnLmÅ@y@k@ašI@W@aXIlVVaV@nnlKnLVW@IUa@a@K„UVVlI@wXKVV@IUƒla„@lUXwWƒnƒnalLlxXLll°@XwVKVaXIl™nb˜@nln@Va@U@k°ƒUmÆUVaXI„JV¯ÇUmmkU@WaKmakVm@U@aVKkkmKkVmIkÇ°£@aUUVaVVnKlkX‚mkƒ@ƒlUVaX@@Um@‚™UmlUXV„UVU@w‚K²¥Ua@I@UV™l@U™V±UIUÇ°»VkUmVI@a@U™m™ĉ™¯V±bŹĖğaÇL¯lmŽkX@‚óĀ@ŽmšÝêb±WkLƒn@xXx@Ž@b@V@LW@UbƒlţXƒ`kxWnXô¯¦ÆV@L@JVLƒxkK@V@bkz°l‚lXz@J„UlVla@XUV„bVKXnW`XXV@laVV@V„X@V¯xƒx@xULVbUJ@n@LU@VmmakbUK@b™IWWUUVkUmkLm@VJkb@nUJƒ@`V@kX™aUaVmmLkUmJ@Uk@U„±lkzmJUb@b„VUxVXU¤ƒL@JƒX@VlL@JkLUVU@mnUl„¦@V"],"encodeOffsets":[[117181,32063]]}},{"type":"Feature","id":"4210","properties":{"name":"荆州市","cp":[113.291,30.0092],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@ÈJV„lVVLXJln„K@UlL„anbla„xlK@„XVWxXLlƒJ@V„nXxlnô¤l@nKn—‚ƒÈKl¼VL²Ç‚Un@Vl™zŽV¦UxWVU@@U™`lbUL@xV@²@@nlVU„UJVb@VlbXx°XVWX_VKUwVKVa@UVKUUVk@KnblaUU@wnWl@UX@lÆ@@a„IVmUk„™šxVJ„U„bܙ@Uk@WWnk@Vƒ„™Vm@I@m@Un@m™XUlVlUnJ@knJVU°@@aÆLX@ƒllL@¦nJV@XblLVa²U@UlWš@VX@`@LV@@bXJlIXml_lJœU°b„KÆLnVVl‚@ö—Vƒ‚mXaVIĢllUlVnLVlX@@b‚ašnnxšV„L‚bn@°ÆXmmkĉƒ¯w±™™™Uċ@KÝÅƧŃÝ癙Uw¯ƒm™¯k@W‚kV@¯UIUJW¼kb™Uƒwk@W`@¦Uônb@VƚlÈ@VU@ƒƒ£UWWnUÆUnmJkUÇ£VWUI@aUU@WkI@Uƒa@JW@k£kaWVUKmnkKƒb™kkVWb—VmUUmwU@kk›@UakUUa@V@nlx@lUb±lUbnnWLUyk@UamœUK™@mlk@Wb@VXL@x@xWI@a¯Ž¯V@bVn@LkKmL@`XmKmVU@@bkL@V±bk@Uaƒa™L™KUVƒIƒ„™W™XamVVbUK@b@Lm@UWkxULWVUnm@UlUX"],"encodeOffsets":[[113918,30764]]}},{"type":"Feature","id":"4208","properties":{"name":"荆门市","cp":[112.6758,30.9979],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@n@lxlInVUnWJ@nUVV@Xb@xVƚb„alLVUnx°Jnb„I@„V`lInbl@@V°mn_VJÞUVLXx‚@nllKVb²kVa@KlknL°ƒ@JVLXnmJ@bU@VlnLVKV„@nX@lUšKVaXal@VKn@¥°L@Unw˜bnašV@KV@VUX@lVXI@KW@@IXWV@laVL„„KlaXUVVnkVWV@lwXblIXWVkVmšaU£VaUmVIkU@y@WakKUamU@UUK@kmK@w@@mK@LƒV¯™U@WwkmULƒamVVUU@ƒƒIƒbUKUa™kmƒm@UakLmxU@UÒWlULţÿmwkIUm@a‚kÈblW@UVƒUUk@JW@XkWWUkUKUIlw@aUWknWUUmnIWƒ™aUwVaۚƒaƒVUI™wƒšVlUnƒJ@bÅ@@kVWk@mX@xVVkbma@LUlVVUL@VUbULVxULW`UX@V@lUXWaXlWXX`@bmb@x@LUb@VmŽXX@‚@nWKUL@xVlknkL@bWJXbWLƒKkb@VlL@Vn@VV@bƒnX‚mLUK@nUaU@WbXVWL@VU@@V"],"encodeOffsets":[[114548,31984]]}},{"type":"Feature","id":"4212","properties":{"name":"咸宁市","cp":[114.2578,29.6631],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@ÞƂLČ@šV‚š²š°xĊ„nlWnŎ¯m@aƒK@„„°‚n„Jšwn™VIUaÆJšÅ@wšwV™XW@aV_l@²V°lĊwlaXLšwlUkalVVaX@lVXI@a˜UXJ@U°UU¥VIVKVklanLVa@VÈIVV@nk@aVa@mV_@a„K@klKUa@UnKWk@@lU@@UW@@nUWUwmaVIXƒ„lV@mLXblJ@kV@kk@KU@WƒkUWVÅwkLmW@UmL@lUL™KULƒak@maUUÝwUJƒIb›KUUƒ@š™aWK@kUWVkUwVw@™mÝ@™I@wkW@a›ww@LU¥™kƒJ@nVJƒIkVVnkV›UkyUIUl@xWUkaW@@°kz„ŽWxkLUWmzk@@bVVVš„b@‚@XlVœ@Vl@bVbUn™`Wn—@Wb„VVI@`„LVbXLV`mnU@@lƒL@LUŽƒak@ƒLk@WbUJn¦@lVb@xVb@n"],"encodeOffsets":[[116303,30567]]}},{"type":"Feature","id":"4213","properties":{"name":"随州市","cp":[113.4338,31.8768],"childNum":2},"geometry":{"type":"Polygon","coordinates":["@@„@nš`lw„k„ƒ„UmUVWX@lk„@VanUĠ¼V@@mX@@nVV‚VXLmJVLnK@b„V@@J„@VUn@VaVUUUVWVLV@@Kk_@almaVkUU@WVƒVUVLXmmk@wUaUKUV@°™@kmaUaÈmW„mUƒVklaX@lVnxl@@UnaUk@ƒVUVwVK„nš@VVn@VbVJUknUmmVmk_Vw„KUUm™Vak¥@UVKVIkW@UmIVWkIVƒkmmLkwmVUƒ@LƒUU@VVXL@JmLUbmK@UUKmkKUUmVUaUnÇlk¯™mJUnmLUaUJUaWL@UkJ™ƒUƒ@ƒaklkU@¯@KWLUmUUWVkbƒLƒŽUKkbU@WX@JX@@LWJkUW@UVU@@L™Umb—amx@V¯K@¦mŽULk@WbUb™LkVW@kVVxUb@x@LlV@V@b@VšU@L@V„LnšlJVIVK„¦„aVJ@XUŽ@b„LV‚@LVJnXmbk@@bU`VLUVV‚b@V@VnL@Vml@„@VXnWVXnWlXblK@LnV@VVX@VkV@XWK@b„VV@VV"],"encodeOffsets":[[115830,33154]]}},{"type":"Feature","id":"4209","properties":{"name":"孝感市","cp":[113.9502,31.1188],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@VnXK@L@°lVlk„b„@„VšlI@VXKVbVIVbnKVmnI°šlŽÈkVmVbnUVVlLnVL@VnLVanK@IWKUUV@„V@KV„nUlxnKlnU„lJUXnJ@VlXUJUL@Vl¦UbnšVVƒLUxl`UnnnmVVlnVK„bšmVX@a°Ý°LšaXJV@VUnKVXVK@LnKlLUbVVX@VwVJVn„@@UU¥V@@UUK@ƒmaUVUkkJ@L@K@UmVUI@JU@W@U@UV@ƒUIWmXUVmUUÇ@UVmIlmnmakK@akaW@UwVUkKVnUlKVwk™ƒVU_WKUkVW@UXaWkUa@w@VU@XaW±@IkbƒKƒb¯L@WƒXkWƒ@UakL@UV@UmVUmL@UXWVL@ašUƒVUUUVU@yUUƒIUa@wUKWVU@kƒ™™Wk¯UkwVKƒLUx™K@nVxUlUUWVUmw@wƒUUyXWlX¦WbUV@„U‚@blbUVVbXXƒl@lVL@bk@lxkVVnVx™¦ƒ`UnkL@V@L@Ž‚@@xnL@lVL@VnVVblLXb@‚@zlVUJVnUbV¤™bUnUlWXkJWakxU@UXml"],"encodeOffsets":[[116033,32091]]}},{"type":"Feature","id":"4201","properties":{"name":"武汉市","cp":[114.3896,30.6628],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@nbnm‚knJVUÈ@@Uƒ¥VknmV@VUlK@IkK@U„W@I„KV£UWVwƒU@aVanIly²kVƒl@@VnIlVnKUnVbšblWU@@_„‚VI@mlaUIn@lKVnUlVVXXšJ@aVLlanbUnV@@K@mVIUaVK@w„w°w@UƒW@UUUkbU@WWX_WmULƒaVU@WkbkUƒV@IWyk¯kly@a@UlL„wUK@I@KÅUW@ѱUm@wl¥kaƒ@@_Vw@ķƒa@akw@ƒkKW£XVUVwVwUaU@VUU™™xWKkbĉx¯k±Uk@U`@bWXUš™x@x™ÆÅIVbUJmš™xƒImƒ¯@ƒ™Umx™nUVVbnJV„@Lƒ@@ŽkV@bVnƒ@UVULlx°VXlššl„V@XUVL@xVb„JVV@zUVVVUV„™V@bUKWX@VnKUVVnU@@VlKVb„@lX„W@X°K„a„Lla@JX²Wb@ŽUV@@xVbXlWb@VUXVlXLV`Uš„lŽUxkLmVUŽlLUVVxX@lb@blL"],"encodeOffsets":[[117000,32097]]}},{"type":"Feature","id":"4202","properties":{"name":"黄石市","cp":[115.0159,29.9213],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@VšUVV@VbUx„aWUœblUVmnKlX@bXJVIlVUxVVVIU‚zlx¯š@‚VbnL@x‚x@UVaXK„b˜@Xk‚WU_Vm²klW„XVK„Žl@nXV@@w„mlK²X‚aÞén™@ôÿ@lWn°kUKmmUљUmm@ƒwkImWU@UakL@bVLUVċ@™bUK@alIXKWK@™nXnKmkUVwƒ@¯b@L„lUL±W™n@KULUaW@kL@lƒL@bU`@nUb@bmlU@UÇJ@UUbmKkblŽUULUJV¦¯V@VWI—V@bWJkUW@UbkUlbkV"],"encodeOffsets":[[117282,30685]]}},{"type":"Feature","id":"429021","properties":{"name":"神农架林区","cp":[110.4565,31.5802],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@n`lIXll@lœl@b°aVklKXaVn@bU`mX@V„V@nmJn¼„V@bÞ@lL@„lJXVlL„aVLV„nVnalV„@VLÈUlblWXIšKVU@J„™š_‚@an™na‚X„m@KmI@mkk@KVkWWw¯w¯°ƒ@UUU@WƒaÅWkL@ƒ¥@kWWXkWmIUVVbm@@bUbmUU„ƒbW@UVk@mVkU@U¯ƒmKVUkaW@aULƒÆVbƒb@VÅ@Un@VƒLWl¯Lš„"],"encodeOffsets":[[112624,32266]]}},{"type":"Feature","id":"429006","properties":{"name":"天门市","cp":[113.0273,30.6409],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@@K@UlKVm„_š¥UwUmlUkwl@@aUK@k„kWWUaVUka@aV@ƒVUXaW¥Xk@WWIklm@ÅxmI™VÝUkxkaƒ„@bWJaUL@„W@™l¯UULU‚ƒbƒkV™Ua¯bm¤UnÇUkmUšUx˜b@VkXÇal@bVnlJnxŤĀVKXkVÑV@nwlKVbn@n„šlVbVL„a„J@„VV‚UnU„bVKlnXxV@°š„U@KnL"],"encodeOffsets":[[116056,31636]]}},{"type":"Feature","id":"429004","properties":{"name":"仙桃市","cp":[113.3789,30.3003],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@VK°VškX@@ƒVK‚bXI@a„ƒlblwÞVšUnJÆwn@lkXJ@X‚WVz„V@xnx‚VXUVVVkUw@mšLVw„KVU„@Um@alU@„@@KUƒmIUaVUšmnwmw™mb@aW@UkmKkUkVġkUJWbnU„õ˜@UkmUÅKƒL¯a›VkIk`WnkJƒ@xVLUVVbUbk@WlXbm„VxnxUblbUV™@@VUV@nVL"],"encodeOffsets":[[115662,31259]]}},{"type":"Feature","id":"429005","properties":{"name":"潜江市","cp":[112.7637,30.3607],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@UbVxšbX„mJVnXVlmVX@bkxVJVLVlXXWlX@@IVl„V‚U—aVwV™lnÈVVmn£°aVbUš„l„aVUK@mVU@Uš@VUkaVamwUwnƒWaXkl@VaUaVUUK@w„WI@aU@@K@_UW™@kX@V±VUbkKWaU@mI@¥kK„kW@ÅK@b¯@UVmI@lmIkVkUWVnšm@@V@n@JUnƒšU„@ŽmlXXl@@V"],"encodeOffsets":[[115234,31118]]}},{"type":"Feature","id":"4207","properties":{"name":"鄂州市","cp":[114.7302,30.4102],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@°¥WóXmlw„_ŤW„kVaX@@K@U@a@WwU@mWk@ƒULƒWkX±lUnV`XWl—@ƒaWLUb@Vw@wmKUa@°™kw‚yVUJUUVwkUUJWI@akWmLUnkV›aXVƒbUxUVWX¤lL@„lx@b„b@ĸUx@`„@lbk¦@x‚n²VƄX@"],"encodeOffsets":[[117541,31349]]}}],"UTF8Encoding":true}; }); -define('echarts/util/mapData/geoJson/hu_nan_geo',[],function() { - return {"type":"FeatureCollection","features":[{"type":"Feature","id":"4312","properties":{"name":"怀化市","cp":[109.9512,27.4438],"childNum":12},"geometry":{"type":"Polygon","coordinates":["@@@n„‚@b@XnJ@k°x@aVUnl‚UXnV@@VnJWUJV„nIVV°ŽUbVVVL@Ž²LUVa°V@aV@nm‚UXblLXWVXVmVLVK@an_„`@X@l°„VlXXW`nX@Jmn@b„@nV@Lm`„bUb‚n@VUVl@nIVbUlƒV@LkJUnVV@xVblVUbU@ƒzUKU@mx@xUnn@@WV@lbUb@šnVWXX‚V@VIV@VUnJ@VUz@JWbXllI@VXVVL@ŽVn@„„Wlb@„Žl„XVlL„aV@VJ@XX`„kVwVl@bk„‚bUŽlVXIlƒnLVa„mVwV@@nV@XaVJVbX@lwV@n„@nV@VWnIVVUŽÆ@Xx‚a@I„UUKmk@mVƒ„IXmWUš™VJnUVU@anaVwk™›U@UXa@W™@m_@a¯@@K@UVƒ„bnK@blIlbXa@WW_n@VƒU@¯bmyƒUkUJÇÅ@WU@kWKÅwƒnm°KVkmankVWnXVWV@UƒƒwXkV@mƒ„UlLnaƒVaX@VUn@VnVK@xlnXWšU@a™@@klak™Vw™mUaV@™wmIÛ`m—@mVUXmlIXƒV‚I@K@aU@UaV_UK@wkUmmUKWXŽmVkUƒL@mƒƒU_nK‚™@aVU@Ukak»@U™™@ymUƒ„¯™ƒUUƒVKkam@™nka@ƒmwkLWb¯mkaƒ_VaVKUƒ™IUw@kKmU@WK@UnƒmaULkU@wUalWV¹U@@WUI@WU@‚_@W@U@mƒU@WbbUK@Um@@UmbUwWWkk@WU„a@anUUwlWUwUU@wlJVUnnV@@mnI@m‚K@U@w„a@wUm@_mƒVUUaVUkƒƒƒ_kċUk™VWLƒ@mlU@kn¥W@UwUWV@VÝU@lXLWVUbVLXlVIl‚knmU@VUJk@@„ƒ@™kVmwmVkxU@@XmVUb@xnKVLl@VxUxkIU`@bWVXX@JWL@bkb„¤@bmUUU¯Kƒkmb@V™VU„VVn@@„Vb@`lnœxmb„lUn‚bk„@xU„mV@bmWbUV@VJ„Il@nVUb‚K@nn@VbnJVIlJVkXJ@X@lmx@bnnWVXJWXU@UlU@mk@@llb°x„IUbnJ@VWbXVmI@JVX@bk‚@bWL@JUXUK@U@Uƒ`n@@Xm@XVW@@nX@@`ƒImxU@@JUI@KƒLmK@UÅUUV@VW@™¯kUU@UamVUUmJ@n„xmLKƒkmJkwkKm_mKXU@aƒU@b@Wk@ma@zUJVUmbUlU@™xnXlWlXXblK„¤V@@nUVVLkVš„l@Xb@VVK‚nXKVx@znW@X‚@@lVK@X@JXbWbnn@JUamLVVXIVxnK@aWUX@˜x@VnI@WlI@anV„IVxk‚l@lbXXšxVVVJVInbV@@ln¦ml@XXVWbkJWb","@@XLVKVXVKUa@UUUmV@l"],"encodeOffsets":[[112050,28384],[112174,27394]]}},{"type":"Feature","id":"4311","properties":{"name":"永州市","cp":[111.709,25.752],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@lxUXV‚lXUVnlVĢ„JVbUXVJV@XUW¯„VIUK@klW@Un@„nl@V`XUVL@l@šVx@„XXW`UnUbšxUlVnUšV„lb@VnJšUVVVInJlUšVnwVklKnw„LVJVšV@nIV@nbVa@KVVVUUa„KV_nVVJ@_VW„nV@n¥lI@anƒl¥X_VKlwVlULUVVVš@šU@VXL˜ƒ@IUmn@VU@wmKXUWU@m²šl@VIXWWkWUkWlkIVamUXamUnmWUU@@Un™lK@XJl@kVUk@mWKXkl@@aVU@UVWUUVa„In`VUVLnw@U@K@Uƒƒ@w@UVmUUƒ™°K@UnV@bV@Xk@KVm@amk„aU£VWUUmUUwm`UbULka›KXU@kVmU™@aV_UWVIn@˜y„XXK@klmV„V_kWVUn@WUU@UƒmaU@™wnwWanUmmXkƒam@UakLmK@b™xUUUU@Km¥Vaƒ¯@ƒkUaVUlm„UU@mUUÇmUk™Uyƒb™bUa™XUWWbÅLmL@V™aL@WWXUKmmk@a@UUK™XW¥kU@VƒUkxmVkUWbUJnVJ@nVJXzWxkŽ@lVbUX@VVL@`mbUnšŽUn™VV¼k@Ulm@mwLƒb@lmLUK@UamƒWkƒK@£Ua@ƒ›UkJkUmbVlkX@bWbUŽVŽnnUVl„@bšbVK@VX@lb„V@nU¤šx‚²„Knblb@x„V„ô@šlŽ@b@l@XWxnVl@„VV@XLVl‚LUŽUXV`šbXXmJU@@bm@UUkLW@UlUKWUUb™wUm™L@nklVVmVXXm@@bUKlÆn„‚XkllVUVVL@nUbV‚@V@nnV@xUn¯U@JW@UX@xĉ@™`m@@LV@b"],"encodeOffsets":[[113671,26989]]}},{"type":"Feature","id":"4305","properties":{"name":"邵阳市","cp":[110.9619,26.8121],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@XIlJšI„VVK@n@VVVKnLVwVmnLVK@U„@šw„J@wVIƚ°X@ÜȄUÈxll@kn@VwVaXJWXn@@WVL@UUKVKV_U@@aVK„x@U„aV@lk„@XylbUaV_šVnal@W„U@a„I@aV@@aVUl@Xm‚UXWaXml@@kk@ma@V_UnUV™UUWJUa@kkaWLUmk@@LUVWUkJWkK@¼UnWJƒIkV@b@JUIm@Ul™V™m@Uw@a@kWƒXWKUknW@ƒWUU@k™mx™UkVmIUJUU™VmI@UkaUƒV™UmVk™wVaVmX_WW@ƒUw@™@kUKWVU_k@ƒmm@@VkX@lVLUJƒX°WVU@UIVWUaƒIUġmkVUkWUVWkwWXk`mI@¥kUVƒUƒUn±@m›XkWknV„UVmmU@@XƒVƒUk`@Xƒƒƒk@¥¯»mbĉó@mkU@kU™ƒƒ™KmX@˜UnmL@lULkKUƒWUU@ƒbUaUnƒ@Vb@l„¦Ub@l™@UKmnƒKUnl„UVVbUVn„@`Vn@xƒb@x@VL@nmJ@nU@mmUVkI@xVVVxkXVxmV@bƒbXVl@Xl‚XVxna@Vn@@VVL‚aXaV@n„‚@@V@X`V@@XVJ@XV@UºkXVb@xlVVKnbm„@VXLV@n‚lL@VxšJV„ULUb„`lb°nXalKnx@„lbšmn@lbULV„„V°š„ƒnV@zšš@Vl¼lb@VUV@bšmLV`„„@n„KlVnU‚XWVLnnlV@xVLU`VbV@"],"encodeOffsets":[[113535,28322]]}},{"type":"Feature","id":"4310","properties":{"name":"郴州市","cp":[113.2361,25.8673],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@²zVaVlnVl@nšVk„Jl_XJlIVmnL@mV@VXn@lV@‚XzV@lyV¯²U@UlJ@XVKnVVIXl@UVLV`@n@J„I@mlI„KVLnUlVUVVLXašKVLl@nb@ŽW„XV°KUnVV„L@xVJ„L@b@LUVVVU„˜VXbmbVbn@@lUbm@x@XVVVŽ@@˜@bkImx@Vm@Xbƒb@l°XU¤„a‚L„mnL@bl@@™VUX@VxnV˜anLnƒWƒ¥XKVwnUWXmVIUWÆLVx„L„w@wVmlU@¥XƒWUkwlÇn_Uw„WV@VU°wnU—ƒy@aVškVlnL@lVn„w@VlJ@b„X„x@bVKnb@U@WVUl@@Vnbl@XLlK@aVLVKnxÞn@a„LlmUaVU™ƒm@ÅknUmaUKmVk@m™kk@UlWUkVm@w@kUU@W™U¯™¥@w„Ç@aVIlUV@kUWU@UUm»@k@mKVkUKUwƒaUaUa›@k„kUWJkImaU@UK™@maUzk`@zƒy@XmJkL@UUJmUkV@z›@kŽkVmK@¦UbWL@a@UbmKmwUK™Xk›VUUkmVkw@UUKmL@WUIWa—JW_k@@WmI@mk@WkWULUUVKUUVm@šU„bš@‚nUǃ@U@w„™V@Ua@aƒL@ak„›l@k™UƒJƒwó@@L@V@„™`@œƒJ@xnn™šmV@bkJmUó@ƒn—JW„UUmƒU@UV@Lk„WlnnmVXbmxšxV@nbV„V@XVm@UVlXU`ƒUŽkn@lWLƒW—zm@UJVXU`@bVšUn@lWVœLlbVKVan_VxnVVVUXV¤ƒbnl@bUn@LWlU@@amU@V¯L„šVVUn@V@x„„@V@L@VmxUKUVm_ƒJUbVV"],"encodeOffsets":[[114930,26747]]}},{"type":"Feature","id":"4307","properties":{"name":"常德市","cp":[111.4014,29.2676],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@l™U™mkUwUyV™@VW@¯Va—VmUU@KVUVUVLnaWƒnkUÓV_@mVU@݄w@ƒka@kVmƒUmK@IkaUamKkXWaUW@WUk„™@@KVU@aU@™L@J@XÇVUKVak_mWkLWakVUbmLUUmlUVKUU@kUWW@UImJ@xkLkKm@@Xƒ@ó݃@UUk@UKƒV™ƒULƒKƒXkWWbkaƒIUƒWU@mUk@WLaUJġ™ƒ@@XÈÆVIl‚„Vnz°aV@U„m@X`@XWbkakJ@amLƒaU„@V@L°@@bn`š@@XWb@VœVlšUxmb@bUVmVUI™šXVWnƒJU„@nnlVLƒV@JbWzk`m@UVK²V‚x„k„LVl„@Vn@V„„°xVKVkœVVlUblx@bU„‚Æœ@@nVnUll„kx@VW@@VkLWxUL@bÝ@kKkVõV@bkXVVUVƒ@ƒVkUkV›LkV™a™@@™ƒ¯xUxmX@JVb°WXkK@Vm@k„Vb™bn¤‚xUXkJƒblxnXÆK²l‚_@Wnašn@ŽUL@b‚JnIlV„@lUœ@@¯ô@lWȂIVKVm„U@aXaV@lwVXn@@K@UVKUUnU‚bn@lWšX„ƒlJnUšLšKV@„„l@²a@UlK@aV@naVX„WV_nKlL@KUm@a°U°@VXL@a@wWmXal@„k„@VLn›V@@bl@VnX@mwVa²aVU@mk@"],"encodeOffsets":[[114976,30201]]}},{"type":"Feature","id":"4331","properties":{"name":"湘西土家族苗族自治州","cp":[109.7864,28.6743],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@@KšL@wnK±nƒnm‚—@WUk„ƒÜÈn@n»@mVamk„mšU„„l@V™nmmU@wUan¯VKšLn„VWlInyWUœI@WWk@KXU˜n@mnUmU@WœƒmkV@ƒkXašaVaUm‚Ikƒƒ@kaƒX@ƒUm@UKWU@UkJWkXa@IVy@UmIUVU@UJU@WXWmU@™VakaU@@Xm@Vm@wnwV@VL„yV@VakUUa@wUUVmlI@K„UVkUamJk@VU@UmVaƒan_@KmUƒ@@anm@ImWX_WWUk¯ƒ@k@Wƒ_m`@bULUKUnUWWXkKWaVmnU@@b¯UUbVŽ±K@UKUUVa¯UUmJUƒVIXmI@UU@WmVmkUV@b¯w@lmI@W@aƒ@m¯LXbmJVLklWL@V@XXŽmbVVU@@VU²Ul@VlX@bš`Xx›zUmkUVÒlŽ@bXLWxXVlš@V„bkLma@nmVmULVbmVUb@lnzmbUÒVl@°nLV„lJkn@bmJk_ƒVmmkblxÈx@LUb„xVb@V™n@JmLVŽUš@„nV@¦VbnJ@lVVbkx™bm@UxVLV@n`UnVVV„kl°z„xVb@VU@@ÆlXnWm¦nbVK@XVVUVVl@X„KUV@nVL@WnIWŽXLVKVLlxUbVKXVWbn@@UnKVLVb„JšU@aVU°b"],"encodeOffsets":[[112354,30325]]}},{"type":"Feature","id":"4304","properties":{"name":"衡阳市","cp":[112.4121,26.7902],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@lšV@XV@„mXVlXL„W‚X@l@bVxn@šŽšUVkn@VJ@I@alU„JXIVm@»‚LXllIXVVU@Kl@VnXKlb@lVbXIVVUšmVVU`@nbl@@lXLVVVKVbnXWJ@VXbWxXb„Ul™VK„¦nLVVUVVbšb„K@U˜LnK@Un@VxlUV`UnnL@VVL@JV@VUnxnKVbV@@VšIVUnJUVUl@nW„XllIUa„KVbÞLV¼²`V@VIUwlaVmXa@IWanK@U@m„kVƒVUVaX@lšnaVLÈ@‚¥@kkJUWJUaƒXkaUm‚wVXJ@_lWUU@¥n_‚KkamUK„™@amKƒnKƒbV£¯W@k„aWan@@UnwlJ@a@—@UUU@W‚wn@Va@km@UanaWa—UVƒUUVU@K@aƒKUI@wƒKUUVm¯LWUXƒ@mak@UK™LWbUKVUkUmVUKƒLkJ@nƒJ@I@mU_UK@VWkUJmUUL@WkI@V±VU°kzU@Wy@kUm@UWU@@nmKUnkJWIk`ƒIUlm™k@mUUkUb±yUX@VUV@bk@WlXL@nVlUl‚k@WI@ŽkLmš@VV@XVmnnVWbnVUblJXkVl‚XXlWXUJk@±™@nXVWVnL@xUVm@Vn@J—„WK@U™V™@UUVUVKUkkxULW`k¦m„@bkJm¦U@ƒmUX@`UImUU`ƒLVbUVUU@LUbmaU@mJU@U™UIƒKmxkLUl"],"encodeOffsets":[[114222,27484]]}},{"type":"Feature","id":"4306","properties":{"name":"岳阳市","cp":[113.2361,29.1357],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@@wUklmUUmU@@UVm@wUaV_mmUKmwkIkJmUUnm@™™@UUƒbUKUƒmÛamm¯xVLkbÇƃUƒVUzkVUlƒUUKWLX¦W@ƒVUUUaƒKUbmLKm„@akU@aƒmVaUUVIVWkk@wkƒƒ@@xmLlmÅwmbVlXlÝIWVkK@kkVƒL@VWKU@Ublnaƒƒm@b@bšnW`@XUJk@UUWKƒk@UKƒnn‚@xmLUVm@kbVbV„nV@V„b‚@KnV„LWšXŽÆVĢ¦VblŽš„n„UJWz@ƙVóUVbkV™aÅx@¦lVUbVVknWKƒ„k@ƒwƒK™VU„Å„ƒl@zkb@`m_mJ@xX„mbVbœ@llV@n„@llbXL˜UXalUšl„alVnwnLVKlšVbX@@I„V@blJ@bVL@VVVUXȤ‚VnkVÑXmlbnš‚„VKkÑř@UmaVç@±XUlI„xlV„@VaX¯lUVVUšVJn—V@°°nŽ°„Vxĸł°¦šb²¦lJ@U@aUK@kUm@_m±VIXal@„Kl@„bV@K„K@k„m@UmUUaƒK@_UJƒaXU˜@Xmš_VmUk@WUk›@kU@a@m@UƒaUUU@al@ny‚XXWWwkly@¯n@@bnV@k@mVI‚„œVlUUmlU„JUw„I‚bXƒVaUal@K„b@ƒVKVkXVl@VkUU@ylUœVVaVL"],"encodeOffsets":[[116888,29526]]}},{"type":"Feature","id":"4309","properties":{"name":"益阳市","cp":[111.731,28.3832],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@„ŽÆxXL@l‚V„@ĢšVI‚bXKl@nVV@„XVŽ„JlbXalX„W„LVKš„„UVLl@VV„@ôބ@@Wn@lLlK@wnIVJX@VX@lVVUL‚VnkVVnKValUXblKnXl`UbVLÈU@W@IšKV@@bUV@Lš@lƒXV‚@VXXblWnLVblb@JnL„VUn@llb@„ƒx@ÞUV@nU`VÔmlX„mbUKUVUV@LVVUn˜ŽUb@°UXš@U‚VzVxnlVškšVnlVnaWƒ@wnIn`@_la@y„kƃVƒšU„L„xl@„ƒXLlmUUVakU@¥ÆwšblUUaôVšU@ÅXyVImƒ™ƒkUaġ¥ÅUWX™ƒKmU@Lƒa@UmUUƒUalan@VUnK@wm„m‚L@V„lXLVVl@VI@WX_™m@a™¯mKUkwW¥UK@_UWWLUVkUWL@WUIkVƒU@JƒwkLUUmJVI@WkXm@VmkKUIU@mmm_@VUV™@™„kJċwUU@KUWkkW@IWW@km@klwkWVkkU™V¯m@kWLU`mIkmkXm@@`@L@xUKWkU@VL@JUU@mbUKVa¯WVnL@`lXUVkU@xW@UbUWVU@UJ@„lnU@m‚nÈmVƒa@bUL™wUb™@@VkxmUUƒ™UV›K@IƒUƒmk@akm@wmIƒŽkK@b™VWXkm@wULUmm@UVW@Ub„mbkKƒVn„U@Wl„xV„U@UXmWUXmlnbUl¯Lmn"],"encodeOffsets":[[113378,28981]]}},{"type":"Feature","id":"4301","properties":{"name":"长沙市","cp":[113.0823,28.2568],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@lVUllXkx@lln@‚XX@JlXXl‚V@LVVČxlIšƒš@VU@Un`nnV@VJlLUnn@lW@XUJnIVVlK„x@I„VlUVJ@XXKlVVUXKVX@`VLX¦lxVŽnLš°‚an@„„‚bkmVaV@XL@U„KlU@llLXUÞJWkUknaÆxnŽ‚knK@w„@l„@xllUXUJVVUb„n@blV@bnƒ‚LnKVa„LVbVV„UX@W¥XKVL„VVklUVy„U„VÈÅlaUK°wnnÜbn‚V„VL„aVVš@šn@VmnVlIlJna„@Valkn@na@amwm@„UXw˜K@aUUVUUaVa—wWK@kU@UaW@kKUUƒƒ@k™W¯XWan@k„™mmÅ@@I@U@KmLkaVUƒKkLWVUƒk@UVmU@am@kkk¥ƒUƒVUK™„maUb@ŽUb™I@aƒKkkWm@W¯K¯b@VmaULVxUXlVk@UxVJVbUb@xULƒ@ULWW—LƒĕmxVVL@šVb™KUwƒaŲWwX@@WƒUWLU@VbkV@aU@@VUnmJ@VUn@VƒLUK@U‚mUIk@UÇmU@@UW@J@LƒbUmVI@aUmW@@bkXUx@lmLUbm@UbkJ@V@XmlUbkKm@ma@kUaVU@aUK@mImJUIkVƒUƒVUakbWwka@UWKkLUamKUXm`Å_U˜ƒULmaU@@lUV@X"],"encodeOffsets":[[114582,28694]]}},{"type":"Feature","id":"4302","properties":{"name":"株洲市","cp":[113.5327,27.0319],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@X‚‚Unw„Ė˜KXXVK„@VK@wVaUaUIVwl@kUVWUwVKnb@U°a°LXŽ‚@Xnll„L@bšJVa@VanbšƒVL„U„V@al@@UV¯ÅÇ@Ummk™w@¯ƒyVwnUVVVUkmWV—nKVUƒa@WXkVKn@lUVU„VVVXIlV°VnI@VlKnV@mwVm@LXKWkU¥wWwƒƒ@k@m„X@KX¯V@VUVa@VnKWkœƒV@VUkm@aWa@wkUWwkmV£VÿXUVL@mVIXaò@nW@ašUš@@am™@aUU„UmXmWUk@ƒƒnUW@_maVm™wUkamaUL@aƒwƒW@akI@UƒxUm@kmKUk™lUŽ@b„zV˜m¯xUVU@ƒXVxm`kÈlxXVW„@¦kVUn@xƒxƒKUwÅKVXUJWnXŽmVUxWL„¦XŽm„mK—bmUUwW@UV@šk@ƒšVLnŽlbLm`@¦VVkX@`WIUŽxVnlb„WVbXIV‚lI@l¦Ç@UKmbk™W@UbUVU„ƒl@n@VmLXb@JWbUnkbVxUJUxWXXlWL@V@V@XXJWx„zUVVVVKnXW`@bkIUl‚„nLVJUbUIWVXlWV@XklVbnn@xlš"],"encodeOffsets":[[115774,28587]]}},{"type":"Feature","id":"4308","properties":{"name":"张家界市","cp":[110.5115,29.328],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@@InWVw°wš„@š@šblUœKlUlV„U„@VUUUlW@aöUlUlLÞ@@aVKXwlK@UX@@UlwkƒVkUm@m›@ÅVƒ@akwVaUk›UUlUL¯wƒƒ@UUmƒ@UkƒKƒlw±UULVn@l_XyWwÅ@VUUmJUXU@@mmƒU@kxW@UaUIWbU@@mU@UxƒnUbmKk„WJkUValƒ@aUkUxƒlW_@WUIU@ƒbkKWUJVnUb™bWb„lU@nl›„@XnVmV@n—mWV@LXl@X›JXVmzkJUXmƒ™KULm°Vb@xnVmnUšk@ƒƒ™VƒnnlUb@nm¼m@Ûǃ„Vl@X˜mnm„²ŽmL@x™K@LUl@nULÆx@V@VXVWbXX˜l„@nLlm@bVKœX‚W„L°bnUš@VaVUš@šmšVw„JnwVK°zn@V‚Vb„a„@Ċ¼"],"encodeOffsets":[[113288,30471]]}},{"type":"Feature","id":"4313","properties":{"name":"娄底市","cp":[111.6431,27.7185],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@lL„nJ@xln@bnlV„‚„@JœLVUšŽV„nVlw@Uš@VašxVK@a„bnUmÇnV@km@ƒ‚I@VUVVXVaX@@wlVVUkW@_mKXU°‚UbVLnaV@‚V@IUKV@XlVL@w@K@_n@lWlnnJV_XK@l°nšU@WVU@kV@nbVK„V—lƒ@nLlƒ„LXU@ƒlmkw@nW@UKVa¯IVn@@aVUUKl@nXVKVn²a˜ŽXblKnLlmVI@KUU@akLUaVa‚UXm@aƒ@wVUVKnLnWlXl‚n@@U@anUVm@U‚Inm@IUK@UmKVmU_kVUwm@@VmL—K@VƒL™aUaVUUUmKƒ¥ULkšƒVWaXwWa@UXImWUaULUUWKk@WnXbWŽVWnk@UV@bU@@bƒJ@bƒV@XkŽmb™UU`VbkaWzƒ@klU@ƒb@VƒwUL@bV@U`ULVL@VUK@Xm@XWWIUbUxm@@lkkÇwƒVÛÇW@¯Å™UJ@xƒI™xƒ@@VULmKUnUxmKULUUm@@‚ULƒU™JkIWJ@b@LJUW„kJWnUV@nn˜Ü_nJšxU@VbšnUxlškb@lš@"],"encodeOffsets":[[113682,28699]]}},{"type":"Feature","id":"4303","properties":{"name":"湘潭市","cp":[112.5439,27.7075],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@Æ`n_VWnLVblKXL@VlbXxlaVb„U„VlUVJnInJ‚@VL@bUVVb@lnbn@lLVank@W@UlIVan@VanK@kVwlW@aX@Vn@bUJVn„a@K‚IX@@VV@nŽVÈl@VJn@VVL„K@UVm@UnIVm@UV@@blUUaV@XK„V@XW@XxƱ„bVxšLUa@™UKWk™@wmmUalk@WXUWkXUVJVaUImKƒVklJ@aX_mWULUUVUƒyXwWI@W@U@UXKWkXWVwU@±_U»ÝKUaƒLVbkJkƒWmXk@UVVŽmIUV™J@UU@UamLmwUVU@mnJ@VUnmV@b@Vm@kkWmXmKULUV@x„Ž@bWnVUbVblK@bVV@LUJknmKkLWa—±bUmULmWk@VLUV@bm@U°JUbVLX@@mlxkn@„WVƒKk„mK@k„"],"encodeOffsets":[[114683,28576]]}}],"UTF8Encoding":true}; +define('echarts/util/mapData/geoJson/hu_nan_geo',[],function() { + return {"type":"FeatureCollection","features":[{"type":"Feature","id":"4312","properties":{"name":"怀化市","cp":[109.9512,27.4438],"childNum":12},"geometry":{"type":"Polygon","coordinates":["@@@n„‚@b@XnJ@k°x@aVUnl‚UXnV@@VnJWUJV„nIVV°ŽUbVVVL@Ž²LUVa°V@aV@nm‚UXblLXWVXVmVLVK@an_„`@X@l°„VlXXW`nX@Jmn@b„@nV@Lm`„bUb‚n@VUVl@nIVbUlƒV@LkJUnVV@xVblVUbU@ƒzUKU@mx@xUnn@@WV@lbUb@šnVWXX‚V@VIV@VUnJ@VUz@JWbXllI@VXVVL@ŽVn@„„Wlb@„Žl„XVlL„aV@VJ@XX`„kVwVl@bk„‚bUŽlVXIlƒnLVa„mVwV@@nV@XaVJVbX@lwV@n„@nV@VWnIVVUŽÆ@Xx‚a@I„UUKmk@mVƒ„IXmWUš™VJnUVU@anaVwk™›U@UXa@W™@m_@a¯@@K@UVƒ„bnK@blIlbXa@WW_n@VƒU@¯bmyƒUkUJÇÅ@WU@kWKÅwƒnm°KVkmankVWnXVWV@UƒƒwXkV@mƒ„UlLnaƒVaX@VUn@VnVK@xlnXWšU@a™@@klak™Vw™mUaV@™wmIÛ`m—@mVUXmlIXƒV‚I@K@aU@UaV_UK@wkUmmUKWXŽmVkUƒL@mƒƒU_nK‚™@aVU@Ukak»@U™™@ymUƒ„¯™ƒUUƒVKkam@™nka@ƒmwkLWb¯mkaƒ_VaVKUƒ™IUw@kKmU@WK@UnƒmaULkU@wUalWV¹U@@WUI@WU@‚_@W@U@mƒU@WbbUK@Um@@UmbUwWWkk@WU„a@anUUwlWUwUU@wlJVUnnV@@mnI@m‚K@U@w„a@wUm@_mƒVUUaVUkƒƒƒ_kċUk™VWLƒ@mlU@kn¥W@UwUWV@VÝU@lXLWVUbVLXlVIl‚knmU@VUJk@@„ƒ@™kVmwmVkxU@@XmVUb@xnKVLl@VxUxkIU`@bWVXX@JWL@bkb„¤@bmUUU¯Kƒkmb@V™VU„VVn@@„Vb@`lnœxmb„lUn‚bk„@xU„mV@bmWbUV@VJ„Il@nVUb‚K@nn@VbnJVIlJVkXJ@X@lmx@bnnWVXJWXU@UlU@mk@@llb°x„IUbnJ@VWbXVmI@JVX@bk‚@bWL@JUXUK@U@Uƒ`n@@Xm@XVW@@nX@@`ƒImxU@@JUI@KƒLmK@UÅUUV@VW@™¯kUU@UamVUUmJ@n„xmLKƒkmJkwkKm_mKXU@aƒU@b@Wk@ma@zUJVUmbUlU@™xnXlWlXXblK„¤V@@nUVVLkVš„l@Xb@VVK‚nXKVx@znW@X‚@@lVK@X@JXbWbnn@JUamLVVXIVxnK@aWUX@˜x@VnI@WlI@anV„IVxk‚l@lbXXšxVVVJVInbV@@ln¦ml@XXVWbkJWb","@@XLVKVXVKUa@UUUmV@l"],"encodeOffsets":[[112050,28384],[112174,27394]]}},{"type":"Feature","id":"4311","properties":{"name":"永州市","cp":[111.709,25.752],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@lxUXV‚lXUVnlVĢ„JVbUXVJV@XUW¯„VIUK@klW@Un@„nl@V`XUVL@l@šVx@„XXW`UnUbšxUlVnUšV„lb@VnJšUVVVInJlUšVnwVklKnw„LVJVšV@nIV@nbVa@KVVVUUa„KV_nVVJ@_VW„nV@n¥lI@anƒl¥X_VKlwVlULUVVVš@šU@VXL˜ƒ@IUmn@VU@wmKXUWU@m²šl@VIXWWkWUkWlkIVamUXamUnmWUU@@Un™lK@XJl@kVUk@mWKXkl@@aVU@UVWUUVa„In`VUVLnw@U@K@Uƒƒ@w@UVmUUƒ™°K@UnV@bV@Xk@KVm@amk„aU£VWUUmUUwm`UbULka›KXU@kVmU™@aV_UWVIn@˜y„XXK@klmV„V_kWVUn@WUU@UƒmaU@™wnwWanUmmXkƒam@UakLmK@b™xUUUU@Km¥Vaƒ¯@ƒkUaVUlm„UU@mUUÇmUk™Uyƒb™bUa™XUWWbÅLmL@V™aL@WWXUKmmk@a@UUK™XW¥kU@VƒUkxmVkUWbUJnVJ@nVJXzWxkŽ@lVbUX@VVL@`mbUnšŽUn™VV¼k@Ulm@mwLƒb@lmLUK@UamƒWkƒK@£Ua@ƒ›UkJkUmbVlkX@bWbUŽVŽnnUVl„@bšbVK@VX@lb„V@nU¤šx‚²„Knblb@x„V„ô@šlŽ@b@l@XWxnVl@„VV@XLVl‚LUŽUXV`šbXXmJU@@bm@UUkLW@UlUKWUUb™wUm™L@nklVVmVXXm@@bUKlÆn„‚XkllVUVVL@nUbV‚@V@nnV@xUn¯U@JW@UX@xĉ@™`m@@LV@b"],"encodeOffsets":[[113671,26989]]}},{"type":"Feature","id":"4305","properties":{"name":"邵阳市","cp":[110.9619,26.8121],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@XIlJšI„VVK@n@VVVKnLVwVmnLVK@U„@šw„J@wVIƚ°X@ÜȄUÈxll@kn@VwVaXJWXn@@WVL@UUKVKV_U@@aVK„x@U„aV@lk„@XylbUaV_šVnal@W„U@a„I@aV@@aVUl@Xm‚UXWaXml@@kk@ma@V_UnUV™UUWJUa@kkaWLUmk@@LUVWUkJWkK@¼UnWJƒIkV@b@JUIm@Ul™V™m@Uw@a@kWƒXWKUknW@ƒWUU@k™mx™UkVmIUJUU™VmI@UkaUƒV™UmVk™wVaVmX_WW@ƒUw@™@kUKWVU_k@ƒmm@@VkX@lVLUJƒX°WVU@UIVWUaƒIUġmkVUkWUVWkwWXk`mI@¥kUVƒUƒUn±@m›XkWknV„UVmmU@@XƒVƒUk`@Xƒƒƒk@¥¯»mbĉó@mkU@kU™ƒƒ™KmX@˜UnmL@lULkKUƒWUU@ƒbUaUnƒ@Vb@l„¦Ub@l™@UKmnƒKUnl„UVVbUVn„@`Vn@xƒb@x@VL@nmJ@nU@mmUVkI@xVVVxkXVxmV@bƒbXVl@Xl‚XVxna@Vn@@VVL‚aXaV@n„‚@@V@X`V@@XVJ@XV@UºkXVb@xlVVKnbm„@VXLV@n‚lL@VxšJV„ULUb„`lb°nXalKnx@„lbšmn@lbULV„„V°š„ƒnV@zšš@Vl¼lb@VUV@bšmLV`„„@n„KlVnU‚XWVLnnlV@xVLU`VbV@"],"encodeOffsets":[[113535,28322]]}},{"type":"Feature","id":"4310","properties":{"name":"郴州市","cp":[113.2361,25.8673],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@²zVaVlnVl@nšVk„Jl_XJlIVmnL@mV@VXn@lV@‚XzV@lyV¯²U@UlJ@XVKnVVIXl@UVLV`@n@J„I@mlI„KVLnUlVUVVLXašKVLl@nb@ŽW„XV°KUnVV„L@xVJ„L@b@LUVVVU„˜VXbmbVbn@@lUbm@x@XVVVŽ@@˜@bkImx@Vm@Xbƒb@l°XU¤„a‚L„mnL@bl@@™VUX@VxnV˜anLnƒWƒ¥XKVwnUWXmVIUWÆLVx„L„w@wVmlU@¥XƒWUkwlÇn_Uw„WV@VU°wnU—ƒy@aVškVlnL@lVn„w@VlJ@b„X„x@bVKnb@U@WVUl@@Vnbl@XLlK@aVLVKnxÞn@a„LlmUaVU™ƒm@ÅknUmaUKmVk@m™kk@UlWUkVm@w@kUU@W™U¯™¥@w„Ç@aVIlUV@kUWU@UUm»@k@mKVkUKUwƒaUaUa›@k„kUWJkImaU@UK™@maUzk`@zƒy@XmJkL@UUJmUkV@z›@kŽkVmK@¦UbWL@a@UbmKmwUK™Xk›VUUkmVkw@UUKmL@WUIWa—JW_k@@WmI@mk@WkWULUUVKUUVm@šU„bš@‚nUǃ@U@w„™V@Ua@aƒL@ak„›l@k™UƒJƒwó@@L@V@„™`@œƒJ@xnn™šmV@bkJmUó@ƒn—JW„UUmƒU@UV@Lk„WlnnmVXbmxšxV@nbV„V@XVm@UVlXU`ƒUŽkn@lWLƒW—zm@UJVXU`@bVšUn@lWVœLlbVKVan_VxnVVVUXV¤ƒbnl@bUn@LWlU@@amU@V¯L„šVVUn@V@x„„@V@L@VmxUKUVm_ƒJUbVV"],"encodeOffsets":[[114930,26747]]}},{"type":"Feature","id":"4307","properties":{"name":"常德市","cp":[111.4014,29.2676],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@l™U™mkUwUyV™@VW@¯Va—VmUU@KVUVUVLnaWƒnkUÓV_@mVU@݄w@ƒka@kVmƒUmK@IkaUamKkXWaUW@WUk„™@@KVU@aU@™L@J@XÇVUKVak_mWkLWakVUbmLUUmlUVKUU@kUWW@UImJ@xkLkKm@@Xƒ@ó݃@UUk@UKƒV™ƒULƒKƒXkWWbkaƒIUƒWU@mUk@WLaUJġ™ƒ@@XÈÆVIl‚„Vnz°aV@U„m@X`@XWbkakJ@amLƒaU„@V@L°@@bn`š@@XWb@VœVlšUxmb@bUVmVUI™šXVWnƒJU„@nnlVLƒV@JbWzk`m@UVK²V‚x„k„LVl„@Vn@V„„°xVKVkœVVlUblx@bU„‚Æœ@@nVnUll„kx@VW@@VkLWxUL@bÝ@kKkVõV@bkXVVUVƒ@ƒVkUkV›LkV™a™@@™ƒ¯xUxmX@JVb°WXkK@Vm@k„Vb™bn¤‚xUXkJƒblxnXÆK²l‚_@Wnašn@ŽUL@b‚JnIlV„@lUœ@@¯ô@lWȂIVKVm„U@aXaV@lwVXn@@K@UVKUUnU‚bn@lWšX„ƒlJnUšLšKV@„„l@²a@UlK@aV@naVX„WV_nKlL@KUm@a°U°@VXL@a@wWmXal@„k„@VLn›V@@bl@VnX@mwVa²aVU@mk@"],"encodeOffsets":[[114976,30201]]}},{"type":"Feature","id":"4331","properties":{"name":"湘西土家族苗族自治州","cp":[109.7864,28.6743],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@@KšL@wnK±nƒnm‚—@WUk„ƒÜÈn@n»@mVamk„mšU„„l@V™nmmU@wUan¯VKšLn„VWlInyWUœI@WWk@KXU˜n@mnUmU@WœƒmkV@ƒkXašaVaUm‚Ikƒƒ@kaƒX@ƒUm@UKWU@UkJWkXa@IVy@UmIUVU@UJU@WXWmU@™VakaU@@Xm@Vm@wnwV@VL„yV@VakUUa@wUUVmlI@K„UVkUamJk@VU@UmVaƒan_@KmUƒ@@anm@ImWX_WWUk¯ƒ@k@Wƒ_m`@bULUKUnUWWXkKWaVmnU@@b¯UUbVŽ±K@UKUUVa¯UUmJUƒVIXmI@UU@WmVmkUV@b¯w@lmI@W@aƒ@m¯LXbmJVLklWL@V@XXŽmbVVU@@VU²Ul@VlX@bš`Xx›zUmkUVÒlŽ@bXLWxXVlš@V„bkLma@nmVmULVbmVUb@lnzmbUÒVl@°nLV„lJkn@bmJk_ƒVmmkblxÈx@LUb„xVb@V™n@JmLVŽUš@„nV@¦VbnJ@lVVbkx™bm@UxVLV@n`UnVVV„kl°z„xVb@VU@@ÆlXnWm¦nbVK@XVVUVVl@X„KUV@nVL@WnIWŽXLVKVLlxUbVKXVWbn@@UnKVLVb„JšU@aVU°b"],"encodeOffsets":[[112354,30325]]}},{"type":"Feature","id":"4304","properties":{"name":"衡阳市","cp":[112.4121,26.7902],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@lšV@XV@„mXVlXL„W‚X@l@bVxn@šŽšUVkn@VJ@I@alU„JXIVm@»‚LXllIXVVU@Kl@VnXKlb@lVbXIVVUšmVVU`@nbl@@lXLVVVKVbnXWJ@VXbWxXb„Ul™VK„¦nLVVUVVbšb„K@U˜LnK@Un@VxlUV`UnnL@VVL@JV@VUnxnKVbV@@VšIVUnJUVUl@nW„XllIUa„KVbÞLV¼²`V@VIUwlaVmXa@IWanK@U@m„kVƒVUVaX@lšnaVLÈ@‚¥@kkJUWJUaƒXkaUm‚wVXJ@_lWUU@¥n_‚KkamUK„™@amKƒnKƒbV£¯W@k„aWan@@UnwlJ@a@—@UUU@W‚wn@Va@km@UanaWa—UVƒUUVU@K@aƒKUI@wƒKUUVm¯LWUXƒ@mak@UK™LWbUKVUkUmVUKƒLkJ@nƒJ@I@mU_UK@VWkUJmUUL@WkI@V±VU°kzU@Wy@kUm@UWU@@nmKUnkJWIk`ƒIUlm™k@mUUkUb±yUX@VUV@bk@WlXL@nVlUl‚k@WI@ŽkLmš@VV@XVmnnVWbnVUblJXkVl‚XXlWXUJk@±™@nXVWVnL@xUVm@Vn@J—„WK@U™V™@UUVUVKUkkxULW`k¦m„@bkJm¦U@ƒmUX@`UImUU`ƒLVbUVUU@LUbmaU@mJU@U™UIƒKmxkLUl"],"encodeOffsets":[[114222,27484]]}},{"type":"Feature","id":"4306","properties":{"name":"岳阳市","cp":[113.2361,29.1357],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@@wUklmUUmU@@UVm@wUaV_mmUKmwkIkJmUUnm@™™@UUƒbUKUƒmÛamm¯xVLkbÇƃUƒVUzkVUlƒUUKWLX¦W@ƒVUUUaƒKUbmLKm„@akU@aƒmVaUUVIVWkk@wkƒƒ@@xmLlmÅwmbVlXlÝIWVkK@kkVƒL@VWKU@Ublnaƒƒm@b@bšnW`@XUJk@UUWKƒk@UKƒnn‚@xmLUVm@kbVbV„nV@V„b‚@KnV„LWšXŽÆVĢ¦VblŽš„n„UJWz@ƙVóUVbkV™aÅx@¦lVUbVVknWKƒ„k@ƒwƒK™VU„Å„ƒl@zkb@`m_mJ@xX„mbVbœ@llV@n„@llbXL˜UXalUšl„alVnwnLVKlšVbX@@I„V@blJ@bVL@VVVUXȤ‚VnkVÑXmlbnš‚„VKkÑř@UmaVç@±XUlI„xlV„@VaX¯lUVVUšVJn—V@°°nŽ°„Vxĸł°¦šb²¦lJ@U@aUK@kUm@_m±VIXal@„Kl@„bV@K„K@k„m@UmUUaƒK@_UJƒaXU˜@Xmš_VmUk@WUk›@kU@a@m@UƒaUUU@al@ny‚XXWWwkly@¯n@@bnV@k@mVI‚„œVlUUmlU„JUw„I‚bXƒVaUal@K„b@ƒVKVkXVl@VkUU@ylUœVVaVL"],"encodeOffsets":[[116888,29526]]}},{"type":"Feature","id":"4309","properties":{"name":"益阳市","cp":[111.731,28.3832],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@„ŽÆxXL@l‚V„@ĢšVI‚bXKl@nVV@„XVŽ„JlbXalX„W„LVKš„„UVLl@VV„@ôބ@@Wn@lLlK@wnIVJX@VX@lVVUL‚VnkVVnKValUXblKnXl`UbVLÈU@W@IšKV@@bUV@Lš@lƒXV‚@VXXblWnLVblb@JnL„VUn@llb@„ƒx@ÞUV@nU`VÔmlX„mbUKUVUV@LVVUn˜ŽUb@°UXš@U‚VzVxnlVškšVnlVnaWƒ@wnIn`@_la@y„kƃVƒšU„L„xl@„ƒXLlmUUVakU@¥ÆwšblUUaôVšU@ÅXyVImƒ™ƒkUaġ¥ÅUWX™ƒKmU@Lƒa@UmUUƒUalan@VUnK@wm„m‚L@V„lXLVVl@VI@WX_™m@a™¯mKUkwW¥UK@_UWWLUVkUWL@WUIkVƒU@JƒwkLUUmJVI@WkXm@VmkKUIU@mmm_@VUV™@™„kJċwUU@KUWkkW@IWW@km@klwkWVkkU™V¯m@kWLU`mIkmkXm@@`@L@xUKWkU@VL@JUU@mbUKVa¯WVnL@`lXUVkU@xW@UbUWVU@UJ@„lnU@m‚nÈmVƒa@bUL™wUb™@@VkxmUUƒ™UV›K@IƒUƒmk@akm@wmIƒŽkK@b™VWXkm@wULUmm@UVW@Ub„mbkKƒVn„U@Wl„xV„U@UXmWUXmlnbUl¯Lmn"],"encodeOffsets":[[113378,28981]]}},{"type":"Feature","id":"4301","properties":{"name":"长沙市","cp":[113.0823,28.2568],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@lVUllXkx@lln@‚XX@JlXXl‚V@LVVČxlIšƒš@VU@Un`nnV@VJlLUnn@lW@XUJnIVVlK„x@I„VlUVJ@XXKlVVUXKVX@`VLX¦lxVŽnLš°‚an@„„‚bkmVaV@XL@U„KlU@llLXUÞJWkUknaÆxnŽ‚knK@w„@l„@xllUXUJVVUb„n@blV@bnƒ‚LnKVa„LVbVV„UX@W¥XKVL„VVklUVy„U„VÈÅlaUK°wnnÜbn‚V„VL„aVVš@šn@VmnVlIlJna„@Valkn@na@amwm@„UXw˜K@aUUVUUaVa—wWK@kU@UaW@kKUUƒƒ@k™W¯XWan@k„™mmÅ@@I@U@KmLkaVUƒKkLWVUƒk@UVmU@am@kkk¥ƒUƒVUK™„maUb@ŽUb™I@aƒKkkWm@W¯K¯b@VmaULVxUXlVk@UxVJVbUb@xULƒ@ULWW—LƒĕmxVVL@šVb™KUwƒaŲWwX@@WƒUWLU@VbkV@aU@@VUnmJ@VUn@VƒLUK@U‚mUIk@UÇmU@@UW@J@LƒbUmVI@aUmW@@bkXUx@lmLUbm@UbkJ@V@XmlUbkKm@ma@kUaVU@aUK@mImJUIkVƒUƒVUakbWwka@UWKkLUamKUXm`Å_U˜ƒULmaU@@lUV@X"],"encodeOffsets":[[114582,28694]]}},{"type":"Feature","id":"4302","properties":{"name":"株洲市","cp":[113.5327,27.0319],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@X‚‚Unw„Ė˜KXXVK„@VK@wVaUaUIVwl@kUVWUwVKnb@U°a°LXŽ‚@Xnll„L@bšJVa@VanbšƒVL„U„V@al@@UV¯ÅÇ@Ummk™w@¯ƒyVwnUVVVUkmWV—nKVUƒa@WXkVKn@lUVU„VVVXIlV°VnI@VlKnV@mwVm@LXKWkU¥wWwƒƒ@k@m„X@KX¯V@VUVa@VnKWkœƒV@VUkm@aWa@wkUWwkmV£VÿXUVL@mVIXaò@nW@ašUš@@am™@aUU„UmXmWUk@ƒƒnUW@_maVm™wUkamaUL@aƒwƒW@akI@UƒxUm@kmKUk™lUŽ@b„zV˜m¯xUVU@ƒXVxm`kÈlxXVW„@¦kVUn@xƒxƒKUwÅKVXUJWnXŽmVUxWL„¦XŽm„mK—bmUUwW@UV@šk@ƒšVLnŽlbLm`@¦VVkX@`WIUŽxVnlb„WVbXIV‚lI@l¦Ç@UKmbk™W@UbUVU„ƒl@n@VmLXb@JWbUnkbVxUJUxWXXlWL@V@V@XXJWx„zUVVVVKnXW`@bkIUl‚„nLVJUbUIWVXlWV@XklVbnn@xlš"],"encodeOffsets":[[115774,28587]]}},{"type":"Feature","id":"4308","properties":{"name":"张家界市","cp":[110.5115,29.328],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@@InWVw°wš„@š@šblUœKlUlV„U„@VUUUlW@aöUlUlLÞ@@aVKXwlK@UX@@UlwkƒVkUm@m›@ÅVƒ@akwVaUk›UUlUL¯wƒƒ@UUmƒ@UkƒKƒlw±UULVn@l_XyWwÅ@VUUmJUXU@@mmƒU@kxW@UaUIWbU@@mU@UxƒnUbmKk„WJkUValƒ@aUkUxƒlW_@WUIU@ƒbkKWUJVnUb™bWb„lU@nl›„@XnVmV@n—mWV@LXl@X›JXVmzkJUXmƒ™KULm°Vb@xnVmnUšk@ƒƒ™VƒnnlUb@nm¼m@Ûǃ„Vl@X˜mnm„²ŽmL@x™K@LUl@nULÆx@V@VXVWbXX˜l„@nLlm@bVKœX‚W„L°bnUš@VaVUš@šmšVw„JnwVK°zn@V‚Vb„a„@Ċ¼"],"encodeOffsets":[[113288,30471]]}},{"type":"Feature","id":"4313","properties":{"name":"娄底市","cp":[111.6431,27.7185],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@lL„nJ@xln@bnlV„‚„@JœLVUšŽV„nVlw@Uš@VašxVK@a„bnUmÇnV@km@ƒ‚I@VUVVXVaX@@wlVVUkW@_mKXU°‚UbVLnaV@‚V@IUKV@XlVL@w@K@_n@lWlnnJV_XK@l°nšU@WVU@kV@nbVK„V—lƒ@nLlƒ„LXU@ƒlmkw@nW@UKVa¯IVn@@aVUUKl@nXVKVn²a˜ŽXblKnLlmVI@KUU@akLUaVa‚UXm@aƒ@wVUVKnLnWlXl‚n@@U@anUVm@U‚Inm@IUK@UmKVmU_kVUwm@@VmL—K@VƒL™aUaVUUUmKƒ¥ULkšƒVWaXwWa@UXImWUaULUUWKk@WnXbWŽVWnk@UV@bU@@bƒJ@bƒV@XkŽmb™UU`VbkaWzƒ@klU@ƒb@VƒwUL@bV@U`ULVL@VUK@Xm@XWWIUbUxm@@lkkÇwƒVÛÇW@¯Å™UJ@xƒI™xƒ@@VULmKUnUxmKULUUm@@‚ULƒU™JkIWJ@b@LJUW„kJWnUV@nn˜Ü_nJšxU@VbšnUxlškb@lš@"],"encodeOffsets":[[113682,28699]]}},{"type":"Feature","id":"4303","properties":{"name":"湘潭市","cp":[112.5439,27.7075],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@Æ`n_VWnLVblKXL@VlbXxlaVb„U„VlUVJnInJ‚@VL@bUVVb@lnbn@lLVank@W@UlIVan@VanK@kVwlW@aX@Vn@bUJVn„a@K‚IX@@VV@nŽVÈl@VJn@VVL„K@UVm@UnIVm@UV@@blUUaV@XK„V@XW@XxƱ„bVxšLUa@™UKWk™@wmmUalk@WXUWkXUVJVaUImKƒVklJ@aX_mWULUUVUƒyXwWI@W@U@UXKWkXWVwU@±_U»ÝKUaƒLVbkJkƒWmXk@UVVŽmIUV™J@UU@UamLmwUVU@mnJ@VUnmV@b@Vm@kkWmXmKULUV@x„Ž@bWnVUbVblK@bVV@LUJknmKkLWa—±bUmULmWk@VLUV@bm@U°JUbVLX@@mlxkn@„WVƒKk„mK@k„"],"encodeOffsets":[[114683,28576]]}}],"UTF8Encoding":true}; }); -define('echarts/util/mapData/geoJson/jiang_su_geo',[],function() { - return {"type":"FeatureCollection","features":[{"type":"Feature","id":"3209","properties":{"name":"盐城市","cp":[120.2234,33.5577],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@„n@‚°ĀÞ°@¦ULWKkx@bkLWb@lUlVXXJVbƒnUKmxXV@bm@@Xš‚„LޚܦXlVnš‚mzVJ@n@‚²ÞôkƃÞaȰĉ‚wnljÜó„éVÛnĊīČlj‚ĉ@ō@KÞUlU@ƒkklÇÈњÑlġXɛ@UġƒƒaU@U_ƒW@n™@kaUL@VW@kKmkUV@bkbWW@bkzma@ƒJWI@KUKULƒ@U¦™`@XUJ™U@KmXƒw¯KXkmy@aUIWJXXmV@K¯UU@@bVL@¤VLXbV@@JVXVK@„„JVn@bkKmakVVXUVVVlI@`U@nzVVƒb@¤n@@UlKXLVVšI@V@nV@V‚@ÈUx@šóVōšƒkÅWó@mU@bk@Ýwk@WbXxm@@J@zV@kVƒbV‚nLWVUX™WUXUŽWLUŽ@Wl°z@VkxU@UVWIxWJkbƒĬ„nW@@bUl"],"encodeOffsets":[[122344,34504]]}},{"type":"Feature","id":"3203","properties":{"name":"徐州市","cp":[117.5208,34.3268],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@XKVX@WnIVx@K°Lnll@@I°K„nVašU°x²mlxš@VanU@aƒk@akmV@@w™@Ua@aUwVwUw@w›@UK@£kaĉlóIÇVkŽ±@@kUKmVkIkxW@Ua¯UUm@UVI@WVI„JV@ƒ@Um@Uana„U@m‚I@J@XV@XaVlkXƒVaUUWLUyVIXmWak@ƒXkJókƒJUL@KWkk@ULU@Wa™lUIkJmI™mk„VbVš@lV°kXUKWKULU„mb@VUlVnƒb@VV@IVKUUmU@ak@@bmV@xklƒUƒU@UKmV@nƒJVbkXƒKUamLUJ¯UUVmI™bVV—Ll`@LƒLU`m@kXUVU@V„lxUK@xkIWbUKƒx@V‚kVVn™b¯@@U™@ƒxk‚mbkLÇK™b™@@XnJ@LmVklƒ@@XƒlUƒVkxƒakVVb@bVnUbU@@x˜VUšVb@š„ŽnIĊ`šXVVôJš_„K@xlU²Klk„U„@VaVVÈm@kVUVmnamUUaVƒXIVJ„@‚ç@¥nkVLn›„@@XVK@VUX@JVUV@UnVJVLUJVLUVlšnI„b‚KnU@m°™VanI@anV‚KVL„an„lK„blš„KÞk@¦@¤@„VKnLVK„L„KVzlWšLX@VmV@VbnU°@Ualk™˜WXLVU„KWkUUWšƒ@£Wa"],"encodeOffsets":[[121005,35213]]}},{"type":"Feature","id":"3206","properties":{"name":"南通市","cp":[121.1023,32.1625],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@VJ@bnzWl°L„xnW@LšVVI@Wš_V¥„@VKVL@LXJ„I‚@nbly@aXXla@aVUnllLX@@UVKlbš@@m„XV`V@„bĢ„lkČÇƃȘ¯šwnĕVĉVÿšUƒUĠƒŦğlXÑVǵ@±ōLʵĖ¯lÇbÝÞ¯xk@Çkķé™n¯@ğŽġƴǫ@kVVlUbƒL@xULǂóLUl¤@nkVV°VLkxVb@l™aUXUKWĖklVX@¤UšƒUkb"],"encodeOffsets":[[123087,33385]]}},{"type":"Feature","id":"3208","properties":{"name":"淮安市","cp":[118.927,33.4039],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@šnźUôÒɴ胚l¦nĖV‚kbmš„X@xVlVL@xUb@bUJVnUx‚šœ„lKVLÈx‚m„zXV@lW@XV‚b@bȚVxnb‚ƒVIXa°L„aÆVVaXUlK@aXIƄVlXKVUlIXalK@alwXLVK@¥Ý¯¯ÿ@ƒmVk@aX@ƒm„īlaXI‚wXJVUV@lw@U¯yb›UaƒUġUÅaUKVknaġm@kUm@wÆIV±nLÆw„ÇnUUkƒ@ƅÝU¯JÝI¯¦Ul@bƒ@@VVL@l@LƒLÅmƒL@b™@UaVaUWmLUKV¹KƒLWKX¥WI@mXk@UmaUVUU@VmL@W™bkIUWƒUmVóIkbmm™@UbVLUxmJkU@bkJWbnXU`Wz™KUÞÈlVb™Lmx@„kè@Æ"],"encodeOffsets":[[121062,33975]]}},{"type":"Feature","id":"3205","properties":{"name":"苏州市","cp":[120.6519,31.3989],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@ôèĊVnX°¤²„lxƒÈÜ@²x@J@b@X‚`nIUƙUUV@bl@VVnL@L@xƒJ@X@blJXnW@@`XbW„kVƒ@UbVxƒXUxkV@LóxVbUVWš²šVJĸklUǬ@ĢƳĠ°@šmƒī°»ÈÇ¥ULUU±a@bU@¯ƒU@KnImUVWUk™mXUVU@lIVaUUVWKUbUkWKU¥n£WakJUkUL›K¯L™KkƒVIn@VaUƒVUUƒ›UkVk@ƒU@amUkJƒ@UUlwX¥W@@UkVmk@JUakL›@kk¯ÝmJUn@nmVXlmbVVkn@„UJ@±WUxV¯a¯KōbżÇxUxƒšUUlWL"],"encodeOffsets":[[122794,31917]]}},{"type":"Feature","id":"3213","properties":{"name":"宿迁市","cp":[118.5535,33.7775],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@XbWnUJVzXKVVUbW„klUWbU@@W@IJ@nƒVmbVbn@@V@„UŽƒIUJ@XUJ@VVn°VVbX@lwlJnUVL@l²@lÈUôJĊklb@¤VLœ@@xVxUxVx@bVbš@@xU@ln„mnX˜mXLVmV@X@lxVnVJôL„LXa‚x@b„@@KVL@bn@@m@™@alLUUVaU¥nIV±‚I@mXI@aWWXU@LlUXWW_XWmaUwǙ@aaWUX@@kWUƒynÇwUKkL›ƒ™VwUmVI@aVa@wUKUk@wƒWn™laUmĕk¥„™ɳçóÑŹV™mmzkVmm@a@Ióƒk@@LWU@`—„WbXLWlkImJVn@`nXVbXŽmL@Vn@‚l@nUVl°Xx°U@LVĠ@z°˜@¦UV@Xn@VJmV"],"encodeOffsets":[[121005,34560]]}},{"type":"Feature","id":"3207","properties":{"name":"连云港市","cp":[119.1248,34.552],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@@‚lzXxmÆV„„@@¦„@l`XnlKšXXm‚KnLla„b„@„xmbm@kL@V@Vl@@VUXšJX„mbš@@„°Æ@èÈzlW°XĢJlÈ`lInbšWV_@mš™@UUķnƒôw°ÆmnaVƒVÛVmĸ»Ģw±Ý@@mUIny™UmWkۥݙƒK™@Wn@@aWUnwVL„mUaWIUWVk@kkJUVWLUkŃWJ@bkLWVUbÅUƒb¯KWbUJ„WXX`WXkV@KWVXX@bWJ@nJU²mJV¦UbVVkK@b@š@nm@@aUK@Lƒ@@awWbƒKóKUIUmkwW@U@UnWK—nmWƒn@b„l@bmVUb™@kw±n¯w™VUb"],"encodeOffsets":[[121253,35264]]}},{"type":"Feature","id":"3210","properties":{"name":"扬州市","cp":[119.4653,32.8162],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@VUXblVVV„b@xV@kz„V@l‚wVLUbVV@VU@VbUbl‚b@nkĶ°IÞV@Ɔ„VlmVƒÈÅxmKU²ÅJ@xVn@lĢnmbUlVLÆbĢV„V‚bœV‚aXk‚@VXKVVWšXVWXUmKU„aWaU@™¥@£XW‚UUV@@ynam_VWkUVUna@ÆV@mnkWmXkWU„W@k„@@akklƒlWUI@UnKl¥™I@VVma@a@I@U@a@anK@UmK@ÅVUnJl™kI@aVwka@mVIUW@UWL@WÅbmIƒƒULka™UWƒUxkLUKWlXL@VƒImƒÅVƒU™mĉL™Uól¯I±l@ÒUbVbUVVXUJUnVV@lnbl@"],"encodeOffsets":[[121928,33244]]}},{"type":"Feature","id":"3201","properties":{"name":"南京市","cp":[118.8062,31.9208],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@k@ma@kUUVmVIUWVUUaVa@Ѳk°Jôk@Wmk¯KmX¯aUakKƒƒWU„@XU‚LXaV@@mUaVUUl@VmkaUXm@ƒWUUna°IlmV™m™IUW‚@Uk@@aV@VVX@„V‚I°»nm„U@VKVan@m»UaU@U_@WlIUa™aVaUala@¯n@‚ƒkaUkUUWKU@mwkUUmmL@K@ƒLmUUVƒKƒVÅImU—JƒƒVkVVLšèVLVU@W„L„V„š@nVÜULVŽUL@bW@XbWbkJƒUUVUxVXmVk@WUUkVmIƒV@„nbnVWbƒJU„kUULƒa@Jma@XkK@VVL@L@JƒLUVU@V¼ƒnXlƒbm@kbUKmn@lVb@VXXV‚UV@b@LVbÆxXbl@@lV@U„VV@XVK²VlIš`„UbVbUlVVn@WXn@@VUV@„@KmbVLXқLkKƒV@nX@VVUV@b™nVllbšmnb„IWVXU@`lLlknVnmlLlbUmVInK°nUƒU@l@VU@Vn@„ƒ@alI„`VIXaVaVa"],"encodeOffsets":[[121928,33244]]}},{"type":"Feature","id":"3212","properties":{"name":"泰州市","cp":[120.0586,32.5525],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@lUU@@y@In@WwXal@Þxl@@anVô@ÆX„lŎ™ôU@™Vw@ÇUU@@m@U™JUUWKkL@Vm@@£„aUUmyV@@_kJUUVUUWlUnblL@aUmƒI@ƒULUW@IU@WaUK@£UK@aV@°V@LnUWWXIla„VV™@£UWlkXĕVLVWšb@kUalwUKU¯lU@mk£VôKȁVK@w„KVaUkķlUI±™ğ¥ÝUŹš™Ž¯ôm¦ƒĸ™‚@XXK@VVXUJ@nlbUx@blJkšmIUV@ÆnL@VmL@b@b@V@J@bnb‚U@UšJk¦mL@VVJkXk„ll@bƒ@@lƒXXVWlXnml@nÅU@ŽmbUVlVUXn`mb@zU@V‚VWX@¤š¦V@Xb"],"encodeOffsets":[[122592,34015]]}},{"type":"Feature","id":"3202","properties":{"name":"无锡市","cp":[120.3442,31.5527],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@nLƒÒlxUVkL™am@™ƒkVWUULUxVVVbUV@bVLU‚nnź™ÞVĠ¦X™VUUaôw@KlUVw„WUwVa„@lUXƒWa@_X@WmkI@a@W„I@w@KmKUUk@@aVUšVVÅmJ_@W@a@I±wÛ@ƑÇkw±ƒ¯£mWĉUóçƒK¯VkUWK@XkV¯UWabƒmUa™UUb™lln@b@xƒbXŽWX`@„VxUblL@bn@Vb@`m@XbWnn@l¤„n@xnVlU„™VLÆWœkV@VbÞJ‚_nƒl@nKVU@aU™U@mVk°WVLUV¯bVXŽ˜bXlVn@VmL@x—V@bl„š‚@œnW@X@VVJ@²VJVU"],"encodeOffsets":[[123064,32513]]}},{"type":"Feature","id":"3204","properties":{"name":"常州市","cp":[119.4543,31.5582],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@„L˜ŽnxUbVVƒL@xnnW‚nn@VVXn@‚yœImx„„°ƒšL„a‚¥n@VkšKVw„W@nX„VJ@b‚@UVn„ƒ@UnUV@L‚b@`VLklVÞn„Æ@VaXLl™ÈJšmmVUK@aVUUaUUVwVKXVlUš„n@šblKVUkw„ÑmKUVUI@±UI@U@WmX@›™kƒ@a˜U@wnK@UUmWk—aWU°aVUUK¯XUl@nVŽVš@bUVmLk@m„`ÝIUaU@›lÅXUKƒškVmU@wƒmk£m@XmWan@@_Uam@@akKVaUw@ƒW_XW„a@w@akmm@mL@UJmnUKƒ@@XnJWLkKUb@„Vxk„WƒL—aWVUImVULUK@L@lkLVVVllb„m@@°kbVbUbšbVbkJ@XV`V@Vbn¼"],"encodeOffsets":[[122097,32389]]}},{"type":"Feature","id":"3211","properties":{"name":"镇江市","cp":[119.4763,31.9702],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@šVĊKšn„VÆUn„„J@UWKXkVLlKVwX„šVlbVK„„nJÆaš„ķn¥°óÇIkšWKUbÅ@mƒUÝlkUK@_a@KVUVm„@mƒVU@@aUIWƒ@mƒXUx™LUlm@¦ƒb™K¯„ƒƒnw›Jzm@UW@UmmXmm@w„KUUVamw—ƒKm@UbUL@ŽƒVmn¯¼JƒUW@UUU@@bl@@VŽVXšJšnnU‚‚k¯JmbVV„Xn@VWlbUnk@VVUŽVb@nU@WbKWVƒ@XV„„lLVb°bnW°Lnl@X"],"encodeOffsets":[[122097,32997]]}}],"UTF8Encoding":true}; +define('echarts/util/mapData/geoJson/jiang_su_geo',[],function() { + return {"type":"FeatureCollection","features":[{"type":"Feature","id":"3209","properties":{"name":"盐城市","cp":[120.2234,33.5577],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@„n@‚°ĀÞ°@¦ULWKkx@bkLWb@lUlVXXJVbƒnUKmxXV@bm@@Xš‚„LޚܦXlVnš‚mzVJ@n@‚²ÞôkƃÞaȰĉ‚wnljÜó„éVÛnĊīČlj‚ĉ@ō@KÞUlU@ƒkklÇÈњÑlġXɛ@UġƒƒaU@U_ƒW@n™@kaUL@VW@kKmkUV@bkbWW@bkzma@ƒJWI@KUKULƒ@U¦™`@XUJ™U@KmXƒw¯KXkmy@aUIWJXXmV@K¯UU@@bVL@¤VLXbV@@JVXVK@„„JVn@bkKmakVVXUVVVlI@`U@nzVVƒb@¤n@@UlKXLVVšI@V@nV@V‚@ÈUx@šóVōšƒkÅWó@mU@bk@Ýwk@WbXxm@@J@zV@kVƒbV‚nLWVUX™WUXUŽWLUŽ@Wl°z@VkxU@UVWIxWJkbƒĬ„nW@@bUl"],"encodeOffsets":[[122344,34504]]}},{"type":"Feature","id":"3203","properties":{"name":"徐州市","cp":[117.5208,34.3268],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@XKVX@WnIVx@K°Lnll@@I°K„nVašU°x²mlxš@VanU@aƒk@akmV@@w™@Ua@aUwVwUw@w›@UK@£kaĉlóIÇVkŽ±@@kUKmVkIkxW@Ua¯UUm@UVI@WVI„JV@ƒ@Um@Uana„U@m‚I@J@XV@XaVlkXƒVaUUWLUyVIXmWak@ƒXkJókƒJUL@KWkk@ULU@Wa™lUIkJmI™mk„VbVš@lV°kXUKWKULU„mb@VUlVnƒb@VV@IVKUUmU@ak@@bmV@xklƒUƒU@UKmV@nƒJVbkXƒKUamLUJ¯UUVmI™bVV—Ll`@LƒLU`m@kXUVU@V„lxUK@xkIWbUKƒx@V‚kVVn™b¯@@U™@ƒxk‚mbkLÇK™b™@@XnJ@LmVklƒ@@XƒlUƒVkxƒakVVb@bVnUbU@@x˜VUšVb@š„ŽnIĊ`šXVVôJš_„K@xlU²Klk„U„@VaVVÈm@kVUVmnamUUaVƒXIVJ„@‚ç@¥nkVLn›„@@XVK@VUX@JVUV@UnVJVLUJVLUVlšnI„b‚KnU@m°™VanI@anV‚KVL„an„lK„blš„KÞk@¦@¤@„VKnLVK„L„KVzlWšLX@VmV@VbnU°@Ualk™˜WXLVU„KWkUUWšƒ@£Wa"],"encodeOffsets":[[121005,35213]]}},{"type":"Feature","id":"3206","properties":{"name":"南通市","cp":[121.1023,32.1625],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@VJ@bnzWl°L„xnW@LšVVI@Wš_V¥„@VKVL@LXJ„I‚@nbly@aXXla@aVUnllLX@@UVKlbš@@m„XV`V@„bĢ„lkČÇƃȘ¯šwnĕVĉVÿšUƒUĠƒŦğlXÑVǵ@±ōLʵĖ¯lÇbÝÞ¯xk@Çkķé™n¯@ğŽġƴǫ@kVVlUbƒL@xULǂóLUl¤@nkVV°VLkxVb@l™aUXUKWĖklVX@¤UšƒUkb"],"encodeOffsets":[[123087,33385]]}},{"type":"Feature","id":"3208","properties":{"name":"淮安市","cp":[118.927,33.4039],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@šnźUôÒɴ胚l¦nĖV‚kbmš„X@xVlVL@xUb@bUJVnUx‚šœ„lKVLÈx‚m„zXV@lW@XV‚b@bȚVxnb‚ƒVIXa°L„aÆVVaXUlK@aXIƄVlXKVUlIXalK@alwXLVK@¥Ý¯¯ÿ@ƒmVk@aX@ƒm„īlaXI‚wXJVUV@lw@U¯yb›UaƒUġUÅaUKVknaġm@kUm@wÆIV±nLÆw„ÇnUUkƒ@ƅÝU¯JÝI¯¦Ul@bƒ@@VVL@l@LƒLÅmƒL@b™@UaVaUWmLUKV¹KƒLWKX¥WI@mXk@UmaUVUU@VmL@W™bkIUWƒUmVóIkbmm™@UbVLUxmJkU@bkJWbnXU`Wz™KUÞÈlVb™Lmx@„kè@Æ"],"encodeOffsets":[[121062,33975]]}},{"type":"Feature","id":"3205","properties":{"name":"苏州市","cp":[120.6519,31.3989],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@ôèĊVnX°¤²„lxƒÈÜ@²x@J@b@X‚`nIUƙUUV@bl@VVnL@L@xƒJ@X@blJXnW@@`XbW„kVƒ@UbVxƒXUxkV@LóxVbUVWš²šVJĸklUǬ@ĢƳĠ°@šmƒī°»ÈÇ¥ULUU±a@bU@¯ƒU@KnImUVWUk™mXUVU@lIVaUUVWKUbUkWKU¥n£WakJUkUL›K¯L™KkƒVIn@VaUƒVUUƒ›UkVk@ƒU@amUkJƒ@UUlwX¥W@@UkVmk@JUakL›@kk¯ÝmJUn@nmVXlmbVVkn@„UJ@±WUxV¯a¯KōbżÇxUxƒšUUlWL"],"encodeOffsets":[[122794,31917]]}},{"type":"Feature","id":"3213","properties":{"name":"宿迁市","cp":[118.5535,33.7775],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@XbWnUJVzXKVVUbW„klUWbU@@W@IJ@nƒVmbVbn@@V@„UŽƒIUJ@XUJ@VVn°VVbX@lwlJnUVL@l²@lÈUôJĊklb@¤VLœ@@xVxUxVx@bVbš@@xU@ln„mnX˜mXLVmV@X@lxVnVJôL„LXa‚x@b„@@KVL@bn@@m@™@alLUUVaU¥nIV±‚I@mXI@aWWXU@LlUXWW_XWmaUwǙ@aaWUX@@kWUƒynÇwUKkL›ƒ™VwUmVI@aVa@wUKUk@wƒWn™laUmĕk¥„™ɳçóÑŹV™mmzkVmm@a@Ióƒk@@LWU@`—„WbXLWlkImJVn@`nXVbXŽmL@Vn@‚l@nUVl°Xx°U@LVĠ@z°˜@¦UV@Xn@VJmV"],"encodeOffsets":[[121005,34560]]}},{"type":"Feature","id":"3207","properties":{"name":"连云港市","cp":[119.1248,34.552],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@@‚lzXxmÆV„„@@¦„@l`XnlKšXXm‚KnLla„b„@„xmbm@kL@V@Vl@@VUXšJX„mbš@@„°Æ@èÈzlW°XĢJlÈ`lInbšWV_@mš™@UUķnƒôw°ÆmnaVƒVÛVmĸ»Ģw±Ý@@mUIny™UmWkۥݙƒK™@Wn@@aWUnwVL„mUaWIUWVk@kkJUVWLUkŃWJ@bkLWVUbÅUƒb¯KWbUJ„WXX`WXkV@KWVXX@bWJ@nJU²mJV¦UbVVkK@b@š@nm@@aUK@Lƒ@@awWbƒKóKUIUmkwW@U@UnWK—nmWƒn@b„l@bmVUb™@kw±n¯w™VUb"],"encodeOffsets":[[121253,35264]]}},{"type":"Feature","id":"3210","properties":{"name":"扬州市","cp":[119.4653,32.8162],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@VUXblVVV„b@xV@kz„V@l‚wVLUbVV@VU@VbUbl‚b@nkĶ°IÞV@Ɔ„VlmVƒÈÅxmKU²ÅJ@xVn@lĢnmbUlVLÆbĢV„V‚bœV‚aXk‚@VXKVVWšXVWXUmKU„aWaU@™¥@£XW‚UUV@@ynam_VWkUVUna@ÆV@mnkWmXkWU„W@k„@@akklƒlWUI@UnKl¥™I@VVma@a@I@U@a@anK@UmK@ÅVUnJl™kI@aVwka@mVIUW@UWL@WÅbmIƒƒULka™UWƒUxkLUKWlXL@VƒImƒÅVƒU™mĉL™Uól¯I±l@ÒUbVbUVVXUJUnVV@lnbl@"],"encodeOffsets":[[121928,33244]]}},{"type":"Feature","id":"3201","properties":{"name":"南京市","cp":[118.8062,31.9208],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@k@ma@kUUVmVIUWVUUaVa@Ѳk°Jôk@Wmk¯KmX¯aUakKƒƒWU„@XU‚LXaV@@mUaVUUl@VmkaUXm@ƒWUUna°IlmV™m™IUW‚@Uk@@aV@VVX@„V‚I°»nm„U@VKVan@m»UaU@U_@WlIUa™aVaUala@¯n@‚ƒkaUkUUWKU@mwkUUmmL@K@ƒLmUUVƒKƒVÅImU—JƒƒVkVVLšèVLVU@W„L„V„š@nVÜULVŽUL@bW@XbWbkJƒUUVUxVXmVk@WUUkVmIƒV@„nbnVWbƒJU„kUULƒa@Jma@XkK@VVL@L@JƒLUVU@V¼ƒnXlƒbm@kbUKmn@lVb@VXXV‚UV@b@LVbÆxXbl@@lV@U„VV@XVK²VlIš`„UbVbUlVVn@WXn@@VUV@„@KmbVLXқLkKƒV@nX@VVUV@b™nVllbšmnb„IWVXU@`lLlknVnmlLlbUmVInK°nUƒU@l@VU@Vn@„ƒ@alI„`VIXaVaVa"],"encodeOffsets":[[121928,33244]]}},{"type":"Feature","id":"3212","properties":{"name":"泰州市","cp":[120.0586,32.5525],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@lUU@@y@In@WwXal@Þxl@@anVô@ÆX„lŎ™ôU@™Vw@ÇUU@@m@U™JUUWKkL@Vm@@£„aUUmyV@@_kJUUVUUWlUnblL@aUmƒI@ƒULUW@IU@WaUK@£UK@aV@°V@LnUWWXIla„VV™@£UWlkXĕVLVWšb@kUalwUKU¯lU@mk£VôKȁVK@w„KVaUkķlUI±™ğ¥ÝUŹš™Ž¯ôm¦ƒĸ™‚@XXK@VVXUJ@nlbUx@blJkšmIUV@ÆnL@VmL@b@b@V@J@bnb‚U@UšJk¦mL@VVJkXk„ll@bƒ@@lƒXXVWlXnml@nÅU@ŽmbUVlVUXn`mb@zU@V‚VWX@¤š¦V@Xb"],"encodeOffsets":[[122592,34015]]}},{"type":"Feature","id":"3202","properties":{"name":"无锡市","cp":[120.3442,31.5527],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@nLƒÒlxUVkL™am@™ƒkVWUULUxVVVbUV@bVLU‚nnź™ÞVĠ¦X™VUUaôw@KlUVw„WUwVa„@lUXƒWa@_X@WmkI@a@W„I@w@KmKUUk@@aVUšVVÅmJ_@W@a@I±wÛ@ƑÇkw±ƒ¯£mWĉUóçƒK¯VkUWK@XkV¯UWabƒmUa™UUb™lln@b@xƒbXŽWX`@„VxUblL@bn@Vb@`m@XbWnn@l¤„n@xnVlU„™VLÆWœkV@VbÞJ‚_nƒl@nKVU@aU™U@mVk°WVLUV¯bVXŽ˜bXlVn@VmL@x—V@bl„š‚@œnW@X@VVJ@²VJVU"],"encodeOffsets":[[123064,32513]]}},{"type":"Feature","id":"3204","properties":{"name":"常州市","cp":[119.4543,31.5582],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@„L˜ŽnxUbVVƒL@xnnW‚nn@VVXn@‚yœImx„„°ƒšL„a‚¥n@VkšKVw„W@nX„VJ@b‚@UVn„ƒ@UnUV@L‚b@`VLklVÞn„Æ@VaXLl™ÈJšmmVUK@aVUUaUUVwVKXVlUš„n@šblKVUkw„ÑmKUVUI@±UI@U@WmX@›™kƒ@a˜U@wnK@UUmWk—aWU°aVUUK¯XUl@nVŽVš@bUVmLk@m„`ÝIUaU@›lÅXUKƒškVmU@wƒmk£m@XmWan@@_Uam@@akKVaUw@ƒW_XW„a@w@akmm@mL@UJmnUKƒ@@XnJWLkKUb@„Vxk„WƒL—aWVUImVULUK@L@lkLVVVllb„m@@°kbVbUbšbVbkJ@XV`V@Vbn¼"],"encodeOffsets":[[122097,32389]]}},{"type":"Feature","id":"3211","properties":{"name":"镇江市","cp":[119.4763,31.9702],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@šVĊKšn„VÆUn„„J@UWKXkVLlKVwX„šVlbVK„„nJÆaš„ķn¥°óÇIkšWKUbÅ@mƒUÝlkUK@_a@KVUVm„@mƒVU@@aUIWƒ@mƒXUx™LUlm@¦ƒb™K¯„ƒƒnw›Jzm@UW@UmmXmm@w„KUUVamw—ƒKm@UbUL@ŽƒVmn¯¼JƒUW@UUU@@bl@@VŽVXšJšnnU‚‚k¯JmbVV„Xn@VWlbUnk@VVUŽVb@nU@WbKWVƒ@XV„„lLVb°bnW°Lnl@X"],"encodeOffsets":[[122097,32997]]}}],"UTF8Encoding":true}; }); -define('echarts/util/mapData/geoJson/jiang_xi_geo',[],function() { - return {"type":"FeatureCollection","features":[{"type":"Feature","id":"3607","properties":{"name":"赣州市","cp":[115.2795,25.8124],"childNum":18},"geometry":{"type":"Polygon","coordinates":["@@„`l@Èbln„@„KVLl@„V@bȎlnšKXkVlVL@„lJnb„¦VKVVnX„W@w°@VU„mln„UV`šU„bVUV@„xnKVI°KXKVkVL@al@Xa„LVlULWV™VVL@b„x@VXVmb@x@V™VV@nn¤„šlb°b°KXXWbX`lbXx‚z@x„`VIVUnK„L‚x„WXLVKVbVLVU@wnW°b„@nalX„‚mXVJn@U²mKkVl„U@@xlnœaVmlKnœ@JVLlŽnVššl@XXÆèVlUX@xVLXVšb°W@wnUWmXk@K‚LVwUmUkUKUw@wVaVK@kƒ@WnkUKWkwlmXL@KVUlLVKXmWU„L@ašL@malaVk@aa‚ašƒnXš@VVUblb„Jn˜ƒXa„V‚wn£„K@UWmUk@ƒUaWIV@b™JW@KmmU@aUUUkmKkVKlUU™nKVU„lVaV£Å¥WUUK@UkUUw@m@mIkƒƒUUWƒLƒK¯Uw°¯@wUKUbƒKmƒ@kkKUL@UUKV¥U@manw@k@U@Wm@@U@Wwkm„wWaUU@UUmV¯kwƒ@@kmƒkKkUW@UK@ÅV@XWWkXa@Ul@Va@KVaUUU@ƒaXwla@UkVWaXk@K@lmkUmV@Vmbk@ƒ»XIƒ¥VUkƒVUVU@anKVUƒKUalU@wX@˜™@a@K—@ÝwƒL@ŽUnÇlUIkJmn@ŽƒbVVb@VmnkLƒV¯U@ƒ±l—IWmƒ@kaUI@aÇU@K@KUIkbWbƒJUIUyƒX¯ƒUbU@méUUmUk„WK—xWIkJm@V¥U_UJUwmVkšƒUU@ƒƒƒ@knƒwm@UmkWJkL@n@VW@@‚U@knm@kUml@xÅxƒ@@XUJlb„@VX„JVxn@lbV„@lULnV@VlnV@bWV@bXL@lVLVb„V@blLn@Vl„K@xln@bX@lašLVbnKUVVb„KlXVVkxƒV@nnVUb‚lV@@z—°WWkbƒIk‚WL@LUJ@bUI@b™`@UmI@mkK¯XW™™mUV¯@UUVUUam@@VULWUJƒIm`IUJ›KUkW@Uxn‚WbnnmlXbmIUVmV@Vnb@V™LUKWLnÒVVV@V„UL@„kJUV@bƒÈ@ŽšV°šŽ@XVV@l@xUz"],"encodeOffsets":[[116753,26596]]}},{"type":"Feature","id":"3608","properties":{"name":"吉安市","cp":[114.884,26.9659],"childNum":12},"geometry":{"type":"Polygon","coordinates":["@@lxnb@V@bV@ln@‚n„‚lInš@blVXK‚nk¼@VUKWL@b™L@`UXU`ƒ@V¦XLĠ@lJ„¦@„nV@l°nn@‚mVXnaš@nb‚K„n@l„IVƒš@VanJ@_lKVVnš„L@L‚K@Vn@VbšUVanKlLnbnJVbšnWVnVVanI@‚Vb@L„bVKVanXVbVJVU@aXLll„bôlƼXxVLVK@Xn@ƒxnVVVmb@LnVVKVXV@@mnaVXUVnV˜K@_UaUmšwnKV_‚anKVLš»„K@¯ÝU@›™U@kWlUn™lknK‚VnaUkma@ƒUIUwl»Åw@ƒVwV@n™‚n@ÈXlKVmna@kVw@anm‚@n_WWk@™™mUkUK@Im›kLUn›bkm@wV@kƒlUnLV±m@UInWƒkWmbƒ@¯amX@xUVUKUaULWKƒXwƒKmLUVUJƒ_@wyWwkaW_XaWW¯L¯akaƒ™m£@mUUš@U@wnaWU@Uƒw@aUKšUXUVKUkƒKWbk@@bUKUlWL¯LUJmLƒwU@UVƒa™VU_ƒVkmƒnUV¯@@xƒXmWUUULƒ¥makI@ƒUKUkWl™LkmǍ@aƒUk@UKƒLƒ@kmÇak@ƒ_VlkL@`lbnšlLVanLnbmVÆln@škJlbknmKUbÝmmwULUK@bkLWKULUUma@Kk@UV@L@llbVzšxUxnl@bVLmŽšŽ@IVJXœVlƒLV`@bn²@J™@™V@Xmbñ@WbUJ@bm@@LUĬU‚„¦lV@xXb@blnUV"],"encodeOffsets":[[116652,27608]]}},{"type":"Feature","id":"3611","properties":{"name":"上饶市","cp":[117.8613,28.7292],"childNum":12},"geometry":{"type":"Polygon","coordinates":["@@„„@„V‚š„„I°`nm¤²@bVJUVVXUl@Vmb@xV@XbmVVœ@lkLmbn`VbnU‚@Va„UnbVllUXV„a@w°VW@_VWšLššnVlbšLVbnl„KšnVK@IUW@_@am@™‚ÑUólK@U@WU@VwU@UI@aUU‚aXƒƒ@kwmJV@yX@k‚anƒƒ@mkwVmmI@aUU@aUUW@kVkV@@anKš»„XVWnIVUl`@_„W@wlUœV@UWKnU‚bnŽ°InJl„UV@VnI‚b„Wn@VklL@l@Vn²m@U`kI@bWJƒnV@°VXnJm„XVmx@VVL@bkLmWULUmU@ƒbWXb@llnX@‚xkxVV„nVV@¤nL‚nVxnJVXX@˜ššbn`VI„b„@„blmlLnaV@„blWXnlUnbl@„ƒšKVanUVmm_XK@kWWnašU@UnaWUXa›ƒXamUkKmXUWƒLX¯WakKm™nUWwXa@KW_„aXWW_@WnIVl@XU‚LnWVknK@ImyUUÆbXK„Û@W@IÆUnƒVÝlkVK@mUIVwkUVaUm@aVIVyXIƒaÈwmmk@UnanVUmÅaó»lwšW@kkUVmUK@WKLƒUmWULkamK™Lk@Wa@wk@UU@U@mbUIWVKUXWmkUmVm›U@LkakKƒw@w@U™¯ƒ‚ƒUUn¯l@bmn@xkJWxkL@VkI@mƒkmJUI@V@b@VVxnbWlkÈkVƒLƒbkKmVƒL@V@²nxW‚kLUL@xlKVx„bXmVnšWJ@ޙ°@n™xUKUw±`UImVmnU@kalm@akwƒU@UUJmxU@@Uƒ@kU@Um@@Kn™ƒVm@k™KmkU@@WUnkLWxkVUwmKmLkU™bmKUbVŽ@xUnkJ@n±ŽšUxVXUšWJ@LUb™lUnm@ƒW@nknUJUVm@kXllknVbÆK„VVbš¼V„@šUl"],"encodeOffsets":[[119194,29751]]}},{"type":"Feature","id":"3604","properties":{"name":"九江市","cp":[115.4224,29.3774],"childNum":12},"geometry":{"type":"Polygon","coordinates":["@@WUkVUkmaƒVUb@mVUam_nalK@kU›nUWaU@@wna@UVkUWVUUI@a‚±n£m¯_ƒJ™ƒU@ƒƒƒĉ¦Ul@UV™Km™mLlm@ğ¹m`Uk¯@@UVK¯™@UUK@amkmKkVVUa@UkUƒKƒŽUa™L@VVXUJ™@ƒnƒ@™š™WUbƒnVb¯V@LÅlÝIƒJÅkݙm@Ua™WUU@UmUXmmwVUUKWUX±mUam@kWƒzUaVmÇw@aÅLmKXƒ‚UWKkL@W¯IƒwVw™lkUƒJ@Um@ÛÈWŽKUxWkƒaUU@KkLVl@„UKUX±KUb@nVVUbUVmaUlUL@„ƒaUL@‚@nUlWzX`@„V@lx²„@Vlb@bšVÞ@°nl@UxVL@lUbVV@n²xVUVmnUÞb‚a„J@IšV°xnbl@nbÆ@VwnK@VnXlK°xnUlVX„V@Vl@L@lk@W_XK@KƒkWxUL@J„nVx@aX@VVUa˜IXlmL@bVVX@VbnK‚a²XVWƒk°a„@UnV¤nbmLmW@XbmJUbVL„aÞK„L@K@U@aVKlbV@nXlJœxV@VnšŽVȚ„ÞKôbźĕČmV@ĊšŽ²xÆIšV@Þ¦ĸ¼ÞVlŽVÞnxln°Jœk‚LXWVUVUVwnJVI@yn@lXlaXmWI@w—»ma@UmK@akKkXmW@_kaWakKWk@@K@IšWƒkUa„ƒ"],"encodeOffsets":[[119487,30319]]}},{"type":"Feature","id":"3610","properties":{"name":"抚州市","cp":[116.4441,27.4933],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@°V°UnÜ@n@lnLlV@bšV°L„lnLllVzVVXlV„V@@L@xX@WlX„m@UVƒL@V@n„°škVmVUnKlaXxVbšnlU@lVVnaVI@aX@V„šJš@V„@b„b@šVbš‚@X@lUL@Ž@VlIVm@wUVanLšalVnKnLVxlUXwlKVm@k@Una@mWIXKWUÛVƒk@a@UVWn@@kl@@W„XlW@_Um@UVK@a„LnalInWV@@xnI@¥‚K„—šm@kKmƒnk@mlI„¤laXbVblknV@U‚KXVlUXa‚@@Unw@±mU@ak_±a@ƒUJUIƒVKW_Xa@aWU™šK@mmUVa@IXa@UWmšannlmX¯WKXwVUVwƒ@XUlK@klJXa@kƒkmm@Uwƒw@¯ƒW¯kw@WmbULƒaUUU@mVUU™WmkUb™KmkkK@aƒkUƒ¯¥Uƒl—ƒm@akU@mš@KVIVV@KUkUVUkaƒUWb—„mƒIkaVaUU™@mW™„b‚b@bUlkb‚b@n™K@bƒKXVWnULkKUV@LWKknlxXŽVLml@X„Ž@lULUb@xVxVLVlVnUxK@LWlXnmV@x¯X™aWUUK@wVWUkÅçm`@mn@bUx@lmbUnkLÇWm@mšU@Ux@„Æxk¼VxVJ@„nbVlmbUmLklmškVlX@‚VœšV@°Þ"],"encodeOffsets":[[118508,28396]]}},{"type":"Feature","id":"3609","properties":{"name":"宜春市","cp":[115.0159,28.3228],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@@VlbnK@b@JšLlUnx±ĀXxÆW„X@lš@V„@@blJ@nX@˜xUbVVUbVV@b—VmnmJœ„@bmbm@klUbƒLmbœš@lVb@xUX@bVVVbV¤@LVV„bXlVw‚LXÜÇn@@V„IlVškUx„x°J@XlKXLV„‚WnLÆK@bÈxUnVb„ylXn@Vbn‚W²XV‚LVVUŽnxWnnV@VVVšXVbn@ޚÆl„IÞJÆk@K°UUa„mVa@UUUš»@wV@VƒkkUKUVW£U@UmW@@aXkVUnVlKVV„UUkVmU™@kWaUanU„VVamIX¥W@@aUaUVW@_mW@UnIVVn@VbVm@bVL@anKVUkƒWK„UXV‚Ikx‚@na„bVK„b@nVJ„_V›@Vw„‚VUVVXUlUUaV@X@VblašbnKlkVaXaƒ¯@m@U„KVUn@WƒXkW@@w@KU@UƒWkUUUykkmKƒk¯K™U@akUmK@k@mmÛ¯V¯U@‚ƒL™¼UKmLbU`mL™xVnVb@`—LmUVUUWmb@nU@UWULmU@KnaUUmU„wmJ¯IUJWIkVkaWVUIUlWaUIUVkKmbUIƒÒlVUnnŽ@VlLUJ@bUX¯@ƒaWVUKUXƒKUbm@UwKWa@a@VkUWn™@Uak@mbX„WJXbm@mL—aWVk@™wƒL@WmanU@knwWmkaWL—KWUXaƒU@¥l„UVVVbnwƒ¥nKV™»@aUk@a@UƒJ@kƒmLma™@mbUWnm@ULǺ@LXnmxUŽm@UbkbW@@akLmWk@UXmJmUkV@VUXVlULmKUxkL@lmXnJ@X‚l°Vnb@bU@WbKUX@VmKUX"],"encodeOffsets":[[116652,28666]]}},{"type":"Feature","id":"3601","properties":{"name":"南昌市","cp":[116.0046,28.6633],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@šXš™„@„mš@VIUW@UšKVb„„LlV@VVbUŽlUnLnl@bVL@V°šUL@V°@Vln_Ġºn@‚knKnššLVU@VkĊ¥Vk@™Uƒ™»UaƒUÅLUalmkklWn@VUVIlm@m„Xn@VmškVa@KXIV™UWVw‚™²@m@U@VK@k@W™Ua@™ƒa@aUƒ™@™IUƒW@@bUJmbUU@kkV™mUaWwkbmLUVUn™lWbUbklmL™akbUaW@U@VbkVWVUUUVƒUx@‚Uœƒ`UI@mƒaULƒamb@lwJWUƒVXLl„UVmL@bUK@aUnUam@UUmJ@VnX@`UXVŽVb@bX@W¦nJUbƒUmVVbXb@lVšUnVlƒVUUkLmUUVWl@bX@VnV@X¤VUVLllU„U@@x™¼VV@V"],"encodeOffsets":[[118249,29700]]}},{"type":"Feature","id":"3602","properties":{"name":"景德镇市","cp":[117.334,29.3225],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@VVX@Vbmz„xUlU@mbmL@V²xVbUVVblbX@šVškVykValKVI@bn@n`lVWnX@l„L@™WKnƒVIVa@¯nK@alIXJVIVWUw‚ƒn@nU˜„nK@alI@a@anKm_™a—™W@UWmIUwmmK@£UUƒmUUlwwW@km@kWaX„aV@VnVKnXlK@aUK@UnwWUnƒmIUW@¯mU„XI@alJV_n@m±@U@kkKUlm@ƒXamJ@UVUkƒmI¯JmamVXL@V›UkV@xƒX@`k_UVmJUXƒW™¼mL@bU@UllX@VV@bVV@bnJUnlx@n„Žm„b@lWŽ@zU‚nIlx„@W„bVV@bVJV@UxV@@X@VkLVôÒ‚šn@@b@`VX@J"],"encodeOffsets":[[119903,30409]]}},{"type":"Feature","id":"3603","properties":{"name":"萍乡市","cp":[113.9282,27.4823],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@VWnL@UVW‚LXaV@@ama¯Uk@WmInW@klKVwnLVKUkVW@UlUnVnIVWl@nXlK@bX@laVan@VnwWm@KȹVK¯m@kmU@ƒƒ¥kIğ@WKU¥„@V_VW@_šK@aXKVL@Ul»mWLkU@am™kJƒm@kmU@@a@UmakwU@›„Xlƒ@VXk`UIW¼kWWX@‚œ@l‚xV¦XlW@Ubn„@ŽmUkL@UmJ¯UkUWVUaƒUlm@UXWl„nUJ@LmLU˜nXll@bUVUUmVUn„Ž@¦šxlŽnn@VÆÈU°kbV„VxllnL@VnVVUl@V„„anL"],"encodeOffsets":[[116652,28666]]}},{"type":"Feature","id":"3606","properties":{"name":"鹰潭市","cp":[117.0813,28.2349],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@@XV@nlšL@lUnš„mŽ@Ln@@VlV„@@VV@nwVI@V„Vlx@bknlbV@nmnUVJ‚_²‚VxVLšw@mš¯@ÝXIm™nUWƒaUwkL@wVKlKXmw@±@U„KnUlL„a„KlUlÇXkmaUw@U@a@Uƒ™UkwUJ@zWJ™w@WbkVWUL@VmUklUaWakbƒ£kJ@nmln„lL@Ž™nƒ˜L@¦mJ@wU@mXkJmbƒK@bUL@VVn@`kXƒW@Xk@@lm@UX@V@b„lÜUXVWLXJ@nmb@V@l"],"encodeOffsets":[[119599,29025]]}},{"type":"Feature","id":"3605","properties":{"name":"新余市","cp":[114.95,27.8174],"childNum":2},"geometry":{"type":"Polygon","coordinates":["@@m@@WULUKWwÅ»ókƒakkWK@bUVUIUamWUbULƒa@KUa@mJUbmUXU™mUamImakKmLUb™VUam@@UL@KƒKm™UUkL@`mIUb™@U„@V@bVl@bš¼UŽmL„¦mxUaUUƒVkŽ@¦„VWbXV˜LXKlbXnmx@lmVnb@X„Kšxl@XU˜bnKn@WaXIWƒnal@Vbš@XmlV@U@bXb‚LVxn@Va„LVWVLXU„b°@VW@aVIkK@UmVmkU„ÑVJnalLVUVJXbVkVJXUlblUXJVI°JnI"],"encodeOffsets":[[118182,28542]]}}],"UTF8Encoding":true}; +define('echarts/util/mapData/geoJson/jiang_xi_geo',[],function() { + return {"type":"FeatureCollection","features":[{"type":"Feature","id":"3607","properties":{"name":"赣州市","cp":[115.2795,25.8124],"childNum":18},"geometry":{"type":"Polygon","coordinates":["@@„`l@Èbln„@„KVLl@„V@bȎlnšKXkVlVL@„lJnb„¦VKVVnX„W@w°@VU„mln„UV`šU„bVUV@„xnKVI°KXKVkVL@al@Xa„LVlULWV™VVL@b„x@VXVmb@x@V™VV@nn¤„šlb°b°KXXWbX`lbXx‚z@x„`VIVUnK„L‚x„WXLVKVbVLVU@wnW°b„@nalX„‚mXVJn@U²mKkVl„U@@xlnœaVmlKnœ@JVLlŽnVššl@XXÆèVlUX@xVLXVšb°W@wnUWmXk@K‚LVwUmUkUKUw@wVaVK@kƒ@WnkUKWkwlmXL@KVUlLVKXmWU„L@ašL@malaVk@aa‚ašƒnXš@VVUblb„Jn˜ƒXa„V‚wn£„K@UWmUk@ƒUaWIV@b™JW@KmmU@aUUUkmKkVKlUU™nKVU„lVaV£Å¥WUUK@UkUUw@m@mIkƒƒUUWƒLƒK¯Uw°¯@wUKUbƒKmƒ@kkKUL@UUKV¥U@manw@k@U@Wm@@U@Wwkm„wWaUU@UUmV¯kwƒ@@kmƒkKkUW@UK@ÅV@XWWkXa@Ul@Va@KVaUUU@ƒaXwla@UkVWaXk@K@lmkUmV@Vmbk@ƒ»XIƒ¥VUkƒVUVU@anKVUƒKUalU@wX@˜™@a@K—@ÝwƒL@ŽUnÇlUIkJmn@ŽƒbVVb@VmnkLƒV¯U@ƒ±l—IWmƒ@kaUI@aÇU@K@KUIkbWbƒJUIUyƒX¯ƒUbU@méUUmUk„WK—xWIkJm@V¥U_UJUwmVkšƒUU@ƒƒƒ@knƒwm@UmkWJkL@n@VW@@‚U@knm@kUml@xÅxƒ@@XUJlb„@VX„JVxn@lbV„@lULnV@VlnV@bWV@bXL@lVLVb„V@blLn@Vl„K@xln@bX@lašLVbnKUVVb„KlXVVkxƒV@nnVUb‚lV@@z—°WWkbƒIk‚WL@LUJ@bUI@b™`@UmI@mkK¯XW™™mUV¯@UUVUUam@@VULWUJƒIm`IUJ›KUkW@Uxn‚WbnnmlXbmIUVmV@Vnb@V™LUKWLnÒVVV@V„UL@„kJUV@bƒÈ@ŽšV°šŽ@XVV@l@xUz"],"encodeOffsets":[[116753,26596]]}},{"type":"Feature","id":"3608","properties":{"name":"吉安市","cp":[114.884,26.9659],"childNum":12},"geometry":{"type":"Polygon","coordinates":["@@lxnb@V@bV@ln@‚n„‚lInš@blVXK‚nk¼@VUKWL@b™L@`UXU`ƒ@V¦XLĠ@lJ„¦@„nV@l°nn@‚mVXnaš@nb‚K„n@l„IVƒš@VanJ@_lKVVnš„L@L‚K@Vn@VbšUVanKlLnbnJVbšnWVnVVanI@‚Vb@L„bVKVanXVbVJVU@aXLll„bôlƼXxVLVK@Xn@ƒxnVVVmb@LnVVKVXV@@mnaVXUVnV˜K@_UaUmšwnKV_‚anKVLš»„K@¯ÝU@›™U@kWlUn™lknK‚VnaUkma@ƒUIUwl»Åw@ƒVwV@n™‚n@ÈXlKVmna@kVw@anm‚@n_WWk@™™mUkUK@Im›kLUn›bkm@wV@kƒlUnLV±m@UInWƒkWmbƒ@¯amX@xUVUKUaULWKƒXwƒKmLUVUJƒ_@wyWwkaW_XaWW¯L¯akaƒ™m£@mUUš@U@wnaWU@Uƒw@aUKšUXUVKUkƒKWbk@@bUKUlWL¯LUJmLƒwU@UVƒa™VU_ƒVkmƒnUV¯@@xƒXmWUUULƒ¥makI@ƒUKUkWl™LkmǍ@aƒUk@UKƒLƒ@kmÇak@ƒ_VlkL@`lbnšlLVanLnbmVÆln@škJlbknmKUbÝmmwULUK@bkLWKULUUma@Kk@UV@L@llbVzšxUxnl@bVLmŽšŽ@IVJXœVlƒLV`@bn²@J™@™V@Xmbñ@WbUJ@bm@@LUĬU‚„¦lV@xXb@blnUV"],"encodeOffsets":[[116652,27608]]}},{"type":"Feature","id":"3611","properties":{"name":"上饶市","cp":[117.8613,28.7292],"childNum":12},"geometry":{"type":"Polygon","coordinates":["@@„„@„V‚š„„I°`nm¤²@bVJUVVXUl@Vmb@xV@XbmVVœ@lkLmbn`VbnU‚@Va„UnbVllUXV„a@w°VW@_VWšLššnVlbšLVbnl„KšnVK@IUW@_@am@™‚ÑUólK@U@WU@VwU@UI@aUU‚aXƒƒ@kwmJV@yX@k‚anƒƒ@mkwVmmI@aUU@aUUW@kVkV@@anKš»„XVWnIVUl`@_„W@wlUœV@UWKnU‚bnŽ°InJl„UV@VnI‚b„Wn@VklL@l@Vn²m@U`kI@bWJƒnV@°VXnJm„XVmx@VVL@bkLmWULUmU@ƒbWXb@llnX@‚xkxVV„nVV@¤nL‚nVxnJVXX@˜ššbn`VI„b„@„blmlLnaV@„blWXnlUnbl@„ƒšKVanUVmm_XK@kWWnašU@UnaWUXa›ƒXamUkKmXUWƒLX¯WakKm™nUWwXa@KW_„aXWW_@WnIVl@XU‚LnWVknK@ImyUUÆbXK„Û@W@IÆUnƒVÝlkVK@mUIVwkUVaUm@aVIVyXIƒaÈwmmk@UnanVUmÅaó»lwšW@kkUVmUK@WKLƒUmWULkamK™Lk@Wa@wk@UU@U@mbUIWVKUXWmkUmVm›U@LkakKƒw@w@U™¯ƒ‚ƒUUn¯l@bmn@xkJWxkL@VkI@mƒkmJUI@V@b@VVxnbWlkÈkVƒLƒbkKmVƒL@V@²nxW‚kLUL@xlKVx„bXmVnšWJ@ޙ°@n™xUKUw±`UImVmnU@kalm@akwƒU@UUJmxU@@Uƒ@kU@Um@@Kn™ƒVm@k™KmkU@@WUnkLWxkVUwmKmLkU™bmKUbVŽ@xUnkJ@n±ŽšUxVXUšWJ@LUb™lUnm@ƒW@nknUJUVm@kXllknVbÆK„VVbš¼V„@šUl"],"encodeOffsets":[[119194,29751]]}},{"type":"Feature","id":"3604","properties":{"name":"九江市","cp":[115.4224,29.3774],"childNum":12},"geometry":{"type":"Polygon","coordinates":["@@WUkVUkmaƒVUb@mVUam_nalK@kU›nUWaU@@wna@UVkUWVUUI@a‚±n£m¯_ƒJ™ƒU@ƒƒƒĉ¦Ul@UV™Km™mLlm@ğ¹m`Uk¯@@UVK¯™@UUK@amkmKkVVUa@UkUƒKƒŽUa™L@VVXUJ™@ƒnƒ@™š™WUbƒnVb¯V@LÅlÝIƒJÅkݙm@Ua™WUU@UmUXmmwVUUKWUX±mUam@kWƒzUaVmÇw@aÅLmKXƒ‚UWKkL@W¯IƒwVw™lkUƒJ@Um@ÛÈWŽKUxWkƒaUU@KkLVl@„UKUX±KUb@nVVUbUVmaUlUL@„ƒaUL@‚@nUlWzX`@„V@lx²„@Vlb@bšVÞ@°nl@UxVL@lUbVV@n²xVUVmnUÞb‚a„J@IšV°xnbl@nbÆ@VwnK@VnXlK°xnUlVX„V@Vl@L@lk@W_XK@KƒkWxUL@J„nVx@aX@VVUa˜IXlmL@bVVX@VbnK‚a²XVWƒk°a„@UnV¤nbmLmW@XbmJUbVL„aÞK„L@K@U@aVKlbV@nXlJœxV@VnšŽVȚ„ÞKôbźĕČmV@ĊšŽ²xÆIšV@Þ¦ĸ¼ÞVlŽVÞnxln°Jœk‚LXWVUVUVwnJVI@yn@lXlaXmWI@w—»ma@UmK@akKkXmW@_kaWakKWk@@K@IšWƒkUa„ƒ"],"encodeOffsets":[[119487,30319]]}},{"type":"Feature","id":"3610","properties":{"name":"抚州市","cp":[116.4441,27.4933],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@°V°UnÜ@n@lnLlV@bšV°L„lnLllVzVVXlV„V@@L@xX@WlX„m@UVƒL@V@n„°škVmVUnKlaXxVbšnlU@lVVnaVI@aX@V„šJš@V„@b„b@šVbš‚@X@lUL@Ž@VlIVm@wUVanLšalVnKnLVxlUXwlKVm@k@Una@mWIXKWUÛVƒk@a@UVWn@@kl@@W„XlW@_Um@UVK@a„LnalInWV@@xnI@¥‚K„—šm@kKmƒnk@mlI„¤laXbVblknV@U‚KXVlUXa‚@@Unw@±mU@ak_±a@ƒUJUIƒVKW_Xa@aWU™šK@mmUVa@IXa@UWmšannlmX¯WKXwVUVwƒ@XUlK@klJXa@kƒkmm@Uwƒw@¯ƒW¯kw@WmbULƒaUUU@mVUU™WmkUb™KmkkK@aƒkUƒ¯¥Uƒl—ƒm@akU@mš@KVIVV@KUkUVUkaƒUWb—„mƒIkaVaUU™@mW™„b‚b@bUlkb‚b@n™K@bƒKXVWnULkKUV@LWKknlxXŽVLml@X„Ž@lULUb@xVxVLVlVnUxK@LWlXnmV@x¯X™aWUUK@wVWUkÅçm`@mn@bUx@lmbUnkLÇWm@mšU@Ux@„Æxk¼VxVJ@„nbVlmbUmLklmškVlX@‚VœšV@°Þ"],"encodeOffsets":[[118508,28396]]}},{"type":"Feature","id":"3609","properties":{"name":"宜春市","cp":[115.0159,28.3228],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@@VlbnK@b@JšLlUnx±ĀXxÆW„X@lš@V„@@blJ@nX@˜xUbVVUbVV@b—VmnmJœ„@bmbm@klUbƒLmbœš@lVb@xUX@bVVVbV¤@LVV„bXlVw‚LXÜÇn@@V„IlVškUx„x°J@XlKXLV„‚WnLÆK@bÈxUnVb„ylXn@Vbn‚W²XV‚LVVUŽnxWnnV@VVVšXVbn@ޚÆl„IÞJÆk@K°UUa„mVa@UUUš»@wV@VƒkkUKUVW£U@UmW@@aXkVUnVlKVV„UUkVmU™@kWaUanU„VVamIX¥W@@aUaUVW@_mW@UnIVVn@VbVm@bVL@anKVUkƒWK„UXV‚Ikx‚@na„bVK„b@nVJ„_V›@Vw„‚VUVVXUlUUaV@X@VblašbnKlkVaXaƒ¯@m@U„KVUn@WƒXkW@@w@KU@UƒWkUUUykkmKƒk¯K™U@akUmK@k@mmÛ¯V¯U@‚ƒL™¼UKmLbU`mL™xVnVb@`—LmUVUUWmb@nU@UWULmU@KnaUUmU„wmJ¯IUJWIkVkaWVUIUlWaUIUVkKmbUIƒÒlVUnnŽ@VlLUJ@bUX¯@ƒaWVUKUXƒKUbm@UwKWa@a@VkUWn™@Uak@mbX„WJXbm@mL—aWVk@™wƒL@WmanU@knwWmkaWL—KWUXaƒU@¥l„UVVVbnwƒ¥nKV™»@aUk@a@UƒJ@kƒmLma™@mbUWnm@ULǺ@LXnmxUŽm@UbkbW@@akLmWk@UXmJmUkV@VUXVlULmKUxkL@lmXnJ@X‚l°Vnb@bU@WbKUX@VmKUX"],"encodeOffsets":[[116652,28666]]}},{"type":"Feature","id":"3601","properties":{"name":"南昌市","cp":[116.0046,28.6633],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@šXš™„@„mš@VIUW@UšKVb„„LlV@VVbUŽlUnLnl@bVL@V°šUL@V°@Vln_Ġºn@‚knKnššLVU@VkĊ¥Vk@™Uƒ™»UaƒUÅLUalmkklWn@VUVIlm@m„Xn@VmškVa@KXIV™UWVw‚™²@m@U@VK@k@W™Ua@™ƒa@aUƒ™@™IUƒW@@bUJmbUU@kkV™mUaWwkbmLUVUn™lWbUbklmL™akbUaW@U@VbkVWVUUUVƒUx@‚Uœƒ`UI@mƒaULƒamb@lwJWUƒVXLl„UVmL@bUK@aUnUam@UUmJ@VnX@`UXVŽVb@bX@W¦nJUbƒUmVVbXb@lVšUnVlƒVUUkLmUUVWl@bX@VnV@X¤VUVLllU„U@@x™¼VV@V"],"encodeOffsets":[[118249,29700]]}},{"type":"Feature","id":"3602","properties":{"name":"景德镇市","cp":[117.334,29.3225],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@VVX@Vbmz„xUlU@mbmL@V²xVbUVVblbX@šVškVykValKVI@bn@n`lVWnX@l„L@™WKnƒVIVa@¯nK@alIXJVIVWUw‚ƒn@nU˜„nK@alI@a@anKm_™a—™W@UWmIUwmmK@£UUƒmUUlwwW@km@kWaX„aV@VnVKnXlK@aUK@UnwWUnƒmIUW@¯mU„XI@alJV_n@m±@U@kkKUlm@ƒXamJ@UVUkƒmI¯JmamVXL@V›UkV@xƒX@`k_UVmJUXƒW™¼mL@bU@UllX@VV@bVV@bnJUnlx@n„Žm„b@lWŽ@zU‚nIlx„@W„bVV@bVJV@UxV@@X@VkLVôÒ‚šn@@b@`VX@J"],"encodeOffsets":[[119903,30409]]}},{"type":"Feature","id":"3603","properties":{"name":"萍乡市","cp":[113.9282,27.4823],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@VWnL@UVW‚LXaV@@ama¯Uk@WmInW@klKVwnLVKUkVW@UlUnVnIVWl@nXlK@bX@laVan@VnwWm@KȹVK¯m@kmU@ƒƒ¥kIğ@WKU¥„@V_VW@_šK@aXKVL@Ul»mWLkU@am™kJƒm@kmU@@a@UmakwU@›„Xlƒ@VXk`UIW¼kWWX@‚œ@l‚xV¦XlW@Ubn„@ŽmUkL@UmJ¯UkUWVUaƒUlm@UXWl„nUJ@LmLU˜nXll@bUVUUmVUn„Ž@¦šxlŽnn@VÆÈU°kbV„VxllnL@VnVVUl@V„„anL"],"encodeOffsets":[[116652,28666]]}},{"type":"Feature","id":"3606","properties":{"name":"鹰潭市","cp":[117.0813,28.2349],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@@XV@nlšL@lUnš„mŽ@Ln@@VlV„@@VV@nwVI@V„Vlx@bknlbV@nmnUVJ‚_²‚VxVLšw@mš¯@ÝXIm™nUWƒaUwkL@wVKlKXmw@±@U„KnUlL„a„KlUlÇXkmaUw@U@a@Uƒ™UkwUJ@zWJ™w@WbkVWUL@VmUklUaWakbƒ£kJ@nmln„lL@Ž™nƒ˜L@¦mJ@wU@mXkJmbƒK@bUL@VVn@`kXƒW@Xk@@lm@UX@V@b„lÜUXVWLXJ@nmb@V@l"],"encodeOffsets":[[119599,29025]]}},{"type":"Feature","id":"3605","properties":{"name":"新余市","cp":[114.95,27.8174],"childNum":2},"geometry":{"type":"Polygon","coordinates":["@@m@@WULUKWwÅ»ókƒakkWK@bUVUIUamWUbULƒa@KUa@mJUbmUXU™mUamImakKmLUb™VUam@@UL@KƒKm™UUkL@`mIUb™@U„@V@bVl@bš¼UŽmL„¦mxUaUUƒVkŽ@¦„VWbXV˜LXKlbXnmx@lmVnb@X„Kšxl@XU˜bnKn@WaXIWƒnal@Vbš@XmlV@U@bXb‚LVxn@Va„LVWVLXU„b°@VW@aVIkK@UmVmkU„ÑVJnalLVUVJXbVkVJXUlblUXJVI°JnI"],"encodeOffsets":[[118182,28542]]}}],"UTF8Encoding":true}; }); -define('echarts/util/mapData/geoJson/ji_lin_geo',[],function() { - return {"type":"FeatureCollection","features":[{"type":"Feature","id":"2224","properties":{"name":"延边朝鲜族自治州","cp":[129.397,43.2587],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@Wxĵ„mš@„ó¤VX@@xܼƨš²xWxƒV„V@„XVƒ„„„ƒbWšXllaÞU°Ċ„@ô¼„LôÝWanV¥ƒÑnĉ°¥šÅX¥°¯@w°w@»°k£°mÈŹ‚mÈbƃŎ¦„K°z@Žkxl¦UbU¤šššklV„KŤÞȰ@@bšV@nVVUlÞ¦lUllœVlU°ÑU¯Vƒ°w„bXxl@VŽ²„˜@n„ô¼ƒó°™kmVk²ĕ‚w@wV™ÞÞ@@Ġƒö»˜¯œ@‚„šbnb°mÞ¯°V°„ÈJmX¥mam™UřƒUƒlaU¯™ƒ@w™Kk—l±n@@wƒkÝVUUl±¯I¯b™a™lƒ@™kLmakbƒ@ġƒŹé°™Þb°šékƒƒLm™„wX™‚aÅb@bVlƒbVb—ÒVbUb›UUanwƒakbVŽUV›ak„¯„UŽƒLmxV°UxnôŻX@J„Xkl‚bkbĉaƒbƒWU„ƒ@ƒk„WUU¯@@klmƒ@@™Å@aƒwWXlKkI@WbUaVIUanUƒƒ@ĕƒ¯K™„mUnWUwm@£ċèkUmbUmm@@nkJUalwk@@nmWUan_óaWmnw±KœIƒwl@UmƒI@an@@mlUÅmV_™KUkƒ@U`@_ƒKUmU™@U¯™mmb¯@kb™ImV¯ƒƒLkbƒKƒƒÛ@ÇnɱJóaÝĢkb@„›x—ÒÇllœ@‚Ž²V‚„ÆUVV„UÇ°X„óxlV¯„lV@bƒV@n—x›@—¤@„șŎnxV¼knšJ‚nšKX°˜¦UlnVbUbÆVnÞWVX¦llšb@l°œVJôÒnLVbšbXŽ"],"encodeOffsets":[[131086,44798]]}},{"type":"Feature","id":"2202","properties":{"name":"吉林市","cp":[126.8372,43.6047],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@ôl‚zšaÈV°„šK@„mŽ—LWl™nšVxUV‚È@ŽÝĬUÈn‚ôLša‚„²VmĀkV@„ĠĊnU@b„V@b˜@nl°UVnÞaôJ@bš™V„¦mlkššbmVXx¯@Vxm„nbƒ„šbÈK‚V@bÈL„wĠyônšmnbÜ@nn„V˜x@n²K‚„„J@k„al@nxÞU„Lź±Vwkw¯LWWUš™kŎīVwƒw„°y„Vĕ°wÈVlkÛ»@wW@Uô£@ƒn™ĶƒXwW™aUamKóÑUI¯›@k™akkW¥XUmÝÅUVaUa‚mVk—¥W¯™Lm™IlmU»mwȚō@ƒ˜£kJUÇk@am¯y¯UVwƒa@wġx¦ƒKƒƒ¯X°Ċ¯¦U°ċWULÅa±b¯@UkÅWmVƒ™ƒkIUlóŽċ¹™`óIƒlX„WŽXxmbUƒLݏƒbƧ@ƒx¯bƒÈ—l@xƒš¯zƒaݤ@nšm„VWb²bmn¯J¯Ò@n„š"],"encodeOffsets":[[128701,44303]]}},{"type":"Feature","id":"2208","properties":{"name":"白城市","cp":[123.0029,45.2637],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@ó™ǩŁ@WlwUaƑwÛÅÇéĉamKƒōÇ@Iƒ™ôġVƒȁÑŹçƒ™ÝUƧċĉwóóÝ@Ƒ»ğL¯ll²@ƆÅV@¦m‚Åb@nmlU²VxšlUn™@VbnW„bÇbk҃š„n@èlnlšU҄Ž°Lšx@¼ĉb@҄šUŽċxՃènLVxƒÒƒbÅJ±a@_ÅJÅnƒŽVb„Kl„nUÜĊ@„Uš™xXVÆn„mšVššJÞ¯V™ĠwšƒXw°xWL„x„KV¦ôU„wVÝǬóÞޙ¼‚‚„ÞkŽVôȘxބU„lVn¦ÞšĊa°w„b°@šbÆw„lŤL²`„z°@V@@™nJVnl@@¥nUmmn„@mwnmmUnk@mlwUaƒLnƒ›wn¯°anƒWakI„ƒÇmXwÆamUXUlJXa‚UUklKUknmÞV@‚K@VWÞ@VkUwVƒ"],"encodeOffsets":[[127350,46553]]}},{"type":"Feature","id":"2207","properties":{"name":"松原市","cp":[124.0906,44.7198],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@„šźèȂÒU„óĢ„š@JŎȄ‚‚LnŽĊbÈêÜƃxVbkx@XǪłôš„kÞ`„šW„b@n°ašbšKšnVw°`š_X`W„š¦„ĊIkmVšakw‚K„x°UÞb„U@lšƒl@°¦œVW„šaÞbšxÞI@mVI@ƒVkŚUWK„¥nL‚a@ƒ„@ȍ„@°ƒÆ@nU@KÞalkUwVékUWw„™kU›VkkƒJk¯@»ókƒV¯ÆÇI@bĉô¯@™ķw¯nmmÅL¯wƒVƒUÞy@UówÇLkmm@@UóxkkĉmL¯wVwkWWX™mLõm@kűV_ƒƒô»ÛƒÆ¯@™Va™VšaĠVlmğwķUóÝƽ£ÇJkbǫaƽLW@nxݤkzƒy¯XɅm@VšôÇX¯Ė¯ºÝnUŽnLVlUÔmV"],"encodeOffsets":[[126068,45580]]}},{"type":"Feature","id":"2201","properties":{"name":"长春市","cp":[125.8154,44.2584],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@„U°xÆKnn°mĸxš°@Ċó@aÈJ°Å„Uôl@¼l°„IllœUlVƒšXxlVUêVxkllnÈUVll@Vx²IÞ¤VUlVnIôlރlwô_„›„bVaĶLXÅÞÇ@K˜¯@wÛaƒçn¥š¯WXyW¯XwƒUmmÛ@ma™nómğzƒxÇK@aUÇL™a„ƒmanƒUw°@WwnU™al™nkƒ¥šU™@aóIÝbUm¯Vmk—@@aƒU@amVğĉ@ƒlUnÿ±Uƒ™bóKmVÇÞī@ÇVUUw‚™šmXk˜Kn@ƒ™L¯ƒÇU™byókōè@b‚n@lÝX@x¯ô@ƙUV_maXm@aóƒJWxnX@ŽVVnĖVnUJ@nōÆǼV¼kxƒLklÝw@xƒx@zV`ÅbmxU±xU„nnm‚kn‚ŽğU™bUŽ‚šUb@šÅ°Ü„󼄄U`Ʋ@lön‚KšnXWlXUx°xnKĊllôw@Vn@lnÈKôx@VÝz„V"],"encodeOffsets":[[128262,45940]]}},{"type":"Feature","id":"2206","properties":{"name":"白山市","cp":[127.2217,42.0941],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@Ušl¦kÒÆ°„IlÒU¤ôz„¼lJš„U„n‚ÆXVl°@²aÆbVKČXV¯°¥¯ĉ°W„„„L‚¥Ģw@x„bUx°V°zn‚‚b@ÈlVŽlIœ@˜w@m„U@akU°ƒkUôwWƒÈ¯VUƒVUƒÅ±U›@kÈk˜Ñœw@ƒlaÞġƒUÞ£@ƅ‚KnÑĢ¯@W‚aUaVUVkkw@a¯@¯™Ý™ƒVXnW@@WkXmK@xkKUb@bW@Uw¯„mmb@WKUbmUbUaWbƒJĉIVW@I—l±LkšmU™bUm™@ƒnkKWa¯n™@„`Ubma™„ĉL@bƚ—@W`ƒL@n¯‚Xb‚@kb@x™Lƒ„™@V‚kL±™™mlUIU¥mL@lÅx@_laƒƒ@U—aƒV@kmmƒK„£ƒƒLƒƒmKUnÅKVbmXVlèĉUUbml„ĢŤƒIlŽ¯bǦœl‚@ô¼Ģ„@x°„l¤„n„a„l@x™b"],"encodeOffsets":[[129567,43262]]}},{"type":"Feature","id":"2205","properties":{"name":"通化市","cp":[125.9583,41.8579],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@ÆlXnĠxĢ°lÈ°š„K„°kXm‚@¦Vbk„ŤJšnݤk„VÞVVkȄb°y„™@w˜k„Ç°a„wƨ@„aސ„K‚VnaWwXWƒ„kôJš_ČºôVkƒ»óyV£kуJůlÑk¥V™ša@wƒkƒbƒmk£¯ƒ@wġƒó»@›kÈ¥°ak„JÆ£ƒġnkVaĊVkçWUnUaÆLVmnL„„‚KU™±@—„m@a¯U„bmV¯m@_ƒK™™U™ƒaƒÅ™Wó¹ƒ@UanmWak@@wmI@y™@mk„JVa™@UaƒIkJ@n™@Um±kkxƒm™Ik„ƒbÇm@Ž°bXn„V@Ž°ÈmlÞ¼¯XVº¯Lm„kWWXLmVVlknƒ@@lnWƙ„Vxbmšnšm„¯lÝaVȁè@¼V„„b™„ÆŽ°ÞUVšJ„„kx›I—xƒƒƒIV¤™ÒXxmn"],"encodeOffsets":[[128273,43330]]}},{"type":"Feature","id":"2203","properties":{"name":"四平市","cp":[124.541,43.4894],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@Ɇn°W„zlyÞ£mwX@ƾKǬblaÈIƾ¤ôÞĸVĠxnmmVƒ²w‚VnwÆaU_@y„w@wÞxlk„KlwU»È»ŎÅ@mVIUmmĕUU@mWXw„Iô‚@bWnnbU`‚šV@Å°ó@wÞW@km@aŎ烙@m°Ñ°Inm±aXaƒU™n@mƑšU¦@šÇŽ¯aU£šaU™ġ¦ÅҙJōUŻókUÇ@™¥¯ak¯mUVak@@aċçÅaUƒm¦Ý`XbƄ@n`ƒI™xĊÞōÞml@šUb@Wl™_¯JkšÇUÝÆÅb@n™„llUb¯„±a@ƒ—ƒWĉJġĀ¯™Unóšm¤œxôaVnƒxôI@x„V@bmƙ„@lnLmޯޙxVb¯þ"],"encodeOffsets":[[126293,45124]]}},{"type":"Feature","id":"2204","properties":{"name":"辽源市","cp":[125.343,42.7643],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@żôŎVšIÆÑĢ¥Vš™bV¤°bȍ@™V¥ƒ™Þ£lÇUUUÝlƒÞ£™mţIlƒUa@¥nlWƒ¯ƒL¯™kÇġ¯ğwWmÅk¯UƒVU„„bWlXlmnƒbUx¯xVVknlŽUbV„ÇKUb@„™VnbmlnzUº±bmJUbWÈnèm҄š@X`WL"],"encodeOffsets":[[127879,44168]]}}],"UTF8Encoding":true}; +define('echarts/util/mapData/geoJson/ji_lin_geo',[],function() { + return {"type":"FeatureCollection","features":[{"type":"Feature","id":"2224","properties":{"name":"延边朝鲜族自治州","cp":[129.397,43.2587],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@Wxĵ„mš@„ó¤VX@@xܼƨš²xWxƒV„V@„XVƒ„„„ƒbWšXllaÞU°Ċ„@ô¼„LôÝWanV¥ƒÑnĉ°¥šÅX¥°¯@w°w@»°k£°mÈŹ‚mÈbƃŎ¦„K°z@Žkxl¦UbU¤šššklV„KŤÞȰ@@bšV@nVVUlÞ¦lUllœVlU°ÑU¯Vƒ°w„bXxl@VŽ²„˜@n„ô¼ƒó°™kmVk²ĕ‚w@wV™ÞÞ@@Ġƒö»˜¯œ@‚„šbnb°mÞ¯°V°„ÈJmX¥mam™UřƒUƒlaU¯™ƒ@w™Kk—l±n@@wƒkÝVUUl±¯I¯b™a™lƒ@™kLmakbƒ@ġƒŹé°™Þb°šékƒƒLm™„wX™‚aÅb@bVlƒbVb—ÒVbUb›UUanwƒakbVŽUV›ak„¯„UŽƒLmxV°UxnôŻX@J„Xkl‚bkbĉaƒbƒWU„ƒ@ƒk„WUU¯@@klmƒ@@™Å@aƒwWXlKkI@WbUaVIUanUƒƒ@ĕƒ¯K™„mUnWUwm@£ċèkUmbUmm@@nkJUalwk@@nmWUan_óaWmnw±KœIƒwl@UmƒI@an@@mlUÅmV_™KUkƒ@U`@_ƒKUmU™@U¯™mmb¯@kb™ImV¯ƒƒLkbƒKƒƒÛ@ÇnɱJóaÝĢkb@„›x—ÒÇllœ@‚Ž²V‚„ÆUVV„UÇ°X„óxlV¯„lV@bƒV@n—x›@—¤@„șŎnxV¼knšJ‚nšKX°˜¦UlnVbUbÆVnÞWVX¦llšb@l°œVJôÒnLVbšbXŽ"],"encodeOffsets":[[131086,44798]]}},{"type":"Feature","id":"2202","properties":{"name":"吉林市","cp":[126.8372,43.6047],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@ôl‚zšaÈV°„šK@„mŽ—LWl™nšVxUV‚È@ŽÝĬUÈn‚ôLša‚„²VmĀkV@„ĠĊnU@b„V@b˜@nl°UVnÞaôJ@bš™V„¦mlkššbmVXx¯@Vxm„nbƒ„šbÈK‚V@bÈL„wĠyônšmnbÜ@nn„V˜x@n²K‚„„J@k„al@nxÞU„Lź±Vwkw¯LWWUš™kŎīVwƒw„°y„Vĕ°wÈVlkÛ»@wW@Uô£@ƒn™ĶƒXwW™aUamKóÑUI¯›@k™akkW¥XUmÝÅUVaUa‚mVk—¥W¯™Lm™IlmU»mwȚō@ƒ˜£kJUÇk@am¯y¯UVwƒa@wġx¦ƒKƒƒ¯X°Ċ¯¦U°ċWULÅa±b¯@UkÅWmVƒ™ƒkIUlóŽċ¹™`óIƒlX„WŽXxmbUƒLݏƒbƧ@ƒx¯bƒÈ—l@xƒš¯zƒaݤ@nšm„VWb²bmn¯J¯Ò@n„š"],"encodeOffsets":[[128701,44303]]}},{"type":"Feature","id":"2208","properties":{"name":"白城市","cp":[123.0029,45.2637],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@ó™ǩŁ@WlwUaƑwÛÅÇéĉamKƒōÇ@Iƒ™ôġVƒȁÑŹçƒ™ÝUƧċĉwóóÝ@Ƒ»ğL¯ll²@ƆÅV@¦m‚Åb@nmlU²VxšlUn™@VbnW„bÇbk҃š„n@èlnlšU҄Ž°Lšx@¼ĉb@҄šUŽċxՃènLVxƒÒƒbÅJ±a@_ÅJÅnƒŽVb„Kl„nUÜĊ@„Uš™xXVÆn„mšVššJÞ¯V™ĠwšƒXw°xWL„x„KV¦ôU„wVÝǬóÞޙ¼‚‚„ÞkŽVôȘxބU„lVn¦ÞšĊa°w„b°@šbÆw„lŤL²`„z°@V@@™nJVnl@@¥nUmmn„@mwnmmUnk@mlwUaƒLnƒ›wn¯°anƒWakI„ƒÇmXwÆamUXUlJXa‚UUklKUknmÞV@‚K@VWÞ@VkUwVƒ"],"encodeOffsets":[[127350,46553]]}},{"type":"Feature","id":"2207","properties":{"name":"松原市","cp":[124.0906,44.7198],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@„šźèȂÒU„óĢ„š@JŎȄ‚‚LnŽĊbÈêÜƃxVbkx@XǪłôš„kÞ`„šW„b@n°ašbšKšnVw°`š_X`W„š¦„ĊIkmVšakw‚K„x°UÞb„U@lšƒl@°¦œVW„šaÞbšxÞI@mVI@ƒVkŚUWK„¥nL‚a@ƒ„@ȍ„@°ƒÆ@nU@KÞalkUwVékUWw„™kU›VkkƒJk¯@»ókƒV¯ÆÇI@bĉô¯@™ķw¯nmmÅL¯wƒVƒUÞy@UówÇLkmm@@UóxkkĉmL¯wVwkWWX™mLõm@kűV_ƒƒô»ÛƒÆ¯@™Va™VšaĠVlmğwķUóÝƽ£ÇJkbǫaƽLW@nxݤkzƒy¯XɅm@VšôÇX¯Ė¯ºÝnUŽnLVlUÔmV"],"encodeOffsets":[[126068,45580]]}},{"type":"Feature","id":"2201","properties":{"name":"长春市","cp":[125.8154,44.2584],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@„U°xÆKnn°mĸxš°@Ċó@aÈJ°Å„Uôl@¼l°„IllœUlVƒšXxlVUêVxkllnÈUVll@Vx²IÞ¤VUlVnIôlރlwô_„›„bVaĶLXÅÞÇ@K˜¯@wÛaƒçn¥š¯WXyW¯XwƒUmmÛ@ma™nómğzƒxÇK@aUÇL™a„ƒmanƒUw°@WwnU™al™nkƒ¥šU™@aóIÝbUm¯Vmk—@@aƒU@amVğĉ@ƒlUnÿ±Uƒ™bóKmVÇÞī@ÇVUUw‚™šmXk˜Kn@ƒ™L¯ƒÇU™byókōè@b‚n@lÝX@x¯ô@ƙUV_maXm@aóƒJWxnX@ŽVVnĖVnUJ@nōÆǼV¼kxƒLklÝw@xƒx@zV`ÅbmxU±xU„nnm‚kn‚ŽğU™bUŽ‚šUb@šÅ°Ü„󼄄U`Ʋ@lön‚KšnXWlXUx°xnKĊllôw@Vn@lnÈKôx@VÝz„V"],"encodeOffsets":[[128262,45940]]}},{"type":"Feature","id":"2206","properties":{"name":"白山市","cp":[127.2217,42.0941],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@Ušl¦kÒÆ°„IlÒU¤ôz„¼lJš„U„n‚ÆXVl°@²aÆbVKČXV¯°¥¯ĉ°W„„„L‚¥Ģw@x„bUx°V°zn‚‚b@ÈlVŽlIœ@˜w@m„U@akU°ƒkUôwWƒÈ¯VUƒVUƒÅ±U›@kÈk˜Ñœw@ƒlaÞġƒUÞ£@ƅ‚KnÑĢ¯@W‚aUaVUVkkw@a¯@¯™Ý™ƒVXnW@@WkXmK@xkKUb@bW@Uw¯„mmb@WKUbmUbUaWbƒJĉIVW@I—l±LkšmU™bUm™@ƒnkKWa¯n™@„`Ubma™„ĉL@bƚ—@W`ƒL@n¯‚Xb‚@kb@x™Lƒ„™@V‚kL±™™mlUIU¥mL@lÅx@_laƒƒ@U—aƒV@kmmƒK„£ƒƒLƒƒmKUnÅKVbmXVlèĉUUbml„ĢŤƒIlŽ¯bǦœl‚@ô¼Ģ„@x°„l¤„n„a„l@x™b"],"encodeOffsets":[[129567,43262]]}},{"type":"Feature","id":"2205","properties":{"name":"通化市","cp":[125.9583,41.8579],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@ÆlXnĠxĢ°lÈ°š„K„°kXm‚@¦Vbk„ŤJšnݤk„VÞVVkȄb°y„™@w˜k„Ç°a„wƨ@„aސ„K‚VnaWwXWƒ„kôJš_ČºôVkƒ»óyV£kуJůlÑk¥V™ša@wƒkƒbƒmk£¯ƒ@wġƒó»@›kÈ¥°ak„JÆ£ƒġnkVaĊVkçWUnUaÆLVmnL„„‚KU™±@—„m@a¯U„bmV¯m@_ƒK™™U™ƒaƒÅ™Wó¹ƒ@UanmWak@@wmI@y™@mk„JVa™@UaƒIkJ@n™@Um±kkxƒm™Ik„ƒbÇm@Ž°bXn„V@Ž°ÈmlÞ¼¯XVº¯Lm„kWWXLmVVlknƒ@@lnWƙ„Vxbmšnšm„¯lÝaVȁè@¼V„„b™„ÆŽ°ÞUVšJ„„kx›I—xƒƒƒIV¤™ÒXxmn"],"encodeOffsets":[[128273,43330]]}},{"type":"Feature","id":"2203","properties":{"name":"四平市","cp":[124.541,43.4894],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@Ɇn°W„zlyÞ£mwX@ƾKǬblaÈIƾ¤ôÞĸVĠxnmmVƒ²w‚VnwÆaU_@y„w@wÞxlk„KlwU»È»ŎÅ@mVIUmmĕUU@mWXw„Iô‚@bWnnbU`‚šV@Å°ó@wÞW@km@aŎ烙@m°Ñ°Inm±aXaƒU™n@mƑšU¦@šÇŽ¯aU£šaU™ġ¦ÅҙJōUŻókUÇ@™¥¯ak¯mUVak@@aċçÅaUƒm¦Ý`XbƄ@n`ƒI™xĊÞōÞml@šUb@Wl™_¯JkšÇUÝÆÅb@n™„llUb¯„±a@ƒ—ƒWĉJġĀ¯™Unóšm¤œxôaVnƒxôI@x„V@bmƙ„@lnLmޯޙxVb¯þ"],"encodeOffsets":[[126293,45124]]}},{"type":"Feature","id":"2204","properties":{"name":"辽源市","cp":[125.343,42.7643],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@żôŎVšIÆÑĢ¥Vš™bV¤°bȍ@™V¥ƒ™Þ£lÇUUUÝlƒÞ£™mţIlƒUa@¥nlWƒ¯ƒL¯™kÇġ¯ğwWmÅk¯UƒVU„„bWlXlmnƒbUx¯xVVknlŽUbV„ÇKUb@„™VnbmlnzUº±bmJUbWÈnèm҄š@X`WL"],"encodeOffsets":[[127879,44168]]}}],"UTF8Encoding":true}; }); -define('echarts/util/mapData/geoJson/liao_ning_geo',[],function() { - return {"type":"FeatureCollection","features":[{"type":"Feature","id":"2102","properties":{"name":"大连市","cp":[122.2229,39.4409],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@‚IÞmVk@wXWÜbnwlLnU„@‚nLlbXW@a‚wnbl@XL‚aš@Ċ¥@LULnJ@xVnmV@VXXV@VJkn@VÜKXXôJlb„xl@„IVbnJVLUbn‚lnVw„JVU@ƒXU‚aUUlwn@°ƒn„VKnV°_VJšwl@nwlV„IXWlIVVnK@IWmkIVaVU@WÈUlmU@U„WUalkXġŻ@kIƒ»mm™akUm›ĉUŁV»²ġVĕ@aUU؍IɃ`ȃ@kƒw@ƒUƒmwĉ™@ƒWķсIĉÇbÝLkymbIƒwÇmÛbmbU„¯ÜõÈkÆVbŎxnXVÆnšǪ¦„bš¤Uš™xÝnĉÒmĊVȄ¤Èš„bƼ„Ā„„ÆÆބźb„VVbX„‚°²¤"],"encodeOffsets":[[124786,41102]]}},{"type":"Feature","id":"2113","properties":{"name":"朝阳市","cp":[120.0696,41.4899],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@na@UVI@m„ÑW™kaV¥UI@wl@„aÈbšm@wVašk„@@K@kƒ™@a@UUmƒUUalmU@KÇUű¯@±kUKVkUaƒaU@¥m@@¯k@WLUmkn@mmIkm@amU@wVmkU@Klk@U—m˜aXIWWUL™aULVbƒmk@UUmUk±™_Uym@mbkImaX¯WW™xWKzU@WƒkJWwkV™@Um@UbVVVVXb@VWX—@WŽ@Vkb@V™nUK±aUUlwX™ÇWKknU@mmUkƒLUVƒVUUVƒUaƒw™bkKmwnIƒ™kJ@nmbƒ`kmVkLWwUm@UUU™K@UmaUa@UUaWK@mUƒ¯Wkk¯VmUUŽ„xVXUVmL¯ymXkWUbmXUKƒVknWx¯JVnkLƒl@VVxnxlĀVL²WlX„l@bÝVUn@bnlÜaXblIVl@šš@Ȧ@VmbXV‚@@x„VVnUn@`°@VnXU@K@„VV@VmbnVn@ln@b„xƒ°Ub@bšLV`Ånƒ„W@@lUšnnWVU@Vbkl@Xl`XxV„UblŽkX@Ž°¦V„UVVbUlkV›@UbVbkLUxmJkXšš@b‚bœxVKÆlXX˜bnŽnala@ƒUk@U„VVklKVUXKVU°KVan@VUnLšKVL„WVaU_@mmUXa@m˜wXwVkVWXk‚k@›„k@klm@wXKl@U@KVUUUVaUƒV@„alL„xUx@b°°VnnVšxlIXJmx„LUVlV@bnX@Všb„aVx‚@XJ@b‚n@VŽVXȄl@llX@lU„Vô°°@ބVbn@‚V„k„@VW"],"encodeOffsets":[[123919,43262]]}},{"type":"Feature","id":"2106","properties":{"name":"丹东市","cp":[124.541,40.4242],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@lzXJ‚U@š²x‚@@Vš„@bUVmKUn„°n@lnVK„„nV@n@VlV„°WbXn@‚VzƒJ@¦@bkb‚bUl@bkbƒJ¯zƒWULWbklV„nb™¦VJ@„„K°U„kl@@W„bVn°@„Všm²U˜nX`„UÜLXmVXlKVbUVVnUbn˜ƒX@VUL@lUbWxš@²kl`n@Vlb„@nUVWVLVU@aV@²bl@ÈmšxWX„VÈU„JV„l@„„la„WnX‚KÈkÈ@Va°bÆm„@XV°IVV°UnalƒVUn@UwVU„@@VVJ„I@bl@XK@wWmXU‚UVbkJVXnJVI@mƒknwlKXL@`l@VI@UUaVKÞn„aVm@aÇ£XW„U@aÇUU@mbkKm£™@WW™ƒL@@Kk@kl›U—bWKUkUU¯UõÛƒmUUaVU„U@WU_W@kVkJƒ_WKkV@bUL™¯¯ƒ±mk¯ġƒğÑ@UmwƒKUakƒ™ƒa@a„m¥ÝƒIUWmk@w™mţ—L›KʝbȗKWĢklVbƒX@VV‚knÇV@XUVUblJXn@J"],"encodeOffsets":[[126372,40967]]}},{"type":"Feature","id":"2112","properties":{"name":"铁岭市","cp":[124.2773,42.7423],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@XJm@¯šmXUlnVbUJƒU@bV@UJWL@VXLmJVbkXlJXxVL@b@V@n@b@`Vbk@lxknV@VV™V@bUL@bV@@bVK@VXLWLXJ@LV@nbWJ@IUV„x@LVJUXVxVx@VV@@LXJWL@VU@@L@VnL@bVVmVX@@VVInJmbnLWVnVULVVU@VVmX@@JVz‚l@„nVVKVXރ@mk_lm„UUWV_nJlUÞÑÞVVUVƒVL„UVJ@I„Vna‚@@KV@XwWknwnKlalU„w„aĉݚwšJl_@aUaƒKUUU@WU@WXUÆ@@UVK@n@UnVVšblK@bœllb@b„bW@Xbl@UlnLl°°bš¦nKlVnI„V@UWU@WXkƒw@am@nm@aVw@I@KUaVIm±XÑlknJVnVJšaX_VaUaVKmwnkmmn@lU@U@mnašXlKUmUIVmklaUK@UlUVUW@U™kVm™a@UUU@JmUU@@bmb—KWV¯XUKm@ka@UVKVk@aUKmLkKUUÝUmbXbÇJ@k@WU_@m™™@klm@UXKVaUI@KWUXaƒÇWk™aWUkWUL±U@lUU@ƒUJƒI@V¯JmIm@@aU@Uwƒa™@UV@VkI›V¯aUkƒWkb@bVL„@@VVVUXW@Uaƒ@@b—‚ÝbUV݄@ŽƒLmUkVUbVllLUV@LššXŽWbUXm@U`@„kxlnnJlbnIllšLX„lVlUXmVK„n‚V@L"],"encodeOffsets":[[126720,43572]]}},{"type":"Feature","id":"2101","properties":{"name":"沈阳市","cp":[123.1238,42.1216],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@ȚĊÜ°„b„L‚lÞxUbUn±‚@ÈnVÆL@xnLšlUVƒbƒxkImJkn@V±LUxkV@bšbšKVKnzVl@L°@Va„xÞUlbôxVVœ@@V±bnŽ@llXL˜ŽöXĶŽnal@nkVJVI@aU@@aVK@ašUUUU@lmkwl@Ua@_@a@m@U@aUKWwkIlWUanIWK@UXKVIU@@a„VVIUa‚mVknW°™n@WI@KUƒmULWnkVkUWƒ™KkkmJkamIkmlw@ƒV_n@VWXaW™™@KVUkKUkValUnV„K@ÞƒVUÞa˜@a„@VbX@VWUU@Uƒ@UK@ala@IkKmUUa@U@ƒVƒkk™WVwU_@KÜUXbl@V¥XUVmƒƒƒXa‚kŃlUUkIm`UIUJW@UIKmkm@UUJƒImmU@ƒVUXU`mIUbUK@LƒJUU™l@Xƒ@UbƒJ™kU@ƒŽn„m@Uam@@ƒ™aUmLKƒwƒ™mWXUK@kUaÇa@JUIUa@aƒKVUƒUXmƒUy™_@lmbkLUKWLX`‚n@bVL@JXL„‚WX@Vnb@Vm@UbnVmL@V@x@LUbVV@V@LƒUVl@mb¯U@xU@UVVV@X@VVblJ@bn„VKUn„x@llnL±¤™b@k`VXÆK@„kV@¼kl@bWIUl@VmLnbm@@JXXmb"],"encodeOffsets":[[125359,43139]]}},{"type":"Feature","id":"2104","properties":{"name":"抚顺市","cp":[124.585,41.8579],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@„XVl°bœUlJ@UVUš@„bVxV@@bn@nJ°I@U„J‚I„VV@V@k²VVKlXXVšb‚lÈX„ŽWbXV@LVJUbWL@Vkn@lšš@nV`@X@lÈIWanaÞVVVlLnKVL@bUlUL@Vlbn@VL°WXU˜Lna@aV@nV@IVV@VšbUnšl@V‚XnKVa@U„UnyWkXaƒaVk@ašašbnm@_WKXmWanU@alaU—l@XJVLVxX@˜wnKnVlwƒƒ™@V_@a¯¥@UkKWUaUU‚anK@IƒaU@WUaVw@klUVyUUVUUÇ@Iôbša@mnUma@kXa@UWak@Wa—l@a›@WUƒLmU@U`mIUU™`mUk@@UUK±nkJƒbUam@kwm@@a@UU@Ua@@K@ƒVK@kmKU_UKƒUUaĉWmkkL@`™LƒnmlkLkbmK@k™@Ulmb@b™„@Ž„xUVƒIUlmVXXƒxm@™JUUk@WUk@ƒakx±@¯x¯Umb™KUUVmUU¯UmVVn™WkÆ„lWb„„„ŽUnWVU¦k@WaÛV@LV`UxšXllU„@„@VVbnVlL@J"],"encodeOffsets":[[126754,42992]]}},{"type":"Feature","id":"2114","properties":{"name":"葫芦岛市","cp":[120.1575,40.578],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@ll°X„ŽnV‚@XLVb@VVbnb@VšLVV@VVnXxlKnU‚l„_na@mlI„šmJnxlLša„xVbU„VV„UVU„KVlnnV@lmXLšÈWŽkxVV²bVLšm@Ula@UX˜@XW@UWaUUUUVan@V‚š@lUXxlIX„V@‚yXLšw‚ŽXXW°nblJnan@Vzš`l²nVVVl@„nUaVKšbVKnXVaUaVUšyšnXK@kVK‚@X@m@m‚LXa„LWƒU¯„w@™ƒa@UVw„¥°™ó¯¯y¯ƒUǯ»›w¯Iƒm—¯Ç™UUl™¯»ţKċÑţķm¯w@mU_ómk¼VnU`±IkbVlƒnnŽU¼±Lk`@X™Wl¦UbmVUxkXVlkbllU„Vb@bkVmx@XVV@Jb±aULkKWXkWmX¯aUJmIkVm@ƒxU@n„"],"encodeOffsets":[[122097,41575]]}},{"type":"Feature","id":"2109","properties":{"name":"阜新市","cp":[122.0032,42.2699],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@šXnb°lš„VlnXVJ„LlVnl@zÆxnK@b„blKVLn@@V„aVLVK@L@Vl@XVVInVVKVwlUXwlKšL„ššVVb@aV@X„lUXbVW@n„lWnXKV@@V@XUVVLUVV@@bVVV@@ln@VbVUXV‚I„xVanJ@UšIVWšL@UV@@¤V@nInw˜W„k„lnIVx‚lnzUVÇJ¦VVÜLĸUnW@aV_šWĊXXa‚Knkl@nm™L™a@alUVw²K@UlmnIlJ„w„aVU™kmK@wÅKmU@DzVmVaÝwkƒKƒaÛ¯șĉķ¥ğ¥ƒ@kUWkƏī݃ƒ@@akU„K@KWIUm¯nƒU¯JmwUVmIkJÇLm@™UImJUU@aW@U@@nUb™JƒaƒbXVWn@UVmX@V@b„š@l@Lƒ@™lUb@x™nÇaƒbk@@xVJU¦lbXšƒÒ@nUJ@Vmb"],"encodeOffsets":[[123919,43262]]}},{"type":"Feature","id":"2107","properties":{"name":"锦州市","cp":[121.6626,41.4294],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@nJ@nlmVnXKl@@°n@@¦‚V„bVbUlVL²l°@ƲÈV@LV‚knVb„VVnnWVU‚@XmWU„a„bšIVa@mV@X@@bVVnIVJ@š‚nÈKlInJVUnx°I„V°mVnXJ@LƒLlV@b„@ބƐĬXllV„@Ġ¦ĸ¦naWW@In@manK@UVkXJ@alk@»lU@ƒÅLUWl_@ša²£‚Kkm@kƒwVmULmƒ@akIUa@U@WUUVU™aÝ@ğ›wkƒƒmĉ£UWƒ@@bÇL@m—a@_mKƒlƒXUwKƒLţÓ@UWw@K@U„I@m™U@UV¥„@°UnJ°@@_™KUwƒW@UnaWUmmI@m™ķwUaÇLóVĵwݙUUW™¯šƒ¦Ux@V„b@šƒxV°X„ƒKWbK@n@nW‚@UL@lWL™m™zUVVbUbmWXXWJ—b˜n@Vkl@LlVUn@xnV@bln"],"encodeOffsets":[[123694,42391]]}},{"type":"Feature","id":"2103","properties":{"name":"鞍山市","cp":[123.0798,40.6055],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@l„œxĠŽÞ@šbV@@w°Vna‚@Uk„V@K@UUUVa@K@w@UnKmUVan@@Uma@UXWƒWK@IUK@amW_XKVLlKna@kmKVak@VU„@VmšU@anIÆan@‚a„šUVnb@blLV`ÞLlU„bna‚Kn@naVU@¥°IVK@anUUKVaƒUVak™@mJƒkXƒ™UVwkƒVUUa°U@Wƒ@WlkXWlIXUlJlaœx‚IVVXLšll@nLV@lLXl„KĊzš¥maUƒlkXaVK„X°y„Ila@aVkala@a@¥„IUy@WmXaƒ¯kU@U@mmUƒƒULkmm@ƒ¯VmnLVU@a™ƒ@U@±w@™VWIkymLUUkJWXƒJkUmxk@™xUI¯`mUULmƒ¯„m@kxVVbWV@„UVƒIUx@bkšVšVVšxUbVV@V@zšJVXU‚lnk@@lkLƒlƒLUU±Jkšm@UIUVƒLUVU@™K@UƒnnV@l@Ll„ƒaUJ@zn`@nWlƒIUVUUUV±Ln‚@nmL@VUVkLVlUxVLVlÅXma™@@akLmWUX@JUnVJVkXJ@X@`WX„VUVUIlb„W@bVUVL@`Un@¦U`@bUV@z@Jm@@XV`„LUL¯J@IVKmKÅI@J™nWVnLnšVxV¤™z@bmV@VUV@bUL"],"encodeOffsets":[[125123,42447]]}},{"type":"Feature","id":"2105","properties":{"name":"本溪市","cp":[124.1455,41.1987],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@lb@Vn„lnVVUb@šVJ@nnJ@bmXUx@xVbkbkŽWLUxnl@Ul@„xWx@nUV@¼Ull„knkK@bmbnl‚LVJX@VIVJn_lJVVšXUmnU°VVVUnVVšLna°V°w²@lw„bl@XVl@VVšIn@„wWWnUVk„JVUƒw@šƒ@anaVkš@@lnLlalKnk„mšK@_lKnlĊXVb„VVLV`nL@lUL@„@L@‚VbV@@V@bn@lxn@Vb„alI²mVL@Vl@nVš_VVnJV_‚@nV„K‚V@Xœ‚@b˜kXbl@XblylUUkš™@Xa@UVIlK@UUWVU„Llm@UUUnKWU@K@UXm„XVa@U°KVUUWUk@ašUVKkaWkƒKUknaWa@U—@m@mk@ƒaUJk@@_WKkLmx„l@nUJmIUWlIUaVWVXn@xWLk@@aƒJUI@Uƒ@UVVxm@UVk„mb¯VUU¯JWUƒ@Ån¯aUbÇ@ÇlLmWƒXkbƒƒk@UƒƒIÇVƒUXW™wÇnk@±aU@@bUVUKUXmVƒ@kaUm@k_±l™@XwVa@kVK@U„Wm—VaUmVUUakLUWWnÛKƒVW_—m±V™nƒU¯@Umƒa@Xk@ƒl¯V"],"encodeOffsets":[[126552,41839]]}},{"type":"Feature","id":"2108","properties":{"name":"营口市","cp":[122.4316,40.4297],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@ĊĖƐn¤„„°Ċ¯ŎWšô„@xXb‚wnKl@nX@VUVƒKmL@VU@Ux݄@Vlb„x„U@VUb@b‚kœ`‚IUlVUn„V@@UV@@JnXlK@bš@nbÆWUkUKVwUklKVU@UnK@mm²KVUVVVU„JXk@mm_@yVI„bkƒ@K@kmU„m@VšLV@VU„KVUVJn@l™²IVV„K„klK@kl@kmVUW™I@y@UUUVa™wUUU™l™@akmmVaUKmIUaƒJk@ƒwkaóIWWÛL@UlmUIU@WW@UnUUm@wmIVK@Kĉ¦™@bWKk@max@bWXkamKƒ@mVkKmxÛaWX@xUlÝnJ"],"encodeOffsets":[[124786,41102]]}},{"type":"Feature","id":"2110","properties":{"name":"辽阳市","cp":[123.4094,41.1383],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@š`Vz„‚Wn„VUV„L@bVbVJ@IÈbVb@lVLXW‚n„š„x‚LnKVŽšb@„n@Vbn@mƒ„V@šl„IVa„@@WškVV„I@KVLVanJV_VW„UV@nn„JVI‚Vn@na@alLlmkƒVk@»VU@mXwƒwk@@VmkVwXKllaUa@wVwnW@amI@mUI@™VaUUkmmƒ@UkaƒL@ƒUIĉyƒLWkkKU@mKk@™kWKUUJ›wkbkIWVkJWXkl@X„‚@X¯VVbUVl„UxšVW„„lnIš@l‚Ub„VUbVLmV@bUL¯J@¦UVmbm@LmbƒakVÝKU_kK@amaVUƒ™bm@ÅbmJ@b™VUnƒ@UVl@UbnL"],"encodeOffsets":[[125562,42194]]}},{"type":"Feature","id":"2111","properties":{"name":"盘锦市","cp":[121.9482,41.0449],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@Vbĸx‚š@nnJVnXŽmb@V„XVxšL@`¯@mI¯Vƒ@U¦@VšV@nƒJ@V@LXx@VŤÔ„K‚LVx„W„knL@`˜b@nÈK@a„@VXĊ¤„nVK@aVU@UnU@ašyU£Uwm™mKXUšm@IÆJnLUL@J°IVKƒKU_@Wn@@I@yVU@aV_@¥Vm@_UKUV@aƒXkaVJVUƒUXW@_@WWIUlUIVm@IVW@IU@@VU@mƒUVVkJ›_l@aVa@UƒVƒwka@UރVwV@@UnK„LVU@UmWk@mLxWa@wóƒUVUIÇÆĉ¦¯¦¯xʟJ"],"encodeOffsets":[[124392,41822]]}}],"UTF8Encoding":true}; +define('echarts/util/mapData/geoJson/liao_ning_geo',[],function() { + return {"type":"FeatureCollection","features":[{"type":"Feature","id":"2102","properties":{"name":"大连市","cp":[122.2229,39.4409],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@‚IÞmVk@wXWÜbnwlLnU„@‚nLlbXW@a‚wnbl@XL‚aš@Ċ¥@LULnJ@xVnmV@VXXV@VJkn@VÜKXXôJlb„xl@„IVbnJVLUbn‚lnVw„JVU@ƒXU‚aUUlwn@°ƒn„VKnV°_VJšwl@nwlV„IXWlIVVnK@IWmkIVaVU@WÈUlmU@U„WUalkXġŻ@kIƒ»mm™akUm›ĉUŁV»²ġVĕ@aUU؍IɃ`ȃ@kƒw@ƒUƒmwĉ™@ƒWķсIĉÇbÝLkymbIƒwÇmÛbmbU„¯ÜõÈkÆVbŎxnXVÆnšǪ¦„bš¤Uš™xÝnĉÒmĊVȄ¤Èš„bƼ„Ā„„ÆÆބźb„VVbX„‚°²¤"],"encodeOffsets":[[124786,41102]]}},{"type":"Feature","id":"2113","properties":{"name":"朝阳市","cp":[120.0696,41.4899],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@na@UVI@m„ÑW™kaV¥UI@wl@„aÈbšm@wVašk„@@K@kƒ™@a@UUmƒUUalmU@KÇUű¯@±kUKVkUaƒaU@¥m@@¯k@WLUmkn@mmIkm@amU@wVmkU@Klk@U—m˜aXIWWUL™aULVbƒmk@UUmUk±™_Uym@mbkImaX¯WW™xWKzU@WƒkJWwkV™@Um@UbVVVVXb@VWX—@WŽ@Vkb@V™nUK±aUUlwX™ÇWKknU@mmUkƒLUVƒVUUVƒUaƒw™bkKmwnIƒ™kJ@nmbƒ`kmVkLWwUm@UUU™K@UmaUa@UUaWK@mUƒ¯Wkk¯VmUUŽ„xVXUVmL¯ymXkWUbmXUKƒVknWx¯JVnkLƒl@VVxnxlĀVL²WlX„l@bÝVUn@bnlÜaXblIVl@šš@Ȧ@VmbXV‚@@x„VVnUn@`°@VnXU@K@„VV@VmbnVn@ln@b„xƒ°Ub@bšLV`Ånƒ„W@@lUšnnWVU@Vbkl@Xl`XxV„UblŽkX@Ž°¦V„UVVbUlkV›@UbVbkLUxmJkXšš@b‚bœxVKÆlXX˜bnŽnala@ƒUk@U„VVklKVUXKVU°KVan@VUnLšKVL„WVaU_@mmUXa@m˜wXwVkVWXk‚k@›„k@klm@wXKl@U@KVUUUVaUƒV@„alL„xUx@b°°VnnVšxlIXJmx„LUVlV@bnX@Všb„aVx‚@XJ@b‚n@VŽVXȄl@llX@lU„Vô°°@ބVbn@‚V„k„@VW"],"encodeOffsets":[[123919,43262]]}},{"type":"Feature","id":"2106","properties":{"name":"丹东市","cp":[124.541,40.4242],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@lzXJ‚U@š²x‚@@Vš„@bUVmKUn„°n@lnVK„„nV@n@VlV„°WbXn@‚VzƒJ@¦@bkb‚bUl@bkbƒJ¯zƒWULWbklV„nb™¦VJ@„„K°U„kl@@W„bVn°@„Všm²U˜nX`„UÜLXmVXlKVbUVVnUbn˜ƒX@VUL@lUbWxš@²kl`n@Vlb„@nUVWVLVU@aV@²bl@ÈmšxWX„VÈU„JV„l@„„la„WnX‚KÈkÈ@Va°bÆm„@XV°IVV°UnalƒVUn@UwVU„@@VVJ„I@bl@XK@wWmXU‚UVbkJVXnJVI@mƒknwlKXL@`l@VI@UUaVKÞn„aVm@aÇ£XW„U@aÇUU@mbkKm£™@WW™ƒL@@Kk@kl›U—bWKUkUU¯UõÛƒmUUaVU„U@WU_W@kVkJƒ_WKkV@bUL™¯¯ƒ±mk¯ġƒğÑ@UmwƒKUakƒ™ƒa@a„m¥ÝƒIUWmk@w™mţ—L›KʝbȗKWĢklVbƒX@VV‚knÇV@XUVUblJXn@J"],"encodeOffsets":[[126372,40967]]}},{"type":"Feature","id":"2112","properties":{"name":"铁岭市","cp":[124.2773,42.7423],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@XJm@¯šmXUlnVbUJƒU@bV@UJWL@VXLmJVbkXlJXxVL@b@V@n@b@`Vbk@lxknV@VV™V@bUL@bV@@bVK@VXLWLXJ@LV@nbWJ@IUV„x@LVJUXVxVx@VV@@LXJWL@VU@@L@VnL@bVVmVX@@VVInJmbnLWVnVULVVU@VVmX@@JVz‚l@„nVVKVXރ@mk_lm„UUWV_nJlUÞÑÞVVUVƒVL„UVJ@I„Vna‚@@KV@XwWknwnKlalU„w„aĉݚwšJl_@aUaƒKUUU@WU@WXUÆ@@UVK@n@UnVVšblK@bœllb@b„bW@Xbl@UlnLl°°bš¦nKlVnI„V@UWU@WXkƒw@am@nm@aVw@I@KUaVIm±XÑlknJVnVJšaX_VaUaVKmwnkmmn@lU@U@mnašXlKUmUIVmklaUK@UlUVUW@U™kVm™a@UUU@JmUU@@bmb—KWV¯XUKm@ka@UVKVk@aUKmLkKUUÝUmbXbÇJ@k@WU_@m™™@klm@UXKVaUI@KWUXaƒÇWk™aWUkWUL±U@lUU@ƒUJƒI@V¯JmIm@@aU@Uwƒa™@UV@VkI›V¯aUkƒWkb@bVL„@@VVVUXW@Uaƒ@@b—‚ÝbUV݄@ŽƒLmUkVUbVllLUV@LššXŽWbUXm@U`@„kxlnnJlbnIllšLX„lVlUXmVK„n‚V@L"],"encodeOffsets":[[126720,43572]]}},{"type":"Feature","id":"2101","properties":{"name":"沈阳市","cp":[123.1238,42.1216],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@ȚĊÜ°„b„L‚lÞxUbUn±‚@ÈnVÆL@xnLšlUVƒbƒxkImJkn@V±LUxkV@bšbšKVKnzVl@L°@Va„xÞUlbôxVVœ@@V±bnŽ@llXL˜ŽöXĶŽnal@nkVJVI@aU@@aVK@ašUUUU@lmkwl@Ua@_@a@m@U@aUKWwkIlWUanIWK@UXKVIU@@a„VVIUa‚mVknW°™n@WI@KUƒmULWnkVkUWƒ™KkkmJkamIkmlw@ƒV_n@VWXaW™™@KVUkKUkValUnV„K@ÞƒVUÞa˜@a„@VbX@VWUU@Uƒ@UK@ala@IkKmUUa@U@ƒVƒkk™WVwU_@KÜUXbl@V¥XUVmƒƒƒXa‚kŃlUUkIm`UIUJW@UIKmkm@UUJƒImmU@ƒVUXU`mIUbUK@LƒJUU™l@Xƒ@UbƒJ™kU@ƒŽn„m@Uam@@ƒ™aUmLKƒwƒ™mWXUK@kUaÇa@JUIUa@aƒKVUƒUXmƒUy™_@lmbkLUKWLX`‚n@bVL@JXL„‚WX@Vnb@Vm@UbnVmL@V@x@LUbVV@V@LƒUVl@mb¯U@xU@UVVV@X@VVblJ@bn„VKUn„x@llnL±¤™b@k`VXÆK@„kV@¼kl@bWIUl@VmLnbm@@JXXmb"],"encodeOffsets":[[125359,43139]]}},{"type":"Feature","id":"2104","properties":{"name":"抚顺市","cp":[124.585,41.8579],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@„XVl°bœUlJ@UVUš@„bVxV@@bn@nJ°I@U„J‚I„VV@V@k²VVKlXXVšb‚lÈX„ŽWbXV@LVJUbWL@Vkn@lšš@nV`@X@lÈIWanaÞVVVlLnKVL@bUlUL@Vlbn@VL°WXU˜Lna@aV@nV@IVV@VšbUnšl@V‚XnKVa@U„UnyWkXaƒaVk@ašašbnm@_WKXmWanU@alaU—l@XJVLVxX@˜wnKnVlwƒƒ™@V_@a¯¥@UkKWUaUU‚anK@IƒaU@WUaVw@klUVyUUVUUÇ@Iôbša@mnUma@kXa@UWak@Wa—l@a›@WUƒLmU@U`mIUU™`mUk@@UUK±nkJƒbUam@kwm@@a@UU@Ua@@K@ƒVK@kmKU_UKƒUUaĉWmkkL@`™LƒnmlkLkbmK@k™@Ulmb@b™„@Ž„xUVƒIUlmVXXƒxm@™JUUk@WUk@ƒakx±@¯x¯Umb™KUUVmUU¯UmVVn™WkÆ„lWb„„„ŽUnWVU¦k@WaÛV@LV`UxšXllU„@„@VVbnVlL@J"],"encodeOffsets":[[126754,42992]]}},{"type":"Feature","id":"2114","properties":{"name":"葫芦岛市","cp":[120.1575,40.578],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@ll°X„ŽnV‚@XLVb@VVbnb@VšLVV@VVnXxlKnU‚l„_na@mlI„šmJnxlLša„xVbU„VV„UVU„KVlnnV@lmXLšÈWŽkxVV²bVLšm@Ula@UX˜@XW@UWaUUUUVan@V‚š@lUXxlIX„V@‚yXLšw‚ŽXXW°nblJnan@Vzš`l²nVVVl@„nUaVKšbVKnXVaUaVUšyšnXK@kVK‚@X@m@m‚LXa„LWƒU¯„w@™ƒa@UVw„¥°™ó¯¯y¯ƒUǯ»›w¯Iƒm—¯Ç™UUl™¯»ţKċÑţķm¯w@mU_ómk¼VnU`±IkbVlƒnnŽU¼±Lk`@X™Wl¦UbmVUxkXVlkbllU„Vb@bkVmx@XVV@Jb±aULkKWXkWmX¯aUJmIkVm@ƒxU@n„"],"encodeOffsets":[[122097,41575]]}},{"type":"Feature","id":"2109","properties":{"name":"阜新市","cp":[122.0032,42.2699],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@šXnb°lš„VlnXVJ„LlVnl@zÆxnK@b„blKVLn@@V„aVLVK@L@Vl@XVVInVVKVwlUXwlKšL„ššVVb@aV@X„lUXbVW@n„lWnXKV@@V@XUVVLUVV@@bVVV@@ln@VbVUXV‚I„xVanJ@UšIVWšL@UV@@¤V@nInw˜W„k„lnIVx‚lnzUVÇJ¦VVÜLĸUnW@aV_šWĊXXa‚Knkl@nm™L™a@alUVw²K@UlmnIlJ„w„aVU™kmK@wÅKmU@DzVmVaÝwkƒKƒaÛ¯șĉķ¥ğ¥ƒ@kUWkƏī݃ƒ@@akU„K@KWIUm¯nƒU¯JmwUVmIkJÇLm@™UImJUU@aW@U@@nUb™JƒaƒbXVWn@UVmX@V@b„š@l@Lƒ@™lUb@x™nÇaƒbk@@xVJU¦lbXšƒÒ@nUJ@Vmb"],"encodeOffsets":[[123919,43262]]}},{"type":"Feature","id":"2107","properties":{"name":"锦州市","cp":[121.6626,41.4294],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@nJ@nlmVnXKl@@°n@@¦‚V„bVbUlVL²l°@ƲÈV@LV‚knVb„VVnnWVU‚@XmWU„a„bšIVa@mV@X@@bVVnIVJ@š‚nÈKlInJVUnx°I„V°mVnXJ@LƒLlV@b„@ބƐĬXllV„@Ġ¦ĸ¦naWW@In@manK@UVkXJ@alk@»lU@ƒÅLUWl_@ša²£‚Kkm@kƒwVmULmƒ@akIUa@U@WUUVU™aÝ@ğ›wkƒƒmĉ£UWƒ@@bÇL@m—a@_mKƒlƒXUwKƒLţÓ@UWw@K@U„I@m™U@UV¥„@°UnJ°@@_™KUwƒW@UnaWUmmI@m™ķwUaÇLóVĵwݙUUW™¯šƒ¦Ux@V„b@šƒxV°X„ƒKWbK@n@nW‚@UL@lWL™m™zUVVbUbmWXXWJ—b˜n@Vkl@LlVUn@xnV@bln"],"encodeOffsets":[[123694,42391]]}},{"type":"Feature","id":"2103","properties":{"name":"鞍山市","cp":[123.0798,40.6055],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@l„œxĠŽÞ@šbV@@w°Vna‚@Uk„V@K@UUUVa@K@w@UnKmUVan@@Uma@UXWƒWK@IUK@amW_XKVLlKna@kmKVak@VU„@VmšU@anIÆan@‚a„šUVnb@blLV`ÞLlU„bna‚Kn@naVU@¥°IVK@anUUKVaƒUVak™@mJƒkXƒ™UVwkƒVUUa°U@Wƒ@WlkXWlIXUlJlaœx‚IVVXLšll@nLV@lLXl„KĊzš¥maUƒlkXaVK„X°y„Ila@aVkala@a@¥„IUy@WmXaƒ¯kU@U@mmUƒƒULkmm@ƒ¯VmnLVU@a™ƒ@U@±w@™VWIkymLUUkJWXƒJkUmxk@™xUI¯`mUULmƒ¯„m@kxVVbWV@„UVƒIUx@bkšVšVVšxUbVV@V@zšJVXU‚lnk@@lkLƒlƒLUU±Jkšm@UIUVƒLUVU@™K@UƒnnV@l@Ll„ƒaUJ@zn`@nWlƒIUVUUUV±Ln‚@nmL@VUVkLVlUxVLVlÅXma™@@akLmWUX@JUnVJVkXJ@X@`WX„VUVUIlb„W@bVUVL@`Un@¦U`@bUV@z@Jm@@XV`„LUL¯J@IVKmKÅI@J™nWVnLnšVxV¤™z@bmV@VUV@bUL"],"encodeOffsets":[[125123,42447]]}},{"type":"Feature","id":"2105","properties":{"name":"本溪市","cp":[124.1455,41.1987],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@lb@Vn„lnVVUb@šVJ@nnJ@bmXUx@xVbkbkŽWLUxnl@Ul@„xWx@nUV@¼Ull„knkK@bmbnl‚LVJX@VIVJn_lJVVšXUmnU°VVVUnVVšLna°V°w²@lw„bl@XVl@VVšIn@„wWWnUVk„JVUƒw@šƒ@anaVkš@@lnLlalKnk„mšK@_lKnlĊXVb„VVLV`nL@lUL@„@L@‚VbV@@V@bn@lxn@Vb„alI²mVL@Vl@nVš_VVnJV_‚@nV„K‚V@Xœ‚@b˜kXbl@XblylUUkš™@Xa@UVIlK@UUWVU„Llm@UUUnKWU@K@UXm„XVa@U°KVUUWUk@ašUVKkaWkƒKUknaWa@U—@m@mk@ƒaUJk@@_WKkLmx„l@nUJmIUWlIUaVWVXn@xWLk@@aƒJUI@Uƒ@UVVxm@UVk„mb¯VUU¯JWUƒ@Ån¯aUbÇ@ÇlLmWƒXkbƒƒk@UƒƒIÇVƒUXW™wÇnk@±aU@@bUVUKUXmVƒ@kaUm@k_±l™@XwVa@kVK@U„Wm—VaUmVUUakLUWWnÛKƒVW_—m±V™nƒU¯@Umƒa@Xk@ƒl¯V"],"encodeOffsets":[[126552,41839]]}},{"type":"Feature","id":"2108","properties":{"name":"营口市","cp":[122.4316,40.4297],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@ĊĖƐn¤„„°Ċ¯ŎWšô„@xXb‚wnKl@nX@VUVƒKmL@VU@Ux݄@Vlb„x„U@VUb@b‚kœ`‚IUlVUn„V@@UV@@JnXlK@bš@nbÆWUkUKVwUklKVU@UnK@mm²KVUVVVU„JXk@mm_@yVI„bkƒ@K@kmU„m@VšLV@VU„KVUVJn@l™²IVV„K„klK@kl@kmVUW™I@y@UUUVa™wUUU™l™@akmmVaUKmIUaƒJk@ƒwkaóIWWÛL@UlmUIU@WW@UnUUm@wmIVK@Kĉ¦™@bWKk@max@bWXkamKƒ@mVkKmxÛaWX@xUlÝnJ"],"encodeOffsets":[[124786,41102]]}},{"type":"Feature","id":"2110","properties":{"name":"辽阳市","cp":[123.4094,41.1383],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@š`Vz„‚Wn„VUV„L@bVbVJ@IÈbVb@lVLXW‚n„š„x‚LnKVŽšb@„n@Vbn@mƒ„V@šl„IVa„@@WškVV„I@KVLVanJV_VW„UV@nn„JVI‚Vn@na@alLlmkƒVk@»VU@mXwƒwk@@VmkVwXKllaUa@wVwnW@amI@mUI@™VaUUkmmƒ@UkaƒL@ƒUIĉyƒLWkkKU@mKk@™kWKUUJ›wkbkIWVkJWXkl@X„‚@X¯VVbUVl„UxšVW„„lnIš@l‚Ub„VUbVLmV@bUL¯J@¦UVmbm@LmbƒakVÝKU_kK@amaVUƒ™bm@ÅbmJ@b™VUnƒ@UVl@UbnL"],"encodeOffsets":[[125562,42194]]}},{"type":"Feature","id":"2111","properties":{"name":"盘锦市","cp":[121.9482,41.0449],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@Vbĸx‚š@nnJVnXŽmb@V„XVxšL@`¯@mI¯Vƒ@U¦@VšV@nƒJ@V@LXx@VŤÔ„K‚LVx„W„knL@`˜b@nÈK@a„@VXĊ¤„nVK@aVU@UnU@ašyU£Uwm™mKXUšm@IÆJnLUL@J°IVKƒKU_@Wn@@I@yVU@aV_@¥Vm@_UKUV@aƒXkaVJVUƒUXW@_@WWIUlUIVm@IVW@IU@@VU@mƒUVVkJ›_l@aVa@UƒVƒwka@UރVwV@@UnK„LVU@UmWk@mLxWa@wóƒUVUIÇÆĉ¦¯¦¯xʟJ"],"encodeOffsets":[[124392,41822]]}}],"UTF8Encoding":true}; }); -define('echarts/util/mapData/geoJson/nei_meng_gu_geo',[],function() { - return {"type":"FeatureCollection","features":[{"type":"Feature","id":"1507","properties":{"name":"呼伦贝尔市","cp":[120.8057,50.2185],"childNum":13},"geometry":{"type":"Polygon","coordinates":["@@„m@Łkƒ™Žƒklƒôƒ@£kJ°ý™ɅķÑó¤ğLĉÅlÇğŁW¯¯›™ƥóÿlwkţÈéÝƛó™°ÞÅxV¤ĉĖWƒ¯lȭţυ̃ɱÿķƅˋğɱřÝţϙȍƧĊţ@¯kWKUKm¹Å@ķJU@ƧÑƧ„ō¥˹Ɔ@L@„Þ‚VLnš@VōČWJX¦@JŻbU@ţÞmVU@ȁýóbkWWLƒƒÅ™¯UWġkmóƒ±UŹôV¼ƽ¼ƒł̥ĖƽǬʉxĉŽŻȗKΕ̛ʵƨʟÞ˹»Ƨţ»Ǖō˷Ȍ±ȚʊĠUɾɜɨmÜ֞߼˸ƅȂ¯ǖKˢğÈÒǔnƾŎՂ@šĊbôô̐¼ƒ@ĊôĊŽÞĀ™xšĖƧL±ŽœŽ‚Uš°U„°ĬƒČ°ÜƒêɴȂVł°@ƒ„nxŎèƒbȄÞȌ΀ǸlŽ²IlxĊl²ÒmšôĖ™Èl„ĵºm„ÈêVþ„xɛČʉÇĵVmš„ÒƒÈɆôƐŰǀĊ°ÆǬĮƾb„yĊ@ĠšƒXǀċm»ôw°Ûk¥Çm¯ç™kkÇǫţǕéX_ĶWǖīŎaÆĵĸĊ@ȚȘ‚™ĊLĢĉ„VÆĉʊÇĕóaU¥šĉ°mkÅ°ġUĠřk°mƒÑČÿ˜ÛƒWĸ£ʠšÆxÈÞŎÞ»ʈ²ĊÇČalÒ°Ť±ĸz„ŽĊKȲm¤Ŏ@Ò°¼nyȂUźīǖƳÈē°@šÝĶƒ@ƒÈkl¥Ççkxk™›JXÇƒUÅ@˜£k»„óƿīÛ@lÅJl¥óý@¯ƽġƍÅan™ċ™°é¯¹"],"encodeOffsets":[[128194,51014]]}},{"type":"Feature","id":"1529","properties":{"name":"阿拉善盟","cp":[102.019,40.1001],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@™ƏnǟƨʫšŹɆÿ°¯ÆV²ˢ™żÿ@ÝÆŁȰ¯ȀƳĉó™™@ğkyš¹@īš›ƒwl£Źƒƒ¯Ŧé@™ÇÇxŋĉƩUUŃōL™Ç™ĵóÝnƒóç@™™ó@ġƒƱ„¥ƒç™WUçÆōƒ@é—çťK™çȭVһƽ̻aW¥ȁ£ʵNJǓƲɳޗǔlżÞmĠóĬȂɲȮ@ÈĢŮźÔnĶŻǠšŎȭœгŃċóȭţΗÆƑÞƧÅΫóȘǫɱȁġlÛkÇ°ȁÈnšõl¯ô„ÞɛÝkĢóWĊ„zÇɼʝ@ÇÈķlUČÅÜķnέƒǓKȮŎŎb°ĢǀŌ@ȼôĬmĠğŰōĖƧbЇƧōx@ķó£Ål±ĀƧīXÝġƃêĉK°Ýʇƅ@ΌʉżÅÒϱʈ@˺ƾ֛।࡬ţશóЈèʞUš¤Ґ_޸Ƒʠɽ̦ÝɜL׈ɛϜóȂJϚÈ@ǟͪaÞ»Ȯź"],"encodeOffsets":[[107764,42750]]}},{"type":"Feature","id":"1525","properties":{"name":"锡林郭勒盟","cp":[115.6421,44.176],"childNum":12},"geometry":{"type":"Polygon","coordinates":["@@ʶĬĊIȘƨƨŽ@ĬÛĢșŤĉĬƒĀóšU‚ÈŚÜènŦƐȤȄłϰUƨťƾÑ܆ğɲƜǔÈèʈƲĊƞƒšɆ¯̼V˺Ò˺ȂŤVĢêU܃x„Āˌ˘ƨ„Æ°ѢmÞżU¼ÆlŎ@ĊçŎnÈÒͪŎźƒĸU°lżwUb°°°Vš£ÞlĠĉĊLޏɆnźÞ„n¦ĊaȂīġŃ¯Iĉůl»kƒ„™Çý„¥Ŏ¯ƒén£ġљÝȭxƒÇ™@Åçķ»óƱŎ¥™çWÿmlóa£Çb™yVÅČÇV»ÝU¯™KĉýǕċţnġ¯»ÇōUm»ğƒÑ™wƏbċÇŎċwˋÈÛÿʉÑ°Łkw@óÇ»ĉw™¥VÑŹU™mW»ğğljVÿŤÅźī@ř¯ğnõƐ@ÞÅnŁVljóJƒwĊÑkĕÝw¯nk¥ŏaó¦ĉƒV¦Å`ğуÑÝ@mwn¯m±@óƒÛKˍƏǓ±UšÝ™a¯lƒōšșk„èƒĬގn@ŤġŰk°ċx@œĉ`Ƨĕ°@ţÒĉwmĉ@ƒƒnƒƒa„™¥ķnƒÞĉVóÆókĉŽķ@ÝkƧƧÛaƒ°Ç@ÝÈU˜óbݼ@„ÛÒV°™@V¼ˋL™ÞɅŤŹǠVÞȗŤÇĖŚōbȁƜ"],"encodeOffsets":[[113817,44421]]}},{"type":"Feature","id":"1506","properties":{"name":"鄂尔多斯市","cp":[108.9734,39.2487],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@ĶL²ĬVłƑkkl@Ȏ™ŘWńÈĬȗ¯™ºlz@ĠššĊôŦô„ÒĠ°kÞܚ™n@¤„UĸèĸbŌÈXŽĸLlÒĢxɲÆ¤ÈÛƾJÈÝ°UšÅĶ»²VW¯ĸJôšbk‚V@ôlbnĊyÈzVôašb@ĸ‚ÞUl°yǬ²Ǭm°ššk„±lbn°@È»˜JX„VŎÑÆJ@k„LšƒÆl²™Ġ²ʊůĊġ‚řóƛÞÅ@m„ƒmLUÿóĉƧ@™»L@„›`ČĸmšȗÑţů±ĉğl¯Ā™wǎƒçƧŤÛI@±ÜĉǓçō°Uwô™ǫůķƳř±bÅ£™ÓÇwnÑó@ȁƽ@™ƒÇƧĢón»ŏĕóĊ¯b„Å™™VȯÅImƒōKU„™LǓ±Ýxċ—ŋ˜V±Āȗ°™„Źl±šÛ@WÒȁŚŹНŚÅèŌô„¼°ȰɞȂVĊ"],"encodeOffsets":[[109542,39983]]}},{"type":"Feature","id":"1504","properties":{"name":"赤峰市","cp":[118.6743,43.2642],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@ɲŁĢljĊwƾōÞĭ°_ŎŃźȹƒUČÿl»¯ôķVÿǬƽ™ɅġÅÑǫ»̐ʟȣU™¯wVWݍÈġW»Þ¹m݃ɛŎÿŎōͩůV¹›ō™éċ™óŹÅVVĢǩʈ@Ėċ@ķšÛšV°¯xÇÅţ¥™»°Ûô™ĉʟ„¥WýČ¥™w‚灻±mnÅķ¥ˋVƒbUÒġ»ÅxğLƧ™ƒbWĖÅxš¦U°ÝVóŰlô²@š¥ÜÞÛô„V@²±`š¦™„™¯Ý@„ŽÅ„VÒō¼ôš™¤V²ŹĬÇĊƑƒţxƒç¯Lk»ʟlƽýmłÝÆƏ@mö°Ġ@ŚŹĬţÆUĀĠNJĠŽX¼šnźVUҚ¦Ċxȼ@ôlx¯łʊÒÜĀˌÇČxƍČÈƐašx„ÒĠŽn¼ŎVȐ‚¼Ģ°ŤmǖČĊþšLV°ÞŽU¼ċÈUƚzÈa‚¤ôbkŽ‚nXĀšè"],"encodeOffsets":[[122232,46328]]}},{"type":"Feature","id":"1508","properties":{"name":"巴彦淖尔市","cp":[107.5562,41.3196],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@²@Ζǀݴʶհĸ„˜ƒ¦Ķ™̒Uˌ¼ӾÇƾ¼̨UÞĉ˜Ƨ—éÝ»ƒĕĉ—ƐȍœōǪakó‚ó¯a@™ôţ™aV¯Þ¯°@²él¥ĵğťwōxó¯k±š—Vó@™aóbUÇyĉzmŽkaóŽU@l™aó‚ķIX°±Uĵ¼™Æ¯VÇÞƽIÇÜÅ£ɱŽġwkÑķKWŋÇķaķçƒV@£šmۙlÝğ¯ƒÑťóǿƴȯ°Åł@ÞŻĀˡš±ŽÅU¯°ɅĀ™źƧʬmǠšƐ"],"encodeOffsets":[[107764,42750]]}},{"type":"Feature","id":"1505","properties":{"name":"通辽市","cp":[121.4758,43.9673],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@ôƲĸ¼Æèš@„ÈȮwƾ»ʠĢ¥VÆ@²¥@»Ŏњ¯ĊJŤ£k»ÆÇX¯̼ōšī°aX£ôƒƾȁź¥„ƒ™aôŤ™ĢL°ƒĸ@Ȯ¼ÈÒʈŚôVXůÆaĠƛÈKƒķšĉôÿ@ğÈĉ™»ÇVn™ĉV›wXĠÝ°šČÿĸwVƒ™¯¯ǵ±™ĉ‚ǫ™ÅÅm»²Ż±ƽIm¥ţÈķ@¯šƧJV»ÞUÝç¯UġºU£ţŽóaÅÅlƒƒ™Ƨī¯K¯Þ݃ğL̑ȍƽ@ōŎōĀƑɜnÞݺX¼ÇĢގUX°xVšʠȤ̏Ǭ¼ÆÒɆĢšŽǫƾUĀóĸ°‚k¼ċĀƑVŹȺōń¯`ÝĮƽŎĉxġNJɱłō¦"],"encodeOffsets":[[122097,46379]]}},{"type":"Feature","id":"1509","properties":{"name":"乌兰察布市","cp":[112.5769,41.77],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@ʠǠÞĸɲȺƒÒȂƛŎaƙÈĕȘţUÝźǟɆţšÝˌKU»š@U¯ÜÑ@ƒÞ»ôaV—ÞÇÈ@„¯ÜbƨƨÞlĸ@ĊôlôÅĊU„Ýĸmš¦ƒŽ„bm„„„Ċ@n‚ĊxŤÑ@¯‚ƨĖĊ_@›Čwl¯™ƒȭL›Ý„»ƽ¯ķů„Ǔ@ÇǓbċ™ÅÅÆwÿĠÇU£óaƒ¥¯aŎğĠţkw°»¯ůlÝĵkǻݰɱƧǫaóôɱ»Çk¯ŃóƒʇŐŻ›ĉNJŻĢ„Ž¯ÒÈUl°ƒx°n„Ò™Ĭón™Ċğ°ÇŚĉ¦ʵVƒ°°ĬÛżÇJȁńʇʹó˂ƽŎ›Æţ¦"],"encodeOffsets":[[112984,43763]]}},{"type":"Feature","id":"1522","properties":{"name":"兴安盟","cp":[121.3879,46.1426],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@ÆXnlŎ°@LVLĠþœxĊUȮĊnU„ĠV@żaW¯XIŎġƒ¥Ý@K@w@K@I˺ŻŎ¦ƨƒƨÒŎIÆ@X@VºnX°lŎ@ƾĉˤƒȘǷȘÑÝݚÞbVţĸÿŤxÈĖƐŽêÇKnĸ¥ô@›ķÞUnÒl@UŚaƒīˋƒ¯ÑƧx@±kXřƐƏÛéV™ˋ»lō¯ĉ„ÅÇÓǫޗĖġV@ğ»›°ĵ„ÇÞǓ¼¯m˜ÛÅŃĉĠÇƾb²çƒ™šéż¯VƒƒğÞml»ōÑV痻V¯™¯šĕÆU¯y°k¯¯V»ôDŽѰa@Źk™ġKţšóŽšbƒ„Ź¦ƽȂó„W¤¯b™Ĭ̻ŎW°ÅÈl¼ţ¤ĉI™°ōÒ@¼±¦Å@UŽġ¦ʟŽƽ¼šÞĢÒm¤„êō°ƒ¦Èþƒšl„k¼ĊŰ°JĢńȁĬ„°ƒżn‚ÇbV„ݼ@¼óĸţ¤@°Ånšl"],"encodeOffsets":[[122412,48482]]}},{"type":"Feature","id":"1502","properties":{"name":"包头市","cp":[110.3467,41.4899],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@źxżĀǔÆǬVȘĀŤ¥œÅƾōôˁʈͳȂŃÈIÜŻ¯ī„¯ōm™¯ɱĖ¯ƒķÒÝIÝ»ÅV™ƒlÅôфġ™ğVmÞnnƒWçkW܁XƝÆwU»Șĕš£ĉÑ𱱚Åk™„ƒK@lÅIō҃UW‚—IǼ¯@m‚kaƒ²™l¯™ǫnǫ±¯zkŽÝVķUô™˜l²ô°ŎwŦxĶĠk¦±ê¯@Ý°U°šbóŤ@š°bôlôǩb›ŎƏȎĊ˜„ĖÞ¼˜ê—ƨÝĊ"],"encodeOffsets":[[112017,43465]]}},{"type":"Feature","id":"1501","properties":{"name":"呼和浩特市","cp":[111.4124,40.4901],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@ʶUĊ¥ÈřĠ¯šĉômšīƒÑ¯m„wk¯ÇV°ÑƒżġĊljǓɱţǓ›ƝóX¯ƒɛÒóa@nÝÆôƜŚĉĢʉŰĊҙ¤ȗĖV¼ÅxWƞۂlXXèm„ÝmUnšĠƒĢóÒkƚ„ÆUÞ¼ÞJĸÑ°„ɲĕš°Ŏn"],"encodeOffsets":[[114098,42312]]}},{"type":"Feature","id":"1503","properties":{"name":"乌海市","cp":[106.886,39.4739],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@Ș°ÇīXњŗ@ȍlkƒlUŁ±īĵKō¼VŽÇôXĸ¯Ž@šťê„°ź„k¤„x™œ@Ĭ"],"encodeOffsets":[[109317,40799]]}}],"UTF8Encoding":true}; +define('echarts/util/mapData/geoJson/nei_meng_gu_geo',[],function() { + return {"type":"FeatureCollection","features":[{"type":"Feature","id":"1507","properties":{"name":"呼伦贝尔市","cp":[120.8057,50.2185],"childNum":13},"geometry":{"type":"Polygon","coordinates":["@@„m@Łkƒ™Žƒklƒôƒ@£kJ°ý™ɅķÑó¤ğLĉÅlÇğŁW¯¯›™ƥóÿlwkţÈéÝƛó™°ÞÅxV¤ĉĖWƒ¯lȭţυ̃ɱÿķƅˋğɱřÝţϙȍƧĊţ@¯kWKUKm¹Å@ķJU@ƧÑƧ„ō¥˹Ɔ@L@„Þ‚VLnš@VōČWJX¦@JŻbU@ţÞmVU@ȁýóbkWWLƒƒÅ™¯UWġkmóƒ±UŹôV¼ƽ¼ƒł̥ĖƽǬʉxĉŽŻȗKΕ̛ʵƨʟÞ˹»Ƨţ»Ǖō˷Ȍ±ȚʊĠUɾɜɨmÜ֞߼˸ƅȂ¯ǖKˢğÈÒǔnƾŎՂ@šĊbôô̐¼ƒ@ĊôĊŽÞĀ™xšĖƧL±ŽœŽ‚Uš°U„°ĬƒČ°ÜƒêɴȂVł°@ƒ„nxŎèƒbȄÞȌ΀ǸlŽ²IlxĊl²ÒmšôĖ™Èl„ĵºm„ÈêVþ„xɛČʉÇĵVmš„ÒƒÈɆôƐŰǀĊ°ÆǬĮƾb„yĊ@ĠšƒXǀċm»ôw°Ûk¥Çm¯ç™kkÇǫţǕéX_ĶWǖīŎaÆĵĸĊ@ȚȘ‚™ĊLĢĉ„VÆĉʊÇĕóaU¥šĉ°mkÅ°ġUĠřk°mƒÑČÿ˜ÛƒWĸ£ʠšÆxÈÞŎÞ»ʈ²ĊÇČalÒ°Ť±ĸz„ŽĊKȲm¤Ŏ@Ò°¼nyȂUźīǖƳÈē°@šÝĶƒ@ƒÈkl¥Ççkxk™›JXÇƒUÅ@˜£k»„óƿīÛ@lÅJl¥óý@¯ƽġƍÅan™ċ™°é¯¹"],"encodeOffsets":[[128194,51014]]}},{"type":"Feature","id":"1529","properties":{"name":"阿拉善盟","cp":[102.019,40.1001],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@™ƏnǟƨʫšŹɆÿ°¯ÆV²ˢ™żÿ@ÝÆŁȰ¯ȀƳĉó™™@ğkyš¹@īš›ƒwl£Źƒƒ¯Ŧé@™ÇÇxŋĉƩUUŃōL™Ç™ĵóÝnƒóç@™™ó@ġƒƱ„¥ƒç™WUçÆōƒ@é—çťK™çȭVһƽ̻aW¥ȁ£ʵNJǓƲɳޗǔlżÞmĠóĬȂɲȮ@ÈĢŮźÔnĶŻǠšŎȭœгŃċóȭţΗÆƑÞƧÅΫóȘǫɱȁġlÛkÇ°ȁÈnšõl¯ô„ÞɛÝkĢóWĊ„zÇɼʝ@ÇÈķlUČÅÜķnέƒǓKȮŎŎb°ĢǀŌ@ȼôĬmĠğŰōĖƧbЇƧōx@ķó£Ål±ĀƧīXÝġƃêĉK°Ýʇƅ@ΌʉżÅÒϱʈ@˺ƾ֛।࡬ţશóЈèʞUš¤Ґ_޸Ƒʠɽ̦ÝɜL׈ɛϜóȂJϚÈ@ǟͪaÞ»Ȯź"],"encodeOffsets":[[107764,42750]]}},{"type":"Feature","id":"1525","properties":{"name":"锡林郭勒盟","cp":[115.6421,44.176],"childNum":12},"geometry":{"type":"Polygon","coordinates":["@@ʶĬĊIȘƨƨŽ@ĬÛĢșŤĉĬƒĀóšU‚ÈŚÜènŦƐȤȄłϰUƨťƾÑ܆ğɲƜǔÈèʈƲĊƞƒšɆ¯̼V˺Ò˺ȂŤVĢêU܃x„Āˌ˘ƨ„Æ°ѢmÞżU¼ÆlŎ@ĊçŎnÈÒͪŎźƒĸU°lżwUb°°°Vš£ÞlĠĉĊLޏɆnźÞ„n¦ĊaȂīġŃ¯Iĉůl»kƒ„™Çý„¥Ŏ¯ƒén£ġљÝȭxƒÇ™@Åçķ»óƱŎ¥™çWÿmlóa£Çb™yVÅČÇV»ÝU¯™KĉýǕċţnġ¯»ÇōUm»ğƒÑ™wƏbċÇŎċwˋÈÛÿʉÑ°Łkw@óÇ»ĉw™¥VÑŹU™mW»ğğljVÿŤÅźī@ř¯ğnõƐ@ÞÅnŁVljóJƒwĊÑkĕÝw¯nk¥ŏaó¦ĉƒV¦Å`ğуÑÝ@mwn¯m±@óƒÛKˍƏǓ±UšÝ™a¯lƒōšșk„èƒĬގn@ŤġŰk°ċx@œĉ`Ƨĕ°@ţÒĉwmĉ@ƒƒnƒƒa„™¥ķnƒÞĉVóÆókĉŽķ@ÝkƧƧÛaƒ°Ç@ÝÈU˜óbݼ@„ÛÒV°™@V¼ˋL™ÞɅŤŹǠVÞȗŤÇĖŚōbȁƜ"],"encodeOffsets":[[113817,44421]]}},{"type":"Feature","id":"1506","properties":{"name":"鄂尔多斯市","cp":[108.9734,39.2487],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@ĶL²ĬVłƑkkl@Ȏ™ŘWńÈĬȗ¯™ºlz@ĠššĊôŦô„ÒĠ°kÞܚ™n@¤„UĸèĸbŌÈXŽĸLlÒĢxɲÆ¤ÈÛƾJÈÝ°UšÅĶ»²VW¯ĸJôšbk‚V@ôlbnĊyÈzVôašb@ĸ‚ÞUl°yǬ²Ǭm°ššk„±lbn°@È»˜JX„VŎÑÆJ@k„LšƒÆl²™Ġ²ʊůĊġ‚řóƛÞÅ@m„ƒmLUÿóĉƧ@™»L@„›`ČĸmšȗÑţů±ĉğl¯Ā™wǎƒçƧŤÛI@±ÜĉǓçō°Uwô™ǫůķƳř±bÅ£™ÓÇwnÑó@ȁƽ@™ƒÇƧĢón»ŏĕóĊ¯b„Å™™VȯÅImƒōKU„™LǓ±Ýxċ—ŋ˜V±Āȗ°™„Źl±šÛ@WÒȁŚŹНŚÅèŌô„¼°ȰɞȂVĊ"],"encodeOffsets":[[109542,39983]]}},{"type":"Feature","id":"1504","properties":{"name":"赤峰市","cp":[118.6743,43.2642],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@ɲŁĢljĊwƾōÞĭ°_ŎŃźȹƒUČÿl»¯ôķVÿǬƽ™ɅġÅÑǫ»̐ʟȣU™¯wVWݍÈġW»Þ¹m݃ɛŎÿŎōͩůV¹›ō™éċ™óŹÅVVĢǩʈ@Ėċ@ķšÛšV°¯xÇÅţ¥™»°Ûô™ĉʟ„¥WýČ¥™w‚灻±mnÅķ¥ˋVƒbUÒġ»ÅxğLƧ™ƒbWĖÅxš¦U°ÝVóŰlô²@š¥ÜÞÛô„V@²±`š¦™„™¯Ý@„ŽÅ„VÒō¼ôš™¤V²ŹĬÇĊƑƒţxƒç¯Lk»ʟlƽýmłÝÆƏ@mö°Ġ@ŚŹĬţÆUĀĠNJĠŽX¼šnźVUҚ¦Ċxȼ@ôlx¯łʊÒÜĀˌÇČxƍČÈƐašx„ÒĠŽn¼ŎVȐ‚¼Ģ°ŤmǖČĊþšLV°ÞŽU¼ċÈUƚzÈa‚¤ôbkŽ‚nXĀšè"],"encodeOffsets":[[122232,46328]]}},{"type":"Feature","id":"1508","properties":{"name":"巴彦淖尔市","cp":[107.5562,41.3196],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@²@Ζǀݴʶհĸ„˜ƒ¦Ķ™̒Uˌ¼ӾÇƾ¼̨UÞĉ˜Ƨ—éÝ»ƒĕĉ—ƐȍœōǪakó‚ó¯a@™ôţ™aV¯Þ¯°@²él¥ĵğťwōxó¯k±š—Vó@™aóbUÇyĉzmŽkaóŽU@l™aó‚ķIX°±Uĵ¼™Æ¯VÇÞƽIÇÜÅ£ɱŽġwkÑķKWŋÇķaķçƒV@£šmۙlÝğ¯ƒÑťóǿƴȯ°Åł@ÞŻĀˡš±ŽÅU¯°ɅĀ™źƧʬmǠšƐ"],"encodeOffsets":[[107764,42750]]}},{"type":"Feature","id":"1505","properties":{"name":"通辽市","cp":[121.4758,43.9673],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@ôƲĸ¼Æèš@„ÈȮwƾ»ʠĢ¥VÆ@²¥@»Ŏњ¯ĊJŤ£k»ÆÇX¯̼ōšī°aX£ôƒƾȁź¥„ƒ™aôŤ™ĢL°ƒĸ@Ȯ¼ÈÒʈŚôVXůÆaĠƛÈKƒķšĉôÿ@ğÈĉ™»ÇVn™ĉV›wXĠÝ°šČÿĸwVƒ™¯¯ǵ±™ĉ‚ǫ™ÅÅm»²Ż±ƽIm¥ţÈķ@¯šƧJV»ÞUÝç¯UġºU£ţŽóaÅÅlƒƒ™Ƨī¯K¯Þ݃ğL̑ȍƽ@ōŎōĀƑɜnÞݺX¼ÇĢގUX°xVšʠȤ̏Ǭ¼ÆÒɆĢšŽǫƾUĀóĸ°‚k¼ċĀƑVŹȺōń¯`ÝĮƽŎĉxġNJɱłō¦"],"encodeOffsets":[[122097,46379]]}},{"type":"Feature","id":"1509","properties":{"name":"乌兰察布市","cp":[112.5769,41.77],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@ʠǠÞĸɲȺƒÒȂƛŎaƙÈĕȘţUÝźǟɆţšÝˌKU»š@U¯ÜÑ@ƒÞ»ôaV—ÞÇÈ@„¯ÜbƨƨÞlĸ@ĊôlôÅĊU„Ýĸmš¦ƒŽ„bm„„„Ċ@n‚ĊxŤÑ@¯‚ƨĖĊ_@›Čwl¯™ƒȭL›Ý„»ƽ¯ķů„Ǔ@ÇǓbċ™ÅÅÆwÿĠÇU£óaƒ¥¯aŎğĠţkw°»¯ůlÝĵkǻݰɱƧǫaóôɱ»Çk¯ŃóƒʇŐŻ›ĉNJŻĢ„Ž¯ÒÈUl°ƒx°n„Ò™Ĭón™Ċğ°ÇŚĉ¦ʵVƒ°°ĬÛżÇJȁńʇʹó˂ƽŎ›Æţ¦"],"encodeOffsets":[[112984,43763]]}},{"type":"Feature","id":"1522","properties":{"name":"兴安盟","cp":[121.3879,46.1426],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@ÆXnlŎ°@LVLĠþœxĊUȮĊnU„ĠV@żaW¯XIŎġƒ¥Ý@K@w@K@I˺ŻŎ¦ƨƒƨÒŎIÆ@X@VºnX°lŎ@ƾĉˤƒȘǷȘÑÝݚÞbVţĸÿŤxÈĖƐŽêÇKnĸ¥ô@›ķÞUnÒl@UŚaƒīˋƒ¯ÑƧx@±kXřƐƏÛéV™ˋ»lō¯ĉ„ÅÇÓǫޗĖġV@ğ»›°ĵ„ÇÞǓ¼¯m˜ÛÅŃĉĠÇƾb²çƒ™šéż¯VƒƒğÞml»ōÑV痻V¯™¯šĕÆU¯y°k¯¯V»ôDŽѰa@Źk™ġKţšóŽšbƒ„Ź¦ƽȂó„W¤¯b™Ĭ̻ŎW°ÅÈl¼ţ¤ĉI™°ōÒ@¼±¦Å@UŽġ¦ʟŽƽ¼šÞĢÒm¤„êō°ƒ¦Èþƒšl„k¼ĊŰ°JĢńȁĬ„°ƒżn‚ÇbV„ݼ@¼óĸţ¤@°Ånšl"],"encodeOffsets":[[122412,48482]]}},{"type":"Feature","id":"1502","properties":{"name":"包头市","cp":[110.3467,41.4899],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@źxżĀǔÆǬVȘĀŤ¥œÅƾōôˁʈͳȂŃÈIÜŻ¯ī„¯ōm™¯ɱĖ¯ƒķÒÝIÝ»ÅV™ƒlÅôфġ™ğVmÞnnƒWçkW܁XƝÆwU»Șĕš£ĉÑ𱱚Åk™„ƒK@lÅIō҃UW‚—IǼ¯@m‚kaƒ²™l¯™ǫnǫ±¯zkŽÝVķUô™˜l²ô°ŎwŦxĶĠk¦±ê¯@Ý°U°šbóŤ@š°bôlôǩb›ŎƏȎĊ˜„ĖÞ¼˜ê—ƨÝĊ"],"encodeOffsets":[[112017,43465]]}},{"type":"Feature","id":"1501","properties":{"name":"呼和浩特市","cp":[111.4124,40.4901],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@ʶUĊ¥ÈřĠ¯šĉômšīƒÑ¯m„wk¯ÇV°ÑƒżġĊljǓɱţǓ›ƝóX¯ƒɛÒóa@nÝÆôƜŚĉĢʉŰĊҙ¤ȗĖV¼ÅxWƞۂlXXèm„ÝmUnšĠƒĢóÒkƚ„ÆUÞ¼ÞJĸÑ°„ɲĕš°Ŏn"],"encodeOffsets":[[114098,42312]]}},{"type":"Feature","id":"1503","properties":{"name":"乌海市","cp":[106.886,39.4739],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@Ș°ÇīXњŗ@ȍlkƒlUŁ±īĵKō¼VŽÇôXĸ¯Ž@šťê„°ź„k¤„x™œ@Ĭ"],"encodeOffsets":[[109317,40799]]}}],"UTF8Encoding":true}; }); -define('echarts/util/mapData/geoJson/ning_xia_geo',[],function() { - return {"type":"FeatureCollection","features":[{"type":"Feature","id":"6403","properties":{"name":"吴忠市","cp":[106.853,37.3755],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@nLV‚@šVLšaÞbn@@l˜š@bUVlUV„zVx™¤kÞVèšXnš‚@nm°a@UƒÑ„@VŽXnV@Va„UšŽVKUUU@@U‚@@KVa@U²@‚wXkWnk„±lLnU@UmmVKnIVWnI@UK›@UK@@UVKXkmWLWUXmlkVwUyVa@w„w@aVI„K@aVÈw„KlLVV@LnV„VVnU‚ܲ°WÈIUÆ@nÞ¼‚‚@¦™@UÞUVW@UxUxVn„b„K‚b¯ÞU`VbǬ™V@XXÆVVl°InmnUôƒ°¯‚anam£œWVX‚KXmškôaVU@ƒVak@@wmaƒn@K@UÛUWKXUƒÇƒ@UI™b@alW@akLUKV@@Ukw±Iš›nL@kmwkWmk@JUIƒůVmnnU@m@UƒK„VKlkUwkƒƒnVUKmbkI±š—KƒkmVkKƒb@U@aƒVkUmn™`kIlaUK@UUKmbUIݚUa@mUa@aƒ„m@UUULUK@bmKkbWI@WXwlkXƒWa@k@kKƒLVkkK@L@JUVmzUKlwUUnW˜£XVlKUwVU@aXI@aWaUw@W@_nam@¯‚UkWVkUWaU@nwmJkUVkWVUmUkJ@ImbUaƒ@@WÅ_mJknmak@@mƒXƒaUV@„ƒxUšƒ„@‚ƒ„@VUnkVƒ@Vn@`ULUbWLXVW@kbUJ@XW`@ƒnÅĖWJƒ@—m°@xƒxšbnUa‚w²lƒÞ°xŤIVVULۂWbšbkVVXÆ`UbVL„@kx°LlV@Vœ„WbƒJn@bl¤ULV„°@lmL@ƒƒ£U@@aUwmKULVxUVVx@„™@kU™@mK¯LÇa¯@"],"encodeOffsets":[[108124,38605]]}},{"type":"Feature","id":"6405","properties":{"name":"中卫市","cp":[105.4028,36.9525],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@°@Èb°KnLš@lVš@@ƒUwVUUwVKnLVx@bV@„¤@„nK@k‚¯UƒVKk£@a‚m„IXa›ƒ@UkU¯Klwƒ@UKVaÅ_UWlU™aXa܁VKUUţJ¯w„ݱkxVbmŽ™a„w@wn¯˜„@XIÆĕ„m‚@X_@WVIlaX@WUXKVaVK@_Um„@lUVm@U„ƒ@„ƒV™„w@ƒVUÛwm@@W@ImKUkU@Ua‚aXƒ@wWaUKkw@UVaUamLU™nk@»±`¯@k—W@Ua™ykbƒI„„@VWJkLWUkJƒwU@ƒn¤mL¯wm@Umƒ²XVWbnV@bmxƒVkxUblLUV@kVWKU¼ƒŽkUƒ@mn@JnV@bUnmJUn@„k‚@XlxšLVVnKlLVV@š@LkKULVbk`WL@lkXW@kVƒ@UÞUlÇX™lkaUbmV¯@@L@šƒV@bkb@xƒlW„—bƒbW@—±@UJ@IU@mVk„VxV@@l„Illœn@Vm@ƒVUbl„@JLmKÛXmVkU›KULU`@LĉwƒKUX„lVUl@Vb„JX¦̼bÞxŎxɜĖĠ„Ŏaô@"],"encodeOffsets":[[108124,38605]]}},{"type":"Feature","id":"6404","properties":{"name":"固原市","cp":[106.1389,35.9363],"childNum":6},"geometry":{"type":"MultiPolygon","coordinates":[["@@Vnn@°xnK‚£„mV@„xlIXVlKXI@Uƒƒ„JlašzVbX@l˜°@²_@¼mlVšnKVbUb@VlxVLXb@xW„bVbV@VlnL@J@Xn@Üx„b„W@nl@nblmnIÆ`@X„@Vbna@aVUUWVkƒ@kbWakbU@VwšW@_l@nmn@@alVlk@UkmVak@@a‚UXaƒL@¯@KVa@axWI@KnkVaVJn_lJ@„X@‚m@nVanUVb@mXLlJ„VWnLla„VVaVX@KXVVkVKlknKVa@aVU@KXb@klJUknUmƒ@K@_UW@alIUamaU¯kJma@IUK@U„@@UW@@aXLVƒVJVaXIƒKlaUkUV@ambUUJkIWJ@wUI™V@JU@UwV@@Um@™nU`@UkUmVUxWUUV@aÅb@aWXkKUUƒUUaWK@wnm@IVU@aXwm@UmVaUalk@anKUwlƒUwlkK@wmaƒUkmmIk@VmkUUbW@UVUnW@kV@xkVmbVnU‚™@UbUV@a›k@kkW@„kLW¤@„nV@VU@W_UV™UU`VLUV@IUVõVULU@UUUJ@wmkUJ@šWI@l@bkKkbVVƒbVbUL@UUJ@Vm@@L@xbVVVLVlVwX@Vb@bmUkbk@@JWIUVÅw@Km@UkWKXxWLÅ@UVUnWK@xkVW„@KULwWVXVWzXVVKVXkV›V@VUbV@U„VV@š@LXxVL@V„b‚Ž„LnKVLVxXVmb@l"],["@@@J@aƒU@LWK¯UUxVVn@Ġ„„LUW@UbUUUa@KUX"]],"encodeOffsets":[[[108023,37052]],[[108541,36299]]]}},{"type":"Feature","id":"6401","properties":{"name":"银川市","cp":[106.3586,38.1775],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@šUšwVK@UVWÞUšbšw„V@knV˜@@KU_VK@K„ƒn@W_XWlL@Vn@Ċw@Ulaœ@Wanamī@aƒ»ŋó@aÆÅɲÿUaV_°ÝaƒLƒaUmVwVwX@VUVݚ@@¥Ý»@mVÅÇJ¯XÛ±VUmƒUmU@KUUkKƒLÇxUŽ@bƒLUJ@bƒx@xUbVzUxklWnXV‚KnXWlUL@V@ŽVLœ@VL@ŽmJUXmJULnn@VmVkKƒ²mlXWlx±@@VUb@L@@VV@VVUL™ƒVUbU@WmUƒ@„Ò@V¯bmn@VŽƒ„@lVnUšnVWŽXVl@¦VVUn@x‚š@‚XL@¦‚lXxš„Vb"],"encodeOffsets":[[108563,39803]]}},{"type":"Feature","id":"6402","properties":{"name":"石嘴山市","cp":[106.4795,39.0015],"childNum":2},"geometry":{"type":"Polygon","coordinates":["@@U¯ķó±ÇÛ¯™ķmbXb›@kb@Vĉxm@@UkKWXX`m@ƒ„@LULV`@L—@mU@lƒU™x™aÝVUX@VUL™x™VkLWVšš@J„nVLXVlŽUV@zl‚VL@V@b„„n@lU²WVLlLVbUŽVxUx@xǀL˜xôҜk‚K²ŽVa‚U@wXa@W™ÈĉUa@‚bÈk„m@¯"],"encodeOffsets":[[109542,39938]]}}],"UTF8Encoding":true}; +define('echarts/util/mapData/geoJson/ning_xia_geo',[],function() { + return {"type":"FeatureCollection","features":[{"type":"Feature","id":"6403","properties":{"name":"吴忠市","cp":[106.853,37.3755],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@nLV‚@šVLšaÞbn@@l˜š@bUVlUV„zVx™¤kÞVèšXnš‚@nm°a@UƒÑ„@VŽXnV@Va„UšŽVKUUU@@U‚@@KVa@U²@‚wXkWnk„±lLnU@UmmVKnIVWnI@UK›@UK@@UVKXkmWLWUXmlkVwUyVa@w„w@aVI„K@aVÈw„KlLVV@LnV„VVnU‚ܲ°WÈIUÆ@nÞ¼‚‚@¦™@UÞUVW@UxUxVn„b„K‚b¯ÞU`VbǬ™V@XXÆVVl°InmnUôƒ°¯‚anam£œWVX‚KXmškôaVU@ƒVak@@wmaƒn@K@UÛUWKXUƒÇƒ@UI™b@alW@akLUKV@@Ukw±Iš›nL@kmwkWmk@JUIƒůVmnnU@m@UƒK„VKlkUwkƒƒnVUKmbkI±š—KƒkmVkKƒb@U@aƒVkUmn™`kIlaUK@UUKmbUIݚUa@mUa@aƒ„m@UUULUK@bmKkbWI@WXwlkXƒWa@k@kKƒLVkkK@L@JUVmzUKlwUUnW˜£XVlKUwVU@aXI@aWaUw@W@_nam@¯‚UkWVkUWaU@nwmJkUVkWVUmUkJ@ImbUaƒ@@WÅ_mJknmak@@mƒXƒaUV@„ƒxUšƒ„@‚ƒ„@VUnkVƒ@Vn@`ULUbWLXVW@kbUJ@XW`@ƒnÅĖWJƒ@—m°@xƒxšbnUa‚w²lƒÞ°xŤIVVULۂWbšbkVVXÆ`UbVL„@kx°LlV@Vœ„WbƒJn@bl¤ULV„°@lmL@ƒƒ£U@@aUwmKULVxUVVx@„™@kU™@mK¯LÇa¯@"],"encodeOffsets":[[108124,38605]]}},{"type":"Feature","id":"6405","properties":{"name":"中卫市","cp":[105.4028,36.9525],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@°@Èb°KnLš@lVš@@ƒUwVUUwVKnLVx@bV@„¤@„nK@k‚¯UƒVKk£@a‚m„IXa›ƒ@UkU¯Klwƒ@UKVaÅ_UWlU™aXa܁VKUUţJ¯w„ݱkxVbmŽ™a„w@wn¯˜„@XIÆĕ„m‚@X_@WVIlaX@WUXKVaVK@_Um„@lUVm@U„ƒ@„ƒV™„w@ƒVUÛwm@@W@ImKUkU@Ua‚aXƒ@wWaUKkw@UVaUamLU™nk@»±`¯@k—W@Ua™ykbƒI„„@VWJkLWUkJƒwU@ƒn¤mL¯wm@Umƒ²XVWbnV@bmxƒVkxUblLUV@kVWKU¼ƒŽkUƒ@mn@JnV@bUnmJUn@„k‚@XlxšLVVnKlLVV@š@LkKULVbk`WL@lkXW@kVƒ@UÞUlÇX™lkaUbmV¯@@L@šƒV@bkb@xƒlW„—bƒbW@—±@UJ@IU@mVk„VxV@@l„Illœn@Vm@ƒVUbl„@JLmKÛXmVkU›KULU`@LĉwƒKUX„lVUl@Vb„JX¦̼bÞxŎxɜĖĠ„Ŏaô@"],"encodeOffsets":[[108124,38605]]}},{"type":"Feature","id":"6404","properties":{"name":"固原市","cp":[106.1389,35.9363],"childNum":6},"geometry":{"type":"MultiPolygon","coordinates":[["@@Vnn@°xnK‚£„mV@„xlIXVlKXI@Uƒƒ„JlašzVbX@l˜°@²_@¼mlVšnKVbUb@VlxVLXb@xW„bVbV@VlnL@J@Xn@Üx„b„W@nl@nblmnIÆ`@X„@Vbna@aVUUWVkƒ@kbWakbU@VwšW@_l@nmn@@alVlk@UkmVak@@a‚UXaƒL@¯@KVa@axWI@KnkVaVJn_lJ@„X@‚m@nVanUVb@mXLlJ„VWnLla„VVaVX@KXVVkVKlknKVa@aVU@KXb@klJUknUmƒ@K@_UW@alIUamaU¯kJma@IUK@U„@@UW@@aXLVƒVJVaXIƒKlaUkUV@ambUUJkIWJ@wUI™V@JU@UwV@@Um@™nU`@UkUmVUxWUUV@aÅb@aWXkKUUƒUUaWK@wnm@IVU@aXwm@UmVaUalk@anKUwlƒUwlkK@wmaƒUkmmIk@VmkUUbW@UVUnW@kV@xkVmbVnU‚™@UbUV@a›k@kkW@„kLW¤@„nV@VU@W_UV™UU`VLUV@IUVõVULU@UUUJ@wmkUJ@šWI@l@bkKkbVVƒbVbUL@UUJ@Vm@@L@xbVVVLVlVwX@Vb@bmUkbk@@JWIUVÅw@Km@UkWKXxWLÅ@UVUnWK@xkVW„@KULwWVXVWzXVVKVXkV›V@VUbV@U„VV@š@LXxVL@V„b‚Ž„LnKVLVxXVmb@l"],["@@@J@aƒU@LWK¯UUxVVn@Ġ„„LUW@UbUUUa@KUX"]],"encodeOffsets":[[[108023,37052]],[[108541,36299]]]}},{"type":"Feature","id":"6401","properties":{"name":"银川市","cp":[106.3586,38.1775],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@šUšwVK@UVWÞUšbšw„V@knV˜@@KU_VK@K„ƒn@W_XWlL@Vn@Ċw@Ulaœ@Wanamī@aƒ»ŋó@aÆÅɲÿUaV_°ÝaƒLƒaUmVwVwX@VUVݚ@@¥Ý»@mVÅÇJ¯XÛ±VUmƒUmU@KUUkKƒLÇxUŽ@bƒLUJ@bƒx@xUbVzUxklWnXV‚KnXWlUL@V@ŽVLœ@VL@ŽmJUXmJULnn@VmVkKƒ²mlXWlx±@@VUb@L@@VV@VVUL™ƒVUbU@WmUƒ@„Ò@V¯bmn@VŽƒ„@lVnUšnVWŽXVl@¦VVUn@x‚š@‚XL@¦‚lXxš„Vb"],"encodeOffsets":[[108563,39803]]}},{"type":"Feature","id":"6402","properties":{"name":"石嘴山市","cp":[106.4795,39.0015],"childNum":2},"geometry":{"type":"Polygon","coordinates":["@@U¯ķó±ÇÛ¯™ķmbXb›@kb@Vĉxm@@UkKWXX`m@ƒ„@LULV`@L—@mU@lƒU™x™aÝVUX@VUL™x™VkLWVšš@J„nVLXVlŽUV@zl‚VL@V@b„„n@lU²WVLlLVbUŽVxUx@xǀL˜xôҜk‚K²ŽVa‚U@wXa@W™ÈĉUa@‚bÈk„m@¯"],"encodeOffsets":[[109542,39938]]}}],"UTF8Encoding":true}; }); -define('echarts/util/mapData/geoJson/qing_hai_geo',[],function() { - return {"type":"FeatureCollection","features":[{"type":"Feature","id":"6328","properties":{"name":"海西蒙古族藏族自治州","cp":[94.9768,37.1118],"childNum":7},"geometry":{"type":"MultiPolygon","coordinates":[["@@„V£°š@laœXô±źwš™ô@„Ulƒża܍n™Kƒw@U„aƒ™ša²L‚mÈLƚÈxlaUa„wÞmÜbÞUšnJ°a„kôƒ‚ÑkwÝVğwÇ@ÝkkV¯¥@ò„»„nŤ¥XImw@mVwša@Åw™mLkaW—wƒ¥l»kçƒó„»@ƒWÑĉŽğ@ĉ„™‚Ń„UwóřVómĵ»™™Ý@VǕ¯kšÝĊÅk™°ÓUklkU±šI„ÇÞkƒ±@šƽJƒ™@UġIk@W¦™VÑșÓÅnťKULnŽ¯X›ƒ@¯mUÛ@WřmóKknōbƒxÝ@ƒŽU@kw@ÿÇLţšÝUkšmwƒŽk™lċVŚU¦™ŽƒLkUWlÅÑ@aƒ@ÅѱUóġŹ¼ƒÈĉmŻ@@wkw™Kl¯U™ġ@—„lÇU™Ó¯_ƒ‚Waĉ²Åló¼VbknƒKǎÅ@ƧĢō°Ý@ğ„W™ÅxUUm@™‚ÝXۂW„ULUè¯@mbUaƒLƒbUWġxIUJWz™a¯b™y™@ōÈóLU`ÇXUl™UĉV¯n›mÛbǕLklƒUĉVƒšóaġ„ƏbġKţnkbÝmmnÝWȭȃŽÝXţWókUÇl¯U¯‚ġUɅĀ@°¯„„š¯„VÆnmJ@ĊķnóJUbÝXUlVškL@lVxnnmb@¤Vzš`ÞÞŤ@„VnÆJV„°b„UôJkzlŽkl@²óš@ÆÇ°kĖƒšÇbÛU@lmb™XV˜kzƒV™ŽɅĀXˢlń„ĬŹ@›éÅ@ĉńÆ°ğbUšlŽɜ_°‚@xŦ˜škbVbƒKĢ„ŤVŎŽ°@żÈźlĊ„ôKôb@nôxŦ„Æ@ôŽŎL@þÆb@šnnšWˌbÈx‚InaŎxlU@Ѳ±ƒğVUĢƒƨbɲ@Þ¥ôUUķWVô¯ĊWʶnôaŤˁ@£nmnIôŽǪK°xUXô@Ŧa°m‚kXÆÞVŎkĊ°ÞLȄôyVašIlwX°UVwĢÑÜKôw@nV@œm°nmŽn„Ü‚ɞ£VbmŽXnƒ°ÜÒ@xx@V‚b²UlbkxVnšJUnVVĊ°KȚm°nxÇnn¤±¦@ŽUXVV@„lV„„bmVVȁŽVxšÒ™°šIšbźaȃšbVwš@šƒVL„™ƾÑ@ƒŦô¯ĊkôÑ"],["@@„@šƒ„@n„òVœa‚w²bVxšxÜaČVô_ĊJšIVmšL„a°@Ŏ¥XlK@ƒšk„l„KVbUb˜@nUĢn‚aÈ@lmǬ»Ġ¯œn‚mnƒƨVy™Ñǖ™Ġ»ɲInŽ‚@@ÅĢƳ@¯°™ôV„KÈbVIÇ¥¯@Ýó„™@ÑnīWKšƒk™‚k@¥š™¯™Åa™Xƒ±VÅw@±Ġ¯@»™š™n™Wmw@ƒ™@¯ƒVƒUUWçƒKĉ„a±VkkƒV¯w™x@šUJ‚x@bknÇb™mÅ@Uw±U¯¦UŽ™Kmš¯I¯Žť¼ğĊ™@ǃŹÈ¯@Ý»ÇnˡJƒbÛèÇnƒ„ÅK¯„ġĠŹW¼Ålm„@¤n²ƒŽÝb@b„š¯lƒ¯@ƒšÅ¤W„™¼nV@x„„°@Vx„@lbUblbX¼W‚œšÇ²lšUŽ@¼ŽV¦@bÇlVxUbVxÞbVšœbm¦ƒVV„"]],"encodeOffsets":[[[100452,39719]],[[91980,35742]]]}},{"type":"Feature","id":"6327","properties":{"name":"玉树藏族自治州","cp":[93.5925,33.9368],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@ɆÿĢV°°VÈklVôŤXÞW„ȮÇÞXnmÞnlaŤmĢLƐaĢƒôb„™ĊU„VlkǖKÜaœn°mĊUšVVkÈWV_ôKŎǚ@šz°ašbXyVI‚JĢwVX„a„KVbna°@VçVKXƒÜÞWšn@VVÆwXšĠƒÞ@Ŏ¯ƨġÆ@ȍ„LlmUaô»ÆkĊ±Xb„°`šÔV‚kȘƒĢ@Všk°šLlx@xż@Ċn„Çź»ôĢ²VÆ҄@@bÆÒXklV„KšV¥Æ™ČUšk‚l„nxl™çƒ¥ċç@±m¥ƒwÅJƒ@™™™Vƒ„mÈIléÈa°U¥™™@kÞV‚K²ÑWƒ°w²Ñ‚K²ñšyƐ„ÝšVmw„»kkWĉ—JWUƒVÅwƒL™mÅ@@ƒmw„kn¥Vу»°™°@@»„¯„Lla„JônV‚UůƒU@W¯Umѯ¯k@WykU@¯„wV¥ƒkVwţƒk»šwWǜĉĶçšK„ƒÞ™ÇaĉbƒI™lUƒ@kwƒWƒXUƒ°w™±@UšKn£Wĉ—KWxƒkĕVƒšamwXw™@™„Wmnk@aƒVkƒ™bĉLƒl™Imm„wUÇ‚Wx™nÝJn@¥Æ™kwƒaXƒÜĉ™¯ÅV¯¤mkƒx¯kķܙ²VWôŹVUƒƒ@V£™¥@ƒ°wn@™m@¯@UbUôķŽmn@ÆÛ@ÇýVaUÇĊVƒ@Çlğ—¯xÝŤ™lVÈÈVƒx„ƒ¤Vx™„kK@™@ƒx@„kVƒĖġ¥kIWbXŽŎx@nƒxÅUW`ƒ_—@±ŽUa™LUxƒK¯„WbkVlb—bmŽƒLÛÆWIUwƒWkwÝV@kI›ŽéUb›UUk™V¯Km¯k@Umݐ¯m¯›m—L›Þĉ‚ÛUm™ġ£UxkKm°™Lw›šk@kšƒVm„ƒKVUk›@¯a¯Ģ™móKUU™x™ImlÅn™™ÇbXèVVU„°„@ŽšŽ@„‚xXnmš™ššŽ@¼ğ°@²ÆxU‚„²šWÆb°š™š@¦llš™„XLmĬ@҃šÞô°@ȦUJÇaƒLóU¯š@°ġƴ@Ɓ@mɱJğ¼ǕššÒUzƧ‚m„n›mğ°ǫ¼knÇ@bġmmV—@VaUaƒLƒk™l@„kLW‚ō¦¯@ƒb™KUn™JĉIó`ċUÛb™wUw±ax›bñUmƒƒ@™„ƒ@—bƒaƒbǏÅXm˜„ƒÝ„ÅôVbގ™bl„UšÞVޚ„U‚°„VUxƒ@U„V„@l`™¼nL@Ċ„LW„„¤kXķWġXUVVVķ„UbVb@°kVVxÈa‚@ȦĊbšaźJ„U@Ț„„˜Vœƒlš@XkôaWƒĢ™Þ@laĸUÆb²mÞLĠ™ÞÑôbšÒĊa„JVbm¦"],"encodeOffsets":[[93285,37030]]}},{"type":"Feature","id":"6326","properties":{"name":"果洛藏族自治州","cp":[99.3823,34.0466],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@ÞVŤ™ÈK@ĀlxV@„Þ@„wŎalmôLšnXÆÜ@nV‚°@œ„°WmVKŦLÆmȚԂҚUX¥l@ĢJVš@„ŽƾI@w™W°™™Ån¥›kÅÝVwôƒÈç„@lÑĊĕša„JnaÆLVw°kny°UnkÆVȍĊll¦„Vƾ@@™nUźƒÈǂIn°X„wÞKô¦VWV£„@£°ókċ±I™™am¯Va™»ČĉV¥°™@m„k„¥l@„Ċm@ašU™mwXƒ@wÆxšmĢ_„`VnÆbšKVw„@@ƒnUVğVmVVöIlŽl@@çÛmƒ£UDŽw°@VUƒ¯»m¯ƒJōĖÅLƒa@»ĉĢ±`U_k`ÇçšóƒkX™lK@ƒakÝރš£WċkÝ™kxƒJݯÅw™xķxmIÅx„@k±J@ýŋš›¤UœkŽmV™°ÅÝxkwmġƒnÝVU„š¦ƒŤlmšóXk¤™UKƒç™@mVkK@klīƒ£mš¯VUbƒW¯¼ċb¯ĵam¼mVX„m@k¤ÇX‚ÇbƒUƒ„¯J¯„¯È@˜™bVXVҙ¤V¼kxݚV„@l‚V—„WxÛ¦Wš¯šmKnlŽkŽ‚šU‚@nƑUĉ„Ý@ǺۄċUĉ¥™UƒÞŏ™z±òL±Ò¯xX„±ÒLÝU@lššV¦¯‚ÇbkêÇJƒnU„šš@š„‚ÆI„xn¦‚‚@²Č脦‚è"],"encodeOffsets":[[99709,36130]]}},{"type":"Feature","id":"6325","properties":{"name":"海南藏族自治州","cp":[100.3711,35.9418],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@VxƒŽńƒš@ĊĠŽĊXÒ°UƾĕÞm°£nb@‚@LUUW„Ûº@nlÆǬšĠ£ÞV°UXb‚VȂǵ„éƒ@kWanm°@™x„z„K°¯ĠVšƒVƒkw™Lnm°kÞxÆa„¥@‚wnĉƏ@™œ_l›š_VwšmĸèŤÅČU@™˜Wn@ÑmKU™nğƒK@ƒ°¯UÿV£nmšLl™„UƒUÛé±óókkmƒnƒakV@Ç°óÝXƒWəÞťIţxmm™VÛUVȂÓnWyȁĉkƒVš°WnkĊa„¥‚_œK°ÿWna@ƒmU¯wƒlÝIU¤UXó¥ÝLƒx¯WmJÇÈŹ„mV@šƽ@ƒUk¥ĉkċŽÅUml¯Vmz¯lUxÅKmbƒI™bĉĖk҃@Çèó„UxÆޜlm¦šÆ¯ššX@x™Ž@Ž„²ÝlƒÈ™JV²klVl¯ÔlšĉƙްlUǖÞ@ššĶ¼nŽUôôŚ"],"encodeOffsets":[[101712,37632]]}},{"type":"Feature","id":"6322","properties":{"name":"海北藏族自治州","cp":[100.3711,37.9138],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@ōmġxƽUm±Lǿþġԙ@kxmWƒb¯I¯‚mIUx@bƒbŹVǎƒkĵbƒlĉI¯¥ƒUšm@ƒÆ¯È@šašóšUlƒČ»@w›œ»›wXaƒƒó°ţç݄kUƒaV¥ÅbÝw¯lmnšKlxU„™„ğU¯°ƒLƒyšw¯@mnXb‚l„@ƒêȁǶUWa¯VÝUğ¤ǫ™kÅ@mܹXƒVV@K@ma¯¤ÝnƽĖ¯V@„ƒ¼„ôlèk¼„¦˜xXŽlbnKšÆx@Ž™bUx@nnxWJţ¦ƒmƒ¼ñ@Ž°¦lUÞlÈ@ĠxÞUlxÒó„ƒl¯bmI™ŽÝVÛaÝnƒxVbkbÇwřÇKn±K™b„šƒb@V„xšLmŽÛŽŻbk„ƒVó@™šŹxó²›Wkb™@¯U¤ƒźĊ@lUX„°lÆôU„ƒlLX‚aœV°wšxUb°xÜôÈKVkÈmlwškÈKšwšK™™VUŤĉŎ»„»„Il¥na°LV»²¯Üy@wĢƒ°ĸwlwĢw°±„_lVkš@°ƒbƒÆ¯zƒ‚„š„@l_„@Ģ±lŚVlUaރ„LVƒnKlnȏ°IllČa˜wÞÑ°x„UU™@wƒVkmĠLô»„KÞýôaÞ¥ôĀÞmƁ„™‚mUƒŎV¥Èl°²°a²¥V„@@w„amm@Ñn@Æ£żƒVƒĠ£@W„¯Þƒšl@š»@Uk@"],"encodeOffsets":[[105087,37992]]}},{"type":"Feature","id":"6323","properties":{"name":"黄南藏族自治州","cp":[101.5686,35.1178],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@ôl²ôÜê„VƒVkš™KmnU¤VĀ¯°@„„LmĠVšnLÈL@alb@al@n°Vš_XmWUÈamaVIn@n‚aV£œóVWƒ™U£°ašxÈ¥@™‚aĊwȹ@óša™ƒğbm@k„w@mƒaÆw@ƒ„In¯mmƒ@UkkWƒÑÅ@@kċÅçVkÝJÅkVykŹl¥@¯š™ĢU܃X¥òý—mmX™ÝÅlmU@£™Wly™XW»Åbƒl@aI›»k@klm@UxUUƒVƒ¼¯Xƒl™aUnķ‚ƒI@x™@¯„ƒK™„ĉUU`óšlČ¯ô@¤ƒÞJ„k°xVŽ„n@ŽmbXŽ¯Ā›L`ƒ¦ĉbml¯X™ŽUŽl„ȂĊXzm‚ȁÔU‚ÜVšUnnŤwŦJɚ݄XÞW¯ô@ÈlU„b„mln"],"encodeOffsets":[[103984,36344]]}},{"type":"Feature","id":"6321","properties":{"name":"海东地区","cp":[102.3706,36.2988],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@@҄bš¤ÆI°ôU¼š°UŽnnWx™š@b¯L@lUUWbXxWl„ƨnxVUllš„XVŽUŽnL@lȀý²KVnƾ‚ĢwV»ƒ@mÞ£nÆƒÞÑmL™ƒKUaVżĕƒWVk²ƒƒÆÝ@ƒXw°@„ô™@a°wóUUmIk™™aVmÞwmknyƒ¹VÿƧnŏm£X»˜™naV±„Ýw@ašb@aƒm¯„ĉVó¦kÝWKUU@WanU™b@ôǺĉxb@šÇ¦™w¯bV¤„šUX›ôU¤bmm@UJnbÇbXVWn™`¯Umk@@bka@bÇK"],"encodeOffsets":[[104108,37030]]}},{"type":"Feature","id":"6301","properties":{"name":"西宁市","cp":[101.4038,36.8207],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@@kmKVUƒWk™VkUmwƒƧXkWwXaVV@k°K@aš™XwmmV™¯V»¯óÅJ™£ƒamŽ—X@šċVţÆķç™nUx™`kœ›`@šÅmĊx@Žƒ¦U¦„blVރŤèô¯„„Wbœx›¼œŽ@xċ¼k„™V™ô™bÇ@Å°@„™n„V°¦ĊJ„kĶa„lȍźU„a@aVwnJ°°J„anXlwš@ĢÓ"],"encodeOffsets":[[104356,38042]]}}],"UTF8Encoding":true}; +define('echarts/util/mapData/geoJson/qing_hai_geo',[],function() { + return {"type":"FeatureCollection","features":[{"type":"Feature","id":"6328","properties":{"name":"海西蒙古族藏族自治州","cp":[94.9768,37.1118],"childNum":7},"geometry":{"type":"MultiPolygon","coordinates":[["@@„V£°š@laœXô±źwš™ô@„Ulƒża܍n™Kƒw@U„aƒ™ša²L‚mÈLƚÈxlaUa„wÞmÜbÞUšnJ°a„kôƒ‚ÑkwÝVğwÇ@ÝkkV¯¥@ò„»„nŤ¥XImw@mVwša@Åw™mLkaW—wƒ¥l»kçƒó„»@ƒWÑĉŽğ@ĉ„™‚Ń„UwóřVómĵ»™™Ý@VǕ¯kšÝĊÅk™°ÓUklkU±šI„ÇÞkƒ±@šƽJƒ™@UġIk@W¦™VÑșÓÅnťKULnŽ¯X›ƒ@¯mUÛ@WřmóKknōbƒxÝ@ƒŽU@kw@ÿÇLţšÝUkšmwƒŽk™lċVŚU¦™ŽƒLkUWlÅÑ@aƒ@ÅѱUóġŹ¼ƒÈĉmŻ@@wkw™Kl¯U™ġ@—„lÇU™Ó¯_ƒ‚Waĉ²Åló¼VbknƒKǎÅ@ƧĢō°Ý@ğ„W™ÅxUUm@™‚ÝXۂW„ULUè¯@mbUaƒLƒbUWġxIUJWz™a¯b™y™@ōÈóLU`ÇXUl™UĉV¯n›mÛbǕLklƒUĉVƒšóaġ„ƏbġKţnkbÝmmnÝWȭȃŽÝXţWókUÇl¯U¯‚ġUɅĀ@°¯„„š¯„VÆnmJ@ĊķnóJUbÝXUlVškL@lVxnnmb@¤Vzš`ÞÞŤ@„VnÆJV„°b„UôJkzlŽkl@²óš@ÆÇ°kĖƒšÇbÛU@lmb™XV˜kzƒV™ŽɅĀXˢlń„ĬŹ@›éÅ@ĉńÆ°ğbUšlŽɜ_°‚@xŦ˜škbVbƒKĢ„ŤVŎŽ°@żÈźlĊ„ôKôb@nôxŦ„Æ@ôŽŎL@þÆb@šnnšWˌbÈx‚InaŎxlU@Ѳ±ƒğVUĢƒƨbɲ@Þ¥ôUUķWVô¯ĊWʶnôaŤˁ@£nmnIôŽǪK°xUXô@Ŧa°m‚kXÆÞVŎkĊ°ÞLȄôyVašIlwX°UVwĢÑÜKôw@nV@œm°nmŽn„Ü‚ɞ£VbmŽXnƒ°ÜÒ@xx@V‚b²UlbkxVnšJUnVVĊ°KȚm°nxÇnn¤±¦@ŽUXVV@„lV„„bmVVȁŽVxšÒ™°šIšbźaȃšbVwš@šƒVL„™ƾÑ@ƒŦô¯ĊkôÑ"],["@@„@šƒ„@n„òVœa‚w²bVxšxÜaČVô_ĊJšIVmšL„a°@Ŏ¥XlK@ƒšk„l„KVbUb˜@nUĢn‚aÈ@lmǬ»Ġ¯œn‚mnƒƨVy™Ñǖ™Ġ»ɲInŽ‚@@ÅĢƳ@¯°™ôV„KÈbVIÇ¥¯@Ýó„™@ÑnīWKšƒk™‚k@¥š™¯™Åa™Xƒ±VÅw@±Ġ¯@»™š™n™Wmw@ƒ™@¯ƒVƒUUWçƒKĉ„a±VkkƒV¯w™x@šUJ‚x@bknÇb™mÅ@Uw±U¯¦UŽ™Kmš¯I¯Žť¼ğĊ™@ǃŹÈ¯@Ý»ÇnˡJƒbÛèÇnƒ„ÅK¯„ġĠŹW¼Ålm„@¤n²ƒŽÝb@b„š¯lƒ¯@ƒšÅ¤W„™¼nV@x„„°@Vx„@lbUblbX¼W‚œšÇ²lšUŽ@¼ŽV¦@bÇlVxUbVxÞbVšœbm¦ƒVV„"]],"encodeOffsets":[[[100452,39719]],[[91980,35742]]]}},{"type":"Feature","id":"6327","properties":{"name":"玉树藏族自治州","cp":[93.5925,33.9368],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@ɆÿĢV°°VÈklVôŤXÞW„ȮÇÞXnmÞnlaŤmĢLƐaĢƒôb„™ĊU„VlkǖKÜaœn°mĊUšVVkÈWV_ôKŎǚ@šz°ašbXyVI‚JĢwVX„a„KVbna°@VçVKXƒÜÞWšn@VVÆwXšĠƒÞ@Ŏ¯ƨġÆ@ȍ„LlmUaô»ÆkĊ±Xb„°`šÔV‚kȘƒĢ@Všk°šLlx@xż@Ċn„Çź»ôĢ²VÆ҄@@bÆÒXklV„KšV¥Æ™ČUšk‚l„nxl™çƒ¥ċç@±m¥ƒwÅJƒ@™™™Vƒ„mÈIléÈa°U¥™™@kÞV‚K²ÑWƒ°w²Ñ‚K²ñšyƐ„ÝšVmw„»kkWĉ—JWUƒVÅwƒL™mÅ@@ƒmw„kn¥Vу»°™°@@»„¯„Lla„JônV‚UůƒU@W¯Umѯ¯k@WykU@¯„wV¥ƒkVwţƒk»šwWǜĉĶçšK„ƒÞ™ÇaĉbƒI™lUƒ@kwƒWƒXUƒ°w™±@UšKn£Wĉ—KWxƒkĕVƒšamwXw™@™„Wmnk@aƒVkƒ™bĉLƒl™Imm„wUÇ‚Wx™nÝJn@¥Æ™kwƒaXƒÜĉ™¯ÅV¯¤mkƒx¯kķܙ²VWôŹVUƒƒ@V£™¥@ƒ°wn@™m@¯@UbUôķŽmn@ÆÛ@ÇýVaUÇĊVƒ@Çlğ—¯xÝŤ™lVÈÈVƒx„ƒ¤Vx™„kK@™@ƒx@„kVƒĖġ¥kIWbXŽŎx@nƒxÅUW`ƒ_—@±ŽUa™LUxƒK¯„WbkVlb—bmŽƒLÛÆWIUwƒWkwÝV@kI›ŽéUb›UUk™V¯Km¯k@Umݐ¯m¯›m—L›Þĉ‚ÛUm™ġ£UxkKm°™Lw›šk@kšƒVm„ƒKVUk›@¯a¯Ģ™móKUU™x™ImlÅn™™ÇbXèVVU„°„@ŽšŽ@„‚xXnmš™ššŽ@¼ğ°@²ÆxU‚„²šWÆb°š™š@¦llš™„XLmĬ@҃šÞô°@ȦUJÇaƒLóU¯š@°ġƴ@Ɓ@mɱJğ¼ǕššÒUzƧ‚m„n›mğ°ǫ¼knÇ@bġmmV—@VaUaƒLƒk™l@„kLW‚ō¦¯@ƒb™KUn™JĉIó`ċUÛb™wUw±ax›bñUmƒƒ@™„ƒ@—bƒaƒbǏÅXm˜„ƒÝ„ÅôVbގ™bl„UšÞVޚ„U‚°„VUxƒ@U„V„@l`™¼nL@Ċ„LW„„¤kXķWġXUVVVķ„UbVb@°kVVxÈa‚@ȦĊbšaźJ„U@Ț„„˜Vœƒlš@XkôaWƒĢ™Þ@laĸUÆb²mÞLĠ™ÞÑôbšÒĊa„JVbm¦"],"encodeOffsets":[[93285,37030]]}},{"type":"Feature","id":"6326","properties":{"name":"果洛藏族自治州","cp":[99.3823,34.0466],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@ÞVŤ™ÈK@ĀlxV@„Þ@„wŎalmôLšnXÆÜ@nV‚°@œ„°WmVKŦLÆmȚԂҚUX¥l@ĢJVš@„ŽƾI@w™W°™™Ån¥›kÅÝVwôƒÈç„@lÑĊĕša„JnaÆLVw°kny°UnkÆVȍĊll¦„Vƾ@@™nUźƒÈǂIn°X„wÞKô¦VWV£„@£°ókċ±I™™am¯Va™»ČĉV¥°™@m„k„¥l@„Ċm@ašU™mwXƒ@wÆxšmĢ_„`VnÆbšKVw„@@ƒnUVğVmVVöIlŽl@@çÛmƒ£UDŽw°@VUƒ¯»m¯ƒJōĖÅLƒa@»ĉĢ±`U_k`ÇçšóƒkX™lK@ƒakÝރš£WċkÝ™kxƒJݯÅw™xķxmIÅx„@k±J@ýŋš›¤UœkŽmV™°ÅÝxkwmġƒnÝVU„š¦ƒŤlmšóXk¤™UKƒç™@mVkK@klīƒ£mš¯VUbƒW¯¼ċb¯ĵam¼mVX„m@k¤ÇX‚ÇbƒUƒ„¯J¯„¯È@˜™bVXVҙ¤V¼kxݚV„@l‚V—„WxÛ¦Wš¯šmKnlŽkŽ‚šU‚@nƑUĉ„Ý@ǺۄċUĉ¥™UƒÞŏ™z±òL±Ò¯xX„±ÒLÝU@lššV¦¯‚ÇbkêÇJƒnU„šš@š„‚ÆI„xn¦‚‚@²Č脦‚è"],"encodeOffsets":[[99709,36130]]}},{"type":"Feature","id":"6325","properties":{"name":"海南藏族自治州","cp":[100.3711,35.9418],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@VxƒŽńƒš@ĊĠŽĊXÒ°UƾĕÞm°£nb@‚@LUUW„Ûº@nlÆǬšĠ£ÞV°UXb‚VȂǵ„éƒ@kWanm°@™x„z„K°¯ĠVšƒVƒkw™Lnm°kÞxÆa„¥@‚wnĉƏ@™œ_l›š_VwšmĸèŤÅČU@™˜Wn@ÑmKU™nğƒK@ƒ°¯UÿV£nmšLl™„UƒUÛé±óókkmƒnƒakV@Ç°óÝXƒWəÞťIţxmm™VÛUVȂÓnWyȁĉkƒVš°WnkĊa„¥‚_œK°ÿWna@ƒmU¯wƒlÝIU¤UXó¥ÝLƒx¯WmJÇÈŹ„mV@šƽ@ƒUk¥ĉkċŽÅUml¯Vmz¯lUxÅKmbƒI™bĉĖk҃@Çèó„UxÆޜlm¦šÆ¯ššX@x™Ž@Ž„²ÝlƒÈ™JV²klVl¯ÔlšĉƙްlUǖÞ@ššĶ¼nŽUôôŚ"],"encodeOffsets":[[101712,37632]]}},{"type":"Feature","id":"6322","properties":{"name":"海北藏族自治州","cp":[100.3711,37.9138],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@ōmġxƽUm±Lǿþġԙ@kxmWƒb¯I¯‚mIUx@bƒbŹVǎƒkĵbƒlĉI¯¥ƒUšm@ƒÆ¯È@šašóšUlƒČ»@w›œ»›wXaƒƒó°ţç݄kUƒaV¥ÅbÝw¯lmnšKlxU„™„ğU¯°ƒLƒyšw¯@mnXb‚l„@ƒêȁǶUWa¯VÝUğ¤ǫ™kÅ@mܹXƒVV@K@ma¯¤ÝnƽĖ¯V@„ƒ¼„ôlèk¼„¦˜xXŽlbnKšÆx@Ž™bUx@nnxWJţ¦ƒmƒ¼ñ@Ž°¦lUÞlÈ@ĠxÞUlxÒó„ƒl¯bmI™ŽÝVÛaÝnƒxVbkbÇwřÇKn±K™b„šƒb@V„xšLmŽÛŽŻbk„ƒVó@™šŹxó²›Wkb™@¯U¤ƒźĊ@lUX„°lÆôU„ƒlLX‚aœV°wšxUb°xÜôÈKVkÈmlwškÈKšwšK™™VUŤĉŎ»„»„Il¥na°LV»²¯Üy@wĢƒ°ĸwlwĢw°±„_lVkš@°ƒbƒÆ¯zƒ‚„š„@l_„@Ģ±lŚVlUaރ„LVƒnKlnȏ°IllČa˜wÞÑ°x„UU™@wƒVkmĠLô»„KÞýôaÞ¥ôĀÞmƁ„™‚mUƒŎV¥Èl°²°a²¥V„@@w„amm@Ñn@Æ£żƒVƒĠ£@W„¯Þƒšl@š»@Uk@"],"encodeOffsets":[[105087,37992]]}},{"type":"Feature","id":"6323","properties":{"name":"黄南藏族自治州","cp":[101.5686,35.1178],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@ôl²ôÜê„VƒVkš™KmnU¤VĀ¯°@„„LmĠVšnLÈL@alb@al@n°Vš_XmWUÈamaVIn@n‚aV£œóVWƒ™U£°ašxÈ¥@™‚aĊwȹ@óša™ƒğbm@k„w@mƒaÆw@ƒ„In¯mmƒ@UkkWƒÑÅ@@kċÅçVkÝJÅkVykŹl¥@¯š™ĢU܃X¥òý—mmX™ÝÅlmU@£™Wly™XW»Åbƒl@aI›»k@klm@UxUUƒVƒ¼¯Xƒl™aUnķ‚ƒI@x™@¯„ƒK™„ĉUU`óšlČ¯ô@¤ƒÞJ„k°xVŽ„n@ŽmbXŽ¯Ā›L`ƒ¦ĉbml¯X™ŽUŽl„ȂĊXzm‚ȁÔU‚ÜVšUnnŤwŦJɚ݄XÞW¯ô@ÈlU„b„mln"],"encodeOffsets":[[103984,36344]]}},{"type":"Feature","id":"6321","properties":{"name":"海东地区","cp":[102.3706,36.2988],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@@҄bš¤ÆI°ôU¼š°UŽnnWx™š@b¯L@lUUWbXxWl„ƨnxVUllš„XVŽUŽnL@lȀý²KVnƾ‚ĢwV»ƒ@mÞ£nÆƒÞÑmL™ƒKUaVżĕƒWVk²ƒƒÆÝ@ƒXw°@„ô™@a°wóUUmIk™™aVmÞwmknyƒ¹VÿƧnŏm£X»˜™naV±„Ýw@ašb@aƒm¯„ĉVó¦kÝWKUU@WanU™b@ôǺĉxb@šÇ¦™w¯bV¤„šUX›ôU¤bmm@UJnbÇbXVWn™`¯Umk@@bka@bÇK"],"encodeOffsets":[[104108,37030]]}},{"type":"Feature","id":"6301","properties":{"name":"西宁市","cp":[101.4038,36.8207],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@@kmKVUƒWk™VkUmwƒƧXkWwXaVV@k°K@aš™XwmmV™¯V»¯óÅJ™£ƒamŽ—X@šċVţÆķç™nUx™`kœ›`@šÅmĊx@Žƒ¦U¦„blVރŤèô¯„„Wbœx›¼œŽ@xċ¼k„™V™ô™bÇ@Å°@„™n„V°¦ĊJ„kĶa„lȍźU„a@aVwnJ°°J„anXlwš@ĢÓ"],"encodeOffsets":[[104356,38042]]}}],"UTF8Encoding":true}; }); -define('echarts/util/mapData/geoJson/shang_hai_geo',[],function() { - return {"type":"FeatureCollection","features":[{"type":"Feature","id":"310230","properties":{"name":"崇明县","cp":[121.5637,31.5383],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@uŏu»GPIV±ÐɃŜ{\\qJmC[W\\t„¾ÕjÕp‡nα|ěÔe`²„ †nZzZ~V|B^IpUbU†{bs\\a\\OvQ’Kªs†Mň£RAhQĤ‹lA`GĂA@ĥWĝO“"],"encodeOffsets":[[124908,32105]]}},{"type":"Feature","id":"310119","properties":{"name":"南汇区","cp":[121.8755,30.954],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@`y”ĉNǕDwǏ»ƒÖLxCdJ`HB@LBTD@CPFXANC@@PGBKNECCBB@EBFHEDDDSNKAUNBDMNqf[HcDCCcF…@EFGLEBa@ACoCCDDD@LGHD@DJFBBJED@BGAEGGFKIGDBDLBAD@FHBEF@RFDMLE@SGANFFJBANPH@@E@FJjRIACDMDOEKLFD@DbDAJI@AP@BGHFBCBGDCC@DCA@CECGH@FKCEHFJGBFDIHACEDNJDCVFBDCRKRLDLITB@CjNJI^DBCfNVDHDFKHAFGDIICDWBIF@@CFAjFJNJBBHD@CJ@AEFJ@@DH@BFBCPDBMFEQGDIFCNDHIP@HDABFACBJFHEBSZC@DP@@JDBƤ~"],"encodeOffsets":[[124854,31907]]}},{"type":"Feature","id":"310120","properties":{"name":"奉贤区","cp":[121.5747,30.8475],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@~T~JjZdDbLXDLCB_J@@FHFZJJIAGH@HGR@BENBLID@@LFCDF\\FpDBDb@FAHKFE†@dEDDdC\\GreNMACVMLBTMCCFCEGFAA@DAFDLMHA@OD@BMEWDOC@AS@KGAI_DcKw„ÕísƝ‘åĆctKbMBQ@EGEBEJ@@MBKL@BJB@FIBGKE@ABG@@FMFCPL@AjCD@ZOFCJIDICIlKJHNGJALH@@FPDCTJDGDBNCn"],"encodeOffsets":[[124274,31722]]}},{"type":"Feature","id":"310115","properties":{"name":"浦东新区","cp":[121.6928,31.2561],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@EN@JJLNHjLJNR^GRYVBNZJRBV@PDvbLNDN@LGNER@nCNQNuT_TIVFV\\Z\\XnDrI|[Ʉś²ÏJUHOƣ}CA@IO@@CYDATGFIEDAEBBAGCO@GJMCEDCJRHEFANOCADAEG@@CI@FE@BDIC@AGIAIMiEEB@DE@AJCXJDCJEHGBELGCUCeMAD]CIJiM@DSAKJKCLQDQACUECDMIFCBDJGECHAEIWCK@GLMCCGEACNKCEJG@MMBMC@@CIJUINT@JAJSTEPZZCP"],"encodeOffsets":[[124383,31915]]}},{"type":"Feature","id":"310116","properties":{"name":"金山区","cp":[121.2657,30.8112],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@L@BIHFN@@EE@@EFBDGDAADVDD@@EF@CA@IIsRE@GDAF@BF@CV@|FBCHBLCNHAFCADBMDCFZXHILBVEEQA@MWFARJJ@DCX@@TEFBLHAAERE@AJABRPBNK\\BrJ\\VHGND@CNADKDADQjGAGNC@GJ@FCFFHC@JF@@dLBDSFADHVG\\DTEPDDHJALIJkJDJCDIPE@YDCBiK@DONE@EH@BAF@HLJA@EIA@ALKNA@@FIFAFHR@NALadsæąyQY@ƒA±DʼnXUVI^BF@FFF@HBJEDFFGFEBSRkVEXGHFBMFIVW@GAEEFOIAIPKABGWEKFSCQLQBSEIBC\\FdBLRR@JGACFDDEF@AWB@LJJYNABBA@CUEGPaO_AIE@MYMFIGAEFECHSAAKAO\\[JEDB@E@MMA@@AGBKMGDFFCDDFEDFJF@NPBAFLHFH@EDDHBADDC@DDCDHHCDDFDABDAD@FEFOBCJ[D@HEDDNJBDDHABJIBBvGLBJAH"],"encodeOffsets":[[123901,31695]]}},{"type":"Feature","id":"310118","properties":{"name":"青浦区","cp":[121.1751,31.1909],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@RUNKdOFDJCbRFMLAHPLDN@JGL@@APBWYCKN@TU@SHGCEJIDIJKVIZVNM`iNY@CIE@CA@KBOEGEUFCCSADEIEFCDDDIDDHC@CKIeDCG@IG@DHWFEEGCH@@GO@@O]CNpeEQDBFME[JC]DGF@CKOA@QSB@GB@@GW@@ED@AQIJIAAFE@@DO@CFI@KNG@CDACAFEGKGBEGBDCCAIFCCLIECFI@MBCLDHGNAHSF@DMB@EEKBA@@C]DEICFG@ADBHGFKCDAKKHKD@@FHGAANGEEFCHKCECBCKG@ADKCNE\\[A[I@@mGBDQQEO@BCE@AI[AML@JGACLOAFKEMM@EQKC@CUCBCCBCHEA@FF@@FM@GEAJK@GNF@EXPH@FD@M^@HIADJCFDBER@DK@@DE@CAKFOCCBDHIBCNSB@GFC@GQEEOWFICGDUAEJIDBTAHJHEB@DIF@NE@H|HBDBEH@DKBAHEF@HEEUB@FGFGCCCE@AHOB@NH@PRLVNNFBX@RC€PbAvMtBfH@DJF@ELBFA@EH@HNED@FFB@HLC@CJ@@DJ@PIRf@HE@CFF@GPHD@DKE@FFBEFFD@DEFCA@DD@IjCRFBAHFDKD@HF@@PM@H@BlbDJDBFEF@DLXB@HCD@@IFCBIFEJD@FDC@FBALLF@PAACJERACAJCBD@EL@JD"],"encodeOffsets":[[124061,32028]]}},{"type":"Feature","id":"310117","properties":{"name":"松江区","cp":[121.1984,31.0268],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@@DLDFRN@FNELPBDKHB@INK\\BBJF@ADP@RFCRHA@nJ@B\\[\\MFLDBCH@DLDADFGLEDFFMHBBGH@EC@GLLLCBLDHEAGBCH@DEFJ^C@DB@LAFFA@CNE@GTMBGHKCAD@NEJFDKJDDJEDBCDHAAFLHFHBEBDDCH@LMJ@DEP@@CF@BEJBJIBRC@@FX@@HA@@HTA@RPBDLE@CHD^\\INFAERCfFMo^D@PP@@HG@HDFFXECGH@@JDHfCLJ@DGDCCCJCCEDJFCFTBDDVEHFPFLAB@NBFCFKFC@CHIACNOHWHCAAFIDD@CDAGEI@ACFMF@R@R_@GQED@EGFEQEDE_IAHKAEXCQUOQCUDEN@ZI\\DDmAMHCICDSOC@EG@BKHIGMIBCGOCSF[CUHCGEBCTKA@cE@@IGDEEEDI@@HMDBHiHCRCBCLMB@DMCGH[UqI[AMLOAAQIB@BQFBFGBAKFE@SW@CDI@QIEBNXB@FRUFKAGJYWDENCCADBBEMGKDGAAD{EU@@DAEE@CB@HQFJt@JDBE@@FC@"],"encodeOffsets":[[123933,31687]]}},{"type":"Feature","id":"310114","properties":{"name":"嘉定区","cp":[121.2437,31.3625],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@F@LI@IDKJADKIEJICADGACFECCJ@HKCAFOHAJI@aCBEE@ICAEB[GFGCKL@FGEIFADMLCAEJM@ELQECEIG@BE^QKKLQCA@EHBIGQ[GEHOMGGDHKH@JOECFCjCBEFDNCACMBCILGTABDLEEOEIG@GFIMM@CGKFBFCDE@@GEAGEEACIcGaHMFITIHDN[AKF@FS@OA@BK@IHM@KCGOKBENaQIDECcPMLQVFHFB@BFBKLGD@FAJOVGIACQ@A`LPCB@JEF@RU@ANS@@RCL\\HIFpRBFRBBDKLLDADJDGBFDABHBEDNF@DGBBBADKDAHC@\\JJFBDEH[DEFDH\\LX@XLBLbT@DNJLDCEL@VJABJNDHB@HBHYFBAA@GNFB@@AFB@AFABFLFBHFCL@HJBAFBLC@DN@HN"],"encodeOffsets":[[124213,32254]]}},{"type":"Feature","id":"310113","properties":{"name":"宝山区","cp":[121.4346,31.4051],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@ˆmÖoÖiƒ½[s[YEUJU`SCIEBCCWJY_LIICDWU@@FaBCJIB[ICH[@@CDKEE@MK@@IMCAEBCH@AMFI@SMGEFGB@FK@BHCAIFJNQD@FEBDFMBKGACG@ECWH@@CDDTOEEBGEK@GC@EE@GPHFR\\JHGA@FDBKRLL]RAFH@FJFDKR@FINBFKDCNEBFJEHK@DLEH\\HFADB@JFFDA@bIJGBEPDBGLI@DDEFBDCHDBIJJFCLIBCL@JKJE@ADHDBHJ@HIBBDFHBBAEIJ@BJFAVL¢ˆ"],"encodeOffsets":[[124300,32302]]}},{"type":"Feature","id":"310112","properties":{"name":"闵行区","cp":[121.4992,31.0838],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@T@@ELE\\BCMJGJSNEbGdHDJFBJAFIEIFCEWG@@gMENSFCVJFAxR~B@IH@AIiI@GE@FGEAFQPDRiV[\\DFSGMHAXHDOMCJCDETBBNVJJI@DD@ANNNH@FILDDMFBDHNDHKL@XDFGLD@EHGFD@DDB@CDDHCDAEAHG@ABOJ@BIaC@CECLKPFNCDCJBiQEIF@@@OGBMIAEEBMTHF@NKEC@QFEGA@EBCKAACHCLJHEFHHB@AFCAIEACIC@HG@KCCDC[ECEED@KC@KJMAAFQ@GHG@BHIJYIGE@EI@A`KDWCaKcCiY}I}S[CYJM@CFDVPRRVWDFžLBBG`JCFRFEFFHC@RF@HQ`Q@E@ENBDJ@HFCB@DCCEJBBGDGXMPBDGJ@DEDELEDMA@DJF@DMZ_jMNYUUJILCJIJDFGH@TSVM@DLXZ"],"encodeOffsets":[[124165,32010]]}},{"type":"Feature","id":"310110","properties":{"name":"杨浦区","cp":[121.528,31.2966],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@V@CXJDKJZ`XIDDFADJvSRMDM@mFQHM@KCMKMuaOCU@BDAJSX@HKJGD@PNJCJWAGT@R"],"encodeOffsets":[[124402,32064]]}},{"type":"Feature","id":"310107","properties":{"name":"普陀区","cp":[121.3879,31.2602],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@F@@FHDL@HFFAPFCSDC@@XGFDH@BDLHNACEFA@ERCIMJEDBAGL@@EHAFENHHJ\\ONQBQCIBC[MKACKI@GGGH@I_G@CW@[DMHCDIBMTDHN@JNHEH@FJFPKFACSBKHDJNABDMDECAFiDEDFDIPG@GLHCNH"],"encodeOffsets":[[124248,32045]]}},{"type":"Feature","id":"310104","properties":{"name":"徐汇区","cp":[121.4333,31.1607],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@RADL\\NCPHFfLJaJ@FWLGMGIK@IFMDOYYFOTSBI@IMSAMSACFIDNDCPWGGBHNET[CU\\QjOCERFBEHF@@HjJBJG@@J"],"encodeOffsets":[[124327,31941]]}},{"type":"Feature","id":"310105","properties":{"name":"长宁区","cp":[121.3852,31.2115],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@HFFB@HF@DCAELENSJADCNG\\CX@@D`H@JHGHHJ@BINBFUGEDO[MCKQB}AwQEBUIEDMTNF@hH@FXEDFJEJIB"],"encodeOffsets":[[124250,31987]]}},{"type":"Feature","id":"310108","properties":{"name":"闸北区","cp":[121.4511,31.2794],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@CSG@BQGODUPWTOBQAAFMECKBGEMFKEOHADDJARMR[PGI@TEJBNG@ADBFND@JL@@NFFCL@D\\@DG\\JJADI"],"encodeOffsets":[[124385,32068]]}},{"type":"Feature","id":"310109","properties":{"name":"虹口区","cp":[121.4882,31.2788],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@bA@E@QHSXBDIMI@OHCLI@GTWBIACQAYIOFGCENBBARSPOXCVHPARH@DT"],"encodeOffsets":[[124385,32068]]}},{"type":"Feature","id":"310101","properties":{"name":"黄浦区","cp":[121.4868,31.219],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@NEHFLAFDHDPEAMZUHQQ]IMKJG@EPERABHBGRUCCNGV"],"encodeOffsets":[[124379,31992]]}},{"type":"Feature","id":"310103","properties":{"name":"卢湾区","cp":[121.4758,31.2074],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@VDHQGABAFQFOH@LIiKKHEXI@IbAFZB"],"encodeOffsets":[[124385,31974]]}},{"type":"Feature","id":"310106","properties":{"name":"静安区","cp":[121.4484,31.2286],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@DLLB\\NPGLFHUDMYABEeKEVMAAJ"],"encodeOffsets":[[124343,31979]]}}],"UTF8Encoding":true}; +define('echarts/util/mapData/geoJson/shang_hai_geo',[],function() { + return {"type":"FeatureCollection","features":[{"type":"Feature","id":"310230","properties":{"name":"崇明县","cp":[121.5637,31.5383],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@uŏu»GPIV±ÐɃŜ{\\qJmC[W\\t„¾ÕjÕp‡nα|ěÔe`²„ †nZzZ~V|B^IpUbU†{bs\\a\\OvQ’Kªs†Mň£RAhQĤ‹lA`GĂA@ĥWĝO“"],"encodeOffsets":[[124908,32105]]}},{"type":"Feature","id":"310119","properties":{"name":"南汇区","cp":[121.8755,30.954],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@`y”ĉNǕDwǏ»ƒÖLxCdJ`HB@LBTD@CPFXANC@@PGBKNECCBB@EBFHEDDDSNKAUNBDMNqf[HcDCCcF…@EFGLEBa@ACoCCDDD@LGHD@DJFBBJED@BGAEGGFKIGDBDLBAD@FHBEF@RFDMLE@SGANFFJBANPH@@E@FJjRIACDMDOEKLFD@DbDAJI@AP@BGHFBCBGDCC@DCA@CECGH@FKCEHFJGBFDIHACEDNJDCVFBDCRKRLDLITB@CjNJI^DBCfNVDHDFKHAFGDIICDWBIF@@CFAjFJNJBBHD@CJ@AEFJ@@DH@BFBCPDBMFEQGDIFCNDHIP@HDABFACBJFHEBSZC@DP@@JDBƤ~"],"encodeOffsets":[[124854,31907]]}},{"type":"Feature","id":"310120","properties":{"name":"奉贤区","cp":[121.5747,30.8475],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@~T~JjZdDbLXDLCB_J@@FHFZJJIAGH@HGR@BENBLID@@LFCDF\\FpDBDb@FAHKFE†@dEDDdC\\GreNMACVMLBTMCCFCEGFAA@DAFDLMHA@OD@BMEWDOC@AS@KGAI_DcKw„ÕísƝ‘åĆctKbMBQ@EGEBEJ@@MBKL@BJB@FIBGKE@ABG@@FMFCPL@AjCD@ZOFCJIDICIlKJHNGJALH@@FPDCTJDGDBNCn"],"encodeOffsets":[[124274,31722]]}},{"type":"Feature","id":"310115","properties":{"name":"浦东新区","cp":[121.6928,31.2561],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@EN@JJLNHjLJNR^GRYVBNZJRBV@PDvbLNDN@LGNER@nCNQNuT_TIVFV\\Z\\XnDrI|[Ʉś²ÏJUHOƣ}CA@IO@@CYDATGFIEDAEBBAGCO@GJMCEDCJRHEFANOCADAEG@@CI@FE@BDIC@AGIAIMiEEB@DE@AJCXJDCJEHGBELGCUCeMAD]CIJiM@DSAKJKCLQDQACUECDMIFCBDJGECHAEIWCK@GLMCCGEACNKCEJG@MMBMC@@CIJUINT@JAJSTEPZZCP"],"encodeOffsets":[[124383,31915]]}},{"type":"Feature","id":"310116","properties":{"name":"金山区","cp":[121.2657,30.8112],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@L@BIHFN@@EE@@EFBDGDAADVDD@@EF@CA@IIsRE@GDAF@BF@CV@|FBCHBLCNHAFCADBMDCFZXHILBVEEQA@MWFARJJ@DCX@@TEFBLHAAERE@AJABRPBNK\\BrJ\\VHGND@CNADKDADQjGAGNC@GJ@FCFFHC@JF@@dLBDSFADHVG\\DTEPDDHJALIJkJDJCDIPE@YDCBiK@DONE@EH@BAF@HLJA@EIA@ALKNA@@FIFAFHR@NALadsæąyQY@ƒA±DʼnXUVI^BF@FFF@HBJEDFFGFEBSRkVEXGHFBMFIVW@GAEEFOIAIPKABGWEKFSCQLQBSEIBC\\FdBLRR@JGACFDDEF@AWB@LJJYNABBA@CUEGPaO_AIE@MYMFIGAEFECHSAAKAO\\[JEDB@E@MMA@@AGBKMGDFFCDDFEDFJF@NPBAFLHFH@EDDHBADDC@DDCDHHCDDFDABDAD@FEFOBCJ[D@HEDDNJBDDHABJIBBvGLBJAH"],"encodeOffsets":[[123901,31695]]}},{"type":"Feature","id":"310118","properties":{"name":"青浦区","cp":[121.1751,31.1909],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@RUNKdOFDJCbRFMLAHPLDN@JGL@@APBWYCKN@TU@SHGCEJIDIJKVIZVNM`iNY@CIE@CA@KBOEGEUFCCSADEIEFCDDDIDDHC@CKIeDCG@IG@DHWFEEGCH@@GO@@O]CNpeEQDBFME[JC]DGF@CKOA@QSB@GB@@GW@@ED@AQIJIAAFE@@DO@CFI@KNG@CDACAFEGKGBEGBDCCAIFCCLIECFI@MBCLDHGNAHSF@DMB@EEKBA@@C]DEICFG@ADBHGFKCDAKKHKD@@FHGAANGEEFCHKCECBCKG@ADKCNE\\[A[I@@mGBDQQEO@BCE@AI[AML@JGACLOAFKEMM@EQKC@CUCBCCBCHEA@FF@@FM@GEAJK@GNF@EXPH@FD@M^@HIADJCFDBER@DK@@DE@CAKFOCCBDHIBCNSB@GFC@GQEEOWFICGDUAEJIDBTAHJHEB@DIF@NE@H|HBDBEH@DKBAHEF@HEEUB@FGFGCCCE@AHOB@NH@PRLVNNFBX@RC€PbAvMtBfH@DJF@ELBFA@EH@HNED@FFB@HLC@CJ@@DJ@PIRf@HE@CFF@GPHD@DKE@FFBEFFD@DEFCA@DD@IjCRFBAHFDKD@HF@@PM@H@BlbDJDBFEF@DLXB@HCD@@IFCBIFEJD@FDC@FBALLF@PAACJERACAJCBD@EL@JD"],"encodeOffsets":[[124061,32028]]}},{"type":"Feature","id":"310117","properties":{"name":"松江区","cp":[121.1984,31.0268],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@@DLDFRN@FNELPBDKHB@INK\\BBJF@ADP@RFCRHA@nJ@B\\[\\MFLDBCH@DLDADFGLEDFFMHBBGH@EC@GLLLCBLDHEAGBCH@DEFJ^C@DB@LAFFA@CNE@GTMBGHKCAD@NEJFDKJDDJEDBCDHAAFLHFHBEBDDCH@LMJ@DEP@@CF@BEJBJIBRC@@FX@@HA@@HTA@RPBDLE@CHD^\\INFAERCfFMo^D@PP@@HG@HDFFXECGH@@JDHfCLJ@DGDCCCJCCEDJFCFTBDDVEHFPFLAB@NBFCFKFC@CHIACNOHWHCAAFIDD@CDAGEI@ACFMF@R@R_@GQED@EGFEQEDE_IAHKAEXCQUOQCUDEN@ZI\\DDmAMHCICDSOC@EG@BKHIGMIBCGOCSF[CUHCGEBCTKA@cE@@IGDEEEDI@@HMDBHiHCRCBCLMB@DMCGH[UqI[AMLOAAQIB@BQFBFGBAKFE@SW@CDI@QIEBNXB@FRUFKAGJYWDENCCADBBEMGKDGAAD{EU@@DAEE@CB@HQFJt@JDBE@@FC@"],"encodeOffsets":[[123933,31687]]}},{"type":"Feature","id":"310114","properties":{"name":"嘉定区","cp":[121.2437,31.3625],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@F@LI@IDKJADKIEJICADGACFECCJ@HKCAFOHAJI@aCBEE@ICAEB[GFGCKL@FGEIFADMLCAEJM@ELQECEIG@BE^QKKLQCA@EHBIGQ[GEHOMGGDHKH@JOECFCjCBEFDNCACMBCILGTABDLEEOEIG@GFIMM@CGKFBFCDE@@GEAGEEACIcGaHMFITIHDN[AKF@FS@OA@BK@IHM@KCGOKBENaQIDECcPMLQVFHFB@BFBKLGD@FAJOVGIACQ@A`LPCB@JEF@RU@ANS@@RCL\\HIFpRBFRBBDKLLDADJDGBFDABHBEDNF@DGBBBADKDAHC@\\JJFBDEH[DEFDH\\LX@XLBLbT@DNJLDCEL@VJABJNDHB@HBHYFBAA@GNFB@@AFB@AFABFLFBHFCL@HJBAFBLC@DN@HN"],"encodeOffsets":[[124213,32254]]}},{"type":"Feature","id":"310113","properties":{"name":"宝山区","cp":[121.4346,31.4051],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@ˆmÖoÖiƒ½[s[YEUJU`SCIEBCCWJY_LIICDWU@@FaBCJIB[ICH[@@CDKEE@MK@@IMCAEBCH@AMFI@SMGEFGB@FK@BHCAIFJNQD@FEBDFMBKGACG@ECWH@@CDDTOEEBGEK@GC@EE@GPHFR\\JHGA@FDBKRLL]RAFH@FJFDKR@FINBFKDCNEBFJEHK@DLEH\\HFADB@JFFDA@bIJGBEPDBGLI@DDEFBDCHDBIJJFCLIBCL@JKJE@ADHDBHJ@HIBBDFHBBAEIJ@BJFAVL¢ˆ"],"encodeOffsets":[[124300,32302]]}},{"type":"Feature","id":"310112","properties":{"name":"闵行区","cp":[121.4992,31.0838],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@T@@ELE\\BCMJGJSNEbGdHDJFBJAFIEIFCEWG@@gMENSFCVJFAxR~B@IH@AIiI@GE@FGEAFQPDRiV[\\DFSGMHAXHDOMCJCDETBBNVJJI@DD@ANNNH@FILDDMFBDHNDHKL@XDFGLD@EHGFD@DDB@CDDHCDAEAHG@ABOJ@BIaC@CECLKPFNCDCJBiQEIF@@@OGBMIAEEBMTHF@NKEC@QFEGA@EBCKAACHCLJHEFHHB@AFCAIEACIC@HG@KCCDC[ECEED@KC@KJMAAFQ@GHG@BHIJYIGE@EI@A`KDWCaKcCiY}I}S[CYJM@CFDVPRRVWDFžLBBG`JCFRFEFFHC@RF@HQ`Q@E@ENBDJ@HFCB@DCCEJBBGDGXMPBDGJ@DEDELEDMA@DJF@DMZ_jMNYUUJILCJIJDFGH@TSVM@DLXZ"],"encodeOffsets":[[124165,32010]]}},{"type":"Feature","id":"310110","properties":{"name":"杨浦区","cp":[121.528,31.2966],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@V@CXJDKJZ`XIDDFADJvSRMDM@mFQHM@KCMKMuaOCU@BDAJSX@HKJGD@PNJCJWAGT@R"],"encodeOffsets":[[124402,32064]]}},{"type":"Feature","id":"310107","properties":{"name":"普陀区","cp":[121.3879,31.2602],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@F@@FHDL@HFFAPFCSDC@@XGFDH@BDLHNACEFA@ERCIMJEDBAGL@@EHAFENHHJ\\ONQBQCIBC[MKACKI@GGGH@I_G@CW@[DMHCDIBMTDHN@JNHEH@FJFPKFACSBKHDJNABDMDECAFiDEDFDIPG@GLHCNH"],"encodeOffsets":[[124248,32045]]}},{"type":"Feature","id":"310104","properties":{"name":"徐汇区","cp":[121.4333,31.1607],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@RADL\\NCPHFfLJaJ@FWLGMGIK@IFMDOYYFOTSBI@IMSAMSACFIDNDCPWGGBHNET[CU\\QjOCERFBEHF@@HjJBJG@@J"],"encodeOffsets":[[124327,31941]]}},{"type":"Feature","id":"310105","properties":{"name":"长宁区","cp":[121.3852,31.2115],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@HFFB@HF@DCAELENSJADCNG\\CX@@D`H@JHGHHJ@BINBFUGEDO[MCKQB}AwQEBUIEDMTNF@hH@FXEDFJEJIB"],"encodeOffsets":[[124250,31987]]}},{"type":"Feature","id":"310108","properties":{"name":"闸北区","cp":[121.4511,31.2794],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@CSG@BQGODUPWTOBQAAFMECKBGEMFKEOHADDJARMR[PGI@TEJBNG@ADBFND@JL@@NFFCL@D\\@DG\\JJADI"],"encodeOffsets":[[124385,32068]]}},{"type":"Feature","id":"310109","properties":{"name":"虹口区","cp":[121.4882,31.2788],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@bA@E@QHSXBDIMI@OHCLI@GTWBIACQAYIOFGCENBBARSPOXCVHPARH@DT"],"encodeOffsets":[[124385,32068]]}},{"type":"Feature","id":"310101","properties":{"name":"黄浦区","cp":[121.4868,31.219],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@NEHFLAFDHDPEAMZUHQQ]IMKJG@EPERABHBGRUCCNGV"],"encodeOffsets":[[124379,31992]]}},{"type":"Feature","id":"310103","properties":{"name":"卢湾区","cp":[121.4758,31.2074],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@VDHQGABAFQFOH@LIiKKHEXI@IbAFZB"],"encodeOffsets":[[124385,31974]]}},{"type":"Feature","id":"310106","properties":{"name":"静安区","cp":[121.4484,31.2286],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@DLLB\\NPGLFHUDMYABEeKEVMAAJ"],"encodeOffsets":[[124343,31979]]}}],"UTF8Encoding":true}; }); -define('echarts/util/mapData/geoJson/shan_dong_geo',[],function() { - return {"type":"FeatureCollection","features":[{"type":"Feature","id":"3706","properties":{"name":"烟台市","cp":[120.7397,37.5128],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@ŤLšLllVń²è°xżĢĠÆl҄šŤbœ„V¤ĊXnŽlĢVĊ„Òš„È°ĊŰÞè˜L„±@џn»VUźċ²»ÆkôVɆkĊŃ²kŤVVwUUVmUaƒ@KkU@ƒmUmmk@UwUkmW@UVIXa@ƒmw@a™KULƒaƒx@Uk@UbWU@yULmK¯@kXƒVUwm@@JUUknWKUVƒLUbU@™wWykIƒa@w@mUI@ašUVynIWa„k„@@W„bl@@knmƒK@wnIl™°Kna@V¥ğ@ġUķ»™¥@UōJƒX¯¤k@™wmI¯‚k@mwƒak@@šlX@bUJ@VƒbknWxkLkxlŽšLVlkLmŽšb@bU@ƒbU@VbU`Vb@n„L@Žmb—U@˜VnUVmnU@mm™@kIUWVIUK›VkkUJUnmL@VmLUaVWaXamU@™™U@KUUmVƒU—JƒU™VÇwğn™mƒ@mXĉV@l¯xnô"],"encodeOffsets":[[122446,38042]]}},{"type":"Feature","id":"3713","properties":{"name":"临沂市","cp":[118.3118,35.2936],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@˜bXlƒl@zlV@lXXmŽkbVVlš„U@Vn@@Vmb@XšKšVX„WJ@XXl@„‚ŽÈbVLšUl`„@XXV@VVUxVbUxVbš¦„@‚WnXVJ@bnVUzl@„°Æx„U„KlU@mUUnUlUVWVUnVV@XX°V@Všll@Vk„aXVl@Ux@bmbXLlKlb@b@bUJn@@„„b@n°x°K@an@@UlLVKVbXb@bVVnK°LVa@UVa@™Xw‚KVxnLšU°@naV@UWUkWƒULmV—wÝKUUla@aó_@mƒK@aUU@ƒWUkwVm@aVI°W„@@IUw@a±¯@¥kUVUm@a‚wkw™@ƒK@kVKk@maXalI@alL„WXblaVLVU„V@LnKš@„l@w˜aXašLlnUl„LšmV@n°J@_VmnIVym£UKmI@WnIVm@anUVmÇ_kġIÅWUXÇm@U@ݯÅ@ƒ™@naWƒ™IVW@IkK@klKn@naWIƒmk@ƒaƒbkKkLWn™WkLWmk_ƒ@UaVƒUKmLUw@mn£WwUmU™ƒaóV@UkUm@UKULUwmJUX@WW@XҙzVblJXŽWXk@UVWK—X‚¤UL@xU@ƒ@ƒVUaU@@XmVkLmWkXUyÝLmKXnVŽ@n@l™x@bWLnVVn™`knULmxUl„„WLXŽVb@VƒK@z¯x¯¼Wx™KUn@bk@ƒlƒVVVz"],"encodeOffsets":[[120241,36119]]}},{"type":"Feature","id":"3707","properties":{"name":"潍坊市","cp":[119.0918,36.524],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@l@@UšK@Ž@L@bX@@VlL@JƒLUVnX@`ÜXn`V²mJ@bU@@n„b@l°xnnĸVƚ°@„ƒĊ£Þ@lWnÑnkʶJmó°w@kk»V@»ƒ¥k@V@kw@wVm„a˜Å„mšaô£ŎƒXI@mln„Kla@mV_UKƒ@kUkw@alW™IU»™mƒ—@WUIl±UUÅU›bkJƒ@a@wUKUaVIÆmXIWaka@m@Ul£XKVw@ƒUIƒJUkmJ™ƒVkU@a„ƒWK—ImVƒ@UxmL@bX`WXU@U`ÇkUak@@°UblXk‚mLUKmL@VULóƒƒVk@@Vlbn@Ub@ċaUJUbƒIUlVLUVVbVKX„VlVXU@mb¯@™VmKUwLWx@šUb@VUb¯KmLUU@aWaUaULkK@Vm@@b¯L¯w@mƒa@ƒm@UUU@U¦lJUXƒVƒmkb@nm„XVWŽkb™IVxUV@VUbWLXVƒLW`Ux@nk@Vn@x@VkJ@œV`mXkŽ@V„xV@lVššI@VULš˜VU„IV`°bVXXx„V@VWVnL@xV„Ub"],"encodeOffsets":[[121332,37840]]}},{"type":"Feature","id":"3702","properties":{"name":"青岛市","cp":[120.4651,36.3373],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@„@nU˜JXLƒ„@blVU‚š„nIVl„IVJ@„UxWLk¤@V@nlbXbWJÅnUJVbVL@x@b„ŽlIœaÆVVVk²VJ@X„˜šnV¼šJkX@blxlV„@VLU`@nkbƒLkm@nWJō„ó¤™bƒn—ƃbUn@xlxU@l@„¦@¼UŽl¼ĊUnW„@šnĠmÈxšU„V˜I„VnUVV@LšV@šnVWbXb‚UVbnK@UnKVmVIllœUVLUJVXlJš@nnV@nmVUUm@—˜Vna@ƒK@mUaV_UaV@„aV@@a™anlKUk™KklwlKXwlm„a@UVI@akW@™l@„bnxl@°nJšxl@°£„WŎIUÑn»lašmô¹Ŏ¥VaUUkƒmkġWɱIUUŹ`›@kk@ĉƨřV¥_Ç@™Ĭƒ¤ÝL¯m¯£ƽóķwUW±ī¯kōaĉĕ™kğmó°ƒbW@UKkLUaƒVmz@V@ŽUxVn"],"encodeOffsets":[[122389,36580]]}},{"type":"Feature","id":"3717","properties":{"name":"菏泽市","cp":[115.6201,35.2057],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@@¥šIVUÈmÞ»@UlU@Un@VW@UVmkk@aVUUKVÝ@UVknK@UV@VVnIVƒ@wnƒmwmKXaWaXI@UV@Vy²blkVKkam™U@kb@Um@VmUkmƒKmkXKWwkU@Ulƒ@UnK@UVUUm‚KXwšUVL„w‚K„U„@@Wl@@wUkV¥—@@I@W@_V@VWUw@UUa@aƒaWa—@@_mKUw™l¯amzmV—@WK™nU@kƒWLķaUKbÝVmV@UWÇbÛ@ƒX™°UbW@XŽm„Vlk²UJUbmLÇxÅWUzl‚¯Ll„@VkK™XUbWJ@bU@¯@™ƒkbƒLmKka™„@l™_WšXºVbUz@J‚n²V@¤lX„Ž„nV°šLn`WbXLôVlKVUšxXn˜lXLlU@bVV@„XJWLUVnVV@„„@n‚l„°nn‚V„KÈbVXÆJU°VnXV„kV@@xVL„@šWlb"],"encodeOffsets":[[118654,36726]]}},{"type":"Feature","id":"3708","properties":{"name":"济宁市","cp":[116.8286,35.3375],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@nam_nKlVLXa„Il`š_@KVVXI@m@w‚ƒ„@@k@Kšnô@n`VbV@@L„L@KVVn@VX@‚VL„Jl„š@VUUƒU@Uam@Uk„wšKWaXamkJmIUVUÈblašUnV@kVKl@@lXL°kVJ@VÈnVJUX@V‚LXl@xVLnU‚@VK„V@a„IUaV@„bĊU„x„K‚kVJXUlV„ƒ„UVašI@WUI@KlUnw„mWk@WXIWƒ™U™L@Wna@Um@@UƒVk™UUlanWW@kkU@y„kWk—aWVUlÝbUU@kƒJUIU@@ƒ™JmaókƒLKǃUUkKWLk@WbkUUaƒbmKn¯°¥V@XwV@VanaVaU_@Wlk@WÈ@VUÈVVۂm„aklKȯlLVUX@lK@aX@@kV@VmV@VwnJV_UWUwƒX™am@kW@wVUkKVIUUVmU@UV@IVK@aUL@aƒV@Lm„UKmx@ŽômLkUWJ@šnXmlUxUL@Vkn›VUšU„@V™L™`Ub±LkV@kUKÇbÛ@ƒU™Wó_mJƒ@Wk@@Xƒ@ƒVLƒxUK™VWxLVnUV@VmL@Vk„@VlVXxWLnl‚Ln„VlUnn@@VlaV@nšlbULkl±aUzU@@VWJXbWbnLnxm„@xU„mJUUU@@VmLUl@VUÞVLUV@bllUn@VUXm@@VkV@VݼÇnUV™J@¦nnƒlnVlL@„Þb°KVV"],"encodeOffsets":[[118834,36844]]}},{"type":"Feature","id":"3714","properties":{"name":"德州市","cp":[116.6858,37.2107],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@„¤@VmbVXnVVbVJššX@Žll@z„lVInl@„@bVxUbĠ‚l@Èbla„IšxXVWb@L™@n‚ULWVXXšWWLnL@`@LUVVL@lVn„JšU@UUk‚a„™nš‚Vôô„b°¼V‚ސXš˜‚œIÜbČa˜bôW„XÞWÈzÆmnLVJ°ÈnlV²lbnW@™@UƒUV™šmnwmkkKWƒkla@mVIUKUa™aUwmn™JU@@amIk@@bVlkX@mmUklUUƒƒa@_UaUUƒV@wƒw™WkXmW@I@WUaÝU@UXaWUU@UUVW@UUUWUn¥nUVa@m@k@alU@wk™LWa@UUm@@wnmU™wla@anKn_@alK@ݙ_ƒ@@WUUUmlkaƒIƒyU@UwU_Wa¯yU_mWUwkImm@InWWUk@@UVWV—kW¯U@VƒL@b¯b@l±¦@šVV@lUbV„@škxVnUšl¼XV@b@lV@nIWxnbƒ‚™@UU™LƒxÅxm¯ƒaUƒ™wU@mUÅVÝKULm@bmKUXó@"],"encodeOffsets":[[118542,37801]]}},{"type":"Feature","id":"3716","properties":{"name":"滨州市","cp":[117.8174,37.4963],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@Vb@`„bV„kVlnV@nlWUk@al@nJ@bV@šInmVxšbVbVLUJ@nkb‚lX„lLnlmx™nUš„V@V@šmXn˜lbĸ@nnVx‚b@lnXV@UJ@nVxšxnxVbÆVn¯ƒĕ‚@@wÈçUÇlķVIœb‚@„Çmk@¥k@UkUK@aWakUóJW_UW@wkkWK@U@Kš@XUƒƒUkmUUalKXala@U@kkWlkÈl@kšV„mVIVmU_‚a„ƒƒwnwVW@wƒwUƒ@wU£ƒwkJWIyUI±bk‚VUJ@nmV™Ukl„Xmx@lnbW„kVƒUkLWŽƒxkKUUmUkb™J±—LÇxUKmkUmkkW™™a„mUaVkšJÆ_²KĠ@U„W@w„U‚¥nUWwK@aÝUkÅVaVK@akLWƒƒƒ¯I@bnbVx¯JW„ñšWbUL@šƒŽnV@VmbkUUV@IÇak@@bWak@WJUœJWL@bXV@„‚@„V„Jlb@zUlUŽUImšnbV‚mz@°UV@V™bV@@V@L@xLmKUnmJVX„J@VkLW@UVUL@b"],"encodeOffsets":[[120083,38442]]}},{"type":"Feature","id":"3715","properties":{"name":"聊城市","cp":[115.9167,36.4032],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@ô@VWnL‚an@VKÞLÆUnVV@šxV„„bn°Æw„wšKVVš@„maXwmJU@@k@aWUk»V™Umlw@™UƒVa@kUU@™²¥@k°a@a„K@U›ƒU@mmm@ów—ѱ¥¯@@w™Kmw—I›¥kU¯UmakJmIUaƒVkKUkm@VUUa™Uƒ@UaƒKUK¯@™w™UVŽUIUKVw™k™¥™wƒbVŽ@xn„@lWnXxlL@`„XlJX¦l°XxW¦@¦Ul™n@Ž™@@Um@@VXVmx@¯bllUnUJ@VULVn@b„xV‚VL@b„„VlnVVblV„ÈnVlIVJœLô„lJ@xl²„"],"encodeOffsets":[[118542,37801]]}},{"type":"Feature","id":"3705","properties":{"name":"东营市","cp":[118.7073,37.5513],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@ͬUǪlô@°Uœw°ōĠ¯š»Ģ炻XÇ@w™wƑa™ÇƒkwVƑ¯@řķUmm¯w@kƒa@mV@@anIU±m_ÛW@_mWVU„K@IkK@UW@@a@K@™L@Vk@±U@UV@lm@mUU@kLm„„xV¤@xV„„x@xUXmx„xƒ„bV`UnUJƒn™U@lÇkkllX@l@VkbWbkLVbnVVl„„WV™@@L@VXLll@xVXX`ôIlVXb@bVLVll@@¦nlƒÈ@›aUJkĸVÈÇè@x"],"encodeOffsets":[[121005,39066]]}},{"type":"Feature","id":"3701","properties":{"name":"济南市","cp":[117.1582,36.8701],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@²¦˜Òôxn@nn‚@V‚œ„°VlXU˜UX@Vl@XVmX@JnnlJVxnXV`°zXbV`VxV@„z„JlbkŽVnVV@X„@š`@ÞkL@bm`mL@bkbšxnVm@xn@VV‚@XbšKl@xkV@b@l@nUbmVm¦XVVV@VUXVVV@XVWb@VÞVVb@X@JnXlWšX„x@x„UVV@aVKVUX@lK@UƒIUWnIVmnL‚K@w@K@UU@ša@UVU@¯nyUman™VJVVk@ykaƒIƒU@@ƒWU@aXK‚IV›XIl@Xb@al@Èb@JVUlVna@UmU„@™VKXaò™Xƒ°IUwma@aU@UU@wVW@фw@a™I±`kbƒUkw™UmJ@UkmÇUUkmKknUVƒ@mJUkaWkƒa@KmKkUƒLmyXa¯_@WmImmbƒLmUkVUbUVƒJ™bƒUkkWJkUƒl™IUm™k™Lƒ›„lK@knaVmkI@mWaƒLUK™UU@@VmLUVLWK@UUUƒWUkkVmx@„Vl™¦"],"encodeOffsets":[[119014,37041]]}},{"type":"Feature","id":"3709","properties":{"name":"泰安市","cp":[117.0264,36.0516],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@n¼šŽW„nxšL@x°@š¥Uk@ƒnwlUVl„XVV@VXL‚KVUnK@UV@šVVL„KXb@nlJUnmb@lkLƒ‚„œšKšlVnšJ„klVXIll„Vša„IVUValUnV„K‚annnJ@X°`Wbnz„KlVnL‚Ž@L„bXl‚bVlnI„@VUU@UmVƒ@U@Uš¥@VmV@@_Ua@m°@@ƒ„kmUUm@UVmn@nX‚@@a„anJVUVL„mlIVJn@nkVLVa@KVmVLXVVLš@@U°bn@VaV@@K@aVkœbWaXUVymU@aUImWXƒ@™¥UaVwUaVwUUU@WWƒ@k_™VUKÇa@ƒƒnmxkV@LVJ@X™JUbƒVƒ„kUWVUIlƒLƒwĉVƒaU@VbƒJ@bƒUUL@mVUK@wWkK@UVWUIÇm@UUI¯lWK@kk@UL@lmU™VkbÇaUVVnJlIn‚WbXb™LƒxVln@VbV@V„UV™@kƒƒIUK@UWm@UU@LƒK@KU@Uam_ó@™m@L@lƒ@„@x@nWJUU@L™`k_ƒJWbUKkmLn`mb"],"encodeOffsets":[[118834,36844]]}},{"type":"Feature","id":"3710","properties":{"name":"威海市","cp":[121.9482,37.1393],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@VbUnVVUxĊ¼š¼ô@Þф¯‚WǬLŎUÆW„¹Uǃō¯ÑƒÝkţ™™ţóġ™óL™ł̥U™wm¥kÝmkkKóbÝ@U¦@‚mb¯LkšmJ@x„Lmn@lk@ƒa@Xƒ@ƒlXbmJUz™V@bVJ@n@x„blJXzšxV@Va„KVUXLlmVV@In@Vx„UlW°@nLVK@zXVVal@@V„w„bVKšL@bnx@„WbUJ@VnXVlVxl@nnnV@„lV@L„‚"],"encodeOffsets":[[124842,38312]]}},{"type":"Feature","id":"3711","properties":{"name":"日照市","cp":[119.2786,35.5023],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@UaVUUKVk„JVaVIČb@Vam@ka@Ul@„Uô„VK@UnKVLnKlkWVa@¯l@VbÈlV_V@XWW_@anKVwUmVw@@Uny„UVblKVLX@„aô¯ó¥mÛĊÿÈ¥š™Þ¹lUīƒ¯Kĉ¼ʟbÇV™U™ŽUŽ™XmakJUnmV@bUnmJ@XnJVLn¤UzmJUn@`¯ImŽU@™nƒKVkkm™KWb—b@xƒk™@mL@KƒUUVUKkbWaƒXkK@bkJWbnbl@UL@l„Lš@lxx@b‚nUVlV@¦²°@bVx@Jƒ@¯XUJ@bUnlxVŽ„X@‚VV@b„L@nô`@bkbVVÞL˜xnU"],"encodeOffsets":[[121883,36895]]}},{"type":"Feature","id":"3703","properties":{"name":"淄博市","cp":[118.0371,36.6064],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@nƒlKV@nVn@@kVU‚@²VVaUƒ@wmKXU@UƒUWwUW¯aU_ƒJUV™—VK@U™JU™@kUƒw@UlnWU_@›lI@U@wUml@@mVwX_„KWUXKVa@UVUUwšJlaXWUnƒ@mla„n„UVWkIV¥V@VVVI@a@akakLWKna@aVwk@WUƒbUlk@™k@U¯UWWU@mUUVUXkVmVVV@nkVƒLƒVÅwƒ¯k@WVXb›aUl@bV@@b@xkVVXVxkJ@nk@@ŽVLUlVb‚VXUVVUzV‚™LVbUbV„VWVkLmškJ@n±@UxU„VVkV@bƒx@ÒUX@xVVV@°J„„X„lK@bULUblÆÞV@b‚LXxmV¦ƒV@xƒXVŽğ@±LÅ`™IUlVbƒnšbXšllVnnlVLÈw˜K²ŽšIlanVVVlL„wXlK„VlUXƒma@knwƒWlkšVnU@mVIUl²aVJ‚zXJlI"],"encodeOffsets":[[121129,37891]]}},{"type":"Feature","id":"3704","properties":{"name":"枣庄市","cp":[117.323,34.8926],"childNum":2},"geometry":{"type":"Polygon","coordinates":["@@‚yUU„U„kl@@aVmšLXw°»°w@y„L@UUaWXKƒƒVknwVKlmš_UmmUXK@ašw@k@mUWmUL@ƒ@™@£@KƒbÝV@akw™aULmƒƒbUK™LUU@lm@—°mL@nUJVxVXU`mIUxU@UnU@@lW@@bkLW@UVkKÇ°kLlŽƒbnUÜÇUUVÇ@@Xkl@XV`UbmbUbU@WxU@¯¦m°nL„aVblVXal@XKlLVVȄ‚L„KôlnbšI@„V@VJ„I@lVVÞaVkXU"],"encodeOffsets":[[120241,36119]]}},{"type":"Feature","id":"3712","properties":{"name":"莱芜市","cp":[117.6526,36.2714],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@lmnLVlÈVln@VnIšVlx„Vla²_šJlUUUVƒVw²@@mlIn™lKXU‚UUƒVaUašKUVyUUWVUUaVkUK@l@@mlIUwUWlU@w@aU@@LU@Ubm@¯a@V™@UKWUUKUn@LUbUKmlm@UIkJƒnUKUVmIƒb@b@mWm@Un@VVnnVƒl@„¯@@nVb@`U@Un@Ž™¦@V@VU„VnV@"],"encodeOffsets":[[120173,37334]]}}],"UTF8Encoding":true}; +define('echarts/util/mapData/geoJson/shan_dong_geo',[],function() { + return {"type":"FeatureCollection","features":[{"type":"Feature","id":"3706","properties":{"name":"烟台市","cp":[120.7397,37.5128],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@ŤLšLllVń²è°xżĢĠÆl҄šŤbœ„V¤ĊXnŽlĢVĊ„Òš„È°ĊŰÞè˜L„±@џn»VUźċ²»ÆkôVɆkĊŃ²kŤVVwUUVmUaƒ@KkU@ƒmUmmk@UwUkmW@UVIXa@ƒmw@a™KULƒaƒx@Uk@UbWU@yULmK¯@kXƒVUwm@@JUUknWKUVƒLUbU@™wWykIƒa@w@mUI@ašUVynIWa„k„@@W„bl@@knmƒK@wnIl™°Kna@V¥ğ@ġUķ»™¥@UōJƒX¯¤k@™wmI¯‚k@mwƒak@@šlX@bUJ@VƒbknWxkLkxlŽšLVlkLmŽšb@bU@ƒbU@VbU`Vb@n„L@Žmb—U@˜VnUVmnU@mm™@kIUWVIUK›VkkUJUnmL@VmLUaVWaXamU@™™U@KUUmVƒU—JƒU™VÇwğn™mƒ@mXĉV@l¯xnô"],"encodeOffsets":[[122446,38042]]}},{"type":"Feature","id":"3713","properties":{"name":"临沂市","cp":[118.3118,35.2936],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@˜bXlƒl@zlV@lXXmŽkbVVlš„U@Vn@@Vmb@XšKšVX„WJ@XXl@„‚ŽÈbVLšUl`„@XXV@VVUxVbUxVbš¦„@‚WnXVJ@bnVUzl@„°Æx„U„KlU@mUUnUlUVWVUnVV@XX°V@Všll@Vk„aXVl@Ux@bmbXLlKlb@b@bUJn@@„„b@n°x°K@an@@UlLVKVbXb@bVVnK°LVa@UVa@™Xw‚KVxnLšU°@naV@UWUkWƒULmV—wÝKUUla@aó_@mƒK@aUU@ƒWUkwVm@aVI°W„@@IUw@a±¯@¥kUVUm@a‚wkw™@ƒK@kVKk@maXalI@alL„WXblaVLVU„V@LnKš@„l@w˜aXašLlnUl„LšmV@n°J@_VmnIVym£UKmI@WnIVm@anUVmÇ_kġIÅWUXÇm@U@ݯÅ@ƒ™@naWƒ™IVW@IkK@klKn@naWIƒmk@ƒaƒbkKkLWn™WkLWmk_ƒ@UaVƒUKmLUw@mn£WwUmU™ƒaóV@UkUm@UKULUwmJUX@WW@XҙzVblJXŽWXk@UVWK—X‚¤UL@xU@ƒ@ƒVUaU@@XmVkLmWkXUyÝLmKXnVŽ@n@l™x@bWLnVVn™`knULmxUl„„WLXŽVb@VƒK@z¯x¯¼Wx™KUn@bk@ƒlƒVVVz"],"encodeOffsets":[[120241,36119]]}},{"type":"Feature","id":"3707","properties":{"name":"潍坊市","cp":[119.0918,36.524],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@l@@UšK@Ž@L@bX@@VlL@JƒLUVnX@`ÜXn`V²mJ@bU@@n„b@l°xnnĸVƚ°@„ƒĊ£Þ@lWnÑnkʶJmó°w@kk»V@»ƒ¥k@V@kw@wVm„a˜Å„mšaô£ŎƒXI@mln„Kla@mV_UKƒ@kUkw@alW™IU»™mƒ—@WUIl±UUÅU›bkJƒ@a@wUKUaVIÆmXIWaka@m@Ul£XKVw@ƒUIƒJUkmJ™ƒVkU@a„ƒWK—ImVƒ@UxmL@bX`WXU@U`ÇkUak@@°UblXk‚mLUKmL@VULóƒƒVk@@Vlbn@Ub@ċaUJUbƒIUlVLUVVbVKX„VlVXU@mb¯@™VmKUwLWx@šUb@VUb¯KmLUU@aWaUaULkK@Vm@@b¯L¯w@mƒa@ƒm@UUU@U¦lJUXƒVƒmkb@nm„XVWŽkb™IVxUV@VUbWLXVƒLW`Ux@nk@Vn@x@VkJ@œV`mXkŽ@V„xV@lVššI@VULš˜VU„IV`°bVXXx„V@VWVnL@xV„Ub"],"encodeOffsets":[[121332,37840]]}},{"type":"Feature","id":"3702","properties":{"name":"青岛市","cp":[120.4651,36.3373],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@„@nU˜JXLƒ„@blVU‚š„nIVl„IVJ@„UxWLk¤@V@nlbXbWJÅnUJVbVL@x@b„ŽlIœaÆVVVk²VJ@X„˜šnV¼šJkX@blxlV„@VLU`@nkbƒLkm@nWJō„ó¤™bƒn—ƃbUn@xlxU@l@„¦@¼UŽl¼ĊUnW„@šnĠmÈxšU„V˜I„VnUVV@LšV@šnVWbXb‚UVbnK@UnKVmVIllœUVLUJVXlJš@nnV@nmVUUm@—˜Vna@ƒK@mUaV_UaV@„aV@@a™anlKUk™KklwlKXwlm„a@UVI@akW@™l@„bnxl@°nJšxl@°£„WŎIUÑn»lašmô¹Ŏ¥VaUUkƒmkġWɱIUUŹ`›@kk@ĉƨřV¥_Ç@™Ĭƒ¤ÝL¯m¯£ƽóķwUW±ī¯kōaĉĕ™kğmó°ƒbW@UKkLUaƒVmz@V@ŽUxVn"],"encodeOffsets":[[122389,36580]]}},{"type":"Feature","id":"3717","properties":{"name":"菏泽市","cp":[115.6201,35.2057],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@@¥šIVUÈmÞ»@UlU@Un@VW@UVmkk@aVUUKVÝ@UVknK@UV@VVnIVƒ@wnƒmwmKXaWaXI@UV@Vy²blkVKkam™U@kb@Um@VmUkmƒKmkXKWwkU@Ulƒ@UnK@UVUUm‚KXwšUVL„w‚K„U„@@Wl@@wUkV¥—@@I@W@_V@VWUw@UUa@aƒaWa—@@_mKUw™l¯amzmV—@WK™nU@kƒWLķaUKbÝVmV@UWÇbÛ@ƒX™°UbW@XŽm„Vlk²UJUbmLÇxÅWUzl‚¯Ll„@VkK™XUbWJ@bU@¯@™ƒkbƒLmKka™„@l™_WšXºVbUz@J‚n²V@¤lX„Ž„nV°šLn`WbXLôVlKVUšxXn˜lXLlU@bVV@„XJWLUVnVV@„„@n‚l„°nn‚V„KÈbVXÆJU°VnXV„kV@@xVL„@šWlb"],"encodeOffsets":[[118654,36726]]}},{"type":"Feature","id":"3708","properties":{"name":"济宁市","cp":[116.8286,35.3375],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@nam_nKlVLXa„Il`š_@KVVXI@m@w‚ƒ„@@k@Kšnô@n`VbV@@L„L@KVVn@VX@‚VL„Jl„š@VUUƒU@Uam@Uk„wšKWaXamkJmIUVUÈblašUnV@kVKl@@lXL°kVJ@VÈnVJUX@V‚LXl@xVLnU‚@VK„V@a„IUaV@„bĊU„x„K‚kVJXUlV„ƒ„UVašI@WUI@KlUnw„mWk@WXIWƒ™U™L@Wna@Um@@UƒVk™UUlanWW@kkU@y„kWk—aWVUlÝbUU@kƒJUIU@@ƒ™JmaókƒLKǃUUkKWLk@WbkUUaƒbmKn¯°¥V@XwV@VanaVaU_@Wlk@WÈ@VUÈVVۂm„aklKȯlLVUX@lK@aX@@kV@VmV@VwnJV_UWUwƒX™am@kW@wVUkKVIUUVmU@UV@IVK@aUL@aƒV@Lm„UKmx@ŽômLkUWJ@šnXmlUxUL@Vkn›VUšU„@V™L™`Ub±LkV@kUKÇbÛ@ƒU™Wó_mJƒ@Wk@@Xƒ@ƒVLƒxUK™VWxLVnUV@VmL@Vk„@VlVXxWLnl‚Ln„VlUnn@@VlaV@nšlbULkl±aUzU@@VWJXbWbnLnxm„@xU„mJUUU@@VmLUl@VUÞVLUV@bllUn@VUXm@@VkV@VݼÇnUV™J@¦nnƒlnVlL@„Þb°KVV"],"encodeOffsets":[[118834,36844]]}},{"type":"Feature","id":"3714","properties":{"name":"德州市","cp":[116.6858,37.2107],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@„¤@VmbVXnVVbVJššX@Žll@z„lVInl@„@bVxUbĠ‚l@Èbla„IšxXVWb@L™@n‚ULWVXXšWWLnL@`@LUVVL@lVn„JšU@UUk‚a„™nš‚Vôô„b°¼V‚ސXš˜‚œIÜbČa˜bôW„XÞWÈzÆmnLVJ°ÈnlV²lbnW@™@UƒUV™šmnwmkkKWƒkla@mVIUKUa™aUwmn™JU@@amIk@@bVlkX@mmUklUUƒƒa@_UaUUƒV@wƒw™WkXmW@I@WUaÝU@UXaWUU@UUVW@UUUWUn¥nUVa@m@k@alU@wk™LWa@UUm@@wnmU™wla@anKn_@alK@ݙ_ƒ@@WUUUmlkaƒIƒyU@UwU_Wa¯yU_mWUwkImm@InWWUk@@UVWV—kW¯U@VƒL@b¯b@l±¦@šVV@lUbV„@škxVnUšl¼XV@b@lV@nIWxnbƒ‚™@UU™LƒxÅxm¯ƒaUƒ™wU@mUÅVÝKULm@bmKUXó@"],"encodeOffsets":[[118542,37801]]}},{"type":"Feature","id":"3716","properties":{"name":"滨州市","cp":[117.8174,37.4963],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@Vb@`„bV„kVlnV@nlWUk@al@nJ@bV@šInmVxšbVbVLUJ@nkb‚lX„lLnlmx™nUš„V@V@šmXn˜lbĸ@nnVx‚b@lnXV@UJ@nVxšxnxVbÆVn¯ƒĕ‚@@wÈçUÇlķVIœb‚@„Çmk@¥k@UkUK@aWakUóJW_UW@wkkWK@U@Kš@XUƒƒUkmUUalKXala@U@kkWlkÈl@kšV„mVIVmU_‚a„ƒƒwnwVW@wƒwUƒ@wU£ƒwkJWIyUI±bk‚VUJ@nmV™Ukl„Xmx@lnbW„kVƒUkLWŽƒxkKUUmUkb™J±—LÇxUKmkUmkkW™™a„mUaVkšJÆ_²KĠ@U„W@w„U‚¥nUWwK@aÝUkÅVaVK@akLWƒƒƒ¯I@bnbVx¯JW„ñšWbUL@šƒŽnV@VmbkUUV@IÇak@@bWak@WJUœJWL@bXV@„‚@„V„Jlb@zUlUŽUImšnbV‚mz@°UV@V™bV@@V@L@xLmKUnmJVX„J@VkLW@UVUL@b"],"encodeOffsets":[[120083,38442]]}},{"type":"Feature","id":"3715","properties":{"name":"聊城市","cp":[115.9167,36.4032],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@ô@VWnL‚an@VKÞLÆUnVV@šxV„„bn°Æw„wšKVVš@„maXwmJU@@k@aWUk»V™Umlw@™UƒVa@kUU@™²¥@k°a@a„K@U›ƒU@mmm@ów—ѱ¥¯@@w™Kmw—I›¥kU¯UmakJmIUaƒVkKUkm@VUUa™Uƒ@UaƒKUK¯@™w™UVŽUIUKVw™k™¥™wƒbVŽ@xn„@lWnXxlL@`„XlJX¦l°XxW¦@¦Ul™n@Ž™@@Um@@VXVmx@¯bllUnUJ@VULVn@b„xV‚VL@b„„VlnVVblV„ÈnVlIVJœLô„lJ@xl²„"],"encodeOffsets":[[118542,37801]]}},{"type":"Feature","id":"3705","properties":{"name":"东营市","cp":[118.7073,37.5513],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@ͬUǪlô@°Uœw°ōĠ¯š»Ģ炻XÇ@w™wƑa™ÇƒkwVƑ¯@řķUmm¯w@kƒa@mV@@anIU±m_ÛW@_mWVU„K@IkK@UW@@a@K@™L@Vk@±U@UV@lm@mUU@kLm„„xV¤@xV„„x@xUXmx„xƒ„bV`UnUJƒn™U@lÇkkllX@l@VkbWbkLVbnVVl„„WV™@@L@VXLll@xVXX`ôIlVXb@bVLVll@@¦nlƒÈ@›aUJkĸVÈÇè@x"],"encodeOffsets":[[121005,39066]]}},{"type":"Feature","id":"3701","properties":{"name":"济南市","cp":[117.1582,36.8701],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@²¦˜Òôxn@nn‚@V‚œ„°VlXU˜UX@Vl@XVmX@JnnlJVxnXV`°zXbV`VxV@„z„JlbkŽVnVV@X„@š`@ÞkL@bm`mL@bkbšxnVm@xn@VV‚@XbšKl@xkV@b@l@nUbmVm¦XVVV@VUXVVV@XVWb@VÞVVb@X@JnXlWšX„x@x„UVV@aVKVUX@lK@UƒIUWnIVmnL‚K@w@K@UU@ša@UVU@¯nyUman™VJVVk@ykaƒIƒU@@ƒWU@aXK‚IV›XIl@Xb@al@Èb@JVUlVna@UmU„@™VKXaò™Xƒ°IUwma@aU@UU@wVW@фw@a™I±`kbƒUkw™UmJ@UkmÇUUkmKknUVƒ@mJUkaWkƒa@KmKkUƒLmyXa¯_@WmImmbƒLmUkVUbUVƒJ™bƒUkkWJkUƒl™IUm™k™Lƒ›„lK@knaVmkI@mWaƒLUK™UU@@VmLUVLWK@UUUƒWUkkVmx@„Vl™¦"],"encodeOffsets":[[119014,37041]]}},{"type":"Feature","id":"3709","properties":{"name":"泰安市","cp":[117.0264,36.0516],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@n¼šŽW„nxšL@x°@š¥Uk@ƒnwlUVl„XVV@VXL‚KVUnK@UV@šVVL„KXb@nlJUnmb@lkLƒ‚„œšKšlVnšJ„klVXIll„Vša„IVUValUnV„K‚annnJ@X°`Wbnz„KlVnL‚Ž@L„bXl‚bVlnI„@VUU@UmVƒ@U@Uš¥@VmV@@_Ua@m°@@ƒ„kmUUm@UVmn@nX‚@@a„anJVUVL„mlIVJn@nkVLVa@KVmVLXVVLš@@U°bn@VaV@@K@aVkœbWaXUVymU@aUImWXƒ@™¥UaVwUaVwUUU@WWƒ@k_™VUKÇa@ƒƒnmxkV@LVJ@X™JUbƒVƒ„kUWVUIlƒLƒwĉVƒaU@VbƒJ@bƒUUL@mVUK@wWkK@UVWUIÇm@UUI¯lWK@kk@UL@lmU™VkbÇaUVVnJlIn‚WbXb™LƒxVln@VbV@V„UV™@kƒƒIUK@UWm@UU@LƒK@KU@Uam_ó@™m@L@lƒ@„@x@nWJUU@L™`k_ƒJWbUKkmLn`mb"],"encodeOffsets":[[118834,36844]]}},{"type":"Feature","id":"3710","properties":{"name":"威海市","cp":[121.9482,37.1393],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@VbUnVVUxĊ¼š¼ô@Þф¯‚WǬLŎUÆW„¹Uǃō¯ÑƒÝkţ™™ţóġ™óL™ł̥U™wm¥kÝmkkKóbÝ@U¦@‚mb¯LkšmJ@x„Lmn@lk@ƒa@Xƒ@ƒlXbmJUz™V@bVJ@n@x„blJXzšxV@Va„KVUXLlmVV@In@Vx„UlW°@nLVK@zXVVal@@V„w„bVKšL@bnx@„WbUJ@VnXVlVxl@nnnV@„lV@L„‚"],"encodeOffsets":[[124842,38312]]}},{"type":"Feature","id":"3711","properties":{"name":"日照市","cp":[119.2786,35.5023],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@UaVUUKVk„JVaVIČb@Vam@ka@Ul@„Uô„VK@UnKVLnKlkWVa@¯l@VbÈlV_V@XWW_@anKVwUmVw@@Uny„UVblKVLX@„aô¯ó¥mÛĊÿÈ¥š™Þ¹lUīƒ¯Kĉ¼ʟbÇV™U™ŽUŽ™XmakJUnmV@bUnmJ@XnJVLn¤UzmJUn@`¯ImŽU@™nƒKVkkm™KWb—b@xƒk™@mL@KƒUUVUKkbWaƒXkK@bkJWbnbl@UL@l„Lš@lxx@b‚nUVlV@¦²°@bVx@Jƒ@¯XUJ@bUnlxVŽ„X@‚VV@b„L@nô`@bkbVVÞL˜xnU"],"encodeOffsets":[[121883,36895]]}},{"type":"Feature","id":"3703","properties":{"name":"淄博市","cp":[118.0371,36.6064],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@nƒlKV@nVn@@kVU‚@²VVaUƒ@wmKXU@UƒUWwUW¯aU_ƒJUV™—VK@U™JU™@kUƒw@UlnWU_@›lI@U@wUml@@mVwX_„KWUXKVa@UVUUwšJlaXWUnƒ@mla„n„UVWkIV¥V@VVVI@a@akakLWKna@aVwk@WUƒbUlk@™k@U¯UWWU@mUUVUXkVmVVV@nkVƒLƒVÅwƒ¯k@WVXb›aUl@bV@@b@xkVVXVxkJ@nk@@ŽVLUlVb‚VXUVVUzV‚™LVbUbV„VWVkLmškJ@n±@UxU„VVkV@bƒx@ÒUX@xVVV@°J„„X„lK@bULUblÆÞV@b‚LXxmV¦ƒV@xƒXVŽğ@±LÅ`™IUlVbƒnšbXšllVnnlVLÈw˜K²ŽšIlanVVVlL„wXlK„VlUXƒma@knwƒWlkšVnU@mVIUl²aVJ‚zXJlI"],"encodeOffsets":[[121129,37891]]}},{"type":"Feature","id":"3704","properties":{"name":"枣庄市","cp":[117.323,34.8926],"childNum":2},"geometry":{"type":"Polygon","coordinates":["@@‚yUU„U„kl@@aVmšLXw°»°w@y„L@UUaWXKƒƒVknwVKlmš_UmmUXK@ašw@k@mUWmUL@ƒ@™@£@KƒbÝV@akw™aULmƒƒbUK™LUU@lm@—°mL@nUJVxVXU`mIUxU@UnU@@lW@@bkLW@UVkKÇ°kLlŽƒbnUÜÇUUVÇ@@Xkl@XV`UbmbUbU@WxU@¯¦m°nL„aVblVXal@XKlLVVȄ‚L„KôlnbšI@„V@VJ„I@lVVÞaVkXU"],"encodeOffsets":[[120241,36119]]}},{"type":"Feature","id":"3712","properties":{"name":"莱芜市","cp":[117.6526,36.2714],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@lmnLVlÈVln@VnIšVlx„Vla²_šJlUUUVƒVw²@@mlIn™lKXU‚UUƒVaUašKUVyUUWVUUaVkUK@l@@mlIUwUWlU@w@aU@@LU@Ubm@¯a@V™@UKWUUKUn@LUbUKmlm@UIkJƒnUKUVmIƒb@b@mWm@Un@VVnnVƒl@„¯@@nVb@`U@Un@Ž™¦@V@VU„VnV@"],"encodeOffsets":[[120173,37334]]}}],"UTF8Encoding":true}; }); -define('echarts/util/mapData/geoJson/shan_xi_1_geo',[],function() { - return {"type":"FeatureCollection","features":[{"type":"Feature","id":"6108","properties":{"name":"榆林市","cp":[109.8743,38.205],"childNum":12},"geometry":{"type":"Polygon","coordinates":["@@™ýVƒnIW»ƒW@»kUÇL—݃U¯¥ÇIUWWїUWwX¯mƒ@»n@ÜÈķô™@a±kȱƒw„ÑmwçċmU»ÆkkVyIm™ĉÿ@ƒÝ¹ƒWnwÇVš™Åaƒzmmĉ¦ó™kVmx™xU¼VškVm_UlVlk„°IV‚kmJa›¦k™™LmmV@XmKnšlUô›VXbƒbƒ@UaÇLğܙ™Åwƒ£mKnmċwÅ@UkƒbmaVƒƒƒn@m¯aU™Jm_k˜@kWXyl@@kÅamw™LU™Þ™ƒ™mWÅzUKƒš™Uk±@™b@nnK‚bX¤mzVšŽVxÇn„‚¯„@ÒknWƒƒVUbkķÈÑWkk@Va™™U@„mUkbƒÝÅ@Ý¥ÇbkĬ™XV`kLǍVmalUUa™nV±nwmkƒJ@Inƒ°KVw¯UnÅ@¥™ƒ™U±bUU˜±œmWbÛKWnUm`UƒVK@bmnœm‚Èż@V„L@xƒxmš„Ť°nŽ@VmK™²VlšlKk„ô@„êÜV@VXLlmš¦UššV°Ș¯²ÿ@¥š@ƁĊ˜²IšmĶnnb°b„KVƒĸLl„Þ@UȮš™Ü°IVƒÞÝސlŽœx@ŽķĀWŽ„Ux„èƐ@š°ŽXnšlĊĖ°m„nƒšV„²V°ÒƦ„aބ„˜@zll@bÞĀšlš¼nKĊ¼óȂb²±šIǪÒ¯ĖV@„lxnVlk„JlaXwŌĉ„„@VnŽššlÆĕ„UÆLœèŌŤôxȚlUœ@šxlaUċĕXm„IWmnkšVVƒ„VW_@aÈWUUmk@ƒ¯çVm»™±W¯n¥V™mkXw±ÇVwƒ"],"encodeOffsets":[[113592,39645]]}},{"type":"Feature","id":"6106","properties":{"name":"延安市","cp":[109.1052,36.4252],"childNum":13},"geometry":{"type":"Polygon","coordinates":["@@@kkÇmIšmUwVkUƒƒU²WmšVkm@m`mIĢĕUƒVa@™mXƒƒÿVVkyUýšĕ@l_UmnƒW„KVkţ™™¥™aƒwğ@™@aôƒ„ƒWa„kUmƒa¯¯™a±£kx™mmxUwÝ@xmU™b¯K™wó„Ý@kmm¹Ub@lklVbmnnVUV@x›UknƧJUX@ŽƒLÇWkw™LķƧÅwWJk„ƒLkþĉxWz™JUnǚkš@Ɛk¼ÜÔÈKšè@°lșÆk¦l„n@l¼@l¯L™°UU™VÇ°ƒ¹—`m¼mXk‚™bUaƒV@U¯x@¦™Ç™„UUmlmUVm„nnmlkw™@@šƒ¦Å‚ÇLmx¯Iklš„@¦mÆ°VUx¯Lm„@J„InlmxU²šmVbkV‚bUnȎlKU_šWlīÈaÞ¦Æ@„ÞlanV@ƒšVšUbl@XlÇÒĸlŽVa„UX„lm@Ñ°ƒƒÈmUw‚U™nyW£amL@mša²@lšV„™VLÆynX„šÝšVššKnxÆb@lk@WzXŽ@ll—n`šIV‚°b@n„m„„‚Unb„aVlÆ@ČxmnnL„¤ÆxššĠÛÈKVb„@„aWaœU‚ókVm™nL@W‚UnnšKlšœ¥‚bnIlU¯JlƒUkVkn`lUU™V»šwnwlUôšĊ¥nn„yÆb"],"encodeOffsets":[[113074,37862]]}},{"type":"Feature","id":"6107","properties":{"name":"汉中市","cp":[106.886,33.0139],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@lKnb@n„lWb°bkxĸwVb@ł„nlŽ„ƒĊ¥šL@XŽl™ÈƒVblÈK‚b„akVwôml²`‚nœ@‚nVKœl˜k²xŎƒ°¦VU„JĊw@çnWçރVkUóÛ@¥kwš™šUmƒX¯WšÑkƒ@UymIUwlUn¥‚mUk²a°¯V»@™ÝVș„ÝċÅÅVl»@l@a°±@_kammÅb™a@ƒƒm@ż™KknõĠ—@mšƒ„¯LÅw›‚—LVxmb@¼kV™@mw¯wVakKW»X±¼¯Vkxƒb„¼WŽ@nx@x±bóakbƒ@ÝmU™@ķÓÛL™kƒVUm™k¯¤ÝLUlÝ@Ýz™š„x@x™°™™™bƒmƒX¯aUJW¯—k@bÇWƒwÛwWxƒ@XWlb@Žƒ„VŽÈUlwšLnl°VlUô¦œU°¤VšUxVXUxlbkVVlƒI„°„ÅVlU°m@k„ÇU¯xUlƒLUlVL@b™°ĠInĠ°ÈnK‚„@xÞa²n‚aUyšXUKVkšWô¼Èa‚z°JXUVÇV_„JVƒšz@Žnb"],"encodeOffsets":[[109137,34392]]}},{"type":"Feature","id":"6109","properties":{"name":"安康市","cp":[109.1162,32.7722],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@„bĊaƨèšwôô„¼šb°ašXVƒÞVUÞ@‚aXƒm¥kImx¯¯ƒV@anU@UÇéğL@ƒ¯¥V£mƒ@ÝÈb„K‚™„X°wČÿ˜ƒ„b@xÈblxȯĊ„„mÆUVƒ„nÈ@ƨÜLĢ¥ƒŹnƒ°Vnn˜K„aô_ȃšwU‚aXmnW‚¯kl›LXƒÇ™ō¦ÝaÅVmbğUn¥±wÅéVƒan¥ƒ„U„»°am¥„£ƒÝ@ƒ„wVw™¥nU„уUmmVwmķIÅaóVWxkblb@ból@œğÒĉ¤ċXƒ˜¯X™xk„Ç@óÆÅx@š™xķ_kmݎǣkblb@`¯²@bk‚‚@k¼ÆUČƃÞǚÞU@šU¼¯°±bVlnm¦kVVxnJVz@‚l„™ÒXW°n„™V™šlx@¦ôÜVUl݄Xèm@è"],"encodeOffsets":[[110644,34521]]}},{"type":"Feature","id":"6110","properties":{"name":"商洛市","cp":[109.8083,33.761],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@²nl‚ôbš„°aVwnKÞIš`°wšXôw°VĊ°@ŽÅš„ÞÆV„zÞK@xšŽ@a‚LŚ@b@ŽnLlƒ@šln„mnLVw„a„bVƒ‚VnbU¼„Vƒ°„bl„šbÈ@ĶŦb˜@nÇ@amIyUI@ĠVmôƒU™ƒVwkwlanJ„¯lwó¥@an°Jš_„‚@š™nóƒó@£l¥UwmašÑ@ƒUm±V_ƒJ—£›J—UW¥¯@ƒ_k¯¼mUƒVUè¯b@wmL™»ğVmağI¯¤ċIUW™XƒKĵ¦ķaƒJUb™IƒlUóVmk@WÅÅÇ@ƒmU„ÅVƒnĉƒÇ°kwÇa@wƒa—„ċĀ¯xƒWšƒLÇa@Þn„U¤°¦@„ĠKÈê@VmV@b„U°°nwlJn¦W„bÝ@VŽ"],"encodeOffsets":[[111454,34628]]}},{"type":"Feature","id":"6103","properties":{"name":"宝鸡市","cp":[107.1826,34.3433],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@@ƒ„£@›°Išb@¯°ynŹƒaUƒlƒU£„Umšĵĉ@@ylUÞ@@£kWU¯WaU£¯ÇV¥ƒ@kb¯wƒn™¥ÇkUÇnUƒ@¯±›kULm›@m±_kŽónUxlŽƒbaÇLkŽUaDŽkšW@™Kĉ¦ƒ„kƒm@ŁUaķxlw¯aXaƒk@mmakL@šmšÛŽ@¼m„@l„XV`ƒn™KUš°°@²š¤UÈ@VxmôƒxKl„VV²aVw„Xla„Vlx@UVnŽÇnk°ƒVVL™lkI™šƒJÇk¯V@šknƘn@lznmlVkzVŽ„VVxš@Ux„z@x±¼VxxU„l‚kb˜@„¼Čk˜VXlĠkôV²w‚LUKlwœJ@a‚IV¥Þƒn¯Ün„‚„@nk˜l²kÆ@š°„aVbnI@™š‚Ťn"],"encodeOffsets":[[110408,35815]]}},{"type":"Feature","id":"6105","properties":{"name":"渭南市","cp":[109.7864,35.0299],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@@ÈôL„xUŽ°„Þ@mŽÈnl¤nUôL‚wX`@ÞÝL™ŽUšmLô„„ŽôbVbnºlnÞ@ôƒšx°LšanV‚wÞ@Vxnwšnlw²¤šb°°„bVnƒlXbƒ„ó„@bš‚Ġ@„xšbš¦ŤšV™Xġ„£W¥ƽɽƒó@ýóƝÝ»„£X™mƅšĊkUƒ„@™™šó„kťaĵŽÇ@™akƒƒa„¯ƒUV»maUU„ƒaƒbUxmKƒnkm@™k„mK@ƒxó@¯n¯KǦ@ôÅèlxkx°nƒƾ¯KU¯WķL@VÝIUb™yWbX¼Ç°"],"encodeOffsets":[[111589,35657]]}},{"type":"Feature","id":"6104","properties":{"name":"咸阳市","cp":[108.4131,34.8706],"childNum":14},"geometry":{"type":"Polygon","coordinates":["@@šIXyĊwlý„KlƒXIVaķƒ™»a›£„¯aVU@a™‚wÈō‚ašL²»‚VœUln°WȯW»XašzVaÞJ@Uƒ»@¯Ýbğwly@£kÑţ±Wу@ka™IUƒƒnƒ@¯ƒómţU™b™U¯lÇIÝb@¤Ý@kV@zĊ@™ĶnƒVV¤k„V„„bmź¯z@°™a¯J@œƒ¤@„„bUx™bƒ„@`™xUÔ±ºVXœW‚„UnUJ‚LĢ¯ÈKlblmÈXŎ°šU„°LšŽlkÞKš@Èxl_°ĶUÒkblš"],"encodeOffsets":[[111229,36394]]}},{"type":"Feature","id":"6101","properties":{"name":"西安市","cp":[109.1162,34.2004],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@°²@‚„mVVÈÈlš¦„m°xla„@U¦°ÈV¤XbV°lXÞaÈJ°kšVšaŤVôn°„„@„mV„šJlb„@XÒŤ²lÒ@¤kzĠxÞa@°„¼ĸK°XV‚°L„ƽ¯mlwkwÆç@óÈ¥°L°mô@„w@aƙK@b™@wÝLƒyÅUƒÝƙ@ĉ¯¯Uóx™W¯x™_ÝJmLUx¯b™ƒóak±mÝUU„™W¯b™aƒ»óó™xƧçĉbƒaĉxƒIUV¯¥ō„±w—l"],"encodeOffsets":[[110206,34532]]}},{"type":"Feature","id":"6102","properties":{"name":"铜川市","cp":[109.0393,35.1947],"childNum":2},"geometry":{"type":"Polygon","coordinates":["@@ÆxĸƨšKlxÈX„K@VWƨIlmœV@wVUmUnmUalk@kVaUaóaƒóƒnKV™šÞK@ÝW_xóKmVk£ÇmnÝ@¯ƒVƒwóK@ǯXkm›VU±¼™KbÇŎx‚š@bUV°bƒœ¤‚bš¼ĸ„Ub"],"encodeOffsets":[[111477,36192]]}}],"UTF8Encoding":true}; +define('echarts/util/mapData/geoJson/shan_xi_1_geo',[],function() { + return {"type":"FeatureCollection","features":[{"type":"Feature","id":"6108","properties":{"name":"榆林市","cp":[109.8743,38.205],"childNum":12},"geometry":{"type":"Polygon","coordinates":["@@™ýVƒnIW»ƒW@»kUÇL—݃U¯¥ÇIUWWїUWwX¯mƒ@»n@ÜÈķô™@a±kȱƒw„ÑmwçċmU»ÆkkVyIm™ĉÿ@ƒÝ¹ƒWnwÇVš™Åaƒzmmĉ¦ó™kVmx™xU¼VškVm_UlVlk„°IV‚kmJa›¦k™™LmmV@XmKnšlUô›VXbƒbƒ@UaÇLğܙ™Åwƒ£mKnmċwÅ@UkƒbmaVƒƒƒn@m¯aU™Jm_k˜@kWXyl@@kÅamw™LU™Þ™ƒ™mWÅzUKƒš™Uk±@™b@nnK‚bX¤mzVšŽVxÇn„‚¯„@ÒknWƒƒVUbkķÈÑWkk@Va™™U@„mUkbƒÝÅ@Ý¥ÇbkĬ™XV`kLǍVmalUUa™nV±nwmkƒJ@Inƒ°KVw¯UnÅ@¥™ƒ™U±bUU˜±œmWbÛKWnUm`UƒVK@bmnœm‚Èż@V„L@xƒxmš„Ť°nŽ@VmK™²VlšlKk„ô@„êÜV@VXLlmš¦UššV°Ș¯²ÿ@¥š@ƁĊ˜²IšmĶnnb°b„KVƒĸLl„Þ@UȮš™Ü°IVƒÞÝސlŽœx@ŽķĀWŽ„Ux„èƐ@š°ŽXnšlĊĖ°m„nƒšV„²V°ÒƦ„aބ„˜@zll@bÞĀšlš¼nKĊ¼óȂb²±šIǪÒ¯ĖV@„lxnVlk„JlaXwŌĉ„„@VnŽššlÆĕ„UÆLœèŌŤôxȚlUœ@šxlaUċĕXm„IWmnkšVVƒ„VW_@aÈWUUmk@ƒ¯çVm»™±W¯n¥V™mkXw±ÇVwƒ"],"encodeOffsets":[[113592,39645]]}},{"type":"Feature","id":"6106","properties":{"name":"延安市","cp":[109.1052,36.4252],"childNum":13},"geometry":{"type":"Polygon","coordinates":["@@@kkÇmIšmUwVkUƒƒU²WmšVkm@m`mIĢĕUƒVa@™mXƒƒÿVVkyUýšĕ@l_UmnƒW„KVkţ™™¥™aƒwğ@™@aôƒ„ƒWa„kUmƒa¯¯™a±£kx™mmxUwÝ@xmU™b¯K™wó„Ý@kmm¹Ub@lklVbmnnVUV@x›UknƧJUX@ŽƒLÇWkw™LķƧÅwWJk„ƒLkþĉxWz™JUnǚkš@Ɛk¼ÜÔÈKšè@°lșÆk¦l„n@l¼@l¯L™°UU™VÇ°ƒ¹—`m¼mXk‚™bUaƒV@U¯x@¦™Ç™„UUmlmUVm„nnmlkw™@@šƒ¦Å‚ÇLmx¯Iklš„@¦mÆ°VUx¯Lm„@J„InlmxU²šmVbkV‚bUnȎlKU_šWlīÈaÞ¦Æ@„ÞlanV@ƒšVšUbl@XlÇÒĸlŽVa„UX„lm@Ñ°ƒƒÈmUw‚U™nyW£amL@mša²@lšV„™VLÆynX„šÝšVššKnxÆb@lk@WzXŽ@ll—n`šIV‚°b@n„m„„‚Unb„aVlÆ@ČxmnnL„¤ÆxššĠÛÈKVb„@„aWaœU‚ókVm™nL@W‚UnnšKlšœ¥‚bnIlU¯JlƒUkVkn`lUU™V»šwnwlUôšĊ¥nn„yÆb"],"encodeOffsets":[[113074,37862]]}},{"type":"Feature","id":"6107","properties":{"name":"汉中市","cp":[106.886,33.0139],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@lKnb@n„lWb°bkxĸwVb@ł„nlŽ„ƒĊ¥šL@XŽl™ÈƒVblÈK‚b„akVwôml²`‚nœ@‚nVKœl˜k²xŎƒ°¦VU„JĊw@çnWçރVkUóÛ@¥kwš™šUmƒX¯WšÑkƒ@UymIUwlUn¥‚mUk²a°¯V»@™ÝVș„ÝċÅÅVl»@l@a°±@_kammÅb™a@ƒƒm@ż™KknõĠ—@mšƒ„¯LÅw›‚—LVxmb@¼kV™@mw¯wVakKW»X±¼¯Vkxƒb„¼WŽ@nx@x±bóakbƒ@ÝmU™@ķÓÛL™kƒVUm™k¯¤ÝLUlÝ@Ýz™š„x@x™°™™™bƒmƒX¯aUJW¯—k@bÇWƒwÛwWxƒ@XWlb@Žƒ„VŽÈUlwšLnl°VlUô¦œU°¤VšUxVXUxlbkVVlƒI„°„ÅVlU°m@k„ÇU¯xUlƒLUlVL@b™°ĠInĠ°ÈnK‚„@xÞa²n‚aUyšXUKVkšWô¼Èa‚z°JXUVÇV_„JVƒšz@Žnb"],"encodeOffsets":[[109137,34392]]}},{"type":"Feature","id":"6109","properties":{"name":"安康市","cp":[109.1162,32.7722],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@„bĊaƨèšwôô„¼šb°ašXVƒÞVUÞ@‚aXƒm¥kImx¯¯ƒV@anU@UÇéğL@ƒ¯¥V£mƒ@ÝÈb„K‚™„X°wČÿ˜ƒ„b@xÈblxȯĊ„„mÆUVƒ„nÈ@ƨÜLĢ¥ƒŹnƒ°Vnn˜K„aô_ȃšwU‚aXmnW‚¯kl›LXƒÇ™ō¦ÝaÅVmbğUn¥±wÅéVƒan¥ƒ„U„»°am¥„£ƒÝ@ƒ„wVw™¥nU„уUmmVwmķIÅaóVWxkblb@ból@œğÒĉ¤ċXƒ˜¯X™xk„Ç@óÆÅx@š™xķ_kmݎǣkblb@`¯²@bk‚‚@k¼ÆUČƃÞǚÞU@šU¼¯°±bVlnm¦kVVxnJVz@‚l„™ÒXW°n„™V™šlx@¦ôÜVUl݄Xèm@è"],"encodeOffsets":[[110644,34521]]}},{"type":"Feature","id":"6110","properties":{"name":"商洛市","cp":[109.8083,33.761],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@²nl‚ôbš„°aVwnKÞIš`°wšXôw°VĊ°@ŽÅš„ÞÆV„zÞK@xšŽ@a‚LŚ@b@ŽnLlƒ@šln„mnLVw„a„bVƒ‚VnbU¼„Vƒ°„bl„šbÈ@ĶŦb˜@nÇ@amIyUI@ĠVmôƒU™ƒVwkwlanJ„¯lwó¥@an°Jš_„‚@š™nóƒó@£l¥UwmašÑ@ƒUm±V_ƒJ—£›J—UW¥¯@ƒ_k¯¼mUƒVUè¯b@wmL™»ğVmağI¯¤ċIUW™XƒKĵ¦ķaƒJUb™IƒlUóVmk@WÅÅÇ@ƒmU„ÅVƒnĉƒÇ°kwÇa@wƒa—„ċĀ¯xƒWšƒLÇa@Þn„U¤°¦@„ĠKÈê@VmV@b„U°°nwlJn¦W„bÝ@VŽ"],"encodeOffsets":[[111454,34628]]}},{"type":"Feature","id":"6103","properties":{"name":"宝鸡市","cp":[107.1826,34.3433],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@@ƒ„£@›°Išb@¯°ynŹƒaUƒlƒU£„Umšĵĉ@@ylUÞ@@£kWU¯WaU£¯ÇV¥ƒ@kb¯wƒn™¥ÇkUÇnUƒ@¯±›kULm›@m±_kŽónUxlŽƒbaÇLkŽUaDŽkšW@™Kĉ¦ƒ„kƒm@ŁUaķxlw¯aXaƒk@mmakL@šmšÛŽ@¼m„@l„XV`ƒn™KUš°°@²š¤UÈ@VxmôƒxKl„VV²aVw„Xla„Vlx@UVnŽÇnk°ƒVVL™lkI™šƒJÇk¯V@šknƘn@lznmlVkzVŽ„VVxš@Ux„z@x±¼VxxU„l‚kb˜@„¼Čk˜VXlĠkôV²w‚LUKlwœJ@a‚IV¥Þƒn¯Ün„‚„@nk˜l²kÆ@š°„aVbnI@™š‚Ťn"],"encodeOffsets":[[110408,35815]]}},{"type":"Feature","id":"6105","properties":{"name":"渭南市","cp":[109.7864,35.0299],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@@ÈôL„xUŽ°„Þ@mŽÈnl¤nUôL‚wX`@ÞÝL™ŽUšmLô„„ŽôbVbnºlnÞ@ôƒšx°LšanV‚wÞ@Vxnwšnlw²¤šb°°„bVnƒlXbƒ„ó„@bš‚Ġ@„xšbš¦ŤšV™Xġ„£W¥ƽɽƒó@ýóƝÝ»„£X™mƅšĊkUƒ„@™™šó„kťaĵŽÇ@™akƒƒa„¯ƒUV»maUU„ƒaƒbUxmKƒnkm@™k„mK@ƒxó@¯n¯KǦ@ôÅèlxkx°nƒƾ¯KU¯WķL@VÝIUb™yWbX¼Ç°"],"encodeOffsets":[[111589,35657]]}},{"type":"Feature","id":"6104","properties":{"name":"咸阳市","cp":[108.4131,34.8706],"childNum":14},"geometry":{"type":"Polygon","coordinates":["@@šIXyĊwlý„KlƒXIVaķƒ™»a›£„¯aVU@a™‚wÈō‚ašL²»‚VœUln°WȯW»XašzVaÞJ@Uƒ»@¯Ýbğwly@£kÑţ±Wу@ka™IUƒƒnƒ@¯ƒómţU™b™U¯lÇIÝb@¤Ý@kV@zĊ@™ĶnƒVV¤k„V„„bmź¯z@°™a¯J@œƒ¤@„„bUx™bƒ„@`™xUÔ±ºVXœW‚„UnUJ‚LĢ¯ÈKlblmÈXŎ°šU„°LšŽlkÞKš@Èxl_°ĶUÒkblš"],"encodeOffsets":[[111229,36394]]}},{"type":"Feature","id":"6101","properties":{"name":"西安市","cp":[109.1162,34.2004],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@°²@‚„mVVÈÈlš¦„m°xla„@U¦°ÈV¤XbV°lXÞaÈJ°kšVšaŤVôn°„„@„mV„šJlb„@XÒŤ²lÒ@¤kzĠxÞa@°„¼ĸK°XV‚°L„ƽ¯mlwkwÆç@óÈ¥°L°mô@„w@aƙK@b™@wÝLƒyÅUƒÝƙ@ĉ¯¯Uóx™W¯x™_ÝJmLUx¯b™ƒóak±mÝUU„™W¯b™aƒ»óó™xƧçĉbƒaĉxƒIUV¯¥ō„±w—l"],"encodeOffsets":[[110206,34532]]}},{"type":"Feature","id":"6102","properties":{"name":"铜川市","cp":[109.0393,35.1947],"childNum":2},"geometry":{"type":"Polygon","coordinates":["@@ÆxĸƨšKlxÈX„K@VWƨIlmœV@wVUmUnmUalk@kVaUaóaƒóƒnKV™šÞK@ÝW_xóKmVk£ÇmnÝ@¯ƒVƒwóK@ǯXkm›VU±¼™KbÇŎx‚š@bUV°bƒœ¤‚bš¼ĸ„Ub"],"encodeOffsets":[[111477,36192]]}}],"UTF8Encoding":true}; }); -define('echarts/util/mapData/geoJson/shan_xi_2_geo',[],function() { - return {"type":"FeatureCollection","features":[{"type":"Feature","id":"1409","properties":{"name":"忻州市","cp":[112.4561,38.8971],"childNum":14},"geometry":{"type":"Polygon","coordinates":["@@Vx@lnbn¦WlnnUšmš°š²VšV‚VVVnUn„ºlz@l„„@Jƒ@kXWVXl@Lƒa@„ƒKUL„ŽlbnKlLnK‚LnKÆXn°šbVV@bUVl°Un@LnaVJUbW@UX²l‚@ČwlVVIšWnkÆa°„„anV‚Kn°™UW¯@™aVUVk@Un@„aV@ValwUanmWU„k@WVUUanaVwnLVl°@nk@mVU@UVK@w„LVKVU@ƒ„K@UUKVUV@@bnL„a‚V„aôšlIXmlKX_°KVV@bVV„@šzV`kblI„V„Ul‚šL@bnV@V„Ċll„„VlIXW@k„a‚U²blKšVnIlJ„albXXlWVn°JnšnL@l@XlJlaX@„X˜W²@l_VmnKšU„blU@mnkVK„¯@U@ƒma@kX¥VƒmakkƒLƒa@aƒ@WIUUVXWWnk@a°a@kkm@kUUmJm@WUUUIk`m@V—kaWWkX™KmƒXk¯ƒ@WKƒLkak@±bƒw@ƒaƒa@akaƒ@ma¯@ƒL—KÇÅkKWbkmġ™±ÅUƒLUK™VVkƒm¯LUVVbƒ„UwUW¯bm„ƒULƒxWJ—@ƒklmkUm@@KnwVkVK@akwƒ@@a¯bƒKkn›VUI™b¯mmbk@UbmKUL@xUUƒ@klmLUŽlVXI‚VVVUVUœU`mLXVWbXnW`Ų°xmŽxU@mĉƒƒwU@mbU@UƒmbkVW¦kJ™@ƒX@`¯Im@UlUVVnb@bWJXnmbƒJUU™UUaƒ@UamIkaƒxƒ@@x@b"],"encodeOffsets":[[113614,39657]]}},{"type":"Feature","id":"1411","properties":{"name":"吕梁市","cp":[111.3574,37.7325],"childNum":13},"geometry":{"type":"Polygon","coordinates":["@@@a@w„@„wlbnJVb„@VbšVVV„InaWmXI@a‚aUmVUVkn@°J@_„Wš@lIX¥lUnaV„V@naV@„xĊ„n‚V@‚wn¯wƱX_WmXaWUnKV_V›VUUUUWJkUVnKlk¯™@@kmKUaŁ±KkU@WmI@WUIlUUmVwXƒ‚w@ƒUlUVwœV‚@„Lnb‚W@anU@UšaVkô@l»n@na˜JnUÈLVaƃUUVm„VKVƒ²L@mU_lK@UVWkU‚a@a@U¯aUaƒÑóÑUb™„ƒKk@@aƒk¯mVaUwVƒÑkWUmK@UUKmXUWÝwUa™LUU@aWJUUU@Ua݄U@WL@VKVaVI@WnU@alIVKƒƒ@kIƒmIkJ@™m@ƒ™@@_™K@xƒ@kaW@U„@Vmn@ŽUK@mIƒJUXV¤XXWlkKƒkkK@XmJVakImJU@ó™¯LWKUV@nUVƒLkxmKkLma@kXKmmƒLƒab™LmK@V@mXVÆUxƒX@`nL„aV@@VmLUVnLlLš˜„b@„šŽ°²nx@b‚VUxlb@V¯bUV@zV‚XVĊXVx@lVn@VnnmŽUš@LlJXVƒz¯VWVXbšV@bmn™VUVk„Çþń@XVxmbUlV„Uln„W„@„Xl‚@VLXÒ@bÞJ°¦„L˜ò„@nU‚b@°„X@ŽXbmVU„V„nb@x‚x"],"encodeOffsets":[[113614,39657]]}},{"type":"Feature","id":"1410","properties":{"name":"临汾市","cp":[111.4783,36.1615],"childNum":17},"geometry":{"type":"Polygon","coordinates":["@@nW‚@@UnLšK‚a„b„KnnWL@lnblKnLlw„KVU@mVUXL°KôšV@nIlJUbnI@WlL„llLXkWWU£VW„InJ‚@VL@nm@UVƒX@lb„@@wšL@`‚@„šn@V@lw„@n„VmVX„WmwnUlƒœa@_lK„wVlUn°xVKVXXWlUšVVI@K@K„n°KœwlVlU@kna@V_„Wn‚m„UVm@kXml_@m„LlKXw°m@_ôJVUV@X™l@UaV@Va°I„lk»VwUkVmwUmmVn@V¯@KƒU—wmK@U¯wUVÝ@mJƒU—nWK™@@UnKVa„_lykUmKÛnm@™x@ƒUUlwVk™ƒXW@ƒa@Uƒ@@K@ƒkIV™nammVakUlƒ@wX@@kƒ™¯@ƒVVbml@„„°UbULmlVbnbÅK±VƒKVXUJWa@ULWaUU@@U@aWK@UkxUKƒLUUUJ±UkL@V±kk@kam@UV@l@LWl@n@VVUx„LlUUx@VUV™U@aƒIUl™L@°mLU‚ƒbkUUaWUUaUU@aWK—LWJ@bUL@VUVVbU@m@a@kmKmnĉlUK™XƒWUblb—xmIkƒƒU@xWb@lkšVx™LXŽmzVV@bklVVUzm˜@bk„@Vx@xlŽU„@lUbVnl@„Wxnl@n@ŽUbV„mL‚mƒb@`X@lUX@@xlnkLWaUJnnWV™Vn@l„@bULVV@l™V@XnJVX"],"encodeOffsets":[[113063,37784]]}},{"type":"Feature","id":"1407","properties":{"name":"晋中市","cp":[112.7747,37.37],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@@šlInJ„lJ„@‚„ULkJ@bmV@XUJUb‚L@UXKV@ރVbV@VVXI@bVVšKVbÞxVXnWVL@VnLV‚lX„ÒUŽVxUb°n„l@bl@„LšƒVaô҄ÒVb°b@VnLnnV@lmn@lb„U„V@„‚JœUVV‚Xkl@lUzmJ@xšXkl‚bUn„JVšUb„nU‚lb„V@nlLX@lakšV`Ub°š@XVJnU‚L²KlxnI@KV@lbUbVV„KnVl@„zlm@Uš@nŽšI@WUaVl@@mVU„@XkW@ƒnkVKVƒ„_Vw„y@knwVa‚@XalU„@šVnml@„X@V„L‚KVaÞbnnlJšI„mVKn„VVVInVlU„@„m@™mXK@UmyUI@mWUUakamw@wUwmLkakwVƒmK™w@wUam£y@am_ƒW@™UU@knmm„amU@WUa@knw@ƒUUUUV@nƒJm@mVUkKVUUUkKmwƒKULƒKUImV@lUn™nŽm@mbUK@°™bUnmbUmkkƒWUb@am@UXkK@a±@™V™@ĉř„V‚UXVxUVkLWl¯@@bULUlm@@nm`—XƒlWakIkm›VUbUL@Vm@kIƒ@@Kšm@—VaX‚I@W@aU@kUƒVU_™KƒbƒJkkǎ™b@nkKmL™wÅW@kVUUƒVU@WUIƒJmIXmma@_kyVaUUlkUm@ƒkU›x¯Lƒm@L@LUJ™UkVWXUWUL¯wVmUkƒxkL@`›bk„mVnxƒXUWUnmƒƒ@kxU@"],"encodeOffsets":[[114087,37682]]}},{"type":"Feature","id":"1408","properties":{"name":"运城市","cp":[111.1487,35.2002],"childNum":13},"geometry":{"type":"Polygon","coordinates":["@@„Vl„nJ˜wkaVa„XšWVLĊknmnL‚l@@bn‚V@UaVU@UVK@aXI˜KXL@bVVVbXVVblV„aVnK@¯šKVk„J@bšVVU@UVwkVƒKVwUUm@@Xk@K@kVUn@lbl@²l@UlK²VVIVV„KVLlw@VXL@b@VV@VŽXbVK‚@XbVIUW„L‚U²ÆLmaUankVKVaƒ¯@ƒnkUa„U°@„š‚n@@kWa„UVaXUW@IXKVw@U™ƒ„™WU@W@@UUƒU@mn@ƒ`m@UUULkUmJ™IUƒ@@UƒK@U@›anƒ™ak_@wmKUwmakV™kmK™V™k¯b™wƒ`kwUIÇx¯»ÇaŃmn@@™mƒmUkV@wkKW@kxmL™UkĉLÝk™xÝw¯lóVU„mV@ĀVVX¦W¤kz@`Vx°„²ĸ‚š@„Ul@x„êĸNJ°¤V„VlXLWnXxmV@nUl@„"],"encodeOffsets":[[113232,36597]]}},{"type":"Feature","id":"1402","properties":{"name":"大同市","cp":[113.7854,39.8035],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@²£šyl@Ȑ˜Ė@bĸŽĢbĸ„˜X„a‚KŤnn@ŎôllÈx„nVnÞDŽV@b‚nXllL°KšbVb@J@b—„‚„@ŽU„„xlKXLlKlXk„@Ulk„JlkUƒVKXUƒÇVIVm@_nǚLšašl‚w„VnU@UUwma@aƒaÝaLmUk@@Wƒ@U@@X™wVWÝUUUk@@VmLƒKV»nwUw™aUL@`mzƒJUIVƒUaUw™KUaVIlJôanÑlLVUn@ša„@VV„@@UUwVK°Vn_lJÆLœéW@UUUÅ@»lm@aÞIVwXW˜UUkkm@U@aƒU@mwU£VWU_kWmƒXwW_°yUkkK@UÇK@kkUVymóK—U@KWIƒbUak@mJ@bkbmLkŽ™UmƒkVU„W¦@lnb@„@Vƒ°ULml@nkVƒa™VmLUnk`±@—XƒWW@kbǦXŽ¯„WxI@xmbmxXlWV„„@bŎUz@J‚b@bÞb™ŽU@Wbk@ƒxk@WX¯VۙƒWÝbÝUkVUU@alI@a@akLWa™m@U¯UUmÇL@K@aU@¯VUkƒKmX@`@œkJ@nV‚Ub@lbVÆXVW„ULU`VbkLUV@XWl@bXJ˜@VbV@Vl"],"encodeOffsets":[[115335,41209]]}},{"type":"Feature","id":"1404","properties":{"name":"长治市","cp":[112.8625,36.4746],"childNum":12},"geometry":{"type":"Polygon","coordinates":["@@Uk™Lky@I‚JVa@mÞaWšy@_W@_WƒXVlUVwš@nw°K@m„UƒVaƒmVkU@mmmnLVUmKXa™U@IlKVUnK@UmWkX@WV_Vƒ@akU@a„KWIXyƒIUVmUn™Ua@WaXUVKVmkUWVkUƒLU@@VƒbƒKbƒIUmƒ@mbVL—x›WUUkn±V¯wƒbÅJUbmLkbmKÅKƒbVnUbƒV™KUb™KUbmLKmƒb™aƒKkUm@UŽnn‚VnxUVlUxl¼ƒk¯JUbU@Vbk@WšU@UVóI@`¯nWxkLƒK@nk`Wn@lUnƒVnm‚ƒXU`@mb@lkV@„VnklVVUblz@`nbWnnJ„IVJ@XUVV„UV@lÆXšxnKlL@mšaȍll„I„ašLV`„UlVV@@b@XJWUb@˜™n@L„@lJn@@UVKVaœUlnlJXb„k˜Wn_@mn@VkVK@a°@XklKVUUwVWUšƒĊƚ@šU²@@blLVWn@@bVa„XllVnnaVmša@¯VLnan@‚šmVm@knUVJ"],"encodeOffsets":[[116269,37637]]}},{"type":"Feature","id":"1406","properties":{"name":"朔州市","cp":[113.0713,39.6991],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@XXWVXVWnnlnn@èƼ@„„xlš„ŽV„nblšššVŽÈUVl‚š@„blnœL܃ĊmUkU@Ua‚—@WI@aXk@WVUlKUaV_VKXƒWUUÅka@VaU@mlI@›@_nW„LVl°UV@@b@LÈKVn°V@VšnXblK@b@bkJ@bVVlUÞVÞa„Xܚ°UXWl@„wl@XaV@šÝa@aa@IVyƍ@aƒƒXUWknwna@w‚JXw°ƒWÈ¥kI@W@kmKm™¯IUmkXWWkaƒbkImJ™UkL±aVƒb@lWXkJƒUkƒĉkƒ@UmU@a™KkƒVƒUkJlaU_™yƒ@UU@aUU¯LW`kLWnkJó™ƒbUƒbmK@aU@UVVL@VƒL@„UVULƒK@xUL@VUV@nml¯@UkmKUxmbVbUV@XƒlXVmnVbkxUbU@ƒbm@@VUlUVšb°@VX¯šm‚"],"encodeOffsets":[[114615,40562]]}},{"type":"Feature","id":"1405","properties":{"name":"晋城市","cp":[112.7856,35.6342],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@lV„Lšb„an‚LnKVašLVašL„UVaUm„aÆLnLlanKVaÆI„a°x²UlmVVœX˜wUKna„@Vn„J‚a„L„a@UV@@alUkKVKnkmmVwUk„w@ƒ™@kxWUXƒW@@mƒk@aUa@a¯aƒLkKmwkUm@kL@K@aWIXmƒVƒXƒWkUVakL@UVKƒw@aUK@UUKmLU@¯n™KUwVƒUIWJUWmka™@UXƒJƒk@UkmW@kLWKVƒx@bmI@VUaVU@a¯@UUmVKmX@±`kÝKVxUL±akL@V™bƒLkKmVƒ@XWVUbƒVXb@lm@@lW@@xk„lVUbnnmbUšlJ@„@L„@@V„b@‚WXš„UlkxVV@„šwn@ÜmnLlVkzƒ`UbmL@Vš@XL˜m„VnIÞ@VU°x@VnL˜x„V@LU°"],"encodeOffsets":[[115223,36895]]}},{"type":"Feature","id":"1401","properties":{"name":"太原市","cp":[112.3352,37.9413],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@„@VV@wVKnLVal@na°nšaVJœUlm„L°a@b„@lx@bULUlmx@Ln@lVkn„l˜@XI„w‚K„Vnƒ°aVXVx„ƒUaVU°K„nUlšUVL„KÆVš²Ģ‚lnXalLÈƘL„KUaVkUanmWU™a@WwkUWU¯y¯Ñ@anIl@@aVU„m„I„ymUƒLUUVakaU@@LmJkw±LKmVUI@W¯™VaU_l™kbW@kK@mƒUkaVƒmVaU™ƒIVmalk™W@wnIVy@klkWUU›VI@ƒƒUƒVkam@knU@mmmK@bblVUX@VkLV`@n±KU„ULƒ‚UnVVńUbÇKmV—Imbm@k¼ó@Ul™b@VmV@bXmaƒK@›UUxkV‚V@„xW„UxVnkVVJ@XnJ@XlV²LƂVbnL@lš@°"],"encodeOffsets":[[114503,39134]]}},{"type":"Feature","id":"1403","properties":{"name":"阳泉市","cp":[113.4778,38.0951],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@°@nb„@lb@b„b„b‚@„x²al@lb„KXU@m‚kUWkkmUUƒVwV@XUW@™naVklKXblKnL‚ƒnLVanImaXKlL„ašV@U@KUKW„alƒXK@£WKXUV@VU„ƒUUVW„_V™@W@@K„@šƒUƒƒIWmXUmƒULƒn™JkImmÝaUbLƒK@UƒWk@mn™Uƒ@kVWb@Ubmx@lƒzUxƒ`U„ULml@„XWlƒ@UV@nk@U‚Vb@X™Jm™@@Vknƒyk@ƒzƒJƒnUV@bk@mJ@b°Ò°zXVlVXx‚@šbXVmnVbUlVb"],"encodeOffsets":[[115864,39336]]}}],"UTF8Encoding":true}; +define('echarts/util/mapData/geoJson/shan_xi_2_geo',[],function() { + return {"type":"FeatureCollection","features":[{"type":"Feature","id":"1409","properties":{"name":"忻州市","cp":[112.4561,38.8971],"childNum":14},"geometry":{"type":"Polygon","coordinates":["@@Vx@lnbn¦WlnnUšmš°š²VšV‚VVVnUn„ºlz@l„„@Jƒ@kXWVXl@Lƒa@„ƒKUL„ŽlbnKlLnK‚LnKÆXn°šbVV@bUVl°Un@LnaVJUbW@UX²l‚@ČwlVVIšWnkÆa°„„anV‚Kn°™UW¯@™aVUVk@Un@„aV@ValwUanmWU„k@WVUUanaVwnLVl°@nk@mVU@UVK@w„LVKVU@ƒ„K@UUKVUV@@bnL„a‚V„aôšlIXmlKX_°KVV@bVV„@šzV`kblI„V„Ul‚šL@bnV@V„Ċll„„VlIXW@k„a‚U²blKšVnIlJ„albXXlWVn°JnšnL@l@XlJlaX@„X˜W²@l_VmnKšU„blU@mnkVK„¯@U@ƒma@kX¥VƒmakkƒLƒa@aƒ@WIUUVXWWnk@a°a@kkm@kUUmJm@WUUUIk`m@V—kaWWkX™KmƒXk¯ƒ@WKƒLkak@±bƒw@ƒaƒa@akaƒ@ma¯@ƒL—KÇÅkKWbkmġ™±ÅUƒLUK™VVkƒm¯LUVVbƒ„UwUW¯bm„ƒULƒxWJ—@ƒklmkUm@@KnwVkVK@akwƒ@@a¯bƒKkn›VUI™b¯mmbk@UbmKUL@xUUƒ@klmLUŽlVXI‚VVVUVUœU`mLXVWbXnW`Ų°xmŽxU@mĉƒƒwU@mbU@UƒmbkVW¦kJ™@ƒX@`¯Im@UlUVVnb@bWJXnmbƒJUU™UUaƒ@UamIkaƒxƒ@@x@b"],"encodeOffsets":[[113614,39657]]}},{"type":"Feature","id":"1411","properties":{"name":"吕梁市","cp":[111.3574,37.7325],"childNum":13},"geometry":{"type":"Polygon","coordinates":["@@@a@w„@„wlbnJVb„@VbšVVV„InaWmXI@a‚aUmVUVkn@°J@_„Wš@lIX¥lUnaV„V@naV@„xĊ„n‚V@‚wn¯wƱX_WmXaWUnKV_V›VUUUUWJkUVnKlk¯™@@kmKUaŁ±KkU@WmI@WUIlUUmVwXƒ‚w@ƒUlUVwœV‚@„Lnb‚W@anU@UšaVkô@l»n@na˜JnUÈLVaƃUUVm„VKVƒ²L@mU_lK@UVWkU‚a@a@U¯aUaƒÑóÑUb™„ƒKk@@aƒk¯mVaUwVƒÑkWUmK@UUKmXUWÝwUa™LUU@aWJUUU@Ua݄U@WL@VKVaVI@WnU@alIVKƒƒ@kIƒmIkJ@™m@ƒ™@@_™K@xƒ@kaW@U„@Vmn@ŽUK@mIƒJUXV¤XXWlkKƒkkK@XmJVakImJU@ó™¯LWKUV@nUVƒLkxmKkLma@kXKmmƒLƒab™LmK@V@mXVÆUxƒX@`nL„aV@@VmLUVnLlLš˜„b@„šŽ°²nx@b‚VUxlb@V¯bUV@zV‚XVĊXVx@lVn@VnnmŽUš@LlJXVƒz¯VWVXbšV@bmn™VUVk„Çþń@XVxmbUlV„Uln„W„@„Xl‚@VLXÒ@bÞJ°¦„L˜ò„@nU‚b@°„X@ŽXbmVU„V„nb@x‚x"],"encodeOffsets":[[113614,39657]]}},{"type":"Feature","id":"1410","properties":{"name":"临汾市","cp":[111.4783,36.1615],"childNum":17},"geometry":{"type":"Polygon","coordinates":["@@nW‚@@UnLšK‚a„b„KnnWL@lnblKnLlw„KVU@mVUXL°KôšV@nIlJUbnI@WlL„llLXkWWU£VW„InJ‚@VL@nm@UVƒX@lb„@@wšL@`‚@„šn@V@lw„@n„VmVX„WmwnUlƒœa@_lK„wVlUn°xVKVXXWlUšVVI@K@K„n°KœwlVlU@kna@V_„Wn‚m„UVm@kXml_@m„LlKXw°m@_ôJVUV@X™l@UaV@Va°I„lk»VwUkVmwUmmVn@V¯@KƒU—wmK@U¯wUVÝ@mJƒU—nWK™@@UnKVa„_lykUmKÛnm@™x@ƒUUlwVk™ƒXW@ƒa@Uƒ@@K@ƒkIV™nammVakUlƒ@wX@@kƒ™¯@ƒVVbml@„„°UbULmlVbnbÅK±VƒKVXUJWa@ULWaUU@@U@aWK@UkxUKƒLUUUJ±UkL@V±kk@kam@UV@l@LWl@n@VVUx„LlUUx@VUV™U@aƒIUl™L@°mLU‚ƒbkUUaWUUaUU@aWK—LWJ@bUL@VUVVbU@m@a@kmKmnĉlUK™XƒWUblb—xmIkƒƒU@xWb@lkšVx™LXŽmzVV@bklVVUzm˜@bk„@Vx@xlŽU„@lUbVnl@„Wxnl@n@ŽUbV„mL‚mƒb@`X@lUX@@xlnkLWaUJnnWV™Vn@l„@bULVV@l™V@XnJVX"],"encodeOffsets":[[113063,37784]]}},{"type":"Feature","id":"1407","properties":{"name":"晋中市","cp":[112.7747,37.37],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@@šlInJ„lJ„@‚„ULkJ@bmV@XUJUb‚L@UXKV@ރVbV@VVXI@bVVšKVbÞxVXnWVL@VnLV‚lX„ÒUŽVxUb°n„l@bl@„LšƒVaô҄ÒVb°b@VnLnnV@lmn@lb„U„V@„‚JœUVV‚Xkl@lUzmJ@xšXkl‚bUn„JVšUb„nU‚lb„V@nlLX@lakšV`Ub°š@XVJnU‚L²KlxnI@KV@lbUbVV„KnVl@„zlm@Uš@nŽšI@WUaVl@@mVU„@XkW@ƒnkVKVƒ„_Vw„y@knwVa‚@XalU„@šVnml@„X@V„L‚KVaÞbnnlJšI„mVKn„VVVInVlU„@„m@™mXK@UmyUI@mWUUakamw@wUwmLkakwVƒmK™w@wUam£y@am_ƒW@™UU@knmm„amU@WUa@knw@ƒUUUUV@nƒJm@mVUkKVUUUkKmwƒKULƒKUImV@lUn™nŽm@mbUK@°™bUnmbUmkkƒWUb@am@UXkK@a±@™V™@ĉř„V‚UXVxUVkLWl¯@@bULUlm@@nm`—XƒlWakIkm›VUbUL@Vm@kIƒ@@Kšm@—VaX‚I@W@aU@kUƒVU_™KƒbƒJkkǎ™b@nkKmL™wÅW@kVUUƒVU@WUIƒJmIXmma@_kyVaUUlkUm@ƒkU›x¯Lƒm@L@LUJ™UkVWXUWUL¯wVmUkƒxkL@`›bk„mVnxƒXUWUnmƒƒ@kxU@"],"encodeOffsets":[[114087,37682]]}},{"type":"Feature","id":"1408","properties":{"name":"运城市","cp":[111.1487,35.2002],"childNum":13},"geometry":{"type":"Polygon","coordinates":["@@„Vl„nJ˜wkaVa„XšWVLĊknmnL‚l@@bn‚V@UaVU@UVK@aXI˜KXL@bVVVbXVVblV„aVnK@¯šKVk„J@bšVVU@UVwkVƒKVwUUm@@Xk@K@kVUn@lbl@²l@UlK²VVIVV„KVLlw@VXL@b@VV@VŽXbVK‚@XbVIUW„L‚U²ÆLmaUankVKVaƒ¯@ƒnkUa„U°@„š‚n@@kWa„UVaXUW@IXKVw@U™ƒ„™WU@W@@UUƒU@mn@ƒ`m@UUULkUmJ™IUƒ@@UƒK@U@›anƒ™ak_@wmKUwmakV™kmK™V™k¯b™wƒ`kwUIÇx¯»ÇaŃmn@@™mƒmUkV@wkKW@kxmL™UkĉLÝk™xÝw¯lóVU„mV@ĀVVX¦W¤kz@`Vx°„²ĸ‚š@„Ul@x„êĸNJ°¤V„VlXLWnXxmV@nUl@„"],"encodeOffsets":[[113232,36597]]}},{"type":"Feature","id":"1402","properties":{"name":"大同市","cp":[113.7854,39.8035],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@²£šyl@Ȑ˜Ė@bĸŽĢbĸ„˜X„a‚KŤnn@ŎôllÈx„nVnÞDŽV@b‚nXllL°KšbVb@J@b—„‚„@ŽU„„xlKXLlKlXk„@Ulk„JlkUƒVKXUƒÇVIVm@_nǚLšašl‚w„VnU@UUwma@aƒaÝaLmUk@@Wƒ@U@@X™wVWÝUUUk@@VmLƒKV»nwUw™aUL@`mzƒJUIVƒUaUw™KUaVIlJôanÑlLVUn@ša„@VV„@@UUwVK°Vn_lJÆLœéW@UUUÅ@»lm@aÞIVwXW˜UUkkm@U@aƒU@mwU£VWU_kWmƒXwW_°yUkkK@UÇK@kkUVymóK—U@KWIƒbUak@mJ@bkbmLkŽ™UmƒkVU„W¦@lnb@„@Vƒ°ULml@nkVƒa™VmLUnk`±@—XƒWW@kbǦXŽ¯„WxI@xmbmxXlWV„„@bŎUz@J‚b@bÞb™ŽU@Wbk@ƒxk@WX¯VۙƒWÝbÝUkVUU@alI@a@akLWa™m@U¯UUmÇL@K@aU@¯VUkƒKmX@`@œkJ@nV‚Ub@lbVÆXVW„ULU`VbkLUV@XWl@bXJ˜@VbV@Vl"],"encodeOffsets":[[115335,41209]]}},{"type":"Feature","id":"1404","properties":{"name":"长治市","cp":[112.8625,36.4746],"childNum":12},"geometry":{"type":"Polygon","coordinates":["@@Uk™Lky@I‚JVa@mÞaWšy@_W@_WƒXVlUVwš@nw°K@m„UƒVaƒmVkU@mmmnLVUmKXa™U@IlKVUnK@UmWkX@WV_Vƒ@akU@a„KWIXyƒIUVmUn™Ua@WaXUVKVmkUWVkUƒLU@@VƒbƒKbƒIUmƒ@mbVL—x›WUUkn±V¯wƒbÅJUbmLkbmKÅKƒbVnUbƒV™KUb™KUbmLKmƒb™aƒKkUm@UŽnn‚VnxUVlUxl¼ƒk¯JUbU@Vbk@WšU@UVóI@`¯nWxkLƒK@nk`Wn@lUnƒVnm‚ƒXU`@mb@lkV@„VnklVVUblz@`nbWnnJ„IVJ@XUVV„UV@lÆXšxnKlL@mšaȍll„I„ašLV`„UlVV@@b@XJWUb@˜™n@L„@lJn@@UVKVaœUlnlJXb„k˜Wn_@mn@VkVK@a°@XklKVUUwVWUšƒĊƚ@šU²@@blLVWn@@bVa„XllVnnaVmša@¯VLnan@‚šmVm@knUVJ"],"encodeOffsets":[[116269,37637]]}},{"type":"Feature","id":"1406","properties":{"name":"朔州市","cp":[113.0713,39.6991],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@XXWVXVWnnlnn@èƼ@„„xlš„ŽV„nblšššVŽÈUVl‚š@„blnœL܃ĊmUkU@Ua‚—@WI@aXk@WVUlKUaV_VKXƒWUUÅka@VaU@mlI@›@_nW„LVl°UV@@b@LÈKVn°V@VšnXblK@b@bkJ@bVVlUÞVÞa„Xܚ°UXWl@„wl@XaV@šÝa@aa@IVyƍ@aƒƒXUWknwna@w‚JXw°ƒWÈ¥kI@W@kmKm™¯IUmkXWWkaƒbkImJ™UkL±aVƒb@lWXkJƒUkƒĉkƒ@UmU@a™KkƒVƒUkJlaU_™yƒ@UU@aUU¯LW`kLWnkJó™ƒbUƒbmK@aU@UVVL@VƒL@„UVULƒK@xUL@VUV@nml¯@UkmKUxmbVbUV@XƒlXVmnVbkxUbU@ƒbm@@VUlUVšb°@VX¯šm‚"],"encodeOffsets":[[114615,40562]]}},{"type":"Feature","id":"1405","properties":{"name":"晋城市","cp":[112.7856,35.6342],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@lV„Lšb„an‚LnKVašLVašL„UVaUm„aÆLnLlanKVaÆI„a°x²UlmVVœX˜wUKna„@Vn„J‚a„L„a@UV@@alUkKVKnkmmVwUk„w@ƒ™@kxWUXƒW@@mƒk@aUa@a¯aƒLkKmwkUm@kL@K@aWIXmƒVƒXƒWkUVakL@UVKƒw@aUK@UUKmLU@¯n™KUwVƒUIWJUWmka™@UXƒJƒk@UkmW@kLWKVƒx@bmI@VUaVU@a¯@UUmVKmX@±`kÝKVxUL±akL@V™bƒLkKmVƒ@XWVUbƒVXb@lm@@lW@@xk„lVUbnnmbUšlJ@„@L„@@V„b@‚WXš„UlkxVV@„šwn@ÜmnLlVkzƒ`UbmL@Vš@XL˜m„VnIÞ@VU°x@VnL˜x„V@LU°"],"encodeOffsets":[[115223,36895]]}},{"type":"Feature","id":"1401","properties":{"name":"太原市","cp":[112.3352,37.9413],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@„@VV@wVKnLVal@na°nšaVJœUlm„L°a@b„@lx@bULUlmx@Ln@lVkn„l˜@XI„w‚K„Vnƒ°aVXVx„ƒUaVU°K„nUlšUVL„KÆVš²Ģ‚lnXalLÈƘL„KUaVkUanmWU™a@WwkUWU¯y¯Ñ@anIl@@aVU„m„I„ymUƒLUUVakaU@@LmJkw±LKmVUI@W¯™VaU_l™kbW@kK@mƒUkaVƒmVaU™ƒIVmalk™W@wnIVy@klkWUU›VI@ƒƒUƒVkam@knU@mmmK@bblVUX@VkLV`@n±KU„ULƒ‚UnVVńUbÇKmV—Imbm@k¼ó@Ul™b@VmV@bXmaƒK@›UUxkV‚V@„xW„UxVnkVVJ@XnJ@XlV²LƂVbnL@lš@°"],"encodeOffsets":[[114503,39134]]}},{"type":"Feature","id":"1403","properties":{"name":"阳泉市","cp":[113.4778,38.0951],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@°@nb„@lb@b„b„b‚@„x²al@lb„KXU@m‚kUWkkmUUƒVwV@XUW@™naVklKXblKnL‚ƒnLVanImaXKlL„ašV@U@KUKW„alƒXK@£WKXUV@VU„ƒUUVW„_V™@W@@K„@šƒUƒƒIWmXUmƒULƒn™JkImmÝaUbLƒK@UƒWk@mn™Uƒ@kVWb@Ubmx@lƒzUxƒ`U„ULml@„XWlƒ@UV@nk@U‚Vb@X™Jm™@@Vknƒyk@ƒzƒJƒnUV@bk@mJ@b°Ò°zXVlVXx‚@šbXVmnVbUlVb"],"encodeOffsets":[[115864,39336]]}}],"UTF8Encoding":true}; }); -define('echarts/util/mapData/geoJson/si_chuan_geo',[],function() { - return {"type":"FeatureCollection","features":[{"type":"Feature","id":"5133","properties":{"name":"甘孜藏族自治州","cp":[99.9207,31.0803],"childNum":18},"geometry":{"type":"Polygon","coordinates":["@@ƒaXamƒ¯wm@±°wUwV@UaVw²Kš™„U@UƒU„¥‚a„ƒ@£Þ™ôx‚Knkm™X¥™IUƒÝUwlk°V„@ƒÈ™‚KUwlkUyV¹„mšx²Xll„ÑW»š„l„w°UŎ„nƒ„„˜Jœƒl¯°V@wôIVÇn™nUllšLšVǚLô¼XW£@±„@¥k_ÇJƒkUéƒkšƒƒwXa@ƒšLlw²™Vx„b‚mš¼ÈxlLȃ„VWÞn¯mǙÑUÝlÛkwlĉmƒULmwUJ™ç@wkm@ÑlUX™ƒÑôġƒVa™ƒUф¯@wķÓkbV„mnU@@y¯IķKƒV@¹šaƒé@k„mÞU°¥@a¯@anKlblU„¥@óğç@Çw@wkla„çݱk¯±@ğÝUÛmݯwƒ@kb±¯akXWÜkXUÆÇUš¤X_Ɛw„V@¤ƒXU‚ƒbUƒŽƒIUlÇUkŽġ@™aXČmlUlèUV@„mVk¦Vxš@¦±š¯ƒƒ¯¯anlWš¯nƒƒÅw@w°KVak£m@klƒKknÇU™»óKšīlaUaV£@™™¯@ƙU™VƒÛÝÇXƒÇl—ÓlŹ„»WUğJ¯£mx™Lĵô›ºX„VlUll²bl„„lŽƒxónn°ÝšU¼mJUš¯nƒƒƒV@êĉ°Uĸ™w™@mƒ@¯kmXamѯaUwÝKU¥„mÅn¥Wmn™ƒ¹n±ƑƆÇôXê±NJnšƒ‚UôlĖkȂVÒ¯¼VnƒȮ¯ĀnƆ˜Ģ@Žk°V°¯ĢVlkšVxm¼X²™Ŏ@ŽVxknWÜ°U‚¯n™Æݜ@`„ôݲÒƒ‚Çzn‚mX@x„è°K°Å„UČĬóĖ݄ƒ˜ó¼ÅêƒÒƒbmšk@V„Ž˜„@ҁl@nĉܛê—x@Ėml՛J¯¦óxȭ°ÝmŽ¯Lĵè›Ā@Ɓ„l°żƒ‚šX@xmŽkV@z@‚„°blŽnÞ°J@bn@ƼUVƒUóŽóLƒ°X°ÝLƒxUn„°ƒĬƒn@lnL@ŽÆ@šn„KÆxnUnV˜InĬmÆnxŎ¼ĊIĢóÞ@ĊƒƨbUƒ‚mV¥lkƒ‚wnL„mšÅÆ¥Xƒ˜wU@w‚wUÞ™@alUUŚU™Vkkm°aU—°Ó°w°U„ƒ„b°aš²K˜¯œĕ˜@ÈbޏĊaš»„XVm°In„‚Ĭk¼Vb„ašJšôš£VĊan™‚k„ů™™nƒÜU@anKnĮ‚bÈmƎš»nI‚霣Ġ™"],"encodeOffsets":[[103073,33295]]}},{"type":"Feature","id":"5132","properties":{"name":"阿坝藏族羌族自治州","cp":[102.4805,32.4536],"childNum":13},"geometry":{"type":"Polygon","coordinates":["@@l@@þ²I@lƒ„VL°wnJ°Uĸ™Ŏè„Ilw„V°¤nĮ™¤Ý„lè„L@„ƒ„@x„l™è²ôĊ_ĊġVÈôJżīlbXšÆÈVŽkxÇVƒ„n°„¦Üb@è@nn@@°šUÈ¥WDŽ_Uala¯¯UǙkƒ»„mVwk»˜k²°VxlL@¤œ_@x‚`ȍ‚Ėöb˜š@l²alX„a@bnK°¦VK@nnWmx@nUnl@@lƒlĉk°l°UXkmW@Unš`k„ÇL„ŽW„ÛÈVxšVVlVk@l„IXb@ylXÈW˜Į„WŤzœy@šmIƒŽ²šJ‚š@nŽ°@V„„J°a„Å@ƒŎkVǚk™aUw„KVw™™Vƒ„@nkm™@±ôkô™ĊJš¼šInÑm±nIššÞ‚XȃĊxĊUÈbÜyÈ£Vkw@kVUV™„m@ša„»ÜbÈmƒUXwÝxƒUn¥@°ġ™Å‚aœJVk™aW¯Û@W¥—UŏĶ™@¯kUƒŃ@ašI@mmanwސ‚W@œ™mw°»Uřk¹±W„xVx¯¦U°ƒzţW™w@°ÇVÑk¯@„y°aš£š@šmšnl¼„ašÝÝakwUƒ±aĉImlĵn@ƒm@kkVƒ¯Ñm™ĸ™°x„l™œ@˜ƒXVÞmlÛݙĉUÅ¥mwÅ¥VaUw›™XġċaVůÛŹlwU¯U™ó±™xÛV±¯¯n¯mċƒLmnĊm‚™@™_kJWaXmwUƒĉK™»™@mwX݃UDŽkKÇw™»nƒaUw±škx™K@„Wb„x™„„lVê„lÈIl`@¦ƒŽ@²X¤Wó»™KUșŽ™KkkmVmšUÈóJ@x¯Uk°›„—Iƒƒm„ōƒ¯Vƒxƒk™ŽX¼ƒÒkk±W™wƒnUºVzklVxLǚ@„ƒŽ¯UklVxސV„šJW¦nšmlLówݚ@¤ƒ„bƒ¦„V@VƒV™š±LUxVbU@Vx¯x@²n‚°xn„Wb„b"],"encodeOffsets":[[103073,33295]]}},{"type":"Feature","id":"5134","properties":{"name":"凉山彝族自治州","cp":[101.9641,27.6746],"childNum":17},"geometry":{"type":"Polygon","coordinates":["@@ĶóšKnw°¤ĠIXVƒ¼kź˜Ôk‚„ÈWŽÞȄÜUVšÅš°@šš‚@U¤Vbkb™ĬôLš¼ÈVlm„Llkn@l¤Ub¯L@xÆx„„°mX™mk°b„°°„²™@¥‚™Uwl¥nU@ƒVUkçVnkWċšbĢ@lÈVVk„J„‚V„aV„W@£ƒUƏxW`™£ÈVVÅlWXÛlW°b²la„@°xnÞVÜĠÞ²@l°Þ²ƒèkblŽ@xÈx@Ġènal£nU‚Dz@‚ÞK„nn¤@¼˜°U¼„nV‚šXU‚šbn™ĠUVbUlVš°LX„@lV„èÜUnK@_ƒyXVyUwmIU»Vƒ„kÇ¥šÿkkV¯m±n@ƒn¯ÜanVVƄz@Ž‚bœwÜb„m@wša@kƒmk»@™a@VUUó„w˜@nb°mš„XŽmnVbގVôanwšJ‚ak£lw„˜šLšÅnÝ@wl¥IÇӃ@U™™Lƒ¼kVǃÅó¯kVmmw@ƒn_‚Vn»°LÅ»@éÇçŹīVÇÝ@ÝğU™ƒaVݙ™š¯ķlŭġlƒ@óÞۂċ@¯nkUӄ—m±™IVġUwóKUn±¯—K›w»ƒKݐV„nl@„óxUwţ›£ĉƒUmŗÇ݃K™„ÝUlmKƒ£UVŽ@ÞȎW¦„Ò@Ĭšnny‚@nÒmœVŽ—¼@°Vbl@VlnUUwl™°a@„œ„@llnk°lbnKWĀnŽU„VxUŽ‚²Å‚m¦Û›ÇŚƒaU„Vbš@¦m`móX™Umm™xÅ@±Þn虲™U¯»m™ƒV—m@wƒU@wݚÝmLƒa@„™VÇUk„l°¯„VlkVƒ¦UšmxƒaULUèVx@„kIUxmWV¼¯VmȯšU„nl›È—@m»Å™ƒVWxÅbÅğW@kƒm@kVV¦mlnn@‚ō„l¦Åƙxkœ"],"encodeOffsets":[[102466,28756]]}},{"type":"Feature","id":"5107","properties":{"name":"绵阳市","cp":[104.7327,31.8713],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@„ńlV°š@Őĵ˜VX»ÆUĊќJ‚w„@È»m»š£°Kšk@ÇnÑƍš@„w°JUwnw@wšbVbš@VlźLUw„aƒ»„aUklyUUVakwWXwWƒUxkLƒmn¥mšwk™˜UX™lJ„w@aƒIk°X„¥Wƒ²l¥šaU™„IlmkklƒÈL@m°nlWU™aW—š@Vƒ„@UaV¥@ašk@Çk¹ƒK@a™K@kƒKkšÇX@VU@kx±V™èkIWwUVUkkKÇ@ƒa@wkml¯@kUWn£Wa„aVwnaV݃w¯@UaWx—n›JńUxUšma@L@„mbUŽU±VVnkxUƙ„VŽm@kkKW°„X@¤ÇUkÆÇnU¦¯ŽkƒmLVwÅK@UóbÇƁVƒ¦™L@‚±êX¦mVޚkÜÝnWU—„›@kšƒŽ¯wķšnš°ÒU„lln@@„ĶmnkĊJ²bV„lxÞb™Þƒbk»™m™n™@™¤¯bƒz@Žl°UÒ¯È@ŽšxŤX„yV¯°¥Uwƒw²XlºVŚ¯¼nx›š@ŽXݏmxnb@n™J@b"],"encodeOffsets":[[106448,33694]]}},{"type":"Feature","id":"5117","properties":{"name":"达州市","cp":[107.6111,31.333],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@Uxn°‚bnŽlUnÒƃnn@n‚¤„LnxlU„ššV@„Æl„x°XXxl`XœƒVW‚œL˜è—„±nÈbƒŽ°b@š²x°Kܼ°ĉ„V¦lJnU@¦šÞ‚JÞğ„mšLÞ»šxU„lb„VÆann„alŽ„VƍX@lnŎV„mU™maÅXƒa@aWmœ@‚£@wĉJVƒkk‚kkmƒnk@ƒmna@šal„Kš™‚J@Þwm‚ÅŃ@ambkUƒƒ@™™KUġKU@m‚ak¯±ƒ„a@aĉÑÅaVwšXlwƒ±—V¥l@@a™kƒ›@@£šmƒĉÝónWV@ŽnÝÇÇx—UmbƒaVkkk@m„@m°ƒÝýXm›akÅīƒ@@ƒmb@@xmšnbƒ@mxšŽkWL@ƒ¯b@WUXmWœWKkbm@kx™Xmm@LUl„xlêóK™nUš„all™LƒlLó°m¯JVšU„K„„@x˜K²Āô¦l°"],"encodeOffsets":[[109519,31917]]}},{"type":"Feature","id":"5108","properties":{"name":"广元市","cp":[105.6885,32.2284],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@ÆL„Ċx°»Ŧ¦˜W„™šLȄ@xÞKÜ°ÞnVxÅĀlÒnJ°a@w„V¯l@XWknKnw˜VȚ°XXa˜lX°VI°b„W„nšaššš¥@ƒw°™n@šyÆ@nkÞ@°¯lJn„°IÈl‚UšlXÅ@ķlUV¥VUUÝޙUUƒ@UwƒJUkĉm@ýƒƒlk™WUwVwWJk@VUK™lUkaVƒUƒmLk„m@ƒƒ@Uƒ›Ik`@„™UmlUkV¯ÇXKÝ_mm¯@Uƒ`kwmƒl¼±KV¯—¯Vk±Vk±kzma™KUnDZ™bk¦±ŽX„ƒ¦¯Wl„J@bƒxkIWš—Vlš™xnŽm¦„nlKVwX„WxXŽlxUbVVkzVlƒb„¼ƒbVxŹKUk™@Ua™a@xmxVx¯Iƒx™@ŎmÒ@șl¯L™¤n¼"],"encodeOffsets":[[107146,33452]]}},{"type":"Feature","id":"5118","properties":{"name":"雅安市","cp":[102.6672,29.8938],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@ln@xšèVInxVKn„‚ĊklxkÜVޚÒnÈm°nxš@š¼ĊLV„nx‚WXblIš`š@nmĉn‚KȄôÅlUÑmU„K²¹@ÇÅVÓůVýÞW„‚UVmX„ÆbnwšKUÿ‚™@UmmIUb¯¥Uwƒ™¯™Çmš™„çmanUm»UUƒl—kƒ¤ƒa¯bV™U_WĕmÇŚ±ĢUlƒUl™ÛVƒçkUƒ@WŽ¯KU™VkUağVmš™aV™WUƒmV»—¯@»m£ƒmÝLŽ±@ÈmVk¤mb@ôƒ¦kVkamL@b°‚@b¯¦ÝVƒn@l„ê™b@º„UĸL°J@zV@nmUƒlaĸÔ@xƒ°VҚ„Ub„‚óĢ„ÒWškV@Ò"],"encodeOffsets":[[104727,30797]]}},{"type":"Feature","id":"5115","properties":{"name":"宜宾市","cp":[104.6558,28.548],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@VlÈnl‚XnWLX`m„²nV‚@b°xĢçlnšVm‚nn„@@„°‚UzšlV°nޘÒkxl„w„`UnVb„mšL@albÞKÈۚmܼ°@Xǚ@wmW@ńKĊL„lV„šLVŎçÞL²±‚ğkw@Uƒy@¹lKX™lKVa@w™™Č@‚w@a˜ÇU¯n™@@wġak—™aō‚ƒƒK@Å»VakUWmķwkbğ¥mL™akš™@ġރ°¯xVVÞ@VšxVš—VWx„XlxU‚™@k²WVŃULmèULVĊklĠ„VœJVx±nŃ¯¦mwğ@mƒƒlğkkl±@kšUk@¯±Ç™Kƒ—kxl¤b™Imx"],"encodeOffsets":[[106099,29279]]}},{"type":"Feature","id":"5111","properties":{"name":"乐山市","cp":[103.5791,29.1742],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@kšVŽk„ššÆkšV²UlºÈIlxƒLXèÜlU„„XU‚mkƒbVè„x°@„@¼°Knnn@m˜ÆIUbnJ@bVI°b°±@nK@mVakkƒKl¯nbšmĸ„èl@VnÈl‚UUw„wmwnm°¥„L„™lLnU@Va™ImbkƒmK„ƒƒnk@mƒb™ƒƒLV„JVUUƒ„VnkVmb@a¯JUaÆkk¥„IW¥„Klw—ÑmÝU¯™kVy¯@ƒƒ@mmn™Ukmġè¯w@aU±mnƒW_XKWmkÇmUkóbUÝUanmW™ƒ¯nma—@ƒxVôUV@šb@‚l¼„n@l™b@xƒnÛa›xa@ƒyUÅmUÛbm°@„m‚n²U°ll™ĀȦƒlU„V¼nJVxUz‚W„z@`mL"],"encodeOffsets":[[105480,29993]]}},{"type":"Feature","id":"5113","properties":{"name":"南充市","cp":[106.2048,31.1517],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@ȲVmšLnblyl²²UUl˜°U°²L‚»„knlx„_VŽ°@nnÞ`WL°ÈUŽVlnkšV@ƒl_œJV„‚@„„n@lƒnKV£™Çšƒ„UV¯šm„@laX˜U„‚UbVx„@VkôJU°Jn™@™‚wUk°wnUƒV_nJmknmm¯Vwk¯ó¥±ÿ—L@wƒƒƒLVU™kU›bX¯mykI@a±Kk¦ULmaXƒƒVm¯ƒK—z±ƒklUIVbÇJšƒkL¯™l™ƒU™ÿ™UƒlUkJƒUmŽUUkVVklKk@@a™U@„™J„²ƒxƒ¦kĬ@¼±ºXnWb—xƒU@xƒx@lšL@b„Llº@șl@bU¦Vbƒ@U„™@X˜‚bVškX¯m@nÇKk„llknƒJVš"],"encodeOffsets":[[107989,32282]]}},{"type":"Feature","id":"5119","properties":{"name":"巴中市","cp":[107.0618,31.9977],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@V„U„lbkVšŽVLUŽl@XI‚ŽUxVxšXkl„„@þĊnVl„IVx„@VVݚVÞUVU¦kV@ĸWÆô²š@VÞnš@Vaôb²W@‚K@XUmÑUW°¯°Ina@y„_lWn¼lLUbô¼„Kla@™nkUyô—Æx°@šn£™Ý@¥mVkIU¥Ċƒ‚¯Û»¯L±w@™¯a„Ça²m˜ƒ—ç›KX„UW›k_Ww¯WƒwÅk@ƒ™Uƒ™kVmwƒK£@mmmńmÑkVmamnnlmIU`V„m¯xVlx@šmš¯IV‚óIUlƒ@UwVaƒ—VW‚kbƒ@™nU°ƒV™„šÈU¤"],"encodeOffsets":[[108957,32569]]}},{"type":"Feature","id":"5105","properties":{"name":"泸州市","cp":[105.4578,28.493],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@VVXwVKn„˜wnVƒn„l@b¯xmKUbVn°°X°@blLšènV„@Vn‚l@U„LnmmUna„VV_ĶV@wnJ„„l@@kkKVólaUwnJm„wUlm@ašUaôKVnJWbޚ@VšwVLX¥VVš_Þ`šw„WƒÞŹmmnIn¥Wƒ@k„WV¯@ƒ°kI™ŽƒLk¼Ç@k¤±Xk˜™nmݯUlÅÛKWV¯kƒlUwkLƒÓ™@U—@ƒ‚w@ġXV„˜WX„š@UbVbšV›š_kÇV™lU°lnwŎ¦ÞaƯnmm¯šU„™m¥nkVmkƒl_ó¥¯UÇl¯@™ƒ™L™kƒ`¯ķLUy¯@mw—¼ķ°ġ_řU°mlšnÇVUޚ„@‚ƒš_ƒJUnV‚UXšbl˜Ģb@x@mšV°—È‚b@‚xċ@šš@xUbkLWškL@º„zV‚@lxĠ±²"],"encodeOffsets":[[107674,29639]]}},{"type":"Feature","id":"5101","properties":{"name":"成都市","cp":[103.9526,30.7617],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@°n°m²°ÜUšw²ŽôVš°ŽVkxÜźUŰČb‚ŽĢlaÈL„»ƒ@k„wVǂ@„ƒnÛƻșUÝ°Kl_„V°Uš`Vbn@VbÈLšaVU@ƨ»V™nIl™šUUa„±lIk±š@VnKmÅ@WaƒK¦™lVōškK™Ý@maXÇmw¯IU‚@kƒVƒwUmVIƒƒƒç—ÿƒU±ŽÅ@¯È@xƒK@wƒLUbÇKō@mÝ£@yóUóóUxkI@WlIUaƒbƒaŽVĀ™LmxÅaWƒUnVƒÝXUþÆ°UÔÈÆ@±ºƒLnVVÒkóÆ"],"encodeOffsets":[[105492,31534]]}},{"type":"Feature","id":"5120","properties":{"name":"资阳市","cp":[104.9744,30.1575],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@„è„„UJVn„x„U@lV°JnxWÈnbÞ@šŽlLŎ™Ušk‚¥„LXbÆ@nŽmLU‚@zlbXmlnVynL„çšJVb‚UnómUnamU„an¥lKV_²aValWô„n@nƒ‚bVœK°¯VblW@kkƒlUnlV£°W@w„UXk°KVwƒmVkwVyVI@wkmƒVÅ_Umm@Uÿmbk£™xUaVw±V¼V¤kLWxU@Uk™bƒyƒXšómƒ°V@@zÝÒkKƒn™±U@@_VVkƒÇaVwnLWalm@@kkVVl™¦kIV`±n@w„Kƒƒk²™aƒVUUV¤™nkxmUkVWVnLUbVbƒ`kUU„mLU‚mX@`ÅbǚXbWLXŽ›n"],"encodeOffsets":[[106695,31062]]}},{"type":"Feature","id":"5104","properties":{"name":"攀枝花市","cp":[101.6895,26.7133],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@„b‚KÞnޙ@x„V@x˜n„Unš°¼šVš±mç²ÝÆ@šwnnšVWŽnôn_@¥‚™UaVƒ„bƙœÈ܎n¥Æ±VUwVƒmXÿmLkal¯km@k›ƒ@ƒ¯bkšVxmVUkk@Ua@¯˜»Un›mс@mz™m@īƒÑX¥Ç@ݙxU¦ƒšÅŽÇUkx@šlb„UWVX„mV@xĵĖ±@@Ž¯xUšÆLnÆm„šx@nXL±lUUVwKWak@WxkbšÞƒŽĉbUn@‚ƒ@@xó¦„Ŏ"],"encodeOffsets":[[103602,27816]]}},{"type":"Feature","id":"5114","properties":{"name":"眉山市","cp":[103.8098,30.0146],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@„šVx°¦VanJVnš@„b„aVbkJ@XlJVwôôôV@zÞ¤@nƎÈLVa„K@x„L@w°ÇÆ@²„V˜ĀœmWXKWașÆa@_nWVnKVƒlV„_UaVamKXUWwnmmwœÑm£@ynUƒkWƒĉUkWVkkV±çkJmkKƒšƒK¯¦mnnxƒxVxVÇkUmk@ƒçķ™nmak°„LllUb@nmL@‚¯²¯aUJ@amIVaÅJn—m@mm¯L@»ƒŽ¯@ƒwUç„anlVƒWVƒÛkWç„KkwÇJk¹±V™UÅl™™ġV™²ÈƂnXĖV`Uš°a„b„£˜l„kVVn¼mVnbƒè™šÈn°š"],"encodeOffsets":[[105683,30685]]}},{"type":"Feature","id":"5116","properties":{"name":"广安市","cp":[106.6333,30.4376],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@„VlIV‚„kšVšĀ„Vkš°šlK™„ÈIUaVJlk²„˜y„Ln°„UW„nbVKl¥²L@blJnzW°œalV°Inô¯‚K„kšKkkƒbV™šmôLkéƒwVk@KnnšWlwn@laXL›ŽnXVW@X°a@„XKl™nw„@man™@w‚@na@„„@ƒw™ĕġġ™wUkUWb@mk@™¦ƒ¥mUÛb±yÅn@bml@kV@„ƒlknVbmVnlmš—bÇk¯bWyk@V_UamJ@I—@WaƒVXamIVWkUkbVaƒUUxƒ@VnkVU¼›bkKUxmK™„@WšƒxnV@n"],"encodeOffsets":[[108518,31208]]}},{"type":"Feature","id":"5106","properties":{"name":"德阳市","cp":[104.48,31.1133],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@nUW¥²é@šK„¥‚UÈÅôa@VÆLUxnKl„°V¥ÈmlÅÈV@£ƒWX¯lLln@UšƒVÅlwUm²U‚VVna@ƒ@KnbV™VwƃœI˜mXwWƒkIVwÝĕVUa™IƒèmKUzkmWnka@y™@l²kJƒ²Vb™VkšmJUšƧ¼@UV™bÇKUam@Ua™_¯VƒUk`¯LVÞǚżm܃„@Uȃx@l„ƒ¼ÇKkbWŽœšVxUbƦnxƦĊV"],"encodeOffsets":[[106594,32457]]}},{"type":"Feature","id":"5110","properties":{"name":"内江市","cp":[104.8535,29.6136],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@²èlUUllXĊVX„„lmV@zn¤›ÒnxmnXxlUnVlwšmU£VV„Ušbl±„„ƒL@x²mU_lJš¥UklU@ln@‚kXbmKUxÈbl„UU@`V@š²„mlLÞÑ@yU@„¯ôn‚™„W„zšaVlV@XwlKU£‚»—aVaUwm@mwUVUwkƒlVDzLlƒ„KV™m_@ykUmƒ@mU™çkKmxkIU‚Ý„@LUJ@n±„kº‚LXb™¼@mmIXa™@mamnkW™ƒKUƒƒxƒ_U`UklwUw™mUbƒV™²ƒakbƒmkn@`„UmҙšVxUb™I™`UƒaÝÈ"],"encodeOffsets":[[106774,30342]]}},{"type":"Feature","id":"5109","properties":{"name":"遂宁市","cp":[105.5347,30.6683],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@ÞĖUxlJX„Vb°@„xUÞmbUxƒbXbm¤VX@lk°ln@x„bÈ@lLVlVUXxlJšç²UlwV@@UÈWl™„L„w@w„V˜wXaWm²¹@»lī„¥„wƒ±šI@ƒšV@bl@kLUllUVVn@mmU„wX™ċbVb@VUkbmamšW@kƒa@™™k@ƒlaUa™@¯b@šmmwó@@lkXUa¯°›LU‚am„m@óƒkXUb±bU`kLm¦ƒbnVmbnVmô"],"encodeOffsets":[[107595,31270]]}},{"type":"Feature","id":"5103","properties":{"name":"自贡市","cp":[104.6667,29.2786],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@lIÞDŽbVŽš_šJVaUwš™nуV@_lm„nla„bš±„UVašnVxkxVlV_„`„wV„„LšlXnmnbš@WbnJ@nš»WaKl¹²ƒ@mVI@KރVlJnw@aW¯¯¯UmVanL°w@aƒk„mmU—xmƒULWxUUÝKōèU™KUƒƒkĉKƒL@ÆnX@x™‚Wȯ@Û»™nÇÜÝLka@b™KƒnUaVmƒ_ƒxkƒLX¦ƒJl¦ÅlVb°I@bnaUŽmlƒUV„UVƒIUŽ„Kš„„a@nml„„ƒŽnLl„našJUbV@"],"encodeOffsets":[[106752,30347]]}}],"UTF8Encoding":true}; +define('echarts/util/mapData/geoJson/si_chuan_geo',[],function() { + return {"type":"FeatureCollection","features":[{"type":"Feature","id":"5133","properties":{"name":"甘孜藏族自治州","cp":[99.9207,31.0803],"childNum":18},"geometry":{"type":"Polygon","coordinates":["@@ƒaXamƒ¯wm@±°wUwV@UaVw²Kš™„U@UƒU„¥‚a„ƒ@£Þ™ôx‚Knkm™X¥™IUƒÝUwlk°V„@ƒÈ™‚KUwlkUyV¹„mšx²Xll„ÑW»š„l„w°UŎ„nƒ„„˜Jœƒl¯°V@wôIVÇn™nUllšLšVǚLô¼XW£@±„@¥k_ÇJƒkUéƒkšƒƒwXa@ƒšLlw²™Vx„b‚mš¼ÈxlLȃ„VWÞn¯mǙÑUÝlÛkwlĉmƒULmwUJ™ç@wkm@ÑlUX™ƒÑôġƒVa™ƒUф¯@wķÓkbV„mnU@@y¯IķKƒV@¹šaƒé@k„mÞU°¥@a¯@anKlblU„¥@óğç@Çw@wkla„çݱk¯±@ğÝUÛmݯwƒ@kb±¯akXWÜkXUÆÇUš¤X_Ɛw„V@¤ƒXU‚ƒbUƒŽƒIUlÇUkŽġ@™aXČmlUlèUV@„mVk¦Vxš@¦±š¯ƒƒ¯¯anlWš¯nƒƒÅw@w°KVak£m@klƒKknÇU™»óKšīlaUaV£@™™¯@ƙU™VƒÛÝÇXƒÇl—ÓlŹ„»WUğJ¯£mx™Lĵô›ºX„VlUll²bl„„lŽƒxónn°ÝšU¼mJUš¯nƒƒƒV@êĉ°Uĸ™w™@mƒ@¯kmXamѯaUwÝKU¥„mÅn¥Wmn™ƒ¹n±ƑƆÇôXê±NJnšƒ‚UôlĖkȂVÒ¯¼VnƒȮ¯ĀnƆ˜Ģ@Žk°V°¯ĢVlkšVxm¼X²™Ŏ@ŽVxknWÜ°U‚¯n™Æݜ@`„ôݲÒƒ‚Çzn‚mX@x„è°K°Å„UČĬóĖ݄ƒ˜ó¼ÅêƒÒƒbmšk@V„Ž˜„@ҁl@nĉܛê—x@Ėml՛J¯¦óxȭ°ÝmŽ¯Lĵè›Ā@Ɓ„l°żƒ‚šX@xmŽkV@z@‚„°blŽnÞ°J@bn@ƼUVƒUóŽóLƒ°X°ÝLƒxUn„°ƒĬƒn@lnL@ŽÆ@šn„KÆxnUnV˜InĬmÆnxŎ¼ĊIĢóÞ@ĊƒƨbUƒ‚mV¥lkƒ‚wnL„mšÅÆ¥Xƒ˜wU@w‚wUÞ™@alUUŚU™Vkkm°aU—°Ó°w°U„ƒ„b°aš²K˜¯œĕ˜@ÈbޏĊaš»„XVm°In„‚Ĭk¼Vb„ašJšôš£VĊan™‚k„ů™™nƒÜU@anKnĮ‚bÈmƎš»nI‚霣Ġ™"],"encodeOffsets":[[103073,33295]]}},{"type":"Feature","id":"5132","properties":{"name":"阿坝藏族羌族自治州","cp":[102.4805,32.4536],"childNum":13},"geometry":{"type":"Polygon","coordinates":["@@l@@þ²I@lƒ„VL°wnJ°Uĸ™Ŏè„Ilw„V°¤nĮ™¤Ý„lè„L@„ƒ„@x„l™è²ôĊ_ĊġVÈôJżīlbXšÆÈVŽkxÇVƒ„n°„¦Üb@è@nn@@°šUÈ¥WDŽ_Uala¯¯UǙkƒ»„mVwk»˜k²°VxlL@¤œ_@x‚`ȍ‚Ėöb˜š@l²alX„a@bnK°¦VK@nnWmx@nUnl@@lƒlĉk°l°UXkmW@Unš`k„ÇL„ŽW„ÛÈVxšVVlVk@l„IXb@ylXÈW˜Į„WŤzœy@šmIƒŽ²šJ‚š@nŽ°@V„„J°a„Å@ƒŎkVǚk™aUw„KVw™™Vƒ„@nkm™@±ôkô™ĊJš¼šInÑm±nIššÞ‚XȃĊxĊUÈbÜyÈ£Vkw@kVUV™„m@ša„»ÜbÈmƒUXwÝxƒUn¥@°ġ™Å‚aœJVk™aW¯Û@W¥—UŏĶ™@¯kUƒŃ@ašI@mmanwސ‚W@œ™mw°»Uřk¹±W„xVx¯¦U°ƒzţW™w@°ÇVÑk¯@„y°aš£š@šmšnl¼„ašÝÝakwUƒ±aĉImlĵn@ƒm@kkVƒ¯Ñm™ĸ™°x„l™œ@˜ƒXVÞmlÛݙĉUÅ¥mwÅ¥VaUw›™XġċaVůÛŹlwU¯U™ó±™xÛV±¯¯n¯mċƒLmnĊm‚™@™_kJWaXmwUƒĉK™»™@mwX݃UDŽkKÇw™»nƒaUw±škx™K@„Wb„x™„„lVê„lÈIl`@¦ƒŽ@²X¤Wó»™KUșŽ™KkkmVmšUÈóJ@x¯Uk°›„—Iƒƒm„ōƒ¯Vƒxƒk™ŽX¼ƒÒkk±W™wƒnUºVzklVxLǚ@„ƒŽ¯UklVxސV„šJW¦nšmlLówݚ@¤ƒ„bƒ¦„V@VƒV™š±LUxVbU@Vx¯x@²n‚°xn„Wb„b"],"encodeOffsets":[[103073,33295]]}},{"type":"Feature","id":"5134","properties":{"name":"凉山彝族自治州","cp":[101.9641,27.6746],"childNum":17},"geometry":{"type":"Polygon","coordinates":["@@ĶóšKnw°¤ĠIXVƒ¼kź˜Ôk‚„ÈWŽÞȄÜUVšÅš°@šš‚@U¤Vbkb™ĬôLš¼ÈVlm„Llkn@l¤Ub¯L@xÆx„„°mX™mk°b„°°„²™@¥‚™Uwl¥nU@ƒVUkçVnkWċšbĢ@lÈVVk„J„‚V„aV„W@£ƒUƏxW`™£ÈVVÅlWXÛlW°b²la„@°xnÞVÜĠÞ²@l°Þ²ƒèkblŽ@xÈx@Ġènal£nU‚Dz@‚ÞK„nn¤@¼˜°U¼„nV‚šXU‚šbn™ĠUVbUlVš°LX„@lV„èÜUnK@_ƒyXVyUwmIU»Vƒ„kÇ¥šÿkkV¯m±n@ƒn¯ÜanVVƄz@Ž‚bœwÜb„m@wša@kƒmk»@™a@VUUó„w˜@nb°mš„XŽmnVbގVôanwšJ‚ak£lw„˜šLšÅnÝ@wl¥IÇӃ@U™™Lƒ¼kVǃÅó¯kVmmw@ƒn_‚Vn»°LÅ»@éÇçŹīVÇÝ@ÝğU™ƒaVݙ™š¯ķlŭġlƒ@óÞۂċ@¯nkUӄ—m±™IVġUwóKUn±¯—K›w»ƒKݐV„nl@„óxUwţ›£ĉƒUmŗÇ݃K™„ÝUlmKƒ£UVŽ@ÞȎW¦„Ò@Ĭšnny‚@nÒmœVŽ—¼@°Vbl@VlnUUwl™°a@„œ„@llnk°lbnKWĀnŽU„VxUŽ‚²Å‚m¦Û›ÇŚƒaU„Vbš@¦m`móX™Umm™xÅ@±Þn虲™U¯»m™ƒV—m@wƒU@wݚÝmLƒa@„™VÇUk„l°¯„VlkVƒ¦UšmxƒaULUèVx@„kIUxmWV¼¯VmȯšU„nl›È—@m»Å™ƒVWxÅbÅğW@kƒm@kVV¦mlnn@‚ō„l¦Åƙxkœ"],"encodeOffsets":[[102466,28756]]}},{"type":"Feature","id":"5107","properties":{"name":"绵阳市","cp":[104.7327,31.8713],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@„ńlV°š@Őĵ˜VX»ÆUĊќJ‚w„@È»m»š£°Kšk@ÇnÑƍš@„w°JUwnw@wšbVbš@VlźLUw„aƒ»„aUklyUUVakwWXwWƒUxkLƒmn¥mšwk™˜UX™lJ„w@aƒIk°X„¥Wƒ²l¥šaU™„IlmkklƒÈL@m°nlWU™aW—š@Vƒ„@UaV¥@ašk@Çk¹ƒK@a™K@kƒKkšÇX@VU@kx±V™èkIWwUVUkkKÇ@ƒa@wkml¯@kUWn£Wa„aVwnaV݃w¯@UaWx—n›JńUxUšma@L@„mbUŽU±VVnkxUƙ„VŽm@kkKW°„X@¤ÇUkÆÇnU¦¯ŽkƒmLVwÅK@UóbÇƁVƒ¦™L@‚±êX¦mVޚkÜÝnWU—„›@kšƒŽ¯wķšnš°ÒU„lln@@„ĶmnkĊJ²bV„lxÞb™Þƒbk»™m™n™@™¤¯bƒz@Žl°UÒ¯È@ŽšxŤX„yV¯°¥Uwƒw²XlºVŚ¯¼nx›š@ŽXݏmxnb@n™J@b"],"encodeOffsets":[[106448,33694]]}},{"type":"Feature","id":"5117","properties":{"name":"达州市","cp":[107.6111,31.333],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@Uxn°‚bnŽlUnÒƃnn@n‚¤„LnxlU„ššV@„Æl„x°XXxl`XœƒVW‚œL˜è—„±nÈbƒŽ°b@š²x°Kܼ°ĉ„V¦lJnU@¦šÞ‚JÞğ„mšLÞ»šxU„lb„VÆann„alŽ„VƍX@lnŎV„mU™maÅXƒa@aWmœ@‚£@wĉJVƒkk‚kkmƒnk@ƒmna@šal„Kš™‚J@Þwm‚ÅŃ@ambkUƒƒ@™™KUġKU@m‚ak¯±ƒ„a@aĉÑÅaVwšXlwƒ±—V¥l@@a™kƒ›@@£šmƒĉÝónWV@ŽnÝÇÇx—UmbƒaVkkk@m„@m°ƒÝýXm›akÅīƒ@@ƒmb@@xmšnbƒ@mxšŽkWL@ƒ¯b@WUXmWœWKkbm@kx™Xmm@LUl„xlêóK™nUš„all™LƒlLó°m¯JVšU„K„„@x˜K²Āô¦l°"],"encodeOffsets":[[109519,31917]]}},{"type":"Feature","id":"5108","properties":{"name":"广元市","cp":[105.6885,32.2284],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@ÆL„Ċx°»Ŧ¦˜W„™šLȄ@xÞKÜ°ÞnVxÅĀlÒnJ°a@w„V¯l@XWknKnw˜VȚ°XXa˜lX°VI°b„W„nšaššš¥@ƒw°™n@šyÆ@nkÞ@°¯lJn„°IÈl‚UšlXÅ@ķlUV¥VUUÝޙUUƒ@UwƒJUkĉm@ýƒƒlk™WUwVwWJk@VUK™lUkaVƒUƒmLk„m@ƒƒ@Uƒ›Ik`@„™UmlUkV¯ÇXKÝ_mm¯@Uƒ`kwmƒl¼±KV¯—¯Vk±Vk±kzma™KUnDZ™bk¦±ŽX„ƒ¦¯Wl„J@bƒxkIWš—Vlš™xnŽm¦„nlKVwX„WxXŽlxUbVVkzVlƒb„¼ƒbVxŹKUk™@Ua™a@xmxVx¯Iƒx™@ŎmÒ@șl¯L™¤n¼"],"encodeOffsets":[[107146,33452]]}},{"type":"Feature","id":"5118","properties":{"name":"雅安市","cp":[102.6672,29.8938],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@ln@xšèVInxVKn„‚ĊklxkÜVޚÒnÈm°nxš@š¼ĊLV„nx‚WXblIš`š@nmĉn‚KȄôÅlUÑmU„K²¹@ÇÅVÓůVýÞW„‚UVmX„ÆbnwšKUÿ‚™@UmmIUb¯¥Uwƒ™¯™Çmš™„çmanUm»UUƒl—kƒ¤ƒa¯bV™U_WĕmÇŚ±ĢUlƒUl™ÛVƒçkUƒ@WŽ¯KU™VkUağVmš™aV™WUƒmV»—¯@»m£ƒmÝLŽ±@ÈmVk¤mb@ôƒ¦kVkamL@b°‚@b¯¦ÝVƒn@l„ê™b@º„UĸL°J@zV@nmUƒlaĸÔ@xƒ°VҚ„Ub„‚óĢ„ÒWškV@Ò"],"encodeOffsets":[[104727,30797]]}},{"type":"Feature","id":"5115","properties":{"name":"宜宾市","cp":[104.6558,28.548],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@VlÈnl‚XnWLX`m„²nV‚@b°xĢçlnšVm‚nn„@@„°‚UzšlV°nޘÒkxl„w„`UnVb„mšL@albÞKÈۚmܼ°@Xǚ@wmW@ńKĊL„lV„šLVŎçÞL²±‚ğkw@Uƒy@¹lKX™lKVa@w™™Č@‚w@a˜ÇU¯n™@@wġak—™aō‚ƒƒK@Å»VakUWmķwkbğ¥mL™akš™@ġރ°¯xVVÞ@VšxVš—VWx„XlxU‚™@k²WVŃULmèULVĊklĠ„VœJVx±nŃ¯¦mwğ@mƒƒlğkkl±@kšUk@¯±Ç™Kƒ—kxl¤b™Imx"],"encodeOffsets":[[106099,29279]]}},{"type":"Feature","id":"5111","properties":{"name":"乐山市","cp":[103.5791,29.1742],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@kšVŽk„ššÆkšV²UlºÈIlxƒLXèÜlU„„XU‚mkƒbVè„x°@„@¼°Knnn@m˜ÆIUbnJ@bVI°b°±@nK@mVakkƒKl¯nbšmĸ„èl@VnÈl‚UUw„wmwnm°¥„L„™lLnU@Va™ImbkƒmK„ƒƒnk@mƒb™ƒƒLV„JVUUƒ„VnkVmb@a¯JUaÆkk¥„IW¥„Klw—ÑmÝU¯™kVy¯@ƒƒ@mmn™Ukmġè¯w@aU±mnƒW_XKWmkÇmUkóbUÝUanmW™ƒ¯nma—@ƒxVôUV@šb@‚l¼„n@l™b@xƒnÛa›xa@ƒyUÅmUÛbm°@„m‚n²U°ll™ĀȦƒlU„V¼nJVxUz‚W„z@`mL"],"encodeOffsets":[[105480,29993]]}},{"type":"Feature","id":"5113","properties":{"name":"南充市","cp":[106.2048,31.1517],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@ȲVmšLnblyl²²UUl˜°U°²L‚»„knlx„_VŽ°@nnÞ`WL°ÈUŽVlnkšV@ƒl_œJV„‚@„„n@lƒnKV£™Çšƒ„UV¯šm„@laX˜U„‚UbVx„@VkôJU°Jn™@™‚wUk°wnUƒV_nJmknmm¯Vwk¯ó¥±ÿ—L@wƒƒƒLVU™kU›bX¯mykI@a±Kk¦ULmaXƒƒVm¯ƒK—z±ƒklUIVbÇJšƒkL¯™l™ƒU™ÿ™UƒlUkJƒUmŽUUkVVklKk@@a™U@„™J„²ƒxƒ¦kĬ@¼±ºXnWb—xƒU@xƒx@lšL@b„Llº@șl@bU¦Vbƒ@U„™@X˜‚bVškX¯m@nÇKk„llknƒJVš"],"encodeOffsets":[[107989,32282]]}},{"type":"Feature","id":"5119","properties":{"name":"巴中市","cp":[107.0618,31.9977],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@V„U„lbkVšŽVLUŽl@XI‚ŽUxVxšXkl„„@þĊnVl„IVx„@VVݚVÞUVU¦kV@ĸWÆô²š@VÞnš@Vaôb²W@‚K@XUmÑUW°¯°Ina@y„_lWn¼lLUbô¼„Kla@™nkUyô—Æx°@šn£™Ý@¥mVkIU¥Ċƒ‚¯Û»¯L±w@™¯a„Ça²m˜ƒ—ç›KX„UW›k_Ww¯WƒwÅk@ƒ™Uƒ™kVmwƒK£@mmmńmÑkVmamnnlmIU`V„m¯xVlx@šmš¯IV‚óIUlƒ@UwVaƒ—VW‚kbƒ@™nU°ƒV™„šÈU¤"],"encodeOffsets":[[108957,32569]]}},{"type":"Feature","id":"5105","properties":{"name":"泸州市","cp":[105.4578,28.493],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@VVXwVKn„˜wnVƒn„l@b¯xmKUbVn°°X°@blLšènV„@Vn‚l@U„LnmmUna„VV_ĶV@wnJ„„l@@kkKVólaUwnJm„wUlm@ašUaôKVnJWbޚ@VšwVLX¥VVš_Þ`šw„WƒÞŹmmnIn¥Wƒ@k„WV¯@ƒ°kI™ŽƒLk¼Ç@k¤±Xk˜™nmݯUlÅÛKWV¯kƒlUwkLƒÓ™@U—@ƒ‚w@ġXV„˜WX„š@UbVbšV›š_kÇV™lU°lnwŎ¦ÞaƯnmm¯šU„™m¥nkVmkƒl_ó¥¯UÇl¯@™ƒ™L™kƒ`¯ķLUy¯@mw—¼ķ°ġ_řU°mlšnÇVUޚ„@‚ƒš_ƒJUnV‚UXšbl˜Ģb@x@mšV°—È‚b@‚xċ@šš@xUbkLWškL@º„zV‚@lxĠ±²"],"encodeOffsets":[[107674,29639]]}},{"type":"Feature","id":"5101","properties":{"name":"成都市","cp":[103.9526,30.7617],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@°n°m²°ÜUšw²ŽôVš°ŽVkxÜźUŰČb‚ŽĢlaÈL„»ƒ@k„wVǂ@„ƒnÛƻșUÝ°Kl_„V°Uš`Vbn@VbÈLšaVU@ƨ»V™nIl™šUUa„±lIk±š@VnKmÅ@WaƒK¦™lVōškK™Ý@maXÇmw¯IU‚@kƒVƒwUmVIƒƒƒç—ÿƒU±ŽÅ@¯È@xƒK@wƒLUbÇKō@mÝ£@yóUóóUxkI@WlIUaƒbƒaŽVĀ™LmxÅaWƒUnVƒÝXUþÆ°UÔÈÆ@±ºƒLnVVÒkóÆ"],"encodeOffsets":[[105492,31534]]}},{"type":"Feature","id":"5120","properties":{"name":"资阳市","cp":[104.9744,30.1575],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@„è„„UJVn„x„U@lV°JnxWÈnbÞ@šŽlLŎ™Ušk‚¥„LXbÆ@nŽmLU‚@zlbXmlnVynL„çšJVb‚UnómUnamU„an¥lKV_²aValWô„n@nƒ‚bVœK°¯VblW@kkƒlUnlV£°W@w„UXk°KVwƒmVkwVyVI@wkmƒVÅ_Umm@Uÿmbk£™xUaVw±V¼V¤kLWxU@Uk™bƒyƒXšómƒ°V@@zÝÒkKƒn™±U@@_VVkƒÇaVwnLWalm@@kkVVl™¦kIV`±n@w„Kƒƒk²™aƒVUUV¤™nkxmUkVWVnLUbVbƒ`kUU„mLU‚mX@`ÅbǚXbWLXŽ›n"],"encodeOffsets":[[106695,31062]]}},{"type":"Feature","id":"5104","properties":{"name":"攀枝花市","cp":[101.6895,26.7133],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@„b‚KÞnޙ@x„V@x˜n„Unš°¼šVš±mç²ÝÆ@šwnnšVWŽnôn_@¥‚™UaVƒ„bƙœÈ܎n¥Æ±VUwVƒmXÿmLkal¯km@k›ƒ@ƒ¯bkšVxmVUkk@Ua@¯˜»Un›mс@mz™m@īƒÑX¥Ç@ݙxU¦ƒšÅŽÇUkx@šlb„UWVX„mV@xĵĖ±@@Ž¯xUšÆLnÆm„šx@nXL±lUUVwKWak@WxkbšÞƒŽĉbUn@‚ƒ@@xó¦„Ŏ"],"encodeOffsets":[[103602,27816]]}},{"type":"Feature","id":"5114","properties":{"name":"眉山市","cp":[103.8098,30.0146],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@„šVx°¦VanJVnš@„b„aVbkJ@XlJVwôôôV@zÞ¤@nƎÈLVa„K@x„L@w°ÇÆ@²„V˜ĀœmWXKWașÆa@_nWVnKVƒlV„_UaVamKXUWwnmmwœÑm£@ynUƒkWƒĉUkWVkkV±çkJmkKƒšƒK¯¦mnnxƒxVxVÇkUmk@ƒçķ™nmak°„LllUb@nmL@‚¯²¯aUJ@amIVaÅJn—m@mm¯L@»ƒŽ¯@ƒwUç„anlVƒWVƒÛkWç„KkwÇJk¹±V™UÅl™™ġV™²ÈƂnXĖV`Uš°a„b„£˜l„kVVn¼mVnbƒè™šÈn°š"],"encodeOffsets":[[105683,30685]]}},{"type":"Feature","id":"5116","properties":{"name":"广安市","cp":[106.6333,30.4376],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@„VlIV‚„kšVšĀ„Vkš°šlK™„ÈIUaVJlk²„˜y„Ln°„UW„nbVKl¥²L@blJnzW°œalV°Inô¯‚K„kšKkkƒbV™šmôLkéƒwVk@KnnšWlwn@laXL›ŽnXVW@X°a@„XKl™nw„@man™@w‚@na@„„@ƒw™ĕġġ™wUkUWb@mk@™¦ƒ¥mUÛb±yÅn@bml@kV@„ƒlknVbmVnlmš—bÇk¯bWyk@V_UamJ@I—@WaƒVXamIVWkUkbVaƒUUxƒ@VnkVU¼›bkKUxmK™„@WšƒxnV@n"],"encodeOffsets":[[108518,31208]]}},{"type":"Feature","id":"5106","properties":{"name":"德阳市","cp":[104.48,31.1133],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@nUW¥²é@šK„¥‚UÈÅôa@VÆLUxnKl„°V¥ÈmlÅÈV@£ƒWX¯lLln@UšƒVÅlwUm²U‚VVna@ƒ@KnbV™VwƃœI˜mXwWƒkIVwÝĕVUa™IƒèmKUzkmWnka@y™@l²kJƒ²Vb™VkšmJUšƧ¼@UV™bÇKUam@Ua™_¯VƒUk`¯LVÞǚżm܃„@Uȃx@l„ƒ¼ÇKkbWŽœšVxUbƦnxƦĊV"],"encodeOffsets":[[106594,32457]]}},{"type":"Feature","id":"5110","properties":{"name":"内江市","cp":[104.8535,29.6136],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@²èlUUllXĊVX„„lmV@zn¤›ÒnxmnXxlUnVlwšmU£VV„Ušbl±„„ƒL@x²mU_lJš¥UklU@ln@‚kXbmKUxÈbl„UU@`V@š²„mlLÞÑ@yU@„¯ôn‚™„W„zšaVlV@XwlKU£‚»—aVaUwm@mwUVUwkƒlVDzLlƒ„KV™m_@ykUmƒ@mU™çkKmxkIU‚Ý„@LUJ@n±„kº‚LXb™¼@mmIXa™@mamnkW™ƒKUƒƒxƒ_U`UklwUw™mUbƒV™²ƒakbƒmkn@`„UmҙšVxUb™I™`UƒaÝÈ"],"encodeOffsets":[[106774,30342]]}},{"type":"Feature","id":"5109","properties":{"name":"遂宁市","cp":[105.5347,30.6683],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@ÞĖUxlJX„Vb°@„xUÞmbUxƒbXbm¤VX@lk°ln@x„bÈ@lLVlVUXxlJšç²UlwV@@UÈWl™„L„w@w„V˜wXaWm²¹@»lī„¥„wƒ±šI@ƒšV@bl@kLUllUVVn@mmU„wX™ċbVb@VUkbmamšW@kƒa@™™k@ƒlaUa™@¯b@šmmwó@@lkXUa¯°›LU‚am„m@óƒkXUb±bU`kLm¦ƒbnVmbnVmô"],"encodeOffsets":[[107595,31270]]}},{"type":"Feature","id":"5103","properties":{"name":"自贡市","cp":[104.6667,29.2786],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@lIÞDŽbVŽš_šJVaUwš™nуV@_lm„nla„bš±„UVašnVxkxVlV_„`„wV„„LšlXnmnbš@WbnJ@nš»WaKl¹²ƒ@mVI@KރVlJnw@aW¯¯¯UmVanL°w@aƒk„mmU—xmƒULWxUUÝKōèU™KUƒƒkĉKƒL@ÆnX@x™‚Wȯ@Û»™nÇÜÝLka@b™KƒnUaVmƒ_ƒxkƒLX¦ƒJl¦ÅlVb°I@bnaUŽmlƒUV„UVƒIUŽ„Kš„„a@nml„„ƒŽnLl„našJUbV@"],"encodeOffsets":[[106752,30347]]}}],"UTF8Encoding":true}; }); -define('echarts/util/mapData/geoJson/tai_wan_geo',[],function() { - return {"type":"FeatureCollection","features":[{"type":"Feature","id":"7100","properties":{"name":"台湾","cp":[121.0295,23.6082],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@\\sŽ@pS}aekgKSu™SsMß`¡CqZ·be@Q^o@‹gieMp‹‰]}•}Ľc_Kk…{™ù“A¡r‰[uom@эĥJiq©mʼnq¯Bq]ÙYgSåk_gwU­isTE…“‘ĕiqiUEkue_‰OSsZ‹aWKo¡­q“ycY£w}‹ĩ™ĕS§Z©S™N¥SyLÑ¡±Ks^IY‰PdƒY[Uo†Fp}´\\¬\\j]ˆe܍ò‹¤¡–ā a\\bn™U㺹Ìs¼j®[cíȈEŽĝĆ`ļf¶Š®K|VØDdKGpVnU‚FjpH—F`†B’[pMºxÖjbpÎxp€¬‚|ΟÜÒCŠ²®‚ÜAp„ZG~€Šd˜ÞàV¨|¸€`|Œ²tx~\\~|dFf^zG€ĄŚhœdL\\hĸž¼†ŠOªP®lV`p\\]Xpll˜æ¤œCpQ|oF}fMRi†NSon_²qämœM„NM‹\\•"],"encodeOffsets":[[124853,25650]]}}],"UTF8Encoding":true}; +define('echarts/util/mapData/geoJson/tai_wan_geo',[],function() { + return {"type":"FeatureCollection","features":[{"type":"Feature","id":"7100","properties":{"name":"台湾","cp":[121.0295,23.6082],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@\\sŽ@pS}aekgKSu™SsMß`¡CqZ·be@Q^o@‹gieMp‹‰]}•}Ľc_Kk…{™ù“A¡r‰[uom@эĥJiq©mʼnq¯Bq]ÙYgSåk_gwU­isTE…“‘ĕiqiUEkue_‰OSsZ‹aWKo¡­q“ycY£w}‹ĩ™ĕS§Z©S™N¥SyLÑ¡±Ks^IY‰PdƒY[Uo†Fp}´\\¬\\j]ˆe܍ò‹¤¡–ā a\\bn™U㺹Ìs¼j®[cíȈEŽĝĆ`ļf¶Š®K|VØDdKGpVnU‚FjpH—F`†B’[pMºxÖjbpÎxp€¬‚|ΟÜÒCŠ²®‚ÜAp„ZG~€Šd˜ÞàV¨|¸€`|Œ²tx~\\~|dFf^zG€ĄŚhœdL\\hĸž¼†ŠOªP®lV`p\\]Xpll˜æ¤œCpQ|oF}fMRi†NSon_²qämœM„NM‹\\•"],"encodeOffsets":[[124853,25650]]}}],"UTF8Encoding":true}; }); -define('echarts/util/mapData/geoJson/tian_jin_geo',[],function() { - return {"type":"FeatureCollection","features":[{"type":"Feature","id":"120225","properties":{"name":"蓟县","cp":[117.4672,40.004],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@EUDAEI@WNMNCBFAHFFNACDJDPBD@@GD@DIFFHEFGDBDEQOFG@EI_KG@OcJQM]RMEKBGPG@[LaCIICBWKCEEG@WBQHCDFD@HSLEJI@IHWECFGAAEKCGDBFCBSBIDCKKHEADMJMFABKOKEQAA@IEEG@GIQAEK@OZEESMOL“lu@SLUTYFQCMG@@SQUAYKAACA@IB@BDB@B@DC@@BGAEFAA@BEGKJCC@AGAIHA@@JC@QEIP@@A@EGIDC@O@C@@@@CJCWKABFLBBEBSQGBAAMIEM@AKBcJEN@BEBCFMAEFEF@J@BG@BFABECKFG@AFQ@@F@BEB@@A@@AAAKAE@GFGDECEFEECBKIKDELDFEDYH@EIACDCHKBEB@BAAC@ADBHABKJIAIJICEDGDCD@@A@A@DHCHJHDFEFGBKRKBGIK@GIMHSBCH_BOJECCJCFKKMD@DNJEDEGC@OJCJHRUL@HRJ@H[DCNKDZHCTFDHCFFKR`TANVDFZRDLFARB@HPAPG`ILAR@TERNDFNHDLCLDDCXDYbHF@FEB@LDDVE@JPNfXPINCVDJJD@NJPAJHLXHDNANHhB@DPNLRMTBFRBHHr@`NBFEBOCCBIAQJDHCHLHFA@HSDCRLFTB@HEFLNF@PELBDJALFLTC@EPFLLP@tUHQJDfIHGTB^JTCPDLKAIBATFPADIEGECEMJ@JIAIHGECFEAGDI\\SPOXAFCL@BQTQBBTMZECYGAHA@GJAE@HCAEME@IECFKJADDBABLTHHG@ILEAMNDJCDHEBF@@JNFJELDFKTOT@JETBFFHBHEHKI@@IJEJ@XKEOUMS@AF@CEB"],"encodeOffsets":[[120575,41009]]}},{"type":"Feature","id":"120114","properties":{"name":"武清区","cp":[117.0621,39.4121],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@FWôµ@IFCLIB@EHNBp]AGEAKAEDMGZKFGBGME@ILGP@HEFB@BXMEAHUGC@IHCLOD@X[NWHWPKAEF[@EKIOL@EKGBNMJ@EIEHKBIC@BAKMIACCFQZCF]DB@ERAKADIHGEIBCGIIECFaGLZO@EFCNGAGDGAKL@BMG@IE@ADSDEH[JGC@CGA@BMDeK@EIACFE@@GG@FIAMM@CCGC@EM@ADE@CFMAAGHBDKIEAJG@DOGCDEKAGIS@KFCHKAEHIE]BeKNO[IFIOELC@A]GMBKVYCDDgGAICARc@MW@AQE@DGI@@AQ@@BKBAIQQYEFW@CEADIGGBCEIiMEMF_LGEKMBBDWEBGRC@E_CHYGCH_IAED@FFBQh@FGJaJ}AHRAREF@bE\\C@CT`FHC@\\BBF@BID@HGDDJ@@FAHKBARECKDAZBJIVNHCTA@EREAMLHDAFFBVFFC@RNRETHD@FOJMACH@CAB@P@DF@@FGDWE@FFSIEMKQDYCCHKb^JADOCIDGNDBdBCFJB@EC\\A@BJEA@JAAAD@HHD@LFBCFF@BERDHNhZQHMBGHOACCEBWEGD@PSJKCGEUD@CINLFGHE@AJK@HDABBHTB@F`DBFLBBHEDARCFG@ABJBAPVFE^FBGLGCFG_BMLEXGAAFE@@JNRVJHFALFBEHQJCTbNDHCF@PlFLJSXCHFHfVBTNJ\\BPJXC^FAVNFCHFB@FFH@JF@\\ABCFD\\BDMCAAJKQBGAILOEGHILECQLWFENJHADC@QxNHFJNLDFA@CBA@D˜UÂmR@FBL@BD"],"encodeOffsets":[[119959,40574]]}},{"type":"Feature","id":"120115","properties":{"name":"宝坻区","cp":[117.4274,39.5913],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@TZbB@JHD@DODCLM@AP@LL@BNH@ETFN@`E@DNG@CHLBCJA@AICFKDDBKA@\\N@AFNAGRBFjFFFL@DHLBLFQPcXAZMJ]GAVHAIZJFNE@JpDRRDCLFDGXA@EFF@CFFPDfEBDB@DCHCFCJDJIJBLI@I@CB@@ADBB@FALADGDC@@H@BB@FZGFCCE@@FMLALJDAFFFEFDFCB@@AHCF@L@@BBB@BB@FC@E@@R@BEL@HEFD@G@AH@AIB@@@FEFEBALDDEFAFO^IF@JCBBFPNJJ@D@PRDCEKBAXL@BIFD@T@JE@BHHJORFDI@@B@JGH@@B@BDDLIFFHCD@D@DEE@BAAAB@DAF@B@H@NGLJLMRDNMfGIEPMI@GDAKK@KIDIJ@GE@CFDN@FE@GFEPGV@TCDFKHBBF@RW@DD@@ID@TJFKIKLI@EP@IGBCLAEKLEN@KSHIGYACSD@SEAMBBMGEBMQBCMIGKFB[D@HDLPHDBC@IFITDLG@IIIFGVBNJDLN@VIRI@YIAIHIC@CLKZCBEE@JECEIHEAKGDGECBGEEM@@DA@CCCBBEGA[GEDBBoNAAH]MKiIAWKQoIIPMFQAEEDMH@FMSUYIeF@EK@BIOEKJEBICFKaKPFAFSE@LWCCFMHDDEKESBOGBKIEIODLG@CCDEQCEDWEMDIEIB@EHGEEDAEAa@@HqDEJGF[AECCFa@WCEIKAAEQB@FCAE^YDERDDJBLNABD@AJGLJF@FNIAMLH@FPKLJ@FE\\BFOLGXMXW\\C@KPGD@JHDGVFBWN@AEAGFO@KH@JNFAHEHYLNHFCLBFBBHo^MAFGA@KJED@Jó¶EX"],"encodeOffsets":[[119959,40574]]}},{"type":"Feature","id":"120223","properties":{"name":"静海县","cp":[116.9824,38.8312],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@NGFMDATCNDR@CCbINEHNJA@C\\EEGVE@IhE–[˜w”epc¢·²›^QEKIEKIgiQDkehY£uSDBMkUDOJDHC@GF@CAFBFEN@C‹Q@BeP@@G@HD@@MHQKi@[IGCOCESE@GMA_OcCGDu`aˆ@VZzKDkJBLNXGDqKEWE@cFEFA@ƒISIi@@KMABJGBcMuFEzGVH\\ATSEUBeALCEMG@CEBUHUCGXaBPtUBBFIBFTDFF@DDKBFNGBJPHXDDMDCLJ^mBIHIL@LR\\@LCR[@@z@NFD@LLBNb@RHDBNTPT\\F@BJF@BXCFBHHBDLFB@HODADE@@JHVXCPDHCFTLBBFNCDCCCU@@GAABEHHZHBCAEdEjFDD@GfD@DXFCHF@ERFDLBH@"],"encodeOffsets":[[119688,40010]]}},{"type":"Feature","id":"120221","properties":{"name":"宁河县","cp":[117.6801,39.3853],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@BFLBFJXDb@DEFD\\BHEFIrC@Gb@FBCBFFGH@FJAJFNCXFFCRDCFDDH@CKJPJFALPHTALFCFGCENDDKXF@ETEBO‚bLELJDFALIPFAJL@@FfEZJTVENG@CNFFRBNEJOpJLRBXjJNLG^BBpMAAFC\\HHBAFDADDB@@CN@FFAHFDCHLHFBJGFCFUNKJJTD\\XUXF\\^F@DDDQXXBRLRCBDFEVCDLVDpUl@LEDJHAPRFGL@CETGPBTCDDVI@CFF@GFDCCVGLKEK[Y@MECISG@BKNSCGCKWEAaEBEKNGFSECO@GGM@GYI@DÅCMLHPTF@DJHAVVNKEGDETJ^[TJNNd@NOAMFYJ@@GFANDPEJB^aOadSTQSI@MHBDIEOKCG@EEFCKCqXO@@DMFENCDDHCCGJ]AKFoDaGGHYFDHKJiCMFGC@EQ@AEHGAC@IEAATKOHGIC@IXIFEoƒGE[JCFCDHNmRADFZMF[EEBMO{GU@AOW@@]ZeHBDEHBKEfQkuIWBs‡@EC@d[@[^EDMTKCEEcI@cDAB@FCBCACmOCG{PYHeBgPwPFDDALFFFCHQGSD@BHFAR[TaFYXMASUiGFL@DQNCJI@@D@PLDN`ETEFIGMCGBCE‘~CAIFDPEHGEQPHJADFJGHCJLB"],"encodeOffsets":[[120145,40295]]}},{"type":"Feature","id":"120109","properties":{"name":"大港区","cp":[117.3875,38.757],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@JFFL°_`ONJKDDFIFZN xlb~yFVNRŒrdJGzDPVFBCTNND\\UR@E`F@@Ip@IWGUoawOEE@ÏDgK{İEEMFëC—b…™@—KwOCDHHKBDJCDEEEAGHOABFABMCgDLSQ@CFEB‰MgYIDQINE@AUSwSAdYEHQMEyK[KI@GRMLE@@OqOoBOnpJ@BmEAFHL^FDB[C@BBDVFAHFJENB@sNEjQAMYsUgCSBGDJH@\\LjGR@NC@@G@HO@AfR@DŒM@EFEADBE@@HGDICCPlVANTC¤vgZlfRChjLJ"],"encodeOffsets":[[120065,39771]]}},{"type":"Feature","id":"120107","properties":{"name":"塘沽区","cp":[117.6801,38.9987],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@|ODHnPBDADEDA@CB@ddJFFLDNSFC\\]\\@@cFDˆ@nACOMW@M@ITURBRZNHNWRQšoO•j½f‡cqŸAqeiDÿÍyÓįFL|Ch@ÐFFxPpbHVJXo@@JCTR^BPABQA]^MB@bE@@FQBFVJRH@FXtPNZSBAja@@NƒDTŽLJrQTHFXZFB`"],"encodeOffsets":[[120391,40118]]}},{"type":"Feature","id":"120111","properties":{"name":"西青区","cp":[117.1829,39.0022],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@@LHAHRHATh`LHNHDG`HDGZ`D@FQDAHXFACNAFLVRTBFOfHDCVBFQH@HSXHEPFB@LDBF[bDbLFKJBFLADBDjLvCPEI]FGEIGCBEUSjcFiBIVWfaHCjN^HtwBBFGPBJGjFBEGECGDONMFAP]TDHQOWCMGAMHKIJEIGQ]aDlUG]VGEGDC„{PEbBZmE@@GH@BCA@FMQCFMYMJECELCMI_P¯`]R±œ¡¸od“f—x•\\gF@JUFFH[F@DIBGMMFaJDDQ@MCSDCBENMH"],"encodeOffsets":[[119688,40010]]}},{"type":"Feature","id":"120113","properties":{"name":"北辰区","cp":[117.1761,39.2548],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@ROHFFGCOJEDB’}DFHANDJHFEFSM_KC@O@CJ@DIRM@CEKKA…L…FKACHoLSJSIBETDJaEIIE]E]K[MYUYQILC@GF[MGNKEK@A@BCWECAIFEFYAGFOMI[OFuDiKACBCEKIAELaKaCE\\CA@KEAFOWGGTG@ERUACDeGEPSAUQKHE`FNjNFJADHHCJFB@DEXZFRRBJLA@AR@@BJ@CHF@BRX@@NQdDBBJhHCCZDLUNA^H@BKDPFEJ\\JMPfL^AJFFGLBDGLET@HJLBCFHDCPH@BIJFCLGABHNBDEF@BCN@@FHDDDN@BNEJH@@HF@DEJB@FfLNC@AHB@DHD\\IFGTCBCF@@JNH@ALKHBHCHBDMFEP@KYbHDEJF"],"encodeOffsets":[[120139,40273]]}},{"type":"Feature","id":"120110","properties":{"name":"东丽区","cp":[117.4013,39.1223],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@ZV\\N^L^FJFFJIbSCAFTJTIpKDGLB†E†KLBjHTVNBZWbE\\SBQGE@ATCRHDGEEKECBECxOhOfAZGA_YEEWSGqRKIS„C@Mb@BiTAMYsOEWG@IQEURA@EF@@acUOXQRYCUDCHDTEF[SUEgAYDcVGJM`iAWDWLQRMHUHgDsDBLHJFCFDFGHBFFVEAGHCJN@RJF‡PIhBD\\FENCPWA@LFBAFHBEJUEARCDIAEDQBRNa^"],"encodeOffsets":[[120048,40134]]}},{"type":"Feature","id":"120108","properties":{"name":"汉沽区","cp":[117.8888,39.2191],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@LMEI\\MTABKN@FCDMH@COAcH[AoēA™M¡Wa[Meq™pQRMXMGQYQASV@J@NNXDPmBAtJXlveRLFGACFGAYf@^X@BPV@|HNPFA\\FNEEYBCnQGMDCDE\\IHFp„EFWJ@JJDGHLPBSFB@JBDGHBFR@@FHDNEjDLICGZEHGbHpCLE^BHIDDCGDCFMNE@CP@rWLDEDFFH@"],"encodeOffsets":[[120859,40235]]}},{"type":"Feature","id":"120112","properties":{"name":"津南区","cp":[117.3958,38.9603],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@TLv@CNHFFBHGZFETNPhCVGNGRQXKXCjBN_HIdUZChBVF\\TFECSDGVCZDRQPWdVNA^]RBBAAOQ]DSE@F_Q@[VMCSMADUECOHycI‹qMQEU}zkaŸwENRDENB@ADG@@HF@YnaAOFƒ|CDFHUHH^kVbCR^JHIFLJNGHBDNPXGRSCO^EBMNCPDHHFAFiEIHOAEH"],"encodeOffsets":[[120045,39982]]}},{"type":"Feature","id":"120103","properties":{"name":"河西区","cp":[117.2365,39.0804],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@d@hZNFdcLYXKRCtCMOFSYEGHEAGEDMu@SKAAsx]GMTGt"],"encodeOffsets":[[119992,40041]]}},{"type":"Feature","id":"120102","properties":{"name":"河东区","cp":[117.2571,39.1209],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@ZBVFFIGABEEA@KXBDOFM[EACJgˆOIE@QIMGDBHUFEEGAEHECEDGIAKQDWLKZcdQPEP@FOFBJTJ@HNORJf@DBCN"],"encodeOffsets":[[120063,40098]]}},{"type":"Feature","id":"120104","properties":{"name":"南开区","cp":[117.1527,39.1065],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@NMVDCG\\E^B@HlB@YEDS@C…HsNSiMGDebUXAJEjidVTAFHDFJ"],"encodeOffsets":[[119940,40093]]}},{"type":"Feature","id":"120105","properties":{"name":"河北区","cp":[117.2145,39.1615],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@DBXFADB@L@LFHM\\NHED@JKZRb]QMRAFCJBDCBQYADMCAe@QIMP@GSIAIPE@E[EGH@ZEF]^HJAXK@KF"],"encodeOffsets":[[119980,40125]]}},{"type":"Feature","id":"120106","properties":{"name":"红桥区","cp":[117.1596,39.1663],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@J\\PNHEZBFEJELEL@BWGI^]FEkA@G]A[FDHUCMNEHJ^"],"encodeOffsets":[[119942,40112]]}},{"type":"Feature","id":"120101","properties":{"name":"和平区","cp":[117.2008,39.1189],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@D†T@FCHG\\FFOROMEgYc@"],"encodeOffsets":[[119992,40041]]}}],"UTF8Encoding":true}; +define('echarts/util/mapData/geoJson/tian_jin_geo',[],function() { + return {"type":"FeatureCollection","features":[{"type":"Feature","id":"120225","properties":{"name":"蓟县","cp":[117.4672,40.004],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@EUDAEI@WNMNCBFAHFFNACDJDPBD@@GD@DIFFHEFGDBDEQOFG@EI_KG@OcJQM]RMEKBGPG@[LaCIICBWKCEEG@WBQHCDFD@HSLEJI@IHWECFGAAEKCGDBFCBSBIDCKKHEADMJMFABKOKEQAA@IEEG@GIQAEK@OZEESMOL“lu@SLUTYFQCMG@@SQUAYKAACA@IB@BDB@B@DC@@BGAEFAA@BEGKJCC@AGAIHA@@JC@QEIP@@A@EGIDC@O@C@@@@CJCWKABFLBBEBSQGBAAMIEM@AKBcJEN@BEBCFMAEFEF@J@BG@BFABECKFG@AFQ@@F@BEB@@A@@AAAKAE@GFGDECEFEECBKIKDELDFEDYH@EIACDCHKBEB@BAAC@ADBHABKJIAIJICEDGDCD@@A@A@DHCHJHDFEFGBKRKBGIK@GIMHSBCH_BOJECCJCFKKMD@DNJEDEGC@OJCJHRUL@HRJ@H[DCNKDZHCTFDHCFFKR`TANVDFZRDLFARB@HPAPG`ILAR@TERNDFNHDLCLDDCXDYbHF@FEB@LDDVE@JPNfXPINCVDJJD@NJPAJHLXHDNANHhB@DPNLRMTBFRBHHr@`NBFEBOCCBIAQJDHCHLHFA@HSDCRLFTB@HEFLNF@PELBDJALFLTC@EPFLLP@tUHQJDfIHGTB^JTCPDLKAIBATFPADIEGECEMJ@JIAIHGECFEAGDI\\SPOXAFCL@BQTQBBTMZECYGAHA@GJAE@HCAEME@IECFKJADDBABLTHHG@ILEAMNDJCDHEBF@@JNFJELDFKTOT@JETBFFHBHEHKI@@IJEJ@XKEOUMS@AF@CEB"],"encodeOffsets":[[120575,41009]]}},{"type":"Feature","id":"120114","properties":{"name":"武清区","cp":[117.0621,39.4121],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@FWôµ@IFCLIB@EHNBp]AGEAKAEDMGZKFGBGME@ILGP@HEFB@BXMEAHUGC@IHCLOD@X[NWHWPKAEF[@EKIOL@EKGBNMJ@EIEHKBIC@BAKMIACCFQZCF]DB@ERAKADIHGEIBCGIIECFaGLZO@EFCNGAGDGAKL@BMG@IE@ADSDEH[JGC@CGA@BMDeK@EIACFE@@GG@FIAMM@CCGC@EM@ADE@CFMAAGHBDKIEAJG@DOGCDEKAGIS@KFCHKAEHIE]BeKNO[IFIOELC@A]GMBKVYCDDgGAICARc@MW@AQE@DGI@@AQ@@BKBAIQQYEFW@CEADIGGBCEIiMEMF_LGEKMBBDWEBGRC@E_CHYGCH_IAED@FFBQh@FGJaJ}AHRAREF@bE\\C@CT`FHC@\\BBF@BID@HGDDJ@@FAHKBARECKDAZBJIVNHCTA@EREAMLHDAFFBVFFC@RNRETHD@FOJMACH@CAB@P@DF@@FGDWE@FFSIEMKQDYCCHKb^JADOCIDGNDBdBCFJB@EC\\A@BJEA@JAAAD@HHD@LFBCFF@BERDHNhZQHMBGHOACCEBWEGD@PSJKCGEUD@CINLFGHE@AJK@HDABBHTB@F`DBFLBBHEDARCFG@ABJBAPVFE^FBGLGCFG_BMLEXGAAFE@@JNRVJHFALFBEHQJCTbNDHCF@PlFLJSXCHFHfVBTNJ\\BPJXC^FAVNFCHFB@FFH@JF@\\ABCFD\\BDMCAAJKQBGAILOEGHILECQLWFENJHADC@QxNHFJNLDFA@CBA@D˜UÂmR@FBL@BD"],"encodeOffsets":[[119959,40574]]}},{"type":"Feature","id":"120115","properties":{"name":"宝坻区","cp":[117.4274,39.5913],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@TZbB@JHD@DODCLM@AP@LL@BNH@ETFN@`E@DNG@CHLBCJA@AICFKDDBKA@\\N@AFNAGRBFjFFFL@DHLBLFQPcXAZMJ]GAVHAIZJFNE@JpDRRDCLFDGXA@EFF@CFFPDfEBDB@DCHCFCJDJIJBLI@I@CB@@ADBB@FALADGDC@@H@BB@FZGFCCE@@FMLALJDAFFFEFDFCB@@AHCF@L@@BBB@BB@FC@E@@R@BEL@HEFD@G@AH@AIB@@@FEFEBALDDEFAFO^IF@JCBBFPNJJ@D@PRDCEKBAXL@BIFD@T@JE@BHHJORFDI@@B@JGH@@B@BDDLIFFHCD@D@DEE@BAAAB@DAF@B@H@NGLJLMRDNMfGIEPMI@GDAKK@KIDIJ@GE@CFDN@FE@GFEPGV@TCDFKHBBF@RW@DD@@ID@TJFKIKLI@EP@IGBCLAEKLEN@KSHIGYACSD@SEAMBBMGEBMQBCMIGKFB[D@HDLPHDBC@IFITDLG@IIIFGVBNJDLN@VIRI@YIAIHIC@CLKZCBEE@JECEIHEAKGDGECBGEEM@@DA@CCCBBEGA[GEDBBoNAAH]MKiIAWKQoIIPMFQAEEDMH@FMSUYIeF@EK@BIOEKJEBICFKaKPFAFSE@LWCCFMHDDEKESBOGBKIEIODLG@CCDEQCEDWEMDIEIB@EHGEEDAEAa@@HqDEJGF[AECCFa@WCEIKAAEQB@FCAE^YDERDDJBLNABD@AJGLJF@FNIAMLH@FPKLJ@FE\\BFOLGXMXW\\C@KPGD@JHDGVFBWN@AEAGFO@KH@JNFAHEHYLNHFCLBFBBHo^MAFGA@KJED@Jó¶EX"],"encodeOffsets":[[119959,40574]]}},{"type":"Feature","id":"120223","properties":{"name":"静海县","cp":[116.9824,38.8312],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@NGFMDATCNDR@CCbINEHNJA@C\\EEGVE@IhE–[˜w”epc¢·²›^QEKIEKIgiQDkehY£uSDBMkUDOJDHC@GF@CAFBFEN@C‹Q@BeP@@G@HD@@MHQKi@[IGCOCESE@GMA_OcCGDu`aˆ@VZzKDkJBLNXGDqKEWE@cFEFA@ƒISIi@@KMABJGBcMuFEzGVH\\ATSEUBeALCEMG@CEBUHUCGXaBPtUBBFIBFTDFF@DDKBFNGBJPHXDDMDCLJ^mBIHIL@LR\\@LCR[@@z@NFD@LLBNb@RHDBNTPT\\F@BJF@BXCFBHHBDLFB@HODADE@@JHVXCPDHCFTLBBFNCDCCCU@@GAABEHHZHBCAEdEjFDD@GfD@DXFCHF@ERFDLBH@"],"encodeOffsets":[[119688,40010]]}},{"type":"Feature","id":"120221","properties":{"name":"宁河县","cp":[117.6801,39.3853],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@BFLBFJXDb@DEFD\\BHEFIrC@Gb@FBCBFFGH@FJAJFNCXFFCRDCFDDH@CKJPJFALPHTALFCFGCENDDKXF@ETEBO‚bLELJDFALIPFAJL@@FfEZJTVENG@CNFFRBNEJOpJLRBXjJNLG^BBpMAAFC\\HHBAFDADDB@@CN@FFAHFDCHLHFBJGFCFUNKJJTD\\XUXF\\^F@DDDQXXBRLRCBDFEVCDLVDpUl@LEDJHAPRFGL@CETGPBTCDDVI@CFF@GFDCCVGLKEK[Y@MECISG@BKNSCGCKWEAaEBEKNGFSECO@GGM@GYI@DÅCMLHPTF@DJHAVVNKEGDETJ^[TJNNd@NOAMFYJ@@GFANDPEJB^aOadSTQSI@MHBDIEOKCG@EEFCKCqXO@@DMFENCDDHCCGJ]AKFoDaGGHYFDHKJiCMFGC@EQ@AEHGAC@IEAATKOHGIC@IXIFEoƒGE[JCFCDHNmRADFZMF[EEBMO{GU@AOW@@]ZeHBDEHBKEfQkuIWBs‡@EC@d[@[^EDMTKCEEcI@cDAB@FCBCACmOCG{PYHeBgPwPFDDALFFFCHQGSD@BHFAR[TaFYXMASUiGFL@DQNCJI@@D@PLDN`ETEFIGMCGBCE‘~CAIFDPEHGEQPHJADFJGHCJLB"],"encodeOffsets":[[120145,40295]]}},{"type":"Feature","id":"120109","properties":{"name":"大港区","cp":[117.3875,38.757],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@JFFL°_`ONJKDDFIFZN xlb~yFVNRŒrdJGzDPVFBCTNND\\UR@E`F@@Ip@IWGUoawOEE@ÏDgK{İEEMFëC—b…™@—KwOCDHHKBDJCDEEEAGHOABFABMCgDLSQ@CFEB‰MgYIDQINE@AUSwSAdYEHQMEyK[KI@GRMLE@@OqOoBOnpJ@BmEAFHL^FDB[C@BBDVFAHFJENB@sNEjQAMYsUgCSBGDJH@\\LjGR@NC@@G@HO@AfR@DŒM@EFEADBE@@HGDICCPlVANTC¤vgZlfRChjLJ"],"encodeOffsets":[[120065,39771]]}},{"type":"Feature","id":"120107","properties":{"name":"塘沽区","cp":[117.6801,38.9987],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@|ODHnPBDADEDA@CB@ddJFFLDNSFC\\]\\@@cFDˆ@nACOMW@M@ITURBRZNHNWRQšoO•j½f‡cqŸAqeiDÿÍyÓįFL|Ch@ÐFFxPpbHVJXo@@JCTR^BPABQA]^MB@bE@@FQBFVJRH@FXtPNZSBAja@@NƒDTŽLJrQTHFXZFB`"],"encodeOffsets":[[120391,40118]]}},{"type":"Feature","id":"120111","properties":{"name":"西青区","cp":[117.1829,39.0022],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@@LHAHRHATh`LHNHDG`HDGZ`D@FQDAHXFACNAFLVRTBFOfHDCVBFQH@HSXHEPFB@LDBF[bDbLFKJBFLADBDjLvCPEI]FGEIGCBEUSjcFiBIVWfaHCjN^HtwBBFGPBJGjFBEGECGDONMFAP]TDHQOWCMGAMHKIJEIGQ]aDlUG]VGEGDC„{PEbBZmE@@GH@BCA@FMQCFMYMJECELCMI_P¯`]R±œ¡¸od“f—x•\\gF@JUFFH[F@DIBGMMFaJDDQ@MCSDCBENMH"],"encodeOffsets":[[119688,40010]]}},{"type":"Feature","id":"120113","properties":{"name":"北辰区","cp":[117.1761,39.2548],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@ROHFFGCOJEDB’}DFHANDJHFEFSM_KC@O@CJ@DIRM@CEKKA…L…FKACHoLSJSIBETDJaEIIE]E]K[MYUYQILC@GF[MGNKEK@A@BCWECAIFEFYAGFOMI[OFuDiKACBCEKIAELaKaCE\\CA@KEAFOWGGTG@ERUACDeGEPSAUQKHE`FNjNFJADHHCJFB@DEXZFRRBJLA@AR@@BJ@CHF@BRX@@NQdDBBJhHCCZDLUNA^H@BKDPFEJ\\JMPfL^AJFFGLBDGLET@HJLBCFHDCPH@BIJFCLGABHNBDEF@BCN@@FHDDDN@BNEJH@@HF@DEJB@FfLNC@AHB@DHD\\IFGTCBCF@@JNH@ALKHBHCHBDMFEP@KYbHDEJF"],"encodeOffsets":[[120139,40273]]}},{"type":"Feature","id":"120110","properties":{"name":"东丽区","cp":[117.4013,39.1223],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@ZV\\N^L^FJFFJIbSCAFTJTIpKDGLB†E†KLBjHTVNBZWbE\\SBQGE@ATCRHDGEEKECBECxOhOfAZGA_YEEWSGqRKIS„C@Mb@BiTAMYsOEWG@IQEURA@EF@@acUOXQRYCUDCHDTEF[SUEgAYDcVGJM`iAWDWLQRMHUHgDsDBLHJFCFDFGHBFFVEAGHCJN@RJF‡PIhBD\\FENCPWA@LFBAFHBEJUEARCDIAEDQBRNa^"],"encodeOffsets":[[120048,40134]]}},{"type":"Feature","id":"120108","properties":{"name":"汉沽区","cp":[117.8888,39.2191],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@LMEI\\MTABKN@FCDMH@COAcH[AoēA™M¡Wa[Meq™pQRMXMGQYQASV@J@NNXDPmBAtJXlveRLFGACFGAYf@^X@BPV@|HNPFA\\FNEEYBCnQGMDCDE\\IHFp„EFWJ@JJDGHLPBSFB@JBDGHBFR@@FHDNEjDLICGZEHGbHpCLE^BHIDDCGDCFMNE@CP@rWLDEDFFH@"],"encodeOffsets":[[120859,40235]]}},{"type":"Feature","id":"120112","properties":{"name":"津南区","cp":[117.3958,38.9603],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@TLv@CNHFFBHGZFETNPhCVGNGRQXKXCjBN_HIdUZChBVF\\TFECSDGVCZDRQPWdVNA^]RBBAAOQ]DSE@F_Q@[VMCSMADUECOHycI‹qMQEU}zkaŸwENRDENB@ADG@@HF@YnaAOFƒ|CDFHUHH^kVbCR^JHIFLJNGHBDNPXGRSCO^EBMNCPDHHFAFiEIHOAEH"],"encodeOffsets":[[120045,39982]]}},{"type":"Feature","id":"120103","properties":{"name":"河西区","cp":[117.2365,39.0804],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@d@hZNFdcLYXKRCtCMOFSYEGHEAGEDMu@SKAAsx]GMTGt"],"encodeOffsets":[[119992,40041]]}},{"type":"Feature","id":"120102","properties":{"name":"河东区","cp":[117.2571,39.1209],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@ZBVFFIGABEEA@KXBDOFM[EACJgˆOIE@QIMGDBHUFEEGAEHECEDGIAKQDWLKZcdQPEP@FOFBJTJ@HNORJf@DBCN"],"encodeOffsets":[[120063,40098]]}},{"type":"Feature","id":"120104","properties":{"name":"南开区","cp":[117.1527,39.1065],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@NMVDCG\\E^B@HlB@YEDS@C…HsNSiMGDebUXAJEjidVTAFHDFJ"],"encodeOffsets":[[119940,40093]]}},{"type":"Feature","id":"120105","properties":{"name":"河北区","cp":[117.2145,39.1615],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@DBXFADB@L@LFHM\\NHED@JKZRb]QMRAFCJBDCBQYADMCAe@QIMP@GSIAIPE@E[EGH@ZEF]^HJAXK@KF"],"encodeOffsets":[[119980,40125]]}},{"type":"Feature","id":"120106","properties":{"name":"红桥区","cp":[117.1596,39.1663],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@J\\PNHEZBFEJELEL@BWGI^]FEkA@G]A[FDHUCMNEHJ^"],"encodeOffsets":[[119942,40112]]}},{"type":"Feature","id":"120101","properties":{"name":"和平区","cp":[117.2008,39.1189],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@D†T@FCHG\\FFOROMEgYc@"],"encodeOffsets":[[119992,40041]]}}],"UTF8Encoding":true}; }); -define('echarts/util/mapData/geoJson/world_geo',[],function() { - return {"type":"FeatureCollection","offset":{"x":170,"y":90},"features":[{"type":"Feature","id":"AFG","properties":{"name":"Afghanistan"},"geometry":{"type":"Polygon","coordinates":["@@ࡪ͇وŐǬϠڐŶӂʮǚڦ۾njƀ̚ІɣʪҴMوǯʲĹ،˒˰Nj˖ϪԈiżŬĘͺβ̈Ҕȏĝʱʪ¡ý۷ͪ˟̊ǰώĊԼϖׂ×ࢀAƬʋӧĥяƹ७ĭࣗǭӫλȤΣĪллΛ–͑ɳ̡ߛ€ͦ։՗ɅΥԕ²ԋ͡ɿ̳þٝŋğɻسDҵӇ‡܍થΓבôǝȁԇņ࠿űටіހހåզُƚßՔ˟ڢάҢιŮɲؒ΂ਸ"],"encodeOffsets":[[62680,36506]]}},{"type":"Feature","id":"AGO","properties":{"name":"Angola"},"geometry":{"type":"MultiPolygon","coordinates":[["@@ȸصʌԋȘ˕͐ѯ֊æˤŠҬşŲɀɂӨԶ®ƤіHñ̡৴RfՉǞ͕ūԑÖԫ˪̷­ৃȼüκsԴŴϦ¹ĘʹĩСƨϿů̿î́ყZᦵ֤ۋպԽ໳΁᎝Š׋Ж₭—ŵÏԃϞկ~ԉƝЙDžÿՈŜ݊̂ޒªΰ˚ݶȨΆӘռːϐĘج«ӊʣ̜ɡԚȵԎ®Ǩʶͬʭ߼ǣ֚сՐĄǎΌŔʒg̎ĸៜ["],["@@ɉėɣلͼδʪƘ̀˽̩ǯƍɍλ"]],"encodeOffsets":[[[16719,-6018]],[[12736,-5820]]]}},{"type":"Feature","id":"ALB","properties":{"name":"Albania"},"geometry":{"type":"Polygon","coordinates":["@@Ń˷ŢέΒȳiə˗ŧ»˙ϷСƛÐgȂү˰ñАîֶŖʼƗƂÉˌθаÂƿɨôǴɥȪďȨ̂"],"encodeOffsets":[[21085,42860]]}},{"type":"Feature","id":"ARE","properties":{"name":"United Arab Emirates"},"geometry":{"type":"Polygon","coordinates":["@@Ƭ¤ŒɱڂƂ۞uԖ{ֺ֪ظՠՎԮdž˹ŖڑѕGçճƪŝϝǑE΅ʓΏuͷǝDZᡋъ͏࡚Ț"],"encodeOffsets":[[52818,24828]]}},{"type":"Feature","id":"ARG","properties":{"name":"Argentina"},"geometry":{"type":"MultiPolygon","coordinates":[["@@ߗ§ѓ̔ԑx࣑@Aሞ͒ϵрؿનԋ୲ȿϙп"],["@@Ӵ؇͠ڰॠ“ƊǷ໶ോۊŷਆاࡾ͡Ŧχࠡ౧ࡒɭ़ŷڔƈނ٢ƎݐжLjфӝiڣۻҩ֟΁ॅࠃ૭ଧȽڥɣࡹT࠷ǽȇÝիËѫ੨ܙŗ׃Հν§Ч߯ઁఛ҉။ǩउĎǰԅǣػƺщԋ̏ࡱř̪͕߱ɗŜ࠳֨ʧҠˆʢѧޛʻڭԹūࡋȣ҇ߏEڃљʋؿؙࠞߦǝ˿ݭ঳Ӄձটލͧ΅Ͽ˔ࢍ֔ӡΟ¨ީƀ᎓ŒΑӪhؾ֓Ą̃̏óࢺ٤φˈՒĭьѾܔ̬૘ěӲξDŽę̈́ϵǚˢΜϛ͈ȝॺ͸Ǣƙ਀ȠࡲɤݢԊ̨ʭࠐEޚَոo۰ӒࠎDޜɓƶϭฐԬࡺÿࠀ̜ބռ߂צԺʥ͢Ǭ˔ඔࣶд̀ࢎĹɂ۬ݺશȱ"]],"encodeOffsets":[[[-67072,-56524]],[[-66524,-22605]]]}},{"type":"Feature","id":"ARM","properties":{"name":"Armenia"},"geometry":{"type":"Polygon","coordinates":["@@୞ƀǨə͌ƣǛɁ҄˽ʁˋΦɫϘƏl׋̣}΃ӢHżχCʝɤǩuͧʖرȼĄФƛ̒"],"encodeOffsets":[[44629,42079]]}},{"type":"Feature","id":"ATF","properties":{"name":"French Southern and Antarctic Lands"},"geometry":{"type":"Polygon","coordinates":["@@ը˃ߐĿˆDžɽϣಇÃq҂ŮΎÊǢ"],"encodeOffsets":[[70590,-49792]]}},{"type":"Feature","id":"AUS","properties":{"name":"Australia"},"geometry":{"type":"MultiPolygon","coordinates":[["@@ߺ́ҜŘپNJԎÉÐঽ˽́ēگ̉ɰ׍בǧ®ԫ€ԭܘŗֈӝܸtϬռõ"],["@@̢ڇբ̈́˦ΡЖ͟đϋǴܛŸнɄĹɬܕąѥ˖֭࣬ѭצЋ֞λŋȯӔՃࣧ͜ͲȂ;ηȴźƢࢹ׬ԩϸ͋ڀڹʀڭtӏËԳА܋µݓơϵɩݡjӕǕ׻χއثЭ̫ٱ˫гʝܧ͕нɅػʼnׁªˇӕ̇व‰ޡ·ϫ͙ԕέ۟ψԥƪżѬҝǃ݁؉ܩɪӉƄӑÔ߿ʐիԮƻْțьЭ;߱ĸˢРȯزЧ׉ݝƷѮҬŶӞ͘ЬãجہܑԿ˽͏ڛٽΊ~ҀԿ،ѹ̀ǂȘઃԚןz߯Цຓāછ̝ख़˫ߡÈࢻљܯȗljѱ̳Ϳ܉qՅõݑƶ׿ğֽԁ҃ʕœуʁЗˋؕ֛Bࢽ՜ҋDŽlӖкŘƚȒ‡̠ĺאģӼѻࡖƏӒ˜ӎͭնsʚϋͰĽڄӓڔřΪτε˳ެиʑʞ͗aјеڎă˄țʦĠӠǢȸŘрęӮΎ؀Úٕ΢׀ۀˬЦΪٜ̰ϤàɴĻڎ̺ԚĤŶȀɞüҬoࢨʖҚώɊ҆ӲѐœͲvҘט܎ΠܩΦǚ̗Ј˂ТψǻĸٖҠаȮͨцƜ`ɼτĭdɂτŦОŔبϫҲӽՂMՖÿDZҦДڪϜɘſȾκӒԘ̒јıۺǂeі؛ˢ҂Ū֎ȻҀ·ۼɋʈĐԶʵӬʊ͂ñȠNJϬеɡ͉҇ͻ˿ƒĮͱʙп̗ЭÔʁڜҫ٨ˏѠ́؈ӻʂBѰɍŶʷߤ˵ֈ˼ǐҊǠόľҤʰڞŝОÔʔīӔŌنLjǠŽˬȮѾdžҦtʈ̸̾ʂЩÎՃȾķ˜Λ̨ёÚӇ‡̥"]],"encodeOffsets":[[[148888,-41771]],[[147008,-14093]]]}},{"type":"Feature","id":"AUT","properties":{"name":"Austria"},"geometry":{"type":"Polygon","coordinates":["@@Û΃ӁCǎǻ˧էLJƗܽsщȏۛÞயɐȉ̊ࠧƣĭDžԗŢѕxϝƶźȴƬʪ²ьɹŤɜݎ•׸ƮЖ}ˀǣþƜšո̠ń̒ϰز˓ӀΆ̐ÚٶʱЂªϰǁãŃČ̅"],"encodeOffsets":[[17388,49279]]}},{"type":"Feature","id":"AZE","properties":{"name":"Azerbaijan"},"geometry":{"type":"MultiPolygon","coordinates":[["@@ʞɣψDGŻ΄ӡֽŒщϰƃ͆Ǫv"],["@@ϊËƞɈԈͺѴѵђ׭ϺŸʸɧۗãƣٵƟ̭̍ȝvзȽ¥ԻѲ̂дʝʚ̿×যإk׌ϗƐΥɬʂˌ҃˾ǜɂ͋ƤǧɚȶƎضʍҐ¹ŘIJбҔɔŚʀ…׀ԙ"]],"encodeOffsets":[[[46083,40694]],[[48511,42210]]]}},{"type":"Feature","id":"BDI","properties":{"name":"Burundi"},"geometry":{"type":"Polygon","coordinates":["@@Á০ɃϢԜßʲӎҀŸͧǸȏT˗ȹǭ͛ѫ̧̥΍Ÿ"],"encodeOffsets":[[30045,-4607]]}},{"type":"Feature","id":"BEL","properties":{"name":"Belgium"},"geometry":{"type":"Polygon","coordinates":["@@؜áުǪՐοҦȝħ֧ɕĝһܿϦћßדІϷͶϷ`ũ̒ڪǔ"],"encodeOffsets":[[3395,52579]]}},{"type":"Feature","id":"BEN","properties":{"name":"Benin"},"geometry":{"type":"Polygon","coordinates":["@@ۛįȹ׆žኞǛǦЮ̇̌ʱʞņѶ̀ĨǠξЪĀȀʤˮʘ̠F٘ә˩ȎӽǓͷĘɧСԳʵʳǁՉt՗µണ"],"encodeOffsets":[[2757,6410]]}},{"type":"Feature","id":"BFA","properties":{"name":"Burkina Faso"},"geometry":{"type":"Polygon","coordinates":["@@ֹɐϽ‹̍Ƀϗǰƥ˦ϙǾÅӦɮΤo˴ښۢŬּɲȴОœΚǢŘɎٴϖdžˀ޼ΒҦŢɀLJՠJáСŔϣӀչ€НॺȏmֻǿʣЩÿǟν˿ħ݁lϳâ˓ƉωÖร¡qӉŘم"],"encodeOffsets":[[-2895,9874]]}},{"type":"Feature","id":"BGD","properties":{"name":"Bangladesh"},"geometry":{"type":"Polygon","coordinates":["@@i׽̉ŶÆگʉѬµєDžКΕӨޟ’ü΋˃ҳΧǠũƵʃĠ͗øŽۖ̅لƜԒԫɤȆ̪Հ̼؅Ѽ֮̔ږεВ£ô׏ߞřު^Ӟƛϯ܅ϕµʷӍҢѥƎ՞ɶFѶ೯"],"encodeOffsets":[[94897,22571]]}},{"type":"Feature","id":"BGR","properties":{"name":"Bulgaria"},"geometry":{"type":"Polygon","coordinates":["@@ʎΉ͚Ö٦ſ௾«иɌবȜ̩ؒӴĕѥΏ̫׹˔ӏܣŒࡥ˃Uлޅÿס̊ڧɱة|Ñ֊сːƒŢĝĴƘˌ͌ˀСδ÷̬ȸȐ"],"encodeOffsets":[[23201,45297]]}},{"type":"Feature","id":"BHS","properties":{"name":"The Bahamas"},"geometry":{"type":"MultiPolygon","coordinates":[["@@ȵ£ɇӜ̿ʐǾՔʨ‘ۣ̎Jӥ"],["@@ࣷƅÏ̴Ђäֈ{~ɕ"],["@@ƟׯƷņ`ѮϓͪCĪڐϗ"]],"encodeOffsets":[[[-79395,24330]],[[-79687,27218]],[[-78848,27229]]]}},{"type":"Feature","id":"BIH","properties":{"name":"Bosnia and Herzegovina"},"geometry":{"type":"Polygon","coordinates":["@@̦FȿσМ͓ūЃȡ™ƽû˙țūҥݓ͈ͅΘ͋Ȅϭ̾ǻʺЩϾǬΒ̞ȕǼǨϾnܠƓ׈\\Ϟȅ"],"encodeOffsets":[[19462,45937]]}},{"type":"Feature","id":"BLR","properties":{"name":"Belarus"},"geometry":{"type":"Polygon","coordinates":["@@߼Mࣰ̈́ȚӄېːÿϔԜƚ͖ࣘࢮɁŢȻѲĴࠒȧĊЁǷɧՄս΂Ƴ»Ʊ֦Ʃʎɡ͝ǿڳˆljÿȠ˧ȸ՝ܝ¹ʵȁÃхͭĆݷ¡əȞ̿ƥ́ŨڍjफȬࡕàٱmҡɩГeϐʷϴԌǢLͰɷ͌™ϊ"],"encodeOffsets":[[24048,55207]]}},{"type":"Feature","id":"BLZ","properties":{"name":"Belize"},"geometry":{"type":"Polygon","coordinates":["@@OŮĸžƴı̞ԔDŽZHūDŽGaɭƋεôŻĕ̝ÀăīщǓɟƱǓ̅ʣ@àॆPژ"],"encodeOffsets":[[-91282,18236]]}},{"type":"Feature","id":"BMU","properties":{"name":"Bermuda"},"geometry":{"type":"Polygon","coordinates":["@@OEMA]NOGNG\\Q^McMOI_OK@CQSGa@WNLVWHFLJXVFGJ`ZRTDLeeWKIHGIK@@[MQNi`]VDTBHCJAPBJLVFjT^LV\\RJZRn^RH`TfJjZHHOTTFJP_NOX[EYQQKMEJOLANJH@HQHAARF@ZEPS[U_IcRQXE@EEKKOCGGCQCOGISKYGUC"],"encodeOffsets":[[-66334,33083]]}},{"type":"Feature","id":"BOL","properties":{"name":"Bolivia"},"geometry":{"type":"Polygon","coordinates":["@@य़”͟گӳ؈વȲ۫ݹ؅ŗ͡୆ҋऺˆ߾ѳ΢ŏ؆ЫֲՌ࣢αۺȖ˰ƭ̶͠рh܎¤נǸ˶ܩഠزíѠnȈʪ݀;Ѷ͂સƚęؽļ͓ãࣰ֛ݫऴƑ̻ͦ֨ǕΐʑՈTӦʟšӟǐʕZγʓa͒এྖ“ūӟĜͧҞɽȤԹƫڋɯρĄӏʿǥaʶ޳јޭ^ัʓЕ݋sҋͥ৕ƉǸ"],"encodeOffsets":[[-64354,-22563]]}},{"type":"Feature","id":"BRA","properties":{"name":"Brazil"},"geometry":{"type":"Polygon","coordinates":["@@૮ନॆࠄ֠΂ۼҪjڤуӞеLJǒӜŖӼBҦ̡ƴ̿Ƌ̻œį͔ýޔƿʤ֥ɪ΃ǏࢱLjÈଜʝҴˀǦăӐɰςƬڌȣԺҝɾěͨŬӠྕ”͑ঐʔbYδǏʖ™ӠӥʠՇSΏʒ֧ǖ̼ͥळƒ࣯ݬä֜Ļ͔Ěؾષƙѵ́ܿͽȇʩџmرîӃƟϡĪÈ౨ۏӷݏv҄ͅ֏¶DzΰұԞΓݴɜƶA΢ԖʎċҔɊ̈Ôϼ०ֲێNJŔŴݴŸϚᘰpθſӔύ̬LؐӀƒǚē†͐ӯĔYՀ࿖k˦̂ɸˉǐӷǂļҨѻٸÆnjʲشȞΊƐĮΤ׸ʆ¯Ǯ܅ðśՊ’֞ϓɒǀþجŅڜȿʐȤ؀žल̮͎̾ŏʂѪšȜȗʼnσ̀ŵȖϷɷ̏ƅ܏ɌыÔϳԬϿЮ¥Ģǒˆ˜ϠƦ˚ɢҬíȲŠҚçøǢƗǘĎʐͺõЈĒӔDZξǥʺɪȊ•ŘɿДÒ͒͊ʴؤӼޒ˺¢ȺҫҼ฽҈Ƒxׅمەʾʩ๤ƁŠࡃٔր੐̟ඊԡШӱƏҫ঎ʶ࿐ѹఴŽఔ۝੸व٪ʏܖ‘̦˅˸੭Ɣԗͯ൹ёշஅୡՙोثܯȿgɻءÒ༽ɹಓęօˇͧƫ૱࡛઱ƛࢁڹηȟԋ࣯Fೕ͓סύवʗ঩ڝ܅࠯ũطƔҫƽࡓȏЧחҥट๕݉ڗ֯Ͻϥߛ։ӑɷӈψЊӟֲڇҬࡹՠ̹{ࡅٰձę"],"encodeOffsets":[[-59008,-30941]]}},{"type":"Feature","id":"BRN","properties":{"name":"Brunei"},"geometry":{"type":"Polygon","coordinates":["@@ͬ̾܎Ң›Я·՛Б€ǭ˹ϥѦ"],"encodeOffsets":[[116945,4635]]}},{"type":"Feature","id":"BTN","properties":{"name":"Bhutan"},"geometry":{"type":"Polygon","coordinates":["@@΂ˍÏԩۇ{ۿÈՇſޅ͊kǚ֌زҒɈ׸șѺqπɥ"],"encodeOffsets":[[93898,28439]]}},{"type":"Feature","id":"BWA","properties":{"name":"Botswana"},"geometry":{"type":"Polygon","coordinates":["@@ǜƭ˄ӡॎइήĝD̑ʚՑٰŹ՚ϝ஑أݭع˩֓ʧ́ҙãƧГďʽ՝țہ¤БɾΟĸХșȵГЉʧпϑ׻đȇ̐üԠӽߚɧŲAរࠤˆ|Ჾش„ಖ͎̎΍՜ͤʮDӂȎưÙ͔ڣ"],"encodeOffsets":[[26265,-18980]]}},{"type":"Feature","id":"CAF","properties":{"name":"Central African Republic"},"geometry":{"type":"Polygon","coordinates":["@@ۜÚƺɎƔgȾȏ੔͐Τ͠Ѭ̌ĉ̐ʂüߺ½߆ϴ؊ࣺю;ՐƜĪΫӜԿF΃ƋΓÄʻ̆ʍٖοҢͻT˗֠ѫΖεɆԋغͩƊˉˣęաpكĘ̹ïųȱ˕}ͧDzधнϥĎŗÝʥԕطǐؙĊ՗̴ۓ˸҉˓͛яùדգ²֩Ƙԅѻѯޱėʐ›Ϧϧ˔̳Ѡï̠ЇѮæʢċΞÞٴȬƴц࡜"],"encodeOffsets":[[15647,7601]]}},{"type":"Feature","id":"CAN","properties":{"name":"Canada"},"geometry":{"type":"MultiPolygon","coordinates":[["@@؎œުxЯ΅̵Å੥Φȿˬ͆ʸ̎С"],["@@Хcઝ˂ޯІ̄î૆Ɂ࡮Η|Ʒ"],["@@хŝൡϢʥ̘ݩ̌Ưʈࡻư͕ҜðȚࢨǿԨŵ߄ė˺̃дЋ࠼΍Όҩ"],["@@։ܿո˴֠ǵ̏̉ݚɱϰȴ࠼ʵʹ؛טƞņѿʼԷΝ݉ϝ‹փǂǾیɻńইܯԅ†צЂ߫Ȳࣙ¹࿅~ŹʠԼ̐λɬ۸Ԓࢄ೾Զӎܲ̂϶™Njɫ҅Չ"],["@@@@@@@@߰äʥ॓ܶگͯDԑϪ̵ϮчʾƻτºˎЂŋ"],["@@͡ѳχîəʢ Î͖ʦΆkɈǣ"],["@@ঝҧץnǿɪزϲ଼SiǍ"],["@@ƼυјżӨɗं˽४ʽöЍؤÞ׶˥ݙ˃ಳȬҽϚ࠭ҁ஡ѣ˿Ӯଗăܴдņڌ˺ޔ؈å"],["@@ष¥ȿЪΦҼޖŜپɷXέħřձʛ"],["@@Է̍ଉʬۃğଫϘ݊ʼטζࢼʃԎƯʦDžԠ͍"],["@@G࡭૰ڄ৐եʡح߾֥࢚؈ؖܨ°ईஞÝఔūૼй¼зس҃פ҇ŃУ࿩חୡŻࢃʨʣуߵ۽ʓοই֩ளÇڏΡÇձ঍Ŀਉڻ࣭ु͙ڏ±উంƕϜ޻ϼّ୲ǔ༞εࡀ͋׺Ѕ੆ɳࢸΟ൶µࣴąƍܫʼࡋ،ळనߗ٨˚ҔࡺѭೢףѶഎЀ॒לҮהç֭֘܌৷لলࢤνݾ˫ಾגȘ෸ɫࡸć۠ɚ޴˵ਚӣʮ͙ຄÛ}۷˪ਜ਼ގſ،ӵ௖Ұߦऔ֌ϸٺݣબੳघ৙͵Յ૤Ӂݰӓംɏբˍͬ܃ټŏͶͅÖऻ؍́׽̏൯̗੏ۑ෇ƋᅛǮుPࢇÍ۱׽ੳω௉૗ॵޡ܌Ɛഘૄᄈ۪సČݔЫߍ֟ˊࣟ˜هતп൸ŨࡆीÎ؍ժ̥ਣսᇷԁ࠯ͽय؁ٓ֍܆ฤ۞഍ƒणĹջӆBନύʐ֛ƛ˧ɚٙىʱٹ̕ϡΥŽˏ¥čȹ໽A౥MϛƷࢵ؃Ŀßˍ͝ޗBࠛGϛƅƊǑøʯeďષлࡽſউ҅Ɂ@˷ƂĥŦnĔȂ̎ЂҦʘӺǙܴǵނ࢕ЂľƬūĺɳ@ǛƆ¥ȤǍēɥ€¾ĊȡĊćɚٵːڹ˪ࠑ͘߁̨ݧʃ˝Sਕɔڻʼnࠁʺ࡫Ɔו¾ʻƜƫҤ˳IE͓჏BᮝA᭯@ᡃ@ᠿ@៙@ᢡ@ࠛ@᠁@ᛷ@őF྽ࠜ׵δຽΐҳݖŤԨ੻ΨƧڴ৭؎iѠҲКwՌෙ՘࡭ॠՁ׾ޑϚ֣ΈѿѢࡇ˕ࠇҹݛւדπࠋɸࠟ|JⷎNᷲ༬ȭ೘Й࢘û݆ΖৰˀఢĹ఼τ൘Ⱦ־ΑظȠȊЄ׈ęෆݫ૦֬ŖّਔƐ͆ʖৰ·౼Λዸ̭ୄƛࠖÄଊэ஁зຶǷᗘIJܒƦࣆԋࣴьࡩΦժ˼৾žڦĎڴȩࡊҗरä๢ϛಬƄ௬oĭԺݞƦದ˵KߑՖڠڰuϞࡊ࣑԰কͺäघশ؎ૌƇࡘχଞॅݗЭ༠ǝ"],["@@нϿሎʬୠщॊіސ˟یࠛфΒ׭ࡰ݊Ŭ࠲Ƈश͹ՆࠉʼץථеະЉĝσൡã՚͓˱ູ̯Ƃฃɪঋ»ཅ˷ᒃű๻āҕІଫɮݙģਛږ֔ĚಘƜஈ›રƦྷȞᅗã஗jѷ̴ዎͲಗ[ืɚ۶ـגͮᖬԠ࡬Nj"],["@@݉ևಹך˸Ş૸’ٔȁ"],["@@öɵࢿ|ࣟjࣿőʑ¼ऍѾ˜̠ИÈነěชң"],["@@ڎԽޤڴᒆΈ෺ࢅůջဒʒߒͮሀыୄЏŊν༚Ȑ࢘՗᎐ܸͩ͹ߐ޻໯ϹጘչೲȁீޙೖÇʽכ้ঋਗά೓߲ઙĿŁӕࢪӥଜϯΌɟմࠩ́׿੕ɪᑏڨஎܣ࢔ԕƎ̉ᗱͲᅩӤ৳Ц̌ʂయќ௥Т`ʑᝡƅ܃˾ֆؤ཈dႸņ˫̜̊оચࠊɳϊ͕˾౿Рၳ˺՞ɆࢷԺ݋´ڏ˸҇ʛ຿ŅᵝȈᄫʚഹŴۥ̐࢞Ϧ஝Hˉ࡚٦ݨࡺ΄ᓪɢأի"],["@@৊ǯຄńɖʑ޷Е౜αƱݳ൝͗߳ê׉͎ᐡٮjˎ႖ĽएռসР"],["@@࣓عय़ŒԽ݆`кѮΨ࠰ɮც‡ྈȱళݟ৉Ǎ"],["@@ᕍЙѷςኹѺήΤ׌ؘܰւࠑԦᭊƀ஬ǧᒰ±ࠄʑࣖΝ੍ɃᏝןਫי@ν"],["@@ҙ͙௝Øৱɖ҂Ϛீɨܼ̬̍ˇ"],["@@ٞϵ€љϣس൱đࣗƈjӬ൝ÝÁٮࣜౌ˺ஂµÜŎ"],["@@̙͢ݠƘࢢ™ƪЩԝЋ᭗Žᑯη౩mŅ˜პϊ④ij୯Ʈପࠐ߈ɾᛄ˳๶ӻฺÛறߨޔ̪ࢄĭ˲Џ"],["@@ढ˓ကFܨˡȑ́८ȍՔȧଊ™௬ë೸ǼႊðീÏ࣒ͅȊ΍ԽɟభǷ੽ĸᜱŻႫcഫļᖁ˔̃ҦĹжࡇξ჋ĺঅʼ͂ΈႾÁ"],["@@ŗ٣٩̇޹£༝Ϋ഍ŹଗǼ@@ුؼႮծಆ[ସŬ"],["@@ϣy༽Âɡɼၜ]מƻĵĩ"],["@@༩ʋఝ˔ڼˎ௮Đஈſ˩ʥ"],["@@৽ǏඉBbŤࡴʦҌદǝ"],["@@కǥۃȚέ͂áΎજ‘ӪÅ৐̇ɫ̣"],["@@͜Ε൏Ĥ൩˘ሏŒߺʠ৫ȮÕ͐࿶ŕᗢ̫ٞЍ"],["@@০˕ଽʟ༇ك๥Óდņࣗ΄^̦ڔɢ໡Oए˨ՑϠ׌ώ׊ʲࡴÎοȖዜ¨੶҅මǵ൞ǃڒև"],["@@ᖢßᅮŅ໤ɫ™ɡᏅη᎙ǟݻȉᆬJጡԙേʃ෯ۇႿƓՙǡᡷěୈĿׇƭ۞бߙ˽ಛʃЋ͡୫ʣŞȏ෬lȳᖟԋᔧɴឿŻధĸཟªĿЖ༊Ȑб؆ԢÐᖤγ଩բഹLjڼ͘๰Ȩʄ̊஋͠ΥѠᘞ—ڒĝ಼̪ቃĬ᰽Á๣˸۩ͼগʘȁ˺దLjঘ‚࿲ƌం̺ਬ©ࣤɽٔҒૐƈບĢᢲ–Ҁĝ᝚ƚᆔÁᆒÁ"]],"encodeOffsets":[[[-65192,47668]],[[-63289,50284]],[[-126474,49675]],[[-57481,51904]],[[-135895,55337]],[[-81168,63651]],[[-83863,64216]],[[-87205,67234]],[[-77686,68761]],[[-97943,70767]],[[-92720,71166]],[[-116907,74877]],[[-107008,75183]],[[-78172,74858]],[[-88639,74914]],[[-102764,75617]],[[-95433,74519]],[[-123351,73097]],[[-95859,76780]],[[-100864,78562]],[[-110808,78031]],[[-96956,78949]],[[-118987,79509]],[[-96092,79381]],[[-112831,79562]],[[-112295,80489]],[[-98130,79931]],[[-102461,80205]],[[-89108,81572]],[[-70144,85101]]]}},{"type":"Feature","id":"CHE","properties":{"name":"Switzerland"},"geometry":{"type":"Polygon","coordinates":["@@ƫŹȳϞƵіwá΅χƙةŀǻ͹ЏơƄһ˵Л¡αǶ˽ςБſ^ϠؚҾɈϤûɲƞ܎MǦǼ࣒ʱ"],"encodeOffsets":[[9825,48666]]}},{"type":"Feature","id":"CHL","properties":{"name":"Chile"},"geometry":{"type":"MultiPolygon","coordinates":[["@@Bም࣒@Ԓw˧ͻܛʻЭ‚ӻä؏ʨ࢟ŨੑҸ࡫Ҏୃशۘǭ୼֗૜̟ѢϬ˘ֺޠΎװı"],["@@͢୅؆ŘĺɁ˿ࢍࣵг€ඓǫ˓ʦ͡ץԹջ߁̛ރĀ߿ԫࡹϮฏɔƵCޛӑࠍpۯٍշFޙʮࠏԉ̧ɣݡȟࡱƚ৿ͷǡȞॹϜ͇ˡΛ϶ǙĚ̓νǃĜӱ̫૗ѽܓĮыˇՑ٣υôࢹ̧̐֔ÄgؽΒө᎔őުſݝPЙȷݷ̣Ɖ޹Σoॅ˚१ג@@ਲ਼ӔˁՒʄӰх֒Ņ෤Φ߰ࢴٰౣʔߞݒ˸ඊत̏Ѯგ֝ɠʿ਻ՉŠ˂ல˺༒ϮָʍࠎéूΠ„Ԩപ׈എΤబȗ఼ʤۚĵਞӮਆưྺ˒ნˀሤÕ൘ǩ஄ќɌɦњЬֱŐ؅ѴΡ˅߽Ҍह"]],"encodeOffsets":[[[-70281,-53899]],[[-69857,-22010]]]}},{"type":"Feature","id":"CHN","properties":{"name":"China"},"geometry":{"type":"MultiPolygon","coordinates":[["@@ԑഓΫۏѷ܂ĩخӶࠜڦَϨʡƣԓ","@@ܩЗۏʺyܢаϠࣾɾӚoȊ͍σσșӟ"],["@@ฬˍ঺ׯͼ߃౨Cܰͨ൸ʜѳݱ͙̭˽ः֡ࠇ৵ƪܝ̑ɜܙť঳ѕwLяթӺͯһಙαƀѹܩŒЍ˂ֽ׭ऑҋۃա୭ʑأϽࣝɭ҂ϴǭ͞ږ֠ѹѲܷ̓ॉ׏ԫթ࠙¡ѓϻѸ֩یƏ„ϕڔʕस׶ݚ͝լuƌѱஓɻϻҏࠇућיࣜҥͦࠝԞޓ֮٥_دՅɯȪ҃ӶʻŻۃɇڗҷ÷ؗࣧڹિޭোିޡୟۻृĩԣύ̃˘Ӈй୭сࢵŹ˻ࢱҭ·ə؎Ȧ͘ૻːЇƍࡍɔЏ΀ƄӜޏƶЙܑ̀҃ࠇīڡJ҉ȳѥūŶ॥҃x÷Ȣ}Ύ؝ʓεƸر͂ʔۤՏǎȧޜࢱƓĴাߔۮ”ۚ{٠νȨ˭ӶӭÙࣟŲ˴ΜϿԺ׳Ν۵ȸॷ՗އسڳĿοɦѹr׷Țґɇ֋رëڌԟǭওĈोȖڿτٵǔ˯ЖҽŦࡓոکʴΑȩଢ଼טࠛՒɽऐ׾ő‚іͭјĐۆࣙঠ൧ͼʝ٦ةϼƫʌųӎˆ͜ԛȔ˟ďɇިʈȔśȠߤЈ׈ǐࢸő͆՜ંIJͮ̚೜ҔŠȐãӐּɔݱฦဘͲјȈ؆ຒဠˡҲϞ¢ࡆۦĀٖ֔͢èɚו۸ѽப̿׆ڱ͕ঙ̢ηূƝଆŝ৪ԻԲġϤޟӲӿऒnჄȉ૤Ŝࠦůఔԛ৮BόʽঐҌബ̈ాŒঘ̒׾҈ך˰Ƌˤˍ͔ѴըӀùࡺǝ࠸Ѿ౲͚؞֊נʆ௠ŐڐĥĠ̘ݿזګː٥̳ࠣžӇŃɏΆר࠾Цو৚̓ஆՎQτݸࢾҲːWҪңȦۜмਰƲ૜vసʡ݈̱԰ࡏ̀α̊ԩ̶ࠕ"]],"encodeOffsets":[[[124701,24980],[112988,19127]],[[130722,50955]]]}},{"type":"Feature","id":"CIV","properties":{"name":"Ivory Coast"},"geometry":{"type":"Polygon","coordinates":["@@ϣUוǒ՟Wহƥ׍ʍ̯ࠫNjvÞۖĄŀ}ͨΣΚˉÈʕɲǾώčО ʔƄB¸ξÝnjĄŜ̸ĶȹڨȗΎæ˸ǘÞŊúɸųٮOƸʖƢgʎĦžΫȞłΌŰϚǽƦ˥Ϙǯ̎ɄϾŒֺɏɠ஡Ο۷ɕेθܣ›ͧ"],"encodeOffsets":[[-2924,5115]]}},{"type":"Feature","id":"CMR","properties":{"name":"Cameroon"},"geometry":{"type":"Polygon","coordinates":["@@Ľ°ӻŇԝŒЋÅ൅nŬڒ͟֊ϧƚǟϖɋŦXɶɎתЎ߸ʒRԄӮ͈bҾΉ־˲ĀΔȌͺžь҆ΊǞךDzȊŢѨɜ՚۾ٲ¬˨ĠƲͫͰ‚ˌʂ¶ͮ՟Ê֏‹֏ҜޅҷTʁÏϥČǻЅӸөμƛŠΏˆ׃ſɩх࡛ȫƳÝٳČΝåʡЈѭð̴̟џϨ˓œϥĘʏÓґڛȤڷɜ੗"],"encodeOffsets":[[13390,2322]]}},{"type":"Feature","id":"COD","properties":{"name":"Democratic Republic of the Congo"},"geometry":{"type":"Polygon","coordinates":["@@»ঙͶŕˑ̗͓ɟ͍ѫǯϷ±ګț͍Oهʍɹ‹ԃŗÝýҟɄϡÂ৥ưޝċѧǘӣӤҹҒ੕ͥĒ૿ƙɣĵʇՙȊχƫষĻࡇɨƫט͝ɲƴìٟࣟR·Ҧ̳ΨٟŠȋѰԣ˅ڧŞ˫ϢՕüϽqµʾ́rϥºԳųιtȻû®ৄ˩̸ÕԬŬԒǝ͖eՊ৳Qò̢ѕG­ƣԵɁӧűȿҫŠˣş։å͏Ѱȗ˖ʋԌȷض៛\\̍ķʑh΋œşʼɊʀμƎɎ̪ǰɚđ˼͐ҜSÄʃ̼ƩӶՄӨШɆːƒ۔θࠆϬўքМĪˌt̰Ǝ̆«ӊŀݖǐԾʦ҈¸Ԕúה͜ѐҊ˔۔˷՘ؚ̳ĉظǏʦԖŘÞϦčनоͨDZ˖~ŴȲ̺ðلėբoˤĚԘۙϘķɤƖϲÅҶDzȦΫ݊֏"],"encodeOffsets":[[31574,3594]]}},{"type":"Feature","id":"COG","properties":{"name":"Republic of the Congo"},"geometry":{"type":"Polygon","coordinates":["@@̿˾ʩƗͻγۏࢸٖҪ̓֌˾ɂ֦ĺäό҆Зݐ•ʴЈł֒ĝڀЉӺζ঄ȽǘسçɻѢÔξ੘ڸɛڜȣÔҒѰ޲ԆѼ֪Ɨդ±·ԓʥ҇ǏԽĿݕ¬Ӊƍ̅s̯ĩˋփЛϫѝηࠅ„ۓɅˏӧЧӵՃ̻ƪÃʄқT˻͏əĒ"],"encodeOffsets":[[13308,-4895]]}},{"type":"Feature","id":"COL","properties":{"name":"Colombia"},"geometry":{"type":"Polygon","coordinates":["@@ΫȤЭ˨ʅƅ܉Ŝȱΰƽ_࠿Ӓŕʺ̼ڛтȢ̦иÊΞՆ͐Ѵ̳ȦDŽӦȏސǸɚƃ܄ͻ҄ņТ˔ÑǂʠțӶĺŬѢـהΌĚT˦ƺ܂ӖϸՊfäǪڂéڌъ͞ȊОК̖»ɚɛǍ˱գƕɇп͗ʋʓ̷Ĺ׵ɷӭѢÇņϭȄȁâ͹ij̵ˆǫȸéȨ̉ઊĄӦŃעܡͼĚ؂­ӐĪ̔ƟƱҍȇ˯ß׻ǜ֑ʆʟ†ȉэл̨ȃɠ̋ʰ࠹ǁĻǏӸɷˊ˥́࿕lZԿӰē…͏ǙĔҿƑK؏ώ̫ƀӓoηϙᘯп҂ʣpժࡤٟϾԍị̈ƤҧɝصŀӵࢤϳɐˍІ֑Њɡā"],"encodeOffsets":[[-77182,-155]]}},{"type":"Feature","id":"CRI","properties":{"name":"Costa Rica"},"geometry":{"type":"Polygon","coordinates":["@@җȆǟǮĬƤ‰ȄɷȪͥǔ́ņÅʖəƮÄʑǗȩȓɸˑĊŗǞLʮŎˆʁŠȖnjŴňֆɝȖŊˊéƔǥʜÇȪDzɈҙ͖ͷЂΩ͗õLͷǪűűıƱëǟ©Ǖ"],"encodeOffsets":[[-84956,8423]]}},{"type":"Feature","id":"CUB","properties":{"name":"Cuba"},"geometry":{"type":"Polygon","coordinates":["@@ܨÑڊW߄˹̭ͮ޺Ĩ̔ȡ܈ԳԺϛˢ\\ԆǟÕʁئ“ٌ΅ıȟ֑Ń֡¥׃âளą֜Ҷ΁ɔէÈ̃ʐȥӎӃ޵ɦʥǬભž̋ǐ̀ɀࠗ¨׿ѧΏ[ťȳеğΫĂѺʸǼ̤ϞȈіǎَĄȰĢ"],"encodeOffsets":[[-84242,23746]]}},{"type":"Feature","id":"-99","properties":{"name":"Northern Cyprus"},"geometry":{"type":"Polygon","coordinates":["@@ÐJŨȮ؄Yކʢ֧ΧÔƿęˆLJÙűj¥iĎѾNjVɫïƿ¬"],"encodeOffsets":[[33518,35984]]}},{"type":"Feature","id":"CYP","properties":{"name":"Cyprus"},"geometry":{"type":"Polygon","coordinates":["@@€ãࡱͿЩŊȟͶЎŒǀ«ɬðnjUÒ½j覎ŲiLjÚ̇"],"encodeOffsets":[[34789,35900]]}},{"type":"Feature","id":"CZE","properties":{"name":"Czech Republic"},"geometry":{"type":"Polygon","coordinates":["@@ϯǂЁ©ٵʲ̏Ùҿ΅ر˔ӃΰѕȬėΠƧʠؒǾ̸Ⱦ׾ǎɂdžɜīϒĖЊ˓ؼñ¿ɳҘǧŲɒּĥĄʿز»ϮЯʡCŽƯȕ—ÅȑLJ¡wý˹ēϋbšȁ"],"encodeOffsets":[[17368,49764]]}},{"type":"Feature","id":"DEU","properties":{"name":"Germany"},"geometry":{"type":"Polygon","coordinates":["@@d͗ࡔțS̗ࡢǂҾɰॊͧІˋȞёɹɣ̨̙Ⱥ҅ß́Έ՛ϑĕɛĬɁDž׽Ǎ̷ȽؑǽƨʟĘΟіȫӄί̑ϯ̟ŃŢշýƛʿǤЕ~׷ƭݍ–ţɛыɺʩ±࣑ʲǥǻ܍Nń״ьֺ௅ƸЇɘ´ςǗȐĨ֨ƗࢢԎ@Ɉ͂Ⱦޔƿ˴ǐDz۰°Ƽȃ֮вȓ̀ӈٌōՠŸ"],"encodeOffsets":[[10161,56303]]}},{"type":"Feature","id":"DJI","properties":{"name":"Djibouti"},"geometry":{"type":"Polygon","coordinates":["@@ȤʹΑӏȩήɯ̱҇ȅƬȭÏҷb_ʮßɶ˴Ѐ̐ϊήñʪȴ"],"encodeOffsets":[[44116,13005]]}},{"type":"Feature","id":"DNK","properties":{"name":"Denmark"},"geometry":{"type":"MultiPolygon","coordinates":[["@@ԋڹ࢟ӄŝΒ௼˨ˎу"],["@@ȵ̓ʡĞ؁؁ɮХ՟ŷًŎͽҲ}࡬Ɣɪʌʦ݌À̐ɴڮʂƒѝʟ˙ĶɽҘŵ"]],"encodeOffsets":[[[12995,56945]],[[11175,57814]]]}},{"type":"Feature","id":"DOM","properties":{"name":"Dominican Republic"},"geometry":{"type":"Polygon","coordinates":["@@ŀƞپIӾɏɜtƴ̕Ҡhʡϐ‰Ю̷̯ͿЍǼϫ•ˡ¢ƱƵ͑½ŷȲˣťͳֻɏƆ§ʎjɬɍʦȲƚÞ͒óҜ"],"encodeOffsets":[[-73433,20188]]}},{"type":"Feature","id":"DZA","properties":{"name":"Algeria"},"geometry":{"type":"Polygon","coordinates":["@@ᮩཽᝩ࿷இϑटćU՘ϵƌԹʊȧЀᬻᆴᬻᆴṕᎠfnj@ÊQ঺ബب࠼Ÿێɦ͎тচͪ˜جӢòϞ̶સƚƸ͜ɛDz̃ࢲ¹Ԟ́ՠ߰ҠࣦƢՌΎ߶ʰ෎Ƭർæшůߊͨ࣌P΀ȝֺ¾ǟћƄߟȡۙԭҵôمۊԃRȯԮ͹Ϊຝ˖ݏ°ϵƧۇÔϥŃҟòՇͫΗӺؓŽέ̘ҵϼƸڒϷςՃ"],"encodeOffsets":[[12288,24035]]}},{"type":"Feature","id":"ECU","properties":{"name":"Ecuador"},"geometry":{"type":"Polygon","coordinates":["@@҂غǻξ͍ϵԉςǞʀƙބ̎ŴƺԼ͆զÍ΄ҢǸ׀Ͱࡀӑƾ`Ȳί܊śʆƆЮ˧άȣŞٓʽճࣷ࢟য়ͧԥܵǃ֣Ӆ΋ΙъͻĞ΍áw̮ʈȨıΔ"],"encodeOffsets":[[-82229,-3486]]}},{"type":"Feature","id":"EGY","properties":{"name":"Egypt"},"geometry":{"type":"Polygon","coordinates":["@@ɽͷǹىɫѩȝƥ˩˔ϛϒ׵ஸđùΐࢯԪࡋٌವ̴ҙ˒ӃݮछǗƣ‚ճ঒ݭƨǣΏ@Ὁ@⁩@@ᶶ@Ჴʥڲɐ԰Żά̤Ж૦b߲ɝ࠲ʛϴſ٨ˊΌʊݎêװŃɮеȜ˜ڨȣټ³аɄւ෽"],"encodeOffsets":[[35761,30210]]}},{"type":"Feature","id":"ERI","properties":{"name":"Eritrea"},"geometry":{"type":"Polygon","coordinates":["@@˻˖ΉӰϋ˒ɏܷ̄ͶֻXȭǬӯȡԛϢʽط঑ǬęʹβఀĊ֒ˆʴؤƐьӒӦঃɴޗҢУବߏҲӍҖӝˀ˿аʧʩȳέò"],"encodeOffsets":[[43368,12844]]}},{"type":"Feature","id":"ESP","properties":{"name":"Spain"},"geometry":{"type":"Polygon","coordinates":["@@¦״΃θஒ؆ਊƱ૾NࣂƝۦªമƒͰ͛໺ϡ̨ǺीϝআŊ®ӥߓ֓ઁǯõ˱ԩү͕ہ͞ӑӟϑǹճىǗש٥੧_ߟhՃ͍̓ͅЩê̵˴ʃӚ޷žé˦̶̀Śɬ̃ʢɶրͳԌδè’ЈƎŬZپϲɪɻфөˆƝŁӹCɁЬ΃ū̥ɇ"],"encodeOffsets":[[-9251,42886]]}},{"type":"Feature","id":"EST","properties":{"name":"Estonia"},"geometry":{"type":"Polygon","coordinates":["@@ĮӸ̱ŁՓ̘ñӘਫ਼ɼ੔Ũ࣮Ƒࢂ|Ŵƣׯӝʞ޵ΫˉۙDܡ̸ρļ܏Ʃ"],"encodeOffsets":[[24897,59181]]}},{"type":"Feature","id":"ETH","properties":{"name":"Ethiopia"},"geometry":{"type":"Polygon","coordinates":["@@ԜϡӰȢȮǫּWܸ͵ɐ̃όˑΊӯ˼˕̏ω˳Ͽàɵ`ʭҸaȮÐȆƫǽ̴̕ҧ̴Й̛͎ᩨঽۺNᛛᡃફ™ݟףաeɯ˅ַB͹˴ލΙʝΓ֕àȃĬȟwˇT੟܌ב@˹ˢ@ҾѧƘӻࣴϥȚƧʹэЦԧÒ˸ӐҀrŲʰ[ݲʞࢠЊɾĎ΄ήٜԔи΀ࠠƆܠ঒ǫʾظ"],"encodeOffsets":[[38816,15319]]}},{"type":"Feature","id":"FIN","properties":{"name":"Finland"},"geometry":{"type":"Polygon","coordinates":["@@ūיಀ֓ޡى঎ख़֡ܛݴس΅յఘֻ́ѓޭӟᅡੵໃá๑̯ൃǯӡҞ߿ˠȈࠢСݶАӪނՆ኎࣮֖Ǭē΢ୟЈ˳͜uಒ಻ֲ૩ЪԊɞतѻલ¦ࣘȭߠϊЬ؞ಬ˶઄ͯΡכ"],"encodeOffsets":[[29279,70723]]}},{"type":"Feature","id":"FJI","properties":{"name":"Fiji"},"geometry":{"type":"MultiPolygon","coordinates":[["@@̂ʍƓѭԳŗҩļąτ͖̀ϤĻȼƐ"],["@@՛ǯŅ̼оǤˊ°Ӱˀ@ЧՕȷ"],["@@é­@ШǨžĽЗ"]],"encodeOffsets":[[[182655,-17756]],[[183669,-17204]],[[-184235,-16897]]]}},{"type":"Feature","id":"FLK","properties":{"name":"Falkland Islands"},"geometry":{"type":"Polygon","coordinates":["@@৘Ԍ܎ȿԌʹڦϙʥ̋ଋʥϙ̌܋ϙпϚ"],"encodeOffsets":[[-62668,-53094]]}},{"type":"Feature","id":"FRA","properties":{"name":"France"},"geometry":{"type":"MultiPolygon","coordinates":[["@@ˣ٭ϡǠș֢ǜ̺ը͎Ɯܛ"],["@@הЅќà݀ϥȊñʎjЈɗெƷыֹŃ׳ɱƝϣü‚ɇؙҽ]ϟВƀ˾ρ“ʁʚ̿̅ʯɐٱҖŃĩηݿӅစɬ௧˗ĩԑঅʼnिϞ̧ǹ໹Ϣͯ͜ѢԎdžူࢁࢤإю౹͒čؖઠǾථɏˇॎߌέዠپʨێܾǞŪ̑ϸ_ϸ͵"]],"encodeOffsets":[[[9790,43165]],[[3675,51589]]]}},{"type":"Feature","id":"GAB","properties":{"name":"Gabon"},"geometry":{"type":"Polygon","coordinates":["@@ࡹࡔ։ۚԙࢄ‚˨ǾˎȲؔǜخ˴¶௢SOৠЌÆԞőӼňľ¯ÓνɼѡشèȾǗεঃЊӹĞٿŁ֑ʳЇݏ–҅Иãϋ֥Ĺ˽Ɂ̈́֋ٕҩ"],"encodeOffsets":[[11361,-4074]]}},{"type":"Feature","id":"GBR","properties":{"name":"United Kingdom"},"geometry":{"type":"MultiPolygon","coordinates":[["@@҉ֽًǦԱ[ǦҊǥ҈۴–ࣔԳ"],["@@࣋ࣧࡦŘऄIɕۅݯݩࢄÃäĕݠ঱ֺƇԬढ़ʈͧৰDžķ՝ѓʗͲѣݱѯ૳Rෝɱϻǒ։ϿޥĪם͍ҁǘ௼ࢨݪǺOBಽƔʃͰ࢜ʺҡҐdžռఢ÷D@ŮӤ֛Ԯ_\\৵ƨȧɬ̨ϒˡɴҍЇ·߶щє̨ࢆٶھڤá০ì"]],"encodeOffsets":[[[-5797,55864]],[[-3077,60043]]]}},{"type":"Feature","id":"GEO","properties":{"name":"Georgia"},"geometry":{"type":"Polygon","coordinates":["@@Ųάȿִӟ̲ҭĬ̯ʴĺIJ܄ƝఆƋଦЕƦƻԚƂ޶ǭʴ·Նșɓřвғŗıҏºصʎȵƍଢ଼ſ߳Юࣅ¡"],"encodeOffsets":[[42552,42533]]}},{"type":"Feature","id":"GHA","properties":{"name":"Ghana"},"geometry":{"type":"Polygon","coordinates":["@@೉ӯҳ˽ݳʑݡʆœͨηܤɖैΠ۸ɟ஢ŗنrӊฤ¢ϊÕ˔ƊϴáÕʿΖџC؍Ąڍɂ̫ȅݳäйɢՓȈ̍"],"encodeOffsets":[[1086,6072]]}},{"type":"Feature","id":"GIN","properties":{"name":"Guinea"},"geometry":{"type":"Polygon","coordinates":["@@ʃtǡͷʁJǏǴÈͶΗԨɕħǵmɳ³V̮Ƈɘ‚ʔǻΜɹ̜ڥDțǁɵoƝǷīɹ҅σρӼ͛͢ɋŊȿǖħϊūȂʓƐώЦʮeɖƘȄDƄŎï˨ĢĖd˶МU؀ȱȄlÚĤҜáŨ´¶̭ƆBɖŒƔƒɸɇάãɲǺ˖ŒȬŠǚuȈȁĴɳΆΙǣɏ˙ǴĊŀį«ʡʲʍǗÝå˷Ș΍Ⱥڧ̷ĵăśÞNj·νƃA"],"encodeOffsets":[[-8641,7871]]}},{"type":"Feature","id":"GMB","properties":{"name":"Gambia"},"geometry":{"type":"Polygon","coordinates":["@@ņόࣶzȎȦˊ`ͨȷʼIˢƚǞʏεȋιdέǰ̷ȗƭQȫŝއl"],"encodeOffsets":[[-17245,13468]]}},{"type":"Feature","id":"GNB","properties":{"name":"Guinea Bissau"},"geometry":{"type":"Polygon","coordinates":["@@҅ΘΝÈȕʀLŸʯǴÁǶѼƌ˦ɦĨ༈•c˵ġĕð˧ƃōȃCɕƗʭfύХ"],"encodeOffsets":[[-15493,11306]]}},{"type":"Feature","id":"GNQ","properties":{"name":"Equatorial Guinea"},"geometry":{"type":"Polygon","coordinates":["@@ƿŴ़̀െmPয়௡T˳µ"],"encodeOffsets":[[9721,1035]]}},{"type":"Feature","id":"GRC","properties":{"name":"Greece"},"geometry":{"type":"MultiPolygon","coordinates":[["@@Ҡ˱ٺ¶شÑqƣҜĶĿʛ௃íTƒਁǎƺΦ"],["@@ʹՁȥĥԟ|ѫĀৱɓ׌ҿяƋҳAѻўƿȁȊԅрЁ̓ǿҴϯжʑ^ӅޥɠʜѕՓĕ͈ݏ֏Yۍμ̿ڦƧ֒͝ϮљӐÉʆϸТ¼˚˘Ũjɚռö͌ȀҖgƒƦdž„ت{ڨɲע̉ކĀVмЦɝ"]],"encodeOffsets":[[[24269,36562]],[[27243,42560]]]}},{"type":"Feature","id":"GRL","properties":{"name":"Greenland"},"geometry":{"type":"Polygon","coordinates":["@@ᬜԆ᱒›ੴ̴ᲈĄ䀦Ŀ㉊ڗ༅͕ộ™⭏ćшƫᲐĠᡚ́࿈ʴۦ̝इӧᒞ̺✘͚ᠼNjҾΫ⃝ױӃȕ᧑ơወ¡ছؕگկ€ध৚շಽ“൧ˇ༂ѽȢ܋࣍ýઞܡህÑঈ΁˟̑இŽ୥E੆֩\\Ϗပΐћɣଌȿ઼ԣ͈ڱກlj٫͖ਣӘ˼֭উѵᕖ•୆¯ᖯܵᗿڏឧ́ओIࢅ͓ୟࢱᅵכׅ“૧ȷ஽ȝܛԱ[כыտോڧͺٿϗ۝љࠍஅ½఍ۈဿLࠁҢ֕ࠐฝਲэոŗݮ୓ޢ̢ئ֗̒ࠪচొ̺ͨΘǬڀॡ̕қůݯţਏ˜Éְ͢҂ެ\\႔ɟ෿Քݩ˾࠷ş۫ȼम޴ԝ̺ڗ׈ৡࢼ੯͚XΚᖷӮᄻÖᖟ‘Ꮕ×ইˌวՈᕂ˄ၚ¬≹ɖ቉΄Ś͜ẊИᶎИ̪͘ᗗ̠ܺͰ᯲ז௢ĚΓϘጲɜᣚƂᣖRࣺʽᕺҨፘ̽୺áპ˙ፅҐŘή"],"encodeOffsets":[[-47886,84612]]}},{"type":"Feature","id":"GTM","properties":{"name":"Guatemala"},"geometry":{"type":"Polygon","coordinates":["@@ћƦԻfϩǖҍΌrʖĮȠšƾКۆ઄Ft˸Ƌ¾ġǺ̵Ț̹ˬϜDBӂ޸BަUOڗßॅʤ@˚ƱòŰʘŃϥ͍ЉɻÏljâǑǧɇȟ½¬ıƿġ˽Ƀ}ŭ"],"encodeOffsets":[[-92257,14065]]}},{"type":"Feature","id":"GUF","properties":{"name":"French Guiana"},"geometry":{"type":"Polygon","coordinates":["@@͉͑ГÑŗʀȉ–ʹɩνǦɈΪòϤƢή͛ӸáֺѪܠ˸ğؤȥࢸۿƔ·ӻޑʳأ"],"encodeOffsets":[[-53817,2565]]}},{"type":"Feature","id":"GUY","properties":{"name":"Guyana"},"geometry":{"type":"Polygon","coordinates":["@@ր̯Դյzџ̈́o҈Чͪ̇Ƈݱԛɕ°ȣƹџϊ؏ːAŎӃԢܳȱ‰ҫî˙ɡϟƥ˅—ġǑЭ¦ԫЀÓϴɋьƆܐɸ̐ȕϸ˿ŶŊτțȘѩ™ْ֩ɬɲiϲԬƊȾƾ˽̸ô̬ږӲ"],"encodeOffsets":[[-61192,8568]]}},{"type":"Feature","id":"HND","properties":{"name":"Honduras"},"geometry":{"type":"Polygon","coordinates":["@@ơˀʭòÐʹŗĞǣÒσij‹ŔʩƈǷǚʛìǨɈáǒÐNJЊɼϦ͎ĔȂƨʊ\\þ垦ϸùϲv˒ĢİĦˎ©ȪÉɘnǖòϨśƄkʲƿʐį̏Źɜɳ˽jśŕ̇ŋɃAȅŃǙœƛźĕ{ŇȩăRaǥ̉ɳƹıđĽʛǞǹɣǫPȟqlЭūQĿȓʽ“"],"encodeOffsets":[[-89412,13297]]}},{"type":"Feature","id":"HRV","properties":{"name":"Croatia"},"geometry":{"type":"Polygon","coordinates":["@@Ȳ͗ˊʇ͓̓ϝȆׇ[ܟƔϽmǻǧ̝ȖǫΑЪϽǼʹϮ̽͌ȃ͆Ηݔ͇ġƛ߃̶ӣ̢ޑʠ۹ؤǞØϥΞe˲եƄʱγʝˮn̆Šbג…Ƹƚ˸ƍͤgGɼ̈ĒĈͺڞɠˊĻؼέۜlj̼Ų"],"encodeOffsets":[[19282,47011]]}},{"type":"Feature","id":"HTI","properties":{"name":"Haiti"},"geometry":{"type":"Polygon","coordinates":["@@Ԣ™ܰƁôқÝ͑ȱƙɎʥiɫ֏ƜЅÍԡÔϽƿ҉ʾö˔ޜśيã̢ȈϧθP͎ՋžȌɶ"],"encodeOffsets":[[-74946,20394]]}},{"type":"Feature","id":"HUN","properties":{"name":"Hungary"},"geometry":{"type":"Polygon","coordinates":["@@˨ըǍǼӂDÜ΄ђɋ̲ğ۸ļäǚͮ~ЦžĜÃЂŀȠȢˠ¼࣒ʭǴĒҲɭÎɣԡǭЉ֫ԕ֭کǁԽš١ə̻űۛNJػήˉļǍ˴ƗV"],"encodeOffsets":[[16592,47977]]}},{"type":"Feature","id":"IDN","properties":{"name":"Indonesia"},"geometry":{"type":"MultiPolygon","coordinates":[["@@Λe૝ך޴ǒѴʭ̎ʭ»ɩ"],["@@ܙȁijĶø˸ΰԢࠨͬĐǓfʫշع"],["@@̢ɣԲèȼΥॿǛ׉őҍP̀ӚҤPɤ̖"],["@@ūұ౅ʅૣľE̬ښǪՂʥ֔Üݬ̮"],["@@ྔċȂΌ༘З̪կీƵਐӿय़͋ऍ͸ݻwࢍØ޻ưঅ͎؝ČΓŁ໕ΌƣΰޑØּߤ৶·ڴ͡ΒÛŘ̗"],["@@ѝֱćنƬ̠Ǭ˴ȒʗCЏ"],["@@̿˥ׅƸǏΰࡘ¢Ⱦˣ"],["@@̨ٝۿΌۯìӃÅׇˆȦҦਠ”ऎʕ"],["@@ɼയ࢈ԉ۰ࢼ८ԔݜBܘ̉خ̛ࣘLJbᩑbᩑݟې࡟ǜȷʇ੡}ΦۂՈɺɕࣲЕ۸࿃܆ۗêృަʛУ͑óȏ̮GκٛЮ̢ࣞ״gëɠ௵DͩԄݥƺΡдଈȰњ˜ഘ·Ƃ̹"],["@@ڭ࠭كlj߱ǐඓ¥ܽŧţٍݪݛҒϠ༪˸çϯλŪιӯ͙݉ߒ੿Ƶ˿ݲॻQտ҅ʙ̐͡Мی࠙͗ȻɶŊ͖؅ӲØࠌ֕ʭîও”றՓũίʚʌޜŽ߸ΛPʻֺΎվŤښф౎ǮΎ܎ذپʛ੖śॴ–ࠨ؎Ʀȉ"],["@@©ܽџĈŷԝΌѷɽĵ͹Ւʟ੺ǚڤ˨̨ÔҝӸóĀ΃"],["@@सާহį˫ֵšݿַ߱u࠷͕౻ŭ̚ॕϙͫԤ׳´лːৃ̟̩Оս¯ۗĬŹૺнɺЕܘŝ݀ĮުԂ֐Ɩָ֗ӅըǠ՜ÑӪъЖôߒɽۆǶњୠ͔̈̆क़ॲ@ܰƙӍݷآߓơϭ"],["@@छkۻ۰અۊέԚٍۄзؾٕ୴۪݅ʙܠ̳ڀݵՊѭܘمҺࢗऒóђզ‘ಢNjݔࠓٮ֫ҪΓߔࣙࡢ_ۺֹӠ۳٘ϥͳۉӖ̞̅sƜו̊ҵؠõФՏɁ਱‘ಟ"]],"encodeOffsets":[[[123613,-10485]],[[127423,-10383]],[[120730,-8289]],[[125854,-8288]],[[111231,-6940]],[[137959,-6363]],[[130304,-3542]],[[133603,-3168]],[[137363,-1179]],[[128247,1454]],[[131777,1160]],[[120705,1872]],[[108358,-5992]]]}},{"type":"Feature","id":"IND","properties":{"name":"India"},"geometry":{"type":"Polygon","coordinates":["@@ࣚটďۅͮїѕ׽ŒɾएࠜՑ୞חՑϟ͛޻ࠀͅߊЭરһସʼnӜёٮāৠȝ۪bĪͪŋՖÞβԠǮìڋlǙކ͉Ոƀ܀Çۈ|ÐԪ΁ˎڴŀވشॸ՘۶ȷ״ΞЀԹ˳Λ࣠űÜ͇̍Ʒèԫ׷Ʋછׅ~ӓҩ۵§ХϏۗځȒࢇȏ˹ĚΣгȥѵ೰ɵEƍ՝ҡѦʸӎϖ¶ϰ܆ӝƜީ]ߝŚóאБ¤ڕζ֭̓؆ѻԿ̻ȅ̩Ԭɣƛԑ̆كžەţֱ̫Zਛǩ´ك҃ӻ௃֡ळ঩كՋ࠷ջCϭлȹݳ̝Ͻ«ʥٙǪધ®ۡΣߙI෗ѣ¡ϣٙʰˣދʃ˱֯͵ʍߑ޸ϳ୴͑ࡒ̍Јѿ߰ȻੂơՀޅ଼Α࿀ʣ੾HৰǍ޾௣ԉףĶ઱৲И̤ʝͤড܊֖֔ᇜCǗܞҽюĩ٨ջϘऒࢢঊÙ࢞ࢢՄ࡞ࠄࡈ_״ܒӠڳд֪݂̇̕Ьβ౤ȱपŰߺ۸"],"encodeOffsets":[[79706,36346]]}},{"type":"Feature","id":"IRL","properties":{"name":"Ireland"},"geometry":{"type":"Polygon","coordinates":["@@ƒ׷ًݣ๯ӹ஑Ŷڼ࢚ѭࡢତڄٌϼǦ҇ǥ҉Բ\\ٌǥ"],"encodeOffsets":[[-6346,55161]]}},{"type":"Feature","id":"IRN","properties":{"name":"Iran"},"geometry":{"type":"Polygon","coordinates":["@@݈njװӔ֚{τƾװýघэڤğ।ݓظ‰òۻ΁਷ɱؑκŭΫҡˠڡàՓِƙæեݿݿжѵ͸ԓߦυx݉ДƋêϯ௉ѡ̓উཌྷʪࣷȖेŊΧਐЕƪ٣ƭࡑНਇ˦ࡑ٦߳ʈ֗ߘا૪ҍƋՕ˦̻͝ҭѴS҂ˍ@Ɛ،ѝٔ਍Ң׉ߜȜپц̂ÙӬտʨխ৊ҟڨǐʼʿ६ּʈƄͅъϯ־ő̤~রئ̀Øʞʙ́гԼѱȾ¦ˈإߖǩ׎у஠ƟಾɞĄȞ"],"encodeOffsets":[[55216,38092]]}},{"type":"Feature","id":"IRQ","properties":{"name":"Iraq"},"geometry":{"type":"Polygon","coordinates":["@@րʧÚӫх́țٽ׊ߛ਎ҡўٓƏ؋ˎ@TҁҮѳӿ¤֟ê؝߭༟äᛍၖఫךৡɪ͹৾ᇶ࢔͆৬āؘҢȺјԾΰž঎Ň̐ɉЖƚծ৉"],"encodeOffsets":[[46511,36842]]}},{"type":"Feature","id":"ISL","properties":{"name":"Iceland"},"geometry":{"type":"Polygon","coordinates":["@@șիॊֵથٙᝓֹܣƵૉŮᚑˈࠠψᆧЪ๪ǎ—ʘᄋȜ֨նౠŰಸ֭౨Ҝ੒ʃൌ҄ආÑ"],"encodeOffsets":[[-14856,68051]]}},{"type":"Feature","id":"ISR","properties":{"name":"Israel"},"geometry":{"type":"Polygon","coordinates":["@@ƥ˅̣Ŝǫ֓ɂĥɋř—ɛЄŖp͛нഉց෾ʔˢ˶ɞϼǠيŤɆzVˬCþƦɤ\\`·ŕŵhM"],"encodeOffsets":[[36578,33495]]}},{"type":"Feature","id":"ITA","properties":{"name":"Italy"},"geometry":{"type":"MultiPolygon","coordinates":[["@@̟ڋŲʹǭѝٝ̈́ёĞ୩ѐŞќজûࡪĠْò"],["@@Ԍ׭ş૕ϣÂ΁˫͇ɞ‘২ȓӒҨ¥рʼ"],["@@ரɏĝЯȬΧڝŪہ̗²зĻʇˠё߀чцۛदڱچLȲȃɽǗݪ̥ؠʩܜѫĔƿƽ̛үϼܳƐΝի؈̷ıѫΗ¹҅ܛΕÝHʲǢҊǼǶ͝ӤʱшΑŀʛδգƴεͶثÆٿϜޑմ֯ӜʿࠪйĮہˤϯŕӝϵΓÕĪθҕńɏٲ̆ʰʙ̀”ʂβǵМ¢Ҽ˶ƢƃА€ǼͺتĿψƚâΆԘšĮdžࠨƤȊ̉"]],"encodeOffsets":[[[15893,39149]],[[9432,42200]],[[12674,47890]]]}},{"type":"Feature","id":"JAM","properties":{"name":"Jamaica"},"geometry":{"type":"Polygon","coordinates":["@@֢÷ҀȫƔɯןeʭƗҹƊӑ̪ĶȔΜÎȒƒ"],"encodeOffsets":[[-79431,18935]]}},{"type":"Feature","id":"JOR","properties":{"name":"Jordan"},"geometry":{"type":"Polygon","coordinates":["@@Ʀˆपͫ࿪ࣆͺ৽Džų၅у࠸࠿ˣƛƑ˭ٙřȩ̡εʵधƆƒŨоഊo͜Ůʚ@Ԥ"],"encodeOffsets":[[36399,33172]]}},{"type":"Feature","id":"JPN","properties":{"name":"Japan"},"geometry":{"type":"MultiPolygon","coordinates":[["@@ņ˽ҿԕΉːљțɝӭշʈRЊҬԆӌīΊΜؠǹ"],["@@́ڡƤсѩף੹Ѓ๏½ணॡ͔֡“غษȃষЃঝe࡞أ֗෗իΝН͜ȶݶՏʒͿ־ߐʶѲՈࡌѢ؞ָာʤ࣎ǣࢠ๺֔Б௾ࡀӌ͜ՈਈƟा΢ՎࣀƸҞୗ}ڻޥࡍbࢁ"],["@@נǵרΤȈहఝɯ݁࠱೓ָқँण]ř࠴д٨࣌²ʖ୐ʜټন࢓٤˯"]],"encodeOffsets":[[[137870,34969]],[[144360,38034]],[[147365,45235]]]}},{"type":"Feature","id":"KAZ","properties":{"name":"Kazakhstan"},"geometry":{"type":"Polygon","coordinates":["@@ӕƹ્דο׹̹KɱЊ੫‚ǡێХNÚࡆ৓ؘ෷ßডũߣݶۋ͆ಥ׼ƽðᓗӹᶽљ£יچ֧ɼॕǩχ˧±ȲȶΖDž̊অ˺ϛݮҩɆ…˜ࠊāŽؘ܎ƎܼűƲࠎƭԲ࠿£܍ȴঃσ޵ǭяƌĐўՙ֘دw܉֬ӞِʕǢڢऊࡺӣŀؘჄࣴಾtᇢ׉঺ͻࢼΠ೰j੺ѥʔʠ୼—ɂЊഷ׀߮Цƿɮ߮ɔ؅ֺϬ˼Ḯ̈ШȺᑆ̴ݰΒຢǹ˄ࢉ࢚Ȳઆ˹éҝ߮´ᑌߎ̭ˁ੶٭ሠᒑ҄ѰୄӛீɎҪƯКӟטNjΨΥ઎ŒѾԣٕ֓ۥÿ¡ࡅұϝဟˢ؅ຑїȇဗͱݲลֻɓäӏԭŬу̠ఝĖඃx̧ġ஥ΞӉǧŽӹ൩̂փşȉρ"],"encodeOffsets":[[72666,43281]]}},{"type":"Feature","id":"KEN","properties":{"name":"Kenya"},"geometry":{"type":"Polygon","coordinates":["@@ӾۙיͱȹΕ̿Õšףˑ͹Ǐ֑ͷ˥஻ࡀËӤᵁႌƙĢSࢺʊ;а֌̨ؔσ॰įтЉ׎ԬԈ֬ֆѨƗ@ҽ˺ˡג@੠܋ˈSȠxȄī֖ßʞΔގΚͺ˳ָAܽ॑Xᵣ"],"encodeOffsets":[[41977,-878]]}},{"type":"Feature","id":"KGZ","properties":{"name":"Kyrgyzstan"},"geometry":{"type":"Polygon","coordinates":["@@ȊςքŠ൪́žӺӊǨ஦Ν̨Ģ඄wఞĕф̟Ԯūşȏ೛ғ̙ͭઁıͅ՛ࢷŒׇǏߣЇŜȟʇȓཟŵਡ˘࣫ÝĂӜࣴƕ̮ʸٖĉ੾؂঻ѸױȽإ͂۶ծʟĊ"],"encodeOffsets":[[72666,43281]]}},{"type":"Feature","id":"KHM","properties":{"name":"Cambodia"},"geometry":{"type":"Polygon","coordinates":["@@΁Ѭыࢄȣ২ՠۨઘdž߀ťۚ͡Ϟׄݖ̱Ȝ֕Ļ৕ඳ٧τԙࢥÓܫͷ۱Ū"],"encodeOffsets":[[105982,10888]]}},{"type":"Feature","id":"KOR","properties":{"name":"South Korea"},"geometry":{"type":"Polygon","coordinates":["@@ܨযȺխPॷ̓ҥݽljڥΏݳïĥҚƼـχ࢔ذƚֻܘÂúϒ‡͞Ϝצ¢ΨÈŨȮ"],"encodeOffsets":[[131431,39539]]}},{"type":"Feature","id":"CS-KM","properties":{"name":"Kosovo"},"geometry":{"type":"Polygon","coordinates":["@@›ǣŃPĘ́ȩĐdzɦƾȌȪÒŜ˨ư²Ţşƾ¿ŌƅƒŸǎƻŢLĥȳijij„×ȉӹŻ"],"encodeOffsets":[[21261,43062]]}},{"type":"Feature","id":"KWT","properties":{"name":"Kuwait"},"geometry":{"type":"Polygon","coordinates":["@@Ǭχõȓ˔هשuȽАݟĆ؞߮֠é"],"encodeOffsets":[[49126,30696]]}},{"type":"Feature","id":"LAO","properties":{"name":"Laos"},"geometry":{"type":"Polygon","coordinates":["@@˚Ϝœ܆ڹܸ¿ٕࠦھٍÎǛ̉ӯyʣƨࢯԅoݬȸࢮ֧ž³ԎηʸǴ̲ܐնøȡ҄wŵ०ѦŬӮڏϖޅਚO͚ܹ՝ɗʉ̟৔ԉۦ঳Ռ݋َ׏ɄץƵ࠿ݕ̲ϝ׃ۙ͢"],"encodeOffsets":[[107745,14616]]}},{"type":"Feature","id":"LBN","properties":{"name":"Lebanon"},"geometry":{"type":"Polygon","coordinates":["@@ɣ[ýƥ˫D̘ۄмעfˆϘ§Ɛͣқ̓ȷҟ"],"encodeOffsets":[[36681,34077]]}},{"type":"Feature","id":"LBR","properties":{"name":"Liberia"},"geometry":{"type":"Polygon","coordinates":["@@ɗQࡽАޅٖ܏Ң֣ըȪː¬ʔϜҘϺϺǶnɖĨΘԧÇ͵ǐdzʂIǢ͸ʄsŸʓĎНǽύʖɱˊÇΤΙ~ͧăĿÝە"],"encodeOffsets":[[-7897,4470]]}},{"type":"Feature","id":"LBY","properties":{"name":"Libya"},"geometry":{"type":"Polygon","coordinates":["@@ק̷ҿҤ೧βρՄڑϸϻƷ̗ҶήӹؔͬΘñՈńҠÓϦƨۈ¯϶˕ݐШȜðΠėΒ־͔ʶːЦʌ´٦দ́ΜðۮƓ૞ϓЀݛݮǍஆΙࣆйЦɔЖϮț٠˂Ф؄ЀׂŘ଒ǣ˺ϑ̺Iˌƛ࠴ıȲˣ̣ЕżΫɏԯʦڱ@Ჳ@ᶵ@့ॱGYΙ‧ྐ‧ྒࡓҟ"],"encodeOffsets":[[15208,23412]]}},{"type":"Feature","id":"LKA","properties":{"name":"Sri Lanka"},"geometry":{"type":"Polygon","coordinates":["@@ų࢓ΙʇܵȓЍڜƫீϠ഼׆ұϺסО࢓"],"encodeOffsets":[[83751,7704]]}},{"type":"Feature","id":"LSO","properties":{"name":"Lesotho"},"geometry":{"type":"Polygon","coordinates":["@@̆ʩʳУƛ˛ҳſƹˍ̛ċؿ٨҄ՐҖ͢ϼǠξʵ"],"encodeOffsets":[[29674,-29650]]}},{"type":"Feature","id":"LTU","properties":{"name":"Lithuania"},"geometry":{"type":"Polygon","coordinates":["@@ãɊĚɲχƄࢡƨDZ۸२ʴඬÁࠜĊŞǩ҂Ã߲СĀϓۏˏșӃ࣯̓߻NȫʶљĜ"],"encodeOffsets":[[23277,55632]]}},{"type":"Feature","id":"LUX","properties":{"name":"Luxembourg"},"geometry":{"type":"Polygon","coordinates":["@@ǘȏ³ρʍiȉòĞҼɖŽ"],"encodeOffsets":[[6189,51332]]}},{"type":"Feature","id":"LVA","properties":{"name":"Latvia"},"geometry":{"type":"Polygon","coordinates":["@@†نЮՆߊ˼ڜعڪhNJ٤ܐƪςĻܢ̷ۚCКȕîС˒ӷ͕ࣗԛƙ߱ТҁÄŝǪࠛĉණÂ१ʳ"],"encodeOffsets":[[21562,57376]]}},{"type":"Feature","id":"MAR","properties":{"name":"Morocco"},"geometry":{"type":"Polygon","coordinates":["@@ԒΥߜÎࢊȃκU͂՟ºԝ̄ࢱɜDZƷ͛ષƙϝ̵ӡñ—ثঙ͍ͩсۍɥ࠻ŷഫاRহŷ@@@p҉Ա˓ȑϡ@̥Ŋ۹ě˛ٻʿÕЁ੕ୟ࣡ˣୋ΅ϗĵ̡ቅãaD ϶͒ɮ˞ѪÃ˶̀פҴՖ˲ƊɞӬp҂̤Բ̪֔Ւ࡬f\\ц͔ްĢڎָтɠۮۮȿਸ਼͊ܢŔѶդ֨ࡈϦخΐ֘࢈˄ԪؤI"],"encodeOffsets":[[-5318,36614]]}},{"type":"Feature","id":"MDA","properties":{"name":"Moldova"},"geometry":{"type":"Polygon","coordinates":["@@ȨŮ֒ĊؤʽΊϞɥÑ˵̪ƏŨΗ̊ɇÏűƾčɝ×ӷ|ĉŜǫãÒƭɱˍƥ˽ɁĝƯϦĘΪςӝԂˉΠʹʠʯĈ"],"encodeOffsets":[[27259,49379]]}},{"type":"Feature","id":"MDG","properties":{"name":"Madagascar"},"geometry":{"type":"Polygon","coordinates":["@@ɠΥȺ։Ɗঢ়ɒϽĉЗƩʙ˷ӰǁʝLjثõΥɵȗ¿܅ͧওб୅ԯཧ͑ୟϛইہȣܻΡӛɊڙ̜ɳѺÇݘ̑ڠù؂Ʈ؄ϰƢD˪Дِø՚șЈǃՌãޠ̊ҺŔՒмŒҶǤ̶Ʋτ\\ӐӎۖԮʦцŗάΦĵҪ׎fԐ˦ϔ̊ί"],"encodeOffsets":[[50733,-12769]]}},{"type":"Feature","id":"MEX","properties":{"name":"Mexico"},"geometry":{"type":"Polygon","coordinates":["@@͙݅ƥ؁Õ૷ąЧƤқʺЧǚٳ֎سȞӏ͢бࢾɝΐΙ݄ɾٚĎؼưՊƠՖ΂ȨӬè۸Ƣʖ֬ɚࢶȚݔ‡ԚîȬDZ…ЙҋԁȥԝƸƥűγɁٽɅɎǭcǃY̝ԓƳIJķPŭޥV޷AAӁϛC̺˫̶șĢǹƌ½s˷ઃEЙۅŢƽĭȟqʕ्ࣞџ˘ۇɖҷÓګ́чĉץɜؿDŽ޹ϬؿŠ्ϸ۱ВɃɤҹº࡯ˈΓϦࣗӊсՌȧЦ˪ĈđʈȖɔJ̄˱Ϙùͮ˭ъ݋࠴ࡋڀУԼܝ΄ƷȴŸԲѓȞӹФȽהҍæӣѸϿФ™ˀҍو̓٠^͔؇ͬ˫™ӑɴƇͿƔЕĆف̀΋خׁƒȡŸÓŎ˽Ƭ\\ǜթʮɇǴ̕Նё˨ޯʠρɸϿ²ѷКƒͶϡ̨ϑqƭΝ̱ƫJɛԞջӎ؃РїɈ„ؚŵҖЏʺֿϒŏŇɃɖԭȰӷӦÖÚΊ³̸̼ŽϜ٩׶ӱɶ̱Հ̷վϳڦͿݲॖÞ੪ĞÿǑ౔СኀףဪPژ@DΌผ@̪̕јˇԀσ˨ѭȾҥѢʩۤʥՊڒۊhפͱфֹ̄ӯӸӏȂחɾЃپʹ׮ȁ͞|"],"encodeOffsets":[[-99471,26491]]}},{"type":"Feature","id":"MKD","properties":{"name":"Macedonia"},"geometry":{"type":"Polygon","coordinates":["@@ńOœǤӺżȊ˺¶ϴbтˏÒ։DžƒƑƥҕh͋ǿջõΑȴšήń˸"],"encodeOffsets":[[21085,42860]]}},{"type":"Feature","id":"MLI","properties":{"name":"Mali"},"geometry":{"type":"Polygon","coordinates":["@@˰ƶƘӶˊpזɻӄǖ͖ÇŴȈ⁚^ȈךƣļЛ⋈Л⋆౾dᬼᆳᬼᆳȨϿԺʉ϶ƋV՗ठĈFካҟ֗íԭݛƃ଩ï̳̗ա՟IȿLjҥš޻ΑDžʿٳϕŗɍΙǡНŔɱȳūֻڙۡp˳ɭΣÆӥ΋ůȝŁŽάʍĥơhƷʕ٭PɷŴʼnùʱʎ¬ʢĿİdzĉ˚Ǥɐ΅ΚijɴȇȂǙvȫş˕őɱǹΫäɷɈƓ„ɕőƅAµ̮žʾí̽͘ʀǓӔԺ"],"encodeOffsets":[[-12462,14968]]}},{"type":"Feature","id":"MMR","properties":{"name":"Myanmar"},"geometry":{"type":"Polygon","coordinates":["@@ӫηץ›ϥࣥΟƳО݅ՔؗΈօ̭ܵ̃ƹȪу֖ڙĪҷ_ϵ͠ދң޵Сࡷăذʴ٠˯ӼæࣸͽѤ˛৔Ʊਗ਼εۢօуॕ׳ҽöԳȠ̂ਪǫ޾څॺļ̢ӭņ׭ۆÅڰ̊ŵj׾дȦęΤȐ˺Ž࢈ڂȑϐۘ¨ЦҪ۶}Ӕજ׆׸ƱçԬ̎ƸÛ͈ӮÚˮӵξȧ|ٟ“ۙߓۭijঽࢲƔȨޛՐǍʓۣز́ζƷ؞ʔ~΍܏յdẕӓȗ"],"encodeOffsets":[[101933,20672]]}},{"type":"Feature","id":"MNE","properties":{"name":"Montenegro"},"geometry":{"type":"Polygon","coordinates":["@@ÁǀηЯÊˋǫÞɽ˞εǖĢƜŬҦ˚ȜƾüɠƟŬśˠě͌ǧçïƽȋɧó"],"encodeOffsets":[[20277,43521]]}},{"type":"Feature","id":"MNG","properties":{"name":"Mongolia"},"geometry":{"type":"Polygon","coordinates":["@@ࢮƢ྄ܤ౬Єܴʳ࢚]֘Ͻ࠼‰ௐɁࠈגͿӶࢊࢊश΍ނįনɍLjؿஜΛߐƺਫ਼ŌࡆōࠖЗԚѕެT੒Ƌޜȼૈƒ௸פԌĝѰ˭ৌêХهק࠽ɐ΅ӈńࠤŽ٦̴ڬˏހוğ̗ڏĦ௟ŏןʅ؝։౱͙࠷ѽࡹǞҿúѳէˎ͓ƌˣי˯׽҇গ̑ఽ‹ഫ̇এҋϋʾ৭AఓԜࠥŰૣśჃȊऑmӱԀϣޠԱĢ৩ԼଅŞুƞ̡θ͖চׅڲன̀۷Ѿəז"],"encodeOffsets":[[89858,50481]]}},{"type":"Feature","id":"MOZ","properties":{"name":"Mozambique"},"geometry":{"type":"Polygon","coordinates":["@@لæ৞ʁɖńגt̚ʦԌaऀ͜ڞӤƊϕ“࠷ľ݅ಿƨЫʣ׷͙׍՗Եޏ͉ृСॉ͓ࣕƵוׯ΋ȗí׳ЌُǔӱZʣƪ¦{ࠗƋϷȤƝűΓΗ̗ۗ˳য়ҕρ̳ðΟɊÉíѵّRïϊůϖí̠ƬपɓװГஂࢬ॔ɜ؆ŶúĨӶƉʞ˜غǐ׌E੠ѥ˒ЏÔǹȼϳǰ۫gÅ̼āװᢈۘӚЕɴüͨɅ¸͵ǯϷØסոԱʲ׌ζǰíઊΙ؈̣˖̅]ɽદɾٔ"],"encodeOffsets":[[35390,-11796]]}},{"type":"Feature","id":"MRT","properties":{"name":"Mauritania"},"geometry":{"type":"Polygon","coordinates":["@@և־ԗؤ֍ɞГʚҵUЧǽйð˽ˏïҐɺаŀߊģࠨĵкČмɑЎѵδǾˬᾔMǃ௎ȴќ߀øᒸ᪂©F౞Ṗ᎟౽cМ⋅М⋇ƤĻȇי⁙]ųȇ͕ÈӃǕוɼˉoƗӵ˯Ƶ"],"encodeOffsets":[[-12462,14968]]}},{"type":"Feature","id":"MWI","properties":{"name":"Malawi"},"geometry":{"type":"Polygon","coordinates":["@@ɽٓɾથ̆^̤˕Κ؇îઉεǯʱ׋շԲ×עǰϸ·ͶͧɆɳûәЖѵɔʮޮ˄̈LJۢǚڼƞɪɉ܌Ѕϐ࠘ƽǜɵ˶Ϲɾଡ"],"encodeOffsets":[[35390,-11796]]}},{"type":"Feature","id":"MYS","properties":{"name":"Malaysia"},"geometry":{"type":"MultiPolygon","coordinates":[["@@àћֈĶ˞ΈȘýӸԓΜ֛¶֣ęϡĆ˿Öӻ̒ɵͤݑe˳׫Éߑخ঵ښįђӟ֚ś̡۠ҜĠؔȃΤƤƮۈρ"],["@@أ˹ܯƚॱ@̅ॗ͓̇љୟۅǵߑɾЕóөщ՛Òէǟַӆƕ֘؜˽ٮǀǜ܆άǂ৖Ǻ׾ڔЬՐϦѥǮ˺В¸՜œа٪אшڀͼHќыžιֆɻ۬ʧÑ֝͡¥ƮЧ"]],"encodeOffsets":[[[103502,6354]],[[121466,4586]]]}},{"type":"Feature","id":"NAM","properties":{"name":"Namibia"},"geometry":{"type":"Polygon","coordinates":["@@رٌؖ͡ȃࠊȷ،˯ಒm৒ŅҞ͛Όѡۜѳ৘ǽՆۃࠐ»٢КdžԊƞհ}ԄϝŶÐ₮˜׌Е᎞ş໴΂یȒհµͨȍPéӁȍʭC՛͍ͣΎಕ̍سƒ{Ჽࠣ‡BយA᷋ݣѕҋÕՇDŽϗÔƗάͩɰГг"],"encodeOffsets":[[16738,-29262]]}},{"type":"Feature","id":"NCL","properties":{"name":"New Caledonia"},"geometry":{"type":"Polygon","coordinates":["@@ېԵѨϭ͉ȫҥɪ׹ϚէѼ։פś˶β[Һ˹φ˷ˎɻ"],"encodeOffsets":[[169759,-21585]]}},{"type":"Feature","id":"NER","properties":{"name":"Niger"},"geometry":{"type":"Polygon","coordinates":["@@nּॹȐОҿպœϤâТբ̴̘ପðݜƄîԮҠ֘Eኬஈϒᝪ࿸᮪ཾ೨αӀңר̸ȸಯ̾ɓ`ˋΔ˽ǻί͕ၻ«ધੳߋγૉΔ̵CեբmčЃʁµˋƻm֩ंȟ’ځҷٱʔҍ¸ʏşӯ~ӷΧѓq৯ѢЉȵѓb̿͆ࡅ̼ࣗıɕǻşӗʋ͹ÍݣٗӚ̟E˭ʗ"],"encodeOffsets":[[2207,12227]]}},{"type":"Feature","id":"NGA","properties":{"name":"Nigeria"},"geometry":{"type":"Polygon","coordinates":["@@ࢍ̡͉¬͓ȉڥl҇Ղˡ؊שֆكYݍB¶തs՘ǂՊʶʴТԴėɨǔ͸ȍӾ˪ÎݤʌͺŠӘɖǼࣘIJࡆ̻̀ͅєaЊȶৰѡєrӸΨӰ}ʐŠҎ·ٲʓڂҸȠ‘֪ँƼnͬͯğƱ«˧۽ٱɛՙšѧDZȉǝי҅ΉŽыȋ͹ÿΓֽ˱ҽΊ͇aԃӭʑQЍ߷ɍש"],"encodeOffsets":[[8705,4887]]}},{"type":"Feature","id":"NIC","properties":{"name":"Nicaragua"},"geometry":{"type":"Polygon","coordinates":["@@̃ˆϽͺȁ˲Ο˄сϜĤžƒŵÚÒʾ”ŀȔŬRkЮȠrǬOǺɤʜǝĒľƺIJ̊ɴbǦĄQňȪĖ|ƜŹǚ›ȆńɄB̈ŌŜŖ˾iïă§ȉĐ̫ȗ˹ěͷυ®ɏtϙŹĉýΫÌɛǣɋ ɩźƏȩDZʛÈƓǦˉêȕʼnօɞųŇ"],"encodeOffsets":[[-87769,11355]]}},{"type":"Feature","id":"NLD","properties":{"name":"Netherlands"},"geometry":{"type":"Polygon","coordinates":["@@ۦyǀ˳Ƚޓɇ́ԍ@ƘࢡҥȞՏπީǩ؛âѠɲ݀ఆଲΘ"],"encodeOffsets":[[6220,54795]]}},{"type":"Feature","id":"NOR","properties":{"name":"Norway"},"geometry":{"type":"MultiPolygon","coordinates":[["@@᥆ؙઍɣऄՅෛ͵ڵû΢לઃͰಫ˵Ы؝ߟωࣗȮ઱¥णѼԉɝԷ“ūփནƊɝҵ߭Hևױ࠿झಫ஁̨˹̇ͫ࠯bձ޿¾૟՞э˥ধֻۧυӛ֝Ԫဋঁ૫ȟ୏є̛ࣚˇ኶ޞզᕠ۶ဌࢂ໤୦፺ྴඦلᘼ੊ᇎπ൪­౮ۢ໖›ພǘ"],["@@ም΅๝Ȝ׆ɐԕˎეǚͮ̿ொȍ"],["@@᪖صᑟͥұأ݅ǁЍۡৣᅵԢނ̘ఽʐ࿕܂ٷڄᘎ̜Ң̋஦\\͊˼௾ˆ੖̋"],["@@࿮̏ఝҍ᝱ı៙ƖƫɴஹdँϬᣴɼ௞ȫࡘʤᑺȽ"]],"encodeOffsets":[[[28842,72894]],[[25318,79723]],[[18690,81615]],[[26059,82338]]]}},{"type":"Feature","id":"NPL","properties":{"name":"Nepal"},"geometry":{"type":"Polygon","coordinates":["@@ÝαŌՕĩͩ۩aয়Ȟ٭ĂӛђଷŊયҼ߉Ю߿͆͜޼ՒϠΒȪڪʳࡔշҾť˰ЕٶǓۀσौȕঔć"],"encodeOffsets":[[90236,28546]]}},{"type":"Feature","id":"NZL","properties":{"name":"New Zealand"},"geometry":{"type":"MultiPolygon","coordinates":[["@@Ȓ΋װ;ʐΡBΝ̹ϳչإїͷ̴З٭Yܗ̓ɣջӋࡗڇϓнʇޝlխˢࣱÐƗ̰Ҍذ੐ࠦժǀ׾͌ܜѰԎѦώظ͈ɆŰҶלϴȆΧ"],["@@،ࢫlָϜɯŲًڰ˛֨ãӒ͎юĭȯݗʯӫٛjɡʭþαūƻͅҏзֹ٭ͯƟɘΕŨӞ۔˟ҨࣛͲz̦؈̌ƚ٨Ÿլͻ֜vƪБΎڋݔΗת̸àҚұٺɑʂݡ"]],"encodeOffsets":[[[177173,-41901]],[[178803,-37024]]]}},{"type":"Feature","id":"OMN","properties":{"name":"Oman"},"geometry":{"type":"MultiPolygon","coordinates":[["@@ֹ̻ϟªǩȧƉэļ֗ÿĻϯFԽ̻ćХȓǯԹP͡ɃJͻПɷҩĂ֗˳ϱ³˝טٿ൴ᠾ࠾֖၂ϩתv͸ʔΐFΆϞǒƩŞèմіHϖֵҸ̧؞ŋӼƳϜӕɨ˧̞ŃCȉ̩ԃƅɽΟˏ"],["@@ʼnƳDž˺ʔ˺ľñā΍"]],"encodeOffsets":[[[60274,21621]],[[57745,26518]]]}},{"type":"Feature","id":"PAK","properties":{"name":"Pakistan"},"geometry":{"type":"Polygon","coordinates":["@@تϻʞ٥൨ͻ߹۷ऩůౣȲЫα̖݁̈֩ڴгܑӟ`׳ࠃࡇՃ࡝࢝ࢡউÚऑࢡռϗĪ٧ҾэǘܝᇛD֓֕؛Ɇʣ؀٭٘໻ǁിeஃŝ̈́ঊொѢéϰГƌw݊ߥφͷԔеѶඨѕࡀŲԈŅǞȂגóદĈ܎ҶӈشCĠɼٞŌ̴ý͢ʀ±ԌΦԖ՘Ɇͥ֊ߜɴ̢•͒мΜĩмȣΤӬμࣘǮ८ĮѐƺӨĦ"],"encodeOffsets":[[76962,38025]]}},{"type":"Feature","id":"PAN","properties":{"name":"Panama"},"geometry":{"type":"Polygon","coordinates":["@@˫ʎǵҒȺɢɅÎƿˤлɸοÁǝ̇ͻɁǽ‡ĉǩВҗɯŅŧŭϷ©ơԈŋƛˡ¸ǝ͸·ÈɓİέCǻĩŶªǖìǠƲŲIJǩŲK͸͘ö̠̝iDZͲ›ĀæɴȵЮÔΨɄԜǞ˺ʤҬ·‹ĉҶ…ώơ˜ʧ̈́ɵĹūȜӵǁʟ˓ÒŅС"],"encodeOffsets":[[-79750,7398]]}},{"type":"Feature","id":"PER","properties":{"name":"Peru"},"geometry":{"type":"Polygon","coordinates":["@@ɥљћɋࡅӘñΈရࡊທࣾ٫԰ΏۜƐʎ܅ાࠣ༄ߍီ΅Ϥ˃ؤٷպױͼ˖ϒПߢʼךڢՎIJΓʇȧx̭ΎâͼĝΚщӆΌDŽ֤ԦܶৠͨࣸࢠʾմŝٔɢĂ֒ЉˎЅϴɏӶࢣضĿҨɞ̤ƣԎð٠Ͻթࡣʤoрҁݳ œųۍlj॥ֱÓϻɉ̇ČғԕʍBΡɛƵΔݳҲԝDZί֐µ͆҃ݐuېӸÇ౧ϢĩӄƠܪടǷ˵£ןg܍͟пƮ̵ȕ˯β۹Ջ࣡"],"encodeOffsets":[[-71260,-18001]]}},{"type":"Feature","id":"PHL","properties":{"name":"Philippines"},"geometry":{"type":"MultiPolygon","coordinates":[["@@Đ֏ºҽ˹ޑ̫ࡨϽэˎإʉϿ঩Ӧɿ؊ʰЎՑЈˁΑЃثҵƑʖ͢۾ՌʀҜ̈́̔ϝٔɰƎϒרv·ٰڼЋêхÐ̱"],["@@̟ˡˁՍ˃ʝԫ׈ǦɤɂɾĢԸҨ¸Ɖ֣جߺāߡ"],["@@ૣߕЬט؈԰Ԏ׊Ѱ࠲Ʈۅևҧѳֿ"],["@@Ԏʹ՘BgΗϳΣՕʧ‡ϸÒєŽА"],["@@ʀभ٫ɞj˭ȶԯЍȋ•עʧªƁԘӶãY͈ԣٜ߮mɴ̻"],["@@ɟܩέоѓ٘ܚ‰̡̈"],["@@ԮʉʶɖüɇƍΑ˼׻ɛۥӷ˥ƁڳȊڝѾġϊIJਾүăҙ˜ȫēϯٻЮ̵Ѵɍ̯՗ԊރůлȆ¨ΎˀɊʣȘŇ̡бӚűμߨͺˡĔೄ˜ހԘA"]],"encodeOffsets":[[[129410,8617]],[[126959,10526]],[[121349,9540]],[[124809,12178]],[[128515,12455]],[[124445,13384]],[[124234,18949]]]}},{"type":"Feature","id":"PNG","properties":{"name":"Papua New Guinea"},"geometry":{"type":"MultiPolygon","coordinates":[["@@ɽčε͔ρՔǷ٘ŜĆĜʡʬȏРՑЈ˵ŝɽ"],["@@ѯçƃɽҟȱћȟѽBۏʔӑɺêʺݬũҠàŶЖŦrĆѽӐÜʂ˼Ҹ̚ġӸԌfǜƏgү˯ԡ"],["@@ݤտղࢻӖ„‘ω٬ƛʥǁࣀΝġʏ֋ÏȷɔܟĦࡕŴٷ՚ӉҦѧ݀ભπ܇ʇԡˣńإڇ˿һƖࢅ–aᩒaᩒภ׃༊ӓׄїҴхŸӵඔԱȲѽޛěȄ֕"],["@@ʿɡǁӸȝ͘ϝ˞ӍΪ؇ʚɺȮҒɻ˸ȁΜȫʹΛ͊ˏĶѧ"]],"encodeOffsets":[[[159622,-6983]],[[155631,-5609]],[[150725,-7565]],[[156816,-4607]]]}},{"type":"Feature","id":"POL","properties":{"name":"Poland"},"geometry":{"type":"Polygon","coordinates":["@@·՜à̂ȹ̧҆̚ɺɤȝђָʘ಼ϴ੒˴࠼ƙÚȱ߸Yਚħ໶^њěȬʵšωɸ͋KͯԋǡʸϳfϏцܻěɽзįރۥɒϗǿ¶ߙ͔؁šЇĒӹǵч̖Ήŕ³¼ϭаر¼ăˀֻĦűɑҗǨÀɴػòЉ˔"],"encodeOffsets":[[15378,52334]]}},{"type":"Feature","id":"PRI","properties":{"name":"Puerto Rico"},"geometry":{"type":"Polygon","coordinates":["@@јõưǕɋɃمLӫ‡·άŢŬیK"],"encodeOffsets":[[-67873,18960]]}},{"type":"Feature","id":"PRK","properties":{"name":"North Korea"},"geometry":{"type":"Polygon","coordinates":["@@Şƥ͉ºη˵ʣ˷Ž׽ѣȅƫƧ̓ʝ֓ƏηɥηįġͰƋӈσŧȭΧÇץ¡͝ϛϑˆÁùСdžĵƿʙé‡ǀɑüɥƆɰφȤİõƶɆҒÅƎөĠЇɤۄբऒҌ־׮Ўˁܪ‹ſѺಚβͰҼժӹ"],"encodeOffsets":[[133776,43413]]}},{"type":"Feature","id":"PRT","properties":{"name":"Portugal"},"geometry":{"type":"Polygon","coordinates":["@@̦Ɉ΄ŬɂЫӺDƞłӪ‡ɼуϱɩYٽƍū‘Їγçʹԋɵտ̄ʡřɫ̵̿ê˥ͷɓѷŠџġŸڂÿԬϓþȩ͈äռͰ̨ÒͼǪԎkΤǙ̠™˲"],"encodeOffsets":[[-9251,42886]]}},{"type":"Feature","id":"PRY","properties":{"name":"Paraguay"},"geometry":{"type":"Polygon","coordinates":["@@ͦ৖tҌЖ݌าʔޮ]޴їbʵʞҳÇଛࢲLJ΄ǐ֦ɩǀʣþޓİ͓̼›̀ƌ̢ƳAҥŕӻǑӛƍݏށ١ړƇऻŸࡑɮࠢ౨ťψࡽ͢ਅبۉŸ໵ൌ"],"encodeOffsets":[[-64189,-22783]]}},{"type":"Feature","id":"QAT","properties":{"name":"Qatar"},"geometry":{"type":"Polygon","coordinates":["@@ÇؔɨѲɰĜʬˁdӯǽӳɵÑʫǖ"],"encodeOffsets":[[52030,25349]]}},{"type":"Feature","id":"ROU","properties":{"name":"Romania"},"geometry":{"type":"Polygon","coordinates":["@@δǶԴġՠGϸȳ˺źبĄɄȠΠ@ʰćʺʟˊΟӞԁ€ρėΩưϥϒƹЂƊϠƟpɏПǹʯĀɻ৥ӳĖ̪ؑফțзɋ௽¬٥ƀ͙ÕʍΊƵƦȚƘȷŀ˃ȋөʔßΌԟȢĥˌҕͤڪǂԖ֮Њ֬ԢǮ"],"encodeOffsets":[[23256,49032]]}},{"type":"Feature","id":"RUS","properties":{"name":"Russia"},"geometry":{"type":"MultiPolygon","coordinates":[["@@ࡌ๫కˤԫ்ࠌࡳyוُԒսٱƻ۸Ĥࠊħ࣢Țٌš૴ӯࠜôରަϮͭϴϐŠɔ։̆ߵuࠟΎࡑ"],["@@໵]ਙĨȒτ୊˚ࢢƧψƃęɱäɉ"],["@@֦Ƚțؐᗸű࿨޻࠭λ൛ēsࠑͳǩ޽~ٗ̊ૣʖȉθ࡟Ǝॗʼnҗ̎Ǽ̸৓ȥϚЃӉΣ@„Ꮪٛᔺ࠳ïԷ"],["@@ः©ƭˌੲΖ@ַ"],["@@ળ»@ָň–܈E௒ʉïŗࡽȩ"],["@@ౡMႣĤƧ¬ߘͪੀþஞ͏ĸə"],["@@ॿͩഉø༛ͨȪ˖༨ųᑔɗ"],["@@ډرᶽzඃȣမղҎ׀૎ǂᕞ™ᴬѽ"],["@@ӹóᩣŊɟώູɦūҒ࡮Ƕ…Ҟသܒޙĺ፨݆ɩϢሤѺ᪪բ᫠ǀ෴̸࿐Ŋאͩ֟ʻᲗз᢭Џᤙߝఫࠍ೉߱Ǡۥྎۏ"],["@@ɨгސȲឤYቈЧڬ̿ȽѧङʝᕅүفʟਬşఖɃݴDŽєաτɔഊƂ᧪ƑȴϽ↲ů´ٜᄼƥഄLബѷϮ՝ӹΙੌڋ೔Ϳ߸ࢦഖϙ෢ɦྼʵؤʀൖş؅ޮૐζ䢀ձܐӿᔲٛ₎DŽာƑ۪΍Ĺؙਜʇ૴Ǥ๰vཚǑཪĢะݛਪˎڷ՞ϐώᧆɻფºᝂБ୲ν@”MKઇσઝÖݶҁԄەϲɧĮΏɑɝ༧Ǿ᚝مݛĭ౽ן௛ԧ̱ϣய׊ᔗڇϣ̸ߵΫ૱Ř˓ց৙߽Šͻड़ȋő௣ޭ‹Ϋ۱Δα฽ѕ̅ॡభȳʥ࡟ே޳ׂ̳έ௬ҵለИ୘܀ԆªϾರȊຊ੒คࡺຢڢڮஆ৷ëԍۗᒉइۍਖᓧ˷ᑃටۚԧሙɕಝēÔ؊ಯŶ਩ЭᢵƠ᪏ʟᨩ࿛ủጝ೚ŁаՃࠄȅ՞оईÃௌऍ†܍ځ࠽ë্ϛഉ్௓˯ׇଙ঑ଇॻթӹ૩ӱՉYՇФૻؙſ˩ŝƦKѐіxŦ঴ɛܚܞ̒৶Ʃ֢ࠈ˾ऄ͚̮Ѵݲ൷ʛܯͧ౧Dͻ߄হװหˎ̵ࠖ̉Ԫ̿βԯࡐ̲݇షʢ૛uਯƱۛлҤȥXҩұˑݷࢻRσஅՍ৙̈́োéѯˮԋĞ௷ףેƑޛȻੑƌޫSԙіࠕИࡅŎ੝ŋߏƹ஛ΜLJـধɎށİवΎࢉࢉ΀ӵࠇב௏ɂ࠻Š֗Ͼ࢙^ܳʴ౫Ѓྃܣࢭơ͡çѽԤઍőΧΦחnjЙӠҩưிɍୃӜ҃ѯሟᒒੵٮ̮˂ᑋߍ߭³êҞઅ˺࢙ȱ˃ࢊມǺݯΑᑅ̳Чȹḭ̇ϫ˻؆ֹ߭ɓǀɭ߭ХസֿɁЉ୻˜ʓʟ੹Ѧ೯iࢻΟহͼᇡ׊ಽsჃࣳĿؗࡹӤڡउʖǡӝُ܊֫ذx՚֗ďѝѐƋϥӽ߿Ƒ࠳ࢁކߕĉ֣ࣼফԇ͹ƝɇωÌֿԚɿ†ՅȚʳΈ޵ǮԙƁƥƼଥЖఅƌ܃ƞĹıੱ܂य़̈́ܩӴؒƈۤ۰ҹͪఌ΄uȀݯƉ‚ώѠɼ߼ÖƄ˪ȅҪ΀ѰWʚఉ˚ӭUԯЀ١ƃ੩̐lǒ̗θڟ¤éʼɀǞ՝ӈࢋąʭ¦Ƀȑ̽”ȷ՞ȟ˨NJĀڴ‡͞Ȁʍɢ֥ƪ¼Ʋ΁ƴՃվǸɨĉЂࠑȨѱijšȼࢭɂˑӸíТЙȖάˊʝ޶װӞųƤक़ҬࢡЎᅢ੶ޮӠ͂єగּΆնݳش֢ܜ঍ग़ޢي౿֔ŬךڶüොͶࢀ̈൦ԕᘨȧṺो٤ЋÆ֓टѳ൏ɡ⏷ٔ؟Ńൌ؛ÂϵÆ࡫ઌʯڂɓňРԑΰ՘͈᎖Թ۾Ȳ֣؜ዦࠖޢµ޸̋Ӫ׀۫ԄЪԊءԶᚠˑӔҹ੡ĻNҳڌ˽ಜǼȶ՚ჶАᰪܞي£ࠣԙਬĕ׼˼༾xఢΐफ़ԏॖ֌ࢡӢѪˤ២ʫ୒ʿᴾॣ֚ѰࡡѺ{ǴৣĈˢЌ҅ټ}ː༄ݾրކزǒᕮɛǬұߕڽԺˋ˒חȏଵऒԧέ֕࿫஝०ŭ̢ͮऎɎɞжܮЎөӌϼֈࣿêȫҲڢࡈણۆຒ֦șװмnѴүͧ߷࣐Ƶϥ؄ඤͦლ¬༈ӏݛ۪ċࣆศǞ፾™ᆘŌہѮংւॲx࿎иᕠŐ˪ɲᕂþیȋሴҀ໲aɶδߤΨጤΈ෸˗ଥȷበŹ"],["@@ⵙ͕ໞીےĦقÃᒈӋʟͿ"],["@@૽ōݱÛśƏঙƑ࣫ȦӐʾል~࿞ƶ౨XǢɧӘȬߊƐఞǿ͗ŷ"],["@@ᆳĿᚉʎඅ͎٣׾଩ǔᔆָᆎȎ࿌чኬ߻ȹݯ"]],"encodeOffsets":[[[147096,51966]],[[23277,55632]],[[-179214,68183]],[[184320,72533]],[[-182982,72595]],[[147051,74970]],[[154350,76887]],[[148569,77377]],[[58917,72418]],[[109538,78822]],[[107598,80187]],[[52364,82481]],[[102339,80775]]]}},{"type":"Feature","id":"RWA","properties":{"name":"Rwanda"},"geometry":{"type":"Polygon","coordinates":["@@ͬӃµӵʏŁѿÆʱӍԛàþҠŘތԄʎɺȰďԈʸ"],"encodeOffsets":[[31150,-1161]]}},{"type":"Feature","id":"ESH","properties":{"name":"Western Sahara"},"geometry":{"type":"Polygon","coordinates":["@@oҊŸ@@ÉeNjEౝ᪁ª‚ᒷ޿÷ȳћDŽ்ᾓNǽ˫˜΢bCቆäĶ̢ΆϘˤୌୠ࣢Ђ੖ˀÖ˜ټۺĜ̦ʼnϢ@˔ȒԲ‚"],"encodeOffsets":[[-9005,27772]]}},{"type":"Feature","id":"SAU","properties":{"name":"Saudi Arabia"},"geometry":{"type":"Polygon","coordinates":["@@ʼnΪʩʨÝͲѡ̞҃۴ʁۆׇ׀ϑƐ֋ߠīא–ӾӕञϿ͠ґǨˡӖ°ȎɹѦʕȊ͝زԟڴѓ־лIžҦœ̌ļͲनƅζʶȪ̢ٚŚƒˮˤƜ࠷ࡀ၆фdžŴৢɩబיᛎၕ༠ãݠąȾЏתv͠ܥаȓƠִ̏Λ¼΍ċ˩ł˯ʎɽŐ˟ŲȵʬǕɶÒdž͍Žș࡙͐ᡌщǞDzϪש֕၁ᠽ࠽ᝑ͑޷ϙ׻ࢥϹƕɁˬ͏§߻ĎƷČॹmɫùΉɔɝЭĒΟρˋ"],"encodeOffsets":[[43807,16741]]}},{"type":"Feature","id":"SDN","properties":{"name":"Sudan"},"geometry":{"type":"Polygon","coordinates":["@@śhdмĵ̀џͨĵ؄ĶبϳÌÍȇԍ©Ȭʕðԍңңл؅џđ۹Ӫͅǥđʓџǃ…ǥ࠵@řǦ؃†̡ƝɳîѝӬƟɲ؃ŗɱϵɏݣ˿ǁʳğå ̅ʎÃʼƌΔE΄ӛՀĩάZȰ̱ʜUӦǭ͖̍µĎ̰ɒΖħΐˢʴǫȞɞ԰ϨئܦÏ¥ ZΚॲH@း@Ὂ@ῼ@˔ࠗȁƳŪࡻ্̰͌ȷҠ̳ыӑأƏ˅ʳĉ֑α௿ĚͳƅܟͿࠟԓзέٛč΃Љɽʝ࢟Dij"],"encodeOffsets":[[34779,9692]]}},{"type":"Feature","id":"SDS","properties":{"name":"South Sudan"},"geometry":{"type":"Polygon","coordinates":["@@Xٽűʯѿq˷ӏԨÑюХƨͳϦșӼࣳ֫օԫԇԫϭסFگȟՕȊ΋ɭ݉֐ȥάҵDZϱÆɣƕϗĸԗۚƉˊعͪɅԌΕζ֟ѬS˘ҡͼ֯͠ʴĠ̀ǂɐݤɲ϶؄ŘƠɱўӫɴí̢ƞ؄…Śǥ࠶@†ǦѠDŽĒʔ͆ǦۺөѠĒм؆ҤҤïԎȫʖԎªÎȈϴËĵاĶ؃ѠͧĶ˿cлŜg"],"encodeOffsets":[[34779,9692]]}},{"type":"Feature","id":"SEN","properties":{"name":"Senegal"},"geometry":{"type":"Polygon","coordinates":["@@΍ٺн̚φDŽРמȦќ˾ːкïШǾҶVДʙ֎ɝԘأֈֽžԹǔӓ̾ɿî͗ʽŧ³қâÙģȃk׿ȲЛV༇–ɥħ˥‚ѻƋƏ٢ވkȬŞƮR̸ȘήǯκcζȌǝʐˡƙʻJͧȸˉ_ȍȥࣵy"],"encodeOffsets":[[-17114,13922]]}},{"type":"Feature","id":"SLB","properties":{"name":"Solomon Islands"},"geometry":{"type":"MultiPolygon","coordinates":[["@@ɾ˿חN͉ԬԈȯǜ‰"],["@@͝mԧĎǫżÀͮֈƁ˜ǭƎə"],["@@ųƹحܰǫԈ˺@̠ڥʹЗ"],["@@–ǛڅΦҟ̠̿˪ŰĐϮȫېϭȢˉ"],["@@Ǘ³οȒ·Ί¨ƖԈΡͰ˛"]],"encodeOffsets":[[[166010,-10734]],[[164713,-10109]],[[165561,-9830]],[[163713,-8537]],[[161320,-7524]]]}},{"type":"Feature","id":"SLE","properties":{"name":"Sierra Leone"},"geometry":{"type":"Polygon","coordinates":["@@ɧØ؁ͺѩ҈Ƨ̬Ĺت҆τĬɺƞǸɶpȜǂڦCɺ̛ǼˁʓƈɗṶɴ´ϹϹϛҗ«ʓȩˏ"],"encodeOffsets":[[-11713,6949]]}},{"type":"Feature","id":"SLV","properties":{"name":"El Salvador"},"geometry":{"type":"Polygon","coordinates":["@@ġȡӡ^̡Ą΍ǘұÀʃǶ~Ů˾ɄǀĢ«IJȠ¾ʜëǸǙʪƇŒœτĴǤÑŘĝÏͳ"],"encodeOffsets":[[-89900,13706]]}},{"type":"Feature","id":"-99","properties":{"name":"Somaliland"},"geometry":{"type":"Polygon","coordinates":["@@ϛԩד۫۹Mᩧা͍̜̳К̳ҨǾ̖̲҈˚ƹǒΏϜΗкGߊɌࣴĴ݌ʼиÆ̚ƶӎˆKaE΋Aࡑ@ѫ"],"encodeOffsets":[[50113,9679]]}},{"type":"Feature","id":"SOM","properties":{"name":"Somalia"},"geometry":{"type":"Polygon","coordinates":["@@ѼĎЊ˾͈FpɵýӧHѳǯ̣ʁࣥЙयԱ੷ܝ௷ܓवধ଩ࡁڹష࠯޳ٕँৱȗѷȍȣӽۚWᵤܾ॒ɰˆբfݠפબšᛜᡄה۬ϜԪ@ѬBࡒFΌLbːhϰŰ"],"encodeOffsets":[[50923,11857]]}},{"type":"Feature","id":"SRB","properties":{"name":"Republic of Serbia"},"geometry":{"type":"Polygon","coordinates":["@@Ԡȡà΋Ӫʓ˄ȌȸĿșƗƶƥȷȏø̫Тγ͋ʿƗˋĞijƑšϳa˹µƒØĴĴĦȴšKǍƼƑ ŋƆƽÀšŠƯ±ś˧ȩÑèð͋Ǩ˟ĜūŜɟƠȢšŬЄЛ͔ɀτ̥Ë͔́ˉʈȱ͘٢ɚԾ™ҖͣĦˋ"],"encodeOffsets":[[21376,46507]]}},{"type":"Feature","id":"SUR","properties":{"name":"Suriname"},"geometry":{"type":"Polygon","coordinates":["@@৔ǙĞưڶÔࣚɥѩܟâֹͤӽƥίóϩɉΛӓDzЇđ͹öčʏƘǗ÷ǡҙèԡܴōӄˏBωؐƺѠ¯ȤԜɖƈݲ"],"encodeOffsets":[[-58518,6117]]}},{"type":"Feature","id":"SVK","properties":{"name":"Slovakia"},"geometry":{"type":"Polygon","coordinates":["@@´»ΊŖш̕ӺǶЈđ؂Ţߚ͓ɷɓǏ͹dzđ࣑ʮ˟»ȟȡЁĿěÄХŽͭ}ãǙ۷Ļ̱ĠёɌċ̆äńŢȂόa˺ĔxþLj¢ÆȒȖ˜žưʢD"],"encodeOffsets":[[19306,50685]]}},{"type":"Feature","id":"SVN","properties":{"name":"Slovenia"},"geometry":{"type":"Polygon","coordinates":["@@ۜÝъȐܾtLjƘƘUǎ˳ڝɟć͹̇đHɻͣh˷ƎƷƙב†ȈúȫΨĞа"],"encodeOffsets":[[14138,47626]]}},{"type":"Feature","id":"SWE","properties":{"name":"Sweden"},"geometry":{"type":"Polygon","coordinates":["@@ࠁוƀԥ೹ڭྱܡؓஃײףߦүޗॅ࢑ȝ͍තӋ޿৳ĆӅڗঃˉߐ۳॔ٓஐφӜּۨ˦ন՝ю½ૠղ߀࠰ä̧ͬ˺ಬஂࡀञֈײ߮GɞҶཔƉŬքԸ”૪Щ಼ֱv಑˴͛ฃʃ"],"encodeOffsets":[[22716,67302]]}},{"type":"Feature","id":"SWZ","properties":{"name":"Swaziland"},"geometry":{"type":"Polygon","coordinates":["@@ǡύӭěԅҖS̄ɰ̀ĂʔʐÒшƵŰϕðω"],"encodeOffsets":[[32842,-27375]]}},{"type":"Feature","id":"SYR","properties":{"name":"Syria"},"geometry":{"type":"Polygon","coordinates":["@@࿩ࣅऩͬgNŖŶ_ΈȸҠҜ̈́Əͤϗ¨ÿٞȶΌɤȀɤȀ°Ҹ˞Ǐऎɺ҂ƿۖFॴ̀Ґaक़žїԽҡȹĂؗͅ৫ᇵ࢓"],"encodeOffsets":[[39724,34180]]}},{"type":"Feature","id":"TCD","properties":{"name":"Chad"},"geometry":{"type":"Polygon","coordinates":["@@ĎЄաnDզΓ̶δ૊ੴߌ¬ન͖ၼǼΰΓ˾_ˌ̽ɔȷರࡔҠ…ྑ…ྏ¦ ܥÐϧإɝԯǬȝˡʳĨΏɑΕč̯̎¶Ǯ͕Vӥ̲ʛYȯՏƛэͽ؉ࣹ߅ϳ߹¾ʁûĊ̏ѫ̋Σ͟੓͏ȽȐƓhƹɍۛÙƀɪ˅ׄşΐλƜӷӪǼІϦċʂÐҸSқކŒ֐É֐ͭՠ"],"encodeOffsets":[[14844,13169]]}},{"type":"Feature","id":"TGO","properties":{"name":"Togo"},"geometry":{"type":"Polygon","coordinates":["@@ڱdzȇ̎ɡՔãкȆݴɁ̬ăڎD؎ΕѠÖˀ݂kŅѵʲʝ̈̋ŽЭǜǥኝȺׅ"],"encodeOffsets":[[1911,6290]]}},{"type":"Feature","id":"THA","properties":{"name":"Thailand"},"geometry":{"type":"Polygon","coordinates":["@@ݭϬܗeŬڈ݉Káऋґ௯˙ݏÌ؋ն΀ދưܭҶӓԚĭѤѧ˝·ևĵßќۇςƣƭͧ͒ƝжҁӄПЌƏӳǃҲĠԾʚ߬ТࡸҤ޶͟ތ`϶ĩҸ֕ښȩф̄ƺ̮ܶ·ֆՓؘН݆ΠƴϦࣦצœӬθӔȘθʷ´ԍ֨ȷࢭpݫࢰԆʤƧӰzǜَ̊ÍٖڽÀࠥںܷ›܅˙ϛ޿ŦગDž՟ۧȤ১"],"encodeOffsets":[[105047,12480]]}},{"type":"Feature","id":"TJK","properties":{"name":"Tajikistan"},"geometry":{"type":"Polygon","coordinates":["@@̭ʷࣳƖāӛ࣬Þਢ˗འŶɈާˠĐԜȓ‡͛ŴӍࡿBׁØԻϕύĉ̉ǯͩˠþ۸ʩ¢ĞʲғȐα̇ė͹Żūԇj˕ϩ˯nj؋ˑʱĺӀࡘǹض؟ȨɔφۮŸЌҬˌբ૲ȜǩϵŤɹΎv"],"encodeOffsets":[[72719,41211]]}},{"type":"Feature","id":"TKM","properties":{"name":"Turkmenistan"},"geometry":{"type":"Polygon","coordinates":["@@ñۼطŠॣݔڣĠगюׯþσƽ֙|ׯӓ݇NjƻרŪ࢞ٽ˶Ɏֺ֏¸Ȇ۾ߊȵ݈ˎؓԎʉӔڱɋď؛ʿհψ˨ॖǪ֨ɻךڅњ¤ॆ\\Əцܖ̂۾ӦଆѹĜڡ͐ǣࣦžˮƳаࡽ०ׇոЃ࢞Щ૤Ϋwԥʩ€Ѕɤſ̙۽NjǙڥӁʭڏŵǫϟهŏࡩ͈"],"encodeOffsets":[[62680,36506]]}},{"type":"Feature","id":"TLS","properties":{"name":"East Timor"},"geometry":{"type":"Polygon","coordinates":["@@IJȤܢȌז†ˀŀ͆Ľ̯ɫ࢕ο۳ʋeʬďǔ"],"encodeOffsets":[[127968,-9106]]}},{"type":"Feature","id":"TTO","properties":{"name":"Trinidad and Tobago"},"geometry":{"type":"Polygon","coordinates":["@@ӚŊǮ‡‘صۭġƯúʒɲiͪ"],"encodeOffsets":[[-63160,11019]]}},{"type":"Feature","id":"TUN","properties":{"name":"Tunisia"},"geometry":{"type":"Polygon","coordinates":["@@ΩພԭͺQȰۉԄóنԮҶȢۚƃߠǠќࣶͺךĵ}ы܊̲ÒljпЫMϱ̆ȽōܫփхDŽқѤaɄЍ͊ſ³٥Хʋʵˏֽ͓ĘΑïΟЧț"],"encodeOffsets":[[9710,31035]]}},{"type":"Feature","id":"TUR","properties":{"name":"Turkey"},"geometry":{"type":"MultiPolygon","coordinates":[["@@஺͗ঐżܤõলѬࣆ¢ߴЭƜ̑ăУزȻͨʕֻʇˀ५ǏʻҠڧЕƙ̏Ɋ঍ňίŽॗŽҏbॳ̿ەEҁǀऍɹ˝ǐ¯ҷɣǿɣǿ̱Ϡ͈͂ԟí۱ȖֿәౣĥڹҊࣟ†ȗΑׇij߻҄ࣻeӽ࠶ؗҰЦٸՓВठߨಒ’Μྀٔŏ৞հ঒ʄർlุף"],["@@۫ҏ˃Ϻ\\ǦȦĦʺՂХɞࡦ˄ܤőĴ͓ܼ˓Ƶȵি±Ωʷ"]],"encodeOffsets":[[[37800,42328]],[[27845,41668]]]}},{"type":"Feature","id":"TZA","properties":{"name":"United Republic of Tanzania"},"geometry":{"type":"Polygon","coordinates":["@@ƚġᵂႋÌӣ஼࠿ϱਙ¸Ӊՠ̩~ɓɳԓ¶ʭÇГ̌Ճΐ̰ࠡǿڝӣࣿ͛ԋb̙ʥבsɕŃঢ়ʂكåɽଢ˵ϺǛɶࠗƾӉʨՕƘͯƘΗɈґ੖ӣҺǗӤČѨƯޞΎ ̨̦͜ѬȺǮS˘ǷȐ·ͨʐł¶Ӷͫӄ̎Ķऄ[ႎà"],"encodeOffsets":[[34718,-972]]}},{"type":"Feature","id":"UGA","properties":{"name":"Uganda"},"geometry":{"type":"Polygon","coordinates":["@@ः\\̍ĵԇʷȯĐPوȜ͎²ڬǰϸ͎Ѭ͔ɠ˒̘͵Ŗ¼চΌɮՖȉڰȠעEԬϮЊ׍İсτ९̧ؓЯ֋ʉͽTࢹႍß"],"encodeOffsets":[[32631,-1052]]}},{"type":"Feature","id":"UKR","properties":{"name":"Ukraine"},"geometry":{"type":"Polygon","coordinates":["@@̾“ɄȒʮ¥ࢌĆ՞Ӈȿǝêʻڠ£̘ηkǑ੪̏٢Ƅ԰ϿӮVఊ˙XʙͿѯȆҩƃ˩߻Õџɻύڡã֑˕޽«ܣ̻¸ԹЪȭࡨ¼Ǐ̛ँơଛӟұǠȄЂࣽʘƨLjߪ˪ʑȔಯɆË̼ީĻ̷ҧٱةϟƠЁƉϑƺɂĞƦ˾ɲˎÑƮǬäĊśӸ{ɞØƽĎÐŲ̉ɈŧΘ̩ƐÒ˶ϝɦΉŽأʾ֑ĉȧŭΟ@Ƀȟاă˹ŹϷȴ՟HԳĢγǵÍɤұɮǐͺɸɔȀµɑϘބۦиİĜɾхܼДҢɪٲnࡖßबȫڎi͂ŧ̀Ʀɚȝݸ¢ͮąÄцʶȂܞº"],"encodeOffsets":[[32549,53353]]}},{"type":"Feature","id":"URY","properties":{"name":"Uruguay"},"geometry":{"type":"Polygon","coordinates":["@@ղĚࡆٯ̺|ࡺ՟ڈҫӠֱχЉɸӇεՇॉұاǚғěޥΰ֫ԟҬÞլǾȈS࠸ɤࡺȾڦ"],"encodeOffsets":[[-59008,-30941]]}},{"type":"Feature","id":"USA","properties":{"name":"United States of America"},"geometry":{"type":"MultiPolygon","coordinates":[["@@ũƕȽŤ|ɾƓ̨¦ĤƤƎÍǔ¸þÜe͐ƙƬñƌőɊ̍q¯͟ǵˏſ"],["@@˭ÑƟǮīèQÀĈî̘āɘŹëĵ"],["@@ĝ҉|Úĸа•"],["@@­µÓŻˆŃȒ’ɤŚêÃʐ˥"],["@@ıĉ˱ƴªÖŸĈȘijȝ"],["@@Ƭңʼƛז½࡬ƅࠂʹڼŊਖɓ˞Tݨʄ߂̧ࠒ͗ں˩ٶˏĈəȢĉ½ĉɦǎĔ¦ȣǜƅɴ@ŬĹĽƫ࢖ЁǶށǚܳʗӹЁҥȁ̍mēĦť˸Ɓɂ@ঊ҆ࡾƀસмfĐ÷ʰƉǒϜƆࠜHޘAˎ͞ŀàࢶ؄ϜƸ౦N໾BĎȺː¦Φž̖Ϣʲٺٚي˨ə֜ƜώʏAଧռӅƢ˝࣋Пࡷ̃ࢱʝѻӿƛȋSѽˤѽΒsė̬ʦȇãʇ֥ƋЗhةƥλ¥ӥ¥۫ʏఀǂʠǃ୳ʥ՗C|ĺʭɷʚǹ׽ؑ٧×Ɏȁª˟ɀǪҍȼƭ^ͅˏ͛ҿڡûʺֲѕ͎įۦljεǴՑևƀׂ˓˜ߛʊÍĖ̃ŠࡁՕدࢇʝցӱнÁэ̱ţ˭इձӁЍЅӽŻׯƪ׍ˬܗώשLεЊঅ֥—͛ȿԡʣŃЯĺƁς͋ȖѻܢϹٞű͢Ǥ֐ɽҦٻ۲͟źࡑϡƭ¦СϼՃȺोŁݗĤٙÍΏſƲɟaͽǴǓLJō̵Ů́ǃ؍€طѺܻĿ؏ȚԹÏۻȝއح࠳γҝБȕϗUׅ¨ЕDŽ˹͝{׭ȂٽʺɽЄȁטӷӐ̃ӰуֺףͲۉgՉڑۣʦѡʪȽҦ˧Ѯӿτїˈ̩̖ป@C΋ڗ@ဩOቿפ౓ТĀǒ੩ĝॕÝƙіխӚϻĴğʌһ¦̝ɪޭĊɉƌĹҢࠁࡊ۩ୠˆȚχˤٯ۴řۆ҃ҞȀۢ…ܜˍ٢͠ߊĸނĺނƱૼˇܘʓ϶ĸǐ௒˷҂ߋȺɜƇې˷ێᛸ@᠂@ࠜ@ᢢ@៚@ᡀ@ᡄ@᭰@ᮞBაAF͔˴J"],["@@࠽͋ѕɐŽЀބ̘҆Ÿ֐ÉΤʻܫЍ"],["@@ԧŽսƾԛɮࠦƞښùĂ͑"],["@@԰DžԾĒڸɛ࠲őéĝُDZٕǾ͋Ʋݍµȧôº̈́"],["@@؊ϛώnjහ»¹ȕ౾ƛࡨČᄚ˅ྤā٨ʼn૦Ǝౢʧࣲŝ@@MᷱIⷍࠠ{ࠌɵהρݜցࠈҺࡈ˖Ҁѡ֤·ޒϙՂ׽࡮य़ේ՗xՋұЙҥ͂ݍˌʃܺએںҍߎ߯Ä೷rটʌ჉ࢎߩDŽ฽̜୑í࿻ϬৃΨटǯǦ׏ҫÁঁǫ݉˱झdzťӶϚࠚࣀʶɱɂੱҵֵ֑௅ױؚСߏ׿ࣗΗࡁʱȻωಽѡ˅ϿছΫֽÞ޷ɻ࡝˹ۧ˫෹ʉſƘऀϾࠔʸࣆҠਬĨвΈ୘ԊȈǚب̒ƢْђӸॹʫ˓Ơҕ̧շюɧ̝̽м࠿ͳԩBïԄƲ̮ե̚થLJ܁ЀַȬIӈ٩Ϊ͘ӘۆҸ̚њںÖ־ƇڴМ؎ï٘ʼƻϨҹưج͖ԩWࢻǽʯȃڏȄஏĥ௷ȬΛ͸੟Ӧ୾ΘመШ۔@ŕнᄢŽڽԶਕ͌ױр߫ΨଽˈҺѲ๰‚ਗ਼ϦȨФ࡬ЎࠊĪཪώޜÉಐ҄ౚǭ"]],"encodeOffsets":[[[-159275,19542]],[[-159825,21140]],[[-160520,21686]],[[-161436,21834]],[[-163169,22510]],[[-97093,50575]],[[-156678,58487]],[[-169553,61348]],[[-175853,65314]],[[-158789,72856]]]}},{"type":"Feature","id":"UZB","properties":{"name":"Uzbekistan"},"geometry":{"type":"Polygon","coordinates":["@@xԦૣά࢝ЪշЄ॥׈Яࡾ˭ƴࣥ͏ǤěڢଅѺ۽ӥܕ́Ɛхॅ[ᶾᓘӺƾïದ׻یͅߤݵঢŪ෸à৔ؗÙࡅЦMǢۍ੬ɲЉ̺Lπ׺૎הӖƺʠĉ۵խئ́ײȾ়ѷ੽؁ٕĊ΍uţɺǪ϶૱țˋաЋҫۭ ɓυؠȧǺصҿࡗهǰҳN"],"encodeOffsets":[[68116,38260]]}},{"type":"Feature","id":"VEN","properties":{"name":"Venezuela"},"geometry":{"type":"Polygon","coordinates":["@@yȣӱĭ˜ϡYѭυӥ͆ڙδÆȌ؈ʻ̒§َਸ਼΀řІ̎ˆ̞ןל_մҵ˧ݮQ࣌ĔӖϕٞĻҼʾXɄਨ¼৖\\܉ʛ˼Їڦ×ِЯƆڧѬn͢ȣڕӱó̫˾̷ȽƽԫƉjϱɫɱّ֪Őʁ̭͍ऱ̽׿Žʏȣڛɀثņƿýϔɑ‘֝ŜՉ܆ï°ǭ׷ʅĭΣΉƏسȝNjʱٷÅҧѼʯ࠺ɟ̧̌Ȅюм…ȊʅʠǛ֒à׼Ȉ˰ƲҎ̓Ơӏĩ؁®ͻęסܢӥńઉăȧ̊ȷê‡ǬĴ̶áͺȃȂŅϮѡÈɸӮĺ׶ʔ̸͘ʌɈрդƖ"],"encodeOffsets":[[-73043,12059]]}},{"type":"Feature","id":"VNM","properties":{"name":"Vietnam"},"geometry":{"type":"Polygon","coordinates":["@@૭ܗ۫ߍȁ׍٠ࢭ޺ળނԱԞګϪ།ŕ๓۫փ१եۇ۫਷ޱ̧ՠʀ֬دӌܬ͸ࢦÔσԚප٨ļ৖ț֖ƶࡀɃצٍאՋ݌ۥ঴৓Ԋʊ̠՞ɘ͙ܺਙPϕކӭڐҊȴڢIࠈĬܒ҄К̿ސƵƃӛАͿࡎɓ"],"encodeOffsets":[[110644,22070]]}},{"type":"Feature","id":"VUT","properties":{"name":"Vanuatu"},"geometry":{"type":"MultiPolygon","coordinates":[["@@ˣō˭ςŒɤՆӗ"],["@@ƌڱɥŀǩ­ťɴi٢Дʵ"]],"encodeOffsets":[[[171874,-16861]],[[171119,-15292]]]}},{"type":"Feature","id":"PSE","properties":{"name":"West Bank"},"geometry":{"type":"Polygon","coordinates":["@@@ԣŭʙЃŕ˜ɜɌŚɁĦǬ̤֔ś"],"encodeOffsets":[[36399,33172]]}},{"type":"Feature","id":"YEM","properties":{"name":"Yemen"},"geometry":{"type":"Polygon","coordinates":["@@؉ɥNjύo˹࠷Οഇϻݩףυ±ʥºӭΑ՗lj۷©ɃµǿɛəÕŻɇеlˍœ׉¨ɓӬzҠƍʜǑتʋΊǚ¤đϨĸNJ™ξςˌđΠɞЮΊɓɬúॺnƸċ߼č͐¨ɂ˫ϺƖ׼ࢦ޸Ϛᝒ͒ڀ൳˞ח"],"encodeOffsets":[[54384,17051]]}},{"type":"Feature","id":"ZAF","properties":{"name":"South Africa"},"geometry":{"type":"Polygon","coordinates":["@@ǏŧΣяɻћӇ׻ोࢁףԋًϣ࢛͙ѓ«ŇɷԛŰеDž࣫NJԙĹΏ¬ࡿͩܓƃԱͅϡoΣ̚˳fαϒŸśŏɦLӰ˙֞˔ƴs٤ս޼х܈AF׽તДдͪɯƘΫϘÓՈǃҌÖݤіB᷌ɨűӾߙûԟȈ̏׼ĒрϒЊʨȶДЦȚΠķВɽۂ£՞ȜĐʾƨДҚäʨ͂˪֔ݮغஒؤ΂UОƛ˲Ķ҂ċД஁ɔׯƫऩî̟чƶʏÑāʓɯ̿T̃ԆҕӮĜǢώْQȿؑıۥɑϛֵщ","@@νʶϻǟҕ҃͡Տـ٧̜ČƺˎҴƀƜ˜ʴФ̅ʪ"],"encodeOffsets":[[32278,-29959],[29674,-29650]]}},{"type":"Feature","id":"ZMB","properties":{"name":"Zambia"},"geometry":{"type":"Polygon","coordinates":["@@ІϏɊ܋ƝɩǙڻLjۡ˃̇ʭޭѶɓᢇۗĂׯٍřӍͯĹ̛̅ßܵۓҭխ˳o˗ĬऱĠƯÚOêͧȎկ¶ۋȑչԾ֣یžᦶშYí̂Ű̀ƧЀĪТėʺ̂q¶ʽϾrՖûˬϡڨŝԤˆȌѯ٠ş̴ΧΈҥ٠Që࣠ɱƳח͞ɧƬļࡈƬসȉψʈ՚ɤĶ଀ƚͦđΘɇͰƗՖƗӊʧ"],"encodeOffsets":[[33546,-9452]]}},{"type":"Feature","id":"ZWE","properties":{"name":"Zimbabwe"},"geometry":{"type":"Polygon","coordinates":["@@ҁČ˱ĵНƜ΁VՙϞٯźʙՒC̒έĞ्ई˃ӢǛƮ͓ڤलğ˘ī˴pҮծܶ۔̜àĺ̆ӎͰَŚÆ̻۬hϴǯǺȻАÓѦˑF੟Ǐ׋—عƊʝħӵŵùɛ؅ࢫ॓"],"encodeOffsets":[[31941,-22785]]}}],"UTF8Encoding":true}; +define('echarts/util/mapData/geoJson/world_geo',[],function() { + return {"type":"FeatureCollection","offset":{"x":170,"y":90},"features":[{"type":"Feature","id":"AFG","properties":{"name":"Afghanistan"},"geometry":{"type":"Polygon","coordinates":["@@ࡪ͇وŐǬϠڐŶӂʮǚڦ۾njƀ̚ІɣʪҴMوǯʲĹ،˒˰Nj˖ϪԈiżŬĘͺβ̈Ҕȏĝʱʪ¡ý۷ͪ˟̊ǰώĊԼϖׂ×ࢀAƬʋӧĥяƹ७ĭࣗǭӫλȤΣĪллΛ–͑ɳ̡ߛ€ͦ։՗ɅΥԕ²ԋ͡ɿ̳þٝŋğɻسDҵӇ‡܍થΓבôǝȁԇņ࠿űටіހހåզُƚßՔ˟ڢάҢιŮɲؒ΂ਸ"],"encodeOffsets":[[62680,36506]]}},{"type":"Feature","id":"AGO","properties":{"name":"Angola"},"geometry":{"type":"MultiPolygon","coordinates":[["@@ȸصʌԋȘ˕͐ѯ֊æˤŠҬşŲɀɂӨԶ®ƤіHñ̡৴RfՉǞ͕ūԑÖԫ˪̷­ৃȼüκsԴŴϦ¹ĘʹĩСƨϿů̿î́ყZᦵ֤ۋպԽ໳΁᎝Š׋Ж₭—ŵÏԃϞկ~ԉƝЙDžÿՈŜ݊̂ޒªΰ˚ݶȨΆӘռːϐĘج«ӊʣ̜ɡԚȵԎ®Ǩʶͬʭ߼ǣ֚сՐĄǎΌŔʒg̎ĸៜ["],["@@ɉėɣلͼδʪƘ̀˽̩ǯƍɍλ"]],"encodeOffsets":[[[16719,-6018]],[[12736,-5820]]]}},{"type":"Feature","id":"ALB","properties":{"name":"Albania"},"geometry":{"type":"Polygon","coordinates":["@@Ń˷ŢέΒȳiə˗ŧ»˙ϷСƛÐgȂү˰ñАîֶŖʼƗƂÉˌθаÂƿɨôǴɥȪďȨ̂"],"encodeOffsets":[[21085,42860]]}},{"type":"Feature","id":"ARE","properties":{"name":"United Arab Emirates"},"geometry":{"type":"Polygon","coordinates":["@@Ƭ¤ŒɱڂƂ۞uԖ{ֺ֪ظՠՎԮdž˹ŖڑѕGçճƪŝϝǑE΅ʓΏuͷǝDZᡋъ͏࡚Ț"],"encodeOffsets":[[52818,24828]]}},{"type":"Feature","id":"ARG","properties":{"name":"Argentina"},"geometry":{"type":"MultiPolygon","coordinates":[["@@ߗ§ѓ̔ԑx࣑@Aሞ͒ϵрؿનԋ୲ȿϙп"],["@@Ӵ؇͠ڰॠ“ƊǷ໶ോۊŷਆاࡾ͡Ŧχࠡ౧ࡒɭ़ŷڔƈނ٢ƎݐжLjфӝiڣۻҩ֟΁ॅࠃ૭ଧȽڥɣࡹT࠷ǽȇÝիËѫ੨ܙŗ׃Հν§Ч߯ઁఛ҉။ǩउĎǰԅǣػƺщԋ̏ࡱř̪͕߱ɗŜ࠳֨ʧҠˆʢѧޛʻڭԹūࡋȣ҇ߏEڃљʋؿؙࠞߦǝ˿ݭ঳Ӄձটލͧ΅Ͽ˔ࢍ֔ӡΟ¨ީƀ᎓ŒΑӪhؾ֓Ą̃̏óࢺ٤φˈՒĭьѾܔ̬૘ěӲξDŽę̈́ϵǚˢΜϛ͈ȝॺ͸Ǣƙ਀ȠࡲɤݢԊ̨ʭࠐEޚَոo۰ӒࠎDޜɓƶϭฐԬࡺÿࠀ̜ބռ߂צԺʥ͢Ǭ˔ඔࣶд̀ࢎĹɂ۬ݺશȱ"]],"encodeOffsets":[[[-67072,-56524]],[[-66524,-22605]]]}},{"type":"Feature","id":"ARM","properties":{"name":"Armenia"},"geometry":{"type":"Polygon","coordinates":["@@୞ƀǨə͌ƣǛɁ҄˽ʁˋΦɫϘƏl׋̣}΃ӢHżχCʝɤǩuͧʖرȼĄФƛ̒"],"encodeOffsets":[[44629,42079]]}},{"type":"Feature","id":"ATF","properties":{"name":"French Southern and Antarctic Lands"},"geometry":{"type":"Polygon","coordinates":["@@ը˃ߐĿˆDžɽϣಇÃq҂ŮΎÊǢ"],"encodeOffsets":[[70590,-49792]]}},{"type":"Feature","id":"AUS","properties":{"name":"Australia"},"geometry":{"type":"MultiPolygon","coordinates":[["@@ߺ́ҜŘپNJԎÉÐঽ˽́ēگ̉ɰ׍בǧ®ԫ€ԭܘŗֈӝܸtϬռõ"],["@@̢ڇբ̈́˦ΡЖ͟đϋǴܛŸнɄĹɬܕąѥ˖֭࣬ѭצЋ֞λŋȯӔՃࣧ͜ͲȂ;ηȴźƢࢹ׬ԩϸ͋ڀڹʀڭtӏËԳА܋µݓơϵɩݡjӕǕ׻χއثЭ̫ٱ˫гʝܧ͕нɅػʼnׁªˇӕ̇व‰ޡ·ϫ͙ԕέ۟ψԥƪżѬҝǃ݁؉ܩɪӉƄӑÔ߿ʐիԮƻْțьЭ;߱ĸˢРȯزЧ׉ݝƷѮҬŶӞ͘ЬãجہܑԿ˽͏ڛٽΊ~ҀԿ،ѹ̀ǂȘઃԚןz߯Цຓāછ̝ख़˫ߡÈࢻљܯȗljѱ̳Ϳ܉qՅõݑƶ׿ğֽԁ҃ʕœуʁЗˋؕ֛Bࢽ՜ҋDŽlӖкŘƚȒ‡̠ĺאģӼѻࡖƏӒ˜ӎͭնsʚϋͰĽڄӓڔřΪτε˳ެиʑʞ͗aјеڎă˄țʦĠӠǢȸŘрęӮΎ؀Úٕ΢׀ۀˬЦΪٜ̰ϤàɴĻڎ̺ԚĤŶȀɞüҬoࢨʖҚώɊ҆ӲѐœͲvҘט܎ΠܩΦǚ̗Ј˂ТψǻĸٖҠаȮͨцƜ`ɼτĭdɂτŦОŔبϫҲӽՂMՖÿDZҦДڪϜɘſȾκӒԘ̒јıۺǂeі؛ˢ҂Ū֎ȻҀ·ۼɋʈĐԶʵӬʊ͂ñȠNJϬеɡ͉҇ͻ˿ƒĮͱʙп̗ЭÔʁڜҫ٨ˏѠ́؈ӻʂBѰɍŶʷߤ˵ֈ˼ǐҊǠόľҤʰڞŝОÔʔīӔŌنLjǠŽˬȮѾdžҦtʈ̸̾ʂЩÎՃȾķ˜Λ̨ёÚӇ‡̥"]],"encodeOffsets":[[[148888,-41771]],[[147008,-14093]]]}},{"type":"Feature","id":"AUT","properties":{"name":"Austria"},"geometry":{"type":"Polygon","coordinates":["@@Û΃ӁCǎǻ˧էLJƗܽsщȏۛÞயɐȉ̊ࠧƣĭDžԗŢѕxϝƶźȴƬʪ²ьɹŤɜݎ•׸ƮЖ}ˀǣþƜšո̠ń̒ϰز˓ӀΆ̐ÚٶʱЂªϰǁãŃČ̅"],"encodeOffsets":[[17388,49279]]}},{"type":"Feature","id":"AZE","properties":{"name":"Azerbaijan"},"geometry":{"type":"MultiPolygon","coordinates":[["@@ʞɣψDGŻ΄ӡֽŒщϰƃ͆Ǫv"],["@@ϊËƞɈԈͺѴѵђ׭ϺŸʸɧۗãƣٵƟ̭̍ȝvзȽ¥ԻѲ̂дʝʚ̿×যإk׌ϗƐΥɬʂˌ҃˾ǜɂ͋ƤǧɚȶƎضʍҐ¹ŘIJбҔɔŚʀ…׀ԙ"]],"encodeOffsets":[[[46083,40694]],[[48511,42210]]]}},{"type":"Feature","id":"BDI","properties":{"name":"Burundi"},"geometry":{"type":"Polygon","coordinates":["@@Á০ɃϢԜßʲӎҀŸͧǸȏT˗ȹǭ͛ѫ̧̥΍Ÿ"],"encodeOffsets":[[30045,-4607]]}},{"type":"Feature","id":"BEL","properties":{"name":"Belgium"},"geometry":{"type":"Polygon","coordinates":["@@؜áުǪՐοҦȝħ֧ɕĝһܿϦћßדІϷͶϷ`ũ̒ڪǔ"],"encodeOffsets":[[3395,52579]]}},{"type":"Feature","id":"BEN","properties":{"name":"Benin"},"geometry":{"type":"Polygon","coordinates":["@@ۛįȹ׆žኞǛǦЮ̇̌ʱʞņѶ̀ĨǠξЪĀȀʤˮʘ̠F٘ә˩ȎӽǓͷĘɧСԳʵʳǁՉt՗µണ"],"encodeOffsets":[[2757,6410]]}},{"type":"Feature","id":"BFA","properties":{"name":"Burkina Faso"},"geometry":{"type":"Polygon","coordinates":["@@ֹɐϽ‹̍Ƀϗǰƥ˦ϙǾÅӦɮΤo˴ښۢŬּɲȴОœΚǢŘɎٴϖdžˀ޼ΒҦŢɀLJՠJáСŔϣӀչ€НॺȏmֻǿʣЩÿǟν˿ħ݁lϳâ˓ƉωÖร¡qӉŘم"],"encodeOffsets":[[-2895,9874]]}},{"type":"Feature","id":"BGD","properties":{"name":"Bangladesh"},"geometry":{"type":"Polygon","coordinates":["@@i׽̉ŶÆگʉѬµєDžКΕӨޟ’ü΋˃ҳΧǠũƵʃĠ͗øŽۖ̅لƜԒԫɤȆ̪Հ̼؅Ѽ֮̔ږεВ£ô׏ߞřު^Ӟƛϯ܅ϕµʷӍҢѥƎ՞ɶFѶ೯"],"encodeOffsets":[[94897,22571]]}},{"type":"Feature","id":"BGR","properties":{"name":"Bulgaria"},"geometry":{"type":"Polygon","coordinates":["@@ʎΉ͚Ö٦ſ௾«иɌবȜ̩ؒӴĕѥΏ̫׹˔ӏܣŒࡥ˃Uлޅÿס̊ڧɱة|Ñ֊сːƒŢĝĴƘˌ͌ˀСδ÷̬ȸȐ"],"encodeOffsets":[[23201,45297]]}},{"type":"Feature","id":"BHS","properties":{"name":"The Bahamas"},"geometry":{"type":"MultiPolygon","coordinates":[["@@ȵ£ɇӜ̿ʐǾՔʨ‘ۣ̎Jӥ"],["@@ࣷƅÏ̴Ђäֈ{~ɕ"],["@@ƟׯƷņ`ѮϓͪCĪڐϗ"]],"encodeOffsets":[[[-79395,24330]],[[-79687,27218]],[[-78848,27229]]]}},{"type":"Feature","id":"BIH","properties":{"name":"Bosnia and Herzegovina"},"geometry":{"type":"Polygon","coordinates":["@@̦FȿσМ͓ūЃȡ™ƽû˙țūҥݓ͈ͅΘ͋Ȅϭ̾ǻʺЩϾǬΒ̞ȕǼǨϾnܠƓ׈\\Ϟȅ"],"encodeOffsets":[[19462,45937]]}},{"type":"Feature","id":"BLR","properties":{"name":"Belarus"},"geometry":{"type":"Polygon","coordinates":["@@߼Mࣰ̈́ȚӄېːÿϔԜƚ͖ࣘࢮɁŢȻѲĴࠒȧĊЁǷɧՄս΂Ƴ»Ʊ֦Ʃʎɡ͝ǿڳˆljÿȠ˧ȸ՝ܝ¹ʵȁÃхͭĆݷ¡əȞ̿ƥ́ŨڍjफȬࡕàٱmҡɩГeϐʷϴԌǢLͰɷ͌™ϊ"],"encodeOffsets":[[24048,55207]]}},{"type":"Feature","id":"BLZ","properties":{"name":"Belize"},"geometry":{"type":"Polygon","coordinates":["@@OŮĸžƴı̞ԔDŽZHūDŽGaɭƋεôŻĕ̝ÀăīщǓɟƱǓ̅ʣ@àॆPژ"],"encodeOffsets":[[-91282,18236]]}},{"type":"Feature","id":"BMU","properties":{"name":"Bermuda"},"geometry":{"type":"Polygon","coordinates":["@@OEMA]NOGNG\\Q^McMOI_OK@CQSGa@WNLVWHFLJXVFGJ`ZRTDLeeWKIHGIK@@[MQNi`]VDTBHCJAPBJLVFjT^LV\\RJZRn^RH`TfJjZHHOTTFJP_NOX[EYQQKMEJOLANJH@HQHAARF@ZEPS[U_IcRQXE@EEKKOCGGCQCOGISKYGUC"],"encodeOffsets":[[-66334,33083]]}},{"type":"Feature","id":"BOL","properties":{"name":"Bolivia"},"geometry":{"type":"Polygon","coordinates":["@@य़”͟گӳ؈વȲ۫ݹ؅ŗ͡୆ҋऺˆ߾ѳ΢ŏ؆ЫֲՌ࣢αۺȖ˰ƭ̶͠рh܎¤נǸ˶ܩഠزíѠnȈʪ݀;Ѷ͂સƚęؽļ͓ãࣰ֛ݫऴƑ̻ͦ֨ǕΐʑՈTӦʟšӟǐʕZγʓa͒এྖ“ūӟĜͧҞɽȤԹƫڋɯρĄӏʿǥaʶ޳јޭ^ัʓЕ݋sҋͥ৕ƉǸ"],"encodeOffsets":[[-64354,-22563]]}},{"type":"Feature","id":"BRA","properties":{"name":"Brazil"},"geometry":{"type":"Polygon","coordinates":["@@૮ନॆࠄ֠΂ۼҪjڤуӞеLJǒӜŖӼBҦ̡ƴ̿Ƌ̻œį͔ýޔƿʤ֥ɪ΃ǏࢱLjÈଜʝҴˀǦăӐɰςƬڌȣԺҝɾěͨŬӠྕ”͑ঐʔbYδǏʖ™ӠӥʠՇSΏʒ֧ǖ̼ͥळƒ࣯ݬä֜Ļ͔Ěؾષƙѵ́ܿͽȇʩџmرîӃƟϡĪÈ౨ۏӷݏv҄ͅ֏¶DzΰұԞΓݴɜƶA΢ԖʎċҔɊ̈Ôϼ०ֲێNJŔŴݴŸϚᘰpθſӔύ̬LؐӀƒǚē†͐ӯĔYՀ࿖k˦̂ɸˉǐӷǂļҨѻٸÆnjʲشȞΊƐĮΤ׸ʆ¯Ǯ܅ðśՊ’֞ϓɒǀþجŅڜȿʐȤ؀žल̮͎̾ŏʂѪšȜȗʼnσ̀ŵȖϷɷ̏ƅ܏ɌыÔϳԬϿЮ¥Ģǒˆ˜ϠƦ˚ɢҬíȲŠҚçøǢƗǘĎʐͺõЈĒӔDZξǥʺɪȊ•ŘɿДÒ͒͊ʴؤӼޒ˺¢ȺҫҼ฽҈Ƒxׅمەʾʩ๤ƁŠࡃٔր੐̟ඊԡШӱƏҫ঎ʶ࿐ѹఴŽఔ۝੸व٪ʏܖ‘̦˅˸੭Ɣԗͯ൹ёշஅୡՙोثܯȿgɻءÒ༽ɹಓęօˇͧƫ૱࡛઱ƛࢁڹηȟԋ࣯Fೕ͓סύवʗ঩ڝ܅࠯ũطƔҫƽࡓȏЧחҥट๕݉ڗ֯Ͻϥߛ։ӑɷӈψЊӟֲڇҬࡹՠ̹{ࡅٰձę"],"encodeOffsets":[[-59008,-30941]]}},{"type":"Feature","id":"BRN","properties":{"name":"Brunei"},"geometry":{"type":"Polygon","coordinates":["@@ͬ̾܎Ң›Я·՛Б€ǭ˹ϥѦ"],"encodeOffsets":[[116945,4635]]}},{"type":"Feature","id":"BTN","properties":{"name":"Bhutan"},"geometry":{"type":"Polygon","coordinates":["@@΂ˍÏԩۇ{ۿÈՇſޅ͊kǚ֌زҒɈ׸șѺqπɥ"],"encodeOffsets":[[93898,28439]]}},{"type":"Feature","id":"BWA","properties":{"name":"Botswana"},"geometry":{"type":"Polygon","coordinates":["@@ǜƭ˄ӡॎइήĝD̑ʚՑٰŹ՚ϝ஑أݭع˩֓ʧ́ҙãƧГďʽ՝țہ¤БɾΟĸХșȵГЉʧпϑ׻đȇ̐üԠӽߚɧŲAរࠤˆ|Ჾش„ಖ͎̎΍՜ͤʮDӂȎưÙ͔ڣ"],"encodeOffsets":[[26265,-18980]]}},{"type":"Feature","id":"CAF","properties":{"name":"Central African Republic"},"geometry":{"type":"Polygon","coordinates":["@@ۜÚƺɎƔgȾȏ੔͐Τ͠Ѭ̌ĉ̐ʂüߺ½߆ϴ؊ࣺю;ՐƜĪΫӜԿF΃ƋΓÄʻ̆ʍٖοҢͻT˗֠ѫΖεɆԋغͩƊˉˣęաpكĘ̹ïųȱ˕}ͧDzधнϥĎŗÝʥԕطǐؙĊ՗̴ۓ˸҉˓͛яùדգ²֩Ƙԅѻѯޱėʐ›Ϧϧ˔̳Ѡï̠ЇѮæʢċΞÞٴȬƴц࡜"],"encodeOffsets":[[15647,7601]]}},{"type":"Feature","id":"CAN","properties":{"name":"Canada"},"geometry":{"type":"MultiPolygon","coordinates":[["@@؎œުxЯ΅̵Å੥Φȿˬ͆ʸ̎С"],["@@Хcઝ˂ޯІ̄î૆Ɂ࡮Η|Ʒ"],["@@хŝൡϢʥ̘ݩ̌Ưʈࡻư͕ҜðȚࢨǿԨŵ߄ė˺̃дЋ࠼΍Όҩ"],["@@։ܿո˴֠ǵ̏̉ݚɱϰȴ࠼ʵʹ؛טƞņѿʼԷΝ݉ϝ‹փǂǾیɻńইܯԅ†צЂ߫Ȳࣙ¹࿅~ŹʠԼ̐λɬ۸Ԓࢄ೾Զӎܲ̂϶™Njɫ҅Չ"],["@@@@@@@@߰äʥ॓ܶگͯDԑϪ̵ϮчʾƻτºˎЂŋ"],["@@͡ѳχîəʢ Î͖ʦΆkɈǣ"],["@@ঝҧץnǿɪزϲ଼SiǍ"],["@@ƼυјżӨɗं˽४ʽöЍؤÞ׶˥ݙ˃ಳȬҽϚ࠭ҁ஡ѣ˿Ӯଗăܴдņڌ˺ޔ؈å"],["@@ष¥ȿЪΦҼޖŜپɷXέħřձʛ"],["@@Է̍ଉʬۃğଫϘ݊ʼטζࢼʃԎƯʦDžԠ͍"],["@@G࡭૰ڄ৐եʡح߾֥࢚؈ؖܨ°ईஞÝఔūૼй¼зس҃פ҇ŃУ࿩חୡŻࢃʨʣуߵ۽ʓοই֩ளÇڏΡÇձ঍Ŀਉڻ࣭ु͙ڏ±উంƕϜ޻ϼّ୲ǔ༞εࡀ͋׺Ѕ੆ɳࢸΟ൶µࣴąƍܫʼࡋ،ळనߗ٨˚ҔࡺѭೢףѶഎЀ॒לҮהç֭֘܌৷لলࢤνݾ˫ಾגȘ෸ɫࡸć۠ɚ޴˵ਚӣʮ͙ຄÛ}۷˪ਜ਼ގſ،ӵ௖Ұߦऔ֌ϸٺݣબੳघ৙͵Յ૤Ӂݰӓംɏբˍͬ܃ټŏͶͅÖऻ؍́׽̏൯̗੏ۑ෇ƋᅛǮుPࢇÍ۱׽ੳω௉૗ॵޡ܌Ɛഘૄᄈ۪సČݔЫߍ֟ˊࣟ˜هતп൸ŨࡆीÎ؍ժ̥ਣսᇷԁ࠯ͽय؁ٓ֍܆ฤ۞഍ƒणĹջӆBନύʐ֛ƛ˧ɚٙىʱٹ̕ϡΥŽˏ¥čȹ໽A౥MϛƷࢵ؃Ŀßˍ͝ޗBࠛGϛƅƊǑøʯeďષлࡽſউ҅Ɂ@˷ƂĥŦnĔȂ̎ЂҦʘӺǙܴǵނ࢕ЂľƬūĺɳ@ǛƆ¥ȤǍēɥ€¾ĊȡĊćɚٵːڹ˪ࠑ͘߁̨ݧʃ˝Sਕɔڻʼnࠁʺ࡫Ɔו¾ʻƜƫҤ˳IE͓჏BᮝA᭯@ᡃ@ᠿ@៙@ᢡ@ࠛ@᠁@ᛷ@őF྽ࠜ׵δຽΐҳݖŤԨ੻ΨƧڴ৭؎iѠҲКwՌෙ՘࡭ॠՁ׾ޑϚ֣ΈѿѢࡇ˕ࠇҹݛւדπࠋɸࠟ|JⷎNᷲ༬ȭ೘Й࢘û݆ΖৰˀఢĹ఼τ൘Ⱦ־ΑظȠȊЄ׈ęෆݫ૦֬ŖّਔƐ͆ʖৰ·౼Λዸ̭ୄƛࠖÄଊэ஁зຶǷᗘIJܒƦࣆԋࣴьࡩΦժ˼৾žڦĎڴȩࡊҗरä๢ϛಬƄ௬oĭԺݞƦದ˵KߑՖڠڰuϞࡊ࣑԰কͺäघশ؎ૌƇࡘχଞॅݗЭ༠ǝ"],["@@нϿሎʬୠщॊіސ˟یࠛфΒ׭ࡰ݊Ŭ࠲Ƈश͹ՆࠉʼץථеະЉĝσൡã՚͓˱ູ̯Ƃฃɪঋ»ཅ˷ᒃű๻āҕІଫɮݙģਛږ֔ĚಘƜஈ›રƦྷȞᅗã஗jѷ̴ዎͲಗ[ืɚ۶ـגͮᖬԠ࡬Nj"],["@@݉ևಹך˸Ş૸’ٔȁ"],["@@öɵࢿ|ࣟjࣿőʑ¼ऍѾ˜̠ИÈነěชң"],["@@ڎԽޤڴᒆΈ෺ࢅůջဒʒߒͮሀыୄЏŊν༚Ȑ࢘՗᎐ܸͩ͹ߐ޻໯ϹጘչೲȁீޙೖÇʽכ้ঋਗά೓߲ઙĿŁӕࢪӥଜϯΌɟմࠩ́׿੕ɪᑏڨஎܣ࢔ԕƎ̉ᗱͲᅩӤ৳Ц̌ʂయќ௥Т`ʑᝡƅ܃˾ֆؤ཈dႸņ˫̜̊оચࠊɳϊ͕˾౿Рၳ˺՞ɆࢷԺ݋´ڏ˸҇ʛ຿ŅᵝȈᄫʚഹŴۥ̐࢞Ϧ஝Hˉ࡚٦ݨࡺ΄ᓪɢأի"],["@@৊ǯຄńɖʑ޷Е౜αƱݳ൝͗߳ê׉͎ᐡٮjˎ႖ĽएռসР"],["@@࣓عय़ŒԽ݆`кѮΨ࠰ɮც‡ྈȱళݟ৉Ǎ"],["@@ᕍЙѷςኹѺήΤ׌ؘܰւࠑԦᭊƀ஬ǧᒰ±ࠄʑࣖΝ੍ɃᏝןਫי@ν"],["@@ҙ͙௝Øৱɖ҂Ϛீɨܼ̬̍ˇ"],["@@ٞϵ€љϣس൱đࣗƈjӬ൝ÝÁٮࣜౌ˺ஂµÜŎ"],["@@̙͢ݠƘࢢ™ƪЩԝЋ᭗Žᑯη౩mŅ˜პϊ④ij୯Ʈପࠐ߈ɾᛄ˳๶ӻฺÛறߨޔ̪ࢄĭ˲Џ"],["@@ढ˓ကFܨˡȑ́८ȍՔȧଊ™௬ë೸ǼႊðീÏ࣒ͅȊ΍ԽɟభǷ੽ĸᜱŻႫcഫļᖁ˔̃ҦĹжࡇξ჋ĺঅʼ͂ΈႾÁ"],["@@ŗ٣٩̇޹£༝Ϋ഍ŹଗǼ@@ුؼႮծಆ[ସŬ"],["@@ϣy༽Âɡɼၜ]מƻĵĩ"],["@@༩ʋఝ˔ڼˎ௮Đஈſ˩ʥ"],["@@৽ǏඉBbŤࡴʦҌદǝ"],["@@కǥۃȚέ͂áΎજ‘ӪÅ৐̇ɫ̣"],["@@͜Ε൏Ĥ൩˘ሏŒߺʠ৫ȮÕ͐࿶ŕᗢ̫ٞЍ"],["@@০˕ଽʟ༇ك๥Óდņࣗ΄^̦ڔɢ໡Oए˨ՑϠ׌ώ׊ʲࡴÎοȖዜ¨੶҅මǵ൞ǃڒև"],["@@ᖢßᅮŅ໤ɫ™ɡᏅη᎙ǟݻȉᆬJጡԙേʃ෯ۇႿƓՙǡᡷěୈĿׇƭ۞бߙ˽ಛʃЋ͡୫ʣŞȏ෬lȳᖟԋᔧɴឿŻధĸཟªĿЖ༊Ȑб؆ԢÐᖤγ଩բഹLjڼ͘๰Ȩʄ̊஋͠ΥѠᘞ—ڒĝ಼̪ቃĬ᰽Á๣˸۩ͼগʘȁ˺దLjঘ‚࿲ƌం̺ਬ©ࣤɽٔҒૐƈບĢᢲ–Ҁĝ᝚ƚᆔÁᆒÁ"]],"encodeOffsets":[[[-65192,47668]],[[-63289,50284]],[[-126474,49675]],[[-57481,51904]],[[-135895,55337]],[[-81168,63651]],[[-83863,64216]],[[-87205,67234]],[[-77686,68761]],[[-97943,70767]],[[-92720,71166]],[[-116907,74877]],[[-107008,75183]],[[-78172,74858]],[[-88639,74914]],[[-102764,75617]],[[-95433,74519]],[[-123351,73097]],[[-95859,76780]],[[-100864,78562]],[[-110808,78031]],[[-96956,78949]],[[-118987,79509]],[[-96092,79381]],[[-112831,79562]],[[-112295,80489]],[[-98130,79931]],[[-102461,80205]],[[-89108,81572]],[[-70144,85101]]]}},{"type":"Feature","id":"CHE","properties":{"name":"Switzerland"},"geometry":{"type":"Polygon","coordinates":["@@ƫŹȳϞƵіwá΅χƙةŀǻ͹ЏơƄһ˵Л¡αǶ˽ςБſ^ϠؚҾɈϤûɲƞ܎MǦǼ࣒ʱ"],"encodeOffsets":[[9825,48666]]}},{"type":"Feature","id":"CHL","properties":{"name":"Chile"},"geometry":{"type":"MultiPolygon","coordinates":[["@@Bም࣒@Ԓw˧ͻܛʻЭ‚ӻä؏ʨ࢟ŨੑҸ࡫Ҏୃशۘǭ୼֗૜̟ѢϬ˘ֺޠΎװı"],["@@͢୅؆ŘĺɁ˿ࢍࣵг€ඓǫ˓ʦ͡ץԹջ߁̛ރĀ߿ԫࡹϮฏɔƵCޛӑࠍpۯٍշFޙʮࠏԉ̧ɣݡȟࡱƚ৿ͷǡȞॹϜ͇ˡΛ϶ǙĚ̓νǃĜӱ̫૗ѽܓĮыˇՑ٣υôࢹ̧̐֔ÄgؽΒө᎔őުſݝPЙȷݷ̣Ɖ޹Σoॅ˚१ג@@ਲ਼ӔˁՒʄӰх֒Ņ෤Φ߰ࢴٰౣʔߞݒ˸ඊत̏Ѯგ֝ɠʿ਻ՉŠ˂ல˺༒ϮָʍࠎéूΠ„Ԩപ׈എΤబȗ఼ʤۚĵਞӮਆưྺ˒ნˀሤÕ൘ǩ஄ќɌɦњЬֱŐ؅ѴΡ˅߽Ҍह"]],"encodeOffsets":[[[-70281,-53899]],[[-69857,-22010]]]}},{"type":"Feature","id":"CHN","properties":{"name":"China"},"geometry":{"type":"MultiPolygon","coordinates":[["@@ԑഓΫۏѷ܂ĩخӶࠜڦَϨʡƣԓ","@@ܩЗۏʺyܢаϠࣾɾӚoȊ͍σσșӟ"],["@@ฬˍ঺ׯͼ߃౨Cܰͨ൸ʜѳݱ͙̭˽ः֡ࠇ৵ƪܝ̑ɜܙť঳ѕwLяթӺͯһಙαƀѹܩŒЍ˂ֽ׭ऑҋۃա୭ʑأϽࣝɭ҂ϴǭ͞ږ֠ѹѲܷ̓ॉ׏ԫթ࠙¡ѓϻѸ֩یƏ„ϕڔʕस׶ݚ͝լuƌѱஓɻϻҏࠇућיࣜҥͦࠝԞޓ֮٥_دՅɯȪ҃ӶʻŻۃɇڗҷ÷ؗࣧڹિޭোିޡୟۻृĩԣύ̃˘Ӈй୭сࢵŹ˻ࢱҭ·ə؎Ȧ͘ૻːЇƍࡍɔЏ΀ƄӜޏƶЙܑ̀҃ࠇīڡJ҉ȳѥūŶ॥҃x÷Ȣ}Ύ؝ʓεƸر͂ʔۤՏǎȧޜࢱƓĴাߔۮ”ۚ{٠νȨ˭ӶӭÙࣟŲ˴ΜϿԺ׳Ν۵ȸॷ՗އسڳĿοɦѹr׷Țґɇ֋رëڌԟǭওĈोȖڿτٵǔ˯ЖҽŦࡓոکʴΑȩଢ଼טࠛՒɽऐ׾ő‚іͭјĐۆࣙঠ൧ͼʝ٦ةϼƫʌųӎˆ͜ԛȔ˟ďɇިʈȔśȠߤЈ׈ǐࢸő͆՜ંIJͮ̚೜ҔŠȐãӐּɔݱฦဘͲјȈ؆ຒဠˡҲϞ¢ࡆۦĀٖ֔͢èɚו۸ѽப̿׆ڱ͕ঙ̢ηূƝଆŝ৪ԻԲġϤޟӲӿऒnჄȉ૤Ŝࠦůఔԛ৮BόʽঐҌബ̈ాŒঘ̒׾҈ך˰Ƌˤˍ͔ѴըӀùࡺǝ࠸Ѿ౲͚؞֊נʆ௠ŐڐĥĠ̘ݿזګː٥̳ࠣžӇŃɏΆר࠾Цو৚̓ஆՎQτݸࢾҲːWҪңȦۜмਰƲ૜vసʡ݈̱԰ࡏ̀α̊ԩ̶ࠕ"]],"encodeOffsets":[[[124701,24980],[112988,19127]],[[130722,50955]]]}},{"type":"Feature","id":"CIV","properties":{"name":"Ivory Coast"},"geometry":{"type":"Polygon","coordinates":["@@ϣUוǒ՟Wহƥ׍ʍ̯ࠫNjvÞۖĄŀ}ͨΣΚˉÈʕɲǾώčО ʔƄB¸ξÝnjĄŜ̸ĶȹڨȗΎæ˸ǘÞŊúɸųٮOƸʖƢgʎĦžΫȞłΌŰϚǽƦ˥Ϙǯ̎ɄϾŒֺɏɠ஡Ο۷ɕेθܣ›ͧ"],"encodeOffsets":[[-2924,5115]]}},{"type":"Feature","id":"CMR","properties":{"name":"Cameroon"},"geometry":{"type":"Polygon","coordinates":["@@Ľ°ӻŇԝŒЋÅ൅nŬڒ͟֊ϧƚǟϖɋŦXɶɎתЎ߸ʒRԄӮ͈bҾΉ־˲ĀΔȌͺžь҆ΊǞךDzȊŢѨɜ՚۾ٲ¬˨ĠƲͫͰ‚ˌʂ¶ͮ՟Ê֏‹֏ҜޅҷTʁÏϥČǻЅӸөμƛŠΏˆ׃ſɩх࡛ȫƳÝٳČΝåʡЈѭð̴̟џϨ˓œϥĘʏÓґڛȤڷɜ੗"],"encodeOffsets":[[13390,2322]]}},{"type":"Feature","id":"COD","properties":{"name":"Democratic Republic of the Congo"},"geometry":{"type":"Polygon","coordinates":["@@»ঙͶŕˑ̗͓ɟ͍ѫǯϷ±ګț͍Oهʍɹ‹ԃŗÝýҟɄϡÂ৥ưޝċѧǘӣӤҹҒ੕ͥĒ૿ƙɣĵʇՙȊχƫষĻࡇɨƫט͝ɲƴìٟࣟR·Ҧ̳ΨٟŠȋѰԣ˅ڧŞ˫ϢՕüϽqµʾ́rϥºԳųιtȻû®ৄ˩̸ÕԬŬԒǝ͖eՊ৳Qò̢ѕG­ƣԵɁӧűȿҫŠˣş։å͏Ѱȗ˖ʋԌȷض៛\\̍ķʑh΋œşʼɊʀμƎɎ̪ǰɚđ˼͐ҜSÄʃ̼ƩӶՄӨШɆːƒ۔θࠆϬўքМĪˌt̰Ǝ̆«ӊŀݖǐԾʦ҈¸Ԕúה͜ѐҊ˔۔˷՘ؚ̳ĉظǏʦԖŘÞϦčनоͨDZ˖~ŴȲ̺ðلėբoˤĚԘۙϘķɤƖϲÅҶDzȦΫ݊֏"],"encodeOffsets":[[31574,3594]]}},{"type":"Feature","id":"COG","properties":{"name":"Republic of the Congo"},"geometry":{"type":"Polygon","coordinates":["@@̿˾ʩƗͻγۏࢸٖҪ̓֌˾ɂ֦ĺäό҆Зݐ•ʴЈł֒ĝڀЉӺζ঄ȽǘسçɻѢÔξ੘ڸɛڜȣÔҒѰ޲ԆѼ֪Ɨդ±·ԓʥ҇ǏԽĿݕ¬Ӊƍ̅s̯ĩˋփЛϫѝηࠅ„ۓɅˏӧЧӵՃ̻ƪÃʄқT˻͏əĒ"],"encodeOffsets":[[13308,-4895]]}},{"type":"Feature","id":"COL","properties":{"name":"Colombia"},"geometry":{"type":"Polygon","coordinates":["@@ΫȤЭ˨ʅƅ܉Ŝȱΰƽ_࠿Ӓŕʺ̼ڛтȢ̦иÊΞՆ͐Ѵ̳ȦDŽӦȏސǸɚƃ܄ͻ҄ņТ˔ÑǂʠțӶĺŬѢـהΌĚT˦ƺ܂ӖϸՊfäǪڂéڌъ͞ȊОК̖»ɚɛǍ˱գƕɇп͗ʋʓ̷Ĺ׵ɷӭѢÇņϭȄȁâ͹ij̵ˆǫȸéȨ̉ઊĄӦŃעܡͼĚ؂­ӐĪ̔ƟƱҍȇ˯ß׻ǜ֑ʆʟ†ȉэл̨ȃɠ̋ʰ࠹ǁĻǏӸɷˊ˥́࿕lZԿӰē…͏ǙĔҿƑK؏ώ̫ƀӓoηϙᘯп҂ʣpժࡤٟϾԍị̈ƤҧɝصŀӵࢤϳɐˍІ֑Њɡā"],"encodeOffsets":[[-77182,-155]]}},{"type":"Feature","id":"CRI","properties":{"name":"Costa Rica"},"geometry":{"type":"Polygon","coordinates":["@@җȆǟǮĬƤ‰ȄɷȪͥǔ́ņÅʖəƮÄʑǗȩȓɸˑĊŗǞLʮŎˆʁŠȖnjŴňֆɝȖŊˊéƔǥʜÇȪDzɈҙ͖ͷЂΩ͗õLͷǪűűıƱëǟ©Ǖ"],"encodeOffsets":[[-84956,8423]]}},{"type":"Feature","id":"CUB","properties":{"name":"Cuba"},"geometry":{"type":"Polygon","coordinates":["@@ܨÑڊW߄˹̭ͮ޺Ĩ̔ȡ܈ԳԺϛˢ\\ԆǟÕʁئ“ٌ΅ıȟ֑Ń֡¥׃âளą֜Ҷ΁ɔէÈ̃ʐȥӎӃ޵ɦʥǬભž̋ǐ̀ɀࠗ¨׿ѧΏ[ťȳеğΫĂѺʸǼ̤ϞȈіǎَĄȰĢ"],"encodeOffsets":[[-84242,23746]]}},{"type":"Feature","id":"-99","properties":{"name":"Northern Cyprus"},"geometry":{"type":"Polygon","coordinates":["@@ÐJŨȮ؄Yކʢ֧ΧÔƿęˆLJÙűj¥iĎѾNjVɫïƿ¬"],"encodeOffsets":[[33518,35984]]}},{"type":"Feature","id":"CYP","properties":{"name":"Cyprus"},"geometry":{"type":"Polygon","coordinates":["@@€ãࡱͿЩŊȟͶЎŒǀ«ɬðnjUÒ½j覎ŲiLjÚ̇"],"encodeOffsets":[[34789,35900]]}},{"type":"Feature","id":"CZE","properties":{"name":"Czech Republic"},"geometry":{"type":"Polygon","coordinates":["@@ϯǂЁ©ٵʲ̏Ùҿ΅ر˔ӃΰѕȬėΠƧʠؒǾ̸Ⱦ׾ǎɂdžɜīϒĖЊ˓ؼñ¿ɳҘǧŲɒּĥĄʿز»ϮЯʡCŽƯȕ—ÅȑLJ¡wý˹ēϋbšȁ"],"encodeOffsets":[[17368,49764]]}},{"type":"Feature","id":"DEU","properties":{"name":"Germany"},"geometry":{"type":"Polygon","coordinates":["@@d͗ࡔțS̗ࡢǂҾɰॊͧІˋȞёɹɣ̨̙Ⱥ҅ß́Έ՛ϑĕɛĬɁDž׽Ǎ̷ȽؑǽƨʟĘΟіȫӄί̑ϯ̟ŃŢշýƛʿǤЕ~׷ƭݍ–ţɛыɺʩ±࣑ʲǥǻ܍Nń״ьֺ௅ƸЇɘ´ςǗȐĨ֨ƗࢢԎ@Ɉ͂Ⱦޔƿ˴ǐDz۰°Ƽȃ֮вȓ̀ӈٌōՠŸ"],"encodeOffsets":[[10161,56303]]}},{"type":"Feature","id":"DJI","properties":{"name":"Djibouti"},"geometry":{"type":"Polygon","coordinates":["@@ȤʹΑӏȩήɯ̱҇ȅƬȭÏҷb_ʮßɶ˴Ѐ̐ϊήñʪȴ"],"encodeOffsets":[[44116,13005]]}},{"type":"Feature","id":"DNK","properties":{"name":"Denmark"},"geometry":{"type":"MultiPolygon","coordinates":[["@@ԋڹ࢟ӄŝΒ௼˨ˎу"],["@@ȵ̓ʡĞ؁؁ɮХ՟ŷًŎͽҲ}࡬Ɣɪʌʦ݌À̐ɴڮʂƒѝʟ˙ĶɽҘŵ"]],"encodeOffsets":[[[12995,56945]],[[11175,57814]]]}},{"type":"Feature","id":"DOM","properties":{"name":"Dominican Republic"},"geometry":{"type":"Polygon","coordinates":["@@ŀƞپIӾɏɜtƴ̕Ҡhʡϐ‰Ю̷̯ͿЍǼϫ•ˡ¢ƱƵ͑½ŷȲˣťͳֻɏƆ§ʎjɬɍʦȲƚÞ͒óҜ"],"encodeOffsets":[[-73433,20188]]}},{"type":"Feature","id":"DZA","properties":{"name":"Algeria"},"geometry":{"type":"Polygon","coordinates":["@@ᮩཽᝩ࿷இϑटćU՘ϵƌԹʊȧЀᬻᆴᬻᆴṕᎠfnj@ÊQ঺ബب࠼Ÿێɦ͎тচͪ˜جӢòϞ̶સƚƸ͜ɛDz̃ࢲ¹Ԟ́ՠ߰ҠࣦƢՌΎ߶ʰ෎Ƭർæшůߊͨ࣌P΀ȝֺ¾ǟћƄߟȡۙԭҵôمۊԃRȯԮ͹Ϊຝ˖ݏ°ϵƧۇÔϥŃҟòՇͫΗӺؓŽέ̘ҵϼƸڒϷςՃ"],"encodeOffsets":[[12288,24035]]}},{"type":"Feature","id":"ECU","properties":{"name":"Ecuador"},"geometry":{"type":"Polygon","coordinates":["@@҂غǻξ͍ϵԉςǞʀƙބ̎ŴƺԼ͆զÍ΄ҢǸ׀Ͱࡀӑƾ`Ȳί܊śʆƆЮ˧άȣŞٓʽճࣷ࢟য়ͧԥܵǃ֣Ӆ΋ΙъͻĞ΍áw̮ʈȨıΔ"],"encodeOffsets":[[-82229,-3486]]}},{"type":"Feature","id":"EGY","properties":{"name":"Egypt"},"geometry":{"type":"Polygon","coordinates":["@@ɽͷǹىɫѩȝƥ˩˔ϛϒ׵ஸđùΐࢯԪࡋٌವ̴ҙ˒ӃݮछǗƣ‚ճ঒ݭƨǣΏ@Ὁ@⁩@@ᶶ@Ჴʥڲɐ԰Żά̤Ж૦b߲ɝ࠲ʛϴſ٨ˊΌʊݎêװŃɮеȜ˜ڨȣټ³аɄւ෽"],"encodeOffsets":[[35761,30210]]}},{"type":"Feature","id":"ERI","properties":{"name":"Eritrea"},"geometry":{"type":"Polygon","coordinates":["@@˻˖ΉӰϋ˒ɏܷ̄ͶֻXȭǬӯȡԛϢʽط঑ǬęʹβఀĊ֒ˆʴؤƐьӒӦঃɴޗҢУବߏҲӍҖӝˀ˿аʧʩȳέò"],"encodeOffsets":[[43368,12844]]}},{"type":"Feature","id":"ESP","properties":{"name":"Spain"},"geometry":{"type":"Polygon","coordinates":["@@¦״΃θஒ؆ਊƱ૾NࣂƝۦªമƒͰ͛໺ϡ̨ǺीϝআŊ®ӥߓ֓ઁǯõ˱ԩү͕ہ͞ӑӟϑǹճىǗש٥੧_ߟhՃ͍̓ͅЩê̵˴ʃӚ޷žé˦̶̀Śɬ̃ʢɶրͳԌδè’ЈƎŬZپϲɪɻфөˆƝŁӹCɁЬ΃ū̥ɇ"],"encodeOffsets":[[-9251,42886]]}},{"type":"Feature","id":"EST","properties":{"name":"Estonia"},"geometry":{"type":"Polygon","coordinates":["@@ĮӸ̱ŁՓ̘ñӘਫ਼ɼ੔Ũ࣮Ƒࢂ|Ŵƣׯӝʞ޵ΫˉۙDܡ̸ρļ܏Ʃ"],"encodeOffsets":[[24897,59181]]}},{"type":"Feature","id":"ETH","properties":{"name":"Ethiopia"},"geometry":{"type":"Polygon","coordinates":["@@ԜϡӰȢȮǫּWܸ͵ɐ̃όˑΊӯ˼˕̏ω˳Ͽàɵ`ʭҸaȮÐȆƫǽ̴̕ҧ̴Й̛͎ᩨঽۺNᛛᡃફ™ݟףաeɯ˅ַB͹˴ލΙʝΓ֕àȃĬȟwˇT੟܌ב@˹ˢ@ҾѧƘӻࣴϥȚƧʹэЦԧÒ˸ӐҀrŲʰ[ݲʞࢠЊɾĎ΄ήٜԔи΀ࠠƆܠ঒ǫʾظ"],"encodeOffsets":[[38816,15319]]}},{"type":"Feature","id":"FIN","properties":{"name":"Finland"},"geometry":{"type":"Polygon","coordinates":["@@ūיಀ֓ޡى঎ख़֡ܛݴس΅յఘֻ́ѓޭӟᅡੵໃá๑̯ൃǯӡҞ߿ˠȈࠢСݶАӪނՆ኎࣮֖Ǭē΢ୟЈ˳͜uಒ಻ֲ૩ЪԊɞतѻલ¦ࣘȭߠϊЬ؞ಬ˶઄ͯΡכ"],"encodeOffsets":[[29279,70723]]}},{"type":"Feature","id":"FJI","properties":{"name":"Fiji"},"geometry":{"type":"MultiPolygon","coordinates":[["@@̂ʍƓѭԳŗҩļąτ͖̀ϤĻȼƐ"],["@@՛ǯŅ̼оǤˊ°Ӱˀ@ЧՕȷ"],["@@é­@ШǨžĽЗ"]],"encodeOffsets":[[[182655,-17756]],[[183669,-17204]],[[-184235,-16897]]]}},{"type":"Feature","id":"FLK","properties":{"name":"Falkland Islands"},"geometry":{"type":"Polygon","coordinates":["@@৘Ԍ܎ȿԌʹڦϙʥ̋ଋʥϙ̌܋ϙпϚ"],"encodeOffsets":[[-62668,-53094]]}},{"type":"Feature","id":"FRA","properties":{"name":"France"},"geometry":{"type":"MultiPolygon","coordinates":[["@@ˣ٭ϡǠș֢ǜ̺ը͎Ɯܛ"],["@@הЅќà݀ϥȊñʎjЈɗெƷыֹŃ׳ɱƝϣü‚ɇؙҽ]ϟВƀ˾ρ“ʁʚ̿̅ʯɐٱҖŃĩηݿӅစɬ௧˗ĩԑঅʼnिϞ̧ǹ໹Ϣͯ͜ѢԎdžူࢁࢤإю౹͒čؖઠǾථɏˇॎߌέዠپʨێܾǞŪ̑ϸ_ϸ͵"]],"encodeOffsets":[[[9790,43165]],[[3675,51589]]]}},{"type":"Feature","id":"GAB","properties":{"name":"Gabon"},"geometry":{"type":"Polygon","coordinates":["@@ࡹࡔ։ۚԙࢄ‚˨ǾˎȲؔǜخ˴¶௢SOৠЌÆԞőӼňľ¯ÓνɼѡشèȾǗεঃЊӹĞٿŁ֑ʳЇݏ–҅Иãϋ֥Ĺ˽Ɂ̈́֋ٕҩ"],"encodeOffsets":[[11361,-4074]]}},{"type":"Feature","id":"GBR","properties":{"name":"United Kingdom"},"geometry":{"type":"MultiPolygon","coordinates":[["@@҉ֽًǦԱ[ǦҊǥ҈۴–ࣔԳ"],["@@࣋ࣧࡦŘऄIɕۅݯݩࢄÃäĕݠ঱ֺƇԬढ़ʈͧৰDžķ՝ѓʗͲѣݱѯ૳Rෝɱϻǒ։ϿޥĪם͍ҁǘ௼ࢨݪǺOBಽƔʃͰ࢜ʺҡҐdžռఢ÷D@ŮӤ֛Ԯ_\\৵ƨȧɬ̨ϒˡɴҍЇ·߶щє̨ࢆٶھڤá০ì"]],"encodeOffsets":[[[-5797,55864]],[[-3077,60043]]]}},{"type":"Feature","id":"GEO","properties":{"name":"Georgia"},"geometry":{"type":"Polygon","coordinates":["@@Ųάȿִӟ̲ҭĬ̯ʴĺIJ܄ƝఆƋଦЕƦƻԚƂ޶ǭʴ·Նșɓřвғŗıҏºصʎȵƍଢ଼ſ߳Юࣅ¡"],"encodeOffsets":[[42552,42533]]}},{"type":"Feature","id":"GHA","properties":{"name":"Ghana"},"geometry":{"type":"Polygon","coordinates":["@@೉ӯҳ˽ݳʑݡʆœͨηܤɖैΠ۸ɟ஢ŗنrӊฤ¢ϊÕ˔ƊϴáÕʿΖџC؍Ąڍɂ̫ȅݳäйɢՓȈ̍"],"encodeOffsets":[[1086,6072]]}},{"type":"Feature","id":"GIN","properties":{"name":"Guinea"},"geometry":{"type":"Polygon","coordinates":["@@ʃtǡͷʁJǏǴÈͶΗԨɕħǵmɳ³V̮Ƈɘ‚ʔǻΜɹ̜ڥDțǁɵoƝǷīɹ҅σρӼ͛͢ɋŊȿǖħϊūȂʓƐώЦʮeɖƘȄDƄŎï˨ĢĖd˶МU؀ȱȄlÚĤҜáŨ´¶̭ƆBɖŒƔƒɸɇάãɲǺ˖ŒȬŠǚuȈȁĴɳΆΙǣɏ˙ǴĊŀį«ʡʲʍǗÝå˷Ș΍Ⱥڧ̷ĵăśÞNj·νƃA"],"encodeOffsets":[[-8641,7871]]}},{"type":"Feature","id":"GMB","properties":{"name":"Gambia"},"geometry":{"type":"Polygon","coordinates":["@@ņόࣶzȎȦˊ`ͨȷʼIˢƚǞʏεȋιdέǰ̷ȗƭQȫŝއl"],"encodeOffsets":[[-17245,13468]]}},{"type":"Feature","id":"GNB","properties":{"name":"Guinea Bissau"},"geometry":{"type":"Polygon","coordinates":["@@҅ΘΝÈȕʀLŸʯǴÁǶѼƌ˦ɦĨ༈•c˵ġĕð˧ƃōȃCɕƗʭfύХ"],"encodeOffsets":[[-15493,11306]]}},{"type":"Feature","id":"GNQ","properties":{"name":"Equatorial Guinea"},"geometry":{"type":"Polygon","coordinates":["@@ƿŴ़̀െmPয়௡T˳µ"],"encodeOffsets":[[9721,1035]]}},{"type":"Feature","id":"GRC","properties":{"name":"Greece"},"geometry":{"type":"MultiPolygon","coordinates":[["@@Ҡ˱ٺ¶شÑqƣҜĶĿʛ௃íTƒਁǎƺΦ"],["@@ʹՁȥĥԟ|ѫĀৱɓ׌ҿяƋҳAѻўƿȁȊԅрЁ̓ǿҴϯжʑ^ӅޥɠʜѕՓĕ͈ݏ֏Yۍμ̿ڦƧ֒͝ϮљӐÉʆϸТ¼˚˘Ũjɚռö͌ȀҖgƒƦdž„ت{ڨɲע̉ކĀVмЦɝ"]],"encodeOffsets":[[[24269,36562]],[[27243,42560]]]}},{"type":"Feature","id":"GRL","properties":{"name":"Greenland"},"geometry":{"type":"Polygon","coordinates":["@@ᬜԆ᱒›ੴ̴ᲈĄ䀦Ŀ㉊ڗ༅͕ộ™⭏ćшƫᲐĠᡚ́࿈ʴۦ̝इӧᒞ̺✘͚ᠼNjҾΫ⃝ױӃȕ᧑ơወ¡ছؕگկ€ध৚շಽ“൧ˇ༂ѽȢ܋࣍ýઞܡህÑঈ΁˟̑இŽ୥E੆֩\\Ϗပΐћɣଌȿ઼ԣ͈ڱກlj٫͖ਣӘ˼֭উѵᕖ•୆¯ᖯܵᗿڏឧ́ओIࢅ͓ୟࢱᅵכׅ“૧ȷ஽ȝܛԱ[כыտോڧͺٿϗ۝љࠍஅ½఍ۈဿLࠁҢ֕ࠐฝਲэոŗݮ୓ޢ̢ئ֗̒ࠪচొ̺ͨΘǬڀॡ̕қůݯţਏ˜Éְ͢҂ެ\\႔ɟ෿Քݩ˾࠷ş۫ȼम޴ԝ̺ڗ׈ৡࢼ੯͚XΚᖷӮᄻÖᖟ‘Ꮕ×ইˌวՈᕂ˄ၚ¬≹ɖ቉΄Ś͜ẊИᶎИ̪͘ᗗ̠ܺͰ᯲ז௢ĚΓϘጲɜᣚƂᣖRࣺʽᕺҨፘ̽୺áპ˙ፅҐŘή"],"encodeOffsets":[[-47886,84612]]}},{"type":"Feature","id":"GTM","properties":{"name":"Guatemala"},"geometry":{"type":"Polygon","coordinates":["@@ћƦԻfϩǖҍΌrʖĮȠšƾКۆ઄Ft˸Ƌ¾ġǺ̵Ț̹ˬϜDBӂ޸BަUOڗßॅʤ@˚ƱòŰʘŃϥ͍ЉɻÏljâǑǧɇȟ½¬ıƿġ˽Ƀ}ŭ"],"encodeOffsets":[[-92257,14065]]}},{"type":"Feature","id":"GUF","properties":{"name":"French Guiana"},"geometry":{"type":"Polygon","coordinates":["@@͉͑ГÑŗʀȉ–ʹɩνǦɈΪòϤƢή͛ӸáֺѪܠ˸ğؤȥࢸۿƔ·ӻޑʳأ"],"encodeOffsets":[[-53817,2565]]}},{"type":"Feature","id":"GUY","properties":{"name":"Guyana"},"geometry":{"type":"Polygon","coordinates":["@@ր̯Դյzџ̈́o҈Чͪ̇Ƈݱԛɕ°ȣƹџϊ؏ːAŎӃԢܳȱ‰ҫî˙ɡϟƥ˅—ġǑЭ¦ԫЀÓϴɋьƆܐɸ̐ȕϸ˿ŶŊτțȘѩ™ْ֩ɬɲiϲԬƊȾƾ˽̸ô̬ږӲ"],"encodeOffsets":[[-61192,8568]]}},{"type":"Feature","id":"HND","properties":{"name":"Honduras"},"geometry":{"type":"Polygon","coordinates":["@@ơˀʭòÐʹŗĞǣÒσij‹ŔʩƈǷǚʛìǨɈáǒÐNJЊɼϦ͎ĔȂƨʊ\\þ垦ϸùϲv˒ĢİĦˎ©ȪÉɘnǖòϨśƄkʲƿʐį̏Źɜɳ˽jśŕ̇ŋɃAȅŃǙœƛźĕ{ŇȩăRaǥ̉ɳƹıđĽʛǞǹɣǫPȟqlЭūQĿȓʽ“"],"encodeOffsets":[[-89412,13297]]}},{"type":"Feature","id":"HRV","properties":{"name":"Croatia"},"geometry":{"type":"Polygon","coordinates":["@@Ȳ͗ˊʇ͓̓ϝȆׇ[ܟƔϽmǻǧ̝ȖǫΑЪϽǼʹϮ̽͌ȃ͆Ηݔ͇ġƛ߃̶ӣ̢ޑʠ۹ؤǞØϥΞe˲եƄʱγʝˮn̆Šbג…Ƹƚ˸ƍͤgGɼ̈ĒĈͺڞɠˊĻؼέۜlj̼Ų"],"encodeOffsets":[[19282,47011]]}},{"type":"Feature","id":"HTI","properties":{"name":"Haiti"},"geometry":{"type":"Polygon","coordinates":["@@Ԣ™ܰƁôқÝ͑ȱƙɎʥiɫ֏ƜЅÍԡÔϽƿ҉ʾö˔ޜśيã̢ȈϧθP͎ՋžȌɶ"],"encodeOffsets":[[-74946,20394]]}},{"type":"Feature","id":"HUN","properties":{"name":"Hungary"},"geometry":{"type":"Polygon","coordinates":["@@˨ըǍǼӂDÜ΄ђɋ̲ğ۸ļäǚͮ~ЦžĜÃЂŀȠȢˠ¼࣒ʭǴĒҲɭÎɣԡǭЉ֫ԕ֭کǁԽš١ə̻űۛNJػήˉļǍ˴ƗV"],"encodeOffsets":[[16592,47977]]}},{"type":"Feature","id":"IDN","properties":{"name":"Indonesia"},"geometry":{"type":"MultiPolygon","coordinates":[["@@Λe૝ך޴ǒѴʭ̎ʭ»ɩ"],["@@ܙȁijĶø˸ΰԢࠨͬĐǓfʫշع"],["@@̢ɣԲèȼΥॿǛ׉őҍP̀ӚҤPɤ̖"],["@@ūұ౅ʅૣľE̬ښǪՂʥ֔Üݬ̮"],["@@ྔċȂΌ༘З̪կీƵਐӿय़͋ऍ͸ݻwࢍØ޻ưঅ͎؝ČΓŁ໕ΌƣΰޑØּߤ৶·ڴ͡ΒÛŘ̗"],["@@ѝֱćنƬ̠Ǭ˴ȒʗCЏ"],["@@̿˥ׅƸǏΰࡘ¢Ⱦˣ"],["@@̨ٝۿΌۯìӃÅׇˆȦҦਠ”ऎʕ"],["@@ɼയ࢈ԉ۰ࢼ८ԔݜBܘ̉خ̛ࣘLJbᩑbᩑݟې࡟ǜȷʇ੡}ΦۂՈɺɕࣲЕ۸࿃܆ۗêృަʛУ͑óȏ̮GκٛЮ̢ࣞ״gëɠ௵DͩԄݥƺΡдଈȰњ˜ഘ·Ƃ̹"],["@@ڭ࠭كlj߱ǐඓ¥ܽŧţٍݪݛҒϠ༪˸çϯλŪιӯ͙݉ߒ੿Ƶ˿ݲॻQտ҅ʙ̐͡Мی࠙͗ȻɶŊ͖؅ӲØࠌ֕ʭîও”றՓũίʚʌޜŽ߸ΛPʻֺΎվŤښф౎ǮΎ܎ذپʛ੖śॴ–ࠨ؎Ʀȉ"],["@@©ܽџĈŷԝΌѷɽĵ͹Ւʟ੺ǚڤ˨̨ÔҝӸóĀ΃"],["@@सާহį˫ֵšݿַ߱u࠷͕౻ŭ̚ॕϙͫԤ׳´лːৃ̟̩Оս¯ۗĬŹૺнɺЕܘŝ݀ĮުԂ֐Ɩָ֗ӅըǠ՜ÑӪъЖôߒɽۆǶњୠ͔̈̆क़ॲ@ܰƙӍݷآߓơϭ"],["@@छkۻ۰અۊέԚٍۄзؾٕ୴۪݅ʙܠ̳ڀݵՊѭܘمҺࢗऒóђզ‘ಢNjݔࠓٮ֫ҪΓߔࣙࡢ_ۺֹӠ۳٘ϥͳۉӖ̞̅sƜו̊ҵؠõФՏɁ਱‘ಟ"]],"encodeOffsets":[[[123613,-10485]],[[127423,-10383]],[[120730,-8289]],[[125854,-8288]],[[111231,-6940]],[[137959,-6363]],[[130304,-3542]],[[133603,-3168]],[[137363,-1179]],[[128247,1454]],[[131777,1160]],[[120705,1872]],[[108358,-5992]]]}},{"type":"Feature","id":"IND","properties":{"name":"India"},"geometry":{"type":"Polygon","coordinates":["@@ࣚটďۅͮїѕ׽ŒɾएࠜՑ୞חՑϟ͛޻ࠀͅߊЭરһସʼnӜёٮāৠȝ۪bĪͪŋՖÞβԠǮìڋlǙކ͉Ոƀ܀Çۈ|ÐԪ΁ˎڴŀވشॸ՘۶ȷ״ΞЀԹ˳Λ࣠űÜ͇̍Ʒèԫ׷Ʋછׅ~ӓҩ۵§ХϏۗځȒࢇȏ˹ĚΣгȥѵ೰ɵEƍ՝ҡѦʸӎϖ¶ϰ܆ӝƜީ]ߝŚóאБ¤ڕζ֭̓؆ѻԿ̻ȅ̩Ԭɣƛԑ̆كžەţֱ̫Zਛǩ´ك҃ӻ௃֡ळ঩كՋ࠷ջCϭлȹݳ̝Ͻ«ʥٙǪધ®ۡΣߙI෗ѣ¡ϣٙʰˣދʃ˱֯͵ʍߑ޸ϳ୴͑ࡒ̍Јѿ߰ȻੂơՀޅ଼Α࿀ʣ੾HৰǍ޾௣ԉףĶ઱৲И̤ʝͤড܊֖֔ᇜCǗܞҽюĩ٨ջϘऒࢢঊÙ࢞ࢢՄ࡞ࠄࡈ_״ܒӠڳд֪݂̇̕Ьβ౤ȱपŰߺ۸"],"encodeOffsets":[[79706,36346]]}},{"type":"Feature","id":"IRL","properties":{"name":"Ireland"},"geometry":{"type":"Polygon","coordinates":["@@ƒ׷ًݣ๯ӹ஑Ŷڼ࢚ѭࡢତڄٌϼǦ҇ǥ҉Բ\\ٌǥ"],"encodeOffsets":[[-6346,55161]]}},{"type":"Feature","id":"IRN","properties":{"name":"Iran"},"geometry":{"type":"Polygon","coordinates":["@@݈njװӔ֚{τƾװýघэڤğ।ݓظ‰òۻ΁਷ɱؑκŭΫҡˠڡàՓِƙæեݿݿжѵ͸ԓߦυx݉ДƋêϯ௉ѡ̓উཌྷʪࣷȖेŊΧਐЕƪ٣ƭࡑНਇ˦ࡑ٦߳ʈ֗ߘا૪ҍƋՕ˦̻͝ҭѴS҂ˍ@Ɛ،ѝٔ਍Ң׉ߜȜپц̂ÙӬտʨխ৊ҟڨǐʼʿ६ּʈƄͅъϯ־ő̤~রئ̀Øʞʙ́гԼѱȾ¦ˈإߖǩ׎у஠ƟಾɞĄȞ"],"encodeOffsets":[[55216,38092]]}},{"type":"Feature","id":"IRQ","properties":{"name":"Iraq"},"geometry":{"type":"Polygon","coordinates":["@@րʧÚӫх́țٽ׊ߛ਎ҡўٓƏ؋ˎ@TҁҮѳӿ¤֟ê؝߭༟äᛍၖఫךৡɪ͹৾ᇶ࢔͆৬āؘҢȺјԾΰž঎Ň̐ɉЖƚծ৉"],"encodeOffsets":[[46511,36842]]}},{"type":"Feature","id":"ISL","properties":{"name":"Iceland"},"geometry":{"type":"Polygon","coordinates":["@@șիॊֵથٙᝓֹܣƵૉŮᚑˈࠠψᆧЪ๪ǎ—ʘᄋȜ֨նౠŰಸ֭౨Ҝ੒ʃൌ҄ආÑ"],"encodeOffsets":[[-14856,68051]]}},{"type":"Feature","id":"ISR","properties":{"name":"Israel"},"geometry":{"type":"Polygon","coordinates":["@@ƥ˅̣Ŝǫ֓ɂĥɋř—ɛЄŖp͛нഉց෾ʔˢ˶ɞϼǠيŤɆzVˬCþƦɤ\\`·ŕŵhM"],"encodeOffsets":[[36578,33495]]}},{"type":"Feature","id":"ITA","properties":{"name":"Italy"},"geometry":{"type":"MultiPolygon","coordinates":[["@@̟ڋŲʹǭѝٝ̈́ёĞ୩ѐŞќজûࡪĠْò"],["@@Ԍ׭ş૕ϣÂ΁˫͇ɞ‘২ȓӒҨ¥рʼ"],["@@ரɏĝЯȬΧڝŪہ̗²зĻʇˠё߀чцۛदڱچLȲȃɽǗݪ̥ؠʩܜѫĔƿƽ̛үϼܳƐΝի؈̷ıѫΗ¹҅ܛΕÝHʲǢҊǼǶ͝ӤʱшΑŀʛδգƴεͶثÆٿϜޑմ֯ӜʿࠪйĮہˤϯŕӝϵΓÕĪθҕńɏٲ̆ʰʙ̀”ʂβǵМ¢Ҽ˶ƢƃА€ǼͺتĿψƚâΆԘšĮdžࠨƤȊ̉"]],"encodeOffsets":[[[15893,39149]],[[9432,42200]],[[12674,47890]]]}},{"type":"Feature","id":"JAM","properties":{"name":"Jamaica"},"geometry":{"type":"Polygon","coordinates":["@@֢÷ҀȫƔɯןeʭƗҹƊӑ̪ĶȔΜÎȒƒ"],"encodeOffsets":[[-79431,18935]]}},{"type":"Feature","id":"JOR","properties":{"name":"Jordan"},"geometry":{"type":"Polygon","coordinates":["@@Ʀˆपͫ࿪ࣆͺ৽Džų၅у࠸࠿ˣƛƑ˭ٙřȩ̡εʵधƆƒŨоഊo͜Ůʚ@Ԥ"],"encodeOffsets":[[36399,33172]]}},{"type":"Feature","id":"JPN","properties":{"name":"Japan"},"geometry":{"type":"MultiPolygon","coordinates":[["@@ņ˽ҿԕΉːљțɝӭշʈRЊҬԆӌīΊΜؠǹ"],["@@́ڡƤсѩף੹Ѓ๏½ணॡ͔֡“غษȃষЃঝe࡞أ֗෗իΝН͜ȶݶՏʒͿ־ߐʶѲՈࡌѢ؞ָာʤ࣎ǣࢠ๺֔Б௾ࡀӌ͜ՈਈƟा΢ՎࣀƸҞୗ}ڻޥࡍbࢁ"],["@@נǵרΤȈहఝɯ݁࠱೓ָқँण]ř࠴д٨࣌²ʖ୐ʜټন࢓٤˯"]],"encodeOffsets":[[[137870,34969]],[[144360,38034]],[[147365,45235]]]}},{"type":"Feature","id":"KAZ","properties":{"name":"Kazakhstan"},"geometry":{"type":"Polygon","coordinates":["@@ӕƹ્דο׹̹KɱЊ੫‚ǡێХNÚࡆ৓ؘ෷ßডũߣݶۋ͆ಥ׼ƽðᓗӹᶽљ£יچ֧ɼॕǩχ˧±ȲȶΖDž̊অ˺ϛݮҩɆ…˜ࠊāŽؘ܎ƎܼűƲࠎƭԲ࠿£܍ȴঃσ޵ǭяƌĐўՙ֘دw܉֬ӞِʕǢڢऊࡺӣŀؘჄࣴಾtᇢ׉঺ͻࢼΠ೰j੺ѥʔʠ୼—ɂЊഷ׀߮Цƿɮ߮ɔ؅ֺϬ˼Ḯ̈ШȺᑆ̴ݰΒຢǹ˄ࢉ࢚Ȳઆ˹éҝ߮´ᑌߎ̭ˁ੶٭ሠᒑ҄ѰୄӛீɎҪƯКӟטNjΨΥ઎ŒѾԣٕ֓ۥÿ¡ࡅұϝဟˢ؅ຑїȇဗͱݲลֻɓäӏԭŬу̠ఝĖඃx̧ġ஥ΞӉǧŽӹ൩̂փşȉρ"],"encodeOffsets":[[72666,43281]]}},{"type":"Feature","id":"KEN","properties":{"name":"Kenya"},"geometry":{"type":"Polygon","coordinates":["@@ӾۙיͱȹΕ̿Õšףˑ͹Ǐ֑ͷ˥஻ࡀËӤᵁႌƙĢSࢺʊ;а֌̨ؔσ॰įтЉ׎ԬԈ֬ֆѨƗ@ҽ˺ˡג@੠܋ˈSȠxȄī֖ßʞΔގΚͺ˳ָAܽ॑Xᵣ"],"encodeOffsets":[[41977,-878]]}},{"type":"Feature","id":"KGZ","properties":{"name":"Kyrgyzstan"},"geometry":{"type":"Polygon","coordinates":["@@ȊςքŠ൪́žӺӊǨ஦Ν̨Ģ඄wఞĕф̟Ԯūşȏ೛ғ̙ͭઁıͅ՛ࢷŒׇǏߣЇŜȟʇȓཟŵਡ˘࣫ÝĂӜࣴƕ̮ʸٖĉ੾؂঻ѸױȽإ͂۶ծʟĊ"],"encodeOffsets":[[72666,43281]]}},{"type":"Feature","id":"KHM","properties":{"name":"Cambodia"},"geometry":{"type":"Polygon","coordinates":["@@΁Ѭыࢄȣ২ՠۨઘdž߀ťۚ͡Ϟׄݖ̱Ȝ֕Ļ৕ඳ٧τԙࢥÓܫͷ۱Ū"],"encodeOffsets":[[105982,10888]]}},{"type":"Feature","id":"KOR","properties":{"name":"South Korea"},"geometry":{"type":"Polygon","coordinates":["@@ܨযȺխPॷ̓ҥݽljڥΏݳïĥҚƼـχ࢔ذƚֻܘÂúϒ‡͞Ϝצ¢ΨÈŨȮ"],"encodeOffsets":[[131431,39539]]}},{"type":"Feature","id":"CS-KM","properties":{"name":"Kosovo"},"geometry":{"type":"Polygon","coordinates":["@@›ǣŃPĘ́ȩĐdzɦƾȌȪÒŜ˨ư²Ţşƾ¿ŌƅƒŸǎƻŢLĥȳijij„×ȉӹŻ"],"encodeOffsets":[[21261,43062]]}},{"type":"Feature","id":"KWT","properties":{"name":"Kuwait"},"geometry":{"type":"Polygon","coordinates":["@@Ǭχõȓ˔هשuȽАݟĆ؞߮֠é"],"encodeOffsets":[[49126,30696]]}},{"type":"Feature","id":"LAO","properties":{"name":"Laos"},"geometry":{"type":"Polygon","coordinates":["@@˚Ϝœ܆ڹܸ¿ٕࠦھٍÎǛ̉ӯyʣƨࢯԅoݬȸࢮ֧ž³ԎηʸǴ̲ܐնøȡ҄wŵ०ѦŬӮڏϖޅਚO͚ܹ՝ɗʉ̟৔ԉۦ঳Ռ݋َ׏ɄץƵ࠿ݕ̲ϝ׃ۙ͢"],"encodeOffsets":[[107745,14616]]}},{"type":"Feature","id":"LBN","properties":{"name":"Lebanon"},"geometry":{"type":"Polygon","coordinates":["@@ɣ[ýƥ˫D̘ۄмעfˆϘ§Ɛͣқ̓ȷҟ"],"encodeOffsets":[[36681,34077]]}},{"type":"Feature","id":"LBR","properties":{"name":"Liberia"},"geometry":{"type":"Polygon","coordinates":["@@ɗQࡽАޅٖ܏Ң֣ըȪː¬ʔϜҘϺϺǶnɖĨΘԧÇ͵ǐdzʂIǢ͸ʄsŸʓĎНǽύʖɱˊÇΤΙ~ͧăĿÝە"],"encodeOffsets":[[-7897,4470]]}},{"type":"Feature","id":"LBY","properties":{"name":"Libya"},"geometry":{"type":"Polygon","coordinates":["@@ק̷ҿҤ೧βρՄڑϸϻƷ̗ҶήӹؔͬΘñՈńҠÓϦƨۈ¯϶˕ݐШȜðΠėΒ־͔ʶːЦʌ´٦দ́ΜðۮƓ૞ϓЀݛݮǍஆΙࣆйЦɔЖϮț٠˂Ф؄ЀׂŘ଒ǣ˺ϑ̺Iˌƛ࠴ıȲˣ̣ЕżΫɏԯʦڱ@Ჳ@ᶵ@့ॱGYΙ‧ྐ‧ྒࡓҟ"],"encodeOffsets":[[15208,23412]]}},{"type":"Feature","id":"LKA","properties":{"name":"Sri Lanka"},"geometry":{"type":"Polygon","coordinates":["@@ų࢓ΙʇܵȓЍڜƫீϠ഼׆ұϺסО࢓"],"encodeOffsets":[[83751,7704]]}},{"type":"Feature","id":"LSO","properties":{"name":"Lesotho"},"geometry":{"type":"Polygon","coordinates":["@@̆ʩʳУƛ˛ҳſƹˍ̛ċؿ٨҄ՐҖ͢ϼǠξʵ"],"encodeOffsets":[[29674,-29650]]}},{"type":"Feature","id":"LTU","properties":{"name":"Lithuania"},"geometry":{"type":"Polygon","coordinates":["@@ãɊĚɲχƄࢡƨDZ۸२ʴඬÁࠜĊŞǩ҂Ã߲СĀϓۏˏșӃ࣯̓߻NȫʶљĜ"],"encodeOffsets":[[23277,55632]]}},{"type":"Feature","id":"LUX","properties":{"name":"Luxembourg"},"geometry":{"type":"Polygon","coordinates":["@@ǘȏ³ρʍiȉòĞҼɖŽ"],"encodeOffsets":[[6189,51332]]}},{"type":"Feature","id":"LVA","properties":{"name":"Latvia"},"geometry":{"type":"Polygon","coordinates":["@@†نЮՆߊ˼ڜعڪhNJ٤ܐƪςĻܢ̷ۚCКȕîС˒ӷ͕ࣗԛƙ߱ТҁÄŝǪࠛĉණÂ१ʳ"],"encodeOffsets":[[21562,57376]]}},{"type":"Feature","id":"MAR","properties":{"name":"Morocco"},"geometry":{"type":"Polygon","coordinates":["@@ԒΥߜÎࢊȃκU͂՟ºԝ̄ࢱɜDZƷ͛ષƙϝ̵ӡñ—ثঙ͍ͩсۍɥ࠻ŷഫاRহŷ@@@p҉Ա˓ȑϡ@̥Ŋ۹ě˛ٻʿÕЁ੕ୟ࣡ˣୋ΅ϗĵ̡ቅãaD ϶͒ɮ˞ѪÃ˶̀פҴՖ˲ƊɞӬp҂̤Բ̪֔Ւ࡬f\\ц͔ްĢڎָтɠۮۮȿਸ਼͊ܢŔѶդ֨ࡈϦخΐ֘࢈˄ԪؤI"],"encodeOffsets":[[-5318,36614]]}},{"type":"Feature","id":"MDA","properties":{"name":"Moldova"},"geometry":{"type":"Polygon","coordinates":["@@ȨŮ֒ĊؤʽΊϞɥÑ˵̪ƏŨΗ̊ɇÏűƾčɝ×ӷ|ĉŜǫãÒƭɱˍƥ˽ɁĝƯϦĘΪςӝԂˉΠʹʠʯĈ"],"encodeOffsets":[[27259,49379]]}},{"type":"Feature","id":"MDG","properties":{"name":"Madagascar"},"geometry":{"type":"Polygon","coordinates":["@@ɠΥȺ։Ɗঢ়ɒϽĉЗƩʙ˷ӰǁʝLjثõΥɵȗ¿܅ͧওб୅ԯཧ͑ୟϛইہȣܻΡӛɊڙ̜ɳѺÇݘ̑ڠù؂Ʈ؄ϰƢD˪Дِø՚șЈǃՌãޠ̊ҺŔՒмŒҶǤ̶Ʋτ\\ӐӎۖԮʦцŗάΦĵҪ׎fԐ˦ϔ̊ί"],"encodeOffsets":[[50733,-12769]]}},{"type":"Feature","id":"MEX","properties":{"name":"Mexico"},"geometry":{"type":"Polygon","coordinates":["@@͙݅ƥ؁Õ૷ąЧƤқʺЧǚٳ֎سȞӏ͢бࢾɝΐΙ݄ɾٚĎؼưՊƠՖ΂ȨӬè۸Ƣʖ֬ɚࢶȚݔ‡ԚîȬDZ…ЙҋԁȥԝƸƥűγɁٽɅɎǭcǃY̝ԓƳIJķPŭޥV޷AAӁϛC̺˫̶șĢǹƌ½s˷ઃEЙۅŢƽĭȟqʕ्ࣞџ˘ۇɖҷÓګ́чĉץɜؿDŽ޹ϬؿŠ्ϸ۱ВɃɤҹº࡯ˈΓϦࣗӊсՌȧЦ˪ĈđʈȖɔJ̄˱Ϙùͮ˭ъ݋࠴ࡋڀУԼܝ΄ƷȴŸԲѓȞӹФȽהҍæӣѸϿФ™ˀҍو̓٠^͔؇ͬ˫™ӑɴƇͿƔЕĆف̀΋خׁƒȡŸÓŎ˽Ƭ\\ǜթʮɇǴ̕Նё˨ޯʠρɸϿ²ѷКƒͶϡ̨ϑqƭΝ̱ƫJɛԞջӎ؃РїɈ„ؚŵҖЏʺֿϒŏŇɃɖԭȰӷӦÖÚΊ³̸̼ŽϜ٩׶ӱɶ̱Հ̷վϳڦͿݲॖÞ੪ĞÿǑ౔СኀףဪPژ@DΌผ@̪̕јˇԀσ˨ѭȾҥѢʩۤʥՊڒۊhפͱфֹ̄ӯӸӏȂחɾЃپʹ׮ȁ͞|"],"encodeOffsets":[[-99471,26491]]}},{"type":"Feature","id":"MKD","properties":{"name":"Macedonia"},"geometry":{"type":"Polygon","coordinates":["@@ńOœǤӺżȊ˺¶ϴbтˏÒ։DžƒƑƥҕh͋ǿջõΑȴšήń˸"],"encodeOffsets":[[21085,42860]]}},{"type":"Feature","id":"MLI","properties":{"name":"Mali"},"geometry":{"type":"Polygon","coordinates":["@@˰ƶƘӶˊpזɻӄǖ͖ÇŴȈ⁚^ȈךƣļЛ⋈Л⋆౾dᬼᆳᬼᆳȨϿԺʉ϶ƋV՗ठĈFካҟ֗íԭݛƃ଩ï̳̗ա՟IȿLjҥš޻ΑDžʿٳϕŗɍΙǡНŔɱȳūֻڙۡp˳ɭΣÆӥ΋ůȝŁŽάʍĥơhƷʕ٭PɷŴʼnùʱʎ¬ʢĿİdzĉ˚Ǥɐ΅ΚijɴȇȂǙvȫş˕őɱǹΫäɷɈƓ„ɕőƅAµ̮žʾí̽͘ʀǓӔԺ"],"encodeOffsets":[[-12462,14968]]}},{"type":"Feature","id":"MMR","properties":{"name":"Myanmar"},"geometry":{"type":"Polygon","coordinates":["@@ӫηץ›ϥࣥΟƳО݅ՔؗΈօ̭ܵ̃ƹȪу֖ڙĪҷ_ϵ͠ދң޵Сࡷăذʴ٠˯ӼæࣸͽѤ˛৔Ʊਗ਼εۢօуॕ׳ҽöԳȠ̂ਪǫ޾څॺļ̢ӭņ׭ۆÅڰ̊ŵj׾дȦęΤȐ˺Ž࢈ڂȑϐۘ¨ЦҪ۶}Ӕજ׆׸ƱçԬ̎ƸÛ͈ӮÚˮӵξȧ|ٟ“ۙߓۭijঽࢲƔȨޛՐǍʓۣز́ζƷ؞ʔ~΍܏յdẕӓȗ"],"encodeOffsets":[[101933,20672]]}},{"type":"Feature","id":"MNE","properties":{"name":"Montenegro"},"geometry":{"type":"Polygon","coordinates":["@@ÁǀηЯÊˋǫÞɽ˞εǖĢƜŬҦ˚ȜƾüɠƟŬśˠě͌ǧçïƽȋɧó"],"encodeOffsets":[[20277,43521]]}},{"type":"Feature","id":"MNG","properties":{"name":"Mongolia"},"geometry":{"type":"Polygon","coordinates":["@@ࢮƢ྄ܤ౬Єܴʳ࢚]֘Ͻ࠼‰ௐɁࠈגͿӶࢊࢊश΍ނįনɍLjؿஜΛߐƺਫ਼ŌࡆōࠖЗԚѕެT੒Ƌޜȼૈƒ௸פԌĝѰ˭ৌêХهק࠽ɐ΅ӈńࠤŽ٦̴ڬˏހוğ̗ڏĦ௟ŏןʅ؝։౱͙࠷ѽࡹǞҿúѳէˎ͓ƌˣי˯׽҇গ̑ఽ‹ഫ̇এҋϋʾ৭AఓԜࠥŰૣśჃȊऑmӱԀϣޠԱĢ৩ԼଅŞুƞ̡θ͖চׅڲன̀۷Ѿəז"],"encodeOffsets":[[89858,50481]]}},{"type":"Feature","id":"MOZ","properties":{"name":"Mozambique"},"geometry":{"type":"Polygon","coordinates":["@@لæ৞ʁɖńגt̚ʦԌaऀ͜ڞӤƊϕ“࠷ľ݅ಿƨЫʣ׷͙׍՗Եޏ͉ृСॉ͓ࣕƵוׯ΋ȗí׳ЌُǔӱZʣƪ¦{ࠗƋϷȤƝűΓΗ̗ۗ˳য়ҕρ̳ðΟɊÉíѵّRïϊůϖí̠ƬपɓװГஂࢬ॔ɜ؆ŶúĨӶƉʞ˜غǐ׌E੠ѥ˒ЏÔǹȼϳǰ۫gÅ̼āװᢈۘӚЕɴüͨɅ¸͵ǯϷØסոԱʲ׌ζǰíઊΙ؈̣˖̅]ɽદɾٔ"],"encodeOffsets":[[35390,-11796]]}},{"type":"Feature","id":"MRT","properties":{"name":"Mauritania"},"geometry":{"type":"Polygon","coordinates":["@@և־ԗؤ֍ɞГʚҵUЧǽйð˽ˏïҐɺаŀߊģࠨĵкČмɑЎѵδǾˬᾔMǃ௎ȴќ߀øᒸ᪂©F౞Ṗ᎟౽cМ⋅М⋇ƤĻȇי⁙]ųȇ͕ÈӃǕוɼˉoƗӵ˯Ƶ"],"encodeOffsets":[[-12462,14968]]}},{"type":"Feature","id":"MWI","properties":{"name":"Malawi"},"geometry":{"type":"Polygon","coordinates":["@@ɽٓɾથ̆^̤˕Κ؇îઉεǯʱ׋շԲ×עǰϸ·ͶͧɆɳûәЖѵɔʮޮ˄̈LJۢǚڼƞɪɉ܌Ѕϐ࠘ƽǜɵ˶Ϲɾଡ"],"encodeOffsets":[[35390,-11796]]}},{"type":"Feature","id":"MYS","properties":{"name":"Malaysia"},"geometry":{"type":"MultiPolygon","coordinates":[["@@àћֈĶ˞ΈȘýӸԓΜ֛¶֣ęϡĆ˿Öӻ̒ɵͤݑe˳׫Éߑخ঵ښįђӟ֚ś̡۠ҜĠؔȃΤƤƮۈρ"],["@@أ˹ܯƚॱ@̅ॗ͓̇љୟۅǵߑɾЕóөщ՛Òէǟַӆƕ֘؜˽ٮǀǜ܆άǂ৖Ǻ׾ڔЬՐϦѥǮ˺В¸՜œа٪אшڀͼHќыžιֆɻ۬ʧÑ֝͡¥ƮЧ"]],"encodeOffsets":[[[103502,6354]],[[121466,4586]]]}},{"type":"Feature","id":"NAM","properties":{"name":"Namibia"},"geometry":{"type":"Polygon","coordinates":["@@رٌؖ͡ȃࠊȷ،˯ಒm৒ŅҞ͛Όѡۜѳ৘ǽՆۃࠐ»٢КdžԊƞհ}ԄϝŶÐ₮˜׌Е᎞ş໴΂یȒհµͨȍPéӁȍʭC՛͍ͣΎಕ̍سƒ{Ჽࠣ‡BយA᷋ݣѕҋÕՇDŽϗÔƗάͩɰГг"],"encodeOffsets":[[16738,-29262]]}},{"type":"Feature","id":"NCL","properties":{"name":"New Caledonia"},"geometry":{"type":"Polygon","coordinates":["@@ېԵѨϭ͉ȫҥɪ׹ϚէѼ։פś˶β[Һ˹φ˷ˎɻ"],"encodeOffsets":[[169759,-21585]]}},{"type":"Feature","id":"NER","properties":{"name":"Niger"},"geometry":{"type":"Polygon","coordinates":["@@nּॹȐОҿպœϤâТբ̴̘ପðݜƄîԮҠ֘Eኬஈϒᝪ࿸᮪ཾ೨αӀңר̸ȸಯ̾ɓ`ˋΔ˽ǻί͕ၻ«ધੳߋγૉΔ̵CեբmčЃʁµˋƻm֩ंȟ’ځҷٱʔҍ¸ʏşӯ~ӷΧѓq৯ѢЉȵѓb̿͆ࡅ̼ࣗıɕǻşӗʋ͹ÍݣٗӚ̟E˭ʗ"],"encodeOffsets":[[2207,12227]]}},{"type":"Feature","id":"NGA","properties":{"name":"Nigeria"},"geometry":{"type":"Polygon","coordinates":["@@ࢍ̡͉¬͓ȉڥl҇Ղˡ؊שֆكYݍB¶തs՘ǂՊʶʴТԴėɨǔ͸ȍӾ˪ÎݤʌͺŠӘɖǼࣘIJࡆ̻̀ͅєaЊȶৰѡєrӸΨӰ}ʐŠҎ·ٲʓڂҸȠ‘֪ँƼnͬͯğƱ«˧۽ٱɛՙšѧDZȉǝי҅ΉŽыȋ͹ÿΓֽ˱ҽΊ͇aԃӭʑQЍ߷ɍש"],"encodeOffsets":[[8705,4887]]}},{"type":"Feature","id":"NIC","properties":{"name":"Nicaragua"},"geometry":{"type":"Polygon","coordinates":["@@̃ˆϽͺȁ˲Ο˄сϜĤžƒŵÚÒʾ”ŀȔŬRkЮȠrǬOǺɤʜǝĒľƺIJ̊ɴbǦĄQňȪĖ|ƜŹǚ›ȆńɄB̈ŌŜŖ˾iïă§ȉĐ̫ȗ˹ěͷυ®ɏtϙŹĉýΫÌɛǣɋ ɩźƏȩDZʛÈƓǦˉêȕʼnօɞųŇ"],"encodeOffsets":[[-87769,11355]]}},{"type":"Feature","id":"NLD","properties":{"name":"Netherlands"},"geometry":{"type":"Polygon","coordinates":["@@ۦyǀ˳Ƚޓɇ́ԍ@ƘࢡҥȞՏπީǩ؛âѠɲ݀ఆଲΘ"],"encodeOffsets":[[6220,54795]]}},{"type":"Feature","id":"NOR","properties":{"name":"Norway"},"geometry":{"type":"MultiPolygon","coordinates":[["@@᥆ؙઍɣऄՅෛ͵ڵû΢לઃͰಫ˵Ы؝ߟωࣗȮ઱¥णѼԉɝԷ“ūփནƊɝҵ߭Hևױ࠿झಫ஁̨˹̇ͫ࠯bձ޿¾૟՞э˥ধֻۧυӛ֝Ԫဋঁ૫ȟ୏є̛ࣚˇ኶ޞզᕠ۶ဌࢂ໤୦፺ྴඦلᘼ੊ᇎπ൪­౮ۢ໖›ພǘ"],["@@ም΅๝Ȝ׆ɐԕˎეǚͮ̿ொȍ"],["@@᪖صᑟͥұأ݅ǁЍۡৣᅵԢނ̘ఽʐ࿕܂ٷڄᘎ̜Ң̋஦\\͊˼௾ˆ੖̋"],["@@࿮̏ఝҍ᝱ı៙ƖƫɴஹdँϬᣴɼ௞ȫࡘʤᑺȽ"]],"encodeOffsets":[[[28842,72894]],[[25318,79723]],[[18690,81615]],[[26059,82338]]]}},{"type":"Feature","id":"NPL","properties":{"name":"Nepal"},"geometry":{"type":"Polygon","coordinates":["@@ÝαŌՕĩͩ۩aয়Ȟ٭ĂӛђଷŊયҼ߉Ю߿͆͜޼ՒϠΒȪڪʳࡔշҾť˰ЕٶǓۀσौȕঔć"],"encodeOffsets":[[90236,28546]]}},{"type":"Feature","id":"NZL","properties":{"name":"New Zealand"},"geometry":{"type":"MultiPolygon","coordinates":[["@@Ȓ΋װ;ʐΡBΝ̹ϳչإїͷ̴З٭Yܗ̓ɣջӋࡗڇϓнʇޝlխˢࣱÐƗ̰Ҍذ੐ࠦժǀ׾͌ܜѰԎѦώظ͈ɆŰҶלϴȆΧ"],["@@،ࢫlָϜɯŲًڰ˛֨ãӒ͎юĭȯݗʯӫٛjɡʭþαūƻͅҏзֹ٭ͯƟɘΕŨӞ۔˟ҨࣛͲz̦؈̌ƚ٨Ÿլͻ֜vƪБΎڋݔΗת̸àҚұٺɑʂݡ"]],"encodeOffsets":[[[177173,-41901]],[[178803,-37024]]]}},{"type":"Feature","id":"OMN","properties":{"name":"Oman"},"geometry":{"type":"MultiPolygon","coordinates":[["@@ֹ̻ϟªǩȧƉэļ֗ÿĻϯFԽ̻ćХȓǯԹP͡ɃJͻПɷҩĂ֗˳ϱ³˝טٿ൴ᠾ࠾֖၂ϩתv͸ʔΐFΆϞǒƩŞèմіHϖֵҸ̧؞ŋӼƳϜӕɨ˧̞ŃCȉ̩ԃƅɽΟˏ"],["@@ʼnƳDž˺ʔ˺ľñā΍"]],"encodeOffsets":[[[60274,21621]],[[57745,26518]]]}},{"type":"Feature","id":"PAK","properties":{"name":"Pakistan"},"geometry":{"type":"Polygon","coordinates":["@@تϻʞ٥൨ͻ߹۷ऩůౣȲЫα̖݁̈֩ڴгܑӟ`׳ࠃࡇՃ࡝࢝ࢡউÚऑࢡռϗĪ٧ҾэǘܝᇛD֓֕؛Ɇʣ؀٭٘໻ǁിeஃŝ̈́ঊொѢéϰГƌw݊ߥφͷԔеѶඨѕࡀŲԈŅǞȂגóદĈ܎ҶӈشCĠɼٞŌ̴ý͢ʀ±ԌΦԖ՘Ɇͥ֊ߜɴ̢•͒мΜĩмȣΤӬμࣘǮ८ĮѐƺӨĦ"],"encodeOffsets":[[76962,38025]]}},{"type":"Feature","id":"PAN","properties":{"name":"Panama"},"geometry":{"type":"Polygon","coordinates":["@@˫ʎǵҒȺɢɅÎƿˤлɸοÁǝ̇ͻɁǽ‡ĉǩВҗɯŅŧŭϷ©ơԈŋƛˡ¸ǝ͸·ÈɓİέCǻĩŶªǖìǠƲŲIJǩŲK͸͘ö̠̝iDZͲ›ĀæɴȵЮÔΨɄԜǞ˺ʤҬ·‹ĉҶ…ώơ˜ʧ̈́ɵĹūȜӵǁʟ˓ÒŅС"],"encodeOffsets":[[-79750,7398]]}},{"type":"Feature","id":"PER","properties":{"name":"Peru"},"geometry":{"type":"Polygon","coordinates":["@@ɥљћɋࡅӘñΈရࡊທࣾ٫԰ΏۜƐʎ܅ાࠣ༄ߍီ΅Ϥ˃ؤٷպױͼ˖ϒПߢʼךڢՎIJΓʇȧx̭ΎâͼĝΚщӆΌDŽ֤ԦܶৠͨࣸࢠʾմŝٔɢĂ֒ЉˎЅϴɏӶࢣضĿҨɞ̤ƣԎð٠Ͻթࡣʤoрҁݳ œųۍlj॥ֱÓϻɉ̇ČғԕʍBΡɛƵΔݳҲԝDZί֐µ͆҃ݐuېӸÇ౧ϢĩӄƠܪടǷ˵£ןg܍͟пƮ̵ȕ˯β۹Ջ࣡"],"encodeOffsets":[[-71260,-18001]]}},{"type":"Feature","id":"PHL","properties":{"name":"Philippines"},"geometry":{"type":"MultiPolygon","coordinates":[["@@Đ֏ºҽ˹ޑ̫ࡨϽэˎإʉϿ঩Ӧɿ؊ʰЎՑЈˁΑЃثҵƑʖ͢۾ՌʀҜ̈́̔ϝٔɰƎϒרv·ٰڼЋêхÐ̱"],["@@̟ˡˁՍ˃ʝԫ׈ǦɤɂɾĢԸҨ¸Ɖ֣جߺāߡ"],["@@ૣߕЬט؈԰Ԏ׊Ѱ࠲Ʈۅևҧѳֿ"],["@@Ԏʹ՘BgΗϳΣՕʧ‡ϸÒєŽА"],["@@ʀभ٫ɞj˭ȶԯЍȋ•עʧªƁԘӶãY͈ԣٜ߮mɴ̻"],["@@ɟܩέоѓ٘ܚ‰̡̈"],["@@ԮʉʶɖüɇƍΑ˼׻ɛۥӷ˥ƁڳȊڝѾġϊIJਾүăҙ˜ȫēϯٻЮ̵Ѵɍ̯՗ԊރůлȆ¨ΎˀɊʣȘŇ̡бӚűμߨͺˡĔೄ˜ހԘA"]],"encodeOffsets":[[[129410,8617]],[[126959,10526]],[[121349,9540]],[[124809,12178]],[[128515,12455]],[[124445,13384]],[[124234,18949]]]}},{"type":"Feature","id":"PNG","properties":{"name":"Papua New Guinea"},"geometry":{"type":"MultiPolygon","coordinates":[["@@ɽčε͔ρՔǷ٘ŜĆĜʡʬȏРՑЈ˵ŝɽ"],["@@ѯçƃɽҟȱћȟѽBۏʔӑɺêʺݬũҠàŶЖŦrĆѽӐÜʂ˼Ҹ̚ġӸԌfǜƏgү˯ԡ"],["@@ݤտղࢻӖ„‘ω٬ƛʥǁࣀΝġʏ֋ÏȷɔܟĦࡕŴٷ՚ӉҦѧ݀ભπ܇ʇԡˣńإڇ˿һƖࢅ–aᩒaᩒภ׃༊ӓׄїҴхŸӵඔԱȲѽޛěȄ֕"],["@@ʿɡǁӸȝ͘ϝ˞ӍΪ؇ʚɺȮҒɻ˸ȁΜȫʹΛ͊ˏĶѧ"]],"encodeOffsets":[[[159622,-6983]],[[155631,-5609]],[[150725,-7565]],[[156816,-4607]]]}},{"type":"Feature","id":"POL","properties":{"name":"Poland"},"geometry":{"type":"Polygon","coordinates":["@@·՜à̂ȹ̧҆̚ɺɤȝђָʘ಼ϴ੒˴࠼ƙÚȱ߸Yਚħ໶^њěȬʵšωɸ͋KͯԋǡʸϳfϏцܻěɽзįރۥɒϗǿ¶ߙ͔؁šЇĒӹǵч̖Ήŕ³¼ϭаر¼ăˀֻĦűɑҗǨÀɴػòЉ˔"],"encodeOffsets":[[15378,52334]]}},{"type":"Feature","id":"PRI","properties":{"name":"Puerto Rico"},"geometry":{"type":"Polygon","coordinates":["@@јõưǕɋɃمLӫ‡·άŢŬیK"],"encodeOffsets":[[-67873,18960]]}},{"type":"Feature","id":"PRK","properties":{"name":"North Korea"},"geometry":{"type":"Polygon","coordinates":["@@Şƥ͉ºη˵ʣ˷Ž׽ѣȅƫƧ̓ʝ֓ƏηɥηįġͰƋӈσŧȭΧÇץ¡͝ϛϑˆÁùСdžĵƿʙé‡ǀɑüɥƆɰφȤİõƶɆҒÅƎөĠЇɤۄբऒҌ־׮Ўˁܪ‹ſѺಚβͰҼժӹ"],"encodeOffsets":[[133776,43413]]}},{"type":"Feature","id":"PRT","properties":{"name":"Portugal"},"geometry":{"type":"Polygon","coordinates":["@@̦Ɉ΄ŬɂЫӺDƞłӪ‡ɼуϱɩYٽƍū‘Їγçʹԋɵտ̄ʡřɫ̵̿ê˥ͷɓѷŠџġŸڂÿԬϓþȩ͈äռͰ̨ÒͼǪԎkΤǙ̠™˲"],"encodeOffsets":[[-9251,42886]]}},{"type":"Feature","id":"PRY","properties":{"name":"Paraguay"},"geometry":{"type":"Polygon","coordinates":["@@ͦ৖tҌЖ݌าʔޮ]޴їbʵʞҳÇଛࢲLJ΄ǐ֦ɩǀʣþޓİ͓̼›̀ƌ̢ƳAҥŕӻǑӛƍݏށ١ړƇऻŸࡑɮࠢ౨ťψࡽ͢ਅبۉŸ໵ൌ"],"encodeOffsets":[[-64189,-22783]]}},{"type":"Feature","id":"QAT","properties":{"name":"Qatar"},"geometry":{"type":"Polygon","coordinates":["@@ÇؔɨѲɰĜʬˁdӯǽӳɵÑʫǖ"],"encodeOffsets":[[52030,25349]]}},{"type":"Feature","id":"ROU","properties":{"name":"Romania"},"geometry":{"type":"Polygon","coordinates":["@@δǶԴġՠGϸȳ˺źبĄɄȠΠ@ʰćʺʟˊΟӞԁ€ρėΩưϥϒƹЂƊϠƟpɏПǹʯĀɻ৥ӳĖ̪ؑফțзɋ௽¬٥ƀ͙ÕʍΊƵƦȚƘȷŀ˃ȋөʔßΌԟȢĥˌҕͤڪǂԖ֮Њ֬ԢǮ"],"encodeOffsets":[[23256,49032]]}},{"type":"Feature","id":"RUS","properties":{"name":"Russia"},"geometry":{"type":"MultiPolygon","coordinates":[["@@ࡌ๫కˤԫ்ࠌࡳyוُԒսٱƻ۸Ĥࠊħ࣢Țٌš૴ӯࠜôରަϮͭϴϐŠɔ։̆ߵuࠟΎࡑ"],["@@໵]ਙĨȒτ୊˚ࢢƧψƃęɱäɉ"],["@@֦Ƚțؐᗸű࿨޻࠭λ൛ēsࠑͳǩ޽~ٗ̊ૣʖȉθ࡟Ǝॗʼnҗ̎Ǽ̸৓ȥϚЃӉΣ@„Ꮪٛᔺ࠳ïԷ"],["@@ः©ƭˌੲΖ@ַ"],["@@ળ»@ָň–܈E௒ʉïŗࡽȩ"],["@@ౡMႣĤƧ¬ߘͪੀþஞ͏ĸə"],["@@ॿͩഉø༛ͨȪ˖༨ųᑔɗ"],["@@ډرᶽzඃȣမղҎ׀૎ǂᕞ™ᴬѽ"],["@@ӹóᩣŊɟώູɦūҒ࡮Ƕ…Ҟသܒޙĺ፨݆ɩϢሤѺ᪪բ᫠ǀ෴̸࿐Ŋאͩ֟ʻᲗз᢭Џᤙߝఫࠍ೉߱Ǡۥྎۏ"],["@@ɨгސȲឤYቈЧڬ̿ȽѧङʝᕅүفʟਬşఖɃݴDŽєաτɔഊƂ᧪ƑȴϽ↲ů´ٜᄼƥഄLബѷϮ՝ӹΙੌڋ೔Ϳ߸ࢦഖϙ෢ɦྼʵؤʀൖş؅ޮૐζ䢀ձܐӿᔲٛ₎DŽာƑ۪΍Ĺؙਜʇ૴Ǥ๰vཚǑཪĢะݛਪˎڷ՞ϐώᧆɻფºᝂБ୲ν@”MKઇσઝÖݶҁԄەϲɧĮΏɑɝ༧Ǿ᚝مݛĭ౽ן௛ԧ̱ϣய׊ᔗڇϣ̸ߵΫ૱Ř˓ց৙߽Šͻड़ȋő௣ޭ‹Ϋ۱Δα฽ѕ̅ॡభȳʥ࡟ே޳ׂ̳έ௬ҵለИ୘܀ԆªϾರȊຊ੒คࡺຢڢڮஆ৷ëԍۗᒉइۍਖᓧ˷ᑃටۚԧሙɕಝēÔ؊ಯŶ਩ЭᢵƠ᪏ʟᨩ࿛ủጝ೚ŁаՃࠄȅ՞оईÃௌऍ†܍ځ࠽ë্ϛഉ్௓˯ׇଙ঑ଇॻթӹ૩ӱՉYՇФૻؙſ˩ŝƦKѐіxŦ঴ɛܚܞ̒৶Ʃ֢ࠈ˾ऄ͚̮Ѵݲ൷ʛܯͧ౧Dͻ߄হװหˎ̵ࠖ̉Ԫ̿βԯࡐ̲݇షʢ૛uਯƱۛлҤȥXҩұˑݷࢻRσஅՍ৙̈́োéѯˮԋĞ௷ףેƑޛȻੑƌޫSԙіࠕИࡅŎ੝ŋߏƹ஛ΜLJـধɎށİवΎࢉࢉ΀ӵࠇב௏ɂ࠻Š֗Ͼ࢙^ܳʴ౫Ѓྃܣࢭơ͡çѽԤઍőΧΦחnjЙӠҩưிɍୃӜ҃ѯሟᒒੵٮ̮˂ᑋߍ߭³êҞઅ˺࢙ȱ˃ࢊມǺݯΑᑅ̳Чȹḭ̇ϫ˻؆ֹ߭ɓǀɭ߭ХസֿɁЉ୻˜ʓʟ੹Ѧ೯iࢻΟহͼᇡ׊ಽsჃࣳĿؗࡹӤڡउʖǡӝُ܊֫ذx՚֗ďѝѐƋϥӽ߿Ƒ࠳ࢁކߕĉ֣ࣼফԇ͹ƝɇωÌֿԚɿ†ՅȚʳΈ޵ǮԙƁƥƼଥЖఅƌ܃ƞĹıੱ܂य़̈́ܩӴؒƈۤ۰ҹͪఌ΄uȀݯƉ‚ώѠɼ߼ÖƄ˪ȅҪ΀ѰWʚఉ˚ӭUԯЀ١ƃ੩̐lǒ̗θڟ¤éʼɀǞ՝ӈࢋąʭ¦Ƀȑ̽”ȷ՞ȟ˨NJĀڴ‡͞Ȁʍɢ֥ƪ¼Ʋ΁ƴՃվǸɨĉЂࠑȨѱijšȼࢭɂˑӸíТЙȖάˊʝ޶װӞųƤक़ҬࢡЎᅢ੶ޮӠ͂єగּΆնݳش֢ܜ঍ग़ޢي౿֔ŬךڶüොͶࢀ̈൦ԕᘨȧṺो٤ЋÆ֓टѳ൏ɡ⏷ٔ؟Ńൌ؛ÂϵÆ࡫ઌʯڂɓňРԑΰ՘͈᎖Թ۾Ȳ֣؜ዦࠖޢµ޸̋Ӫ׀۫ԄЪԊءԶᚠˑӔҹ੡ĻNҳڌ˽ಜǼȶ՚ჶАᰪܞي£ࠣԙਬĕ׼˼༾xఢΐफ़ԏॖ֌ࢡӢѪˤ២ʫ୒ʿᴾॣ֚ѰࡡѺ{ǴৣĈˢЌ҅ټ}ː༄ݾրކزǒᕮɛǬұߕڽԺˋ˒חȏଵऒԧέ֕࿫஝०ŭ̢ͮऎɎɞжܮЎөӌϼֈࣿêȫҲڢࡈણۆຒ֦șװмnѴүͧ߷࣐Ƶϥ؄ඤͦლ¬༈ӏݛ۪ċࣆศǞ፾™ᆘŌہѮংւॲx࿎иᕠŐ˪ɲᕂþیȋሴҀ໲aɶδߤΨጤΈ෸˗ଥȷበŹ"],["@@ⵙ͕ໞીےĦقÃᒈӋʟͿ"],["@@૽ōݱÛśƏঙƑ࣫ȦӐʾል~࿞ƶ౨XǢɧӘȬߊƐఞǿ͗ŷ"],["@@ᆳĿᚉʎඅ͎٣׾଩ǔᔆָᆎȎ࿌чኬ߻ȹݯ"]],"encodeOffsets":[[[147096,51966]],[[23277,55632]],[[-179214,68183]],[[184320,72533]],[[-182982,72595]],[[147051,74970]],[[154350,76887]],[[148569,77377]],[[58917,72418]],[[109538,78822]],[[107598,80187]],[[52364,82481]],[[102339,80775]]]}},{"type":"Feature","id":"RWA","properties":{"name":"Rwanda"},"geometry":{"type":"Polygon","coordinates":["@@ͬӃµӵʏŁѿÆʱӍԛàþҠŘތԄʎɺȰďԈʸ"],"encodeOffsets":[[31150,-1161]]}},{"type":"Feature","id":"ESH","properties":{"name":"Western Sahara"},"geometry":{"type":"Polygon","coordinates":["@@oҊŸ@@ÉeNjEౝ᪁ª‚ᒷ޿÷ȳћDŽ்ᾓNǽ˫˜΢bCቆäĶ̢ΆϘˤୌୠ࣢Ђ੖ˀÖ˜ټۺĜ̦ʼnϢ@˔ȒԲ‚"],"encodeOffsets":[[-9005,27772]]}},{"type":"Feature","id":"SAU","properties":{"name":"Saudi Arabia"},"geometry":{"type":"Polygon","coordinates":["@@ʼnΪʩʨÝͲѡ̞҃۴ʁۆׇ׀ϑƐ֋ߠīא–ӾӕञϿ͠ґǨˡӖ°ȎɹѦʕȊ͝زԟڴѓ־лIžҦœ̌ļͲनƅζʶȪ̢ٚŚƒˮˤƜ࠷ࡀ၆фdžŴৢɩబיᛎၕ༠ãݠąȾЏתv͠ܥаȓƠִ̏Λ¼΍ċ˩ł˯ʎɽŐ˟ŲȵʬǕɶÒdž͍Žș࡙͐ᡌщǞDzϪש֕၁ᠽ࠽ᝑ͑޷ϙ׻ࢥϹƕɁˬ͏§߻ĎƷČॹmɫùΉɔɝЭĒΟρˋ"],"encodeOffsets":[[43807,16741]]}},{"type":"Feature","id":"SDN","properties":{"name":"Sudan"},"geometry":{"type":"Polygon","coordinates":["@@śhdмĵ̀џͨĵ؄ĶبϳÌÍȇԍ©Ȭʕðԍңңл؅џđ۹Ӫͅǥđʓџǃ…ǥ࠵@řǦ؃†̡ƝɳîѝӬƟɲ؃ŗɱϵɏݣ˿ǁʳğå ̅ʎÃʼƌΔE΄ӛՀĩάZȰ̱ʜUӦǭ͖̍µĎ̰ɒΖħΐˢʴǫȞɞ԰ϨئܦÏ¥ ZΚॲH@း@Ὂ@ῼ@˔ࠗȁƳŪࡻ্̰͌ȷҠ̳ыӑأƏ˅ʳĉ֑α௿ĚͳƅܟͿࠟԓзέٛč΃Љɽʝ࢟Dij"],"encodeOffsets":[[34779,9692]]}},{"type":"Feature","id":"SDS","properties":{"name":"South Sudan"},"geometry":{"type":"Polygon","coordinates":["@@Xٽűʯѿq˷ӏԨÑюХƨͳϦșӼࣳ֫օԫԇԫϭסFگȟՕȊ΋ɭ݉֐ȥάҵDZϱÆɣƕϗĸԗۚƉˊعͪɅԌΕζ֟ѬS˘ҡͼ֯͠ʴĠ̀ǂɐݤɲ϶؄ŘƠɱўӫɴí̢ƞ؄…Śǥ࠶@†ǦѠDŽĒʔ͆ǦۺөѠĒм؆ҤҤïԎȫʖԎªÎȈϴËĵاĶ؃ѠͧĶ˿cлŜg"],"encodeOffsets":[[34779,9692]]}},{"type":"Feature","id":"SEN","properties":{"name":"Senegal"},"geometry":{"type":"Polygon","coordinates":["@@΍ٺн̚φDŽРמȦќ˾ːкïШǾҶVДʙ֎ɝԘأֈֽžԹǔӓ̾ɿî͗ʽŧ³қâÙģȃk׿ȲЛV༇–ɥħ˥‚ѻƋƏ٢ވkȬŞƮR̸ȘήǯκcζȌǝʐˡƙʻJͧȸˉ_ȍȥࣵy"],"encodeOffsets":[[-17114,13922]]}},{"type":"Feature","id":"SLB","properties":{"name":"Solomon Islands"},"geometry":{"type":"MultiPolygon","coordinates":[["@@ɾ˿חN͉ԬԈȯǜ‰"],["@@͝mԧĎǫżÀͮֈƁ˜ǭƎə"],["@@ųƹحܰǫԈ˺@̠ڥʹЗ"],["@@–ǛڅΦҟ̠̿˪ŰĐϮȫېϭȢˉ"],["@@Ǘ³οȒ·Ί¨ƖԈΡͰ˛"]],"encodeOffsets":[[[166010,-10734]],[[164713,-10109]],[[165561,-9830]],[[163713,-8537]],[[161320,-7524]]]}},{"type":"Feature","id":"SLE","properties":{"name":"Sierra Leone"},"geometry":{"type":"Polygon","coordinates":["@@ɧØ؁ͺѩ҈Ƨ̬Ĺت҆τĬɺƞǸɶpȜǂڦCɺ̛ǼˁʓƈɗṶɴ´ϹϹϛҗ«ʓȩˏ"],"encodeOffsets":[[-11713,6949]]}},{"type":"Feature","id":"SLV","properties":{"name":"El Salvador"},"geometry":{"type":"Polygon","coordinates":["@@ġȡӡ^̡Ą΍ǘұÀʃǶ~Ů˾ɄǀĢ«IJȠ¾ʜëǸǙʪƇŒœτĴǤÑŘĝÏͳ"],"encodeOffsets":[[-89900,13706]]}},{"type":"Feature","id":"-99","properties":{"name":"Somaliland"},"geometry":{"type":"Polygon","coordinates":["@@ϛԩד۫۹Mᩧা͍̜̳К̳ҨǾ̖̲҈˚ƹǒΏϜΗкGߊɌࣴĴ݌ʼиÆ̚ƶӎˆKaE΋Aࡑ@ѫ"],"encodeOffsets":[[50113,9679]]}},{"type":"Feature","id":"SOM","properties":{"name":"Somalia"},"geometry":{"type":"Polygon","coordinates":["@@ѼĎЊ˾͈FpɵýӧHѳǯ̣ʁࣥЙयԱ੷ܝ௷ܓवধ଩ࡁڹష࠯޳ٕँৱȗѷȍȣӽۚWᵤܾ॒ɰˆբfݠפબšᛜᡄה۬ϜԪ@ѬBࡒFΌLbːhϰŰ"],"encodeOffsets":[[50923,11857]]}},{"type":"Feature","id":"SRB","properties":{"name":"Republic of Serbia"},"geometry":{"type":"Polygon","coordinates":["@@Ԡȡà΋Ӫʓ˄ȌȸĿșƗƶƥȷȏø̫Тγ͋ʿƗˋĞijƑšϳa˹µƒØĴĴĦȴšKǍƼƑ ŋƆƽÀšŠƯ±ś˧ȩÑèð͋Ǩ˟ĜūŜɟƠȢšŬЄЛ͔ɀτ̥Ë͔́ˉʈȱ͘٢ɚԾ™ҖͣĦˋ"],"encodeOffsets":[[21376,46507]]}},{"type":"Feature","id":"SUR","properties":{"name":"Suriname"},"geometry":{"type":"Polygon","coordinates":["@@৔ǙĞưڶÔࣚɥѩܟâֹͤӽƥίóϩɉΛӓDzЇđ͹öčʏƘǗ÷ǡҙèԡܴōӄˏBωؐƺѠ¯ȤԜɖƈݲ"],"encodeOffsets":[[-58518,6117]]}},{"type":"Feature","id":"SVK","properties":{"name":"Slovakia"},"geometry":{"type":"Polygon","coordinates":["@@´»ΊŖш̕ӺǶЈđ؂Ţߚ͓ɷɓǏ͹dzđ࣑ʮ˟»ȟȡЁĿěÄХŽͭ}ãǙ۷Ļ̱ĠёɌċ̆äńŢȂόa˺ĔxþLj¢ÆȒȖ˜žưʢD"],"encodeOffsets":[[19306,50685]]}},{"type":"Feature","id":"SVN","properties":{"name":"Slovenia"},"geometry":{"type":"Polygon","coordinates":["@@ۜÝъȐܾtLjƘƘUǎ˳ڝɟć͹̇đHɻͣh˷ƎƷƙב†ȈúȫΨĞа"],"encodeOffsets":[[14138,47626]]}},{"type":"Feature","id":"SWE","properties":{"name":"Sweden"},"geometry":{"type":"Polygon","coordinates":["@@ࠁוƀԥ೹ڭྱܡؓஃײףߦүޗॅ࢑ȝ͍තӋ޿৳ĆӅڗঃˉߐ۳॔ٓஐφӜּۨ˦ন՝ю½ૠղ߀࠰ä̧ͬ˺ಬஂࡀञֈײ߮GɞҶཔƉŬքԸ”૪Щ಼ֱv಑˴͛ฃʃ"],"encodeOffsets":[[22716,67302]]}},{"type":"Feature","id":"SWZ","properties":{"name":"Swaziland"},"geometry":{"type":"Polygon","coordinates":["@@ǡύӭěԅҖS̄ɰ̀ĂʔʐÒшƵŰϕðω"],"encodeOffsets":[[32842,-27375]]}},{"type":"Feature","id":"SYR","properties":{"name":"Syria"},"geometry":{"type":"Polygon","coordinates":["@@࿩ࣅऩͬgNŖŶ_ΈȸҠҜ̈́Əͤϗ¨ÿٞȶΌɤȀɤȀ°Ҹ˞Ǐऎɺ҂ƿۖFॴ̀Ґaक़žїԽҡȹĂؗͅ৫ᇵ࢓"],"encodeOffsets":[[39724,34180]]}},{"type":"Feature","id":"TCD","properties":{"name":"Chad"},"geometry":{"type":"Polygon","coordinates":["@@ĎЄաnDզΓ̶δ૊ੴߌ¬ન͖ၼǼΰΓ˾_ˌ̽ɔȷರࡔҠ…ྑ…ྏ¦ ܥÐϧإɝԯǬȝˡʳĨΏɑΕč̯̎¶Ǯ͕Vӥ̲ʛYȯՏƛэͽ؉ࣹ߅ϳ߹¾ʁûĊ̏ѫ̋Σ͟੓͏ȽȐƓhƹɍۛÙƀɪ˅ׄşΐλƜӷӪǼІϦċʂÐҸSқކŒ֐É֐ͭՠ"],"encodeOffsets":[[14844,13169]]}},{"type":"Feature","id":"TGO","properties":{"name":"Togo"},"geometry":{"type":"Polygon","coordinates":["@@ڱdzȇ̎ɡՔãкȆݴɁ̬ăڎD؎ΕѠÖˀ݂kŅѵʲʝ̈̋ŽЭǜǥኝȺׅ"],"encodeOffsets":[[1911,6290]]}},{"type":"Feature","id":"THA","properties":{"name":"Thailand"},"geometry":{"type":"Polygon","coordinates":["@@ݭϬܗeŬڈ݉Káऋґ௯˙ݏÌ؋ն΀ދưܭҶӓԚĭѤѧ˝·ևĵßќۇςƣƭͧ͒ƝжҁӄПЌƏӳǃҲĠԾʚ߬ТࡸҤ޶͟ތ`϶ĩҸ֕ښȩф̄ƺ̮ܶ·ֆՓؘН݆ΠƴϦࣦצœӬθӔȘθʷ´ԍ֨ȷࢭpݫࢰԆʤƧӰzǜَ̊ÍٖڽÀࠥںܷ›܅˙ϛ޿ŦગDž՟ۧȤ১"],"encodeOffsets":[[105047,12480]]}},{"type":"Feature","id":"TJK","properties":{"name":"Tajikistan"},"geometry":{"type":"Polygon","coordinates":["@@̭ʷࣳƖāӛ࣬Þਢ˗འŶɈާˠĐԜȓ‡͛ŴӍࡿBׁØԻϕύĉ̉ǯͩˠþ۸ʩ¢ĞʲғȐα̇ė͹Żūԇj˕ϩ˯nj؋ˑʱĺӀࡘǹض؟ȨɔφۮŸЌҬˌբ૲ȜǩϵŤɹΎv"],"encodeOffsets":[[72719,41211]]}},{"type":"Feature","id":"TKM","properties":{"name":"Turkmenistan"},"geometry":{"type":"Polygon","coordinates":["@@ñۼطŠॣݔڣĠगюׯþσƽ֙|ׯӓ݇NjƻרŪ࢞ٽ˶Ɏֺ֏¸Ȇ۾ߊȵ݈ˎؓԎʉӔڱɋď؛ʿհψ˨ॖǪ֨ɻךڅњ¤ॆ\\Əцܖ̂۾ӦଆѹĜڡ͐ǣࣦžˮƳаࡽ०ׇոЃ࢞Щ૤Ϋwԥʩ€Ѕɤſ̙۽NjǙڥӁʭڏŵǫϟهŏࡩ͈"],"encodeOffsets":[[62680,36506]]}},{"type":"Feature","id":"TLS","properties":{"name":"East Timor"},"geometry":{"type":"Polygon","coordinates":["@@IJȤܢȌז†ˀŀ͆Ľ̯ɫ࢕ο۳ʋeʬďǔ"],"encodeOffsets":[[127968,-9106]]}},{"type":"Feature","id":"TTO","properties":{"name":"Trinidad and Tobago"},"geometry":{"type":"Polygon","coordinates":["@@ӚŊǮ‡‘صۭġƯúʒɲiͪ"],"encodeOffsets":[[-63160,11019]]}},{"type":"Feature","id":"TUN","properties":{"name":"Tunisia"},"geometry":{"type":"Polygon","coordinates":["@@ΩພԭͺQȰۉԄóنԮҶȢۚƃߠǠќࣶͺךĵ}ы܊̲ÒljпЫMϱ̆ȽōܫփхDŽқѤaɄЍ͊ſ³٥Хʋʵˏֽ͓ĘΑïΟЧț"],"encodeOffsets":[[9710,31035]]}},{"type":"Feature","id":"TUR","properties":{"name":"Turkey"},"geometry":{"type":"MultiPolygon","coordinates":[["@@஺͗ঐżܤõলѬࣆ¢ߴЭƜ̑ăУزȻͨʕֻʇˀ५ǏʻҠڧЕƙ̏Ɋ঍ňίŽॗŽҏbॳ̿ەEҁǀऍɹ˝ǐ¯ҷɣǿɣǿ̱Ϡ͈͂ԟí۱ȖֿәౣĥڹҊࣟ†ȗΑׇij߻҄ࣻeӽ࠶ؗҰЦٸՓВठߨಒ’Μྀٔŏ৞հ঒ʄർlุף"],["@@۫ҏ˃Ϻ\\ǦȦĦʺՂХɞࡦ˄ܤőĴ͓ܼ˓Ƶȵি±Ωʷ"]],"encodeOffsets":[[[37800,42328]],[[27845,41668]]]}},{"type":"Feature","id":"TZA","properties":{"name":"United Republic of Tanzania"},"geometry":{"type":"Polygon","coordinates":["@@ƚġᵂႋÌӣ஼࠿ϱਙ¸Ӊՠ̩~ɓɳԓ¶ʭÇГ̌Ճΐ̰ࠡǿڝӣࣿ͛ԋb̙ʥבsɕŃঢ়ʂكåɽଢ˵ϺǛɶࠗƾӉʨՕƘͯƘΗɈґ੖ӣҺǗӤČѨƯޞΎ ̨̦͜ѬȺǮS˘ǷȐ·ͨʐł¶Ӷͫӄ̎Ķऄ[ႎà"],"encodeOffsets":[[34718,-972]]}},{"type":"Feature","id":"UGA","properties":{"name":"Uganda"},"geometry":{"type":"Polygon","coordinates":["@@ः\\̍ĵԇʷȯĐPوȜ͎²ڬǰϸ͎Ѭ͔ɠ˒̘͵Ŗ¼চΌɮՖȉڰȠעEԬϮЊ׍İсτ९̧ؓЯ֋ʉͽTࢹႍß"],"encodeOffsets":[[32631,-1052]]}},{"type":"Feature","id":"UKR","properties":{"name":"Ukraine"},"geometry":{"type":"Polygon","coordinates":["@@̾“ɄȒʮ¥ࢌĆ՞Ӈȿǝêʻڠ£̘ηkǑ੪̏٢Ƅ԰ϿӮVఊ˙XʙͿѯȆҩƃ˩߻Õџɻύڡã֑˕޽«ܣ̻¸ԹЪȭࡨ¼Ǐ̛ँơଛӟұǠȄЂࣽʘƨLjߪ˪ʑȔಯɆË̼ީĻ̷ҧٱةϟƠЁƉϑƺɂĞƦ˾ɲˎÑƮǬäĊśӸ{ɞØƽĎÐŲ̉ɈŧΘ̩ƐÒ˶ϝɦΉŽأʾ֑ĉȧŭΟ@Ƀȟاă˹ŹϷȴ՟HԳĢγǵÍɤұɮǐͺɸɔȀµɑϘބۦиİĜɾхܼДҢɪٲnࡖßबȫڎi͂ŧ̀Ʀɚȝݸ¢ͮąÄцʶȂܞº"],"encodeOffsets":[[32549,53353]]}},{"type":"Feature","id":"URY","properties":{"name":"Uruguay"},"geometry":{"type":"Polygon","coordinates":["@@ղĚࡆٯ̺|ࡺ՟ڈҫӠֱχЉɸӇεՇॉұاǚғěޥΰ֫ԟҬÞլǾȈS࠸ɤࡺȾڦ"],"encodeOffsets":[[-59008,-30941]]}},{"type":"Feature","id":"USA","properties":{"name":"United States of America"},"geometry":{"type":"MultiPolygon","coordinates":[["@@ũƕȽŤ|ɾƓ̨¦ĤƤƎÍǔ¸þÜe͐ƙƬñƌőɊ̍q¯͟ǵˏſ"],["@@˭ÑƟǮīèQÀĈî̘āɘŹëĵ"],["@@ĝ҉|Úĸа•"],["@@­µÓŻˆŃȒ’ɤŚêÃʐ˥"],["@@ıĉ˱ƴªÖŸĈȘijȝ"],["@@Ƭңʼƛז½࡬ƅࠂʹڼŊਖɓ˞Tݨʄ߂̧ࠒ͗ں˩ٶˏĈəȢĉ½ĉɦǎĔ¦ȣǜƅɴ@ŬĹĽƫ࢖ЁǶށǚܳʗӹЁҥȁ̍mēĦť˸Ɓɂ@ঊ҆ࡾƀસмfĐ÷ʰƉǒϜƆࠜHޘAˎ͞ŀàࢶ؄ϜƸ౦N໾BĎȺː¦Φž̖Ϣʲٺٚي˨ə֜ƜώʏAଧռӅƢ˝࣋Пࡷ̃ࢱʝѻӿƛȋSѽˤѽΒsė̬ʦȇãʇ֥ƋЗhةƥλ¥ӥ¥۫ʏఀǂʠǃ୳ʥ՗C|ĺʭɷʚǹ׽ؑ٧×Ɏȁª˟ɀǪҍȼƭ^ͅˏ͛ҿڡûʺֲѕ͎įۦljεǴՑևƀׂ˓˜ߛʊÍĖ̃ŠࡁՕدࢇʝցӱнÁэ̱ţ˭इձӁЍЅӽŻׯƪ׍ˬܗώשLεЊঅ֥—͛ȿԡʣŃЯĺƁς͋ȖѻܢϹٞű͢Ǥ֐ɽҦٻ۲͟źࡑϡƭ¦СϼՃȺोŁݗĤٙÍΏſƲɟaͽǴǓLJō̵Ů́ǃ؍€طѺܻĿ؏ȚԹÏۻȝއح࠳γҝБȕϗUׅ¨ЕDŽ˹͝{׭ȂٽʺɽЄȁטӷӐ̃ӰуֺףͲۉgՉڑۣʦѡʪȽҦ˧Ѯӿτїˈ̩̖ป@C΋ڗ@ဩOቿפ౓ТĀǒ੩ĝॕÝƙіխӚϻĴğʌһ¦̝ɪޭĊɉƌĹҢࠁࡊ۩ୠˆȚχˤٯ۴řۆ҃ҞȀۢ…ܜˍ٢͠ߊĸނĺނƱૼˇܘʓ϶ĸǐ௒˷҂ߋȺɜƇې˷ێᛸ@᠂@ࠜ@ᢢ@៚@ᡀ@ᡄ@᭰@ᮞBაAF͔˴J"],["@@࠽͋ѕɐŽЀބ̘҆Ÿ֐ÉΤʻܫЍ"],["@@ԧŽսƾԛɮࠦƞښùĂ͑"],["@@԰DžԾĒڸɛ࠲őéĝُDZٕǾ͋Ʋݍµȧôº̈́"],["@@؊ϛώnjහ»¹ȕ౾ƛࡨČᄚ˅ྤā٨ʼn૦Ǝౢʧࣲŝ@@MᷱIⷍࠠ{ࠌɵהρݜցࠈҺࡈ˖Ҁѡ֤·ޒϙՂ׽࡮य़ේ՗xՋұЙҥ͂ݍˌʃܺએںҍߎ߯Ä೷rটʌ჉ࢎߩDŽ฽̜୑í࿻ϬৃΨटǯǦ׏ҫÁঁǫ݉˱झdzťӶϚࠚࣀʶɱɂੱҵֵ֑௅ױؚСߏ׿ࣗΗࡁʱȻωಽѡ˅ϿছΫֽÞ޷ɻ࡝˹ۧ˫෹ʉſƘऀϾࠔʸࣆҠਬĨвΈ୘ԊȈǚب̒ƢْђӸॹʫ˓Ơҕ̧շюɧ̝̽м࠿ͳԩBïԄƲ̮ե̚થLJ܁ЀַȬIӈ٩Ϊ͘ӘۆҸ̚њںÖ־ƇڴМ؎ï٘ʼƻϨҹưج͖ԩWࢻǽʯȃڏȄஏĥ௷ȬΛ͸੟Ӧ୾ΘመШ۔@ŕнᄢŽڽԶਕ͌ױр߫ΨଽˈҺѲ๰‚ਗ਼ϦȨФ࡬ЎࠊĪཪώޜÉಐ҄ౚǭ"]],"encodeOffsets":[[[-159275,19542]],[[-159825,21140]],[[-160520,21686]],[[-161436,21834]],[[-163169,22510]],[[-97093,50575]],[[-156678,58487]],[[-169553,61348]],[[-175853,65314]],[[-158789,72856]]]}},{"type":"Feature","id":"UZB","properties":{"name":"Uzbekistan"},"geometry":{"type":"Polygon","coordinates":["@@xԦૣά࢝ЪշЄ॥׈Яࡾ˭ƴࣥ͏ǤěڢଅѺ۽ӥܕ́Ɛхॅ[ᶾᓘӺƾïದ׻یͅߤݵঢŪ෸à৔ؗÙࡅЦMǢۍ੬ɲЉ̺Lπ׺૎הӖƺʠĉ۵խئ́ײȾ়ѷ੽؁ٕĊ΍uţɺǪ϶૱țˋաЋҫۭ ɓυؠȧǺصҿࡗهǰҳN"],"encodeOffsets":[[68116,38260]]}},{"type":"Feature","id":"VEN","properties":{"name":"Venezuela"},"geometry":{"type":"Polygon","coordinates":["@@yȣӱĭ˜ϡYѭυӥ͆ڙδÆȌ؈ʻ̒§َਸ਼΀řІ̎ˆ̞ןל_մҵ˧ݮQ࣌ĔӖϕٞĻҼʾXɄਨ¼৖\\܉ʛ˼Їڦ×ِЯƆڧѬn͢ȣڕӱó̫˾̷ȽƽԫƉjϱɫɱّ֪Őʁ̭͍ऱ̽׿Žʏȣڛɀثņƿýϔɑ‘֝ŜՉ܆ï°ǭ׷ʅĭΣΉƏسȝNjʱٷÅҧѼʯ࠺ɟ̧̌Ȅюм…ȊʅʠǛ֒à׼Ȉ˰ƲҎ̓Ơӏĩ؁®ͻęסܢӥńઉăȧ̊ȷê‡ǬĴ̶áͺȃȂŅϮѡÈɸӮĺ׶ʔ̸͘ʌɈрդƖ"],"encodeOffsets":[[-73043,12059]]}},{"type":"Feature","id":"VNM","properties":{"name":"Vietnam"},"geometry":{"type":"Polygon","coordinates":["@@૭ܗ۫ߍȁ׍٠ࢭ޺ળނԱԞګϪ།ŕ๓۫փ१եۇ۫਷ޱ̧ՠʀ֬دӌܬ͸ࢦÔσԚප٨ļ৖ț֖ƶࡀɃצٍאՋ݌ۥ঴৓Ԋʊ̠՞ɘ͙ܺਙPϕކӭڐҊȴڢIࠈĬܒ҄К̿ސƵƃӛАͿࡎɓ"],"encodeOffsets":[[110644,22070]]}},{"type":"Feature","id":"VUT","properties":{"name":"Vanuatu"},"geometry":{"type":"MultiPolygon","coordinates":[["@@ˣō˭ςŒɤՆӗ"],["@@ƌڱɥŀǩ­ťɴi٢Дʵ"]],"encodeOffsets":[[[171874,-16861]],[[171119,-15292]]]}},{"type":"Feature","id":"PSE","properties":{"name":"West Bank"},"geometry":{"type":"Polygon","coordinates":["@@@ԣŭʙЃŕ˜ɜɌŚɁĦǬ̤֔ś"],"encodeOffsets":[[36399,33172]]}},{"type":"Feature","id":"YEM","properties":{"name":"Yemen"},"geometry":{"type":"Polygon","coordinates":["@@؉ɥNjύo˹࠷Οഇϻݩףυ±ʥºӭΑ՗lj۷©ɃµǿɛəÕŻɇеlˍœ׉¨ɓӬzҠƍʜǑتʋΊǚ¤đϨĸNJ™ξςˌđΠɞЮΊɓɬúॺnƸċ߼č͐¨ɂ˫ϺƖ׼ࢦ޸Ϛᝒ͒ڀ൳˞ח"],"encodeOffsets":[[54384,17051]]}},{"type":"Feature","id":"ZAF","properties":{"name":"South Africa"},"geometry":{"type":"Polygon","coordinates":["@@ǏŧΣяɻћӇ׻ोࢁףԋًϣ࢛͙ѓ«ŇɷԛŰеDž࣫NJԙĹΏ¬ࡿͩܓƃԱͅϡoΣ̚˳fαϒŸśŏɦLӰ˙֞˔ƴs٤ս޼х܈AF׽તДдͪɯƘΫϘÓՈǃҌÖݤіB᷌ɨűӾߙûԟȈ̏׼ĒрϒЊʨȶДЦȚΠķВɽۂ£՞ȜĐʾƨДҚäʨ͂˪֔ݮغஒؤ΂UОƛ˲Ķ҂ċД஁ɔׯƫऩî̟чƶʏÑāʓɯ̿T̃ԆҕӮĜǢώْQȿؑıۥɑϛֵщ","@@νʶϻǟҕ҃͡Տـ٧̜ČƺˎҴƀƜ˜ʴФ̅ʪ"],"encodeOffsets":[[32278,-29959],[29674,-29650]]}},{"type":"Feature","id":"ZMB","properties":{"name":"Zambia"},"geometry":{"type":"Polygon","coordinates":["@@ІϏɊ܋ƝɩǙڻLjۡ˃̇ʭޭѶɓᢇۗĂׯٍřӍͯĹ̛̅ßܵۓҭխ˳o˗ĬऱĠƯÚOêͧȎկ¶ۋȑչԾ֣یžᦶშYí̂Ű̀ƧЀĪТėʺ̂q¶ʽϾrՖûˬϡڨŝԤˆȌѯ٠ş̴ΧΈҥ٠Që࣠ɱƳח͞ɧƬļࡈƬসȉψʈ՚ɤĶ଀ƚͦđΘɇͰƗՖƗӊʧ"],"encodeOffsets":[[33546,-9452]]}},{"type":"Feature","id":"ZWE","properties":{"name":"Zimbabwe"},"geometry":{"type":"Polygon","coordinates":["@@ҁČ˱ĵНƜ΁VՙϞٯźʙՒC̒έĞ्ई˃ӢǛƮ͓ڤलğ˘ī˴pҮծܶ۔̜àĺ̆ӎͰَŚÆ̻۬hϴǯǺȻАÓѦˑF੟Ǐ׋—عƊʝħӵŵùɛ؅ࢫ॓"],"encodeOffsets":[[31941,-22785]]}}],"UTF8Encoding":true}; }); -define('echarts/util/mapData/geoJson/xiang_gang_geo',[],function() { - return {"type":"FeatureCollection","features":[{"type":"Feature","id":"8100","properties":{"name":"香港","cp":[114.2784,22.3057],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@™@}ScTʟ@cWuJÁ–]„l¦RLj¼BĄà˜ ŽH@TOHCTDDDHDNAT@PEHDDNJLX@BABALHFF@DKHADBBLDHHFBLEJB@GDBBFBADDB@@KFAFBBJJA@BB@@FFDDADFF@FADDDBJC@AFBD@@DDD@DAA@D@DB@DHHBFJBBFEHDFAN@DGDC@DLCBDDCFDlAFBFCBEF@BC@GDAB@FD@DZJ‚X´HĐMja@Ý`p_PCZ@lLnRGSDMFK|a\\Y}­ƒ§™Mën"],"encodeOffsets":[[117078,22678]]}}],"UTF8Encoding":true}; +define('echarts/util/mapData/geoJson/xiang_gang_geo',[],function() { + return {"type":"FeatureCollection","features":[{"type":"Feature","id":"8100","properties":{"name":"香港","cp":[114.2784,22.3057],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@™@}ScTʟ@cWuJÁ–]„l¦RLj¼BĄà˜ ŽH@TOHCTDDDHDNAT@PEHDDNJLX@BABALHFF@DKHADBBLDHHFBLEJB@GDBBFBADDB@@KFAFBBJJA@BB@@FFDDADFF@FADDDBJC@AFBD@@DDD@DAA@D@DB@DHHBFJBBFEHDFAN@DGDC@DLCBDDCFDlAFBFCBEF@BC@GDAB@FD@DZJ‚X´HĐMja@Ý`p_PCZ@lLnRGSDMFK|a\\Y}­ƒ§™Mën"],"encodeOffsets":[[117078,22678]]}}],"UTF8Encoding":true}; }); -define('echarts/util/mapData/geoJson/xin_jiang_geo',[],function() { - return {"type":"FeatureCollection","features":[{"type":"Feature","id":"6528","properties":{"name":"巴音郭楞蒙古自治州","cp":[88.1653,39.6002],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@˜@ÈÒĊanwŎV„™Ȯ¦ͪŃĢ„ÜōȂçČéƐżLɆóĊ‚ĊaʊŁ±¯²Um»ˌmÈ»V™ʠţWÑůǓ郙ôƑƒğÆīŎī@Ƿ™wô™˺LÞ¯ƨVǪуšĢ™ȘV°wĢŽôk°¯ƒ»΀@Ȃ»ĸŽǔ@΀ƒ͔ôôLɆó̐ÝɜLɲōͪƒƨóŤK@ī@IU܃ÛmȻţǩÝ˹ÛljťǓǫō@Ɲ²¯VçōKͿŁΗÇţ»ƽ™ɅƑLÓŏÅÅɱV@ÝĊU¯ÑĊĭÞLšÞŎJ±̃XȣˌōlƒUÈ¯ŎKÆƅ°™XÑܱnŗġV¯™óaUƒƧUōŁ„Ñ™±„çɲ¥lĉkğ°ƒk¥˜ƒnğţL¯ÝÝUƽĬ΁lķ°@„ō„XÿݯV»ŹLʉÞɱŤĉó°ÝJ™¦ÝKÝ£ţܙÈĉ@ƒxǩUċƑ@ky͓¹™`U²ĉVġ»ğa¯¥ť@ĉ™‚ó@ŻÛÛJƒw¯nó¯ġWƽʩķÝɛwĉĕݼȭÞķō@ó£Å΀ƑŽ¯ôȯÞ¯Ȱ™ÆōèĉXǼó@ݚnºƒĸ„ÞVƜĸȚUʶõˀĵĖɱŎÝĖVࢰӒѢ°˘nϚVˌ™ÈmɼĵŦW¤öʊõʔ@°ÈXVŽ™ènŎȁb¯ǫĉ„±Èğ`ġwōÔğ»mVVŽ„Ý¥ó@™ĸķô@ššbX„ĶmV²²`Þ_˜˜ɴbͪÈ°„ÞWĸÈŌmބškɲŽÈUÆ»n¼ǬVķĸźô¯°n¦ɄǜÈ"],"encodeOffsets":[[86986,44534]]}},{"type":"Feature","id":"6532","properties":{"name":"和田地区","cp":[81.167,36.9855],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@ƨ¥šèź٨ΘƑᩄbUࢯÞĕɲōĶĕöʿVʵķșUƛƒÝ„ķm¹Þ™ô@È»ĊWŎçšÅ°ȯȰÝ°óƒÆͿĉ»̽çnƒmɱĵƧºóU™™ƽ@±wóL¯°̻L±Æ¯Vƴķb¯VÇ¥ğ²Ǖbk¥ÇKlÅɱġ@у™óK@™ÇaÝXğţxĉČǫķê¯K@уaŹ„ƑKƒ¼¯Vóaónġw™óÞéU™ġbóĉğÇl¹™aUóğKW„Vůn›ÇŋƑ›ķnʇ»óxĉw™çÇ°Åw™°ċ„XŽ™„ób±ƒkÈÇJ—ƒm²ţx@ÒݎšŦǺn„ó¼n°ÇbUÒ±¼XĸĠłƽXmwĉºƒzÈÜmnxmx²ĖmҚbnŽƧêUºĊêÆVóĖóUĉ¼ÅĬƑ°ɆƆŻŚlłÞLš¼nĠƒ¼@ޙšÞź@ŎÞ°VšɄɴжϼِ͈Ŏ„"],"encodeOffsets":[[81293,39764]]}},{"type":"Feature","id":"6522","properties":{"name":"哈密地区","cp":[93.7793,42.9236],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@WnŐÆĶLĢ¦ţºź„lxÅĸƽŚ‚Ʉ—Į˜è@ô²ÞUĔƐńV°¯ĸX¦Ɛm̐bƒ»Ɇa΀šĢ™ƐLˤ™ȘÑnƒІljĸÿn¯ĶaŎ¯ĢĕȘ¯°΂œla¯¥™ǕǔwˤӱlťО̻nŻmɃĕċţUw°WUóƨÅţķ°ýV±óÅǓéʉ¯ƽŁƒéōǖȁÝƏůǕw˹ǫȗǓƧǕVý™é@ĬţLƧôͩ„ɱŎɛK̏ÞɅôóK@²@°ōؚ¼lŦ¯ŰóƜÛlV¼ķ¼ƒ°kȰ™Ű„ĠƒǬ™ŚÝŎmĖ`@ÇÜn„"],"encodeOffsets":[[93387,44539]]}},{"type":"Feature","id":"6529","properties":{"name":"阿克苏地区","cp":[82.9797,41.0229],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@VƚxˌŎÞŎƒ°n„ȂÒ°²VĊ¯VğƾˍǬƨÞÞKÈÞĊVźôɆÞĢèŌôWČ²ŤVÞĸʶbl‚¯ôn_VÆĸlmÞnVź_ĸ¼Ȯmǖ„šéĸW°°„ĸJ„kʠ¼Æw°¤ÈƒlxɆzČºĶI²ÆǔUš°ô@Þ¦‚ƒUnUĠ¼ŎÓĢxĠ_²ÇĊƒǬ°ŽȂamōšçUÇW@¯öʓõʉX£ĶťnɻšÇUˋmϙ¯˗ӑѡᩃaΗƒœɜ°xWƴUxɃÒˣ¤Ʌwğ„ʉōóÝŹ±°ȗ@¯„ƃ²¼","@@ō™гwȁ¥Ƨ°ŹÑķV™¼ÞêĊ»‚lĵšm¦ÅW@ĀôÈźaɜxÈbÞÆĶIОŘnIÇŃÛÝĊÑĠƏ"],"encodeOffsets":[[80022,41294],[83914,41474]]}},{"type":"Feature","id":"6543","properties":{"name":"阿勒泰地区","cp":[88.2971,47.0929],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@ɲˣĊIÈ¥‚ÅU±Ċýkō°ƒĉƽó»ĶƽXóʵʵ™ȯƑÅȁɅ¯ĉ@ÇሗK֛@@ˤV֜ʵрƒǬVĸƑŎ@ƆϯÑóŽķ@ʇ»ķ¦έmlÈĸĊX¼WźÛÞÝѸ‚ĢČþ„ĀĊôάVö¼ĊUƨ°°èŎČUÜƐóôVôôŽ²êȘlˌç°`n²ǬŽĊaš™ƒÛ°±kğmm»š@°ÝɆÛÅÇVaݍVm͔ğôÝÈb‚„@„ƒ™n¯š™ÜUĢÑĊ@źīżWŤÈǖWôŁÆI²ÓƨL@ŽĊX„mmÑÆ»ȰÑkƒĶō@ý°m—¯"],"encodeOffsets":[[92656,48460]]}},{"type":"Feature","id":"6531","properties":{"name":"喀什地区","cp":[77.168,37.8534],"childNum":13},"geometry":{"type":"Polygon","coordinates":["@@Č@°ƒĠ„ôÓô@Ŏĉ@Ƴĸ@Ť£ĢlVôWVóřXĉŤêÞ@ƐÒĢÑlèÈV@šĠIk°ÆŘ@ÈÈĀ@ǶťÒğ@š„@ÒĉlŻ_@šƧĖÅĬōÆ@bźÞnƒƒlVœÝĬšWƼʇ„ƒÝÅ@ÇÅÈwWóĉ±ğz‚ĬČƨƂÝIĉݯbÇÑĉƒ¯ʈV°xUŰĊ¤ƪ_ôÓɚI@lȚXȮ™ŎlɴȘ՘š„¦ɲÆʈ_ɴŽźŽôÞʊŎĠƒɆxˤ£ɄÑVwXƳ¯w›ɛŹ٧™çƧ¦ōƒُ͇еϻɃɳU™Ý¯@ōÝŹš™@݄»mğ™»ÝKkŁżřɅƅƒ¯ÆīĊ»ôVôĕÅUĉéV¹ƨém™anѱĕnwmwnÇۄyĉ¹ŹlŏkĵèķmōÞġKñÔċKÅèĉzƒŽ„ômxȗÿƿI@þÅČÝKÝ°@¼ÈVºš@ÅĢšÆUċłn„ÝÆǕČĵJm£ÝJ¦@ĊƒxV°ƏLċ¼ǩ™@™m@ÅĢómÇÆğ¹Çš™ÆšĖÞKšx„wô¦ÆÑÆL²ÆƾŽU„Ž±ŚÅŻĖ@ĬŤÈñ„@ǔÇx„Èǃ","@@VÇ™ţ°ğUĠ¯mk¯ó¥ķIġÿƏbƒ„ĉa±ÒĸĀlKU„_m»nwšŽ„m@ÈŤ¦ĉbÞ°±Þżł̦°ĢŁVé"],"encodeOffsets":[[76624,39196],[81507,40877]]}},{"type":"Feature","id":"6542","properties":{"name":"塔城地区","cp":[86.6272,45.8514],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@ήnĸ¥ʈ¼ĸ@ôϰÒ@ƅƒōUķƑǫʶпU֛܃LګK@΋ĸ@Æ£ÞġÅĠċšLV݄»™@Å»Ýnm¯š»nŻĊ@nķŃ@¯ómóÛÝǟ¯aÝóȭ¥ƒšōUmxĉbÇї@›bUº¯X¯ÆƧbVÒĉnǕw¯°ƑŽV„—ŽÇ@kx±Uƒšɱn™ŽÅKƒ„¯ƒĠǠU°ɜL@°ƒxnĬ‚ĀŋŎÇLƒŽğšϱÞέƜkôÅĀǕłƒĸĊŤUŰĢ°„¦ȂϰÜɨ°x@°żǠÆƈČVĠ»ČL°ÇšbĊÑ̐óÞlĶwބɆVÞwǬxǪţȼÜLŐĶˢ@","@@óKĵĀV͈ĉłƾNJÆŤƒzXl°ƒÆL²¼źŽôÈĢǔ™¦l„ô°ɜÞʊĠğŃm»ʵƳƑʝȗīV¥¯ĉ°Ñ@ŃÅI™»ĉmğn™ƒašƒċƨbš™Vğ—w›ġ¯@Uōa™ĉÝJğÑÆŎkŎÞĀlźƒ¦"],"encodeOffsets":[[87593,48184],[86884,45760]]}},{"type":"Feature","id":"6523","properties":{"name":"昌吉回族自治州","cp":[89.6814,44.4507],"childNum":7},"geometry":{"type":"MultiPolygon","coordinates":[["@@መL@È°ĊȂɆƒÆĊ£„ťôWÓɆbĢÅŎƒÆ¦ČÑW¥°ķU¯ƏŃVē±Ý@ó—ç˜ĭɃƾřÆķkwŹƒŤ¹ġ¥ĵKŏÅXmˍщwǓ¤Ƒ@wóōVķ£ɱšġôÛa±Òȁ„óèţIVŽƽ¼k¤ó¹ġJmx—»ÝUƒ²™@ÅƃĸǫŎ„ĊmŎǬ՘"],["@@Þô°bÞǠôÜôn@°ĸń˜Ƕkłƒ¼UޙKğȂÆÝĢŤķ@@ΌڬL܄K@ˣȂ˭lĉńW¥ĵVÆý@ŃÞēUŃȗƅ@ŹƩǕĉ»k»Ç™VğóřX™ŻKƏŽċêȁèÛŎġƒͩń"]],"encodeOffsets":[[[90113,46080]],[[87638,44579]]]}},{"type":"Feature","id":"6530","properties":{"name":"克孜勒苏柯尔克孜自治州","cp":[74.6301,39.5233],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@ˎǫĠƽ°UUĉ¯±ȁÑmƒ„¯Ýōˋō™wUű»ÅƑ°ƒȘ@²¯ɳʇ`ɱŃ¥՗™ɳȗōkȭšșW@kəJóÔƩ`ĉ£Vů¯wU°ʇĊ„ÈÒ°aĊÞÞJŁċƧīĠyĊ²XôÇxÈÆÆ@„ÞʈƒÅ»™XÞīU›Ƒkm„ŹÝ@aŎÅÆīƨĕ@™ż`Ċk@љƒĠ@ŦÑ@ǵÇÿ@ÇÅŗl¯ğJ@™ÇUkçġÒƏÑÝ@ţéWĊôŚUŽóXUġkţ¤ķ@@ƴōĊó@óÔğƒ¯„ċ@@Қ¤kôˣŰ͓„k»ƒKX¯ċwƧôğɐšÒôIVƙš¯UķǬķšnŽ™¼ôb°ÒȰVVÈÞ°ƒĸó¤V¼°„V°²êƒlĢ҂Uƨ¦ôȰƴĊVV¼ǖIċĊ„ÞɜéšnČW˸Ǹša„řÈw±īšçĸ¤ĊšôšwšŽĸUĢ¦˜éǖĬ„Āô¼lÞkÒ°x°ƆÞx„šÆV²ǔ»„b°wގȘ¥°n„šŎV@°„„ʠè‚ŰȂb"],"encodeOffsets":[[80269,42396]]}},{"type":"Feature","id":"6521","properties":{"name":"吐鲁番地区","cp":[89.6375,42.4127],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@ôK„ĉǪa²¼lÜô@ʠê°Ĭ™ôȂƒ²ÑÜbĢóɲ™ĸ¤ŎUô@xƒŽǔ£ъxˎmƒÈÛ@‚_nĕÞōšř„ǫƒğšůlȯ„¯ĸ»U»Ükôƛ°ůkť™»Ŏŗ@¯@±͓óͿ„Ǔ@ķȁ¼Ϳ@Ƒ¼¯°ólġ¯xȗUġšƑ™ǩÒƧUÝ°˹Kóššx@ǸōĬÅĬƑĠ󃄚ǔêÆ°XÒʟŤUšÇ¼ˋnn¼±V²°ȂUŌݜbʟǔɅô@żǬaҎÈ"],"encodeOffsets":[[90248,44371]]}},{"type":"Feature","id":"6540","properties":{"name":"伊犁哈萨克自治州","cp":[82.5513,43.5498],"childNum":10},"geometry":{"type":"MultiPolygon","coordinates":[["@@ĉ„ÆŘȁ̐mÞ¯ĀX°±¼@ƾ¯ƴ°ŎÝþŋ¦WÜÞbȂĉźUœÇmwVUȂóô@ȰÝ΀nÆJn™ƾ™ʠ™ŌLČóǪ¯œ¥ǔaǖšŌaôÝĢLšx„ƒÆLšɲm„™²VlwÈ@˜Uƒƒ°¯ǖxĊmUÑƨa°Å°WV¹œa›ÇɃÈm¥°¯ŹóĸķǫUm»Å¼ÇVɱ™l݃ŋnķÇÝX¯ƒͩÇɳa——Ý`±_U±ĵnWƒ™a@™ĸóšķ™¯ǓV±ÅĵJċ¹ɅykwDŽ¯£Åxʟ»ƒlķI¯ƒX¯ķ‚™êǕƒȭnķ»Ź`±„kÞ@Žš„Ýô@Þ°xšŤŎIƨÆUxōš¯²ǔĬǬlUŚ"],["@@ÞĀlźƒ¦¯ĸŤKޙšƒċƨbš™Vğ—w›ġ¯@ţƽJ"]],"encodeOffsets":[[[82722,44337]],[[86817,45456]]]}},{"type":"Feature","id":"6527","properties":{"name":"博尔塔拉蒙古自治州","cp":[81.8481,44.6979],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@ήƛϲÝĠ™„ÈKŌōÿmī„w@¯ɛKV¯ğǟ°Ƒ™wġKóÞŋbǕ™Ǔb›¦ǩ°ċôŋKʟšƽšmšÅImŽͿŽȯÞó@ȁôUVnx›ÈŹVȁĊÝabŻ£¯°l„óxȂŤĸkĊšÞyĊêĊmĢxV„ƨÈŽĠX„ŽΘÆĠÔź‚Ɇţ°LXƾŤŤb"],"encodeOffsets":[[84555,46311]]}},{"type":"Feature","id":"6501","properties":{"name":"乌鲁木齐市","cp":[87.9236,43.5883],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@šŽWŽôŚUĠȚl¼Ċ¼ƪǖ@źȘƆ@ýlܚXVŘޙš¦V¼kĖó҃èkĊȁˮ֜@ǫ՗nōƒĉǬō„ķÆŚ@„±ÞV˜¼nwĢIôºl£ƾ»UŤJôçšó¯īʟéó@kÛ±»ǩbƒĊóLҍÇǫb@ŻɆóʠǓ›aŋÞȁVʉłĉbĉɅô"],"encodeOffsets":[[88887,44146]]}},{"type":"Feature","id":"6502","properties":{"name":"克拉玛依市","cp":[85.2869,45.5054],"childNum":2},"geometry":{"type":"MultiPolygon","coordinates":[["@@ɜÞʊĊýVaŃm»ʵƳƑʝȗīV¥¯ĉ°Ñ@ŃÅI™»ĉmğn™ƒaݚţL°ķóKĵĀV͈ĉłƾNJÆŤƒzXl°ƒÆL²¼źŽôÈĢǔ™¦l„ô°"],["@@ƾIŤ@UUwōa™ĉÝJğÑÆŎkŎ"]],"encodeOffsets":[[[87424,47245]],[[86817,45456]]]}},{"type":"Feature","id":"659002","properties":{"name":"阿拉尔市","cp":[81.2769,40.6549],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@nIÇŃÛÝĊÑĠƏō™гwȁ¥Ƨ°ŹÑķV™¼ÞêĊ»‚lĵšm¦ÅW@ĀôÈźaɜxÈbÞÆĶIОŘ"],"encodeOffsets":[[83824,41929]]}},{"type":"Feature","id":"659003","properties":{"name":"图木舒克市","cp":[79.1345,39.8749],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@VéVÇ™ţ°ğUĠ¯mk¯ó¥ķIġÿƏbƒ„ĉa±ÒĸĀlKU„_m»nwšŽ„m@ÈŤ¦ĉbÞ°±Þżł̦°ĢŁ"],"encodeOffsets":[[81496,40962]]}},{"type":"Feature","id":"659004","properties":{"name":"五家渠市","cp":[87.5391,44.3024],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@„çôÑlĕU»™¥ÝšUŗ™WkÛ@þVńÝĔ@ńÅþĶUX¦Æƒ"],"encodeOffsets":[[89674,45636]]}},{"type":"Feature","id":"659001","properties":{"name":"石河子市","cp":[86.0229,44.2914],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@lŁ—ǵm‚ĉ@mż™¼n°ÞmƼš@"],"encodeOffsets":[[88178,45529]]}}],"UTF8Encoding":true}; +define('echarts/util/mapData/geoJson/xin_jiang_geo',[],function() { + return {"type":"FeatureCollection","features":[{"type":"Feature","id":"6528","properties":{"name":"巴音郭楞蒙古自治州","cp":[88.1653,39.6002],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@˜@ÈÒĊanwŎV„™Ȯ¦ͪŃĢ„ÜōȂçČéƐżLɆóĊ‚ĊaʊŁ±¯²Um»ˌmÈ»V™ʠţWÑůǓ郙ôƑƒğÆīŎī@Ƿ™wô™˺LÞ¯ƨVǪуšĢ™ȘV°wĢŽôk°¯ƒ»΀@Ȃ»ĸŽǔ@΀ƒ͔ôôLɆó̐ÝɜLɲōͪƒƨóŤK@ī@IU܃ÛmȻţǩÝ˹ÛljťǓǫō@Ɲ²¯VçōKͿŁΗÇţ»ƽ™ɅƑLÓŏÅÅɱV@ÝĊU¯ÑĊĭÞLšÞŎJ±̃XȣˌōlƒUÈ¯ŎKÆƅ°™XÑܱnŗġV¯™óaUƒƧUōŁ„Ñ™±„çɲ¥lĉkğ°ƒk¥˜ƒnğţL¯ÝÝUƽĬ΁lķ°@„ō„XÿݯV»ŹLʉÞɱŤĉó°ÝJ™¦ÝKÝ£ţܙÈĉ@ƒxǩUċƑ@ky͓¹™`U²ĉVġ»ğa¯¥ť@ĉ™‚ó@ŻÛÛJƒw¯nó¯ġWƽʩķÝɛwĉĕݼȭÞķō@ó£Å΀ƑŽ¯ôȯÞ¯Ȱ™ÆōèĉXǼó@ݚnºƒĸ„ÞVƜĸȚUʶõˀĵĖɱŎÝĖVࢰӒѢ°˘nϚVˌ™ÈmɼĵŦW¤öʊõʔ@°ÈXVŽ™ènŎȁb¯ǫĉ„±Èğ`ġwōÔğ»mVVŽ„Ý¥ó@™ĸķô@ššbX„ĶmV²²`Þ_˜˜ɴbͪÈ°„ÞWĸÈŌmބškɲŽÈUÆ»n¼ǬVķĸźô¯°n¦ɄǜÈ"],"encodeOffsets":[[86986,44534]]}},{"type":"Feature","id":"6532","properties":{"name":"和田地区","cp":[81.167,36.9855],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@ƨ¥šèź٨ΘƑᩄbUࢯÞĕɲōĶĕöʿVʵķșUƛƒÝ„ķm¹Þ™ô@È»ĊWŎçšÅ°ȯȰÝ°óƒÆͿĉ»̽çnƒmɱĵƧºóU™™ƽ@±wóL¯°̻L±Æ¯Vƴķb¯VÇ¥ğ²Ǖbk¥ÇKlÅɱġ@у™óK@™ÇaÝXğţxĉČǫķê¯K@уaŹ„ƑKƒ¼¯Vóaónġw™óÞéU™ġbóĉğÇl¹™aUóğKW„Vůn›ÇŋƑ›ķnʇ»óxĉw™çÇ°Åw™°ċ„XŽ™„ób±ƒkÈÇJ—ƒm²ţx@ÒݎšŦǺn„ó¼n°ÇbUÒ±¼XĸĠłƽXmwĉºƒzÈÜmnxmx²ĖmҚbnŽƧêUºĊêÆVóĖóUĉ¼ÅĬƑ°ɆƆŻŚlłÞLš¼nĠƒ¼@ޙšÞź@ŎÞ°VšɄɴжϼِ͈Ŏ„"],"encodeOffsets":[[81293,39764]]}},{"type":"Feature","id":"6522","properties":{"name":"哈密地区","cp":[93.7793,42.9236],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@WnŐÆĶLĢ¦ţºź„lxÅĸƽŚ‚Ʉ—Į˜è@ô²ÞUĔƐńV°¯ĸX¦Ɛm̐bƒ»Ɇa΀šĢ™ƐLˤ™ȘÑnƒІljĸÿn¯ĶaŎ¯ĢĕȘ¯°΂œla¯¥™ǕǔwˤӱlťО̻nŻmɃĕċţUw°WUóƨÅţķ°ýV±óÅǓéʉ¯ƽŁƒéōǖȁÝƏůǕw˹ǫȗǓƧǕVý™é@ĬţLƧôͩ„ɱŎɛK̏ÞɅôóK@²@°ōؚ¼lŦ¯ŰóƜÛlV¼ķ¼ƒ°kȰ™Ű„ĠƒǬ™ŚÝŎmĖ`@ÇÜn„"],"encodeOffsets":[[93387,44539]]}},{"type":"Feature","id":"6529","properties":{"name":"阿克苏地区","cp":[82.9797,41.0229],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@VƚxˌŎÞŎƒ°n„ȂÒ°²VĊ¯VğƾˍǬƨÞÞKÈÞĊVźôɆÞĢèŌôWČ²ŤVÞĸʶbl‚¯ôn_VÆĸlmÞnVź_ĸ¼Ȯmǖ„šéĸW°°„ĸJ„kʠ¼Æw°¤ÈƒlxɆzČºĶI²ÆǔUš°ô@Þ¦‚ƒUnUĠ¼ŎÓĢxĠ_²ÇĊƒǬ°ŽȂamōšçUÇW@¯öʓõʉX£ĶťnɻšÇUˋmϙ¯˗ӑѡᩃaΗƒœɜ°xWƴUxɃÒˣ¤Ʌwğ„ʉōóÝŹ±°ȗ@¯„ƃ²¼","@@ō™гwȁ¥Ƨ°ŹÑķV™¼ÞêĊ»‚lĵšm¦ÅW@ĀôÈźaɜxÈbÞÆĶIОŘnIÇŃÛÝĊÑĠƏ"],"encodeOffsets":[[80022,41294],[83914,41474]]}},{"type":"Feature","id":"6543","properties":{"name":"阿勒泰地区","cp":[88.2971,47.0929],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@ɲˣĊIÈ¥‚ÅU±Ċýkō°ƒĉƽó»ĶƽXóʵʵ™ȯƑÅȁɅ¯ĉ@ÇሗK֛@@ˤV֜ʵрƒǬVĸƑŎ@ƆϯÑóŽķ@ʇ»ķ¦έmlÈĸĊX¼WźÛÞÝѸ‚ĢČþ„ĀĊôάVö¼ĊUƨ°°èŎČUÜƐóôVôôŽ²êȘlˌç°`n²ǬŽĊaš™ƒÛ°±kğmm»š@°ÝɆÛÅÇVaݍVm͔ğôÝÈb‚„@„ƒ™n¯š™ÜUĢÑĊ@źīżWŤÈǖWôŁÆI²ÓƨL@ŽĊX„mmÑÆ»ȰÑkƒĶō@ý°m—¯"],"encodeOffsets":[[92656,48460]]}},{"type":"Feature","id":"6531","properties":{"name":"喀什地区","cp":[77.168,37.8534],"childNum":13},"geometry":{"type":"Polygon","coordinates":["@@Č@°ƒĠ„ôÓô@Ŏĉ@Ƴĸ@Ť£ĢlVôWVóřXĉŤêÞ@ƐÒĢÑlèÈV@šĠIk°ÆŘ@ÈÈĀ@ǶťÒğ@š„@ÒĉlŻ_@šƧĖÅĬōÆ@bźÞnƒƒlVœÝĬšWƼʇ„ƒÝÅ@ÇÅÈwWóĉ±ğz‚ĬČƨƂÝIĉݯbÇÑĉƒ¯ʈV°xUŰĊ¤ƪ_ôÓɚI@lȚXȮ™ŎlɴȘ՘š„¦ɲÆʈ_ɴŽźŽôÞʊŎĠƒɆxˤ£ɄÑVwXƳ¯w›ɛŹ٧™çƧ¦ōƒُ͇еϻɃɳU™Ý¯@ōÝŹš™@݄»mğ™»ÝKkŁżřɅƅƒ¯ÆīĊ»ôVôĕÅUĉéV¹ƨém™anѱĕnwmwnÇۄyĉ¹ŹlŏkĵèķmōÞġKñÔċKÅèĉzƒŽ„ômxȗÿƿI@þÅČÝKÝ°@¼ÈVºš@ÅĢšÆUċłn„ÝÆǕČĵJm£ÝJ¦@ĊƒxV°ƏLċ¼ǩ™@™m@ÅĢómÇÆğ¹Çš™ÆšĖÞKšx„wô¦ÆÑÆL²ÆƾŽU„Ž±ŚÅŻĖ@ĬŤÈñ„@ǔÇx„Èǃ","@@VÇ™ţ°ğUĠ¯mk¯ó¥ķIġÿƏbƒ„ĉa±ÒĸĀlKU„_m»nwšŽ„m@ÈŤ¦ĉbÞ°±Þżł̦°ĢŁVé"],"encodeOffsets":[[76624,39196],[81507,40877]]}},{"type":"Feature","id":"6542","properties":{"name":"塔城地区","cp":[86.6272,45.8514],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@ήnĸ¥ʈ¼ĸ@ôϰÒ@ƅƒōUķƑǫʶпU֛܃LګK@΋ĸ@Æ£ÞġÅĠċšLV݄»™@Å»Ýnm¯š»nŻĊ@nķŃ@¯ómóÛÝǟ¯aÝóȭ¥ƒšōUmxĉbÇї@›bUº¯X¯ÆƧbVÒĉnǕw¯°ƑŽV„—ŽÇ@kx±Uƒšɱn™ŽÅKƒ„¯ƒĠǠU°ɜL@°ƒxnĬ‚ĀŋŎÇLƒŽğšϱÞέƜkôÅĀǕłƒĸĊŤUŰĢ°„¦ȂϰÜɨ°x@°żǠÆƈČVĠ»ČL°ÇšbĊÑ̐óÞlĶwބɆVÞwǬxǪţȼÜLŐĶˢ@","@@óKĵĀV͈ĉłƾNJÆŤƒzXl°ƒÆL²¼źŽôÈĢǔ™¦l„ô°ɜÞʊĠğŃm»ʵƳƑʝȗīV¥¯ĉ°Ñ@ŃÅI™»ĉmğn™ƒašƒċƨbš™Vğ—w›ġ¯@Uōa™ĉÝJğÑÆŎkŎÞĀlźƒ¦"],"encodeOffsets":[[87593,48184],[86884,45760]]}},{"type":"Feature","id":"6523","properties":{"name":"昌吉回族自治州","cp":[89.6814,44.4507],"childNum":7},"geometry":{"type":"MultiPolygon","coordinates":[["@@መL@È°ĊȂɆƒÆĊ£„ťôWÓɆbĢÅŎƒÆ¦ČÑW¥°ķU¯ƏŃVē±Ý@ó—ç˜ĭɃƾřÆķkwŹƒŤ¹ġ¥ĵKŏÅXmˍщwǓ¤Ƒ@wóōVķ£ɱšġôÛa±Òȁ„óèţIVŽƽ¼k¤ó¹ġJmx—»ÝUƒ²™@ÅƃĸǫŎ„ĊmŎǬ՘"],["@@Þô°bÞǠôÜôn@°ĸń˜Ƕkłƒ¼UޙKğȂÆÝĢŤķ@@ΌڬL܄K@ˣȂ˭lĉńW¥ĵVÆý@ŃÞēUŃȗƅ@ŹƩǕĉ»k»Ç™VğóřX™ŻKƏŽċêȁèÛŎġƒͩń"]],"encodeOffsets":[[[90113,46080]],[[87638,44579]]]}},{"type":"Feature","id":"6530","properties":{"name":"克孜勒苏柯尔克孜自治州","cp":[74.6301,39.5233],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@ˎǫĠƽ°UUĉ¯±ȁÑmƒ„¯Ýōˋō™wUű»ÅƑ°ƒȘ@²¯ɳʇ`ɱŃ¥՗™ɳȗōkȭšșW@kəJóÔƩ`ĉ£Vů¯wU°ʇĊ„ÈÒ°aĊÞÞJŁċƧīĠyĊ²XôÇxÈÆÆ@„ÞʈƒÅ»™XÞīU›Ƒkm„ŹÝ@aŎÅÆīƨĕ@™ż`Ċk@љƒĠ@ŦÑ@ǵÇÿ@ÇÅŗl¯ğJ@™ÇUkçġÒƏÑÝ@ţéWĊôŚUŽóXUġkţ¤ķ@@ƴōĊó@óÔğƒ¯„ċ@@Қ¤kôˣŰ͓„k»ƒKX¯ċwƧôğɐšÒôIVƙš¯UķǬķšnŽ™¼ôb°ÒȰVVÈÞ°ƒĸó¤V¼°„V°²êƒlĢ҂Uƨ¦ôȰƴĊVV¼ǖIċĊ„ÞɜéšnČW˸Ǹša„řÈw±īšçĸ¤ĊšôšwšŽĸUĢ¦˜éǖĬ„Āô¼lÞkÒ°x°ƆÞx„šÆV²ǔ»„b°wގȘ¥°n„šŎV@°„„ʠè‚ŰȂb"],"encodeOffsets":[[80269,42396]]}},{"type":"Feature","id":"6521","properties":{"name":"吐鲁番地区","cp":[89.6375,42.4127],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@ôK„ĉǪa²¼lÜô@ʠê°Ĭ™ôȂƒ²ÑÜbĢóɲ™ĸ¤ŎUô@xƒŽǔ£ъxˎmƒÈÛ@‚_nĕÞōšř„ǫƒğšůlȯ„¯ĸ»U»Ükôƛ°ůkť™»Ŏŗ@¯@±͓óͿ„Ǔ@ķȁ¼Ϳ@Ƒ¼¯°ólġ¯xȗUġšƑ™ǩÒƧUÝ°˹Kóššx@ǸōĬÅĬƑĠ󃄚ǔêÆ°XÒʟŤUšÇ¼ˋnn¼±V²°ȂUŌݜbʟǔɅô@żǬaҎÈ"],"encodeOffsets":[[90248,44371]]}},{"type":"Feature","id":"6540","properties":{"name":"伊犁哈萨克自治州","cp":[82.5513,43.5498],"childNum":10},"geometry":{"type":"MultiPolygon","coordinates":[["@@ĉ„ÆŘȁ̐mÞ¯ĀX°±¼@ƾ¯ƴ°ŎÝþŋ¦WÜÞbȂĉźUœÇmwVUȂóô@ȰÝ΀nÆJn™ƾ™ʠ™ŌLČóǪ¯œ¥ǔaǖšŌaôÝĢLšx„ƒÆLšɲm„™²VlwÈ@˜Uƒƒ°¯ǖxĊmUÑƨa°Å°WV¹œa›ÇɃÈm¥°¯ŹóĸķǫUm»Å¼ÇVɱ™l݃ŋnķÇÝX¯ƒͩÇɳa——Ý`±_U±ĵnWƒ™a@™ĸóšķ™¯ǓV±ÅĵJċ¹ɅykwDŽ¯£Åxʟ»ƒlķI¯ƒX¯ķ‚™êǕƒȭnķ»Ź`±„kÞ@Žš„Ýô@Þ°xšŤŎIƨÆUxōš¯²ǔĬǬlUŚ"],["@@ÞĀlźƒ¦¯ĸŤKޙšƒċƨbš™Vğ—w›ġ¯@ţƽJ"]],"encodeOffsets":[[[82722,44337]],[[86817,45456]]]}},{"type":"Feature","id":"6527","properties":{"name":"博尔塔拉蒙古自治州","cp":[81.8481,44.6979],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@ήƛϲÝĠ™„ÈKŌōÿmī„w@¯ɛKV¯ğǟ°Ƒ™wġKóÞŋbǕ™Ǔb›¦ǩ°ċôŋKʟšƽšmšÅImŽͿŽȯÞó@ȁôUVnx›ÈŹVȁĊÝabŻ£¯°l„óxȂŤĸkĊšÞyĊêĊmĢxV„ƨÈŽĠX„ŽΘÆĠÔź‚Ɇţ°LXƾŤŤb"],"encodeOffsets":[[84555,46311]]}},{"type":"Feature","id":"6501","properties":{"name":"乌鲁木齐市","cp":[87.9236,43.5883],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@šŽWŽôŚUĠȚl¼Ċ¼ƪǖ@źȘƆ@ýlܚXVŘޙš¦V¼kĖó҃èkĊȁˮ֜@ǫ՗nōƒĉǬō„ķÆŚ@„±ÞV˜¼nwĢIôºl£ƾ»UŤJôçšó¯īʟéó@kÛ±»ǩbƒĊóLҍÇǫb@ŻɆóʠǓ›aŋÞȁVʉłĉbĉɅô"],"encodeOffsets":[[88887,44146]]}},{"type":"Feature","id":"6502","properties":{"name":"克拉玛依市","cp":[85.2869,45.5054],"childNum":2},"geometry":{"type":"MultiPolygon","coordinates":[["@@ɜÞʊĊýVaŃm»ʵƳƑʝȗīV¥¯ĉ°Ñ@ŃÅI™»ĉmğn™ƒaݚţL°ķóKĵĀV͈ĉłƾNJÆŤƒzXl°ƒÆL²¼źŽôÈĢǔ™¦l„ô°"],["@@ƾIŤ@UUwōa™ĉÝJğÑÆŎkŎ"]],"encodeOffsets":[[[87424,47245]],[[86817,45456]]]}},{"type":"Feature","id":"659002","properties":{"name":"阿拉尔市","cp":[81.2769,40.6549],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@nIÇŃÛÝĊÑĠƏō™гwȁ¥Ƨ°ŹÑķV™¼ÞêĊ»‚lĵšm¦ÅW@ĀôÈźaɜxÈbÞÆĶIОŘ"],"encodeOffsets":[[83824,41929]]}},{"type":"Feature","id":"659003","properties":{"name":"图木舒克市","cp":[79.1345,39.8749],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@VéVÇ™ţ°ğUĠ¯mk¯ó¥ķIġÿƏbƒ„ĉa±ÒĸĀlKU„_m»nwšŽ„m@ÈŤ¦ĉbÞ°±Þżł̦°ĢŁ"],"encodeOffsets":[[81496,40962]]}},{"type":"Feature","id":"659004","properties":{"name":"五家渠市","cp":[87.5391,44.3024],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@„çôÑlĕU»™¥ÝšUŗ™WkÛ@þVńÝĔ@ńÅþĶUX¦Æƒ"],"encodeOffsets":[[89674,45636]]}},{"type":"Feature","id":"659001","properties":{"name":"石河子市","cp":[86.0229,44.2914],"childNum":1},"geometry":{"type":"Polygon","coordinates":["@@lŁ—ǵm‚ĉ@mż™¼n°ÞmƼš@"],"encodeOffsets":[[88178,45529]]}}],"UTF8Encoding":true}; }); -define('echarts/util/mapData/geoJson/xi_zang_geo',[],function() { - return {"type":"FeatureCollection","features":[{"type":"Feature","id":"5424","properties":{"name":"那曲地区","cp":[88.1982,33.3215],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@ƨʔĸbܺÞwnxźbÞ°ô@„ĶŽĸIȼĊJŎÈôUšÝƒ¤ǔLސŎ@ĢŽȘblƒôL„ÇźçȤôLš¥ÞIÞ¯Ķxʊťƨ™ƿÑĉXVķŦ¯ȂKÇǕšÑ¯IUš£¯Óƿ£VĕōÞÿÆwƒƑ„£ǖxÞĕ±ÇÝaUÑȃU¯‚UōÈ݃wWŁĵ™±Ý„óĢÿ°IÞ±mÅĢ¯mÿ„¥°UnÑŤĢĕĶwǬŻͪwŎ¼źÇĢ„ĠĕˎŁ°óƨ¼Èa‚m@¥°wǔ„ǖ°ŽƨÇŤœšġƨ„ŎŃôbÈÛŎĊ°@Ġw²ÑÞJƃÆb²ƒ°êĊUނlȲƒV„ÈKĊÒĸĉ›»ÅôťUÅǃk¯@ǂÑklǁÅl™Ģ™VÑóƒ@°@„ÛĸƒV¯ƒÇĊ™n¯Uĕšƽ¯m›¯b™È@Ò°Ĭƒbĵ›¼„‚kxķýÇJk£ÝaUÑÅóĶǟkÓʉnĉƒÝ¼Ƒ„ó»Þmn£m™Č¯@ƒȮÿV¯ĸƒ™k@Ýówƒ»ğ„ġ±ǓLō„ƒšV¼Əèķĉ™è±b@Òţ„UÑóakƒl£™Ó@¯L@™ÇlUóȁš¯aġÈÅĕÝLķ¯Ė¯@WĬ—x‚ÒÈnW°ţôU²ǓÓġ²V°¯ôƒǔÝL—ċšk™š»Ý»Ýš¯ÞƒVƒwۄÝÇōͩÈĉċ»ĉm¯£W¥ţKkóġƏW@¯±kōŽÈ›b@җšÇaƒÆ¯a™„ƒkóŽÛƒÇ¦Ýa¯šÝ™ĉ@ǻۄmƒǓxķƛ¯lVĀÅÞġb™™ÇJUÅV™ĖƑW™zō»ōšƒW™n@è¯ÞóVkwƩnkźÇބҙޯƒƒýğÇUxÆÈnè±bĉÝ»ÈуwšwÞ@m»ÈV@ýÇ°ķ™xƒa„ݯXċ¥ƒÈóW@ôkxlnxVÈóĊkŤġ¼@°¯ŰƑL̻۱ŎÝV—Þ›VƒÇÞŎÇakƞ‚š@èğŎĸżšƾ°ÒšLÞôĠKȰĖźVÈÒĠ„¤™VôšŽU„ÈþťL@ôǬÞlÜÈnÇÒUŚ™@šĊƨW°™°Xƒ‚@ČÇþ„ƴĉÒķ¦@ŽĢôWĀôłUÞĢǬ™ź°¼š@ƒôV°„bUÆnzm¤ƽĸƒÈ"],"encodeOffsets":[[88133,36721]]}},{"type":"Feature","id":"5425","properties":{"name":"阿里地区","cp":[82.3645,32.7667],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@„Çƾķn£myVŃaU¯„ó™@¯»šŹġǫVÝóŁXÿġó@ĸ¥ĊуƳÈý@ċ„Wš¯X¯ĉƧ‚™š@VřÈÑÇmkÛǫÝ@óŦKÇýVƒ™U󚏃£ğÇÑŹUȯĕğLÝó™K¯Ñ™ƽķŻĠō@灙lƝÈbƍÈ݂„œU˜ÝÞU²ō̼ůƒK°ů@¯UK±—ĊƧbōÇmçÈġƒóšÅób™™źóš¥kīƯól™ç™KôĵUƒÅ„VŃķ¥nÅŏm¯¹Å‚™»@ÑǍóxÝkʇȤU¤ķb@ƒ¯ĊÇx¯ĸĉKm°šĀk¦l„„KnĬȀƾÛ¦WÆŐmNJĉ°ōUţ¤UšŎ°šŎKÞłÆ„Ǔ¦ƒÞ™‚™„ř¯bmUÝl¯Um™ğl¯£șwŎǫaÝnĉĶƒk@¯™K™šō»ĉn™aÞ»ťnkml™ĸ¥UŚŻkÑťƒĉV™ôó°LôīĠU„ÿĉǕÅz±Kƒ¤„²ō¤¯Ė¯UÝ¥Vĵ™óÈťÝwķșÑk¤ó„™ƒWýĵĕ™„VĠƒV󍃎Ǔ„ķ°k±VU±ţ¦UǟÝřJVљ¥XUċUŎlÛƆǕÆȗƆ¯wŏÞÅ@™šĉl݁óŽƒÒ™nUôńlxólÝôێ±™™LÛôÝL@‚ġ¯X¯ÇUżóa󤛼XÒġŎóLk¦‚ôżĸĠ™¼™KġƆô¦„ÆƑÔĉĶ¯ImÒ°¦n°¯Þl˜ÝČn„ƒÒšKĠޚĕkƒlýƾťœšôI‚ĖŤÒnƜm¼¯lnżóÞ@Ůó¦™ôƽĖċŚn°Ý°ôÈUƜƒblÞóŽ@Žǖô°UÈƆ°X„þôŽô‚lѢšŽ²Ėm¦°š@¤™XŽĊblܚzkºƒĖmX„šŎWVšóÞn°lĠxȚa°»żLźƒ„b@Æ°XĠÝȚxĊĕŤaȚ‚°È@„„@èŤ¦Ü¼œW˜ÞkŽÈ@V°lŤkŎ±²¦ƐUšlj°aÈÑŎbĢƒŎbÆ¥ÞIȘlššôVÈU‚™šb„kɲĶn„mnXb̼òƾĖŎ@ĢȂÑôÓĠĖʊšĊÔ"],"encodeOffsets":[[88133,36721]]}},{"type":"Feature","id":"5423","properties":{"name":"日喀则地区","cp":[86.2427,29.5093],"childNum":18},"geometry":{"type":"Polygon","coordinates":["@@ĶĖXþš„ôƒl£šÒĸÇÞxÇŦšôUĶÞ¦°V°ĕŎ£ƒ±„£²LÆyĊǖƒĀğVóĬ¯KóôUš‚ĊŦ„lҙżVÆķ¦kšlnŦmݼšbĊmŎ¼š™šL@°„lĊĵÞmǬbƍȚx°¤Ġknš°VÞkVn°aƒŚš‚š„Ýǔ¥ÅƒÝŁōL¯™ōV™Ť£ŎVĊ¯nljƏXÅÜ¥ǿƽmīƒLkƒl¥™ÿn¯ĊL°ķÈw°ĉ@ƑĸaV£ʈȣÞlôwȎ@Қ¼Æ°ºŐnmÆĸ¦UńƃV„óĶšLšèôkÅ°lĬ™¦Źôššôa™Æ„ôÇĢnèŎÈƨa˜ĉ²‚VLĢ»lţôĉUǂwkmlw@óôX„ÇȦ°WƒÞ„b‚wĸšÈ¯@þÇUn¼Ý@™x„xÇńÞ¼ĊŽ²amçÅÇVwĠȄþ°„šÝƒÑÈÝlŹƪmlxôU°Ý@çšm„XŎ™Ŏ¼šyƒXšĕÆUVÈIššĢaÆÝUÿ°kĸƜǔwn„܃ȼĊ@ޚ°™Þbȥ܄ô„lšƒ°b„ÅÈb˜™@ќa‚ǯUU¯Vġš»ƒ™¯aV¯Ç°Å™mnÑŤçǬVǬ™±ĉ¯¥Vĕ¯Ýk£˜ō—w@±ġÛ°ÇVїƒ@ۘa@ČL™Ƴ™„ƒÇa¯¤ÝIĵ¼U¥ƿōķÅţŻókÝóĕ‚¥¯™U»Æ£X¯ġŃÛkÝ°V°ó¼¯èWôÞĖ„ȎƒŽkĀƧĀówm¥¯JŹÝJݙōVVŁaݐƑ@ƒ˜ğŭǂ¯_ƒ˜ĵ—›VnxŃón›ƒĵxÇĖĉVÝÈğV™Ò󃯐±Żĉ£ķÆÅL™Ljĉý˜ţۃ¯VƒnV¤ÝÈ@°ÅÞݤ™ŰğŁm¦ÝxóKƒ¥ɱÈUĠôêVôÛ¼ÇWÝçĵaō¦óĖƧlÇĢƑŽnŎDŽV¼¼‚ºÛ@m¦ƽ„ĉmm¯ÝKÛç¯bŏłĬ™bƒ¼ÅLmŽ„xť°ÅU™šÝXkŽÝmĉ¦W„¯K„ÒknÝaV„Ýè¯KɅńÝKnÞ¯¼"],"encodeOffsets":[[84117,30927]]}},{"type":"Feature","id":"5426","properties":{"name":"林芝地区","cp":[95.4602,29.1138],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@‚VÈłVôÈk@š°K@ŽšÔk¤l„ôbVÒŤƒ@ѲašçĸĊƐçU»„™ŎƒǔKĢ²Ġƒ„¼ôx@ޚlƨĬ„Ul¯ÈLV‚šÞJ„°Ünʊ„wÜbXê‚VÞ¯°ššanaU°wƼɴÑWÑ°mÈýÈam¥Þ£Ť@„¥ôblÞĢ„ź¥ôxÈÅmݚ™ƒĕŃV»ĉōŤōnóƒ»ÈīķIUƒĠÑ°ġĸLÞ¯VÒƂ@Ābš¼WôÈ@V¼ôóŤKÈÑU»šwVǫżnWÒÈx™¼‚lŦ£ĊōŤx²¯@ƒÆƒU¯šçÆ@„¤°£„é°k°lšůÈó@¯ŤÇÈĉƒkkÿó¥ÝXķљÜ@ÒóŚÝ¯°ĉówÇ±¦ÅJUÒĉĀķw¯°mĖ¯„±akxÝÅnƒ™»lуK@¯lU™¯UVѯóĊ¯mōğVǓƅƒÞƒWÝÈÛ@ƿô¯ÜġzÅþ¯ólmôʇġĊÅUͿřŏȁˋŁóÇˡōƧƒÇb™w°Ķôk¦šÒƒnUþġҙÔkǔķèó@ƒ²@ŘōńĵyƒzġaݤÅIƒ¤Ƀť¦ğѯ¤ķbóš¯ó±ŽU²°¤ČÜVnÈƂ„ŚŎ°ôĢ„þÆzèVĀǎĀǘƒXŹÑ¯¤ówċķk¦šłUÒġzÇ@ƒ™ÆÝx@²Þ@Ƥ„Uô¦Uš°x„U"],"encodeOffsets":[[94737,30809]]}},{"type":"Feature","id":"5421","properties":{"name":"昌都地区","cp":[97.0203,30.7068],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@™ŽVĖm°ĉš„ÈU°ķ„ƒÜ¯@@ô„UÒġškš‚ÆkÈlŽÒ@Èl°È„VÆóŦƂœ¼‚a„ÅĢ™Ʉwnōw@¥Ŏ¦°ŹÞmVš°wnÿƒw„wÝw@¯šmÞŗ°wĠ˜ĸkÞğlĔ²¦°@„ĕĸwVóšal@nĢÇĊn°@¦šŽźUXçǔůĸVš™ÆK„ÈÝĠš²ÅĔô@lšŽÈ_m˜„zǖl„šaU¼ôwV°¯¦‚ĬÈa„l@Čǎ„¼™„nŽ˜I„xô»ɜ@ƨ¥ɆŁ„ŃǪȁkƛƨȍʊȡóĭ›@—ÈÇVƒůރĸƅmēƨť™ÅÈʉVǵ°ġVŭÅɧ°ÿnɛš£mƒķ²ŃóÑUĉ°mÇ»¯@mxUĀ¯èţ°ȁÝç„ġU¯ÆÇţÈ@°Çô™Ű¯k¯lƒê¯¤ƒ£Å@™èV°Å„@„±°ţwĉŎť¤kš»ÇwXÑŻmUǬ™xV¼ÇÒţLóôU»Ç@X󙻂a@ÿŁUÑÝ°ķK¯ĢğÒV„ĸJÇĬ„¼môţŎĊŎU¼Æ„„Ė™šnÞÇÆówŹ¦ġƒkÝóaƒ¦ţ@ݤn¦ÇbÇþ¯nXÒɳÒÅ»¯xVmb™b¯™Ý°UWéÛaƒxʉÛmƒ¯ÝI™‚UÇKk°ƒVƧīķ„U°ȭĀ@„ċ°nšm¤Ýnô¼ƒƒÞ»Ċ„ʊmlÔĵǠÆôVÒÞbl¤ÈIĸþlwƒœ»ĶŽ„a¯ī@њǰanœƾ°"],"encodeOffsets":[[97302,31917]]}},{"type":"Feature","id":"5422","properties":{"name":"山南地区","cp":[92.2083,28.3392],"childNum":12},"geometry":{"type":"Polygon","coordinates":["@@°ÞUĖ°¦²ĊôÇÜLǖĀɜŽȘŰÞLĸźêÞ@UÜUŤ°ɞ¯Ü„°WŦĀmŎ„¦ĢyVљŁl¥Čĸôx°£źÒ„Wȗ‚ÿȍUÿ‚çÅyƒýóġō¯ƒřŁmÇÛUċŽ¯£V±²°ôô™ĸa°£ĠÒŦ¥ɄŽ„£ÆJÞ£Ģb„yĶzŎŃ@ŗ„±ô@ĸçlǓšÓĢÑVý„m™Ñl¥ĵó‚¯̻̥™ƛǫÝһÇƧĉyţ¼ҍēVĶĉŎ°ĸmšÞVÝĸ™ÒÛaċ„ó™ŹĖƒèÈÈl¼k¤ÝX@`ސŏ¼Æō¼ÇçĉKUÝÝ£ğ¤@¦ġl¯Òġĉ¯óš™móxÝÞğVšƴċK@—b@ܘ„UÒ¯ÈĢÜ@²˜x—Ŏl¤"],"encodeOffsets":[[92363,29672]]}},{"type":"Feature","id":"5401","properties":{"name":"拉萨市","cp":[91.1865,30.1465],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@Ŏ²l@°‚XĢƐlôŤLX¦°¤ĊnČ¼ÇĊŎͪÞÈ܃„x„U°Ýޙ޼™¼lšČ™˜ŽÞK„Ǔ°óU¯Ģ±ǔÔV±ŤóX¯ÇmÑ˜wXī°@°ĕĸÞKÆĖĢÇ°bȂ™ÇŁUƒV¯wV™ó¥ƒVÅ£Ý@@±ÞwšÅ‚„È@ƒ¥nōťÿ¯Xۃɝ°ţ¯ÛVVÝ@ŹéķÝKȗůɛǕÿÛKóÈǫšǫUţèmҚn¯Æ°ÈU‚°b„š™¼UĢV°°V"],"encodeOffsets":[[92059,30696]]}}],"UTF8Encoding":true}; +define('echarts/util/mapData/geoJson/xi_zang_geo',[],function() { + return {"type":"FeatureCollection","features":[{"type":"Feature","id":"5424","properties":{"name":"那曲地区","cp":[88.1982,33.3215],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@ƨʔĸbܺÞwnxźbÞ°ô@„ĶŽĸIȼĊJŎÈôUšÝƒ¤ǔLސŎ@ĢŽȘblƒôL„ÇźçȤôLš¥ÞIÞ¯Ķxʊťƨ™ƿÑĉXVķŦ¯ȂKÇǕšÑ¯IUš£¯Óƿ£VĕōÞÿÆwƒƑ„£ǖxÞĕ±ÇÝaUÑȃU¯‚UōÈ݃wWŁĵ™±Ý„óĢÿ°IÞ±mÅĢ¯mÿ„¥°UnÑŤĢĕĶwǬŻͪwŎ¼źÇĢ„ĠĕˎŁ°óƨ¼Èa‚m@¥°wǔ„ǖ°ŽƨÇŤœšġƨ„ŎŃôbÈÛŎĊ°@Ġw²ÑÞJƃÆb²ƒ°êĊUނlȲƒV„ÈKĊÒĸĉ›»ÅôťUÅǃk¯@ǂÑklǁÅl™Ģ™VÑóƒ@°@„ÛĸƒV¯ƒÇĊ™n¯Uĕšƽ¯m›¯b™È@Ò°Ĭƒbĵ›¼„‚kxķýÇJk£ÝaUÑÅóĶǟkÓʉnĉƒÝ¼Ƒ„ó»Þmn£m™Č¯@ƒȮÿV¯ĸƒ™k@Ýówƒ»ğ„ġ±ǓLō„ƒšV¼Əèķĉ™è±b@Òţ„UÑóakƒl£™Ó@¯L@™ÇlUóȁš¯aġÈÅĕÝLķ¯Ė¯@WĬ—x‚ÒÈnW°ţôU²ǓÓġ²V°¯ôƒǔÝL—ċšk™š»Ý»Ýš¯ÞƒVƒwۄÝÇōͩÈĉċ»ĉm¯£W¥ţKkóġƏW@¯±kōŽÈ›b@җšÇaƒÆ¯a™„ƒkóŽÛƒÇ¦Ýa¯šÝ™ĉ@ǻۄmƒǓxķƛ¯lVĀÅÞġb™™ÇJUÅV™ĖƑW™zō»ōšƒW™n@è¯ÞóVkwƩnkźÇބҙޯƒƒýğÇUxÆÈnè±bĉÝ»ÈуwšwÞ@m»ÈV@ýÇ°ķ™xƒa„ݯXċ¥ƒÈóW@ôkxlnxVÈóĊkŤġ¼@°¯ŰƑL̻۱ŎÝV—Þ›VƒÇÞŎÇakƞ‚š@èğŎĸżšƾ°ÒšLÞôĠKȰĖźVÈÒĠ„¤™VôšŽU„ÈþťL@ôǬÞlÜÈnÇÒUŚ™@šĊƨW°™°Xƒ‚@ČÇþ„ƴĉÒķ¦@ŽĢôWĀôłUÞĢǬ™ź°¼š@ƒôV°„bUÆnzm¤ƽĸƒÈ"],"encodeOffsets":[[88133,36721]]}},{"type":"Feature","id":"5425","properties":{"name":"阿里地区","cp":[82.3645,32.7667],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@„Çƾķn£myVŃaU¯„ó™@¯»šŹġǫVÝóŁXÿġó@ĸ¥ĊуƳÈý@ċ„Wš¯X¯ĉƧ‚™š@VřÈÑÇmkÛǫÝ@óŦKÇýVƒ™U󚏃£ğÇÑŹUȯĕğLÝó™K¯Ñ™ƽķŻĠō@灙lƝÈbƍÈ݂„œU˜ÝÞU²ō̼ůƒK°ů@¯UK±—ĊƧbōÇmçÈġƒóšÅób™™źóš¥kīƯól™ç™KôĵUƒÅ„VŃķ¥nÅŏm¯¹Å‚™»@ÑǍóxÝkʇȤU¤ķb@ƒ¯ĊÇx¯ĸĉKm°šĀk¦l„„KnĬȀƾÛ¦WÆŐmNJĉ°ōUţ¤UšŎ°šŎKÞłÆ„Ǔ¦ƒÞ™‚™„ř¯bmUÝl¯Um™ğl¯£șwŎǫaÝnĉĶƒk@¯™K™šō»ĉn™aÞ»ťnkml™ĸ¥UŚŻkÑťƒĉV™ôó°LôīĠU„ÿĉǕÅz±Kƒ¤„²ō¤¯Ė¯UÝ¥Vĵ™óÈťÝwķșÑk¤ó„™ƒWýĵĕ™„VĠƒV󍃎Ǔ„ķ°k±VU±ţ¦UǟÝřJVљ¥XUċUŎlÛƆǕÆȗƆ¯wŏÞÅ@™šĉl݁óŽƒÒ™nUôńlxólÝôێ±™™LÛôÝL@‚ġ¯X¯ÇUżóa󤛼XÒġŎóLk¦‚ôżĸĠ™¼™KġƆô¦„ÆƑÔĉĶ¯ImÒ°¦n°¯Þl˜ÝČn„ƒÒšKĠޚĕkƒlýƾťœšôI‚ĖŤÒnƜm¼¯lnżóÞ@Ůó¦™ôƽĖċŚn°Ý°ôÈUƜƒblÞóŽ@Žǖô°UÈƆ°X„þôŽô‚lѢšŽ²Ėm¦°š@¤™XŽĊblܚzkºƒĖmX„šŎWVšóÞn°lĠxȚa°»żLźƒ„b@Æ°XĠÝȚxĊĕŤaȚ‚°È@„„@èŤ¦Ü¼œW˜ÞkŽÈ@V°lŤkŎ±²¦ƐUšlj°aÈÑŎbĢƒŎbÆ¥ÞIȘlššôVÈU‚™šb„kɲĶn„mnXb̼òƾĖŎ@ĢȂÑôÓĠĖʊšĊÔ"],"encodeOffsets":[[88133,36721]]}},{"type":"Feature","id":"5423","properties":{"name":"日喀则地区","cp":[86.2427,29.5093],"childNum":18},"geometry":{"type":"Polygon","coordinates":["@@ĶĖXþš„ôƒl£šÒĸÇÞxÇŦšôUĶÞ¦°V°ĕŎ£ƒ±„£²LÆyĊǖƒĀğVóĬ¯KóôUš‚ĊŦ„lҙżVÆķ¦kšlnŦmݼšbĊmŎ¼š™šL@°„lĊĵÞmǬbƍȚx°¤Ġknš°VÞkVn°aƒŚš‚š„Ýǔ¥ÅƒÝŁōL¯™ōV™Ť£ŎVĊ¯nljƏXÅÜ¥ǿƽmīƒLkƒl¥™ÿn¯ĊL°ķÈw°ĉ@ƑĸaV£ʈȣÞlôwȎ@Қ¼Æ°ºŐnmÆĸ¦UńƃV„óĶšLšèôkÅ°lĬ™¦Źôššôa™Æ„ôÇĢnèŎÈƨa˜ĉ²‚VLĢ»lţôĉUǂwkmlw@óôX„ÇȦ°WƒÞ„b‚wĸšÈ¯@þÇUn¼Ý@™x„xÇńÞ¼ĊŽ²amçÅÇVwĠȄþ°„šÝƒÑÈÝlŹƪmlxôU°Ý@çšm„XŎ™Ŏ¼šyƒXšĕÆUVÈIššĢaÆÝUÿ°kĸƜǔwn„܃ȼĊ@ޚ°™Þbȥ܄ô„lšƒ°b„ÅÈb˜™@ќa‚ǯUU¯Vġš»ƒ™¯aV¯Ç°Å™mnÑŤçǬVǬ™±ĉ¯¥Vĕ¯Ýk£˜ō—w@±ġÛ°ÇVїƒ@ۘa@ČL™Ƴ™„ƒÇa¯¤ÝIĵ¼U¥ƿōķÅţŻókÝóĕ‚¥¯™U»Æ£X¯ġŃÛkÝ°V°ó¼¯èWôÞĖ„ȎƒŽkĀƧĀówm¥¯JŹÝJݙōVVŁaݐƑ@ƒ˜ğŭǂ¯_ƒ˜ĵ—›VnxŃón›ƒĵxÇĖĉVÝÈğV™Ò󃯐±Żĉ£ķÆÅL™Ljĉý˜ţۃ¯VƒnV¤ÝÈ@°ÅÞݤ™ŰğŁm¦ÝxóKƒ¥ɱÈUĠôêVôÛ¼ÇWÝçĵaō¦óĖƧlÇĢƑŽnŎDŽV¼¼‚ºÛ@m¦ƽ„ĉmm¯ÝKÛç¯bŏłĬ™bƒ¼ÅLmŽ„xť°ÅU™šÝXkŽÝmĉ¦W„¯K„ÒknÝaV„Ýè¯KɅńÝKnÞ¯¼"],"encodeOffsets":[[84117,30927]]}},{"type":"Feature","id":"5426","properties":{"name":"林芝地区","cp":[95.4602,29.1138],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@‚VÈłVôÈk@š°K@ŽšÔk¤l„ôbVÒŤƒ@ѲašçĸĊƐçU»„™ŎƒǔKĢ²Ġƒ„¼ôx@ޚlƨĬ„Ul¯ÈLV‚šÞJ„°Ünʊ„wÜbXê‚VÞ¯°ššanaU°wƼɴÑWÑ°mÈýÈam¥Þ£Ť@„¥ôblÞĢ„ź¥ôxÈÅmݚ™ƒĕŃV»ĉōŤōnóƒ»ÈīķIUƒĠÑ°ġĸLÞ¯VÒƂ@Ābš¼WôÈ@V¼ôóŤKÈÑU»šwVǫżnWÒÈx™¼‚lŦ£ĊōŤx²¯@ƒÆƒU¯šçÆ@„¤°£„é°k°lšůÈó@¯ŤÇÈĉƒkkÿó¥ÝXķљÜ@ÒóŚÝ¯°ĉówÇ±¦ÅJUÒĉĀķw¯°mĖ¯„±akxÝÅnƒ™»lуK@¯lU™¯UVѯóĊ¯mōğVǓƅƒÞƒWÝÈÛ@ƿô¯ÜġzÅþ¯ólmôʇġĊÅUͿřŏȁˋŁóÇˡōƧƒÇb™w°Ķôk¦šÒƒnUþġҙÔkǔķèó@ƒ²@ŘōńĵyƒzġaݤÅIƒ¤Ƀť¦ğѯ¤ķbóš¯ó±ŽU²°¤ČÜVnÈƂ„ŚŎ°ôĢ„þÆzèVĀǎĀǘƒXŹÑ¯¤ówċķk¦šłUÒġzÇ@ƒ™ÆÝx@²Þ@Ƥ„Uô¦Uš°x„U"],"encodeOffsets":[[94737,30809]]}},{"type":"Feature","id":"5421","properties":{"name":"昌都地区","cp":[97.0203,30.7068],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@™ŽVĖm°ĉš„ÈU°ķ„ƒÜ¯@@ô„UÒġškš‚ÆkÈlŽÒ@Èl°È„VÆóŦƂœ¼‚a„ÅĢ™Ʉwnōw@¥Ŏ¦°ŹÞmVš°wnÿƒw„wÝw@¯šmÞŗ°wĠ˜ĸkÞğlĔ²¦°@„ĕĸwVóšal@nĢÇĊn°@¦šŽźUXçǔůĸVš™ÆK„ÈÝĠš²ÅĔô@lšŽÈ_m˜„zǖl„šaU¼ôwV°¯¦‚ĬÈa„l@Čǎ„¼™„nŽ˜I„xô»ɜ@ƨ¥ɆŁ„ŃǪȁkƛƨȍʊȡóĭ›@—ÈÇVƒůރĸƅmēƨť™ÅÈʉVǵ°ġVŭÅɧ°ÿnɛš£mƒķ²ŃóÑUĉ°mÇ»¯@mxUĀ¯èţ°ȁÝç„ġU¯ÆÇţÈ@°Çô™Ű¯k¯lƒê¯¤ƒ£Å@™èV°Å„@„±°ţwĉŎť¤kš»ÇwXÑŻmUǬ™xV¼ÇÒţLóôU»Ç@X󙻂a@ÿŁUÑÝ°ķK¯ĢğÒV„ĸJÇĬ„¼môţŎĊŎU¼Æ„„Ė™šnÞÇÆówŹ¦ġƒkÝóaƒ¦ţ@ݤn¦ÇbÇþ¯nXÒɳÒÅ»¯xVmb™b¯™Ý°UWéÛaƒxʉÛmƒ¯ÝI™‚UÇKk°ƒVƧīķ„U°ȭĀ@„ċ°nšm¤Ýnô¼ƒƒÞ»Ċ„ʊmlÔĵǠÆôVÒÞbl¤ÈIĸþlwƒœ»ĶŽ„a¯ī@њǰanœƾ°"],"encodeOffsets":[[97302,31917]]}},{"type":"Feature","id":"5422","properties":{"name":"山南地区","cp":[92.2083,28.3392],"childNum":12},"geometry":{"type":"Polygon","coordinates":["@@°ÞUĖ°¦²ĊôÇÜLǖĀɜŽȘŰÞLĸźêÞ@UÜUŤ°ɞ¯Ü„°WŦĀmŎ„¦ĢyVљŁl¥Čĸôx°£źÒ„Wȗ‚ÿȍUÿ‚çÅyƒýóġō¯ƒřŁmÇÛUċŽ¯£V±²°ôô™ĸa°£ĠÒŦ¥ɄŽ„£ÆJÞ£Ģb„yĶzŎŃ@ŗ„±ô@ĸçlǓšÓĢÑVý„m™Ñl¥ĵó‚¯̻̥™ƛǫÝһÇƧĉyţ¼ҍēVĶĉŎ°ĸmšÞVÝĸ™ÒÛaċ„ó™ŹĖƒèÈÈl¼k¤ÝX@`ސŏ¼Æō¼ÇçĉKUÝÝ£ğ¤@¦ġl¯Òġĉ¯óš™móxÝÞğVšƴċK@—b@ܘ„UÒ¯ÈĢÜ@²˜x—Ŏl¤"],"encodeOffsets":[[92363,29672]]}},{"type":"Feature","id":"5401","properties":{"name":"拉萨市","cp":[91.1865,30.1465],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@Ŏ²l@°‚XĢƐlôŤLX¦°¤ĊnČ¼ÇĊŎͪÞÈ܃„x„U°Ýޙ޼™¼lšČ™˜ŽÞK„Ǔ°óU¯Ģ±ǔÔV±ŤóX¯ÇmÑ˜wXī°@°ĕĸÞKÆĖĢÇ°bȂ™ÇŁUƒV¯wV™ó¥ƒVÅ£Ý@@±ÞwšÅ‚„È@ƒ¥nōťÿ¯Xۃɝ°ţ¯ÛVVÝ@ŹéķÝKȗůɛǕÿÛKóÈǫšǫUţèmҚn¯Æ°ÈU‚°b„š™¼UĢV°°V"],"encodeOffsets":[[92059,30696]]}}],"UTF8Encoding":true}; }); -define('echarts/util/mapData/geoJson/yun_nan_geo',[],function() { - return {"type":"FeatureCollection","features":[{"type":"Feature","id":"5308","properties":{"name":"普洱市","cp":[100.7446,23.4229],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@U‚ô²‚a@Ž²²Ķ¥œV°šĶ²bl¤kVxl‚@œ°‚Ś²@˜„„y„@ô¦¯„@xƒxVxU„VššbVšÜm¼Ŏ„„ĢmºXXWÆ@ĀœšmŽmXU°ÅÒm¼Þx°w„@°‚XêĠ°»nV°U„l@k„@V±ôī@£‚ƒČŃÆ£„KÞý@¥‚k@y„a@—nWV„UVƒšwƒmƒ£Jƒknm@wmkn‚X„˜šX„¥mUUlUnbš¯°ŽnkƒVInlIUw°n™mk@@mlanXlanmšk@wVWUw™_@éĠašnmUaÜ£ƒmXƒ¥¯@@„óUmݯ¯ÞÝlKnxô£š»„»Ġ„J°aV„UÝÿV¥ÛbƒI@wmŽón¯yÛL@ƒWkŎmș`IWa¯K@¯mUnmaXm™bmak„¯ŽƒĢ™ÒÝm¯mV¯KÇb¯KۜWW™X@a™V™knċLUWV™kXóW@k™a@ƒób¯Uƒwmb¥UUlaU¥U£maķšƒKXkƒmÝ@kwmѯk±ċbUUVakaġ¦ƒƒkL@`ƒœ™a¯xƒm™Åƒ™LUWƒ@ċnŎUV°LkL@b°°@¤š²ƒ‚šnôôk„l°kè›ÒÈzV¤È„WôôƒnV@„ƒ¦@¼Ux"],"encodeOffsets":[[101903,23637]]}},{"type":"Feature","id":"5325","properties":{"name":"红河哈尼族彝族自治州","cp":[103.0408,23.6041],"childNum":13},"geometry":{"type":"Polygon","coordinates":["@@°°nÞôV@ƒ°@„¦WŽ„nÛ¤Vbmn™ğb@êš`VxUX@xš„ƏÞUnn˜WÞĸĢƒšÈ@ŽÇè@zÛÜWšÅêlš²„˜KnV¯ĖĊx@bk@@„°JÆ£Èbl„nnm°nlUkVUUwVm„Kn„‚nVŽÞxVLX¥laX@@xl@VzȎVmšk@b°šÈĸmŽV¦`W„XšƒbUb‚bX¼°x@ašVVkn@lþnXUlVxŤÅ„y‚IUƒka‚IŎĊ@lXx@b„z@‚ô„ƒ¥„_V@l‚n@„ôy@al_l`nmƒÈ»@kƒmXwWK™U¯»™a™Å@wƒmUÝKUa™UUƒ™wWƒ@w²»@kƃV£—mm£VKkÑV@@»nwƒ¥™ƒ@kƙnllIVlnLVakalknJšWmnaUaVÑVVލn¥m@ƒ„¯Uÿl™@™™™VçƒaXaV¯UyVLVkš@nJlšXLlŽkxlbla²Òl@nVJVkšx„KlkUaVķÝÑU@Åm¯@±™Uó°ğńķĠmU™Ñ@ǯ¯Å¼@nml@°¯¯`@w™£@¯Çƒk@ƒ»nmċ¯U»™I™Ž¯LÇĶÛn@bó°™U›šwmŽ¯„™Umǯa„™ƒ™ƒI@ykIƒVUŽ¯bƒIğŽƒ¼™¼ó¤mwkLÝÞ"],"encodeOffsets":[[104243,23429]]}},{"type":"Feature","id":"5326","properties":{"name":"文山壮族苗族自治州","cp":[104.8865,23.5712],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@šwô„š@²¯maUmôUÆxš@Xš˜bÞInlVUVw„JVaU„K°¥„xmÞXnlKlnna°@ĊČ„ÆwUmnkl@°ƒƒ£nyn@VV@Vak™ƒ@@kÞ݄bmx°Vnw°klÞInĖÞVlKl™@Xa°„„KlV„U@šJnx‚U@ÈĢbUKlm@ak_‚wšanWUk°ƒl»„k@Wk@lwU_ƒ@UalóU¥ƒÇnƒ™kJWƒ@mVXx±bƒK@nV±a@™Åa™£ÝK²ƒWknamKknǏk¯ƒaV™™V¯ĀƒU™„™Ò¥ƒI@mm¯¯xōW@@`k@ó»ƒUU¯lm£ÅWlĵ„w@mmwÅmWU@y±U—xmwU„¯Uƒ¥Ý¥¯£m@kŽÇVUV°VbklƒL™wUlUIm‚k@±ÑkbkalwkWKk™mI™@UlUKVzU°Wb„bU蚚@škšVĀƒ°@„n‚m¦ÝŽUUUÒVbmbXn™‚mIkllbUbmKUkkJmkŚ@lš„„¦mx@¼U@lÒULn¤˜nU¤Å„@l±¼@xX„šxV„šVVbÞLVŽ„n@xšÆšb°¼šV"],"encodeOffsets":[[106504,25037]]}},{"type":"Feature","id":"5303","properties":{"name":"曲靖市","cp":[103.9417,25.7025],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@ȦlKÞĕUV¯Um¯„ÇVUnVVUƒĉn™ĊÇƾLn°°È„JÆw„@lbÞa„¦V„XJ°¯W¯„aÞJVkUša„ƒ@lKnÅmWUk¯a¯»@m±@уkkbWWX_WÓU»_l™kÑm@U»m@l@IWċn¯l@VanV„UV™UVwVx„KȄVmUē‚@„ƒn@VÝÆL„w„VVwnVlmkUVÑÇ°ka@k™ÿÝaÞUl£™›—ċĕX±±ĉƒa@UnVnalónk@wl™UVmkÝJ—aW™™@ÅwóVVnnb±°™@óƒ™xXLWx„n@lǼn„m‚k_k`@bózƒ‚m@kU@ƒ`„¦óƒ@nWš@ÜÅXWw@ƒyƒb¦@ÒlnUb@x™lܐk‚@²Ç@Uƒ¯bmy@kV@bƒb„¦U`lLVx@b—Ll¼Þ¤@„°VVބU@WސUb›J@nnš@lnnm„šxUŽƒUUbƒK@šÇwklkUƒVWakn@ŽlbU@@„ULVxkKUn‚°¯Ò@¼™„kmƒ¦m@kl™Ȱ@lU„l¦„@Vl°wšnnþĊUÆbUx™b„ŽV„šĖU°„a‚nnašV„al@@b"],"encodeOffsets":[[106099,27653]]}},{"type":"Feature","id":"5323","properties":{"name":"楚雄彝族自治州","cp":[101.6016,25.3619],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@mҁXU`Wnšš™@Xl±¦š„Uxnbl°knmKUx„„ƒxVôUx°¼ôÒȄ°JlnÞKĠœW°¦ƒ„Vx²JVwš_°¥@UV@@wnymknK¯I@‚™²b°ƒš£V¥šwU‚V„¤nLškÆJÈwôô°„l»Č¯ƒġVƒUU@@ƒ°ƒƒÝXl@U»°Å„@U„¯@w±¯VmUUlm@m™„ÑnIVyUwmak£Vwm±—@Çw@nƒ@UxkwlÇnL‚mkř@±Žk™ka@kóJV¯Ç»U£lw¯™Xalbl¥¯UXƒ@a˜™UaÈL@ÇVIVƒkaU¯mm™akLWkUJ¯Umxnšƒ@ƒkUx¯xƒ„mWÅīÝkkbƒŤƒbkxWmXwWk¯wƒKkƒƒLŤċń„@¤óĬU²ƒ@@lƒk¯VmU¯¼@xV@k°l°kbUš°nm‚VnUš@°„š„UVèރÆbUÒÞnU¦›V—¼lô„@Vl"],"encodeOffsets":[[103433,26196]]}},{"type":"Feature","id":"5329","properties":{"name":"大理白族自治州","cp":[99.9536,25.6805],"childNum":12},"geometry":{"type":"Polygon","coordinates":["@@lbœKVIUa˜@²m@b™xôÒÜxXLmbnšl@š„„K°šš¼k„Uô‚xôlV¦nJ„Uš™Ænšm„@šx„ÆwšbXšÆôô„LUVwôK@wlmšaVwœ@WknmƒIUmlnJla@_™@kÝmKUašÑm¯Xw°aUaVl»²JV„bÆJkôĶĀ²VVk„mšbVwUó„wƒƒVwnLlmk¯maVw™ƒ²¥Wkš@™™XmV_‚WnÑUkƒ@k󘻜UV¥ÝmVÑÅa݄UçƒVƒ™@¯V™Umn¯mV™lak¯l¯U@@wğŽW鯁ƒ@¯xÝw¯š¯Jċa¯U¥mLU¤„bÞȤƒbÇLWUwmIUVW¼kbš`U„Vb¯L±ĊÛkƒÿÝKkwƒKţê™UĉþƒÈƒV¯ÞVbUŽ°KVšk²Ý‚mI—ƒmV@kƒm™UkšVxm„¯KXÈķJU¦V°ULWxšL@môƒšb@bkx±LnVUŽVLnkÜWnwlLŃmW@kkJU_ƒV„šWĊ„Þ"],"encodeOffsets":[[101408,26770]]}},{"type":"Feature","id":"5309","properties":{"name":"临沧市","cp":[99.613,24.0546],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@‚xĢ„l`²X°ŽV„šx@x°Þ°KXašğUњW‚bnIl`X²°b„xl°„„šV@xVxk¦mb„l@xšXV‚ÆzX¤™Æ˜k°„kx@lźêlaX»VUnJVx‚XÈK„aÝȣƒaV£nKV¦°‚Čb°I°™n»ÆÑV¯nWn›™@ÿXÅWWn¹ƒġōƒn»‚ÛU™™aU™VƒUw„w@w°ƒó¥ƒ@ƒz—ƒ±@ř›¯@kUwlk£±aĵŽ¯™›Uĵ¦±±@bó±VÝ@ó¤ƒw¯I@mńóm±XŽ¯IólƒK@š°Ullb™zkKlln@@ԙºƒUmVk²ôҙx™ŎUVóLƒb„ŽmÈnŽmbnl‚a„x@z„@Ǝ„¦kš"],"encodeOffsets":[[101251,24734]]}},{"type":"Feature","id":"5334","properties":{"name":"迪庆藏族自治州","cp":[99.4592,27.9327],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@W™Xwƒ™@akk@y›—k°īX¥›Uóķ¯w@n»UaVaUۃ¯ƒmV¼k‚™Þċô@n¯xÛÒm„V‚¯Ô@xƒ‚@šk™wm™Åa@ƒUa‚݁¯VŃyV„a@ÿšn»ÝVmank™mmÞÅôƒ@n£±›ğzÇmU¦™Vm„nÜmbn@°nV@xmzÅ@mºV¦k°ln¤š¼õô„n@xkƃIUxUš@Ťƒ¦VšmVkmkXW¤XzVx@ƚx™¼ƒÞ¯b@lVš™ĸގV„m¼XŽm¦V„ŽÞ@Ǝš¹Vón¥ÆKn„‚KX¯x@èĊȱłXšaÆxnlV@UÛlȻkğV¥„m²ljmÅÞĕƒƛm°„ÆmX¤mznƃŽV¦ÞVVb°bnÞWbnŽ°l@V„È@„‚VĵĊ±@ó„InxÆw„¥@£Þ›W¯ĸ£UƒUK‚ƒk±akkkbmWmÈķ„aÆÇU—ȃÆW@wmknmU¯"],"encodeOffsets":[[102702,28401]]}},{"type":"Feature","id":"5306","properties":{"name":"昭通市","cp":[104.0955,27.6031],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@mƒnK@wmƒUř¥mšóXǓŏmX@Ž—VƒmL@xţ™nk@mlUšŻÒğŋ@ƒL@mmLkm™š@b™XŎW¼ka¯lÇŹ¯aÇ»™ÝÝ_@m„@@a™@UklwUm@ak@ƒb™UmbmƒbV¯™ĕUƒƒšaVwÅaĉVmý™m¯xUkƒ@k¥VƒUXƒ¤VÈm`@„—ńÇÜ@Ākn‚ĔkƞÆĠ„™Þš‚U„VôƆÞI@ŽUxƦn„l@ĊĊnxUÒ°¦Vb¯WUnWŽIml@xn„Ubô¤‚¼ÈxlI„»šKVš„@ÈԂJkšUĖ±ÆVb@nœ„VÜVUVƒšL„wĠl„kn„Ġ@nx°¥Æ„²mUwƒ@m™mÅUl¯UњÑUm„Lll„Il±š@VkwƒW@w°@U»™kUóI°ƒ„»ĢтL„™š`nUĠ²lm„bôV@n„JUxƦX¦l@š‚ŎUƒV„@lV„KVřV£UaÞU™ƒnW@¯VU@ó™"],"encodeOffsets":[[107787,28244]]}},{"type":"Feature","id":"5301","properties":{"name":"昆明市","cp":[102.9199,25.4663],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@n@Vk‚VUn²°@xƒ°Vƒ@¯ÆV¼k@WŽ„Þ¯„@„@‚VVU„„Ģċ°k¼V„Ċxœ¤Ōœx°mVkƒÑȏšL‚°„x°Xœ°VmĊLVxUĖ°bX¦VW@kšȯlkn@„¥lnšƒ@»°Ñ¯VmlLUwVK@ƒV@ka@lmXb„UlVlkÈx@™„LVa„VV™wnƒmm@km™@mœIVaݏ@XƒVUݯU@ƒÝ£k»˜K@aUwkKV_ƒ¥„a@alU@nz°aV„È@@±lÛšk@wVakm@т¥„a„z‚@XxÆW@ÛX™@m@ƒy@aWw@kōĉJlbV„JƒzţÆUwVkmWkým@Ul™U@b¯wVºƒU™VUêšĠƒXUaUbVĊUŽWXUmkK™™WnUUU™V™ƒƒVV™Ý@kk±‚™¯ƒƒLkƒš±WkXlVklƒ@ƒwXbmLƒ›VUIVmk@Ubma@kkaVKUƒ™kmlXLWn™J¯ÒĊ°@zkºlLUŤn@@n›ô@lƁnmKkÈlxVw„@@mÈx˜@n²Uxl¤nbVxUzmJƒÒnš"],"encodeOffsets":[[104828,25999]]}},{"type":"Feature","id":"5307","properties":{"name":"丽江市","cp":[100.448,26.955],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@l@™„@w°ÓUnƒÜÑ°w@mČóšÝlU»n°„„VÜUbVbm¼@Ž°xôĸœVW¦¯Ĭlœ˜@zll@b„šWxXš‚a„X@ÆĠÆaXwl@XaƦn¼˜Jn@mnKW¯È»V¯°ak™VanXVwl@VyUĕVU„bÈīlaUk°ƒk¯lƒ²V˜Ukƛô@ƒ„I@mVwĊa„™ƒVaka„™ÆbUŽVLšaXIWKUw™ƒ„aWÑÅKUaVk°ƒ@Uw„ƒ¯¥›XğÝLkm¯Iǃóѯ»™aƒnUl±UĵÿlóÅIƒaU‚±Ik¼UŽVb¯bWxn°™ÒVbnLlޚ@@`kbmIkŽVn„JmnXl›@Ux™bkn@xóLUxVŽƒKóóŐW™™aÅxƒŽ™wƒ@™nÅm™šƒV™„ƒôX„ƒLlVU¤ƒb¦m¼™Ž@ĀƒbU‚„zUƂ°ÞVb@„Æbnššx"],"encodeOffsets":[[101937,28227]]}},{"type":"Feature","id":"5328","properties":{"name":"西双版纳傣族自治州","cp":[100.8984,21.8628],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@l²°ŽnÒlxÞ@„nWl„Lĸ™nbV¤V¦kbVV‚¦na„x°Vôa@„šb@lôXlWUšVXČKlmššU@bšWXXܛ°LÈa°LnU°‚ÞnšÑ„ġ°lƒnbšaƒ¯¯KWƒœó@kmK@UšĉV@k°„VV¹„a@y‚_ċl_nÓlL@anI@ƒóWl£VU—ƒl™kĕl™šKVw„U@™kVƒam¯ÅL@bƒ‚Ýk@Vn„UbÇbÝwÅ@ċ¥¯lk‚¼ÅŽ™Ò°b@¦nlUn@ŽÇV„mƁbWôU@ÝÅōm™¯ƒaU™™mk™WWw—@±ƒ™n¯U™è™a™Lƒ¯mƒL™škwƒl@°mnÈÒ¯šów@V™xƒĀU¤°Įƒ°Xl"],"encodeOffsets":[[102376,22579]]}},{"type":"Feature","id":"5305","properties":{"name":"保山市","cp":[99.0637,24.9884],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@X°„Il‚@¦ƒŽÈ¼m¼ÞaÞÅl„ÈxV¼šlVôÈÆlLޣȺlkUƒ‚ƒUw„¯UĕVwĊ@n¦mlnVĸIWÇ°LnƒUwl™šV„n@lnU˜„nJށl±U™¯LVUa°Ý„U„ÇĊýšVŤé„LlxÞL„ĀÜl²ĉ°KUaVƒ™_Źé@klw¯ƒlÅ—šW£ÅyU™W@wƒknal¥Uw@w™Uƒƒk¯ƒw¯aW±k_mJa™XVҙĠWb¯L¯Ý@w™wUƒ¯±Wk_ġƒwƒwōKmb@¤„bk°lĖƒô„UJƒšVnÅlťUš¯°VbnbWxX„m„ÞššWUĀ™L™yWzÛKmbUxVKkn݃kŽVšĀċ¤Ux„@Ž¯Žm@ƒ¦"],"encodeOffsets":[[100440,25943]]}},{"type":"Feature","id":"5304","properties":{"name":"玉溪市","cp":[101.9312,23.8898],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@l„„L°xXlWxXnlw„a„ţlaÞlÆĬnX„ƒ°wVw„l„@m™nw°VVIXllKšbnnV°lbU„UJ@ÈÇKVb—š@bW„°Vk¦kaWb°škxV¤È¼U°ôI@llblš²š@‚@œó@mm@VţkKl¹@yĉ¯°ÑšIXmWKnkšlV„ULlb@lnbVal@UnVJœU‚„nKWa„x„@lkkUlW²X„™‚l„K°„šl²@lšÞUŽ„U‚„UšVšVVXmššlLVnXWVUĉVaVb„W™ğVéšU„VU¹W»aVa„aW™Xƒ‚_U¥nÇķ¯™@a™lUnǍUyk@@wW@kbW¦UKÝwUmmƒƒLUnVxUVVlk¯mmnƒmkÇaŤ¯I@ƒl@@aĉw°ĕmU—L±ƒk™ÆéX™ÜÛ@yÈç@™Çġ„Ýķ—XmmÝVՙƒ™lmnkbmWkb@nl@nŽmš¯VxkJmUJ„ml¯™°makVVnVƒ¦™Wƒ—Wmnl@xmn„l‚I„¤„n™xU„ƒVUŽmX@˜ƒb@zl@¦Ýþ"],"encodeOffsets":[[103703,24874]]}},{"type":"Feature","id":"5333","properties":{"name":"怒江傈僳族自治州","cp":[99.1516,26.5594],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@WyX£lWlnnUU™„¥@ţV™Vw„JlÅ@wƒmö󙻂£kml¯U¥n¹Æ@ny@wmU@¯mnamÛnƒšUV¥ÈnĠy²œm¤„@ÆónݚnmlnbÞU‚¥„aV£kU„KWƒ„óšƒmIU¥ókwVólƒ™»¯™ƒL™ƒk@m™naWKÛwóњw@a±n—@VbUJ›LkaƒÝXĉƒ™„UV`lI@lnXÆƑkKmxÛXmlUKVmU²Klw@a™aó„@n™KXwVKU¯V¥mUnkm¥ĉ@UxVĖƒ°Vx„V„klmޙkKWĀkVWšnl°Lnm@°ŽUxlV@nk¦™JVÈ°ŽVÒ@nX°@ÆlUômlnôƒ²nxmłnVV„¯x@Èm°XblVUšl°@xkXU¤WXX‚W„Xƃ„mkÅJmށw±bƒxUīkKmÅVUĖÝèV„kx@š›lX„lnk¤ƒLkŽ‚Ėk¦‚xUššL°‚¯Ė@LnK@b°xVI„¥Ua°Ñ@»nm@¹‚KŎÞÈWln²n"],"encodeOffsets":[[101071,28891]]}},{"type":"Feature","id":"5331","properties":{"name":"德宏傣族景颇族自治州","cp":[98.1299,24.5874],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@„¥n@°@ƒVwČ£™ÿUlÞ„lmULVwnaÜLXyšzšKVÿ™XݙnƒWƒXwmaUa°¯V™ŦŽÆkUm„™VIƒ„ókĕl¯ƒa@£nama™@¯m¯œó@óyţbġkÅm±ÛammVkƒLwU`Wk@VƒkUmŃlUUKmbkkUVUwƒ¦óŽ°¼šbn°ô¦lºƒz@xšŽ¯„™@UŽ°nƒšU¤ţU„°VƆ@ÈmlnzÞl°¦Æa„xUxƒLkxWƒn@‚š²ŰšW„™‚@°ÈXl°Llx"],"encodeOffsets":[[100440,25943]]}}],"UTF8Encoding":true}; +define('echarts/util/mapData/geoJson/yun_nan_geo',[],function() { + return {"type":"FeatureCollection","features":[{"type":"Feature","id":"5308","properties":{"name":"普洱市","cp":[100.7446,23.4229],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@U‚ô²‚a@Ž²²Ķ¥œV°šĶ²bl¤kVxl‚@œ°‚Ś²@˜„„y„@ô¦¯„@xƒxVxU„VššbVšÜm¼Ŏ„„ĢmºXXWÆ@ĀœšmŽmXU°ÅÒm¼Þx°w„@°‚XêĠ°»nV°U„l@k„@V±ôī@£‚ƒČŃÆ£„KÞý@¥‚k@y„a@—nWV„UVƒšwƒmƒ£Jƒknm@wmkn‚X„˜šX„¥mUUlUnbš¯°ŽnkƒVInlIUw°n™mk@@mlanXlanmšk@wVWUw™_@éĠašnmUaÜ£ƒmXƒ¥¯@@„óUmݯ¯ÞÝlKnxô£š»„»Ġ„J°aV„UÝÿV¥ÛbƒI@wmŽón¯yÛL@ƒWkŎmș`IWa¯K@¯mUnmaXm™bmak„¯ŽƒĢ™ÒÝm¯mV¯KÇb¯KۜWW™X@a™V™knċLUWV™kXóW@k™a@ƒób¯Uƒwmb¥UUlaU¥U£maķšƒKXkƒmÝ@kwmѯk±ċbUUVakaġ¦ƒƒkL@`ƒœ™a¯xƒm™Åƒ™LUWƒ@ċnŎUV°LkL@b°°@¤š²ƒ‚šnôôk„l°kè›ÒÈzV¤È„WôôƒnV@„ƒ¦@¼Ux"],"encodeOffsets":[[101903,23637]]}},{"type":"Feature","id":"5325","properties":{"name":"红河哈尼族彝族自治州","cp":[103.0408,23.6041],"childNum":13},"geometry":{"type":"Polygon","coordinates":["@@°°nÞôV@ƒ°@„¦WŽ„nÛ¤Vbmn™ğb@êš`VxUX@xš„ƏÞUnn˜WÞĸĢƒšÈ@ŽÇè@zÛÜWšÅêlš²„˜KnV¯ĖĊx@bk@@„°JÆ£Èbl„nnm°nlUkVUUwVm„Kn„‚nVŽÞxVLX¥laX@@xl@VzȎVmšk@b°šÈĸmŽV¦`W„XšƒbUb‚bX¼°x@ašVVkn@lþnXUlVxŤÅ„y‚IUƒka‚IŎĊ@lXx@b„z@‚ô„ƒ¥„_V@l‚n@„ôy@al_l`nmƒÈ»@kƒmXwWK™U¯»™a™Å@wƒmUÝKUa™UUƒ™wWƒ@w²»@kƃV£—mm£VKkÑV@@»nwƒ¥™ƒ@kƙnllIVlnLVakalknJšWmnaUaVÑVVލn¥m@ƒ„¯Uÿl™@™™™VçƒaXaV¯UyVLVkš@nJlšXLlŽkxlbla²Òl@nVJVkšx„KlkUaVķÝÑU@Åm¯@±™Uó°ğńķĠmU™Ñ@ǯ¯Å¼@nml@°¯¯`@w™£@¯Çƒk@ƒ»nmċ¯U»™I™Ž¯LÇĶÛn@bó°™U›šwmŽ¯„™Umǯa„™ƒ™ƒI@ykIƒVUŽ¯bƒIğŽƒ¼™¼ó¤mwkLÝÞ"],"encodeOffsets":[[104243,23429]]}},{"type":"Feature","id":"5326","properties":{"name":"文山壮族苗族自治州","cp":[104.8865,23.5712],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@šwô„š@²¯maUmôUÆxš@Xš˜bÞInlVUVw„JVaU„K°¥„xmÞXnlKlnna°@ĊČ„ÆwUmnkl@°ƒƒ£nyn@VV@Vak™ƒ@@kÞ݄bmx°Vnw°klÞInĖÞVlKl™@Xa°„„KlV„U@šJnx‚U@ÈĢbUKlm@ak_‚wšanWUk°ƒl»„k@Wk@lwU_ƒ@UalóU¥ƒÇnƒ™kJWƒ@mVXx±bƒK@nV±a@™Åa™£ÝK²ƒWknamKknǏk¯ƒaV™™V¯ĀƒU™„™Ò¥ƒI@mm¯¯xōW@@`k@ó»ƒUU¯lm£ÅWlĵ„w@mmwÅmWU@y±U—xmwU„¯Uƒ¥Ý¥¯£m@kŽÇVUV°VbklƒL™wUlUIm‚k@±ÑkbkalwkWKk™mI™@UlUKVzU°Wb„bU蚚@škšVĀƒ°@„n‚m¦ÝŽUUUÒVbmbXn™‚mIkllbUbmKUkkJmkŚ@lš„„¦mx@¼U@lÒULn¤˜nU¤Å„@l±¼@xX„šxV„šVVbÞLVŽ„n@xšÆšb°¼šV"],"encodeOffsets":[[106504,25037]]}},{"type":"Feature","id":"5303","properties":{"name":"曲靖市","cp":[103.9417,25.7025],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@ȦlKÞĕUV¯Um¯„ÇVUnVVUƒĉn™ĊÇƾLn°°È„JÆw„@lbÞa„¦V„XJ°¯W¯„aÞJVkUša„ƒ@lKnÅmWUk¯a¯»@m±@уkkbWWX_WÓU»_l™kÑm@U»m@l@IWċn¯l@VanV„UV™UVwVx„KȄVmUē‚@„ƒn@VÝÆL„w„VVwnVlmkUVÑÇ°ka@k™ÿÝaÞUl£™›—ċĕX±±ĉƒa@UnVnalónk@wl™UVmkÝJ—aW™™@ÅwóVVnnb±°™@óƒ™xXLWx„n@lǼn„m‚k_k`@bózƒ‚m@kU@ƒ`„¦óƒ@nWš@ÜÅXWw@ƒyƒb¦@ÒlnUb@x™lܐk‚@²Ç@Uƒ¯bmy@kV@bƒb„¦U`lLVx@b—Ll¼Þ¤@„°VVބU@WސUb›J@nnš@lnnm„šxUŽƒUUbƒK@šÇwklkUƒVWakn@ŽlbU@@„ULVxkKUn‚°¯Ò@¼™„kmƒ¦m@kl™Ȱ@lU„l¦„@Vl°wšnnþĊUÆbUx™b„ŽV„šĖU°„a‚nnašV„al@@b"],"encodeOffsets":[[106099,27653]]}},{"type":"Feature","id":"5323","properties":{"name":"楚雄彝族自治州","cp":[101.6016,25.3619],"childNum":10},"geometry":{"type":"Polygon","coordinates":["@@mҁXU`Wnšš™@Xl±¦š„Uxnbl°knmKUx„„ƒxVôUx°¼ôÒȄ°JlnÞKĠœW°¦ƒ„Vx²JVwš_°¥@UV@@wnymknK¯I@‚™²b°ƒš£V¥šwU‚V„¤nLškÆJÈwôô°„l»Č¯ƒġVƒUU@@ƒ°ƒƒÝXl@U»°Å„@U„¯@w±¯VmUUlm@m™„ÑnIVyUwmak£Vwm±—@Çw@nƒ@UxkwlÇnL‚mkř@±Žk™ka@kóJV¯Ç»U£lw¯™Xalbl¥¯UXƒ@a˜™UaÈL@ÇVIVƒkaU¯mm™akLWkUJ¯Umxnšƒ@ƒkUx¯xƒ„mWÅīÝkkbƒŤƒbkxWmXwWk¯wƒKkƒƒLŤċń„@¤óĬU²ƒ@@lƒk¯VmU¯¼@xV@k°l°kbUš°nm‚VnUš@°„š„UVèރÆbUÒÞnU¦›V—¼lô„@Vl"],"encodeOffsets":[[103433,26196]]}},{"type":"Feature","id":"5329","properties":{"name":"大理白族自治州","cp":[99.9536,25.6805],"childNum":12},"geometry":{"type":"Polygon","coordinates":["@@lbœKVIUa˜@²m@b™xôÒÜxXLmbnšl@š„„K°šš¼k„Uô‚xôlV¦nJ„Uš™Ænšm„@šx„ÆwšbXšÆôô„LUVwôK@wlmšaVwœ@WknmƒIUmlnJla@_™@kÝmKUašÑm¯Xw°aUaVl»²JV„bÆJkôĶĀ²VVk„mšbVwUó„wƒƒVwnLlmk¯maVw™ƒ²¥Wkš@™™XmV_‚WnÑUkƒ@k󘻜UV¥ÝmVÑÅa݄UçƒVƒ™@¯V™Umn¯mV™lak¯l¯U@@wğŽW鯁ƒ@¯xÝw¯š¯Jċa¯U¥mLU¤„bÞȤƒbÇLWUwmIUVW¼kbš`U„Vb¯L±ĊÛkƒÿÝKkwƒKţê™UĉþƒÈƒV¯ÞVbUŽ°KVšk²Ý‚mI—ƒmV@kƒm™UkšVxm„¯KXÈķJU¦V°ULWxšL@môƒšb@bkx±LnVUŽVLnkÜWnwlLŃmW@kkJU_ƒV„šWĊ„Þ"],"encodeOffsets":[[101408,26770]]}},{"type":"Feature","id":"5309","properties":{"name":"临沧市","cp":[99.613,24.0546],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@‚xĢ„l`²X°ŽV„šx@x°Þ°KXašğUњW‚bnIl`X²°b„xl°„„šV@xVxk¦mb„l@xšXV‚ÆzX¤™Æ˜k°„kx@lźêlaX»VUnJVx‚XÈK„aÝȣƒaV£nKV¦°‚Čb°I°™n»ÆÑV¯nWn›™@ÿXÅWWn¹ƒġōƒn»‚ÛU™™aU™VƒUw„w@w°ƒó¥ƒ@ƒz—ƒ±@ř›¯@kUwlk£±aĵŽ¯™›Uĵ¦±±@bó±VÝ@ó¤ƒw¯I@mńóm±XŽ¯IólƒK@š°Ullb™zkKlln@@ԙºƒUmVk²ôҙx™ŎUVóLƒb„ŽmÈnŽmbnl‚a„x@z„@Ǝ„¦kš"],"encodeOffsets":[[101251,24734]]}},{"type":"Feature","id":"5334","properties":{"name":"迪庆藏族自治州","cp":[99.4592,27.9327],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@W™Xwƒ™@akk@y›—k°īX¥›Uóķ¯w@n»UaVaUۃ¯ƒmV¼k‚™Þċô@n¯xÛÒm„V‚¯Ô@xƒ‚@šk™wm™Åa@ƒUa‚݁¯VŃyV„a@ÿšn»ÝVmank™mmÞÅôƒ@n£±›ğzÇmU¦™Vm„nÜmbn@°nV@xmzÅ@mºV¦k°ln¤š¼õô„n@xkƃIUxUš@Ťƒ¦VšmVkmkXW¤XzVx@ƚx™¼ƒÞ¯b@lVš™ĸގV„m¼XŽm¦V„ŽÞ@Ǝš¹Vón¥ÆKn„‚KX¯x@èĊȱłXšaÆxnlV@UÛlȻkğV¥„m²ljmÅÞĕƒƛm°„ÆmX¤mznƃŽV¦ÞVVb°bnÞWbnŽ°l@V„È@„‚VĵĊ±@ó„InxÆw„¥@£Þ›W¯ĸ£UƒUK‚ƒk±akkkbmWmÈķ„aÆÇU—ȃÆW@wmknmU¯"],"encodeOffsets":[[102702,28401]]}},{"type":"Feature","id":"5306","properties":{"name":"昭通市","cp":[104.0955,27.6031],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@mƒnK@wmƒUř¥mšóXǓŏmX@Ž—VƒmL@xţ™nk@mlUšŻÒğŋ@ƒL@mmLkm™š@b™XŎW¼ka¯lÇŹ¯aÇ»™ÝÝ_@m„@@a™@UklwUm@ak@ƒb™UmbmƒbV¯™ĕUƒƒšaVwÅaĉVmý™m¯xUkƒ@k¥VƒUXƒ¤VÈm`@„—ńÇÜ@Ākn‚ĔkƞÆĠ„™Þš‚U„VôƆÞI@ŽUxƦn„l@ĊĊnxUÒ°¦Vb¯WUnWŽIml@xn„Ubô¤‚¼ÈxlI„»šKVš„@ÈԂJkšUĖ±ÆVb@nœ„VÜVUVƒšL„wĠl„kn„Ġ@nx°¥Æ„²mUwƒ@m™mÅUl¯UњÑUm„Lll„Il±š@VkwƒW@w°@U»™kUóI°ƒ„»ĢтL„™š`nUĠ²lm„bôV@n„JUxƦX¦l@š‚ŎUƒV„@lV„KVřV£UaÞU™ƒnW@¯VU@ó™"],"encodeOffsets":[[107787,28244]]}},{"type":"Feature","id":"5301","properties":{"name":"昆明市","cp":[102.9199,25.4663],"childNum":11},"geometry":{"type":"Polygon","coordinates":["@@n@Vk‚VUn²°@xƒ°Vƒ@¯ÆV¼k@WŽ„Þ¯„@„@‚VVU„„Ģċ°k¼V„Ċxœ¤Ōœx°mVkƒÑȏšL‚°„x°Xœ°VmĊLVxUĖ°bX¦VW@kšȯlkn@„¥lnšƒ@»°Ñ¯VmlLUwVK@ƒV@ka@lmXb„UlVlkÈx@™„LVa„VV™wnƒmm@km™@mœIVaݏ@XƒVUݯU@ƒÝ£k»˜K@aUwkKV_ƒ¥„a@alU@nz°aV„È@@±lÛšk@wVakm@т¥„a„z‚@XxÆW@ÛX™@m@ƒy@aWw@kōĉJlbV„JƒzţÆUwVkmWkým@Ul™U@b¯wVºƒU™VUêšĠƒXUaUbVĊUŽWXUmkK™™WnUUU™V™ƒƒVV™Ý@kk±‚™¯ƒƒLkƒš±WkXlVklƒ@ƒwXbmLƒ›VUIVmk@Ubma@kkaVKUƒ™kmlXLWn™J¯ÒĊ°@zkºlLUŤn@@n›ô@lƁnmKkÈlxVw„@@mÈx˜@n²Uxl¤nbVxUzmJƒÒnš"],"encodeOffsets":[[104828,25999]]}},{"type":"Feature","id":"5307","properties":{"name":"丽江市","cp":[100.448,26.955],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@l@™„@w°ÓUnƒÜÑ°w@mČóšÝlU»n°„„VÜUbVbm¼@Ž°xôĸœVW¦¯Ĭlœ˜@zll@b„šWxXš‚a„X@ÆĠÆaXwl@XaƦn¼˜Jn@mnKW¯È»V¯°ak™VanXVwl@VyUĕVU„bÈīlaUk°ƒk¯lƒ²V˜Ukƛô@ƒ„I@mVwĊa„™ƒVaka„™ÆbUŽVLšaXIWKUw™ƒ„aWÑÅKUaVk°ƒ@Uw„ƒ¯¥›XğÝLkm¯Iǃóѯ»™aƒnUl±UĵÿlóÅIƒaU‚±Ik¼UŽVb¯bWxn°™ÒVbnLlޚ@@`kbmIkŽVn„JmnXl›@Ux™bkn@xóLUxVŽƒKóóŐW™™aÅxƒŽ™wƒ@™nÅm™šƒV™„ƒôX„ƒLlVU¤ƒb¦m¼™Ž@ĀƒbU‚„zUƂ°ÞVb@„Æbnššx"],"encodeOffsets":[[101937,28227]]}},{"type":"Feature","id":"5328","properties":{"name":"西双版纳傣族自治州","cp":[100.8984,21.8628],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@l²°ŽnÒlxÞ@„nWl„Lĸ™nbV¤V¦kbVV‚¦na„x°Vôa@„šb@lôXlWUšVXČKlmššU@bšWXXܛ°LÈa°LnU°‚ÞnšÑ„ġ°lƒnbšaƒ¯¯KWƒœó@kmK@UšĉV@k°„VV¹„a@y‚_ċl_nÓlL@anI@ƒóWl£VU—ƒl™kĕl™šKVw„U@™kVƒam¯ÅL@bƒ‚Ýk@Vn„UbÇbÝwÅ@ċ¥¯lk‚¼ÅŽ™Ò°b@¦nlUn@ŽÇV„mƁbWôU@ÝÅōm™¯ƒaU™™mk™WWw—@±ƒ™n¯U™è™a™Lƒ¯mƒL™škwƒl@°mnÈÒ¯šów@V™xƒĀU¤°Įƒ°Xl"],"encodeOffsets":[[102376,22579]]}},{"type":"Feature","id":"5305","properties":{"name":"保山市","cp":[99.0637,24.9884],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@X°„Il‚@¦ƒŽÈ¼m¼ÞaÞÅl„ÈxV¼šlVôÈÆlLޣȺlkUƒ‚ƒUw„¯UĕVwĊ@n¦mlnVĸIWÇ°LnƒUwl™šV„n@lnU˜„nJށl±U™¯LVUa°Ý„U„ÇĊýšVŤé„LlxÞL„ĀÜl²ĉ°KUaVƒ™_Źé@klw¯ƒlÅ—šW£ÅyU™W@wƒknal¥Uw@w™Uƒƒk¯ƒw¯aW±k_mJa™XVҙĠWb¯L¯Ý@w™wUƒ¯±Wk_ġƒwƒwōKmb@¤„bk°lĖƒô„UJƒšVnÅlťUš¯°VbnbWxX„m„ÞššWUĀ™L™yWzÛKmbUxVKkn݃kŽVšĀċ¤Ux„@Ž¯Žm@ƒ¦"],"encodeOffsets":[[100440,25943]]}},{"type":"Feature","id":"5304","properties":{"name":"玉溪市","cp":[101.9312,23.8898],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@l„„L°xXlWxXnlw„a„ţlaÞlÆĬnX„ƒ°wVw„l„@m™nw°VVIXllKšbnnV°lbU„UJ@ÈÇKVb—š@bW„°Vk¦kaWb°škxV¤È¼U°ôI@llblš²š@‚@œó@mm@VţkKl¹@yĉ¯°ÑšIXmWKnkšlV„ULlb@lnbVal@UnVJœU‚„nKWa„x„@lkkUlW²X„™‚l„K°„šl²@lšÞUŽ„U‚„UšVšVVXmššlLVnXWVUĉVaVb„W™ğVéšU„VU¹W»aVa„aW™Xƒ‚_U¥nÇķ¯™@a™lUnǍUyk@@wW@kbW¦UKÝwUmmƒƒLUnVxUVVlk¯mmnƒmkÇaŤ¯I@ƒl@@aĉw°ĕmU—L±ƒk™ÆéX™ÜÛ@yÈç@™Çġ„Ýķ—XmmÝVՙƒ™lmnkbmWkb@nl@nŽmš¯VxkJmUJ„ml¯™°makVVnVƒ¦™Wƒ—Wmnl@xmn„l‚I„¤„n™xU„ƒVUŽmX@˜ƒb@zl@¦Ýþ"],"encodeOffsets":[[103703,24874]]}},{"type":"Feature","id":"5333","properties":{"name":"怒江傈僳族自治州","cp":[99.1516,26.5594],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@WyX£lWlnnUU™„¥@ţV™Vw„JlÅ@wƒmö󙻂£kml¯U¥n¹Æ@ny@wmU@¯mnamÛnƒšUV¥ÈnĠy²œm¤„@ÆónݚnmlnbÞU‚¥„aV£kU„KWƒ„óšƒmIU¥ókwVólƒ™»¯™ƒL™ƒk@m™naWKÛwóњw@a±n—@VbUJ›LkaƒÝXĉƒ™„UV`lI@lnXÆƑkKmxÛXmlUKVmU²Klw@a™aó„@n™KXwVKU¯V¥mUnkm¥ĉ@UxVĖƒ°Vx„V„klmޙkKWĀkVWšnl°Lnm@°ŽUxlV@nk¦™JVÈ°ŽVÒ@nX°@ÆlUômlnôƒ²nxmłnVV„¯x@Èm°XblVUšl°@xkXU¤WXX‚W„Xƃ„mkÅJmށw±bƒxUīkKmÅVUĖÝèV„kx@š›lX„lnk¤ƒLkŽ‚Ėk¦‚xUššL°‚¯Ė@LnK@b°xVI„¥Ua°Ñ@»nm@¹‚KŎÞÈWln²n"],"encodeOffsets":[[101071,28891]]}},{"type":"Feature","id":"5331","properties":{"name":"德宏傣族景颇族自治州","cp":[98.1299,24.5874],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@„¥n@°@ƒVwČ£™ÿUlÞ„lmULVwnaÜLXyšzšKVÿ™XݙnƒWƒXwmaUa°¯V™ŦŽÆkUm„™VIƒ„ókĕl¯ƒa@£nama™@¯m¯œó@óyţbġkÅm±ÛammVkƒLwU`Wk@VƒkUmŃlUUKmbkkUVUwƒ¦óŽ°¼šbn°ô¦lºƒz@xšŽ¯„™@UŽ°nƒšU¤ţU„°VƆ@ÈmlnzÞl°¦Æa„xUxƒLkxWƒn@‚š²ŰšW„™‚@°ÈXl°Llx"],"encodeOffsets":[[100440,25943]]}}],"UTF8Encoding":true}; }); -define('echarts/util/mapData/geoJson/zhe_jiang_geo',[],function() { - return {"type":"FeatureCollection","features":[{"type":"Feature","id":"3311","properties":{"name":"丽水市","cp":[119.5642,28.1854],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@@V‚bVl@Xn‚UXƒKVŽ@¦nxlUXV‚n„KVmnL‚UV@bn¤lLXK˜²„`nnlJXIVJ‚I„Vnn°KnnVll@VLXWV@UkVaVK„zV@„ƒšVVaUK@U»VUl@@WnUUƒ@wVLn@Vwl@XW°LVbn@VU‚@X„l`@XnKVbkl@XVJlUnlV„„xlL@lnXl„@VšUnV°°„@a„UVLXblWVXn@VVUV@Lš¤VLV„U‚VbnalLUUVX_laVa„WVzXKV@@a@KUmImmXama@kU@yVIUK‚aVa@kXK@aWU@VIUmW@kkVm„Uš@VwUa@K@k@Uƒ`@kUKVk@UV@VaUm²Vy@klUUWUkVmUa@_ƒKVaXa›XmƒU@mUlWkaUXƒ@mmkL@w™JƒnVVÅbWKXa™@@I@aƒJUUÇ@V„UL™W@akLmb@K@a™XXw@mƒVmUVkUy@£@aU@@VkUWm@kUKƒXUWU_mW@wkkmJUUkLWWUXƒW@IkJ@k@mW_kӃ_Ul™Lƒm@I@aUa¯m@kƒa¯LUJƒ@mVVxUb™a@LUKkXƒbm@Uak@@a@Um`ƒIUbUJ@nUVW@@LnVV@lšUbVlUX@`š@blXklW„Ušm„Xlm¦U@@V¯bml@š@nUb@llnn@VbX@lV@ŽUVULmU@JVn„bVbkb™VWxU@@nUVk@"],"encodeOffsets":[[121546,28992]]}},{"type":"Feature","id":"3301","properties":{"name":"杭州市","cp":[119.5313,29.8773],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@X@l„°KXXlW„b@²„`šššb‚I„šX`l@„@bWl@n@VnLUV@V„@°¦@šl@XVlU@š@xVbUb@Vkb@‚@XVJVz™J@Lޚ@VmLUxUJ@LU„Vx‚b„xXUl@VaÈw„b‚aÞa@Vl@XUVx@V@V„LlbnV„al@lb„Vnn‚LnKnL@VlbVJXalIšb@KUU@mVInJ˜„U„Vl@xUšVLnUš@UÞaV@lkV@UanK„L@UlKVUnbÆmn@@nUlVnVJl@@UXU„L@WVIVJVxVLXV@IÜKnbn@V¥V@@I@ƒƒ„y°b@UUwnk°ÆƨVlUšçXm›£aƒÇ™IkVƒ@WV@@aWIUWUIkb@WW@UnƒK@UU@kaWVkƒVIVVnU@UWVUV@VmVkKkWIkVWaULU`UImJUImm—U@ƒƒwmwUV™IUWVkUamaU@mV—kƒb@KVU@aVU@anKULVJ‚U@kÛU™JUV›kkƒVakU@ƒaVwkW@UWkXmWaULUaUK@XƒJUUmƒVU@UVƒUkJ@ImwmKU@k„@lU„W@@akKm„kamIkWl_UwVm@UkaVUUaƒ@UamakbWlkL@aUalU@mkL@U@U™lmK@XkKm@Ýakb@xƒnXbƒ`ƒnUUU@›™U@™wU@@ƒmKkkƒV¯U@lULUbVbUb@V‚a@L™ºÝb@bLmK™x@VUL@bk@mxULWl"],"encodeOffsets":[[121185,30184]]}},{"type":"Feature","id":"3303","properties":{"name":"温州市","cp":[120.498,27.8119],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@ll@xnXV`VX„WVL@lXnlV@UV@@b@¤VzUlnV„U@nWxšW@b@LnalK@bšXVKUƒÈ@VV„I@b@Jš@WbXLÆaUU„mšI@xlKnn„@VWlbkXV‚@n„VWnœ‚WbUb„L@`VbUnVlVXkV@lUz±‚VnUbU@@VUlVL@l„_@V@l@LVbV@XLV`VÈlxn@lU@aœaVV‚k„@XJ@nl@@LU`°LVb„L°a@a„UVy@anI@a„a‚nV@²wÜJX@VšVV°k„na@WVk„aWwU@m@™ƒkƒaUĕ™ÝšÝŤnÈa„aóI›»@±X™WkUķ@kV±kw™ƒUkWw„™UƒÝ»ÛkɳlImaUaWóXÿǬk‚UnWVmmk™KţnŏÞğl™„UlUx@XWb„V@JkXƒ°mb@VULVxUVk@@LWWk@WIkšƒUkJmUkVmI@yƒ@Ua™kLm‚U@mUUUkaVk™@mK@UlUU@UmKmbUUUJ@n@KVLUL@VkJWXX`mnULWlkL@JVLVb@°kxkU@LVŽ™V@„VLV`UL@VUX"],"encodeOffsets":[[122502,28334]]}},{"type":"Feature","id":"3302","properties":{"name":"宁波市","cp":[121.5967,29.6466],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@Ċ¦ĸĀ°‚nXÞVšKškƨƑźÿ°»n„@wô¥ÜbœU°ÆXÞWóçĉݱIUƒÈ¥@U°wÆ»²mm_@aXƒVKÞVlk@akk›̅@£X»VwƏXWa¯aȗb™KƽۃĊ™xƒLóŽk@ƒƒƒ@¯nƒKUL@xkL›ÑkWULUUmJUXVŽU@mŽUX¯@V`mbXbV@@nn¤WXšx@škJ@nVVUVl²UbÝVUVk@Wx@V@„ƒVXzmlaƒL@VlLU`„XUVVVUnl@VbnJlnUVVnƒlUKkbmnn„VxlJnxmbU@UL@KUV™X@xmb@lk@mnVVUš™è"],"encodeOffsets":[[123784,30977]]}},{"type":"Feature","id":"3309","properties":{"name":"舟山市","cp":[122.2559,30.2234],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@l΢ƒʠþÆVĢLĊƒǬXĊ܄XôV„ÑÆw„ƒlšƏÈóVĭVǓ@ƒĉwɛkmK@ĉXīWaĉUĵÝmƒ¯ĉƒwĉ±±nż¯x@VǦV„²JĊÞôèÝXÅW¯›VÛaó¦@xƒŽmŽ¯¼ŹĀ"],"encodeOffsets":[[124437,30983]]}},{"type":"Feature","id":"3310","properties":{"name":"台州市","cp":[121.1353,28.6688],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@lV„IVWVz@bXJl@Xal@°„nLll@nVxnV„K@UJVbƒ¦°„k`UIWJXnƚ@bUJ„Xl@lb„Wn@UzVV@bVVšmVnnJVXna‚bšKUKnUVVUnVLlKVLXa„Jm£@mU@WanaU_°@VWnV@UVWnIVVVKlXœÒlK@wVK„L°m„@„„l@ô„Kšw„ĉƾůUƒl£@»UƒVk„m@ƅUƒƒaÛIŏmUk@m„w@a™£ƒWk@ţšƒIm±@ankôUlaU™Uw¯ƒōaƒbÇbţm™ÞšÞVĖ„b„l@š@n‚VXxƒbUl@XmbƒŽ¯lUUU™W@ÛI±xU@mƒb@bmJ@bUzƒV@b¯bƒKUa¯KV_@Kk@@mWIƒ@lUU›b@bkVm@kwUÇU_WKU@Ux™@ƒVUnllX@Vn‚J@UXV@bWL@lUbbVLUJ@z‚V@lnbWbnnnJVŽ@L"],"encodeOffsets":[[123312,29526]]}},{"type":"Feature","id":"3307","properties":{"name":"金华市","cp":[120.0037,29.1028],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@nbVb„@VbUVlb@VUnVxk`lXnJlbnƒlL@bX@Vƒ@klƒV@nLnx@JlI„V‚U@VUVn„VV„I@WVLVbVKXbWnXl@VlXUx„b@ŽlVUbl„œlVUšIÜVnalKX@@bV@@aUUlUƒwUw„@naWW„UVaUUšaVb„LlxXJVk°ƒUƒlkU¥@k„a@LVlXLVlšVWznVn@lxšJl_@WX_@mVa„a@alU@kVVna„KVLlK„b@UUaVašbnUWmXU@k@yVI@ařWmXIVJl_¯ƒ„¥UaVI@ƒLmUUw@mkkmK¯ƒk@Wbk@WI@aUyUXƒJkU@bU@WLUyƒXUbkbW`UVVkKmbUaVUƒUK™£@KVUUUm@UWkXWaUKƒV@b¯ƒ¯mU™V@UkƒmW@kkKƒwUƒmkkVUI@WlkUamL@Wk_Wƒ@UVm@Ua¯KWXk@Uxm@UK@xV„mV@Xk@UVV¼@‚VLUb™Uƒ„U@ƒyULUbVlU@@XlVUVVbƒU@lXXVW@XUVl@@VUVƒÈn@VVU„@lVa@„U„mL@`X@`WL@VUX@lUL@xlx"],"encodeOffsets":[[122119,29948]]}},{"type":"Feature","id":"3308","properties":{"name":"衢州市","cp":[118.6853,28.8666],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@XkVKnwl@@aVK@UšwnL‚K@aÞaš¹@Kb@UVaUaVaVK@k°V„UllnL@„V@šxV@œšV@VV„m„_Wa„m@wlaÞbn@lL@WnLšk@V@VlK@nkVVb@blKXklakw@wVK@kVW@UXK@_‚W@_nKVƒ@ƒUb@kVƒUUm@„ÇVU@Uk@VU@WUXWW@k„VUaVUkU@WWXUKk@Ukmm¯LmmƒUJUIWJkImmƒ_—±WLkKm£@aVUmKUnƒLmWUkVmw@¥U„LVWm@WUka@UmmLmm@@bUX™@@WUIm@UVUK@UVUUU™VVJmb@b„Xn‚mVƒ¼nnn¦mJUVƒL„V@VW@UzUlVnUbl`UnVl@XU@kl@bmÈUx™Vk@@J@„ƒ¼W@ÅaVVnzmVƒ„@WJk@kWJ@ƒlXbWbXxmVnšlLXb@°lKVXnWšbWV„„X„mbV@Xl‚bšI@Kn@@x@šVLlm"],"encodeOffsets":[[121185,30184]]}},{"type":"Feature","id":"3306","properties":{"name":"绍兴市","cp":[120.564,29.7565],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@„x@„˜VnnVJnIVJV_VKXblUXJlŽlLUŽUnU@UVVX@ŽmVUUUJl„XUlbV@@V„LVmX@@XlaVJVXXJ@b‚@XU„@lUšJ„È‚bœ¤Ō„JšçV™UUnml@@kna@wšWVU@LVKV@namwkIUwmƒnmlaVL„kUmVUkmmIUak@VmUUVUƒWV_kK@U„K‚bnkWy„U@ƒ@UXwl@VUÞUVak±VUUU@mlI@™™wXWƒIWbUKkLUKVmUUmVVL™LambUWmIUm™nUU@aUUVym@ƒXkak@ƒW@z@lWVXnmV™aUbVb@VƒakLUKƒLmbUU@lkV@bƒbUb@nW`@Xk`™Ikwm@mUXy™UUkWKUk@Kƒb@lV¦klV„¯„UlWIkwƒKUa™bVVUbƒVXXmbƒ@Vx„xkVVV@bU@@aW@kLmb@lVUIVKmL@bUV@bUV@L„a˜lnUV@nbVbUlVXšJVUnx"],"encodeOffsets":[[122997,30561]]}},{"type":"Feature","id":"3304","properties":{"name":"嘉兴市","cp":[120.9155,30.6354],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@@blIX@@VÜVUnn@l‚k„lKnI°Þl`²LVKVbnbVaVLUVn@W¦@VkVVb„@VI„`@blLnL‚aX@„VVb@U‚@XlVa„@@kVaUKV»U_lWXUƒƒ@alb„k@VllnLVKn@@UVIUw@y°IVVXU@VV@lw„m@wVkƾaœJ‚LkΡƧƒ™l™LÝUmW¯ķÿĉ¥ƒIŋŽWn™èkVƧU¯ÅmlVx@V¯aƒz„Ž@„@JU@U¦m@@šnVmn@V„LV‚"],"encodeOffsets":[[123233,31382]]}},{"type":"Feature","id":"3305","properties":{"name":"湖州市","cp":[119.8608,30.7782],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@kLlƒkm@VmÛU@UW@kJ@aUƒK@UnmmU@™maÛL@JWUUKUwUIUJ@XƒKWV@Vk@UIUmVk@mm@ÅnmaUVkL@VƒKmLVbU@klU@ÝbV™@mVUKV™@wUkVƒ—ƒmIUJ@nVV@L™akJWbUIka@UmKmLKmmƒUUVk@@nmLX`WXUV@Ž@nUl™kmlU@Ub„„ƒxVVšIlV„Žšnn„@@n˜„UҚ@„°n@@xmb@„VbnV@šš„@b@`@L@L@x@blVklVbnnV@‚aXb°VlU@W„b°U„LXWVUV™„™VwÈwÜ»ĸaĠnUVw²X@V@lVU@wlaUUVm@knUV›"],"encodeOffsets":[[123379,31500]]}}],"UTF8Encoding":true}; +define('echarts/util/mapData/geoJson/zhe_jiang_geo',[],function() { + return {"type":"FeatureCollection","features":[{"type":"Feature","id":"3311","properties":{"name":"丽水市","cp":[119.5642,28.1854],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@@V‚bVl@Xn‚UXƒKVŽ@¦nxlUXV‚n„KVmnL‚UV@bn¤lLXK˜²„`nnlJXIVJ‚I„Vnn°KnnVll@VLXWV@UkVaVK„zV@„ƒšVVaUK@U»VUl@@WnUUƒ@wVLn@Vwl@XW°LVbn@VU‚@X„l`@XnKVbkl@XVJlUnlV„„xlL@lnXl„@VšUnV°°„@a„UVLXblWVXn@VVUV@Lš¤VLV„U‚VbnalLUUVX_laVa„WVzXKV@@a@KUmImmXama@kU@yVIUK‚aVa@kXK@aWU@VIUmW@kkVm„Uš@VwUa@K@k@Uƒ`@kUKVk@UV@VaUm²Vy@klUUWUkVmUa@_ƒKVaXa›XmƒU@mUlWkaUXƒ@mmkL@w™JƒnVVÅbWKXa™@@I@aƒJUUÇ@V„UL™W@akLmb@K@a™XXw@mƒVmUVkUy@£@aU@@VkUWm@kUKƒXUWU_mW@wkkmJUUkLWWUXƒW@IkJ@k@mW_kӃ_Ul™Lƒm@I@aUa¯m@kƒa¯LUJƒ@mVVxUb™a@LUKkXƒbm@Uak@@a@Um`ƒIUbUJ@nUVW@@LnVV@lšUbVlUX@`š@blXklW„Ušm„Xlm¦U@@V¯bml@š@nUb@llnn@VbX@lV@ŽUVULmU@JVn„bVbkb™VWxU@@nUVk@"],"encodeOffsets":[[121546,28992]]}},{"type":"Feature","id":"3301","properties":{"name":"杭州市","cp":[119.5313,29.8773],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@X@l„°KXXlW„b@²„`šššb‚I„šX`l@„@bWl@n@VnLUV@V„@°¦@šl@XVlU@š@xVbUb@Vkb@‚@XVJVz™J@Lޚ@VmLUxUJ@LU„Vx‚b„xXUl@VaÈw„b‚aÞa@Vl@XUVx@V@V„LlbnV„al@lb„Vnn‚LnKnL@VlbVJXalIšb@KUU@mVInJ˜„U„Vl@xUšVLnUš@UÞaV@lkV@UanK„L@UlKVUnbÆmn@@nUlVnVJl@@UXU„L@WVIVJVxVLXV@IÜKnbn@V¥V@@I@ƒƒ„y°b@UUwnk°ÆƨVlUšçXm›£aƒÇ™IkVƒ@WV@@aWIUWUIkb@WW@UnƒK@UU@kaWVkƒVIVVnU@UWVUV@VmVkKkWIkVWaULU`UImJUImm—U@ƒƒwmwUV™IUWVkUamaU@mV—kƒb@KVU@aVU@anKULVJ‚U@kÛU™JUV›kkƒVakU@ƒaVwkW@UWkXmWaULUaUK@XƒJUUmƒVU@UVƒUkJ@ImwmKU@k„@lU„W@@akKm„kamIkWl_UwVm@UkaVUUaƒ@UamakbWlkL@aUalU@mkL@U@U™lmK@XkKm@Ýakb@xƒnXbƒ`ƒnUUU@›™U@™wU@@ƒmKkkƒV¯U@lULUbVbUb@V‚a@L™ºÝb@bLmK™x@VUL@bk@mxULWl"],"encodeOffsets":[[121185,30184]]}},{"type":"Feature","id":"3303","properties":{"name":"温州市","cp":[120.498,27.8119],"childNum":9},"geometry":{"type":"Polygon","coordinates":["@@ll@xnXV`VX„WVL@lXnlV@UV@@b@¤VzUlnV„U@nWxšW@b@LnalK@bšXVKUƒÈ@VV„I@b@Jš@WbXLÆaUU„mšI@xlKnn„@VWlbkXV‚@n„VWnœ‚WbUb„L@`VbUnVlVXkV@lUz±‚VnUbU@@VUlVL@l„_@V@l@LVbV@XLV`VÈlxn@lU@aœaVV‚k„@XJ@nl@@LU`°LVb„L°a@a„UVy@anI@a„a‚nV@²wÜJX@VšVV°k„na@WVk„aWwU@m@™ƒkƒaUĕ™ÝšÝŤnÈa„aóI›»@±X™WkUķ@kV±kw™ƒUkWw„™UƒÝ»ÛkɳlImaUaWóXÿǬk‚UnWVmmk™KţnŏÞğl™„UlUx@XWb„V@JkXƒ°mb@VULVxUVk@@LWWk@WIkšƒUkJmUkVmI@yƒ@Ua™kLm‚U@mUUUkaVk™@mK@UlUU@UmKmbUUUJ@n@KVLUL@VkJWXX`mnULWlkL@JVLVb@°kxkU@LVŽ™V@„VLV`UL@VUX"],"encodeOffsets":[[122502,28334]]}},{"type":"Feature","id":"3302","properties":{"name":"宁波市","cp":[121.5967,29.6466],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@Ċ¦ĸĀ°‚nXÞVšKškƨƑźÿ°»n„@wô¥ÜbœU°ÆXÞWóçĉݱIUƒÈ¥@U°wÆ»²mm_@aXƒVKÞVlk@akk›̅@£X»VwƏXWa¯aȗb™KƽۃĊ™xƒLóŽk@ƒƒƒ@¯nƒKUL@xkL›ÑkWULUUmJUXVŽU@mŽUX¯@V`mbXbV@@nn¤WXšx@škJ@nVVUVl²UbÝVUVk@Wx@V@„ƒVXzmlaƒL@VlLU`„XUVVVUnl@VbnJlnUVVnƒlUKkbmnn„VxlJnxmbU@UL@KUV™X@xmb@lk@mnVVUš™è"],"encodeOffsets":[[123784,30977]]}},{"type":"Feature","id":"3309","properties":{"name":"舟山市","cp":[122.2559,30.2234],"childNum":3},"geometry":{"type":"Polygon","coordinates":["@@l΢ƒʠþÆVĢLĊƒǬXĊ܄XôV„ÑÆw„ƒlšƏÈóVĭVǓ@ƒĉwɛkmK@ĉXīWaĉUĵÝmƒ¯ĉƒwĉ±±nż¯x@VǦV„²JĊÞôèÝXÅW¯›VÛaó¦@xƒŽmŽ¯¼ŹĀ"],"encodeOffsets":[[124437,30983]]}},{"type":"Feature","id":"3310","properties":{"name":"台州市","cp":[121.1353,28.6688],"childNum":7},"geometry":{"type":"Polygon","coordinates":["@@lV„IVWVz@bXJl@Xal@°„nLll@nVxnV„K@UJVbƒ¦°„k`UIWJXnƚ@bUJ„Xl@lb„Wn@UzVV@bVVšmVnnJVXna‚bšKUKnUVVUnVLlKVLXa„Jm£@mU@WanaU_°@VWnV@UVWnIVVVKlXœÒlK@wVK„L°m„@„„l@ô„Kšw„ĉƾůUƒl£@»UƒVk„m@ƅUƒƒaÛIŏmUk@m„w@a™£ƒWk@ţšƒIm±@ankôUlaU™Uw¯ƒōaƒbÇbţm™ÞšÞVĖ„b„l@š@n‚VXxƒbUl@XmbƒŽ¯lUUU™W@ÛI±xU@mƒb@bmJ@bUzƒV@b¯bƒKUa¯KV_@Kk@@mWIƒ@lUU›b@bkVm@kwUÇU_WKU@Ux™@ƒVUnllX@Vn‚J@UXV@bWL@lUbbVLUJ@z‚V@lnbWbnnnJVŽ@L"],"encodeOffsets":[[123312,29526]]}},{"type":"Feature","id":"3307","properties":{"name":"金华市","cp":[120.0037,29.1028],"childNum":8},"geometry":{"type":"Polygon","coordinates":["@@nbVb„@VbUVlb@VUnVxk`lXnJlbnƒlL@bX@Vƒ@klƒV@nLnx@JlI„V‚U@VUVn„VV„I@WVLVbVKXbWnXl@VlXUx„b@ŽlVUbl„œlVUšIÜVnalKX@@bV@@aUUlUƒwUw„@naWW„UVaUUšaVb„LlxXJVk°ƒUƒlkU¥@k„a@LVlXLVlšVWznVn@lxšJl_@WX_@mVa„a@alU@kVVna„KVLlK„b@UUaVašbnUWmXU@k@yVI@ařWmXIVJl_¯ƒ„¥UaVI@ƒLmUUw@mkkmK¯ƒk@Wbk@WI@aUyUXƒJkU@bU@WLUyƒXUbkbW`UVVkKmbUaVUƒUK™£@KVUUUm@UWkXWaUKƒV@b¯ƒ¯mU™V@UkƒmW@kkKƒwUƒmkkVUI@WlkUamL@Wk_Wƒ@UVm@Ua¯KWXk@Uxm@UK@xV„mV@Xk@UVV¼@‚VLUb™Uƒ„U@ƒyULUbVlU@@XlVUVVbƒU@lXXVW@XUVl@@VUVƒÈn@VVU„@lVa@„U„mL@`X@`WL@VUX@lUL@xlx"],"encodeOffsets":[[122119,29948]]}},{"type":"Feature","id":"3308","properties":{"name":"衢州市","cp":[118.6853,28.8666],"childNum":5},"geometry":{"type":"Polygon","coordinates":["@@XkVKnwl@@aVK@UšwnL‚K@aÞaš¹@Kb@UVaUaVaVK@k°V„UllnL@„V@šxV@œšV@VV„m„_Wa„m@wlaÞbn@lL@WnLšk@V@VlK@nkVVb@blKXklakw@wVK@kVW@UXK@_‚W@_nKVƒ@ƒUb@kVƒUUm@„ÇVU@Uk@VU@WUXWW@k„VUaVUkU@WWXUKk@Ukmm¯LmmƒUJUIWJkImmƒ_—±WLkKm£@aVUmKUnƒLmWUkVmw@¥U„LVWm@WUka@UmmLmm@@bUX™@@WUIm@UVUK@UVUUU™VVJmb@b„Xn‚mVƒ¼nnn¦mJUVƒL„V@VW@UzUlVnUbl`UnVl@XU@kl@bmÈUx™Vk@@J@„ƒ¼W@ÅaVVnzmVƒ„@WJk@kWJ@ƒlXbWbXxmVnšlLXb@°lKVXnWšbWV„„X„mbV@Xl‚bšI@Kn@@x@šVLlm"],"encodeOffsets":[[121185,30184]]}},{"type":"Feature","id":"3306","properties":{"name":"绍兴市","cp":[120.564,29.7565],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@„x@„˜VnnVJnIVJV_VKXblUXJlŽlLUŽUnU@UVVX@ŽmVUUUJl„XUlbV@@V„LVmX@@XlaVJVXXJ@b‚@XU„@lUšJ„È‚bœ¤Ō„JšçV™UUnml@@kna@wšWVU@LVKV@namwkIUwmƒnmlaVL„kUmVUkmmIUak@VmUUVUƒWV_kK@U„K‚bnkWy„U@ƒ@UXwl@VUÞUVak±VUUU@mlI@™™wXWƒIWbUKkLUKVmUUmVVL™LambUWmIUm™nUU@aUUVym@ƒXkak@ƒW@z@lWVXnmV™aUbVb@VƒakLUKƒLmbUU@lkV@bƒbUb@nW`@Xk`™Ikwm@mUXy™UUkWKUk@Kƒb@lV¦klV„¯„UlWIkwƒKUa™bVVUbƒVXXmbƒ@Vx„xkVVV@bU@@aW@kLmb@lVUIVKmL@bUV@bUV@L„a˜lnUV@nbVbUlVXšJVUnx"],"encodeOffsets":[[122997,30561]]}},{"type":"Feature","id":"3304","properties":{"name":"嘉兴市","cp":[120.9155,30.6354],"childNum":6},"geometry":{"type":"Polygon","coordinates":["@@@blIX@@VÜVUnn@l‚k„lKnI°Þl`²LVKVbnbVaVLUVn@W¦@VkVVb„@VI„`@blLnL‚aX@„VVb@U‚@XlVa„@@kVaUKV»U_lWXUƒƒ@alb„k@VllnLVKn@@UVIUw@y°IVVXU@VV@lw„m@wVkƾaœJ‚LkΡƧƒ™l™LÝUmW¯ķÿĉ¥ƒIŋŽWn™èkVƧU¯ÅmlVx@V¯aƒz„Ž@„@JU@U¦m@@šnVmn@V„LV‚"],"encodeOffsets":[[123233,31382]]}},{"type":"Feature","id":"3305","properties":{"name":"湖州市","cp":[119.8608,30.7782],"childNum":4},"geometry":{"type":"Polygon","coordinates":["@@kLlƒkm@VmÛU@UW@kJ@aUƒK@UnmmU@™maÛL@JWUUKUwUIUJ@XƒKWV@Vk@UIUmVk@mm@ÅnmaUVkL@VƒKmLVbU@klU@ÝbV™@mVUKV™@wUkVƒ—ƒmIUJ@nVV@L™akJWbUIka@UmKmLKmmƒUUVk@@nmLX`WXUV@Ž@nUl™kmlU@Ub„„ƒxVVšIlV„Žšnn„@@n˜„UҚ@„°n@@xmb@„VbnV@šš„@b@`@L@L@x@blVklVbnnV@‚aXb°VlU@W„b°U„LXWVUV™„™VwÈwÜ»ĸaĠnUVw²X@V@lVU@wlaUUVm@knUV›"],"encodeOffsets":[[123379,31500]]}}],"UTF8Encoding":true}; }); -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:支持半平滑的polygon,折线面积图使用 - * 可配图形属性: - { - // 基础属性 - shape : 'halfSmoothPolygon', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - pointList : {Array}, // 必须,多边形各个顶角坐标 - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'halfSmoothPolygon', - id : '123456', - zlevel : 1, - style : { - pointList : [[10, 10], [300, 20], [298, 400], [50, 450]] - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function (eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define('echarts/util/shape/HalfSmoothPolygon',['require','zrender/shape/Base','zrender/shape/util/smoothBezier','zrender/tool/util','zrender/shape/Polygon'],function (require) { - var Base = require('zrender/shape/Base'); - var smoothBezier = require('zrender/shape/util/smoothBezier'); - var zrUtil = require('zrender/tool/util'); - - function HalfSmoothPolygon(options) { - Base.call(this, options); - } - - HalfSmoothPolygon.prototype = { - type : 'half-smooth-polygon', - /** - * 创建多边形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function (ctx, style) { - var pointList = style.pointList; - if (pointList.length < 2) { - // 少于2个点就不画了~ - return; - } - if (style.smooth) { - var controlPoints = smoothBezier( - pointList.slice(0, -2), style.smooth - ); - - ctx.moveTo(pointList[0][0], pointList[0][1]); - var cp1; - var cp2; - var p; - var l = pointList.length; - for (var i = 0; i < l - 3; i++) { - cp1 = controlPoints[i * 2]; - cp2 = controlPoints[i * 2 + 1]; - p = pointList[i + 1]; - ctx.bezierCurveTo( - cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1] - ); - } - ctx.lineTo(pointList[l - 2][0], pointList[l - 2][1]); - ctx.lineTo(pointList[l - 1][0], pointList[l - 1][1]); - ctx.lineTo(pointList[0][0], pointList[0][1]); - } - else { - require('zrender/shape/Polygon').prototype.buildPath( - ctx, style - ); - } - return; - } - }; - - zrUtil.inherits(HalfSmoothPolygon, Base); - - return HalfSmoothPolygon; +/** + * zrender + * + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + * shape类:支持半平滑的polygon,折线面积图使用 + * 可配图形属性: + { + // 基础属性 + shape : 'halfSmoothPolygon', // 必须,shape类标识,需要显式指定 + id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 + zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 + invisible : {boolean}, // 默认为false,是否可见 + + // 样式属性,默认状态样式样式属性 + style : { + pointList : {Array}, // 必须,多边形各个顶角坐标 + }, + + // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 + highlightStyle : { + // 同style + } + + // 交互属性,详见shape.Base + + // 事件属性,详见shape.Base + } + 例子: + { + shape : 'halfSmoothPolygon', + id : '123456', + zlevel : 1, + style : { + pointList : [[10, 10], [300, 20], [298, 400], [50, 450]] + color : '#eee', + text : 'Baidu' + }, + myName : 'kener', // 可自带任何有效自定义属性 + + clickable : true, + onClick : function (eventPacket) { + alert(eventPacket.target.myName); + } + } + */ +define('echarts/util/shape/HalfSmoothPolygon',['require','zrender/shape/Base','zrender/shape/util/smoothBezier','zrender/tool/util','zrender/shape/Polygon'],function (require) { + var Base = require('zrender/shape/Base'); + var smoothBezier = require('zrender/shape/util/smoothBezier'); + var zrUtil = require('zrender/tool/util'); + + function HalfSmoothPolygon(options) { + Base.call(this, options); + } + + HalfSmoothPolygon.prototype = { + type : 'half-smooth-polygon', + /** + * 创建多边形路径 + * @param {Context2D} ctx Canvas 2D上下文 + * @param {Object} style 样式 + */ + buildPath : function (ctx, style) { + var pointList = style.pointList; + if (pointList.length < 2) { + // 少于2个点就不画了~ + return; + } + if (style.smooth) { + var controlPoints = smoothBezier( + pointList.slice(0, -2), style.smooth, false, style.smoothConstraint + ); + + ctx.moveTo(pointList[0][0], pointList[0][1]); + var cp1; + var cp2; + var p; + var l = pointList.length; + for (var i = 0; i < l - 3; i++) { + cp1 = controlPoints[i * 2]; + cp2 = controlPoints[i * 2 + 1]; + p = pointList[i + 1]; + ctx.bezierCurveTo( + cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1] + ); + } + ctx.lineTo(pointList[l - 2][0], pointList[l - 2][1]); + ctx.lineTo(pointList[l - 1][0], pointList[l - 1][1]); + ctx.lineTo(pointList[0][0], pointList[0][1]); + } + else { + require('zrender/shape/Polygon').prototype.buildPath( + ctx, style + ); + } + return; + } + }; + + zrUtil.inherits(HalfSmoothPolygon, Base); + + return HalfSmoothPolygon; }); -/** - * echarts图表类:折线图 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/chart/line',['require','../component/base','./base','zrender/shape/BrokenLine','../util/shape/Icon','../util/shape/HalfSmoothPolygon','../component/axis','../component/grid','../component/dataZoom','../config','../util/ecData','zrender/tool/util','zrender/tool/color','../chart'],function (require) { - var ComponentBase = require('../component/base'); - var ChartBase = require('./base'); - - // 图形依赖 - var BrokenLineShape = require('zrender/shape/BrokenLine'); - var IconShape = require('../util/shape/Icon'); - var HalfSmoothPolygonShape = require('../util/shape/HalfSmoothPolygon'); - // 组件依赖 - require('../component/axis'); - require('../component/grid'); - require('../component/dataZoom'); - - var ecConfig = require('../config'); - var ecData = require('../util/ecData'); - var zrUtil = require('zrender/tool/util'); - var zrColor = require('zrender/tool/color'); - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} series 数据 - * @param {Object} component 组件 - */ - function Line(ecTheme, messageCenter, zr, option, myChart){ - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); - // 图表基类 - ChartBase.call(this); - - this.refresh(option); - } - - Line.prototype = { - type : ecConfig.CHART_TYPE_LINE, - /** - * 绘制图形 - */ - _buildShape : function () { - var series = this.series; - this.finalPLMap = {}; // 完成的point list(PL) - this._sIndex2ColorMap = {}; // series默认颜色索引,seriesIndex索引到color - this._symbol = this.option.symbolList; - this._sIndex2ShapeMap = {}; // series拐点图形类型,seriesIndex索引到shape type - - this.selectedMap = {}; - this.xMarkMap = {}; - - // 水平垂直双向series索引 ,position索引到seriesIndex - var _position2sIndexMap = { - top : [], - bottom : [], - left : [], - right : [] - }; - var xAxisIndex; - var yAxisIndex; - var xAxis; - var yAxis; - for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type == this.type) { - series[i] = this.reformOption(series[i]); - xAxisIndex = series[i].xAxisIndex; - yAxisIndex = series[i].yAxisIndex; - xAxis = this.component.xAxis.getAxis(xAxisIndex); - yAxis = this.component.yAxis.getAxis(yAxisIndex); - if (xAxis.type == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY - ) { - _position2sIndexMap[xAxis.getPosition()].push(i); - } - else if (yAxis.type == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY - ) { - _position2sIndexMap[yAxis.getPosition()].push(i); - } - } - } - // console.log(_position2sIndexMap); - for (var position in _position2sIndexMap) { - if (_position2sIndexMap[position].length > 0) { - this._buildSinglePosition( - position, _position2sIndexMap[position] - ); - } - } - this.addShapeList(); - }, - - /** - * 构建单个方向上的折线图 - * - * @param {number} seriesIndex 系列索引 - */ - _buildSinglePosition : function (position, seriesArray) { - var mapData = this._mapData(seriesArray); - var locationMap = mapData.locationMap; - var maxDataLength = mapData.maxDataLength; - - if (maxDataLength === 0 || locationMap.length === 0) { - return; - } - switch (position) { - case 'bottom' : - case 'top' : - this._buildHorizontal(seriesArray, maxDataLength, locationMap, this.xMarkMap); - break; - case 'left' : - case 'right' : - this._buildVertical(seriesArray, maxDataLength, locationMap, this.xMarkMap); - break; - } - - for (var i = 0, l = seriesArray.length; i < l; i++) { - this.buildMark(seriesArray[i]); - } - }, - - /** - * 数据整形 - * 数组位置映射到系列索引 - */ - _mapData : function (seriesArray) { - var series = this.series; - var serie; // 临时映射变量 - var dataIndex = 0; // 堆积数据所在位置映射 - var stackMap = {}; // 堆积数据位置映射,堆积组在二维中的第几项 - var magicStackKey = '__kener__stack__'; // 堆积命名,非堆积数据安单一堆积处理 - var stackKey; // 临时映射变量 - var serieName; // 临时映射变量 - var legend = this.component.legend; - var locationMap = []; // 需要返回的东西:数组位置映射到系列索引 - var maxDataLength = 0; // 需要返回的东西:最大数据长度 - var iconShape; - // 计算需要显示的个数和分配位置并记在下面这个结构里 - for (var i = 0, l = seriesArray.length; i < l; i++) { - serie = series[seriesArray[i]]; - serieName = serie.name; - - this._sIndex2ShapeMap[seriesArray[i]] - = this._sIndex2ShapeMap[seriesArray[i]] - || this.query(serie,'symbol') - || this._symbol[i % this._symbol.length]; - - if (legend){ - this.selectedMap[serieName] = legend.isSelected(serieName); - - this._sIndex2ColorMap[seriesArray[i]] - = legend.getColor(serieName); - - iconShape = legend.getItemShape(serieName); - if (iconShape) { - // 回调legend,换一个更形象的icon - iconShape.style.iconType = 'legendLineIcon'; - iconShape.style.symbol = - this._sIndex2ShapeMap[seriesArray[i]]; - - legend.setItemShape(serieName, iconShape); - } - } else { - this.selectedMap[serieName] = true; - this._sIndex2ColorMap[seriesArray[i]] - = this.zr.getColor(seriesArray[i]); - } - - if (this.selectedMap[serieName]) { - stackKey = serie.stack || (magicStackKey + seriesArray[i]); - if (typeof stackMap[stackKey] == 'undefined') { - stackMap[stackKey] = dataIndex; - locationMap[dataIndex] = [seriesArray[i]]; - dataIndex++; - } - else { - // 已经分配了位置就推进去就行 - locationMap[stackMap[stackKey]].push(seriesArray[i]); - } - } - // 兼职帮算一下最大长度 - maxDataLength = Math.max(maxDataLength, serie.data.length); - } - /* 调试输出 - var s = ''; - for (var i = 0, l = maxDataLength; i < l; i++) { - s = '['; - for (var j = 0, k = locationMap.length; j < k; j++) { - s +='[' - for (var m = 0, n = locationMap[j].length - 1; m < n; m++) { - s += series[locationMap[j][m]].data[i] + ',' - } - s += series[locationMap[j][locationMap[j].length - 1]] - .data[i]; - s += ']' - } - s += ']'; - console.log(s); - } - console.log(locationMap) - */ - - return { - locationMap : locationMap, - maxDataLength : maxDataLength - }; - }, - - /** - * 构建类目轴为水平方向的折线图系列 - */ - _buildHorizontal : function (seriesArray, maxDataLength, locationMap, xMarkMap) { - var series = this.series; - // 确定类目轴和数值轴,同一方向随便找一个即可 - var seriesIndex = locationMap[0][0]; - var serie = series[seriesIndex]; - var xAxisIndex = serie.xAxisIndex; - var categoryAxis = this.component.xAxis.getAxis(xAxisIndex); - var yAxisIndex; // 数值轴各异 - var valueAxis; // 数值轴各异 - - var x; - var y; - var lastYP; // 正向堆积处理 - var baseYP; - var lastYN; // 负向堆积处理 - var baseYN; - //var this.finalPLMap = {}; // 完成的point list(PL) - var curPLMap = {}; // 正在记录的point list(PL) - var data; - var value; - for (var i = 0, l = maxDataLength; i < l; i++) { - if (typeof categoryAxis.getNameByIndex(i) == 'undefined') { - // 系列数据超出类目轴长度 - break; - } - x = categoryAxis.getCoordByIndex(i); - for (var j = 0, k = locationMap.length; j < k; j++) { - // 堆积数据用第一条valueAxis - yAxisIndex = series[locationMap[j][0]].yAxisIndex || 0; - valueAxis = this.component.yAxis.getAxis(yAxisIndex); - baseYP = lastYP = baseYN = lastYN = valueAxis.getCoord(0); - for (var m = 0, n = locationMap[j].length; m < n; m++) { - seriesIndex = locationMap[j][m]; - serie = series[seriesIndex]; - data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; - curPLMap[seriesIndex] = curPLMap[seriesIndex] || []; - xMarkMap[seriesIndex] = xMarkMap[seriesIndex] - || { - min : Number.POSITIVE_INFINITY, - max : Number.NEGATIVE_INFINITY, - sum : 0, - counter : 0, - average : 0 - }; - if (value == '-') { - // 空数据则把正在记录的curPLMap添加到finalPLMap中 - if (curPLMap[seriesIndex].length > 0) { - this.finalPLMap[seriesIndex] = - this.finalPLMap[seriesIndex] || []; - - this.finalPLMap[seriesIndex].push( - curPLMap[seriesIndex] - ); - - curPLMap[seriesIndex] = []; - } - continue; - } - //y = valueAxis.getCoord(value); - if (value >= 0) { - // 正向堆积 - lastYP -= m > 0 - ? valueAxis.getCoordSize(value) - : (baseYP - valueAxis.getCoord(value)); - y = lastYP; - } - else if (value < 0){ - // 负向堆积 - lastYN += m > 0 - ? valueAxis.getCoordSize(value) - : (valueAxis.getCoord(value) - baseYN); - y = lastYN; - } - curPLMap[seriesIndex].push( - [x, y, i, categoryAxis.getNameByIndex(i), x, baseYP] - ); - - if (xMarkMap[seriesIndex].min > value) { - xMarkMap[seriesIndex].min = value; - xMarkMap[seriesIndex].minY = y; - xMarkMap[seriesIndex].minX = x; - } - if (xMarkMap[seriesIndex].max < value) { - xMarkMap[seriesIndex].max = value; - xMarkMap[seriesIndex].maxY = y; - xMarkMap[seriesIndex].maxX = x; - } - xMarkMap[seriesIndex].sum += value; - xMarkMap[seriesIndex].counter++; - } - } - // 补充空数据的拖拽提示 - lastYP = this.component.grid.getY(); - var symbolSize; - for (var j = 0, k = locationMap.length; j < k; j++) { - for (var m = 0, n = locationMap[j].length; m < n; m++) { - seriesIndex = locationMap[j][m]; - serie = series[seriesIndex]; - data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; - if (value != '-') { - // 只关心空数据 - continue; - } - if (this.deepQuery( - [data, serie, this.option], 'calculable' - ) - ) { - symbolSize = this.deepQuery( - [data, serie], - 'symbolSize' - ); - lastYP += symbolSize * 2 + 5; - y = lastYP; - this.shapeList.push(this._getCalculableItem( - seriesIndex, i, categoryAxis.getNameByIndex(i), - x, y, 'horizontal' - )); - } - } - } - } - - // 把剩余未完成的curPLMap全部添加到finalPLMap中 - for (var sId in curPLMap) { - if (curPLMap[sId].length > 0) { - this.finalPLMap[sId] = this.finalPLMap[sId] || []; - this.finalPLMap[sId].push(curPLMap[sId]); - curPLMap[sId] = []; - } - } - - for (var j = 0, k = locationMap.length; j < k; j++) { - for (var m = 0, n = locationMap[j].length; m < n; m++) { - seriesIndex = locationMap[j][m]; - if (xMarkMap[seriesIndex].counter > 0) { - xMarkMap[seriesIndex].average = - (xMarkMap[seriesIndex].sum / xMarkMap[seriesIndex].counter).toFixed(2) - - 0; - } - y = this.component.yAxis.getAxis(series[seriesIndex].yAxisIndex || 0) - .getCoord(xMarkMap[seriesIndex].average); - xMarkMap[seriesIndex].averageLine = [ - [this.component.grid.getX(), y], - [this.component.grid.getXend(), y] - ]; - - xMarkMap[seriesIndex].minLine = [ - [this.component.grid.getX(), xMarkMap[seriesIndex].minY], - [this.component.grid.getXend(), xMarkMap[seriesIndex].minY] - ]; - xMarkMap[seriesIndex].maxLine = [ - [this.component.grid.getX(), xMarkMap[seriesIndex].maxY], - [this.component.grid.getXend(), xMarkMap[seriesIndex].maxY] - ]; - } - } - - this._buildBorkenLine(seriesArray, this.finalPLMap, categoryAxis, 'horizontal'); - }, - - /** - * 构建类目轴为垂直方向的折线图系列 - */ - _buildVertical : function (seriesArray, maxDataLength, locationMap, xMarkMap) { - var series = this.series; - // 确定类目轴和数值轴,同一方向随便找一个即可 - var seriesIndex = locationMap[0][0]; - var serie = series[seriesIndex]; - var yAxisIndex = serie.yAxisIndex; - var categoryAxis = this.component.yAxis.getAxis(yAxisIndex); - var xAxisIndex; // 数值轴各异 - var valueAxis; // 数值轴各异 - - var x; - var y; - var lastXP; // 正向堆积处理 - var baseXP; - var lastXN; // 负向堆积处理 - var baseXN; - //var this.finalPLMap = {}; // 完成的point list(PL) - var curPLMap = {}; // 正在记录的point list(PL) - var data; - var value; - for (var i = 0, l = maxDataLength; i < l; i++) { - if (typeof categoryAxis.getNameByIndex(i) == 'undefined') { - // 系列数据超出类目轴长度 - break; - } - y = categoryAxis.getCoordByIndex(i); - for (var j = 0, k = locationMap.length; j < k; j++) { - // 堆积数据用第一条valueAxis - xAxisIndex = series[locationMap[j][0]].xAxisIndex || 0; - valueAxis = this.component.xAxis.getAxis(xAxisIndex); - baseXP = lastXP = baseXN = lastXN = valueAxis.getCoord(0); - for (var m = 0, n = locationMap[j].length; m < n; m++) { - seriesIndex = locationMap[j][m]; - serie = series[seriesIndex]; - data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; - curPLMap[seriesIndex] = curPLMap[seriesIndex] || []; - xMarkMap[seriesIndex] = xMarkMap[seriesIndex] - || { - min : Number.POSITIVE_INFINITY, - max : Number.NEGATIVE_INFINITY, - sum : 0, - counter : 0, - average : 0 - }; - if (value == '-') { - // 空数据则把正在记录的curPLMap添加到finalPLMap中 - if (curPLMap[seriesIndex].length > 0) { - this.finalPLMap[seriesIndex] = - this.finalPLMap[seriesIndex] || []; - - this.finalPLMap[seriesIndex].push( - curPLMap[seriesIndex] - ); - - curPLMap[seriesIndex] = []; - } - continue; - } - //x = valueAxis.getCoord(value); - if (value >= 0) { - // 正向堆积 - lastXP += m > 0 - ? valueAxis.getCoordSize(value) - : (valueAxis.getCoord(value) - baseXP); - x = lastXP; - } - else if (value < 0){ - // 负向堆积 - lastXN -= m > 0 - ? valueAxis.getCoordSize(value) - : (baseXN - valueAxis.getCoord(value)); - x = lastXN; - } - curPLMap[seriesIndex].push( - [x, y, i, categoryAxis.getNameByIndex(i), baseXP, y] - ); - - if (xMarkMap[seriesIndex].min > value) { - xMarkMap[seriesIndex].min = value; - xMarkMap[seriesIndex].minX = x; - xMarkMap[seriesIndex].minY = y; - } - if (xMarkMap[seriesIndex].max < value) { - xMarkMap[seriesIndex].max = value; - xMarkMap[seriesIndex].maxX = x; - xMarkMap[seriesIndex].maxY = y; - } - xMarkMap[seriesIndex].sum += value; - xMarkMap[seriesIndex].counter++; - } - } - // 补充空数据的拖拽提示 - lastXP = this.component.grid.getXend(); - var symbolSize; - for (var j = 0, k = locationMap.length; j < k; j++) { - for (var m = 0, n = locationMap[j].length; m < n; m++) { - seriesIndex = locationMap[j][m]; - serie = series[seriesIndex]; - data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; - if (value != '-') { - // 只关心空数据 - continue; - } - if (this.deepQuery( - [data, serie, this.option], 'calculable' - ) - ) { - symbolSize = this.deepQuery( - [data, serie], - 'symbolSize' - ); - lastXP -= symbolSize * 2 + 5; - x = lastXP; - this.shapeList.push(this._getCalculableItem( - seriesIndex, i, categoryAxis.getNameByIndex(i), - x, y, 'vertical' - )); - } - } - } - } - - // 把剩余未完成的curPLMap全部添加到finalPLMap中 - for (var sId in curPLMap) { - if (curPLMap[sId].length > 0) { - this.finalPLMap[sId] = this.finalPLMap[sId] || []; - this.finalPLMap[sId].push(curPLMap[sId]); - curPLMap[sId] = []; - } - } - - for (var j = 0, k = locationMap.length; j < k; j++) { - for (var m = 0, n = locationMap[j].length; m < n; m++) { - seriesIndex = locationMap[j][m]; - if (xMarkMap[seriesIndex].counter > 0) { - xMarkMap[seriesIndex].average = - (xMarkMap[seriesIndex].sum / xMarkMap[seriesIndex].counter).toFixed(2) - - 0; - } - - x = this.component.xAxis.getAxis(series[seriesIndex].xAxisIndex || 0) - .getCoord(xMarkMap[seriesIndex].average); - - xMarkMap[seriesIndex].averageLine = [ - [x, this.component.grid.getYend()], - [x, this.component.grid.getY()] - ]; - xMarkMap[seriesIndex].minLine = [ - [xMarkMap[seriesIndex].minX, this.component.grid.getYend()], - [xMarkMap[seriesIndex].minX, this.component.grid.getY()] - ]; - xMarkMap[seriesIndex].maxLine = [ - [xMarkMap[seriesIndex].maxX, this.component.grid.getYend()], - [xMarkMap[seriesIndex].maxX, this.component.grid.getY()] - ]; - } - } - - this._buildBorkenLine(seriesArray, this.finalPLMap, categoryAxis, 'vertical'); - }, - - /** - * 生成折线和折线上的拐点 - */ - _buildBorkenLine : function (seriesArray, pointList, categoryAxis, orient) { - var series = this.series; - var defaultColor; - - // 折线相关 - var lineWidth; - var lineType; - var lineColor; - var normalColor; - - // 填充相关 - var isFill; - var fillNormalColor; - - var serie; - var data; - var seriesPL; - var singlePL; - var brokenLineShape; - var halfSmoothPolygonShape; - - var isLarge; - - // 堆积层叠需求,反顺序构建 - var seriesIndex; - for (var sIdx = seriesArray.length - 1; sIdx >= 0; sIdx--) { - seriesIndex = seriesArray[sIdx]; - serie = series[seriesIndex]; - seriesPL = pointList[seriesIndex]; - if (serie.type == this.type && typeof seriesPL != 'undefined') { - defaultColor = this._sIndex2ColorMap[seriesIndex]; - // 多级控制 - lineWidth = this.query( - serie, 'itemStyle.normal.lineStyle.width' - ); - lineType = this.query( - serie, 'itemStyle.normal.lineStyle.type' - ); - lineColor = this.query( - serie, 'itemStyle.normal.lineStyle.color' - ); - normalColor = this.getItemStyleColor( - this.query(serie, 'itemStyle.normal.color'), seriesIndex, -1 - ); - - isFill = typeof this.query( - serie, 'itemStyle.normal.areaStyle' - ) != 'undefined'; - - fillNormalColor = this.query( - serie, 'itemStyle.normal.areaStyle.color' - ); - - for (var i = 0, l = seriesPL.length; i < l; i++) { - singlePL = seriesPL[i]; - isLarge = this._isLarge(orient, singlePL); - if (!isLarge) { // 非大数据模式才显示拐点symbol - for (var j = 0, k = singlePL.length; j < k; j++) { - data = serie.data[singlePL[j][2]]; - if (this.deepQuery( - [data, serie], 'showAllSymbol' - ) // 全显示 - || (categoryAxis.isMainAxis(singlePL[j][2]) - && this.deepQuery( - [data, serie], 'symbol' - ) != 'none' - ) // 主轴非空 - || this.deepQuery( - [data, serie, this.option], - 'calculable' - ) // 可计算 - ) { - this.shapeList.push(this._getSymbol( - seriesIndex, - singlePL[j][2], // dataIndex - singlePL[j][3], // name - singlePL[j][0], // x - singlePL[j][1], // y - orient - )); - } - } - } - else { - // 大数据模式截取pointList - singlePL = this._getLargePointList(orient, singlePL); - } - - // 折线图 - brokenLineShape = new BrokenLineShape({ - zlevel : this._zlevelBase, - style : { - miterLimit: lineWidth, - pointList : singlePL, - strokeColor : lineColor - || normalColor - || defaultColor, - lineWidth : lineWidth, - lineType : lineType, - smooth : this._getSmooth(serie.smooth), - shadowColor : this.query( - serie, - 'itemStyle.normal.lineStyle.shadowColor' - ), - shadowBlur: this.query( - serie, - 'itemStyle.normal.lineStyle.shadowBlur' - ), - shadowOffsetX: this.query( - serie, - 'itemStyle.normal.lineStyle.shadowOffsetX' - ), - shadowOffsetY: this.query( - serie, - 'itemStyle.normal.lineStyle.shadowOffsetY' - ) - }, - hoverable : false, - _main : true, - _seriesIndex : seriesIndex, - _orient : orient - }); - - ecData.pack( - brokenLineShape, - series[seriesIndex], seriesIndex, - 0, i, series[seriesIndex].name - ); - - this.shapeList.push(brokenLineShape); - - if (isFill) { - halfSmoothPolygonShape = new HalfSmoothPolygonShape({ - zlevel : this._zlevelBase, - style : { - miterLimit: lineWidth, - pointList : zrUtil.clone(singlePL).concat([ - [ - singlePL[singlePL.length - 1][4], - singlePL[singlePL.length - 1][5] - ], - [ - singlePL[0][4], - singlePL[0][5] - ] - ]), - brushType : 'fill', - smooth : this._getSmooth(serie.smooth), - color : fillNormalColor - ? fillNormalColor - : zrColor.alpha(defaultColor,0.5) - }, - hoverable : false, - _main : true, - _seriesIndex : seriesIndex, - _orient : orient - }); - ecData.pack( - halfSmoothPolygonShape, - series[seriesIndex], seriesIndex, - 0, i, series[seriesIndex].name - ); - this.shapeList.push(halfSmoothPolygonShape); - } - } - } - } - }, - - _isLarge : function(orient, singlePL) { - if (singlePL.length < 2) { - return false; - } - else { - return orient == 'horizontal' - ? (Math.abs(singlePL[0][0] - singlePL[1][0]) < 0.5) - : (Math.abs(singlePL[0][1] - singlePL[1][1]) < 0.5); - } - }, - - /** - * 大规模pointList优化 - */ - _getLargePointList : function(orient, singlePL) { - var total; - if (orient == 'horizontal') { - total = this.component.grid.getWidth(); - } - else { - total = this.component.grid.getHeight(); - } - - var len = singlePL.length; - var newList = []; - for (var i = 0; i < total; i++) { - newList[i] = singlePL[Math.floor(len / total * i)]; - } - return newList; - }, - - _getSmooth : function (isSmooth/*, pointList, orient*/) { - if (isSmooth) { - /* 不科学啊,发现0.3通用了 - var delta; - if (orient == 'horizontal') { - delta = Math.abs(pointList[0][0] - pointList[1][0]); - } - else { - delta = Math.abs(pointList[0][1] - pointList[1][1]); - } - */ - return 0.3; - } - else { - return 0; - } - }, - - /** - * 生成空数据所需的可计算提示图形 - */ - _getCalculableItem : function (seriesIndex, dataIndex, name, x, y, orient) { - var series = this.series; - var color = series[seriesIndex].calculableHolderColor - || this.ecTheme.calculableHolderColor; - - var itemShape = this._getSymbol( - seriesIndex, dataIndex, name, - x, y, orient - ); - itemShape.style.color = color; - itemShape.style.strokeColor = color; - itemShape.rotation = [0,0]; - itemShape.hoverable = false; - itemShape.draggable = false; - itemShape.style.text = undefined; - - return itemShape; - }, - - /** - * 生成折线图上的拐点图形 - */ - _getSymbol : function (seriesIndex, dataIndex, name, x, y, orient) { - var series = this.series; - var serie = series[seriesIndex]; - var data = serie.data[dataIndex]; - - var itemShape = this.getSymbolShape( - serie, seriesIndex, data, dataIndex, name, - x, y, - this._sIndex2ShapeMap[seriesIndex], - this._sIndex2ColorMap[seriesIndex], - '#fff', - orient == 'vertical' ? 'horizontal' : 'vertical' // 翻转 - ); - itemShape.zlevel = this._zlevelBase + 1; - - if (this.deepQuery([data, serie, this.option], 'calculable')) { - this.setCalculable(itemShape); - itemShape.draggable = true; - } - - return itemShape; - }, - - // 位置转换 - getMarkCoord : function (seriesIndex, mpData) { - var serie = this.series[seriesIndex]; - var xMarkMap = this.xMarkMap[seriesIndex]; - var xAxis = this.component.xAxis.getAxis(serie.xAxisIndex); - var yAxis = this.component.yAxis.getAxis(serie.yAxisIndex); - - if (mpData.type - && (mpData.type == 'max' || mpData.type == 'min' || mpData.type == 'average') - ) { - // 特殊值内置支持 - return [ - xMarkMap[mpData.type + 'X'], - xMarkMap[mpData.type + 'Y'], - xMarkMap[mpData.type + 'Line'], - xMarkMap[mpData.type] - ]; - } - - return [ - typeof mpData.xAxis != 'string' && xAxis.getCoordByIndex - ? xAxis.getCoordByIndex(mpData.xAxis || 0) - : xAxis.getCoord(mpData.xAxis || 0), - - typeof mpData.yAxis != 'string' && yAxis.getCoordByIndex - ? yAxis.getCoordByIndex(mpData.yAxis || 0) - : yAxis.getCoord(mpData.yAxis || 0) - ]; - }, - - /** - * 刷新 - */ - refresh : function (newOption) { - if (newOption) { - this.option = newOption; - this.series = newOption.series; - } - - this.backupShapeList(); - this._buildShape(); - }, - - ontooltipHover : function (param, tipShape) { - var seriesIndex = param.seriesIndex; - var dataIndex = param.dataIndex; - var seriesPL; - var singlePL; - var len = seriesIndex.length; - while (len--) { - seriesPL = this.finalPLMap[seriesIndex[len]]; - if (seriesPL) { - for (var i = 0, l = seriesPL.length; i < l; i++) { - singlePL = seriesPL[i]; - for (var j = 0, k = singlePL.length; j < k; j++) { - if (dataIndex == singlePL[j][2]) { - tipShape.push(this._getSymbol( - seriesIndex[len], // seriesIndex - singlePL[j][2], // dataIndex - singlePL[j][3], // name - singlePL[j][0], // x - singlePL[j][1], // y - 'horizontal' - )); - } - } - } - } - } - }, - - /** - * 动态数据增加动画 - */ - addDataAnimation : function (params) { - var series = this.series; - var aniMap = {}; // seriesIndex索引参数 - for (var i = 0, l = params.length; i < l; i++) { - aniMap[params[i][0]] = params[i]; - } - var x; - var dx; - var y; - var dy; - var seriesIndex; - var pointList; - var isHorizontal; // 是否横向布局, isHorizontal; - for (var i = this.shapeList.length - 1; i >= 0; i--) { - seriesIndex = this.shapeList[i]._seriesIndex; - if (aniMap[seriesIndex] && !aniMap[seriesIndex][3]) { - // 有数据删除才有移动的动画 - if (this.shapeList[i]._main && this.shapeList[i].style.pointList.length > 1) { - pointList = this.shapeList[i].style.pointList; - // 主线动画 - dx = Math.abs(pointList[0][0] - pointList[1][0]); - dy = Math.abs(pointList[0][1] - pointList[1][1]); - isHorizontal = - this.shapeList[i]._orient == 'horizontal'; - - if (aniMap[seriesIndex][2]) { - // 队头加入删除末尾 - if (this.shapeList[i].type == 'polygon') { - //区域图 - var len = pointList.length; - this.shapeList[i].style.pointList[len - 3] - = pointList[len - 2]; - isHorizontal - ? (this.shapeList[i].style.pointList[len - 3][0] - = pointList[len - 4][0] - ) - : (this.shapeList[i].style.pointList[len - 3][1] - = pointList[len - 4][1] - ); - this.shapeList[i].style.pointList[len - 2] - = pointList[len - 1]; - } - this.shapeList[i].style.pointList.pop(); - - isHorizontal ? (x = dx, y = 0) : (x = 0, y = -dy); - } - else { - // 队尾加入删除头部 - this.shapeList[i].style.pointList.shift(); - if (this.shapeList[i].type == 'polygon') { - //区域图 - var targetPoint = - this.shapeList[i].style.pointList.pop(); - isHorizontal - ? (targetPoint[0] = pointList[0][0]) - : (targetPoint[1] = pointList[0][1]); - this.shapeList[i].style.pointList.push( - targetPoint - ); - } - isHorizontal ? (x = -dx, y = 0) : (x = 0, y = dy); - } - - this.zr.modShape( - this.shapeList[i].id, - { - style : { - pointList: this.shapeList[i].style.pointList - } - }, - true - ); - } - else { - // 拐点动画 - if (aniMap[seriesIndex][2] - && this.shapeList[i]._dataIndex - == series[seriesIndex].data.length - 1 - ) { - // 队头加入删除末尾 - this.zr.delShape(this.shapeList[i].id); - continue; - } - else if (!aniMap[seriesIndex][2] - && this.shapeList[i]._dataIndex === 0 - ) { - // 队尾加入删除头部 - this.zr.delShape(this.shapeList[i].id); - continue; - } - } - this.shapeList[i].position = [0, 0]; - this.zr.animate(this.shapeList[i].id, '') - .when( - 500, - {position : [x, y]} - ) - .start(); - } - } - } - }; - - function legendLineIcon(ctx, style) { - var x = style.x; - var y = style.y; - var width = style.width; - var height = style.height; - - var dy = height / 2; - - if (style.symbol.match('empty')) { - ctx.fillStyle = '#fff'; - } - style.brushType = 'both'; - - var symbol = style.symbol.replace('empty', '').toLowerCase(); - if (symbol.match('star')) { - dy = (symbol.replace('star','') - 0) || 5; - y -= 1; - symbol = 'star'; - } - else if (symbol == 'rectangle' || symbol == 'arrow') { - x += (width - height) / 2; - width = height; - } - - var imageLocation = ''; - if (symbol.match('image')) { - imageLocation = symbol.replace( - new RegExp('^image:\\/\\/'), '' - ); - symbol = 'image'; - x += Math.round((width - height) / 2) - 1; - width = height = height + 2; - } - symbol = IconShape.prototype.iconLibrary[symbol]; - - if (symbol) { - var x2 = style.x; - var y2 = style.y; - ctx.moveTo(x2, y2 + dy); - ctx.lineTo(x2 + 5, y2 + dy); - ctx.moveTo(x2 + style.width - 5, y2 + dy); - ctx.lineTo(x2 + style.width, y2 + dy); - - symbol(ctx, { - x : x + 4, - y : y + 4, - width : width - 8, - height : height - 8, - n : dy, - image : imageLocation - }); - - } - else { - ctx.moveTo(x, y + dy); - ctx.lineTo(x + width, y + dy); - } - } - IconShape.prototype.iconLibrary['legendLineIcon'] = legendLineIcon; - - zrUtil.inherits(Line, ChartBase); - zrUtil.inherits(Line, ComponentBase); - - // 图表注册 - require('../chart').define('line', Line); - - return Line; +/** + * echarts图表类:折线图 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/chart/line',['require','../component/base','./base','zrender/shape/BrokenLine','../util/shape/Icon','../util/shape/HalfSmoothPolygon','../component/axis','../component/grid','../component/dataZoom','../config','../util/ecData','zrender/tool/util','zrender/tool/color','../chart'],function (require) { + var ComponentBase = require('../component/base'); + var ChartBase = require('./base'); + + // 图形依赖 + var BrokenLineShape = require('zrender/shape/BrokenLine'); + var IconShape = require('../util/shape/Icon'); + var HalfSmoothPolygonShape = require('../util/shape/HalfSmoothPolygon'); + // 组件依赖 + require('../component/axis'); + require('../component/grid'); + require('../component/dataZoom'); + + var ecConfig = require('../config'); + var ecData = require('../util/ecData'); + var zrUtil = require('zrender/tool/util'); + var zrColor = require('zrender/tool/color'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} series 数据 + * @param {Object} component 组件 + */ + function Line(ecTheme, messageCenter, zr, option, myChart){ + // 基类 + ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); + // 图表基类 + ChartBase.call(this); + + this.refresh(option); + } + + Line.prototype = { + type: ecConfig.CHART_TYPE_LINE, + /** + * 绘制图形 + */ + _buildShape: function () { + var series = this.series; + this.finalPLMap = {}; // 完成的point list(PL) + this._sIndex2ColorMap = {}; // series默认颜色索引,seriesIndex索引到color + this._symbol = this.option.symbolList; + this._sIndex2ShapeMap = {}; // series拐点图形类型,seriesIndex索引到shape type + + this.selectedMap = {}; + this.xMarkMap = {}; + + // 水平垂直双向series索引 ,position索引到seriesIndex + var _position2sIndexMap = { + top: [ ], + bottom: [ ], + left: [ ], + right: [ ] + }; + var xAxisIndex; + var yAxisIndex; + var xAxis; + var yAxis; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type === this.type) { + series[i] = this.reformOption(series[i]); + xAxisIndex = series[i].xAxisIndex; + yAxisIndex = series[i].yAxisIndex; + xAxis = this.component.xAxis.getAxis(xAxisIndex); + yAxis = this.component.yAxis.getAxis(yAxisIndex); + if (xAxis.type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + ) { + _position2sIndexMap[xAxis.getPosition()].push(i); + } + else if (yAxis.type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + ) { + _position2sIndexMap[yAxis.getPosition()].push(i); + } + } + } + // console.log(_position2sIndexMap); + for (var position in _position2sIndexMap) { + if (_position2sIndexMap[position].length > 0) { + this._buildSinglePosition( + position, _position2sIndexMap[position] + ); + } + } + this.addShapeList(); + }, + + /** + * 构建单个方向上的折线图 + * + * @param {number} seriesIndex 系列索引 + */ + _buildSinglePosition: function (position, seriesArray) { + var mapData = this._mapData(seriesArray); + var locationMap = mapData.locationMap; + var maxDataLength = mapData.maxDataLength; + + if (maxDataLength === 0 || locationMap.length === 0) { + return; + } + switch (position) { + case 'bottom' : + case 'top' : + this._buildHorizontal(seriesArray, maxDataLength, locationMap, this.xMarkMap); + break; + case 'left' : + case 'right' : + this._buildVertical(seriesArray, maxDataLength, locationMap, this.xMarkMap); + break; + } + + for (var i = 0, l = seriesArray.length; i < l; i++) { + this.buildMark(seriesArray[i]); + } + }, + + /** + * 数据整形 + * 数组位置映射到系列索引 + */ + _mapData: function (seriesArray) { + var series = this.series; + var serie; // 临时映射变量 + var dataIndex = 0; // 堆积数据所在位置映射 + var stackMap = {}; // 堆积数据位置映射,堆积组在二维中的第几项 + var magicStackKey = '__kener__stack__'; // 堆积命名,非堆积数据安单一堆积处理 + var stackKey; // 临时映射变量 + var serieName; // 临时映射变量 + var legend = this.component.legend; + var locationMap = []; // 需要返回的东西:数组位置映射到系列索引 + var maxDataLength = 0; // 需要返回的东西:最大数据长度 + var iconShape; + // 计算需要显示的个数和分配位置并记在下面这个结构里 + for (var i = 0, l = seriesArray.length; i < l; i++) { + serie = series[seriesArray[i]]; + serieName = serie.name; + + this._sIndex2ShapeMap[seriesArray[i]] + = this._sIndex2ShapeMap[seriesArray[i]] + || this.query(serie,'symbol') + || this._symbol[i % this._symbol.length]; + + if (legend){ + this.selectedMap[serieName] = legend.isSelected(serieName); + + this._sIndex2ColorMap[seriesArray[i]] + = legend.getColor(serieName); + + iconShape = legend.getItemShape(serieName); + if (iconShape) { + // 回调legend,换一个更形象的icon + iconShape.style.iconType = 'legendLineIcon'; + iconShape.style.symbol = + this._sIndex2ShapeMap[seriesArray[i]]; + + legend.setItemShape(serieName, iconShape); + } + } else { + this.selectedMap[serieName] = true; + this._sIndex2ColorMap[seriesArray[i]] + = this.zr.getColor(seriesArray[i]); + } + + if (this.selectedMap[serieName]) { + stackKey = serie.stack || (magicStackKey + seriesArray[i]); + if (stackMap[stackKey] == null) { + stackMap[stackKey] = dataIndex; + locationMap[dataIndex] = [seriesArray[i]]; + dataIndex++; + } + else { + // 已经分配了位置就推进去就行 + locationMap[stackMap[stackKey]].push(seriesArray[i]); + } + } + // 兼职帮算一下最大长度 + maxDataLength = Math.max(maxDataLength, serie.data.length); + } + /* 调试输出 + var s = ''; + for (var i = 0, l = maxDataLength; i < l; i++) { + s = '['; + for (var j = 0, k = locationMap.length; j < k; j++) { + s +='[' + for (var m = 0, n = locationMap[j].length - 1; m < n; m++) { + s += series[locationMap[j][m]].data[i] + ',' + } + s += series[locationMap[j][locationMap[j].length - 1]] + .data[i]; + s += ']' + } + s += ']'; + console.log(s); + } + console.log(locationMap) + */ + + return { + locationMap: locationMap, + maxDataLength: maxDataLength + }; + }, + + /** + * 构建类目轴为水平方向的折线图系列 + */ + _buildHorizontal: function (seriesArray, maxDataLength, locationMap, xMarkMap) { + var series = this.series; + // 确定类目轴和数值轴,同一方向随便找一个即可 + var seriesIndex = locationMap[0][0]; + var serie = series[seriesIndex]; + var xAxisIndex = serie.xAxisIndex; + var categoryAxis = this.component.xAxis.getAxis(xAxisIndex); + var yAxisIndex; // 数值轴各异 + var valueAxis; // 数值轴各异 + + var x; + var y; + var lastYP; // 正向堆积处理 + var baseYP; + var lastYN; // 负向堆积处理 + var baseYN; + //var this.finalPLMap = {}; // 完成的point list(PL) + var curPLMap = {}; // 正在记录的point list(PL) + var data; + var value; + for (var i = 0, l = maxDataLength; i < l; i++) { + if (categoryAxis.getNameByIndex(i) == null) { + // 系列数据超出类目轴长度 + break; + } + x = categoryAxis.getCoordByIndex(i); + for (var j = 0, k = locationMap.length; j < k; j++) { + // 堆积数据用第一条valueAxis + yAxisIndex = series[locationMap[j][0]].yAxisIndex || 0; + valueAxis = this.component.yAxis.getAxis(yAxisIndex); + baseYP = lastYP = baseYN = lastYN = valueAxis.getCoord(0); + for (var m = 0, n = locationMap[j].length; m < n; m++) { + seriesIndex = locationMap[j][m]; + serie = series[seriesIndex]; + data = serie.data[i]; + value = data != null + ? (data.value != null + ? data.value + : data) + : '-'; + curPLMap[seriesIndex] = curPLMap[seriesIndex] || []; + xMarkMap[seriesIndex] = xMarkMap[seriesIndex] + || { + min: Number.POSITIVE_INFINITY, + max: Number.NEGATIVE_INFINITY, + sum: 0, + counter: 0, + average: 0 + }; + if (value === '-') { + // 空数据则把正在记录的curPLMap添加到finalPLMap中 + if (curPLMap[seriesIndex].length > 0) { + this.finalPLMap[seriesIndex] = + this.finalPLMap[seriesIndex] || []; + + this.finalPLMap[seriesIndex].push( + curPLMap[seriesIndex] + ); + + curPLMap[seriesIndex] = []; + } + continue; + } + //y = valueAxis.getCoord(value); + if (value >= 0) { + // 正向堆积 + lastYP -= m > 0 + ? valueAxis.getCoordSize(value) + : (baseYP - valueAxis.getCoord(value)); + y = lastYP; + } + else if (value < 0){ + // 负向堆积 + lastYN += m > 0 + ? valueAxis.getCoordSize(value) + : (valueAxis.getCoord(value) - baseYN); + y = lastYN; + } + curPLMap[seriesIndex].push( + [x, y, i, categoryAxis.getNameByIndex(i), x, baseYP] + ); + + if (xMarkMap[seriesIndex].min > value) { + xMarkMap[seriesIndex].min = value; + xMarkMap[seriesIndex].minY = y; + xMarkMap[seriesIndex].minX = x; + } + if (xMarkMap[seriesIndex].max < value) { + xMarkMap[seriesIndex].max = value; + xMarkMap[seriesIndex].maxY = y; + xMarkMap[seriesIndex].maxX = x; + } + xMarkMap[seriesIndex].sum += value; + xMarkMap[seriesIndex].counter++; + } + } + // 补充空数据的拖拽提示 + lastYP = this.component.grid.getY(); + var symbolSize; + for (var j = 0, k = locationMap.length; j < k; j++) { + for (var m = 0, n = locationMap[j].length; m < n; m++) { + seriesIndex = locationMap[j][m]; + serie = series[seriesIndex]; + data = serie.data[i]; + value = data != null + ? (data.value != null + ? data.value + : data) + : '-'; + if (value != '-') { + // 只关心空数据 + continue; + } + if (this.deepQuery( + [data, serie, this.option], 'calculable' + ) + ) { + symbolSize = this.deepQuery( + [data, serie], + 'symbolSize' + ); + lastYP += symbolSize * 2 + 5; + y = lastYP; + this.shapeList.push(this._getCalculableItem( + seriesIndex, i, categoryAxis.getNameByIndex(i), + x, y, 'horizontal' + )); + } + } + } + } + + // 把剩余未完成的curPLMap全部添加到finalPLMap中 + for (var sId in curPLMap) { + if (curPLMap[sId].length > 0) { + this.finalPLMap[sId] = this.finalPLMap[sId] || []; + this.finalPLMap[sId].push(curPLMap[sId]); + curPLMap[sId] = []; + } + } + + for (var j = 0, k = locationMap.length; j < k; j++) { + for (var m = 0, n = locationMap[j].length; m < n; m++) { + seriesIndex = locationMap[j][m]; + if (xMarkMap[seriesIndex].counter > 0) { + xMarkMap[seriesIndex].average = + (xMarkMap[seriesIndex].sum / xMarkMap[seriesIndex].counter).toFixed(2) + - 0; + } + y = this.component.yAxis.getAxis(series[seriesIndex].yAxisIndex || 0) + .getCoord(xMarkMap[seriesIndex].average); + xMarkMap[seriesIndex].averageLine = [ + [this.component.grid.getX(), y], + [this.component.grid.getXend(), y] + ]; + + xMarkMap[seriesIndex].minLine = [ + [this.component.grid.getX(), xMarkMap[seriesIndex].minY], + [this.component.grid.getXend(), xMarkMap[seriesIndex].minY] + ]; + xMarkMap[seriesIndex].maxLine = [ + [this.component.grid.getX(), xMarkMap[seriesIndex].maxY], + [this.component.grid.getXend(), xMarkMap[seriesIndex].maxY] + ]; + } + } + + this._buildBorkenLine(seriesArray, this.finalPLMap, categoryAxis, 'horizontal'); + }, + + /** + * 构建类目轴为垂直方向的折线图系列 + */ + _buildVertical: function (seriesArray, maxDataLength, locationMap, xMarkMap) { + var series = this.series; + // 确定类目轴和数值轴,同一方向随便找一个即可 + var seriesIndex = locationMap[0][0]; + var serie = series[seriesIndex]; + var yAxisIndex = serie.yAxisIndex; + var categoryAxis = this.component.yAxis.getAxis(yAxisIndex); + var xAxisIndex; // 数值轴各异 + var valueAxis; // 数值轴各异 + + var x; + var y; + var lastXP; // 正向堆积处理 + var baseXP; + var lastXN; // 负向堆积处理 + var baseXN; + //var this.finalPLMap = {}; // 完成的point list(PL) + var curPLMap = {}; // 正在记录的point list(PL) + var data; + var value; + for (var i = 0, l = maxDataLength; i < l; i++) { + if (categoryAxis.getNameByIndex(i) == null) { + // 系列数据超出类目轴长度 + break; + } + y = categoryAxis.getCoordByIndex(i); + for (var j = 0, k = locationMap.length; j < k; j++) { + // 堆积数据用第一条valueAxis + xAxisIndex = series[locationMap[j][0]].xAxisIndex || 0; + valueAxis = this.component.xAxis.getAxis(xAxisIndex); + baseXP = lastXP = baseXN = lastXN = valueAxis.getCoord(0); + for (var m = 0, n = locationMap[j].length; m < n; m++) { + seriesIndex = locationMap[j][m]; + serie = series[seriesIndex]; + data = serie.data[i]; + value = data != null + ? (data.value != null + ? data.value + : data) + : '-'; + curPLMap[seriesIndex] = curPLMap[seriesIndex] || []; + xMarkMap[seriesIndex] = xMarkMap[seriesIndex] + || { + min: Number.POSITIVE_INFINITY, + max: Number.NEGATIVE_INFINITY, + sum: 0, + counter: 0, + average: 0 + }; + if (value === '-') { + // 空数据则把正在记录的curPLMap添加到finalPLMap中 + if (curPLMap[seriesIndex].length > 0) { + this.finalPLMap[seriesIndex] = + this.finalPLMap[seriesIndex] || []; + + this.finalPLMap[seriesIndex].push( + curPLMap[seriesIndex] + ); + + curPLMap[seriesIndex] = []; + } + continue; + } + //x = valueAxis.getCoord(value); + if (value >= 0) { + // 正向堆积 + lastXP += m > 0 + ? valueAxis.getCoordSize(value) + : (valueAxis.getCoord(value) - baseXP); + x = lastXP; + } + else if (value < 0){ + // 负向堆积 + lastXN -= m > 0 + ? valueAxis.getCoordSize(value) + : (baseXN - valueAxis.getCoord(value)); + x = lastXN; + } + curPLMap[seriesIndex].push( + [x, y, i, categoryAxis.getNameByIndex(i), baseXP, y] + ); + + if (xMarkMap[seriesIndex].min > value) { + xMarkMap[seriesIndex].min = value; + xMarkMap[seriesIndex].minX = x; + xMarkMap[seriesIndex].minY = y; + } + if (xMarkMap[seriesIndex].max < value) { + xMarkMap[seriesIndex].max = value; + xMarkMap[seriesIndex].maxX = x; + xMarkMap[seriesIndex].maxY = y; + } + xMarkMap[seriesIndex].sum += value; + xMarkMap[seriesIndex].counter++; + } + } + // 补充空数据的拖拽提示 + lastXP = this.component.grid.getXend(); + var symbolSize; + for (var j = 0, k = locationMap.length; j < k; j++) { + for (var m = 0, n = locationMap[j].length; m < n; m++) { + seriesIndex = locationMap[j][m]; + serie = series[seriesIndex]; + data = serie.data[i]; + value = data != null + ? (data.value != null + ? data.value + : data) + : '-'; + if (value != '-') { + // 只关心空数据 + continue; + } + if (this.deepQuery( + [data, serie, this.option], 'calculable' + ) + ) { + symbolSize = this.deepQuery( + [data, serie], + 'symbolSize' + ); + lastXP -= symbolSize * 2 + 5; + x = lastXP; + this.shapeList.push(this._getCalculableItem( + seriesIndex, i, categoryAxis.getNameByIndex(i), + x, y, 'vertical' + )); + } + } + } + } + + // 把剩余未完成的curPLMap全部添加到finalPLMap中 + for (var sId in curPLMap) { + if (curPLMap[sId].length > 0) { + this.finalPLMap[sId] = this.finalPLMap[sId] || []; + this.finalPLMap[sId].push(curPLMap[sId]); + curPLMap[sId] = []; + } + } + + for (var j = 0, k = locationMap.length; j < k; j++) { + for (var m = 0, n = locationMap[j].length; m < n; m++) { + seriesIndex = locationMap[j][m]; + if (xMarkMap[seriesIndex].counter > 0) { + xMarkMap[seriesIndex].average = + (xMarkMap[seriesIndex].sum / xMarkMap[seriesIndex].counter).toFixed(2) + - 0; + } + + x = this.component.xAxis.getAxis(series[seriesIndex].xAxisIndex || 0) + .getCoord(xMarkMap[seriesIndex].average); + + xMarkMap[seriesIndex].averageLine = [ + [x, this.component.grid.getYend()], + [x, this.component.grid.getY()] + ]; + xMarkMap[seriesIndex].minLine = [ + [xMarkMap[seriesIndex].minX, this.component.grid.getYend()], + [xMarkMap[seriesIndex].minX, this.component.grid.getY()] + ]; + xMarkMap[seriesIndex].maxLine = [ + [xMarkMap[seriesIndex].maxX, this.component.grid.getYend()], + [xMarkMap[seriesIndex].maxX, this.component.grid.getY()] + ]; + } + } + + this._buildBorkenLine(seriesArray, this.finalPLMap, categoryAxis, 'vertical'); + }, + + /** + * 生成折线和折线上的拐点 + */ + _buildBorkenLine: function (seriesArray, pointList, categoryAxis, orient) { + var series = this.series; + + var data; + + // 堆积层叠需求,反顺序构建 + for (var sIdx = seriesArray.length - 1; sIdx >= 0; sIdx--) { + var seriesIndex = seriesArray[sIdx]; + var serie = series[seriesIndex]; + var seriesPL = pointList[seriesIndex]; + if (serie.type === this.type && seriesPL != null) { + var bbox = this._getBbox(seriesIndex, orient); + var defaultColor = this._sIndex2ColorMap[seriesIndex]; + // 折线相关,多级控制 + var lineWidth = this.query( + serie, 'itemStyle.normal.lineStyle.width' + ); + var lineType = this.query( + serie, 'itemStyle.normal.lineStyle.type' + ); + var lineColor = this.query( + serie, 'itemStyle.normal.lineStyle.color' + ); + var normalColor = this.getItemStyleColor( + this.query(serie, 'itemStyle.normal.color'), seriesIndex, -1 + ); + + // 填充相关 + var isFill = this.query(serie, 'itemStyle.normal.areaStyle') != null; + var fillNormalColor = this.query( + serie, 'itemStyle.normal.areaStyle.color' + ); + + for (var i = 0, l = seriesPL.length; i < l; i++) { + var singlePL = seriesPL[i]; + var isLarge = this._isLarge(orient, singlePL); + if (!isLarge) { // 非大数据模式才显示拐点symbol + for (var j = 0, k = singlePL.length; j < k; j++) { + data = serie.data[singlePL[j][2]]; + if (this.deepQuery( + [data, serie], 'showAllSymbol' + ) // 全显示 + || (categoryAxis.isMainAxis(singlePL[j][2]) + && this.deepQuery( + [data, serie], 'symbol' + ) != 'none' + ) // 主轴非空 + || this.deepQuery( + [data, serie, this.option], + 'calculable' + ) // 可计算 + ) { + this.shapeList.push(this._getSymbol( + seriesIndex, + singlePL[j][2], // dataIndex + singlePL[j][3], // name + singlePL[j][0], // x + singlePL[j][1], // y + orient + )); + } + } + } + else { + // 大数据模式截取pointList + singlePL = this._getLargePointList(orient, singlePL); + } + + // 折线图 + var brokenLineShape = new BrokenLineShape({ + zlevel: this._zlevelBase, + style: { + miterLimit: lineWidth, + pointList: singlePL, + strokeColor: lineColor + || normalColor + || defaultColor, + lineWidth: lineWidth, + lineType: lineType, + smooth: this._getSmooth(serie.smooth), + smoothConstraint: bbox, + shadowColor: this.query( + serie, + 'itemStyle.normal.lineStyle.shadowColor' + ), + shadowBlur: this.query( + serie, + 'itemStyle.normal.lineStyle.shadowBlur' + ), + shadowOffsetX: this.query( + serie, + 'itemStyle.normal.lineStyle.shadowOffsetX' + ), + shadowOffsetY: this.query( + serie, + 'itemStyle.normal.lineStyle.shadowOffsetY' + ) + }, + hoverable: false, + _main: true, + _seriesIndex: seriesIndex, + _orient: orient + }); + + ecData.pack( + brokenLineShape, + series[seriesIndex], seriesIndex, + 0, i, series[seriesIndex].name + ); + + this.shapeList.push(brokenLineShape); + + if (isFill) { + var halfSmoothPolygonShape = new HalfSmoothPolygonShape({ + zlevel: this._zlevelBase, + style: { + miterLimit: lineWidth, + pointList: zrUtil.clone(singlePL).concat([ + [ + singlePL[singlePL.length - 1][4], + singlePL[singlePL.length - 1][5] + ], + [ + singlePL[0][4], + singlePL[0][5] + ] + ]), + brushType: 'fill', + smooth: this._getSmooth(serie.smooth), + smoothConstraint: bbox, + color: fillNormalColor + ? fillNormalColor + : zrColor.alpha(defaultColor,0.5) + }, + hoverable: false, + _main: true, + _seriesIndex: seriesIndex, + _orient: orient + }); + ecData.pack( + halfSmoothPolygonShape, + series[seriesIndex], seriesIndex, + 0, i, series[seriesIndex].name + ); + this.shapeList.push(halfSmoothPolygonShape); + } + } + } + } + }, + + _getBbox: function(seriesIndex, orient) { + var bbox = this.component.grid.getBbox(); + var xMarkMap = this.xMarkMap[seriesIndex]; + if (orient === 'horizontal') { + bbox[0][1] = Math.min(xMarkMap.minY, xMarkMap.maxY); + bbox[1][1] = Math.max(xMarkMap.minY, xMarkMap.maxY); + } + else { + bbox[0][0] = Math.min(xMarkMap.minX, xMarkMap.maxX); + bbox[1][0] = Math.max(xMarkMap.minX, xMarkMap.maxX); + } + return bbox; + }, + + _isLarge: function(orient, singlePL) { + if (singlePL.length < 2) { + return false; + } + else { + return orient === 'horizontal' + ? (Math.abs(singlePL[0][0] - singlePL[1][0]) < 0.5) + : (Math.abs(singlePL[0][1] - singlePL[1][1]) < 0.5); + } + }, + + /** + * 大规模pointList优化 + */ + _getLargePointList: function(orient, singlePL) { + var total; + if (orient === 'horizontal') { + total = this.component.grid.getWidth(); + } + else { + total = this.component.grid.getHeight(); + } + + var len = singlePL.length; + var newList = []; + for (var i = 0; i < total; i++) { + newList[i] = singlePL[Math.floor(len / total * i)]; + } + return newList; + }, + + _getSmooth: function (isSmooth/*, pointList, orient*/) { + if (isSmooth) { + /* 不科学啊,发现0.3通用了 + var delta; + if (orient === 'horizontal') { + delta = Math.abs(pointList[0][0] - pointList[1][0]); + } + else { + delta = Math.abs(pointList[0][1] - pointList[1][1]); + } + */ + return 0.3; + } + else { + return 0; + } + }, + + /** + * 生成空数据所需的可计算提示图形 + */ + _getCalculableItem: function (seriesIndex, dataIndex, name, x, y, orient) { + var series = this.series; + var color = series[seriesIndex].calculableHolderColor + || this.ecTheme.calculableHolderColor; + + var itemShape = this._getSymbol( + seriesIndex, dataIndex, name, + x, y, orient + ); + itemShape.style.color = color; + itemShape.style.strokeColor = color; + itemShape.rotation = [0,0]; + itemShape.hoverable = false; + itemShape.draggable = false; + itemShape.style.text = undefined; + + return itemShape; + }, + + /** + * 生成折线图上的拐点图形 + */ + _getSymbol: function (seriesIndex, dataIndex, name, x, y, orient) { + var series = this.series; + var serie = series[seriesIndex]; + var data = serie.data[dataIndex]; + + var itemShape = this.getSymbolShape( + serie, seriesIndex, data, dataIndex, name, + x, y, + this._sIndex2ShapeMap[seriesIndex], + this._sIndex2ColorMap[seriesIndex], + '#fff', + orient === 'vertical' ? 'horizontal' : 'vertical' // 翻转 + ); + itemShape.zlevel = this._zlevelBase + 1; + + if (this.deepQuery([data, serie, this.option], 'calculable')) { + this.setCalculable(itemShape); + itemShape.draggable = true; + } + + return itemShape; + }, + + // 位置转换 + getMarkCoord: function (seriesIndex, mpData) { + var serie = this.series[seriesIndex]; + var xMarkMap = this.xMarkMap[seriesIndex]; + var xAxis = this.component.xAxis.getAxis(serie.xAxisIndex); + var yAxis = this.component.yAxis.getAxis(serie.yAxisIndex); + + if (mpData.type + && (mpData.type === 'max' || mpData.type === 'min' || mpData.type === 'average') + ) { + // 特殊值内置支持 + return [ + xMarkMap[mpData.type + 'X'], + xMarkMap[mpData.type + 'Y'], + xMarkMap[mpData.type + 'Line'], + xMarkMap[mpData.type] + ]; + } + + return [ + typeof mpData.xAxis != 'string' && xAxis.getCoordByIndex + ? xAxis.getCoordByIndex(mpData.xAxis || 0) + : xAxis.getCoord(mpData.xAxis || 0), + + typeof mpData.yAxis != 'string' && yAxis.getCoordByIndex + ? yAxis.getCoordByIndex(mpData.yAxis || 0) + : yAxis.getCoord(mpData.yAxis || 0) + ]; + }, + + /** + * 刷新 + */ + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + + this.backupShapeList(); + this._buildShape(); + }, + + ontooltipHover: function (param, tipShape) { + var seriesIndex = param.seriesIndex; + var dataIndex = param.dataIndex; + var seriesPL; + var singlePL; + var len = seriesIndex.length; + while (len--) { + seriesPL = this.finalPLMap[seriesIndex[len]]; + if (seriesPL) { + for (var i = 0, l = seriesPL.length; i < l; i++) { + singlePL = seriesPL[i]; + for (var j = 0, k = singlePL.length; j < k; j++) { + if (dataIndex === singlePL[j][2]) { + tipShape.push(this._getSymbol( + seriesIndex[len], // seriesIndex + singlePL[j][2], // dataIndex + singlePL[j][3], // name + singlePL[j][0], // x + singlePL[j][1], // y + 'horizontal' + )); + } + } + } + } + } + }, + + /** + * 动态数据增加动画 + */ + addDataAnimation: function (params) { + var series = this.series; + var aniMap = {}; // seriesIndex索引参数 + for (var i = 0, l = params.length; i < l; i++) { + aniMap[params[i][0]] = params[i]; + } + var x; + var dx; + var y; + var dy; + var seriesIndex; + var pointList; + var isHorizontal; // 是否横向布局, isHorizontal; + for (var i = this.shapeList.length - 1; i >= 0; i--) { + seriesIndex = this.shapeList[i]._seriesIndex; + if (aniMap[seriesIndex] && !aniMap[seriesIndex][3]) { + // 有数据删除才有移动的动画 + if (this.shapeList[i]._main && this.shapeList[i].style.pointList.length > 1) { + pointList = this.shapeList[i].style.pointList; + // 主线动画 + dx = Math.abs(pointList[0][0] - pointList[1][0]); + dy = Math.abs(pointList[0][1] - pointList[1][1]); + isHorizontal = + this.shapeList[i]._orient === 'horizontal'; + + if (aniMap[seriesIndex][2]) { + // 队头加入删除末尾 + if (this.shapeList[i].type === 'polygon') { + //区域图 + var len = pointList.length; + this.shapeList[i].style.pointList[len - 3] + = pointList[len - 2]; + isHorizontal + ? (this.shapeList[i].style.pointList[len - 3][0] + = pointList[len - 4][0] + ) + : (this.shapeList[i].style.pointList[len - 3][1] + = pointList[len - 4][1] + ); + this.shapeList[i].style.pointList[len - 2] + = pointList[len - 1]; + } + this.shapeList[i].style.pointList.pop(); + + isHorizontal ? (x = dx, y = 0) : (x = 0, y = -dy); + } + else { + // 队尾加入删除头部 + this.shapeList[i].style.pointList.shift(); + if (this.shapeList[i].type === 'polygon') { + //区域图 + var targetPoint = + this.shapeList[i].style.pointList.pop(); + isHorizontal + ? (targetPoint[0] = pointList[0][0]) + : (targetPoint[1] = pointList[0][1]); + this.shapeList[i].style.pointList.push( + targetPoint + ); + } + isHorizontal ? (x = -dx, y = 0) : (x = 0, y = dy); + } + + this.zr.modShape( + this.shapeList[i].id, + { + style: { + pointList: this.shapeList[i].style.pointList + } + }, + true + ); + } + else { + // 拐点动画 + if (aniMap[seriesIndex][2] + && this.shapeList[i]._dataIndex + === series[seriesIndex].data.length - 1 + ) { + // 队头加入删除末尾 + this.zr.delShape(this.shapeList[i].id); + continue; + } + else if (!aniMap[seriesIndex][2] + && this.shapeList[i]._dataIndex === 0 + ) { + // 队尾加入删除头部 + this.zr.delShape(this.shapeList[i].id); + continue; + } + } + this.shapeList[i].position = [0, 0]; + this.zr.animate(this.shapeList[i].id, '') + .when( + 500, + { position: [ x, y ] } + ) + .start(); + } + } + } + }; + + function legendLineIcon(ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + + var dy = height / 2; + + if (style.symbol.match('empty')) { + ctx.fillStyle = '#fff'; + } + style.brushType = 'both'; + + var symbol = style.symbol.replace('empty', '').toLowerCase(); + if (symbol.match('star')) { + dy = (symbol.replace('star','') - 0) || 5; + y -= 1; + symbol = 'star'; + } + else if (symbol === 'rectangle' || symbol === 'arrow') { + x += (width - height) / 2; + width = height; + } + + var imageLocation = ''; + if (symbol.match('image')) { + imageLocation = symbol.replace( + new RegExp('^image:\\/\\/'), '' + ); + symbol = 'image'; + x += Math.round((width - height) / 2) - 1; + width = height = height + 2; + } + symbol = IconShape.prototype.iconLibrary[symbol]; + + if (symbol) { + var x2 = style.x; + var y2 = style.y; + ctx.moveTo(x2, y2 + dy); + ctx.lineTo(x2 + 5, y2 + dy); + ctx.moveTo(x2 + style.width - 5, y2 + dy); + ctx.lineTo(x2 + style.width, y2 + dy); + + symbol(ctx, { + x: x + 4, + y: y + 4, + width: width - 8, + height: height - 8, + n: dy, + image: imageLocation + }); + + } + else { + ctx.moveTo(x, y + dy); + ctx.lineTo(x + width, y + dy); + } + } + IconShape.prototype.iconLibrary['legendLineIcon'] = legendLineIcon; + + zrUtil.inherits(Line, ChartBase); + zrUtil.inherits(Line, ComponentBase); + + // 图表注册 + require('../chart').define('line', Line); + + return Line; }); -/** - * echarts图表类:柱形图 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/chart/bar',['require','../component/base','./base','zrender/shape/Rectangle','../component/axis','../component/grid','../component/dataZoom','../config','../util/ecData','zrender/tool/util','zrender/tool/color','../chart'],function (require) { - var ComponentBase = require('../component/base'); - var ChartBase = require('./base'); - - // 图形依赖 - var RectangleShape = require('zrender/shape/Rectangle'); - // 组件依赖 - require('../component/axis'); - require('../component/grid'); - require('../component/dataZoom'); - - var ecConfig = require('../config'); - var ecData = require('../util/ecData'); - var zrUtil = require('zrender/tool/util'); - var zrColor = require('zrender/tool/color'); - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} series 数据 - * @param {Object} component 组件 - */ - function Bar(ecTheme, messageCenter, zr, option, myChart){ - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); - // 图表基类 - ChartBase.call(this); - - this.refresh(option); - } - - Bar.prototype = { - type : ecConfig.CHART_TYPE_BAR, - /** - * 绘制图形 - */ - _buildShape : function () { - var series = this.series; - this.selectedMap = {}; - this.xMarkMap = {}; - - // series默认颜色索引,seriesIndex索引到color - this._sIndex2colorMap = {}; - - // 水平垂直双向series索引 ,position索引到seriesIndex - var _position2sIndexMap = { - top : [], - bottom : [], - left : [], - right : [] - }; - var xAxisIndex; - var yAxisIndex; - var xAxis; - var yAxis; - for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type == ecConfig.CHART_TYPE_BAR) { - series[i] = this.reformOption(series[i]); - xAxisIndex = series[i].xAxisIndex; - yAxisIndex = series[i].yAxisIndex; - xAxis = this.component.xAxis.getAxis(xAxisIndex); - yAxis = this.component.yAxis.getAxis(yAxisIndex); - if (xAxis.type == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY - ) { - _position2sIndexMap[xAxis.getPosition()].push(i); - } - else if (yAxis.type == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY - ) { - _position2sIndexMap[yAxis.getPosition()].push(i); - } - } - } - // console.log(_position2sIndexMap) - for (var position in _position2sIndexMap) { - if (_position2sIndexMap[position].length > 0) { - this._buildSinglePosition( - position, _position2sIndexMap[position], this.xMarkMap - ); - } - } - - this.addShapeList(); - }, - - /** - * 构建单个方向上的柱形图 - * - * @param {number} seriesIndex 系列索引 - */ - _buildSinglePosition : function (position, seriesArray, xMarkMap) { - var mapData = this._mapData(seriesArray); - var locationMap = mapData.locationMap; - var maxDataLength = mapData.maxDataLength; - - if (maxDataLength === 0 || locationMap.length === 0) { - return; - } - - switch (position) { - case 'bottom' : - case 'top' : - this._buildHorizontal(maxDataLength, locationMap, seriesArray, xMarkMap); - break; - case 'left' : - case 'right' : - this._buildVertical(maxDataLength, locationMap, seriesArray, xMarkMap); - break; - } - }, - - /** - * 数据整形 - * 数组位置映射到系列索引 - */ - _mapData : function (seriesArray) { - var series = this.series; - var serie; // 临时映射变量 - var dataIndex = 0; // 堆积数据所在位置映射 - var stackMap = {}; // 堆积数据位置映射,堆积组在二维中的第几项 - var magicStackKey = '__kener__stack__'; // 堆积命名,非堆积数据安单一堆积处理 - var stackKey; // 临时映射变量 - var serieName; // 临时映射变量 - var legend = this.component.legend; - var locationMap = []; // 需要返回的东西:数组位置映射到系列索引 - var maxDataLength = 0; // 需要返回的东西:最大数据长度 - var iconShape; - // 计算需要显示的个数和分配位置并记在下面这个结构里 - for (var i = 0, l = seriesArray.length; i < l; i++) { - serie = series[seriesArray[i]]; - serieName = serie.name; - if (legend){ - this.selectedMap[serieName] = legend.isSelected(serieName); - this._sIndex2colorMap[seriesArray[i]] = - legend.getColor(serieName); - - iconShape = legend.getItemShape(serieName); - if (iconShape) { - // 回调legend,换一个更形象的icon - if (serie.itemStyle.normal.borderWidth > 0) { - iconShape.style.x += 1; - iconShape.style.y += 1; - iconShape.style.width -= 2; - iconShape.style.height -= 2; - iconShape.style.strokeColor = - iconShape.highlightStyle.strokeColor = - serie.itemStyle.normal.borderColor; - iconShape.highlightStyle.lineWidth = 3; - iconShape.style.brushType = 'both'; - } - legend.setItemShape(serieName, iconShape); - } - } else { - this.selectedMap[serieName] = true; - this._sIndex2colorMap[seriesArray[i]] = - this.zr.getColor(seriesArray[i]); - } - - if (this.selectedMap[serieName]) { - stackKey = serie.stack || (magicStackKey + seriesArray[i]); - if (typeof stackMap[stackKey] == 'undefined') { - stackMap[stackKey] = dataIndex; - locationMap[dataIndex] = [seriesArray[i]]; - dataIndex++; - } - else { - // 已经分配了位置就推进去就行 - locationMap[stackMap[stackKey]].push(seriesArray[i]); - } - } - // 兼职帮算一下最大长度 - maxDataLength = Math.max(maxDataLength, serie.data.length); - } - - /* 调试输出 - var s = ''; - for (var i = 0, l = maxDataLength; i < l; i++) { - s = '['; - for (var j = 0, k = locationMap.length; j < k; j++) { - s +='[' - for (var m = 0, n = locationMap[j].length - 1; m < n; m++) { - s += series[locationMap[j][m]].data[i] + ',' - } - s += series[locationMap[j][locationMap[j].length - 1]] - .data[i]; - s += ']' - } - s += ']'; - console.log(s); - } - console.log(locationMap) - */ - - return { - locationMap : locationMap, - maxDataLength : maxDataLength - }; - }, - - /** - * 构建类目轴为水平方向的柱形图系列 - */ - _buildHorizontal : function (maxDataLength, locationMap, seriesArray, xMarkMap) { - var series = this.series; - // 确定类目轴和数值轴,同一方向随便找一个即可 - var seriesIndex = locationMap[0][0]; - var serie = series[seriesIndex]; - var xAxisIndex = serie.xAxisIndex; - var categoryAxis = this.component.xAxis.getAxis(xAxisIndex); - var yAxisIndex; // 数值轴各异 - var valueAxis; // 数值轴各异 - - var size = this._mapSize(categoryAxis, locationMap); - var gap = size.gap; - var barGap = size.barGap; - var barWidthMap = size.barWidthMap; - var barWidth = size.barWidth; // 自适应宽度 - var barMinHeightMap = size.barMinHeightMap; - var barHeight; - var interval = size.interval; - - var x; - var y; - var lastYP; // 正向堆积处理 - var baseYP; - var lastYN; // 负向堆积处理 - var baseYN; - var barShape; - var data; - var value; - for (var i = 0, l = maxDataLength; i < l; i++) { - if (typeof categoryAxis.getNameByIndex(i) == 'undefined') { - // 系列数据超出类目轴长度 - break; - } - x = categoryAxis.getCoordByIndex(i) - gap / 2; - for (var j = 0, k = locationMap.length; j < k; j++) { - // 堆积数据用第一条valueAxis - yAxisIndex = series[locationMap[j][0]].yAxisIndex || 0; - valueAxis = this.component.yAxis.getAxis(yAxisIndex); - baseYP = lastYP = baseYN = lastYN = valueAxis.getCoord(0); - for (var m = 0, n = locationMap[j].length; m < n; m++) { - seriesIndex = locationMap[j][m]; - serie = series[seriesIndex]; - data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; - xMarkMap[seriesIndex] = xMarkMap[seriesIndex] - || { - min : Number.POSITIVE_INFINITY, - max : Number.NEGATIVE_INFINITY, - sum : 0, - counter : 0, - average : 0 - }; - if (value == '-') { - // 空数据在做完后补充拖拽提示框 - continue; - } - //y = valueAxis.getCoord(value); - if (value > 0) { - // 正向堆积 - //barHeight = baseYP - y; - barHeight = m > 0 - ? valueAxis.getCoordSize(value) - : (baseYP - valueAxis.getCoord(value)); - // 非堆积数据最小高度有效 - if (n == 1 - && barMinHeightMap[seriesIndex] > barHeight - ) { - barHeight = barMinHeightMap[seriesIndex]; - } - lastYP -= barHeight; - y = lastYP; - } - else if (value < 0){ - // 负向堆积 - //barHeight = y - baseYN; - barHeight = m > 0 - ? valueAxis.getCoordSize(value) - : (valueAxis.getCoord(value) - baseYN); - // 非堆积数据最小高度有效 - if (n == 1 - && barMinHeightMap[seriesIndex] > barHeight - ) { - barHeight = barMinHeightMap[seriesIndex]; - } - y = lastYN; - lastYN += barHeight; - } - else { - // 0值 - barHeight = 0;//baseYP - y; - // 最小高度无效 - lastYP -= barHeight; - y = lastYP; - } - xMarkMap[seriesIndex][i] = - x + (barWidthMap[seriesIndex] || barWidth) / 2; - if (xMarkMap[seriesIndex].min > value) { - xMarkMap[seriesIndex].min = value; - xMarkMap[seriesIndex].minY = y; - xMarkMap[seriesIndex].minX = xMarkMap[seriesIndex][i]; - } - if (xMarkMap[seriesIndex].max < value) { - xMarkMap[seriesIndex].max = value; - xMarkMap[seriesIndex].maxY = y; - xMarkMap[seriesIndex].maxX = xMarkMap[seriesIndex][i]; - } - xMarkMap[seriesIndex].sum += value; - xMarkMap[seriesIndex].counter++; - - if (i % interval === 0) { - barShape = this._getBarItem( - seriesIndex, i, - categoryAxis.getNameByIndex(i), - x, y, - barWidthMap[seriesIndex] || barWidth, - barHeight, - 'vertical' - ); - this.shapeList.push(new RectangleShape(barShape)); - } - } - - // 补充空数据的拖拽提示框 - for (var m = 0, n = locationMap[j].length; m < n; m++) { - seriesIndex = locationMap[j][m]; - serie = series[seriesIndex]; - data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; - if (value != '-') { - // 只关心空数据 - continue; - } - - if (this.deepQuery( - [data, serie, this.option], 'calculable' - ) - ) { - lastYP -= this.ecTheme.island.r; - y = lastYP; - - barShape = this._getBarItem( - seriesIndex, i, - categoryAxis.getNameByIndex(i), - x + 0.5, y + 0.5, - (barWidthMap[seriesIndex] || barWidth) - 1, - this.ecTheme.island.r - 1, - 'vertical' - ); - barShape.hoverable = false; - barShape.draggable = false; - barShape.style.lineWidth = 1; - barShape.style.brushType = 'stroke'; - barShape.style.strokeColor = - serie.calculableHolderColor - || this.ecTheme.calculableHolderColor; - - this.shapeList.push(new RectangleShape(barShape)); - } - } - - x += ((barWidthMap[seriesIndex] || barWidth) + barGap); - } - } - - for (var j = 0, k = locationMap.length; j < k; j++) { - for (var m = 0, n = locationMap[j].length; m < n; m++) { - seriesIndex = locationMap[j][m]; - if (xMarkMap[seriesIndex].counter > 0) { - xMarkMap[seriesIndex].average = - (xMarkMap[seriesIndex].sum / xMarkMap[seriesIndex].counter).toFixed(2) - - 0; - } - - y = this.component.yAxis.getAxis(series[seriesIndex].yAxisIndex || 0) - .getCoord(xMarkMap[seriesIndex].average); - - xMarkMap[seriesIndex].averageLine = [ - [this.component.grid.getX(), y], - [this.component.grid.getXend(), y] - ]; - xMarkMap[seriesIndex].minLine = [ - [this.component.grid.getX(), xMarkMap[seriesIndex].minY], - [this.component.grid.getXend(), xMarkMap[seriesIndex].minY] - ]; - xMarkMap[seriesIndex].maxLine = [ - [this.component.grid.getX(), xMarkMap[seriesIndex].maxY], - [this.component.grid.getXend(), xMarkMap[seriesIndex].maxY] - ]; - - xMarkMap[seriesIndex].isHorizontal = true; - this.buildMark(seriesIndex); - } - } - }, - - /** - * 构建类目轴为垂直方向的柱形图系列 - */ - _buildVertical : function (maxDataLength, locationMap, seriesArray, xMarkMap) { - var series = this.series; - // 确定类目轴和数值轴,同一方向随便找一个即可 - var seriesIndex = locationMap[0][0]; - var serie = series[seriesIndex]; - var yAxisIndex = serie.yAxisIndex; - var categoryAxis = this.component.yAxis.getAxis(yAxisIndex); - var xAxisIndex; // 数值轴各异 - var valueAxis; // 数值轴各异 - - var size = this._mapSize(categoryAxis, locationMap); - var gap = size.gap; - var barGap = size.barGap; - var barWidthMap = size.barWidthMap; - var barWidth = size.barWidth; // 自适应宽度 - var barMinHeightMap = size.barMinHeightMap; - var barHeight; - var interval = size.interval; - - var x; - var y; - var lastXP; // 正向堆积处理 - var baseXP; - var lastXN; // 负向堆积处理 - var baseXN; - var barShape; - var data; - var value; - for (var i = 0, l = maxDataLength; i < l; i++) { - if (typeof categoryAxis.getNameByIndex(i) == 'undefined') { - // 系列数据超出类目轴长度 - break; - } - y = categoryAxis.getCoordByIndex(i) + gap / 2; - for (var j = 0, k = locationMap.length; j < k; j++) { - // 堆积数据用第一条valueAxis - xAxisIndex = series[locationMap[j][0]].xAxisIndex || 0; - valueAxis = this.component.xAxis.getAxis(xAxisIndex); - baseXP = lastXP = baseXN = lastXN = valueAxis.getCoord(0); - for (var m = 0, n = locationMap[j].length; m < n; m++) { - seriesIndex = locationMap[j][m]; - serie = series[seriesIndex]; - data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; - xMarkMap[seriesIndex] = xMarkMap[seriesIndex] - || { - min : Number.POSITIVE_INFINITY, - max : Number.NEGATIVE_INFINITY, - sum : 0, - counter : 0, - average : 0 - }; - if (value == '-') { - // 空数据在做完后补充拖拽提示框 - continue; - } - //x = valueAxis.getCoord(value); - if (value > 0) { - // 正向堆积 - //barHeight = x - baseXP; - barHeight = m > 0 - ? valueAxis.getCoordSize(value) - : (valueAxis.getCoord(value) - baseXP); - // 非堆积数据最小高度有效 - if (n == 1 - && barMinHeightMap[seriesIndex] > barHeight - ) { - barHeight = barMinHeightMap[seriesIndex]; - } - x = lastXP; - lastXP += barHeight; - } - else if (value < 0){ - // 负向堆积 - //barHeight = baseXN - x; - barHeight = m > 0 - ? valueAxis.getCoordSize(value) - : (baseXN - valueAxis.getCoord(value)); - // 非堆积数据最小高度有效 - if (n == 1 - && barMinHeightMap[seriesIndex] > barHeight - ) { - barHeight = barMinHeightMap[seriesIndex]; - } - lastXN -= barHeight; - x = lastXN; - } - else { - // 0值 - barHeight = 0;//x - baseXP; - // 最小高度无效 - x = lastXP; - lastXP += barHeight; - } - - xMarkMap[seriesIndex][i] = - y - (barWidthMap[seriesIndex] || barWidth) / 2; - if (xMarkMap[seriesIndex].min > value) { - xMarkMap[seriesIndex].min = value; - xMarkMap[seriesIndex].minX = x + barHeight; - xMarkMap[seriesIndex].minY = xMarkMap[seriesIndex][i]; - } - if (xMarkMap[seriesIndex].max < value) { - xMarkMap[seriesIndex].max = value; - xMarkMap[seriesIndex].maxX = x + barHeight; - xMarkMap[seriesIndex].maxY = xMarkMap[seriesIndex][i]; - } - xMarkMap[seriesIndex].sum += value; - xMarkMap[seriesIndex].counter++; - - if (i % interval === 0) { - barShape = this._getBarItem( - seriesIndex, i, - categoryAxis.getNameByIndex(i), - x, y - (barWidthMap[seriesIndex] || barWidth), - barHeight, - barWidthMap[seriesIndex] || barWidth, - 'horizontal' - ); - this.shapeList.push(new RectangleShape(barShape)); - } - } - - // 补充空数据的拖拽提示框 - for (var m = 0, n = locationMap[j].length; m < n; m++) { - seriesIndex = locationMap[j][m]; - serie = series[seriesIndex]; - data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; - if (value != '-') { - // 只关心空数据 - continue; - } - - if (this.deepQuery( - [data, serie, this.option], 'calculable' - ) - ) { - x = lastXP; - lastXP += this.ecTheme.island.r; - - barShape = this._getBarItem( - seriesIndex, - i, - categoryAxis.getNameByIndex(i), - x + 0.5, y + 0.5 - (barWidthMap[seriesIndex] || barWidth), - this.ecTheme.island.r - 1, - (barWidthMap[seriesIndex] || barWidth) - 1, - 'horizontal' - ); - barShape.hoverable = false; - barShape.draggable = false; - barShape.style.lineWidth = 1; - barShape.style.brushType = 'stroke'; - barShape.style.strokeColor = - serie.calculableHolderColor - || this.ecTheme.calculableHolderColor; - - this.shapeList.push(new RectangleShape(barShape)); - } - } - - y -= ((barWidthMap[seriesIndex] || barWidth) + barGap); - } - } - - for (var j = 0, k = locationMap.length; j < k; j++) { - for (var m = 0, n = locationMap[j].length; m < n; m++) { - seriesIndex = locationMap[j][m]; - if (xMarkMap[seriesIndex].counter > 0) { - xMarkMap[seriesIndex].average = - (xMarkMap[seriesIndex].sum / xMarkMap[seriesIndex].counter).toFixed(2) - - 0; - } - - x = this.component.xAxis.getAxis(series[seriesIndex].xAxisIndex || 0) - .getCoord(xMarkMap[seriesIndex].average); - - xMarkMap[seriesIndex].averageLine = [ - [x, this.component.grid.getYend()], - [x, this.component.grid.getY()] - ]; - xMarkMap[seriesIndex].minLine = [ - [xMarkMap[seriesIndex].minX, this.component.grid.getYend()], - [xMarkMap[seriesIndex].minX, this.component.grid.getY()] - ]; - xMarkMap[seriesIndex].maxLine = [ - [xMarkMap[seriesIndex].maxX, this.component.grid.getYend()], - [xMarkMap[seriesIndex].maxX, this.component.grid.getY()] - ]; - - xMarkMap[seriesIndex].isHorizontal = false; - this.buildMark(seriesIndex); - } - } - }, - - /** - * 我真是自找麻烦啊,为啥要允许系列级个性化最小宽度和高度啊!!! - * @param {CategoryAxis} categoryAxis 类目坐标轴,需要知道类目间隔大小 - * @param {Array} locationMap 整形数据的系列索引 - */ - _mapSize : function (categoryAxis, locationMap, ignoreUserDefined) { - var series = this.series; - var seriesIndex; - var barWidthMap = {}; - var barMinHeightMap = {}; - var sBarWidth; - var sBarWidthCounter = 0; - var sBarWidthTotal = 0; - var barGap; - var barCategoryGap; - var hasFound; - var queryTarget; - var interval = 1; - - for (var j = 0, k = locationMap.length; j < k; j++) { - hasFound = false; // 同一堆积第一个barWidth生效 - for (var m = 0, n = locationMap[j].length; m < n; m++) { - seriesIndex = locationMap[j][m]; - queryTarget = series[seriesIndex]; - if (!ignoreUserDefined) { - if (!hasFound) { - sBarWidth = this.query( - queryTarget, - 'barWidth' - ); - if (typeof sBarWidth != 'undefined') { - // 同一堆积第一个生效barWidth - barWidthMap[seriesIndex] = sBarWidth; - sBarWidthTotal += sBarWidth; - sBarWidthCounter++; - hasFound = true; - // 复位前面同一堆积但没被定义的 - for (var ii = 0, ll = m; ii < ll; ii++) { - var pSeriesIndex = locationMap[j][ii]; - barWidthMap[pSeriesIndex] = sBarWidth; - } - } - } else { - barWidthMap[seriesIndex] = sBarWidth; // 用找到的一个 - } - } - - barMinHeightMap[seriesIndex] = this.query( - queryTarget, - 'barMinHeight' - ); - barGap = typeof barGap != 'undefined' - ? barGap - : this.query( - queryTarget, - 'barGap' - ); - barCategoryGap = typeof barCategoryGap != 'undefined' - ? barCategoryGap - : this.query( - queryTarget, - 'barCategoryGap' - ); - } - } - - var gap; - var barWidth; - if (locationMap.length != sBarWidthCounter) { - // 至少存在一个自适应宽度的柱形图 - if (!ignoreUserDefined) { - gap = typeof barCategoryGap == 'string' - && barCategoryGap.match(/%$/) - // 百分比 - ? Math.floor( - categoryAxis.getGap() - * (100 - parseFloat(barCategoryGap)) - / 100 - ) - // 数值 - : (categoryAxis.getGap() - barCategoryGap); - if (typeof barGap == 'string' && barGap.match(/%$/)) { - barGap = parseFloat(barGap) / 100; - barWidth = Math.floor( - (gap - sBarWidthTotal) - / ((locationMap.length - 1) * barGap - + locationMap.length - sBarWidthCounter) - ); - barGap = Math.floor(barWidth * barGap); - } - else { - barGap = parseFloat(barGap); - barWidth = Math.floor( - (gap - sBarWidthTotal - - barGap * (locationMap.length - 1) - ) - / (locationMap.length - sBarWidthCounter) - ); - } - // 无法满足用户定义的宽度设计,忽略用户宽度,打回重做 - if (barWidth <= 0) { - return this._mapSize(categoryAxis, locationMap, true); - } - } - else { - // 忽略用户定义的宽度设定 - gap = categoryAxis.getGap(); - barGap = 0; - barWidth = Math.floor(gap / locationMap.length); - // 已经忽略用户定义的宽度设定依然还无法满足显示,只能硬来了; - if (barWidth <= 0) { - interval = Math.floor(locationMap.length / gap); - barWidth = 1; - } - } - } - else { - // 全是自定义宽度,barGap无效,系列间隔决定barGap - gap = sBarWidthCounter > 1 - ? (typeof barCategoryGap == 'string' - && barCategoryGap.match(/%$/) - ) - // 百分比 - ? Math.floor( - categoryAxis.getGap() - * (100 - parseFloat(barCategoryGap)) - / 100 - ) - // 数值 - : (categoryAxis.getGap() - barCategoryGap) - // 只有一个 - : sBarWidthTotal; - barWidth = 0; - barGap = sBarWidthCounter > 1 - ? Math.floor( - (gap - sBarWidthTotal) / (sBarWidthCounter - 1) - ) - : 0; - if (barGap < 0) { - // 无法满足用户定义的宽度设计,忽略用户宽度,打回重做 - return this._mapSize(categoryAxis, locationMap, true); - } - } - - return { - barWidthMap : barWidthMap, - barMinHeightMap : barMinHeightMap , - gap : gap, - barWidth : barWidth, - barGap : barGap, - interval : interval - }; - }, - - /** - * 生成最终图形数据 - */ - _getBarItem : function (seriesIndex, dataIndex, name, x, y, width, height, orient) { - var series = this.series; - var barShape; - var serie = series[seriesIndex]; - var data = serie.data[dataIndex]; - // 多级控制 - var defaultColor = this._sIndex2colorMap[seriesIndex]; - var queryTarget = [data, serie]; - var normalColor = this.deepQuery( - queryTarget, - 'itemStyle.normal.color' - ) || defaultColor; - var emphasisColor = this.deepQuery( - queryTarget, - 'itemStyle.emphasis.color' - ); - var normal = this.deepMerge( - queryTarget, - 'itemStyle.normal' - ); - var normalBorderWidth = normal.borderWidth; - var emphasis = this.deepMerge( - queryTarget, - 'itemStyle.emphasis' - ); - barShape = { - zlevel : this._zlevelBase, - clickable: true, - style : { - x : x, - y : y, - width : width, - height : height, - brushType : 'both', - color : this.getItemStyleColor(normalColor, seriesIndex, dataIndex, data), - radius : normal.borderRadius, - lineWidth : normalBorderWidth, - strokeColor : normal.borderColor - }, - highlightStyle : { - color : this.getItemStyleColor(emphasisColor, seriesIndex, dataIndex, data), - radius : emphasis.borderRadius, - lineWidth : emphasis.borderWidth, - strokeColor : emphasis.borderColor - }, - _orient : orient - }; - barShape.highlightStyle.color = barShape.highlightStyle.color - || (typeof barShape.style.color == 'string' - ? zrColor.lift(barShape.style.color, -0.3) - : barShape.style.color - ); - // 考虑线宽的显示优化 - if (normalBorderWidth > 0 - && barShape.style.height > normalBorderWidth - && barShape.style.width > normalBorderWidth - ) { - barShape.style.y += normalBorderWidth / 2; - barShape.style.height -= normalBorderWidth; - barShape.style.x += normalBorderWidth / 2; - barShape.style.width -= normalBorderWidth; - } - else { - // 太小了或者线宽小于0,废了边线 - barShape.style.brushType = 'fill'; - } - - barShape.highlightStyle.textColor = barShape.highlightStyle.color; - - barShape = this.addLabel(barShape, serie, data, name, orient); - if (barShape.style.textPosition == 'insideLeft' - || barShape.style.textPosition == 'insideRight' - || barShape.style.textPosition == 'insideTop' - || barShape.style.textPosition == 'insideBottom' - ) { - var gap = 5; - switch (barShape.style.textPosition) { - case 'insideLeft' : - barShape.style.textX = barShape.style.x + gap; - barShape.style.textY = barShape.style.y + barShape.style.height / 2; - barShape.style.textAlign = 'left'; - barShape.style.textBaseline = 'middle'; - break; - case 'insideRight' : - barShape.style.textX = barShape.style.x + barShape.style.width - gap; - barShape.style.textY = barShape.style.y + barShape.style.height / 2; - barShape.style.textAlign = 'right'; - barShape.style.textBaseline = 'middle'; - break; - case 'insideTop' : - barShape.style.textX = barShape.style.x + barShape.style.width / 2; - barShape.style.textY = barShape.style.y + gap / 2; - barShape.style.textAlign = 'center'; - barShape.style.textBaseline = 'top'; - break; - case 'insideBottom' : - barShape.style.textX = barShape.style.x + barShape.style.width / 2; - barShape.style.textY = barShape.style.y + barShape.style.height - gap / 2; - barShape.style.textAlign = 'center'; - barShape.style.textBaseline = 'bottom'; - break; - } - barShape.style.textPosition = 'specific'; - barShape.style.textColor = barShape.style.textColor || '#fff'; - } - - - - if (this.deepQuery([data, serie, this.option],'calculable')) { - this.setCalculable(barShape); - barShape.draggable = true; - } - - ecData.pack( - barShape, - series[seriesIndex], seriesIndex, - series[seriesIndex].data[dataIndex], dataIndex, - name - ); - - return barShape; - }, - - // 位置转换 - getMarkCoord : function (seriesIndex, mpData) { - var serie = this.series[seriesIndex]; - var xMarkMap = this.xMarkMap[seriesIndex]; - var xAxis = this.component.xAxis.getAxis(serie.xAxisIndex); - var yAxis = this.component.yAxis.getAxis(serie.yAxisIndex); - var dataIndex; - var pos; - if (mpData.type - && (mpData.type == 'max' || mpData.type == 'min' || mpData.type == 'average') - ) { - // 特殊值内置支持 - pos = [ - xMarkMap[mpData.type + 'X'], - xMarkMap[mpData.type + 'Y'], - xMarkMap[mpData.type + 'Line'], - xMarkMap[mpData.type] - ]; - } - else if (xMarkMap.isHorizontal) { - // 横向 - dataIndex = typeof mpData.xAxis == 'string' && xAxis.getIndexByName - ? xAxis.getIndexByName(mpData.xAxis) - : (mpData.xAxis || 0); - - var x = xMarkMap[dataIndex]; - x = typeof x != 'undefined' - ? x - : typeof mpData.xAxis != 'string' && xAxis.getCoordByIndex - ? xAxis.getCoordByIndex(mpData.xAxis || 0) - : xAxis.getCoord(mpData.xAxis || 0); - - pos = [x, yAxis.getCoord(mpData.yAxis || 0)]; - } - else { - // 纵向 - dataIndex = typeof mpData.yAxis == 'string' && yAxis.getIndexByName - ? yAxis.getIndexByName(mpData.yAxis) - : (mpData.yAxis || 0); - - var y = xMarkMap[dataIndex]; - y = typeof y != 'undefined' - ? y - : typeof mpData.yAxis != 'string' && yAxis.getCoordByIndex - ? yAxis.getCoordByIndex(mpData.yAxis || 0) - : yAxis.getCoord(mpData.yAxis || 0); - - pos = [xAxis.getCoord(mpData.xAxis || 0), y]; - } - - return pos; - }, - - /** - * 刷新 - */ - refresh : function (newOption) { - if (newOption) { - this.option = newOption; - this.series = newOption.series; - } - - this.backupShapeList(); - this._buildShape(); - }, - - /** - * 动态数据增加动画 - */ - addDataAnimation : function (params) { - var series = this.series; - var aniMap = {}; // seriesIndex索引参数 - for (var i = 0, l = params.length; i < l; i++) { - aniMap[params[i][0]] = params[i]; - } - var x; - var dx; - var y; - var dy; - var serie; - var seriesIndex; - var dataIndex; - for (var i = this.shapeList.length - 1; i >= 0; i--) { - seriesIndex = ecData.get(this.shapeList[i], 'seriesIndex'); - if (aniMap[seriesIndex] && !aniMap[seriesIndex][3]) { - // 有数据删除才有移动的动画 - if (this.shapeList[i].type == 'rectangle') { - // 主动画 - dataIndex = ecData.get(this.shapeList[i], 'dataIndex'); - serie = series[seriesIndex]; - if (aniMap[seriesIndex][2] - && dataIndex == serie.data.length - 1 - ) { - // 队头加入删除末尾 - this.zr.delShape(this.shapeList[i].id); - continue; - } - else if (!aniMap[seriesIndex][2] && dataIndex === 0) { - // 队尾加入删除头部 - this.zr.delShape(this.shapeList[i].id); - continue; - } - if (this.shapeList[i]._orient == 'horizontal') { - // 条形图 - dy = this.component.yAxis.getAxis( - serie.yAxisIndex || 0 - ).getGap(); - y = aniMap[seriesIndex][2] ? -dy : dy; - x = 0; - } - else { - // 柱形图 - dx = this.component.xAxis.getAxis( - serie.xAxisIndex || 0 - ).getGap(); - x = aniMap[seriesIndex][2] ? dx : -dx; - y = 0; - } - this.shapeList[i].position = [0, 0]; - this.zr.animate(this.shapeList[i].id, '') - .when( - 500, - {position : [x, y]} - ) - .start(); - } - } - } - } - }; - - zrUtil.inherits(Bar, ChartBase); - zrUtil.inherits(Bar, ComponentBase); - - // 图表注册 - require('../chart').define('bar', Bar); - - return Bar; +/** + * echarts图表类:柱形图 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/chart/bar',['require','../component/base','./base','zrender/shape/Rectangle','../component/axis','../component/grid','../component/dataZoom','../config','../util/ecData','zrender/tool/util','zrender/tool/color','../chart'],function (require) { + var ComponentBase = require('../component/base'); + var ChartBase = require('./base'); + + // 图形依赖 + var RectangleShape = require('zrender/shape/Rectangle'); + // 组件依赖 + require('../component/axis'); + require('../component/grid'); + require('../component/dataZoom'); + + var ecConfig = require('../config'); + var ecData = require('../util/ecData'); + var zrUtil = require('zrender/tool/util'); + var zrColor = require('zrender/tool/color'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} series 数据 + * @param {Object} component 组件 + */ + function Bar(ecTheme, messageCenter, zr, option, myChart){ + // 基类 + ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); + // 图表基类 + ChartBase.call(this); + + this.refresh(option); + } + + Bar.prototype = { + type: ecConfig.CHART_TYPE_BAR, + /** + * 绘制图形 + */ + _buildShape: function () { + var series = this.series; + this.selectedMap = {}; + this.xMarkMap = {}; + + // series默认颜色索引,seriesIndex索引到color + this._sIndex2colorMap = {}; + + // 水平垂直双向series索引 ,position索引到seriesIndex + var _position2sIndexMap = { + top: [ ], + bottom: [ ], + left: [ ], + right: [ ] + }; + var xAxisIndex; + var yAxisIndex; + var xAxis; + var yAxis; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type === ecConfig.CHART_TYPE_BAR) { + series[i] = this.reformOption(series[i]); + xAxisIndex = series[i].xAxisIndex; + yAxisIndex = series[i].yAxisIndex; + xAxis = this.component.xAxis.getAxis(xAxisIndex); + yAxis = this.component.yAxis.getAxis(yAxisIndex); + if (xAxis.type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + ) { + _position2sIndexMap[xAxis.getPosition()].push(i); + } + else if (yAxis.type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + ) { + _position2sIndexMap[yAxis.getPosition()].push(i); + } + } + } + // console.log(_position2sIndexMap) + for (var position in _position2sIndexMap) { + if (_position2sIndexMap[position].length > 0) { + this._buildSinglePosition( + position, _position2sIndexMap[position], this.xMarkMap + ); + } + } + + this.addShapeList(); + }, + + /** + * 构建单个方向上的柱形图 + * + * @param {number} seriesIndex 系列索引 + */ + _buildSinglePosition: function (position, seriesArray, xMarkMap) { + var mapData = this._mapData(seriesArray); + var locationMap = mapData.locationMap; + var maxDataLength = mapData.maxDataLength; + + if (maxDataLength === 0 || locationMap.length === 0) { + return; + } + + switch (position) { + case 'bottom' : + case 'top' : + this._buildHorizontal(maxDataLength, locationMap, seriesArray, xMarkMap); + break; + case 'left' : + case 'right' : + this._buildVertical(maxDataLength, locationMap, seriesArray, xMarkMap); + break; + } + }, + + /** + * 数据整形 + * 数组位置映射到系列索引 + */ + _mapData: function (seriesArray) { + var series = this.series; + var serie; // 临时映射变量 + var dataIndex = 0; // 堆积数据所在位置映射 + var stackMap = {}; // 堆积数据位置映射,堆积组在二维中的第几项 + var magicStackKey = '__kener__stack__'; // 堆积命名,非堆积数据安单一堆积处理 + var stackKey; // 临时映射变量 + var serieName; // 临时映射变量 + var legend = this.component.legend; + var locationMap = [ ]; // 需要返回的东西:数组位置映射到系列索引 + var maxDataLength = 0; // 需要返回的东西:最大数据长度 + var iconShape; + // 计算需要显示的个数和分配位置并记在下面这个结构里 + for (var i = 0, l = seriesArray.length; i < l; i++) { + serie = series[seriesArray[i]]; + serieName = serie.name; + if (legend){ + this.selectedMap[serieName] = legend.isSelected(serieName); + this._sIndex2colorMap[seriesArray[i]] = + legend.getColor(serieName); + + iconShape = legend.getItemShape(serieName); + if (iconShape) { + // 回调legend,换一个更形象的icon + if (serie.itemStyle.normal.barBorderWidth > 0) { + iconShape.style.x += 1; + iconShape.style.y += 1; + iconShape.style.width -= 2; + iconShape.style.height -= 2; + iconShape.style.strokeColor = + iconShape.highlightStyle.strokeColor = + serie.itemStyle.normal.barBorderColor; + iconShape.highlightStyle.lineWidth = 3; + iconShape.style.brushType = 'both'; + } + legend.setItemShape(serieName, iconShape); + } + } else { + this.selectedMap[serieName] = true; + this._sIndex2colorMap[seriesArray[i]] = + this.zr.getColor(seriesArray[i]); + } + + if (this.selectedMap[serieName]) { + stackKey = serie.stack || (magicStackKey + seriesArray[i]); + if (stackMap[stackKey] == null) { + stackMap[stackKey] = dataIndex; + locationMap[dataIndex] = [seriesArray[i]]; + dataIndex++; + } + else { + // 已经分配了位置就推进去就行 + locationMap[stackMap[stackKey]].push(seriesArray[i]); + } + } + // 兼职帮算一下最大长度 + maxDataLength = Math.max(maxDataLength, serie.data.length); + } + + /* 调试输出 + var s = ''; + for (var i = 0, l = maxDataLength; i < l; i++) { + s = '['; + for (var j = 0, k = locationMap.length; j < k; j++) { + s +='[' + for (var m = 0, n = locationMap[j].length - 1; m < n; m++) { + s += series[locationMap[j][m]].data[i] + ',' + } + s += series[locationMap[j][locationMap[j].length - 1]] + .data[i]; + s += ']' + } + s += ']'; + console.log(s); + } + console.log(locationMap) + */ + + return { + locationMap: locationMap, + maxDataLength: maxDataLength + }; + }, + + /** + * 构建类目轴为水平方向的柱形图系列 + */ + _buildHorizontal: function (maxDataLength, locationMap, seriesArray, xMarkMap) { + var series = this.series; + // 确定类目轴和数值轴,同一方向随便找一个即可 + var seriesIndex = locationMap[0][0]; + var serie = series[seriesIndex]; + var xAxisIndex = serie.xAxisIndex; + var categoryAxis = this.component.xAxis.getAxis(xAxisIndex); + var yAxisIndex; // 数值轴各异 + var valueAxis; // 数值轴各异 + + var size = this._mapSize(categoryAxis, locationMap); + var gap = size.gap; + var barGap = size.barGap; + var barWidthMap = size.barWidthMap; + var barWidth = size.barWidth; // 自适应宽度 + var barMinHeightMap = size.barMinHeightMap; + var barHeight; + var interval = size.interval; + + var x; + var y; + var lastYP; // 正向堆积处理 + var baseYP; + var lastYN; // 负向堆积处理 + var baseYN; + var barShape; + var data; + var value; + for (var i = 0, l = maxDataLength; i < l; i++) { + if (categoryAxis.getNameByIndex(i) == null) { + // 系列数据超出类目轴长度 + break; + } + x = categoryAxis.getCoordByIndex(i) - gap / 2; + for (var j = 0, k = locationMap.length; j < k; j++) { + // 堆积数据用第一条valueAxis + yAxisIndex = series[locationMap[j][0]].yAxisIndex || 0; + valueAxis = this.component.yAxis.getAxis(yAxisIndex); + baseYP = lastYP = baseYN = lastYN = valueAxis.getCoord(0); + for (var m = 0, n = locationMap[j].length; m < n; m++) { + seriesIndex = locationMap[j][m]; + serie = series[seriesIndex]; + data = serie.data[i]; + value = data != null + ? (data.value != null + ? data.value + : data) + : '-'; + xMarkMap[seriesIndex] = xMarkMap[seriesIndex] + || { + min: Number.POSITIVE_INFINITY, + max: Number.NEGATIVE_INFINITY, + sum: 0, + counter: 0, + average: 0 + }; + if (value === '-') { + // 空数据在做完后补充拖拽提示框 + continue; + } + //y = valueAxis.getCoord(value); + if (value > 0) { + // 正向堆积 + //barHeight = baseYP - y; + barHeight = m > 0 + ? valueAxis.getCoordSize(value) + : (baseYP - valueAxis.getCoord(value)); + // 非堆积数据最小高度有效 + if (n === 1 + && barMinHeightMap[seriesIndex] > barHeight + ) { + barHeight = barMinHeightMap[seriesIndex]; + } + lastYP -= barHeight; + y = lastYP; + } + else if (value < 0){ + // 负向堆积 + //barHeight = y - baseYN; + barHeight = m > 0 + ? valueAxis.getCoordSize(value) + : (valueAxis.getCoord(value) - baseYN); + // 非堆积数据最小高度有效 + if (n === 1 + && barMinHeightMap[seriesIndex] > barHeight + ) { + barHeight = barMinHeightMap[seriesIndex]; + } + y = lastYN; + lastYN += barHeight; + } + else { + // 0值 + barHeight = 0;//baseYP - y; + // 最小高度无效 + lastYP -= barHeight; + y = lastYP; + } + xMarkMap[seriesIndex][i] = + x + (barWidthMap[seriesIndex] || barWidth) / 2; + if (xMarkMap[seriesIndex].min > value) { + xMarkMap[seriesIndex].min = value; + xMarkMap[seriesIndex].minY = y; + xMarkMap[seriesIndex].minX = xMarkMap[seriesIndex][i]; + } + if (xMarkMap[seriesIndex].max < value) { + xMarkMap[seriesIndex].max = value; + xMarkMap[seriesIndex].maxY = y; + xMarkMap[seriesIndex].maxX = xMarkMap[seriesIndex][i]; + } + xMarkMap[seriesIndex].sum += value; + xMarkMap[seriesIndex].counter++; + + if (i % interval === 0) { + barShape = this._getBarItem( + seriesIndex, i, + categoryAxis.getNameByIndex(i), + x, y, + barWidthMap[seriesIndex] || barWidth, + barHeight, + 'vertical' + ); + this.shapeList.push(new RectangleShape(barShape)); + } + } + + // 补充空数据的拖拽提示框 + for (var m = 0, n = locationMap[j].length; m < n; m++) { + seriesIndex = locationMap[j][m]; + serie = series[seriesIndex]; + data = serie.data[i]; + value = data != null + ? (data.value != null + ? data.value + : data) + : '-'; + if (value != '-') { + // 只关心空数据 + continue; + } + + if (this.deepQuery( + [data, serie, this.option], 'calculable' + ) + ) { + lastYP -= this.ecTheme.island.r; + y = lastYP; + + barShape = this._getBarItem( + seriesIndex, i, + categoryAxis.getNameByIndex(i), + x + 0.5, y + 0.5, + (barWidthMap[seriesIndex] || barWidth) - 1, + this.ecTheme.island.r - 1, + 'vertical' + ); + barShape.hoverable = false; + barShape.draggable = false; + barShape.style.lineWidth = 1; + barShape.style.brushType = 'stroke'; + barShape.style.strokeColor = + serie.calculableHolderColor + || this.ecTheme.calculableHolderColor; + + this.shapeList.push(new RectangleShape(barShape)); + } + } + + x += ((barWidthMap[seriesIndex] || barWidth) + barGap); + } + } + + for (var j = 0, k = locationMap.length; j < k; j++) { + for (var m = 0, n = locationMap[j].length; m < n; m++) { + seriesIndex = locationMap[j][m]; + if (xMarkMap[seriesIndex].counter > 0) { + xMarkMap[seriesIndex].average = + (xMarkMap[seriesIndex].sum / xMarkMap[seriesIndex].counter).toFixed(2) + - 0; + } + + y = this.component.yAxis.getAxis(series[seriesIndex].yAxisIndex || 0) + .getCoord(xMarkMap[seriesIndex].average); + + xMarkMap[seriesIndex].averageLine = [ + [this.component.grid.getX(), y], + [this.component.grid.getXend(), y] + ]; + xMarkMap[seriesIndex].minLine = [ + [this.component.grid.getX(), xMarkMap[seriesIndex].minY], + [this.component.grid.getXend(), xMarkMap[seriesIndex].minY] + ]; + xMarkMap[seriesIndex].maxLine = [ + [this.component.grid.getX(), xMarkMap[seriesIndex].maxY], + [this.component.grid.getXend(), xMarkMap[seriesIndex].maxY] + ]; + + xMarkMap[seriesIndex].isHorizontal = true; + this.buildMark(seriesIndex); + } + } + }, + + /** + * 构建类目轴为垂直方向的柱形图系列 + */ + _buildVertical: function (maxDataLength, locationMap, seriesArray, xMarkMap) { + var series = this.series; + // 确定类目轴和数值轴,同一方向随便找一个即可 + var seriesIndex = locationMap[0][0]; + var serie = series[seriesIndex]; + var yAxisIndex = serie.yAxisIndex; + var categoryAxis = this.component.yAxis.getAxis(yAxisIndex); + var xAxisIndex; // 数值轴各异 + var valueAxis; // 数值轴各异 + + var size = this._mapSize(categoryAxis, locationMap); + var gap = size.gap; + var barGap = size.barGap; + var barWidthMap = size.barWidthMap; + var barWidth = size.barWidth; // 自适应宽度 + var barMinHeightMap = size.barMinHeightMap; + var barHeight; + var interval = size.interval; + + var x; + var y; + var lastXP; // 正向堆积处理 + var baseXP; + var lastXN; // 负向堆积处理 + var baseXN; + var barShape; + var data; + var value; + for (var i = 0, l = maxDataLength; i < l; i++) { + if (categoryAxis.getNameByIndex(i) == null) { + // 系列数据超出类目轴长度 + break; + } + y = categoryAxis.getCoordByIndex(i) + gap / 2; + for (var j = 0, k = locationMap.length; j < k; j++) { + // 堆积数据用第一条valueAxis + xAxisIndex = series[locationMap[j][0]].xAxisIndex || 0; + valueAxis = this.component.xAxis.getAxis(xAxisIndex); + baseXP = lastXP = baseXN = lastXN = valueAxis.getCoord(0); + for (var m = 0, n = locationMap[j].length; m < n; m++) { + seriesIndex = locationMap[j][m]; + serie = series[seriesIndex]; + data = serie.data[i]; + value = data != null + ? (data.value != null + ? data.value + : data) + : '-'; + xMarkMap[seriesIndex] = xMarkMap[seriesIndex] + || { + min: Number.POSITIVE_INFINITY, + max: Number.NEGATIVE_INFINITY, + sum: 0, + counter: 0, + average: 0 + }; + if (value === '-') { + // 空数据在做完后补充拖拽提示框 + continue; + } + //x = valueAxis.getCoord(value); + if (value > 0) { + // 正向堆积 + //barHeight = x - baseXP; + barHeight = m > 0 + ? valueAxis.getCoordSize(value) + : (valueAxis.getCoord(value) - baseXP); + // 非堆积数据最小高度有效 + if (n === 1 + && barMinHeightMap[seriesIndex] > barHeight + ) { + barHeight = barMinHeightMap[seriesIndex]; + } + x = lastXP; + lastXP += barHeight; + } + else if (value < 0){ + // 负向堆积 + //barHeight = baseXN - x; + barHeight = m > 0 + ? valueAxis.getCoordSize(value) + : (baseXN - valueAxis.getCoord(value)); + // 非堆积数据最小高度有效 + if (n === 1 + && barMinHeightMap[seriesIndex] > barHeight + ) { + barHeight = barMinHeightMap[seriesIndex]; + } + lastXN -= barHeight; + x = lastXN; + } + else { + // 0值 + barHeight = 0;//x - baseXP; + // 最小高度无效 + x = lastXP; + lastXP += barHeight; + } + + xMarkMap[seriesIndex][i] = + y - (barWidthMap[seriesIndex] || barWidth) / 2; + if (xMarkMap[seriesIndex].min > value) { + xMarkMap[seriesIndex].min = value; + xMarkMap[seriesIndex].minX = x + barHeight; + xMarkMap[seriesIndex].minY = xMarkMap[seriesIndex][i]; + } + if (xMarkMap[seriesIndex].max < value) { + xMarkMap[seriesIndex].max = value; + xMarkMap[seriesIndex].maxX = x + barHeight; + xMarkMap[seriesIndex].maxY = xMarkMap[seriesIndex][i]; + } + xMarkMap[seriesIndex].sum += value; + xMarkMap[seriesIndex].counter++; + + if (i % interval === 0) { + barShape = this._getBarItem( + seriesIndex, i, + categoryAxis.getNameByIndex(i), + x, y - (barWidthMap[seriesIndex] || barWidth), + barHeight, + barWidthMap[seriesIndex] || barWidth, + 'horizontal' + ); + this.shapeList.push(new RectangleShape(barShape)); + } + } + + // 补充空数据的拖拽提示框 + for (var m = 0, n = locationMap[j].length; m < n; m++) { + seriesIndex = locationMap[j][m]; + serie = series[seriesIndex]; + data = serie.data[i]; + value = data != null + ? (data.value != null + ? data.value + : data) + : '-'; + if (value != '-') { + // 只关心空数据 + continue; + } + + if (this.deepQuery( + [data, serie, this.option], 'calculable' + ) + ) { + x = lastXP; + lastXP += this.ecTheme.island.r; + + barShape = this._getBarItem( + seriesIndex, + i, + categoryAxis.getNameByIndex(i), + x + 0.5, y + 0.5 - (barWidthMap[seriesIndex] || barWidth), + this.ecTheme.island.r - 1, + (barWidthMap[seriesIndex] || barWidth) - 1, + 'horizontal' + ); + barShape.hoverable = false; + barShape.draggable = false; + barShape.style.lineWidth = 1; + barShape.style.brushType = 'stroke'; + barShape.style.strokeColor = + serie.calculableHolderColor + || this.ecTheme.calculableHolderColor; + + this.shapeList.push(new RectangleShape(barShape)); + } + } + + y -= ((barWidthMap[seriesIndex] || barWidth) + barGap); + } + } + + for (var j = 0, k = locationMap.length; j < k; j++) { + for (var m = 0, n = locationMap[j].length; m < n; m++) { + seriesIndex = locationMap[j][m]; + if (xMarkMap[seriesIndex].counter > 0) { + xMarkMap[seriesIndex].average = + (xMarkMap[seriesIndex].sum / xMarkMap[seriesIndex].counter).toFixed(2) + - 0; + } + + x = this.component.xAxis.getAxis(series[seriesIndex].xAxisIndex || 0) + .getCoord(xMarkMap[seriesIndex].average); + + xMarkMap[seriesIndex].averageLine = [ + [x, this.component.grid.getYend()], + [x, this.component.grid.getY()] + ]; + xMarkMap[seriesIndex].minLine = [ + [xMarkMap[seriesIndex].minX, this.component.grid.getYend()], + [xMarkMap[seriesIndex].minX, this.component.grid.getY()] + ]; + xMarkMap[seriesIndex].maxLine = [ + [xMarkMap[seriesIndex].maxX, this.component.grid.getYend()], + [xMarkMap[seriesIndex].maxX, this.component.grid.getY()] + ]; + + xMarkMap[seriesIndex].isHorizontal = false; + this.buildMark(seriesIndex); + } + } + }, + + /** + * 我真是自找麻烦啊,为啥要允许系列级个性化最小宽度和高度啊!!! + * @param {CategoryAxis} categoryAxis 类目坐标轴,需要知道类目间隔大小 + * @param {Array} locationMap 整形数据的系列索引 + */ + _mapSize: function (categoryAxis, locationMap, ignoreUserDefined) { + var series = this.series; + var seriesIndex; + var barWidthMap = {}; + var barMinHeightMap = {}; + var sBarWidth; + var sBarWidthCounter = 0; + var sBarWidthTotal = 0; + var barGap; + var barCategoryGap; + var hasFound; + var queryTarget; + var interval = 1; + + for (var j = 0, k = locationMap.length; j < k; j++) { + hasFound = false; // 同一堆积第一个barWidth生效 + for (var m = 0, n = locationMap[j].length; m < n; m++) { + seriesIndex = locationMap[j][m]; + queryTarget = series[seriesIndex]; + if (!ignoreUserDefined) { + if (!hasFound) { + sBarWidth = this.query( + queryTarget, + 'barWidth' + ); + if (sBarWidth != null) { + // 同一堆积第一个生效barWidth + barWidthMap[seriesIndex] = sBarWidth; + sBarWidthTotal += sBarWidth; + sBarWidthCounter++; + hasFound = true; + // 复位前面同一堆积但没被定义的 + for (var ii = 0, ll = m; ii < ll; ii++) { + var pSeriesIndex = locationMap[j][ii]; + barWidthMap[pSeriesIndex] = sBarWidth; + } + } + } else { + barWidthMap[seriesIndex] = sBarWidth; // 用找到的一个 + } + } + + barMinHeightMap[seriesIndex] = this.query(queryTarget, 'barMinHeight'); + barGap = barGap != null ? barGap : this.query(queryTarget, 'barGap'); + barCategoryGap = barCategoryGap != null + ? barCategoryGap : this.query(queryTarget, 'barCategoryGap'); + } + } + + var gap; + var barWidth; + if (locationMap.length != sBarWidthCounter) { + // 至少存在一个自适应宽度的柱形图 + if (!ignoreUserDefined) { + gap = typeof barCategoryGap === 'string' + && barCategoryGap.match(/%$/) + // 百分比 + ? Math.floor( + categoryAxis.getGap() + * (100 - parseFloat(barCategoryGap)) + / 100 + ) + // 数值 + : (categoryAxis.getGap() - barCategoryGap); + if (typeof barGap === 'string' && barGap.match(/%$/)) { + barGap = parseFloat(barGap) / 100; + barWidth = Math.floor( + (gap - sBarWidthTotal) + / ((locationMap.length - 1) * barGap + + locationMap.length - sBarWidthCounter) + ); + barGap = Math.floor(barWidth * barGap); + } + else { + barGap = parseFloat(barGap); + barWidth = Math.floor( + (gap - sBarWidthTotal + - barGap * (locationMap.length - 1) + ) + / (locationMap.length - sBarWidthCounter) + ); + } + // 无法满足用户定义的宽度设计,忽略用户宽度,打回重做 + if (barWidth <= 0) { + return this._mapSize(categoryAxis, locationMap, true); + } + } + else { + // 忽略用户定义的宽度设定 + gap = categoryAxis.getGap(); + barGap = 0; + barWidth = Math.floor(gap / locationMap.length); + // 已经忽略用户定义的宽度设定依然还无法满足显示,只能硬来了; + if (barWidth <= 0) { + interval = Math.floor(locationMap.length / gap); + barWidth = 1; + } + } + } + else { + // 全是自定义宽度,barGap无效,系列间隔决定barGap + gap = sBarWidthCounter > 1 + ? (typeof barCategoryGap === 'string' + && barCategoryGap.match(/%$/) + ) + // 百分比 + ? Math.floor( + categoryAxis.getGap() + * (100 - parseFloat(barCategoryGap)) + / 100 + ) + // 数值 + : (categoryAxis.getGap() - barCategoryGap) + // 只有一个 + : sBarWidthTotal; + barWidth = 0; + barGap = sBarWidthCounter > 1 + ? Math.floor( + (gap - sBarWidthTotal) / (sBarWidthCounter - 1) + ) + : 0; + if (barGap < 0) { + // 无法满足用户定义的宽度设计,忽略用户宽度,打回重做 + return this._mapSize(categoryAxis, locationMap, true); + } + } + + return { + barWidthMap: barWidthMap, + barMinHeightMap: barMinHeightMap , + gap: gap, + barWidth: barWidth, + barGap: barGap, + interval: interval + }; + }, + + /** + * 生成最终图形数据 + */ + _getBarItem: function (seriesIndex, dataIndex, name, x, y, width, height, orient) { + var series = this.series; + var barShape; + var serie = series[seriesIndex]; + var data = serie.data[dataIndex]; + // 多级控制 + var defaultColor = this._sIndex2colorMap[seriesIndex]; + var queryTarget = [data, serie]; + var normalColor = this.deepQuery( + queryTarget, + 'itemStyle.normal.color' + ) || defaultColor; + var emphasisColor = this.deepQuery( + queryTarget, + 'itemStyle.emphasis.color' + ); + var normal = this.deepMerge( + queryTarget, + 'itemStyle.normal' + ); + var normalBorderWidth = normal.barBorderWidth; + var emphasis = this.deepMerge( + queryTarget, + 'itemStyle.emphasis' + ); + barShape = { + zlevel: this._zlevelBase, + clickable: this.deepQuery(queryTarget, 'clickable'), + style: { + x: x, + y: y, + width: width, + height: height, + brushType: 'both', + color: this.getItemStyleColor(normalColor, seriesIndex, dataIndex, data), + radius: normal.barBorderRadius, + lineWidth: normalBorderWidth, + strokeColor: normal.barBorderColor + }, + highlightStyle: { + color: this.getItemStyleColor(emphasisColor, seriesIndex, dataIndex, data), + radius: emphasis.barBorderRadius, + lineWidth: emphasis.barBorderWidth, + strokeColor: emphasis.barBorderColor + }, + _orient: orient + }; + barShape.highlightStyle.color = barShape.highlightStyle.color + || (typeof barShape.style.color === 'string' + ? zrColor.lift(barShape.style.color, -0.3) + : barShape.style.color + ); + // 考虑线宽的显示优化 + if (normalBorderWidth > 0 + && barShape.style.height > normalBorderWidth + && barShape.style.width > normalBorderWidth + ) { + barShape.style.y += normalBorderWidth / 2; + barShape.style.height -= normalBorderWidth; + barShape.style.x += normalBorderWidth / 2; + barShape.style.width -= normalBorderWidth; + } + else { + // 太小了或者线宽小于0,废了边线 + barShape.style.brushType = 'fill'; + } + + barShape.highlightStyle.textColor = barShape.highlightStyle.color; + + barShape = this.addLabel(barShape, serie, data, name, orient); + if (barShape.style.textPosition === 'insideLeft' + || barShape.style.textPosition === 'insideRight' + || barShape.style.textPosition === 'insideTop' + || barShape.style.textPosition === 'insideBottom' + ) { + var gap = 5; + switch (barShape.style.textPosition) { + case 'insideLeft': + barShape.style.textX = barShape.style.x + gap; + barShape.style.textY = barShape.style.y + barShape.style.height / 2; + barShape.style.textAlign = 'left'; + barShape.style.textBaseline = 'middle'; + break; + case 'insideRight': + barShape.style.textX = barShape.style.x + barShape.style.width - gap; + barShape.style.textY = barShape.style.y + barShape.style.height / 2; + barShape.style.textAlign = 'right'; + barShape.style.textBaseline = 'middle'; + break; + case 'insideTop': + barShape.style.textX = barShape.style.x + barShape.style.width / 2; + barShape.style.textY = barShape.style.y + gap / 2; + barShape.style.textAlign = 'center'; + barShape.style.textBaseline = 'top'; + break; + case 'insideBottom': + barShape.style.textX = barShape.style.x + barShape.style.width / 2; + barShape.style.textY = barShape.style.y + barShape.style.height - gap / 2; + barShape.style.textAlign = 'center'; + barShape.style.textBaseline = 'bottom'; + break; + } + barShape.style.textPosition = 'specific'; + barShape.style.textColor = barShape.style.textColor || '#fff'; + } + + + + if (this.deepQuery([data, serie, this.option],'calculable')) { + this.setCalculable(barShape); + barShape.draggable = true; + } + + ecData.pack( + barShape, + series[seriesIndex], seriesIndex, + series[seriesIndex].data[dataIndex], dataIndex, + name + ); + + return barShape; + }, + + // 位置转换 + getMarkCoord: function (seriesIndex, mpData) { + var serie = this.series[seriesIndex]; + var xMarkMap = this.xMarkMap[seriesIndex]; + var xAxis = this.component.xAxis.getAxis(serie.xAxisIndex); + var yAxis = this.component.yAxis.getAxis(serie.yAxisIndex); + var dataIndex; + var pos; + if (mpData.type + && (mpData.type === 'max' || mpData.type === 'min' || mpData.type === 'average') + ) { + // 特殊值内置支持 + pos = [ + xMarkMap[mpData.type + 'X'], + xMarkMap[mpData.type + 'Y'], + xMarkMap[mpData.type + 'Line'], + xMarkMap[mpData.type] + ]; + } + else if (xMarkMap.isHorizontal) { + // 横向 + dataIndex = typeof mpData.xAxis === 'string' && xAxis.getIndexByName + ? xAxis.getIndexByName(mpData.xAxis) + : (mpData.xAxis || 0); + + var x = xMarkMap[dataIndex]; + x = x != null + ? x + : typeof mpData.xAxis != 'string' && xAxis.getCoordByIndex + ? xAxis.getCoordByIndex(mpData.xAxis || 0) + : xAxis.getCoord(mpData.xAxis || 0); + + pos = [x, yAxis.getCoord(mpData.yAxis || 0)]; + } + else { + // 纵向 + dataIndex = typeof mpData.yAxis === 'string' && yAxis.getIndexByName + ? yAxis.getIndexByName(mpData.yAxis) + : (mpData.yAxis || 0); + + var y = xMarkMap[dataIndex]; + y = y != null + ? y + : typeof mpData.yAxis != 'string' && yAxis.getCoordByIndex + ? yAxis.getCoordByIndex(mpData.yAxis || 0) + : yAxis.getCoord(mpData.yAxis || 0); + + pos = [xAxis.getCoord(mpData.xAxis || 0), y]; + } + + return pos; + }, + + /** + * 刷新 + */ + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + + this.backupShapeList(); + this._buildShape(); + }, + + /** + * 动态数据增加动画 + */ + addDataAnimation: function (params) { + var series = this.series; + var aniMap = {}; // seriesIndex索引参数 + for (var i = 0, l = params.length; i < l; i++) { + aniMap[params[i][0]] = params[i]; + } + var x; + var dx; + var y; + var dy; + var serie; + var seriesIndex; + var dataIndex; + for (var i = this.shapeList.length - 1; i >= 0; i--) { + seriesIndex = ecData.get(this.shapeList[i], 'seriesIndex'); + if (aniMap[seriesIndex] && !aniMap[seriesIndex][3]) { + // 有数据删除才有移动的动画 + if (this.shapeList[i].type === 'rectangle') { + // 主动画 + dataIndex = ecData.get(this.shapeList[i], 'dataIndex'); + serie = series[seriesIndex]; + if (aniMap[seriesIndex][2] + && dataIndex === serie.data.length - 1 + ) { + // 队头加入删除末尾 + this.zr.delShape(this.shapeList[i].id); + continue; + } + else if (!aniMap[seriesIndex][2] && dataIndex === 0) { + // 队尾加入删除头部 + this.zr.delShape(this.shapeList[i].id); + continue; + } + if (this.shapeList[i]._orient === 'horizontal') { + // 条形图 + dy = this.component.yAxis.getAxis( + serie.yAxisIndex || 0 + ).getGap(); + y = aniMap[seriesIndex][2] ? -dy : dy; + x = 0; + } + else { + // 柱形图 + dx = this.component.xAxis.getAxis( + serie.xAxisIndex || 0 + ).getGap(); + x = aniMap[seriesIndex][2] ? dx : -dx; + y = 0; + } + this.shapeList[i].position = [0, 0]; + this.zr.animate(this.shapeList[i].id, '') + .when( + 500, + { position: [x, y] } + ) + .start(); + } + } + } + } + }; + + zrUtil.inherits(Bar, ChartBase); + zrUtil.inherits(Bar, ComponentBase); + + // 图表注册 + require('../chart').define('bar', Bar); + + return Bar; }); -/** - * echarts图表类:饼图 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/chart/pie',['require','../component/base','./base','zrender/shape/Text','zrender/shape/Ring','zrender/shape/Circle','zrender/shape/Sector','zrender/shape/BrokenLine','../config','../util/ecData','zrender/tool/util','zrender/tool/math','zrender/tool/color','../chart'],function (require) { - var ComponentBase = require('../component/base'); - var ChartBase = require('./base'); - - // 图形依赖 - var TextShape = require('zrender/shape/Text'); - var RingShape = require('zrender/shape/Ring'); - var CircleShape = require('zrender/shape/Circle'); - var SectorShape = require('zrender/shape/Sector'); - var BrokenLineShape = require('zrender/shape/BrokenLine'); - - var ecConfig = require('../config'); - var ecData = require('../util/ecData'); - var zrUtil = require('zrender/tool/util'); - var zrMath = require('zrender/tool/math'); - var zrColor = require('zrender/tool/color'); - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} series 数据 - * @param {Object} component 组件 - */ - function Pie(ecTheme, messageCenter, zr, option, myChart){ - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); - // 图表基类 - ChartBase.call(this); - - var self = this; - /** - * 输出动态视觉引导线 - */ - self.shapeHandler.onmouseover = function (param) { - var shape = param.target; - var seriesIndex = ecData.get(shape, 'seriesIndex'); - var dataIndex = ecData.get(shape, 'dataIndex'); - var percent = ecData.get(shape, 'special'); - var lastAddRadius = shape._lastAddRadius; - - var startAngle = shape.style.startAngle; - var endAngle = shape.style.endAngle; - var defaultColor = shape.highlightStyle.color; - - // 文本标签,需要显示则会有返回 - var label = self.getLabel( - seriesIndex, dataIndex, percent, lastAddRadius, - startAngle, endAngle, defaultColor, - true - ); - if (label) { - self.zr.addHoverShape(label); - } - - // 文本标签视觉引导线,需要显示则会有返回 - var labelLine = self.getLabelLine( - seriesIndex, dataIndex, lastAddRadius, - shape.style.r0, shape.style.r, - startAngle, endAngle, defaultColor, - true - ); - if (labelLine) { - self.zr.addHoverShape(labelLine); - } - }; - - this.refresh(option); - } - - Pie.prototype = { - type : ecConfig.CHART_TYPE_PIE, - /** - * 绘制图形 - */ - _buildShape : function () { - var series = this.series; - var legend = this.component.legend; - this.selectedMap = {}; - this._selected = {}; - var center; - var radius; - - var pieCase; // 饼图箱子 - this._selectedMode = false; - var serieName; - for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type == ecConfig.CHART_TYPE_PIE) { - series[i] = this.reformOption(series[i]); - serieName = series[i].name || ''; - // 系列图例开关 - this.selectedMap[serieName] = - legend ? legend.isSelected(serieName) : true; - if (!this.selectedMap[serieName]) { - continue; - } - - center = this.parseCenter(this.zr, series[i].center); - radius = this.parseRadius(this.zr, series[i].radius); - this._selectedMode = this._selectedMode || series[i].selectedMode; - this._selected[i] = []; - if (this.deepQuery([series[i], this.option], 'calculable')) { - pieCase = { - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : center[0], // 圆心横坐标 - y : center[1], // 圆心纵坐标 - // 圆环内外半径 - r0 : radius[0] <= 10 ? 0 : radius[0] - 10, - r : radius[1] + 10, - brushType : 'stroke', - lineWidth: 1, - strokeColor : series[i].calculableHolderColor - || this.ecTheme.calculableHolderColor - } - }; - ecData.pack(pieCase, series[i], i, undefined, -1); - this.setCalculable(pieCase); - - pieCase = radius[0] <= 10 - ? new CircleShape(pieCase) - : new RingShape(pieCase); - this.shapeList.push(pieCase); - } - this._buildSinglePie(i); - this.buildMark(i); - } - } - - this.addShapeList(); - }, - - /** - * 构建单个饼图 - * - * @param {number} seriesIndex 系列索引 - */ - _buildSinglePie : function (seriesIndex) { - var series = this.series; - var serie = series[seriesIndex]; - var data = serie.data; - var legend = this.component.legend; - var itemName; - var totalSelected = 0; // 迭代累计选中且非0个数 - var totalSelectedValue0 = 0; // 迭代累计选中0只个数 - var totalValue = 0; // 迭代累计 - var maxValue = Number.NEGATIVE_INFINITY; - - // 计算需要显示的个数和总值 - for (var i = 0, l = data.length; i < l; i++) { - itemName = data[i].name; - if (legend){ - this.selectedMap[itemName] = legend.isSelected(itemName); - } else { - this.selectedMap[itemName] = true; - } - if (this.selectedMap[itemName] && !isNaN(data[i].value)) { - if (+data[i].value !== 0) { - totalSelected++; - } - else { - totalSelectedValue0++; - } - totalValue += +data[i].value; - maxValue = Math.max(maxValue, +data[i].value); - } - } - - var percent = 100; - var lastPercent; // 相邻细角度优化 - var lastAddRadius = 0; - var clockWise = serie.clockWise; - var startAngle = serie.startAngle.toFixed(2) - 0; - var endAngle; - var minAngle = serie.minAngle || 0.01; // #bugfixed - var totalAngle = 360 - (minAngle * totalSelected) - - 0.01 * totalSelectedValue0; - var defaultColor; - var roseType = serie.roseType; - var radius; - var r0; // 扇形内半径 - var r1; // 扇形外半径 - - for (var i = 0, l = data.length; i < l; i++) { - itemName = data[i].name; - if (!this.selectedMap[itemName] || isNaN(data[i].value)) { - continue; - } - // 默认颜色策略 - if (legend) { - // 有图例则从图例中获取颜色定义 - defaultColor = legend.getColor(itemName); - } - else { - // 全局颜色定义 - defaultColor = this.zr.getColor(i); - } - - lastPercent = percent; - percent = data[i].value / totalValue; - if (roseType != 'area') { - endAngle = clockWise - ? (startAngle - percent * totalAngle - (percent !== 0 ? minAngle : 0.01)) - : (percent * totalAngle + startAngle + (percent !== 0 ? minAngle : 0.01)); - } - else { - endAngle = clockWise - ? (startAngle - 360 / l) - : (360 / l + startAngle); - } - endAngle = endAngle.toFixed(2) - 0; - percent = (percent * 100).toFixed(2); - - radius = this.parseRadius(this.zr, serie.radius); - r0 = +radius[0]; - r1 = +radius[1]; - - if (roseType == 'radius') { - r1 = data[i].value / maxValue * (r1 - r0) * 0.8 - + (r1 - r0) * 0.2 - + r0; - } - else if (roseType == 'area') { - r1 = Math.sqrt(data[i].value / maxValue) * (r1 - r0) + r0; - } - - if (clockWise) { - var temp; - temp = startAngle; - startAngle = endAngle; - endAngle = temp; - } - - // 当前小角度需要检查前一个是否也是小角度,如果是得调整长度,不能完全避免,但能大大降低覆盖概率 - if (i > 0 - && Math.abs(startAngle - endAngle) < 15 // 约15度 - && lastPercent < 4 - && this._needLabel(serie, data[i], false) - && this.deepQuery( - [data[i], serie], 'itemStyle.normal.label.position' - ) != 'center' - ) { - // 都小就延长,前小后大就缩短 - lastAddRadius += (percent < 4 ? 20 : -20); - } - else { - lastAddRadius = 0; - } - - this._buildItem( - seriesIndex, i, percent, lastAddRadius, // 相邻最小角度优化 - data[i].selected, - r0, r1, - startAngle, endAngle, defaultColor - ); - if (!clockWise) { - startAngle = endAngle; - } - } - }, - - /** - * 构建单个扇形及指标 - */ - _buildItem : function ( - seriesIndex, dataIndex, percent, lastAddRadius, - isSelected, - r0, r1, - startAngle, endAngle, defaultColor - ) { - var series = this.series; - // 扇形 - var sector = this.getSector( - seriesIndex, dataIndex, percent, isSelected, - r0, r1, - startAngle, endAngle, defaultColor - ); - // 图形需要附加的私有数据 - ecData.pack( - sector, - series[seriesIndex], seriesIndex, - series[seriesIndex].data[dataIndex], dataIndex, - series[seriesIndex].data[dataIndex].name, - percent - ); - sector._lastAddRadius = lastAddRadius; - this.shapeList.push(sector); - - // 文本标签,需要显示则会有返回 - var label = this.getLabel( - seriesIndex, dataIndex, percent, lastAddRadius, - startAngle, endAngle, defaultColor, - false - ); - if (label) { - ecData.pack( - label, - series[seriesIndex], seriesIndex, - series[seriesIndex].data[dataIndex], dataIndex, - series[seriesIndex].data[dataIndex].name, - percent - ); - label._dataIndex = dataIndex; - this.shapeList.push(label); - } - - // 文本标签视觉引导线,需要显示则会有返回 - var labelLine = this.getLabelLine( - seriesIndex, dataIndex, lastAddRadius, - r0, r1, - startAngle, endAngle, defaultColor, - false - ); - if (labelLine) { - ecData.pack( - labelLine, - series[seriesIndex], seriesIndex, - series[seriesIndex].data[dataIndex], dataIndex, - series[seriesIndex].data[dataIndex].name, - percent - ); - labelLine._dataIndex = dataIndex; - this.shapeList.push(labelLine); - } - }, - - /** - * 构建扇形 - */ - getSector : function ( - seriesIndex, dataIndex, percent, isSelected, - r0, r1, - startAngle, endAngle, defaultColor - ) { - var series = this.series; - var serie = series[seriesIndex]; - var data = serie.data[dataIndex]; - var queryTarget = [data, serie]; - var center = this.parseCenter(this.zr, serie.center); - - // 多级控制 - var normal = this.deepMerge( - queryTarget, - 'itemStyle.normal' - ) || {}; - var emphasis = this.deepMerge( - queryTarget, - 'itemStyle.emphasis' - ) || {}; - var normalColor = this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) - || defaultColor; - - var emphasisColor = this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data) - || (typeof normalColor == 'string' - ? zrColor.lift(normalColor, -0.2) - : normalColor - ); - - var sector = { - zlevel : this._zlevelBase, - clickable : true, - style : { - x : center[0], // 圆心横坐标 - y : center[1], // 圆心纵坐标 - r0 : r0, // 圆环内半径 - r : r1, // 圆环外半径 - startAngle : startAngle, - endAngle : endAngle, - brushType : 'both', - color : normalColor, - lineWidth : normal.borderWidth, - strokeColor : normal.borderColor, - lineJoin: 'round' - }, - highlightStyle : { - color : emphasisColor, - lineWidth : emphasis.borderWidth, - strokeColor : emphasis.borderColor, - lineJoin: 'round' - }, - _seriesIndex : seriesIndex, - _dataIndex : dataIndex - }; - - if (isSelected) { - var midAngle = - ((sector.style.startAngle + sector.style.endAngle) / 2) - .toFixed(2) - 0; - sector.style._hasSelected = true; - sector.style._x = sector.style.x; - sector.style._y = sector.style.y; - var offset = this.query(serie, 'selectedOffset'); - sector.style.x += zrMath.cos(midAngle, true) * offset; - sector.style.y -= zrMath.sin(midAngle, true) * offset; - - this._selected[seriesIndex][dataIndex] = true; - } - else { - this._selected[seriesIndex][dataIndex] = false; - } - - - if (this._selectedMode) { - sector.onclick = this.shapeHandler.onclick; - } - - if (this.deepQuery([data, serie, this.option], 'calculable')) { - this.setCalculable(sector); - sector.draggable = true; - } - - // “normal下不显示,emphasis显示”添加事件响应 - if (this._needLabel(serie, data, true) // emphasis下显示文本 - || this._needLabelLine(serie, data, true) // emphasis下显示引导线 - ) { - sector.onmouseover = this.shapeHandler.onmouseover; - } - - sector = new SectorShape(sector); - return sector; - }, - - /** - * 需要显示则会有返回构建好的shape,否则返回undefined - */ - getLabel : function ( - seriesIndex, dataIndex, percent, lastAddRadius, - startAngle, endAngle, defaultColor, - isEmphasis - ) { - var series = this.series; - var serie = series[seriesIndex]; - var data = serie.data[dataIndex]; - - // 特定状态下是否需要显示文本标签 - if (!this._needLabel(serie, data, isEmphasis)) { - return; - } - - var status = isEmphasis ? 'emphasis' : 'normal'; - - // serie里有默认配置,放心大胆的用! - var itemStyle = zrUtil.merge( - zrUtil.clone(data.itemStyle) || {}, - serie.itemStyle - ); - // label配置 - var labelControl = itemStyle[status].label; - var textStyle = labelControl.textStyle || {}; - - var center = this.parseCenter(this.zr, serie.center); - var centerX = center[0]; // 圆心横坐标 - var centerY = center[1]; // 圆心纵坐标 - var x; - var y; - var midAngle = ((endAngle + startAngle) / 2 + 360) % 360; // 中值 - var radius = this.parseRadius(this.zr, serie.radius); // 标签位置半径 - var textAlign; - var textBaseline = 'middle'; - labelControl.position = labelControl.position - || itemStyle.normal.label.position; - if (labelControl.position == 'center') { - // center显示 - radius = radius[1]; - x = centerX; - y = centerY; - textAlign = 'center'; - } - else if (labelControl.position == 'inner'){ - // 内部显示 - radius = (radius[0] + radius[1]) / 2 + lastAddRadius; - x = Math.round( - centerX + radius * zrMath.cos(midAngle, true) - ); - y = Math.round( - centerY - radius * zrMath.sin(midAngle, true) - ); - defaultColor = '#fff'; - textAlign = 'center'; - - } - else { - // 外部显示,默认 labelControl.position == 'outer') - radius = radius[1] - - (-itemStyle[status].labelLine.length) - //- (-textStyle.fontSize) - + lastAddRadius; - x = centerX + radius * zrMath.cos(midAngle, true); - y = centerY - radius * zrMath.sin(midAngle, true); - textAlign = (midAngle >= 90 && midAngle <= 270) - ? 'right' : 'left'; - } - - if (labelControl.position != 'center' - && labelControl.position != 'inner' - ) { - x += textAlign == 'left' ? 20 : -20; - } - data.__labelX = x - (textAlign == 'left' ? 5 : -5); - data.__labelY = y; - - return new TextShape({ - zlevel : this._zlevelBase + 1, - hoverable : false, - style : { - x : x, - y : y, - color : textStyle.color || defaultColor, - text : this.getLabelText( - seriesIndex, dataIndex, percent, status - ), - textAlign : textStyle.align || textAlign, - textBaseline : textStyle.baseline || textBaseline, - textFont : this.getFont(textStyle) - }, - highlightStyle : { - brushType : 'fill' - }, - _seriesIndex : seriesIndex, - _dataIndex : dataIndex - }); - }, - - /** - * 根据lable.format计算label text - */ - getLabelText : function (seriesIndex, dataIndex, percent, status) { - var series = this.series; - var serie = series[seriesIndex]; - var data = serie.data[dataIndex]; - var formatter = this.deepQuery( - [data, serie], - 'itemStyle.' + status + '.label.formatter' - ); - - if (formatter) { - if (typeof formatter == 'function') { - return formatter.call( - this.myChart, - serie.name, - data.name, - data.value, - percent - ); - } - else if (typeof formatter == 'string') { - formatter = formatter.replace('{a}','{a0}') - .replace('{b}','{b0}') - .replace('{c}','{c0}') - .replace('{d}','{d0}'); - formatter = formatter.replace('{a0}', serie.name) - .replace('{b0}', data.name) - .replace('{c0}', data.value) - .replace('{d0}', percent); - - return formatter; - } - } - else { - return data.name; - } - }, - - /** - * 需要显示则会有返回构建好的shape,否则返回undefined - */ - getLabelLine : function ( - seriesIndex, dataIndex, lastAddRadius, - r0, r1, - startAngle, endAngle, defaultColor, - isEmphasis - ) { - var series = this.series; - var serie = series[seriesIndex]; - var data = serie.data[dataIndex]; - - // 特定状态下是否需要显示文本标签 - if (this._needLabelLine(serie, data, isEmphasis)) { - var status = isEmphasis ? 'emphasis' : 'normal'; - - // serie里有默认配置,放心大胆的用! - var itemStyle = zrUtil.merge( - zrUtil.clone(data.itemStyle) || {}, - serie.itemStyle - ); - // labelLine配置 - var labelLineControl = itemStyle[status].labelLine; - var lineStyle = labelLineControl.lineStyle || {}; - - var center = this.parseCenter(this.zr, serie.center); - var centerX = center[0]; // 圆心横坐标 - var centerY = center[1]; // 圆心纵坐标 - // 视觉引导线起点半径 - var midRadius = r1; - // 视觉引导线终点半径 - var maxRadius = this.parseRadius(this.zr, serie.radius)[1] - - (-labelLineControl.length) - + lastAddRadius; - var midAngle = ((endAngle + startAngle) / 2) % 360; // 角度中值 - var cosValue = zrMath.cos(midAngle, true); - var sinValue = zrMath.sin(midAngle, true); - // 三角函数缓存已在zrender/tool/math中做了 - return new BrokenLineShape({ - // shape : 'brokenLine', - zlevel : this._zlevelBase + 1, - hoverable : false, - style : { - pointList : [ - [ - centerX + midRadius * cosValue, - centerY - midRadius * sinValue - ], - [ - centerX + maxRadius * cosValue, - centerY - maxRadius * sinValue - ], - [ - data.__labelX, - data.__labelY - ] - ], - //xStart : centerX + midRadius * cosValue, - //yStart : centerY - midRadius * sinValue, - //xEnd : centerX + maxRadius * cosValue, - //yEnd : centerY - maxRadius * sinValue, - strokeColor : lineStyle.color || defaultColor, - lineType : lineStyle.type, - lineWidth : lineStyle.width - }, - _seriesIndex : seriesIndex, - _dataIndex : dataIndex - }); - } - else { - return; - } - }, - - /** - * 返回特定状态(normal or emphasis)下是否需要显示label标签文本 - * @param {Object} serie - * @param {Object} data - * @param {boolean} isEmphasis true is 'emphasis' and false is 'normal' - */ - _needLabel : function (serie, data, isEmphasis) { - return this.deepQuery( - [data, serie], - 'itemStyle.' - + (isEmphasis ? 'emphasis' : 'normal') - + '.label.show' - ); - }, - - /** - * 返回特定状态(normal or emphasis)下是否需要显示labelLine标签视觉引导线 - * @param {Object} serie - * @param {Object} data - * @param {boolean} isEmphasis true is 'emphasis' and false is 'normal' - */ - _needLabelLine : function (serie, data, isEmphasis) { - return this.deepQuery( - [data, serie], - 'itemStyle.' - + (isEmphasis ? 'emphasis' : 'normal') - +'.labelLine.show' - ); - }, - - /** - * 参数修正&默认值赋值,重载基类方法 - * @param {Object} opt 参数 - */ - reformOption : function (opt) { - // 常用方法快捷方式 - var _merge = zrUtil.merge; - opt = _merge( - opt || {}, - this.ecTheme.pie - ); - - // 通用字体设置 - opt.itemStyle.normal.label.textStyle = _merge( - opt.itemStyle.normal.label.textStyle || {}, - this.ecTheme.textStyle - ); - opt.itemStyle.emphasis.label.textStyle = _merge( - opt.itemStyle.emphasis.label.textStyle || {}, - this.ecTheme.textStyle - ); - - return opt; - }, - - /** - * 刷新 - */ - refresh : function (newOption) { - if (newOption) { - this.option = newOption; - this.series = newOption.series; - } - - this.backupShapeList(); - this._buildShape(); - }, - - /** - * 动态数据增加动画 - */ - addDataAnimation : function (params) { - var series = this.series; - var aniMap = {}; // seriesIndex索引参数 - for (var i = 0, l = params.length; i < l; i++) { - aniMap[params[i][0]] = params[i]; - } - - // 构建新的饼图匹配差异做动画 - var sectorMap = {}; - var textMap = {}; - var lineMap = {}; - var backupShapeList = this.shapeList; - this.shapeList = []; - - var seriesIndex; - var isHead; - var dataGrow; - var deltaIdxMap = {}; // 修正新增数据后会对dataIndex产生错位匹配 - for (var i = 0, l = params.length; i < l; i++) { - seriesIndex = params[i][0]; - isHead = params[i][2]; - dataGrow = params[i][3]; - if (series[seriesIndex] - && series[seriesIndex].type == ecConfig.CHART_TYPE_PIE - ) { - if (isHead) { - if (!dataGrow) { - sectorMap[ - seriesIndex - + '_' - + series[seriesIndex].data.length - ] = 'delete'; - } - deltaIdxMap[seriesIndex] = 1; - } - else { - if (!dataGrow) { - sectorMap[seriesIndex + '_-1'] = 'delete'; - deltaIdxMap[seriesIndex] = -1; - } - else { - deltaIdxMap[seriesIndex] = 0; - } - } - this._buildSinglePie(seriesIndex); - } - } - var dataIndex; - var key; - for (var i = 0, l = this.shapeList.length; i < l; i++) { - seriesIndex = this.shapeList[i]._seriesIndex; - dataIndex = this.shapeList[i]._dataIndex; - key = seriesIndex + '_' + dataIndex; - // map映射让n*n变n - switch (this.shapeList[i].type) { - case 'sector' : - sectorMap[key] = this.shapeList[i]; - break; - case 'text' : - textMap[key] = this.shapeList[i]; - break; - case 'broken-line' : - lineMap[key] = this.shapeList[i]; - break; - } - } - this.shapeList = []; - var targeSector; - for (var i = 0, l = backupShapeList.length; i < l; i++) { - seriesIndex = backupShapeList[i]._seriesIndex; - if (aniMap[seriesIndex]) { - dataIndex = backupShapeList[i]._dataIndex - + deltaIdxMap[seriesIndex]; - key = seriesIndex + '_' + dataIndex; - targeSector = sectorMap[key]; - if (!targeSector) { - continue; - } - if (backupShapeList[i].type == 'sector') { - if (targeSector != 'delete') { - // 原有扇形 - this.zr.animate(backupShapeList[i].id, 'style') - .when( - 400, - { - startAngle : - targeSector.style.startAngle, - endAngle : - targeSector.style.endAngle - } - ) - .start(); - } - else { - // 删除的扇形 - this.zr.animate(backupShapeList[i].id, 'style') - .when( - 400, - deltaIdxMap[seriesIndex] < 0 - ? { - startAngle : - backupShapeList[i].style.startAngle - } - : { - endAngle : - backupShapeList[i].style.endAngle - } - ) - .start(); - } - } - else if (backupShapeList[i].type == 'text' - || backupShapeList[i].type == 'broken-line' - ) { - if (targeSector == 'delete') { - // 删除逻辑一样 - this.zr.delShape(backupShapeList[i].id); - } - else { - // 懒得新建变量了,借用一下 - switch (backupShapeList[i].type) { - case 'text': - targeSector = textMap[key]; - this.zr.animate(backupShapeList[i].id, 'style') - .when( - 400, - { - x :targeSector.style.x, - y :targeSector.style.y - } - ) - .start(); - break; - case 'broken-line': - targeSector = lineMap[key]; - this.zr.animate(backupShapeList[i].id, 'style') - .when( - 400, - { - pointList:targeSector.style.pointList - } - ) - .start(); - break; - } - - } - } - } - } - this.shapeList = backupShapeList; - }, - - onclick : function (param) { - var series = this.series; - if (!this.isClick || !param.target) { - // 没有在当前实例上发生点击直接返回 - return; - } - this.isClick = false; - var offset; // 偏移 - var target = param.target; - var style = target.style; - var seriesIndex = ecData.get(target, 'seriesIndex'); - var dataIndex = ecData.get(target, 'dataIndex'); - - for (var i = 0, len = this.shapeList.length; i < len; i++) { - if (this.shapeList[i].id == target.id) { - seriesIndex = ecData.get(target, 'seriesIndex'); - dataIndex = ecData.get(target, 'dataIndex'); - // 当前点击的 - if (!style._hasSelected) { - var midAngle = - ((style.startAngle + style.endAngle) / 2) - .toFixed(2) - 0; - target.style._hasSelected = true; - this._selected[seriesIndex][dataIndex] = true; - target.style._x = target.style.x; - target.style._y = target.style.y; - offset = this.query( - series[seriesIndex], - 'selectedOffset' - ); - target.style.x += zrMath.cos(midAngle, true) - * offset; - target.style.y -= zrMath.sin(midAngle, true) - * offset; - } - else { - // 复位 - target.style.x = target.style._x; - target.style.y = target.style._y; - target.style._hasSelected = false; - this._selected[seriesIndex][dataIndex] = false; - } - - this.zr.modShape(target.id, target); - } - else if (this.shapeList[i].style._hasSelected - && this._selectedMode == 'single' - ) { - seriesIndex = ecData.get(this.shapeList[i], 'seriesIndex'); - dataIndex = ecData.get(this.shapeList[i], 'dataIndex'); - // 单选模式下需要取消其他已经选中的 - this.shapeList[i].style.x = this.shapeList[i].style._x; - this.shapeList[i].style.y = this.shapeList[i].style._y; - this.shapeList[i].style._hasSelected = false; - this._selected[seriesIndex][dataIndex] = false; - this.zr.modShape( - this.shapeList[i].id, this.shapeList[i] - ); - } - } - - this.messageCenter.dispatch( - ecConfig.EVENT.PIE_SELECTED, - param.event, - { - selected : this._selected, - target : ecData.get(target, 'name') - }, - this.myChart - ); - this.zr.refresh(); - } - }; - - zrUtil.inherits(Pie, ChartBase); - zrUtil.inherits(Pie, ComponentBase); - - // 图表注册 - require('../chart').define('pie', Pie); - - return Pie; +/** + * echarts图表类:饼图 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/chart/pie',['require','../component/base','./base','zrender/shape/Text','zrender/shape/Ring','zrender/shape/Circle','zrender/shape/Sector','zrender/shape/BrokenLine','../config','../util/ecData','zrender/tool/util','zrender/tool/math','zrender/tool/color','../chart'],function (require) { + var ComponentBase = require('../component/base'); + var ChartBase = require('./base'); + + // 图形依赖 + var TextShape = require('zrender/shape/Text'); + var RingShape = require('zrender/shape/Ring'); + var CircleShape = require('zrender/shape/Circle'); + var SectorShape = require('zrender/shape/Sector'); + var BrokenLineShape = require('zrender/shape/BrokenLine'); + + var ecConfig = require('../config'); + var ecData = require('../util/ecData'); + var zrUtil = require('zrender/tool/util'); + var zrMath = require('zrender/tool/math'); + var zrColor = require('zrender/tool/color'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} series 数据 + * @param {Object} component 组件 + */ + function Pie(ecTheme, messageCenter, zr, option, myChart){ + // 基类 + ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); + // 图表基类 + ChartBase.call(this); + + var self = this; + /** + * 输出动态视觉引导线 + */ + self.shapeHandler.onmouseover = function (param) { + var shape = param.target; + var seriesIndex = ecData.get(shape, 'seriesIndex'); + var dataIndex = ecData.get(shape, 'dataIndex'); + var percent = ecData.get(shape, 'special'); + var lastAddRadius = shape._lastAddRadius; + + var startAngle = shape.style.startAngle; + var endAngle = shape.style.endAngle; + var defaultColor = shape.highlightStyle.color; + + // 文本标签,需要显示则会有返回 + var label = self.getLabel( + seriesIndex, dataIndex, percent, lastAddRadius, + startAngle, endAngle, defaultColor, + true + ); + if (label) { + self.zr.addHoverShape(label); + } + + // 文本标签视觉引导线,需要显示则会有返回 + var labelLine = self.getLabelLine( + seriesIndex, dataIndex, lastAddRadius, + shape.style.r0, shape.style.r, + startAngle, endAngle, defaultColor, + true + ); + if (labelLine) { + self.zr.addHoverShape(labelLine); + } + }; + + this.refresh(option); + } + + Pie.prototype = { + type: ecConfig.CHART_TYPE_PIE, + /** + * 绘制图形 + */ + _buildShape: function () { + var series = this.series; + var legend = this.component.legend; + this.selectedMap = {}; + this._selected = {}; + var center; + var radius; + + var pieCase; // 饼图箱子 + this._selectedMode = false; + var serieName; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type === ecConfig.CHART_TYPE_PIE) { + series[i] = this.reformOption(series[i]); + serieName = series[i].name || ''; + // 系列图例开关 + this.selectedMap[serieName] = + legend ? legend.isSelected(serieName) : true; + if (!this.selectedMap[serieName]) { + continue; + } + + center = this.parseCenter(this.zr, series[i].center); + radius = this.parseRadius(this.zr, series[i].radius); + this._selectedMode = this._selectedMode || series[i].selectedMode; + this._selected[i] = []; + if (this.deepQuery([series[i], this.option], 'calculable')) { + pieCase = { + zlevel: this._zlevelBase, + hoverable: false, + style: { + x: center[0], // 圆心横坐标 + y: center[1], // 圆心纵坐标 + // 圆环内外半径 + r0: radius[0] <= 10 ? 0 : radius[0] - 10, + r: radius[1] + 10, + brushType: 'stroke', + lineWidth: 1, + strokeColor: series[i].calculableHolderColor + || this.ecTheme.calculableHolderColor + } + }; + ecData.pack(pieCase, series[i], i, undefined, -1); + this.setCalculable(pieCase); + + pieCase = radius[0] <= 10 + ? new CircleShape(pieCase) + : new RingShape(pieCase); + this.shapeList.push(pieCase); + } + this._buildSinglePie(i); + this.buildMark(i); + } + } + + this.addShapeList(); + }, + + /** + * 构建单个饼图 + * + * @param {number} seriesIndex 系列索引 + */ + _buildSinglePie: function (seriesIndex) { + var series = this.series; + var serie = series[seriesIndex]; + var data = serie.data; + var legend = this.component.legend; + var itemName; + var totalSelected = 0; // 迭代累计选中且非0个数 + var totalSelectedValue0 = 0; // 迭代累计选中0只个数 + var totalValue = 0; // 迭代累计 + var maxValue = Number.NEGATIVE_INFINITY; + + // 计算需要显示的个数和总值 + for (var i = 0, l = data.length; i < l; i++) { + itemName = data[i].name; + if (legend){ + this.selectedMap[itemName] = legend.isSelected(itemName); + } else { + this.selectedMap[itemName] = true; + } + if (this.selectedMap[itemName] && !isNaN(data[i].value)) { + if (+data[i].value !== 0) { + totalSelected++; + } + else { + totalSelectedValue0++; + } + totalValue += +data[i].value; + maxValue = Math.max(maxValue, +data[i].value); + } + } + + if (totalValue === 0) { + return; + } + + var percent = 100; + var lastPercent; // 相邻细角度优化 + var lastAddRadius = 0; + var clockWise = serie.clockWise; + var startAngle = serie.startAngle.toFixed(2) - 0; + var endAngle; + var minAngle = serie.minAngle || 0.01; // #bugfixed + var totalAngle = 360 - (minAngle * totalSelected) + - 0.01 * totalSelectedValue0; + var defaultColor; + var roseType = serie.roseType; + var radius; + var r0; // 扇形内半径 + var r1; // 扇形外半径 + + for (var i = 0, l = data.length; i < l; i++) { + itemName = data[i].name; + if (!this.selectedMap[itemName] || isNaN(data[i].value)) { + continue; + } + // 默认颜色策略 + if (legend) { + // 有图例则从图例中获取颜色定义 + defaultColor = legend.getColor(itemName); + } + else { + // 全局颜色定义 + defaultColor = this.zr.getColor(i); + } + + lastPercent = percent; + percent = data[i].value / totalValue; + if (roseType != 'area') { + endAngle = clockWise + ? (startAngle - percent * totalAngle - (percent !== 0 ? minAngle : 0.01)) + : (percent * totalAngle + startAngle + (percent !== 0 ? minAngle : 0.01)); + } + else { + endAngle = clockWise + ? (startAngle - 360 / l) + : (360 / l + startAngle); + } + endAngle = endAngle.toFixed(2) - 0; + percent = (percent * 100).toFixed(2); + + radius = this.parseRadius(this.zr, serie.radius); + r0 = +radius[0]; + r1 = +radius[1]; + + if (roseType === 'radius') { + r1 = data[i].value / maxValue * (r1 - r0) * 0.8 + + (r1 - r0) * 0.2 + + r0; + } + else if (roseType === 'area') { + r1 = Math.sqrt(data[i].value / maxValue) * (r1 - r0) + r0; + } + + if (clockWise) { + var temp; + temp = startAngle; + startAngle = endAngle; + endAngle = temp; + } + + // 当前小角度需要检查前一个是否也是小角度,如果是得调整长度,不能完全避免,但能大大降低覆盖概率 + if (i > 0 + && Math.abs(startAngle - endAngle) < 15 // 约15度 + && lastPercent < 4 + && this._needLabel(serie, data[i], false) + && this.deepQuery( + [data[i], serie], 'itemStyle.normal.label.position' + ) != 'center' + ) { + // 都小就延长,前小后大就缩短 + lastAddRadius += (percent < 4 ? 20 : -20); + } + else { + lastAddRadius = 0; + } + + this._buildItem( + seriesIndex, i, percent, lastAddRadius, // 相邻最小角度优化 + data[i].selected, + r0, r1, + startAngle, endAngle, defaultColor + ); + if (!clockWise) { + startAngle = endAngle; + } + } + }, + + /** + * 构建单个扇形及指标 + */ + _buildItem: function ( + seriesIndex, dataIndex, percent, lastAddRadius, + isSelected, + r0, r1, + startAngle, endAngle, defaultColor + ) { + var series = this.series; + // 扇形 + var sector = this.getSector( + seriesIndex, dataIndex, percent, isSelected, + r0, r1, + startAngle, endAngle, defaultColor + ); + // 图形需要附加的私有数据 + ecData.pack( + sector, + series[seriesIndex], seriesIndex, + series[seriesIndex].data[dataIndex], dataIndex, + series[seriesIndex].data[dataIndex].name, + percent + ); + sector._lastAddRadius = lastAddRadius; + this.shapeList.push(sector); + + // 文本标签,需要显示则会有返回 + var label = this.getLabel( + seriesIndex, dataIndex, percent, lastAddRadius, + startAngle, endAngle, defaultColor, + false + ); + if (label) { + ecData.pack( + label, + series[seriesIndex], seriesIndex, + series[seriesIndex].data[dataIndex], dataIndex, + series[seriesIndex].data[dataIndex].name, + percent + ); + label._dataIndex = dataIndex; + this.shapeList.push(label); + } + + // 文本标签视觉引导线,需要显示则会有返回 + var labelLine = this.getLabelLine( + seriesIndex, dataIndex, lastAddRadius, + r0, r1, + startAngle, endAngle, defaultColor, + false + ); + if (labelLine) { + ecData.pack( + labelLine, + series[seriesIndex], seriesIndex, + series[seriesIndex].data[dataIndex], dataIndex, + series[seriesIndex].data[dataIndex].name, + percent + ); + labelLine._dataIndex = dataIndex; + this.shapeList.push(labelLine); + } + }, + + /** + * 构建扇形 + */ + getSector: function ( + seriesIndex, dataIndex, percent, isSelected, + r0, r1, + startAngle, endAngle, defaultColor + ) { + var series = this.series; + var serie = series[seriesIndex]; + var data = serie.data[dataIndex]; + var queryTarget = [data, serie]; + var center = this.parseCenter(this.zr, serie.center); + + // 多级控制 + var normal = this.deepMerge( + queryTarget, + 'itemStyle.normal' + ) || {}; + var emphasis = this.deepMerge( + queryTarget, + 'itemStyle.emphasis' + ) || {}; + var normalColor = this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) + || defaultColor; + + var emphasisColor = this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data) + || (typeof normalColor === 'string' + ? zrColor.lift(normalColor, -0.2) + : normalColor + ); + + var sector = { + zlevel: this._zlevelBase, + clickable: this.deepQuery(queryTarget, 'clickable'), + style: { + x: center[0], // 圆心横坐标 + y: center[1], // 圆心纵坐标 + r0: r0, // 圆环内半径 + r: r1, // 圆环外半径 + startAngle: startAngle, + endAngle: endAngle, + brushType: 'both', + color: normalColor, + lineWidth: normal.borderWidth, + strokeColor: normal.borderColor, + lineJoin: 'round' + }, + highlightStyle: { + color: emphasisColor, + lineWidth: emphasis.borderWidth, + strokeColor: emphasis.borderColor, + lineJoin: 'round' + }, + _seriesIndex: seriesIndex, + _dataIndex: dataIndex + }; + + if (isSelected) { + var midAngle = + ((sector.style.startAngle + sector.style.endAngle) / 2) + .toFixed(2) - 0; + sector.style._hasSelected = true; + sector.style._x = sector.style.x; + sector.style._y = sector.style.y; + var offset = this.query(serie, 'selectedOffset'); + sector.style.x += zrMath.cos(midAngle, true) * offset; + sector.style.y -= zrMath.sin(midAngle, true) * offset; + + this._selected[seriesIndex][dataIndex] = true; + } + else { + this._selected[seriesIndex][dataIndex] = false; + } + + + if (this._selectedMode) { + sector.onclick = this.shapeHandler.onclick; + } + + if (this.deepQuery([data, serie, this.option], 'calculable')) { + this.setCalculable(sector); + sector.draggable = true; + } + + // “normal下不显示,emphasis显示”添加事件响应 + if (this._needLabel(serie, data, true) // emphasis下显示文本 + || this._needLabelLine(serie, data, true) // emphasis下显示引导线 + ) { + sector.onmouseover = this.shapeHandler.onmouseover; + } + + sector = new SectorShape(sector); + return sector; + }, + + /** + * 需要显示则会有返回构建好的shape,否则返回undefined + */ + getLabel: function ( + seriesIndex, dataIndex, percent, lastAddRadius, + startAngle, endAngle, defaultColor, + isEmphasis + ) { + var series = this.series; + var serie = series[seriesIndex]; + var data = serie.data[dataIndex]; + + // 特定状态下是否需要显示文本标签 + if (!this._needLabel(serie, data, isEmphasis)) { + return; + } + + var status = isEmphasis ? 'emphasis' : 'normal'; + + // serie里有默认配置,放心大胆的用! + var itemStyle = zrUtil.merge( + zrUtil.clone(data.itemStyle) || {}, + serie.itemStyle + ); + // label配置 + var labelControl = itemStyle[status].label; + var textStyle = labelControl.textStyle || {}; + + var center = this.parseCenter(this.zr, serie.center); + var centerX = center[0]; // 圆心横坐标 + var centerY = center[1]; // 圆心纵坐标 + var x; + var y; + var midAngle = ((endAngle + startAngle) / 2 + 360) % 360; // 中值 + var radius = this.parseRadius(this.zr, serie.radius); // 标签位置半径 + var textAlign; + var textBaseline = 'middle'; + labelControl.position = labelControl.position + || itemStyle.normal.label.position; + if (labelControl.position === 'center') { + // center显示 + radius = radius[1]; + x = centerX; + y = centerY; + textAlign = 'center'; + } + else if (labelControl.position === 'inner'){ + // 内部显示 + radius = (radius[0] + radius[1]) / 2 + lastAddRadius; + x = Math.round( + centerX + radius * zrMath.cos(midAngle, true) + ); + y = Math.round( + centerY - radius * zrMath.sin(midAngle, true) + ); + defaultColor = '#fff'; + textAlign = 'center'; + + } + else { + // 外部显示,默认 labelControl.position === 'outer') + radius = radius[1] + - (-itemStyle[status].labelLine.length) + //- (-textStyle.fontSize) + + lastAddRadius; + x = centerX + radius * zrMath.cos(midAngle, true); + y = centerY - radius * zrMath.sin(midAngle, true); + textAlign = (midAngle >= 90 && midAngle <= 270) ? 'right' : 'left'; + } + + if (labelControl.position != 'center' + && labelControl.position != 'inner' + ) { + x += textAlign === 'left' ? 20 : -20; + } + data.__labelX = x - (textAlign === 'left' ? 5 : -5); + data.__labelY = y; + + return new TextShape({ + zlevel: this._zlevelBase + 1, + hoverable: false, + style: { + x: x, + y: y, + color: textStyle.color || defaultColor, + text: this.getLabelText(seriesIndex, dataIndex, percent, status), + textAlign: textStyle.align || textAlign, + textBaseline: textStyle.baseline || textBaseline, + textFont: this.getFont(textStyle) + }, + highlightStyle: { + brushType: 'fill' + }, + _seriesIndex: seriesIndex, + _dataIndex: dataIndex + }); + }, + + /** + * 根据lable.format计算label text + */ + getLabelText: function (seriesIndex, dataIndex, percent, status) { + var series = this.series; + var serie = series[seriesIndex]; + var data = serie.data[dataIndex]; + var formatter = this.deepQuery( + [data, serie], + 'itemStyle.' + status + '.label.formatter' + ); + + if (formatter) { + if (typeof formatter === 'function') { + return formatter.call( + this.myChart, + serie.name, + data.name, + data.value, + percent + ); + } + else if (typeof formatter === 'string') { + formatter = formatter.replace('{a}','{a0}') + .replace('{b}','{b0}') + .replace('{c}','{c0}') + .replace('{d}','{d0}'); + formatter = formatter.replace('{a0}', serie.name) + .replace('{b0}', data.name) + .replace('{c0}', data.value) + .replace('{d0}', percent); + + return formatter; + } + } + else { + return data.name; + } + }, + + /** + * 需要显示则会有返回构建好的shape,否则返回undefined + */ + getLabelLine: function ( + seriesIndex, dataIndex, lastAddRadius, + r0, r1, + startAngle, endAngle, defaultColor, + isEmphasis + ) { + var series = this.series; + var serie = series[seriesIndex]; + var data = serie.data[dataIndex]; + + // 特定状态下是否需要显示文本标签 + if (this._needLabelLine(serie, data, isEmphasis)) { + var status = isEmphasis ? 'emphasis' : 'normal'; + + // serie里有默认配置,放心大胆的用! + var itemStyle = zrUtil.merge( + zrUtil.clone(data.itemStyle) || {}, + serie.itemStyle + ); + // labelLine配置 + var labelLineControl = itemStyle[status].labelLine; + var lineStyle = labelLineControl.lineStyle || {}; + + var center = this.parseCenter(this.zr, serie.center); + var centerX = center[0]; // 圆心横坐标 + var centerY = center[1]; // 圆心纵坐标 + // 视觉引导线起点半径 + var midRadius = r1; + // 视觉引导线终点半径 + var maxRadius = this.parseRadius(this.zr, serie.radius)[1] + - (-labelLineControl.length) + + lastAddRadius; + var midAngle = ((endAngle + startAngle) / 2) % 360; // 角度中值 + var cosValue = zrMath.cos(midAngle, true); + var sinValue = zrMath.sin(midAngle, true); + // 三角函数缓存已在zrender/tool/math中做了 + return new BrokenLineShape({ + // shape: 'brokenLine', + zlevel: this._zlevelBase + 1, + hoverable: false, + style: { + pointList: [ + [ + centerX + midRadius * cosValue, + centerY - midRadius * sinValue + ], + [ + centerX + maxRadius * cosValue, + centerY - maxRadius * sinValue + ], + [ + data.__labelX, + data.__labelY + ] + ], + //xStart: centerX + midRadius * cosValue, + //yStart: centerY - midRadius * sinValue, + //xEnd: centerX + maxRadius * cosValue, + //yEnd: centerY - maxRadius * sinValue, + strokeColor: lineStyle.color || defaultColor, + lineType: lineStyle.type, + lineWidth: lineStyle.width + }, + _seriesIndex: seriesIndex, + _dataIndex: dataIndex + }); + } + else { + return; + } + }, + + /** + * 返回特定状态(normal or emphasis)下是否需要显示label标签文本 + * @param {Object} serie + * @param {Object} data + * @param {boolean} isEmphasis true is 'emphasis' and false is 'normal' + */ + _needLabel: function (serie, data, isEmphasis) { + return this.deepQuery( + [data, serie], + 'itemStyle.' + + (isEmphasis ? 'emphasis' : 'normal') + + '.label.show' + ); + }, + + /** + * 返回特定状态(normal or emphasis)下是否需要显示labelLine标签视觉引导线 + * @param {Object} serie + * @param {Object} data + * @param {boolean} isEmphasis true is 'emphasis' and false is 'normal' + */ + _needLabelLine: function (serie, data, isEmphasis) { + return this.deepQuery( + [data, serie], + 'itemStyle.' + + (isEmphasis ? 'emphasis' : 'normal') + +'.labelLine.show' + ); + }, + + /** + * 参数修正&默认值赋值,重载基类方法 + * @param {Object} opt 参数 + */ + reformOption: function (opt) { + // 常用方法快捷方式 + var _merge = zrUtil.merge; + opt = _merge( + opt || {}, + this.ecTheme.pie + ); + + // 通用字体设置 + opt.itemStyle.normal.label.textStyle = _merge( + opt.itemStyle.normal.label.textStyle || {}, + this.ecTheme.textStyle + ); + opt.itemStyle.emphasis.label.textStyle = _merge( + opt.itemStyle.emphasis.label.textStyle || {}, + this.ecTheme.textStyle + ); + + return opt; + }, + + /** + * 刷新 + */ + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + + this.backupShapeList(); + this._buildShape(); + }, + + /** + * 动态数据增加动画 + */ + addDataAnimation: function (params) { + var series = this.series; + var aniMap = {}; // seriesIndex索引参数 + for (var i = 0, l = params.length; i < l; i++) { + aniMap[params[i][0]] = params[i]; + } + + // 构建新的饼图匹配差异做动画 + var sectorMap = {}; + var textMap = {}; + var lineMap = {}; + var backupShapeList = this.shapeList; + this.shapeList = []; + + var seriesIndex; + var isHead; + var dataGrow; + var deltaIdxMap = {}; // 修正新增数据后会对dataIndex产生错位匹配 + for (var i = 0, l = params.length; i < l; i++) { + seriesIndex = params[i][0]; + isHead = params[i][2]; + dataGrow = params[i][3]; + if (series[seriesIndex] + && series[seriesIndex].type === ecConfig.CHART_TYPE_PIE + ) { + if (isHead) { + if (!dataGrow) { + sectorMap[ + seriesIndex + + '_' + + series[seriesIndex].data.length + ] = 'delete'; + } + deltaIdxMap[seriesIndex] = 1; + } + else { + if (!dataGrow) { + sectorMap[seriesIndex + '_-1'] = 'delete'; + deltaIdxMap[seriesIndex] = -1; + } + else { + deltaIdxMap[seriesIndex] = 0; + } + } + this._buildSinglePie(seriesIndex); + } + } + var dataIndex; + var key; + for (var i = 0, l = this.shapeList.length; i < l; i++) { + seriesIndex = this.shapeList[i]._seriesIndex; + dataIndex = this.shapeList[i]._dataIndex; + key = seriesIndex + '_' + dataIndex; + // map映射让n*n变n + switch (this.shapeList[i].type) { + case 'sector' : + sectorMap[key] = this.shapeList[i]; + break; + case 'text' : + textMap[key] = this.shapeList[i]; + break; + case 'broken-line' : + lineMap[key] = this.shapeList[i]; + break; + } + } + this.shapeList = []; + var targeSector; + for (var i = 0, l = backupShapeList.length; i < l; i++) { + seriesIndex = backupShapeList[i]._seriesIndex; + if (aniMap[seriesIndex]) { + dataIndex = backupShapeList[i]._dataIndex + + deltaIdxMap[seriesIndex]; + key = seriesIndex + '_' + dataIndex; + targeSector = sectorMap[key]; + if (!targeSector) { + continue; + } + if (backupShapeList[i].type === 'sector') { + if (targeSector != 'delete') { + // 原有扇形 + this.zr.animate(backupShapeList[i].id, 'style') + .when( + 400, + { + startAngle: targeSector.style.startAngle, + endAngle: targeSector.style.endAngle + } + ) + .start(); + } + else { + // 删除的扇形 + this.zr.animate(backupShapeList[i].id, 'style') + .when( + 400, + deltaIdxMap[seriesIndex] < 0 + ? { startAngle: backupShapeList[i].style.startAngle } + : { endAngle: backupShapeList[i].style.endAngle } + ) + .start(); + } + } + else if (backupShapeList[i].type === 'text' + || backupShapeList[i].type === 'broken-line' + ) { + if (targeSector === 'delete') { + // 删除逻辑一样 + this.zr.delShape(backupShapeList[i].id); + } + else { + // 懒得新建变量了,借用一下 + switch (backupShapeList[i].type) { + case 'text': + targeSector = textMap[key]; + this.zr.animate(backupShapeList[i].id, 'style') + .when( + 400, + { + x :targeSector.style.x, + y :targeSector.style.y + } + ) + .start(); + break; + case 'broken-line': + targeSector = lineMap[key]; + this.zr.animate(backupShapeList[i].id, 'style') + .when( + 400, + { + pointList:targeSector.style.pointList + } + ) + .start(); + break; + } + + } + } + } + } + this.shapeList = backupShapeList; + }, + + onclick: function (param) { + var series = this.series; + if (!this.isClick || !param.target) { + // 没有在当前实例上发生点击直接返回 + return; + } + this.isClick = false; + var offset; // 偏移 + var target = param.target; + var style = target.style; + var seriesIndex = ecData.get(target, 'seriesIndex'); + var dataIndex = ecData.get(target, 'dataIndex'); + + for (var i = 0, len = this.shapeList.length; i < len; i++) { + if (this.shapeList[i].id === target.id) { + seriesIndex = ecData.get(target, 'seriesIndex'); + dataIndex = ecData.get(target, 'dataIndex'); + // 当前点击的 + if (!style._hasSelected) { + var midAngle = + ((style.startAngle + style.endAngle) / 2) + .toFixed(2) - 0; + target.style._hasSelected = true; + this._selected[seriesIndex][dataIndex] = true; + target.style._x = target.style.x; + target.style._y = target.style.y; + offset = this.query( + series[seriesIndex], + 'selectedOffset' + ); + target.style.x += zrMath.cos(midAngle, true) + * offset; + target.style.y -= zrMath.sin(midAngle, true) + * offset; + } + else { + // 复位 + target.style.x = target.style._x; + target.style.y = target.style._y; + target.style._hasSelected = false; + this._selected[seriesIndex][dataIndex] = false; + } + + this.zr.modShape(target.id, target); + } + else if (this.shapeList[i].style._hasSelected + && this._selectedMode === 'single' + ) { + seriesIndex = ecData.get(this.shapeList[i], 'seriesIndex'); + dataIndex = ecData.get(this.shapeList[i], 'dataIndex'); + // 单选模式下需要取消其他已经选中的 + this.shapeList[i].style.x = this.shapeList[i].style._x; + this.shapeList[i].style.y = this.shapeList[i].style._y; + this.shapeList[i].style._hasSelected = false; + this._selected[seriesIndex][dataIndex] = false; + this.zr.modShape( + this.shapeList[i].id, this.shapeList[i] + ); + } + } + + this.messageCenter.dispatch( + ecConfig.EVENT.PIE_SELECTED, + param.event, + { + selected: this._selected, + target: ecData.get(target, 'name') + }, + this.myChart + ); + this.zr.refresh(); + } + }; + + zrUtil.inherits(Pie, ChartBase); + zrUtil.inherits(Pie, ComponentBase); + + // 图表注册 + require('../chart').define('pie', Pie); + + return Pie; }); define('_chart',['require','echarts/chart/gauge','echarts/chart/funnel','echarts/chart/scatter','echarts/chart/k','echarts/chart/radar','echarts/chart/chord','echarts/chart/force','echarts/chart/map','echarts/util/mapData/geoJson/an_hui_geo','echarts/util/mapData/geoJson/ao_men_geo','echarts/util/mapData/geoJson/bei_jing_geo','echarts/util/mapData/geoJson/china_geo','echarts/util/mapData/geoJson/chong_qing_geo','echarts/util/mapData/geoJson/fu_jian_geo','echarts/util/mapData/geoJson/gan_su_geo','echarts/util/mapData/geoJson/guang_dong_geo','echarts/util/mapData/geoJson/guang_xi_geo','echarts/util/mapData/geoJson/gui_zhou_geo','echarts/util/mapData/geoJson/hai_nan_geo','echarts/util/mapData/geoJson/hei_long_jiang_geo','echarts/util/mapData/geoJson/he_bei_geo','echarts/util/mapData/geoJson/he_nan_geo','echarts/util/mapData/geoJson/hu_bei_geo','echarts/util/mapData/geoJson/hu_nan_geo','echarts/util/mapData/geoJson/jiang_su_geo','echarts/util/mapData/geoJson/jiang_xi_geo','echarts/util/mapData/geoJson/ji_lin_geo','echarts/util/mapData/geoJson/liao_ning_geo','echarts/util/mapData/geoJson/nei_meng_gu_geo','echarts/util/mapData/geoJson/ning_xia_geo','echarts/util/mapData/geoJson/qing_hai_geo','echarts/util/mapData/geoJson/shang_hai_geo','echarts/util/mapData/geoJson/shan_dong_geo','echarts/util/mapData/geoJson/shan_xi_1_geo','echarts/util/mapData/geoJson/shan_xi_2_geo','echarts/util/mapData/geoJson/si_chuan_geo','echarts/util/mapData/geoJson/tai_wan_geo','echarts/util/mapData/geoJson/tian_jin_geo','echarts/util/mapData/geoJson/world_geo','echarts/util/mapData/geoJson/xiang_gang_geo','echarts/util/mapData/geoJson/xin_jiang_geo','echarts/util/mapData/geoJson/xi_zang_geo','echarts/util/mapData/geoJson/yun_nan_geo','echarts/util/mapData/geoJson/zhe_jiang_geo','echarts/chart/line','echarts/chart/bar','echarts/chart/pie'],function (require) { require("echarts/chart/gauge"); diff --git a/build/echarts-original.js b/build/echarts-original.js index 79bc438..0a33e86 100644 --- a/build/echarts-original.js +++ b/build/echarts-original.js @@ -1,40811 +1,42860 @@ -/** - * echarts默认配置项 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/config',[],function() { - // 请原谅我这样写,这显然可以直接返回个对象,但那样的话outline就显示不出来了~~ - var config = { - // 图表类型 - CHART_TYPE_LINE: 'line', - CHART_TYPE_BAR: 'bar', - CHART_TYPE_SCATTER: 'scatter', - CHART_TYPE_PIE: 'pie', - CHART_TYPE_RADAR: 'radar', - CHART_TYPE_MAP: 'map', - CHART_TYPE_K: 'k', - CHART_TYPE_ISLAND: 'island', - CHART_TYPE_FORCE : 'force', - CHART_TYPE_CHORD : 'chord', - CHART_TYPE_GAUGE : 'gauge', - CHART_TYPE_FUNNEL : 'funnel', - - // 组件类型 - COMPONENT_TYPE_TITLE: 'title', - COMPONENT_TYPE_LEGEND: 'legend', - COMPONENT_TYPE_DATARANGE: 'dataRange', - COMPONENT_TYPE_DATAVIEW: 'dataView', - COMPONENT_TYPE_DATAZOOM: 'dataZoom', - COMPONENT_TYPE_TOOLBOX: 'toolbox', - COMPONENT_TYPE_TOOLTIP: 'tooltip', - COMPONENT_TYPE_GRID: 'grid', - COMPONENT_TYPE_AXIS: 'axis', - COMPONENT_TYPE_POLAR: 'polar', - COMPONENT_TYPE_X_AXIS: 'xAxis', - COMPONENT_TYPE_Y_AXIS: 'yAxis', - COMPONENT_TYPE_AXIS_CATEGORY: 'categoryAxis', - COMPONENT_TYPE_AXIS_VALUE: 'valueAxis', - COMPONENT_TYPE_TIMELINE: 'timeline', - - // 全图默认背景 - backgroundColor: 'rgba(0,0,0,0)', - - // 默认色板 - color: ['#ff7f50','#87cefa','#da70d6','#32cd32','#6495ed', - '#ff69b4','#ba55d3','#cd5c5c','#ffa500','#40e0d0', - '#1e90ff','#ff6347','#7b68ee','#00fa9a','#ffd700', - '#6699FF','#ff6666','#3cb371','#b8860b','#30e0e0'], - - // 图表标题 - title: { - text: '', - //link: null, // 超链接跳转 - //target: null, // 仅支持self | blank - subtext: '', - //sublink: null, // 超链接跳转 - //subtarget: null, // 仅支持self | blank - x: 'left', // 水平安放位置,默认为左对齐,可选为: - // 'center' ¦ 'left' ¦ 'right' - // ¦ {number}(x坐标,单位px) - y: 'top', // 垂直安放位置,默认为全图顶端,可选为: - // 'top' ¦ 'bottom' ¦ 'center' - // ¦ {number}(y坐标,单位px) - //textAlign: null // 水平对齐方式,默认根据x设置自动调整 - backgroundColor: 'rgba(0,0,0,0)', - borderColor: '#ccc', // 标题边框颜色 - borderWidth: 0, // 标题边框线宽,单位px,默认为0(无边框) - padding: 5, // 标题内边距,单位px,默认各方向内边距为5, - // 接受数组分别设定上右下左边距,同css - itemGap: 5, // 主副标题纵向间隔,单位px,默认为10, - textStyle: { - fontSize: 18, - fontWeight: 'bolder', - color: '#333' // 主标题文字颜色 - }, - subtextStyle: { - color: '#aaa' // 副标题文字颜色 - } - }, - - // 图例 - legend: { - orient: 'horizontal', // 布局方式,默认为水平布局,可选为: - // 'horizontal' ¦ 'vertical' - x: 'center', // 水平安放位置,默认为全图居中,可选为: - // 'center' ¦ 'left' ¦ 'right' - // ¦ {number}(x坐标,单位px) - y: 'top', // 垂直安放位置,默认为全图顶端,可选为: - // 'top' ¦ 'bottom' ¦ 'center' - // ¦ {number}(y坐标,单位px) - backgroundColor: 'rgba(0,0,0,0)', - borderColor: '#ccc', // 图例边框颜色 - borderWidth: 0, // 图例边框线宽,单位px,默认为0(无边框) - padding: 5, // 图例内边距,单位px,默认各方向内边距为5, - // 接受数组分别设定上右下左边距,同css - itemGap: 10, // 各个item之间的间隔,单位px,默认为10, - // 横向布局时为水平间隔,纵向布局时为纵向间隔 - itemWidth: 20, // 图例图形宽度 - itemHeight: 14, // 图例图形高度 - textStyle: { - color: '#333' // 图例文字颜色 - }, - selectedMode: true // 选择模式,默认开启图例开关 - // selected: null, // 配置默认选中状态,可配合LEGEND.SELECTED事件做动态数据载入 - // data: [], // 图例内容(详见legend.data,数组中每一项代表一个item - }, - - // 值域 - dataRange: { - orient: 'vertical', // 布局方式,默认为垂直布局,可选为: - // 'horizontal' ¦ 'vertical' - x: 'left', // 水平安放位置,默认为全图左对齐,可选为: - // 'center' ¦ 'left' ¦ 'right' - // ¦ {number}(x坐标,单位px) - y: 'bottom', // 垂直安放位置,默认为全图底部,可选为: - // 'top' ¦ 'bottom' ¦ 'center' - // ¦ {number}(y坐标,单位px) - backgroundColor: 'rgba(0,0,0,0)', - borderColor: '#ccc', // 值域边框颜色 - borderWidth: 0, // 值域边框线宽,单位px,默认为0(无边框) - padding: 5, // 值域内边距,单位px,默认各方向内边距为5, - // 接受数组分别设定上右下左边距,同css - itemGap: 10, // 各个item之间的间隔,单位px,默认为10, - // 横向布局时为水平间隔,纵向布局时为纵向间隔 - itemWidth: 20, // 值域图形宽度,线性渐变水平布局宽度为该值 * 10 - itemHeight: 14, // 值域图形高度,线性渐变垂直布局高度为该值 * 10 - // min: null, // 最小值 - // max: null, // 最大值 - precision: 0, // 小数精度,默认为0,无小数点 - splitNumber: 5, // 分割段数,默认为5,为0时为线性渐变 - calculable: false, // 是否值域漫游,启用后无视splitNumber,线性渐变 - realtime: true, - color:['#006edd','#e0ffff'],//颜色 - //formatter: null, - //text:['高','低'], // 文本,默认为数值文本 - textStyle: { - color: '#333' // 值域文字颜色 - } - }, - - toolbox: { - show : false, - orient: 'horizontal', // 布局方式,默认为水平布局,可选为: - // 'horizontal' ¦ 'vertical' - x: 'right', // 水平安放位置,默认为全图右对齐,可选为: - // 'center' ¦ 'left' ¦ 'right' - // ¦ {number}(x坐标,单位px) - y: 'top', // 垂直安放位置,默认为全图顶端,可选为: - // 'top' ¦ 'bottom' ¦ 'center' - // ¦ {number}(y坐标,单位px) - color : ['#1e90ff','#22bb22','#4b0082','#d2691e'], - disableColor : '#ddd', - effectiveColor : 'red', - backgroundColor: 'rgba(0,0,0,0)', // 工具箱背景颜色 - borderColor: '#ccc', // 工具箱边框颜色 - borderWidth: 0, // 工具箱边框线宽,单位px,默认为0(无边框) - padding: 5, // 工具箱内边距,单位px,默认各方向内边距为5, - // 接受数组分别设定上右下左边距,同css - itemGap: 10, // 各个item之间的间隔,单位px,默认为10, - // 横向布局时为水平间隔,纵向布局时为纵向间隔 - itemSize: 16, // 工具箱图形宽度 - showTitle : true, - //textStyle : {}, - feature : { - mark : { - show : false, - title : { - mark : '辅助线开关', - markUndo : '删除辅助线', - markClear : '清空辅助线' - }, - lineStyle : { - width : 1, - color : '#1e90ff', - type : 'dashed' - } - }, - dataZoom : { - show : false, - title : { - dataZoom : '区域缩放', - dataZoomReset : '区域缩放后退' - } - }, - dataView : { - show : false, - title : '数据视图', - readOnly: false, - lang : ['Data View', 'close', 'refresh'] - }, - magicType: { - show : false, - title : { - line : '折线图切换', - bar : '柱形图切换', - stack : '堆积', - tiled : '平铺' - }, - type : [] // 'line', 'bar', 'stack', 'tiled' - }, - restore : { - show : false, - title : '还原' - }, - saveAsImage : { - show : false, - title : '保存为图片', - type : 'png', - lang : ['点击保存'] - } - } - }, - - // 提示框 - tooltip: { - show: true, - showContent: true, // tooltip主体内容 - trigger: 'item', // 触发类型,默认数据触发,见下图,可选为:'item' ¦ 'axis' - // position : null // 位置 {Array} | {Function} - // formatter: null // 内容格式器:{string}(Template) ¦ {Function} - islandFormatter: '{a}
{b} : {c}', // 数据孤岛内容格式器 - showDelay: 20, // 显示延迟,添加显示延迟可以避免频繁切换,单位ms - hideDelay: 100, // 隐藏延迟,单位ms - transitionDuration : 0.4, // 动画变换时间,单位s - backgroundColor: 'rgba(0,0,0,0.7)', // 提示背景颜色,默认为透明度为0.7的黑色 - borderColor: '#333', // 提示边框颜色 - borderRadius: 4, // 提示边框圆角,单位px,默认为4 - borderWidth: 0, // 提示边框线宽,单位px,默认为0(无边框) - padding: 5, // 提示内边距,单位px,默认各方向内边距为5, - // 接受数组分别设定上右下左边距,同css - axisPointer : { // 坐标轴指示器,坐标轴触发有效 - type : 'line', // 默认为直线,可选为:'line' | 'shadow' | 'cross' - lineStyle : { // 直线指示器样式设置 - color: '#48b', - width: 2, - type: 'solid' - }, - crossStyle: { - color: '#1e90ff', - width: 1, - type: 'dashed' - }, - shadowStyle : { // 阴影指示器样式设置 - color: 'rgba(150,150,150,0.3)', // 阴影颜色 - width: 'auto', // 阴影大小 - type: 'default' - } - }, - textStyle: { - color: '#fff' - } - }, - - // 区域缩放控制器 - dataZoom: { - show: false, - orient: 'horizontal', // 布局方式,默认为水平布局,可选为: - // 'horizontal' ¦ 'vertical' - // x: {number}, // 水平安放位置,默认为根据grid参数适配,可选为: - // {number}(x坐标,单位px) - // y: {number}, // 垂直安放位置,默认为根据grid参数适配,可选为: - // {number}(y坐标,单位px) - // width: {number}, // 指定宽度,横向布局时默认为根据grid参数适配 - // height: {number}, // 指定高度,纵向布局时默认为根据grid参数适配 - backgroundColor: 'rgba(0,0,0,0)', // 背景颜色 - dataBackgroundColor: '#eee', // 数据背景颜色 - fillerColor: 'rgba(144,197,237,0.2)', // 填充颜色 - handleColor: 'rgba(70,130,180,0.8)', // 手柄颜色 - // xAxisIndex: [], // 默认控制所有横向类目 - // yAxisIndex: [], // 默认控制所有横向类目 - // start: 0, // 默认为0 - // end: 100, // 默认为全部 100% - realtime: true - // zoomLock: false // 是否锁定选择区域大小 - }, - - // 网格 - grid: { - x: 80, - y: 60, - x2: 80, - y2: 60, - // width: {totalWidth} - x - x2, - // height: {totalHeight} - y - y2, - backgroundColor: 'rgba(0,0,0,0)', - borderWidth: 1, - borderColor: '#ccc' - }, - - // 类目轴 - categoryAxis: { - position: 'bottom', // 位置 - name: '', // 坐标轴名字,默认为空 - nameLocation: 'end', // 坐标轴名字位置,支持'start' | 'end' - nameTextStyle: {}, // 坐标轴文字样式,默认取全局样式 - boundaryGap: true, // 类目起始和结束两端空白策略 - axisLine: { // 坐标轴线 - show: true, // 默认显示,属性show控制显示与否 - onZero: true, - lineStyle: { // 属性lineStyle控制线条样式 - color: '#48b', - width: 2, - type: 'solid' - } - }, - axisTick: { // 坐标轴小标记 - show: true, // 属性show控制显示与否,默认不显示 - interval: 'auto', - inside : false, // 控制小标记是否在grid里 - // onGap: null, - length :5, // 属性length控制线长 - lineStyle: { // 属性lineStyle控制线条样式 - color: '#333', - width: 1 - } - }, - axisLabel: { // 坐标轴文本标签,详见axis.axisLabel - show: true, - interval: 'auto', - rotate: 0, - margin: 8, - // clickable: false, - // formatter: null, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#333' - } - }, - splitLine: { // 分隔线 - show: true, // 默认显示,属性show控制显示与否 - // onGap: null, - lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 - color: ['#ccc'], - width: 1, - type: 'solid' - } - }, - splitArea: { // 分隔区域 - show: false, // 默认不显示,属性show控制显示与否 - // onGap: null, - areaStyle: { // 属性areaStyle(详见areaStyle)控制区域样式 - color: ['rgba(250,250,250,0.3)','rgba(200,200,200,0.3)'] - } - } - }, - - // 数值型坐标轴默认参数 - valueAxis: { - position: 'left', // 位置 - name: '', // 坐标轴名字,默认为空 - nameLocation: 'end', // 坐标轴名字位置,支持'start' | 'end' - nameTextStyle: {}, // 坐标轴文字样式,默认取全局样式 - boundaryGap: [0, 0], // 数值起始和结束两端空白策略 - // min: null, // 最小值 - // max: null, // 最大值 - // scale: false, // 脱离0值比例,放大聚焦到最终_min,_max区间 - precision: 0, // 小数精度,默认为0,无小数点 - power: 100, // 整数精度,默认为100,个位和百位为0 - splitNumber: 5, // 分割段数,默认为5 - axisLine: { // 坐标轴线 - show: true, // 默认显示,属性show控制显示与否 - onZero: true, - lineStyle: { // 属性lineStyle控制线条样式 - color: '#48b', - width: 2, - type: 'solid' - } - }, - axisTick: { // 坐标轴小标记 - show: false, // 属性show控制显示与否,默认不显示 - inside : false, // 控制小标记是否在grid里 - length :5, // 属性length控制线长 - lineStyle: { // 属性lineStyle控制线条样式 - color: '#333', - width: 1 - } - }, - axisLabel: { // 坐标轴文本标签,详见axis.axisLabel - show: true, - rotate: 0, - margin: 8, - // clickable: false, - // formatter: null, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#333' - } - }, - splitLine: { // 分隔线 - show: true, // 默认显示,属性show控制显示与否 - lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 - color: ['#ccc'], - width: 1, - type: 'solid' - } - }, - splitArea: { // 分隔区域 - show: false, // 默认不显示,属性show控制显示与否 - areaStyle: { // 属性areaStyle(详见areaStyle)控制区域样式 - color: ['rgba(250,250,250,0.3)','rgba(200,200,200,0.3)'] - } - } - }, - - polar : { - center : ['50%', '50%'], // 默认全局居中 - radius : '75%', - startAngle : 90, - splitNumber : 5, - name : { - show: true, - // formatter: null, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#333' - } - }, - axisLine: { // 坐标轴线 - show: true, // 默认显示,属性show控制显示与否 - lineStyle: { // 属性lineStyle控制线条样式 - color: '#ccc', - width: 1, - type: 'solid' - } - }, - axisLabel: { // 坐标轴文本标签,详见axis.axisLabel - show: false, - // formatter: null, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#333' - } - }, - splitArea : { - show : true, - areaStyle : { - color: ['rgba(250,250,250,0.3)','rgba(200,200,200,0.3)'] - } - }, - splitLine : { - show : true, - lineStyle : { - width : 1, - color : '#ccc' - } - }, - type: 'polygon' - //indicator : [] - }, - - timeline : { - show: true, - type : 'time', // 模式是时间类型,支持 number - notMerge : false, - realtime : true, - x: 80, - // y: {number}, - x2: 80, - y2: 0, - // width: {totalWidth} - x - x2, - height: 50, - backgroundColor: 'rgba(0,0,0,0)', // 时间轴背景颜色 - borderColor : '#ccc', // 时间轴边框颜色 - borderWidth : 0, // 时间轴边框线宽,单位px,默认为0(无边框) - padding : 5, // 时间轴内边距,单位px,默认各方向内边距为5, - controlPosition : 'left', // 'right' | 'none' - autoPlay : false, - loop : true, - playInterval : 2000, // 播放时间间隔,单位ms - lineStyle : { - width : 1, - color : '#666', - type : 'dashed' - }, - label: { // 文本标签 - show: true, - interval: 'auto', - rotate: 0, - // formatter: null, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#333' - } - }, - checkpointStyle : { - symbol : 'auto', - symbolSize : 'auto', - color : 'auto', - borderColor : 'auto', - borderWidth : 'auto', - label: { // 文本标签 - show: false, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: 'auto' - } - } - }, - controlStyle : { - normal : { color : '#333'}, - emphasis : { color : '#1e90ff'} - }, - symbol : 'emptyDiamond', - symbolSize : 4, - currentIndex : 0 - // data : [] - }, - - // 柱形图默认参数 - bar: { - // stack: null - xAxisIndex: 0, - yAxisIndex: 0, - barMinHeight: 0, // 最小高度改为0 - // barWidth: null, // 默认自适应 - barGap: '30%', // 柱间距离,默认为柱形宽度的30%,可设固定值 - barCategoryGap : '20%', // 类目间柱形距离,默认为类目间距的20%,可设固定值 - itemStyle: { - normal: { - // color: '各异', - borderColor: '#fff', // 柱条边线 - borderRadius: 0, // 柱条边线圆角,单位px,默认为0 - borderWidth: 0, // 柱条边线线宽,单位px,默认为1 - label: { - show: false - // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - }, - emphasis: { - // color: '各异', - borderColor: '#fff', // 柱条边线 - borderRadius: 0, // 柱条边线圆角,单位px,默认为0 - borderWidth: 0, // 柱条边线线宽,单位px,默认为1 - label: { - show: false - // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - } - } - }, - - // 折线图默认参数 - line: { - // stack: null - xAxisIndex: 0, - yAxisIndex: 0, - itemStyle: { - normal: { - // color: 各异, - label: { - show: false - // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - lineStyle: { - width: 2, - type: 'solid', - shadowColor : 'rgba(0,0,0,0)', //默认透明 - shadowBlur: 0, - shadowOffsetX: 0, - shadowOffsetY: 0 - } - }, - emphasis: { - // color: 各异, - label: { - show: false - // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - } - }, - //smooth : false, - //symbol: null, // 拐点图形类型 - symbolSize: 2, // 拐点图形大小 - //symbolRotate : null, // 拐点图形旋转控制 - showAllSymbol: false // 标志图形默认只有主轴显示(随主轴标签间隔隐藏策略) - }, - - // K线图默认参数 - k: { - xAxisIndex: 0, - yAxisIndex: 0, - // barWidth : null // 默认自适应 - // barMaxWidth : null // 默认自适应 - itemStyle: { - normal: { - color: '#fff', // 阳线填充颜色 - color0: '#00aa11', // 阴线填充颜色 - lineStyle: { - width: 1, - color: '#ff3200', // 阳线边框颜色 - color0: '#00aa11' // 阴线边框颜色 - } - }, - emphasis: { - // color: 各异, - // color0: 各异 - } - } - }, - - // 散点图默认参数 - scatter: { - xAxisIndex: 0, - yAxisIndex: 0, - //symbol: null, // 图形类型 - symbolSize: 4, // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 - //symbolRotate : null, // 图形旋转控制 - large: false, // 大规模散点图 - largeThreshold: 2000,// 大规模阀值,large为true且数据量>largeThreshold才启用大规模模式 - itemStyle: { - normal: { - // color: 各异, - label: { - show: false, - // 标签文本格式器,同Tooltip.formatter,不支持回调 - formatter : function (a, b, c) { - if (typeof c[2] != 'undefined') { - return c[2]; - } - else { - return c[0] + ' , ' + c[1]; - } - } - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - }, - emphasis: { - // color: '各异' - label: { - show: false, - // 标签文本格式器,同Tooltip.formatter,不支持回调 - formatter : function (a, b, c) { - if (typeof c[2] != 'undefined') { - return c[2]; - } - else { - return c[0] + ' , ' + c[1]; - } - } - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - } - } - }, - - // 雷达图默认参数 - radar : { - polarIndex: 0, - itemStyle: { - normal: { - // color: 各异, - label: { - show: false - }, - lineStyle: { - width: 2, - type: 'solid' - } - }, - emphasis: { - // color: 各异, - label: { - show: false - } - } - }, - //symbol: null, // 拐点图形类型 - symbolSize: 2 // 可计算特性参数,空数据拖拽提示图形大小 - //symbolRotate : null, // 图形旋转控制 - }, - - // 饼图默认参数 - pie: { - center : ['50%', '50%'], // 默认全局居中 - radius : [0, '75%'], - clockWise : true, // 默认顺时针 - startAngle: 90, - minAngle: 0, // 最小角度改为0 - selectedOffset: 10, // 选中是扇区偏移量 - // selectedMode: false, // 选择模式,默认关闭,可选single,multiple - // roseType : null, // 南丁格尔玫瑰图模式,'radius'(半径) | 'area'(面积) - itemStyle: { - normal: { - // color: 各异, - borderColor: 'rgba(0,0,0,0)', - borderWidth: 1, - label: { - show: true, - position: 'outer' - // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - labelLine: { - show: true, - length: 20, - lineStyle: { - // color: 各异, - width: 1, - type: 'solid' - } - } - }, - emphasis: { - // color: 各异, - borderColor: 'rgba(0,0,0,0)', - borderWidth: 1, - label: { - show: false - // position: 'outer' - // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - labelLine: { - show: false, - length: 20, - lineStyle: { - // color: 各异, - width: 1, - type: 'solid' - } - } - } - } - }, - - map: { - mapType: 'china', // 各省的mapType暂时都用中文 - //mapLocation: { - // x : 'center' | 'left' | 'right' | 'x%' | {number}, - // y : 'center' | 'top' | 'bottom' | 'x%' | {number} - // width // 自适应 - // height // 自适应 - //}, - // mapValueCalculation: 'sum', // 数值合并方式,默认加和,可选为: - // 'sum' | 'average' | 'max' | 'min' - mapValuePrecision : 0, // 地图数值计算结果小数精度 - showLegendSymbol : true, // 显示图例颜色标识(系列标识的小圆点),存在legend时生效 - // selectedMode: false, // 选择模式,默认关闭,可选single,multiple - hoverable: true, - // roam : false, // 是否开启缩放及漫游模式 - // scaleLimit : null, - itemStyle: { - normal: { - // color: 各异, - borderColor: 'rgba(0,0,0,0)', - borderWidth: 1, - areaStyle: { - color: '#ccc' - }, - label: { - show: false, - textStyle: { - color: 'rgb(139,69,19)' - } - } - }, - emphasis: { // 也是选中样式 - // color: 各异, - borderColor: 'rgba(0,0,0,0)', - borderWidth: 1, - areaStyle: { - color: 'rgba(255,215,0,0.8)' - }, - label: { - show: false, - textStyle: { - color: 'rgb(100,0,0)' - } - } - } - } - }, - - force : { - // 布局中心 - center: ['50%', '50%'], - - // 布局大小 - size: '100%', - - // 布局冷却因子,值越小结束时间越短,值越大时间越长但是结果也越收敛 - coolDown: 0.99, - - // 数据映射到圆的半径的最小值和最大值 - minRadius : 10, - maxRadius : 20, - - // 是否根据屏幕比例拉伸 - ratioScaling: false, - - // 在 500+ 顶点的图上建议设置 large 为 true, 会使用 Barnes-Hut simulation - // 同时开启 useWorker 并且把 steps 值调大 - // 关于Barnes-Hut simulation: http://en.wikipedia.org/wiki/Barnes–Hut_simulation - large: false, - - // 是否在浏览器支持 worker 的时候使用 web worker - useWorker: false, - // 每一帧 force 迭代的次数,仅在启用webworker的情况下有用 - steps: 1, - - // 布局缩放因子,并不完全精确, 效果跟布局大小类似 - scaling : 1.0, - - // 向心力因子,越大向心力越大( 所有顶点会往 center 的位置收拢 ) - gravity : 1, - - symbol: 'circle', - // symbolSize 为 0 的话使用映射到minRadius-maxRadius后的值 - symbolSize: 0, - - linkSymbol: null, - linkSymbolSize: [10, 15], - draggable: true, - - // 分类里如果有样式会覆盖节点默认样式 - categories : [{ - // itemStyle - // symbol - // symbolSize - // name - }], - itemStyle: { - normal: { - // color: 各异, - label: { - show: false - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - nodeStyle : { - brushType : 'both', - color : '#f08c2e', - strokeColor : '#5182ab', - lineWidth: 1 - }, - linkStyle : { - strokeColor : '#5182ab' - } - }, - emphasis: { - // color: 各异, - label: { - show: false - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - nodeStyle : {}, - linkStyle : { - opacity: 0 - } - } - } - // nodes: [{ - // name: 'xxx', - // value: 1, - // itemStyle: {}, - // initial: [0, 0], - // fixX: false, - // fixY: false, - // ignore: false, - // symbol: 'circle', - // symbolSize: 0 - // }] - // links: [{ - // source: 1, - // target: 2, - // weight: 1, - // itemStyle: {} - // }, { - // source: 'xxx', - // target: 'ooo' - // }] - }, - - chord : { - radius : ['65%', '75%'], - center : ['50%', '50%'], - padding : 2, - sort : 'none', // can be 'none', 'ascending', 'descending' - sortSub : 'none', // can be 'none', 'ascending', 'descending' - startAngle : 90, - clockWise : true, - showScale : false, - showScaleText : false, - itemStyle : { - normal : { - label : { - show : true, - rotate: false, - distance: 10 - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - lineStyle : { - width : 0, - color : '#000' - }, - chordStyle : { - lineStyle : { - width : 1, - color : '#999' - } - } - }, - emphasis : { - lineStyle : { - width : 0, - color : '#000' - }, - chordStyle : { - lineStyle : { - width : 1, - color : '#666' - } - } - } - }, - // Source data matrix - /** - * target - * -1--2--3--4--5- - * 1| x x x x x - * 2| x x x x x - * 3| x x x x x source - * 4| x x x x x - * 5| x x x x x - * - * Relation ship from source to target - * https://github.com/mbostock/d3/wiki/Chord-Layout#wiki-chord - * - * Row based - */ - matrix : [] - }, - - gauge : { - center : ['50%', '50%'], // 默认全局居中 - radius : '75%', - startAngle: 225, - endAngle : -45, - min: 0, // 最小值 - max: 100, // 最大值 - precision: 0, // 小数精度,默认为0,无小数点 - splitNumber: 10, // 分割段数,默认为10 - axisLine: { // 坐标轴线 - show: true, // 默认显示,属性show控制显示与否 - lineStyle: { // 属性lineStyle控制线条样式 - color: [[0.2, '#228b22'],[0.8, '#48b'],[1, '#ff4500']], - width: 30 - } - }, - axisTick: { // 坐标轴小标记 - show: true, // 属性show控制显示与否,默认不显示 - splitNumber: 5, // 每份split细分多少段 - length :8, // 属性length控制线长 - lineStyle: { // 属性lineStyle控制线条样式 - color: '#eee', - width: 1, - type: 'solid' - } - }, - axisLabel: { // 坐标轴文本标签,详见axis.axisLabel - show: true, - // formatter: null, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: 'auto' - } - }, - splitLine: { // 分隔线 - show: true, // 默认显示,属性show控制显示与否 - length :30, // 属性length控制线长 - lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 - color: '#eee', - width: 2, - type: 'solid' - } - }, - pointer : { - show : true, - length : '80%', - width : 8, - color : 'auto' - }, - title : { - show : true, - offsetCenter: [0, '-40%'], // x, y,单位px - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#333', - fontSize : 15 - } - }, - detail : { - show : true, - backgroundColor: 'rgba(0,0,0,0)', - borderWidth: 0, - borderColor: '#ccc', - width: 100, - height: 40, - offsetCenter: [0, '40%'], // x, y,单位px - // formatter: null, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: 'auto', - fontSize : 30 - } - } - }, - - funnel : { - x: 80, - y: 60, - x2: 80, - y2: 60, - // width: {totalWidth} - x - x2, - // height: {totalHeight} - y - y2, - min: 0, - max: 100, - minSize: '0%', - maxSize: '100%', - sort : 'descending', // 'ascending', 'descending' - gap : 0, - itemStyle: { - normal: { - // color: 各异, - borderColor: '#fff', - borderWidth: 1, - label: { - show: true, - position: 'outer' - // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - labelLine: { - show: true, - length: 10, - lineStyle: { - // color: 各异, - width: 1, - type: 'solid' - } - } - }, - emphasis: { - // color: 各异, - borderColor: 'rgba(0,0,0,0)', - borderWidth: 1, - label: { - show: true - }, - labelLine: { - show: true - } - } - } - }, - - island: { - r: 15, - calculateStep: 0.1 // 滚轮可计算步长 0.1 = 10% - }, - - markPoint : { - symbol: 'pin', // 标注类型 - symbolSize: 10, // 标注大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 - //symbolRotate : null, // 标注旋转控制 - large : false, - effect : { - show: false, - loop: true, - period: 15, // 运动周期,无单位,值越大越慢 - scaleSize : 2 // 放大倍数,以markPoint点size为基准 - // color : 'gold', - // shadowColor : 'rgba(255,215,0,0.8)', - // shadowBlur : 0 // 炫光模糊 - }, - itemStyle: { - normal: { - // color: 各异, - // borderColor: 各异, // 标注边线颜色,优先于color - borderWidth: 2, // 标注边线线宽,单位px,默认为1 - label: { - show: true, - // 标签文本格式器,同Tooltip.formatter,不支持回调 - // formatter : null, - position: 'inside' // 可选为'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - }, - emphasis: { - // color: 各异 - label: { - show: true - // 标签文本格式器,同Tooltip.formatter,不支持回调 - // formatter : null, - // position: 'inside' // 'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - } - } - }, - - markLine : { - // 标线起始和结束的symbol介绍类型,如果都一样,可以直接传string - symbol: ['circle', 'arrow'], - // 标线起始和结束的symbol大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 - symbolSize: [2, 4], - // 标线起始和结束的symbol旋转控制 - //symbolRotate : null, - //smooth : false, - large : false, - effect : { - show: false, - loop: true, - period: 15, // 运动周期,无单位,值越大越慢 - scaleSize : 2 // 放大倍数,以markLine线lineWidth为基准 - // color : 'gold', - // shadowColor : 'rgba(255,215,0,0.8)', - // shadowBlur : lineWidth * 2 // 炫光模糊,默认等于scaleSize计算所得 - }, - itemStyle: { - normal: { - // color: 各异, // 标线主色,线色,symbol主色 - // borderColor: 随color, // 标线symbol边框颜色,优先于color - borderWidth: 1.5, // 标线symbol边框线宽,单位px,默认为2 - label: { - show: true, - // 标签文本格式器,同Tooltip.formatter,不支持回调 - // formatter : null, - // 可选为 'start'|'end'|'left'|'right'|'top'|'bottom' - position: 'end' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - lineStyle: { - // color: 随borderColor, // 主色,线色,优先级高于borderColor和color - // width: 随borderWidth, // 优先于borderWidth - type: 'dashed' - // shadowColor : 'rgba(0,0,0,0)', //默认透明 - // shadowBlur: 0, - // shadowOffsetX: 0, - // shadowOffsetY: 0 - } - }, - emphasis: { - // color: 各异 - label: { - show: false - // 标签文本格式器,同Tooltip.formatter,不支持回调 - // formatter : null, - // position: 'inside' // 'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - lineStyle : {} - } - } - }, - - // 主题,主题 - textStyle: { - decoration: 'none', - fontFamily: 'Arial, Verdana, sans-serif', - fontFamily2: '微软雅黑', // IE8- 字体模糊并且,不支持不同字体混排,额外指定一份 - fontSize: 12, - fontStyle: 'normal', - fontWeight: 'normal' - }, - - EVENT: { - // -------全局通用 - REFRESH: 'refresh', - RESTORE: 'restore', - RESIZE: 'resize', - CLICK: 'click', - HOVER: 'hover', - //MOUSEWHEEL: 'mousewheel', - // -------业务交互逻辑 - DATA_CHANGED: 'dataChanged', - DATA_ZOOM: 'dataZoom', - DATA_RANGE: 'dataRange', - LEGEND_SELECTED: 'legendSelected', - MAP_SELECTED: 'mapSelected', - PIE_SELECTED: 'pieSelected', - MAGIC_TYPE_CHANGED: 'magicTypeChanged', - DATA_VIEW_CHANGED: 'dataViewChanged', - TIMELINE_CHANGED: 'timelineChanged', - MAP_ROAM : 'mapRoam', - // -------内部通信 - TOOLTIP_HOVER: 'tooltipHover', - TOOLTIP_IN_GRID: 'tooltipInGrid', - TOOLTIP_OUT_GRID: 'tooltipOutGrid' - }, - DRAG_ENABLE_TIME : 120, // 降低图表内元素拖拽敏感度,单位ms,不建议外部干预 - EFFECT_ZLEVEL : 7, - // 主题,默认标志图形类型列表 - symbolList : [ - 'circle', 'rectangle', 'triangle', 'diamond', - 'emptyCircle', 'emptyRectangle', 'emptyTriangle', 'emptyDiamond' - ], - loadingText : 'Loading...', - // 可计算特性配置,孤岛,提示颜色 - calculable: false, // 默认关闭可计算特性 - calculableColor: 'rgba(255,165,0,0.6)', // 拖拽提示边框颜色 - calculableHolderColor: '#ccc', // 可计算占位提示颜色 - nameConnector: ' & ', - valueConnector: ' : ', - animation: true, - addDataAnimation: true, // 动态数据接口是否开启动画效果 - animationThreshold: 2000, // 动画元素阀值,产生的图形原素超过2000不出动画 - animationDuration: 2000, - animationEasing: 'ExponentialOut' //BounceOut - }; - - return config; -}); -// Copyright 2006 Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -// Known Issues: -// -// * Patterns only support repeat. -// * Radial gradient are not implemented. The VML version of these look very -// different from the canvas one. -// * Clipping paths are not implemented. -// * Coordsize. The width and height attribute have higher priority than the -// width and height style values which isn't correct. -// * Painting mode isn't implemented. -// * Canvas width/height should is using content-box by default. IE in -// Quirks mode will draw the canvas using border-box. Either change your -// doctype to HTML5 -// (http://www.whatwg.org/specs/web-apps/current-work/#the-doctype) -// or use Box Sizing Behavior from WebFX -// (http://webfx.eae.net/dhtml/boxsizing/boxsizing.html) -// * Non uniform scaling does not correctly scale strokes. -// * Optimize. There is always room for speed improvements. - -// AMD by kener.linfeng@gmail.com -define('zrender/lib/excanvas',['require'],function(require) { - -// Only add this code if we do not already have a canvas implementation -if (!document.createElement('canvas').getContext) { - -(function() { - - // alias some functions to make (compiled) code shorter - var m = Math; - var mr = m.round; - var ms = m.sin; - var mc = m.cos; - var abs = m.abs; - var sqrt = m.sqrt; - - // this is used for sub pixel precision - var Z = 10; - var Z2 = Z / 2; - - var IE_VERSION = +navigator.userAgent.match(/MSIE ([\d.]+)?/)[1]; - - /** - * This funtion is assigned to the elements as element.getContext(). - * @this {HTMLElement} - * @return {CanvasRenderingContext2D_} - */ - function getContext() { - return this.context_ || - (this.context_ = new CanvasRenderingContext2D_(this)); - } - - var slice = Array.prototype.slice; - - /** - * Binds a function to an object. The returned function will always use the - * passed in {@code obj} as {@code this}. - * - * Example: - * - * g = bind(f, obj, a, b) - * g(c, d) // will do f.call(obj, a, b, c, d) - * - * @param {Function} f The function to bind the object to - * @param {Object} obj The object that should act as this when the function - * is called - * @param {*} var_args Rest arguments that will be used as the initial - * arguments when the function is called - * @return {Function} A new function that has bound this - */ - function bind(f, obj, var_args) { - var a = slice.call(arguments, 2); - return function() { - return f.apply(obj, a.concat(slice.call(arguments))); - }; - } - - function encodeHtmlAttribute(s) { - return String(s).replace(/&/g, '&').replace(/"/g, '"'); - } - - function addNamespace(doc, prefix, urn) { - if (!doc.namespaces[prefix]) { - doc.namespaces.add(prefix, urn, '#default#VML'); - } - } - - function addNamespacesAndStylesheet(doc) { - addNamespace(doc, 'g_vml_', 'urn:schemas-microsoft-com:vml'); - addNamespace(doc, 'g_o_', 'urn:schemas-microsoft-com:office:office'); - - // Setup default CSS. Only add one style sheet per document - if (!doc.styleSheets['ex_canvas_']) { - var ss = doc.createStyleSheet(); - ss.owningElement.id = 'ex_canvas_'; - ss.cssText = 'canvas{display:inline-block;overflow:hidden;' + - // default size is 300x150 in Gecko and Opera - 'text-align:left;width:300px;height:150px}'; - } - } - - // Add namespaces and stylesheet at startup. - addNamespacesAndStylesheet(document); - - var G_vmlCanvasManager_ = { - init: function(opt_doc) { - var doc = opt_doc || document; - // Create a dummy element so that IE will allow canvas elements to be - // recognized. - doc.createElement('canvas'); - doc.attachEvent('onreadystatechange', bind(this.init_, this, doc)); - }, - - init_: function(doc) { - // find all canvas elements - var els = doc.getElementsByTagName('canvas'); - for (var i = 0; i < els.length; i++) { - this.initElement(els[i]); - } - }, - - /** - * Public initializes a canvas element so that it can be used as canvas - * element from now on. This is called automatically before the page is - * loaded but if you are creating elements using createElement you need to - * make sure this is called on the element. - * @param {HTMLElement} el The canvas element to initialize. - * @return {HTMLElement} the element that was created. - */ - initElement: function(el) { - if (!el.getContext) { - el.getContext = getContext; - - // Add namespaces and stylesheet to document of the element. - addNamespacesAndStylesheet(el.ownerDocument); - - // Remove fallback content. There is no way to hide text nodes so we - // just remove all childNodes. We could hide all elements and remove - // text nodes but who really cares about the fallback content. - el.innerHTML = ''; - - // do not use inline function because that will leak memory - el.attachEvent('onpropertychange', onPropertyChange); - el.attachEvent('onresize', onResize); - - var attrs = el.attributes; - if (attrs.width && attrs.width.specified) { - // TODO: use runtimeStyle and coordsize - // el.getContext().setWidth_(attrs.width.nodeValue); - el.style.width = attrs.width.nodeValue + 'px'; - } else { - el.width = el.clientWidth; - } - if (attrs.height && attrs.height.specified) { - // TODO: use runtimeStyle and coordsize - // el.getContext().setHeight_(attrs.height.nodeValue); - el.style.height = attrs.height.nodeValue + 'px'; - } else { - el.height = el.clientHeight; - } - //el.getContext().setCoordsize_() - } - return el; - } - }; - - function onPropertyChange(e) { - var el = e.srcElement; - - switch (e.propertyName) { - case 'width': - el.getContext().clearRect(); - el.style.width = el.attributes.width.nodeValue + 'px'; - // In IE8 this does not trigger onresize. - el.firstChild.style.width = el.clientWidth + 'px'; - break; - case 'height': - el.getContext().clearRect(); - el.style.height = el.attributes.height.nodeValue + 'px'; - el.firstChild.style.height = el.clientHeight + 'px'; - break; - } - } - - function onResize(e) { - var el = e.srcElement; - if (el.firstChild) { - el.firstChild.style.width = el.clientWidth + 'px'; - el.firstChild.style.height = el.clientHeight + 'px'; - } - } - - G_vmlCanvasManager_.init(); - - // precompute "00" to "FF" - var decToHex = []; - for (var i = 0; i < 16; i++) { - for (var j = 0; j < 16; j++) { - decToHex[i * 16 + j] = i.toString(16) + j.toString(16); - } - } - - function createMatrixIdentity() { - return [ - [1, 0, 0], - [0, 1, 0], - [0, 0, 1] - ]; - } - - function matrixMultiply(m1, m2) { - var result = createMatrixIdentity(); - - for (var x = 0; x < 3; x++) { - for (var y = 0; y < 3; y++) { - var sum = 0; - - for (var z = 0; z < 3; z++) { - sum += m1[x][z] * m2[z][y]; - } - - result[x][y] = sum; - } - } - return result; - } - - function copyState(o1, o2) { - o2.fillStyle = o1.fillStyle; - o2.lineCap = o1.lineCap; - o2.lineJoin = o1.lineJoin; - o2.lineWidth = o1.lineWidth; - o2.miterLimit = o1.miterLimit; - o2.shadowBlur = o1.shadowBlur; - o2.shadowColor = o1.shadowColor; - o2.shadowOffsetX = o1.shadowOffsetX; - o2.shadowOffsetY = o1.shadowOffsetY; - o2.strokeStyle = o1.strokeStyle; - o2.globalAlpha = o1.globalAlpha; - o2.font = o1.font; - o2.textAlign = o1.textAlign; - o2.textBaseline = o1.textBaseline; - o2.arcScaleX_ = o1.arcScaleX_; - o2.arcScaleY_ = o1.arcScaleY_; - o2.lineScale_ = o1.lineScale_; - } - - var colorData = { - aliceblue: '#F0F8FF', - antiquewhite: '#FAEBD7', - aquamarine: '#7FFFD4', - azure: '#F0FFFF', - beige: '#F5F5DC', - bisque: '#FFE4C4', - black: '#000000', - blanchedalmond: '#FFEBCD', - blueviolet: '#8A2BE2', - brown: '#A52A2A', - burlywood: '#DEB887', - cadetblue: '#5F9EA0', - chartreuse: '#7FFF00', - chocolate: '#D2691E', - coral: '#FF7F50', - cornflowerblue: '#6495ED', - cornsilk: '#FFF8DC', - crimson: '#DC143C', - cyan: '#00FFFF', - darkblue: '#00008B', - darkcyan: '#008B8B', - darkgoldenrod: '#B8860B', - darkgray: '#A9A9A9', - darkgreen: '#006400', - darkgrey: '#A9A9A9', - darkkhaki: '#BDB76B', - darkmagenta: '#8B008B', - darkolivegreen: '#556B2F', - darkorange: '#FF8C00', - darkorchid: '#9932CC', - darkred: '#8B0000', - darksalmon: '#E9967A', - darkseagreen: '#8FBC8F', - darkslateblue: '#483D8B', - darkslategray: '#2F4F4F', - darkslategrey: '#2F4F4F', - darkturquoise: '#00CED1', - darkviolet: '#9400D3', - deeppink: '#FF1493', - deepskyblue: '#00BFFF', - dimgray: '#696969', - dimgrey: '#696969', - dodgerblue: '#1E90FF', - firebrick: '#B22222', - floralwhite: '#FFFAF0', - forestgreen: '#228B22', - gainsboro: '#DCDCDC', - ghostwhite: '#F8F8FF', - gold: '#FFD700', - goldenrod: '#DAA520', - grey: '#808080', - greenyellow: '#ADFF2F', - honeydew: '#F0FFF0', - hotpink: '#FF69B4', - indianred: '#CD5C5C', - indigo: '#4B0082', - ivory: '#FFFFF0', - khaki: '#F0E68C', - lavender: '#E6E6FA', - lavenderblush: '#FFF0F5', - lawngreen: '#7CFC00', - lemonchiffon: '#FFFACD', - lightblue: '#ADD8E6', - lightcoral: '#F08080', - lightcyan: '#E0FFFF', - lightgoldenrodyellow: '#FAFAD2', - lightgreen: '#90EE90', - lightgrey: '#D3D3D3', - lightpink: '#FFB6C1', - lightsalmon: '#FFA07A', - lightseagreen: '#20B2AA', - lightskyblue: '#87CEFA', - lightslategray: '#778899', - lightslategrey: '#778899', - lightsteelblue: '#B0C4DE', - lightyellow: '#FFFFE0', - limegreen: '#32CD32', - linen: '#FAF0E6', - magenta: '#FF00FF', - mediumaquamarine: '#66CDAA', - mediumblue: '#0000CD', - mediumorchid: '#BA55D3', - mediumpurple: '#9370DB', - mediumseagreen: '#3CB371', - mediumslateblue: '#7B68EE', - mediumspringgreen: '#00FA9A', - mediumturquoise: '#48D1CC', - mediumvioletred: '#C71585', - midnightblue: '#191970', - mintcream: '#F5FFFA', - mistyrose: '#FFE4E1', - moccasin: '#FFE4B5', - navajowhite: '#FFDEAD', - oldlace: '#FDF5E6', - olivedrab: '#6B8E23', - orange: '#FFA500', - orangered: '#FF4500', - orchid: '#DA70D6', - palegoldenrod: '#EEE8AA', - palegreen: '#98FB98', - paleturquoise: '#AFEEEE', - palevioletred: '#DB7093', - papayawhip: '#FFEFD5', - peachpuff: '#FFDAB9', - peru: '#CD853F', - pink: '#FFC0CB', - plum: '#DDA0DD', - powderblue: '#B0E0E6', - rosybrown: '#BC8F8F', - royalblue: '#4169E1', - saddlebrown: '#8B4513', - salmon: '#FA8072', - sandybrown: '#F4A460', - seagreen: '#2E8B57', - seashell: '#FFF5EE', - sienna: '#A0522D', - skyblue: '#87CEEB', - slateblue: '#6A5ACD', - slategray: '#708090', - slategrey: '#708090', - snow: '#FFFAFA', - springgreen: '#00FF7F', - steelblue: '#4682B4', - tan: '#D2B48C', - thistle: '#D8BFD8', - tomato: '#FF6347', - turquoise: '#40E0D0', - violet: '#EE82EE', - wheat: '#F5DEB3', - whitesmoke: '#F5F5F5', - yellowgreen: '#9ACD32' - }; - - - function getRgbHslContent(styleString) { - var start = styleString.indexOf('(', 3); - var end = styleString.indexOf(')', start + 1); - var parts = styleString.substring(start + 1, end).split(','); - // add alpha if needed - if (parts.length != 4 || styleString.charAt(3) != 'a') { - parts[3] = 1; - } - return parts; - } - - function percent(s) { - return parseFloat(s) / 100; - } - - function clamp(v, min, max) { - return Math.min(max, Math.max(min, v)); - } - - function hslToRgb(parts){ - var r, g, b, h, s, l; - h = parseFloat(parts[0]) / 360 % 360; - if (h < 0) - h++; - s = clamp(percent(parts[1]), 0, 1); - l = clamp(percent(parts[2]), 0, 1); - if (s == 0) { - r = g = b = l; // achromatic - } else { - var q = l < 0.5 ? l * (1 + s) : l + s - l * s; - var p = 2 * l - q; - r = hueToRgb(p, q, h + 1 / 3); - g = hueToRgb(p, q, h); - b = hueToRgb(p, q, h - 1 / 3); - } - - return '#' + decToHex[Math.floor(r * 255)] + - decToHex[Math.floor(g * 255)] + - decToHex[Math.floor(b * 255)]; - } - - function hueToRgb(m1, m2, h) { - if (h < 0) - h++; - if (h > 1) - h--; - - if (6 * h < 1) - return m1 + (m2 - m1) * 6 * h; - else if (2 * h < 1) - return m2; - else if (3 * h < 2) - return m1 + (m2 - m1) * (2 / 3 - h) * 6; - else - return m1; - } - - var processStyleCache = {}; - - function processStyle(styleString) { - if (styleString in processStyleCache) { - return processStyleCache[styleString]; - } - - var str, alpha = 1; - - styleString = String(styleString); - if (styleString.charAt(0) == '#') { - str = styleString; - } else if (/^rgb/.test(styleString)) { - var parts = getRgbHslContent(styleString); - var str = '#', n; - for (var i = 0; i < 3; i++) { - if (parts[i].indexOf('%') != -1) { - n = Math.floor(percent(parts[i]) * 255); - } else { - n = +parts[i]; - } - str += decToHex[clamp(n, 0, 255)]; - } - alpha = +parts[3]; - } else if (/^hsl/.test(styleString)) { - var parts = getRgbHslContent(styleString); - str = hslToRgb(parts); - alpha = parts[3]; - } else { - str = colorData[styleString] || styleString; - } - return processStyleCache[styleString] = {color: str, alpha: alpha}; - } - - var DEFAULT_STYLE = { - style: 'normal', - variant: 'normal', - weight: 'normal', - size: 12, //10 - family: '微软雅黑' //'sans-serif' - }; - - // Internal text style cache - var fontStyleCache = {}; - - function processFontStyle(styleString) { - if (fontStyleCache[styleString]) { - return fontStyleCache[styleString]; - } - - var el = document.createElement('div'); - var style = el.style; - var fontFamily; - try { - style.font = styleString; - fontFamily = style.fontFamily.split(',')[0]; - } catch (ex) { - // Ignore failures to set to invalid font. - } - - return fontStyleCache[styleString] = { - style: style.fontStyle || DEFAULT_STYLE.style, - variant: style.fontVariant || DEFAULT_STYLE.variant, - weight: style.fontWeight || DEFAULT_STYLE.weight, - size: style.fontSize || DEFAULT_STYLE.size, - family: fontFamily || DEFAULT_STYLE.family - }; - } - - function getComputedStyle(style, element) { - var computedStyle = {}; - - for (var p in style) { - computedStyle[p] = style[p]; - } - - // Compute the size - var canvasFontSize = parseFloat(element.currentStyle.fontSize), - fontSize = parseFloat(style.size); - - if (typeof style.size == 'number') { - computedStyle.size = style.size; - } else if (style.size.indexOf('px') != -1) { - computedStyle.size = fontSize; - } else if (style.size.indexOf('em') != -1) { - computedStyle.size = canvasFontSize * fontSize; - } else if(style.size.indexOf('%') != -1) { - computedStyle.size = (canvasFontSize / 100) * fontSize; - } else if (style.size.indexOf('pt') != -1) { - computedStyle.size = fontSize / .75; - } else { - computedStyle.size = canvasFontSize; - } - - // Different scaling between normal text and VML text. This was found using - // trial and error to get the same size as non VML text. - //computedStyle.size *= 0.981; - - return computedStyle; - } - - function buildStyle(style) { - return style.style + ' ' + style.variant + ' ' + style.weight + ' ' + - style.size + "px '" + style.family + "'"; - } - - var lineCapMap = { - 'butt': 'flat', - 'round': 'round' - }; - - function processLineCap(lineCap) { - return lineCapMap[lineCap] || 'square'; - } - - /** - * This class implements CanvasRenderingContext2D interface as described by - * the WHATWG. - * @param {HTMLElement} canvasElement The element that the 2D context should - * be associated with - */ - function CanvasRenderingContext2D_(canvasElement) { - this.m_ = createMatrixIdentity(); - - this.mStack_ = []; - this.aStack_ = []; - this.currentPath_ = []; - - // Canvas context properties - this.strokeStyle = '#000'; - this.fillStyle = '#000'; - - this.lineWidth = 1; - this.lineJoin = 'miter'; - this.lineCap = 'butt'; - this.miterLimit = Z * 1; - this.globalAlpha = 1; - // this.font = '10px sans-serif'; - this.font = '12px 微软雅黑'; // 决定还是改这吧,影响代价最小 - this.textAlign = 'left'; - this.textBaseline = 'alphabetic'; - this.canvas = canvasElement; - - var cssText = 'width:' + canvasElement.clientWidth + 'px;height:' + - canvasElement.clientHeight + 'px;overflow:hidden;position:absolute'; - var el = canvasElement.ownerDocument.createElement('div'); - el.style.cssText = cssText; - canvasElement.appendChild(el); - - var overlayEl = el.cloneNode(false); - // Use a non transparent background. - overlayEl.style.backgroundColor = '#fff'; //red, I don't know why, it work! - overlayEl.style.filter = 'alpha(opacity=0)'; - canvasElement.appendChild(overlayEl); - - this.element_ = el; - this.arcScaleX_ = 1; - this.arcScaleY_ = 1; - this.lineScale_ = 1; - } - - var contextPrototype = CanvasRenderingContext2D_.prototype; - contextPrototype.clearRect = function() { - if (this.textMeasureEl_) { - this.textMeasureEl_.removeNode(true); - this.textMeasureEl_ = null; - } - this.element_.innerHTML = ''; - }; - - contextPrototype.beginPath = function() { - // TODO: Branch current matrix so that save/restore has no effect - // as per safari docs. - this.currentPath_ = []; - }; - - contextPrototype.moveTo = function(aX, aY) { - var p = getCoords(this, aX, aY); - this.currentPath_.push({type: 'moveTo', x: p.x, y: p.y}); - this.currentX_ = p.x; - this.currentY_ = p.y; - }; - - contextPrototype.lineTo = function(aX, aY) { - var p = getCoords(this, aX, aY); - this.currentPath_.push({type: 'lineTo', x: p.x, y: p.y}); - - this.currentX_ = p.x; - this.currentY_ = p.y; - }; - - contextPrototype.bezierCurveTo = function(aCP1x, aCP1y, - aCP2x, aCP2y, - aX, aY) { - var p = getCoords(this, aX, aY); - var cp1 = getCoords(this, aCP1x, aCP1y); - var cp2 = getCoords(this, aCP2x, aCP2y); - bezierCurveTo(this, cp1, cp2, p); - }; - - // Helper function that takes the already fixed cordinates. - function bezierCurveTo(self, cp1, cp2, p) { - self.currentPath_.push({ - type: 'bezierCurveTo', - cp1x: cp1.x, - cp1y: cp1.y, - cp2x: cp2.x, - cp2y: cp2.y, - x: p.x, - y: p.y - }); - self.currentX_ = p.x; - self.currentY_ = p.y; - } - - contextPrototype.quadraticCurveTo = function(aCPx, aCPy, aX, aY) { - // the following is lifted almost directly from - // http://developer.mozilla.org/en/docs/Canvas_tutorial:Drawing_shapes - - var cp = getCoords(this, aCPx, aCPy); - var p = getCoords(this, aX, aY); - - var cp1 = { - x: this.currentX_ + 2.0 / 3.0 * (cp.x - this.currentX_), - y: this.currentY_ + 2.0 / 3.0 * (cp.y - this.currentY_) - }; - var cp2 = { - x: cp1.x + (p.x - this.currentX_) / 3.0, - y: cp1.y + (p.y - this.currentY_) / 3.0 - }; - - bezierCurveTo(this, cp1, cp2, p); - }; - - contextPrototype.arc = function(aX, aY, aRadius, - aStartAngle, aEndAngle, aClockwise) { - aRadius *= Z; - var arcType = aClockwise ? 'at' : 'wa'; - - var xStart = aX + mc(aStartAngle) * aRadius - Z2; - var yStart = aY + ms(aStartAngle) * aRadius - Z2; - - var xEnd = aX + mc(aEndAngle) * aRadius - Z2; - var yEnd = aY + ms(aEndAngle) * aRadius - Z2; - - // IE won't render arches drawn counter clockwise if xStart == xEnd. - if (xStart == xEnd && !aClockwise) { - xStart += 0.125; // Offset xStart by 1/80 of a pixel. Use something - // that can be represented in binary - } - - var p = getCoords(this, aX, aY); - var pStart = getCoords(this, xStart, yStart); - var pEnd = getCoords(this, xEnd, yEnd); - - this.currentPath_.push({type: arcType, - x: p.x, - y: p.y, - radius: aRadius, - xStart: pStart.x, - yStart: pStart.y, - xEnd: pEnd.x, - yEnd: pEnd.y}); - - }; - - contextPrototype.rect = function(aX, aY, aWidth, aHeight) { - this.moveTo(aX, aY); - this.lineTo(aX + aWidth, aY); - this.lineTo(aX + aWidth, aY + aHeight); - this.lineTo(aX, aY + aHeight); - this.closePath(); - }; - - contextPrototype.strokeRect = function(aX, aY, aWidth, aHeight) { - var oldPath = this.currentPath_; - this.beginPath(); - - this.moveTo(aX, aY); - this.lineTo(aX + aWidth, aY); - this.lineTo(aX + aWidth, aY + aHeight); - this.lineTo(aX, aY + aHeight); - this.closePath(); - this.stroke(); - - this.currentPath_ = oldPath; - }; - - contextPrototype.fillRect = function(aX, aY, aWidth, aHeight) { - var oldPath = this.currentPath_; - this.beginPath(); - - this.moveTo(aX, aY); - this.lineTo(aX + aWidth, aY); - this.lineTo(aX + aWidth, aY + aHeight); - this.lineTo(aX, aY + aHeight); - this.closePath(); - this.fill(); - - this.currentPath_ = oldPath; - }; - - contextPrototype.createLinearGradient = function(aX0, aY0, aX1, aY1) { - var gradient = new CanvasGradient_('gradient'); - gradient.x0_ = aX0; - gradient.y0_ = aY0; - gradient.x1_ = aX1; - gradient.y1_ = aY1; - return gradient; - }; - - contextPrototype.createRadialGradient = function(aX0, aY0, aR0, - aX1, aY1, aR1) { - var gradient = new CanvasGradient_('gradientradial'); - gradient.x0_ = aX0; - gradient.y0_ = aY0; - gradient.r0_ = aR0; - gradient.x1_ = aX1; - gradient.y1_ = aY1; - gradient.r1_ = aR1; - return gradient; - }; - - contextPrototype.drawImage = function(image, var_args) { - var dx, dy, dw, dh, sx, sy, sw, sh; - - // to find the original width we overide the width and height - var oldRuntimeWidth = image.runtimeStyle.width; - var oldRuntimeHeight = image.runtimeStyle.height; - image.runtimeStyle.width = 'auto'; - image.runtimeStyle.height = 'auto'; - - // get the original size - var w = image.width; - var h = image.height; - - // and remove overides - image.runtimeStyle.width = oldRuntimeWidth; - image.runtimeStyle.height = oldRuntimeHeight; - - if (arguments.length == 3) { - dx = arguments[1]; - dy = arguments[2]; - sx = sy = 0; - sw = dw = w; - sh = dh = h; - } else if (arguments.length == 5) { - dx = arguments[1]; - dy = arguments[2]; - dw = arguments[3]; - dh = arguments[4]; - sx = sy = 0; - sw = w; - sh = h; - } else if (arguments.length == 9) { - sx = arguments[1]; - sy = arguments[2]; - sw = arguments[3]; - sh = arguments[4]; - dx = arguments[5]; - dy = arguments[6]; - dw = arguments[7]; - dh = arguments[8]; - } else { - throw Error('Invalid number of arguments'); - } - - var d = getCoords(this, dx, dy); - - var w2 = sw / 2; - var h2 = sh / 2; - - var vmlStr = []; - - var W = 10; - var H = 10; - - var scaleX = scaleY = 1; - - // For some reason that I've now forgotten, using divs didn't work - vmlStr.push(' '); - - // Draw a special cropping div if needed - if (sx || sy) { - // Apply scales to width and height - vmlStr.push('
'); - } - - - // Apply scales to width and height - vmlStr.push('
'); - - // Close the crop div if necessary - if (sx || sy) vmlStr.push('
'); - - vmlStr.push('
'); - - this.element_.insertAdjacentHTML('BeforeEnd', vmlStr.join('')); - }; - - contextPrototype.stroke = function(aFill) { - var lineStr = []; - var lineOpen = false; - - var W = 10; - var H = 10; - - lineStr.push(''); - - if (!aFill) { - appendStroke(this, lineStr); - } else { - appendFill(this, lineStr, min, max); - } - - lineStr.push(''); - - this.element_.insertAdjacentHTML('beforeEnd', lineStr.join('')); - }; - - function appendStroke(ctx, lineStr) { - var a = processStyle(ctx.strokeStyle); - var color = a.color; - var opacity = a.alpha * ctx.globalAlpha; - var lineWidth = ctx.lineScale_ * ctx.lineWidth; - - // VML cannot correctly render a line if the width is less than 1px. - // In that case, we dilute the color to make the line look thinner. - if (lineWidth < 1) { - opacity *= lineWidth; - } - - lineStr.push( - '' - ); - } - - function appendFill(ctx, lineStr, min, max) { - var fillStyle = ctx.fillStyle; - var arcScaleX = ctx.arcScaleX_; - var arcScaleY = ctx.arcScaleY_; - var width = max.x - min.x; - var height = max.y - min.y; - if (fillStyle instanceof CanvasGradient_) { - // TODO: Gradients transformed with the transformation matrix. - var angle = 0; - var focus = {x: 0, y: 0}; - - // additional offset - var shift = 0; - // scale factor for offset - var expansion = 1; - - if (fillStyle.type_ == 'gradient') { - var x0 = fillStyle.x0_ / arcScaleX; - var y0 = fillStyle.y0_ / arcScaleY; - var x1 = fillStyle.x1_ / arcScaleX; - var y1 = fillStyle.y1_ / arcScaleY; - var p0 = getCoords(ctx, x0, y0); - var p1 = getCoords(ctx, x1, y1); - var dx = p1.x - p0.x; - var dy = p1.y - p0.y; - angle = Math.atan2(dx, dy) * 180 / Math.PI; - - // The angle should be a non-negative number. - if (angle < 0) { - angle += 360; - } - - // Very small angles produce an unexpected result because they are - // converted to a scientific notation string. - if (angle < 1e-6) { - angle = 0; - } - } else { - var p0 = getCoords(ctx, fillStyle.x0_, fillStyle.y0_); - focus = { - x: (p0.x - min.x) / width, - y: (p0.y - min.y) / height - }; - - width /= arcScaleX * Z; - height /= arcScaleY * Z; - var dimension = m.max(width, height); - shift = 2 * fillStyle.r0_ / dimension; - expansion = 2 * fillStyle.r1_ / dimension - shift; - } - - // We need to sort the color stops in ascending order by offset, - // otherwise IE won't interpret it correctly. - var stops = fillStyle.colors_; - stops.sort(function(cs1, cs2) { - return cs1.offset - cs2.offset; - }); - - var length = stops.length; - var color1 = stops[0].color; - var color2 = stops[length - 1].color; - var opacity1 = stops[0].alpha * ctx.globalAlpha; - var opacity2 = stops[length - 1].alpha * ctx.globalAlpha; - - var colors = []; - for (var i = 0; i < length; i++) { - var stop = stops[i]; - colors.push(stop.offset * expansion + shift + ' ' + stop.color); - } - - // When colors attribute is used, the meanings of opacity and o:opacity2 - // are reversed. - lineStr.push(''); - } else if (fillStyle instanceof CanvasPattern_) { - if (width && height) { - var deltaLeft = -min.x; - var deltaTop = -min.y; - lineStr.push(''); - } - } else { - var a = processStyle(ctx.fillStyle); - var color = a.color; - var opacity = a.alpha * ctx.globalAlpha; - lineStr.push(''); - } - } - - contextPrototype.fill = function() { - this.stroke(true); - }; - - contextPrototype.closePath = function() { - this.currentPath_.push({type: 'close'}); - }; - - function getCoords(ctx, aX, aY) { - var m = ctx.m_; - return { - x: Z * (aX * m[0][0] + aY * m[1][0] + m[2][0]) - Z2, - y: Z * (aX * m[0][1] + aY * m[1][1] + m[2][1]) - Z2 - }; - }; - - contextPrototype.save = function() { - var o = {}; - copyState(this, o); - this.aStack_.push(o); - this.mStack_.push(this.m_); - this.m_ = matrixMultiply(createMatrixIdentity(), this.m_); - }; - - contextPrototype.restore = function() { - if (this.aStack_.length) { - copyState(this.aStack_.pop(), this); - this.m_ = this.mStack_.pop(); - } - }; - - function matrixIsFinite(m) { - return isFinite(m[0][0]) && isFinite(m[0][1]) && - isFinite(m[1][0]) && isFinite(m[1][1]) && - isFinite(m[2][0]) && isFinite(m[2][1]); - } - - function setM(ctx, m, updateLineScale) { - if (!matrixIsFinite(m)) { - return; - } - ctx.m_ = m; - - if (updateLineScale) { - // Get the line scale. - // Determinant of this.m_ means how much the area is enlarged by the - // transformation. So its square root can be used as a scale factor - // for width. - var det = m[0][0] * m[1][1] - m[0][1] * m[1][0]; - ctx.lineScale_ = sqrt(abs(det)); - } - } - - contextPrototype.translate = function(aX, aY) { - var m1 = [ - [1, 0, 0], - [0, 1, 0], - [aX, aY, 1] - ]; - - setM(this, matrixMultiply(m1, this.m_), false); - }; - - contextPrototype.rotate = function(aRot) { - var c = mc(aRot); - var s = ms(aRot); - - var m1 = [ - [c, s, 0], - [-s, c, 0], - [0, 0, 1] - ]; - - setM(this, matrixMultiply(m1, this.m_), false); - }; - - contextPrototype.scale = function(aX, aY) { - this.arcScaleX_ *= aX; - this.arcScaleY_ *= aY; - var m1 = [ - [aX, 0, 0], - [0, aY, 0], - [0, 0, 1] - ]; - - setM(this, matrixMultiply(m1, this.m_), true); - }; - - contextPrototype.transform = function(m11, m12, m21, m22, dx, dy) { - var m1 = [ - [m11, m12, 0], - [m21, m22, 0], - [dx, dy, 1] - ]; - - setM(this, matrixMultiply(m1, this.m_), true); - }; - - contextPrototype.setTransform = function(m11, m12, m21, m22, dx, dy) { - var m = [ - [m11, m12, 0], - [m21, m22, 0], - [dx, dy, 1] - ]; - - setM(this, m, true); - }; - - /** - * The text drawing function. - * The maxWidth argument isn't taken in account, since no browser supports - * it yet. - */ - contextPrototype.drawText_ = function(text, x, y, maxWidth, stroke) { - var m = this.m_, - delta = 1000, - left = 0, - right = delta, - offset = {x: 0, y: 0}, - lineStr = []; - - var fontStyle = getComputedStyle(processFontStyle(this.font), - this.element_); - - var fontStyleString = buildStyle(fontStyle); - - var elementStyle = this.element_.currentStyle; - var textAlign = this.textAlign.toLowerCase(); - switch (textAlign) { - case 'left': - case 'center': - case 'right': - break; - case 'end': - textAlign = elementStyle.direction == 'ltr' ? 'right' : 'left'; - break; - case 'start': - textAlign = elementStyle.direction == 'rtl' ? 'right' : 'left'; - break; - default: - textAlign = 'left'; - } - - // 1.75 is an arbitrary number, as there is no info about the text baseline - switch (this.textBaseline) { - case 'hanging': - case 'top': - offset.y = fontStyle.size / 1.75; - break; - case 'middle': - break; - default: - case null: - case 'alphabetic': - case 'ideographic': - case 'bottom': - offset.y = -fontStyle.size / 2.25; - break; - } - - switch(textAlign) { - case 'right': - left = delta; - right = 0.05; - break; - case 'center': - left = right = delta / 2; - break; - } - - var d = getCoords(this, x + offset.x, y + offset.y); - - lineStr.push(''); - - if (stroke) { - appendStroke(this, lineStr); - } else { - // TODO: Fix the min and max params. - appendFill(this, lineStr, {x: -left, y: 0}, - {x: right, y: fontStyle.size}); - } - - var skewM = m[0][0].toFixed(3) + ',' + m[1][0].toFixed(3) + ',' + - m[0][1].toFixed(3) + ',' + m[1][1].toFixed(3) + ',0,0'; - - var skewOffset = mr(d.x / Z) + ',' + mr(d.y / Z); - - lineStr.push('', - '', - ''); - - this.element_.insertAdjacentHTML('beforeEnd', lineStr.join('')); - }; - - contextPrototype.fillText = function(text, x, y, maxWidth) { - this.drawText_(text, x, y, maxWidth, false); - }; - - contextPrototype.strokeText = function(text, x, y, maxWidth) { - this.drawText_(text, x, y, maxWidth, true); - }; - - contextPrototype.measureText = function(text) { - if (!this.textMeasureEl_) { - var s = ''; - this.element_.insertAdjacentHTML('beforeEnd', s); - this.textMeasureEl_ = this.element_.lastChild; - } - var doc = this.element_.ownerDocument; - this.textMeasureEl_.innerHTML = ''; - this.textMeasureEl_.style.font = this.font; - // Don't use innerHTML or innerText because they allow markup/whitespace. - this.textMeasureEl_.appendChild(doc.createTextNode(text)); - return {width: this.textMeasureEl_.offsetWidth}; - }; - - /******** STUBS ********/ - contextPrototype.clip = function() { - // TODO: Implement - }; - - contextPrototype.arcTo = function() { - // TODO: Implement - }; - - contextPrototype.createPattern = function(image, repetition) { - return new CanvasPattern_(image, repetition); - }; - - // Gradient / Pattern Stubs - function CanvasGradient_(aType) { - this.type_ = aType; - this.x0_ = 0; - this.y0_ = 0; - this.r0_ = 0; - this.x1_ = 0; - this.y1_ = 0; - this.r1_ = 0; - this.colors_ = []; - } - - CanvasGradient_.prototype.addColorStop = function(aOffset, aColor) { - aColor = processStyle(aColor); - this.colors_.push({offset: aOffset, - color: aColor.color, - alpha: aColor.alpha}); - }; - - function CanvasPattern_(image, repetition) { - assertImageIsValid(image); - switch (repetition) { - case 'repeat': - case null: - case '': - this.repetition_ = 'repeat'; - break - case 'repeat-x': - case 'repeat-y': - case 'no-repeat': - this.repetition_ = repetition; - break; - default: - throwException('SYNTAX_ERR'); - } - - this.src_ = image.src; - this.width_ = image.width; - this.height_ = image.height; - } - - function throwException(s) { - throw new DOMException_(s); - } - - function assertImageIsValid(img) { - if (!img || img.nodeType != 1 || img.tagName != 'IMG') { - throwException('TYPE_MISMATCH_ERR'); - } - if (img.readyState != 'complete') { - throwException('INVALID_STATE_ERR'); - } - } - - function DOMException_(s) { - this.code = this[s]; - this.message = s +': DOM Exception ' + this.code; - } - var p = DOMException_.prototype = new Error; - p.INDEX_SIZE_ERR = 1; - p.DOMSTRING_SIZE_ERR = 2; - p.HIERARCHY_REQUEST_ERR = 3; - p.WRONG_DOCUMENT_ERR = 4; - p.INVALID_CHARACTER_ERR = 5; - p.NO_DATA_ALLOWED_ERR = 6; - p.NO_MODIFICATION_ALLOWED_ERR = 7; - p.NOT_FOUND_ERR = 8; - p.NOT_SUPPORTED_ERR = 9; - p.INUSE_ATTRIBUTE_ERR = 10; - p.INVALID_STATE_ERR = 11; - p.SYNTAX_ERR = 12; - p.INVALID_MODIFICATION_ERR = 13; - p.NAMESPACE_ERR = 14; - p.INVALID_ACCESS_ERR = 15; - p.VALIDATION_ERR = 16; - p.TYPE_MISMATCH_ERR = 17; - - // set up externs - G_vmlCanvasManager = G_vmlCanvasManager_; - CanvasRenderingContext2D = CanvasRenderingContext2D_; - CanvasGradient = CanvasGradient_; - CanvasPattern = CanvasPattern_; - DOMException = DOMException_; -})(); - -} // if -else { // make the canvas test simple by kener.linfeng@gmail.com - G_vmlCanvasManager = false; -} -return G_vmlCanvasManager; -}); // define; -/** - * zrender: 公共辅助函数 - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * clone:深度克隆 - * merge:合并源对象的属性到目标对象 - * getContext:获取一个自由使用的canvas 2D context,使用原生方法,如isPointInPath,measureText等 - */ -define( - 'zrender/tool/util',['require','../lib/excanvas'],function(require) { - // 用于处理merge时无法遍历Date等对象的问题 - var BUILTIN_OBJECT = { - '[object Function]': 1, - '[object RegExp]': 1, - '[object Date]': 1, - '[object Error]': 1, - '[object CanvasGradient]': 1 - }; - - /** - * 对一个object进行深度拷贝 - * - * @param {Any} source 需要进行拷贝的对象 - * @return {Any} 拷贝后的新对象 - */ - function clone(source) { - if (typeof source == 'object' && source !== null) { - var result = source; - if (source instanceof Array) { - result = []; - for (var i = 0, len = source.length; i < len; i++) { - result[i] = clone(source[i]); - } - } - else if (!BUILTIN_OBJECT[Object.prototype.toString.call(source)]) { - result = {}; - for (var key in source) { - if (source.hasOwnProperty(key)) { - result[key] = clone(source[key]); - } - } - } - - return result; - } - - return source; - } - - function mergeItem(target, source, key, overwrite) { - if (source.hasOwnProperty(key)) { - if (typeof target[key] == 'object' - && !BUILTIN_OBJECT[ Object.prototype.toString.call(target[key]) ] - ) { - // 如果需要递归覆盖,就递归调用merge - merge( - target[key], - source[key], - overwrite - ); - } - else if (overwrite || !(key in target)) { - // 否则只处理overwrite为true,或者在目标对象中没有此属性的情况 - target[key] = source[key]; - } - } - } - - /** - * 合并源对象的属性到目标对象 - * modify from Tangram - * @param {*} target 目标对象 - * @param {*} source 源对象 - * @param {boolean} overwrite 是否覆盖 - */ - function merge(target, source, overwrite) { - for (var i in source) { - mergeItem(target, source, i, overwrite); - } - - return target; - } - - var _ctx; - - function getContext() { - if (!_ctx) { - require('../lib/excanvas'); - if (G_vmlCanvasManager) { - var _div = document.createElement('div'); - _div.style.position = 'absolute'; - _div.style.top = '-1000px'; - document.body.appendChild(_div); - - _ctx = G_vmlCanvasManager.initElement(_div) - .getContext('2d'); - } - else { - _ctx = document.createElement('canvas').getContext('2d'); - } - } - return _ctx; - } - - var _canvas; - var _pixelCtx; - var _width; - var _height; - var _offsetX = 0; - var _offsetY = 0; - - /** - * 获取像素拾取专用的上下文 - * @return {Object} 上下文 - */ - function getPixelContext() { - if (!_pixelCtx) { - _canvas = document.createElement('canvas'); - _width = _canvas.width; - _height = _canvas.height; - _pixelCtx = _canvas.getContext('2d'); - } - return _pixelCtx; - } - - /** - * 如果坐标处在_canvas外部,改变_canvas的大小 - * @param {number} x : 横坐标 - * @param {number} y : 纵坐标 - * 注意 修改canvas的大小 需要重新设置translate - */ - function adjustCanvasSize(x, y) { - // 每次加的长度 - var _v = 100; - var _flag; - - if (x + _offsetX > _width) { - _width = x + _offsetX + _v; - _canvas.width = _width; - _flag = true; - } - - if (y + _offsetY > _height) { - _height = y + _offsetY + _v; - _canvas.height = _height; - _flag = true; - } - - if (x < -_offsetX) { - _offsetX = Math.ceil(-x / _v) * _v; - _width += _offsetX; - _canvas.width = _width; - _flag = true; - } - - if (y < -_offsetY) { - _offsetY = Math.ceil(-y / _v) * _v; - _height += _offsetY; - _canvas.height = _height; - _flag = true; - } - - if (_flag) { - _pixelCtx.translate(_offsetX, _offsetY); - } - } - - /** - * 获取像素canvas的偏移量 - * @return {Object} 偏移量 - */ - function getPixelOffset() { - return { - x : _offsetX, - y : _offsetY - }; - } - - /** - * 查询数组中元素的index - */ - function indexOf(array, value){ - if (array.indexOf) { - return array.indexOf(value); - } - for(var i = 0, len=array.length; i 3) { - args = Array.prototype.slice.call(args, 1); - } - - if(this._handlers[type]) { - var _h = this._handlers[type]; - var len = _h.length; - for (var i = 0; i < len;) { - // Optimize advise from backbone - switch (argLen) { - case 1: - _h[i]['h'].call(_h[i]['ctx']); - break; - case 2: - _h[i]['h'].call(_h[i]['ctx'], args[1]); - break; - case 3: - _h[i]['h'].call(_h[i]['ctx'], args[1], args[2]); - break; - default: - // have more than 2 given arguments - _h[i]['h'].apply(_h[i]['ctx'], args); - break; - } - - if (_h[i]['one']) { - _h.splice(i, 1); - len--; - } else { - i++; - } - } - } - - return this; - }; - - /** - * 带有context的事件分发, 最后一个参数是事件回调的context - * - * @param {string} type : 事件类型 - */ - Dispatcher.prototype.dispatchWithContext = function(type) { - var args = arguments; - var argLen = args.length; - - if (argLen > 4) { - args = Array.prototype.slice.call(args, 1, args.length - 1); - } - var ctx = args[args.length - 1]; - - if(this._handlers[type]) { - var _h = this._handlers[type]; - var len = _h.length; - for (var i = 0; i < len;) { - // Optimize advise from backbone - switch (argLen) { - case 1: - _h[i]['h'].call(ctx); - break; - case 2: - _h[i]['h'].call(ctx, args[1]); - break; - case 3: - _h[i]['h'].call(ctx, args[1], args[2]); - break; - default: - // have more than 2 given arguments - _h[i]['h'].apply(ctx, args); - break; - } - - if (_h[i]['one']) { - _h.splice(i, 1); - len--; - } else { - i++; - } - } - } - - return this; - }; - - return { - getX : getX, - getY : getY, - getDelta : getDelta, - stop : stop, - Dispatcher : Dispatcher - }; - } -); - -/** - * echarts设备环境识别 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author firede[firede@firede.us] - * @desc thanks zepto. - */ -define('zrender/tool/env',[],function() { - // Zepto.js - // (c) 2010-2013 Thomas Fuchs - // Zepto.js may be freely distributed under the MIT license. - - function detect( ua ) { - var os = this.os = {}; - var browser = this.browser = {}; - var webkit = ua.match(/Web[kK]it[\/]{0,1}([\d.]+)/); - var android = ua.match(/(Android);?[\s\/]+([\d.]+)?/); - var ipad = ua.match(/(iPad).*OS\s([\d_]+)/); - var ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/); - var iphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/); - var webos = ua.match(/(webOS|hpwOS)[\s\/]([\d.]+)/); - var touchpad = webos && ua.match(/TouchPad/); - var kindle = ua.match(/Kindle\/([\d.]+)/); - var silk = ua.match(/Silk\/([\d._]+)/); - var blackberry = ua.match(/(BlackBerry).*Version\/([\d.]+)/); - var bb10 = ua.match(/(BB10).*Version\/([\d.]+)/); - var rimtabletos = ua.match(/(RIM\sTablet\sOS)\s([\d.]+)/); - var playbook = ua.match(/PlayBook/); - var chrome = ua.match(/Chrome\/([\d.]+)/) || ua.match(/CriOS\/([\d.]+)/); - var firefox = ua.match(/Firefox\/([\d.]+)/); - var ie = ua.match(/MSIE ([\d.]+)/); - var safari = webkit && ua.match(/Mobile\//) && !chrome; - var webview = ua.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/) && !chrome; - var ie = ua.match(/MSIE\s([\d.]+)/); - - // Todo: clean this up with a better OS/browser seperation: - // - discern (more) between multiple browsers on android - // - decide if kindle fire in silk mode is android or not - // - Firefox on Android doesn't specify the Android version - // - possibly devide in os, device and browser hashes - - if (browser.webkit = !!webkit) browser.version = webkit[1]; - - if (android) os.android = true, os.version = android[2]; - if (iphone && !ipod) os.ios = os.iphone = true, os.version = iphone[2].replace(/_/g, '.'); - if (ipad) os.ios = os.ipad = true, os.version = ipad[2].replace(/_/g, '.'); - if (ipod) os.ios = os.ipod = true, os.version = ipod[3] ? ipod[3].replace(/_/g, '.') : null; - if (webos) os.webos = true, os.version = webos[2]; - if (touchpad) os.touchpad = true; - if (blackberry) os.blackberry = true, os.version = blackberry[2]; - if (bb10) os.bb10 = true, os.version = bb10[2]; - if (rimtabletos) os.rimtabletos = true, os.version = rimtabletos[2]; - if (playbook) browser.playbook = true; - if (kindle) os.kindle = true, os.version = kindle[1]; - if (silk) browser.silk = true, browser.version = silk[1]; - if (!silk && os.android && ua.match(/Kindle Fire/)) browser.silk = true; - if (chrome) browser.chrome = true, browser.version = chrome[1]; - if (firefox) browser.firefox = true, browser.version = firefox[1]; - if (ie) browser.ie = true, browser.version = ie[1]; - if (safari && (ua.match(/Safari/) || !!os.ios)) browser.safari = true; - if (webview) browser.webview = true; - if (ie) browser.ie = true, browser.version = ie[1]; - - os.tablet = !!(ipad || playbook || (android && !ua.match(/Mobile/)) || - (firefox && ua.match(/Tablet/)) || (ie && !ua.match(/Phone/) && ua.match(/Touch/))); - os.phone = !!(!os.tablet && !os.ipod && (android || iphone || webos || blackberry || bb10 || - (chrome && ua.match(/Android/)) || (chrome && ua.match(/CriOS\/([\d.]+)/)) || - (firefox && ua.match(/Mobile/)) || (ie && ua.match(/Touch/)))); - - return { - browser: browser, - os: os, - // 原生canvas支持 - canvasSupported : document.createElement('canvas').getContext - ? true : false - } - } - - return detect( navigator.userAgent ); -}); -/** - * zrender: config默认配置项 - * - * @desc zrender是一个轻量级的Canvas类库,MVC封装,数据驱动,提供类Dom事件模型。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define( - 'zrender/config',{ - EVENT : { // 支持事件列表 - RESIZE : 'resize', // 窗口大小变化 - CLICK : 'click', // 鼠标按钮被(手指)按下,事件对象是:目标图形元素或空 - - MOUSEWHEEL : 'mousewheel', // 鼠标滚轮变化,事件对象是:目标图形元素或空 - MOUSEMOVE : 'mousemove', // 鼠标(手指)被移动,事件对象是:目标图形元素或空 - MOUSEOVER : 'mouseover', // 鼠标移到某图形元素之上,事件对象是:目标图形元素 - MOUSEOUT : 'mouseout', // 鼠标从某图形元素移开,事件对象是:目标图形元素 - MOUSEDOWN : 'mousedown', // 鼠标按钮(手指)被按下,事件对象是:目标图形元素或空 - MOUSEUP : 'mouseup', // 鼠标按键(手指)被松开,事件对象是:目标图形元素或空 - - // - GLOBALOUT : 'globalout', // 全局离开,MOUSEOUT触发比较频繁,一次离开优化绑定 - - // 一次成功元素拖拽的行为事件过程是: - // dragstart > dragenter > dragover [> dragleave] > drop > dragend - DRAGSTART : 'dragstart', // 开始拖拽时触发,事件对象是:被拖拽图形元素 - DRAGEND : 'dragend', // 拖拽完毕时触发(在drop之后触发),事件对象是:被拖拽图形元素 - DRAGENTER : 'dragenter', // 拖拽图形元素进入目标图形元素时触发,事件对象是:目标图形元素 - DRAGOVER : 'dragover', // 拖拽图形元素在目标图形元素上移动时触发,事件对象是:目标图形元素 - DRAGLEAVE : 'dragleave', // 拖拽图形元素离开目标图形元素时触发,事件对象是:目标图形元素 - DROP : 'drop', // 拖拽图形元素放在目标图形元素内时触发,事件对象是:目标图形元素 - - touchClickDelay : 300 // touch end - start < delay is click - }, - - // 是否异常捕获 - catchBrushException: false, - - /** - * debug日志选项:catchBrushException为true下有效 - * 0 : 不生成debug数据,发布用 - * 1 : 异常抛出,调试用 - * 2 : 控制台输出,调试用 - */ - debugMode: 0 - } -); -/** - * zrender: 日志记录 - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - */ - -define( - 'zrender/tool/log',['require','../config'],function (require) { - var config = require('../config'); - - return function() { - if (config.debugMode === 0) { - return; - } - else if (config.debugMode == 1) { - for (var k in arguments) { - throw new Error(arguments[k]); - } - } - else if (config.debugMode > 1) { - for (var k in arguments) { - console.log(arguments[k]); - } - } - }; - - /* for debug - return function(mes) { - document.getElementById('wrong-message').innerHTML = - mes + ' ' + (new Date() - 0) - + '
' - + document.getElementById('wrong-message').innerHTML; - }; - */ - } -); - -/** - * zrender: 生成唯一id - * - * @author errorrik (errorrik@gmail.com) - */ - -define( - 'zrender/tool/guid',[],function() { - var idStart = 0x0907; - - return function () { - return 'zrender__' + (idStart++); - }; - } -); - -/** - * Handler控制模块 - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * errorrik (errorrik@gmail.com) - */ - -define( - 'zrender/Handler',['require','./config','./tool/env','./tool/event','./tool/util'],function (require) { - - - - var config = require('./config'); - var env = require('./tool/env'); - var eventTool = require('./tool/event'); - var util = require('./tool/util'); - var EVENT = config.EVENT; - - var domHandlerNames = [ - 'resize', 'click', - 'mousewheel', 'mousemove', 'mouseout', 'mouseup', 'mousedown', - 'touchstart', 'touchend', 'touchmove' - ]; - - var domHandlers = { - /** - * 窗口大小改变响应函数 - * - * @param {event} event dom事件对象 - */ - resize: function (event) { - event = event || window.event; - this._lastHover = null; - this._isMouseDown = 0; - - // 分发config.EVENT.RESIZE事件,global - this.dispatch(EVENT.RESIZE, event); - }, - - /** - * 点击响应函数 - * - * @param {event} event dom事件对象 - */ - click: function (event) { - event = this._zrenderEventFixed(event); - - //分发config.EVENT.CLICK事件 - var _lastHover = this._lastHover; - if (( _lastHover && _lastHover.clickable ) - || !_lastHover - ) { - this._dispatchAgency(_lastHover, EVENT.CLICK, event); - } - - this._mousemoveHandler(event); - }, - - /** - * 鼠标滚轮响应函数 - * - * @param {event} event dom事件对象 - */ - mousewheel: function (event) { - event = this._zrenderEventFixed(event); - - //分发config.EVENT.MOUSEWHEEL事件 - this._dispatchAgency(this._lastHover, EVENT.MOUSEWHEEL, event); - this._mousemoveHandler(event); - }, - - /** - * 鼠标(手指)移动响应函数 - * - * @param {event} event dom事件对象 - */ - mousemove: function (event) { - if (this.painter.isLoading()) { - return; - } - - event = this._zrenderEventFixed(event); - this._lastX = this._mouseX; - this._lastY = this._mouseY; - this._mouseX = eventTool.getX(event); - this._mouseY = eventTool.getY(event); - - // 可能出现config.EVENT.DRAGSTART事件 - // 避免手抖点击误认为拖拽 - //if (this._mouseX - this._lastX > 1 || this._mouseY - this._lastY > 1) { - this._processDragStart(event); - //} - this._hasfound = 0; - this._event = event; - this.storage.iterShape(this._findHover, { normal: 'down'}); - - // 找到的在迭代函数里做了处理,没找到得在迭代完后处理 - if (!this._hasfound) { - // 过滤首次拖拽产生的mouseout和dragLeave - if (!this._draggingTarget - || (this._lastHover && this._lastHover != this._draggingTarget) - ) { - // 可能出现config.EVENT.MOUSEOUT事件 - this._processOutShape(event); - - // 可能出现config.EVENT.DRAGLEAVE事件 - this._processDragLeave(event); - } - - this._lastHover = null; - this.storage.delHover(); - this.painter.clearHover(); - } - //如果存在拖拽中元素,被拖拽的图形元素最后addHover - if (this._draggingTarget) { - this.storage.drift( - this._draggingTarget.id, - this._mouseX - this._lastX, - this._mouseY - this._lastY - ); - this.storage.addHover(this._draggingTarget); - } - - // set cursor for root element - var cursor = 'default'; - if (this._draggingTarget || (this._hasfound && this._lastHover.draggable)) { - cursor = 'move'; - } - else if (this._hasfound && this._lastHover.clickable) { - cursor = 'pointer'; - } - this.root.style.cursor = cursor; - - // 分发config.EVENT.MOUSEMOVE事件 - this._dispatchAgency(this._lastHover, EVENT.MOUSEMOVE, event); - - if (this._draggingTarget || this._hasfound || this.storage.hasHoverShape()) { - this.painter.refreshHover(); - } - }, - - /** - * 鼠标(手指)离开响应函数 - * - * @param {event} event dom事件对象 - */ - mouseout: function (event) { - event = this._zrenderEventFixed(event); - - var element = event.toElement || event.relatedTarget; - if (element != this.root) { - while (element && element.nodeType != 9) { - // 忽略包含在root中的dom引起的mouseOut - if (element == this.root) { - this._mousemoveHandler(event); - return; - } - - element = element.parentNode; - } - } - - event.zrenderX = this._lastX; - event.zrenderY = this._lastY; - this.root.style.cursor = 'default'; - this._isMouseDown = 0; - - this._processOutShape(event); - this._processDrop(event); - this._processDragEnd(event); - if (!this.painter.isLoading()) { - this.painter.refreshHover(); - } - - this.dispatch(EVENT.GLOBALOUT, event); - }, - - /** - * 鼠标(手指)按下响应函数 - * - * @param {event} event dom事件对象 - */ - mousedown: function (event) { - if (this._lastDownButton == 2) { - this._lastDownButton = event.button; - this._mouseDownTarget = null; - // 仅作为关闭右键菜单使用 - return; - } - - this._lastMouseDownMoment = new Date(); - event = this._zrenderEventFixed(event); - this._isMouseDown = 1; - - //分发config.EVENT.MOUSEDOWN事件 - this._mouseDownTarget = this._lastHover; - this._dispatchAgency(this._lastHover, EVENT.MOUSEDOWN, event); - this._lastDownButton = event.button; - }, - - /** - * 鼠标(手指)抬起响应函数 - * - * @param {event} event dom事件对象 - */ - mouseup:function (event) { - event = this._zrenderEventFixed(event); - this.root.style.cursor = 'default'; - this._isMouseDown = 0; - this._mouseDownTarget = null; - - //分发config.EVENT.MOUSEUP事件 - this._dispatchAgency(this._lastHover, EVENT.MOUSEUP, event); - this._processDrop(event); - this._processDragEnd(event); - }, - - /** - * Touch开始响应函数 - * - * @param {event} event dom事件对象 - */ - touchstart: function (event) { - //eventTool.stop(event);// 阻止浏览器默认事件,重要 - event = this._zrenderEventFixed(event, true); - this._lastTouchMoment = new Date(); - - //平板补充一次findHover - this._mobildFindFixed(event); - this._mousedownHandler(event); - }, - - /** - * Touch移动响应函数 - * - * @param {event} event dom事件对象 - */ - touchmove: function (event) { - event = this._zrenderEventFixed(event, true); - this._mousemoveHandler(event); - if (this._isDragging) { - eventTool.stop(event);// 阻止浏览器默认事件,重要 - } - }, - - /** - * Touch结束响应函数 - * - * @param {event} event dom事件对象 - */ - touchend: function (event) { - //eventTool.stop(event);// 阻止浏览器默认事件,重要 - event = this._zrenderEventFixed(event, true); - this._mouseupHandler(event); - - if (new Date() - this._lastTouchMoment < EVENT.touchClickDelay) { - this._mobildFindFixed(event); - this._clickHandler(event); - } - this.painter.clearHover(); - } - }; - - /** - * bind一个参数的function - * - * @inner - * @param {Function} handler 要bind的function - * @param {Object} context 运行时this环境 - * @return {Function} - */ - function bind1Arg( handler, context ) { - return function ( e ) { - return handler.call( context, e ); - }; - } - - /** - * 为控制类实例初始化dom 事件处理函数 - * - * @inner - * @param {Handler} instance 控制类实例 - */ - function initDomHandler( instance ) { - var len = domHandlerNames.length; - while ( len-- ) { - var name = domHandlerNames[ len ]; - instance[ '_' + name + 'Handler' ] = bind1Arg( domHandlers[ name ], instance ); - } - } - - /** - * 控制类 (C) - * - * @param {HTMLElement} root 绘图区域 - * @param {storage} storage Storage实例 - * @param {painter} painter Painter实例 - * - * 分发事件支持详见config.EVENT - */ - function Handler(root, storage, painter) { - // 添加事件分发器特性 - eventTool.Dispatcher.call(this); - - this.root = root; - this.storage = storage; - this.painter = painter; - - // 各种事件标识的私有变量 - // this._hasfound = false; //是否找到hover图形元素 - // this._lastHover = null; //最后一个hover图形元素 - // this._mouseDownTarget = null; - // this._draggingTarget = null; //当前被拖拽的图形元素 - // this._isMouseDown = false; - // this._isDragging = false; - // this._lastMouseDownMoment; - // this._lastTouchMoment; - // this._lastDownButton; - - this._lastX = - this._lastY = - this._mouseX = - this._mouseY = 0; - - this._findHover = bind1Arg(findHover, this); - this._domHover = painter.getDomHover(); - initDomHandler(this); - - // 初始化,事件绑定,支持的所有事件都由如下原生事件计算得来 - if (window.addEventListener) { - window.addEventListener('resize', this._resizeHandler); - - if (env.os.tablet || env.os.phone) { - // mobile支持 - root.addEventListener('touchstart', this._touchstartHandler); - root.addEventListener('touchmove', this._touchmoveHandler); - root.addEventListener('touchend', this._touchendHandler); - } - else { - // mobile的click/move/up/down自己模拟 - root.addEventListener('click', this._clickHandler); - root.addEventListener('mousewheel', this._mousewheelHandler); - root.addEventListener('mousemove', this._mousemoveHandler); - root.addEventListener('mousedown', this._mousedownHandler); - root.addEventListener('mouseup', this._mouseupHandler); - } - root.addEventListener('DOMMouseScroll', this._mousewheelHandler); - root.addEventListener('mouseout', this._mouseoutHandler); - } - else { - window.attachEvent('onresize', this._resizeHandler); - - root.attachEvent('onclick', this._clickHandler); - root.attachEvent('onmousewheel', this._mousewheelHandler); - root.attachEvent('onmousemove', this._mousemoveHandler); - root.attachEvent('onmouseout', this._mouseoutHandler); - root.attachEvent('onmousedown', this._mousedownHandler); - root.attachEvent('onmouseup', this._mouseupHandler); - } - } - - /** - * 自定义事件绑定 - * @param {string} eventName 事件名称,resize,hover,drag,etc~ - * @param {Function} handler 响应函数 - */ - Handler.prototype.on = function (eventName, handler) { - this.bind(eventName, handler); - return this; - }; - - /** - * 自定义事件解绑 - * @param {string} eventName 事件名称,resize,hover,drag,etc~ - * @param {Function} handler 响应函数 - */ - Handler.prototype.un = function (eventName, handler) { - this.unbind(eventName, handler); - return this; - }; - - /** - * 事件触发 - * @param {string} eventName 事件名称,resize,hover,drag,etc~ - * @param {event=} eventArgs event dom事件对象 - */ - Handler.prototype.trigger = function (eventName, eventArgs) { - switch (eventName) { - case EVENT.RESIZE: - case EVENT.CLICK: - case EVENT.MOUSEWHEEL: - case EVENT.MOUSEMOVE: - case EVENT.MOUSEDOWN: - case EVENT.MOUSEUP: - case EVENT.MOUSEOUT: - this['_' + eventName + 'Handler'](eventArgs); - break; - } - }; - - /** - * 释放 - */ - Handler.prototype.dispose = function () { - var root = this.root; - - if (window.removeEventListener) { - window.removeEventListener('resize', this._resizeHandler); - - if (env.os.tablet || env.os.phone) { - // mobile支持 - root.removeEventListener('touchstart', this._touchstartHandler); - root.removeEventListener('touchmove', this._touchmoveHandler); - root.removeEventListener('touchend', this._touchendHandler); - } - else { - // mobile的click自己模拟 - root.removeEventListener('click', this._clickHandler); - root.removeEventListener('mousewheel', this._mousewheelHandler); - root.removeEventListener('mousemove', this._mousemoveHandler); - root.removeEventListener('mousedown', this._mousedownHandler); - root.removeEventListener('mouseup', this._mouseupHandler); - } - root.removeEventListener('DOMMouseScroll', this._mousewheelHandler); - root.removeEventListener('mouseout', this._mouseoutHandler); - } - else { - window.detachEvent('onresize', this._resizeHandler); - - root.detachEvent('onclick', this._clickHandler); - root.detachEvent('onmousewheel', this._mousewheelHandler); - root.detachEvent('onmousemove', this._mousemoveHandler); - root.detachEvent('onmouseout', this._mouseoutHandler); - root.detachEvent('onmousedown', this._mousedownHandler); - root.detachEvent('onmouseup', this._mouseupHandler); - } - - this.root = - this._domHover = - this.storage = - this.painter = null; - - this.un(); - }; - - /** - * 拖拽开始 - * - * @private - * @param {Object} event 事件对象 - */ - Handler.prototype._processDragStart = function (event) { - var _lastHover = this._lastHover; - - if (this._isMouseDown - && _lastHover - && _lastHover.draggable - && !this._draggingTarget - && this._mouseDownTarget == _lastHover - ) { - // 拖拽点击生效时长阀门,某些场景需要降低拖拽敏感度 - if (_lastHover.dragEnableTime && - new Date() - this._lastMouseDownMoment < _lastHover.dragEnableTime - ) { - return; - } - - var _draggingTarget = _lastHover; - this._draggingTarget = _draggingTarget; - this._isDragging = 1; - - _draggingTarget.invisible = true; - this.storage.mod(_draggingTarget.id); - - //分发config.EVENT.DRAGSTART事件 - this._dispatchAgency( - _draggingTarget, - EVENT.DRAGSTART, - event - ); - this.painter.refresh(); - } - }; - - /** - * 拖拽进入目标元素 - * - * @private - * @param {Object} event 事件对象 - */ - Handler.prototype._processDragEnter = function (event) { - if (this._draggingTarget) { - //分发config.EVENT.DRAGENTER事件 - this._dispatchAgency( - this._lastHover, - EVENT.DRAGENTER, - event, - this._draggingTarget - ); - } - }; - - /** - * 拖拽在目标元素上移动 - * - * @private - * @param {Object} event 事件对象 - */ - Handler.prototype._processDragOver = function (event) { - if (this._draggingTarget) { - //分发config.EVENT.DRAGOVER事件 - this._dispatchAgency( - this._lastHover, - EVENT.DRAGOVER, - event, - this._draggingTarget - ); - } - }; - - /** - * 拖拽离开目标元素 - * - * @private - * @param {Object} event 事件对象 - */ - Handler.prototype._processDragLeave = function (event) { - if (this._draggingTarget) { - //分发config.EVENT.DRAGLEAVE事件 - this._dispatchAgency( - this._lastHover, - EVENT.DRAGLEAVE, - event, - this._draggingTarget - ); - } - }; - - /** - * 拖拽在目标元素上完成 - * - * @private - * @param {Object} event 事件对象 - */ - Handler.prototype._processDrop = function (event) { - if (this._draggingTarget) { - this._draggingTarget.invisible = false; - this.storage.mod(this._draggingTarget.id); - this.painter.refresh(); - - //分发config.EVENT.DROP事件 - this._dispatchAgency( - this._lastHover, - EVENT.DROP, - event, - this._draggingTarget - ); - } - }; - - /** - * 拖拽结束 - * - * @private - * @param {Object} event 事件对象 - */ - Handler.prototype._processDragEnd = function (event) { - if (this._draggingTarget) { - //分发config.EVENT.DRAGEND事件 - this._dispatchAgency( - this._draggingTarget, - EVENT.DRAGEND, - event - ); - - this._lastHover = null; - } - - this._isDragging = 0; - this._draggingTarget = null; - }; - - /** - * 鼠标在某个图形元素上移动 - * - * @private - * @param {Object} event 事件对象 - */ - Handler.prototype._processOverShape = function (event) { - //分发config.EVENT.MOUSEOVER事件 - this._dispatchAgency(this._lastHover, EVENT.MOUSEOVER, event); - }; - - /** - * 鼠标离开某个图形元素 - * - * @private - * @param {Object} event 事件对象 - */ - Handler.prototype._processOutShape = function (event) { - //分发config.EVENT.MOUSEOUT事件 - this._dispatchAgency(this._lastHover, EVENT.MOUSEOUT, event); - }; - - /** - * 事件分发代理 - * - * @private - * @param {Object} targetShape 目标图形元素 - * @param {string} eventName 事件名称 - * @param {Object} event 事件对象 - * @param {Object=} draggedShape 拖拽事件特有,当前被拖拽图形元素 - */ - Handler.prototype._dispatchAgency = function (targetShape, eventName, event, draggedShape) { - var eventHandler = 'on' + eventName; - var eventPacket = { - type : eventName, - event : event, - target : targetShape, - cancelBubble: false - }; - - var el = targetShape; - - if (draggedShape) { - eventPacket.dragged = draggedShape; - } - - while (el) { - el[eventHandler] && el[eventHandler](eventPacket); - el.dispatch(eventName, eventPacket); - - el = el.parent; - - if (eventPacket.cancelBubble) { - break; - } - } - - if (targetShape) { - // 冒泡到顶级 zrender 对象 - if (!eventPacket.cancelBubble) { - this.dispatch(eventName, eventPacket); - } - } - else if (!draggedShape) { - //无hover目标,无拖拽对象,原生事件分发 - this.dispatch(eventName, { - type: eventName, - event: event - }); - } - }; - - // touch指尖错觉的尝试偏移量配置 - var MOBILE_TOUCH_OFFSETS = [ - { x: 10 }, - { x: -20 }, - { x: 10, y: 10}, - { y: -20} - ]; - - // touch有指尖错觉,四向尝试,让touch上的点击更好触发事件 - Handler.prototype._mobildFindFixed = function (event) { - this._lastHover = null; - this._mouseX = event.zrenderX; - this._mouseY = event.zrenderY; - - this._event = event; - this.storage.iterShape(this._findHover, { normal: 'down'}); - for ( var i = 0; !this._lastHover && i < MOBILE_TOUCH_OFFSETS.length ; i++ ) { - var offset = MOBILE_TOUCH_OFFSETS[ i ]; - offset.x && ( this._mouseX += offset.x ); - offset.y && ( this._mouseX += offset.y ); - this.storage.iterShape(this._findHover, { normal: 'down'}); - } - - if (this._lastHover) { - event.zrenderX = this._mouseX; - event.zrenderY = this._mouseY; - } - }; - - /** - * 迭代函数,查找hover到的图形元素并即时做些事件分发 - * - * @private - * @param {Object} e 图形元素 - */ - function findHover(shape) { - if ( - ( this._draggingTarget && this._draggingTarget.id == shape.id ) //迭代到当前拖拽的图形上 - || shape.isSilent() // 打酱油的路过,啥都不响应的shape~ - ) { - return false; - } - - var event = this._event; - if (shape.isCover(this._mouseX, this._mouseY)) { - if (shape.hoverable) { - this.storage.addHover(shape); - } - // 查找是否在 clipShape 中 - var p = shape.parent; - while (p) { - if (p.clipShape && !p.clipShape.isCover(this._mouseX, this._mouseY)) { - // 已经被祖先 clip 掉了 - return false; - } - p = p.parent; - } - - if (this._lastHover != shape) { - this._processOutShape(event); - - //可能出现config.EVENT.DRAGLEAVE事件 - this._processDragLeave(event); - - this._lastHover = shape; - - //可能出现config.EVENT.DRAGENTER事件 - this._processDragEnter(event); - } - - this._processOverShape(event); - - //可能出现config.EVENT.DRAGOVER - this._processDragOver(event); - - this._hasfound = 1; - - return true; //找到则中断迭代查找 - } - - return false; - } - - /** - * 如果存在第三方嵌入的一些dom触发的事件,或touch事件,需要转换一下事件坐标 - * - * @private - */ - Handler.prototype._zrenderEventFixed = function (event, isTouch) { - if ( event.zrenderFixed ) { - return event; - } - - if (!isTouch) { - event = event || window.event; - // 进入对象优先~ - var target = event.toElement - || event.relatedTarget - || event.srcElement - || event.target; - - if (target && target != this._domHover) { - event.zrenderX = (typeof event.offsetX != 'undefined' - ? event.offsetX - : event.layerX) - + target.offsetLeft; - event.zrenderY = (typeof event.offsetY != 'undefined' - ? event.offsetY - : event.layerY) - + target.offsetTop; - } - } - else { - var touch = event.type != 'touchend' - ? event.targetTouches[0] - : event.changedTouches[0]; - if (touch) { - var rBounding = this.root.getBoundingClientRect(); - // touch事件坐标是全屏的~ - event.zrenderX = touch.clientX - rBounding.left; - event.zrenderY = touch.clientY - rBounding.top; - } - } - - event.zrenderFixed = 1; - return event; - }; - - util.merge(Handler.prototype, eventTool.Dispatcher.prototype, true); - - return Handler; - } -); - -/** - * zrender: 3x2矩阵操作类 - * - * author: https://github.com/pissang - */ - -define( - 'zrender/tool/matrix',[],function() { - - var ArrayCtor = typeof Float32Array === 'undefined' - ? Array - : Float32Array; - - var matrix = { - create : function() { - var out = new ArrayCtor(6); - matrix.identity(out); - - return out; - }, - identity : function(out) { - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 1; - out[4] = 0; - out[5] = 0; - }, - copy: function(out, m) { - out[0] = m[0]; - out[1] = m[1]; - out[2] = m[2]; - out[3] = m[3]; - out[4] = m[4]; - out[5] = m[5]; - }, - mul : function(out, m1, m2) { - out[0] = m1[0] * m2[0] + m1[2] * m2[1]; - out[1] = m1[1] * m2[0] + m1[3] * m2[1]; - out[2] = m1[0] * m2[2] + m1[2] * m2[3]; - out[3] = m1[1] * m2[2] + m1[3] * m2[3]; - out[4] = m1[0] * m2[4] + m1[2] * m2[5] + m1[4]; - out[5] = m1[1] * m2[4] + m1[3] * m2[5] + m1[5]; - return out; - }, - translate : function(out, a, v) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4] + v[0]; - out[5] = a[5] + v[1]; - return out; - }, - rotate : function(out, a, rad) { - var aa = a[0], ac = a[2], atx = a[4]; - var ab = a[1], ad = a[3], aty = a[5]; - var st = Math.sin(rad); - var ct = Math.cos(rad); - - out[0] = aa*ct + ab*st; - out[1] = -aa*st + ab*ct; - out[2] = ac*ct + ad*st; - out[3] = -ac*st + ct*ad; - out[4] = ct*atx + st*aty; - out[5] = ct*aty - st*atx; - return out; - }, - scale : function(out, a, v) { - var vx = v[0], vy = v[1]; - out[0] = a[0] * vx; - out[1] = a[1] * vy; - out[2] = a[2] * vx; - out[3] = a[3] * vy; - out[4] = a[4] * vx; - out[5] = a[5] * vy; - return out; - }, - /** - * 求逆矩阵 - */ - invert : function(out, a) { - - var aa = a[0], ac = a[2], atx = a[4]; - var ab = a[1], ad = a[3], aty = a[5]; - - var det = aa * ad - ab * ac; - if(!det){ - return null; - } - det = 1.0 / det; - - out[0] = ad * det; - out[1] = -ab * det; - out[2] = -ac * det; - out[3] = aa * det; - out[4] = (ac * aty - ad * atx) * det; - out[5] = (ab * atx - aa * aty) * det; - return out; - }, - - /** - * 矩阵左乘向量 - */ - mulVector : function(out, a, v) { - var aa = a[0], ac = a[2], atx = a[4]; - var ab = a[1], ad = a[3], aty = a[5]; - - out[0] = v[0] * aa + v[1] * ac + atx; - out[1] = v[0] * ab + v[1] * ad + aty; - - return out; - } - }; - - return matrix; - } -); -define('zrender/shape/mixin/Transformable',['require','../../tool/matrix'],function(require) { - - var matrix = require('../../tool/matrix'); - var origin = [0, 0]; - - var Transformable = function() { - - if (!this.position) { - this.position = [0, 0]; - } - if (typeof(this.rotation) == 'undefined') { - this.rotation = [0, 0, 0]; - } - if (!this.scale) { - this.scale = [1, 1, 0, 0]; - } - - this.needLocalTransform = false; - this.needTransform = false; - }; - - Transformable.prototype = { - - constructor: Transformable, - - updateNeedTransform: function() { - this.needLocalTransform = Math.abs(this.rotation[0]) > 0.0001 - || Math.abs(this.position[0]) > 0.0001 - || Math.abs(this.position[1]) > 0.0001 - || Math.abs(this.scale[0] - 1) > 0.0001 - || Math.abs(this.scale[1] - 1) > 0.0001; - }, - - updateTransform: function() { - - this.updateNeedTransform(); - - if (this.parent) { - this.needTransform = this.needLocalTransform || this.parent.needTransform; - } else { - this.needTransform = this.needLocalTransform; - } - - if (!this.needTransform) { - return; - } - - var m = this.transform || matrix.create(); - matrix.identity(m); - - if (this.needLocalTransform) { - if (this.scale && (this.scale[0] !== 1 || this.scale[1] !== 1)) { - origin[0] = -this.scale[2] || 0; - origin[1] = -this.scale[3] || 0; - if (origin[0] || origin[1]) { - matrix.translate( - m, m, origin - ); - } - matrix.scale(m, m, this.scale); - if (origin[0] || origin[1]) { - origin[0] = -origin[0]; - origin[1] = -origin[1]; - matrix.translate( - m, m, origin - ); - } - } - - if (this.rotation) { - if (this.rotation instanceof Array) { - if (this.rotation[0] !== 0) { - origin[0] = -this.rotation[1] || 0; - origin[1] = -this.rotation[2] || 0; - if (origin[0] || origin[1]) { - matrix.translate( - m, m, origin - ); - } - matrix.rotate(m, m, this.rotation[0]); - if (origin[0] || origin[1]) { - origin[0] = -origin[0]; - origin[1] = -origin[1]; - matrix.translate( - m, m, origin - ); - } - } - } - else { - if (this.rotation !== 0) { - matrix.rotate(m, m, this.rotation); - } - } - } - - if (this.position && (this.position[0] !==0 || this.position[1] !== 0)) { - matrix.translate(m, m, this.position); - } - } - - // 保存这个变换矩阵 - this.transform = m; - - // 应用父节点变换 - if (this.parent && this.parent.needTransform) { - if (this.needLocalTransform) { - matrix.mul(this.transform, this.parent.transform, this.transform); - } else { - matrix.copy(this.transform, this.parent.transform); - } - } - }, - - setTransform: function(ctx) { - if (this.needTransform) { - var m = this.transform; - ctx.transform( - m[0], m[1], - m[2], m[3], - m[4], m[5] - ); - } - } - }; - - return Transformable; -}); -/** - * zrender : 颜色辅助类 - * - * author: CrossDo (chenhuaimu@baidu.com) - * - * getColor:获取色板颜色 - * customPalette : 自定义调色板 - * resetPalette : 重置调色板 - * - * getHighlightColor : 获取默认高亮颜色 - * customHighlight : 自定义默认高亮颜色 - * resetHighlight : 重置默认高亮颜色 - * - * getRadialGradient : 径向渐变 - * getLinearGradient : 线性渐变 - * getGradientColors : 获取颜色之间渐变颜色数组 - * getStepColors : 获取两种颜色之间渐变颜色数组 - * reverse : 颜色翻转 - * mix : 颜色混合 - * lift : 颜色升降 - * trim : 清除空格 - * random : 随机颜色 - * toRGB : 转为RGB格式 - * toRGBA : 转为RGBA格式 - * toHex : 转为#RRGGBB格式 - * toHSL : 转为HSL格式 - * toHSLA : 转为HSLA格式 - * toHSB : 转为HSB格式 - * toHSBA : 转为HSBA格式 - * toHSV : 转为HSV格式 - * toHSVA : 转为HSVA格式 - * toName : 转为颜色名字 - * toColor: 颜色值数组转为指定格式颜色 - * toArray: 返回颜色值数组 - * alpha : 设置颜色的透明度 - **/ -define( 'zrender/tool/color',['require','../tool/util'],function(require) { - var util = require('../tool/util'); - - var _ctx; - - // Color palette is an array containing the default colors for the chart's - // series. - // When all colors are used, new colors are selected from the start again. - // Defaults to: - // 默认色板 - var palette = [ - '#ff9277', ' #dddd00', ' #ffc877', ' #bbe3ff', ' #d5ffbb', - '#bbbbff', ' #ddb000', ' #b0dd00', ' #e2bbff', ' #ffbbe3', - '#ff7777', ' #ff9900', ' #83dd00', ' #77e3ff', ' #778fff', - '#c877ff', ' #ff77ab', ' #ff6600', ' #aa8800', ' #77c7ff', - '#ad77ff', ' #ff77ff', ' #dd0083', ' #777700', ' #00aa00', - '#0088aa', ' #8400dd', ' #aa0088', ' #dd0000', ' #772e00' - ]; - var _palette = palette; - - var highlightColor = 'rgba(255,255,0,0.5)'; - var _highlightColor = highlightColor; - - // 颜色格式 - /*jshint maxlen: 330 */ - var colorRegExp = /^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i; - - var _nameColors = { - aliceblue : '#f0f8ff', - antiquewhite : '#faebd7', - aqua : '#0ff', - aquamarine : '#7fffd4', - azure : '#f0ffff', - beige : '#f5f5dc', - bisque : '#ffe4c4', - black : '#000', - blanchedalmond : '#ffebcd', - blue : '#00f', - blueviolet : '#8a2be2', - brown : '#a52a2a', - burlywood : '#deb887', - cadetblue : '#5f9ea0', - chartreuse : '#7fff00', - chocolate : '#d2691e', - coral : '#ff7f50', - cornflowerblue : '#6495ed', - cornsilk : '#fff8dc', - crimson : '#dc143c', - cyan : '#0ff', - darkblue : '#00008b', - darkcyan : '#008b8b', - darkgoldenrod : '#b8860b', - darkgray : '#a9a9a9', - darkgrey : '#a9a9a9', - darkgreen : '#006400', - darkkhaki : '#bdb76b', - darkmagenta : '#8b008b', - darkolivegreen : '#556b2f', - darkorange : '#ff8c00', - darkorchid : '#9932cc', - darkred : '#8b0000', - darksalmon : '#e9967a', - darkseagreen : '#8fbc8f', - darkslateblue : '#483d8b', - darkslategray : '#2f4f4f', - darkslategrey : '#2f4f4f', - darkturquoise : '#00ced1', - darkviolet : '#9400d3', - deeppink : '#ff1493', - deepskyblue : '#00bfff', - dimgray : '#696969', - dimgrey : '#696969', - dodgerblue : '#1e90ff', - firebrick : '#b22222', - floralwhite : '#fffaf0', - forestgreen : '#228b22', - fuchsia : '#f0f', - gainsboro : '#dcdcdc', - ghostwhite : '#f8f8ff', - gold : '#ffd700', - goldenrod : '#daa520', - gray : '#808080', - grey : '#808080', - green : '#008000', - greenyellow : '#adff2f', - honeydew : '#f0fff0', - hotpink : '#ff69b4', - indianred : '#cd5c5c', - indigo : '#4b0082', - ivory : '#fffff0', - khaki : '#f0e68c', - lavender : '#e6e6fa', - lavenderblush : '#fff0f5', - lawngreen : '#7cfc00', - lemonchiffon : '#fffacd', - lightblue : '#add8e6', - lightcoral : '#f08080', - lightcyan : '#e0ffff', - lightgoldenrodyellow : '#fafad2', - lightgray : '#d3d3d3', - lightgrey : '#d3d3d3', - lightgreen : '#90ee90', - lightpink : '#ffb6c1', - lightsalmon : '#ffa07a', - lightseagreen : '#20b2aa', - lightskyblue : '#87cefa', - lightslategray : '#789', - lightslategrey : '#789', - lightsteelblue : '#b0c4de', - lightyellow : '#ffffe0', - lime : '#0f0', - limegreen : '#32cd32', - linen : '#faf0e6', - magenta : '#f0f', - maroon : '#800000', - mediumaquamarine : '#66cdaa', - mediumblue : '#0000cd', - mediumorchid : '#ba55d3', - mediumpurple : '#9370d8', - mediumseagreen : '#3cb371', - mediumslateblue : '#7b68ee', - mediumspringgreen : '#00fa9a', - mediumturquoise : '#48d1cc', - mediumvioletred : '#c71585', - midnightblue : '#191970', - mintcream : '#f5fffa', - mistyrose : '#ffe4e1', - moccasin : '#ffe4b5', - navajowhite : '#ffdead', - navy : '#000080', - oldlace : '#fdf5e6', - olive : '#808000', - olivedrab : '#6b8e23', - orange : '#ffa500', - orangered : '#ff4500', - orchid : '#da70d6', - palegoldenrod : '#eee8aa', - palegreen : '#98fb98', - paleturquoise : '#afeeee', - palevioletred : '#d87093', - papayawhip : '#ffefd5', - peachpuff : '#ffdab9', - peru : '#cd853f', - pink : '#ffc0cb', - plum : '#dda0dd', - powderblue : '#b0e0e6', - purple : '#800080', - red : '#f00', - rosybrown : '#bc8f8f', - royalblue : '#4169e1', - saddlebrown : '#8b4513', - salmon : '#fa8072', - sandybrown : '#f4a460', - seagreen : '#2e8b57', - seashell : '#fff5ee', - sienna : '#a0522d', - silver : '#c0c0c0', - skyblue : '#87ceeb', - slateblue : '#6a5acd', - slategray : '#708090', - slategrey : '#708090', - snow : '#fffafa', - springgreen : '#00ff7f', - steelblue : '#4682b4', - tan : '#d2b48c', - teal : '#008080', - thistle : '#d8bfd8', - tomato : '#ff6347', - turquoise : '#40e0d0', - violet : '#ee82ee', - wheat : '#f5deb3', - white : '#fff', - whitesmoke : '#f5f5f5', - yellow : '#ff0', - yellowgreen : '#9acd32' - }; - - /** - * 自定义调色板 - */ - function customPalette(userPalete) { - palette = userPalete; - } - - /** - * 复位默认色板 - */ - function resetPalette() { - palette = _palette; - } - - /** - * 获取色板颜色 - * - * @param {number} idx : 色板位置 - * @param {array} [userPalete] : 自定义色板 - * - * @return {color} 颜色#000000~#ffffff - */ - function getColor(idx, userPalete) { - idx = idx | 0; - userPalete = userPalete || palette; - return userPalete[idx % userPalete.length]; - } - - /** - * 自定义默认高亮颜色 - */ - function customHighlight(userHighlightColor) { - highlightColor = userHighlightColor; - } - - /** - * 重置默认高亮颜色 - */ - function resetHighlight() { - _highlightColor = highlightColor; - } - - /** - * 获取默认高亮颜色 - */ - function getHighlightColor() { - return highlightColor; - } - - /** - * 径向渐变 - * - * @param {number} x0 渐变起点 - * @param {number} y0 - * @param {number} r0 - * @param {number} x1 渐变终点 - * @param {number} y1 - * @param {number} r1 - * @param {Array} colorList 颜色列表 - */ - function getRadialGradient(x0, y0, r0, x1, y1, r1, colorList) { - if (!_ctx) { - _ctx = util.getContext(); - } - var gradient = _ctx.createRadialGradient(x0, y0, r0, x1, y1, r1); - for ( var i = 0, l = colorList.length; i < l; i++) { - gradient.addColorStop(colorList[i][0], colorList[i][1]); - } - gradient.__nonRecursion = true; - return gradient; - } - - /** - * 线性渐变 - * @param {Object} x0 渐变起点 - * @param {Object} y0 - * @param {Object} x1 渐变终点 - * @param {Object} y1 - * @param {Array} colorList 颜色列表 - */ - function getLinearGradient(x0, y0, x1, y1, colorList) { - if (!_ctx) { - _ctx = util.getContext(); - } - var gradient = _ctx.createLinearGradient(x0, y0, x1, y1); - for ( var i = 0, l = colorList.length; i < l; i++) { - gradient.addColorStop(colorList[i][0], colorList[i][1]); - } - gradient.__nonRecursion = true; - return gradient; - } - - /** - * 获取两种颜色之间渐变颜色数组 - * @param {color} start 起始颜色 - * @param {color} end 结束颜色 - * @param {number} step 渐变级数 - * @return {Array} 颜色数组 - */ - function getStepColors(start, end, step) { - start = toRGBA(start); - end = toRGBA(end); - start = getData(start); - end = getData(end); - - var colors = []; - var stepR = (end[0] - start[0]) / step; - var stepG = (end[1] - start[1]) / step; - var stepB = (end[2] - start[2]) / step; - // 生成颜色集合 - // fix by linfeng 颜色堆积 - for (var i = 0, r = start[0], g = start[1], b = start[2]; i < step; i++ - ) { - colors[i] = toColor([ - adjust(Math.floor(r), [0, 255]), - adjust(Math.floor(g), [0, 255]), - adjust(Math.floor(b), [0, 255]) - ]); - r += stepR; - g += stepG; - b += stepB; - } - r = end[0]; - g = end[1]; - b = end[2]; - colors[i] = toColor([r, g, b]); - return colors; - } - - /** - * 获取指定级数的渐变颜色数组 - * @param {Array} colors 颜色组 - * @param {number=20} step 渐变级数 - * @return {Array} 颜色数组 - */ - function getGradientColors(colors, step) { - var ret = []; - var len = colors.length; - if (step === undefined) { - step = 20; - } - if (len === 1) { - ret = getStepColors(colors[0], colors[0], step); - } else if (len > 1) { - for ( var i = 0, n = len - 1; i < n; i++) { - var steps = getStepColors(colors[i], colors[i + 1], step); - if (i < n - 1) { - steps.pop(); - } - ret = ret.concat(steps); - } - } - return ret; - } - - /** - * 颜色值数组转为指定格式颜色,例如:
- * data = [60,20,20,0.1] format = 'rgba' - * 返回:rgba(60,20,20,0.1) - * @param {Array} data 颜色值数组 - * @param {string} format 格式,默认rgb - * @return {string} 颜色 - */ - function toColor(data, format) { - format = format || 'rgb'; - if (data && (data.length === 3 || data.length === 4)) { - data = map(data, - function(c) { - return c > 1 ? Math.ceil(c) : c; - }); - - if (format.indexOf('hex') > -1) { - return '#' + ((1 << 24) + (data[0] << 16) + (data[1] << 8) + (+data[2])).toString(16).slice(1); - } else if (format.indexOf('hs') > -1) { - var sx = map(data.slice(1, 3), - function(c) { - return c + '%'; - }); - data[1] = sx[0]; - data[2] = sx[1]; - } - - if (format.indexOf('a') > -1) { - if (data.length === 3) { - data.push(1); - } - data[3] = adjust(data[3], [0, 1]); - return format + '(' + data.slice(0, 4).join(',') + ')'; - } - - return format + '(' + data.slice(0, 3).join(',') + ')'; - } - } - - /** - * 返回颜色值数组 - * - * @param {color} color 颜色 - * @return {Array} 颜色值数组 - */ - function toArray(color) { - color = trim(color); - if (color.indexOf('rgba') < 0) { - color = toRGBA(color); - } - - var data = []; - var i = 0; - color.replace(/[\d.]+/g, function (n) { - if (i < 3) { - n = n | 0; - } else { - // Alpha - n = +n; - } - data[i++] = n; - }); - return data; - } - - /** - * 颜色格式转化 - * - * @param {Array} data 颜色值数组 - * @param {string} format 格式,默认rgb - * @return {string} 颜色 - */ - function convert(color, format) { - var data = getData(color); - var alpha = data[3]; - if(typeof alpha === 'undefined') { - alpha = 1; - } - - if (color.indexOf('hsb') > -1) { - data = _HSV_2_RGB(data); - } else if (color.indexOf('hsl') > -1) { - data = _HSL_2_RGB(data); - } - - if (format.indexOf('hsb') > -1 || format.indexOf('hsv') > -1) { - data = _RGB_2_HSB(data); - } else if (format.indexOf('hsl') > -1) { - data = _RGB_2_HSL(data); - } - - data[3] = alpha; - - return toColor(data, format); - } - - /** - * 转换为rgba格式的颜色 - * - * @param {string} color 颜色 - * @return {string} rgba颜色,rgba(r,g,b,a) - */ - function toRGBA(color) { - return convert(color, 'rgba'); - } - - /** - * 转换为rgb数字格式的颜色 - * - * @param {string} color 颜色 - * @return {string} rgb颜色,rgb(0,0,0)格式 - */ - function toRGB(color) { - return convert(color, 'rgb'); - } - - /** - * 转换为16进制颜色 - * - * @param {string} color 颜色 - * @return {string} 16进制颜色,#rrggbb格式 - */ - function toHex(color) { - return convert(color, 'hex'); - } - - /** - * 转换为HSV颜色 - * - * @param {string} color 颜色 - * @return {string} HSVA颜色,hsva(h,s,v,a) - */ - function toHSVA(color) { - return convert(color, 'hsva'); - } - - /** - * 转换为HSV颜色 - * - * @param {string} color 颜色 - * @return {string} HSV颜色,hsv(h,s,v) - */ - function toHSV(color) { - return convert(color, 'hsv'); - } - - /** - * 转换为HSBA颜色 - * - * @param {string} color 颜色 - * @return {string} HSBA颜色,hsba(h,s,b,a) - */ - function toHSBA(color) { - return convert(color, 'hsba'); - } - - /** - * 转换为HSB颜色 - * - * @param {string} color 颜色 - * @return {string} HSB颜色,hsb(h,s,b) - */ - function toHSB(color) { - return convert(color, 'hsb'); - } - - /** - * 转换为HSLA颜色 - * - * @param {string} color 颜色 - * @return {string} HSLA颜色,hsla(h,s,l,a) - */ - function toHSLA(color) { - return convert(color, 'hsla'); - } - - /** - * 转换为HSL颜色 - * - * @param {string} color 颜色 - * @return {string} HSL颜色,hsl(h,s,l) - */ - function toHSL(color) { - return convert(color, 'hsl'); - } - - /** - * 转换颜色名 - * - * @param {string} color 颜色 - * @return {string} 颜色名 - */ - function toName(color) { - for ( var key in _nameColors) { - if (toHex(_nameColors[key]) === toHex(color)) { - return key; - } - } - return null; - } - - /** - * 移除颜色中多余空格 - * - * @param {string} color 颜色 - * @return {string} 无空格颜色 - */ - function trim(color) { - return String(color).replace(/\s+/g, ''); - } - - /** - * 颜色规范化 - * - * @param {string} color 颜色 - * @return {string} 规范化后的颜色 - */ - function normalize(color) { - // 颜色名 - if (_nameColors[color]) { - color = _nameColors[color]; - } - // 去掉空格 - color = trim(color); - // hsv与hsb等价 - color = color.replace(/hsv/i, 'hsb'); - // rgb转为rrggbb - if (/^#[\da-f]{3}$/i.test(color)) { - color = parseInt(color.slice(1), 16); - var r = (color & 0xf00) << 8; - var g = (color & 0xf0) << 4; - var b = color & 0xf; - - color = '#'+ ((1 << 24) + (r << 4) + r + (g << 4) + g + (b << 4) + b).toString(16).slice(1); - } - // 或者使用以下正则替换,不过 chrome 下性能相对差点 - // color = color.replace(/^#([\da-f])([\da-f])([\da-f])$/i, '#$1$1$2$2$3$3'); - return color; - } - - /** - * 颜色加深或减淡,当level>0加深,当level<0减淡 - * - * @param {string} color 颜色 - * @param {number} level 升降程度,取值区间[-1,1] - * @return {string} 加深或减淡后颜色值 - */ - function lift(color, level) { - var direct = level > 0 ? 1 : -1; - if (typeof level === 'undefined') { - level = 0; - } - level = Math.abs(level) > 1 ? 1 : Math.abs(level); - color = toRGB(color); - var data = getData(color); - for ( var i = 0; i < 3; i++) { - if (direct === 1) { - data[i] = data[i] * (1 - level) | 0; - } else { - data[i] = ((255 - data[i]) * level + data[i]) | 0; - } - } - return 'rgb(' + data.join(',') + ')'; - } - - /** - * 颜色翻转,[255-r,255-g,255-b,1-a] - * - * @param {string} color 颜色 - * @return {string} 翻转颜色 - */ - function reverse(color) { - var data = getData(toRGBA(color)); - data = map(data, - function(c) { - return 255 - c; - }); - return toColor(data, 'rgb'); - } - - /** - * 简单两种颜色混合 - * - * @param {string} color1 第一种颜色 - * @param {string} color2 第二种颜色 - * @param {string} weight 混合权重[0-1] - * @return {string} 结果色,rgb(r,g,b)或rgba(r,g,b,a) - */ - function mix(color1, color2, weight) { - if(typeof weight === 'undefined') { - weight = 0.5; - } - weight = 1 - adjust(weight, [0, 1]); - - var w = weight * 2 - 1; - var data1 = getData(toRGBA(color1)); - var data2 = getData(toRGBA(color2)); - - var d = data1[3] - data2[3]; - - var weight1 = (((w * d === -1) ? w : (w + d) / (1 + w * d)) + 1) / 2; - var weight2 = 1 - weight1; - - var data = []; - - for ( var i = 0; i < 3; i++) { - data[i] = data1[i] * weight1 + data2[i] * weight2; - } - - var alpha = data1[3] * weight + data2[3] * (1 - weight); - alpha = Math.max(0, Math.min(1, alpha)); - - if (data1[3] === 1 && data2[3] === 1) {// 不考虑透明度 - return toColor(data, 'rgb'); - } - data[3] = alpha; - return toColor(data, 'rgba'); - } - - /** - * 随机颜色 - * - * @return {string} 颜色值,#rrggbb格式 - */ - function random() { - return '#' + Math.random().toString(16).slice(2, 8); - } - - /** - * 获取颜色值数组,返回值范围:
- * RGB 范围[0-255]
- * HSL/HSV/HSB 范围[0-1]
- * A透明度范围[0-1] - * 支持格式: - * #rgb - * #rrggbb - * rgb(r,g,b) - * rgb(r%,g%,b%) - * rgba(r,g,b,a) - * hsb(h,s,b) // hsv与hsb等价 - * hsb(h%,s%,b%) - * hsba(h,s,b,a) - * hsl(h,s,l) - * hsl(h%,s%,l%) - * hsla(h,s,l,a) - * - * @param {string} color 颜色 - * @return {Array} 颜色值数组或null - */ - function getData(color) { - color = normalize(color); - var r = color.match(colorRegExp); - if (r === null) { - throw new Error('The color format error'); // 颜色格式错误 - } - var d; - var a; - var data = []; - var rgb; - - if (r[2]) { - // #rrggbb - d = r[2].replace('#', '').split(''); - rgb = [d[0] + d[1], d[2] + d[3], d[4] + d[5]]; - data = map(rgb, - function(c) { - return adjust(parseInt(c, 16), [0, 255]); - }); - - } - else if (r[4]) { - // rgb rgba - var rgba = (r[4]).split(','); - a = rgba[3]; - rgb = rgba.slice(0, 3); - data = map( - rgb, - function(c) { - c = Math.floor( - c.indexOf('%') > 0 ? parseInt(c, 0) * 2.55 : c - ); - return adjust(c, [0, 255]); - } - ); - - if(typeof a !== 'undefined') { - data.push(adjust(parseFloat(a), [0, 1])); - } - } - else if (r[5] || r[6]) { - // hsb hsba hsl hsla - var hsxa = (r[5] || r[6]).split(','); - var h = parseInt(hsxa[0], 0) / 360; - var s = hsxa[1]; - var x = hsxa[2]; - a = hsxa[3]; - data = map([s, x], - function(c) { - return adjust(parseFloat(c) / 100, [0, 1]); - }); - data.unshift(h); - if( typeof a !== 'undefined') { - data.push(adjust(parseFloat(a), [0, 1])); - } - } - return data; - } - - /** - * 设置颜色透明度 - * @param {string} color 颜色 - * @param {number} alpha 透明度,区间[0,1] - * @return {string} rgba颜色值 - */ - function alpha(color, a) { - if (a === null) { - a = 1; - } - var data = getData(toRGBA(color)); - data[3] = adjust(Number(a).toFixed(4), [0, 1]); - - return toColor(data, 'rgba'); - } - - // 数组映射 - function map(array, fun) { - if (typeof fun !== 'function') { - throw new TypeError(); - } - var len = array ? array.length : 0; - for ( var i = 0; i < len; i++) { - array[i] = fun(array[i]); - } - return array; - } - - // 调整值区间 - function adjust(value, region) { - // < to <= & > to >= - // modify by linzhifeng 2014-05-25 because -0 == 0 - if (value <= region[0]) { - value = region[0]; - } - else if (value >= region[1]) { - value = region[1]; - } - return value; - } - - // 参见 http:// www.easyrgb.com/index.php?X=MATH - function _HSV_2_RGB(data) { - var H = data[0]; - var S = data[1]; - var V = data[2]; - // HSV from 0 to 1 - var R, G, B; - if (S === 0) { - R = V * 255; - G = V * 255; - B = V * 255; - } else { - var h = H * 6; - if (h === 6) { - h = 0; - } - var i = h | 0; - var v1 = V * (1 - S); - var v2 = V * (1 - S * (h - i)); - var v3 = V * (1 - S * (1 - (h - i))); - var r = 0; - var g = 0; - var b = 0; - - if (i === 0) { - r = V; - g = v3; - b = v1; - } else if (i === 1) { - r = v2; - g = V; - b = v1; - } else if (i === 2) { - r = v1; - g = V; - b = v3; - } else if (i === 3) { - r = v1; - g = v2; - b = V; - } else if (i === 4) { - r = v3; - g = v1; - b = V; - } else { - r = V; - g = v1; - b = v2; - } - - // RGB results from 0 to 255 - R = r * 255; - G = g * 255; - B = b * 255; - } - return [ R, G, B ]; - } - - function _HSL_2_RGB(data) { - var H = data[0]; - var S = data[1]; - var L = data[2]; - // HSL from 0 to 1 - var R, G, B; - if (S === 0) { - R = L * 255; - G = L * 255; - B = L * 255; - } else { - var v2; - if (L < 0.5) { - v2 = L * (1 + S); - } else { - v2 = (L + S) - (S * L); - } - - var v1 = 2 * L - v2; - - R = 255 * _HUE_2_RGB(v1, v2, H + (1 / 3)); - G = 255 * _HUE_2_RGB(v1, v2, H); - B = 255 * _HUE_2_RGB(v1, v2, H - (1 / 3)); - } - return [ R, G, B ]; - } - - function _HUE_2_RGB(v1, v2, vH) { - if (vH < 0) { - vH += 1; - } - if (vH > 1) { - vH -= 1; - } - if ((6 * vH) < 1) { - return (v1 + (v2 - v1) * 6 * vH); - } - if ((2 * vH) < 1) { - return (v2); - } - if ((3 * vH) < 2) { - return (v1 + (v2 - v1) * ((2 / 3) - vH) * 6); - } - return v1; - } - - function _RGB_2_HSB(data) { - // RGB from 0 to 255 - var R = (data[0] / 255); - var G = (data[1] / 255); - var B = (data[2] / 255); - - var vMin = Math.min(R, G, B); // Min. value of RGB - var vMax = Math.max(R, G, B); // Max. value of RGB - var delta = vMax - vMin; // Delta RGB value - var V = vMax; - var H; - var S; - - // HSV results from 0 to 1 - if (delta === 0) { - H = 0; - S = 0; - } else { - S = delta / vMax; - - var deltaR = (((vMax - R) / 6) + (delta / 2)) / delta; - var deltaG = (((vMax - G) / 6) + (delta / 2)) / delta; - var deltaB = (((vMax - B) / 6) + (delta / 2)) / delta; - - if (R === vMax) { - H = deltaB - deltaG; - } else if (G === vMax) { - H = (1 / 3) + deltaR - deltaB; - } else if (B === vMax) { - H = (2 / 3) + deltaG - deltaR; - } - - if (H < 0) { - H += 1; - } - if (H > 1) { - H -= 1; - } - } - H = H * 360; - S = S * 100; - V = V * 100; - return [ H, S, V ]; - } - - function _RGB_2_HSL(data) { - // RGB from 0 to 255 - var R = (data[0] / 255); - var G = (data[1] / 255); - var B = (data[2] / 255); - - var vMin = Math.min(R, G, B); // Min. value of RGB - var vMax = Math.max(R, G, B); // Max. value of RGB - var delta = vMax - vMin; // Delta RGB value - - var L = (vMax + vMin) / 2; - var H; - var S; - // HSL results from 0 to 1 - if (delta === 0) { - H = 0; - S = 0; - } else { - if (L < 0.5) { - S = delta / (vMax + vMin); - } else { - S = delta / (2 - vMax - vMin); - } - - var deltaR = (((vMax - R) / 6) + (delta / 2)) / delta; - var deltaG = (((vMax - G) / 6) + (delta / 2)) / delta; - var deltaB = (((vMax - B) / 6) + (delta / 2)) / delta; - - if (R === vMax) { - H = deltaB - deltaG; - } else if (G === vMax) { - H = (1 / 3) + deltaR - deltaB; - } else if (B === vMax) { - H = (2 / 3) + deltaG - deltaR; - } - - if (H < 0) { - H += 1; - } - - if (H > 1) { - H -= 1; - } - } - - H = H * 360; - S = S * 100; - L = L * 100; - - return [ H, S, L ]; - } - - return { - customPalette : customPalette, - resetPalette : resetPalette, - getColor : getColor, - getHighlightColor : getHighlightColor, - customHighlight : customHighlight, - resetHighlight : resetHighlight, - getRadialGradient : getRadialGradient, - getLinearGradient : getLinearGradient, - getGradientColors : getGradientColors, - getStepColors : getStepColors, - reverse : reverse, - mix : mix, - lift : lift, - trim : trim, - random : random, - toRGB : toRGB, - toRGBA : toRGBA, - toHex : toHex, - toHSL : toHSL, - toHSLA : toHSLA, - toHSB : toHSB, - toHSBA : toHSBA, - toHSV : toHSV, - toHSVA : toHSVA, - toName : toName, - toColor : toColor, - toArray : toArray, - alpha : alpha, - getData : getData - }; -}); - - -/** - * zrender : shape基类 - * - * desc: zrender是一个轻量级的Canvas类库,MVC封装,数据驱动,提供类Dom事件模型。 - * author: Kener (@Kener-林峰, linzhifeng@baidu.com) - * errorrik (errorrik@gmail.com) - * - * 可配图形属性: - { - // 基础属性,详见各shape - shape : {string}, // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 变换 - position : {array}, // 默认为[0, 0], shape的坐标 - rotation : {number|array}, // 默认为[0, 0, 0],shape绕自身旋转的角度,不被translate 影响 - // 后两个值为旋转的origin - scale : {array}, // 默认为[1, 1, 0, 0], shape纵横缩放比例,不被translate影响 - // 后两个值为缩放的origin - - // 样式属性,详见各shape,默认状态样式属性 - style : {Object}, - - // 样式属性,详见各shape,高亮样式属性,当不存在highlightStyle时使用默认样式扩展显示 - highlightStyle : {Object}, - - // 交互属性,zrender支持,非图形类实现 - hoverable : {boolean}, // 默认为true,可悬浮响应,默认悬浮响应为高亮显示 - // 可在onbrush中捕获并阻塞高亮绘画 - clickable : {boolean}, // 默认为false,可点击响应,影响鼠标hover时图标是否为可点击样式 - // 为false则阻断点击事件抛出,为true可在onclick中捕获 - draggable : {boolean}, // 默认为false,可拖拽响应,默认拖拽响应改变图形位置, - // 可在ondrift中捕获并阻塞默认拖拽行为 - - // 事件属性 - onbrush : {Function}, // 默认为null,当前图形被刷画时回调,可用于实现自定义绘画 - // 回传参数为: - // @param {2D Context} context 当前canvas context - // @param {Object} shape 当前shape - // @param {boolean} isHighlight 是否高亮 - // @return {boolean} 回调返回true则不执行默认绘画 - ondrift : {Function}, // 默认为null,当前图形被拖拽改变位置时回调,可用于限制拖拽范围 - // 回传参数为: - // @param {Object} shape 当前shape - // @param {number} dx x方向变化 - // @param {number} dy y方向变化 - onclick : {Function}, // 默认为null,当前图形点击响应,回传参数为: - // @param {Object} eventPacket 对象内容如下: - // @param {string} eventPacket.type 事件类型,EVENT.CLICK - // @param {event} eventPacket.event 原始dom事件对象 - // @param {Object} eventPacket.target 当前图形shape对象 - // @return {boolean} 回调返回true则阻止抛出全局事件 - - onmousewheel : {Function}, // 默认为null,当前图形上鼠标滚轮触发,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.MOUSEWHEEL - // @return {boolean} 回调返回true则阻止抛出全局事件 - - onmousemove : {Function}, // 默认为null,当前图上形鼠标(或手指)移动触发,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.MOUSEMOVE - // @return {boolean} 回调返回true则阻止抛出全局事件 - - onmouseover : {Function}, // 默认为null,鼠标(或手指)移动到当前图形上触发,回传参数格式同onclick: - // 事件类型为confit.EVENT.MOUSEOVER - // @return {boolean} 回调返回true则阻止抛出全局事件 - - onmouseout : {Function}, // 默认为null,鼠标(或手指)从当前图形移开,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.MOUSEOUT - // @return {boolean} 回调返回true则阻止抛出全局事件 - - onmousedown : {Function}, // 默认为null,鼠标按钮(或手指)按下,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.MOUSEDOWN - // @return {boolean} 回调返回true则阻止抛出全局事件 - - onmouseup : {Function}, // 默认为null,鼠标按钮(或手指)松开,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.MOUSEUP - // @return {boolean} 回调返回true则阻止抛出全局事件 - - ondragstart : {Function}, // 默认为null,开始拖拽时触发,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.DRAGSTART - // @return {boolean} 回调返回true则阻止抛出全局事件 - - ondragend : {Function}, // 默认为null,拖拽完毕时触发,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.DRAGEND - // @return {boolean} 回调返回true则阻止抛出全局事件 - - ondragenter : {Function}, // 默认为null,拖拽图形元素进入目标图形元素时触发 - // 回传参数格式同onclick,其中: - // @param {string} eventPacket.type 事件类型,EVENT.DRAGENTER - // @param {Object} eventPacket.target 目标图形元素shape对象 - // @param {Object} eventPacket.dragged 拖拽图形元素shape对象 - // @return {boolean} 回调返回true则阻止抛出全局事件 - - ondragover : {Function}, // 默认为null,拖拽图形元素在目标图形元素上移动时触发, - // 回传参数格式同onclick,其中: - // @param {string} eventPacket.type 事件类型,EVENT.DRAGOVER - // @param {Object} eventPacket.target 目标图形元素shape对象 - // @param {Object} eventPacket.dragged 拖拽图形元素shape对象 - // @return {boolean} 回调返回true则阻止抛出全局事件 - - ondragleave : {Function}, // 默认为null,拖拽图形元素离开目标图形元素时触发, - // 回传参数格式同onclick,其中: - // @param {string} eventPacket.type 事件类型,EVENT.DRAGLEAVE - // @param {Object} eventPacket.target 目标图形元素shape对象 - // @param {Object} eventPacket.dragged 拖拽图形元素shape对象 - // @return {boolean} 回调返回true则阻止抛出全局事件 - - ondrop : {Function}, // 默认为null,拖拽图形元素放在目标图形元素内时触发, - // 回传参数格式同onclick,其中: - // @param {string} eventPacket.type 事件类型,EVENT.DRAG - // @param {Object} eventPacket.target 目标图形元素shape对象 - // @param {Object} eventPacket.dragged 拖拽图形元素shape对象 - // @return {boolean} 回调返回true则阻止抛出全局事件 - } - */ -define( - 'zrender/shape/Base',['require','../tool/matrix','../tool/guid','../tool/util','./mixin/Transformable','../tool/event','../tool/area','../tool/area','../tool/color','../tool/area'],function(require) { - var matrix = require('../tool/matrix'); - var guid = require('../tool/guid'); - var util = require('../tool/util'); - - var Transformable = require('./mixin/Transformable'); - var Dispatcher = require('../tool/event').Dispatcher; - - function _fillText(ctx, text, x, y, textFont, textAlign, textBaseline) { - if (textFont) { - ctx.font = textFont; - } - ctx.textAlign = textAlign; - ctx.textBaseline = textBaseline; - var rect = _getTextRect( - text, x, y, textFont, textAlign, textBaseline - ); - - text = (text + '').split('\n'); - var lineHeight = require('../tool/area').getTextHeight('国', textFont); - - switch (textBaseline) { - case 'top': - y = rect.y; - break; - case 'bottom': - y = rect.y + lineHeight; - break; - default: - y = rect.y + lineHeight / 2; - } - - for (var i = 0, l = text.length; i < l; i++) { - ctx.fillText(text[i], x, y); - y += lineHeight; - } - } - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * - * @inner - * @param {Object} style - */ - function _getTextRect(text, x, y, textFont, textAlign, textBaseline) { - var area = require('../tool/area'); - var width = area.getTextWidth(text, textFont); - var lineHeight = area.getTextHeight('国', textFont); - - text = (text + '').split('\n'); - - switch (textAlign) { - case 'end': - case 'right': - x -= width; - break; - case 'center': - x -= (width / 2); - break; - } - - switch (textBaseline) { - case 'top': - break; - case 'bottom': - y -= lineHeight * text.length; - break; - default: - y -= lineHeight * text.length / 2; - } - - return { - x : x, - y : y, - width : width, - height : lineHeight * text.length - }; - } - - function Base( options ) { - - options = options || {}; - - this.id = options.id || guid(); - - for ( var key in options ) { - this[ key ] = options[ key ]; - } - - this.style = this.style || {}; - - this.parent = null; - - this.__dirty = true; - - Transformable.call(this); - Dispatcher.call(this); - } - - Base.prototype.invisible = false; - - Base.prototype.ignore = false; - - Base.prototype.zlevel = 0; - - Base.prototype.draggable = false; - - Base.prototype.clickable = false; - - Base.prototype.hoverable = true; - - Base.prototype.z = 0; - - /** - * 画刷 - * - * @param ctx 画布句柄 - * @param isHighlight 是否为高亮状态 - * @param updateCallback 需要异步加载资源的shape可以通过这个callback(e) - * 让painter更新视图,base.brush没用,需要的话重载brush - */ - Base.prototype.brush = function (ctx, isHighlight) { - var style = this.style; - - if (this.brushTypeOnly) { - style.brushType = this.brushTypeOnly; - } - - if (isHighlight) { - // 根据style扩展默认高亮样式 - style = this.getHighlightStyle( - style, - this.highlightStyle || {}, - this.brushTypeOnly - ); - } - - if (this.brushTypeOnly == 'stroke') { - style.strokeColor = style.strokeColor || style.color; - } - - ctx.save(); - - this.setContext(ctx, style); - - // 设置transform - this.setTransform(ctx); - - ctx.beginPath(); - this.buildPath(ctx, style); - if (this.brushTypeOnly != 'stroke') { - ctx.closePath(); - } - - switch (style.brushType) { - case 'both': - ctx.fill(); - case 'stroke': - style.lineWidth > 0 && ctx.stroke(); - break; - default: - ctx.fill(); - } - - this.drawText(ctx, style, this.style); - - ctx.restore(); - }; - - var STYLE_CTX_MAP = [ - ['color', 'fillStyle'], - ['strokeColor', 'strokeStyle'], - ['opacity', 'globalAlpha'], - ['lineCap', 'lineCap'], - ['lineJoin', 'lineJoin'], - ['miterLimit', 'miterLimit'], - ['lineWidth', 'lineWidth'], - ['shadowBlur', 'shadowBlur'], - ['shadowColor', 'shadowColor'], - ['shadowOffsetX', 'shadowOffsetX'], - ['shadowOffsetY', 'shadowOffsetY'] - ]; - - /** - * 画布通用设置 - * - * TODO Performance - * - * @param ctx 画布句柄 - * @param style 通用样式 - */ - Base.prototype.setContext = function (ctx, style) { - for (var i = 0, len = STYLE_CTX_MAP.length; i < len; i++) { - var styleProp = STYLE_CTX_MAP[i][0]; - var styleValue = style[styleProp]; - var ctxProp = STYLE_CTX_MAP[i][1]; - - if (typeof styleValue != 'undefined') { - ctx[ctxProp] = styleValue; - } - } - }; - - /** - * 根据默认样式扩展高亮样式 - * - * @param ctx Canvas 2D上下文 - * @param {Object} style 默认样式 - * @param {Object} highlightStyle 高亮样式 - */ - Base.prototype.getHighlightStyle = function (style, highlightStyle, brushTypeOnly) { - var newStyle = {}; - for (var k in style) { - newStyle[k] = style[k]; - } - - var color = require('../tool/color'); - var highlightColor = color.getHighlightColor(); - // 根据highlightStyle扩展 - if (style.brushType != 'stroke') { - // 带填充则用高亮色加粗边线 - newStyle.strokeColor = highlightColor; - newStyle.lineWidth = (style.lineWidth || 1) - + this.getHighlightZoom(); - newStyle.brushType = 'both'; - } - else { - if (brushTypeOnly != 'stroke') { - // 描边型的则用原色加工高亮 - newStyle.strokeColor = highlightColor; - newStyle.lineWidth = (style.lineWidth || 1) - + this.getHighlightZoom(); - } - else { - // 线型的则用原色加工高亮 - newStyle.strokeColor = highlightStyle.strokeColor - || color.mix( - style.strokeColor, - color.toRGB(highlightColor) - ); - } - } - - // 可自定义覆盖默认值 - for (var k in highlightStyle) { - if (typeof highlightStyle[k] != 'undefined') { - newStyle[k] = highlightStyle[k]; - } - } - - return newStyle; - }; - - /** - * 高亮放大效果参数 - * 当前统一设置为6,如有需要差异设置,通过this.type判断实例类型 - */ - Base.prototype.getHighlightZoom = function () { - return this.type != 'text' ? 6 : 2; - }; - - /** - * 默认漂移 - * - * @param dx 横坐标变化 - * @param dy 纵坐标变化 - */ - Base.prototype.drift = function (dx, dy) { - this.position[0] += dx; - this.position[1] += dy; - }; - - /** - * 获取鼠标坐标变换 - * TODO Performance - */ - Base.prototype.getTansform = (function() { - - var invTransform = []; - - return function (x, y) { - var originPos = [x, y]; - // 对鼠标的坐标也做相同的变换 - if (this.needTransform && this.transform) { - matrix.invert(invTransform, this.transform); - - matrix.mulVector(originPos, invTransform, [x, y, 1]); - - if (x == originPos[0] && y == originPos[1]) { - // 避免外部修改导致的needTransform不准确 - this.updateNeedTransform(); - } - } - return originPos; - }; - })(); - - /** - * 默认区域包含判断 - * - * @param x 横坐标 - * @param y 纵坐标 - */ - Base.prototype.isCover = function (x, y) { - var originPos = this.getTansform(x, y); - x = originPos[0]; - y = originPos[1]; - - // 快速预判并保留判断矩形 - var rect = this.style.__rect; - if (!rect) { - rect = this.style.__rect = this.getRect(this.style); - } - - if (x >= rect.x - && x <= (rect.x + rect.width) - && y >= rect.y - && y <= (rect.y + rect.height) - ) { - // 矩形内 - return require('../tool/area').isInside(this, this.style, x, y); - } - - return false; - }; - - /** - * 附加文本 - * - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - * @param {Object} normalStyle 默认样式,用于定位文字显示 - */ - Base.prototype.drawText = function (ctx, style, normalStyle) { - if (typeof(style.text) == 'undefined' || style.text === false ) { - return; - } - // 字体颜色策略 - var textColor = style.textColor || style.color || style.strokeColor; - ctx.fillStyle = textColor; - - /* - if (style.textPosition == 'inside') { - ctx.shadowColor = 'rgba(0,0,0,0)'; // 内部文字不带shadowColor - } - */ - - // 文本与图形间空白间隙 - var dd = 10; - var al; // 文本水平对齐 - var bl; // 文本垂直对齐 - var tx; // 文本横坐标 - var ty; // 文本纵坐标 - - var textPosition = style.textPosition // 用户定义 - || this.textPosition // shape默认 - || 'top'; // 全局默认 - - switch (textPosition) { - case 'inside': - case 'top': - case 'bottom': - case 'left': - case 'right': - if (this.getRect) { - var rect = (normalStyle || style).__rect - || this.getRect(normalStyle || style); - - switch (textPosition) { - case 'inside': - tx = rect.x + rect.width / 2; - ty = rect.y + rect.height / 2; - al = 'center'; - bl = 'middle'; - if (style.brushType != 'stroke' - && textColor == style.color - ) { - ctx.fillStyle = '#fff'; - } - break; - case 'left': - tx = rect.x - dd; - ty = rect.y + rect.height / 2; - al = 'end'; - bl = 'middle'; - break; - case 'right': - tx = rect.x + rect.width + dd; - ty = rect.y + rect.height / 2; - al = 'start'; - bl = 'middle'; - break; - case 'top': - tx = rect.x + rect.width / 2; - ty = rect.y - dd; - al = 'center'; - bl = 'bottom'; - break; - case 'bottom': - tx = rect.x + rect.width / 2; - ty = rect.y + rect.height + dd; - al = 'center'; - bl = 'top'; - break; - } - } - break; - case 'start': - case 'end': - var xStart; - var xEnd; - var yStart; - var yEnd; - if (typeof style.pointList != 'undefined') { - var pointList = style.pointList; - if (pointList.length < 2) { - // 少于2个点就不画了~ - return; - } - var length = pointList.length; - switch (textPosition) { - case 'start': - xStart = pointList[0][0]; - xEnd = pointList[1][0]; - yStart = pointList[0][1]; - yEnd = pointList[1][1]; - break; - case 'end': - xStart = pointList[length - 2][0]; - xEnd = pointList[length - 1][0]; - yStart = pointList[length - 2][1]; - yEnd = pointList[length - 1][1]; - break; - } - } - else { - xStart = style.xStart || 0; - xEnd = style.xEnd || 0; - yStart = style.yStart || 0; - yEnd = style.yEnd || 0; - } - - switch (textPosition) { - case 'start': - al = xStart < xEnd ? 'end' : 'start'; - bl = yStart < yEnd ? 'bottom' : 'top'; - tx = xStart; - ty = yStart; - break; - case 'end': - al = xStart < xEnd ? 'start' : 'end'; - bl = yStart < yEnd ? 'top' : 'bottom'; - tx = xEnd; - ty = yEnd; - break; - } - dd -= 4; - if (xStart != xEnd) { - tx -= (al == 'end' ? dd : -dd); - } - else { - al = 'center'; - } - - if (yStart != yEnd) { - ty -= (bl == 'bottom' ? dd : -dd); - } - else { - bl = 'middle'; - } - break; - case 'specific': - tx = style.textX || 0; - ty = style.textY || 0; - al = 'start'; - bl = 'middle'; - break; - } - - if (tx != null && ty != null) { - _fillText( - ctx, - style.text, - tx, ty, - style.textFont, - style.textAlign || al, - style.textBaseline || bl - ); - } - }; - // TODO - Base.prototype.isSilent = function () { - return !( - this.hoverable || this.draggable - || this.onmousemove || this.onmouseover || this.onmouseout - || this.onmousedown || this.onmouseup || this.onclick - || this.ondragenter || this.ondragover || this.ondragleave - || this.ondrop - ); - }; - - util.merge(Base.prototype, Transformable.prototype, true); - util.merge(Base.prototype, Dispatcher.prototype, true); - - return Base; - } -); - -/** - * zrender - * - * author: CrossDo (chenhuaimu@baidu.com) - * - * shape类:路径 - * 可配图形属性: - { - // 基础属性 - shape : 'path', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - path : {string},// 必须,路径。例如:M 0 0 L 0 10 L 10 10 Z (一个三角形) - //M = moveto - //L = lineto - //H = horizontal lineto - //V = vertical lineto - //C = curveto - //S = smooth curveto - //Q = quadratic Belzier curve - //T = smooth quadratic Belzier curveto - //Z = closepath - - - x : {number}, // 必须,x轴坐标 - y : {number}, // 必须,y轴坐标 - - - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为top,附加文本位置。 - // inside | left | right | top | bottom - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - - **/ - -define('zrender/shape/Path',['require','./Base','../tool/util'],function (require) { - var Base = require('./Base'); - - function Path(options) { - Base.call(this, options); - } - - Path.prototype = { - type: 'path', - - _parsePathData : function(data) { - if (!data) { - return []; - } - - // command string - var cs = data; - - // command chars - var cc = [ - 'm', 'M', 'l', 'L', 'v', 'V', 'h', 'H', 'z', 'Z', - 'c', 'C', 'q', 'Q', 't', 'T', 's', 'S', 'a', 'A' - ]; - - cs = cs.replace(/-/g, ' -'); - cs = cs.replace(/ /g, ' '); - cs = cs.replace(/ /g, ','); - cs = cs.replace(/,,/g, ','); - - - var n; - // create pipes so that we can split the data - for (n = 0; n < cc.length; n++) { - cs = cs.replace(new RegExp(cc[n], 'g'), '|' + cc[n]); - } - - // create array - var arr = cs.split('|'); - var ca = []; - // init context point - var cpx = 0; - var cpy = 0; - for (n = 1; n < arr.length; n++) { - var str = arr[n]; - var c = str.charAt(0); - str = str.slice(1); - str = str.replace(new RegExp('e,-', 'g'), 'e-'); - - var p = str.split(','); - if (p.length > 0 && p[0] === '') { - p.shift(); - } - - for (var i = 0; i < p.length; i++) { - p[i] = parseFloat(p[i]); - } - while (p.length > 0) { - if (isNaN(p[0])) { - break; - } - var cmd = null; - var points = []; - - var ctlPtx; - var ctlPty; - var prevCmd; - - var rx; - var ry; - var psi; - var fa; - var fs; - - var x1 = cpx; - var y1 = cpy; - - // convert l, H, h, V, and v to L - switch (c) { - case 'l': - cpx += p.shift(); - cpy += p.shift(); - cmd = 'L'; - points.push(cpx, cpy); - break; - case 'L': - cpx = p.shift(); - cpy = p.shift(); - points.push(cpx, cpy); - break; - case 'm': - cpx += p.shift(); - cpy += p.shift(); - cmd = 'M'; - points.push(cpx, cpy); - c = 'l'; - break; - case 'M': - cpx = p.shift(); - cpy = p.shift(); - cmd = 'M'; - points.push(cpx, cpy); - c = 'L'; - break; - - case 'h': - cpx += p.shift(); - cmd = 'L'; - points.push(cpx, cpy); - break; - case 'H': - cpx = p.shift(); - cmd = 'L'; - points.push(cpx, cpy); - break; - case 'v': - cpy += p.shift(); - cmd = 'L'; - points.push(cpx, cpy); - break; - case 'V': - cpy = p.shift(); - cmd = 'L'; - points.push(cpx, cpy); - break; - case 'C': - points.push(p.shift(), p.shift(), p.shift(), p.shift()); - cpx = p.shift(); - cpy = p.shift(); - points.push(cpx, cpy); - break; - case 'c': - points.push( - cpx + p.shift(), cpy + p.shift(), - cpx + p.shift(), cpy + p.shift() - ); - cpx += p.shift(); - cpy += p.shift(); - cmd = 'C'; - points.push(cpx, cpy); - break; - case 'S': - ctlPtx = cpx; - ctlPty = cpy; - prevCmd = ca[ca.length - 1]; - if (prevCmd.command === 'C') { - ctlPtx = cpx + (cpx - prevCmd.points[2]); - ctlPty = cpy + (cpy - prevCmd.points[3]); - } - points.push(ctlPtx, ctlPty, p.shift(), p.shift()); - cpx = p.shift(); - cpy = p.shift(); - cmd = 'C'; - points.push(cpx, cpy); - break; - case 's': - ctlPtx = cpx, ctlPty = cpy; - prevCmd = ca[ca.length - 1]; - if (prevCmd.command === 'C') { - ctlPtx = cpx + (cpx - prevCmd.points[2]); - ctlPty = cpy + (cpy - prevCmd.points[3]); - } - points.push( - ctlPtx, ctlPty, - cpx + p.shift(), cpy + p.shift() - ); - cpx += p.shift(); - cpy += p.shift(); - cmd = 'C'; - points.push(cpx, cpy); - break; - case 'Q': - points.push(p.shift(), p.shift()); - cpx = p.shift(); - cpy = p.shift(); - points.push(cpx, cpy); - break; - case 'q': - points.push(cpx + p.shift(), cpy + p.shift()); - cpx += p.shift(); - cpy += p.shift(); - cmd = 'Q'; - points.push(cpx, cpy); - break; - case 'T': - ctlPtx = cpx, ctlPty = cpy; - prevCmd = ca[ca.length - 1]; - if (prevCmd.command === 'Q') { - ctlPtx = cpx + (cpx - prevCmd.points[0]); - ctlPty = cpy + (cpy - prevCmd.points[1]); - } - cpx = p.shift(); - cpy = p.shift(); - cmd = 'Q'; - points.push(ctlPtx, ctlPty, cpx, cpy); - break; - case 't': - ctlPtx = cpx, ctlPty = cpy; - prevCmd = ca[ca.length - 1]; - if (prevCmd.command === 'Q') { - ctlPtx = cpx + (cpx - prevCmd.points[0]); - ctlPty = cpy + (cpy - prevCmd.points[1]); - } - cpx += p.shift(); - cpy += p.shift(); - cmd = 'Q'; - points.push(ctlPtx, ctlPty, cpx, cpy); - break; - case 'A': - rx = p.shift(); - ry = p.shift(); - psi = p.shift(); - fa = p.shift(); - fs = p.shift(); - - x1 = cpx, y1 = cpy; - cpx = p.shift(), cpy = p.shift(); - cmd = 'A'; - points = this._convertPoint( - x1, y1, cpx, cpy, fa, fs, rx, ry, psi - ); - break; - case 'a': - rx = p.shift(); - ry = p.shift(); - psi = p.shift(); - fa = p.shift(); - fs = p.shift(); - - x1 = cpx, y1 = cpy; - cpx += p.shift(); - cpy += p.shift(); - cmd = 'A'; - points = this._convertPoint( - x1, y1, cpx, cpy, fa, fs, rx, ry, psi - ); - break; - - } - - ca.push({ - command : cmd || c, - points : points - }); - } - - if (c === 'z' || c === 'Z') { - ca.push({ - command : 'z', - points : [] - }); - } - } - - return ca; - - }, - - _convertPoint : function(x1, y1, x2, y2, fa, fs, rx, ry, psiDeg) { - var psi = psiDeg * (Math.PI / 180.0); - var xp = Math.cos(psi) * (x1 - x2) / 2.0 - + Math.sin(psi) * (y1 - y2) / 2.0; - var yp = -1 * Math.sin(psi) * (x1 - x2) / 2.0 - + Math.cos(psi) * (y1 - y2) / 2.0; - - var lambda = (xp * xp) / (rx * rx) + (yp * yp) / (ry * ry); - - if (lambda > 1) { - rx *= Math.sqrt(lambda); - ry *= Math.sqrt(lambda); - } - - var f = Math.sqrt((((rx * rx) * (ry * ry)) - - ((rx * rx) * (yp * yp)) - - ((ry * ry) * (xp * xp))) / ((rx * rx) * (yp * yp) - + (ry * ry) * (xp * xp)) - ); - - if (fa === fs) { - f *= -1; - } - if (isNaN(f)) { - f = 0; - } - - var cxp = f * rx * yp / ry; - var cyp = f * -ry * xp / rx; - - var cx = (x1 + x2) / 2.0 - + Math.cos(psi) * cxp - - Math.sin(psi) * cyp; - var cy = (y1 + y2) / 2.0 - + Math.sin(psi) * cxp - + Math.cos(psi) * cyp; - - var vMag = function(v) { - return Math.sqrt(v[0] * v[0] + v[1] * v[1]); - }; - var vRatio = function(u, v) { - return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v)); - }; - var vAngle = function(u, v) { - return (u[0] * v[1] < u[1] * v[0] ? -1 : 1) - * Math.acos(vRatio(u, v)); - }; - var theta = vAngle([ 1, 0 ], [ (xp - cxp) / rx, (yp - cyp) / ry ]); - var u = [ (xp - cxp) / rx, (yp - cyp) / ry ]; - var v = [ (-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry ]; - var dTheta = vAngle(u, v); - - if (vRatio(u, v) <= -1) { - dTheta = Math.PI; - } - if (vRatio(u, v) >= 1) { - dTheta = 0; - } - if (fs === 0 && dTheta > 0) { - dTheta = dTheta - 2 * Math.PI; - } - if (fs === 1 && dTheta < 0) { - dTheta = dTheta + 2 * Math.PI; - } - return [ cx, cy, rx, ry, theta, dTheta, psi, fs ]; - }, - - /** - * 创建路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - var path = style.path; - - var pathArray = this.pathArray || this._parsePathData(path); - - // 平移坐标 - var x = style.x || 0; - var y = style.y || 0; - - var p; - // 记录边界点,用于判断inside - var pointList = style.pointList = []; - var singlePointList = []; - for (var i = 0, l = pathArray.length; i < l; i++) { - if (pathArray[i].command.toUpperCase() == 'M') { - singlePointList.length > 0 - && pointList.push(singlePointList); - singlePointList = []; - } - p = pathArray[i].points; - for (var j = 0, k = p.length; j < k; j += 2) { - singlePointList.push([p[j] + x, p[j+1] + y]); - } - } - singlePointList.length > 0 && pointList.push(singlePointList); - - var c; - for (var i = 0, l = pathArray.length; i < l; i++) { - c = pathArray[i].command; - p = pathArray[i].points; - // 平移变换 - for (var j = 0, k = p.length; j < k; j++) { - if (j % 2 === 0) { - p[j] += x; - } else { - p[j] += y; - } - } - switch (c) { - case 'L': - ctx.lineTo(p[0], p[1]); - break; - case 'M': - ctx.moveTo(p[0], p[1]); - break; - case 'C': - ctx.bezierCurveTo(p[0], p[1], p[2], p[3], p[4], p[5]); - break; - case 'Q': - ctx.quadraticCurveTo(p[0], p[1], p[2], p[3]); - break; - case 'A': - var cx = p[0]; - var cy = p[1]; - var rx = p[2]; - var ry = p[3]; - var theta = p[4]; - var dTheta = p[5]; - var psi = p[6]; - var fs = p[7]; - var r = (rx > ry) ? rx : ry; - var scaleX = (rx > ry) ? 1 : rx / ry; - var scaleY = (rx > ry) ? ry / rx : 1; - - ctx.translate(cx, cy); - ctx.rotate(psi); - ctx.scale(scaleX, scaleY); - ctx.arc(0, 0, r, theta, theta + dTheta, 1 - fs); - ctx.scale(1 / scaleX, 1 / scaleY); - ctx.rotate(-psi); - ctx.translate(-cx, -cy); - break; - case 'z': - ctx.closePath(); - break; - } - } - - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style 样式 - */ - getRect : function(style) { - if (style.__rect) { - return style.__rect; - } - - var lineWidth; - if (style.brushType == 'stroke' || style.brushType == 'fill') { - lineWidth = style.lineWidth || 1; - } - else { - lineWidth = 0; - } - - var minX = Number.MAX_VALUE; - var maxX = Number.MIN_VALUE; - - var minY = Number.MAX_VALUE; - var maxY = Number.MIN_VALUE; - - // 平移坐标 - var x = style.x || 0; - var y = style.y || 0; - - var pathArray = this.pathArray || this._parsePathData(style.path); - for (var i = 0; i < pathArray.length; i++) { - var p = pathArray[i].points; - - for (var j = 0; j < p.length; j++) { - if (j % 2 === 0) { - if (p[j] + x < minX) { - minX = p[j] + x; - } - if (p[j] + x > maxX) { - maxX = p[j] + x; - } - } - else { - if (p[j] + y < minY) { - minY = p[j] + y; - } - if (p[j] + y > maxY) { - maxY = p[j] + y; - } - } - } - } - - var rect; - if (minX === Number.MAX_VALUE - || maxX === Number.MIN_VALUE - || minY === Number.MAX_VALUE - || maxY === Number.MIN_VALUE - ) { - rect = { - x : 0, - y : 0, - width : 0, - height : 0 - }; - } - else { - rect = { - x : Math.round(minX - lineWidth / 2), - y : Math.round(minY - lineWidth / 2), - width : maxX - minX + lineWidth, - height : maxY - minY + lineWidth - }; - } - style.__rect = rect; - return rect; - } - }; - - require('../tool/util').inherits(Path, Base); - return Path; -}); -/** - * zrender: 图形空间辅助类 - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * isInside:是否在区域内部 - * isOutside:是否在区域外部 - * getTextWidth:测算单行文本宽度 - */ -define( - 'zrender/tool/area',['require','../tool/util','../shape/Path'],function(require) { - var util = require('../tool/util'); - - var _ctx; - - var _textWidthCache = {}; - var _textHeightCache = {}; - var _textWidthCacheCounter = 0; - var _textHeightCacheCounter = 0; - var TEXT_CACHE_MAX = 20000; - - /** - * 包含判断 - * - * @param {Object} shape : 图形 - * @param {Object} area : 目标区域 - * @param {number} x : 横坐标 - * @param {number} y : 纵坐标 - */ - function isInside(shape, area, x, y) { - if (!area || !shape) { - // 无参数或不支持类型 - return false; - } - var zoneType = shape.type; - - _ctx = _ctx || util.getContext(); - - if (!_isInsideRectangle(area.__rect || shape.getRect(area), x, y)) { - // 不在矩形区域内直接返回false - return false; - } - - // 未实现或不可用时(excanvas不支持)则数学运算,主要是line,brokenLine,ring - var _mathReturn = _mathMethod(zoneType, area, x, y); - if (typeof _mathReturn != 'undefined') { - return _mathReturn; - } - - if (zoneType != 'bezier-curve' - && shape.buildPath - && _ctx.isPointInPath - ) { - return _buildPathMethod(shape, _ctx, area, x, y); - } - else if (_ctx.getImageData) { - return _pixelMethod(shape, area, x, y); - } - - // 上面的方法都行不通时 - switch (zoneType) { - case 'heart': //心形---------10 // Todo,不精确 - case 'droplet':// 水滴----------11 // Todo,不精确 - case 'ellipse': // Todo,不精确 - return true; - // 旋轮曲线 不准确 - case 'trochoid': - var _r = area.location == 'out' - ? area.r1 + area.r2 + area.d - : area.r1 - area.r2 + area.d; - return _isInsideCircle(area, x, y, _r); - // 玫瑰线 不准确 - case 'rose' : - return _isInsideCircle(area, x, y, area.maxr); - //路径,椭圆,曲线等-----------------13 - default: - return false; // Todo,暂不支持 - } - } - - /** - * 用数学方法判断,三个方法中最快,但是支持的shape少 - * - * @param {string} zoneType : 图形类型 - * @param {Object} area :目标区域 - * @param {number} x : 横坐标 - * @param {number} y : 纵坐标 - * @return {boolean=} true表示坐标处在图形中 - */ - function _mathMethod(zoneType, area, x, y) { - // 在矩形内则部分图形需要进一步判断 - switch (zoneType) { - //线-----------------------1 - case 'line': - return _isInsideLine(area, x, y); - //折线----------------------2 - case 'broken-line': - return _isInsideBrokenLine(area, x, y); - //文本----------------------3 - case 'text': - return true; - //圆环----------------------4 - case 'ring': - return _isInsideRing(area, x, y); - //矩形----------------------5 - case 'rectangle': - return true; - //圆形----------------------6 - case 'circle': - return _isInsideCircle(area, x, y, area.r); - //扇形----------------------7 - case 'sector': - return _isInsideSector(area, x, y); - //多边形---------------------8 - case 'path': - return _isInsidePath(area, x, y); - case 'polygon': - case 'star': - case 'isogon': - return _isInsidePolygon(area, x, y); - //图片----------------------9 - case 'image': - return true; - } - } - - /** - * 通过buildPath方法来判断,三个方法中较快,但是不支持线条类型的shape, - * 而且excanvas不支持isPointInPath方法 - * - * @param {Object} shape : shape - * @param {Object} context : 上下文 - * @param {Object} area :目标区域 - * @param {number} x : 横坐标 - * @param {number} y : 纵坐标 - * @return {boolean} true表示坐标处在图形中 - */ - function _buildPathMethod(shape, context, area, x, y) { - // 图形类实现路径创建了则用类的path - context.beginPath(); - shape.buildPath(context, area); - context.closePath(); - return context.isPointInPath(x, y); - } - - /** - * 通过像素值来判断,三个方法中最慢,但是支持广,不足之处是excanvas不支持像素处理 - * - * @param {Object} shape shape类 - * @param {Object} area 目标区域 - * @param {number} x 横坐标 - * @param {number} y 纵坐标 - * @return {boolean} true表示坐标处在图形中 - */ - function _pixelMethod(shape, area, x, y) { - var _rect = area.__rect || shape.getRect(area); - var _context = util.getPixelContext(); - var _offset = util.getPixelOffset(); - - util.adjustCanvasSize(x, y); - _context.clearRect(_rect.x, _rect.y, _rect.width, _rect.height); - _context.beginPath(); - shape.brush(_context, {style : area}); - _context.closePath(); - - return _isPainted(_context, x + _offset.x, y + _offset.y); - } - - /** - * 坐标像素值,判断坐标是否被作色 - * - * @param {Object} context : 上下文 - * @param {number} x : 横坐标 - * @param {number} y : 纵坐标 - * @param {number=} unit : 触发的精度,越大越容易触发,可选,缺省是为1 - * @return {boolean} 已经被画过返回true - */ - function _isPainted(context, x, y, unit) { - var pixelsData; - - if (typeof unit != 'undefined') { - unit = (unit || 1 ) >> 1; - pixelsData = context.getImageData( - x - unit, - y - unit, - unit + unit, - unit + unit - ).data; - } - else { - pixelsData = context.getImageData(x, y, 1, 1).data; - } - - var len = pixelsData.length; - while (len--) { - if (pixelsData[len] !== 0) { - return true; - } - } - - return false; - } - - /** - * !isInside - */ - function isOutside(shape, area, x, y) { - return !isInside(shape, area, x, y); - } - - /** - * 线段包含判断 - */ - function _isInsideLine(area, x, y) { - var _x1 = area.xStart; - var _y1 = area.yStart; - var _x2 = area.xEnd; - var _y2 = area.yEnd; - var _l = Math.max(area.lineWidth, 5); - var _a = 0; - var _b = _x1; - - var minX, maxX; - if (_x1 < _x2) { - minX = _x1 - _l; maxX = _x2 + _l; - } else { - minX = _x2 - _l; maxX = _x1 + _l; - } - - var minY, maxY; - if (_y1 < _y2) { - minY = _y1 - _l; maxY = _y2 + _l; - } else { - minY = _y2 - _l; maxY = _y1 + _l; - } - - if (x < minX || x > maxX || y < minY || y > maxY) { - return false; - } - - if (_x1 !== _x2) { - _a = (_y1 - _y2) / (_x1 - _x2); - _b = (_x1 * _y2 - _x2 * _y1) / (_x1 - _x2) ; - } - else { - return Math.abs(x - _x1) <= _l / 2; - } - - var _s = (_a * x - y + _b) * (_a * x - y + _b) / (_a * _a + 1); - return _s <= _l / 2 * _l / 2; - } - - function _isInsideBrokenLine(area, x, y) { - var pointList = area.pointList; - var lineArea = { - xStart : 0, - yStart : 0, - xEnd : 0, - yEnd : 0, - lineWidth : 0 - }; - for (var i = 0, l = pointList.length - 1; i < l; i++) { - lineArea.xStart = pointList[i][0]; - lineArea.yStart = pointList[i][1]; - lineArea.xEnd = pointList[i + 1][0]; - lineArea.yEnd = pointList[i + 1][1]; - lineArea.lineWidth = Math.max(area.lineWidth, 10); - - if (_isInsideLine(lineArea, x, y)) { - return true; - } - } - - return false; - } - - function _isInsideRing(area, x, y) { - return _isInsideCircle(area, x, y, area.r) - && !_isInsideCircle({x: area.x, y: area.y}, x, y, area.r0 || 0); - } - - /** - * 矩形包含判断 - */ - function _isInsideRectangle(area, x, y) { - return x >= area.x - && x <= (area.x + area.width) - && y >= area.y - && y <= (area.y + area.height); - } - - /** - * 圆形包含判断 - */ - function _isInsideCircle(area, x, y, r) { - return (x - area.x) * (x - area.x) + (y - area.y) * (y - area.y) - < r * r; - } - - /** - * 扇形包含判断 - */ - function _isInsideSector(area, x, y) { - if (!_isInsideCircle(area, x, y, area.r) - || (area.r0 > 0 - && _isInsideCircle( - { - x : area.x, - y : area.y - }, - x, y, - area.r0 - ) - ) - ){ - // 大圆外或者小圆内直接false - return false; - } - - // 判断夹角 - if (Math.abs(area.endAngle - area.startAngle) >= 360) { - // 大于360度的扇形,在环内就为true - return true; - } - - var angle = (360 - - Math.atan2(y - area.y, x - area.x) / Math.PI - * 180) - % 360; - var endA = (360 + area.endAngle) % 360; - var startA = (360 + area.startAngle) % 360; - if (endA > startA) { - return (angle >= startA && angle <= endA); - } - - return !(angle >= endA && angle <= startA); - } - - /** - * 多边形包含判断 - * 警告:下面这段代码会很难看,建议跳过~ - */ - function _isInsidePolygon(area, x, y) { - /** - * 射线判别法 - * 如果一个点在多边形内部,任意角度做射线肯定会与多边形要么有一个交点,要么有与多边形边界线重叠 - * 如果一个点在多边形外部,任意角度做射线要么与多边形有一个交点, - * 要么有两个交点,要么没有交点,要么有与多边形边界线重叠。 - */ - var i; - var j; - var polygon = area.pointList; - var N = polygon.length; - var inside = false; - var redo = true; - var v; - - for (i = 0; i < N; ++i) { - // 是否在顶点上 - if (polygon[i][0] == x && polygon[i][1] == y ) { - redo = false; - inside = true; - break; - } - } - - if (redo) { - redo = false; - inside = false; - for (i = 0,j = N - 1; i < N; j = i++) { - if ((polygon[i][1] < y && y < polygon[j][1]) - || (polygon[j][1] < y && y < polygon[i][1]) - ) { - if (x <= polygon[i][0] || x <= polygon[j][0]) { - v = (y - polygon[i][1]) - * (polygon[j][0] - polygon[i][0]) - / (polygon[j][1] - polygon[i][1]) - + polygon[i][0]; - if (x < v) { // 在线的左侧 - inside = !inside; - } - else if (x == v) { // 在线上 - inside = true; - break; - } - } - } - else if (y == polygon[i][1]) { - if (x < polygon[i][0]) { // 交点在顶点上 - polygon[i][1] > polygon[j][1] ? --y : ++y; - //redo = true; - break; - } - } - else if (polygon[i][1] == polygon[j][1] // 在水平的边界线上 - && y == polygon[i][1] - && ((polygon[i][0] < x && x < polygon[j][0]) - || (polygon[j][0] < x && x < polygon[i][0])) - ) { - inside = true; - break; - } - } - } - return inside; - } - - /** - * 路径包含判断,依赖多边形判断 - */ - function _isInsidePath(area, x, y) { - if (!area.pointList) { - require('../shape/Path').prototype.buildPath(_ctx, area); - } - var pointList = area.pointList; - var insideCatch = false; - for (var i = 0, l = pointList.length; i < l; i++) { - insideCatch = _isInsidePolygon( - { pointList : pointList[i] }, x, y - ); - - if (insideCatch) { - break; - } - } - - return insideCatch; - } - - /** - * 测算多行文本宽度 - * @param {Object} text - * @param {Object} textFont - */ - function getTextWidth(text, textFont) { - var key = text+':'+textFont; - if (_textWidthCache[key]) { - return _textWidthCache[key]; - } - _ctx = _ctx || util.getContext(); - _ctx.save(); - - if (textFont) { - _ctx.font = textFont; - } - - text = (text + '').split('\n'); - var width = 0; - for (var i = 0, l = text.length; i < l; i++) { - width = Math.max( - _ctx.measureText(text[i]).width, - width - ); - } - _ctx.restore(); - - _textWidthCache[key] = width; - if (++_textWidthCacheCounter > TEXT_CACHE_MAX) { - // 内存释放 - _textWidthCacheCounter = 0; - _textWidthCache = {}; - } - - return width; - } - - /** - * 测算多行文本高度 - * @param {Object} text - * @param {Object} textFont - */ - function getTextHeight(text, textFont) { - var key = text+':'+textFont; - if (_textHeightCache[key]) { - return _textHeightCache[key]; - } - - _ctx = _ctx || util.getContext(); - - _ctx.save(); - if (textFont) { - _ctx.font = textFont; - } - - text = (text + '').split('\n'); - //比较粗暴 - var height = (_ctx.measureText('国').width + 2) * text.length; - - _ctx.restore(); - - _textHeightCache[key] = height; - if (++_textHeightCacheCounter > TEXT_CACHE_MAX) { - // 内存释放 - _textHeightCacheCounter = 0; - _textHeightCache = {}; - } - return height; - } - - return { - isInside : isInside, - isOutside : isOutside, - getTextWidth : getTextWidth, - getTextHeight : getTextHeight - }; - } -); - -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:文字 - * 可配图形属性: - { - // 基础属性 - shape : 'text', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,横坐标 - y : {number}, // 必须,纵坐标 - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',线条颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 必须,文本内容 - textFont : {string}, // 默认为null,文本文字样式,eg:'bold 18px verdana' - textAlign : {string}, // 默认为start,文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认为middle,文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - maxWidth : {number} // 默认为null,最大宽度 - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'text', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - color : 'red', - text : 'Baidu' - }, - myName : 'kener', //可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - 'zrender/shape/Text',['require','../tool/area','./Base','../tool/util'],function (require) { - var area = require('../tool/area'); - var Base = require('./Base'); - - function Text(options) { - Base.call(this, options); - } - - Text.prototype = { - type: 'text', - - /** - * 画刷,重载基类方法 - * @param {Context2D} ctx Canvas 2D上下文 - * @param isHighlight 是否为高亮状态 - */ - brush : function(ctx, isHighlight) { - var style = this.style; - if (isHighlight) { - // 根据style扩展默认高亮样式 - style = this.getHighlightStyle( - style, this.highlightStyle || {} - ); - } - - if (typeof(style.text) == 'undefined' || style.text === false) { - return; - } - - ctx.save(); - this.setContext(ctx, style); - - // 设置transform - this.setTransform(ctx); - - if (style.textFont) { - ctx.font = style.textFont; - } - ctx.textAlign = style.textAlign || 'start'; - ctx.textBaseline = style.textBaseline || 'middle'; - - var text = (style.text + '').split('\n'); - var lineHeight = area.getTextHeight('国', style.textFont); - var rect = this.getRect(style); - var x = style.x; - var y; - if (style.textBaseline == 'top') { - y = rect.y; - } - else if (style.textBaseline == 'bottom') { - y = rect.y + lineHeight; - } - else { - y = rect.y + lineHeight / 2; - } - - for (var i = 0, l = text.length; i < l; i++) { - if (style.maxWidth) { - switch (style.brushType) { - case 'fill': - ctx.fillText( - text[i], - x, y, style.maxWidth - ); - break; - case 'stroke': - ctx.strokeText( - text[i], - x, y, style.maxWidth - ); - break; - case 'both': - ctx.fillText( - text[i], - x, y, style.maxWidth - ); - ctx.strokeText( - text[i], - x, y, style.maxWidth - ); - break; - default: - ctx.fillText( - text[i], - x, y, style.maxWidth - ); - } - } - else{ - switch (style.brushType) { - case 'fill': - ctx.fillText(text[i], x, y); - break; - case 'stroke': - ctx.strokeText(text[i], x, y); - break; - case 'both': - ctx.fillText(text[i], x, y); - ctx.strokeText(text[i], x, y); - break; - default: - ctx.fillText(text[i], x, y); - } - } - y += lineHeight; - } - - ctx.restore(); - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function(style) { - if (style.__rect) { - return style.__rect; - } - - var width = area.getTextWidth(style.text, style.textFont); - var height = area.getTextHeight(style.text, style.textFont); - - var textX = style.x; //默认start == left - if (style.textAlign == 'end' || style.textAlign == 'right') { - textX -= width; - } - else if (style.textAlign == 'center') { - textX -= (width / 2); - } - - var textY; - if (style.textBaseline == 'top') { - textY = style.y; - } - else if (style.textBaseline == 'bottom') { - textY = style.y - height; - } - else { - // middle - textY = style.y - height / 2; - } - - style.__rect = { - x : textX, - y : textY, - width : width, - height : height - }; - - return style.__rect; - } - }; - - require('../tool/util').inherits(Text, Base); - return Text; - } -); - -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) , - * strwind (@劲风FEI, yaofeifei@baidu.com) - * - * shape类:矩形 - * 可配图形属性: - { - // 基础属性 - shape : 'rectangle', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,左上角横坐标 - y : {number}, // 必须,左上角纵坐标 - width : {number}, // 必须,宽度 - height : {number}, // 必须,高度 - radius : {array}, // 默认为[0],圆角 - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为top,附加文本位置。 - // inside | left | right | top | bottom - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'rectangle', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - width : 150, - height : 50, - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - 'zrender/shape/Rectangle',['require','./Base','../tool/util'],function (require) { - var Base = require('./Base'); - - function Rectangle(options) { - Base.call(this, options); - } - - Rectangle.prototype = { - type: 'rectangle', - - /** - * 绘制圆角矩形 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - _buildRadiusPath: function(ctx, style) { - //左上、右上、右下、左下角的半径依次为r1、r2、r3、r4 - //r缩写为1 相当于 [1, 1, 1, 1] - //r缩写为[1] 相当于 [1, 1, 1, 1] - //r缩写为[1, 2] 相当于 [1, 2, 1, 2] - //r缩写为[1, 2, 3] 相当于 [1, 2, 3, 2] - var x = style.x; - var y = style.y; - var width = style.width; - var height = style.height; - var r = style.radius; - var r1; - var r2; - var r3; - var r4; - - if(typeof r === 'number') { - r1 = r2 = r3 = r4 = r; - } - else if(r instanceof Array) { - if (r.length === 1) { - r1 = r2 = r3 = r4 = r[0]; - } - else if(r.length === 2) { - r1 = r3 = r[0]; - r2 = r4 = r[1]; - } - else if(r.length === 3) { - r1 = r[0]; - r2 = r4 = r[1]; - r3 = r[2]; - } else { - r1 = r[0]; - r2 = r[1]; - r3 = r[2]; - r4 = r[3]; - } - } else { - r1 = r2 = r3 = r4 = 0; - } - ctx.moveTo(x + r1, y); - ctx.lineTo(x + width - r2, y); - r2 !== 0 && ctx.quadraticCurveTo( - x + width, y, x + width, y + r2 - ); - ctx.lineTo(x + width, y + height - r3); - r3 !== 0 && ctx.quadraticCurveTo( - x + width, y + height, x + width - r3, y + height - ); - ctx.lineTo(x + r4, y + height); - r4 !== 0 && ctx.quadraticCurveTo( - x, y + height, x, y + height - r4 - ); - ctx.lineTo(x, y + r1); - r1 !== 0 && ctx.quadraticCurveTo(x, y, x + r1, y); - }, - - /** - * 创建矩形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - if(!style.radius) { - ctx.moveTo(style.x, style.y); - ctx.lineTo(style.x + style.width, style.y); - ctx.lineTo(style.x + style.width, style.y + style.height); - ctx.lineTo(style.x, style.y + style.height); - ctx.lineTo(style.x, style.y); - //ctx.rect(style.x, style.y, style.width, style.height); - } else { - this._buildRadiusPath(ctx, style); - } - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function(style) { - if (style.__rect) { - return style.__rect; - } - - var lineWidth; - if (style.brushType == 'stroke' || style.brushType == 'fill') { - lineWidth = style.lineWidth || 1; - } - else { - lineWidth = 0; - } - style.__rect = { - x : Math.round(style.x - lineWidth / 2), - y : Math.round(style.y - lineWidth / 2), - width : style.width + lineWidth, - height : style.height + lineWidth - }; - - return style.__rect; - } - }; - - require('../tool/util').inherits(Rectangle, Base); - return Rectangle; - } -); -/** - * zrender: loading特效类 - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * errorrik (errorrik@gmail.com) - */ - -define( - 'zrender/loadingEffect/Base',['require','../tool/util','../shape/Text','../shape/Rectangle'],function(require) { - var util = require('../tool/util'); - var TextShape = require('../shape/Text'); - var RectangleShape = require('../shape/Rectangle'); - - - var DEFAULT_TEXT = 'Loading...'; - var DEFAULT_TEXT_FONT = 'normal 16px Arial'; - - /** - * @constructor - * - * @param {Object} options 选项 - * @param {color} options.backgroundColor 背景颜色 - * @param {Object} options.textStyle 文字样式,同shape/text.style - * @param {number=} options.progress 进度参数,部分特效有用 - * @param {Object=} options.effect 特效参数,部分特效有用 - * - * { - * effect, - * //loading话术 - * text:'', - * // 水平安放位置,默认为 'center',可指定x坐标 - * x:'center' || 'left' || 'right' || {number}, - * // 垂直安放位置,默认为'top',可指定y坐标 - * y:'top' || 'bottom' || {number}, - * - * textStyle:{ - * textFont: 'normal 20px Arial' || {textFont}, //文本字体 - * color: {color} - * } - * } - */ - function Base(options) { - this.setOptions(options); - } - - /** - * 创建loading文字图形 - * - * @param {Object} textStyle 文字style,同shape/text.style - */ - Base.prototype.createTextShape = function (textStyle) { - return new TextShape({ - highlightStyle : util.merge( - { - x : this.canvasWidth / 2, - y : this.canvasHeight / 2, - text : DEFAULT_TEXT, - textAlign : 'center', - textBaseline : 'middle', - textFont : DEFAULT_TEXT_FONT, - color: '#333', - brushType : 'fill' - }, - textStyle, - true - ) - }); - }; - - /** - * 获取loading背景图形 - * - * @param {color} color 背景颜色 - */ - Base.prototype.createBackgroundShape = function (color) { - return new RectangleShape({ - highlightStyle : { - x : 0, - y : 0, - width : this.canvasWidth, - height : this.canvasHeight, - brushType : 'fill', - color : color - } - }); - }; - - Base.prototype.start = function (painter) { - this.canvasWidth = painter._width; - this.canvasHeight = painter._height; - - function addShapeHandle(param) { - painter.storage.addHover(param); - } - function refreshHandle() { - painter.refreshHover(); - } - this.loadingTimer = this._start(addShapeHandle, refreshHandle); - }; - - Base.prototype._start = function (/*addShapeHandle, refreshHandle*/) { - return setInterval(function(){}, 10000); - }; - - Base.prototype.stop = function () { - clearInterval(this.loadingTimer); - }; - - Base.prototype.setOptions = function (options) { - this.options = options || {}; - }; - - Base.prototype.adjust = function (value, region) { - if (value <= region[0]) { - value = region[0]; - } - else if (value >= region[1]) { - value = region[1]; - } - return value; - }; - - return Base; - } -); - -/** - * zrender - * - * @author lang( shenyi01@baidu.com ) - * - * shape类:图片 - * 可配图形属性: - { - // 基础属性 - shape : 'image', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,左上角横坐标 - y : {number}, // 必须,左上角纵坐标 - width : {number}, // 可选,宽度 - height : {number}, // 可选,高度 - sx : {number}, // 可选, 从图片中裁剪的x - sy : {number}, // 可选, 从图片中裁剪的y - sWidth : {number}, // 可选, 从图片中裁剪的宽度 - sHeight : {number}, // 可选, 从图片中裁剪的高度 - image : {string|Image} // 必须,图片url或者图片对象 - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为top,附加文本位置。 - // inside | left | right | top | bottom - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'image', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - width : 150, - height : 50, - image : 'tests.jpg', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - 'zrender/shape/Image',['require','./Base','../tool/util'],function (require) { - var _cache = {}; - var _needsRefresh = []; - var _refreshTimeout; - - var Base = require('./Base'); - - function ZImage(options) { - Base.call(this, options); - } - - ZImage.prototype = { - type: 'image', - brush : function(ctx, isHighlight, refresh) { - var style = this.style || {}; - - if (isHighlight) { - // 根据style扩展默认高亮样式 - style = this.getHighlightStyle( - style, this.highlightStyle || {} - ); - } - - var image = style.image; - var me = this; - - if (typeof(image) === 'string') { - var src = image; - if (_cache[src]) { - image = _cache[src]; - } - else { - image = new Image();//document.createElement('image'); - image.onload = function(){ - image.onload = null; - clearTimeout(_refreshTimeout); - _needsRefresh.push( me ); - // 防止因为缓存短时间内触发多次onload事件 - _refreshTimeout = setTimeout(function(){ - refresh && refresh( _needsRefresh ); - // 清空needsRefresh - _needsRefresh = []; - }, 10); - }; - _cache[src] = image; - - image.src = src; - } - } - if (image) { - //图片已经加载完成 - if (image.nodeName.toUpperCase() == 'IMG') { - if (window.ActiveXObject) { - if (image.readyState != 'complete') { - return; - } - } - else { - if (!image.complete) { - return; - } - } - } - // Else is canvas - - var width = style.width || image.width; - var height = style.height || image.height; - var x = style.x; - var y = style.y; - - // 图片加载失败 - if (!image.width || !image.height) { - return; - } - - ctx.save(); - this.setContext(ctx, style); - - // 设置transform - this.setTransform(ctx); - - if (style.sWidth && style.sHeight) { - var sx = style.sx || 0; - var sy = style.sy || 0; - ctx.drawImage( - image, - sx, sy, style.sWidth, style.sHeight, - x, y, width, height - ); - } - else if (style.sx && style.sy) { - var sx = style.sx; - var sy = style.sy; - var sWidth = width - sx; - var sHeight = height - sy; - ctx.drawImage( - image, - sx, sy, sWidth, sHeight, - x, y, width, height - ); - } - else { - ctx.drawImage(image, x, y, width, height); - } - // 如果没设置宽和高的话自动根据图片宽高设置 - style.width = width; - style.height = height; - this.style.width = width; - this.style.height = height; - - - this.drawText(ctx, style, this.style); - - ctx.restore(); - } - }, - - /** - * 创建路径,用于判断hover时调用isPointInPath~ - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - ctx.rect(style.x, style.y, style.width, style.height); - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function(style) { - return { - x : style.x, - y : style.y, - width : style.width, - height : style.height - }; - } - }; - - require('../tool/util').inherits(ZImage, Base); - return ZImage; - } -); -/** - * Painter绘图模块 - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * errorrik (errorrik@gmail.com) - */ - - - -define( - 'zrender/Painter',['require','./config','./tool/util','./tool/log','./tool/matrix','./loadingEffect/Base','./shape/Image'],function (require) { - - - - var config = require('./config'); - var util = require('./tool/util'); - var log = require('./tool/log'); - var matrix = require('./tool/matrix'); - var BaseLoadingEffect = require('./loadingEffect/Base'); - - // retina 屏幕优化 - var devicePixelRatio = window.devicePixelRatio || 1; - devicePixelRatio = Math.max(devicePixelRatio, 1); - var vmlCanvasManager = window.G_vmlCanvasManager; - - /** - * 返回false的方法,用于避免页面被选中 - * - * @inner - */ - function returnFalse() { - return false; - } - - /** - * 什么都不干的空方法 - * - * @inner - */ - function doNothing() {} - - /** - * 绘图类 (V) - * - * @param {HTMLElement} root 绘图区域 - * @param {storage} storage Storage实例 - */ - function Painter(root, storage) { - this.root = root; - this.storage = storage; - - root.innerHTML = ''; - this._width = this._getWidth(); // 宽,缓存记录 - this._height = this._getHeight(); // 高,缓存记录 - - var domRoot = document.createElement('div'); - this._domRoot = domRoot; - - //domRoot.onselectstart = returnFalse; // 避免页面选中的尴尬 - domRoot.style.position = 'relative'; - domRoot.style.overflow = 'hidden'; - domRoot.style.width = this._width + 'px'; - domRoot.style.height = this._height + 'px'; - root.appendChild(domRoot); - - this._layers = {}; - - this._layerConfig = {}; - - this._loadingEffect = new BaseLoadingEffect({}); - this.shapeToImage = this._createShapeToImageProcessor(); - - // 创建各层canvas - // 背景 - this._bgDom = createDom('bg', 'div', this); - domRoot.appendChild(this._bgDom); - - // 高亮 - var hoverLayer = new Layer('_zrender_hover_', this); - this._layers['hover'] = hoverLayer; - domRoot.appendChild(hoverLayer.dom); - hoverLayer.initContext(); - - hoverLayer.onselectstart = returnFalse; - - var me = this; - this.updatePainter = function(shapeList, callback) { - me.update(shapeList, callback); - }; - } - - /** - * 首次绘图,创建各种dom和context - * - * @param {Function=} callback 绘画结束后的回调函数 - */ - Painter.prototype.render = function (callback) { - if (this.isLoading()) { - this.hideLoading(); - } - // TODO - this.refresh(callback, true); - - return this; - }; - - /** - * 刷新 - * - * @param {Function=} callback 刷新结束后的回调函数 - * @param {Boolean} paintAll 强制绘制所有shape - */ - Painter.prototype.refresh = function (callback, paintAll) { - var list = this.storage.getShapeList(true); - this._paintList(list, paintAll); - - if (typeof callback == 'function') { - callback(); - } - - return this; - }; - - Painter.prototype._paintList = function(list, paintAll) { - - if (typeof(paintAll) == 'undefined') { - paintAll = false; - } - - this._updateLayerStatus(list); - - var currentLayer; - var currentZLevel; - var ctx; - - for (var id in this._layers) { - if (id !== 'hover') { - this._layers[id].unusedCount++; - } - } - - var invTransform = []; - - for (var i = 0, l = list.length; i < l; i++) { - var shape = list[i]; - - if (currentZLevel !== shape.zlevel) { - currentLayer = this.getLayer(shape.zlevel, currentLayer); - ctx = currentLayer.ctx; - currentZLevel = shape.zlevel; - - // Reset the count - currentLayer.unusedCount = 0; - - if (currentLayer.dirty || paintAll) { - currentLayer.clear(); - } - } - - // Start group clipping - if (shape.__startClip && !vmlCanvasManager) { - var clipShape = shape.__startClip; - ctx.save(); - // Set transform - if (clipShape.needTransform) { - var m = clipShape.transform; - matrix.invert(invTransform, m); - ctx.transform( - m[0], m[1], - m[2], m[3], - m[4], m[5] - ); - } - - ctx.beginPath(); - clipShape.buildPath(ctx, clipShape.style); - ctx.clip(); - - // Transform back - if (clipShape.needTransform) { - var m = invTransform; - ctx.transform( - m[0], m[1], - m[2], m[3], - m[4], m[5] - ); - } - } - - if ((currentLayer.dirty || paintAll) && !shape.invisible) { - if ( - !shape.onbrush - || (shape.onbrush && !shape.onbrush(ctx, false)) - ) { - if (config.catchBrushException) { - try { - shape.brush(ctx, false, this.updatePainter); - } - catch(error) { - log( - error, - 'brush error of ' + shape.type, - shape - ); - } - } else { - shape.brush(ctx, false, this.updatePainter); - } - } - } - - // Stop group clipping - if (shape.__stopClip && !vmlCanvasManager) { - ctx.restore(); - } - - shape.__dirty = false; - } - - for (var id in this._layers) { - if (id !== 'hover') { - var layer = this._layers[id]; - layer.dirty = false; - // 删除过期的层 - if (layer.unusedCount >= 500) { - delete this._layers[id]; - layer.dom.parentNode.removeChild(layer.dom); - } - else if (layer.unusedCount == 1) { - layer.clear(); - } - } - } - }; - - Painter.prototype.getLayer = function(zlevel, prevLayer) { - // Change draw layer - var currentLayer = this._layers[zlevel]; - if (!currentLayer) { - // Create a new layer - currentLayer = new Layer(zlevel, this); - var prevDom = prevLayer ? prevLayer.dom : this._bgDom; - if (prevDom.nextSibling) { - prevDom.parentNode.insertBefore( - currentLayer.dom, - prevDom.nextSibling - ); - } else { - prevDom.parentNode.appendChild( - currentLayer.dom - ); - } - currentLayer.initContext(); - - this._layers[zlevel] = currentLayer; - - currentLayer.config = this._layerConfig[zlevel]; - } - - return currentLayer; - }; - - Painter.prototype._updateLayerStatus = function(list) { - - var layers = this._layers; - - var elCounts = {}; - for (var z in layers) { - if (z !== 'hover') { - elCounts[z] = layers[z].elCount; - layers[z].elCount = 0; - } - } - - for (var i = 0, l = list.length; i < l; i++) { - var shape = list[i]; - var zlevel = shape.zlevel; - var layer = layers[zlevel]; - if (layer) { - layer.elCount++; - // 已经被标记为需要刷新 - if (layer.dirty) { - continue; - } - layer.dirty = shape.__dirty; - } - } - - // 层中的元素数量有发生变化 - for (var z in layers) { - if (z !== 'hover') { - if (elCounts[z] !== layers[z].elCount) { - layers[z].dirty = true; - } - } - } - }; - - /** - * 视图更新 - * - * @param {Array} shapeList 需要更新的图形元素列表 - * @param {Function} callback 视图更新后回调函数 - */ - Painter.prototype.update = function (shapeList, callback) { - for (var i = 0, l = shapeList.length; i < l; i++) { - var shape = shapeList[i]; - this.storage.mod(shape.id); - } - - this.refresh(callback); - return this; - }; - - /** - * 设置loading特效 - * - * @param {Object} loadingEffect loading特效 - * @return {Painter} - */ - Painter.prototype.setLoadingEffect = function (loadingEffect) { - this._loadingEffect = loadingEffect; - return this; - }; - - /** - * 清除hover层外所有内容 - */ - Painter.prototype.clear = function () { - for (var k in this._layers) { - if (k == 'hover') { - continue; - } - this._layers[k].clear(); - } - - return this; - }; - - /** - * 修改指定zlevel的绘制参数 - */ - Painter.prototype.modLayer = function (zlevel, config) { - if (config) { - if (!this._layerConfig[zlevel]) { - this._layerConfig[zlevel] = config; - } else { - util.merge(this._layerConfig[zlevel], config, true); - } - - var layer = this._layers[zlevel]; - - if (layer) { - layer.config = this._layerConfig[zlevel]; - } - } - }; - - /** - * 刷新hover层 - */ - Painter.prototype.refreshHover = function () { - this.clearHover(); - var list = this.storage.getHoverShapes(true); - for (var i = 0, l = list.length; i < l; i++) { - this._brushHover(list[i]); - } - this.storage.delHover(); - - return this; - }; - - /** - * 清除hover层所有内容 - */ - Painter.prototype.clearHover = function () { - var hover = this._layers.hover; - hover && hover.clear(); - - return this; - }; - - /** - * 显示loading - * - * @param {Object=} loadingEffect loading效果对象 - */ - Painter.prototype.showLoading = function (loadingEffect) { - this._loadingEffect && this._loadingEffect.stop(); - loadingEffect && this.setLoadingEffect(loadingEffect); - this._loadingEffect.start(this); - this.loading = true; - - return this; - }; - - /** - * loading结束 - */ - Painter.prototype.hideLoading = function () { - this._loadingEffect.stop(); - - this.clearHover(); - this.loading = false; - return this; - }; - - /** - * loading结束判断 - */ - Painter.prototype.isLoading = function () { - return this.loading; - }; - - /** - * 区域大小变化后重绘 - */ - Painter.prototype.resize = function () { - var domRoot = this._domRoot; - domRoot.style.display = 'none'; - - var width = this._getWidth(); - var height = this._getHeight(); - - domRoot.style.display = ''; - - // 优化没有实际改变的resize - if (this._width != width || height != this._height){ - this._width = width; - this._height = height; - - domRoot.style.width = width + 'px'; - domRoot.style.height = height + 'px'; - - for (var id in this._layers) { - - this._layers[id].resize(width, height); - } - - this.refresh(null, true); - } - - return this; - }; - - /** - * 清除单独的一个层 - */ - Painter.prototype.clearLayer = function (k) { - var layer = this._layers[k]; - if (layer) { - layer.clear(); - } - }; - - /** - * 释放 - */ - Painter.prototype.dispose = function () { - if (this.isLoading()) { - this.hideLoading(); - } - - this.root.innerHTML = ''; - - this.root = - this.storage = - - this._domRoot = - this._layers = null; - }; - - Painter.prototype.getDomHover = function () { - return this._layers.hover.dom; - }; - - Painter.prototype.toDataURL = function (type, backgroundColor, args) { - if (vmlCanvasManager) { - return null; - } - - var imageDom = createDom('image', 'canvas', this); - this._bgDom.appendChild(imageDom); - var ctx = imageDom.getContext('2d'); - devicePixelRatio != 1 - && ctx.scale(devicePixelRatio, devicePixelRatio); - - ctx.fillStyle = backgroundColor || '#fff'; - ctx.rect( - 0, 0, - this._width * devicePixelRatio, - this._height * devicePixelRatio - ); - ctx.fill(); - - //升序遍历,shape上的zlevel指定绘画图层的z轴层叠 - - this.storage.iterShape( - function (shape) { - if (!shape.invisible) { - if (!shape.onbrush //没有onbrush - //有onbrush并且调用执行返回false或undefined则继续粉刷 - || (shape.onbrush && !shape.onbrush(ctx, false)) - ) { - if (config.catchBrushException) { - try { - shape.brush(ctx, false, this.updatePainter); - } - catch(error) { - log( - error, - 'brush error of ' + shape.type, - shape - ); - } - } - else { - shape.brush(ctx, false, this.updatePainter); - } - } - } - }, - { normal: 'up', update: true } - ); - var image = imageDom.toDataURL(type, args); - ctx = null; - this._bgDom.removeChild(imageDom); - return image; - }; - - /** - * 获取绘图区域宽度 - */ - Painter.prototype.getWidth = function () { - return this._width; - }; - - /** - * 获取绘图区域高度 - */ - Painter.prototype.getHeight = function () { - return this._height; - }; - - Painter.prototype._getWidth = function() { - var root = this.root; - var stl = root.currentStyle - || document.defaultView.getComputedStyle(root); - - return ((root.clientWidth || parseInt(stl.width, 10)) - - parseInt(stl.paddingLeft, 10) // 请原谅我这比较粗暴 - - parseInt(stl.paddingRight, 10)).toFixed(0) - 0; - }; - - Painter.prototype._getHeight = function () { - var root = this.root; - var stl = root.currentStyle - || document.defaultView.getComputedStyle(root); - - return ((root.clientHeight || parseInt(stl.height, 10)) - - parseInt(stl.paddingTop, 10) // 请原谅我这比较粗暴 - - parseInt(stl.paddingBottom, 10)).toFixed(0) - 0; - }; - - /** - * 鼠标悬浮刷画 - */ - Painter.prototype._brushHover = function (shape) { - var ctx = this._layers.hover.ctx; - - if (!shape.onbrush //没有onbrush - //有onbrush并且调用执行返回false或undefined则继续粉刷 - || (shape.onbrush && !shape.onbrush(ctx, true)) - ) { - // Retina 优化 - if (config.catchBrushException) { - try { - shape.brush(ctx, true, this.updatePainter); - } - catch(error) { - log( - error, 'hoverBrush error of ' + shape.type, shape - ); - } - } - else { - shape.brush(ctx, true, this.updatePainter); - } - } - }; - - Painter.prototype._shapeToImage = function ( - id, shape, width, height, devicePixelRatio - ) { - var canvas = document.createElement('canvas'); - var ctx = canvas.getContext('2d'); - var devicePixelRatio = window.devicePixelRatio || 1; - - canvas.style.width = width + 'px'; - canvas.style.height = height + 'px'; - canvas.setAttribute('width', width * devicePixelRatio); - canvas.setAttribute('height', height * devicePixelRatio); - - ctx.clearRect(0, 0, width * devicePixelRatio, height * devicePixelRatio); - - var shapeTransform = { - position : shape.position, - rotation : shape.rotation, - scale : shape.scale - }; - shape.position = [0, 0, 0]; - shape.rotation = 0; - shape.scale = [1, 1]; - if (shape) { - shape.brush(ctx, false); - } - - var ImageShape = require( './shape/Image' ); - var imgShape = new ImageShape({ - id : id, - style : { - x : 0, - y : 0, - image : canvas - } - }); - - if (shapeTransform.position != null) { - imgShape.position = shape.position = shapeTransform.position; - } - - if (shapeTransform.rotation != null) { - imgShape.rotation = shape.rotation = shapeTransform.rotation; - } - - if (shapeTransform.scale != null) { - imgShape.scale = shape.scale = shapeTransform.scale; - } - - return imgShape; - }; - - Painter.prototype._createShapeToImageProcessor = function () { - if (vmlCanvasManager) { - return doNothing; - } - - var painter = this; - - return function (id, e, width, height) { - return painter._shapeToImage( - id, e, width, height, devicePixelRatio - ); - }; - }; - - /** - * 创建dom - * - * @inner - * @param {string} id dom id 待用 - * @param {string} type dom type,such as canvas, div etc. - * @param {Painter} painter painter instance - */ - function createDom(id, type, painter) { - var newDom = document.createElement(type); - var width = painter._width; - var height = painter._height; - - // 没append呢,请原谅我这样写,清晰~ - newDom.style.position = 'absolute'; - newDom.style.left = 0; - newDom.style.top = 0; - newDom.style.width = width + 'px'; - newDom.style.height = height + 'px'; - newDom.setAttribute('width', width * devicePixelRatio); - newDom.setAttribute('height', height * devicePixelRatio); - - // id不作为索引用,避免可能造成的重名,定义为私有属性 - newDom.setAttribute('data-zr-dom-id', id); - return newDom; - } - - /***************************************** - * Layer - *****************************************/ - function Layer(id, painter) { - this.dom = createDom(id, 'canvas', painter); - vmlCanvasManager && vmlCanvasManager.initElement(this.dom); - - this.domBack = null; - this.ctxBack = null; - - this.painter = painter; - - this.unusedCount = 0; - - this.config = null; - - this.dirty = true; - - this.elCount = 0; - } - - Layer.prototype.initContext = function() { - this.ctx = this.dom.getContext('2d'); - if (devicePixelRatio != 1) { - this.ctx.scale(devicePixelRatio, devicePixelRatio); - } - } - - Layer.prototype.createBackBuffer = function() { - if (vmlCanvasManager) { // IE 8- should not support back buffer - return; - } - this.domBack = createDom('back-' + this.id, 'canvas', this.painter); - this.ctxBack = this.domBack.getContext('2d'); - - if (devicePixelRatio != 1) { - this.ctxBack.scale(devicePixelRatio, devicePixelRatio); - } - }; - - Layer.prototype.resize = function(width, height) { - this.dom.style.width = width + 'px'; - this.dom.style.height = height + 'px'; - - this.dom.setAttribute('width', width * devicePixelRatio); - this.dom.setAttribute('height', height * devicePixelRatio); - - if (devicePixelRatio != 1) { - this.ctx.scale(devicePixelRatio, devicePixelRatio); - } - - if (this.domBack) { - this.domBack.setAttribute('width', width * devicePixelRatio); - this.domBack.setAttribute('height', height * devicePixelRatio); - - if (devicePixelRatio != 1) { - this.ctxBack.scale(devicePixelRatio, devicePixelRatio); - } - } - }; - - Layer.prototype.clear = function() { - var config = this.config; - var dom = this.dom; - var ctx = this.ctx; - var width = dom.width; - var height = dom.height; - - if (config) { - var haveClearColor = - typeof(config.clearColor) !== 'undefined' - && !vmlCanvasManager; - var haveMotionBLur = config.motionBlur && !vmlCanvasManager; - var lastFrameAlpha = config.lastFrameAlpha; - if (typeof(lastFrameAlpha) == 'undefined') { - lastFrameAlpha = 0.7; - } - - if (haveMotionBLur) { - if (!this.domBack) { - this.createBackBuffer(); - } - - this.ctxBack.globalCompositeOperation = 'copy'; - this.ctxBack.drawImage( - dom, 0, 0, - width / devicePixelRatio, - height / devicePixelRatio - ); - } - - if (haveClearColor) { - ctx.save(); - ctx.fillStyle = this.config.clearColor; - ctx.fillRect( - 0, 0, - width / devicePixelRatio, - height / devicePixelRatio - ); - ctx.restore(); - } - else { - ctx.clearRect( - 0, 0, - width / devicePixelRatio, - height / devicePixelRatio - ); - } - - if (haveMotionBLur) { - var domBack = this.domBack; - ctx.save(); - ctx.globalAlpha = lastFrameAlpha; - ctx.drawImage( - domBack, 0, 0, - width / devicePixelRatio, - height / devicePixelRatio - ); - ctx.restore(); - } - } - else { - ctx.clearRect( - 0, 0, - width / devicePixelRatio, - height / devicePixelRatio - ); - } - }; - - return Painter; - } -); - -define('zrender/shape/Group',['require','../tool/guid','../tool/util','../tool/event','./mixin/Transformable'],function(require) { - - var guid = require('../tool/guid'); - var util = require('../tool/util'); - - var Dispatcher = require('../tool/event').Dispatcher; - var Transformable = require('./mixin/Transformable'); - - /** - * @constructor zrender.shape.Group - */ - function Group(options) { - - options = options || {}; - - this.id = options.id || guid(); - - for (var key in options) { - this[key] = options[key]; - } - - this.type = 'group'; - - this.clipShape = null; - - this._children = []; - - this._storage = null; - - this.__dirty = true; - - // Mixin - Transformable.call(this); - Dispatcher.call(this); - } - - Group.prototype.ignore = false; - - Group.prototype.children = function() { - return this._children.slice(); - }; - - Group.prototype.childAt = function(idx) { - return this._children[idx]; - }; - - Group.prototype.addChild = function(child) { - if (child == this) { - return; - } - - if (child.parent == this) { - return; - } - if (child.parent) { - child.parent.removeChild(child); - } - - this._children.push(child); - child.parent = this; - - if (this._storage && this._storage !== child._storage) { - - this._storage.addToMap(child); - - if (child instanceof Group) { - child.addChildrenToStorage(this._storage); - } - } - }; - - Group.prototype.removeChild = function(child) { - var idx = util.indexOf(this._children, child); - - this._children.splice(idx, 1); - child.parent = null; - - if (child._storage) { - - this._storage.delFromMap(child.id); - - if (child instanceof Group) { - child.delChildrenFromStorage(child._storage); - } - } - }; - - Group.prototype.each = function(cb, context) { - var haveContext = !!context; - for (var i = 0; i < this._children.length; i++) { - var child = this._children[i]; - if (haveContext) { - cb.call(context, child); - } else { - cb(child); - } - } - }; - - Group.prototype.iterate = function(cb, context) { - var haveContext = !!context; - - for (var i = 0; i < this._children.length; i++) { - var child = this._children[i]; - if (haveContext) { - cb.call(context, child); - } else { - cb(child); - } - - if (child.type === 'group') { - child.iterate(cb, context); - } - } - }; - - Group.prototype.addChildrenToStorage = function(storage) { - for (var i = 0; i < this._children.length; i++) { - var child = this._children[i]; - storage.addToMap(child); - if (child.type === 'group') { - child.addChildrenToStorage(storage); - } - } - }; - - Group.prototype.delChildrenFromStorage = function(storage) { - for (var i = 0; i < this._children.length; i++) { - var child = this._children[i]; - storage.delFromMap(child); - if (child.type === 'group') { - child.delChildrenFromStorage(storage); - } - } - }; - - util.merge(Group.prototype, Transformable.prototype, true); - util.merge(Group.prototype, Dispatcher.prototype, true); - - return Group; -}); -/** - * Storage内容仓库模块 - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * errorrik (errorrik@gmail.com) - */ - - -define( - 'zrender/Storage',['require','./tool/util','./shape/Group'],function (require) { - - - - var util = require('./tool/util'); - - var Group = require('./shape/Group'); - - var defaultIterateOption = { - hover: false, - normal: 'down', - update: false - }; - - function shapeCompareFunc(a, b) { - if (a.zlevel == b.zlevel) { - if (a.z == b.z) { - return a.__renderidx - b.__renderidx; - } - return a.z - b.z; - } - return a.zlevel - b.zlevel; - } - /** - * 内容仓库 (M) - * - */ - function Storage() { - // 所有常规形状,id索引的map - this._elements = {}; - - // 高亮层形状,不稳定,动态增删,数组位置也是z轴方向,靠前显示在下方 - this._hoverElements = []; - - this._roots = []; - - this._shapeList = []; - - this._shapeListOffset = 0; - } - - /** - * 遍历迭代器 - * - * @param {Function} fun 迭代回调函数,return true终止迭代 - * @param {Object=} option 迭代参数,缺省为仅降序遍历常规形状 - * hover : true 是否迭代高亮层数据 - * normal : 'down' | 'up' 是否迭代常规数据,迭代时是否指定及z轴顺序 - * update : false 是否更新shapeList - */ - Storage.prototype.iterShape = function (fun, option) { - if (!option) { - option = defaultIterateOption; - } - - if (option.hover) { - //高亮层数据遍历 - for (var i = 0, l = this._hoverElements.length; i < l; i++) { - var el = this._hoverElements[i]; - el.updateTransform(); - if (fun(el)) { - return this; - } - } - } - - if (option.update) { - this.updateShapeList(); - } - - //遍历: 'down' | 'up' - switch (option.normal) { - case 'down': - // 降序遍历,高层优先 - var l = this._shapeList.length; - while (l--) { - if (fun(this._shapeList[l])) { - return this; - } - } - break; - // case 'up': - default: - //升序遍历,底层优先 - for (var i = 0, l = this._shapeList.length; i < l; i++) { - if (fun(this._shapeList[i])) { - return this; - } - } - break; - } - - return this; - }; - - Storage.prototype.getHoverShapes = function(update) { - if (update) { - for (var i = 0, l = this._hoverElements.length; i < l; i++) { - this._hoverElements[i].updateTransform(); - } - } - return this._hoverElements; - }; - - Storage.prototype.getShapeList = function(update) { - if (update) { - this.updateShapeList(); - } - return this._shapeList; - }; - - - Storage.prototype.updateShapeList = function() { - this._shapeListOffset = 0; - for (var i = 0, len = this._roots.length; i < len; i++) { - var root = this._roots[i]; - this._updateAndAddShape(root); - } - this._shapeList.length = this._shapeListOffset; - - for (var i = 0, len = this._shapeList.length; i < len; i++) { - this._shapeList[i].__renderidx = i; - } - - this._shapeList.sort(shapeCompareFunc); - }; - - Storage.prototype._updateAndAddShape = function(el) { - - if (el.ignore) { - return; - } - - el.updateTransform(); - - if (el.type == 'group') { - - if (el.clipShape) { - // clipShape 的变换是基于 group 的变换 - el.clipShape.parent = el; - el.clipShape.updateTransform(); - - var startClipShape = el._children[0]; - if (startClipShape) { - startClipShape.__startClip = el.clipShape; - } - } - - for (var i = 0; i < el._children.length; i++) { - var child = el._children[i]; - - // Force to mark as dirty if group is dirty - child.__dirty = el.__dirty || child.__dirty; - - this._updateAndAddShape(child); - } - - if (el.clipShape) { - var stopClipShape = this._shapeList[this._shapeListOffset - 1]; - if (stopClipShape) { - stopClipShape.__stopClip = true; - } - } - - // Mark group clean here - el.__dirty = false; - - } else { - this._shapeList[this._shapeListOffset++] = el; - } - }; - - /** - * 修改 - * - * @param {string} idx 唯一标识 - * @param {Object} [params] 参数 - */ - Storage.prototype.mod = function (elId, params) { - var el = this._elements[elId]; - if (el) { - if (!(el instanceof Group)) { - el.style.__rect = null; - } - el.__dirty = true; - - if (params) { - // 如果第二个参数直接使用 shape - // parent, _storage, __startClip 三个属性会有循环引用 - // 主要为了向 1.x 版本兼容,2.x 版本不建议使用第二个参数 - if (params.parent || params._storage || params.__startClip) { - var target = {}; - for (var name in params) { - if ( - name == 'parent' - || name == '_storage' - || name == '__startClip' - ) { - continue; - } - if (params.hasOwnProperty(name)) { - target[name] = params[name]; - } - } - util.merge(el, target, true); - } else { - util.merge(el, params, true); - } - } - } - - return this; - }; - - /** - * 常规形状位置漂移,形状自身定义漂移函数 - * - * @param {string} idx 形状唯一标识 - */ - Storage.prototype.drift = function (shapeId, dx, dy) { - var shape = this._elements[shapeId]; - if (shape) { - shape.needTransform = true; - if (!shape.ondrift //ondrift - //有onbrush并且调用执行返回false或undefined则继续 - || (shape.ondrift && !shape.ondrift(dx, dy)) - ) { - shape.drift(dx, dy); - } - } - - return this; - }; - - /** - * 添加高亮层数据 - * - * @param {Object} params 参数 - */ - Storage.prototype.addHover = function (shape) { - shape.updateNeedTransform(); - this._hoverElements.push(shape); - return this; - }; - - /** - * 删除高亮层数据 - */ - Storage.prototype.delHover = function () { - this._hoverElements = []; - return this; - }; - - Storage.prototype.hasHoverShape = function () { - return this._hoverElements.length > 0; - }; - - /** - * 添加到根节点 - * - * @param {Shape|Group} el 参数 - */ - Storage.prototype.addRoot = function (el) { - if (el instanceof Group) { - el.addChildrenToStorage(this); - } - - this.addToMap(el); - this._roots.push(el); - }; - - Storage.prototype.delRoot = function (elId) { - if (typeof(elId) == 'undefined') { - // 不指定elId清空 - for (var i = 0; i < this._roots.length; i++) { - var root = this._roots[i]; - if (root instanceof Group) { - root.delChildrenFromStorage(this); - } - } - - this._elements = {}; - this._hoverElements = []; - this._roots = []; - - return; - } - - if (elId instanceof Array) { - for (var i = 0, l = elId.length; i < l; i++) { - this.delRoot(elId[i]); - } - return; - } - - var el; - if (typeof(elId) == 'string') { - el = this._elements[elId]; - } else { - el = elId; - } - - var idx = util.indexOf(this._roots, el); - if (idx >= 0) { - this.delFromMap(el.id); - this._roots.splice(idx, 1); - if (el instanceof Group) { - el.delChildrenFromStorage(this); - } - } - }; - - /** - * 添加 - * - * @param {Shape|Group} el 参数 - */ - Storage.prototype.addToMap = function (el) { - if (el instanceof Group) { - el._storage = this; - } else { - el.style.__rect = null; - } - - this._elements[el.id] = el; - - return this; - }; - - /** - * 根据指定的elId获取相应的shape属性 - * - * @param {string=} idx 唯一标识 - */ - Storage.prototype.get = function (elId) { - return this._elements[elId]; - }; - - /** - * 删除,elId不指定则全清空 - * - * @param {string} idx 唯一标识 - */ - Storage.prototype.delFromMap = function (elId) { - var el = this._elements[elId]; - if (el) { - delete this._elements[elId]; - - if (el instanceof Group) { - el._storage = null; - } - } - - return this; - }; - - - /** - * 释放 - */ - Storage.prototype.dispose = function () { - this._elements = - this._renderList = - this._roots = - this._hoverElements = null; - }; - - return Storage; - } -); - -/** - * 缓动代码来自 https://github.com/sole/tween.js/blob/master/src/Tween.js - * author: lang(shenyi01@baidu.com) - */ -define( - 'zrender/animation/easing',[],function() { - var Easing = { - // 线性 - Linear: function(k) { - return k; - }, - - // 二次方的缓动(t^2) - QuadraticIn: function(k) { - return k * k; - }, - QuadraticOut: function(k) { - return k * (2 - k); - }, - QuadraticInOut: function(k) { - if ((k *= 2) < 1) { - return 0.5 * k * k; - } - return - 0.5 * (--k * (k - 2) - 1); - }, - - // 三次方的缓动(t^3) - CubicIn: function(k) { - return k * k * k; - }, - CubicOut: function(k) { - return --k * k * k + 1; - }, - CubicInOut: function(k) { - if ((k *= 2) < 1) { - return 0.5 * k * k * k; - } - return 0.5 * ((k -= 2) * k * k + 2); - }, - - // 四次方的缓动(t^4) - QuarticIn: function(k) { - return k * k * k * k; - }, - QuarticOut: function(k) { - return 1 - (--k * k * k * k); - }, - QuarticInOut: function(k) { - if ((k *= 2) < 1) { - return 0.5 * k * k * k * k; - } - return - 0.5 * ((k -= 2) * k * k * k - 2); - }, - - // 五次方的缓动(t^5) - QuinticIn: function(k) { - return k * k * k * k * k; - }, - - QuinticOut: function(k) { - return --k * k * k * k * k + 1; - }, - QuinticInOut: function(k) { - if ((k *= 2) < 1) { - return 0.5 * k * k * k * k * k; - } - return 0.5 * ((k -= 2) * k * k * k * k + 2); - }, - - // 正弦曲线的缓动(sin(t)) - SinusoidalIn: function(k) { - return 1 - Math.cos(k * Math.PI / 2); - }, - SinusoidalOut: function(k) { - return Math.sin(k * Math.PI / 2); - }, - SinusoidalInOut: function(k) { - return 0.5 * (1 - Math.cos(Math.PI * k)); - }, - - // 指数曲线的缓动(2^t) - ExponentialIn: function(k) { - return k === 0 ? 0 : Math.pow(1024, k - 1); - }, - ExponentialOut: function(k) { - return k === 1 ? 1 : 1 - Math.pow(2, - 10 * k); - }, - ExponentialInOut: function(k) { - if (k === 0) { - return 0; - } - if (k === 1) { - return 1; - } - if ((k *= 2) < 1) { - return 0.5 * Math.pow(1024, k - 1); - } - return 0.5 * (- Math.pow(2, - 10 * (k - 1)) + 2); - }, - - // 圆形曲线的缓动(sqrt(1-t^2)) - CircularIn: function(k) { - return 1 - Math.sqrt(1 - k * k); - }, - CircularOut: function(k) { - return Math.sqrt(1 - (--k * k)); - }, - CircularInOut: function(k) { - if ((k *= 2) < 1) { - return - 0.5 * (Math.sqrt(1 - k * k) - 1); - } - return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1); - }, - - // 创建类似于弹簧在停止前来回振荡的动画 - ElasticIn: function(k) { - var s, a = 0.1, p = 0.4; - if (k === 0) { - return 0; - } - if (k === 1) { - return 1; - } - if (!a || a < 1) { - a = 1; s = p / 4; - }else{ - s = p * Math.asin(1 / a) / (2 * Math.PI); - } - return - (a * Math.pow(2, 10 * (k -= 1)) * - Math.sin((k - s) * (2 * Math.PI) / p)); - }, - ElasticOut: function(k) { - var s, a = 0.1, p = 0.4; - if (k === 0) { - return 0; - } - if (k === 1) { - return 1; - } - if (!a || a < 1) { - a = 1; s = p / 4; - } - else{ - s = p * Math.asin(1 / a) / (2 * Math.PI); - } - return (a * Math.pow(2, - 10 * k) * - Math.sin((k - s) * (2 * Math.PI) / p) + 1); - }, - ElasticInOut: function(k) { - var s, a = 0.1, p = 0.4; - if (k === 0) { - return 0; - } - if (k === 1) { - return 1; - } - if (!a || a < 1) { - a = 1; s = p / 4; - } - else{ - s = p * Math.asin(1 / a) / (2 * Math.PI); - } - if ((k *= 2) < 1) { - return - 0.5 * (a * Math.pow(2, 10 * (k -= 1)) - * Math.sin((k - s) * (2 * Math.PI) / p)); - } - return a * Math.pow(2, -10 * (k -= 1)) - * Math.sin((k - s) * (2 * Math.PI) / p) * 0.5 + 1; - - }, - - // 在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动 - BackIn: function(k) { - var s = 1.70158; - return k * k * ((s + 1) * k - s); - }, - BackOut: function(k) { - var s = 1.70158; - return --k * k * ((s + 1) * k + s) + 1; - }, - BackInOut: function(k) { - var s = 1.70158 * 1.525; - if ((k *= 2) < 1) { - return 0.5 * (k * k * ((s + 1) * k - s)); - } - return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2); - }, - - // 创建弹跳效果 - BounceIn: function(k) { - return 1 - Easing.BounceOut(1 - k); - }, - BounceOut: function(k) { - if (k < (1 / 2.75)) { - return 7.5625 * k * k; - } - else if (k < (2 / 2.75)) { - return 7.5625 * (k -= (1.5 / 2.75)) * k + 0.75; - } else if (k < (2.5 / 2.75)) { - return 7.5625 * (k -= (2.25 / 2.75)) * k + 0.9375; - } else { - return 7.5625 * (k -= (2.625 / 2.75)) * k + 0.984375; - } - }, - BounceInOut: function(k) { - if (k < 0.5) { - return Easing.BounceIn(k * 2) * 0.5; - } - return Easing.BounceOut(k * 2 - 1) * 0.5 + 0.5; - } - }; - - return Easing; - } -); - - -/** - * 动画主控制器 - * @config target 动画对象,可以是数组,如果是数组的话会批量分发onframe等事件 - * @config life(1000) 动画时长 - * @config delay(0) 动画延迟时间 - * @config loop(true) - * @config gap(0) 循环的间隔时间 - * @config onframe - * @config easing(optional) - * @config ondestroy(optional) - * @config onrestart(optional) - */ -define( - 'zrender/animation/Clip',['require','./easing'],function(require) { - - var Easing = require('./easing'); - - function Clip(options) { - - this._targetPool = options.target || {}; - if (!(this._targetPool instanceof Array)) { - this._targetPool = [this._targetPool]; - } - - //生命周期 - this._life = options.life || 1000; - //延时 - this._delay = options.delay || 0; - //开始时间 - this._startTime = new Date().getTime() + this._delay;//单位毫秒 - - //结束时间 - this._endTime = this._startTime + this._life * 1000; - - //是否循环 - this.loop = typeof options.loop == 'undefined' - ? false : options.loop; - - this.gap = options.gap || 0; - - this.easing = options.easing || 'Linear'; - - this.onframe = options.onframe; - this.ondestroy = options.ondestroy; - this.onrestart = options.onrestart; - } - - Clip.prototype = { - step : function (time) { - var percent = (time - this._startTime) / this._life; - - //还没开始 - if (percent < 0) { - return; - } - - percent = Math.min(percent, 1); - - var easingFunc = typeof this.easing == 'string' - ? Easing[this.easing] - : this.easing; - var schedule = typeof easingFunc === 'function' - ? easingFunc(percent) - : percent; - - this.fire('frame', schedule); - - // 结束 - if (percent == 1) { - if (this.loop) { - this.restart(); - // 重新开始周期 - // 抛出而不是直接调用事件直到 stage.update 后再统一调用这些事件 - return 'restart'; - - } - - // 动画完成将这个控制器标识为待删除 - // 在Animation.update中进行批量删除 - this._needsRemove = true; - return 'destroy'; - } - - return null; - }, - restart : function() { - var time = new Date().getTime(); - var remainder = (time - this._startTime) % this._life; - this._startTime = new Date().getTime() - remainder + this.gap; - }, - fire : function(eventType, arg) { - for (var i = 0, len = this._targetPool.length; i < len; i++) { - if (this['on' + eventType]) { - this['on' + eventType](this._targetPool[i], arg); - } - } - }, - constructor: Clip - }; - - return Clip; - } -); - -/** - * 动画主类, 调度和管理所有动画控制器 - * - * @author pissang(https://github.com/pissang) - * - * @class : Animation - * @config : stage(optional) 绘制类, 需要提供update接口 - * @config : onframe(optional) - * @method : add - * @method : remove - * @method : update - * @method : start - * @method : stop - */ -define( - 'zrender/animation/Animation',['require','./Clip','../tool/color','../tool/util','../tool/event'],function(require) { - - - - var Clip = require('./Clip'); - var color = require('../tool/color'); - var util = require('../tool/util'); - var Dispatcher = require('../tool/event').Dispatcher; - - var requestAnimationFrame = window.requestAnimationFrame - || window.msRequestAnimationFrame - || window.mozRequestAnimationFrame - || window.webkitRequestAnimationFrame - || function(func){setTimeout(func, 16);}; - - var arraySlice = Array.prototype.slice; - - function Animation(options) { - - options = options || {}; - - this.stage = options.stage || {}; - - this.onframe = options.onframe || function() {}; - - // private properties - this._clips = []; - - this._running = false; - - this._time = 0; - - Dispatcher.call(this); - } - - Animation.prototype = { - add : function(clip) { - this._clips.push(clip); - }, - remove : function(clip) { - var idx = util.indexOf(this._clips, clip); - if (idx >= 0) { - this._clips.splice(idx, 1); - } - }, - update : function() { - - var time = new Date().getTime(); - var delta = time - this._time; - var clips = this._clips; - var len = clips.length; - - var deferredEvents = []; - var deferredClips = []; - for (var i = 0; i < len; i++) { - var clip = clips[i]; - var e = clip.step(time); - // Throw out the events need to be called after - // stage.update, like destroy - if (e) { - deferredEvents.push(e); - deferredClips.push(clip); - } - } - if (this.stage.update) { - this.stage.update(); - } - - // Remove the finished clip - for (var i = 0; i < len;) { - if (clips[i]._needsRemove) { - clips[i] = clips[len-1]; - clips.pop(); - len--; - } else { - i++; - } - } - - len = deferredEvents.length; - for (var i = 0; i < len; i++) { - deferredClips[i].fire(deferredEvents[i]); - } - - this._time = time; - - this.onframe(delta); - - this.dispatch('frame', delta); - }, - start : function() { - var self = this; - - this._running = true; - - function step() { - if (self._running) { - self.update(); - requestAnimationFrame(step); - } - } - - this._time = new Date().getTime(); - requestAnimationFrame(step); - }, - stop : function() { - this._running = false; - }, - clear : function() { - this._clips = []; - }, - animate : function(target, options) { - options = options || {}; - var deferred = new Deferred( - target, - options.loop, - options.getter, - options.setter - ); - deferred.animation = this; - return deferred; - }, - constructor: Animation - }; - - util.merge(Animation.prototype, Dispatcher.prototype, true); - - function _defaultGetter(target, key) { - return target[key]; - } - - function _defaultSetter(target, key, value) { - target[key] = value; - } - - function _interpolateNumber(p0, p1, percent) { - return (p1 - p0) * percent + p0; - } - - function _interpolateArray(p0, p1, percent, out, arrDim) { - var len = p0.length; - if (arrDim == 1) { - for (var i = 0; i < len; i++) { - out[i] = _interpolateNumber(p0[i], p1[i], percent); - } - } else { - var len2 = p0[0].length; - for (var i = 0; i < len; i++) { - for (var j = 0; j < len2; j++) { - out[i][j] = _interpolateNumber( - p0[i][j], p1[i][j], percent - ); - } - } - } - } - - function _isArrayLike(data) { - switch (typeof data) { - case 'undefined': - case 'string': - return false; - } - - return typeof data.length !== 'undefined'; - } - - function _catmullRomInterpolateArray( - p0, p1, p2, p3, t, t2, t3, out, arrDim - ) { - var len = p0.length; - if (arrDim == 1) { - for (var i = 0; i < len; i++) { - out[i] = _catmullRomInterpolate( - p0[i], p1[i], p2[i], p3[i], t, t2, t3 - ); - } - } else { - var len2 = p0[0].length; - for (var i = 0; i < len; i++) { - for (var j = 0; j < len2; j++) { - out[i][j] = _catmullRomInterpolate( - p0[i][j], p1[i][j], p2[i][j], p3[i][j], - t, t2, t3 - ); - } - } - } - } - - function _catmullRomInterpolate(p0, p1, p2, p3, t, t2, t3) { - var v0 = (p2 - p0) * 0.5; - var v1 = (p3 - p1) * 0.5; - return (2 * (p1 - p2) + v0 + v1) * t3 - + (- 3 * (p1 - p2) - 2 * v0 - v1) * t2 - + v0 * t + p1; - } - - function _cloneValue(value) { - if (_isArrayLike(value)) { - var len = value.length; - if (_isArrayLike(value[0])) { - var ret = []; - for (var i = 0; i < len; i++) { - ret.push(arraySlice.call(value[i])); - } - return ret; - } else { - return arraySlice.call(value); - } - } else { - return value; - } - } - - function rgba2String(rgba) { - rgba[0] = Math.floor(rgba[0]); - rgba[1] = Math.floor(rgba[1]); - rgba[2] = Math.floor(rgba[2]); - - return 'rgba(' + rgba.join(',') + ')'; - } - - function Deferred(target, loop, getter, setter) { - this._tracks = {}; - this._target = target; - - this._loop = loop || false; - - this._getter = getter || _defaultGetter; - this._setter = setter || _defaultSetter; - - this._clipCount = 0; - - this._delay = 0; - - this._doneList = []; - - this._onframeList = []; - - this._clipList = []; - } - - Deferred.prototype = { - when : function(time /* ms */, props) { - for (var propName in props) { - if (! this._tracks[propName]) { - this._tracks[propName] = []; - // If time is 0 - // Then props is given initialize value - // Else - // Initialize value from current prop value - if (time !== 0) { - this._tracks[propName].push({ - time : 0, - value : _cloneValue( - this._getter(this._target, propName) - ) - }); - } - } - this._tracks[propName].push({ - time : parseInt(time, 10), - value : props[propName] - }); - } - return this; - }, - during : function(callback) { - this._onframeList.push(callback); - return this; - }, - start : function(easing) { - - var self = this; - var setter = this._setter; - var getter = this._getter; - var onFrameListLen = self._onframeList.length; - var useSpline = easing === 'spline'; - - var ondestroy = function() { - self._clipCount--; - if (self._clipCount === 0) { - // Clear all tracks - self._tracks = {}; - - var len = self._doneList.length; - for (var i = 0; i < len; i++) { - self._doneList[i].call(self); - } - } - }; - - var createTrackClip = function(keyframes, propName) { - var trackLen = keyframes.length; - if (!trackLen) { - return; - } - // Guess data type - var firstVal = keyframes[0].value; - var isValueArray = _isArrayLike(firstVal); - var isValueColor = false; - - // For vertices morphing - var arrDim = ( - isValueArray - && _isArrayLike(firstVal[0]) - ) - ? 2 : 1; - // Sort keyframe as ascending - keyframes.sort(function(a, b) { - return a.time - b.time; - }); - var trackMaxTime; - if (trackLen) { - trackMaxTime = keyframes[trackLen-1].time; - }else{ - return; - } - // Percents of each keyframe - var kfPercents = []; - // Value of each keyframe - var kfValues = []; - for (var i = 0; i < trackLen; i++) { - kfPercents.push(keyframes[i].time / trackMaxTime); - // Assume value is a color when it is a string - var value = keyframes[i].value; - if (typeof(value) == 'string') { - value = color.toArray(value); - if (value.length === 0) { // Invalid color - value[0] = value[1] = value[2] = 0; - value[3] = 1; - } - isValueColor = true; - } - kfValues.push(value); - } - - // Cache the key of last frame to speed up when - // animation playback is sequency - var cacheKey = 0; - var cachePercent = 0; - var start; - var i, w; - var p0, p1, p2, p3; - - - if (isValueColor) { - var rgba = [0, 0, 0, 0]; - } - - var onframe = function(target, percent) { - // Find the range keyframes - // kf1-----kf2---------current--------kf3 - // find kf2 and kf3 and do interpolation - if (percent < cachePercent) { - // Start from next key - start = Math.min(cacheKey + 1, trackLen - 1); - for (i = start; i >= 0; i--) { - if (kfPercents[i] <= percent) { - break; - } - } - i = Math.min(i, trackLen-2); - } else { - for (i = cacheKey; i < trackLen; i++) { - if (kfPercents[i] > percent) { - break; - } - } - i = Math.min(i-1, trackLen-2); - } - cacheKey = i; - cachePercent = percent; - - var range = (kfPercents[i+1] - kfPercents[i]); - if (range === 0) { - return; - } else { - w = (percent - kfPercents[i]) / range; - } - if (useSpline) { - p1 = kfValues[i]; - p0 = kfValues[i === 0 ? i : i - 1]; - p2 = kfValues[i > trackLen - 2 ? trackLen - 1 : i + 1]; - p3 = kfValues[i > trackLen - 3 ? trackLen - 1 : i + 2]; - if (isValueArray) { - _catmullRomInterpolateArray( - p0, p1, p2, p3, w, w*w, w*w*w, - getter(target, propName), - arrDim - ); - } else { - var value; - if (isValueColor) { - value = _catmullRomInterpolateArray( - p0, p1, p2, p3, w, w*w, w*w*w, - rgba, 1 - ); - value = rgba2String(rgba); - } else { - value = _catmullRomInterpolate( - p0, p1, p2, p3, w, w*w, w*w*w - ); - } - setter( - target, - propName, - value - ); - } - } else { - if (isValueArray) { - _interpolateArray( - kfValues[i], kfValues[i+1], w, - getter(target, propName), - arrDim - ); - } else { - var value; - if (isValueColor) { - _interpolateArray( - kfValues[i], kfValues[i+1], w, - rgba, 1 - ); - value = rgba2String(rgba); - } else { - value = _interpolateNumber(kfValues[i], kfValues[i+1], w); - } - setter( - target, - propName, - value - ); - } - } - - for (i = 0; i < onFrameListLen; i++) { - self._onframeList[i](target, percent); - } - }; - - var clip = new Clip({ - target : self._target, - life : trackMaxTime, - loop : self._loop, - delay : self._delay, - onframe : onframe, - ondestroy : ondestroy - }); - - if (easing && easing !== 'spline') { - clip.easing = easing; - } - self._clipList.push(clip); - self._clipCount++; - self.animation.add(clip); - }; - - for (var propName in this._tracks) { - createTrackClip(this._tracks[propName], propName); - } - return this; - }, - stop : function() { - for (var i = 0; i < this._clipList.length; i++) { - var clip = this._clipList[i]; - this.animation.remove(clip); - } - this._clipList = []; - }, - delay : function(time){ - this._delay = time; - return this; - }, - done : function(func) { - this._doneList.push(func); - return this; - } - }; - - return Animation; - } -); - -/*! - * ZRender, a lightweight canvas library with a MVC architecture, data-driven - * and provides an event model like DOM. - * - * Copyright (c) 2013, Baidu Inc. - * All rights reserved. - * - * LICENSE - * https://github.com/ecomfe/zrender/blob/master/LICENSE.txt - */ - -/** - * zrender: core核心类 - * - * @desc zrender是一个轻量级的Canvas类库,MVC封装,数据驱动,提供类Dom事件模型。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define( - 'zrender/zrender',['require','./lib/excanvas','./tool/util','./tool/log','./tool/guid','./Handler','./Painter','./Storage','./animation/Animation','./tool/env'],function(require) { - /* - * HTML5 Canvas for Internet Explorer! - * Modern browsers like Firefox, Safari, Chrome and Opera support - * the HTML5 canvas tag to allow 2D command-based drawing. - * ExplorerCanvas brings the same functionality to Internet Explorer. - * To use, web developers only need to include a single script tag - * in their existing web pages. - * - * https://code.google.com/p/explorercanvas/ - * http://explorercanvas.googlecode.com/svn/trunk/excanvas.js - */ - // 核心代码会生成一个全局变量 G_vmlCanvasManager,模块改造后借用于快速判断canvas支持 - require('./lib/excanvas'); - - var util = require('./tool/util'); - var log = require('./tool/log'); - var guid = require('./tool/guid'); - - var Handler = require('./Handler'); - var Painter = require('./Painter'); - var Storage = require('./Storage'); - var Animation = require('./animation/Animation'); - - var _instances = {}; //ZRender实例map索引 - - var zrender = {}; - zrender.version = '2.0.2'; - - /** - * zrender初始化 - * 不让外部直接new ZRender实例,为啥? - * 不为啥,提供全局可控同时减少全局污染和降低命名冲突的风险! - * - * @param {HTMLElement} dom dom对象,不帮你做document.getElementById了 - * @param {Object=} params 个性化参数,如自定义shape集合,带进来就好 - * - * @return {ZRender} ZRender实例 - */ - zrender.init = function(dom, params) { - var zi = new ZRender(guid(), dom, params || {}); - _instances[zi.id] = zi; - return zi; - }; - - /** - * zrender实例销毁,记在_instances里的索引也会删除了 - * 管生就得管死,可以通过zrender.dispose(zi)销毁指定ZRender实例 - * 当然也可以直接zi.dispose()自己销毁 - * - * @param {ZRender=} zi ZRender对象,不传则销毁全部 - */ - zrender.dispose = function (zi) { - if (zi) { - zi.dispose(); - } - else { - for (var key in _instances) { - _instances[key].dispose(); - } - _instances = {}; - } - - return zrender; - }; - - /** - * 获取zrender实例 - * - * @param {string} id ZRender对象索引 - */ - zrender.getInstance = function (id) { - return _instances[id]; - }; - - /** - * 删除zrender实例,ZRender实例dispose时会调用, - * 删除后getInstance则返回undefined - * ps: 仅是删除,删除的实例不代表已经dispose了~~ - * 这是一个摆脱全局zrender.dispose()自动销毁的后门, - * take care of yourself~ - * - * @param {string} id ZRender对象索引 - */ - zrender.delInstance = function (id) { - delete _instances[id]; - return zrender; - }; - - function getFrameCallback(zrInstance) { - return function(){ - var animatingShapes = zrInstance.animatingShapes; - for (var i = 0, l = animatingShapes.length; i < l; i++) { - zrInstance.storage.mod(animatingShapes[i].id); - } - - if (animatingShapes.length || zrInstance._needsRefreshNextFrame) { - zrInstance.refresh(); - } - }; - } - - /** - * ZRender接口类,对外可用的所有接口都在这里!! - * storage(M)、painter(V)、handler(C)为内部私有类,外部接口不可见 - * 非get接口统一返回支持链式调用~ - * - * @param {string} id 唯一标识 - * @param {HTMLElement} dom dom对象,不帮你做document.getElementById - * - * @return {ZRender} ZRender实例 - */ - function ZRender(id, dom) { - this.id = id; - this.env = require('./tool/env'); - - this.storage = new Storage(); - this.painter = new Painter(dom, this.storage); - this.handler = new Handler(dom, this.storage, this.painter); - - // 动画控制 - this.animatingShapes = []; - this.animation = new Animation({ - stage : { - update : getFrameCallback(this) - } - }); - this.animation.start(); - - this._needsRefreshNextFrame = false; - } - - /** - * 获取实例唯一标识 - */ - ZRender.prototype.getId = function () { - return this.id; - }; - - /** - * 添加图形形状到根节点 - * - * @param {zrender.shape.Base} shape 形状对象,可用属性全集,详见各shape - */ - ZRender.prototype.addShape = function (shape) { - this.storage.addRoot(shape); - return this; - }; - - /** - * 添加组到根节点 - * - * @param {zrender.shape.Group} group - */ - ZRender.prototype.addGroup = function(group) { - this.storage.addRoot(group); - return this; - }; - - /** - * 从根节点删除图形形状 - * - * @param {string} shapeId 形状对象唯一标识 - */ - ZRender.prototype.delShape = function (shapeId) { - this.storage.delRoot(shapeId); - return this; - }; - - /** - * 从根节点删除组 - * - * @param {string} groupId - */ - ZRender.prototype.delGroup = function (groupId) { - this.storage.delRoot(groupId); - return this; - }; - - /** - * 修改图形形状 - * - * @param {string} shapeId 形状对象唯一标识 - * @param {Object} shape 形状对象 - */ - ZRender.prototype.modShape = function (shapeId, shape) { - this.storage.mod(shapeId, shape); - return this; - }; - - /** - * 修改组 - * - * @param {string} shapeId - * @param {Object} group - */ - ZRender.prototype.modGroup = function (groupId, group) { - this.storage.mod(groupId, group); - return this; - }; - - /** - * 修改指定zlevel的绘制配置项,例如clearColor - * - * @param {string} zLevel - * @param {Object} config 配置对象, 目前支持clearColor - */ - ZRender.prototype.modLayer = function (zLevel, config) { - this.painter.modLayer(zLevel, config); - return this; - }; - - /** - * 添加额外高亮层显示,仅提供添加方法,每次刷新后高亮层图形均被清空 - * - * @param {Object} shape 形状对象 - */ - ZRender.prototype.addHoverShape = function (shape) { - this.storage.addHover(shape); - return this; - }; - - /** - * 渲染 - * - * @param {Function} callback 渲染结束后回调函数 - * todo:增加缓动函数 - */ - ZRender.prototype.render = function (callback) { - this.painter.render(callback); - this._needsRefreshNextFrame = false; - return this; - }; - - /** - * 视图更新 - * - * @param {Function} callback 视图更新后回调函数 - */ - ZRender.prototype.refresh = function (callback) { - this.painter.refresh(callback); - this._needsRefreshNextFrame = false; - return this; - }; - - // TODO - // 好像会有奇怪的问题 - ZRender.prototype.refreshNextFrame = function() { - this._needsRefreshNextFrame = true; - return this; - }; - - /** - * 高亮层更新 - * - * @param {Function} callback 视图更新后回调函数 - */ - ZRender.prototype.refreshHover = function (callback) { - this.painter.refreshHover(callback); - return this; - }; - - /** - * 视图更新 - * - * @param {Array} shapeList 需要更新的图形元素列表 - * @param {Function} callback 视图更新后回调函数 - */ - ZRender.prototype.update = function (shapeList, callback) { - this.painter.update(shapeList, callback); - return this; - }; - - ZRender.prototype.resize = function() { - this.painter.resize(); - return this; - }; - - /** - * 动画 - * - * @param {string} shapeId 形状对象唯一标识 - * @param {string} path 需要添加动画的属性获取路径,可以通过a.b.c来获取深层的属性 - * @param {boolean} loop 动画是否循环 - * @return {Object} 动画的Deferred对象 - * Example: - * zr.animate(circleId, 'style', false) - * .when(1000, { x: 10} ) - * .done(function(){ console.log('Animation done')}) - * .start() - */ - ZRender.prototype.animate = function (shapeId, path, loop) { - var shape = this.storage.get(shapeId); - if (shape) { - var target; - if (path) { - var pathSplitted = path.split('.'); - var prop = shape; - for (var i = 0, l = pathSplitted.length; i < l; i++) { - if (!prop) { - continue; - } - prop = prop[pathSplitted[i]]; - } - if (prop) { - target = prop; - } - } - else { - target = shape; - } - - if (!target) { - log( - 'Property "' - + path - + '" is not existed in shape ' - + shapeId - ); - return; - } - - var animatingShapes = this.animatingShapes; - if (typeof shape.__aniCount === 'undefined') { - // 正在进行的动画记数 - shape.__aniCount = 0; - } - if (shape.__aniCount === 0) { - animatingShapes.push(shape); - } - shape.__aniCount++; - - return this.animation.animate(target, {loop : loop}) - .done(function() { - shape.__aniCount --; - if (shape.__aniCount === 0) { - // 从animatingShapes里移除 - var idx = util.indexOf(animatingShapes, shape); - animatingShapes.splice(idx, 1); - } - }); - } - else { - log('Shape "'+ shapeId + '" not existed'); - } - }; - - /** - * 停止所有动画 - */ - ZRender.prototype.clearAnimation = function () { - this.animation.clear(); - }; - - /** - * loading显示 - * - * @param {Object=} loadingEffect loading效果对象 - */ - ZRender.prototype.showLoading = function (loadingEffect) { - this.painter.showLoading(loadingEffect); - return this; - }; - - /** - * loading结束 - */ - ZRender.prototype.hideLoading = function () { - this.painter.hideLoading(); - return this; - }; - - /** - * 获取视图宽度 - */ - ZRender.prototype.getWidth = function() { - return this.painter.getWidth(); - }; - - /** - * 获取视图高度 - */ - ZRender.prototype.getHeight = function() { - return this.painter.getHeight(); - }; - - /** - * 图像导出 - */ - ZRender.prototype.toDataURL = function(type, backgroundColor, args) { - return this.painter.toDataURL(type, backgroundColor, args); - }; - - /** - * 将常规shape转成image shape - */ - ZRender.prototype.shapeToImage = function(e, width, height) { - var id = guid(); - return this.painter.shapeToImage(id, e, width, height); - }; - - /** - * 事件绑定 - * - * @param {string} eventName 事件名称 - * @param {Function} eventHandler 响应函数 - */ - ZRender.prototype.on = function(eventName, eventHandler) { - this.handler.on(eventName, eventHandler); - return this; - }; - - /** - * 事件解绑定,参数为空则解绑所有自定义事件 - * - * @param {string} eventName 事件名称 - * @param {Function} eventHandler 响应函数 - */ - ZRender.prototype.un = function(eventName, eventHandler) { - this.handler.un(eventName, eventHandler); - return this; - }; - - /** - * 事件触发 - * - * @param {string} event 事件名称,resize,hover,drag,etc~ - * @param {event=} event event dom事件对象 - */ - ZRender.prototype.trigger = function (eventName, event) { - this.handler.trigger(eventName, event); - return this; - }; - - - /** - * 清除当前ZRender下所有类图的数据和显示,clear后MVC和已绑定事件均还存在在,ZRender可用 - */ - ZRender.prototype.clear = function () { - this.storage.delRoot(); - this.painter.clear(); - return this; - }; - - /** - * 释放当前ZR实例(删除包括dom,数据、显示和事件绑定),dispose后ZR不可用 - */ - ZRender.prototype.dispose = function () { - this.animation.stop(); - - this.clear(); - this.storage.dispose(); - this.painter.dispose(); - this.handler.dispose(); - - this.animation = - this.animatingShapes = - this.storage = - this.painter = - this.handler = null; - - //释放后告诉全局删除对自己的索引,没想到啥好方法 - zrender.delInstance(this.id); - }; - - return zrender; - } -); - -define('zrender', ['zrender/zrender'], function (main) { return main; }); - -/** - * echarts层级查找方法 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/util/ecQuery',['zrender/tool/util'],function() { - var zrUtil = require('zrender/tool/util'); - - /** - * 获取嵌套选项的基础方法 - * 返回optionTarget中位于optionLocation上的值,如果没有定义,则返回undefined - */ - function query(optionTarget, optionLocation) { - if (typeof optionTarget == 'undefined') { - return; - } - - if (!optionLocation) { - return optionTarget; - } - - optionLocation = optionLocation.split('.'); - var length = optionLocation.length; - var curIdx = 0; - while (curIdx < length) { - optionTarget = optionTarget[optionLocation[curIdx]]; - if (typeof optionTarget == 'undefined') { - return; - } - curIdx++; - } - - return optionTarget; - } - - /** - * 获取多级控制嵌套属性的基础方法 - * 返回ctrList中优先级最高(最靠前)的非undefined属性,ctrList中均无定义则返回undefined - */ - function deepQuery(ctrList, optionLocation) { - var finalOption; - for (var i = 0, l = ctrList.length; i < l; i++) { - finalOption = query(ctrList[i], optionLocation); - if (typeof finalOption != 'undefined') { - return finalOption; - } - } - } - - /** - * 获取多级控制嵌套属性的基础方法 - * 根据ctrList中优先级合并产出目标属性 - */ - function deepMerge(ctrList, optionLocation) { - var finalOption; - var len = ctrList.length; - while (len--) { - var tempOption = query(ctrList[len], optionLocation); - if (typeof tempOption != 'undefined') { - if (typeof finalOption == 'undefined') { - finalOption = zrUtil.clone(tempOption); - } - else { - zrUtil.merge( - finalOption, tempOption, true - ); - } - } - } - - return finalOption; - } - - return { - query : query, - deepQuery : deepQuery, - deepMerge : deepMerge - }; -}); -/** - * echarts数字运算相关 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/util/number',[],function() { - function _trim(str) { - return str.replace(/^\s+/, '').replace(/\s+$/, ''); - } - - /** - * 百分比计算 - */ - function parsePercent(value, maxValue) { - if (typeof value === 'string') { - if (_trim(value).match(/%$/)) { - return parseFloat(value) / 100 * maxValue; - } - - return parseFloat(value); - } - - return value; - } - - /** - * 获取中心坐标 - */ - function parseCenter(zr, center) { - return [ - parsePercent(center[0], zr.getWidth()), - parsePercent(center[1], zr.getHeight()) - ]; - } - - /** - * 获取自适应半径 - */ - function parseRadius(zr, radius) { - // 传数组实现环形图,[内半径,外半径],传单个则默认为外半径为 - if (!(radius instanceof Array)) { - radius = [0, radius]; - } - var zrSize = Math.min(zr.getWidth(), zr.getHeight()) / 2; - return [ - parsePercent(radius[0], zrSize), - parsePercent(radius[1], zrSize) - ]; - } - - /** - * 每三位默认加,格式化 - */ - function addCommas(x) { - if (isNaN(x)) { - return '-'; - } - x = (x + '').split('.'); - return x[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,'$1,') - + (x.length > 1 ? ('.' + x[1]) : ''); - } - - return { - parsePercent : parsePercent, - parseCenter : parseCenter, - parseRadius : parseRadius, - addCommas : addCommas - }; -}); -/** - * echarts组件基类 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/component/base',['require','../config','../util/ecQuery','../util/number','zrender/tool/util','zrender/tool/env'],function (require) { - var ecConfig = require('../config'); - var ecQuery = require('../util/ecQuery'); - var number = require('../util/number'); - var zrUtil = require('zrender/tool/util'); - - function Base(ecTheme, messageCenter, zr, option, myChart){ - this.ecTheme = ecTheme; - this.messageCenter = messageCenter; - this.zr =zr; - this.option = option; - this.series = option.series; - this.myChart = myChart; - this.component = myChart.component; - - this._zlevelBase = this.getZlevelBase(); - this.shapeList = []; - this.effectList = []; - - var self = this; - self.hoverConnect = function (param) { - var target = (param.target || {}).hoverConnect; - if (target) { - var zlevel = 10; - var shape; - if (!(target instanceof Array)) { - shape = self.getShapeById(target); - if (shape) { - self.zr.addHoverShape(shape); - zlevel = Math.min(zlevel, shape.zlevel); - } - } - else { - for (var i = 0, l = target.length; i < l; i++) { - shape = self.getShapeById(target[i]); - self.zr.addHoverShape(shape); - zlevel = Math.min(zlevel, shape.zlevel); - } - } - if (zlevel < param.target.zlevel) { - self.zr.addHoverShape(param.target); - } - } - }; - } - - /** - * 基类方法 - */ - Base.prototype = { - canvasSupported : require('zrender/tool/env').canvasSupported, - /** - * 获取zlevel基数配置 - * @param {Object} contentType - */ - getZlevelBase : function (contentType) { - contentType = contentType || this.type + ''; - - switch (contentType) { - case ecConfig.COMPONENT_TYPE_GRID : - case ecConfig.COMPONENT_TYPE_AXIS_CATEGORY : - case ecConfig.COMPONENT_TYPE_AXIS_VALUE : - case ecConfig.COMPONENT_TYPE_POLAR : - return 0; - - case ecConfig.CHART_TYPE_LINE : - case ecConfig.CHART_TYPE_BAR : - case ecConfig.CHART_TYPE_SCATTER : - case ecConfig.CHART_TYPE_PIE : - case ecConfig.CHART_TYPE_RADAR : - case ecConfig.CHART_TYPE_MAP : - case ecConfig.CHART_TYPE_K : - case ecConfig.CHART_TYPE_CHORD: - case ecConfig.CHART_TYPE_GUAGE: - case ecConfig.CHART_TYPE_FUNNEL: - return 2; - - case ecConfig.COMPONENT_TYPE_LEGEND : - case ecConfig.COMPONENT_TYPE_DATARANGE: - case ecConfig.COMPONENT_TYPE_DATAZOOM : - case ecConfig.COMPONENT_TYPE_TIMELINE : - return 4; - - case ecConfig.CHART_TYPE_ISLAND : - return 5; - - case ecConfig.COMPONENT_TYPE_TOOLBOX : - case ecConfig.COMPONENT_TYPE_TITLE : - return 6; - - // ecConfig.EFFECT_ZLEVEL = 7; - - case ecConfig.COMPONENT_TYPE_TOOLTIP : - return 8; - - default : - return 0; - } - }, - - /** - * 参数修正&默认值赋值 - * @param {Object} opt 参数 - * - * @return {Object} 修正后的参数 - */ - reformOption : function (opt) { - return zrUtil.merge( - opt || {}, - zrUtil.clone(this.ecTheme[this.type] || {}) - ); - }, - - /** - * css类属性数组补全,如padding,margin等~ - */ - reformCssArray : function (p) { - if (p instanceof Array) { - switch (p.length + '') { - case '4': - return p; - case '3': - return [p[0], p[1], p[2], p[1]]; - case '2': - return [p[0], p[1], p[0], p[1]]; - case '1': - return [p[0], p[0], p[0], p[0]]; - case '0': - return [0, 0, 0, 0]; - } - } - else { - return [p, p, p, p]; - } - }, - - getShapeById : function(id) { - for (var i = 0, l = this.shapeList.length; i < l; i++) { - if (this.shapeList[i].id == id) { - return this.shapeList[i]; - } - } - return null; - }, - - /** - * 获取自定义和默认配置合并后的字体设置 - */ - getFont : function (textStyle) { - var finalTextStyle = zrUtil.merge( - zrUtil.clone(textStyle) || {}, - this.ecTheme.textStyle - ); - return finalTextStyle.fontStyle + ' ' - + finalTextStyle.fontWeight + ' ' - + finalTextStyle.fontSize + 'px ' - + finalTextStyle.fontFamily; - }, - - getItemStyleColor : function (itemColor, seriesIndex, dataIndex, data) { - return typeof itemColor == 'function' - ? itemColor(seriesIndex, dataIndex, data) : itemColor; - - }, - - // 亚像素优化 - subPixelOptimize : function (position, lineWidth) { - if (lineWidth % 2 == 1) { - //position += position == Math.ceil(position) ? 0.5 : 0; - position = Math.floor(position) + 0.5; - } - else { - position = Math.round(position); - } - return position; - }, - - - resize : function () { - this.refresh && this.refresh(); - this.clearEffectShape && this.clearEffectShape(true); - var self = this; - setTimeout(function(){ - self.animationEffect && self.animationEffect(); - },200); - }, - - /** - * 清除图形数据,实例仍可用 - */ - clear :function () { - this.clearEffectShape && this.clearEffectShape(); - this.zr && this.zr.delShape(this.shapeList); - this.shapeList = []; - }, - - /** - * 释放后实例不可用 - */ - dispose : function () { - this.clear(); - this.shapeList = null; - this.effectList = null; - }, - - query : ecQuery.query, - deepQuery : ecQuery.deepQuery, - deepMerge : ecQuery.deepMerge, - - parsePercent : number.parsePercent, - parseCenter : number.parseCenter, - parseRadius : number.parseRadius, - numAddCommas : number.addCommas - }; - - return Base; -}); - -/** - * zrender: 数学辅助类 - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * sin:正弦函数,自动缓存 - * cos:余弦函数,自动缓存 - * degreeToRadian:角度转弧度 - * radianToDegree:弧度转角度 - */ -define( - 'zrender/tool/math',[],function() { - /* - var _cache = { - sin : {}, //sin缓存 - cos : {} //cos缓存 - }; - */ - var _radians = Math.PI / 180; - - /** - * @param angle 弧度(角度)参数 - * @param isDegrees angle参数是否为角度计算,默认为false,angle为以弧度计量的角度 - */ - function sin(angle, isDegrees) { - return Math.sin(isDegrees ? angle * _radians : angle); - /* - angle = (isDegrees ? angle * _radians : angle).toFixed(4); - if(typeof _cache.sin[angle] == 'undefined') { - _cache.sin[angle] = Math.sin(angle); - } - return _cache.sin[angle]; - */ - } - - /** - * @param radians 弧度参数 - */ - function cos(angle, isDegrees) { - return Math.cos(isDegrees ? angle * _radians : angle); - /* - angle = (isDegrees ? angle * _radians : angle).toFixed(4); - if(typeof _cache.cos[angle] == 'undefined') { - _cache.cos[angle] = Math.cos(angle); - } - return _cache.cos[angle]; - */ - } - - /** - * 角度转弧度 - * @param {Object} angle - */ - function degreeToRadian(angle) { - return angle * _radians; - } - - /** - * 弧度转角度 - * @param {Object} angle - */ - function radianToDegree(angle) { - return angle / _radians; - } - - return { - sin : sin, - cos : cos, - degreeToRadian : degreeToRadian, - radianToDegree : radianToDegree - }; - } -); -/** - * zrender - * - * @author sushuang (宿爽, sushuang@baidu.com) - * - * shape类:n角星(n>3) - * 可配图形属性: - { - // 基础属性 - shape : 'star', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,n角星外接圆心横坐标 - y : {number}, // 必须,n角星外接圆心纵坐标 - r : {number}, // 必须,n角星外接圆半径 - r0 : {number}, // n角星内部顶点(凹点)的外接圆半径, - // 如果不指定此参数,则自动计算:取相隔外部顶点连线的交点作内部顶点 - n : {number}, // 必须,指明几角星 - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - lineJoin : {string}, // 默认为miter,线段连接样式。miter | round | bevel - - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为outside,附加文本位置。 - // outside | inside - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'star', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - r : 150, - n : 5, - color : '#eee' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - 'zrender/shape/Star',['require','../tool/math','./Base','../tool/util'],function (require) { - - var math = require('../tool/math'); - var sin = math.sin; - var cos = math.cos; - var PI = Math.PI; - - var Base = require('./Base'); - - function Star(options) { - Base.call(this, options); - } - - Star.prototype = { - type: 'star', - - /** - * 创建n角星(n>3)路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - var n = style.n; - if (!n || n < 2) { return; } - - var x = style.x; - var y = style.y; - var r = style.r; - var r0 = style.r0; - - // 如果未指定内部顶点外接圆半径,则自动计算 - if (r0 == null) { - r0 = n > 4 - // 相隔的外部顶点的连线的交点, - // 被取为内部交点,以此计算r0 - ? r * cos(2 * PI / n) / cos(PI / n) - // 二三四角星的特殊处理 - : r / 3; - } - - var dStep = PI / n; - var deg = -PI / 2; - var xStart = x + r * cos(deg); - var yStart = y + r * sin(deg); - deg += dStep; - - // 记录边界点,用于判断inside - var pointList = style.pointList = []; - pointList.push([xStart, yStart]); - for (var i = 0, end = n * 2 - 1, ri; i < end; i ++) { - ri = i % 2 === 0 ? r0 : r; - pointList.push([x + ri * cos(deg), y + ri * sin(deg)]); - deg += dStep; - } - pointList.push([xStart, yStart]); - - // 绘制 - ctx.moveTo(pointList[0][0], pointList[0][1]); - for (var i = 0; i < pointList.length; i ++) { - ctx.lineTo(pointList[i][0], pointList[i][1]); - } - - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function(style) { - if (style.__rect) { - return style.__rect; - } - - var lineWidth; - if (style.brushType == 'stroke' || style.brushType == 'fill') { - lineWidth = style.lineWidth || 1; - } - else { - lineWidth = 0; - } - style.__rect = { - x : Math.round(style.x - style.r - lineWidth / 2), - y : Math.round(style.y - style.r - lineWidth / 2), - width : style.r * 2 + lineWidth, - height : style.r * 2 + lineWidth - }; - - return style.__rect; - } - }; - - require('../tool/util').inherits(Star, Base); - return Star; - } -); -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:心形 - * 可配图形属性: - { - // 基础属性 - shape : 'heart', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,心形内部尖端横坐标 - y : {number}, // 必须,心形内部尖端纵坐标 - a : {number}, // 必须,心形横宽(中轴线到水平边缘最宽处距离) - b : {number}, // 必须,心形纵高(内尖到外尖距离) - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为outside,附加文本位置。 - // outside | inside - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'heart', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - a : 50, - b : 80, - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - 'zrender/shape/Heart',['require','./Base','../tool/util'],function (require) { - var Base = require('./Base'); - - function Heart(options) { - Base.call(this, options); - } - - Heart.prototype = { - type: 'heart', - - /** - * 创建扇形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - ctx.moveTo(style.x, style.y); - ctx.bezierCurveTo( - style.x + style.a / 2, - style.y - style.b * 2 / 3, - style.x + style.a * 2, - style.y + style.b / 3, - style.x, - style.y + style.b - ); - ctx.bezierCurveTo( - style.x - style.a * 2, - style.y + style.b / 3, - style.x - style.a / 2, - style.y - style.b * 2 / 3, - style.x, - style.y - ); - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function(style) { - if (style.__rect) { - return style.__rect; - } - - var lineWidth; - if (style.brushType == 'stroke' || style.brushType == 'fill') { - lineWidth = style.lineWidth || 1; - } - else { - lineWidth = 0; - } - style.__rect = { - x : Math.round(style.x - style.a - lineWidth / 2), - y : Math.round(style.y - style.b / 4 - lineWidth / 2), - width : style.a * 2 + lineWidth, - height : style.b * 5 / 4 + lineWidth - }; - - return style.__rect; - } - }; - - require('../tool/util').inherits(Heart, Base); - return Heart; - } -); -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:水滴 - * 可配图形属性: - { - // 基础属性 - shape : 'heart', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,水滴中心横坐标 - y : {number}, // 必须,水滴中心纵坐标 - a : {number}, // 必须,水滴横宽(中心到水平边缘最宽处距离) - b : {number}, // 必须,水滴纵高(中心到尖端距离) - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为outside,附加文本位置。 - // outside | inside - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'droplet', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - a : 50, - b : 80, - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - 'zrender/shape/Droplet',['require','./Base','../tool/util'],function (require) { - var Base = require('./Base'); - - function Droplet(options) { - Base.call(this, options); - } - - Droplet.prototype = { - type: 'droplet', - - /** - * 创建扇形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - ctx.moveTo(style.x, style.y + style.a); - ctx.bezierCurveTo( - style.x + style.a, - style.y + style.a, - style.x + style.a * 3 / 2, - style.y - style.a / 3, - style.x, - style.y - style.b - ); - ctx.bezierCurveTo( - style.x - style.a * 3 / 2, - style.y - style.a / 3, - style.x - style.a, - style.y + style.a, - style.x, - style.y + style.a - ); - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function(style) { - if (style.__rect) { - return style.__rect; - } - - var lineWidth; - if (style.brushType == 'stroke' || style.brushType == 'fill') { - lineWidth = style.lineWidth || 1; - } - else { - lineWidth = 0; - } - style.__rect = { - x : Math.round(style.x - style.a - lineWidth / 2), - y : Math.round(style.y - style.b - lineWidth / 2), - width : style.a * 2 + lineWidth, - height : style.a + style.b + lineWidth - }; - - return style.__rect; - } - }; - - require('../tool/util').inherits(Droplet, Base); - return Droplet; - } -); -/** - * echarts扩展zrender shape - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:icon - * 可配图形属性: - { - // 基础属性 - shape : 'icon', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,左上角横坐标 - y : {number}, // 必须,左上角纵坐标 - width : {number}, // 必须,宽度 - height : {number}, // 必须,高度 - iconType : {string}, // 必须,icon类型 - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - */ -define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/Star','zrender/shape/Heart','zrender/shape/Droplet','zrender/shape/Image','zrender/shape/Base'],function (require) { - var zrUtil = require('zrender/tool/util'); - - function _iconMark(ctx, style) { - var dx = style.width / 16; - var dy = style.height / 16; - ctx.moveTo(style.x, style.y + style.height); - ctx.lineTo(style.x + 5 * dx, style.y + 14 * dy); - ctx.lineTo(style.x + style.width, style.y + 3 * dy); - ctx.lineTo(style.x + 13 * dx, style.y); - ctx.lineTo(style.x + 2 * dx, style.y + 11 * dy); - ctx.lineTo(style.x, style.y + style.height); - - ctx.moveTo(style.x + 6 * dx, style.y + 10 * dy); - ctx.lineTo(style.x + 14 * dx, style.y + 2 * dy); - - ctx.moveTo(style.x + 10 * dx, style.y + 13 * dy); - ctx.lineTo(style.x + style.width, style.y + 13 * dy); - - ctx.moveTo(style.x + 13 * dx, style.y + 10 * dy); - ctx.lineTo(style.x + 13 * dx, style.y + style.height); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); - } - - function _iconMarkUndo(ctx, style) { - var dx = style.width / 16; - var dy = style.height / 16; - ctx.moveTo(style.x, style.y + style.height); - ctx.lineTo(style.x + 5 * dx, style.y + 14 * dy); - ctx.lineTo(style.x + style.width, style.y + 3 * dy); - ctx.lineTo(style.x + 13 * dx, style.y); - ctx.lineTo(style.x + 2 * dx, style.y + 11 * dy); - ctx.lineTo(style.x, style.y + style.height); - - ctx.moveTo(style.x + 6 * dx, style.y + 10 * dy); - ctx.lineTo(style.x + 14 * dx, style.y + 2 * dy); - - ctx.moveTo(style.x + 10 * dx, style.y + 13 * dy); - ctx.lineTo(style.x + style.width, style.y + 13 * dy); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); - } - - function _iconMarkClear(ctx, style) { - var dx = style.width / 16; - var dy = style.height / 16; - - ctx.moveTo(style.x + 4 * dx, style.y + 15 * dy); - ctx.lineTo(style.x + 9 * dx, style.y + 13 * dy); - ctx.lineTo(style.x + 14 * dx, style.y + 8 * dy); - ctx.lineTo(style.x + 11 * dx, style.y + 5 * dy); - ctx.lineTo(style.x + 6 * dx, style.y + 10 * dy); - ctx.lineTo(style.x + 4 * dx, style.y + 15 * dy); - - ctx.moveTo(style.x + 5 * dx, style.y); - ctx.lineTo(style.x + 11 * dx, style.y); - ctx.moveTo(style.x + 5 * dx, style.y + dy); - ctx.lineTo(style.x + 11 * dx, style.y + dy); - ctx.moveTo(style.x, style.y + 2 * dy); - ctx.lineTo(style.x + style.width, style.y + 2 * dy); - - ctx.moveTo(style.x, style.y + 5 * dy); - ctx.lineTo(style.x + 3 * dx, style.y + style.height); - ctx.lineTo(style.x + 13 * dx, style.y + style.height); - ctx.lineTo(style.x + style.width, style.y + 5 * dy); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); - } - - function _iconDataZoom(ctx, style) { - var dx = style.width / 16; - var dy = style.height / 16; - - ctx.moveTo(style.x, style.y + 3 * dy); - ctx.lineTo(style.x + 6 * dx, style.y + 3 * dy); - - ctx.moveTo(style.x + 3 * dx, style.y); - ctx.lineTo(style.x + 3 * dx, style.y + 6 * dy); - - ctx.moveTo(style.x + 3 * dx, style.y + 8 * dy); - ctx.lineTo(style.x + 3 * dx, style.y + style.height); - ctx.lineTo(style.x + style.width, style.y + style.height); - ctx.lineTo(style.x + style.width, style.y + 3 * dy); - ctx.lineTo(style.x + 8 * dx, style.y + 3 * dy); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); - } - - function _iconDataZoomReset(ctx, style) { - var dx = style.width / 16; - var dy = style.height / 16; - - ctx.moveTo(style.x + 6 * dx, style.y); - ctx.lineTo(style.x + 2 * dx, style.y + 3 * dy); - ctx.lineTo(style.x + 6 * dx, style.y + 6 * dy); - - ctx.moveTo(style.x + 2 * dx, style.y + 3 * dy); - ctx.lineTo(style.x + 14 * dx, style.y + 3 * dy); - ctx.lineTo(style.x + 14 * dx, style.y + 11 * dy); - - ctx.moveTo(style.x + 2 * dx, style.y + 5 * dy); - ctx.lineTo(style.x + 2 * dx, style.y + 13 * dy); - ctx.lineTo(style.x + 14 * dx, style.y + 13 * dy); - - ctx.moveTo(style.x + 10 * dx, style.y + 10 * dy); - ctx.lineTo(style.x + 14 * dx, style.y + 13 * dy); - ctx.lineTo(style.x + 10 * dx, style.y + style.height); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); - } - - function _iconRestore(ctx, style) { - var dx = style.width / 16; - var dy = style.height / 16; - var r = style.width / 2; - - ctx.lineWidth = 1.5; - - ctx.arc(style.x + r, style.y + r, r - dx, 0, Math.PI * 2 / 3); - ctx.moveTo(style.x + 3 * dx, style.y + style.height); - ctx.lineTo(style.x + 0 * dx, style.y + 12 * dy); - ctx.lineTo(style.x + 5 * dx, style.y + 11 * dy); - - ctx.moveTo(style.x, style.y + 8 * dy); - ctx.arc(style.x + r, style.y + r, r - dx, Math.PI, Math.PI * 5 / 3); - ctx.moveTo(style.x + 13 * dx, style.y); - ctx.lineTo(style.x + style.width, style.y + 4 * dy); - ctx.lineTo(style.x + 11 * dx, style.y + 5 * dy); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); - } - - function _iconLineChart(ctx, style) { - var dx = style.width / 16; - var dy = style.height / 16; - - ctx.moveTo(style.x, style.y); - ctx.lineTo(style.x, style.y + style.height); - ctx.lineTo(style.x + style.width, style.y + style.height); - - ctx.moveTo(style.x + 2 * dx, style.y + 14 * dy); - ctx.lineTo(style.x + 7 * dx, style.y + 6 * dy); - ctx.lineTo(style.x + 11 * dx, style.y + 11 * dy); - ctx.lineTo(style.x + 15 * dx, style.y + 2 * dy); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); - } - - function _iconBarChart(ctx, style) { - var dx = style.width / 16; - var dy = style.height / 16; - - ctx.moveTo(style.x, style.y); - ctx.lineTo(style.x, style.y + style.height); - ctx.lineTo(style.x + style.width, style.y + style.height); - - ctx.moveTo(style.x + 3 * dx, style.y + 14 * dy); - ctx.lineTo(style.x + 3 * dx, style.y + 6 * dy); - ctx.lineTo(style.x + 4 * dx, style.y + 6 * dy); - ctx.lineTo(style.x + 4 * dx, style.y + 14 * dy); - ctx.moveTo(style.x + 7 * dx, style.y + 14 * dy); - ctx.lineTo(style.x + 7 * dx, style.y + 2 * dy); - ctx.lineTo(style.x + 8 * dx, style.y + 2 * dy); - ctx.lineTo(style.x + 8 * dx, style.y + 14 * dy); - ctx.moveTo(style.x + 11 * dx, style.y + 14 * dy); - ctx.lineTo(style.x + 11 * dx, style.y + 9 * dy); - ctx.lineTo(style.x + 12 * dx, style.y + 9 * dy); - ctx.lineTo(style.x + 12 * dx, style.y + 14 * dy); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); - } - - function _iconStackChart(ctx, style) { - var x = style.x; - var y = style.y; - var width = style.width; - var height = style.height; - var dy = Math.round(height / 3); - var len = 3; - while (len--) { - ctx.rect(x, y + dy * len + 2, width, 2); - } - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); - } - - function _iconTiledChart(ctx, style) { - var x = style.x; - var y = style.y; - var width = style.width; - var height = style.height; - var dx = Math.round(width / 3); - var len = 3; - while (len--) { - ctx.rect(x + dx * len, y, 2, height); - } - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); - } - - function _iconDataView(ctx, style) { - var dx = style.width / 16; - - ctx.moveTo(style.x + dx, style.y); - ctx.lineTo(style.x + dx, style.y + style.height); - ctx.lineTo(style.x + 15 * dx, style.y + style.height); - ctx.lineTo(style.x + 15 * dx, style.y); - ctx.lineTo(style.x + dx, style.y); - - ctx.moveTo(style.x + 3 * dx, style.y + 3 * dx); - ctx.lineTo(style.x + 13 * dx, style.y + 3 * dx); - - ctx.moveTo(style.x + 3 * dx, style.y + 6 * dx); - ctx.lineTo(style.x + 13 * dx, style.y + 6 * dx); - - ctx.moveTo(style.x + 3 * dx, style.y + 9 * dx); - ctx.lineTo(style.x + 13 * dx, style.y + 9 * dx); - - ctx.moveTo(style.x + 3 * dx, style.y + 12 * dx); - ctx.lineTo(style.x + 9 * dx, style.y + 12 * dx); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); - } - - function _iconSave(ctx, style) { - var dx = style.width / 16; - var dy = style.height / 16; - - ctx.moveTo(style.x, style.y); - ctx.lineTo(style.x, style.y + style.height); - ctx.lineTo(style.x + style.width, style.y + style.height); - ctx.lineTo(style.x + style.width, style.y); - ctx.lineTo(style.x, style.y); - - ctx.moveTo(style.x + 4 * dx, style.y); - ctx.lineTo(style.x + 4 * dx, style.y + 8 * dy); - ctx.lineTo(style.x + 12 * dx, style.y + 8 * dy); - ctx.lineTo(style.x + 12 * dx, style.y); - - ctx.moveTo(style.x + 6 * dx, style.y + 11 * dy); - ctx.lineTo(style.x + 6 * dx, style.y + 13 * dy); - ctx.lineTo(style.x + 10 * dx, style.y + 13 * dy); - ctx.lineTo(style.x + 10 * dx, style.y + 11 * dy); - ctx.lineTo(style.x + 6 * dx, style.y + 11 * dy); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); - } - - function _iconCross(ctx, style) { - var x = style.x; - var y = style.y; - var width = style.width; - var height = style.height; - ctx.moveTo(x, y + height / 2); - ctx.lineTo(x + width, y + height / 2); - - ctx.moveTo(x + width / 2, y); - ctx.lineTo(x + width / 2, y + height); - } - - function _iconCircle(ctx, style) { - var width = style.width / 2; - var height = style.height / 2; - var r = Math.min(width, height); - ctx.moveTo( - style.x + width + r, - style.y + height - ); - ctx.arc( - style.x + width, - style.y + height, - r, - 0, - Math.PI * 2 - ); - } - - function _iconRectangle(ctx, style) { - ctx.rect(style.x, style.y, style.width, style.height); - } - - function _iconTriangle(ctx, style) { - var width = style.width / 2; - var height = style.height / 2; - var x = style.x + width; - var y = style.y + height; - var symbolSize = Math.min(width, height); - ctx.moveTo(x, y - symbolSize); - ctx.lineTo(x + symbolSize, y + symbolSize); - ctx.lineTo(x - symbolSize, y + symbolSize); - ctx.lineTo(x, y - symbolSize); - } - - function _iconDiamond(ctx, style) { - var width = style.width / 2; - var height = style.height / 2; - var x = style.x + width; - var y = style.y + height; - var symbolSize = Math.min(width, height); - ctx.moveTo(x, y - symbolSize); - ctx.lineTo(x + symbolSize, y); - ctx.lineTo(x, y + symbolSize); - ctx.lineTo(x - symbolSize, y); - ctx.lineTo(x, y - symbolSize); - } - - function _iconArrow(ctx, style) { - var x = style.x; - var y = style.y; - var dx = style.width / 16; - ctx.moveTo(x + 8 * dx, y); - ctx.lineTo(x + dx, y + style.height); - ctx.lineTo(x + 8 * dx, y + style.height / 4 * 3); - ctx.lineTo(x + 15 * dx, y + style.height); - ctx.lineTo(x + 8 * dx, y); - } - - function _iconStar(ctx, style) { - var StarShape = require('zrender/shape/Star'); - var width = style.width / 2; - var height = style.height / 2; - StarShape.prototype.buildPath(ctx, { - x : style.x + width, - y : style.y + height, - r : Math.min(width, height), - n : style.n || 5 - }); - } - - function _iconHeart(ctx, style) { - var HeartShape = require('zrender/shape/Heart'); - HeartShape.prototype.buildPath(ctx, { - x : style.x + style.width / 2, - y : style.y + style.height * 0.2, - a : style.width / 2, - b : style.height * 0.8 - }); - } - - function _iconDroplet(ctx, style) { - var DropletShape = require('zrender/shape/Droplet'); - DropletShape.prototype.buildPath(ctx, { - x : style.x + style.width * 0.5, - y : style.y + style.height * 0.5, - a : style.width * 0.5, - b : style.height * 0.8 - }); - } - - function _iconPin(ctx, style) { - var x = style.x; - var y = style.y - style.height / 2 * 1.5; - var width = style.width / 2; - var height = style.height / 2; - var r = Math.min(width, height); - ctx.arc( - x + width, - y + height, - r, - Math.PI / 5 * 4, - Math.PI / 5 - ); - ctx.lineTo(x + width, y + height + r * 1.5); - } - - function _iconImage(ctx, style) { - setTimeout(function (){ - var ImageShape = require('zrender/shape/Image'); - var itemShape = new ImageShape({ - style : style - }); - itemShape.brush(ctx); - },100); - } - - var Base = require('zrender/shape/Base'); - - function Icon(options) { - Base.call(this, options); - } - - Icon.prototype = { - type : 'icon', - iconLibrary : { - mark : _iconMark, - markUndo : _iconMarkUndo, - markClear : _iconMarkClear, - dataZoom : _iconDataZoom, - dataZoomReset : _iconDataZoomReset, - restore : _iconRestore, - lineChart : _iconLineChart, - barChart : _iconBarChart, - stackChart : _iconStackChart, - tiledChart : _iconTiledChart, - dataView : _iconDataView, - saveAsImage : _iconSave, - - cross : _iconCross, - circle : _iconCircle, - rectangle : _iconRectangle, - triangle : _iconTriangle, - diamond : _iconDiamond, - arrow : _iconArrow, - star : _iconStar, - heart : _iconHeart, - droplet : _iconDroplet, - pin : _iconPin, - image : _iconImage - }, - /** - * 创建矩形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function (ctx, style) { - if (this.iconLibrary[style.iconType]) { - this.iconLibrary[style.iconType](ctx, style); - } - else { - ctx.moveTo(style.x, style.y); - ctx.lineTo(style.x + style.width, style.y); - ctx.lineTo(style.x + style.width, style.y + style.height); - ctx.lineTo(style.x, style.y + style.height); - ctx.lineTo(style.x, style.y); - } - - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function (style) { - if (style.__rect) { - return style.__rect; - } - - // pin比较特殊,让尖端在目标x,y上 - style.__rect = { - x : Math.round(style.x), - y : Math.round(style.y - (style.iconType == 'pin' - ? (style.height / 2 * 1.5) : 0) - ), - width : style.width, - height : style.height - }; - - return style.__rect; - }, - - isCover : function (x, y) { - var originPos = this.getTansform(x, y); - x = originPos[0]; - y = originPos[1]; - - // 快速预判并保留判断矩形 - var rect = this.style.__rect; - if (!rect) { - rect = this.style.__rect = this.getRect(this.style); - } - // 提高交互体验,太小的图形包围盒四向扩大4px - var delta = (rect.height < 8 || rect.width < 8 ) ? 4 : 0; - if (x >= rect.x - delta - && x <= (rect.x + rect.width + delta) - && y >= rect.y - delta - && y <= (rect.y + rect.height + delta) - ) { - // 矩形内 - return true; - } - else { - return false; - } - } - }; - - zrUtil.inherits(Icon, Base); - - return Icon; -}); -/** - * 虚线lineTo - * - * author: Kener (@Kener-林峰, linzhifeng@baidu.com) - * errorrik (errorrik@gmail.com) - */ - -define( - 'zrender/shape/util/dashedLineTo',[],function (/* require */) { - - var dashPattern = [5, 5]; - /** - * 虚线lineTo - */ - return function (ctx, x1, y1, x2, y2, dashLength) { - // http://msdn.microsoft.com/en-us/library/ie/dn265063(v=vs.85).aspx - if (ctx.setLineDash) { - dashPattern[0] = dashPattern[1] = dashLength; - ctx.setLineDash(dashPattern); - ctx.moveTo(x1, y1); - ctx.lineTo(x2, y2); - return; - } - - dashLength = typeof dashLength != 'number' - ? 5 - : dashLength; - - var dx = x2 - x1; - var dy = y2 - y1; - var numDashes = Math.floor( - Math.sqrt(dx * dx + dy * dy) / dashLength - ); - dx = dx / numDashes; - dy = dy / numDashes; - var flag = true; - for (var i = 0; i < numDashes; ++i) { - if (flag) { - ctx.moveTo(x1, y1); - } else { - ctx.lineTo(x1, y1); - } - flag = !flag; - x1 += dx; - y1 += dy; - } - ctx.lineTo(x2, y2); - }; - } -); - -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:直线 - * 可配图形属性: - { - // 基础属性 - shape : 'line', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - xStart : {number}, // 必须,起点横坐标 - yStart : {number}, // 必须,起点纵坐标 - xEnd : {number}, // 必须,终点横坐标 - yEnd : {number}, // 必须,终点纵坐标 - strokeColor : {color}, // 默认为'#000',线条颜色(轮廓),支持rgba - lineType : {string}, // 默认为solid,线条类型,solid | dashed | dotted - lineWidth : {number}, // 默认为1,线条宽度 - lineCap : {string}, // 默认为butt,线帽样式。butt | round | square - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为end,附加文本位置。 - // inside | start | end - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#000' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'line', - id : '123456', - zlevel : 1, - style : { - xStart : 100, - yStart : 100, - xEnd : 200, - yEnd : 200, - strokeColor : '#eee', - lineWidth : 20, - text : 'Baidu' - }, - myName : 'kener', //可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - 'zrender/shape/Line',['require','./Base','./util/dashedLineTo','../tool/util'],function (require) { - var Base = require('./Base'); - var dashedLineTo = require('./util/dashedLineTo'); - - function Line(options) { - this.brushTypeOnly = 'stroke'; //线条只能描边,填充后果自负 - this.textPosition = 'end'; - Base.call(this, options); - } - - Line.prototype = { - type: 'line', - - /** - * 创建线条路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - if (!style.lineType || style.lineType == 'solid') { - //默认为实线 - ctx.moveTo(style.xStart, style.yStart); - ctx.lineTo(style.xEnd, style.yEnd); - } - else if (style.lineType == 'dashed' - || style.lineType == 'dotted' - ) { - var dashLength = (style.lineWidth || 1) - * (style.lineType == 'dashed' ? 5 : 1); - dashedLineTo( - ctx, - style.xStart, style.yStart, - style.xEnd, style.yEnd, - dashLength - ); - } - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function(style) { - if (style.__rect) { - return style.__rect; - } - - var lineWidth = style.lineWidth || 1; - style.__rect = { - x : Math.min(style.xStart, style.xEnd) - lineWidth, - y : Math.min(style.yStart, style.yEnd) - lineWidth, - width : Math.abs(style.xStart - style.xEnd) - + lineWidth, - height : Math.abs(style.yStart - style.yEnd) - + lineWidth - }; - - return style.__rect; - } - }; - - require('../tool/util').inherits(Line, Base); - return Line; - } -); -/** - * zrender: 向量操作类 - * - * author : https://github.com/pissang - */ -define( - 'zrender/tool/vector',[],function() { - var ArrayCtor = typeof Float32Array === 'undefined' - ? Array - : Float32Array; - - var vector = { - create : function(x, y) { - var out = new ArrayCtor(2); - out[0] = x || 0; - out[1] = y || 0; - return out; - }, - copy : function(out, v) { - out[0] = v[0]; - out[1] = v[1]; - }, - set : function(out, a, b) { - out[0] = a; - out[1] = b; - }, - add : function(out, v1, v2) { - out[0] = v1[0] + v2[0]; - out[1] = v1[1] + v2[1]; - return out; - }, - scaleAndAdd : function(out, v1, v2, a) { - out[0] = v1[0] + v2[0] * a; - out[1] = v1[1] + v2[1] * a; - return out; - }, - sub : function(out, v1, v2) { - out[0] = v1[0] - v2[0]; - out[1] = v1[1] - v2[1]; - return out; - }, - length : function(v) { - return Math.sqrt(this.lengthSquare(v)); - }, - lengthSquare : function(v) { - return v[0] * v[0] + v[1] * v[1]; - }, - mul : function(out, v1, v2) { - out[0] = v1[0] * v2[0]; - out[1] = v1[1] * v2[1]; - return out; - }, - dot : function(v1, v2) { - return v1[0] * v2[0] + v1[1] * v2[1]; - }, - scale : function(out, v, s) { - out[0] = v[0] * s; - out[1] = v[1] * s; - return out; - }, - normalize : function(out, v) { - var d = vector.length(v); - if(d === 0){ - out[0] = 0; - out[1] = 0; - }else{ - out[0] = v[0]/d; - out[1] = v[1]/d; - } - return out; - }, - distance : function(v1, v2) { - return Math.sqrt( - (v1[0] - v2[0]) * (v1[0] - v2[0]) + - (v1[1] - v2[1]) * (v1[1] - v2[1]) - ); - }, - negate : function(out, v) { - out[0] = -v[0]; - out[1] = -v[1]; - }, - middle : function(out, v1, v2) { - out[0] = (v1[0] + v2[0])/2; - out[1] = (v1[1] + v2[1])/2; - return out; - }, - applyTransform: function(out, v, m) { - var x = v[0]; - var y = v[1]; - out[0] = m[0] * x + m[2] * y + m[4]; - out[1] = m[1] * x + m[3] * y + m[5]; - return out; - } - }; - - vector.len = vector.length; - vector.dist = vector.distance; - - return vector; - } -); -/** - * 多线段平滑曲线 Catmull-Rom spline - * - * author: Kener (@Kener-林峰, linzhifeng@baidu.com) - * errorrik (errorrik@gmail.com) - */ - - -define( - 'zrender/shape/util/smoothSpline',['require','../../tool/vector'],function ( require ) { - var vector = require('../../tool/vector'); - - /** - * @inner - */ - function interpolate(p0, p1, p2, p3, t, t2, t3) { - var v0 = (p2 - p0) * 0.5; - var v1 = (p3 - p1) * 0.5; - return (2 * (p1 - p2) + v0 + v1) * t3 - + (- 3 * (p1 - p2) - 2 * v0 - v1) * t2 - + v0 * t + p1; - } - - /** - * 多线段平滑曲线 Catmull-Rom spline - */ - return function (points, isLoop) { - var len = points.length; - var ret = []; - - var distance = 0; - for (var i = 1; i < len; i++) { - distance += vector.distance(points[i-1], points[i]); - } - - var segs = distance / 5; - segs = segs < len ? len : segs; - for (var i = 0; i < segs; i++) { - var pos = i / (segs-1) * (isLoop ? len : len - 1); - var idx = Math.floor(pos); - - var w = pos - idx; - - var p0; - var p1 = points[idx % len]; - var p2; - var p3; - if (!isLoop) { - p0 = points[idx === 0 ? idx : idx - 1]; - p2 = points[idx > len - 2 ? len - 1 : idx + 1]; - p3 = points[idx > len - 3 ? len - 1 : idx + 2]; - } else { - p0 = points[(idx -1 + len) % len]; - p2 = points[(idx + 1) % len]; - p3 = points[(idx + 2) % len]; - } - - var w2 = w * w; - var w3 = w * w2; - - ret.push([ - interpolate(p0[0], p1[0], p2[0], p3[0], w, w2, w3), - interpolate(p0[1], p1[1], p2[1], p3[1], w, w2, w3) - ]); - } - return ret; - }; - } -); - -/** - * 贝塞尔平滑曲线 - * - * author: Kener (@Kener-林峰, linzhifeng@baidu.com) - * errorrik (errorrik@gmail.com) - */ - -define( - 'zrender/shape/util/smoothBezier',['require','../../tool/vector'],function ( require ) { - var vector = require('../../tool/vector'); - - /** - * 贝塞尔平滑曲线 - */ - return function (points, smooth, isLoop) { - var cps = []; - - var v = []; - var v1 = []; - var v2 = []; - var prevPoint; - var nextPoint; - - for (var i = 0, len = points.length; i < len; i++) { - var point = points[i]; - var prevPoint; - var nextPoint; - - if (isLoop) { - prevPoint = points[i ? i - 1 : len - 1]; - nextPoint = points[(i + 1) % len]; - } - else { - if (i === 0 || i === len - 1) { - cps.push(points[i]); - continue; - } - else { - prevPoint = points[i - 1]; - nextPoint = points[i + 1]; - } - } - - vector.sub(v, nextPoint, prevPoint); - - //use degree to scale the handle length - vector.scale(v, v, smooth); - - var d0 = vector.distance(point, prevPoint); - var d1 = vector.distance(point, nextPoint); - var sum = d0 + d1; - d0 /= sum; - d1 /= sum; - - vector.scale(v1, v, -d0); - vector.scale(v2, v, d1); - - cps.push(vector.add([], point, v1)); - cps.push(vector.add([], point, v2)); - } - - if (isLoop) { - cps.push(cps.shift()); - } - - return cps; - }; - } -); - -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:多边形 - * 可配图形属性: - { - // 基础属性 - shape : 'polygon', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - pointList : {Array}, // 必须,多边形各个顶角坐标 - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为top,附加文本位置。 - // inside | left | right | top | bottom - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'polygon', - id : '123456', - zlevel : 1, - style : { - pointList : [[10, 10], [300, 20], [298, 400], [50, 450]] - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - 'zrender/shape/Polygon',['require','./Base','./util/smoothSpline','./util/smoothBezier','./util/dashedLineTo','../tool/util'],function (require) { - var Base = require('./Base'); - var smoothSpline = require('./util/smoothSpline'); - var smoothBezier = require('./util/smoothBezier'); - var dashedLineTo = require('./util/dashedLineTo'); - - - function Polygon(options) { - Base.call(this, options); - } - - Polygon.prototype = { - type: 'polygon', - - /** - * 画刷 - * @param ctx 画布句柄 - * @param isHighlight 是否为高亮状态 - * @param updateCallback 需要异步加载资源的shape可以通过这个callback(e) - * 让painter更新视图,base.brush没用,需要的话重载brush - */ - brush : function (ctx, isHighlight) { - var style = this.style; - if (isHighlight) { - // 根据style扩展默认高亮样式 - style = this.getHighlightStyle( - style, - this.highlightStyle || {} - ); - } - - ctx.save(); - this.setContext(ctx, style); - - // 设置transform - this.setTransform(ctx); - - // 先fill再stroke - var hasPath = false; - if (style.brushType == 'fill' - || style.brushType == 'both' - || typeof style.brushType == 'undefined' // 默认为fill - ) { - ctx.beginPath(); - if (style.lineType == 'dashed' - || style.lineType == 'dotted' - ) { - // 特殊处理,虚线围不成path,实线再build一次 - this.buildPath( - ctx, - { - lineType: 'solid', - lineWidth: style.lineWidth, - pointList: style.pointList - } - ); - hasPath = false; // 这个path不能用 - } - else { - this.buildPath(ctx, style); - hasPath = true; // 这个path能用 - } - ctx.closePath(); - ctx.fill(); - } - - if (style.lineWidth > 0 - && (style.brushType == 'stroke' || style.brushType == 'both') - ) { - if (!hasPath) { - ctx.beginPath(); - this.buildPath(ctx, style); - ctx.closePath(); - } - ctx.stroke(); - } - - this.drawText(ctx, style, this.style); - - ctx.restore(); - - return; - }, - - /** - * 创建多边形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - // 虽然能重用brokenLine,但底层图形基于性能考虑,重复代码减少调用吧 - var pointList = style.pointList; - // 开始点和结束点重复 - /* - var start = pointList[0]; - var end = pointList[pointList.length-1]; - - if (start && end) { - if (start[0] == end[0] && - start[1] == end[1]) { - // 移除最后一个点 - pointList.pop(); - } - } - */ - - if (pointList.length < 2) { - // 少于2个点就不画了~ - return; - } - - if (style.smooth && style.smooth !== 'spline') { - var controlPoints = smoothBezier( - pointList, style.smooth, true - ); - - ctx.moveTo(pointList[0][0], pointList[0][1]); - var cp1; - var cp2; - var p; - var len = pointList.length; - for (var i = 0; i < len; i++) { - cp1 = controlPoints[i * 2]; - cp2 = controlPoints[i * 2 + 1]; - p = pointList[(i + 1) % len]; - ctx.bezierCurveTo( - cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1] - ); - } - } - else { - if (style.smooth === 'spline') { - pointList = smoothSpline(pointList, true); - } - - if (!style.lineType || style.lineType == 'solid') { - //默认为实线 - ctx.moveTo(pointList[0][0],pointList[0][1]); - for (var i = 1, l = pointList.length; i < l; i++) { - ctx.lineTo(pointList[i][0],pointList[i][1]); - } - ctx.lineTo(pointList[0][0], pointList[0][1]); - } - else if (style.lineType == 'dashed' - || style.lineType == 'dotted' - ) { - var dashLength = - style._dashLength - || (style.lineWidth || 1) - * (style.lineType == 'dashed' ? 5 : 1); - style._dashLength = dashLength; - ctx.moveTo(pointList[0][0],pointList[0][1]); - for (var i = 1, l = pointList.length; i < l; i++) { - dashedLineTo( - ctx, - pointList[i - 1][0], pointList[i - 1][1], - pointList[i][0], pointList[i][1], - dashLength - ); - } - dashedLineTo( - ctx, - pointList[pointList.length - 1][0], - pointList[pointList.length - 1][1], - pointList[0][0], - pointList[0][1], - dashLength - ); - } - } - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function(style) { - if (style.__rect) { - return style.__rect; - } - - var minX = Number.MAX_VALUE; - var maxX = Number.MIN_VALUE; - var minY = Number.MAX_VALUE; - var maxY = Number.MIN_VALUE; - - var pointList = style.pointList; - for(var i = 0, l = pointList.length; i < l; i++) { - if (pointList[i][0] < minX) { - minX = pointList[i][0]; - } - if (pointList[i][0] > maxX) { - maxX = pointList[i][0]; - } - if (pointList[i][1] < minY) { - minY = pointList[i][1]; - } - if (pointList[i][1] > maxY) { - maxY = pointList[i][1]; - } - } - - var lineWidth; - if (style.brushType == 'stroke' || style.brushType == 'fill') { - lineWidth = style.lineWidth || 1; - } - else { - lineWidth = 0; - } - - style.__rect = { - x : Math.round(minX - lineWidth / 2), - y : Math.round(minY - lineWidth / 2), - width : maxX - minX + lineWidth, - height : maxY - minY + lineWidth - }; - return style.__rect; - } - }; - - require('../tool/util').inherits(Polygon, Base); - return Polygon; - } -); -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:折线 - * 可配图形属性: - { - // 基础属性 - shape : 'brokenLine', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - pointList : {Array}, // 必须,各个顶角坐标 - smooth : {Number}, // 默认为0 - strokeColor : {color}, // 默认为'#000',线条颜色(轮廓),支持rgba - lineType : {string}, // 默认为solid,线条类型,solid | dashed | dotted - lineWidth : {number}, // 默认为1,线条宽度 - lineCap : {string}, // 默认为butt,线帽样式。butt | round | square - lineJoin : {string}, // 默认为miter,线段连接样式。miter | round | bevel - miterLimit : {number}, // 默认为10,最大斜接长度,仅当lineJoin为miter时生效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为end,附加文本位置。 - // start | end - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#000' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'brokenLine', - id : '123456', - zlevel : 1, - style : { - pointList : [[10, 10], [300, 20], [298, 400], [50, 450]], - strokeColor : '#eee', - lineWidth : 20, - text : 'Baidu' - }, - myName : 'kener', //可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - 'zrender/shape/BrokenLine',['require','./Base','./util/smoothSpline','./util/smoothBezier','./util/dashedLineTo','./Polygon','../tool/util'],function (require) { - var Base = require('./Base'); - var smoothSpline = require('./util/smoothSpline'); - var smoothBezier = require('./util/smoothBezier'); - var dashedLineTo = require('./util/dashedLineTo'); - - function BrokenLine( options ) { - this.brushTypeOnly = 'stroke'; //线条只能描边,填充后果自负 - this.textPosition = 'end'; - Base.call(this, options); - } - - BrokenLine.prototype = { - type: 'broken-line', - - /** - * 创建多边形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - var pointList = style.pointList; - if (pointList.length < 2) { - // 少于2个点就不画了~ - return; - } - - var len = Math.min( - style.pointList.length, - Math.round(style.pointListLength || style.pointList.length) - ); - - if (style.smooth && style.smooth !== 'spline') { - var controlPoints = smoothBezier( - pointList, style.smooth - ); - - ctx.moveTo(pointList[0][0], pointList[0][1]); - var cp1; - var cp2; - var p; - for (var i = 0; i < len - 1; i++) { - cp1 = controlPoints[i * 2]; - cp2 = controlPoints[i * 2 + 1]; - p = pointList[i + 1]; - ctx.bezierCurveTo( - cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1] - ); - } - } - else { - if (style.smooth === 'spline') { - pointList = smoothSpline(pointList); - len = pointList.length; - } - if (!style.lineType || style.lineType == 'solid') { - //默认为实线 - ctx.moveTo(pointList[0][0],pointList[0][1]); - for (var i = 1; i < len; i++) { - ctx.lineTo(pointList[i][0],pointList[i][1]); - } - } - else if (style.lineType == 'dashed' - || style.lineType == 'dotted' - ) { - var dashLength = (style.lineWidth || 1) - * (style.lineType == 'dashed' ? 5 : 1); - ctx.moveTo(pointList[0][0],pointList[0][1]); - for (var i = 1; i < len; i++) { - dashedLineTo( - ctx, - pointList[i - 1][0], pointList[i - 1][1], - pointList[i][0], pointList[i][1], - dashLength - ); - } - } - } - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function(style) { - return require('./Polygon').prototype.getRect(style); - } - }; - - require('../tool/util').inherits(BrokenLine, Base); - return BrokenLine; - } -); - -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:标线 - */ -define('echarts/util/shape/MarkLine',['require','zrender/shape/Base','./Icon','zrender/shape/Line','zrender/shape/BrokenLine','zrender/tool/matrix','zrender/tool/area','zrender/shape/util/dashedLineTo','zrender/shape/util/smoothSpline','zrender/tool/util'],function (require) { - var Base = require('zrender/shape/Base'); - var IconShape = require('./Icon'); - var LineShape = require('zrender/shape/Line'); - var lineInstance = new LineShape({}); - var BrokenLineShape = require('zrender/shape/BrokenLine'); - var brokenLineInstance = new BrokenLineShape({}); - - var matrix = require('zrender/tool/matrix'); - var area = require('zrender/tool/area'); - var dashedLineTo = require('zrender/shape/util/dashedLineTo'); - var smoothSpline = require('zrender/shape/util/smoothSpline'); - var zrUtil = require('zrender/tool/util'); - - - function MarkLine(options) { - Base.call(this, options); - } - - MarkLine.prototype = { - type : 'mark-line', - /** - * 画刷 - * @param ctx 画布句柄 - * @param e 形状实体 - * @param isHighlight 是否为高亮状态 - * @param updateCallback 需要异步加载资源的shape可以通过这个callback(e) - * 让painter更新视图,base.brush没用,需要的话重载brush - */ - brush : function (ctx, isHighlight) { - var style = this.style; - - if (isHighlight) { - // 根据style扩展默认高亮样式 - style = this.getHighlightStyle( - style, - this.highlightStyle || {} - ); - } - - ctx.save(); - this.setContext(ctx, style); - - // 设置transform - this.setTransform(ctx); - - ctx.beginPath(); - this.buildLinePath(ctx, style); - ctx.stroke(); - - this.brushSymbol(ctx, style, 0); - this.brushSymbol(ctx, style, 1); - - this.drawText(ctx, style, this.style); - - ctx.restore(); - }, - - /** - * 创建线条路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildLinePath : function (ctx, style) { - var pointList = style.pointList || this.getPointList(style); - style.pointList = pointList; - - var len = Math.min( - style.pointList.length, - Math.round(style.pointListLength || style.pointList.length) - ); - - if (!style.lineType || style.lineType == 'solid') { - //默认为实线 - ctx.moveTo(pointList[0][0],pointList[0][1]); - for (var i = 1; i < len; i++) { - ctx.lineTo(pointList[i][0],pointList[i][1]); - } - } - else if (style.lineType == 'dashed' - || style.lineType == 'dotted' - ) { - if (style.smooth !== 'spline') { - // 直线 - var dashLength = (style.lineWidth || 1) - * (style.lineType == 'dashed' ? 5 : 1); - ctx.moveTo(pointList[0][0],pointList[0][1]); - for (var i = 1; i < len; i++) { - dashedLineTo( - ctx, - pointList[i - 1][0], pointList[i - 1][1], - pointList[i][0], pointList[i][1], - dashLength - ); - } - } - else { - // 曲线 - for (var i = 1; i < len; i += 2) { - ctx.moveTo(pointList[i - 1][0],pointList[i - 1][1]); - ctx.lineTo(pointList[i][0],pointList[i][1]); - } - } - } - }, - - /** - * 标线始末标注 - */ - brushSymbol : function (ctx, style, idx) { - if (style.symbol[idx] == 'none') { - return; - } - ctx.save(); - ctx.beginPath(); - - ctx.lineWidth = style.symbolBorder; - ctx.strokeStyle = style.symbolBorderColor; - // symbol - style.iconType = style.symbol[idx].replace('empty', '') - .toLowerCase(); - if (style.symbol[idx].match('empty')) { - ctx.fillStyle = '#fff'; //'rgba(0, 0, 0, 0)'; - } - - // symbolRotate - var len = Math.min( - style.pointList.length, - Math.round(style.pointListLength || style.pointList.length) - ); - var x = idx === 0 ? style.pointList[0][0] : style.pointList[len - 1][0]; - var y = idx === 0 ? style.pointList[0][1] : style.pointList[len - 1][1]; - var rotate = typeof style.symbolRotate[idx] != 'undefined' - ? (style.symbolRotate[idx] - 0) : 0; - var transform; - if (rotate !== 0) { - transform = matrix.create(); - matrix.identity(transform); - if (x || y ) { - matrix.translate(transform, transform, [-x, -y]); - } - matrix.rotate( - transform, transform, - rotate * Math.PI / 180 - ); - if (x || y ) { - matrix.translate(transform, transform, [x, y]); - } - ctx.transform.apply(ctx, transform); - } - - if (style.iconType == 'arrow' && rotate === 0) { - // 箭头自动旋转,手动画 - this.buildArrawPath(ctx, style, idx); - } - else { - // symbolSize - var symbolSize = style.symbolSize[idx]; - style.x = x - symbolSize; - style.y = y - symbolSize, - style.width = symbolSize * 2; - style.height = symbolSize * 2; - IconShape.prototype.buildPath(ctx, style); - } - - ctx.closePath(); - ctx.fill(); - ctx.stroke(); - ctx.restore(); - }, - - buildArrawPath : function (ctx, style, idx) { - var len = Math.min( - style.pointList.length, - Math.round(style.pointListLength || style.pointList.length) - ); - var symbolSize = style.symbolSize[idx] * 2; - var xStart = style.pointList[0][0]; - var xEnd = style.pointList[len - 1][0]; - var yStart = style.pointList[0][1]; - var yEnd = style.pointList[len - 1][1]; - var delta = 0; - if (style.smooth === 'spline') { - delta = 0.2; // 偏移0.2弧度 - } - // 原谅我吧,这三角函数实在没想明白,只能这么笨了 - var rotate = Math.atan( - Math.abs((yEnd - yStart) / (xStart - xEnd) - )); - if (idx === 0) { - if (xEnd > xStart) { - if (yEnd > yStart) { - rotate = Math.PI * 2 - rotate + delta; - } - else { - rotate += delta; - } - } - else { - if (yEnd > yStart) { - rotate += Math.PI - delta; - } - else { - rotate = Math.PI - rotate - delta; - } - } - } - else { - if (xStart > xEnd) { - if (yStart > yEnd) { - rotate = Math.PI * 2 - rotate + delta; - } - else { - rotate += delta; - } - } - else { - if (yStart > yEnd) { - rotate += Math.PI - delta; - } - else { - rotate = Math.PI - rotate - delta; - } - } - } - - var halfRotate = Math.PI / 8; // 夹角 - var x = idx === 0 ? xStart : xEnd; - var y = idx === 0 ? yStart : yEnd; - var point= [ - [ - x + symbolSize * Math.cos(rotate - halfRotate), - y - symbolSize * Math.sin(rotate - halfRotate) - ], - [ - x + symbolSize * 0.6 * Math.cos(rotate), - y - symbolSize * 0.6 * Math.sin(rotate) - ], - [ - x + symbolSize * Math.cos(rotate + halfRotate), - y - symbolSize * Math.sin(rotate + halfRotate) - ] - ]; - ctx.moveTo(x, y); - for (var i = 0, l = point.length; i = rect.x - && x <= (rect.x + rect.width) - && y >= rect.y - && y <= (rect.y + rect.height) - ) { - // 矩形内 - return this.style.smooth !== 'spline' - ? area.isInside(lineInstance, this.style, x, y) - : area.isInside(brokenLineInstance, this.style, x, y); - } - - return false; - } - }; - - zrUtil.inherits(MarkLine, Base); - - return MarkLine; -}); - -// 由于大多数shape默认的isCover都是相同的逻辑 -// 所以在echarts里临时抽象一个module,用于isCover method -// TODO: 对zrender的isCover和getRect方法进行抽象,重新整理该逻辑 - -define('echarts/util/shape/normalIsCover',[],function () { - return function (x, y) { - var originPos = this.getTansform(x, y); - x = originPos[0]; - y = originPos[1]; - - // 快速预判并保留判断矩形 - var rect = this.style.__rect; - if (!rect) { - rect = this.style.__rect = this.getRect(this.style); - } - - return x >= rect.x - && x <= (rect.x + rect.width) - && y >= rect.y - && y <= (rect.y + rect.height); - }; -}); - -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:大规模散点图图形 - * 可配图形属性: - { - // 基础属性 - shape : 'symbol', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - pointList : {Array}, // 必须,二维数组,二维内容如下 - x : {number}, // 必须,横坐标 - y : {number}, // 必须,纵坐标数组 - size : {number}, // 必须,半宽 - type : {string=}, // 默认为'circle',图形类型 - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - */ -define('echarts/util/shape/Symbol',['require','zrender/shape/Base','zrender/shape/Polygon','zrender/tool/util','./normalIsCover'],function (require) { - var Base = require('zrender/shape/Base'); - var PolygonShape = require('zrender/shape/Polygon'); - var polygonInstance = new PolygonShape({}); - var zrUtil = require('zrender/tool/util'); - - function Symbol(options) { - Base.call(this, options); - } - - Symbol.prototype = { - type : 'symbol', - /** - * 创建矩形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function (ctx, style) { - var pointList = style.pointList; - var len = pointList.length; - if (len === 0) { - return; - } - - var subSize = 10000; - var subSetLength = Math.ceil(len / subSize); - var sub; - var subLen; - var isArray = pointList[0] instanceof Array; - var size = style.size ? style.size : 2; - var curSize = size; - var halfSize = size / 2; - var PI2 = Math.PI * 2; - var percent; - var x; - var y; - for (var j = 0; j < subSetLength; j++) { - ctx.beginPath(); - sub = j * subSize; - subLen = sub + subSize; - subLen = subLen > len ? len : subLen; - for (var i = sub; i < subLen; i++) { - if (style.random) { - percent = style['randomMap' + (i % 20)] / 100; - curSize = size * percent * percent; - halfSize = curSize / 2; - } - if (isArray) { - x = pointList[i][0]; - y = pointList[i][1]; - } - else { - x = pointList[i].x; - y = pointList[i].y; - } - if (curSize < 3) { - // 小于3像素视觉误差 - ctx.rect(x - halfSize, y - halfSize, curSize, curSize); - } - else { - // 大于3像素才考虑图形 - switch (style.iconType) { - case 'circle' : - ctx.moveTo(x, y); - ctx.arc(x, y, halfSize, 0, PI2, true); - break; - case 'diamond' : - ctx.moveTo(x, y - halfSize); - ctx.lineTo(x + halfSize / 3, y - halfSize / 3); - ctx.lineTo(x + halfSize, y); - ctx.lineTo(x + halfSize / 3, y + halfSize / 3); - ctx.lineTo(x, y + halfSize); - ctx.lineTo(x - halfSize / 3, y + halfSize / 3); - ctx.lineTo(x - halfSize, y); - ctx.lineTo(x - halfSize / 3, y - halfSize / 3); - ctx.lineTo(x, y - halfSize); - break; - default : - ctx.rect(x - halfSize, y - halfSize, curSize, curSize); - } - } - } - ctx.closePath(); - if (j < (subSetLength - 1)) { - switch (style.brushType) { - case 'both': - ctx.fill(); - style.lineWidth > 0 && ctx.stroke(); // js hint -_-" - break; - case 'stroke': - style.lineWidth > 0 && ctx.stroke(); - break; - default: - ctx.fill(); - } - } - } - }, - - /* 像素模式 - buildPath : function (ctx, style) { - var pointList = style.pointList; - var rect = this.getRect(style); - var ratio = window.devicePixelRatio || 1; - // console.log(rect) - // var ti = new Date(); - // bbox取整 - rect = { - x : Math.floor(rect.x), - y : Math.floor(rect.y), - width : Math.floor(rect.width), - height : Math.floor(rect.height) - }; - var pixels = ctx.getImageData( - rect.x * ratio, rect.y * ratio, - rect.width * ratio, rect.height * ratio - ); - var data = pixels.data; - var idx; - var zrColor = require('zrender/tool/color'); - var color = zrColor.toArray(style.color); - var r = color[0]; - var g = color[1]; - var b = color[2]; - var width = rect.width; - - for (var i = 1, l = pointList.length; i < l; i++) { - idx = ((Math.floor(pointList[i][0]) - rect.x) * ratio - + (Math.floor(pointList[i][1])- rect.y) * width * ratio * ratio - ) * 4; - data[idx] = r; - data[idx + 1] = g; - data[idx + 2] = b; - data[idx + 3] = 255; - } - ctx.putImageData(pixels, rect.x * ratio, rect.y * ratio); - // console.log(new Date() - ti); - return; - }, - */ - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function (style) { - return style.__rect || polygonInstance.getRect(style); - }, - - isCover : require('./normalIsCover') - }; - - zrUtil.inherits(Symbol, Base); - - return Symbol; -}); - -/** - * echarts通用私有数据服务 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/util/ecData',[],function() { - /** - * 打包私有数据 - * - * @param {shape} shape 修改目标 - * @param {Object} series - * @param {number} seriesIndex - * @param {number | Object} data - * @param {number} dataIndex - * @param {*=} special - * @param {*=} special2 - */ - function pack( - shape, series, seriesIndex, data, dataIndex, name, special, special2 - ) { - var value; - if (typeof data != 'undefined') { - value = data.value == null - ? data - : data.value; - } - - shape._echartsData = { - '_series' : series, - '_seriesIndex' : seriesIndex, - '_data' : data, - '_dataIndex' : dataIndex, - '_name' : name, - '_value' : value, - '_special' : special, - '_special2' : special2 - }; - return shape._echartsData; - } - - /** - * 从私有数据中获取特定项 - * @param {shape} shape - * @param {string} key - */ - function get(shape, key) { - var data = shape._echartsData; - if (!key) { - return data; - } - - switch (key) { - case 'series' : - case 'seriesIndex' : - case 'data' : - case 'dataIndex' : - case 'name' : - case 'value' : - case 'special' : - case 'special2' : - return data && data['_' + key]; - } - - return null; - } - - /** - * 修改私有数据中获取特定项 - * @param {shape} shape - * @param {string} key - * @param {*} value - */ - function set(shape, key, value) { - shape._echartsData = shape._echartsData || {}; - switch (key) { - case 'series' : // 当前系列值 - case 'seriesIndex' : // 系列数组位置索引 - case 'data' : // 当前数据值 - case 'dataIndex' : // 数据数组位置索引 - case 'name' : - case 'value' : - case 'special' : - case 'special2' : - shape._echartsData['_' + key] = value; - break; - } - } - - /** - * 私有数据克隆,把source拷贝到target上 - * @param {shape} source 源 - * @param {shape} target 目标 - */ - function clone(source, target) { - target._echartsData = { - '_series' : source._echartsData._series, - '_seriesIndex' : source._echartsData._seriesIndex, - '_data' : source._echartsData._data, - '_dataIndex' : source._echartsData._dataIndex, - '_name' : source._echartsData._name, - '_value' : source._echartsData._value, - '_special' : source._echartsData._special, - '_special2' : source._echartsData._special2 - }; - } - - return { - pack : pack, - set : set, - get : get, - clone : clone - }; -}); -/** - * echarts图表动画基类 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/util/ecAnimation',['require','zrender/tool/util','zrender/shape/Polygon'],function (require) { - var zrUtil = require('zrender/tool/util'); - - /** - * 折线型动画 - * - * @param {ZRender} zr - * @param {shape} oldShape - * @param {shape} newShape - * @param {number} duration - * @param {tring} easing - */ - function pointList(zr, oldShape, newShape, duration, easing) { - var newPointList = newShape.style.pointList; - var newPointListLen = newPointList.length; - var oldPointList; - - if (!oldShape) { // add - oldPointList = []; - if (newShape._orient != 'vertical') { - var y = newPointList[0][1]; - for (var i = 0; i < newPointListLen; i++) { - oldPointList[i] = [newPointList[i][0], y]; - } - } - else { - var x = newPointList[0][0]; - for (var i = 0; i < newPointListLen; i++) { - oldPointList[i] = [x, newPointList[i][1]]; - } - } - - if (newShape.type == 'half-smooth-polygon') { - oldPointList[newPointListLen - 1] = zrUtil.clone(newPointList[newPointListLen - 1]); - oldPointList[newPointListLen - 2] = zrUtil.clone(newPointList[newPointListLen - 2]); - } - oldShape = {style : {pointList : oldPointList}}; - } - - oldPointList = oldShape.style.pointList; - var oldPointListLen = oldPointList.length; - if (oldPointListLen == newPointListLen) { - newShape.style.pointList = oldPointList; - } - else if (oldPointListLen < newPointListLen) { - // 原来短,新的长,补全 - newShape.style.pointList = oldPointList.concat(newPointList.slice(oldPointListLen)); - } - else { - // 原来长,新的短,截断 - newShape.style.pointList = oldPointList.slice(0, newPointListLen); - } - - zr.addShape(newShape); - zr.animate(newShape.id, 'style') - .when( - duration, - { pointList: newPointList } - ) - .start(easing); - } - - /** - * 复制样式 - * - * @inner - * @param {Object} target 目标对象 - * @param {Object} source 源对象 - * @param {...string} props 复制的属性列表 - */ - function cloneStyle(target, source) { - var len = arguments.length; - for (var i = 2; i < len; i++) { - var prop = arguments[i]; - target.style[prop] = source.style[prop]; - } - } - - /** - * 方型动画 - * - * @param {ZRender} zr - * @param {shape} oldShape - * @param {shape} newShape - * @param {number} duration - * @param {tring} easing - */ - function rectangle(zr, oldShape, newShape, duration, easing) { - var newShapeStyle = newShape.style; - if (!oldShape) { // add - oldShape = { - style : { - x : newShapeStyle.x, - y : newShape._orient == 'vertical' - ? newShapeStyle.y + newShapeStyle.height - : newShapeStyle.y, - width: newShape._orient == 'vertical' - ? newShapeStyle.width : 0, - height: newShape._orient != 'vertical' - ? newShapeStyle.height : 0 - } - }; - } - - var newX = newShapeStyle.x; - var newY = newShapeStyle.y; - var newWidth = newShapeStyle.width; - var newHeight = newShapeStyle.height; - cloneStyle( - newShape, oldShape, - 'x', 'y', 'width', 'height' - ); - - zr.addShape(newShape); - zr.animate(newShape.id, 'style') - .when( - duration, - { - x: newX, - y: newY, - width: newWidth, - height: newHeight - } - ) - .start(easing); - } - - /** - * 蜡烛动画 - * - * @param {ZRender} zr - * @param {shape} oldShape - * @param {shape} newShape - * @param {number} duration - * @param {tring} easing - */ - function candle(zr, oldShape, newShape, duration, easing) { - if (!oldShape) { // add - var y = newShape.style.y; - oldShape = {style : {y : [y[0], y[0], y[0], y[0]]}}; - } - - var newY = newShape.style.y; - newShape.style.y = oldShape.style.y; - zr.addShape(newShape); - zr.animate(newShape.id, 'style') - .when( - duration, - { y: newY } - ) - .start(easing); - } - - /** - * 环型动画 - * - * @param {ZRender} zr - * @param {shape} oldShape - * @param {shape} newShape - * @param {number} duration - * @param {tring} easing - */ - function ring(zr, oldShape, newShape, duration, easing) { - var x = newShape.style.x; - var y = newShape.style.y; - var r0 = newShape.style.r0; - var r = newShape.style.r; - - if (newShape._animationAdd != 'r') { - newShape.style.r0 = 0; - newShape.style.r = 0; - newShape.rotation = [Math.PI*2, x, y]; - - zr.addShape(newShape); - zr.animate(newShape.id, 'style') - .when( - duration, - { - r0 : r0, - r : r - } - ) - .start(easing); - zr.animate(newShape.id, '') - .when( - Math.round(duration / 3 * 2), - { rotation : [0, x, y] } - ) - .start(easing); - } - else { - newShape.style.r0 = newShape.style.r; - - zr.addShape(newShape); - zr.animate(newShape.id, 'style') - .when( - duration, - { - r0 : r0 - } - ) - .start(easing); - } - } - - /** - * 扇形动画 - * - * @param {ZRender} zr - * @param {shape} oldShape - * @param {shape} newShape - * @param {number} duration - * @param {tring} easing - */ - function sector(zr, oldShape, newShape, duration, easing) { - if (!oldShape) { // add - if (newShape._animationAdd != 'r') { - oldShape = { - style : { - startAngle : newShape.style.startAngle, - endAngle : newShape.style.startAngle - } - }; - } - else { - oldShape = {style : {r0 : newShape.style.r}}; - } - } - - var startAngle = newShape.style.startAngle; - var endAngle = newShape.style.endAngle; - - cloneStyle( - newShape, oldShape, - 'startAngle', 'endAngle' - ); - - zr.addShape(newShape); - zr.animate(newShape.id, 'style') - .when( - duration, - { - startAngle : startAngle, - endAngle : endAngle - } - ) - .start(easing); - } - - /** - * 文本动画 - * - * @param {ZRender} zr - * @param {shape} oldShape - * @param {shape} newShape - * @param {number} duration - * @param {tring} easing - */ - function text(zr, oldShape, newShape, duration, easing) { - if (!oldShape) { // add - oldShape = { - style : { - x : newShape.style.textAlign == 'left' - ? newShape.style.x + 100 - : newShape.style.x - 100, - y : newShape.style.y - } - }; - } - - var x = newShape.style.x; - var y = newShape.style.y; - - cloneStyle( - newShape, oldShape, - 'x', 'y' - ); - - zr.addShape(newShape); - zr.animate(newShape.id, 'style') - .when( - duration, - { - x : x, - y : y - } - ) - .start(easing); - } - - /** - * 多边形动画 - * - * @param {ZRender} zr - * @param {shape} oldShape - * @param {shape} newShape - * @param {number} duration - * @param {tring} easing - */ - function polygon(zr, oldShape, newShape, duration, easing) { - var rect = require('zrender/shape/Polygon').prototype.getRect(newShape.style); - var x = rect.x + rect.width / 2; - var y = rect.y + rect.height / 2; - - newShape.scale = [0.1, 0.1, x, y]; - zr.addShape(newShape); - zr.animate(newShape.id, '') - .when( - duration, - { - scale : [1, 1, x, y] - } - ) - .start(easing); - } - - /** - * 和弦动画 - * - * @param {ZRender} zr - * @param {shape} oldShape - * @param {shape} newShape - * @param {number} duration - * @param {tring} easing - */ - function chord(zr, oldShape, newShape, duration, easing) { - if (!oldShape) { // add - oldShape = { - style : { - source0 : 0, - source1 : 360, - target0 : 0, - target1 : 360 - } - }; - } - - var source0 = newShape.style.source0; - var source1 = newShape.style.source1; - var target0 = newShape.style.target0; - var target1 = newShape.style.target1; - - if (oldShape.style) { - cloneStyle( - newShape, oldShape, - 'source0', 'source1', 'target0', 'target1' - ); - } - - zr.addShape(newShape); - zr.animate(newShape.id, 'style') - .when( - duration, - { - source0 : source0, - source1 : source1, - target0 : target0, - target1 : target1 - } - ) - .start(easing); - } - - /** - * gaugePointer动画 - * - * @param {ZRender} zr - * @param {shape} oldShape - * @param {shape} newShape - * @param {number} duration - * @param {tring} easing - */ - function gaugePointer(zr, oldShape, newShape, duration, easing) { - if (!oldShape) { // add - oldShape = { - style : { - angle : newShape.style.startAngle - } - }; - } - - var angle = newShape.style.angle; - newShape.style.angle = oldShape.style.angle; - zr.addShape(newShape); - zr.animate(newShape.id, 'style') - .when( - duration, - { - angle : angle - } - ) - .start(easing); - } - - /** - * icon动画 - * - * @param {ZRender} zr - * @param {shape} oldShape - * @param {shape} newShape - * @param {number} duration - * @param {tring} easing - */ - function icon(zr, oldShape, newShape, duration, easing) { - // 避免markPoint特效取值在动画帧上 - newShape.style._x = newShape.style.x; - newShape.style._y = newShape.style.y; - newShape.style._width = newShape.style.width; - newShape.style._height = newShape.style.height; - - if (!oldShape) { // add - var x = newShape._x || 0; - var y = newShape._y || 0; - newShape.scale = [0, 0, x, y]; - zr.addShape(newShape); - zr.animate(newShape.id, '') - .when( - duration, - {scale : [1, 1, x, y]} - ) - .start(easing || 'QuinticOut'); - } - else { // mod - rectangle(zr, oldShape, newShape, duration, easing); - } - } - - /** - * line动画 - * - * @param {ZRender} zr - * @param {shape} oldShape - * @param {shape} newShape - * @param {number} duration - * @param {tring} easing - */ - function line(zr, oldShape, newShape, duration, easing) { - if (!oldShape) { - oldShape = { - style : { - xEnd : newShape.style.xStart, - yEnd : newShape.style.yStart - } - }; - } - - var xStart = newShape.style.xStart; - var xEnd = newShape.style.xEnd; - var yStart = newShape.style.yStart; - var yEnd = newShape.style.yEnd; - - cloneStyle( - newShape, oldShape, - 'xStart', 'xEnd', 'yStart', 'yEnd' - ); - - zr.addShape(newShape); - zr.animate(newShape.id, 'style') - .when( - duration, - { - xStart: xStart, - xEnd: xEnd, - yStart: yStart, - yEnd: yEnd - } - ) - .start(easing); - } - - /** - * markline动画 - * - * @param {ZRender} zr - * @param {shape} oldShape - * @param {shape} newShape - * @param {number} duration - * @param {tring} easing - */ - function markline(zr, oldShape, newShape, duration, easing) { - if (!newShape.style.smooth) { - newShape.style.pointList = !oldShape - ? [ - [newShape.style.xStart, newShape.style.yStart], - [newShape.style.xStart, newShape.style.yStart] - ] - : oldShape.style.pointList; - zr.addShape(newShape); - zr.animate(newShape.id, 'style') - .when( - duration, - { - pointList : [ - [ - newShape.style.xStart, - newShape.style.yStart - ], - [ - newShape._x || 0, newShape._y || 0 - ] - ] - } - ) - .start(easing || 'QuinticOut'); - } - else { - // 曲线动画 - newShape.style.pointListLength = 1; - zr.addShape(newShape); - newShape.style.pointList = newShape.style.pointList - || newShape.getPointList(newShape.style); - zr.animate(newShape.id, 'style') - .when( - duration, - { - pointListLength : newShape.style.pointList.length - } - ) - .start(easing || 'QuinticOut'); - } - } - - return { - pointList : pointList, - rectangle : rectangle, - candle : candle, - ring : ring, - sector : sector, - text : text, - polygon : polygon, - chord : chord, - gaugePointer : gaugePointer, - icon : icon, - line : line, - markline : markline - }; -}); - -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:圆 - * 可配图形属性: - { - // 基础属性 - shape : 'circle', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,圆心横坐标 - y : {number}, // 必须,圆心纵坐标 - r : {number}, // 必须,圆半径 - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为top,附加文本位置。 - // inside | left | right | top | bottom - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'circle', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - r : 50, - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - 'zrender/shape/Circle',['require','./Base','../tool/util'],function (require) { - var Base = require('./Base'); - - function Circle(options) { - Base.call(this, options); - } - - Circle.prototype = { - type: 'circle', - /** - * 创建圆形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function (ctx, style) { - ctx.arc(style.x, style.y, style.r, 0, Math.PI * 2, true); - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function (style) { - if (style.__rect) { - return style.__rect; - } - - var lineWidth; - if (style.brushType == 'stroke' || style.brushType == 'fill') { - lineWidth = style.lineWidth || 1; - } - else { - lineWidth = 0; - } - style.__rect = { - x : Math.round(style.x - style.r - lineWidth / 2), - y : Math.round(style.y - style.r - lineWidth / 2), - width : style.r * 2 + lineWidth, - height : style.r * 2 + lineWidth - }; - - return style.__rect; - } - }; - - require('../tool/util').inherits(Circle, Base); - return Circle; - } -); -/** - * echarts图表特效基类 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/util/ecEffect',['require','../util/ecData','zrender/shape/Circle','zrender/shape/Image','../util/shape/Icon','../util/shape/Symbol','zrender/tool/env'],function (require) { - var ecData = require('../util/ecData'); - - var CircleShape = require('zrender/shape/Circle'); - var ImageShape = require('zrender/shape/Image'); - var IconShape = require('../util/shape/Icon'); - var SymbolShape = require('../util/shape/Symbol'); - - var canvasSupported = require('zrender/tool/env').canvasSupported; - - function point(zr, effectList, shape, zlevel) { - var effect = shape.effect; - var color = effect.color || shape.style.strokeColor || shape.style.color; - var shadowColor = effect.shadowColor || color; - var size = effect.scaleSize; - var shadowBlur = typeof effect.shadowBlur != 'undefined' - ? effect.shadowBlur : size; - - var effectShape = new IconShape({ - zlevel : zlevel, - style : { - brushType : 'stroke', - iconType : (shape.style.iconType != 'pin' - && shape.style.iconType != 'droplet') - ? shape.style.iconType - : 'circle', - x : shadowBlur + 1, // 线宽 - y : shadowBlur + 1, - n : shape.style.n, - width : shape.style.width * size, - height : shape.style.height * size, - lineWidth : 1, - strokeColor : color, - shadowColor : shadowColor, - shadowBlur : shadowBlur - }, - draggable : false, - hoverable : false - }); - - if (canvasSupported) { // 提高性能,换成image - effectShape.style.image = zr.shapeToImage( - effectShape, - effectShape.style.width + shadowBlur * 2 + 2, - effectShape.style.height + shadowBlur * 2 + 2 - ).style.image; - - effectShape = new ImageShape({ - zlevel : effectShape.zlevel, - style : effectShape.style, - draggable : false, - hoverable : false - }); - } - - ecData.clone(shape, effectShape); - - // 改变坐标,不能移到前面 - effectShape.position = shape.position; - effectList.push(effectShape); - zr.addShape(effectShape); - - var devicePixelRatio = window.devicePixelRatio || 1; - var offset = (effectShape.style.width / devicePixelRatio - shape.style.width) / 2; - effectShape.style.x = shape.style._x - offset; - effectShape.style.y = shape.style._y - offset; - var duration = (effect.period + Math.random() * 10) * 100; - - zr.modShape( - shape.id, - { invisible : true} - ); - - var centerX = effectShape.style.x + (effectShape.style.width) / 2 / devicePixelRatio; - var centerY = effectShape.style.y + (effectShape.style.height) / 2 / devicePixelRatio; - zr.modShape( - effectShape.id, - { - scale : [0.1, 0.1, centerX, centerY] - } - ); - - zr.animate(effectShape.id, '', effect.loop) - .when( - duration, - { - scale : [1, 1, centerX, centerY] - } - ) - .done(function() { - shape.effect.show = false; - zr.delShape(effectShape.id); - }) - .start(); - } - - function largePoint(zr, effectList, shape, zlevel) { - var effect = shape.effect; - var color = effect.color || shape.style.strokeColor || shape.style.color; - var size = effect.scaleSize; - var shadowColor = effect.shadowColor || color; - var shadowBlur = typeof effect.shadowBlur != 'undefined' - ? effect.shadowBlur : (size * 2); - var devicePixelRatio = window.devicePixelRatio || 1; - var effectShape = new SymbolShape({ - zlevel : zlevel, - position : shape.position, - scale : shape.scale, - style : { - pointList : shape.style.pointList, - iconType : shape.style.iconType, - color : color, - strokeColor : color, - shadowColor : shadowColor, - shadowBlur : shadowBlur * devicePixelRatio, - random : true, - brushType: 'fill', - lineWidth:1, - size : shape.style.size - }, - draggable : false, - hoverable : false - }); - - effectList.push(effectShape); - zr.addShape(effectShape); - zr.modShape( - shape.id, - { invisible : true} - ); - - var duration = Math.round(effect.period * 100); - var clip1 = {}; - var clip2 = {}; - for (var i = 0; i < 20; i++) { - effectShape.style['randomMap' + i] = 0; - clip1 = {}; - clip1['randomMap' + i] = 100; - clip2 = {}; - clip2['randomMap' + i] = 0; - effectShape.style['randomMap' + i] = Math.random() * 100; - zr.animate(effectShape.id, 'style', true) - .when(duration, clip1) - .when(duration * 2, clip2) - .when(duration * 3, clip1) - .when(duration * 4, clip1) - .delay(Math.random() * duration * i) - //.delay(duration / 15 * (15 - i + 1)) - .start(); - - } - } - - function line(zr, effectList, shape, zlevel) { - var effect = shape.effect; - var color = effect.color || shape.style.strokeColor || shape.style.color; - var shadowColor = effect.shadowColor || shape.style.strokeColor || color; - var size = shape.style.lineWidth * effect.scaleSize; - var shadowBlur = typeof effect.shadowBlur != 'undefined' - ? effect.shadowBlur : size; - - var effectShape = new CircleShape({ - zlevel : zlevel, - style : { - x : shadowBlur, - y : shadowBlur, - r : size, - color : color, - shadowColor : shadowColor, - shadowBlur : shadowBlur - }, - draggable : false, - hoverable : false - }); - - var offset; - if (canvasSupported) { // 提高性能,换成image - effectShape.style.image = zr.shapeToImage( - effectShape, - (size + shadowBlur) * 2, - (size + shadowBlur) * 2 - ).style.image; - effectShape = new ImageShape({ - zlevel : effectShape.zlevel, - style : effectShape.style, - draggable : false, - hoverable : false - }); - offset = shadowBlur; - } - else { - offset = 0; - } - - ecData.clone(shape, effectShape); - - // 改变坐标, 不能移到前面 - effectShape.position = shape.position; - effectList.push(effectShape); - zr.addShape(effectShape); - - effectShape.style.x = shape.style.xStart - offset; - effectShape.style.y = shape.style.yStart - offset; - var distance = (shape.style.xStart - shape.style.xEnd) - * (shape.style.xStart - shape.style.xEnd) - + - (shape.style.yStart - shape.style.yEnd) - * (shape.style.yStart - shape.style.yEnd); - var duration = Math.round(Math.sqrt(Math.round( - distance * effect.period * effect.period - ))); - if (!shape.style.smooth) { - // 直线 - zr.animate(effectShape.id, 'style', effect.loop) - .when( - duration, - { - x : shape._x - offset, - y : shape._y - offset - } - ) - .done(function() { - shape.effect.show = false; - zr.delShape(effectShape.id); - }) - .start(); - } - else { - // 曲线 - var pointList = shape.style.pointList || shape.getPointList(shape.style); - var len = pointList.length; - duration = Math.round(duration / len); - var deferred = zr.animate(effectShape.id, 'style', effect.loop); - var step = Math.ceil(len / 8); - for (var j = 0; j < len - step; j+= step) { - deferred.when( - duration * (j + 1), - { - x : pointList[j][0] - offset, - y : pointList[j][1] - offset - } - ); - } - deferred.when( - duration * len, - { - x : pointList[len - 1][0] - offset, - y : pointList[len - 1][1] - offset - } - ); - deferred.done(function() { - shape.effect.show = false; - zr.delShape(effectShape.id); - }); - deferred.start('spline'); - } - } - - return { - point : point, - largePoint : largePoint, - line : line - }; -}); - -/** - * 高精度数学运算 - */ -define('echarts/util/accMath',[],function() { - // 除法函数,用来得到精确的除法结果 - // 说明:javascript的除法结果会有误差,在两个浮点数相除的时候会比较明显。这个函数返回较为精确的除法结果。 - // 调用:accDiv(arg1,arg2) - // 返回值:arg1除以arg2的精确结果 - function accDiv(arg1, arg2) { - return accMul(arg1, 1 / arg2); - } - - // 乘法函数,用来得到精确的乘法结果 - // 说明:javascript的乘法结果会有误差,在两个浮点数相乘的时候会比较明显。这个函数返回较为精确的乘法结果。 - // 调用:accMul(arg1,arg2) - // 返回值:arg1乘以arg2的精确结果 - function accMul(arg1, arg2) { - var m = 0; - var s1 = arg1.toString(); - var s2 = arg2.toString(); - try { - m += s1.split('.')[1].length; - } - catch(e) {} - - try { - m += s2.split('.')[1].length; - } - catch(e){} - - return (s1.replace('.', '') - 0) * (s2.replace('.', '') - 0) / Math.pow(10, m); - } - - // 加法函数,用来得到精确的加法结果 - // 说明:javascript的加法结果会有误差,在两个浮点数相加的时候会比较明显。这个函数返回较为精确的加法结果。 - // 调用:accAdd(arg1,arg2) - // 返回值:arg1加上arg2的精确结果 - function accAdd(arg1, arg2) { - var r1 = 0; - var r2 = 0; - - try { - r1 = arg1.toString().split('.')[1].length; - } - catch(e) {} - - try { - r2 = arg2.toString().split('.')[1].length; - } - catch(e) {} - - var m = Math.pow(10, Math.max(r1, r2)); - return (Math.round(arg1 * m) + Math.round(arg2 * m)) / m; - } - - //减法函数,用来得到精确的减法结果 - //说明:javascript的减法结果会有误差,在两个浮点数减法的时候会比较明显。这个函数返回较为精确的减法结果。 - //调用:accSub(arg1,arg2) - //返回值:arg1减法arg2的精确结果 - function accSub(arg1,arg2) { - return accAdd(arg1, -arg2); - } - - return { - accDiv : accDiv, - accMul : accMul, - accAdd : accAdd, - accSub : accSub - }; -}); -/** - * echarts图表基类 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon','../util/shape/MarkLine','../util/shape/Symbol','../config','../util/ecData','../util/ecAnimation','../util/ecEffect','../util/accMath','zrender/tool/util','zrender/tool/area'],function (require) { - // 图形依赖 - var ImageShape = require('zrender/shape/Image'); - var IconShape = require('../util/shape/Icon'); - var MarkLineShape = require('../util/shape/MarkLine'); - var SymbolShape = require('../util/shape/Symbol'); - - var ecConfig = require('../config'); - var ecData = require('../util/ecData'); - var ecAnimation = require('../util/ecAnimation'); - var ecEffect = require('../util/ecEffect'); - var accMath = require('../util/accMath'); - var zrUtil = require('zrender/tool/util'); - var zrArea = require('zrender/tool/area'); - - function Base(){ - var self = this; - this.selectedMap = {}; - this.lastShapeList = []; - this.shapeHandler = { - onclick : function () { - self.isClick = true; - }, - - ondragover : function (param) { - // 返回触发可计算特性的图形提示 - var calculableShape = param.target; - calculableShape.highlightStyle = calculableShape.highlightStyle || {}; - - // 备份特出特性 - var highlightStyle = calculableShape.highlightStyle; - var brushType = highlightStyle.brushTyep; - var strokeColor = highlightStyle.strokeColor; - var lineWidth = highlightStyle.lineWidth; - - highlightStyle.brushType = 'stroke'; - highlightStyle.strokeColor = self.ecTheme.calculableColor; - highlightStyle.lineWidth = calculableShape.type == 'icon' ? 30 : 10; - - self.zr.addHoverShape(calculableShape); - - setTimeout(function (){ - // 复位 - if (calculableShape.highlightStyle) { - calculableShape.highlightStyle.brushType = brushType; - calculableShape.highlightStyle.strokeColor = strokeColor; - calculableShape.highlightStyle.lineWidth = lineWidth; - } - },20); - }, - - ondrop : function (param) { - // 排除一些非数据的拖拽进入 - if (typeof ecData.get(param.dragged, 'data') != 'undefined') { - self.isDrop = true; - } - }, - - ondragend : function () { - self.isDragend = true; - } - }; - } - - /** - * 基类方法 - */ - Base.prototype = { - /** - * 图形拖拽特性 - */ - setCalculable : function (shape) { - shape.dragEnableTime = this.ecTheme.DRAG_ENABLE_TIME; - shape.ondragover = this.shapeHandler.ondragover; - shape.ondragend = this.shapeHandler.ondragend; - shape.ondrop = this.shapeHandler.ondrop; - return shape; - }, - - /** - * 数据项被拖拽进来 - */ - ondrop : function (param, status) { - if (!this.isDrop || !param.target) { - // 没有在当前实例上发生拖拽行为则直接返回 - return; - } - var target = param.target; // 拖拽安放目标 - var dragged = param.dragged; // 当前被拖拽的图形对象 - - var seriesIndex = ecData.get(target, 'seriesIndex'); - var dataIndex = ecData.get(target, 'dataIndex'); - - var series = this.series; - var data; - var legend = this.component.legend; - if (dataIndex == -1) { - // 落到calculableCase上,数据被拖拽进某个饼图|雷达|漏斗,增加数据 - data = { - value : ecData.get(dragged, 'value'), - name : ecData.get(dragged, 'name') - }; - - // 修饼图数值不为负值 - if (this.type == ecConfig.CHART_TYPE_PIE && data.value < 0) { - data.value = 0; - } - - var hasFind = false; - var sData = series[seriesIndex].data; - for (var i = 0, l = sData.length; i < l; i++) { - if (sData[i].name == data.name && sData[i].value == '-') { - series[seriesIndex].data[i].value = data.value; - hasFind = true; - } - } - !hasFind && series[seriesIndex].data.push(data); - - legend && legend.add( - data.name, - dragged.style.color || dragged.style.strokeColor - ); - } - else { - // 落到数据item上,数据被拖拽到某个数据项上,数据修改 - data = this.option.series[seriesIndex].data[dataIndex] || '-'; - if (typeof data.value != 'undefined') { - if (data.value != '-') { - this.option.series[seriesIndex].data[dataIndex].value = - accMath.accAdd( - this.option.series[seriesIndex].data[dataIndex].value, - ecData.get(dragged, 'value') - ); - } - else { - this.option.series[seriesIndex].data[dataIndex].value = - ecData.get(dragged, 'value'); - } - - if (this.type == ecConfig.CHART_TYPE_FUNNEL - || this.type == ecConfig.CHART_TYPE_PIE - ) { - legend && legend.getRelatedAmount(data.name) == 1 - && this.component.legend.del(data.name); - data.name += this.option.nameConnector + ecData.get(dragged, 'name'); - legend && legend.add( - data.name, - dragged.style.color || dragged.style.strokeColor - ); - } - } - else { - if (data != '-') { - this.option.series[seriesIndex].data[dataIndex] = - accMath.accAdd( - this.option.series[seriesIndex].data[dataIndex], - ecData.get(dragged, 'value') - ); - } - else { - this.option.series[seriesIndex].data[dataIndex] = - ecData.get(dragged, 'value'); - } - } - } - - // 别status = {}赋值啊!! - status.dragIn = status.dragIn || true; - - // 处理完拖拽事件后复位 - this.isDrop = false; - - var self = this; - setTimeout(function(){ - self.zr.trigger('mousemove', param.event); - }, 300); - - return; - }, - - /** - * 数据项被拖拽出去 - */ - ondragend : function (param, status) { - if (!this.isDragend || !param.target) { - // 没有在当前实例上发生拖拽行为则直接返回 - return; - } - var target = param.target; // 被拖拽图形元素 - - var seriesIndex = ecData.get(target, 'seriesIndex'); - var dataIndex = ecData.get(target, 'dataIndex'); - - var series = this.series; - - // 删除被拖拽走的数据 - if (typeof series[seriesIndex].data[dataIndex].value != 'undefined') { - series[seriesIndex].data[dataIndex].value = '-'; - // 清理可能有且唯一的legend data - var name = series[seriesIndex].data[dataIndex].name; - if (this.component.legend - && this.component.legend.getRelatedAmount(name) === 0 - ) { - this.component.legend.del(name); - } - } - else { - series[seriesIndex].data[dataIndex] = '-'; - } - - // 别status = {}赋值啊!! - status.dragOut = true; - status.needRefresh = true; - - // 处理完拖拽事件后复位 - this.isDragend = false; - - return; - }, - - /** - * 图例选择 - */ - onlegendSelected : function (param, status) { - var legendSelected = param.selected; - for (var itemName in this.selectedMap) { - if (this.selectedMap[itemName] != legendSelected[itemName]) { - // 有一项不一致都需要重绘 - status.needRefresh = true; - } - this.selectedMap[itemName] = legendSelected[itemName]; - } - return; - }, - - /** - * 添加文本 - */ - addLabel : function (tarShape, serie, data, name, orient) { - // 多级控制 - var queryTarget = [data, serie]; - var nLabel = this.deepMerge(queryTarget, 'itemStyle.normal.label'); - var eLabel = this.deepMerge(queryTarget, 'itemStyle.emphasis.label'); - - var nTextStyle = nLabel.textStyle || {}; - var eTextStyle = eLabel.textStyle || {}; - - if (nLabel.show) { - tarShape.style.text = this._getLabelText( - serie, data, name, 'normal' - ); - tarShape.style.textPosition = typeof nLabel.position == 'undefined' - ? (orient == 'horizontal' ? 'right' : 'top') - : nLabel.position; - tarShape.style.textColor = nTextStyle.color; - tarShape.style.textFont = this.getFont(nTextStyle); - } - if (eLabel.show) { - tarShape.highlightStyle.text = this._getLabelText( - serie, data, name, 'emphasis' - ); - tarShape.highlightStyle.textPosition = nLabel.show - ? tarShape.style.textPosition - : (typeof eLabel.position == 'undefined' - ? (orient == 'horizontal' ? 'right' : 'top') - : eLabel.position); - tarShape.highlightStyle.textColor = eTextStyle.color; - tarShape.highlightStyle.textFont = this.getFont(eTextStyle); - } - - return tarShape; - }, - - /** - * 根据lable.format计算label text - */ - _getLabelText : function (serie, data, name, status) { - var formatter = this.deepQuery( - [data, serie], - 'itemStyle.' + status + '.label.formatter' - ); - if (!formatter && status == 'emphasis') { - // emphasis时需要看看normal下是否有formatter - formatter = this.deepQuery( - [data, serie], - 'itemStyle.normal.label.formatter' - ); - } - - var value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; - - if (formatter) { - if (typeof formatter == 'function') { - return formatter.call( - this.myChart, - serie.name, - name, - value - ); - } - else if (typeof formatter == 'string') { - formatter = formatter.replace('{a}','{a0}') - .replace('{b}','{b0}') - .replace('{c}','{c0}'); - formatter = formatter.replace('{a0}', serie.name) - .replace('{b0}', name) - .replace('{c0}', value); - - return formatter; - } - } - else { - return value; - } - }, - - /** - * 标线标注 - */ - buildMark : function (seriesIndex) { - var serie = this.series[seriesIndex]; - if (this.selectedMap[serie.name]) { - serie.markPoint && this._buildMarkPoint(seriesIndex); - serie.markLine && this._buildMarkLine(seriesIndex); - } - }, - - /** - * 标注逻辑 - */ - _buildMarkPoint : function (seriesIndex) { - var attachStyle = (this.markAttachStyle || {})[seriesIndex]; - var serie = this.series[seriesIndex]; - var _zlevelBase = this.getZlevelBase(); - var mpData; - var pos; - var markPoint = zrUtil.clone(serie.markPoint); - for (var i = 0, l = markPoint.data.length; i < l; i++) { - mpData = markPoint.data[i]; - pos = this.getMarkCoord(seriesIndex, mpData); - markPoint.data[i].x = typeof mpData.x != 'undefined' - ? mpData.x : pos[0]; - markPoint.data[i].y = typeof mpData.y != 'undefined' - ? mpData.y : pos[1]; - if (mpData.type - && (mpData.type == 'max' || mpData.type == 'min') - ) { - // 特殊值内置支持 - markPoint.data[i].value = pos[3]; - markPoint.data[i].name = mpData.name || mpData.type; - markPoint.data[i].symbolSize = markPoint.data[i].symbolSize - || (zrArea.getTextWidth(pos[3], this.getFont()) / 2 + 5); - } - } - - var shapeList = this._markPoint(seriesIndex, markPoint); - - for (var i = 0, l = shapeList.length; i < l; i++) { - shapeList[i].zlevel = _zlevelBase + 1; - for (var key in attachStyle) { - shapeList[i][key] = zrUtil.clone(attachStyle[key]); - } - this.shapeList.push(shapeList[i]); - } - // 个别特殊图表需要自己addShape - if (this.type == ecConfig.CHART_TYPE_FORCE - || this.type == ecConfig.CHART_TYPE_CHORD - ) { - for (var i = 0, l = shapeList.length; i < l; i++) { - this.zr.addShape(shapeList[i]); - } - } - }, - - /** - * 标线逻辑 - */ - _buildMarkLine : function (seriesIndex) { - var attachStyle = (this.markAttachStyle || {})[seriesIndex]; - var serie = this.series[seriesIndex]; - var _zlevelBase = this.getZlevelBase(); - var mlData; - var pos; - var markLine = zrUtil.clone(serie.markLine); - for (var i = 0, l = markLine.data.length; i < l; i++) { - mlData = markLine.data[i]; - if (mlData.type - && (mlData.type == 'max' || mlData.type == 'min' || mlData.type == 'average') - ) { - // 特殊值内置支持 - pos = this.getMarkCoord(seriesIndex, mlData); - markLine.data[i] = [zrUtil.clone(mlData), {}]; - markLine.data[i][0].name = mlData.name || mlData.type; - markLine.data[i][0].value = pos[3]; - pos = pos[2]; - mlData = [{},{}]; - } - else { - pos = [ - this.getMarkCoord(seriesIndex, mlData[0]), - this.getMarkCoord(seriesIndex, mlData[1]) - ]; - } - - markLine.data[i][0].x = typeof mlData[0].x != 'undefined' - ? mlData[0].x : pos[0][0]; - markLine.data[i][0].y = typeof mlData[0].y != 'undefined' - ? mlData[0].y : pos[0][1]; - markLine.data[i][1].x = typeof mlData[1].x != 'undefined' - ? mlData[1].x : pos[1][0]; - markLine.data[i][1].y = typeof mlData[1].y != 'undefined' - ? mlData[1].y : pos[1][1]; - } - - var shapeList = this._markLine(seriesIndex, markLine); - - for (var i = 0, l = shapeList.length; i < l; i++) { - shapeList[i].zlevel = _zlevelBase + 1; - for (var key in attachStyle) { - shapeList[i][key] = zrUtil.clone(attachStyle[key]); - } - this.shapeList.push(shapeList[i]); - } - // 个别特殊图表需要自己addShape - if (this.type == ecConfig.CHART_TYPE_FORCE - || this.type == ecConfig.CHART_TYPE_CHORD - ) { - for (var i = 0, l = shapeList.length; i < l; i++) { - this.zr.addShape(shapeList[i]); - } - } - }, - - /** - * 标注多级控制构造 - */ - _markPoint : function (seriesIndex, mpOption) { - var serie = this.series[seriesIndex]; - var component = this.component; - zrUtil.merge( - mpOption, - this.ecTheme.markPoint - ); - mpOption.name = serie.name; - - var pList = []; - var data = mpOption.data; - var itemShape; - - var dataRange = component.dataRange; - var legend = component.legend; - var color; - var value; - var queryTarget; - var nColor; - var eColor; - var effect; - var zrWidth = this.zr.getWidth(); - var zrHeight = this.zr.getHeight(); - - if (!mpOption.large) { - for (var i = 0, l = data.length; i < l; i++) { - value = typeof data[i] != 'undefined' && typeof data[i].value != 'undefined' - ? data[i].value - : ''; - // 图例 - if (legend) { - color = legend.getColor(serie.name); - } - // 值域 - if (dataRange) { - color = isNaN(value) ? color : dataRange.getColor(value); - - queryTarget = [data[i], mpOption]; - nColor = this.deepQuery( - queryTarget, 'itemStyle.normal.color' - ) || color; - eColor = this.deepQuery( - queryTarget, 'itemStyle.emphasis.color' - ) || nColor; - // 有值域,并且值域返回null且用户没有自己定义颜色,则隐藏这个mark - if (nColor == null && eColor == null) { - continue; - } - } - - // 标准化一些参数 - data[i].tooltip = data[i].tooltip - || {trigger:'item'}; // tooltip.trigger指定为item - data[i].name = typeof data[i].name != 'undefined' - ? data[i].name : ''; - data[i].value = value; - - // 复用getSymbolShape - itemShape = this.getSymbolShape( - mpOption, seriesIndex, // 系列 - data[i], i, data[i].name, // 数据 - this.parsePercent(data[i].x, zrWidth), // 坐标 - this.parsePercent(data[i].y, zrHeight), // 坐标 - 'pin', color, // 默认symbol和color - 'rgba(0,0,0,0)', - 'horizontal' // 走向,用于默认文字定位 - ); - itemShape._mark = 'point'; - - effect = this.deepMerge( - [data[i], mpOption], - 'effect' - ); - if (effect.show) { - itemShape.effect = effect; - } - - if (serie.type == ecConfig.CHART_TYPE_MAP) { - itemShape._geo = this.getMarkGeo(data[i]); - } - - // 重新pack一下数据 - ecData.pack( - itemShape, - serie, seriesIndex, - data[i], i, - data[i].name, - value - ); - pList.push(itemShape); - } - } - else { - // 大规模MarkPoint - itemShape = this.getLargeMarkPoingShape(seriesIndex, mpOption); - itemShape._mark = 'largePoint'; - itemShape && pList.push(itemShape); - } - return pList; - }, - - /** - * 标线多级控制构造 - */ - _markLine : function (seriesIndex, mlOption) { - var serie = this.series[seriesIndex]; - var component = this.component; - zrUtil.merge( - mlOption, - this.ecTheme.markLine - ); - // 标准化一些同时支持Array和String的参数 - mlOption.symbol = mlOption.symbol instanceof Array - ? mlOption.symbol.length > 1 - ? mlOption.symbol - : [mlOption.symbol[0], mlOption.symbol[0]] - : [mlOption.symbol, mlOption.symbol]; - mlOption.symbolSize = mlOption.symbolSize instanceof Array - ? mlOption.symbolSize.length > 1 - ? mlOption.symbolSize - : [mlOption.symbolSize[0], mlOption.symbolSize[0]] - : [mlOption.symbolSize, mlOption.symbolSize]; - mlOption.symbolRotate = mlOption.symbolRotate instanceof Array - ? mlOption.symbolRotate.length > 1 - ? mlOption.symbolRotate - : [mlOption.symbolRotate[0], mlOption.symbolRotate[0]] - : [mlOption.symbolRotate, mlOption.symbolRotate]; - - mlOption.name = serie.name; - - var pList = []; - var data = mlOption.data; - var itemShape; - - var dataRange = component.dataRange; - var legend = component.legend; - var color; - var value; - var queryTarget; - var nColor; - var eColor; - var effect; - var zrWidth = this.zr.getWidth(); - var zrHeight = this.zr.getHeight(); - var mergeData; - for (var i = 0, l = data.length; i < l; i++) { - // 图例 - if (legend) { - color = legend.getColor(serie.name); - } - // 组装一个mergeData - mergeData = this.deepMerge(data[i]); - value = typeof mergeData != 'undefined' && typeof mergeData.value != 'undefined' - ? mergeData.value - : ''; - // 值域 - if (dataRange) { - color = isNaN(value) ? color : dataRange.getColor(value); - - queryTarget = [mergeData, mlOption]; - nColor = this.deepQuery( - queryTarget, 'itemStyle.normal.color' - ) || color; - eColor = this.deepQuery( - queryTarget, 'itemStyle.emphasis.color' - ) || nColor; - // 有值域,并且值域返回null且用户没有自己定义颜色,则隐藏这个mark - if (nColor == null && eColor == null) { - continue; - } - } - - // 标准化一些参数 - data[i][0].tooltip = mergeData.tooltip - || {trigger:'item'}; // tooltip.trigger指定为item - data[i][0].name = typeof data[i][0].name != 'undefined' - ? data[i][0].name : ''; - data[i][1].name = typeof data[i][1].name != 'undefined' - ? data[i][1].name : ''; - data[i][0].value = typeof data[i][0].value != 'undefined' - ? data[i][0].value : ''; - - itemShape = this.getLineMarkShape( - mlOption, // markLine - seriesIndex, - data[i], // 数据 - i, - this.parsePercent(data[i][0].x, zrWidth), // 坐标 - this.parsePercent(data[i][0].y, zrHeight), // 坐标 - this.parsePercent(data[i][1].x, zrWidth), // 坐标 - this.parsePercent(data[i][1].y, zrHeight), // 坐标 - color // 默认symbol和color - ); - itemShape._mark = 'line'; - - effect = this.deepMerge( - [mergeData, mlOption], - 'effect' - ); - if (effect.show) { - itemShape.effect = effect; - } - - if (serie.type == ecConfig.CHART_TYPE_MAP) { - itemShape._geo = [ - this.getMarkGeo(data[i][0]), - this.getMarkGeo(data[i][1]) - ]; - } - - // 重新pack一下数据 - ecData.pack( - itemShape, - serie, seriesIndex, - data[i][0], i, - data[i][0].name + (data[i][1].name !== '' - ? (' > ' + data[i][1].name) - : ''), - value - ); - pList.push(itemShape); - } - //console.log(pList); - return pList; - }, - - getMarkCoord : function () { - // 无转换位置 - return [0, 0]; - }, - - /** - * symbol构造器 - */ - getSymbolShape : function ( - serie, seriesIndex, // 系列 - data, dataIndex, name, // 数据 - x, y, // 坐标 - symbol, color, // 默认symbol和color,来自legend或dataRange全局分配 - emptyColor, // 折线的emptySymbol用白色填充 - orient // 走向,用于默认文字定位 - ) { - var queryTarget = [data, serie]; - var value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; - - symbol = this.deepQuery(queryTarget, 'symbol') || symbol; - var symbolSize = this.deepQuery(queryTarget, 'symbolSize'); - symbolSize = typeof symbolSize == 'function' - ? symbolSize(value) - : symbolSize; - var symbolRotate = this.deepQuery(queryTarget, 'symbolRotate'); - - var normal = this.deepMerge( - queryTarget, - 'itemStyle.normal' - ); - var emphasis = this.deepMerge( - queryTarget, - 'itemStyle.emphasis' - ); - var nBorderWidth = typeof normal.borderWidth != 'undefined' - ? normal.borderWidth - : (normal.lineStyle && normal.lineStyle.width); - if (typeof nBorderWidth == 'undefined') { - nBorderWidth = symbol.match('empty') ? 2 : 0; - } - var eBorderWidth = typeof emphasis.borderWidth != 'undefined' - ? emphasis.borderWidth - : (emphasis.lineStyle && emphasis.lineStyle.width); - if (typeof eBorderWidth == 'undefined') { - eBorderWidth = nBorderWidth + 2; - } - - var itemShape = new IconShape({ - style : { - iconType : symbol.replace('empty', '').toLowerCase(), - x : x - symbolSize, - y : y - symbolSize, - width : symbolSize * 2, - height : symbolSize * 2, - brushType : 'both', - color : symbol.match('empty') - ? emptyColor - : (this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) - || color), - strokeColor : normal.borderColor - || this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) - || color, - lineWidth: nBorderWidth - }, - highlightStyle : { - color : symbol.match('empty') - ? emptyColor - : this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data), - strokeColor : emphasis.borderColor - || normal.borderColor - || this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) - || color, - lineWidth: eBorderWidth - }, - clickable : true - }); - - if (symbol.match('image')) { - itemShape.style.image = - symbol.replace(new RegExp('^image:\\/\\/'), ''); - itemShape = new ImageShape({ - style : itemShape.style, - highlightStyle : itemShape.highlightStyle, - clickable : true - }); - } - - if (typeof symbolRotate != 'undefined') { - itemShape.rotation = [ - symbolRotate * Math.PI / 180, x, y - ]; - } - - if (symbol.match('star')) { - itemShape.style.iconType = 'star'; - itemShape.style.n = - (symbol.replace('empty', '').replace('star','') - 0) || 5; - } - - if (symbol == 'none') { - itemShape.invisible = true; - itemShape.hoverable = false; - } - - /* - if (this.deepQuery([data, serie, option], 'calculable')) { - this.setCalculable(itemShape); - itemShape.draggable = true; - } - */ - - itemShape = this.addLabel( - itemShape, - serie, data, name, - orient - ); - - if (symbol.match('empty')) { - if (typeof itemShape.style.textColor == 'undefined') { - itemShape.style.textColor = itemShape.style.strokeColor; - } - if (typeof itemShape.highlightStyle.textColor == 'undefined') { - itemShape.highlightStyle.textColor = - itemShape.highlightStyle.strokeColor; - } - } - - ecData.pack( - itemShape, - serie, seriesIndex, - data, dataIndex, - name - ); - - itemShape._x = x; - itemShape._y = y; - - itemShape._dataIndex = dataIndex; - itemShape._seriesIndex = seriesIndex; - - return itemShape; - }, - - /** - * 标线构造器 - */ - getLineMarkShape : function ( - mlOption, // 系列 - seriesIndex, // 系列索引 - data, // 数据 - dataIndex, // 数据索引 - xStart, yStart, // 坐标 - xEnd, yEnd, // 坐标 - color // 默认color,来自legend或dataRange全局分配 - ) { - var value0 = typeof data[0] != 'undefined' - ? (typeof data[0].value != 'undefined' - ? data[0].value - : data[0]) - : '-'; - var value1 = typeof data[1] != 'undefined' - ? (typeof data[1].value != 'undefined' - ? data[1].value - : data[1]) - : '-'; - var symbol = [ - this.query(data[0], 'symbol') || mlOption.symbol[0], - this.query(data[1], 'symbol') || mlOption.symbol[1] - ]; - var symbolSize = [ - this.query(data[0], 'symbolSize') || mlOption.symbolSize[0], - this.query(data[1], 'symbolSize') || mlOption.symbolSize[1] - ]; - symbolSize[0] = typeof symbolSize[0] == 'function' - ? symbolSize[0](value0) - : symbolSize[0]; - symbolSize[1] = typeof symbolSize[1] == 'function' - ? symbolSize[1](value1) - : symbolSize[1]; - var symbolRotate = [ - this.query(data[0], 'symbolRotate') || mlOption.symbolRotate[0], - this.query(data[1], 'symbolRotate') || mlOption.symbolRotate[1] - ]; - //console.log(symbol, symbolSize, symbolRotate); - - var queryTarget = [data[0], mlOption]; - var normal = this.deepMerge( - queryTarget, - 'itemStyle.normal' - ); - normal.color = this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data); - var emphasis = this.deepMerge( - queryTarget, - 'itemStyle.emphasis' - ); - emphasis.color = this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data); - - var nlineStyle = normal.lineStyle; - var elineStyle = emphasis.lineStyle; - - var nBorderWidth = nlineStyle.width; - if (typeof nBorderWidth == 'undefined') { - nBorderWidth = normal.borderWidth; - } - var eBorderWidth = elineStyle.width; - if (typeof eBorderWidth == 'undefined') { - if (typeof emphasis.borderWidth != 'undefined') { - eBorderWidth = emphasis.borderWidth; - } - else { - eBorderWidth = nBorderWidth + 2; - } - } - - var itemShape = new MarkLineShape({ - style : { - smooth : mlOption.smooth ? 'spline' : false, - symbol : symbol, - symbolSize : symbolSize, - symbolRotate : symbolRotate, - //data : [data[0].name,data[1].name], - xStart : xStart, - yStart : yStart, // 坐标 - xEnd : xEnd, - yEnd : yEnd, // 坐标 - brushType : 'both', - lineType : nlineStyle.type, - shadowColor : nlineStyle.shadowColor - || nlineStyle.color - || normal.borderColor - || normal.color - || color, - shadowBlur: nlineStyle.shadowBlur, - shadowOffsetX: nlineStyle.shadowOffsetX, - shadowOffsetY: nlineStyle.shadowOffsetY, - color : normal.color || color, - strokeColor : nlineStyle.color - || normal.borderColor - || normal.color - || color, - lineWidth: nBorderWidth, - symbolBorderColor: normal.borderColor - || normal.color - || color, - symbolBorder: normal.borderWidth - }, - highlightStyle : { - shadowColor : elineStyle.shadowColor, - shadowBlur: elineStyle.shadowBlur, - shadowOffsetX: elineStyle.shadowOffsetX, - shadowOffsetY: elineStyle.shadowOffsetY, - color : emphasis.color|| normal.color || color, - strokeColor : elineStyle.color - || nlineStyle.color - || emphasis.borderColor - || normal.borderColor - || emphasis.color - || normal.color - || color, - lineWidth: eBorderWidth, - symbolBorderColor: emphasis.borderColor - || normal.borderColor - || emphasis.color - || normal.color - || color, - symbolBorder: typeof emphasis.borderWidth == 'undefined' - ? (normal.borderWidth + 2) - : (emphasis.borderWidth) - }, - clickable : true - }); - - itemShape = this.addLabel( - itemShape, - mlOption, - data[0], - data[0].name + ' : ' + data[1].name - ); - - itemShape._x = xEnd; - itemShape._y = yEnd; - - return itemShape; - }, - - /** - * 大规模标注构造器 - */ - getLargeMarkPoingShape : function(seriesIndex, mpOption) { - var serie = this.series[seriesIndex]; - var component = this.component; - var data = mpOption.data; - var itemShape; - - var dataRange = component.dataRange; - var legend = component.legend; - var color; - var value; - var queryTarget = [data[0], mpOption]; - var nColor; - var eColor; - var effect; - - // 图例 - if (legend) { - color = legend.getColor(serie.name); - } - // 值域 - if (dataRange) { - value = typeof data[0] != 'undefined' - ? (typeof data[0].value != 'undefined' - ? data[0].value - : data[0]) - : '-'; - color = isNaN(value) ? color : dataRange.getColor(value); - - nColor = this.deepQuery( - queryTarget, 'itemStyle.normal.color' - ) || color; - eColor = this.deepQuery( - queryTarget, 'itemStyle.emphasis.color' - ) || nColor; - // 有值域,并且值域返回null且用户没有自己定义颜色,则隐藏这个mark - if (nColor == null && eColor == null) { - return; - } - } - color = this.deepMerge(queryTarget, 'itemStyle.normal').color - || color; - - var symbol = this.deepQuery(queryTarget, 'symbol') || 'circle'; - symbol = symbol.replace('empty', '').replace(/\d/g, ''); - - effect = this.deepMerge( - [data[0], mpOption], - 'effect' - ); - - var devicePixelRatio = window.devicePixelRatio || 1; - - //console.log(data) - itemShape = new SymbolShape({ - style : { - pointList : data, - color : color, - strokeColor: color, - shadowColor : effect.shadowColor || color, - shadowBlur : (typeof effect.shadowBlur != 'undefined' ? effect.shadowBlur : 8) - * devicePixelRatio, - size : this.deepQuery(queryTarget, 'symbolSize'), - iconType : symbol, - brushType: 'fill', - lineWidth:1 - }, - draggable : false, - hoverable : false - }); - - if (effect.show) { - itemShape.effect = effect; - } - - return itemShape; - }, - - backupShapeList : function () { - if (this.shapeList && this.shapeList.length > 0) { - this.lastShapeList = this.shapeList; - this.shapeList = []; - } - else { - this.lastShapeList = []; - } - }, - - addShapeList : function () { - var maxLenth = this.option.animationThreshold / (this.canvasSupported ? 2 : 4); - var lastShapeList = this.lastShapeList; - var shapeList = this.shapeList; - var duration = lastShapeList.length > 0 - ? 500 : this.query(this.option, 'animationDuration'); - var easing = this.query(this.option, 'animationEasing'); - var key; - var oldMap = {}; - var newMap = {}; - if (this.option.animation - && !this.option.renderAsImage - && shapeList.length < maxLenth - && !this.motionlessOnce - ) { - // 通过已有的shape做动画过渡 - for (var i = 0, l = lastShapeList.length; i < l; i++) { - key = this._getAnimationKey(lastShapeList[i]); - if (key.match('undefined')) { - this.zr.delShape(lastShapeList[i].id); // 非关键元素直接删除 - } - else { - key += lastShapeList[i].type; - oldMap[key] = lastShapeList[i]; - } - } - for (var i = 0, l = shapeList.length; i < l; i++) { - key = this._getAnimationKey(shapeList[i]); - if (key.match('undefined')) { - this.zr.addShape(shapeList[i]); // 非关键元素直接添加 - } - else { - key += shapeList[i].type; - newMap[key] = shapeList[i]; - } - } - - for (key in oldMap) { - if (!newMap[key]) { - // 新的没有 删除 - this.zr.delShape(oldMap[key].id); - } - } - for (key in newMap) { - if (oldMap[key]) { - // 新旧都有 动画过渡 - this.zr.delShape(oldMap[key].id); - this._animateMod(oldMap[key], newMap[key], duration, easing); - } - else { - // 新有旧没有 添加并动画过渡 - //this._animateAdd(newMap[key], duration, easing); - this._animateMod(false, newMap[key], duration, easing); - } - } - this.zr.refresh(); - this.animationEffect(); - } - else { - this.motionlessOnce = false; - // clear old - this.zr.delShape(lastShapeList); - // 直接添加 - for (var i = 0, l = shapeList.length; i < l; i++) { - this.zr.addShape(shapeList[i]); - } - } - }, - - _getAnimationKey : function(shape) { - if (this.type != ecConfig.CHART_TYPE_MAP) { - return ecData.get(shape, 'seriesIndex') + '_' - + ecData.get(shape, 'dataIndex') - + (shape._mark ? shape._mark : '') - + (this.type == ecConfig.CHART_TYPE_RADAR - ? ecData.get(shape, 'special') : ''); - } - else { - return ecData.get(shape, 'seriesIndex') + '_' - + ecData.get(shape, 'dataIndex') - + (shape._mark ? shape._mark : 'undefined'); - } - }, - - /** - * 动画过渡 - */ - _animateMod : function (oldShape, newShape, duration, easing) { - switch (newShape.type) { - case 'broken-line' : - case 'half-smooth-polygon' : - ecAnimation.pointList(this.zr, oldShape, newShape, duration, easing); - break; - case 'rectangle' : - ecAnimation.rectangle(this.zr, oldShape, newShape, duration, easing); - break; - case 'icon' : - ecAnimation.icon(this.zr, oldShape, newShape, duration, easing); - break; - case 'candle' : - if (duration > 500) { - ecAnimation.candle(this.zr, oldShape, newShape, duration, easing); - } - else { - this.zr.addShape(newShape); - } - break; - case 'ring' : - case 'sector' : - case 'circle' : - if (duration > 500) { - // 进入动画,加旋转 - ecAnimation.ring( - this.zr, - oldShape, - newShape, - duration + ((ecData.get(newShape, 'dataIndex') || 0) % 20 * 100), - easing - ); - } - else if (newShape.type == 'sector') { - ecAnimation.sector(this.zr, oldShape, newShape, duration, easing); - } - else { - this.zr.addShape(newShape); - } - break; - case 'text' : - ecAnimation.text(this.zr, oldShape, newShape, duration, easing); - break; - case 'polygon' : - if (duration > 500) { - ecAnimation.polygon(this.zr, oldShape, newShape, duration, easing); - } - else { - ecAnimation.pointList(this.zr, oldShape, newShape, duration, easing); - } - break; - case 'chord' : - ecAnimation.chord(this.zr, oldShape, newShape, duration, easing); - break; - case 'gauge-pointer' : - ecAnimation.gaugePointer(this.zr, oldShape, newShape, duration, easing); - break; - case 'mark-line' : - ecAnimation.markline(this.zr, oldShape, newShape, duration, easing); - break; - case 'line' : - ecAnimation.line(this.zr, oldShape, newShape, duration, easing); - break; - default : - this.zr.addShape(newShape); - break; - } - }, - - /** - * 标注动画 - * @param {number} duration 时长 - * @param {string=} easing 缓动效果 - * @param {Array=} addShapeList 指定特效对象,不知道默认使用this.shapeList - */ - animationMark : function (duration , easing, addShapeList) { - var shapeList = addShapeList || this.shapeList; - for (var i = 0, l = shapeList.length; i < l; i++) { - if (!shapeList[i]._mark) { - continue; - } - this._animateMod(false, shapeList[i], duration, easing); - } - this.animationEffect(addShapeList); - }, - - /** - * 特效动画 - * @param {Array=} addShapeList 指定特效对象,不知道默认使用this.shapeList - */ - animationEffect : function (addShapeList) { - !addShapeList && this.clearEffectShape(); - var shapeList = addShapeList || this.shapeList; - var zlevel = ecConfig.EFFECT_ZLEVEL; - if (this.canvasSupported) { - this.zr.modLayer( - zlevel, - { - motionBlur : true, - lastFrameAlpha : 0.95 - } - ); - } - var shape; - for (var i = 0, l = shapeList.length; i < l; i++) { - shape = shapeList[i]; - if (!(shape._mark && shape.effect && shape.effect.show && ecEffect[shape._mark]) - ) { - continue; - } - ecEffect[shape._mark](this.zr, this.effectList, shape, zlevel); - this.effectList[this.effectList.length - 1]._mark = shape._mark; - } - }, - - clearEffectShape : function (clearMotionBlur) { - if (this.zr && this.effectList && this.effectList.length > 0) { - clearMotionBlur && this.zr.modLayer( - ecConfig.EFFECT_ZLEVEL, - { motionBlur : false} - ); - this.zr.delShape(this.effectList); - } - this.effectList = []; - }, - - /** - * 动态标线标注添加 - * @param {number} seriesIndex 系列索引 - * @param {Object} markData 标线标注对象,支持多个 - * @param {string} markType 标线标注类型 - */ - addMark : function (seriesIndex, markData, markType) { - var serie = this.series[seriesIndex]; - if (this.selectedMap[serie.name]) { - var duration = 500; - var easing = this.query(this.option, 'animationEasing'); - // 备份,复用_buildMarkX - var oriMarkData = serie[markType].data; - var lastLength = this.shapeList.length; - - serie[markType].data = markData.data; - this['_build' + markType.replace('m', 'M')](seriesIndex); - for (var i = lastLength, l = this.shapeList.length; i < l; i++) { - this.zr.addShape(this.shapeList[i]); - } - this.zr.refresh(); - - if (this.option.animation && !this.option.renderAsImage) { - this.animationMark(duration, easing, this.shapeList.slice(lastLength)); - } - // 还原,复用_buildMarkX - serie[markType].data = oriMarkData; - } - }, - - /** - * 动态标线标注删除 - * @param {number} seriesIndex 系列索引 - * @param {string} markName 标线标注名称 - * @param {string} markType 标线标注类型 - */ - delMark : function (seriesIndex, markName, markType) { - markType = markType.replace('mark', '').replace('large', '').toLowerCase(); - var serie = this.series[seriesIndex]; - if (this.selectedMap[serie.name]) { - var needRefresh = false; - var shapeList = [this.shapeList, this.effectList]; - var len = 2; - while(len--) { - for (var i = 0, l = shapeList[len].length; i < l; i++) { - if (shapeList[len][i]._mark == markType - && ecData.get(shapeList[len][i], 'seriesIndex') == seriesIndex - && ecData.get(shapeList[len][i], 'name') == markName - ) { - this.zr.delShape(shapeList[len][i].id); - shapeList[len].splice(i, 1); - needRefresh = true; - break; - } - } - } - - needRefresh && this.zr.refresh(); - } - } - }; - - return Base; -}); - -/** - * echart图表库 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - */ -define('echarts/chart',[],function (/*require*/) { //chart - var self = {}; - - var _chartLibrary = {}; //echart图表库 - - /** - * 定义图形实现 - * @param {Object} name - * @param {Object} clazz 图形实现 - */ - self.define = function (name, clazz) { - _chartLibrary[name] = clazz; - return self; - }; - - /** - * 获取图形实现 - * @param {Object} name - */ - self.get = function (name) { - return _chartLibrary[name]; - }; - - return self; -}); -/** - * echarts组件:孤岛数据 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/chart/island',['require','../component/base','./base','zrender/shape/Circle','../config','../util/ecData','zrender/tool/util','zrender/tool/event','zrender/tool/color','../util/accMath','../chart'],function (require) { - var ComponentBase = require('../component/base'); - var ChartBase = require('./base'); - - // 图形依赖 - var CircleShape = require('zrender/shape/Circle'); - - var ecConfig = require('../config'); - var ecData = require('../util/ecData'); - var zrUtil = require('zrender/tool/util'); - var zrEvent = require('zrender/tool/event'); - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} option 图表选项 - */ - function Island(ecTheme, messageCenter, zr, option, myChart) { - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, {}, myChart); - // 图表基类 - ChartBase.call(this); - - this._nameConnector; - this._valueConnector; - this._zrHeight = this.zr.getHeight(); - this._zrWidth = this.zr.getWidth(); - - var self = this; - /** - * 滚轮改变孤岛数据值 - */ - self.shapeHandler.onmousewheel = function (param) { - var shape = param.target; - - var event = param.event; - var delta = zrEvent.getDelta(event); - delta = delta > 0 ? (-1) : 1; - shape.style.r -= delta; - shape.style.r = shape.style.r < 5 ? 5 : shape.style.r; - - var value = ecData.get(shape, 'value'); - var dvalue = value * self.option.island.calculateStep; - if (dvalue > 1) { - value = Math.round(value - dvalue * delta); - } - else { - value = (value - dvalue * delta).toFixed(2) - 0; - } - - var name = ecData.get(shape, 'name'); - shape.style.text = name + ':' + value; - - ecData.set(shape, 'value', value); - ecData.set(shape, 'name', name); - - self.zr.modShape(shape.id); - self.zr.refresh(); - zrEvent.stop(event); - }; - } - - Island.prototype = { - type : ecConfig.CHART_TYPE_ISLAND, - /** - * 孤岛合并 - * - * @param {string} tarShapeIndex 目标索引 - * @param {Object} srcShape 源目标,合入目标后删除 - */ - _combine : function (tarShape, srcShape) { - var zrColor = require('zrender/tool/color'); - var accMath = require('../util/accMath'); - var value = accMath.accAdd( - ecData.get(tarShape, 'value'), - ecData.get(srcShape, 'value') - ); - var name = ecData.get(tarShape, 'name') - + this._nameConnector - + ecData.get(srcShape, 'name'); - - tarShape.style.text = name + this._valueConnector + value; - - ecData.set(tarShape, 'value', value); - ecData.set(tarShape, 'name', name); - tarShape.style.r = this.option.island.r; - tarShape.style.color = zrColor.mix( - tarShape.style.color, - srcShape.style.color - ); - }, - - /** - * 刷新 - */ - refresh : function (newOption) { - if (newOption) { - newOption.island = this.reformOption(newOption.island); - this.option = newOption; - - this._nameConnector = this.option.nameConnector; - this._valueConnector = this.option.valueConnector; - } - }, - - getOption : function () { - return this.option; - }, - - resize : function () { - var newWidth = this.zr.getWidth(); - var newHieght = this.zr.getHeight(); - var xScale = newWidth / (this._zrWidth || newWidth); - var yScale = newHieght / (this._zrHeight || newHieght); - if (xScale == 1 && yScale == 1) { - return; - } - this._zrWidth = newWidth; - this._zrHeight = newHieght; - for (var i = 0, l = this.shapeList.length; i < l; i++) { - this.zr.modShape( - this.shapeList[i].id, - { - style: { - x: Math.round(this.shapeList[i].style.x * xScale), - y: Math.round(this.shapeList[i].style.y * yScale) - } - } - ); - } - }, - - add : function (shape) { - var name = ecData.get(shape, 'name'); - var value = ecData.get(shape, 'value'); - var seriesName = typeof ecData.get(shape, 'series') != 'undefined' - ? ecData.get(shape, 'series').name - : ''; - var font = this.getFont(this.option.island.textStyle); - var islandShape = { - zlevel : this._zlevelBase, - style : { - x : shape.style.x, - y : shape.style.y, - r : this.option.island.r, - color : shape.style.color || shape.style.strokeColor, - text : name + this._valueConnector + value, - textFont : font - }, - draggable : true, - hoverable : true, - onmousewheel : this.shapeHandler.onmousewheel, - _type : 'island' - }; - if (islandShape.style.color == '#fff') { - islandShape.style.color = shape.style.strokeColor; - } - this.setCalculable(islandShape); - islandShape.dragEnableTime = 0; - ecData.pack( - islandShape, - {name:seriesName}, -1, - value, -1, - name - ); - islandShape = new CircleShape(islandShape); - this.shapeList.push(islandShape); - this.zr.addShape(islandShape); - }, - - del : function (shape) { - this.zr.delShape(shape.id); - var newShapeList = []; - for (var i = 0, l = this.shapeList.length; i < l; i++) { - if (this.shapeList[i].id != shape.id) { - newShapeList.push(this.shapeList[i]); - } - } - this.shapeList = newShapeList; - }, - - /** - * 数据项被拖拽进来, 重载基类方法 - */ - ondrop : function (param, status) { - if (!this.isDrop || !param.target) { - // 没有在当前实例上发生拖拽行为则直接返回 - return; - } - // 拖拽产生孤岛数据合并 - var target = param.target; // 拖拽安放目标 - var dragged = param.dragged; // 当前被拖拽的图形对象 - - this._combine(target, dragged); - this.zr.modShape(target.id); - - status.dragIn = true; - - // 处理完拖拽事件后复位 - this.isDrop = false; - - return; - }, - - /** - * 数据项被拖拽出去, 重载基类方法 - */ - ondragend : function (param, status) { - var target = param.target; // 拖拽安放目标 - if (!this.isDragend) { - // 拖拽的不是孤岛数据,如果没有图表接受孤岛数据,需要新增孤岛数据 - if (!status.dragIn) { - target.style.x = zrEvent.getX(param.event); - target.style.y = zrEvent.getY(param.event); - this.add(target); - status.needRefresh = true; - } - } - else { - // 拖拽的是孤岛数据,如果有图表接受了孤岛数据,需要删除孤岛数据 - if (status.dragIn) { - this.del(target); - status.needRefresh = true; - } - } - - // 处理完拖拽事件后复位 - this.isDragend = false; - - return; - } - }; - - zrUtil.inherits(Island, ChartBase); - zrUtil.inherits(Island, ComponentBase); - - // 图表注册 - require('../chart').define('island', Island); - - return Island; -}); -/** - * echart组件库 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/component',[],function (/*require*/) { // component - var self = {}; - - var _componentLibrary = {}; // echart组件库 - - /** - * 定义图形实现 - * @param {Object} name - * @param {Object} clazz 图形实现 - */ - self.define = function (name, clazz) { - _componentLibrary[name] = clazz; - return self; - }; - - /** - * 获取图形实现 - * @param {Object} name - */ - self.get = function (name) { - return _componentLibrary[name]; - }; - - return self; -}); -/** - * echarts组件:提示框 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/component/dataView',['require','./base','../config','zrender/tool/util','../component'],function (require) { - var Base = require('./base'); - - var ecConfig = require('../config'); - var zrUtil = require('zrender/tool/util'); - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} option 提示框参数 - * @param {HtmlElement} dom 目标对象 - */ - function DataView(ecTheme, messageCenter, zr, option, myChart) { - Base.call(this, ecTheme, messageCenter, zr, option, myChart); - - this.dom = myChart.dom; - - // dataview dom & css - this._tDom = document.createElement('div'); - this._textArea = document.createElement('textArea'); - this._buttonRefresh = document.createElement('button'); - this._buttonClose = document.createElement('button'); - this._hasShow = false; - - // 缓存一些高宽数据 - this._zrHeight = zr.getHeight(); - this._zrWidth = zr.getWidth(); - - this._tDom.className = 'echarts-dataview', - this.hide(); - this.dom.firstChild.appendChild(this._tDom); - - if (window.addEventListener) { - this._tDom.addEventListener('click', this._stop); - this._tDom.addEventListener('mousewheel', this._stop); - this._tDom.addEventListener('mousemove', this._stop); - this._tDom.addEventListener('mousedown', this._stop); - this._tDom.addEventListener('mouseup', this._stop); - - // mobile支持 - this._tDom.addEventListener('touchstart', this._stop); - this._tDom.addEventListener('touchmove', this._stop); - this._tDom.addEventListener('touchend', this._stop); - } - else { - this._tDom.attachEvent('onclick', this._stop); - this._tDom.attachEvent('onmousewheel', this._stop); - this._tDom.attachEvent('onmousemove', this._stop); - this._tDom.attachEvent('onmousedown', this._stop); - this._tDom.attachEvent('onmouseup', this._stop); - } - } - - DataView.prototype = { - type : ecConfig.COMPONENT_TYPE_DATAVIEW, - _lang : ['Data View', 'close', 'refresh'], - // 通用样式 - _gCssText : 'position:absolute;' - + 'display:block;' - + 'overflow:hidden;' - + 'transition:height 0.8s,background-color 1s;' - + '-moz-transition:height 0.8s,background-color 1s;' - + '-webkit-transition:height 0.8s,background-color 1s;' - + '-o-transition:height 0.8s,background-color 1s;' - + 'z-index:1;' - + 'left:0;' - + 'top:0;', - hide : function () { - this._sizeCssText = 'width:' + this._zrWidth + 'px;' - + 'height:' + 0 + 'px;' - + 'background-color:#f0ffff;'; - this._tDom.style.cssText = this._gCssText + this._sizeCssText; - // 这是个很恶心的事情 - /* - this.dom.onselectstart = function () { - return false; - }; - */ - }, - - show : function (newOption) { - this._hasShow = true; - var lang = this.query(this.option, 'toolbox.feature.dataView.lang') - || this._lang; - - this.option = newOption; - - this._tDom.innerHTML = '

' - + (lang[0] || this._lang[0]) - + '

'; - - this._textArea.style.cssText = - 'display:block;margin:0 0 8px 0;padding:4px 6px;overflow:auto;' - + 'width:' + (this._zrWidth - 15) + 'px;' - + 'height:' + (this._zrHeight - 100) + 'px;'; - var customContent = this.query( - this.option, 'toolbox.feature.dataView.optionToContent' - ); - if (typeof customContent != 'function') { - this._textArea.value = this._optionToContent(); - } - else { - this._textArea.value = customContent(this.option); - } - this._tDom.appendChild(this._textArea); - - this._buttonClose.style.cssText = 'float:right;padding:1px 6px;'; - this._buttonClose.innerHTML = lang[1] || this._lang[1]; - var self = this; - this._buttonClose.onclick = function (){ - self.hide(); - }; - this._tDom.appendChild(this._buttonClose); - - if (this.query(this.option, 'toolbox.feature.dataView.readOnly') - === false - ) { - this._buttonRefresh.style.cssText = - 'float:right;margin-right:10px;padding:1px 6px;'; - this._buttonRefresh.innerHTML = lang[2] || this._lang[2]; - this._buttonRefresh.onclick = function (){ - self._save(); - }; - this._tDom.appendChild(this._buttonRefresh); - this._textArea.readOnly = false; - this._textArea.style.cursor = 'default'; - } - else { - this._textArea.readOnly = true; - this._textArea.style.cursor = 'text'; - } - - this._sizeCssText = 'width:' + this._zrWidth + 'px;' - + 'height:' + this._zrHeight + 'px;' - + 'background-color:#fff;'; - this._tDom.style.cssText = this._gCssText + this._sizeCssText; - // 这是个很恶心的事情 - /* - this.dom.onselectstart = function () { - return true; - }; - */ - }, - - _optionToContent : function () { - var i; - var j; - var k; - var len; - var data; - var valueList; - var axisList = []; - var content = ''; - if (this.option.xAxis) { - if (this.option.xAxis instanceof Array) { - axisList = this.option.xAxis; - } else { - axisList = [this.option.xAxis]; - } - for (i = 0, len = axisList.length; i < len; i++) { - // 横纵默认为类目 - if ((axisList[i].type || 'category') == 'category') { - valueList = []; - for (j = 0, k = axisList[i].data.length; j < k; j++) { - data = axisList[i].data[j]; - valueList.push( - typeof data.value != 'undefined' - ? data.value : data - ); - } - content += valueList.join(', ') + '\n\n'; - } - } - } - - if (this.option.yAxis) { - if (this.option.yAxis instanceof Array) { - axisList = this.option.yAxis; - } else { - axisList = [this.option.yAxis]; - } - for (i = 0, len = axisList.length; i < len; i++) { - if (axisList[i].type == 'category') { - valueList = []; - for (j = 0, k = axisList[i].data.length; j < k; j++) { - data = axisList[i].data[j]; - valueList.push( - typeof data.value != 'undefined' - ? data.value : data - ); - } - content += valueList.join(', ') + '\n\n'; - } - } - } - - var series = this.option.series; - var itemName; - for (i = 0, len = series.length; i < len; i++) { - valueList = []; - for (j = 0, k = series[i].data.length; j < k; j++) { - data = series[i].data[j]; - if (series[i].type == ecConfig.CHART_TYPE_PIE - || series[i].type == ecConfig.CHART_TYPE_MAP - ) { - itemName = (data.name || '-') + ':'; - } - else { - itemName = ''; - } - - if (series[i].type == ecConfig.CHART_TYPE_SCATTER) { - data = typeof data.value != 'undefined' - ? data.value - : data; - data = data.join(', '); - } - valueList.push( - itemName - + (typeof data.value != 'undefined' ? data.value : data) - ); - } - content += (series[i].name || '-') + ' : \n'; - content += valueList.join( - series[i].type == ecConfig.CHART_TYPE_SCATTER ? '\n': ', ' - ); - content += '\n\n'; - } - - return content; - }, - - _save : function () { - var text = this._textArea.value; - var customContent = this.query( - this.option, 'toolbox.feature.dataView.contentToOption' - ); - if (typeof customContent != 'function') { - text = text.split('\n'); - var content = []; - for (var i = 0, l = text.length; i < l; i++) { - text[i] = this._trim(text[i]); - if (text[i] !== '') { - content.push(text[i]); - } - } - this._contentToOption(content); - } - else { - customContent(text, this.option); - } - - this.hide(); - - var self = this; - setTimeout( - function (){ - self.messageCenter && self.messageCenter.dispatch( - ecConfig.EVENT.DATA_VIEW_CHANGED, - null, - {option : self.option}, - self.myChart - ); - }, - // 有动画,所以高级浏览器时间更长点 - self.canvasSupported ? 800 : 100 - ); - }, - - _contentToOption : function (content) { - var i; - var j; - var k; - var len; - var data; - var axisList = []; - - var contentIdx = 0; - var contentValueList; - var value; - - if (this.option.xAxis) { - if (this.option.xAxis instanceof Array) { - axisList = this.option.xAxis; - } else { - axisList = [this.option.xAxis]; - } - for (i = 0, len = axisList.length; i < len; i++) { - // 横纵默认为类目 - if ((axisList[i].type || 'category') == 'category' - ) { - contentValueList = content[contentIdx].split(','); - for (j = 0, k = axisList[i].data.length; j < k; j++) { - value = this._trim(contentValueList[j] || ''); - data = axisList[i].data[j]; - if (typeof axisList[i].data[j].value != 'undefined' - ) { - axisList[i].data[j].value = value; - } - else { - axisList[i].data[j] = value; - } - } - contentIdx++; - } - } - } - - if (this.option.yAxis) { - if (this.option.yAxis instanceof Array) { - axisList = this.option.yAxis; - } else { - axisList = [this.option.yAxis]; - } - for (i = 0, len = axisList.length; i < len; i++) { - if (axisList[i].type == 'category') { - contentValueList = content[contentIdx].split(','); - for (j = 0, k = axisList[i].data.length; j < k; j++) { - value = this._trim(contentValueList[j] || ''); - data = axisList[i].data[j]; - if (typeof axisList[i].data[j].value != 'undefined' - ) { - axisList[i].data[j].value = value; - } - else { - axisList[i].data[j] = value; - } - } - contentIdx++; - } - } - } - - var series = this.option.series; - for (i = 0, len = series.length; i < len; i++) { - contentIdx++; - if (series[i].type == ecConfig.CHART_TYPE_SCATTER) { - for (var j = 0, k = series[i].data.length; j < k; j++) { - contentValueList = content[contentIdx]; - value = contentValueList.replace(' ','').split(','); - if (typeof series[i].data[j].value != 'undefined' - ) { - series[i].data[j].value = value; - } - else { - series[i].data[j] = value; - } - contentIdx++; - } - } - else { - contentValueList = content[contentIdx].split(','); - for (var j = 0, k = series[i].data.length; j < k; j++) { - value = (contentValueList[j] || '').replace(/.*:/,''); - value = this._trim(value); - value = (value != '-' && value !== '') - ? (value - 0) - : '-'; - if (typeof series[i].data[j].value != 'undefined' - ) { - series[i].data[j].value = value; - } - else { - series[i].data[j] = value; - } - } - contentIdx++; - } - } - }, - - _trim : function (str){ - var trimer = new RegExp( - '(^[\\s\\t\\xa0\\u3000]+)|([\\u3000\\xa0\\s\\t]+\x24)', 'g' - ); - return str.replace(trimer, ''); - }, - - // 阻塞zrender事件 - _stop : function (e){ - e = e || window.event; - if (e.stopPropagation) { - e.stopPropagation(); - } - else { - e.cancelBubble = true; - } - }, - - /** - * zrender事件响应:窗口大小改变 - */ - resize : function () { - this._zrHeight = this.zr.getHeight(); - this._zrWidth = this.zr.getWidth(); - if (this._tDom.offsetHeight > 10) { - this._sizeCssText = 'width:' + this._zrWidth + 'px;' - + 'height:' + this._zrHeight + 'px;' - + 'background-color:#fff;'; - this._tDom.style.cssText = this._gCssText + this._sizeCssText; - this._textArea.style.cssText = 'display:block;margin:0 0 8px 0;' - + 'padding:4px 6px;overflow:auto;' - + 'width:' + (this._zrWidth - 15) + 'px;' - + 'height:' + (this._zrHeight - 100) + 'px;'; - } - }, - - /** - * 释放后实例不可用,重载基类方法 - */ - dispose : function () { - if (window.removeEventListener) { - this._tDom.removeEventListener('click', this._stop); - this._tDom.removeEventListener('mousewheel', this._stop); - this._tDom.removeEventListener('mousemove', this._stop); - this._tDom.removeEventListener('mousedown', this._stop); - this._tDom.removeEventListener('mouseup', this._stop); - - // mobile支持 - this._tDom.removeEventListener('touchstart', this._stop); - this._tDom.removeEventListener('touchmove', this._stop); - this._tDom.removeEventListener('touchend', this._stop); - } - else { - this._tDom.detachEvent('onclick', this._stop); - this._tDom.detachEvent('onmousewheel', this._stop); - this._tDom.detachEvent('onmousemove', this._stop); - this._tDom.detachEvent('onmousedown', this._stop); - this._tDom.detachEvent('onmouseup', this._stop); - } - - this._buttonRefresh.onclick = null; - this._buttonClose.onclick = null; - - if (this._hasShow) { - this._tDom.removeChild(this._textArea); - this._tDom.removeChild(this._buttonRefresh); - this._tDom.removeChild(this._buttonClose); - } - - this._textArea = null; - this._buttonRefresh = null; - this._buttonClose = null; - - this.dom.firstChild.removeChild(this._tDom); - this._tDom = null; - } - }; - - zrUtil.inherits(DataView, Base); - - require('../component').define('dataView', DataView); - - return DataView; -}); -/** - * echarts组件:工具箱 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zrender/shape/Image','zrender/shape/Rectangle','../util/shape/Icon','../config','zrender/tool/util','zrender/config','zrender/tool/event','./dataView','../component'],function (require) { - var Base = require('./base'); - - // 图形依赖 - var LineShape = require('zrender/shape/Line'); - var ImageShape = require('zrender/shape/Image'); - var RectangleShape = require('zrender/shape/Rectangle'); - var IconShape = require('../util/shape/Icon'); - - var ecConfig = require('../config'); - var zrUtil = require('zrender/tool/util'); - var zrConfig = require('zrender/config'); - var zrEvent = require('zrender/tool/event'); - - var _MAGICTYPE_STACK = 'stack'; - var _MAGICTYPE_TILED = 'tiled'; - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {HtmlElement} dom 目标对象 - * @param {ECharts} myChart 当前图表实例 - */ - function Toolbox(ecTheme, messageCenter, zr, option, myChart) { - Base.call(this, ecTheme, messageCenter, zr, option, myChart); - - this.dom = myChart.dom; - - this._magicType = {}; - //this._magicMap; - this._isSilence = false; - - this._iconList; - this._iconShapeMap = {}; - //this._itemGroupLocation; - this._featureTitle = {}; // 文字 - this._featureIcon = {}; // 图标 - this._featureColor = {}; // 颜色 - this._enableColor = 'red'; - this._disableColor = '#ccc'; - // this._markStart; - // this._marking; - // this._markShape; - // this._zoomStart; - // this._zooming; - // this._zoomShape; - // this._zoomQueue; - // this._dataView; - this._markShapeList = []; - var self = this; - self._onMark = function (param) { - self.__onMark(param); - }; - self._onMarkUndo = function (param) { - self.__onMarkUndo(param); - }; - self._onMarkClear = function (param) { - self.__onMarkClear(param); - }; - self._onDataZoom = function (param) { - self.__onDataZoom(param); - }; - self._onDataZoomReset = function (param) { - self.__onDataZoomReset(param); - }; - self._onDataView = function (param) { - self.__onDataView(param); - }; - self._onRestore = function (param) { - self.__onRestore(param); - }; - self._onSaveAsImage = function (param) { - self.__onSaveAsImage(param); - }; - self._onMagicType = function (param) { - self.__onMagicType(param); - }; - self._onCustomHandler = function (param) { - self.__onCustomHandler(param); - }; - self._onmousemove = function (param) { - return self.__onmousemove(param); - }; - - self._onmousedown = function (param) { - return self.__onmousedown(param); - }; - - self._onmouseup = function (param) { - return self.__onmouseup(param); - }; - - self._onclick = function (param) { - return self.__onclick(param); - }; - } - - Toolbox.prototype = { - type : ecConfig.COMPONENT_TYPE_TOOLBOX, - _buildShape : function () { - this._iconList = []; - var toolboxOption = this.option.toolbox; - this._enableColor = toolboxOption.effectiveColor; - this._disableColor = toolboxOption.disableColor; - var feature = toolboxOption.feature; - var iconName = []; - for (var key in feature){ - if (feature[key].show) { - switch (key) { - case 'mark' : - iconName.push({key : key, name : 'mark'}); - iconName.push({key : key, name : 'markUndo'}); - iconName.push({key : key, name : 'markClear'}); - break; - case 'magicType' : - for (var i = 0, l = feature[key].type.length; i < l; i++) { - feature[key].title[feature[key].type[i] + 'Chart'] - = feature[key].title[feature[key].type[i]]; - iconName.push({key : key, name : feature[key].type[i] + 'Chart'}); - } - break; - case 'dataZoom' : - iconName.push({key : key, name : 'dataZoom'}); - iconName.push({key : key, name : 'dataZoomReset'}); - break; - case 'saveAsImage' : - if (this.canvasSupported) { - iconName.push({key : key, name : 'saveAsImage'}); - } - break; - default : - iconName.push({key : key, name : key}); - break; - } - } - } - if (iconName.length > 0) { - var name; - var key; - for (var i = 0, l = iconName.length; i < l; i++) { - name = iconName[i].name; - key = iconName[i].key; - this._iconList.push(name); - this._featureTitle[name] = feature[key].title[name] || feature[key].title; - if (feature[key].icon) { - this._featureIcon[name] = feature[key].icon[name] || feature[key].icon; - } - if (feature[key].color) { - this._featureColor[name] = feature[key].color[name] || feature[key].color; - } - } - this._itemGroupLocation = this._getItemGroupLocation(); - - this._buildBackground(); - this._buildItem(); - - for (var i = 0, l = this.shapeList.length; i < l; i++) { - this.zr.addShape(this.shapeList[i]); - } - if (this._iconShapeMap['mark']) { - this._iconDisable(this._iconShapeMap['markUndo']); - this._iconDisable(this._iconShapeMap['markClear']); - } - if (this._iconShapeMap['dataZoomReset'] && this._zoomQueue.length === 0) { - this._iconDisable(this._iconShapeMap['dataZoomReset']); - } - } - }, - - /** - * 构建所有图例元素 - */ - _buildItem : function () { - var toolboxOption = this.option.toolbox; - var iconLength = this._iconList.length; - var lastX = this._itemGroupLocation.x; - var lastY = this._itemGroupLocation.y; - var itemSize = toolboxOption.itemSize; - var itemGap = toolboxOption.itemGap; - var itemShape; - - var color = toolboxOption.color instanceof Array - ? toolboxOption.color : [toolboxOption.color]; - - var textFont = this.getFont(toolboxOption.textStyle); - var textPosition; - var textAlign; - var textBaseline; - if (toolboxOption.orient == 'horizontal') { - textPosition = this._itemGroupLocation.y / this.zr.getHeight() < 0.5 - ? 'bottom' : 'top'; - textAlign = this._itemGroupLocation.x / this.zr.getWidth() < 0.5 - ? 'left' : 'right'; - textBaseline = this._itemGroupLocation.y / this.zr.getHeight() < 0.5 - ? 'top' : 'bottom'; - } - else { - textPosition = this._itemGroupLocation.x / this.zr.getWidth() < 0.5 - ? 'right' : 'left'; - /* - textAlign = this._itemGroupLocation.x / this.zr.getWidth() < 0.5 - ? 'right' : 'left'; - textBaseline = 'top'; - */ - } - - this._iconShapeMap = {}; - var self = this; - - for (var i = 0; i < iconLength; i++) { - // 图形 - itemShape = { - type : 'icon', - zlevel : this._zlevelBase, - style : { - x : lastX, - y : lastY, - width : itemSize, - height : itemSize, - iconType : this._iconList[i], - lineWidth : 1, - strokeColor : this._featureColor[this._iconList[i]] - || color[i % color.length], - brushType: 'stroke' - }, - highlightStyle : { - lineWidth : 1, - text : toolboxOption.showTitle - ? this._featureTitle[this._iconList[i]] - : undefined, - textFont : textFont, - textPosition : textPosition, - strokeColor : this._featureColor[this._iconList[i]] - || color[i % color.length] - }, - hoverable : true, - clickable : true - }; - - if (this._featureIcon[this._iconList[i]]) { - itemShape.style.image = this._featureIcon[this._iconList[i]].replace( - new RegExp('^image:\\/\\/'), '' - ); - itemShape.style.opacity = 0.8; - itemShape.highlightStyle.opacity = 1; - itemShape.type = 'image'; - } - - if (toolboxOption.orient == 'horizontal') { - // 修正左对齐第一个或右对齐最后一个 - if (i === 0 && textAlign == 'left') { - itemShape.highlightStyle.textPosition = 'specific'; - itemShape.highlightStyle.textAlign = textAlign; - itemShape.highlightStyle.textBaseline = textBaseline; - itemShape.highlightStyle.textX = lastX; - itemShape.highlightStyle.textY = textBaseline == 'top' - ? lastY + itemSize + 10 - : lastY - 10; - } - if (i == iconLength - 1 && textAlign == 'right') { - itemShape.highlightStyle.textPosition = 'specific'; - itemShape.highlightStyle.textAlign = textAlign; - itemShape.highlightStyle.textBaseline = textBaseline; - itemShape.highlightStyle.textX = lastX + itemSize; - itemShape.highlightStyle.textY = textBaseline == 'top' - ? lastY + itemSize + 10 - : lastY - 10; - } - } - - switch(this._iconList[i]) { - case 'mark': - itemShape.onclick = self._onMark; - break; - case 'markUndo': - itemShape.onclick = self._onMarkUndo; - break; - case 'markClear': - itemShape.onclick = self._onMarkClear; - break; - case 'dataZoom': - itemShape.onclick = self._onDataZoom; - break; - case 'dataZoomReset': - itemShape.onclick = self._onDataZoomReset; - break; - case 'dataView' : - if (!this._dataView) { - var DataView = require('./dataView'); - this._dataView = new DataView( - this.ecTheme, this.messageCenter, this.zr, this.option, this.myChart - ); - } - itemShape.onclick = self._onDataView; - break; - case 'restore': - itemShape.onclick = self._onRestore; - break; - case 'saveAsImage': - itemShape.onclick = self._onSaveAsImage; - break; - default: - if (this._iconList[i].match('Chart')) { - itemShape._name = this._iconList[i].replace('Chart', ''); - /* - if (this._magicType[itemShape._name]) { - itemShape.style.strokeColor = this._enableColor; - } - */ - itemShape.onclick = self._onMagicType; - } - else { - itemShape.onclick = self._onCustomHandler; - } - break; - } - - if (itemShape.type == 'icon') { - itemShape = new IconShape(itemShape); - } - else if (itemShape.type == 'image') { - itemShape = new ImageShape(itemShape); - } - this.shapeList.push(itemShape); - this._iconShapeMap[this._iconList[i]] = itemShape; - - if (toolboxOption.orient == 'horizontal') { - lastX += itemSize + itemGap; - } - else { - lastY += itemSize + itemGap; - } - } - }, - - _buildBackground : function () { - var toolboxOption = this.option.toolbox; - var pTop = toolboxOption.padding[0]; - var pRight = toolboxOption.padding[1]; - var pBottom = toolboxOption.padding[2]; - var pLeft = toolboxOption.padding[3]; - - this.shapeList.push(new RectangleShape({ - zlevel : this._zlevelBase, - hoverable :false, - style : { - x : this._itemGroupLocation.x - pLeft, - y : this._itemGroupLocation.y - pTop, - width : this._itemGroupLocation.width + pLeft + pRight, - height : this._itemGroupLocation.height + pTop + pBottom, - brushType : toolboxOption.borderWidth === 0 - ? 'fill' : 'both', - color : toolboxOption.backgroundColor, - strokeColor : toolboxOption.borderColor, - lineWidth : toolboxOption.borderWidth - } - })); - }, - - /** - * 根据选项计算图例实体的位置坐标 - */ - _getItemGroupLocation : function () { - var toolboxOption = this.option.toolbox; - var iconLength = this._iconList.length; - var itemGap = toolboxOption.itemGap; - var itemSize = toolboxOption.itemSize; - var totalWidth = 0; - var totalHeight = 0; - - if (toolboxOption.orient == 'horizontal') { - // 水平布局,计算总宽度,别忘减去最后一个的itemGap - totalWidth = (itemSize + itemGap) * iconLength - itemGap; - totalHeight = itemSize; - } - else { - // 垂直布局,计算总高度 - totalHeight = (itemSize + itemGap) * iconLength - itemGap; - totalWidth = itemSize; - } - - var x; - var zrWidth = this.zr.getWidth(); - switch (toolboxOption.x) { - case 'center' : - x = Math.floor((zrWidth - totalWidth) / 2); - break; - case 'left' : - x = toolboxOption.padding[3] + toolboxOption.borderWidth; - break; - case 'right' : - x = zrWidth - - totalWidth - - toolboxOption.padding[1] - - toolboxOption.borderWidth; - break; - default : - x = toolboxOption.x - 0; - x = isNaN(x) ? 0 : x; - break; - } - - var y; - var zrHeight = this.zr.getHeight(); - switch (toolboxOption.y) { - case 'top' : - y = toolboxOption.padding[0] + toolboxOption.borderWidth; - break; - case 'bottom' : - y = zrHeight - - totalHeight - - toolboxOption.padding[2] - - toolboxOption.borderWidth; - break; - case 'center' : - y = Math.floor((zrHeight - totalHeight) / 2); - break; - default : - y = toolboxOption.y - 0; - y = isNaN(y) ? 0 : y; - break; - } - - return { - x : x, - y : y, - width : totalWidth, - height : totalHeight - }; - }, - - __onmousemove : function (param) { - if (this._marking) { - this._markShape.style.xEnd = zrEvent.getX(param.event); - this._markShape.style.yEnd = zrEvent.getY(param.event); - this.zr.addHoverShape(this._markShape); - } - if (this._zooming) { - this._zoomShape.style.width = - zrEvent.getX(param.event) - this._zoomShape.style.x; - this._zoomShape.style.height = - zrEvent.getY(param.event) - this._zoomShape.style.y; - this.zr.addHoverShape(this._zoomShape); - this.dom.style.cursor = 'crosshair'; - } - if (this._zoomStart - && (this.dom.style.cursor != 'pointer' && this.dom.style.cursor != 'move') - ) { - this.dom.style.cursor = 'crosshair'; - } - }, - - __onmousedown : function (param) { - if (param.target) { - return; - } - this._zooming = true; - var x = zrEvent.getX(param.event); - var y = zrEvent.getY(param.event); - var zoomOption = this.option.dataZoom || {}; - this._zoomShape = new RectangleShape({ - zlevel : this._zlevelBase, - style : { - x : x, - y : y, - width : 1, - height : 1, - brushType: 'both' - }, - highlightStyle : { - lineWidth : 2, - color: zoomOption.fillerColor - || ecConfig.dataZoom.fillerColor, - strokeColor : zoomOption.handleColor - || ecConfig.dataZoom.handleColor, - brushType: 'both' - } - }); - this.zr.addHoverShape(this._zoomShape); - return true; // 阻塞全局事件 - }, - - __onmouseup : function (/*param*/) { - if (!this._zoomShape - || Math.abs(this._zoomShape.style.width) < 10 - || Math.abs(this._zoomShape.style.height) < 10 - ) { - this._zooming = false; - return true; - } - if (this._zooming && this.component.dataZoom) { - this._zooming = false; - - var zoom = this.component.dataZoom.rectZoom(this._zoomShape.style); - if (zoom) { - this._zoomQueue.push({ - start : zoom.start, - end : zoom.end, - start2 : zoom.start2, - end2 : zoom.end2 - }); - this._iconEnable(this._iconShapeMap['dataZoomReset']); - this.zr.refresh(); - } - } - return true; // 阻塞全局事件 - }, - - __onclick : function (param) { - if (param.target) { - return; - } - if (this._marking) { - this._marking = false; - this._markShapeList.push(this._markShape); - this._iconEnable(this._iconShapeMap['markUndo']); - this._iconEnable(this._iconShapeMap['markClear']); - this.zr.addShape(this._markShape); - this.zr.refresh(); - } - else if (this._markStart) { - this._marking = true; - var x = zrEvent.getX(param.event); - var y = zrEvent.getY(param.event); - this._markShape = new LineShape({ - zlevel : this._zlevelBase, - style : { - xStart : x, - yStart : y, - xEnd : x, - yEnd : y, - lineWidth : this.query( - this.option, - 'toolbox.feature.mark.lineStyle.width' - ), - strokeColor : this.query( - this.option, - 'toolbox.feature.mark.lineStyle.color' - ), - lineType : this.query( - this.option, - 'toolbox.feature.mark.lineStyle.type' - ) - } - }); - this.zr.addHoverShape(this._markShape); - } - }, - - __onMark : function (param) { - var target = param.target; - if (this._marking || this._markStart) { - // 取消 - this._resetMark(); - this.zr.refresh(); - } - else { - // 启用Mark - this._resetZoom(); // mark与dataZoom互斥 - - this.zr.modShape(target.id, {style: {strokeColor: this._enableColor}}); - this.zr.refresh(); - this._markStart = true; - var self = this; - setTimeout(function (){ - self.zr - && self.zr.on(zrConfig.EVENT.CLICK, self._onclick) - && self.zr.on(zrConfig.EVENT.MOUSEMOVE, self._onmousemove); - }, 10); - } - return true; // 阻塞全局事件 - }, - - __onMarkUndo : function () { - if (this._marking) { - this._marking = false; - } else { - var len = this._markShapeList.length; - if (len >= 1) { - var target = this._markShapeList[len - 1]; - this.zr.delShape(target.id); - this.zr.refresh(); - this._markShapeList.pop(); - if (len == 1) { - this._iconDisable(this._iconShapeMap['markUndo']); - this._iconDisable(this._iconShapeMap['markClear']); - } - } - } - return true; - }, - - __onMarkClear : function () { - if (this._marking) { - this._marking = false; - } - var len = this._markShapeList.length; - if (len > 0) { - while(len--) { - this.zr.delShape(this._markShapeList.pop().id); - } - this._iconDisable(this._iconShapeMap['markUndo']); - this._iconDisable(this._iconShapeMap['markClear']); - this.zr.refresh(); - } - return true; - }, - - __onDataZoom : function (param) { - var target = param.target; - if (this._zooming || this._zoomStart) { - // 取消 - this._resetZoom(); - this.zr.refresh(); - this.dom.style.cursor = 'default'; - } - else { - // 启用Zoom - this._resetMark(); // mark与dataZoom互斥 - - this.zr.modShape(target.id, {style: {strokeColor: this._enableColor}}); - this.zr.refresh(); - this._zoomStart = true; - var self = this; - setTimeout(function (){ - self.zr - && self.zr.on(zrConfig.EVENT.MOUSEDOWN, self._onmousedown) - && self.zr.on(zrConfig.EVENT.MOUSEUP, self._onmouseup) - && self.zr.on(zrConfig.EVENT.MOUSEMOVE, self._onmousemove); - }, 10); - - this.dom.style.cursor = 'crosshair'; - } - return true; // 阻塞全局事件 - }, - - __onDataZoomReset : function () { - if (this._zooming) { - this._zooming = false; - } - this._zoomQueue.pop(); - //console.log(this._zoomQueue) - if (this._zoomQueue.length > 0) { - this.component.dataZoom.absoluteZoom( - this._zoomQueue[this._zoomQueue.length - 1] - ); - } - else { - this.component.dataZoom.rectZoom(); - this._iconDisable(this._iconShapeMap['dataZoomReset']); - this.zr.refresh(); - } - - return true; - }, - - _resetMark : function () { - this._marking = false; - if (this._markStart) { - this._markStart = false; - if (this._iconShapeMap['mark']) { - // 还原图标为未生效状态 - this.zr.modShape( - this._iconShapeMap['mark'].id, - { - style: { - strokeColor: this._iconShapeMap['mark'] - .highlightStyle - .strokeColor - } - } - ); - } - - this.zr.un(zrConfig.EVENT.CLICK, this._onclick); - this.zr.un(zrConfig.EVENT.MOUSEMOVE, this._onmousemove); - } - }, - - _resetZoom : function () { - this._zooming = false; - if (this._zoomStart) { - this._zoomStart = false; - if (this._iconShapeMap['dataZoom']) { - // 还原图标为未生效状态 - this.zr.modShape( - this._iconShapeMap['dataZoom'].id, - { - style: { - strokeColor: this._iconShapeMap['dataZoom'] - .highlightStyle - .strokeColor - } - } - ); - } - - this.zr.un(zrConfig.EVENT.MOUSEDOWN, this._onmousedown); - this.zr.un(zrConfig.EVENT.MOUSEUP, this._onmouseup); - this.zr.un(zrConfig.EVENT.MOUSEMOVE, this._onmousemove); - } - }, - - _iconDisable : function (target) { - if (target.type != 'image') { - this.zr.modShape(target.id, { - hoverable : false, - clickable : false, - style : { - strokeColor : this._disableColor - } - }); - } - else { - this.zr.modShape(target.id, { - hoverable : false, - clickable : false, - style : { - opacity : 0.3 - } - }); - } - }, - - _iconEnable : function (target) { - if (target.type != 'image') { - this.zr.modShape(target.id, { - hoverable : true, - clickable : true, - style : { - strokeColor : target.highlightStyle.strokeColor - } - }); - } - else { - this.zr.modShape(target.id, { - hoverable : true, - clickable : true, - style : { - opacity : 0.8 - } - }); - } - }, - - __onDataView : function () { - this._dataView.show(this.option); - return true; - }, - - __onRestore : function (){ - this._resetMark(); - this._resetZoom(); - this.messageCenter.dispatch(ecConfig.EVENT.RESTORE, null, null, this.myChart); - return true; - }, - - __onSaveAsImage : function () { - var saveOption = this.option.toolbox.feature.saveAsImage; - var imgType = saveOption.type || 'png'; - if (imgType != 'png' && imgType != 'jpeg') { - imgType = 'png'; - } - - var image; - if (!this.myChart.isConnected()) { - image = this.zr.toDataURL( - 'image/' + imgType, - this.option.backgroundColor - && this.option.backgroundColor.replace(' ','') == 'rgba(0,0,0,0)' - ? '#fff' : this.option.backgroundColor - ); - } - else { - image = this.myChart.getConnectedDataURL(imgType); - } - - var downloadDiv = document.createElement('div'); - downloadDiv.id = '__echarts_download_wrap__'; - downloadDiv.style.cssText = 'position:fixed;' - + 'z-index:99999;' - + 'display:block;' - + 'top:0;left:0;' - + 'background-color:rgba(33,33,33,0.5);' - + 'text-align:center;' - + 'width:100%;' - + 'height:100%;' - + 'line-height:' - + document.documentElement.clientHeight + 'px;'; - - var downloadLink = document.createElement('a'); - //downloadLink.onclick = _saveImageForIE; - downloadLink.href = image; - downloadLink.setAttribute( - 'download', - (saveOption.name - ? saveOption.name - : (this.option.title && (this.option.title.text || this.option.title.subtext)) - ? (this.option.title.text || this.option.title.subtext) - : 'ECharts') - + '.' + imgType - ); - downloadLink.innerHTML = ''; - - downloadDiv.appendChild(downloadLink); - document.body.appendChild(downloadDiv); - downloadLink = null; - downloadDiv = null; - - setTimeout(function (){ - var _d = document.getElementById('__echarts_download_wrap__'); - if (_d) { - _d.onclick = function () { - var d = document.getElementById( - '__echarts_download_wrap__' - ); - d.onclick = null; - d.innerHTML = ''; - document.body.removeChild(d); - d = null; - }; - _d = null; - } - }, 500); - - /* - function _saveImageForIE() { - window.win = window.open(image); - win.document.execCommand("SaveAs"); - win.close() - } - */ - return; - }, - - __onMagicType : function (param) { - this._resetMark(); - var itemName = param.target._name; - if (!this._magicType[itemName]) { - // 启用 - this._magicType[itemName] = true; - // 折柱互斥 - if (itemName == ecConfig.CHART_TYPE_LINE) { - this._magicType[ecConfig.CHART_TYPE_BAR] = false; - } - else if (itemName == ecConfig.CHART_TYPE_BAR) { - this._magicType[ecConfig.CHART_TYPE_LINE] = false; - } - // 堆积平铺互斥 - if (itemName == _MAGICTYPE_STACK) { - this._magicType[_MAGICTYPE_TILED] = false; - } - else if (itemName == _MAGICTYPE_TILED) { - this._magicType[_MAGICTYPE_STACK] = false; - } - this.messageCenter.dispatch( - ecConfig.EVENT.MAGIC_TYPE_CHANGED, - param.event, - {magicType : this._magicType}, - this.myChart - ); - } - - return true; - }, - - setMagicType : function (magicType) { - this._resetMark(); - this._magicType = magicType; - - !this._isSilence && this.messageCenter.dispatch( - ecConfig.EVENT.MAGIC_TYPE_CHANGED, - null, - {magicType : this._magicType}, - this.myChart - ); - }, - - // 用户自定义扩展toolbox方法 - __onCustomHandler : function (param) { - var target = param.target.style.iconType; - var featureHandler = this.option.toolbox.feature[target].onclick; - if (typeof featureHandler === 'function') { - featureHandler(this.option); - } - }, - - // 重置备份还原状态等 - reset : function (newOption, isRestore) { - isRestore && this.clear(); - - if (this.query(newOption, 'toolbox.show') - && this.query(newOption, 'toolbox.feature.magicType.show') - ) { - var magicType = newOption.toolbox.feature.magicType.type; - var len = magicType.length; - this._magicMap = {}; // 标识可控类型 - while (len--) { - this._magicMap[magicType[len]] = true; - } - - len = newOption.series.length; - var oriType; // 备份还原可控类型 - var axis; - while (len--) { - oriType = newOption.series[len].type; - if (this._magicMap[oriType]) { - axis = newOption.xAxis instanceof Array - ? newOption.xAxis[newOption.series[len].xAxisIndex || 0] - : newOption.xAxis; - if (axis && (axis.type || 'category') == 'category') { - axis.__boundaryGap = typeof axis.boundaryGap != 'undefined' - ? axis.boundaryGap : true; - } - axis = newOption.yAxis instanceof Array - ? newOption.yAxis[newOption.series[len].yAxisIndex || 0] - : newOption.yAxis; - if (axis && axis.type == 'category') { - axis.__boundaryGap = typeof axis.boundaryGap != 'undefined' - ? axis.boundaryGap : true; - } - newOption.series[len].__type = oriType; - // 避免不同类型图表类型的样式污染 - newOption.series[len].__itemStyle = zrUtil.clone( - newOption.series[len].itemStyle || {} - ); - } - - if (this._magicMap[_MAGICTYPE_STACK] || this._magicMap[_MAGICTYPE_TILED]) { - newOption.series[len].__stack = newOption.series[len].stack; - } - } - } - - this._magicType = isRestore ? {} : (this._magicType || {}); - for (var itemName in this._magicType) { - if (this._magicType[itemName]) { - this.option = newOption; - this.getMagicOption(); - break; - } - } - - // 框选缩放 - var zoomOption = newOption.dataZoom; - if (zoomOption && zoomOption.show) { - var start = typeof zoomOption.start != 'undefined' - && zoomOption.start >= 0 - && zoomOption.start <= 100 - ? zoomOption.start : 0; - var end = typeof zoomOption.end != 'undefined' - && zoomOption.end >= 0 - && zoomOption.end <= 100 - ? zoomOption.end : 100; - if (start > end) { - // 大小颠倒自动翻转 - start = start + end; - end = start - end; - start = start - end; - } - this._zoomQueue = [{ - start : start, - end : end, - start2 : 0, - end2 : 100 - }]; - } - else { - this._zoomQueue = []; - } - }, - - getMagicOption : function (){ - var axis; - if (this._magicType[ecConfig.CHART_TYPE_LINE] - || this._magicType[ecConfig.CHART_TYPE_BAR] - ) { - // 图表类型有切换 - var boundaryGap = this._magicType[ecConfig.CHART_TYPE_LINE] ? false : true; - for (var i = 0, l = this.option.series.length; i < l; i++) { - if (this._magicMap[this.option.series[i].type]) { - this.option.series[i].type = this._magicType[ecConfig.CHART_TYPE_LINE] - ? ecConfig.CHART_TYPE_LINE - : ecConfig.CHART_TYPE_BAR; - // 避免不同类型图表类型的样式污染 - this.option.series[i].itemStyle = zrUtil.clone( - this.option.series[i].__itemStyle - ); - - axis = this.option.xAxis instanceof Array - ? this.option.xAxis[this.option.series[i].xAxisIndex || 0] - : this.option.xAxis; - if (axis && (axis.type || 'category') == 'category') { - axis.boundaryGap = boundaryGap ? true : axis.__boundaryGap; - } - axis = this.option.yAxis instanceof Array - ? this.option.yAxis[this.option.series[i].yAxisIndex || 0] - : this.option.yAxis; - if (axis && axis.type == 'category') { - axis.boundaryGap = boundaryGap ? true : axis.__boundaryGap; - } - } - } - } - - if (this._magicType[_MAGICTYPE_STACK] || this._magicType[_MAGICTYPE_TILED]) { - // 有堆积平铺切换 - for (var i = 0, l = this.option.series.length; i < l; i++) { - if (this._magicType[_MAGICTYPE_STACK]) { - // 启用堆积 - this.option.series[i].stack = '_ECHARTS_STACK_KENER_2014_'; - } - else if (this._magicType[_MAGICTYPE_TILED]) { - // 启用平铺 - this.option.series[i].stack = null; - } - } - } - - return this.option; - }, - - silence : function (s) { - this._isSilence = s; - }, - - resize : function () { - this._resetMark(); - this.clear(); - if (this.option && this.option.toolbox && this.option.toolbox.show) { - this._buildShape(); - } - if (this._dataView) { - this._dataView.resize(); - } - }, - - hideDataView : function () { - if (this._dataView) { - this._dataView.hide(); - } - }, - - clear : function(notMark) { - if (this.zr) { - this.zr.delShape(this.shapeList); - this.shapeList = []; - - if (!notMark) { - this.zr.delShape(this._markShapeList); - this._markShapeList = []; - } - } - }, - - /** - * 释放后实例不可用 - */ - dispose : function () { - if (this._dataView) { - this._dataView.dispose(); - this._dataView = null; - } - this.clear(); - this.shapeList = null; - this._markShapeList = null; - }, - - /** - * 刷新 - */ - refresh : function (newOption) { - if (newOption) { - this._resetMark(); - this._resetZoom(); - - newOption.toolbox = this.reformOption(newOption.toolbox); - // 补全padding属性 - newOption.toolbox.padding = this.reformCssArray( - newOption.toolbox.padding - ); - this.option = newOption; - - this.clear(true); - - if (newOption.toolbox.show) { - this._buildShape(); - } - - this.hideDataView(); - } - } - }; - - zrUtil.inherits(Toolbox, Base); - - require('../component').define('toolbox', Toolbox); - - return Toolbox; -}); - -/** - * echarts组件:图表标题 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/component/title',['require','./base','zrender/shape/Text','zrender/shape/Rectangle','../config','zrender/tool/util','zrender/tool/area','zrender/tool/color','../component'],function (require) { - var Base = require('./base'); - - // 图形依赖 - var TextShape = require('zrender/shape/Text'); - var RectangleShape = require('zrender/shape/Rectangle'); - - var ecConfig = require('../config'); - var zrUtil = require('zrender/tool/util'); - var zrArea = require('zrender/tool/area'); - var zrColor = require('zrender/tool/color'); - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} option 图表参数 - */ - function Title(ecTheme, messageCenter, zr, option, myChart) { - Base.call(this, ecTheme, messageCenter, zr, option, myChart); - - this.refresh(option); - } - - Title.prototype = { - type : ecConfig.COMPONENT_TYPE_TITLE, - _buildShape : function () { - // 标题元素组的位置参数,通过计算所得x, y, width, height - this._itemGroupLocation = this._getItemGroupLocation(); - - this._buildBackground(); - this._buildItem(); - - for (var i = 0, l = this.shapeList.length; i < l; i++) { - this.zr.addShape(this.shapeList[i]); - } - }, - - /** - * 构建所有标题元素 - */ - _buildItem : function () { - var text = this.titleOption.text; - var link = this.titleOption.link; - var target = this.titleOption.target; - var subtext = this.titleOption.subtext; - var sublink = this.titleOption.sublink; - var subtarget = this.titleOption.subtarget; - var font = this.getFont(this.titleOption.textStyle); - var subfont = this.getFont(this.titleOption.subtextStyle); - - var x = this._itemGroupLocation.x; - var y = this._itemGroupLocation.y; - var width = this._itemGroupLocation.width; - var height = this._itemGroupLocation.height; - - var textShape = { - zlevel : this._zlevelBase, - style : { - y : y, - color : this.titleOption.textStyle.color, - text: text, - textFont: font, - textBaseline: 'top' - }, - highlightStyle: { - color : zrColor.lift(this.titleOption.textStyle.color, 1), - brushType: 'fill' - }, - hoverable: false - }; - if (link) { - textShape.hoverable = true; - textShape.clickable = true; - textShape.onclick = function (){ - if (!target || target != 'self') { - window.open(link); - } - else { - window.location = link; - } - }; - } - - var subtextShape = { - zlevel : this._zlevelBase, - style : { - y : y + height, - color : this.titleOption.subtextStyle.color, - text: subtext, - textFont: subfont, - textBaseline: 'bottom' - }, - highlightStyle: { - color : zrColor.lift(this.titleOption.subtextStyle.color, 1), - brushType: 'fill' - }, - hoverable: false - }; - if (sublink) { - subtextShape.hoverable = true; - subtextShape.clickable = true; - subtextShape.onclick = function (){ - if (!subtarget || subtarget != 'self') { - window.open(sublink); - } - else { - window.location = sublink; - } - }; - } - - switch (this.titleOption.x) { - case 'center' : - textShape.style.x = subtextShape.style.x = x + width / 2; - textShape.style.textAlign = subtextShape.style.textAlign - = 'center'; - break; - case 'left' : - textShape.style.x = subtextShape.style.x = x; - textShape.style.textAlign = subtextShape.style.textAlign - = 'left'; - break; - case 'right' : - textShape.style.x = subtextShape.style.x = x + width; - textShape.style.textAlign = subtextShape.style.textAlign - = 'right'; - break; - default : - x = this.titleOption.x - 0; - x = isNaN(x) ? 0 : x; - textShape.style.x = subtextShape.style.x = x; - break; - } - - if (this.titleOption.textAlign) { - textShape.style.textAlign = subtextShape.style.textAlign - = this.titleOption.textAlign; - } - - this.shapeList.push(new TextShape(textShape)); - subtext !== '' && this.shapeList.push(new TextShape(subtextShape)); - }, - - _buildBackground : function () { - var pTop = this.titleOption.padding[0]; - var pRight = this.titleOption.padding[1]; - var pBottom = this.titleOption.padding[2]; - var pLeft = this.titleOption.padding[3]; - - this.shapeList.push(new RectangleShape({ - zlevel : this._zlevelBase, - hoverable :false, - style : { - x : this._itemGroupLocation.x - pLeft, - y : this._itemGroupLocation.y - pTop, - width : this._itemGroupLocation.width + pLeft + pRight, - height : this._itemGroupLocation.height + pTop + pBottom, - brushType : this.titleOption.borderWidth === 0 - ? 'fill' : 'both', - color : this.titleOption.backgroundColor, - strokeColor : this.titleOption.borderColor, - lineWidth : this.titleOption.borderWidth - } - })); - }, - - /** - * 根据选项计算标题实体的位置坐标 - */ - _getItemGroupLocation : function () { - var text = this.titleOption.text; - var subtext = this.titleOption.subtext; - var font = this.getFont(this.titleOption.textStyle); - var subfont = this.getFont(this.titleOption.subtextStyle); - - var totalWidth = Math.max( - zrArea.getTextWidth(text, font), - zrArea.getTextWidth(subtext, subfont) - ); - var totalHeight = zrArea.getTextHeight(text, font) - + (subtext === '' - ? 0 - : (this.titleOption.itemGap - + zrArea.getTextHeight(subtext, subfont)) - ); - - var x; - var zrWidth = this.zr.getWidth(); - switch (this.titleOption.x) { - case 'center' : - x = Math.floor((zrWidth - totalWidth) / 2); - break; - case 'left' : - x = this.titleOption.padding[3] + this.titleOption.borderWidth; - break; - case 'right' : - x = zrWidth - - totalWidth - - this.titleOption.padding[1] - - this.titleOption.borderWidth; - break; - default : - x = this.titleOption.x - 0; - x = isNaN(x) ? 0 : x; - break; - } - - var y; - var zrHeight = this.zr.getHeight(); - switch (this.titleOption.y) { - case 'top' : - y = this.titleOption.padding[0] + this.titleOption.borderWidth; - break; - case 'bottom' : - y = zrHeight - - totalHeight - - this.titleOption.padding[2] - - this.titleOption.borderWidth; - break; - case 'center' : - y = Math.floor((zrHeight - totalHeight) / 2); - break; - default : - y = this.titleOption.y - 0; - y = isNaN(y) ? 0 : y; - break; - } - - return { - x : x, - y : y, - width : totalWidth, - height : totalHeight - }; - }, - - /** - * 刷新 - */ - refresh : function (newOption) { - if (newOption) { - this.option = newOption; - - this.option.title = this.reformOption(this.option.title); - // 补全padding属性 - this.option.title.padding = this.reformCssArray( - this.option.title.padding - ); - - this.titleOption = this.option.title; - this.titleOption.textStyle = zrUtil.merge( - this.titleOption.textStyle, - this.ecTheme.textStyle - ); - this.titleOption.subtextStyle = zrUtil.merge( - this.titleOption.subtextStyle, - this.ecTheme.textStyle - ); - } - - this.clear(); - this._buildShape(); - } - }; - - zrUtil.inherits(Title, Base); - - require('../component').define('title', Title); - - return Title; -}); - - - -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:十字准星 - * 可配图形属性: - { - // 基础属性 - shape : 'cross', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - rect : {Object}, // 必须,对角框 - x : {number}, // 必须,横坐标 - y : {number}, // 必须,纵坐标 - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - */ -define('echarts/util/shape/Cross',['require','zrender/shape/Base','zrender/shape/Line','zrender/tool/util','./normalIsCover'],function (require) { - var Base = require('zrender/shape/Base'); - var LineShape = require('zrender/shape/Line'); - var zrUtil = require('zrender/tool/util'); - - function Cross(options) { - Base.call(this, options); - } - - Cross.prototype = { - type : 'cross', - - /** - * 创建矩形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function (ctx, style) { - var rect = style.rect; - style.xStart = rect.x; - style.xEnd = rect.x + rect.width; - style.yStart = style.yEnd = style.y; - LineShape.prototype.buildPath(ctx, style); - style.xStart = style.xEnd = style.x; - style.yStart = rect.y; - style.yEnd = rect.y + rect.height; - LineShape.prototype.buildPath(ctx, style); - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function (style) { - return style.rect; - }, - - isCover : require('./normalIsCover') - }; - - zrUtil.inherits(Cross, Base); - - return Cross; -}); - -/** - * echarts组件:提示框 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zrender/shape/Line','zrender/shape/Rectangle','../config','../util/ecData','zrender/config','zrender/tool/event','zrender/tool/area','zrender/tool/color','zrender/tool/util','zrender/shape/Base','../component'],function (require) { - var Base = require('./base'); - - // 图形依赖 - var CrossShape = require('../util/shape/Cross'); - var LineShape = require('zrender/shape/Line'); - var RectangleShape = require('zrender/shape/Rectangle'); - var rectangleInstance = new RectangleShape({}); - - var ecConfig = require('../config'); - var ecData = require('../util/ecData'); - var zrConfig = require('zrender/config'); - var zrEvent = require('zrender/tool/event'); - var zrArea = require('zrender/tool/area'); - var zrColor = require('zrender/tool/color'); - var zrUtil = require('zrender/tool/util'); - var zrShapeBase = require('zrender/shape/Base'); - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} option 提示框参数 - * @param {HtmlElement} dom 目标对象 - * @param {ECharts} myChart 当前图表实例 - */ - function Tooltip(ecTheme, messageCenter, zr, option, myChart) { - Base.call(this, ecTheme, messageCenter, zr, option, myChart); - - this.dom = myChart.dom; - - var self = this; - self._onmousemove = function (param) { - return self.__onmousemove(param); - }; - self._onglobalout = function (param) { - return self.__onglobalout(param); - }; - - this.zr.on(zrConfig.EVENT.MOUSEMOVE, self._onmousemove); - this.zr.on(zrConfig.EVENT.GLOBALOUT, self._onglobalout); - - self._hide = function (param) { - return self.__hide(param); - }; - self._tryShow = function(param) { - return self.__tryShow(param); - }; - self._refixed = function(param) { - return self.__refixed(param); - }; - - self._setContent = function(ticket, res) { - return self.__setContent(ticket, res); - }; - - this._tDom = this._tDom || document.createElement('div'); - // 避免拖拽时页面选中的尴尬 - this._tDom.onselectstart = function() { - return false; - }; - this._tDom.style.position = 'absolute'; // 不是多余的,别删! - this.hasAppend = false; - - this._axisLineShape && this.zr.delShape(this._axisLineShape.id); - this._axisLineShape = new LineShape({ - zlevel: this._zlevelBase, - invisible : true, - hoverable: false - }); - this.shapeList.push(this._axisLineShape); - this.zr.addShape(this._axisLineShape); - - this._axisShadowShape && this.zr.delShape(this._axisShadowShape.id); - this._axisShadowShape = new LineShape({ - zlevel: 1, // grid上,chart下 - invisible : true, - hoverable: false - }); - this.shapeList.push(this._axisShadowShape); - this.zr.addShape(this._axisShadowShape); - - this._axisCrossShape && this.zr.delShape(this._axisCrossShape.id); - this._axisCrossShape = new CrossShape({ - zlevel: this._zlevelBase, - invisible : true, - hoverable: false - }); - this.shapeList.push(this._axisCrossShape); - this.zr.addShape(this._axisCrossShape); - - this.showing = false; - this.refresh(option); - } - - Tooltip.prototype = { - type : ecConfig.COMPONENT_TYPE_TOOLTIP, - // 通用样式 - _gCssText : 'position:absolute;' - + 'display:block;' - + 'border-style:solid;' - + 'white-space:nowrap;', - /** - * 根据配置设置dom样式 - */ - _style : function (opt) { - if (!opt) { - return ''; - } - var cssText = []; - if (opt.transitionDuration) { - var transitionText = 'left ' + opt.transitionDuration + 's,' - + 'top ' + opt.transitionDuration + 's'; - cssText.push( - 'transition:' + transitionText - ); - cssText.push( - '-moz-transition:' + transitionText - ); - cssText.push( - '-webkit-transition:' + transitionText - ); - cssText.push( - '-o-transition:' + transitionText - ); - } - - if (opt.backgroundColor) { - // for sb ie~ - cssText.push( - 'background-Color:' + zrColor.toHex( - opt.backgroundColor - ) - ); - cssText.push('filter:alpha(opacity=70)'); - cssText.push('background-Color:' + opt.backgroundColor); - } - - if (typeof opt.borderWidth != 'undefined') { - cssText.push('border-width:' + opt.borderWidth + 'px'); - } - - if (typeof opt.borderColor != 'undefined') { - cssText.push('border-color:' + opt.borderColor); - } - - if (typeof opt.borderRadius != 'undefined') { - cssText.push( - 'border-radius:' + opt.borderRadius + 'px' - ); - cssText.push( - '-moz-border-radius:' + opt.borderRadius + 'px' - ); - cssText.push( - '-webkit-border-radius:' + opt.borderRadius + 'px' - ); - cssText.push( - '-o-border-radius:' + opt.borderRadius + 'px' - ); - } - - var textStyle = opt.textStyle; - if (textStyle) { - textStyle.color && cssText.push('color:' + textStyle.color); - textStyle.decoration && cssText.push( - 'text-decoration:' + textStyle.decoration - ); - textStyle.align && cssText.push( - 'text-align:' + textStyle.align - ); - textStyle.fontFamily && cssText.push( - 'font-family:' + textStyle.fontFamily - ); - textStyle.fontSize && cssText.push( - 'font-size:' + textStyle.fontSize + 'px' - ); - textStyle.fontSize && cssText.push( - 'line-height:' + Math.round(textStyle.fontSize*3/2) + 'px' - ); - textStyle.fontStyle && cssText.push( - 'font-style:' + textStyle.fontStyle - ); - textStyle.fontWeight && cssText.push( - 'font-weight:' + textStyle.fontWeight - ); - } - - - var padding = opt.padding; - if (typeof padding != 'undefined') { - padding = this.reformCssArray(padding); - cssText.push( - 'padding:' + padding[0] + 'px ' - + padding[1] + 'px ' - + padding[2] + 'px ' - + padding[3] + 'px' - ); - } - - cssText = cssText.join(';') + ';'; - - return cssText; - }, - - __hide : function () { - if (this._tDom) { - this._tDom.style.display = 'none'; - } - var needRefresh = false; - if (!this._axisLineShape.invisible) { - this._axisLineShape.invisible = true; - this.zr.modShape(this._axisLineShape.id); - needRefresh = true; - } - if (!this._axisShadowShape.invisible) { - this._axisShadowShape.invisible = true; - this.zr.modShape(this._axisShadowShape.id); - needRefresh = true; - } - if (!this._axisCrossShape.invisible) { - this._axisCrossShape.invisible = true; - this.zr.modShape(this._axisCrossShape.id); - needRefresh = true; - } - if (this._lastTipShape && this._lastTipShape.tipShape.length > 0) { - this.zr.delShape(this._lastTipShape.tipShape); - this._lastTipShape = false; - this.shapeList.length = 2; - } - needRefresh && this.zr.refresh(); - this.showing = false; - }, - - _show : function (position, x, y, specialCssText) { - var domHeight = this._tDom.offsetHeight; - var domWidth = this._tDom.offsetWidth; - if (position) { - if (typeof position == 'function') { - position = position([x, y]); - } - if (position instanceof Array) { - x = position[0]; - y = position[1]; - } - } - if (x + domWidth > this._zrWidth) { - // 太靠右 - //x = this._zrWidth - domWidth; - x -= (domWidth + 40); - } - if (y + domHeight > this._zrHeight) { - // 太靠下 - //y = this._zrHeight - domHeight; - y -= (domHeight - 20); - } - if (y < 20) { - y = 0; - } - this._tDom.style.cssText = this._gCssText - + this._defaultCssText - + (specialCssText ? specialCssText : '') - + 'left:' + x + 'px;top:' + y + 'px;'; - - if (domHeight < 10 || domWidth < 10) { - // this._zrWidth - x < 100 || this._zrHeight - y < 100 - setTimeout(this._refixed, 20); - } - this.showing = true; - }, - - __refixed : function () { - if (this._tDom) { - var cssText = ''; - var domHeight = this._tDom.offsetHeight; - var domWidth = this._tDom.offsetWidth; - if (this._tDom.offsetLeft + domWidth > this._zrWidth) { - cssText += 'left:' + (this._zrWidth - domWidth - 20) + 'px;'; - } - if (this._tDom.offsetTop + domHeight > this._zrHeight) { - cssText += 'top:' + (this._zrHeight - domHeight - 10) + 'px;'; - } - if (cssText !== '') { - this._tDom.style.cssText += cssText; - } - } - }, - - __tryShow : function () { - var needShow; - var trigger; - if (!this._curTarget) { - // 坐标轴事件 - this._findPolarTrigger() || this._findAxisTrigger(); - } - else { - // 数据项事件 - if (this._curTarget._type == 'island' && this.option.tooltip.show) { - this._showItemTrigger(); - return; - } - var serie = ecData.get(this._curTarget, 'series'); - var data = ecData.get(this._curTarget, 'data'); - needShow = this.deepQuery( - [data, serie, this.option], - 'tooltip.show' - ); - if (typeof serie == 'undefined' - || typeof data == 'undefined' - || needShow === false - ) { - // 不响应tooltip的数据对象延时隐藏 - clearTimeout(this._hidingTicket); - clearTimeout(this._showingTicket); - this._hidingTicket = setTimeout(this._hide, this._hideDelay); - } - else { - trigger = this.deepQuery( - [data, serie, this.option], - 'tooltip.trigger' - ); - - trigger == 'axis' - ? this._showAxisTrigger( - serie.xAxisIndex, serie.yAxisIndex, - ecData.get(this._curTarget, 'dataIndex') - ) - : this._showItemTrigger(); - } - } - }, - - /** - * 直角系 - */ - _findAxisTrigger : function () { - if (!this.component.xAxis || !this.component.yAxis) { - this._hidingTicket = setTimeout(this._hide, this._hideDelay); - return; - } - var series = this.option.series; - var xAxisIndex; - var yAxisIndex; - for (var i = 0, l = series.length; i < l; i++) { - // 找到第一个axis触发tooltip的系列 - if (this.deepQuery( - [series[i], this.option], 'tooltip.trigger' - ) == 'axis' - ) { - xAxisIndex = series[i].xAxisIndex || 0; - yAxisIndex = series[i].yAxisIndex || 0; - if (this.component.xAxis.getAxis(xAxisIndex) - && this.component.xAxis.getAxis(xAxisIndex).type - == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY - ) { - // 横轴为类目轴 - this._showAxisTrigger(xAxisIndex, yAxisIndex, - this._getNearestDataIndex( - 'x', this.component.xAxis.getAxis(xAxisIndex) - ) - ); - return; - } - else if (this.component.yAxis.getAxis(yAxisIndex) - && this.component.yAxis.getAxis(yAxisIndex).type - == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY - ) { - // 纵轴为类目轴 - this._showAxisTrigger(xAxisIndex, yAxisIndex, - this._getNearestDataIndex( - 'y', this.component.yAxis.getAxis(yAxisIndex) - ) - ); - return; - } - else { - // 双数值轴 - this._showAxisTrigger(xAxisIndex, yAxisIndex, -1); - return; - } - } - } - if (this.option.tooltip.axisPointer.type == 'cross') { - this._showAxisTrigger(-1, -1, -1); - } - }, - - /** - * 极坐标 - */ - _findPolarTrigger : function () { - if (!this.component.polar) { - return false; - } - var x = zrEvent.getX(this._event); - var y = zrEvent.getY(this._event); - var polarIndex = this.component.polar.getNearestIndex([x, y]); - var valueIndex; - if (polarIndex) { - valueIndex = polarIndex.valueIndex; - polarIndex = polarIndex.polarIndex; - } - else { - polarIndex = -1; - } - - if (polarIndex != -1) { - return this._showPolarTrigger(polarIndex, valueIndex); - } - - return false; - }, - - /** - * 根据坐标轴事件带的属性获取最近的axisDataIndex - */ - _getNearestDataIndex : function (direction, categoryAxis) { - var dataIndex = -1; - var x = zrEvent.getX(this._event); - var y = zrEvent.getY(this._event); - if (direction == 'x') { - // 横轴为类目轴 - var left; - var right; - var xEnd = this.component.grid.getXend(); - var curCoord = categoryAxis.getCoordByIndex(dataIndex); - while (curCoord < xEnd) { - if (curCoord <= x) { - left = curCoord; - } - if (curCoord >= x) { - break; - } - curCoord = categoryAxis.getCoordByIndex(++dataIndex); - right = curCoord; - } - if (x - left < right - x) { - dataIndex -= dataIndex !== 0 ? 1 : 0; - } - else { - // 离右边近,看是否为最后一个 - if (typeof categoryAxis.getNameByIndex(dataIndex) - == 'undefined' - ) { - dataIndex -= 1; - } - } - return dataIndex; - } - else { - // 纵轴为类目轴 - var top; - var bottom; - var yStart = this.component.grid.getY(); - var curCoord = categoryAxis.getCoordByIndex(dataIndex); - while (curCoord > yStart) { - if (curCoord >= y) { - bottom = curCoord; - } - if (curCoord <= y) { - break; - } - curCoord = categoryAxis.getCoordByIndex(++dataIndex); - top = curCoord; - } - - if (y - top > bottom - y) { - dataIndex -= dataIndex !== 0 ? 1 : 0; - } - else { - // 离上方边近,看是否为最后一个 - if (typeof categoryAxis.getNameByIndex(dataIndex) - == 'undefined' - ) { - dataIndex -= 1; - } - } - return dataIndex; - } - return -1; - }, - - /** - * 直角系 - */ - _showAxisTrigger : function (xAxisIndex, yAxisIndex, dataIndex) { - !this._event.connectTrigger && this.messageCenter.dispatch( - ecConfig.EVENT.TOOLTIP_IN_GRID, - this._event, - null, - this.myChart - ); - if (typeof this.component.xAxis == 'undefined' - || typeof this.component.yAxis == 'undefined' - || typeof xAxisIndex == 'undefined' - || typeof yAxisIndex == 'undefined' - // || dataIndex < 0 - ) { - // 不响应tooltip的数据对象延时隐藏 - clearTimeout(this._hidingTicket); - clearTimeout(this._showingTicket); - this._hidingTicket = setTimeout(this._hide, this._hideDelay); - return; - } - var series = this.option.series; - var seriesArray = []; - var seriesIndex = []; - var categoryAxis; - var x; - var y; - - var formatter; - var position; - var showContent; - var specialCssText = ''; - if (this.option.tooltip.trigger == 'axis') { - if (this.option.tooltip.show === false) { - return; - } - formatter = this.option.tooltip.formatter; - position = this.option.tooltip.position; - } - - if (xAxisIndex != -1 - && this.component.xAxis.getAxis(xAxisIndex).type - == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY - ) { - // 横轴为类目轴,找到所有用这条横轴并且axis触发的系列数据 - categoryAxis = this.component.xAxis.getAxis(xAxisIndex); - for (var i = 0, l = series.length; i < l; i++) { - if (!this._isSelected(series[i].name)) { - continue; - } - if (series[i].xAxisIndex == xAxisIndex - && this.deepQuery([series[i], this.option], 'tooltip.trigger') == 'axis' - ) { - showContent = this.query(series[i], 'tooltip.showContent') - || showContent; - formatter = this.query(series[i], 'tooltip.formatter') - || formatter; - position = this.query(series[i], 'tooltip.position') - || position; - - specialCssText += this._style(this.query(series[i], 'tooltip')); - seriesArray.push(series[i]); - seriesIndex.push(i); - } - } - // 寻找高亮元素 - this.messageCenter.dispatch( - ecConfig.EVENT.TOOLTIP_HOVER, - this._event, - { - seriesIndex : seriesIndex, - dataIndex : dataIndex - }, - this.myChart - ); - y = zrEvent.getY(this._event); - x = this.subPixelOptimize( - categoryAxis.getCoordByIndex(dataIndex), - this._axisLineWidth - ); - this._styleAxisPointer( - seriesArray, - x, this.component.grid.getY(), - x, this.component.grid.getYend(), - categoryAxis.getGap(), x, y - ); - } - else if (yAxisIndex != -1 - && this.component.yAxis.getAxis(yAxisIndex).type - == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY - ) { - // 纵轴为类目轴,找到所有用这条纵轴并且axis触发的系列数据 - categoryAxis = this.component.yAxis.getAxis(yAxisIndex); - for (var i = 0, l = series.length; i < l; i++) { - if (!this._isSelected(series[i].name)) { - continue; - } - if (series[i].yAxisIndex == yAxisIndex - && this.deepQuery([series[i], this.option], 'tooltip.trigger') == 'axis' - ) { - showContent = this.query(series[i], 'tooltip.showContent') - || showContent; - formatter = this.query(series[i], 'tooltip.formatter') - || formatter; - position = this.query(series[i], 'tooltip.position') - || position; - specialCssText += this._style(this.query(series[i], 'tooltip')); - seriesArray.push(series[i]); - seriesIndex.push(i); - } - } - // 寻找高亮元素 - this.messageCenter.dispatch( - ecConfig.EVENT.TOOLTIP_HOVER, - this._event, - { - seriesIndex : seriesIndex, - dataIndex : dataIndex - }, - this.myChart - ); - x = zrEvent.getX(this._event); - y = this.subPixelOptimize( - categoryAxis.getCoordByIndex(dataIndex), - this._axisLineWidth - ); - this._styleAxisPointer( - seriesArray, - this.component.grid.getX(), y, - this.component.grid.getXend(), y, - categoryAxis.getGap(), x, y - ); - } - else { - // 双数值轴 - x = zrEvent.getX(this._event); - y = zrEvent.getY(this._event); - this._styleAxisPointer( - series, - this.component.grid.getX(), y, - this.component.grid.getXend(), y, - 0, x, y - ); - if (dataIndex >= 0) { - this._showItemTrigger(); - } - else { - clearTimeout(this._hidingTicket); - clearTimeout(this._showingTicket); - this._tDom.style.display = 'none'; - } - } - - if (seriesArray.length > 0) { - var data; - if (typeof formatter == 'function') { - var params = []; - for (var i = 0, l = seriesArray.length; i < l; i++) { - data = seriesArray[i].data[dataIndex]; - data = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; - - params.push([ - seriesArray[i].name || '', - categoryAxis.getNameByIndex(dataIndex), - data - ]); - } - this._curTicket = 'axis:' + dataIndex; - this._tDom.innerHTML = formatter.call( - this.myChart, params, this._curTicket, this._setContent - ); - } - else if (typeof formatter == 'string') { - this._curTicket = NaN; - formatter = formatter.replace('{a}','{a0}') - .replace('{b}','{b0}') - .replace('{c}','{c0}'); - for (var i = 0, l = seriesArray.length; i < l; i++) { - formatter = formatter.replace( - '{a' + i + '}', - this._encodeHTML(seriesArray[i].name || '') - ); - formatter = formatter.replace( - '{b' + i + '}', - this._encodeHTML(categoryAxis.getNameByIndex(dataIndex)) - ); - data = seriesArray[i].data[dataIndex]; - data = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; - formatter = formatter.replace( - '{c' + i + '}', - data instanceof Array - ? data : this.numAddCommas(data) - ); - } - this._tDom.innerHTML = formatter; - } - else { - this._curTicket = NaN; - formatter = this._encodeHTML( - categoryAxis.getNameByIndex(dataIndex) - ); - - for (var i = 0, l = seriesArray.length; i < l; i++) { - formatter += '
' - + this._encodeHTML(seriesArray[i].name || '') - + ' : '; - data = seriesArray[i].data[dataIndex]; - data = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; - formatter += data instanceof Array - ? data : this.numAddCommas(data); - } - this._tDom.innerHTML = formatter; - } - - if (showContent === false || !this.option.tooltip.showContent) { - // 只用tooltip的行为,不显示主体 - return; - } - - if (!this.hasAppend) { - this._tDom.style.left = this._zrWidth / 2 + 'px'; - this._tDom.style.top = this._zrHeight / 2 + 'px'; - this.dom.firstChild.appendChild(this._tDom); - this.hasAppend = true; - } - this._show(position, x + 10, y + 10, specialCssText); - } - }, - - /** - * 极坐标 - */ - _showPolarTrigger : function (polarIndex, dataIndex) { - if (typeof this.component.polar == 'undefined' - || typeof polarIndex == 'undefined' - || typeof dataIndex == 'undefined' - || dataIndex < 0 - ) { - return false; - } - var series = this.option.series; - var seriesArray = []; - - var formatter; - var position; - var showContent; - var specialCssText = ''; - if (this.option.tooltip.trigger == 'axis') { - if (this.option.tooltip.show === false) { - return false; - } - formatter = this.option.tooltip.formatter; - position = this.option.tooltip.position; - } - var indicatorName = this.option.polar[polarIndex].indicator[dataIndex].text; - - // 找到所有用这个极坐标并且axis触发的系列数据 - for (var i = 0, l = series.length; i < l; i++) { - if (!this._isSelected(series[i].name)) { - continue; - } - if (series[i].polarIndex == polarIndex - && this.deepQuery([series[i], this.option], 'tooltip.trigger') == 'axis' - ) { - showContent = this.query(series[i], 'tooltip.showContent') - || showContent; - formatter = this.query(series[i], 'tooltip.formatter') - || formatter; - position = this.query(series[i], 'tooltip.position') - || position; - specialCssText += this._style(this.query(series[i], 'tooltip')); - seriesArray.push(series[i]); - } - } - if (seriesArray.length > 0) { - var polarData; - var data; - var params = []; - - for (var i = 0, l = seriesArray.length; i < l; i++) { - polarData = seriesArray[i].data; - for (var j = 0, k = polarData.length; j < k; j++) { - data = polarData[j]; - if (!this._isSelected(data.name)) { - continue; - } - data = typeof data != 'undefined' - ? data - : {name:'', value: {dataIndex:'-'}}; - - params.push([ - seriesArray[i].name || '', - data.name, - typeof data.value[dataIndex].value != 'undefined' - ? data.value[dataIndex].value : data.value[dataIndex], - indicatorName - ]); - } - } - if (params.length <= 0) { - return; - } - if (typeof formatter == 'function') { - this._curTicket = 'axis:' + dataIndex; - this._tDom.innerHTML = formatter.call( - this.myChart, params, this._curTicket, this._setContent - ); - } - else if (typeof formatter == 'string') { - formatter = formatter.replace('{a}','{a0}') - .replace('{b}','{b0}') - .replace('{c}','{c0}') - .replace('{d}','{d0}'); - for (var i = 0, l = params.length; i < l; i++) { - formatter = formatter.replace( - '{a' + i + '}', - this._encodeHTML(params[i][0]) - ); - formatter = formatter.replace( - '{b' + i + '}', - this._encodeHTML(params[i][1]) - ); - formatter = formatter.replace( - '{c' + i + '}', - this.numAddCommas(params[i][2]) - ); - formatter = formatter.replace( - '{d' + i + '}', - this._encodeHTML(params[i][3]) - ); - } - this._tDom.innerHTML = formatter; - } - else { - formatter = this._encodeHTML(params[0][1]) + '
' - + this._encodeHTML(params[0][3]) + ' : ' - + this.numAddCommas(params[0][2]); - for (var i = 1, l = params.length; i < l; i++) { - formatter += '
' + this._encodeHTML(params[i][1]) - + '
'; - formatter += this._encodeHTML(params[i][3]) + ' : ' - + this.numAddCommas(params[i][2]); - } - this._tDom.innerHTML = formatter; - } - - if (showContent === false || !this.option.tooltip.showContent) { - // 只用tooltip的行为,不显示主体 - return; - } - - if (!this.hasAppend) { - this._tDom.style.left = this._zrWidth / 2 + 'px'; - this._tDom.style.top = this._zrHeight / 2 + 'px'; - this.dom.firstChild.appendChild(this._tDom); - this.hasAppend = true; - } - this._show( - position, - zrEvent.getX(this._event), - zrEvent.getY(this._event), - specialCssText - ); - return true; - } - }, - - _showItemTrigger : function () { - if (!this._curTarget) { - return; - } - var serie = ecData.get(this._curTarget, 'series'); - var data = ecData.get(this._curTarget, 'data'); - var name = ecData.get(this._curTarget, 'name'); - var value = ecData.get(this._curTarget, 'value'); - var special = ecData.get(this._curTarget, 'special'); - var special2 = ecData.get(this._curTarget, 'special2'); - // 从低优先级往上找到trigger为item的formatter和样式 - var formatter; - var position; - var showContent; - var specialCssText = ''; - var indicator; - var html = ''; - if (this._curTarget._type != 'island') { - // 全局 - if (this.option.tooltip.trigger == 'item') { - formatter = this.option.tooltip.formatter; - position = this.option.tooltip.position; - } - // 系列 - if (this.query(serie, 'tooltip.trigger') == 'item') { - showContent = this.query(serie, 'tooltip.showContent') - || showContent; - formatter = this.query(serie, 'tooltip.formatter') - || formatter; - position = this.query(serie, 'tooltip.position') - || position; - specialCssText += this._style(this.query(serie, 'tooltip')); - } - // 数据项 - showContent = this.query(data, 'tooltip.showContent') - || showContent; - formatter = this.query(data, 'tooltip.formatter') - || formatter; - position = this.query(data, 'tooltip.position') - || position; - specialCssText += this._style(this.query(data, 'tooltip')); - } - else { - showContent = this.deepQuery([data, serie, this.option], 'tooltip.showContent'); - formatter = this.deepQuery([data, serie, this.option], 'tooltip.islandFormatter'); - position = this.deepQuery([data, serie, this.option], 'tooltip.islandPosition'); - } - - if (typeof formatter == 'function') { - this._curTicket = (serie.name || '') - + ':' - + ecData.get(this._curTarget, 'dataIndex'); - this._tDom.innerHTML = formatter.call( - this.myChart, - [ - serie.name || '', - name, - value, - special, - special2, - data - ], - this._curTicket, - this._setContent - ); - } - else if (typeof formatter == 'string') { - this._curTicket = NaN; - formatter = formatter.replace('{a}','{a0}') - .replace('{b}','{b0}') - .replace('{c}','{c0}'); - formatter = formatter.replace('{a0}', this._encodeHTML(serie.name || '')) - .replace('{b0}', this._encodeHTML(name)) - .replace( - '{c0}', - value instanceof Array ? value : this.numAddCommas(value) - ); - - formatter = formatter.replace('{d}','{d0}') - .replace('{d0}', special || ''); - formatter = formatter.replace('{e}','{e0}') - .replace('{e0}', ecData.get(this._curTarget, 'special2') || ''); - - this._tDom.innerHTML = formatter; - } - else { - this._curTicket = NaN; - if (serie.type == ecConfig.CHART_TYPE_SCATTER) { - this._tDom.innerHTML = (typeof serie.name != 'undefined' - ? (this._encodeHTML(serie.name) + '
') - : '' - ) - + (name === '' ? '' : (this._encodeHTML(name) + ' : ')) - + value - + (typeof special == 'undefined' - ? '' : (' (' + special + ')') - ); - } - else if (serie.type == ecConfig.CHART_TYPE_RADAR && special) { - indicator = special; - html += this._encodeHTML(name === '' ? (serie.name || '') : name); - html += html === '' ? '' : '
'; - for (var i = 0 ; i < indicator.length; i ++) { - html += this._encodeHTML(indicator[i].text) + ' : ' - + this.numAddCommas(value[i]) + '
'; - } - this._tDom.innerHTML = html; - } - else if (serie.type == ecConfig.CHART_TYPE_CHORD) { - if (typeof special2 == 'undefined') { - // 外环上 - this._tDom.innerHTML = this._encodeHTML(name) + ' (' - + this.numAddCommas(value) + ')'; - } - else { - var name1 = this._encodeHTML(name); - var name2 = this._encodeHTML(special); - // 内部弦上 - this._tDom.innerHTML = (typeof serie.name != 'undefined' - ? (this._encodeHTML(serie.name) + '
') : '' - ) - + name1 + ' -> ' + name2 - + ' (' + this.numAddCommas(value) + ')' - + '
' - + name2 + ' -> ' + name1 - + ' (' + this.numAddCommas(special2) + ')'; - } - } - else { - this._tDom.innerHTML = (typeof serie.name != 'undefined' - ? (this._encodeHTML(serie.name) + '
') : '' - ) - + this._encodeHTML(name) + ' : ' - + this.numAddCommas(value) + - (typeof special == 'undefined' - ? '' : (' ('+ this.numAddCommas(special) +')') - ); - } - } - - if (!this._axisLineShape.invisible - || !this._axisShadowShape.invisible - ) { - this._axisLineShape.invisible = true; - this.zr.modShape(this._axisLineShape.id); - this._axisShadowShape.invisible = true; - this.zr.modShape(this._axisShadowShape.id); - this.zr.refresh(); - } - - if (showContent === false || !this.option.tooltip.showContent) { - // 只用tooltip的行为,不显示主体 - return; - } - - if (!this.hasAppend) { - this._tDom.style.left = this._zrWidth / 2 + 'px'; - this._tDom.style.top = this._zrHeight / 2 + 'px'; - this.dom.firstChild.appendChild(this._tDom); - this.hasAppend = true; - } - - this._show( - position, - zrEvent.getX(this._event) + 20, - zrEvent.getY(this._event) - 20, - specialCssText - ); - }, - - /** - * 设置坐标轴指示器样式 - */ - _styleAxisPointer : function (seriesArray, xStart, yStart, xEnd, yEnd, gap, x, y) { - if (seriesArray.length > 0) { - var queryTarget; - var curType; - var axisPointer = this.option.tooltip.axisPointer; - var pointType = axisPointer.type; - var style = { - line : {}, - cross : {}, - shadow : {} - }; - for (var pType in style) { - style[pType].color = axisPointer[pType + 'Style'].color; - style[pType].width = axisPointer[pType + 'Style'].width; - style[pType].type = axisPointer[pType + 'Style'].type; - } - for (var i = 0, l = seriesArray.length; i < l; i++) { - if (this.deepQuery( - [seriesArray[i], this.option], 'tooltip.trigger' - ) == 'axis' - ) { - queryTarget = seriesArray[i]; - curType = this.query(queryTarget, 'tooltip.axisPointer.type'); - pointType = curType || pointType; - if (curType) { - style[curType].color = this.query( - queryTarget, - 'tooltip.axisPointer.' + curType + 'Style.color' - ) || style[curType].color; - style[curType].width = this.query( - queryTarget, - 'tooltip.axisPointer.' + curType + 'Style.width' - ) || style[curType].width; - style[curType].type = this.query( - queryTarget, - 'tooltip.axisPointer.' + curType + 'Style.type' - ) || style[curType].type; - } - } - } - - if (pointType == 'line') { - this._axisLineShape.style = { - xStart : xStart, - yStart : yStart, - xEnd : xEnd, - yEnd : yEnd, - strokeColor : style.line.color, - lineWidth : style.line.width, - lineType : style.line.type - }; - this._axisLineShape.invisible = false; - this.zr.modShape(this._axisLineShape.id); - } - else if (pointType == 'cross') { - this._axisCrossShape.style = { - brushType: 'stroke', - rect : this.component.grid.getArea(), - x : x, - y : y, - text : ('( ' - + this.component.xAxis.getAxis(0).getValueFromCoord(x) - + ' , ' - + this.component.yAxis.getAxis(0).getValueFromCoord(y) - + ' )' - ).replace(' , ', ' ').replace(' , ', ' '), - textPosition : 'specific', - strokeColor : style.cross.color, - lineWidth : style.cross.width, - lineType : style.cross.type - }; - if (this.component.grid.getXend() - x > 100) { // 右侧有空间 - this._axisCrossShape.style.textAlign = 'left'; - this._axisCrossShape.style.textX = x + 10; - } - else { - this._axisCrossShape.style.textAlign = 'right'; - this._axisCrossShape.style.textX = x - 10; - } - if (y - this.component.grid.getY() > 50) { // 上方有空间 - this._axisCrossShape.style.textBaseline = 'bottom'; - this._axisCrossShape.style.textY = y - 10; - } - else { - this._axisCrossShape.style.textBaseline = 'top'; - this._axisCrossShape.style.textY = y + 10; - } - this._axisCrossShape.invisible = false; - this.zr.modShape(this._axisCrossShape.id); - } - else if (pointType == 'shadow') { - if (typeof style.shadow.width == 'undefined' - || style.shadow.width == 'auto' - || isNaN(style.shadow.width) - ) { - style.shadow.width = gap; - } - if (xStart == xEnd) { - // 纵向 - if (Math.abs(this.component.grid.getX() - xStart) < 2) { - // 最左边 - style.shadow.width /= 2; - xStart = xEnd = xEnd + style.shadow.width / 2; - } - else if (Math.abs(this.component.grid.getXend() - xStart) < 2) { - // 最右边 - style.shadow.width /= 2; - xStart = xEnd = xEnd - style.shadow.width / 2; - } - } - else if (yStart == yEnd) { - // 横向 - if (Math.abs(this.component.grid.getY() - yStart) < 2) { - // 最上边 - style.shadow.width /= 2; - yStart = yEnd = yEnd + style.shadow.width / 2; - } - else if (Math.abs(this.component.grid.getYend() - yStart) < 2) { - // 最右边 - style.shadow.width /= 2; - yStart = yEnd = yEnd - style.shadow.width / 2; - } - } - this._axisShadowShape.style = { - xStart : xStart, - yStart : yStart, - xEnd : xEnd, - yEnd : yEnd, - strokeColor : style.shadow.color, - lineWidth : style.shadow.width - }; - this._axisShadowShape.invisible = false; - this.zr.modShape(this._axisShadowShape.id); - } - this.zr.refresh(); - } - }, - - __onmousemove : function (param) { - clearTimeout(this._hidingTicket); - clearTimeout(this._showingTicket); - var target = param.target; - var mx = zrEvent.getX(param.event); - var my = zrEvent.getY(param.event); - if (!target) { - // 判断是否落到直角系里,axis触发的tooltip - this._curTarget = false; - this._event = param.event; - // this._event._target = this._event.target || this._event.toElement; - this._event.zrenderX = mx; - this._event.zrenderY = my; - if (this._needAxisTrigger - && this.component.grid - && zrArea.isInside(rectangleInstance, this.component.grid.getArea(), mx, my) - ) { - this._showingTicket = setTimeout(this._tryShow, this._showDelay); - } - else if (this._needAxisTrigger - && this.component.polar - && this.component.polar.isInside([mx, my]) != -1 - ) { - this._showingTicket = setTimeout(this._tryShow, this._showDelay); - } - else { - !this._event.connectTrigger && this.messageCenter.dispatch( - ecConfig.EVENT.TOOLTIP_OUT_GRID, - this._event, - null, - this.myChart - ); - this._hidingTicket = setTimeout(this._hide, this._hideDelay); - } - } - else { - this._curTarget = target; - this._event = param.event; - // this._event._target = this._event.target || this._event.toElement; - this._event.zrenderX = mx; - this._event.zrenderY = my; - var polarIndex; - if (this._needAxisTrigger - && this.component.polar - && (polarIndex = this.component.polar.isInside([mx, my])) != -1 - ) { - // 看用这个polar的系列数据是否是axis触发,如果是设置_curTarget为nul - var series = this.option.series; - for (var i = 0, l = series.length; i < l; i++) { - if (series[i].polarIndex == polarIndex - && this.deepQuery( - [series[i], this.option], 'tooltip.trigger' - ) == 'axis' - ) { - this._curTarget = null; - break; - } - } - - } - this._showingTicket = setTimeout(this._tryShow, this._showDelay); - } - }, - - /** - * zrender事件响应:鼠标离开绘图区域 - */ - __onglobalout : function () { - clearTimeout(this._hidingTicket); - clearTimeout(this._showingTicket); - this._hidingTicket = setTimeout(this._hide, this._hideDelay); - }, - - /** - * 异步回调填充内容 - */ - __setContent : function (ticket, content) { - if (!this._tDom) { - return; - } - if (ticket == this._curTicket) { - this._tDom.innerHTML = content; - } - - setTimeout(this._refixed, 20); - }, - - ontooltipHover : function (param, tipShape) { - if (!this._lastTipShape // 不存在或者存在但dataIndex发生变化才需要重绘 - || (this._lastTipShape && this._lastTipShape.dataIndex != param.dataIndex) - ) { - if (this._lastTipShape && this._lastTipShape.tipShape.length > 0) { - this.zr.delShape(this._lastTipShape.tipShape); - this.shapeList.length = 2; - } - for (var i = 0, l = tipShape.length; i < l; i++) { - tipShape[i].zlevel = this._zlevelBase; - tipShape[i].style = zrShapeBase.prototype.getHighlightStyle( - tipShape[i].style, - tipShape[i].highlightStyle - ); - tipShape[i].draggable = false; - tipShape[i].hoverable = false; - tipShape[i].clickable = false; - tipShape[i].ondragend = null; - tipShape[i].ondragover = null; - tipShape[i].ondrop = null; - this.shapeList.push(tipShape[i]); - this.zr.addShape(tipShape[i]); - } - this._lastTipShape = { - dataIndex : param.dataIndex, - tipShape : tipShape - }; - } - }, - - ondragend : function () { - this._hide(); - }, - - /** - * 图例选择 - */ - onlegendSelected : function (param) { - this._selectedMap = param.selected; - }, - - _setSelectedMap : function () { - if (this.component.legend) { - this._selectedMap = zrUtil.clone(this.component.legend.getSelectedMap()); - } - else { - this._selectedMap = {}; - } - }, - - _isSelected : function (itemName) { - if (typeof this._selectedMap[itemName] != 'undefined') { - return this._selectedMap[itemName]; - } - else { - return true; // 没在legend里定义的都为true啊~ - } - }, - - /** - * 模拟tooltip hover方法 - * {object} params 参数 - * {seriesIndex: 0, seriesName:'', dataInex:0} line、bar、scatter、k、radar - * {seriesIndex: 0, seriesName:'', name:''} map、pie、chord - */ - showTip : function (params) { - if (!params) { - return; - } - - var seriesIndex; - var series = this.option.series; - if (typeof params.seriesIndex != 'undefined') { - seriesIndex = params.seriesIndex; - } - else { - var seriesName = params.seriesName; - for (var i = 0, l = series.length; i < l; i++) { - if (series[i].name == seriesName) { - seriesIndex = i; - break; - } - } - } - - var serie = series[seriesIndex]; - if (typeof serie == 'undefined') { - return; - } - var chart = this.myChart.chart[serie.type]; - var isAxisTrigger = this.deepQuery( - [serie, this.option], 'tooltip.trigger' - ) == 'axis'; - - if (!chart) { - return; - } - - if (isAxisTrigger) { - // axis trigger - var dataIndex = params.dataIndex; - switch (chart.type) { - case ecConfig.CHART_TYPE_LINE : - case ecConfig.CHART_TYPE_BAR : - case ecConfig.CHART_TYPE_K : - if (typeof this.component.xAxis == 'undefined' - || typeof this.component.yAxis == 'undefined' - || serie.data.length <= dataIndex - ) { - return; - } - var xAxisIndex = serie.xAxisIndex || 0; - var yAxisIndex = serie.yAxisIndex || 0; - if (this.component.xAxis.getAxis(xAxisIndex).type - == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY - ) { - // 横轴是类目 - this._event = { - zrenderX : this.component.xAxis.getAxis(xAxisIndex) - .getCoordByIndex(dataIndex), - zrenderY : this.component.grid.getY() - + (this.component.grid.getYend() - - this.component.grid.getY() - ) / 4 - }; - } - else { - // 纵轴是类目 - this._event = { - zrenderX : this.component.grid.getX() - + (this.component.grid.getXend() - - this.component.grid.getX() - ) / 4, - zrenderY : this.component.yAxis.getAxis(yAxisIndex) - .getCoordByIndex(dataIndex) - }; - } - this._showAxisTrigger( - xAxisIndex, - yAxisIndex, - dataIndex - ); - break; - case ecConfig.CHART_TYPE_RADAR : - if (typeof this.component.polar == 'undefined' - || serie.data[0].value.length <= dataIndex - ) { - return; - } - var polarIndex = serie.polarIndex || 0; - var vector = this.component.polar.getVector( - polarIndex, dataIndex, 'max' - ); - this._event = { - zrenderX : vector[0], - zrenderY : vector[1] - }; - this._showPolarTrigger( - polarIndex, - dataIndex - ); - break; - } - } - else { - // item trigger - var shapeList = chart.shapeList; - var x; - var y; - switch (chart.type) { - case ecConfig.CHART_TYPE_LINE : - case ecConfig.CHART_TYPE_BAR : - case ecConfig.CHART_TYPE_K : - case ecConfig.CHART_TYPE_SCATTER : - var dataIndex = params.dataIndex; - for (var i = 0, l = shapeList.length; i < l; i++) { - if (ecData.get(shapeList[i], 'seriesIndex') == seriesIndex - && ecData.get(shapeList[i], 'dataIndex') == dataIndex - ) { - this._curTarget = shapeList[i]; - x = shapeList[i].style.x; - y = chart.type != ecConfig.CHART_TYPE_K - ? shapeList[i].style.y : shapeList[i].style.y[0]; - break; - } - } - break; - case ecConfig.CHART_TYPE_RADAR : - var dataIndex = params.dataIndex; - for (var i = 0, l = shapeList.length; i < l; i++) { - if (shapeList[i].type == 'polygon' - && ecData.get(shapeList[i], 'seriesIndex') == seriesIndex - && ecData.get(shapeList[i], 'dataIndex') == dataIndex - ) { - this._curTarget = shapeList[i]; - var vector = this.component.polar.getCenter( - serie.polarIndex || 0 - ); - x = vector[0]; - y = vector[1]; - break; - } - } - break; - case ecConfig.CHART_TYPE_PIE : - var name = params.name; - for (var i = 0, l = shapeList.length; i < l; i++) { - if (shapeList[i].type == 'sector' - && ecData.get(shapeList[i], 'seriesIndex') == seriesIndex - && ecData.get(shapeList[i], 'name') == name - ) { - this._curTarget = shapeList[i]; - var style = this._curTarget.style; - var midAngle = (style.startAngle + style.endAngle) - / 2 * Math.PI / 180; - x = this._curTarget.style.x + Math.cos(midAngle) * style.r / 1.5; - y = this._curTarget.style.y - Math.sin(midAngle) * style.r / 1.5; - break; - } - } - break; - case ecConfig.CHART_TYPE_MAP : - var name = params.name; - var mapType = serie.mapType; - for (var i = 0, l = shapeList.length; i < l; i++) { - if (shapeList[i].type == 'text' - && shapeList[i]._mapType == mapType - && shapeList[i].style._name == name - ) { - this._curTarget = shapeList[i]; - x = this._curTarget.style.x + this._curTarget.position[0]; - y = this._curTarget.style.y + this._curTarget.position[1]; - break; - } - } - break; - case ecConfig.CHART_TYPE_CHORD: - var name = params.name; - for (var i = 0, l = shapeList.length; i < l; i++) { - if (shapeList[i].type == 'sector' - && ecData.get(shapeList[i], 'name') == name - ) { - this._curTarget = shapeList[i]; - var style = this._curTarget.style; - var midAngle = (style.startAngle + style.endAngle) - / 2 * Math.PI / 180; - x = this._curTarget.style.x + Math.cos(midAngle) * (style.r - 2); - y = this._curTarget.style.y - Math.sin(midAngle) * (style.r - 2); - this.zr.trigger( - zrConfig.EVENT.MOUSEMOVE, - { - zrenderX : x, - zrenderY : y - } - ); - return; - } - } - break; - case ecConfig.CHART_TYPE_FORCE: - var name = params.name; - for (var i = 0, l = shapeList.length; i < l; i++) { - if (shapeList[i].type == 'circle' - && ecData.get(shapeList[i], 'name') == name - ) { - this._curTarget = shapeList[i]; - x = this._curTarget.position[0]; - y = this._curTarget.position[1]; - break; - } - } - break; - } - if (typeof x != 'undefined' && typeof y != 'undefined') { - this._event = { - zrenderX : x, - zrenderY : y - }; - this.zr.addHoverShape(this._curTarget); - this.zr.refreshHover(); - this._showItemTrigger(); - } - } - }, - - /** - * 关闭,公开接口 - */ - hideTip : function () { - this._hide(); - }, - - /** - * 刷新 - */ - refresh : function (newOption) { - // this._selectedMap; - // this._defaultCssText; // css样式缓存 - // this._needAxisTrigger; // 坐标轴触发 - // this._curTarget; - // this._event; - // this._curTicket; // 异步回调标识,用来区分多个请求 - - // 缓存一些高宽数据 - this._zrHeight = this.zr.getHeight(); - this._zrWidth = this.zr.getWidth(); - - if (this._lastTipShape && this._lastTipShape.tipShape.length > 0) { - this.zr.delShape(this._lastTipShape.tipShape); - } - this._lastTipShape = false; - this.shapeList.length = 2; - - if (newOption) { - this.option = newOption; - this.option.tooltip = this.reformOption(this.option.tooltip); - this.option.tooltip.textStyle = zrUtil.merge( - this.option.tooltip.textStyle, - this.ecTheme.textStyle - ); - // 补全padding属性 - this.option.tooltip.padding = this.reformCssArray( - this.option.tooltip.padding - ); - - this._needAxisTrigger = false; - if (this.option.tooltip.trigger == 'axis') { - this._needAxisTrigger = true; - } - - var series = this.option.series; - for (var i = 0, l = series.length; i < l; i++) { - if (this.query(series[i], 'tooltip.trigger') == 'axis') { - this._needAxisTrigger = true; - break; - } - } - // this._hidingTicket; - // this._showingTicket; - this._showDelay = this.option.tooltip.showDelay; // 显示延迟 - this._hideDelay = this.option.tooltip.hideDelay; // 隐藏延迟 - this._defaultCssText = this._style(this.option.tooltip); - - this._setSelectedMap(); - this._axisLineWidth = this.option.tooltip.axisPointer.lineStyle.width; - } - if (this.showing) { - this._tryShow(); - } - }, - - /** - * 释放后实例不可用,重载基类方法 - */ - dispose : function () { - if (this._lastTipShape && this._lastTipShape.tipShape.length > 0) { - this.zr.delShape(this._lastTipShape.tipShape); - } - this.clear(); - this.shapeList = null; - - clearTimeout(this._hidingTicket); - clearTimeout(this._showingTicket); - this.zr.un(zrConfig.EVENT.MOUSEMOVE, this._onmousemove); - this.zr.un(zrConfig.EVENT.GLOBALOUT, this._onglobalout); - - if (this.hasAppend) { - this.dom.firstChild.removeChild(this._tDom); - } - this._tDom = null; - }, - - /** - * html转码的方法 - */ - _encodeHTML : function (source) { - return String(source) - .replace(/&/g, '&') - .replace(//g, '>') - .replace(/"/g, '"') - .replace(/'/g, '''); - } - }; - - zrUtil.inherits(Tooltip, Base); - - require('../component').define('tooltip', Tooltip); - - return Tooltip; -}); -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:圆环 - * 可配图形属性: - { - // 基础属性 - shape : 'ring', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,圆心横坐标 - y : {number}, // 必须,圆心纵坐标 - r0 : {number}, // 必须,内圆半径 - r : {number}, // 必须,外圆半径 - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为outside,附加文本位置。 - // outside | inside - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'ring', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - r : 50, - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - 'zrender/shape/Ring',['require','./Base','../tool/util'],function (require) { - var Base = require('./Base'); - - function Ring(options) { - Base.call(this, options); - } - - Ring.prototype = { - type: 'ring', - - /** - * 创建圆环路径,依赖扇形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - // 非零环绕填充优化 - ctx.arc(style.x, style.y, style.r, 0, Math.PI * 2, false); - ctx.moveTo(style.x + style.r0, style.y); - ctx.arc(style.x, style.y, style.r0, 0, Math.PI * 2, true); - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function(style) { - if (style.__rect) { - return style.__rect; - } - - var lineWidth; - if (style.brushType == 'stroke' || style.brushType == 'fill') { - lineWidth = style.lineWidth || 1; - } - else { - lineWidth = 0; - } - style.__rect = { - x : Math.round(style.x - style.r - lineWidth / 2), - y : Math.round(style.y - style.r - lineWidth / 2), - width : style.r * 2 + lineWidth, - height : style.r * 2 + lineWidth - }; - - return style.__rect; - } - }; - - require('../tool/util').inherits(Ring, Base); - return Ring; - } -); -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:扇形 - * 可配图形属性: - { - // 基础属性 - shape : 'sector', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,圆心横坐标 - y : {number}, // 必须,圆心纵坐标 - r0 : {number}, // 默认为0,内圆半径,指定后将出现内弧,同时扇边长度 = r - r0 - r : {number}, // 必须,外圆半径 - startAngle : {number}, // 必须,起始角度[0, 360) - endAngle : {number}, // 必须,结束角度(0, 360] - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为outside,附加文本位置。 - // outside | inside - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'sector', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - r : 50, - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define( - 'zrender/shape/Sector',['require','../tool/math','./Base','./Ring','./Polygon','../tool/util'],function (require) { - var math = require('../tool/math'); - var Base = require('./Base'); - - function Sector(options) { - Base.call(this, options); - } - - Sector.prototype = { - type: 'sector', - - /** - * 创建扇形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - var x = style.x; // 圆心x - var y = style.y; // 圆心y - var r0 = typeof style.r0 == 'undefined' // 形内半径[0,r) - ? 0 : style.r0; - var r = style.r; // 扇形外半径(0,r] - var startAngle = style.startAngle; // 起始角度[0,360) - var endAngle = style.endAngle; // 结束角度(0,360] - - if (Math.abs(endAngle - startAngle) >= 360) { - // 大于360度的扇形简化为圆环画法 - ctx.arc(x, y, r, 0, Math.PI * 2, false); - if (r0 !== 0) { - ctx.moveTo(x + r0, y); - ctx.arc(x, y, r0, 0, Math.PI * 2, true); - } - return; - } - - startAngle = math.degreeToRadian(startAngle); - endAngle = math.degreeToRadian(endAngle); - - var PI2 = Math.PI * 2; - var cosStartAngle = math.cos(startAngle); - var sinStartAngle = math.sin(startAngle); - ctx.moveTo( - cosStartAngle * r0 + x, - y - sinStartAngle * r0 - ); - - ctx.lineTo( - cosStartAngle * r + x, - y - sinStartAngle * r - ); - - ctx.arc(x, y, r, PI2 - startAngle, PI2 - endAngle, true); - - ctx.lineTo( - math.cos(endAngle) * r0 + x, - y - math.sin(endAngle) * r0 - ); - - if (r0 !== 0) { - ctx.arc(x, y, r0, PI2 - endAngle, PI2 - startAngle, false); - } - - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function(style) { - if (style.__rect) { - return style.__rect; - } - - var x = style.x; // 圆心x - var y = style.y; // 圆心y - var r0 = typeof style.r0 == 'undefined' // 形内半径[0,r) - ? 0 : style.r0; - var r = style.r; // 扇形外半径(0,r] - var startAngle = style.startAngle; // 起始角度[0,360) - var endAngle = style.endAngle; // 结束角度(0,360] - - if (Math.abs(endAngle - startAngle) >= 360) { - // 大于360度的扇形简化为圆环bbox - style.__rect = require('./Ring').prototype.getRect(style); - return style.__rect; - } - - startAngle = (720 + startAngle) % 360; - endAngle = (720 + endAngle) % 360; - if (endAngle <= startAngle) { - endAngle += 360; - } - var pointList = []; - if (startAngle <= 90 && endAngle >= 90) { - pointList.push([ - x, y - r - ]); - } - if (startAngle <= 180 && endAngle >= 180) { - pointList.push([ - x - r, y - ]); - } - if (startAngle <= 270 && endAngle >= 270) { - pointList.push([ - x, y + r - ]); - } - if (startAngle <= 360 && endAngle >= 360) { - pointList.push([ - x + r, y - ]); - } - - startAngle = math.degreeToRadian(startAngle); - endAngle = math.degreeToRadian(endAngle); - - - pointList.push([ - math.cos(startAngle) * r0 + x, - y - math.sin(startAngle) * r0 - ]); - - pointList.push([ - math.cos(startAngle) * r + x, - y - math.sin(startAngle) * r - ]); - - pointList.push([ - math.cos(endAngle) * r + x, - y - math.sin(endAngle) * r - ]); - - pointList.push([ - math.cos(endAngle) * r0 + x, - y - math.sin(endAngle) * r0 - ]); - - style.__rect = require('./Polygon').prototype.getRect({ - brushType : style.brushType, - lineWidth : style.lineWidth, - pointList : pointList - }); - - return style.__rect; - } - }; - - - require('../tool/util').inherits(Sector, Base); - return Sector; - } -); -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:蜡烛 - * 可配图形属性: - { - // 基础属性 - shape : 'candle', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,横坐标 - y : {Array}, // 必须,纵坐标数组 - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'candle', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : [100,123,90,125], - width : 150, - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function (eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define('echarts/util/shape/Candle',['require','zrender/shape/Base','zrender/tool/util','./normalIsCover'],function (require) { - var Base = require('zrender/shape/Base'); - var zrUtil = require('zrender/tool/util'); - - function Candle(options) { - Base.call(this, options); - } - - Candle.prototype = { - type: 'candle', - _numberOrder : function (a, b) { - return b - a; - }, - - /** - * 创建矩形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function (ctx, style) { - var yList = zrUtil.clone(style.y).sort(this._numberOrder); - - ctx.moveTo(style.x, yList[3]); - ctx.lineTo(style.x, yList[2]); - ctx.moveTo(style.x - style.width / 2, yList[2]); - ctx.rect( - style.x - style.width / 2, - yList[2], - style.width, - yList[1] - yList[2] - ); - ctx.moveTo(style.x, yList[1]); - ctx.lineTo(style.x, yList[0]); - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function (style) { - if (!style.__rect) { - var lineWidth = 0; - if (style.brushType == 'stroke' || style.brushType == 'fill') { - lineWidth = style.lineWidth || 1; - } - - var yList = zrUtil.clone(style.y).sort(this._numberOrder); - style.__rect = { - x : Math.round(style.x - style.width / 2 - lineWidth / 2), - y : Math.round(yList[3] - lineWidth / 2), - width : style.width + lineWidth, - height : yList[0] - yList[3] + lineWidth - }; - } - - return style.__rect; - }, - - - isCover : require('./normalIsCover') - }; - - zrUtil.inherits(Candle, Base); - - return Candle; -}); - -/** - * echarts组件:图例 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/component/legend',['require','./base','zrender/shape/Text','zrender/shape/Rectangle','zrender/shape/Sector','../util/shape/Icon','../util/shape/Candle','../config','zrender/tool/util','zrender/tool/area','../component'],function (require) { - var Base = require('./base'); - - // 图形依赖 - var TextShape = require('zrender/shape/Text'); - var RectangleShape = require('zrender/shape/Rectangle'); - var SectorShape = require('zrender/shape/Sector'); - //var BeziercurveShape = require('zrender/shape/Beziercurve'); - var IconShape = require('../util/shape/Icon'); - var CandleShape = require('../util/shape/Candle'); - - var ecConfig = require('../config'); - var zrUtil = require('zrender/tool/util'); - var zrArea = require('zrender/tool/area'); - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} option 图表参数 - */ - function Legend(ecTheme, messageCenter, zr, option, myChart) { - if (!this.query(option, 'legend.data')) { - console.error('option.legend.data has not been defined.'); - return; - } - - Base.call(this, ecTheme, messageCenter, zr, option, myChart); - - var self = this; - self._legendSelected = function (param) { - self.__legendSelected(param); - }; - - this._colorIndex = 0; - this._colorMap = {}; - this._selectedMap = {}; - - this.refresh(option); - } - - Legend.prototype = { - type : ecConfig.COMPONENT_TYPE_LEGEND, - _buildShape : function () { - // 图例元素组的位置参数,通过计算所得x, y, width, height - this._itemGroupLocation = this._getItemGroupLocation(); - - this._buildBackground(); - this._buildItem(); - - for (var i = 0, l = this.shapeList.length; i < l; i++) { - this.zr.addShape(this.shapeList[i]); - } - }, - - /** - * 构建所有图例元素 - */ - _buildItem : function () { - var data = this.legendOption.data; - var dataLength = data.length; - var itemName; - var itemType; - var itemShape; - var textShape; - var textStyle = this.legendOption.textStyle; - var dataTextStyle; - var dataFont; - var formattedName; - - var zrWidth = this.zr.getWidth(); - var zrHeight = this.zr.getHeight(); - var lastX = this._itemGroupLocation.x; - var lastY = this._itemGroupLocation.y; - var itemWidth = this.legendOption.itemWidth; - var itemHeight = this.legendOption.itemHeight; - var itemGap = this.legendOption.itemGap; - var color; - - if (this.legendOption.orient == 'vertical' && this.legendOption.x == 'right') { - lastX = this._itemGroupLocation.x - + this._itemGroupLocation.width - - itemWidth; - } - - for (var i = 0; i < dataLength; i++) { - dataTextStyle = zrUtil.merge( - data[i].textStyle || {}, - textStyle - ); - dataFont = this.getFont(dataTextStyle); - - itemName = this._getName(data[i]); - formattedName = this._getFormatterName(itemName); - if (itemName === '') { - if (this.legendOption.orient == 'horizontal') { - lastX = this._itemGroupLocation.x; - lastY += itemHeight + itemGap; - } - else { - this.legendOption.x == 'right' - ? lastX -= this._itemGroupLocation.maxWidth + itemGap - : lastX += this._itemGroupLocation.maxWidth + itemGap; - lastY = this._itemGroupLocation.y; - } - continue; - } - itemType = data[i].icon || this._getSomethingByName(itemName).type; - - color = this.getColor(itemName); - - if (this.legendOption.orient == 'horizontal') { - if (zrWidth - lastX < 200 // 最后200px做分行预判 - && (itemWidth + 5 + zrArea.getTextWidth(formattedName, dataFont) - // 分行的最后一个不用算itemGap - + (i == dataLength - 1 || data[i+1] === '' ? 0 : itemGap) - ) >= zrWidth - lastX - ) { - lastX = this._itemGroupLocation.x; - lastY += itemHeight + itemGap; - } - } - else { - if (zrHeight - lastY < 200 // 最后200px做分行预判 - && (itemHeight - // 分行的最后一个不用算itemGap - + (i == dataLength - 1 || data[i+1] === '' ? 0 : itemGap) - ) >= zrHeight - lastY - ) { - this.legendOption.x == 'right' - ? lastX -= this._itemGroupLocation.maxWidth + itemGap - : lastX += this._itemGroupLocation.maxWidth + itemGap; - lastY = this._itemGroupLocation.y; - } - } - - // 图形 - itemShape = this._getItemShapeByType( - lastX, lastY, - itemWidth, itemHeight, - (this._selectedMap[itemName] ? color : '#ccc'), - itemType, - color - ); - itemShape._name = itemName; - itemShape = new IconShape(itemShape); - - // 文字 - textShape = { - // shape : 'text', - zlevel : this._zlevelBase, - style : { - x : lastX + itemWidth + 5, - y : lastY + itemHeight / 2, - color : this._selectedMap[itemName] - ? (dataTextStyle.color === 'auto' ? color : dataTextStyle.color) - : '#ccc', - text: formattedName, - textFont: dataFont, - textBaseline: 'middle' - }, - highlightStyle : { - color : color, - brushType: 'fill' - }, - hoverable : !!this.legendOption.selectedMode, - clickable : !!this.legendOption.selectedMode - }; - - if (this.legendOption.orient == 'vertical' - && this.legendOption.x == 'right' - ) { - textShape.style.x -= (itemWidth + 10); - textShape.style.textAlign = 'right'; - } - - textShape._name = itemName; - textShape = new TextShape(textShape); - - if (this.legendOption.selectedMode) { - itemShape.onclick = textShape.onclick = this._legendSelected; - itemShape.onmouseover = textShape.onmouseover = this.hoverConnect; - itemShape.hoverConnect = textShape.id; - textShape.hoverConnect = itemShape.id; - } - this.shapeList.push(itemShape); - this.shapeList.push(textShape); - - if (this.legendOption.orient == 'horizontal') { - lastX += itemWidth + 5 - + zrArea.getTextWidth(formattedName, dataFont) - + itemGap; - } - else { - lastY += itemHeight + itemGap; - } - } - - if (this.legendOption.orient == 'horizontal' - && this.legendOption.x == 'center' - && lastY != this._itemGroupLocation.y - ) { - // 多行橫排居中优化 - this._mLineOptimize(); - } - }, - - _getName : function(data) { - return typeof data.name != 'undefined' ? data.name : data; - }, - - _getFormatterName: function(itemName) { - var formatter = this.legendOption.formatter; - var formattedName; - if (typeof formatter == 'function') { - formattedName = formatter.call(this.myChart, itemName); - } - else if (typeof formatter == 'string') { - formattedName = formatter.replace('{name}', itemName); - } - else { - formattedName = itemName; - } - return formattedName; - }, - - _getFormatterNameFromData: function(data) { - var itemName = this._getName(data); - return this._getFormatterName(itemName); - }, - - // 多行橫排居中优化 - _mLineOptimize : function () { - var lineOffsetArray = []; // 每行宽度 - var lastX = this._itemGroupLocation.x; - for (var i = 2, l = this.shapeList.length; i < l; i++) { - if (this.shapeList[i].style.x == lastX) { - lineOffsetArray.push( - ( - this._itemGroupLocation.width - - ( - this.shapeList[i - 1].style.x - + zrArea.getTextWidth( - this.shapeList[i - 1].style.text, - this.shapeList[i - 1].style.textFont - ) - - lastX - ) - ) / 2 - ); - } - else if (i == l - 1) { - lineOffsetArray.push( - ( - this._itemGroupLocation.width - - ( - this.shapeList[i].style.x - + zrArea.getTextWidth( - this.shapeList[i].style.text, - this.shapeList[i].style.textFont - ) - - lastX - ) - ) / 2 - ); - } - } - var curLineIndex = -1; - for (var i = 1, l = this.shapeList.length; i < l; i++) { - if (this.shapeList[i].style.x == lastX) { - curLineIndex++; - } - if (lineOffsetArray[curLineIndex] === 0) { - continue; - } - else { - this.shapeList[i].style.x += lineOffsetArray[curLineIndex]; - } - } - }, - - _buildBackground : function () { - var pTop = this.legendOption.padding[0]; - var pRight = this.legendOption.padding[1]; - var pBottom = this.legendOption.padding[2]; - var pLeft = this.legendOption.padding[3]; - - this.shapeList.push(new RectangleShape({ - zlevel : this._zlevelBase, - hoverable :false, - style : { - x : this._itemGroupLocation.x - pLeft, - y : this._itemGroupLocation.y - pTop, - width : this._itemGroupLocation.width + pLeft + pRight, - height : this._itemGroupLocation.height + pTop + pBottom, - brushType : this.legendOption.borderWidth === 0 ? 'fill' : 'both', - color : this.legendOption.backgroundColor, - strokeColor : this.legendOption.borderColor, - lineWidth : this.legendOption.borderWidth - } - })); - }, - - /** - * 根据选项计算图例实体的位置坐标 - */ - _getItemGroupLocation : function () { - var data = this.legendOption.data; - var dataLength = data.length; - var itemGap = this.legendOption.itemGap; - var itemWidth = this.legendOption.itemWidth + 5; // 5px是图形和文字的间隔,不可配 - var itemHeight = this.legendOption.itemHeight; - var textStyle = this.legendOption.textStyle; - var font = this.getFont(textStyle); - var totalWidth = 0; - var totalHeight = 0; - var padding = this.legendOption.padding; - var zrWidth = this.zr.getWidth() - padding[1] - padding[3]; - var zrHeight = this.zr.getHeight() - padding[0] - padding[2]; - - var temp = 0; // 宽高计算,用于多行判断 - var maxWidth = 0; // 垂直布局有用 - if (this.legendOption.orient == 'horizontal') { - // 水平布局,计算总宽度 - totalHeight = itemHeight; - for (var i = 0; i < dataLength; i++) { - if (this._getName(data[i]) === '') { - temp -= itemGap; - if (temp > zrWidth) { - totalWidth = zrWidth; - totalHeight += itemHeight + itemGap; - } - else { - totalWidth = Math.max(totalWidth, temp); - } - totalHeight += itemHeight + itemGap; - temp = 0; - continue; - } - temp += itemWidth - + zrArea.getTextWidth( - this._getFormatterNameFromData(data[i]), - data[i].textStyle - ? this.getFont(zrUtil.merge( - data[i].textStyle || {}, - textStyle - )) - : font - ) - + itemGap; - } - totalHeight = Math.max(totalHeight, itemHeight); - temp -= itemGap; // 减去最后一个的itemGap - if (temp > zrWidth) { - totalWidth = zrWidth; - totalHeight += itemHeight + itemGap; - } else { - totalWidth = Math.max(totalWidth, temp); - } - } - else { - // 垂直布局,计算总高度 - for (var i = 0; i < dataLength; i++) { - maxWidth = Math.max( - maxWidth, - zrArea.getTextWidth( - this._getFormatterNameFromData(data[i]), - data[i].textStyle - ? this.getFont(zrUtil.merge( - data[i].textStyle || {}, - textStyle - )) - : font - ) - ); - } - maxWidth += itemWidth; - totalWidth = maxWidth; - for (var i = 0; i < dataLength; i++) { - if (this._getName(data[i]) === '') { - temp -= itemGap; - if (temp > zrHeight) { - totalHeight = zrHeight; - totalWidth += maxWidth + itemGap; - } - else { - totalHeight = Math.max(totalHeight, temp); - } - totalWidth += maxWidth + itemGap; - temp = 0; - continue; - } - temp += itemHeight + itemGap; - } - totalWidth = Math.max(totalWidth, maxWidth); - temp -= itemGap; // 减去最后一个的itemGap - if (temp > zrHeight) { - totalHeight = zrHeight; - totalWidth += maxWidth + itemGap; - } else { - totalHeight = Math.max(totalHeight, temp); - } - } - - zrWidth = this.zr.getWidth(); - zrHeight = this.zr.getHeight(); - var x; - switch (this.legendOption.x) { - case 'center' : - x = Math.floor((zrWidth - totalWidth) / 2); - break; - case 'left' : - x = this.legendOption.padding[3] + this.legendOption.borderWidth; - break; - case 'right' : - x = zrWidth - - totalWidth - - this.legendOption.padding[1] - - this.legendOption.padding[3] - - this.legendOption.borderWidth * 2; - break; - default : - x = this.parsePercent(this.legendOption.x, zrWidth); - break; - } - - var y; - switch (this.legendOption.y) { - case 'top' : - y = this.legendOption.padding[0] + this.legendOption.borderWidth; - break; - case 'bottom' : - y = zrHeight - - totalHeight - - this.legendOption.padding[0] - - this.legendOption.padding[2] - - this.legendOption.borderWidth * 2; - break; - case 'center' : - y = Math.floor((zrHeight - totalHeight) / 2); - break; - default : - y = this.parsePercent(this.legendOption.y, zrHeight); - break; - } - - return { - x : x, - y : y, - width : totalWidth, - height : totalHeight, - maxWidth : maxWidth - }; - }, - - /** - * 根据名称返回series数据或data - */ - _getSomethingByName : function (name) { - var series = this.option.series; - var data; - for (var i = 0, l = series.length; i < l; i++) { - if (series[i].name == name) { - // 系列名称优先 - return { - type : series[i].type, - series : series[i], - seriesIndex : i, - data : null, - dataIndex : -1 - }; - } - - if ( - series[i].type == ecConfig.CHART_TYPE_PIE - || series[i].type == ecConfig.CHART_TYPE_RADAR - || series[i].type == ecConfig.CHART_TYPE_CHORD - || series[i].type == ecConfig.CHART_TYPE_FORCE - || series[i].type == ecConfig.CHART_TYPE_FUNNEL - ) { - data = series[i].type != ecConfig.CHART_TYPE_FORCE - ? series[i].data // 饼图、雷达图、和弦图得查找里面的数据名字 - : series[i].categories; // 力导布局查找categories配置 - for (var j = 0, k = data.length; j < k; j++) { - if (data[j].name == name) { - return { - type : series[i].type, - series : series[i], - seriesIndex : i, - data : data[j], - dataIndex : j - }; - } - } - } - } - return { - type : 'bar', - series : null, - seriesIndex : -1, - data : null, - dataIndex : -1 - }; - }, - - _getItemShapeByType : function (x, y, width, height, color, itemType, defaultColor) { - var highlightColor = color === '#ccc' ? defaultColor : color; - var itemShape = { - zlevel : this._zlevelBase, - style : { - iconType : 'legendicon' + itemType, - x : x, - y : y, - width : width, - height : height, - color : color, - strokeColor : color, - lineWidth : 2 - }, - highlightStyle: { - color : highlightColor, - strokeColor : highlightColor, - lineWidth : 1 - }, - hoverable : this.legendOption.selectedMode, - clickable : this.legendOption.selectedMode - }; - - var imageLocation; - if (itemType.match('image')) { - var imageLocation = itemType.replace( - new RegExp('^image:\\/\\/'), '' - ); - itemType = 'image'; - } - // 特殊设置 - switch (itemType) { - case 'line' : - itemShape.style.brushType = 'stroke'; - itemShape.highlightStyle.lineWidth = 3; - break; - case 'radar' : - case 'scatter' : - itemShape.highlightStyle.lineWidth = 3; - break; - case 'k' : - itemShape.style.brushType = 'both'; - itemShape.highlightStyle.lineWidth = 3; - itemShape.highlightStyle.color = - itemShape.style.color = this.query(this.ecTheme, 'k.itemStyle.normal.color') - || '#fff'; - itemShape.style.strokeColor = color != '#ccc' - ? (this.query(this.ecTheme, 'k.itemStyle.normal.lineStyle.color') - || '#ff3200') - : color; - break; - case 'image' : - itemShape.style.iconType = 'image'; - itemShape.style.image = imageLocation; - if (color === '#ccc') { - itemShape.style.opacity = 0.5; - } - break; - } - return itemShape; - }, - - __legendSelected : function (param) { - var itemName = param.target._name; - if (this.legendOption.selectedMode === 'single') { - for (var k in this._selectedMap) { - this._selectedMap[k] = false; - } - } - this._selectedMap[itemName] = !this._selectedMap[itemName]; - this.messageCenter.dispatch( - ecConfig.EVENT.LEGEND_SELECTED, - param.event, - { - selected : this._selectedMap, - target : itemName - }, - this.myChart - ); - }, - - /** - * 刷新 - */ - refresh : function (newOption) { - if (newOption) { - this.option = newOption || this.option; - this.option.legend = this.reformOption(this.option.legend); - // 补全padding属性 - this.option.legend.padding = this.reformCssArray( - this.option.legend.padding - ); - this.legendOption = this.option.legend; - - var data = this.legendOption.data || []; - var itemName; - var something; - var color; - var queryTarget; - if (this.legendOption.selected) { - for (var k in this.legendOption.selected) { - this._selectedMap[k] = typeof this._selectedMap[k] != 'undefined' - ? this._selectedMap[k] - : this.legendOption.selected[k]; - } - } - for (var i = 0, dataLength = data.length; i < dataLength; i++) { - itemName = this._getName(data[i]); - if (itemName === '') { - continue; - } - something = this._getSomethingByName(itemName); - if (!something.series) { - this._selectedMap[itemName] = false; - } - else { - if (something.data - && (something.type == ecConfig.CHART_TYPE_PIE - || something.type == ecConfig.CHART_TYPE_FORCE - || something.type == ecConfig.CHART_TYPE_FUNNEL) - ) { - queryTarget = [something.data, something.series]; - } - else { - queryTarget = [something.series]; - } - - color = this.getItemStyleColor( - this.deepQuery(queryTarget, 'itemStyle.normal.color'), - something.seriesIndex, - something.dataIndex, - something.data - ); - if (color && something.type != ecConfig.CHART_TYPE_K) { - this.setColor(itemName, color); - } - this._selectedMap[itemName] = - typeof this._selectedMap[itemName] != 'undefined' - ? this._selectedMap[itemName] : true; - } - } - } - this.clear(); - this._buildShape(); - }, - - getRelatedAmount : function(name) { - var amount = 0; - var series = this.option.series; - var data; - for (var i = 0, l = series.length; i < l; i++) { - if (series[i].name == name) { - // 系列名称优先 - amount++; - } - - if ( - series[i].type == ecConfig.CHART_TYPE_PIE - || series[i].type == ecConfig.CHART_TYPE_RADAR - || series[i].type == ecConfig.CHART_TYPE_CHORD - || series[i].type == ecConfig.CHART_TYPE_FORCE - || series[i].type == ecConfig.CHART_TYPE_FUNNEL - ) { - data = series[i].type != ecConfig.CHART_TYPE_FORCE - ? series[i].data // 饼图、雷达图、和弦图得查找里面的数据名字 - : series[i].categories; // 力导布局查找categories配置 - for (var j = 0, k = data.length; j < k; j++) { - if (data[j].name == name && data[j].value != '-') { - amount++; - } - } - } - } - return amount; - }, - - setColor : function (legendName, color) { - this._colorMap[legendName] = color; - }, - - getColor : function (legendName) { - if (!this._colorMap[legendName]) { - this._colorMap[legendName] = this.zr.getColor(this._colorIndex++); - } - return this._colorMap[legendName]; - }, - - hasColor : function (legendName) { - return this._colorMap[legendName] ? this._colorMap[legendName] : false; - }, - - add : function (name, color){ - var data = this.legendOption.data; - for (var i = 0, dataLength = data.length; i < dataLength; i++) { - if (this._getName(data[i]) == name) { - // 已有就不重复加了 - return; - } - } - this.legendOption.data.push(name); - this.setColor(name,color); - this._selectedMap[name] = true; - }, - - del : function (name){ - var data = this.legendOption.data; - for (var i = 0, dataLength = data.length; i < dataLength; i++) { - if (this._getName(data[i]) == name) { - return this.legendOption.data.splice(i, 1); - } - } - }, - - /** - * 特殊图形元素回调设置 - * @param {Object} name - * @param {Object} itemShape - */ - getItemShape : function (name) { - if (typeof name == 'undefined') { - return; - } - var shape; - for (var i = 0, l = this.shapeList.length; i < l; i++) { - shape = this.shapeList[i]; - if (shape._name == name && shape.type != 'text') { - return shape; - } - } - }, - - /** - * 特殊图形元素回调设置 - * @param {Object} name - * @param {Object} itemShape - */ - setItemShape : function (name, itemShape) { - var shape; - for (var i = 0, l = this.shapeList.length; i < l; i++) { - shape = this.shapeList[i]; - if (shape._name == name && shape.type != 'text') { - if (!this._selectedMap[name]) { - itemShape.style.color = '#ccc'; - itemShape.style.strokeColor = '#ccc'; - } - this.zr.modShape(shape.id, itemShape); - } - } - }, - - isSelected : function (itemName) { - if (typeof this._selectedMap[itemName] != 'undefined') { - return this._selectedMap[itemName]; - } - else { - // 没在legend里定义的都为true啊~ - return true; - } - }, - - getSelectedMap : function () { - return this._selectedMap; - }, - - setSelected : function(itemName, selectStatus) { - if (this.legendOption.selectedMode === 'single') { - for (var k in this._selectedMap) { - this._selectedMap[k] = false; - } - } - this._selectedMap[itemName] = selectStatus; - this.messageCenter.dispatch( - ecConfig.EVENT.LEGEND_SELECTED, - null, - { - selected : this._selectedMap, - target : itemName - }, - this.myChart - ); - }, - - /** - * 图例选择 - */ - onlegendSelected : function (param, status) { - var legendSelected = param.selected; - for (var itemName in legendSelected) { - if (this._selectedMap[itemName] != legendSelected[itemName]) { - // 有一项不一致都需要重绘 - status.needRefresh = true; - } - this._selectedMap[itemName] = legendSelected[itemName]; - } - return; - } - }; - - var legendIcon = { - line : function (ctx, style) { - var dy = style.height / 2; - ctx.moveTo(style.x, style.y + dy); - ctx.lineTo(style.x + style.width,style.y + dy); - }, - - pie : function (ctx, style) { - var x = style.x; - var y = style.y; - var width = style.width; - var height = style.height; - SectorShape.prototype.buildPath(ctx, { - x : x + width / 2, - y : y + height + 2, - r : height + 2, - r0 : 6, - startAngle : 45, - endAngle : 135 - }); - }, - /* - chord : function (ctx, style) { - var x = style.x; - var y = style.y; - var width = style.width; - var height = style.height; - ctx.moveTo(x, y + height); - BeziercurveShape.prototype.buildPath(ctx, { - xStart : x, - yStart : y + height, - cpX1 : x + width, - cpY1 : y + height, - cpX2 : x, - cpY2 : y + 4, - xEnd : x + width, - yEnd : y + 4 - }); - ctx.lineTo(x + width, y); - BeziercurveShape.prototype.buildPath(ctx, { - xStart : x + width, - yStart : y, - cpX1 : x, - cpY1 : y, - cpX2 : x + width, - cpY2 : y + height - 4, - xEnd : x, - yEnd : y + height - 4 - }); - ctx.lineTo(x, y + height); - }, - */ - k : function (ctx, style) { - var x = style.x; - var y = style.y; - var width = style.width; - var height = style.height; - CandleShape.prototype.buildPath(ctx, { - x : x + width / 2, - y : [y + 1, y + 1, y + height - 6, y + height], - width : width - 6 - }); - }, - - bar : function (ctx, style) { - var x = style.x; - var y = style.y +1; - var width = style.width; - var height = style.height - 2; - var r = 3; - - ctx.moveTo(x + r, y); - ctx.lineTo(x + width - r, y); - ctx.quadraticCurveTo( - x + width, y, x + width, y + r - ); - ctx.lineTo(x + width, y + height - r); - ctx.quadraticCurveTo( - x + width, y + height, x + width - r, y + height - ); - ctx.lineTo(x + r, y + height); - ctx.quadraticCurveTo( - x, y + height, x, y + height - r - ); - ctx.lineTo(x, y + r); - ctx.quadraticCurveTo(x, y, x + r, y); - }, - - force : function (ctx, style) { - IconShape.prototype.iconLibrary.circle(ctx, style); - }, - - radar: function (ctx, style) { - var n = 6; - var x = style.x + style.width / 2; - var y = style.y + style.height / 2; - var r = style.height / 2; - - var dStep = 2 * Math.PI / n; - var deg = -Math.PI / 2; - var xStart = x + r * Math.cos(deg); - var yStart = y + r * Math.sin(deg); - - ctx.moveTo(xStart, yStart); - deg += dStep; - for (var i = 0, end = n - 1; i < end; i ++) { - ctx.lineTo(x + r * Math.cos(deg), y + r * Math.sin(deg)); - deg += dStep; - } - ctx.lineTo(xStart, yStart); - } - }; - legendIcon.chord = legendIcon.pie; - legendIcon.map = legendIcon.bar; - - for (var k in legendIcon) { - IconShape.prototype.iconLibrary['legendicon' + k] = legendIcon[k]; - } - - zrUtil.inherits(Legend, Base); - - require('../component').define('legend', Legend); - - return Legend; -}); - - - -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:时间轴线 - */ -define('echarts/util/shape/Chain',['require','zrender/shape/Base','./Icon','zrender/shape/util/dashedLineTo','zrender/tool/util','zrender/tool/matrix'],function (require) { - var Base = require('zrender/shape/Base'); - var IconShape = require('./Icon'); - - var dashedLineTo = require('zrender/shape/util/dashedLineTo'); - var zrUtil = require('zrender/tool/util'); - var matrix = require('zrender/tool/matrix'); - - function Chain(options) { - Base.call(this, options); - } - - Chain.prototype = { - type : 'chain', - - /** - * 画刷 - * @param ctx 画布句柄 - * @param e 形状实体 - * @param isHighlight 是否为高亮状态 - * @param updateCallback 需要异步加载资源的shape可以通过这个callback(e) - * 让painter更新视图,base.brush没用,需要的话重载brush - */ - brush : function (ctx, isHighlight) { - var style = this.style; - - if (isHighlight) { - // 根据style扩展默认高亮样式 - style = this.getHighlightStyle( - style, - this.highlightStyle || {} - ); - } - - ctx.save(); - this.setContext(ctx, style); - - // 设置transform - this.setTransform(ctx); - - ctx.beginPath(); - this.buildLinePath(ctx, style); - ctx.stroke(); - - this.brushSymbol(ctx, style); - - ctx.restore(); - return; - }, - - /** - * 创建线条路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildLinePath : function (ctx, style) { - var x = style.x; - var y = style.y + 5; - var width = style.width; - var height = style.height / 2 - 10; - - ctx.moveTo(x, y); - ctx.lineTo(x, y + height); - ctx.moveTo(x + width, y); - ctx.lineTo(x + width, y + height); - - ctx.moveTo(x, y + height / 2); - if (!style.lineType || style.lineType == 'solid') { - ctx.lineTo(x + width, y + height / 2); - } - else if (style.lineType == 'dashed' || style.lineType == 'dotted') { - var dashLength = (style.lineWidth || 1) - * (style.lineType == 'dashed' ? 5 : 1); - dashedLineTo(ctx, x, y + height / 2, x + width, y + height / 2, dashLength); - } - }, - - /** - * 标线始末标注 - */ - brushSymbol : function (ctx, style) { - var y = style.y + style.height / 4; - ctx.save(); - - var chainPoint = style.chainPoint; - var curPoint; - for (var idx = 0, l = chainPoint.length; idx < l; idx++) { - curPoint = chainPoint[idx]; - if (curPoint.symbol != 'none') { - ctx.beginPath(); - var symbolSize = curPoint.symbolSize; - IconShape.prototype.buildPath( - ctx, - { - iconType : curPoint.symbol, - x : curPoint.x - symbolSize, - y : y - symbolSize, - width : symbolSize * 2, - height : symbolSize * 2, - n : curPoint.n - } - ); - ctx.fillStyle = curPoint.isEmpty ? '#fff' : style.strokeColor; - ctx.closePath(); - ctx.fill(); - ctx.stroke(); - } - - if (curPoint.showLabel) { - ctx.font = curPoint.textFont; - ctx.fillStyle = curPoint.textColor; - ctx.textAlign = curPoint.textAlign; - ctx.textBaseline = curPoint.textBaseline; - if (curPoint.rotation) { - ctx.save(); - this._updateTextTransform(ctx, curPoint.rotation); - ctx.fillText(curPoint.name, curPoint.textX, curPoint.textY); - ctx.restore(); - } - else { - ctx.fillText(curPoint.name, curPoint.textX, curPoint.textY); - } - } - } - - ctx.restore(); - }, - - _updateTextTransform : function (ctx, rotation) { - var _transform = matrix.create(); - matrix.identity(_transform); - - if (rotation[0] !== 0) { - var originX = rotation[1] || 0; - var originY = rotation[2] || 0; - if (originX || originY) { - matrix.translate( - _transform, _transform, [-originX, -originY] - ); - } - matrix.rotate(_transform, _transform, rotation[0]); - if (originX || originY) { - matrix.translate( - _transform, _transform, [originX, originY] - ); - } - } - - // 保存这个变换矩阵 - ctx.transform.apply(ctx, _transform); - }, - - isCover : function (x, y) { - var rect = this.style; - if (x >= rect.x - && x <= (rect.x + rect.width) - && y >= rect.y - && y <= (rect.y + rect.height) - ) { - // 矩形内 - return true; - } - else { - return false; - } - } - }; - - zrUtil.inherits(Chain, Base); - - return Chain; -}); - -/** - * echarts组件:时间轴组件 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle','../util/shape/Icon','../util/shape/Chain','../config','zrender/tool/util','zrender/tool/area','zrender/tool/event','../component'],function (require) { - var Base = require('./base'); - - // 图形依赖 - var RectangleShape = require('zrender/shape/Rectangle'); - var IconShape = require('../util/shape/Icon'); - var ChainShape = require('../util/shape/Chain'); - - var ecConfig = require('../config'); - var zrUtil = require('zrender/tool/util'); - var zrArea = require('zrender/tool/area'); - var zrEvent = require('zrender/tool/event'); - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} option 图表参数 - */ - function Timeline(ecTheme, messageCenter, zr, option, myChart) { - Base.call(this, ecTheme, messageCenter, zr, option, myChart); - - var self = this; - self._onclick = function(param) { - return self.__onclick(param); - }; - self._ondrift = function (dx, dy) { - return self.__ondrift(this, dx, dy); - }; - self._ondragend = function () { - return self.__ondragend(); - }; - self._setCurrentOption = function() { - var timelineOption = self.timelineOption; - self.currentIndex %= timelineOption.data.length; - // console.log(self.currentIndex); - var curOption = self.options[self.currentIndex] || {}; - self.myChart.setOption(curOption, timelineOption.notMerge); - - self.messageCenter.dispatch( - ecConfig.EVENT.TIMELINE_CHANGED, - null, - { - currentIndex: self.currentIndex, - data : typeof timelineOption.data[self.currentIndex].name != 'undefined' - ? timelineOption.data[self.currentIndex].name - : timelineOption.data[self.currentIndex] - }, - self.myChart - ); - }; - self._onFrame = function() { - self._setCurrentOption(); - self._syncHandleShape(); - - if (self.timelineOption.autoPlay) { - self.playTicket = setTimeout( - function() { - self.currentIndex += 1; - if (!self.timelineOption.loop - && self.currentIndex >= self.timelineOption.data.length - ) { - self.currentIndex = self.timelineOption.data.length - 1; - self.stop(); - return; - } - self._onFrame(); - }, - self.timelineOption.playInterval - ); - } - }; - - this.setTheme(false); - this.options = this.option.options; - this.currentIndex = this.timelineOption.currentIndex % this.timelineOption.data.length; - - if (!this.timelineOption.notMerge && this.currentIndex !== 0) { - /* - for (var i = 1, l = this.timelineOption.data.length; i < l; i++) { - this.options[i] = zrUtil.merge( - this.options[i], this.options[i - 1] - ); - } - */ - this.options[this.currentIndex] = zrUtil.merge( - this.options[this.currentIndex], this.options[0] - ); - } - - if (this.timelineOption.show) { - this._buildShape(); - this._syncHandleShape(); - } - - this._setCurrentOption(); - - if (this.timelineOption.autoPlay) { - var self = this; - this.playTicket = setTimeout( - function() { - self.play(); - }, - this.ecTheme.animationDuration - ); - } - } - - Timeline.prototype = { - type : ecConfig.COMPONENT_TYPE_TIMELINE, - _buildShape : function () { - // 位置参数,通过计算所得x, y, width, height - this._location = this._getLocation(); - this._buildBackground(); - this._buildControl(); - this._chainPoint = this._getChainPoint(); - if (this.timelineOption.label.show) { - // 标签显示的挑选间隔 - var interval = this._getInterval(); - for (var i = 0, len = this._chainPoint.length; i < len; i += interval) { - this._chainPoint[i].showLabel = true; - } - } - this._buildChain(); - this._buildHandle(); - - for (var i = 0, l = this.shapeList.length; i < l; i++) { - this.zr.addShape(this.shapeList[i]); - } - }, - - /** - * 根据选项计算实体的位置坐标 - */ - _getLocation : function () { - var timelineOption = this.timelineOption; - var padding = timelineOption.padding; - - // 水平布局 - var zrWidth = this.zr.getWidth(); - var x = this.parsePercent(timelineOption.x, zrWidth); - var x2 = this.parsePercent(timelineOption.x2, zrWidth); - var width; - if (typeof timelineOption.width == 'undefined') { - width = zrWidth - x - x2; - x2 = zrWidth - x2; - } - else { - width = this.parsePercent(timelineOption.width, zrWidth); - x2 = x + width; - } - - var zrHeight = this.zr.getHeight(); - var height = this.parsePercent(timelineOption.height, zrHeight); - var y; - var y2; - if (typeof timelineOption.y != 'undefined') { - y = this.parsePercent(timelineOption.y, zrHeight); - y2 = y + height; - } - else { - y2 = zrHeight - this.parsePercent(timelineOption.y2, zrHeight); - y = y2 - height; - } - - return { - x : x + padding[3], - y : y + padding[0], - x2 : x2 - padding[1], - y2 : y2 - padding[2], - width : width - padding[1] - padding[3], - height : height - padding[0] - padding[2] - }; - }, - - _getReformedLabel : function (idx) { - var timelineOption = this.timelineOption; - var data = typeof timelineOption.data[idx].name != 'undefined' - ? timelineOption.data[idx].name - : timelineOption.data[idx]; - var formatter = timelineOption.data[idx].formatter - || timelineOption.label.formatter; - if (formatter) { - if (typeof formatter == 'function') { - data = formatter.call(this.myChart, data); - } - else if (typeof formatter == 'string') { - data = formatter.replace('{value}', data); - } - } - return data; - }, - - /** - * 计算标签显示挑选间隔 - */ - _getInterval : function () { - var chainPoint = this._chainPoint; - var timelineOption = this.timelineOption; - var interval = timelineOption.label.interval; - if (interval == 'auto') { - // 麻烦的自适应计算 - var fontSize = timelineOption.label.textStyle.fontSize; - var data = timelineOption.data; - var dataLength = timelineOption.data.length; - - // 横向 - if (dataLength > 3) { - var isEnough = false; - var labelSpace; - var labelSize; - interval = 0; - while (!isEnough && interval < dataLength) { - interval++; - isEnough = true; - for (var i = interval; i < dataLength; i += interval) { - labelSpace = chainPoint[i].x - chainPoint[i - interval].x; - if (timelineOption.label.rotate !== 0) { - // 有旋转 - labelSize = fontSize; - } - else if (data[i].textStyle) { - labelSize = zrArea.getTextWidth( - chainPoint[i].name, - chainPoint[i].textFont - ); - } - else { - // 不定义data级特殊文本样式,用fontSize优化getTextWidth - var label = chainPoint[i].name + ''; - var wLen = (label.match(/\w/g) || '').length; - var oLen = label.length - wLen; - labelSize = wLen * fontSize * 2 / 3 + oLen * fontSize; - } - - if (labelSpace < labelSize) { - // 放不下,中断循环让interval++ - isEnough = false; - break; - } - } - } - } - else { - // 少于3个则全部显示 - interval = 1; - } - } - else { - // 用户自定义间隔 - interval = interval - 0 + 1; - } - - return interval; - }, - - /** - * 根据选项计算时间链条上的坐标及symbolList - */ - _getChainPoint : function() { - var timelineOption = this.timelineOption; - var symbol = timelineOption.symbol.toLowerCase(); - var symbolSize = timelineOption.symbolSize; - var rotate = timelineOption.label.rotate; - var textStyle = timelineOption.label.textStyle; - var textFont = this.getFont(textStyle); - var dataTextStyle; - var data = timelineOption.data; - var x = this._location.x; - var y = this._location.y + this._location.height / 4 * 3; - var width = this._location.x2 - this._location.x; - var len = data.length; - - function _getName(i) { - return typeof data[i].name != 'undefined' ? data[i].name : data[i]; - } - var xList = []; - if (len > 1) { - var boundaryGap = width / len; - boundaryGap = boundaryGap > 50 ? 50 : (boundaryGap < 20 ? 5 : boundaryGap); - width -= boundaryGap * 2; - if (timelineOption.type == 'number') { - // 平均分布 - for (var i = 0; i < len; i++) { - xList.push(x + boundaryGap + width / (len - 1) * i); - } - } - else { - // 时间比例 - xList[0] = new Date(_getName(0).replace(/-/g, '/')); - xList[len - 1] = new Date(_getName(len - 1).replace(/-/g, '/')) - xList[0]; - for (var i = 1; i < len; i++) { - xList[i] = x + boundaryGap - + width - * (new Date(_getName(i).replace(/-/g, '/')) - xList[0]) - / xList[len - 1]; - } - xList[0] = x + boundaryGap; - } - } - else { - xList.push(x + width / 2); - } - - var list = []; - var curSymbol; - var n; - var isEmpty; - var textAlign; - var rotation; - for (var i = 0; i < len; i++) { - x = xList[i]; - curSymbol = (data[i].symbol && data[i].symbol.toLowerCase()) || symbol; - if (curSymbol.match('empty')) { - curSymbol = curSymbol.replace('empty', ''); - isEmpty = true; - } - else { - isEmpty = false; - } - if (curSymbol.match('star')) { - n = (curSymbol.replace('star','') - 0) || 5; - curSymbol = 'star'; - } - - dataTextStyle = data[i].textStyle - ? zrUtil.merge(data[i].textStyle || {}, textStyle) - : textStyle; - - textAlign = dataTextStyle.align || 'center'; - - if (rotate) { - textAlign = rotate > 0 ? 'right' : 'left'; - rotation = [rotate * Math.PI / 180, x, y - 5]; - } - else { - rotation = false; - } - - list.push({ - x : x, - n : n, - isEmpty : isEmpty, - symbol : curSymbol, - symbolSize : data[i].symbolSize || symbolSize, - color : data[i].color, - borderColor : data[i].borderColor, - borderWidth : data[i].borderWidth, - name : this._getReformedLabel(i), - textColor : dataTextStyle.color, - textAlign : textAlign, - textBaseline : dataTextStyle.baseline || 'middle', - textX : x, - textY : y - (rotate ? 5 : 0), - textFont : data[i].textStyle ? this.getFont(dataTextStyle) : textFont, - rotation : rotation, - showLabel : false - }); - } - - return list; - }, - - _buildBackground : function () { - var timelineOption = this.timelineOption; - var padding = timelineOption.padding; - var width = this._location.width; - var height = this._location.height; - - if (timelineOption.borderWidth !== 0 - || timelineOption.backgroundColor.replace(/\s/g,'') != 'rgba(0,0,0,0)' - ) { - // 背景 - this.shapeList.push(new RectangleShape({ - zlevel : this._zlevelBase, - hoverable :false, - style : { - x : this._location.x - padding[3], - y : this._location.y - padding[0], - width : width + padding[1] + padding[3], - height : height + padding[0] + padding[2], - brushType : timelineOption.borderWidth === 0 - ? 'fill' : 'both', - color : timelineOption.backgroundColor, - strokeColor : timelineOption.borderColor, - lineWidth : timelineOption.borderWidth - } - })); - } - }, - - _buildControl : function() { - var self = this; - var timelineOption = this.timelineOption; - var lineStyle = timelineOption.lineStyle; - var controlStyle = timelineOption.controlStyle; - if (timelineOption.controlPosition == 'none') { - return; - } - var iconSize = 15; - var iconGap = 5; - var x; - if (timelineOption.controlPosition == 'left') { - x = this._location.x; - this._location.x += (iconSize + iconGap) * 3; - } - else { - x = this._location.x2 - ((iconSize + iconGap) * 3 - iconGap); - this._location.x2 -= (iconSize + iconGap) * 3; - } - - var y = this._location.y; - var iconStyle = { - zlevel : this._zlevelBase + 1, - style : { - iconType : 'timelineControl', - symbol : 'last', - x : x, - y : y, - width : iconSize, - height : iconSize, - brushType : 'stroke', - color: controlStyle.normal.color, - strokeColor : controlStyle.normal.color, - lineWidth : lineStyle.width - }, - highlightStyle : { - color : controlStyle.emphasis.color, - strokeColor : controlStyle.emphasis.color, - lineWidth : lineStyle.width + 1 - }, - clickable : true - }; - - this._ctrLastShape = new IconShape(iconStyle); - this._ctrLastShape.onclick = function() { - self.last(); - }; - this.shapeList.push(this._ctrLastShape); - - x += iconSize + iconGap; - this._ctrPlayShape = new IconShape(zrUtil.clone(iconStyle)); - this._ctrPlayShape.style.brushType = 'fill'; - this._ctrPlayShape.style.symbol = 'play'; - this._ctrPlayShape.style.status = this.timelineOption.autoPlay ? 'playing' : 'stop'; - this._ctrPlayShape.style.x = x; - this._ctrPlayShape.onclick = function() { - if (self._ctrPlayShape.style.status == 'stop') { - self.play(); - } - else { - self.stop(); - } - }; - this.shapeList.push(this._ctrPlayShape); - - x += iconSize + iconGap; - this._ctrNextShape = new IconShape(zrUtil.clone(iconStyle)); - this._ctrNextShape.style.symbol = 'next'; - this._ctrNextShape.style.x = x; - this._ctrNextShape.onclick = function() { - self.next(); - }; - this.shapeList.push(this._ctrNextShape); - }, - - /** - * 构建时间轴 - */ - _buildChain : function () { - var timelineOption = this.timelineOption; - var lineStyle = timelineOption.lineStyle; - this._timelineShae = { - zlevel : this._zlevelBase, - style : { - x : this._location.x, - y : this.subPixelOptimize(this._location.y, lineStyle.width), - width : this._location.x2 - this._location.x, - height : this._location.height, - chainPoint : this._chainPoint, - brushType:'both', - strokeColor : lineStyle.color, - lineWidth : lineStyle.width, - lineType : lineStyle.type - }, - hoverable : false, - clickable : true, - onclick : this._onclick - }; - - this._timelineShae = new ChainShape(this._timelineShae); - this.shapeList.push(this._timelineShae); - }, - - /** - * 构建拖拽手柄 - */ - _buildHandle : function () { - var curPoint = this._chainPoint[this.currentIndex]; - var symbolSize = curPoint.symbolSize + 1; - symbolSize = symbolSize < 5 ? 5 : symbolSize; - - this._handleShape = { - zlevel : this._zlevelBase + 1, - hoverable : false, - draggable : true, - style : { - iconType : 'diamond', - n : curPoint.n, - x : curPoint.x - symbolSize, - y : this._location.y + this._location.height / 4 - symbolSize, - width : symbolSize * 2, - height : symbolSize * 2, - brushType:'both', - textPosition : 'specific', - textX : curPoint.x, - textY : this._location.y - this._location.height / 4, - textAlign : 'center', - textBaseline : 'middle' - }, - highlightStyle : {}, - ondrift : this._ondrift, - ondragend : this._ondragend - }; - - this._handleShape = new IconShape(this._handleShape); - this.shapeList.push(this._handleShape); - }, - - /** - * 同步拖拽图形样式 - */ - _syncHandleShape : function() { - if (!this.timelineOption.show) { - return; - } - - var timelineOption = this.timelineOption; - var cpStyle = timelineOption.checkpointStyle; - var curPoint = this._chainPoint[this.currentIndex]; - - this._handleShape.style.text = cpStyle.label.show ? curPoint.name : ''; - this._handleShape.style.textFont = curPoint.textFont; - - this._handleShape.style.n = curPoint.n; - if (cpStyle.symbol == 'auto') { - this._handleShape.style.iconType = curPoint.symbol != 'none' - ? curPoint.symbol : 'diamond'; - } - else { - this._handleShape.style.iconType = cpStyle.symbol; - if (cpStyle.symbol.match('star')) { - this._handleShape.style.n = (cpStyle.symbol.replace('star','') - 0) || 5; - this._handleShape.style.iconType = 'star'; - } - } - - var symbolSize; - if (cpStyle.symbolSize == 'auto') { - symbolSize = curPoint.symbolSize + 2; - symbolSize = symbolSize < 5 ? 5 : symbolSize; - } - else { - symbolSize = cpStyle.symbolSize - 0; - } - - this._handleShape.style.color = cpStyle.color == 'auto' - ? (curPoint.color - ? curPoint.color - : timelineOption.controlStyle.emphasis.color - ) - : cpStyle.color; - this._handleShape.style.textColor = cpStyle.label.textStyle.color == 'auto' - ? this._handleShape.style.color - : cpStyle.label.textStyle.color; - this._handleShape.highlightStyle.strokeColor = - this._handleShape.style.strokeColor = cpStyle.borderColor == 'auto' - ? (curPoint.borderColor ? curPoint.borderColor : '#fff') - : cpStyle.borderColor; - this._handleShape.style.lineWidth = cpStyle.borderWidth == 'auto' - ? (curPoint.borderWidth ? curPoint.borderWidth : 0) - : (cpStyle.borderWidth - 0); - this._handleShape.highlightStyle.lineWidth = this._handleShape.style.lineWidth + 1; - - this.zr.animate(this._handleShape.id, 'style') - .when( - 500, - { - x : curPoint.x - symbolSize, - textX : curPoint.x, - y : this._location.y + this._location.height / 4 - symbolSize, - width : symbolSize * 2, - height : symbolSize * 2 - } - ) - .start('ExponentialOut'); - }, - - _findChainIndex : function(x) { - var chainPoint = this._chainPoint; - var len = chainPoint.length; - if (x <= chainPoint[0].x) { - return 0; - } - else if (x >= chainPoint[len - 1].x) { - return len - 1; - } - for (var i = 0; i < len - 1; i++) { - if (x >= chainPoint[i].x && x <= chainPoint[i + 1].x) { - // catch you! - return (Math.abs(x - chainPoint[i].x) < Math.abs(x - chainPoint[i + 1].x)) - ? i : (i + 1); - } - } - }, - - __onclick : function(param) { - var x = zrEvent.getX(param.event); - var newIndex = this._findChainIndex(x); - if (newIndex == this.currentIndex) { - return true; // 啥事都没发生 - } - - this.currentIndex = newIndex; - this.timelineOption.autoPlay && this.stop(); // 停止自动播放 - clearTimeout(this.playTicket); - this._onFrame(); - }, - - /** - * 拖拽范围控制 - */ - __ondrift : function (shape, dx) { - this.timelineOption.autoPlay && this.stop(); // 停止自动播放 - - var chainPoint = this._chainPoint; - var len = chainPoint.length; - var newIndex; - if (shape.style.x + dx <= chainPoint[0].x - chainPoint[0].symbolSize) { - shape.style.x = chainPoint[0].x - chainPoint[0].symbolSize; - newIndex = 0; - } - else if (shape.style.x + dx >= chainPoint[len - 1].x - chainPoint[len - 1].symbolSize) { - shape.style.x = chainPoint[len - 1].x - chainPoint[len - 1].symbolSize; - newIndex = len - 1; - } - else { - shape.style.x += dx; - newIndex = this._findChainIndex(shape.style.x); - } - var curPoint = chainPoint[newIndex]; - var symbolSize = curPoint.symbolSize + 2; - shape.style.iconType = curPoint.symbol; - shape.style.n = curPoint.n; - shape.style.textX = shape.style.x + symbolSize / 2; - shape.style.y = this._location.y + this._location.height / 4 - symbolSize; - shape.style.width = symbolSize * 2; - shape.style.height = symbolSize * 2; - shape.style.text = curPoint.name; - - //console.log(newIndex) - if (newIndex == this.currentIndex) { - return true; // 啥事都没发生 - } - - this.currentIndex = newIndex; - if (this.timelineOption.realtime) { - clearTimeout(this.playTicket); - var self = this; - this.playTicket = setTimeout(function() { - self._setCurrentOption(); - },200); - } - - return true; - }, - - __ondragend : function () { - this.isDragend = true; - }, - - /** - * 数据项被拖拽出去 - */ - ondragend : function (param, status) { - if (!this.isDragend || !param.target) { - // 没有在当前实例上发生拖拽行为则直接返回 - return; - } - !this.timelineOption.realtime && this._setCurrentOption(); - - // 别status = {}赋值啊!! - status.dragOut = true; - status.dragIn = true; - status.needRefresh = false; // 会有消息触发fresh,不用再刷一遍 - // 处理完拖拽事件后复位 - this.isDragend = false; - this._syncHandleShape(); - return; - }, - - last : function () { - this.timelineOption.autoPlay && this.stop(); // 停止自动播放 - - this.currentIndex -= 1; - if (this.currentIndex < 0) { - this.currentIndex = this.timelineOption.data.length - 1; - } - this._onFrame(); - - return this.currentIndex; - }, - - next : function () { - this.timelineOption.autoPlay && this.stop(); // 停止自动播放 - - this.currentIndex += 1; - if (this.currentIndex >= this.timelineOption.data.length) { - this.currentIndex = 0; - } - this._onFrame(); - - return this.currentIndex; - }, - - play : function (targetIndex, autoPlay) { - if (this._ctrPlayShape && this._ctrPlayShape.style.status != 'playing') { - this._ctrPlayShape.style.status = 'playing'; - this.zr.modShape(this._ctrPlayShape.id); - this.zr.refresh(); - } - - - this.timelineOption.autoPlay = typeof autoPlay != 'undefined' - ? autoPlay : true; - - if (!this.timelineOption.autoPlay) { - clearTimeout(this.playTicket); - } - - this.currentIndex = typeof targetIndex != 'undefined' - ? targetIndex : (this.currentIndex + 1); - if (this.currentIndex >= this.timelineOption.data.length) { - this.currentIndex = 0; - } - this._onFrame(); - - return this.currentIndex; - }, - - stop : function () { - if (this._ctrPlayShape && this._ctrPlayShape.style.status != 'stop') { - this._ctrPlayShape.style.status = 'stop'; - this.zr.modShape(this._ctrPlayShape.id); - this.zr.refresh(); - } - - this.timelineOption.autoPlay = false; - - clearTimeout(this.playTicket); - - return this.currentIndex; - }, - - /** - * 避免dataZoom带来两次refresh,不设refresh接口,resize重复一下buildshape逻辑 - */ - resize : function () { - if (this.timelineOption.show) { - this.clear(); - this._buildShape(); - this._syncHandleShape(); - } - }, - - setTheme : function(needRefresh) { - this.timelineOption = this.reformOption(zrUtil.clone(this.option.timeline)); - // 补全padding属性 - this.timelineOption.padding = this.reformCssArray( - this.timelineOption.padding - ); - // 通用字体设置 - this.timelineOption.label.textStyle = zrUtil.merge( - this.timelineOption.label.textStyle || {}, - this.ecTheme.textStyle - ); - this.timelineOption.checkpointStyle.label.textStyle = zrUtil.merge( - this.timelineOption.checkpointStyle.label.textStyle || {}, - this.ecTheme.textStyle - ); - - if (this.timelineOption.show && needRefresh) { - this.clear(); - this._buildShape(); - this._syncHandleShape(); - } - }, - - /** - * 释放后实例不可用,重载基类方法 - */ - dispose : function () { - this.clear(); - this.shapeList = null; - - clearTimeout(this.playTicket); - } - }; - - function timelineControl(ctx, style) { - var lineWidth = 2;//style.lineWidth; - var x = style.x + lineWidth; - var y = style.y + lineWidth + 2; - var width = style.width - lineWidth; - var height = style.height - lineWidth; - - - var symbol = style.symbol; - if (symbol == 'last') { - ctx.moveTo(x + width - 2, y + height / 3); - ctx.lineTo(x + width - 2, y); - ctx.lineTo(x + 2, y + height / 2); - ctx.lineTo(x + width - 2, y + height); - ctx.lineTo(x + width - 2, y + height / 3 * 2); - ctx.moveTo(x, y); - ctx.lineTo(x, y); - } - else if (symbol == 'next') { - ctx.moveTo(x + 2, y + height / 3); - ctx.lineTo(x + 2, y); - ctx.lineTo(x + width - 2, y + height / 2); - ctx.lineTo(x + 2, y + height); - ctx.lineTo(x + 2, y + height / 3 * 2); - ctx.moveTo(x, y); - ctx.lineTo(x, y); - } - else if (symbol == 'play') { - if (style.status == 'stop') { - ctx.moveTo(x + 2, y); - ctx.lineTo(x + width - 2, y + height / 2); - ctx.lineTo(x + 2, y + height); - ctx.lineTo(x + 2, y); - } - else { - var delta = style.brushType == 'both' ? 2 : 3; - ctx.rect(x + 2, y, delta, height); - ctx.rect(x + width - delta - 2, y, delta, height); - } - } - else if (symbol.match('image')) { - var imageLocation = ''; - imageLocation = symbol.replace( - new RegExp('^image:\\/\\/'), '' - ); - symbol = IconShape.prototype.iconLibrary.image; - symbol(ctx, { - x : x, - y : y, - width : width, - height : height, - image : imageLocation - }); - } - } - IconShape.prototype.iconLibrary['timelineControl'] = timelineControl; - - zrUtil.inherits(Timeline, Base); - - require('../component').define('timeline', Timeline); - - return Timeline; -}); - -define( - 'zrender/loadingEffect/Bar',['require','./Base','../tool/util','../tool/color','../shape/Rectangle'],function (require) { - var Base = require('./Base'); - var util = require('../tool/util'); - var zrColor = require('../tool/color'); - var RectangleShape = require('../shape/Rectangle'); - - function Bar(options) { - Base.call(this, options); - } - util.inherits(Bar, Base); - - - /** - * 进度条 - * - * @param {Object} addShapeHandle - * @param {Object} refreshHandle - */ - Bar.prototype._start = function (addShapeHandle, refreshHandle) { - // 特效默认配置 - var options = util.merge( - this.options, - { - textStyle : { - color : '#888' - }, - backgroundColor : 'rgba(250, 250, 250, 0.8)', - effectOption : { - x : 0, - y : this.canvasHeight / 2 - 30, - width : this.canvasWidth, - height : 5, - brushType : 'fill', - timeInterval : 100 - } - } - ); - - var textShape = this.createTextShape(options.textStyle); - var background = this.createBackgroundShape(options.backgroundColor); - - var effectOption = options.effectOption; - - // 初始化动画元素 - var barShape = new RectangleShape({ - highlightStyle : util.clone(effectOption) - }); - - barShape.highlightStyle.color = - effectOption.color - || zrColor.getLinearGradient( - effectOption.x, - effectOption.y, - effectOption.x + effectOption.width, - effectOption.y + effectOption.height, - [[0, '#ff6400'], [0.5, '#ffe100'], [1, '#b1ff00']] - ); - - if (options.progress != null) { - // 指定进度 - addShapeHandle(background); - - barShape.highlightStyle.width = - this.adjust(options.progress, [0,1]) - * options.effectOption.width; - - addShapeHandle(barShape); - addShapeHandle(textShape); - - refreshHandle(); - return; - } - else { - // 循环显示 - barShape.highlightStyle.width = 0; - return setInterval( - function() { - addShapeHandle(background); - - if (barShape.highlightStyle.width < effectOption.width) { - barShape.highlightStyle.width += 8; - } - else { - barShape.highlightStyle.width = 0; - } - addShapeHandle(barShape); - addShapeHandle(textShape); - refreshHandle(); - }, - effectOption.timeInterval - ); - } - }; - - return Bar; - } -); - - -define( - 'zrender/loadingEffect/Bubble',['require','./Base','../tool/util','../tool/color','../shape/Circle'],function (require) { - var Base = require('./Base'); - var util = require('../tool/util'); - var zrColor = require('../tool/color'); - var CircleShape = require('../shape/Circle'); - - function Bubble(options) { - Base.call(this, options); - } - util.inherits(Bubble, Base); - - /** - * 泡泡 - * - * @param {Object} addShapeHandle - * @param {Object} refreshHandle - */ - Bubble.prototype._start = function (addShapeHandle, refreshHandle) { - - // 特效默认配置 - var options = util.merge( - this.options, - { - textStyle : { - color : '#888' - }, - backgroundColor : 'rgba(250, 250, 250, 0.8)', - effect : { - n : 50, - lineWidth : 2, - brushType : 'stroke', - color : 'random', - timeInterval : 100 - } - } - ); - - var textShape = this.createTextShape(options.textStyle); - var background = this.createBackgroundShape(options.backgroundColor); - - var effectOption = options.effect; - var n = effectOption.n; - var brushType = effectOption.brushType; - var lineWidth = effectOption.lineWidth; - - var shapeList = []; - var canvasWidth = this.canvasWidth; - var canvasHeight = this.canvasHeight; - - // 初始化动画元素 - for(var i = 0; i < n; i++) { - var color = effectOption.color == 'random' - ? zrColor.alpha(zrColor.random(), 0.3) - : effectOption.color; - - shapeList[i] = new CircleShape({ - highlightStyle : { - x : Math.ceil(Math.random() * canvasWidth), - y : Math.ceil(Math.random() * canvasHeight), - r : Math.ceil(Math.random() * 40), - brushType : brushType, - color : color, - strokeColor : color, - lineWidth : lineWidth - }, - animationY : Math.ceil(Math.random() * 20) - }); - } - - return setInterval( - function () { - addShapeHandle(background); - - for(var i = 0; i < n; i++) { - var style = shapeList[i].highlightStyle; - - if (style.y - shapeList[i].animationY + style.r <= 0){ - shapeList[i].highlightStyle.y = canvasHeight + style.r; - shapeList[i].highlightStyle.x = Math.ceil( - Math.random() * canvasWidth - ); - } - shapeList[i].highlightStyle.y -= - shapeList[i].animationY; - - addShapeHandle(shapeList[i]); - } - - addShapeHandle(textShape); - refreshHandle(); - }, - effectOption.timeInterval - ); - }; - - return Bubble; - } -); - - -define( - 'zrender/loadingEffect/DynamicLine',['require','./Base','../tool/util','../tool/color','../shape/Line'],function (require) { - var Base = require('./Base'); - var util = require('../tool/util'); - var zrColor = require('../tool/color'); - var LineShape = require('../shape/Line'); - - function DynamicLine(options) { - Base.call(this, options); - } - util.inherits(DynamicLine, Base); - - - /** - * 动态线 - * - * @param {Object} addShapeHandle - * @param {Object} refreshHandle - */ - DynamicLine.prototype._start = function (addShapeHandle, refreshHandle) { - // 特效默认配置 - var options = util.merge( - this.options, - { - textStyle : { - color : '#fff' - }, - backgroundColor : 'rgba(0, 0, 0, 0.8)', - effectOption : { - n : 30, - lineWidth : 1, - color : 'random', - timeInterval : 100 - } - } - ); - - var textShape = this.createTextShape(options.textStyle); - var background = this.createBackgroundShape(options.backgroundColor); - - var effectOption = options.effectOption; - var n = effectOption.n; - var lineWidth = effectOption.lineWidth; - - var shapeList = []; - var canvasWidth = this.canvasWidth; - var canvasHeight = this.canvasHeight; - - // 初始化动画元素 - for(var i = 0; i < n; i++) { - var xStart = -Math.ceil(Math.random() * 1000); - var len = Math.ceil(Math.random() * 400); - var pos = Math.ceil(Math.random() * canvasHeight); - - var color = effectOption.color == 'random' - ? zrColor.random() - : effectOption.color; - - shapeList[i] = new LineShape({ - highlightStyle : { - xStart : xStart, - yStart : pos, - xEnd : xStart + len, - yEnd : pos, - strokeColor : color, - lineWidth : lineWidth - }, - animationX : Math.ceil(Math.random() * 100), - len : len - }); - } - - return setInterval( - function() { - addShapeHandle(background); - - for(var i = 0; i < n; i++) { - var style = shapeList[i].highlightStyle; - - if (style.xStart >= canvasWidth){ - - shapeList[i].len = Math.ceil(Math.random() * 400); - style.xStart = -400; - style.xEnd = -400 + shapeList[i].len; - style.yStart = Math.ceil(Math.random() * canvasHeight); - style.yEnd = style.yStart; - } - - style.xStart += shapeList[i].animationX; - style.xEnd += shapeList[i].animationX; - - addShapeHandle(shapeList[i]); - } - - addShapeHandle(textShape); - refreshHandle(); - }, - effectOption.timeInterval - ); - }; - - return DynamicLine; - } -); - - -define( - 'zrender/loadingEffect/Ring',['require','./Base','../tool/util','../tool/color','../shape/Ring','../shape/Sector'],function (require) { - var Base = require('./Base'); - var util = require('../tool/util'); - var zrColor = require('../tool/color'); - var RingShape = require('../shape/Ring'); - var SectorShape = require('../shape/Sector'); - - function Ring(options) { - Base.call(this, options); - } - util.inherits(Ring, Base); - - - /** - * 圆环 - * - * @param {Object} addShapeHandle - * @param {Object} refreshHandle - */ - Ring.prototype._start = function (addShapeHandle, refreshHandle) { - - // 特效默认配置 - var options = util.merge( - this.options, - { - textStyle : { - color : '#07a' - }, - backgroundColor : 'rgba(250, 250, 250, 0.8)', - effect : { - x : this.canvasWidth / 2, - y : this.canvasHeight / 2, - r0 : 60, - r : 100, - color : '#bbdcff', - brushType: 'fill', - textPosition : 'inside', - textFont : 'normal 30px verdana', - textColor : 'rgba(30, 144, 255, 0.6)', - timeInterval : 100 - } - } - ); - - var effectOption = options.effect; - - var textStyle = options.textStyle; - if (textStyle.x == null) { - textStyle.x = effectOption.x; - } - if (textStyle.y == null) { - textStyle.y = (effectOption.y + (effectOption.r0 + effectOption.r) / 2 - 5); - } - - var textShape = this.createTextShape(options.textStyle); - var background = this.createBackgroundShape(options.backgroundColor); - - var x = effectOption.x; - var y = effectOption.y; - var r0 = effectOption.r0 + 6; - var r = effectOption.r - 6; - var color = effectOption.color; - var darkColor = zrColor.lift(color, 0.1); - - var shapeRing = new RingShape({ - highlightStyle : util.clone(effectOption) - }); - - // 初始化动画元素 - var shapeList = []; - var clolrList = zrColor.getGradientColors( - ['#ff6400', '#ffe100', '#97ff00'], 25 - ); - var preAngle = 15; - var endAngle = 240; - - for(var i = 0; i < 16; i++) { - shapeList.push(new SectorShape({ - highlightStyle : { - x : x, - y : y, - r0 : r0, - r : r, - startAngle : endAngle - preAngle, - endAngle : endAngle, - brushType: 'fill', - color : darkColor - }, - _color : zrColor.getLinearGradient( - x + r0 * Math.cos(endAngle, true), - y - r0 * Math.sin(endAngle, true), - x + r0 * Math.cos(endAngle - preAngle, true), - y - r0 * Math.sin(endAngle - preAngle, true), - [ - [0, clolrList[i * 2]], - [1, clolrList[i * 2 + 1]] - ] - ) - })); - endAngle -= preAngle; - } - endAngle = 360; - for(var i = 0; i < 4; i++) { - shapeList.push(new SectorShape({ - highlightStyle : { - x : x, - y : y, - r0 : r0, - r : r, - startAngle : endAngle - preAngle, - endAngle : endAngle, - brushType: 'fill', - color : darkColor - }, - _color : zrColor.getLinearGradient( - x + r0 * Math.cos(endAngle, true), - y - r0 * Math.sin(endAngle, true), - x + r0 * Math.cos(endAngle - preAngle, true), - y - r0 * Math.sin(endAngle - preAngle, true), - [ - [0, clolrList[i * 2 + 32]], - [1, clolrList[i * 2 + 33]] - ] - ) - })); - endAngle -= preAngle; - } - - var n = 0; - if (options.progress != null) { - // 指定进度 - addShapeHandle(background); - - n = this.adjust(options.progress, [0,1]).toFixed(2) * 100 / 5; - shapeRing.highlightStyle.text = n * 5 + '%'; - addShapeHandle(shapeRing); - - for(var i = 0; i < 20; i++) { - shapeList[i].highlightStyle.color = i < n - ? shapeList[i]._color : darkColor; - addShapeHandle(shapeList[i]); - } - - addShapeHandle(textShape); - refreshHandle(); - return; - } - - // 循环显示 - return setInterval( - function() { - addShapeHandle(background); - - n += n >= 20 ? -20 : 1; - - //shapeRing.highlightStyle.text = n * 5 + '%'; - addShapeHandle(shapeRing); - - for(var i = 0; i < 20; i++) { - shapeList[i].highlightStyle.color = i < n - ? shapeList[i]._color : darkColor; - addShapeHandle(shapeList[i]); - } - - addShapeHandle(textShape); - refreshHandle(); - }, - effectOption.timeInterval - ); - }; - - return Ring; - } -); - - -define( - 'zrender/loadingEffect/Spin',['require','./Base','../tool/util','../tool/color','../shape/Sector'],function (require) { - var Base = require('./Base'); - var util = require('../tool/util'); - var zrColor = require('../tool/color'); - var SectorShape = require('../shape/Sector'); - - function Spin(options) { - Base.call(this, options); - } - util.inherits(Spin, Base); - - /** - * 旋转 - * - * @param {Object} addShapeHandle - * @param {Object} refreshHandle - */ - Spin.prototype._start = function (addShapeHandle, refreshHandle) { - // 特效默认配置 - var effectOption = util.merge( - this.options.effect || {}, - { - x : this.canvasWidth / 2 - 80, - y : this.canvasHeight / 2, - r0 : 9, - r : 15, - n : 18, - color : '#fff', - timeInterval : 100 - } - ); - - var options = util.merge( - this.options, - { - textStyle : { - color : '#fff', - x : effectOption.x + effectOption.r + 10, - y : effectOption.y, - textAlign : 'start' - }, - backgroundColor : 'rgba(0, 0, 0, 0.8)' - } - ); - - var textShape = this.createTextShape(options.textStyle); - var background = this.createBackgroundShape(options.backgroundColor); - - var n = effectOption.n; - var x = effectOption.x; - var y = effectOption.y; - var r0 = effectOption.r0; - var r = effectOption.r; - var color = effectOption.color; - - // 初始化动画元素 - var shapeList = []; - var preAngle = Math.round(180 / n); - for(var i = 0; i < n; i++) { - shapeList[i] = new SectorShape({ - highlightStyle : { - x : x, - y : y, - r0 : r0, - r : r, - startAngle : preAngle * i * 2, - endAngle : preAngle * i * 2 + preAngle, - color : zrColor.alpha(color, (i + 1) / n), - brushType: 'fill' - } - }); - } - - var pos = [0, x, y]; - - return setInterval( - function() { - addShapeHandle(background); - pos[0] -= 0.3; - for(var i = 0; i < n; i++) { - shapeList[i].rotation = pos; - addShapeHandle(shapeList[i]); - } - - addShapeHandle(textShape); - refreshHandle(); - }, - effectOption.timeInterval - ); - }; - - return Spin; - } -); - - -define( - 'zrender/loadingEffect/Whirling',['require','./Base','../tool/util','../shape/Ring','../shape/Droplet','../shape/Circle'],function (require) { - var Base = require('./Base'); - var util = require('../tool/util'); - var RingShape = require('../shape/Ring'); - var DropletShape = require('../shape/Droplet'); - var CircleShape = require('../shape/Circle'); - - function Whirling(options) { - Base.call(this, options); - } - util.inherits(Whirling, Base); - - /** - * 旋转水滴 - * - * @param {Object} addShapeHandle - * @param {Object} refreshHandle - */ - Whirling.prototype._start = function (addShapeHandle, refreshHandle) { - // 特效默认配置 - var effectOption = util.merge( - this.options.effect || {}, - { - x : this.canvasWidth / 2 - 80, - y : this.canvasHeight / 2, - r : 18, - colorIn : '#fff', - colorOut : '#555', - colorWhirl : '#6cf', - timeInterval : 50 - } - ); - - var options = util.merge( - this.options, - { - textStyle : { - color : '#888', - x : effectOption.x + effectOption.r + 10, - y : effectOption.y, - textAlign : 'start' - }, - backgroundColor : 'rgba(250, 250, 250, 0.8)' - } - ); - - var textShape = this.createTextShape(options.textStyle); - var background = this.createBackgroundShape(options.backgroundColor); - - // 初始化动画元素 - var droplet = new DropletShape({ - highlightStyle : { - a : Math.round(effectOption.r / 2), - b : Math.round(effectOption.r - effectOption.r / 6), - brushType : 'fill', - color : effectOption.colorWhirl - } - }); - var circleIn = new CircleShape({ - highlightStyle : { - r : Math.round(effectOption.r / 6), - brushType : 'fill', - color : effectOption.colorIn - } - }); - var circleOut = new RingShape({ - highlightStyle : { - r0 : Math.round(effectOption.r - effectOption.r / 3), - r : effectOption.r, - brushType : 'fill', - color : effectOption.colorOut - } - }); - - var pos = [0, effectOption.x, effectOption.y]; - - droplet.highlightStyle.x - = circleIn.highlightStyle.x - = circleOut.highlightStyle.x - = pos[1]; - droplet.highlightStyle.y - = circleIn.highlightStyle.y - = circleOut.highlightStyle.y - = pos[2]; - - return setInterval( - function() { - addShapeHandle(background); - addShapeHandle(circleOut); - pos[0] -= 0.3; - droplet.rotation = pos; - addShapeHandle(droplet); - addShapeHandle(circleIn); - addShapeHandle(textShape); - refreshHandle(); - }, - effectOption.timeInterval - ); - }; - - return Whirling; - } -); - -/** - * echarts默认主题,开发中 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/theme/default',[],function() { - var config = { - }; - - return config; -}); -/*! - * ECharts, a javascript interactive chart library. - * - * Copyright (c) 2014, Baidu Inc. - * All rights reserved. - * - * LICENSE - * https://github.com/ecomfe/echarts/blob/master/LICENSE.txt - */ - -/** - * echarts - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool/event','zrender/tool/env','zrender','zrender/config','zrender','./chart/island','./component/toolbox','./component','./component/title','./component/tooltip','./component/legend','./util/ecData','./chart','./component','zrender/tool/color','./component/timeline','zrender','zrender/shape/Image','zrender/loadingEffect/Bar','zrender/loadingEffect/Bubble','zrender/loadingEffect/DynamicLine','zrender/loadingEffect/Ring','zrender/loadingEffect/Spin','zrender/loadingEffect/Whirling','./theme/default'],function (require) { - var ecConfig = require('./config'); - var zrUtil = require('zrender/tool/util'); - var zrEvent = require('zrender/tool/event'); - - var self = {}; - - var _canvasSupported = require('zrender/tool/env').canvasSupported; - var _idBase = new Date() - 0; - var _instances = {}; // ECharts实例map索引 - var DOM_ATTRIBUTE_KEY = '_echarts_instance_'; - - self.version = '2.0.2'; - self.dependencies = { - zrender : '2.0.2' - }; - /** - * 入口方法 - */ - self.init = function (dom, theme) { - var zrender = require('zrender'); - if (((zrender.version || '1.0.3').replace('.', '') - 0) - < (self.dependencies.zrender.replace('.', '') - 0) - ) { - console.error( - 'ZRender ' + (zrender.version || '1.0.3-') - + ' is too old for ECharts ' + self.version - + '. Current version need ZRender ' - + self.dependencies.zrender + '+' - ); - } - - dom = dom instanceof Array ? dom[0] : dom; - - // dom与echarts实例映射索引 - var key = dom.getAttribute(DOM_ATTRIBUTE_KEY); - if (!key) { - key = _idBase++; - dom.setAttribute(DOM_ATTRIBUTE_KEY, key); - } - - if (_instances[key]) { - // 同一个dom上多次init,自动释放已有实例 - _instances[key].dispose(); - } - _instances[key] = new Echarts(dom); - _instances[key].id = key; - _instances[key].setTheme(theme); - - return _instances[key]; - }; - - /** - * 通过id获得ECharts实例,id可在实例化后读取 - */ - self.getInstanceById = function (key) { - return _instances[key]; - }; - - /** - * 消息中心 - */ - function MessageCenter() { - zrEvent.Dispatcher.call(this); - } - zrUtil.merge(MessageCenter.prototype, zrEvent.Dispatcher.prototype, true); - - /** - * 基于zrender实现Echarts接口层 - * @param {HtmlElement} dom 必要 - */ - function Echarts(dom) { - this._themeConfig = zrUtil.clone(ecConfig); - - this.dom = dom; - // this._zr; - // this._option; // curOption clone - // this._optionRestore; // for restore; - // this._island; - // this._toolbox; - // this._timeline; - // this._refreshInside; // 内部刷新标志位 - - this._connected = false; - this._status = { // 用于图表间通信 - dragIn : false, - dragOut : false, - needRefresh : false - }; - this._curEventType = false; // 破循环信号灯 - this._chartList = []; // 图表实例 - - this._messageCenter = new MessageCenter(); - - this._messageCenterOutSide = new MessageCenter(); // Echarts层的外部消息中心,做Echarts层的消息转发 - - // resize方法经常被绑定到window.resize上,闭包一个this - this.resize = this.resize(); - - // 初始化::构造函数 - this._init(); - } - - /** - * ZRender EVENT - * - * @inner - * @const - * @type {Object} - */ - var ZR_EVENT = require('zrender/config').EVENT; - - /** - * 要绑定监听的zrender事件列表 - * - * @const - * @inner - * @type {Array} - */ - var ZR_EVENT_LISTENS = [ - 'CLICK', 'MOUSEOVER', - 'DRAGSTART', 'DRAGEND', 'DRAGENTER', 'DRAGOVER', 'DRAGLEAVE', 'DROP' - ]; - - /** - * 对echarts的实例中的chartList属性成员,逐个进行方法调用,遍历顺序为逆序 - * 由于在事件触发的默认行为处理中,多次用到相同逻辑,所以抽象了该方法 - * 由于所有的调用场景里,最多只有两个参数,基于性能和体积考虑,这里就不使用call或者apply了 - * - * @inner - * @param {ECharts} ecInstance ECharts实例 - * @param {string} methodName 要调用的方法名 - * @param {*} arg0 调用参数1 - * @param {*} arg1 调用参数2 - * @param {*} arg2 调用参数3 - */ - function callChartListMethodReverse(ecInstance, methodName, arg0, arg1, arg2) { - var chartList = ecInstance._chartList; - var len = chartList.length; - - while (len--) { - var chart = chartList[len]; - if (typeof chart[methodName] === 'function') { - chart[methodName](arg0, arg1, arg2); - } - } - } - - Echarts.prototype = { - /** - * 初始化::构造函数 - */ - _init : function () { - var self = this; - var _zr = require('zrender').init(this.dom); - this._zr = _zr; - - // wrap: n,e,d,t for name event data this - this._messageCenter.dispatch = function(type, event, eventPackage, that) { - eventPackage = eventPackage || {}; - eventPackage.type = type; - eventPackage.event = event; - - self._messageCenter.dispatchWithContext(type, eventPackage, that); - if (type != 'HOVER') { - setTimeout(function(){ - self._messageCenterOutSide.dispatchWithContext( - type, eventPackage, that - ); - },50); - } - else { - self._messageCenterOutSide.dispatchWithContext( - type, eventPackage, that - ); - } - }; - - this._onevent = function(param){ - return self.__onevent(param); - }; - for (var e in ecConfig.EVENT) { - if (e != 'CLICK' && e != 'HOVER' && e != 'MAP_ROAM') { - this._messageCenter.bind(ecConfig.EVENT[e], this._onevent, this); - } - } - - - var eventBehaviors = {}; - this._onzrevent = function (param) { - return self[eventBehaviors[ param.type ]](param); - }; - - // 挂载关心的事件 - for (var i = 0, len = ZR_EVENT_LISTENS.length; i < len; i++) { - var eventName = ZR_EVENT_LISTENS[i]; - var eventValue = ZR_EVENT[eventName]; - eventBehaviors[eventValue] = '_on' + eventName.toLowerCase(); - _zr.on(eventValue, this._onzrevent); - } - - this.chart = {}; // 图表索引 - this.component = {}; // 组件索引 - - // 内置图表 - // 孤岛 - var Island = require('./chart/island'); - this._island = new Island(this._themeConfig, this._messageCenter, _zr, {}, this); - this.chart.island = this._island; - - // 内置通用组件 - // 工具箱 - var Toolbox = require('./component/toolbox'); - this._toolbox = new Toolbox(this._themeConfig, this._messageCenter, _zr, {}, this); - this.component.toolbox = this._toolbox; - - var componentLibrary = require('./component'); - componentLibrary.define('title', require('./component/title')); - componentLibrary.define('tooltip', require('./component/tooltip')); - componentLibrary.define('legend', require('./component/legend')); - }, - - /** - * ECharts事件处理中心 - */ - __onevent : function (param){ - param.__echartsId = param.__echartsId || this.id; - - // 来自其他联动图表的事件 - var fromMyself = (param.__echartsId == this.id); - - if (!this._curEventType) { - this._curEventType = param.type; - } - - switch (param.type) { - case ecConfig.EVENT.LEGEND_SELECTED : - this._onlegendSelected(param); - break; - case ecConfig.EVENT.DATA_ZOOM : - if (!fromMyself) { - var dz = this.component.dataZoom; - if (dz) { - dz.silence(true); - dz.absoluteZoom(param.zoom); - dz.silence(false); - } - } - this._ondataZoom(param); - break; - case ecConfig.EVENT.DATA_RANGE : - fromMyself && this._ondataRange(param); - break; - case ecConfig.EVENT.MAGIC_TYPE_CHANGED : - if (!fromMyself) { - var tb = this.component.toolbox; - if (tb) { - tb.silence(true); - tb.setMagicType(param.magicType); - tb.silence(false); - } - } - this._onmagicTypeChanged(param); - break; - case ecConfig.EVENT.DATA_VIEW_CHANGED : - fromMyself && this._ondataViewChanged(param); - break; - case ecConfig.EVENT.TOOLTIP_HOVER : - fromMyself && this._tooltipHover(param); - break; - case ecConfig.EVENT.RESTORE : - this._onrestore(); - break; - case ecConfig.EVENT.REFRESH : - fromMyself && this._onrefresh(param); - break; - // 鼠标同步 - case ecConfig.EVENT.TOOLTIP_IN_GRID : - case ecConfig.EVENT.TOOLTIP_OUT_GRID : - if (!fromMyself) { - // 只处理来自外部的鼠标同步 - var grid = this.component.grid; - if (grid) { - this._zr.trigger( - 'mousemove', - { - connectTrigger : true, - zrenderX : grid.getX() + param.x * grid.getWidth(), - zrenderY : grid.getY() + param.y * grid.getHeight() - } - ); - } - } - else if (this._connected) { - // 来自自己,并且存在多图联动,空间坐标映射修改参数分发 - var grid = this.component.grid; - if (grid) { - param.x = (param.event.zrenderX - grid.getX()) / grid.getWidth(); - param.y = (param.event.zrenderY - grid.getY()) / grid.getHeight(); - } - } - break; - /* - case ecConfig.EVENT.RESIZE : - case ecConfig.EVENT.DATA_CHANGED : - case ecConfig.EVENT.PIE_SELECTED : - case ecConfig.EVENT.MAP_SELECTED : - break; - */ - } - - // 多图联动,只做自己的一级事件分发,避免级联事件循环 - if (this._connected && fromMyself && this._curEventType == param.type) { - for (var c in this._connected) { - this._connected[c].connectedEventHandler(param); - } - // 分发完毕后复位 - this._curEventType = null; - } - - if (!fromMyself || (!this._connected && fromMyself)) { // 处理了完联动事件复位 - this._curEventType = null; - } - }, - - /** - * 点击事件,响应zrender事件,包装后分发到Echarts层 - */ - _onclick : function (param) { - callChartListMethodReverse(this, 'onclick', param); - - if (param.target) { - var ecData = this._eventPackage(param.target); - if (ecData && ecData.seriesIndex != null) { - this._messageCenter.dispatch( - ecConfig.EVENT.CLICK, - param.event, - ecData, - this - ); - } - } - }, - - /** - * 鼠标移入事件,响应zrender事件,包装后分发到Echarts层 - */ - _onmouseover : function (param) { - if (param.target) { - var ecData = this._eventPackage(param.target); - if (ecData && ecData.seriesIndex != null) { - this._messageCenter.dispatch( - ecConfig.EVENT.HOVER, - param.event, - ecData, - this - ); - } - } - }, - - /** - * dragstart回调,可计算特性实现 - */ - _ondragstart : function (param) { - // 复位用于图表间通信拖拽标识 - this._status = { - dragIn : false, - dragOut : false, - needRefresh : false - }; - - callChartListMethodReverse(this, 'ondragstart', param); - }, - - /** - * dragging回调,可计算特性实现 - */ - _ondragenter : function (param) { - callChartListMethodReverse(this, 'ondragenter', param); - }, - - /** - * dragstart回调,可计算特性实现 - */ - _ondragover : function (param) { - callChartListMethodReverse(this, 'ondragover', param); - }, - - /** - * dragstart回调,可计算特性实现 - */ - _ondragleave : function (param) { - callChartListMethodReverse(this, 'ondragleave', param); - }, - - /** - * dragstart回调,可计算特性实现 - */ - _ondrop : function (param) { - callChartListMethodReverse(this, 'ondrop', param, this._status); - this._island.ondrop(param, this._status); - }, - - /** - * dragdone回调 ,可计算特性实现 - */ - _ondragend : function (param) { - callChartListMethodReverse(this, 'ondragend', param, this._status); - - this._timeline && this._timeline.ondragend(param, this._status); - this._island.ondragend(param, this._status); - - // 发生过重计算 - if (this._status.needRefresh) { - this._syncBackupData(this._option); - - var messageCenter = this._messageCenter; - messageCenter.dispatch( - ecConfig.EVENT.DATA_CHANGED, - param.event, - this._eventPackage(param.target), - this - ); - messageCenter.dispatch(ecConfig.EVENT.REFRESH, null, null, this); - } - }, - - /** - * 图例选择响应 - */ - _onlegendSelected : function (param) { - // 用于图表间通信 - this._status.needRefresh = false; - callChartListMethodReverse(this, 'onlegendSelected', param, this._status); - - if (this._status.needRefresh) { - this._messageCenter.dispatch(ecConfig.EVENT.REFRESH, null, null, this); - } - }, - - /** - * 数据区域缩放响应 - */ - _ondataZoom : function (param) { - // 用于图表间通信 - this._status.needRefresh = false; - callChartListMethodReverse(this, 'ondataZoom', param, this._status); - - if (this._status.needRefresh) { - this._messageCenter.dispatch(ecConfig.EVENT.REFRESH, null, null, this); - } - }, - - /** - * 值域漫游响应 - */ - _ondataRange : function (param) { - this._clearEffect(); - // 用于图表间通信 - this._status.needRefresh = false; - callChartListMethodReverse(this, 'ondataRange', param, this._status); - - // 没有相互影响,直接刷新即可 - if (this._status.needRefresh) { - this._zr.refresh(); - } - }, - - /** - * 动态类型切换响应 - */ - _onmagicTypeChanged : function () { - this._clearEffect(); - this._render(this._toolbox.getMagicOption()); - }, - - /** - * 数据视图修改响应 - */ - _ondataViewChanged : function (param) { - this._syncBackupData(param.option); - this._messageCenter.dispatch( - ecConfig.EVENT.DATA_CHANGED, - null, - param, - this - ); - this._messageCenter.dispatch(ecConfig.EVENT.REFRESH, null, null, this); - }, - - /** - * tooltip与图表间通信 - */ - _tooltipHover : function (param) { - var tipShape = []; - callChartListMethodReverse(this, 'ontooltipHover', param, tipShape); - }, - - /** - * 还原 - */ - _onrestore : function () { - this.restore(); - }, - - /** - * 刷新 - */ - _onrefresh : function (param) { - this._refreshInside = true; - this.refresh(param); - this._refreshInside = false; - }, - - /** - * 数据修改后的反向同步dataZoom持有的备份数据 - */ - _syncBackupData : function (curOption) { - this.component.dataZoom && this.component.dataZoom.syncBackupData(curOption); - }, - - /** - * 打包Echarts层的事件附件 - */ - _eventPackage : function (target) { - if (target) { - var ecData = require('./util/ecData'); - - var seriesIndex = ecData.get(target, 'seriesIndex'); - var dataIndex = ecData.get(target, 'dataIndex'); - - dataIndex = seriesIndex != -1 && this.component.dataZoom - ? this.component.dataZoom.getRealDataIndex( - seriesIndex, - dataIndex - ) - : dataIndex; - return { - seriesIndex : seriesIndex, - dataIndex : dataIndex, - data : ecData.get(target, 'data'), - name : ecData.get(target, 'name'), - value : ecData.get(target, 'value'), - special : ecData.get(target, 'special') - }; - } - return; - }, - - /** - * 图表渲染 - */ - _render : function (magicOption) { - this._mergeGlobalConifg(magicOption); - - var bgColor = magicOption.backgroundColor; - if (bgColor) { - if (!_canvasSupported - && bgColor.indexOf('rgba') != -1 - ) { - // IE6~8对RGBA的处理,filter会带来其他颜色的影响 - var cList = bgColor.split(','); - this.dom.style.filter = 'alpha(opacity=' + - cList[3].substring(0, cList[3].lastIndexOf(')')) * 100 - + ')'; - cList.length = 3; - cList[0] = cList[0].replace('a', ''); - this.dom.style.backgroundColor = cList.join(',') + ')'; - } - else { - this.dom.style.backgroundColor = bgColor; - } - } - - this._zr.clearAnimation(); - this._chartList = []; - - var chartLibrary = require('./chart'); - var componentLibrary = require('./component'); - - if (magicOption.xAxis || magicOption.yAxis) { - magicOption.grid = magicOption.grid || {}; - magicOption.dataZoom = magicOption.dataZoom || {}; - } - - var componentList = [ - 'title', 'legend', 'tooltip', 'dataRange', - 'grid', 'dataZoom', 'xAxis', 'yAxis', 'polar' - ]; - - var ComponentClass; - var componentType; - var component; - for (var i = 0, l = componentList.length; i < l; i++) { - componentType = componentList[i]; - component = this.component[componentType]; - - if (magicOption[componentType]) { - if (component) { - component.refresh && component.refresh(magicOption); - } - else { - ComponentClass = componentLibrary.get( - /^[xy]Axis$/.test(componentType) ? 'axis' : componentType - ); - component = new ComponentClass( - this._themeConfig, this._messageCenter, this._zr, - magicOption, this, componentType - ); - this.component[componentType] = component; - } - this._chartList.push(component); - } - else if (component) { - component.dispose(); - this.component[componentType] = null; - delete this.component[componentType]; - } - } - - var ChartClass; - var chartType; - var chart; - var chartMap = {}; // 记录已经初始化的图表 - for (var i = 0, l = magicOption.series.length; i < l; i++) { - chartType = magicOption.series[i].type; - if (!chartType) { - console.error('series[' + i + '] chart type has not been defined.'); - continue; - } - - if (!chartMap[chartType]) { - chartMap[chartType] = true; - ChartClass = chartLibrary.get(chartType); - if (ChartClass) { - if (this.chart[chartType]) { - chart = this.chart[chartType]; - chart.refresh(magicOption); - } - else { - chart = new ChartClass( - this._themeConfig, this._messageCenter, this._zr, - magicOption, this - ); - } - this._chartList.push(chart); - this.chart[chartType] = chart; - } - else { - console.error(chartType + ' has not been required.'); - } - } - } - - // 已有实例但新option不带这类图表的实例释放 - for (chartType in this.chart) { - if (chartType != ecConfig.CHART_TYPE_ISLAND && !chartMap[chartType]) { - this.chart[chartType].dispose(); - this.chart[chartType] = null; - delete this.chart[chartType]; - } - } - - this.component.grid && this.component.grid.refixAxisShape(this.component); - - this._island.refresh(magicOption); - this._toolbox.refresh(magicOption); - - magicOption.animation && !magicOption.renderAsImage - ? this._zr.refresh() - : this._zr.render(); - - var imgId = 'IMG' + this.id; - var img = document.getElementById(imgId); - if (magicOption.renderAsImage && _canvasSupported) { - // IE8- 不支持图片渲染形式 - if (img) { - // 已经渲染过则更新显示 - img.src = this.getDataURL(magicOption.renderAsImage); - } - else { - // 没有渲染过插入img dom - img = this.getImage(magicOption.renderAsImage); - img.id = imgId; - img.style.position = 'absolute'; - img.style.left = 0; - img.style.top = 0; - this.dom.firstChild.appendChild(img); - } - this.un(); - this._zr.un(); - this._disposeChartList(); - this._zr.clear(); - } - else if (img) { - // 删除可能存在的img - img.parentNode.removeChild(img); - } - img = null; - - this._option = magicOption; - }, - - /** - * 还原 - */ - restore : function () { - this._clearEffect(); - this._option = zrUtil.clone(this._optionRestore); - this._disposeChartList(); - this._island.clear(); - this._toolbox.reset(this._option, true); - this._render(this._option); - }, - - /** - * 刷新 - * @param {Object=} param,可选参数,用于附带option,内部同步用,外部不建议带入数据修改,无法同步 - */ - refresh : function (param) { - this._clearEffect(); - param = param || {}; - var magicOption = param.option; - - // 外部调用的refresh且有option带入 - if (!this._refreshInside && magicOption) { - // 做简单的差异合并去同步内部持有的数据克隆,不建议带入数据 - // 开启数据区域缩放、拖拽重计算、数据视图可编辑模式情况下,当用户产生了数据变化后无法同步 - // 如有带入option存在数据变化,请重新setOption - magicOption = this.getOption(); - zrUtil.merge(magicOption, param.option, true); - zrUtil.merge(this._optionRestore, param.option, true); - this._toolbox.reset(magicOption); - } - - this._island.refresh(magicOption); - this._toolbox.refresh(magicOption); - - // 停止动画 - this._zr.clearAnimation(); - // 先来后到,安顺序刷新各种图表,图表内部refresh优化检查magicOption,无需更新则不更新~ - for (var i = 0, l = this._chartList.length; i < l; i++) { - this._chartList[i].refresh && this._chartList[i].refresh(magicOption); - } - this.component.grid && this.component.grid.refixAxisShape(this.component); - this._zr.refresh(); - }, - - /** - * 释放图表实例 - */ - _disposeChartList : function () { - this._clearEffect(); - - // 停止动画 - this._zr.clearAnimation(); - - var len = this._chartList.length; - while (len--) { - var chart = this._chartList[len]; - - if (chart) { - var chartType = chart.type; - this.chart[chartType] && delete this.chart[chartType]; - this.component[chartType] && delete this.component[chartType]; - chart.dispose && chart.dispose(); - } - } - - this._chartList = []; - }, - - /** - * 非图表全局属性merge~~ - */ - _mergeGlobalConifg : function (magicOption) { - var mergeList = [ - // 背景颜色 - 'backgroundColor', - - // 拖拽重计算相关 - 'calculable', 'calculableColor', 'calculableHolderColor', - - // 孤岛显示连接符 - 'nameConnector', 'valueConnector', - - // 动画相关 - 'animation', 'animationThreshold', 'animationDuration', - 'animationEasing', 'addDataAnimation', - - // 默认标志图形类型列表 - 'symbolList', - - // 降低图表内元素拖拽敏感度,单位ms,不建议外部干预 - 'DRAG_ENABLE_TIME' - ]; - - var len = mergeList.length; - while (len--) { - var mergeItem = mergeList[len]; - if (magicOption[mergeItem] == null) { - magicOption[mergeItem] = this._themeConfig[mergeItem]; - } - } - - // 数值系列的颜色列表,不传则采用内置颜色,可配数组,借用zrender实例注入,会有冲突风险,先这样 - var themeColor = magicOption.color; - if (!(themeColor && themeColor.length)) { - themeColor = this._themeConfig.color; - } - - this._zr.getColor = function (idx) { - var zrColor = require('zrender/tool/color'); - return zrColor.getColor(idx, themeColor); - }; - }, - - /** - * 万能接口,配置图表实例任何可配置选项,多次调用时option选项做merge处理 - * @param {Object} option - * @param {boolean=} notMerge 多次调用时option选项是默认是合并(merge)的, - * 如果不需求,可以通过notMerger参数为true阻止与上次option的合并 - */ - setOption : function (option, notMerge) { - if (!option.timeline) { - return this._setOption(option, notMerge); - } - else { - return this._setTimelineOption(option); - } - }, - - /** - * 万能接口,配置图表实例任何可配置选项,多次调用时option选项做merge处理 - * @param {Object} option - * @param {boolean=} notMerge 多次调用时option选项是默认是合并(merge)的, - * 如果不需求,可以通过notMerger参数为true阻止与上次option的合并 - */ - _setOption : function (option, notMerge) { - if (!notMerge && this._option) { - this._option = zrUtil.merge( - this.getOption(), - zrUtil.clone(option), - true - ); - } - else { - this._option = zrUtil.clone(option); - } - - this._optionRestore = zrUtil.clone(this._option); - - if (!this._option.series || this._option.series.length === 0) { - this._zr.clear(); - return; - } - - if (this.component.dataZoom // 存在dataZoom控件 - && (this._option.dataZoom // 并且新option也存在 - || (this._option.toolbox - && this._option.toolbox.feature - && this._option.toolbox.feature.dataZoom - && this._option.toolbox.feature.dataZoom.show - ) - ) - ) { - // dataZoom同步数据 - this.component.dataZoom.syncOption(this._option); - } - this._toolbox.reset(this._option); - this._render(this._option); - return this; - }, - - /** - * 返回内部持有的当前显示option克隆 - */ - getOption : function () { - var magicOption = zrUtil.clone(this._option); - - var self = this; - function restoreOption(prop) { - var restoreSource = self._optionRestore[prop]; - - if (restoreSource) { - if (restoreSource instanceof Array) { - var len = restoreSource.length; - while (len--) { - magicOption[prop][len].data = zrUtil.clone( - restoreSource[len].data - ); - } - } - else { - magicOption[prop].data = zrUtil.clone(restoreSource.data); - } - } - } - - // 横轴数据还原 - restoreOption('xAxis'); - - // 纵轴数据还原 - restoreOption('yAxis'); - - // 系列数据还原 - restoreOption('series'); - - return magicOption; - }, - - /** - * 数据设置快捷接口 - * @param {Array} series - * @param {boolean=} notMerge 多次调用时option选项是默认是合并(merge)的, - * 如果不需求,可以通过notMerger参数为true阻止与上次option的合并。 - */ - setSeries : function (series, notMerge) { - if (!notMerge) { - this.setOption({series: series}); - } - else { - this._option.series = series; - this.setOption(this._option, notMerge); - } - return this; - }, - - /** - * 返回内部持有的当前显示series克隆 - */ - getSeries : function () { - return this.getOption().series; - }, - - /** - * timelineOption接口,配置图表实例任何可配置选项 - * @param {Object} option - */ - _setTimelineOption : function(option) { - this._timeline && this._timeline.dispose(); - var Timeline = require('./component/timeline'); - var timeline = new Timeline( - this._themeConfig, this._messageCenter, this._zr, option, this - ); - this._timeline = timeline; - this.component.timeline = this._timeline; - - return this; - }, - - /** - * 动态数据添加 - * 形参为单组数据参数,多组时为数据,内容同[seriesIdx, data, isShift, additionData] - * @param {number} seriesIdx 系列索引 - * @param {number | Object} data 增加数据 - * @param {boolean=} isHead 是否队头加入,默认,不指定或false时为队尾插入 - * @param {boolean=} dataGrow 是否增长数据队列长度,默认,不指定或false时移出目标数组对位数据 - * @param {string=} additionData 是否增加类目轴(饼图为图例)数据,附加操作同isHead和dataGrow - */ - addData : function (seriesIdx, data, isHead, dataGrow, additionData) { - var params = seriesIdx instanceof Array - ? seriesIdx - : [[seriesIdx, data, isHead, dataGrow, additionData]]; - - //this._optionRestore 和 magicOption 都要同步 - var magicOption = this.getOption(); - var optionRestore = this._optionRestore; - for (var i = 0, l = params.length; i < l; i++) { - seriesIdx = params[i][0]; - data = params[i][1]; - isHead = params[i][2]; - dataGrow = params[i][3]; - additionData = params[i][4]; - - - var seriesItem = optionRestore.series[seriesIdx]; - var inMethod = isHead ? 'unshift' : 'push'; - var outMethod = isHead ? 'pop' : 'shift'; - if (seriesItem) { - var seriesItemData = seriesItem.data; - var mSeriesItemData = magicOption.series[seriesIdx].data; - - seriesItemData[inMethod](data); - mSeriesItemData[inMethod](data); - if (!dataGrow) { - seriesItemData[outMethod](); - data = mSeriesItemData[outMethod](); - } - - - if (additionData != null) { - var legend; - var legendData; - - if (seriesItem.type == ecConfig.CHART_TYPE_PIE - && (legend = optionRestore.legend) - && (legendData = legend.data) - ) { - var mLegendData = magicOption.legend.data; - legendData[inMethod](additionData); - mLegendData[inMethod](additionData); - - if (!dataGrow) { - var legendDataIdx = zrUtil.indexOf(legendData, data.name); - legendDataIdx != -1 && legendData.splice(legendDataIdx, 1); - - legendDataIdx = zrUtil.indexOf(mLegendData, data.name); - legendDataIdx != -1 && mLegendData.splice(legendDataIdx, 1); - } - } - else if (optionRestore.xAxis != null && optionRestore.yAxis != null) { - // x轴类目 - var axisData; - var mAxisData; - var axisIdx = seriesItem.xAxisIndex || 0; - - if (typeof optionRestore.xAxis[axisIdx].type == 'undefined' - || optionRestore.xAxis[axisIdx].type == 'category' - ) { - axisData = optionRestore.xAxis[axisIdx].data; - mAxisData = magicOption.xAxis[axisIdx].data; - - axisData[inMethod](additionData); - mAxisData[inMethod](additionData); - if (!dataGrow) { - axisData[outMethod](); - mAxisData[outMethod](); - } - } - - // y轴类目 - axisIdx = seriesItem.yAxisIndex || 0; - if (optionRestore.yAxis[axisIdx].type == 'category') { - axisData = optionRestore.yAxis[axisIdx].data; - mAxisData = magicOption.yAxis[axisIdx].data; - - axisData[inMethod](additionData); - mAxisData[inMethod](additionData); - if (!dataGrow) { - axisData[outMethod](); - mAxisData[outMethod](); - } - } - } - } - - // 同步图表内状态,动画需要 - this._option.series[seriesIdx].data = magicOption.series[seriesIdx].data; - } - } - - this._zr.clearAnimation(); - var chartList = this._chartList; - for (var i = 0, l = chartList.length; i < l; i++) { - if (magicOption.addDataAnimation && chartList[i].addDataAnimation) { - chartList[i].addDataAnimation(params); - } - } - - // dataZoom同步数据 - this.component.dataZoom && this.component.dataZoom.syncOption(magicOption); - - this._option = magicOption; - var self = this; - setTimeout(function (){ - if (!self._zr) { - return; // 已经被释放 - } - self._zr.clearAnimation(); - for (var i = 0, l = chartList.length; i < l; i++) { - // 有addData动画就去掉过渡动画 - chartList[i].motionlessOnce = - magicOption.addDataAnimation && chartList[i].addDataAnimation; - } - self._messageCenter.dispatch( - ecConfig.EVENT.REFRESH, - null, - {option: magicOption}, - self - ); - }, magicOption.addDataAnimation ? 500 : 0); - return this; - }, - - /** - * 动态[标注 | 标线]添加 - * @param {number} seriesIdx 系列索引 - * @param {Object} markData [标注 | 标线]对象,支持多个 - */ - addMarkPoint : function (seriesIdx, markData) { - return this._addMark(seriesIdx, markData, 'markPoint'); - }, - - addMarkLine : function (seriesIdx, markData) { - return this._addMark(seriesIdx, markData, 'markLine'); - }, - - _addMark : function (seriesIdx, markData, markType) { - var series = this._option.series; - var seriesItem; - - if (series && (seriesItem = series[seriesIdx])) { - var seriesR = this._optionRestore.series; - var seriesRItem = seriesR[seriesIdx]; - var markOpt = seriesItem[markType]; - var markOptR = seriesRItem[markType]; - - markOpt = seriesItem[markType] = markOpt || {data: []}; - markOptR = seriesRItem[markType] = markOptR || {data: []}; - - for (var key in markData) { - if (key == 'data') { - // 数据concat - markOpt.data = markOpt.data.concat(markData.data); - markOptR.data = markOptR.data.concat(markData.data); - } - else if (typeof markData[key] != 'object' - || typeof markOpt[key] == 'undefined' - ) { - // 简单类型或新值直接赋值 - markOpt[key] = markOptR[key] = markData[key]; - } - else { - // 非数据的复杂对象merge - zrUtil.merge(markOpt[key], markData[key], true); - zrUtil.merge(markOptR[key], markData[key], true); - } - } - - var chart = this.chart[seriesItem.type]; - chart && chart.addMark(seriesIdx, markData, markType); - } - - return this; - }, - - /** - * 动态[标注 | 标线]删除 - * @param {number} seriesIdx 系列索引 - * @param {string} markName [标注 | 标线]名称 - */ - delMarkPoint : function (seriesIdx, markName) { - return this._delMark(seriesIdx, markName, 'markPoint'); - }, - - delMarkLine : function (seriesIdx, markName) { - return this._delMark(seriesIdx, markName, 'markLine'); - }, - - _delMark : function (seriesIdx, markName, markType) { - var series = this._option.series; - var seriesItem; - var mark; - var dataArray; - - if (!( - series - && (seriesItem = series[seriesIdx]) - && (mark = seriesItem[markType]) - && (dataArray = mark.data) - ) - ) { - return this; - } - - markName = markName.split(' > '); - var targetIndex = -1; - - for (var i = 0, l = dataArray.length; i < l; i++) { - var dataItem = dataArray[i]; - if (dataItem instanceof Array) { - if (dataItem[0].name == markName[0] - && dataItem[1].name == markName[1] - ) { - targetIndex = i; - break; - } - } - else if (dataItem.name == markName[0]) { - targetIndex = i; - break; - } - } - - if (targetIndex > -1) { - dataArray.splice(targetIndex, 1); - this._optionRestore.series[seriesIdx][markType].data.splice(targetIndex, 1); - - var chart = this.chart[seriesItem.type]; - chart && chart.delMark(seriesIdx, markName.join(' > '), markType); - } - - return this; - }, - - /** - * 获取当前dom - */ - getDom : function () { - return this.dom; - }, - - /** - * 获取当前zrender实例,可用于添加额为的shape和深度控制 - */ - getZrender : function () { - return this._zr; - }, - - /** - * 获取Base64图片dataURL - * @param {string} imgType 图片类型,支持png|jpeg,默认为png - * @return imgDataURL - */ - getDataURL : function (imgType) { - if (!_canvasSupported) { - return ''; - } - - if (this._chartList.length === 0) { - // 渲染为图片 - var imgId = 'IMG' + this.id; - var img = document.getElementById(imgId); - if (img) { - return img.src; - } - } - - // 清除可能存在的tooltip元素 - var tooltip = this.component.tooltip; - tooltip && tooltip.hideTip(); - - switch (imgType) { - case 'jpeg': - break; - default: - imgType = 'png'; - } - - var bgColor = this._option.backgroundColor; - if (bgColor && bgColor.replace(' ','') == 'rgba(0,0,0,0)') { - bgColor = '#fff'; - } - - return this._zr.toDataURL('image/' + imgType, bgColor); - }, - - /** - * 获取img - * @param {string} imgType 图片类型,支持png|jpeg,默认为png - * @return img dom - */ - getImage : function (imgType) { - var title = this._optionRestore.title; - var imgDom = document.createElement('img'); - imgDom.src = this.getDataURL(imgType); - imgDom.title = (title && title.text) || 'ECharts'; - return imgDom; - }, - - /** - * 获取多图联动的Base64图片dataURL - * @param {string} imgType 图片类型,支持png|jpeg,默认为png - * @return imgDataURL - */ - getConnectedDataURL : function (imgType) { - if (!this.isConnected()) { - return this.getDataURL(imgType); - } - - var tempDom = this.dom; - var imgList = { - 'self' : { - img : this.getDataURL(imgType), - left : tempDom.offsetLeft, - top : tempDom.offsetTop, - right : tempDom.offsetLeft + tempDom.offsetWidth, - bottom : tempDom.offsetTop + tempDom.offsetHeight - } - }; - - var minLeft = imgList.self.left; - var minTop = imgList.self.top; - var maxRight = imgList.self.right; - var maxBottom = imgList.self.bottom; - - for (var c in this._connected) { - tempDom = this._connected[c].getDom(); - imgList[c] = { - img : this._connected[c].getDataURL(imgType), - left : tempDom.offsetLeft, - top : tempDom.offsetTop, - right : tempDom.offsetLeft + tempDom.offsetWidth, - bottom : tempDom.offsetTop + tempDom.offsetHeight - }; - - minLeft = Math.min(minLeft, imgList[c].left); - minTop = Math.min(minTop, imgList[c].top); - maxRight = Math.max(maxRight, imgList[c].right); - maxBottom = Math.max(maxBottom, imgList[c].bottom); - } - - var zrDom = document.createElement('div'); - zrDom.style.position = 'absolute'; - zrDom.style.left = '-4000px'; - zrDom.style.width = (maxRight - minLeft) + 'px'; - zrDom.style.height = (maxBottom - minTop) + 'px'; - document.body.appendChild(zrDom); - - var zrImg = require('zrender').init(zrDom); - - var ImageShape = require('zrender/shape/Image'); - for (var c in imgList) { - zrImg.addShape(new ImageShape({ - style : { - x : imgList[c].left - minLeft, - y : imgList[c].top - minTop, - image : imgList[c].img - } - })); - } - - zrImg.render(); - var bgColor = this._option.backgroundColor; - if (bgColor && bgColor.replace(/ /g, '') == 'rgba(0,0,0,0)') { - bgColor = '#fff'; - } - - var image = zrImg.toDataURL('image/png', bgColor); - - setTimeout(function () { - zrImg.dispose(); - zrDom.parentNode.removeChild(zrDom); - zrDom = null; - }, 100); - - return image; - }, - - /** - * 获取多图联动的img - * @param {string} imgType 图片类型,支持png|jpeg,默认为png - * @return img dom - */ - getConnectedImage : function (imgType) { - var title = this._optionRestore.title; - var imgDom = document.createElement('img'); - imgDom.src = this.getConnectedDataURL(imgType); - imgDom.title = (title && title.text) || 'ECharts'; - return imgDom; - }, - - /** - * 外部接口绑定事件 - * @param {Object} eventName 事件名称 - * @param {Object} eventListener 事件响应函数 - */ - on : function (eventName, eventListener) { - this._messageCenterOutSide.bind(eventName, eventListener, this); - return this; - }, - - /** - * 外部接口解除事件绑定 - * @param {Object} eventName 事件名称 - * @param {Object} eventListener 事件响应函数 - */ - un : function (eventName, eventListener) { - this._messageCenterOutSide.unbind(eventName, eventListener); - return this; - }, - - /** - * 多图联动 - * @param connectTarget{ECharts | Array } connectTarget 联动目标 - */ - connect : function (connectTarget) { - if (!connectTarget) { - return this; - } - - if (!this._connected) { - this._connected = {}; - } - - if (connectTarget instanceof Array) { - for (var i = 0, l = connectTarget.length; i < l; i++) { - this._connected[connectTarget[i].id] = connectTarget[i]; - } - } - else { - this._connected[connectTarget.id] = connectTarget; - } - - return this; - }, - - /** - * 解除多图联动 - * @param connectTarget{ECharts | Array } connectTarget 解除联动目标 - */ - disConnect : function (connectTarget) { - if (!connectTarget || !this._connected) { - return this; - } - - if (connectTarget instanceof Array) { - for (var i = 0, l = connectTarget.length; i < l; i++) { - delete this._connected[connectTarget[i].id]; - } - } - else { - delete this._connected[connectTarget.id]; - } - - for (var k in this._connected) { - return k, this; // 非空 - } - - // 空,转为标志位 - this._connected = false; - return this; - }, - - /** - * 联动事件响应 - */ - connectedEventHandler : function (param) { - if (param.__echartsId != this.id) { - // 来自其他联动图表的事件 - this._onevent(param); - } - }, - - /** - * 是否存在多图联动 - */ - isConnected : function () { - return !!this._connected; - }, - - /** - * 显示loading过渡 - * @param {Object} loadingOption - */ - showLoading : function (loadingOption) { - var effectList = { - bar : require('zrender/loadingEffect/Bar'), - bubble : require('zrender/loadingEffect/Bubble'), - dynamicLine : require('zrender/loadingEffect/DynamicLine'), - ring : require('zrender/loadingEffect/Ring'), - spin : require('zrender/loadingEffect/Spin'), - whirling : require('zrender/loadingEffect/Whirling') - }; - this._toolbox.hideDataView(); - - loadingOption = loadingOption || {}; - - var textStyle = loadingOption.textStyle || {}; - loadingOption.textStyle = textStyle; - - var finalTextStyle = zrUtil.merge( - zrUtil.clone(textStyle), - this._themeConfig.textStyle - ); - textStyle.textFont = finalTextStyle.fontStyle + ' ' - + finalTextStyle.fontWeight + ' ' - + finalTextStyle.fontSize + 'px ' - + finalTextStyle.fontFamily; - - textStyle.text = loadingOption.text || this._themeConfig.loadingText; - - if (loadingOption.x != null) { - textStyle.x = loadingOption.x; - } - if (loadingOption.y != null) { - textStyle.y = loadingOption.y; - } - - loadingOption.effectOption = loadingOption.effectOption || {}; - loadingOption.effectOption.textStyle = textStyle; - - var Effect = loadingOption.effect; - if (typeof Effect == 'string' || Effect == null) { - Effect = effectList[loadingOption.effect || 'spin']; - } - this._zr.showLoading(new Effect(loadingOption.effectOption)); - return this; - }, - - /** - * 隐藏loading过渡 - */ - hideLoading : function () { - this._zr.hideLoading(); - return this; - }, - - /** - * 主题设置 - */ - setTheme : function (theme) { - if (theme) { - if (typeof theme === 'string') { - // 默认主题 - switch (theme) { - // case 'themename': - // theme = require('./theme/themename'); - default: - theme = require('./theme/default'); - } - } - else { - theme = theme || {}; - } - - // 复位默认配置 - // this._themeConfig会被别的对象引用持有 - // 所以不能改成this._themeConfig = {}; - for (var key in this._themeConfig) { - delete this._themeConfig[key]; - } - for (var key in ecConfig) { - this._themeConfig[key] = zrUtil.clone(ecConfig[key]); - } - - // 颜色数组随theme,不merge - theme.color && (this._themeConfig.color = []); - - // 默认标志图形类型列表,不merge - theme.symbolList && (this._themeConfig.symbolList = []); - - // 应用新主题 - zrUtil.merge(this._themeConfig, zrUtil.clone(theme), true); - } - - if (!_canvasSupported) { // IE8- - this._themeConfig.textStyle.fontFamily = this._themeConfig.textStyle.fontFamily2; - } - - this._timeline && this._timeline.setTheme(true); - this._optionRestore && this.restore(); - }, - - /** - * 视图区域大小变化更新,不默认绑定,供使用方按需调用 - */ - resize : function () { - var self = this; - return function(){ - self._clearEffect(); - self._zr.resize(); - if (self._option && self._option.renderAsImage && _canvasSupported) { - // 渲染为图片重走render模式 - self._render(self._option); - return self; - } - // 停止动画 - self._zr.clearAnimation(); - self._island.resize(); - self._toolbox.resize(); - self._timeline && self._timeline.resize(); - // 先来后到,不能仅刷新自己,也不能在上一个循环中刷新,如坐标系数据改变会影响其他图表的大小 - // 所以安顺序刷新各种图表,图表内部refresh优化无需更新则不更新~ - for (var i = 0, l = self._chartList.length; i < l; i++) { - self._chartList[i].resize && self._chartList[i].resize(); - } - self.component.grid && self.component.grid.refixAxisShape(self.component); - self._zr.refresh(); - self._messageCenter.dispatch(ecConfig.EVENT.RESIZE, null, null, self); - return self; - }; - }, - - _clearEffect : function() { - this._zr.modLayer(ecConfig.EFFECT_ZLEVEL, {motionBlur : false}); - this._zr.painter.clearLayer(ecConfig.EFFECT_ZLEVEL); - }, - - /** - * 清除已渲染内容 ,clear后echarts实例可用 - */ - clear : function () { - this._disposeChartList(); - this._zr.clear(); - this._option = {}; - this._optionRestore = {}; - return this; - }, - - /** - * 释放,dispose后echarts实例不可用 - */ - dispose : function () { - var key = this.dom.getAttribute(DOM_ATTRIBUTE_KEY); - key && delete _instances[key]; - - this._island.dispose(); - this._toolbox.dispose(); - this._timeline && this._timeline.dispose(); - this._messageCenter.unbind(); - this.clear(); - this._zr.dispose(); - this._zr = null; - } - }; - - return self; -}); -define('echarts', ['echarts/echarts'], function (main) { return main; }); - -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:仪表盘指针 - * 可配图形属性: - { - // 基础属性 - shape : 'gauge-pointer', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - xStart : {number}, // 必须,起点横坐标 - yStart : {number}, // 必须,起点纵坐标 - xEnd : {number}, // 必须,终点横坐标 - yEnd : {number}, // 必须,终点纵坐标 - strokeColor : {color}, // 默认为'#000',线条颜色(轮廓),支持rgba - lineWidth : {number}, // 线条宽度 - }, - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - */ -define('echarts/util/shape/GaugePointer',['require','zrender/shape/Base','zrender/tool/util','./normalIsCover'],function (require) { - var Base = require('zrender/shape/Base'); - var zrUtil = require('zrender/tool/util'); - - function GaugePointer(options) { - Base.call(this, options); - } - - GaugePointer.prototype = { - type: 'gauge-pointer', - /** - * 创建矩形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function (ctx, style) { - var r = style.r; - var width = style.width; - var angle = style.angle; - var x = style.x - Math.cos(angle) * width * (width >= r / 3 ? 1 : 2); - var y = style.y + Math.sin(angle) * width * (width >= r / 3 ? 1 : 2); - - angle = style.angle - Math.PI / 2; - ctx.moveTo(x, y); - ctx.lineTo( - style.x + Math.cos(angle) * width, - style.y - Math.sin(angle) * width - ); - ctx.lineTo( - style.x + Math.cos(style.angle) * r, - style.y - Math.sin(style.angle) * r - ); - ctx.lineTo( - style.x - Math.cos(angle) * width, - style.y + Math.sin(angle) * width - ); - ctx.lineTo(x, y); - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect : function(style) { - if (style.__rect) { - return style.__rect; - } - - var width = style.width * 2; - var xStart = style.x; - var yStart = style.y; - var xEnd = xStart + Math.cos(style.angle) * style.r; - var yEnd = yStart - Math.sin(style.angle) * style.r; - - style.__rect = { - x : Math.min(xStart, xEnd) - width, - y : Math.min(yStart, yEnd) - width, - width : Math.abs(xStart - xEnd) + width, - height : Math.abs(yStart - yEnd) + width - }; - return style.__rect; - }, - - isCover : require('./normalIsCover') - }; - - zrUtil.inherits(GaugePointer, Base); - - return GaugePointer; -}); - -/** - * echarts图表类:仪表盘 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/chart/gauge',['require','../component/base','./base','../util/shape/GaugePointer','zrender/shape/Text','zrender/shape/Line','zrender/shape/Rectangle','zrender/shape/Circle','zrender/shape/Sector','../config','../util/ecData','../util/accMath','zrender/tool/util','../chart'],function (require) { - var ComponentBase = require('../component/base'); - var ChartBase = require('./base'); - - // 图形依赖 - var GaugePointerShape = require('../util/shape/GaugePointer'); - var TextShape = require('zrender/shape/Text'); - var LineShape = require('zrender/shape/Line'); - var RectangleShape = require('zrender/shape/Rectangle'); - var CircleShape = require('zrender/shape/Circle'); - var SectorShape = require('zrender/shape/Sector'); - - var ecConfig = require('../config'); - var ecData = require('../util/ecData'); - var accMath = require('../util/accMath'); - var zrUtil = require('zrender/tool/util'); - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} series 数据 - * @param {Object} component 组件 - */ - function Gauge(ecTheme, messageCenter, zr, option, myChart){ - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); - // 图表基类 - ChartBase.call(this); - this.refresh(option); - } - - Gauge.prototype = { - type : ecConfig.CHART_TYPE_GAUGE, - /** - * 绘制图形 - */ - _buildShape : function () { - var series = this.series; - // 复用参数索引 - this._paramsMap = {}; - for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type == ecConfig.CHART_TYPE_GAUGE) { - series[i] = this.reformOption(series[i]); - this._buildSingleGauge(i); - this.buildMark(i); - } - } - - this.addShapeList(); - }, - - /** - * 构建单个仪表盘 - * - * @param {number} seriesIndex 系列索引 - */ - _buildSingleGauge : function (seriesIndex) { - var serie = this.series[seriesIndex]; - - this._paramsMap[seriesIndex] = { - center : this.parseCenter(this.zr, serie.center), - radius : this.parseRadius(this.zr, serie.radius), - startAngle : serie.startAngle.toFixed(2) - 0, - endAngle : serie.endAngle.toFixed(2) - 0 - }; - this._paramsMap[seriesIndex].totalAngle = this._paramsMap[seriesIndex].startAngle - - this._paramsMap[seriesIndex].endAngle; - - this._colorMap(seriesIndex); - - this._buildAxisLine(seriesIndex); - - this._buildSplitLine(seriesIndex); - - this._buildAxisTick(seriesIndex); - - this._buildAxisLabel(seriesIndex); - - this._buildPointer(seriesIndex); - - this._buildTitle(seriesIndex); - - this._buildDetail(seriesIndex); - }, - - // 轴线 - _buildAxisLine : function (seriesIndex) { - var serie = this.series[seriesIndex]; - if (!serie.axisLine.show) { - return; - } - var min = serie.min; - var total = serie.max - min; - var params = this._paramsMap[seriesIndex]; - var center = params.center; - var startAngle = params.startAngle; - var totalAngle = params.totalAngle; - var colorArray = params.colorArray; - var lineStyle = serie.axisLine.lineStyle; - var lineWidth = this.parsePercent(lineStyle.width, params.radius[1]); - var r = params.radius[1]; - var r0 = r - lineWidth; - - var sectorShape; - var lastAngle = startAngle; - var newAngle; - for (var i = 0, l = colorArray.length; i < l; i++) { - newAngle = startAngle - totalAngle * (colorArray[i][0] - min) / total; - sectorShape = this._getSector( - center, r0, r, - newAngle, // startAngle - lastAngle, // endAngle - colorArray[i][1], // color - lineStyle - ); - lastAngle = newAngle; - sectorShape._animationAdd = 'r'; - ecData.set(sectorShape, 'seriesIndex', seriesIndex); - ecData.set(sectorShape, 'dataIndex', i); - this.shapeList.push(sectorShape); - } - }, - - // 坐标轴分割线 - _buildSplitLine : function (seriesIndex) { - var serie = this.series[seriesIndex]; - if (!serie.splitLine.show) { - return; - } - - var params = this._paramsMap[seriesIndex]; - var splitNumber = serie.splitNumber; - var min = serie.min; - var total = serie.max - min; - var splitLine = serie.splitLine; - var length = this.parsePercent( - splitLine.length, params.radius[1] - ); - var lineStyle = splitLine.lineStyle; - var color = lineStyle.color; - var center = params.center; - var startAngle = params.startAngle * Math.PI / 180; - var totalAngle = params.totalAngle * Math.PI / 180; - var r = params.radius[1]; - var r0 = r - length; - - var angle; - var sinAngle; - var cosAngle; - for (var i = 0; i <= splitNumber; i++) { - angle = startAngle - totalAngle / splitNumber * i; - sinAngle = Math.sin(angle); - cosAngle = Math.cos(angle); - this.shapeList.push(new LineShape({ - zlevel : this._zlevelBase + 1, - hoverable : false, - style : { - xStart : center[0] + cosAngle * r, - yStart : center[1] - sinAngle * r, - xEnd : center[0] + cosAngle * r0, - yEnd : center[1] - sinAngle * r0, - strokeColor : color == 'auto' - ? this._getColor(seriesIndex, min + total / splitNumber * i) - : color, - lineType : lineStyle.type, - lineWidth : lineStyle.width, - shadowColor : lineStyle.shadowColor, - shadowBlur: lineStyle.shadowBlur, - shadowOffsetX: lineStyle.shadowOffsetX, - shadowOffsetY: lineStyle.shadowOffsetY - } - })); - } - }, - - // 小标记 - _buildAxisTick : function (seriesIndex) { - var serie = this.series[seriesIndex]; - if (!serie.axisTick.show) { - return; - } - - var params = this._paramsMap[seriesIndex]; - var splitNumber = serie.splitNumber; - var min = serie.min; - var total = serie.max - min; - var axisTick = serie.axisTick; - var tickSplit = axisTick.splitNumber; - var length = this.parsePercent( - axisTick.length, params.radius[1] - ); - var lineStyle = axisTick.lineStyle; - var color = lineStyle.color; - - var center = params.center; - var startAngle = params.startAngle * Math.PI / 180; - var totalAngle = params.totalAngle * Math.PI / 180; - var r = params.radius[1]; - var r0 = r - length; - - var angle; - var sinAngle; - var cosAngle; - for (var i = 0, l = splitNumber * tickSplit; i <= l; i++) { - if (i % tickSplit === 0) { // 同splitLine - continue; - } - angle = startAngle - totalAngle / l * i; - sinAngle = Math.sin(angle); - cosAngle = Math.cos(angle); - this.shapeList.push(new LineShape({ - zlevel : this._zlevelBase + 1, - hoverable : false, - style : { - xStart : center[0] + cosAngle * r, - yStart : center[1] - sinAngle * r, - xEnd : center[0] + cosAngle * r0, - yEnd : center[1] - sinAngle * r0, - strokeColor : color == 'auto' - ? this._getColor(seriesIndex, min + total / l * i) - : color, - lineType : lineStyle.type, - lineWidth : lineStyle.width, - shadowColor : lineStyle.shadowColor, - shadowBlur: lineStyle.shadowBlur, - shadowOffsetX: lineStyle.shadowOffsetX, - shadowOffsetY: lineStyle.shadowOffsetY - } - })); - } - }, - - // 坐标轴文本 - _buildAxisLabel : function (seriesIndex) { - var serie = this.series[seriesIndex]; - if (!serie.axisLabel.show) { - return; - } - - var splitNumber = serie.splitNumber; - var min = serie.min; - var total = serie.max - min; - var textStyle = serie.axisLabel.textStyle; - var textFont = this.getFont(textStyle); - var color = textStyle.color; - - var params = this._paramsMap[seriesIndex]; - var center = params.center; - var startAngle = params.startAngle; - var totalAngle = params.totalAngle; - var r0 = params.radius[1] - - this.parsePercent( - serie.splitLine.length, params.radius[1] - ) - 10; - - var angle; - var sinAngle; - var cosAngle; - var value; - for (var i = 0; i <= splitNumber; i++) { - value = min + accMath.accMul(accMath.accDiv(total , splitNumber) , i); - angle = startAngle - totalAngle / splitNumber * i; - sinAngle = Math.sin(angle * Math.PI / 180); - cosAngle = Math.cos(angle * Math.PI / 180); - angle = (angle + 360) % 360; - this.shapeList.push(new TextShape({ - zlevel : this._zlevelBase + 1, - hoverable : false, - style : { - x : center[0] + cosAngle * r0, - y : center[1] - sinAngle * r0, - color : color == 'auto' ? this._getColor(seriesIndex, value) : color, - text : this._getLabelText(serie.axisLabel.formatter, value), - textAlign : (angle >= 110 && angle <= 250) - ? 'left' - : (angle <= 70 || angle >= 290) - ? 'right' - : 'center', - textBaseline : (angle >= 10 && angle <= 170) - ? 'top' - : (angle >= 190 && angle <= 350) - ? 'bottom' - : 'middle', - textFont : textFont, - shadowColor : textStyle.shadowColor, - shadowBlur: textStyle.shadowBlur, - shadowOffsetX: textStyle.shadowOffsetX, - shadowOffsetY: textStyle.shadowOffsetY - } - })); - } - }, - - _buildPointer : function (seriesIndex) { - var serie = this.series[seriesIndex]; - if (!serie.pointer.show) { - return; - } - var total = serie.max - serie.min; - var pointer = serie.pointer; - - var params = this._paramsMap[seriesIndex]; - var length = this.parsePercent(pointer.length, params.radius[1]); - var width = this.parsePercent(pointer.width, params.radius[1]); - var center = params.center; - var value = this._getValue(seriesIndex); - value = value < serie.max ? value : serie.max; - - var angle = (params.startAngle - params.totalAngle / total * (value - serie.min)) * Math.PI / 180; - var color = pointer.color == 'auto' - ? this._getColor(seriesIndex, value) : pointer.color; - - var pointShape = new GaugePointerShape({ - zlevel : this._zlevelBase + 1, - style : { - x : center[0], - y : center[1], - r : length, - startAngle : params.startAngle * Math.PI / 180, - angle : angle, - color : color, - width : width, - shadowColor : pointer.shadowColor, - shadowBlur: pointer.shadowBlur, - shadowOffsetX: pointer.shadowOffsetX, - shadowOffsetY: pointer.shadowOffsetY - }, - highlightStyle : { - brushType : 'fill', - width : width > 2 ? 2 : (width / 2), - color : '#fff' - } - }); - ecData.pack( - pointShape, - this.series[seriesIndex], seriesIndex, - this.series[seriesIndex].data[0], 0, - this.series[seriesIndex].data[0].name, - value - ); - this.shapeList.push(pointShape); - - this.shapeList.push(new CircleShape({ - zlevel : this._zlevelBase + 2, - hoverable : false, - style : { - x : center[0], - y : center[1], - r : pointer.width / 2.5, - color : '#fff' - } - })); - }, - - _buildTitle : function(seriesIndex) { - var serie = this.series[seriesIndex]; - if (!serie.title.show) { - return; - } - - var data = serie.data[0]; - var name = typeof data.name != 'undefined' ? data.name : ''; - if (name !== '') { - var title = serie.title; - var offsetCenter = title.offsetCenter; - var textStyle = title.textStyle; - var textColor = textStyle.color; - var params = this._paramsMap[seriesIndex]; - var x = params.center[0] + this.parsePercent(offsetCenter[0], params.radius[1]); - var y = params.center[1] + this.parsePercent(offsetCenter[1], params.radius[1]); - this.shapeList.push(new TextShape({ - zlevel : this._zlevelBase - + (Math.abs(x - params.center[0]) + Math.abs(y - params.center[1])) - < textStyle.fontSize * 2 ? 2 : 1, - hoverable : false, - style : { - x : x, - y : y, - color: textColor == 'auto' ? this._getColor(seriesIndex) : textColor, - text: name, - textAlign: 'center', - textFont : this.getFont(textStyle), - shadowColor : textStyle.shadowColor, - shadowBlur: textStyle.shadowBlur, - shadowOffsetX: textStyle.shadowOffsetX, - shadowOffsetY: textStyle.shadowOffsetY - } - })); - } - }, - - _buildDetail : function(seriesIndex) { - var serie = this.series[seriesIndex]; - if (!serie.detail.show) { - return; - } - - var detail = serie.detail; - var offsetCenter = detail.offsetCenter; - var color = detail.backgroundColor; - var textStyle = detail.textStyle; - var textColor = textStyle.color; - - var params = this._paramsMap[seriesIndex]; - var value = this._getValue(seriesIndex); - var x = params.center[0] - detail.width / 2 - + this.parsePercent(offsetCenter[0], params.radius[1]); - var y = params.center[1] - + this.parsePercent(offsetCenter[1], params.radius[1]); - this.shapeList.push(new RectangleShape({ - zlevel : this._zlevelBase - + (Math.abs(x+detail.width/2 - params.center[0]) - + Math.abs(y+detail.height/2 - params.center[1])) - < textStyle.fontSize ? 2 : 1, - hoverable : false, - style : { - x : x, - y : y, - width : detail.width, - height : detail.height, - brushType: 'both', - color: color == 'auto' ? this._getColor(seriesIndex, value) : color, - lineWidth : detail.borderWidth, - strokeColor : detail.borderColor, - - shadowColor : detail.shadowColor, - shadowBlur: detail.shadowBlur, - shadowOffsetX: detail.shadowOffsetX, - shadowOffsetY: detail.shadowOffsetY, - - text: this._getLabelText(detail.formatter, value), - textFont: this.getFont(textStyle), - textPosition: 'inside', - textColor : textColor == 'auto' ? this._getColor(seriesIndex, value) : textColor - } - })); - }, - - _getValue : function(seriesIndex) { - var data = this.series[seriesIndex].data[0]; - return typeof data.value != 'undefined' ? data.value : data; - }, - - /** - * 颜色索引 - */ - _colorMap : function (seriesIndex) { - var serie = this.series[seriesIndex]; - var min = serie.min; - var total = serie.max - min; - var color = serie.axisLine.lineStyle.color; - if (!(color instanceof Array)) { - color = [[1, color]]; - } - var colorArray = []; - for (var i = 0, l = color.length; i < l; i++) { - colorArray.push([color[i][0] * total + min, color[i][1]]); - } - this._paramsMap[seriesIndex].colorArray = colorArray; - }, - - /** - * 自动颜色 - */ - _getColor : function (seriesIndex, value) { - if (typeof value == 'undefined') { - value = this._getValue(seriesIndex); - } - - var colorArray = this._paramsMap[seriesIndex].colorArray; - for (var i = 0, l = colorArray.length; i < l; i++) { - if (colorArray[i][0] >= value) { - return colorArray[i][1]; - } - } - return colorArray[colorArray.length - 1][1]; - }, - - /** - * 构建扇形 - */ - _getSector : function (center, r0, r, startAngle, endAngle, color, lineStyle) { - return new SectorShape ({ - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : center[0], // 圆心横坐标 - y : center[1], // 圆心纵坐标 - r0 : r0, // 圆环内半径 - r : r, // 圆环外半径 - startAngle : startAngle, - endAngle : endAngle, - brushType : 'fill', - color : color, - shadowColor : lineStyle.shadowColor, - shadowBlur: lineStyle.shadowBlur, - shadowOffsetX: lineStyle.shadowOffsetX, - shadowOffsetY: lineStyle.shadowOffsetY - } - }); - }, - - /** - * 根据lable.format计算label text - */ - _getLabelText : function (formatter, value) { - if (formatter) { - if (typeof formatter == 'function') { - return formatter.call(this.myChart, value); - } - else if (typeof formatter == 'string') { - return formatter.replace('{value}', value); - } - } - return value; - }, - - /** - * 刷新 - */ - refresh : function (newOption) { - if (newOption) { - this.option = newOption; - this.series = newOption.series; - } - - this.backupShapeList(); - this._buildShape(); - } - }; - - zrUtil.inherits(Gauge, ChartBase); - zrUtil.inherits(Gauge, ComponentBase); - - // 图表注册 - require('../chart').define('gauge', Gauge); - - return Gauge; -}); -/** - * echarts图表类:漏斗图 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/chart/funnel',['require','../component/base','./base','zrender/shape/Text','zrender/shape/Line','zrender/shape/Polygon','../config','../util/ecData','../util/number','zrender/tool/util','zrender/tool/color','zrender/tool/area','../chart'],function (require) { - var ComponentBase = require('../component/base'); - var ChartBase = require('./base'); - - // 图形依赖 - var TextShape = require('zrender/shape/Text'); - var LineShape = require('zrender/shape/Line'); - var PolygonShape = require('zrender/shape/Polygon'); - - var ecConfig = require('../config'); - var ecData = require('../util/ecData'); - var number = require('../util/number'); - var zrUtil = require('zrender/tool/util'); - var zrColor = require('zrender/tool/color'); - var zrArea = require('zrender/tool/area'); - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} series 数据 - * @param {Object} component 组件 - */ - function Funnel(ecTheme, messageCenter, zr, option, myChart){ - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); - // 图表基类 - ChartBase.call(this); - this.refresh(option); - } - - Funnel.prototype = { - type : ecConfig.CHART_TYPE_FUNNEL, - /** - * 绘制图形 - */ - _buildShape : function () { - var series = this.series; - var legend = this.component.legend; - // 复用参数索引 - this._paramsMap = {}; - this._selected = {}; - this.selectedMap = {}; - - var serieName; - for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type == ecConfig.CHART_TYPE_FUNNEL) { - series[i] = this.reformOption(series[i]); - serieName = series[i].name || ''; - // 系列图例开关 - this.selectedMap[serieName] = - legend ? legend.isSelected(serieName) : true; - if (!this.selectedMap[serieName]) { - continue; - } - this._buildSingleFunnel(i); - this.buildMark(i); - } - } - - this.addShapeList(); - }, - - /** - * 构建单个仪表盘 - * - * @param {number} seriesIndex 系列索引 - */ - _buildSingleFunnel : function (seriesIndex) { - var legend = this.component.legend; - var serie = this.series[seriesIndex]; - var data = this._mapData(seriesIndex); - var location = this._getLocation(seriesIndex); - this._paramsMap[seriesIndex] = { - location : location, - data : data - }; - - var itemName; - var total = 0; - var selectedData = []; - // 计算需要显示的个数和总值 - for (var i = 0, l = data.length; i < l; i++) { - itemName = data[i].name; - if (legend){ - this.selectedMap[itemName] = legend.isSelected(itemName); - } else { - this.selectedMap[itemName] = true; - } - if (this.selectedMap[itemName] && !isNaN(data[i].value)) { - selectedData.push(data[i]); - total++; - } - } - if (total === 0) { - return; - } - // 可计算箱子 - var funnelCase = this._buildFunnelCase(seriesIndex); - var gap = serie.gap; - var height = total > 1 - ? (location.height - (total - 1) * gap) / total : location.height; - var width; - var lastY = location.y; - var lastWidth = serie.sort == 'descending' - ? this._getItemWidth(seriesIndex, selectedData[0].value) - : number.parsePercent(serie.minSize, location.width); - var next = serie.sort == 'descending' ? 1 : 0; - var centerX = location.centerX; - var pointList = [ - [ - centerX - lastWidth / 2 - (lastWidth === 0 ? 0 : 10), - lastY - (lastWidth === 0 ? 10 : 5) - ], - [ - centerX + lastWidth / 2 + (lastWidth === 0 ? 0 : 10), - lastY - (lastWidth === 0 ? 10 : 5) - ] - ]; - for (var i = 0, l = selectedData.length; i < l; i++) { - itemName = selectedData[i].name; - if (this.selectedMap[itemName] && !isNaN(selectedData[i].value)) { - width = i <= l - 2 - ? this._getItemWidth(seriesIndex, selectedData[i + next].value) - : serie.sort == 'descending' - ? number.parsePercent(serie.minSize, location.width) - : number.parsePercent(serie.maxSize, location.width); - this._buildItem( - seriesIndex, selectedData[i]._index, - legend - ? legend.getColor(itemName) : this.zr.getColor(selectedData[i]._index), - centerX - lastWidth / 2, lastY, - lastWidth, width, height - ); - lastY += height + gap; - lastWidth = width; - pointList.unshift([centerX - lastWidth / 2 - 10, lastY]); - pointList.push([centerX + lastWidth / 2 + 10, lastY]); - } - } - if (funnelCase) { - if (lastWidth === 0) { - pointList.pop(); - pointList[0][0] +=10; - pointList[0][1] +=10; - } - else { - pointList[pointList.length - 1][1] +=5; - pointList[0][1] +=5; - } - funnelCase.style.pointList = pointList; - } - }, - - _buildFunnelCase : function(seriesIndex) { - var serie = this.series[seriesIndex]; - if (this.deepQuery([serie, this.option], 'calculable')) { - var location = this._paramsMap[seriesIndex].location; - var gap = 10; - var funnelCase = { - hoverable : false, - style : { - pointListd : [ - [location.x - gap, location.y - gap], - [location.x + location.width + gap, location.y - gap], - [location.x + location.width + gap, location.y + location.height + gap], - [location.x - gap, location.y + location.height + gap] - ], - brushType : 'stroke', - lineWidth : 1, - strokeColor : serie.calculableHolderColor - || this.ecTheme.calculableHolderColor - } - }; - ecData.pack(funnelCase, serie, seriesIndex, undefined, -1); - this.setCalculable(funnelCase); - funnelCase = new PolygonShape(funnelCase); - this.shapeList.push(funnelCase); - return funnelCase; - } - }, - - _getLocation: function (seriesIndex) { - var gridOption = this.series[seriesIndex]; - var zrWidth = this.zr.getWidth(); - var zrHeight = this.zr.getHeight(); - var x = this.parsePercent(gridOption.x, zrWidth); - var y = this.parsePercent(gridOption.y, zrHeight); - - var width; - if (typeof gridOption.width == 'undefined') { - width = zrWidth - x - this.parsePercent(gridOption.x2, zrWidth); - } - else { - width = this.parsePercent(gridOption.width, zrWidth); - } - - var height; - if (typeof gridOption.height == 'undefined') { - height = zrHeight - y - this.parsePercent(gridOption.y2, zrHeight); - } - else { - height = this.parsePercent(gridOption.height, zrHeight); - } - - return { - x : x, - y : y, - width : width, - height : height, - centerX : x + width / 2 - }; - }, - - _mapData : function(seriesIndex) { - var serie = this.series[seriesIndex]; - var funnelData = zrUtil.clone(serie.data); - for (var i = 0, l = funnelData.length; i < l; i++) { - funnelData[i]._index = i; - } - function numDescending (a, b) { - if (a.value == '-') { - return 1; - } - else if (b.value == '-') { - return -1; - } - return b.value - a.value; - } - function numAscending (a, b) { - return -numDescending(a, b); - } - if (serie.sort != 'none') { - funnelData.sort(serie.sort == 'descending' ? numDescending : numAscending); - } - - return funnelData; - }, - - /** - * 构建单个扇形及指标 - */ - _buildItem : function ( - seriesIndex, dataIndex, defaultColor, - x, y, topWidth, bottomWidth, height - ) { - var series = this.series; - var serie = series[seriesIndex]; - var data = serie.data[dataIndex]; - // 漏斗 - var polygon = this.getPolygon( - seriesIndex, dataIndex, defaultColor, - x, y, topWidth, bottomWidth, height - ); - ecData.pack( - polygon, - series[seriesIndex], seriesIndex, - series[seriesIndex].data[dataIndex], dataIndex, - series[seriesIndex].data[dataIndex].name - ); - this.shapeList.push(polygon); - - // 文本标签 - var label = this.getLabel( - seriesIndex, dataIndex, defaultColor, - x, y, topWidth, bottomWidth, height - ); - ecData.pack( - label, - series[seriesIndex], seriesIndex, - series[seriesIndex].data[dataIndex], dataIndex, - series[seriesIndex].data[dataIndex].name - ); - this.shapeList.push(label); - // 特定状态下是否需要显示文本标签 - if (!this._needLabel(serie, data,false)) { - label.invisible = true; - } - - // 文本标签视觉引导线 - var labelLine = this.getLabelLine( - seriesIndex, dataIndex, defaultColor, - x, y, topWidth, bottomWidth, height - ); - this.shapeList.push(labelLine); - // 特定状态下是否需要显示文本标签引导线 - if (!this._needLabelLine(serie, data,false)) { - labelLine.invisible = true; - } - - var polygonHoverConnect = []; - var labelHoverConnect = []; - if (this._needLabelLine(serie, data, true)) { - polygonHoverConnect.push(labelLine.id); - labelHoverConnect.push(labelLine.id); - } - if (this._needLabel(serie, data, true)) { - polygonHoverConnect.push(label.id); - labelHoverConnect.push(polygon.id); - } - polygon.hoverConnect = polygonHoverConnect; - label.hoverConnect = labelHoverConnect; - polygon.onmouseover = label.onmouseover = this.hoverConnect; - }, - - /** - * 根据值计算宽度 - */ - _getItemWidth : function (seriesIndex, value) { - var serie = this.series[seriesIndex]; - var location = this._paramsMap[seriesIndex].location; - var min = serie.min; - var max = serie.max; - var minSize = number.parsePercent(serie.minSize, location.width); - var maxSize = number.parsePercent(serie.maxSize, location.width); - return value * (maxSize - minSize) / (max - min); - }, - - /** - * 构建扇形 - */ - getPolygon : function ( - seriesIndex, dataIndex, defaultColor, - x, y, topWidth, bottomWidth, height - ) { - var serie = this.series[seriesIndex]; - var data = serie.data[dataIndex]; - var queryTarget = [data, serie]; - - // 多级控制 - var normal = this.deepMerge( - queryTarget, - 'itemStyle.normal' - ) || {}; - var emphasis = this.deepMerge( - queryTarget, - 'itemStyle.emphasis' - ) || {}; - var normalColor = this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) - || defaultColor; - - var emphasisColor = this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data) - || (typeof normalColor == 'string' - ? zrColor.lift(normalColor, -0.2) - : normalColor - ); - - var polygon = { - zlevel : this._zlevelBase, - clickable : true, - style : { - pointList : [ - [x, y], - [x + topWidth, y], - [x + topWidth - (topWidth - bottomWidth) / 2, y + height], - [x + (topWidth - bottomWidth) / 2, y + height] - ], - brushType : 'both', - color : normalColor, - lineWidth : normal.borderWidth, - strokeColor : normal.borderColor - }, - highlightStyle : { - color : emphasisColor, - lineWidth : emphasis.borderWidth, - strokeColor : emphasis.borderColor - } - }; - - if (this.deepQuery([data, serie, this.option], 'calculable')) { - this.setCalculable(polygon); - polygon.draggable = true; - } - - return new PolygonShape(polygon); - }, - - /** - * 需要显示则会有返回构建好的shape,否则返回undefined - */ - getLabel : function ( - seriesIndex, dataIndex, defaultColor, - x, y, topWidth, bottomWidth, height - ) { - var serie = this.series[seriesIndex]; - var data = serie.data[dataIndex]; - var location = this._paramsMap[seriesIndex].location; - // serie里有默认配置,放心大胆的用! - var itemStyle = zrUtil.merge( - zrUtil.clone(data.itemStyle) || {}, - serie.itemStyle - ); - var status = 'normal'; - // label配置 - var labelControl = itemStyle[status].label; - var textStyle = labelControl.textStyle || {}; - var lineLength = itemStyle[status].labelLine.length; - - var text = this.getLabelText(seriesIndex, dataIndex, status); - var textFont = this.getFont(textStyle); - var textAlign; - var textX; - var textColor = defaultColor; - labelControl.position = labelControl.position - || itemStyle.normal.label.position; - if (labelControl.position == 'inner' || labelControl.position == 'inside') { - // 内部 - textAlign = 'center'; - textX = x + topWidth / 2; - if (Math.max(topWidth, bottomWidth) / 2 > zrArea.getTextWidth(text, textFont)) { - textColor = '#fff'; - } - else { - textColor = zrColor.reverse(defaultColor); - } - } - else if (labelControl.position == 'left'){ - // 左侧显示 - textAlign = 'right'; - textX = lineLength == 'auto' - ? (location.x - 10) - : (location.centerX - Math.max(topWidth, bottomWidth) / 2 - lineLength); - } - else { - // 右侧显示,默认 labelControl.position == 'outer' || 'right) - textAlign = 'left'; - textX = lineLength == 'auto' - ? (location.x + location.width + 10) - : (location.centerX + Math.max(topWidth, bottomWidth) / 2 + lineLength); - } - - var textShape = { - zlevel : this._zlevelBase + 1, - style : { - x : textX, - y : y + height / 2, - color : textStyle.color || textColor, - text : text, - textAlign : textStyle.align || textAlign, - textBaseline : textStyle.baseline || 'middle', - textFont : textFont - } - }; - - //----------高亮 - status = 'emphasis'; - // label配置 - labelControl = itemStyle[status].label || labelControl; - textStyle = labelControl.textStyle || textStyle; - lineLength = itemStyle[status].labelLine.length || lineLength; - labelControl.position = labelControl.position || itemStyle.normal.label.position; - text = this.getLabelText(seriesIndex, dataIndex, status); - textFont = this.getFont(textStyle); - textColor = defaultColor; - if (labelControl.position == 'inner' || labelControl.position == 'inside') { - // 内部 - textAlign = 'center'; - textX = x + topWidth / 2; - if (Math.max(topWidth, bottomWidth) / 2 > zrArea.getTextWidth(text, textFont)) { - textColor = '#fff'; - } - else { - textColor = zrColor.reverse(defaultColor); - } - } - else if (labelControl.position == 'left'){ - // 左侧显示 - textAlign = 'right'; - textX = lineLength == 'auto' - ? (location.x - 10) - : (location.centerX - Math.max(topWidth, bottomWidth) / 2 - lineLength); - } - else { - // 右侧显示,默认 labelControl.position == 'outer' || 'right) - textAlign = 'left'; - textX = lineLength == 'auto' - ? (location.x + location.width + 10) - : (location.centerX + Math.max(topWidth, bottomWidth) / 2 + lineLength); - } - textShape.highlightStyle = { - x : textX, - color : textStyle.color || textColor, - text : text, - textAlign : textStyle.align || textAlign, - textFont : textFont, - brushType : 'fill' - }; - - return new TextShape(textShape); - }, - - /** - * 根据lable.format计算label text - */ - getLabelText : function (seriesIndex, dataIndex, status) { - var series = this.series; - var serie = series[seriesIndex]; - var data = serie.data[dataIndex]; - var formatter = this.deepQuery( - [data, serie], - 'itemStyle.' + status + '.label.formatter' - ); - - if (formatter) { - if (typeof formatter == 'function') { - return formatter.call( - this.myChart, - serie.name, - data.name, - data.value - ); - } - else if (typeof formatter == 'string') { - formatter = formatter.replace('{a}','{a0}') - .replace('{b}','{b0}') - .replace('{c}','{c0}'); - formatter = formatter.replace('{a0}', serie.name) - .replace('{b0}', data.name) - .replace('{c0}', data.value); - - return formatter; - } - } - else { - return data.name; - } - }, - - /** - * 需要显示则会有返回构建好的shape,否则返回undefined - */ - getLabelLine : function ( - seriesIndex, dataIndex, defaultColor, - x, y, topWidth, bottomWidth, height - ) { - var serie = this.series[seriesIndex]; - var data = serie.data[dataIndex]; - var location = this._paramsMap[seriesIndex].location; - - // serie里有默认配置,放心大胆的用! - var itemStyle = zrUtil.merge( - zrUtil.clone(data.itemStyle) || {}, - serie.itemStyle - ); - var status = 'normal'; - // labelLine配置 - var labelLineControl = itemStyle[status].labelLine; - var lineLength = itemStyle[status].labelLine.length; - var lineStyle = labelLineControl.lineStyle || {}; - - var labelControl = itemStyle[status].label; - labelControl.position = labelControl.position - || itemStyle.normal.label.position; - var xEnd; - if (labelControl.position == 'inner' || labelControl.position == 'inside') { - // 内部 - xEnd = x + topWidth / 2; - } - else if (labelControl.position == 'left'){ - // 左侧显示 - xEnd = lineLength == 'auto' - ? (location.x - 10) - : (location.centerX - Math.max(topWidth, bottomWidth) / 2 - lineLength); - } - else { - // 右侧显示,默认 labelControl.position == 'outer' || 'right) - xEnd = lineLength == 'auto' - ? (location.x + location.width + 10) - : (location.centerX + Math.max(topWidth, bottomWidth) / 2 + lineLength); - } - var lineShape = { - zlevel : this._zlevelBase + 1, - hoverable : false, - style : { - xStart : location.centerX, - yStart : y + height / 2, - xEnd : xEnd, - yEnd : y + height / 2, - strokeColor : lineStyle.color || defaultColor, - lineType : lineStyle.type, - lineWidth : lineStyle.width - } - }; - - status = 'emphasis'; - // labelLine配置 - labelLineControl = itemStyle[status].labelLine || labelLineControl; - lineLength = itemStyle[status].labelLine.length || lineLength; - lineStyle = labelLineControl.lineStyle || lineStyle; - - labelControl = itemStyle[status].label || labelControl; - labelControl.position = labelControl.position; - if (labelControl.position == 'inner' || labelControl.position == 'inside') { - // 内部 - xEnd = x + topWidth / 2; - } - else if (labelControl.position == 'left'){ - // 左侧显示 - xEnd = lineLength == 'auto' - ? (location.x - 10) - : (location.centerX - Math.max(topWidth, bottomWidth) / 2 - lineLength); - } - else { - // 右侧显示,默认 labelControl.position == 'outer' || 'right) - xEnd = lineLength == 'auto' - ? (location.x + location.width + 10) - : (location.centerX + Math.max(topWidth, bottomWidth) / 2 + lineLength); - } - lineShape.highlightStyle = { - xEnd : xEnd, - strokeColor : lineStyle.color || defaultColor, - lineType : lineStyle.type, - lineWidth : lineStyle.width - }; - - return new LineShape(lineShape); - }, - - /** - * 返回特定状态(normal or emphasis)下是否需要显示label标签文本 - * @param {Object} serie - * @param {Object} data - * @param {boolean} isEmphasis true is 'emphasis' and false is 'normal' - */ - _needLabel : function (serie, data, isEmphasis) { - return this.deepQuery( - [data, serie], - 'itemStyle.' - + (isEmphasis ? 'emphasis' : 'normal') - + '.label.show' - ); - }, - - /** - * 返回特定状态(normal or emphasis)下是否需要显示labelLine标签视觉引导线 - * @param {Object} serie - * @param {Object} data - * @param {boolean} isEmphasis true is 'emphasis' and false is 'normal' - */ - _needLabelLine : function (serie, data, isEmphasis) { - return this.deepQuery( - [data, serie], - 'itemStyle.' - + (isEmphasis ? 'emphasis' : 'normal') - +'.labelLine.show' - ); - }, - - /** - * 刷新 - */ - refresh : function (newOption) { - if (newOption) { - this.option = newOption; - this.series = newOption.series; - } - - this.backupShapeList(); - this._buildShape(); - } - }; - - zrUtil.inherits(Funnel, ChartBase); - zrUtil.inherits(Funnel, ComponentBase); - - // 图表注册 - require('../chart').define('funnel', Funnel); - - return Funnel; -}); -/** - * echarts组件: 类目轴 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/component/categoryAxis',['require','./base','zrender/shape/Text','zrender/shape/Line','zrender/shape/Rectangle','../config','zrender/tool/util','zrender/tool/area','../component'],function (require) { - var Base = require('./base'); - - // 图形依赖 - var TextShape = require('zrender/shape/Text'); - var LineShape = require('zrender/shape/Line'); - var RectangleShape = require('zrender/shape/Rectangle'); - - var ecConfig = require('../config'); - var zrUtil = require('zrender/tool/util'); - var zrArea = require('zrender/tool/area'); - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} option 类目轴参数 - * @param {Grid} component 组件 - */ - function CategoryAxis(ecTheme, messageCenter, zr, option, myChart, axisBase) { - if (option.data.length < 1) { - console.error('option.data.length < 1.'); - return; - } - - Base.call(this, ecTheme, messageCenter, zr, option, myChart); - - this.grid = this.component.grid; - - for (var method in axisBase) { - this[method] = axisBase[method]; - } - - this.refresh(option); - } - - CategoryAxis.prototype = { - type : ecConfig.COMPONENT_TYPE_AXIS_CATEGORY, - _getReformedLabel : function (idx) { - var data = typeof this.option.data[idx].value != 'undefined' - ? this.option.data[idx].value - : this.option.data[idx]; - var formatter = this.option.data[idx].formatter - || this.option.axisLabel.formatter; - if (formatter) { - if (typeof formatter == 'function') { - data = formatter.call(this.myChart, data); - } - else if (typeof formatter == 'string') { - data = formatter.replace('{value}', data); - } - } - return data; - }, - - /** - * 计算标签显示挑选间隔 - */ - _getInterval : function () { - var interval = this.option.axisLabel.interval; - if (interval == 'auto') { - // 麻烦的自适应计算 - var fontSize = this.option.axisLabel.textStyle.fontSize; - var data = this.option.data; - var dataLength = this.option.data.length; - - if (this.isHorizontal()) { - // 横向 - if (dataLength > 3) { - var gap = this.getGap(); - var isEnough = false; - var labelSpace; - var labelSize; - var step = Math.floor(0.5 / gap); - step = step < 1 ? 1 : step; - interval = Math.floor(15 / gap); - while (!isEnough && interval < dataLength) { - interval += step; - isEnough = true; - labelSpace = Math.floor(gap * interval); // 标签左右至少间隔为3px - for (var i = Math.floor((dataLength - 1)/ interval) * interval; - i >= 0; i -= interval - ) { - if (this.option.axisLabel.rotate !== 0) { - // 有旋转 - labelSize = fontSize; - } - else if (data[i].textStyle) { - labelSize = zrArea.getTextWidth( - this._getReformedLabel(i), - this.getFont( - zrUtil.merge( - data[i].textStyle, - this.option.axisLabel.textStyle - ) - ) - ); - } - else { - /* - labelSize = zrArea.getTextWidth( - this._getReformedLabel(i), - font - ); - */ - // 不定义data级特殊文本样式,用fontSize优化getTextWidth - var label = this._getReformedLabel(i) + ''; - var wLen = (label.match(/\w/g) || '').length; - var oLen = label.length - wLen; - labelSize = wLen * fontSize * 2 / 3 + oLen * fontSize; - } - - if (labelSpace < labelSize) { - // 放不下,中断循环让interval++ - isEnough = false; - break; - } - } - } - } - else { - // 少于3个则全部显示 - interval = 1; - } - } - else { - // 纵向 - if (dataLength > 3) { - var gap = this.getGap(); - interval = Math.floor(11 / gap); - // 标签上下至少间隔为3px - while ((gap * interval - 6) < fontSize - && interval < dataLength - ) { - interval++; - } - } - else { - // 少于3个则全部显示 - interval = 1; - } - } - } - else { - // 用户自定义间隔 - interval = interval - 0 + 1; - } - - return interval; - }, - - /** - * 绘制图形 - */ - _buildShape : function () { - // 标签显示的挑选间隔 - this._interval = this._getInterval(); - - this.option.splitArea.show && this._buildSplitArea(); - this.option.splitLine.show && this._buildSplitLine(); - this.option.axisLine.show && this._buildAxisLine(); - this.option.axisTick.show && this._buildAxisTick(); - this.option.axisLabel.show && this._buildAxisLabel(); - - for (var i = 0, l = this.shapeList.length; i < l; i++) { - this.zr.addShape(this.shapeList[i]); - } - }, - - // 小标记 - _buildAxisTick : function () { - var axShape; - //var data = this.option.data; - var dataLength = this.option.data.length; - var tickOption = this.option.axisTick; - var length = tickOption.length; - var color = tickOption.lineStyle.color; - var lineWidth = tickOption.lineStyle.width; - var interval = tickOption.interval == 'auto' - ? this._interval : (tickOption.interval - 0 + 1); - var onGap = tickOption.onGap; - var optGap = onGap - ? (this.getGap() / 2) - : typeof onGap == 'undefined' - ? (this.option.boundaryGap ? (this.getGap() / 2) : 0) - : 0; - var startIndex = optGap > 0 ? -interval : 0; - if (this.isHorizontal()) { - // 横向 - var yPosition = this.option.position == 'bottom' - ? (tickOption.inside - ? (this.grid.getYend() - length - 1) : (this.grid.getYend() + 1)) - : (tickOption.inside - ? (this.grid.getY() + 1) : (this.grid.getY() - length - 1)); - var x; - for (var i = startIndex; i < dataLength; i += interval) { - // 亚像素优化 - x = this.subPixelOptimize( - this.getCoordByIndex(i) + (i >= 0 ? optGap : 0), lineWidth - ); - axShape = { - _axisShape : 'axisTick', - zlevel : this._zlevelBase, - hoverable : false, - style : { - xStart : x, - yStart : yPosition, - xEnd : x, - yEnd : yPosition + length, - strokeColor : color, - lineWidth : lineWidth - } - }; - this.shapeList.push(new LineShape(axShape)); - } - } - else { - // 纵向 - var xPosition = this.option.position == 'left' - ? (tickOption.inside - ? (this.grid.getX() + 1) : (this.grid.getX() - length - 1)) - : (tickOption.inside - ? (this.grid.getXend() - length - 1) : (this.grid.getXend() + 1)); - - var y; - for (var i = startIndex; i < dataLength; i += interval) { - // 亚像素优化 - y = this.subPixelOptimize( - this.getCoordByIndex(i) - (i >= 0 ? optGap : 0), lineWidth - ); - axShape = { - _axisShape : 'axisTick', - zlevel : this._zlevelBase, - hoverable : false, - style : { - xStart : xPosition, - yStart : y, - xEnd : xPosition + length, - yEnd : y, - strokeColor : color, - lineWidth : lineWidth - } - }; - this.shapeList.push(new LineShape(axShape)); - } - } - }, - - // 坐标轴文本 - _buildAxisLabel : function () { - var axShape; - var data = this.option.data; - var dataLength = this.option.data.length; - var rotate = this.option.axisLabel.rotate; - var margin = this.option.axisLabel.margin; - var clickable = this.option.axisLabel.clickable; - var textStyle = this.option.axisLabel.textStyle; - var dataTextStyle; - - if (this.isHorizontal()) { - // 横向 - var yPosition; - var baseLine; - if (this.option.position == 'bottom') { - yPosition = this.grid.getYend() + margin; - baseLine = 'top'; - } - else { - yPosition = this.grid.getY() - margin; - baseLine = 'bottom'; - } - - for (var i = 0; i < dataLength; i += this._interval) { - if (this._getReformedLabel(i) === '') { - // 空文本优化 - continue; - } - dataTextStyle = zrUtil.merge( - data[i].textStyle || {}, - textStyle - ); - axShape = { - // shape : 'text', - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : this.getCoordByIndex(i), - y : yPosition, - color : dataTextStyle.color, - text : this._getReformedLabel(i), - textFont : this.getFont(dataTextStyle), - textAlign : dataTextStyle.align || 'center', - textBaseline : dataTextStyle.baseline || baseLine - } - }; - if (rotate) { - axShape.style.textAlign = rotate > 0 - ? (this.option.position == 'bottom' - ? 'right' : 'left') - : (this.option.position == 'bottom' - ? 'left' : 'right'); - axShape.rotation = [ - rotate * Math.PI / 180, - axShape.style.x, - axShape.style.y - ]; - } - this.shapeList.push(new TextShape( - this._axisLabelClickable(clickable, axShape) - )); - } - } - else { - // 纵向 - var xPosition; - var align; - if (this.option.position == 'left') { - xPosition = this.grid.getX() - margin; - align = 'right'; - } - else { - xPosition = this.grid.getXend() + margin; - align = 'left'; - } - - for (var i = 0; i < dataLength; i += this._interval) { - if (this._getReformedLabel(i) === '') { - // 空文本优化 - continue; - } - dataTextStyle = zrUtil.merge( - data[i].textStyle || {}, - textStyle - ); - axShape = { - // shape : 'text', - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : xPosition, - y : this.getCoordByIndex(i), - color : dataTextStyle.color, - text : this._getReformedLabel(i), - textFont : this.getFont(dataTextStyle), - textAlign : dataTextStyle.align || align, - textBaseline : dataTextStyle.baseline - || (i === 0 && this.option.name !== '') - ? 'bottom' - : (i == (dataLength - 1) - && this.option.name !== '') - ? 'top' - : 'middle' - } - }; - - if (rotate) { - axShape.rotation = [ - rotate * Math.PI / 180, - axShape.style.x, - axShape.style.y - ]; - } - this.shapeList.push(new TextShape( - this._axisLabelClickable(clickable, axShape) - )); - } - } - }, - - _buildSplitLine : function () { - var axShape; - //var data = this.option.data; - var dataLength = this.option.data.length; - var sLineOption = this.option.splitLine; - var lineType = sLineOption.lineStyle.type; - var lineWidth = sLineOption.lineStyle.width; - var color = sLineOption.lineStyle.color; - color = color instanceof Array ? color : [color]; - var colorLength = color.length; - - var onGap = sLineOption.onGap; - var optGap = onGap - ? (this.getGap() / 2) - : typeof onGap == 'undefined' - ? (this.option.boundaryGap ? (this.getGap() / 2) : 0) - : 0; - dataLength -= (onGap || (typeof onGap == 'undefined' && this.option.boundaryGap)) - ? 1 : 0; - if (this.isHorizontal()) { - // 横向 - var sy = this.grid.getY(); - var ey = this.grid.getYend(); - var x; - - for (var i = 0; i < dataLength; i += this._interval) { - // 亚像素优化 - x = this.subPixelOptimize( - this.getCoordByIndex(i) + optGap, lineWidth - ); - axShape = { - // shape : 'line', - zlevel : this._zlevelBase, - hoverable : false, - style : { - xStart : x, - yStart : sy, - xEnd : x, - yEnd : ey, - strokeColor : color[(i / this._interval) % colorLength], - lineType : lineType, - lineWidth : lineWidth - } - }; - this.shapeList.push(new LineShape(axShape)); - } - - } - else { - // 纵向 - var sx = this.grid.getX(); - var ex = this.grid.getXend(); - var y; - - for (var i = 0; i < dataLength; i += this._interval) { - // 亚像素优化 - y = this.subPixelOptimize( - this.getCoordByIndex(i) - optGap, lineWidth - ); - axShape = { - // shape : 'line', - zlevel : this._zlevelBase, - hoverable : false, - style : { - xStart : sx, - yStart : y, - xEnd : ex, - yEnd : y, - strokeColor : color[(i / this._interval) % colorLength], - linetype : lineType, - lineWidth : lineWidth - } - }; - this.shapeList.push(new LineShape(axShape)); - } - } - }, - - _buildSplitArea : function () { - var axShape; - var sAreaOption = this.option.splitArea; - var color = sAreaOption.areaStyle.color; - if (!(color instanceof Array)) { - // 非数组一律认为是单一颜色的字符串,单一颜色则用一个背景,颜色错误不负责啊!!! - axShape = { - // shape : 'rectangle', - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : this.grid.getX(), - y : this.grid.getY(), - width : this.grid.getWidth(), - height : this.grid.getHeight(), - color : color - // type : this.option.splitArea.areaStyle.type, - } - }; - this.shapeList.push(new RectangleShape(axShape)); - } - else { - // 多颜色 - var colorLength = color.length; - var dataLength = this.option.data.length; - - var onGap = sAreaOption.onGap; - var optGap = onGap - ? (this.getGap() / 2) - : typeof onGap == 'undefined' - ? (this.option.boundaryGap ? (this.getGap() / 2) : 0) - : 0; - if (this.isHorizontal()) { - // 横向 - var y = this.grid.getY(); - var height = this.grid.getHeight(); - var lastX = this.grid.getX(); - var curX; - - for (var i = 0; i <= dataLength; i += this._interval) { - curX = i < dataLength - ? (this.getCoordByIndex(i) + optGap) - : this.grid.getXend(); - axShape = { - // shape : 'rectangle', - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : lastX, - y : y, - width : curX - lastX, - height : height, - color : color[(i / this._interval) % colorLength] - // type : this.option.splitArea.areaStyle.type, - } - }; - this.shapeList.push(new RectangleShape(axShape)); - lastX = curX; - } - } - else { - // 纵向 - var x = this.grid.getX(); - var width = this.grid.getWidth(); - var lastYend = this.grid.getYend(); - var curY; - - for (var i = 0; i <= dataLength; i += this._interval) { - curY = i < dataLength - ? (this.getCoordByIndex(i) - optGap) - : this.grid.getY(); - axShape = { - // shape : 'rectangle', - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : x, - y : curY, - width : width, - height : lastYend - curY, - color : color[(i / this._interval) % colorLength] - // type : this.option.splitArea.areaStyle.type - } - }; - this.shapeList.push(new RectangleShape(axShape)); - lastYend = curY; - } - } - } - }, - - /** - * 刷新 - */ - refresh : function (newOption) { - if (newOption) { - this.option = this.reformOption(newOption); - // 通用字体设置 - this.option.axisLabel.textStyle = zrUtil.merge( - this.option.axisLabel.textStyle || {}, - this.ecTheme.textStyle - ); - } - this.clear(); - this._buildShape(); - }, - - /** - * 返回间隔 - */ - getGap : function () { - var dataLength = this.option.data.length; - var total = this.isHorizontal() - ? this.grid.getWidth() - : this.grid.getHeight(); - if (this.option.boundaryGap) { // 留空 - return total / dataLength; - } - else { // 顶头 - return total / (dataLength > 1 ? (dataLength - 1) : 1); - } - }, - - // 根据值换算位置 - getCoord : function (value) { - var data = this.option.data; - var dataLength = data.length; - var gap = this.getGap(); - var position = this.option.boundaryGap ? (gap / 2) : 0; - - for (var i = 0; i < dataLength; i++) { - if (data[i] == value - || (typeof data[i].value != 'undefined' - && data[i].value == value) - ) { - if (this.isHorizontal()) { - // 横向 - position = this.grid.getX() + position; - } - else { - // 纵向 - position = this.grid.getYend() - position; - } - - return position; - // Math.floor可能引起一些偏差,但性能会更好 - /* 准确更重要 - return (i === 0 || i == dataLength - 1) - ? position - : Math.floor(position); - */ - } - position += gap; - } - }, - - // 根据类目轴数据索引换算位置 - getCoordByIndex : function (dataIndex) { - if (dataIndex < 0) { - if (this.isHorizontal()) { - return this.grid.getX(); - } - else { - return this.grid.getYend(); - } - } - else if (dataIndex > this.option.data.length - 1) { - if (this.isHorizontal()) { - return this.grid.getXend(); - } - else { - return this.grid.getY(); - } - } - else { - var gap = this.getGap(); - var position = this.option.boundaryGap ? (gap / 2) : 0; - position += dataIndex * gap; - - if (this.isHorizontal()) { - // 横向 - position = this.grid.getX() + position; - } - else { - // 纵向 - position = this.grid.getYend() - position; - } - - return position; - /* 准确更重要 - return (dataIndex === 0 || dataIndex == this.option.data.length - 1) - ? position - : Math.floor(position); - */ - } - }, - - // 根据类目轴数据索引换算类目轴名称 - getNameByIndex : function (dataIndex) { - var data = this.option.data[dataIndex]; - if (typeof data != 'undefined' && typeof data.value != 'undefined') - { - return data.value; - } - else { - return data; - } - }, - - // 根据类目轴名称换算类目轴数据索引 - getIndexByName : function (name) { - var data = this.option.data; - var dataLength = data.length; - - for (var i = 0; i < dataLength; i++) { - if (data[i] == name - || (typeof data[i].value != 'undefined' - && data[i].value == name) - ) { - return i; - } - } - - return -1; - }, - - // 根据位置换算值 - getValueFromCoord : function() { - return ''; - }, - - /** - * 根据类目轴数据索引返回是否为主轴线 - * @param {number} dataIndex 类目轴数据索引 - * @return {boolean} 是否为主轴 - */ - isMainAxis : function (dataIndex) { - return dataIndex % this._interval === 0; - } - }; - - zrUtil.inherits(CategoryAxis, Base); - - require('../component').define('categoryAxis', CategoryAxis); - - return CategoryAxis; -}); -/** - * echarts组件: 数值轴 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','zrender/shape/Line','zrender/shape/Rectangle','../config','zrender/tool/util','../component'],function (require) { - var Base = require('./base'); - - // 图形依赖 - var TextShape = require('zrender/shape/Text'); - var LineShape = require('zrender/shape/Line'); - var RectangleShape = require('zrender/shape/Rectangle'); - - var ecConfig = require('../config'); - var zrUtil = require('zrender/tool/util'); - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} option 类目轴参数 - * @param {Object} component 组件 - * @param {Array} series 数据对象 - */ - function ValueAxis(ecTheme, messageCenter, zr, option, myChart, axisBase, series) { - if (!series || series.length === 0) { - console.err('option.series.length == 0.'); - return; - } - - Base.call(this, ecTheme, messageCenter, zr, option, myChart); - - this.series = series; - this.grid = this.component.grid; - - for (var method in axisBase) { - this[method] = axisBase[method]; - } - - this.refresh(option, series); - } - - ValueAxis.prototype = { - type : ecConfig.COMPONENT_TYPE_AXIS_VALUE, - _buildShape : function () { - this._hasData = false; - this._calculateValue(); - if (!this._hasData) { - return; - } - this.option.splitArea.show && this._buildSplitArea(); - this.option.splitLine.show && this._buildSplitLine(); - this.option.axisLine.show && this._buildAxisLine(); - this.option.axisTick.show && this._buildAxisTick(); - this.option.axisLabel.show && this._buildAxisLabel(); - - for (var i = 0, l = this.shapeList.length; i < l; i++) { - this.zr.addShape(this.shapeList[i]); - } - }, - - // 小标记 - _buildAxisTick : function () { - var axShape; - var data = this._valueList; - var dataLength = this._valueList.length; - var tickOption = this.option.axisTick; - var length = tickOption.length; - var color = tickOption.lineStyle.color; - var lineWidth = tickOption.lineStyle.width; - - if (this.isHorizontal()) { - // 横向 - var yPosition = this.option.position == 'bottom' - ? (tickOption.inside - ? (this.grid.getYend() - length - 1) : (this.grid.getYend()) + 1) - : (tickOption.inside - ? (this.grid.getY() + 1) : (this.grid.getY() - length - 1)); - var x; - for (var i = 0; i < dataLength; i++) { - // 亚像素优化 - x = this.subPixelOptimize(this.getCoord(data[i]), lineWidth); - axShape = { - _axisShape : 'axisTick', - zlevel : this._zlevelBase, - hoverable : false, - style : { - xStart : x, - yStart : yPosition, - xEnd : x, - yEnd : yPosition + length, - strokeColor : color, - lineWidth : lineWidth - } - }; - this.shapeList.push(new LineShape(axShape)); - } - } - else { - // 纵向 - var xPosition = this.option.position == 'left' - ? (tickOption.inside - ? (this.grid.getX() + 1) : (this.grid.getX() - length - 1)) - : (tickOption.inside - ? (this.grid.getXend() - length - 1) : (this.grid.getXend() + 1)); - - var y; - for (var i = 0; i < dataLength; i++) { - // 亚像素优化 - y = this.subPixelOptimize(this.getCoord(data[i]), lineWidth); - axShape = { - _axisShape : 'axisTick', - zlevel : this._zlevelBase, - hoverable : false, - style : { - xStart : xPosition, - yStart : y, - xEnd : xPosition + length, - yEnd : y, - strokeColor : color, - lineWidth : lineWidth - } - }; - this.shapeList.push(new LineShape(axShape)); - } - } - }, - - // 坐标轴文本 - _buildAxisLabel : function () { - var axShape; - var data = this._valueList; - var dataLength = this._valueList.length; - var rotate = this.option.axisLabel.rotate; - var margin = this.option.axisLabel.margin; - var clickable = this.option.axisLabel.clickable; - var textStyle = this.option.axisLabel.textStyle; - - if (this.isHorizontal()) { - // 横向 - var yPosition; - var baseLine; - if (this.option.position == 'bottom') { - yPosition = this.grid.getYend() + margin; - baseLine = 'top'; - } - else { - yPosition = this.grid.getY() - margin; - baseLine = 'bottom'; - } - - for (var i = 0; i < dataLength; i++) { - axShape = { - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : this.getCoord(data[i]), - y : yPosition, - color : typeof textStyle.color == 'function' - ? textStyle.color(data[i]) : textStyle.color, - text : this._valueLabel[i], - textFont : this.getFont(textStyle), - textAlign : textStyle.align || 'center', - textBaseline : textStyle.baseline || baseLine - } - }; - if (rotate) { - axShape.style.textAlign = rotate > 0 - ? (this.option.position == 'bottom' - ? 'right' : 'left') - : (this.option.position == 'bottom' - ? 'left' : 'right'); - axShape.rotation = [ - rotate * Math.PI / 180, - axShape.style.x, - axShape.style.y - ]; - } - this.shapeList.push(new TextShape( - this._axisLabelClickable(clickable, axShape) - )); - } - } - else { - // 纵向 - var xPosition; - var align; - if (this.option.position == 'left') { - xPosition = this.grid.getX() - margin; - align = 'right'; - } - else { - xPosition = this.grid.getXend() + margin; - align = 'left'; - } - - for (var i = 0; i < dataLength; i++) { - axShape = { - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : xPosition, - y : this.getCoord(data[i]), - color : typeof textStyle.color == 'function' - ? textStyle.color(data[i]) : textStyle.color, - text : this._valueLabel[i], - textFont : this.getFont(textStyle), - textAlign : textStyle.align || align, - textBaseline : textStyle.baseline - || (i === 0 && this.option.name !== '') - ? 'bottom' - : (i == (dataLength - 1) - && this.option.name !== '') - ? 'top' - : 'middle' - } - }; - - if (rotate) { - axShape.rotation = [ - rotate * Math.PI / 180, - axShape.style.x, - axShape.style.y - ]; - } - this.shapeList.push(new TextShape( - this._axisLabelClickable(clickable, axShape) - )); - } - } - }, - - _buildSplitLine : function () { - var axShape; - var data = this._valueList; - var dataLength = this._valueList.length; - var sLineOption = this.option.splitLine; - var lineType = sLineOption.lineStyle.type; - var lineWidth = sLineOption.lineStyle.width; - var color = sLineOption.lineStyle.color; - color = color instanceof Array ? color : [color]; - var colorLength = color.length; - - if (this.isHorizontal()) { - // 横向 - var sy = this.grid.getY(); - var ey = this.grid.getYend(); - var x; - - for (var i = 0; i < dataLength; i++) { - // 亚像素优化 - x = this.subPixelOptimize(this.getCoord(data[i]), lineWidth); - axShape = { - zlevel : this._zlevelBase, - hoverable : false, - style : { - xStart : x, - yStart : sy, - xEnd : x, - yEnd : ey, - strokeColor : color[i % colorLength], - lineType : lineType, - lineWidth : lineWidth - } - }; - this.shapeList.push(new LineShape(axShape)); - } - - } - else { - // 纵向 - var sx = this.grid.getX(); - var ex = this.grid.getXend(); - var y; - - for (var i = 0; i < dataLength; i++) { - // 亚像素优化 - y = this.subPixelOptimize(this.getCoord(data[i]), lineWidth); - axShape = { - zlevel : this._zlevelBase, - hoverable : false, - style : { - xStart : sx, - yStart : y, - xEnd : ex, - yEnd : y, - strokeColor : color[i % colorLength], - lineType : lineType, - lineWidth : lineWidth - } - }; - this.shapeList.push(new LineShape(axShape)); - } - } - }, - - _buildSplitArea : function () { - var axShape; - var color = this.option.splitArea.areaStyle.color; - - if (!(color instanceof Array)) { - // 非数组一律认为是单一颜色的字符串,单一颜色则用一个背景,颜色错误不负责啊!!! - axShape = { - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : this.grid.getX(), - y : this.grid.getY(), - width : this.grid.getWidth(), - height : this.grid.getHeight(), - color : color - // type : this.option.splitArea.areaStyle.type, - } - }; - this.shapeList.push(new RectangleShape(axShape)); - } - else { - // 多颜色 - var colorLength = color.length; - var data = this._valueList; - var dataLength = this._valueList.length; - - if (this.isHorizontal()) { - // 横向 - var y = this.grid.getY(); - var height = this.grid.getHeight(); - var lastX = this.grid.getX(); - var curX; - - for (var i = 0; i <= dataLength; i++) { - curX = i < dataLength - ? this.getCoord(data[i]) - : this.grid.getXend(); - axShape = { - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : lastX, - y : y, - width : curX - lastX, - height : height, - color : color[i % colorLength] - // type : this.option.splitArea.areaStyle.type, - } - }; - this.shapeList.push(new RectangleShape(axShape)); - lastX = curX; - } - } - else { - // 纵向 - var x = this.grid.getX(); - var width = this.grid.getWidth(); - var lastYend = this.grid.getYend(); - var curY; - - for (var i = 0; i <= dataLength; i++) { - curY = i < dataLength - ? this.getCoord(data[i]) - : this.grid.getY(); - axShape = { - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : x, - y : curY, - width : width, - height : lastYend - curY, - color : color[i % colorLength] - // type : this.option.splitArea.areaStyle.type - } - }; - this.shapeList.push(new RectangleShape(axShape)); - lastYend = curY; - } - } - } - }, - - /** - * 极值计算 - */ - _calculateValue : function () { - if (isNaN(this.option.min - 0) || isNaN(this.option.max - 0)) { - // 有一个没指定都得算 - // 数据整形 - var oriData; // 原始数据 - var data = {}; // 整形后数据抽取 - var value; - var xIdx; - var yIdx; - var legend = this.component.legend; - for (var i = 0, l = this.series.length; i < l; i++) { - if (this.series[i].type != ecConfig.CHART_TYPE_LINE - && this.series[i].type != ecConfig.CHART_TYPE_BAR - && this.series[i].type != ecConfig.CHART_TYPE_SCATTER - && this.series[i].type != ecConfig.CHART_TYPE_K - ) { - // 非坐标轴支持的不算极值 - continue; - } - // 请允许我写开,跟上面一个不是一样东西 - if (legend && !legend.isSelected(this.series[i].name)){ - continue; - } - - // 不指定默认为第一轴线 - xIdx = this.series[i].xAxisIndex || 0; - yIdx = this.series[i].yAxisIndex || 0; - if ((this.option.xAxisIndex != xIdx) - && (this.option.yAxisIndex != yIdx) - ) { - // 不是自己的数据不计算极值 - continue; - } - - var key = this.series[i].name || 'kener'; - if (!this.series[i].stack) { - data[key] = data[key] || []; - oriData = this.series[i].data; - for (var j = 0, k = oriData.length; j < k; j++) { - value = typeof oriData[j].value != 'undefined' - ? oriData[j].value - : oriData[j]; - if (this.series[i].type == ecConfig.CHART_TYPE_SCATTER) { - if (this.option.xAxisIndex != -1) { - data[key].push(value[0]); - } - if (this.option.yAxisIndex != -1) { - data[key].push(value[1]); - } - } - else if (this.series[i].type == ecConfig.CHART_TYPE_K) { - data[key].push(value[0]); - data[key].push(value[1]); - data[key].push(value[2]); - data[key].push(value[3]); - } - else { - data[key].push(value); - } - } - } - else { - // 堆积数据,需要区分正负向堆积 - var keyP = '__Magic_Key_Positive__' + this.series[i].stack; - var keyN = '__Magic_Key_Negative__' + this.series[i].stack; - data[keyP] = data[keyP] || []; - data[keyN] = data[keyN] || []; - data[key] = data[key] || []; // scale下还需要记录每一个量 - oriData = this.series[i].data; - for (var j = 0, k = oriData.length; j < k; j++) { - value = typeof oriData[j].value != 'undefined' - ? oriData[j].value - : oriData[j]; - if (value == '-') { - continue; - } - value = value - 0; - if (value >= 0) { - if (typeof data[keyP][j] != 'undefined') { - data[keyP][j] += value; - } - else { - data[keyP][j] = value; - } - } - else { - if (typeof data[keyN][j] != 'undefined') { - data[keyN][j] += value; - } - else { - data[keyN][j] = value; - } - } - if (this.option.scale) { - data[key].push(value); - } - } - } - } - // 找极值 - for (var i in data){ - oriData = data[i]; - for (var j = 0, k = oriData.length; j < k; j++) { - if (!isNaN(oriData[j])){ - this._hasData = true; - this._min = oriData[j]; - this._max = oriData[j]; - break; - } - } - if (this._hasData) { - break; - } - } - for (var i in data){ - oriData = data[i]; - for (var j = 0, k = oriData.length; j < k; j++) { - if (!isNaN(oriData[j])){ - this._min = Math.min(this._min, oriData[j]); - this._max = Math.max(this._max, oriData[j]); - } - } - } - - //console.log(this._min,this._max,'vvvvv111111') - this._min = isNaN(this.option.min - 0) - ? (this._min - Math.abs(this._min * this.option.boundaryGap[0])) - : (this.option.min - 0); // 指定min忽略boundaryGay[0] - - this._max = isNaN(this.option.max - 0) - ? (this._max + Math.abs(this._max * this.option.boundaryGap[1])) - : (this.option.max - 0); // 指定max忽略boundaryGay[1] - if (this._min == this._max) { - if (this._max === 0) { - // 修复全0数据 - this._max = this.option.power > 0 ? this.option.power : 1; - } - // 修复最大值==最小值时数据整形 - else if (this._max > 0) { - this._min = this._max / this.option.splitNumber; - } - else { // this._max < 0 - this._max = this._max / this.option.splitNumber; - } - } - this._reformValue(this.option.scale); - } - else { - this._hasData = true; - // 用户指定min max就不多管闲事了 - this._min = this.option.min - 0; // 指定min忽略boundaryGay[0] - this._max = this.option.max - 0; // 指定max忽略boundaryGay[1] - this._customerValue(); - } - }, - - /** - * 找到原始数据的极值后根据选项整形最终 this._min / this._max / this._valueList - * 如果你不知道这个“整形”的用义,请不要试图去理解和修改这个方法!找我也没用,我相信我已经记不起来! - * 如果你有更简洁的数学推导欢迎重写,后果自负~ - * 一旦你不得不遇到了需要修改或重写的厄运,希望下面的脚手架能帮助你 - * ps:其实我是想说别搞砸了!升级后至少得保证这些case通过!! - * - * by linzhifeng@baidu.com 2013-1-8 - * -------- - this._valueList = []; - this.option = {splitNumber:5,power:100,precision:0}; - this._min = 1; this._max = 123; console.log(this._min, this._max); this._reformValue(); - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : 0 150 [0, 30, 60, 90, 120, 150]', - (this._min == 0 && this._max == 150) ? 'success' : 'failed'); - - this._min = 10; this._max = 1923; console.log(this._min, this._max); this._reformValue(); - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : 0 2000 [0, 400, 800, 1200, 1600, 2000]', - (this._min == 0 && this._max == 2000) ? 'success' : 'failed'); - - this._min = 10; this._max = 78; console.log(this._min, this._max); this._reformValue(); - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : 0 100 [0, 20, 40, 60, 80, 100]', - (this._min == 0 && this._max == 100) ? 'success' : 'failed'); - - this._min = -31; this._max = -3; console.log(this._min, this._max); this._reformValue(); - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : -35 0 [-35, -28, -21, -14, -7, 0]', - (this._min == -35 && this._max == 0) ? 'success' : 'failed'); - - this._min = -51; this._max = 203; console.log(this._min, this._max); this._reformValue(); - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : -60 240 [-60, 0, 60, 120, 180, 240]', - (this._min == -60 && this._max == 240) ? 'success' : 'failed'); - - this._min = -251; this._max = 23; console.log(this._min, this._max); this._reformValue(); - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : -280 70 [-280, -210, -140, -70, 0, 70]', - (this._min == -280 && this._max == 70) ? 'success' : 'failed'); - - this.option.precision = 2; - this._min = 0.23; this._max = 0.78; console.log(this._min, this._max); this._reformValue(); - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : 0.00 1.00' - + '["0.00", "0.20", "0.40", "0.60", "0.80", "1.00"]', - (this._min == 0.00 && this._max == 1.00) ? 'success' : 'failed'); - - this._min = -12.23; this._max = -0.78; console.log(this._min, this._max); - this._reformValue(); - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : -15.00 0.00' - + '["-15.00", "-12.00", "-9.00", "-6.00", "-3.00", "0.00"]', - (this._min == -15.00 && this._max == 0.00) ? 'success' : 'failed'); - - this._min = -0.23; this._max = 0.78; console.log(this._min, this._max); this._reformValue() - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : -0.30 1.20' - + '["-0.30", "0.00", "0.30", "0.60", "0.90", "1.20"]', - (this._min == -0.30 && this._max == 1.20) ? 'success' : 'failed'); - - this._min = -1.23; this._max = 0.78; console.log(this._min, this._max); _reformValue(); - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : -1.50 1.00' - + '["-1.50", "-1.00", "-0.50", "0.00", "0.50", "1.00"]', - (this._min == -1.50 && this._max == 1.00) ? 'success' : 'failed'); - - this.option.precision = 1; - this._min = -2.3; this._max = 0.5; console.log(this._min, this._max); _reformValue(); - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : -2.4 0.6' - + '["-2.4", "-1.8", "-1.2", "-0.6", "0.0", "0.6"]', - (this._min == -2.4 && this._max == 0.6) ? 'success' : 'failed'); - * -------- - */ - _reformValue : function (scale) { - var splitNumber = this.option.splitNumber; - var precision = this.option.precision; - var splitGap; - var power; - if (precision === 0) { // 整数 - power = this.option.power > 1 ? this.option.power : 1; - } - else { // 小数 - // 放大倍数后复用整数逻辑,最后再缩小回去 - power = Math.pow(10, precision); - this._min *= power; - this._max *= power; - power = this.option.power; - } - // console.log(this._min,this._max) - var total; - if (this._min >= 0 && this._max >= 0) { - // 双正 - if (!scale) { - // power自动降级 - while ((this._max / power < splitNumber) && power != 1) { - power = power / 10; - } - this._min = 0; - } - else { - // power自动降级 - while (this._min < power && power != 1) { - power = power / 10; - } - if (precision === 0) { // 整数 - // 满足power - this._min = Math.floor(this._min / power) * power; - this._max = Math.ceil(this._max / power) * power; - } - } - power = power > 1 ? power / 10 : 1; - total = this._max - this._min; - splitGap = Math.ceil((total / splitNumber) / power) * power; - this._max = this._min + splitGap * splitNumber; - } - else if (this._min <= 0 && this._max <= 0) { - // 双负 - power = -power; - if (!scale) { - // power自动降级 - while ((this._min / power < splitNumber) && power != -1) { - power = power / 10; - } - this._max = 0; - } - else { - // power自动降级 - while (this._max > power && power != -1) { - power = power / 10; - } - if (precision === 0) { // 整数 - // 满足power - this._min = Math.ceil(this._min / power) * power; - this._max = Math.floor(this._max / power) * power; - } - } - power = power < -1 ? power / 10 : -1; - total = this._min - this._max; - splitGap = -Math.ceil((total / splitNumber) / power) * power; - this._min = -splitGap * splitNumber + this._max; - } - else { - // 一正一负,确保0被选中 - total = this._max - this._min; - // power自动降级 - while ((total / power < splitNumber) && power != 1) { - power = power/10; - } - // 正数部分的分隔数 - var partSplitNumber = Math.round(this._max / total * splitNumber); - // 修正数据范围极度偏正向,留给负数一个 - partSplitNumber -= (partSplitNumber == splitNumber ? 1 : 0); - // 修正数据范围极度偏负向,留给正数一个 - partSplitNumber += partSplitNumber === 0 ? 1 : 0; - splitGap = (Math.ceil(Math.max( - this._max / partSplitNumber, - this._min / (partSplitNumber - splitNumber) - ) - / power)) - * power; - - this._max = splitGap * partSplitNumber; - this._min = splitGap * (partSplitNumber - splitNumber); - } - //console.log(this._min,this._max,'vvvvvrrrrrr') - this._valueList = []; - for (var i = 0; i <= splitNumber; i++) { - this._valueList.push(this._min + splitGap * i); - } - - if (precision !== 0) { // 小数 - // 放大倍数后复用整数逻辑,最后再缩小回去 - power = Math.pow(10, precision); - this._min = (this._min / power).toFixed(precision) - 0; - this._max = (this._max / power).toFixed(precision) - 0; - for (var i = 0; i <= splitNumber; i++) { - this._valueList[i] = - (this._valueList[i] / power).toFixed(precision) - 0; - } - } - this._reformLabelData(); - }, - - _customerValue : function () { - var splitNumber = this.option.splitNumber; - var precision = this.option.precision; - var splitGap = (this._max - this._min) / splitNumber; - - this._valueList = []; - for (var i = 0; i <= splitNumber; i++) { - this._valueList.push((this._min + splitGap * i).toFixed(precision) - 0); - } - this._reformLabelData(); - }, - - _reformLabelData : function () { - this._valueLabel = []; - var formatter = this.option.axisLabel.formatter; - if (formatter) { - for (var i = 0, l = this._valueList.length; i < l; i++) { - if (typeof formatter == 'function') { - this._valueLabel.push(formatter.call(this.myChart, this._valueList[i])); - } - else if (typeof formatter == 'string') { - this._valueLabel.push( - formatter.replace('{value}',this._valueList[i]) - ); - } - } - } - else { - // 每三位默认加,格式化 - for (var i = 0, l = this._valueList.length; i < l; i++) { - this._valueLabel.push(this.numAddCommas(this._valueList[i])); - } - } - - }, - - getExtremum : function () { - this._calculateValue(); - return { - min: this._min, - max: this._max - }; - }, - - /** - * 刷新 - */ - refresh : function (newOption, newSeries) { - if (newOption) { - this.option = this.reformOption(newOption); - // 通用字体设置 - this.option.axisLabel.textStyle = zrUtil.merge( - this.option.axisLabel.textStyle || {}, - this.ecTheme.textStyle - ); - this.series = newSeries; - } - if (this.zr) { // 数值轴的另外一个功能只是用来计算极值 - this.clear(); - this._buildShape(); - } - }, - - // 根据值换算位置 - getCoord : function (value) { - value = value < this._min ? this._min : value; - value = value > this._max ? this._max : value; - - var result; - if (!this.isHorizontal()) { - // 纵向 - result = this.grid.getYend() - - (value - this._min) - / (this._max - this._min) - * this.grid.getHeight(); - } - else { - // 横向 - result = this.grid.getX() - + (value - this._min) - / (this._max - this._min) - * this.grid.getWidth(); - } - - return result; - // Math.floor可能引起一些偏差,但性能会更好 - /* 准确更重要 - return (value == this._min || value == this._max) - ? result - : Math.floor(result); - */ - }, - - // 根据值换算绝对大小 - getCoordSize : function (value) { - if (!this.isHorizontal()) { - // 纵向 - return Math.abs(value / (this._max - this._min) * this.grid.getHeight()); - } - else { - // 横向 - return Math.abs(value / (this._max - this._min) * this.grid.getWidth()); - } - }, - - // 根据位置换算值 - getValueFromCoord : function(coord) { - var result; - if (!this.isHorizontal()) { - // 纵向 - coord = coord < this.grid.getY() ? this.grid.getY() : coord; - coord = coord > this.grid.getYend() ? this.grid.getYend() : coord; - result = this._max - - (coord - this.grid.getY()) - / this.grid.getHeight() - * (this._max - this._min); - } - else { - // 横向 - coord = coord < this.grid.getX() ? this.grid.getX() : coord; - coord = coord > this.grid.getXend() ? this.grid.getXend() : coord; - result = this._min - + (coord - this.grid.getX()) - / this.grid.getWidth() - * (this._max - this._min); - } - - return result.toFixed(2) - 0; - } - }; - - zrUtil.inherits(ValueAxis, Base); - - require('../component').define('valueAxis', ValueAxis); - - return ValueAxis; -}); - - -/** - * echarts组件类: 坐标轴 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * 直角坐标系中坐标轴数组,数组中每一项代表一条横轴(纵轴)坐标轴。 - * 标准(1.0)中规定最多同时存在2条横轴和2条纵轴 - * 单条横轴时可指定安放于grid的底部(默认)或顶部,2条同时存在时则默认第一条安放于底部,第二天安放于顶部 - * 单条纵轴时可指定安放于grid的左侧(默认)或右侧,2条同时存在时则默认第一条安放于左侧,第二天安放于右侧。 - * 坐标轴有两种类型,类目型和数值型(区别详见axis): - * 横轴通常为类目型,但条形图时则横轴为数值型,散点图时则横纵均为数值型 - * 纵轴通常为数值型,但条形图时则纵轴为类目型。 - * - */ -define('echarts/component/axis',['require','./base','zrender/shape/Line','../config','../util/ecData','zrender/tool/util','zrender/tool/color','./categoryAxis','./valueAxis','../component'],function (require) { - var Base = require('./base'); - - var LineShape = require('zrender/shape/Line'); - - var ecConfig = require('../config'); - var ecData = require('../util/ecData'); - var zrUtil = require('zrender/tool/util'); - var zrColor = require('zrender/tool/color'); - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} option 图表选项 - * @param {string=} option.xAxis.type 坐标轴类型,横轴默认为类目型'category' - * @param {string=} option.yAxis.type 坐标轴类型,纵轴默认为类目型'value' - * @param {Object} component 组件 - * @param {string} axisType 横走or纵轴 - */ - function Axis(ecTheme, messageCenter, zr, option, myChart, axisType) { - Base.call(this, ecTheme, messageCenter, zr, option, myChart); - - this.axisType = axisType; - this._axisList = []; - - this.refresh(option); - } - - Axis.prototype = { - type : ecConfig.COMPONENT_TYPE_AXIS, - axisBase : { - // 轴线 - _buildAxisLine : function () { - var lineWidth = this.option.axisLine.lineStyle.width; - var halfLineWidth = lineWidth / 2; - var axShape = { - _axisShape : 'axisLine', - zlevel : this._zlevelBase + 1, - hoverable : false - }; - switch (this.option.position) { - case 'left' : - axShape.style = { - xStart : this.grid.getX() - halfLineWidth, - yStart : this.grid.getYend(), - xEnd : this.grid.getX() - halfLineWidth, - yEnd : this.grid.getY(), - lineCap : 'round' - }; - break; - case 'right' : - axShape.style = { - xStart : this.grid.getXend() + halfLineWidth, - yStart : this.grid.getYend(), - xEnd : this.grid.getXend() + halfLineWidth, - yEnd : this.grid.getY(), - lineCap : 'round' - }; - break; - case 'bottom' : - axShape.style = { - xStart : this.grid.getX(), - yStart : this.grid.getYend() + halfLineWidth, - xEnd : this.grid.getXend(), - yEnd : this.grid.getYend() + halfLineWidth, - lineCap : 'round' - }; - break; - case 'top' : - axShape.style = { - xStart : this.grid.getX(), - yStart : this.grid.getY() - halfLineWidth, - xEnd : this.grid.getXend(), - yEnd : this.grid.getY() - halfLineWidth, - lineCap : 'round' - }; - break; - } - if (this.option.name !== '') { - axShape.style.text = this.option.name; - axShape.style.textPosition = this.option.nameLocation; - axShape.style.textFont = this.getFont(this.option.nameTextStyle); - if (this.option.nameTextStyle.align) { - axShape.style.textAlign = this.option.nameTextStyle.align; - } - if (this.option.nameTextStyle.baseline) { - axShape.style.textBaseline = this.option.nameTextStyle.baseline; - } - if (this.option.nameTextStyle.color) { - axShape.style.textColor = this.option.nameTextStyle.color; - } - } - axShape.style.strokeColor = this.option.axisLine.lineStyle.color; - - axShape.style.lineWidth = lineWidth; - // 亚像素优化 - if (this.isHorizontal()) { - // 横向布局,优化y - axShape.style.yStart - = axShape.style.yEnd - = this.subPixelOptimize(axShape.style.yEnd, lineWidth); - } - else { - // 纵向布局,优化x - axShape.style.xStart - = axShape.style.xEnd - = this.subPixelOptimize(axShape.style.xEnd, lineWidth); - } - - axShape.style.lineType = this.option.axisLine.lineStyle.type; - - axShape = new LineShape(axShape); - this.shapeList.push(axShape); - }, - - _axisLabelClickable : function(clickable, axShape) { - if (clickable) { - ecData.pack( - axShape, undefined, -1, undefined, -1, axShape.style.text - ); - axShape.hoverable = true; - axShape.clickable = true; - axShape.highlightStyle = { - color : zrColor.lift(axShape.style.color, 1), - brushType: 'fill' - }; - return axShape; - } - else { - return axShape; - } - }, - - refixAxisShape : function(zeroX, zeroY) { - if (!this.option.axisLine.onZero) { - return; - } - var tickLength; - if (this.isHorizontal() && typeof zeroY != 'undefined') { - // 横向布局调整纵向y - for (var i = 0, l = this.shapeList.length; i < l; i++) { - if (this.shapeList[i]._axisShape == 'axisLine') { - this.shapeList[i].style.yStart - = this.shapeList[i].style.yEnd - = this.subPixelOptimize( - zeroY, this.shapeList[i].stylelineWidth - ); - this.zr.modShape(this.shapeList[i].id); - } - else if (this.shapeList[i]._axisShape == 'axisTick') { - tickLength = this.shapeList[i].style.yEnd - - this.shapeList[i].style.yStart; - this.shapeList[i].style.yStart = zeroY - tickLength; - this.shapeList[i].style.yEnd = zeroY; - this.zr.modShape(this.shapeList[i].id); - } - } - } - if (!this.isHorizontal() && typeof zeroX != 'undefined') { - // 纵向布局调整横向x - for (var i = 0, l = this.shapeList.length; i < l; i++) { - if (this.shapeList[i]._axisShape == 'axisLine') { - this.shapeList[i].style.xStart - = this.shapeList[i].style.xEnd - = this.subPixelOptimize( - zeroX, this.shapeList[i].stylelineWidth - ); - this.zr.modShape(this.shapeList[i].id); - } - else if (this.shapeList[i]._axisShape == 'axisTick') { - tickLength = this.shapeList[i].style.xEnd - - this.shapeList[i].style.xStart; - this.shapeList[i].style.xStart = zeroX; - this.shapeList[i].style.xEnd = zeroX + tickLength; - this.zr.modShape(this.shapeList[i].id); - } - } - } - }, - - getPosition : function () { - return this.option.position; - }, - - isHorizontal : function() { - return this.option.position == 'bottom' || this.option.position == 'top'; - } - }, - /** - * 参数修正&默认值赋值,重载基类方法 - * @param {Object} opt 参数 - */ - reformOption : function (opt) { - // 不写或传了个空数值默认为数值轴 - if (!opt || (opt instanceof Array && opt.length === 0)) { - opt = [{type : ecConfig.COMPONENT_TYPE_AXIS_VALUE}]; - } - else if (!(opt instanceof Array)){ - opt = [opt]; - } - - // 最多两条,其他参数忽略 - if (opt.length > 2) { - opt = [opt[0],opt[1]]; - } - - if (this.axisType == 'xAxis') { - // 横轴位置默认配置 - if (!opt[0].position // 没配置或配置错 - || (opt[0].position != 'bottom' - && opt[0].position != 'top') - ) { - opt[0].position = 'bottom'; - } - if (opt.length > 1) { - opt[1].position = opt[0].position == 'bottom' - ? 'top' : 'bottom'; - } - - for (var i = 0, l = opt.length; i < l; i++) { - // 坐标轴类型,横轴默认为类目型'category' - opt[i].type = opt[i].type || 'category'; - // 标识轴类型&索引 - opt[i].xAxisIndex = i; - opt[i].yAxisIndex = -1; - } - } - else { - // 纵轴位置默认配置 - if (!opt[0].position // 没配置或配置错 - || (opt[0].position != 'left' - && opt[0].position != 'right') - ) { - opt[0].position = 'left'; - } - - if (opt.length > 1) { - opt[1].position = opt[0].position == 'left' - ? 'right' : 'left'; - } - - for (var i = 0, l = opt.length; i < l; i++) { - // 坐标轴类型,纵轴默认为数值型'value' - opt[i].type = opt[i].type || 'value'; - // 标识轴类型&索引 - opt[i].xAxisIndex = -1; - opt[i].yAxisIndex = i; - } - } - - return opt; - }, - - /** - * 刷新 - */ - refresh : function (newOption) { - var axisOption; - if (newOption) { - this.option = newOption; - if (this.axisType == 'xAxis') { - this.option.xAxis = this.reformOption(newOption.xAxis); - axisOption = this.option.xAxis; - } - else { - this.option.yAxis = this.reformOption(newOption.yAxis); - axisOption = this.option.yAxis; - } - this.series = newOption.series; - } - - var CategoryAxis = require('./categoryAxis'); - var ValueAxis = require('./valueAxis'); - var len = Math.max((axisOption && axisOption.length || 0), this._axisList.length); - for (var i = 0; i < len; i++) { - if (this._axisList[i] // 已有实例 - && newOption // 非空刷新 - && (!axisOption[i] || this._axisList[i].type != axisOption[i].type) // 类型不匹配 - ) { - this._axisList[i].dispose && this._axisList[i].dispose(); - this._axisList[i] = false; - } - - if (this._axisList[i]) { - this._axisList[i].refresh && this._axisList[i].refresh( - axisOption ? axisOption[i] : false, - this.series - ); - } - else if (axisOption && axisOption[i]) { - this._axisList[i] = axisOption[i].type == 'category' - ? new CategoryAxis( - this.ecTheme, this.messageCenter, this.zr, - axisOption[i], this.myChart, this.axisBase - ) - : new ValueAxis( - this.ecTheme, this.messageCenter, this.zr, - axisOption[i], this.myChart, this.axisBase, - this.series - ); - - } - } - }, - - /** - * 根据值换算位置 - * @param {number} idx 坐标轴索引0~1 - */ - getAxis : function (idx) { - return this._axisList[idx]; - }, - - clear : function () { - for (var i = 0, l = this._axisList.length; i < l; i++) { - this._axisList[i].dispose && this._axisList[i].dispose(); - } - this._axisList = []; - } - }; - - zrUtil.inherits(Axis, Base); - - require('../component').define('axis', Axis); - - return Axis; -}); -/** - * echarts组件: 网格 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/component/grid',['require','./base','zrender/shape/Rectangle','../config','zrender/tool/util','../component'],function (require) { - var Base = require('./base'); - - // 图形依赖 - var RectangleShape = require('zrender/shape/Rectangle'); - - var ecConfig = require('../config'); - var zrUtil = require('zrender/tool/util'); - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} option 图表选项 - * @param {number=} option.grid.x 直角坐标系内绘图网格起始横坐标,数值单位px - * @param {number=} option.grid.y 直角坐标系内绘图网格起始纵坐标,数值单位px - * @param {number=} option.grid.width 直角坐标系内绘图网格宽度,数值单位px - * @param {number=} option.grid.height 直角坐标系内绘图网格高度,数值单位px - */ - function Grid(ecTheme, messageCenter, zr, option, myChart) { - Base.call(this, ecTheme, messageCenter, zr, option, myChart); - - this.refresh(option); - } - - Grid.prototype = { - type : ecConfig.COMPONENT_TYPE_GRID, - - getX : function () { - return this._x; - }, - - getY : function () { - return this._y; - }, - - getWidth : function () { - return this._width; - }, - - getHeight : function () { - return this._height; - }, - - getXend : function () { - return this._x + this._width; - }, - - getYend : function () { - return this._y + this._height; - }, - - getArea : function () { - return { - x : this._x, - y : this._y, - width : this._width, - height : this._height - }; - }, - - /** - * 实在找不到合适的地方做了,各种粗暴的写法~ -_- - */ - refixAxisShape : function(component) { - var zeroX; - var zeroY; - var axisList = component.xAxis._axisList.concat(component.yAxis._axisList); - var len = axisList.length; - var axis; - while (len--) { - axis = axisList[len]; - if (axis.type == ecConfig.COMPONENT_TYPE_AXIS_VALUE - && axis._min < 0 - && axis._max >= 0 - ) { - axis.isHorizontal() - ? (zeroX = axis.getCoord(0)) - : (zeroY = axis.getCoord(0)); - } - } - if (typeof zeroX != 'undefined' || typeof zeroY != 'undefined') { - len = axisList.length; - while (len--) { - axisList[len].refixAxisShape(zeroX, zeroY); - } - } - }, - - refresh : function (newOption) { - if (newOption - || this._zrWidth != this.zr.getWidth() - || this._zrHeight != this.zr.getHeight() - ) { - this.clear(); - this.option = newOption || this.option; - this.option.grid = this.reformOption(this.option.grid); - - var gridOption = this.option.grid; - this._zrWidth = this.zr.getWidth(); - this._zrHeight = this.zr.getHeight(); - this._x = this.parsePercent(gridOption.x, this._zrWidth); - this._y = this.parsePercent(gridOption.y, this._zrHeight); - var x2 = this.parsePercent(gridOption.x2, this._zrWidth); - var y2 = this.parsePercent(gridOption.y2, this._zrHeight); - - - if (typeof gridOption.width == 'undefined') { - this._width = this._zrWidth - this._x - x2; - } - else { - this._width = this.parsePercent(gridOption.width, this._zrWidth); - } - - if (typeof gridOption.height == 'undefined') { - this._height = this._zrHeight - this._y - y2; - } - else { - this._height = this.parsePercent(gridOption.height, this._zrHeight); - } - - this._x = this.subPixelOptimize(this._x, gridOption.borderWidth); - this._y = this.subPixelOptimize(this._y, gridOption.borderWidth); - - this.shapeList.push(new RectangleShape({ - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : this._x, - y : this._y, - width : this._width, - height : this._height, - brushType : gridOption.borderWidth > 0 ? 'both' : 'fill', - color : gridOption.backgroundColor, - strokeColor: gridOption.borderColor, - lineWidth : gridOption.borderWidth - // type : this.option.splitArea.areaStyle.type, - } - })); - this.zr.addShape(this.shapeList[0]); - } - } - }; - - zrUtil.inherits(Grid, Base); - - require('../component').define('grid', Grid); - - return Grid; -}); -/** - * echarts组件:数据区域缩放 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/component/dataZoom',['require','./base','zrender/shape/Rectangle','zrender/shape/Polygon','../util/shape/Icon','../config','zrender/tool/util','../component','../component'],function (require) { - var Base = require('./base'); - - // 图形依赖 - var RectangleShape = require('zrender/shape/Rectangle'); - var PolygonShape = require('zrender/shape/Polygon'); - var IconShape = require('../util/shape/Icon'); - - var ecConfig = require('../config'); - var zrUtil = require('zrender/tool/util'); - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} option 图表参数 - * @param {Object} component 组件 - */ - function DataZoom(ecTheme, messageCenter, zr, option, myChart) { - Base.call(this, ecTheme, messageCenter, zr, option, myChart); - - var self = this; - self._ondrift = function (dx, dy) { - return self.__ondrift(this, dx, dy); - }; - self._ondragend = function () { - return self.__ondragend(); - }; - - this._fillerSize = 28; // 控件大小,水平布局为高,纵向布局为宽 - this._handleSize = 8; // 手柄大小 - // this._fillerShae; // 填充 - // this._startShape; // 起始手柄 - // this._endShape; // 结束手柄 - // this._startFrameShape; // 起始特效边框 - // this._endFrameShape; // 结束特效边框 - // this._syncTicket; - this._isSilence = false; - this._zoom = {}; - // this._originalData; - - this.option.dataZoom = this.reformOption(this.option.dataZoom); - this.zoomOption = this.option.dataZoom; - - // 位置参数,通过计算所得x, y, width, height - this._location = this._getLocation(); - // 缩放参数 - this._zoom = this._getZoom(); - this._backupData(); - - if (this.option.dataZoom.show) { - this._buildShape(); - } - this._syncData(); - } - - DataZoom.prototype = { - type : ecConfig.COMPONENT_TYPE_DATAZOOM, - _buildShape : function () { - this._buildBackground(); - this._buildFiller(); - this._buildHandle(); - this._buildFrame(); - - for (var i = 0, l = this.shapeList.length; i < l; i++) { - this.zr.addShape(this.shapeList[i]); - } - this._syncFrameShape(); - }, - - /** - * 根据选项计算实体的位置坐标 - */ - _getLocation : function () { - var x; - var y; - var width; - var height; - var grid = this.component.grid; - - // 不指定则根据grid适配 - if (this.zoomOption.orient == 'horizontal') { - // 水平布局 - width = this.zoomOption.width || grid.getWidth(); - height = this.zoomOption.height || this._fillerSize; - x = typeof this.zoomOption.x != 'undefined' - ? this.zoomOption.x : grid.getX(); - y = typeof this.zoomOption.y != 'undefined' - ? this.zoomOption.y : (this.zr.getHeight() - height - 2); - } - else { - // 垂直布局 - width = this.zoomOption.width || this._fillerSize; - height = this.zoomOption.height || grid.getHeight(); - x = typeof this.zoomOption.x != 'undefined' - ? this.zoomOption.x : 2; - y = typeof this.zoomOption.y != 'undefined' - ? this.zoomOption.y : grid.getY(); - } - - return { - x : x, - y : y, - width : width, - height : height - }; - }, - - /** - * 计算缩放参数 - * 修正单坐标轴只传对象为数组。 - */ - _getZoom : function () { - var series = this.option.series; - var xAxis = this.option.xAxis; - if (xAxis && !(xAxis instanceof Array)) { - xAxis = [xAxis]; - this.option.xAxis = xAxis; - } - var yAxis = this.option.yAxis; - if (yAxis && !(yAxis instanceof Array)) { - yAxis = [yAxis]; - this.option.yAxis = yAxis; - } - - var zoomSeriesIndex = []; - var xAxisIndex; - var yAxisIndex; - - var zOptIdx = this.zoomOption.xAxisIndex; - if (xAxis && typeof zOptIdx == 'undefined') { - xAxisIndex = []; - for (var i = 0, l = xAxis.length; i < l; i++) { - // 横纵默认为类目轴 - if (xAxis[i].type == 'category' - || typeof xAxis[i].type == 'undefined' - ) { - xAxisIndex.push(i); - } - } - } - else { - if (zOptIdx instanceof Array) { - xAxisIndex = zOptIdx; - } - else if (typeof zOptIdx != 'undefined') { - xAxisIndex = [zOptIdx]; - } - else { - xAxisIndex = []; - } - } - - zOptIdx = this.zoomOption.yAxisIndex; - if (yAxis && typeof zOptIdx == 'undefined') { - yAxisIndex = []; - for (var i = 0, l = yAxis.length; i < l; i++) { - if (yAxis[i].type == 'category') { - yAxisIndex.push(i); - } - } - } - else { - if (zOptIdx instanceof Array) { - yAxisIndex = zOptIdx; - } - else if (typeof zOptIdx != 'undefined') { - yAxisIndex = [zOptIdx]; - } - else { - yAxisIndex = []; - } - } - - // 找到缩放控制的所有series - for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type != ecConfig.CHART_TYPE_LINE - && series[i].type != ecConfig.CHART_TYPE_BAR - && series[i].type != ecConfig.CHART_TYPE_SCATTER - && series[i].type != ecConfig.CHART_TYPE_K - ) { - continue; - } - for (var j = 0, k = xAxisIndex.length; j < k; j++) { - if (xAxisIndex[j] == (series[i].xAxisIndex || 0)) { - zoomSeriesIndex.push(i); - break; - } - } - for (var j = 0, k = yAxisIndex.length; j < k; j++) { - if (yAxisIndex[j] == (series[i].yAxisIndex || 0)) { - zoomSeriesIndex.push(i); - break; - } - } - // 不指定接管坐标轴,则散点图被纳入接管范围 - if (series[i].type == ecConfig.CHART_TYPE_SCATTER - && typeof this.zoomOption.xAxisIndex == 'undefined' - && typeof this.zoomOption.yAxisIndex == 'undefined' - ) { - zoomSeriesIndex.push(i); - } - } - - var start = typeof this._zoom.start != 'undefined' - ? this._zoom.start - : (typeof this.zoomOption.start != 'undefined' ? this.zoomOption.start : 0); - var end = typeof this._zoom.end != 'undefined' - ? this._zoom.end - : (typeof this.zoomOption.end != 'undefined' ? this.zoomOption.end : 100); - /* - var start = typeof this.zoomOption.start != 'undefined' - && this.zoomOption.start >= 0 - && this.zoomOption.start <= 100 - ? this.zoomOption.start : 0; - var end = typeof this.zoomOption.end != 'undefined' - && this.zoomOption.end >= 0 - && this.zoomOption.end <= 100 - ? this.zoomOption.end : 100; - */ - if (start > end) { - // 大小颠倒自动翻转 - start = start + end; - end = start - end; - start = start - end; - } - var size = Math.round( - (end - start) / 100 - * (this.zoomOption.orient == 'horizontal' - ? this._location.width : this._location.height) - ); - return { - start : start, - end : end, - start2 : 0, - end2 : 100, - size : size, - xAxisIndex : xAxisIndex, - yAxisIndex : yAxisIndex, - seriesIndex : zoomSeriesIndex, - scatterMap : this._zoom.scatterMap || {} - }; - }, - - _backupData : function () { - this._originalData = { - xAxis : {}, - yAxis : {}, - series : {} - }; - var xAxis = this.option.xAxis; - var xAxisIndex = this._zoom.xAxisIndex; - for (var i = 0, l = xAxisIndex.length; i < l; i++) { - this._originalData.xAxis[xAxisIndex[i]] = xAxis[xAxisIndex[i]].data; - } - - var yAxis = this.option.yAxis; - var yAxisIndex = this._zoom.yAxisIndex; - for (var i = 0, l = yAxisIndex.length; i < l; i++) { - this._originalData.yAxis[yAxisIndex[i]] = yAxis[yAxisIndex[i]].data; - } - - var series = this.option.series; - var seriesIndex = this._zoom.seriesIndex; - var serie; - for (var i = 0, l = seriesIndex.length; i < l; i++) { - serie = series[seriesIndex[i]]; - this._originalData.series[seriesIndex[i]] = serie.data; - if (serie.type == ecConfig.CHART_TYPE_SCATTER) { - this._calculScatterMap(seriesIndex[i]); - } - } - }, - - _calculScatterMap : function (seriesIndex) { - this._zoom.scatterMap = this._zoom.scatterMap || {}; - this._zoom.scatterMap[seriesIndex] = this._zoom.scatterMap[seriesIndex] || {}; - var componentLibrary = require('../component'); - // x轴极值 - var Axis = componentLibrary.get('axis'); - var axisOption = zrUtil.clone(this.option.xAxis); - if (axisOption instanceof Array) { - axisOption[0].type = 'value'; - axisOption[0].boundary = [0, 0]; - axisOption[1] && (axisOption[1].type = 'value', axisOption[1].boundary = [0, 0]); - } - else { - axisOption.type = 'value'; - axisOption.boundary = [0, 0]; - } - var vAxis = new Axis( - this.ecTheme, - null, // messageCenter - false, // this.zr - { - xAxis: axisOption, - series : this.option.series - }, - this, - 'xAxis' - ); - var axisIndex = this.option.series[seriesIndex].xAxisIndex || 0; - this._zoom.scatterMap[seriesIndex].x = vAxis.getAxis(axisIndex).getExtremum(); - vAxis.dispose(); - - // y轴极值 - axisOption = zrUtil.clone(this.option.yAxis); - if (axisOption instanceof Array) { - axisOption[0].type = 'value'; - axisOption[1] && (axisOption[1].type = 'value', axisOption[1].boundary = [0, 0]); - } - else { - axisOption.type = 'value'; - axisOption.boundary = [0, 0]; - } - vAxis = new Axis( - this.ecTheme, - null, // messageCenter - false, // this.zr - { - yAxis: axisOption, - series : this.option.series - }, - this, - 'yAxis' - ); - axisIndex = this.option.series[seriesIndex].yAxisIndex || 0; - this._zoom.scatterMap[seriesIndex].y = vAxis.getAxis(axisIndex).getExtremum(); - vAxis.dispose(); - // console.log(this._zoom.scatterMap); - }, - - _buildBackground : function () { - var width = this._location.width; - var height = this._location.height; - - // 背景 - this.shapeList.push(new RectangleShape({ - zlevel : this._zlevelBase, - hoverable :false, - style : { - x : this._location.x, - y : this._location.y, - width : width, - height : height, - color : this.zoomOption.backgroundColor - } - })); - - // 数据阴影 - var maxLength = 0; - var xAxis = this._originalData.xAxis; - var xAxisIndex = this._zoom.xAxisIndex; - for (var i = 0, l = xAxisIndex.length; i < l; i++) { - maxLength = Math.max( - maxLength, xAxis[xAxisIndex[i]].length - ); - } - var yAxis = this._originalData.yAxis; - var yAxisIndex = this._zoom.yAxisIndex; - for (var i = 0, l = yAxisIndex.length; i < l; i++) { - maxLength = Math.max( - maxLength, yAxis[yAxisIndex[i]].length - ); - } - - var seriesIndex = this._zoom.seriesIndex[0]; - var data = this._originalData.series[seriesIndex]; - var maxValue = Number.MIN_VALUE; - var minValue = Number.MAX_VALUE; - var value; - for (var i = 0, l = data.length; i < l; i++) { - value = typeof data[i] != 'undefined' - ? (typeof data[i].value != 'undefined' ? data[i].value : data[i]) - : 0; - if (this.option.series[seriesIndex].type == ecConfig.CHART_TYPE_K) { - value = value[1]; // 收盘价 - } - if (isNaN(value)) { - value = 0; - } - maxValue = Math.max(maxValue, value); - minValue = Math.min(minValue, value); - } - var valueRange = maxValue - minValue; - - var pointList = []; - var x = width / (maxLength - (maxLength > 1 ? 1 : 0)); - var y = height / (maxLength - (maxLength > 1 ? 1 : 0)); - var step = 1; - if (this.zoomOption.orient == 'horizontal' && x < 1) { - step = Math.floor(maxLength * 3 / width); - } - else if (this.zoomOption.orient == 'vertical' && y < 1){ - step = Math.floor(maxLength * 3 / height); - } - - for (var i = 0, l = maxLength; i < l; i += step) { - value = typeof data[i] != 'undefined' - ? (typeof data[i].value != 'undefined' - ? data[i].value : data[i]) - : 0; - if (this.option.series[seriesIndex].type == ecConfig.CHART_TYPE_K) { - value = value[1]; // 收盘价 - } - if (isNaN(value)) { - value = 0; - } - if (this.zoomOption.orient == 'horizontal') { - pointList.push([ - this._location.x + x * i, - this._location.y + height - 1 - Math.round( - (value - minValue) / valueRange * (height - 10) - ) - ]); - } - else { - pointList.push([ - this._location.x + 1 + Math.round( - (value - minValue) / valueRange * (width - 10) - ), - this._location.y + y * i - ]); - } - } - if (this.zoomOption.orient == 'horizontal') { - pointList.push([ - this._location.x + width, - this._location.y + height - ]); - pointList.push([ - this._location.x, this._location.y + height - ]); - } - else { - pointList.push([ - this._location.x, this._location.y + height - ]); - pointList.push([ - this._location.x, this._location.y - ]); - } - - this.shapeList.push(new PolygonShape({ - zlevel : this._zlevelBase, - style : { - pointList : pointList, - color : this.zoomOption.dataBackgroundColor - }, - hoverable : false - })); - }, - - /** - * 构建填充物 - */ - _buildFiller : function () { - this._fillerShae = { - zlevel : this._zlevelBase, - draggable : true, - ondrift : this._ondrift, - ondragend : this._ondragend, - _type : 'filler' - }; - - if (this.zoomOption.orient == 'horizontal') { - // 横向 - this._fillerShae.style = { - x : this._location.x - + Math.round(this._zoom.start / 100 * this._location.width) - + this._handleSize, - y : this._location.y, - width : this._zoom.size - this._handleSize * 2, - height : this._location.height, - color : this.zoomOption.fillerColor, - // strokeColor : '#fff', // this.zoomOption.handleColor, - // lineWidth: 2, - text : ':::', - textPosition : 'inside' - }; - } - else { - // 纵向 - this._fillerShae.style ={ - x : this._location.x, - y : this._location.y - + Math.round(this._zoom.start / 100 * this._location.height) - + this._handleSize, - width : this._location.width, - height : this._zoom.size - this._handleSize * 2, - color : this.zoomOption.fillerColor, - // strokeColor : '#fff', // this.zoomOption.handleColor, - // lineWidth: 2, - text : '::', - textPosition : 'inside' - }; - } - - this._fillerShae.highlightStyle = { - brushType: 'fill', - color : 'rgba(0,0,0,0)' - /* - color : require('zrender/tool/color').alpha( - this._fillerShae.style.color, 0 - ) - */ - }; - this._fillerShae = new RectangleShape(this._fillerShae); - this.shapeList.push(this._fillerShae); - }, - - /** - * 构建拖拽手柄 - */ - _buildHandle : function () { - this._startShape = { - zlevel : this._zlevelBase, - draggable : true, - style : { - iconType: 'rectangle', - x : this._location.x, - y : this._location.y, - width : this._handleSize, - height : this._handleSize, - color : this.zoomOption.handleColor, - text : '=', - textPosition : 'inside' - }, - highlightStyle : { - brushType: 'fill' - }, - ondrift : this._ondrift, - ondragend : this._ondragend - }; - - if (this.zoomOption.orient == 'horizontal') { - this._startShape.style.height = this._location.height; - this._endShape = zrUtil.clone(this._startShape); - - this._startShape.style.x = this._fillerShae.style.x - this._handleSize, - this._endShape.style.x = this._fillerShae.style.x - + this._fillerShae.style.width; - } - else { - this._startShape.style.width = this._location.width; - this._endShape = zrUtil.clone(this._startShape); - - this._startShape.style.y = this._fillerShae.style.y - this._handleSize; - this._endShape.style.y = this._fillerShae.style.y - + this._fillerShae.style.height; - } - this._startShape = new IconShape(this._startShape); - this._endShape = new IconShape(this._endShape); - this.shapeList.push(this._startShape); - this.shapeList.push(this._endShape); - }, - - /** - * 构建特效边框 - */ - _buildFrame : function () { - // 特效框线,亚像素优化 - var x = this.subPixelOptimize(this._location.x, 1); - var y = this.subPixelOptimize(this._location.y, 1); - this._startFrameShape = { - zlevel : this._zlevelBase, - hoverable :false, - style : { - x : x, - y : y, - width : this._location.width - (x > this._location.x ? 1 : 0), - height : this._location.height - (y > this._location.y ? 1 : 0), - lineWidth: 1, - brushType: 'stroke', - strokeColor : this.zoomOption.handleColor - } - }; - this._endFrameShape = zrUtil.clone(this._startFrameShape); - - this._startFrameShape = new RectangleShape(this._startFrameShape); - this._endFrameShape = new RectangleShape(this._endFrameShape); - this.shapeList.push(this._startFrameShape); - this.shapeList.push(this._endFrameShape); - return; - }, - - _syncHandleShape : function () { - if (this.zoomOption.orient == 'horizontal') { - this._startShape.style.x = this._fillerShae.style.x - this._handleSize; - this._endShape.style.x = this._fillerShae.style.x - + this._fillerShae.style.width; - - this._zoom.start = Math.floor( - (this._startShape.style.x - this._location.x) - / this._location.width * 100 - ); - this._zoom.end = Math.ceil( - (this._endShape.style.x + this._handleSize - this._location.x) - / this._location.width * 100 - ); - } - else { - this._startShape.style.y = this._fillerShae.style.y - this._handleSize; - this._endShape.style.y = this._fillerShae.style.y - + this._fillerShae.style.height; - this._zoom.start = Math.floor( - (this._startShape.style.y - this._location.y) - / this._location.height * 100 - ); - this._zoom.end = Math.ceil( - (this._endShape.style.y + this._handleSize - this._location.y) - / this._location.height * 100 - ); - } - - this.zr.modShape(this._startShape.id); - this.zr.modShape(this._endShape.id); - - // 同步边框 - this._syncFrameShape(); - - this.zr.refresh(); - }, - - _syncFillerShape : function () { - var a; - var b; - if (this.zoomOption.orient == 'horizontal') { - a = this._startShape.style.x; - b = this._endShape.style.x; - this._fillerShae.style.x = Math.min(a, b) + this._handleSize; - this._fillerShae.style.width = Math.abs(a - b) - this._handleSize; - this._zoom.start = Math.floor( - (Math.min(a, b) - this._location.x) - / this._location.width * 100 - ); - this._zoom.end = Math.ceil( - (Math.max(a, b) + this._handleSize - this._location.x) - / this._location.width * 100 - ); - } - else { - a = this._startShape.style.y; - b = this._endShape.style.y; - this._fillerShae.style.y = Math.min(a, b) + this._handleSize; - this._fillerShae.style.height = Math.abs(a - b) - this._handleSize; - this._zoom.start = Math.floor( - (Math.min(a, b) - this._location.y) - / this._location.height * 100 - ); - this._zoom.end = Math.ceil( - (Math.max(a, b) + this._handleSize - this._location.y) - / this._location.height * 100 - ); - } - - this.zr.modShape(this._fillerShae.id); - - // 同步边框 - this._syncFrameShape(); - - this.zr.refresh(); - }, - - _syncFrameShape : function () { - if (this.zoomOption.orient == 'horizontal') { - this._startFrameShape.style.width = - this._fillerShae.style.x - this._location.x; - this._endFrameShape.style.x = - this._fillerShae.style.x + this._fillerShae.style.width; - this._endFrameShape.style.width = - this._location.x + this._location.width - this._endFrameShape.style.x; - } - else { - this._startFrameShape.style.height = - this._fillerShae.style.y - this._location.y; - this._endFrameShape.style.y = - this._fillerShae.style.y + this._fillerShae.style.height; - this._endFrameShape.style.height = - this._location.y + this._location.height - this._endFrameShape.style.y; - } - - this.zr.modShape(this._startFrameShape.id); - this.zr.modShape(this._endFrameShape.id); - }, - - _syncShape : function () { - if (!this.zoomOption.show) { - // 没有伸缩控件 - return; - } - if (this.zoomOption.orient == 'horizontal') { - this._startShape.style.x = this._location.x - + this._zoom.start / 100 * this._location.width; - this._endShape.style.x = this._location.x - + this._zoom.end / 100 * this._location.width - - this._handleSize; - - this._fillerShae.style.x = this._startShape.style.x + this._handleSize; - this._fillerShae.style.width = this._endShape.style.x - - this._startShape.style.x - - this._handleSize; - } - else { - this._startShape.style.y = this._location.y - + this._zoom.start / 100 * this._location.height; - this._endShape.style.y = this._location.y - + this._zoom.end / 100 * this._location.height - - this._handleSize; - - this._fillerShae.style.y = this._startShape.style.y + this._handleSize; - this._fillerShae.style.height = this._endShape.style.y - - this._startShape.style.y - - this._handleSize; - } - - this.zr.modShape(this._startShape.id); - this.zr.modShape(this._endShape.id); - this.zr.modShape(this._fillerShae.id); - // 同步边框 - this._syncFrameShape(); - this.zr.refresh(); - }, - - _syncData : function (dispatchNow) { - var target; - var start; - var end; - var length; - var data; - - for (var key in this._originalData) { - target = this._originalData[key]; - for (var idx in target) { - data = target[idx]; - if (typeof data == 'undefined') { - continue; - } - length = data.length; - start = Math.floor(this._zoom.start / 100 * length); - end = Math.ceil(this._zoom.end / 100 * length); - if (this.option[key][idx].type != ecConfig.CHART_TYPE_SCATTER) { - this.option[key][idx].data = data.slice(start, end); - } - else { - // 散点图特殊处理 - this.option[key][idx].data = this._synScatterData(idx, data); - } - } - } - - if (!this._isSilence && (this.zoomOption.realtime || dispatchNow)) { - this.messageCenter.dispatch( - ecConfig.EVENT.DATA_ZOOM, - null, - {zoom: this._zoom}, - this.myChart - ); - } - - //this.zoomOption.start = this._zoom.start; - //this.zoomOption.end = this._zoom.end; - }, - - _synScatterData : function (seriesIndex, data) { - if (this._zoom.start === 0 - && this._zoom.end == 100 - && this._zoom.start2 === 0 - && this._zoom.end2 == 100 - ) { - return data; - } - var newData = []; - var scale = this._zoom.scatterMap[seriesIndex]; - var total; - var xStart; - var xEnd; - var yStart; - var yEnd; - - if (this.zoomOption.orient == 'horizontal') { - total = scale.x.max - scale.x.min; - xStart = this._zoom.start / 100 * total + scale.x.min; - xEnd = this._zoom.end / 100 * total + scale.x.min; - - total = scale.y.max - scale.y.min; - yStart = this._zoom.start2 / 100 * total + scale.y.min; - yEnd = this._zoom.end2 / 100 * total + scale.y.min; - } - else { - total = scale.x.max - scale.x.min; - xStart = this._zoom.start2 / 100 * total + scale.x.min; - xEnd = this._zoom.end2 / 100 * total + scale.x.min; - - total = scale.y.max - scale.y.min; - yStart = this._zoom.start / 100 * total + scale.y.min; - yEnd = this._zoom.end / 100 * total + scale.y.min; - } - - // console.log(xStart,xEnd,yStart,yEnd); - var value; - for (var i = 0, l = data.length; i < l; i++) { - value = data[i].value || data[i]; - if (value[0] >= xStart - && value[0] <= xEnd - && value[1] >= yStart - && value[1] <= yEnd - ) { - newData.push(data[i]); - } - } - - return newData; - }, - /** - * 拖拽范围控制 - */ - __ondrift : function (shape, dx, dy) { - if (this.zoomOption.zoomLock) { - // zoomLock时把handle转成filler的拖拽 - shape = this._fillerShae; - } - - var detailSize = shape._type == 'filler' ? this._handleSize : 0; - if (this.zoomOption.orient == 'horizontal') { - if (shape.style.x + dx - detailSize <= this._location.x) { - shape.style.x = this._location.x + detailSize; - } - else if (shape.style.x + dx + shape.style.width + detailSize - >= this._location.x + this._location.width - ) { - shape.style.x = this._location.x + this._location.width - - shape.style.width - detailSize; - } - else { - shape.style.x += dx; - } - } - else { - if (shape.style.y + dy - detailSize <= this._location.y) { - shape.style.y = this._location.y + detailSize; - } - else if (shape.style.y + dy + shape.style.height + detailSize - >= this._location.y + this._location.height - ) { - shape.style.y = this._location.y + this._location.height - - shape.style.height - detailSize; - } - else { - shape.style.y += dy; - } - } - - if (shape._type == 'filler') { - this._syncHandleShape(); - } - else { - this._syncFillerShape(); - } - - if (this.zoomOption.realtime) { - this._syncData(); - } - - return true; - }, - - __ondragend : function () { - this.isDragend = true; - }, - - /** - * 数据项被拖拽出去 - */ - ondragend : function (param, status) { - if (!this.isDragend || !param.target) { - // 没有在当前实例上发生拖拽行为则直接返回 - return; - } - - !this.zoomOption.realtime && this._syncData(); - - // 别status = {}赋值啊!! - status.dragOut = true; - status.dragIn = true; - if (!this._isSilence && !this.zoomOption.realtime) { - this.messageCenter.dispatch( - ecConfig.EVENT.DATA_ZOOM, - null, - {zoom: this._zoom}, - this.myChart - ); - } - status.needRefresh = false; // 会有消息触发fresh,不用再刷一遍 - // 处理完拖拽事件后复位 - this.isDragend = false; - - return; - }, - - ondataZoom : function (param, status) { - status.needRefresh = true; - return; - }, - - absoluteZoom : function (param) { - //this.zoomOption.start = - this._zoom.start = param.start; - //this.zoomOption.end = - this._zoom.end = param.end; - //this.zoomOption.start2 = - this._zoom.start2 = param.start2; - //this.zoomOption.end2 = - this._zoom.end2 = param.end2; - this._syncShape(); - this._syncData(true); - return; - }, - - rectZoom : function (param) { - if (!param) { - // 重置拖拽 - //this.zoomOption.start = - //this.zoomOption.start2 = - this._zoom.start = - this._zoom.start2 = 0; - - //this.zoomOption.end = - //this.zoomOption.end2 = - this._zoom.end = - this._zoom.end2 = 100; - - this._syncShape(); - this._syncData(true); - return this._zoom; - } - var gridArea = this.component.grid.getArea(); - var rect = { - x : param.x, - y : param.y, - width : param.width, - height : param.height - }; - // 修正方向框选 - if (rect.width < 0) { - rect.x += rect.width; - rect.width = -rect.width; - } - if (rect.height < 0) { - rect.y += rect.height; - rect.height = -rect.height; - } - // console.log(rect,this._zoom); - - // 剔除无效缩放 - if (rect.x > gridArea.x + gridArea.width - || rect.y > gridArea.y + gridArea.height - ) { - return false; // 无效缩放 - } - - // 修正框选超出 - if (rect.x < gridArea.x) { - rect.x = gridArea.x; - } - if (rect.x + rect.width > gridArea.x + gridArea.width) { - rect.width = gridArea.x + gridArea.width - rect.x; - } - if (rect.y + rect.height > gridArea.y + gridArea.height) { - rect.height = gridArea.y + gridArea.height - rect.y; - } - - var total; - var sdx = (rect.x - gridArea.x) / gridArea.width; - var edx = 1 - (rect.x + rect.width - gridArea.x) / gridArea.width; - var sdy = 1 - (rect.y + rect.height - gridArea.y) / gridArea.height; - var edy = (rect.y - gridArea.y) / gridArea.height; - //console.log('this',sdy,edy,this._zoom.start,this._zoom.end) - if (this.zoomOption.orient == 'horizontal') { - total = this._zoom.end - this._zoom.start; - this._zoom.start += total * sdx; - this._zoom.end -= total * edx; - - total = this._zoom.end2 - this._zoom.start2; - this._zoom.start2 += total * sdy; - this._zoom.end2 -= total * edy; - } - else { - total = this._zoom.end - this._zoom.start; - this._zoom.start += total * sdy; - this._zoom.end -= total * edy; - - total = this._zoom.end2 - this._zoom.start2; - this._zoom.start2 += total * sdx; - this._zoom.end2 -= total * edx; - } - //console.log(this._zoom.start,this._zoom.end,this._zoom.start2,this._zoom.end2) - //this.zoomOption.start = this._zoom.start; - //this.zoomOption.end = this._zoom.end; - //this.zoomOption.start2 = this._zoom.start2; - //this.zoomOption.end2 = this._zoom.end2; - //console.log(rect,gridArea,this._zoom,total) - this._syncShape(); - this._syncData(true); - return this._zoom; - }, - - syncBackupData : function (curOption) { - var start; - var target = this._originalData['series']; - var curSeries = curOption.series; - var curData; - for (var i = 0, l = curSeries.length; i < l; i++) { - curData = curSeries[i].data; - if (target[i]) { - // dataZoom接管的 - start = Math.floor(this._zoom.start / 100 * target[i].length); - } - else { - // 非dataZoom接管 - start = 0; - } - for (var j = 0, k = curData.length; j < k; j++) { - //optionBackup.series[i].data[j + start] = curData[j]; - if (target[i]) { - // 同步内部备份 - target[i][j + start] = curData[j]; - } - } - } - }, - - syncOption : function(magicOption) { - this.silence(true); - this.option = magicOption; - - this.clear(); - // 位置参数,通过计算所得x, y, width, height - this._location = this._getLocation(); - // 缩放参数 - this._zoom = this._getZoom(); - - this._backupData(); - if (this.option.dataZoom && this.option.dataZoom.show) { - this._buildShape(); - } - this._syncData(); - - this.silence(false); - }, - - silence : function (s) { - this._isSilence = s; - }, - - getRealDataIndex : function (sIdx, dIdx) { - if (!this._originalData || (this._zoom.start === 0 && this._zoom.end == 100)) { - return dIdx; - } - var sreies = this._originalData.series; - if (sreies[sIdx]) { - return Math.floor(this._zoom.start / 100 * sreies[sIdx].length) + dIdx; - } - return -1; - }, - - /** - * 避免dataZoom带来两次refresh,不设refresh接口,resize重复一下buildshape逻辑 - */ - resize : function () { - this.clear(); - - // 位置参数,通过计算所得x, y, width, height - this._location = this._getLocation(); - // 缩放参数 - this._zoom = this._getZoom(); - - if (this.option.dataZoom.show) { - this._buildShape(); - } - } - }; - - zrUtil.inherits(DataZoom, Base); - - require('../component').define('dataZoom', DataZoom); - - return DataZoom; -}); -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:handlePolygon,dataRange手柄 - */ -define('echarts/util/shape/HandlePolygon',['require','zrender/shape/Base','zrender/shape/Polygon','zrender/tool/util'],function (require) { - var Base = require('zrender/shape/Base'); - var PolygonShape = require('zrender/shape/Polygon'); - var zrUtil = require('zrender/tool/util'); - - function HandlePolygon(options) { - Base.call(this, options); - } - - HandlePolygon.prototype = { - type : 'handle-polygon', - /** - * 创建多边形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function (ctx, style) { - PolygonShape.prototype.buildPath( - ctx, style - ); - }, - isCover : function (x, y) { - var originPos = this.getTansform(x, y); - x = originPos[0]; - y = originPos[1]; - - // 不能缓存rect! - var rect = this.style.rect; - if (x >= rect.x - && x <= (rect.x + rect.width) - && y >= rect.y - && y <= (rect.y + rect.height) - ) { - // 矩形内 - return true; - } - else { - return false; - } - } - }; - zrUtil.inherits(HandlePolygon, Base); - - return HandlePolygon; -}); - -/** - * echarts组件:值域 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/component/dataRange',['require','./base','zrender/shape/Text','zrender/shape/Rectangle','../util/shape/HandlePolygon','../config','zrender/tool/util','zrender/tool/area','zrender/tool/color','zrender/tool/color','../component'],function (require) { - var Base = require('./base'); - - // 图形依赖 - var TextShape = require('zrender/shape/Text'); - var RectangleShape = require('zrender/shape/Rectangle'); - var HandlePolygonShape = require('../util/shape/HandlePolygon'); - - var ecConfig = require('../config'); - var zrUtil = require('zrender/tool/util'); - var zrArea = require('zrender/tool/area'); - var zrColor = require('zrender/tool/color'); - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} option 图表参数 - * @param {Object=} selected 用于状态保持 - */ - function DataRange(ecTheme, messageCenter, zr, option, myChart) { - if (typeof this.query(option, 'dataRange.min') == 'undefined' - || typeof this.query(option, 'dataRange.max') == 'undefined' - ) { - console.error('option.dataRange.min or option.dataRange.max has not been defined.'); - return; - } - - Base.call(this, ecTheme, messageCenter, zr, option, myChart); - - var self = this; - self._ondrift = function(dx, dy) { - return self.__ondrift(this, dx, dy); - }; - self._ondragend = function() { - return self.__ondragend(); - }; - self._dataRangeSelected = function(param) { - return self.__dataRangeSelected(param); - }; - this._selectedMap = {}; - this._range = {}; - - this.refresh(option); - } - - DataRange.prototype = { - type : ecConfig.COMPONENT_TYPE_DATARANGE, - _textGap : 10, // 非值文字间隔 - _buildShape : function () { - // 值域元素组的位置参数,通过计算所得x, y, width, height - this._itemGroupLocation = this._getItemGroupLocation(); - this._buildBackground(); - if (this.dataRangeOption.splitNumber <= 0 - || this.dataRangeOption.calculable - ) { - this._buildGradient(); - } - else { - this._buildItem(); - } - - for (var i = 0, l = this.shapeList.length; i < l; i++) { - this.zr.addShape(this.shapeList[i]); - } - - this._syncShapeFromRange(); - }, - - /** - * 构建图例型的值域元素 - */ - _buildItem : function () { - var data = this._valueTextList; - var dataLength = data.length; - var itemName; - var itemShape; - var textShape; - var font = this.getFont(this.dataRangeOption.textStyle); - - var lastX = this._itemGroupLocation.x; - var lastY = this._itemGroupLocation.y; - var itemWidth = this.dataRangeOption.itemWidth; - var itemHeight = this.dataRangeOption.itemHeight; - var itemGap = this.dataRangeOption.itemGap; - var textHeight = zrArea.getTextHeight('国', font); - var color; - - if (this.dataRangeOption.orient == 'vertical' - && this.dataRangeOption.x == 'right' - ) { - lastX = this._itemGroupLocation.x - + this._itemGroupLocation.width - - itemWidth; - } - var needValueText = true; - if (this.dataRangeOption.text) { - needValueText = false; - // 第一个文字 - if (this.dataRangeOption.text[0]) { - textShape = this._getTextShape( - lastX, lastY, this.dataRangeOption.text[0] - ); - if (this.dataRangeOption.orient == 'horizontal') { - lastX += zrArea.getTextWidth( - this.dataRangeOption.text[0], - font - ) - + this._textGap; - } - else { - lastY += textHeight + this._textGap; - textShape.style.y += textHeight / 2 + this._textGap; - textShape.style.textBaseline = 'bottom'; - } - this.shapeList.push(new TextShape(textShape)); - } - } - - for (var i = 0; i < dataLength; i++) { - itemName = data[i]; - color = this.getColor((dataLength - i) * this._gap + this.dataRangeOption.min); - // 图形 - itemShape = this._getItemShape( - lastX, lastY, - itemWidth, itemHeight, - (this._selectedMap[i] ? color : '#ccc') - ); - itemShape._idx = i; - itemShape.onclick = this._dataRangeSelected; - this.shapeList.push(new RectangleShape(itemShape)); - - if (needValueText) { - // 文字 - textShape = { - zlevel : this._zlevelBase, - style : { - x : lastX + itemWidth + 5, - y : lastY, - color : this._selectedMap[i] - ? this.dataRangeOption.textStyle.color - : '#ccc', - text: data[i], - textFont: font, - textBaseline: 'top' - }, - highlightStyle:{ - brushType: 'fill' - }, - clickable : true - }; - if (this.dataRangeOption.orient == 'vertical' - && this.dataRangeOption.x == 'right' - ) { - textShape.style.x -= (itemWidth + 10); - textShape.style.textAlign = 'right'; - } - textShape._idx = i; - textShape.onclick = this._dataRangeSelected; - this.shapeList.push(new TextShape(textShape)); - } - - if (this.dataRangeOption.orient == 'horizontal') { - lastX += itemWidth - + (needValueText ? 5 : 0) - + (needValueText - ? zrArea.getTextWidth(itemName, font) - : 0) - + itemGap; - } - else { - lastY += itemHeight + itemGap; - } - } - - if (!needValueText && this.dataRangeOption.text[1]) { - if (this.dataRangeOption.orient == 'horizontal') { - lastX = lastX - itemGap + this._textGap; - } - else { - lastY = lastY - itemGap + this._textGap; - } - // 最后一个文字 - textShape = this._getTextShape( - lastX, lastY, this.dataRangeOption.text[1] - ); - - if (this.dataRangeOption.orient != 'horizontal') { - textShape.style.y -= 5; - textShape.style.textBaseline = 'top'; - } - - this.shapeList.push(new TextShape(textShape)); - } - }, - - /** - * 构建渐变型的值域元素 - */ - _buildGradient : function () { - var itemShape; - var textShape; - var font = this.getFont(this.dataRangeOption.textStyle); - - var lastX = this._itemGroupLocation.x; - var lastY = this._itemGroupLocation.y; - var itemWidth = this.dataRangeOption.itemWidth; - var itemHeight = this.dataRangeOption.itemHeight; - var textHeight = zrArea.getTextHeight('国', font); - - - var needValueText = true; - if (this.dataRangeOption.text) { - needValueText = false; - // 第一个文字 - if (this.dataRangeOption.text[0]) { - textShape = this._getTextShape( - lastX, lastY, this.dataRangeOption.text[0] - ); - if (this.dataRangeOption.orient == 'horizontal') { - lastX += zrArea.getTextWidth( - this.dataRangeOption.text[0], - font - ) - + this._textGap; - } - else { - lastY += textHeight + this._textGap; - textShape.style.y += textHeight / 2 + this._textGap; - textShape.style.textBaseline = 'bottom'; - } - this.shapeList.push(new TextShape(textShape)); - } - } - - var zrColor = require('zrender/tool/color'); - var per = 1 / (this.dataRangeOption.color.length - 1); - var colorList = []; - for (var i = 0, l = this.dataRangeOption.color.length; i < l; i++) { - colorList.push([i * per, this.dataRangeOption.color[i]]); - } - if (this.dataRangeOption.orient == 'horizontal') { - itemShape = { - zlevel : this._zlevelBase, - style : { - x : lastX, - y : lastY, - width : itemWidth * 10, - height : itemHeight, - color : zrColor.getLinearGradient( - lastX, lastY, lastX + itemWidth * 10, lastY, - colorList - ) - }, - hoverable : false - }; - lastX += itemWidth * 10 + this._textGap; - } - else { - itemShape = { - zlevel : this._zlevelBase, - style : { - x : lastX, - y : lastY, - width : itemWidth, - height : itemHeight * 10, - color : zrColor.getLinearGradient( - lastX, lastY, lastX, lastY + itemHeight * 10, - colorList - ) - }, - hoverable : false - }; - lastY += itemHeight * 10 + this._textGap; - } - this.shapeList.push(new RectangleShape(itemShape)); - if (this.dataRangeOption.calculable) { - // 可计算元素的位置缓存 - this._calculableLocation = itemShape.style; - this._buildFiller(); - this._bulidMask(); - this._bulidHandle(); - } - - if (!needValueText && this.dataRangeOption.text[1]) { - // 最后一个文字 - textShape = this._getTextShape( - lastX, lastY, this.dataRangeOption.text[1] - ); - - this.shapeList.push(new TextShape(textShape)); - } - }, - - /** - * 构建填充物 - */ - _buildFiller : function () { - this._fillerShae = { - zlevel : this._zlevelBase + 1, - style : { - x : this._calculableLocation.x, - y : this._calculableLocation.y, - width : this._calculableLocation.width, - height : this._calculableLocation.height, - color : 'rgba(255,255,255,0)' - }, - highlightStyle : { - strokeColor : 'rgba(255,255,255,0.5)', - lineWidth : 1 - }, - draggable : true, - ondrift : this._ondrift, - ondragend : this._ondragend, - _type : 'filler' - }; - this._fillerShae = new RectangleShape(this._fillerShae); - this.shapeList.push(this._fillerShae); - }, - - /** - * 构建拖拽手柄 - */ - _bulidHandle : function () { - var x = this._calculableLocation.x; - var y = this._calculableLocation.y; - var width = this._calculableLocation.width; - var height = this._calculableLocation.height; - - var font = this.getFont(this.dataRangeOption.textStyle); - var textHeight = zrArea.getTextHeight('国', font); - var textWidth = Math.max( - zrArea.getTextWidth(this._textFormat(this.dataRangeOption.max), font), - zrArea.getTextWidth(this._textFormat(this.dataRangeOption.min), font) - ) + 2; - - var pointListStart; - var textXStart; - var textYStart; - var coverRectStart; - var pointListEnd; - var textXEnd; - var textYEnd; - var coverRectEnd; - if (this.dataRangeOption.orient == 'horizontal') { - // 水平 - if (this.dataRangeOption.y != 'bottom') { - // 手柄统统在下方 - pointListStart = [ - [x, y], - [x, y + height + textHeight], - [x - textHeight, y + height + textHeight], - [x - 1, y + height], - [x - 1, y] - - ]; - textXStart = x - textWidth / 2 - textHeight; - textYStart = y + height + textHeight / 2 + 2; - coverRectStart = { - x : x - textWidth - textHeight, - y : y + height, - width : textWidth + textHeight, - height : textHeight - }; - - pointListEnd = [ - [x + width, y], - [x + width, y + height + textHeight], - [x + width + textHeight, y + height + textHeight], - [x + width + 1, y + height], - [x + width + 1, y] - ]; - textXEnd = x + width + textWidth / 2 + textHeight; - textYEnd = textYStart; - coverRectEnd = { - x : x + width, - y : y + height, - width : textWidth + textHeight, - height : textHeight - }; - } - else { - // 手柄在上方 - pointListStart = [ - [x, y + height], - [x, y - textHeight], - [x - textHeight, y - textHeight], - [x - 1, y], - [x - 1, y + height] - - ]; - textXStart = x - textWidth / 2 - textHeight; - textYStart = y - textHeight / 2 - 2; - coverRectStart = { - x : x - textWidth - textHeight, - y : y - textHeight, - width : textWidth + textHeight, - height : textHeight - }; - - pointListEnd = [ - [x + width, y + height], - [x + width, y - textHeight], - [x + width + textHeight, y - textHeight], - [x + width + 1, y], - [x + width + 1, y + height] - ]; - textXEnd = x + width + textWidth / 2 + textHeight; - textYEnd = textYStart; - coverRectEnd = { - x : x + width, - y : y - textHeight, - width : textWidth + textHeight, - height : textHeight - }; - } - } - else { - textWidth += textHeight; - // 垂直 - if (this.dataRangeOption.x != 'right') { - // 手柄统统在右侧 - pointListStart = [ - [x, y], - [x + width + textHeight, y], - [x + width + textHeight, y - textHeight], - [x + width, y - 1], - [x, y - 1] - ]; - textXStart = x + width + textWidth / 2 + textHeight / 2; - textYStart = y - textHeight / 2; - coverRectStart = { - x : x + width, - y : y - textHeight, - width : textWidth + textHeight, - height : textHeight - }; - - pointListEnd = [ - [x, y + height], - [x + width + textHeight, y + height], - [x + width + textHeight, y + textHeight + height], - [x + width, y + 1 + height], - [x, y + height + 1] - ]; - textXEnd = textXStart; - textYEnd = y + height + textHeight / 2; - coverRectEnd = { - x : x + width, - y : y + height, - width : textWidth + textHeight, - height : textHeight - }; - } - else { - // 手柄在左侧 - pointListStart = [ - [x + width, y], - [x - textHeight, y], - [x - textHeight, y - textHeight], - [x, y - 1], - [x + width, y - 1] - ]; - textXStart = x - textWidth / 2 - textHeight / 2; - textYStart = y - textHeight / 2; - coverRectStart = { - x : x - textWidth - textHeight, - y : y - textHeight, - width : textWidth + textHeight, - height : textHeight - }; - - pointListEnd = [ - [x + width, y + height], - [x - textHeight, y + height], - [x - textHeight, y + textHeight + height], - [x, y + 1 + height], - [x + width, y + height + 1] - ]; - textXEnd = textXStart; - textYEnd = y + height + textHeight / 2; - coverRectEnd = { - x : x - textWidth - textHeight, - y : y + height, - width : textWidth + textHeight, - height : textHeight - }; - } - } - - this._startShape = { - style : { - pointList : pointListStart, - text : this._textFormat(this.dataRangeOption.max), - textX : textXStart, - textY : textYStart, - color : this.getColor(this.dataRangeOption.max), - rect : coverRectStart, - x : pointListStart[0][0], - y : pointListStart[0][1], - _x : pointListStart[0][0], // 拖拽区域控制缓存 - _y : pointListStart[0][1] - } - }; - this._startShape.highlightStyle = { - strokeColor : this._startShape.style.color, - lineWidth : 1 - }; - - this._endShape = { - style : { - pointList : pointListEnd, - text : this._textFormat(this.dataRangeOption.min), - textX : textXEnd, - textY : textYEnd, - color : this.getColor(this.dataRangeOption.min), - rect : coverRectEnd, - x : pointListEnd[0][0], - y : pointListEnd[0][1], - _x : pointListEnd[0][0], // 拖拽区域控制缓存 - _y : pointListEnd[0][1] - } - }; - this._endShape.highlightStyle = { - strokeColor : this._endShape.style.color, - lineWidth : 1 - }; - - // 统一参数 - this._startShape.zlevel = this._endShape.zlevel = this._zlevelBase + 1; - this._startShape.draggable = this._endShape.draggable = true; - this._startShape.ondrift = this._endShape.ondrift = this._ondrift; - this._startShape.ondragend = this._endShape.ondragend = this._ondragend; - - this._startShape.style.textColor = this._endShape.style.textColor - = this.dataRangeOption.textStyle.color; - this._startShape.style.textAlign = this._endShape.style.textAlign = 'center'; - this._startShape.style.textPosition = this._endShape.style.textPosition = 'specific'; - this._startShape.style.textBaseline = this._endShape.style.textBaseline = 'middle'; - // for ondrif计算统一 - this._startShape.style.width = this._endShape.style.width = 0; - this._startShape.style.height = this._endShape.style.height = 0; - this._startShape.style.textPosition = this._endShape.style.textPosition = 'specific'; - - this._startShape = new HandlePolygonShape(this._startShape); - this._endShape = new HandlePolygonShape(this._endShape); - this.shapeList.push(this._startShape); - this.shapeList.push(this._endShape); - }, - - _bulidMask : function () { - var x = this._calculableLocation.x; - var y = this._calculableLocation.y; - var width = this._calculableLocation.width; - var height = this._calculableLocation.height; - this._startMask = { - zlevel : this._zlevelBase + 1, - style : { - x : x, - y : y, - width : this.dataRangeOption.orient == 'horizontal' - ? 0 : width, - height : this.dataRangeOption.orient == 'horizontal' - ? height : 0, - color : '#ccc' - }, - hoverable:false - }; - this._endMask = { - zlevel : this._zlevelBase + 1, - style : { - x : this.dataRangeOption.orient == 'horizontal' - ? x + width : x, - y : this.dataRangeOption.orient == 'horizontal' - ? y : y + height, - width : this.dataRangeOption.orient == 'horizontal' - ? 0 : width, - height : this.dataRangeOption.orient == 'horizontal' - ? height : 0, - color : '#ccc' - }, - hoverable:false - }; - this._startMask = new RectangleShape(this._startMask); - this._endMask = new RectangleShape(this._endMask); - this.shapeList.push(this._startMask); - this.shapeList.push(this._endMask); - }, - - _buildBackground : function () { - var pTop = this.dataRangeOption.padding[0]; - var pRight = this.dataRangeOption.padding[1]; - var pBottom = this.dataRangeOption.padding[2]; - var pLeft = this.dataRangeOption.padding[3]; - - this.shapeList.push(new RectangleShape({ - zlevel : this._zlevelBase, - hoverable :false, - style : { - x : this._itemGroupLocation.x - pLeft, - y : this._itemGroupLocation.y - pTop, - width : this._itemGroupLocation.width + pLeft + pRight, - height : this._itemGroupLocation.height + pTop + pBottom, - brushType : this.dataRangeOption.borderWidth === 0 - ? 'fill' : 'both', - color : this.dataRangeOption.backgroundColor, - strokeColor : this.dataRangeOption.borderColor, - lineWidth : this.dataRangeOption.borderWidth - } - })); - }, - - /** - * 根据选项计算值域实体的位置坐标 - */ - _getItemGroupLocation : function () { - var data = this._valueTextList; - var dataLength = data.length; - var itemGap = this.dataRangeOption.itemGap; - var itemWidth = this.dataRangeOption.itemWidth; - var itemHeight = this.dataRangeOption.itemHeight; - var totalWidth = 0; - var totalHeight = 0; - var font = this.getFont(this.dataRangeOption.textStyle); - var textHeight = zrArea.getTextHeight('国', font); - - if (this.dataRangeOption.orient == 'horizontal') { - // 水平布局,计算总宽度 - if (this.dataRangeOption.text - || this.dataRangeOption.splitNumber <= 0 - || this.dataRangeOption.calculable - ) { - // 指定文字或线性渐变 - totalWidth = - ((this.dataRangeOption.splitNumber <= 0 - || this.dataRangeOption.calculable) - ? (itemWidth * 10 + itemGap) - : dataLength * (itemWidth + itemGap)) - + (this.dataRangeOption.text - && typeof this.dataRangeOption.text[0] != 'undefined' - ? (zrArea.getTextWidth( - this.dataRangeOption.text[0], - font - ) + this._textGap) - : 0) - + (this.dataRangeOption.text - && typeof this.dataRangeOption.text[1] != 'undefined' - ? (zrArea.getTextWidth( - this.dataRangeOption.text[1], - font - ) + this._textGap) - : 0); - } - else { - // 值标签 - itemWidth += 5; - for (var i = 0; i < dataLength; i++) { - totalWidth += itemWidth - + zrArea.getTextWidth( - data[i], - font - ) - + itemGap; - } - } - totalWidth -= itemGap; // 减去最后一个的itemGap - totalHeight = Math.max(textHeight, itemHeight); - } - else { - // 垂直布局,计算总高度 - var maxWidth; - if (this.dataRangeOption.text - || this.dataRangeOption.splitNumber <= 0 - || this.dataRangeOption.calculable - ) { - // 指定文字或线性渐变 - totalHeight = - ((this.dataRangeOption.splitNumber <= 0 - || this.dataRangeOption.calculable) - ? (itemHeight * 10 + itemGap) - : dataLength * (itemHeight + itemGap)) - + (this.dataRangeOption.text - && typeof this.dataRangeOption.text[0] != 'undefined' - ? (this._textGap + textHeight) - : 0) - + (this.dataRangeOption.text - && typeof this.dataRangeOption.text[1] != 'undefined' - ? (this._textGap + textHeight) - : 0); - - maxWidth = Math.max( - zrArea.getTextWidth( - (this.dataRangeOption.text && this.dataRangeOption.text[0]) - || '', - font - ), - zrArea.getTextWidth( - (this.dataRangeOption.text && this.dataRangeOption.text[1]) - || '', - font - ) - ); - totalWidth = Math.max(itemWidth, maxWidth); - } - else { - totalHeight = (itemHeight + itemGap) * dataLength; - // 值标签 - itemWidth += 5; - maxWidth = 0; - for (var i = 0; i < dataLength; i++) { - maxWidth = Math.max( - maxWidth, - zrArea.getTextWidth( - data[i], - font - ) - ); - } - totalWidth = itemWidth + maxWidth; - } - totalHeight -= itemGap; // 减去最后一个的itemGap; - } - - var x; - var zrWidth = this.zr.getWidth(); - switch (this.dataRangeOption.x) { - case 'center' : - x = Math.floor((zrWidth - totalWidth) / 2); - break; - case 'left' : - x = this.dataRangeOption.padding[3] - + this.dataRangeOption.borderWidth; - break; - case 'right' : - x = zrWidth - - totalWidth - - this.dataRangeOption.padding[1] - - this.dataRangeOption.borderWidth; - break; - default : - x = this.parsePercent(this.dataRangeOption.x, zrWidth); - x = isNaN(x) ? 0 : x; - break; - } - - var y; - var zrHeight = this.zr.getHeight(); - switch (this.dataRangeOption.y) { - case 'top' : - y = this.dataRangeOption.padding[0] - + this.dataRangeOption.borderWidth; - break; - case 'bottom' : - y = zrHeight - - totalHeight - - this.dataRangeOption.padding[2] - - this.dataRangeOption.borderWidth; - break; - case 'center' : - y = Math.floor((zrHeight - totalHeight) / 2); - break; - default : - y = this.parsePercent(this.dataRangeOption.y, zrHeight); - y = isNaN(y) ? 0 : y; - break; - } - - if (this.dataRangeOption.calculable) { - // 留出手柄控件 - var handlerWidth = Math.max( - zrArea.getTextWidth(this.dataRangeOption.max, font), - zrArea.getTextWidth(this.dataRangeOption.min, font) - ) + textHeight; - if (this.dataRangeOption.orient == 'horizontal') { - if (x < handlerWidth) { - x = handlerWidth; - } - if (x + totalWidth + handlerWidth > zrWidth) { - x -= handlerWidth; - } - } - else { - if (y < textHeight) { - y = textHeight; - } - if (y + totalHeight + textHeight > zrHeight) { - y -= textHeight; - } - } - } - - return { - x : x, - y : y, - width : totalWidth, - height : totalHeight - }; - }, - - // 指定文本 - _getTextShape : function (x, y, text) { - return { - zlevel : this._zlevelBase, - style : { - x : (this.dataRangeOption.orient == 'horizontal' - ? x - : this._itemGroupLocation.x - + this._itemGroupLocation.width / 2 - ), - y : (this.dataRangeOption.orient == 'horizontal' - ? this._itemGroupLocation.y - + this._itemGroupLocation.height / 2 - : y - ), - color : this.dataRangeOption.textStyle.color, - text: text, - textFont: this.getFont(this.dataRangeOption.textStyle), - textBaseline: (this.dataRangeOption.orient == 'horizontal' - ? 'middle' : 'top'), - textAlign: (this.dataRangeOption.orient == 'horizontal' - ? 'left' : 'center') - }, - hoverable : false - }; - }, - - // 色尺legend item shape - _getItemShape : function (x, y, width, height, color) { - return { - zlevel : this._zlevelBase, - style : { - x : x, - y : y + 1, - width : width, - height : height - 2, - color : color - }, - highlightStyle: { - strokeColor: color, - lineWidth : 1 - }, - clickable : true - }; - }, - - /** - * 拖拽范围控制 - */ - __ondrift : function (shape, dx, dy) { - var x = this._calculableLocation.x; - var y = this._calculableLocation.y; - var width = this._calculableLocation.width; - var height = this._calculableLocation.height; - - if (this.dataRangeOption.orient == 'horizontal') { - if (shape.style.x + dx <= x) { - shape.style.x = x; - } - else if (shape.style.x + dx + shape.style.width >= x + width) { - shape.style.x = x + width - shape.style.width; - } - else { - shape.style.x += dx; - } - } - else { - if (shape.style.y + dy <= y) { - shape.style.y = y; - } - else if (shape.style.y + dy + shape.style.height >= y + height) { - shape.style.y = y + height - shape.style.height; - } - else { - shape.style.y += dy; - } - } - - if (shape._type == 'filler') { - this._syncHandleShape(); - } - else { - this._syncFillerShape(shape); - } - - if (this.dataRangeOption.realtime) { - this._syncData(); - } - - return true; - }, - - __ondragend : function () { - this.isDragend = true; - }, - - /** - * 数据项被拖拽出去 - */ - ondragend : function (param, status) { - if (!this.isDragend || !param.target) { - // 没有在当前实例上发生拖拽行为则直接返回 - return; - } - - !this.dataRangeOption.realtime && this._syncData(); - - // 别status = {}赋值啊!! - status.dragOut = true; - status.dragIn = true; - - if (!this.dataRangeOption.realtime && false) { - this.messageCenter.dispatch( - ecConfig.EVENT.DATA_RANGE, - null, - { - range : { - start : this._range.end, - end : this._range.start - } - }, - this.myChart - ); - } - - status.needRefresh = false; // 会有消息触发fresh,不用再刷一遍 - // 处理完拖拽事件后复位 - this.isDragend = false; - - return; - }, - - // 外部传入range - _syncShapeFromRange : function () { - var range = this.dataRangeOption.range || {}; - // 做一个反转 - this._range.end = typeof this._range.end != 'undefined' - ? this._range.end - : (typeof range.start != 'undefined' ? range.start : 0); - this._range.start = typeof this._range.start != 'undefined' - ? this._range.start - : (typeof range.end != 'undefined' ? range.end : 100); - - if (this._range.start != 100 || this._range.end !== 0) { - // 非默认满值同步一下图形 - if (this.dataRangeOption.orient == 'horizontal') { - // 横向 - var width = this._fillerShae.style.width; - this._fillerShae.style.x += - width * (100 - this._range.start) / 100; - this._fillerShae.style.width = - width * (this._range.start - this._range.end) / 100; - } - else { - // 纵向 - var height = this._fillerShae.style.height; - this._fillerShae.style.y += - height * (100 - this._range.start) / 100; - this._fillerShae.style.height = - height * (this._range.start - this._range.end) / 100; - } - this.zr.modShape(this._fillerShae.id); - this._syncHandleShape(); - } - }, - - _syncHandleShape : function () { - var x = this._calculableLocation.x; - var y = this._calculableLocation.y; - var width = this._calculableLocation.width; - var height = this._calculableLocation.height; - - if (this.dataRangeOption.orient == 'horizontal') { - this._startShape.style.x = this._fillerShae.style.x; - this._startMask.style.width = this._startShape.style.x - x; - - this._endShape.style.x = this._fillerShae.style.x - + this._fillerShae.style.width; - this._endMask.style.x = this._endShape.style.x; - this._endMask.style.width = x + width - this._endShape.style.x; - - this._range.start = Math.ceil( - 100 - (this._startShape.style.x - x) / width * 100 - ); - this._range.end = Math.floor( - 100 - (this._endShape.style.x - x) / width * 100 - ); - } - else { - this._startShape.style.y = this._fillerShae.style.y; - this._startMask.style.height = this._startShape.style.y - y; - - this._endShape.style.y = this._fillerShae.style.y - + this._fillerShae.style.height; - this._endMask.style.y = this._endShape.style.y; - this._endMask.style.height = y + height - this._endShape.style.y; - - this._range.start = Math.ceil( - 100 - (this._startShape.style.y - y) / height * 100 - ); - this._range.end = Math.floor( - 100 - (this._endShape.style.y - y) / height * 100 - ); - } - - this._syncShape(); - }, - - _syncFillerShape : function (e) { - var x = this._calculableLocation.x; - var y = this._calculableLocation.y; - var width = this._calculableLocation.width; - var height = this._calculableLocation.height; - - var a; - var b; - if (this.dataRangeOption.orient == 'horizontal') { - a = this._startShape.style.x; - b = this._endShape.style.x; - if (e.id == this._startShape.id && a >= b) { - // _startShape触发 - b = a; - this._endShape.style.x = a; - } - else if (e.id == this._endShape.id && a >= b) { - // _endShape触发 - a = b; - this._startShape.style.x = a; - } - this._fillerShae.style.x = a; - this._fillerShae.style.width = b - a; - this._startMask.style.width = a - x; - this._endMask.style.x = b; - this._endMask.style.width = x + width - b; - - this._range.start = Math.ceil(100 - (a - x) / width * 100); - this._range.end = Math.floor(100 - (b - x) / width * 100); - } - else { - a = this._startShape.style.y; - b = this._endShape.style.y; - if (e.id == this._startShape.id && a >= b) { - // _startShape触发 - b = a; - this._endShape.style.y = a; - } - else if (e.id == this._endShape.id && a >= b) { - // _endShape触发 - a = b; - this._startShape.style.y = a; - } - this._fillerShae.style.y = a; - this._fillerShae.style.height = b - a; - this._startMask.style.height = a - y; - this._endMask.style.y = b; - this._endMask.style.height = y + height - b; - - this._range.start = Math.ceil(100 - (a - y) / height * 100); - this._range.end = Math.floor(100 - (b - y) / height * 100); - } - - this._syncShape(); - }, - - _syncShape : function () { - this._startShape.position = [ - this._startShape.style.x - this._startShape.style._x, - this._startShape.style.y - this._startShape.style._y - ]; - - this._startShape.style.text = this._textFormat( - this._gap * this._range.start + this.dataRangeOption.min - ); - - this._startShape.style.color - = this._startShape.highlightStyle.strokeColor - = this.getColor( - this._gap * this._range.start + this.dataRangeOption.min - ); - - this._endShape.position = [ - this._endShape.style.x - this._endShape.style._x, - this._endShape.style.y - this._endShape.style._y - ]; - - this._endShape.style.text = this._textFormat( - this._gap * this._range.end + this.dataRangeOption.min - ); - - this._endShape.style.color - = this._endShape.highlightStyle.strokeColor - = this.getColor( - this._gap * this._range.end + this.dataRangeOption.min - ); - - this.zr.modShape(this._startShape.id); - this.zr.modShape(this._endShape.id); - this.zr.modShape(this._startMask.id); - this.zr.modShape(this._endMask.id); - this.zr.modShape(this._fillerShae.id); - this.zr.refresh(); - }, - - _syncData : function () { - if (this.dataRangeOption.realtime) { - this.messageCenter.dispatch( - ecConfig.EVENT.DATA_RANGE, - null, - { - range : { - start : this._range.end, - end : this._range.start - } - }, - this.myChart - ); - } - }, - - - __dataRangeSelected : function (param) { - var idx = param.target._idx; - this._selectedMap[idx] = !this._selectedMap[idx]; - this.messageCenter.dispatch(ecConfig.EVENT.REFRESH, null, null, this.myChart); - }, - - _textFormat : function(valueStart, valueEnd) { - valueStart = valueStart.toFixed(this.dataRangeOption.precision); - valueEnd = typeof valueEnd != 'undefined' - ? valueEnd.toFixed(this.dataRangeOption.precision) : ''; - if (this.dataRangeOption.formatter) { - if (typeof this.dataRangeOption.formatter == 'string') { - return this.dataRangeOption.formatter.replace('{value}', valueStart) - .replace('{value2}', valueEnd); - } - else if (typeof this.dataRangeOption.formatter == 'function') { - return this.dataRangeOption.formatter.call( - this.myChart, valueStart, valueEnd - ); - } - } - - if (valueEnd !== '') { - return valueStart + ' - ' + valueEnd; - } - - return valueStart; - }, - - /** - * 刷新 - */ - refresh : function (newOption) { - if (newOption) { - this.option = newOption; - this.option.dataRange = this.reformOption(this.option.dataRange); - // 补全padding属性 - this.option.dataRange.padding = this.reformCssArray( - this.option.dataRange.padding - ); - this.dataRangeOption = this.option.dataRange; - - var splitNumber = this.dataRangeOption.splitNumber <= 0 - || this.dataRangeOption.calculable - ? 100 - : this.dataRangeOption.splitNumber; - this._colorList = zrColor.getGradientColors( - this.dataRangeOption.color, - Math.max( - (splitNumber - this.dataRangeOption.color.length) - / (this.dataRangeOption.color.length - 1), - 0 - ) + 1 - ); - - if (this._colorList.length > splitNumber) { - var len = this._colorList.length; - var newColorList = [this._colorList[0]]; - var step = len / (splitNumber - 1); - for (var i = 1; i < splitNumber - 1; i++) { - newColorList.push(this._colorList[Math.floor(i * step)]); - } - newColorList.push(this._colorList[len - 1]); - this._colorList = newColorList; - } - // console.log(this._colorList.length) - - var precision = this.dataRangeOption.precision; - this._gap = (this.dataRangeOption.max - this.dataRangeOption.min) / splitNumber; - while (this._gap.toFixed(precision) - 0 != this._gap && precision < 5) { - // 精度自适应 - precision++; - } - this.dataRangeOption.precision = precision; - - this._gap = ( - (this.dataRangeOption.max - this.dataRangeOption.min) / splitNumber - ).toFixed(precision) - 0; - - this._valueTextList = []; - for (var i = 0; i < splitNumber; i++) { - this._selectedMap[i] = true; - this._valueTextList.unshift( - this._textFormat( - i * this._gap + this.dataRangeOption.min, - (i + 1) * this._gap + this.dataRangeOption.min - ) - ); - } - } - - this.clear(); - this._buildShape(); - }, - - getColor : function (value) { - if (isNaN(value)) { - return null; - } - - if (value < this.dataRangeOption.min) { - value = this.dataRangeOption.min; - } - else if (value > this.dataRangeOption.max) { - value = this.dataRangeOption.max; - } - - if (this.dataRangeOption.calculable) { - if (value - (this._gap * this._range.start + this.dataRangeOption.min) > 0.00005 - || value - (this._gap * this._range.end + this.dataRangeOption.min) < -0.00005) { - return null; - } - } - - var idx = this._colorList.length - Math.ceil( - (value - this.dataRangeOption.min) - / (this.dataRangeOption.max - this.dataRangeOption.min) - * this._colorList.length - ); - if (idx == this._colorList.length) { - idx--; - } - //console.log(value, idx,this._colorList[idx]) - if (this._selectedMap[idx]) { - return this._colorList[idx]; - } - else { - return null; - } - } - }; - - zrUtil.inherits(DataRange, Base); - - require('../component').define('dataRange', DataRange); - - return DataRange; -}); - - - -/** - * echarts图表类:散点图 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/chart/scatter',['require','../component/base','./base','../util/shape/Symbol','../component/axis','../component/grid','../component/dataZoom','../component/dataRange','../config','zrender/tool/util','zrender/tool/color','../chart'],function (require) { - var ComponentBase = require('../component/base'); - var ChartBase = require('./base'); - - // 图形依赖 - var SymbolShape = require('../util/shape/Symbol'); - // 组件依赖 - require('../component/axis'); - require('../component/grid'); - require('../component/dataZoom'); - require('../component/dataRange'); - - var ecConfig = require('../config'); - var zrUtil = require('zrender/tool/util'); - var zrColor = require('zrender/tool/color'); - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} series 数据 - * @param {Object} component 组件 - */ - function Scatter(ecTheme, messageCenter, zr, option, myChart){ - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); - // 图表基类 - ChartBase.call(this); - - this.refresh(option); - } - - Scatter.prototype = { - type : ecConfig.CHART_TYPE_SCATTER, - /** - * 绘制图形 - */ - _buildShape : function () { - var series = this.series; - this._sIndex2ColorMap = {}; // series默认颜色索引,seriesIndex索引到color - this._symbol = this.option.symbolList; - this._sIndex2ShapeMap = {}; // series图形类型,seriesIndex索引到_symbol - - this.selectedMap = {}; - this.xMarkMap = {}; - - var legend = this.component.legend; - var seriesArray = []; - var serie; // 临时映射变量 - var serieName; // 临时映射变量 - var iconShape; - var iconType; - for (var i = 0, l = series.length; i < l; i++) { - serie = series[i]; - serieName = serie.name; - if (serie.type == ecConfig.CHART_TYPE_SCATTER) { - series[i] = this.reformOption(series[i]); - this._sIndex2ShapeMap[i] = this.query(serie, 'symbol') - || this._symbol[i % this._symbol.length]; - if (legend){ - this.selectedMap[serieName] = legend.isSelected(serieName); - - this._sIndex2ColorMap[i] = zrColor.alpha(legend.getColor(serieName), 0.5); - - iconShape = legend.getItemShape(serieName); - if (iconShape) { - // 回调legend,换一个更形象的icon - var iconType = this._sIndex2ShapeMap[i]; - iconShape.style.brushType = iconType.match('empty') ? 'stroke' : 'both'; - iconType = iconType.replace('empty', '').toLowerCase(); - - if (iconType.match('rectangle')) { - iconShape.style.x += Math.round( - (iconShape.style.width - iconShape.style.height) / 2 - ); - iconShape.style.width = iconShape.style.height; - } - - if (iconType.match('star')) { - iconShape.style.n = (iconType.replace('star','') - 0) || 5; - iconType = 'star'; - } - - if (iconType.match('image')) { - iconShape.style.image = iconType.replace( - new RegExp('^image:\\/\\/'), '' - ); - iconShape.style.x += Math.round( - (iconShape.style.width - iconShape.style.height) / 2 - ); - iconShape.style.width = iconShape.style.height; - iconType = 'image'; - } - - iconShape.style.iconType = iconType; - legend.setItemShape(serieName, iconShape); - } - } - else { - this.selectedMap[serieName] = true; - this._sIndex2ColorMap[i] = this.zr.getColor(i); - } - - if (this.selectedMap[serieName]) { - seriesArray.push(i); - } - } - } - - this._buildSeries(seriesArray); - - this.addShapeList(); - }, - - /** - * 构建类目轴为水平方向的散点图系列 - */ - _buildSeries : function (seriesArray) { - if (seriesArray.length === 0) { - return; - } - var series = this.series; - var seriesIndex; - var serie; - var data; - var value; - var xAxis; - var yAxis; - - var pointList = {}; - var x; - var y; - for (var j = 0, k = seriesArray.length; j < k; j++) { - seriesIndex = seriesArray[j]; - serie = series[seriesIndex]; - if (serie.data.length === 0) { - continue; - } - - xAxis = this.component.xAxis.getAxis(serie.xAxisIndex || 0); - yAxis = this.component.yAxis.getAxis(serie.yAxisIndex || 0); - - pointList[seriesIndex] = []; - for (var i = 0, l = serie.data.length; i < l; i++) { - data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; - if (value == '-' || value.length < 2) { - // 数据格式不符 - continue; - } - x = xAxis.getCoord(value[0]); - y = yAxis.getCoord(value[1]); - pointList[seriesIndex].push([ - x, // 横坐标 - y, // 纵坐标 - i, // 数据index - data.name || '' // 名称 - ]); - - } - this.xMarkMap[seriesIndex] = this._markMap( - xAxis, yAxis, serie.data, pointList[seriesIndex] - ); - this.buildMark(seriesIndex); - } - - // console.log(pointList) - this._buildPointList(pointList); - }, - - _markMap : function (xAxis, yAxis, data, pointList) { - var xMarkMap = { - min0 : Number.POSITIVE_INFINITY, - max0 : Number.NEGATIVE_INFINITY, - sum0 : 0, - counter0 : 0, - average0 : 0, - min1 : Number.POSITIVE_INFINITY, - max1 : Number.NEGATIVE_INFINITY, - sum1 : 0, - counter1 : 0, - average1 : 0 - }; - var value; - for (var i = 0, l = pointList.length; i < l; i++) { - /** - x, // 横坐标 - y, // 纵坐标 - i, // 数据index - data.name || '' // 名称 - */ - value = data[pointList[i][2]].value || data[pointList[i][2]]; - // 横轴 - if (xMarkMap.min0 > value[0]) { - xMarkMap.min0 = value[0]; - xMarkMap.minY0 = pointList[i][1]; - xMarkMap.minX0 = pointList[i][0]; - } - if (xMarkMap.max0 < value[0]) { - xMarkMap.max0 = value[0]; - xMarkMap.maxY0 = pointList[i][1]; - xMarkMap.maxX0 = pointList[i][0]; - } - xMarkMap.sum0 += value[0]; - xMarkMap.counter0++; - - // 纵轴 - if (xMarkMap.min1 > value[1]) { - xMarkMap.min1 = value[1]; - xMarkMap.minY1 = pointList[i][1]; - xMarkMap.minX1 = pointList[i][0]; - } - if (xMarkMap.max1 < value[1]) { - xMarkMap.max1 = value[1]; - xMarkMap.maxY1 = pointList[i][1]; - xMarkMap.maxX1 = pointList[i][0]; - } - xMarkMap.sum1 += value[1]; - xMarkMap.counter1++; - } - - var gridX = this.component.grid.getX(); - var gridXend = this.component.grid.getXend(); - var gridY = this.component.grid.getY(); - var gridYend = this.component.grid.getYend(); - - xMarkMap.average0 = (xMarkMap.sum0 / xMarkMap.counter0).toFixed(2) - 0; - var x = xAxis.getCoord(xMarkMap.average0); - // 横轴平均纵向 - xMarkMap.averageLine0 = [ - [x, gridYend], - [x, gridY] - ]; - xMarkMap.minLine0 = [ - [xMarkMap.minX0, gridYend], - [xMarkMap.minX0, gridY] - ]; - xMarkMap.maxLine0 = [ - [xMarkMap.maxX0, gridYend], - [xMarkMap.maxX0, gridY] - ]; - - xMarkMap.average1 = (xMarkMap.sum1 / xMarkMap.counter1).toFixed(2) - 0; - var y = yAxis.getCoord(xMarkMap.average1); - // 纵轴平均横向 - xMarkMap.averageLine1 = [ - [gridX, y], - [gridXend, y] - ]; - xMarkMap.minLine1 = [ - [gridX, xMarkMap.minY1], - [gridXend, xMarkMap.minY1] - ]; - xMarkMap.maxLine1 = [ - [gridX, xMarkMap.maxY1], - [gridXend, xMarkMap.maxY1] - ]; - - return xMarkMap; - }, - - /** - * 生成折线和折线上的拐点 - */ - _buildPointList : function (pointList) { - var series = this.series; - var serie; - var seriesPL; - var singlePoint; - var shape; - for (var seriesIndex in pointList) { - serie = series[seriesIndex]; - seriesPL = pointList[seriesIndex]; - if (serie.large && serie.data.length > serie.largeThreshold) { - this.shapeList.push(this._getLargeSymbol( - seriesPL, - this.getItemStyleColor( - this.query( - serie, 'itemStyle.normal.color' - ), - seriesIndex, - -1 - ) || this._sIndex2ColorMap[seriesIndex] - )); - continue; - } - - /* - * pointlist=[ - * 0 x, - * 1 y, - * 2 数据index - * 3 名称 - * ] - */ - - for (var i = 0, l = seriesPL.length; i < l; i++) { - singlePoint = seriesPL[i]; - shape = this._getSymbol( - seriesIndex, // seriesIndex - singlePoint[2], // dataIndex - singlePoint[3], // name - singlePoint[0], // x - singlePoint[1] // y - ); - shape && this.shapeList.push(shape); - } - } - // console.log(this.shapeList) - }, - - /** - * 生成折线图上的拐点图形 - */ - _getSymbol : function (seriesIndex, dataIndex, name, x, y) { - var series = this.series; - var serie = series[seriesIndex]; - var data = serie.data[dataIndex]; - - var dataRange = this.component.dataRange; - var rangColor; - if (dataRange) { - rangColor = isNaN(data[2]) - ? this._sIndex2ColorMap[seriesIndex] - : dataRange.getColor(data[2]); - if (!rangColor) { - return null; - } - } - else { - rangColor = this._sIndex2ColorMap[seriesIndex]; - } - - var itemShape = this.getSymbolShape( - serie, seriesIndex, data, dataIndex, name, - x, y, - this._sIndex2ShapeMap[seriesIndex], - rangColor, - 'rgba(0,0,0,0)', - 'vertical' - ); - itemShape.zlevel = this._zlevelBase; - itemShape._main = true; - return itemShape; - }, - - _getLargeSymbol : function (pointList, nColor) { - return new SymbolShape({ - zlevel : this._zlevelBase, - _main : true, - hoverable: false, - style : { - pointList : pointList, - color : nColor, - strokeColor : nColor - }, - highlightStyle : { - pointList : [] - } - }); - }, - - // 位置转换 - getMarkCoord : function (seriesIndex, mpData) { - var serie = this.series[seriesIndex]; - var xMarkMap = this.xMarkMap[seriesIndex]; - var xAxis = this.component.xAxis.getAxis(serie.xAxisIndex); - var yAxis = this.component.yAxis.getAxis(serie.yAxisIndex); - var pos; - - if (mpData.type - && (mpData.type == 'max' || mpData.type == 'min' || mpData.type == 'average') - ) { - // 特殊值内置支持 - // 默认取纵值 - var valueIndex = typeof mpData.valueIndex != 'undefined' - ? mpData.valueIndex : 1; - pos = [ - xMarkMap[mpData.type + 'X' + valueIndex], - xMarkMap[mpData.type + 'Y' + valueIndex], - xMarkMap[mpData.type + 'Line' + valueIndex], - xMarkMap[mpData.type + valueIndex] - ]; - } - else { - pos = [ - typeof mpData.xAxis != 'string' && xAxis.getCoordByIndex - ? xAxis.getCoordByIndex(mpData.xAxis || 0) - : xAxis.getCoord(mpData.xAxis || 0), - - typeof mpData.yAxis != 'string' && yAxis.getCoordByIndex - ? yAxis.getCoordByIndex(mpData.yAxis || 0) - : yAxis.getCoord(mpData.yAxis || 0) - ]; - } - - return pos; - }, - - /** - * 刷新 - */ - refresh : function (newOption) { - if (newOption) { - this.option = newOption; - this.series = newOption.series; - } - - this.backupShapeList(); - this._buildShape(); - }, - - /** - * 值域响应 - * @param {Object} param - * @param {Object} status - */ - ondataRange : function (param, status) { - if (this.component.dataRange) { - this.refresh(); - status.needRefresh = true; - } - return; - } - }; - - zrUtil.inherits(Scatter, ChartBase); - zrUtil.inherits(Scatter, ComponentBase); - - // 图表注册 - require('../chart').define('scatter', Scatter); - - return Scatter; -}); -/** - * echarts图表类:K线图 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/chart/k',['require','../component/base','./base','../util/shape/Candle','../component/axis','../component/grid','../component/dataZoom','../config','../util/ecData','zrender/tool/util','../chart'],function (require) { - var ComponentBase = require('../component/base'); - var ChartBase = require('./base'); - - // 图形依赖 - var CandleShape = require('../util/shape/Candle'); - // 组件依赖 - require('../component/axis'); - require('../component/grid'); - require('../component/dataZoom'); - - var ecConfig = require('../config'); - var ecData = require('../util/ecData'); - var zrUtil = require('zrender/tool/util'); - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} series 数据 - * @param {Object} component 组件 - */ - function K(ecTheme, messageCenter, zr, option, myChart){ - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); - // 图表基类 - ChartBase.call(this); - - this.refresh(option); - } - - K.prototype = { - type : ecConfig.CHART_TYPE_K, - /** - * 绘制图形 - */ - _buildShape : function () { - var series = this.series; - this.selectedMap = {}; - - // 水平垂直双向series索引 ,position索引到seriesIndex - var _position2sIndexMap = { - top : [], - bottom : [] - }; - var xAxis; - for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type == ecConfig.CHART_TYPE_K) { - series[i] = this.reformOption(series[i]); - xAxis = this.component.xAxis.getAxis(series[i].xAxisIndex); - if (xAxis.type == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY - ) { - _position2sIndexMap[xAxis.getPosition()].push(i); - } - } - } - //console.log(_position2sIndexMap) - for (var position in _position2sIndexMap) { - if (_position2sIndexMap[position].length > 0) { - this._buildSinglePosition( - position, _position2sIndexMap[position] - ); - } - } - - this.addShapeList(); - }, - - /** - * 构建单个方向上的K线图 - * - * @param {number} seriesIndex 系列索引 - */ - _buildSinglePosition : function (position, seriesArray) { - var mapData = this._mapData(seriesArray); - var locationMap = mapData.locationMap; - var maxDataLength = mapData.maxDataLength; - - if (maxDataLength === 0 || locationMap.length === 0) { - return; - } - this._buildHorizontal(seriesArray, maxDataLength, locationMap); - - for (var i = 0, l = seriesArray.length; i < l; i++) { - this.buildMark(seriesArray[i]); - } - }, - - /** - * 数据整形 - * 数组位置映射到系列索引 - */ - _mapData : function (seriesArray) { - var series = this.series; - var serie; // 临时映射变量 - var serieName; // 临时映射变量 - var legend = this.component.legend; - var locationMap = []; // 需要返回的东西:数组位置映射到系列索引 - var maxDataLength = 0; // 需要返回的东西:最大数据长度 - // 计算需要显示的个数和分配位置并记在下面这个结构里 - for (var i = 0, l = seriesArray.length; i < l; i++) { - serie = series[seriesArray[i]]; - serieName = serie.name; - if (legend){ - this.selectedMap[serieName] = legend.isSelected(serieName); - } else { - this.selectedMap[serieName] = true; - } - - if (this.selectedMap[serieName]) { - locationMap.push(seriesArray[i]); - } - // 兼职帮算一下最大长度 - maxDataLength = Math.max(maxDataLength, serie.data.length); - } - return { - locationMap : locationMap, - maxDataLength : maxDataLength - }; - }, - - /** - * 构建类目轴为水平方向的K线图系列 - */ - _buildHorizontal : function (seriesArray, maxDataLength, locationMap) { - var series = this.series; - // 确定类目轴和数值轴,同一方向随便找一个即可 - var seriesIndex; - var serie; - var xAxisIndex; - var categoryAxis; - var yAxisIndex; // 数值轴各异 - var valueAxis; // 数值轴各异 - - var pointList = {}; - var candleWidth; - var data; - var value; - var barMaxWidth; - for (var j = 0, k = locationMap.length; j < k; j++) { - seriesIndex = locationMap[j]; - serie = series[seriesIndex]; - - xAxisIndex = serie.xAxisIndex || 0; - categoryAxis = this.component.xAxis.getAxis(xAxisIndex); - candleWidth = serie.barWidth - || Math.floor(categoryAxis.getGap() / 2); - barMaxWidth = serie.barMaxWidth; - if (barMaxWidth && barMaxWidth < candleWidth) { - candleWidth = barMaxWidth; - } - yAxisIndex = serie.yAxisIndex || 0; - valueAxis = this.component.yAxis.getAxis(yAxisIndex); - - pointList[seriesIndex] = []; - for (var i = 0, l = maxDataLength; i < l; i++) { - if (typeof categoryAxis.getNameByIndex(i) == 'undefined') { - // 系列数据超出类目轴长度 - break; - } - - data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; - if (value == '-' || value.length != 4) { - // 数据格式不符 - continue; - } - pointList[seriesIndex].push([ - categoryAxis.getCoordByIndex(i), // 横坐标 - candleWidth, - valueAxis.getCoord(value[0]), // 纵坐标:开盘 - valueAxis.getCoord(value[1]), // 纵坐标:收盘 - valueAxis.getCoord(value[2]), // 纵坐标:最低 - valueAxis.getCoord(value[3]), // 纵坐标:最高 - i, // 数据index - categoryAxis.getNameByIndex(i) // 类目名称 - ]); - } - } - // console.log(pointList) - this._buildKLine(seriesArray, pointList); - }, - - /** - * 生成K线 - */ - _buildKLine : function (seriesArray, pointList) { - var series = this.series; - // normal: - var nLineWidth; - var nLineColor; - var nLineColor0; // 阴线 - var nColor; - var nColor0; // 阴线 - - // emphasis: - var eLineWidth; - var eLineColor; - var eLineColor0; - var eColor; - var eColor0; - - var serie; - var queryTarget; - var data; - var seriesPL; - var singlePoint; - var candleType; - - var seriesIndex; - for (var sIdx = 0, len = seriesArray.length; sIdx < len; sIdx++) { - seriesIndex = seriesArray[sIdx]; - serie = series[seriesIndex]; - seriesPL = pointList[seriesIndex]; - - if (this._isLarge(seriesPL)) { - seriesPL = this._getLargePointList(seriesPL); - } - - if (serie.type == ecConfig.CHART_TYPE_K - && typeof seriesPL != 'undefined' - ) { - // 多级控制 - queryTarget = serie; - nLineWidth = this.query( - queryTarget, 'itemStyle.normal.lineStyle.width' - ); - nLineColor = this.query( - queryTarget, 'itemStyle.normal.lineStyle.color' - ); - nLineColor0 = this.query( - queryTarget, 'itemStyle.normal.lineStyle.color0' - ); - nColor = this.query( - queryTarget, 'itemStyle.normal.color' - ); - nColor0 = this.query( - queryTarget, 'itemStyle.normal.color0' - ); - - eLineWidth = this.query( - queryTarget, 'itemStyle.emphasis.lineStyle.width' - ); - eLineColor = this.query( - queryTarget, 'itemStyle.emphasis.lineStyle.color' - ); - eLineColor0 = this.query( - queryTarget, 'itemStyle.emphasis.lineStyle.color0' - ); - eColor = this.query( - queryTarget, 'itemStyle.emphasis.color' - ); - eColor0 = this.query( - queryTarget, 'itemStyle.emphasis.color0' - ); - - /* - * pointlist=[ - * 0 x, - * 1 width, - * 2 y0, - * 3 y1, - * 4 y2, - * 5 y3, - * 6 dataIndex, - * 7 categoryName - * ] - */ - for (var i = 0, l = seriesPL.length; i < l; i++) { - singlePoint = seriesPL[i]; - data = serie.data[singlePoint[6]]; - queryTarget = data; - candleType = singlePoint[3] < singlePoint[2]; - this.shapeList.push(this._getCandle( - seriesIndex, // seriesIndex - singlePoint[6], // dataIndex - singlePoint[7], // name - - singlePoint[0], // x - singlePoint[1], // width - singlePoint[2], // y开盘 - singlePoint[3], // y收盘 - singlePoint[4], // y最低 - singlePoint[5], // y最高 - - // 填充颜色 - candleType - ? (this.query( // 阳 - queryTarget, 'itemStyle.normal.color' - ) || nColor) - : (this.query( // 阴 - queryTarget, 'itemStyle.normal.color0' - ) || nColor0), - - // 线宽 - this.query( - queryTarget, 'itemStyle.normal.lineStyle.width' - ) || nLineWidth, - - // 线色 - candleType - ? (this.query( // 阳 - queryTarget, - 'itemStyle.normal.lineStyle.color' - ) || nLineColor) - : (this.query( // 阴 - queryTarget, - 'itemStyle.normal.lineStyle.color0' - ) || nLineColor0), - - //------------高亮 - - // 填充颜色 - candleType - ? (this.query( // 阳 - queryTarget, 'itemStyle.emphasis.color' - ) || eColor || nColor) - : (this.query( // 阴 - queryTarget, 'itemStyle.emphasis.color0' - ) || eColor0 || nColor0), - - // 线宽 - this.query( - queryTarget, 'itemStyle.emphasis.lineStyle.width' - ) || eLineWidth || nLineWidth, - - // 线色 - candleType - ? (this.query( // 阳 - queryTarget, - 'itemStyle.emphasis.lineStyle.color' - ) || eLineColor || nLineColor) - : (this.query( // 阴 - queryTarget, - 'itemStyle.emphasis.lineStyle.color0' - ) || eLineColor0 || nLineColor0) - )); - } - } - } - // console.log(this.shapeList) - }, - - _isLarge : function(singlePL) { - return singlePL[0][1] < 0.5; - }, - - /** - * 大规模pointList优化 - */ - _getLargePointList : function(singlePL) { - var total = this.component.grid.getWidth(); - var len = singlePL.length; - var newList = []; - for (var i = 0; i < total; i++) { - newList[i] = singlePL[Math.floor(len / total * i)]; - } - return newList; - }, - - /** - * 生成K线图上的图形 - */ - _getCandle : function ( - seriesIndex, dataIndex, name, - x, width, y0, y1, y2, y3, - nColor, nLinewidth, nLineColor, - eColor, eLinewidth, eLineColor - ) { - var series = this.series; - var itemShape = { - zlevel : this._zlevelBase, - clickable: true, - style : { - x : x, - y : [y0, y1, y2, y3], - width : width, - color : nColor, - strokeColor : nLineColor, - lineWidth : nLinewidth, - brushType : 'both' - }, - highlightStyle : { - color : eColor, - strokeColor : eLineColor, - lineWidth : eLinewidth - }, - _seriesIndex: seriesIndex - }; - ecData.pack( - itemShape, - series[seriesIndex], seriesIndex, - series[seriesIndex].data[dataIndex], dataIndex, - name - ); - - itemShape = new CandleShape(itemShape); - return itemShape; - }, - - // 位置转换 - getMarkCoord : function (seriesIndex, mpData) { - var serie = this.series[seriesIndex]; - var xAxis = this.component.xAxis.getAxis(serie.xAxisIndex); - var yAxis = this.component.yAxis.getAxis(serie.yAxisIndex); - - return [ - typeof mpData.xAxis != 'string' && xAxis.getCoordByIndex - ? xAxis.getCoordByIndex(mpData.xAxis || 0) - : xAxis.getCoord(mpData.xAxis || 0), - - typeof mpData.yAxis != 'string' && yAxis.getCoordByIndex - ? yAxis.getCoordByIndex(mpData.yAxis || 0) - : yAxis.getCoord(mpData.yAxis || 0) - ]; - }, - - /** - * 刷新 - */ - refresh : function (newOption) { - if (newOption) { - this.option = newOption; - this.series = newOption.series; - } - - this.backupShapeList(); - this._buildShape(); - }, - - /** - * 动画设定 - */ - addDataAnimation : function (params) { - var series = this.series; - var aniMap = {}; // seriesIndex索引参数 - for (var i = 0, l = params.length; i < l; i++) { - aniMap[params[i][0]] = params[i]; - } - var x; - var dx; - var y; - var serie; - var seriesIndex; - var dataIndex; - for (var i = 0, l = this.shapeList.length; i < l; i++) { - seriesIndex = this.shapeList[i]._seriesIndex; - if (aniMap[seriesIndex] && !aniMap[seriesIndex][3]) { - // 有数据删除才有移动的动画 - if (this.shapeList[i].type == 'candle') { - dataIndex = ecData.get(this.shapeList[i], 'dataIndex'); - serie = series[seriesIndex]; - if (aniMap[seriesIndex][2] - && dataIndex == serie.data.length - 1 - ) { - // 队头加入删除末尾 - this.zr.delShape(this.shapeList[i].id); - continue; - } - else if (!aniMap[seriesIndex][2] && dataIndex === 0) { - // 队尾加入删除头部 - this.zr.delShape(this.shapeList[i].id); - continue; - } - dx = this.component.xAxis.getAxis( - serie.xAxisIndex || 0 - ).getGap(); - x = aniMap[seriesIndex][2] ? dx : -dx; - y = 0; - this.zr.animate(this.shapeList[i].id, '') - .when( - 500, - {position : [x, y]} - ) - .start(); - } - } - } - } - }; - - zrUtil.inherits(K, ChartBase); - zrUtil.inherits(K, ComponentBase); - - // 图表注册 - require('../chart').define('k', K); - - return K; -}); -/** - * echarts坐标处理方法 - * - * @author Neil (杨骥, yangji01@baidu.com) - */ - -define( - 'echarts/util/coordinates',['require','zrender/tool/math'],function (require) { - var zrMath = require('zrender/tool/math'); - - /** - * 极坐标转直角坐标 - * - * @param {number} 半径 - * @param {number} 角度 - * - * @return {Array.} 直角坐标[x,y] - */ - function polar2cartesian(r, theta) { - return [r * zrMath.sin(theta), r*zrMath.cos(theta)]; - } - - /** - * 直角坐标转极坐标 - * - * @param {number} 横坐标 - * @param {number} 纵坐标 - * - * @return {Array.} 极坐标[r,theta] - */ - function cartesian2polar(x, y) { - return [Math.sqrt(x * x + y * y), Math.atan(y / x)]; - } - - return { - polar2cartesian : polar2cartesian, - cartesian2polar : cartesian2polar - }; - } -); -/** - * echarts组件类:极坐标 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Neil (杨骥, yangji01@baidu.com) - * - */ -define('echarts/component/polar',['require','./base','zrender/shape/Text','zrender/shape/Line','zrender/shape/Polygon','zrender/shape/Circle','zrender/shape/Ring','../config','zrender/tool/util','../util/coordinates','../component'],function (require) { - var Base = require('./base'); - - // 图形依赖 - var TextShape = require('zrender/shape/Text'); - var LineShape = require('zrender/shape/Line'); - var PolygonShape = require('zrender/shape/Polygon'); - var Circle = require('zrender/shape/Circle'); - var Ring = require('zrender/shape/Ring'); - - var ecConfig = require('../config'); - var zrUtil = require('zrender/tool/util'); - var ecCoordinates = require('../util/coordinates'); - - function Polar(ecTheme, messageCenter, zr, option, myChart) { - Base.call(this, ecTheme, messageCenter, zr, option, myChart); - - this.refresh(option); - } - - Polar.prototype = { - type : ecConfig.COMPONENT_TYPE_POLAR, - - /** - * 绘制图形 - */ - _buildShape : function () { - for (var i = 0; i < this.polar.length; i ++) { - this._index = i; - this.reformOption(this.polar[i]); - - this._queryTarget = [this.polar[i], this.option]; - this._createVector(i); - this._buildSpiderWeb(i); - - this._buildText(i); - - this._adjustIndicatorValue(i); - this._addAxisLabel(i); - } - - for (var i = 0; i < this.shapeList.length; i ++) { - this.zr.addShape(this.shapeList[i]); - } - }, - - /** - * 生成蜘蛛网顶点坐标 - * @param {number} polar的index - */ - _createVector : function (index) { - var item = this.polar[index]; - var indicator = this.deepQuery(this._queryTarget, 'indicator'); - var length = indicator.length; - var startAngle = item.startAngle ; - var dStep = 2 * Math.PI / length; - var radius = this._getRadius(); - var __ecIndicator = item.__ecIndicator = []; - var vector; - - for (var i = 0 ;i < length ; i ++) { - vector = ecCoordinates.polar2cartesian( - radius, startAngle * Math.PI / 180 + dStep * i - ); - __ecIndicator.push({ - // 将图形翻转 - vector : [vector[1], -vector[0]] - }); - } - }, - - /** - * 获取外圈的半径 - * - * @return {number} - */ - _getRadius : function () { - var item = this.polar[this._index]; - return this.parsePercent( - item.radius, - Math.min(this.zr.getWidth(), this.zr.getHeight()) / 2 - ); - }, - - /** - * 构建蜘蛛网 - * @param {number} polar的index - */ - _buildSpiderWeb : function (index) { - var item = this.polar[index]; - var __ecIndicator = item.__ecIndicator; - var splitArea = item.splitArea; - var splitLine = item.splitLine; - - var center = this.getCenter(index); - var splitNumber = item.splitNumber; - - var strokeColor = splitLine.lineStyle.color; - var lineWidth = splitLine.lineStyle.width; - var show = splitLine.show; - - var axisLine = this.deepQuery(this._queryTarget, 'axisLine'); - - this._addArea( - __ecIndicator, splitNumber, center, - splitArea, strokeColor, lineWidth, show - ); - - axisLine.show && this._addLine( - __ecIndicator, center, axisLine - ); - }, - - /** - * 绘制axisLabel - */ - _addAxisLabel : function (index) { - var item = this.polar[index]; - var indicator = this.deepQuery(this._queryTarget, 'indicator'); - var __ecIndicator = item.__ecIndicator; - var axisLabel; - var vector; - var style; - var newStyle; - var splitNumber = this.deepQuery(this._queryTarget, 'splitNumber'); - var center = this.getCenter(index); - var vector; - var value; - var text; - var theta; - // var startAngle = this.deepQuery(this._queryTarget, 'startAngle'); - var offset; - var precision = this.deepQuery(this._queryTarget, 'precision'); - var interval; - - for (var i = 0; i < indicator.length; i ++) { - axisLabel = this.deepQuery( - [indicator[i], item, this.option], 'axisLabel' - ); - - if (axisLabel.show) { - style = {}; - style.textFont = this.getFont(); - //Todo: bug fix - style = zrUtil.merge(style, axisLabel); - style.lineWidth = style.width; - - vector = __ecIndicator[i].vector; - value = __ecIndicator[i].value; - theta = i / indicator.length * 2 * Math.PI; - offset = axisLabel.offset || 10; - interval = axisLabel.interval || 0; - - for (var j = 1 ; j <= splitNumber; j += interval + 1) { - newStyle = zrUtil.merge({}, style); - text = - j * (value.max - value.min) / splitNumber - + value.min; - if (precision) { - text = text.toFixed(precision); - } - newStyle.text = this.numAddCommas(text); - newStyle.x = j * vector[0] / splitNumber - + Math.cos(theta) * offset + center[0]; - newStyle.y = j * vector[1] / splitNumber - + Math.sin(theta) * offset + center[1]; - - this.shapeList.push(new TextShape({ - zlevel : this._zlevelBase, - style : newStyle, - draggable : false, - hoverable : false - })); - } - } - } - }, - - /** - * 绘制坐标头的文字 - * @param {number} polar的index - */ - _buildText : function (index) { - var item = this.polar[index]; - var __ecIndicator = item.__ecIndicator; - var vector; - var indicator = this.deepQuery(this._queryTarget, 'indicator'); - var center = this.getCenter(index); - var style; - var textAlign; - var name; - var rotation; - var x = 0; - var y = 0; - var margin; - var textStyle; - - for (var i = 0; i < indicator.length; i ++) { - name = this.deepQuery( - [indicator[i], item, this.option], 'name' - ); - - if (!name.show) { - continue; - } - textStyle = this.deepQuery( - [name, item, this.option], - 'textStyle' - ); - - style = {}; - - style.textFont = this.getFont(textStyle); - style.color = textStyle.color; - - if (typeof name.formatter == 'function') { - style.text = name.formatter.call(this.myChart, indicator[i].text, i); - } - else if (typeof name.formatter == 'string'){ - style.text = name.formatter.replace( - '{value}', indicator[i].text - ); - } - else { - style.text = indicator[i].text; - } - __ecIndicator[i].text = style.text; - - vector = __ecIndicator[i].vector; - - if (Math.round(vector[0]) > 0) { - textAlign = 'left'; - } - else if (Math.round(vector[0]) < 0) { - textAlign = 'right'; - } - else { - textAlign = 'center'; - } - - if (!name.margin) { - vector = this._mapVector(vector, center, 1.2); - } - else { - margin = name.margin; - x = vector[0] > 0 ? margin : - margin; - y = vector[1] > 0 ? margin : - margin; - - x = vector[0] === 0 ? 0 : x; - y = vector[1] === 0 ? 0 : y; - vector = this._mapVector(vector, center, 1); - } - - - style.textAlign = textAlign; - style.x = vector[0] + x; - style.y = vector[1] + y; - - if (name.rotate) { - rotation = [ - name.rotate / 180 * Math.PI, - vector[0], vector[1] - ]; - } - else { - rotation = [0, 0, 0]; - } - - this.shapeList.push(new TextShape({ - zlevel : this._zlevelBase, - style : style, - draggable : false, - hoverable : false, - rotation : rotation - })); - } - }, - - getIndicatorText : function(polarIndex, indicatorIndex) { - return this.polar[polarIndex] - && this.polar[polarIndex].__ecIndicator[indicatorIndex] - && this.polar[polarIndex].__ecIndicator[indicatorIndex].text; - }, - - /** - * 添加一个隐形的盒子 当做drop的容器 暴露给外部的图形类使用 - * @param {number} polar的index - * @return {Object} 添加的盒子图形 - */ - getDropBox : function (index) { - var index = index || 0; - var item = this.polar[index]; - var center = this.getCenter(index); - var __ecIndicator = item.__ecIndicator; - var len = __ecIndicator.length; - var pointList = []; - var vector; - var shape; - var type = item.type; - - if (type == 'polygon') { - for (var i = 0; i < len; i ++) { - vector = __ecIndicator[i].vector; - pointList.push(this._mapVector(vector, center, 1.2)); - } - shape = this._getShape( - pointList, 'fill', 'rgba(0,0,0,0)', '', 1 - ); - } else if (type == 'circle') { - shape = this._getCircle( - '', 1, 1.2, center, 'fill', 'rgba(0,0,0,0)' - ); - } - - return shape; - }, - - /** - * 绘制蜘蛛网的正n变形 - * - * @param {Array} 指标数组 - * @param {number} 分割线数量 - * @param {Array} 中点坐标 - * @param {Object} 分割区域对象 - * @param {string} 线条颜色 - * @param {number} 线条宽度 - */ - _addArea : function ( - __ecIndicator, splitNumber, center, - splitArea, strokeColor, lineWidth, show - ) { - var shape; - var scale; - var scale1; - var pointList; - var type = this.deepQuery(this._queryTarget, 'type'); - - for (var i = 0; i < splitNumber ; i ++ ) { - scale = (splitNumber - i) / splitNumber; - - if (show) { - if (type == 'polygon') { - pointList = this._getPointList( - __ecIndicator, scale, center); - shape = this._getShape( - pointList, 'stroke', '', strokeColor, lineWidth - ); - } else if (type == 'circle') { - shape = this._getCircle( - strokeColor, lineWidth, scale, center, 'stroke' - ); - } - - this.shapeList.push(shape); - } - - if (splitArea.show) { - scale1 = (splitNumber - i - 1) / splitNumber; - this._addSplitArea( - __ecIndicator, splitArea, scale, scale1, center, i - ); - } - } - }, - - /** - * 绘制圆 - * - * @param {string} strokeColor - * @param {number} lineWidth - * @param {number} scale - * @param {Array.} center - * @param {string} brushType - * @param {string} color - * @return {Circle} - */ - _getCircle : function ( - strokeColor, lineWidth, scale, center, brushType, color - ) { - var radius = this._getRadius(); - return new Circle({ - zlevel : this._zlevelBase, - style: { - x: center[0], - y: center[1], - r: radius * scale, - brushType: brushType, - strokeColor: strokeColor, - lineWidth: lineWidth, - color: color - }, - hoverable : false, - draggable : false - }); - }, - - /** - * 绘制圆环 - * - * @param {string} color 间隔颜色 - * @param {number} scale0 小圆的scale - * @param {number} scale1 大圆的scale - * @param {Array.} center 圆点 - * @return {Ring} - */ - _getRing : function (color, scale0, scale1, center) { - var radius = this._getRadius(); - return new Ring({ - zlevel : this._zlevelBase, - style : { - x : center[0], - y : center[1], - r : scale0 * radius, - r0 : scale1 * radius, - color : color, - brushType : 'fill' - }, - hoverable : false, - draggable : false - }); - }, - - /** - * 获取需要绘制的多边形的点集 - * @param {Object} serie的指标参数 - * @param {number} 缩小的系数 - * @param {Array} 中点坐标 - * - * @return {Array>} 返回绘制的点集 - */ - _getPointList : function (__ecIndicator, scale, center) { - var pointList = []; - var len = __ecIndicator.length; - var vector; - - for (var i = 0 ; i < len ; i ++ ) { - vector = __ecIndicator[i].vector; - - pointList.push(this._mapVector(vector, center, scale)); - } - return pointList; - }, - - /** - * 获取绘制的图形 - * @param {Array>} 绘制的点集 - * @param {string} 绘制方式 stroke | fill | both 描边 | 填充 | 描边 + 填充 - * @param {string} 颜色 - * @param {string} 描边颜色 - * @param {number} 线条宽度 - * @return {Object} 绘制的图形对象 - */ - _getShape : function ( - pointList, brushType, color, strokeColor, lineWidth - ) { - return new PolygonShape({ - zlevel : this._zlevelBase, - style : { - pointList : pointList, - brushType : brushType, - color : color, - strokeColor : strokeColor, - lineWidth : lineWidth - }, - hoverable : false, - draggable : false - }); - }, - - /** - * 绘制填充区域 - */ - _addSplitArea : function ( - __ecIndicator, splitArea, scale, scale1, center, colorInd - ) { - var indLen = __ecIndicator.length; - var color; - var colorArr = splitArea.areaStyle.color; - var colorLen; - - var vector; - var vector1; - var pointList = []; - var indLen = __ecIndicator.length; - var shape; - - var type = this.deepQuery(this._queryTarget, 'type'); - - if (typeof colorArr == 'string') { - colorArr = [colorArr]; - } - colorLen = colorArr.length; - color = colorArr[ colorInd % colorLen]; - - if (type == 'polygon') { - for (var i = 0; i < indLen ; i ++) { - pointList = []; - vector = __ecIndicator[i].vector; - vector1 = __ecIndicator[(i + 1) % indLen].vector; - - pointList.push(this._mapVector(vector, center, scale)); - pointList.push(this._mapVector(vector, center, scale1)); - pointList.push(this._mapVector(vector1, center, scale1)); - pointList.push(this._mapVector(vector1, center, scale)); - - shape = this._getShape( - pointList, 'fill', color, '', 1 - ); - this.shapeList.push(shape); - } - } else if (type == 'circle') { - shape = this._getRing(color, scale, scale1, center); - this.shapeList.push(shape); - } - }, - - /** - * 转换坐标 - * - * @param {Array} 原始坐标 - * @param {Array} 中点坐标 - * @param {number} 缩小的倍数 - * - * @return {Array} 转换后的坐标 - */ - _mapVector : function (vector, center, scale) { - return [ - vector[0] * scale + center[0], - vector[1] * scale + center[1] - ]; - }, - - /** - * 获取中心点位置 暴露给外部图形类使用 - * @param {number} polar的index - */ - getCenter : function (index) { - var index = index || 0; - return this.parseCenter(this.zr, this.polar[index].center); - }, - - /** - * 绘制从中点出发的线 - * - * @param {Array} 指标对象 - * @param {Array} 中点坐标 - * @param {string} 线条颜色 - * @param {number} 线条宽度 - * @param {string} 线条绘制类型 - * solid | dotted | dashed 实线 | 点线 | 虚线 - */ - _addLine : function ( - __ecIndicator, center, axisLine - ) { - var indLen = __ecIndicator.length; - var line; - var vector; - var lineStyle = axisLine.lineStyle; - var strokeColor = lineStyle.color; - var lineWidth = lineStyle.width; - var lineType = lineStyle.type; - - for (var i = 0; i < indLen ; i ++ ) { - vector = __ecIndicator[i].vector; - line = this._getLine( - center[0], center[1], - vector[0] + center[0], - vector[1] + center[1], - strokeColor, lineWidth, lineType - ); - this.shapeList.push(line); - } - }, - - /** - * 获取线条对象 - * @param {number} 出发点横坐标 - * @param {number} 出发点纵坐标 - * @param {number} 终点横坐标 - * @param {number} 终点纵坐标 - * @param {string} 线条颜色 - * @param {number} 线条宽度 - * @param {string} 线条类型 - * - * @return {Object} 线条对象 - */ - _getLine : function ( - xStart, yStart, xEnd, yEnd, strokeColor, lineWidth, lineType - ) { - return new LineShape({ - zlevel : this._zlevelBase, - style : { - xStart : xStart, - yStart : yStart, - xEnd : xEnd, - yEnd : yEnd, - strokeColor : strokeColor, - lineWidth : lineWidth, - lineType : lineType - }, - hoverable : false - }); - }, - - /** - * 调整指标的值,当indicator中存在max时设置为固定值 - * @param {number} polar的index - */ - _adjustIndicatorValue : function (index) { - var item = this.polar[index]; - var indicator = this.deepQuery(this._queryTarget, 'indicator'); - var len = indicator.length; - var __ecIndicator = item.__ecIndicator; - var value; - var max; - var min; - var data = this._getSeriesData(index); - var splitNumber = item.splitNumber; - - var boundaryGap = this.deepQuery(this._queryTarget, 'boundaryGap'); - var precision = this.deepQuery(this._queryTarget, 'precision'); - var power = this.deepQuery(this._queryTarget, 'power'); - var scale = this.deepQuery(this._queryTarget, 'scale'); - - for (var i = 0; i < len ; i ++ ) { - if (typeof indicator[i].max == 'number') { - max = indicator[i].max; - min = indicator[i].min || 0; - value = { - max : max, - min : min - }; - } - else { - value = this._findValue( - data, i, splitNumber, - boundaryGap, precision, power, scale - ); - } - - __ecIndicator[i].value = value; - } - }, - - /** - * 将series中的数据拿出来,如果没有polarIndex属性,默认为零 - * @param {number} polar 的index - * @param {Array} 需要处理的数据 - */ - _getSeriesData : function (index) { - var data = []; - var serie; - var serieData; - var legend = this.component.legend; - var polarIndex; - - for (var i = 0; i < this.series.length; i ++) { - serie = this.series[i]; - if (serie.type != ecConfig.CHART_TYPE_RADAR) { - continue; - } - serieData = serie.data || []; - for (var j = 0; j < serieData.length; j ++) { - polarIndex = this.deepQuery( - [serieData[j], serie, this.option], 'polarIndex' - ) || 0; - if (polarIndex == index - && (!legend || legend.isSelected(serieData[j].name)) - ) { - data.push(serieData[j]); - } - } - } - return data; - }, - - /** - * 查找指标合适的值 - * - * 如果只有一组数据以数据中的最大值作为最大值 0为最小值 - * 如果是多组,使用同一维度的进行比较 选出最大值最小值 - * 对它们进行处理 - * @param {Object} serie 的 data - * @param {number} 指标的序号 - * @param {boolean} boundaryGap 两端留白 - * @param {number} precision 小数精度 - * @param {number} power 整数精度 - * @return {Object} 指标的最大值最小值 - */ - _findValue : function ( - data, index, splitNumber, boundaryGap, precision, power, scale - ) { - var max; - var min; - var value; - var delta; - var str; - var len = 0; - var max0; - var min0; - var one; - - if (!data || data.length === 0) { - return; - } - - function _compare(item) { - (item > max || max === undefined) && (max = item); - (item < min || min === undefined) && (min = item); - } - - if (data.length == 1) { - min = 0; - } - if (data.length != 1) { - for (var i = 0; i < data.length; i ++) { - value = typeof data[i].value[index].value != 'undefined' - ? data[i].value[index].value : data[i].value[index]; - _compare(value); - } - } - else { - one = data[0]; - for (var i = 0; i < one.value.length; i ++) { - _compare( - typeof one.value[i].value != 'undefined' - ? one.value[i].value : one.value[i] - ); - } - } - - if (data.length != 1) { - if (scale) { - delta = this._getDelta( - max, min, splitNumber, precision, power - ); - - if (delta >= 1) { - min = Math.floor(min / delta) * delta - delta; - } - else if (delta === 0) { - if (max > 0) { - min0 = 0; - max0 = 2 * max; - } - else if (max === 0) { - min0 = 0; - max0 = 100; - } - else { - max0 = 0; - min0 = 2 * min; - } - - return { - max : max0, - min : min0 - }; - } - else { - str = (delta + '').split('.')[1]; - len = str.length; - min = Math.floor( - min * Math.pow(10, len)) / Math.pow(10, len - ) - delta; - } - - if (Math.abs(min) <= delta) { - min = 0; - } - - max = min + Math.floor(delta * Math.pow(10, len) - * (splitNumber + 1)) / Math.pow(10, len) ; - } - else { - min = min > 0 ? 0 : min; - } - } - - if (boundaryGap) { - max = max > 0 ? max * 1.2 : max * 0.8; - min = min > 0 ? min * 0.8 : min * 1.2; - } - - return { - max : max, - min : min - }; - }, - - /** - * 获取最大值与最小值中间比较合适的差值 - * @param {number} max; - * @param {number} min - * @param {number} precision 小数精度 - * @param {number} power 整数精度 - * @return {number} delta - */ - _getDelta : function (max , min, splitNumber, precision, power) { - var delta = (max - min) / splitNumber; - var str; - var n; - - if (delta > 1) { - if (!power) { - str = (delta + '').split('.')[0]; - n = str.length; - if (str.charAt(0) >= 5) { - return Math.pow(10, n); - } - else { - return (str.charAt(0) - 0 + 1 ) * Math.pow(10, n - 1); - } - } - else { - delta = Math.ceil(delta); - if (delta % power > 0) { - return (Math.ceil(delta / power) + 1) * power; - } - else { - return delta; - } - } - } - else if (delta == 1) { - return 1; - } - else if (delta === 0) { - return 0; - } - else { - if (!precision) { - str = (delta + '').split('.')[1]; - n = 0; - while (str[n] == '0') { - n ++ ; - } - - if (str[n] >= 5) { - return '0.' + str.substring(0, n + 1) - 0 - + 1 / Math.pow(10, n); - } - else { - return '0.' + str.substring(0, n + 1) - 0 - + 1 / Math.pow(10, n + 1); - } - } - else { - return Math.ceil(delta * Math.pow(10, precision)) - / Math.pow(10, precision); - } - } - }, - - /** - * 获取每个指标上某个value对应的坐标 - * @param {number} polarIndex - * @param {number} indicatorIndex - * @param {number} value - * @return {Array} 对应坐标 - */ - getVector : function (polarIndex, indicatorIndex, value) { - polarIndex = polarIndex || 0; - indicatorIndex = indicatorIndex || 0; - var __ecIndicator = this.polar[polarIndex].__ecIndicator; - - if (indicatorIndex >= __ecIndicator.length) { - return ; - } - - var indicator = this.polar[polarIndex].__ecIndicator[indicatorIndex]; - var center = this.getCenter(polarIndex); - var vector = indicator.vector; - var max = indicator.value.max; - var min = indicator.value.min; - var alpha; - - if (typeof value == 'undefined') { - return center; - } - - switch (value) { - case 'min' : - value = min; - break; - case 'max' : - value = max; - break; - case 'center' : - value = (max + min) / 2; - break; - } - - if (max != min) { - alpha = (value - min) / (max - min); - } - else { - alpha = 0.5; - } - - return this._mapVector(vector, center, alpha); - }, - - /** - * 判断一个点是否在网内 - * @param {Array} 坐标 - * @return {number} 返回polarindex 返回-1表示不在任何polar - */ - isInside : function (vector) { - var polar = this.getNearestIndex(vector); - - if (polar) { - return polar.polarIndex; - } - return -1; - }, - - /** - * 如果一个点在网内,返回离它最近的数据轴的index - * @param {Array} 坐标 - * @return {Object} | false - * polarIndex - * valueIndex - */ - getNearestIndex : function (vector) { - var item; - var center; - var radius; - var polarVector; - var startAngle; - var indicator; - var len; - var angle; - var finalAngle; - for (var i = 0 ; i < this.polar.length; i ++) { - item = this.polar[i]; - center = this.getCenter(i); - if (vector[0] == center[0] && vector[1] == center[1]) { - return { - polarIndex : i, - valueIndex : 0 - }; - } - radius = this._getRadius(); - startAngle = item.startAngle; - indicator = item.indicator; - len = indicator.length; - angle = 2 * Math.PI / len; - // 注意y轴的翻转 - polarVector = ecCoordinates.cartesian2polar( - vector[0] - center[0], center[1] - vector[1] - ); - if (vector[0] - center[0] < 0) { - polarVector[1] += Math.PI; - } - if (polarVector[1] < 0) { - polarVector[1] += 2 * Math.PI; - } - - - // 减去startAngle的偏移量 再加2PI变成正数 - finalAngle = polarVector[1] - - startAngle / 180 * Math.PI + Math.PI * 2; - - if (Math.abs(Math.cos(finalAngle % (angle / 2))) * radius - > polarVector[0]) - { - return { - polarIndex : i, - valueIndex : Math.floor( - (finalAngle + angle / 2 ) / angle - ) % len - }; - } - } - }, - - /** - * 获取指标信息 - * @param {number} polarIndex - * @return {Array} indicator - */ - getIndicator : function (index) { - var index = index || 0; - return this.polar[index].indicator; - }, - - /** - * 刷新 - */ - refresh : function (newOption) { - if (newOption) { - this.option = newOption; - this.polar = this.option.polar; - this.series = this.option.series; - } - this.clear(); - this._buildShape(); - } - }; - - zrUtil.inherits(Polar, Base); - - require('../component').define('polar', Polar); - - return Polar; -}); -/** - * echarts图表类:雷达图 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Neil (杨骥, yangji01@baidu.com) - * - */ - - define('echarts/chart/radar',['require','../component/base','./base','zrender/shape/Polygon','../component/polar','../config','../util/ecData','zrender/tool/util','zrender/tool/color','../util/accMath','../chart'],function (require) { - var ComponentBase = require('../component/base'); - var ChartBase = require('./base'); - - // 图形依赖 - var PolygonShape = require('zrender/shape/Polygon'); - // 组件依赖 - require('../component/polar'); - - var ecConfig = require('../config'); - var ecData = require('../util/ecData'); - var zrUtil = require('zrender/tool/util'); - var zrColor = require('zrender/tool/color'); - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} series 数据 - * @param {Object} component 组件 - */ - function Radar(ecTheme, messageCenter, zr, option, myChart) { - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); - // 图表基类 - ChartBase.call(this); - - this.refresh(option); - } - - Radar.prototype = { - type : ecConfig.CHART_TYPE_RADAR, - /** - * 绘制图形 - */ - _buildShape : function () { - this.selectedMap = {}; - this._symbol = this.option.symbolList; - this._queryTarget; - this._dropBoxList = []; - this._radarDataCounter = 0; - - var series = this.series; - var legend = this.component.legend; - var serieName; - for (var i = 0, l = series.length; i < l ; i ++) { - if (series[i].type == ecConfig.CHART_TYPE_RADAR) { - this.serie = this.reformOption(series[i]); - serieName = this.serie.name || ''; - // 系列图例开关 - this.selectedMap[serieName] = - legend ? legend.isSelected(serieName) : true; - - if (this.selectedMap[serieName]) { - this._queryTarget = [this.serie, this.option]; - - // 添加可拖拽提示框,多系列共用一个极坐标,第一个优先 - if (this.deepQuery(this._queryTarget, 'calculable')) { - this._addDropBox(i); - } - this._buildSingleRadar(i); - this.buildMark(i); - } - } - } - - this.addShapeList(); - }, - - /** - * 构建数据图形 - * @param {number} 序列的index - */ - _buildSingleRadar : function (index) { - var legend = this.component.legend; - var iconShape; - var data = this.serie.data; - var defaultColor; - var name; - var pointList; - var calculable = this.deepQuery(this._queryTarget, 'calculable'); - - for (var i = 0; i < data.length; i ++) { - name = data[i].name || ''; - - // 图例开关 - this.selectedMap[name] = legend - ? legend.isSelected(name) - : true; - if (!this.selectedMap[name]) { - continue; - } - - // 默认颜色策略 - if (legend) { - // 有图例则从图例中获取颜色定义 - defaultColor = legend.getColor(name); - iconShape = legend.getItemShape(name); - if (iconShape) { - // 回调legend,换一个更形象的icon - iconShape.style.brushType = this.deepQuery( - [data[i], this.serie], 'itemStyle.normal.areaStyle' - ) ? 'both' : 'stroke'; - legend.setItemShape(name, iconShape); - } - } - else { - // 全局颜色定义 - defaultColor = this.zr.getColor(i); - } - - pointList = this._getPointList(this.serie.polarIndex, data[i]); - // 添加拐点形状 - this._addSymbol(pointList, defaultColor, i, index, this.serie.polarIndex); - // 添加数据形状 - this._addDataShape( - pointList, defaultColor, data[i], - index, i, calculable - ); - this._radarDataCounter++; - } - }, - - /** - * 获取数据的点集 - * @param {number} polarIndex - * @param {Array} 处理的数据 - * @return {Array>} 点集 - */ - _getPointList : function (polarIndex, dataArr) { - var pointList = []; - var vector; - var polar = this.component.polar; - - for (var i = 0, l = dataArr.value.length; i < l; i++) { - vector = polar.getVector( - polarIndex, - i, - typeof dataArr.value[i].value != 'undefined' - ? dataArr.value[i].value : dataArr.value[i] - ); - if (vector) { - pointList.push(vector); - } - } - return pointList; - }, - - /** - * 添加拐点 - * @param {Array>} pointList 点集 - * @param {string} defaultColor 默认填充颜色 - * @param {object} data 数据 - * @param {number} serieIndex - */ - _addSymbol : function (pointList, defaultColor, dataIndex, seriesIndex, polarIndex) { - var series = this.series; - var itemShape; - var polar = this.component.polar; - - for (var i = 0, l = pointList.length; i < l; i++) { - itemShape = this.getSymbolShape( - this.deepMerge( - [series[seriesIndex].data[dataIndex], series[seriesIndex]] - ), - seriesIndex, - series[seriesIndex].data[dataIndex].value[i], i, - polar.getIndicatorText(polarIndex, i), - pointList[i][0], // x - pointList[i][1], // y - this._symbol[this._radarDataCounter % this._symbol.length], - defaultColor, - '#fff', - 'vertical' - ); - itemShape.zlevel = this._zlevelBase + 1; - ecData.set(itemShape, 'data', series[seriesIndex].data[dataIndex]); - ecData.set(itemShape, 'value', series[seriesIndex].data[dataIndex].value); - ecData.set(itemShape, 'dataIndex', dataIndex); - ecData.set(itemShape, 'special', i); - this.shapeList.push(itemShape); - } - }, - - /** - * 添加数据图形 - * @param {Array>} pointList 点集 - * @param {string} defaultColor 默认填充颜色 - * @param {object} data 数据 - * @param {number} serieIndex - * @param {number} dataIndex - * @param {boolean} calcalable - */ - _addDataShape : function ( - pointList, defaultColor, data, - seriesIndex, dataIndex, calculable - ) { - var series = this.series; - // 多级控制 - var queryTarget = [data, this.serie]; - var nColor = this.getItemStyleColor( - this.deepQuery( - queryTarget, 'itemStyle.normal.color' - ), - seriesIndex, - dataIndex, - data - ); - var nLineWidth = this.deepQuery( - queryTarget, 'itemStyle.normal.lineStyle.width' - ); - var nLineType = this.deepQuery( - queryTarget, 'itemStyle.normal.lineStyle.type' - ); - var nAreaColor = this.deepQuery( - queryTarget, 'itemStyle.normal.areaStyle.color' - ); - var nIsAreaFill = this.deepQuery( - queryTarget, 'itemStyle.normal.areaStyle' - ); - var shape = { - zlevel : this._zlevelBase, - style : { - pointList : pointList, - brushType : nIsAreaFill ? 'both' : 'stroke', - color : nAreaColor - || nColor - || zrColor.alpha(defaultColor,0.5), - strokeColor : nColor || defaultColor, - lineWidth : nLineWidth, - lineType : nLineType - }, - highlightStyle : { - brushType : this.deepQuery( - queryTarget, - 'itemStyle.emphasis.areaStyle' - ) || nIsAreaFill - ? 'both' : 'stroke', - color : this.deepQuery( - queryTarget, - 'itemStyle.emphasis.areaStyle.color' - ) - || nAreaColor - || nColor - || zrColor.alpha(defaultColor,0.5), - strokeColor : this.getItemStyleColor( - this.deepQuery( - queryTarget, 'itemStyle.emphasis.color' - ), - seriesIndex, - dataIndex, - data - ) - || nColor || defaultColor, - lineWidth : this.deepQuery( - queryTarget, - 'itemStyle.emphasis.lineStyle.width' - ) || nLineWidth, - lineType : this.deepQuery( - queryTarget, - 'itemStyle.emphasis.lineStyle.type' - ) || nLineType - } - }; - ecData.pack( - shape, - series[seriesIndex], // 系列 - seriesIndex, // 系列索引 - data, // 数据 - dataIndex, // 数据索引 - data.name, // 数据名称 - // 附加指标信息 - this.component.polar.getIndicator(series[seriesIndex].polarIndex) - ); - if (calculable) { - shape.draggable = true; - this.setCalculable(shape); - } - - shape = new PolygonShape(shape); - this.shapeList.push(shape); - }, - - /** - * 增加外围接受框 - * @param {number} serie的序列 - */ - _addDropBox : function (index) { - var series = this.series; - var polarIndex = this.deepQuery( - this._queryTarget, 'polarIndex' - ); - if (!this._dropBoxList[polarIndex]) { - var shape = this.component.polar.getDropBox(polarIndex); - shape.zlevel = this._zlevelBase; - this.setCalculable(shape); - ecData.pack(shape, series, index, undefined, -1); - this.shapeList.push(shape); - this._dropBoxList[polarIndex] = true; - } - }, - - /** - * 数据项被拖拽出去,重载基类方法 - */ - ondragend : function (param, status) { - var series = this.series; - if (!this.isDragend || !param.target) { - // 没有在当前实例上发生拖拽行为则直接返回 - return; - } - - var target = param.target; // 被拖拽图形元素 - - var seriesIndex = ecData.get(target, 'seriesIndex'); - var dataIndex = ecData.get(target, 'dataIndex'); - - // 被拖拽的图形是饼图sector,删除被拖拽走的数据 - this.component.legend && this.component.legend.del( - series[seriesIndex].data[dataIndex].name - ); - - series[seriesIndex].data.splice(dataIndex, 1); - - // 别status = {}赋值啊!! - status.dragOut = true; - status.needRefresh = true; - - // 处理完拖拽事件后复位 - this.isDragend = false; - - return; - }, - - /** - * 数据项被拖拽进来, 重载基类方法 - */ - ondrop : function (param, status) { - var series = this.series; - if (!this.isDrop || !param.target) { - // 没有在当前实例上发生拖拽行为则直接返回 - return; - } - - var target = param.target; // 拖拽安放目标 - var dragged = param.dragged; // 当前被拖拽的图形对象 - - var seriesIndex = ecData.get(target, 'seriesIndex'); - var dataIndex = ecData.get(target, 'dataIndex'); - - var data; - var legend = this.component.legend; - var value; - - if (dataIndex == -1) { - data = { - value : ecData.get(dragged, 'value'), - name : ecData.get(dragged, 'name') - }; - - series[seriesIndex].data.push(data); - - legend && legend.add( - data.name, - dragged.style.color || dragged.style.strokeColor - ); - } - else { - // 数据被拖拽到某个数据项上,数据修改 - var accMath = require('../util/accMath'); - data = series[seriesIndex].data[dataIndex]; - legend && legend.del(data.name); - data.name += this.option.nameConnector - + ecData.get(dragged, 'name'); - value = ecData.get(dragged, 'value'); - for (var i = 0 ; i < value.length; i ++) { - data.value[i] = accMath.accAdd(data.value[i], value[i]); - } - - legend && legend.add( - data.name, - dragged.style.color || dragged.style.strokeColor - ); - } - - // 别status = {}赋值啊!! - status.dragIn = status.dragIn || true; - - // 处理完拖拽事件后复位 - this.isDrop = false; - - return; - }, - - /** - * 刷新 - */ - refresh : function (newOption) { - if (newOption) { - this.option = newOption; - this.series = newOption.series; - } - - this.backupShapeList(); - this._buildShape(); - } - }; - - zrUtil.inherits(Radar, ChartBase); - zrUtil.inherits(Radar, ComponentBase); - - // 图表注册 - require('../chart').define('radar', Radar); - - return Radar; -}); -/** - * zrender - * - * @author pissang (https://github.com/pissang) - * - * shape类:chord - * 可配图形属性: - { - // 基础属性 - shape : 'chord', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - center : {array}, - source0 : {number}, - source1 : {number}, - target0 : {number}, - target1 : {number}, - r : {number}, - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - */ -define('echarts/util/shape/Chord',['require','zrender/shape/Base','zrender/tool/util'],function (require) { - var Base = require('zrender/shape/Base'); - var zrUtil = require('zrender/tool/util'); - var _ctx = zrUtil.getContext(); - - function ChordShape(options) { - Base.call(this, options); - } - - ChordShape.prototype = { - type : 'chord', - - // center, source0, source1, target0, target1, r - buildPath : function (ctx, style) { - var PI2 = Math.PI * 2; - var cx = style.center[0]; - var cy = style.center[1]; - var r = style.r; - var s0 = style.source0 / 180 * Math.PI; - var s1 = style.source1 / 180 * Math.PI; - var t0 = style.target0 / 180 * Math.PI; - var t1 = style.target1 / 180 * Math.PI; - var sx0 = cx + Math.cos(PI2 - s0) * r; - var sy0 = cy - Math.sin(PI2 - s0) * r; - var sx1 = cx + Math.cos(PI2 - s1) * r; - var sy1 = cy - Math.sin(PI2 - s1) * r; - var tx0 = cx + Math.cos(PI2 - t0) * r; - var ty0 = cy - Math.sin(PI2 - t0) * r; - var tx1 = cx + Math.cos(PI2 - t1) * r; - var ty1 = cy - Math.sin(PI2 - t1) * r; - - ctx.moveTo(sx0, sy0); - ctx.arc(cx, cy, style.r, s0, s1, false); - ctx.bezierCurveTo( - (cx - sx1) * 0.70 + sx1, - (cy - sy1) * 0.70 + sy1, - (cx - tx0) * 0.70 + tx0, - (cy - ty0) * 0.70 + ty0, - tx0, ty0 - ); - // Chord to self - if (style.source0 === style.target0 && - style.source1 === style.target1) { - return; - } - ctx.arc(cx, cy, style.r, t0, t1, false); - ctx.bezierCurveTo( - (cx - tx1) * 0.70 + tx1, - (cy - ty1) * 0.70 + ty1, - (cx - sx0) * 0.70 + sx0, - (cy - sy0) * 0.70 + sy0, - sx0, sy0 - ); - }, - - getRect : function (){ - return { - x : 0, - y : 0, - width : 0, - height : 0 - }; - }, - - isCover : function (x, y) { - if (!_ctx.isPointInPath) { // In ie - return false; - } - var originPos = this.getTansform(x, y); - x = originPos[0]; - y = originPos[1]; - - _ctx.beginPath(); - ChordShape.prototype.buildPath.call(null, _ctx, this.style); - _ctx.closePath(); - - return _ctx.isPointInPath(x, y); - } - }; - - zrUtil.inherits(ChordShape, Base); - - return ChordShape; -}); -define('echarts/util/kwargs',[],function (){ - function kwargs(func, defaults) { - /*jshint maxlen : 200*/ - var removeComments = new RegExp('(\\/\\*[\\w\\\'\\,\\(\\)\\s\\r\\n\\*]*\\*\\/)|(\\/\\/[\\w\\s\\\'][^\\n\\r]*$)|(\\/]*>)', 'gim'); - var removeWhitespc = new RegExp('\\s+', 'gim'); - var matchSignature = new RegExp('function.*?\\((.*?)\\)', 'i'); - // get the argument names from function source - var names = func.toString() - .replace(removeComments, '') - .replace(removeWhitespc, '') - .match(matchSignature)[1] - .split(','); - - // Check the existance of default, if not create an object - if(defaults !== Object(defaults)){ - defaults = {}; - } - - return function () { - var args = Array.prototype.slice.call(arguments); - var kwargs = args[args.length - 1]; - - // Check the existance of the kwargs - if (kwargs && kwargs.constructor === Object) { - args.pop(); - } - else{ - kwargs = {}; - } - - // Fill the arguments and apply them - for (var i = 0; i < names.length; i++) { - var name = names[i]; - if (name in kwargs) { - args[i] = kwargs[name]; - } - else if(name in defaults && args[i] == null){ - args[i] = defaults[name]; - } - } - - return func.apply(this, args); - }; - } - // As function prototype - // Function.prototype.kwargs = kwargs; - return kwargs; -}); -/** - * Numpy like n-dimensional array proccessing class - * http://docs.scipy.org/doc/numpy/reference/arrays.ndarray.html - * - * @author pissang (https://github.com/pissang/) - */ -define('echarts/util/ndarray',['require','./kwargs'],function (require) { - - - -var kwargs = require('./kwargs'); - -var ArraySlice = Array.prototype.slice; - -// Polyfill of Typed Array -this.Int32Array = window.Int32Array || Array; -this.Int16Array = window.Int16Array || Array; -this.Int8Array = window.Int8Array || Array; -this.Uint32Array = window.Uint32Array || Array; -this.Uint16Array = window.Uint16Array || Array; -this.Uint8Array = window.Uint8Array || Array; -this.Float32Array = window.Float32Array || Array; -this.Float64Array = window.Float64Array || Array; - -// Map of numpy dtype and typed array -// http://docs.scipy.org/doc/numpy/reference/arrays.dtypes.html#arrays-dtypes -// http://www.khronos.org/registry/typedarray/specs/latest/ -var ArrayConstructor = { - 'int32' : this.Int32Array, - 'int16' : this.Int16Array, - 'int8' : this.Int8Array, - 'uint32' : this.Uint32Array, - 'uint16' : this.Uint16Array, - 'uint8' : this.Uint8Array, - // 'uint8c' is not existed in numpy - 'uint8c' : this.Uint8ClampedArray, - 'float32' : this.Float32Array, - 'float64' : this.Float64Array, - 'number' : Array -}; - -var dTypeStrideMap = { - 'int32' : 4, - 'int16' : 2, - 'int8' : 1, - 'uint32' : 4, - 'uint16' : 2, - 'uint8' : 1, - 'uint8c' : 1, - 'float32' : 4, - 'float64' : 8, - // Consider array stride is 1 - 'number' : 1 -}; - -var E_ADD = 0; -var E_SUB = 1; -var E_MUL = 2; -var E_DIV = 3; -var E_MOD = 4; -var E_AND = 5; -var E_OR = 6; -var E_XOR = 7; -var E_EQL = 8; - -function guessDataType(arr) { - if (typeof(arr) === 'undefined') { - return 'number'; - } - switch(Object.prototype.toString.call(arr)) { - case '[object Int32Array]': - return 'int32'; - case '[object Int16Array]': - return 'int16'; - case '[object Int8Array]': - return 'int8'; - case '[object Uint32Array]': - return 'uint32'; - case '[object Uint16Array]': - return 'uint16'; - case '[object Uint8Array]': - return 'uint8'; - case '[object Uint8ClampedArray]': - return 'uint8c'; - case '[object Float32Array]': - return 'float32'; - case '[object Float64Array]': - return 'float64'; - default: - return 'number'; - } -} - -/** - * NDArray - * @param {Array|NDArray} array - * @param {String} dtype - */ -var NDArray = function (array) { - // Last argument describe the data type of ndarray - var dtype = arguments[arguments.length-1]; - if (typeof(dtype) == 'string') { - this._dtype = dtype; - } else { - // Normal array - this._dtype = guessDataType(array); - } - - if (array && typeof(array) !== 'string') { - if (array instanceof NDArray) { - array._dtype = this._dtype; - return array; - } else if (typeof(array.length) !== 'undefined') { - // Init from array - this.initFromArray(array); - } else if(typeof(array) === 'number') { - // Init from shape - this.initFromShape.apply(this, arguments); - } - } else { - /** - * _array - * Initialized with an empty array - * Data is continuous one-dimensional array, row-major - * A [2, 2] dim empty array is stored like - * [0,0, 0,0] - * TODO : Consider column majors ? - * @type {ArrayConstructor} - */ - this._array = new ArrayConstructor[this._dtype](); - /** - * _shape - * a tuple array describe the dimension and size of each dimension - * [10, 10] means a 10x10 array - * @type {Array} - */ - this._shape = [0]; - /** - * _size - * size of the storage array length - * @type {Number} - */ - this._size = 0; - } -}; - -NDArray.prototype = { - /** - * Initialize from a normal js array. - * - * @param {Array} input - * @return {NDArray} this - */ - initFromArray : function (input) { - var dim = getDimension(input); - var cursor = 0; - function flatten(axis, _out, _in) { - var len = _in.length; - for (var i = 0; i < len; i++) { - if (axis < dim-1) { - flatten(axis+1, _out, _in[i]); - } else { - _out[cursor++] = _in[i]; - } - } - } - var shape = getShape(input); - var size = getSize(shape); - this._array = new ArrayConstructor[this._dtype](size); - - flatten(0, this._array, input); - this._shape = shape; - this._size = size; - - return this; - }, - - /** - * Initialize from the given shape description. - * @param {Array} shape - * @return {NDArray} this - */ - initFromShape : function (shape) { - if (typeof(shape) == 'number') { - shape = Array.prototype.slice.call(arguments); - } - if(shape) { - var size = getSize(shape); - if (this._dtype === 'number') { - this._array = []; - var data = this._array; - for (var i = 0; i < size; i++) { - data[i] = 0; - } - } else { - this._array = new ArrayConstructor[this._dtype](size); - } - } - this._shape = shape; - this._size = getSize(shape); - - return this; - }, - /** - * Fill the array with the given value. - * @param {Number} value - * @return {NDArray} this - */ - fill : function (value) { - var data = this._array; - for (var i = 0; i < data.length; i++) { - data[i] = value; - } - return this; - }, - - /** - * Get ndarray shape copy. - * @return {Array} - */ - shape : function () { - // Create a copy - return this._shape.slice(); - }, - - /** - * Get array size - * @return {Number} - */ - size : function () { - return this._size; - }, - - /** - * Get array data type. - * 'int32' - * 'int16' - * 'int8' - * 'uint32' - * 'uint16' - * 'uint8' - * 'float32' - * 'float64' - * @return {String} - */ - dtype : function () { - return this._dtype; - }, - - /** - * Get array dimension. - * @return {[type]} [description] - */ - dimension : function () { - return this._shape.length; - }, - - /** - * Tuple of bytes to step in each dimension when traversing an array. - * @return {Array} - */ - strides : function () { - var strides = calculateDimStrides(this._shape); - var dTypeStride = dTypeStrideMap[this._dtype]; - for (var i = 0; i < strides.length; i++) { - strides[i] *= dTypeStride; - } - return strides; - }, - /** - * Gives a new shape to an array without changing its data. - * @param {Array} shape - * @return {NDArray} - */ - reshape : function (shape) { - if (typeof(shape) == 'number') { - shape = Array.prototype.slice.call(arguments); - } - if (this._isShapeValid(shape)) { - this._shape = shape; - } else { - throw new Error('Total size of new array must be unchanged'); - } - return this; - }, - - _isShapeValid : function (shape) { - return getSize(shape) === this._size; - }, - - /** - * Change shape and size of array in-place. - * @param {Array} shape - * @return {NDArray} - */ - resize : function (shape) { - if (typeof(shape) == 'number') { - shape = Array.prototype.slice.call(arguments); - } - - var len = getSize(shape); - if (len < this._size) { - if (this._dtype === 'number') { - this._array.length = len; - } - } else { - if (this._dtype === 'number') { - for (var i = this._array.length; i < len; i++) { - // Fill the rest with zero - this._array[i] = 0; - } - } else { - // Reallocate new buffer - var newArr = new ArrayConstructor[this._dtype](len); - var originArr = this._array; - - // Copy data - for (var i = 0; i < originArr.length; i++) { - newArr[i] = originArr[i]; - } - this._array = newArr; - } - } - this._shape = shape; - this._size = len; - - return this; - - }, - - /** - * Returns a new array with axes transposed. - * @param {Array} [axes] - * @param {NDArray} [out] - * @return {NDArray} - */ - transpose : kwargs(function (axes, out) { - var originAxes = []; - for (var i = 0; i < this._shape.length; i++) { - originAxes.push(i); - } - if (typeof(axes) === 'undefined') { - axes = originAxes.slice(); - } - // Check if any axis is out of bounds - for (var i = 0; i < axes.length; i++) { - if (axes[i] >= this._shape.length) { - throw new Error(axisOutofBoundsErrorMsg(axes[i])); - } - } - // Has no effect on 1-D transpose - if (axes.length <= 1) { - return this; - } - - var targetAxes = originAxes.slice(); - for (var i = 0; i < Math.floor(axes.length / 2); i++) { - for (var j = axes.length-1; j >= Math.ceil(axes.length / 2) ; j--) { - // Swap axes - targetAxes[axes[i]] = axes[j]; - targetAxes[axes[j]] = axes[i]; - } - } - - return this._transposelike(targetAxes, out); - - }), - - /** - * Return a new array with axis1 and axis2 interchanged. - * @param {Number} axis1 - * @param {Number} axis2 - * @param {NDArray} out - * @return {NDArray} - */ - swapaxes : kwargs(function (axis1, axis2, out) { - return this.transpose([axis1, axis2], out); - }), - - /** - * Roll the specified axis backwards, until it lies in a given position. - * @param {Number} axis - * @param {Number} [start=0] - * @param {NDArray} out - * @return {NDArray} - */ - rollaxis : kwargs(function (axis, start, out) { - if (axis >= this._shape.length) { - throw new Error(axisOutofBoundsErrorMsg(axis)); - } - - var axes = []; - for (var i = 0; i < this._shape.length; i++) { - axes.push(i); - } - axes.splice(axis, 1); - axes.splice(start, 0, axis); - - return this._transposelike(axes, out); - - }, { start : 0}), - - // Base function for transpose-like operations - _transposelike : function (axes, out) { - var source = this._array; - var shape = this._shape.slice(); - var strides = calculateDimStrides(this._shape); - var dim = shape.length; - - // Swap - var tmpStrides = []; - var tmpShape = []; - for (var i = 0; i < axes.length; i++) { - var axis = axes[i]; - // swap to target axis - tmpShape[i] = shape[axis]; - tmpStrides[i] = strides[axis]; - } - strides = tmpStrides; - shape = tmpShape; - - this._shape = shape; - var transposedStrides = calculateDimStrides(this._shape); - - if (!out) { - out = new NDArray(); - out._shape = this._shape.slice(); - out._dtype = this._dtype; - out._size = this._size; - } - // FIXME in-place transpose? - var transposedData = new ArrayConstructor[this._dtype](this._size); - out._array = transposedData; - // @param Item offset in current axis offset of the original array - // @param Item offset in current axis offset of the transposed array - function transpose(axis, offset, transposedOffset) { - var size = shape[axis]; - // strides in orginal array - var stride = strides[axis]; - // strides in transposed array - var transposedStride = transposedStrides[axis]; - - if (axis < dim-1) { - for (var i = 0; i < size; i++) { - transpose( - axis+1, - offset + stride * i, - transposedOffset + transposedStride * i - ); - } - } else { - for (var i = 0; i < size; i++) { - // offset + stride * i is the index of the original array - // transposedOffset + i is the index of the transposed array - transposedData[transposedOffset + i] - = source[offset + stride * i]; - } - } - } - - transpose(0, 0, 0); - - return out; - }, - - /** - * Repeat elements of an array along axis - * @param {Number} repeats - * The number of repetitions for each element. - * repeats is broadcasted to fit the shape of the given axis. - * @param {Number} [axis] - * The axis along which to repeat values. - * By default, use the flattened input array, - * and return a flat output array. - * @param {NDArray} [out] - * @return {NDArray} - */ - repeat : kwargs(function (repeats, axis, out) { - var shape; - // flattened input array - if (typeof(axis) === 'undefined') { - shape = [this._size]; - axis = 0; - } else { - shape = this._shape.slice(); - } - var originShape = shape.slice(); - - shape[axis] *= repeats; - if (!out) { - out = new NDArray(this._dtype); - out.initFromShape(shape); - } else { - if (!arrayEqual(shape, out._shape)) { - throw new Error(broadcastErrorMsg(shape, out._shape)); - } - } - var data = out._array; - - var stride = calculateDimStride(originShape, axis); - var axisSize = originShape[axis]; - var source = this._array; - - var offsetStride = stride * axisSize; - - for (var offset = 0; offset < this._size; offset+=offsetStride) { - for (var k = 0; k < stride; k++) { - var idx = offset + k; - var idxRepeated = offset * repeats + k; - for (var i = 0; i < axisSize; i++) { - for (var j = 0; j < repeats; j++) { - data[idxRepeated] = source[idx]; - idxRepeated += stride; - } - idx += stride; - } - } - } - - return out; - }), - - choose : function () { - console.warn('TODO'); - }, - - take : function () { - console.warn('TODO'); - }, - - tile : function () { - console.warn('TODO'); - }, - - /** - * Preprocess for array calculation - * max, min, argmax, argmin, sum, ptp, val, mean - * Which will reduce one axis if the axis is given - * - * @param {Number} axis - * @param {NDArray} out - * @param {Function} funcWithAxis - * @param {Function} funcFlatten - * @return {Number|NDArray} - */ - _withPreprocess1 : function (axis, out, funcWithAxis, funcFlatten) { - var source = this._array; - if (!this._size) { - return; - } - - if (typeof(axis)!=='undefined') { - if (axis < 0) { - axis = this._shape.length + axis; - } - if (axis >= this._shape.length || axis < 0) { - throw new Error(axisOutofBoundsErrorMsg(axis)); - } - - var shape = this._shape.slice(); - shape.splice(axis, 1); - if (out && !arrayEqual(shape, out._shape)) { - throw new Error(broadcastErrorMsg(shape, out._shape)); - } - - if (!out) { - out = new NDArray(this._dtype); - out.initFromShape(shape); - } - var data = out._array; - - var stride = calculateDimStride(this._shape, axis); - var axisSize = this._shape[axis]; - var offsetStride = stride * axisSize; - - funcWithAxis.call( - this, data, source, offsetStride, axisSize, stride - ); - - return out; - } else { - return funcFlatten.call(this, source); - } - }, - - /** - * Preprocess for array calculation cumsum, cumprod - * Which will keep the shape if axis is given - * and flatten if axis is undefined - * @param {Number} axis - * @param {NDArray} out - * @param {Function} funcWithAxis - * @param {Function} funcFlatten - * @return {NDArray} - */ - _withPreprocess2 : function (axis, out, funcWithAxis, funcFlatten) { - var source = this._array; - if (!this._size) { - return; - } - if (out && !arrayEqual(this._shape, out._shape)) { - throw new Error(broadcastErrorMsg(this._shape, out._shape)); - } - if (!out) { - out = new NDArray(this._dtype); - out.initFromShape(this._shape); - } - - var data = out._array; - - if (typeof(axis)!=='undefined') { - if (axis < 0) { - axis = this._shape.length + axis; - } - if (axis >= this._shape.length || axis < 0) { - throw new Error(axisOutofBoundsErrorMsg(axis)); - } - - if (axis >= this._shape.length) { - throw new Error(axisOutofBoundsErrorMsg(axis)); - } - - var stride = calculateDimStride(this._shape, axis); - var axisSize = this._shape[axis]; - var offsetStride = stride * axisSize; - - funcWithAxis.call( - this, data, source, offsetStride, axisSize, stride - ); - } else { - out.reshape([this._size]); - funcFlatten.call(this, data, source); - } - - return out; - }, - - /** - * Get the max value of ndarray - * If the axis is given, the max is only calculate in this dimension - * Example, for the given ndarray - * [[3, 9], - * [4, 8]] - * >>> max(0) - * [4, 9] - * >>> max(1) - * [9, 8] - * - * @param {Number} [axis] - * @param {NDArray} out - * @return {NDArray} - */ - max : kwargs((function () { - function withAxis(data, source, offsetStride, axisSize, stride) { - var cursor = 0; - for (var offset = 0; offset < this._size; offset+=offsetStride) { - for (var i = 0; i < stride; i++) { - var idx = i + offset; - var max = source[idx]; - for (var j = 0; j < axisSize; j++) { - var d = source[idx]; - if (d > max) { - max = d; - } - idx += stride; - } - data[cursor++] = max; - } - } - } - function withFlatten(source) { - var max = source[0]; - for (var i = 1; i < this._size; i++) { - if (source[i] > max) { - max = source[i]; - } - } - return max; - } - return function (axis, out) { - return this._withPreprocess1( - axis, out, - withAxis, withFlatten - ); - }; - })()), - - - /** - * Return the minimum of an array or minimum along an axis. - * @param {Number} [axis] - * @param {NDArray} out - * @return {NDArray} - */ - min : kwargs((function () { - function withAxis(data, source, offsetStride, axisSize, stride) { - var cursor = 0; - for (var offset = 0; offset < this._size; offset+=offsetStride) { - for (var i = 0; i < stride; i++) { - var idx = i + offset; - var min = source[idx]; - for (var j = 0; j < axisSize; j++) { - var d = source[idx]; - if (d < min) { - min = d; - } - idx += stride; - } - data[cursor++] = min; - } - } - } - function withFlatten(source) { - var min = source[0]; - for (var i = 1; i < this._size; i++) { - if (source[i] < min) { - min = source[i]; - } - } - return min; - } - return function (axis, out) { - return this._withPreprocess1( - axis, out, - withAxis, withFlatten - ); - }; - })()), - - /** - * Return indices of the maximum values along an axis. - * @param {Number} [axis] - * @param {NDArray} out - * @return {NDArray} - */ - argmax : kwargs((function () { - function withAxis(data, source, offsetStride, axisSize, stride) { - var cursor = 0; - for (var offset = 0; offset < this._size; offset+=offsetStride) { - for (var i = 0; i < stride; i++) { - var dataIdx = 0; - var idx = i + offset; - var max = source[idx]; - for (var j = 0; j < axisSize; j++) { - var d = source[idx]; - if (d > max) { - max = d; - dataIdx = j; - } - idx += stride; - } - data[cursor++] = dataIdx; - } - } - } - function withFlatten(source) { - var max = source[0]; - var idx = 0; - for (var i = 1; i < this._size; i++) { - if (source[i] > max) { - idx = i; - max = source[i]; - } - } - return idx; - } - return function (axis, out) { - return this._withPreprocess1( - axis, out, - withAxis, withFlatten - ); - }; - })()), - - /** - * Indices of the minimum values along an axis. - * @param {Number} [axis] - * @param {NDArray} out - * @return {NDArray} - */ - argmin : kwargs((function () { - function withAxis(data, source, offsetStride, axisSize, stride) { - var cursor = 0; - for (var offset = 0; offset < this._size; offset+=offsetStride) { - for (var i = 0; i < stride; i++) { - var dataIdx = 0; - var idx = i + offset; - var min = source[idx]; - for (var j = 0; j < axisSize; j++) { - var d = source[idx]; - if (d < min) { - min = d; - dataIdx = j; - } - idx += stride; - } - data[cursor++] = dataIdx; - } - } - } - function withFlatten(source) { - var min = source[0]; - var idx = 0; - for (var i = 1; i < this._size; i++) { - if (source[i] < min) { - idx = i; - min = source[i]; - } - } - return idx; - } - return function (axis, out) { - return this._withPreprocess1( - axis, out, - withAxis, withFlatten - ); - }; - })()), - - /** - * Return the sum of the array elements over the given axis. - * @param {Number} [axis] - * @param {NDArray} out - * @return {NDArray} - */ - sum : kwargs((function () { - function withAxis(data, source, offsetStride, axisSize, stride) { - var cursor = 0; - for (var offset = 0; offset < this._size; offset+=offsetStride) { - for (var i = 0; i < stride; i++) { - var sum = 0; - var idx = i + offset; - for (var j = 0; j < axisSize; j++) { - sum += source[idx]; - idx += stride; - } - data[cursor++] = sum; - } - } - } - function withFlatten(source) { - var sum = 0; - for (var i = 0; i < this._size; i++) { - sum += source[i]; - } - return sum; - } - return function (axis, out) { - return this._withPreprocess1( - axis, out, - withAxis, withFlatten - ); - }; - })()), - - /** - * Return the product of the array elements over the given axis. - * @param {Number} [axis] - * @param {NDArray} out - * @return {NDArray} - */ - prod : kwargs((function () { - function withAxis(data, source, offsetStride, axisSize, stride) { - var cursor = 0; - for (var offset = 0; offset < this._size; offset+=offsetStride) { - for (var i = 0; i < stride; i++) { - var prod = 1; - var idx = i + offset; - for (var j = 0; j < axisSize; j++) { - prod *= source[idx]; - idx += stride; - } - data[cursor++] = prod; - } - } - } - function withFlatten(source) { - var prod = 1; - for (var i = 0; i < this._size; i++) { - prod *= source[i]; - } - return prod; - } - return function (axis, out) { - return this._withPreprocess1( - axis, out, - withAxis, withFlatten - ); - }; - })()), - - /** - * Returns the average of the array elements along given axis. - * @param {Number} [axis] - * @param {NDArray} out - * @return {NDArray} - */ - mean : kwargs((function () { - function withAxis(data, source, offsetStride, axisSize, stride) { - var cursor = 0; - for (var offset = 0; offset < this._size; offset+=offsetStride) { - for (var i = 0; i < stride; i++) { - var sum = 0; - var idx = i + offset; - for (var j = 0; j < axisSize; j++) { - sum += source[idx]; - idx += stride; - } - var mean = sum / axisSize; - data[cursor++] = mean; - } - } - } - function withFlatten(source) { - var sum = 0; - var len = source.length; - for (var i = 0; i < len; i++) { - sum += source[i]; - } - var mean = sum / len; - return mean; - } - return function (axis, out) { - return this._withPreprocess1( - axis, out, - withAxis, withFlatten - ); - }; - })()), - - /** - * Return the variance of the array elements over the given axis. - * @param {Number} [axis] - * @param {NDArray} out - * @return {NDArray} - */ - 'var' : kwargs((function () { - function withAxis(data, source, offsetStride, axisSize, stride) { - var cursor = 0; - for (var offset = 0; offset < this._size; offset+=offsetStride) { - for (var i = 0; i < stride; i++) { - var sum = 0; - var idx = i + offset; - for (var j = 0; j < axisSize; j++) { - sum += source[idx]; - idx += stride; - } - var mean = sum / axisSize; - var moments = 0; - idx = i + offset; - for (var j = 0; j < axisSize; j++) { - var diff = source[idx] - mean; - moments += diff * diff; - idx += stride; - } - data[cursor++] = moments / axisSize; - } - } - } - function withFlatten(source) { - var sum = 0; - var len = source.length; - for (var i = 0; i < len; i++) { - sum += source[i]; - } - var mean = sum / len; - var moments = 0; - for (var i = 0; i < len; i++) { - var diff = source[i] - mean; - moments += diff * diff; - } - return moments / len; - } - return function (axis, out) { - return this._withPreprocess1( - axis, out, - withAxis, withFlatten - ); - }; - })()), - - /** - * Return the standard derivatione of the array elements - * over the given axis. - * @param {Number} [axis] - * @param {NDArray} out - * @return {NDArray} - */ - std : kwargs((function () { - function withAxis(data, source, offsetStride, axisSize, stride) { - var cursor = 0; - for (var offset = 0; offset < this._size; offset+=offsetStride) { - for (var i = 0; i < stride; i++) { - var sum = 0; - var idx = i + offset; - for (var j = 0; j < axisSize; j++) { - sum += source[idx]; - idx += stride; - } - var mean = sum / axisSize; - var moments = 0; - idx = i + offset; - for (var j = 0; j < axisSize; j++) { - var diff = source[idx] - mean; - moments += diff * diff; - idx += stride; - } - data[cursor++] = Math.sqrt(moments / axisSize); - } - } - } - function withFlatten(source) { - var sum = 0; - var len = source.length; - for (var i = 0; i < len; i++) { - sum += source[i]; - } - var mean = sum / len; - var moments = 0; - for (var i = 0; i < len; i++) { - var diff = source[i] - mean; - moments += diff * diff; - } - return Math.sqrt(moments / len); - } - return function (axis, out) { - return this._withPreprocess1( - axis, out, - withAxis, withFlatten - ); - }; - })()), - - /** - * Peak to peak (maximum - minimum) value along a given axis. - * @param {Number} [axis] - * @param {NDArray} out - * @return {NDArray} - */ - ptp : kwargs((function () { - function withAxis(data, source, offsetStride, axisSize, stride) { - var cursor = 0; - for (var offset = 0; offset < this._size; offset+=offsetStride) { - for (var i = 0; i < stride; i++) { - var idx = offset + i; - var min = source[idx]; - var max = source[idx]; - for (var j = 0; j < axisSize; j++) { - var d = source[idx]; - if (d < min) { - min = d; - } - if (d > max) { - max = d; - } - idx += stride; - } - data[cursor++] = max - min; - } - } - } - function withFlatten(source) { - var min = source[0]; - var max = source[0]; - for (var i = 1; i < this._size; i++) { - if (source[i] < min) { - min = source[i]; - } - if (source[i] > max) { - max = source[i]; - } - } - return max - min; - } - return function (axis, out) { - return this._withPreprocess1( - axis, out, - withAxis, withFlatten - ); - }; - })()), - - /** - * - * @param {Number} [axis=-1] - * @param {string} [order='ascending'] - * 'ascending' | 'descending' - * @return {NDArray} - */ - // FIXME : V8 is quick sort, firefox and safari is merge sort - // order : ascending or desc - sort : kwargs(function (axis, order) { - if (axis < 0) { - axis = this._shape.length + axis; - } - var compareFunc; - if (order === 'ascending') { - compareFunc = function (a, b) { - return a - b; - }; - } else if( order === 'descending') { - compareFunc = function (a, b) { - return b - a; - }; - } - - var source = this._array; - var stride = calculateDimStride(this._shape, axis); - var axisSize = this._shape[axis]; - - var offsetStride = stride * axisSize; - - var tmp = new Array(axisSize); - - for (var offset = 0; offset < this._size; offset+=offsetStride) { - - for (var i = 0; i < stride; i++) { - var idx = offset + i; - for (var j = 0; j < axisSize; j++) { - tmp[j] = source[idx]; - idx += stride; - } - tmp.sort(compareFunc); - var idx = offset + i; - // Copy back - for (var j = 0; j < axisSize; j++) { - source[idx] = tmp[j]; - idx += stride; - } - } - } - - return this; - - }, {axis : -1, order : 'ascending'}), - - /** - * - * @param {Number} [axis=-1] - * @param {string} [order='ascending'] - * 'ascending' | 'descending' - * @param {NDArray} [out] - * @return {NDArray} - */ - argsort : kwargs(function (axis, order, out) { - if (axis < 0) { - axis = this._shape.length + axis; - } - if (!this._size) { - return; - } - if (out && !arrayEqual(this._shape, out._shape)) { - throw new Error(broadcastErrorMsg(this._shape, out._shape)); - } - if (!out) { - out = new NDArray(this._dtype); - out.initFromShape(this._shape); - } - var data = out._array; - - var compareFunc; - if (order === 'ascending') { - compareFunc = function (a, b) { - return tmp[a] - tmp[b]; - }; - } else if( order === 'descending') { - compareFunc = function (a, b) { - return tmp[b] - tmp[a]; - }; - } - - var source = this._array; - var stride = calculateDimStride(this._shape, axis); - var axisSize = this._shape[axis]; - var offsetStride = stride * axisSize; - - var tmp = new Array(axisSize); - var indexList = new Array(axisSize); - - for (var offset = 0; offset < this._size; offset+=offsetStride) { - for (var i = 0; i < stride; i++) { - var idx = offset + i; - for (var j = 0; j < axisSize; j++) { - tmp[j] = source[idx]; - indexList[j] = j; - idx += stride; - } - indexList.sort(compareFunc); - // Copy back - var idx = offset + i; - for (var j = 0; j < axisSize; j++) { - data[idx] = indexList[j]; - idx += stride; - } - } - } - - return out; - - }, {axis : -1, order : 'ascending'}), - - /** - * Return the cumulative sum of the elements along the given axis. - * @param {Number} [axis] - * @param {NDArray} out - * @return {NDArray} - */ - cumsum : kwargs((function () { - function withAxis(data, source, offsetStride, axisSize, stride) { - for (var offset = 0; offset < this._size; offset+=offsetStride) { - for (var i = 0; i < stride; i++) { - var idx = offset + i; - var prevIdx = idx; - data[idx] = source[idx]; - for (var j = 1; j < axisSize; j++) { - prevIdx = idx; - idx += stride; - data[idx] = data[prevIdx] + source[idx]; - } - - } - } - } - function withFlatten(data, source) { - data[0] = source[0]; - for (var i = 1; i < data.length; i++) { - data[i] = data[i-1] + source[i]; - } - } - return function (axis, out) { - return this._withPreprocess2( - axis, out, - withAxis, withFlatten - ); - }; - })()), - - /** - * Return the cumulative product of the elements along the given axis. - * @param {Number} [axis] - * @param {NDArray} out - * @return {NDArray} - */ - cumprod : kwargs((function () { - function withAxis(data, source, offsetStride, axisSize, stride) { - for (var offset = 0; offset < this._size; offset+=offsetStride) { - for (var i = 0; i < stride; i++) { - var idx = offset + i; - var prevIdx = idx; - data[idx] = source[idx]; - for (var j = 1; j < axisSize; j++) { - prevIdx = idx; - idx += stride; - data[idx] = data[prevIdx] * source[idx]; - } - - } - } - } - function withFlatten(data, source) { - data[0] = source[0]; - for (var i = 1; i < data.length; i++) { - data[i] = data[i-1] * source[i]; - } - } - return function (axis, out) { - return this._withPreprocess2( - axis, out, - withAxis, withFlatten - ); - }; - })()), - - /** - * Dot product of two arrays. - * - * @param {NDArray|Number} b - * @param {NDArray} [out] - * @return {NDArray|Number} - */ - dot : function () { - console.warn('TODO'); - }, - - /** - * Mapped to region [min, max] - * @param {Number} mappedMin - * @param {Number} mappedMax - */ - map : function (mappedMin, mappedMax) { - var input = this._array; - var output = this._array; - - var min = input[0]; - var max = input[0]; - var l = this._size; - for (var i = 1; i < l; i++) { - var val = input[i]; - if (val < min) { - min = val; - } - if (val > max) { - max = val; - } - } - var range = max - min; - var mappedRange = mappedMax - mappedMin; - for (var i = 0; i < l; i++) { - if (range === 0) { - output[i] = mappedMin; - } else { - var val = input[i]; - var percent = (val - min) / range; - output[i] = mappedRange * percent + mappedMin; - } - } - return this; - }, - - /** - * Add - */ - add : function (rightOperand, out) { - return this.binaryOperation( - this, rightOperand, E_ADD, out - ); - }, - - /** - * Substract - */ - sub : function (rightOperand, out) { - return this.binaryOperation( - this, rightOperand, E_SUB, out - ); - }, - - /** - * Multiply - */ - mul : function (rightOperand, out) { - return this.binaryOperation( - this, rightOperand, E_MUL, out - ); - }, - - /** - * Divide - */ - div : function (rightOperand, out) { - return this.binaryOperation( - this, rightOperand, E_DIV, out - ); - }, - /** - * mod - */ - mod : function (rightOperand, out) { - return this.binaryOperation( - this, rightOperand, E_MOD, out - ); - }, - /** - * and - */ - and : function (rightOperand, out) { - return this.binaryOperation( - this, rightOperand, E_AND, out - ); - }, - /** - * or - */ - or : function (rightOperand, out) { - return this.binaryOperation( - this, rightOperand, E_OR, out - ); - }, - /** - * xor - */ - xor : function (rightOperand, out) { - return this.binaryOperation( - this, rightOperand, E_XOR, out - ); - }, - /** - * equal - */ - equal : function (rightOperand, out) { - return this.binaryOperation( - this, rightOperand, E_EQL, out - ); - }, - - binaryOperation : function (lo, ro, op, out) { - // Broadcasting - // http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html - var shape = []; - var isLoScalar = typeof(lo) === 'number'; - var isRoScalar = typeof(ro) === 'number'; - if (isLoScalar) { - shape = ro._shape.slice(); - } else if (isRoScalar) { - shape = lo._shape.slice(); - } else { - // Starts with the trailing dimensions - var cl = lo._shape.length-1; - var cr = ro._shape.length-1; - var loBroadCasted = lo; - var roBroadCasted = ro; - while (cl >= 0 && cr >= 0) { - if (lo._shape[cl] == 1) { - shape.unshift(ro._shape[cr]); - loBroadCasted = lo.repeat(ro._shape[cr], cl); - } else if(ro._shape[cr] == 1) { - shape.unshift(lo._shape[cl]); - roBroadCasted = ro.repeat(lo._shape[cl], cr); - } else if(ro._shape[cr] == lo._shape[cl]) { - shape.unshift(lo._shape[cl]); - } else { - throw new Error(broadcastErrorMsg(lo._shape, ro._shape)); - } - cl --; - cr --; - } - for (var i = cl; i >= 0; i--) { - shape.unshift(lo._shape[i]); - } - for (var i = cr; i >= 0; i--) { - shape.unshift(ro._shape[i]); - } - lo = loBroadCasted; - ro = roBroadCasted; - } - if (!out) { - out = new NDArray(this._dtype); - out.initFromShape(shape); - } else { - if (! arrayEqual(shape, out._shape)) { - throw new Error(broadcastErrorMsg(shape, out._shape)); - } - } - var outData = out._array; - - var diffAxis; - var isLoLarger; - var loData; - var roData; - if (isLoScalar) { - diffAxis = ro._shape.length-1; - isLoLarger = false; - loData = lo; - roData = ro._array; - } else if(isRoScalar) { - diffAxis = lo._shape.length-1; - isLoLarger = true; - roData = ro; - loData = lo._array; - } else { - diffAxis = Math.abs(lo._shape.length - ro._shape.length); - isLoLarger = lo._shape.length >= ro._shape.length; - loData = lo._array; - roData = ro._array; - } - var stride = calculateDimStride(shape, diffAxis); - var axisSize = shape[diffAxis]; - - var offsetStride = stride * axisSize; - var offsetRepeats = out._size / offsetStride; - - var _a, _b, res; - var idx = 0; - if (isLoLarger) { - if(isRoScalar) { - for (var c = 0; c < offsetRepeats; c++) { - for (var i = 0; i < offsetStride; i++) { - _a = loData[idx]; _b = roData; - switch (op) { - case E_ADD: res = _a + _b; break; - case E_SUB: res = _a - _b; break; - case E_MUL: res = _a * _b; break; - case E_DIV: res = _a / _b; break; - case E_MOD: res = _a % _b; break; - case E_AND: res = _a & _b; break; - case E_OR: res = _a | _b; break; - case E_XOR: res = _a ^ _b; break; - case E_EQL: res = _a == _b; break; - default: throw new Error('Unkown operation ' + op); - } - outData[idx] = res; - idx ++; - } - } - } else { - for (var c = 0; c < offsetRepeats; c++) { - for (var i = 0; i < offsetStride; i++) { - _a = loData[idx]; _b = roData[i]; - switch (op) { - case E_ADD: res = _a + _b; break; - case E_SUB: res = _a - _b; break; - case E_MUL: res = _a * _b; break; - case E_DIV: res = _a / _b; break; - case E_MOD: res = _a % _b; break; - case E_AND: res = _a & _b; break; - case E_OR: res = _a | _b; break; - case E_XOR: res = _a ^ _b; break; - case E_EQL: res = _a == _b; break; - default: throw new Error('Unkown operation ' + op); - } - outData[idx] = res; - idx ++; - } - } - } - } else { - if (isLoScalar) { - for (var c = 0; c < offsetRepeats; c++) { - for (var i = 0; i < offsetStride; i++) { - _a = loData; _b = roData[idx]; - switch (op) { - case E_ADD: res = _a + _b; break; - case E_SUB: res = _a - _b; break; - case E_MUL: res = _a * _b; break; - case E_DIV: res = _a / _b; break; - case E_MOD: res = _a % _b; break; - case E_AND: res = _a & _b; break; - case E_OR: res = _a | _b; break; - case E_XOR: res = _a ^ _b; break; - case E_EQL: res = _a == _b; break; - default: throw new Error('Unkown operation ' + op); - } - outData[idx] = res; - idx ++; - } - } - } else { - for (var c = 0; c < offsetRepeats; c++) { - for (var i = 0; i < offsetStride; i++) { - _a = loData[idx]; _b = roData[i]; - switch (op) { - case E_ADD: res = _a + _b; break; - case E_SUB: res = _a - _b; break; - case E_MUL: res = _a * _b; break; - case E_DIV: res = _a / _b; break; - case E_MOD: res = _a % _b; break; - case E_AND: res = _a & _b; break; - case E_OR: res = _a | _b; break; - case E_XOR: res = _a ^ _b; break; - case E_EQL: res = _a == _b; break; - default: throw new Error('Unkown operation ' + op); - } - outData[idx] = res; - idx ++; - } - } - } - } - return out; - }, - - /** - * negtive - */ - neg : function () { - var data = this._array; - for (var i = 0; i < this._size; i++) { - data[i] = -data[i]; - } - return this; - }, - - /** - * @return {NDArray} this - */ - sin : function () { - return this._mathAdapter(Math.sin); - }, - - /** - * @return {NDArray} this - */ - cos : function () { - return this._mathAdapter(Math.cos); - }, - - /** - * @return {NDArray} this - */ - tan : function () { - return this._mathAdapter(Math.tan); - }, - - /** - * @return {NDArray} this - */ - abs : function () { - return this._mathAdapter(Math.abs); - }, - - /** - * @return {NDArray} this - */ - log : function () { - return this._mathAdapter(Math.log); - }, - - /** - * @return {NDArray} this - */ - sqrt : function () { - return this._mathAdapter(Math.sqrt); - }, - - /** - * @return {NDArray} this - */ - ceil : function () { - return this._mathAdapter(Math.ceil); - }, - - /** - * @return {NDArray} this - */ - floor : function () { - return this._mathAdapter(Math.floor); - }, - - /** - * @return {NDArray} this - */ - pow : function (exp) { - var data = this._array; - for (var i = 0; i < this._size; i++) { - data[i] = Math.pow(data[i], exp); - } - return this; - }, - - _mathAdapter : function (mathFunc) { - var data = this._array; - for (var i = 0; i < this._size; i++) { - data[i] = mathFunc(data[i]); - } - return this; - }, - - /** - * @param {Number} decimals - * @return {NDArray} this - */ - round : function (decimals) { - decimals = Math.floor(decimals || 0); - var offset = Math.pow(10, decimals); - var data = this._array; - if (decimals === 0) { - for (var i = 0; i < this._size; i++) { - data[i] = Math.round(data[i]); - } - } else { - for (var i = 0; i < this._size; i++) { - data[i] = Math.round(data[i] * offset) / offset; - } - } - return this; - }, - /** - * @param {Number} min - * @param {Number} max - * Clip to [min, max] - */ - clip : function (min, max) { - // TODO : Support array_like param - var data = this._array; - for (var i = 0; i < this._size; i++) { - data[i] = Math.max(Math.min(data[i], max), min); - } - return this; - }, - - /** - * Indexing array, support range indexing - * @param {string} index - * Index syntax can be an integer 1, 2, 3 - * Or more complex range indexing - * '1:2' - * '1:2, 1:2' - * '1:2, :' - * More about the indexing syntax can check the doc of numpy ndarray - * @param {NDArray} [out] - * @return {NDArray} New created sub array, or out if given - */ - get : function (index, out) { - if (typeof(index) == 'number') { - index = index.toString(); - } - var strides = calculateDimStrides(this._shape); - var res = this._parseRanges(index); - var ranges = res[0]; - var shape = res[1]; - - if (ranges.length > this._shape.length) { - throw new Error('Too many indices'); - } - // Get data - var len = ranges.length; - var data; - if (shape.length) { - out = new NDArray(this._dtype); - out.initFromShape(shape); - data = out._array; - } else { - data = []; - } - - var source = this._array; - var cursor = 0; - function getPiece(axis, offset) { - var range = ranges[axis]; - var stride = strides[axis]; - if (axis < len-1) { - if (range[2] > 0) { - for (var i = range[0]; i < range[1]; i += range[2]) { - getPiece(axis+1, offset + stride * i); - } - } else { - for (var i = range[0]; i > range[1]; i += range[2]) { - getPiece(axis+1, offset + stride * i); - } - } - } else { - if (range[2] > 0) { - for (var i = range[0]; i < range[1]; i += range[2]) { - for (var j = 0; j < stride; j++) { - data[cursor++] = source[i*stride + j + offset]; - } - } - } else { - for (var i = range[0]; i > range[1]; i += range[2]) { - for (var j = 0; j < stride; j++) { - data[cursor++] = source[i*stride + j + offset]; - } - } - } - } - } - - getPiece(0, 0); - - if (shape.length) { - // Return scalar - return out; - } else { - return data[0]; - } - - }, - - /** - * - * @param {string} index - * index syntax can be an integer 1, 2, 3 - * Or more complex range indexing - * '1:2' - * '1:2, 1:2' - * '1:2, :' - * More about the indexing syntax can check the doc of numpy ndarray - * @param {NDArray} ndarray Ndarray data source - * @return {NDArray} this - */ - set : function (index, narray) { - if (typeof(index) == 'number') { - index = index.toString(); - } - var strides = calculateDimStrides(this._shape); - var res = this._parseRanges(index); - var ranges = res[0]; - var shape = res[1]; - - if (ranges.length > this._shape.length) { - throw new Error('Too many indices'); - } - var isScalar = typeof(narray) == 'number'; - var len = ranges.length; - var data = this._array; - if (isScalar) { - // Set with a single scalar - var source = narray; - } else { - if (!arrayEqual(shape, narray.shape())) { - throw new Error(broadcastErrorMsg(shape, narray.shape())); - } - var source = narray._array; - } - var cursor = 0; - var setPiece = function (axis, offset) { - var range = ranges[axis]; - var stride = strides[axis]; - if (axis < len-1) { - if (range[2] > 0) { - for (var i = range[0]; i < range[1]; i += range[2]) { - setPiece(axis+1, offset + stride * i); - } - } else { - for (var i = range[0]; i > range[1]; i += range[2]) { - setPiece(axis+1, offset + stride * i); - } - } - } else { - if (range[2] > 0) { - for (var i = range[0]; i < range[1]; i += range[2]) { - for (var j = 0; j < stride; j++) { - if (isScalar) { - data[i*stride + j + offset] = source; - } else { - data[i*stride + j + offset] = source[cursor++]; - } - } - } - } else { - for (var i = range[0]; i > range[1]; i += range[2]) { - for (var j = 0; j < stride; j++) { - if (isScalar) { - data[i*stride + j + offset] = source; - } else { - data[i*stride + j + offset] = source[cursor++]; - } - } - } - } - } - }; - - setPiece(0, 0); - - return this; - }, - - /** - * Insert values along the given axis before the given indices. - * @param {Number|Array} obj - * Object that defines the index or indices before - * which values is inserted. - * @param {Number|Array|NDArray} values - * Values to insert - * @param {Number} [axis] - * @return {NDArray} this - */ - insert : kwargs(function (obj, values, axis) { - var data = this._array; - var isObjScalar = false; - if (typeof(obj) === 'number') { - obj = [obj]; - isObjScalar = true; - } - if (typeof(values) === 'number') { - values = new NDArray([values]); - } else if (values instanceof Array) { - values = new NDArray(values); - } - - if (typeof(axis) === 'undefined') { - this._shape = [this._size]; - axis = 0; - } - // Checking if indices is valid - var prev = obj[0]; - var axisSize = this._shape[axis]; - for (var i = 0; i < obj.length; i++) { - if (obj[i] < 0) { - obj[i] = axisSize + obj[i]; - } - if (obj[i] > axisSize) { - throw new Error(indexOutofBoundsErrorMsg(obj[i])); - } - if (obj[i] < prev) { - throw new Error('Index must be in ascending order'); - } - prev = obj[i]; - } - // Broadcasting - var targetShape = this._shape.slice(); - if (isObjScalar) { - targetShape.splice(axis, 1); - } else { - targetShape[axis] = obj.length; - } - - var sourceShape = values._shape; - var cs = sourceShape.length - 1; - var ct = targetShape.length - 1; - - var valueBroadcasted = values; - while (cs >= 0 && ct >= 0) { - if (sourceShape[cs] === 1) { - valueBroadcasted = values.repeat(targetShape[ct], cs); - } else if(sourceShape[cs] !== targetShape[ct]) { - throw new Error(broadcastErrorMsg(sourceShape, targetShape)); - } - cs --; - ct --; - } - values = valueBroadcasted; - - // Calculate indices to insert - var stride = calculateDimStride(this._shape, axis); - var axisSize = this._shape[axis]; - var offsetStride = axisSize * stride; - var offsetRepeats = this._size / offsetStride; - - var objLen = obj.length; - var indices = new Uint32Array(offsetRepeats * objLen); - - var cursor = 0; - for (var offset = 0; offset < this._size; offset += offsetStride) { - for (var i = 0; i < objLen; i++) { - var objIdx = obj[i]; - indices[cursor++] = offset + objIdx * stride; - } - } - - var resShape = this._shape.slice(); - resShape[axis] += obj.length; - var resSize = getSize(resShape); - if (this._array.length < resSize) { - var data = new ArrayConstructor[this._dtype](resSize); - } else { - var data = this._array; - } - var source = this._array; - var valuesArr = values._array; - - var idxCursor = indices.length - 1; - var end = this._size; - var start = indices[idxCursor]; - var dataCursor = resSize - 1; - var valueCursor = values._size - 1; - while (idxCursor >= 0) { - // Copy source data; - for (var i = end - 1; i >= start; i--) { - data[dataCursor--] = source[i]; - } - end = start; - start = indices[--idxCursor]; - // Copy inserted data; - for (var i = 0; i < stride; i++) { - if (valueCursor < 0) { - valueCursor = values._size - 1; - } - data[dataCursor--] = valuesArr[valueCursor--]; - } - } - // Copy the rest - for (var i = end - 1; i >= 0; i--) { - data[dataCursor--] = source[i]; - } - - this._array = data; - this._shape = resShape; - this._size = resSize; - - return this; - }), - - append : function () { - console.warn('TODO'); - }, - - /** - * Delete values along the axis - * @param {Array|Number} obj - * @param {Number} [axis] - * @return {NDArray} this - */ - 'delete' : kwargs(function (obj, axis) { - var data = this._array; - if (typeof(obj) === 'number') { - obj = [obj]; - } - var size = this._size; - - if (typeof(axis) === 'undefined') { - this._shape = [size]; - axis = 0; - } - - var stride = calculateDimStride(this._shape, axis); - var axisSize = this._shape[axis]; - - var offsetStride = stride * axisSize; - var cursor = 0; - for (var offset = 0; offset < size; offset += offsetStride) { - var start = 0; - var end = obj[0]; - var objCursor = 0; - while(objCursor < obj.length) { - if (end < 0) { - end = end + axisSize; - } - if (end > axisSize) { - throw new Error(indexOutofBoundsErrorMsg(end)); - } - if (end < start) { - throw new Error('Index must be in ascending order'); - } - for (var i = start; i < end; i++) { - for (var j = 0; j < stride; j++) { - data[cursor++] = data[i * stride + j + offset]; - } - } - start = end + 1; - end = obj[++objCursor]; - } - // Copy the rest - for (var i = start; i < axisSize; i++) { - for (var j = 0; j < stride; j++) { - data[cursor++] = data[i * stride + j + offset]; - } - } - } - this._shape[axis] -= obj.length; - this._size = getSize(this._shape); - - return this; - }), - - _parseRanges : function (index) { - var rangesStr = index.split(/\s*,\s*/); - - // Parse range of each axis - var ranges = []; - var shape = []; - var j = 0; - for (var i = 0; i < rangesStr.length; i++) { - if (rangesStr[i] === '...') { - var end = this._shape.length - (rangesStr.length - i); - while (j <= end) { - ranges.push([0, this._shape[j], 1]); - shape.push(this._shape[j]); - j++; - } - } else { - var range = parseRange(rangesStr[i], this._shape[j]); - ranges.push(range); - if(rangesStr[i].indexOf(':') >= 0) { - var size = Math.floor((range[1] - range[0]) / range[2]); - size = size < 0 ? 0 : size; - // Get a range not a item - shape.push(size); - } - j++; - } - } - // Copy the lower dimension size - for (; j < this._shape.length; j++) { - shape.push(this._shape[j]); - } - - return [ranges, shape]; - }, - - /** - * Export normal js array - * @return {Array} - */ - toArray : function () { - var data = this._array; - var cursor = 0; - - var shape = this._shape; - var dim = shape.length; - - function create(axis, out) { - var len = shape[axis]; - for (var i = 0; i < len; i++) { - if (axis < dim-1) { - create(axis+1, out[i] = []); - } else { - out[i] = data[cursor++]; - } - } - } - - var output = []; - create(0, output); - - return output; - }, - - /** - * Create a copy of self - * @return {NDArray} - */ - copy : function () { - var numArr = new NDArray(); - numArr._array = ArraySlice.call(this._array); - numArr._shape = this._shape.slice(); - numArr._dtype = this._dtype; - numArr._size = this._size; - - return numArr; - }, - - constructor : NDArray -}; - -/** - * - * @param {Number} [min=0] - * @param {Number} max - * @param {Number} [step=1] - * @param {string} [dtype] - * @return {NDArray} - */ -NDArray.range = kwargs(function (min, max, step, dtype) { - var args = ArraySlice.call(arguments); - // Last argument describe the data type of ndarray - var lastArg = args[args.length-1]; - if (typeof(lastArg) == 'string') { - var dtype = lastArg; - args.pop(); - } - if (args.length === 1) { - max = args[0]; - step = 1; - min = 0; - } else if(args.length == 2) { - step = 1; - } - dtype = dtype || 'number'; - - var array = new ArrayConstructor[dtype](Math.ceil((max - min)/step)); - var cursor = 0; - for (var i = min; i < max; i+=step) { - array[cursor++] = i; - } - var ndarray = new NDArray(); - ndarray._array = array; - ndarray._shape = [array.length]; - ndarray._dtype = dtype; - ndarray._size = array.length; - - return ndarray; - -}); - -/** - * - * @param {Array} shape - * @param {String} [dtype] - * @return {NDArray} - */ -NDArray.zeros = kwargs(function (shape, dtype) { - var ret = new NDArray(dtype); - ret.initFromShape(shape); - return ret; -}); - -/** - * Python like array indexing - * http://www.python.org/dev/peps/pep-0204/ - * - * @param {string} index - * index can be a simple integer 1,2,3, - * or a range 2:10, 2:10:1 - * example : - * 2:10 => [2, 10, 1], - * 10:2:-2 => [10, 2, -2], - * : => [0, dimSize, 1], - * ::-1 => [dimSize-1, -1, -1], - * @param {number} dimSize - * @return {Array} a tuple array [startOffset, endOffset, sliceStep] - */ -function parseRange(index, dimSize) { - if (index.indexOf(':') >= 0) { - // Range indexing; - var res = index.split(/\s*:\s*/); - - var step = parseInt(res[2] || 1, 10); - var start, end; - if (step === 0) { - throw new Error('Slice step cannot be zero'); - } - else if (step > 0) { - start = parseInt(res[0] || 0, 10); - end = parseInt(res[1] || dimSize, 10); - } - else { - start = parseInt(res[0] || dimSize - 1, 10); - end = parseInt(res[1] || -1, 10); - } - // Negtive offset - if (start < 0) { - start = dimSize + start; - } - // Negtive offset - if (end < 0 && res[1]) { - end = dimSize + end; - } - if (step > 0) { - // Clamp to [0-dimSize] - start = Math.max(Math.min(dimSize, start), 0); - // Clamp to [0-dimSize] - end = Math.max(Math.min(dimSize, end), 0); - } else { - // Clamp to [0-dimSize) - start = Math.max(Math.min(dimSize-1, start), -1); - // Clamp to [0-dimSize) - end = Math.max(Math.min(dimSize-1, end), -1); - } - return [start, end, step]; - } else { - var start = parseInt(index, 10); - // Negtive offset - if (start < 0) { - start = dimSize + start; - } - if (start < 0 || start > dimSize) { - throw new Error(indexOutofBoundsErrorMsg(index)); - } - // Clamp to [0-dimSize) - start = Math.max(Math.min(dimSize-1, start), 0); - return [start, start+1, 1]; - } -} - -function getSize(shape) { - var size = shape[0]; - for (var i = 1; i < shape.length; i++) { - size *= shape[i]; - } - return size; -} - -function getDimension(array) { - var dim = 1; - var el = array[0]; - while (el instanceof Array) { - el = el[0]; - dim ++; - } - return dim; -} - -function getShape(array) { - var shape = [array.length]; - var el = array[0]; - while (el instanceof Array) { - shape.push(el.length); - el = el[0]; - } - return shape; -} - -function calculateDimStride(shape, axis) { - if (axis == shape.length-1) { - return 1; - } - var stride = shape[axis+1]; - for (var i = axis+2; i < shape.length; i++) { - stride *= shape[i]; - } - return stride; -} - -function calculateDimStrides(shape) { - // Calculate stride of each axis - var strides = []; - var tmp = 1; - var len = getSize(shape); - for (var i = 0; i < shape.length; i++) { - tmp *= shape[i]; - strides.push(len / tmp); - } - - return strides; -} - -function arrayEqual(arr1, arr2) { - if (arr1.length !== arr2.length) { - return false; - } - for (var i = 0; i 0) { - sector.style.brushType = 'both'; - } - if (sector.highlightStyle.lineWidth > 0) { - sector.highlightStyle.brushType = 'both'; - } - ecData.pack( - sector, - this.chordSeries[0], - 0, - data[i], i, - group.name - ); - if (showLabel) { - var halfAngle = [_start + _end] / 2; - halfAngle %= 360; // Constrain to [0,360] - var isRightSide = halfAngle <= 90 - || halfAngle >= 270; - halfAngle = halfAngle * Math.PI / 180; - var v = [Math.cos(halfAngle), -Math.sin(halfAngle)]; - - var distance = this.showScaleText ? 35 + labelDistance : labelDistance; - var start = vec2.scale([], v, this.outerRadius + distance); - vec2.add(start, start, this.center); - - var labelShape = { - zlevel : this._zlevelBase - 1, - hoverable : false, - style : { - text : group.name, - textAlign : isRightSide ? 'left' : 'right', - color : labelColor - } - }; - if (rotateLabel) { - labelShape.rotation = isRightSide ? halfAngle : Math.PI + halfAngle; - if (isRightSide) { - labelShape.style.x = this.outerRadius + distance; - } else { - labelShape.style.x = -this.outerRadius - distance; - } - labelShape.style.y = 0; - labelShape.position = this.center; - } else { - labelShape.style.x = start[0]; - labelShape.style.y = start[1]; - } - labelShape.style.textColor = this.deepQuery( - [group, this.chordSerieSample], - 'itemStyle.normal.label.textStyle.color' - ) || '#fff'; - labelShape.style.textFont = this.getFont(this.deepQuery( - [group, this.chordSerieSample], - 'itemStyle.normal.label.textStyle' - )); - labelShape = new TextShape(labelShape); - this.shapeList.push(labelShape); - } - - sector.onmouseover = createMouseOver(i); - sector.onmouseout = createMouseOut(); - - sector = new SectorShape(sector); - this.shapeList.push(sector); - this.sectorShapes.push(sector); - } - }, - - _buildChords : function (angles, dataArr) { - var len = angles.length; - if (!len) { - return; - } - var len2 = angles[0][0].length; - - var chordLineStyle - = this.chordSerieSample.itemStyle.normal.chordStyle.lineStyle; - var chordLineStyleEmphsis - = this.chordSerieSample.itemStyle.emphasis.chordStyle.lineStyle; - - for (var i = 0; i < len; i++) { - for (var j = 0; j < len; j++) { - for (var k = 0; k < len2; k++) { - if (this.chordShapes[j][i][k]) { - continue; - } - - var angleIJ0 = angles[i][j][k][0]; - var angleJI0 = angles[j][i][k][0]; - - var angleIJ1 = angles[i][j][k][1]; - var angleJI1 = angles[j][i][k][1]; - - if (angleIJ0 - angleJI1 === 0 || - angleJI0 - angleJI1 === 0) { - this.chordShapes[i][j][k] = null; - continue; - } - - var color; - if (len2 === 1) { - if (angleIJ1 - angleIJ0 <= angleJI1 - angleJI0) { - color = this.getColor(this.groups[i].name); - } else { - color = this.getColor(this.groups[j].name); - } - } else { - color = this.getColor(this.chordSeries[k].name); - } - var s0 = !this.clockWise ? (360 - angleIJ1) : angleIJ0; - var s1 = !this.clockWise ? (360 - angleIJ0) : angleIJ1; - var t0 = !this.clockWise ? (360 - angleJI1) : angleJI0; - var t1 = !this.clockWise ? (360 - angleJI0) : angleJI1; - var chord = { - zlevel : this._zlevelBase, - style : { - center : this.center, - r : this.innerRadius, - source0 : s0 - this.startAngle, - source1 : s1 - this.startAngle, - target0 : t0 - this.startAngle, - target1 : t1 - this.startAngle, - brushType : 'both', - opacity : 0.5, - color : color, - lineWidth : chordLineStyle.width, - strokeColor : chordLineStyle.color - }, - clickable: true, - highlightStyle : { - brushType : 'both', - lineWidth : chordLineStyleEmphsis.width, - strokeColor : chordLineStyleEmphsis.color - } - }; - - ecData.pack( - chord, - this.chordSeries[k], - k, - dataArr[i][j][k], i + '-' +j, - this.groups[i].name, - this.groups[j].name, - dataArr[j][i][k] - ); - - chord = new ChordShape(chord); - this.chordShapes[i][j][k] = chord; - this.shapeList.push(chord); - } - } - } - }, - - _buildScales : function ( - values, - unitPostfix, - angles, - unitValue - ) { - for (var i = 0; i < angles.length; i++) { - var subStartAngle = angles[i][0]; - var subEndAngle = angles[i][1]; - - var scaleAngle = subStartAngle; - while (scaleAngle < subEndAngle) { - var thelta = ((this.clockWise ? (360 - scaleAngle) : scaleAngle) - + this.startAngle) / 180 * Math.PI; - var v = [ - Math.cos(thelta), - -Math.sin(thelta) - ]; - var start = vec2.scale([], v, this.outerRadius + 1); - vec2.add(start, start, this.center); - var end = vec2.scale([], v, this.outerRadius + this.scaleLineLength); - vec2.add(end, end, this.center); - var scaleShape = { - zlevel : this._zlevelBase - 1, - hoverable : false, - style : { - xStart : start[0], - yStart : start[1], - xEnd : end[0], - yEnd : end[1], - lineCap : 'round', - brushType : 'stroke', - strokeColor : '#666', - lineWidth: 1 - } - }; - - scaleShape = new LineShape(scaleShape); - this.shapeList.push(scaleShape); - - scaleAngle += this.scaleUnitAngle; - } - if (!this.showScaleText) { - continue; - } - - var scaleTextAngle = subStartAngle; - var step = unitValue * 5 * this.scaleUnitAngle; - var scaleValues = NDArray.range(0, values[i], step).toArray(); - while (scaleTextAngle < subEndAngle) { - var thelta = this.clockWise - ? (360 - scaleTextAngle) : scaleTextAngle; - thelta = (thelta + this.startAngle) % 360; - var isRightSide = thelta <= 90 - || thelta >= 270; - var textShape = { - zlevel : this._zlevelBase - 1, - hoverable : false, - style : { - x : isRightSide - ? this.outerRadius + this.scaleLineLength + 4 - : -this.outerRadius - this.scaleLineLength - 4, - y : 0, - text : Math.round(scaleValues.shift()*10)/10 - + unitPostfix, - textAlign : isRightSide ? 'left' : 'right' - }, - position : this.center.slice(), - rotation : isRightSide - ? [thelta / 180 * Math.PI, 0, 0] - : [ - (thelta + 180) / 180 * Math.PI, - 0, 0 - ] - }; - - textShape = new TextShape(textShape); - this.shapeList.push(textShape); - scaleTextAngle += this.scaleUnitAngle * 5; - } - } - }, - - normalizeValue : function (values) { - var result = []; - var max = new NDArray(values).max(); - var unitPostfix, unitScale; - if (max > 10000) { - unitPostfix = 'k'; - unitScale = 1 / 1000; - } else if (max > 10000000) { - unitPostfix = 'm'; - unitScale = 1 / 1000000; - } else if (max > 10000000000) { - unitPostfix = 'b'; - unitScale = 1 / 1000000000; - } else { - unitPostfix = ''; - unitScale = 1; - } - - for (var i = 0; i < values.length; i++) { - result[i] = values[i] * unitScale; - } - return [result, unitPostfix]; - }, - - refresh : function (newOption) { - if (newOption) { - this.option = newOption; - this.series = newOption.series; - } - - /* - this.legend; - this.getColor; - this.isSelected; - this.chordSerieSample; - */ - // Config - this.chordSeries = []; - /* - this.groups; - this.startAngle; - this.clockWise; - this.innerRadius; - this.outerRadius; - this.padding; - this.sortGroups; - this.sortSubGroups; - this.center; - this.showScale; - this.showScaleText; - this.dataMat; - */ - this.strokeFix = 0; - // Adjacency matrix - this.sectorShapes = []; - this.chordShapes = []; - - this.scaleLineLength = 4; - this.scaleUnitAngle = 4; - - this.legend = this.component.legend; - if (this.legend) { - this.getColor = function(param) { - return this.legend.getColor(param); - }; - this.isSelected = function(param) { - return this.legend.isSelected(param); - }; - } else { - var colorIndices = {}; - var colorMap = {}; - var count = 0; - this.getColor = function (key) { - if (colorMap[key]) { - return colorMap[key]; - } - if (colorIndices[key] === undefined) { - colorIndices[key] = count++; - } - // key is serie name - for (var i = 0; i < this.chordSeries.length; i++) { - if (this.chordSeries[i].name === key) { - colorMap[key] = this.query( - this.chordSeries[i], - 'itemStyle.normal.color' - ); - break; - } - } - if (!colorMap[key]) { - var len = this.groups.length; - // key is group name - for (var i = 0; i < len; i++) { - if (this.groups[i].name === key) { - colorMap[key] = this.query( - this.groups[i], - 'itemStyle.normal.color' - ); - break; - } - } - } - if (!colorMap[key]) { - colorMap[key] = this.zr.getColor(colorIndices[key]); - } - - return colorMap[key]; - }; - this.isSelected = function () { - return true; - }; - } - - this.backupShapeList(); - this._buildShape(); - }, - - reformOption : function (opt) { - var _merge = zrUtil.merge; - opt = _merge( - opt || {}, - this.ecTheme.chord - ); - opt.itemStyle.normal.label.textStyle = _merge( - opt.itemStyle.normal.label.textStyle || {}, - this.ecTheme.textStyle - ); - } - }; - - zrUtil.inherits(Chord, ChartBase); - zrUtil.inherits(Chord, ComponentBase); - - // 图表注册 - require('../chart').define('chord', Chord); - - return Chord; -}); -// 1. Graph Drawing by Force-directed Placement -// 2. http://webatlas.fr/tempshare/ForceAtlas2_Paper.pdf -define('echarts/chart/forceLayoutWorker',['require','zrender/tool/vector'],function __echartsForceLayoutWorker(require) { - - - - var vec2; - // In web worker - var inWorker = typeof(window) === 'undefined' && typeof(require) === 'undefined'; - if (inWorker) { - vec2 = { - create: function(x, y) { - var out = new Float32Array(2); - out[0] = x || 0; - out[1] = y || 0; - return out; - }, - dist: function(a, b) { - var x = b[0] - a[0]; - var y = b[1] - a[1]; - return Math.sqrt(x*x + y*y); - }, - len: function(a) { - var x = a[0]; - var y = a[1]; - return Math.sqrt(x*x + y*y); - }, - scaleAndAdd: function(out, a, b, scale) { - out[0] = a[0] + b[0] * scale; - out[1] = a[1] + b[1] * scale; - return out; - }, - scale: function(out, a, b) { - out[0] = a[0] * b; - out[1] = a[1] * b; - return out; - }, - add: function(out, a, b) { - out[0] = a[0] + b[0]; - out[1] = a[1] + b[1]; - return out; - }, - sub: function(out, a, b) { - out[0] = a[0] - b[0]; - out[1] = a[1] - b[1]; - return out; - }, - normalize: function(out, a) { - var x = a[0]; - var y = a[1]; - var len = x*x + y*y; - if (len > 0) { - //TODO: evaluate use of glm_invsqrt here? - len = 1 / Math.sqrt(len); - out[0] = a[0] * len; - out[1] = a[1] * len; - } - return out; - }, - negate: function(out, a) { - out[0] = -a[0]; - out[1] = -a[1]; - return out; - }, - copy: function(out, a) { - out[0] = a[0]; - out[1] = a[1]; - return out; - }, - set: function(out, x, y) { - out[0] = x; - out[1] = y; - return out; - } - }; - } else { - vec2 = require('zrender/tool/vector'); - } - var ArrayCtor = typeof(Float32Array) == 'undefined' ? Array : Float32Array; - - /**************************** - * Class: Region - ***************************/ - - function Region() { - - this.subRegions = []; - - this.nSubRegions = 0; - - this.node = null; - - this.mass = 0; - - this.centerOfMass = null; - - this.bbox = new ArrayCtor(4); - - this.size = 0; - } - - // Reset before update - Region.prototype.beforeUpdate = function() { - for (var i = 0; i < this.nSubRegions; i++) { - this.subRegions[i].beforeUpdate(); - } - this.mass = 0; - if (this.centerOfMass) { - this.centerOfMass[0] = 0; - this.centerOfMass[1] = 0; - } - this.nSubRegions = 0; - this.node = null; - }; - // Clear after update - Region.prototype.afterUpdate = function() { - this.subRegions.length = this.nSubRegions; - for (var i = 0; i < this.nSubRegions; i++) { - this.subRegions[i].afterUpdate(); - } - }; - - Region.prototype.addNode = function(node) { - if (this.nSubRegions === 0) { - if (this.node == null) { - this.node = node; - return; - } else { - this._addNodeToSubRegion(this.node); - this.node = null; - } - } - this._addNodeToSubRegion(node); - - this._updateCenterOfMass(node); - }; - - Region.prototype.findSubRegion = function(x, y) { - for (var i = 0; i < this.nSubRegions; i++) { - var region = this.subRegions[i]; - if (region.contain(x, y)) { - return region; - } - } - }; - - Region.prototype.contain = function(x, y) { - return this.bbox[0] <= x - && this.bbox[2] >= x - && this.bbox[1] <= y - && this.bbox[3] >= y; - }; - - Region.prototype.setBBox = function(minX, minY, maxX, maxY) { - // Min - this.bbox[0] = minX; - this.bbox[1] = minY; - // Max - this.bbox[2] = maxX; - this.bbox[3] = maxY; - - this.size = (maxX - minX + maxY - minY) / 2; - }; - - Region.prototype._newSubRegion = function() { - var subRegion = this.subRegions[this.nSubRegions]; - if (!subRegion) { - subRegion = new Region(); - this.subRegions[this.nSubRegions] = subRegion; - } - this.nSubRegions++; - return subRegion; - }; - - Region.prototype._addNodeToSubRegion = function(node) { - var subRegion = this.findSubRegion(node.position[0], node.position[1]); - var bbox = this.bbox; - if (!subRegion) { - var cx = (bbox[0] + bbox[2]) / 2; - var cy = (bbox[1] + bbox[3]) / 2; - var w = (bbox[2] - bbox[0]) / 2; - var h = (bbox[3] - bbox[1]) / 2; - - var xi = node.position[0] >= cx ? 1 : 0; - var yi = node.position[1] >= cy ? 1 : 0; - - var subRegion = this._newSubRegion(); - // Min - subRegion.setBBox( - // Min - xi * w + bbox[0], - yi * h + bbox[1], - // Max - (xi + 1) * w + bbox[0], - (yi + 1) * h + bbox[1] - ); - } - - subRegion.addNode(node); - }; - - Region.prototype._updateCenterOfMass = function(node) { - // Incrementally update - if (this.centerOfMass == null) { - this.centerOfMass = vec2.create(); - } - var x = this.centerOfMass[0] * this.mass; - var y = this.centerOfMass[1] * this.mass; - x += node.position[0] * node.mass; - y += node.position[1] * node.mass; - this.mass += node.mass; - this.centerOfMass[0] = x / this.mass; - this.centerOfMass[1] = y / this.mass; - }; - - /**************************** - * Class: Graph Node - ***************************/ - function GraphNode() { - this.position = vec2.create(); - - this.force = vec2.create(); - this.forcePrev = vec2.create(); - - this.speed = vec2.create(); - this.speedPrev = vec2.create(); - - // If repulsionByDegree is true - // mass = inDegree + outDegree + 1 - // Else - // mass is manually set - this.mass = 1; - - this.inDegree = 0; - this.outDegree = 0; - } - - /**************************** - * Class: Graph Edge - ***************************/ - function GraphEdge(source, target) { - this.source = source; - this.target = target; - - this.weight = 1; - } - - /**************************** - * Class: ForceLayout - ***************************/ - function ForceLayout() { - - this.barnesHutOptimize = false; - this.barnesHutTheta = 1.5; - - this.repulsionByDegree = false; - - this.preventOverlap = false; - this.strongGravity = true; - - this.gravity = 1.0; - this.scaling = 1.0; - - this.edgeWeightInfluence = 1.0; - - this.center = [0, 0]; - this.width = 500; - this.height = 500; - - this.maxSpeedIncrease = 1.0; - - this.nodes = []; - this.edges = []; - - this.bbox = new ArrayCtor(4); - - this._rootRegion = new Region(); - this._rootRegion.centerOfMass = vec2.create(); - - this._massArr = null; - - this._k = 0; - } - - ForceLayout.prototype.initNodes = function(positionArr, massArr, sizeArr) { - - this.temperature = 1.0; - - var nNodes = positionArr.length / 2; - this.nodes.length = 0; - var haveSize = typeof(sizeArr) !== 'undefined'; - - for (var i = 0; i < nNodes; i++) { - var node = new GraphNode(); - node.position[0] = positionArr[i * 2]; - node.position[1] = positionArr[i * 2 + 1]; - node.mass = massArr[i]; - if (haveSize) { - node.size = sizeArr[i]; - } - this.nodes.push(node); - } - - this._massArr = massArr; - if (haveSize) { - this._sizeArr = sizeArr; - } - }; - - ForceLayout.prototype.initEdges = function(edgeArr, edgeWeightArr) { - var nEdges = edgeArr.length / 2; - this.edges.length = 0; - var edgeHaveWeight = typeof(edgeWeightArr) !== 'undefined'; - - for (var i = 0; i < nEdges; i++) { - var sIdx = edgeArr[i * 2]; - var tIdx = edgeArr[i * 2 + 1]; - var sNode = this.nodes[sIdx]; - var tNode = this.nodes[tIdx]; - - if (!sNode || !tNode) { - continue; - } - sNode.outDegree++; - tNode.inDegree++; - var edge = new GraphEdge(sNode, tNode); - - if (edgeHaveWeight) { - edge.weight = edgeWeightArr[i]; - } - - this.edges.push(edge); - } - }; - - ForceLayout.prototype.update = function() { - - var nNodes = this.nodes.length; - - this.updateBBox(); - - this._k = 0.4 * this.scaling * Math.sqrt(this.width * this.height / nNodes); - - if (this.barnesHutOptimize) { - this._rootRegion.setBBox( - this.bbox[0], this.bbox[1], - this.bbox[2], this.bbox[3] - ); - this._rootRegion.beforeUpdate(); - for (var i = 0; i < nNodes; i++) { - this._rootRegion.addNode(this.nodes[i]); - } - this._rootRegion.afterUpdate(); - } else { - // Update center of mass of whole graph - var mass = 0; - var centerOfMass = this._rootRegion.centerOfMass; - vec2.set(centerOfMass, 0, 0); - for (var i = 0; i < nNodes; i++) { - var node = this.nodes[i]; - mass += node.mass; - vec2.scaleAndAdd(centerOfMass, centerOfMass, node.position, node.mass); - } - vec2.scale(centerOfMass, centerOfMass, 1 / mass); - } - - // Reset forces - for (var i = 0; i < nNodes; i++) { - var node = this.nodes[i]; - vec2.copy(node.forcePrev, node.force); - vec2.copy(node.speedPrev, node.speed); - vec2.set(node.force, 0, 0); - } - - // Compute forces - // Repulsion - for (var i = 0; i < nNodes; i++) { - var na = this.nodes[i]; - if (this.barnesHutOptimize) { - this.applyRegionToNodeRepulsion(this._rootRegion, na); - } else { - for (var j = i + 1; j < nNodes; j++) { - var nb = this.nodes[j]; - this.applyNodeToNodeRepulsion(na, nb, false); - } - } - - // Gravity - if (this.gravity > 0) { - this.applyNodeGravity(na); - } - } - - // Attraction - for (var i = 0; i < this.edges.length; i++) { - this.applyEdgeAttraction(this.edges[i]); - } - - // Apply forces - // var speed = vec2.create(); - var v = vec2.create(); - for (var i = 0; i < nNodes; i++) { - var node = this.nodes[i]; - var speed = node.speed; - - // var swing = vec2.dist(node.force, node.forcePrev); - // // var swing = 30; - // vec2.scale(node.force, node.force, 1 / (1 + Math.sqrt(swing))); - vec2.scale(node.force, node.force, 1 / 30); - - // contraint force - var df = vec2.len(node.force) + 0.1; - var scale = Math.min(df, 500.0) / df; - vec2.scale(node.force, node.force, scale); - - vec2.add(speed, speed, node.force); - - vec2.scale(speed, speed, this.temperature); - - // Prevent swinging - // Limited the increase of speed up to 100% each step - // TODO adjust by nodes number - vec2.sub(v, speed, node.speedPrev); - var swing = vec2.len(v); - if (swing > 0) { - vec2.scale(v, v, 1 / swing); - var base = vec2.len(node.speedPrev); - if (base > 0) { - swing = Math.min(swing / base, this.maxSpeedIncrease) * base; - vec2.scaleAndAdd(speed, node.speedPrev, v, swing); - } - } - - // constraint speed - var ds = vec2.len(speed); - var scale = Math.min(ds, 100.0) / (ds + 0.1); - vec2.scale(speed, speed, scale); - - vec2.add(node.position, node.position, speed); - } - }; - - ForceLayout.prototype.applyRegionToNodeRepulsion = (function() { - var v = vec2.create(); - return function applyRegionToNodeRepulsion(region, node) { - if (region.node) { // Region is a leaf - this.applyNodeToNodeRepulsion(region.node, node, true); - } else { - vec2.sub(v, node.position, region.centerOfMass); - var d2 = v[0] * v[0] + v[1] * v[1]; - if (d2 > this.barnesHutTheta * region.size * region.size) { - var factor = this._k * this._k * (node.mass + region.mass) / (d2 + 1); - vec2.scaleAndAdd(node.force, node.force, v, factor * 2); - } else { - for (var i = 0; i < region.nSubRegions; i++) { - this.applyRegionToNodeRepulsion(region.subRegions[i], node); - } - } - } - }; - })(); - - ForceLayout.prototype.applyNodeToNodeRepulsion = (function() { - var v = vec2.create(); - return function applyNodeToNodeRepulsion(na, nb, oneWay) { - if (na == nb) { - return; - } - vec2.sub(v, na.position, nb.position); - var d2 = v[0] * v[0] + v[1] * v[1]; - - // PENDING - if (d2 === 0) { - return; - } - - var factor; - var k2 = this._k * this._k; - var mass = na.mass + nb.mass; - - if (this.preventOverlap) { - var d = Math.sqrt(d2); - d = d - na.size - nb.size; - if (d > 0) { - factor = k2 * mass / (d * d); - } else if (d <= 0) { - // A stronger repulsion if overlap - factor = k2 * 10 * mass; - } - } else { - // Divide factor by an extra `d` to normalize the `v` - factor = k2 * mass / d2; - } - - if (!oneWay) { - vec2.scaleAndAdd(na.force, na.force, v, factor * 2); - } - vec2.scaleAndAdd(nb.force, nb.force, v, -factor * 2); - }; - })(); - - ForceLayout.prototype.applyEdgeAttraction = (function() { - var v = vec2.create(); - return function applyEdgeAttraction(edge) { - var na = edge.source; - var nb = edge.target; - - vec2.sub(v, na.position, nb.position); - var d = vec2.len(v); - - var w; - if (this.edgeWeightInfluence === 0) { - w = 1; - } else if (this.edgeWeightInfluence == 1) { - w = edge.weight; - } else { - w = Math.pow(edge.weight, this.edgeWeightInfluence); - } - - var factor; - - if (this.preventOverlap) { - d = d - na.size - nb.size; - if (d <= 0) { - // No attraction - return; - } - } - - var factor = -w * d / this._k; - - vec2.scaleAndAdd(na.force, na.force, v, factor); - vec2.scaleAndAdd(nb.force, nb.force, v, -factor); - }; - })(); - - ForceLayout.prototype.applyNodeGravity = (function() { - var v = vec2.create(); - return function(node) { - // PENDING Move to centerOfMass or [0, 0] ? - // vec2.sub(v, this._rootRegion.centerOfMass, node.position); - // vec2.negate(v, node.position); - vec2.sub(v, this.center, node.position); - if (this.width > this.height) { - // Stronger gravity on y axis - v[1] *= this.width / this.height; - } else { - // Stronger gravity on x axis - v[0] *= this.height / this.width; - } - var d = vec2.len(v) / 100; - - if (this.strongGravity) { - vec2.scaleAndAdd(node.force, node.force, v, d * this.gravity * node.mass); - } else { - vec2.scaleAndAdd(node.force, node.force, v, this.gravity * node.mass / (d + 1)); - } - }; - })(); - - ForceLayout.prototype.updateBBox = function() { - var minX = Infinity; - var minY = Infinity; - var maxX = -Infinity; - var maxY = -Infinity; - for (var i = 0; i < this.nodes.length; i++) { - var pos = this.nodes[i].position; - minX = Math.min(minX, pos[0]); - minY = Math.min(minY, pos[1]); - maxX = Math.max(maxX, pos[0]); - maxY = Math.max(maxY, pos[1]); - } - this.bbox[0] = minX; - this.bbox[1] = minY; - this.bbox[2] = maxX; - this.bbox[3] = maxY; - }; - - ForceLayout.getWorkerCode = function() { - var str = __echartsForceLayoutWorker.toString(); - return str.slice(str.indexOf('{') + 1, str.lastIndexOf('return')); - }; - - /**************************** - * Main process - ***************************/ - - if (inWorker) { - var forceLayout = null; - - self.onmessage = function(e) { - // Position read back - if (e.data instanceof ArrayBuffer) { - if (!forceLayout) { - return; - } - var positionArr = new Float32Array(e.data); - var nNodes = (positionArr.length - 1) / 2; - for (var i = 0; i < nNodes; i++) { - var node = forceLayout.nodes[i]; - node.position[0] = positionArr[i * 2 + 1]; - node.position[1] = positionArr[i * 2 + 2]; - } - return; - } - - switch(e.data.cmd) { - case 'init': - if (!forceLayout) { - forceLayout = new ForceLayout(); - } - forceLayout.initNodes(e.data.nodesPosition, e.data.nodesMass, e.data.nodesSize); - forceLayout.initEdges(e.data.edges, e.data.edgesWeight); - forceLayout._token = e.data.token; - break; - case 'updateConfig': - if (forceLayout) { - for (var name in e.data.config) { - forceLayout[name] = e.data.config[name]; - } - } - break; - case 'update': - var steps = e.data.steps; - - if (forceLayout) { - var nNodes = forceLayout.nodes.length; - var positionArr = new Float32Array(nNodes * 2 + 1); - - forceLayout.temperature = e.data.temperature; - - if (e.data.temperature > 0.01) { - for (var i = 0; i < steps; i++) { - forceLayout.update(); - forceLayout.temperature *= e.data.coolDown; - } - // Callback - for (var i = 0; i < nNodes; i++) { - var node = forceLayout.nodes[i]; - positionArr[i * 2 + 1] = node.position[0]; - positionArr[i * 2 + 2] = node.position[1]; - } - - positionArr[0] = forceLayout._token; - } - - self.postMessage(positionArr.buffer, [positionArr.buffer]); - } else { - // Not initialzied yet - var emptyArr = new Float32Array(); - // Post transfer object - self.postMessage(emptyArr.buffer, [emptyArr.buffer]); - } - break; - } - }; - } - - return ForceLayout; +/** + * echarts默认配置项 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/config',[],function() { + // 请原谅我这样写,这显然可以直接返回个对象,但那样的话outline就显示不出来了~~ + var config = { + // 图表类型 + CHART_TYPE_LINE: 'line', + CHART_TYPE_BAR: 'bar', + CHART_TYPE_SCATTER: 'scatter', + CHART_TYPE_PIE: 'pie', + CHART_TYPE_RADAR: 'radar', + CHART_TYPE_MAP: 'map', + CHART_TYPE_K: 'k', + CHART_TYPE_ISLAND: 'island', + CHART_TYPE_FORCE: 'force', + CHART_TYPE_CHORD: 'chord', + CHART_TYPE_GAUGE: 'gauge', + CHART_TYPE_FUNNEL: 'funnel', + + // 组件类型 + COMPONENT_TYPE_TITLE: 'title', + COMPONENT_TYPE_LEGEND: 'legend', + COMPONENT_TYPE_DATARANGE: 'dataRange', + COMPONENT_TYPE_DATAVIEW: 'dataView', + COMPONENT_TYPE_DATAZOOM: 'dataZoom', + COMPONENT_TYPE_TOOLBOX: 'toolbox', + COMPONENT_TYPE_TOOLTIP: 'tooltip', + COMPONENT_TYPE_GRID: 'grid', + COMPONENT_TYPE_AXIS: 'axis', + COMPONENT_TYPE_POLAR: 'polar', + COMPONENT_TYPE_X_AXIS: 'xAxis', + COMPONENT_TYPE_Y_AXIS: 'yAxis', + COMPONENT_TYPE_AXIS_CATEGORY: 'categoryAxis', + COMPONENT_TYPE_AXIS_VALUE: 'valueAxis', + COMPONENT_TYPE_TIMELINE: 'timeline', + COMPONENT_TYPE_ROAMCONTROLLER: 'roamController', + + // 全图默认背景 + backgroundColor: 'rgba(0,0,0,0)', + + // 默认色板 + color: ['#ff7f50','#87cefa','#da70d6','#32cd32','#6495ed', + '#ff69b4','#ba55d3','#cd5c5c','#ffa500','#40e0d0', + '#1e90ff','#ff6347','#7b68ee','#00fa9a','#ffd700', + '#6699FF','#ff6666','#3cb371','#b8860b','#30e0e0'], + + // 图表标题 + title: { + text: '', + // link: null, // 超链接跳转 + // target: null, // 仅支持self | blank + subtext: '', + // sublink: null, // 超链接跳转 + // subtarget: null, // 仅支持self | blank + x: 'left', // 水平安放位置,默认为左对齐,可选为: + // 'center' ¦ 'left' ¦ 'right' + // ¦ {number}(x坐标,单位px) + y: 'top', // 垂直安放位置,默认为全图顶端,可选为: + // 'top' ¦ 'bottom' ¦ 'center' + // ¦ {number}(y坐标,单位px) + //textAlign: null // 水平对齐方式,默认根据x设置自动调整 + backgroundColor: 'rgba(0,0,0,0)', + borderColor: '#ccc', // 标题边框颜色 + borderWidth: 0, // 标题边框线宽,单位px,默认为0(无边框) + padding: 5, // 标题内边距,单位px,默认各方向内边距为5, + // 接受数组分别设定上右下左边距,同css + itemGap: 5, // 主副标题纵向间隔,单位px,默认为10, + textStyle: { + fontSize: 18, + fontWeight: 'bolder', + color: '#333' // 主标题文字颜色 + }, + subtextStyle: { + color: '#aaa' // 副标题文字颜色 + } + }, + + // 图例 + legend: { + orient: 'horizontal', // 布局方式,默认为水平布局,可选为: + // 'horizontal' ¦ 'vertical' + x: 'center', // 水平安放位置,默认为全图居中,可选为: + // 'center' ¦ 'left' ¦ 'right' + // ¦ {number}(x坐标,单位px) + y: 'top', // 垂直安放位置,默认为全图顶端,可选为: + // 'top' ¦ 'bottom' ¦ 'center' + // ¦ {number}(y坐标,单位px) + backgroundColor: 'rgba(0,0,0,0)', + borderColor: '#ccc', // 图例边框颜色 + borderWidth: 0, // 图例边框线宽,单位px,默认为0(无边框) + padding: 5, // 图例内边距,单位px,默认各方向内边距为5, + // 接受数组分别设定上右下左边距,同css + itemGap: 10, // 各个item之间的间隔,单位px,默认为10, + // 横向布局时为水平间隔,纵向布局时为纵向间隔 + itemWidth: 20, // 图例图形宽度 + itemHeight: 14, // 图例图形高度 + textStyle: { + color: '#333' // 图例文字颜色 + }, + selectedMode: true // 选择模式,默认开启图例开关 + // selected: null, // 配置默认选中状态,可配合LEGEND.SELECTED事件做动态数据载入 + // data: [], // 图例内容(详见legend.data,数组中每一项代表一个item + }, + + // 值域 + dataRange: { + orient: 'vertical', // 布局方式,默认为垂直布局,可选为: + // 'horizontal' ¦ 'vertical' + x: 'left', // 水平安放位置,默认为全图左对齐,可选为: + // 'center' ¦ 'left' ¦ 'right' + // ¦ {number}(x坐标,单位px) + y: 'bottom', // 垂直安放位置,默认为全图底部,可选为: + // 'top' ¦ 'bottom' ¦ 'center' + // ¦ {number}(y坐标,单位px) + backgroundColor: 'rgba(0,0,0,0)', + borderColor: '#ccc', // 值域边框颜色 + borderWidth: 0, // 值域边框线宽,单位px,默认为0(无边框) + padding: 5, // 值域内边距,单位px,默认各方向内边距为5, + // 接受数组分别设定上右下左边距,同css + itemGap: 10, // 各个item之间的间隔,单位px,默认为10, + // 横向布局时为水平间隔,纵向布局时为纵向间隔 + itemWidth: 20, // 值域图形宽度,线性渐变水平布局宽度为该值 * 10 + itemHeight: 14, // 值域图形高度,线性渐变垂直布局高度为该值 * 10 + // min: null, // 最小值 + // max: null, // 最大值 + precision: 0, // 小数精度,默认为0,无小数点 + splitNumber: 5, // 分割段数,默认为5,为0时为线性渐变 + calculable: false, // 是否值域漫游,启用后无视splitNumber,线性渐变 + realtime: true, + color:['#006edd','#e0ffff'],//颜色 + // formatter: null, + // text:['高','低'], // 文本,默认为数值文本 + textStyle: { + color: '#333' // 值域文字颜色 + } + }, + + toolbox: { + show: false, + orient: 'horizontal', // 布局方式,默认为水平布局,可选为: + // 'horizontal' ¦ 'vertical' + x: 'right', // 水平安放位置,默认为全图右对齐,可选为: + // 'center' ¦ 'left' ¦ 'right' + // ¦ {number}(x坐标,单位px) + y: 'top', // 垂直安放位置,默认为全图顶端,可选为: + // 'top' ¦ 'bottom' ¦ 'center' + // ¦ {number}(y坐标,单位px) + color: ['#1e90ff','#22bb22','#4b0082','#d2691e'], + disableColor: '#ddd', + effectiveColor: 'red', + backgroundColor: 'rgba(0,0,0,0)', // 工具箱背景颜色 + borderColor: '#ccc', // 工具箱边框颜色 + borderWidth: 0, // 工具箱边框线宽,单位px,默认为0(无边框) + padding: 5, // 工具箱内边距,单位px,默认各方向内边距为5, + // 接受数组分别设定上右下左边距,同css + itemGap: 10, // 各个item之间的间隔,单位px,默认为10, + // 横向布局时为水平间隔,纵向布局时为纵向间隔 + itemSize: 16, // 工具箱图形宽度 + showTitle: true, + // textStyle: { }, + feature: { + mark: { + show: false, + title: { + mark: '辅助线开关', + markUndo: '删除辅助线', + markClear: '清空辅助线' + }, + lineStyle: { + width: 1, + color: '#1e90ff', + type: 'dashed' + } + }, + dataZoom: { + show: false, + title: { + dataZoom: '区域缩放', + dataZoomReset: '区域缩放后退' + } + }, + dataView: { + show: false, + title: '数据视图', + readOnly: false, + lang: ['Data View', 'close', 'refresh'] + }, + magicType: { + show: false, + title: { + line: '折线图切换', + bar: '柱形图切换', + stack: '堆积', + tiled: '平铺' + }, + type: [ ] // 'line', 'bar', 'stack', 'tiled' + }, + restore: { + show: false, + title: '还原' + }, + saveAsImage: { + show: false, + title: '保存为图片', + type: 'png', + lang: ['点击保存'] + } + } + }, + + // 提示框 + tooltip: { + show: true, + showContent: true, // tooltip主体内容 + trigger: 'item', // 触发类型,默认数据触发,见下图,可选为:'item' ¦ 'axis' + // position: null // 位置 {Array} | {Function} + // formatter: null // 内容格式器:{string}(Template) ¦ {Function} + islandFormatter: '{a}
{b} : {c}', // 数据孤岛内容格式器 + showDelay: 20, // 显示延迟,添加显示延迟可以避免频繁切换,单位ms + hideDelay: 100, // 隐藏延迟,单位ms + transitionDuration: 0.4, // 动画变换时间,单位s + backgroundColor: 'rgba(0,0,0,0.7)', // 提示背景颜色,默认为透明度为0.7的黑色 + borderColor: '#333', // 提示边框颜色 + borderRadius: 4, // 提示边框圆角,单位px,默认为4 + borderWidth: 0, // 提示边框线宽,单位px,默认为0(无边框) + padding: 5, // 提示内边距,单位px,默认各方向内边距为5, + // 接受数组分别设定上右下左边距,同css + axisPointer: { // 坐标轴指示器,坐标轴触发有效 + type: 'line', // 默认为直线,可选为:'line' | 'shadow' | 'cross' + lineStyle: { // 直线指示器样式设置 + color: '#48b', + width: 2, + type: 'solid' + }, + crossStyle: { + color: '#1e90ff', + width: 1, + type: 'dashed' + }, + shadowStyle: { // 阴影指示器样式设置 + color: 'rgba(150,150,150,0.3)', // 阴影颜色 + width: 'auto', // 阴影大小 + type: 'default' + } + }, + textStyle: { + color: '#fff' + } + }, + + // 区域缩放控制器 + dataZoom: { + show: false, + orient: 'horizontal', // 布局方式,默认为水平布局,可选为: + // 'horizontal' ¦ 'vertical' + // x: {number}, // 水平安放位置,默认为根据grid参数适配,可选为: + // {number}(x坐标,单位px) + // y: {number}, // 垂直安放位置,默认为根据grid参数适配,可选为: + // {number}(y坐标,单位px) + // width: {number}, // 指定宽度,横向布局时默认为根据grid参数适配 + // height: {number}, // 指定高度,纵向布局时默认为根据grid参数适配 + backgroundColor: 'rgba(0,0,0,0)', // 背景颜色 + dataBackgroundColor: '#eee', // 数据背景颜色 + fillerColor: 'rgba(144,197,237,0.2)', // 填充颜色 + handleColor: 'rgba(70,130,180,0.8)', // 手柄颜色 + // xAxisIndex: [], // 默认控制所有横向类目 + // yAxisIndex: [], // 默认控制所有横向类目 + // start: 0, // 默认为0 + // end: 100, // 默认为全部 100% + realtime: true + // zoomLock: false // 是否锁定选择区域大小 + }, + + // 网格 + grid: { + x: 80, + y: 60, + x2: 80, + y2: 60, + // width: {totalWidth} - x - x2, + // height: {totalHeight} - y - y2, + backgroundColor: 'rgba(0,0,0,0)', + borderWidth: 1, + borderColor: '#ccc' + }, + + // 类目轴 + categoryAxis: { + position: 'bottom', // 位置 + name: '', // 坐标轴名字,默认为空 + nameLocation: 'end', // 坐标轴名字位置,支持'start' | 'end' + nameTextStyle: {}, // 坐标轴文字样式,默认取全局样式 + boundaryGap: true, // 类目起始和结束两端空白策略 + axisLine: { // 坐标轴线 + show: true, // 默认显示,属性show控制显示与否 + onZero: true, + lineStyle: { // 属性lineStyle控制线条样式 + color: '#48b', + width: 2, + type: 'solid' + } + }, + axisTick: { // 坐标轴小标记 + show: true, // 属性show控制显示与否,默认不显示 + interval: 'auto', + inside: false, // 控制小标记是否在grid里 + // onGap: null, + length :5, // 属性length控制线长 + lineStyle: { // 属性lineStyle控制线条样式 + color: '#333', + width: 1 + } + }, + axisLabel: { // 坐标轴文本标签,详见axis.axisLabel + show: true, + interval: 'auto', + rotate: 0, + margin: 8, + // clickable: false, + // formatter: null, + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: '#333' + } + }, + splitLine: { // 分隔线 + show: true, // 默认显示,属性show控制显示与否 + // onGap: null, + lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 + color: ['#ccc'], + width: 1, + type: 'solid' + } + }, + splitArea: { // 分隔区域 + show: false, // 默认不显示,属性show控制显示与否 + // onGap: null, + areaStyle: { // 属性areaStyle(详见areaStyle)控制区域样式 + color: ['rgba(250,250,250,0.3)','rgba(200,200,200,0.3)'] + } + } + }, + + // 数值型坐标轴默认参数 + valueAxis: { + position: 'left', // 位置 + name: '', // 坐标轴名字,默认为空 + nameLocation: 'end', // 坐标轴名字位置,支持'start' | 'end' + nameTextStyle: {}, // 坐标轴文字样式,默认取全局样式 + boundaryGap: [0, 0], // 数值起始和结束两端空白策略 + // min: null, // 最小值 + // max: null, // 最大值 + // scale: false, // 脱离0值比例,放大聚焦到最终_min,_max区间 + precision: 0, // 小数精度,默认为0,无小数点 + power: 100, // 整数精度,默认为100,个位和百位为0 + splitNumber: 5, // 分割段数,默认为5 + axisLine: { // 坐标轴线 + show: true, // 默认显示,属性show控制显示与否 + onZero: true, + lineStyle: { // 属性lineStyle控制线条样式 + color: '#48b', + width: 2, + type: 'solid' + } + }, + axisTick: { // 坐标轴小标记 + show: false, // 属性show控制显示与否,默认不显示 + inside: false, // 控制小标记是否在grid里 + length :5, // 属性length控制线长 + lineStyle: { // 属性lineStyle控制线条样式 + color: '#333', + width: 1 + } + }, + axisLabel: { // 坐标轴文本标签,详见axis.axisLabel + show: true, + rotate: 0, + margin: 8, + // clickable: false, + // formatter: null, + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: '#333' + } + }, + splitLine: { // 分隔线 + show: true, // 默认显示,属性show控制显示与否 + lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 + color: ['#ccc'], + width: 1, + type: 'solid' + } + }, + splitArea: { // 分隔区域 + show: false, // 默认不显示,属性show控制显示与否 + areaStyle: { // 属性areaStyle(详见areaStyle)控制区域样式 + color: ['rgba(250,250,250,0.3)','rgba(200,200,200,0.3)'] + } + } + }, + + polar: { + center: ['50%', '50%'], // 默认全局居中 + radius: '75%', + startAngle: 90, + splitNumber: 5, + name: { + show: true, + // formatter: null, + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: '#333' + } + }, + axisLine: { // 坐标轴线 + show: true, // 默认显示,属性show控制显示与否 + lineStyle: { // 属性lineStyle控制线条样式 + color: '#ccc', + width: 1, + type: 'solid' + } + }, + axisLabel: { // 坐标轴文本标签,详见axis.axisLabel + show: false, + // formatter: null, + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: '#333' + } + }, + splitArea: { + show: true, + areaStyle: { + color: ['rgba(250,250,250,0.3)','rgba(200,200,200,0.3)'] + } + }, + splitLine: { + show: true, + lineStyle: { + width: 1, + color: '#ccc' + } + }, + type: 'polygon' + // indicator: [ ] + }, + + timeline: { + show: true, + type: 'time', // 模式是时间类型,支持 number + notMerge: false, + realtime: true, + x: 80, + // y: {number}, + x2: 80, + y2: 0, + // width: {totalWidth} - x - x2, + height: 50, + backgroundColor: 'rgba(0,0,0,0)', // 时间轴背景颜色 + borderColor: '#ccc', // 时间轴边框颜色 + borderWidth: 0, // 时间轴边框线宽,单位px,默认为0(无边框) + padding: 5, // 时间轴内边距,单位px,默认各方向内边距为5, + controlPosition: 'left', // 'right' | 'none' + autoPlay: false, + loop: true, + playInterval: 2000, // 播放时间间隔,单位ms + lineStyle: { + width: 1, + color: '#666', + type: 'dashed' + }, + label: { // 文本标签 + show: true, + interval: 'auto', + rotate: 0, + // formatter: null, + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: '#333' + } + }, + checkpointStyle: { + symbol: 'auto', + symbolSize: 'auto', + color: 'auto', + borderColor: 'auto', + borderWidth: 'auto', + label: { // 文本标签 + show: false, + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: 'auto' + } + } + }, + controlStyle: { + normal: { color: '#333'}, + emphasis: { color: '#1e90ff'} + }, + symbol: 'emptyDiamond', + symbolSize: 4, + currentIndex: 0 + // data: [] + }, + + roamController: { + show: false, + x: 'left', // 水平安放位置,默认为全图左对齐,可选为: + // 'center' ¦ 'left' ¦ 'right' + // ¦ {number}(x坐标,单位px) + y: 'top', // 垂直安放位置,默认为全图顶端,可选为: + // 'top' ¦ 'bottom' ¦ 'center' + // ¦ {number}(y坐标,单位px) + width: 80, + height: 120, + backgroundColor: 'rgba(0,0,0,0)', + borderColor: '#ccc', // 图例边框颜色 + borderWidth: 0, // 图例边框线宽,单位px,默认为0(无边框) + padding: 5, // 图例内边距,单位px,默认各方向内边距为5, + // 接受数组分别设定上右下左边距,同css + handlerColor: '#6495ed', + fillerColor: '#fff', + step: 15, // 移动幅度 + mapTypeControl: null + }, + + // 柱形图默认参数 + bar: { + clickable: true, + // stack: null + xAxisIndex: 0, + yAxisIndex: 0, + barMinHeight: 0, // 最小高度改为0 + // barWidth: null, // 默认自适应 + barGap: '30%', // 柱间距离,默认为柱形宽度的30%,可设固定值 + barCategoryGap: '20%', // 类目间柱形距离,默认为类目间距的20%,可设固定值 + itemStyle: { + normal: { + // color: '各异', + barBorderColor: '#fff', // 柱条边线 + barBorderRadius: 0, // 柱条边线圆角,单位px,默认为0 + barBorderWidth: 0, // 柱条边线线宽,单位px,默认为1 + label: { + show: false + // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 + // 'inside'|'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + } + }, + emphasis: { + // color: '各异', + barBorderColor: '#fff', // 柱条边线 + barBorderRadius: 0, // 柱条边线圆角,单位px,默认为0 + barBorderWidth: 0, // 柱条边线线宽,单位px,默认为1 + label: { + show: false + // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 + // 'inside'|'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + } + } + } + }, + + // 折线图默认参数 + line: { + clickable: true, + // stack: null + xAxisIndex: 0, + yAxisIndex: 0, + itemStyle: { + normal: { + // color: 各异, + label: { + show: false + // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 + // 'inside'|'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + }, + lineStyle: { + width: 2, + type: 'solid', + shadowColor: 'rgba(0,0,0,0)', //默认透明 + shadowBlur: 0, + shadowOffsetX: 0, + shadowOffsetY: 0 + } + }, + emphasis: { + // color: 各异, + label: { + show: false + // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 + // 'inside'|'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + } + } + }, + // smooth: false, + // symbol: null, // 拐点图形类型 + symbolSize: 2, // 拐点图形大小 + // symbolRotate: null, // 拐点图形旋转控制 + showAllSymbol: false // 标志图形默认只有主轴显示(随主轴标签间隔隐藏策略) + }, + + // K线图默认参数 + k: { + clickable: true, + xAxisIndex: 0, + yAxisIndex: 0, + // barWidth: null // 默认自适应 + // barMaxWidth: null // 默认自适应 + itemStyle: { + normal: { + color: '#fff', // 阳线填充颜色 + color0: '#00aa11', // 阴线填充颜色 + lineStyle: { + width: 1, + color: '#ff3200', // 阳线边框颜色 + color0: '#00aa11' // 阴线边框颜色 + } + }, + emphasis: { + // color: 各异, + // color0: 各异 + } + } + }, + + // 散点图默认参数 + scatter: { + clickable: true, + xAxisIndex: 0, + yAxisIndex: 0, + // symbol: null, // 图形类型 + symbolSize: 4, // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 + // symbolRotate: null, // 图形旋转控制 + large: false, // 大规模散点图 + largeThreshold: 2000, // 大规模阀值,large为true且数据量>largeThreshold才启用大规模模式 + itemStyle: { + normal: { + // color: 各异, + label: { + show: false, + // 标签文本格式器,同Tooltip.formatter,不支持回调 + formatter: function (a, b, c) { + if (typeof c[2] != 'undefined') { + return c[2]; + } + else { + return c[0] + ' , ' + c[1]; + } + } + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 + // 'inside'|'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + } + }, + emphasis: { + // color: '各异' + label: { + show: false, + // 标签文本格式器,同Tooltip.formatter,不支持回调 + formatter: function (a, b, c) { + if (typeof c[2] != 'undefined') { + return c[2]; + } + else { + return c[0] + ' , ' + c[1]; + } + } + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 + // 'inside'|'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + } + } + } + }, + + // 雷达图默认参数 + radar: { + clickable: true, + polarIndex: 0, + itemStyle: { + normal: { + // color: 各异, + label: { + show: false + }, + lineStyle: { + width: 2, + type: 'solid' + } + }, + emphasis: { + // color: 各异, + label: { + show: false + } + } + }, + // symbol: null, // 拐点图形类型 + symbolSize: 2 // 可计算特性参数,空数据拖拽提示图形大小 + // symbolRotate: null, // 图形旋转控制 + }, + + // 饼图默认参数 + pie: { + clickable: true, + center: ['50%', '50%'], // 默认全局居中 + radius: [0, '75%'], + clockWise: true, // 默认顺时针 + startAngle: 90, + minAngle: 0, // 最小角度改为0 + selectedOffset: 10, // 选中是扇区偏移量 + // selectedMode: false, // 选择模式,默认关闭,可选single,multiple + // roseType: null, // 南丁格尔玫瑰图模式,'radius'(半径) | 'area'(面积) + itemStyle: { + normal: { + // color: 各异, + borderColor: 'rgba(0,0,0,0)', + borderWidth: 1, + label: { + show: true, + position: 'outer' + // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + }, + labelLine: { + show: true, + length: 20, + lineStyle: { + // color: 各异, + width: 1, + type: 'solid' + } + } + }, + emphasis: { + // color: 各异, + borderColor: 'rgba(0,0,0,0)', + borderWidth: 1, + label: { + show: false + // position: 'outer' + // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + }, + labelLine: { + show: false, + length: 20, + lineStyle: { + // color: 各异, + width: 1, + type: 'solid' + } + } + } + } + }, + + map: { + mapType: 'china', // 各省的mapType暂时都用中文 + //mapLocation: { + // x: 'center' | 'left' | 'right' | 'x%' | {number}, + // y: 'center' | 'top' | 'bottom' | 'x%' | {number} + // width // 自适应 + // height // 自适应 + //}, + // mapValueCalculation: 'sum', // 数值合并方式,默认加和,可选为: + // 'sum' | 'average' | 'max' | 'min' + mapValuePrecision: 0, // 地图数值计算结果小数精度 + showLegendSymbol: true, // 显示图例颜色标识(系列标识的小圆点),存在legend时生效 + // selectedMode: false, // 选择模式,默认关闭,可选single,multiple + hoverable: true, + clickable: true, + // roam: false, // 是否开启缩放及漫游模式 + // scaleLimit: null, + itemStyle: { + normal: { + // color: 各异, + borderColor: 'rgba(0,0,0,0)', + borderWidth: 1, + areaStyle: { + color: '#ccc' + }, + label: { + show: false, + textStyle: { + color: 'rgb(139,69,19)' + } + } + }, + emphasis: { // 也是选中样式 + // color: 各异, + borderColor: 'rgba(0,0,0,0)', + borderWidth: 1, + areaStyle: { + color: 'rgba(255,215,0,0.8)' + }, + label: { + show: false, + textStyle: { + color: 'rgb(100,0,0)' + } + } + } + } + }, + + force: { + // 布局中心 + center: ['50%', '50%'], + + // 布局大小 + size: '100%', + + // 布局冷却因子,值越小结束时间越短,值越大时间越长但是结果也越收敛 + coolDown: 0.99, + + // 数据映射到圆的半径的最小值和最大值 + minRadius: 10, + maxRadius: 20, + + // 是否根据屏幕比例拉伸 + ratioScaling: false, + + // 在 500+ 顶点的图上建议设置 large 为 true, 会使用 Barnes-Hut simulation + // 同时开启 useWorker 并且把 steps 值调大 + // 关于Barnes-Hut simulation: http://en.wikipedia.org/wiki/Barnes–Hut_simulation + large: false, + + // 是否在浏览器支持 worker 的时候使用 web worker + useWorker: false, + // 每一帧 force 迭代的次数,仅在启用webworker的情况下有用 + steps: 1, + + // 布局缩放因子,并不完全精确, 效果跟布局大小类似 + scaling: 1.0, + + // 向心力因子,越大向心力越大( 所有顶点会往 center 的位置收拢 ) + gravity: 1, + + symbol: 'circle', + // symbolSize 为 0 的话使用映射到minRadius-maxRadius后的值 + symbolSize: 0, + + linkSymbol: null, + linkSymbolSize: [10, 15], + draggable: true, + clickable: true, + + // 分类里如果有样式会覆盖节点默认样式 + categories: [{ + // itemStyle + // symbol + // symbolSize + // name + }], + itemStyle: { + normal: { + // color: 各异, + label: { + show: false + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + }, + nodeStyle: { + brushType: 'both', + color: '#f08c2e', + strokeColor: '#5182ab', + lineWidth: 1 + }, + linkStyle: { + strokeColor: '#5182ab' + } + }, + emphasis: { + // color: 各异, + label: { + show: false + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + }, + nodeStyle: {}, + linkStyle: { + opacity: 0 + } + } + } + // nodes: [{ + // name: 'xxx', + // value: 1, + // itemStyle: {}, + // initial: [0, 0], + // fixX: false, + // fixY: false, + // ignore: false, + // symbol: 'circle', + // symbolSize: 0 + // }] + // links: [{ + // source: 1, + // target: 2, + // weight: 1, + // itemStyle: {} + // }, { + // source: 'xxx', + // target: 'ooo' + // }] + }, + + chord: { + clickable: true, + radius: ['65%', '75%'], + center: ['50%', '50%'], + padding: 2, + sort: 'none', // can be 'none', 'ascending', 'descending' + sortSub: 'none', // can be 'none', 'ascending', 'descending' + startAngle: 90, + clockWise: true, + showScale: false, + showScaleText: false, + itemStyle: { + normal: { + label: { + show: true, + rotate: false, + distance: 10 + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + }, + lineStyle: { + width: 0, + color: '#000' + }, + chordStyle: { + lineStyle: { + width: 1, + color: '#999' + } + } + }, + emphasis: { + lineStyle: { + width: 0, + color: '#000' + }, + chordStyle: { + lineStyle: { + width: 1, + color: '#666' + } + } + } + }, + // Source data matrix + /** + * target + * -1--2--3--4--5- + * 1| x x x x x + * 2| x x x x x + * 3| x x x x x source + * 4| x x x x x + * 5| x x x x x + * + * Relation ship from source to target + * https://github.com/mbostock/d3/wiki/Chord-Layout#wiki-chord + * + * Row based + */ + matrix: [ ] + }, + + gauge: { + center: ['50%', '50%'], // 默认全局居中 + radius: '75%', + startAngle: 225, + endAngle: -45, + min: 0, // 最小值 + max: 100, // 最大值 + precision: 0, // 小数精度,默认为0,无小数点 + splitNumber: 10, // 分割段数,默认为10 + axisLine: { // 坐标轴线 + show: true, // 默认显示,属性show控制显示与否 + lineStyle: { // 属性lineStyle控制线条样式 + color: [[0.2, '#228b22'],[0.8, '#48b'],[1, '#ff4500']], + width: 30 + } + }, + axisTick: { // 坐标轴小标记 + show: true, // 属性show控制显示与否,默认不显示 + splitNumber: 5, // 每份split细分多少段 + length :8, // 属性length控制线长 + lineStyle: { // 属性lineStyle控制线条样式 + color: '#eee', + width: 1, + type: 'solid' + } + }, + axisLabel: { // 坐标轴文本标签,详见axis.axisLabel + show: true, + // formatter: null, + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: 'auto' + } + }, + splitLine: { // 分隔线 + show: true, // 默认显示,属性show控制显示与否 + length :30, // 属性length控制线长 + lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 + color: '#eee', + width: 2, + type: 'solid' + } + }, + pointer: { + show: true, + length: '80%', + width: 8, + color: 'auto' + }, + title: { + show: true, + offsetCenter: [0, '-40%'], // x, y,单位px + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: '#333', + fontSize: 15 + } + }, + detail: { + show: true, + backgroundColor: 'rgba(0,0,0,0)', + borderWidth: 0, + borderColor: '#ccc', + width: 100, + height: 40, + offsetCenter: [0, '40%'], // x, y,单位px + // formatter: null, + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: 'auto', + fontSize: 30 + } + } + }, + + funnel: { + clickable: true, + x: 80, + y: 60, + x2: 80, + y2: 60, + // width: {totalWidth} - x - x2, + // height: {totalHeight} - y - y2, + min: 0, + max: 100, + minSize: '0%', + maxSize: '100%', + sort: 'descending', // 'ascending', 'descending' + gap: 0, + itemStyle: { + normal: { + // color: 各异, + borderColor: '#fff', + borderWidth: 1, + label: { + show: true, + position: 'outer' + // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + }, + labelLine: { + show: true, + length: 10, + lineStyle: { + // color: 各异, + width: 1, + type: 'solid' + } + } + }, + emphasis: { + // color: 各异, + borderColor: 'rgba(0,0,0,0)', + borderWidth: 1, + label: { + show: true + }, + labelLine: { + show: true + } + } + } + }, + + island: { + r: 15, + calculateStep: 0.1 // 滚轮可计算步长 0.1 = 10% + }, + + markPoint: { + clickable: true, + symbol: 'pin', // 标注类型 + symbolSize: 10, // 标注大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 + // symbolRotate: null, // 标注旋转控制 + large: false, + effect: { + show: false, + loop: true, + period: 15, // 运动周期,无单位,值越大越慢 + scaleSize: 2 // 放大倍数,以markPoint点size为基准 + // color: 'gold', + // shadowColor: 'rgba(255,215,0,0.8)', + // shadowBlur: 0 // 炫光模糊 + }, + itemStyle: { + normal: { + // color: 各异, + // borderColor: 各异, // 标注边线颜色,优先于color + borderWidth: 2, // 标注边线线宽,单位px,默认为1 + label: { + show: true, + // 标签文本格式器,同Tooltip.formatter,不支持回调 + // formatter: null, + position: 'inside' // 可选为'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + } + }, + emphasis: { + // color: 各异 + label: { + show: true + // 标签文本格式器,同Tooltip.formatter,不支持回调 + // formatter: null, + // position: 'inside' // 'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + } + } + } + }, + + markLine: { + clickable: true, + // 标线起始和结束的symbol介绍类型,如果都一样,可以直接传string + symbol: ['circle', 'arrow'], + // 标线起始和结束的symbol大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 + symbolSize: [2, 4], + // 标线起始和结束的symbol旋转控制 + //symbolRotate: null, + //smooth: false, + large: false, + effect: { + show: false, + loop: true, + period: 15, // 运动周期,无单位,值越大越慢 + scaleSize: 2 // 放大倍数,以markLine线lineWidth为基准 + // color: 'gold', + // shadowColor: 'rgba(255,215,0,0.8)', + // shadowBlur: lineWidth * 2 // 炫光模糊,默认等于scaleSize计算所得 + }, + itemStyle: { + normal: { + // color: 各异, // 标线主色,线色,symbol主色 + // borderColor: 随color, // 标线symbol边框颜色,优先于color + borderWidth: 1.5, // 标线symbol边框线宽,单位px,默认为2 + label: { + show: true, + // 标签文本格式器,同Tooltip.formatter,不支持回调 + // formatter: null, + // 可选为 'start'|'end'|'left'|'right'|'top'|'bottom' + position: 'end' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + }, + lineStyle: { + // color: 随borderColor, // 主色,线色,优先级高于borderColor和color + // width: 随borderWidth, // 优先于borderWidth + type: 'dashed' + // shadowColor: 'rgba(0,0,0,0)', //默认透明 + // shadowBlur: 0, + // shadowOffsetX: 0, + // shadowOffsetY: 0 + } + }, + emphasis: { + // color: 各异 + label: { + show: false + // 标签文本格式器,同Tooltip.formatter,不支持回调 + // formatter: null, + // position: 'inside' // 'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + }, + lineStyle: {} + } + } + }, + + // 主题,主题 + textStyle: { + decoration: 'none', + fontFamily: 'Arial, Verdana, sans-serif', + fontFamily2: '微软雅黑', // IE8- 字体模糊并且,不支持不同字体混排,额外指定一份 + fontSize: 12, + fontStyle: 'normal', + fontWeight: 'normal' + }, + + EVENT: { + // -------全局通用 + REFRESH: 'refresh', + RESTORE: 'restore', + RESIZE: 'resize', + CLICK: 'click', + DBLCLICK: 'dblclick', + HOVER: 'hover', + MOUSEOUT: 'mouseout', + //MOUSEWHEEL: 'mousewheel', + // -------业务交互逻辑 + DATA_CHANGED: 'dataChanged', + DATA_ZOOM: 'dataZoom', + DATA_RANGE: 'dataRange', + LEGEND_SELECTED: 'legendSelected', + MAP_SELECTED: 'mapSelected', + PIE_SELECTED: 'pieSelected', + MAGIC_TYPE_CHANGED: 'magicTypeChanged', + DATA_VIEW_CHANGED: 'dataViewChanged', + TIMELINE_CHANGED: 'timelineChanged', + MAP_ROAM: 'mapRoam', + // -------内部通信 + TOOLTIP_HOVER: 'tooltipHover', + TOOLTIP_IN_GRID: 'tooltipInGrid', + TOOLTIP_OUT_GRID: 'tooltipOutGrid', + ROAMCONTROLLER: 'roamController' + }, + DRAG_ENABLE_TIME: 120, // 降低图表内元素拖拽敏感度,单位ms,不建议外部干预 + EFFECT_ZLEVEL: 7, + // 主题,默认标志图形类型列表 + symbolList: [ + 'circle', 'rectangle', 'triangle', 'diamond', + 'emptyCircle', 'emptyRectangle', 'emptyTriangle', 'emptyDiamond' + ], + loadingText: 'Loading...', + // 可计算特性配置,孤岛,提示颜色 + calculable: false, // 默认关闭可计算特性 + calculableColor: 'rgba(255,165,0,0.6)', // 拖拽提示边框颜色 + calculableHolderColor: '#ccc', // 可计算占位提示颜色 + nameConnector: ' & ', + valueConnector: ': ', + animation: true, // 过渡动画是否开启 + addDataAnimation: true, // 动态数据接口是否开启动画效果 + animationThreshold: 2000, // 动画元素阀值,产生的图形原素超过2000不出动画 + animationDuration: 2000, + animationEasing: 'ExponentialOut' //BounceOut + }; + + return config; }); -/** - * echarts图表类:力导向图 - * - * @author pissang (https://github.com/pissang/) - * - */ - -define('echarts/chart/force',['require','../component/base','./base','./forceLayoutWorker','zrender/shape/Line','../util/shape/Icon','../config','../util/ecData','zrender/tool/util','zrender/config','zrender/tool/vector','../util/ndarray','../chart'],function (require) { - - - var ComponentBase = require('../component/base'); - var ChartBase = require('./base'); - - var ForceLayout = require('./forceLayoutWorker'); - - // 图形依赖 - var LineShape = require('zrender/shape/Line'); - var IconShape = require('../util/shape/Icon'); - - var ecConfig = require('../config'); - var ecData = require('../util/ecData'); - var zrUtil = require('zrender/tool/util'); - var zrConfig = require('zrender/config'); - var vec2 = require('zrender/tool/vector'); - - var NDArray = require('../util/ndarray'); - var ArrayCtor = typeof(Float32Array) == 'undefined' ? Array : Float32Array; - - var requestAnimationFrame = window.requestAnimationFrame - || window.msRequestAnimationFrame - || window.mozRequestAnimationFrame - || window.webkitRequestAnimationFrame - || function (func){setTimeout(func, 16);}; - - // Use inline web worker - var workerUrl; - if ( - typeof(Worker) !== 'undefined' && - typeof(Blob) !== 'undefined' - ) { - try { - var blob = new Blob([ForceLayout.getWorkerCode()]); - workerUrl = window.URL.createObjectURL(blob); - } catch(e) { - workerUrl = ''; - } - } - - function getToken() { - return Math.round(new Date().getTime() / 100) % 10000000; - } - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} series 数据 - * @param {Object} component 组件 - */ - function Force(ecTheme, messageCenter, zr, option, myChart) { - var self = this; - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); - // 图表基类 - ChartBase.call(this); - - // 保存节点的位置,改变数据时能够有更好的动画效果 - // TODO - this.__nodePositionMap = {}; - - this._nodeShapes = []; - this._linkShapes = []; - - this._updating = true; - - this._filteredNodes = null; - this._filteredLinks = null; - this._rawNodes = null; - this._rawLinks = null; - - this._steps = 1; - this._coolDown = 0.99; - - // 关闭可拖拽属性 - this.ondragstart = function() { - ondragstart.apply(self, arguments); - }; - this.ondragend = function() { - ondragend.apply(self, arguments); - }; - this.ondrop = function() {}; - this.shapeHandler.ondragstart = function() { - self.isDragstart = true; - }; - this.onmousemove = function() { - onmousemove.apply(self, arguments); - }; - this._init(); - } - - /** - * 绘制图形 - */ - Force.prototype = { - - constructor: Force, - - type : ecConfig.CHART_TYPE_FORCE, - - _init: function() { - var self = this; - - this.clear(); - - this._updating = true; - - this._buildShape(); - - if (this._layoutWorker) { - this._layoutWorker.onmessage = function(e) { - if (self._temperature < 0.01) { - requestAnimationFrame(function() { - self._step.call(self, e); - }); - } else { - self._step.call(self, e); - } - }; - - this._layoutWorker.postMessage({ - cmd: 'update', - steps: this._steps, - temperature: this._temperature, - coolDown: this._coolDown - }); - } - else { - var cb = function() { - if (self._updating) { - self._step(); - requestAnimationFrame(cb); - } - }; - - requestAnimationFrame(cb); - } - }, - - _buildShape: function() { - var legend = this.component.legend; - var series = this.series; - var serieName; - - this._temperature = 1; - - this.shapeList.length = 0; - - for (var i = 0, l = series.length; i < l; i++) { - var serie = series[i]; - if (serie.type === ecConfig.CHART_TYPE_FORCE) { - series[i] = this.reformOption(series[i]); - serieName = series[i].name || ''; - - if (workerUrl && serie.useWorker) { - try { - if (!this._layoutWorker) { - this._layoutWorker = new Worker(workerUrl); - } - this._layout = null; - } catch(e) { // IE10-11 will throw security error when using blog url - this._layoutWorker = null; - if (!this._layout) { - this._layout = new ForceLayout(); - } - } - } else { - if (!this._layout) { - this._layout = new ForceLayout(); - } - if (this._layoutWorker) { - this._layoutWorker.terminate(); - this._layoutWorker = null; - } - } - - // 系列图例开关 - this.selectedMap[serieName] = - legend ? legend.isSelected(serieName) : true; - if (!this.selectedMap[serieName]) { - continue; - } - - this.buildMark(i); - - // 同步selected状态 - var categories = serie.categories; - for (var j = 0, len = categories.length; j < len; j++) { - if (categories[j].name) { - if (legend){ - this.selectedMap[j] = - legend.isSelected(categories[j].name); - } else { - this.selectedMap[j] = true; - } - } - } - - this._preProcessData(serie); - - this._nodeShapes.length = 0; - this._linkShapes.length = 0; - - this._buildLinkShapes(serie); - this._buildNodeShapes(serie); - - this._initLayout(serie); - - this._updateLinkShapes(); - - // TODO 多个 force - this._forceSerie = serie; - break; - } - } - }, - - _preProcessData: function(serie) { - this._rawNodes = this.query(serie, 'nodes'); - this._rawLinks = zrUtil.clone(this.query(serie, 'links')); - - var filteredNodeList = []; - var filteredNodeMap = {}; - var cursor = 0; - var self = this; - this._filteredNodes = _filter(this._rawNodes, function (node, i) { - if (!node) { - return; - } - if (node.ignore) { - return; - } - var idx = -1; - if ( - typeof(node.category) == 'undefined' - || self.selectedMap[node.category] - ) { - idx = cursor++; - } - if (node.name) { - filteredNodeMap[node.name] = idx; - } - filteredNodeList[i] = idx; - - return idx >= 0; - }); - var source; - var target; - this._filteredLinks = _filter(this._rawLinks, function (link, i){ - source = link.source; - target = link.target; - var ret = true; - var idx = typeof(source) === 'string' - ? filteredNodeMap[source] // source 用 node id 表示 - : filteredNodeList[source]; // source 用 node index 表示 - if (typeof(idx) == 'undefined') { - idx = -1; - } - - if (idx >= 0) { - link.source = idx; - } else { - ret = false; - } - - var idx = typeof(target) === 'string' - ? filteredNodeMap[target] // target 用 node id 表示 - : filteredNodeList[target]; // target 用 node index 表示 - if (typeof(idx) == 'undefined') { - idx = -1; - } - - if (idx >= 0) { - link.target = idx; - } else { - ret = false; - } - // 保存原始链接中的index - link.rawIndex = i; - - return ret; - }); - }, - - _initLayout: function(serie) { - - var nodes = this._filteredNodes; - var links = this._filteredLinks; - var shapes = this._nodeShapes; - var len = nodes.length; - - var minRadius = this.query(serie, 'minRadius'); - var maxRadius = this.query(serie, 'maxRadius'); - this._steps = serie.steps || 1; - this._coolDown = serie.coolDown || 0.99; - - var center = this.parseCenter(this.zr, serie.center); - var width = this.parsePercent(serie.size, this.zr.getWidth()); - var height = this.parsePercent(serie.size, this.zr.getHeight()); - var size = Math.min(width, height); - - // 将值映射到minRadius-maxRadius的范围上 - var radius = []; - for (var i = 0; i < len; i++) { - var node = nodes[i]; - radius.push(node.value || 1); - } - - var arr = new NDArray(radius); - radius = arr.map(minRadius, maxRadius).toArray(); - var max = arr.max(); - if (max === 0) { - return; - } - var massArr = arr.mul(1/max, arr).toArray(); - var positionArr = new ArrayCtor(len * 2); - - for (var i = 0; i < len; i++) { - var initPos; - var node = nodes[i]; - if (typeof(this.__nodePositionMap[node.name]) !== 'undefined') { - initPos = vec2.create(); - vec2.copy(initPos, this.__nodePositionMap[node.name]); - } else if (typeof(node.initial) !== 'undefined') { - initPos = Array.prototype.slice.call(node.initial); - } else { - initPos = _randomInSquare( - center[0], center[1], size * 0.8 - ); - } - var style = shapes[i].style; - style.width = style.width || (radius[i] * 2); - style.height = style.height || (radius[i] * 2); - style.x = -style.width / 2; - style.y = -style.height / 2; - shapes[i].position = initPos; - - positionArr[i * 2] = initPos[0]; - positionArr[i * 2 + 1] = initPos[1]; - } - - len = links.length; - var edgeArr = new ArrayCtor(len * 2); - var edgeWeightArr = new ArrayCtor(len); - for (var i = 0; i < len; i++) { - var link = links[i]; - edgeArr[i * 2] = link.source; - edgeArr[i * 2 + 1] = link.target; - edgeWeightArr[i] = link.weight || 1; - } - - arr = new NDArray(edgeWeightArr); - var max = arr.max(); - if (max === 0) { - return; - } - var edgeWeightArr = arr.mul(1 / max, arr)._array; - - var config = { - center: center, - width: serie.ratioScaling ? width : size, - height: serie.ratioScaling ? height : size, - scaling: serie.scaling || 1.0, - gravity: serie.gravity || 1.0, - barnesHutOptimize: serie.large - }; - - if (this._layoutWorker) { - - this._token = getToken(); - - this._layoutWorker.postMessage({ - cmd: 'init', - nodesPosition: positionArr, - nodesMass: massArr, - nodesSize: radius, - edges: edgeArr, - edgesWeight: edgeWeightArr, - token: this._token - }); - - this._layoutWorker.postMessage({ - cmd: 'updateConfig', - config: config - }); - - } else { - - zrUtil.merge(this._layout, config, true); - this._layout.initNodes(positionArr, massArr, radius); - this._layout.initEdges(edgeArr, edgeWeightArr); - } - }, - - _buildNodeShapes: function(serie) { - var categories = this.query(serie, 'categories'); - var nodes = this._filteredNodes; - var len = nodes.length; - var legend = this.component.legend; - - for (var i = 0; i < len; i++) { - var node = nodes[i]; - - var shape = new IconShape({ - style : { - x : 0, - y : 0 - }, - clickable : true, - highlightStyle : {} - }); - - var queryTarget = []; - var shapeNormalStyle = []; - var shapeEmphasisStyle = []; - - queryTarget.push(node); - if (node.itemStyle) { - shapeNormalStyle.push(node.itemStyle.normal); - shapeEmphasisStyle.push(node.itemStyle.emphasis); - } - if (typeof(node.category) !== 'undefined') { - var category = categories[node.category]; - if (category) { - // 使用 Legend.getColor 配置默认 category 的默认颜色 - category.itemStyle = category.itemStyle || {}; - category.itemStyle.normal = category.itemStyle.normal || {}; - category.itemStyle.normal.color = category.itemStyle.normal.color - || legend.getColor(category.name); - - queryTarget.push(category); - shapeNormalStyle.unshift(category.itemStyle.normal); - shapeEmphasisStyle.unshift(category.itemStyle.emphasis); - } - } - queryTarget.push(serie); - shapeNormalStyle.unshift(serie.itemStyle.normal.nodeStyle); - shapeEmphasisStyle.unshift(serie.itemStyle.emphasis.nodeStyle); - - shape.style.iconType = this.deepQuery(queryTarget, 'symbol'); - // 强制设定节点大小,否则默认映射到 minRadius 到 maxRadius 后的值 - shape.style.width = shape.style.height - = (this.deepQuery(queryTarget, 'symbolSize') || 0) * 2; - - // 节点样式 - for (var k = 0; k < shapeNormalStyle.length; k++) { - if (shapeNormalStyle[k]) { - zrUtil.merge(shape.style, shapeNormalStyle[k], true); - } - } - // 节点高亮样式 - for (var k = 0; k < shapeEmphasisStyle.length; k++) { - if (shapeEmphasisStyle[k]) { - zrUtil.merge(shape.highlightStyle, shapeEmphasisStyle[k], true); - } - } - - // 节点标签样式 - if (this.deepQuery(queryTarget, 'itemStyle.normal.label.show')) { - shape.style.text = node.name; - shape.style.textPosition = 'inside'; - var labelStyle = this.deepQuery( - queryTarget, 'itemStyle.normal.label.textStyle' - ) || {}; - shape.style.textColor = labelStyle.color || '#fff'; - shape.style.textAlign = labelStyle.align || 'center'; - shape.style.textBaseline = labelStyle.baseline || 'middle'; - shape.style.textFont = this.getFont(labelStyle); - } - - if (this.deepQuery(queryTarget, 'itemStyle.emphasis.label.show')) { - shape.highlightStyle.text = node.name; - shape.highlightStyle.textPosition = 'inside'; - var labelStyle = this.deepQuery( - queryTarget, 'itemStyle.emphasis.label.textStyle' - ) || {}; - shape.highlightStyle.textColor = labelStyle.color || '#fff'; - shape.highlightStyle.textAlign = labelStyle.align || 'center'; - shape.highlightStyle.textBaseline = labelStyle.baseline || 'middle'; - shape.highlightStyle.textFont = this.getFont(labelStyle); - } - - // 拖拽特性 - if (this.deepQuery(queryTarget, 'draggable')) { - this.setCalculable(shape); - shape.dragEnableTime = 0; - shape.draggable = true; - shape.ondragstart = this.shapeHandler.ondragstart; - shape.ondragover = null; - } - - var categoryName = ''; - if (typeof(node.category) !== 'undefined') { - var category = categories[node.category]; - categoryName = (category && category.name) || ''; - } - // !!Pack data before addShape - ecData.pack( - shape, - // category - { - name : categoryName - }, - // series index - 0, - // data - node, - // data index - zrUtil.indexOf(this._rawNodes, node), - // name - node.name || '', - // value - node.value - ); - - this._nodeShapes.push(shape); - this.shapeList.push(shape); - this.zr.addShape(shape); - } - }, - - _buildLinkShapes: function(serie) { - - var nodes = this._filteredNodes; - var links = this._filteredLinks; - var len = links.length; - - for (var i = 0; i < len; i++) { - var link = links[i]; - var source = nodes[link.source]; - var target = nodes[link.target]; - - var linkShape = new LineShape({ - style : { - xStart : 0, - yStart : 0, - xEnd : 0, - yEnd : 0, - lineWidth : 1 - }, - clickable : true, - highlightStyle : {} - }); - - zrUtil.merge( - linkShape.style, - this.query(serie, 'itemStyle.normal.linkStyle'), - true - ); - zrUtil.merge( - linkShape.highlightStyle, - this.query(serie, 'itemStyle.emphasis.linkStyle'), - true - ); - if (typeof(link.itemStyle) !== 'undefined') { - if(link.itemStyle.normal){ - zrUtil.merge(linkShape.style, link.itemStyle.normal, true); - } - if(link.itemStyle.emphasis){ - zrUtil.merge( - linkShape.highlightStyle, - link.itemStyle.emphasis, - true - ); - } - } - - var link = this._rawLinks[link.rawIndex]; - ecData.pack( - linkShape, - // serie - serie, - // serie index - 0, - // link data - { - source : link.source, - target : link.target, - weight : link.weight || 0 - }, - // link data index - link.rawIndex, - // source name - target name - source.name + ' - ' + target.name, - // link weight - link.weight || 0, - // special - // 这一项只是为了表明这是条边 - true - ); - - this._linkShapes.push(linkShape); - this.shapeList.push(linkShape); - this.zr.addShape(linkShape); - - // Arrow shape - if (serie.linkSymbol && serie.linkSymbol !== 'none') { - var symbolShape = new IconShape({ - style: { - x: -5, - y: 0, - width: serie.linkSymbolSize[0], - height: serie.linkSymbolSize[1], - iconType: serie.linkSymbol, - brushType: 'fill', - // Use same style with link shape - color: linkShape.style.strokeColor, - opacity: linkShape.style.opacity, - shadowBlur: linkShape.style.shadowBlur, - shadowColor: linkShape.style.shadowColor, - shadowOffsetX: linkShape.style.shadowOffsetX, - shadowOffsetY: linkShape.style.shadowOffsetY - }, - highlightStyle: { - brushType: 'fill' - }, - position: [0, 0], - rotation: 0 - }); - linkShape._symbolShape = symbolShape; - this.shapeList.push(symbolShape); - this.zr.addShape(symbolShape); - } - } - }, - - _updateLinkShapes: function() { - var v = vec2.create(); - var links = this._filteredLinks; - for (var i = 0, len = links.length; i < len; i++) { - var link = links[i]; - var linkShape = this._linkShapes[i]; - var sourceShape = this._nodeShapes[link.source]; - var targetShape = this._nodeShapes[link.target]; - - linkShape.style.xStart = sourceShape.position[0]; - linkShape.style.yStart = sourceShape.position[1]; - linkShape.style.xEnd = targetShape.position[0]; - linkShape.style.yEnd = targetShape.position[1]; - - this.zr.modShape(linkShape.id); - - if (linkShape._symbolShape) { - var symbolShape = linkShape._symbolShape; - vec2.copy(symbolShape.position, targetShape.position); - - vec2.sub(v, sourceShape.position, targetShape.position); - vec2.normalize(v, v); - - vec2.scaleAndAdd( - symbolShape.position, symbolShape.position, - v, targetShape.style.width / 2 + 2 - ); - - var angle; - if (v[1] < 0) { - angle = 2 * Math.PI - Math.acos(-v[0]); - } else { - angle = Math.acos(-v[0]); - } - symbolShape.rotation = angle - Math.PI / 2; - - this.zr.modShape(symbolShape.id); - } - } - }, - - _update: function(e) { - - this._layout.temperature = this._temperature; - this._layout.update(); - - for (var i = 0; i < this._layout.nodes.length; i++) { - var position = this._layout.nodes[i].position; - var shape = this._nodeShapes[i]; - var node = this._filteredNodes[i]; - if (shape.fixed || (node.fixX && node.fixY)) { - vec2.copy(position, shape.position); - } else if (node.fixX) { - position[0] = shape.position[0]; - shape.position[1] = position[1]; - } else if (node.fixY) { - position[1] = shape.position[1]; - shape.position[0] = position[0]; - } else { - vec2.copy(shape.position, position); - } - - var nodeName = node.name; - if (nodeName) { - var gPos = this.__nodePositionMap[nodeName]; - if (!gPos) { - gPos = this.__nodePositionMap[nodeName] = vec2.create(); - } - vec2.copy(gPos, position); - } - } - - this._temperature *= this._coolDown; - }, - - _updateWorker: function(e) { - if (!this._updating) { - return; - } - - var positionArr = new Float32Array(e.data); - var token = positionArr[0]; - var ret = token === this._token; - // If token is from current layout instance - if (ret) { - var nNodes = (positionArr.length - 1) / 2; - - for (var i = 0; i < nNodes; i++) { - var shape = this._nodeShapes[i]; - var node = this._filteredNodes[i]; - - var x = positionArr[i * 2 + 1]; - var y = positionArr[i * 2 + 2]; - - if (shape.fixed || (node.fixX && node.fixY)) { - positionArr[i * 2 + 1] = shape.position[0]; - positionArr[i * 2 + 2] = shape.position[1]; - } else if (node.fixX) { - positionArr[i * 2 + 1] = shape.position[0]; - shape.position[1] = y; - } else if (node.fixY) { - positionArr[i * 2 + 2] = shape.position[1]; - shape.position[0] = x; - } else { - shape.position[0] = x; - shape.position[1] = y; - } - - var nodeName = node.name; - if (nodeName) { - var gPos = this.__nodePositionMap[nodeName]; - if (!gPos) { - gPos = this.__nodePositionMap[nodeName] = vec2.create(); - } - vec2.copy(gPos, shape.position); - } - } - - this._layoutWorker.postMessage(positionArr.buffer, [positionArr.buffer]); - } - - var self = this; - self._layoutWorker.postMessage({ - cmd: 'update', - steps: this._steps, - temperature: this._temperature, - coolDown: this._coolDown - }); - - for (var i = 0; i < this._steps; i++) { - this._temperature *= this._coolDown; - } - - return ret; - }, - - _step: function(e){ - if (this._layoutWorker) { - var res = this._updateWorker(e); - if (!res) { - return; - } - } else { - if (this._temperature < 0.01) { - return; - } - this._update(); - } - - this._updateLinkShapes(); - - for (var i = 0; i < this._nodeShapes.length; i++) { - this.zr.modShape(this._nodeShapes[i].id); - } - - this.zr.refresh(); - }, - - refresh: function(newOption) { - if (newOption) { - this.option = newOption; - this.series = this.option.series; - } - this.clear(); - this._buildShape(); - }, - - dispose: function(){ - this._updating = false; - this.clear(); - this.shapeList = null; - this.effectList = null; - - if (this._layoutWorker) { - this._layoutWorker.terminate(); - } - this._layoutWorker = null; - - this.__nodePositionMap = {}; - } - }; - - /** - * 拖拽开始 - */ - function ondragstart(param) { - if (!this.isDragstart || !param.target) { - // 没有在当前实例上发生拖拽行为则直接返回 - return; - } - - var shape = param.target; - shape.fixed = true; - - // 处理完拖拽事件后复位 - this.isDragstart = false; - - this.zr.on(zrConfig.EVENT.MOUSEMOVE, this.onmousemove); - } - - function onmousemove() { - this._temperature = 0.8; - } - - /** - * 数据项被拖拽出去,重载基类方法 - */ - function ondragend(param, status) { - if (!this.isDragend || !param.target) { - // 没有在当前实例上发生拖拽行为则直接返回 - return; - } - var shape = param.target; - shape.fixed = false; - - // 别status = {}赋值啊!! - status.dragIn = true; - //你自己refresh的话把他设为false,设true就会重新调refresh接口 - status.needRefresh = false; - - // 处理完拖拽事件后复位 - this.isDragend = false; - - this.zr.un(zrConfig.EVENT.MOUSEMOVE, this.onmousemove); - } - - function _randomInSquare(x, y, size) { - return [ - (Math.random() - 0.5) * size + x, - (Math.random() - 0.5) * size + y - ]; - } - - function _filter(array, callback){ - var len = array.length; - var result = []; - for(var i = 0; i < len; i++){ - if(callback(array[i], i)){ - result.push(array[i]); - } - } - return result; - } - - zrUtil.inherits(Force, ChartBase); - zrUtil.inherits(Force, ComponentBase); - - // 图表注册 - require('../chart').define('force', Force); - - return Force; +// Copyright 2006 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +// Known Issues: +// +// * Patterns only support repeat. +// * Radial gradient are not implemented. The VML version of these look very +// different from the canvas one. +// * Clipping paths are not implemented. +// * Coordsize. The width and height attribute have higher priority than the +// width and height style values which isn't correct. +// * Painting mode isn't implemented. +// * Canvas width/height should is using content-box by default. IE in +// Quirks mode will draw the canvas using border-box. Either change your +// doctype to HTML5 +// (http://www.whatwg.org/specs/web-apps/current-work/#the-doctype) +// or use Box Sizing Behavior from WebFX +// (http://webfx.eae.net/dhtml/boxsizing/boxsizing.html) +// * Non uniform scaling does not correctly scale strokes. +// * Optimize. There is always room for speed improvements. + +// AMD by kener.linfeng@gmail.com +define('zrender/dep/excanvas',['require'],function(require) { + +// Only add this code if we do not already have a canvas implementation +if (!document.createElement('canvas').getContext) { + +(function() { + + // alias some functions to make (compiled) code shorter + var m = Math; + var mr = m.round; + var ms = m.sin; + var mc = m.cos; + var abs = m.abs; + var sqrt = m.sqrt; + + // this is used for sub pixel precision + var Z = 10; + var Z2 = Z / 2; + + var IE_VERSION = +navigator.userAgent.match(/MSIE ([\d.]+)?/)[1]; + + /** + * This funtion is assigned to the elements as element.getContext(). + * @this {HTMLElement} + * @return {CanvasRenderingContext2D_} + */ + function getContext() { + return this.context_ || + (this.context_ = new CanvasRenderingContext2D_(this)); + } + + var slice = Array.prototype.slice; + + /** + * Binds a function to an object. The returned function will always use the + * passed in {@code obj} as {@code this}. + * + * Example: + * + * g = bind(f, obj, a, b) + * g(c, d) // will do f.call(obj, a, b, c, d) + * + * @param {Function} f The function to bind the object to + * @param {Object} obj The object that should act as this when the function + * is called + * @param {*} var_args Rest arguments that will be used as the initial + * arguments when the function is called + * @return {Function} A new function that has bound this + */ + function bind(f, obj, var_args) { + var a = slice.call(arguments, 2); + return function() { + return f.apply(obj, a.concat(slice.call(arguments))); + }; + } + + function encodeHtmlAttribute(s) { + return String(s).replace(/&/g, '&').replace(/"/g, '"'); + } + + function addNamespace(doc, prefix, urn) { + if (!doc.namespaces[prefix]) { + doc.namespaces.add(prefix, urn, '#default#VML'); + } + } + + function addNamespacesAndStylesheet(doc) { + addNamespace(doc, 'g_vml_', 'urn:schemas-microsoft-com:vml'); + addNamespace(doc, 'g_o_', 'urn:schemas-microsoft-com:office:office'); + + // Setup default CSS. Only add one style sheet per document + if (!doc.styleSheets['ex_canvas_']) { + var ss = doc.createStyleSheet(); + ss.owningElement.id = 'ex_canvas_'; + ss.cssText = 'canvas{display:inline-block;overflow:hidden;' + + // default size is 300x150 in Gecko and Opera + 'text-align:left;width:300px;height:150px}'; + } + } + + // Add namespaces and stylesheet at startup. + addNamespacesAndStylesheet(document); + + var G_vmlCanvasManager_ = { + init: function(opt_doc) { + var doc = opt_doc || document; + // Create a dummy element so that IE will allow canvas elements to be + // recognized. + doc.createElement('canvas'); + doc.attachEvent('onreadystatechange', bind(this.init_, this, doc)); + }, + + init_: function(doc) { + // find all canvas elements + var els = doc.getElementsByTagName('canvas'); + for (var i = 0; i < els.length; i++) { + this.initElement(els[i]); + } + }, + + /** + * Public initializes a canvas element so that it can be used as canvas + * element from now on. This is called automatically before the page is + * loaded but if you are creating elements using createElement you need to + * make sure this is called on the element. + * @param {HTMLElement} el The canvas element to initialize. + * @return {HTMLElement} the element that was created. + */ + initElement: function(el) { + if (!el.getContext) { + el.getContext = getContext; + + // Add namespaces and stylesheet to document of the element. + addNamespacesAndStylesheet(el.ownerDocument); + + // Remove fallback content. There is no way to hide text nodes so we + // just remove all childNodes. We could hide all elements and remove + // text nodes but who really cares about the fallback content. + el.innerHTML = ''; + + // do not use inline function because that will leak memory + el.attachEvent('onpropertychange', onPropertyChange); + el.attachEvent('onresize', onResize); + + var attrs = el.attributes; + if (attrs.width && attrs.width.specified) { + // TODO: use runtimeStyle and coordsize + // el.getContext().setWidth_(attrs.width.nodeValue); + el.style.width = attrs.width.nodeValue + 'px'; + } else { + el.width = el.clientWidth; + } + if (attrs.height && attrs.height.specified) { + // TODO: use runtimeStyle and coordsize + // el.getContext().setHeight_(attrs.height.nodeValue); + el.style.height = attrs.height.nodeValue + 'px'; + } else { + el.height = el.clientHeight; + } + //el.getContext().setCoordsize_() + } + return el; + } + }; + + function onPropertyChange(e) { + var el = e.srcElement; + + switch (e.propertyName) { + case 'width': + el.getContext().clearRect(); + el.style.width = el.attributes.width.nodeValue + 'px'; + // In IE8 this does not trigger onresize. + el.firstChild.style.width = el.clientWidth + 'px'; + break; + case 'height': + el.getContext().clearRect(); + el.style.height = el.attributes.height.nodeValue + 'px'; + el.firstChild.style.height = el.clientHeight + 'px'; + break; + } + } + + function onResize(e) { + var el = e.srcElement; + if (el.firstChild) { + el.firstChild.style.width = el.clientWidth + 'px'; + el.firstChild.style.height = el.clientHeight + 'px'; + } + } + + G_vmlCanvasManager_.init(); + + // precompute "00" to "FF" + var decToHex = []; + for (var i = 0; i < 16; i++) { + for (var j = 0; j < 16; j++) { + decToHex[i * 16 + j] = i.toString(16) + j.toString(16); + } + } + + function createMatrixIdentity() { + return [ + [1, 0, 0], + [0, 1, 0], + [0, 0, 1] + ]; + } + + function matrixMultiply(m1, m2) { + var result = createMatrixIdentity(); + + for (var x = 0; x < 3; x++) { + for (var y = 0; y < 3; y++) { + var sum = 0; + + for (var z = 0; z < 3; z++) { + sum += m1[x][z] * m2[z][y]; + } + + result[x][y] = sum; + } + } + return result; + } + + function copyState(o1, o2) { + o2.fillStyle = o1.fillStyle; + o2.lineCap = o1.lineCap; + o2.lineJoin = o1.lineJoin; + o2.lineWidth = o1.lineWidth; + o2.miterLimit = o1.miterLimit; + o2.shadowBlur = o1.shadowBlur; + o2.shadowColor = o1.shadowColor; + o2.shadowOffsetX = o1.shadowOffsetX; + o2.shadowOffsetY = o1.shadowOffsetY; + o2.strokeStyle = o1.strokeStyle; + o2.globalAlpha = o1.globalAlpha; + o2.font = o1.font; + o2.textAlign = o1.textAlign; + o2.textBaseline = o1.textBaseline; + o2.arcScaleX_ = o1.arcScaleX_; + o2.arcScaleY_ = o1.arcScaleY_; + o2.lineScale_ = o1.lineScale_; + } + + var colorData = { + aliceblue: '#F0F8FF', + antiquewhite: '#FAEBD7', + aquamarine: '#7FFFD4', + azure: '#F0FFFF', + beige: '#F5F5DC', + bisque: '#FFE4C4', + black: '#000000', + blanchedalmond: '#FFEBCD', + blueviolet: '#8A2BE2', + brown: '#A52A2A', + burlywood: '#DEB887', + cadetblue: '#5F9EA0', + chartreuse: '#7FFF00', + chocolate: '#D2691E', + coral: '#FF7F50', + cornflowerblue: '#6495ED', + cornsilk: '#FFF8DC', + crimson: '#DC143C', + cyan: '#00FFFF', + darkblue: '#00008B', + darkcyan: '#008B8B', + darkgoldenrod: '#B8860B', + darkgray: '#A9A9A9', + darkgreen: '#006400', + darkgrey: '#A9A9A9', + darkkhaki: '#BDB76B', + darkmagenta: '#8B008B', + darkolivegreen: '#556B2F', + darkorange: '#FF8C00', + darkorchid: '#9932CC', + darkred: '#8B0000', + darksalmon: '#E9967A', + darkseagreen: '#8FBC8F', + darkslateblue: '#483D8B', + darkslategray: '#2F4F4F', + darkslategrey: '#2F4F4F', + darkturquoise: '#00CED1', + darkviolet: '#9400D3', + deeppink: '#FF1493', + deepskyblue: '#00BFFF', + dimgray: '#696969', + dimgrey: '#696969', + dodgerblue: '#1E90FF', + firebrick: '#B22222', + floralwhite: '#FFFAF0', + forestgreen: '#228B22', + gainsboro: '#DCDCDC', + ghostwhite: '#F8F8FF', + gold: '#FFD700', + goldenrod: '#DAA520', + grey: '#808080', + greenyellow: '#ADFF2F', + honeydew: '#F0FFF0', + hotpink: '#FF69B4', + indianred: '#CD5C5C', + indigo: '#4B0082', + ivory: '#FFFFF0', + khaki: '#F0E68C', + lavender: '#E6E6FA', + lavenderblush: '#FFF0F5', + lawngreen: '#7CFC00', + lemonchiffon: '#FFFACD', + lightblue: '#ADD8E6', + lightcoral: '#F08080', + lightcyan: '#E0FFFF', + lightgoldenrodyellow: '#FAFAD2', + lightgreen: '#90EE90', + lightgrey: '#D3D3D3', + lightpink: '#FFB6C1', + lightsalmon: '#FFA07A', + lightseagreen: '#20B2AA', + lightskyblue: '#87CEFA', + lightslategray: '#778899', + lightslategrey: '#778899', + lightsteelblue: '#B0C4DE', + lightyellow: '#FFFFE0', + limegreen: '#32CD32', + linen: '#FAF0E6', + magenta: '#FF00FF', + mediumaquamarine: '#66CDAA', + mediumblue: '#0000CD', + mediumorchid: '#BA55D3', + mediumpurple: '#9370DB', + mediumseagreen: '#3CB371', + mediumslateblue: '#7B68EE', + mediumspringgreen: '#00FA9A', + mediumturquoise: '#48D1CC', + mediumvioletred: '#C71585', + midnightblue: '#191970', + mintcream: '#F5FFFA', + mistyrose: '#FFE4E1', + moccasin: '#FFE4B5', + navajowhite: '#FFDEAD', + oldlace: '#FDF5E6', + olivedrab: '#6B8E23', + orange: '#FFA500', + orangered: '#FF4500', + orchid: '#DA70D6', + palegoldenrod: '#EEE8AA', + palegreen: '#98FB98', + paleturquoise: '#AFEEEE', + palevioletred: '#DB7093', + papayawhip: '#FFEFD5', + peachpuff: '#FFDAB9', + peru: '#CD853F', + pink: '#FFC0CB', + plum: '#DDA0DD', + powderblue: '#B0E0E6', + rosybrown: '#BC8F8F', + royalblue: '#4169E1', + saddlebrown: '#8B4513', + salmon: '#FA8072', + sandybrown: '#F4A460', + seagreen: '#2E8B57', + seashell: '#FFF5EE', + sienna: '#A0522D', + skyblue: '#87CEEB', + slateblue: '#6A5ACD', + slategray: '#708090', + slategrey: '#708090', + snow: '#FFFAFA', + springgreen: '#00FF7F', + steelblue: '#4682B4', + tan: '#D2B48C', + thistle: '#D8BFD8', + tomato: '#FF6347', + turquoise: '#40E0D0', + violet: '#EE82EE', + wheat: '#F5DEB3', + whitesmoke: '#F5F5F5', + yellowgreen: '#9ACD32' + }; + + + function getRgbHslContent(styleString) { + var start = styleString.indexOf('(', 3); + var end = styleString.indexOf(')', start + 1); + var parts = styleString.substring(start + 1, end).split(','); + // add alpha if needed + if (parts.length != 4 || styleString.charAt(3) != 'a') { + parts[3] = 1; + } + return parts; + } + + function percent(s) { + return parseFloat(s) / 100; + } + + function clamp(v, min, max) { + return Math.min(max, Math.max(min, v)); + } + + function hslToRgb(parts){ + var r, g, b, h, s, l; + h = parseFloat(parts[0]) / 360 % 360; + if (h < 0) + h++; + s = clamp(percent(parts[1]), 0, 1); + l = clamp(percent(parts[2]), 0, 1); + if (s == 0) { + r = g = b = l; // achromatic + } else { + var q = l < 0.5 ? l * (1 + s) : l + s - l * s; + var p = 2 * l - q; + r = hueToRgb(p, q, h + 1 / 3); + g = hueToRgb(p, q, h); + b = hueToRgb(p, q, h - 1 / 3); + } + + return '#' + decToHex[Math.floor(r * 255)] + + decToHex[Math.floor(g * 255)] + + decToHex[Math.floor(b * 255)]; + } + + function hueToRgb(m1, m2, h) { + if (h < 0) + h++; + if (h > 1) + h--; + + if (6 * h < 1) + return m1 + (m2 - m1) * 6 * h; + else if (2 * h < 1) + return m2; + else if (3 * h < 2) + return m1 + (m2 - m1) * (2 / 3 - h) * 6; + else + return m1; + } + + var processStyleCache = {}; + + function processStyle(styleString) { + if (styleString in processStyleCache) { + return processStyleCache[styleString]; + } + + var str, alpha = 1; + + styleString = String(styleString); + if (styleString.charAt(0) == '#') { + str = styleString; + } else if (/^rgb/.test(styleString)) { + var parts = getRgbHslContent(styleString); + var str = '#', n; + for (var i = 0; i < 3; i++) { + if (parts[i].indexOf('%') != -1) { + n = Math.floor(percent(parts[i]) * 255); + } else { + n = +parts[i]; + } + str += decToHex[clamp(n, 0, 255)]; + } + alpha = +parts[3]; + } else if (/^hsl/.test(styleString)) { + var parts = getRgbHslContent(styleString); + str = hslToRgb(parts); + alpha = parts[3]; + } else { + str = colorData[styleString] || styleString; + } + return processStyleCache[styleString] = {color: str, alpha: alpha}; + } + + var DEFAULT_STYLE = { + style: 'normal', + variant: 'normal', + weight: 'normal', + size: 12, //10 + family: '微软雅黑' //'sans-serif' + }; + + // Internal text style cache + var fontStyleCache = {}; + + function processFontStyle(styleString) { + if (fontStyleCache[styleString]) { + return fontStyleCache[styleString]; + } + + var el = document.createElement('div'); + var style = el.style; + var fontFamily; + try { + style.font = styleString; + fontFamily = style.fontFamily.split(',')[0]; + } catch (ex) { + // Ignore failures to set to invalid font. + } + + return fontStyleCache[styleString] = { + style: style.fontStyle || DEFAULT_STYLE.style, + variant: style.fontVariant || DEFAULT_STYLE.variant, + weight: style.fontWeight || DEFAULT_STYLE.weight, + size: style.fontSize || DEFAULT_STYLE.size, + family: fontFamily || DEFAULT_STYLE.family + }; + } + + function getComputedStyle(style, element) { + var computedStyle = {}; + + for (var p in style) { + computedStyle[p] = style[p]; + } + + // Compute the size + var canvasFontSize = parseFloat(element.currentStyle.fontSize), + fontSize = parseFloat(style.size); + + if (typeof style.size == 'number') { + computedStyle.size = style.size; + } else if (style.size.indexOf('px') != -1) { + computedStyle.size = fontSize; + } else if (style.size.indexOf('em') != -1) { + computedStyle.size = canvasFontSize * fontSize; + } else if(style.size.indexOf('%') != -1) { + computedStyle.size = (canvasFontSize / 100) * fontSize; + } else if (style.size.indexOf('pt') != -1) { + computedStyle.size = fontSize / .75; + } else { + computedStyle.size = canvasFontSize; + } + + // Different scaling between normal text and VML text. This was found using + // trial and error to get the same size as non VML text. + //computedStyle.size *= 0.981; + + return computedStyle; + } + + function buildStyle(style) { + return style.style + ' ' + style.variant + ' ' + style.weight + ' ' + + style.size + "px '" + style.family + "'"; + } + + var lineCapMap = { + 'butt': 'flat', + 'round': 'round' + }; + + function processLineCap(lineCap) { + return lineCapMap[lineCap] || 'square'; + } + + /** + * This class implements CanvasRenderingContext2D interface as described by + * the WHATWG. + * @param {HTMLElement} canvasElement The element that the 2D context should + * be associated with + */ + function CanvasRenderingContext2D_(canvasElement) { + this.m_ = createMatrixIdentity(); + + this.mStack_ = []; + this.aStack_ = []; + this.currentPath_ = []; + + // Canvas context properties + this.strokeStyle = '#000'; + this.fillStyle = '#000'; + + this.lineWidth = 1; + this.lineJoin = 'miter'; + this.lineCap = 'butt'; + this.miterLimit = Z * 1; + this.globalAlpha = 1; + // this.font = '10px sans-serif'; + this.font = '12px 微软雅黑'; // 决定还是改这吧,影响代价最小 + this.textAlign = 'left'; + this.textBaseline = 'alphabetic'; + this.canvas = canvasElement; + + var cssText = 'width:' + canvasElement.clientWidth + 'px;height:' + + canvasElement.clientHeight + 'px;overflow:hidden;position:absolute'; + var el = canvasElement.ownerDocument.createElement('div'); + el.style.cssText = cssText; + canvasElement.appendChild(el); + + var overlayEl = el.cloneNode(false); + // Use a non transparent background. + overlayEl.style.backgroundColor = '#fff'; //red, I don't know why, it work! + overlayEl.style.filter = 'alpha(opacity=0)'; + canvasElement.appendChild(overlayEl); + + this.element_ = el; + this.arcScaleX_ = 1; + this.arcScaleY_ = 1; + this.lineScale_ = 1; + } + + var contextPrototype = CanvasRenderingContext2D_.prototype; + contextPrototype.clearRect = function() { + if (this.textMeasureEl_) { + this.textMeasureEl_.removeNode(true); + this.textMeasureEl_ = null; + } + this.element_.innerHTML = ''; + }; + + contextPrototype.beginPath = function() { + // TODO: Branch current matrix so that save/restore has no effect + // as per safari docs. + this.currentPath_ = []; + }; + + contextPrototype.moveTo = function(aX, aY) { + var p = getCoords(this, aX, aY); + this.currentPath_.push({type: 'moveTo', x: p.x, y: p.y}); + this.currentX_ = p.x; + this.currentY_ = p.y; + }; + + contextPrototype.lineTo = function(aX, aY) { + var p = getCoords(this, aX, aY); + this.currentPath_.push({type: 'lineTo', x: p.x, y: p.y}); + + this.currentX_ = p.x; + this.currentY_ = p.y; + }; + + contextPrototype.bezierCurveTo = function(aCP1x, aCP1y, + aCP2x, aCP2y, + aX, aY) { + var p = getCoords(this, aX, aY); + var cp1 = getCoords(this, aCP1x, aCP1y); + var cp2 = getCoords(this, aCP2x, aCP2y); + bezierCurveTo(this, cp1, cp2, p); + }; + + // Helper function that takes the already fixed cordinates. + function bezierCurveTo(self, cp1, cp2, p) { + self.currentPath_.push({ + type: 'bezierCurveTo', + cp1x: cp1.x, + cp1y: cp1.y, + cp2x: cp2.x, + cp2y: cp2.y, + x: p.x, + y: p.y + }); + self.currentX_ = p.x; + self.currentY_ = p.y; + } + + contextPrototype.quadraticCurveTo = function(aCPx, aCPy, aX, aY) { + // the following is lifted almost directly from + // http://developer.mozilla.org/en/docs/Canvas_tutorial:Drawing_shapes + + var cp = getCoords(this, aCPx, aCPy); + var p = getCoords(this, aX, aY); + + var cp1 = { + x: this.currentX_ + 2.0 / 3.0 * (cp.x - this.currentX_), + y: this.currentY_ + 2.0 / 3.0 * (cp.y - this.currentY_) + }; + var cp2 = { + x: cp1.x + (p.x - this.currentX_) / 3.0, + y: cp1.y + (p.y - this.currentY_) / 3.0 + }; + + bezierCurveTo(this, cp1, cp2, p); + }; + + contextPrototype.arc = function(aX, aY, aRadius, + aStartAngle, aEndAngle, aClockwise) { + aRadius *= Z; + var arcType = aClockwise ? 'at' : 'wa'; + + var xStart = aX + mc(aStartAngle) * aRadius - Z2; + var yStart = aY + ms(aStartAngle) * aRadius - Z2; + + var xEnd = aX + mc(aEndAngle) * aRadius - Z2; + var yEnd = aY + ms(aEndAngle) * aRadius - Z2; + + // IE won't render arches drawn counter clockwise if xStart == xEnd. + if (xStart == xEnd && !aClockwise) { + xStart += 0.125; // Offset xStart by 1/80 of a pixel. Use something + // that can be represented in binary + } + + var p = getCoords(this, aX, aY); + var pStart = getCoords(this, xStart, yStart); + var pEnd = getCoords(this, xEnd, yEnd); + + this.currentPath_.push({type: arcType, + x: p.x, + y: p.y, + radius: aRadius, + xStart: pStart.x, + yStart: pStart.y, + xEnd: pEnd.x, + yEnd: pEnd.y}); + + }; + + contextPrototype.rect = function(aX, aY, aWidth, aHeight) { + this.moveTo(aX, aY); + this.lineTo(aX + aWidth, aY); + this.lineTo(aX + aWidth, aY + aHeight); + this.lineTo(aX, aY + aHeight); + this.closePath(); + }; + + contextPrototype.strokeRect = function(aX, aY, aWidth, aHeight) { + var oldPath = this.currentPath_; + this.beginPath(); + + this.moveTo(aX, aY); + this.lineTo(aX + aWidth, aY); + this.lineTo(aX + aWidth, aY + aHeight); + this.lineTo(aX, aY + aHeight); + this.closePath(); + this.stroke(); + + this.currentPath_ = oldPath; + }; + + contextPrototype.fillRect = function(aX, aY, aWidth, aHeight) { + var oldPath = this.currentPath_; + this.beginPath(); + + this.moveTo(aX, aY); + this.lineTo(aX + aWidth, aY); + this.lineTo(aX + aWidth, aY + aHeight); + this.lineTo(aX, aY + aHeight); + this.closePath(); + this.fill(); + + this.currentPath_ = oldPath; + }; + + contextPrototype.createLinearGradient = function(aX0, aY0, aX1, aY1) { + var gradient = new CanvasGradient_('gradient'); + gradient.x0_ = aX0; + gradient.y0_ = aY0; + gradient.x1_ = aX1; + gradient.y1_ = aY1; + return gradient; + }; + + contextPrototype.createRadialGradient = function(aX0, aY0, aR0, + aX1, aY1, aR1) { + var gradient = new CanvasGradient_('gradientradial'); + gradient.x0_ = aX0; + gradient.y0_ = aY0; + gradient.r0_ = aR0; + gradient.x1_ = aX1; + gradient.y1_ = aY1; + gradient.r1_ = aR1; + return gradient; + }; + + contextPrototype.drawImage = function(image, var_args) { + var dx, dy, dw, dh, sx, sy, sw, sh; + + // to find the original width we overide the width and height + var oldRuntimeWidth = image.runtimeStyle.width; + var oldRuntimeHeight = image.runtimeStyle.height; + image.runtimeStyle.width = 'auto'; + image.runtimeStyle.height = 'auto'; + + // get the original size + var w = image.width; + var h = image.height; + + // and remove overides + image.runtimeStyle.width = oldRuntimeWidth; + image.runtimeStyle.height = oldRuntimeHeight; + + if (arguments.length == 3) { + dx = arguments[1]; + dy = arguments[2]; + sx = sy = 0; + sw = dw = w; + sh = dh = h; + } else if (arguments.length == 5) { + dx = arguments[1]; + dy = arguments[2]; + dw = arguments[3]; + dh = arguments[4]; + sx = sy = 0; + sw = w; + sh = h; + } else if (arguments.length == 9) { + sx = arguments[1]; + sy = arguments[2]; + sw = arguments[3]; + sh = arguments[4]; + dx = arguments[5]; + dy = arguments[6]; + dw = arguments[7]; + dh = arguments[8]; + } else { + throw Error('Invalid number of arguments'); + } + + var d = getCoords(this, dx, dy); + + var w2 = sw / 2; + var h2 = sh / 2; + + var vmlStr = []; + + var W = 10; + var H = 10; + + var scaleX = scaleY = 1; + + // For some reason that I've now forgotten, using divs didn't work + vmlStr.push(' '); + + // Draw a special cropping div if needed + if (sx || sy) { + // Apply scales to width and height + vmlStr.push('
'); + } + + + // Apply scales to width and height + vmlStr.push('
'); + + // Close the crop div if necessary + if (sx || sy) vmlStr.push('
'); + + vmlStr.push('
'); + + this.element_.insertAdjacentHTML('BeforeEnd', vmlStr.join('')); + }; + + contextPrototype.stroke = function(aFill) { + var lineStr = []; + var lineOpen = false; + + var W = 10; + var H = 10; + + lineStr.push(''); + + if (!aFill) { + appendStroke(this, lineStr); + } else { + appendFill(this, lineStr, min, max); + } + + lineStr.push(''); + + this.element_.insertAdjacentHTML('beforeEnd', lineStr.join('')); + }; + + function appendStroke(ctx, lineStr) { + var a = processStyle(ctx.strokeStyle); + var color = a.color; + var opacity = a.alpha * ctx.globalAlpha; + var lineWidth = ctx.lineScale_ * ctx.lineWidth; + + // VML cannot correctly render a line if the width is less than 1px. + // In that case, we dilute the color to make the line look thinner. + if (lineWidth < 1) { + opacity *= lineWidth; + } + + lineStr.push( + '' + ); + } + + function appendFill(ctx, lineStr, min, max) { + var fillStyle = ctx.fillStyle; + var arcScaleX = ctx.arcScaleX_; + var arcScaleY = ctx.arcScaleY_; + var width = max.x - min.x; + var height = max.y - min.y; + if (fillStyle instanceof CanvasGradient_) { + // TODO: Gradients transformed with the transformation matrix. + var angle = 0; + var focus = {x: 0, y: 0}; + + // additional offset + var shift = 0; + // scale factor for offset + var expansion = 1; + + if (fillStyle.type_ == 'gradient') { + var x0 = fillStyle.x0_ / arcScaleX; + var y0 = fillStyle.y0_ / arcScaleY; + var x1 = fillStyle.x1_ / arcScaleX; + var y1 = fillStyle.y1_ / arcScaleY; + var p0 = getCoords(ctx, x0, y0); + var p1 = getCoords(ctx, x1, y1); + var dx = p1.x - p0.x; + var dy = p1.y - p0.y; + angle = Math.atan2(dx, dy) * 180 / Math.PI; + + // The angle should be a non-negative number. + if (angle < 0) { + angle += 360; + } + + // Very small angles produce an unexpected result because they are + // converted to a scientific notation string. + if (angle < 1e-6) { + angle = 0; + } + } else { + var p0 = getCoords(ctx, fillStyle.x0_, fillStyle.y0_); + focus = { + x: (p0.x - min.x) / width, + y: (p0.y - min.y) / height + }; + + width /= arcScaleX * Z; + height /= arcScaleY * Z; + var dimension = m.max(width, height); + shift = 2 * fillStyle.r0_ / dimension; + expansion = 2 * fillStyle.r1_ / dimension - shift; + } + + // We need to sort the color stops in ascending order by offset, + // otherwise IE won't interpret it correctly. + var stops = fillStyle.colors_; + stops.sort(function(cs1, cs2) { + return cs1.offset - cs2.offset; + }); + + var length = stops.length; + var color1 = stops[0].color; + var color2 = stops[length - 1].color; + var opacity1 = stops[0].alpha * ctx.globalAlpha; + var opacity2 = stops[length - 1].alpha * ctx.globalAlpha; + + var colors = []; + for (var i = 0; i < length; i++) { + var stop = stops[i]; + colors.push(stop.offset * expansion + shift + ' ' + stop.color); + } + + // When colors attribute is used, the meanings of opacity and o:opacity2 + // are reversed. + lineStr.push(''); + } else if (fillStyle instanceof CanvasPattern_) { + if (width && height) { + var deltaLeft = -min.x; + var deltaTop = -min.y; + lineStr.push(''); + } + } else { + var a = processStyle(ctx.fillStyle); + var color = a.color; + var opacity = a.alpha * ctx.globalAlpha; + lineStr.push(''); + } + } + + contextPrototype.fill = function() { + this.stroke(true); + }; + + contextPrototype.closePath = function() { + this.currentPath_.push({type: 'close'}); + }; + + function getCoords(ctx, aX, aY) { + var m = ctx.m_; + return { + x: Z * (aX * m[0][0] + aY * m[1][0] + m[2][0]) - Z2, + y: Z * (aX * m[0][1] + aY * m[1][1] + m[2][1]) - Z2 + }; + }; + + contextPrototype.save = function() { + var o = {}; + copyState(this, o); + this.aStack_.push(o); + this.mStack_.push(this.m_); + this.m_ = matrixMultiply(createMatrixIdentity(), this.m_); + }; + + contextPrototype.restore = function() { + if (this.aStack_.length) { + copyState(this.aStack_.pop(), this); + this.m_ = this.mStack_.pop(); + } + }; + + function matrixIsFinite(m) { + return isFinite(m[0][0]) && isFinite(m[0][1]) && + isFinite(m[1][0]) && isFinite(m[1][1]) && + isFinite(m[2][0]) && isFinite(m[2][1]); + } + + function setM(ctx, m, updateLineScale) { + if (!matrixIsFinite(m)) { + return; + } + ctx.m_ = m; + + if (updateLineScale) { + // Get the line scale. + // Determinant of this.m_ means how much the area is enlarged by the + // transformation. So its square root can be used as a scale factor + // for width. + var det = m[0][0] * m[1][1] - m[0][1] * m[1][0]; + ctx.lineScale_ = sqrt(abs(det)); + } + } + + contextPrototype.translate = function(aX, aY) { + var m1 = [ + [1, 0, 0], + [0, 1, 0], + [aX, aY, 1] + ]; + + setM(this, matrixMultiply(m1, this.m_), false); + }; + + contextPrototype.rotate = function(aRot) { + var c = mc(aRot); + var s = ms(aRot); + + var m1 = [ + [c, s, 0], + [-s, c, 0], + [0, 0, 1] + ]; + + setM(this, matrixMultiply(m1, this.m_), false); + }; + + contextPrototype.scale = function(aX, aY) { + this.arcScaleX_ *= aX; + this.arcScaleY_ *= aY; + var m1 = [ + [aX, 0, 0], + [0, aY, 0], + [0, 0, 1] + ]; + + setM(this, matrixMultiply(m1, this.m_), true); + }; + + contextPrototype.transform = function(m11, m12, m21, m22, dx, dy) { + var m1 = [ + [m11, m12, 0], + [m21, m22, 0], + [dx, dy, 1] + ]; + + setM(this, matrixMultiply(m1, this.m_), true); + }; + + contextPrototype.setTransform = function(m11, m12, m21, m22, dx, dy) { + var m = [ + [m11, m12, 0], + [m21, m22, 0], + [dx, dy, 1] + ]; + + setM(this, m, true); + }; + + /** + * The text drawing function. + * The maxWidth argument isn't taken in account, since no browser supports + * it yet. + */ + contextPrototype.drawText_ = function(text, x, y, maxWidth, stroke) { + var m = this.m_, + delta = 1000, + left = 0, + right = delta, + offset = {x: 0, y: 0}, + lineStr = []; + + var fontStyle = getComputedStyle(processFontStyle(this.font), + this.element_); + + var fontStyleString = buildStyle(fontStyle); + + var elementStyle = this.element_.currentStyle; + var textAlign = this.textAlign.toLowerCase(); + switch (textAlign) { + case 'left': + case 'center': + case 'right': + break; + case 'end': + textAlign = elementStyle.direction == 'ltr' ? 'right' : 'left'; + break; + case 'start': + textAlign = elementStyle.direction == 'rtl' ? 'right' : 'left'; + break; + default: + textAlign = 'left'; + } + + // 1.75 is an arbitrary number, as there is no info about the text baseline + switch (this.textBaseline) { + case 'hanging': + case 'top': + offset.y = fontStyle.size / 1.75; + break; + case 'middle': + break; + default: + case null: + case 'alphabetic': + case 'ideographic': + case 'bottom': + offset.y = -fontStyle.size / 2.25; + break; + } + + switch(textAlign) { + case 'right': + left = delta; + right = 0.05; + break; + case 'center': + left = right = delta / 2; + break; + } + + var d = getCoords(this, x + offset.x, y + offset.y); + + lineStr.push(''); + + if (stroke) { + appendStroke(this, lineStr); + } else { + // TODO: Fix the min and max params. + appendFill(this, lineStr, {x: -left, y: 0}, + {x: right, y: fontStyle.size}); + } + + var skewM = m[0][0].toFixed(3) + ',' + m[1][0].toFixed(3) + ',' + + m[0][1].toFixed(3) + ',' + m[1][1].toFixed(3) + ',0,0'; + + var skewOffset = mr(d.x / Z) + ',' + mr(d.y / Z); + + lineStr.push('', + '', + ''); + + this.element_.insertAdjacentHTML('beforeEnd', lineStr.join('')); + }; + + contextPrototype.fillText = function(text, x, y, maxWidth) { + this.drawText_(text, x, y, maxWidth, false); + }; + + contextPrototype.strokeText = function(text, x, y, maxWidth) { + this.drawText_(text, x, y, maxWidth, true); + }; + + contextPrototype.measureText = function(text) { + if (!this.textMeasureEl_) { + var s = ''; + this.element_.insertAdjacentHTML('beforeEnd', s); + this.textMeasureEl_ = this.element_.lastChild; + } + var doc = this.element_.ownerDocument; + this.textMeasureEl_.innerHTML = ''; + this.textMeasureEl_.style.font = this.font; + // Don't use innerHTML or innerText because they allow markup/whitespace. + this.textMeasureEl_.appendChild(doc.createTextNode(text)); + return {width: this.textMeasureEl_.offsetWidth}; + }; + + /******** STUBS ********/ + contextPrototype.clip = function() { + // TODO: Implement + }; + + contextPrototype.arcTo = function() { + // TODO: Implement + }; + + contextPrototype.createPattern = function(image, repetition) { + return new CanvasPattern_(image, repetition); + }; + + // Gradient / Pattern Stubs + function CanvasGradient_(aType) { + this.type_ = aType; + this.x0_ = 0; + this.y0_ = 0; + this.r0_ = 0; + this.x1_ = 0; + this.y1_ = 0; + this.r1_ = 0; + this.colors_ = []; + } + + CanvasGradient_.prototype.addColorStop = function(aOffset, aColor) { + aColor = processStyle(aColor); + this.colors_.push({offset: aOffset, + color: aColor.color, + alpha: aColor.alpha}); + }; + + function CanvasPattern_(image, repetition) { + assertImageIsValid(image); + switch (repetition) { + case 'repeat': + case null: + case '': + this.repetition_ = 'repeat'; + break + case 'repeat-x': + case 'repeat-y': + case 'no-repeat': + this.repetition_ = repetition; + break; + default: + throwException('SYNTAX_ERR'); + } + + this.src_ = image.src; + this.width_ = image.width; + this.height_ = image.height; + } + + function throwException(s) { + throw new DOMException_(s); + } + + function assertImageIsValid(img) { + if (!img || img.nodeType != 1 || img.tagName != 'IMG') { + throwException('TYPE_MISMATCH_ERR'); + } + if (img.readyState != 'complete') { + throwException('INVALID_STATE_ERR'); + } + } + + function DOMException_(s) { + this.code = this[s]; + this.message = s +': DOM Exception ' + this.code; + } + var p = DOMException_.prototype = new Error; + p.INDEX_SIZE_ERR = 1; + p.DOMSTRING_SIZE_ERR = 2; + p.HIERARCHY_REQUEST_ERR = 3; + p.WRONG_DOCUMENT_ERR = 4; + p.INVALID_CHARACTER_ERR = 5; + p.NO_DATA_ALLOWED_ERR = 6; + p.NO_MODIFICATION_ALLOWED_ERR = 7; + p.NOT_FOUND_ERR = 8; + p.NOT_SUPPORTED_ERR = 9; + p.INUSE_ATTRIBUTE_ERR = 10; + p.INVALID_STATE_ERR = 11; + p.SYNTAX_ERR = 12; + p.INVALID_MODIFICATION_ERR = 13; + p.NAMESPACE_ERR = 14; + p.INVALID_ACCESS_ERR = 15; + p.VALIDATION_ERR = 16; + p.TYPE_MISMATCH_ERR = 17; + + // set up externs + G_vmlCanvasManager = G_vmlCanvasManager_; + CanvasRenderingContext2D = CanvasRenderingContext2D_; + CanvasGradient = CanvasGradient_; + CanvasPattern = CanvasPattern_; + DOMException = DOMException_; +})(); + +} // if +else { // make the canvas test simple by kener.linfeng@gmail.com + G_vmlCanvasManager = false; +} +return G_vmlCanvasManager; +}); // define; +/** + * zrender: 公共辅助函数 + * + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + * clone:深度克隆 + * merge:合并源对象的属性到目标对象 + * getContext:获取一个自由使用的canvas 2D context,使用原生方法,如isPointInPath,measureText等 + */ +define( + 'zrender/tool/util',['require','../dep/excanvas'],function(require) { + // 用于处理merge时无法遍历Date等对象的问题 + var BUILTIN_OBJECT = { + '[object Function]': 1, + '[object RegExp]': 1, + '[object Date]': 1, + '[object Error]': 1, + '[object CanvasGradient]': 1 + }; + + /** + * 对一个object进行深度拷贝 + * + * @param {Any} source 需要进行拷贝的对象 + * @return {Any} 拷贝后的新对象 + */ + function clone(source) { + if (typeof source == 'object' && source !== null) { + var result = source; + if (source instanceof Array) { + result = []; + for (var i = 0, len = source.length; i < len; i++) { + result[i] = clone(source[i]); + } + } + else if (!BUILTIN_OBJECT[Object.prototype.toString.call(source)]) { + result = {}; + for (var key in source) { + if (source.hasOwnProperty(key)) { + result[key] = clone(source[key]); + } + } + } + + return result; + } + + return source; + } + + function mergeItem(target, source, key, overwrite) { + if (source.hasOwnProperty(key)) { + if (typeof target[key] == 'object' + && !BUILTIN_OBJECT[ Object.prototype.toString.call(target[key]) ] + ) { + // 如果需要递归覆盖,就递归调用merge + merge( + target[key], + source[key], + overwrite + ); + } + else if (overwrite || !(key in target)) { + // 否则只处理overwrite为true,或者在目标对象中没有此属性的情况 + target[key] = source[key]; + } + } + } + + /** + * 合并源对象的属性到目标对象 + * modify from Tangram + * @param {*} target 目标对象 + * @param {*} source 源对象 + * @param {boolean} overwrite 是否覆盖 + */ + function merge(target, source, overwrite) { + for (var i in source) { + mergeItem(target, source, i, overwrite); + } + + return target; + } + + var _ctx; + + function getContext() { + if (!_ctx) { + require('../dep/excanvas'); + /* jshint ignore:start */ + if (G_vmlCanvasManager) { + var _div = document.createElement('div'); + _div.style.position = 'absolute'; + _div.style.top = '-1000px'; + document.body.appendChild(_div); + + _ctx = G_vmlCanvasManager.initElement(_div) + .getContext('2d'); + } + else { + _ctx = document.createElement('canvas').getContext('2d'); + } + /* jshint ignore:end */ + } + return _ctx; + } + + var _canvas; + var _pixelCtx; + var _width; + var _height; + var _offsetX = 0; + var _offsetY = 0; + + /** + * 获取像素拾取专用的上下文 + * @return {Object} 上下文 + */ + function getPixelContext() { + if (!_pixelCtx) { + _canvas = document.createElement('canvas'); + _width = _canvas.width; + _height = _canvas.height; + _pixelCtx = _canvas.getContext('2d'); + } + return _pixelCtx; + } + + /** + * 如果坐标处在_canvas外部,改变_canvas的大小 + * @param {number} x : 横坐标 + * @param {number} y : 纵坐标 + * 注意 修改canvas的大小 需要重新设置translate + */ + function adjustCanvasSize(x, y) { + // 每次加的长度 + var _v = 100; + var _flag; + + if (x + _offsetX > _width) { + _width = x + _offsetX + _v; + _canvas.width = _width; + _flag = true; + } + + if (y + _offsetY > _height) { + _height = y + _offsetY + _v; + _canvas.height = _height; + _flag = true; + } + + if (x < -_offsetX) { + _offsetX = Math.ceil(-x / _v) * _v; + _width += _offsetX; + _canvas.width = _width; + _flag = true; + } + + if (y < -_offsetY) { + _offsetY = Math.ceil(-y / _v) * _v; + _height += _offsetY; + _canvas.height = _height; + _flag = true; + } + + if (_flag) { + _pixelCtx.translate(_offsetX, _offsetY); + } + } + + /** + * 获取像素canvas的偏移量 + * @return {Object} 偏移量 + */ + function getPixelOffset() { + return { + x : _offsetX, + y : _offsetY + }; + } + + /** + * 查询数组中元素的index + */ + function indexOf(array, value) { + if (array.indexOf) { + return array.indexOf(value); + } + for (var i = 0, len = array.length; i < len; i++) { + if (array[i] === value) { + return i; + } + } + return -1; + } + + /** + * 构造类继承关系 + * + * @param {Function} clazz 源类 + * @param {Function} baseClazz 基类 + */ + function inherits(clazz, baseClazz) { + var clazzPrototype = clazz.prototype; + function F() {} + F.prototype = baseClazz.prototype; + clazz.prototype = new F(); + + for (var prop in clazzPrototype) { + clazz.prototype[prop] = clazzPrototype[prop]; + } + clazz.constructor = clazz; + } + + return { + inherits: inherits, + clone : clone, + merge : merge, + getContext : getContext, + getPixelContext : getPixelContext, + getPixelOffset : getPixelOffset, + adjustCanvasSize : adjustCanvasSize, + indexOf : indexOf + }; + } +); + +/** + * 事件扩展 + * @module zrender/mixin/Eventful + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * pissang (https://www.github.com/pissang) + */ +define('zrender/mixin/Eventful',['require'],function (require) { + + /** + * 事件分发器 + * @alias module:zrender/mixin/Eventful + * @constructor + */ + var Eventful = function () { + this._handlers = {}; + }; + /** + * 单次触发绑定,dispatch后销毁 + * + * @param {string} event 事件名 + * @param {Function} handler 响应函数 + * @param {Object} context + */ + Eventful.prototype.one = function (event, handler, context) { + var _h = this._handlers; + + if (!handler || !event) { + return this; + } + + if (!_h[event]) { + _h[event] = []; + } + + _h[event].push({ + h : handler, + one : true, + ctx: context || this + }); + + return this; + }; + + /** + * 绑定事件 + * @param {string} event 事件名 + * @param {Function} handler 事件处理函数 + * @param {Object} context + */ + Eventful.prototype.bind = function (event, handler, context) { + var _h = this._handlers; + + if (!handler || !event) { + return this; + } + + if (!_h[event]) { + _h[event] = []; + } + + _h[event].push({ + h : handler, + one : false, + ctx: context || this + }); + + return this; + }; + + /** + * 解绑事件 + * @param {string} event 事件名 + * @param {Function} [handler] 事件处理函数 + */ + Eventful.prototype.unbind = function (event, handler) { + var _h = this._handlers; + + if (!event) { + this._handlers = {}; + return this; + } + + if (handler) { + if (_h[event]) { + var newList = []; + for (var i = 0, l = _h[event].length; i < l; i++) { + if (_h[event][i]['h'] != handler) { + newList.push(_h[event][i]); + } + } + _h[event] = newList; + } + + if (_h[event] && _h[event].length === 0) { + delete _h[event]; + } + } + else { + delete _h[event]; + } + + return this; + }; + + /** + * 事件分发 + * + * @param {string} type 事件类型 + */ + Eventful.prototype.dispatch = function (type) { + if (this._handlers[type]) { + var args = arguments; + var argLen = args.length; + + if (argLen > 3) { + args = Array.prototype.slice.call(args, 1); + } + + var _h = this._handlers[type]; + var len = _h.length; + for (var i = 0; i < len;) { + // Optimize advise from backbone + switch (argLen) { + case 1: + _h[i]['h'].call(_h[i]['ctx']); + break; + case 2: + _h[i]['h'].call(_h[i]['ctx'], args[1]); + break; + case 3: + _h[i]['h'].call(_h[i]['ctx'], args[1], args[2]); + break; + default: + // have more than 2 given arguments + _h[i]['h'].apply(_h[i]['ctx'], args); + break; + } + + if (_h[i]['one']) { + _h.splice(i, 1); + len--; + } + else { + i++; + } + } + } + + return this; + }; + + /** + * 带有context的事件分发, 最后一个参数是事件回调的context + * @param {string} type 事件类型 + */ + Eventful.prototype.dispatchWithContext = function (type) { + if (this._handlers[type]) { + var args = arguments; + var argLen = args.length; + + if (argLen > 4) { + args = Array.prototype.slice.call(args, 1, args.length - 1); + } + var ctx = args[args.length - 1]; + + var _h = this._handlers[type]; + var len = _h.length; + for (var i = 0; i < len;) { + // Optimize advise from backbone + switch (argLen) { + case 1: + _h[i]['h'].call(ctx); + break; + case 2: + _h[i]['h'].call(ctx, args[1]); + break; + case 3: + _h[i]['h'].call(ctx, args[1], args[2]); + break; + default: + // have more than 2 given arguments + _h[i]['h'].apply(ctx, args); + break; + } + + if (_h[i]['one']) { + _h.splice(i, 1); + len--; + } + else { + i++; + } + } + } + + return this; + }; + + // 对象可以通过 onxxxx 绑定事件 + /** + * @event module:zrender/mixin/Eventful#onclick + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#onmouseover + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#onmouseout + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#onmousemove + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#onmousewheel + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#onmousedown + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#onmouseup + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#ondragstart + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#ondragend + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#ondragenter + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#ondragleave + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#ondragover + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#ondrop + * @type {Function} + * @default null + */ + + return Eventful; +}); + +/** + * 事件辅助类 + * @module zrender/tool/event + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + */ +define( + 'zrender/tool/event',['require','../mixin/Eventful'],function(require) { + + + + var Eventful = require('../mixin/Eventful'); + + /** + * 提取鼠标(手指)x坐标 + * @memberOf module:zrender/tool/event + * @param {Event} e 事件. + * @return {number} 鼠标(手指)x坐标. + */ + function getX(e) { + return typeof e.zrenderX != 'undefined' && e.zrenderX + || typeof e.offsetX != 'undefined' && e.offsetX + || typeof e.layerX != 'undefined' && e.layerX + || typeof e.clientX != 'undefined' && e.clientX; + } + + /** + * 提取鼠标y坐标 + * @memberOf module:zrender/tool/event + * @param {Event} e 事件. + * @return {number} 鼠标(手指)y坐标. + */ + function getY(e) { + return typeof e.zrenderY != 'undefined' && e.zrenderY + || typeof e.offsetY != 'undefined' && e.offsetY + || typeof e.layerY != 'undefined' && e.layerY + || typeof e.clientY != 'undefined' && e.clientY; + } + + /** + * 提取鼠标滚轮变化 + * @memberOf module:zrender/tool/event + * @param {Event} e 事件. + * @return {number} 滚轮变化,正值说明滚轮是向上滚动,如果是负值说明滚轮是向下滚动 + */ + function getDelta(e) { + return typeof e.zrenderDelta != 'undefined' && e.zrenderDelta + || typeof e.wheelDelta != 'undefined' && e.wheelDelta + || typeof e.detail != 'undefined' && -e.detail; + } + + /** + * 停止冒泡和阻止默认行为 + * @memberOf module:zrender/tool/event + * @method + * @param {Event} e : event对象 + */ + var stop = typeof window.addEventListener === 'function' + ? function (e) { + e.preventDefault(); + e.stopPropagation(); + e.cancelBubble = true; + } + : function (e) { + e.returnValue = false; + e.cancelBubble = true; + }; + + return { + getX : getX, + getY : getY, + getDelta : getDelta, + stop : stop, + // 做向上兼容 + Dispatcher : Eventful + }; + } +); + +/** + * echarts设备环境识别 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author firede[firede@firede.us] + * @desc thanks zepto. + */ +define('zrender/tool/env',[],function() { + // Zepto.js + // (c) 2010-2013 Thomas Fuchs + // Zepto.js may be freely distributed under the MIT license. + + function detect(ua) { + var os = this.os = {}; + var browser = this.browser = {}; + var webkit = ua.match(/Web[kK]it[\/]{0,1}([\d.]+)/); + var android = ua.match(/(Android);?[\s\/]+([\d.]+)?/); + var ipad = ua.match(/(iPad).*OS\s([\d_]+)/); + var ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/); + var iphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/); + var webos = ua.match(/(webOS|hpwOS)[\s\/]([\d.]+)/); + var touchpad = webos && ua.match(/TouchPad/); + var kindle = ua.match(/Kindle\/([\d.]+)/); + var silk = ua.match(/Silk\/([\d._]+)/); + var blackberry = ua.match(/(BlackBerry).*Version\/([\d.]+)/); + var bb10 = ua.match(/(BB10).*Version\/([\d.]+)/); + var rimtabletos = ua.match(/(RIM\sTablet\sOS)\s([\d.]+)/); + var playbook = ua.match(/PlayBook/); + var chrome = ua.match(/Chrome\/([\d.]+)/) || ua.match(/CriOS\/([\d.]+)/); + var firefox = ua.match(/Firefox\/([\d.]+)/); + var ie = ua.match(/MSIE ([\d.]+)/); + var safari = webkit && ua.match(/Mobile\//) && !chrome; + var webview = ua.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/) && !chrome; + var ie = ua.match(/MSIE\s([\d.]+)/); + + // Todo: clean this up with a better OS/browser seperation: + // - discern (more) between multiple browsers on android + // - decide if kindle fire in silk mode is android or not + // - Firefox on Android doesn't specify the Android version + // - possibly devide in os, device and browser hashes + + if (browser.webkit = !!webkit) browser.version = webkit[1]; + + if (android) os.android = true, os.version = android[2]; + if (iphone && !ipod) os.ios = os.iphone = true, os.version = iphone[2].replace(/_/g, '.'); + if (ipad) os.ios = os.ipad = true, os.version = ipad[2].replace(/_/g, '.'); + if (ipod) os.ios = os.ipod = true, os.version = ipod[3] ? ipod[3].replace(/_/g, '.') : null; + if (webos) os.webos = true, os.version = webos[2]; + if (touchpad) os.touchpad = true; + if (blackberry) os.blackberry = true, os.version = blackberry[2]; + if (bb10) os.bb10 = true, os.version = bb10[2]; + if (rimtabletos) os.rimtabletos = true, os.version = rimtabletos[2]; + if (playbook) browser.playbook = true; + if (kindle) os.kindle = true, os.version = kindle[1]; + if (silk) browser.silk = true, browser.version = silk[1]; + if (!silk && os.android && ua.match(/Kindle Fire/)) browser.silk = true; + if (chrome) browser.chrome = true, browser.version = chrome[1]; + if (firefox) browser.firefox = true, browser.version = firefox[1]; + if (ie) browser.ie = true, browser.version = ie[1]; + if (safari && (ua.match(/Safari/) || !!os.ios)) browser.safari = true; + if (webview) browser.webview = true; + if (ie) browser.ie = true, browser.version = ie[1]; + + os.tablet = !!(ipad || playbook || (android && !ua.match(/Mobile/)) || + (firefox && ua.match(/Tablet/)) || (ie && !ua.match(/Phone/) && ua.match(/Touch/))); + os.phone = !!(!os.tablet && !os.ipod && (android || iphone || webos || blackberry || bb10 || + (chrome && ua.match(/Android/)) || (chrome && ua.match(/CriOS\/([\d.]+)/)) || + (firefox && ua.match(/Mobile/)) || (ie && ua.match(/Touch/)))); + + return { + browser: browser, + os: os, + // 原生canvas支持 + canvasSupported : document.createElement('canvas').getContext + ? true : false + }; + } + + return detect(navigator.userAgent); }); - -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:支持半平滑的polygon,折线面积图使用 - * 可配图形属性: - { - // 基础属性 - shape : 'halfSmoothPolygon', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - pointList : {Array}, // 必须,多边形各个顶角坐标 - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'halfSmoothPolygon', - id : '123456', - zlevel : 1, - style : { - pointList : [[10, 10], [300, 20], [298, 400], [50, 450]] - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function (eventPacket) { - alert(eventPacket.target.myName); - } - } - */ -define('echarts/util/shape/HalfSmoothPolygon',['require','zrender/shape/Base','zrender/shape/util/smoothBezier','zrender/tool/util','zrender/shape/Polygon'],function (require) { - var Base = require('zrender/shape/Base'); - var smoothBezier = require('zrender/shape/util/smoothBezier'); - var zrUtil = require('zrender/tool/util'); - - function HalfSmoothPolygon(options) { - Base.call(this, options); - } - - HalfSmoothPolygon.prototype = { - type : 'half-smooth-polygon', - /** - * 创建多边形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function (ctx, style) { - var pointList = style.pointList; - if (pointList.length < 2) { - // 少于2个点就不画了~ - return; - } - if (style.smooth) { - var controlPoints = smoothBezier( - pointList.slice(0, -2), style.smooth - ); - - ctx.moveTo(pointList[0][0], pointList[0][1]); - var cp1; - var cp2; - var p; - var l = pointList.length; - for (var i = 0; i < l - 3; i++) { - cp1 = controlPoints[i * 2]; - cp2 = controlPoints[i * 2 + 1]; - p = pointList[i + 1]; - ctx.bezierCurveTo( - cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1] - ); - } - ctx.lineTo(pointList[l - 2][0], pointList[l - 2][1]); - ctx.lineTo(pointList[l - 1][0], pointList[l - 1][1]); - ctx.lineTo(pointList[0][0], pointList[0][1]); - } - else { - require('zrender/shape/Polygon').prototype.buildPath( - ctx, style - ); - } - return; - } - }; - - zrUtil.inherits(HalfSmoothPolygon, Base); - - return HalfSmoothPolygon; +define('zrender/config',[],function () { + /** + * config默认配置项 + * @exports zrender/config + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + */ + var config = { + /** + * @namespace module:zrender/config.EVENT + */ + EVENT : { + /** + * 窗口大小变化 + * @type {string} + */ + RESIZE : 'resize', + /** + * 鼠标按钮被(手指)按下,事件对象是:目标图形元素或空 + * @type {string} + */ + CLICK : 'click', + /** + * 双击事件 + * @type {string} + */ + DBLCLICK : 'dblclick', + /** + * 鼠标滚轮变化,事件对象是:目标图形元素或空 + * @type {string} + */ + MOUSEWHEEL : 'mousewheel', + /** + * 鼠标(手指)被移动,事件对象是:目标图形元素或空 + * @type {string} + */ + MOUSEMOVE : 'mousemove', + /** + * 鼠标移到某图形元素之上,事件对象是:目标图形元素 + * @type {string} + */ + MOUSEOVER : 'mouseover', + /** + * 鼠标从某图形元素移开,事件对象是:目标图形元素 + * @type {string} + */ + MOUSEOUT : 'mouseout', + /** + * 鼠标按钮(手指)被按下,事件对象是:目标图形元素或空 + * @type {string} + */ + MOUSEDOWN : 'mousedown', + /** + * 鼠标按键(手指)被松开,事件对象是:目标图形元素或空 + * @type {string} + */ + MOUSEUP : 'mouseup', + /** + * 全局离开,MOUSEOUT触发比较频繁,一次离开优化绑定 + * @type {string} + */ + GLOBALOUT : 'globalout', // + + // 一次成功元素拖拽的行为事件过程是: + // dragstart > dragenter > dragover [> dragleave] > drop > dragend + /** + * 开始拖拽时触发,事件对象是:被拖拽图形元素 + * @type {string} + */ + DRAGSTART : 'dragstart', + /** + * 拖拽完毕时触发(在drop之后触发),事件对象是:被拖拽图形元素 + * @type {string} + */ + DRAGEND : 'dragend', + /** + * 拖拽图形元素进入目标图形元素时触发,事件对象是:目标图形元素 + * @type {string} + */ + DRAGENTER : 'dragenter', + /** + * 拖拽图形元素在目标图形元素上移动时触发,事件对象是:目标图形元素 + * @type {string} + */ + DRAGOVER : 'dragover', + /** + * 拖拽图形元素离开目标图形元素时触发,事件对象是:目标图形元素 + * @type {string} + */ + DRAGLEAVE : 'dragleave', + /** + * 拖拽图形元素放在目标图形元素内时触发,事件对象是:目标图形元素 + * @type {string} + */ + DROP : 'drop', + /** + * touch end - start < delay is click + * @type {number} + */ + touchClickDelay : 300 + }, + + // 是否异常捕获 + catchBrushException: false, + + /** + * debug日志选项:catchBrushException为true下有效 + * 0 : 不生成debug数据,发布用 + * 1 : 异常抛出,调试用 + * 2 : 控制台输出,调试用 + */ + debugMode: 0 + }; + return config; +}); + + +define( + 'zrender/tool/log',['require','../config'],function (require) { + var config = require('../config'); + + /** + * @exports zrender/tool/log + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + */ + return function() { + if (config.debugMode === 0) { + return; + } + else if (config.debugMode == 1) { + for (var k in arguments) { + throw new Error(arguments[k]); + } + } + else if (config.debugMode > 1) { + for (var k in arguments) { + console.log(arguments[k]); + } + } + }; + + /* for debug + return function(mes) { + document.getElementById('wrong-message').innerHTML = + mes + ' ' + (new Date() - 0) + + '
' + + document.getElementById('wrong-message').innerHTML; + }; + */ + } +); + +/** + * zrender: 生成唯一id + * + * @author errorrik (errorrik@gmail.com) + */ + +define( + 'zrender/tool/guid',[],function() { + var idStart = 0x0907; + + return function () { + return 'zrender__' + (idStart++); + }; + } +); + +define( + 'zrender/tool/vector',[],function () { + var ArrayCtor = typeof Float32Array === 'undefined' + ? Array + : Float32Array; + /** + * 二维向量类 + * @exports zrender/tool/vector + */ + var vector = { + /** + * 创建一个向量 + * @param {number} [x=0] + * @param {number} [y=0] + * @return {Float32Array|Array.} + */ + create: function (x, y) { + var out = new ArrayCtor(2); + out[0] = x || 0; + out[1] = y || 0; + return out; + }, + + /** + * 复制一个向量 + * @return {Float32Array|Array.} out + * @return {Float32Array|Array.} v + */ + copy: function (out, v) { + out[0] = v[0]; + out[1] = v[1]; + return out; + }, + + /** + * 设置向量的两个项 + * @param {Float32Array|Array.} out + * @param {number} a + * @param {number} b + * @return {Float32Array|Array.} 结果 + */ + set: function (out, a, b) { + out[0] = a; + out[1] = b; + return out; + }, + + /** + * 向量相加 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + */ + add: function (out, v1, v2) { + out[0] = v1[0] + v2[0]; + out[1] = v1[1] + v2[1]; + return out; + }, + + /** + * 向量缩放后相加 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + * @param {number} a + */ + scaleAndAdd: function (out, v1, v2, a) { + out[0] = v1[0] + v2[0] * a; + out[1] = v1[1] + v2[1] * a; + return out; + }, + + /** + * 向量相减 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + */ + sub: function (out, v1, v2) { + out[0] = v1[0] - v2[0]; + out[1] = v1[1] - v2[1]; + return out; + }, + + /** + * 向量长度 + * @param {Float32Array|Array.} v + * @return {number} + */ + len: function (v) { + return Math.sqrt(this.lenSquare(v)); + }, + + /** + * 向量长度平方 + * @param {Float32Array|Array.} v + * @return {number} + */ + lenSquare: function (v) { + return v[0] * v[0] + v[1] * v[1]; + }, + + /** + * 向量乘法 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + */ + mul: function (out, v1, v2) { + out[0] = v1[0] * v2[0]; + out[1] = v1[1] * v2[1]; + return out; + }, + + /** + * 向量除法 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + */ + div: function (out, v1, v2) { + out[0] = v1[0] / v2[0]; + out[1] = v1[1] / v2[1]; + return out; + }, + + /** + * 向量点乘 + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + * @return {number} + */ + dot: function (v1, v2) { + return v1[0] * v2[0] + v1[1] * v2[1]; + }, + + /** + * 向量缩放 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v + * @param {number} s + */ + scale: function (out, v, s) { + out[0] = v[0] * s; + out[1] = v[1] * s; + return out; + }, + + /** + * 向量归一化 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v + */ + normalize: function (out, v) { + var d = vector.len(v); + if (d === 0) { + out[0] = 0; + out[1] = 0; + } + else { + out[0] = v[0] / d; + out[1] = v[1] / d; + } + return out; + }, + + /** + * 计算向量间距离 + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + * @return {number} + */ + distance: function (v1, v2) { + return Math.sqrt( + (v1[0] - v2[0]) * (v1[0] - v2[0]) + + (v1[1] - v2[1]) * (v1[1] - v2[1]) + ); + }, + + /** + * 向量距离平方 + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + * @return {number} + */ + distanceSquare: function (v1, v2) { + return (v1[0] - v2[0]) * (v1[0] - v2[0]) + + (v1[1] - v2[1]) * (v1[1] - v2[1]); + }, + + /** + * 求负向量 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v + */ + negate: function (out, v) { + out[0] = -v[0]; + out[1] = -v[1]; + return out; + }, + + /** + * 插值两个点 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + * @param {number} t + */ + lerp: function (out, v1, v2, t) { + // var ax = v1[0]; + // var ay = v1[1]; + out[0] = v1[0] + t * (v2[0] - v1[0]); + out[1] = v1[1] + t * (v2[1] - v1[1]); + return out; + }, + + /** + * 矩阵左乘向量 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v + * @param {Float32Array|Array.} m + */ + applyTransform: function (out, v, m) { + var x = v[0]; + var y = v[1]; + out[0] = m[0] * x + m[2] * y + m[4]; + out[1] = m[1] * x + m[3] * y + m[5]; + return out; + }, + /** + * 求两个向量最小值 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + */ + min: function (out, v1, v2) { + out[0] = Math.min(v1[0], v2[0]); + out[1] = Math.min(v1[1], v2[1]); + return out; + }, + /** + * 求两个向量最大值 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + */ + max: function (out, v1, v2) { + out[0] = Math.max(v1[0], v2[0]); + out[1] = Math.max(v1[1], v2[1]); + return out; + } + }; + + vector.length = vector.len; + vector.lengthSquare = vector.lenSquare; + vector.dist = vector.distance; + vector.distSquare = vector.distanceSquare; + + return vector; + } +); + +define( + 'zrender/tool/matrix',[],function () { + + var ArrayCtor = typeof Float32Array === 'undefined' + ? Array + : Float32Array; + /** + * 3x2矩阵操作类 + * @exports zrender/tool/matrix + */ + var matrix = { + /** + * 创建一个单位矩阵 + * @return {Float32Array|Array.} + */ + create : function() { + var out = new ArrayCtor(6); + matrix.identity(out); + + return out; + }, + /** + * 设置矩阵为单位矩阵 + * @param {Float32Array|Array.} out + */ + identity : function(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = 0; + out[5] = 0; + return out; + }, + /** + * 复制矩阵 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} m + */ + copy: function(out, m) { + out[0] = m[0]; + out[1] = m[1]; + out[2] = m[2]; + out[3] = m[3]; + out[4] = m[4]; + out[5] = m[5]; + return out; + }, + /** + * 矩阵相乘 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} m1 + * @param {Float32Array|Array.} m2 + */ + mul : function (out, m1, m2) { + out[0] = m1[0] * m2[0] + m1[2] * m2[1]; + out[1] = m1[1] * m2[0] + m1[3] * m2[1]; + out[2] = m1[0] * m2[2] + m1[2] * m2[3]; + out[3] = m1[1] * m2[2] + m1[3] * m2[3]; + out[4] = m1[0] * m2[4] + m1[2] * m2[5] + m1[4]; + out[5] = m1[1] * m2[4] + m1[3] * m2[5] + m1[5]; + return out; + }, + /** + * 平移变换 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} a + * @param {Float32Array|Array.} v + */ + translate : function(out, a, v) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4] + v[0]; + out[5] = a[5] + v[1]; + return out; + }, + /** + * 旋转变换 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} a + * @param {number} rad + */ + rotate : function(out, a, rad) { + var aa = a[0]; + var ac = a[2]; + var atx = a[4]; + var ab = a[1]; + var ad = a[3]; + var aty = a[5]; + var st = Math.sin(rad); + var ct = Math.cos(rad); + + out[0] = aa * ct + ab * st; + out[1] = -aa * st + ab * ct; + out[2] = ac * ct + ad * st; + out[3] = -ac * st + ct * ad; + out[4] = ct * atx + st * aty; + out[5] = ct * aty - st * atx; + return out; + }, + /** + * 缩放变换 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} a + * @param {Float32Array|Array.} v + */ + scale : function(out, a, v) { + var vx = v[0]; + var vy = v[1]; + out[0] = a[0] * vx; + out[1] = a[1] * vy; + out[2] = a[2] * vx; + out[3] = a[3] * vy; + out[4] = a[4] * vx; + out[5] = a[5] * vy; + return out; + }, + /** + * 求逆矩阵 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} a + */ + invert : function(out, a) { + + var aa = a[0]; + var ac = a[2]; + var atx = a[4]; + var ab = a[1]; + var ad = a[3]; + var aty = a[5]; + + var det = aa * ad - ab * ac; + if (!det) { + return null; + } + det = 1.0 / det; + + out[0] = ad * det; + out[1] = -ab * det; + out[2] = -ac * det; + out[3] = aa * det; + out[4] = (ac * aty - ad * atx) * det; + out[5] = (ab * atx - aa * aty) * det; + return out; + }, + + /** + * 矩阵左乘向量 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} a + * @param {Float32Array|Array.} v + */ + mulVector : function(out, a, v) { + var aa = a[0]; + var ac = a[2]; + var atx = a[4]; + var ab = a[1]; + var ad = a[3]; + var aty = a[5]; + + out[0] = v[0] * aa + v[1] * ac + atx; + out[1] = v[0] * ab + v[1] * ad + aty; + + return out; + } + }; + + return matrix; + } +); + +/** + * Handler控制模块 + * @module zrender/Handler + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * errorrik (errorrik@gmail.com) + */ + +define( + 'zrender/Handler',['require','./config','./tool/env','./tool/event','./tool/util','./tool/vector','./tool/matrix','./mixin/Eventful'],function (require) { + + + + var config = require('./config'); + var env = require('./tool/env'); + var eventTool = require('./tool/event'); + var util = require('./tool/util'); + var vec2 = require('./tool/vector'); + var mat2d = require('./tool/matrix'); + var EVENT = config.EVENT; + + var Eventful = require('./mixin/Eventful'); + + var domHandlerNames = [ + 'resize', 'click', 'dblclick', + 'mousewheel', 'mousemove', 'mouseout', 'mouseup', 'mousedown', + 'touchstart', 'touchend', 'touchmove' + ]; + + var domHandlers = { + /** + * 窗口大小改变响应函数 + * @inner + * @param {Event} event + */ + resize: function (event) { + event = event || window.event; + this._lastHover = null; + this._isMouseDown = 0; + + // 分发config.EVENT.RESIZE事件,global + this.dispatch(EVENT.RESIZE, event); + }, + + /** + * 点击响应函数 + * @inner + * @param {Event} event + */ + click: function (event) { + event = this._zrenderEventFixed(event); + + // 分发config.EVENT.CLICK事件 + var _lastHover = this._lastHover; + if ((_lastHover && _lastHover.clickable) + || !_lastHover + ) { + this._dispatchAgency(_lastHover, EVENT.CLICK, event); + } + + this._mousemoveHandler(event); + }, + + /** + * 双击响应函数 + * @inner + * @param {Event} event + */ + dblclick: function (event) { + event = this._zrenderEventFixed(event); + + // 分发config.EVENT.DBLCLICK事件 + var _lastHover = this._lastHover; + if ((_lastHover && _lastHover.clickable) + || !_lastHover + ) { + this._dispatchAgency(_lastHover, EVENT.DBLCLICK, event); + } + + this._mousemoveHandler(event); + }, + + + /** + * 鼠标滚轮响应函数 + * @inner + * @param {Event} event + */ + mousewheel: function (event) { + event = this._zrenderEventFixed(event); + + // http://www.sitepoint.com/html5-javascript-mouse-wheel/ + // https://developer.mozilla.org/en-US/docs/DOM/DOM_event_reference/mousewheel + var delta = event.wheelDelta // Webkit + || -event.detail; // Firefox + var scale = delta > 0 ? 1.1 : 1 / 1.1; + + var layers = this.painter.getLayers(); + + var needsRefresh = false; + for (var z in layers) { + if (z !== 'hover') { + var layer = layers[z]; + var pos = layer.position; + if (layer.zoomable) { + layer.__zoom = layer.__zoom || 1; + var newZoom = layer.__zoom; + newZoom *= scale; + newZoom = Math.max( + Math.min(layer.maxZoom, newZoom), + layer.minZoom + ); + scale = newZoom / layer.__zoom; + layer.__zoom = newZoom; + // Keep the mouse center when scaling + pos[0] -= (this._mouseX - pos[0]) * (scale - 1); + pos[1] -= (this._mouseY - pos[1]) * (scale - 1); + layer.scale[0] *= scale; + layer.scale[1] *= scale; + layer.dirty = true; + needsRefresh = true; + } + } + } + if (needsRefresh) { + this.painter.refresh(); + } + + // 分发config.EVENT.MOUSEWHEEL事件 + this._dispatchAgency(this._lastHover, EVENT.MOUSEWHEEL, event); + this._mousemoveHandler(event); + }, + + /** + * 鼠标(手指)移动响应函数 + * @inner + * @param {Event} event + */ + mousemove: function (event) { + if (this.painter.isLoading()) { + return; + } + + event = this._zrenderEventFixed(event); + this._lastX = this._mouseX; + this._lastY = this._mouseY; + this._mouseX = eventTool.getX(event); + this._mouseY = eventTool.getY(event); + var dx = this._mouseX - this._lastX; + var dy = this._mouseY - this._lastY; + + // 可能出现config.EVENT.DRAGSTART事件 + // 避免手抖点击误认为拖拽 + // if (this._mouseX - this._lastX > 1 || this._mouseY - this._lastY > 1) { + this._processDragStart(event); + // } + this._hasfound = 0; + this._event = event; + + this._iterateAndFindHover(); + + // 找到的在迭代函数里做了处理,没找到得在迭代完后处理 + if (!this._hasfound) { + // 过滤首次拖拽产生的mouseout和dragLeave + if (!this._draggingTarget + || (this._lastHover && this._lastHover != this._draggingTarget) + ) { + // 可能出现config.EVENT.MOUSEOUT事件 + this._processOutShape(event); + + // 可能出现config.EVENT.DRAGLEAVE事件 + this._processDragLeave(event); + } + + this._lastHover = null; + this.storage.delHover(); + this.painter.clearHover(); + } + + // set cursor for root element + var cursor = 'default'; + + // 如果存在拖拽中元素,被拖拽的图形元素最后addHover + if (this._draggingTarget) { + this.storage.drift(this._draggingTarget.id, dx, dy); + this.storage.addHover(this._draggingTarget); + } + else if (this._isMouseDown) { + // Layer dragging + var layers = this.painter.getLayers(); + + var needsRefresh = false; + for (var z in layers) { + if (z !== 'hover') { + var layer = layers[z]; + if (layer.panable) { + // PENDING + cursor = 'move'; + // Keep the mouse center when scaling + layer.position[0] += dx; + layer.position[1] += dy; + needsRefresh = true; + layer.dirty = true; + } + } + } + if (needsRefresh) { + this.painter.refresh(); + } + } + + if (this._draggingTarget || (this._hasfound && this._lastHover.draggable)) { + cursor = 'move'; + } + else if (this._hasfound && this._lastHover.clickable) { + cursor = 'pointer'; + } + this.root.style.cursor = cursor; + + // 分发config.EVENT.MOUSEMOVE事件 + this._dispatchAgency(this._lastHover, EVENT.MOUSEMOVE, event); + + if (this._draggingTarget || this._hasfound || this.storage.hasHoverShape()) { + this.painter.refreshHover(); + } + }, + + /** + * 鼠标(手指)离开响应函数 + * @inner + * @param {Event} event + */ + mouseout: function (event) { + event = this._zrenderEventFixed(event); + + var element = event.toElement || event.relatedTarget; + if (element != this.root) { + while (element && element.nodeType != 9) { + // 忽略包含在root中的dom引起的mouseOut + if (element == this.root) { + this._mousemoveHandler(event); + return; + } + + element = element.parentNode; + } + } + + event.zrenderX = this._lastX; + event.zrenderY = this._lastY; + this.root.style.cursor = 'default'; + this._isMouseDown = 0; + + this._processOutShape(event); + this._processDrop(event); + this._processDragEnd(event); + if (!this.painter.isLoading()) { + this.painter.refreshHover(); + } + + this.dispatch(EVENT.GLOBALOUT, event); + }, + + /** + * 鼠标(手指)按下响应函数 + * @inner + * @param {Event} event + */ + mousedown: function (event) { + if (this._lastDownButton == 2) { + this._lastDownButton = event.button; + this._mouseDownTarget = null; + // 仅作为关闭右键菜单使用 + return; + } + + this._lastMouseDownMoment = new Date(); + event = this._zrenderEventFixed(event); + this._isMouseDown = 1; + + // 分发config.EVENT.MOUSEDOWN事件 + this._mouseDownTarget = this._lastHover; + this._dispatchAgency(this._lastHover, EVENT.MOUSEDOWN, event); + this._lastDownButton = event.button; + }, + + /** + * 鼠标(手指)抬起响应函数 + * @inner + * @param {Event} event + */ + mouseup: function (event) { + event = this._zrenderEventFixed(event); + this.root.style.cursor = 'default'; + this._isMouseDown = 0; + this._mouseDownTarget = null; + + // 分发config.EVENT.MOUSEUP事件 + this._dispatchAgency(this._lastHover, EVENT.MOUSEUP, event); + this._processDrop(event); + this._processDragEnd(event); + }, + + /** + * Touch开始响应函数 + * @inner + * @param {Event} event + */ + touchstart: function (event) { + // eventTool.stop(event);// 阻止浏览器默认事件,重要 + event = this._zrenderEventFixed(event, true); + this._lastTouchMoment = new Date(); + + // 平板补充一次findHover + this._mobildFindFixed(event); + this._mousedownHandler(event); + }, + + /** + * Touch移动响应函数 + * @inner + * @param {Event} event + */ + touchmove: function (event) { + event = this._zrenderEventFixed(event, true); + this._mousemoveHandler(event); + if (this._isDragging) { + eventTool.stop(event);// 阻止浏览器默认事件,重要 + } + }, + + /** + * Touch结束响应函数 + * @inner + * @param {Event} event + */ + touchend: function (event) { + // eventTool.stop(event);// 阻止浏览器默认事件,重要 + event = this._zrenderEventFixed(event, true); + this._mouseupHandler(event); + + var now = new Date(); + if (now - this._lastTouchMoment < EVENT.touchClickDelay) { + this._mobildFindFixed(event); + this._clickHandler(event); + if (now - this._lastClickMoment < EVENT.touchClickDelay / 2) { + this._dblclickHandler(event); + if (this._lastHover && this._lastHover.clickable) { + eventTool.stop(event);// 阻止浏览器默认事件,重要 + } + } + this._lastClickMoment = now; + } + this.painter.clearHover(); + } + }; + + /** + * bind一个参数的function + * + * @inner + * @param {Function} handler 要bind的function + * @param {Object} context 运行时this环境 + * @return {Function} + */ + function bind1Arg(handler, context) { + return function (e) { + return handler.call(context, e); + }; + } + /**function bind2Arg(handler, context) { + return function (arg1, arg2) { + return handler.call(context, arg1, arg2); + }; + }*/ + + function bind3Arg(handler, context) { + return function (arg1, arg2, arg3) { + return handler.call(context, arg1, arg2, arg3); + }; + } + /** + * 为控制类实例初始化dom 事件处理函数 + * + * @inner + * @param {module:zrender/Handler} instance 控制类实例 + */ + function initDomHandler(instance) { + var len = domHandlerNames.length; + while (len--) { + var name = domHandlerNames[len]; + instance['_' + name + 'Handler'] = bind1Arg(domHandlers[name], instance); + } + } + + /** + * @alias module:zrender/Handler + * @constructor + * @extends module:zrender/mixin/Eventful + * @param {HTMLElement} root 绘图区域 + * @param {module:zrender/Storage} storage Storage实例 + * @param {module:zrender/Painter} painter Painter实例 + */ + var Handler = function(root, storage, painter) { + // 添加事件分发器特性 + Eventful.call(this); + + this.root = root; + this.storage = storage; + this.painter = painter; + + // 各种事件标识的私有变量 + // this._hasfound = false; //是否找到hover图形元素 + // this._lastHover = null; //最后一个hover图形元素 + // this._mouseDownTarget = null; + // this._draggingTarget = null; //当前被拖拽的图形元素 + // this._isMouseDown = false; + // this._isDragging = false; + // this._lastMouseDownMoment; + // this._lastTouchMoment; + // this._lastDownButton; + + this._lastX = + this._lastY = + this._mouseX = + this._mouseY = 0; + + this._findHover = bind3Arg(findHover, this); + this._domHover = painter.getDomHover(); + initDomHandler(this); + + // 初始化,事件绑定,支持的所有事件都由如下原生事件计算得来 + if (window.addEventListener) { + window.addEventListener('resize', this._resizeHandler); + + if (env.os.tablet || env.os.phone) { + // mobile支持 + root.addEventListener('touchstart', this._touchstartHandler); + root.addEventListener('touchmove', this._touchmoveHandler); + root.addEventListener('touchend', this._touchendHandler); + } + else { + // mobile的click/move/up/down自己模拟 + root.addEventListener('click', this._clickHandler); + root.addEventListener('dblclick', this._dblclickHandler); + root.addEventListener('mousewheel', this._mousewheelHandler); + root.addEventListener('mousemove', this._mousemoveHandler); + root.addEventListener('mousedown', this._mousedownHandler); + root.addEventListener('mouseup', this._mouseupHandler); + } + root.addEventListener('DOMMouseScroll', this._mousewheelHandler); + root.addEventListener('mouseout', this._mouseoutHandler); + } + else { + window.attachEvent('onresize', this._resizeHandler); + + root.attachEvent('onclick', this._clickHandler); + root.attachEvent('ondblclick ', this._dblclickHandler); + root.attachEvent('onmousewheel', this._mousewheelHandler); + root.attachEvent('onmousemove', this._mousemoveHandler); + root.attachEvent('onmouseout', this._mouseoutHandler); + root.attachEvent('onmousedown', this._mousedownHandler); + root.attachEvent('onmouseup', this._mouseupHandler); + } + }; + + /** + * 自定义事件绑定 + * @param {string} eventName 事件名称,resize,hover,drag,etc~ + * @param {Function} handler 响应函数 + */ + Handler.prototype.on = function (eventName, handler) { + this.bind(eventName, handler); + return this; + }; + + /** + * 自定义事件解绑 + * @param {string} eventName 事件名称,resize,hover,drag,etc~ + * @param {Function} handler 响应函数 + */ + Handler.prototype.un = function (eventName, handler) { + this.unbind(eventName, handler); + return this; + }; + + /** + * 事件触发 + * @param {string} eventName 事件名称,resize,hover,drag,etc~ + * @param {event=} eventArgs event dom事件对象 + */ + Handler.prototype.trigger = function (eventName, eventArgs) { + switch (eventName) { + case EVENT.RESIZE: + case EVENT.CLICK: + case EVENT.DBLCLICK: + case EVENT.MOUSEWHEEL: + case EVENT.MOUSEMOVE: + case EVENT.MOUSEDOWN: + case EVENT.MOUSEUP: + case EVENT.MOUSEOUT: + this['_' + eventName + 'Handler'](eventArgs); + break; + } + }; + + /** + * 释放,解绑所有事件 + */ + Handler.prototype.dispose = function () { + var root = this.root; + + if (window.removeEventListener) { + window.removeEventListener('resize', this._resizeHandler); + + if (env.os.tablet || env.os.phone) { + // mobile支持 + root.removeEventListener('touchstart', this._touchstartHandler); + root.removeEventListener('touchmove', this._touchmoveHandler); + root.removeEventListener('touchend', this._touchendHandler); + } + else { + // mobile的click自己模拟 + root.removeEventListener('click', this._clickHandler); + root.removeEventListener('dblclick', this._dblclickHandler); + root.removeEventListener('mousewheel', this._mousewheelHandler); + root.removeEventListener('mousemove', this._mousemoveHandler); + root.removeEventListener('mousedown', this._mousedownHandler); + root.removeEventListener('mouseup', this._mouseupHandler); + } + root.removeEventListener('DOMMouseScroll', this._mousewheelHandler); + root.removeEventListener('mouseout', this._mouseoutHandler); + } + else { + window.detachEvent('onresize', this._resizeHandler); + + root.detachEvent('onclick', this._clickHandler); + root.detachEvent('dblclick', this._dblclickHandler); + root.detachEvent('onmousewheel', this._mousewheelHandler); + root.detachEvent('onmousemove', this._mousemoveHandler); + root.detachEvent('onmouseout', this._mouseoutHandler); + root.detachEvent('onmousedown', this._mousedownHandler); + root.detachEvent('onmouseup', this._mouseupHandler); + } + + this.root = + this._domHover = + this.storage = + this.painter = null; + + this.un(); + }; + + /** + * 拖拽开始 + * + * @private + * @param {Object} event 事件对象 + */ + Handler.prototype._processDragStart = function (event) { + var _lastHover = this._lastHover; + + if (this._isMouseDown + && _lastHover + && _lastHover.draggable + && !this._draggingTarget + && this._mouseDownTarget == _lastHover + ) { + // 拖拽点击生效时长阀门,某些场景需要降低拖拽敏感度 + if (_lastHover.dragEnableTime && + new Date() - this._lastMouseDownMoment < _lastHover.dragEnableTime + ) { + return; + } + + var _draggingTarget = _lastHover; + this._draggingTarget = _draggingTarget; + this._isDragging = 1; + + _draggingTarget.invisible = true; + this.storage.mod(_draggingTarget.id); + + // 分发config.EVENT.DRAGSTART事件 + this._dispatchAgency( + _draggingTarget, + EVENT.DRAGSTART, + event + ); + this.painter.refresh(); + } + }; + + /** + * 拖拽进入目标元素 + * + * @private + * @param {Object} event 事件对象 + */ + Handler.prototype._processDragEnter = function (event) { + if (this._draggingTarget) { + // 分发config.EVENT.DRAGENTER事件 + this._dispatchAgency( + this._lastHover, + EVENT.DRAGENTER, + event, + this._draggingTarget + ); + } + }; + + /** + * 拖拽在目标元素上移动 + * + * @private + * @param {Object} event 事件对象 + */ + Handler.prototype._processDragOver = function (event) { + if (this._draggingTarget) { + // 分发config.EVENT.DRAGOVER事件 + this._dispatchAgency( + this._lastHover, + EVENT.DRAGOVER, + event, + this._draggingTarget + ); + } + }; + + /** + * 拖拽离开目标元素 + * + * @private + * @param {Object} event 事件对象 + */ + Handler.prototype._processDragLeave = function (event) { + if (this._draggingTarget) { + // 分发config.EVENT.DRAGLEAVE事件 + this._dispatchAgency( + this._lastHover, + EVENT.DRAGLEAVE, + event, + this._draggingTarget + ); + } + }; + + /** + * 拖拽在目标元素上完成 + * + * @private + * @param {Object} event 事件对象 + */ + Handler.prototype._processDrop = function (event) { + if (this._draggingTarget) { + this._draggingTarget.invisible = false; + this.storage.mod(this._draggingTarget.id); + this.painter.refresh(); + + // 分发config.EVENT.DROP事件 + this._dispatchAgency( + this._lastHover, + EVENT.DROP, + event, + this._draggingTarget + ); + } + }; + + /** + * 拖拽结束 + * + * @private + * @param {Object} event 事件对象 + */ + Handler.prototype._processDragEnd = function (event) { + if (this._draggingTarget) { + // 分发config.EVENT.DRAGEND事件 + this._dispatchAgency( + this._draggingTarget, + EVENT.DRAGEND, + event + ); + + this._lastHover = null; + } + + this._isDragging = 0; + this._draggingTarget = null; + }; + + /** + * 鼠标在某个图形元素上移动 + * + * @private + * @param {Object} event 事件对象 + */ + Handler.prototype._processOverShape = function (event) { + // 分发config.EVENT.MOUSEOVER事件 + this._dispatchAgency(this._lastHover, EVENT.MOUSEOVER, event); + }; + + /** + * 鼠标离开某个图形元素 + * + * @private + * @param {Object} event 事件对象 + */ + Handler.prototype._processOutShape = function (event) { + // 分发config.EVENT.MOUSEOUT事件 + this._dispatchAgency(this._lastHover, EVENT.MOUSEOUT, event); + }; + + /** + * 事件分发代理 + * + * @private + * @param {Object} targetShape 目标图形元素 + * @param {string} eventName 事件名称 + * @param {Object} event 事件对象 + * @param {Object=} draggedShape 拖拽事件特有,当前被拖拽图形元素 + */ + Handler.prototype._dispatchAgency = function (targetShape, eventName, event, draggedShape) { + var eventHandler = 'on' + eventName; + var eventPacket = { + type : eventName, + event : event, + target : targetShape, + cancelBubble: false + }; + + var el = targetShape; + + if (draggedShape) { + eventPacket.dragged = draggedShape; + } + + while (el) { + el[eventHandler] + && (eventPacket.cancelBubble = el[eventHandler](eventPacket)); + el.dispatch(eventName, eventPacket); + + el = el.parent; + + if (eventPacket.cancelBubble) { + break; + } + } + + if (targetShape) { + // 冒泡到顶级 zrender 对象 + if (!eventPacket.cancelBubble) { + this.dispatch(eventName, eventPacket); + } + } + else if (!draggedShape) { + // 无hover目标,无拖拽对象,原生事件分发 + this.dispatch(eventName, { + type: eventName, + event: event + }); + } + }; + + /** + * 迭代寻找hover shape + * @private + * @method + */ + Handler.prototype._iterateAndFindHover = (function() { + var invTransform = mat2d.create(); + return function() { + var list = this.storage.getShapeList(); + var currentZLevel; + var currentLayer; + var tmp = [ 0, 0 ]; + for (var i = list.length - 1; i >= 0 ; i--) { + var shape = list[i]; + + if (currentZLevel !== shape.zlevel) { + currentLayer = this.painter.getLayer(shape.zlevel, currentLayer); + tmp[0] = this._mouseX; + tmp[1] = this._mouseY; + + if (currentLayer.needTransform) { + mat2d.invert(invTransform, currentLayer.transform); + vec2.applyTransform(tmp, tmp, invTransform); + } + } + + if (this._findHover(shape, tmp[0], tmp[1])) { + break; + } + } + }; + })(); + + // touch指尖错觉的尝试偏移量配置 + var MOBILE_TOUCH_OFFSETS = [ + { x: 10 }, + { x: -20 }, + { x: 10, y: 10 }, + { y: -20 } + ]; + + // touch有指尖错觉,四向尝试,让touch上的点击更好触发事件 + Handler.prototype._mobildFindFixed = function (event) { + this._lastHover = null; + this._mouseX = event.zrenderX; + this._mouseY = event.zrenderY; + + this._event = event; + + this._iterateAndFindHover(); + + for (var i = 0; !this._lastHover && i < MOBILE_TOUCH_OFFSETS.length ; i++) { + var offset = MOBILE_TOUCH_OFFSETS[ i ]; + offset.x && (this._mouseX += offset.x); + offset.y && (this._mouseX += offset.y); + + this._iterateAndFindHover(); + } + + if (this._lastHover) { + event.zrenderX = this._mouseX; + event.zrenderY = this._mouseY; + } + }; + + /** + * 迭代函数,查找hover到的图形元素并即时做些事件分发 + * + * @inner + * @param {Object} shape 图形元素 + * @param {number} x + * @param {number} y + */ + function findHover(shape, x, y) { + if ( + (this._draggingTarget && this._draggingTarget.id == shape.id) // 迭代到当前拖拽的图形上 + || shape.isSilent() // 打酱油的路过,啥都不响应的shape~ + ) { + return false; + } + + var event = this._event; + if (shape.isCover(x, y)) { + if (shape.hoverable) { + this.storage.addHover(shape); + } + // 查找是否在 clipShape 中 + var p = shape.parent; + while (p) { + if (p.clipShape && !p.clipShape.isCover(this._mouseX, this._mouseY)) { + // 已经被祖先 clip 掉了 + return false; + } + p = p.parent; + } + + if (this._lastHover != shape) { + this._processOutShape(event); + + // 可能出现config.EVENT.DRAGLEAVE事件 + this._processDragLeave(event); + + this._lastHover = shape; + + // 可能出现config.EVENT.DRAGENTER事件 + this._processDragEnter(event); + } + + this._processOverShape(event); + + // 可能出现config.EVENT.DRAGOVER + this._processDragOver(event); + + this._hasfound = 1; + + return true; // 找到则中断迭代查找 + } + + return false; + } + + /** + * 如果存在第三方嵌入的一些dom触发的事件,或touch事件,需要转换一下事件坐标 + * + * @private + */ + Handler.prototype._zrenderEventFixed = function (event, isTouch) { + if (event.zrenderFixed) { + return event; + } + + if (!isTouch) { + event = event || window.event; + // 进入对象优先~ + var target = event.toElement + || event.relatedTarget + || event.srcElement + || event.target; + + if (target && target != this._domHover) { + event.zrenderX = (typeof event.offsetX != 'undefined' + ? event.offsetX + : event.layerX) + + target.offsetLeft; + event.zrenderY = (typeof event.offsetY != 'undefined' + ? event.offsetY + : event.layerY) + + target.offsetTop; + } + } + else { + var touch = event.type != 'touchend' + ? event.targetTouches[0] + : event.changedTouches[0]; + if (touch) { + var rBounding = this.root.getBoundingClientRect(); + // touch事件坐标是全屏的~ + event.zrenderX = touch.clientX - rBounding.left; + event.zrenderY = touch.clientY - rBounding.top; + } + } + + event.zrenderFixed = 1; + return event; + }; + + util.merge(Handler.prototype, Eventful.prototype, true); + + return Handler; + } +); + +/** + * @module zrender/tool/curve + * @author pissang(https://www.github.com/pissang) + */ +define('zrender/tool/curve',['require','./vector'],function(require) { + + var vector = require('./vector'); + + + + var EPSILON = 1e-4; + + var THREE_SQRT = Math.sqrt(3); + var ONE_THIRD = 1 / 3; + + // 临时变量 + var _v0 = vector.create(); + var _v1 = vector.create(); + var _v2 = vector.create(); + // var _v3 = vector.create(); + + function isAroundZero(val) { + return val > -EPSILON && val < EPSILON; + } + function isNotAroundZero(val) { + return val > EPSILON || val < -EPSILON; + } + /* + function evalCubicCoeff(a, b, c, d, t) { + return ((a * t + b) * t + c) * t + d; + } + */ + + /** + * 计算三次贝塞尔值 + * @memberOf module:zrender/tool/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} p3 + * @param {number} t + * @return {number} + */ + function cubicAt(p0, p1, p2, p3, t) { + var onet = 1 - t; + return onet * onet * (onet * p0 + 3 * t * p1) + + t * t * (t * p3 + 3 * onet * p2); + } + + /** + * 计算三次贝塞尔导数值 + * @memberOf module:zrender/tool/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} p3 + * @param {number} t + * @return {number} + */ + function cubicDerivativeAt(p0, p1, p2, p3, t) { + var onet = 1 - t; + return 3 * ( + ((p1 - p0) * onet + 2 * (p2 - p1) * t) * onet + + (p3 - p2) * t * t + ); + } + + /** + * 计算三次贝塞尔方程根,使用盛金公式 + * @memberOf module:zrender/tool/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} p3 + * @param {number} val + * @param {Array.} roots + * @return {number} 有效根数目 + */ + function cubicRootAt(p0, p1, p2, p3, val, roots) { + // Evaluate roots of cubic functions + var a = p3 + 3 * (p1 - p2) - p0; + var b = 3 * (p2 - p1 * 2 + p0); + var c = 3 * (p1 - p0); + var d = p0 - val; + + var A = b * b - 3 * a * c; + var B = b * c - 9 * a * d; + var C = c * c - 3 * b * d; + + var n = 0; + + if (isAroundZero(A) && isAroundZero(B)) { + if (isAroundZero(b)) { + roots[0] = 0; + } + else { + var t1 = -c / b; //t1, t2, t3, b is not zero + if (t1 >=0 && t1 <= 1) { + roots[n++] = t1; + } + } + } + else { + var disc = B * B - 4 * A * C; + + if (isAroundZero(disc)) { + var K = B / A; + var t1 = -b / a + K; // t1, a is not zero + var t2 = -K / 2; // t2, t3 + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + if (t2 >= 0 && t2 <= 1) { + roots[n++] = t2; + } + } + else if (disc > 0) { + var discSqrt = Math.sqrt(disc); + var Y1 = A * b + 1.5 * a * (-B + discSqrt); + var Y2 = A * b + 1.5 * a * (-B - discSqrt); + if (Y1 < 0) { + Y1 = -Math.pow(-Y1, ONE_THIRD); + } + else { + Y1 = Math.pow(Y1, ONE_THIRD); + } + if (Y2 < 0) { + Y2 = -Math.pow(-Y2, ONE_THIRD); + } + else { + Y2 = Math.pow(Y2, ONE_THIRD); + } + var t1 = (-b - (Y1 + Y2)) / (3 * a); + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + } + else { + var T = (2 * A * b - 3 * a * B) / (2 * Math.sqrt(A * A * A)); + var theta = Math.acos(T) / 3; + var ASqrt = Math.sqrt(A); + var tmp = Math.cos(theta); + + var t1 = (-b - 2 * ASqrt * tmp) / (3 * a); + var t2 = (-b + ASqrt * (tmp + THREE_SQRT * Math.sin(theta))) / (3 * a); + var t3 = (-b + ASqrt * (tmp - THREE_SQRT * Math.sin(theta))) / (3 * a); + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + if (t2 >= 0 && t2 <= 1) { + roots[n++] = t2; + } + if (t3 >= 0 && t3 <= 1) { + roots[n++] = t3; + } + } + } + return n; + } + + /** + * 计算三次贝塞尔方程极限值的位置 + * @memberOf module:zrender/tool/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} p3 + * @param {Array.} extrema + * @return {number} 有效数目 + */ + function cubicExtrema(p0, p1, p2, p3, extrema) { + var b = 6 * p2 - 12 * p1 + 6 * p0; + var a = 9 * p1 + 3 * p3 - 3 * p0 - 9 * p2; + var c = 3 * p1 - 3 * p0; + + var n = 0; + if (isAroundZero(a)) { + if (isNotAroundZero(b)) { + var t1 = -c / b; + if (t1 >= 0 && t1 <=1) { + extrema[n++] = t1; + } + } + } + else { + var disc = b * b - 4 * a * c; + if (isAroundZero(disc)) { + extrema[0] = -b / (2 * a); + } + else if (disc > 0) { + var discSqrt = Math.sqrt(disc); + var t1 = (-b + discSqrt) / (2 * a); + var t2 = (-b - discSqrt) / (2 * a); + if (t1 >= 0 && t1 <= 1) { + extrema[n++] = t1; + } + if (t2 >= 0 && t2 <= 1) { + extrema[n++] = t2; + } + } + } + return n; + } + + /** + * 细分三次贝塞尔曲线 + * @memberOf module:zrender/tool/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} p3 + * @param {number} t + * @param {Array.} out + */ + function cubicSubdivide(p0, p1, p2, p3, t, out) { + var p01 = (p1 - p0) * t + p0; + var p12 = (p2 - p1) * t + p1; + var p23 = (p3 - p2) * t + p2; + + var p012 = (p12 - p01) * t + p01; + var p123 = (p23 - p12) * t + p12; + + var p0123 = (p123 - p012) * t + p012; + // Seg0 + out[0] = p0; + out[1] = p01; + out[2] = p012; + out[3] = p0123; + // Seg1 + out[4] = p0123; + out[5] = p123; + out[6] = p23; + out[7] = p3; + } + + /** + * 投射点到三次贝塞尔曲线上,返回投射距离。 + * 投射点有可能会有一个或者多个,这里只返回其中距离最短的一个。 + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @param {number} x3 + * @param {number} y3 + * @param {number} x + * @param {number} y + * @param {Array.} [out] 投射点 + * @return {number} + */ + function cubicProjectPoint( + x0, y0, x1, y1, x2, y2, x3, y3, + x, y, out + ) { + // http://pomax.github.io/bezierinfo/#projections + var t; + var interval = 0.005; + var d = Infinity; + + _v0[0] = x; + _v0[1] = y; + + // 先粗略估计一下可能的最小距离的 t 值 + // PENDING + for (var _t = 0; _t < 1; _t += 0.05) { + _v1[0] = cubicAt(x0, x1, x2, x3, _t); + _v1[1] = cubicAt(y0, y1, y2, y3, _t); + var d1 = vector.distSquare(_v0, _v1); + if (d1 < d) { + t = _t; + d = d1; + } + } + d = Infinity; + + // At most 32 iteration + for (var i = 0; i < 32; i++) { + if (interval < EPSILON) { + break; + } + var prev = t - interval; + var next = t + interval; + // t - interval + _v1[0] = cubicAt(x0, x1, x2, x3, prev); + _v1[1] = cubicAt(y0, y1, y2, y3, prev); + + var d1 = vector.distSquare(_v1, _v0); + + if (prev >= 0 && d1 < d) { + t = prev; + d = d1; + } + else { + // t + interval + _v2[0] = cubicAt(x0, x1, x2, x3, next); + _v2[1] = cubicAt(y0, y1, y2, y3, next); + var d2 = vector.distSquare(_v2, _v0); + + if (next <= 1 && d2 < d) { + t = next; + d = d2; + } + else { + interval *= 0.5; + } + } + } + // t + if (out) { + out[0] = cubicAt(x0, x1, x2, x3, t); + out[1] = cubicAt(y0, y1, y2, y3, t); + } + // console.log(interval, i); + return Math.sqrt(d); + } + + /** + * 计算二次方贝塞尔值 + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} t + * @return {number} + */ + function quadraticAt(p0, p1, p2, t) { + var onet = 1 - t; + return onet * (onet * p0 + 2 * t * p1) + t * t * p2; + } + + /** + * 计算二次方贝塞尔导数值 + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} t + * @return {number} + */ + function quadraticDerivativeAt(p0, p1, p2, t) { + return 2 * ((1 - t) * (p1 - p0) + t * (p2 - p1)); + } + + /** + * 计算二次方贝塞尔方程根 + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} t + * @param {Array.} roots + * @return {number} 有效根数目 + */ + function quadraticRootAt(p0, p1, p2, val, roots) { + var a = p0 - 2 * p1 + p2; + var b = 2 * (p1 - p0); + var c = p0 - val; + + var n = 0; + if (isAroundZero(a)) { + if (isNotAroundZero(b)) { + var t1 = -c / b; + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + } + } + else { + var disc = b * b - 4 * a * c; + if (isAroundZero(disc)) { + var t1 = -b / (2 * a); + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + } + else if (disc > 0) { + var discSqrt = Math.sqrt(disc); + var t1 = (-b + discSqrt) / (2 * a); + var t2 = (-b - discSqrt) / (2 * a); + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + if (t2 >= 0 && t2 <= 1) { + roots[n++] = t2; + } + } + } + return n; + } + + /** + * 计算二次贝塞尔方程极限值 + * @memberOf module:zrender/tool/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @return {number} + */ + function quadraticExtremum(p0, p1, p2) { + var divider = p0 + p2 - 2 * p1; + if (divider === 0) { + // p1 is center of p0 and p2 + return 0.5; + } + else { + return (p0 - p1) / divider; + } + } + + /** + * 投射点到二次贝塞尔曲线上,返回投射距离。 + * 投射点有可能会有一个或者多个,这里只返回其中距离最短的一个。 + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @param {number} x + * @param {number} y + * @param {Array.} out 投射点 + * @return {number} + */ + function quadraticProjectPoint( + x0, y0, x1, y1, x2, y2, + x, y, out + ) { + // http://pomax.github.io/bezierinfo/#projections + var t; + var interval = 0.005; + var d = Infinity; + + _v0[0] = x; + _v0[1] = y; + + // 先粗略估计一下可能的最小距离的 t 值 + // PENDING + for (var _t = 0; _t < 1; _t += 0.05) { + _v1[0] = quadraticAt(x0, x1, x2, _t); + _v1[1] = quadraticAt(y0, y1, y2, _t); + var d1 = vector.distSquare(_v0, _v1); + if (d1 < d) { + t = _t; + d = d1; + } + } + d = Infinity; + + // At most 32 iteration + for (var i = 0; i < 32; i++) { + if (interval < EPSILON) { + break; + } + var prev = t - interval; + var next = t + interval; + // t - interval + _v1[0] = quadraticAt(x0, x1, x2, prev); + _v1[1] = quadraticAt(y0, y1, y2, prev); + + var d1 = vector.distSquare(_v1, _v0); + + if (prev >= 0 && d1 < d) { + t = prev; + d = d1; + } + else { + // t + interval + _v2[0] = quadraticAt(x0, x1, x2, next); + _v2[1] = quadraticAt(y0, y1, y2, next); + var d2 = vector.distSquare(_v2, _v0); + if (next <= 1 && d2 < d) { + t = next; + d = d2; + } + else { + interval *= 0.5; + } + } + } + // t + if (out) { + out[0] = quadraticAt(x0, x1, x2, t); + out[1] = quadraticAt(y0, y1, y2, t); + } + // console.log(interval, i); + return Math.sqrt(d); + } + + return { + + cubicAt: cubicAt, + + cubicDerivativeAt: cubicDerivativeAt, + + cubicRootAt: cubicRootAt, + + cubicExtrema: cubicExtrema, + + cubicSubdivide: cubicSubdivide, + + cubicProjectPoint: cubicProjectPoint, + + quadraticAt: quadraticAt, + + quadraticDerivativeAt: quadraticDerivativeAt, + + quadraticRootAt: quadraticRootAt, + + quadraticExtremum: quadraticExtremum, + + quadraticProjectPoint: quadraticProjectPoint + }; }); -/** - * echarts图表类:折线图 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/chart/line',['require','../component/base','./base','zrender/shape/BrokenLine','../util/shape/Icon','../util/shape/HalfSmoothPolygon','../component/axis','../component/grid','../component/dataZoom','../config','../util/ecData','zrender/tool/util','zrender/tool/color','../chart'],function (require) { - var ComponentBase = require('../component/base'); - var ChartBase = require('./base'); - - // 图形依赖 - var BrokenLineShape = require('zrender/shape/BrokenLine'); - var IconShape = require('../util/shape/Icon'); - var HalfSmoothPolygonShape = require('../util/shape/HalfSmoothPolygon'); - // 组件依赖 - require('../component/axis'); - require('../component/grid'); - require('../component/dataZoom'); - - var ecConfig = require('../config'); - var ecData = require('../util/ecData'); - var zrUtil = require('zrender/tool/util'); - var zrColor = require('zrender/tool/color'); - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} series 数据 - * @param {Object} component 组件 - */ - function Line(ecTheme, messageCenter, zr, option, myChart){ - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); - // 图表基类 - ChartBase.call(this); - - this.refresh(option); - } - - Line.prototype = { - type : ecConfig.CHART_TYPE_LINE, - /** - * 绘制图形 - */ - _buildShape : function () { - var series = this.series; - this.finalPLMap = {}; // 完成的point list(PL) - this._sIndex2ColorMap = {}; // series默认颜色索引,seriesIndex索引到color - this._symbol = this.option.symbolList; - this._sIndex2ShapeMap = {}; // series拐点图形类型,seriesIndex索引到shape type - - this.selectedMap = {}; - this.xMarkMap = {}; - - // 水平垂直双向series索引 ,position索引到seriesIndex - var _position2sIndexMap = { - top : [], - bottom : [], - left : [], - right : [] - }; - var xAxisIndex; - var yAxisIndex; - var xAxis; - var yAxis; - for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type == this.type) { - series[i] = this.reformOption(series[i]); - xAxisIndex = series[i].xAxisIndex; - yAxisIndex = series[i].yAxisIndex; - xAxis = this.component.xAxis.getAxis(xAxisIndex); - yAxis = this.component.yAxis.getAxis(yAxisIndex); - if (xAxis.type == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY - ) { - _position2sIndexMap[xAxis.getPosition()].push(i); - } - else if (yAxis.type == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY - ) { - _position2sIndexMap[yAxis.getPosition()].push(i); - } - } - } - // console.log(_position2sIndexMap); - for (var position in _position2sIndexMap) { - if (_position2sIndexMap[position].length > 0) { - this._buildSinglePosition( - position, _position2sIndexMap[position] - ); - } - } - this.addShapeList(); - }, - - /** - * 构建单个方向上的折线图 - * - * @param {number} seriesIndex 系列索引 - */ - _buildSinglePosition : function (position, seriesArray) { - var mapData = this._mapData(seriesArray); - var locationMap = mapData.locationMap; - var maxDataLength = mapData.maxDataLength; - - if (maxDataLength === 0 || locationMap.length === 0) { - return; - } - switch (position) { - case 'bottom' : - case 'top' : - this._buildHorizontal(seriesArray, maxDataLength, locationMap, this.xMarkMap); - break; - case 'left' : - case 'right' : - this._buildVertical(seriesArray, maxDataLength, locationMap, this.xMarkMap); - break; - } - - for (var i = 0, l = seriesArray.length; i < l; i++) { - this.buildMark(seriesArray[i]); - } - }, - - /** - * 数据整形 - * 数组位置映射到系列索引 - */ - _mapData : function (seriesArray) { - var series = this.series; - var serie; // 临时映射变量 - var dataIndex = 0; // 堆积数据所在位置映射 - var stackMap = {}; // 堆积数据位置映射,堆积组在二维中的第几项 - var magicStackKey = '__kener__stack__'; // 堆积命名,非堆积数据安单一堆积处理 - var stackKey; // 临时映射变量 - var serieName; // 临时映射变量 - var legend = this.component.legend; - var locationMap = []; // 需要返回的东西:数组位置映射到系列索引 - var maxDataLength = 0; // 需要返回的东西:最大数据长度 - var iconShape; - // 计算需要显示的个数和分配位置并记在下面这个结构里 - for (var i = 0, l = seriesArray.length; i < l; i++) { - serie = series[seriesArray[i]]; - serieName = serie.name; - - this._sIndex2ShapeMap[seriesArray[i]] - = this._sIndex2ShapeMap[seriesArray[i]] - || this.query(serie,'symbol') - || this._symbol[i % this._symbol.length]; - - if (legend){ - this.selectedMap[serieName] = legend.isSelected(serieName); - - this._sIndex2ColorMap[seriesArray[i]] - = legend.getColor(serieName); - - iconShape = legend.getItemShape(serieName); - if (iconShape) { - // 回调legend,换一个更形象的icon - iconShape.style.iconType = 'legendLineIcon'; - iconShape.style.symbol = - this._sIndex2ShapeMap[seriesArray[i]]; - - legend.setItemShape(serieName, iconShape); - } - } else { - this.selectedMap[serieName] = true; - this._sIndex2ColorMap[seriesArray[i]] - = this.zr.getColor(seriesArray[i]); - } - - if (this.selectedMap[serieName]) { - stackKey = serie.stack || (magicStackKey + seriesArray[i]); - if (typeof stackMap[stackKey] == 'undefined') { - stackMap[stackKey] = dataIndex; - locationMap[dataIndex] = [seriesArray[i]]; - dataIndex++; - } - else { - // 已经分配了位置就推进去就行 - locationMap[stackMap[stackKey]].push(seriesArray[i]); - } - } - // 兼职帮算一下最大长度 - maxDataLength = Math.max(maxDataLength, serie.data.length); - } - /* 调试输出 - var s = ''; - for (var i = 0, l = maxDataLength; i < l; i++) { - s = '['; - for (var j = 0, k = locationMap.length; j < k; j++) { - s +='[' - for (var m = 0, n = locationMap[j].length - 1; m < n; m++) { - s += series[locationMap[j][m]].data[i] + ',' - } - s += series[locationMap[j][locationMap[j].length - 1]] - .data[i]; - s += ']' - } - s += ']'; - console.log(s); - } - console.log(locationMap) - */ - - return { - locationMap : locationMap, - maxDataLength : maxDataLength - }; - }, - - /** - * 构建类目轴为水平方向的折线图系列 - */ - _buildHorizontal : function (seriesArray, maxDataLength, locationMap, xMarkMap) { - var series = this.series; - // 确定类目轴和数值轴,同一方向随便找一个即可 - var seriesIndex = locationMap[0][0]; - var serie = series[seriesIndex]; - var xAxisIndex = serie.xAxisIndex; - var categoryAxis = this.component.xAxis.getAxis(xAxisIndex); - var yAxisIndex; // 数值轴各异 - var valueAxis; // 数值轴各异 - - var x; - var y; - var lastYP; // 正向堆积处理 - var baseYP; - var lastYN; // 负向堆积处理 - var baseYN; - //var this.finalPLMap = {}; // 完成的point list(PL) - var curPLMap = {}; // 正在记录的point list(PL) - var data; - var value; - for (var i = 0, l = maxDataLength; i < l; i++) { - if (typeof categoryAxis.getNameByIndex(i) == 'undefined') { - // 系列数据超出类目轴长度 - break; - } - x = categoryAxis.getCoordByIndex(i); - for (var j = 0, k = locationMap.length; j < k; j++) { - // 堆积数据用第一条valueAxis - yAxisIndex = series[locationMap[j][0]].yAxisIndex || 0; - valueAxis = this.component.yAxis.getAxis(yAxisIndex); - baseYP = lastYP = baseYN = lastYN = valueAxis.getCoord(0); - for (var m = 0, n = locationMap[j].length; m < n; m++) { - seriesIndex = locationMap[j][m]; - serie = series[seriesIndex]; - data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; - curPLMap[seriesIndex] = curPLMap[seriesIndex] || []; - xMarkMap[seriesIndex] = xMarkMap[seriesIndex] - || { - min : Number.POSITIVE_INFINITY, - max : Number.NEGATIVE_INFINITY, - sum : 0, - counter : 0, - average : 0 - }; - if (value == '-') { - // 空数据则把正在记录的curPLMap添加到finalPLMap中 - if (curPLMap[seriesIndex].length > 0) { - this.finalPLMap[seriesIndex] = - this.finalPLMap[seriesIndex] || []; - - this.finalPLMap[seriesIndex].push( - curPLMap[seriesIndex] - ); - - curPLMap[seriesIndex] = []; - } - continue; - } - //y = valueAxis.getCoord(value); - if (value >= 0) { - // 正向堆积 - lastYP -= m > 0 - ? valueAxis.getCoordSize(value) - : (baseYP - valueAxis.getCoord(value)); - y = lastYP; - } - else if (value < 0){ - // 负向堆积 - lastYN += m > 0 - ? valueAxis.getCoordSize(value) - : (valueAxis.getCoord(value) - baseYN); - y = lastYN; - } - curPLMap[seriesIndex].push( - [x, y, i, categoryAxis.getNameByIndex(i), x, baseYP] - ); - - if (xMarkMap[seriesIndex].min > value) { - xMarkMap[seriesIndex].min = value; - xMarkMap[seriesIndex].minY = y; - xMarkMap[seriesIndex].minX = x; - } - if (xMarkMap[seriesIndex].max < value) { - xMarkMap[seriesIndex].max = value; - xMarkMap[seriesIndex].maxY = y; - xMarkMap[seriesIndex].maxX = x; - } - xMarkMap[seriesIndex].sum += value; - xMarkMap[seriesIndex].counter++; - } - } - // 补充空数据的拖拽提示 - lastYP = this.component.grid.getY(); - var symbolSize; - for (var j = 0, k = locationMap.length; j < k; j++) { - for (var m = 0, n = locationMap[j].length; m < n; m++) { - seriesIndex = locationMap[j][m]; - serie = series[seriesIndex]; - data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; - if (value != '-') { - // 只关心空数据 - continue; - } - if (this.deepQuery( - [data, serie, this.option], 'calculable' - ) - ) { - symbolSize = this.deepQuery( - [data, serie], - 'symbolSize' - ); - lastYP += symbolSize * 2 + 5; - y = lastYP; - this.shapeList.push(this._getCalculableItem( - seriesIndex, i, categoryAxis.getNameByIndex(i), - x, y, 'horizontal' - )); - } - } - } - } - - // 把剩余未完成的curPLMap全部添加到finalPLMap中 - for (var sId in curPLMap) { - if (curPLMap[sId].length > 0) { - this.finalPLMap[sId] = this.finalPLMap[sId] || []; - this.finalPLMap[sId].push(curPLMap[sId]); - curPLMap[sId] = []; - } - } - - for (var j = 0, k = locationMap.length; j < k; j++) { - for (var m = 0, n = locationMap[j].length; m < n; m++) { - seriesIndex = locationMap[j][m]; - if (xMarkMap[seriesIndex].counter > 0) { - xMarkMap[seriesIndex].average = - (xMarkMap[seriesIndex].sum / xMarkMap[seriesIndex].counter).toFixed(2) - - 0; - } - y = this.component.yAxis.getAxis(series[seriesIndex].yAxisIndex || 0) - .getCoord(xMarkMap[seriesIndex].average); - xMarkMap[seriesIndex].averageLine = [ - [this.component.grid.getX(), y], - [this.component.grid.getXend(), y] - ]; - - xMarkMap[seriesIndex].minLine = [ - [this.component.grid.getX(), xMarkMap[seriesIndex].minY], - [this.component.grid.getXend(), xMarkMap[seriesIndex].minY] - ]; - xMarkMap[seriesIndex].maxLine = [ - [this.component.grid.getX(), xMarkMap[seriesIndex].maxY], - [this.component.grid.getXend(), xMarkMap[seriesIndex].maxY] - ]; - } - } - - this._buildBorkenLine(seriesArray, this.finalPLMap, categoryAxis, 'horizontal'); - }, - - /** - * 构建类目轴为垂直方向的折线图系列 - */ - _buildVertical : function (seriesArray, maxDataLength, locationMap, xMarkMap) { - var series = this.series; - // 确定类目轴和数值轴,同一方向随便找一个即可 - var seriesIndex = locationMap[0][0]; - var serie = series[seriesIndex]; - var yAxisIndex = serie.yAxisIndex; - var categoryAxis = this.component.yAxis.getAxis(yAxisIndex); - var xAxisIndex; // 数值轴各异 - var valueAxis; // 数值轴各异 - - var x; - var y; - var lastXP; // 正向堆积处理 - var baseXP; - var lastXN; // 负向堆积处理 - var baseXN; - //var this.finalPLMap = {}; // 完成的point list(PL) - var curPLMap = {}; // 正在记录的point list(PL) - var data; - var value; - for (var i = 0, l = maxDataLength; i < l; i++) { - if (typeof categoryAxis.getNameByIndex(i) == 'undefined') { - // 系列数据超出类目轴长度 - break; - } - y = categoryAxis.getCoordByIndex(i); - for (var j = 0, k = locationMap.length; j < k; j++) { - // 堆积数据用第一条valueAxis - xAxisIndex = series[locationMap[j][0]].xAxisIndex || 0; - valueAxis = this.component.xAxis.getAxis(xAxisIndex); - baseXP = lastXP = baseXN = lastXN = valueAxis.getCoord(0); - for (var m = 0, n = locationMap[j].length; m < n; m++) { - seriesIndex = locationMap[j][m]; - serie = series[seriesIndex]; - data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; - curPLMap[seriesIndex] = curPLMap[seriesIndex] || []; - xMarkMap[seriesIndex] = xMarkMap[seriesIndex] - || { - min : Number.POSITIVE_INFINITY, - max : Number.NEGATIVE_INFINITY, - sum : 0, - counter : 0, - average : 0 - }; - if (value == '-') { - // 空数据则把正在记录的curPLMap添加到finalPLMap中 - if (curPLMap[seriesIndex].length > 0) { - this.finalPLMap[seriesIndex] = - this.finalPLMap[seriesIndex] || []; - - this.finalPLMap[seriesIndex].push( - curPLMap[seriesIndex] - ); - - curPLMap[seriesIndex] = []; - } - continue; - } - //x = valueAxis.getCoord(value); - if (value >= 0) { - // 正向堆积 - lastXP += m > 0 - ? valueAxis.getCoordSize(value) - : (valueAxis.getCoord(value) - baseXP); - x = lastXP; - } - else if (value < 0){ - // 负向堆积 - lastXN -= m > 0 - ? valueAxis.getCoordSize(value) - : (baseXN - valueAxis.getCoord(value)); - x = lastXN; - } - curPLMap[seriesIndex].push( - [x, y, i, categoryAxis.getNameByIndex(i), baseXP, y] - ); - - if (xMarkMap[seriesIndex].min > value) { - xMarkMap[seriesIndex].min = value; - xMarkMap[seriesIndex].minX = x; - xMarkMap[seriesIndex].minY = y; - } - if (xMarkMap[seriesIndex].max < value) { - xMarkMap[seriesIndex].max = value; - xMarkMap[seriesIndex].maxX = x; - xMarkMap[seriesIndex].maxY = y; - } - xMarkMap[seriesIndex].sum += value; - xMarkMap[seriesIndex].counter++; - } - } - // 补充空数据的拖拽提示 - lastXP = this.component.grid.getXend(); - var symbolSize; - for (var j = 0, k = locationMap.length; j < k; j++) { - for (var m = 0, n = locationMap[j].length; m < n; m++) { - seriesIndex = locationMap[j][m]; - serie = series[seriesIndex]; - data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; - if (value != '-') { - // 只关心空数据 - continue; - } - if (this.deepQuery( - [data, serie, this.option], 'calculable' - ) - ) { - symbolSize = this.deepQuery( - [data, serie], - 'symbolSize' - ); - lastXP -= symbolSize * 2 + 5; - x = lastXP; - this.shapeList.push(this._getCalculableItem( - seriesIndex, i, categoryAxis.getNameByIndex(i), - x, y, 'vertical' - )); - } - } - } - } - - // 把剩余未完成的curPLMap全部添加到finalPLMap中 - for (var sId in curPLMap) { - if (curPLMap[sId].length > 0) { - this.finalPLMap[sId] = this.finalPLMap[sId] || []; - this.finalPLMap[sId].push(curPLMap[sId]); - curPLMap[sId] = []; - } - } - - for (var j = 0, k = locationMap.length; j < k; j++) { - for (var m = 0, n = locationMap[j].length; m < n; m++) { - seriesIndex = locationMap[j][m]; - if (xMarkMap[seriesIndex].counter > 0) { - xMarkMap[seriesIndex].average = - (xMarkMap[seriesIndex].sum / xMarkMap[seriesIndex].counter).toFixed(2) - - 0; - } - - x = this.component.xAxis.getAxis(series[seriesIndex].xAxisIndex || 0) - .getCoord(xMarkMap[seriesIndex].average); - - xMarkMap[seriesIndex].averageLine = [ - [x, this.component.grid.getYend()], - [x, this.component.grid.getY()] - ]; - xMarkMap[seriesIndex].minLine = [ - [xMarkMap[seriesIndex].minX, this.component.grid.getYend()], - [xMarkMap[seriesIndex].minX, this.component.grid.getY()] - ]; - xMarkMap[seriesIndex].maxLine = [ - [xMarkMap[seriesIndex].maxX, this.component.grid.getYend()], - [xMarkMap[seriesIndex].maxX, this.component.grid.getY()] - ]; - } - } - - this._buildBorkenLine(seriesArray, this.finalPLMap, categoryAxis, 'vertical'); - }, - - /** - * 生成折线和折线上的拐点 - */ - _buildBorkenLine : function (seriesArray, pointList, categoryAxis, orient) { - var series = this.series; - var defaultColor; - - // 折线相关 - var lineWidth; - var lineType; - var lineColor; - var normalColor; - - // 填充相关 - var isFill; - var fillNormalColor; - - var serie; - var data; - var seriesPL; - var singlePL; - var brokenLineShape; - var halfSmoothPolygonShape; - - var isLarge; - - // 堆积层叠需求,反顺序构建 - var seriesIndex; - for (var sIdx = seriesArray.length - 1; sIdx >= 0; sIdx--) { - seriesIndex = seriesArray[sIdx]; - serie = series[seriesIndex]; - seriesPL = pointList[seriesIndex]; - if (serie.type == this.type && typeof seriesPL != 'undefined') { - defaultColor = this._sIndex2ColorMap[seriesIndex]; - // 多级控制 - lineWidth = this.query( - serie, 'itemStyle.normal.lineStyle.width' - ); - lineType = this.query( - serie, 'itemStyle.normal.lineStyle.type' - ); - lineColor = this.query( - serie, 'itemStyle.normal.lineStyle.color' - ); - normalColor = this.getItemStyleColor( - this.query(serie, 'itemStyle.normal.color'), seriesIndex, -1 - ); - - isFill = typeof this.query( - serie, 'itemStyle.normal.areaStyle' - ) != 'undefined'; - - fillNormalColor = this.query( - serie, 'itemStyle.normal.areaStyle.color' - ); - - for (var i = 0, l = seriesPL.length; i < l; i++) { - singlePL = seriesPL[i]; - isLarge = this._isLarge(orient, singlePL); - if (!isLarge) { // 非大数据模式才显示拐点symbol - for (var j = 0, k = singlePL.length; j < k; j++) { - data = serie.data[singlePL[j][2]]; - if (this.deepQuery( - [data, serie], 'showAllSymbol' - ) // 全显示 - || (categoryAxis.isMainAxis(singlePL[j][2]) - && this.deepQuery( - [data, serie], 'symbol' - ) != 'none' - ) // 主轴非空 - || this.deepQuery( - [data, serie, this.option], - 'calculable' - ) // 可计算 - ) { - this.shapeList.push(this._getSymbol( - seriesIndex, - singlePL[j][2], // dataIndex - singlePL[j][3], // name - singlePL[j][0], // x - singlePL[j][1], // y - orient - )); - } - } - } - else { - // 大数据模式截取pointList - singlePL = this._getLargePointList(orient, singlePL); - } - - // 折线图 - brokenLineShape = new BrokenLineShape({ - zlevel : this._zlevelBase, - style : { - miterLimit: lineWidth, - pointList : singlePL, - strokeColor : lineColor - || normalColor - || defaultColor, - lineWidth : lineWidth, - lineType : lineType, - smooth : this._getSmooth(serie.smooth), - shadowColor : this.query( - serie, - 'itemStyle.normal.lineStyle.shadowColor' - ), - shadowBlur: this.query( - serie, - 'itemStyle.normal.lineStyle.shadowBlur' - ), - shadowOffsetX: this.query( - serie, - 'itemStyle.normal.lineStyle.shadowOffsetX' - ), - shadowOffsetY: this.query( - serie, - 'itemStyle.normal.lineStyle.shadowOffsetY' - ) - }, - hoverable : false, - _main : true, - _seriesIndex : seriesIndex, - _orient : orient - }); - - ecData.pack( - brokenLineShape, - series[seriesIndex], seriesIndex, - 0, i, series[seriesIndex].name - ); - - this.shapeList.push(brokenLineShape); - - if (isFill) { - halfSmoothPolygonShape = new HalfSmoothPolygonShape({ - zlevel : this._zlevelBase, - style : { - miterLimit: lineWidth, - pointList : zrUtil.clone(singlePL).concat([ - [ - singlePL[singlePL.length - 1][4], - singlePL[singlePL.length - 1][5] - ], - [ - singlePL[0][4], - singlePL[0][5] - ] - ]), - brushType : 'fill', - smooth : this._getSmooth(serie.smooth), - color : fillNormalColor - ? fillNormalColor - : zrColor.alpha(defaultColor,0.5) - }, - hoverable : false, - _main : true, - _seriesIndex : seriesIndex, - _orient : orient - }); - ecData.pack( - halfSmoothPolygonShape, - series[seriesIndex], seriesIndex, - 0, i, series[seriesIndex].name - ); - this.shapeList.push(halfSmoothPolygonShape); - } - } - } - } - }, - - _isLarge : function(orient, singlePL) { - if (singlePL.length < 2) { - return false; - } - else { - return orient == 'horizontal' - ? (Math.abs(singlePL[0][0] - singlePL[1][0]) < 0.5) - : (Math.abs(singlePL[0][1] - singlePL[1][1]) < 0.5); - } - }, - - /** - * 大规模pointList优化 - */ - _getLargePointList : function(orient, singlePL) { - var total; - if (orient == 'horizontal') { - total = this.component.grid.getWidth(); - } - else { - total = this.component.grid.getHeight(); - } - - var len = singlePL.length; - var newList = []; - for (var i = 0; i < total; i++) { - newList[i] = singlePL[Math.floor(len / total * i)]; - } - return newList; - }, - - _getSmooth : function (isSmooth/*, pointList, orient*/) { - if (isSmooth) { - /* 不科学啊,发现0.3通用了 - var delta; - if (orient == 'horizontal') { - delta = Math.abs(pointList[0][0] - pointList[1][0]); - } - else { - delta = Math.abs(pointList[0][1] - pointList[1][1]); - } - */ - return 0.3; - } - else { - return 0; - } - }, - - /** - * 生成空数据所需的可计算提示图形 - */ - _getCalculableItem : function (seriesIndex, dataIndex, name, x, y, orient) { - var series = this.series; - var color = series[seriesIndex].calculableHolderColor - || this.ecTheme.calculableHolderColor; - - var itemShape = this._getSymbol( - seriesIndex, dataIndex, name, - x, y, orient - ); - itemShape.style.color = color; - itemShape.style.strokeColor = color; - itemShape.rotation = [0,0]; - itemShape.hoverable = false; - itemShape.draggable = false; - itemShape.style.text = undefined; - - return itemShape; - }, - - /** - * 生成折线图上的拐点图形 - */ - _getSymbol : function (seriesIndex, dataIndex, name, x, y, orient) { - var series = this.series; - var serie = series[seriesIndex]; - var data = serie.data[dataIndex]; - - var itemShape = this.getSymbolShape( - serie, seriesIndex, data, dataIndex, name, - x, y, - this._sIndex2ShapeMap[seriesIndex], - this._sIndex2ColorMap[seriesIndex], - '#fff', - orient == 'vertical' ? 'horizontal' : 'vertical' // 翻转 - ); - itemShape.zlevel = this._zlevelBase + 1; - - if (this.deepQuery([data, serie, this.option], 'calculable')) { - this.setCalculable(itemShape); - itemShape.draggable = true; - } - - return itemShape; - }, - - // 位置转换 - getMarkCoord : function (seriesIndex, mpData) { - var serie = this.series[seriesIndex]; - var xMarkMap = this.xMarkMap[seriesIndex]; - var xAxis = this.component.xAxis.getAxis(serie.xAxisIndex); - var yAxis = this.component.yAxis.getAxis(serie.yAxisIndex); - - if (mpData.type - && (mpData.type == 'max' || mpData.type == 'min' || mpData.type == 'average') - ) { - // 特殊值内置支持 - return [ - xMarkMap[mpData.type + 'X'], - xMarkMap[mpData.type + 'Y'], - xMarkMap[mpData.type + 'Line'], - xMarkMap[mpData.type] - ]; - } - - return [ - typeof mpData.xAxis != 'string' && xAxis.getCoordByIndex - ? xAxis.getCoordByIndex(mpData.xAxis || 0) - : xAxis.getCoord(mpData.xAxis || 0), - - typeof mpData.yAxis != 'string' && yAxis.getCoordByIndex - ? yAxis.getCoordByIndex(mpData.yAxis || 0) - : yAxis.getCoord(mpData.yAxis || 0) - ]; - }, - - /** - * 刷新 - */ - refresh : function (newOption) { - if (newOption) { - this.option = newOption; - this.series = newOption.series; - } - - this.backupShapeList(); - this._buildShape(); - }, - - ontooltipHover : function (param, tipShape) { - var seriesIndex = param.seriesIndex; - var dataIndex = param.dataIndex; - var seriesPL; - var singlePL; - var len = seriesIndex.length; - while (len--) { - seriesPL = this.finalPLMap[seriesIndex[len]]; - if (seriesPL) { - for (var i = 0, l = seriesPL.length; i < l; i++) { - singlePL = seriesPL[i]; - for (var j = 0, k = singlePL.length; j < k; j++) { - if (dataIndex == singlePL[j][2]) { - tipShape.push(this._getSymbol( - seriesIndex[len], // seriesIndex - singlePL[j][2], // dataIndex - singlePL[j][3], // name - singlePL[j][0], // x - singlePL[j][1], // y - 'horizontal' - )); - } - } - } - } - } - }, - - /** - * 动态数据增加动画 - */ - addDataAnimation : function (params) { - var series = this.series; - var aniMap = {}; // seriesIndex索引参数 - for (var i = 0, l = params.length; i < l; i++) { - aniMap[params[i][0]] = params[i]; - } - var x; - var dx; - var y; - var dy; - var seriesIndex; - var pointList; - var isHorizontal; // 是否横向布局, isHorizontal; - for (var i = this.shapeList.length - 1; i >= 0; i--) { - seriesIndex = this.shapeList[i]._seriesIndex; - if (aniMap[seriesIndex] && !aniMap[seriesIndex][3]) { - // 有数据删除才有移动的动画 - if (this.shapeList[i]._main && this.shapeList[i].style.pointList.length > 1) { - pointList = this.shapeList[i].style.pointList; - // 主线动画 - dx = Math.abs(pointList[0][0] - pointList[1][0]); - dy = Math.abs(pointList[0][1] - pointList[1][1]); - isHorizontal = - this.shapeList[i]._orient == 'horizontal'; - - if (aniMap[seriesIndex][2]) { - // 队头加入删除末尾 - if (this.shapeList[i].type == 'polygon') { - //区域图 - var len = pointList.length; - this.shapeList[i].style.pointList[len - 3] - = pointList[len - 2]; - isHorizontal - ? (this.shapeList[i].style.pointList[len - 3][0] - = pointList[len - 4][0] - ) - : (this.shapeList[i].style.pointList[len - 3][1] - = pointList[len - 4][1] - ); - this.shapeList[i].style.pointList[len - 2] - = pointList[len - 1]; - } - this.shapeList[i].style.pointList.pop(); - - isHorizontal ? (x = dx, y = 0) : (x = 0, y = -dy); - } - else { - // 队尾加入删除头部 - this.shapeList[i].style.pointList.shift(); - if (this.shapeList[i].type == 'polygon') { - //区域图 - var targetPoint = - this.shapeList[i].style.pointList.pop(); - isHorizontal - ? (targetPoint[0] = pointList[0][0]) - : (targetPoint[1] = pointList[0][1]); - this.shapeList[i].style.pointList.push( - targetPoint - ); - } - isHorizontal ? (x = -dx, y = 0) : (x = 0, y = dy); - } - - this.zr.modShape( - this.shapeList[i].id, - { - style : { - pointList: this.shapeList[i].style.pointList - } - }, - true - ); - } - else { - // 拐点动画 - if (aniMap[seriesIndex][2] - && this.shapeList[i]._dataIndex - == series[seriesIndex].data.length - 1 - ) { - // 队头加入删除末尾 - this.zr.delShape(this.shapeList[i].id); - continue; - } - else if (!aniMap[seriesIndex][2] - && this.shapeList[i]._dataIndex === 0 - ) { - // 队尾加入删除头部 - this.zr.delShape(this.shapeList[i].id); - continue; - } - } - this.shapeList[i].position = [0, 0]; - this.zr.animate(this.shapeList[i].id, '') - .when( - 500, - {position : [x, y]} - ) - .start(); - } - } - } - }; - - function legendLineIcon(ctx, style) { - var x = style.x; - var y = style.y; - var width = style.width; - var height = style.height; - - var dy = height / 2; - - if (style.symbol.match('empty')) { - ctx.fillStyle = '#fff'; - } - style.brushType = 'both'; - - var symbol = style.symbol.replace('empty', '').toLowerCase(); - if (symbol.match('star')) { - dy = (symbol.replace('star','') - 0) || 5; - y -= 1; - symbol = 'star'; - } - else if (symbol == 'rectangle' || symbol == 'arrow') { - x += (width - height) / 2; - width = height; - } - - var imageLocation = ''; - if (symbol.match('image')) { - imageLocation = symbol.replace( - new RegExp('^image:\\/\\/'), '' - ); - symbol = 'image'; - x += Math.round((width - height) / 2) - 1; - width = height = height + 2; - } - symbol = IconShape.prototype.iconLibrary[symbol]; - - if (symbol) { - var x2 = style.x; - var y2 = style.y; - ctx.moveTo(x2, y2 + dy); - ctx.lineTo(x2 + 5, y2 + dy); - ctx.moveTo(x2 + style.width - 5, y2 + dy); - ctx.lineTo(x2 + style.width, y2 + dy); - - symbol(ctx, { - x : x + 4, - y : y + 4, - width : width - 8, - height : height - 8, - n : dy, - image : imageLocation - }); - - } - else { - ctx.moveTo(x, y + dy); - ctx.lineTo(x + width, y + dy); - } - } - IconShape.prototype.iconLibrary['legendLineIcon'] = legendLineIcon; - - zrUtil.inherits(Line, ChartBase); - zrUtil.inherits(Line, ComponentBase); - - // 图表注册 - require('../chart').define('line', Line); - - return Line; +/** + * zrender: 图形空间辅助类 + * + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * pissang (https://www.github.com/pissang) + * + * isInside:是否在区域内部 + * isOutside:是否在区域外部 + * getTextWidth:测算单行文本宽度 + */ +define( + 'zrender/tool/area',['require','./util','./curve'],function (require) { + + + + var util = require('./util'); + var curve = require('./curve'); + + var _ctx; + + var _textWidthCache = {}; + var _textHeightCache = {}; + var _textWidthCacheCounter = 0; + var _textHeightCacheCounter = 0; + var TEXT_CACHE_MAX = 5000; + + var PI2 = Math.PI * 2; + + function normalizeRadian(angle) { + angle %= PI2; + if (angle < 0) { + angle += PI2; + } + return angle; + } + /** + * 包含判断 + * + * @param {Object} shape : 图形 + * @param {Object} area : 目标区域 + * @param {number} x : 横坐标 + * @param {number} y : 纵坐标 + */ + function isInside(shape, area, x, y) { + if (!area || !shape) { + // 无参数或不支持类型 + return false; + } + var zoneType = shape.type; + + _ctx = _ctx || util.getContext(); + + // 未实现或不可用时(excanvas不支持)则数学运算,主要是line,brokenLine,ring + var _mathReturn = _mathMethod(shape, area, x, y); + if (typeof _mathReturn != 'undefined') { + return _mathReturn; + } + + if (shape.buildPath && _ctx.isPointInPath) { + return _buildPathMethod(shape, _ctx, area, x, y); + } + + // 上面的方法都行不通时 + switch (zoneType) { + case 'heart': // 心形---------10 // Todo,不精确 + case 'droplet':// 水滴----------11 // Todo,不精确 + case 'ellipse': // Todo,不精确 + return true; + // 旋轮曲线 不准确 + case 'trochoid': + var _r = area.location == 'out' + ? area.r1 + area.r2 + area.d + : area.r1 - area.r2 + area.d; + return isInsideCircle(area, x, y, _r); + // 玫瑰线 不准确 + case 'rose' : + return isInsideCircle(area, x, y, area.maxr); + // 路径,椭圆,曲线等-----------------13 + default: + return false; // Todo,暂不支持 + } + } + + /** + * 用数学方法判断,三个方法中最快,但是支持的shape少 + * + * @param {Object} shape : 图形 + * @param {Object} area :目标区域 + * @param {number} x : 横坐标 + * @param {number} y : 纵坐标 + * @return {boolean=} true表示坐标处在图形中 + */ + function _mathMethod(shape, area, x, y) { + var zoneType = shape.type; + // 在矩形内则部分图形需要进一步判断 + switch (zoneType) { + // 贝塞尔曲线 + case 'bezier-curve': + if (typeof(area.cpX2) === 'undefined') { + return isInsideQuadraticStroke( + area.xStart, area.yStart, + area.cpX1, area.cpY1, + area.xEnd, area.yEnd, + area.lineWidth, x, y + ); + } + return isInsideCubicStroke( + area.xStart, area.yStart, + area.cpX1, area.cpY1, + area.cpX2, area.cpY2, + area.xEnd, area.yEnd, + area.lineWidth, x, y + ); + // 线 + case 'line': + return isInsideLine( + area.xStart, area.yStart, + area.xEnd, area.yEnd, + area.lineWidth, x, y + ); + // 折线 + case 'broken-line': + return isInsideBrokenLine( + area.pointList, area.lineWidth, x, y + ); + // 圆环 + case 'ring': + return isInsideRing( + area.x, area.y, area.r0, area.r, x, y + ); + // 圆形 + case 'circle': + return isInsideCircle( + area.x, area.y, area.r, x, y + ); + // 扇形 + case 'sector': + return isInsideSector(area, x, y); + // 多边形 + case 'path': + return isInsidePath( + area.pathArray, Math.max(area.lineWidth, 5), + area.brushType, x, y + ); + case 'polygon': + case 'star': + case 'isogon': + return isInsidePolygon(area.pointList, x, y); + // 文本 + case 'text': + var rect = area.__rect || shape.getRect(area); + return isInsideRect( + rect.x, rect.y, rect.width, rect.height, x, y + ); + // 矩形 + case 'rectangle': + // 图片 + case 'image': + return isInsideRect( + area.x, area.y, area.width, area.height, x, y + ); + } + } + + /** + * 通过buildPath方法来判断,三个方法中较快,但是不支持线条类型的shape, + * 而且excanvas不支持isPointInPath方法 + * + * @param {Object} shape : shape + * @param {Object} context : 上下文 + * @param {Object} area :目标区域 + * @param {number} x : 横坐标 + * @param {number} y : 纵坐标 + * @return {boolean} true表示坐标处在图形中 + */ + function _buildPathMethod(shape, context, area, x, y) { + // 图形类实现路径创建了则用类的path + context.beginPath(); + shape.buildPath(context, area); + context.closePath(); + return context.isPointInPath(x, y); + } + + /** + * !isInside + */ + function isOutside(shape, area, x, y) { + return !isInside(shape, area, x, y); + } + + /** + * 线段包含判断 + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @param {number} lineWidth + * @param {number} x + * @param {number} y + * @return {boolean} + */ + function isInsideLine(x0, y0, x1, y1, lineWidth, x, y) { + if (lineWidth === 0) { + return false; + } + var _l = Math.max(lineWidth, 5); + var _a = 0; + var _b = x0; + // Quick reject + if ( + (y > y0 + _l && y > y1 + _l) + || (y < y0 - _l && y < y1 - _l) + || (x > x0 + _l && x > x1 + _l) + || (x < x0 - _l && x < x1 - _l) + ) { + return false; + } + + if (x0 !== x1) { + _a = (y0 - y1) / (x0 - x1); + _b = (x0 * y1 - x1 * y0) / (x0 - x1) ; + } + else { + return Math.abs(x - x0) <= _l / 2; + } + var tmp = _a * x - y + _b; + var _s = tmp * tmp / (_a * _a + 1); + return _s <= _l / 2 * _l / 2; + } + + /** + * 三次贝塞尔曲线描边包含判断 + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @param {number} x3 + * @param {number} y3 + * @param {number} lineWidth + * @param {number} x + * @param {number} y + * @return {boolean} + */ + function isInsideCubicStroke( + x0, y0, x1, y1, x2, y2, x3, y3, + lineWidth, x, y + ) { + if (lineWidth === 0) { + return false; + } + var _l = Math.max(lineWidth, 5); + // Quick reject + if ( + (y > y0 + _l && y > y1 + _l && y > y2 + _l && y > y3 + _l) + || (y < y0 - _l && y < y1 - _l && y < y2 - _l && y < y3 - _l) + || (x > x0 + _l && x > x1 + _l && x > x2 + _l && x > x3 + _l) + || (x < x0 - _l && x < x1 - _l && x < x2 - _l && x < x3 - _l) + ) { + return false; + } + var d = curve.cubicProjectPoint( + x0, y0, x1, y1, x2, y2, x3, y3, + x, y, null + ); + return d <= _l / 2; + } + + /** + * 二次贝塞尔曲线描边包含判断 + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @param {number} lineWidth + * @param {number} x + * @param {number} y + * @return {boolean} + */ + function isInsideQuadraticStroke( + x0, y0, x1, y1, x2, y2, + lineWidth, x, y + ) { + if (lineWidth === 0) { + return false; + } + var _l = Math.max(lineWidth, 5); + // Quick reject + if ( + (y > y0 + _l && y > y1 + _l && y > y2 + _l) + || (y < y0 - _l && y < y1 - _l && y < y2 - _l) + || (x > x0 + _l && x > x1 + _l && x > x2 + _l) + || (x < x0 - _l && x < x1 - _l && x < x2 - _l) + ) { + return false; + } + var d = curve.quadraticProjectPoint( + x0, y0, x1, y1, x2, y2, + x, y, null + ); + return d <= _l / 2; + } + + /** + * 圆弧描边包含判断 + * @param {number} cx + * @param {number} cy + * @param {number} r + * @param {number} startAngle + * @param {number} endAngle + * @param {boolean} anticlockwise + * @param {number} lineWidth + * @param {number} x + * @param {number} y + * @return {Boolean} + */ + function isInsideArcStroke( + cx, cy, r, startAngle, endAngle, anticlockwise, + lineWidth, x, y + ) { + if (lineWidth === 0) { + return false; + } + var _l = Math.max(lineWidth, 5); + + x -= cx; + y -= cy; + var d = Math.sqrt(x * x + y * y); + if ((d - _l > r) || (d + _l < r)) { + return false; + } + if (anticlockwise) { + startAngle = normalizeRadian(endAngle); + endAngle = normalizeRadian(startAngle); + } else { + startAngle = normalizeRadian(startAngle); + endAngle = normalizeRadian(endAngle); + } + if (startAngle > endAngle) { + endAngle += PI2; + } + + var angle = Math.atan2(y, x); + if (angle < 0) { + angle += PI2; + } + return (angle >= startAngle && angle <= endAngle) + || (angle + PI2 >= startAngle && angle + PI2 <= endAngle); + } + + function isInsideBrokenLine(points, lineWidth, x, y) { + var lineWidth = Math.max(lineWidth, 10); + for (var i = 0, l = points.length - 1; i < l; i++) { + var x0 = points[i][0]; + var y0 = points[i][1]; + var x1 = points[i + 1][0]; + var y1 = points[i + 1][1]; + + if (isInsideLine(x0, y0, x1, y1, lineWidth, x, y)) { + return true; + } + } + + return false; + } + + function isInsideRing(cx, cy, r0, r, x, y) { + var d = (x - cx) * (x - cx) + (y - cy) * (y - cy); + return (d < r * r) && (d > r0 * r0); + } + + /** + * 矩形包含判断 + */ + function isInsideRect(x0, y0, width, height, x, y) { + return x >= x0 && x <= (x0 + width) + && y >= y0 && y <= (y0 + height); + } + + /** + * 圆形包含判断 + */ + function isInsideCircle(x0, y0, r, x, y) { + return (x - x0) * (x - x0) + (y - y0) * (y - y0) + < r * r; + } + + /** + * 扇形包含判断 + */ + function isInsideSector(area, x, y) { + if (!isInsideRing(area.x, area.y, area.r0 || 0, area.r, x, y)) { + // 大圆外或者小圆内直接false + return false; + } + + // 判断夹角 + if (Math.abs(area.endAngle - area.startAngle) >= 360) { + // 大于360度的扇形,在环内就为true + return true; + } + + var angle = (360 + - Math.atan2(y - area.y, x - area.x) / Math.PI + * 180) + % 360; + var endA = (360 + area.endAngle) % 360; + var startA = (360 + area.startAngle) % 360; + if (endA > startA) { + return (angle >= startA && angle <= endA); + } + + return !(angle >= endA && angle <= startA); + } + + /** + * 多边形包含判断 + * 与 canvas 一样采用 non-zero winding rule + */ + function isInsidePolygon(points, x, y) { + var N = points.length; + var w = 0; + + for (var i = 0, j = N - 1; i < N; i++) { + var x0 = points[j][0]; + var y0 = points[j][1]; + var x1 = points[i][0]; + var y1 = points[i][1]; + w += windingLine(x0, y0, x1, y1, x, y); + j = i; + } + return w !== 0; + } + + function windingLine(x0, y0, x1, y1, x, y) { + if ((y > y0 && y > y1) || (y < y0 && y < y1)) { + return 0; + } + if (y1 == y0) { + return 0; + } + var dir = y1 < y0 ? 1 : -1; + var t = (y - y0) / (y1 - y0); + var x_ = t * (x1 - x0) + x0; + + return x_ > x ? dir : 0; + } + + // 临时数组 + var roots = [-1, -1, -1]; + var extrema = [-1, -1]; + + function swapExtrema() { + var tmp = extrema[0]; + extrema[0] = extrema[1]; + extrema[1] = tmp; + } + function windingCubic(x0, y0, x1, y1, x2, y2, x3, y3, x, y) { + // Quick reject + if ( + (y > y0 && y > y1 && y > y2 && y > y3) + || (y < y0 && y < y1 && y < y2 && y < y3) + ) { + return 0; + } + var nRoots = curve.cubicRootAt(y0, y1, y2, y3, y, roots); + if (nRoots === 0) { + return 0; + } + else { + var w = 0; + var nExtrema = -1; + var y0_, y1_; + for (var i = 0; i < nRoots; i++) { + var t = roots[i]; + var x_ = curve.cubicAt(x0, x1, x2, x3, t); + if (x_ < x) { // Quick reject + continue; + } + if (nExtrema < 0) { + nExtrema = curve.cubicExtrema(y0, y1, y2, y3, extrema); + if (extrema[1] < extrema[0] && nExtrema > 1) { + swapExtrema(); + } + y0_ = curve.cubicAt(y0, y1, y2, y3, extrema[0]); + if (nExtrema > 1) { + y1_ = curve.cubicAt(y0, y1, y2, y3, extrema[1]); + } + } + if (nExtrema == 2) { + // 分成三段单调函数 + if (t < extrema[0]) { + w += y0_ < y0 ? 1 : -1; + } + else if (t < extrema[1]) { + w += y1_ < y0_ ? 1 : -1; + } + else { + w += y3 < y1_ ? 1 : -1; + } + } + else { + // 分成两段单调函数 + if (t < extrema[0]) { + w += y0_ < y0 ? 1 : -1; + } + else { + w += y3 < y0_ ? 1 : -1; + } + } + } + return w; + } + } + + function windingQuadratic(x0, y0, x1, y1, x2, y2, x, y) { + // Quick reject + if ( + (y > y0 && y > y1 && y > y2) + || (y < y0 && y < y1 && y < y2) + ) { + return 0; + } + var nRoots = curve.quadraticRootAt(y0, y1, y2, y, roots); + if (nRoots === 0) { + return 0; + } + else { + var t = curve.quadraticExtremum(y0, y1, y2); + if (t >=0 && t <= 1) { + var w = 0; + var y_ = curve.quadraticAt(y0, y1, y2, t); + for (var i = 0; i < nRoots; i++) { + var x_ = curve.quadraticAt(x0, x1, x2, roots[i]); + if (x_ > x) { + continue; + } + if (roots[i] < t) { + w += y_ < y0 ? 1 : -1; + } + else { + w += y2 < y_ ? 1 : -1; + } + } + return w; + } + else { + var x_ = curve.quadraticAt(x0, x1, x2, roots[0]); + if (x_ > x) { + return 0; + } + return y2 < y0 ? 1 : -1; + } + } + } + + // TODO + // Arc 旋转 + function windingArc( + cx, cy, r, startAngle, endAngle, anticlockwise, x, y + ) { + y -= cy; + if (y > r || y < -r) { + return 0; + } + var tmp = Math.sqrt(r * r - y * y); + roots[0] = -tmp; + roots[1] = tmp; + + if (anticlockwise) { + startAngle = normalizeRadian(endAngle); + endAngle = normalizeRadian(startAngle); + } else { + startAngle = normalizeRadian(startAngle); + endAngle = normalizeRadian(endAngle); + } + if (startAngle > endAngle) { + endAngle += PI2; + } + + var w = 0; + for (var i = 0; i < 2; i++) { + var x_ = roots[i]; + if (x_ + cx > x) { + var angle = Math.atan2(y, x_); + var dir = anticlockwise ? 1 : -1; + if (angle < 0) { + angle = PI2 + angle; + } + if ( + (angle >= startAngle && angle <= endAngle) + || (angle + PI2 >= startAngle && angle + PI2 <= endAngle) + ) { + if (angle > Math.PI / 2 && angle < Math.PI * 1.5) { + dir = -dir; + } + w += dir; + } + } + } + return w; + } + + /** + * 路径包含判断 + * 与 canvas 一样采用 non-zero winding rule + */ + function isInsidePath(pathArray, lineWidth, brushType, x, y) { + var w = 0; + var xi = 0; + var yi = 0; + var x0 = 0; + var y0 = 0; + var beginSubpath = true; + + var hasStroke = brushType === 'stroke' || brushType === 'both'; + var hasFill = brushType === 'fill' || brushType === 'both'; + + // var roots = [-1, -1, -1]; + for (var i = 0; i < pathArray.length; i++) { + var seg = pathArray[i]; + var p = seg.points; + // Begin a new subpath + if (beginSubpath || seg.command === 'M') { + if (i > 0) { + // Close previous subpath + if (hasFill) { + w += windingLine(xi, yi, x0, y0, x, y); + } + if (w !== 0) { + return true; + } + } + x0 = p[p.length - 2]; + y0 = p[p.length - 1]; + beginSubpath = false; + } + switch (seg.command) { + case 'M': + xi = p[0]; + yi = p[1]; + break; + case 'L': + if (hasStroke) { + if (isInsideLine( + xi, yi, p[0], p[1], lineWidth, x, y + )) { + return true; + } + } + if (hasFill) { + w += windingLine(xi, yi, p[0], p[1], x, y); + } + xi = p[0]; + yi = p[1]; + break; + case 'C': + if (hasStroke) { + if (isInsideCubicStroke( + xi, yi, p[0], p[1], p[2], p[3], p[4], p[5], + lineWidth, x, y + )) { + return true; + } + } + if (hasFill) { + w += windingCubic( + xi, yi, p[0], p[1], p[2], p[3], p[4], p[5], x, y + ); + } + xi = p[4]; + yi = p[5]; + break; + case 'Q': + if (hasStroke) { + if (isInsideQuadraticStroke( + xi, yi, p[0], p[1], p[2], p[3], + lineWidth, x, y + )) { + return true; + } + } + if (hasFill) { + w += windingQuadratic( + xi, yi, p[0], p[1], p[2], p[3], x, y + ); + } + xi = p[2]; + yi = p[3]; + break; + case 'A': + // TODO Arc 旋转 + // TODO Arc 判断的开销比较大 + var cx = p[0]; + var cy = p[1]; + var rx = p[2]; + var ry = p[3]; + var theta = p[4]; + var dTheta = p[5]; + var x1 = Math.cos(theta) * rx + cx; + var y1 = Math.sin(theta) * ry + cy; + w += windingLine(xi, yi, x1, y1); + // zr 使用scale来模拟椭圆, 这里也对x做一定的缩放 + var _x = (x - cx) * ry / rx + cx; + if (hasStroke) { + if (isInsideArcStroke( + cx, cy, ry, theta, theta + dTheta, 1 - p[7], + lineWidth, _x, y + )) { + return true; + } + } + if (hasFill) { + w += windingArc( + cx, cy, ry, theta, theta + dTheta, 1 - p[7], + _x, y + ); + } + xi = Math.cos(theta + dTheta) * rx + cx; + yi = Math.sin(theta + dTheta) * ry + cy; + break; + case 'z': + if (hasStroke) { + if (isInsideLine( + xi, yi, x0, y0, lineWidth, x, y + )) { + return true; + } + } + beginSubpath = true; + break; + } + } + if (hasFill) { + w += windingLine(xi, yi, x0, y0, x, y); + } + return w !== 0; + } + + /** + * 测算多行文本宽度 + * @param {Object} text + * @param {Object} textFont + */ + function getTextWidth(text, textFont) { + var key = text + ':' + textFont; + if (_textWidthCache[key]) { + return _textWidthCache[key]; + } + _ctx = _ctx || util.getContext(); + _ctx.save(); + + if (textFont) { + _ctx.font = textFont; + } + + text = (text + '').split('\n'); + var width = 0; + for (var i = 0, l = text.length; i < l; i++) { + width = Math.max( + _ctx.measureText(text[i]).width, + width + ); + } + _ctx.restore(); + + _textWidthCache[key] = width; + if (++_textWidthCacheCounter > TEXT_CACHE_MAX) { + // 内存释放 + _textWidthCacheCounter = 0; + _textWidthCache = {}; + } + + return width; + } + + /** + * 测算多行文本高度 + * @param {Object} text + * @param {Object} textFont + */ + function getTextHeight(text, textFont) { + var key = text + ':' + textFont; + if (_textHeightCache[key]) { + return _textHeightCache[key]; + } + + _ctx = _ctx || util.getContext(); + + _ctx.save(); + if (textFont) { + _ctx.font = textFont; + } + + text = (text + '').split('\n'); + // 比较粗暴 + var height = (_ctx.measureText('国').width + 2) * text.length; + + _ctx.restore(); + + _textHeightCache[key] = height; + if (++_textHeightCacheCounter > TEXT_CACHE_MAX) { + // 内存释放 + _textHeightCacheCounter = 0; + _textHeightCache = {}; + } + return height; + } + + return { + isInside : isInside, + isOutside : isOutside, + getTextWidth : getTextWidth, + getTextHeight : getTextHeight, + + isInsidePath: isInsidePath, + isInsidePolygon: isInsidePolygon, + isInsideSector: isInsideSector, + isInsideCircle: isInsideCircle, + isInsideLine: isInsideLine, + isInsideRect: isInsideRect, + isInsideBrokenLine: isInsideBrokenLine + }; + } +); + +/** + * 提供变换扩展 + * @module zrender/mixin/Transformable + * @author pissang (https://www.github.com/pissang) + */ +define('zrender/mixin/Transformable',['require','../tool/matrix','../tool/vector'],function (require) { + + + + var matrix = require('../tool/matrix'); + var vector = require('../tool/vector'); + var origin = [ 0, 0 ]; + + var EPSILON = 5e-5; + + function isAroundZero(val) { + return val > -EPSILON && val < EPSILON; + } + function isNotAroundZero(val) { + return val > EPSILON || val < -EPSILON; + } + + /** + * @alias module:zrender/mixin/Transformable + * @constructor + */ + var Transformable = function () { + + if (!this.position) { + /** + * 平移 + * @type {Array.} + * @default [0, 0] + */ + this.position = [ 0, 0 ]; + } + if (typeof(this.rotation) == 'undefined') { + /** + * 旋转,可以通过数组二三项指定旋转的原点 + * @type {Array.} + * @default [0, 0, 0] + */ + this.rotation = [ 0, 0, 0 ]; + } + if (!this.scale) { + /** + * 缩放,可以通过数组三四项指定缩放的原点 + * @type {Array.} + * @default [1, 1, 0, 0] + */ + this.scale = [ 1, 1, 0, 0 ]; + } + + this.needLocalTransform = false; + + /** + * 是否有坐标变换 + * @type {boolean} + * @readOnly + */ + this.needTransform = false; + }; + + Transformable.prototype = { + + constructor: Transformable, + + updateNeedTransform: function () { + this.needLocalTransform = isNotAroundZero(this.rotation[0]) + || isNotAroundZero(this.position[0]) + || isNotAroundZero(this.position[1]) + || isNotAroundZero(this.scale[0] - 1) + || isNotAroundZero(this.scale[1] - 1); + }, + + /** + * 判断是否需要有坐标变换,更新needTransform属性。 + * 如果有坐标变换, 则从position, rotation, scale以及父节点的transform计算出自身的transform矩阵 + */ + updateTransform: function () { + + this.updateNeedTransform(); + + if (this.parent) { + this.needTransform = this.needLocalTransform || this.parent.needTransform; + } + else { + this.needTransform = this.needLocalTransform; + } + + if (!this.needTransform) { + return; + } + + var m = this.transform || matrix.create(); + matrix.identity(m); + + if (this.needLocalTransform) { + if ( + isNotAroundZero(this.scale[0]) + || isNotAroundZero(this.scale[1]) + ) { + origin[0] = -this.scale[2] || 0; + origin[1] = -this.scale[3] || 0; + var haveOrigin = isNotAroundZero(origin[0]) + || isNotAroundZero(origin[1]); + if (haveOrigin) { + matrix.translate( + m, m, origin + ); + } + matrix.scale(m, m, this.scale); + if (haveOrigin) { + origin[0] = -origin[0]; + origin[1] = -origin[1]; + matrix.translate( + m, m, origin + ); + } + } + + if (this.rotation instanceof Array) { + if (this.rotation[0] !== 0) { + origin[0] = -this.rotation[1] || 0; + origin[1] = -this.rotation[2] || 0; + var haveOrigin = isNotAroundZero(origin[0]) + || isNotAroundZero(origin[1]); + if (haveOrigin) { + matrix.translate( + m, m, origin + ); + } + matrix.rotate(m, m, this.rotation[0]); + if (haveOrigin) { + origin[0] = -origin[0]; + origin[1] = -origin[1]; + matrix.translate( + m, m, origin + ); + } + } + } + else { + if (this.rotation !== 0) { + matrix.rotate(m, m, this.rotation); + } + } + + if ( + isNotAroundZero(this.position[0]) || isNotAroundZero(this.position[1]) + ) { + matrix.translate(m, m, this.position); + } + } + + // 保存这个变换矩阵 + this.transform = m; + + // 应用父节点变换 + if (this.parent && this.parent.needTransform) { + if (this.needLocalTransform) { + matrix.mul(this.transform, this.parent.transform, this.transform); + } + else { + matrix.copy(this.transform, this.parent.transform); + } + } + }, + /** + * 将自己的transform应用到context上 + * @param {Context2D} ctx + */ + setTransform: function (ctx) { + if (this.needTransform) { + var m = this.transform; + ctx.transform( + m[0], m[1], + m[2], m[3], + m[4], m[5] + ); + } + }, + /** + * 设置图形的朝向 + * @param {Array.|Float32Array} target + * @method + */ + lookAt: (function () { + var v = vector.create(); + return function(target) { + if (!this.transform) { + this.transform = matrix.create(); + } + var m = this.transform; + vector.sub(v, target, this.position); + if (isAroundZero(v[0]) && isAroundZero(v[1])) { + return; + } + vector.normalize(v, v); + // Y Axis + // TODO Scale origin ? + m[2] = v[0] * this.scale[1]; + m[3] = v[1] * this.scale[1]; + // X Axis + m[0] = v[1] * this.scale[0]; + m[1] = -v[0] * this.scale[0]; + // Position + m[4] = this.position[0]; + m[5] = this.position[1]; + + this.decomposeTransform(); + }; + })(), + /** + * 分解`transform`矩阵到`position`, `rotation`, `scale` + */ + decomposeTransform: function () { + if (!this.transform) { + return; + } + var m = this.transform; + var sx = m[0] * m[0] + m[1] * m[1]; + var position = this.position; + var scale = this.scale; + var rotation = this.rotation; + if (isNotAroundZero(sx - 1)) { + sx = Math.sqrt(sx); + } + var sy = m[2] * m[2] + m[3] * m[3]; + if (isNotAroundZero(sy - 1)) { + sy = Math.sqrt(sy); + } + position[0] = m[4]; + position[1] = m[5]; + scale[0] = sx; + scale[1] = sy; + scale[2] = scale[3] = 0; + rotation[0] = Math.atan2(-m[1] / sy, m[0] / sx); + rotation[1] = rotation[2] = 0; + } + }; + + return Transformable; +}); + +/** + * 颜色辅助类 + * @module zrender/tool/color + * @author CrossDo (chenhuaimu@baidu.com) + */ +define('zrender/tool/color',['require','../tool/util'],function(require) { + var util = require('../tool/util'); + + var _ctx; + + // Color palette is an array containing the default colors for the chart's + // series. + // When all colors are used, new colors are selected from the start again. + // Defaults to: + // 默认色板 + var palette = [ + '#ff9277', ' #dddd00', ' #ffc877', ' #bbe3ff', ' #d5ffbb', + '#bbbbff', ' #ddb000', ' #b0dd00', ' #e2bbff', ' #ffbbe3', + '#ff7777', ' #ff9900', ' #83dd00', ' #77e3ff', ' #778fff', + '#c877ff', ' #ff77ab', ' #ff6600', ' #aa8800', ' #77c7ff', + '#ad77ff', ' #ff77ff', ' #dd0083', ' #777700', ' #00aa00', + '#0088aa', ' #8400dd', ' #aa0088', ' #dd0000', ' #772e00' + ]; + var _palette = palette; + + var highlightColor = 'rgba(255,255,0,0.5)'; + var _highlightColor = highlightColor; + + // 颜色格式 + /*jshint maxlen: 330 */ + var colorRegExp = /^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i; + + var _nameColors = { + aliceblue : '#f0f8ff', + antiquewhite : '#faebd7', + aqua : '#0ff', + aquamarine : '#7fffd4', + azure : '#f0ffff', + beige : '#f5f5dc', + bisque : '#ffe4c4', + black : '#000', + blanchedalmond : '#ffebcd', + blue : '#00f', + blueviolet : '#8a2be2', + brown : '#a52a2a', + burlywood : '#deb887', + cadetblue : '#5f9ea0', + chartreuse : '#7fff00', + chocolate : '#d2691e', + coral : '#ff7f50', + cornflowerblue : '#6495ed', + cornsilk : '#fff8dc', + crimson : '#dc143c', + cyan : '#0ff', + darkblue : '#00008b', + darkcyan : '#008b8b', + darkgoldenrod : '#b8860b', + darkgray : '#a9a9a9', + darkgrey : '#a9a9a9', + darkgreen : '#006400', + darkkhaki : '#bdb76b', + darkmagenta : '#8b008b', + darkolivegreen : '#556b2f', + darkorange : '#ff8c00', + darkorchid : '#9932cc', + darkred : '#8b0000', + darksalmon : '#e9967a', + darkseagreen : '#8fbc8f', + darkslateblue : '#483d8b', + darkslategray : '#2f4f4f', + darkslategrey : '#2f4f4f', + darkturquoise : '#00ced1', + darkviolet : '#9400d3', + deeppink : '#ff1493', + deepskyblue : '#00bfff', + dimgray : '#696969', + dimgrey : '#696969', + dodgerblue : '#1e90ff', + firebrick : '#b22222', + floralwhite : '#fffaf0', + forestgreen : '#228b22', + fuchsia : '#f0f', + gainsboro : '#dcdcdc', + ghostwhite : '#f8f8ff', + gold : '#ffd700', + goldenrod : '#daa520', + gray : '#808080', + grey : '#808080', + green : '#008000', + greenyellow : '#adff2f', + honeydew : '#f0fff0', + hotpink : '#ff69b4', + indianred : '#cd5c5c', + indigo : '#4b0082', + ivory : '#fffff0', + khaki : '#f0e68c', + lavender : '#e6e6fa', + lavenderblush : '#fff0f5', + lawngreen : '#7cfc00', + lemonchiffon : '#fffacd', + lightblue : '#add8e6', + lightcoral : '#f08080', + lightcyan : '#e0ffff', + lightgoldenrodyellow : '#fafad2', + lightgray : '#d3d3d3', + lightgrey : '#d3d3d3', + lightgreen : '#90ee90', + lightpink : '#ffb6c1', + lightsalmon : '#ffa07a', + lightseagreen : '#20b2aa', + lightskyblue : '#87cefa', + lightslategray : '#789', + lightslategrey : '#789', + lightsteelblue : '#b0c4de', + lightyellow : '#ffffe0', + lime : '#0f0', + limegreen : '#32cd32', + linen : '#faf0e6', + magenta : '#f0f', + maroon : '#800000', + mediumaquamarine : '#66cdaa', + mediumblue : '#0000cd', + mediumorchid : '#ba55d3', + mediumpurple : '#9370d8', + mediumseagreen : '#3cb371', + mediumslateblue : '#7b68ee', + mediumspringgreen : '#00fa9a', + mediumturquoise : '#48d1cc', + mediumvioletred : '#c71585', + midnightblue : '#191970', + mintcream : '#f5fffa', + mistyrose : '#ffe4e1', + moccasin : '#ffe4b5', + navajowhite : '#ffdead', + navy : '#000080', + oldlace : '#fdf5e6', + olive : '#808000', + olivedrab : '#6b8e23', + orange : '#ffa500', + orangered : '#ff4500', + orchid : '#da70d6', + palegoldenrod : '#eee8aa', + palegreen : '#98fb98', + paleturquoise : '#afeeee', + palevioletred : '#d87093', + papayawhip : '#ffefd5', + peachpuff : '#ffdab9', + peru : '#cd853f', + pink : '#ffc0cb', + plum : '#dda0dd', + powderblue : '#b0e0e6', + purple : '#800080', + red : '#f00', + rosybrown : '#bc8f8f', + royalblue : '#4169e1', + saddlebrown : '#8b4513', + salmon : '#fa8072', + sandybrown : '#f4a460', + seagreen : '#2e8b57', + seashell : '#fff5ee', + sienna : '#a0522d', + silver : '#c0c0c0', + skyblue : '#87ceeb', + slateblue : '#6a5acd', + slategray : '#708090', + slategrey : '#708090', + snow : '#fffafa', + springgreen : '#00ff7f', + steelblue : '#4682b4', + tan : '#d2b48c', + teal : '#008080', + thistle : '#d8bfd8', + tomato : '#ff6347', + turquoise : '#40e0d0', + violet : '#ee82ee', + wheat : '#f5deb3', + white : '#fff', + whitesmoke : '#f5f5f5', + yellow : '#ff0', + yellowgreen : '#9acd32' + }; + + /** + * 自定义调色板 + */ + function customPalette(userPalete) { + palette = userPalete; + } + + /** + * 复位默认色板 + */ + function resetPalette() { + palette = _palette; + } + + /** + * 获取色板颜色 + * @memberOf module:zrender/tool/color + * @param {number} idx 色板位置 + * @param {Array.} [userPalete] 自定义色板 + * @return {string} 颜色 + */ + function getColor(idx, userPalete) { + idx = idx | 0; + userPalete = userPalete || palette; + return userPalete[idx % userPalete.length]; + } + + /** + * 自定义默认高亮颜色 + */ + function customHighlight(userHighlightColor) { + highlightColor = userHighlightColor; + } + + /** + * 重置默认高亮颜色 + */ + function resetHighlight() { + _highlightColor = highlightColor; + } + + /** + * 获取默认高亮颜色 + */ + function getHighlightColor() { + return highlightColor; + } + + /** + * 径向渐变 + * @memberOf module:zrender/tool/color + * @param {number} x0 渐变起点 + * @param {number} y0 + * @param {number} r0 + * @param {number} x1 渐变终点 + * @param {number} y1 + * @param {number} r1 + * @param {Array} colorList 颜色列表 + * @return {CanvasGradient} + */ + function getRadialGradient(x0, y0, r0, x1, y1, r1, colorList) { + if (!_ctx) { + _ctx = util.getContext(); + } + var gradient = _ctx.createRadialGradient(x0, y0, r0, x1, y1, r1); + for (var i = 0, l = colorList.length; i < l; i++) { + gradient.addColorStop(colorList[i][0], colorList[i][1]); + } + gradient.__nonRecursion = true; + return gradient; + } + + /** + * 线性渐变 + * @param {Object} x0 渐变起点 + * @param {Object} y0 + * @param {Object} x1 渐变终点 + * @param {Object} y1 + * @param {Array} colorList 颜色列表 + */ + function getLinearGradient(x0, y0, x1, y1, colorList) { + if (!_ctx) { + _ctx = util.getContext(); + } + var gradient = _ctx.createLinearGradient(x0, y0, x1, y1); + for (var i = 0, l = colorList.length; i < l; i++) { + gradient.addColorStop(colorList[i][0], colorList[i][1]); + } + gradient.__nonRecursion = true; + return gradient; + } + + /** + * 获取两种颜色之间渐变颜色数组 + * @param {color} start 起始颜色 + * @param {color} end 结束颜色 + * @param {number} step 渐变级数 + * @return {Array} 颜色数组 + */ + function getStepColors(start, end, step) { + start = toRGBA(start); + end = toRGBA(end); + start = getData(start); + end = getData(end); + + var colors = []; + var stepR = (end[0] - start[0]) / step; + var stepG = (end[1] - start[1]) / step; + var stepB = (end[2] - start[2]) / step; + // 生成颜色集合 + // fix by linfeng 颜色堆积 + for (var i = 0, r = start[0], g = start[1], b = start[2]; i < step; i++ + ) { + colors[i] = toColor([ + adjust(Math.floor(r), [ 0, 255 ]), + adjust(Math.floor(g), [ 0, 255 ]), + adjust(Math.floor(b), [ 0, 255 ]) + ]); + r += stepR; + g += stepG; + b += stepB; + } + r = end[0]; + g = end[1]; + b = end[2]; + colors[i] = toColor([ r, g, b ]); + return colors; + } + + /** + * 获取指定级数的渐变颜色数组 + * @memberOf module:zrender/tool/color + * @param {Array.} colors 颜色组 + * @param {number} [step=20] 渐变级数 + * @return {Array.} 颜色数组 + */ + function getGradientColors(colors, step) { + var ret = []; + var len = colors.length; + if (step === undefined) { + step = 20; + } + if (len === 1) { + ret = getStepColors(colors[0], colors[0], step); + } + else if (len > 1) { + for (var i = 0, n = len - 1; i < n; i++) { + var steps = getStepColors(colors[i], colors[i + 1], step); + if (i < n - 1) { + steps.pop(); + } + ret = ret.concat(steps); + } + } + return ret; + } + + /** + * 颜色值数组转为指定格式颜色,例如:
+ * data = [60,20,20,0.1] format = 'rgba' + * 返回:rgba(60,20,20,0.1) + * @param {Array} data 颜色值数组 + * @param {string} format 格式,默认rgb + * @return {string} 颜色 + */ + function toColor(data, format) { + format = format || 'rgb'; + if (data && (data.length === 3 || data.length === 4)) { + data = map(data, + function(c) { + return c > 1 ? Math.ceil(c) : c; + } + ); + + if (format.indexOf('hex') > -1) { + return '#' + ((1 << 24) + (data[0] << 16) + (data[1] << 8) + (+data[2])).toString(16).slice(1); + } + else if (format.indexOf('hs') > -1) { + var sx = map(data.slice(1, 3), + function(c) { + return c + '%'; + } + ); + data[1] = sx[0]; + data[2] = sx[1]; + } + + if (format.indexOf('a') > -1) { + if (data.length === 3) { + data.push(1); + } + data[3] = adjust(data[3], [ 0, 1 ]); + return format + '(' + data.slice(0, 4).join(',') + ')'; + } + + return format + '(' + data.slice(0, 3).join(',') + ')'; + } + } + + /** + * 颜色字符串转换为rgba数组 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {Array.} 颜色值数组 + */ + function toArray(color) { + color = trim(color); + if (color.indexOf('rgba') < 0) { + color = toRGBA(color); + } + + var data = []; + var i = 0; + color.replace(/[\d.]+/g, function (n) { + if (i < 3) { + n = n | 0; + } + else { + // Alpha + n = +n; + } + data[i++] = n; + }); + return data; + } + + /** + * 颜色格式转化 + * + * @param {string} color 颜色值数组 + * @param {string} format 格式,默认rgb + * @return {string} 颜色 + */ + function convert(color, format) { + var data = getData(color); + var alpha = data[3]; + if (typeof alpha === 'undefined') { + alpha = 1; + } + + if (color.indexOf('hsb') > -1) { + data = _HSV_2_RGB(data); + } + else if (color.indexOf('hsl') > -1) { + data = _HSL_2_RGB(data); + } + + if (format.indexOf('hsb') > -1 || format.indexOf('hsv') > -1) { + data = _RGB_2_HSB(data); + } + else if (format.indexOf('hsl') > -1) { + data = _RGB_2_HSL(data); + } + + data[3] = alpha; + + return toColor(data, format); + } + + /** + * 转换为rgba格式的颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} rgba颜色,rgba(r,g,b,a) + */ + function toRGBA(color) { + return convert(color, 'rgba'); + } + + /** + * 转换为rgb数字格式的颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} rgb颜色,rgb(0,0,0)格式 + */ + function toRGB(color) { + return convert(color, 'rgb'); + } + + /** + * 转换为16进制颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} 16进制颜色,#rrggbb格式 + */ + function toHex(color) { + return convert(color, 'hex'); + } + + /** + * 转换为HSV颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} HSVA颜色,hsva(h,s,v,a) + */ + function toHSVA(color) { + return convert(color, 'hsva'); + } + + /** + * 转换为HSV颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} HSV颜色,hsv(h,s,v) + */ + function toHSV(color) { + return convert(color, 'hsv'); + } + + /** + * 转换为HSBA颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} HSBA颜色,hsba(h,s,b,a) + */ + function toHSBA(color) { + return convert(color, 'hsba'); + } + + /** + * 转换为HSB颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} HSB颜色,hsb(h,s,b) + */ + function toHSB(color) { + return convert(color, 'hsb'); + } + + /** + * 转换为HSLA颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} HSLA颜色,hsla(h,s,l,a) + */ + function toHSLA(color) { + return convert(color, 'hsla'); + } + + /** + * 转换为HSL颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} HSL颜色,hsl(h,s,l) + */ + function toHSL(color) { + return convert(color, 'hsl'); + } + + /** + * 转换颜色名 + * + * @param {string} color 颜色 + * @return {string} 颜色名 + */ + function toName(color) { + for (var key in _nameColors) { + if (toHex(_nameColors[key]) === toHex(color)) { + return key; + } + } + return null; + } + + /** + * 移除颜色中多余空格 + * + * @param {string} color 颜色 + * @return {string} 无空格颜色 + */ + function trim(color) { + return String(color).replace(/\s+/g, ''); + } + + /** + * 颜色规范化 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} 规范化后的颜色 + */ + function normalize(color) { + // 颜色名 + if (_nameColors[color]) { + color = _nameColors[color]; + } + // 去掉空格 + color = trim(color); + // hsv与hsb等价 + color = color.replace(/hsv/i, 'hsb'); + // rgb转为rrggbb + if (/^#[\da-f]{3}$/i.test(color)) { + color = parseInt(color.slice(1), 16); + var r = (color & 0xf00) << 8; + var g = (color & 0xf0) << 4; + var b = color & 0xf; + + color = '#' + ((1 << 24) + (r << 4) + r + (g << 4) + g + (b << 4) + b).toString(16).slice(1); + } + // 或者使用以下正则替换,不过 chrome 下性能相对差点 + // color = color.replace(/^#([\da-f])([\da-f])([\da-f])$/i, '#$1$1$2$2$3$3'); + return color; + } + + /** + * 颜色加深或减淡,当level>0加深,当level<0减淡 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @param {number} level 升降程度,取值区间[-1,1] + * @return {string} 加深或减淡后颜色值 + */ + function lift(color, level) { + var direct = level > 0 ? 1 : -1; + if (typeof level === 'undefined') { + level = 0; + } + level = Math.abs(level) > 1 ? 1 : Math.abs(level); + color = toRGB(color); + var data = getData(color); + for (var i = 0; i < 3; i++) { + if (direct === 1) { + data[i] = data[i] * (1 - level) | 0; + } + else { + data[i] = ((255 - data[i]) * level + data[i]) | 0; + } + } + return 'rgb(' + data.join(',') + ')'; + } + + /** + * 颜色翻转,[255-r,255-g,255-b,1-a] + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} 翻转颜色 + */ + function reverse(color) { + var data = getData(toRGBA(color)); + data = map(data, + function(c) { + return 255 - c; + } + ); + return toColor(data, 'rgb'); + } + + /** + * 简单两种颜色混合 + * @memberOf module:zrender/tool/color + * @param {string} color1 第一种颜色 + * @param {string} color2 第二种颜色 + * @param {number} weight 混合权重[0-1] + * @return {string} 结果色,rgb(r,g,b)或rgba(r,g,b,a) + */ + function mix(color1, color2, weight) { + if (typeof weight === 'undefined') { + weight = 0.5; + } + weight = 1 - adjust(weight, [ 0, 1 ]); + + var w = weight * 2 - 1; + var data1 = getData(toRGBA(color1)); + var data2 = getData(toRGBA(color2)); + + var d = data1[3] - data2[3]; + + var weight1 = (((w * d === -1) ? w : (w + d) / (1 + w * d)) + 1) / 2; + var weight2 = 1 - weight1; + + var data = []; + + for (var i = 0; i < 3; i++) { + data[i] = data1[i] * weight1 + data2[i] * weight2; + } + + var alpha = data1[3] * weight + data2[3] * (1 - weight); + alpha = Math.max(0, Math.min(1, alpha)); + + if (data1[3] === 1 && data2[3] === 1) {// 不考虑透明度 + return toColor(data, 'rgb'); + } + data[3] = alpha; + return toColor(data, 'rgba'); + } + + /** + * 随机颜色 + * + * @return {string} 颜色值,#rrggbb格式 + */ + function random() { + return '#' + Math.random().toString(16).slice(2, 8); + } + + /** + * 获取颜色值数组,返回值范围:
+ * RGB 范围[0-255]
+ * HSL/HSV/HSB 范围[0-1]
+ * A透明度范围[0-1] + * 支持格式: + * #rgb + * #rrggbb + * rgb(r,g,b) + * rgb(r%,g%,b%) + * rgba(r,g,b,a) + * hsb(h,s,b) // hsv与hsb等价 + * hsb(h%,s%,b%) + * hsba(h,s,b,a) + * hsl(h,s,l) + * hsl(h%,s%,l%) + * hsla(h,s,l,a) + * + * @param {string} color 颜色 + * @return {Array.} 颜色值数组或null + */ + function getData(color) { + color = normalize(color); + var r = color.match(colorRegExp); + if (r === null) { + throw new Error('The color format error'); // 颜色格式错误 + } + var d; + var a; + var data = []; + var rgb; + + if (r[2]) { + // #rrggbb + d = r[2].replace('#', '').split(''); + rgb = [ d[0] + d[1], d[2] + d[3], d[4] + d[5] ]; + data = map(rgb, + function(c) { + return adjust(parseInt(c, 16), [ 0, 255 ]); + } + ); + + } + else if (r[4]) { + // rgb rgba + var rgba = (r[4]).split(','); + a = rgba[3]; + rgb = rgba.slice(0, 3); + data = map( + rgb, + function(c) { + c = Math.floor( + c.indexOf('%') > 0 ? parseInt(c, 0) * 2.55 : c + ); + return adjust(c, [ 0, 255 ]); + } + ); + + if (typeof a !== 'undefined') { + data.push(adjust(parseFloat(a), [ 0, 1 ])); + } + } + else if (r[5] || r[6]) { + // hsb hsba hsl hsla + var hsxa = (r[5] || r[6]).split(','); + var h = parseInt(hsxa[0], 0) / 360; + var s = hsxa[1]; + var x = hsxa[2]; + a = hsxa[3]; + data = map([ s, x ], + function(c) { + return adjust(parseFloat(c) / 100, [ 0, 1 ]); + } + ); + data.unshift(h); + if (typeof a !== 'undefined') { + data.push(adjust(parseFloat(a), [ 0, 1 ])); + } + } + return data; + } + + /** + * 设置颜色透明度 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @param {number} a 透明度,区间[0,1] + * @return {string} rgba颜色值 + */ + function alpha(color, a) { + if (a === null) { + a = 1; + } + var data = getData(toRGBA(color)); + data[3] = adjust(Number(a).toFixed(4), [ 0, 1 ]); + + return toColor(data, 'rgba'); + } + + // 数组映射 + function map(array, fun) { + if (typeof fun !== 'function') { + throw new TypeError(); + } + var len = array ? array.length : 0; + for (var i = 0; i < len; i++) { + array[i] = fun(array[i]); + } + return array; + } + + // 调整值区间 + function adjust(value, region) { + // < to <= & > to >= + // modify by linzhifeng 2014-05-25 because -0 == 0 + if (value <= region[0]) { + value = region[0]; + } + else if (value >= region[1]) { + value = region[1]; + } + return value; + } + + // 参见 http:// www.easyrgb.com/index.php?X=MATH + function _HSV_2_RGB(data) { + var H = data[0]; + var S = data[1]; + var V = data[2]; + // HSV from 0 to 1 + var R; + var G; + var B; + if (S === 0) { + R = V * 255; + G = V * 255; + B = V * 255; + } + else { + var h = H * 6; + if (h === 6) { + h = 0; + } + var i = h | 0; + var v1 = V * (1 - S); + var v2 = V * (1 - S * (h - i)); + var v3 = V * (1 - S * (1 - (h - i))); + var r = 0; + var g = 0; + var b = 0; + + if (i === 0) { + r = V; + g = v3; + b = v1; + } + else if (i === 1) { + r = v2; + g = V; + b = v1; + } + else if (i === 2) { + r = v1; + g = V; + b = v3; + } + else if (i === 3) { + r = v1; + g = v2; + b = V; + } + else if (i === 4) { + r = v3; + g = v1; + b = V; + } + else { + r = V; + g = v1; + b = v2; + } + + // RGB results from 0 to 255 + R = r * 255; + G = g * 255; + B = b * 255; + } + return [ R, G, B ]; + } + + function _HSL_2_RGB(data) { + var H = data[0]; + var S = data[1]; + var L = data[2]; + // HSL from 0 to 1 + var R; + var G; + var B; + if (S === 0) { + R = L * 255; + G = L * 255; + B = L * 255; + } + else { + var v2; + if (L < 0.5) { + v2 = L * (1 + S); + } + else { + v2 = (L + S) - (S * L); + } + + var v1 = 2 * L - v2; + + R = 255 * _HUE_2_RGB(v1, v2, H + (1 / 3)); + G = 255 * _HUE_2_RGB(v1, v2, H); + B = 255 * _HUE_2_RGB(v1, v2, H - (1 / 3)); + } + return [ R, G, B ]; + } + + function _HUE_2_RGB(v1, v2, vH) { + if (vH < 0) { + vH += 1; + } + if (vH > 1) { + vH -= 1; + } + if ((6 * vH) < 1) { + return (v1 + (v2 - v1) * 6 * vH); + } + if ((2 * vH) < 1) { + return (v2); + } + if ((3 * vH) < 2) { + return (v1 + (v2 - v1) * ((2 / 3) - vH) * 6); + } + return v1; + } + + function _RGB_2_HSB(data) { + // RGB from 0 to 255 + var R = (data[0] / 255); + var G = (data[1] / 255); + var B = (data[2] / 255); + + var vMin = Math.min(R, G, B); // Min. value of RGB + var vMax = Math.max(R, G, B); // Max. value of RGB + var delta = vMax - vMin; // Delta RGB value + var V = vMax; + var H; + var S; + + // HSV results from 0 to 1 + if (delta === 0) { + H = 0; + S = 0; + } + else { + S = delta / vMax; + + var deltaR = (((vMax - R) / 6) + (delta / 2)) / delta; + var deltaG = (((vMax - G) / 6) + (delta / 2)) / delta; + var deltaB = (((vMax - B) / 6) + (delta / 2)) / delta; + + if (R === vMax) { + H = deltaB - deltaG; + } + else if (G === vMax) { + H = (1 / 3) + deltaR - deltaB; + } + else if (B === vMax) { + H = (2 / 3) + deltaG - deltaR; + } + + if (H < 0) { + H += 1; + } + if (H > 1) { + H -= 1; + } + } + H = H * 360; + S = S * 100; + V = V * 100; + return [ H, S, V ]; + } + + function _RGB_2_HSL(data) { + // RGB from 0 to 255 + var R = (data[0] / 255); + var G = (data[1] / 255); + var B = (data[2] / 255); + + var vMin = Math.min(R, G, B); // Min. value of RGB + var vMax = Math.max(R, G, B); // Max. value of RGB + var delta = vMax - vMin; // Delta RGB value + + var L = (vMax + vMin) / 2; + var H; + var S; + // HSL results from 0 to 1 + if (delta === 0) { + H = 0; + S = 0; + } + else { + if (L < 0.5) { + S = delta / (vMax + vMin); + } + else { + S = delta / (2 - vMax - vMin); + } + + var deltaR = (((vMax - R) / 6) + (delta / 2)) / delta; + var deltaG = (((vMax - G) / 6) + (delta / 2)) / delta; + var deltaB = (((vMax - B) / 6) + (delta / 2)) / delta; + + if (R === vMax) { + H = deltaB - deltaG; + } + else if (G === vMax) { + H = (1 / 3) + deltaR - deltaB; + } + else if (B === vMax) { + H = (2 / 3) + deltaG - deltaR; + } + + if (H < 0) { + H += 1; + } + + if (H > 1) { + H -= 1; + } + } + + H = H * 360; + S = S * 100; + L = L * 100; + + return [ H, S, L ]; + } + + return { + customPalette : customPalette, + resetPalette : resetPalette, + getColor : getColor, + getHighlightColor : getHighlightColor, + customHighlight : customHighlight, + resetHighlight : resetHighlight, + getRadialGradient : getRadialGradient, + getLinearGradient : getLinearGradient, + getGradientColors : getGradientColors, + getStepColors : getStepColors, + reverse : reverse, + mix : mix, + lift : lift, + trim : trim, + random : random, + toRGB : toRGB, + toRGBA : toRGBA, + toHex : toHex, + toHSL : toHSL, + toHSLA : toHSLA, + toHSB : toHSB, + toHSBA : toHSBA, + toHSV : toHSV, + toHSVA : toHSVA, + toName : toName, + toColor : toColor, + toArray : toArray, + alpha : alpha, + getData : getData + }; +}); + + +/** + * shape基类 + * @module zrender/shape/Base + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * errorrik (errorrik@gmail.com) + */ + +/** + * @typedef {Object} IBaseShapeStyle + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ + +/** + * @typedef {Object} module:zrender/shape/Base~IBoundingRect + * @property {number} x 左上角顶点x轴坐标 + * @property {number} y 左上角顶点y轴坐标 + * @property {number} width 包围盒矩形宽度 + * @property {number} height 包围盒矩形高度 + */ + +define( + 'zrender/shape/Base',['require','../tool/matrix','../tool/guid','../tool/util','../tool/log','../mixin/Transformable','../mixin/Eventful','../tool/area','../tool/area','../tool/color','../tool/area'],function(require) { + var matrix = require('../tool/matrix'); + var guid = require('../tool/guid'); + var util = require('../tool/util'); + var log = require('../tool/log'); + + var Transformable = require('../mixin/Transformable'); + var Eventful = require('../mixin/Eventful'); + + function _fillText(ctx, text, x, y, textFont, textAlign, textBaseline) { + if (textFont) { + ctx.font = textFont; + } + ctx.textAlign = textAlign; + ctx.textBaseline = textBaseline; + var rect = _getTextRect( + text, x, y, textFont, textAlign, textBaseline + ); + + text = (text + '').split('\n'); + var lineHeight = require('../tool/area').getTextHeight('国', textFont); + + switch (textBaseline) { + case 'top': + y = rect.y; + break; + case 'bottom': + y = rect.y + lineHeight; + break; + default: + y = rect.y + lineHeight / 2; + } + + for (var i = 0, l = text.length; i < l; i++) { + ctx.fillText(text[i], x, y); + y += lineHeight; + } + } + + /** + * 返回矩形区域,用于局部刷新和文字定位 + * @inner + * @param {string} text + * @param {number} x + * @param {number} y + * @param {string} textFont + * @param {string} textAlign + * @param {string} textBaseline + */ + function _getTextRect(text, x, y, textFont, textAlign, textBaseline) { + var area = require('../tool/area'); + var width = area.getTextWidth(text, textFont); + var lineHeight = area.getTextHeight('国', textFont); + + text = (text + '').split('\n'); + + switch (textAlign) { + case 'end': + case 'right': + x -= width; + break; + case 'center': + x -= (width / 2); + break; + } + + switch (textBaseline) { + case 'top': + break; + case 'bottom': + y -= lineHeight * text.length; + break; + default: + y -= lineHeight * text.length / 2; + } + + return { + x : x, + y : y, + width : width, + height : lineHeight * text.length + }; + } + + /** + * @alias module:zrender/shape/Base + * @constructor + * @extends module:zrender/mixin/Transformable + * @extends module:zrender/mixin/Eventful + * @param {Object} options 关于shape的配置项,可以是shape的自有属性,也可以是自定义的属性。 + */ + var Base = function(options) { + + options = options || {}; + + /** + * Shape id, 全局唯一 + * @type {string} + */ + this.id = options.id || guid(); + + for (var key in options) { + this[key] = options[key]; + } + + /** + * 基础绘制样式 + * @type {module:zrender/shape/Base~IBaseShapeStyle} + */ + this.style = this.style || {}; + + /** + * 高亮样式 + * @type {module:zrender/shape/Base~IBaseShapeStyle} + */ + this.highlightStyle = this.highlightStyle || null; + + /** + * 父节点 + * @readonly + * @type {module:zrender/Group} + * @default null + */ + this.parent = null; + + this.__dirty = true; + + Transformable.call(this); + Eventful.call(this); + }; + /** + * 图形是否可见,为true时不绘制图形,但是仍能触发鼠标事件 + * @name module:zrender/shape/Base#invisible + * @type {boolean} + * @default false + */ + Base.prototype.invisible = false; + + /** + * 图形是否忽略,为true时忽略图形的绘制以及事件触发 + * @name module:zrender/shape/Base#ignore + * @type {boolean} + * @default false + */ + Base.prototype.ignore = false; + + /** + * z层level,决定绘画在哪层canvas中 + * @name module:zrender/shape/Base#zlevel + * @type {number} + * @default 0 + */ + Base.prototype.zlevel = 0; + + /** + * 是否可拖拽 + * @name module:zrender/shape/Base#draggable + * @type {boolean} + * @default false + */ + Base.prototype.draggable = false; + + /** + * 是否可点击 + * @name module:zrender/shape/Base#clickable + * @type {boolean} + * @default false + */ + Base.prototype.clickable = false; + + /** + * 是否可以hover + * @name module:zrender/shape/Base#hoverable + * @type {boolean} + * @default true + */ + Base.prototype.hoverable = true; + + /** + * z值,跟zlevel一样影响shape绘制的前后顺序,z值大的shape会覆盖在z值小的上面, + * 但是并不会创建新的canvas,所以优先级低于zlevel,而且频繁改动的开销比zlevel小很多。 + * + * @name module:zrender/shape/Base#z + * @type {number} + * @default 0 + */ + Base.prototype.z = 0; + + /** + * 绘制图形 + * + * @param {CanvasRenderingContext2D} ctx + * @param {boolean} [isHighlight=false] 是否使用高亮属性 + * @param {Function} [updateCallback] + * 需要异步加载资源的shape可以通过这个callback(e), + * 让painter更新视图,base.brush没用,需要的话重载brush + */ + Base.prototype.brush = function (ctx, isHighlight) { + var style = this.style; + + if (this.brushTypeOnly) { + style.brushType = this.brushTypeOnly; + } + + if (isHighlight) { + // 根据style扩展默认高亮样式 + style = this.getHighlightStyle( + style, + this.highlightStyle || {}, + this.brushTypeOnly + ); + } + + if (this.brushTypeOnly == 'stroke') { + style.strokeColor = style.strokeColor || style.color; + } + + ctx.save(); + + this.setContext(ctx, style); + + // 设置transform + this.setTransform(ctx); + + ctx.beginPath(); + this.buildPath(ctx, style); + + switch (style.brushType) { + /* jshint ignore:start */ + case 'both': + ctx.fill(); + case 'stroke': + style.lineWidth > 0 && ctx.stroke(); + break; + /* jshint ignore:end */ + default: + ctx.fill(); + } + + this.drawText(ctx, style, this.style); + + ctx.restore(); + }; + + var STYLE_CTX_MAP = [ + [ 'color', 'fillStyle' ], + [ 'strokeColor', 'strokeStyle' ], + [ 'opacity', 'globalAlpha' ], + [ 'lineCap', 'lineCap' ], + [ 'lineJoin', 'lineJoin' ], + [ 'miterLimit', 'miterLimit' ], + [ 'lineWidth', 'lineWidth' ], + [ 'shadowBlur', 'shadowBlur' ], + [ 'shadowColor', 'shadowColor' ], + [ 'shadowOffsetX', 'shadowOffsetX' ], + [ 'shadowOffsetY', 'shadowOffsetY' ] + ]; + + /** + * 设置 fillStyle, strokeStyle, shadow 等通用绘制样式 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Base~IBaseShapeStyle} style + */ + Base.prototype.setContext = function (ctx, style) { + for (var i = 0, len = STYLE_CTX_MAP.length; i < len; i++) { + var styleProp = STYLE_CTX_MAP[i][0]; + var styleValue = style[styleProp]; + var ctxProp = STYLE_CTX_MAP[i][1]; + + if (typeof styleValue != 'undefined') { + ctx[ctxProp] = styleValue; + } + } + }; + + /** + * 根据默认样式扩展高亮样式 + * + * @param {module:zrender/shape/Base~IBaseShapeStyle} style 默认样式 + * @param {module:zrender/shape/Base~IBaseShapeStyle} highlightStyle 高亮样式 + * @param {string} brushTypeOnly + */ + Base.prototype.getHighlightStyle = function (style, highlightStyle, brushTypeOnly) { + var newStyle = {}; + for (var k in style) { + newStyle[k] = style[k]; + } + + var color = require('../tool/color'); + var highlightColor = color.getHighlightColor(); + // 根据highlightStyle扩展 + if (style.brushType != 'stroke') { + // 带填充则用高亮色加粗边线 + newStyle.strokeColor = highlightColor; + newStyle.lineWidth = (style.lineWidth || 1) + + this.getHighlightZoom(); + newStyle.brushType = 'both'; + } + else { + if (brushTypeOnly != 'stroke') { + // 描边型的则用原色加工高亮 + newStyle.strokeColor = highlightColor; + newStyle.lineWidth = (style.lineWidth || 1) + + this.getHighlightZoom(); + } + else { + // 线型的则用原色加工高亮 + newStyle.strokeColor = highlightStyle.strokeColor + || color.mix( + style.strokeColor, + color.toRGB(highlightColor) + ); + } + } + + // 可自定义覆盖默认值 + for (var k in highlightStyle) { + if (typeof highlightStyle[k] != 'undefined') { + newStyle[k] = highlightStyle[k]; + } + } + + return newStyle; + }; + + // 高亮放大效果参数 + // 当前统一设置为6,如有需要差异设置,通过this.type判断实例类型 + Base.prototype.getHighlightZoom = function () { + return this.type != 'text' ? 6 : 2; + }; + + /** + * 移动位置 + * @param {number} dx 横坐标变化 + * @param {number} dy 纵坐标变化 + */ + Base.prototype.drift = function (dx, dy) { + this.position[0] += dx; + this.position[1] += dy; + }; + + /** + * 变换鼠标位置到 shape 的局部坐标空间 + * @method + * @param {number} x + * @param {number} y + * @return {Array.} + */ + Base.prototype.getTansform = (function() { + + var invTransform = []; + + return function (x, y) { + var originPos = [ x, y ]; + // 对鼠标的坐标也做相同的变换 + if (this.needTransform && this.transform) { + matrix.invert(invTransform, this.transform); + + matrix.mulVector(originPos, invTransform, [ x, y, 1 ]); + + if (x == originPos[0] && y == originPos[1]) { + // 避免外部修改导致的needTransform不准确 + this.updateNeedTransform(); + } + } + return originPos; + }; + })(); + + /** + * 构建绘制的Path + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Base~IBaseShapeStyle} style + */ + Base.prototype.buildPath = function (ctx, style) { + log('buildPath not implemented in ' + this.type); + }; + + /** + * 计算返回包围盒矩形 + * @param {module:zrender/shape/Base~IBaseShapeStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + Base.prototype.getRect = function (style) { + log('getRect not implemented in ' + this.type); + }; + + /** + * 判断鼠标位置是否在图形内 + * @param {number} x + * @param {number} y + * @return {boolean} + */ + Base.prototype.isCover = function (x, y) { + var originPos = this.getTansform(x, y); + x = originPos[0]; + y = originPos[1]; + + // 快速预判并保留判断矩形 + var rect = this.style.__rect; + if (!rect) { + rect = this.style.__rect = this.getRect(this.style); + } + + if (x >= rect.x + && x <= (rect.x + rect.width) + && y >= rect.y + && y <= (rect.y + rect.height) + ) { + // 矩形内 + return require('../tool/area').isInside(this, this.style, x, y); + } + + return false; + }; + + /** + * 绘制附加文本 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Base~IBaseShapeStyle} style 样式 + * @param {module:zrender/shape/Base~IBaseShapeStyle} normalStyle 默认样式,用于定位文字显示 + */ + Base.prototype.drawText = function (ctx, style, normalStyle) { + if (typeof(style.text) == 'undefined' || style.text === false) { + return; + } + // 字体颜色策略 + var textColor = style.textColor || style.color || style.strokeColor; + ctx.fillStyle = textColor; + + // 文本与图形间空白间隙 + var dd = 10; + var al; // 文本水平对齐 + var bl; // 文本垂直对齐 + var tx; // 文本横坐标 + var ty; // 文本纵坐标 + + var textPosition = style.textPosition // 用户定义 + || this.textPosition // shape默认 + || 'top'; // 全局默认 + + switch (textPosition) { + case 'inside': + case 'top': + case 'bottom': + case 'left': + case 'right': + if (this.getRect) { + var rect = (normalStyle || style).__rect + || this.getRect(normalStyle || style); + + switch (textPosition) { + case 'inside': + tx = rect.x + rect.width / 2; + ty = rect.y + rect.height / 2; + al = 'center'; + bl = 'middle'; + if (style.brushType != 'stroke' + && textColor == style.color + ) { + ctx.fillStyle = '#fff'; + } + break; + case 'left': + tx = rect.x - dd; + ty = rect.y + rect.height / 2; + al = 'end'; + bl = 'middle'; + break; + case 'right': + tx = rect.x + rect.width + dd; + ty = rect.y + rect.height / 2; + al = 'start'; + bl = 'middle'; + break; + case 'top': + tx = rect.x + rect.width / 2; + ty = rect.y - dd; + al = 'center'; + bl = 'bottom'; + break; + case 'bottom': + tx = rect.x + rect.width / 2; + ty = rect.y + rect.height + dd; + al = 'center'; + bl = 'top'; + break; + } + } + break; + case 'start': + case 'end': + var xStart; + var xEnd; + var yStart; + var yEnd; + if (typeof style.pointList != 'undefined') { + var pointList = style.pointList; + if (pointList.length < 2) { + // 少于2个点就不画了~ + return; + } + var length = pointList.length; + switch (textPosition) { + case 'start': + xStart = pointList[0][0]; + xEnd = pointList[1][0]; + yStart = pointList[0][1]; + yEnd = pointList[1][1]; + break; + case 'end': + xStart = pointList[length - 2][0]; + xEnd = pointList[length - 1][0]; + yStart = pointList[length - 2][1]; + yEnd = pointList[length - 1][1]; + break; + } + } + else { + xStart = style.xStart || 0; + xEnd = style.xEnd || 0; + yStart = style.yStart || 0; + yEnd = style.yEnd || 0; + } + + switch (textPosition) { + case 'start': + al = xStart < xEnd ? 'end' : 'start'; + bl = yStart < yEnd ? 'bottom' : 'top'; + tx = xStart; + ty = yStart; + break; + case 'end': + al = xStart < xEnd ? 'start' : 'end'; + bl = yStart < yEnd ? 'top' : 'bottom'; + tx = xEnd; + ty = yEnd; + break; + } + dd -= 4; + if (xStart != xEnd) { + tx -= (al == 'end' ? dd : -dd); + } + else { + al = 'center'; + } + + if (yStart != yEnd) { + ty -= (bl == 'bottom' ? dd : -dd); + } + else { + bl = 'middle'; + } + break; + case 'specific': + tx = style.textX || 0; + ty = style.textY || 0; + al = 'start'; + bl = 'middle'; + break; + } + + if (tx != null && ty != null) { + _fillText( + ctx, + style.text, + tx, ty, + style.textFont, + style.textAlign || al, + style.textBaseline || bl + ); + } + }; + + Base.prototype.modSelf = function() { + this.__dirty = true; + if (this.style) { + this.style.__rect = null; + } + }; + + /** + * 图形是否会触发事件 + * @return {boolean} + */ + // TODO, 通过 bind 绑定的事件 + Base.prototype.isSilent = function () { + return !( + this.hoverable || this.draggable || this.clickable + || this.onmousemove || this.onmouseover || this.onmouseout + || this.onmousedown || this.onmouseup || this.onclick + || this.ondragenter || this.ondragover || this.ondragleave + || this.ondrop + ); + }; + + util.merge(Base.prototype, Transformable.prototype, true); + util.merge(Base.prototype, Eventful.prototype, true); + + return Base; + } +); + +/** + * @module zrender/shape/Text + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @example + * var Text = require('zrender/shape/Text'); + * var shape = new Text({ + * style: { + * text: 'Label', + * x: 100, + * y: 100, + * textFont: '14px Arial' + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} ITextStyle + * @property {number} x 横坐标 + * @property {number} y 纵坐标 + * @property {string} text 文本内容 + * @property {number} [maxWidth=null] 最大宽度限制 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + */ + +define( + 'zrender/shape/Text',['require','../tool/area','./Base','../tool/util'],function (require) { + var area = require('../tool/area'); + var Base = require('./Base'); + + /** + * @alias module:zrender/shape/Text + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var Text = function (options) { + Base.call(this, options); + /** + * 文字绘制样式 + * @name module:zrender/shape/Text#style + * @type {module:zrender/shape/Text~ITextStyle} + */ + /** + * 文字高亮绘制样式 + * @name module:zrender/shape/Text#highlightStyle + * @type {module:zrender/shape/Text~ITextStyle} + */ + }; + + Text.prototype = { + type: 'text', + + brush : function (ctx, isHighlight) { + var style = this.style; + if (isHighlight) { + // 根据style扩展默认高亮样式 + style = this.getHighlightStyle( + style, this.highlightStyle || {} + ); + } + + if (typeof(style.text) == 'undefined' || style.text === false) { + return; + } + + ctx.save(); + this.setContext(ctx, style); + + // 设置transform + this.setTransform(ctx); + + if (style.textFont) { + ctx.font = style.textFont; + } + ctx.textAlign = style.textAlign || 'start'; + ctx.textBaseline = style.textBaseline || 'middle'; + + var text = (style.text + '').split('\n'); + var lineHeight = area.getTextHeight('国', style.textFont); + var rect = this.getRect(style); + var x = style.x; + var y; + if (style.textBaseline == 'top') { + y = rect.y; + } + else if (style.textBaseline == 'bottom') { + y = rect.y + lineHeight; + } + else { + y = rect.y + lineHeight / 2; + } + + for (var i = 0, l = text.length; i < l; i++) { + if (style.maxWidth) { + switch (style.brushType) { + case 'fill': + ctx.fillText( + text[i], + x, y, style.maxWidth + ); + break; + case 'stroke': + ctx.strokeText( + text[i], + x, y, style.maxWidth + ); + break; + case 'both': + ctx.fillText( + text[i], + x, y, style.maxWidth + ); + ctx.strokeText( + text[i], + x, y, style.maxWidth + ); + break; + default: + ctx.fillText( + text[i], + x, y, style.maxWidth + ); + } + } + else { + switch (style.brushType) { + case 'fill': + ctx.fillText(text[i], x, y); + break; + case 'stroke': + ctx.strokeText(text[i], x, y); + break; + case 'both': + ctx.fillText(text[i], x, y); + ctx.strokeText(text[i], x, y); + break; + default: + ctx.fillText(text[i], x, y); + } + } + y += lineHeight; + } + + ctx.restore(); + return; + }, + + /** + * 返回文字包围盒矩形 + * @param {module:zrender/shape/Text~ITextStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function (style) { + if (style.__rect) { + return style.__rect; + } + + var width = area.getTextWidth(style.text, style.textFont); + var height = area.getTextHeight(style.text, style.textFont); + + var textX = style.x; // 默认start == left + if (style.textAlign == 'end' || style.textAlign == 'right') { + textX -= width; + } + else if (style.textAlign == 'center') { + textX -= (width / 2); + } + + var textY; + if (style.textBaseline == 'top') { + textY = style.y; + } + else if (style.textBaseline == 'bottom') { + textY = style.y - height; + } + else { + // middle + textY = style.y - height / 2; + } + + style.__rect = { + x : textX, + y : textY, + width : width, + height : height + }; + + return style.__rect; + } + }; + + require('../tool/util').inherits(Text, Base); + return Text; + } +); + + +/** + * 矩形 + * @module zrender/shape/Rectangle + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) , + * strwind (@劲风FEI, yaofeifei@baidu.com) + * @example + * var Rectangle = require('zrender/shape/Rectangle'); + * var shape = new Rectangle({ + * style: { + * x: 0, + * y: 0, + * width: 100, + * height: 100, + * radius: 20 + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} IRectangleStyle + * @property {number} x 左上角x坐标 + * @property {number} y 左上角y坐标 + * @property {number} width 宽度 + * @property {number} height 高度 + * @property {number|Array.} radius 矩形圆角,可以用数组分别指定四个角的圆角 + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ +define( + 'zrender/shape/Rectangle',['require','./Base','../tool/util'],function (require) { + var Base = require('./Base'); + + /** + * @alias module:zrender/shape/Rectangle + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var Rectangle = function (options) { + Base.call(this, options); + /** + * 矩形绘制样式 + * @name module:zrender/shape/Rectangle#style + * @type {module:zrender/shape/Rectangle~IRectangleStyle} + */ + /** + * 矩形高亮绘制样式 + * @name module:zrender/shape/Rectangle#highlightStyle + * @type {module:zrender/shape/Rectangle~IRectangleStyle} + */ + }; + + Rectangle.prototype = { + type: 'rectangle', + + _buildRadiusPath: function (ctx, style) { + // 左上、右上、右下、左下角的半径依次为r1、r2、r3、r4 + // r缩写为1 相当于 [1, 1, 1, 1] + // r缩写为[1] 相当于 [1, 1, 1, 1] + // r缩写为[1, 2] 相当于 [1, 2, 1, 2] + // r缩写为[1, 2, 3] 相当于 [1, 2, 3, 2] + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + var r = style.radius; + var r1; + var r2; + var r3; + var r4; + + if (typeof r === 'number') { + r1 = r2 = r3 = r4 = r; + } + else if (r instanceof Array) { + if (r.length === 1) { + r1 = r2 = r3 = r4 = r[0]; + } + else if (r.length === 2) { + r1 = r3 = r[0]; + r2 = r4 = r[1]; + } + else if (r.length === 3) { + r1 = r[0]; + r2 = r4 = r[1]; + r3 = r[2]; + } + else { + r1 = r[0]; + r2 = r[1]; + r3 = r[2]; + r4 = r[3]; + } + } + else { + r1 = r2 = r3 = r4 = 0; + } + + var total; + if (r1 + r2 > width) { + total = r1 + r2; + r1 *= width / total; + r2 *= width / total; + } + if (r3 + r4 > width) { + total = r3 + r4; + r3 *= width / total; + r4 *= width / total; + } + if (r2 + r3 > height) { + total = r2 + r3; + r2 *= height / total; + r3 *= height / total; + } + if (r1 + r4 > height) { + total = r1 + r4; + r1 *= height / total; + r4 *= height / total; + } + ctx.moveTo(x + r1, y); + ctx.lineTo(x + width - r2, y); + r2 !== 0 && ctx.quadraticCurveTo( + x + width, y, x + width, y + r2 + ); + ctx.lineTo(x + width, y + height - r3); + r3 !== 0 && ctx.quadraticCurveTo( + x + width, y + height, x + width - r3, y + height + ); + ctx.lineTo(x + r4, y + height); + r4 !== 0 && ctx.quadraticCurveTo( + x, y + height, x, y + height - r4 + ); + ctx.lineTo(x, y + r1); + r1 !== 0 && ctx.quadraticCurveTo(x, y, x + r1, y); + }, + + /** + * 创建矩形路径 + * @param {CanvasRenderingContext2D} ctx + * @param {Object} style + */ + buildPath : function (ctx, style) { + if (!style.radius) { + ctx.moveTo(style.x, style.y); + ctx.lineTo(style.x + style.width, style.y); + ctx.lineTo(style.x + style.width, style.y + style.height); + ctx.lineTo(style.x, style.y + style.height); + ctx.lineTo(style.x, style.y); + // ctx.rect(style.x, style.y, style.width, style.height); + } + else { + this._buildRadiusPath(ctx, style); + } + ctx.closePath(); + return; + }, + + /** + * 计算返回矩形包围盒矩阵 + * @param {module:zrender/shape/Rectangle~IRectangleStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function(style) { + if (style.__rect) { + return style.__rect; + } + + var lineWidth; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } + else { + lineWidth = 0; + } + style.__rect = { + x : Math.round(style.x - lineWidth / 2), + y : Math.round(style.y - lineWidth / 2), + width : style.width + lineWidth, + height : style.height + lineWidth + }; + + return style.__rect; + } + }; + + require('../tool/util').inherits(Rectangle, Base); + return Rectangle; + } +); + +/** + * zrender: loading特效类 + * + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * errorrik (errorrik@gmail.com) + */ + +define( + 'zrender/loadingEffect/Base',['require','../tool/util','../shape/Text','../shape/Rectangle'],function(require) { + var util = require('../tool/util'); + var TextShape = require('../shape/Text'); + var RectangleShape = require('../shape/Rectangle'); + + + var DEFAULT_TEXT = 'Loading...'; + var DEFAULT_TEXT_FONT = 'normal 16px Arial'; + + /** + * @constructor + * + * @param {Object} options 选项 + * @param {color} options.backgroundColor 背景颜色 + * @param {Object} options.textStyle 文字样式,同shape/text.style + * @param {number=} options.progress 进度参数,部分特效有用 + * @param {Object=} options.effect 特效参数,部分特效有用 + * + * { + * effect, + * //loading话术 + * text:'', + * // 水平安放位置,默认为 'center',可指定x坐标 + * x:'center' || 'left' || 'right' || {number}, + * // 垂直安放位置,默认为'top',可指定y坐标 + * y:'top' || 'bottom' || {number}, + * + * textStyle:{ + * textFont: 'normal 20px Arial' || {textFont}, //文本字体 + * color: {color} + * } + * } + */ + function Base(options) { + this.setOptions(options); + } + + /** + * 创建loading文字图形 + * + * @param {Object} textStyle 文字style,同shape/text.style + */ + Base.prototype.createTextShape = function (textStyle) { + return new TextShape({ + highlightStyle : util.merge( + { + x : this.canvasWidth / 2, + y : this.canvasHeight / 2, + text : DEFAULT_TEXT, + textAlign : 'center', + textBaseline : 'middle', + textFont : DEFAULT_TEXT_FONT, + color: '#333', + brushType : 'fill' + }, + textStyle, + true + ) + }); + }; + + /** + * 获取loading背景图形 + * + * @param {color} color 背景颜色 + */ + Base.prototype.createBackgroundShape = function (color) { + return new RectangleShape({ + highlightStyle : { + x : 0, + y : 0, + width : this.canvasWidth, + height : this.canvasHeight, + brushType : 'fill', + color : color + } + }); + }; + + Base.prototype.start = function (painter) { + this.canvasWidth = painter._width; + this.canvasHeight = painter._height; + + function addShapeHandle(param) { + painter.storage.addHover(param); + } + function refreshHandle() { + painter.refreshHover(); + } + this.loadingTimer = this._start(addShapeHandle, refreshHandle); + }; + + Base.prototype._start = function (/*addShapeHandle, refreshHandle*/) { + return setInterval(function () { + }, 10000); + }; + + Base.prototype.stop = function () { + clearInterval(this.loadingTimer); + }; + + Base.prototype.setOptions = function (options) { + this.options = options || {}; + }; + + Base.prototype.adjust = function (value, region) { + if (value <= region[0]) { + value = region[0]; + } + else if (value >= region[1]) { + value = region[1]; + } + return value; + }; + + Base.prototype.getLocation = function(loc, totalWidth, totalHeight) { + var x = loc.x != null ? loc.x : 'center'; + switch (x) { + case 'center' : + x = Math.floor((this.canvasWidth - totalWidth) / 2); + break; + case 'left' : + x = 0; + break; + case 'right' : + x = this.canvasWidth - totalWidth; + break; + } + var y = loc.y != null ? loc.y : 'center'; + switch (y) { + case 'center' : + y = Math.floor((this.canvasHeight - totalHeight) / 2); + break; + case 'top' : + y = 0; + break; + case 'bottom' : + y = this.canvasHeight - totalHeight; + break; + } + return { + x : x, + y : y, + width : totalWidth, + height : totalHeight + }; + }; + + return Base; + } +); + +/** + * 图片绘制 + * @module zrender/shape/Image + * @author pissang(https://www.github.com/pissang) + * @example + * var ImageShape = require('zrender/shape/Image'); + * var image = new ImageShape({ + * style: { + * image: 'test.jpg', + * x: 100, + * y: 100 + * } + * }); + * zr.addShape(image); + */ + +/** + * @typedef {Object} IImageStyle + * @property {string|HTMLImageElement|HTMLCanvasElement} image 图片url或者图片对象 + * @property {number} x 左上角横坐标 + * @property {number} y 左上角纵坐标 + * @property {number} [width] 绘制到画布上的宽度,默认为图片宽度 + * @property {number} [height] 绘制到画布上的高度,默认为图片高度 + * @property {number} [sx=0] 从图片中裁剪的左上角横坐标 + * @property {number} [sy=0] 从图片中裁剪的左上角纵坐标 + * @property {number} [sWidth] 从图片中裁剪的宽度,默认为图片高度 + * @property {number} [sHeight] 从图片中裁剪的高度,默认为图片高度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ +define( + 'zrender/shape/Image',['require','./Base','../tool/util'],function (require) { + + var _needsRefresh = []; + var _refreshTimeout; + + var Base = require('./Base'); + + /** + * @alias zrender/shape/Image + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var ZImage = function(options) { + Base.call(this, options); + + this._imageCache = {}; + /** + * 图片绘制样式 + * @name module:zrender/shape/Image#style + * @type {module:zrender/shape/Image~IImageStyle} + */ + /** + * 图片高亮绘制样式 + * @name module:zrender/shape/Image#highlightStyle + * @type {module:zrender/shape/Image~IImageStyle} + */ + }; + + ZImage.prototype = { + + type: 'image', + + brush : function(ctx, isHighlight, refresh) { + var style = this.style || {}; + + if (isHighlight) { + // 根据style扩展默认高亮样式 + style = this.getHighlightStyle( + style, this.highlightStyle || {} + ); + } + + var image = style.image; + var me = this; + + if (typeof(image) === 'string') { + var src = image; + if (this._imageCache[src]) { + image = this._imageCache[src]; + } else { + image = new Image(); + image.onload = function () { + image.onload = null; + clearTimeout(_refreshTimeout); + _needsRefresh.push(me); + // 防止因为缓存短时间内触发多次onload事件 + _refreshTimeout = setTimeout(function () { + refresh && refresh(_needsRefresh); + // 清空needsRefresh + _needsRefresh = []; + }, 10); + }; + + image.src = src; + this._imageCache[src] = image; + } + } + if (image) { + // 图片已经加载完成 + if (image.nodeName.toUpperCase() == 'IMG') { + if (window.ActiveXObject) { + if (image.readyState != 'complete') { + return; + } + } + else { + if (!image.complete) { + return; + } + } + } + // Else is canvas + var width = style.width || image.width; + var height = style.height || image.height; + var x = style.x; + var y = style.y; + + // 图片加载失败 + if (!image.width || !image.height) { + return; + } + + ctx.save(); + this.setContext(ctx, style); + + // 设置transform + this.setTransform(ctx); + + if (style.sWidth && style.sHeight) { + var sx = style.sx || 0; + var sy = style.sy || 0; + ctx.drawImage( + image, + sx, sy, style.sWidth, style.sHeight, + x, y, width, height + ); + } + else if (style.sx && style.sy) { + var sx = style.sx; + var sy = style.sy; + var sWidth = width - sx; + var sHeight = height - sy; + ctx.drawImage( + image, + sx, sy, sWidth, sHeight, + x, y, width, height + ); + } + else { + ctx.drawImage(image, x, y, width, height); + } + // 如果没设置宽和高的话自动根据图片宽高设置 + if (!style.width) { + style.width = width; + } + if (!style.height) { + style.height = height; + } + if (!this.style.width) { + this.style.width = width; + } + if (!this.style.height) { + this.style.height = height; + } + + this.drawText(ctx, style, this.style); + + ctx.restore(); + } + }, + + /** + * 计算返回图片的包围盒矩形 + * @param {module:zrender/shape/Image~IImageStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect: function(style) { + return { + x : style.x, + y : style.y, + width : style.width, + height : style.height + }; + }, + + clearCache: function() { + this._imageCache = {}; + } + }; + + require('../tool/util').inherits(ZImage, Base); + return ZImage; + } +); + +/** + * Painter绘图模块 + * @module zrender/Painter + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * errorrik (errorrik@gmail.com) + * pissang (https://www.github.com/pissang) + */ + define( + 'zrender/Painter',['require','./config','./tool/util','./tool/log','./tool/matrix','./loadingEffect/Base','./mixin/Transformable','./shape/Image'],function (require) { + + + var config = require('./config'); + var util = require('./tool/util'); + // var vec2 = require('./tool/vector'); + var log = require('./tool/log'); + var matrix = require('./tool/matrix'); + var BaseLoadingEffect = require('./loadingEffect/Base'); + var Transformable = require('./mixin/Transformable'); + + // retina 屏幕优化 + var devicePixelRatio = window.devicePixelRatio || 1; + devicePixelRatio = Math.max(devicePixelRatio, 1); + var vmlCanvasManager = window['G_vmlCanvasManager']; + + + // 返回false的方法,用于避免页面被选中 + function returnFalse() { + return false; + } + + // 什么都不干的空方法 + function doNothing() {} + + /** + * @alias module:zrender/Painter + * @constructor + * @param {HTMLElement} root 绘图容器 + * @param {module:zrender/Storage} storage + */ + var Painter = function (root, storage) { + /** + * 绘图容器 + * @type {HTMLElement} + */ + this.root = root; + /** + * @type {module:zrender/Storage} + */ + this.storage = storage; + + root.innerHTML = ''; + this._width = this._getWidth(); // 宽,缓存记录 + this._height = this._getHeight(); // 高,缓存记录 + + var domRoot = document.createElement('div'); + this._domRoot = domRoot; + + // domRoot.onselectstart = returnFalse; // 避免页面选中的尴尬 + domRoot.style.position = 'relative'; + domRoot.style.overflow = 'hidden'; + domRoot.style.width = this._width + 'px'; + domRoot.style.height = this._height + 'px'; + root.appendChild(domRoot); + + this._layers = {}; + + this._layerConfig = {}; + + this._loadingEffect = new BaseLoadingEffect({}); + this.shapeToImage = this._createShapeToImageProcessor(); + + // 创建各层canvas + // 背景 + this._bgDom = createDom('bg', 'div', this); + domRoot.appendChild(this._bgDom); + this._bgDom.onselectstart = returnFalse; + this._bgDom.style['-webkit-user-select'] = 'none'; + this._bgDom.style['user-select'] = 'none'; + // this._bgDom.style[' -webkit-touch-callout'] = 'none'; + + // 高亮 + var hoverLayer = new Layer('_zrender_hover_', this); + this._layers['hover'] = hoverLayer; + domRoot.appendChild(hoverLayer.dom); + hoverLayer.initContext(); + + hoverLayer.dom.onselectstart = returnFalse; + hoverLayer.dom.style['-webkit-user-select'] = 'none'; + hoverLayer.dom.style['user-select'] = 'none'; + // hoverLayer.dom.style[' -webkit-touch-callout'] = 'none'; + + var me = this; + this.updatePainter = function (shapeList, callback) { + me.refreshShapes(shapeList, callback); + }; + }; + + /** + * 首次绘图,创建各种dom和context + * + * @param {Function} callback 绘画结束后的回调函数 + */ + Painter.prototype.render = function (callback) { + if (this.isLoading()) { + this.hideLoading(); + } + // TODO + this.refresh(callback, true); + + return this; + }; + + /** + * 刷新 + * @param {Function} callback 刷新结束后的回调函数 + * @param {boolean} paintAll 强制绘制所有shape + */ + Painter.prototype.refresh = function (callback, paintAll) { + var list = this.storage.getShapeList(true); + this._paintList(list, paintAll); + + if (typeof callback == 'function') { + callback(); + } + + return this; + }; + + Painter.prototype._paintList = function (list, paintAll) { + + if (typeof(paintAll) == 'undefined') { + paintAll = false; + } + + this._updateLayerStatus(list); + + var currentLayer; + var currentZLevel; + var ctx; + + for (var id in this._layers) { + if (id !== 'hover') { + this._layers[id].unusedCount++; + this._layers[id].updateTransform(); + } + } + + var invTransform = []; + + for (var i = 0, l = list.length; i < l; i++) { + var shape = list[i]; + + if (currentZLevel !== shape.zlevel) { + if (currentLayer && currentLayer.needTransform) { + ctx.restore(); + } + + currentLayer = this.getLayer(shape.zlevel, currentLayer); + ctx = currentLayer.ctx; + currentZLevel = shape.zlevel; + + // Reset the count + currentLayer.unusedCount = 0; + + if (currentLayer.dirty || paintAll) { + currentLayer.clear(); + } + + if (currentLayer.needTransform) { + ctx.save(); + currentLayer.setTransform(ctx); + } + } + + // Start group clipping + if (shape.__startClip && !vmlCanvasManager) { + var clipShape = shape.__startClip; + ctx.save(); + // Set transform + if (clipShape.needTransform) { + var m = clipShape.transform; + matrix.invert(invTransform, m); + ctx.transform( + m[0], m[1], + m[2], m[3], + m[4], m[5] + ); + } + + ctx.beginPath(); + clipShape.buildPath(ctx, clipShape.style); + ctx.clip(); + + // Transform back + if (clipShape.needTransform) { + var m = invTransform; + ctx.transform( + m[0], m[1], + m[2], m[3], + m[4], m[5] + ); + } + } + + if ((currentLayer.dirty || paintAll) && !shape.invisible) { + if ( + !shape.onbrush + || (shape.onbrush && !shape.onbrush(ctx, false)) + ) { + if (config.catchBrushException) { + try { + shape.brush(ctx, false, this.updatePainter); + } + catch (error) { + log( + error, + 'brush error of ' + shape.type, + shape + ); + } + } + else { + shape.brush(ctx, false, this.updatePainter); + } + } + } + + // Stop group clipping + if (shape.__stopClip && !vmlCanvasManager) { + ctx.restore(); + } + + shape.__dirty = false; + } + + if (currentLayer && currentLayer.needTransform) { + ctx.restore(); + } + + for (var id in this._layers) { + if (id !== 'hover') { + var layer = this._layers[id]; + layer.dirty = false; + // 删除过期的层 + // PENDING + // if (layer.unusedCount >= 500) { + // this.delLayer(id); + // } + if (layer.unusedCount == 1) { + layer.clear(); + } + } + } + }; + + /** + * 获取 zlevel 所在层,如果不存在则会创建一个新的层 + * @param {number} zlevel + * @param {module:zrender/Painter~Layer} [prevLayer] + * 在需要创建新的层时需要使用,新创建层的dom节点会插在该层后面 + */ + Painter.prototype.getLayer = function (zlevel, prevLayer) { + // Change draw layer + var currentLayer = this._layers[zlevel]; + if (!currentLayer) { + // Create a new layer + currentLayer = new Layer(zlevel, this); + var prevDom = prevLayer ? prevLayer.dom : this._bgDom; + if (prevDom.nextSibling) { + prevDom.parentNode.insertBefore( + currentLayer.dom, + prevDom.nextSibling + ); + } + else { + prevDom.parentNode.appendChild( + currentLayer.dom + ); + } + currentLayer.initContext(); + + this._layers[zlevel] = currentLayer; + + if (this._layerConfig[zlevel]) { + util.merge(currentLayer, this._layerConfig[zlevel], true); + } + + currentLayer.updateTransform(); + } + + return currentLayer; + }; + + /** + * 获取所有已创建的层 + * @param {Array.} [prevLayer] + */ + Painter.prototype.getLayers = function () { + return this._layers; + }; + + Painter.prototype._updateLayerStatus = function (list) { + + var layers = this._layers; + + var elCounts = {}; + for (var z in layers) { + if (z !== 'hover') { + elCounts[z] = layers[z].elCount; + layers[z].elCount = 0; + } + } + + for (var i = 0, l = list.length; i < l; i++) { + var shape = list[i]; + var zlevel = shape.zlevel; + var layer = layers[zlevel]; + if (layer) { + layer.elCount++; + // 已经被标记为需要刷新 + if (layer.dirty) { + continue; + } + layer.dirty = shape.__dirty; + } + } + + // 层中的元素数量有发生变化 + for (var z in layers) { + if (z !== 'hover') { + if (elCounts[z] !== layers[z].elCount) { + layers[z].dirty = true; + } + } + } + }; + + /** + * 指定的图形列表 + * @param {Array.} shapeList 需要更新的图形元素列表 + * @param {Function} [callback] 视图更新后回调函数 + */ + Painter.prototype.refreshShapes = function (shapeList, callback) { + for (var i = 0, l = shapeList.length; i < l; i++) { + var shape = shapeList[i]; + this.storage.mod(shape.id); + } + + this.refresh(callback); + return this; + }; + + /** + * 设置loading特效 + * + * @param {Object} loadingEffect loading特效 + * @return {Painter} + */ + Painter.prototype.setLoadingEffect = function (loadingEffect) { + this._loadingEffect = loadingEffect; + return this; + }; + + /** + * 清除hover层外所有内容 + */ + Painter.prototype.clear = function () { + for (var k in this._layers) { + if (k == 'hover') { + continue; + } + this._layers[k].clear(); + } + + return this; + }; + + /** + * 修改指定zlevel的绘制参数 + * + * @param {string} zlevel + * @param {Object} config 配置对象 + * @param {string} [config.clearColor=0] 每次清空画布的颜色 + * @param {string} [config.motionBlur=false] 是否开启动态模糊 + * @param {number} [config.lastFrameAlpha=0.7] + * 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显 + * @param {Array.} [position] 层的平移 + * @param {Array.} [rotation] 层的旋转 + * @param {Array.} [scale] 层的缩放 + * @param {boolean} [zoomable=false] 层是否支持鼠标缩放操作 + * @param {boolean} [panable=false] 层是否支持鼠标平移操作 + */ + Painter.prototype.modLayer = function (zlevel, config) { + if (config) { + if (!this._layerConfig[zlevel]) { + this._layerConfig[zlevel] = config; + } + else { + util.merge(this._layerConfig[zlevel], config, true); + } + + var layer = this._layers[zlevel]; + + if (layer) { + util.merge(layer, this._layerConfig[zlevel], true); + } + } + }; + + /** + * 删除指定层 + * @param {number} zlevel 层所在的zlevel + */ + Painter.prototype.delLayer = function (zlevel) { + var layer = this._layers[zlevel]; + if (!layer) { + return; + } + // Save config + this.modLayer(zlevel, { + position: layer.position, + rotation: layer.rotation, + scale: layer.scale + }); + layer.dom.parentNode.removeChild(layer.dom); + delete this._layers[zlevel]; + }; + + /** + * 刷新hover层 + */ + Painter.prototype.refreshHover = function () { + this.clearHover(); + var list = this.storage.getHoverShapes(true); + for (var i = 0, l = list.length; i < l; i++) { + this._brushHover(list[i]); + } + this.storage.delHover(); + + return this; + }; + + /** + * 清除hover层所有内容 + */ + Painter.prototype.clearHover = function () { + var hover = this._layers.hover; + hover && hover.clear(); + + return this; + }; + + /** + * 显示loading + * + * @param {Object=} loadingEffect loading效果对象 + */ + Painter.prototype.showLoading = function (loadingEffect) { + this._loadingEffect && this._loadingEffect.stop(); + loadingEffect && this.setLoadingEffect(loadingEffect); + this._loadingEffect.start(this); + this.loading = true; + + return this; + }; + + /** + * loading结束 + */ + Painter.prototype.hideLoading = function () { + this._loadingEffect.stop(); + + this.clearHover(); + this.loading = false; + return this; + }; + + /** + * loading结束判断 + */ + Painter.prototype.isLoading = function () { + return this.loading; + }; + + /** + * 区域大小变化后重绘 + */ + Painter.prototype.resize = function () { + var domRoot = this._domRoot; + domRoot.style.display = 'none'; + + var width = this._getWidth(); + var height = this._getHeight(); + + domRoot.style.display = ''; + + // 优化没有实际改变的resize + if (this._width != width || height != this._height) { + this._width = width; + this._height = height; + + domRoot.style.width = width + 'px'; + domRoot.style.height = height + 'px'; + + for (var id in this._layers) { + + this._layers[id].resize(width, height); + } + + this.refresh(null, true); + } + + return this; + }; + + /** + * 清除单独的一个层 + * @param {number} zLevel + */ + Painter.prototype.clearLayer = function (zLevel) { + var layer = this._layers[zLevel]; + if (layer) { + layer.clear(); + } + }; + + /** + * 释放 + */ + Painter.prototype.dispose = function () { + if (this.isLoading()) { + this.hideLoading(); + } + + this.root.innerHTML = ''; + + this.root = + this.storage = + + this._domRoot = + this._layers = null; + }; + + Painter.prototype.getDomHover = function () { + return this._layers.hover.dom; + }; + + /** + * 图像导出 + * @param {string} type + * @param {string} [backgroundColor='#fff'] 背景色 + * @return {string} 图片的Base64 url + */ + Painter.prototype.toDataURL = function (type, backgroundColor, args) { + if (vmlCanvasManager) { + return null; + } + + var imageDom = createDom('image', 'canvas', this); + this._bgDom.appendChild(imageDom); + var ctx = imageDom.getContext('2d'); + devicePixelRatio != 1 + && ctx.scale(devicePixelRatio, devicePixelRatio); + + ctx.fillStyle = backgroundColor || '#fff'; + ctx.rect( + 0, 0, + this._width * devicePixelRatio, + this._height * devicePixelRatio + ); + ctx.fill(); + + var self = this; + // 升序遍历,shape上的zlevel指定绘画图层的z轴层叠 + + this.storage.iterShape( + function (shape) { + if (!shape.invisible) { + if (!shape.onbrush // 没有onbrush + // 有onbrush并且调用执行返回false或undefined则继续粉刷 + || (shape.onbrush && !shape.onbrush(ctx, false)) + ) { + if (config.catchBrushException) { + try { + shape.brush(ctx, false, self.updatePainter); + } + catch (error) { + log( + error, + 'brush error of ' + shape.type, + shape + ); + } + } + else { + shape.brush(ctx, false, self.updatePainter); + } + } + } + }, + { normal: 'up', update: true } + ); + var image = imageDom.toDataURL(type, args); + ctx = null; + this._bgDom.removeChild(imageDom); + return image; + }; + + /** + * 获取绘图区域宽度 + */ + Painter.prototype.getWidth = function () { + return this._width; + }; + + /** + * 获取绘图区域高度 + */ + Painter.prototype.getHeight = function () { + return this._height; + }; + + Painter.prototype._getWidth = function () { + var root = this.root; + var stl = root.currentStyle + || document.defaultView.getComputedStyle(root); + + return ((root.clientWidth || parseInt(stl.width, 10)) + - parseInt(stl.paddingLeft, 10) // 请原谅我这比较粗暴 + - parseInt(stl.paddingRight, 10)).toFixed(0) - 0; + }; + + Painter.prototype._getHeight = function () { + var root = this.root; + var stl = root.currentStyle + || document.defaultView.getComputedStyle(root); + + return ((root.clientHeight || parseInt(stl.height, 10)) + - parseInt(stl.paddingTop, 10) // 请原谅我这比较粗暴 + - parseInt(stl.paddingBottom, 10)).toFixed(0) - 0; + }; + + Painter.prototype._brushHover = function (shape) { + var ctx = this._layers.hover.ctx; + + if (!shape.onbrush // 没有onbrush + // 有onbrush并且调用执行返回false或undefined则继续粉刷 + || (shape.onbrush && !shape.onbrush(ctx, true)) + ) { + var layer = this.getLayer(shape.zlevel); + if (layer.needTransform) { + ctx.save(); + layer.setTransform(ctx); + } + // Retina 优化 + if (config.catchBrushException) { + try { + shape.brush(ctx, true, this.updatePainter); + } + catch (error) { + log( + error, 'hoverBrush error of ' + shape.type, shape + ); + } + } + else { + shape.brush(ctx, true, this.updatePainter); + } + if (layer.needTransform) { + ctx.restore(); + } + } + }; + + Painter.prototype._shapeToImage = function ( + id, shape, width, height, devicePixelRatio + ) { + var canvas = document.createElement('canvas'); + var ctx = canvas.getContext('2d'); + var devicePixelRatio = window.devicePixelRatio || 1; + + canvas.style.width = width + 'px'; + canvas.style.height = height + 'px'; + canvas.setAttribute('width', width * devicePixelRatio); + canvas.setAttribute('height', height * devicePixelRatio); + + ctx.clearRect(0, 0, width * devicePixelRatio, height * devicePixelRatio); + + var shapeTransform = { + position : shape.position, + rotation : shape.rotation, + scale : shape.scale + }; + shape.position = [ 0, 0, 0 ]; + shape.rotation = 0; + shape.scale = [ 1, 1 ]; + if (shape) { + shape.brush(ctx, false); + } + + var ImageShape = require('./shape/Image'); + var imgShape = new ImageShape({ + id : id, + style : { + x : 0, + y : 0, + image : canvas + } + }); + + if (shapeTransform.position != null) { + imgShape.position = shape.position = shapeTransform.position; + } + + if (shapeTransform.rotation != null) { + imgShape.rotation = shape.rotation = shapeTransform.rotation; + } + + if (shapeTransform.scale != null) { + imgShape.scale = shape.scale = shapeTransform.scale; + } + + return imgShape; + }; + + Painter.prototype._createShapeToImageProcessor = function () { + if (vmlCanvasManager) { + return doNothing; + } + + var me = this; + + return function (id, e, width, height) { + return me._shapeToImage( + id, e, width, height, devicePixelRatio + ); + }; + }; + + /** + * 创建dom + * + * @inner + * @param {string} id dom id 待用 + * @param {string} type dom type,such as canvas, div etc. + * @param {Painter} painter painter instance + */ + function createDom(id, type, painter) { + var newDom = document.createElement(type); + var width = painter._width; + var height = painter._height; + + // 没append呢,请原谅我这样写,清晰~ + newDom.style.position = 'absolute'; + newDom.style.left = 0; + newDom.style.top = 0; + newDom.style.width = width + 'px'; + newDom.style.height = height + 'px'; + newDom.setAttribute('width', width * devicePixelRatio); + newDom.setAttribute('height', height * devicePixelRatio); + + // id不作为索引用,避免可能造成的重名,定义为私有属性 + newDom.setAttribute('data-zr-dom-id', id); + return newDom; + } + + /** + * @alias module:zrender/Painter~Layer + * @constructor + * @extends module:zrender/mixin/Transformable + * @param {string} id + * @param {module:zrender/Painter} painter + */ + var Layer = function(id, painter) { + this.dom = createDom(id, 'canvas', painter); + this.dom.onselectstart = returnFalse; // 避免页面选中的尴尬 + this.dom.style['-webkit-user-select'] = 'none'; + this.dom.style['user-select'] = 'none'; + // this.dom.style[' -webkit-touch-callout'] = 'none'; + vmlCanvasManager && vmlCanvasManager.initElement(this.dom); + + this.domBack = null; + this.ctxBack = null; + + this.painter = painter; + + this.unusedCount = 0; + + this.config = null; + + this.dirty = true; + + this.elCount = 0; + + // Configs + /** + * 每次清空画布的颜色 + * @type {string} + * @default 0 + */ + this.clearColor = 0; + /** + * 是否开启动态模糊 + * @type {boolean} + * @default false + */ + this.motionBlur = false; + /** + * 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显 + * @type {number} + * @default 0.7 + */ + this.lastFrameAlpha = 0.7; + /** + * 层是否支持鼠标平移操作 + * @type {boolean} + * @default false + */ + this.zoomable = false; + /** + * 层是否支持鼠标缩放操作 + * @type {boolean} + * @default false + */ + this.panable = false; + + this.maxZoom = Infinity; + this.minZoom = 0; + + Transformable.call(this); + }; + + Layer.prototype.initContext = function () { + this.ctx = this.dom.getContext('2d'); + if (devicePixelRatio != 1) { + this.ctx.scale(devicePixelRatio, devicePixelRatio); + } + }; + + Layer.prototype.createBackBuffer = function () { + if (vmlCanvasManager) { // IE 8- should not support back buffer + return; + } + this.domBack = createDom('back-' + this.id, 'canvas', this.painter); + this.ctxBack = this.domBack.getContext('2d'); + + if (devicePixelRatio != 1) { + this.ctxBack.scale(devicePixelRatio, devicePixelRatio); + } + }; + + /** + * @param {number} width + * @param {number} height + */ + Layer.prototype.resize = function (width, height) { + this.dom.style.width = width + 'px'; + this.dom.style.height = height + 'px'; + + this.dom.setAttribute('width', width * devicePixelRatio); + this.dom.setAttribute('height', height * devicePixelRatio); + + if (devicePixelRatio != 1) { + this.ctx.scale(devicePixelRatio, devicePixelRatio); + } + + if (this.domBack) { + this.domBack.setAttribute('width', width * devicePixelRatio); + this.domBack.setAttribute('height', height * devicePixelRatio); + + if (devicePixelRatio != 1) { + this.ctxBack.scale(devicePixelRatio, devicePixelRatio); + } + } + }; + + /** + * 清空该层画布 + */ + Layer.prototype.clear = function () { + var dom = this.dom; + var ctx = this.ctx; + var width = dom.width; + var height = dom.height; + + var haveClearColor = this.clearColor && !vmlCanvasManager; + var haveMotionBLur = this.motionBlur && !vmlCanvasManager; + var lastFrameAlpha = this.lastFrameAlpha; + + if (haveMotionBLur) { + if (!this.domBack) { + this.createBackBuffer(); + } + + this.ctxBack.globalCompositeOperation = 'copy'; + this.ctxBack.drawImage( + dom, 0, 0, + width / devicePixelRatio, + height / devicePixelRatio + ); + } + + if (haveClearColor) { + ctx.save(); + ctx.fillStyle = this.config.clearColor; + ctx.fillRect( + 0, 0, + width / devicePixelRatio, + height / devicePixelRatio + ); + ctx.restore(); + } + else { + ctx.clearRect( + 0, 0, + width / devicePixelRatio, + height / devicePixelRatio + ); + } + + if (haveMotionBLur) { + var domBack = this.domBack; + ctx.save(); + ctx.globalAlpha = lastFrameAlpha; + ctx.drawImage( + domBack, 0, 0, + width / devicePixelRatio, + height / devicePixelRatio + ); + ctx.restore(); + } + }; + + util.merge(Layer.prototype, Transformable.prototype); + + return Painter; + } +); + +/** + * Group是一个容器,可以插入子节点,Group的变换也会被应用到子节点上 + * @module zrender/Group + * @example + * var Group = require('zrender/Group'); + * var Circle = require('zrender/shape/Circle'); + * var g = new Group(); + * g.position[0] = 100; + * g.position[1] = 100; + * g.addChild(new Circle({ + * style: { + * x: 100, + * y: 100, + * r: 20, + * brushType: 'fill' + * } + * })); + * zr.addGroup(g); + */ +define('zrender/Group',['require','./tool/guid','./tool/util','./mixin/Transformable','./mixin/Eventful'],function(require) { + + var guid = require('./tool/guid'); + var util = require('./tool/util'); + + var Transformable = require('./mixin/Transformable'); + var Eventful = require('./mixin/Eventful'); + + /** + * @alias module:zrender/Group + * @constructor + * @extends module:zrender/mixin/Transformable + * @extends module:zrender/mixin/Eventful + */ + var Group = function(options) { + + options = options || {}; + + /** + * Group id + * @type {string} + */ + this.id = options.id || guid(); + + for (var key in options) { + this[key] = options[key]; + } + + /** + * @type {string} + */ + this.type = 'group'; + + /** + * 用于裁剪的图形(shape),所有 Group 内的图形在绘制时都会被这个图形裁剪 + * 该图形会继承Group的变换 + * @type {module:zrender/shape/Base} + * @see http://www.w3.org/TR/2dcontext/#clipping-region + */ + this.clipShape = null; + + this._children = []; + + this._storage = null; + + this.__dirty = true; + + // Mixin + Transformable.call(this); + Eventful.call(this); + }; + + /** + * 是否忽略该 Group 及其所有子节点 + * @type {boolean} + * @default false + */ + Group.prototype.ignore = false; + + /** + * 复制并返回一份新的包含所有儿子节点的数组 + * @return {Array.} + */ + Group.prototype.children = function() { + return this._children.slice(); + }; + + /** + * 获取指定 index 的儿子节点 + * @param {number} idx + * @return {module:zrender/Group|module:zrender/shape/Base} + */ + Group.prototype.childAt = function(idx) { + return this._children[idx]; + }; + + /** + * 添加子节点,可以是Shape或者Group + * @param {module:zrender/Group|module:zrender/shape/Base} child + */ + Group.prototype.addChild = function(child) { + if (child == this) { + return; + } + + if (child.parent == this) { + return; + } + if (child.parent) { + child.parent.removeChild(child); + } + + this._children.push(child); + child.parent = this; + + if (this._storage && this._storage !== child._storage) { + + this._storage.addToMap(child); + + if (child instanceof Group) { + child.addChildrenToStorage(this._storage); + } + } + }; + + /** + * 移除子节点 + * @param {module:zrender/Group|module:zrender/shape/Base} child + */ + Group.prototype.removeChild = function(child) { + var idx = util.indexOf(this._children, child); + + this._children.splice(idx, 1); + child.parent = null; + + if (child._storage) { + + this._storage.delFromMap(child.id); + + if (child instanceof Group) { + child.delChildrenFromStorage(child._storage); + } + } + }; + + /** + * 遍历所有子节点 + * @param {Function} cb + * @param {} context + */ + Group.prototype.eachChild = function(cb, context) { + var haveContext = !!context; + for (var i = 0; i < this._children.length; i++) { + var child = this._children[i]; + if (haveContext) { + cb.call(context, child); + } else { + cb(child); + } + } + }; + + /** + * 深度优先遍历所有子孙节点 + * @param {Function} cb + * @param {} context + */ + Group.prototype.traverse = function(cb, context) { + var haveContext = !!context; + for (var i = 0; i < this._children.length; i++) { + var child = this._children[i]; + if (haveContext) { + cb.call(context, child); + } else { + cb(child); + } + + if (child.type === 'group') { + child.traverse(cb, context); + } + } + }; + + Group.prototype.addChildrenToStorage = function(storage) { + for (var i = 0; i < this._children.length; i++) { + var child = this._children[i]; + storage.addToMap(child); + if (child.type === 'group') { + child.addChildrenToStorage(storage); + } + } + }; + + Group.prototype.delChildrenFromStorage = function(storage) { + for (var i = 0; i < this._children.length; i++) { + var child = this._children[i]; + storage.delFromMap(child.id); + if (child.type === 'group') { + child.delChildrenFromStorage(storage); + } + } + }; + + Group.prototype.modSelf = function() { + this.__dirty = true; + }; + + util.merge(Group.prototype, Transformable.prototype, true); + util.merge(Group.prototype, Eventful.prototype, true); + + return Group; }); -/** - * echarts图表类:柱形图 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/chart/bar',['require','../component/base','./base','zrender/shape/Rectangle','../component/axis','../component/grid','../component/dataZoom','../config','../util/ecData','zrender/tool/util','zrender/tool/color','../chart'],function (require) { - var ComponentBase = require('../component/base'); - var ChartBase = require('./base'); - - // 图形依赖 - var RectangleShape = require('zrender/shape/Rectangle'); - // 组件依赖 - require('../component/axis'); - require('../component/grid'); - require('../component/dataZoom'); - - var ecConfig = require('../config'); - var ecData = require('../util/ecData'); - var zrUtil = require('zrender/tool/util'); - var zrColor = require('zrender/tool/color'); - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} series 数据 - * @param {Object} component 组件 - */ - function Bar(ecTheme, messageCenter, zr, option, myChart){ - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); - // 图表基类 - ChartBase.call(this); - - this.refresh(option); - } - - Bar.prototype = { - type : ecConfig.CHART_TYPE_BAR, - /** - * 绘制图形 - */ - _buildShape : function () { - var series = this.series; - this.selectedMap = {}; - this.xMarkMap = {}; - - // series默认颜色索引,seriesIndex索引到color - this._sIndex2colorMap = {}; - - // 水平垂直双向series索引 ,position索引到seriesIndex - var _position2sIndexMap = { - top : [], - bottom : [], - left : [], - right : [] - }; - var xAxisIndex; - var yAxisIndex; - var xAxis; - var yAxis; - for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type == ecConfig.CHART_TYPE_BAR) { - series[i] = this.reformOption(series[i]); - xAxisIndex = series[i].xAxisIndex; - yAxisIndex = series[i].yAxisIndex; - xAxis = this.component.xAxis.getAxis(xAxisIndex); - yAxis = this.component.yAxis.getAxis(yAxisIndex); - if (xAxis.type == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY - ) { - _position2sIndexMap[xAxis.getPosition()].push(i); - } - else if (yAxis.type == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY - ) { - _position2sIndexMap[yAxis.getPosition()].push(i); - } - } - } - // console.log(_position2sIndexMap) - for (var position in _position2sIndexMap) { - if (_position2sIndexMap[position].length > 0) { - this._buildSinglePosition( - position, _position2sIndexMap[position], this.xMarkMap - ); - } - } - - this.addShapeList(); - }, - - /** - * 构建单个方向上的柱形图 - * - * @param {number} seriesIndex 系列索引 - */ - _buildSinglePosition : function (position, seriesArray, xMarkMap) { - var mapData = this._mapData(seriesArray); - var locationMap = mapData.locationMap; - var maxDataLength = mapData.maxDataLength; +/** + * Storage内容仓库模块 + * @module zrender/Storage + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author errorrik (errorrik@gmail.com) + * @author pissang (https://github.com/pissang/) + */ +define( + 'zrender/Storage',['require','./tool/util','./Group'],function (require) { + + + + var util = require('./tool/util'); + + var Group = require('./Group'); + + var defaultIterateOption = { + hover: false, + normal: 'down', + update: false + }; + + function shapeCompareFunc(a, b) { + if (a.zlevel == b.zlevel) { + if (a.z == b.z) { + return a.__renderidx - b.__renderidx; + } + return a.z - b.z; + } + return a.zlevel - b.zlevel; + } + /** + * 内容仓库 (M) + * @alias module:zrender/Storage + * @constructor + */ + var Storage = function () { + // 所有常规形状,id索引的map + this._elements = {}; + + // 高亮层形状,不稳定,动态增删,数组位置也是z轴方向,靠前显示在下方 + this._hoverElements = []; + + this._roots = []; + + this._shapeList = []; + + this._shapeListOffset = 0; + }; + + /** + * 遍历迭代器 + * + * @param {Function} fun 迭代回调函数,return true终止迭代 + * @param {Object} [option] 迭代参数,缺省为仅降序遍历普通层图形 + * @param {boolean} [option.hover=true] 是否是高亮层图形 + * @param {string} [option.normal='up'] 是否是普通层图形,迭代时是否指定及z轴顺序 + * @param {boolean} [option.update=false] 是否在迭代前更新形状列表 + * + */ + Storage.prototype.iterShape = function (fun, option) { + if (!option) { + option = defaultIterateOption; + } + + if (option.hover) { + // 高亮层数据遍历 + for (var i = 0, l = this._hoverElements.length; i < l; i++) { + var el = this._hoverElements[i]; + el.updateTransform(); + if (fun(el)) { + return this; + } + } + } + + if (option.update) { + this.updateShapeList(); + } + + // 遍历: 'down' | 'up' + switch (option.normal) { + case 'down': + // 降序遍历,高层优先 + var l = this._shapeList.length; + while (l--) { + if (fun(this._shapeList[l])) { + return this; + } + } + break; + // case 'up': + default: + // 升序遍历,底层优先 + for (var i = 0, l = this._shapeList.length; i < l; i++) { + if (fun(this._shapeList[i])) { + return this; + } + } + break; + } + + return this; + }; + + /** + * 返回hover层的形状数组 + * @param {boolean} [update=false] 是否在返回前更新图形的变换 + * @return {Array.} + */ + Storage.prototype.getHoverShapes = function (update) { + if (update) { + for (var i = 0, l = this._hoverElements.length; i < l; i++) { + this._hoverElements[i].updateTransform(); + } + } + return this._hoverElements; + }; + + /** + * 返回所有图形的绘制队列 + * @param {boolean} [update=false] 是否在返回前更新该数组 + * 详见{@link module:zrender/shape/Base.prototype.updateShapeList} + * @return {Array.} + */ + Storage.prototype.getShapeList = function (update) { + if (update) { + this.updateShapeList(); + } + return this._shapeList; + }; + + /** + * 更新图形的绘制队列。 + * 每次绘制前都会调用,该方法会先深度优先遍历整个树,更新所有Group和Shape的变换并且把所有可见的Shape保存到数组中, + * 最后根据绘制的优先级(zlevel > z > 插入顺序)排序得到绘制队列 + */ + Storage.prototype.updateShapeList = function () { + this._shapeListOffset = 0; + for (var i = 0, len = this._roots.length; i < len; i++) { + var root = this._roots[i]; + this._updateAndAddShape(root); + } + this._shapeList.length = this._shapeListOffset; + + for (var i = 0, len = this._shapeList.length; i < len; i++) { + this._shapeList[i].__renderidx = i; + } + + this._shapeList.sort(shapeCompareFunc); + }; + + Storage.prototype._updateAndAddShape = function (el) { + + if (el.ignore) { + return; + } + + el.updateTransform(); + + if (el.type == 'group') { + + if (el.clipShape) { + // clipShape 的变换是基于 group 的变换 + el.clipShape.parent = el; + el.clipShape.updateTransform(); + + var startClipShape = el._children[0]; + if (startClipShape) { + startClipShape.__startClip = el.clipShape; + } + } + + for (var i = 0; i < el._children.length; i++) { + var child = el._children[i]; + + // Force to mark as dirty if group is dirty + child.__dirty = el.__dirty || child.__dirty; + + this._updateAndAddShape(child); + } + + if (el.clipShape) { + var stopClipShape = this._shapeList[this._shapeListOffset - 1]; + if (stopClipShape) { + stopClipShape.__stopClip = true; + } + } + + // Mark group clean here + el.__dirty = false; + + } + else { + this._shapeList[this._shapeListOffset++] = el; + } + }; + + /** + * 修改图形(Shape)或者组(Group) + * + * @param {string} elId 唯一标识 + * @param {Object} [params] 参数 + */ + Storage.prototype.mod = function (elId, params) { + var el = this._elements[elId]; + if (el) { + + el.modSelf(); + + if (params) { + // 如果第二个参数直接使用 shape + // parent, _storage, __startClip 三个属性会有循环引用 + // 主要为了向 1.x 版本兼容,2.x 版本不建议使用第二个参数 + if (params.parent || params._storage || params.__startClip) { + var target = {}; + for (var name in params) { + if ( + name == 'parent' + || name == '_storage' + || name == '__startClip' + ) { + continue; + } + if (params.hasOwnProperty(name)) { + target[name] = params[name]; + } + } + util.merge(el, target, true); + } + else { + util.merge(el, params, true); + } + } + } + + return this; + }; + + /** + * 移动指定的图形(Shape)或者组(Group)的位置 + * @param {string} shapeId 形状唯一标识 + * @param {number} dx + * @param {number} dy + */ + Storage.prototype.drift = function (shapeId, dx, dy) { + var shape = this._elements[shapeId]; + if (shape) { + shape.needTransform = true; + if (!shape.ondrift // ondrift + // 有onbrush并且调用执行返回false或undefined则继续 + || (shape.ondrift && !shape.ondrift(dx, dy)) + ) { + shape.drift(dx, dy); + } + } + + return this; + }; + + /** + * 添加高亮层数据 + * + * @param {module:zrender/shape/Base} shape + */ + Storage.prototype.addHover = function (shape) { + shape.updateNeedTransform(); + this._hoverElements.push(shape); + return this; + }; + + /** + * 清空高亮层数据 + */ + Storage.prototype.delHover = function () { + this._hoverElements = []; + return this; + }; + + /** + * 是否有图形在高亮层里 + * @return {boolean} + */ + Storage.prototype.hasHoverShape = function () { + return this._hoverElements.length > 0; + }; + + /** + * 添加图形(Shape)或者组(Group)到根节点 + * @param {module:zrender/shape/Shape|module:zrender/Group} el + */ + Storage.prototype.addRoot = function (el) { + if (el instanceof Group) { + el.addChildrenToStorage(this); + } + + this.addToMap(el); + this._roots.push(el); + }; + + /** + * 删除指定的图形(Shape)或者组(Group) + * @param {string|Array.} [elId] 如果为空清空整个Storage + */ + Storage.prototype.delRoot = function (elId) { + if (typeof(elId) == 'undefined') { + // 不指定elId清空 + for (var i = 0; i < this._roots.length; i++) { + var root = this._roots[i]; + if (root instanceof Group) { + root.delChildrenFromStorage(this); + } + } + + this._elements = {}; + this._hoverElements = []; + this._roots = []; + + return; + } + + if (elId instanceof Array) { + for (var i = 0, l = elId.length; i < l; i++) { + this.delRoot(elId[i]); + } + return; + } + + var el; + if (typeof(elId) == 'string') { + el = this._elements[elId]; + } + else { + el = elId; + } + + var idx = util.indexOf(this._roots, el); + if (idx >= 0) { + this.delFromMap(el.id); + this._roots.splice(idx, 1); + if (el instanceof Group) { + el.delChildrenFromStorage(this); + } + } + }; + + Storage.prototype.addToMap = function (el) { + if (el instanceof Group) { + el._storage = this; + } + el.modSelf(); + + this._elements[el.id] = el; + + return this; + }; + + Storage.prototype.get = function (elId) { + return this._elements[elId]; + }; + + Storage.prototype.delFromMap = function (elId) { + var el = this._elements[elId]; + if (el) { + delete this._elements[elId]; + + if (el instanceof Group) { + el._storage = null; + } + } + + return this; + }; + + + /** + * 清空并且释放Storage + */ + Storage.prototype.dispose = function () { + this._elements = + this._renderList = + this._roots = + this._hoverElements = null; + }; + + return Storage; + } +); + +define( + 'zrender/animation/easing',[],function() { + /** + * 缓动代码来自 https://github.com/sole/tween.js/blob/master/src/Tween.js + * @see http://sole.github.io/tween.js/examples/03_graphs.html + * @exports zrender/animation/easing + */ + var easing = { + // 线性 + /** + * @param {number} k + * @return {number} + */ + Linear: function (k) { + return k; + }, + + // 二次方的缓动(t^2) + /** + * @param {number} k + * @return {number} + */ + QuadraticIn: function (k) { + return k * k; + }, + /** + * @param {number} k + * @return {number} + */ + QuadraticOut: function (k) { + return k * (2 - k); + }, + /** + * @param {number} k + * @return {number} + */ + QuadraticInOut: function (k) { + if ((k *= 2) < 1) { + return 0.5 * k * k; + } + return -0.5 * (--k * (k - 2) - 1); + }, + + // 三次方的缓动(t^3) + /** + * @param {number} k + * @return {number} + */ + CubicIn: function (k) { + return k * k * k; + }, + /** + * @param {number} k + * @return {number} + */ + CubicOut: function (k) { + return --k * k * k + 1; + }, + /** + * @param {number} k + * @return {number} + */ + CubicInOut: function (k) { + if ((k *= 2) < 1) { + return 0.5 * k * k * k; + } + return 0.5 * ((k -= 2) * k * k + 2); + }, + + // 四次方的缓动(t^4) + /** + * @param {number} k + * @return {number} + */ + QuarticIn: function (k) { + return k * k * k * k; + }, + /** + * @param {number} k + * @return {number} + */ + QuarticOut: function (k) { + return 1 - (--k * k * k * k); + }, + /** + * @param {number} k + * @return {number} + */ + QuarticInOut: function (k) { + if ((k *= 2) < 1) { + return 0.5 * k * k * k * k; + } + return -0.5 * ((k -= 2) * k * k * k - 2); + }, + + // 五次方的缓动(t^5) + /** + * @param {number} k + * @return {number} + */ + QuinticIn: function (k) { + return k * k * k * k * k; + }, + /** + * @param {number} k + * @return {number} + */ + QuinticOut: function (k) { + return --k * k * k * k * k + 1; + }, + /** + * @param {number} k + * @return {number} + */ + QuinticInOut: function (k) { + if ((k *= 2) < 1) { + return 0.5 * k * k * k * k * k; + } + return 0.5 * ((k -= 2) * k * k * k * k + 2); + }, + + // 正弦曲线的缓动(sin(t)) + /** + * @param {number} k + * @return {number} + */ + SinusoidalIn: function (k) { + return 1 - Math.cos(k * Math.PI / 2); + }, + /** + * @param {number} k + * @return {number} + */ + SinusoidalOut: function (k) { + return Math.sin(k * Math.PI / 2); + }, + /** + * @param {number} k + * @return {number} + */ + SinusoidalInOut: function (k) { + return 0.5 * (1 - Math.cos(Math.PI * k)); + }, + + // 指数曲线的缓动(2^t) + /** + * @param {number} k + * @return {number} + */ + ExponentialIn: function (k) { + return k === 0 ? 0 : Math.pow(1024, k - 1); + }, + /** + * @param {number} k + * @return {number} + */ + ExponentialOut: function (k) { + return k === 1 ? 1 : 1 - Math.pow(2, -10 * k); + }, + /** + * @param {number} k + * @return {number} + */ + ExponentialInOut: function (k) { + if (k === 0) { + return 0; + } + if (k === 1) { + return 1; + } + if ((k *= 2) < 1) { + return 0.5 * Math.pow(1024, k - 1); + } + return 0.5 * (-Math.pow(2, -10 * (k - 1)) + 2); + }, + + // 圆形曲线的缓动(sqrt(1-t^2)) + /** + * @param {number} k + * @return {number} + */ + CircularIn: function (k) { + return 1 - Math.sqrt(1 - k * k); + }, + /** + * @param {number} k + * @return {number} + */ + CircularOut: function (k) { + return Math.sqrt(1 - (--k * k)); + }, + /** + * @param {number} k + * @return {number} + */ + CircularInOut: function (k) { + if ((k *= 2) < 1) { + return -0.5 * (Math.sqrt(1 - k * k) - 1); + } + return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1); + }, + + // 创建类似于弹簧在停止前来回振荡的动画 + /** + * @param {number} k + * @return {number} + */ + ElasticIn: function (k) { + var s; + var a = 0.1; + var p = 0.4; + if (k === 0) { + return 0; + } + if (k === 1) { + return 1; + } + if (!a || a < 1) { + a = 1; s = p / 4; + } + else { + s = p * Math.asin(1 / a) / (2 * Math.PI); + } + return -(a * Math.pow(2, 10 * (k -= 1)) * + Math.sin((k - s) * (2 * Math.PI) / p)); + }, + /** + * @param {number} k + * @return {number} + */ + ElasticOut: function (k) { + var s; + var a = 0.1; + var p = 0.4; + if (k === 0) { + return 0; + } + if (k === 1) { + return 1; + } + if (!a || a < 1) { + a = 1; s = p / 4; + } + else { + s = p * Math.asin(1 / a) / (2 * Math.PI); + } + return (a * Math.pow(2, -10 * k) * + Math.sin((k - s) * (2 * Math.PI) / p) + 1); + }, + /** + * @param {number} k + * @return {number} + */ + ElasticInOut: function (k) { + var s; + var a = 0.1; + var p = 0.4; + if (k === 0) { + return 0; + } + if (k === 1) { + return 1; + } + if (!a || a < 1) { + a = 1; s = p / 4; + } + else { + s = p * Math.asin(1 / a) / (2 * Math.PI); + } + if ((k *= 2) < 1) { + return -0.5 * (a * Math.pow(2, 10 * (k -= 1)) + * Math.sin((k - s) * (2 * Math.PI) / p)); + } + return a * Math.pow(2, -10 * (k -= 1)) + * Math.sin((k - s) * (2 * Math.PI) / p) * 0.5 + 1; + + }, + + // 在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动 + /** + * @param {number} k + * @return {number} + */ + BackIn: function (k) { + var s = 1.70158; + return k * k * ((s + 1) * k - s); + }, + /** + * @param {number} k + * @return {number} + */ + BackOut: function (k) { + var s = 1.70158; + return --k * k * ((s + 1) * k + s) + 1; + }, + /** + * @param {number} k + * @return {number} + */ + BackInOut: function (k) { + var s = 1.70158 * 1.525; + if ((k *= 2) < 1) { + return 0.5 * (k * k * ((s + 1) * k - s)); + } + return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2); + }, + + // 创建弹跳效果 + /** + * @param {number} k + * @return {number} + */ + BounceIn: function (k) { + return 1 - easing.BounceOut(1 - k); + }, + /** + * @param {number} k + * @return {number} + */ + BounceOut: function (k) { + if (k < (1 / 2.75)) { + return 7.5625 * k * k; + } + else if (k < (2 / 2.75)) { + return 7.5625 * (k -= (1.5 / 2.75)) * k + 0.75; + } + else if (k < (2.5 / 2.75)) { + return 7.5625 * (k -= (2.25 / 2.75)) * k + 0.9375; + } + else { + return 7.5625 * (k -= (2.625 / 2.75)) * k + 0.984375; + } + }, + /** + * @param {number} k + * @return {number} + */ + BounceInOut: function (k) { + if (k < 0.5) { + return easing.BounceIn(k * 2) * 0.5; + } + return easing.BounceOut(k * 2 - 1) * 0.5 + 0.5; + } + }; + + return easing; + } +); + + +/** + * 动画主控制器 + * @config target 动画对象,可以是数组,如果是数组的话会批量分发onframe等事件 + * @config life(1000) 动画时长 + * @config delay(0) 动画延迟时间 + * @config loop(true) + * @config gap(0) 循环的间隔时间 + * @config onframe + * @config easing(optional) + * @config ondestroy(optional) + * @config onrestart(optional) + */ +define( + 'zrender/animation/Clip',['require','./easing'],function(require) { + + var Easing = require('./easing'); + + function Clip(options) { + + this._targetPool = options.target || {}; + if (!(this._targetPool instanceof Array)) { + this._targetPool = [ this._targetPool ]; + } + + // 生命周期 + this._life = options.life || 1000; + // 延时 + this._delay = options.delay || 0; + // 开始时间 + this._startTime = new Date().getTime() + this._delay;// 单位毫秒 + + // 结束时间 + this._endTime = this._startTime + this._life * 1000; + + // 是否循环 + this.loop = typeof options.loop == 'undefined' + ? false : options.loop; + + this.gap = options.gap || 0; + + this.easing = options.easing || 'Linear'; + + this.onframe = options.onframe; + this.ondestroy = options.ondestroy; + this.onrestart = options.onrestart; + } + + Clip.prototype = { + step : function (time) { + var percent = (time - this._startTime) / this._life; + + // 还没开始 + if (percent < 0) { + return; + } + + percent = Math.min(percent, 1); + + var easingFunc = typeof this.easing == 'string' + ? Easing[this.easing] + : this.easing; + var schedule = typeof easingFunc === 'function' + ? easingFunc(percent) + : percent; + + this.fire('frame', schedule); + + // 结束 + if (percent == 1) { + if (this.loop) { + this.restart(); + // 重新开始周期 + // 抛出而不是直接调用事件直到 stage.update 后再统一调用这些事件 + return 'restart'; + + } + + // 动画完成将这个控制器标识为待删除 + // 在Animation.update中进行批量删除 + this._needsRemove = true; + return 'destroy'; + } + + return null; + }, + restart : function() { + var time = new Date().getTime(); + var remainder = (time - this._startTime) % this._life; + this._startTime = new Date().getTime() - remainder + this.gap; + }, + fire : function(eventType, arg) { + for (var i = 0, len = this._targetPool.length; i < len; i++) { + if (this['on' + eventType]) { + this['on' + eventType](this._targetPool[i], arg); + } + } + }, + constructor: Clip + }; + + return Clip; + } +); + +/** + * 动画主类, 调度和管理所有动画控制器 + * + * @module zrender/animation/Animation + * @author pissang(https://github.com/pissang) + */ +define( + 'zrender/animation/Animation',['require','./Clip','../tool/color','../tool/util','../tool/event'],function(require) { + + + + var Clip = require('./Clip'); + var color = require('../tool/color'); + var util = require('../tool/util'); + var Dispatcher = require('../tool/event').Dispatcher; + + var requestAnimationFrame = window.requestAnimationFrame + || window.msRequestAnimationFrame + || window.mozRequestAnimationFrame + || window.webkitRequestAnimationFrame + || function (func) { + setTimeout(func, 16); + }; + + var arraySlice = Array.prototype.slice; + + /** + * @typedef {Object} IZRenderStage + * @property {Function} update + */ + + /** + * @alias module:zrender/animation/Animation + * @constructor + * @param {Object} [options] + * @param {Function} [options.onframe] + * @param {IZRenderStage} [options.stage] + * @example + * var animation = new Animation(); + * var obj = { + * x: 100, + * y: 100 + * }; + * animation.animate(node.position) + * .when(1000, { + * x: 500, + * y: 500 + * }) + * .when(2000, { + * x: 100, + * y: 100 + * }) + * .start('spline'); + */ + var Animation = function (options) { + + options = options || {}; + + this.stage = options.stage || {}; + + this.onframe = options.onframe || function() {}; + + // private properties + this._clips = []; + + this._running = false; + + this._time = 0; + + Dispatcher.call(this); + }; + + Animation.prototype = { + /** + * 添加动画片段 + * @param {module:zrender/animation/Clip} clip + */ + add: function(clip) { + this._clips.push(clip); + }, + /** + * 删除动画片段 + * @param {module:zrender/animation/Clip} clip + */ + remove: function(clip) { + var idx = util.indexOf(this._clips, clip); + if (idx >= 0) { + this._clips.splice(idx, 1); + } + }, + _update: function() { + + var time = new Date().getTime(); + var delta = time - this._time; + var clips = this._clips; + var len = clips.length; + + var deferredEvents = []; + var deferredClips = []; + for (var i = 0; i < len; i++) { + var clip = clips[i]; + var e = clip.step(time); + // Throw out the events need to be called after + // stage.update, like destroy + if (e) { + deferredEvents.push(e); + deferredClips.push(clip); + } + } + if (this.stage.update) { + this.stage.update(); + } + + // Remove the finished clip + for (var i = 0; i < len;) { + if (clips[i]._needsRemove) { + clips[i] = clips[len - 1]; + clips.pop(); + len--; + } + else { + i++; + } + } + + len = deferredEvents.length; + for (var i = 0; i < len; i++) { + deferredClips[i].fire(deferredEvents[i]); + } + + this._time = time; + + this.onframe(delta); + + this.dispatch('frame', delta); + }, + /** + * 开始运行动画 + */ + start: function () { + var self = this; + + this._running = true; + + function step() { + if (self._running) { + self._update(); + requestAnimationFrame(step); + } + } + + this._time = new Date().getTime(); + requestAnimationFrame(step); + }, + /** + * 停止运行动画 + */ + stop: function () { + this._running = false; + }, + /** + * 清除所有动画片段 + */ + clear : function () { + this._clips = []; + }, + /** + * 对一个目标创建一个animator对象,可以指定目标中的属性使用动画 + * @param {Object} target + * @param {Object} options + * @param {boolean} [options.loop=false] 是否循环播放动画 + * @param {Function} [options.getter=null] + * 如果指定getter函数,会通过getter函数取属性值 + * @param {Function} [options.setter=null] + * 如果指定setter函数,会通过setter函数设置属性值 + * @return {module:zrender/animation/Animation~Animator} + */ + animate : function (target, options) { + options = options || {}; + var deferred = new Animator( + target, + options.loop, + options.getter, + options.setter + ); + deferred.animation = this; + return deferred; + }, + constructor: Animation + }; + + util.merge(Animation.prototype, Dispatcher.prototype, true); + + function _defaultGetter(target, key) { + return target[key]; + } + + function _defaultSetter(target, key, value) { + target[key] = value; + } + + function _interpolateNumber(p0, p1, percent) { + return (p1 - p0) * percent + p0; + } + + function _interpolateArray(p0, p1, percent, out, arrDim) { + var len = p0.length; + if (arrDim == 1) { + for (var i = 0; i < len; i++) { + out[i] = _interpolateNumber(p0[i], p1[i], percent); + } + } + else { + var len2 = p0[0].length; + for (var i = 0; i < len; i++) { + for (var j = 0; j < len2; j++) { + out[i][j] = _interpolateNumber( + p0[i][j], p1[i][j], percent + ); + } + } + } + } + + function _isArrayLike(data) { + switch (typeof data) { + case 'undefined': + case 'string': + return false; + } + + return typeof data.length !== 'undefined'; + } + + function _catmullRomInterpolateArray( + p0, p1, p2, p3, t, t2, t3, out, arrDim + ) { + var len = p0.length; + if (arrDim == 1) { + for (var i = 0; i < len; i++) { + out[i] = _catmullRomInterpolate( + p0[i], p1[i], p2[i], p3[i], t, t2, t3 + ); + } + } + else { + var len2 = p0[0].length; + for (var i = 0; i < len; i++) { + for (var j = 0; j < len2; j++) { + out[i][j] = _catmullRomInterpolate( + p0[i][j], p1[i][j], p2[i][j], p3[i][j], + t, t2, t3 + ); + } + } + } + } + + function _catmullRomInterpolate(p0, p1, p2, p3, t, t2, t3) { + var v0 = (p2 - p0) * 0.5; + var v1 = (p3 - p1) * 0.5; + return (2 * (p1 - p2) + v0 + v1) * t3 + + (-3 * (p1 - p2) - 2 * v0 - v1) * t2 + + v0 * t + p1; + } + + function _cloneValue(value) { + if (_isArrayLike(value)) { + var len = value.length; + if (_isArrayLike(value[0])) { + var ret = []; + for (var i = 0; i < len; i++) { + ret.push(arraySlice.call(value[i])); + } + return ret; + } + else { + return arraySlice.call(value); + } + } + else { + return value; + } + } + + function rgba2String(rgba) { + rgba[0] = Math.floor(rgba[0]); + rgba[1] = Math.floor(rgba[1]); + rgba[2] = Math.floor(rgba[2]); + + return 'rgba(' + rgba.join(',') + ')'; + } + + /** + * @alias module:zrender/animation/Animation~Animator + * @constructor + * @param {Object} target + * @param {boolean} loop + * @param {Function} getter + * @param {Function} setter + */ + var Animator = function(target, loop, getter, setter) { + this._tracks = {}; + this._target = target; + + this._loop = loop || false; + + this._getter = getter || _defaultGetter; + this._setter = setter || _defaultSetter; + + this._clipCount = 0; + + this._delay = 0; + + this._doneList = []; + + this._onframeList = []; + + this._clipList = []; + }; + + Animator.prototype = { + /** + * 设置动画关键帧 + * @param {number} time 关键帧时间,单位是ms + * @param {Object} props 关键帧的属性值,key-value表示 + * @return {module:zrender/animation/Animation~Animator} + */ + when : function(time /* ms */, props) { + for (var propName in props) { + if (!this._tracks[propName]) { + this._tracks[propName] = []; + // If time is 0 + // Then props is given initialize value + // Else + // Initialize value from current prop value + if (time !== 0) { + this._tracks[propName].push({ + time : 0, + value : _cloneValue( + this._getter(this._target, propName) + ) + }); + } + } + this._tracks[propName].push({ + time : parseInt(time, 10), + value : props[propName] + }); + } + return this; + }, + /** + * 添加动画每一帧的回调函数 + * @param {Function} callback + * @return {module:zrender/animation/Animation~Animator} + */ + during: function (callback) { + this._onframeList.push(callback); + return this; + }, + /** + * 开始执行动画 + * @param {string|Function} easing + * 动画缓动函数,详见{@link module:zrender/animation/easing} + * @return {module:zrender/animation/Animation~Animator} + */ + start: function (easing) { + + var self = this; + var setter = this._setter; + var getter = this._getter; + var onFrameListLen = self._onframeList.length; + var useSpline = easing === 'spline'; + + var ondestroy = function() { + self._clipCount--; + if (self._clipCount === 0) { + // Clear all tracks + self._tracks = {}; + + var len = self._doneList.length; + for (var i = 0; i < len; i++) { + self._doneList[i].call(self); + } + } + }; + + var createTrackClip = function (keyframes, propName) { + var trackLen = keyframes.length; + if (!trackLen) { + return; + } + // Guess data type + var firstVal = keyframes[0].value; + var isValueArray = _isArrayLike(firstVal); + var isValueColor = false; + + // For vertices morphing + var arrDim = ( + isValueArray + && _isArrayLike(firstVal[0]) + ) + ? 2 : 1; + // Sort keyframe as ascending + keyframes.sort(function(a, b) { + return a.time - b.time; + }); + var trackMaxTime; + if (trackLen) { + trackMaxTime = keyframes[trackLen - 1].time; + } + else { + return; + } + // Percents of each keyframe + var kfPercents = []; + // Value of each keyframe + var kfValues = []; + for (var i = 0; i < trackLen; i++) { + kfPercents.push(keyframes[i].time / trackMaxTime); + // Assume value is a color when it is a string + var value = keyframes[i].value; + if (typeof(value) == 'string') { + value = color.toArray(value); + if (value.length === 0) { // Invalid color + value[0] = value[1] = value[2] = 0; + value[3] = 1; + } + isValueColor = true; + } + kfValues.push(value); + } + + // Cache the key of last frame to speed up when + // animation playback is sequency + var cacheKey = 0; + var cachePercent = 0; + var start; + var i; + var w; + var p0; + var p1; + var p2; + var p3; + + + if (isValueColor) { + var rgba = [ 0, 0, 0, 0 ]; + } + + var onframe = function (target, percent) { + // Find the range keyframes + // kf1-----kf2---------current--------kf3 + // find kf2 and kf3 and do interpolation + if (percent < cachePercent) { + // Start from next key + start = Math.min(cacheKey + 1, trackLen - 1); + for (i = start; i >= 0; i--) { + if (kfPercents[i] <= percent) { + break; + } + } + i = Math.min(i, trackLen - 2); + } + else { + for (i = cacheKey; i < trackLen; i++) { + if (kfPercents[i] > percent) { + break; + } + } + i = Math.min(i - 1, trackLen - 2); + } + cacheKey = i; + cachePercent = percent; + + var range = (kfPercents[i + 1] - kfPercents[i]); + if (range === 0) { + return; + } + else { + w = (percent - kfPercents[i]) / range; + } + if (useSpline) { + p1 = kfValues[i]; + p0 = kfValues[i === 0 ? i : i - 1]; + p2 = kfValues[i > trackLen - 2 ? trackLen - 1 : i + 1]; + p3 = kfValues[i > trackLen - 3 ? trackLen - 1 : i + 2]; + if (isValueArray) { + _catmullRomInterpolateArray( + p0, p1, p2, p3, w, w * w, w * w * w, + getter(target, propName), + arrDim + ); + } + else { + var value; + if (isValueColor) { + value = _catmullRomInterpolateArray( + p0, p1, p2, p3, w, w * w, w * w * w, + rgba, 1 + ); + value = rgba2String(rgba); + } + else { + value = _catmullRomInterpolate( + p0, p1, p2, p3, w, w * w, w * w * w + ); + } + setter( + target, + propName, + value + ); + } + } + else { + if (isValueArray) { + _interpolateArray( + kfValues[i], kfValues[i + 1], w, + getter(target, propName), + arrDim + ); + } + else { + var value; + if (isValueColor) { + _interpolateArray( + kfValues[i], kfValues[i + 1], w, + rgba, 1 + ); + value = rgba2String(rgba); + } + else { + value = _interpolateNumber(kfValues[i], kfValues[i + 1], w); + } + setter( + target, + propName, + value + ); + } + } + + for (i = 0; i < onFrameListLen; i++) { + self._onframeList[i](target, percent); + } + }; + + var clip = new Clip({ + target : self._target, + life : trackMaxTime, + loop : self._loop, + delay : self._delay, + onframe : onframe, + ondestroy : ondestroy + }); + + if (easing && easing !== 'spline') { + clip.easing = easing; + } + self._clipList.push(clip); + self._clipCount++; + self.animation.add(clip); + }; + + for (var propName in this._tracks) { + createTrackClip(this._tracks[propName], propName); + } + return this; + }, + /** + * 停止动画 + */ + stop : function() { + for (var i = 0; i < this._clipList.length; i++) { + var clip = this._clipList[i]; + this.animation.remove(clip); + } + this._clipList = []; + }, + /** + * 设置动画延迟开始的时间 + * @param {number} time 单位ms + * @return {module:zrender/animation/Animation~Animator} + */ + delay : function (time) { + this._delay = time; + return this; + }, + /** + * 添加动画结束的回调 + * @param {Function} cb + * @return {module:zrender/animation/Animation~Animator} + */ + done : function(cb) { + this._doneList.push(cb); + return this; + } + }; + + return Animation; + } +); + +/*! + * ZRender, a high performance canvas library. + * + * Copyright (c) 2013, Baidu Inc. + * All rights reserved. + * + * LICENSE + * https://github.com/ecomfe/zrender/blob/master/LICENSE.txt + */ +define( + 'zrender/zrender',['require','./dep/excanvas','./tool/util','./tool/log','./tool/guid','./Handler','./Painter','./Storage','./animation/Animation','./tool/env'],function(require) { + /* + * HTML5 Canvas for Internet Explorer! + * Modern browsers like Firefox, Safari, Chrome and Opera support + * the HTML5 canvas tag to allow 2D command-based drawing. + * ExplorerCanvas brings the same functionality to Internet Explorer. + * To use, web developers only need to include a single script tag + * in their existing web pages. + * + * https://code.google.com/p/explorercanvas/ + * http://explorercanvas.googlecode.com/svn/trunk/excanvas.js + */ + // 核心代码会生成一个全局变量 G_vmlCanvasManager,模块改造后借用于快速判断canvas支持 + require('./dep/excanvas'); + + var util = require('./tool/util'); + var log = require('./tool/log'); + var guid = require('./tool/guid'); + + var Handler = require('./Handler'); + var Painter = require('./Painter'); + var Storage = require('./Storage'); + var Animation = require('./animation/Animation'); + + var _instances = {}; // ZRender实例map索引 + + /** + * @exports zrender + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * pissang (https://www.github.com/pissang) + */ + var zrender = {}; + /** + * @type {string} + */ + zrender.version = '2.0.4'; + + /** + * 创建zrender实例 + * + * @param {HTMLElement} dom 绘图容器 + * @return {module:zrender~ZRender} ZRender实例 + */ + // 不让外部直接new ZRender实例,为啥? + // 不为啥,提供全局可控同时减少全局污染和降低命名冲突的风险! + zrender.init = function(dom) { + var zr = new ZRender(guid(), dom); + _instances[zr.id] = zr; + return zr; + }; + + /** + * zrender实例销毁 + * @param {module:zrender~ZRender} zr ZRender对象,不传则销毁全部 + */ + // 在_instances里的索引也会删除了 + // 管生就得管死,可以通过zrender.dispose(zr)销毁指定ZRender实例 + // 当然也可以直接zr.dispose()自己销毁 + zrender.dispose = function (zr) { + if (zr) { + zr.dispose(); + } + else { + for (var key in _instances) { + _instances[key].dispose(); + } + _instances = {}; + } + + return zrender; + }; + + /** + * 获取zrender实例 + * @param {string} id ZRender对象索引 + * @return {module:zrender~ZRender} + */ + zrender.getInstance = function (id) { + return _instances[id]; + }; + + /** + * 删除zrender实例,ZRender实例dispose时会调用, + * 删除后getInstance则返回undefined + * ps: 仅是删除,删除的实例不代表已经dispose了~~ + * 这是一个摆脱全局zrender.dispose()自动销毁的后门, + * take care of yourself~ + * + * @param {string} id ZRender对象索引 + */ + zrender.delInstance = function (id) { + delete _instances[id]; + return zrender; + }; + + function getFrameCallback(zrInstance) { + return function () { + var animatingElements = zrInstance.animatingElements; + for (var i = 0, l = animatingElements.length; i < l; i++) { + zrInstance.storage.mod(animatingElements[i].id); + } + + if (animatingElements.length || zrInstance._needsRefreshNextFrame) { + zrInstance.refresh(); + } + }; + } + + /** + * ZRender接口类,对外可用的所有接口都在这里 + * 非get接口统一返回支持链式调用 + * + * @constructor + * @alias module:zrender~ZRender + * @param {string} id 唯一标识 + * @param {HTMLElement} dom dom对象,不帮你做document.getElementById + * @return {ZRender} ZRender实例 + */ + var ZRender = function(id, dom) { + /** + * 实例 id + * @type {string} + */ + this.id = id; + this.env = require('./tool/env'); + + this.storage = new Storage(); + this.painter = new Painter(dom, this.storage); + this.handler = new Handler(dom, this.storage, this.painter); + + // 动画控制 + this.animatingElements = []; + /** + * @type {module:zrender/animation/Animation} + */ + this.animation = new Animation({ + stage: { + update: getFrameCallback(this) + } + }); + this.animation.start(); + + this._needsRefreshNextFrame = false; + }; + + /** + * 获取实例唯一标识 + * @return {string} + */ + ZRender.prototype.getId = function () { + return this.id; + }; + + /** + * 添加图形形状到根节点 + * + * @param {module:zrender/shape/Base} shape 形状对象,可用属性全集,详见各shape + */ + ZRender.prototype.addShape = function (shape) { + this.storage.addRoot(shape); + return this; + }; + + /** + * 添加组到根节点 + * + * @param {module:zrender/Group} group + */ + ZRender.prototype.addGroup = function(group) { + this.storage.addRoot(group); + return this; + }; + + /** + * 从根节点删除图形形状 + * + * @param {string} shapeId 形状对象唯一标识 + */ + ZRender.prototype.delShape = function (shapeId) { + this.storage.delRoot(shapeId); + return this; + }; + + /** + * 从根节点删除组 + * + * @param {string} groupId + */ + ZRender.prototype.delGroup = function (groupId) { + this.storage.delRoot(groupId); + return this; + }; + + /** + * 修改图形形状 + * + * @param {string} shapeId 形状对象唯一标识 + * @param {Object} shape 形状对象 + */ + ZRender.prototype.modShape = function (shapeId, shape) { + this.storage.mod(shapeId, shape); + return this; + }; + + /** + * 修改组 + * + * @param {string} groupId + * @param {Object} group + */ + ZRender.prototype.modGroup = function (groupId, group) { + this.storage.mod(groupId, group); + return this; + }; + + /** + * 修改指定zlevel的绘制配置项 + * + * @param {string} zLevel + * @param {Object} config 配置对象 + * @param {string} [config.clearColor=0] 每次清空画布的颜色 + * @param {string} [config.motionBlur=false] 是否开启动态模糊 + * @param {number} [config.lastFrameAlpha=0.7] + * 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显 + * @param {Array.} [config.position] 层的平移 + * @param {Array.} [config.rotation] 层的旋转 + * @param {Array.} [config.scale] 层的缩放 + * @param {boolean} [config.zoomable=false] 层是否支持鼠标缩放操作 + * @param {boolean} [config.panable=false] 层是否支持鼠标平移操作 + */ + ZRender.prototype.modLayer = function (zLevel, config) { + this.painter.modLayer(zLevel, config); + return this; + }; + + /** + * 添加额外高亮层显示,仅提供添加方法,每次刷新后高亮层图形均被清空 + * + * @param {Object} shape 形状对象 + */ + ZRender.prototype.addHoverShape = function (shape) { + this.storage.addHover(shape); + return this; + }; + + /** + * 渲染 + * + * @param {Function} callback 渲染结束后回调函数 + */ + ZRender.prototype.render = function (callback) { + this.painter.render(callback); + this._needsRefreshNextFrame = false; + return this; + }; + + /** + * 视图更新 + * + * @param {Function} callback 视图更新后回调函数 + */ + ZRender.prototype.refresh = function (callback) { + this.painter.refresh(callback); + this._needsRefreshNextFrame = false; + return this; + }; + + /** + * 标记视图在浏览器下一帧需要绘制 + */ + ZRender.prototype.refreshNextFrame = function() { + this._needsRefreshNextFrame = true; + return this; + }; + + /** + * 绘制高亮层 + * @param {Function} callback 视图更新后回调函数 + */ + ZRender.prototype.refreshHover = function (callback) { + this.painter.refreshHover(callback); + return this; + }; + + /** + * 视图更新 + * + * @param {Array.} shapeList 需要更新的图形列表 + * @param {Function} callback 视图更新后回调函数 + */ + ZRender.prototype.refreshShapes = function (shapeList, callback) { + this.painter.refreshShapes(shapeList, callback); + return this; + }; + + /** + * 调整视图大小 + */ + ZRender.prototype.resize = function() { + this.painter.resize(); + return this; + }; + + /** + * 动画 + * + * @param {string|module:zrender/Group|module:zrender/shape/Base} el 动画对象 + * @param {string} path 需要添加动画的属性获取路径,可以通过a.b.c来获取深层的属性 + * @param {boolean} [loop] 动画是否循环 + * @return {module:zrender/animation/Animation~Animator} + * @example: + * zr.animate(circle.id, 'style', false) + * .when(1000, {x: 10} ) + * .done(function(){ // Animation done }) + * .start() + */ + ZRender.prototype.animate = function (el, path, loop) { + if (typeof(el) === 'string') { + el = this.storage.get(el); + } + if (el) { + var target; + if (path) { + var pathSplitted = path.split('.'); + var prop = el; + for (var i = 0, l = pathSplitted.length; i < l; i++) { + if (!prop) { + continue; + } + prop = prop[pathSplitted[i]]; + } + if (prop) { + target = prop; + } + } + else { + target = el; + } + + if (!target) { + log( + 'Property "' + + path + + '" is not existed in element ' + + el.id + ); + return; + } + + var animatingElements = this.animatingElements; + if (typeof el.__aniCount === 'undefined') { + // 正在进行的动画记数 + el.__aniCount = 0; + } + if (el.__aniCount === 0) { + animatingElements.push(el); + } + el.__aniCount++; + + return this.animation.animate(target, { loop: loop }) + .done(function () { + el.__aniCount--; + if (el.__aniCount === 0) { + // 从animatingElements里移除 + var idx = util.indexOf(animatingElements, el); + animatingElements.splice(idx, 1); + } + }); + } + else { + log('Element not existed'); + } + }; + + /** + * 停止所有动画 + */ + ZRender.prototype.clearAnimation = function () { + this.animation.clear(); + }; + + /** + * loading显示 + * + * @param {Object=} loadingEffect loading效果对象 + */ + ZRender.prototype.showLoading = function (loadingEffect) { + this.painter.showLoading(loadingEffect); + return this; + }; + + /** + * loading结束 + */ + ZRender.prototype.hideLoading = function () { + this.painter.hideLoading(); + return this; + }; + + /** + * 获取视图宽度 + */ + ZRender.prototype.getWidth = function() { + return this.painter.getWidth(); + }; + + /** + * 获取视图高度 + */ + ZRender.prototype.getHeight = function() { + return this.painter.getHeight(); + }; + + /** + * 图像导出 + * @param {string} type + * @param {string} [backgroundColor='#fff'] 背景色 + * @return {string} 图片的Base64 url + */ + ZRender.prototype.toDataURL = function(type, backgroundColor, args) { + return this.painter.toDataURL(type, backgroundColor, args); + }; + + /** + * 将常规shape转成image shape + * @param {module:zrender/shape/Base} e + * @param {number} width + * @param {number} height + */ + ZRender.prototype.shapeToImage = function(e, width, height) { + var id = guid(); + return this.painter.shapeToImage(id, e, width, height); + }; + + /** + * 事件绑定 + * + * @param {string} eventName 事件名称 + * @param {Function} eventHandler 响应函数 + */ + ZRender.prototype.on = function(eventName, eventHandler) { + this.handler.on(eventName, eventHandler); + return this; + }; + + /** + * 事件解绑定,参数为空则解绑所有自定义事件 + * + * @param {string} eventName 事件名称 + * @param {Function} eventHandler 响应函数 + */ + ZRender.prototype.un = function(eventName, eventHandler) { + this.handler.un(eventName, eventHandler); + return this; + }; + + /** + * 事件触发 + * + * @param {string} eventName 事件名称,resize,hover,drag,etc + * @param {event=} event event dom事件对象 + */ + ZRender.prototype.trigger = function (eventName, event) { + this.handler.trigger(eventName, event); + return this; + }; + + + /** + * 清除当前ZRender下所有类图的数据和显示,clear后MVC和已绑定事件均还存在在,ZRender可用 + */ + ZRender.prototype.clear = function () { + this.storage.delRoot(); + this.painter.clear(); + return this; + }; + + /** + * 释放当前ZR实例(删除包括dom,数据、显示和事件绑定),dispose后ZR不可用 + */ + ZRender.prototype.dispose = function () { + this.animation.stop(); + + this.clear(); + this.storage.dispose(); + this.painter.dispose(); + this.handler.dispose(); + + this.animation = + this.animatingElements = + this.storage = + this.painter = + this.handler = null; + + // 释放后告诉全局删除对自己的索引,没想到啥好方法 + zrender.delInstance(this.id); + }; + + return zrender; + } +); - if (maxDataLength === 0 || locationMap.length === 0) { - return; - } - - switch (position) { - case 'bottom' : - case 'top' : - this._buildHorizontal(maxDataLength, locationMap, seriesArray, xMarkMap); - break; - case 'left' : - case 'right' : - this._buildVertical(maxDataLength, locationMap, seriesArray, xMarkMap); - break; - } - }, - - /** - * 数据整形 - * 数组位置映射到系列索引 - */ - _mapData : function (seriesArray) { - var series = this.series; - var serie; // 临时映射变量 - var dataIndex = 0; // 堆积数据所在位置映射 - var stackMap = {}; // 堆积数据位置映射,堆积组在二维中的第几项 - var magicStackKey = '__kener__stack__'; // 堆积命名,非堆积数据安单一堆积处理 - var stackKey; // 临时映射变量 - var serieName; // 临时映射变量 - var legend = this.component.legend; - var locationMap = []; // 需要返回的东西:数组位置映射到系列索引 - var maxDataLength = 0; // 需要返回的东西:最大数据长度 - var iconShape; - // 计算需要显示的个数和分配位置并记在下面这个结构里 - for (var i = 0, l = seriesArray.length; i < l; i++) { - serie = series[seriesArray[i]]; - serieName = serie.name; - if (legend){ - this.selectedMap[serieName] = legend.isSelected(serieName); - this._sIndex2colorMap[seriesArray[i]] = - legend.getColor(serieName); - - iconShape = legend.getItemShape(serieName); - if (iconShape) { - // 回调legend,换一个更形象的icon - if (serie.itemStyle.normal.borderWidth > 0) { - iconShape.style.x += 1; - iconShape.style.y += 1; - iconShape.style.width -= 2; - iconShape.style.height -= 2; - iconShape.style.strokeColor = - iconShape.highlightStyle.strokeColor = - serie.itemStyle.normal.borderColor; - iconShape.highlightStyle.lineWidth = 3; - iconShape.style.brushType = 'both'; - } - legend.setItemShape(serieName, iconShape); - } - } else { - this.selectedMap[serieName] = true; - this._sIndex2colorMap[seriesArray[i]] = - this.zr.getColor(seriesArray[i]); - } - - if (this.selectedMap[serieName]) { - stackKey = serie.stack || (magicStackKey + seriesArray[i]); - if (typeof stackMap[stackKey] == 'undefined') { - stackMap[stackKey] = dataIndex; - locationMap[dataIndex] = [seriesArray[i]]; - dataIndex++; - } - else { - // 已经分配了位置就推进去就行 - locationMap[stackMap[stackKey]].push(seriesArray[i]); - } - } - // 兼职帮算一下最大长度 - maxDataLength = Math.max(maxDataLength, serie.data.length); - } - - /* 调试输出 - var s = ''; - for (var i = 0, l = maxDataLength; i < l; i++) { - s = '['; - for (var j = 0, k = locationMap.length; j < k; j++) { - s +='[' - for (var m = 0, n = locationMap[j].length - 1; m < n; m++) { - s += series[locationMap[j][m]].data[i] + ',' - } - s += series[locationMap[j][locationMap[j].length - 1]] - .data[i]; - s += ']' - } - s += ']'; - console.log(s); - } - console.log(locationMap) - */ - - return { - locationMap : locationMap, - maxDataLength : maxDataLength - }; - }, - - /** - * 构建类目轴为水平方向的柱形图系列 - */ - _buildHorizontal : function (maxDataLength, locationMap, seriesArray, xMarkMap) { - var series = this.series; - // 确定类目轴和数值轴,同一方向随便找一个即可 - var seriesIndex = locationMap[0][0]; - var serie = series[seriesIndex]; - var xAxisIndex = serie.xAxisIndex; - var categoryAxis = this.component.xAxis.getAxis(xAxisIndex); - var yAxisIndex; // 数值轴各异 - var valueAxis; // 数值轴各异 - - var size = this._mapSize(categoryAxis, locationMap); - var gap = size.gap; - var barGap = size.barGap; - var barWidthMap = size.barWidthMap; - var barWidth = size.barWidth; // 自适应宽度 - var barMinHeightMap = size.barMinHeightMap; - var barHeight; - var interval = size.interval; - - var x; - var y; - var lastYP; // 正向堆积处理 - var baseYP; - var lastYN; // 负向堆积处理 - var baseYN; - var barShape; - var data; - var value; - for (var i = 0, l = maxDataLength; i < l; i++) { - if (typeof categoryAxis.getNameByIndex(i) == 'undefined') { - // 系列数据超出类目轴长度 - break; - } - x = categoryAxis.getCoordByIndex(i) - gap / 2; - for (var j = 0, k = locationMap.length; j < k; j++) { - // 堆积数据用第一条valueAxis - yAxisIndex = series[locationMap[j][0]].yAxisIndex || 0; - valueAxis = this.component.yAxis.getAxis(yAxisIndex); - baseYP = lastYP = baseYN = lastYN = valueAxis.getCoord(0); - for (var m = 0, n = locationMap[j].length; m < n; m++) { - seriesIndex = locationMap[j][m]; - serie = series[seriesIndex]; - data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; - xMarkMap[seriesIndex] = xMarkMap[seriesIndex] - || { - min : Number.POSITIVE_INFINITY, - max : Number.NEGATIVE_INFINITY, - sum : 0, - counter : 0, - average : 0 - }; - if (value == '-') { - // 空数据在做完后补充拖拽提示框 - continue; - } - //y = valueAxis.getCoord(value); - if (value > 0) { - // 正向堆积 - //barHeight = baseYP - y; - barHeight = m > 0 - ? valueAxis.getCoordSize(value) - : (baseYP - valueAxis.getCoord(value)); - // 非堆积数据最小高度有效 - if (n == 1 - && barMinHeightMap[seriesIndex] > barHeight - ) { - barHeight = barMinHeightMap[seriesIndex]; - } - lastYP -= barHeight; - y = lastYP; - } - else if (value < 0){ - // 负向堆积 - //barHeight = y - baseYN; - barHeight = m > 0 - ? valueAxis.getCoordSize(value) - : (valueAxis.getCoord(value) - baseYN); - // 非堆积数据最小高度有效 - if (n == 1 - && barMinHeightMap[seriesIndex] > barHeight - ) { - barHeight = barMinHeightMap[seriesIndex]; - } - y = lastYN; - lastYN += barHeight; - } - else { - // 0值 - barHeight = 0;//baseYP - y; - // 最小高度无效 - lastYP -= barHeight; - y = lastYP; - } - xMarkMap[seriesIndex][i] = - x + (barWidthMap[seriesIndex] || barWidth) / 2; - if (xMarkMap[seriesIndex].min > value) { - xMarkMap[seriesIndex].min = value; - xMarkMap[seriesIndex].minY = y; - xMarkMap[seriesIndex].minX = xMarkMap[seriesIndex][i]; - } - if (xMarkMap[seriesIndex].max < value) { - xMarkMap[seriesIndex].max = value; - xMarkMap[seriesIndex].maxY = y; - xMarkMap[seriesIndex].maxX = xMarkMap[seriesIndex][i]; - } - xMarkMap[seriesIndex].sum += value; - xMarkMap[seriesIndex].counter++; - - if (i % interval === 0) { - barShape = this._getBarItem( - seriesIndex, i, - categoryAxis.getNameByIndex(i), - x, y, - barWidthMap[seriesIndex] || barWidth, - barHeight, - 'vertical' - ); - this.shapeList.push(new RectangleShape(barShape)); - } - } - - // 补充空数据的拖拽提示框 - for (var m = 0, n = locationMap[j].length; m < n; m++) { - seriesIndex = locationMap[j][m]; - serie = series[seriesIndex]; - data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; - if (value != '-') { - // 只关心空数据 - continue; - } - - if (this.deepQuery( - [data, serie, this.option], 'calculable' - ) - ) { - lastYP -= this.ecTheme.island.r; - y = lastYP; - - barShape = this._getBarItem( - seriesIndex, i, - categoryAxis.getNameByIndex(i), - x + 0.5, y + 0.5, - (barWidthMap[seriesIndex] || barWidth) - 1, - this.ecTheme.island.r - 1, - 'vertical' - ); - barShape.hoverable = false; - barShape.draggable = false; - barShape.style.lineWidth = 1; - barShape.style.brushType = 'stroke'; - barShape.style.strokeColor = - serie.calculableHolderColor - || this.ecTheme.calculableHolderColor; - - this.shapeList.push(new RectangleShape(barShape)); - } - } - - x += ((barWidthMap[seriesIndex] || barWidth) + barGap); - } - } - - for (var j = 0, k = locationMap.length; j < k; j++) { - for (var m = 0, n = locationMap[j].length; m < n; m++) { - seriesIndex = locationMap[j][m]; - if (xMarkMap[seriesIndex].counter > 0) { - xMarkMap[seriesIndex].average = - (xMarkMap[seriesIndex].sum / xMarkMap[seriesIndex].counter).toFixed(2) - - 0; - } - - y = this.component.yAxis.getAxis(series[seriesIndex].yAxisIndex || 0) - .getCoord(xMarkMap[seriesIndex].average); - - xMarkMap[seriesIndex].averageLine = [ - [this.component.grid.getX(), y], - [this.component.grid.getXend(), y] - ]; - xMarkMap[seriesIndex].minLine = [ - [this.component.grid.getX(), xMarkMap[seriesIndex].minY], - [this.component.grid.getXend(), xMarkMap[seriesIndex].minY] - ]; - xMarkMap[seriesIndex].maxLine = [ - [this.component.grid.getX(), xMarkMap[seriesIndex].maxY], - [this.component.grid.getXend(), xMarkMap[seriesIndex].maxY] - ]; - - xMarkMap[seriesIndex].isHorizontal = true; - this.buildMark(seriesIndex); - } - } - }, - - /** - * 构建类目轴为垂直方向的柱形图系列 - */ - _buildVertical : function (maxDataLength, locationMap, seriesArray, xMarkMap) { - var series = this.series; - // 确定类目轴和数值轴,同一方向随便找一个即可 - var seriesIndex = locationMap[0][0]; - var serie = series[seriesIndex]; - var yAxisIndex = serie.yAxisIndex; - var categoryAxis = this.component.yAxis.getAxis(yAxisIndex); - var xAxisIndex; // 数值轴各异 - var valueAxis; // 数值轴各异 - - var size = this._mapSize(categoryAxis, locationMap); - var gap = size.gap; - var barGap = size.barGap; - var barWidthMap = size.barWidthMap; - var barWidth = size.barWidth; // 自适应宽度 - var barMinHeightMap = size.barMinHeightMap; - var barHeight; - var interval = size.interval; - - var x; - var y; - var lastXP; // 正向堆积处理 - var baseXP; - var lastXN; // 负向堆积处理 - var baseXN; - var barShape; - var data; - var value; - for (var i = 0, l = maxDataLength; i < l; i++) { - if (typeof categoryAxis.getNameByIndex(i) == 'undefined') { - // 系列数据超出类目轴长度 - break; - } - y = categoryAxis.getCoordByIndex(i) + gap / 2; - for (var j = 0, k = locationMap.length; j < k; j++) { - // 堆积数据用第一条valueAxis - xAxisIndex = series[locationMap[j][0]].xAxisIndex || 0; - valueAxis = this.component.xAxis.getAxis(xAxisIndex); - baseXP = lastXP = baseXN = lastXN = valueAxis.getCoord(0); - for (var m = 0, n = locationMap[j].length; m < n; m++) { - seriesIndex = locationMap[j][m]; - serie = series[seriesIndex]; - data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; - xMarkMap[seriesIndex] = xMarkMap[seriesIndex] - || { - min : Number.POSITIVE_INFINITY, - max : Number.NEGATIVE_INFINITY, - sum : 0, - counter : 0, - average : 0 - }; - if (value == '-') { - // 空数据在做完后补充拖拽提示框 - continue; - } - //x = valueAxis.getCoord(value); - if (value > 0) { - // 正向堆积 - //barHeight = x - baseXP; - barHeight = m > 0 - ? valueAxis.getCoordSize(value) - : (valueAxis.getCoord(value) - baseXP); - // 非堆积数据最小高度有效 - if (n == 1 - && barMinHeightMap[seriesIndex] > barHeight - ) { - barHeight = barMinHeightMap[seriesIndex]; - } - x = lastXP; - lastXP += barHeight; - } - else if (value < 0){ - // 负向堆积 - //barHeight = baseXN - x; - barHeight = m > 0 - ? valueAxis.getCoordSize(value) - : (baseXN - valueAxis.getCoord(value)); - // 非堆积数据最小高度有效 - if (n == 1 - && barMinHeightMap[seriesIndex] > barHeight - ) { - barHeight = barMinHeightMap[seriesIndex]; - } - lastXN -= barHeight; - x = lastXN; - } - else { - // 0值 - barHeight = 0;//x - baseXP; - // 最小高度无效 - x = lastXP; - lastXP += barHeight; - } - - xMarkMap[seriesIndex][i] = - y - (barWidthMap[seriesIndex] || barWidth) / 2; - if (xMarkMap[seriesIndex].min > value) { - xMarkMap[seriesIndex].min = value; - xMarkMap[seriesIndex].minX = x + barHeight; - xMarkMap[seriesIndex].minY = xMarkMap[seriesIndex][i]; - } - if (xMarkMap[seriesIndex].max < value) { - xMarkMap[seriesIndex].max = value; - xMarkMap[seriesIndex].maxX = x + barHeight; - xMarkMap[seriesIndex].maxY = xMarkMap[seriesIndex][i]; - } - xMarkMap[seriesIndex].sum += value; - xMarkMap[seriesIndex].counter++; - - if (i % interval === 0) { - barShape = this._getBarItem( - seriesIndex, i, - categoryAxis.getNameByIndex(i), - x, y - (barWidthMap[seriesIndex] || barWidth), - barHeight, - barWidthMap[seriesIndex] || barWidth, - 'horizontal' - ); - this.shapeList.push(new RectangleShape(barShape)); - } - } - - // 补充空数据的拖拽提示框 - for (var m = 0, n = locationMap[j].length; m < n; m++) { - seriesIndex = locationMap[j][m]; - serie = series[seriesIndex]; - data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' - ? data.value - : data) - : '-'; - if (value != '-') { - // 只关心空数据 - continue; - } - - if (this.deepQuery( - [data, serie, this.option], 'calculable' - ) - ) { - x = lastXP; - lastXP += this.ecTheme.island.r; - - barShape = this._getBarItem( - seriesIndex, - i, - categoryAxis.getNameByIndex(i), - x + 0.5, y + 0.5 - (barWidthMap[seriesIndex] || barWidth), - this.ecTheme.island.r - 1, - (barWidthMap[seriesIndex] || barWidth) - 1, - 'horizontal' - ); - barShape.hoverable = false; - barShape.draggable = false; - barShape.style.lineWidth = 1; - barShape.style.brushType = 'stroke'; - barShape.style.strokeColor = - serie.calculableHolderColor - || this.ecTheme.calculableHolderColor; - - this.shapeList.push(new RectangleShape(barShape)); - } - } - - y -= ((barWidthMap[seriesIndex] || barWidth) + barGap); - } - } - - for (var j = 0, k = locationMap.length; j < k; j++) { - for (var m = 0, n = locationMap[j].length; m < n; m++) { - seriesIndex = locationMap[j][m]; - if (xMarkMap[seriesIndex].counter > 0) { - xMarkMap[seriesIndex].average = - (xMarkMap[seriesIndex].sum / xMarkMap[seriesIndex].counter).toFixed(2) - - 0; - } - - x = this.component.xAxis.getAxis(series[seriesIndex].xAxisIndex || 0) - .getCoord(xMarkMap[seriesIndex].average); - - xMarkMap[seriesIndex].averageLine = [ - [x, this.component.grid.getYend()], - [x, this.component.grid.getY()] - ]; - xMarkMap[seriesIndex].minLine = [ - [xMarkMap[seriesIndex].minX, this.component.grid.getYend()], - [xMarkMap[seriesIndex].minX, this.component.grid.getY()] - ]; - xMarkMap[seriesIndex].maxLine = [ - [xMarkMap[seriesIndex].maxX, this.component.grid.getYend()], - [xMarkMap[seriesIndex].maxX, this.component.grid.getY()] - ]; - - xMarkMap[seriesIndex].isHorizontal = false; - this.buildMark(seriesIndex); - } - } - }, - - /** - * 我真是自找麻烦啊,为啥要允许系列级个性化最小宽度和高度啊!!! - * @param {CategoryAxis} categoryAxis 类目坐标轴,需要知道类目间隔大小 - * @param {Array} locationMap 整形数据的系列索引 - */ - _mapSize : function (categoryAxis, locationMap, ignoreUserDefined) { - var series = this.series; - var seriesIndex; - var barWidthMap = {}; - var barMinHeightMap = {}; - var sBarWidth; - var sBarWidthCounter = 0; - var sBarWidthTotal = 0; - var barGap; - var barCategoryGap; - var hasFound; - var queryTarget; - var interval = 1; - - for (var j = 0, k = locationMap.length; j < k; j++) { - hasFound = false; // 同一堆积第一个barWidth生效 - for (var m = 0, n = locationMap[j].length; m < n; m++) { - seriesIndex = locationMap[j][m]; - queryTarget = series[seriesIndex]; - if (!ignoreUserDefined) { - if (!hasFound) { - sBarWidth = this.query( - queryTarget, - 'barWidth' - ); - if (typeof sBarWidth != 'undefined') { - // 同一堆积第一个生效barWidth - barWidthMap[seriesIndex] = sBarWidth; - sBarWidthTotal += sBarWidth; - sBarWidthCounter++; - hasFound = true; - // 复位前面同一堆积但没被定义的 - for (var ii = 0, ll = m; ii < ll; ii++) { - var pSeriesIndex = locationMap[j][ii]; - barWidthMap[pSeriesIndex] = sBarWidth; - } - } - } else { - barWidthMap[seriesIndex] = sBarWidth; // 用找到的一个 - } - } - - barMinHeightMap[seriesIndex] = this.query( - queryTarget, - 'barMinHeight' - ); - barGap = typeof barGap != 'undefined' - ? barGap - : this.query( - queryTarget, - 'barGap' - ); - barCategoryGap = typeof barCategoryGap != 'undefined' - ? barCategoryGap - : this.query( - queryTarget, - 'barCategoryGap' - ); - } - } - - var gap; - var barWidth; - if (locationMap.length != sBarWidthCounter) { - // 至少存在一个自适应宽度的柱形图 - if (!ignoreUserDefined) { - gap = typeof barCategoryGap == 'string' - && barCategoryGap.match(/%$/) - // 百分比 - ? Math.floor( - categoryAxis.getGap() - * (100 - parseFloat(barCategoryGap)) - / 100 - ) - // 数值 - : (categoryAxis.getGap() - barCategoryGap); - if (typeof barGap == 'string' && barGap.match(/%$/)) { - barGap = parseFloat(barGap) / 100; - barWidth = Math.floor( - (gap - sBarWidthTotal) - / ((locationMap.length - 1) * barGap - + locationMap.length - sBarWidthCounter) - ); - barGap = Math.floor(barWidth * barGap); - } - else { - barGap = parseFloat(barGap); - barWidth = Math.floor( - (gap - sBarWidthTotal - - barGap * (locationMap.length - 1) - ) - / (locationMap.length - sBarWidthCounter) - ); - } - // 无法满足用户定义的宽度设计,忽略用户宽度,打回重做 - if (barWidth <= 0) { - return this._mapSize(categoryAxis, locationMap, true); - } - } - else { - // 忽略用户定义的宽度设定 - gap = categoryAxis.getGap(); - barGap = 0; - barWidth = Math.floor(gap / locationMap.length); - // 已经忽略用户定义的宽度设定依然还无法满足显示,只能硬来了; - if (barWidth <= 0) { - interval = Math.floor(locationMap.length / gap); - barWidth = 1; - } - } - } - else { - // 全是自定义宽度,barGap无效,系列间隔决定barGap - gap = sBarWidthCounter > 1 - ? (typeof barCategoryGap == 'string' - && barCategoryGap.match(/%$/) - ) - // 百分比 - ? Math.floor( - categoryAxis.getGap() - * (100 - parseFloat(barCategoryGap)) - / 100 - ) - // 数值 - : (categoryAxis.getGap() - barCategoryGap) - // 只有一个 - : sBarWidthTotal; - barWidth = 0; - barGap = sBarWidthCounter > 1 - ? Math.floor( - (gap - sBarWidthTotal) / (sBarWidthCounter - 1) - ) - : 0; - if (barGap < 0) { - // 无法满足用户定义的宽度设计,忽略用户宽度,打回重做 - return this._mapSize(categoryAxis, locationMap, true); - } - } - - return { - barWidthMap : barWidthMap, - barMinHeightMap : barMinHeightMap , - gap : gap, - barWidth : barWidth, - barGap : barGap, - interval : interval - }; - }, - - /** - * 生成最终图形数据 - */ - _getBarItem : function (seriesIndex, dataIndex, name, x, y, width, height, orient) { - var series = this.series; - var barShape; - var serie = series[seriesIndex]; - var data = serie.data[dataIndex]; - // 多级控制 - var defaultColor = this._sIndex2colorMap[seriesIndex]; - var queryTarget = [data, serie]; - var normalColor = this.deepQuery( - queryTarget, - 'itemStyle.normal.color' - ) || defaultColor; - var emphasisColor = this.deepQuery( - queryTarget, - 'itemStyle.emphasis.color' - ); - var normal = this.deepMerge( - queryTarget, - 'itemStyle.normal' - ); - var normalBorderWidth = normal.borderWidth; - var emphasis = this.deepMerge( - queryTarget, - 'itemStyle.emphasis' - ); - barShape = { - zlevel : this._zlevelBase, - clickable: true, - style : { - x : x, - y : y, - width : width, - height : height, - brushType : 'both', - color : this.getItemStyleColor(normalColor, seriesIndex, dataIndex, data), - radius : normal.borderRadius, - lineWidth : normalBorderWidth, - strokeColor : normal.borderColor - }, - highlightStyle : { - color : this.getItemStyleColor(emphasisColor, seriesIndex, dataIndex, data), - radius : emphasis.borderRadius, - lineWidth : emphasis.borderWidth, - strokeColor : emphasis.borderColor - }, - _orient : orient - }; - barShape.highlightStyle.color = barShape.highlightStyle.color - || (typeof barShape.style.color == 'string' - ? zrColor.lift(barShape.style.color, -0.3) - : barShape.style.color - ); - // 考虑线宽的显示优化 - if (normalBorderWidth > 0 - && barShape.style.height > normalBorderWidth - && barShape.style.width > normalBorderWidth - ) { - barShape.style.y += normalBorderWidth / 2; - barShape.style.height -= normalBorderWidth; - barShape.style.x += normalBorderWidth / 2; - barShape.style.width -= normalBorderWidth; - } - else { - // 太小了或者线宽小于0,废了边线 - barShape.style.brushType = 'fill'; - } - - barShape.highlightStyle.textColor = barShape.highlightStyle.color; - - barShape = this.addLabel(barShape, serie, data, name, orient); - if (barShape.style.textPosition == 'insideLeft' - || barShape.style.textPosition == 'insideRight' - || barShape.style.textPosition == 'insideTop' - || barShape.style.textPosition == 'insideBottom' - ) { - var gap = 5; - switch (barShape.style.textPosition) { - case 'insideLeft' : - barShape.style.textX = barShape.style.x + gap; - barShape.style.textY = barShape.style.y + barShape.style.height / 2; - barShape.style.textAlign = 'left'; - barShape.style.textBaseline = 'middle'; - break; - case 'insideRight' : - barShape.style.textX = barShape.style.x + barShape.style.width - gap; - barShape.style.textY = barShape.style.y + barShape.style.height / 2; - barShape.style.textAlign = 'right'; - barShape.style.textBaseline = 'middle'; - break; - case 'insideTop' : - barShape.style.textX = barShape.style.x + barShape.style.width / 2; - barShape.style.textY = barShape.style.y + gap / 2; - barShape.style.textAlign = 'center'; - barShape.style.textBaseline = 'top'; - break; - case 'insideBottom' : - barShape.style.textX = barShape.style.x + barShape.style.width / 2; - barShape.style.textY = barShape.style.y + barShape.style.height - gap / 2; - barShape.style.textAlign = 'center'; - barShape.style.textBaseline = 'bottom'; - break; - } - barShape.style.textPosition = 'specific'; - barShape.style.textColor = barShape.style.textColor || '#fff'; - } - - - - if (this.deepQuery([data, serie, this.option],'calculable')) { - this.setCalculable(barShape); - barShape.draggable = true; - } - - ecData.pack( - barShape, - series[seriesIndex], seriesIndex, - series[seriesIndex].data[dataIndex], dataIndex, - name - ); - - return barShape; - }, +define('zrender', ['zrender/zrender'], function (main) { return main; }); - // 位置转换 - getMarkCoord : function (seriesIndex, mpData) { - var serie = this.series[seriesIndex]; - var xMarkMap = this.xMarkMap[seriesIndex]; - var xAxis = this.component.xAxis.getAxis(serie.xAxisIndex); - var yAxis = this.component.yAxis.getAxis(serie.yAxisIndex); - var dataIndex; - var pos; - if (mpData.type - && (mpData.type == 'max' || mpData.type == 'min' || mpData.type == 'average') - ) { - // 特殊值内置支持 - pos = [ - xMarkMap[mpData.type + 'X'], - xMarkMap[mpData.type + 'Y'], - xMarkMap[mpData.type + 'Line'], - xMarkMap[mpData.type] - ]; - } - else if (xMarkMap.isHorizontal) { - // 横向 - dataIndex = typeof mpData.xAxis == 'string' && xAxis.getIndexByName - ? xAxis.getIndexByName(mpData.xAxis) - : (mpData.xAxis || 0); - - var x = xMarkMap[dataIndex]; - x = typeof x != 'undefined' - ? x - : typeof mpData.xAxis != 'string' && xAxis.getCoordByIndex - ? xAxis.getCoordByIndex(mpData.xAxis || 0) - : xAxis.getCoord(mpData.xAxis || 0); - - pos = [x, yAxis.getCoord(mpData.yAxis || 0)]; - } - else { - // 纵向 - dataIndex = typeof mpData.yAxis == 'string' && yAxis.getIndexByName - ? yAxis.getIndexByName(mpData.yAxis) - : (mpData.yAxis || 0); - - var y = xMarkMap[dataIndex]; - y = typeof y != 'undefined' - ? y - : typeof mpData.yAxis != 'string' && yAxis.getCoordByIndex - ? yAxis.getCoordByIndex(mpData.yAxis || 0) - : yAxis.getCoord(mpData.yAxis || 0); - - pos = [xAxis.getCoord(mpData.xAxis || 0), y]; - } - - return pos; - }, - - /** - * 刷新 - */ - refresh : function (newOption) { - if (newOption) { - this.option = newOption; - this.series = newOption.series; - } - - this.backupShapeList(); - this._buildShape(); - }, - - /** - * 动态数据增加动画 - */ - addDataAnimation : function (params) { - var series = this.series; - var aniMap = {}; // seriesIndex索引参数 - for (var i = 0, l = params.length; i < l; i++) { - aniMap[params[i][0]] = params[i]; - } - var x; - var dx; - var y; - var dy; - var serie; - var seriesIndex; - var dataIndex; - for (var i = this.shapeList.length - 1; i >= 0; i--) { - seriesIndex = ecData.get(this.shapeList[i], 'seriesIndex'); - if (aniMap[seriesIndex] && !aniMap[seriesIndex][3]) { - // 有数据删除才有移动的动画 - if (this.shapeList[i].type == 'rectangle') { - // 主动画 - dataIndex = ecData.get(this.shapeList[i], 'dataIndex'); - serie = series[seriesIndex]; - if (aniMap[seriesIndex][2] - && dataIndex == serie.data.length - 1 - ) { - // 队头加入删除末尾 - this.zr.delShape(this.shapeList[i].id); - continue; - } - else if (!aniMap[seriesIndex][2] && dataIndex === 0) { - // 队尾加入删除头部 - this.zr.delShape(this.shapeList[i].id); - continue; - } - if (this.shapeList[i]._orient == 'horizontal') { - // 条形图 - dy = this.component.yAxis.getAxis( - serie.yAxisIndex || 0 - ).getGap(); - y = aniMap[seriesIndex][2] ? -dy : dy; - x = 0; - } - else { - // 柱形图 - dx = this.component.xAxis.getAxis( - serie.xAxisIndex || 0 - ).getGap(); - x = aniMap[seriesIndex][2] ? dx : -dx; - y = 0; - } - this.shapeList[i].position = [0, 0]; - this.zr.animate(this.shapeList[i].id, '') - .when( - 500, - {position : [x, y]} - ) - .start(); - } - } - } - } - }; - - zrUtil.inherits(Bar, ChartBase); - zrUtil.inherits(Bar, ComponentBase); - - // 图表注册 - require('../chart').define('bar', Bar); - - return Bar; +/** + * echarts层级查找方法 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/util/ecQuery',['zrender/tool/util'],function() { + var zrUtil = require('zrender/tool/util'); + + /** + * 获取嵌套选项的基础方法 + * 返回optionTarget中位于optionLocation上的值,如果没有定义,则返回undefined + */ + function query(optionTarget, optionLocation) { + if (typeof optionTarget == 'undefined') { + return; + } + + if (!optionLocation) { + return optionTarget; + } + + optionLocation = optionLocation.split('.'); + var length = optionLocation.length; + var curIdx = 0; + while (curIdx < length) { + optionTarget = optionTarget[optionLocation[curIdx]]; + if (typeof optionTarget == 'undefined') { + return; + } + curIdx++; + } + + return optionTarget; + } + + /** + * 获取多级控制嵌套属性的基础方法 + * 返回ctrList中优先级最高(最靠前)的非undefined属性,ctrList中均无定义则返回undefined + */ + function deepQuery(ctrList, optionLocation) { + var finalOption; + for (var i = 0, l = ctrList.length; i < l; i++) { + finalOption = query(ctrList[i], optionLocation); + if (typeof finalOption != 'undefined') { + return finalOption; + } + } + } + + /** + * 获取多级控制嵌套属性的基础方法 + * 根据ctrList中优先级合并产出目标属性 + */ + function deepMerge(ctrList, optionLocation) { + var finalOption; + var len = ctrList.length; + while (len--) { + var tempOption = query(ctrList[len], optionLocation); + if (typeof tempOption != 'undefined') { + if (typeof finalOption == 'undefined') { + finalOption = zrUtil.clone(tempOption); + } + else { + zrUtil.merge( + finalOption, tempOption, true + ); + } + } + } + + return finalOption; + } + + return { + query : query, + deepQuery : deepQuery, + deepMerge : deepMerge + }; }); -/** - * echarts图表类:饼图 - * - * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define('echarts/chart/pie',['require','../component/base','./base','zrender/shape/Text','zrender/shape/Ring','zrender/shape/Circle','zrender/shape/Sector','zrender/shape/BrokenLine','../config','../util/ecData','zrender/tool/util','zrender/tool/math','zrender/tool/color','../chart'],function (require) { - var ComponentBase = require('../component/base'); - var ChartBase = require('./base'); - - // 图形依赖 - var TextShape = require('zrender/shape/Text'); - var RingShape = require('zrender/shape/Ring'); - var CircleShape = require('zrender/shape/Circle'); - var SectorShape = require('zrender/shape/Sector'); - var BrokenLineShape = require('zrender/shape/BrokenLine'); - - var ecConfig = require('../config'); - var ecData = require('../util/ecData'); - var zrUtil = require('zrender/tool/util'); - var zrMath = require('zrender/tool/math'); - var zrColor = require('zrender/tool/color'); - - /** - * 构造函数 - * @param {Object} messageCenter echart消息中心 - * @param {ZRender} zr zrender实例 - * @param {Object} series 数据 - * @param {Object} component 组件 - */ - function Pie(ecTheme, messageCenter, zr, option, myChart){ - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); - // 图表基类 - ChartBase.call(this); - - var self = this; - /** - * 输出动态视觉引导线 - */ - self.shapeHandler.onmouseover = function (param) { - var shape = param.target; - var seriesIndex = ecData.get(shape, 'seriesIndex'); - var dataIndex = ecData.get(shape, 'dataIndex'); - var percent = ecData.get(shape, 'special'); - var lastAddRadius = shape._lastAddRadius; - - var startAngle = shape.style.startAngle; - var endAngle = shape.style.endAngle; - var defaultColor = shape.highlightStyle.color; - - // 文本标签,需要显示则会有返回 - var label = self.getLabel( - seriesIndex, dataIndex, percent, lastAddRadius, - startAngle, endAngle, defaultColor, - true - ); - if (label) { - self.zr.addHoverShape(label); - } - - // 文本标签视觉引导线,需要显示则会有返回 - var labelLine = self.getLabelLine( - seriesIndex, dataIndex, lastAddRadius, - shape.style.r0, shape.style.r, - startAngle, endAngle, defaultColor, - true - ); - if (labelLine) { - self.zr.addHoverShape(labelLine); - } - }; - - this.refresh(option); - } - - Pie.prototype = { - type : ecConfig.CHART_TYPE_PIE, - /** - * 绘制图形 - */ - _buildShape : function () { - var series = this.series; - var legend = this.component.legend; - this.selectedMap = {}; - this._selected = {}; - var center; - var radius; - - var pieCase; // 饼图箱子 - this._selectedMode = false; - var serieName; - for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type == ecConfig.CHART_TYPE_PIE) { - series[i] = this.reformOption(series[i]); - serieName = series[i].name || ''; - // 系列图例开关 - this.selectedMap[serieName] = - legend ? legend.isSelected(serieName) : true; - if (!this.selectedMap[serieName]) { - continue; - } - - center = this.parseCenter(this.zr, series[i].center); - radius = this.parseRadius(this.zr, series[i].radius); - this._selectedMode = this._selectedMode || series[i].selectedMode; - this._selected[i] = []; - if (this.deepQuery([series[i], this.option], 'calculable')) { - pieCase = { - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : center[0], // 圆心横坐标 - y : center[1], // 圆心纵坐标 - // 圆环内外半径 - r0 : radius[0] <= 10 ? 0 : radius[0] - 10, - r : radius[1] + 10, - brushType : 'stroke', - lineWidth: 1, - strokeColor : series[i].calculableHolderColor - || this.ecTheme.calculableHolderColor - } - }; - ecData.pack(pieCase, series[i], i, undefined, -1); - this.setCalculable(pieCase); - - pieCase = radius[0] <= 10 - ? new CircleShape(pieCase) - : new RingShape(pieCase); - this.shapeList.push(pieCase); - } - this._buildSinglePie(i); - this.buildMark(i); - } - } - - this.addShapeList(); - }, - - /** - * 构建单个饼图 - * - * @param {number} seriesIndex 系列索引 - */ - _buildSinglePie : function (seriesIndex) { - var series = this.series; - var serie = series[seriesIndex]; - var data = serie.data; - var legend = this.component.legend; - var itemName; - var totalSelected = 0; // 迭代累计选中且非0个数 - var totalSelectedValue0 = 0; // 迭代累计选中0只个数 - var totalValue = 0; // 迭代累计 - var maxValue = Number.NEGATIVE_INFINITY; - - // 计算需要显示的个数和总值 - for (var i = 0, l = data.length; i < l; i++) { - itemName = data[i].name; - if (legend){ - this.selectedMap[itemName] = legend.isSelected(itemName); - } else { - this.selectedMap[itemName] = true; - } - if (this.selectedMap[itemName] && !isNaN(data[i].value)) { - if (+data[i].value !== 0) { - totalSelected++; - } - else { - totalSelectedValue0++; - } - totalValue += +data[i].value; - maxValue = Math.max(maxValue, +data[i].value); - } - } - - var percent = 100; - var lastPercent; // 相邻细角度优化 - var lastAddRadius = 0; - var clockWise = serie.clockWise; - var startAngle = serie.startAngle.toFixed(2) - 0; - var endAngle; - var minAngle = serie.minAngle || 0.01; // #bugfixed - var totalAngle = 360 - (minAngle * totalSelected) - - 0.01 * totalSelectedValue0; - var defaultColor; - var roseType = serie.roseType; - var radius; - var r0; // 扇形内半径 - var r1; // 扇形外半径 - - for (var i = 0, l = data.length; i < l; i++) { - itemName = data[i].name; - if (!this.selectedMap[itemName] || isNaN(data[i].value)) { - continue; - } - // 默认颜色策略 - if (legend) { - // 有图例则从图例中获取颜色定义 - defaultColor = legend.getColor(itemName); - } - else { - // 全局颜色定义 - defaultColor = this.zr.getColor(i); - } - - lastPercent = percent; - percent = data[i].value / totalValue; - if (roseType != 'area') { - endAngle = clockWise - ? (startAngle - percent * totalAngle - (percent !== 0 ? minAngle : 0.01)) - : (percent * totalAngle + startAngle + (percent !== 0 ? minAngle : 0.01)); - } - else { - endAngle = clockWise - ? (startAngle - 360 / l) - : (360 / l + startAngle); - } - endAngle = endAngle.toFixed(2) - 0; - percent = (percent * 100).toFixed(2); - - radius = this.parseRadius(this.zr, serie.radius); - r0 = +radius[0]; - r1 = +radius[1]; - - if (roseType == 'radius') { - r1 = data[i].value / maxValue * (r1 - r0) * 0.8 - + (r1 - r0) * 0.2 - + r0; - } - else if (roseType == 'area') { - r1 = Math.sqrt(data[i].value / maxValue) * (r1 - r0) + r0; - } - - if (clockWise) { - var temp; - temp = startAngle; - startAngle = endAngle; - endAngle = temp; - } - - // 当前小角度需要检查前一个是否也是小角度,如果是得调整长度,不能完全避免,但能大大降低覆盖概率 - if (i > 0 - && Math.abs(startAngle - endAngle) < 15 // 约15度 - && lastPercent < 4 - && this._needLabel(serie, data[i], false) - && this.deepQuery( - [data[i], serie], 'itemStyle.normal.label.position' - ) != 'center' - ) { - // 都小就延长,前小后大就缩短 - lastAddRadius += (percent < 4 ? 20 : -20); - } - else { - lastAddRadius = 0; - } - - this._buildItem( - seriesIndex, i, percent, lastAddRadius, // 相邻最小角度优化 - data[i].selected, - r0, r1, - startAngle, endAngle, defaultColor - ); - if (!clockWise) { - startAngle = endAngle; - } - } - }, - - /** - * 构建单个扇形及指标 - */ - _buildItem : function ( - seriesIndex, dataIndex, percent, lastAddRadius, - isSelected, - r0, r1, - startAngle, endAngle, defaultColor - ) { - var series = this.series; - // 扇形 - var sector = this.getSector( - seriesIndex, dataIndex, percent, isSelected, - r0, r1, - startAngle, endAngle, defaultColor - ); - // 图形需要附加的私有数据 - ecData.pack( - sector, - series[seriesIndex], seriesIndex, - series[seriesIndex].data[dataIndex], dataIndex, - series[seriesIndex].data[dataIndex].name, - percent - ); - sector._lastAddRadius = lastAddRadius; - this.shapeList.push(sector); - - // 文本标签,需要显示则会有返回 - var label = this.getLabel( - seriesIndex, dataIndex, percent, lastAddRadius, - startAngle, endAngle, defaultColor, - false - ); - if (label) { - ecData.pack( - label, - series[seriesIndex], seriesIndex, - series[seriesIndex].data[dataIndex], dataIndex, - series[seriesIndex].data[dataIndex].name, - percent - ); - label._dataIndex = dataIndex; - this.shapeList.push(label); - } - - // 文本标签视觉引导线,需要显示则会有返回 - var labelLine = this.getLabelLine( - seriesIndex, dataIndex, lastAddRadius, - r0, r1, - startAngle, endAngle, defaultColor, - false - ); - if (labelLine) { - ecData.pack( - labelLine, - series[seriesIndex], seriesIndex, - series[seriesIndex].data[dataIndex], dataIndex, - series[seriesIndex].data[dataIndex].name, - percent - ); - labelLine._dataIndex = dataIndex; - this.shapeList.push(labelLine); - } - }, - - /** - * 构建扇形 - */ - getSector : function ( - seriesIndex, dataIndex, percent, isSelected, - r0, r1, - startAngle, endAngle, defaultColor - ) { - var series = this.series; - var serie = series[seriesIndex]; - var data = serie.data[dataIndex]; - var queryTarget = [data, serie]; - var center = this.parseCenter(this.zr, serie.center); - - // 多级控制 - var normal = this.deepMerge( - queryTarget, - 'itemStyle.normal' - ) || {}; - var emphasis = this.deepMerge( - queryTarget, - 'itemStyle.emphasis' - ) || {}; - var normalColor = this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) - || defaultColor; - - var emphasisColor = this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data) - || (typeof normalColor == 'string' - ? zrColor.lift(normalColor, -0.2) - : normalColor - ); - - var sector = { - zlevel : this._zlevelBase, - clickable : true, - style : { - x : center[0], // 圆心横坐标 - y : center[1], // 圆心纵坐标 - r0 : r0, // 圆环内半径 - r : r1, // 圆环外半径 - startAngle : startAngle, - endAngle : endAngle, - brushType : 'both', - color : normalColor, - lineWidth : normal.borderWidth, - strokeColor : normal.borderColor, - lineJoin: 'round' - }, - highlightStyle : { - color : emphasisColor, - lineWidth : emphasis.borderWidth, - strokeColor : emphasis.borderColor, - lineJoin: 'round' - }, - _seriesIndex : seriesIndex, - _dataIndex : dataIndex - }; - - if (isSelected) { - var midAngle = - ((sector.style.startAngle + sector.style.endAngle) / 2) - .toFixed(2) - 0; - sector.style._hasSelected = true; - sector.style._x = sector.style.x; - sector.style._y = sector.style.y; - var offset = this.query(serie, 'selectedOffset'); - sector.style.x += zrMath.cos(midAngle, true) * offset; - sector.style.y -= zrMath.sin(midAngle, true) * offset; - - this._selected[seriesIndex][dataIndex] = true; - } - else { - this._selected[seriesIndex][dataIndex] = false; - } - - - if (this._selectedMode) { - sector.onclick = this.shapeHandler.onclick; - } - - if (this.deepQuery([data, serie, this.option], 'calculable')) { - this.setCalculable(sector); - sector.draggable = true; - } - - // “normal下不显示,emphasis显示”添加事件响应 - if (this._needLabel(serie, data, true) // emphasis下显示文本 - || this._needLabelLine(serie, data, true) // emphasis下显示引导线 - ) { - sector.onmouseover = this.shapeHandler.onmouseover; - } - - sector = new SectorShape(sector); - return sector; - }, - - /** - * 需要显示则会有返回构建好的shape,否则返回undefined - */ - getLabel : function ( - seriesIndex, dataIndex, percent, lastAddRadius, - startAngle, endAngle, defaultColor, - isEmphasis - ) { - var series = this.series; - var serie = series[seriesIndex]; - var data = serie.data[dataIndex]; - - // 特定状态下是否需要显示文本标签 - if (!this._needLabel(serie, data, isEmphasis)) { - return; - } - - var status = isEmphasis ? 'emphasis' : 'normal'; - - // serie里有默认配置,放心大胆的用! - var itemStyle = zrUtil.merge( - zrUtil.clone(data.itemStyle) || {}, - serie.itemStyle - ); - // label配置 - var labelControl = itemStyle[status].label; - var textStyle = labelControl.textStyle || {}; - - var center = this.parseCenter(this.zr, serie.center); - var centerX = center[0]; // 圆心横坐标 - var centerY = center[1]; // 圆心纵坐标 - var x; - var y; - var midAngle = ((endAngle + startAngle) / 2 + 360) % 360; // 中值 - var radius = this.parseRadius(this.zr, serie.radius); // 标签位置半径 - var textAlign; - var textBaseline = 'middle'; - labelControl.position = labelControl.position - || itemStyle.normal.label.position; - if (labelControl.position == 'center') { - // center显示 - radius = radius[1]; - x = centerX; - y = centerY; - textAlign = 'center'; - } - else if (labelControl.position == 'inner'){ - // 内部显示 - radius = (radius[0] + radius[1]) / 2 + lastAddRadius; - x = Math.round( - centerX + radius * zrMath.cos(midAngle, true) - ); - y = Math.round( - centerY - radius * zrMath.sin(midAngle, true) - ); - defaultColor = '#fff'; - textAlign = 'center'; - - } - else { - // 外部显示,默认 labelControl.position == 'outer') - radius = radius[1] - - (-itemStyle[status].labelLine.length) - //- (-textStyle.fontSize) - + lastAddRadius; - x = centerX + radius * zrMath.cos(midAngle, true); - y = centerY - radius * zrMath.sin(midAngle, true); - textAlign = (midAngle >= 90 && midAngle <= 270) - ? 'right' : 'left'; - } - - if (labelControl.position != 'center' - && labelControl.position != 'inner' - ) { - x += textAlign == 'left' ? 20 : -20; - } - data.__labelX = x - (textAlign == 'left' ? 5 : -5); - data.__labelY = y; - - return new TextShape({ - zlevel : this._zlevelBase + 1, - hoverable : false, - style : { - x : x, - y : y, - color : textStyle.color || defaultColor, - text : this.getLabelText( - seriesIndex, dataIndex, percent, status - ), - textAlign : textStyle.align || textAlign, - textBaseline : textStyle.baseline || textBaseline, - textFont : this.getFont(textStyle) - }, - highlightStyle : { - brushType : 'fill' - }, - _seriesIndex : seriesIndex, - _dataIndex : dataIndex - }); - }, - - /** - * 根据lable.format计算label text - */ - getLabelText : function (seriesIndex, dataIndex, percent, status) { - var series = this.series; - var serie = series[seriesIndex]; - var data = serie.data[dataIndex]; - var formatter = this.deepQuery( - [data, serie], - 'itemStyle.' + status + '.label.formatter' - ); - - if (formatter) { - if (typeof formatter == 'function') { - return formatter.call( - this.myChart, - serie.name, - data.name, - data.value, - percent - ); - } - else if (typeof formatter == 'string') { - formatter = formatter.replace('{a}','{a0}') - .replace('{b}','{b0}') - .replace('{c}','{c0}') - .replace('{d}','{d0}'); - formatter = formatter.replace('{a0}', serie.name) - .replace('{b0}', data.name) - .replace('{c0}', data.value) - .replace('{d0}', percent); - - return formatter; - } - } - else { - return data.name; - } - }, - - /** - * 需要显示则会有返回构建好的shape,否则返回undefined - */ - getLabelLine : function ( - seriesIndex, dataIndex, lastAddRadius, - r0, r1, - startAngle, endAngle, defaultColor, - isEmphasis - ) { - var series = this.series; - var serie = series[seriesIndex]; - var data = serie.data[dataIndex]; - - // 特定状态下是否需要显示文本标签 - if (this._needLabelLine(serie, data, isEmphasis)) { - var status = isEmphasis ? 'emphasis' : 'normal'; - - // serie里有默认配置,放心大胆的用! - var itemStyle = zrUtil.merge( - zrUtil.clone(data.itemStyle) || {}, - serie.itemStyle - ); - // labelLine配置 - var labelLineControl = itemStyle[status].labelLine; - var lineStyle = labelLineControl.lineStyle || {}; - - var center = this.parseCenter(this.zr, serie.center); - var centerX = center[0]; // 圆心横坐标 - var centerY = center[1]; // 圆心纵坐标 - // 视觉引导线起点半径 - var midRadius = r1; - // 视觉引导线终点半径 - var maxRadius = this.parseRadius(this.zr, serie.radius)[1] - - (-labelLineControl.length) - + lastAddRadius; - var midAngle = ((endAngle + startAngle) / 2) % 360; // 角度中值 - var cosValue = zrMath.cos(midAngle, true); - var sinValue = zrMath.sin(midAngle, true); - // 三角函数缓存已在zrender/tool/math中做了 - return new BrokenLineShape({ - // shape : 'brokenLine', - zlevel : this._zlevelBase + 1, - hoverable : false, - style : { - pointList : [ - [ - centerX + midRadius * cosValue, - centerY - midRadius * sinValue - ], - [ - centerX + maxRadius * cosValue, - centerY - maxRadius * sinValue - ], - [ - data.__labelX, - data.__labelY - ] - ], - //xStart : centerX + midRadius * cosValue, - //yStart : centerY - midRadius * sinValue, - //xEnd : centerX + maxRadius * cosValue, - //yEnd : centerY - maxRadius * sinValue, - strokeColor : lineStyle.color || defaultColor, - lineType : lineStyle.type, - lineWidth : lineStyle.width - }, - _seriesIndex : seriesIndex, - _dataIndex : dataIndex - }); - } - else { - return; - } - }, - - /** - * 返回特定状态(normal or emphasis)下是否需要显示label标签文本 - * @param {Object} serie - * @param {Object} data - * @param {boolean} isEmphasis true is 'emphasis' and false is 'normal' - */ - _needLabel : function (serie, data, isEmphasis) { - return this.deepQuery( - [data, serie], - 'itemStyle.' - + (isEmphasis ? 'emphasis' : 'normal') - + '.label.show' - ); - }, - - /** - * 返回特定状态(normal or emphasis)下是否需要显示labelLine标签视觉引导线 - * @param {Object} serie - * @param {Object} data - * @param {boolean} isEmphasis true is 'emphasis' and false is 'normal' - */ - _needLabelLine : function (serie, data, isEmphasis) { - return this.deepQuery( - [data, serie], - 'itemStyle.' - + (isEmphasis ? 'emphasis' : 'normal') - +'.labelLine.show' - ); - }, - - /** - * 参数修正&默认值赋值,重载基类方法 - * @param {Object} opt 参数 - */ - reformOption : function (opt) { - // 常用方法快捷方式 - var _merge = zrUtil.merge; - opt = _merge( - opt || {}, - this.ecTheme.pie - ); - - // 通用字体设置 - opt.itemStyle.normal.label.textStyle = _merge( - opt.itemStyle.normal.label.textStyle || {}, - this.ecTheme.textStyle - ); - opt.itemStyle.emphasis.label.textStyle = _merge( - opt.itemStyle.emphasis.label.textStyle || {}, - this.ecTheme.textStyle - ); - - return opt; - }, - - /** - * 刷新 - */ - refresh : function (newOption) { - if (newOption) { - this.option = newOption; - this.series = newOption.series; - } - - this.backupShapeList(); - this._buildShape(); - }, - - /** - * 动态数据增加动画 - */ - addDataAnimation : function (params) { - var series = this.series; - var aniMap = {}; // seriesIndex索引参数 - for (var i = 0, l = params.length; i < l; i++) { - aniMap[params[i][0]] = params[i]; - } - - // 构建新的饼图匹配差异做动画 - var sectorMap = {}; - var textMap = {}; - var lineMap = {}; - var backupShapeList = this.shapeList; - this.shapeList = []; - - var seriesIndex; - var isHead; - var dataGrow; - var deltaIdxMap = {}; // 修正新增数据后会对dataIndex产生错位匹配 - for (var i = 0, l = params.length; i < l; i++) { - seriesIndex = params[i][0]; - isHead = params[i][2]; - dataGrow = params[i][3]; - if (series[seriesIndex] - && series[seriesIndex].type == ecConfig.CHART_TYPE_PIE - ) { - if (isHead) { - if (!dataGrow) { - sectorMap[ - seriesIndex - + '_' - + series[seriesIndex].data.length - ] = 'delete'; - } - deltaIdxMap[seriesIndex] = 1; - } - else { - if (!dataGrow) { - sectorMap[seriesIndex + '_-1'] = 'delete'; - deltaIdxMap[seriesIndex] = -1; - } - else { - deltaIdxMap[seriesIndex] = 0; - } - } - this._buildSinglePie(seriesIndex); - } - } - var dataIndex; - var key; - for (var i = 0, l = this.shapeList.length; i < l; i++) { - seriesIndex = this.shapeList[i]._seriesIndex; - dataIndex = this.shapeList[i]._dataIndex; - key = seriesIndex + '_' + dataIndex; - // map映射让n*n变n - switch (this.shapeList[i].type) { - case 'sector' : - sectorMap[key] = this.shapeList[i]; - break; - case 'text' : - textMap[key] = this.shapeList[i]; - break; - case 'broken-line' : - lineMap[key] = this.shapeList[i]; - break; - } - } - this.shapeList = []; - var targeSector; - for (var i = 0, l = backupShapeList.length; i < l; i++) { - seriesIndex = backupShapeList[i]._seriesIndex; - if (aniMap[seriesIndex]) { - dataIndex = backupShapeList[i]._dataIndex - + deltaIdxMap[seriesIndex]; - key = seriesIndex + '_' + dataIndex; - targeSector = sectorMap[key]; - if (!targeSector) { - continue; - } - if (backupShapeList[i].type == 'sector') { - if (targeSector != 'delete') { - // 原有扇形 - this.zr.animate(backupShapeList[i].id, 'style') - .when( - 400, - { - startAngle : - targeSector.style.startAngle, - endAngle : - targeSector.style.endAngle - } - ) - .start(); - } - else { - // 删除的扇形 - this.zr.animate(backupShapeList[i].id, 'style') - .when( - 400, - deltaIdxMap[seriesIndex] < 0 - ? { - startAngle : - backupShapeList[i].style.startAngle - } - : { - endAngle : - backupShapeList[i].style.endAngle - } - ) - .start(); - } - } - else if (backupShapeList[i].type == 'text' - || backupShapeList[i].type == 'broken-line' - ) { - if (targeSector == 'delete') { - // 删除逻辑一样 - this.zr.delShape(backupShapeList[i].id); - } - else { - // 懒得新建变量了,借用一下 - switch (backupShapeList[i].type) { - case 'text': - targeSector = textMap[key]; - this.zr.animate(backupShapeList[i].id, 'style') - .when( - 400, - { - x :targeSector.style.x, - y :targeSector.style.y - } - ) - .start(); - break; - case 'broken-line': - targeSector = lineMap[key]; - this.zr.animate(backupShapeList[i].id, 'style') - .when( - 400, - { - pointList:targeSector.style.pointList - } - ) - .start(); - break; - } - - } - } - } - } - this.shapeList = backupShapeList; - }, - - onclick : function (param) { - var series = this.series; - if (!this.isClick || !param.target) { - // 没有在当前实例上发生点击直接返回 - return; - } - this.isClick = false; - var offset; // 偏移 - var target = param.target; - var style = target.style; - var seriesIndex = ecData.get(target, 'seriesIndex'); - var dataIndex = ecData.get(target, 'dataIndex'); +/** + * echarts数字运算相关 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/util/number',[],function() { + function _trim(str) { + return str.replace(/^\s+/, '').replace(/\s+$/, ''); + } + + /** + * 百分比计算 + */ + function parsePercent(value, maxValue) { + if (typeof value === 'string') { + if (_trim(value).match(/%$/)) { + return parseFloat(value) / 100 * maxValue; + } + + return parseFloat(value); + } + + return value; + } + + /** + * 获取中心坐标 + */ + function parseCenter(zr, center) { + return [ + parsePercent(center[0], zr.getWidth()), + parsePercent(center[1], zr.getHeight()) + ]; + } + + /** + * 获取自适应半径 + */ + function parseRadius(zr, radius) { + // 传数组实现环形图,[内半径,外半径],传单个则默认为外半径为 + if (!(radius instanceof Array)) { + radius = [0, radius]; + } + var zrSize = Math.min(zr.getWidth(), zr.getHeight()) / 2; + return [ + parsePercent(radius[0], zrSize), + parsePercent(radius[1], zrSize) + ]; + } + + /** + * 每三位默认加,格式化 + */ + function addCommas(x) { + if (isNaN(x)) { + return '-'; + } + x = (x + '').split('.'); + return x[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,'$1,') + + (x.length > 1 ? ('.' + x[1]) : ''); + } + + return { + parsePercent : parsePercent, + parseCenter : parseCenter, + parseRadius : parseRadius, + addCommas : addCommas + }; +}); +/** + * echarts组件基类 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/component/base',['require','../config','../util/ecQuery','../util/number','zrender/tool/util','zrender/tool/env'],function (require) { + var ecConfig = require('../config'); + var ecQuery = require('../util/ecQuery'); + var number = require('../util/number'); + var zrUtil = require('zrender/tool/util'); + + function Base(ecTheme, messageCenter, zr, option, myChart){ + this.ecTheme = ecTheme; + this.messageCenter = messageCenter; + this.zr =zr; + this.option = option; + this.series = option.series; + this.myChart = myChart; + this.component = myChart.component; + + this._zlevelBase = this.getZlevelBase(); + this.shapeList = []; + this.effectList = []; + + var self = this; + self.hoverConnect = function (param) { + var target = (param.target || {}).hoverConnect; + if (target) { + var zlevel = 10; + var shape; + if (!(target instanceof Array)) { + shape = self.getShapeById(target); + if (shape) { + self.zr.addHoverShape(shape); + zlevel = Math.min(zlevel, shape.zlevel); + } + } + else { + for (var i = 0, l = target.length; i < l; i++) { + shape = self.getShapeById(target[i]); + self.zr.addHoverShape(shape); + zlevel = Math.min(zlevel, shape.zlevel); + } + } + if (zlevel < param.target.zlevel) { + self.zr.addHoverShape(param.target); + } + } + }; + } + + /** + * 基类方法 + */ + Base.prototype = { + canvasSupported: require('zrender/tool/env').canvasSupported, + /** + * 获取zlevel基数配置 + * @param {Object} contentType + */ + getZlevelBase: function (contentType) { + contentType = contentType || this.type + ''; + + switch (contentType) { + case ecConfig.COMPONENT_TYPE_GRID : + case ecConfig.COMPONENT_TYPE_AXIS_CATEGORY : + case ecConfig.COMPONENT_TYPE_AXIS_VALUE : + case ecConfig.COMPONENT_TYPE_POLAR : + return 0; + + case ecConfig.CHART_TYPE_LINE : + case ecConfig.CHART_TYPE_BAR : + case ecConfig.CHART_TYPE_SCATTER : + case ecConfig.CHART_TYPE_PIE : + case ecConfig.CHART_TYPE_RADAR : + case ecConfig.CHART_TYPE_MAP : + case ecConfig.CHART_TYPE_K : + case ecConfig.CHART_TYPE_CHORD: + case ecConfig.CHART_TYPE_GUAGE: + case ecConfig.CHART_TYPE_FUNNEL: + return 2; + + case ecConfig.COMPONENT_TYPE_LEGEND : + case ecConfig.COMPONENT_TYPE_DATARANGE: + case ecConfig.COMPONENT_TYPE_DATAZOOM : + case ecConfig.COMPONENT_TYPE_TIMELINE : + case ecConfig.COMPONENT_TYPE_ROAMCONTROLLER : + return 4; + + case ecConfig.CHART_TYPE_ISLAND : + return 5; + + case ecConfig.COMPONENT_TYPE_TOOLBOX : + case ecConfig.COMPONENT_TYPE_TITLE : + return 6; + + // ecConfig.EFFECT_ZLEVEL = 7; + + case ecConfig.COMPONENT_TYPE_TOOLTIP : + return 8; + + default : + return 0; + } + }, + + /** + * 参数修正&默认值赋值 + * @param {Object} opt 参数 + * + * @return {Object} 修正后的参数 + */ + reformOption: function (opt) { + return zrUtil.merge( + opt || {}, + zrUtil.clone(this.ecTheme[this.type] || {}) + ); + }, + + /** + * css类属性数组补全,如padding,margin等~ + */ + reformCssArray: function (p) { + if (p instanceof Array) { + switch (p.length + '') { + case '4': + return p; + case '3': + return [p[0], p[1], p[2], p[1]]; + case '2': + return [p[0], p[1], p[0], p[1]]; + case '1': + return [p[0], p[0], p[0], p[0]]; + case '0': + return [0, 0, 0, 0]; + } + } + else { + return [p, p, p, p]; + } + }, + + getShapeById: function(id) { + for (var i = 0, l = this.shapeList.length; i < l; i++) { + if (this.shapeList[i].id === id) { + return this.shapeList[i]; + } + } + return null; + }, + + /** + * 获取自定义和默认配置合并后的字体设置 + */ + getFont: function (textStyle) { + var finalTextStyle = zrUtil.merge( + zrUtil.clone(textStyle) || {}, + this.ecTheme.textStyle + ); + return finalTextStyle.fontStyle + ' ' + + finalTextStyle.fontWeight + ' ' + + finalTextStyle.fontSize + 'px ' + + finalTextStyle.fontFamily; + }, + + getItemStyleColor: function (itemColor, seriesIndex, dataIndex, data) { + return typeof itemColor === 'function' + ? itemColor(seriesIndex, dataIndex, data) : itemColor; + + }, + + // 亚像素优化 + subPixelOptimize: function (position, lineWidth) { + if (lineWidth % 2 === 1) { + //position += position === Math.ceil(position) ? 0.5 : 0; + position = Math.floor(position) + 0.5; + } + else { + position = Math.round(position); + } + return position; + }, + + + resize: function () { + this.refresh && this.refresh(); + this.clearEffectShape && this.clearEffectShape(true); + var self = this; + setTimeout(function(){ + self.animationEffect && self.animationEffect(); + },200); + }, + + /** + * 清除图形数据,实例仍可用 + */ + clear :function () { + this.clearEffectShape && this.clearEffectShape(); + this.zr && this.zr.delShape(this.shapeList); + this.shapeList = []; + }, + + /** + * 释放后实例不可用 + */ + dispose: function () { + this.clear(); + this.shapeList = null; + this.effectList = null; + }, + + query: ecQuery.query, + deepQuery: ecQuery.deepQuery, + deepMerge: ecQuery.deepMerge, + + parsePercent: number.parsePercent, + parseCenter: number.parseCenter, + parseRadius: number.parseRadius, + numAddCommas: number.addCommas + }; + + return Base; +}); + +/** + * zrender: 数学辅助类 + * + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + * sin:正弦函数 + * cos:余弦函数 + * degreeToRadian:角度转弧度 + * radianToDegree:弧度转角度 + */ +define( + 'zrender/tool/math',[],function () { + + var _radians = Math.PI / 180; + + /** + * @param {number} angle 弧度(角度)参数 + * @param {boolean} isDegrees angle参数是否为角度计算,默认为false,angle为以弧度计量的角度 + */ + function sin(angle, isDegrees) { + return Math.sin(isDegrees ? angle * _radians : angle); + } + + /** + * @param {number} angle 弧度(角度)参数 + * @param {boolean} isDegrees angle参数是否为角度计算,默认为false,angle为以弧度计量的角度 + */ + function cos(angle, isDegrees) { + return Math.cos(isDegrees ? angle * _radians : angle); + } + + /** + * 角度转弧度 + * @param {Object} angle + */ + function degreeToRadian(angle) { + return angle * _radians; + } + + /** + * 弧度转角度 + * @param {Object} angle + */ + function radianToDegree(angle) { + return angle / _radians; + } + + return { + sin : sin, + cos : cos, + degreeToRadian : degreeToRadian, + radianToDegree : radianToDegree + }; + } +); + +/** + * n角星(n>3) + * @module zrender/shape/Star + * @author sushuang (宿爽, sushuang@baidu.com) + * @example + * var Star = require('zrender/shape/Star'); + * var shape = new Star({ + * style: { + * x: 200, + * y: 100, + * r: 150, + * n: 5, + * text: '五角星' + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} IStarStyle + * @property {number} x n角星外接圆心x坐标 + * @property {number} y n角星外接圆心y坐标 + * @property {number} r n角星外接圆半径 + * @property {number} [r0] n角星内部顶点(凹点)的外接圆半径。 + * 如果不指定此参数,则自动计算:取相隔外部顶点连线的交点作内部顶点。 + * @property {number} n 指明几角星 + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ + +define( + 'zrender/shape/Star',['require','../tool/math','./Base','../tool/util'],function (require) { + + var math = require('../tool/math'); + var sin = math.sin; + var cos = math.cos; + var PI = Math.PI; + + var Base = require('./Base'); + + /** + * @alias module:zrender/shape/Star + * @param {Object} options + * @constructor + * @extends module:zrender/shape/Base + */ + var Star = function(options) { + Base.call(this, options); + /** + * n角星绘制样式 + * @name module:zrender/shape/Star#style + * @type {module:zrender/shape/Star~IStarStyle} + */ + /** + * n角星高亮绘制样式 + * @name module:zrender/shape/Star#highlightStyle + * @type {module:zrender/shape/Star~IStarStyle} + */ + }; + + Star.prototype = { + type: 'star', + + /** + * 创建n角星(n>3)路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Star~IStarStyle} style + */ + buildPath : function(ctx, style) { + var n = style.n; + if (!n || n < 2) { + return; + } + + var x = style.x; + var y = style.y; + var r = style.r; + var r0 = style.r0; + + // 如果未指定内部顶点外接圆半径,则自动计算 + if (r0 == null) { + r0 = n > 4 + // 相隔的外部顶点的连线的交点, + // 被取为内部交点,以此计算r0 + ? r * cos(2 * PI / n) / cos(PI / n) + // 二三四角星的特殊处理 + : r / 3; + } + + var dStep = PI / n; + var deg = -PI / 2; + var xStart = x + r * cos(deg); + var yStart = y + r * sin(deg); + deg += dStep; + + // 记录边界点,用于判断inside + var pointList = style.pointList = []; + pointList.push([ xStart, yStart ]); + for (var i = 0, end = n * 2 - 1, ri; i < end; i++) { + ri = i % 2 === 0 ? r0 : r; + pointList.push([ x + ri * cos(deg), y + ri * sin(deg) ]); + deg += dStep; + } + pointList.push([ xStart, yStart ]); + + // 绘制 + ctx.moveTo(pointList[0][0], pointList[0][1]); + for (var i = 0; i < pointList.length; i++) { + ctx.lineTo(pointList[i][0], pointList[i][1]); + } + + ctx.closePath(); + + return; + }, + + /** + * 返回n角星包围盒矩形 + * @param {module:zrender/shape/Star~IStarStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function(style) { + if (style.__rect) { + return style.__rect; + } + + var lineWidth; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } + else { + lineWidth = 0; + } + style.__rect = { + x : Math.round(style.x - style.r - lineWidth / 2), + y : Math.round(style.y - style.r - lineWidth / 2), + width : style.r * 2 + lineWidth, + height : style.r * 2 + lineWidth + }; + + return style.__rect; + } + }; + + require('../tool/util').inherits(Star, Base); + return Star; + } +); + +/** + * @module zrender/shape/Heart + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @example + * var Heart = require('zrender/shape/Heart'); + * var shape = new Heart({ + * style: { + * x: 100, + * y: 100, + * a: 40, + * b: 40, + * brushType: 'both', + * color: 'blue', + * strokeColor: 'red', + * lineWidth: 3, + * text: 'Heart' + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} IHeartStyle + * @property {number} x 心形内部尖端横坐标 + * @property {number} y 心形内部尖端纵坐标 + * @property {number} a 心形横宽(中轴线到水平边缘最宽处距离) + * @property {number} b 心形纵高(内尖到外尖距离) + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ +define( + 'zrender/shape/Heart',['require','./Base','../tool/util'],function (require) { + + + var Base = require('./Base'); + + /** + * @alias module:zrender/shape/Heart + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var Heart = function (options) { + Base.call(this, options); + /** + * 心形绘制样式 + * @name module:zrender/shape/Heart#style + * @type {module:zrender/shape/Heart~IHeartStyle} + */ + /** + * 心形高亮绘制样式 + * @name module:zrender/shape/Heart#highlightStyle + * @type {module:zrender/shape/Heart~IHeartStyle} + */ + }; + + Heart.prototype = { + type: 'heart', + + /** + * 创建扇形路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Heart~IHeartStyle} style + */ + buildPath : function (ctx, style) { + ctx.moveTo(style.x, style.y); + ctx.bezierCurveTo( + style.x + style.a / 2, + style.y - style.b * 2 / 3, + style.x + style.a * 2, + style.y + style.b / 3, + style.x, + style.y + style.b + ); + ctx.bezierCurveTo( + style.x - style.a * 2, + style.y + style.b / 3, + style.x - style.a / 2, + style.y - style.b * 2 / 3, + style.x, + style.y + ); + ctx.closePath(); + return; + }, + + /** + * 计算返回心形的包围盒矩形 + * @param {module:zrender/shape/Heart~IHeartStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function (style) { + if (style.__rect) { + return style.__rect; + } + + var lineWidth; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } + else { + lineWidth = 0; + } + style.__rect = { + x : Math.round(style.x - style.a - lineWidth / 2), + y : Math.round(style.y - style.b / 4 - lineWidth / 2), + width : style.a * 2 + lineWidth, + height : style.b * 5 / 4 + lineWidth + }; + + return style.__rect; + } + }; + + require('../tool/util').inherits(Heart, Base); + return Heart; + } +); + +/** + * 水滴形状 + * @module zrender/shape/Droplet + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @example + * var Droplet = require('zrender/shape/Droplet'); + * var shape = new Droplet({ + * style: { + * x: 100, + * y: 100, + * a: 40, + * b: 40, + * brushType: 'both', + * color: 'blue', + * strokeColor: 'red', + * lineWidth: 3, + * text: 'Droplet' + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} IDropletStyle + * @property {number} x 水滴中心x坐标 + * @property {number} y 水滴中心y坐标 + * @property {number} a 水滴横宽(中心到水平边缘最宽处距离) + * @property {number} b 水滴纵高(中心到尖端距离) + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ +define( + 'zrender/shape/Droplet',['require','./Base','../tool/util'],function (require) { + + + var Base = require('./Base'); + + /** + * @alias module:zrender/shape/Droplet + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var Droplet = function(options) { + Base.call(this, options); + /** + * 水滴绘制样式 + * @name module:zrender/shape/Droplet#style + * @type {module:zrender/shape/Droplet~IDropletStyle} + */ + /** + * 水滴高亮绘制样式 + * @name module:zrender/shape/Droplet#highlightStyle + * @type {module:zrender/shape/Droplet~IDropletStyle} + */ + }; + + Droplet.prototype = { + type: 'droplet', + + /** + * 创建水滴路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Droplet~IDropletStyle} style + */ + buildPath : function(ctx, style) { + ctx.moveTo(style.x, style.y + style.a); + ctx.bezierCurveTo( + style.x + style.a, + style.y + style.a, + style.x + style.a * 3 / 2, + style.y - style.a / 3, + style.x, + style.y - style.b + ); + ctx.bezierCurveTo( + style.x - style.a * 3 / 2, + style.y - style.a / 3, + style.x - style.a, + style.y + style.a, + style.x, + style.y + style.a + ); + ctx.closePath(); + }, + + /** + * 计算返回水滴的包围盒矩形 + * @param {module:zrender/shape/Droplet~IDropletStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function(style) { + if (style.__rect) { + return style.__rect; + } + + var lineWidth; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } + else { + lineWidth = 0; + } + style.__rect = { + x : Math.round(style.x - style.a - lineWidth / 2), + y : Math.round(style.y - style.b - lineWidth / 2), + width : style.a * 2 + lineWidth, + height : style.a + style.b + lineWidth + }; + + return style.__rect; + } + }; + + require('../tool/util').inherits(Droplet, Base); + return Droplet; + } +); + +/** + * echarts扩展zrender shape + * + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + * shape类:icon + * 可配图形属性: + { + // 基础属性 + shape : 'icon', // 必须,shape类标识,需要显式指定 + id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 + zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 + invisible : {boolean}, // 默认为false,是否可见 + + // 样式属性,默认状态样式样式属性 + style : { + x : {number}, // 必须,左上角横坐标 + y : {number}, // 必须,左上角纵坐标 + width : {number}, // 必须,宽度 + height : {number}, // 必须,高度 + iconType : {string}, // 必须,icon类型 + }, + + // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 + highlightStyle : { + // 同style + } + + // 交互属性,详见shape.Base + + // 事件属性,详见shape.Base + } + */ +define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/Star','zrender/shape/Heart','zrender/shape/Droplet','zrender/shape/Image','zrender/shape/Base'],function (require) { + var zrUtil = require('zrender/tool/util'); + + function _iconMark(ctx, style) { + var dx = style.width / 16; + var dy = style.height / 16; + ctx.moveTo(style.x, style.y + style.height); + ctx.lineTo(style.x + 5 * dx, style.y + 14 * dy); + ctx.lineTo(style.x + style.width, style.y + 3 * dy); + ctx.lineTo(style.x + 13 * dx, style.y); + ctx.lineTo(style.x + 2 * dx, style.y + 11 * dy); + ctx.lineTo(style.x, style.y + style.height); + + ctx.moveTo(style.x + 6 * dx, style.y + 10 * dy); + ctx.lineTo(style.x + 14 * dx, style.y + 2 * dy); + + ctx.moveTo(style.x + 10 * dx, style.y + 13 * dy); + ctx.lineTo(style.x + style.width, style.y + 13 * dy); + + ctx.moveTo(style.x + 13 * dx, style.y + 10 * dy); + ctx.lineTo(style.x + 13 * dx, style.y + style.height); + } + + function _iconMarkUndo(ctx, style) { + var dx = style.width / 16; + var dy = style.height / 16; + ctx.moveTo(style.x, style.y + style.height); + ctx.lineTo(style.x + 5 * dx, style.y + 14 * dy); + ctx.lineTo(style.x + style.width, style.y + 3 * dy); + ctx.lineTo(style.x + 13 * dx, style.y); + ctx.lineTo(style.x + 2 * dx, style.y + 11 * dy); + ctx.lineTo(style.x, style.y + style.height); + + ctx.moveTo(style.x + 6 * dx, style.y + 10 * dy); + ctx.lineTo(style.x + 14 * dx, style.y + 2 * dy); + + ctx.moveTo(style.x + 10 * dx, style.y + 13 * dy); + ctx.lineTo(style.x + style.width, style.y + 13 * dy); + } + + function _iconMarkClear(ctx, style) { + var dx = style.width / 16; + var dy = style.height / 16; + + ctx.moveTo(style.x + 4 * dx, style.y + 15 * dy); + ctx.lineTo(style.x + 9 * dx, style.y + 13 * dy); + ctx.lineTo(style.x + 14 * dx, style.y + 8 * dy); + ctx.lineTo(style.x + 11 * dx, style.y + 5 * dy); + ctx.lineTo(style.x + 6 * dx, style.y + 10 * dy); + ctx.lineTo(style.x + 4 * dx, style.y + 15 * dy); + + ctx.moveTo(style.x + 5 * dx, style.y); + ctx.lineTo(style.x + 11 * dx, style.y); + ctx.moveTo(style.x + 5 * dx, style.y + dy); + ctx.lineTo(style.x + 11 * dx, style.y + dy); + ctx.moveTo(style.x, style.y + 2 * dy); + ctx.lineTo(style.x + style.width, style.y + 2 * dy); + + ctx.moveTo(style.x, style.y + 5 * dy); + ctx.lineTo(style.x + 3 * dx, style.y + style.height); + ctx.lineTo(style.x + 13 * dx, style.y + style.height); + ctx.lineTo(style.x + style.width, style.y + 5 * dy); + } + + function _iconDataZoom(ctx, style) { + var dx = style.width / 16; + var dy = style.height / 16; + + ctx.moveTo(style.x, style.y + 3 * dy); + ctx.lineTo(style.x + 6 * dx, style.y + 3 * dy); + + ctx.moveTo(style.x + 3 * dx, style.y); + ctx.lineTo(style.x + 3 * dx, style.y + 6 * dy); + + ctx.moveTo(style.x + 3 * dx, style.y + 8 * dy); + ctx.lineTo(style.x + 3 * dx, style.y + style.height); + ctx.lineTo(style.x + style.width, style.y + style.height); + ctx.lineTo(style.x + style.width, style.y + 3 * dy); + ctx.lineTo(style.x + 8 * dx, style.y + 3 * dy); + } + + function _iconDataZoomReset(ctx, style) { + var dx = style.width / 16; + var dy = style.height / 16; + + ctx.moveTo(style.x + 6 * dx, style.y); + ctx.lineTo(style.x + 2 * dx, style.y + 3 * dy); + ctx.lineTo(style.x + 6 * dx, style.y + 6 * dy); + + ctx.moveTo(style.x + 2 * dx, style.y + 3 * dy); + ctx.lineTo(style.x + 14 * dx, style.y + 3 * dy); + ctx.lineTo(style.x + 14 * dx, style.y + 11 * dy); + + ctx.moveTo(style.x + 2 * dx, style.y + 5 * dy); + ctx.lineTo(style.x + 2 * dx, style.y + 13 * dy); + ctx.lineTo(style.x + 14 * dx, style.y + 13 * dy); + + ctx.moveTo(style.x + 10 * dx, style.y + 10 * dy); + ctx.lineTo(style.x + 14 * dx, style.y + 13 * dy); + ctx.lineTo(style.x + 10 * dx, style.y + style.height); + } + + function _iconRestore(ctx, style) { + var dx = style.width / 16; + var dy = style.height / 16; + var r = style.width / 2; + + ctx.lineWidth = 1.5; + + ctx.arc(style.x + r, style.y + r, r - dx, 0, Math.PI * 2 / 3); + ctx.moveTo(style.x + 3 * dx, style.y + style.height); + ctx.lineTo(style.x + 0 * dx, style.y + 12 * dy); + ctx.lineTo(style.x + 5 * dx, style.y + 11 * dy); + + ctx.moveTo(style.x, style.y + 8 * dy); + ctx.arc(style.x + r, style.y + r, r - dx, Math.PI, Math.PI * 5 / 3); + ctx.moveTo(style.x + 13 * dx, style.y); + ctx.lineTo(style.x + style.width, style.y + 4 * dy); + ctx.lineTo(style.x + 11 * dx, style.y + 5 * dy); + } + + function _iconLineChart(ctx, style) { + var dx = style.width / 16; + var dy = style.height / 16; + + ctx.moveTo(style.x, style.y); + ctx.lineTo(style.x, style.y + style.height); + ctx.lineTo(style.x + style.width, style.y + style.height); + + ctx.moveTo(style.x + 2 * dx, style.y + 14 * dy); + ctx.lineTo(style.x + 7 * dx, style.y + 6 * dy); + ctx.lineTo(style.x + 11 * dx, style.y + 11 * dy); + ctx.lineTo(style.x + 15 * dx, style.y + 2 * dy); + } + + function _iconBarChart(ctx, style) { + var dx = style.width / 16; + var dy = style.height / 16; + + ctx.moveTo(style.x, style.y); + ctx.lineTo(style.x, style.y + style.height); + ctx.lineTo(style.x + style.width, style.y + style.height); + + ctx.moveTo(style.x + 3 * dx, style.y + 14 * dy); + ctx.lineTo(style.x + 3 * dx, style.y + 6 * dy); + ctx.lineTo(style.x + 4 * dx, style.y + 6 * dy); + ctx.lineTo(style.x + 4 * dx, style.y + 14 * dy); + ctx.moveTo(style.x + 7 * dx, style.y + 14 * dy); + ctx.lineTo(style.x + 7 * dx, style.y + 2 * dy); + ctx.lineTo(style.x + 8 * dx, style.y + 2 * dy); + ctx.lineTo(style.x + 8 * dx, style.y + 14 * dy); + ctx.moveTo(style.x + 11 * dx, style.y + 14 * dy); + ctx.lineTo(style.x + 11 * dx, style.y + 9 * dy); + ctx.lineTo(style.x + 12 * dx, style.y + 9 * dy); + ctx.lineTo(style.x + 12 * dx, style.y + 14 * dy); + } + + function _iconStackChart(ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + var dy = Math.round(height / 3); + var len = 3; + while (len--) { + ctx.rect(x, y + dy * len + 2, width, 2); + } + } + + function _iconTiledChart(ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + var dx = Math.round(width / 3); + var len = 3; + while (len--) { + ctx.rect(x + dx * len, y, 2, height); + } + } + + function _iconDataView(ctx, style) { + var dx = style.width / 16; + + ctx.moveTo(style.x + dx, style.y); + ctx.lineTo(style.x + dx, style.y + style.height); + ctx.lineTo(style.x + 15 * dx, style.y + style.height); + ctx.lineTo(style.x + 15 * dx, style.y); + ctx.lineTo(style.x + dx, style.y); + + ctx.moveTo(style.x + 3 * dx, style.y + 3 * dx); + ctx.lineTo(style.x + 13 * dx, style.y + 3 * dx); + + ctx.moveTo(style.x + 3 * dx, style.y + 6 * dx); + ctx.lineTo(style.x + 13 * dx, style.y + 6 * dx); + + ctx.moveTo(style.x + 3 * dx, style.y + 9 * dx); + ctx.lineTo(style.x + 13 * dx, style.y + 9 * dx); + + ctx.moveTo(style.x + 3 * dx, style.y + 12 * dx); + ctx.lineTo(style.x + 9 * dx, style.y + 12 * dx); + } + + function _iconSave(ctx, style) { + var dx = style.width / 16; + var dy = style.height / 16; + + ctx.moveTo(style.x, style.y); + ctx.lineTo(style.x, style.y + style.height); + ctx.lineTo(style.x + style.width, style.y + style.height); + ctx.lineTo(style.x + style.width, style.y); + ctx.lineTo(style.x, style.y); + + ctx.moveTo(style.x + 4 * dx, style.y); + ctx.lineTo(style.x + 4 * dx, style.y + 8 * dy); + ctx.lineTo(style.x + 12 * dx, style.y + 8 * dy); + ctx.lineTo(style.x + 12 * dx, style.y); + + ctx.moveTo(style.x + 6 * dx, style.y + 11 * dy); + ctx.lineTo(style.x + 6 * dx, style.y + 13 * dy); + ctx.lineTo(style.x + 10 * dx, style.y + 13 * dy); + ctx.lineTo(style.x + 10 * dx, style.y + 11 * dy); + ctx.lineTo(style.x + 6 * dx, style.y + 11 * dy); + } + + function _iconCross(ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + ctx.moveTo(x, y + height / 2); + ctx.lineTo(x + width, y + height / 2); + + ctx.moveTo(x + width / 2, y); + ctx.lineTo(x + width / 2, y + height); + } + + function _iconCircle(ctx, style) { + var width = style.width / 2; + var height = style.height / 2; + var r = Math.min(width, height); + ctx.moveTo( + style.x + width + r, + style.y + height + ); + ctx.arc( + style.x + width, + style.y + height, + r, + 0, + Math.PI * 2 + ); + ctx.closePath(); + } + + function _iconRectangle(ctx, style) { + ctx.rect(style.x, style.y, style.width, style.height); + ctx.closePath(); + } + + function _iconTriangle(ctx, style) { + var width = style.width / 2; + var height = style.height / 2; + var x = style.x + width; + var y = style.y + height; + var symbolSize = Math.min(width, height); + ctx.moveTo(x, y - symbolSize); + ctx.lineTo(x + symbolSize, y + symbolSize); + ctx.lineTo(x - symbolSize, y + symbolSize); + ctx.lineTo(x, y - symbolSize); + ctx.closePath(); + } + + function _iconDiamond(ctx, style) { + var width = style.width / 2; + var height = style.height / 2; + var x = style.x + width; + var y = style.y + height; + var symbolSize = Math.min(width, height); + ctx.moveTo(x, y - symbolSize); + ctx.lineTo(x + symbolSize, y); + ctx.lineTo(x, y + symbolSize); + ctx.lineTo(x - symbolSize, y); + ctx.lineTo(x, y - symbolSize); + ctx.closePath(); + } + + function _iconArrow(ctx, style) { + var x = style.x; + var y = style.y; + var dx = style.width / 16; + ctx.moveTo(x + 8 * dx, y); + ctx.lineTo(x + dx, y + style.height); + ctx.lineTo(x + 8 * dx, y + style.height / 4 * 3); + ctx.lineTo(x + 15 * dx, y + style.height); + ctx.lineTo(x + 8 * dx, y); + ctx.closePath(); + } + + function _iconStar(ctx, style) { + var StarShape = require('zrender/shape/Star'); + var width = style.width / 2; + var height = style.height / 2; + StarShape.prototype.buildPath(ctx, { + x : style.x + width, + y : style.y + height, + r : Math.min(width, height), + n : style.n || 5 + }); + } + + function _iconHeart(ctx, style) { + var HeartShape = require('zrender/shape/Heart'); + HeartShape.prototype.buildPath(ctx, { + x : style.x + style.width / 2, + y : style.y + style.height * 0.2, + a : style.width / 2, + b : style.height * 0.8 + }); + } + + function _iconDroplet(ctx, style) { + var DropletShape = require('zrender/shape/Droplet'); + DropletShape.prototype.buildPath(ctx, { + x : style.x + style.width * 0.5, + y : style.y + style.height * 0.5, + a : style.width * 0.5, + b : style.height * 0.8 + }); + } + + function _iconPin(ctx, style) { + var x = style.x; + var y = style.y - style.height / 2 * 1.5; + var width = style.width / 2; + var height = style.height / 2; + var r = Math.min(width, height); + ctx.arc( + x + width, + y + height, + r, + Math.PI / 5 * 4, + Math.PI / 5 + ); + ctx.lineTo(x + width, y + height + r * 1.5); + ctx.closePath(); + } + + function _iconImage(ctx, style) { + setTimeout(function (){ + var ImageShape = require('zrender/shape/Image'); + var itemShape = new ImageShape({ + style : style + }); + itemShape.brush(ctx); + },100); + } + + var Base = require('zrender/shape/Base'); + + function Icon(options) { + Base.call(this, options); + } + + Icon.prototype = { + type : 'icon', + iconLibrary : { + mark : _iconMark, + markUndo : _iconMarkUndo, + markClear : _iconMarkClear, + dataZoom : _iconDataZoom, + dataZoomReset : _iconDataZoomReset, + restore : _iconRestore, + lineChart : _iconLineChart, + barChart : _iconBarChart, + stackChart : _iconStackChart, + tiledChart : _iconTiledChart, + dataView : _iconDataView, + saveAsImage : _iconSave, + + cross : _iconCross, + circle : _iconCircle, + rectangle : _iconRectangle, + triangle : _iconTriangle, + diamond : _iconDiamond, + arrow : _iconArrow, + star : _iconStar, + heart : _iconHeart, + droplet : _iconDroplet, + pin : _iconPin, + image : _iconImage + }, + /** + * 创建矩形路径 + * @param {Context2D} ctx Canvas 2D上下文 + * @param {Object} style 样式 + */ + buildPath : function (ctx, style) { + if (this.iconLibrary[style.iconType]) { + this.iconLibrary[style.iconType](ctx, style); + } + else { + ctx.moveTo(style.x, style.y); + ctx.lineTo(style.x + style.width, style.y); + ctx.lineTo(style.x + style.width, style.y + style.height); + ctx.lineTo(style.x, style.y + style.height); + ctx.lineTo(style.x, style.y); + ctx.closePath(); + } + + return; + }, + + /** + * 返回矩形区域,用于局部刷新和文字定位 + * @param {Object} style + */ + getRect : function (style) { + if (style.__rect) { + return style.__rect; + } + + // pin比较特殊,让尖端在目标x,y上 + style.__rect = { + x : Math.round(style.x), + y : Math.round(style.y - (style.iconType == 'pin' + ? (style.height / 2 * 1.5) : 0) + ), + width : style.width, + height : style.height + }; + + return style.__rect; + }, + + isCover : function (x, y) { + var originPos = this.getTansform(x, y); + x = originPos[0]; + y = originPos[1]; + + // 快速预判并保留判断矩形 + var rect = this.style.__rect; + if (!rect) { + rect = this.style.__rect = this.getRect(this.style); + } + // 提高交互体验,太小的图形包围盒四向扩大4px + var delta = (rect.height < 8 || rect.width < 8 ) ? 4 : 0; + if (x >= rect.x - delta + && x <= (rect.x + rect.width + delta) + && y >= rect.y - delta + && y <= (rect.y + rect.height + delta) + ) { + // 矩形内 + return true; + } + else { + return false; + } + } + }; + + zrUtil.inherits(Icon, Base); + + return Icon; +}); +/** + * 虚线lineTo + * + * author: Kener (@Kener-林峰, linzhifeng@baidu.com) + * errorrik (errorrik@gmail.com) + */ +define( + 'zrender/shape/util/dashedLineTo',[],function (/* require */) { + + var dashPattern = [ 5, 5 ]; + /** + * 虚线lineTo + */ + return function (ctx, x1, y1, x2, y2, dashLength) { + // http://msdn.microsoft.com/en-us/library/ie/dn265063(v=vs.85).aspx + if (ctx.setLineDash) { + dashPattern[0] = dashPattern[1] = dashLength; + ctx.setLineDash(dashPattern); + ctx.moveTo(x1, y1); + ctx.lineTo(x2, y2); + return; + } + + dashLength = typeof dashLength != 'number' + ? 5 + : dashLength; + + var dx = x2 - x1; + var dy = y2 - y1; + var numDashes = Math.floor( + Math.sqrt(dx * dx + dy * dy) / dashLength + ); + dx = dx / numDashes; + dy = dy / numDashes; + var flag = true; + for (var i = 0; i < numDashes; ++i) { + if (flag) { + ctx.moveTo(x1, y1); + } + else { + ctx.lineTo(x1, y1); + } + flag = !flag; + x1 += dx; + y1 += dy; + } + ctx.lineTo(x2, y2); + }; + } +); + +/** + * 直线 + * @module zrender/shape/Line + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @example + * var Line = require('zrender/shape/Line'); + * var shape = new Line({ + * style: { + * xStart: 0, + * yStart: 0, + * xEnd: 100, + * yEnd: 100, + * strokeColor: '#000', + * lineWidth: 10 + * } + * }); + * zr.addShape(line); + */ +/** + * @typedef {Object} ILineStyle + * @property {number} xStart 起点x坐标 + * @property {number} yStart 起点y坐标 + * @property {number} xEnd 终止点x坐标 + * @property {number} yEnd 终止点y坐标 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ +define( + 'zrender/shape/Line',['require','./Base','./util/dashedLineTo','../tool/util'],function (require) { + var Base = require('./Base'); + var dashedLineTo = require('./util/dashedLineTo'); + + /** + * @alias module:zrender/shape/Line + * @param {Object} options + * @constructor + * @extends module:zrender/shape/Base + */ + var Line = function (options) { + this.brushTypeOnly = 'stroke'; // 线条只能描边,填充后果自负 + this.textPosition = 'end'; + Base.call(this, options); + + /** + * 直线绘制样式 + * @name module:zrender/shape/Line#style + * @type {module:zrender/shape/Line~ILineStyle} + */ + /** + * 直线高亮绘制样式 + * @name module:zrender/shape/Line#highlightStyle + * @type {module:zrender/shape/Line~ILineStyle} + */ + }; + + Line.prototype = { + type: 'line', + + /** + * 创建线条路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Line~ILineStyle} style + */ + buildPath : function (ctx, style) { + if (!style.lineType || style.lineType == 'solid') { + // 默认为实线 + ctx.moveTo(style.xStart, style.yStart); + ctx.lineTo(style.xEnd, style.yEnd); + } + else if (style.lineType == 'dashed' + || style.lineType == 'dotted' + ) { + var dashLength = (style.lineWidth || 1) + * (style.lineType == 'dashed' ? 5 : 1); + dashedLineTo( + ctx, + style.xStart, style.yStart, + style.xEnd, style.yEnd, + dashLength + ); + } + }, + + /** + * 计算返回线条的包围盒矩形 + * @param {module:zrender/shape/Line~ILineStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function (style) { + if (style.__rect) { + return style.__rect; + } + + var lineWidth = style.lineWidth || 1; + style.__rect = { + x : Math.min(style.xStart, style.xEnd) - lineWidth, + y : Math.min(style.yStart, style.yEnd) - lineWidth, + width : Math.abs(style.xStart - style.xEnd) + + lineWidth, + height : Math.abs(style.yStart - style.yEnd) + + lineWidth + }; + + return style.__rect; + } + }; + + require('../tool/util').inherits(Line, Base); + return Line; + } +); + +/** + * Catmull-Rom spline 插值折线 + * @module zrender/shape/util/smoothSpline + * @author pissang (https://www.github.com/pissang) + * Kener (@Kener-林峰, linzhifeng@baidu.com) + * errorrik (errorrik@gmail.com) + */ +define( + 'zrender/shape/util/smoothSpline',['require','../../tool/vector'],function (require) { + var vector = require('../../tool/vector'); + + /** + * @inner + */ + function interpolate(p0, p1, p2, p3, t, t2, t3) { + var v0 = (p2 - p0) * 0.5; + var v1 = (p3 - p1) * 0.5; + return (2 * (p1 - p2) + v0 + v1) * t3 + + (-3 * (p1 - p2) - 2 * v0 - v1) * t2 + + v0 * t + p1; + } + + /** + * @alias module:zrender/shape/util/smoothSpline + * @param {Array} points 线段顶点数组 + * @param {boolean} isLoop + * @param {Array} constraint + * @return {Array} + */ + return function (points, isLoop, constraint) { + var len = points.length; + var ret = []; + + var distance = 0; + for (var i = 1; i < len; i++) { + distance += vector.distance(points[i - 1], points[i]); + } + + var segs = distance / 5; + segs = segs < len ? len : segs; + for (var i = 0; i < segs; i++) { + var pos = i / (segs - 1) * (isLoop ? len : len - 1); + var idx = Math.floor(pos); + + var w = pos - idx; + + var p0; + var p1 = points[idx % len]; + var p2; + var p3; + if (!isLoop) { + p0 = points[idx === 0 ? idx : idx - 1]; + p2 = points[idx > len - 2 ? len - 1 : idx + 1]; + p3 = points[idx > len - 3 ? len - 1 : idx + 2]; + } + else { + p0 = points[(idx - 1 + len) % len]; + p2 = points[(idx + 1) % len]; + p3 = points[(idx + 2) % len]; + } + + var w2 = w * w; + var w3 = w * w2; + + ret.push([ + interpolate(p0[0], p1[0], p2[0], p3[0], w, w2, w3), + interpolate(p0[1], p1[1], p2[1], p3[1], w, w2, w3) + ]); + } + return ret; + }; + } +); + +/** + * 贝塞尔平滑曲线 + * @module zrender/shape/util/smoothBezier + * @author pissang (https://www.github.com/pissang) + * Kener (@Kener-林峰, linzhifeng@baidu.com) + * errorrik (errorrik@gmail.com) + */ +define( + 'zrender/shape/util/smoothBezier',['require','../../tool/vector'],function (require) { + var vector = require('../../tool/vector'); + + /** + * 贝塞尔平滑曲线 + * @alias module:zrender/shape/util/smoothBezier + * @param {Array} points 线段顶点数组 + * @param {number} smooth 平滑等级, 0-1 + * @param {boolean} isLoop + * @param {Array} constraint 将计算出来的控制点约束在一个包围盒内 + * 比如 [[0, 0], [100, 100]], 这个包围盒会与 + * 整个折线的包围盒做一个并集用来约束控制点。 + * @param {Array} 计算出来的控制点数组 + */ + return function (points, smooth, isLoop, constraint) { + var cps = []; + + var v = []; + var v1 = []; + var v2 = []; + var prevPoint; + var nextPoint; + + var hasConstraint = !!constraint; + var min, max; + if (hasConstraint) { + min = [Infinity, Infinity]; + max = [-Infinity, -Infinity]; + for (var i = 0, len = points.length; i < len; i++) { + vector.min(min, min, points[i]); + vector.max(max, max, points[i]); + } + // 与指定的包围盒做并集 + vector.min(min, min, constraint[0]); + vector.max(max, max, constraint[1]); + } + + for (var i = 0, len = points.length; i < len; i++) { + var point = points[i]; + var prevPoint; + var nextPoint; + + if (isLoop) { + prevPoint = points[i ? i - 1 : len - 1]; + nextPoint = points[(i + 1) % len]; + } + else { + if (i === 0 || i === len - 1) { + cps.push(points[i]); + continue; + } + else { + prevPoint = points[i - 1]; + nextPoint = points[i + 1]; + } + } + + vector.sub(v, nextPoint, prevPoint); + + // use degree to scale the handle length + vector.scale(v, v, smooth); + + var d0 = vector.distance(point, prevPoint); + var d1 = vector.distance(point, nextPoint); + var sum = d0 + d1; + if (sum !== 0) { + d0 /= sum; + d1 /= sum; + } + + vector.scale(v1, v, -d0); + vector.scale(v2, v, d1); + var cp0 = vector.add([], point, v1); + var cp1 = vector.add([], point, v2); + if (hasConstraint) { + vector.max(cp0, cp0, min); + vector.min(cp0, cp0, max); + vector.max(cp1, cp1, min); + vector.min(cp1, cp1, max); + } + cps.push(cp0); + cps.push(cp1); + } + + if (isLoop) { + cps.push(cps.shift()); + } + + return cps; + }; + } +); + +/** + * 多边形 + * @module zrender/shape/Polygon + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @example + * var Polygon = require('zrender/shape/Polygon'); + * var shape = new Polygon({ + * style: { + * // 100x100的正方形 + * pointList: [[0, 0], [100, 0], [100, 100], [0, 100]], + * color: 'blue' + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} IPolygonStyle + * @property {string} pointList 多边形顶点数组 + * @property {string} [smooth=''] 是否做平滑插值, 平滑算法可以选择 bezier, spline + * @property {number} [smoothConstraint] 平滑约束 + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ +define( + 'zrender/shape/Polygon',['require','./Base','./util/smoothSpline','./util/smoothBezier','./util/dashedLineTo','../tool/util'],function (require) { + var Base = require('./Base'); + var smoothSpline = require('./util/smoothSpline'); + var smoothBezier = require('./util/smoothBezier'); + var dashedLineTo = require('./util/dashedLineTo'); + + /** + * @alias module:zrender/shape/Polygon + * @param {Object} options + * @constructor + * @extends module:zrender/shape/Base + */ + var Polygon = function (options) { + Base.call(this, options); + /** + * 多边形绘制样式 + * @name module:zrender/shape/Polygon#style + * @type {module:zrender/shape/Polygon~IPolygonStyle} + */ + /** + * 多边形高亮绘制样式 + * @name module:zrender/shape/Polygon#highlightStyle + * @type {module:zrender/shape/Polygon~IPolygonStyle} + */ + }; + + Polygon.prototype = { + type: 'polygon', + + brush : function (ctx, isHighlight) { + var style = this.style; + if (isHighlight) { + // 根据style扩展默认高亮样式 + style = this.getHighlightStyle( + style, + this.highlightStyle || {} + ); + } + + ctx.save(); + this.setContext(ctx, style); + + // 设置transform + this.setTransform(ctx); + + // 先fill再stroke + var hasPath = false; + if (style.brushType == 'fill' + || style.brushType == 'both' + || typeof style.brushType == 'undefined' // 默认为fill + ) { + ctx.beginPath(); + if (style.lineType == 'dashed' + || style.lineType == 'dotted' + ) { + // 特殊处理,虚线围不成path,实线再build一次 + this.buildPath( + ctx, + { + lineType: 'solid', + lineWidth: style.lineWidth, + pointList: style.pointList + } + ); + hasPath = false; // 这个path不能用 + } + else { + this.buildPath(ctx, style); + hasPath = true; // 这个path能用 + } + ctx.closePath(); + ctx.fill(); + } + + if (style.lineWidth > 0 + && (style.brushType == 'stroke' || style.brushType == 'both') + ) { + if (!hasPath) { + ctx.beginPath(); + this.buildPath(ctx, style); + } + ctx.stroke(); + } + + this.drawText(ctx, style, this.style); + + ctx.restore(); + + return; + }, + + /** + * 创建多边形路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Polygon~IPolygonStyle} style + */ + buildPath : function (ctx, style) { + // 虽然能重用brokenLine,但底层图形基于性能考虑,重复代码减少调用吧 + var pointList = style.pointList; + // 开始点和结束点重复 + /* + var start = pointList[0]; + var end = pointList[pointList.length-1]; + + if (start && end) { + if (start[0] == end[0] && + start[1] == end[1]) { + // 移除最后一个点 + pointList.pop(); + } + } + */ + + if (pointList.length < 2) { + // 少于2个点就不画了~ + return; + } + + if (style.smooth && style.smooth !== 'spline') { + var controlPoints = smoothBezier( + pointList, style.smooth, true, style.smoothConstraint + ); + + ctx.moveTo(pointList[0][0], pointList[0][1]); + var cp1; + var cp2; + var p; + var len = pointList.length; + for (var i = 0; i < len; i++) { + cp1 = controlPoints[i * 2]; + cp2 = controlPoints[i * 2 + 1]; + p = pointList[(i + 1) % len]; + ctx.bezierCurveTo( + cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1] + ); + } + } + else { + if (style.smooth === 'spline') { + pointList = smoothSpline(pointList, true); + } + + if (!style.lineType || style.lineType == 'solid') { + // 默认为实线 + ctx.moveTo(pointList[0][0], pointList[0][1]); + for (var i = 1, l = pointList.length; i < l; i++) { + ctx.lineTo(pointList[i][0], pointList[i][1]); + } + ctx.lineTo(pointList[0][0], pointList[0][1]); + } + else if (style.lineType == 'dashed' + || style.lineType == 'dotted' + ) { + var dashLength = + style._dashLength + || (style.lineWidth || 1) + * (style.lineType == 'dashed' ? 5 : 1); + style._dashLength = dashLength; + ctx.moveTo(pointList[0][0], pointList[0][1]); + for (var i = 1, l = pointList.length; i < l; i++) { + dashedLineTo( + ctx, + pointList[i - 1][0], pointList[i - 1][1], + pointList[i][0], pointList[i][1], + dashLength + ); + } + dashedLineTo( + ctx, + pointList[pointList.length - 1][0], + pointList[pointList.length - 1][1], + pointList[0][0], + pointList[0][1], + dashLength + ); + } + } + return; + }, + + /** + * 计算返回多边形包围盒矩阵 + * @param {module:zrender/shape/Polygon~IPolygonStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function (style) { + if (style.__rect) { + return style.__rect; + } + + var minX = Number.MAX_VALUE; + var maxX = Number.MIN_VALUE; + var minY = Number.MAX_VALUE; + var maxY = Number.MIN_VALUE; + + var pointList = style.pointList; + for (var i = 0, l = pointList.length; i < l; i++) { + if (pointList[i][0] < minX) { + minX = pointList[i][0]; + } + if (pointList[i][0] > maxX) { + maxX = pointList[i][0]; + } + if (pointList[i][1] < minY) { + minY = pointList[i][1]; + } + if (pointList[i][1] > maxY) { + maxY = pointList[i][1]; + } + } + + var lineWidth; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } + else { + lineWidth = 0; + } + + style.__rect = { + x : Math.round(minX - lineWidth / 2), + y : Math.round(minY - lineWidth / 2), + width : maxX - minX + lineWidth, + height : maxY - minY + lineWidth + }; + return style.__rect; + } + }; + + require('../tool/util').inherits(Polygon, Base); + return Polygon; + } +); + + +/** + * 折线 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @module zrender/shape/BrokenLine + * @example + * var BrokenLine = require('zrender/shape/BrokenLine'); + * var shape = new BrokenLine({ + * style: { + * pointList: [[0, 0], [100, 100], [100, 0]], + * smooth: 'bezier', + * strokeColor: 'purple' + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} IBrokenLineStyle + * @property {Array.} pointList 顶点坐标数组 + * @property {string} [smooth=''] 是否做平滑插值, 平滑算法可以选择 bezier, spline + * @property {number} [smoothConstraint] 平滑约束 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {string} [lineJoin='miter'] 线段连接样式,可以是 miter, round, bevel + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ +define( + 'zrender/shape/BrokenLine',['require','./Base','./util/smoothSpline','./util/smoothBezier','./util/dashedLineTo','./Polygon','../tool/util'],function (require) { + var Base = require('./Base'); + var smoothSpline = require('./util/smoothSpline'); + var smoothBezier = require('./util/smoothBezier'); + var dashedLineTo = require('./util/dashedLineTo'); + + /** + * @alias module:zrender/shape/BrokenLine + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var BrokenLine = function(options) { + this.brushTypeOnly = 'stroke'; // 线条只能描边,填充后果自负 + this.textPosition = 'end'; + Base.call(this, options); + /** + * 贝赛尔曲线绘制样式 + * @name module:zrender/shape/BrokenLine#style + * @type {module:zrender/shape/BrokenLine~IBrokenLineStyle} + */ + /** + * 贝赛尔曲线高亮绘制样式 + * @name module:zrender/shape/BrokenLine#highlightStyle + * @type {module:zrender/shape/BrokenLine~IBrokenLineStyle} + */ + }; + + BrokenLine.prototype = { + type: 'broken-line', + + /** + * 创建多边形路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/BrokenLine~IBrokenLineStyle} style + */ + buildPath : function(ctx, style) { + var pointList = style.pointList; + if (pointList.length < 2) { + // 少于2个点就不画了~ + return; + } + + var len = Math.min( + style.pointList.length, + Math.round(style.pointListLength || style.pointList.length) + ); + + if (style.smooth && style.smooth !== 'spline') { + var controlPoints = smoothBezier( + pointList, style.smooth, false, style.smoothConstraint + ); + + ctx.moveTo(pointList[0][0], pointList[0][1]); + var cp1; + var cp2; + var p; + for (var i = 0; i < len - 1; i++) { + cp1 = controlPoints[i * 2]; + cp2 = controlPoints[i * 2 + 1]; + p = pointList[i + 1]; + ctx.bezierCurveTo( + cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1] + ); + } + } + else { + if (style.smooth === 'spline') { + pointList = smoothSpline(pointList); + len = pointList.length; + } + if (!style.lineType || style.lineType == 'solid') { + // 默认为实线 + ctx.moveTo(pointList[0][0], pointList[0][1]); + for (var i = 1; i < len; i++) { + ctx.lineTo(pointList[i][0], pointList[i][1]); + } + } + else if (style.lineType == 'dashed' + || style.lineType == 'dotted' + ) { + var dashLength = (style.lineWidth || 1) + * (style.lineType == 'dashed' ? 5 : 1); + ctx.moveTo(pointList[0][0], pointList[0][1]); + for (var i = 1; i < len; i++) { + dashedLineTo( + ctx, + pointList[i - 1][0], pointList[i - 1][1], + pointList[i][0], pointList[i][1], + dashLength + ); + } + } + } + return; + }, + + /** + * 计算返回折线包围盒矩形。 + * @param {IZRenderBezierCurveStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function(style) { + return require('./Polygon').prototype.getRect(style); + } + }; + + require('../tool/util').inherits(BrokenLine, Base); + return BrokenLine; + } +); + +/** + * zrender + * + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + * shape类:标线 + */ +define('echarts/util/shape/MarkLine',['require','zrender/shape/Base','./Icon','zrender/shape/Line','zrender/shape/BrokenLine','zrender/tool/matrix','zrender/tool/area','zrender/shape/util/dashedLineTo','zrender/shape/util/smoothSpline','zrender/tool/util'],function (require) { + var Base = require('zrender/shape/Base'); + var IconShape = require('./Icon'); + var LineShape = require('zrender/shape/Line'); + var lineInstance = new LineShape({}); + var BrokenLineShape = require('zrender/shape/BrokenLine'); + var brokenLineInstance = new BrokenLineShape({}); + + var matrix = require('zrender/tool/matrix'); + var area = require('zrender/tool/area'); + var dashedLineTo = require('zrender/shape/util/dashedLineTo'); + var smoothSpline = require('zrender/shape/util/smoothSpline'); + var zrUtil = require('zrender/tool/util'); + + + function MarkLine(options) { + Base.call(this, options); + } + + MarkLine.prototype = { + type : 'mark-line', + /** + * 画刷 + * @param ctx 画布句柄 + * @param e 形状实体 + * @param isHighlight 是否为高亮状态 + * @param updateCallback 需要异步加载资源的shape可以通过这个callback(e) + * 让painter更新视图,base.brush没用,需要的话重载brush + */ + brush : function (ctx, isHighlight) { + var style = this.style; + + if (isHighlight) { + // 根据style扩展默认高亮样式 + style = this.getHighlightStyle( + style, + this.highlightStyle || {} + ); + } + + ctx.save(); + this.setContext(ctx, style); + + // 设置transform + this.setTransform(ctx); + + ctx.save(); + ctx.beginPath(); + this.buildLinePath(ctx, style); + ctx.stroke(); + ctx.restore(); + + this.brushSymbol(ctx, style, 0); + this.brushSymbol(ctx, style, 1); + + this.drawText(ctx, style, this.style); + + ctx.restore(); + }, + + /** + * 创建线条路径 + * @param {Context2D} ctx Canvas 2D上下文 + * @param {Object} style 样式 + */ + buildLinePath : function (ctx, style) { + var pointList = style.pointList || this.getPointList(style); + style.pointList = pointList; + + var len = Math.min( + style.pointList.length, + Math.round(style.pointListLength || style.pointList.length) + ); + + if (!style.lineType || style.lineType == 'solid') { + //默认为实线 + ctx.moveTo(pointList[0][0],pointList[0][1]); + for (var i = 1; i < len; i++) { + ctx.lineTo(pointList[i][0],pointList[i][1]); + } + } + else if (style.lineType == 'dashed' + || style.lineType == 'dotted' + ) { + if (style.smooth !== 'spline') { + // 直线 + var dashLength = (style.lineWidth || 1) + * (style.lineType == 'dashed' ? 5 : 1); + ctx.moveTo(pointList[0][0],pointList[0][1]); + for (var i = 1; i < len; i++) { + dashedLineTo( + ctx, + pointList[i - 1][0], pointList[i - 1][1], + pointList[i][0], pointList[i][1], + dashLength + ); + } + } + else { + // 曲线 + for (var i = 1; i < len; i += 2) { + ctx.moveTo(pointList[i - 1][0],pointList[i - 1][1]); + ctx.lineTo(pointList[i][0],pointList[i][1]); + } + } + } + }, + + /** + * 标线始末标注 + */ + brushSymbol : function (ctx, style, idx) { + if (style.symbol[idx] == 'none') { + return; + } + ctx.save(); + ctx.beginPath(); + + ctx.lineWidth = style.symbolBorder; + ctx.strokeStyle = style.symbolBorderColor; + // symbol + style.iconType = style.symbol[idx].replace('empty', '') + .toLowerCase(); + if (style.symbol[idx].match('empty')) { + ctx.fillStyle = '#fff'; //'rgba(0, 0, 0, 0)'; + } + + // symbolRotate + var len = Math.min( + style.pointList.length, + Math.round(style.pointListLength || style.pointList.length) + ); + var x = idx === 0 ? style.pointList[0][0] : style.pointList[len - 1][0]; + var y = idx === 0 ? style.pointList[0][1] : style.pointList[len - 1][1]; + var rotate = typeof style.symbolRotate[idx] != 'undefined' + ? (style.symbolRotate[idx] - 0) : 0; + var transform; + if (rotate !== 0) { + transform = matrix.create(); + matrix.identity(transform); + if (x || y ) { + matrix.translate(transform, transform, [-x, -y]); + } + matrix.rotate( + transform, transform, + rotate * Math.PI / 180 + ); + if (x || y ) { + matrix.translate(transform, transform, [x, y]); + } + ctx.transform.apply(ctx, transform); + } + + if (style.iconType == 'arrow' && rotate === 0) { + // 箭头自动旋转,手动画 + this.buildArrawPath(ctx, style, idx); + } + else { + // symbolSize + var symbolSize = style.symbolSize[idx]; + style.x = x - symbolSize; + style.y = y - symbolSize, + style.width = symbolSize * 2; + style.height = symbolSize * 2; + IconShape.prototype.buildPath(ctx, style); + } + + ctx.closePath(); + ctx.fill(); + ctx.stroke(); + ctx.restore(); + }, + + buildArrawPath : function (ctx, style, idx) { + var len = Math.min( + style.pointList.length, + Math.round(style.pointListLength || style.pointList.length) + ); + var symbolSize = style.symbolSize[idx] * 2; + var xStart = style.pointList[0][0]; + var xEnd = style.pointList[len - 1][0]; + var yStart = style.pointList[0][1]; + var yEnd = style.pointList[len - 1][1]; + var delta = 0; + if (style.smooth === 'spline') { + delta = 0.2; // 偏移0.2弧度 + } + // 原谅我吧,这三角函数实在没想明白,只能这么笨了 + var rotate = Math.atan( + Math.abs((yEnd - yStart) / (xStart - xEnd) + )); + if (idx === 0) { + if (xEnd > xStart) { + if (yEnd > yStart) { + rotate = Math.PI * 2 - rotate + delta; + } + else { + rotate += delta; + } + } + else { + if (yEnd > yStart) { + rotate += Math.PI - delta; + } + else { + rotate = Math.PI - rotate - delta; + } + } + } + else { + if (xStart > xEnd) { + if (yStart > yEnd) { + rotate = Math.PI * 2 - rotate + delta; + } + else { + rotate += delta; + } + } + else { + if (yStart > yEnd) { + rotate += Math.PI - delta; + } + else { + rotate = Math.PI - rotate - delta; + } + } + } + + var halfRotate = Math.PI / 8; // 夹角 + var x = idx === 0 ? xStart : xEnd; + var y = idx === 0 ? yStart : yEnd; + var point= [ + [ + x + symbolSize * Math.cos(rotate - halfRotate), + y - symbolSize * Math.sin(rotate - halfRotate) + ], + [ + x + symbolSize * 0.6 * Math.cos(rotate), + y - symbolSize * 0.6 * Math.sin(rotate) + ], + [ + x + symbolSize * Math.cos(rotate + halfRotate), + y - symbolSize * Math.sin(rotate + halfRotate) + ] + ]; + ctx.moveTo(x, y); + for (var i = 0, l = point.length; i = rect.x + && x <= (rect.x + rect.width) + && y >= rect.y + && y <= (rect.y + rect.height) + ) { + // 矩形内 + return this.style.smooth !== 'spline' + ? area.isInside(lineInstance, this.style, x, y) + : area.isInside(brokenLineInstance, this.style, x, y); + } + + return false; + } + }; + + zrUtil.inherits(MarkLine, Base); + + return MarkLine; +}); + +// 由于大多数shape默认的isCover都是相同的逻辑 +// 所以在echarts里临时抽象一个module,用于isCover method +// TODO: 对zrender的isCover和getRect方法进行抽象,重新整理该逻辑 + +define('echarts/util/shape/normalIsCover',[],function () { + return function (x, y) { + var originPos = this.getTansform(x, y); + x = originPos[0]; + y = originPos[1]; + + // 快速预判并保留判断矩形 + var rect = this.style.__rect; + if (!rect) { + rect = this.style.__rect = this.getRect(this.style); + } + + return x >= rect.x + && x <= (rect.x + rect.width) + && y >= rect.y + && y <= (rect.y + rect.height); + }; +}); + +/** + * zrender + * + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + * shape类:大规模散点图图形 + * 可配图形属性: + { + // 基础属性 + shape : 'symbol', // 必须,shape类标识,需要显式指定 + id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 + zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 + invisible : {boolean}, // 默认为false,是否可见 + + // 样式属性,默认状态样式样式属性 + style : { + pointList : {Array}, // 必须,二维数组,二维内容如下 + x : {number}, // 必须,横坐标 + y : {number}, // 必须,纵坐标数组 + size : {number}, // 必须,半宽 + type : {string=}, // 默认为'circle',图形类型 + }, + + // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 + highlightStyle : { + // 同style + } + + // 交互属性,详见shape.Base + + // 事件属性,详见shape.Base + } + */ +define('echarts/util/shape/Symbol',['require','zrender/shape/Base','zrender/shape/Polygon','zrender/tool/util','./normalIsCover'],function (require) { + var Base = require('zrender/shape/Base'); + var PolygonShape = require('zrender/shape/Polygon'); + var polygonInstance = new PolygonShape({}); + var zrUtil = require('zrender/tool/util'); + + function Symbol(options) { + Base.call(this, options); + } + + Symbol.prototype = { + type : 'symbol', + /** + * 创建矩形路径 + * @param {Context2D} ctx Canvas 2D上下文 + * @param {Object} style 样式 + */ + buildPath : function (ctx, style) { + var pointList = style.pointList; + var len = pointList.length; + if (len === 0) { + return; + } + + var subSize = 10000; + var subSetLength = Math.ceil(len / subSize); + var sub; + var subLen; + var isArray = pointList[0] instanceof Array; + var size = style.size ? style.size : 2; + var curSize = size; + var halfSize = size / 2; + var PI2 = Math.PI * 2; + var percent; + var x; + var y; + for (var j = 0; j < subSetLength; j++) { + ctx.beginPath(); + sub = j * subSize; + subLen = sub + subSize; + subLen = subLen > len ? len : subLen; + for (var i = sub; i < subLen; i++) { + if (style.random) { + percent = style['randomMap' + (i % 20)] / 100; + curSize = size * percent * percent; + halfSize = curSize / 2; + } + if (isArray) { + x = pointList[i][0]; + y = pointList[i][1]; + } + else { + x = pointList[i].x; + y = pointList[i].y; + } + if (curSize < 3) { + // 小于3像素视觉误差 + ctx.rect(x - halfSize, y - halfSize, curSize, curSize); + } + else { + // 大于3像素才考虑图形 + switch (style.iconType) { + case 'circle' : + ctx.moveTo(x, y); + ctx.arc(x, y, halfSize, 0, PI2, true); + break; + case 'diamond' : + ctx.moveTo(x, y - halfSize); + ctx.lineTo(x + halfSize / 3, y - halfSize / 3); + ctx.lineTo(x + halfSize, y); + ctx.lineTo(x + halfSize / 3, y + halfSize / 3); + ctx.lineTo(x, y + halfSize); + ctx.lineTo(x - halfSize / 3, y + halfSize / 3); + ctx.lineTo(x - halfSize, y); + ctx.lineTo(x - halfSize / 3, y - halfSize / 3); + ctx.lineTo(x, y - halfSize); + break; + default : + ctx.rect(x - halfSize, y - halfSize, curSize, curSize); + } + } + } + ctx.closePath(); + if (j < (subSetLength - 1)) { + switch (style.brushType) { + case 'both': + ctx.fill(); + style.lineWidth > 0 && ctx.stroke(); // js hint -_-" + break; + case 'stroke': + style.lineWidth > 0 && ctx.stroke(); + break; + default: + ctx.fill(); + } + } + } + }, + + /* 像素模式 + buildPath : function (ctx, style) { + var pointList = style.pointList; + var rect = this.getRect(style); + var ratio = window.devicePixelRatio || 1; + // console.log(rect) + // var ti = new Date(); + // bbox取整 + rect = { + x : Math.floor(rect.x), + y : Math.floor(rect.y), + width : Math.floor(rect.width), + height : Math.floor(rect.height) + }; + var pixels = ctx.getImageData( + rect.x * ratio, rect.y * ratio, + rect.width * ratio, rect.height * ratio + ); + var data = pixels.data; + var idx; + var zrColor = require('zrender/tool/color'); + var color = zrColor.toArray(style.color); + var r = color[0]; + var g = color[1]; + var b = color[2]; + var width = rect.width; + + for (var i = 1, l = pointList.length; i < l; i++) { + idx = ((Math.floor(pointList[i][0]) - rect.x) * ratio + + (Math.floor(pointList[i][1])- rect.y) * width * ratio * ratio + ) * 4; + data[idx] = r; + data[idx + 1] = g; + data[idx + 2] = b; + data[idx + 3] = 255; + } + ctx.putImageData(pixels, rect.x * ratio, rect.y * ratio); + // console.log(new Date() - ti); + return; + }, + */ + + /** + * 返回矩形区域,用于局部刷新和文字定位 + * @param {Object} style + */ + getRect : function (style) { + return style.__rect || polygonInstance.getRect(style); + }, + + isCover : require('./normalIsCover') + }; + + zrUtil.inherits(Symbol, Base); + + return Symbol; +}); + +/** + * echarts通用私有数据服务 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/util/ecData',[],function() { + /** + * 打包私有数据 + * + * @param {shape} shape 修改目标 + * @param {Object} series + * @param {number} seriesIndex + * @param {number | Object} data + * @param {number} dataIndex + * @param {*=} special + * @param {*=} special2 + */ + function pack( + shape, series, seriesIndex, data, dataIndex, name, special, special2 + ) { + var value; + if (typeof data != 'undefined') { + value = data.value == null + ? data + : data.value; + } + + shape._echartsData = { + '_series' : series, + '_seriesIndex' : seriesIndex, + '_data' : data, + '_dataIndex' : dataIndex, + '_name' : name, + '_value' : value, + '_special' : special, + '_special2' : special2 + }; + return shape._echartsData; + } + + /** + * 从私有数据中获取特定项 + * @param {shape} shape + * @param {string} key + */ + function get(shape, key) { + var data = shape._echartsData; + if (!key) { + return data; + } + + switch (key) { + case 'series' : + case 'seriesIndex' : + case 'data' : + case 'dataIndex' : + case 'name' : + case 'value' : + case 'special' : + case 'special2' : + return data && data['_' + key]; + } + + return null; + } + + /** + * 修改私有数据中获取特定项 + * @param {shape} shape + * @param {string} key + * @param {*} value + */ + function set(shape, key, value) { + shape._echartsData = shape._echartsData || {}; + switch (key) { + case 'series' : // 当前系列值 + case 'seriesIndex' : // 系列数组位置索引 + case 'data' : // 当前数据值 + case 'dataIndex' : // 数据数组位置索引 + case 'name' : + case 'value' : + case 'special' : + case 'special2' : + shape._echartsData['_' + key] = value; + break; + } + } + + /** + * 私有数据克隆,把source拷贝到target上 + * @param {shape} source 源 + * @param {shape} target 目标 + */ + function clone(source, target) { + target._echartsData = { + '_series' : source._echartsData._series, + '_seriesIndex' : source._echartsData._seriesIndex, + '_data' : source._echartsData._data, + '_dataIndex' : source._echartsData._dataIndex, + '_name' : source._echartsData._name, + '_value' : source._echartsData._value, + '_special' : source._echartsData._special, + '_special2' : source._echartsData._special2 + }; + } + + return { + pack : pack, + set : set, + get : get, + clone : clone + }; +}); +/** + * echarts图表动画基类 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/util/ecAnimation',['require','zrender/tool/util','zrender/shape/Polygon'],function (require) { + var zrUtil = require('zrender/tool/util'); + + /** + * 折线型动画 + * + * @param {ZRender} zr + * @param {shape} oldShape + * @param {shape} newShape + * @param {number} duration + * @param {tring} easing + */ + function pointList(zr, oldShape, newShape, duration, easing) { + var newPointList = newShape.style.pointList; + var newPointListLen = newPointList.length; + var oldPointList; + + if (!oldShape) { // add + oldPointList = []; + if (newShape._orient != 'vertical') { + var y = newPointList[0][1]; + for (var i = 0; i < newPointListLen; i++) { + oldPointList[i] = [newPointList[i][0], y]; + } + } + else { + var x = newPointList[0][0]; + for (var i = 0; i < newPointListLen; i++) { + oldPointList[i] = [x, newPointList[i][1]]; + } + } + + if (newShape.type == 'half-smooth-polygon') { + oldPointList[newPointListLen - 1] = zrUtil.clone(newPointList[newPointListLen - 1]); + oldPointList[newPointListLen - 2] = zrUtil.clone(newPointList[newPointListLen - 2]); + } + oldShape = {style : {pointList : oldPointList}}; + } + + oldPointList = oldShape.style.pointList; + var oldPointListLen = oldPointList.length; + if (oldPointListLen == newPointListLen) { + newShape.style.pointList = oldPointList; + } + else if (oldPointListLen < newPointListLen) { + // 原来短,新的长,补全 + newShape.style.pointList = oldPointList.concat(newPointList.slice(oldPointListLen)); + } + else { + // 原来长,新的短,截断 + newShape.style.pointList = oldPointList.slice(0, newPointListLen); + } + + zr.addShape(newShape); + zr.animate(newShape.id, 'style') + .when( + duration, + { pointList: newPointList } + ) + .start(easing); + } + + /** + * 复制样式 + * + * @inner + * @param {Object} target 目标对象 + * @param {Object} source 源对象 + * @param {...string} props 复制的属性列表 + */ + function cloneStyle(target, source) { + var len = arguments.length; + for (var i = 2; i < len; i++) { + var prop = arguments[i]; + target.style[prop] = source.style[prop]; + } + } + + /** + * 方型动画 + * + * @param {ZRender} zr + * @param {shape} oldShape + * @param {shape} newShape + * @param {number} duration + * @param {tring} easing + */ + function rectangle(zr, oldShape, newShape, duration, easing) { + var newShapeStyle = newShape.style; + if (!oldShape) { // add + oldShape = { + style : { + x : newShapeStyle.x, + y : newShape._orient == 'vertical' + ? newShapeStyle.y + newShapeStyle.height + : newShapeStyle.y, + width: newShape._orient == 'vertical' + ? newShapeStyle.width : 0, + height: newShape._orient != 'vertical' + ? newShapeStyle.height : 0 + } + }; + } + + var newX = newShapeStyle.x; + var newY = newShapeStyle.y; + var newWidth = newShapeStyle.width; + var newHeight = newShapeStyle.height; + cloneStyle( + newShape, oldShape, + 'x', 'y', 'width', 'height' + ); + + zr.addShape(newShape); + zr.animate(newShape.id, 'style') + .when( + duration, + { + x: newX, + y: newY, + width: newWidth, + height: newHeight + } + ) + .start(easing); + } + + /** + * 蜡烛动画 + * + * @param {ZRender} zr + * @param {shape} oldShape + * @param {shape} newShape + * @param {number} duration + * @param {tring} easing + */ + function candle(zr, oldShape, newShape, duration, easing) { + if (!oldShape) { // add + var y = newShape.style.y; + oldShape = {style : {y : [y[0], y[0], y[0], y[0]]}}; + } + + var newY = newShape.style.y; + newShape.style.y = oldShape.style.y; + zr.addShape(newShape); + zr.animate(newShape.id, 'style') + .when( + duration, + { y: newY } + ) + .start(easing); + } + + /** + * 环型动画 + * + * @param {ZRender} zr + * @param {shape} oldShape + * @param {shape} newShape + * @param {number} duration + * @param {tring} easing + */ + function ring(zr, oldShape, newShape, duration, easing) { + var x = newShape.style.x; + var y = newShape.style.y; + var r0 = newShape.style.r0; + var r = newShape.style.r; + + if (newShape._animationAdd != 'r') { + newShape.style.r0 = 0; + newShape.style.r = 0; + newShape.rotation = [Math.PI*2, x, y]; + + zr.addShape(newShape); + zr.animate(newShape.id, 'style') + .when( + duration, + { + r0 : r0, + r : r + } + ) + .start(easing); + zr.animate(newShape.id, '') + .when( + Math.round(duration / 3 * 2), + { rotation : [0, x, y] } + ) + .start(easing); + } + else { + newShape.style.r0 = newShape.style.r; + + zr.addShape(newShape); + zr.animate(newShape.id, 'style') + .when( + duration, + { + r0 : r0 + } + ) + .start(easing); + } + } + + /** + * 扇形动画 + * + * @param {ZRender} zr + * @param {shape} oldShape + * @param {shape} newShape + * @param {number} duration + * @param {tring} easing + */ + function sector(zr, oldShape, newShape, duration, easing) { + if (!oldShape) { // add + if (newShape._animationAdd != 'r') { + oldShape = { + style : { + startAngle : newShape.style.startAngle, + endAngle : newShape.style.startAngle + } + }; + } + else { + oldShape = {style : {r0 : newShape.style.r}}; + } + } + + var startAngle = newShape.style.startAngle; + var endAngle = newShape.style.endAngle; + + cloneStyle( + newShape, oldShape, + 'startAngle', 'endAngle' + ); + + zr.addShape(newShape); + zr.animate(newShape.id, 'style') + .when( + duration, + { + startAngle : startAngle, + endAngle : endAngle + } + ) + .start(easing); + } + + /** + * 文本动画 + * + * @param {ZRender} zr + * @param {shape} oldShape + * @param {shape} newShape + * @param {number} duration + * @param {tring} easing + */ + function text(zr, oldShape, newShape, duration, easing) { + if (!oldShape) { // add + oldShape = { + style : { + x : newShape.style.textAlign == 'left' + ? newShape.style.x + 100 + : newShape.style.x - 100, + y : newShape.style.y + } + }; + } + + var x = newShape.style.x; + var y = newShape.style.y; + + cloneStyle( + newShape, oldShape, + 'x', 'y' + ); + + zr.addShape(newShape); + zr.animate(newShape.id, 'style') + .when( + duration, + { + x : x, + y : y + } + ) + .start(easing); + } + + /** + * 多边形动画 + * + * @param {ZRender} zr + * @param {shape} oldShape + * @param {shape} newShape + * @param {number} duration + * @param {tring} easing + */ + function polygon(zr, oldShape, newShape, duration, easing) { + var rect = require('zrender/shape/Polygon').prototype.getRect(newShape.style); + var x = rect.x + rect.width / 2; + var y = rect.y + rect.height / 2; + + newShape.scale = [0.1, 0.1, x, y]; + zr.addShape(newShape); + zr.animate(newShape.id, '') + .when( + duration, + { + scale : [1, 1, x, y] + } + ) + .start(easing); + } + + /** + * 和弦动画 + * + * @param {ZRender} zr + * @param {shape} oldShape + * @param {shape} newShape + * @param {number} duration + * @param {tring} easing + */ + function chord(zr, oldShape, newShape, duration, easing) { + if (!oldShape) { // add + oldShape = { + style : { + source0 : 0, + source1 : 360, + target0 : 0, + target1 : 360 + } + }; + } + + var source0 = newShape.style.source0; + var source1 = newShape.style.source1; + var target0 = newShape.style.target0; + var target1 = newShape.style.target1; + + if (oldShape.style) { + cloneStyle( + newShape, oldShape, + 'source0', 'source1', 'target0', 'target1' + ); + } + + zr.addShape(newShape); + zr.animate(newShape.id, 'style') + .when( + duration, + { + source0 : source0, + source1 : source1, + target0 : target0, + target1 : target1 + } + ) + .start(easing); + } + + /** + * gaugePointer动画 + * + * @param {ZRender} zr + * @param {shape} oldShape + * @param {shape} newShape + * @param {number} duration + * @param {tring} easing + */ + function gaugePointer(zr, oldShape, newShape, duration, easing) { + if (!oldShape) { // add + oldShape = { + style : { + angle : newShape.style.startAngle + } + }; + } + + var angle = newShape.style.angle; + newShape.style.angle = oldShape.style.angle; + zr.addShape(newShape); + zr.animate(newShape.id, 'style') + .when( + duration, + { + angle : angle + } + ) + .start(easing); + } + + /** + * icon动画 + * + * @param {ZRender} zr + * @param {shape} oldShape + * @param {shape} newShape + * @param {number} duration + * @param {tring} easing + */ + function icon(zr, oldShape, newShape, duration, easing) { + // 避免markPoint特效取值在动画帧上 + newShape.style._x = newShape.style.x; + newShape.style._y = newShape.style.y; + newShape.style._width = newShape.style.width; + newShape.style._height = newShape.style.height; + + if (!oldShape) { // add + var x = newShape._x || 0; + var y = newShape._y || 0; + newShape.scale = [0, 0, x, y]; + zr.addShape(newShape); + zr.animate(newShape.id, '') + .when( + duration, + {scale : [1, 1, x, y]} + ) + .start(easing || 'QuinticOut'); + } + else { // mod + rectangle(zr, oldShape, newShape, duration, easing); + } + } + + /** + * line动画 + * + * @param {ZRender} zr + * @param {shape} oldShape + * @param {shape} newShape + * @param {number} duration + * @param {tring} easing + */ + function line(zr, oldShape, newShape, duration, easing) { + if (!oldShape) { + oldShape = { + style : { + xEnd : newShape.style.xStart, + yEnd : newShape.style.yStart + } + }; + } + + var xStart = newShape.style.xStart; + var xEnd = newShape.style.xEnd; + var yStart = newShape.style.yStart; + var yEnd = newShape.style.yEnd; + + cloneStyle( + newShape, oldShape, + 'xStart', 'xEnd', 'yStart', 'yEnd' + ); + + zr.addShape(newShape); + zr.animate(newShape.id, 'style') + .when( + duration, + { + xStart: xStart, + xEnd: xEnd, + yStart: yStart, + yEnd: yEnd + } + ) + .start(easing); + } + + /** + * markline动画 + * + * @param {ZRender} zr + * @param {shape} oldShape + * @param {shape} newShape + * @param {number} duration + * @param {tring} easing + */ + function markline(zr, oldShape, newShape, duration, easing) { + if (!newShape.style.smooth) { + newShape.style.pointList = !oldShape + ? [ + [newShape.style.xStart, newShape.style.yStart], + [newShape.style.xStart, newShape.style.yStart] + ] + : oldShape.style.pointList; + zr.addShape(newShape); + zr.animate(newShape.id, 'style') + .when( + duration, + { + pointList : [ + [ + newShape.style.xStart, + newShape.style.yStart + ], + [ + newShape._x || 0, newShape._y || 0 + ] + ] + } + ) + .start(easing || 'QuinticOut'); + } + else { + // 曲线动画 + newShape.style.pointListLength = 1; + zr.addShape(newShape); + newShape.style.pointList = newShape.style.pointList + || newShape.getPointList(newShape.style); + zr.animate(newShape.id, 'style') + .when( + duration, + { + pointListLength : newShape.style.pointList.length + } + ) + .start(easing || 'QuinticOut'); + } + } + + return { + pointList : pointList, + rectangle : rectangle, + candle : candle, + ring : ring, + sector : sector, + text : text, + polygon : polygon, + chord : chord, + gaugePointer : gaugePointer, + icon : icon, + line : line, + markline : markline + }; +}); + +/** + * 圆形 + * @module zrender/shape/Circle + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @example + * var Circle = require('zrender/shape/Circle'); + * var shape = new Circle({ + * style: { + * x: 100, + * y: 100, + * r: 40, + * brushType: 'both', + * color: 'blue', + * strokeColor: 'red', + * lineWidth: 3, + * text: 'Circle' + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} ICircleStyle + * @property {number} x 圆心x坐标 + * @property {number} y 圆心y坐标 + * @property {number} r 半径 + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ +define( + 'zrender/shape/Circle',['require','./Base','../tool/util'],function (require) { + + + var Base = require('./Base'); + + /** + * @alias module:zrender/shape/Circle + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var Circle = function(options) { + Base.call(this, options); + /** + * 圆形绘制样式 + * @name module:zrender/shape/Circle#style + * @type {module:zrender/shape/Circle~ICircleStyle} + */ + /** + * 圆形高亮绘制样式 + * @name module:zrender/shape/Circle#highlightStyle + * @type {module:zrender/shape/Circle~ICircleStyle} + */ + }; + + Circle.prototype = { + type: 'circle', + /** + * 创建圆形路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Circle~ICircleStyle} style + */ + buildPath : function (ctx, style) { + ctx.arc(style.x, style.y, style.r, 0, Math.PI * 2, true); + return; + }, + + /** + * 计算返回圆形的包围盒矩形 + * @param {module:zrender/shape/Circle~ICircleStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function (style) { + if (style.__rect) { + return style.__rect; + } + + var lineWidth; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } + else { + lineWidth = 0; + } + style.__rect = { + x : Math.round(style.x - style.r - lineWidth / 2), + y : Math.round(style.y - style.r - lineWidth / 2), + width : style.r * 2 + lineWidth, + height : style.r * 2 + lineWidth + }; + + return style.__rect; + } + }; + + require('../tool/util').inherits(Circle, Base); + return Circle; + } +); + +/** + * echarts图表特效基类 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/util/ecEffect',['require','../util/ecData','zrender/shape/Circle','zrender/shape/Image','../util/shape/Icon','../util/shape/Symbol','zrender/tool/env'],function (require) { + var ecData = require('../util/ecData'); + + var CircleShape = require('zrender/shape/Circle'); + var ImageShape = require('zrender/shape/Image'); + var IconShape = require('../util/shape/Icon'); + var SymbolShape = require('../util/shape/Symbol'); + + var canvasSupported = require('zrender/tool/env').canvasSupported; + + function point(zr, effectList, shape, zlevel) { + var effect = shape.effect; + var color = effect.color || shape.style.strokeColor || shape.style.color; + var shadowColor = effect.shadowColor || color; + var size = effect.scaleSize; + var shadowBlur = typeof effect.shadowBlur != 'undefined' + ? effect.shadowBlur : size; + + var effectShape = new IconShape({ + zlevel : zlevel, + style : { + brushType : 'stroke', + iconType : (shape.style.iconType != 'pin' + && shape.style.iconType != 'droplet') + ? shape.style.iconType + : 'circle', + x : shadowBlur + 1, // 线宽 + y : shadowBlur + 1, + n : shape.style.n, + width : shape.style.width * size, + height : shape.style.height * size, + lineWidth : 1, + strokeColor : color, + shadowColor : shadowColor, + shadowBlur : shadowBlur + }, + draggable : false, + hoverable : false + }); + + if (canvasSupported) { // 提高性能,换成image + effectShape.style.image = zr.shapeToImage( + effectShape, + effectShape.style.width + shadowBlur * 2 + 2, + effectShape.style.height + shadowBlur * 2 + 2 + ).style.image; + + effectShape = new ImageShape({ + zlevel : effectShape.zlevel, + style : effectShape.style, + draggable : false, + hoverable : false + }); + } + + ecData.clone(shape, effectShape); + + // 改变坐标,不能移到前面 + effectShape.position = shape.position; + effectList.push(effectShape); + zr.addShape(effectShape); + + var devicePixelRatio = window.devicePixelRatio || 1; + var offset = (effectShape.style.width / devicePixelRatio - shape.style.width) / 2; + effectShape.style.x = shape.style._x - offset; + effectShape.style.y = shape.style._y - offset; + var duration = (effect.period + Math.random() * 10) * 100; + + zr.modShape( + shape.id, + { invisible : true} + ); + + var centerX = effectShape.style.x + (effectShape.style.width) / 2 / devicePixelRatio; + var centerY = effectShape.style.y + (effectShape.style.height) / 2 / devicePixelRatio; + zr.modShape( + effectShape.id, + { + scale : [0.1, 0.1, centerX, centerY] + } + ); + + zr.animate(effectShape.id, '', effect.loop) + .when( + duration, + { + scale : [1, 1, centerX, centerY] + } + ) + .done(function() { + shape.effect.show = false; + zr.delShape(effectShape.id); + }) + .start(); + } + + function largePoint(zr, effectList, shape, zlevel) { + var effect = shape.effect; + var color = effect.color || shape.style.strokeColor || shape.style.color; + var size = effect.scaleSize; + var shadowColor = effect.shadowColor || color; + var shadowBlur = typeof effect.shadowBlur != 'undefined' + ? effect.shadowBlur : (size * 2); + var devicePixelRatio = window.devicePixelRatio || 1; + var effectShape = new SymbolShape({ + zlevel : zlevel, + position : shape.position, + scale : shape.scale, + style : { + pointList : shape.style.pointList, + iconType : shape.style.iconType, + color : color, + strokeColor : color, + shadowColor : shadowColor, + shadowBlur : shadowBlur * devicePixelRatio, + random : true, + brushType: 'fill', + lineWidth:1, + size : shape.style.size + }, + draggable : false, + hoverable : false + }); + + effectList.push(effectShape); + zr.addShape(effectShape); + zr.modShape( + shape.id, + { invisible : true} + ); + + var duration = Math.round(effect.period * 100); + var clip1 = {}; + var clip2 = {}; + for (var i = 0; i < 20; i++) { + effectShape.style['randomMap' + i] = 0; + clip1 = {}; + clip1['randomMap' + i] = 100; + clip2 = {}; + clip2['randomMap' + i] = 0; + effectShape.style['randomMap' + i] = Math.random() * 100; + zr.animate(effectShape.id, 'style', true) + .when(duration, clip1) + .when(duration * 2, clip2) + .when(duration * 3, clip1) + .when(duration * 4, clip1) + .delay(Math.random() * duration * i) + //.delay(duration / 15 * (15 - i + 1)) + .start(); + + } + } + + function line(zr, effectList, shape, zlevel) { + var effect = shape.effect; + var color = effect.color || shape.style.strokeColor || shape.style.color; + var shadowColor = effect.shadowColor || shape.style.strokeColor || color; + var size = shape.style.lineWidth * effect.scaleSize; + var shadowBlur = typeof effect.shadowBlur != 'undefined' + ? effect.shadowBlur : size; + + var effectShape = new CircleShape({ + zlevel : zlevel, + style : { + x : shadowBlur, + y : shadowBlur, + r : size, + color : color, + shadowColor : shadowColor, + shadowBlur : shadowBlur + }, + draggable : false, + hoverable : false + }); + + var offset; + if (canvasSupported) { // 提高性能,换成image + effectShape.style.image = zr.shapeToImage( + effectShape, + (size + shadowBlur) * 2, + (size + shadowBlur) * 2 + ).style.image; + effectShape = new ImageShape({ + zlevel : effectShape.zlevel, + style : effectShape.style, + draggable : false, + hoverable : false + }); + offset = shadowBlur; + } + else { + offset = 0; + } + + ecData.clone(shape, effectShape); + + // 改变坐标, 不能移到前面 + effectShape.position = shape.position; + effectList.push(effectShape); + zr.addShape(effectShape); + + effectShape.style.x = shape.style.xStart - offset; + effectShape.style.y = shape.style.yStart - offset; + var distance = (shape.style.xStart - shape.style.xEnd) + * (shape.style.xStart - shape.style.xEnd) + + + (shape.style.yStart - shape.style.yEnd) + * (shape.style.yStart - shape.style.yEnd); + var duration = Math.round(Math.sqrt(Math.round( + distance * effect.period * effect.period + ))); + if (!shape.style.smooth) { + // 直线 + zr.animate(effectShape.id, 'style', effect.loop) + .when( + duration, + { + x : shape._x - offset, + y : shape._y - offset + } + ) + .done(function() { + shape.effect.show = false; + zr.delShape(effectShape.id); + }) + .start(); + } + else { + // 曲线 + var pointList = shape.style.pointList || shape.getPointList(shape.style); + var len = pointList.length; + duration = Math.round(duration / len); + var deferred = zr.animate(effectShape.id, 'style', effect.loop); + var step = Math.ceil(len / 8); + for (var j = 0; j < len - step; j+= step) { + deferred.when( + duration * (j + 1), + { + x : pointList[j][0] - offset, + y : pointList[j][1] - offset + } + ); + } + deferred.when( + duration * len, + { + x : pointList[len - 1][0] - offset, + y : pointList[len - 1][1] - offset + } + ); + deferred.done(function() { + shape.effect.show = false; + zr.delShape(effectShape.id); + }); + deferred.start('spline'); + } + } + + return { + point : point, + largePoint : largePoint, + line : line + }; +}); + +/** + * 高精度数学运算 + */ +define('echarts/util/accMath',[],function() { + // 除法函数,用来得到精确的除法结果 + // 说明:javascript的除法结果会有误差,在两个浮点数相除的时候会比较明显。这个函数返回较为精确的除法结果。 + // 调用:accDiv(arg1,arg2) + // 返回值:arg1除以arg2的精确结果 + function accDiv(arg1,arg2){ + var s1 = arg1.toString(); + var s2 = arg2.toString(); + var m = 0; + try { + m = s2.split('.')[1].length; + } + catch(e) {} + try { + m -= s1.split('.')[1].length; + } + catch(e) {} + + return (s1.replace('.', '') - 0) / (s2.replace('.', '') - 0) * Math.pow(10, m); + } + + // 乘法函数,用来得到精确的乘法结果 + // 说明:javascript的乘法结果会有误差,在两个浮点数相乘的时候会比较明显。这个函数返回较为精确的乘法结果。 + // 调用:accMul(arg1,arg2) + // 返回值:arg1乘以arg2的精确结果 + function accMul(arg1, arg2) { + var s1 = arg1.toString(); + var s2 = arg2.toString(); + var m = 0; + try { + m += s1.split('.')[1].length; + } + catch(e) {} + try { + m += s2.split('.')[1].length; + } + catch(e) {} + + return (s1.replace('.', '') - 0) * (s2.replace('.', '') - 0) / Math.pow(10, m); + } + + // 加法函数,用来得到精确的加法结果 + // 说明:javascript的加法结果会有误差,在两个浮点数相加的时候会比较明显。这个函数返回较为精确的加法结果。 + // 调用:accAdd(arg1,arg2) + // 返回值:arg1加上arg2的精确结果 + function accAdd(arg1, arg2) { + var r1 = 0; + var r2 = 0; + try { + r1 = arg1.toString().split('.')[1].length; + } + catch(e) {} + try { + r2 = arg2.toString().split('.')[1].length; + } + catch(e) {} + + var m = Math.pow(10, Math.max(r1, r2)); + return (Math.round(arg1 * m) + Math.round(arg2 * m)) / m; + } + + //减法函数,用来得到精确的减法结果 + //说明:javascript的减法结果会有误差,在两个浮点数减法的时候会比较明显。这个函数返回较为精确的减法结果。 + //调用:accSub(arg1,arg2) + //返回值:arg1减法arg2的精确结果 + function accSub(arg1,arg2) { + return accAdd(arg1, -arg2); + } + + return { + accDiv : accDiv, + accMul : accMul, + accAdd : accAdd, + accSub : accSub + }; +}); +/** + * echarts图表基类 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon','../util/shape/MarkLine','../util/shape/Symbol','../config','../util/ecData','../util/ecAnimation','../util/ecEffect','../util/accMath','zrender/tool/util','zrender/tool/area'],function (require) { + // 图形依赖 + var ImageShape = require('zrender/shape/Image'); + var IconShape = require('../util/shape/Icon'); + var MarkLineShape = require('../util/shape/MarkLine'); + var SymbolShape = require('../util/shape/Symbol'); + + var ecConfig = require('../config'); + var ecData = require('../util/ecData'); + var ecAnimation = require('../util/ecAnimation'); + var ecEffect = require('../util/ecEffect'); + var accMath = require('../util/accMath'); + var zrUtil = require('zrender/tool/util'); + var zrArea = require('zrender/tool/area'); + + function Base(){ + var self = this; + this.selectedMap = {}; + this.lastShapeList = []; + this.shapeHandler = { + onclick: function () { + self.isClick = true; + }, + + ondragover: function (param) { + // 返回触发可计算特性的图形提示 + var calculableShape = param.target; + calculableShape.highlightStyle = calculableShape.highlightStyle || {}; + + // 备份特出特性 + var highlightStyle = calculableShape.highlightStyle; + var brushType = highlightStyle.brushTyep; + var strokeColor = highlightStyle.strokeColor; + var lineWidth = highlightStyle.lineWidth; + + highlightStyle.brushType = 'stroke'; + highlightStyle.strokeColor = self.ecTheme.calculableColor; + highlightStyle.lineWidth = calculableShape.type === 'icon' ? 30 : 10; + + self.zr.addHoverShape(calculableShape); + + setTimeout(function (){ + // 复位 + if (calculableShape.highlightStyle) { + calculableShape.highlightStyle.brushType = brushType; + calculableShape.highlightStyle.strokeColor = strokeColor; + calculableShape.highlightStyle.lineWidth = lineWidth; + } + },20); + }, + + ondrop: function (param) { + // 排除一些非数据的拖拽进入 + if (ecData.get(param.dragged, 'data') != null) { + self.isDrop = true; + } + }, + + ondragend: function () { + self.isDragend = true; + } + }; + } + + /** + * 基类方法 + */ + Base.prototype = { + /** + * 图形拖拽特性 + */ + setCalculable: function (shape) { + shape.dragEnableTime = this.ecTheme.DRAG_ENABLE_TIME; + shape.ondragover = this.shapeHandler.ondragover; + shape.ondragend = this.shapeHandler.ondragend; + shape.ondrop = this.shapeHandler.ondrop; + return shape; + }, + + /** + * 数据项被拖拽进来 + */ + ondrop: function (param, status) { + if (!this.isDrop || !param.target) { + // 没有在当前实例上发生拖拽行为则直接返回 + return; + } + var target = param.target; // 拖拽安放目标 + var dragged = param.dragged; // 当前被拖拽的图形对象 + + var seriesIndex = ecData.get(target, 'seriesIndex'); + var dataIndex = ecData.get(target, 'dataIndex'); + + var series = this.series; + var data; + var legend = this.component.legend; + if (dataIndex === -1) { + // 落到calculableCase上,数据被拖拽进某个饼图|雷达|漏斗,增加数据 + data = { + value: ecData.get(dragged, 'value'), + name: ecData.get(dragged, 'name') + }; + + // 修饼图数值不为负值 + if (this.type === ecConfig.CHART_TYPE_PIE && data.value < 0) { + data.value = 0; + } + + var hasFind = false; + var sData = series[seriesIndex].data; + for (var i = 0, l = sData.length; i < l; i++) { + if (sData[i].name === data.name && sData[i].value === '-') { + series[seriesIndex].data[i].value = data.value; + hasFind = true; + } + } + !hasFind && series[seriesIndex].data.push(data); + + legend && legend.add( + data.name, + dragged.style.color || dragged.style.strokeColor + ); + } + else { + // 落到数据item上,数据被拖拽到某个数据项上,数据修改 + data = this.option.series[seriesIndex].data[dataIndex] || '-'; + if (data.value != null) { + if (data.value != '-') { + this.option.series[seriesIndex].data[dataIndex].value = + accMath.accAdd( + this.option.series[seriesIndex].data[dataIndex].value, + ecData.get(dragged, 'value') + ); + } + else { + this.option.series[seriesIndex].data[dataIndex].value = + ecData.get(dragged, 'value'); + } + + if (this.type === ecConfig.CHART_TYPE_FUNNEL + || this.type === ecConfig.CHART_TYPE_PIE + ) { + legend && legend.getRelatedAmount(data.name) === 1 + && this.component.legend.del(data.name); + data.name += this.option.nameConnector + ecData.get(dragged, 'name'); + legend && legend.add( + data.name, + dragged.style.color || dragged.style.strokeColor + ); + } + } + else { + if (data != '-') { + this.option.series[seriesIndex].data[dataIndex] = + accMath.accAdd( + this.option.series[seriesIndex].data[dataIndex], + ecData.get(dragged, 'value') + ); + } + else { + this.option.series[seriesIndex].data[dataIndex] = + ecData.get(dragged, 'value'); + } + } + } + + // 别status = {}赋值啊!! + status.dragIn = status.dragIn || true; + + // 处理完拖拽事件后复位 + this.isDrop = false; + + var self = this; + setTimeout(function(){ + self.zr.trigger('mousemove', param.event); + }, 300); + + return; + }, + + /** + * 数据项被拖拽出去 + */ + ondragend: function (param, status) { + if (!this.isDragend || !param.target) { + // 没有在当前实例上发生拖拽行为则直接返回 + return; + } + var target = param.target; // 被拖拽图形元素 + + var seriesIndex = ecData.get(target, 'seriesIndex'); + var dataIndex = ecData.get(target, 'dataIndex'); + + var series = this.series; + + // 删除被拖拽走的数据 + if (series[seriesIndex].data[dataIndex].value != null) { + series[seriesIndex].data[dataIndex].value = '-'; + // 清理可能有且唯一的legend data + var name = series[seriesIndex].data[dataIndex].name; + if (this.component.legend + && this.component.legend.getRelatedAmount(name) === 0 + ) { + this.component.legend.del(name); + } + } + else { + series[seriesIndex].data[dataIndex] = '-'; + } + + // 别status = {}赋值啊!! + status.dragOut = true; + status.needRefresh = true; + + // 处理完拖拽事件后复位 + this.isDragend = false; + + return; + }, + + /** + * 图例选择 + */ + onlegendSelected: function (param, status) { + var legendSelected = param.selected; + for (var itemName in this.selectedMap) { + if (this.selectedMap[itemName] != legendSelected[itemName]) { + // 有一项不一致都需要重绘 + status.needRefresh = true; + } + this.selectedMap[itemName] = legendSelected[itemName]; + } + return; + }, + + /** + * 添加文本 + */ + addLabel: function (tarShape, serie, data, name, orient) { + // 多级控制 + var queryTarget = [data, serie]; + var nLabel = this.deepMerge(queryTarget, 'itemStyle.normal.label'); + var eLabel = this.deepMerge(queryTarget, 'itemStyle.emphasis.label'); + + var nTextStyle = nLabel.textStyle || {}; + var eTextStyle = eLabel.textStyle || {}; + + if (nLabel.show) { + tarShape.style.text = this._getLabelText( + serie, data, name, 'normal' + ); + tarShape.style.textPosition = nLabel.position == null + ? (orient === 'horizontal' ? 'right' : 'top') + : nLabel.position; + tarShape.style.textColor = nTextStyle.color; + tarShape.style.textFont = this.getFont(nTextStyle); + } + if (eLabel.show) { + tarShape.highlightStyle.text = this._getLabelText( + serie, data, name, 'emphasis' + ); + tarShape.highlightStyle.textPosition = nLabel.show + ? tarShape.style.textPosition + : (eLabel.position == null + ? (orient === 'horizontal' ? 'right' : 'top') + : eLabel.position); + tarShape.highlightStyle.textColor = eTextStyle.color; + tarShape.highlightStyle.textFont = this.getFont(eTextStyle); + } + + return tarShape; + }, + + /** + * 根据lable.format计算label text + */ + _getLabelText: function (serie, data, name, status) { + var formatter = this.deepQuery( + [data, serie], + 'itemStyle.' + status + '.label.formatter' + ); + if (!formatter && status === 'emphasis') { + // emphasis时需要看看normal下是否有formatter + formatter = this.deepQuery( + [data, serie], + 'itemStyle.normal.label.formatter' + ); + } + + var value = data != null + ? (data.value != null + ? data.value + : data) + : '-'; + + if (formatter) { + if (typeof formatter === 'function') { + return formatter.call( + this.myChart, + serie.name, + name, + value + ); + } + else if (typeof formatter === 'string') { + formatter = formatter.replace('{a}','{a0}') + .replace('{b}','{b0}') + .replace('{c}','{c0}'); + formatter = formatter.replace('{a0}', serie.name) + .replace('{b0}', name) + .replace('{c0}', value); + + return formatter; + } + } + else { + return value; + } + }, + + /** + * 标线标注 + */ + buildMark: function (seriesIndex) { + var serie = this.series[seriesIndex]; + if (this.selectedMap[serie.name]) { + serie.markPoint && this._buildMarkPoint(seriesIndex); + serie.markLine && this._buildMarkLine(seriesIndex); + } + }, + + /** + * 标注逻辑 + */ + _buildMarkPoint: function (seriesIndex) { + var attachStyle = (this.markAttachStyle || {})[seriesIndex]; + var serie = this.series[seriesIndex]; + var _zlevelBase = this.getZlevelBase(); + var mpData; + var pos; + var markPoint = zrUtil.clone(serie.markPoint); + for (var i = 0, l = markPoint.data.length; i < l; i++) { + mpData = markPoint.data[i]; + pos = this.getMarkCoord(seriesIndex, mpData); + markPoint.data[i].x = mpData.x != null ? mpData.x : pos[0]; + markPoint.data[i].y = mpData.y != null ? mpData.y : pos[1]; + if (mpData.type + && (mpData.type === 'max' || mpData.type === 'min') + ) { + // 特殊值内置支持 + markPoint.data[i].value = pos[3]; + markPoint.data[i].name = mpData.name || mpData.type; + markPoint.data[i].symbolSize = markPoint.data[i].symbolSize + || (zrArea.getTextWidth(pos[3], this.getFont()) / 2 + 5); + } + } + + var shapeList = this._markPoint(seriesIndex, markPoint); + + for (var i = 0, l = shapeList.length; i < l; i++) { + shapeList[i].zlevel = _zlevelBase + 1; + for (var key in attachStyle) { + shapeList[i][key] = zrUtil.clone(attachStyle[key]); + } + this.shapeList.push(shapeList[i]); + } + // 个别特殊图表需要自己addShape + if (this.type === ecConfig.CHART_TYPE_FORCE + || this.type === ecConfig.CHART_TYPE_CHORD + ) { + for (var i = 0, l = shapeList.length; i < l; i++) { + this.zr.addShape(shapeList[i]); + } + } + }, + + /** + * 标线逻辑 + */ + _buildMarkLine: function (seriesIndex) { + var attachStyle = (this.markAttachStyle || {})[seriesIndex]; + var serie = this.series[seriesIndex]; + var _zlevelBase = this.getZlevelBase(); + var mlData; + var pos; + var markLine = zrUtil.clone(serie.markLine); + for (var i = 0, l = markLine.data.length; i < l; i++) { + mlData = markLine.data[i]; + if (mlData.type + && (mlData.type === 'max' || mlData.type === 'min' || mlData.type === 'average') + ) { + // 特殊值内置支持 + pos = this.getMarkCoord(seriesIndex, mlData); + markLine.data[i] = [zrUtil.clone(mlData), {}]; + markLine.data[i][0].name = mlData.name || mlData.type; + markLine.data[i][0].value = pos[3]; + pos = pos[2]; + mlData = [{},{}]; + } + else { + pos = [ + this.getMarkCoord(seriesIndex, mlData[0]), + this.getMarkCoord(seriesIndex, mlData[1]) + ]; + } + + markLine.data[i][0].x = mlData[0].x != null ? mlData[0].x : pos[0][0]; + markLine.data[i][0].y = mlData[0].y != null ? mlData[0].y : pos[0][1]; + markLine.data[i][1].x = mlData[1].x != null ? mlData[1].x : pos[1][0]; + markLine.data[i][1].y = mlData[1].y != null ? mlData[1].y : pos[1][1]; + } + + var shapeList = this._markLine(seriesIndex, markLine); + + for (var i = 0, l = shapeList.length; i < l; i++) { + shapeList[i].zlevel = _zlevelBase + 1; + for (var key in attachStyle) { + shapeList[i][key] = zrUtil.clone(attachStyle[key]); + } + this.shapeList.push(shapeList[i]); + } + // 个别特殊图表需要自己addShape + if (this.type === ecConfig.CHART_TYPE_FORCE + || this.type === ecConfig.CHART_TYPE_CHORD + ) { + for (var i = 0, l = shapeList.length; i < l; i++) { + this.zr.addShape(shapeList[i]); + } + } + }, + + /** + * 标注多级控制构造 + */ + _markPoint: function (seriesIndex, mpOption) { + var serie = this.series[seriesIndex]; + var component = this.component; + zrUtil.merge( + mpOption, + this.ecTheme.markPoint + ); + mpOption.name = serie.name; + + var pList = []; + var data = mpOption.data; + var itemShape; + + var dataRange = component.dataRange; + var legend = component.legend; + var color; + var value; + var queryTarget; + var nColor; + var eColor; + var effect; + var zrWidth = this.zr.getWidth(); + var zrHeight = this.zr.getHeight(); + + if (!mpOption.large) { + for (var i = 0, l = data.length; i < l; i++) { + if (data[i].x == null || data[i].y == null) { + continue; + } + value = data[i] != null && data[i].value != null + ? data[i].value + : ''; + // 图例 + if (legend) { + color = legend.getColor(serie.name); + } + // 值域 + if (dataRange) { + color = isNaN(value) ? color : dataRange.getColor(value); + + queryTarget = [data[i], mpOption]; + nColor = this.deepQuery( + queryTarget, 'itemStyle.normal.color' + ) || color; + eColor = this.deepQuery( + queryTarget, 'itemStyle.emphasis.color' + ) || nColor; + // 有值域,并且值域返回null且用户没有自己定义颜色,则隐藏这个mark + if (nColor == null && eColor == null) { + continue; + } + } + + // 标准化一些参数 + data[i].tooltip = data[i].tooltip + || {trigger:'item'}; // tooltip.trigger指定为item + data[i].name = data[i].name != null ? data[i].name : ''; + data[i].value = value; + + // 复用getSymbolShape + itemShape = this.getSymbolShape( + mpOption, seriesIndex, // 系列 + data[i], i, data[i].name, // 数据 + this.parsePercent(data[i].x, zrWidth), // 坐标 + this.parsePercent(data[i].y, zrHeight), // 坐标 + 'pin', color, // 默认symbol和color + 'rgba(0,0,0,0)', + 'horizontal' // 走向,用于默认文字定位 + ); + itemShape._mark = 'point'; + + effect = this.deepMerge( + [data[i], mpOption], + 'effect' + ); + if (effect.show) { + itemShape.effect = effect; + } + + if (serie.type === ecConfig.CHART_TYPE_MAP) { + itemShape._geo = this.getMarkGeo(data[i]); + } + + // 重新pack一下数据 + ecData.pack( + itemShape, + serie, seriesIndex, + data[i], i, + data[i].name, + value + ); + pList.push(itemShape); + } + } + else { + // 大规模MarkPoint + itemShape = this.getLargeMarkPoingShape(seriesIndex, mpOption); + itemShape._mark = 'largePoint'; + itemShape && pList.push(itemShape); + } + return pList; + }, + + /** + * 标线多级控制构造 + */ + _markLine: function (seriesIndex, mlOption) { + var serie = this.series[seriesIndex]; + var component = this.component; + zrUtil.merge( + mlOption, + this.ecTheme.markLine + ); + // 标准化一些同时支持Array和String的参数 + mlOption.symbol = mlOption.symbol instanceof Array + ? mlOption.symbol.length > 1 + ? mlOption.symbol + : [mlOption.symbol[0], mlOption.symbol[0]] + : [mlOption.symbol, mlOption.symbol]; + mlOption.symbolSize = mlOption.symbolSize instanceof Array + ? mlOption.symbolSize.length > 1 + ? mlOption.symbolSize + : [mlOption.symbolSize[0], mlOption.symbolSize[0]] + : [mlOption.symbolSize, mlOption.symbolSize]; + mlOption.symbolRotate = mlOption.symbolRotate instanceof Array + ? mlOption.symbolRotate.length > 1 + ? mlOption.symbolRotate + : [mlOption.symbolRotate[0], mlOption.symbolRotate[0]] + : [mlOption.symbolRotate, mlOption.symbolRotate]; + + mlOption.name = serie.name; + + var pList = []; + var data = mlOption.data; + var itemShape; + + var dataRange = component.dataRange; + var legend = component.legend; + var color; + var value; + var queryTarget; + var nColor; + var eColor; + var effect; + var zrWidth = this.zr.getWidth(); + var zrHeight = this.zr.getHeight(); + var mergeData; + for (var i = 0, l = data.length; i < l; i++) { + if (data[i][0].x == null + || data[i][0].y == null + || data[i][1].x == null + || data[i][1].y == null + ) { + continue; + } + + // 图例 + if (legend) { + color = legend.getColor(serie.name); + } + // 组装一个mergeData + mergeData = this.deepMerge(data[i]); + value = mergeData != null && mergeData.value != null + ? mergeData.value + : ''; + // 值域 + if (dataRange) { + color = isNaN(value) ? color : dataRange.getColor(value); + + queryTarget = [mergeData, mlOption]; + nColor = this.deepQuery( + queryTarget, 'itemStyle.normal.color' + ) || color; + eColor = this.deepQuery( + queryTarget, 'itemStyle.emphasis.color' + ) || nColor; + // 有值域,并且值域返回null且用户没有自己定义颜色,则隐藏这个mark + if (nColor == null && eColor == null) { + continue; + } + } + + // 标准化一些参数 + data[i][0].tooltip = mergeData.tooltip + || {trigger:'item'}; // tooltip.trigger指定为item + data[i][0].name = data[i][0].name != null ? data[i][0].name : ''; + data[i][1].name = data[i][1].name != null ? data[i][1].name : ''; + data[i][0].value = data[i][0].value != null ? data[i][0].value : ''; + + itemShape = this.getLineMarkShape( + mlOption, // markLine + seriesIndex, + data[i], // 数据 + i, + this.parsePercent(data[i][0].x, zrWidth), // 坐标 + this.parsePercent(data[i][0].y, zrHeight), // 坐标 + this.parsePercent(data[i][1].x, zrWidth), // 坐标 + this.parsePercent(data[i][1].y, zrHeight), // 坐标 + color // 默认symbol和color + ); + itemShape._mark = 'line'; + + effect = this.deepMerge( + [mergeData, mlOption], + 'effect' + ); + if (effect.show) { + itemShape.effect = effect; + } + + if (serie.type === ecConfig.CHART_TYPE_MAP) { + itemShape._geo = [ + this.getMarkGeo(data[i][0]), + this.getMarkGeo(data[i][1]) + ]; + } + + // 重新pack一下数据 + ecData.pack( + itemShape, + serie, seriesIndex, + data[i][0], i, + data[i][0].name + (data[i][1].name !== '' // 不要帮我代码规范 + ? (' > ' + data[i][1].name) + : ''), + value + ); + pList.push(itemShape); + } + //console.log(pList); + return pList; + }, + + getMarkCoord: function () { + // 无转换位置 + return [0, 0]; + }, + + /** + * symbol构造器 + */ + getSymbolShape: function ( + serie, seriesIndex, // 系列 + data, dataIndex, name, // 数据 + x, y, // 坐标 + symbol, color, // 默认symbol和color,来自legend或dataRange全局分配 + emptyColor, // 折线的emptySymbol用白色填充 + orient // 走向,用于默认文字定位 + ) { + var queryTarget = [data, serie]; + var value = data != null + ? (data.value != null + ? data.value + : data) + : '-'; + + symbol = this.deepQuery(queryTarget, 'symbol') || symbol; + var symbolSize = this.deepQuery(queryTarget, 'symbolSize'); + symbolSize = typeof symbolSize === 'function' + ? symbolSize(value) + : symbolSize; + var symbolRotate = this.deepQuery(queryTarget, 'symbolRotate'); + + var normal = this.deepMerge( + queryTarget, + 'itemStyle.normal' + ); + var emphasis = this.deepMerge( + queryTarget, + 'itemStyle.emphasis' + ); + var nBorderWidth = normal.borderWidth != null + ? normal.borderWidth + : (normal.lineStyle && normal.lineStyle.width); + if (nBorderWidth == null) { + nBorderWidth = symbol.match('empty') ? 2 : 0; + } + var eBorderWidth = emphasis.borderWidth != null + ? emphasis.borderWidth + : (emphasis.lineStyle && emphasis.lineStyle.width); + if (eBorderWidth == null) { + eBorderWidth = nBorderWidth + 2; + } + + var itemShape = new IconShape({ + style: { + iconType: symbol.replace('empty', '').toLowerCase(), + x: x - symbolSize, + y: y - symbolSize, + width: symbolSize * 2, + height: symbolSize * 2, + brushType: 'both', + color: symbol.match('empty') + ? emptyColor + : (this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) + || color), + strokeColor: normal.borderColor + || this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) + || color, + lineWidth: nBorderWidth + }, + highlightStyle: { + color: symbol.match('empty') + ? emptyColor + : this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data), + strokeColor: emphasis.borderColor + || normal.borderColor + || this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) + || color, + lineWidth: eBorderWidth + }, + clickable: this.deepQuery(queryTarget, 'clickable') + }); + + if (symbol.match('image')) { + itemShape.style.image = + symbol.replace(new RegExp('^image:\\/\\/'), ''); + itemShape = new ImageShape({ + style: itemShape.style, + highlightStyle: itemShape.highlightStyle, + clickable: this.deepQuery(queryTarget, 'clickable') + }); + } + + if (symbolRotate != null) { + itemShape.rotation = [ + symbolRotate * Math.PI / 180, x, y + ]; + } + + if (symbol.match('star')) { + itemShape.style.iconType = 'star'; + itemShape.style.n = + (symbol.replace('empty', '').replace('star','') - 0) || 5; + } + + if (symbol === 'none') { + itemShape.invisible = true; + itemShape.hoverable = false; + } + + /* + if (this.deepQuery([data, serie, option], 'calculable')) { + this.setCalculable(itemShape); + itemShape.draggable = true; + } + */ + + itemShape = this.addLabel( + itemShape, + serie, data, name, + orient + ); + + if (symbol.match('empty')) { + if (itemShape.style.textColor == null) { + itemShape.style.textColor = itemShape.style.strokeColor; + } + if (itemShape.highlightStyle.textColor == null) { + itemShape.highlightStyle.textColor = + itemShape.highlightStyle.strokeColor; + } + } + + ecData.pack( + itemShape, + serie, seriesIndex, + data, dataIndex, + name + ); + + itemShape._x = x; + itemShape._y = y; + + itemShape._dataIndex = dataIndex; + itemShape._seriesIndex = seriesIndex; + + return itemShape; + }, + + /** + * 标线构造器 + */ + getLineMarkShape: function ( + mlOption, // 系列 + seriesIndex, // 系列索引 + data, // 数据 + dataIndex, // 数据索引 + xStart, yStart, // 坐标 + xEnd, yEnd, // 坐标 + color // 默认color,来自legend或dataRange全局分配 + ) { + var value0 = data[0] != null + ? (data[0].value != null + ? data[0].value + : data[0]) + : '-'; + var value1 = data[1] != null + ? (data[1].value != null + ? data[1].value + : data[1]) + : '-'; + var symbol = [ + this.query(data[0], 'symbol') || mlOption.symbol[0], + this.query(data[1], 'symbol') || mlOption.symbol[1] + ]; + var symbolSize = [ + this.query(data[0], 'symbolSize') || mlOption.symbolSize[0], + this.query(data[1], 'symbolSize') || mlOption.symbolSize[1] + ]; + symbolSize[0] = typeof symbolSize[0] === 'function' + ? symbolSize[0](value0) + : symbolSize[0]; + symbolSize[1] = typeof symbolSize[1] === 'function' + ? symbolSize[1](value1) + : symbolSize[1]; + var symbolRotate = [ + this.query(data[0], 'symbolRotate') || mlOption.symbolRotate[0], + this.query(data[1], 'symbolRotate') || mlOption.symbolRotate[1] + ]; + //console.log(symbol, symbolSize, symbolRotate); + + var queryTarget = [data[0], mlOption]; + var normal = this.deepMerge( + queryTarget, + 'itemStyle.normal' + ); + normal.color = this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data); + var emphasis = this.deepMerge( + queryTarget, + 'itemStyle.emphasis' + ); + emphasis.color = this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data); + + var nlineStyle = normal.lineStyle; + var elineStyle = emphasis.lineStyle; + + var nBorderWidth = nlineStyle.width; + if (nBorderWidth == null) { + nBorderWidth = normal.borderWidth; + } + var eBorderWidth = elineStyle.width; + if (eBorderWidth == null) { + eBorderWidth = emphasis.borderWidth != null + ? emphasis.borderWidth + : (nBorderWidth + 2); + } + + var itemShape = new MarkLineShape({ + style: { + smooth: mlOption.smooth ? 'spline' : false, + symbol: symbol, + symbolSize: symbolSize, + symbolRotate: symbolRotate, + // data: [data[0].name,data[1].name], + xStart: xStart, + yStart: yStart, // 坐标 + xEnd: xEnd, + yEnd: yEnd, // 坐标 + brushType: 'both', + lineType: nlineStyle.type, + shadowColor: nlineStyle.shadowColor + || nlineStyle.color + || normal.borderColor + || normal.color + || color, + shadowBlur: nlineStyle.shadowBlur, + shadowOffsetX: nlineStyle.shadowOffsetX, + shadowOffsetY: nlineStyle.shadowOffsetY, + color: normal.color || color, + strokeColor: nlineStyle.color + || normal.borderColor + || normal.color + || color, + lineWidth: nBorderWidth, + symbolBorderColor: normal.borderColor + || normal.color + || color, + symbolBorder: normal.borderWidth + }, + highlightStyle: { + shadowColor: elineStyle.shadowColor, + shadowBlur: elineStyle.shadowBlur, + shadowOffsetX: elineStyle.shadowOffsetX, + shadowOffsetY: elineStyle.shadowOffsetY, + color: emphasis.color|| normal.color || color, + strokeColor: elineStyle.color + || nlineStyle.color + || emphasis.borderColor + || normal.borderColor + || emphasis.color + || normal.color + || color, + lineWidth: eBorderWidth, + symbolBorderColor: emphasis.borderColor + || normal.borderColor + || emphasis.color + || normal.color + || color, + symbolBorder: emphasis.borderWidth == null + ? (normal.borderWidth + 2) + : (emphasis.borderWidth) + }, + clickable: this.deepQuery(queryTarget, 'clickable') + }); + + itemShape = this.addLabel( + itemShape, + mlOption, + data[0], + data[0].name + ' : ' + data[1].name + ); + + itemShape._x = xEnd; + itemShape._y = yEnd; + + return itemShape; + }, + + /** + * 大规模标注构造器 + */ + getLargeMarkPoingShape: function(seriesIndex, mpOption) { + var serie = this.series[seriesIndex]; + var component = this.component; + var data = mpOption.data; + var itemShape; + + var dataRange = component.dataRange; + var legend = component.legend; + var color; + var value; + var queryTarget = [data[0], mpOption]; + var nColor; + var eColor; + var effect; + + // 图例 + if (legend) { + color = legend.getColor(serie.name); + } + // 值域 + if (dataRange) { + value = data[0] != null + ? (data[0].value != null + ? data[0].value + : data[0]) + : '-'; + color = isNaN(value) ? color : dataRange.getColor(value); + + nColor = this.deepQuery( + queryTarget, 'itemStyle.normal.color' + ) || color; + eColor = this.deepQuery( + queryTarget, 'itemStyle.emphasis.color' + ) || nColor; + // 有值域,并且值域返回null且用户没有自己定义颜色,则隐藏这个mark + if (nColor == null && eColor == null) { + return; + } + } + color = this.deepMerge(queryTarget, 'itemStyle.normal').color + || color; + + var symbol = this.deepQuery(queryTarget, 'symbol') || 'circle'; + symbol = symbol.replace('empty', '').replace(/\d/g, ''); + + effect = this.deepMerge( + [data[0], mpOption], + 'effect' + ); + + var devicePixelRatio = window.devicePixelRatio || 1; + + //console.log(data) + itemShape = new SymbolShape({ + style: { + pointList: data, + color: color, + strokeColor: color, + shadowColor: effect.shadowColor || color, + shadowBlur: (effect.shadowBlur != null ? effect.shadowBlur : 8) + * devicePixelRatio, + size: this.deepQuery(queryTarget, 'symbolSize'), + iconType: symbol, + brushType: 'fill', + lineWidth:1 + }, + draggable: false, + hoverable: false + }); + + if (effect.show) { + itemShape.effect = effect; + } + + return itemShape; + }, + + backupShapeList: function () { + if (this.shapeList && this.shapeList.length > 0) { + this.lastShapeList = this.shapeList; + this.shapeList = []; + } + else { + this.lastShapeList = []; + } + }, + + addShapeList: function () { + var maxLenth = this.option.animationThreshold / (this.canvasSupported ? 2 : 4); + var lastShapeList = this.lastShapeList; + var shapeList = this.shapeList; + var duration = lastShapeList.length > 0 + ? 500 : this.query(this.option, 'animationDuration'); + var easing = this.query(this.option, 'animationEasing'); + var key; + var oldMap = {}; + var newMap = {}; + if (this.option.animation + && !this.option.renderAsImage + && shapeList.length < maxLenth + && !this.motionlessOnce + ) { + // 通过已有的shape做动画过渡 + for (var i = 0, l = lastShapeList.length; i < l; i++) { + key = this._getAnimationKey(lastShapeList[i]); + if (key.match('undefined')) { + this.zr.delShape(lastShapeList[i].id); // 非关键元素直接删除 + } + else { + key += lastShapeList[i].type; + oldMap[key] = lastShapeList[i]; + } + } + for (var i = 0, l = shapeList.length; i < l; i++) { + key = this._getAnimationKey(shapeList[i]); + if (key.match('undefined')) { + this.zr.addShape(shapeList[i]); // 非关键元素直接添加 + } + else { + key += shapeList[i].type; + newMap[key] = shapeList[i]; + } + } + + for (key in oldMap) { + if (!newMap[key]) { + // 新的没有 删除 + this.zr.delShape(oldMap[key].id); + } + } + for (key in newMap) { + if (oldMap[key]) { + // 新旧都有 动画过渡 + this.zr.delShape(oldMap[key].id); + this._animateMod(oldMap[key], newMap[key], duration, easing); + } + else { + // 新有旧没有 添加并动画过渡 + //this._animateAdd(newMap[key], duration, easing); + this._animateMod(false, newMap[key], duration, easing); + } + } + this.zr.refresh(); + this.animationEffect(); + } + else { + this.motionlessOnce = false; + // clear old + this.zr.delShape(lastShapeList); + // 直接添加 + for (var i = 0, l = shapeList.length; i < l; i++) { + this.zr.addShape(shapeList[i]); + } + } + }, + + _getAnimationKey: function(shape) { + if (this.type != ecConfig.CHART_TYPE_MAP) { + return ecData.get(shape, 'seriesIndex') + '_' + + ecData.get(shape, 'dataIndex') + + (shape._mark ? shape._mark : '') + + (this.type === ecConfig.CHART_TYPE_RADAR + ? ecData.get(shape, 'special') : ''); + } + else { + return ecData.get(shape, 'seriesIndex') + '_' + + ecData.get(shape, 'dataIndex') + + (shape._mark ? shape._mark : 'undefined'); + } + }, + + /** + * 动画过渡 + */ + _animateMod: function (oldShape, newShape, duration, easing) { + switch (newShape.type) { + case 'broken-line' : + case 'half-smooth-polygon' : + ecAnimation.pointList(this.zr, oldShape, newShape, duration, easing); + break; + case 'rectangle' : + ecAnimation.rectangle(this.zr, oldShape, newShape, duration, easing); + break; + case 'icon' : + ecAnimation.icon(this.zr, oldShape, newShape, duration, easing); + break; + case 'candle' : + if (duration > 500) { + ecAnimation.candle(this.zr, oldShape, newShape, duration, easing); + } + else { + this.zr.addShape(newShape); + } + break; + case 'ring' : + case 'sector' : + case 'circle' : + if (duration > 500) { + // 进入动画,加旋转 + ecAnimation.ring( + this.zr, + oldShape, + newShape, + duration + ((ecData.get(newShape, 'dataIndex') || 0) % 20 * 100), + easing + ); + } + else if (newShape.type === 'sector') { + ecAnimation.sector(this.zr, oldShape, newShape, duration, easing); + } + else { + this.zr.addShape(newShape); + } + break; + case 'text' : + ecAnimation.text(this.zr, oldShape, newShape, duration, easing); + break; + case 'polygon' : + if (duration > 500) { + ecAnimation.polygon(this.zr, oldShape, newShape, duration, easing); + } + else { + ecAnimation.pointList(this.zr, oldShape, newShape, duration, easing); + } + break; + case 'chord' : + ecAnimation.chord(this.zr, oldShape, newShape, duration, easing); + break; + case 'gauge-pointer' : + ecAnimation.gaugePointer(this.zr, oldShape, newShape, duration, easing); + break; + case 'mark-line' : + ecAnimation.markline(this.zr, oldShape, newShape, duration, easing); + break; + case 'line' : + ecAnimation.line(this.zr, oldShape, newShape, duration, easing); + break; + default : + this.zr.addShape(newShape); + break; + } + }, + + /** + * 标注动画 + * @param {number} duration 时长 + * @param {string=} easing 缓动效果 + * @param {Array=} addShapeList 指定特效对象,不知道默认使用this.shapeList + */ + animationMark: function (duration , easing, addShapeList) { + var shapeList = addShapeList || this.shapeList; + for (var i = 0, l = shapeList.length; i < l; i++) { + if (!shapeList[i]._mark) { + continue; + } + this._animateMod(false, shapeList[i], duration, easing); + } + this.animationEffect(addShapeList); + }, + + /** + * 特效动画 + * @param {Array=} addShapeList 指定特效对象,不知道默认使用this.shapeList + */ + animationEffect: function (addShapeList) { + !addShapeList && this.clearEffectShape(); + var shapeList = addShapeList || this.shapeList; + var zlevel = ecConfig.EFFECT_ZLEVEL; + if (this.canvasSupported) { + this.zr.modLayer( + zlevel, + { + motionBlur: true, + lastFrameAlpha: 0.95 + } + ); + } + var shape; + for (var i = 0, l = shapeList.length; i < l; i++) { + shape = shapeList[i]; + if (!(shape._mark && shape.effect && shape.effect.show && ecEffect[shape._mark]) + ) { + continue; + } + ecEffect[shape._mark](this.zr, this.effectList, shape, zlevel); + this.effectList[this.effectList.length - 1]._mark = shape._mark; + } + }, + + clearEffectShape: function (clearMotionBlur) { + if (this.zr && this.effectList && this.effectList.length > 0) { + clearMotionBlur && this.zr.modLayer( + ecConfig.EFFECT_ZLEVEL, + { motionBlur: false } + ); + this.zr.delShape(this.effectList); + } + this.effectList = []; + }, + + /** + * 动态标线标注添加 + * @param {number} seriesIndex 系列索引 + * @param {Object} markData 标线标注对象,支持多个 + * @param {string} markType 标线标注类型 + */ + addMark: function (seriesIndex, markData, markType) { + var serie = this.series[seriesIndex]; + if (this.selectedMap[serie.name]) { + var duration = 500; + var easing = this.query(this.option, 'animationEasing'); + // 备份,复用_buildMarkX + var oriMarkData = serie[markType].data; + var lastLength = this.shapeList.length; + + serie[markType].data = markData.data; + this['_build' + markType.replace('m', 'M')](seriesIndex); + if (this.option.animation && !this.option.renderAsImage) { + // animationMark就会addShape + this.animationMark(duration, easing, this.shapeList.slice(lastLength)); + } + else { + for (var i = lastLength, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + this.zr.refresh(); + } + // 还原,复用_buildMarkX + serie[markType].data = oriMarkData; + } + }, + + /** + * 动态标线标注删除 + * @param {number} seriesIndex 系列索引 + * @param {string} markName 标线标注名称 + * @param {string} markType 标线标注类型 + */ + delMark: function (seriesIndex, markName, markType) { + markType = markType.replace('mark', '').replace('large', '').toLowerCase(); + var serie = this.series[seriesIndex]; + if (this.selectedMap[serie.name]) { + var needRefresh = false; + var shapeList = [this.shapeList, this.effectList]; + var len = 2; + while(len--) { + for (var i = 0, l = shapeList[len].length; i < l; i++) { + if (shapeList[len][i]._mark === markType + && ecData.get(shapeList[len][i], 'seriesIndex') === seriesIndex + && ecData.get(shapeList[len][i], 'name') === markName + ) { + this.zr.delShape(shapeList[len][i].id); + shapeList[len].splice(i, 1); + needRefresh = true; + break; + } + } + } + + needRefresh && this.zr.refresh(); + } + } + }; + + return Base; +}); + +/** + * echart图表库 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + */ +define('echarts/chart',[],function (/*require*/) { //chart + var self = {}; + + var _chartLibrary = {}; //echart图表库 + + /** + * 定义图形实现 + * @param {Object} name + * @param {Object} clazz 图形实现 + */ + self.define = function (name, clazz) { + _chartLibrary[name] = clazz; + return self; + }; + + /** + * 获取图形实现 + * @param {Object} name + */ + self.get = function (name) { + return _chartLibrary[name]; + }; + + return self; +}); +/** + * echarts组件:孤岛数据 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/chart/island',['require','../component/base','./base','zrender/shape/Circle','../config','../util/ecData','zrender/tool/util','zrender/tool/event','zrender/tool/color','../util/accMath','../chart'],function (require) { + var ComponentBase = require('../component/base'); + var ChartBase = require('./base'); + + // 图形依赖 + var CircleShape = require('zrender/shape/Circle'); + + var ecConfig = require('../config'); + var ecData = require('../util/ecData'); + var zrUtil = require('zrender/tool/util'); + var zrEvent = require('zrender/tool/event'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} option 图表选项 + */ + function Island(ecTheme, messageCenter, zr, option, myChart) { + // 基类 + ComponentBase.call(this, ecTheme, messageCenter, zr, {}, myChart); + // 图表基类 + ChartBase.call(this); + + this._nameConnector; + this._valueConnector; + this._zrHeight = this.zr.getHeight(); + this._zrWidth = this.zr.getWidth(); + + var self = this; + /** + * 滚轮改变孤岛数据值 + */ + self.shapeHandler.onmousewheel = function (param) { + var shape = param.target; + + var event = param.event; + var delta = zrEvent.getDelta(event); + delta = delta > 0 ? (-1) : 1; + shape.style.r -= delta; + shape.style.r = shape.style.r < 5 ? 5 : shape.style.r; + + var value = ecData.get(shape, 'value'); + var dvalue = value * self.option.island.calculateStep; + if (dvalue > 1) { + value = Math.round(value - dvalue * delta); + } + else { + value = (value - dvalue * delta).toFixed(2) - 0; + } + + var name = ecData.get(shape, 'name'); + shape.style.text = name + ':' + value; + + ecData.set(shape, 'value', value); + ecData.set(shape, 'name', name); + + self.zr.modShape(shape.id); + self.zr.refresh(); + zrEvent.stop(event); + }; + } + + Island.prototype = { + type: ecConfig.CHART_TYPE_ISLAND, + /** + * 孤岛合并 + * + * @param {string} tarShapeIndex 目标索引 + * @param {Object} srcShape 源目标,合入目标后删除 + */ + _combine: function (tarShape, srcShape) { + var zrColor = require('zrender/tool/color'); + var accMath = require('../util/accMath'); + var value = accMath.accAdd( + ecData.get(tarShape, 'value'), + ecData.get(srcShape, 'value') + ); + var name = ecData.get(tarShape, 'name') + + this._nameConnector + + ecData.get(srcShape, 'name'); + + tarShape.style.text = name + this._valueConnector + value; + + ecData.set(tarShape, 'value', value); + ecData.set(tarShape, 'name', name); + tarShape.style.r = this.option.island.r; + tarShape.style.color = zrColor.mix( + tarShape.style.color, + srcShape.style.color + ); + }, + + /** + * 刷新 + */ + refresh: function (newOption) { + if (newOption) { + newOption.island = this.reformOption(newOption.island); + this.option = newOption; + + this._nameConnector = this.option.nameConnector; + this._valueConnector = this.option.valueConnector; + } + }, + + getOption: function () { + return this.option; + }, + + resize: function () { + var newWidth = this.zr.getWidth(); + var newHieght = this.zr.getHeight(); + var xScale = newWidth / (this._zrWidth || newWidth); + var yScale = newHieght / (this._zrHeight || newHieght); + if (xScale === 1 && yScale === 1) { + return; + } + this._zrWidth = newWidth; + this._zrHeight = newHieght; + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.modShape( + this.shapeList[i].id, + { + style: { + x: Math.round(this.shapeList[i].style.x * xScale), + y: Math.round(this.shapeList[i].style.y * yScale) + } + } + ); + } + }, + + add: function (shape) { + var name = ecData.get(shape, 'name'); + var value = ecData.get(shape, 'value'); + var seriesName = ecData.get(shape, 'series') != null + ? ecData.get(shape, 'series').name + : ''; + var font = this.getFont(this.option.island.textStyle); + var islandShape = { + zlevel: this._zlevelBase, + style: { + x: shape.style.x, + y: shape.style.y, + r: this.option.island.r, + color: shape.style.color || shape.style.strokeColor, + text: name + this._valueConnector + value, + textFont: font + }, + draggable: true, + hoverable: true, + onmousewheel: this.shapeHandler.onmousewheel, + _type: 'island' + }; + if (islandShape.style.color === '#fff') { + islandShape.style.color = shape.style.strokeColor; + } + this.setCalculable(islandShape); + islandShape.dragEnableTime = 0; + ecData.pack( + islandShape, + {name:seriesName}, -1, + value, -1, + name + ); + islandShape = new CircleShape(islandShape); + this.shapeList.push(islandShape); + this.zr.addShape(islandShape); + }, + + del: function (shape) { + this.zr.delShape(shape.id); + var newShapeList = []; + for (var i = 0, l = this.shapeList.length; i < l; i++) { + if (this.shapeList[i].id != shape.id) { + newShapeList.push(this.shapeList[i]); + } + } + this.shapeList = newShapeList; + }, + + /** + * 数据项被拖拽进来, 重载基类方法 + */ + ondrop: function (param, status) { + if (!this.isDrop || !param.target) { + // 没有在当前实例上发生拖拽行为则直接返回 + return; + } + // 拖拽产生孤岛数据合并 + var target = param.target; // 拖拽安放目标 + var dragged = param.dragged; // 当前被拖拽的图形对象 + + this._combine(target, dragged); + this.zr.modShape(target.id); + + status.dragIn = true; + + // 处理完拖拽事件后复位 + this.isDrop = false; + + return; + }, + + /** + * 数据项被拖拽出去, 重载基类方法 + */ + ondragend: function (param, status) { + var target = param.target; // 拖拽安放目标 + if (!this.isDragend) { + // 拖拽的不是孤岛数据,如果没有图表接受孤岛数据,需要新增孤岛数据 + if (!status.dragIn) { + target.style.x = zrEvent.getX(param.event); + target.style.y = zrEvent.getY(param.event); + this.add(target); + status.needRefresh = true; + } + } + else { + // 拖拽的是孤岛数据,如果有图表接受了孤岛数据,需要删除孤岛数据 + if (status.dragIn) { + this.del(target); + status.needRefresh = true; + } + } + + // 处理完拖拽事件后复位 + this.isDragend = false; + + return; + } + }; + + zrUtil.inherits(Island, ChartBase); + zrUtil.inherits(Island, ComponentBase); + + // 图表注册 + require('../chart').define('island', Island); + + return Island; +}); +/** + * echart组件库 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/component',[],function (/*require*/) { // component + var self = {}; + + var _componentLibrary = {}; // echart组件库 + + /** + * 定义图形实现 + * @param {Object} name + * @param {Object} clazz 图形实现 + */ + self.define = function (name, clazz) { + _componentLibrary[name] = clazz; + return self; + }; + + /** + * 获取图形实现 + * @param {Object} name + */ + self.get = function (name) { + return _componentLibrary[name]; + }; + + return self; +}); +/** + * echarts组件:提示框 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/component/dataView',['require','./base','../config','zrender/tool/util','../component'],function (require) { + var Base = require('./base'); + + var ecConfig = require('../config'); + var zrUtil = require('zrender/tool/util'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} option 提示框参数 + * @param {HtmlElement} dom 目标对象 + */ + function DataView(ecTheme, messageCenter, zr, option, myChart) { + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + + this.dom = myChart.dom; + + // dataview dom & css + this._tDom = document.createElement('div'); + this._textArea = document.createElement('textArea'); + this._buttonRefresh = document.createElement('button'); + this._buttonClose = document.createElement('button'); + this._hasShow = false; + + // 缓存一些高宽数据 + this._zrHeight = zr.getHeight(); + this._zrWidth = zr.getWidth(); + + this._tDom.className = 'echarts-dataview', + this.hide(); + this.dom.firstChild.appendChild(this._tDom); + + if (window.addEventListener) { + this._tDom.addEventListener('click', this._stop); + this._tDom.addEventListener('mousewheel', this._stop); + this._tDom.addEventListener('mousemove', this._stop); + this._tDom.addEventListener('mousedown', this._stop); + this._tDom.addEventListener('mouseup', this._stop); + + // mobile支持 + this._tDom.addEventListener('touchstart', this._stop); + this._tDom.addEventListener('touchmove', this._stop); + this._tDom.addEventListener('touchend', this._stop); + } + else { + this._tDom.attachEvent('onclick', this._stop); + this._tDom.attachEvent('onmousewheel', this._stop); + this._tDom.attachEvent('onmousemove', this._stop); + this._tDom.attachEvent('onmousedown', this._stop); + this._tDom.attachEvent('onmouseup', this._stop); + } + } + + DataView.prototype = { + type : ecConfig.COMPONENT_TYPE_DATAVIEW, + _lang : ['Data View', 'close', 'refresh'], + // 通用样式 + _gCssText : 'position:absolute;' + + 'display:block;' + + 'overflow:hidden;' + + 'transition:height 0.8s,background-color 1s;' + + '-moz-transition:height 0.8s,background-color 1s;' + + '-webkit-transition:height 0.8s,background-color 1s;' + + '-o-transition:height 0.8s,background-color 1s;' + + 'z-index:1;' + + 'left:0;' + + 'top:0;', + hide : function () { + this._sizeCssText = 'width:' + this._zrWidth + 'px;' + + 'height:' + 0 + 'px;' + + 'background-color:#f0ffff;'; + this._tDom.style.cssText = this._gCssText + this._sizeCssText; + // 这是个很恶心的事情 + /* + this.dom.onselectstart = function () { + return false; + }; + */ + }, + + show : function (newOption) { + this._hasShow = true; + var lang = this.query(this.option, 'toolbox.feature.dataView.lang') + || this._lang; + + this.option = newOption; + + this._tDom.innerHTML = '

' + + (lang[0] || this._lang[0]) + + '

'; + + this._textArea.style.cssText = + 'display:block;margin:0 0 8px 0;padding:4px 6px;overflow:auto;' + + 'width:' + (this._zrWidth - 15) + 'px;' + + 'height:' + (this._zrHeight - 100) + 'px;'; + var customContent = this.query( + this.option, 'toolbox.feature.dataView.optionToContent' + ); + if (typeof customContent != 'function') { + this._textArea.value = this._optionToContent(); + } + else { + this._textArea.value = customContent(this.option); + } + this._tDom.appendChild(this._textArea); + + this._buttonClose.style.cssText = 'float:right;padding:1px 6px;'; + this._buttonClose.innerHTML = lang[1] || this._lang[1]; + var self = this; + this._buttonClose.onclick = function (){ + self.hide(); + }; + this._tDom.appendChild(this._buttonClose); + + if (this.query(this.option, 'toolbox.feature.dataView.readOnly') + === false + ) { + this._buttonRefresh.style.cssText = + 'float:right;margin-right:10px;padding:1px 6px;'; + this._buttonRefresh.innerHTML = lang[2] || this._lang[2]; + this._buttonRefresh.onclick = function (){ + self._save(); + }; + this._tDom.appendChild(this._buttonRefresh); + this._textArea.readOnly = false; + this._textArea.style.cursor = 'default'; + } + else { + this._textArea.readOnly = true; + this._textArea.style.cursor = 'text'; + } + + this._sizeCssText = 'width:' + this._zrWidth + 'px;' + + 'height:' + this._zrHeight + 'px;' + + 'background-color:#fff;'; + this._tDom.style.cssText = this._gCssText + this._sizeCssText; + // 这是个很恶心的事情 + /* + this.dom.onselectstart = function () { + return true; + }; + */ + }, + + _optionToContent : function () { + var i; + var j; + var k; + var len; + var data; + var valueList; + var axisList = []; + var content = ''; + if (this.option.xAxis) { + if (this.option.xAxis instanceof Array) { + axisList = this.option.xAxis; + } else { + axisList = [this.option.xAxis]; + } + for (i = 0, len = axisList.length; i < len; i++) { + // 横纵默认为类目 + if ((axisList[i].type || 'category') == 'category') { + valueList = []; + for (j = 0, k = axisList[i].data.length; j < k; j++) { + data = axisList[i].data[j]; + valueList.push( + typeof data.value != 'undefined' + ? data.value : data + ); + } + content += valueList.join(', ') + '\n\n'; + } + } + } + + if (this.option.yAxis) { + if (this.option.yAxis instanceof Array) { + axisList = this.option.yAxis; + } else { + axisList = [this.option.yAxis]; + } + for (i = 0, len = axisList.length; i < len; i++) { + if (axisList[i].type == 'category') { + valueList = []; + for (j = 0, k = axisList[i].data.length; j < k; j++) { + data = axisList[i].data[j]; + valueList.push( + typeof data.value != 'undefined' + ? data.value : data + ); + } + content += valueList.join(', ') + '\n\n'; + } + } + } + + var series = this.option.series; + var itemName; + for (i = 0, len = series.length; i < len; i++) { + valueList = []; + for (j = 0, k = series[i].data.length; j < k; j++) { + data = series[i].data[j]; + if (series[i].type == ecConfig.CHART_TYPE_PIE + || series[i].type == ecConfig.CHART_TYPE_MAP + ) { + itemName = (data.name || '-') + ':'; + } + else { + itemName = ''; + } + + if (series[i].type == ecConfig.CHART_TYPE_SCATTER) { + data = typeof data.value != 'undefined' + ? data.value + : data; + data = data.join(', '); + } + valueList.push( + itemName + + (typeof data.value != 'undefined' ? data.value : data) + ); + } + content += (series[i].name || '-') + ' : \n'; + content += valueList.join( + series[i].type == ecConfig.CHART_TYPE_SCATTER ? '\n': ', ' + ); + content += '\n\n'; + } + + return content; + }, + + _save : function () { + var text = this._textArea.value; + var customContent = this.query( + this.option, 'toolbox.feature.dataView.contentToOption' + ); + if (typeof customContent != 'function') { + text = text.split('\n'); + var content = []; + for (var i = 0, l = text.length; i < l; i++) { + text[i] = this._trim(text[i]); + if (text[i] !== '') { + content.push(text[i]); + } + } + this._contentToOption(content); + } + else { + customContent(text, this.option); + } + + this.hide(); + + var self = this; + setTimeout( + function (){ + self.messageCenter && self.messageCenter.dispatch( + ecConfig.EVENT.DATA_VIEW_CHANGED, + null, + {option : self.option}, + self.myChart + ); + }, + // 有动画,所以高级浏览器时间更长点 + self.canvasSupported ? 800 : 100 + ); + }, + + _contentToOption : function (content) { + var i; + var j; + var k; + var len; + var data; + var axisList = []; + + var contentIdx = 0; + var contentValueList; + var value; + + if (this.option.xAxis) { + if (this.option.xAxis instanceof Array) { + axisList = this.option.xAxis; + } else { + axisList = [this.option.xAxis]; + } + for (i = 0, len = axisList.length; i < len; i++) { + // 横纵默认为类目 + if ((axisList[i].type || 'category') == 'category' + ) { + contentValueList = content[contentIdx].split(','); + for (j = 0, k = axisList[i].data.length; j < k; j++) { + value = this._trim(contentValueList[j] || ''); + data = axisList[i].data[j]; + if (typeof axisList[i].data[j].value != 'undefined' + ) { + axisList[i].data[j].value = value; + } + else { + axisList[i].data[j] = value; + } + } + contentIdx++; + } + } + } + + if (this.option.yAxis) { + if (this.option.yAxis instanceof Array) { + axisList = this.option.yAxis; + } else { + axisList = [this.option.yAxis]; + } + for (i = 0, len = axisList.length; i < len; i++) { + if (axisList[i].type == 'category') { + contentValueList = content[contentIdx].split(','); + for (j = 0, k = axisList[i].data.length; j < k; j++) { + value = this._trim(contentValueList[j] || ''); + data = axisList[i].data[j]; + if (typeof axisList[i].data[j].value != 'undefined' + ) { + axisList[i].data[j].value = value; + } + else { + axisList[i].data[j] = value; + } + } + contentIdx++; + } + } + } + + var series = this.option.series; + for (i = 0, len = series.length; i < len; i++) { + contentIdx++; + if (series[i].type == ecConfig.CHART_TYPE_SCATTER) { + for (var j = 0, k = series[i].data.length; j < k; j++) { + contentValueList = content[contentIdx]; + value = contentValueList.replace(' ','').split(','); + if (typeof series[i].data[j].value != 'undefined' + ) { + series[i].data[j].value = value; + } + else { + series[i].data[j] = value; + } + contentIdx++; + } + } + else { + contentValueList = content[contentIdx].split(','); + for (var j = 0, k = series[i].data.length; j < k; j++) { + value = (contentValueList[j] || '').replace(/.*:/,''); + value = this._trim(value); + value = (value != '-' && value !== '') + ? (value - 0) + : '-'; + if (typeof series[i].data[j].value != 'undefined' + ) { + series[i].data[j].value = value; + } + else { + series[i].data[j] = value; + } + } + contentIdx++; + } + } + }, + + _trim : function (str){ + var trimer = new RegExp( + '(^[\\s\\t\\xa0\\u3000]+)|([\\u3000\\xa0\\s\\t]+\x24)', 'g' + ); + return str.replace(trimer, ''); + }, + + // 阻塞zrender事件 + _stop : function (e){ + e = e || window.event; + if (e.stopPropagation) { + e.stopPropagation(); + } + else { + e.cancelBubble = true; + } + }, + + /** + * zrender事件响应:窗口大小改变 + */ + resize : function () { + this._zrHeight = this.zr.getHeight(); + this._zrWidth = this.zr.getWidth(); + if (this._tDom.offsetHeight > 10) { + this._sizeCssText = 'width:' + this._zrWidth + 'px;' + + 'height:' + this._zrHeight + 'px;' + + 'background-color:#fff;'; + this._tDom.style.cssText = this._gCssText + this._sizeCssText; + this._textArea.style.cssText = 'display:block;margin:0 0 8px 0;' + + 'padding:4px 6px;overflow:auto;' + + 'width:' + (this._zrWidth - 15) + 'px;' + + 'height:' + (this._zrHeight - 100) + 'px;'; + } + }, + + /** + * 释放后实例不可用,重载基类方法 + */ + dispose : function () { + if (window.removeEventListener) { + this._tDom.removeEventListener('click', this._stop); + this._tDom.removeEventListener('mousewheel', this._stop); + this._tDom.removeEventListener('mousemove', this._stop); + this._tDom.removeEventListener('mousedown', this._stop); + this._tDom.removeEventListener('mouseup', this._stop); + + // mobile支持 + this._tDom.removeEventListener('touchstart', this._stop); + this._tDom.removeEventListener('touchmove', this._stop); + this._tDom.removeEventListener('touchend', this._stop); + } + else { + this._tDom.detachEvent('onclick', this._stop); + this._tDom.detachEvent('onmousewheel', this._stop); + this._tDom.detachEvent('onmousemove', this._stop); + this._tDom.detachEvent('onmousedown', this._stop); + this._tDom.detachEvent('onmouseup', this._stop); + } + + this._buttonRefresh.onclick = null; + this._buttonClose.onclick = null; + + if (this._hasShow) { + this._tDom.removeChild(this._textArea); + this._tDom.removeChild(this._buttonRefresh); + this._tDom.removeChild(this._buttonClose); + } + + this._textArea = null; + this._buttonRefresh = null; + this._buttonClose = null; + + this.dom.firstChild.removeChild(this._tDom); + this._tDom = null; + } + }; + + zrUtil.inherits(DataView, Base); + + require('../component').define('dataView', DataView); + + return DataView; +}); +/** + * echarts组件:工具箱 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zrender/shape/Image','zrender/shape/Rectangle','../util/shape/Icon','../config','zrender/tool/util','zrender/config','zrender/tool/event','./dataView','../component'],function (require) { + var Base = require('./base'); + + // 图形依赖 + var LineShape = require('zrender/shape/Line'); + var ImageShape = require('zrender/shape/Image'); + var RectangleShape = require('zrender/shape/Rectangle'); + var IconShape = require('../util/shape/Icon'); + + var ecConfig = require('../config'); + var zrUtil = require('zrender/tool/util'); + var zrConfig = require('zrender/config'); + var zrEvent = require('zrender/tool/event'); + + var _MAGICTYPE_STACK = 'stack'; + var _MAGICTYPE_TILED = 'tiled'; + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {HtmlElement} dom 目标对象 + * @param {ECharts} myChart 当前图表实例 + */ + function Toolbox(ecTheme, messageCenter, zr, option, myChart) { + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + + this.dom = myChart.dom; + + this._magicType = {}; + this._magicMap = {}; + this._isSilence = false; + + this._iconList; + this._iconShapeMap = {}; + //this._itemGroupLocation; + this._featureTitle = {}; // 文字 + this._featureIcon = {}; // 图标 + this._featureColor = {}; // 颜色 + this._enableColor = 'red'; + this._disableColor = '#ccc'; + // this._markStart; + // this._marking; + // this._markShape; + // this._zoomStart; + // this._zooming; + // this._zoomShape; + // this._zoomQueue; + // this._dataView; + this._markShapeList = []; + var self = this; + self._onMark = function (param) { + self.__onMark(param); + }; + self._onMarkUndo = function (param) { + self.__onMarkUndo(param); + }; + self._onMarkClear = function (param) { + self.__onMarkClear(param); + }; + self._onDataZoom = function (param) { + self.__onDataZoom(param); + }; + self._onDataZoomReset = function (param) { + self.__onDataZoomReset(param); + }; + self._onDataView = function (param) { + self.__onDataView(param); + }; + self._onRestore = function (param) { + self.__onRestore(param); + }; + self._onSaveAsImage = function (param) { + self.__onSaveAsImage(param); + }; + self._onMagicType = function (param) { + self.__onMagicType(param); + }; + self._onCustomHandler = function (param) { + self.__onCustomHandler(param); + }; + self._onmousemove = function (param) { + return self.__onmousemove(param); + }; + + self._onmousedown = function (param) { + return self.__onmousedown(param); + }; + + self._onmouseup = function (param) { + return self.__onmouseup(param); + }; + + self._onclick = function (param) { + return self.__onclick(param); + }; + } + + Toolbox.prototype = { + type: ecConfig.COMPONENT_TYPE_TOOLBOX, + _buildShape: function () { + this._iconList = []; + var toolboxOption = this.option.toolbox; + this._enableColor = toolboxOption.effectiveColor; + this._disableColor = toolboxOption.disableColor; + var feature = toolboxOption.feature; + var iconName = []; + for (var key in feature){ + if (feature[key].show) { + switch (key) { + case 'mark' : + iconName.push({ key: key, name: 'mark' }); + iconName.push({ key: key, name: 'markUndo' }); + iconName.push({ key: key, name: 'markClear' }); + break; + case 'magicType' : + for (var i = 0, l = feature[key].type.length; i < l; i++) { + feature[key].title[feature[key].type[i] + 'Chart'] + = feature[key].title[feature[key].type[i]]; + iconName.push({ key: key, name: feature[key].type[i] + 'Chart' }); + } + break; + case 'dataZoom' : + iconName.push({ key: key, name: 'dataZoom' }); + iconName.push({ key: key, name: 'dataZoomReset' }); + break; + case 'saveAsImage' : + if (this.canvasSupported) { + iconName.push({ key: key, name: 'saveAsImage' }); + } + break; + default : + iconName.push({ key: key, name: key }); + break; + } + } + } + if (iconName.length > 0) { + var name; + var key; + for (var i = 0, l = iconName.length; i < l; i++) { + name = iconName[i].name; + key = iconName[i].key; + this._iconList.push(name); + this._featureTitle[name] = feature[key].title[name] || feature[key].title; + if (feature[key].icon) { + this._featureIcon[name] = feature[key].icon[name] || feature[key].icon; + } + if (feature[key].color) { + this._featureColor[name] = feature[key].color[name] || feature[key].color; + } + } + this._itemGroupLocation = this._getItemGroupLocation(); + + this._buildBackground(); + this._buildItem(); + + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + if (this._iconShapeMap['mark']) { + this._iconDisable(this._iconShapeMap['markUndo']); + this._iconDisable(this._iconShapeMap['markClear']); + } + if (this._iconShapeMap['dataZoomReset'] && this._zoomQueue.length === 0) { + this._iconDisable(this._iconShapeMap['dataZoomReset']); + } + } + }, + + /** + * 构建所有图例元素 + */ + _buildItem: function () { + var toolboxOption = this.option.toolbox; + var iconLength = this._iconList.length; + var lastX = this._itemGroupLocation.x; + var lastY = this._itemGroupLocation.y; + var itemSize = toolboxOption.itemSize; + var itemGap = toolboxOption.itemGap; + var itemShape; + + var color = toolboxOption.color instanceof Array + ? toolboxOption.color : [toolboxOption.color]; + + var textFont = this.getFont(toolboxOption.textStyle); + var textPosition; + var textAlign; + var textBaseline; + if (toolboxOption.orient === 'horizontal') { + textPosition = this._itemGroupLocation.y / this.zr.getHeight() < 0.5 + ? 'bottom' : 'top'; + textAlign = this._itemGroupLocation.x / this.zr.getWidth() < 0.5 + ? 'left' : 'right'; + textBaseline = this._itemGroupLocation.y / this.zr.getHeight() < 0.5 + ? 'top' : 'bottom'; + } + else { + textPosition = this._itemGroupLocation.x / this.zr.getWidth() < 0.5 + ? 'right' : 'left'; + /* + textAlign = this._itemGroupLocation.x / this.zr.getWidth() < 0.5 + ? 'right' : 'left'; + textBaseline = 'top'; + */ + } + + this._iconShapeMap = {}; + var self = this; + + for (var i = 0; i < iconLength; i++) { + // 图形 + itemShape = { + type: 'icon', + zlevel: this._zlevelBase, + style: { + x: lastX, + y: lastY, + width: itemSize, + height: itemSize, + iconType: this._iconList[i], + lineWidth: 1, + strokeColor: this._featureColor[this._iconList[i]] + || color[i % color.length], + brushType: 'stroke' + }, + highlightStyle: { + lineWidth: 1, + text: toolboxOption.showTitle + ? this._featureTitle[this._iconList[i]] + : undefined, + textFont: textFont, + textPosition: textPosition, + strokeColor: this._featureColor[this._iconList[i]] + || color[i % color.length] + }, + hoverable: true, + clickable: true + }; + + if (this._featureIcon[this._iconList[i]]) { + itemShape.style.image = this._featureIcon[this._iconList[i]].replace( + new RegExp('^image:\\/\\/'), '' + ); + itemShape.style.opacity = 0.8; + itemShape.highlightStyle.opacity = 1; + itemShape.type = 'image'; + } + + if (toolboxOption.orient === 'horizontal') { + // 修正左对齐第一个或右对齐最后一个 + if (i === 0 && textAlign === 'left') { + itemShape.highlightStyle.textPosition = 'specific'; + itemShape.highlightStyle.textAlign = textAlign; + itemShape.highlightStyle.textBaseline = textBaseline; + itemShape.highlightStyle.textX = lastX; + itemShape.highlightStyle.textY = textBaseline === 'top' + ? lastY + itemSize + 10 + : lastY - 10; + } + if (i === iconLength - 1 && textAlign === 'right') { + itemShape.highlightStyle.textPosition = 'specific'; + itemShape.highlightStyle.textAlign = textAlign; + itemShape.highlightStyle.textBaseline = textBaseline; + itemShape.highlightStyle.textX = lastX + itemSize; + itemShape.highlightStyle.textY = textBaseline === 'top' + ? lastY + itemSize + 10 + : lastY - 10; + } + } + + switch(this._iconList[i]) { + case 'mark': + itemShape.onclick = self._onMark; + break; + case 'markUndo': + itemShape.onclick = self._onMarkUndo; + break; + case 'markClear': + itemShape.onclick = self._onMarkClear; + break; + case 'dataZoom': + itemShape.onclick = self._onDataZoom; + break; + case 'dataZoomReset': + itemShape.onclick = self._onDataZoomReset; + break; + case 'dataView' : + if (!this._dataView) { + var DataView = require('./dataView'); + this._dataView = new DataView( + this.ecTheme, this.messageCenter, this.zr, this.option, this.myChart + ); + } + itemShape.onclick = self._onDataView; + break; + case 'restore': + itemShape.onclick = self._onRestore; + break; + case 'saveAsImage': + itemShape.onclick = self._onSaveAsImage; + break; + default: + if (this._iconList[i].match('Chart')) { + itemShape._name = this._iconList[i].replace('Chart', ''); + /* + if (this._magicType[itemShape._name]) { + itemShape.style.strokeColor = this._enableColor; + } + */ + itemShape.onclick = self._onMagicType; + } + else { + itemShape.onclick = self._onCustomHandler; + } + break; + } + + if (itemShape.type === 'icon') { + itemShape = new IconShape(itemShape); + } + else if (itemShape.type === 'image') { + itemShape = new ImageShape(itemShape); + } + this.shapeList.push(itemShape); + this._iconShapeMap[this._iconList[i]] = itemShape; + + if (toolboxOption.orient === 'horizontal') { + lastX += itemSize + itemGap; + } + else { + lastY += itemSize + itemGap; + } + } + }, + + _buildBackground: function () { + var toolboxOption = this.option.toolbox; + var pTop = toolboxOption.padding[0]; + var pRight = toolboxOption.padding[1]; + var pBottom = toolboxOption.padding[2]; + var pLeft = toolboxOption.padding[3]; + + this.shapeList.push(new RectangleShape({ + zlevel: this._zlevelBase, + hoverable :false, + style: { + x: this._itemGroupLocation.x - pLeft, + y: this._itemGroupLocation.y - pTop, + width: this._itemGroupLocation.width + pLeft + pRight, + height: this._itemGroupLocation.height + pTop + pBottom, + brushType: toolboxOption.borderWidth === 0 ? 'fill' : 'both', + color: toolboxOption.backgroundColor, + strokeColor: toolboxOption.borderColor, + lineWidth: toolboxOption.borderWidth + } + })); + }, + + /** + * 根据选项计算图例实体的位置坐标 + */ + _getItemGroupLocation: function () { + var toolboxOption = this.option.toolbox; + var iconLength = this._iconList.length; + var itemGap = toolboxOption.itemGap; + var itemSize = toolboxOption.itemSize; + var totalWidth = 0; + var totalHeight = 0; + + if (toolboxOption.orient === 'horizontal') { + // 水平布局,计算总宽度,别忘减去最后一个的itemGap + totalWidth = (itemSize + itemGap) * iconLength - itemGap; + totalHeight = itemSize; + } + else { + // 垂直布局,计算总高度 + totalHeight = (itemSize + itemGap) * iconLength - itemGap; + totalWidth = itemSize; + } + + var x; + var zrWidth = this.zr.getWidth(); + switch (toolboxOption.x) { + case 'center' : + x = Math.floor((zrWidth - totalWidth) / 2); + break; + case 'left' : + x = toolboxOption.padding[3] + toolboxOption.borderWidth; + break; + case 'right' : + x = zrWidth + - totalWidth + - toolboxOption.padding[1] + - toolboxOption.borderWidth; + break; + default : + x = toolboxOption.x - 0; + x = isNaN(x) ? 0 : x; + break; + } + + var y; + var zrHeight = this.zr.getHeight(); + switch (toolboxOption.y) { + case 'top' : + y = toolboxOption.padding[0] + toolboxOption.borderWidth; + break; + case 'bottom' : + y = zrHeight + - totalHeight + - toolboxOption.padding[2] + - toolboxOption.borderWidth; + break; + case 'center' : + y = Math.floor((zrHeight - totalHeight) / 2); + break; + default : + y = toolboxOption.y - 0; + y = isNaN(y) ? 0 : y; + break; + } + + return { + x: x, + y: y, + width: totalWidth, + height: totalHeight + }; + }, + + __onmousemove: function (param) { + if (this._marking) { + this._markShape.style.xEnd = zrEvent.getX(param.event); + this._markShape.style.yEnd = zrEvent.getY(param.event); + this.zr.addHoverShape(this._markShape); + } + if (this._zooming) { + this._zoomShape.style.width = + zrEvent.getX(param.event) - this._zoomShape.style.x; + this._zoomShape.style.height = + zrEvent.getY(param.event) - this._zoomShape.style.y; + this.zr.addHoverShape(this._zoomShape); + this.dom.style.cursor = 'crosshair'; + } + if (this._zoomStart + && (this.dom.style.cursor != 'pointer' && this.dom.style.cursor != 'move') + ) { + this.dom.style.cursor = 'crosshair'; + } + }, + + __onmousedown: function (param) { + if (param.target) { + return; + } + this._zooming = true; + var x = zrEvent.getX(param.event); + var y = zrEvent.getY(param.event); + var zoomOption = this.option.dataZoom || {}; + this._zoomShape = new RectangleShape({ + zlevel: this._zlevelBase, + style: { + x: x, + y: y, + width: 1, + height: 1, + brushType: 'both' + }, + highlightStyle: { + lineWidth: 2, + color: zoomOption.fillerColor + || ecConfig.dataZoom.fillerColor, + strokeColor: zoomOption.handleColor + || ecConfig.dataZoom.handleColor, + brushType: 'both' + } + }); + this.zr.addHoverShape(this._zoomShape); + return true; // 阻塞全局事件 + }, + + __onmouseup: function (/*param*/) { + if (!this._zoomShape + || Math.abs(this._zoomShape.style.width) < 10 + || Math.abs(this._zoomShape.style.height) < 10 + ) { + this._zooming = false; + return true; + } + if (this._zooming && this.component.dataZoom) { + this._zooming = false; + + var zoom = this.component.dataZoom.rectZoom(this._zoomShape.style); + if (zoom) { + this._zoomQueue.push({ + start: zoom.start, + end: zoom.end, + start2: zoom.start2, + end2: zoom.end2 + }); + this._iconEnable(this._iconShapeMap['dataZoomReset']); + this.zr.refresh(); + } + } + return true; // 阻塞全局事件 + }, + + __onclick: function (param) { + if (param.target) { + return; + } + if (this._marking) { + this._marking = false; + this._markShapeList.push(this._markShape); + this._iconEnable(this._iconShapeMap['markUndo']); + this._iconEnable(this._iconShapeMap['markClear']); + this.zr.addShape(this._markShape); + this.zr.refresh(); + } + else if (this._markStart) { + this._marking = true; + var x = zrEvent.getX(param.event); + var y = zrEvent.getY(param.event); + this._markShape = new LineShape({ + zlevel: this._zlevelBase, + style: { + xStart: x, + yStart: y, + xEnd: x, + yEnd: y, + lineWidth: this.query( + this.option, + 'toolbox.feature.mark.lineStyle.width' + ), + strokeColor: this.query( + this.option, + 'toolbox.feature.mark.lineStyle.color' + ), + lineType: this.query( + this.option, + 'toolbox.feature.mark.lineStyle.type' + ) + } + }); + this.zr.addHoverShape(this._markShape); + } + }, + + __onMark: function (param) { + var target = param.target; + if (this._marking || this._markStart) { + // 取消 + this._resetMark(); + this.zr.refresh(); + } + else { + // 启用Mark + this._resetZoom(); // mark与dataZoom互斥 + + this.zr.modShape(target.id, {style: {strokeColor: this._enableColor}}); + this.zr.refresh(); + this._markStart = true; + var self = this; + setTimeout(function (){ + self.zr + && self.zr.on(zrConfig.EVENT.CLICK, self._onclick) + && self.zr.on(zrConfig.EVENT.MOUSEMOVE, self._onmousemove); + }, 10); + } + return true; // 阻塞全局事件 + }, + + __onMarkUndo: function () { + if (this._marking) { + this._marking = false; + } else { + var len = this._markShapeList.length; + if (len >= 1) { + var target = this._markShapeList[len - 1]; + this.zr.delShape(target.id); + this.zr.refresh(); + this._markShapeList.pop(); + if (len === 1) { + this._iconDisable(this._iconShapeMap['markUndo']); + this._iconDisable(this._iconShapeMap['markClear']); + } + } + } + return true; + }, + + __onMarkClear: function () { + if (this._marking) { + this._marking = false; + } + var len = this._markShapeList.length; + if (len > 0) { + while(len--) { + this.zr.delShape(this._markShapeList.pop().id); + } + this._iconDisable(this._iconShapeMap['markUndo']); + this._iconDisable(this._iconShapeMap['markClear']); + this.zr.refresh(); + } + return true; + }, + + __onDataZoom: function (param) { + var target = param.target; + if (this._zooming || this._zoomStart) { + // 取消 + this._resetZoom(); + this.zr.refresh(); + this.dom.style.cursor = 'default'; + } + else { + // 启用Zoom + this._resetMark(); // mark与dataZoom互斥 + + this.zr.modShape(target.id, {style: {strokeColor: this._enableColor}}); + this.zr.refresh(); + this._zoomStart = true; + var self = this; + setTimeout(function (){ + self.zr + && self.zr.on(zrConfig.EVENT.MOUSEDOWN, self._onmousedown) + && self.zr.on(zrConfig.EVENT.MOUSEUP, self._onmouseup) + && self.zr.on(zrConfig.EVENT.MOUSEMOVE, self._onmousemove); + }, 10); + + this.dom.style.cursor = 'crosshair'; + } + return true; // 阻塞全局事件 + }, + + __onDataZoomReset: function () { + if (this._zooming) { + this._zooming = false; + } + this._zoomQueue.pop(); + //console.log(this._zoomQueue) + if (this._zoomQueue.length > 0) { + this.component.dataZoom.absoluteZoom( + this._zoomQueue[this._zoomQueue.length - 1] + ); + } + else { + this.component.dataZoom.rectZoom(); + this._iconDisable(this._iconShapeMap['dataZoomReset']); + this.zr.refresh(); + } + + return true; + }, + + _resetMark: function () { + this._marking = false; + if (this._markStart) { + this._markStart = false; + if (this._iconShapeMap['mark']) { + // 还原图标为未生效状态 + this.zr.modShape( + this._iconShapeMap['mark'].id, + { + style: { + strokeColor: this._iconShapeMap['mark'] + .highlightStyle + .strokeColor + } + } + ); + } + + this.zr.un(zrConfig.EVENT.CLICK, this._onclick); + this.zr.un(zrConfig.EVENT.MOUSEMOVE, this._onmousemove); + } + }, + + _resetZoom: function () { + this._zooming = false; + if (this._zoomStart) { + this._zoomStart = false; + if (this._iconShapeMap['dataZoom']) { + // 还原图标为未生效状态 + this.zr.modShape( + this._iconShapeMap['dataZoom'].id, + { + style: { + strokeColor: this._iconShapeMap['dataZoom'] + .highlightStyle + .strokeColor + } + } + ); + } + + this.zr.un(zrConfig.EVENT.MOUSEDOWN, this._onmousedown); + this.zr.un(zrConfig.EVENT.MOUSEUP, this._onmouseup); + this.zr.un(zrConfig.EVENT.MOUSEMOVE, this._onmousemove); + } + }, + + _iconDisable: function (target) { + if (target.type != 'image') { + this.zr.modShape(target.id, { + hoverable: false, + clickable: false, + style: { + strokeColor: this._disableColor + } + }); + } + else { + this.zr.modShape(target.id, { + hoverable: false, + clickable: false, + style: { + opacity: 0.3 + } + }); + } + }, + + _iconEnable: function (target) { + if (target.type != 'image') { + this.zr.modShape(target.id, { + hoverable: true, + clickable: true, + style: { + strokeColor: target.highlightStyle.strokeColor + } + }); + } + else { + this.zr.modShape(target.id, { + hoverable: true, + clickable: true, + style: { + opacity: 0.8 + } + }); + } + }, + + __onDataView: function () { + this._dataView.show(this.option); + return true; + }, + + __onRestore: function (){ + this._resetMark(); + this._resetZoom(); + this.messageCenter.dispatch(ecConfig.EVENT.RESTORE, null, null, this.myChart); + return true; + }, + + __onSaveAsImage: function () { + var saveOption = this.option.toolbox.feature.saveAsImage; + var imgType = saveOption.type || 'png'; + if (imgType != 'png' && imgType != 'jpeg') { + imgType = 'png'; + } + + var image; + if (!this.myChart.isConnected()) { + image = this.zr.toDataURL( + 'image/' + imgType, + this.option.backgroundColor + && this.option.backgroundColor.replace(' ','') === 'rgba(0,0,0,0)' + ? '#fff' : this.option.backgroundColor + ); + } + else { + image = this.myChart.getConnectedDataURL(imgType); + } + + var downloadDiv = document.createElement('div'); + downloadDiv.id = '__echarts_download_wrap__'; + downloadDiv.style.cssText = 'position:fixed;' + + 'z-index:99999;' + + 'display:block;' + + 'top:0;left:0;' + + 'background-color:rgba(33,33,33,0.5);' + + 'text-align:center;' + + 'width:100%;' + + 'height:100%;' + + 'line-height:' + + document.documentElement.clientHeight + 'px;'; + + var downloadLink = document.createElement('a'); + //downloadLink.onclick = _saveImageForIE; + downloadLink.href = image; + downloadLink.setAttribute( + 'download', + (saveOption.name + ? saveOption.name + : (this.option.title && (this.option.title.text || this.option.title.subtext)) + ? (this.option.title.text || this.option.title.subtext) + : 'ECharts') + + '.' + imgType + ); + downloadLink.innerHTML = ''; + + downloadDiv.appendChild(downloadLink); + document.body.appendChild(downloadDiv); + downloadLink = null; + downloadDiv = null; + + setTimeout(function (){ + var _d = document.getElementById('__echarts_download_wrap__'); + if (_d) { + _d.onclick = function () { + var d = document.getElementById( + '__echarts_download_wrap__' + ); + d.onclick = null; + d.innerHTML = ''; + document.body.removeChild(d); + d = null; + }; + _d = null; + } + }, 500); + + /* + function _saveImageForIE() { + window.win = window.open(image); + win.document.execCommand("SaveAs"); + win.close() + } + */ + return; + }, + + __onMagicType: function (param) { + this._resetMark(); + var itemName = param.target._name; + if (!this._magicType[itemName]) { + // 启用 + this._magicType[itemName] = true; + // 折柱互斥 + if (itemName === ecConfig.CHART_TYPE_LINE) { + this._magicType[ecConfig.CHART_TYPE_BAR] = false; + } + else if (itemName === ecConfig.CHART_TYPE_BAR) { + this._magicType[ecConfig.CHART_TYPE_LINE] = false; + } + // 堆积平铺互斥 + if (itemName === _MAGICTYPE_STACK) { + this._magicType[_MAGICTYPE_TILED] = false; + } + else if (itemName === _MAGICTYPE_TILED) { + this._magicType[_MAGICTYPE_STACK] = false; + } + this.messageCenter.dispatch( + ecConfig.EVENT.MAGIC_TYPE_CHANGED, + param.event, + { magicType: this._magicType }, + this.myChart + ); + } + + return true; + }, + + setMagicType: function (magicType) { + this._resetMark(); + this._magicType = magicType; + + !this._isSilence && this.messageCenter.dispatch( + ecConfig.EVENT.MAGIC_TYPE_CHANGED, + null, + { magicType: this._magicType }, + this.myChart + ); + }, + + // 用户自定义扩展toolbox方法 + __onCustomHandler: function (param) { + var target = param.target.style.iconType; + var featureHandler = this.option.toolbox.feature[target].onclick; + if (typeof featureHandler === 'function') { + featureHandler.call(this, this.option); + } + }, + + // 重置备份还原状态等 + reset: function (newOption, isRestore) { + isRestore && this.clear(); + + if (this.query(newOption, 'toolbox.show') + && this.query(newOption, 'toolbox.feature.magicType.show') + ) { + var magicType = newOption.toolbox.feature.magicType.type; + var len = magicType.length; + this._magicMap = {}; // 标识可控类型 + while (len--) { + this._magicMap[magicType[len]] = true; + } + + len = newOption.series.length; + var oriType; // 备份还原可控类型 + var axis; + while (len--) { + oriType = newOption.series[len].type; + if (this._magicMap[oriType]) { + axis = newOption.xAxis instanceof Array + ? newOption.xAxis[newOption.series[len].xAxisIndex || 0] + : newOption.xAxis; + if (axis && (axis.type || 'category') === 'category') { + axis.__boundaryGap = axis.boundaryGap != null + ? axis.boundaryGap : true; + } + axis = newOption.yAxis instanceof Array + ? newOption.yAxis[newOption.series[len].yAxisIndex || 0] + : newOption.yAxis; + if (axis && axis.type === 'category') { + axis.__boundaryGap = axis.boundaryGap != null + ? axis.boundaryGap : true; + } + newOption.series[len].__type = oriType; + // 避免不同类型图表类型的样式污染 + newOption.series[len].__itemStyle = zrUtil.clone( + newOption.series[len].itemStyle || {} + ); + } + + if (this._magicMap[_MAGICTYPE_STACK] || this._magicMap[_MAGICTYPE_TILED]) { + newOption.series[len].__stack = newOption.series[len].stack; + } + } + } + + this._magicType = isRestore ? {} : (this._magicType || {}); + for (var itemName in this._magicType) { + if (this._magicType[itemName]) { + this.option = newOption; + this.getMagicOption(); + break; + } + } + + // 框选缩放 + var zoomOption = newOption.dataZoom; + if (zoomOption && zoomOption.show) { + var start = zoomOption.start != null + && zoomOption.start >= 0 + && zoomOption.start <= 100 + ? zoomOption.start : 0; + var end = zoomOption.end != null + && zoomOption.end >= 0 + && zoomOption.end <= 100 + ? zoomOption.end : 100; + if (start > end) { + // 大小颠倒自动翻转 + start = start + end; + end = start - end; + start = start - end; + } + this._zoomQueue = [{ + start: start, + end: end, + start2: 0, + end2: 100 + }]; + } + else { + this._zoomQueue = []; + } + }, + + getMagicOption: function (){ + var axis; + if (this._magicType[ecConfig.CHART_TYPE_LINE] + || this._magicType[ecConfig.CHART_TYPE_BAR] + ) { + // 图表类型有切换 + var boundaryGap = this._magicType[ecConfig.CHART_TYPE_LINE] ? false : true; + for (var i = 0, l = this.option.series.length; i < l; i++) { + if (this._magicMap[this.option.series[i].type]) { + this.option.series[i].type = this._magicType[ecConfig.CHART_TYPE_LINE] + ? ecConfig.CHART_TYPE_LINE + : ecConfig.CHART_TYPE_BAR; + // 避免不同类型图表类型的样式污染 + this.option.series[i].itemStyle = zrUtil.clone( + this.option.series[i].__itemStyle + ); + + axis = this.option.xAxis instanceof Array + ? this.option.xAxis[this.option.series[i].xAxisIndex || 0] + : this.option.xAxis; + if (axis && (axis.type || 'category') === 'category') { + axis.boundaryGap = boundaryGap ? true : axis.__boundaryGap; + } + axis = this.option.yAxis instanceof Array + ? this.option.yAxis[this.option.series[i].yAxisIndex || 0] + : this.option.yAxis; + if (axis && axis.type === 'category') { + axis.boundaryGap = boundaryGap ? true : axis.__boundaryGap; + } + } + } + } + + if (this._magicType[_MAGICTYPE_STACK] || this._magicType[_MAGICTYPE_TILED]) { + // 有堆积平铺切换 + for (var i = 0, l = this.option.series.length; i < l; i++) { + if (this._magicType[_MAGICTYPE_STACK]) { + // 启用堆积 + this.option.series[i].stack = '_ECHARTS_STACK_KENER_2014_'; + } + else if (this._magicType[_MAGICTYPE_TILED]) { + // 启用平铺 + this.option.series[i].stack = null; + } + } + } + + return this.option; + }, + + silence: function (s) { + this._isSilence = s; + }, + + resize: function () { + this._resetMark(); + this.clear(); + if (this.option && this.option.toolbox && this.option.toolbox.show) { + this._buildShape(); + } + if (this._dataView) { + this._dataView.resize(); + } + }, + + hideDataView: function () { + if (this._dataView) { + this._dataView.hide(); + } + }, + + clear: function(notMark) { + if (this.zr) { + this.zr.delShape(this.shapeList); + this.shapeList = []; + + if (!notMark) { + this.zr.delShape(this._markShapeList); + this._markShapeList = []; + } + } + }, + + /** + * 释放后实例不可用 + */ + dispose: function () { + if (this._dataView) { + this._dataView.dispose(); + this._dataView = null; + } + this.clear(); + this.shapeList = null; + this._markShapeList = null; + }, + + /** + * 刷新 + */ + refresh: function (newOption) { + if (newOption) { + this._resetMark(); + this._resetZoom(); + + newOption.toolbox = this.reformOption(newOption.toolbox); + // 补全padding属性 + newOption.toolbox.padding = this.reformCssArray( + newOption.toolbox.padding + ); + this.option = newOption; + + this.clear(true); + + if (newOption.toolbox.show) { + this._buildShape(); + } + + this.hideDataView(); + } + } + }; + + zrUtil.inherits(Toolbox, Base); + + require('../component').define('toolbox', Toolbox); + + return Toolbox; +}); + +/** + * echarts组件:图表标题 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/component/title',['require','./base','zrender/shape/Text','zrender/shape/Rectangle','../config','zrender/tool/util','zrender/tool/area','zrender/tool/color','../component'],function (require) { + var Base = require('./base'); + + // 图形依赖 + var TextShape = require('zrender/shape/Text'); + var RectangleShape = require('zrender/shape/Rectangle'); + + var ecConfig = require('../config'); + var zrUtil = require('zrender/tool/util'); + var zrArea = require('zrender/tool/area'); + var zrColor = require('zrender/tool/color'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} option 图表参数 + */ + function Title(ecTheme, messageCenter, zr, option, myChart) { + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + + this.refresh(option); + } + + Title.prototype = { + type: ecConfig.COMPONENT_TYPE_TITLE, + _buildShape: function () { + // 标题元素组的位置参数,通过计算所得x, y, width, height + this._itemGroupLocation = this._getItemGroupLocation(); + + this._buildBackground(); + this._buildItem(); + + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + }, + + /** + * 构建所有标题元素 + */ + _buildItem: function () { + var text = this.titleOption.text; + var link = this.titleOption.link; + var target = this.titleOption.target; + var subtext = this.titleOption.subtext; + var sublink = this.titleOption.sublink; + var subtarget = this.titleOption.subtarget; + var font = this.getFont(this.titleOption.textStyle); + var subfont = this.getFont(this.titleOption.subtextStyle); + + var x = this._itemGroupLocation.x; + var y = this._itemGroupLocation.y; + var width = this._itemGroupLocation.width; + var height = this._itemGroupLocation.height; + + var textShape = { + zlevel: this._zlevelBase, + style: { + y: y, + color: this.titleOption.textStyle.color, + text: text, + textFont: font, + textBaseline: 'top' + }, + highlightStyle: { + color: zrColor.lift(this.titleOption.textStyle.color, 1), + brushType: 'fill' + }, + hoverable: false + }; + if (link) { + textShape.hoverable = true; + textShape.clickable = true; + textShape.onclick = function (){ + if (!target || target != 'self') { + window.open(link); + } + else { + window.location = link; + } + }; + } + + var subtextShape = { + zlevel: this._zlevelBase, + style: { + y: y + height, + color: this.titleOption.subtextStyle.color, + text: subtext, + textFont: subfont, + textBaseline: 'bottom' + }, + highlightStyle: { + color: zrColor.lift(this.titleOption.subtextStyle.color, 1), + brushType: 'fill' + }, + hoverable: false + }; + if (sublink) { + subtextShape.hoverable = true; + subtextShape.clickable = true; + subtextShape.onclick = function (){ + if (!subtarget || subtarget != 'self') { + window.open(sublink); + } + else { + window.location = sublink; + } + }; + } + + switch (this.titleOption.x) { + case 'center' : + textShape.style.x = subtextShape.style.x = x + width / 2; + textShape.style.textAlign = subtextShape.style.textAlign + = 'center'; + break; + case 'left' : + textShape.style.x = subtextShape.style.x = x; + textShape.style.textAlign = subtextShape.style.textAlign + = 'left'; + break; + case 'right' : + textShape.style.x = subtextShape.style.x = x + width; + textShape.style.textAlign = subtextShape.style.textAlign + = 'right'; + break; + default : + x = this.titleOption.x - 0; + x = isNaN(x) ? 0 : x; + textShape.style.x = subtextShape.style.x = x; + break; + } + + if (this.titleOption.textAlign) { + textShape.style.textAlign = subtextShape.style.textAlign + = this.titleOption.textAlign; + } + + this.shapeList.push(new TextShape(textShape)); + subtext !== '' && this.shapeList.push(new TextShape(subtextShape)); + }, + + _buildBackground: function () { + var pTop = this.titleOption.padding[0]; + var pRight = this.titleOption.padding[1]; + var pBottom = this.titleOption.padding[2]; + var pLeft = this.titleOption.padding[3]; + + this.shapeList.push(new RectangleShape({ + zlevel: this._zlevelBase, + hoverable :false, + style: { + x: this._itemGroupLocation.x - pLeft, + y: this._itemGroupLocation.y - pTop, + width: this._itemGroupLocation.width + pLeft + pRight, + height: this._itemGroupLocation.height + pTop + pBottom, + brushType: this.titleOption.borderWidth === 0 ? 'fill' : 'both', + color: this.titleOption.backgroundColor, + strokeColor: this.titleOption.borderColor, + lineWidth: this.titleOption.borderWidth + } + })); + }, + + /** + * 根据选项计算标题实体的位置坐标 + */ + _getItemGroupLocation: function () { + var text = this.titleOption.text; + var subtext = this.titleOption.subtext; + var font = this.getFont(this.titleOption.textStyle); + var subfont = this.getFont(this.titleOption.subtextStyle); + + var totalWidth = Math.max( + zrArea.getTextWidth(text, font), + zrArea.getTextWidth(subtext, subfont) + ); + var totalHeight = zrArea.getTextHeight(text, font) + + (subtext === '' + ? 0 + : (this.titleOption.itemGap + + zrArea.getTextHeight(subtext, subfont)) + ); + + var x; + var zrWidth = this.zr.getWidth(); + switch (this.titleOption.x) { + case 'center' : + x = Math.floor((zrWidth - totalWidth) / 2); + break; + case 'left' : + x = this.titleOption.padding[3] + this.titleOption.borderWidth; + break; + case 'right' : + x = zrWidth + - totalWidth + - this.titleOption.padding[1] + - this.titleOption.borderWidth; + break; + default : + x = this.titleOption.x - 0; + x = isNaN(x) ? 0 : x; + break; + } + + var y; + var zrHeight = this.zr.getHeight(); + switch (this.titleOption.y) { + case 'top' : + y = this.titleOption.padding[0] + this.titleOption.borderWidth; + break; + case 'bottom' : + y = zrHeight + - totalHeight + - this.titleOption.padding[2] + - this.titleOption.borderWidth; + break; + case 'center' : + y = Math.floor((zrHeight - totalHeight) / 2); + break; + default : + y = this.titleOption.y - 0; + y = isNaN(y) ? 0 : y; + break; + } + + return { + x: x, + y: y, + width: totalWidth, + height: totalHeight + }; + }, + + /** + * 刷新 + */ + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + + this.option.title = this.reformOption(this.option.title); + // 补全padding属性 + this.option.title.padding = this.reformCssArray( + this.option.title.padding + ); + + this.titleOption = this.option.title; + this.titleOption.textStyle = zrUtil.merge( + this.titleOption.textStyle, + this.ecTheme.textStyle + ); + this.titleOption.subtextStyle = zrUtil.merge( + this.titleOption.subtextStyle, + this.ecTheme.textStyle + ); + } + + this.clear(); + this._buildShape(); + } + }; + + zrUtil.inherits(Title, Base); + + require('../component').define('title', Title); + + return Title; +}); + + + +/** + * zrender + * + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + * shape类:十字准星 + * 可配图形属性: + { + // 基础属性 + shape : 'cross', // 必须,shape类标识,需要显式指定 + id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 + zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 + invisible : {boolean}, // 默认为false,是否可见 + + // 样式属性,默认状态样式样式属性 + style : { + rect : {Object}, // 必须,对角框 + x : {number}, // 必须,横坐标 + y : {number}, // 必须,纵坐标 + }, + + // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 + highlightStyle : { + // 同style + } + + // 交互属性,详见shape.Base + + // 事件属性,详见shape.Base + } + */ +define('echarts/util/shape/Cross',['require','zrender/shape/Base','zrender/shape/Line','zrender/tool/util','./normalIsCover'],function (require) { + var Base = require('zrender/shape/Base'); + var LineShape = require('zrender/shape/Line'); + var zrUtil = require('zrender/tool/util'); + + function Cross(options) { + Base.call(this, options); + } + + Cross.prototype = { + type : 'cross', + + /** + * 创建矩形路径 + * @param {Context2D} ctx Canvas 2D上下文 + * @param {Object} style 样式 + */ + buildPath : function (ctx, style) { + var rect = style.rect; + style.xStart = rect.x; + style.xEnd = rect.x + rect.width; + style.yStart = style.yEnd = style.y; + LineShape.prototype.buildPath(ctx, style); + style.xStart = style.xEnd = style.x; + style.yStart = rect.y; + style.yEnd = rect.y + rect.height; + LineShape.prototype.buildPath(ctx, style); + }, + + /** + * 返回矩形区域,用于局部刷新和文字定位 + * @param {Object} style + */ + getRect : function (style) { + return style.rect; + }, + + isCover : require('./normalIsCover') + }; + + zrUtil.inherits(Cross, Base); + + return Cross; +}); + +/** + * echarts组件:提示框 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zrender/shape/Line','zrender/shape/Rectangle','../config','../util/ecData','zrender/config','zrender/tool/event','zrender/tool/area','zrender/tool/color','zrender/tool/util','zrender/shape/Base','../component'],function (require) { + var Base = require('./base'); + + // 图形依赖 + var CrossShape = require('../util/shape/Cross'); + var LineShape = require('zrender/shape/Line'); + var RectangleShape = require('zrender/shape/Rectangle'); + var rectangleInstance = new RectangleShape({}); + + var ecConfig = require('../config'); + var ecData = require('../util/ecData'); + var zrConfig = require('zrender/config'); + var zrEvent = require('zrender/tool/event'); + var zrArea = require('zrender/tool/area'); + var zrColor = require('zrender/tool/color'); + var zrUtil = require('zrender/tool/util'); + var zrShapeBase = require('zrender/shape/Base'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} option 提示框参数 + * @param {HtmlElement} dom 目标对象 + * @param {ECharts} myChart 当前图表实例 + */ + function Tooltip(ecTheme, messageCenter, zr, option, myChart) { + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + + this.dom = myChart.dom; + + var self = this; + self._onmousemove = function (param) { + return self.__onmousemove(param); + }; + self._onglobalout = function (param) { + return self.__onglobalout(param); + }; + + this.zr.on(zrConfig.EVENT.MOUSEMOVE, self._onmousemove); + this.zr.on(zrConfig.EVENT.GLOBALOUT, self._onglobalout); + + self._hide = function (param) { + return self.__hide(param); + }; + self._tryShow = function(param) { + return self.__tryShow(param); + }; + self._refixed = function(param) { + return self.__refixed(param); + }; + + self._setContent = function(ticket, res) { + return self.__setContent(ticket, res); + }; + + this._tDom = this._tDom || document.createElement('div'); + // 避免拖拽时页面选中的尴尬 + this._tDom.onselectstart = function() { + return false; + }; + this._tDom.style.position = 'absolute'; // 不是多余的,别删! + this.hasAppend = false; + + this._axisLineShape && this.zr.delShape(this._axisLineShape.id); + this._axisLineShape = new LineShape({ + zlevel: this._zlevelBase, + invisible: true, + hoverable: false + }); + this.shapeList.push(this._axisLineShape); + this.zr.addShape(this._axisLineShape); + + this._axisShadowShape && this.zr.delShape(this._axisShadowShape.id); + this._axisShadowShape = new LineShape({ + zlevel: 1, // grid上,chart下 + invisible: true, + hoverable: false + }); + this.shapeList.push(this._axisShadowShape); + this.zr.addShape(this._axisShadowShape); + + this._axisCrossShape && this.zr.delShape(this._axisCrossShape.id); + this._axisCrossShape = new CrossShape({ + zlevel: this._zlevelBase, + invisible: true, + hoverable: false + }); + this.shapeList.push(this._axisCrossShape); + this.zr.addShape(this._axisCrossShape); + + this.showing = false; + this.refresh(option); + } + + Tooltip.prototype = { + type: ecConfig.COMPONENT_TYPE_TOOLTIP, + // 通用样式 + _gCssText: 'position:absolute;display:block;border-style:solid;white-space:nowrap;', + /** + * 根据配置设置dom样式 + */ + _style: function (opt) { + if (!opt) { + return ''; + } + var cssText = []; + if (opt.transitionDuration) { + var transitionText = 'left ' + opt.transitionDuration + 's,' + + 'top ' + opt.transitionDuration + 's'; + cssText.push( + 'transition:' + transitionText + ); + cssText.push( + '-moz-transition:' + transitionText + ); + cssText.push( + '-webkit-transition:' + transitionText + ); + cssText.push( + '-o-transition:' + transitionText + ); + } + + if (opt.backgroundColor) { + // for sb ie~ + cssText.push( + 'background-Color:' + zrColor.toHex( + opt.backgroundColor + ) + ); + cssText.push('filter:alpha(opacity=70)'); + cssText.push('background-Color:' + opt.backgroundColor); + } + + if (opt.borderWidth != null) { + cssText.push('border-width:' + opt.borderWidth + 'px'); + } + + if (opt.borderColor != null) { + cssText.push('border-color:' + opt.borderColor); + } + + if (opt.borderRadius != null) { + cssText.push( + 'border-radius:' + opt.borderRadius + 'px' + ); + cssText.push( + '-moz-border-radius:' + opt.borderRadius + 'px' + ); + cssText.push( + '-webkit-border-radius:' + opt.borderRadius + 'px' + ); + cssText.push( + '-o-border-radius:' + opt.borderRadius + 'px' + ); + } + + var textStyle = opt.textStyle; + if (textStyle) { + textStyle.color && cssText.push('color:' + textStyle.color); + textStyle.decoration && cssText.push( + 'text-decoration:' + textStyle.decoration + ); + textStyle.align && cssText.push( + 'text-align:' + textStyle.align + ); + textStyle.fontFamily && cssText.push( + 'font-family:' + textStyle.fontFamily + ); + textStyle.fontSize && cssText.push( + 'font-size:' + textStyle.fontSize + 'px' + ); + textStyle.fontSize && cssText.push( + 'line-height:' + Math.round(textStyle.fontSize*3/2) + 'px' + ); + textStyle.fontStyle && cssText.push( + 'font-style:' + textStyle.fontStyle + ); + textStyle.fontWeight && cssText.push( + 'font-weight:' + textStyle.fontWeight + ); + } + + + var padding = opt.padding; + if (padding != null) { + padding = this.reformCssArray(padding); + cssText.push( + 'padding:' + padding[0] + 'px ' + + padding[1] + 'px ' + + padding[2] + 'px ' + + padding[3] + 'px' + ); + } + + cssText = cssText.join(';') + ';'; + + return cssText; + }, + + __hide: function () { + if (this._tDom) { + this._tDom.style.display = 'none'; + } + var needRefresh = false; + if (!this._axisLineShape.invisible) { + this._axisLineShape.invisible = true; + this.zr.modShape(this._axisLineShape.id); + needRefresh = true; + } + if (!this._axisShadowShape.invisible) { + this._axisShadowShape.invisible = true; + this.zr.modShape(this._axisShadowShape.id); + needRefresh = true; + } + if (!this._axisCrossShape.invisible) { + this._axisCrossShape.invisible = true; + this.zr.modShape(this._axisCrossShape.id); + needRefresh = true; + } + if (this._lastTipShape && this._lastTipShape.tipShape.length > 0) { + this.zr.delShape(this._lastTipShape.tipShape); + this._lastTipShape = false; + this.shapeList.length = 2; + } + needRefresh && this.zr.refresh(); + this.showing = false; + }, + + _show: function (position, x, y, specialCssText) { + var domHeight = this._tDom.offsetHeight; + var domWidth = this._tDom.offsetWidth; + if (position) { + if (typeof position === 'function') { + position = position([x, y]); + } + if (position instanceof Array) { + x = position[0]; + y = position[1]; + } + } + if (x + domWidth > this._zrWidth) { + // 太靠右 + //x = this._zrWidth - domWidth; + x -= (domWidth + 40); + } + if (y + domHeight > this._zrHeight) { + // 太靠下 + //y = this._zrHeight - domHeight; + y -= (domHeight - 20); + } + if (y < 20) { + y = 0; + } + this._tDom.style.cssText = this._gCssText + + this._defaultCssText + + (specialCssText ? specialCssText : '') + + 'left:' + x + 'px;top:' + y + 'px;'; + + if (domHeight < 10 || domWidth < 10) { + // this._zrWidth - x < 100 || this._zrHeight - y < 100 + setTimeout(this._refixed, 20); + } + this.showing = true; + }, + + __refixed: function () { + if (this._tDom) { + var cssText = ''; + var domHeight = this._tDom.offsetHeight; + var domWidth = this._tDom.offsetWidth; + if (this._tDom.offsetLeft + domWidth > this._zrWidth) { + cssText += 'left:' + (this._zrWidth - domWidth - 20) + 'px;'; + } + if (this._tDom.offsetTop + domHeight > this._zrHeight) { + cssText += 'top:' + (this._zrHeight - domHeight - 10) + 'px;'; + } + if (cssText !== '') { + this._tDom.style.cssText += cssText; + } + } + }, + + __tryShow: function () { + var needShow; + var trigger; + if (!this._curTarget) { + // 坐标轴事件 + this._findPolarTrigger() || this._findAxisTrigger(); + } + else { + // 数据项事件 + if (this._curTarget._type === 'island' && this.option.tooltip.show) { + this._showItemTrigger(); + return; + } + var serie = ecData.get(this._curTarget, 'series'); + var data = ecData.get(this._curTarget, 'data'); + needShow = this.deepQuery( + [data, serie, this.option], + 'tooltip.show' + ); + if (serie == null || data == null || !needShow) { + // 不响应tooltip的数据对象延时隐藏 + clearTimeout(this._hidingTicket); + clearTimeout(this._showingTicket); + this._hidingTicket = setTimeout(this._hide, this._hideDelay); + } + else { + trigger = this.deepQuery( + [data, serie, this.option], + 'tooltip.trigger' + ); + + trigger === 'axis' + ? this._showAxisTrigger( + serie.xAxisIndex, serie.yAxisIndex, + ecData.get(this._curTarget, 'dataIndex') + ) + : this._showItemTrigger(); + } + } + }, + + /** + * 直角系 + */ + _findAxisTrigger: function () { + if (!this.component.xAxis || !this.component.yAxis) { + this._hidingTicket = setTimeout(this._hide, this._hideDelay); + return; + } + var series = this.option.series; + var xAxisIndex; + var yAxisIndex; + for (var i = 0, l = series.length; i < l; i++) { + // 找到第一个axis触发tooltip的系列 + if (this.deepQuery([series[i], this.option], 'tooltip.trigger') === 'axis') { + xAxisIndex = series[i].xAxisIndex || 0; + yAxisIndex = series[i].yAxisIndex || 0; + if (this.component.xAxis.getAxis(xAxisIndex) + && this.component.xAxis.getAxis(xAxisIndex).type + === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + ) { + // 横轴为类目轴 + this._showAxisTrigger(xAxisIndex, yAxisIndex, + this._getNearestDataIndex( + 'x', this.component.xAxis.getAxis(xAxisIndex) + ) + ); + return; + } + else if (this.component.yAxis.getAxis(yAxisIndex) + && this.component.yAxis.getAxis(yAxisIndex).type + === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + ) { + // 纵轴为类目轴 + this._showAxisTrigger(xAxisIndex, yAxisIndex, + this._getNearestDataIndex( + 'y', this.component.yAxis.getAxis(yAxisIndex) + ) + ); + return; + } + else { + // 双数值轴 + this._showAxisTrigger(xAxisIndex, yAxisIndex, -1); + return; + } + } + } + if (this.option.tooltip.axisPointer.type === 'cross') { + this._showAxisTrigger(-1, -1, -1); + } + }, + + /** + * 极坐标 + */ + _findPolarTrigger: function () { + if (!this.component.polar) { + return false; + } + var x = zrEvent.getX(this._event); + var y = zrEvent.getY(this._event); + var polarIndex = this.component.polar.getNearestIndex([x, y]); + var valueIndex; + if (polarIndex) { + valueIndex = polarIndex.valueIndex; + polarIndex = polarIndex.polarIndex; + } + else { + polarIndex = -1; + } + + if (polarIndex != -1) { + return this._showPolarTrigger(polarIndex, valueIndex); + } + + return false; + }, + + /** + * 根据坐标轴事件带的属性获取最近的axisDataIndex + */ + _getNearestDataIndex: function (direction, categoryAxis) { + var dataIndex = -1; + var x = zrEvent.getX(this._event); + var y = zrEvent.getY(this._event); + if (direction === 'x') { + // 横轴为类目轴 + var left; + var right; + var xEnd = this.component.grid.getXend(); + var curCoord = categoryAxis.getCoordByIndex(dataIndex); + while (curCoord < xEnd) { + right = curCoord; + if (curCoord <= x) { + left = curCoord; + } + else { + break; + } + curCoord = categoryAxis.getCoordByIndex(++dataIndex); + } + if (dataIndex <= 0) { + dataIndex = 0; + } + else if (x - left <= right - x) { + dataIndex -= 1; + } + else { + // 离右边近,看是否为最后一个 + if (categoryAxis.getNameByIndex(dataIndex) == null) { + dataIndex -= 1; + } + } + return dataIndex; + } + else { + // 纵轴为类目轴 + var top; + var bottom; + var yStart = this.component.grid.getY(); + var curCoord = categoryAxis.getCoordByIndex(dataIndex); + while (curCoord > yStart) { + top = curCoord; + if (curCoord >= y) { + bottom = curCoord; + } + else { + break; + } + curCoord = categoryAxis.getCoordByIndex(++dataIndex); + } + + if (dataIndex <= 0) { + dataIndex = 0; + } + else if (y - top >= bottom - y) { + dataIndex -= 1; + } + else { + // 离上方边近,看是否为最后一个 + if (categoryAxis.getNameByIndex(dataIndex) == null) { + dataIndex -= 1; + } + } + return dataIndex; + } + return -1; + }, + + /** + * 直角系 + */ + _showAxisTrigger: function (xAxisIndex, yAxisIndex, dataIndex) { + !this._event.connectTrigger && this.messageCenter.dispatch( + ecConfig.EVENT.TOOLTIP_IN_GRID, + this._event, + null, + this.myChart + ); + if (this.component.xAxis == null + || this.component.yAxis == null + || xAxisIndex == null + || yAxisIndex == null + // || dataIndex < 0 + ) { + // 不响应tooltip的数据对象延时隐藏 + clearTimeout(this._hidingTicket); + clearTimeout(this._showingTicket); + this._hidingTicket = setTimeout(this._hide, this._hideDelay); + return; + } + var series = this.option.series; + var seriesArray = []; + var seriesIndex = []; + var categoryAxis; + var x; + var y; + + var formatter; + var position; + var showContent; + var specialCssText = ''; + if (this.option.tooltip.trigger === 'axis') { + if (!this.option.tooltip.show) { + return; + } + formatter = this.option.tooltip.formatter; + position = this.option.tooltip.position; + } + + if (xAxisIndex != -1 + && this.component.xAxis.getAxis(xAxisIndex).type + === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + ) { + // 横轴为类目轴,找到所有用这条横轴并且axis触发的系列数据 + categoryAxis = this.component.xAxis.getAxis(xAxisIndex); + for (var i = 0, l = series.length; i < l; i++) { + if (!this._isSelected(series[i].name)) { + continue; + } + if (series[i].xAxisIndex === xAxisIndex + && this.deepQuery([series[i], this.option], 'tooltip.trigger') === 'axis' + ) { + showContent = this.query(series[i], 'tooltip.showContent') + || showContent; + formatter = this.query(series[i], 'tooltip.formatter') + || formatter; + position = this.query(series[i], 'tooltip.position') + || position; + + specialCssText += this._style(this.query(series[i], 'tooltip')); + if (series[i].stack != null) { + seriesArray.unshift(series[i]); + seriesIndex.unshift(i); + } + else { + seriesArray.push(series[i]); + seriesIndex.push(i); + } + } + } + + // 寻找高亮元素 + this.messageCenter.dispatch( + ecConfig.EVENT.TOOLTIP_HOVER, + this._event, + { + seriesIndex: seriesIndex, + dataIndex: dataIndex + }, + this.myChart + ); + y = zrEvent.getY(this._event); + x = this.subPixelOptimize( + categoryAxis.getCoordByIndex(dataIndex), + this._axisLineWidth + ); + this._styleAxisPointer( + seriesArray, + x, this.component.grid.getY(), + x, this.component.grid.getYend(), + categoryAxis.getGap(), x, y + ); + } + else if (yAxisIndex != -1 + && this.component.yAxis.getAxis(yAxisIndex).type + === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + ) { + // 纵轴为类目轴,找到所有用这条纵轴并且axis触发的系列数据 + categoryAxis = this.component.yAxis.getAxis(yAxisIndex); + for (var i = 0, l = series.length; i < l; i++) { + if (!this._isSelected(series[i].name)) { + continue; + } + if (series[i].yAxisIndex === yAxisIndex + && this.deepQuery([series[i], this.option], 'tooltip.trigger') === 'axis' + ) { + showContent = this.query(series[i], 'tooltip.showContent') + || showContent; + formatter = this.query(series[i], 'tooltip.formatter') + || formatter; + position = this.query(series[i], 'tooltip.position') + || position; + specialCssText += this._style(this.query(series[i], 'tooltip')); + seriesArray.push(series[i]); + seriesIndex.push(i); + } + } + // 寻找高亮元素 + this.messageCenter.dispatch( + ecConfig.EVENT.TOOLTIP_HOVER, + this._event, + { + seriesIndex: seriesIndex, + dataIndex: dataIndex + }, + this.myChart + ); + x = zrEvent.getX(this._event); + y = this.subPixelOptimize( + categoryAxis.getCoordByIndex(dataIndex), + this._axisLineWidth + ); + this._styleAxisPointer( + seriesArray, + this.component.grid.getX(), y, + this.component.grid.getXend(), y, + categoryAxis.getGap(), x, y + ); + } + else { + // 双数值轴 + x = zrEvent.getX(this._event); + y = zrEvent.getY(this._event); + this._styleAxisPointer( + series, + this.component.grid.getX(), y, + this.component.grid.getXend(), y, + 0, x, y + ); + if (dataIndex >= 0) { + this._showItemTrigger(); + } + else { + clearTimeout(this._hidingTicket); + clearTimeout(this._showingTicket); + this._tDom.style.display = 'none'; + } + } + + if (seriesArray.length > 0) { + var data; + if (typeof formatter === 'function') { + var params = []; + for (var i = 0, l = seriesArray.length; i < l; i++) { + data = seriesArray[i].data[dataIndex]; + data = data != null + ? (data.value != null + ? data.value + : data) + : '-'; + + params.push([ + seriesArray[i].name || '', + categoryAxis.getNameByIndex(dataIndex), + data + ]); + } + this._curTicket = 'axis:' + dataIndex; + this._tDom.innerHTML = formatter.call( + this.myChart, params, this._curTicket, this._setContent + ); + } + else if (typeof formatter === 'string') { + this._curTicket = NaN; + formatter = formatter.replace('{a}','{a0}') + .replace('{b}','{b0}') + .replace('{c}','{c0}'); + for (var i = 0, l = seriesArray.length; i < l; i++) { + formatter = formatter.replace( + '{a' + i + '}', + this._encodeHTML(seriesArray[i].name || '') + ); + formatter = formatter.replace( + '{b' + i + '}', + this._encodeHTML(categoryAxis.getNameByIndex(dataIndex)) + ); + data = seriesArray[i].data[dataIndex]; + data = data != null + ? (data.value != null + ? data.value + : data) + : '-'; + formatter = formatter.replace( + '{c' + i + '}', + data instanceof Array + ? data : this.numAddCommas(data) + ); + } + this._tDom.innerHTML = formatter; + } + else { + this._curTicket = NaN; + formatter = this._encodeHTML( + categoryAxis.getNameByIndex(dataIndex) + ); + + for (var i = 0, l = seriesArray.length; i < l; i++) { + formatter += '
' + + this._encodeHTML(seriesArray[i].name || '') + + ' : '; + data = seriesArray[i].data[dataIndex]; + data = data != null + ? (data.value != null + ? data.value + : data) + : '-'; + formatter += data instanceof Array + ? data : this.numAddCommas(data); + } + this._tDom.innerHTML = formatter; + } + + // don't modify, just false, showContent == undefined == true + if (showContent === false || !this.option.tooltip.showContent) { + // 只用tooltip的行为,不显示主体 + return; + } + + if (!this.hasAppend) { + this._tDom.style.left = this._zrWidth / 2 + 'px'; + this._tDom.style.top = this._zrHeight / 2 + 'px'; + this.dom.firstChild.appendChild(this._tDom); + this.hasAppend = true; + } + this._show(position, x + 10, y + 10, specialCssText); + } + }, + + /** + * 极坐标 + */ + _showPolarTrigger: function (polarIndex, dataIndex) { + if (this.component.polar == null + || polarIndex == null + || dataIndex == null + || dataIndex < 0 + ) { + return false; + } + var series = this.option.series; + var seriesArray = []; + + var formatter; + var position; + var showContent; + var specialCssText = ''; + if (this.option.tooltip.trigger === 'axis') { + if (!this.option.tooltip.show) { + return false; + } + formatter = this.option.tooltip.formatter; + position = this.option.tooltip.position; + } + var indicatorName = this.option.polar[polarIndex].indicator[dataIndex].text; + + // 找到所有用这个极坐标并且axis触发的系列数据 + for (var i = 0, l = series.length; i < l; i++) { + if (!this._isSelected(series[i].name)) { + continue; + } + if (series[i].polarIndex === polarIndex + && this.deepQuery([series[i], this.option], 'tooltip.trigger') === 'axis' + ) { + showContent = this.query(series[i], 'tooltip.showContent') + || showContent; + formatter = this.query(series[i], 'tooltip.formatter') + || formatter; + position = this.query(series[i], 'tooltip.position') + || position; + specialCssText += this._style(this.query(series[i], 'tooltip')); + seriesArray.push(series[i]); + } + } + if (seriesArray.length > 0) { + var polarData; + var data; + var params = []; + + for (var i = 0, l = seriesArray.length; i < l; i++) { + polarData = seriesArray[i].data; + for (var j = 0, k = polarData.length; j < k; j++) { + data = polarData[j]; + if (!this._isSelected(data.name)) { + continue; + } + data = data != null + ? data + : {name:'', value: {dataIndex:'-'}}; + + params.push([ + seriesArray[i].name || '', + data.name, + data.value[dataIndex].value != null + ? data.value[dataIndex].value : data.value[dataIndex], + indicatorName + ]); + } + } + if (params.length <= 0) { + return; + } + if (typeof formatter === 'function') { + this._curTicket = 'axis:' + dataIndex; + this._tDom.innerHTML = formatter.call( + this.myChart, params, this._curTicket, this._setContent + ); + } + else if (typeof formatter === 'string') { + formatter = formatter.replace('{a}','{a0}') + .replace('{b}','{b0}') + .replace('{c}','{c0}') + .replace('{d}','{d0}'); + for (var i = 0, l = params.length; i < l; i++) { + formatter = formatter.replace( + '{a' + i + '}', + this._encodeHTML(params[i][0]) + ); + formatter = formatter.replace( + '{b' + i + '}', + this._encodeHTML(params[i][1]) + ); + formatter = formatter.replace( + '{c' + i + '}', + this.numAddCommas(params[i][2]) + ); + formatter = formatter.replace( + '{d' + i + '}', + this._encodeHTML(params[i][3]) + ); + } + this._tDom.innerHTML = formatter; + } + else { + formatter = this._encodeHTML(params[0][1]) + '
' + + this._encodeHTML(params[0][3]) + ' : ' + + this.numAddCommas(params[0][2]); + for (var i = 1, l = params.length; i < l; i++) { + formatter += '
' + this._encodeHTML(params[i][1]) + + '
'; + formatter += this._encodeHTML(params[i][3]) + ' : ' + + this.numAddCommas(params[i][2]); + } + this._tDom.innerHTML = formatter; + } + + // don't modify, just false, showContent == undefined == true + if (showContent === false || !this.option.tooltip.showContent) { + // 只用tooltip的行为,不显示主体 + return; + } + + if (!this.hasAppend) { + this._tDom.style.left = this._zrWidth / 2 + 'px'; + this._tDom.style.top = this._zrHeight / 2 + 'px'; + this.dom.firstChild.appendChild(this._tDom); + this.hasAppend = true; + } + this._show( + position, + zrEvent.getX(this._event), + zrEvent.getY(this._event), + specialCssText + ); + return true; + } + }, + + _showItemTrigger: function () { + if (!this._curTarget) { + return; + } + var serie = ecData.get(this._curTarget, 'series'); + var data = ecData.get(this._curTarget, 'data'); + var name = ecData.get(this._curTarget, 'name'); + var value = ecData.get(this._curTarget, 'value'); + var special = ecData.get(this._curTarget, 'special'); + var special2 = ecData.get(this._curTarget, 'special2'); + // 从低优先级往上找到trigger为item的formatter和样式 + var formatter; + var position; + var showContent; + var specialCssText = ''; + var indicator; + var html = ''; + if (this._curTarget._type != 'island') { + // 全局 + if (this.option.tooltip.trigger === 'item') { + formatter = this.option.tooltip.formatter; + position = this.option.tooltip.position; + } + // 系列 + if (this.query(serie, 'tooltip.trigger') === 'item') { + showContent = this.query(serie, 'tooltip.showContent') + || showContent; + formatter = this.query(serie, 'tooltip.formatter') + || formatter; + position = this.query(serie, 'tooltip.position') + || position; + specialCssText += this._style(this.query(serie, 'tooltip')); + } + // 数据项 + showContent = this.query(data, 'tooltip.showContent') + || showContent; + formatter = this.query(data, 'tooltip.formatter') + || formatter; + position = this.query(data, 'tooltip.position') + || position; + specialCssText += this._style(this.query(data, 'tooltip')); + } + else { + showContent = this.deepQuery([data, serie, this.option], 'tooltip.showContent'); + formatter = this.deepQuery([data, serie, this.option], 'tooltip.islandFormatter'); + position = this.deepQuery([data, serie, this.option], 'tooltip.islandPosition'); + } + + if (typeof formatter === 'function') { + this._curTicket = (serie.name || '') + + ':' + + ecData.get(this._curTarget, 'dataIndex'); + this._tDom.innerHTML = formatter.call( + this.myChart, + [ + serie.name || '', + name, + value, + special, + special2, + data + ], + this._curTicket, + this._setContent + ); + } + else if (typeof formatter === 'string') { + this._curTicket = NaN; + formatter = formatter.replace('{a}','{a0}') + .replace('{b}','{b0}') + .replace('{c}','{c0}'); + formatter = formatter.replace('{a0}', this._encodeHTML(serie.name || '')) + .replace('{b0}', this._encodeHTML(name)) + .replace( + '{c0}', + value instanceof Array ? value : this.numAddCommas(value) + ); + + formatter = formatter.replace('{d}','{d0}') + .replace('{d0}', special || ''); + formatter = formatter.replace('{e}','{e0}') + .replace('{e0}', ecData.get(this._curTarget, 'special2') || ''); + + this._tDom.innerHTML = formatter; + } + else { + this._curTicket = NaN; + if (serie.type === ecConfig.CHART_TYPE_SCATTER) { + this._tDom.innerHTML = '' + + (serie.name != null ? (this._encodeHTML(serie.name) + '
') : '') + + (name === '' ? '' : (this._encodeHTML(name) + ' : ')) + + value + + (special == null ? '' : (' (' + special + ')')); + } + else if (serie.type === ecConfig.CHART_TYPE_RADAR && special) { + indicator = special; + html += this._encodeHTML(name === '' ? (serie.name || '') : name); + html += html === '' ? '' : '
'; + for (var i = 0 ; i < indicator.length; i ++) { + html += this._encodeHTML(indicator[i].text) + ' : ' + + this.numAddCommas(value[i]) + '
'; + } + this._tDom.innerHTML = html; + } + else if (serie.type === ecConfig.CHART_TYPE_CHORD) { + if (special2 == null) { + // 外环上 + this._tDom.innerHTML = this._encodeHTML(name) + ' (' + + this.numAddCommas(value) + ')'; + } + else { + var name1 = this._encodeHTML(name); + var name2 = this._encodeHTML(special); + // 内部弦上 + this._tDom.innerHTML = '' + + (serie.name != null ? (this._encodeHTML(serie.name) + '
') : '') + + name1 + ' -> ' + name2 + + ' (' + this.numAddCommas(value) + ')' + + '
' + + name2 + ' -> ' + name1 + + ' (' + this.numAddCommas(special2) + ')'; + } + } + else { + this._tDom.innerHTML = '' + + (serie.name != null ? (this._encodeHTML(serie.name) + '
') : '') + + this._encodeHTML(name) + ' : ' + + this.numAddCommas(value) + + (special == null ? '' : (' ('+ this.numAddCommas(special) +')')); + } + } + + if (!this._axisLineShape.invisible + || !this._axisShadowShape.invisible + ) { + this._axisLineShape.invisible = true; + this.zr.modShape(this._axisLineShape.id); + this._axisShadowShape.invisible = true; + this.zr.modShape(this._axisShadowShape.id); + this.zr.refresh(); + } + + // don't modify, just false, showContent == undefined == true + if (showContent === false || !this.option.tooltip.showContent) { + // 只用tooltip的行为,不显示主体 + return; + } + + if (!this.hasAppend) { + this._tDom.style.left = this._zrWidth / 2 + 'px'; + this._tDom.style.top = this._zrHeight / 2 + 'px'; + this.dom.firstChild.appendChild(this._tDom); + this.hasAppend = true; + } + + this._show( + position, + zrEvent.getX(this._event) + 20, + zrEvent.getY(this._event) - 20, + specialCssText + ); + }, + + /** + * 设置坐标轴指示器样式 + */ + _styleAxisPointer: function (seriesArray, xStart, yStart, xEnd, yEnd, gap, x, y) { + if (seriesArray.length > 0) { + var queryTarget; + var curType; + var axisPointer = this.option.tooltip.axisPointer; + var pointType = axisPointer.type; + var style = { + line: { }, + cross: { }, + shadow: { } + }; + for (var pType in style) { + style[pType].color = axisPointer[pType + 'Style'].color; + style[pType].width = axisPointer[pType + 'Style'].width; + style[pType].type = axisPointer[pType + 'Style'].type; + } + for (var i = 0, l = seriesArray.length; i < l; i++) { + if (this.deepQuery( + [seriesArray[i], this.option], 'tooltip.trigger' + ) === 'axis' + ) { + queryTarget = seriesArray[i]; + curType = this.query(queryTarget, 'tooltip.axisPointer.type'); + pointType = curType || pointType; + if (curType) { + style[curType].color = this.query( + queryTarget, + 'tooltip.axisPointer.' + curType + 'Style.color' + ) || style[curType].color; + style[curType].width = this.query( + queryTarget, + 'tooltip.axisPointer.' + curType + 'Style.width' + ) || style[curType].width; + style[curType].type = this.query( + queryTarget, + 'tooltip.axisPointer.' + curType + 'Style.type' + ) || style[curType].type; + } + } + } + + if (pointType === 'line') { + this._axisLineShape.style = { + xStart: xStart, + yStart: yStart, + xEnd: xEnd, + yEnd: yEnd, + strokeColor: style.line.color, + lineWidth: style.line.width, + lineType: style.line.type + }; + this._axisLineShape.invisible = false; + this.zr.modShape(this._axisLineShape.id); + } + else if (pointType === 'cross') { + this._axisCrossShape.style = { + brushType: 'stroke', + rect: this.component.grid.getArea(), + x: x, + y: y, + text: ('( ' + + this.component.xAxis.getAxis(0).getValueFromCoord(x) + + ' , ' + + this.component.yAxis.getAxis(0).getValueFromCoord(y) + + ' )' + ).replace(' , ', ' ').replace(' , ', ' '), + textPosition: 'specific', + strokeColor: style.cross.color, + lineWidth: style.cross.width, + lineType: style.cross.type + }; + if (this.component.grid.getXend() - x > 100) { // 右侧有空间 + this._axisCrossShape.style.textAlign = 'left'; + this._axisCrossShape.style.textX = x + 10; + } + else { + this._axisCrossShape.style.textAlign = 'right'; + this._axisCrossShape.style.textX = x - 10; + } + if (y - this.component.grid.getY() > 50) { // 上方有空间 + this._axisCrossShape.style.textBaseline = 'bottom'; + this._axisCrossShape.style.textY = y - 10; + } + else { + this._axisCrossShape.style.textBaseline = 'top'; + this._axisCrossShape.style.textY = y + 10; + } + this._axisCrossShape.invisible = false; + this.zr.modShape(this._axisCrossShape.id); + } + else if (pointType === 'shadow') { + if (style.shadow.width == null + || style.shadow.width === 'auto' + || isNaN(style.shadow.width) + ) { + style.shadow.width = gap; + } + if (xStart === xEnd) { + // 纵向 + if (Math.abs(this.component.grid.getX() - xStart) < 2) { + // 最左边 + style.shadow.width /= 2; + xStart = xEnd = xEnd + style.shadow.width / 2; + } + else if (Math.abs(this.component.grid.getXend() - xStart) < 2) { + // 最右边 + style.shadow.width /= 2; + xStart = xEnd = xEnd - style.shadow.width / 2; + } + } + else if (yStart === yEnd) { + // 横向 + if (Math.abs(this.component.grid.getY() - yStart) < 2) { + // 最上边 + style.shadow.width /= 2; + yStart = yEnd = yEnd + style.shadow.width / 2; + } + else if (Math.abs(this.component.grid.getYend() - yStart) < 2) { + // 最右边 + style.shadow.width /= 2; + yStart = yEnd = yEnd - style.shadow.width / 2; + } + } + this._axisShadowShape.style = { + xStart: xStart, + yStart: yStart, + xEnd: xEnd, + yEnd: yEnd, + strokeColor: style.shadow.color, + lineWidth: style.shadow.width + }; + this._axisShadowShape.invisible = false; + this.zr.modShape(this._axisShadowShape.id); + } + this.zr.refresh(); + } + }, + + __onmousemove: function (param) { + clearTimeout(this._hidingTicket); + clearTimeout(this._showingTicket); + var target = param.target; + var mx = zrEvent.getX(param.event); + var my = zrEvent.getY(param.event); + if (!target) { + // 判断是否落到直角系里,axis触发的tooltip + this._curTarget = false; + this._event = param.event; + // this._event._target = this._event.target || this._event.toElement; + this._event.zrenderX = mx; + this._event.zrenderY = my; + if (this._needAxisTrigger + && this.component.grid + && zrArea.isInside(rectangleInstance, this.component.grid.getArea(), mx, my) + ) { + this._showingTicket = setTimeout(this._tryShow, this._showDelay); + } + else if (this._needAxisTrigger + && this.component.polar + && this.component.polar.isInside([mx, my]) != -1 + ) { + this._showingTicket = setTimeout(this._tryShow, this._showDelay); + } + else { + !this._event.connectTrigger && this.messageCenter.dispatch( + ecConfig.EVENT.TOOLTIP_OUT_GRID, + this._event, + null, + this.myChart + ); + this._hidingTicket = setTimeout(this._hide, this._hideDelay); + } + } + else { + this._curTarget = target; + this._event = param.event; + // this._event._target = this._event.target || this._event.toElement; + this._event.zrenderX = mx; + this._event.zrenderY = my; + var polarIndex; + if (this._needAxisTrigger + && this.component.polar + && (polarIndex = this.component.polar.isInside([mx, my])) != -1 + ) { + // 看用这个polar的系列数据是否是axis触发,如果是设置_curTarget为nul + var series = this.option.series; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].polarIndex === polarIndex + && this.deepQuery( + [series[i], this.option], 'tooltip.trigger' + ) === 'axis' + ) { + this._curTarget = null; + break; + } + } + + } + this._showingTicket = setTimeout(this._tryShow, this._showDelay); + } + }, + + /** + * zrender事件响应:鼠标离开绘图区域 + */ + __onglobalout: function () { + clearTimeout(this._hidingTicket); + clearTimeout(this._showingTicket); + this._hidingTicket = setTimeout(this._hide, this._hideDelay); + }, + + /** + * 异步回调填充内容 + */ + __setContent: function (ticket, content) { + if (!this._tDom) { + return; + } + if (ticket === this._curTicket) { + this._tDom.innerHTML = content; + } + + setTimeout(this._refixed, 20); + }, + + ontooltipHover: function (param, tipShape) { + if (!this._lastTipShape // 不存在或者存在但dataIndex发生变化才需要重绘 + || (this._lastTipShape && this._lastTipShape.dataIndex != param.dataIndex) + ) { + if (this._lastTipShape && this._lastTipShape.tipShape.length > 0) { + this.zr.delShape(this._lastTipShape.tipShape); + this.shapeList.length = 2; + } + for (var i = 0, l = tipShape.length; i < l; i++) { + tipShape[i].zlevel = this._zlevelBase; + tipShape[i].style = zrShapeBase.prototype.getHighlightStyle( + tipShape[i].style, + tipShape[i].highlightStyle + ); + tipShape[i].draggable = false; + tipShape[i].hoverable = false; + tipShape[i].clickable = false; + tipShape[i].ondragend = null; + tipShape[i].ondragover = null; + tipShape[i].ondrop = null; + this.shapeList.push(tipShape[i]); + this.zr.addShape(tipShape[i]); + } + this._lastTipShape = { + dataIndex: param.dataIndex, + tipShape: tipShape + }; + } + }, + + ondragend: function () { + this._hide(); + }, + + /** + * 图例选择 + */ + onlegendSelected: function (param) { + this._selectedMap = param.selected; + }, + + _setSelectedMap: function () { + if (this.component.legend) { + this._selectedMap = zrUtil.clone(this.component.legend.getSelectedMap()); + } + else { + this._selectedMap = {}; + } + }, + + _isSelected: function (itemName) { + if (this._selectedMap[itemName] != null) { + return this._selectedMap[itemName]; + } + else { + return true; // 没在legend里定义的都为true啊~ + } + }, + + /** + * 模拟tooltip hover方法 + * {object} params 参数 + * {seriesIndex: 0, seriesName:'', dataInex:0} line、bar、scatter、k、radar + * {seriesIndex: 0, seriesName:'', name:''} map、pie、chord + */ + showTip: function (params) { + if (!params) { + return; + } + + var seriesIndex; + var series = this.option.series; + if (params.seriesIndex != null) { + seriesIndex = params.seriesIndex; + } + else { + var seriesName = params.seriesName; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].name === seriesName) { + seriesIndex = i; + break; + } + } + } + + var serie = series[seriesIndex]; + if (serie == null) { + return; + } + var chart = this.myChart.chart[serie.type]; + var isAxisTrigger = this.deepQuery( + [serie, this.option], 'tooltip.trigger' + ) === 'axis'; + + if (!chart) { + return; + } + + if (isAxisTrigger) { + // axis trigger + var dataIndex = params.dataIndex; + switch (chart.type) { + case ecConfig.CHART_TYPE_LINE : + case ecConfig.CHART_TYPE_BAR : + case ecConfig.CHART_TYPE_K : + if (this.component.xAxis == null + || this.component.yAxis == null + || serie.data.length <= dataIndex + ) { + return; + } + var xAxisIndex = serie.xAxisIndex || 0; + var yAxisIndex = serie.yAxisIndex || 0; + if (this.component.xAxis.getAxis(xAxisIndex).type + === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + ) { + // 横轴是类目 + this._event = { + zrenderX: this.component.xAxis.getAxis(xAxisIndex) + .getCoordByIndex(dataIndex), + zrenderY: this.component.grid.getY() + + (this.component.grid.getYend() + - this.component.grid.getY() + ) / 4 + }; + } + else { + // 纵轴是类目 + this._event = { + zrenderX: this.component.grid.getX() + + (this.component.grid.getXend() + - this.component.grid.getX() + ) / 4, + zrenderY: this.component.yAxis.getAxis(yAxisIndex) + .getCoordByIndex(dataIndex) + }; + } + this._showAxisTrigger( + xAxisIndex, + yAxisIndex, + dataIndex + ); + break; + case ecConfig.CHART_TYPE_RADAR : + if (this.component.polar == null + || serie.data[0].value.length <= dataIndex + ) { + return; + } + var polarIndex = serie.polarIndex || 0; + var vector = this.component.polar.getVector( + polarIndex, dataIndex, 'max' + ); + this._event = { + zrenderX: vector[0], + zrenderY: vector[1] + }; + this._showPolarTrigger( + polarIndex, + dataIndex + ); + break; + } + } + else { + // item trigger + var shapeList = chart.shapeList; + var x; + var y; + switch (chart.type) { + case ecConfig.CHART_TYPE_LINE : + case ecConfig.CHART_TYPE_BAR : + case ecConfig.CHART_TYPE_K : + case ecConfig.CHART_TYPE_SCATTER : + var dataIndex = params.dataIndex; + for (var i = 0, l = shapeList.length; i < l; i++) { + if (ecData.get(shapeList[i], 'seriesIndex') === seriesIndex + && ecData.get(shapeList[i], 'dataIndex') === dataIndex + ) { + this._curTarget = shapeList[i]; + x = shapeList[i].style.x; + y = chart.type != ecConfig.CHART_TYPE_K + ? shapeList[i].style.y : shapeList[i].style.y[0]; + break; + } + } + break; + case ecConfig.CHART_TYPE_RADAR : + var dataIndex = params.dataIndex; + for (var i = 0, l = shapeList.length; i < l; i++) { + if (shapeList[i].type === 'polygon' + && ecData.get(shapeList[i], 'seriesIndex') === seriesIndex + && ecData.get(shapeList[i], 'dataIndex') === dataIndex + ) { + this._curTarget = shapeList[i]; + var vector = this.component.polar.getCenter( + serie.polarIndex || 0 + ); + x = vector[0]; + y = vector[1]; + break; + } + } + break; + case ecConfig.CHART_TYPE_PIE : + var name = params.name; + for (var i = 0, l = shapeList.length; i < l; i++) { + if (shapeList[i].type === 'sector' + && ecData.get(shapeList[i], 'seriesIndex') === seriesIndex + && ecData.get(shapeList[i], 'name') === name + ) { + this._curTarget = shapeList[i]; + var style = this._curTarget.style; + var midAngle = (style.startAngle + style.endAngle) + / 2 * Math.PI / 180; + x = this._curTarget.style.x + Math.cos(midAngle) * style.r / 1.5; + y = this._curTarget.style.y - Math.sin(midAngle) * style.r / 1.5; + break; + } + } + break; + case ecConfig.CHART_TYPE_MAP : + var name = params.name; + var mapType = serie.mapType; + for (var i = 0, l = shapeList.length; i < l; i++) { + if (shapeList[i].type === 'text' + && shapeList[i]._mapType === mapType + && shapeList[i].style._name === name + ) { + this._curTarget = shapeList[i]; + x = this._curTarget.style.x + this._curTarget.position[0]; + y = this._curTarget.style.y + this._curTarget.position[1]; + break; + } + } + break; + case ecConfig.CHART_TYPE_CHORD: + var name = params.name; + for (var i = 0, l = shapeList.length; i < l; i++) { + if (shapeList[i].type === 'sector' + && ecData.get(shapeList[i], 'name') === name + ) { + this._curTarget = shapeList[i]; + var style = this._curTarget.style; + var midAngle = (style.startAngle + style.endAngle) + / 2 * Math.PI / 180; + x = this._curTarget.style.x + Math.cos(midAngle) * (style.r - 2); + y = this._curTarget.style.y - Math.sin(midAngle) * (style.r - 2); + this.zr.trigger( + zrConfig.EVENT.MOUSEMOVE, + { + zrenderX: x, + zrenderY: y + } + ); + return; + } + } + break; + case ecConfig.CHART_TYPE_FORCE: + var name = params.name; + for (var i = 0, l = shapeList.length; i < l; i++) { + if (shapeList[i].type === 'circle' + && ecData.get(shapeList[i], 'name') === name + ) { + this._curTarget = shapeList[i]; + x = this._curTarget.position[0]; + y = this._curTarget.position[1]; + break; + } + } + break; + } + if (x != null && y != null) { + this._event = { + zrenderX: x, + zrenderY: y + }; + this.zr.addHoverShape(this._curTarget); + this.zr.refreshHover(); + this._showItemTrigger(); + } + } + }, + + /** + * 关闭,公开接口 + */ + hideTip: function () { + this._hide(); + }, + + /** + * 刷新 + */ + refresh: function (newOption) { + // this._selectedMap; + // this._defaultCssText; // css样式缓存 + // this._needAxisTrigger; // 坐标轴触发 + // this._curTarget; + // this._event; + // this._curTicket; // 异步回调标识,用来区分多个请求 + + // 缓存一些高宽数据 + this._zrHeight = this.zr.getHeight(); + this._zrWidth = this.zr.getWidth(); + + if (this._lastTipShape && this._lastTipShape.tipShape.length > 0) { + this.zr.delShape(this._lastTipShape.tipShape); + } + this._lastTipShape = false; + this.shapeList.length = 2; + + if (newOption) { + this.option = newOption; + this.option.tooltip = this.reformOption(this.option.tooltip); + this.option.tooltip.textStyle = zrUtil.merge( + this.option.tooltip.textStyle, + this.ecTheme.textStyle + ); + // 补全padding属性 + this.option.tooltip.padding = this.reformCssArray( + this.option.tooltip.padding + ); + + this._needAxisTrigger = false; + if (this.option.tooltip.trigger === 'axis') { + this._needAxisTrigger = true; + } + + var series = this.option.series; + for (var i = 0, l = series.length; i < l; i++) { + if (this.query(series[i], 'tooltip.trigger') === 'axis') { + this._needAxisTrigger = true; + break; + } + } + // this._hidingTicket; + // this._showingTicket; + this._showDelay = this.option.tooltip.showDelay; // 显示延迟 + this._hideDelay = this.option.tooltip.hideDelay; // 隐藏延迟 + this._defaultCssText = this._style(this.option.tooltip); + + this._setSelectedMap(); + this._axisLineWidth = this.option.tooltip.axisPointer.lineStyle.width; + } + if (this.showing) { + var self = this; + setTimeout(function(){ + self.zr.trigger(zrConfig.EVENT.MOUSEMOVE, self.zr.handler._event); + },50); + } + }, + + /** + * 释放后实例不可用,重载基类方法 + */ + dispose: function () { + if (this._lastTipShape && this._lastTipShape.tipShape.length > 0) { + this.zr.delShape(this._lastTipShape.tipShape); + } + this.clear(); + this.shapeList = null; + + clearTimeout(this._hidingTicket); + clearTimeout(this._showingTicket); + this.zr.un(zrConfig.EVENT.MOUSEMOVE, this._onmousemove); + this.zr.un(zrConfig.EVENT.GLOBALOUT, this._onglobalout); + + if (this.hasAppend) { + this.dom.firstChild.removeChild(this._tDom); + } + this._tDom = null; + }, + + /** + * html转码的方法 + */ + _encodeHTML: function (source) { + return String(source) + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"') + .replace(/'/g, '''); + } + }; + + zrUtil.inherits(Tooltip, Base); + + require('../component').define('tooltip', Tooltip); + + return Tooltip; +}); +/** + * 圆环 + * @module zrender/shape/Ring + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + * @example + * var Ring = require('zrender/shape/Ring'); + * var shape = new Ring({ + * style: { + * x: 100, + * y: 100, + * r0: 30, + * r: 50 + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} IRingStyle + * @property {number} x 圆心x坐标 + * @property {number} y 圆心y坐标 + * @property {number} r0 内圆半径 + * @property {number} r 外圆半径 + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ +define( + 'zrender/shape/Ring',['require','./Base','../tool/util'],function (require) { + var Base = require('./Base'); + + /** + * @alias module:zrender/shape/Ring + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var Ring = function (options) { + Base.call(this, options); + /** + * 圆环绘制样式 + * @name module:zrender/shape/Ring#style + * @type {module:zrender/shape/Ring~IRingStyle} + */ + /** + * 圆环高亮绘制样式 + * @name module:zrender/shape/Ring#highlightStyle + * @type {module:zrender/shape/Ring~IRingStyle} + */ + }; + + Ring.prototype = { + type: 'ring', + + /** + * 创建圆环路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Ring~IRingStyle} style + */ + buildPath : function (ctx, style) { + // 非零环绕填充优化 + ctx.arc(style.x, style.y, style.r, 0, Math.PI * 2, false); + ctx.moveTo(style.x + style.r0, style.y); + ctx.arc(style.x, style.y, style.r0, 0, Math.PI * 2, true); + return; + }, + + /** + * 计算返回圆环包围盒矩阵 + * @param {module:zrender/shape/Ring~IRingStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function (style) { + if (style.__rect) { + return style.__rect; + } + + var lineWidth; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } + else { + lineWidth = 0; + } + style.__rect = { + x : Math.round(style.x - style.r - lineWidth / 2), + y : Math.round(style.y - style.r - lineWidth / 2), + width : style.r * 2 + lineWidth, + height : style.r * 2 + lineWidth + }; + + return style.__rect; + } + }; + + require('../tool/util').inherits(Ring, Base); + return Ring; + } +); + +/** + * 扇形 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @module zrender/shape/Sector + * @example + * var Sector = require('zrender/shape/Sector'); + * var shape = new Sector({ + * style: { + * x: 100, + * y: 100, + * r: 60, + * r0: 30, + * startAngle: 0, + * endEngle: 180 + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} ISectorStyle + * @property {number} x 圆心x坐标 + * @property {number} y 圆心y坐标 + * @property {number} r 外圆半径 + * @property {number} [r0=0] 内圆半径,指定后将出现内弧,同时扇边长度为`r - r0` + * @property {number} startAngle 起始角度,`[0, 360)` + * @property {number} endAngle 结束角度,`(0, 360]` + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ + +define( + 'zrender/shape/Sector',['require','../tool/math','./Base','./Ring','./Polygon','../tool/util'],function (require) { + var math = require('../tool/math'); + var Base = require('./Base'); + + /** + * @alias module:zrender/shape/Sector + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var Sector = function (options) { + Base.call(this, options); + /** + * 扇形绘制样式 + * @name module:zrender/shape/Sector#style + * @type {module:zrender/shape/Sector~ISectorStyle} + */ + /** + * 扇形高亮绘制样式 + * @name module:zrender/shape/Sector#highlightStyle + * @type {module:zrender/shape/Sector~ISectorStyle} + */ + }; + + Sector.prototype = { + type: 'sector', + + /** + * 创建扇形路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Sector~ISectorStyle} style + */ + buildPath : function (ctx, style) { + var x = style.x; // 圆心x + var y = style.y; // 圆心y + var r0 = typeof style.r0 == 'undefined' // 形内半径[0,r) + ? 0 : style.r0; + var r = style.r; // 扇形外半径(0,r] + var startAngle = style.startAngle; // 起始角度[0,360) + var endAngle = style.endAngle; // 结束角度(0,360] + + if (Math.abs(endAngle - startAngle) >= 360) { + // 大于360度的扇形简化为圆环画法 + ctx.arc(x, y, r, 0, Math.PI * 2, false); + if (r0 !== 0) { + ctx.moveTo(x + r0, y); + ctx.arc(x, y, r0, 0, Math.PI * 2, true); + } + return; + } + + startAngle = math.degreeToRadian(startAngle); + endAngle = math.degreeToRadian(endAngle); + + var PI2 = Math.PI * 2; + var cosStartAngle = math.cos(startAngle); + var sinStartAngle = math.sin(startAngle); + ctx.moveTo( + cosStartAngle * r0 + x, + y - sinStartAngle * r0 + ); + + ctx.lineTo( + cosStartAngle * r + x, + y - sinStartAngle * r + ); + + ctx.arc(x, y, r, PI2 - startAngle, PI2 - endAngle, true); + + ctx.lineTo( + math.cos(endAngle) * r0 + x, + y - math.sin(endAngle) * r0 + ); + + if (r0 !== 0) { + ctx.arc(x, y, r0, PI2 - endAngle, PI2 - startAngle, false); + } + + ctx.closePath(); + + return; + }, + + /** + * 返回扇形包围盒矩形 + * @param {module:zrender/shape/Sector~ISectorStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function (style) { + if (style.__rect) { + return style.__rect; + } + + var x = style.x; // 圆心x + var y = style.y; // 圆心y + var r0 = typeof style.r0 == 'undefined' // 形内半径[0,r) + ? 0 : style.r0; + var r = style.r; // 扇形外半径(0,r] + var startAngle = style.startAngle; // 起始角度[0,360) + var endAngle = style.endAngle; // 结束角度(0,360] + + if (Math.abs(endAngle - startAngle) >= 360) { + // 大于360度的扇形简化为圆环bbox + style.__rect = require('./Ring').prototype.getRect(style); + return style.__rect; + } + + startAngle = (720 + startAngle) % 360; + endAngle = (720 + endAngle) % 360; + if (endAngle <= startAngle) { + endAngle += 360; + } + var pointList = []; + if (startAngle <= 90 && endAngle >= 90) { + pointList.push([ + x, y - r + ]); + } + if (startAngle <= 180 && endAngle >= 180) { + pointList.push([ + x - r, y + ]); + } + if (startAngle <= 270 && endAngle >= 270) { + pointList.push([ + x, y + r + ]); + } + if (startAngle <= 360 && endAngle >= 360) { + pointList.push([ + x + r, y + ]); + } + + startAngle = math.degreeToRadian(startAngle); + endAngle = math.degreeToRadian(endAngle); + + + pointList.push([ + math.cos(startAngle) * r0 + x, + y - math.sin(startAngle) * r0 + ]); + + pointList.push([ + math.cos(startAngle) * r + x, + y - math.sin(startAngle) * r + ]); + + pointList.push([ + math.cos(endAngle) * r + x, + y - math.sin(endAngle) * r + ]); + + pointList.push([ + math.cos(endAngle) * r0 + x, + y - math.sin(endAngle) * r0 + ]); + + style.__rect = require('./Polygon').prototype.getRect({ + brushType : style.brushType, + lineWidth : style.lineWidth, + pointList : pointList + }); + + return style.__rect; + } + }; + + + require('../tool/util').inherits(Sector, Base); + return Sector; + } +); + +/** + * zrender + * + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + * shape类:蜡烛 + * 可配图形属性: + { + // 基础属性 + shape : 'candle', // 必须,shape类标识,需要显式指定 + id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 + zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 + invisible : {boolean}, // 默认为false,是否可见 + + // 样式属性,默认状态样式样式属性 + style : { + x : {number}, // 必须,横坐标 + y : {Array}, // 必须,纵坐标数组 + }, + + // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 + highlightStyle : { + // 同style + } + + // 交互属性,详见shape.Base + + // 事件属性,详见shape.Base + } + 例子: + { + shape : 'candle', + id : '123456', + zlevel : 1, + style : { + x : 200, + y : [100,123,90,125], + width : 150, + color : '#eee', + text : 'Baidu' + }, + myName : 'kener', // 可自带任何有效自定义属性 + + clickable : true, + onClick : function (eventPacket) { + alert(eventPacket.target.myName); + } + } + */ +define('echarts/util/shape/Candle',['require','zrender/shape/Base','zrender/tool/util','./normalIsCover'],function (require) { + var Base = require('zrender/shape/Base'); + var zrUtil = require('zrender/tool/util'); + + function Candle(options) { + Base.call(this, options); + } + + Candle.prototype = { + type: 'candle', + _numberOrder : function (a, b) { + return b - a; + }, + + /** + * 创建矩形路径 + * @param {Context2D} ctx Canvas 2D上下文 + * @param {Object} style 样式 + */ + buildPath : function (ctx, style) { + var yList = zrUtil.clone(style.y).sort(this._numberOrder); + + ctx.moveTo(style.x, yList[3]); + ctx.lineTo(style.x, yList[2]); + ctx.moveTo(style.x - style.width / 2, yList[2]); + ctx.rect( + style.x - style.width / 2, + yList[2], + style.width, + yList[1] - yList[2] + ); + ctx.moveTo(style.x, yList[1]); + ctx.lineTo(style.x, yList[0]); + }, + + /** + * 返回矩形区域,用于局部刷新和文字定位 + * @param {Object} style + */ + getRect : function (style) { + if (!style.__rect) { + var lineWidth = 0; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } + + var yList = zrUtil.clone(style.y).sort(this._numberOrder); + style.__rect = { + x : Math.round(style.x - style.width / 2 - lineWidth / 2), + y : Math.round(yList[3] - lineWidth / 2), + width : style.width + lineWidth, + height : yList[0] - yList[3] + lineWidth + }; + } + + return style.__rect; + }, + + + isCover : require('./normalIsCover') + }; + + zrUtil.inherits(Candle, Base); + + return Candle; +}); + +/** + * echarts组件:图例 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/component/legend',['require','./base','zrender/shape/Text','zrender/shape/Rectangle','zrender/shape/Sector','../util/shape/Icon','../util/shape/Candle','../config','zrender/tool/util','zrender/tool/area','../component'],function (require) { + var Base = require('./base'); + + // 图形依赖 + var TextShape = require('zrender/shape/Text'); + var RectangleShape = require('zrender/shape/Rectangle'); + var SectorShape = require('zrender/shape/Sector'); + //var BeziercurveShape = require('zrender/shape/Beziercurve'); + var IconShape = require('../util/shape/Icon'); + var CandleShape = require('../util/shape/Candle'); + + var ecConfig = require('../config'); + var zrUtil = require('zrender/tool/util'); + var zrArea = require('zrender/tool/area'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} option 图表参数 + */ + function Legend(ecTheme, messageCenter, zr, option, myChart) { + if (!this.query(option, 'legend.data')) { + console.error('option.legend.data has not been defined.'); + return; + } + + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + + var self = this; + self._legendSelected = function (param) { + self.__legendSelected(param); + }; + + this._colorIndex = 0; + this._colorMap = {}; + this._selectedMap = {}; + + this.refresh(option); + } + + Legend.prototype = { + type: ecConfig.COMPONENT_TYPE_LEGEND, + _buildShape: function () { + // 图例元素组的位置参数,通过计算所得x, y, width, height + this._itemGroupLocation = this._getItemGroupLocation(); + + this._buildBackground(); + this._buildItem(); + + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + }, + + /** + * 构建所有图例元素 + */ + _buildItem: function () { + var data = this.legendOption.data; + var dataLength = data.length; + var itemName; + var itemType; + var itemShape; + var textShape; + var textStyle = this.legendOption.textStyle; + var dataTextStyle; + var dataFont; + var formattedName; + + var zrWidth = this.zr.getWidth(); + var zrHeight = this.zr.getHeight(); + var lastX = this._itemGroupLocation.x; + var lastY = this._itemGroupLocation.y; + var itemWidth = this.legendOption.itemWidth; + var itemHeight = this.legendOption.itemHeight; + var itemGap = this.legendOption.itemGap; + var color; + + if (this.legendOption.orient === 'vertical' && this.legendOption.x === 'right') { + lastX = this._itemGroupLocation.x + + this._itemGroupLocation.width + - itemWidth; + } + + for (var i = 0; i < dataLength; i++) { + dataTextStyle = zrUtil.merge( + data[i].textStyle || {}, + textStyle + ); + dataFont = this.getFont(dataTextStyle); + + itemName = this._getName(data[i]); + formattedName = this._getFormatterName(itemName); + if (itemName === '') { // 别帮我代码优化 + if (this.legendOption.orient === 'horizontal') { + lastX = this._itemGroupLocation.x; + lastY += itemHeight + itemGap; + } + else { + this.legendOption.x === 'right' + ? lastX -= this._itemGroupLocation.maxWidth + itemGap + : lastX += this._itemGroupLocation.maxWidth + itemGap; + lastY = this._itemGroupLocation.y; + } + continue; + } + itemType = data[i].icon || this._getSomethingByName(itemName).type; + + color = this.getColor(itemName); + + if (this.legendOption.orient === 'horizontal') { + if (zrWidth - lastX < 200 // 最后200px做分行预判 + && (itemWidth + 5 + zrArea.getTextWidth(formattedName, dataFont) + // 分行的最后一个不用算itemGap + + (i === dataLength - 1 || data[i + 1] === '' ? 0 : itemGap) + ) >= zrWidth - lastX + ) { + lastX = this._itemGroupLocation.x; + lastY += itemHeight + itemGap; + } + } + else { + if (zrHeight - lastY < 200 // 最后200px做分行预判 + && (itemHeight + // 分行的最后一个不用算itemGap + + (i === dataLength - 1 || data[i + 1] === '' ? 0 : itemGap) + ) + >= zrHeight - lastY + ) { + this.legendOption.x === 'right' + ? lastX -= this._itemGroupLocation.maxWidth + itemGap + : lastX += this._itemGroupLocation.maxWidth + itemGap; + lastY = this._itemGroupLocation.y; + } + } + + // 图形 + itemShape = this._getItemShapeByType( + lastX, lastY, + itemWidth, itemHeight, + (this._selectedMap[itemName] ? color : '#ccc'), + itemType, + color + ); + itemShape._name = itemName; + itemShape = new IconShape(itemShape); + + // 文字 + textShape = { + // shape: 'text', + zlevel: this._zlevelBase, + style: { + x: lastX + itemWidth + 5, + y: lastY + itemHeight / 2, + color: this._selectedMap[itemName] + ? (dataTextStyle.color === 'auto' ? color : dataTextStyle.color) + : '#ccc', + text: formattedName, + textFont: dataFont, + textBaseline: 'middle' + }, + highlightStyle: { + color: color, + brushType: 'fill' + }, + hoverable: !!this.legendOption.selectedMode, + clickable: !!this.legendOption.selectedMode + }; + + if (this.legendOption.orient === 'vertical' + && this.legendOption.x === 'right' + ) { + textShape.style.x -= (itemWidth + 10); + textShape.style.textAlign = 'right'; + } + + textShape._name = itemName; + textShape = new TextShape(textShape); + + if (this.legendOption.selectedMode) { + itemShape.onclick = textShape.onclick = this._legendSelected; + itemShape.onmouseover = textShape.onmouseover = this.hoverConnect; + itemShape.hoverConnect = textShape.id; + textShape.hoverConnect = itemShape.id; + } + this.shapeList.push(itemShape); + this.shapeList.push(textShape); + + if (this.legendOption.orient === 'horizontal') { + lastX += itemWidth + 5 + + zrArea.getTextWidth(formattedName, dataFont) + + itemGap; + } + else { + lastY += itemHeight + itemGap; + } + } + + if (this.legendOption.orient === 'horizontal' + && this.legendOption.x === 'center' + && lastY != this._itemGroupLocation.y + ) { + // 多行橫排居中优化 + this._mLineOptimize(); + } + }, + + _getName: function(data) { + return typeof data.name != 'undefined' ? data.name : data; + }, + + _getFormatterName: function(itemName) { + var formatter = this.legendOption.formatter; + var formattedName; + if (typeof formatter === 'function') { + formattedName = formatter.call(this.myChart, itemName); + } + else if (typeof formatter === 'string') { + formattedName = formatter.replace('{name}', itemName); + } + else { + formattedName = itemName; + } + return formattedName; + }, + + _getFormatterNameFromData: function(data) { + var itemName = this._getName(data); + return this._getFormatterName(itemName); + }, + + // 多行橫排居中优化 + _mLineOptimize: function () { + var lineOffsetArray = []; // 每行宽度 + var lastX = this._itemGroupLocation.x; + for (var i = 2, l = this.shapeList.length; i < l; i++) { + if (this.shapeList[i].style.x === lastX) { + lineOffsetArray.push( + ( + this._itemGroupLocation.width + - ( + this.shapeList[i - 1].style.x + + zrArea.getTextWidth( + this.shapeList[i - 1].style.text, + this.shapeList[i - 1].style.textFont + ) + - lastX + ) + ) / 2 + ); + } + else if (i === l - 1) { + lineOffsetArray.push( + ( + this._itemGroupLocation.width + - ( + this.shapeList[i].style.x + + zrArea.getTextWidth( + this.shapeList[i].style.text, + this.shapeList[i].style.textFont + ) + - lastX + ) + ) / 2 + ); + } + } + var curLineIndex = -1; + for (var i = 1, l = this.shapeList.length; i < l; i++) { + if (this.shapeList[i].style.x === lastX) { + curLineIndex++; + } + if (lineOffsetArray[curLineIndex] === 0) { + continue; + } + else { + this.shapeList[i].style.x += lineOffsetArray[curLineIndex]; + } + } + }, + + _buildBackground: function () { + var pTop = this.legendOption.padding[0]; + var pRight = this.legendOption.padding[1]; + var pBottom = this.legendOption.padding[2]; + var pLeft = this.legendOption.padding[3]; + + this.shapeList.push(new RectangleShape({ + zlevel: this._zlevelBase, + hoverable :false, + style: { + x: this._itemGroupLocation.x - pLeft, + y: this._itemGroupLocation.y - pTop, + width: this._itemGroupLocation.width + pLeft + pRight, + height: this._itemGroupLocation.height + pTop + pBottom, + brushType: this.legendOption.borderWidth === 0 ? 'fill' : 'both', + color: this.legendOption.backgroundColor, + strokeColor: this.legendOption.borderColor, + lineWidth: this.legendOption.borderWidth + } + })); + }, + + /** + * 根据选项计算图例实体的位置坐标 + */ + _getItemGroupLocation: function () { + var data = this.legendOption.data; + var dataLength = data.length; + var itemGap = this.legendOption.itemGap; + var itemWidth = this.legendOption.itemWidth + 5; // 5px是图形和文字的间隔,不可配 + var itemHeight = this.legendOption.itemHeight; + var textStyle = this.legendOption.textStyle; + var font = this.getFont(textStyle); + var totalWidth = 0; + var totalHeight = 0; + var padding = this.legendOption.padding; + var zrWidth = this.zr.getWidth() - padding[1] - padding[3]; + var zrHeight = this.zr.getHeight() - padding[0] - padding[2]; + + var temp = 0; // 宽高计算,用于多行判断 + var maxWidth = 0; // 垂直布局有用 + if (this.legendOption.orient === 'horizontal') { + // 水平布局,计算总宽度 + totalHeight = itemHeight; + for (var i = 0; i < dataLength; i++) { + if (this._getName(data[i]) === '') { + temp -= itemGap; + if (temp > zrWidth) { + totalWidth = zrWidth; + totalHeight += itemHeight + itemGap; + } + else { + totalWidth = Math.max(totalWidth, temp); + } + totalHeight += itemHeight + itemGap; + temp = 0; + continue; + } + temp += itemWidth + + zrArea.getTextWidth( + this._getFormatterNameFromData(data[i]), + data[i].textStyle + ? this.getFont(zrUtil.merge( + data[i].textStyle || {}, + textStyle + )) + : font + ) + + itemGap; + } + totalHeight = Math.max(totalHeight, itemHeight); + temp -= itemGap; // 减去最后一个的itemGap + if (temp > zrWidth) { + totalWidth = zrWidth; + totalHeight += itemHeight + itemGap; + } else { + totalWidth = Math.max(totalWidth, temp); + } + } + else { + // 垂直布局,计算总高度 + for (var i = 0; i < dataLength; i++) { + maxWidth = Math.max( + maxWidth, + zrArea.getTextWidth( + this._getFormatterNameFromData(data[i]), + data[i].textStyle + ? this.getFont(zrUtil.merge( + data[i].textStyle || {}, + textStyle + )) + : font + ) + ); + } + maxWidth += itemWidth; + totalWidth = maxWidth; + for (var i = 0; i < dataLength; i++) { + if (this._getName(data[i]) === '') { + temp -= itemGap; + if (temp > zrHeight) { + totalHeight = zrHeight; + totalWidth += maxWidth + itemGap; + } + else { + totalHeight = Math.max(totalHeight, temp); + } + totalWidth += maxWidth + itemGap; + temp = 0; + continue; + } + temp += itemHeight + itemGap; + } + totalWidth = Math.max(totalWidth, maxWidth); + temp -= itemGap; // 减去最后一个的itemGap + if (temp > zrHeight) { + totalHeight = zrHeight; + totalWidth += maxWidth + itemGap; + } else { + totalHeight = Math.max(totalHeight, temp); + } + } + + zrWidth = this.zr.getWidth(); + zrHeight = this.zr.getHeight(); + var x; + switch (this.legendOption.x) { + case 'center' : + x = Math.floor((zrWidth - totalWidth) / 2); + break; + case 'left' : + x = this.legendOption.padding[3] + this.legendOption.borderWidth; + break; + case 'right' : + x = zrWidth + - totalWidth + - this.legendOption.padding[1] + - this.legendOption.padding[3] + - this.legendOption.borderWidth * 2; + break; + default : + x = this.parsePercent(this.legendOption.x, zrWidth); + break; + } + + var y; + switch (this.legendOption.y) { + case 'top' : + y = this.legendOption.padding[0] + this.legendOption.borderWidth; + break; + case 'bottom' : + y = zrHeight + - totalHeight + - this.legendOption.padding[0] + - this.legendOption.padding[2] + - this.legendOption.borderWidth * 2; + break; + case 'center' : + y = Math.floor((zrHeight - totalHeight) / 2); + break; + default : + y = this.parsePercent(this.legendOption.y, zrHeight); + break; + } + + return { + x: x, + y: y, + width: totalWidth, + height: totalHeight, + maxWidth: maxWidth + }; + }, + + /** + * 根据名称返回series数据或data + */ + _getSomethingByName: function (name) { + var series = this.option.series; + var data; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].name === name) { + // 系列名称优先 + return { + type: series[i].type, + series: series[i], + seriesIndex: i, + data: null, + dataIndex: -1 + }; + } + + if ( + series[i].type === ecConfig.CHART_TYPE_PIE + || series[i].type === ecConfig.CHART_TYPE_RADAR + || series[i].type === ecConfig.CHART_TYPE_CHORD + || series[i].type === ecConfig.CHART_TYPE_FORCE + || series[i].type === ecConfig.CHART_TYPE_FUNNEL + ) { + data = series[i].type != ecConfig.CHART_TYPE_FORCE + ? series[i].data // 饼图、雷达图、和弦图得查找里面的数据名字 + : series[i].categories; // 力导布局查找categories配置 + for (var j = 0, k = data.length; j < k; j++) { + if (data[j].name === name) { + return { + type: series[i].type, + series: series[i], + seriesIndex: i, + data: data[j], + dataIndex: j + }; + } + } + } + } + return { + type: 'bar', + series: null, + seriesIndex: -1, + data: null, + dataIndex: -1 + }; + }, + + _getItemShapeByType: function (x, y, width, height, color, itemType, defaultColor) { + var highlightColor = color === '#ccc' ? defaultColor : color; + var itemShape = { + zlevel: this._zlevelBase, + style: { + iconType: 'legendicon' + itemType, + x: x, + y: y, + width: width, + height: height, + color: color, + strokeColor: color, + lineWidth: 2 + }, + highlightStyle: { + color: highlightColor, + strokeColor: highlightColor, + lineWidth: 1 + }, + hoverable: this.legendOption.selectedMode, + clickable: this.legendOption.selectedMode + }; + + var imageLocation; + if (itemType.match('image')) { + var imageLocation = itemType.replace( + new RegExp('^image:\\/\\/'), '' + ); + itemType = 'image'; + } + // 特殊设置 + switch (itemType) { + case 'line': + itemShape.style.brushType = 'stroke'; + itemShape.highlightStyle.lineWidth = 3; + break; + case 'radar': + case 'scatter': + itemShape.highlightStyle.lineWidth = 3; + break; + case 'k': + itemShape.style.brushType = 'both'; + itemShape.highlightStyle.lineWidth = 3; + itemShape.highlightStyle.color = + itemShape.style.color = this.query(this.ecTheme, 'k.itemStyle.normal.color') + || '#fff'; + itemShape.style.strokeColor = color != '#ccc' + ? (this.query(this.ecTheme, 'k.itemStyle.normal.lineStyle.color') + || '#ff3200') + : color; + break; + case 'image': + itemShape.style.iconType = 'image'; + itemShape.style.image = imageLocation; + if (color === '#ccc') { + itemShape.style.opacity = 0.5; + } + break; + } + return itemShape; + }, + + __legendSelected: function (param) { + var itemName = param.target._name; + if (this.legendOption.selectedMode === 'single') { + for (var k in this._selectedMap) { + this._selectedMap[k] = false; + } + } + this._selectedMap[itemName] = !this._selectedMap[itemName]; + this.messageCenter.dispatch( + ecConfig.EVENT.LEGEND_SELECTED, + param.event, + { + selected: this._selectedMap, + target: itemName + }, + this.myChart + ); + }, + + /** + * 刷新 + */ + refresh: function (newOption) { + if (newOption) { + this.option = newOption || this.option; + this.option.legend = this.reformOption(this.option.legend); + // 补全padding属性 + this.option.legend.padding = this.reformCssArray( + this.option.legend.padding + ); + this.legendOption = this.option.legend; + + var data = this.legendOption.data || []; + var itemName; + var something; + var color; + var queryTarget; + if (this.legendOption.selected) { + for (var k in this.legendOption.selected) { + this._selectedMap[k] = typeof this._selectedMap[k] != 'undefined' + ? this._selectedMap[k] + : this.legendOption.selected[k]; + } + } + for (var i = 0, dataLength = data.length; i < dataLength; i++) { + itemName = this._getName(data[i]); + if (itemName === '') { + continue; + } + something = this._getSomethingByName(itemName); + if (!something.series) { + this._selectedMap[itemName] = false; + } + else { + if (something.data + && (something.type === ecConfig.CHART_TYPE_PIE + || something.type === ecConfig.CHART_TYPE_FORCE + || something.type === ecConfig.CHART_TYPE_FUNNEL) + ) { + queryTarget = [something.data, something.series]; + } + else { + queryTarget = [something.series]; + } + + color = this.getItemStyleColor( + this.deepQuery(queryTarget, 'itemStyle.normal.color'), + something.seriesIndex, + something.dataIndex, + something.data + ); + if (color && something.type != ecConfig.CHART_TYPE_K) { + this.setColor(itemName, color); + } + this._selectedMap[itemName] = + typeof this._selectedMap[itemName] != 'undefined' + ? this._selectedMap[itemName] : true; + } + } + } + this.clear(); + this._buildShape(); + }, + + getRelatedAmount: function(name) { + var amount = 0; + var series = this.option.series; + var data; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].name === name) { + // 系列名称优先 + amount++; + } + + if ( + series[i].type === ecConfig.CHART_TYPE_PIE + || series[i].type === ecConfig.CHART_TYPE_RADAR + || series[i].type === ecConfig.CHART_TYPE_CHORD + || series[i].type === ecConfig.CHART_TYPE_FORCE + || series[i].type === ecConfig.CHART_TYPE_FUNNEL + ) { + data = series[i].type != ecConfig.CHART_TYPE_FORCE + ? series[i].data // 饼图、雷达图、和弦图得查找里面的数据名字 + : series[i].categories; // 力导布局查找categories配置 + for (var j = 0, k = data.length; j < k; j++) { + if (data[j].name === name && data[j].value != '-') { + amount++; + } + } + } + } + return amount; + }, + + setColor: function (legendName, color) { + this._colorMap[legendName] = color; + }, + + getColor: function (legendName) { + if (!this._colorMap[legendName]) { + this._colorMap[legendName] = this.zr.getColor(this._colorIndex++); + } + return this._colorMap[legendName]; + }, + + hasColor: function (legendName) { + return this._colorMap[legendName] ? this._colorMap[legendName] : false; + }, + + add: function (name, color){ + var data = this.legendOption.data; + for (var i = 0, dataLength = data.length; i < dataLength; i++) { + if (this._getName(data[i]) === name) { + // 已有就不重复加了 + return; + } + } + this.legendOption.data.push(name); + this.setColor(name,color); + this._selectedMap[name] = true; + }, + + del: function (name){ + var data = this.legendOption.data; + for (var i = 0, dataLength = data.length; i < dataLength; i++) { + if (this._getName(data[i]) === name) { + return this.legendOption.data.splice(i, 1); + } + } + }, + + /** + * 特殊图形元素回调设置 + * @param {Object} name + * @param {Object} itemShape + */ + getItemShape: function (name) { + if (name == null) { + return; + } + var shape; + for (var i = 0, l = this.shapeList.length; i < l; i++) { + shape = this.shapeList[i]; + if (shape._name === name && shape.type != 'text') { + return shape; + } + } + }, + + /** + * 特殊图形元素回调设置 + * @param {Object} name + * @param {Object} itemShape + */ + setItemShape: function (name, itemShape) { + var shape; + for (var i = 0, l = this.shapeList.length; i < l; i++) { + shape = this.shapeList[i]; + if (shape._name === name && shape.type != 'text') { + if (!this._selectedMap[name]) { + itemShape.style.color = '#ccc'; + itemShape.style.strokeColor = '#ccc'; + } + this.zr.modShape(shape.id, itemShape); + } + } + }, + + isSelected: function (itemName) { + if (typeof this._selectedMap[itemName] != 'undefined') { + return this._selectedMap[itemName]; + } + else { + // 没在legend里定义的都为true啊~ + return true; + } + }, + + getSelectedMap: function () { + return this._selectedMap; + }, + + setSelected: function(itemName, selectStatus) { + if (this.legendOption.selectedMode === 'single') { + for (var k in this._selectedMap) { + this._selectedMap[k] = false; + } + } + this._selectedMap[itemName] = selectStatus; + this.messageCenter.dispatch( + ecConfig.EVENT.LEGEND_SELECTED, + null, + { + selected: this._selectedMap, + target: itemName + }, + this.myChart + ); + }, + + /** + * 图例选择 + */ + onlegendSelected: function (param, status) { + var legendSelected = param.selected; + for (var itemName in legendSelected) { + if (this._selectedMap[itemName] != legendSelected[itemName]) { + // 有一项不一致都需要重绘 + status.needRefresh = true; + } + this._selectedMap[itemName] = legendSelected[itemName]; + } + return; + } + }; + + var legendIcon = { + line: function (ctx, style) { + var dy = style.height / 2; + ctx.moveTo(style.x, style.y + dy); + ctx.lineTo(style.x + style.width,style.y + dy); + }, + + pie: function (ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + SectorShape.prototype.buildPath(ctx, { + x: x + width / 2, + y: y + height + 2, + r: height + 2, + r0: 6, + startAngle: 45, + endAngle: 135 + }); + }, + /* + chord: function (ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + ctx.moveTo(x, y + height); + BeziercurveShape.prototype.buildPath(ctx, { + xStart: x, + yStart: y + height, + cpX1: x + width, + cpY1: y + height, + cpX2: x, + cpY2: y + 4, + xEnd: x + width, + yEnd: y + 4 + }); + ctx.lineTo(x + width, y); + BeziercurveShape.prototype.buildPath(ctx, { + xStart: x + width, + yStart: y, + cpX1: x, + cpY1: y, + cpX2: x + width, + cpY2: y + height - 4, + xEnd: x, + yEnd: y + height - 4 + }); + ctx.lineTo(x, y + height); + }, + */ + k: function (ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + CandleShape.prototype.buildPath(ctx, { + x: x + width / 2, + y: [y + 1, y + 1, y + height - 6, y + height], + width: width - 6 + }); + }, + + bar: function (ctx, style) { + var x = style.x; + var y = style.y +1; + var width = style.width; + var height = style.height - 2; + var r = 3; + + ctx.moveTo(x + r, y); + ctx.lineTo(x + width - r, y); + ctx.quadraticCurveTo( + x + width, y, x + width, y + r + ); + ctx.lineTo(x + width, y + height - r); + ctx.quadraticCurveTo( + x + width, y + height, x + width - r, y + height + ); + ctx.lineTo(x + r, y + height); + ctx.quadraticCurveTo( + x, y + height, x, y + height - r + ); + ctx.lineTo(x, y + r); + ctx.quadraticCurveTo(x, y, x + r, y); + }, + + force: function (ctx, style) { + IconShape.prototype.iconLibrary.circle(ctx, style); + }, + + radar: function (ctx, style) { + var n = 6; + var x = style.x + style.width / 2; + var y = style.y + style.height / 2; + var r = style.height / 2; + + var dStep = 2 * Math.PI / n; + var deg = -Math.PI / 2; + var xStart = x + r * Math.cos(deg); + var yStart = y + r * Math.sin(deg); + + ctx.moveTo(xStart, yStart); + deg += dStep; + for (var i = 0, end = n - 1; i < end; i ++) { + ctx.lineTo(x + r * Math.cos(deg), y + r * Math.sin(deg)); + deg += dStep; + } + ctx.lineTo(xStart, yStart); + } + }; + legendIcon.chord = legendIcon.pie; + legendIcon.map = legendIcon.bar; + + for (var k in legendIcon) { + IconShape.prototype.iconLibrary['legendicon' + k] = legendIcon[k]; + } + + zrUtil.inherits(Legend, Base); + + require('../component').define('legend', Legend); + + return Legend; +}); + + + +/** + * zrender + * + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + * shape类:时间轴线 + */ +define('echarts/util/shape/Chain',['require','zrender/shape/Base','./Icon','zrender/shape/util/dashedLineTo','zrender/tool/util','zrender/tool/matrix'],function (require) { + var Base = require('zrender/shape/Base'); + var IconShape = require('./Icon'); + + var dashedLineTo = require('zrender/shape/util/dashedLineTo'); + var zrUtil = require('zrender/tool/util'); + var matrix = require('zrender/tool/matrix'); + + function Chain(options) { + Base.call(this, options); + } + + Chain.prototype = { + type : 'chain', + + /** + * 画刷 + * @param ctx 画布句柄 + * @param e 形状实体 + * @param isHighlight 是否为高亮状态 + * @param updateCallback 需要异步加载资源的shape可以通过这个callback(e) + * 让painter更新视图,base.brush没用,需要的话重载brush + */ + brush : function (ctx, isHighlight) { + var style = this.style; + + if (isHighlight) { + // 根据style扩展默认高亮样式 + style = this.getHighlightStyle( + style, + this.highlightStyle || {} + ); + } + + ctx.save(); + this.setContext(ctx, style); + + // 设置transform + this.setTransform(ctx); + + ctx.save(); + ctx.beginPath(); + this.buildLinePath(ctx, style); + ctx.stroke(); + ctx.restore(); + + this.brushSymbol(ctx, style); + + ctx.restore(); + return; + }, + + /** + * 创建线条路径 + * @param {Context2D} ctx Canvas 2D上下文 + * @param {Object} style 样式 + */ + buildLinePath : function (ctx, style) { + var x = style.x; + var y = style.y + 5; + var width = style.width; + var height = style.height / 2 - 10; + + ctx.moveTo(x, y); + ctx.lineTo(x, y + height); + ctx.moveTo(x + width, y); + ctx.lineTo(x + width, y + height); + + ctx.moveTo(x, y + height / 2); + if (!style.lineType || style.lineType == 'solid') { + ctx.lineTo(x + width, y + height / 2); + } + else if (style.lineType == 'dashed' || style.lineType == 'dotted') { + var dashLength = (style.lineWidth || 1) + * (style.lineType == 'dashed' ? 5 : 1); + dashedLineTo(ctx, x, y + height / 2, x + width, y + height / 2, dashLength); + } + }, + + /** + * 标线始末标注 + */ + brushSymbol : function (ctx, style) { + var y = style.y + style.height / 4; + ctx.save(); + + var chainPoint = style.chainPoint; + var curPoint; + for (var idx = 0, l = chainPoint.length; idx < l; idx++) { + curPoint = chainPoint[idx]; + if (curPoint.symbol != 'none') { + ctx.beginPath(); + var symbolSize = curPoint.symbolSize; + IconShape.prototype.buildPath( + ctx, + { + iconType : curPoint.symbol, + x : curPoint.x - symbolSize, + y : y - symbolSize, + width : symbolSize * 2, + height : symbolSize * 2, + n : curPoint.n + } + ); + ctx.fillStyle = curPoint.isEmpty ? '#fff' : style.strokeColor; + ctx.closePath(); + ctx.fill(); + ctx.stroke(); + } + + if (curPoint.showLabel) { + ctx.font = curPoint.textFont; + ctx.fillStyle = curPoint.textColor; + ctx.textAlign = curPoint.textAlign; + ctx.textBaseline = curPoint.textBaseline; + if (curPoint.rotation) { + ctx.save(); + this._updateTextTransform(ctx, curPoint.rotation); + ctx.fillText(curPoint.name, curPoint.textX, curPoint.textY); + ctx.restore(); + } + else { + ctx.fillText(curPoint.name, curPoint.textX, curPoint.textY); + } + } + } + + ctx.restore(); + }, + + _updateTextTransform : function (ctx, rotation) { + var _transform = matrix.create(); + matrix.identity(_transform); + + if (rotation[0] !== 0) { + var originX = rotation[1] || 0; + var originY = rotation[2] || 0; + if (originX || originY) { + matrix.translate( + _transform, _transform, [-originX, -originY] + ); + } + matrix.rotate(_transform, _transform, rotation[0]); + if (originX || originY) { + matrix.translate( + _transform, _transform, [originX, originY] + ); + } + } + + // 保存这个变换矩阵 + ctx.transform.apply(ctx, _transform); + }, + + isCover : function (x, y) { + var rect = this.style; + if (x >= rect.x + && x <= (rect.x + rect.width) + && y >= rect.y + && y <= (rect.y + rect.height) + ) { + // 矩形内 + return true; + } + else { + return false; + } + } + }; + + zrUtil.inherits(Chain, Base); + + return Chain; +}); + +/** + * echarts组件:时间轴组件 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle','../util/shape/Icon','../util/shape/Chain','../config','zrender/tool/util','zrender/tool/area','zrender/tool/event','../component'],function (require) { + var Base = require('./base'); + + // 图形依赖 + var RectangleShape = require('zrender/shape/Rectangle'); + var IconShape = require('../util/shape/Icon'); + var ChainShape = require('../util/shape/Chain'); + + var ecConfig = require('../config'); + var zrUtil = require('zrender/tool/util'); + var zrArea = require('zrender/tool/area'); + var zrEvent = require('zrender/tool/event'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} option 图表参数 + */ + function Timeline(ecTheme, messageCenter, zr, option, myChart) { + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + + var self = this; + self._onclick = function(param) { + return self.__onclick(param); + }; + self._ondrift = function (dx, dy) { + return self.__ondrift(this, dx, dy); + }; + self._ondragend = function () { + return self.__ondragend(); + }; + self._setCurrentOption = function() { + var timelineOption = self.timelineOption; + self.currentIndex %= timelineOption.data.length; + // console.log(self.currentIndex); + var curOption = self.options[self.currentIndex] || {}; + self.myChart.setOption(curOption, timelineOption.notMerge); + + self.messageCenter.dispatch( + ecConfig.EVENT.TIMELINE_CHANGED, + null, + { + currentIndex: self.currentIndex, + data: timelineOption.data[self.currentIndex].name != null + ? timelineOption.data[self.currentIndex].name + : timelineOption.data[self.currentIndex] + }, + self.myChart + ); + }; + self._onFrame = function() { + self._setCurrentOption(); + self._syncHandleShape(); + + if (self.timelineOption.autoPlay) { + self.playTicket = setTimeout( + function() { + self.currentIndex += 1; + if (!self.timelineOption.loop + && self.currentIndex >= self.timelineOption.data.length + ) { + self.currentIndex = self.timelineOption.data.length - 1; + self.stop(); + return; + } + self._onFrame(); + }, + self.timelineOption.playInterval + ); + } + }; + + this.setTheme(false); + this.options = this.option.options; + this.currentIndex = this.timelineOption.currentIndex % this.timelineOption.data.length; + + if (!this.timelineOption.notMerge && this.currentIndex !== 0) { + /* + for (var i = 1, l = this.timelineOption.data.length; i < l; i++) { + this.options[i] = zrUtil.merge( + this.options[i], this.options[i - 1] + ); + } + */ + this.options[this.currentIndex] = zrUtil.merge( + this.options[this.currentIndex], this.options[0] + ); + } + + if (this.timelineOption.show) { + this._buildShape(); + this._syncHandleShape(); + } + + this._setCurrentOption(); + + if (this.timelineOption.autoPlay) { + var self = this; + this.playTicket = setTimeout( + function() { + self.play(); + }, + this.ecTheme.animationDuration + ); + } + } + + Timeline.prototype = { + type: ecConfig.COMPONENT_TYPE_TIMELINE, + _buildShape: function () { + // 位置参数,通过计算所得x, y, width, height + this._location = this._getLocation(); + this._buildBackground(); + this._buildControl(); + this._chainPoint = this._getChainPoint(); + if (this.timelineOption.label.show) { + // 标签显示的挑选间隔 + var interval = this._getInterval(); + for (var i = 0, len = this._chainPoint.length; i < len; i += interval) { + this._chainPoint[i].showLabel = true; + } + } + this._buildChain(); + this._buildHandle(); + + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + }, + + /** + * 根据选项计算实体的位置坐标 + */ + _getLocation: function () { + var timelineOption = this.timelineOption; + var padding = timelineOption.padding; + + // 水平布局 + var zrWidth = this.zr.getWidth(); + var x = this.parsePercent(timelineOption.x, zrWidth); + var x2 = this.parsePercent(timelineOption.x2, zrWidth); + var width; + if (timelineOption.width == null) { + width = zrWidth - x - x2; + x2 = zrWidth - x2; + } + else { + width = this.parsePercent(timelineOption.width, zrWidth); + x2 = x + width; + } + + var zrHeight = this.zr.getHeight(); + var height = this.parsePercent(timelineOption.height, zrHeight); + var y; + var y2; + if (timelineOption.y != null) { + y = this.parsePercent(timelineOption.y, zrHeight); + y2 = y + height; + } + else { + y2 = zrHeight - this.parsePercent(timelineOption.y2, zrHeight); + y = y2 - height; + } + + return { + x: x + padding[3], + y: y + padding[0], + x2: x2 - padding[1], + y2: y2 - padding[2], + width: width - padding[1] - padding[3], + height: height - padding[0] - padding[2] + }; + }, + + _getReformedLabel: function (idx) { + var timelineOption = this.timelineOption; + var data = timelineOption.data[idx].name != null + ? timelineOption.data[idx].name + : timelineOption.data[idx]; + var formatter = timelineOption.data[idx].formatter + || timelineOption.label.formatter; + if (formatter) { + if (typeof formatter === 'function') { + data = formatter.call(this.myChart, data); + } + else if (typeof formatter === 'string') { + data = formatter.replace('{value}', data); + } + } + return data; + }, + + /** + * 计算标签显示挑选间隔 + */ + _getInterval: function () { + var chainPoint = this._chainPoint; + var timelineOption = this.timelineOption; + var interval = timelineOption.label.interval; + if (interval === 'auto') { + // 麻烦的自适应计算 + var fontSize = timelineOption.label.textStyle.fontSize; + var data = timelineOption.data; + var dataLength = timelineOption.data.length; + + // 横向 + if (dataLength > 3) { + var isEnough = false; + var labelSpace; + var labelSize; + interval = 0; + while (!isEnough && interval < dataLength) { + interval++; + isEnough = true; + for (var i = interval; i < dataLength; i += interval) { + labelSpace = chainPoint[i].x - chainPoint[i - interval].x; + if (timelineOption.label.rotate !== 0) { + // 有旋转 + labelSize = fontSize; + } + else if (data[i].textStyle) { + labelSize = zrArea.getTextWidth( + chainPoint[i].name, + chainPoint[i].textFont + ); + } + else { + // 不定义data级特殊文本样式,用fontSize优化getTextWidth + var label = chainPoint[i].name + ''; + var wLen = (label.match(/\w/g) || '').length; + var oLen = label.length - wLen; + labelSize = wLen * fontSize * 2 / 3 + oLen * fontSize; + } + + if (labelSpace < labelSize) { + // 放不下,中断循环让interval++ + isEnough = false; + break; + } + } + } + } + else { + // 少于3个则全部显示 + interval = 1; + } + } + else { + // 用户自定义间隔 + interval = interval - 0 + 1; + } + + return interval; + }, + + /** + * 根据选项计算时间链条上的坐标及symbolList + */ + _getChainPoint: function() { + var timelineOption = this.timelineOption; + var symbol = timelineOption.symbol.toLowerCase(); + var symbolSize = timelineOption.symbolSize; + var rotate = timelineOption.label.rotate; + var textStyle = timelineOption.label.textStyle; + var textFont = this.getFont(textStyle); + var dataTextStyle; + var data = timelineOption.data; + var x = this._location.x; + var y = this._location.y + this._location.height / 4 * 3; + var width = this._location.x2 - this._location.x; + var len = data.length; + + function _getName(i) { + return data[i].name != null ? data[i].name : data[i]; + } + var xList = []; + if (len > 1) { + var boundaryGap = width / len; + boundaryGap = boundaryGap > 50 ? 50 : (boundaryGap < 20 ? 5 : boundaryGap); + width -= boundaryGap * 2; + if (timelineOption.type === 'number') { + // 平均分布 + for (var i = 0; i < len; i++) { + xList.push(x + boundaryGap + width / (len - 1) * i); + } + } + else { + // 时间比例 + xList[0] = new Date(_getName(0).replace(/-/g, '/')); + xList[len - 1] = new Date(_getName(len - 1).replace(/-/g, '/')) - xList[0]; + for (var i = 1; i < len; i++) { + xList[i] = x + boundaryGap + + width + * (new Date(_getName(i).replace(/-/g, '/')) - xList[0]) + / xList[len - 1]; + } + xList[0] = x + boundaryGap; + } + } + else { + xList.push(x + width / 2); + } + + var list = []; + var curSymbol; + var n; + var isEmpty; + var textAlign; + var rotation; + for (var i = 0; i < len; i++) { + x = xList[i]; + curSymbol = (data[i].symbol && data[i].symbol.toLowerCase()) || symbol; + if (curSymbol.match('empty')) { + curSymbol = curSymbol.replace('empty', ''); + isEmpty = true; + } + else { + isEmpty = false; + } + if (curSymbol.match('star')) { + n = (curSymbol.replace('star','') - 0) || 5; + curSymbol = 'star'; + } + + dataTextStyle = data[i].textStyle + ? zrUtil.merge(data[i].textStyle || {}, textStyle) + : textStyle; + + textAlign = dataTextStyle.align || 'center'; + + if (rotate) { + textAlign = rotate > 0 ? 'right' : 'left'; + rotation = [rotate * Math.PI / 180, x, y - 5]; + } + else { + rotation = false; + } + + list.push({ + x: x, + n: n, + isEmpty: isEmpty, + symbol: curSymbol, + symbolSize: data[i].symbolSize || symbolSize, + color: data[i].color, + borderColor: data[i].borderColor, + borderWidth: data[i].borderWidth, + name: this._getReformedLabel(i), + textColor: dataTextStyle.color, + textAlign: textAlign, + textBaseline: dataTextStyle.baseline || 'middle', + textX: x, + textY: y - (rotate ? 5 : 0), + textFont: data[i].textStyle ? this.getFont(dataTextStyle) : textFont, + rotation: rotation, + showLabel: false + }); + } + + return list; + }, + + _buildBackground: function () { + var timelineOption = this.timelineOption; + var padding = timelineOption.padding; + var width = this._location.width; + var height = this._location.height; + + if (timelineOption.borderWidth !== 0 + || timelineOption.backgroundColor.replace(/\s/g,'') != 'rgba(0,0,0,0)' + ) { + // 背景 + this.shapeList.push(new RectangleShape({ + zlevel: this._zlevelBase, + hoverable :false, + style: { + x: this._location.x - padding[3], + y: this._location.y - padding[0], + width: width + padding[1] + padding[3], + height: height + padding[0] + padding[2], + brushType: timelineOption.borderWidth === 0 ? 'fill' : 'both', + color: timelineOption.backgroundColor, + strokeColor: timelineOption.borderColor, + lineWidth: timelineOption.borderWidth + } + })); + } + }, + + _buildControl: function() { + var self = this; + var timelineOption = this.timelineOption; + var lineStyle = timelineOption.lineStyle; + var controlStyle = timelineOption.controlStyle; + if (timelineOption.controlPosition === 'none') { + return; + } + var iconSize = 15; + var iconGap = 5; + var x; + if (timelineOption.controlPosition === 'left') { + x = this._location.x; + this._location.x += (iconSize + iconGap) * 3; + } + else { + x = this._location.x2 - ((iconSize + iconGap) * 3 - iconGap); + this._location.x2 -= (iconSize + iconGap) * 3; + } + + var y = this._location.y; + var iconStyle = { + zlevel: this._zlevelBase + 1, + style: { + iconType: 'timelineControl', + symbol: 'last', + x: x, + y: y, + width: iconSize, + height: iconSize, + brushType: 'stroke', + color: controlStyle.normal.color, + strokeColor: controlStyle.normal.color, + lineWidth: lineStyle.width + }, + highlightStyle: { + color: controlStyle.emphasis.color, + strokeColor: controlStyle.emphasis.color, + lineWidth: lineStyle.width + 1 + }, + clickable: true + }; + + this._ctrLastShape = new IconShape(iconStyle); + this._ctrLastShape.onclick = function() { + self.last(); + }; + this.shapeList.push(this._ctrLastShape); + + x += iconSize + iconGap; + this._ctrPlayShape = new IconShape(zrUtil.clone(iconStyle)); + this._ctrPlayShape.style.brushType = 'fill'; + this._ctrPlayShape.style.symbol = 'play'; + this._ctrPlayShape.style.status = this.timelineOption.autoPlay ? 'playing' : 'stop'; + this._ctrPlayShape.style.x = x; + this._ctrPlayShape.onclick = function() { + if (self._ctrPlayShape.style.status === 'stop') { + self.play(); + } + else { + self.stop(); + } + }; + this.shapeList.push(this._ctrPlayShape); + + x += iconSize + iconGap; + this._ctrNextShape = new IconShape(zrUtil.clone(iconStyle)); + this._ctrNextShape.style.symbol = 'next'; + this._ctrNextShape.style.x = x; + this._ctrNextShape.onclick = function() { + self.next(); + }; + this.shapeList.push(this._ctrNextShape); + }, + + /** + * 构建时间轴 + */ + _buildChain: function () { + var timelineOption = this.timelineOption; + var lineStyle = timelineOption.lineStyle; + this._timelineShae = { + zlevel: this._zlevelBase, + style: { + x: this._location.x, + y: this.subPixelOptimize(this._location.y, lineStyle.width), + width: this._location.x2 - this._location.x, + height: this._location.height, + chainPoint: this._chainPoint, + brushType:'both', + strokeColor: lineStyle.color, + lineWidth: lineStyle.width, + lineType: lineStyle.type + }, + hoverable: false, + clickable: true, + onclick: this._onclick + }; + + this._timelineShae = new ChainShape(this._timelineShae); + this.shapeList.push(this._timelineShae); + }, + + /** + * 构建拖拽手柄 + */ + _buildHandle: function () { + var curPoint = this._chainPoint[this.currentIndex]; + var symbolSize = curPoint.symbolSize + 1; + symbolSize = symbolSize < 5 ? 5 : symbolSize; + + this._handleShape = { + zlevel: this._zlevelBase + 1, + hoverable: false, + draggable: true, + style: { + iconType: 'diamond', + n: curPoint.n, + x: curPoint.x - symbolSize, + y: this._location.y + this._location.height / 4 - symbolSize, + width: symbolSize * 2, + height: symbolSize * 2, + brushType:'both', + textPosition: 'specific', + textX: curPoint.x, + textY: this._location.y - this._location.height / 4, + textAlign: 'center', + textBaseline: 'middle' + }, + highlightStyle: {}, + ondrift: this._ondrift, + ondragend: this._ondragend + }; + + this._handleShape = new IconShape(this._handleShape); + this.shapeList.push(this._handleShape); + }, + + /** + * 同步拖拽图形样式 + */ + _syncHandleShape: function() { + if (!this.timelineOption.show) { + return; + } + + var timelineOption = this.timelineOption; + var cpStyle = timelineOption.checkpointStyle; + var curPoint = this._chainPoint[this.currentIndex]; + + this._handleShape.style.text = cpStyle.label.show ? curPoint.name : ''; + this._handleShape.style.textFont = curPoint.textFont; + + this._handleShape.style.n = curPoint.n; + if (cpStyle.symbol === 'auto') { + this._handleShape.style.iconType = curPoint.symbol != 'none' + ? curPoint.symbol : 'diamond'; + } + else { + this._handleShape.style.iconType = cpStyle.symbol; + if (cpStyle.symbol.match('star')) { + this._handleShape.style.n = (cpStyle.symbol.replace('star','') - 0) || 5; + this._handleShape.style.iconType = 'star'; + } + } + + var symbolSize; + if (cpStyle.symbolSize === 'auto') { + symbolSize = curPoint.symbolSize + 2; + symbolSize = symbolSize < 5 ? 5 : symbolSize; + } + else { + symbolSize = cpStyle.symbolSize - 0; + } + + this._handleShape.style.color = cpStyle.color === 'auto' + ? (curPoint.color + ? curPoint.color + : timelineOption.controlStyle.emphasis.color + ) + : cpStyle.color; + this._handleShape.style.textColor = cpStyle.label.textStyle.color === 'auto' + ? this._handleShape.style.color + : cpStyle.label.textStyle.color; + this._handleShape.highlightStyle.strokeColor = + this._handleShape.style.strokeColor = cpStyle.borderColor === 'auto' + ? (curPoint.borderColor ? curPoint.borderColor : '#fff') + : cpStyle.borderColor; + this._handleShape.style.lineWidth = cpStyle.borderWidth === 'auto' + ? (curPoint.borderWidth ? curPoint.borderWidth : 0) + : (cpStyle.borderWidth - 0); + this._handleShape.highlightStyle.lineWidth = this._handleShape.style.lineWidth + 1; + + this.zr.animate(this._handleShape.id, 'style') + .when( + 500, + { + x: curPoint.x - symbolSize, + textX: curPoint.x, + y: this._location.y + this._location.height / 4 - symbolSize, + width: symbolSize * 2, + height: symbolSize * 2 + } + ) + .start('ExponentialOut'); + }, + + _findChainIndex: function(x) { + var chainPoint = this._chainPoint; + var len = chainPoint.length; + if (x <= chainPoint[0].x) { + return 0; + } + else if (x >= chainPoint[len - 1].x) { + return len - 1; + } + for (var i = 0; i < len - 1; i++) { + if (x >= chainPoint[i].x && x <= chainPoint[i + 1].x) { + // catch you! + return (Math.abs(x - chainPoint[i].x) < Math.abs(x - chainPoint[i + 1].x)) + ? i : (i + 1); + } + } + }, + + __onclick: function(param) { + var x = zrEvent.getX(param.event); + var newIndex = this._findChainIndex(x); + if (newIndex === this.currentIndex) { + return true; // 啥事都没发生 + } + + this.currentIndex = newIndex; + this.timelineOption.autoPlay && this.stop(); // 停止自动播放 + clearTimeout(this.playTicket); + this._onFrame(); + }, + + /** + * 拖拽范围控制 + */ + __ondrift: function (shape, dx) { + this.timelineOption.autoPlay && this.stop(); // 停止自动播放 + + var chainPoint = this._chainPoint; + var len = chainPoint.length; + var newIndex; + if (shape.style.x + dx <= chainPoint[0].x - chainPoint[0].symbolSize) { + shape.style.x = chainPoint[0].x - chainPoint[0].symbolSize; + newIndex = 0; + } + else if (shape.style.x + dx >= chainPoint[len - 1].x - chainPoint[len - 1].symbolSize) { + shape.style.x = chainPoint[len - 1].x - chainPoint[len - 1].symbolSize; + newIndex = len - 1; + } + else { + shape.style.x += dx; + newIndex = this._findChainIndex(shape.style.x); + } + var curPoint = chainPoint[newIndex]; + var symbolSize = curPoint.symbolSize + 2; + shape.style.iconType = curPoint.symbol; + shape.style.n = curPoint.n; + shape.style.textX = shape.style.x + symbolSize / 2; + shape.style.y = this._location.y + this._location.height / 4 - symbolSize; + shape.style.width = symbolSize * 2; + shape.style.height = symbolSize * 2; + shape.style.text = curPoint.name; + + //console.log(newIndex) + if (newIndex === this.currentIndex) { + return true; // 啥事都没发生 + } + + this.currentIndex = newIndex; + if (this.timelineOption.realtime) { + clearTimeout(this.playTicket); + var self = this; + this.playTicket = setTimeout(function() { + self._setCurrentOption(); + },200); + } + + return true; + }, + + __ondragend: function () { + this.isDragend = true; + }, + + /** + * 数据项被拖拽出去 + */ + ondragend: function (param, status) { + if (!this.isDragend || !param.target) { + // 没有在当前实例上发生拖拽行为则直接返回 + return; + } + !this.timelineOption.realtime && this._setCurrentOption(); + + // 别status = {}赋值啊!! + status.dragOut = true; + status.dragIn = true; + status.needRefresh = false; // 会有消息触发fresh,不用再刷一遍 + // 处理完拖拽事件后复位 + this.isDragend = false; + this._syncHandleShape(); + return; + }, + + last: function () { + this.timelineOption.autoPlay && this.stop(); // 停止自动播放 + + this.currentIndex -= 1; + if (this.currentIndex < 0) { + this.currentIndex = this.timelineOption.data.length - 1; + } + this._onFrame(); + + return this.currentIndex; + }, + + next: function () { + this.timelineOption.autoPlay && this.stop(); // 停止自动播放 + + this.currentIndex += 1; + if (this.currentIndex >= this.timelineOption.data.length) { + this.currentIndex = 0; + } + this._onFrame(); + + return this.currentIndex; + }, + + play: function (targetIndex, autoPlay) { + if (this._ctrPlayShape && this._ctrPlayShape.style.status != 'playing') { + this._ctrPlayShape.style.status = 'playing'; + this.zr.modShape(this._ctrPlayShape.id); + this.zr.refresh(); + } + + + this.timelineOption.autoPlay = autoPlay != null ? autoPlay : true; + + if (!this.timelineOption.autoPlay) { + clearTimeout(this.playTicket); + } + + this.currentIndex = targetIndex != null ? targetIndex : (this.currentIndex + 1); + if (this.currentIndex >= this.timelineOption.data.length) { + this.currentIndex = 0; + } + this._onFrame(); + + return this.currentIndex; + }, + + stop: function () { + if (this._ctrPlayShape && this._ctrPlayShape.style.status != 'stop') { + this._ctrPlayShape.style.status = 'stop'; + this.zr.modShape(this._ctrPlayShape.id); + this.zr.refresh(); + } + + this.timelineOption.autoPlay = false; + + clearTimeout(this.playTicket); + + return this.currentIndex; + }, + + /** + * 避免dataZoom带来两次refresh,不设refresh接口,resize重复一下buildshape逻辑 + */ + resize: function () { + if (this.timelineOption.show) { + this.clear(); + this._buildShape(); + this._syncHandleShape(); + } + }, + + setTheme: function(needRefresh) { + this.timelineOption = this.reformOption(zrUtil.clone(this.option.timeline)); + // 补全padding属性 + this.timelineOption.padding = this.reformCssArray( + this.timelineOption.padding + ); + // 通用字体设置 + this.timelineOption.label.textStyle = zrUtil.merge( + this.timelineOption.label.textStyle || {}, + this.ecTheme.textStyle + ); + this.timelineOption.checkpointStyle.label.textStyle = zrUtil.merge( + this.timelineOption.checkpointStyle.label.textStyle || {}, + this.ecTheme.textStyle + ); + + if (this.timelineOption.show && needRefresh) { + this.clear(); + this._buildShape(); + this._syncHandleShape(); + } + }, + + /** + * 释放后实例不可用,重载基类方法 + */ + dispose: function () { + this.clear(); + this.shapeList = null; + + clearTimeout(this.playTicket); + } + }; + + function timelineControl(ctx, style) { + var lineWidth = 2;//style.lineWidth; + var x = style.x + lineWidth; + var y = style.y + lineWidth + 2; + var width = style.width - lineWidth; + var height = style.height - lineWidth; + + + var symbol = style.symbol; + if (symbol === 'last') { + ctx.moveTo(x + width - 2, y + height / 3); + ctx.lineTo(x + width - 2, y); + ctx.lineTo(x + 2, y + height / 2); + ctx.lineTo(x + width - 2, y + height); + ctx.lineTo(x + width - 2, y + height / 3 * 2); + ctx.moveTo(x, y); + ctx.lineTo(x, y); + } + else if (symbol === 'next') { + ctx.moveTo(x + 2, y + height / 3); + ctx.lineTo(x + 2, y); + ctx.lineTo(x + width - 2, y + height / 2); + ctx.lineTo(x + 2, y + height); + ctx.lineTo(x + 2, y + height / 3 * 2); + ctx.moveTo(x, y); + ctx.lineTo(x, y); + } + else if (symbol === 'play') { + if (style.status === 'stop') { + ctx.moveTo(x + 2, y); + ctx.lineTo(x + width - 2, y + height / 2); + ctx.lineTo(x + 2, y + height); + ctx.lineTo(x + 2, y); + } + else { + var delta = style.brushType === 'both' ? 2 : 3; + ctx.rect(x + 2, y, delta, height); + ctx.rect(x + width - delta - 2, y, delta, height); + } + } + else if (symbol.match('image')) { + var imageLocation = ''; + imageLocation = symbol.replace( + new RegExp('^image:\\/\\/'), '' + ); + symbol = IconShape.prototype.iconLibrary.image; + symbol(ctx, { + x: x, + y: y, + width: width, + height: height, + image: imageLocation + }); + } + } + IconShape.prototype.iconLibrary['timelineControl'] = timelineControl; + + zrUtil.inherits(Timeline, Base); + + require('../component').define('timeline', Timeline); + + return Timeline; +}); + +define( + 'zrender/loadingEffect/Bar',['require','./Base','../tool/util','../tool/color','../shape/Rectangle'],function (require) { + var Base = require('./Base'); + var util = require('../tool/util'); + var zrColor = require('../tool/color'); + var RectangleShape = require('../shape/Rectangle'); + + function Bar(options) { + Base.call(this, options); + } + util.inherits(Bar, Base); + + + /** + * 进度条 + * + * @param {Object} addShapeHandle + * @param {Object} refreshHandle + */ + Bar.prototype._start = function (addShapeHandle, refreshHandle) { + // 特效默认配置 + var options = util.merge( + this.options, + { + textStyle : { + color : '#888' + }, + backgroundColor : 'rgba(250, 250, 250, 0.8)', + effectOption : { + x : 0, + y : this.canvasHeight / 2 - 30, + width : this.canvasWidth, + height : 5, + brushType : 'fill', + timeInterval : 100 + } + } + ); + + var textShape = this.createTextShape(options.textStyle); + var background = this.createBackgroundShape(options.backgroundColor); + + var effectOption = options.effectOption; + + // 初始化动画元素 + var barShape = new RectangleShape({ + highlightStyle : util.clone(effectOption) + }); + + barShape.highlightStyle.color = + effectOption.color + || zrColor.getLinearGradient( + effectOption.x, + effectOption.y, + effectOption.x + effectOption.width, + effectOption.y + effectOption.height, + [ [ 0, '#ff6400' ], [ 0.5, '#ffe100' ], [ 1, '#b1ff00' ] ] + ); + + if (options.progress != null) { + // 指定进度 + addShapeHandle(background); + + barShape.highlightStyle.width = + this.adjust(options.progress, [ 0, 1 ]) + * options.effectOption.width; + + addShapeHandle(barShape); + addShapeHandle(textShape); + + refreshHandle(); + return; + } + else { + // 循环显示 + barShape.highlightStyle.width = 0; + return setInterval( + function () { + addShapeHandle(background); + + if (barShape.highlightStyle.width < effectOption.width) { + barShape.highlightStyle.width += 8; + } + else { + barShape.highlightStyle.width = 0; + } + addShapeHandle(barShape); + addShapeHandle(textShape); + refreshHandle(); + }, + effectOption.timeInterval + ); + } + }; + + return Bar; + } +); + + +define( + 'zrender/loadingEffect/Bubble',['require','./Base','../tool/util','../tool/color','../shape/Circle'],function (require) { + var Base = require('./Base'); + var util = require('../tool/util'); + var zrColor = require('../tool/color'); + var CircleShape = require('../shape/Circle'); + + function Bubble(options) { + Base.call(this, options); + } + util.inherits(Bubble, Base); + + /** + * 泡泡 + * + * @param {Object} addShapeHandle + * @param {Object} refreshHandle + */ + Bubble.prototype._start = function (addShapeHandle, refreshHandle) { + + // 特效默认配置 + var options = util.merge( + this.options, + { + textStyle : { + color : '#888' + }, + backgroundColor : 'rgba(250, 250, 250, 0.8)', + effect : { + n : 50, + lineWidth : 2, + brushType : 'stroke', + color : 'random', + timeInterval : 100 + } + } + ); + + var textShape = this.createTextShape(options.textStyle); + var background = this.createBackgroundShape(options.backgroundColor); + + var effectOption = options.effect; + var n = effectOption.n; + var brushType = effectOption.brushType; + var lineWidth = effectOption.lineWidth; + + var shapeList = []; + var canvasWidth = this.canvasWidth; + var canvasHeight = this.canvasHeight; + + // 初始化动画元素 + for (var i = 0; i < n; i++) { + var color = effectOption.color == 'random' + ? zrColor.alpha(zrColor.random(), 0.3) + : effectOption.color; + + shapeList[i] = new CircleShape({ + highlightStyle : { + x : Math.ceil(Math.random() * canvasWidth), + y : Math.ceil(Math.random() * canvasHeight), + r : Math.ceil(Math.random() * 40), + brushType : brushType, + color : color, + strokeColor : color, + lineWidth : lineWidth + }, + animationY : Math.ceil(Math.random() * 20) + }); + } + + return setInterval( + function () { + addShapeHandle(background); + + for (var i = 0; i < n; i++) { + var style = shapeList[i].highlightStyle; + + if (style.y - shapeList[i].animationY + style.r <= 0) { + shapeList[i].highlightStyle.y = canvasHeight + style.r; + shapeList[i].highlightStyle.x = Math.ceil( + Math.random() * canvasWidth + ); + } + shapeList[i].highlightStyle.y -= + shapeList[i].animationY; + + addShapeHandle(shapeList[i]); + } + + addShapeHandle(textShape); + refreshHandle(); + }, + effectOption.timeInterval + ); + }; + + return Bubble; + } +); + + +define( + 'zrender/loadingEffect/DynamicLine',['require','./Base','../tool/util','../tool/color','../shape/Line'],function (require) { + var Base = require('./Base'); + var util = require('../tool/util'); + var zrColor = require('../tool/color'); + var LineShape = require('../shape/Line'); + + function DynamicLine(options) { + Base.call(this, options); + } + util.inherits(DynamicLine, Base); + + + /** + * 动态线 + * + * @param {Object} addShapeHandle + * @param {Object} refreshHandle + */ + DynamicLine.prototype._start = function (addShapeHandle, refreshHandle) { + // 特效默认配置 + var options = util.merge( + this.options, + { + textStyle : { + color : '#fff' + }, + backgroundColor : 'rgba(0, 0, 0, 0.8)', + effectOption : { + n : 30, + lineWidth : 1, + color : 'random', + timeInterval : 100 + } + } + ); + + var textShape = this.createTextShape(options.textStyle); + var background = this.createBackgroundShape(options.backgroundColor); + + var effectOption = options.effectOption; + var n = effectOption.n; + var lineWidth = effectOption.lineWidth; + + var shapeList = []; + var canvasWidth = this.canvasWidth; + var canvasHeight = this.canvasHeight; + + // 初始化动画元素 + for (var i = 0; i < n; i++) { + var xStart = -Math.ceil(Math.random() * 1000); + var len = Math.ceil(Math.random() * 400); + var pos = Math.ceil(Math.random() * canvasHeight); + + var color = effectOption.color == 'random' + ? zrColor.random() + : effectOption.color; + + shapeList[i] = new LineShape({ + highlightStyle : { + xStart : xStart, + yStart : pos, + xEnd : xStart + len, + yEnd : pos, + strokeColor : color, + lineWidth : lineWidth + }, + animationX : Math.ceil(Math.random() * 100), + len : len + }); + } + + return setInterval( + function() { + addShapeHandle(background); + + for (var i = 0; i < n; i++) { + var style = shapeList[i].highlightStyle; + + if (style.xStart >= canvasWidth) { + + shapeList[i].len = Math.ceil(Math.random() * 400); + style.xStart = -400; + style.xEnd = -400 + shapeList[i].len; + style.yStart = Math.ceil(Math.random() * canvasHeight); + style.yEnd = style.yStart; + } + + style.xStart += shapeList[i].animationX; + style.xEnd += shapeList[i].animationX; + + addShapeHandle(shapeList[i]); + } + + addShapeHandle(textShape); + refreshHandle(); + }, + effectOption.timeInterval + ); + }; + + return DynamicLine; + } +); + + +define( + 'zrender/loadingEffect/Ring',['require','./Base','../tool/util','../tool/color','../shape/Ring','../shape/Sector'],function (require) { + var Base = require('./Base'); + var util = require('../tool/util'); + var zrColor = require('../tool/color'); + var RingShape = require('../shape/Ring'); + var SectorShape = require('../shape/Sector'); + + function Ring(options) { + Base.call(this, options); + } + util.inherits(Ring, Base); + + + /** + * 圆环 + * + * @param {Object} addShapeHandle + * @param {Object} refreshHandle + */ + Ring.prototype._start = function (addShapeHandle, refreshHandle) { + + // 特效默认配置 + var options = util.merge( + this.options, + { + textStyle : { + color : '#07a' + }, + backgroundColor : 'rgba(250, 250, 250, 0.8)', + effect : { + x : this.canvasWidth / 2, + y : this.canvasHeight / 2, + r0 : 60, + r : 100, + color : '#bbdcff', + brushType: 'fill', + textPosition : 'inside', + textFont : 'normal 30px verdana', + textColor : 'rgba(30, 144, 255, 0.6)', + timeInterval : 100 + } + } + ); + + var effectOption = options.effect; + + var textStyle = options.textStyle; + if (textStyle.x == null) { + textStyle.x = effectOption.x; + } + if (textStyle.y == null) { + textStyle.y = (effectOption.y + (effectOption.r0 + effectOption.r) / 2 - 5); + } + + var textShape = this.createTextShape(options.textStyle); + var background = this.createBackgroundShape(options.backgroundColor); + + var x = effectOption.x; + var y = effectOption.y; + var r0 = effectOption.r0 + 6; + var r = effectOption.r - 6; + var color = effectOption.color; + var darkColor = zrColor.lift(color, 0.1); + + var shapeRing = new RingShape({ + highlightStyle : util.clone(effectOption) + }); + + // 初始化动画元素 + var shapeList = []; + var clolrList = zrColor.getGradientColors( + [ '#ff6400', '#ffe100', '#97ff00' ], 25 + ); + var preAngle = 15; + var endAngle = 240; + + for (var i = 0; i < 16; i++) { + shapeList.push(new SectorShape({ + highlightStyle : { + x : x, + y : y, + r0 : r0, + r : r, + startAngle : endAngle - preAngle, + endAngle : endAngle, + brushType: 'fill', + color : darkColor + }, + _color : zrColor.getLinearGradient( + x + r0 * Math.cos(endAngle, true), + y - r0 * Math.sin(endAngle, true), + x + r0 * Math.cos(endAngle - preAngle, true), + y - r0 * Math.sin(endAngle - preAngle, true), + [ + [ 0, clolrList[i * 2] ], + [ 1, clolrList[i * 2 + 1] ] + ] + ) + })); + endAngle -= preAngle; + } + endAngle = 360; + for (var i = 0; i < 4; i++) { + shapeList.push(new SectorShape({ + highlightStyle : { + x : x, + y : y, + r0 : r0, + r : r, + startAngle : endAngle - preAngle, + endAngle : endAngle, + brushType: 'fill', + color : darkColor + }, + _color : zrColor.getLinearGradient( + x + r0 * Math.cos(endAngle, true), + y - r0 * Math.sin(endAngle, true), + x + r0 * Math.cos(endAngle - preAngle, true), + y - r0 * Math.sin(endAngle - preAngle, true), + [ + [ 0, clolrList[i * 2 + 32] ], + [ 1, clolrList[i * 2 + 33] ] + ] + ) + })); + endAngle -= preAngle; + } + + var n = 0; + if (options.progress != null) { + // 指定进度 + addShapeHandle(background); + + n = this.adjust(options.progress, [ 0, 1 ]).toFixed(2) * 100 / 5; + shapeRing.highlightStyle.text = n * 5 + '%'; + addShapeHandle(shapeRing); + + for (var i = 0; i < 20; i++) { + shapeList[i].highlightStyle.color = i < n + ? shapeList[i]._color : darkColor; + addShapeHandle(shapeList[i]); + } + + addShapeHandle(textShape); + refreshHandle(); + return; + } + + // 循环显示 + return setInterval( + function() { + addShapeHandle(background); + + n += n >= 20 ? -20 : 1; + + // shapeRing.highlightStyle.text = n * 5 + '%'; + addShapeHandle(shapeRing); + + for (var i = 0; i < 20; i++) { + shapeList[i].highlightStyle.color = i < n + ? shapeList[i]._color : darkColor; + addShapeHandle(shapeList[i]); + } + + addShapeHandle(textShape); + refreshHandle(); + }, + effectOption.timeInterval + ); + }; + + return Ring; + } +); + + +define( + 'zrender/loadingEffect/Spin',['require','./Base','../tool/util','../tool/color','../tool/area','../shape/Sector'],function (require) { + var Base = require('./Base'); + var util = require('../tool/util'); + var zrColor = require('../tool/color'); + var zrArea = require('../tool/area'); + var SectorShape = require('../shape/Sector'); + + function Spin(options) { + Base.call(this, options); + } + util.inherits(Spin, Base); + + /** + * 旋转 + * + * @param {Object} addShapeHandle + * @param {Object} refreshHandle + */ + Spin.prototype._start = function (addShapeHandle, refreshHandle) { + var options = util.merge( + this.options, + { + textStyle : { + color : '#fff', + textAlign : 'start' + }, + backgroundColor : 'rgba(0, 0, 0, 0.8)' + } + ); + var textShape = this.createTextShape(options.textStyle); + + var textGap = 10; + var textWidth = zrArea.getTextWidth( + textShape.highlightStyle.text, textShape.highlightStyle.textFont + ); + var textHeight = zrArea.getTextHeight( + textShape.highlightStyle.text, textShape.highlightStyle.textFont + ); + + // 特效默认配置 + var effectOption = util.merge( + this.options.effect || {}, + { + r0 : 9, + r : 15, + n : 18, + color : '#fff', + timeInterval : 100 + } + ); + + var location = this.getLocation( + this.options.textStyle, + textWidth + textGap + effectOption.r * 2, + Math.max(effectOption.r * 2, textHeight) + ); + effectOption.x = location.x + effectOption.r; + effectOption.y = textShape.highlightStyle.y = location.y + location.height / 2; + textShape.highlightStyle.x = effectOption.x + effectOption.r + textGap; + + var background = this.createBackgroundShape(options.backgroundColor); + var n = effectOption.n; + var x = effectOption.x; + var y = effectOption.y; + var r0 = effectOption.r0; + var r = effectOption.r; + var color = effectOption.color; + + // 初始化动画元素 + var shapeList = []; + var preAngle = Math.round(180 / n); + for (var i = 0; i < n; i++) { + shapeList[i] = new SectorShape({ + highlightStyle : { + x : x, + y : y, + r0 : r0, + r : r, + startAngle : preAngle * i * 2, + endAngle : preAngle * i * 2 + preAngle, + color : zrColor.alpha(color, (i + 1) / n), + brushType: 'fill' + } + }); + } + + var pos = [ 0, x, y ]; + + return setInterval( + function() { + addShapeHandle(background); + pos[0] -= 0.3; + for (var i = 0; i < n; i++) { + shapeList[i].rotation = pos; + addShapeHandle(shapeList[i]); + } + + addShapeHandle(textShape); + refreshHandle(); + }, + effectOption.timeInterval + ); + }; + + return Spin; + } +); + + +define( + 'zrender/loadingEffect/Whirling',['require','./Base','../tool/util','../tool/area','../shape/Ring','../shape/Droplet','../shape/Circle'],function (require) { + var Base = require('./Base'); + var util = require('../tool/util'); + var zrArea = require('../tool/area'); + var RingShape = require('../shape/Ring'); + var DropletShape = require('../shape/Droplet'); + var CircleShape = require('../shape/Circle'); + + function Whirling(options) { + Base.call(this, options); + } + util.inherits(Whirling, Base); + + /** + * 旋转水滴 + * + * @param {Object} addShapeHandle + * @param {Object} refreshHandle + */ + Whirling.prototype._start = function (addShapeHandle, refreshHandle) { + var options = util.merge( + this.options, + { + textStyle : { + color : '#888', + textAlign : 'start' + }, + backgroundColor : 'rgba(250, 250, 250, 0.8)' + } + ); + var textShape = this.createTextShape(options.textStyle); + + var textGap = 10; + var textWidth = zrArea.getTextWidth( + textShape.highlightStyle.text, textShape.highlightStyle.textFont + ); + var textHeight = zrArea.getTextHeight( + textShape.highlightStyle.text, textShape.highlightStyle.textFont + ); + + // 特效默认配置 + var effectOption = util.merge( + this.options.effect || {}, + { + r : 18, + colorIn : '#fff', + colorOut : '#555', + colorWhirl : '#6cf', + timeInterval : 50 + } + ); + + var location = this.getLocation( + this.options.textStyle, + textWidth + textGap + effectOption.r * 2, + Math.max(effectOption.r * 2, textHeight) + ); + effectOption.x = location.x + effectOption.r; + effectOption.y = textShape.highlightStyle.y = location.y + location.height / 2; + textShape.highlightStyle.x = effectOption.x + effectOption.r + textGap; + + var background = this.createBackgroundShape(options.backgroundColor); + // 初始化动画元素 + var droplet = new DropletShape({ + highlightStyle : { + a : Math.round(effectOption.r / 2), + b : Math.round(effectOption.r - effectOption.r / 6), + brushType : 'fill', + color : effectOption.colorWhirl + } + }); + var circleIn = new CircleShape({ + highlightStyle : { + r : Math.round(effectOption.r / 6), + brushType : 'fill', + color : effectOption.colorIn + } + }); + var circleOut = new RingShape({ + highlightStyle : { + r0 : Math.round(effectOption.r - effectOption.r / 3), + r : effectOption.r, + brushType : 'fill', + color : effectOption.colorOut + } + }); + + var pos = [ 0, effectOption.x, effectOption.y ]; + + droplet.highlightStyle.x + = circleIn.highlightStyle.x + = circleOut.highlightStyle.x + = pos[1]; + droplet.highlightStyle.y + = circleIn.highlightStyle.y + = circleOut.highlightStyle.y + = pos[2]; + + return setInterval( + function() { + addShapeHandle(background); + addShapeHandle(circleOut); + pos[0] -= 0.3; + droplet.rotation = pos; + addShapeHandle(droplet); + addShapeHandle(circleIn); + addShapeHandle(textShape); + refreshHandle(); + }, + effectOption.timeInterval + ); + }; + + return Whirling; + } +); + +/** + * echarts默认主题,开发中 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/theme/default',[],function() { + var config = { + }; + + return config; +}); +/*! + * ECharts, a javascript interactive chart library. + * + * Copyright (c) 2014, Baidu Inc. + * All rights reserved. + * + * LICENSE + * https://github.com/ecomfe/echarts/blob/master/LICENSE.txt + */ + +/** + * echarts + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool/event','zrender/tool/env','zrender','zrender/config','zrender','./chart/island','./component/toolbox','./component','./component/title','./component/tooltip','./component/legend','./util/ecData','./chart','./component','zrender/tool/color','./component/timeline','zrender','zrender/shape/Image','zrender/loadingEffect/Bar','zrender/loadingEffect/Bubble','zrender/loadingEffect/DynamicLine','zrender/loadingEffect/Ring','zrender/loadingEffect/Spin','zrender/loadingEffect/Whirling','./theme/default'],function (require) { + var ecConfig = require('./config'); + var zrUtil = require('zrender/tool/util'); + var zrEvent = require('zrender/tool/event'); + + var self = { }; + + var _canvasSupported = require('zrender/tool/env').canvasSupported; + var _idBase = new Date() - 0; + var _instances = { }; // ECharts实例map索引 + var DOM_ATTRIBUTE_KEY = '_echarts_instance_'; + + self.version = '2.0.4'; + self.dependencies = { + zrender: '2.0.4' + }; + /** + * 入口方法 + */ + self.init = function (dom, theme) { + var zrender = require('zrender'); + if (((zrender.version || '1.0.3').replace('.', '') - 0) + < (self.dependencies.zrender.replace('.', '') - 0) + ) { + console.error( + 'ZRender ' + (zrender.version || '1.0.3-') + + ' is too old for ECharts ' + self.version + + '. Current version need ZRender ' + + self.dependencies.zrender + '+' + ); + } + + dom = dom instanceof Array ? dom[0] : dom; + + // dom与echarts实例映射索引 + var key = dom.getAttribute(DOM_ATTRIBUTE_KEY); + if (!key) { + key = _idBase++; + dom.setAttribute(DOM_ATTRIBUTE_KEY, key); + } + + if (_instances[key]) { + // 同一个dom上多次init,自动释放已有实例 + _instances[key].dispose(); + } + _instances[key] = new Echarts(dom); + _instances[key].id = key; + _instances[key].setTheme(theme); + + return _instances[key]; + }; + + /** + * 通过id获得ECharts实例,id可在实例化后读取 + */ + self.getInstanceById = function (key) { + return _instances[key]; + }; + + /** + * 消息中心 + */ + function MessageCenter() { + zrEvent.Dispatcher.call(this); + } + zrUtil.merge(MessageCenter.prototype, zrEvent.Dispatcher.prototype, true); + + /** + * 基于zrender实现Echarts接口层 + * @param {HtmlElement} dom 必要 + */ + function Echarts(dom) { + this._themeConfig = zrUtil.clone(ecConfig); + + this.dom = dom; + // this._zr; + // this._option; // curOption clone + // this._optionRestore; // for restore; + // this._island; + // this._toolbox; + // this._timeline; + // this._refreshInside; // 内部刷新标志位 + + this._connected = false; + this._status = { // 用于图表间通信 + dragIn: false, + dragOut: false, + needRefresh: false + }; + this._curEventType = false; // 破循环信号灯 + this._chartList = [ ]; // 图表实例 + + this._messageCenter = new MessageCenter(); + + this._messageCenterOutSide = new MessageCenter(); // Echarts层的外部消息中心,做Echarts层的消息转发 + + // resize方法经常被绑定到window.resize上,闭包一个this + this.resize = this.resize(); + + // 初始化::构造函数 + this._init(); + } + + /** + * ZRender EVENT + * + * @inner + * @const + * @type {Object} + */ + var ZR_EVENT = require('zrender/config').EVENT; + + /** + * 要绑定监听的zrender事件列表 + * + * @const + * @inner + * @type {Array} + */ + var ZR_EVENT_LISTENS = [ + 'CLICK', 'DBLCLICK', 'MOUSEOVER', 'MOUSEOUT', + 'DRAGSTART', 'DRAGEND', 'DRAGENTER', 'DRAGOVER', 'DRAGLEAVE', 'DROP' + ]; + + /** + * 对echarts的实例中的chartList属性成员,逐个进行方法调用,遍历顺序为逆序 + * 由于在事件触发的默认行为处理中,多次用到相同逻辑,所以抽象了该方法 + * 由于所有的调用场景里,最多只有两个参数,基于性能和体积考虑,这里就不使用call或者apply了 + * + * @inner + * @param {ECharts} ecInstance ECharts实例 + * @param {string} methodName 要调用的方法名 + * @param {*} arg0 调用参数1 + * @param {*} arg1 调用参数2 + * @param {*} arg2 调用参数3 + */ + function callChartListMethodReverse(ecInstance, methodName, arg0, arg1, arg2) { + var chartList = ecInstance._chartList; + var len = chartList.length; + + while (len--) { + var chart = chartList[len]; + if (typeof chart[methodName] === 'function') { + chart[methodName](arg0, arg1, arg2); + } + } + } + + Echarts.prototype = { + /** + * 初始化::构造函数 + */ + _init: function () { + var self = this; + var _zr = require('zrender').init(this.dom); + this._zr = _zr; + + // wrap: n,e,d,t for name event data this + this._messageCenter.dispatch = function(type, event, eventPackage, that) { + eventPackage = eventPackage || { }; + eventPackage.type = type; + eventPackage.event = event; + + self._messageCenter.dispatchWithContext(type, eventPackage, that); + if (type != 'HOVER' && type != 'MOUSEOUT') { // 频繁事件直接抛出 + setTimeout(function(){ + self._messageCenterOutSide.dispatchWithContext( + type, eventPackage, that + ); + },50); + } + else { + self._messageCenterOutSide.dispatchWithContext( + type, eventPackage, that + ); + } + }; + + this._onevent = function(param){ + return self.__onevent(param); + }; + for (var e in ecConfig.EVENT) { + if (e != 'CLICK' && e != 'DBLCLICK' + && e != 'HOVER' && e != 'MOUSEOUT' && e != 'MAP_ROAM' + ) { + this._messageCenter.bind(ecConfig.EVENT[e], this._onevent, this); + } + } + + + var eventBehaviors = { }; + this._onzrevent = function (param) { + return self[eventBehaviors[ param.type ]](param); + }; + + // 挂载关心的事件 + for (var i = 0, len = ZR_EVENT_LISTENS.length; i < len; i++) { + var eventName = ZR_EVENT_LISTENS[i]; + var eventValue = ZR_EVENT[eventName]; + eventBehaviors[eventValue] = '_on' + eventName.toLowerCase(); + _zr.on(eventValue, this._onzrevent); + } + + this.chart = { }; // 图表索引 + this.component = { }; // 组件索引 + + // 内置图表 + // 孤岛 + var Island = require('./chart/island'); + this._island = new Island(this._themeConfig, this._messageCenter, _zr, { }, this); + this.chart.island = this._island; + + // 内置通用组件 + // 工具箱 + var Toolbox = require('./component/toolbox'); + this._toolbox = new Toolbox(this._themeConfig, this._messageCenter, _zr, { }, this); + this.component.toolbox = this._toolbox; + + var componentLibrary = require('./component'); + componentLibrary.define('title', require('./component/title')); + componentLibrary.define('tooltip', require('./component/tooltip')); + componentLibrary.define('legend', require('./component/legend')); + + if (_zr.getWidth() === 0 || _zr.getHeight() === 0) { + console.error('Dom’s width & height should be ready before init.'); + } + }, + + /** + * ECharts事件处理中心 + */ + __onevent: function (param){ + param.__echartsId = param.__echartsId || this.id; + + // 来自其他联动图表的事件 + var fromMyself = (param.__echartsId === this.id); + + if (!this._curEventType) { + this._curEventType = param.type; + } + + switch (param.type) { + case ecConfig.EVENT.LEGEND_SELECTED : + this._onlegendSelected(param); + break; + case ecConfig.EVENT.DATA_ZOOM : + if (!fromMyself) { + var dz = this.component.dataZoom; + if (dz) { + dz.silence(true); + dz.absoluteZoom(param.zoom); + dz.silence(false); + } + } + this._ondataZoom(param); + break; + case ecConfig.EVENT.DATA_RANGE : + fromMyself && this._ondataRange(param); + break; + case ecConfig.EVENT.MAGIC_TYPE_CHANGED : + if (!fromMyself) { + var tb = this.component.toolbox; + if (tb) { + tb.silence(true); + tb.setMagicType(param.magicType); + tb.silence(false); + } + } + this._onmagicTypeChanged(param); + break; + case ecConfig.EVENT.DATA_VIEW_CHANGED : + fromMyself && this._ondataViewChanged(param); + break; + case ecConfig.EVENT.TOOLTIP_HOVER : + fromMyself && this._tooltipHover(param); + break; + case ecConfig.EVENT.RESTORE : + this._onrestore(); + break; + case ecConfig.EVENT.REFRESH : + fromMyself && this._onrefresh(param); + break; + // 鼠标同步 + case ecConfig.EVENT.TOOLTIP_IN_GRID : + case ecConfig.EVENT.TOOLTIP_OUT_GRID : + if (!fromMyself) { + // 只处理来自外部的鼠标同步 + var grid = this.component.grid; + if (grid) { + this._zr.trigger( + 'mousemove', + { + connectTrigger: true, + zrenderX: grid.getX() + param.x * grid.getWidth(), + zrenderY: grid.getY() + param.y * grid.getHeight() + } + ); + } + } + else if (this._connected) { + // 来自自己,并且存在多图联动,空间坐标映射修改参数分发 + var grid = this.component.grid; + if (grid) { + param.x = (param.event.zrenderX - grid.getX()) / grid.getWidth(); + param.y = (param.event.zrenderY - grid.getY()) / grid.getHeight(); + } + } + break; + /* + case ecConfig.EVENT.RESIZE : + case ecConfig.EVENT.DATA_CHANGED : + case ecConfig.EVENT.PIE_SELECTED : + case ecConfig.EVENT.MAP_SELECTED : + break; + */ + } + + // 多图联动,只做自己的一级事件分发,避免级联事件循环 + if (this._connected && fromMyself && this._curEventType === param.type) { + for (var c in this._connected) { + this._connected[c].connectedEventHandler(param); + } + // 分发完毕后复位 + this._curEventType = null; + } + + if (!fromMyself || (!this._connected && fromMyself)) { // 处理了完联动事件复位 + this._curEventType = null; + } + }, + + /** + * 点击事件,响应zrender事件,包装后分发到Echarts层 + */ + _onclick: function (param) { + callChartListMethodReverse(this, 'onclick', param); + + if (param.target) { + var ecData = this._eventPackage(param.target); + if (ecData && ecData.seriesIndex != null) { + this._messageCenter.dispatch( + ecConfig.EVENT.CLICK, + param.event, + ecData, + this + ); + } + } + }, + + /** + * 双击事件,响应zrender事件,包装后分发到Echarts层 + */ + _ondblclick: function (param) { + callChartListMethodReverse(this, 'ondblclick', param); + + if (param.target) { + var ecData = this._eventPackage(param.target); + if (ecData && ecData.seriesIndex != null) { + this._messageCenter.dispatch( + ecConfig.EVENT.DBLCLICK, + param.event, + ecData, + this + ); + } + } + }, + + /** + * 鼠标移入事件,响应zrender事件,包装后分发到Echarts层 + */ + _onmouseover: function (param) { + if (param.target) { + var ecData = this._eventPackage(param.target); + if (ecData && ecData.seriesIndex != null) { + this._messageCenter.dispatch( + ecConfig.EVENT.HOVER, + param.event, + ecData, + this + ); + } + } + }, + + /** + * 鼠标移出事件,响应zrender事件,包装后分发到Echarts层 + */ + _onmouseout: function (param) { + if (param.target) { + var ecData = this._eventPackage(param.target); + if (ecData && ecData.seriesIndex != null) { + this._messageCenter.dispatch( + ecConfig.EVENT.MOUSEOUT, + param.event, + ecData, + this + ); + } + } + }, + + /** + * dragstart回调,可计算特性实现 + */ + _ondragstart: function (param) { + // 复位用于图表间通信拖拽标识 + this._status = { + dragIn: false, + dragOut: false, + needRefresh: false + }; + + callChartListMethodReverse(this, 'ondragstart', param); + }, + + /** + * dragging回调,可计算特性实现 + */ + _ondragenter: function (param) { + callChartListMethodReverse(this, 'ondragenter', param); + }, + + /** + * dragstart回调,可计算特性实现 + */ + _ondragover: function (param) { + callChartListMethodReverse(this, 'ondragover', param); + }, + + /** + * dragstart回调,可计算特性实现 + */ + _ondragleave: function (param) { + callChartListMethodReverse(this, 'ondragleave', param); + }, + + /** + * dragstart回调,可计算特性实现 + */ + _ondrop: function (param) { + callChartListMethodReverse(this, 'ondrop', param, this._status); + this._island.ondrop(param, this._status); + }, + + /** + * dragdone回调 ,可计算特性实现 + */ + _ondragend: function (param) { + callChartListMethodReverse(this, 'ondragend', param, this._status); + + this._timeline && this._timeline.ondragend(param, this._status); + this._island.ondragend(param, this._status); + + // 发生过重计算 + if (this._status.needRefresh) { + this._syncBackupData(this._option); + + var messageCenter = this._messageCenter; + messageCenter.dispatch( + ecConfig.EVENT.DATA_CHANGED, + param.event, + this._eventPackage(param.target), + this + ); + messageCenter.dispatch(ecConfig.EVENT.REFRESH, null, null, this); + } + }, + + /** + * 图例选择响应 + */ + _onlegendSelected: function (param) { + // 用于图表间通信 + this._status.needRefresh = false; + callChartListMethodReverse(this, 'onlegendSelected', param, this._status); + + if (this._status.needRefresh) { + this._messageCenter.dispatch(ecConfig.EVENT.REFRESH, null, null, this); + } + }, + + /** + * 数据区域缩放响应 + */ + _ondataZoom: function (param) { + // 用于图表间通信 + this._status.needRefresh = false; + callChartListMethodReverse(this, 'ondataZoom', param, this._status); + + if (this._status.needRefresh) { + this._messageCenter.dispatch(ecConfig.EVENT.REFRESH, null, null, this); + } + }, + + /** + * 值域漫游响应 + */ + _ondataRange: function (param) { + this._clearEffect(); + // 用于图表间通信 + this._status.needRefresh = false; + callChartListMethodReverse(this, 'ondataRange', param, this._status); + + // 没有相互影响,直接刷新即可 + if (this._status.needRefresh) { + this._zr.refresh(); + } + }, + + /** + * 动态类型切换响应 + */ + _onmagicTypeChanged: function () { + this._clearEffect(); + this._render(this._toolbox.getMagicOption()); + }, + + /** + * 数据视图修改响应 + */ + _ondataViewChanged: function (param) { + this._syncBackupData(param.option); + this._messageCenter.dispatch( + ecConfig.EVENT.DATA_CHANGED, + null, + param, + this + ); + this._messageCenter.dispatch(ecConfig.EVENT.REFRESH, null, null, this); + }, + + /** + * tooltip与图表间通信 + */ + _tooltipHover: function (param) { + var tipShape = [ ]; + callChartListMethodReverse(this, 'ontooltipHover', param, tipShape); + }, + + /** + * 还原 + */ + _onrestore: function () { + this.restore(); + }, + + /** + * 刷新 + */ + _onrefresh: function (param) { + this._refreshInside = true; + this.refresh(param); + this._refreshInside = false; + }, + + /** + * 数据修改后的反向同步dataZoom持有的备份数据 + */ + _syncBackupData: function (curOption) { + this.component.dataZoom && this.component.dataZoom.syncBackupData(curOption); + }, + + /** + * 打包Echarts层的事件附件 + */ + _eventPackage: function (target) { + if (target) { + var ecData = require('./util/ecData'); + + var seriesIndex = ecData.get(target, 'seriesIndex'); + var dataIndex = ecData.get(target, 'dataIndex'); + + dataIndex = seriesIndex != -1 && this.component.dataZoom + ? this.component.dataZoom.getRealDataIndex( + seriesIndex, + dataIndex + ) + : dataIndex; + return { + seriesIndex: seriesIndex, + seriesName: (ecData.get(target, 'series') || { }).name, + dataIndex: dataIndex, + data: ecData.get(target, 'data'), + name: ecData.get(target, 'name'), + value: ecData.get(target, 'value'), + special: ecData.get(target, 'special') + }; + } + return; + }, + + /** + * 图表渲染 + */ + _render: function (magicOption) { + this._mergeGlobalConifg(magicOption); + + var bgColor = magicOption.backgroundColor; + if (bgColor) { + if (!_canvasSupported + && bgColor.indexOf('rgba') != -1 + ) { + // IE6~8对RGBA的处理,filter会带来其他颜色的影响 + var cList = bgColor.split(','); + this.dom.style.filter = 'alpha(opacity=' + + cList[3].substring(0, cList[3].lastIndexOf(')')) * 100 + + ')'; + cList.length = 3; + cList[0] = cList[0].replace('a', ''); + this.dom.style.backgroundColor = cList.join(',') + ')'; + } + else { + this.dom.style.backgroundColor = bgColor; + } + } + + this._zr.clearAnimation(); + this._chartList = [ ]; + + var chartLibrary = require('./chart'); + var componentLibrary = require('./component'); + + if (magicOption.xAxis || magicOption.yAxis) { + magicOption.grid = magicOption.grid || { }; + magicOption.dataZoom = magicOption.dataZoom || { }; + } + + var componentList = [ + 'title', 'legend', 'tooltip', 'dataRange', 'roamController', + 'grid', 'dataZoom', 'xAxis', 'yAxis', 'polar' + ]; + + var ComponentClass; + var componentType; + var component; + for (var i = 0, l = componentList.length; i < l; i++) { + componentType = componentList[i]; + component = this.component[componentType]; + + if (magicOption[componentType]) { + if (component) { + component.refresh && component.refresh(magicOption); + } + else { + ComponentClass = componentLibrary.get( + /^[xy]Axis$/.test(componentType) ? 'axis' : componentType + ); + component = new ComponentClass( + this._themeConfig, this._messageCenter, this._zr, + magicOption, this, componentType + ); + this.component[componentType] = component; + } + this._chartList.push(component); + } + else if (component) { + component.dispose(); + this.component[componentType] = null; + delete this.component[componentType]; + } + } + + var ChartClass; + var chartType; + var chart; + var chartMap = { }; // 记录已经初始化的图表 + for (var i = 0, l = magicOption.series.length; i < l; i++) { + chartType = magicOption.series[i].type; + if (!chartType) { + console.error('series[' + i + '] chart type has not been defined.'); + continue; + } + + if (!chartMap[chartType]) { + chartMap[chartType] = true; + ChartClass = chartLibrary.get(chartType); + if (ChartClass) { + if (this.chart[chartType]) { + chart = this.chart[chartType]; + chart.refresh(magicOption); + } + else { + chart = new ChartClass( + this._themeConfig, this._messageCenter, this._zr, + magicOption, this + ); + } + this._chartList.push(chart); + this.chart[chartType] = chart; + } + else { + console.error(chartType + ' has not been required.'); + } + } + } + + // 已有实例但新option不带这类图表的实例释放 + for (chartType in this.chart) { + if (chartType != ecConfig.CHART_TYPE_ISLAND && !chartMap[chartType]) { + this.chart[chartType].dispose(); + this.chart[chartType] = null; + delete this.chart[chartType]; + } + } + + this.component.grid && this.component.grid.refixAxisShape(this.component); + + this._island.refresh(magicOption); + this._toolbox.refresh(magicOption); + + magicOption.animation && !magicOption.renderAsImage + ? this._zr.refresh() + : this._zr.render(); + + var imgId = 'IMG' + this.id; + var img = document.getElementById(imgId); + if (magicOption.renderAsImage && _canvasSupported) { + // IE8- 不支持图片渲染形式 + if (img) { + // 已经渲染过则更新显示 + img.src = this.getDataURL(magicOption.renderAsImage); + } + else { + // 没有渲染过插入img dom + img = this.getImage(magicOption.renderAsImage); + img.id = imgId; + img.style.position = 'absolute'; + img.style.left = 0; + img.style.top = 0; + this.dom.firstChild.appendChild(img); + } + this.un(); + this._zr.un(); + this._disposeChartList(); + this._zr.clear(); + } + else if (img) { + // 删除可能存在的img + img.parentNode.removeChild(img); + } + img = null; + + this._option = magicOption; + }, + + /** + * 还原 + */ + restore: function () { + this._clearEffect(); + this._option = zrUtil.clone(this._optionRestore); + this._disposeChartList(); + this._island.clear(); + this._toolbox.reset(this._option, true); + this._render(this._option); + }, + + /** + * 刷新 + * @param {Object=} param,可选参数,用于附带option,内部同步用,外部不建议带入数据修改,无法同步 + */ + refresh: function (param) { + this._clearEffect(); + param = param || { }; + var magicOption = param.option; + + // 外部调用的refresh且有option带入 + if (!this._refreshInside && magicOption) { + // 做简单的差异合并去同步内部持有的数据克隆,不建议带入数据 + // 开启数据区域缩放、拖拽重计算、数据视图可编辑模式情况下,当用户产生了数据变化后无法同步 + // 如有带入option存在数据变化,请重新setOption + magicOption = this.getOption(); + zrUtil.merge(magicOption, param.option, true); + zrUtil.merge(this._optionRestore, param.option, true); + this._toolbox.reset(magicOption); + } + + this._island.refresh(magicOption); + this._toolbox.refresh(magicOption); + + // 停止动画 + this._zr.clearAnimation(); + // 先来后到,安顺序刷新各种图表,图表内部refresh优化检查magicOption,无需更新则不更新~ + for (var i = 0, l = this._chartList.length; i < l; i++) { + this._chartList[i].refresh && this._chartList[i].refresh(magicOption); + } + this.component.grid && this.component.grid.refixAxisShape(this.component); + this._zr.refresh(); + }, + + /** + * 释放图表实例 + */ + _disposeChartList: function () { + this._clearEffect(); + + // 停止动画 + this._zr.clearAnimation(); + + var len = this._chartList.length; + while (len--) { + var chart = this._chartList[len]; + + if (chart) { + var chartType = chart.type; + this.chart[chartType] && delete this.chart[chartType]; + this.component[chartType] && delete this.component[chartType]; + chart.dispose && chart.dispose(); + } + } + + this._chartList = [ ]; + }, + + /** + * 非图表全局属性merge~~ + */ + _mergeGlobalConifg: function (magicOption) { + var mergeList = [ + // 背景颜色 + 'backgroundColor', + + // 拖拽重计算相关 + 'calculable', 'calculableColor', 'calculableHolderColor', + + // 孤岛显示连接符 + 'nameConnector', 'valueConnector', + + // 动画相关 + 'animation', 'animationThreshold', 'animationDuration', + 'animationEasing', 'addDataAnimation', + + // 默认标志图形类型列表 + 'symbolList', + + // 降低图表内元素拖拽敏感度,单位ms,不建议外部干预 + 'DRAG_ENABLE_TIME' + ]; + + var len = mergeList.length; + while (len--) { + var mergeItem = mergeList[len]; + if (magicOption[mergeItem] == null) { + magicOption[mergeItem] = this._themeConfig[mergeItem]; + } + } + + // 数值系列的颜色列表,不传则采用内置颜色,可配数组,借用zrender实例注入,会有冲突风险,先这样 + var themeColor = magicOption.color; + if (!(themeColor && themeColor.length)) { + themeColor = this._themeConfig.color; + } + + this._zr.getColor = function (idx) { + var zrColor = require('zrender/tool/color'); + return zrColor.getColor(idx, themeColor); + }; + }, + + /** + * 万能接口,配置图表实例任何可配置选项,多次调用时option选项做merge处理 + * @param {Object} option + * @param {boolean=} notMerge 多次调用时option选项是默认是合并(merge)的, + * 如果不需求,可以通过notMerger参数为true阻止与上次option的合并 + */ + setOption: function (option, notMerge) { + if (!option.timeline) { + return this._setOption(option, notMerge); + } + else { + return this._setTimelineOption(option); + } + }, + + /** + * 万能接口,配置图表实例任何可配置选项,多次调用时option选项做merge处理 + * @param {Object} option + * @param {boolean=} notMerge 多次调用时option选项是默认是合并(merge)的, + * 如果不需求,可以通过notMerger参数为true阻止与上次option的合并 + */ + _setOption: function (option, notMerge) { + if (!notMerge && this._option) { + this._option = zrUtil.merge( + this.getOption(), + zrUtil.clone(option), + true + ); + } + else { + this._option = zrUtil.clone(option); + } + + this._optionRestore = zrUtil.clone(this._option); + + if (!this._option.series || this._option.series.length === 0) { + this._zr.clear(); + return; + } + + if (this.component.dataZoom // 存在dataZoom控件 + && (this._option.dataZoom // 并且新option也存在 + || (this._option.toolbox + && this._option.toolbox.feature + && this._option.toolbox.feature.dataZoom + && this._option.toolbox.feature.dataZoom.show + ) + ) + ) { + // dataZoom同步数据 + this.component.dataZoom.syncOption(this._option); + } + this._toolbox.reset(this._option); + this._render(this._option); + return this; + }, + + /** + * 返回内部持有的当前显示option克隆 + */ + getOption: function () { + var magicOption = zrUtil.clone(this._option); + + var self = this; + function restoreOption(prop) { + var restoreSource = self._optionRestore[prop]; + + if (restoreSource) { + if (restoreSource instanceof Array) { + var len = restoreSource.length; + while (len--) { + magicOption[prop][len].data = zrUtil.clone( + restoreSource[len].data + ); + } + } + else { + magicOption[prop].data = zrUtil.clone(restoreSource.data); + } + } + } + + // 横轴数据还原 + restoreOption('xAxis'); + + // 纵轴数据还原 + restoreOption('yAxis'); + + // 系列数据还原 + restoreOption('series'); + + return magicOption; + }, + + /** + * 数据设置快捷接口 + * @param {Array} series + * @param {boolean=} notMerge 多次调用时option选项是默认是合并(merge)的, + * 如果不需求,可以通过notMerger参数为true阻止与上次option的合并。 + */ + setSeries: function (series, notMerge) { + if (!notMerge) { + this.setOption({series: series}); + } + else { + this._option.series = series; + this.setOption(this._option, notMerge); + } + return this; + }, + + /** + * 返回内部持有的当前显示series克隆 + */ + getSeries: function () { + return this.getOption().series; + }, + + /** + * timelineOption接口,配置图表实例任何可配置选项 + * @param {Object} option + */ + _setTimelineOption: function(option) { + this._timeline && this._timeline.dispose(); + var Timeline = require('./component/timeline'); + var timeline = new Timeline( + this._themeConfig, this._messageCenter, this._zr, option, this + ); + this._timeline = timeline; + this.component.timeline = this._timeline; + + return this; + }, + + /** + * 动态数据添加 + * 形参为单组数据参数,多组时为数据,内容同[seriesIdx, data, isShift, additionData] + * @param {number} seriesIdx 系列索引 + * @param {number | Object} data 增加数据 + * @param {boolean=} isHead 是否队头加入,默认,不指定或false时为队尾插入 + * @param {boolean=} dataGrow 是否增长数据队列长度,默认,不指定或false时移出目标数组对位数据 + * @param {string=} additionData 是否增加类目轴(饼图为图例)数据,附加操作同isHead和dataGrow + */ + addData: function (seriesIdx, data, isHead, dataGrow, additionData) { + var params = seriesIdx instanceof Array + ? seriesIdx + : [[seriesIdx, data, isHead, dataGrow, additionData]]; + + //this._optionRestore 和 magicOption 都要同步 + var magicOption = this.getOption(); + var optionRestore = this._optionRestore; + for (var i = 0, l = params.length; i < l; i++) { + seriesIdx = params[i][0]; + data = params[i][1]; + isHead = params[i][2]; + dataGrow = params[i][3]; + additionData = params[i][4]; + + + var seriesItem = optionRestore.series[seriesIdx]; + var inMethod = isHead ? 'unshift' : 'push'; + var outMethod = isHead ? 'pop' : 'shift'; + if (seriesItem) { + var seriesItemData = seriesItem.data; + var mSeriesItemData = magicOption.series[seriesIdx].data; + + seriesItemData[inMethod](data); + mSeriesItemData[inMethod](data); + if (!dataGrow) { + seriesItemData[outMethod](); + data = mSeriesItemData[outMethod](); + } + + + if (additionData != null) { + var legend; + var legendData; + + if (seriesItem.type === ecConfig.CHART_TYPE_PIE + && (legend = optionRestore.legend) + && (legendData = legend.data) + ) { + var mLegendData = magicOption.legend.data; + legendData[inMethod](additionData); + mLegendData[inMethod](additionData); + + if (!dataGrow) { + var legendDataIdx = zrUtil.indexOf(legendData, data.name); + legendDataIdx != -1 && legendData.splice(legendDataIdx, 1); + + legendDataIdx = zrUtil.indexOf(mLegendData, data.name); + legendDataIdx != -1 && mLegendData.splice(legendDataIdx, 1); + } + } + else if (optionRestore.xAxis != null && optionRestore.yAxis != null) { + // x轴类目 + var axisData; + var mAxisData; + var axisIdx = seriesItem.xAxisIndex || 0; + + if (optionRestore.xAxis[axisIdx].type == null + || optionRestore.xAxis[axisIdx].type === 'category' + ) { + axisData = optionRestore.xAxis[axisIdx].data; + mAxisData = magicOption.xAxis[axisIdx].data; + + axisData[inMethod](additionData); + mAxisData[inMethod](additionData); + if (!dataGrow) { + axisData[outMethod](); + mAxisData[outMethod](); + } + } + + // y轴类目 + axisIdx = seriesItem.yAxisIndex || 0; + if (optionRestore.yAxis[axisIdx].type === 'category') { + axisData = optionRestore.yAxis[axisIdx].data; + mAxisData = magicOption.yAxis[axisIdx].data; + + axisData[inMethod](additionData); + mAxisData[inMethod](additionData); + if (!dataGrow) { + axisData[outMethod](); + mAxisData[outMethod](); + } + } + } + } + + // 同步图表内状态,动画需要 + this._option.series[seriesIdx].data = magicOption.series[seriesIdx].data; + } + } + + this._zr.clearAnimation(); + var chartList = this._chartList; + for (var i = 0, l = chartList.length; i < l; i++) { + if (magicOption.addDataAnimation && chartList[i].addDataAnimation) { + chartList[i].addDataAnimation(params); + } + } + + // dataZoom同步数据 + this.component.dataZoom && this.component.dataZoom.syncOption(magicOption); + + this._option = magicOption; + var self = this; + setTimeout(function (){ + if (!self._zr) { + return; // 已经被释放 + } + self._zr.clearAnimation(); + for (var i = 0, l = chartList.length; i < l; i++) { + // 有addData动画就去掉过渡动画 + chartList[i].motionlessOnce = + magicOption.addDataAnimation && chartList[i].addDataAnimation; + } + self._messageCenter.dispatch( + ecConfig.EVENT.REFRESH, + null, + {option: magicOption}, + self + ); + }, magicOption.addDataAnimation ? 500 : 0); + return this; + }, + + /** + * 动态[标注 | 标线]添加 + * @param {number} seriesIdx 系列索引 + * @param {Object} markData [标注 | 标线]对象,支持多个 + */ + addMarkPoint: function (seriesIdx, markData) { + return this._addMark(seriesIdx, markData, 'markPoint'); + }, + + addMarkLine: function (seriesIdx, markData) { + return this._addMark(seriesIdx, markData, 'markLine'); + }, + + _addMark: function (seriesIdx, markData, markType) { + var series = this._option.series; + var seriesItem; + + if (series && (seriesItem = series[seriesIdx])) { + var seriesR = this._optionRestore.series; + var seriesRItem = seriesR[seriesIdx]; + var markOpt = seriesItem[markType]; + var markOptR = seriesRItem[markType]; + + markOpt = seriesItem[markType] = markOpt || {data: [ ]}; + markOptR = seriesRItem[markType] = markOptR || {data: [ ]}; + + for (var key in markData) { + if (key === 'data') { + // 数据concat + markOpt.data = markOpt.data.concat(markData.data); + markOptR.data = markOptR.data.concat(markData.data); + } + else if (typeof markData[key] != 'object' || markOpt[key] == null) { + // 简单类型或新值直接赋值 + markOpt[key] = markOptR[key] = markData[key]; + } + else { + // 非数据的复杂对象merge + zrUtil.merge(markOpt[key], markData[key], true); + zrUtil.merge(markOptR[key], markData[key], true); + } + } + + var chart = this.chart[seriesItem.type]; + chart && chart.addMark(seriesIdx, markData, markType); + } + + return this; + }, + + /** + * 动态[标注 | 标线]删除 + * @param {number} seriesIdx 系列索引 + * @param {string} markName [标注 | 标线]名称 + */ + delMarkPoint: function (seriesIdx, markName) { + return this._delMark(seriesIdx, markName, 'markPoint'); + }, + + delMarkLine: function (seriesIdx, markName) { + return this._delMark(seriesIdx, markName, 'markLine'); + }, + + _delMark: function (seriesIdx, markName, markType) { + var series = this._option.series; + var seriesItem; + var mark; + var dataArray; + + if (!( + series + && (seriesItem = series[seriesIdx]) + && (mark = seriesItem[markType]) + && (dataArray = mark.data) + ) + ) { + return this; + } + + markName = markName.split(' > '); + var targetIndex = -1; + + for (var i = 0, l = dataArray.length; i < l; i++) { + var dataItem = dataArray[i]; + if (dataItem instanceof Array) { + if (dataItem[0].name === markName[0] + && dataItem[1].name === markName[1] + ) { + targetIndex = i; + break; + } + } + else if (dataItem.name === markName[0]) { + targetIndex = i; + break; + } + } + + if (targetIndex > -1) { + dataArray.splice(targetIndex, 1); + this._optionRestore.series[seriesIdx][markType].data.splice(targetIndex, 1); + + var chart = this.chart[seriesItem.type]; + chart && chart.delMark(seriesIdx, markName.join(' > '), markType); + } + + return this; + }, + + /** + * 获取当前dom + */ + getDom: function () { + return this.dom; + }, + + /** + * 获取当前zrender实例,可用于添加额为的shape和深度控制 + */ + getZrender: function () { + return this._zr; + }, + + /** + * 获取Base64图片dataURL + * @param {string} imgType 图片类型,支持png|jpeg,默认为png + * @return imgDataURL + */ + getDataURL: function (imgType) { + if (!_canvasSupported) { + return ''; + } + + if (this._chartList.length === 0) { + // 渲染为图片 + var imgId = 'IMG' + this.id; + var img = document.getElementById(imgId); + if (img) { + return img.src; + } + } + + // 清除可能存在的tooltip元素 + var tooltip = this.component.tooltip; + tooltip && tooltip.hideTip(); + + switch (imgType) { + case 'jpeg': + break; + default: + imgType = 'png'; + } + + var bgColor = this._option.backgroundColor; + if (bgColor && bgColor.replace(' ','') === 'rgba(0,0,0,0)') { + bgColor = '#fff'; + } + + return this._zr.toDataURL('image/' + imgType, bgColor); + }, + + /** + * 获取img + * @param {string} imgType 图片类型,支持png|jpeg,默认为png + * @return img dom + */ + getImage: function (imgType) { + var title = this._optionRestore.title; + var imgDom = document.createElement('img'); + imgDom.src = this.getDataURL(imgType); + imgDom.title = (title && title.text) || 'ECharts'; + return imgDom; + }, + + /** + * 获取多图联动的Base64图片dataURL + * @param {string} imgType 图片类型,支持png|jpeg,默认为png + * @return imgDataURL + */ + getConnectedDataURL: function (imgType) { + if (!this.isConnected()) { + return this.getDataURL(imgType); + } + + var tempDom = this.dom; + var imgList = { + 'self': { + img: this.getDataURL(imgType), + left: tempDom.offsetLeft, + top: tempDom.offsetTop, + right: tempDom.offsetLeft + tempDom.offsetWidth, + bottom: tempDom.offsetTop + tempDom.offsetHeight + } + }; + + var minLeft = imgList.self.left; + var minTop = imgList.self.top; + var maxRight = imgList.self.right; + var maxBottom = imgList.self.bottom; + + for (var c in this._connected) { + tempDom = this._connected[c].getDom(); + imgList[c] = { + img: this._connected[c].getDataURL(imgType), + left: tempDom.offsetLeft, + top: tempDom.offsetTop, + right: tempDom.offsetLeft + tempDom.offsetWidth, + bottom: tempDom.offsetTop + tempDom.offsetHeight + }; + + minLeft = Math.min(minLeft, imgList[c].left); + minTop = Math.min(minTop, imgList[c].top); + maxRight = Math.max(maxRight, imgList[c].right); + maxBottom = Math.max(maxBottom, imgList[c].bottom); + } + + var zrDom = document.createElement('div'); + zrDom.style.position = 'absolute'; + zrDom.style.left = '-4000px'; + zrDom.style.width = (maxRight - minLeft) + 'px'; + zrDom.style.height = (maxBottom - minTop) + 'px'; + document.body.appendChild(zrDom); + + var zrImg = require('zrender').init(zrDom); + + var ImageShape = require('zrender/shape/Image'); + for (var c in imgList) { + zrImg.addShape(new ImageShape({ + style: { + x: imgList[c].left - minLeft, + y: imgList[c].top - minTop, + image: imgList[c].img + } + })); + } + + zrImg.render(); + var bgColor = this._option.backgroundColor; + if (bgColor && bgColor.replace(/ /g, '') === 'rgba(0,0,0,0)') { + bgColor = '#fff'; + } + + var image = zrImg.toDataURL('image/png', bgColor); + + setTimeout(function () { + zrImg.dispose(); + zrDom.parentNode.removeChild(zrDom); + zrDom = null; + }, 100); + + return image; + }, + + /** + * 获取多图联动的img + * @param {string} imgType 图片类型,支持png|jpeg,默认为png + * @return img dom + */ + getConnectedImage: function (imgType) { + var title = this._optionRestore.title; + var imgDom = document.createElement('img'); + imgDom.src = this.getConnectedDataURL(imgType); + imgDom.title = (title && title.text) || 'ECharts'; + return imgDom; + }, + + /** + * 外部接口绑定事件 + * @param {Object} eventName 事件名称 + * @param {Object} eventListener 事件响应函数 + */ + on: function (eventName, eventListener) { + this._messageCenterOutSide.bind(eventName, eventListener, this); + return this; + }, + + /** + * 外部接口解除事件绑定 + * @param {Object} eventName 事件名称 + * @param {Object} eventListener 事件响应函数 + */ + un: function (eventName, eventListener) { + this._messageCenterOutSide.unbind(eventName, eventListener); + return this; + }, + + /** + * 多图联动 + * @param connectTarget{ECharts | Array } connectTarget 联动目标 + */ + connect: function (connectTarget) { + if (!connectTarget) { + return this; + } + + if (!this._connected) { + this._connected = { }; + } + + if (connectTarget instanceof Array) { + for (var i = 0, l = connectTarget.length; i < l; i++) { + this._connected[connectTarget[i].id] = connectTarget[i]; + } + } + else { + this._connected[connectTarget.id] = connectTarget; + } + + return this; + }, + + /** + * 解除多图联动 + * @param connectTarget{ECharts | Array } connectTarget 解除联动目标 + */ + disConnect: function (connectTarget) { + if (!connectTarget || !this._connected) { + return this; + } + + if (connectTarget instanceof Array) { + for (var i = 0, l = connectTarget.length; i < l; i++) { + delete this._connected[connectTarget[i].id]; + } + } + else { + delete this._connected[connectTarget.id]; + } + + for (var k in this._connected) { + return k, this; // 非空 + } + + // 空,转为标志位 + this._connected = false; + return this; + }, + + /** + * 联动事件响应 + */ + connectedEventHandler: function (param) { + if (param.__echartsId != this.id) { + // 来自其他联动图表的事件 + this._onevent(param); + } + }, + + /** + * 是否存在多图联动 + */ + isConnected: function () { + return !!this._connected; + }, + + /** + * 显示loading过渡 + * @param {Object} loadingOption + */ + showLoading: function (loadingOption) { + var effectList = { + bar: require('zrender/loadingEffect/Bar'), + bubble: require('zrender/loadingEffect/Bubble'), + dynamicLine: require('zrender/loadingEffect/DynamicLine'), + ring: require('zrender/loadingEffect/Ring'), + spin: require('zrender/loadingEffect/Spin'), + whirling: require('zrender/loadingEffect/Whirling') + }; + this._toolbox.hideDataView(); + + loadingOption = loadingOption || { }; + + var textStyle = loadingOption.textStyle || { }; + loadingOption.textStyle = textStyle; + + var finalTextStyle = zrUtil.merge( + zrUtil.clone(textStyle), + this._themeConfig.textStyle + ); + textStyle.textFont = finalTextStyle.fontStyle + ' ' + + finalTextStyle.fontWeight + ' ' + + finalTextStyle.fontSize + 'px ' + + finalTextStyle.fontFamily; + + textStyle.text = loadingOption.text || this._themeConfig.loadingText; + + if (loadingOption.x != null) { + textStyle.x = loadingOption.x; + } + if (loadingOption.y != null) { + textStyle.y = loadingOption.y; + } + + loadingOption.effectOption = loadingOption.effectOption || { }; + loadingOption.effectOption.textStyle = textStyle; + + var Effect = loadingOption.effect; + if (typeof Effect === 'string' || Effect == null) { + Effect = effectList[loadingOption.effect || 'spin']; + } + this._zr.showLoading(new Effect(loadingOption.effectOption)); + return this; + }, + + /** + * 隐藏loading过渡 + */ + hideLoading: function () { + this._zr.hideLoading(); + return this; + }, + + /** + * 主题设置 + */ + setTheme: function (theme) { + if (theme) { + if (typeof theme === 'string') { + // 默认主题 + switch (theme) { + // case 'themename': + // theme = require('./theme/themename'); + default: + theme = require('./theme/default'); + } + } + else { + theme = theme || { }; + } + + // 复位默认配置 + // this._themeConfig会被别的对象引用持有 + // 所以不能改成this._themeConfig = { }; + for (var key in this._themeConfig) { + delete this._themeConfig[key]; + } + for (var key in ecConfig) { + this._themeConfig[key] = zrUtil.clone(ecConfig[key]); + } + + // 颜色数组随theme,不merge + theme.color && (this._themeConfig.color = [ ]); + + // 默认标志图形类型列表,不merge + theme.symbolList && (this._themeConfig.symbolList = [ ]); + + // 应用新主题 + zrUtil.merge(this._themeConfig, zrUtil.clone(theme), true); + } + + if (!_canvasSupported) { // IE8- + this._themeConfig.textStyle.fontFamily = this._themeConfig.textStyle.fontFamily2; + } + + this._timeline && this._timeline.setTheme(true); + this._optionRestore && this.restore(); + }, + + /** + * 视图区域大小变化更新,不默认绑定,供使用方按需调用 + */ + resize: function () { + var self = this; + return function(){ + self._clearEffect(); + self._zr.resize(); + if (self._option && self._option.renderAsImage && _canvasSupported) { + // 渲染为图片重走render模式 + self._render(self._option); + return self; + } + // 停止动画 + self._zr.clearAnimation(); + self._island.resize(); + self._toolbox.resize(); + self._timeline && self._timeline.resize(); + // 先来后到,不能仅刷新自己,也不能在上一个循环中刷新,如坐标系数据改变会影响其他图表的大小 + // 所以安顺序刷新各种图表,图表内部refresh优化无需更新则不更新~ + for (var i = 0, l = self._chartList.length; i < l; i++) { + self._chartList[i].resize && self._chartList[i].resize(); + } + self.component.grid && self.component.grid.refixAxisShape(self.component); + self._zr.refresh(); + self._messageCenter.dispatch(ecConfig.EVENT.RESIZE, null, null, self); + return self; + }; + }, + + _clearEffect: function() { + this._zr.modLayer(ecConfig.EFFECT_ZLEVEL, { motionBlur: false }); + this._zr.painter.clearLayer(ecConfig.EFFECT_ZLEVEL); + }, + + /** + * 清除已渲染内容 ,clear后echarts实例可用 + */ + clear: function () { + this._disposeChartList(); + this._zr.clear(); + this._option = { }; + this._optionRestore = { }; + return this; + }, + + /** + * 释放,dispose后echarts实例不可用 + */ + dispose: function () { + var key = this.dom.getAttribute(DOM_ATTRIBUTE_KEY); + key && delete _instances[key]; + + this._island.dispose(); + this._toolbox.dispose(); + this._timeline && this._timeline.dispose(); + this._messageCenter.unbind(); + this.clear(); + this._zr.dispose(); + this._zr = null; + } + }; + + return self; +}); +define('echarts', ['echarts/echarts'], function (main) { return main; }); - for (var i = 0, len = this.shapeList.length; i < len; i++) { - if (this.shapeList[i].id == target.id) { - seriesIndex = ecData.get(target, 'seriesIndex'); - dataIndex = ecData.get(target, 'dataIndex'); - // 当前点击的 - if (!style._hasSelected) { - var midAngle = - ((style.startAngle + style.endAngle) / 2) - .toFixed(2) - 0; - target.style._hasSelected = true; - this._selected[seriesIndex][dataIndex] = true; - target.style._x = target.style.x; - target.style._y = target.style.y; - offset = this.query( - series[seriesIndex], - 'selectedOffset' - ); - target.style.x += zrMath.cos(midAngle, true) - * offset; - target.style.y -= zrMath.sin(midAngle, true) - * offset; - } - else { - // 复位 - target.style.x = target.style._x; - target.style.y = target.style._y; - target.style._hasSelected = false; - this._selected[seriesIndex][dataIndex] = false; - } - - this.zr.modShape(target.id, target); - } - else if (this.shapeList[i].style._hasSelected - && this._selectedMode == 'single' - ) { - seriesIndex = ecData.get(this.shapeList[i], 'seriesIndex'); - dataIndex = ecData.get(this.shapeList[i], 'dataIndex'); - // 单选模式下需要取消其他已经选中的 - this.shapeList[i].style.x = this.shapeList[i].style._x; - this.shapeList[i].style.y = this.shapeList[i].style._y; - this.shapeList[i].style._hasSelected = false; - this._selected[seriesIndex][dataIndex] = false; - this.zr.modShape( - this.shapeList[i].id, this.shapeList[i] - ); - } - } - - this.messageCenter.dispatch( - ecConfig.EVENT.PIE_SELECTED, - param.event, - { - selected : this._selected, - target : ecData.get(target, 'name') - }, - this.myChart - ); - this.zr.refresh(); - } - }; - - zrUtil.inherits(Pie, ChartBase); - zrUtil.inherits(Pie, ComponentBase); - - // 图表注册 - require('../chart').define('pie', Pie); - - return Pie; +/** + * zrender + * + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + * shape类:仪表盘指针 + * 可配图形属性: + { + // 基础属性 + shape : 'gauge-pointer', // 必须,shape类标识,需要显式指定 + id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 + zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 + invisible : {boolean}, // 默认为false,是否可见 + + // 样式属性,默认状态样式样式属性 + style : { + xStart : {number}, // 必须,起点横坐标 + yStart : {number}, // 必须,起点纵坐标 + xEnd : {number}, // 必须,终点横坐标 + yEnd : {number}, // 必须,终点纵坐标 + strokeColor : {color}, // 默认为'#000',线条颜色(轮廓),支持rgba + lineWidth : {number}, // 线条宽度 + }, + + // 交互属性,详见shape.Base + + // 事件属性,详见shape.Base + } + */ +define('echarts/util/shape/GaugePointer',['require','zrender/shape/Base','zrender/tool/util','./normalIsCover'],function (require) { + var Base = require('zrender/shape/Base'); + var zrUtil = require('zrender/tool/util'); + + function GaugePointer(options) { + Base.call(this, options); + } + + GaugePointer.prototype = { + type: 'gauge-pointer', + /** + * 创建矩形路径 + * @param {Context2D} ctx Canvas 2D上下文 + * @param {Object} style 样式 + */ + buildPath : function (ctx, style) { + var r = style.r; + var width = style.width; + var angle = style.angle; + var x = style.x - Math.cos(angle) * width * (width >= r / 3 ? 1 : 2); + var y = style.y + Math.sin(angle) * width * (width >= r / 3 ? 1 : 2); + + angle = style.angle - Math.PI / 2; + ctx.moveTo(x, y); + ctx.lineTo( + style.x + Math.cos(angle) * width, + style.y - Math.sin(angle) * width + ); + ctx.lineTo( + style.x + Math.cos(style.angle) * r, + style.y - Math.sin(style.angle) * r + ); + ctx.lineTo( + style.x - Math.cos(angle) * width, + style.y + Math.sin(angle) * width + ); + ctx.lineTo(x, y); + return; + }, + + /** + * 返回矩形区域,用于局部刷新和文字定位 + * @param {Object} style + */ + getRect : function(style) { + if (style.__rect) { + return style.__rect; + } + + var width = style.width * 2; + var xStart = style.x; + var yStart = style.y; + var xEnd = xStart + Math.cos(style.angle) * style.r; + var yEnd = yStart - Math.sin(style.angle) * style.r; + + style.__rect = { + x : Math.min(xStart, xEnd) - width, + y : Math.min(yStart, yEnd) - width, + width : Math.abs(xStart - xEnd) + width, + height : Math.abs(yStart - yEnd) + width + }; + return style.__rect; + }, + + isCover : require('./normalIsCover') + }; + + zrUtil.inherits(GaugePointer, Base); + + return GaugePointer; +}); + +/** + * echarts图表类:仪表盘 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/chart/gauge',['require','../component/base','./base','../util/shape/GaugePointer','zrender/shape/Text','zrender/shape/Line','zrender/shape/Rectangle','zrender/shape/Circle','zrender/shape/Sector','../config','../util/ecData','../util/accMath','zrender/tool/util','../chart'],function (require) { + var ComponentBase = require('../component/base'); + var ChartBase = require('./base'); + + // 图形依赖 + var GaugePointerShape = require('../util/shape/GaugePointer'); + var TextShape = require('zrender/shape/Text'); + var LineShape = require('zrender/shape/Line'); + var RectangleShape = require('zrender/shape/Rectangle'); + var CircleShape = require('zrender/shape/Circle'); + var SectorShape = require('zrender/shape/Sector'); + + var ecConfig = require('../config'); + var ecData = require('../util/ecData'); + var accMath = require('../util/accMath'); + var zrUtil = require('zrender/tool/util'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} series 数据 + * @param {Object} component 组件 + */ + function Gauge(ecTheme, messageCenter, zr, option, myChart){ + // 基类 + ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); + // 图表基类 + ChartBase.call(this); + this.refresh(option); + } + + Gauge.prototype = { + type: ecConfig.CHART_TYPE_GAUGE, + /** + * 绘制图形 + */ + _buildShape: function () { + var series = this.series; + // 复用参数索引 + this._paramsMap = {}; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type === ecConfig.CHART_TYPE_GAUGE) { + series[i] = this.reformOption(series[i]); + this._buildSingleGauge(i); + this.buildMark(i); + } + } + + this.addShapeList(); + }, + + /** + * 构建单个仪表盘 + * + * @param {number} seriesIndex 系列索引 + */ + _buildSingleGauge: function (seriesIndex) { + var serie = this.series[seriesIndex]; + + this._paramsMap[seriesIndex] = { + center: this.parseCenter(this.zr, serie.center), + radius: this.parseRadius(this.zr, serie.radius), + startAngle: serie.startAngle.toFixed(2) - 0, + endAngle: serie.endAngle.toFixed(2) - 0 + }; + this._paramsMap[seriesIndex].totalAngle = this._paramsMap[seriesIndex].startAngle + - this._paramsMap[seriesIndex].endAngle; + + this._colorMap(seriesIndex); + + this._buildAxisLine(seriesIndex); + + this._buildSplitLine(seriesIndex); + + this._buildAxisTick(seriesIndex); + + this._buildAxisLabel(seriesIndex); + + this._buildPointer(seriesIndex); + + this._buildTitle(seriesIndex); + + this._buildDetail(seriesIndex); + }, + + // 轴线 + _buildAxisLine: function (seriesIndex) { + var serie = this.series[seriesIndex]; + if (!serie.axisLine.show) { + return; + } + var min = serie.min; + var total = serie.max - min; + var params = this._paramsMap[seriesIndex]; + var center = params.center; + var startAngle = params.startAngle; + var totalAngle = params.totalAngle; + var colorArray = params.colorArray; + var lineStyle = serie.axisLine.lineStyle; + var lineWidth = this.parsePercent(lineStyle.width, params.radius[1]); + var r = params.radius[1]; + var r0 = r - lineWidth; + + var sectorShape; + var lastAngle = startAngle; + var newAngle; + for (var i = 0, l = colorArray.length; i < l; i++) { + newAngle = startAngle - totalAngle * (colorArray[i][0] - min) / total; + sectorShape = this._getSector( + center, r0, r, + newAngle, // startAngle + lastAngle, // endAngle + colorArray[i][1], // color + lineStyle + ); + lastAngle = newAngle; + sectorShape._animationAdd = 'r'; + ecData.set(sectorShape, 'seriesIndex', seriesIndex); + ecData.set(sectorShape, 'dataIndex', i); + this.shapeList.push(sectorShape); + } + }, + + // 坐标轴分割线 + _buildSplitLine: function (seriesIndex) { + var serie = this.series[seriesIndex]; + if (!serie.splitLine.show) { + return; + } + + var params = this._paramsMap[seriesIndex]; + var splitNumber = serie.splitNumber; + var min = serie.min; + var total = serie.max - min; + var splitLine = serie.splitLine; + var length = this.parsePercent( + splitLine.length, params.radius[1] + ); + var lineStyle = splitLine.lineStyle; + var color = lineStyle.color; + var center = params.center; + var startAngle = params.startAngle * Math.PI / 180; + var totalAngle = params.totalAngle * Math.PI / 180; + var r = params.radius[1]; + var r0 = r - length; + + var angle; + var sinAngle; + var cosAngle; + for (var i = 0; i <= splitNumber; i++) { + angle = startAngle - totalAngle / splitNumber * i; + sinAngle = Math.sin(angle); + cosAngle = Math.cos(angle); + this.shapeList.push(new LineShape({ + zlevel: this._zlevelBase + 1, + hoverable: false, + style: { + xStart: center[0] + cosAngle * r, + yStart: center[1] - sinAngle * r, + xEnd: center[0] + cosAngle * r0, + yEnd: center[1] - sinAngle * r0, + strokeColor: color === 'auto' + ? this._getColor(seriesIndex, min + total / splitNumber * i) + : color, + lineType: lineStyle.type, + lineWidth: lineStyle.width, + shadowColor: lineStyle.shadowColor, + shadowBlur: lineStyle.shadowBlur, + shadowOffsetX: lineStyle.shadowOffsetX, + shadowOffsetY: lineStyle.shadowOffsetY + } + })); + } + }, + + // 小标记 + _buildAxisTick: function (seriesIndex) { + var serie = this.series[seriesIndex]; + if (!serie.axisTick.show) { + return; + } + + var params = this._paramsMap[seriesIndex]; + var splitNumber = serie.splitNumber; + var min = serie.min; + var total = serie.max - min; + var axisTick = serie.axisTick; + var tickSplit = axisTick.splitNumber; + var length = this.parsePercent( + axisTick.length, params.radius[1] + ); + var lineStyle = axisTick.lineStyle; + var color = lineStyle.color; + + var center = params.center; + var startAngle = params.startAngle * Math.PI / 180; + var totalAngle = params.totalAngle * Math.PI / 180; + var r = params.radius[1]; + var r0 = r - length; + + var angle; + var sinAngle; + var cosAngle; + for (var i = 0, l = splitNumber * tickSplit; i <= l; i++) { + if (i % tickSplit === 0) { // 同splitLine + continue; + } + angle = startAngle - totalAngle / l * i; + sinAngle = Math.sin(angle); + cosAngle = Math.cos(angle); + this.shapeList.push(new LineShape({ + zlevel: this._zlevelBase + 1, + hoverable: false, + style: { + xStart: center[0] + cosAngle * r, + yStart: center[1] - sinAngle * r, + xEnd: center[0] + cosAngle * r0, + yEnd: center[1] - sinAngle * r0, + strokeColor: color === 'auto' + ? this._getColor(seriesIndex, min + total / l * i) + : color, + lineType: lineStyle.type, + lineWidth: lineStyle.width, + shadowColor: lineStyle.shadowColor, + shadowBlur: lineStyle.shadowBlur, + shadowOffsetX: lineStyle.shadowOffsetX, + shadowOffsetY: lineStyle.shadowOffsetY + } + })); + } + }, + + // 坐标轴文本 + _buildAxisLabel: function (seriesIndex) { + var serie = this.series[seriesIndex]; + if (!serie.axisLabel.show) { + return; + } + + var splitNumber = serie.splitNumber; + var min = serie.min; + var total = serie.max - min; + var textStyle = serie.axisLabel.textStyle; + var textFont = this.getFont(textStyle); + var color = textStyle.color; + + var params = this._paramsMap[seriesIndex]; + var center = params.center; + var startAngle = params.startAngle; + var totalAngle = params.totalAngle; + var r0 = params.radius[1] + - this.parsePercent( + serie.splitLine.length, params.radius[1] + ) - 10; + + var angle; + var sinAngle; + var cosAngle; + var value; + for (var i = 0; i <= splitNumber; i++) { + value = accMath.accAdd( + min , accMath.accMul(accMath.accDiv(total , splitNumber), i) + ); + angle = startAngle - totalAngle / splitNumber * i; + sinAngle = Math.sin(angle * Math.PI / 180); + cosAngle = Math.cos(angle * Math.PI / 180); + angle = (angle + 360) % 360; + this.shapeList.push(new TextShape({ + zlevel: this._zlevelBase + 1, + hoverable: false, + style: { + x: center[0] + cosAngle * r0, + y: center[1] - sinAngle * r0, + color: color === 'auto' ? this._getColor(seriesIndex, value) : color, + text: this._getLabelText(serie.axisLabel.formatter, value), + textAlign: (angle >= 110 && angle <= 250) + ? 'left' + : (angle <= 70 || angle >= 290) + ? 'right' + : 'center', + textBaseline: (angle >= 10 && angle <= 170) + ? 'top' + : (angle >= 190 && angle <= 350) + ? 'bottom' + : 'middle', + textFont: textFont, + shadowColor: textStyle.shadowColor, + shadowBlur: textStyle.shadowBlur, + shadowOffsetX: textStyle.shadowOffsetX, + shadowOffsetY: textStyle.shadowOffsetY + } + })); + } + }, + + _buildPointer: function (seriesIndex) { + var serie = this.series[seriesIndex]; + if (!serie.pointer.show) { + return; + } + var total = serie.max - serie.min; + var pointer = serie.pointer; + + var params = this._paramsMap[seriesIndex]; + var length = this.parsePercent(pointer.length, params.radius[1]); + var width = this.parsePercent(pointer.width, params.radius[1]); + var center = params.center; + var value = this._getValue(seriesIndex); + value = value < serie.max ? value : serie.max; + + var angle = (params.startAngle - params.totalAngle / total * (value - serie.min)) * Math.PI / 180; + var color = pointer.color === 'auto' + ? this._getColor(seriesIndex, value) : pointer.color; + + var pointShape = new GaugePointerShape({ + zlevel: this._zlevelBase + 1, + style: { + x: center[0], + y: center[1], + r: length, + startAngle: params.startAngle * Math.PI / 180, + angle: angle, + color: color, + width: width, + shadowColor: pointer.shadowColor, + shadowBlur: pointer.shadowBlur, + shadowOffsetX: pointer.shadowOffsetX, + shadowOffsetY: pointer.shadowOffsetY + }, + highlightStyle: { + brushType: 'fill', + width: width > 2 ? 2 : (width / 2), + color: '#fff' + } + }); + ecData.pack( + pointShape, + this.series[seriesIndex], seriesIndex, + this.series[seriesIndex].data[0], 0, + this.series[seriesIndex].data[0].name, + value + ); + this.shapeList.push(pointShape); + + this.shapeList.push(new CircleShape({ + zlevel: this._zlevelBase + 2, + hoverable: false, + style: { + x: center[0], + y: center[1], + r: pointer.width / 2.5, + color: '#fff' + } + })); + }, + + _buildTitle: function(seriesIndex) { + var serie = this.series[seriesIndex]; + if (!serie.title.show) { + return; + } + + var data = serie.data[0]; + var name = data.name != null ? data.name : ''; + if (name !== '') { // 不要帮我代码规范 + var title = serie.title; + var offsetCenter = title.offsetCenter; + var textStyle = title.textStyle; + var textColor = textStyle.color; + var params = this._paramsMap[seriesIndex]; + var x = params.center[0] + this.parsePercent(offsetCenter[0], params.radius[1]); + var y = params.center[1] + this.parsePercent(offsetCenter[1], params.radius[1]); + this.shapeList.push(new TextShape({ + zlevel: this._zlevelBase + + (Math.abs(x - params.center[0]) + Math.abs(y - params.center[1])) + < textStyle.fontSize * 2 ? 2 : 1, + hoverable: false, + style: { + x: x, + y: y, + color: textColor === 'auto' ? this._getColor(seriesIndex) : textColor, + text: name, + textAlign: 'center', + textFont: this.getFont(textStyle), + shadowColor: textStyle.shadowColor, + shadowBlur: textStyle.shadowBlur, + shadowOffsetX: textStyle.shadowOffsetX, + shadowOffsetY: textStyle.shadowOffsetY + } + })); + } + }, + + _buildDetail: function(seriesIndex) { + var serie = this.series[seriesIndex]; + if (!serie.detail.show) { + return; + } + + var detail = serie.detail; + var offsetCenter = detail.offsetCenter; + var color = detail.backgroundColor; + var textStyle = detail.textStyle; + var textColor = textStyle.color; + + var params = this._paramsMap[seriesIndex]; + var value = this._getValue(seriesIndex); + var x = params.center[0] - detail.width / 2 + + this.parsePercent(offsetCenter[0], params.radius[1]); + var y = params.center[1] + + this.parsePercent(offsetCenter[1], params.radius[1]); + this.shapeList.push(new RectangleShape({ + zlevel: this._zlevelBase + + (Math.abs(x+detail.width/2 - params.center[0]) + + Math.abs(y+detail.height/2 - params.center[1])) < textStyle.fontSize + ? 2 : 1, + hoverable: false, + style: { + x: x, + y: y, + width: detail.width, + height: detail.height, + brushType: 'both', + color: color === 'auto' ? this._getColor(seriesIndex, value) : color, + lineWidth: detail.borderWidth, + strokeColor: detail.borderColor, + + shadowColor: detail.shadowColor, + shadowBlur: detail.shadowBlur, + shadowOffsetX: detail.shadowOffsetX, + shadowOffsetY: detail.shadowOffsetY, + + text: this._getLabelText(detail.formatter, value), + textFont: this.getFont(textStyle), + textPosition: 'inside', + textColor: textColor === 'auto' ? this._getColor(seriesIndex, value) : textColor + } + })); + }, + + _getValue: function(seriesIndex) { + var data = this.series[seriesIndex].data[0]; + return data.value != null ? data.value : data; + }, + + /** + * 颜色索引 + */ + _colorMap: function (seriesIndex) { + var serie = this.series[seriesIndex]; + var min = serie.min; + var total = serie.max - min; + var color = serie.axisLine.lineStyle.color; + if (!(color instanceof Array)) { + color = [[1, color]]; + } + var colorArray = []; + for (var i = 0, l = color.length; i < l; i++) { + colorArray.push([color[i][0] * total + min, color[i][1]]); + } + this._paramsMap[seriesIndex].colorArray = colorArray; + }, + + /** + * 自动颜色 + */ + _getColor: function (seriesIndex, value) { + if (value == null) { + value = this._getValue(seriesIndex); + } + + var colorArray = this._paramsMap[seriesIndex].colorArray; + for (var i = 0, l = colorArray.length; i < l; i++) { + if (colorArray[i][0] >= value) { + return colorArray[i][1]; + } + } + return colorArray[colorArray.length - 1][1]; + }, + + /** + * 构建扇形 + */ + _getSector: function (center, r0, r, startAngle, endAngle, color, lineStyle) { + return new SectorShape ({ + zlevel: this._zlevelBase, + hoverable: false, + style: { + x: center[0], // 圆心横坐标 + y: center[1], // 圆心纵坐标 + r0: r0, // 圆环内半径 + r: r, // 圆环外半径 + startAngle: startAngle, + endAngle: endAngle, + brushType: 'fill', + color: color, + shadowColor: lineStyle.shadowColor, + shadowBlur: lineStyle.shadowBlur, + shadowOffsetX: lineStyle.shadowOffsetX, + shadowOffsetY: lineStyle.shadowOffsetY + } + }); + }, + + /** + * 根据lable.format计算label text + */ + _getLabelText: function (formatter, value) { + if (formatter) { + if (typeof formatter === 'function') { + return formatter.call(this.myChart, value); + } + else if (typeof formatter === 'string') { + return formatter.replace('{value}', value); + } + } + return value; + }, + + /** + * 刷新 + */ + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + + this.backupShapeList(); + this._buildShape(); + } + }; + + zrUtil.inherits(Gauge, ChartBase); + zrUtil.inherits(Gauge, ComponentBase); + + // 图表注册 + require('../chart').define('gauge', Gauge); + + return Gauge; +}); +/** + * echarts图表类:漏斗图 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/chart/funnel',['require','../component/base','./base','zrender/shape/Text','zrender/shape/Line','zrender/shape/Polygon','../config','../util/ecData','../util/number','zrender/tool/util','zrender/tool/color','zrender/tool/area','../chart'],function (require) { + var ComponentBase = require('../component/base'); + var ChartBase = require('./base'); + + // 图形依赖 + var TextShape = require('zrender/shape/Text'); + var LineShape = require('zrender/shape/Line'); + var PolygonShape = require('zrender/shape/Polygon'); + + var ecConfig = require('../config'); + var ecData = require('../util/ecData'); + var number = require('../util/number'); + var zrUtil = require('zrender/tool/util'); + var zrColor = require('zrender/tool/color'); + var zrArea = require('zrender/tool/area'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} series 数据 + * @param {Object} component 组件 + */ + function Funnel(ecTheme, messageCenter, zr, option, myChart){ + // 基类 + ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); + // 图表基类 + ChartBase.call(this); + this.refresh(option); + } + + Funnel.prototype = { + type: ecConfig.CHART_TYPE_FUNNEL, + /** + * 绘制图形 + */ + _buildShape: function () { + var series = this.series; + var legend = this.component.legend; + // 复用参数索引 + this._paramsMap = {}; + this._selected = {}; + this.selectedMap = {}; + + var serieName; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type === ecConfig.CHART_TYPE_FUNNEL) { + series[i] = this.reformOption(series[i]); + serieName = series[i].name || ''; + // 系列图例开关 + this.selectedMap[serieName] = legend ? legend.isSelected(serieName) : true; + if (!this.selectedMap[serieName]) { + continue; + } + this._buildSingleFunnel(i); + this.buildMark(i); + } + } + + this.addShapeList(); + }, + + /** + * 构建单个仪表盘 + * + * @param {number} seriesIndex 系列索引 + */ + _buildSingleFunnel: function (seriesIndex) { + var legend = this.component.legend; + var serie = this.series[seriesIndex]; + var data = this._mapData(seriesIndex); + var location = this._getLocation(seriesIndex); + this._paramsMap[seriesIndex] = { + location: location, + data: data + }; + + var itemName; + var total = 0; + var selectedData = []; + // 计算需要显示的个数和总值 + for (var i = 0, l = data.length; i < l; i++) { + itemName = data[i].name; + if (legend){ + this.selectedMap[itemName] = legend.isSelected(itemName); + } else { + this.selectedMap[itemName] = true; + } + if (this.selectedMap[itemName] && !isNaN(data[i].value)) { + selectedData.push(data[i]); + total++; + } + } + if (total === 0) { + return; + } + // 可计算箱子 + var funnelCase = this._buildFunnelCase(seriesIndex); + var gap = serie.gap; + var height = total > 1 + ? (location.height - (total - 1) * gap) / total : location.height; + var width; + var lastY = location.y; + var lastWidth = serie.sort === 'descending' + ? this._getItemWidth(seriesIndex, selectedData[0].value) + : number.parsePercent(serie.minSize, location.width); + var next = serie.sort === 'descending' ? 1 : 0; + var centerX = location.centerX; + var pointList = [ + [ + centerX - lastWidth / 2 - (lastWidth === 0 ? 0 : 10), + lastY - (lastWidth === 0 ? 10 : 5) + ], + [ + centerX + lastWidth / 2 + (lastWidth === 0 ? 0 : 10), + lastY - (lastWidth === 0 ? 10 : 5) + ] + ]; + for (var i = 0, l = selectedData.length; i < l; i++) { + itemName = selectedData[i].name; + if (this.selectedMap[itemName] && !isNaN(selectedData[i].value)) { + width = i <= l - 2 + ? this._getItemWidth(seriesIndex, selectedData[i + next].value) + : serie.sort === 'descending' + ? number.parsePercent(serie.minSize, location.width) + : number.parsePercent(serie.maxSize, location.width); + this._buildItem( + seriesIndex, selectedData[i]._index, + legend + ? legend.getColor(itemName) : this.zr.getColor(selectedData[i]._index), + centerX - lastWidth / 2, lastY, + lastWidth, width, height + ); + lastY += height + gap; + lastWidth = width; + pointList.unshift([centerX - lastWidth / 2 - 10, lastY]); + pointList.push([centerX + lastWidth / 2 + 10, lastY]); + } + } + if (funnelCase) { + if (lastWidth === 0) { + pointList.pop(); + pointList[0][0] +=10; + pointList[0][1] +=10; + } + else { + pointList[pointList.length - 1][1] +=5; + pointList[0][1] +=5; + } + funnelCase.style.pointList = pointList; + } + }, + + _buildFunnelCase: function(seriesIndex) { + var serie = this.series[seriesIndex]; + if (this.deepQuery([serie, this.option], 'calculable')) { + var location = this._paramsMap[seriesIndex].location; + var gap = 10; + var funnelCase = { + hoverable: false, + style: { + pointListd: [ + [location.x - gap, location.y - gap], + [location.x + location.width + gap, location.y - gap], + [location.x + location.width + gap, location.y + location.height + gap], + [location.x - gap, location.y + location.height + gap] + ], + brushType: 'stroke', + lineWidth: 1, + strokeColor: serie.calculableHolderColor + || this.ecTheme.calculableHolderColor + } + }; + ecData.pack(funnelCase, serie, seriesIndex, undefined, -1); + this.setCalculable(funnelCase); + funnelCase = new PolygonShape(funnelCase); + this.shapeList.push(funnelCase); + return funnelCase; + } + }, + + _getLocation: function (seriesIndex) { + var gridOption = this.series[seriesIndex]; + var zrWidth = this.zr.getWidth(); + var zrHeight = this.zr.getHeight(); + var x = this.parsePercent(gridOption.x, zrWidth); + var y = this.parsePercent(gridOption.y, zrHeight); + + var width; + if (gridOption.width == null) { + width = zrWidth - x - this.parsePercent(gridOption.x2, zrWidth); + } + else { + width = this.parsePercent(gridOption.width, zrWidth); + } + + var height; + if (gridOption.height == null) { + height = zrHeight - y - this.parsePercent(gridOption.y2, zrHeight); + } + else { + height = this.parsePercent(gridOption.height, zrHeight); + } + + return { + x: x, + y: y, + width: width, + height: height, + centerX: x + width / 2 + }; + }, + + _mapData: function(seriesIndex) { + var serie = this.series[seriesIndex]; + var funnelData = zrUtil.clone(serie.data); + for (var i = 0, l = funnelData.length; i < l; i++) { + funnelData[i]._index = i; + } + function numDescending (a, b) { + if (a.value === '-') { + return 1; + } + else if (b.value === '-') { + return -1; + } + return b.value - a.value; + } + function numAscending (a, b) { + return -numDescending(a, b); + } + if (serie.sort != 'none') { + funnelData.sort(serie.sort === 'descending' ? numDescending : numAscending); + } + + return funnelData; + }, + + /** + * 构建单个扇形及指标 + */ + _buildItem: function ( + seriesIndex, dataIndex, defaultColor, + x, y, topWidth, bottomWidth, height + ) { + var series = this.series; + var serie = series[seriesIndex]; + var data = serie.data[dataIndex]; + // 漏斗 + var polygon = this.getPolygon( + seriesIndex, dataIndex, defaultColor, + x, y, topWidth, bottomWidth, height + ); + ecData.pack( + polygon, + series[seriesIndex], seriesIndex, + series[seriesIndex].data[dataIndex], dataIndex, + series[seriesIndex].data[dataIndex].name + ); + this.shapeList.push(polygon); + + // 文本标签 + var label = this.getLabel( + seriesIndex, dataIndex, defaultColor, + x, y, topWidth, bottomWidth, height + ); + ecData.pack( + label, + series[seriesIndex], seriesIndex, + series[seriesIndex].data[dataIndex], dataIndex, + series[seriesIndex].data[dataIndex].name + ); + this.shapeList.push(label); + // 特定状态下是否需要显示文本标签 + if (!this._needLabel(serie, data,false)) { + label.invisible = true; + } + + // 文本标签视觉引导线 + var labelLine = this.getLabelLine( + seriesIndex, dataIndex, defaultColor, + x, y, topWidth, bottomWidth, height + ); + this.shapeList.push(labelLine); + // 特定状态下是否需要显示文本标签引导线 + if (!this._needLabelLine(serie, data,false)) { + labelLine.invisible = true; + } + + var polygonHoverConnect = []; + var labelHoverConnect = []; + if (this._needLabelLine(serie, data, true)) { + polygonHoverConnect.push(labelLine.id); + labelHoverConnect.push(labelLine.id); + } + if (this._needLabel(serie, data, true)) { + polygonHoverConnect.push(label.id); + labelHoverConnect.push(polygon.id); + } + polygon.hoverConnect = polygonHoverConnect; + label.hoverConnect = labelHoverConnect; + polygon.onmouseover = label.onmouseover = this.hoverConnect; + }, + + /** + * 根据值计算宽度 + */ + _getItemWidth: function (seriesIndex, value) { + var serie = this.series[seriesIndex]; + var location = this._paramsMap[seriesIndex].location; + var min = serie.min; + var max = serie.max; + var minSize = number.parsePercent(serie.minSize, location.width); + var maxSize = number.parsePercent(serie.maxSize, location.width); + return value * (maxSize - minSize) / (max - min); + }, + + /** + * 构建扇形 + */ + getPolygon: function ( + seriesIndex, dataIndex, defaultColor, + x, y, topWidth, bottomWidth, height + ) { + var serie = this.series[seriesIndex]; + var data = serie.data[dataIndex]; + var queryTarget = [data, serie]; + + // 多级控制 + var normal = this.deepMerge( + queryTarget, + 'itemStyle.normal' + ) || {}; + var emphasis = this.deepMerge( + queryTarget, + 'itemStyle.emphasis' + ) || {}; + var normalColor = this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) + || defaultColor; + + var emphasisColor = this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data) + || (typeof normalColor === 'string' + ? zrColor.lift(normalColor, -0.2) + : normalColor + ); + + var polygon = { + zlevel: this._zlevelBase, + clickable: this.deepQuery(queryTarget, 'clickable'), + style: { + pointList: [ + [x, y], + [x + topWidth, y], + [x + topWidth - (topWidth - bottomWidth) / 2, y + height], + [x + (topWidth - bottomWidth) / 2, y + height] + ], + brushType: 'both', + color: normalColor, + lineWidth: normal.borderWidth, + strokeColor: normal.borderColor + }, + highlightStyle: { + color: emphasisColor, + lineWidth: emphasis.borderWidth, + strokeColor: emphasis.borderColor + } + }; + + if (this.deepQuery([data, serie, this.option], 'calculable')) { + this.setCalculable(polygon); + polygon.draggable = true; + } + + return new PolygonShape(polygon); + }, + + /** + * 需要显示则会有返回构建好的shape,否则返回undefined + */ + getLabel: function ( + seriesIndex, dataIndex, defaultColor, + x, y, topWidth, bottomWidth, height + ) { + var serie = this.series[seriesIndex]; + var data = serie.data[dataIndex]; + var location = this._paramsMap[seriesIndex].location; + // serie里有默认配置,放心大胆的用! + var itemStyle = zrUtil.merge( + zrUtil.clone(data.itemStyle) || {}, + serie.itemStyle + ); + var status = 'normal'; + // label配置 + var labelControl = itemStyle[status].label; + var textStyle = labelControl.textStyle || {}; + var lineLength = itemStyle[status].labelLine.length; + + var text = this.getLabelText(seriesIndex, dataIndex, status); + var textFont = this.getFont(textStyle); + var textAlign; + var textX; + var textColor = defaultColor; + labelControl.position = labelControl.position + || itemStyle.normal.label.position; + if (labelControl.position === 'inner' || labelControl.position === 'inside') { + // 内部 + textAlign = 'center'; + textX = x + topWidth / 2; + if (Math.max(topWidth, bottomWidth) / 2 > zrArea.getTextWidth(text, textFont)) { + textColor = '#fff'; + } + else { + textColor = zrColor.reverse(defaultColor); + } + } + else if (labelControl.position === 'left'){ + // 左侧显示 + textAlign = 'right'; + textX = lineLength === 'auto' + ? (location.x - 10) + : (location.centerX - Math.max(topWidth, bottomWidth) / 2 - lineLength); + } + else { + // 右侧显示,默认 labelControl.position === 'outer' || 'right) + textAlign = 'left'; + textX = lineLength === 'auto' + ? (location.x + location.width + 10) + : (location.centerX + Math.max(topWidth, bottomWidth) / 2 + lineLength); + } + + var textShape = { + zlevel: this._zlevelBase + 1, + style: { + x: textX, + y: y + height / 2, + color: textStyle.color || textColor, + text: text, + textAlign: textStyle.align || textAlign, + textBaseline: textStyle.baseline || 'middle', + textFont: textFont + } + }; + + //----------高亮 + status = 'emphasis'; + // label配置 + labelControl = itemStyle[status].label || labelControl; + textStyle = labelControl.textStyle || textStyle; + lineLength = itemStyle[status].labelLine.length || lineLength; + labelControl.position = labelControl.position || itemStyle.normal.label.position; + text = this.getLabelText(seriesIndex, dataIndex, status); + textFont = this.getFont(textStyle); + textColor = defaultColor; + if (labelControl.position === 'inner' || labelControl.position === 'inside') { + // 内部 + textAlign = 'center'; + textX = x + topWidth / 2; + if (Math.max(topWidth, bottomWidth) / 2 > zrArea.getTextWidth(text, textFont)) { + textColor = '#fff'; + } + else { + textColor = zrColor.reverse(defaultColor); + } + } + else if (labelControl.position === 'left'){ + // 左侧显示 + textAlign = 'right'; + textX = lineLength === 'auto' + ? (location.x - 10) + : (location.centerX - Math.max(topWidth, bottomWidth) / 2 - lineLength); + } + else { + // 右侧显示,默认 labelControl.position === 'outer' || 'right) + textAlign = 'left'; + textX = lineLength === 'auto' + ? (location.x + location.width + 10) + : (location.centerX + Math.max(topWidth, bottomWidth) / 2 + lineLength); + } + textShape.highlightStyle = { + x: textX, + color: textStyle.color || textColor, + text: text, + textAlign: textStyle.align || textAlign, + textFont: textFont, + brushType: 'fill' + }; + + return new TextShape(textShape); + }, + + /** + * 根据lable.format计算label text + */ + getLabelText: function (seriesIndex, dataIndex, status) { + var series = this.series; + var serie = series[seriesIndex]; + var data = serie.data[dataIndex]; + var formatter = this.deepQuery( + [data, serie], + 'itemStyle.' + status + '.label.formatter' + ); + + if (formatter) { + if (typeof formatter === 'function') { + return formatter.call( + this.myChart, + serie.name, + data.name, + data.value + ); + } + else if (typeof formatter === 'string') { + formatter = formatter.replace('{a}','{a0}') + .replace('{b}','{b0}') + .replace('{c}','{c0}'); + formatter = formatter.replace('{a0}', serie.name) + .replace('{b0}', data.name) + .replace('{c0}', data.value); + + return formatter; + } + } + else { + return data.name; + } + }, + + /** + * 需要显示则会有返回构建好的shape,否则返回undefined + */ + getLabelLine: function ( + seriesIndex, dataIndex, defaultColor, + x, y, topWidth, bottomWidth, height + ) { + var serie = this.series[seriesIndex]; + var data = serie.data[dataIndex]; + var location = this._paramsMap[seriesIndex].location; + + // serie里有默认配置,放心大胆的用! + var itemStyle = zrUtil.merge( + zrUtil.clone(data.itemStyle) || {}, + serie.itemStyle + ); + var status = 'normal'; + // labelLine配置 + var labelLineControl = itemStyle[status].labelLine; + var lineLength = itemStyle[status].labelLine.length; + var lineStyle = labelLineControl.lineStyle || {}; + + var labelControl = itemStyle[status].label; + labelControl.position = labelControl.position + || itemStyle.normal.label.position; + var xEnd; + if (labelControl.position === 'inner' || labelControl.position === 'inside') { + // 内部 + xEnd = x + topWidth / 2; + } + else if (labelControl.position === 'left'){ + // 左侧显示 + xEnd = lineLength === 'auto' + ? (location.x - 10) + : (location.centerX - Math.max(topWidth, bottomWidth) / 2 - lineLength); + } + else { + // 右侧显示,默认 labelControl.position === 'outer' || 'right) + xEnd = lineLength === 'auto' + ? (location.x + location.width + 10) + : (location.centerX + Math.max(topWidth, bottomWidth) / 2 + lineLength); + } + var lineShape = { + zlevel: this._zlevelBase + 1, + hoverable: false, + style: { + xStart: location.centerX, + yStart: y + height / 2, + xEnd: xEnd, + yEnd: y + height / 2, + strokeColor: lineStyle.color || defaultColor, + lineType: lineStyle.type, + lineWidth: lineStyle.width + } + }; + + status = 'emphasis'; + // labelLine配置 + labelLineControl = itemStyle[status].labelLine || labelLineControl; + lineLength = itemStyle[status].labelLine.length || lineLength; + lineStyle = labelLineControl.lineStyle || lineStyle; + + labelControl = itemStyle[status].label || labelControl; + labelControl.position = labelControl.position; + if (labelControl.position === 'inner' || labelControl.position === 'inside') { + // 内部 + xEnd = x + topWidth / 2; + } + else if (labelControl.position === 'left'){ + // 左侧显示 + xEnd = lineLength === 'auto' + ? (location.x - 10) + : (location.centerX - Math.max(topWidth, bottomWidth) / 2 - lineLength); + } + else { + // 右侧显示,默认 labelControl.position === 'outer' || 'right) + xEnd = lineLength === 'auto' + ? (location.x + location.width + 10) + : (location.centerX + Math.max(topWidth, bottomWidth) / 2 + lineLength); + } + lineShape.highlightStyle = { + xEnd: xEnd, + strokeColor: lineStyle.color || defaultColor, + lineType: lineStyle.type, + lineWidth: lineStyle.width + }; + + return new LineShape(lineShape); + }, + + /** + * 返回特定状态(normal or emphasis)下是否需要显示label标签文本 + * @param {Object} serie + * @param {Object} data + * @param {boolean} isEmphasis true is 'emphasis' and false is 'normal' + */ + _needLabel: function (serie, data, isEmphasis) { + return this.deepQuery( + [data, serie], + 'itemStyle.' + + (isEmphasis ? 'emphasis' : 'normal') + + '.label.show' + ); + }, + + /** + * 返回特定状态(normal or emphasis)下是否需要显示labelLine标签视觉引导线 + * @param {Object} serie + * @param {Object} data + * @param {boolean} isEmphasis true is 'emphasis' and false is 'normal' + */ + _needLabelLine: function (serie, data, isEmphasis) { + return this.deepQuery( + [data, serie], + 'itemStyle.' + + (isEmphasis ? 'emphasis' : 'normal') + +'.labelLine.show' + ); + }, + + /** + * 刷新 + */ + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + + this.backupShapeList(); + this._buildShape(); + } + }; + + zrUtil.inherits(Funnel, ChartBase); + zrUtil.inherits(Funnel, ComponentBase); + + // 图表注册 + require('../chart').define('funnel', Funnel); + + return Funnel; +}); +/** + * echarts组件: 类目轴 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/component/categoryAxis',['require','./base','zrender/shape/Text','zrender/shape/Line','zrender/shape/Rectangle','../config','zrender/tool/util','zrender/tool/area','../component'],function (require) { + var Base = require('./base'); + + // 图形依赖 + var TextShape = require('zrender/shape/Text'); + var LineShape = require('zrender/shape/Line'); + var RectangleShape = require('zrender/shape/Rectangle'); + + var ecConfig = require('../config'); + var zrUtil = require('zrender/tool/util'); + var zrArea = require('zrender/tool/area'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} option 类目轴参数 + * @param {Grid} component 组件 + */ + function CategoryAxis(ecTheme, messageCenter, zr, option, myChart, axisBase) { + if (option.data.length < 1) { + console.error('option.data.length < 1.'); + return; + } + + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + + this.grid = this.component.grid; + + for (var method in axisBase) { + this[method] = axisBase[method]; + } + + this.refresh(option); + } + + CategoryAxis.prototype = { + type : ecConfig.COMPONENT_TYPE_AXIS_CATEGORY, + _getReformedLabel : function (idx) { + var data = typeof this.option.data[idx].value != 'undefined' + ? this.option.data[idx].value + : this.option.data[idx]; + var formatter = this.option.data[idx].formatter + || this.option.axisLabel.formatter; + if (formatter) { + if (typeof formatter == 'function') { + data = formatter.call(this.myChart, data); + } + else if (typeof formatter == 'string') { + data = formatter.replace('{value}', data); + } + } + return data; + }, + + /** + * 计算标签显示挑选间隔 + */ + _getInterval : function () { + var interval = this.option.axisLabel.interval; + if (interval == 'auto') { + // 麻烦的自适应计算 + var fontSize = this.option.axisLabel.textStyle.fontSize; + var data = this.option.data; + var dataLength = this.option.data.length; + + if (this.isHorizontal()) { + // 横向 + if (dataLength > 3) { + var gap = this.getGap(); + var isEnough = false; + var labelSpace; + var labelSize; + var step = Math.floor(0.5 / gap); + step = step < 1 ? 1 : step; + interval = Math.floor(15 / gap); + while (!isEnough && interval < dataLength) { + interval += step; + isEnough = true; + labelSpace = Math.floor(gap * interval); // 标签左右至少间隔为3px + for (var i = Math.floor((dataLength - 1)/ interval) * interval; + i >= 0; i -= interval + ) { + if (this.option.axisLabel.rotate !== 0) { + // 有旋转 + labelSize = fontSize; + } + else if (data[i].textStyle) { + labelSize = zrArea.getTextWidth( + this._getReformedLabel(i), + this.getFont( + zrUtil.merge( + data[i].textStyle, + this.option.axisLabel.textStyle + ) + ) + ); + } + else { + /* + labelSize = zrArea.getTextWidth( + this._getReformedLabel(i), + font + ); + */ + // 不定义data级特殊文本样式,用fontSize优化getTextWidth + var label = this._getReformedLabel(i) + ''; + var wLen = (label.match(/\w/g) || '').length; + var oLen = label.length - wLen; + labelSize = wLen * fontSize * 2 / 3 + oLen * fontSize; + } + + if (labelSpace < labelSize) { + // 放不下,中断循环让interval++ + isEnough = false; + break; + } + } + } + } + else { + // 少于3个则全部显示 + interval = 1; + } + } + else { + // 纵向 + if (dataLength > 3) { + var gap = this.getGap(); + interval = Math.floor(11 / gap); + // 标签上下至少间隔为3px + while ((gap * interval - 6) < fontSize + && interval < dataLength + ) { + interval++; + } + } + else { + // 少于3个则全部显示 + interval = 1; + } + } + } + else { + // 用户自定义间隔 + interval = interval - 0 + 1; + } + + return interval; + }, + + /** + * 绘制图形 + */ + _buildShape : function () { + // 标签显示的挑选间隔 + this._interval = this._getInterval(); + + this.option.splitArea.show && this._buildSplitArea(); + this.option.splitLine.show && this._buildSplitLine(); + this.option.axisLine.show && this._buildAxisLine(); + this.option.axisTick.show && this._buildAxisTick(); + this.option.axisLabel.show && this._buildAxisLabel(); + + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + }, + + // 小标记 + _buildAxisTick : function () { + var axShape; + //var data = this.option.data; + var dataLength = this.option.data.length; + var tickOption = this.option.axisTick; + var length = tickOption.length; + var color = tickOption.lineStyle.color; + var lineWidth = tickOption.lineStyle.width; + var interval = tickOption.interval == 'auto' + ? this._interval : (tickOption.interval - 0 + 1); + var onGap = tickOption.onGap; + var optGap = onGap + ? (this.getGap() / 2) + : typeof onGap == 'undefined' + ? (this.option.boundaryGap ? (this.getGap() / 2) : 0) + : 0; + var startIndex = optGap > 0 ? -interval : 0; + if (this.isHorizontal()) { + // 横向 + var yPosition = this.option.position == 'bottom' + ? (tickOption.inside + ? (this.grid.getYend() - length - 1) : (this.grid.getYend() + 1)) + : (tickOption.inside + ? (this.grid.getY() + 1) : (this.grid.getY() - length - 1)); + var x; + for (var i = startIndex; i < dataLength; i += interval) { + // 亚像素优化 + x = this.subPixelOptimize( + this.getCoordByIndex(i) + (i >= 0 ? optGap : 0), lineWidth + ); + axShape = { + _axisShape : 'axisTick', + zlevel : this._zlevelBase, + hoverable : false, + style : { + xStart : x, + yStart : yPosition, + xEnd : x, + yEnd : yPosition + length, + strokeColor : color, + lineWidth : lineWidth + } + }; + this.shapeList.push(new LineShape(axShape)); + } + } + else { + // 纵向 + var xPosition = this.option.position == 'left' + ? (tickOption.inside + ? (this.grid.getX() + 1) : (this.grid.getX() - length - 1)) + : (tickOption.inside + ? (this.grid.getXend() - length - 1) : (this.grid.getXend() + 1)); + + var y; + for (var i = startIndex; i < dataLength; i += interval) { + // 亚像素优化 + y = this.subPixelOptimize( + this.getCoordByIndex(i) - (i >= 0 ? optGap : 0), lineWidth + ); + axShape = { + _axisShape : 'axisTick', + zlevel : this._zlevelBase, + hoverable : false, + style : { + xStart : xPosition, + yStart : y, + xEnd : xPosition + length, + yEnd : y, + strokeColor : color, + lineWidth : lineWidth + } + }; + this.shapeList.push(new LineShape(axShape)); + } + } + }, + + // 坐标轴文本 + _buildAxisLabel : function () { + var axShape; + var data = this.option.data; + var dataLength = this.option.data.length; + var rotate = this.option.axisLabel.rotate; + var margin = this.option.axisLabel.margin; + var clickable = this.option.axisLabel.clickable; + var textStyle = this.option.axisLabel.textStyle; + var dataTextStyle; + + if (this.isHorizontal()) { + // 横向 + var yPosition; + var baseLine; + if (this.option.position == 'bottom') { + yPosition = this.grid.getYend() + margin; + baseLine = 'top'; + } + else { + yPosition = this.grid.getY() - margin; + baseLine = 'bottom'; + } + + for (var i = 0; i < dataLength; i += this._interval) { + if (this._getReformedLabel(i) === '') { + // 空文本优化 + continue; + } + dataTextStyle = zrUtil.merge( + data[i].textStyle || {}, + textStyle + ); + axShape = { + // shape : 'text', + zlevel : this._zlevelBase, + hoverable : false, + style : { + x : this.getCoordByIndex(i), + y : yPosition, + color : dataTextStyle.color, + text : this._getReformedLabel(i), + textFont : this.getFont(dataTextStyle), + textAlign : dataTextStyle.align || 'center', + textBaseline : dataTextStyle.baseline || baseLine + } + }; + if (rotate) { + axShape.style.textAlign = rotate > 0 + ? (this.option.position == 'bottom' + ? 'right' : 'left') + : (this.option.position == 'bottom' + ? 'left' : 'right'); + axShape.rotation = [ + rotate * Math.PI / 180, + axShape.style.x, + axShape.style.y + ]; + } + this.shapeList.push(new TextShape( + this._axisLabelClickable(clickable, axShape) + )); + } + } + else { + // 纵向 + var xPosition; + var align; + if (this.option.position == 'left') { + xPosition = this.grid.getX() - margin; + align = 'right'; + } + else { + xPosition = this.grid.getXend() + margin; + align = 'left'; + } + + for (var i = 0; i < dataLength; i += this._interval) { + if (this._getReformedLabel(i) === '') { + // 空文本优化 + continue; + } + dataTextStyle = zrUtil.merge( + data[i].textStyle || {}, + textStyle + ); + axShape = { + // shape : 'text', + zlevel : this._zlevelBase, + hoverable : false, + style : { + x : xPosition, + y : this.getCoordByIndex(i), + color : dataTextStyle.color, + text : this._getReformedLabel(i), + textFont : this.getFont(dataTextStyle), + textAlign : dataTextStyle.align || align, + textBaseline : dataTextStyle.baseline + || (i === 0 && this.option.name !== '') + ? 'bottom' + : (i == (dataLength - 1) + && this.option.name !== '') + ? 'top' + : 'middle' + } + }; + + if (rotate) { + axShape.rotation = [ + rotate * Math.PI / 180, + axShape.style.x, + axShape.style.y + ]; + } + this.shapeList.push(new TextShape( + this._axisLabelClickable(clickable, axShape) + )); + } + } + }, + + _buildSplitLine : function () { + var axShape; + //var data = this.option.data; + var dataLength = this.option.data.length; + var sLineOption = this.option.splitLine; + var lineType = sLineOption.lineStyle.type; + var lineWidth = sLineOption.lineStyle.width; + var color = sLineOption.lineStyle.color; + color = color instanceof Array ? color : [color]; + var colorLength = color.length; + + var onGap = sLineOption.onGap; + var optGap = onGap + ? (this.getGap() / 2) + : typeof onGap == 'undefined' + ? (this.option.boundaryGap ? (this.getGap() / 2) : 0) + : 0; + dataLength -= (onGap || (typeof onGap == 'undefined' && this.option.boundaryGap)) + ? 1 : 0; + if (this.isHorizontal()) { + // 横向 + var sy = this.grid.getY(); + var ey = this.grid.getYend(); + var x; + + for (var i = 0; i < dataLength; i += this._interval) { + // 亚像素优化 + x = this.subPixelOptimize( + this.getCoordByIndex(i) + optGap, lineWidth + ); + axShape = { + // shape : 'line', + zlevel : this._zlevelBase, + hoverable : false, + style : { + xStart : x, + yStart : sy, + xEnd : x, + yEnd : ey, + strokeColor : color[(i / this._interval) % colorLength], + lineType : lineType, + lineWidth : lineWidth + } + }; + this.shapeList.push(new LineShape(axShape)); + } + + } + else { + // 纵向 + var sx = this.grid.getX(); + var ex = this.grid.getXend(); + var y; + + for (var i = 0; i < dataLength; i += this._interval) { + // 亚像素优化 + y = this.subPixelOptimize( + this.getCoordByIndex(i) - optGap, lineWidth + ); + axShape = { + // shape : 'line', + zlevel : this._zlevelBase, + hoverable : false, + style : { + xStart : sx, + yStart : y, + xEnd : ex, + yEnd : y, + strokeColor : color[(i / this._interval) % colorLength], + linetype : lineType, + lineWidth : lineWidth + } + }; + this.shapeList.push(new LineShape(axShape)); + } + } + }, + + _buildSplitArea : function () { + var axShape; + var sAreaOption = this.option.splitArea; + var color = sAreaOption.areaStyle.color; + if (!(color instanceof Array)) { + // 非数组一律认为是单一颜色的字符串,单一颜色则用一个背景,颜色错误不负责啊!!! + axShape = { + // shape : 'rectangle', + zlevel : this._zlevelBase, + hoverable : false, + style : { + x : this.grid.getX(), + y : this.grid.getY(), + width : this.grid.getWidth(), + height : this.grid.getHeight(), + color : color + // type : this.option.splitArea.areaStyle.type, + } + }; + this.shapeList.push(new RectangleShape(axShape)); + } + else { + // 多颜色 + var colorLength = color.length; + var dataLength = this.option.data.length; + + var onGap = sAreaOption.onGap; + var optGap = onGap + ? (this.getGap() / 2) + : typeof onGap == 'undefined' + ? (this.option.boundaryGap ? (this.getGap() / 2) : 0) + : 0; + if (this.isHorizontal()) { + // 横向 + var y = this.grid.getY(); + var height = this.grid.getHeight(); + var lastX = this.grid.getX(); + var curX; + + for (var i = 0; i <= dataLength; i += this._interval) { + curX = i < dataLength + ? (this.getCoordByIndex(i) + optGap) + : this.grid.getXend(); + axShape = { + // shape : 'rectangle', + zlevel : this._zlevelBase, + hoverable : false, + style : { + x : lastX, + y : y, + width : curX - lastX, + height : height, + color : color[(i / this._interval) % colorLength] + // type : this.option.splitArea.areaStyle.type, + } + }; + this.shapeList.push(new RectangleShape(axShape)); + lastX = curX; + } + } + else { + // 纵向 + var x = this.grid.getX(); + var width = this.grid.getWidth(); + var lastYend = this.grid.getYend(); + var curY; + + for (var i = 0; i <= dataLength; i += this._interval) { + curY = i < dataLength + ? (this.getCoordByIndex(i) - optGap) + : this.grid.getY(); + axShape = { + // shape : 'rectangle', + zlevel : this._zlevelBase, + hoverable : false, + style : { + x : x, + y : curY, + width : width, + height : lastYend - curY, + color : color[(i / this._interval) % colorLength] + // type : this.option.splitArea.areaStyle.type + } + }; + this.shapeList.push(new RectangleShape(axShape)); + lastYend = curY; + } + } + } + }, + + /** + * 刷新 + */ + refresh : function (newOption) { + if (newOption) { + this.option = this.reformOption(newOption); + // 通用字体设置 + this.option.axisLabel.textStyle = zrUtil.merge( + this.option.axisLabel.textStyle || {}, + this.ecTheme.textStyle + ); + } + this.clear(); + this._buildShape(); + }, + + /** + * 返回间隔 + */ + getGap : function () { + var dataLength = this.option.data.length; + var total = this.isHorizontal() + ? this.grid.getWidth() + : this.grid.getHeight(); + if (this.option.boundaryGap) { // 留空 + return total / dataLength; + } + else { // 顶头 + return total / (dataLength > 1 ? (dataLength - 1) : 1); + } + }, + + // 根据值换算位置 + getCoord : function (value) { + var data = this.option.data; + var dataLength = data.length; + var gap = this.getGap(); + var position = this.option.boundaryGap ? (gap / 2) : 0; + + for (var i = 0; i < dataLength; i++) { + if (data[i] == value + || (typeof data[i].value != 'undefined' + && data[i].value == value) + ) { + if (this.isHorizontal()) { + // 横向 + position = this.grid.getX() + position; + } + else { + // 纵向 + position = this.grid.getYend() - position; + } + + return position; + // Math.floor可能引起一些偏差,但性能会更好 + /* 准确更重要 + return (i === 0 || i == dataLength - 1) + ? position + : Math.floor(position); + */ + } + position += gap; + } + }, + + // 根据类目轴数据索引换算位置 + getCoordByIndex : function (dataIndex) { + if (dataIndex < 0) { + if (this.isHorizontal()) { + return this.grid.getX(); + } + else { + return this.grid.getYend(); + } + } + else if (dataIndex > this.option.data.length - 1) { + if (this.isHorizontal()) { + return this.grid.getXend(); + } + else { + return this.grid.getY(); + } + } + else { + var gap = this.getGap(); + var position = this.option.boundaryGap ? (gap / 2) : 0; + position += dataIndex * gap; + + if (this.isHorizontal()) { + // 横向 + position = this.grid.getX() + position; + } + else { + // 纵向 + position = this.grid.getYend() - position; + } + + return position; + /* 准确更重要 + return (dataIndex === 0 || dataIndex == this.option.data.length - 1) + ? position + : Math.floor(position); + */ + } + }, + + // 根据类目轴数据索引换算类目轴名称 + getNameByIndex : function (dataIndex) { + var data = this.option.data[dataIndex]; + if (typeof data != 'undefined' && typeof data.value != 'undefined') + { + return data.value; + } + else { + return data; + } + }, + + // 根据类目轴名称换算类目轴数据索引 + getIndexByName : function (name) { + var data = this.option.data; + var dataLength = data.length; + + for (var i = 0; i < dataLength; i++) { + if (data[i] == name + || (typeof data[i].value != 'undefined' + && data[i].value == name) + ) { + return i; + } + } + + return -1; + }, + + // 根据位置换算值 + getValueFromCoord : function() { + return ''; + }, + + /** + * 根据类目轴数据索引返回是否为主轴线 + * @param {number} dataIndex 类目轴数据索引 + * @return {boolean} 是否为主轴 + */ + isMainAxis : function (dataIndex) { + return dataIndex % this._interval === 0; + } + }; + + zrUtil.inherits(CategoryAxis, Base); + + require('../component').define('categoryAxis', CategoryAxis); + + return CategoryAxis; +}); +/** + * echarts组件: 数值轴 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','zrender/shape/Line','zrender/shape/Rectangle','../config','zrender/tool/util','../component'],function (require) { + var Base = require('./base'); + + // 图形依赖 + var TextShape = require('zrender/shape/Text'); + var LineShape = require('zrender/shape/Line'); + var RectangleShape = require('zrender/shape/Rectangle'); + + var ecConfig = require('../config'); + var zrUtil = require('zrender/tool/util'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} option 类目轴参数 + * @param {Object} component 组件 + * @param {Array} series 数据对象 + */ + function ValueAxis(ecTheme, messageCenter, zr, option, myChart, axisBase, series) { + if (!series || series.length === 0) { + console.err('option.series.length == 0.'); + return; + } + + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + + this.series = series; + this.grid = this.component.grid; + + for (var method in axisBase) { + this[method] = axisBase[method]; + } + + this.refresh(option, series); + } + + ValueAxis.prototype = { + type: ecConfig.COMPONENT_TYPE_AXIS_VALUE, + _buildShape: function () { + this._hasData = false; + this._calculateValue(); + if (!this._hasData) { + return; + } + this.option.splitArea.show && this._buildSplitArea(); + this.option.splitLine.show && this._buildSplitLine(); + this.option.axisLine.show && this._buildAxisLine(); + this.option.axisTick.show && this._buildAxisTick(); + this.option.axisLabel.show && this._buildAxisLabel(); + + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + }, + + // 小标记 + _buildAxisTick: function () { + var axShape; + var data = this._valueList; + var dataLength = this._valueList.length; + var tickOption = this.option.axisTick; + var length = tickOption.length; + var color = tickOption.lineStyle.color; + var lineWidth = tickOption.lineStyle.width; + + if (this.isHorizontal()) { + // 横向 + var yPosition = this.option.position === 'bottom' + ? (tickOption.inside + ? (this.grid.getYend() - length - 1) : (this.grid.getYend()) + 1) + : (tickOption.inside + ? (this.grid.getY() + 1) : (this.grid.getY() - length - 1)); + var x; + for (var i = 0; i < dataLength; i++) { + // 亚像素优化 + x = this.subPixelOptimize(this.getCoord(data[i]), lineWidth); + axShape = { + _axisShape: 'axisTick', + zlevel: this._zlevelBase, + hoverable: false, + style: { + xStart: x, + yStart: yPosition, + xEnd: x, + yEnd: yPosition + length, + strokeColor: color, + lineWidth: lineWidth + } + }; + this.shapeList.push(new LineShape(axShape)); + } + } + else { + // 纵向 + var xPosition = this.option.position === 'left' + ? (tickOption.inside + ? (this.grid.getX() + 1) : (this.grid.getX() - length - 1)) + : (tickOption.inside + ? (this.grid.getXend() - length - 1) : (this.grid.getXend() + 1)); + + var y; + for (var i = 0; i < dataLength; i++) { + // 亚像素优化 + y = this.subPixelOptimize(this.getCoord(data[i]), lineWidth); + axShape = { + _axisShape: 'axisTick', + zlevel: this._zlevelBase, + hoverable: false, + style: { + xStart: xPosition, + yStart: y, + xEnd: xPosition + length, + yEnd: y, + strokeColor: color, + lineWidth: lineWidth + } + }; + this.shapeList.push(new LineShape(axShape)); + } + } + }, + + // 坐标轴文本 + _buildAxisLabel: function () { + var axShape; + var data = this._valueList; + var dataLength = this._valueList.length; + var rotate = this.option.axisLabel.rotate; + var margin = this.option.axisLabel.margin; + var clickable = this.option.axisLabel.clickable; + var textStyle = this.option.axisLabel.textStyle; + + if (this.isHorizontal()) { + // 横向 + var yPosition; + var baseLine; + if (this.option.position === 'bottom') { + yPosition = this.grid.getYend() + margin; + baseLine = 'top'; + } + else { + yPosition = this.grid.getY() - margin; + baseLine = 'bottom'; + } + + for (var i = 0; i < dataLength; i++) { + axShape = { + zlevel: this._zlevelBase, + hoverable: false, + style: { + x: this.getCoord(data[i]), + y: yPosition, + color: typeof textStyle.color === 'function' + ? textStyle.color(data[i]) : textStyle.color, + text: this._valueLabel[i], + textFont: this.getFont(textStyle), + textAlign: textStyle.align || 'center', + textBaseline: textStyle.baseline || baseLine + } + }; + if (rotate) { + axShape.style.textAlign = rotate > 0 + ? (this.option.position === 'bottom' + ? 'right' : 'left') + : (this.option.position === 'bottom' + ? 'left' : 'right'); + axShape.rotation = [ + rotate * Math.PI / 180, + axShape.style.x, + axShape.style.y + ]; + } + this.shapeList.push(new TextShape( + this._axisLabelClickable(clickable, axShape) + )); + } + } + else { + // 纵向 + var xPosition; + var align; + if (this.option.position === 'left') { + xPosition = this.grid.getX() - margin; + align = 'right'; + } + else { + xPosition = this.grid.getXend() + margin; + align = 'left'; + } + + for (var i = 0; i < dataLength; i++) { + axShape = { + zlevel: this._zlevelBase, + hoverable: false, + style: { + x: xPosition, + y: this.getCoord(data[i]), + color: typeof textStyle.color === 'function' + ? textStyle.color(data[i]) : textStyle.color, + text: this._valueLabel[i], + textFont: this.getFont(textStyle), + textAlign: textStyle.align || align, + textBaseline: textStyle.baseline + || (i === 0 && this.option.name !== '') + ? 'bottom' + : (i === (dataLength - 1) + && this.option.name !== '') + ? 'top' + : 'middle' + } + }; + + if (rotate) { + axShape.rotation = [ + rotate * Math.PI / 180, + axShape.style.x, + axShape.style.y + ]; + } + this.shapeList.push(new TextShape( + this._axisLabelClickable(clickable, axShape) + )); + } + } + }, + + _buildSplitLine: function () { + var axShape; + var data = this._valueList; + var dataLength = this._valueList.length; + var sLineOption = this.option.splitLine; + var lineType = sLineOption.lineStyle.type; + var lineWidth = sLineOption.lineStyle.width; + var color = sLineOption.lineStyle.color; + color = color instanceof Array ? color : [color]; + var colorLength = color.length; + + if (this.isHorizontal()) { + // 横向 + var sy = this.grid.getY(); + var ey = this.grid.getYend(); + var x; + + for (var i = 0; i < dataLength; i++) { + // 亚像素优化 + x = this.subPixelOptimize(this.getCoord(data[i]), lineWidth); + axShape = { + zlevel: this._zlevelBase, + hoverable: false, + style: { + xStart: x, + yStart: sy, + xEnd: x, + yEnd: ey, + strokeColor: color[i % colorLength], + lineType: lineType, + lineWidth: lineWidth + } + }; + this.shapeList.push(new LineShape(axShape)); + } + + } + else { + // 纵向 + var sx = this.grid.getX(); + var ex = this.grid.getXend(); + var y; + + for (var i = 0; i < dataLength; i++) { + // 亚像素优化 + y = this.subPixelOptimize(this.getCoord(data[i]), lineWidth); + axShape = { + zlevel: this._zlevelBase, + hoverable: false, + style: { + xStart: sx, + yStart: y, + xEnd: ex, + yEnd: y, + strokeColor: color[i % colorLength], + lineType: lineType, + lineWidth: lineWidth + } + }; + this.shapeList.push(new LineShape(axShape)); + } + } + }, + + _buildSplitArea: function () { + var axShape; + var color = this.option.splitArea.areaStyle.color; + + if (!(color instanceof Array)) { + // 非数组一律认为是单一颜色的字符串,单一颜色则用一个背景,颜色错误不负责啊!!! + axShape = { + zlevel: this._zlevelBase, + hoverable: false, + style: { + x: this.grid.getX(), + y: this.grid.getY(), + width: this.grid.getWidth(), + height: this.grid.getHeight(), + color: color + // type: this.option.splitArea.areaStyle.type, + } + }; + this.shapeList.push(new RectangleShape(axShape)); + } + else { + // 多颜色 + var colorLength = color.length; + var data = this._valueList; + var dataLength = this._valueList.length; + + if (this.isHorizontal()) { + // 横向 + var y = this.grid.getY(); + var height = this.grid.getHeight(); + var lastX = this.grid.getX(); + var curX; + + for (var i = 0; i <= dataLength; i++) { + curX = i < dataLength + ? this.getCoord(data[i]) + : this.grid.getXend(); + axShape = { + zlevel: this._zlevelBase, + hoverable: false, + style: { + x: lastX, + y: y, + width: curX - lastX, + height: height, + color: color[i % colorLength] + // type: this.option.splitArea.areaStyle.type, + } + }; + this.shapeList.push(new RectangleShape(axShape)); + lastX = curX; + } + } + else { + // 纵向 + var x = this.grid.getX(); + var width = this.grid.getWidth(); + var lastYend = this.grid.getYend(); + var curY; + + for (var i = 0; i <= dataLength; i++) { + curY = i < dataLength + ? this.getCoord(data[i]) + : this.grid.getY(); + axShape = { + zlevel: this._zlevelBase, + hoverable: false, + style: { + x: x, + y: curY, + width: width, + height: lastYend - curY, + color: color[i % colorLength] + // type: this.option.splitArea.areaStyle.type + } + }; + this.shapeList.push(new RectangleShape(axShape)); + lastYend = curY; + } + } + } + }, + + /** + * 极值计算 + */ + _calculateValue: function () { + if (isNaN(this.option.min - 0) || isNaN(this.option.max - 0)) { + // 有一个没指定都得算 + // 数据整形 + var oriData; // 原始数据 + var data = {}; // 整形后数据抽取 + var value; + var xIdx; + var yIdx; + var legend = this.component.legend; + for (var i = 0, l = this.series.length; i < l; i++) { + if (this.series[i].type != ecConfig.CHART_TYPE_LINE + && this.series[i].type != ecConfig.CHART_TYPE_BAR + && this.series[i].type != ecConfig.CHART_TYPE_SCATTER + && this.series[i].type != ecConfig.CHART_TYPE_K + ) { + // 非坐标轴支持的不算极值 + continue; + } + // 请允许我写开,跟上面一个不是一样东西 + if (legend && !legend.isSelected(this.series[i].name)){ + continue; + } + + // 不指定默认为第一轴线 + xIdx = this.series[i].xAxisIndex || 0; + yIdx = this.series[i].yAxisIndex || 0; + if ((this.option.xAxisIndex != xIdx) + && (this.option.yAxisIndex != yIdx) + ) { + // 不是自己的数据不计算极值 + continue; + } + + var key = this.series[i].name || 'kener'; + if (!this.series[i].stack) { + data[key] = data[key] || []; + oriData = this.series[i].data; + for (var j = 0, k = oriData.length; j < k; j++) { + value = oriData[j].value != null + ? oriData[j].value + : oriData[j]; + if (this.series[i].type === ecConfig.CHART_TYPE_SCATTER) { + if (this.option.xAxisIndex != -1) { + data[key].push(value[0]); + } + if (this.option.yAxisIndex != -1) { + data[key].push(value[1]); + } + } + else if (this.series[i].type === ecConfig.CHART_TYPE_K) { + data[key].push(value[0]); + data[key].push(value[1]); + data[key].push(value[2]); + data[key].push(value[3]); + } + else { + data[key].push(value); + } + } + } + else { + // 堆积数据,需要区分正负向堆积 + var keyP = '__Magic_Key_Positive__' + this.series[i].stack; + var keyN = '__Magic_Key_Negative__' + this.series[i].stack; + data[keyP] = data[keyP] || []; + data[keyN] = data[keyN] || []; + data[key] = data[key] || []; // scale下还需要记录每一个量 + oriData = this.series[i].data; + for (var j = 0, k = oriData.length; j < k; j++) { + value = oriData[j].value != null + ? oriData[j].value + : oriData[j]; + if (value === '-') { + continue; + } + value = value - 0; + if (value >= 0) { + if (data[keyP][j] != null) { + data[keyP][j] += value; + } + else { + data[keyP][j] = value; + } + } + else { + if (data[keyN][j] != null) { + data[keyN][j] += value; + } + else { + data[keyN][j] = value; + } + } + if (this.option.scale) { + data[key].push(value); + } + } + } + } + // 找极值 + for (var i in data){ + oriData = data[i]; + for (var j = 0, k = oriData.length; j < k; j++) { + if (!isNaN(oriData[j])){ + this._hasData = true; + this._min = oriData[j]; + this._max = oriData[j]; + break; + } + } + if (this._hasData) { + break; + } + } + for (var i in data){ + oriData = data[i]; + for (var j = 0, k = oriData.length; j < k; j++) { + if (!isNaN(oriData[j])){ + this._min = Math.min(this._min, oriData[j]); + this._max = Math.max(this._max, oriData[j]); + } + } + } + + //console.log(this._min,this._max,'vvvvv111111') + var gap = Math.abs(this._max - this._min); + this._min = isNaN(this.option.min - 0) + ? (this._min - Math.abs(gap * this.option.boundaryGap[0])) + : (this.option.min - 0); // 指定min忽略boundaryGay[0] + + this._max = isNaN(this.option.max - 0) + ? (this._max + Math.abs(gap * this.option.boundaryGap[1])) + : (this.option.max - 0); // 指定max忽略boundaryGay[1] + if (this._min === this._max) { + if (this._max === 0) { + // 修复全0数据 + this._max = this.option.power > 0 ? this.option.power : 1; + } + // 修复最大值==最小值时数据整形 + else if (this._max > 0) { + this._min = this._max / this.option.splitNumber; + } + else { // this._max < 0 + this._max = this._max / this.option.splitNumber; + } + } + this._reformValue(this.option.scale); + } + else { + this._hasData = true; + // 用户指定min max就不多管闲事了 + this._min = this.option.min - 0; // 指定min忽略boundaryGay[0] + this._max = this.option.max - 0; // 指定max忽略boundaryGay[1] + this._customerValue(); + } + }, + + /** + * 找到原始数据的极值后根据选项整形最终 this._min / this._max / this._valueList + * 如果你不知道这个“整形”的用义,请不要试图去理解和修改这个方法!找我也没用,我相信我已经记不起来! + * 如果你有更简洁的数学推导欢迎重写,后果自负~ + * 一旦你不得不遇到了需要修改或重写的厄运,希望下面的脚手架能帮助你 + * ps:其实我是想说别搞砸了!升级后至少得保证这些case通过!! + * + * by linzhifeng@baidu.com 2013-1-8 + * -------- + this._valueList = []; + this.option = {splitNumber:5,power:100,precision:0}; + this._min = 1; this._max = 123; console.log(this._min, this._max); this._reformValue(); + console.log('result is :', this._min, this._max, this._valueList); + console.log('should be : 0 150 [0, 30, 60, 90, 120, 150]', + (this._min == 0 && this._max == 150) ? 'success' : 'failed'); + + this._min = 10; this._max = 1923; console.log(this._min, this._max); this._reformValue(); + console.log('result is :', this._min, this._max, this._valueList); + console.log('should be : 0 2000 [0, 400, 800, 1200, 1600, 2000]', + (this._min == 0 && this._max == 2000) ? 'success' : 'failed'); + + this._min = 10; this._max = 78; console.log(this._min, this._max); this._reformValue(); + console.log('result is :', this._min, this._max, this._valueList); + console.log('should be : 0 100 [0, 20, 40, 60, 80, 100]', + (this._min == 0 && this._max == 100) ? 'success' : 'failed'); + + this._min = -31; this._max = -3; console.log(this._min, this._max); this._reformValue(); + console.log('result is :', this._min, this._max, this._valueList); + console.log('should be : -35 0 [-35, -28, -21, -14, -7, 0]', + (this._min == -35 && this._max == 0) ? 'success' : 'failed'); + + this._min = -51; this._max = 203; console.log(this._min, this._max); this._reformValue(); + console.log('result is :', this._min, this._max, this._valueList); + console.log('should be : -60 240 [-60, 0, 60, 120, 180, 240]', + (this._min == -60 && this._max == 240) ? 'success' : 'failed'); + + this._min = -251; this._max = 23; console.log(this._min, this._max); this._reformValue(); + console.log('result is :', this._min, this._max, this._valueList); + console.log('should be : -280 70 [-280, -210, -140, -70, 0, 70]', + (this._min == -280 && this._max == 70) ? 'success' : 'failed'); + + this.option.precision = 2; + this._min = 0.23; this._max = 0.78; console.log(this._min, this._max); this._reformValue(); + console.log('result is :', this._min, this._max, this._valueList); + console.log('should be : 0.00 1.00' + + '["0.00", "0.20", "0.40", "0.60", "0.80", "1.00"]', + (this._min == 0.00 && this._max == 1.00) ? 'success' : 'failed'); + + this._min = -12.23; this._max = -0.78; console.log(this._min, this._max); + this._reformValue(); + console.log('result is :', this._min, this._max, this._valueList); + console.log('should be : -15.00 0.00' + + '["-15.00", "-12.00", "-9.00", "-6.00", "-3.00", "0.00"]', + (this._min == -15.00 && this._max == 0.00) ? 'success' : 'failed'); + + this._min = -0.23; this._max = 0.78; console.log(this._min, this._max); this._reformValue() + console.log('result is :', this._min, this._max, this._valueList); + console.log('should be : -0.30 1.20' + + '["-0.30", "0.00", "0.30", "0.60", "0.90", "1.20"]', + (this._min == -0.30 && this._max == 1.20) ? 'success' : 'failed'); + + this._min = -1.23; this._max = 0.78; console.log(this._min, this._max); _reformValue(); + console.log('result is :', this._min, this._max, this._valueList); + console.log('should be : -1.50 1.00' + + '["-1.50", "-1.00", "-0.50", "0.00", "0.50", "1.00"]', + (this._min == -1.50 && this._max == 1.00) ? 'success' : 'failed'); + + this.option.precision = 1; + this._min = -2.3; this._max = 0.5; console.log(this._min, this._max); _reformValue(); + console.log('result is :', this._min, this._max, this._valueList); + console.log('should be : -2.4 0.6' + + '["-2.4", "-1.8", "-1.2", "-0.6", "0.0", "0.6"]', + (this._min == -2.4 && this._max == 0.6) ? 'success' : 'failed'); + * -------- + */ + _reformValue: function (scale) { + var splitNumber = this.option.splitNumber; + var precision = this.option.precision; + var splitGap; + var power; + if (precision === 0) { // 整数 + power = this.option.power > 1 ? this.option.power : 1; + } + else { // 小数 + // 放大倍数后复用整数逻辑,最后再缩小回去 + power = Math.pow(10, precision); + this._min *= power; + this._max *= power; + power = this.option.power; + } + // console.log(this._min,this._max) + var total; + if (this._min >= 0 && this._max >= 0) { + // 双正 + if (!scale) { + // power自动降级 + while ((this._max / power < splitNumber) && power != 1) { + power = power / 10; + } + this._min = 0; + } + else { + // power自动降级 + while (this._min < power && power != 1) { + power = power / 10; + } + if (precision === 0) { // 整数 + // 满足power + this._min = Math.floor(this._min / power) * power; + this._max = Math.ceil(this._max / power) * power; + } + } + power = power > 1 ? power / 10 : 1; + total = this._max - this._min; + splitGap = Math.ceil((total / splitNumber) / power) * power; + this._max = this._min + splitGap * splitNumber; + } + else if (this._min <= 0 && this._max <= 0) { + // 双负 + power = -power; + if (!scale) { + // power自动降级 + while ((this._min / power < splitNumber) && power != -1) { + power = power / 10; + } + this._max = 0; + } + else { + // power自动降级 + while (this._max > power && power != -1) { + power = power / 10; + } + if (precision === 0) { // 整数 + // 满足power + this._min = Math.ceil(this._min / power) * power; + this._max = Math.floor(this._max / power) * power; + } + } + power = power < -1 ? power / 10 : -1; + total = this._min - this._max; + splitGap = -Math.ceil((total / splitNumber) / power) * power; + this._min = -splitGap * splitNumber + this._max; + } + else { + // 一正一负,确保0被选中 + total = this._max - this._min; + // power自动降级 + while ((total / power < splitNumber) && power != 1) { + power = power/10; + } + // 正数部分的分隔数 + var partSplitNumber = Math.round(this._max / total * splitNumber); + // 修正数据范围极度偏正向,留给负数一个 + partSplitNumber -= (partSplitNumber === splitNumber ? 1 : 0); + // 修正数据范围极度偏负向,留给正数一个 + partSplitNumber += partSplitNumber === 0 ? 1 : 0; + splitGap = (Math.ceil(Math.max( + this._max / partSplitNumber, + this._min / (partSplitNumber - splitNumber) + ) + / power)) + * power; + + this._max = splitGap * partSplitNumber; + this._min = splitGap * (partSplitNumber - splitNumber); + } + //console.log(this._min,this._max,'vvvvvrrrrrr') + this._valueList = []; + for (var i = 0; i <= splitNumber; i++) { + this._valueList.push(this._min + splitGap * i); + } + + if (precision !== 0) { // 小数 + // 放大倍数后复用整数逻辑,最后再缩小回去 + power = Math.pow(10, precision); + this._min = (this._min / power).toFixed(precision) - 0; + this._max = (this._max / power).toFixed(precision) - 0; + for (var i = 0; i <= splitNumber; i++) { + this._valueList[i] = + (this._valueList[i] / power).toFixed(precision) - 0; + } + } + this._reformLabelData(); + }, + + _customerValue: function () { + var splitNumber = this.option.splitNumber; + var precision = this.option.precision; + var splitGap = (this._max - this._min) / splitNumber; + + this._valueList = []; + for (var i = 0; i <= splitNumber; i++) { + this._valueList.push((this._min + splitGap * i).toFixed(precision) - 0); + } + this._reformLabelData(); + }, + + _reformLabelData: function () { + this._valueLabel = []; + var formatter = this.option.axisLabel.formatter; + if (formatter) { + for (var i = 0, l = this._valueList.length; i < l; i++) { + if (typeof formatter === 'function') { + this._valueLabel.push(formatter.call(this.myChart, this._valueList[i])); + } + else if (typeof formatter === 'string') { + this._valueLabel.push( + formatter.replace('{value}',this._valueList[i]) + ); + } + } + } + else { + // 每三位默认加,格式化 + for (var i = 0, l = this._valueList.length; i < l; i++) { + this._valueLabel.push(this.numAddCommas(this._valueList[i])); + } + } + + }, + + getExtremum: function () { + this._calculateValue(); + return { + min: this._min, + max: this._max + }; + }, + + /** + * 刷新 + */ + refresh: function (newOption, newSeries) { + if (newOption) { + this.option = this.reformOption(newOption); + // 通用字体设置 + this.option.axisLabel.textStyle = zrUtil.merge( + this.option.axisLabel.textStyle || {}, + this.ecTheme.textStyle + ); + this.series = newSeries; + } + if (this.zr) { // 数值轴的另外一个功能只是用来计算极值 + this.clear(); + this._buildShape(); + } + }, + + // 根据值换算位置 + getCoord: function (value) { + value = value < this._min ? this._min : value; + value = value > this._max ? this._max : value; + + var result; + if (!this.isHorizontal()) { + // 纵向 + result = this.grid.getYend() + - (value - this._min) + / (this._max - this._min) + * this.grid.getHeight(); + } + else { + // 横向 + result = this.grid.getX() + + (value - this._min) + / (this._max - this._min) + * this.grid.getWidth(); + } + + return result; + // Math.floor可能引起一些偏差,但性能会更好 + /* 准确更重要 + return (value === this._min || value === this._max) + ? result + : Math.floor(result); + */ + }, + + // 根据值换算绝对大小 + getCoordSize: function (value) { + if (!this.isHorizontal()) { + // 纵向 + return Math.abs(value / (this._max - this._min) * this.grid.getHeight()); + } + else { + // 横向 + return Math.abs(value / (this._max - this._min) * this.grid.getWidth()); + } + }, + + // 根据位置换算值 + getValueFromCoord: function(coord) { + var result; + if (!this.isHorizontal()) { + // 纵向 + coord = coord < this.grid.getY() ? this.grid.getY() : coord; + coord = coord > this.grid.getYend() ? this.grid.getYend() : coord; + result = this._max + - (coord - this.grid.getY()) + / this.grid.getHeight() + * (this._max - this._min); + } + else { + // 横向 + coord = coord < this.grid.getX() ? this.grid.getX() : coord; + coord = coord > this.grid.getXend() ? this.grid.getXend() : coord; + result = this._min + + (coord - this.grid.getX()) + / this.grid.getWidth() + * (this._max - this._min); + } + + return result.toFixed(2) - 0; + } + }; + + zrUtil.inherits(ValueAxis, Base); + + require('../component').define('valueAxis', ValueAxis); + + return ValueAxis; +}); + + +/** + * echarts组件类: 坐标轴 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + * 直角坐标系中坐标轴数组,数组中每一项代表一条横轴(纵轴)坐标轴。 + * 标准(1.0)中规定最多同时存在2条横轴和2条纵轴 + * 单条横轴时可指定安放于grid的底部(默认)或顶部,2条同时存在时则默认第一条安放于底部,第二天安放于顶部 + * 单条纵轴时可指定安放于grid的左侧(默认)或右侧,2条同时存在时则默认第一条安放于左侧,第二天安放于右侧。 + * 坐标轴有两种类型,类目型和数值型(区别详见axis): + * 横轴通常为类目型,但条形图时则横轴为数值型,散点图时则横纵均为数值型 + * 纵轴通常为数值型,但条形图时则纵轴为类目型。 + * + */ +define('echarts/component/axis',['require','./base','zrender/shape/Line','../config','../util/ecData','zrender/tool/util','zrender/tool/color','./categoryAxis','./valueAxis','../component'],function (require) { + var Base = require('./base'); + + var LineShape = require('zrender/shape/Line'); + + var ecConfig = require('../config'); + var ecData = require('../util/ecData'); + var zrUtil = require('zrender/tool/util'); + var zrColor = require('zrender/tool/color'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} option 图表选项 + * @param {string=} option.xAxis.type 坐标轴类型,横轴默认为类目型'category' + * @param {string=} option.yAxis.type 坐标轴类型,纵轴默认为类目型'value' + * @param {Object} component 组件 + * @param {string} axisType 横走or纵轴 + */ + function Axis(ecTheme, messageCenter, zr, option, myChart, axisType) { + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + + this.axisType = axisType; + this._axisList = []; + + this.refresh(option); + } + + Axis.prototype = { + type: ecConfig.COMPONENT_TYPE_AXIS, + axisBase: { + // 轴线 + _buildAxisLine: function () { + var lineWidth = this.option.axisLine.lineStyle.width; + var halfLineWidth = lineWidth / 2; + var axShape = { + _axisShape: 'axisLine', + zlevel: this._zlevelBase + 1, + hoverable: false + }; + switch (this.option.position) { + case 'left' : + axShape.style = { + xStart: this.grid.getX() - halfLineWidth, + yStart: this.grid.getYend(), + xEnd: this.grid.getX() - halfLineWidth, + yEnd: this.grid.getY(), + lineCap: 'round' + }; + break; + case 'right' : + axShape.style = { + xStart: this.grid.getXend() + halfLineWidth, + yStart: this.grid.getYend(), + xEnd: this.grid.getXend() + halfLineWidth, + yEnd: this.grid.getY(), + lineCap: 'round' + }; + break; + case 'bottom' : + axShape.style = { + xStart: this.grid.getX(), + yStart: this.grid.getYend() + halfLineWidth, + xEnd: this.grid.getXend(), + yEnd: this.grid.getYend() + halfLineWidth, + lineCap: 'round' + }; + break; + case 'top' : + axShape.style = { + xStart: this.grid.getX(), + yStart: this.grid.getY() - halfLineWidth, + xEnd: this.grid.getXend(), + yEnd: this.grid.getY() - halfLineWidth, + lineCap: 'round' + }; + break; + } + if (this.option.name !== '') { // 别帮我代码规范 + axShape.style.text = this.option.name; + axShape.style.textPosition = this.option.nameLocation; + axShape.style.textFont = this.getFont(this.option.nameTextStyle); + if (this.option.nameTextStyle.align) { + axShape.style.textAlign = this.option.nameTextStyle.align; + } + if (this.option.nameTextStyle.baseline) { + axShape.style.textBaseline = this.option.nameTextStyle.baseline; + } + if (this.option.nameTextStyle.color) { + axShape.style.textColor = this.option.nameTextStyle.color; + } + } + axShape.style.strokeColor = this.option.axisLine.lineStyle.color; + + axShape.style.lineWidth = lineWidth; + // 亚像素优化 + if (this.isHorizontal()) { + // 横向布局,优化y + axShape.style.yStart + = axShape.style.yEnd + = this.subPixelOptimize(axShape.style.yEnd, lineWidth); + } + else { + // 纵向布局,优化x + axShape.style.xStart + = axShape.style.xEnd + = this.subPixelOptimize(axShape.style.xEnd, lineWidth); + } + + axShape.style.lineType = this.option.axisLine.lineStyle.type; + + axShape = new LineShape(axShape); + this.shapeList.push(axShape); + }, + + _axisLabelClickable: function(clickable, axShape) { + if (clickable) { + ecData.pack( + axShape, undefined, -1, undefined, -1, axShape.style.text + ); + axShape.hoverable = true; + axShape.clickable = true; + axShape.highlightStyle = { + color: zrColor.lift(axShape.style.color, 1), + brushType: 'fill' + }; + return axShape; + } + else { + return axShape; + } + }, + + refixAxisShape: function(zeroX, zeroY) { + if (!this.option.axisLine.onZero) { + return; + } + var tickLength; + if (this.isHorizontal() && zeroY != null) { + // 横向布局调整纵向y + for (var i = 0, l = this.shapeList.length; i < l; i++) { + if (this.shapeList[i]._axisShape === 'axisLine') { + this.shapeList[i].style.yStart + = this.shapeList[i].style.yEnd + = this.subPixelOptimize( + zeroY, this.shapeList[i].stylelineWidth + ); + this.zr.modShape(this.shapeList[i].id); + } + else if (this.shapeList[i]._axisShape === 'axisTick') { + tickLength = this.shapeList[i].style.yEnd + - this.shapeList[i].style.yStart; + this.shapeList[i].style.yStart = zeroY - tickLength; + this.shapeList[i].style.yEnd = zeroY; + this.zr.modShape(this.shapeList[i].id); + } + } + } + if (!this.isHorizontal() && zeroX != null) { + // 纵向布局调整横向x + for (var i = 0, l = this.shapeList.length; i < l; i++) { + if (this.shapeList[i]._axisShape === 'axisLine') { + this.shapeList[i].style.xStart + = this.shapeList[i].style.xEnd + = this.subPixelOptimize( + zeroX, this.shapeList[i].stylelineWidth + ); + this.zr.modShape(this.shapeList[i].id); + } + else if (this.shapeList[i]._axisShape === 'axisTick') { + tickLength = this.shapeList[i].style.xEnd + - this.shapeList[i].style.xStart; + this.shapeList[i].style.xStart = zeroX; + this.shapeList[i].style.xEnd = zeroX + tickLength; + this.zr.modShape(this.shapeList[i].id); + } + } + } + }, + + getPosition: function () { + return this.option.position; + }, + + isHorizontal: function() { + return this.option.position === 'bottom' || this.option.position === 'top'; + } + }, + /** + * 参数修正&默认值赋值,重载基类方法 + * @param {Object} opt 参数 + */ + reformOption: function (opt) { + // 不写或传了个空数值默认为数值轴 + if (!opt || (opt instanceof Array && opt.length === 0)) { + opt = [ { type: ecConfig.COMPONENT_TYPE_AXIS_VALUE } ]; + } + else if (!(opt instanceof Array)){ + opt = [opt]; + } + + // 最多两条,其他参数忽略 + if (opt.length > 2) { + opt = [opt[0],opt[1]]; + } + + if (this.axisType === 'xAxis') { + // 横轴位置默认配置 + if (!opt[0].position // 没配置或配置错 + || (opt[0].position != 'bottom' + && opt[0].position != 'top') + ) { + opt[0].position = 'bottom'; + } + if (opt.length > 1) { + opt[1].position = opt[0].position === 'bottom' ? 'top' : 'bottom'; + } + + for (var i = 0, l = opt.length; i < l; i++) { + // 坐标轴类型,横轴默认为类目型'category' + opt[i].type = opt[i].type || 'category'; + // 标识轴类型&索引 + opt[i].xAxisIndex = i; + opt[i].yAxisIndex = -1; + } + } + else { + // 纵轴位置默认配置 + if (!opt[0].position // 没配置或配置错 + || (opt[0].position != 'left' + && opt[0].position != 'right') + ) { + opt[0].position = 'left'; + } + + if (opt.length > 1) { + opt[1].position = opt[0].position === 'left' ? 'right' : 'left'; + } + + for (var i = 0, l = opt.length; i < l; i++) { + // 坐标轴类型,纵轴默认为数值型'value' + opt[i].type = opt[i].type || 'value'; + // 标识轴类型&索引 + opt[i].xAxisIndex = -1; + opt[i].yAxisIndex = i; + } + } + + return opt; + }, + + /** + * 刷新 + */ + refresh: function (newOption) { + var axisOption; + if (newOption) { + this.option = newOption; + if (this.axisType === 'xAxis') { + this.option.xAxis = this.reformOption(newOption.xAxis); + axisOption = this.option.xAxis; + } + else { + this.option.yAxis = this.reformOption(newOption.yAxis); + axisOption = this.option.yAxis; + } + this.series = newOption.series; + } + + var CategoryAxis = require('./categoryAxis'); + var ValueAxis = require('./valueAxis'); + var len = Math.max((axisOption && axisOption.length || 0), this._axisList.length); + for (var i = 0; i < len; i++) { + if (this._axisList[i] // 已有实例 + && newOption // 非空刷新 + && (!axisOption[i] || this._axisList[i].type != axisOption[i].type) // 类型不匹配 + ) { + this._axisList[i].dispose && this._axisList[i].dispose(); + this._axisList[i] = false; + } + + if (this._axisList[i]) { + this._axisList[i].refresh && this._axisList[i].refresh( + axisOption ? axisOption[i] : false, + this.series + ); + } + else if (axisOption && axisOption[i]) { + this._axisList[i] = axisOption[i].type === 'category' + ? new CategoryAxis( + this.ecTheme, this.messageCenter, this.zr, + axisOption[i], this.myChart, this.axisBase + ) + : new ValueAxis( + this.ecTheme, this.messageCenter, this.zr, + axisOption[i], this.myChart, this.axisBase, + this.series + ); + + } + } + }, + + /** + * 根据值换算位置 + * @param {number} idx 坐标轴索引0~1 + */ + getAxis: function (idx) { + return this._axisList[idx]; + }, + + clear: function () { + for (var i = 0, l = this._axisList.length; i < l; i++) { + this._axisList[i].dispose && this._axisList[i].dispose(); + } + this._axisList = []; + } + }; + + zrUtil.inherits(Axis, Base); + + require('../component').define('axis', Axis); + + return Axis; +}); +/** + * echarts组件: 网格 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/component/grid',['require','./base','zrender/shape/Rectangle','../config','zrender/tool/util','../component'],function (require) { + var Base = require('./base'); + + // 图形依赖 + var RectangleShape = require('zrender/shape/Rectangle'); + + var ecConfig = require('../config'); + var zrUtil = require('zrender/tool/util'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} option 图表选项 + * @param {number=} option.grid.x 直角坐标系内绘图网格起始横坐标,数值单位px + * @param {number=} option.grid.y 直角坐标系内绘图网格起始纵坐标,数值单位px + * @param {number=} option.grid.width 直角坐标系内绘图网格宽度,数值单位px + * @param {number=} option.grid.height 直角坐标系内绘图网格高度,数值单位px + */ + function Grid(ecTheme, messageCenter, zr, option, myChart) { + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + + this.refresh(option); + } + + Grid.prototype = { + type: ecConfig.COMPONENT_TYPE_GRID, + + getX: function () { + return this._x; + }, + + getY: function () { + return this._y; + }, + + getWidth: function () { + return this._width; + }, + + getHeight: function () { + return this._height; + }, + + getXend: function () { + return this._x + this._width; + }, + + getYend: function () { + return this._y + this._height; + }, + + getArea: function () { + return { + x: this._x, + y: this._y, + width: this._width, + height: this._height + }; + }, + + getBbox: function() { + return [ + [ this._x, this._y ], + [ this.getXend(), this.getYend() ] + ]; + }, + + /** + * 实在找不到合适的地方做了,各种粗暴的写法~ -_- + */ + refixAxisShape: function(component) { + var zeroX; + var zeroY; + var axisList = component.xAxis._axisList.concat(component.yAxis._axisList); + var len = axisList.length; + var axis; + while (len--) { + axis = axisList[len]; + if (axis.type == ecConfig.COMPONENT_TYPE_AXIS_VALUE + && axis._min < 0 + && axis._max >= 0 + ) { + axis.isHorizontal() + ? (zeroX = axis.getCoord(0)) + : (zeroY = axis.getCoord(0)); + } + } + if (typeof zeroX != 'undefined' || typeof zeroY != 'undefined') { + len = axisList.length; + while (len--) { + axisList[len].refixAxisShape(zeroX, zeroY); + } + } + }, + + refresh: function (newOption) { + if (newOption + || this._zrWidth != this.zr.getWidth() + || this._zrHeight != this.zr.getHeight() + ) { + this.clear(); + this.option = newOption || this.option; + this.option.grid = this.reformOption(this.option.grid); + + var gridOption = this.option.grid; + this._zrWidth = this.zr.getWidth(); + this._zrHeight = this.zr.getHeight(); + this._x = this.parsePercent(gridOption.x, this._zrWidth); + this._y = this.parsePercent(gridOption.y, this._zrHeight); + var x2 = this.parsePercent(gridOption.x2, this._zrWidth); + var y2 = this.parsePercent(gridOption.y2, this._zrHeight); + + + if (typeof gridOption.width == 'undefined') { + this._width = this._zrWidth - this._x - x2; + } + else { + this._width = this.parsePercent(gridOption.width, this._zrWidth); + } + this._width = this._width <= 0 ? 10 : this._width; + + if (typeof gridOption.height == 'undefined') { + this._height = this._zrHeight - this._y - y2; + } + else { + this._height = this.parsePercent(gridOption.height, this._zrHeight); + } + this._height = this._height <= 0 ? 10 : this._height; + + this._x = this.subPixelOptimize(this._x, gridOption.borderWidth); + this._y = this.subPixelOptimize(this._y, gridOption.borderWidth); + + this.shapeList.push(new RectangleShape({ + zlevel: this._zlevelBase, + hoverable: false, + style: { + x: this._x, + y: this._y, + width: this._width, + height: this._height, + brushType: gridOption.borderWidth > 0 ? 'both' : 'fill', + color: gridOption.backgroundColor, + strokeColor: gridOption.borderColor, + lineWidth: gridOption.borderWidth + // type: this.option.splitArea.areaStyle.type, + } + })); + this.zr.addShape(this.shapeList[0]); + } + } + }; + + zrUtil.inherits(Grid, Base); + + require('../component').define('grid', Grid); + + return Grid; +}); +/** + * echarts组件:数据区域缩放 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/component/dataZoom',['require','./base','zrender/shape/Rectangle','zrender/shape/Polygon','../util/shape/Icon','../config','zrender/tool/util','../component','../component'],function (require) { + var Base = require('./base'); + + // 图形依赖 + var RectangleShape = require('zrender/shape/Rectangle'); + var PolygonShape = require('zrender/shape/Polygon'); + var IconShape = require('../util/shape/Icon'); + + var ecConfig = require('../config'); + var zrUtil = require('zrender/tool/util'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} option 图表参数 + * @param {Object} component 组件 + */ + function DataZoom(ecTheme, messageCenter, zr, option, myChart) { + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + + var self = this; + self._ondrift = function (dx, dy) { + return self.__ondrift(this, dx, dy); + }; + self._ondragend = function () { + return self.__ondragend(); + }; + + this._fillerSize = 28; // 控件大小,水平布局为高,纵向布局为宽 + this._handleSize = 8; // 手柄大小 + // this._fillerShae; // 填充 + // this._startShape; // 起始手柄 + // this._endShape; // 结束手柄 + // this._startFrameShape; // 起始特效边框 + // this._endFrameShape; // 结束特效边框 + // this._syncTicket; + this._isSilence = false; + this._zoom = {}; + // this._originalData; + + this.option.dataZoom = this.reformOption(this.option.dataZoom); + this.zoomOption = this.option.dataZoom; + + // 位置参数,通过计算所得x, y, width, height + this._location = this._getLocation(); + // 缩放参数 + this._zoom = this._getZoom(); + this._backupData(); + + if (this.option.dataZoom.show) { + this._buildShape(); + } + this._syncData(); + } + + DataZoom.prototype = { + type : ecConfig.COMPONENT_TYPE_DATAZOOM, + _buildShape : function () { + this._buildBackground(); + this._buildFiller(); + this._buildHandle(); + this._buildFrame(); + + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + this._syncFrameShape(); + }, + + /** + * 根据选项计算实体的位置坐标 + */ + _getLocation : function () { + var x; + var y; + var width; + var height; + var grid = this.component.grid; + + // 不指定则根据grid适配 + if (this.zoomOption.orient == 'horizontal') { + // 水平布局 + width = this.zoomOption.width || grid.getWidth(); + height = this.zoomOption.height || this._fillerSize; + x = typeof this.zoomOption.x != 'undefined' + ? this.zoomOption.x : grid.getX(); + y = typeof this.zoomOption.y != 'undefined' + ? this.zoomOption.y : (this.zr.getHeight() - height - 2); + } + else { + // 垂直布局 + width = this.zoomOption.width || this._fillerSize; + height = this.zoomOption.height || grid.getHeight(); + x = typeof this.zoomOption.x != 'undefined' + ? this.zoomOption.x : 2; + y = typeof this.zoomOption.y != 'undefined' + ? this.zoomOption.y : grid.getY(); + } + + return { + x : x, + y : y, + width : width, + height : height + }; + }, + + /** + * 计算缩放参数 + * 修正单坐标轴只传对象为数组。 + */ + _getZoom : function () { + var series = this.option.series; + var xAxis = this.option.xAxis; + if (xAxis && !(xAxis instanceof Array)) { + xAxis = [xAxis]; + this.option.xAxis = xAxis; + } + var yAxis = this.option.yAxis; + if (yAxis && !(yAxis instanceof Array)) { + yAxis = [yAxis]; + this.option.yAxis = yAxis; + } + + var zoomSeriesIndex = []; + var xAxisIndex; + var yAxisIndex; + + var zOptIdx = this.zoomOption.xAxisIndex; + if (xAxis && typeof zOptIdx == 'undefined') { + xAxisIndex = []; + for (var i = 0, l = xAxis.length; i < l; i++) { + // 横纵默认为类目轴 + if (xAxis[i].type == 'category' + || typeof xAxis[i].type == 'undefined' + ) { + xAxisIndex.push(i); + } + } + } + else { + if (zOptIdx instanceof Array) { + xAxisIndex = zOptIdx; + } + else if (typeof zOptIdx != 'undefined') { + xAxisIndex = [zOptIdx]; + } + else { + xAxisIndex = []; + } + } + + zOptIdx = this.zoomOption.yAxisIndex; + if (yAxis && typeof zOptIdx == 'undefined') { + yAxisIndex = []; + for (var i = 0, l = yAxis.length; i < l; i++) { + if (yAxis[i].type == 'category') { + yAxisIndex.push(i); + } + } + } + else { + if (zOptIdx instanceof Array) { + yAxisIndex = zOptIdx; + } + else if (typeof zOptIdx != 'undefined') { + yAxisIndex = [zOptIdx]; + } + else { + yAxisIndex = []; + } + } + + // 找到缩放控制的所有series + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type != ecConfig.CHART_TYPE_LINE + && series[i].type != ecConfig.CHART_TYPE_BAR + && series[i].type != ecConfig.CHART_TYPE_SCATTER + && series[i].type != ecConfig.CHART_TYPE_K + ) { + continue; + } + for (var j = 0, k = xAxisIndex.length; j < k; j++) { + if (xAxisIndex[j] == (series[i].xAxisIndex || 0)) { + zoomSeriesIndex.push(i); + break; + } + } + for (var j = 0, k = yAxisIndex.length; j < k; j++) { + if (yAxisIndex[j] == (series[i].yAxisIndex || 0)) { + zoomSeriesIndex.push(i); + break; + } + } + // 不指定接管坐标轴,则散点图被纳入接管范围 + if (series[i].type == ecConfig.CHART_TYPE_SCATTER + && typeof this.zoomOption.xAxisIndex == 'undefined' + && typeof this.zoomOption.yAxisIndex == 'undefined' + ) { + zoomSeriesIndex.push(i); + } + } + + var start = typeof this._zoom.start != 'undefined' + ? this._zoom.start + : (typeof this.zoomOption.start != 'undefined' ? this.zoomOption.start : 0); + var end = typeof this._zoom.end != 'undefined' + ? this._zoom.end + : (typeof this.zoomOption.end != 'undefined' ? this.zoomOption.end : 100); + /* + var start = typeof this.zoomOption.start != 'undefined' + && this.zoomOption.start >= 0 + && this.zoomOption.start <= 100 + ? this.zoomOption.start : 0; + var end = typeof this.zoomOption.end != 'undefined' + && this.zoomOption.end >= 0 + && this.zoomOption.end <= 100 + ? this.zoomOption.end : 100; + */ + if (start > end) { + // 大小颠倒自动翻转 + start = start + end; + end = start - end; + start = start - end; + } + var size = Math.round( + (end - start) / 100 + * (this.zoomOption.orient == 'horizontal' + ? this._location.width : this._location.height) + ); + return { + start : start, + end : end, + start2 : 0, + end2 : 100, + size : size, + xAxisIndex : xAxisIndex, + yAxisIndex : yAxisIndex, + seriesIndex : zoomSeriesIndex, + scatterMap : this._zoom.scatterMap || {} + }; + }, + + _backupData : function () { + this._originalData = { + xAxis : {}, + yAxis : {}, + series : {} + }; + var xAxis = this.option.xAxis; + var xAxisIndex = this._zoom.xAxisIndex; + for (var i = 0, l = xAxisIndex.length; i < l; i++) { + this._originalData.xAxis[xAxisIndex[i]] = xAxis[xAxisIndex[i]].data; + } + + var yAxis = this.option.yAxis; + var yAxisIndex = this._zoom.yAxisIndex; + for (var i = 0, l = yAxisIndex.length; i < l; i++) { + this._originalData.yAxis[yAxisIndex[i]] = yAxis[yAxisIndex[i]].data; + } + + var series = this.option.series; + var seriesIndex = this._zoom.seriesIndex; + var serie; + for (var i = 0, l = seriesIndex.length; i < l; i++) { + serie = series[seriesIndex[i]]; + this._originalData.series[seriesIndex[i]] = serie.data; + if (serie.type == ecConfig.CHART_TYPE_SCATTER) { + this._calculScatterMap(seriesIndex[i]); + } + } + }, + + _calculScatterMap : function (seriesIndex) { + this._zoom.scatterMap = this._zoom.scatterMap || {}; + this._zoom.scatterMap[seriesIndex] = this._zoom.scatterMap[seriesIndex] || {}; + var componentLibrary = require('../component'); + // x轴极值 + var Axis = componentLibrary.get('axis'); + var axisOption = zrUtil.clone(this.option.xAxis); + if (axisOption instanceof Array) { + axisOption[0].type = 'value'; + axisOption[0].scale = true; + axisOption[0].boundary = [0, 0]; + axisOption[1] && (axisOption[1].type = 'value', axisOption[1].boundary = [0, 0]); + } + else { + axisOption.type = 'value'; + axisOption.scale = true; + axisOption.boundary = [0, 0]; + } + var vAxis = new Axis( + this.ecTheme, + null, // messageCenter + false, // this.zr + { + xAxis: axisOption, + series : this.option.series + }, + this, + 'xAxis' + ); + var axisIndex = this.option.series[seriesIndex].xAxisIndex || 0; + this._zoom.scatterMap[seriesIndex].x = vAxis.getAxis(axisIndex).getExtremum(); + vAxis.dispose(); + + // y轴极值 + axisOption = zrUtil.clone(this.option.yAxis); + if (axisOption instanceof Array) { + axisOption[0].type = 'value'; + axisOption[0].scale = true; + axisOption[1] && (axisOption[1].type = 'value', axisOption[1].boundary = [0, 0]); + } + else { + axisOption.type = 'value'; + axisOption.scale = true; + axisOption.boundary = [0, 0]; + } + vAxis = new Axis( + this.ecTheme, + null, // messageCenter + false, // this.zr + { + yAxis: axisOption, + series : this.option.series + }, + this, + 'yAxis' + ); + axisIndex = this.option.series[seriesIndex].yAxisIndex || 0; + this._zoom.scatterMap[seriesIndex].y = vAxis.getAxis(axisIndex).getExtremum(); + vAxis.dispose(); + // console.log(this._zoom.scatterMap); + }, + + _buildBackground : function () { + var width = this._location.width; + var height = this._location.height; + + // 背景 + this.shapeList.push(new RectangleShape({ + zlevel : this._zlevelBase, + hoverable :false, + style : { + x : this._location.x, + y : this._location.y, + width : width, + height : height, + color : this.zoomOption.backgroundColor + } + })); + + // 数据阴影 + var maxLength = 0; + var xAxis = this._originalData.xAxis; + var xAxisIndex = this._zoom.xAxisIndex; + for (var i = 0, l = xAxisIndex.length; i < l; i++) { + maxLength = Math.max( + maxLength, xAxis[xAxisIndex[i]].length + ); + } + var yAxis = this._originalData.yAxis; + var yAxisIndex = this._zoom.yAxisIndex; + for (var i = 0, l = yAxisIndex.length; i < l; i++) { + maxLength = Math.max( + maxLength, yAxis[yAxisIndex[i]].length + ); + } + + var seriesIndex = this._zoom.seriesIndex[0]; + var data = this._originalData.series[seriesIndex]; + var maxValue = Number.MIN_VALUE; + var minValue = Number.MAX_VALUE; + var value; + for (var i = 0, l = data.length; i < l; i++) { + value = typeof data[i] != 'undefined' + ? (typeof data[i].value != 'undefined' ? data[i].value : data[i]) + : 0; + if (this.option.series[seriesIndex].type == ecConfig.CHART_TYPE_K) { + value = value[1]; // 收盘价 + } + if (isNaN(value)) { + value = 0; + } + maxValue = Math.max(maxValue, value); + minValue = Math.min(minValue, value); + } + var valueRange = maxValue - minValue; + + var pointList = []; + var x = width / (maxLength - (maxLength > 1 ? 1 : 0)); + var y = height / (maxLength - (maxLength > 1 ? 1 : 0)); + var step = 1; + if (this.zoomOption.orient == 'horizontal' && x < 1) { + step = Math.floor(maxLength * 3 / width); + } + else if (this.zoomOption.orient == 'vertical' && y < 1){ + step = Math.floor(maxLength * 3 / height); + } + + for (var i = 0, l = maxLength; i < l; i += step) { + value = typeof data[i] != 'undefined' + ? (typeof data[i].value != 'undefined' + ? data[i].value : data[i]) + : 0; + if (this.option.series[seriesIndex].type == ecConfig.CHART_TYPE_K) { + value = value[1]; // 收盘价 + } + if (isNaN(value)) { + value = 0; + } + if (this.zoomOption.orient == 'horizontal') { + pointList.push([ + this._location.x + x * i, + this._location.y + height - 1 - Math.round( + (value - minValue) / valueRange * (height - 10) + ) + ]); + } + else { + pointList.push([ + this._location.x + 1 + Math.round( + (value - minValue) / valueRange * (width - 10) + ), + this._location.y + y * i + ]); + } + } + if (this.zoomOption.orient == 'horizontal') { + pointList.push([ + this._location.x + width, + this._location.y + height + ]); + pointList.push([ + this._location.x, this._location.y + height + ]); + } + else { + pointList.push([ + this._location.x, this._location.y + height + ]); + pointList.push([ + this._location.x, this._location.y + ]); + } + + this.shapeList.push(new PolygonShape({ + zlevel : this._zlevelBase, + style : { + pointList : pointList, + color : this.zoomOption.dataBackgroundColor + }, + hoverable : false + })); + }, + + /** + * 构建填充物 + */ + _buildFiller : function () { + this._fillerShae = { + zlevel : this._zlevelBase, + draggable : true, + ondrift : this._ondrift, + ondragend : this._ondragend, + _type : 'filler' + }; + + if (this.zoomOption.orient == 'horizontal') { + // 横向 + this._fillerShae.style = { + x : this._location.x + + Math.round(this._zoom.start / 100 * this._location.width) + + this._handleSize, + y : this._location.y, + width : this._zoom.size - this._handleSize * 2, + height : this._location.height, + color : this.zoomOption.fillerColor, + // strokeColor : '#fff', // this.zoomOption.handleColor, + // lineWidth: 2, + text : ':::', + textPosition : 'inside' + }; + } + else { + // 纵向 + this._fillerShae.style ={ + x : this._location.x, + y : this._location.y + + Math.round(this._zoom.start / 100 * this._location.height) + + this._handleSize, + width : this._location.width, + height : this._zoom.size - this._handleSize * 2, + color : this.zoomOption.fillerColor, + // strokeColor : '#fff', // this.zoomOption.handleColor, + // lineWidth: 2, + text : '::', + textPosition : 'inside' + }; + } + + this._fillerShae.highlightStyle = { + brushType: 'fill', + color : 'rgba(0,0,0,0)' + /* + color : require('zrender/tool/color').alpha( + this._fillerShae.style.color, 0 + ) + */ + }; + this._fillerShae = new RectangleShape(this._fillerShae); + this.shapeList.push(this._fillerShae); + }, + + /** + * 构建拖拽手柄 + */ + _buildHandle : function () { + this._startShape = { + zlevel : this._zlevelBase, + draggable : true, + style : { + iconType: 'rectangle', + x : this._location.x, + y : this._location.y, + width : this._handleSize, + height : this._handleSize, + color : this.zoomOption.handleColor, + text : '=', + textPosition : 'inside' + }, + highlightStyle : { + brushType: 'fill' + }, + ondrift : this._ondrift, + ondragend : this._ondragend + }; + + if (this.zoomOption.orient == 'horizontal') { + this._startShape.style.height = this._location.height; + this._endShape = zrUtil.clone(this._startShape); + + this._startShape.style.x = this._fillerShae.style.x - this._handleSize, + this._endShape.style.x = this._fillerShae.style.x + + this._fillerShae.style.width; + } + else { + this._startShape.style.width = this._location.width; + this._endShape = zrUtil.clone(this._startShape); + + this._startShape.style.y = this._fillerShae.style.y - this._handleSize; + this._endShape.style.y = this._fillerShae.style.y + + this._fillerShae.style.height; + } + this._startShape = new IconShape(this._startShape); + this._endShape = new IconShape(this._endShape); + this.shapeList.push(this._startShape); + this.shapeList.push(this._endShape); + }, + + /** + * 构建特效边框 + */ + _buildFrame : function () { + // 特效框线,亚像素优化 + var x = this.subPixelOptimize(this._location.x, 1); + var y = this.subPixelOptimize(this._location.y, 1); + this._startFrameShape = { + zlevel : this._zlevelBase, + hoverable :false, + style : { + x : x, + y : y, + width : this._location.width - (x > this._location.x ? 1 : 0), + height : this._location.height - (y > this._location.y ? 1 : 0), + lineWidth: 1, + brushType: 'stroke', + strokeColor : this.zoomOption.handleColor + } + }; + this._endFrameShape = zrUtil.clone(this._startFrameShape); + + this._startFrameShape = new RectangleShape(this._startFrameShape); + this._endFrameShape = new RectangleShape(this._endFrameShape); + this.shapeList.push(this._startFrameShape); + this.shapeList.push(this._endFrameShape); + return; + }, + + _syncHandleShape : function () { + if (this.zoomOption.orient == 'horizontal') { + this._startShape.style.x = this._fillerShae.style.x - this._handleSize; + this._endShape.style.x = this._fillerShae.style.x + + this._fillerShae.style.width; + + this._zoom.start = Math.floor( + (this._startShape.style.x - this._location.x) + / this._location.width * 100 + ); + this._zoom.end = Math.ceil( + (this._endShape.style.x + this._handleSize - this._location.x) + / this._location.width * 100 + ); + } + else { + this._startShape.style.y = this._fillerShae.style.y - this._handleSize; + this._endShape.style.y = this._fillerShae.style.y + + this._fillerShae.style.height; + this._zoom.start = Math.floor( + (this._startShape.style.y - this._location.y) + / this._location.height * 100 + ); + this._zoom.end = Math.ceil( + (this._endShape.style.y + this._handleSize - this._location.y) + / this._location.height * 100 + ); + } + + this.zr.modShape(this._startShape.id); + this.zr.modShape(this._endShape.id); + + // 同步边框 + this._syncFrameShape(); + + this.zr.refresh(); + }, + + _syncFillerShape : function () { + var a; + var b; + if (this.zoomOption.orient == 'horizontal') { + a = this._startShape.style.x; + b = this._endShape.style.x; + this._fillerShae.style.x = Math.min(a, b) + this._handleSize; + this._fillerShae.style.width = Math.abs(a - b) - this._handleSize; + this._zoom.start = Math.floor( + (Math.min(a, b) - this._location.x) + / this._location.width * 100 + ); + this._zoom.end = Math.ceil( + (Math.max(a, b) + this._handleSize - this._location.x) + / this._location.width * 100 + ); + } + else { + a = this._startShape.style.y; + b = this._endShape.style.y; + this._fillerShae.style.y = Math.min(a, b) + this._handleSize; + this._fillerShae.style.height = Math.abs(a - b) - this._handleSize; + this._zoom.start = Math.floor( + (Math.min(a, b) - this._location.y) + / this._location.height * 100 + ); + this._zoom.end = Math.ceil( + (Math.max(a, b) + this._handleSize - this._location.y) + / this._location.height * 100 + ); + } + + this.zr.modShape(this._fillerShae.id); + + // 同步边框 + this._syncFrameShape(); + + this.zr.refresh(); + }, + + _syncFrameShape : function () { + if (this.zoomOption.orient == 'horizontal') { + this._startFrameShape.style.width = + this._fillerShae.style.x - this._location.x; + this._endFrameShape.style.x = + this._fillerShae.style.x + this._fillerShae.style.width; + this._endFrameShape.style.width = + this._location.x + this._location.width - this._endFrameShape.style.x; + } + else { + this._startFrameShape.style.height = + this._fillerShae.style.y - this._location.y; + this._endFrameShape.style.y = + this._fillerShae.style.y + this._fillerShae.style.height; + this._endFrameShape.style.height = + this._location.y + this._location.height - this._endFrameShape.style.y; + } + + this.zr.modShape(this._startFrameShape.id); + this.zr.modShape(this._endFrameShape.id); + }, + + _syncShape : function () { + if (!this.zoomOption.show) { + // 没有伸缩控件 + return; + } + if (this.zoomOption.orient == 'horizontal') { + this._startShape.style.x = this._location.x + + this._zoom.start / 100 * this._location.width; + this._endShape.style.x = this._location.x + + this._zoom.end / 100 * this._location.width + - this._handleSize; + + this._fillerShae.style.x = this._startShape.style.x + this._handleSize; + this._fillerShae.style.width = this._endShape.style.x + - this._startShape.style.x + - this._handleSize; + } + else { + this._startShape.style.y = this._location.y + + this._zoom.start / 100 * this._location.height; + this._endShape.style.y = this._location.y + + this._zoom.end / 100 * this._location.height + - this._handleSize; + + this._fillerShae.style.y = this._startShape.style.y + this._handleSize; + this._fillerShae.style.height = this._endShape.style.y + - this._startShape.style.y + - this._handleSize; + } + + this.zr.modShape(this._startShape.id); + this.zr.modShape(this._endShape.id); + this.zr.modShape(this._fillerShae.id); + // 同步边框 + this._syncFrameShape(); + this.zr.refresh(); + }, + + _syncData : function (dispatchNow) { + var target; + var start; + var end; + var length; + var data; + + for (var key in this._originalData) { + target = this._originalData[key]; + for (var idx in target) { + data = target[idx]; + if (typeof data == 'undefined') { + continue; + } + length = data.length; + start = Math.floor(this._zoom.start / 100 * length); + end = Math.ceil(this._zoom.end / 100 * length); + if (this.option[key][idx].type != ecConfig.CHART_TYPE_SCATTER) { + this.option[key][idx].data = data.slice(start, end); + } + else { + // 散点图特殊处理 + this.option[key][idx].data = this._synScatterData(idx, data); + } + } + } + + if (!this._isSilence && (this.zoomOption.realtime || dispatchNow)) { + this.messageCenter.dispatch( + ecConfig.EVENT.DATA_ZOOM, + null, + {zoom: this._zoom}, + this.myChart + ); + } + + //this.zoomOption.start = this._zoom.start; + //this.zoomOption.end = this._zoom.end; + }, + + _synScatterData : function (seriesIndex, data) { + if (this._zoom.start === 0 + && this._zoom.end == 100 + && this._zoom.start2 === 0 + && this._zoom.end2 == 100 + ) { + return data; + } + var newData = []; + var scale = this._zoom.scatterMap[seriesIndex]; + var total; + var xStart; + var xEnd; + var yStart; + var yEnd; + + if (this.zoomOption.orient == 'horizontal') { + total = scale.x.max - scale.x.min; + xStart = this._zoom.start / 100 * total + scale.x.min; + xEnd = this._zoom.end / 100 * total + scale.x.min; + + total = scale.y.max - scale.y.min; + yStart = this._zoom.start2 / 100 * total + scale.y.min; + yEnd = this._zoom.end2 / 100 * total + scale.y.min; + } + else { + total = scale.x.max - scale.x.min; + xStart = this._zoom.start2 / 100 * total + scale.x.min; + xEnd = this._zoom.end2 / 100 * total + scale.x.min; + + total = scale.y.max - scale.y.min; + yStart = this._zoom.start / 100 * total + scale.y.min; + yEnd = this._zoom.end / 100 * total + scale.y.min; + } + + // console.log(xStart,xEnd,yStart,yEnd); + var value; + for (var i = 0, l = data.length; i < l; i++) { + value = data[i].value || data[i]; + if (value[0] >= xStart + && value[0] <= xEnd + && value[1] >= yStart + && value[1] <= yEnd + ) { + newData.push(data[i]); + } + } + + return newData; + }, + /** + * 拖拽范围控制 + */ + __ondrift : function (shape, dx, dy) { + if (this.zoomOption.zoomLock) { + // zoomLock时把handle转成filler的拖拽 + shape = this._fillerShae; + } + + var detailSize = shape._type == 'filler' ? this._handleSize : 0; + if (this.zoomOption.orient == 'horizontal') { + if (shape.style.x + dx - detailSize <= this._location.x) { + shape.style.x = this._location.x + detailSize; + } + else if (shape.style.x + dx + shape.style.width + detailSize + >= this._location.x + this._location.width + ) { + shape.style.x = this._location.x + this._location.width + - shape.style.width - detailSize; + } + else { + shape.style.x += dx; + } + } + else { + if (shape.style.y + dy - detailSize <= this._location.y) { + shape.style.y = this._location.y + detailSize; + } + else if (shape.style.y + dy + shape.style.height + detailSize + >= this._location.y + this._location.height + ) { + shape.style.y = this._location.y + this._location.height + - shape.style.height - detailSize; + } + else { + shape.style.y += dy; + } + } + + if (shape._type == 'filler') { + this._syncHandleShape(); + } + else { + this._syncFillerShape(); + } + + if (this.zoomOption.realtime) { + this._syncData(); + } + + return true; + }, + + __ondragend : function () { + this.isDragend = true; + }, + + /** + * 数据项被拖拽出去 + */ + ondragend : function (param, status) { + if (!this.isDragend || !param.target) { + // 没有在当前实例上发生拖拽行为则直接返回 + return; + } + + !this.zoomOption.realtime && this._syncData(); + + // 别status = {}赋值啊!! + status.dragOut = true; + status.dragIn = true; + if (!this._isSilence && !this.zoomOption.realtime) { + this.messageCenter.dispatch( + ecConfig.EVENT.DATA_ZOOM, + null, + {zoom: this._zoom}, + this.myChart + ); + } + status.needRefresh = false; // 会有消息触发fresh,不用再刷一遍 + // 处理完拖拽事件后复位 + this.isDragend = false; + + return; + }, + + ondataZoom : function (param, status) { + status.needRefresh = true; + return; + }, + + absoluteZoom : function (param) { + //this.zoomOption.start = + this._zoom.start = param.start; + //this.zoomOption.end = + this._zoom.end = param.end; + //this.zoomOption.start2 = + this._zoom.start2 = param.start2; + //this.zoomOption.end2 = + this._zoom.end2 = param.end2; + this._syncShape(); + this._syncData(true); + return; + }, + + rectZoom : function (param) { + if (!param) { + // 重置拖拽 + //this.zoomOption.start = + //this.zoomOption.start2 = + this._zoom.start = + this._zoom.start2 = 0; + + //this.zoomOption.end = + //this.zoomOption.end2 = + this._zoom.end = + this._zoom.end2 = 100; + + this._syncShape(); + this._syncData(true); + return this._zoom; + } + var gridArea = this.component.grid.getArea(); + var rect = { + x : param.x, + y : param.y, + width : param.width, + height : param.height + }; + // 修正方向框选 + if (rect.width < 0) { + rect.x += rect.width; + rect.width = -rect.width; + } + if (rect.height < 0) { + rect.y += rect.height; + rect.height = -rect.height; + } + // console.log(rect,this._zoom); + + // 剔除无效缩放 + if (rect.x > gridArea.x + gridArea.width + || rect.y > gridArea.y + gridArea.height + ) { + return false; // 无效缩放 + } + + // 修正框选超出 + if (rect.x < gridArea.x) { + rect.x = gridArea.x; + } + if (rect.x + rect.width > gridArea.x + gridArea.width) { + rect.width = gridArea.x + gridArea.width - rect.x; + } + if (rect.y + rect.height > gridArea.y + gridArea.height) { + rect.height = gridArea.y + gridArea.height - rect.y; + } + + var total; + var sdx = (rect.x - gridArea.x) / gridArea.width; + var edx = 1 - (rect.x + rect.width - gridArea.x) / gridArea.width; + var sdy = 1 - (rect.y + rect.height - gridArea.y) / gridArea.height; + var edy = (rect.y - gridArea.y) / gridArea.height; + //console.log('this',sdy,edy,this._zoom.start,this._zoom.end) + if (this.zoomOption.orient == 'horizontal') { + total = this._zoom.end - this._zoom.start; + this._zoom.start += total * sdx; + this._zoom.end -= total * edx; + + total = this._zoom.end2 - this._zoom.start2; + this._zoom.start2 += total * sdy; + this._zoom.end2 -= total * edy; + } + else { + total = this._zoom.end - this._zoom.start; + this._zoom.start += total * sdy; + this._zoom.end -= total * edy; + + total = this._zoom.end2 - this._zoom.start2; + this._zoom.start2 += total * sdx; + this._zoom.end2 -= total * edx; + } + //console.log(this._zoom.start,this._zoom.end,this._zoom.start2,this._zoom.end2) + //this.zoomOption.start = this._zoom.start; + //this.zoomOption.end = this._zoom.end; + //this.zoomOption.start2 = this._zoom.start2; + //this.zoomOption.end2 = this._zoom.end2; + //console.log(rect,gridArea,this._zoom,total) + this._syncShape(); + this._syncData(true); + return this._zoom; + }, + + syncBackupData : function (curOption) { + var start; + var target = this._originalData['series']; + var curSeries = curOption.series; + var curData; + for (var i = 0, l = curSeries.length; i < l; i++) { + curData = curSeries[i].data; + if (target[i]) { + // dataZoom接管的 + start = Math.floor(this._zoom.start / 100 * target[i].length); + } + else { + // 非dataZoom接管 + start = 0; + } + for (var j = 0, k = curData.length; j < k; j++) { + //optionBackup.series[i].data[j + start] = curData[j]; + if (target[i]) { + // 同步内部备份 + target[i][j + start] = curData[j]; + } + } + } + }, + + syncOption : function(magicOption) { + this.silence(true); + this.option = magicOption; + + this.clear(); + // 位置参数,通过计算所得x, y, width, height + this._location = this._getLocation(); + // 缩放参数 + this._zoom = this._getZoom(); + + this._backupData(); + if (this.option.dataZoom && this.option.dataZoom.show) { + this._buildShape(); + } + this._syncData(); + + this.silence(false); + }, + + silence : function (s) { + this._isSilence = s; + }, + + getRealDataIndex : function (sIdx, dIdx) { + if (!this._originalData || (this._zoom.start === 0 && this._zoom.end == 100)) { + return dIdx; + } + var sreies = this._originalData.series; + if (sreies[sIdx]) { + return Math.floor(this._zoom.start / 100 * sreies[sIdx].length) + dIdx; + } + return -1; + }, + + /** + * 避免dataZoom带来两次refresh,不设refresh接口,resize重复一下buildshape逻辑 + */ + resize : function () { + this.clear(); + + // 位置参数,通过计算所得x, y, width, height + this._location = this._getLocation(); + // 缩放参数 + this._zoom = this._getZoom(); + + if (this.option.dataZoom.show) { + this._buildShape(); + } + } + }; + + zrUtil.inherits(DataZoom, Base); + + require('../component').define('dataZoom', DataZoom); + + return DataZoom; +}); +/** + * zrender + * + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + * shape类:handlePolygon,dataRange手柄 + */ +define('echarts/util/shape/HandlePolygon',['require','zrender/shape/Base','zrender/shape/Polygon','zrender/tool/util'],function (require) { + var Base = require('zrender/shape/Base'); + var PolygonShape = require('zrender/shape/Polygon'); + var zrUtil = require('zrender/tool/util'); + + function HandlePolygon(options) { + Base.call(this, options); + } + + HandlePolygon.prototype = { + type : 'handle-polygon', + /** + * 创建多边形路径 + * @param {Context2D} ctx Canvas 2D上下文 + * @param {Object} style 样式 + */ + buildPath : function (ctx, style) { + PolygonShape.prototype.buildPath( + ctx, style + ); + }, + isCover : function (x, y) { + var originPos = this.getTansform(x, y); + x = originPos[0]; + y = originPos[1]; + + // 不能缓存rect! + var rect = this.style.rect; + if (x >= rect.x + && x <= (rect.x + rect.width) + && y >= rect.y + && y <= (rect.y + rect.height) + ) { + // 矩形内 + return true; + } + else { + return false; + } + } + }; + zrUtil.inherits(HandlePolygon, Base); + + return HandlePolygon; +}); + +/** + * echarts组件:值域 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/component/dataRange',['require','./base','zrender/shape/Text','zrender/shape/Rectangle','../util/shape/HandlePolygon','../config','zrender/tool/util','zrender/tool/area','zrender/tool/color','zrender/tool/color','../component'],function (require) { + var Base = require('./base'); + + // 图形依赖 + var TextShape = require('zrender/shape/Text'); + var RectangleShape = require('zrender/shape/Rectangle'); + var HandlePolygonShape = require('../util/shape/HandlePolygon'); + + var ecConfig = require('../config'); + var zrUtil = require('zrender/tool/util'); + var zrArea = require('zrender/tool/area'); + var zrColor = require('zrender/tool/color'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} option 图表参数 + * @param {Object=} selected 用于状态保持 + */ + function DataRange(ecTheme, messageCenter, zr, option, myChart) { + if (typeof this.query(option, 'dataRange.min') == 'undefined' + || typeof this.query(option, 'dataRange.max') == 'undefined' + ) { + console.error('option.dataRange.min or option.dataRange.max has not been defined.'); + return; + } + + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + + var self = this; + self._ondrift = function(dx, dy) { + return self.__ondrift(this, dx, dy); + }; + self._ondragend = function() { + return self.__ondragend(); + }; + self._dataRangeSelected = function(param) { + return self.__dataRangeSelected(param); + }; + this._selectedMap = {}; + this._range = {}; + + this.refresh(option); + } + + DataRange.prototype = { + type : ecConfig.COMPONENT_TYPE_DATARANGE, + _textGap : 10, // 非值文字间隔 + _buildShape : function () { + // 值域元素组的位置参数,通过计算所得x, y, width, height + this._itemGroupLocation = this._getItemGroupLocation(); + this._buildBackground(); + if (this.dataRangeOption.splitNumber <= 0 + || this.dataRangeOption.calculable + ) { + this._buildGradient(); + } + else { + this._buildItem(); + } + + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + + this._syncShapeFromRange(); + }, + + /** + * 构建图例型的值域元素 + */ + _buildItem : function () { + var data = this._valueTextList; + var dataLength = data.length; + var itemName; + var itemShape; + var textShape; + var font = this.getFont(this.dataRangeOption.textStyle); + + var lastX = this._itemGroupLocation.x; + var lastY = this._itemGroupLocation.y; + var itemWidth = this.dataRangeOption.itemWidth; + var itemHeight = this.dataRangeOption.itemHeight; + var itemGap = this.dataRangeOption.itemGap; + var textHeight = zrArea.getTextHeight('国', font); + var color; + + if (this.dataRangeOption.orient == 'vertical' + && this.dataRangeOption.x == 'right' + ) { + lastX = this._itemGroupLocation.x + + this._itemGroupLocation.width + - itemWidth; + } + var needValueText = true; + if (this.dataRangeOption.text) { + needValueText = false; + // 第一个文字 + if (this.dataRangeOption.text[0]) { + textShape = this._getTextShape( + lastX, lastY, this.dataRangeOption.text[0] + ); + if (this.dataRangeOption.orient == 'horizontal') { + lastX += zrArea.getTextWidth( + this.dataRangeOption.text[0], + font + ) + + this._textGap; + } + else { + lastY += textHeight + this._textGap; + textShape.style.y += textHeight / 2 + this._textGap; + textShape.style.textBaseline = 'bottom'; + } + this.shapeList.push(new TextShape(textShape)); + } + } + + for (var i = 0; i < dataLength; i++) { + itemName = data[i]; + color = this.getColor((dataLength - i) * this._gap + this.dataRangeOption.min); + // 图形 + itemShape = this._getItemShape( + lastX, lastY, + itemWidth, itemHeight, + (this._selectedMap[i] ? color : '#ccc') + ); + itemShape._idx = i; + itemShape.onclick = this._dataRangeSelected; + this.shapeList.push(new RectangleShape(itemShape)); + + if (needValueText) { + // 文字 + textShape = { + zlevel : this._zlevelBase, + style : { + x : lastX + itemWidth + 5, + y : lastY, + color : this._selectedMap[i] + ? this.dataRangeOption.textStyle.color + : '#ccc', + text: data[i], + textFont: font, + textBaseline: 'top' + }, + highlightStyle:{ + brushType: 'fill' + }, + clickable : true + }; + if (this.dataRangeOption.orient == 'vertical' + && this.dataRangeOption.x == 'right' + ) { + textShape.style.x -= (itemWidth + 10); + textShape.style.textAlign = 'right'; + } + textShape._idx = i; + textShape.onclick = this._dataRangeSelected; + this.shapeList.push(new TextShape(textShape)); + } + + if (this.dataRangeOption.orient == 'horizontal') { + lastX += itemWidth + + (needValueText ? 5 : 0) + + (needValueText + ? zrArea.getTextWidth(itemName, font) + : 0) + + itemGap; + } + else { + lastY += itemHeight + itemGap; + } + } + + if (!needValueText && this.dataRangeOption.text[1]) { + if (this.dataRangeOption.orient == 'horizontal') { + lastX = lastX - itemGap + this._textGap; + } + else { + lastY = lastY - itemGap + this._textGap; + } + // 最后一个文字 + textShape = this._getTextShape( + lastX, lastY, this.dataRangeOption.text[1] + ); + + if (this.dataRangeOption.orient != 'horizontal') { + textShape.style.y -= 5; + textShape.style.textBaseline = 'top'; + } + + this.shapeList.push(new TextShape(textShape)); + } + }, + + /** + * 构建渐变型的值域元素 + */ + _buildGradient : function () { + var itemShape; + var textShape; + var font = this.getFont(this.dataRangeOption.textStyle); + + var lastX = this._itemGroupLocation.x; + var lastY = this._itemGroupLocation.y; + var itemWidth = this.dataRangeOption.itemWidth; + var itemHeight = this.dataRangeOption.itemHeight; + var textHeight = zrArea.getTextHeight('国', font); + + + var needValueText = true; + if (this.dataRangeOption.text) { + needValueText = false; + // 第一个文字 + if (this.dataRangeOption.text[0]) { + textShape = this._getTextShape( + lastX, lastY, this.dataRangeOption.text[0] + ); + if (this.dataRangeOption.orient == 'horizontal') { + lastX += zrArea.getTextWidth( + this.dataRangeOption.text[0], + font + ) + + this._textGap; + } + else { + lastY += textHeight + this._textGap; + textShape.style.y += textHeight / 2 + this._textGap; + textShape.style.textBaseline = 'bottom'; + } + this.shapeList.push(new TextShape(textShape)); + } + } + + var zrColor = require('zrender/tool/color'); + var per = 1 / (this.dataRangeOption.color.length - 1); + var colorList = []; + for (var i = 0, l = this.dataRangeOption.color.length; i < l; i++) { + colorList.push([i * per, this.dataRangeOption.color[i]]); + } + if (this.dataRangeOption.orient == 'horizontal') { + itemShape = { + zlevel : this._zlevelBase, + style : { + x : lastX, + y : lastY, + width : itemWidth * 10, + height : itemHeight, + color : zrColor.getLinearGradient( + lastX, lastY, lastX + itemWidth * 10, lastY, + colorList + ) + }, + hoverable : false + }; + lastX += itemWidth * 10 + this._textGap; + } + else { + itemShape = { + zlevel : this._zlevelBase, + style : { + x : lastX, + y : lastY, + width : itemWidth, + height : itemHeight * 10, + color : zrColor.getLinearGradient( + lastX, lastY, lastX, lastY + itemHeight * 10, + colorList + ) + }, + hoverable : false + }; + lastY += itemHeight * 10 + this._textGap; + } + this.shapeList.push(new RectangleShape(itemShape)); + if (this.dataRangeOption.calculable) { + // 可计算元素的位置缓存 + this._calculableLocation = itemShape.style; + this._buildFiller(); + this._bulidMask(); + this._bulidHandle(); + } + + if (!needValueText && this.dataRangeOption.text[1]) { + // 最后一个文字 + textShape = this._getTextShape( + lastX, lastY, this.dataRangeOption.text[1] + ); + + this.shapeList.push(new TextShape(textShape)); + } + }, + + /** + * 构建填充物 + */ + _buildFiller : function () { + this._fillerShae = { + zlevel : this._zlevelBase + 1, + style : { + x : this._calculableLocation.x, + y : this._calculableLocation.y, + width : this._calculableLocation.width, + height : this._calculableLocation.height, + color : 'rgba(255,255,255,0)' + }, + highlightStyle : { + strokeColor : 'rgba(255,255,255,0.5)', + lineWidth : 1 + }, + draggable : true, + ondrift : this._ondrift, + ondragend : this._ondragend, + _type : 'filler' + }; + this._fillerShae = new RectangleShape(this._fillerShae); + this.shapeList.push(this._fillerShae); + }, + + /** + * 构建拖拽手柄 + */ + _bulidHandle : function () { + var x = this._calculableLocation.x; + var y = this._calculableLocation.y; + var width = this._calculableLocation.width; + var height = this._calculableLocation.height; + + var font = this.getFont(this.dataRangeOption.textStyle); + var textHeight = zrArea.getTextHeight('国', font); + var textWidth = Math.max( + zrArea.getTextWidth(this._textFormat(this.dataRangeOption.max), font), + zrArea.getTextWidth(this._textFormat(this.dataRangeOption.min), font) + ) + 2; + + var pointListStart; + var textXStart; + var textYStart; + var coverRectStart; + var pointListEnd; + var textXEnd; + var textYEnd; + var coverRectEnd; + if (this.dataRangeOption.orient == 'horizontal') { + // 水平 + if (this.dataRangeOption.y != 'bottom') { + // 手柄统统在下方 + pointListStart = [ + [x, y], + [x, y + height + textHeight], + [x - textHeight, y + height + textHeight], + [x - 1, y + height], + [x - 1, y] + + ]; + textXStart = x - textWidth / 2 - textHeight; + textYStart = y + height + textHeight / 2 + 2; + coverRectStart = { + x : x - textWidth - textHeight, + y : y + height, + width : textWidth + textHeight, + height : textHeight + }; + + pointListEnd = [ + [x + width, y], + [x + width, y + height + textHeight], + [x + width + textHeight, y + height + textHeight], + [x + width + 1, y + height], + [x + width + 1, y] + ]; + textXEnd = x + width + textWidth / 2 + textHeight; + textYEnd = textYStart; + coverRectEnd = { + x : x + width, + y : y + height, + width : textWidth + textHeight, + height : textHeight + }; + } + else { + // 手柄在上方 + pointListStart = [ + [x, y + height], + [x, y - textHeight], + [x - textHeight, y - textHeight], + [x - 1, y], + [x - 1, y + height] + + ]; + textXStart = x - textWidth / 2 - textHeight; + textYStart = y - textHeight / 2 - 2; + coverRectStart = { + x : x - textWidth - textHeight, + y : y - textHeight, + width : textWidth + textHeight, + height : textHeight + }; + + pointListEnd = [ + [x + width, y + height], + [x + width, y - textHeight], + [x + width + textHeight, y - textHeight], + [x + width + 1, y], + [x + width + 1, y + height] + ]; + textXEnd = x + width + textWidth / 2 + textHeight; + textYEnd = textYStart; + coverRectEnd = { + x : x + width, + y : y - textHeight, + width : textWidth + textHeight, + height : textHeight + }; + } + } + else { + textWidth += textHeight; + // 垂直 + if (this.dataRangeOption.x != 'right') { + // 手柄统统在右侧 + pointListStart = [ + [x, y], + [x + width + textHeight, y], + [x + width + textHeight, y - textHeight], + [x + width, y - 1], + [x, y - 1] + ]; + textXStart = x + width + textWidth / 2 + textHeight / 2; + textYStart = y - textHeight / 2; + coverRectStart = { + x : x + width, + y : y - textHeight, + width : textWidth + textHeight, + height : textHeight + }; + + pointListEnd = [ + [x, y + height], + [x + width + textHeight, y + height], + [x + width + textHeight, y + textHeight + height], + [x + width, y + 1 + height], + [x, y + height + 1] + ]; + textXEnd = textXStart; + textYEnd = y + height + textHeight / 2; + coverRectEnd = { + x : x + width, + y : y + height, + width : textWidth + textHeight, + height : textHeight + }; + } + else { + // 手柄在左侧 + pointListStart = [ + [x + width, y], + [x - textHeight, y], + [x - textHeight, y - textHeight], + [x, y - 1], + [x + width, y - 1] + ]; + textXStart = x - textWidth / 2 - textHeight / 2; + textYStart = y - textHeight / 2; + coverRectStart = { + x : x - textWidth - textHeight, + y : y - textHeight, + width : textWidth + textHeight, + height : textHeight + }; + + pointListEnd = [ + [x + width, y + height], + [x - textHeight, y + height], + [x - textHeight, y + textHeight + height], + [x, y + 1 + height], + [x + width, y + height + 1] + ]; + textXEnd = textXStart; + textYEnd = y + height + textHeight / 2; + coverRectEnd = { + x : x - textWidth - textHeight, + y : y + height, + width : textWidth + textHeight, + height : textHeight + }; + } + } + + this._startShape = { + style : { + pointList : pointListStart, + text : this._textFormat(this.dataRangeOption.max), + textX : textXStart, + textY : textYStart, + color : this.getColor(this.dataRangeOption.max), + rect : coverRectStart, + x : pointListStart[0][0], + y : pointListStart[0][1], + _x : pointListStart[0][0], // 拖拽区域控制缓存 + _y : pointListStart[0][1] + } + }; + this._startShape.highlightStyle = { + strokeColor : this._startShape.style.color, + lineWidth : 1 + }; + + this._endShape = { + style : { + pointList : pointListEnd, + text : this._textFormat(this.dataRangeOption.min), + textX : textXEnd, + textY : textYEnd, + color : this.getColor(this.dataRangeOption.min), + rect : coverRectEnd, + x : pointListEnd[0][0], + y : pointListEnd[0][1], + _x : pointListEnd[0][0], // 拖拽区域控制缓存 + _y : pointListEnd[0][1] + } + }; + this._endShape.highlightStyle = { + strokeColor : this._endShape.style.color, + lineWidth : 1 + }; + + // 统一参数 + this._startShape.zlevel = this._endShape.zlevel = this._zlevelBase + 1; + this._startShape.draggable = this._endShape.draggable = true; + this._startShape.ondrift = this._endShape.ondrift = this._ondrift; + this._startShape.ondragend = this._endShape.ondragend = this._ondragend; + + this._startShape.style.textColor = this._endShape.style.textColor + = this.dataRangeOption.textStyle.color; + this._startShape.style.textAlign = this._endShape.style.textAlign = 'center'; + this._startShape.style.textPosition = this._endShape.style.textPosition = 'specific'; + this._startShape.style.textBaseline = this._endShape.style.textBaseline = 'middle'; + // for ondrif计算统一 + this._startShape.style.width = this._endShape.style.width = 0; + this._startShape.style.height = this._endShape.style.height = 0; + this._startShape.style.textPosition = this._endShape.style.textPosition = 'specific'; + + this._startShape = new HandlePolygonShape(this._startShape); + this._endShape = new HandlePolygonShape(this._endShape); + this.shapeList.push(this._startShape); + this.shapeList.push(this._endShape); + }, + + _bulidMask : function () { + var x = this._calculableLocation.x; + var y = this._calculableLocation.y; + var width = this._calculableLocation.width; + var height = this._calculableLocation.height; + this._startMask = { + zlevel : this._zlevelBase + 1, + style : { + x : x, + y : y, + width : this.dataRangeOption.orient == 'horizontal' + ? 0 : width, + height : this.dataRangeOption.orient == 'horizontal' + ? height : 0, + color : '#ccc' + }, + hoverable:false + }; + this._endMask = { + zlevel : this._zlevelBase + 1, + style : { + x : this.dataRangeOption.orient == 'horizontal' + ? x + width : x, + y : this.dataRangeOption.orient == 'horizontal' + ? y : y + height, + width : this.dataRangeOption.orient == 'horizontal' + ? 0 : width, + height : this.dataRangeOption.orient == 'horizontal' + ? height : 0, + color : '#ccc' + }, + hoverable:false + }; + this._startMask = new RectangleShape(this._startMask); + this._endMask = new RectangleShape(this._endMask); + this.shapeList.push(this._startMask); + this.shapeList.push(this._endMask); + }, + + _buildBackground : function () { + var pTop = this.dataRangeOption.padding[0]; + var pRight = this.dataRangeOption.padding[1]; + var pBottom = this.dataRangeOption.padding[2]; + var pLeft = this.dataRangeOption.padding[3]; + + this.shapeList.push(new RectangleShape({ + zlevel : this._zlevelBase, + hoverable :false, + style : { + x : this._itemGroupLocation.x - pLeft, + y : this._itemGroupLocation.y - pTop, + width : this._itemGroupLocation.width + pLeft + pRight, + height : this._itemGroupLocation.height + pTop + pBottom, + brushType : this.dataRangeOption.borderWidth === 0 + ? 'fill' : 'both', + color : this.dataRangeOption.backgroundColor, + strokeColor : this.dataRangeOption.borderColor, + lineWidth : this.dataRangeOption.borderWidth + } + })); + }, + + /** + * 根据选项计算值域实体的位置坐标 + */ + _getItemGroupLocation : function () { + var data = this._valueTextList; + var dataLength = data.length; + var itemGap = this.dataRangeOption.itemGap; + var itemWidth = this.dataRangeOption.itemWidth; + var itemHeight = this.dataRangeOption.itemHeight; + var totalWidth = 0; + var totalHeight = 0; + var font = this.getFont(this.dataRangeOption.textStyle); + var textHeight = zrArea.getTextHeight('国', font); + + if (this.dataRangeOption.orient == 'horizontal') { + // 水平布局,计算总宽度 + if (this.dataRangeOption.text + || this.dataRangeOption.splitNumber <= 0 + || this.dataRangeOption.calculable + ) { + // 指定文字或线性渐变 + totalWidth = + ((this.dataRangeOption.splitNumber <= 0 + || this.dataRangeOption.calculable) + ? (itemWidth * 10 + itemGap) + : dataLength * (itemWidth + itemGap)) + + (this.dataRangeOption.text + && typeof this.dataRangeOption.text[0] != 'undefined' + ? (zrArea.getTextWidth( + this.dataRangeOption.text[0], + font + ) + this._textGap) + : 0) + + (this.dataRangeOption.text + && typeof this.dataRangeOption.text[1] != 'undefined' + ? (zrArea.getTextWidth( + this.dataRangeOption.text[1], + font + ) + this._textGap) + : 0); + } + else { + // 值标签 + itemWidth += 5; + for (var i = 0; i < dataLength; i++) { + totalWidth += itemWidth + + zrArea.getTextWidth( + data[i], + font + ) + + itemGap; + } + } + totalWidth -= itemGap; // 减去最后一个的itemGap + totalHeight = Math.max(textHeight, itemHeight); + } + else { + // 垂直布局,计算总高度 + var maxWidth; + if (this.dataRangeOption.text + || this.dataRangeOption.splitNumber <= 0 + || this.dataRangeOption.calculable + ) { + // 指定文字或线性渐变 + totalHeight = + ((this.dataRangeOption.splitNumber <= 0 + || this.dataRangeOption.calculable) + ? (itemHeight * 10 + itemGap) + : dataLength * (itemHeight + itemGap)) + + (this.dataRangeOption.text + && typeof this.dataRangeOption.text[0] != 'undefined' + ? (this._textGap + textHeight) + : 0) + + (this.dataRangeOption.text + && typeof this.dataRangeOption.text[1] != 'undefined' + ? (this._textGap + textHeight) + : 0); + + maxWidth = Math.max( + zrArea.getTextWidth( + (this.dataRangeOption.text && this.dataRangeOption.text[0]) + || '', + font + ), + zrArea.getTextWidth( + (this.dataRangeOption.text && this.dataRangeOption.text[1]) + || '', + font + ) + ); + totalWidth = Math.max(itemWidth, maxWidth); + } + else { + totalHeight = (itemHeight + itemGap) * dataLength; + // 值标签 + itemWidth += 5; + maxWidth = 0; + for (var i = 0; i < dataLength; i++) { + maxWidth = Math.max( + maxWidth, + zrArea.getTextWidth( + data[i], + font + ) + ); + } + totalWidth = itemWidth + maxWidth; + } + totalHeight -= itemGap; // 减去最后一个的itemGap; + } + + var x; + var zrWidth = this.zr.getWidth(); + switch (this.dataRangeOption.x) { + case 'center' : + x = Math.floor((zrWidth - totalWidth) / 2); + break; + case 'left' : + x = this.dataRangeOption.padding[3] + + this.dataRangeOption.borderWidth; + break; + case 'right' : + x = zrWidth + - totalWidth + - this.dataRangeOption.padding[1] + - this.dataRangeOption.borderWidth; + break; + default : + x = this.parsePercent(this.dataRangeOption.x, zrWidth); + x = isNaN(x) ? 0 : x; + break; + } + + var y; + var zrHeight = this.zr.getHeight(); + switch (this.dataRangeOption.y) { + case 'top' : + y = this.dataRangeOption.padding[0] + + this.dataRangeOption.borderWidth; + break; + case 'bottom' : + y = zrHeight + - totalHeight + - this.dataRangeOption.padding[2] + - this.dataRangeOption.borderWidth; + break; + case 'center' : + y = Math.floor((zrHeight - totalHeight) / 2); + break; + default : + y = this.parsePercent(this.dataRangeOption.y, zrHeight); + y = isNaN(y) ? 0 : y; + break; + } + + if (this.dataRangeOption.calculable) { + // 留出手柄控件 + var handlerWidth = Math.max( + zrArea.getTextWidth(this.dataRangeOption.max, font), + zrArea.getTextWidth(this.dataRangeOption.min, font) + ) + textHeight; + if (this.dataRangeOption.orient == 'horizontal') { + if (x < handlerWidth) { + x = handlerWidth; + } + if (x + totalWidth + handlerWidth > zrWidth) { + x -= handlerWidth; + } + } + else { + if (y < textHeight) { + y = textHeight; + } + if (y + totalHeight + textHeight > zrHeight) { + y -= textHeight; + } + } + } + + return { + x : x, + y : y, + width : totalWidth, + height : totalHeight + }; + }, + + // 指定文本 + _getTextShape : function (x, y, text) { + return { + zlevel : this._zlevelBase, + style : { + x : (this.dataRangeOption.orient == 'horizontal' + ? x + : this._itemGroupLocation.x + + this._itemGroupLocation.width / 2 + ), + y : (this.dataRangeOption.orient == 'horizontal' + ? this._itemGroupLocation.y + + this._itemGroupLocation.height / 2 + : y + ), + color : this.dataRangeOption.textStyle.color, + text: text, + textFont: this.getFont(this.dataRangeOption.textStyle), + textBaseline: (this.dataRangeOption.orient == 'horizontal' + ? 'middle' : 'top'), + textAlign: (this.dataRangeOption.orient == 'horizontal' + ? 'left' : 'center') + }, + hoverable : false + }; + }, + + // 色尺legend item shape + _getItemShape : function (x, y, width, height, color) { + return { + zlevel : this._zlevelBase, + style : { + x : x, + y : y + 1, + width : width, + height : height - 2, + color : color + }, + highlightStyle: { + strokeColor: color, + lineWidth : 1 + }, + clickable : true + }; + }, + + /** + * 拖拽范围控制 + */ + __ondrift : function (shape, dx, dy) { + var x = this._calculableLocation.x; + var y = this._calculableLocation.y; + var width = this._calculableLocation.width; + var height = this._calculableLocation.height; + + if (this.dataRangeOption.orient == 'horizontal') { + if (shape.style.x + dx <= x) { + shape.style.x = x; + } + else if (shape.style.x + dx + shape.style.width >= x + width) { + shape.style.x = x + width - shape.style.width; + } + else { + shape.style.x += dx; + } + } + else { + if (shape.style.y + dy <= y) { + shape.style.y = y; + } + else if (shape.style.y + dy + shape.style.height >= y + height) { + shape.style.y = y + height - shape.style.height; + } + else { + shape.style.y += dy; + } + } + + if (shape._type == 'filler') { + this._syncHandleShape(); + } + else { + this._syncFillerShape(shape); + } + + if (this.dataRangeOption.realtime) { + this._syncData(); + } + + return true; + }, + + __ondragend : function () { + this.isDragend = true; + }, + + /** + * 数据项被拖拽出去 + */ + ondragend : function (param, status) { + if (!this.isDragend || !param.target) { + // 没有在当前实例上发生拖拽行为则直接返回 + return; + } + + !this.dataRangeOption.realtime && this._syncData(); + + // 别status = {}赋值啊!! + status.dragOut = true; + status.dragIn = true; + + if (!this.dataRangeOption.realtime && false) { + this.messageCenter.dispatch( + ecConfig.EVENT.DATA_RANGE, + null, + { + range : { + start : this._range.end, + end : this._range.start + } + }, + this.myChart + ); + } + + status.needRefresh = false; // 会有消息触发fresh,不用再刷一遍 + // 处理完拖拽事件后复位 + this.isDragend = false; + + return; + }, + + // 外部传入range + _syncShapeFromRange : function () { + var range = this.dataRangeOption.range || {}; + // 做一个反转 + this._range.end = typeof this._range.end != 'undefined' + ? this._range.end + : (typeof range.start != 'undefined' ? range.start : 0); + this._range.start = typeof this._range.start != 'undefined' + ? this._range.start + : (typeof range.end != 'undefined' ? range.end : 100); + + if (this._range.start != 100 || this._range.end !== 0) { + // 非默认满值同步一下图形 + if (this.dataRangeOption.orient == 'horizontal') { + // 横向 + var width = this._fillerShae.style.width; + this._fillerShae.style.x += + width * (100 - this._range.start) / 100; + this._fillerShae.style.width = + width * (this._range.start - this._range.end) / 100; + } + else { + // 纵向 + var height = this._fillerShae.style.height; + this._fillerShae.style.y += + height * (100 - this._range.start) / 100; + this._fillerShae.style.height = + height * (this._range.start - this._range.end) / 100; + } + this.zr.modShape(this._fillerShae.id); + this._syncHandleShape(); + } + }, + + _syncHandleShape : function () { + var x = this._calculableLocation.x; + var y = this._calculableLocation.y; + var width = this._calculableLocation.width; + var height = this._calculableLocation.height; + + if (this.dataRangeOption.orient == 'horizontal') { + this._startShape.style.x = this._fillerShae.style.x; + this._startMask.style.width = this._startShape.style.x - x; + + this._endShape.style.x = this._fillerShae.style.x + + this._fillerShae.style.width; + this._endMask.style.x = this._endShape.style.x; + this._endMask.style.width = x + width - this._endShape.style.x; + + this._range.start = Math.ceil( + 100 - (this._startShape.style.x - x) / width * 100 + ); + this._range.end = Math.floor( + 100 - (this._endShape.style.x - x) / width * 100 + ); + } + else { + this._startShape.style.y = this._fillerShae.style.y; + this._startMask.style.height = this._startShape.style.y - y; + + this._endShape.style.y = this._fillerShae.style.y + + this._fillerShae.style.height; + this._endMask.style.y = this._endShape.style.y; + this._endMask.style.height = y + height - this._endShape.style.y; + + this._range.start = Math.ceil( + 100 - (this._startShape.style.y - y) / height * 100 + ); + this._range.end = Math.floor( + 100 - (this._endShape.style.y - y) / height * 100 + ); + } + + this._syncShape(); + }, + + _syncFillerShape : function (e) { + var x = this._calculableLocation.x; + var y = this._calculableLocation.y; + var width = this._calculableLocation.width; + var height = this._calculableLocation.height; + + var a; + var b; + if (this.dataRangeOption.orient == 'horizontal') { + a = this._startShape.style.x; + b = this._endShape.style.x; + if (e.id == this._startShape.id && a >= b) { + // _startShape触发 + b = a; + this._endShape.style.x = a; + } + else if (e.id == this._endShape.id && a >= b) { + // _endShape触发 + a = b; + this._startShape.style.x = a; + } + this._fillerShae.style.x = a; + this._fillerShae.style.width = b - a; + this._startMask.style.width = a - x; + this._endMask.style.x = b; + this._endMask.style.width = x + width - b; + + this._range.start = Math.ceil(100 - (a - x) / width * 100); + this._range.end = Math.floor(100 - (b - x) / width * 100); + } + else { + a = this._startShape.style.y; + b = this._endShape.style.y; + if (e.id == this._startShape.id && a >= b) { + // _startShape触发 + b = a; + this._endShape.style.y = a; + } + else if (e.id == this._endShape.id && a >= b) { + // _endShape触发 + a = b; + this._startShape.style.y = a; + } + this._fillerShae.style.y = a; + this._fillerShae.style.height = b - a; + this._startMask.style.height = a - y; + this._endMask.style.y = b; + this._endMask.style.height = y + height - b; + + this._range.start = Math.ceil(100 - (a - y) / height * 100); + this._range.end = Math.floor(100 - (b - y) / height * 100); + } + + this._syncShape(); + }, + + _syncShape : function () { + this._startShape.position = [ + this._startShape.style.x - this._startShape.style._x, + this._startShape.style.y - this._startShape.style._y + ]; + + this._startShape.style.text = this._textFormat( + this._gap * this._range.start + this.dataRangeOption.min + ); + + this._startShape.style.color + = this._startShape.highlightStyle.strokeColor + = this.getColor( + this._gap * this._range.start + this.dataRangeOption.min + ); + + this._endShape.position = [ + this._endShape.style.x - this._endShape.style._x, + this._endShape.style.y - this._endShape.style._y + ]; + + this._endShape.style.text = this._textFormat( + this._gap * this._range.end + this.dataRangeOption.min + ); + + this._endShape.style.color + = this._endShape.highlightStyle.strokeColor + = this.getColor( + this._gap * this._range.end + this.dataRangeOption.min + ); + + this.zr.modShape(this._startShape.id); + this.zr.modShape(this._endShape.id); + this.zr.modShape(this._startMask.id); + this.zr.modShape(this._endMask.id); + this.zr.modShape(this._fillerShae.id); + this.zr.refresh(); + }, + + _syncData : function () { + if (this.dataRangeOption.realtime) { + this.messageCenter.dispatch( + ecConfig.EVENT.DATA_RANGE, + null, + { + range : { + start : this._range.end, + end : this._range.start + } + }, + this.myChart + ); + } + }, + + + __dataRangeSelected : function (param) { + var idx = param.target._idx; + this._selectedMap[idx] = !this._selectedMap[idx]; + this.messageCenter.dispatch(ecConfig.EVENT.REFRESH, null, null, this.myChart); + }, + + _textFormat : function(valueStart, valueEnd) { + valueStart = valueStart.toFixed(this.dataRangeOption.precision); + valueEnd = typeof valueEnd != 'undefined' + ? valueEnd.toFixed(this.dataRangeOption.precision) : ''; + if (this.dataRangeOption.formatter) { + if (typeof this.dataRangeOption.formatter == 'string') { + return this.dataRangeOption.formatter.replace('{value}', valueStart) + .replace('{value2}', valueEnd); + } + else if (typeof this.dataRangeOption.formatter == 'function') { + return this.dataRangeOption.formatter.call( + this.myChart, valueStart, valueEnd + ); + } + } + + if (valueEnd !== '') { + return valueStart + ' - ' + valueEnd; + } + + return valueStart; + }, + + /** + * 刷新 + */ + refresh : function (newOption) { + if (newOption) { + this.option = newOption; + this.option.dataRange = this.reformOption(this.option.dataRange); + // 补全padding属性 + this.option.dataRange.padding = this.reformCssArray( + this.option.dataRange.padding + ); + this.dataRangeOption = this.option.dataRange; + + var splitNumber = this.dataRangeOption.splitNumber <= 0 + || this.dataRangeOption.calculable + ? 100 + : this.dataRangeOption.splitNumber; + this._colorList = zrColor.getGradientColors( + this.dataRangeOption.color, + Math.max( + (splitNumber - this.dataRangeOption.color.length) + / (this.dataRangeOption.color.length - 1), + 0 + ) + 1 + ); + + if (this._colorList.length > splitNumber) { + var len = this._colorList.length; + var newColorList = [this._colorList[0]]; + var step = len / (splitNumber - 1); + for (var i = 1; i < splitNumber - 1; i++) { + newColorList.push(this._colorList[Math.floor(i * step)]); + } + newColorList.push(this._colorList[len - 1]); + this._colorList = newColorList; + } + // console.log(this._colorList.length) + + var precision = this.dataRangeOption.precision; + this._gap = (this.dataRangeOption.max - this.dataRangeOption.min) / splitNumber; + while (this._gap.toFixed(precision) - 0 != this._gap && precision < 5) { + // 精度自适应 + precision++; + } + this.dataRangeOption.precision = precision; + + this._gap = ( + (this.dataRangeOption.max - this.dataRangeOption.min) / splitNumber + ).toFixed(precision) - 0; + + this._valueTextList = []; + for (var i = 0; i < splitNumber; i++) { + this._selectedMap[i] = true; + this._valueTextList.unshift( + this._textFormat( + i * this._gap + this.dataRangeOption.min, + (i + 1) * this._gap + this.dataRangeOption.min + ) + ); + } + } + + this.clear(); + this._buildShape(); + }, + + getColor : function (value) { + if (isNaN(value)) { + return null; + } + + if (value < this.dataRangeOption.min) { + value = this.dataRangeOption.min; + } + else if (value > this.dataRangeOption.max) { + value = this.dataRangeOption.max; + } + + if (this.dataRangeOption.calculable) { + if (value - (this._gap * this._range.start + this.dataRangeOption.min) > 0.00005 + || value - (this._gap * this._range.end + this.dataRangeOption.min) < -0.00005) { + return null; + } + } + + var idx = this._colorList.length - Math.ceil( + (value - this.dataRangeOption.min) + / (this.dataRangeOption.max - this.dataRangeOption.min) + * this._colorList.length + ); + if (idx == this._colorList.length) { + idx--; + } + //console.log(value, idx,this._colorList[idx]) + if (this._selectedMap[idx]) { + return this._colorList[idx]; + } + else { + return null; + } + } + }; + + zrUtil.inherits(DataRange, Base); + + require('../component').define('dataRange', DataRange); + + return DataRange; +}); + + + +/** + * echarts图表类:散点图 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/chart/scatter',['require','../component/base','./base','../util/shape/Symbol','../component/axis','../component/grid','../component/dataZoom','../component/dataRange','../config','zrender/tool/util','zrender/tool/color','../chart'],function (require) { + var ComponentBase = require('../component/base'); + var ChartBase = require('./base'); + + // 图形依赖 + var SymbolShape = require('../util/shape/Symbol'); + // 组件依赖 + require('../component/axis'); + require('../component/grid'); + require('../component/dataZoom'); + require('../component/dataRange'); + + var ecConfig = require('../config'); + var zrUtil = require('zrender/tool/util'); + var zrColor = require('zrender/tool/color'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} series 数据 + * @param {Object} component 组件 + */ + function Scatter(ecTheme, messageCenter, zr, option, myChart){ + // 基类 + ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); + // 图表基类 + ChartBase.call(this); + + this.refresh(option); + } + + Scatter.prototype = { + type: ecConfig.CHART_TYPE_SCATTER, + /** + * 绘制图形 + */ + _buildShape: function () { + var series = this.series; + this._sIndex2ColorMap = {}; // series默认颜色索引,seriesIndex索引到color + this._symbol = this.option.symbolList; + this._sIndex2ShapeMap = {}; // series图形类型,seriesIndex索引到_symbol + + this.selectedMap = {}; + this.xMarkMap = {}; + + var legend = this.component.legend; + var seriesArray = []; + var serie; // 临时映射变量 + var serieName; // 临时映射变量 + var iconShape; + var iconType; + for (var i = 0, l = series.length; i < l; i++) { + serie = series[i]; + serieName = serie.name; + if (serie.type === ecConfig.CHART_TYPE_SCATTER) { + series[i] = this.reformOption(series[i]); + this._sIndex2ShapeMap[i] = this.query(serie, 'symbol') + || this._symbol[i % this._symbol.length]; + if (legend){ + this.selectedMap[serieName] = legend.isSelected(serieName); + + this._sIndex2ColorMap[i] = zrColor.alpha(legend.getColor(serieName), 0.5); + + iconShape = legend.getItemShape(serieName); + if (iconShape) { + // 回调legend,换一个更形象的icon + var iconType = this._sIndex2ShapeMap[i]; + iconShape.style.brushType = iconType.match('empty') ? 'stroke' : 'both'; + iconType = iconType.replace('empty', '').toLowerCase(); + + if (iconType.match('rectangle')) { + iconShape.style.x += Math.round( + (iconShape.style.width - iconShape.style.height) / 2 + ); + iconShape.style.width = iconShape.style.height; + } + + if (iconType.match('star')) { + iconShape.style.n = (iconType.replace('star','') - 0) || 5; + iconType = 'star'; + } + + if (iconType.match('image')) { + iconShape.style.image = iconType.replace( + new RegExp('^image:\\/\\/'), '' + ); + iconShape.style.x += Math.round( + (iconShape.style.width - iconShape.style.height) / 2 + ); + iconShape.style.width = iconShape.style.height; + iconType = 'image'; + } + + iconShape.style.iconType = iconType; + legend.setItemShape(serieName, iconShape); + } + } + else { + this.selectedMap[serieName] = true; + this._sIndex2ColorMap[i] = this.zr.getColor(i); + } + + if (this.selectedMap[serieName]) { + seriesArray.push(i); + } + } + } + + this._buildSeries(seriesArray); + + this.addShapeList(); + }, + + /** + * 构建类目轴为水平方向的散点图系列 + */ + _buildSeries: function (seriesArray) { + if (seriesArray.length === 0) { + return; + } + var series = this.series; + var seriesIndex; + var serie; + var data; + var value; + var xAxis; + var yAxis; + + var pointList = {}; + var x; + var y; + for (var j = 0, k = seriesArray.length; j < k; j++) { + seriesIndex = seriesArray[j]; + serie = series[seriesIndex]; + if (serie.data.length === 0) { + continue; + } + + xAxis = this.component.xAxis.getAxis(serie.xAxisIndex || 0); + yAxis = this.component.yAxis.getAxis(serie.yAxisIndex || 0); + + pointList[seriesIndex] = []; + for (var i = 0, l = serie.data.length; i < l; i++) { + data = serie.data[i]; + value = data != null + ? (data.value != null + ? data.value + : data) + : '-'; + if (value === '-' || value.length < 2) { + // 数据格式不符 + continue; + } + x = xAxis.getCoord(value[0]); + y = yAxis.getCoord(value[1]); + pointList[seriesIndex].push([ + x, // 横坐标 + y, // 纵坐标 + i, // 数据index + data.name || '' // 名称 + ]); + + } + this.xMarkMap[seriesIndex] = this._markMap( + xAxis, yAxis, serie.data, pointList[seriesIndex] + ); + this.buildMark(seriesIndex); + } + + // console.log(pointList) + this._buildPointList(pointList); + }, + + _markMap: function (xAxis, yAxis, data, pointList) { + var xMarkMap = { + min0: Number.POSITIVE_INFINITY, + max0: Number.NEGATIVE_INFINITY, + sum0: 0, + counter0: 0, + average0: 0, + min1: Number.POSITIVE_INFINITY, + max1: Number.NEGATIVE_INFINITY, + sum1: 0, + counter1: 0, + average1: 0 + }; + var value; + for (var i = 0, l = pointList.length; i < l; i++) { + /** + x, // 横坐标 + y, // 纵坐标 + i, // 数据index + data.name || '' // 名称 + */ + value = data[pointList[i][2]].value || data[pointList[i][2]]; + // 横轴 + if (xMarkMap.min0 > value[0]) { + xMarkMap.min0 = value[0]; + xMarkMap.minY0 = pointList[i][1]; + xMarkMap.minX0 = pointList[i][0]; + } + if (xMarkMap.max0 < value[0]) { + xMarkMap.max0 = value[0]; + xMarkMap.maxY0 = pointList[i][1]; + xMarkMap.maxX0 = pointList[i][0]; + } + xMarkMap.sum0 += value[0]; + xMarkMap.counter0++; + + // 纵轴 + if (xMarkMap.min1 > value[1]) { + xMarkMap.min1 = value[1]; + xMarkMap.minY1 = pointList[i][1]; + xMarkMap.minX1 = pointList[i][0]; + } + if (xMarkMap.max1 < value[1]) { + xMarkMap.max1 = value[1]; + xMarkMap.maxY1 = pointList[i][1]; + xMarkMap.maxX1 = pointList[i][0]; + } + xMarkMap.sum1 += value[1]; + xMarkMap.counter1++; + } + + var gridX = this.component.grid.getX(); + var gridXend = this.component.grid.getXend(); + var gridY = this.component.grid.getY(); + var gridYend = this.component.grid.getYend(); + + xMarkMap.average0 = (xMarkMap.sum0 / xMarkMap.counter0).toFixed(2) - 0; + var x = xAxis.getCoord(xMarkMap.average0); + // 横轴平均纵向 + xMarkMap.averageLine0 = [ + [x, gridYend], + [x, gridY] + ]; + xMarkMap.minLine0 = [ + [xMarkMap.minX0, gridYend], + [xMarkMap.minX0, gridY] + ]; + xMarkMap.maxLine0 = [ + [xMarkMap.maxX0, gridYend], + [xMarkMap.maxX0, gridY] + ]; + + xMarkMap.average1 = (xMarkMap.sum1 / xMarkMap.counter1).toFixed(2) - 0; + var y = yAxis.getCoord(xMarkMap.average1); + // 纵轴平均横向 + xMarkMap.averageLine1 = [ + [gridX, y], + [gridXend, y] + ]; + xMarkMap.minLine1 = [ + [gridX, xMarkMap.minY1], + [gridXend, xMarkMap.minY1] + ]; + xMarkMap.maxLine1 = [ + [gridX, xMarkMap.maxY1], + [gridXend, xMarkMap.maxY1] + ]; + + return xMarkMap; + }, + + /** + * 生成折线和折线上的拐点 + */ + _buildPointList: function (pointList) { + var series = this.series; + var serie; + var seriesPL; + var singlePoint; + var shape; + for (var seriesIndex in pointList) { + serie = series[seriesIndex]; + seriesPL = pointList[seriesIndex]; + if (serie.large && serie.data.length > serie.largeThreshold) { + this.shapeList.push(this._getLargeSymbol( + seriesPL, + this.getItemStyleColor( + this.query( + serie, 'itemStyle.normal.color' + ), + seriesIndex, + -1 + ) || this._sIndex2ColorMap[seriesIndex] + )); + continue; + } + + /* + * pointlist=[ + * 0 x, + * 1 y, + * 2 数据index + * 3 名称 + * ] + */ + + for (var i = 0, l = seriesPL.length; i < l; i++) { + singlePoint = seriesPL[i]; + shape = this._getSymbol( + seriesIndex, // seriesIndex + singlePoint[2], // dataIndex + singlePoint[3], // name + singlePoint[0], // x + singlePoint[1] // y + ); + shape && this.shapeList.push(shape); + } + } + // console.log(this.shapeList) + }, + + /** + * 生成折线图上的拐点图形 + */ + _getSymbol: function (seriesIndex, dataIndex, name, x, y) { + var series = this.series; + var serie = series[seriesIndex]; + var data = serie.data[dataIndex]; + + var dataRange = this.component.dataRange; + var rangColor; + if (dataRange) { + rangColor = isNaN(data[2]) + ? this._sIndex2ColorMap[seriesIndex] + : dataRange.getColor(data[2]); + if (!rangColor) { + return null; + } + } + else { + rangColor = this._sIndex2ColorMap[seriesIndex]; + } + + var itemShape = this.getSymbolShape( + serie, seriesIndex, data, dataIndex, name, + x, y, + this._sIndex2ShapeMap[seriesIndex], + rangColor, + 'rgba(0,0,0,0)', + 'vertical' + ); + itemShape.zlevel = this._zlevelBase; + itemShape._main = true; + return itemShape; + }, + + _getLargeSymbol: function (pointList, nColor) { + return new SymbolShape({ + zlevel: this._zlevelBase, + _main: true, + hoverable: false, + style: { + pointList: pointList, + color: nColor, + strokeColor: nColor + }, + highlightStyle: { + pointList: [ ] + } + }); + }, + + // 位置转换 + getMarkCoord: function (seriesIndex, mpData) { + var serie = this.series[seriesIndex]; + var xMarkMap = this.xMarkMap[seriesIndex]; + var xAxis = this.component.xAxis.getAxis(serie.xAxisIndex); + var yAxis = this.component.yAxis.getAxis(serie.yAxisIndex); + var pos; + + if (mpData.type + && (mpData.type === 'max' || mpData.type === 'min' || mpData.type === 'average') + ) { + // 特殊值内置支持 + // 默认取纵值 + var valueIndex = mpData.valueIndex != null ? mpData.valueIndex : 1; + pos = [ + xMarkMap[mpData.type + 'X' + valueIndex], + xMarkMap[mpData.type + 'Y' + valueIndex], + xMarkMap[mpData.type + 'Line' + valueIndex], + xMarkMap[mpData.type + valueIndex] + ]; + } + else { + pos = [ + typeof mpData.xAxis != 'string' && xAxis.getCoordByIndex + ? xAxis.getCoordByIndex(mpData.xAxis || 0) + : xAxis.getCoord(mpData.xAxis || 0), + + typeof mpData.yAxis != 'string' && yAxis.getCoordByIndex + ? yAxis.getCoordByIndex(mpData.yAxis || 0) + : yAxis.getCoord(mpData.yAxis || 0) + ]; + } + + return pos; + }, + + /** + * 刷新 + */ + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + + this.backupShapeList(); + this._buildShape(); + }, + + /** + * 值域响应 + * @param {Object} param + * @param {Object} status + */ + ondataRange: function (param, status) { + if (this.component.dataRange) { + this.refresh(); + status.needRefresh = true; + } + return; + } + }; + + zrUtil.inherits(Scatter, ChartBase); + zrUtil.inherits(Scatter, ComponentBase); + + // 图表注册 + require('../chart').define('scatter', Scatter); + + return Scatter; +}); +/** + * echarts图表类:K线图 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/chart/k',['require','../component/base','./base','../util/shape/Candle','../component/axis','../component/grid','../component/dataZoom','../config','../util/ecData','zrender/tool/util','../chart'],function (require) { + var ComponentBase = require('../component/base'); + var ChartBase = require('./base'); + + // 图形依赖 + var CandleShape = require('../util/shape/Candle'); + // 组件依赖 + require('../component/axis'); + require('../component/grid'); + require('../component/dataZoom'); + + var ecConfig = require('../config'); + var ecData = require('../util/ecData'); + var zrUtil = require('zrender/tool/util'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} series 数据 + * @param {Object} component 组件 + */ + function K(ecTheme, messageCenter, zr, option, myChart){ + // 基类 + ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); + // 图表基类 + ChartBase.call(this); + + this.refresh(option); + } + + K.prototype = { + type: ecConfig.CHART_TYPE_K, + /** + * 绘制图形 + */ + _buildShape: function () { + var series = this.series; + this.selectedMap = {}; + + // 水平垂直双向series索引 ,position索引到seriesIndex + var _position2sIndexMap = { + top: [ ], + bottom: [ ] + }; + var xAxis; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type === ecConfig.CHART_TYPE_K) { + series[i] = this.reformOption(series[i]); + xAxis = this.component.xAxis.getAxis(series[i].xAxisIndex); + if (xAxis.type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + ) { + _position2sIndexMap[xAxis.getPosition()].push(i); + } + } + } + //console.log(_position2sIndexMap) + for (var position in _position2sIndexMap) { + if (_position2sIndexMap[position].length > 0) { + this._buildSinglePosition( + position, _position2sIndexMap[position] + ); + } + } + + this.addShapeList(); + }, + + /** + * 构建单个方向上的K线图 + * + * @param {number} seriesIndex 系列索引 + */ + _buildSinglePosition: function (position, seriesArray) { + var mapData = this._mapData(seriesArray); + var locationMap = mapData.locationMap; + var maxDataLength = mapData.maxDataLength; + + if (maxDataLength === 0 || locationMap.length === 0) { + return; + } + this._buildHorizontal(seriesArray, maxDataLength, locationMap); + + for (var i = 0, l = seriesArray.length; i < l; i++) { + this.buildMark(seriesArray[i]); + } + }, + + /** + * 数据整形 + * 数组位置映射到系列索引 + */ + _mapData: function (seriesArray) { + var series = this.series; + var serie; // 临时映射变量 + var serieName; // 临时映射变量 + var legend = this.component.legend; + var locationMap = []; // 需要返回的东西:数组位置映射到系列索引 + var maxDataLength = 0; // 需要返回的东西:最大数据长度 + // 计算需要显示的个数和分配位置并记在下面这个结构里 + for (var i = 0, l = seriesArray.length; i < l; i++) { + serie = series[seriesArray[i]]; + serieName = serie.name; + if (legend){ + this.selectedMap[serieName] = legend.isSelected(serieName); + } else { + this.selectedMap[serieName] = true; + } + + if (this.selectedMap[serieName]) { + locationMap.push(seriesArray[i]); + } + // 兼职帮算一下最大长度 + maxDataLength = Math.max(maxDataLength, serie.data.length); + } + return { + locationMap: locationMap, + maxDataLength: maxDataLength + }; + }, + + /** + * 构建类目轴为水平方向的K线图系列 + */ + _buildHorizontal: function (seriesArray, maxDataLength, locationMap) { + var series = this.series; + // 确定类目轴和数值轴,同一方向随便找一个即可 + var seriesIndex; + var serie; + var xAxisIndex; + var categoryAxis; + var yAxisIndex; // 数值轴各异 + var valueAxis; // 数值轴各异 + + var pointList = {}; + var candleWidth; + var data; + var value; + var barMaxWidth; + for (var j = 0, k = locationMap.length; j < k; j++) { + seriesIndex = locationMap[j]; + serie = series[seriesIndex]; + + xAxisIndex = serie.xAxisIndex || 0; + categoryAxis = this.component.xAxis.getAxis(xAxisIndex); + candleWidth = serie.barWidth + || Math.floor(categoryAxis.getGap() / 2); + barMaxWidth = serie.barMaxWidth; + if (barMaxWidth && barMaxWidth < candleWidth) { + candleWidth = barMaxWidth; + } + yAxisIndex = serie.yAxisIndex || 0; + valueAxis = this.component.yAxis.getAxis(yAxisIndex); + + pointList[seriesIndex] = []; + for (var i = 0, l = maxDataLength; i < l; i++) { + if (categoryAxis.getNameByIndex(i) == null) { + // 系列数据超出类目轴长度 + break; + } + + data = serie.data[i]; + value = data != null + ? (data.value != null + ? data.value + : data) + : '-'; + if (value === '-' || value.length != 4) { + // 数据格式不符 + continue; + } + pointList[seriesIndex].push([ + categoryAxis.getCoordByIndex(i), // 横坐标 + candleWidth, + valueAxis.getCoord(value[0]), // 纵坐标:开盘 + valueAxis.getCoord(value[1]), // 纵坐标:收盘 + valueAxis.getCoord(value[2]), // 纵坐标:最低 + valueAxis.getCoord(value[3]), // 纵坐标:最高 + i, // 数据index + categoryAxis.getNameByIndex(i) // 类目名称 + ]); + } + } + // console.log(pointList) + this._buildKLine(seriesArray, pointList); + }, + + /** + * 生成K线 + */ + _buildKLine: function (seriesArray, pointList) { + var series = this.series; + // normal: + var nLineWidth; + var nLineColor; + var nLineColor0; // 阴线 + var nColor; + var nColor0; // 阴线 + + // emphasis: + var eLineWidth; + var eLineColor; + var eLineColor0; + var eColor; + var eColor0; + + var serie; + var queryTarget; + var data; + var seriesPL; + var singlePoint; + var candleType; + + var seriesIndex; + for (var sIdx = 0, len = seriesArray.length; sIdx < len; sIdx++) { + seriesIndex = seriesArray[sIdx]; + serie = series[seriesIndex]; + seriesPL = pointList[seriesIndex]; + + if (this._isLarge(seriesPL)) { + seriesPL = this._getLargePointList(seriesPL); + } + + if (serie.type === ecConfig.CHART_TYPE_K && seriesPL != null) { + // 多级控制 + queryTarget = serie; + nLineWidth = this.query( + queryTarget, 'itemStyle.normal.lineStyle.width' + ); + nLineColor = this.query( + queryTarget, 'itemStyle.normal.lineStyle.color' + ); + nLineColor0 = this.query( + queryTarget, 'itemStyle.normal.lineStyle.color0' + ); + nColor = this.query( + queryTarget, 'itemStyle.normal.color' + ); + nColor0 = this.query( + queryTarget, 'itemStyle.normal.color0' + ); + + eLineWidth = this.query( + queryTarget, 'itemStyle.emphasis.lineStyle.width' + ); + eLineColor = this.query( + queryTarget, 'itemStyle.emphasis.lineStyle.color' + ); + eLineColor0 = this.query( + queryTarget, 'itemStyle.emphasis.lineStyle.color0' + ); + eColor = this.query( + queryTarget, 'itemStyle.emphasis.color' + ); + eColor0 = this.query( + queryTarget, 'itemStyle.emphasis.color0' + ); + + /* + * pointlist=[ + * 0 x, + * 1 width, + * 2 y0, + * 3 y1, + * 4 y2, + * 5 y3, + * 6 dataIndex, + * 7 categoryName + * ] + */ + for (var i = 0, l = seriesPL.length; i < l; i++) { + singlePoint = seriesPL[i]; + data = serie.data[singlePoint[6]]; + queryTarget = data; + candleType = singlePoint[3] < singlePoint[2]; + this.shapeList.push(this._getCandle( + seriesIndex, // seriesIndex + singlePoint[6], // dataIndex + singlePoint[7], // name + + singlePoint[0], // x + singlePoint[1], // width + singlePoint[2], // y开盘 + singlePoint[3], // y收盘 + singlePoint[4], // y最低 + singlePoint[5], // y最高 + + // 填充颜色 + candleType + ? (this.query( // 阳 + queryTarget, 'itemStyle.normal.color' + ) || nColor) + : (this.query( // 阴 + queryTarget, 'itemStyle.normal.color0' + ) || nColor0), + + // 线宽 + this.query( + queryTarget, 'itemStyle.normal.lineStyle.width' + ) || nLineWidth, + + // 线色 + candleType + ? (this.query( // 阳 + queryTarget, + 'itemStyle.normal.lineStyle.color' + ) || nLineColor) + : (this.query( // 阴 + queryTarget, + 'itemStyle.normal.lineStyle.color0' + ) || nLineColor0), + + //------------高亮 + + // 填充颜色 + candleType + ? (this.query( // 阳 + queryTarget, 'itemStyle.emphasis.color' + ) || eColor || nColor) + : (this.query( // 阴 + queryTarget, 'itemStyle.emphasis.color0' + ) || eColor0 || nColor0), + + // 线宽 + this.query( + queryTarget, 'itemStyle.emphasis.lineStyle.width' + ) || eLineWidth || nLineWidth, + + // 线色 + candleType + ? (this.query( // 阳 + queryTarget, + 'itemStyle.emphasis.lineStyle.color' + ) || eLineColor || nLineColor) + : (this.query( // 阴 + queryTarget, + 'itemStyle.emphasis.lineStyle.color0' + ) || eLineColor0 || nLineColor0) + )); + } + } + } + // console.log(this.shapeList) + }, + + _isLarge: function(singlePL) { + return singlePL[0][1] < 0.5; + }, + + /** + * 大规模pointList优化 + */ + _getLargePointList: function(singlePL) { + var total = this.component.grid.getWidth(); + var len = singlePL.length; + var newList = []; + for (var i = 0; i < total; i++) { + newList[i] = singlePL[Math.floor(len / total * i)]; + } + return newList; + }, + + /** + * 生成K线图上的图形 + */ + _getCandle: function ( + seriesIndex, dataIndex, name, + x, width, y0, y1, y2, y3, + nColor, nLinewidth, nLineColor, + eColor, eLinewidth, eLineColor + ) { + var series = this.series; + var itemShape = { + zlevel: this._zlevelBase, + clickable: this.deepQuery( + [series[seriesIndex].data[dataIndex], series[seriesIndex]], 'clickable' + ), + style: { + x: x, + y: [y0, y1, y2, y3], + width: width, + color: nColor, + strokeColor: nLineColor, + lineWidth: nLinewidth, + brushType: 'both' + }, + highlightStyle: { + color: eColor, + strokeColor: eLineColor, + lineWidth: eLinewidth + }, + _seriesIndex: seriesIndex + }; + ecData.pack( + itemShape, + series[seriesIndex], seriesIndex, + series[seriesIndex].data[dataIndex], dataIndex, + name + ); + + itemShape = new CandleShape(itemShape); + return itemShape; + }, + + // 位置转换 + getMarkCoord: function (seriesIndex, mpData) { + var serie = this.series[seriesIndex]; + var xAxis = this.component.xAxis.getAxis(serie.xAxisIndex); + var yAxis = this.component.yAxis.getAxis(serie.yAxisIndex); + + return [ + typeof mpData.xAxis != 'string' && xAxis.getCoordByIndex + ? xAxis.getCoordByIndex(mpData.xAxis || 0) + : xAxis.getCoord(mpData.xAxis || 0), + + typeof mpData.yAxis != 'string' && yAxis.getCoordByIndex + ? yAxis.getCoordByIndex(mpData.yAxis || 0) + : yAxis.getCoord(mpData.yAxis || 0) + ]; + }, + + /** + * 刷新 + */ + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + + this.backupShapeList(); + this._buildShape(); + }, + + /** + * 动画设定 + */ + addDataAnimation: function (params) { + var series = this.series; + var aniMap = {}; // seriesIndex索引参数 + for (var i = 0, l = params.length; i < l; i++) { + aniMap[params[i][0]] = params[i]; + } + var x; + var dx; + var y; + var serie; + var seriesIndex; + var dataIndex; + for (var i = 0, l = this.shapeList.length; i < l; i++) { + seriesIndex = this.shapeList[i]._seriesIndex; + if (aniMap[seriesIndex] && !aniMap[seriesIndex][3]) { + // 有数据删除才有移动的动画 + if (this.shapeList[i].type === 'candle') { + dataIndex = ecData.get(this.shapeList[i], 'dataIndex'); + serie = series[seriesIndex]; + if (aniMap[seriesIndex][2] + && dataIndex === serie.data.length - 1 + ) { + // 队头加入删除末尾 + this.zr.delShape(this.shapeList[i].id); + continue; + } + else if (!aniMap[seriesIndex][2] && dataIndex === 0) { + // 队尾加入删除头部 + this.zr.delShape(this.shapeList[i].id); + continue; + } + dx = this.component.xAxis.getAxis( + serie.xAxisIndex || 0 + ).getGap(); + x = aniMap[seriesIndex][2] ? dx : -dx; + y = 0; + this.zr.animate(this.shapeList[i].id, '') + .when( + 500, + { position: [ x, y ] } + ) + .start(); + } + } + } + } + }; + + zrUtil.inherits(K, ChartBase); + zrUtil.inherits(K, ComponentBase); + + // 图表注册 + require('../chart').define('k', K); + + return K; +}); +/** + * echarts坐标处理方法 + * + * @author Neil (杨骥, yangji01@baidu.com) + */ + +define( + 'echarts/util/coordinates',['require','zrender/tool/math'],function (require) { + var zrMath = require('zrender/tool/math'); + + /** + * 极坐标转直角坐标 + * + * @param {number} 半径 + * @param {number} 角度 + * + * @return {Array.} 直角坐标[x,y] + */ + function polar2cartesian(r, theta) { + return [r * zrMath.sin(theta), r*zrMath.cos(theta)]; + } + + /** + * 直角坐标转极坐标 + * + * @param {number} 横坐标 + * @param {number} 纵坐标 + * + * @return {Array.} 极坐标[r,theta] + */ + function cartesian2polar(x, y) { + return [Math.sqrt(x * x + y * y), Math.atan(y / x)]; + } + + return { + polar2cartesian : polar2cartesian, + cartesian2polar : cartesian2polar + }; + } +); +/** + * echarts组件类:极坐标 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Neil (杨骥, yangji01@baidu.com) + * + */ +define('echarts/component/polar',['require','./base','zrender/shape/Text','zrender/shape/Line','zrender/shape/Polygon','zrender/shape/Circle','zrender/shape/Ring','../config','zrender/tool/util','../util/coordinates','../component'],function (require) { + var Base = require('./base'); + + // 图形依赖 + var TextShape = require('zrender/shape/Text'); + var LineShape = require('zrender/shape/Line'); + var PolygonShape = require('zrender/shape/Polygon'); + var Circle = require('zrender/shape/Circle'); + var Ring = require('zrender/shape/Ring'); + + var ecConfig = require('../config'); + var zrUtil = require('zrender/tool/util'); + var ecCoordinates = require('../util/coordinates'); + + function Polar(ecTheme, messageCenter, zr, option, myChart) { + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + + this.refresh(option); + } + + Polar.prototype = { + type : ecConfig.COMPONENT_TYPE_POLAR, + + /** + * 绘制图形 + */ + _buildShape : function () { + for (var i = 0; i < this.polar.length; i ++) { + this._index = i; + this.reformOption(this.polar[i]); + + this._queryTarget = [this.polar[i], this.option]; + this._createVector(i); + this._buildSpiderWeb(i); + + this._buildText(i); + + this._adjustIndicatorValue(i); + this._addAxisLabel(i); + } + + for (var i = 0; i < this.shapeList.length; i ++) { + this.zr.addShape(this.shapeList[i]); + } + }, + + /** + * 生成蜘蛛网顶点坐标 + * @param {number} polar的index + */ + _createVector : function (index) { + var item = this.polar[index]; + var indicator = this.deepQuery(this._queryTarget, 'indicator'); + var length = indicator.length; + var startAngle = item.startAngle ; + var dStep = 2 * Math.PI / length; + var radius = this._getRadius(); + var __ecIndicator = item.__ecIndicator = []; + var vector; + + for (var i = 0 ;i < length ; i ++) { + vector = ecCoordinates.polar2cartesian( + radius, startAngle * Math.PI / 180 + dStep * i + ); + __ecIndicator.push({ + // 将图形翻转 + vector : [vector[1], -vector[0]] + }); + } + }, + + /** + * 获取外圈的半径 + * + * @return {number} + */ + _getRadius : function () { + var item = this.polar[this._index]; + return this.parsePercent( + item.radius, + Math.min(this.zr.getWidth(), this.zr.getHeight()) / 2 + ); + }, + + /** + * 构建蜘蛛网 + * @param {number} polar的index + */ + _buildSpiderWeb : function (index) { + var item = this.polar[index]; + var __ecIndicator = item.__ecIndicator; + var splitArea = item.splitArea; + var splitLine = item.splitLine; + + var center = this.getCenter(index); + var splitNumber = item.splitNumber; + + var strokeColor = splitLine.lineStyle.color; + var lineWidth = splitLine.lineStyle.width; + var show = splitLine.show; + + var axisLine = this.deepQuery(this._queryTarget, 'axisLine'); + + this._addArea( + __ecIndicator, splitNumber, center, + splitArea, strokeColor, lineWidth, show + ); + + axisLine.show && this._addLine( + __ecIndicator, center, axisLine + ); + }, + + /** + * 绘制axisLabel + */ + _addAxisLabel : function (index) { + var item = this.polar[index]; + var indicator = this.deepQuery(this._queryTarget, 'indicator'); + var __ecIndicator = item.__ecIndicator; + var axisLabel; + var vector; + var style; + var newStyle; + var splitNumber = this.deepQuery(this._queryTarget, 'splitNumber'); + var center = this.getCenter(index); + var vector; + var value; + var text; + var theta; + // var startAngle = this.deepQuery(this._queryTarget, 'startAngle'); + var offset; + var precision = this.deepQuery(this._queryTarget, 'precision'); + var interval; + + for (var i = 0; i < indicator.length; i ++) { + axisLabel = this.deepQuery( + [indicator[i], item, this.option], 'axisLabel' + ); + + if (axisLabel.show) { + style = {}; + style.textFont = this.getFont(); + + style = zrUtil.merge(style, axisLabel); + style.lineWidth = style.width; + + vector = __ecIndicator[i].vector; + value = __ecIndicator[i].value; + theta = i / indicator.length * 2 * Math.PI; + offset = axisLabel.offset || 10; + interval = axisLabel.interval || 0; + + if (!value) { + return; + } + + for (var j = 1 ; j <= splitNumber; j += interval + 1) { + newStyle = zrUtil.merge({}, style); + text = + j * (value.max - value.min) / splitNumber + + value.min; + if (precision) { + text = text.toFixed(precision); + } + newStyle.text = this.numAddCommas(text); + newStyle.x = j * vector[0] / splitNumber + + Math.cos(theta) * offset + center[0]; + newStyle.y = j * vector[1] / splitNumber + + Math.sin(theta) * offset + center[1]; + + this.shapeList.push(new TextShape({ + zlevel : this._zlevelBase, + style : newStyle, + draggable : false, + hoverable : false + })); + } + } + } + }, + + /** + * 绘制坐标头的文字 + * @param {number} polar的index + */ + _buildText : function (index) { + var item = this.polar[index]; + var __ecIndicator = item.__ecIndicator; + var vector; + var indicator = this.deepQuery(this._queryTarget, 'indicator'); + var center = this.getCenter(index); + var style; + var textAlign; + var name; + var rotation; + var x = 0; + var y = 0; + var margin; + var textStyle; + + for (var i = 0; i < indicator.length; i ++) { + name = this.deepQuery( + [indicator[i], item, this.option], 'name' + ); + + if (!name.show) { + continue; + } + textStyle = this.deepQuery( + [name, item, this.option], + 'textStyle' + ); + + style = {}; + + style.textFont = this.getFont(textStyle); + style.color = textStyle.color; + + if (typeof name.formatter == 'function') { + style.text = name.formatter.call(this.myChart, indicator[i].text, i); + } + else if (typeof name.formatter == 'string'){ + style.text = name.formatter.replace( + '{value}', indicator[i].text + ); + } + else { + style.text = indicator[i].text; + } + __ecIndicator[i].text = style.text; + + vector = __ecIndicator[i].vector; + + if (Math.round(vector[0]) > 0) { + textAlign = 'left'; + } + else if (Math.round(vector[0]) < 0) { + textAlign = 'right'; + } + else { + textAlign = 'center'; + } + + if (!name.margin) { + vector = this._mapVector(vector, center, 1.2); + } + else { + margin = name.margin; + x = vector[0] > 0 ? margin : - margin; + y = vector[1] > 0 ? margin : - margin; + + x = vector[0] === 0 ? 0 : x; + y = vector[1] === 0 ? 0 : y; + vector = this._mapVector(vector, center, 1); + } + + + style.textAlign = textAlign; + style.x = vector[0] + x; + style.y = vector[1] + y; + + if (name.rotate) { + rotation = [ + name.rotate / 180 * Math.PI, + vector[0], vector[1] + ]; + } + else { + rotation = [0, 0, 0]; + } + + this.shapeList.push(new TextShape({ + zlevel : this._zlevelBase, + style : style, + draggable : false, + hoverable : false, + rotation : rotation + })); + } + }, + + getIndicatorText : function(polarIndex, indicatorIndex) { + return this.polar[polarIndex] + && this.polar[polarIndex].__ecIndicator[indicatorIndex] + && this.polar[polarIndex].__ecIndicator[indicatorIndex].text; + }, + + /** + * 添加一个隐形的盒子 当做drop的容器 暴露给外部的图形类使用 + * @param {number} polar的index + * @return {Object} 添加的盒子图形 + */ + getDropBox : function (index) { + var index = index || 0; + var item = this.polar[index]; + var center = this.getCenter(index); + var __ecIndicator = item.__ecIndicator; + var len = __ecIndicator.length; + var pointList = []; + var vector; + var shape; + var type = item.type; + + if (type == 'polygon') { + for (var i = 0; i < len; i ++) { + vector = __ecIndicator[i].vector; + pointList.push(this._mapVector(vector, center, 1.2)); + } + shape = this._getShape( + pointList, 'fill', 'rgba(0,0,0,0)', '', 1 + ); + } else if (type == 'circle') { + shape = this._getCircle( + '', 1, 1.2, center, 'fill', 'rgba(0,0,0,0)' + ); + } + + return shape; + }, + + /** + * 绘制蜘蛛网的正n变形 + * + * @param {Array} 指标数组 + * @param {number} 分割线数量 + * @param {Array} 中点坐标 + * @param {Object} 分割区域对象 + * @param {string} 线条颜色 + * @param {number} 线条宽度 + */ + _addArea : function ( + __ecIndicator, splitNumber, center, + splitArea, strokeColor, lineWidth, show + ) { + var shape; + var scale; + var scale1; + var pointList; + var type = this.deepQuery(this._queryTarget, 'type'); + + for (var i = 0; i < splitNumber ; i ++ ) { + scale = (splitNumber - i) / splitNumber; + + if (show) { + if (type == 'polygon') { + pointList = this._getPointList( + __ecIndicator, scale, center); + shape = this._getShape( + pointList, 'stroke', '', strokeColor, lineWidth + ); + } else if (type == 'circle') { + shape = this._getCircle( + strokeColor, lineWidth, scale, center, 'stroke' + ); + } + + this.shapeList.push(shape); + } + + if (splitArea.show) { + scale1 = (splitNumber - i - 1) / splitNumber; + this._addSplitArea( + __ecIndicator, splitArea, scale, scale1, center, i + ); + } + } + }, + + /** + * 绘制圆 + * + * @param {string} strokeColor + * @param {number} lineWidth + * @param {number} scale + * @param {Array.} center + * @param {string} brushType + * @param {string} color + * @return {Circle} + */ + _getCircle : function ( + strokeColor, lineWidth, scale, center, brushType, color + ) { + var radius = this._getRadius(); + return new Circle({ + zlevel : this._zlevelBase, + style: { + x: center[0], + y: center[1], + r: radius * scale, + brushType: brushType, + strokeColor: strokeColor, + lineWidth: lineWidth, + color: color + }, + hoverable : false, + draggable : false + }); + }, + + /** + * 绘制圆环 + * + * @param {string} color 间隔颜色 + * @param {number} scale0 小圆的scale + * @param {number} scale1 大圆的scale + * @param {Array.} center 圆点 + * @return {Ring} + */ + _getRing : function (color, scale0, scale1, center) { + var radius = this._getRadius(); + return new Ring({ + zlevel : this._zlevelBase, + style : { + x : center[0], + y : center[1], + r : scale0 * radius, + r0 : scale1 * radius, + color : color, + brushType : 'fill' + }, + hoverable : false, + draggable : false + }); + }, + + /** + * 获取需要绘制的多边形的点集 + * @param {Object} serie的指标参数 + * @param {number} 缩小的系数 + * @param {Array} 中点坐标 + * + * @return {Array>} 返回绘制的点集 + */ + _getPointList : function (__ecIndicator, scale, center) { + var pointList = []; + var len = __ecIndicator.length; + var vector; + + for (var i = 0 ; i < len ; i ++ ) { + vector = __ecIndicator[i].vector; + + pointList.push(this._mapVector(vector, center, scale)); + } + return pointList; + }, + + /** + * 获取绘制的图形 + * @param {Array>} 绘制的点集 + * @param {string} 绘制方式 stroke | fill | both 描边 | 填充 | 描边 + 填充 + * @param {string} 颜色 + * @param {string} 描边颜色 + * @param {number} 线条宽度 + * @return {Object} 绘制的图形对象 + */ + _getShape : function ( + pointList, brushType, color, strokeColor, lineWidth + ) { + return new PolygonShape({ + zlevel : this._zlevelBase, + style : { + pointList : pointList, + brushType : brushType, + color : color, + strokeColor : strokeColor, + lineWidth : lineWidth + }, + hoverable : false, + draggable : false + }); + }, + + /** + * 绘制填充区域 + */ + _addSplitArea : function ( + __ecIndicator, splitArea, scale, scale1, center, colorInd + ) { + var indLen = __ecIndicator.length; + var color; + var colorArr = splitArea.areaStyle.color; + var colorLen; + + var vector; + var vector1; + var pointList = []; + var indLen = __ecIndicator.length; + var shape; + + var type = this.deepQuery(this._queryTarget, 'type'); + + if (typeof colorArr == 'string') { + colorArr = [colorArr]; + } + colorLen = colorArr.length; + color = colorArr[ colorInd % colorLen]; + + if (type == 'polygon') { + for (var i = 0; i < indLen ; i ++) { + pointList = []; + vector = __ecIndicator[i].vector; + vector1 = __ecIndicator[(i + 1) % indLen].vector; + + pointList.push(this._mapVector(vector, center, scale)); + pointList.push(this._mapVector(vector, center, scale1)); + pointList.push(this._mapVector(vector1, center, scale1)); + pointList.push(this._mapVector(vector1, center, scale)); + + shape = this._getShape( + pointList, 'fill', color, '', 1 + ); + this.shapeList.push(shape); + } + } else if (type == 'circle') { + shape = this._getRing(color, scale, scale1, center); + this.shapeList.push(shape); + } + }, + + /** + * 转换坐标 + * + * @param {Array} 原始坐标 + * @param {Array} 中点坐标 + * @param {number} 缩小的倍数 + * + * @return {Array} 转换后的坐标 + */ + _mapVector : function (vector, center, scale) { + return [ + vector[0] * scale + center[0], + vector[1] * scale + center[1] + ]; + }, + + /** + * 获取中心点位置 暴露给外部图形类使用 + * @param {number} polar的index + */ + getCenter : function (index) { + var index = index || 0; + return this.parseCenter(this.zr, this.polar[index].center); + }, + + /** + * 绘制从中点出发的线 + * + * @param {Array} 指标对象 + * @param {Array} 中点坐标 + * @param {string} 线条颜色 + * @param {number} 线条宽度 + * @param {string} 线条绘制类型 + * solid | dotted | dashed 实线 | 点线 | 虚线 + */ + _addLine : function ( + __ecIndicator, center, axisLine + ) { + var indLen = __ecIndicator.length; + var line; + var vector; + var lineStyle = axisLine.lineStyle; + var strokeColor = lineStyle.color; + var lineWidth = lineStyle.width; + var lineType = lineStyle.type; + + for (var i = 0; i < indLen ; i ++ ) { + vector = __ecIndicator[i].vector; + line = this._getLine( + center[0], center[1], + vector[0] + center[0], + vector[1] + center[1], + strokeColor, lineWidth, lineType + ); + this.shapeList.push(line); + } + }, + + /** + * 获取线条对象 + * @param {number} 出发点横坐标 + * @param {number} 出发点纵坐标 + * @param {number} 终点横坐标 + * @param {number} 终点纵坐标 + * @param {string} 线条颜色 + * @param {number} 线条宽度 + * @param {string} 线条类型 + * + * @return {Object} 线条对象 + */ + _getLine : function ( + xStart, yStart, xEnd, yEnd, strokeColor, lineWidth, lineType + ) { + return new LineShape({ + zlevel : this._zlevelBase, + style : { + xStart : xStart, + yStart : yStart, + xEnd : xEnd, + yEnd : yEnd, + strokeColor : strokeColor, + lineWidth : lineWidth, + lineType : lineType + }, + hoverable : false + }); + }, + + /** + * 调整指标的值,当indicator中存在max时设置为固定值 + * @param {number} polar的index + */ + _adjustIndicatorValue : function (index) { + var item = this.polar[index]; + var indicator = this.deepQuery(this._queryTarget, 'indicator'); + var len = indicator.length; + var __ecIndicator = item.__ecIndicator; + var value; + var max; + var min; + var data = this._getSeriesData(index); + var splitNumber = item.splitNumber; + + var boundaryGap = this.deepQuery(this._queryTarget, 'boundaryGap'); + var precision = this.deepQuery(this._queryTarget, 'precision'); + var power = this.deepQuery(this._queryTarget, 'power'); + var scale = this.deepQuery(this._queryTarget, 'scale'); + + for (var i = 0; i < len ; i ++ ) { + if (typeof indicator[i].max == 'number') { + max = indicator[i].max; + min = indicator[i].min || 0; + value = { + max : max, + min : min + }; + } + else { + value = this._findValue( + data, i, splitNumber, + boundaryGap, precision, power, scale + ); + } + + __ecIndicator[i].value = value; + } + }, + + /** + * 将series中的数据拿出来,如果没有polarIndex属性,默认为零 + * @param {number} polar 的index + * @param {Array} 需要处理的数据 + */ + _getSeriesData : function (index) { + var data = []; + var serie; + var serieData; + var legend = this.component.legend; + var polarIndex; + + for (var i = 0; i < this.series.length; i ++) { + serie = this.series[i]; + if (serie.type != ecConfig.CHART_TYPE_RADAR) { + continue; + } + serieData = serie.data || []; + for (var j = 0; j < serieData.length; j ++) { + polarIndex = this.deepQuery( + [serieData[j], serie, this.option], 'polarIndex' + ) || 0; + if (polarIndex == index + && (!legend || legend.isSelected(serieData[j].name)) + ) { + data.push(serieData[j]); + } + } + } + return data; + }, + + /** + * 查找指标合适的值 + * + * 如果只有一组数据以数据中的最大值作为最大值 0为最小值 + * 如果是多组,使用同一维度的进行比较 选出最大值最小值 + * 对它们进行处理 + * @param {Object} serie 的 data + * @param {number} 指标的序号 + * @param {boolean} boundaryGap 两端留白 + * @param {number} precision 小数精度 + * @param {number} power 整数精度 + * @return {Object} 指标的最大值最小值 + */ + _findValue : function ( + data, index, splitNumber, boundaryGap, precision, power, scale + ) { + var max; + var min; + var value; + var delta; + var str; + var len = 0; + var max0; + var min0; + var one; + + if (!data || data.length === 0) { + return; + } + + function _compare(item) { + (item > max || max === undefined) && (max = item); + (item < min || min === undefined) && (min = item); + } + + if (data.length == 1) { + min = 0; + } + if (data.length != 1) { + for (var i = 0; i < data.length; i ++) { + value = typeof data[i].value[index].value != 'undefined' + ? data[i].value[index].value : data[i].value[index]; + _compare(value); + } + } + else { + one = data[0]; + for (var i = 0; i < one.value.length; i ++) { + _compare( + typeof one.value[i].value != 'undefined' + ? one.value[i].value : one.value[i] + ); + } + } + + if (data.length != 1) { + if (scale) { + delta = this._getDelta( + max, min, splitNumber, precision, power + ); + + if (delta >= 1) { + min = Math.floor(min / delta) * delta - delta; + } + else if (delta === 0) { + if (max > 0) { + min0 = 0; + max0 = 2 * max; + } + else if (max === 0) { + min0 = 0; + max0 = 100; + } + else { + max0 = 0; + min0 = 2 * min; + } + + return { + max : max0, + min : min0 + }; + } + else { + str = (delta + '').split('.')[1]; + len = str.length; + min = Math.floor( + min * Math.pow(10, len)) / Math.pow(10, len + ) - delta; + } + + if (Math.abs(min) <= delta) { + min = 0; + } + + max = min + Math.floor(delta * Math.pow(10, len) + * (splitNumber + 1)) / Math.pow(10, len) ; + } + else { + min = min > 0 ? 0 : min; + } + } + + if (boundaryGap) { + max = max > 0 ? max * 1.2 : max * 0.8; + min = min > 0 ? min * 0.8 : min * 1.2; + } + + return { + max : max, + min : min + }; + }, + + /** + * 获取最大值与最小值中间比较合适的差值 + * @param {number} max; + * @param {number} min + * @param {number} precision 小数精度 + * @param {number} power 整数精度 + * @return {number} delta + */ + _getDelta : function (max , min, splitNumber, precision, power) { + var delta = (max - min) / splitNumber; + var str; + var n; + + if (delta > 1) { + if (!power) { + str = (delta + '').split('.')[0]; + n = str.length; + if (str.charAt(0) >= 5) { + return Math.pow(10, n); + } + else { + return (str.charAt(0) - 0 + 1 ) * Math.pow(10, n - 1); + } + } + else { + delta = Math.ceil(delta); + if (delta % power > 0) { + return (Math.ceil(delta / power) + 1) * power; + } + else { + return delta; + } + } + } + else if (delta == 1) { + return 1; + } + else if (delta === 0) { + return 0; + } + else { + if (!precision) { + str = (delta + '').split('.')[1]; + n = 0; + while (str[n] == '0') { + n ++ ; + } + + if (str[n] >= 5) { + return '0.' + str.substring(0, n + 1) - 0 + + 1 / Math.pow(10, n); + } + else { + return '0.' + str.substring(0, n + 1) - 0 + + 1 / Math.pow(10, n + 1); + } + } + else { + return Math.ceil(delta * Math.pow(10, precision)) + / Math.pow(10, precision); + } + } + }, + + /** + * 获取每个指标上某个value对应的坐标 + * @param {number} polarIndex + * @param {number} indicatorIndex + * @param {number} value + * @return {Array} 对应坐标 + */ + getVector : function (polarIndex, indicatorIndex, value) { + polarIndex = polarIndex || 0; + indicatorIndex = indicatorIndex || 0; + var __ecIndicator = this.polar[polarIndex].__ecIndicator; + + if (indicatorIndex >= __ecIndicator.length) { + return ; + } + + var indicator = this.polar[polarIndex].__ecIndicator[indicatorIndex]; + var center = this.getCenter(polarIndex); + var vector = indicator.vector; + var max = indicator.value.max; + var min = indicator.value.min; + var alpha; + + if (typeof value == 'undefined') { + return center; + } + + switch (value) { + case 'min' : + value = min; + break; + case 'max' : + value = max; + break; + case 'center' : + value = (max + min) / 2; + break; + } + + if (max != min) { + alpha = (value - min) / (max - min); + } + else { + alpha = 0.5; + } + + return this._mapVector(vector, center, alpha); + }, + + /** + * 判断一个点是否在网内 + * @param {Array} 坐标 + * @return {number} 返回polarindex 返回-1表示不在任何polar + */ + isInside : function (vector) { + var polar = this.getNearestIndex(vector); + + if (polar) { + return polar.polarIndex; + } + return -1; + }, + + /** + * 如果一个点在网内,返回离它最近的数据轴的index + * @param {Array} 坐标 + * @return {Object} | false + * polarIndex + * valueIndex + */ + getNearestIndex : function (vector) { + var item; + var center; + var radius; + var polarVector; + var startAngle; + var indicator; + var len; + var angle; + var finalAngle; + for (var i = 0 ; i < this.polar.length; i ++) { + item = this.polar[i]; + center = this.getCenter(i); + if (vector[0] == center[0] && vector[1] == center[1]) { + return { + polarIndex : i, + valueIndex : 0 + }; + } + radius = this._getRadius(); + startAngle = item.startAngle; + indicator = item.indicator; + len = indicator.length; + angle = 2 * Math.PI / len; + // 注意y轴的翻转 + polarVector = ecCoordinates.cartesian2polar( + vector[0] - center[0], center[1] - vector[1] + ); + if (vector[0] - center[0] < 0) { + polarVector[1] += Math.PI; + } + if (polarVector[1] < 0) { + polarVector[1] += 2 * Math.PI; + } + + + // 减去startAngle的偏移量 再加2PI变成正数 + finalAngle = polarVector[1] - + startAngle / 180 * Math.PI + Math.PI * 2; + + if (Math.abs(Math.cos(finalAngle % (angle / 2))) * radius + > polarVector[0]) + { + return { + polarIndex : i, + valueIndex : Math.floor( + (finalAngle + angle / 2 ) / angle + ) % len + }; + } + } + }, + + /** + * 获取指标信息 + * @param {number} polarIndex + * @return {Array} indicator + */ + getIndicator : function (index) { + var index = index || 0; + return this.polar[index].indicator; + }, + + /** + * 刷新 + */ + refresh : function (newOption) { + if (newOption) { + this.option = newOption; + this.polar = this.option.polar; + this.series = this.option.series; + } + this.clear(); + this._buildShape(); + } + }; + + zrUtil.inherits(Polar, Base); + + require('../component').define('polar', Polar); + + return Polar; +}); +/** + * echarts图表类:雷达图 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Neil (杨骥, yangji01@baidu.com) + */ + + define('echarts/chart/radar',['require','../component/base','./base','zrender/shape/Polygon','../component/polar','../config','../util/ecData','zrender/tool/util','zrender/tool/color','../util/accMath','../chart'],function (require) { + var ComponentBase = require('../component/base'); + var ChartBase = require('./base'); + + // 图形依赖 + var PolygonShape = require('zrender/shape/Polygon'); + // 组件依赖 + require('../component/polar'); + + var ecConfig = require('../config'); + var ecData = require('../util/ecData'); + var zrUtil = require('zrender/tool/util'); + var zrColor = require('zrender/tool/color'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} series 数据 + * @param {Object} component 组件 + * @constructor + * @exports Radar + */ + function Radar(ecTheme, messageCenter, zr, option, myChart) { + // 基类 + ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); + // 图表基类 + ChartBase.call(this); + + this.refresh(option); + } + + Radar.prototype = { + type : ecConfig.CHART_TYPE_RADAR, + /** + * 绘制图形 + */ + _buildShape : function () { + this.selectedMap = {}; + this._symbol = this.option.symbolList; + this._queryTarget; + this._dropBoxList = []; + this._radarDataCounter = 0; + + var series = this.series; + var legend = this.component.legend; + var serieName; + for (var i = 0, l = series.length; i < l ; i++) { + if (series[i].type === ecConfig.CHART_TYPE_RADAR) { + this.serie = this.reformOption(series[i]); + serieName = this.serie.name || ''; + // 系列图例开关 + this.selectedMap[serieName] = + legend ? legend.isSelected(serieName) : true; + + if (this.selectedMap[serieName]) { + this._queryTarget = [this.serie, this.option]; + + // 添加可拖拽提示框,多系列共用一个极坐标,第一个优先 + if (this.deepQuery(this._queryTarget, 'calculable')) { + this._addDropBox(i); + } + this._buildSingleRadar(i); + this.buildMark(i); + } + } + } + + this.addShapeList(); + }, + + /** + * 构建数据图形 + * @param {number} 序列的index + */ + _buildSingleRadar : function (index) { + var legend = this.component.legend; + var iconShape; + var data = this.serie.data; + var defaultColor; + var name; + var pointList; + var calculable = this.deepQuery(this._queryTarget, 'calculable'); + + for (var i = 0; i < data.length; i++) { + name = data[i].name || ''; + + // 图例开关 + this.selectedMap[name] = legend + ? legend.isSelected(name) : true; + if (!this.selectedMap[name]) { + continue; + } + + // 默认颜色策略 + if (legend) { + // 有图例则从图例中获取颜色定义 + defaultColor = legend.getColor(name); + iconShape = legend.getItemShape(name); + if (iconShape) { + // 回调legend,换一个更形象的icon + iconShape.style.brushType = this.deepQuery( + [data[i], this.serie], 'itemStyle.normal.areaStyle' + ) ? 'both' : 'stroke'; + legend.setItemShape(name, iconShape); + } + } + else { + // 全局颜色定义 + defaultColor = this.zr.getColor(i); + } + + pointList = this._getPointList(this.serie.polarIndex, data[i]); + // 添加拐点形状 + this._addSymbol( + pointList, defaultColor, i, index, this.serie.polarIndex); + // 添加数据形状 + this._addDataShape( + pointList, defaultColor, data[i], + index, i, calculable + ); + this._radarDataCounter++; + } + }, + + /** + * 获取数据的点集 + * @param {number} polarIndex + * @param {Array} 处理的数据 + * @return {Array>} 点集 + */ + _getPointList : function (polarIndex, dataArr) { + var pointList = []; + var vector; + var polar = this.component.polar; + + for (var i = 0, l = dataArr.value.length; i < l; i++) { + vector = polar.getVector( + polarIndex, + i, + typeof dataArr.value[i].value != 'undefined' + ? dataArr.value[i].value : dataArr.value[i] + ); + if (vector) { + pointList.push(vector); + } + } + return pointList; + }, + + /** + * 添加拐点 + * @param {Array>} pointList 点集 + * @param {string} defaultColor 默认填充颜色 + * @param {object} data 数据 + * @param {number} serieIndex + */ + _addSymbol :function (pointList, defaultColor, dataIndex, seriesIndex, polarIndex) { + var series = this.series; + var itemShape; + var polar = this.component.polar; + + for (var i = 0, l = pointList.length; i < l; i++) { + itemShape = this.getSymbolShape( + this.deepMerge( + [series[seriesIndex].data[dataIndex], series[seriesIndex]] + ), + seriesIndex, + series[seriesIndex].data[dataIndex].value[i], i, + polar.getIndicatorText(polarIndex, i), + pointList[i][0], // x + pointList[i][1], // y + this._symbol[this._radarDataCounter % this._symbol.length], + defaultColor, + '#fff', + 'vertical' + ); + itemShape.zlevel = this._zlevelBase + 1; + ecData.set(itemShape, 'data', series[seriesIndex].data[dataIndex]); + ecData.set(itemShape, 'value', series[seriesIndex].data[dataIndex].value); + ecData.set(itemShape, 'dataIndex', dataIndex); + ecData.set(itemShape, 'special', i); + this.shapeList.push(itemShape); + } + }, + + /** + * 添加数据图形 + * @param {Array>} pointList 点集 + * @param {string} defaultColor 默认填充颜色 + * @param {object} data 数据 + * @param {number} serieIndex + * @param {number} dataIndex + * @param {boolean} calcalable + */ + _addDataShape : function ( + pointList, defaultColor, data, + seriesIndex, dataIndex, calculable + ) { + var series = this.series; + // 多级控制 + var queryTarget = [data, this.serie]; + var nColor = this.getItemStyleColor( + this.deepQuery( + queryTarget, 'itemStyle.normal.color' + ), + seriesIndex, + dataIndex, + data + ); + var nLineWidth = this.deepQuery( + queryTarget, 'itemStyle.normal.lineStyle.width' + ); + var nLineType = this.deepQuery( + queryTarget, 'itemStyle.normal.lineStyle.type' + ); + var nAreaColor = this.deepQuery( + queryTarget, 'itemStyle.normal.areaStyle.color' + ); + var nIsAreaFill = this.deepQuery( + queryTarget, 'itemStyle.normal.areaStyle' + ); + var shape = { + zlevel : this._zlevelBase, + style : { + pointList : pointList, + brushType : nIsAreaFill ? 'both' : 'stroke', + color : nAreaColor + || nColor + || (typeof defaultColor === 'string' + ? zrColor.alpha(defaultColor,0.5) : defaultColor), + strokeColor : nColor || defaultColor, + lineWidth : nLineWidth, + lineType : nLineType + }, + highlightStyle : { + brushType : this.deepQuery( + queryTarget, + 'itemStyle.emphasis.areaStyle' + ) || nIsAreaFill + ? 'both' : 'stroke', + color : this.deepQuery( + queryTarget, + 'itemStyle.emphasis.areaStyle.color' + ) + || nAreaColor + || nColor + || (typeof defaultColor === 'string' + ? zrColor.alpha(defaultColor,0.5) : defaultColor), + strokeColor : this.getItemStyleColor( + this.deepQuery( + queryTarget, 'itemStyle.emphasis.color' + ), + seriesIndex, + dataIndex, + data + ) + || nColor || defaultColor, + lineWidth : this.deepQuery( + queryTarget, + 'itemStyle.emphasis.lineStyle.width' + ) || nLineWidth, + lineType : this.deepQuery( + queryTarget, + 'itemStyle.emphasis.lineStyle.type' + ) || nLineType + } + }; + ecData.pack( + shape, + series[seriesIndex], // 系列 + seriesIndex, // 系列索引 + data, // 数据 + dataIndex, // 数据索引 + data.name, // 数据名称 + // 附加指标信息 + this.component.polar.getIndicator(series[seriesIndex].polarIndex) + ); + if (calculable) { + shape.draggable = true; + this.setCalculable(shape); + } + + shape = new PolygonShape(shape); + this.shapeList.push(shape); + }, + + /** + * 增加外围接受框 + * @param {number} serie的序列 + */ + _addDropBox : function (index) { + var series = this.series; + var polarIndex = this.deepQuery( + this._queryTarget, 'polarIndex' + ); + if (!this._dropBoxList[polarIndex]) { + var shape = this.component.polar.getDropBox(polarIndex); + shape.zlevel = this._zlevelBase; + this.setCalculable(shape); + ecData.pack(shape, series, index, undefined, -1); + this.shapeList.push(shape); + this._dropBoxList[polarIndex] = true; + } + }, + + /** + * 数据项被拖拽出去,重载基类方法 + */ + ondragend : function (param, status) { + var series = this.series; + if (!this.isDragend || !param.target) { + // 没有在当前实例上发生拖拽行为则直接返回 + return; + } + + // 被拖拽图形元素 + var target = param.target; + + var seriesIndex = ecData.get(target, 'seriesIndex'); + var dataIndex = ecData.get(target, 'dataIndex'); + + // 被拖拽的图形是饼图sector,删除被拖拽走的数据 + this.component.legend && this.component.legend.del( + series[seriesIndex].data[dataIndex].name + ); + + series[seriesIndex].data.splice(dataIndex, 1); + + // 别status = {}赋值啊!! + status.dragOut = true; + status.needRefresh = true; + + // 处理完拖拽事件后复位 + this.isDragend = false; + + return; + }, + + /** + * 数据项被拖拽进来, 重载基类方法 + */ + ondrop : function (param, status) { + var series = this.series; + if (!this.isDrop || !param.target) { + // 没有在当前实例上发生拖拽行为则直接返回 + return; + } + + var target = param.target; // 拖拽安放目标 + var dragged = param.dragged; // 当前被拖拽的图形对象 + + var seriesIndex = ecData.get(target, 'seriesIndex'); + var dataIndex = ecData.get(target, 'dataIndex'); + + var data; + var legend = this.component.legend; + var value; + + if (dataIndex === -1) { + data = { + value : ecData.get(dragged, 'value'), + name : ecData.get(dragged, 'name') + }; + + series[seriesIndex].data.push(data); + + legend && legend.add( + data.name, + dragged.style.color || dragged.style.strokeColor + ); + } + else { + // 数据被拖拽到某个数据项上,数据修改 + var accMath = require('../util/accMath'); + data = series[seriesIndex].data[dataIndex]; + legend && legend.del(data.name); + data.name += this.option.nameConnector + + ecData.get(dragged, 'name'); + value = ecData.get(dragged, 'value'); + for (var i = 0 ; i < value.length; i++) { + data.value[i] = accMath.accAdd(data.value[i], value[i]); + } + + legend && legend.add( + data.name, + dragged.style.color || dragged.style.strokeColor + ); + } + + // 别status = {}赋值啊!! + status.dragIn = status.dragIn || true; + + // 处理完拖拽事件后复位 + this.isDrop = false; + + return; + }, + + /** + * 刷新 + */ + refresh : function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + + this.backupShapeList(); + this._buildShape(); + } + }; + + zrUtil.inherits(Radar, ChartBase); + zrUtil.inherits(Radar, ComponentBase); + + // 图表注册 + require('../chart').define('radar', Radar); + + return Radar; +}); +/** + * Path 代理,可以在`buildPath`中用于替代`ctx`, 会保存每个path操作的命令到pathCommands属性中 + * 可以用于 isInsidePath 判断以及获取boundingRect + * + * @module zrender/shape/util/PathProxy + * @author pissang (http://www.github.com/pissang) + * + * @example + * var SomeShape = function() { + * this._pathProxy = new PathProxy(); + * ... + * } + * SomeShape.prototype.buildPath = function(ctx, style) { + * this._pathProxy.begin(ctx); + * .moveTo(style.x, style.y); + * .lineTo(style.x1, style.y1); + * ... + * .closePath(); + * }, + * SomeShape.prototype.getRect = function(style) { + * if (!style._rect) { + * // 这里必须要在 buildPath 之后才能调用 + * style._rect = this._pathProxy.fastBoundingRect(); + * } + * return this.style._rect; + * }, + * SomeShape.prototype.isCover = function(x, y) { + * var rect = this.getRect(this.style); + * if (x >= rect.x + * && x <= (rect.x + rect.width) + * && y >= rect.y + * && y <= (rect.y + rect.height) + * ) { + * return area.isInsidePath( + * this._pathProxy.pathCommands, 0, 'fill', x, y + * ); + * } + * } + */ +define('zrender/shape/util/PathProxy',['require','../../tool/vector'],function (require) { + + var vector = require('../../tool/vector'); + // var computeBoundingBox = require('../../tool/computeBoundingBox'); + + var PathSegment = function(command, points) { + this.command = command; + this.points = points || null; + }; + + /** + * @alias module:zrender/shape/tool/PathProxy + * @constructor + */ + var PathProxy = function () { + + /** + * Path描述的数组,用于`isInsidePath`的判断 + * @type {Array.} + */ + this.pathCommands = []; + + this._ctx = null; + + this._min = []; + this._max = []; + }; + + /** + * 快速计算Path包围盒(并不是最小包围盒) + * @return {Object} + */ + PathProxy.prototype.fastBoundingRect = function () { + var min = this._min; + var max = this._max; + min[0] = min[1] = Infinity; + max[0] = max[1] = -Infinity; + for (var i = 0; i < this.pathCommands.length; i++) { + var seg = this.pathCommands[i]; + var p = seg.points; + switch (seg.command) { + case 'M': + vector.min(min, min, p); + vector.max(max, max, p); + break; + case 'L': + vector.min(min, min, p); + vector.max(max, max, p); + break; + case 'C': + for (var j = 0; j < 6; j += 2) { + min[0] = Math.min(min[0], min[0], p[j]); + min[1] = Math.min(min[1], min[1], p[j + 1]); + max[0] = Math.max(max[0], max[0], p[j]); + max[1] = Math.max(max[1], max[1], p[j + 1]); + } + break; + case 'Q': + for (var j = 0; j < 4; j += 2) { + min[0] = Math.min(min[0], min[0], p[j]); + min[1] = Math.min(min[1], min[1], p[j + 1]); + max[0] = Math.max(max[0], max[0], p[j]); + max[1] = Math.max(max[1], max[1], p[j + 1]); + } + break; + case 'A': + var cx = p[0]; + var cy = p[1]; + var rx = p[2]; + var ry = p[3]; + min[0] = Math.min(min[0], min[0], cx - rx); + min[1] = Math.min(min[1], min[1], cy - ry); + max[0] = Math.max(max[0], max[0], cx + rx); + max[1] = Math.max(max[1], max[1], cy + ry); + break; + } + } + + return { + x: min[0], + y: min[1], + width: max[0] - min[0], + height: max[1] - min[1] + }; + }; + + /** + * @param {CanvasRenderingContext2D} ctx + * @return {PathProxy} + */ + PathProxy.prototype.begin = function (ctx) { + this._ctx = ctx || null; + // 清空pathCommands + this.pathCommands.length = 0; + + return this; + }; + + /** + * @param {number} x + * @param {number} y + * @return {PathProxy} + */ + PathProxy.prototype.moveTo = function (x, y) { + this.pathCommands.push(new PathSegment('M', [x, y])); + if (this._ctx) { + this._ctx.moveTo(x, y); + } + return this; + }; + + /** + * @param {number} x + * @param {number} y + * @return {PathProxy} + */ + PathProxy.prototype.lineTo = function (x, y) { + this.pathCommands.push(new PathSegment('L', [x, y])); + if (this._ctx) { + this._ctx.lineTo(x, y); + } + return this; + }; + + /** + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @param {number} x3 + * @param {number} y3 + * @return {PathProxy} + */ + PathProxy.prototype.bezierCurveTo = function (x1, y1, x2, y2, x3, y3) { + this.pathCommands.push(new PathSegment('C', [x1, y1, x2, y2, x3, y3])); + if (this._ctx) { + this._ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3); + } + return this; + }; + + /** + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @return {PathProxy} + */ + PathProxy.prototype.quadraticCurveTo = function (x1, y1, x2, y2) { + this.pathCommands.push(new PathSegment('A', [x1, y1, x2, y2])); + if (this._ctx) { + this._ctx.quadraticCurveTo(x1, y1, x2, y2); + } + return this; + }; + + /** + * @param {number} cx + * @param {number} cy + * @param {number} r + * @param {number} startAngle + * @param {number} endAngle + * @param {boolean} anticlockwise + * @return {PathProxy} + */ + PathProxy.prototype.arc = function (cx, cy, r, startAngle, endAngle, anticlockwise) { + this.pathCommands.push(new PathSegment( + 'A', [cx, cy, r, r, startAngle, endAngle - startAngle, 0, anticlockwise ? 0 : 1] + )); + if (this._ctx) { + this._ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise); + } + return this; + }; + + // TODO + PathProxy.prototype.arcTo = function (x1, y1, x2, y2, radius) { + if (this._ctx) { + this._ctx.arcTo(x1, y1, x2, y2, radius); + } + return this; + }; + + // TODO + PathProxy.prototype.rect = function (x, y, w, h) { + if (this._ctx) { + this._ctx.rect(x, y, w, h); + } + return this; + }; + + /** + * @return {PathProxy} + */ + PathProxy.prototype.closePath = function () { + this.pathCommands.push(new PathSegment('z')); + if (this._ctx) { + this._ctx.closePath(); + } + return this; + }; + + /** + * 是否没有Path命令 + * @return {boolean} + */ + PathProxy.prototype.isEmpty = function() { + return this.pathCommands.length === 0; + }; + + PathProxy.PathSegment = PathSegment; + + return PathProxy; +}); +/** + * @module echarts/util/shape/Ribbon + * @author pissang (https://github.com/pissang) + */ +/** + * @typedef {Object} IRibbonStyle + * @property {number} x + * @property {number} y + * @property {number} source0 + * @property {number} source1 + * @property {number} target0 + * @property {number} target1 + * @property {number} r + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ +define('echarts/util/shape/Ribbon',['require','zrender/shape/Base','zrender/shape/util/PathProxy','zrender/tool/util','zrender/tool/area'],function (require) { + var Base = require('zrender/shape/Base'); + var PathProxy = require('zrender/shape/util/PathProxy'); + var zrUtil = require('zrender/tool/util'); + var area = require('zrender/tool/area'); + + // var _ctx = zrUtil.getContext(); + + function RibbonShape(options) { + Base.call(this, options); + + this._pathProxy = new PathProxy(); + } + + RibbonShape.prototype = { + type : 'chord', + + // center, source0, source1, target0, target1, r + buildPath : function (ctx, style) { + + var path = this._pathProxy; + path.begin(ctx); + + var PI2 = Math.PI * 2; + var cx = style.x; + var cy = style.y; + var r = style.r; + var s0 = style.source0 / 180 * Math.PI; + var s1 = style.source1 / 180 * Math.PI; + var t0 = style.target0 / 180 * Math.PI; + var t1 = style.target1 / 180 * Math.PI; + var sx0 = cx + Math.cos(PI2 - s0) * r; + var sy0 = cy - Math.sin(PI2 - s0) * r; + var sx1 = cx + Math.cos(PI2 - s1) * r; + var sy1 = cy - Math.sin(PI2 - s1) * r; + var tx0 = cx + Math.cos(PI2 - t0) * r; + var ty0 = cy - Math.sin(PI2 - t0) * r; + var tx1 = cx + Math.cos(PI2 - t1) * r; + var ty1 = cy - Math.sin(PI2 - t1) * r; + + path.moveTo(sx0, sy0); + path.arc(cx, cy, style.r, s0, s1, false); + path.bezierCurveTo( + (cx - sx1) * 0.70 + sx1, + (cy - sy1) * 0.70 + sy1, + (cx - tx0) * 0.70 + tx0, + (cy - ty0) * 0.70 + ty0, + tx0, ty0 + ); + // Chord to self + if (style.source0 === style.target0 + && style.source1 === style.target1 + ) { + return; + } + path.arc(cx, cy, style.r, t0, t1, false); + path.bezierCurveTo( + (cx - tx1) * 0.70 + tx1, + (cy - ty1) * 0.70 + ty1, + (cx - sx0) * 0.70 + sx0, + (cy - sy0) * 0.70 + sy0, + sx0, sy0 + ); + }, + + getRect : function (style) { + if (style.__rect) { + return style.__rect; + } + if (!this._pathProxy.isEmpty()) { + this.buildPath(null, style); + } + return this._pathProxy.fastBoundingRect(); + }, + + isCover : function (x, y) { + var rect = this.getRect(this.style); + if (x >= rect.x + && x <= (rect.x + rect.width) + && y >= rect.y + && y <= (rect.y + rect.height) + ) { + return area.isInsidePath( + this._pathProxy.pathCommands, 0, 'fill', x, y + ); + } + } + }; + + zrUtil.inherits(RibbonShape, Base); + + return RibbonShape; +}); +define('echarts/util/kwargs',[],function (){ + function kwargs(func, defaults) { + /*jshint maxlen : 200*/ + var removeComments = new RegExp('(\\/\\*[\\w\\\'\\,\\(\\)\\s\\r\\n\\*]*\\*\\/)|(\\/\\/[\\w\\s\\\'][^\\n\\r]*$)|(\\/]*>)', 'gim'); + var removeWhitespc = new RegExp('\\s+', 'gim'); + var matchSignature = new RegExp('function.*?\\((.*?)\\)', 'i'); + // get the argument names from function source + var names = func.toString() + .replace(removeComments, '') + .replace(removeWhitespc, '') + .match(matchSignature)[1] + .split(','); + + // Check the existance of default, if not create an object + if(defaults !== Object(defaults)){ + defaults = {}; + } + + return function () { + var args = Array.prototype.slice.call(arguments); + var kwargs = args[args.length - 1]; + + // Check the existance of the kwargs + if (kwargs && kwargs.constructor === Object) { + args.pop(); + } + else{ + kwargs = {}; + } + + // Fill the arguments and apply them + for (var i = 0; i < names.length; i++) { + var name = names[i]; + if (name in kwargs) { + args[i] = kwargs[name]; + } + else if(name in defaults && args[i] == null){ + args[i] = defaults[name]; + } + } + + return func.apply(this, args); + }; + } + // As function prototype + // Function.prototype.kwargs = kwargs; + return kwargs; +}); +/** + * Numpy like n-dimensional array proccessing class + * http://docs.scipy.org/doc/numpy/reference/arrays.ndarray.html + * + * @author pissang (https://github.com/pissang/) + */ +define('echarts/util/ndarray',['require','./kwargs'],function (require) { + + + +var kwargs = require('./kwargs'); + +var ArraySlice = Array.prototype.slice; + +// Polyfill of Typed Array +this.Int32Array = window.Int32Array || Array; +this.Int16Array = window.Int16Array || Array; +this.Int8Array = window.Int8Array || Array; +this.Uint32Array = window.Uint32Array || Array; +this.Uint16Array = window.Uint16Array || Array; +this.Uint8Array = window.Uint8Array || Array; +this.Float32Array = window.Float32Array || Array; +this.Float64Array = window.Float64Array || Array; + +// Map of numpy dtype and typed array +// http://docs.scipy.org/doc/numpy/reference/arrays.dtypes.html#arrays-dtypes +// http://www.khronos.org/registry/typedarray/specs/latest/ +var ArrayConstructor = { + 'int32' : this.Int32Array, + 'int16' : this.Int16Array, + 'int8' : this.Int8Array, + 'uint32' : this.Uint32Array, + 'uint16' : this.Uint16Array, + 'uint8' : this.Uint8Array, + // 'uint8c' is not existed in numpy + 'uint8c' : this.Uint8ClampedArray, + 'float32' : this.Float32Array, + 'float64' : this.Float64Array, + 'number' : Array +}; + +var dTypeStrideMap = { + 'int32' : 4, + 'int16' : 2, + 'int8' : 1, + 'uint32' : 4, + 'uint16' : 2, + 'uint8' : 1, + 'uint8c' : 1, + 'float32' : 4, + 'float64' : 8, + // Consider array stride is 1 + 'number' : 1 +}; + +var E_ADD = 0; +var E_SUB = 1; +var E_MUL = 2; +var E_DIV = 3; +var E_MOD = 4; +var E_AND = 5; +var E_OR = 6; +var E_XOR = 7; +var E_EQL = 8; + +function guessDataType(arr) { + if (typeof(arr) === 'undefined') { + return 'number'; + } + switch(Object.prototype.toString.call(arr)) { + case '[object Int32Array]': + return 'int32'; + case '[object Int16Array]': + return 'int16'; + case '[object Int8Array]': + return 'int8'; + case '[object Uint32Array]': + return 'uint32'; + case '[object Uint16Array]': + return 'uint16'; + case '[object Uint8Array]': + return 'uint8'; + case '[object Uint8ClampedArray]': + return 'uint8c'; + case '[object Float32Array]': + return 'float32'; + case '[object Float64Array]': + return 'float64'; + default: + return 'number'; + } +} + +/** + * NDArray + * @param {Array|NDArray} array + * @param {String} dtype + */ +var NDArray = function (array) { + // Last argument describe the data type of ndarray + var dtype = arguments[arguments.length-1]; + if (typeof(dtype) == 'string') { + this._dtype = dtype; + } else { + // Normal array + this._dtype = guessDataType(array); + } + + if (array && typeof(array) !== 'string') { + if (array instanceof NDArray) { + array._dtype = this._dtype; + return array; + } else if (typeof(array.length) !== 'undefined') { + // Init from array + this.initFromArray(array); + } else if(typeof(array) === 'number') { + // Init from shape + this.initFromShape.apply(this, arguments); + } + } else { + /** + * _array + * Initialized with an empty array + * Data is continuous one-dimensional array, row-major + * A [2, 2] dim empty array is stored like + * [0,0, 0,0] + * TODO : Consider column majors ? + * @type {ArrayConstructor} + */ + this._array = new ArrayConstructor[this._dtype](); + /** + * _shape + * a tuple array describe the dimension and size of each dimension + * [10, 10] means a 10x10 array + * @type {Array} + */ + this._shape = [0]; + /** + * _size + * size of the storage array length + * @type {Number} + */ + this._size = 0; + } +}; + +NDArray.prototype = { + /** + * Initialize from a normal js array. + * + * @param {Array} input + * @return {NDArray} this + */ + initFromArray : function (input) { + var dim = getDimension(input); + var cursor = 0; + function flatten(axis, _out, _in) { + var len = _in.length; + for (var i = 0; i < len; i++) { + if (axis < dim-1) { + flatten(axis+1, _out, _in[i]); + } else { + _out[cursor++] = _in[i]; + } + } + } + var shape = getShape(input); + var size = getSize(shape); + this._array = new ArrayConstructor[this._dtype](size); + + flatten(0, this._array, input); + this._shape = shape; + this._size = size; + + return this; + }, + + /** + * Initialize from the given shape description. + * @param {Array} shape + * @return {NDArray} this + */ + initFromShape : function (shape) { + if (typeof(shape) == 'number') { + shape = Array.prototype.slice.call(arguments); + } + if(shape) { + var size = getSize(shape); + if (this._dtype === 'number') { + this._array = []; + var data = this._array; + for (var i = 0; i < size; i++) { + data[i] = 0; + } + } else { + this._array = new ArrayConstructor[this._dtype](size); + } + } + this._shape = shape; + this._size = getSize(shape); + + return this; + }, + /** + * Fill the array with the given value. + * @param {Number} value + * @return {NDArray} this + */ + fill : function (value) { + var data = this._array; + for (var i = 0; i < data.length; i++) { + data[i] = value; + } + return this; + }, + + /** + * Get ndarray shape copy. + * @return {Array} + */ + shape : function () { + // Create a copy + return this._shape.slice(); + }, + + /** + * Get array size + * @return {Number} + */ + size : function () { + return this._size; + }, + + /** + * Get array data type. + * 'int32' + * 'int16' + * 'int8' + * 'uint32' + * 'uint16' + * 'uint8' + * 'float32' + * 'float64' + * @return {String} + */ + dtype : function () { + return this._dtype; + }, + + /** + * Get array dimension. + * @return {[type]} [description] + */ + dimension : function () { + return this._shape.length; + }, + + /** + * Tuple of bytes to step in each dimension when traversing an array. + * @return {Array} + */ + strides : function () { + var strides = calculateDimStrides(this._shape); + var dTypeStride = dTypeStrideMap[this._dtype]; + for (var i = 0; i < strides.length; i++) { + strides[i] *= dTypeStride; + } + return strides; + }, + /** + * Gives a new shape to an array without changing its data. + * @param {Array} shape + * @return {NDArray} + */ + reshape : function (shape) { + if (typeof(shape) == 'number') { + shape = Array.prototype.slice.call(arguments); + } + if (this._isShapeValid(shape)) { + this._shape = shape; + } else { + throw new Error('Total size of new array must be unchanged'); + } + return this; + }, + + _isShapeValid : function (shape) { + return getSize(shape) === this._size; + }, + + /** + * Change shape and size of array in-place. + * @param {Array} shape + * @return {NDArray} + */ + resize : function (shape) { + if (typeof(shape) == 'number') { + shape = Array.prototype.slice.call(arguments); + } + + var len = getSize(shape); + if (len < this._size) { + if (this._dtype === 'number') { + this._array.length = len; + } + } else { + if (this._dtype === 'number') { + for (var i = this._array.length; i < len; i++) { + // Fill the rest with zero + this._array[i] = 0; + } + } else { + // Reallocate new buffer + var newArr = new ArrayConstructor[this._dtype](len); + var originArr = this._array; + + // Copy data + for (var i = 0; i < originArr.length; i++) { + newArr[i] = originArr[i]; + } + this._array = newArr; + } + } + this._shape = shape; + this._size = len; + + return this; + + }, + + /** + * Returns a new array with axes transposed. + * @param {Array} [axes] + * @param {NDArray} [out] + * @return {NDArray} + */ + transpose : kwargs(function (axes, out) { + var originAxes = []; + for (var i = 0; i < this._shape.length; i++) { + originAxes.push(i); + } + if (typeof(axes) === 'undefined') { + axes = originAxes.slice(); + } + // Check if any axis is out of bounds + for (var i = 0; i < axes.length; i++) { + if (axes[i] >= this._shape.length) { + throw new Error(axisOutofBoundsErrorMsg(axes[i])); + } + } + // Has no effect on 1-D transpose + if (axes.length <= 1) { + return this; + } + + var targetAxes = originAxes.slice(); + for (var i = 0; i < Math.floor(axes.length / 2); i++) { + for (var j = axes.length-1; j >= Math.ceil(axes.length / 2) ; j--) { + // Swap axes + targetAxes[axes[i]] = axes[j]; + targetAxes[axes[j]] = axes[i]; + } + } + + return this._transposelike(targetAxes, out); + + }), + + /** + * Return a new array with axis1 and axis2 interchanged. + * @param {Number} axis1 + * @param {Number} axis2 + * @param {NDArray} out + * @return {NDArray} + */ + swapaxes : kwargs(function (axis1, axis2, out) { + return this.transpose([axis1, axis2], out); + }), + + /** + * Roll the specified axis backwards, until it lies in a given position. + * @param {Number} axis + * @param {Number} [start=0] + * @param {NDArray} out + * @return {NDArray} + */ + rollaxis : kwargs(function (axis, start, out) { + if (axis >= this._shape.length) { + throw new Error(axisOutofBoundsErrorMsg(axis)); + } + + var axes = []; + for (var i = 0; i < this._shape.length; i++) { + axes.push(i); + } + axes.splice(axis, 1); + axes.splice(start, 0, axis); + + return this._transposelike(axes, out); + + }, { start : 0}), + + // Base function for transpose-like operations + _transposelike : function (axes, out) { + var source = this._array; + var shape = this._shape.slice(); + var strides = calculateDimStrides(this._shape); + var dim = shape.length; + + // Swap + var tmpStrides = []; + var tmpShape = []; + for (var i = 0; i < axes.length; i++) { + var axis = axes[i]; + // swap to target axis + tmpShape[i] = shape[axis]; + tmpStrides[i] = strides[axis]; + } + strides = tmpStrides; + shape = tmpShape; + + this._shape = shape; + var transposedStrides = calculateDimStrides(this._shape); + + if (!out) { + out = new NDArray(); + out._shape = this._shape.slice(); + out._dtype = this._dtype; + out._size = this._size; + } + // FIXME in-place transpose? + var transposedData = new ArrayConstructor[this._dtype](this._size); + out._array = transposedData; + // @param Item offset in current axis offset of the original array + // @param Item offset in current axis offset of the transposed array + function transpose(axis, offset, transposedOffset) { + var size = shape[axis]; + // strides in orginal array + var stride = strides[axis]; + // strides in transposed array + var transposedStride = transposedStrides[axis]; + + if (axis < dim-1) { + for (var i = 0; i < size; i++) { + transpose( + axis+1, + offset + stride * i, + transposedOffset + transposedStride * i + ); + } + } else { + for (var i = 0; i < size; i++) { + // offset + stride * i is the index of the original array + // transposedOffset + i is the index of the transposed array + transposedData[transposedOffset + i] + = source[offset + stride * i]; + } + } + } + + transpose(0, 0, 0); + + return out; + }, + + /** + * Repeat elements of an array along axis + * @param {Number} repeats + * The number of repetitions for each element. + * repeats is broadcasted to fit the shape of the given axis. + * @param {Number} [axis] + * The axis along which to repeat values. + * By default, use the flattened input array, + * and return a flat output array. + * @param {NDArray} [out] + * @return {NDArray} + */ + repeat : kwargs(function (repeats, axis, out) { + var shape; + // flattened input array + if (typeof(axis) === 'undefined') { + shape = [this._size]; + axis = 0; + } else { + shape = this._shape.slice(); + } + var originShape = shape.slice(); + + shape[axis] *= repeats; + if (!out) { + out = new NDArray(this._dtype); + out.initFromShape(shape); + } else { + if (!arrayEqual(shape, out._shape)) { + throw new Error(broadcastErrorMsg(shape, out._shape)); + } + } + var data = out._array; + + var stride = calculateDimStride(originShape, axis); + var axisSize = originShape[axis]; + var source = this._array; + + var offsetStride = stride * axisSize; + + for (var offset = 0; offset < this._size; offset+=offsetStride) { + for (var k = 0; k < stride; k++) { + var idx = offset + k; + var idxRepeated = offset * repeats + k; + for (var i = 0; i < axisSize; i++) { + for (var j = 0; j < repeats; j++) { + data[idxRepeated] = source[idx]; + idxRepeated += stride; + } + idx += stride; + } + } + } + + return out; + }), + + choose : function () { + console.warn('TODO'); + }, + + take : function () { + console.warn('TODO'); + }, + + tile : function () { + console.warn('TODO'); + }, + + /** + * Preprocess for array calculation + * max, min, argmax, argmin, sum, ptp, val, mean + * Which will reduce one axis if the axis is given + * + * @param {Number} axis + * @param {NDArray} out + * @param {Function} funcWithAxis + * @param {Function} funcFlatten + * @return {Number|NDArray} + */ + _withPreprocess1 : function (axis, out, funcWithAxis, funcFlatten) { + var source = this._array; + if (!this._size) { + return; + } + + if (typeof(axis)!=='undefined') { + if (axis < 0) { + axis = this._shape.length + axis; + } + if (axis >= this._shape.length || axis < 0) { + throw new Error(axisOutofBoundsErrorMsg(axis)); + } + + var shape = this._shape.slice(); + shape.splice(axis, 1); + if (out && !arrayEqual(shape, out._shape)) { + throw new Error(broadcastErrorMsg(shape, out._shape)); + } + + if (!out) { + out = new NDArray(this._dtype); + out.initFromShape(shape); + } + var data = out._array; + + var stride = calculateDimStride(this._shape, axis); + var axisSize = this._shape[axis]; + var offsetStride = stride * axisSize; + + funcWithAxis.call( + this, data, source, offsetStride, axisSize, stride + ); + + return out; + } else { + return funcFlatten.call(this, source); + } + }, + + /** + * Preprocess for array calculation cumsum, cumprod + * Which will keep the shape if axis is given + * and flatten if axis is undefined + * @param {Number} axis + * @param {NDArray} out + * @param {Function} funcWithAxis + * @param {Function} funcFlatten + * @return {NDArray} + */ + _withPreprocess2 : function (axis, out, funcWithAxis, funcFlatten) { + var source = this._array; + if (!this._size) { + return; + } + if (out && !arrayEqual(this._shape, out._shape)) { + throw new Error(broadcastErrorMsg(this._shape, out._shape)); + } + if (!out) { + out = new NDArray(this._dtype); + out.initFromShape(this._shape); + } + + var data = out._array; + + if (typeof(axis)!=='undefined') { + if (axis < 0) { + axis = this._shape.length + axis; + } + if (axis >= this._shape.length || axis < 0) { + throw new Error(axisOutofBoundsErrorMsg(axis)); + } + + if (axis >= this._shape.length) { + throw new Error(axisOutofBoundsErrorMsg(axis)); + } + + var stride = calculateDimStride(this._shape, axis); + var axisSize = this._shape[axis]; + var offsetStride = stride * axisSize; + + funcWithAxis.call( + this, data, source, offsetStride, axisSize, stride + ); + } else { + out.reshape([this._size]); + funcFlatten.call(this, data, source); + } + + return out; + }, + + /** + * Get the max value of ndarray + * If the axis is given, the max is only calculate in this dimension + * Example, for the given ndarray + * [[3, 9], + * [4, 8]] + * >>> max(0) + * [4, 9] + * >>> max(1) + * [9, 8] + * + * @param {Number} [axis] + * @param {NDArray} out + * @return {NDArray} + */ + max : kwargs((function () { + function withAxis(data, source, offsetStride, axisSize, stride) { + var cursor = 0; + for (var offset = 0; offset < this._size; offset+=offsetStride) { + for (var i = 0; i < stride; i++) { + var idx = i + offset; + var max = source[idx]; + for (var j = 0; j < axisSize; j++) { + var d = source[idx]; + if (d > max) { + max = d; + } + idx += stride; + } + data[cursor++] = max; + } + } + } + function withFlatten(source) { + var max = source[0]; + for (var i = 1; i < this._size; i++) { + if (source[i] > max) { + max = source[i]; + } + } + return max; + } + return function (axis, out) { + return this._withPreprocess1( + axis, out, + withAxis, withFlatten + ); + }; + })()), + + + /** + * Return the minimum of an array or minimum along an axis. + * @param {Number} [axis] + * @param {NDArray} out + * @return {NDArray} + */ + min : kwargs((function () { + function withAxis(data, source, offsetStride, axisSize, stride) { + var cursor = 0; + for (var offset = 0; offset < this._size; offset+=offsetStride) { + for (var i = 0; i < stride; i++) { + var idx = i + offset; + var min = source[idx]; + for (var j = 0; j < axisSize; j++) { + var d = source[idx]; + if (d < min) { + min = d; + } + idx += stride; + } + data[cursor++] = min; + } + } + } + function withFlatten(source) { + var min = source[0]; + for (var i = 1; i < this._size; i++) { + if (source[i] < min) { + min = source[i]; + } + } + return min; + } + return function (axis, out) { + return this._withPreprocess1( + axis, out, + withAxis, withFlatten + ); + }; + })()), + + /** + * Return indices of the maximum values along an axis. + * @param {Number} [axis] + * @param {NDArray} out + * @return {NDArray} + */ + argmax : kwargs((function () { + function withAxis(data, source, offsetStride, axisSize, stride) { + var cursor = 0; + for (var offset = 0; offset < this._size; offset+=offsetStride) { + for (var i = 0; i < stride; i++) { + var dataIdx = 0; + var idx = i + offset; + var max = source[idx]; + for (var j = 0; j < axisSize; j++) { + var d = source[idx]; + if (d > max) { + max = d; + dataIdx = j; + } + idx += stride; + } + data[cursor++] = dataIdx; + } + } + } + function withFlatten(source) { + var max = source[0]; + var idx = 0; + for (var i = 1; i < this._size; i++) { + if (source[i] > max) { + idx = i; + max = source[i]; + } + } + return idx; + } + return function (axis, out) { + return this._withPreprocess1( + axis, out, + withAxis, withFlatten + ); + }; + })()), + + /** + * Indices of the minimum values along an axis. + * @param {Number} [axis] + * @param {NDArray} out + * @return {NDArray} + */ + argmin : kwargs((function () { + function withAxis(data, source, offsetStride, axisSize, stride) { + var cursor = 0; + for (var offset = 0; offset < this._size; offset+=offsetStride) { + for (var i = 0; i < stride; i++) { + var dataIdx = 0; + var idx = i + offset; + var min = source[idx]; + for (var j = 0; j < axisSize; j++) { + var d = source[idx]; + if (d < min) { + min = d; + dataIdx = j; + } + idx += stride; + } + data[cursor++] = dataIdx; + } + } + } + function withFlatten(source) { + var min = source[0]; + var idx = 0; + for (var i = 1; i < this._size; i++) { + if (source[i] < min) { + idx = i; + min = source[i]; + } + } + return idx; + } + return function (axis, out) { + return this._withPreprocess1( + axis, out, + withAxis, withFlatten + ); + }; + })()), + + /** + * Return the sum of the array elements over the given axis. + * @param {Number} [axis] + * @param {NDArray} out + * @return {NDArray} + */ + sum : kwargs((function () { + function withAxis(data, source, offsetStride, axisSize, stride) { + var cursor = 0; + for (var offset = 0; offset < this._size; offset+=offsetStride) { + for (var i = 0; i < stride; i++) { + var sum = 0; + var idx = i + offset; + for (var j = 0; j < axisSize; j++) { + sum += source[idx]; + idx += stride; + } + data[cursor++] = sum; + } + } + } + function withFlatten(source) { + var sum = 0; + for (var i = 0; i < this._size; i++) { + sum += source[i]; + } + return sum; + } + return function (axis, out) { + return this._withPreprocess1( + axis, out, + withAxis, withFlatten + ); + }; + })()), + + /** + * Return the product of the array elements over the given axis. + * @param {Number} [axis] + * @param {NDArray} out + * @return {NDArray} + */ + prod : kwargs((function () { + function withAxis(data, source, offsetStride, axisSize, stride) { + var cursor = 0; + for (var offset = 0; offset < this._size; offset+=offsetStride) { + for (var i = 0; i < stride; i++) { + var prod = 1; + var idx = i + offset; + for (var j = 0; j < axisSize; j++) { + prod *= source[idx]; + idx += stride; + } + data[cursor++] = prod; + } + } + } + function withFlatten(source) { + var prod = 1; + for (var i = 0; i < this._size; i++) { + prod *= source[i]; + } + return prod; + } + return function (axis, out) { + return this._withPreprocess1( + axis, out, + withAxis, withFlatten + ); + }; + })()), + + /** + * Returns the average of the array elements along given axis. + * @param {Number} [axis] + * @param {NDArray} out + * @return {NDArray} + */ + mean : kwargs((function () { + function withAxis(data, source, offsetStride, axisSize, stride) { + var cursor = 0; + for (var offset = 0; offset < this._size; offset+=offsetStride) { + for (var i = 0; i < stride; i++) { + var sum = 0; + var idx = i + offset; + for (var j = 0; j < axisSize; j++) { + sum += source[idx]; + idx += stride; + } + var mean = sum / axisSize; + data[cursor++] = mean; + } + } + } + function withFlatten(source) { + var sum = 0; + var len = source.length; + for (var i = 0; i < len; i++) { + sum += source[i]; + } + var mean = sum / len; + return mean; + } + return function (axis, out) { + return this._withPreprocess1( + axis, out, + withAxis, withFlatten + ); + }; + })()), + + /** + * Return the variance of the array elements over the given axis. + * @param {Number} [axis] + * @param {NDArray} out + * @return {NDArray} + */ + 'var' : kwargs((function () { + function withAxis(data, source, offsetStride, axisSize, stride) { + var cursor = 0; + for (var offset = 0; offset < this._size; offset+=offsetStride) { + for (var i = 0; i < stride; i++) { + var sum = 0; + var idx = i + offset; + for (var j = 0; j < axisSize; j++) { + sum += source[idx]; + idx += stride; + } + var mean = sum / axisSize; + var moments = 0; + idx = i + offset; + for (var j = 0; j < axisSize; j++) { + var diff = source[idx] - mean; + moments += diff * diff; + idx += stride; + } + data[cursor++] = moments / axisSize; + } + } + } + function withFlatten(source) { + var sum = 0; + var len = source.length; + for (var i = 0; i < len; i++) { + sum += source[i]; + } + var mean = sum / len; + var moments = 0; + for (var i = 0; i < len; i++) { + var diff = source[i] - mean; + moments += diff * diff; + } + return moments / len; + } + return function (axis, out) { + return this._withPreprocess1( + axis, out, + withAxis, withFlatten + ); + }; + })()), + + /** + * Return the standard derivatione of the array elements + * over the given axis. + * @param {Number} [axis] + * @param {NDArray} out + * @return {NDArray} + */ + std : kwargs((function () { + function withAxis(data, source, offsetStride, axisSize, stride) { + var cursor = 0; + for (var offset = 0; offset < this._size; offset+=offsetStride) { + for (var i = 0; i < stride; i++) { + var sum = 0; + var idx = i + offset; + for (var j = 0; j < axisSize; j++) { + sum += source[idx]; + idx += stride; + } + var mean = sum / axisSize; + var moments = 0; + idx = i + offset; + for (var j = 0; j < axisSize; j++) { + var diff = source[idx] - mean; + moments += diff * diff; + idx += stride; + } + data[cursor++] = Math.sqrt(moments / axisSize); + } + } + } + function withFlatten(source) { + var sum = 0; + var len = source.length; + for (var i = 0; i < len; i++) { + sum += source[i]; + } + var mean = sum / len; + var moments = 0; + for (var i = 0; i < len; i++) { + var diff = source[i] - mean; + moments += diff * diff; + } + return Math.sqrt(moments / len); + } + return function (axis, out) { + return this._withPreprocess1( + axis, out, + withAxis, withFlatten + ); + }; + })()), + + /** + * Peak to peak (maximum - minimum) value along a given axis. + * @param {Number} [axis] + * @param {NDArray} out + * @return {NDArray} + */ + ptp : kwargs((function () { + function withAxis(data, source, offsetStride, axisSize, stride) { + var cursor = 0; + for (var offset = 0; offset < this._size; offset+=offsetStride) { + for (var i = 0; i < stride; i++) { + var idx = offset + i; + var min = source[idx]; + var max = source[idx]; + for (var j = 0; j < axisSize; j++) { + var d = source[idx]; + if (d < min) { + min = d; + } + if (d > max) { + max = d; + } + idx += stride; + } + data[cursor++] = max - min; + } + } + } + function withFlatten(source) { + var min = source[0]; + var max = source[0]; + for (var i = 1; i < this._size; i++) { + if (source[i] < min) { + min = source[i]; + } + if (source[i] > max) { + max = source[i]; + } + } + return max - min; + } + return function (axis, out) { + return this._withPreprocess1( + axis, out, + withAxis, withFlatten + ); + }; + })()), + + /** + * + * @param {Number} [axis=-1] + * @param {string} [order='ascending'] + * 'ascending' | 'descending' + * @return {NDArray} + */ + // FIXME : V8 is quick sort, firefox and safari is merge sort + // order : ascending or desc + sort : kwargs(function (axis, order) { + if (axis < 0) { + axis = this._shape.length + axis; + } + var compareFunc; + if (order === 'ascending') { + compareFunc = function (a, b) { + return a - b; + }; + } else if( order === 'descending') { + compareFunc = function (a, b) { + return b - a; + }; + } + + var source = this._array; + var stride = calculateDimStride(this._shape, axis); + var axisSize = this._shape[axis]; + + var offsetStride = stride * axisSize; + + var tmp = new Array(axisSize); + + for (var offset = 0; offset < this._size; offset+=offsetStride) { + + for (var i = 0; i < stride; i++) { + var idx = offset + i; + for (var j = 0; j < axisSize; j++) { + tmp[j] = source[idx]; + idx += stride; + } + tmp.sort(compareFunc); + var idx = offset + i; + // Copy back + for (var j = 0; j < axisSize; j++) { + source[idx] = tmp[j]; + idx += stride; + } + } + } + + return this; + + }, {axis : -1, order : 'ascending'}), + + /** + * + * @param {Number} [axis=-1] + * @param {string} [order='ascending'] + * 'ascending' | 'descending' + * @param {NDArray} [out] + * @return {NDArray} + */ + argsort : kwargs(function (axis, order, out) { + if (axis < 0) { + axis = this._shape.length + axis; + } + if (!this._size) { + return; + } + if (out && !arrayEqual(this._shape, out._shape)) { + throw new Error(broadcastErrorMsg(this._shape, out._shape)); + } + if (!out) { + out = new NDArray(this._dtype); + out.initFromShape(this._shape); + } + var data = out._array; + + var compareFunc; + if (order === 'ascending') { + compareFunc = function (a, b) { + return tmp[a] - tmp[b]; + }; + } else if( order === 'descending') { + compareFunc = function (a, b) { + return tmp[b] - tmp[a]; + }; + } + + var source = this._array; + var stride = calculateDimStride(this._shape, axis); + var axisSize = this._shape[axis]; + var offsetStride = stride * axisSize; + + var tmp = new Array(axisSize); + var indexList = new Array(axisSize); + + for (var offset = 0; offset < this._size; offset+=offsetStride) { + for (var i = 0; i < stride; i++) { + var idx = offset + i; + for (var j = 0; j < axisSize; j++) { + tmp[j] = source[idx]; + indexList[j] = j; + idx += stride; + } + indexList.sort(compareFunc); + // Copy back + var idx = offset + i; + for (var j = 0; j < axisSize; j++) { + data[idx] = indexList[j]; + idx += stride; + } + } + } + + return out; + + }, {axis : -1, order : 'ascending'}), + + /** + * Return the cumulative sum of the elements along the given axis. + * @param {Number} [axis] + * @param {NDArray} out + * @return {NDArray} + */ + cumsum : kwargs((function () { + function withAxis(data, source, offsetStride, axisSize, stride) { + for (var offset = 0; offset < this._size; offset+=offsetStride) { + for (var i = 0; i < stride; i++) { + var idx = offset + i; + var prevIdx = idx; + data[idx] = source[idx]; + for (var j = 1; j < axisSize; j++) { + prevIdx = idx; + idx += stride; + data[idx] = data[prevIdx] + source[idx]; + } + + } + } + } + function withFlatten(data, source) { + data[0] = source[0]; + for (var i = 1; i < data.length; i++) { + data[i] = data[i-1] + source[i]; + } + } + return function (axis, out) { + return this._withPreprocess2( + axis, out, + withAxis, withFlatten + ); + }; + })()), + + /** + * Return the cumulative product of the elements along the given axis. + * @param {Number} [axis] + * @param {NDArray} out + * @return {NDArray} + */ + cumprod : kwargs((function () { + function withAxis(data, source, offsetStride, axisSize, stride) { + for (var offset = 0; offset < this._size; offset+=offsetStride) { + for (var i = 0; i < stride; i++) { + var idx = offset + i; + var prevIdx = idx; + data[idx] = source[idx]; + for (var j = 1; j < axisSize; j++) { + prevIdx = idx; + idx += stride; + data[idx] = data[prevIdx] * source[idx]; + } + + } + } + } + function withFlatten(data, source) { + data[0] = source[0]; + for (var i = 1; i < data.length; i++) { + data[i] = data[i-1] * source[i]; + } + } + return function (axis, out) { + return this._withPreprocess2( + axis, out, + withAxis, withFlatten + ); + }; + })()), + + /** + * Dot product of two arrays. + * + * @param {NDArray|Number} b + * @param {NDArray} [out] + * @return {NDArray|Number} + */ + dot : function () { + console.warn('TODO'); + }, + + /** + * Mapped to region [min, max] + * @param {Number} mappedMin + * @param {Number} mappedMax + */ + map : function (mappedMin, mappedMax) { + var input = this._array; + var output = this._array; + + var min = input[0]; + var max = input[0]; + var l = this._size; + for (var i = 1; i < l; i++) { + var val = input[i]; + if (val < min) { + min = val; + } + if (val > max) { + max = val; + } + } + var range = max - min; + var mappedRange = mappedMax - mappedMin; + for (var i = 0; i < l; i++) { + if (range === 0) { + output[i] = mappedMin; + } else { + var val = input[i]; + var percent = (val - min) / range; + output[i] = mappedRange * percent + mappedMin; + } + } + return this; + }, + + /** + * Add + */ + add : function (rightOperand, out) { + return this.binaryOperation( + this, rightOperand, E_ADD, out + ); + }, + + /** + * Substract + */ + sub : function (rightOperand, out) { + return this.binaryOperation( + this, rightOperand, E_SUB, out + ); + }, + + /** + * Multiply + */ + mul : function (rightOperand, out) { + return this.binaryOperation( + this, rightOperand, E_MUL, out + ); + }, + + /** + * Divide + */ + div : function (rightOperand, out) { + return this.binaryOperation( + this, rightOperand, E_DIV, out + ); + }, + /** + * mod + */ + mod : function (rightOperand, out) { + return this.binaryOperation( + this, rightOperand, E_MOD, out + ); + }, + /** + * and + */ + and : function (rightOperand, out) { + return this.binaryOperation( + this, rightOperand, E_AND, out + ); + }, + /** + * or + */ + or : function (rightOperand, out) { + return this.binaryOperation( + this, rightOperand, E_OR, out + ); + }, + /** + * xor + */ + xor : function (rightOperand, out) { + return this.binaryOperation( + this, rightOperand, E_XOR, out + ); + }, + /** + * equal + */ + equal : function (rightOperand, out) { + return this.binaryOperation( + this, rightOperand, E_EQL, out + ); + }, + + binaryOperation : function (lo, ro, op, out) { + // Broadcasting + // http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html + var shape = []; + var isLoScalar = typeof(lo) === 'number'; + var isRoScalar = typeof(ro) === 'number'; + if (isLoScalar) { + shape = ro._shape.slice(); + } else if (isRoScalar) { + shape = lo._shape.slice(); + } else { + // Starts with the trailing dimensions + var cl = lo._shape.length-1; + var cr = ro._shape.length-1; + var loBroadCasted = lo; + var roBroadCasted = ro; + while (cl >= 0 && cr >= 0) { + if (lo._shape[cl] == 1) { + shape.unshift(ro._shape[cr]); + loBroadCasted = lo.repeat(ro._shape[cr], cl); + } else if(ro._shape[cr] == 1) { + shape.unshift(lo._shape[cl]); + roBroadCasted = ro.repeat(lo._shape[cl], cr); + } else if(ro._shape[cr] == lo._shape[cl]) { + shape.unshift(lo._shape[cl]); + } else { + throw new Error(broadcastErrorMsg(lo._shape, ro._shape)); + } + cl --; + cr --; + } + for (var i = cl; i >= 0; i--) { + shape.unshift(lo._shape[i]); + } + for (var i = cr; i >= 0; i--) { + shape.unshift(ro._shape[i]); + } + lo = loBroadCasted; + ro = roBroadCasted; + } + if (!out) { + out = new NDArray(this._dtype); + out.initFromShape(shape); + } else { + if (! arrayEqual(shape, out._shape)) { + throw new Error(broadcastErrorMsg(shape, out._shape)); + } + } + var outData = out._array; + + var diffAxis; + var isLoLarger; + var loData; + var roData; + if (isLoScalar) { + diffAxis = ro._shape.length-1; + isLoLarger = false; + loData = lo; + roData = ro._array; + } else if(isRoScalar) { + diffAxis = lo._shape.length-1; + isLoLarger = true; + roData = ro; + loData = lo._array; + } else { + diffAxis = Math.abs(lo._shape.length - ro._shape.length); + isLoLarger = lo._shape.length >= ro._shape.length; + loData = lo._array; + roData = ro._array; + } + var stride = calculateDimStride(shape, diffAxis); + var axisSize = shape[diffAxis]; + + var offsetStride = stride * axisSize; + var offsetRepeats = out._size / offsetStride; + + var _a, _b, res; + var idx = 0; + if (isLoLarger) { + if(isRoScalar) { + for (var c = 0; c < offsetRepeats; c++) { + for (var i = 0; i < offsetStride; i++) { + _a = loData[idx]; _b = roData; + switch (op) { + case E_ADD: res = _a + _b; break; + case E_SUB: res = _a - _b; break; + case E_MUL: res = _a * _b; break; + case E_DIV: res = _a / _b; break; + case E_MOD: res = _a % _b; break; + case E_AND: res = _a & _b; break; + case E_OR: res = _a | _b; break; + case E_XOR: res = _a ^ _b; break; + case E_EQL: res = _a == _b; break; + default: throw new Error('Unkown operation ' + op); + } + outData[idx] = res; + idx ++; + } + } + } else { + for (var c = 0; c < offsetRepeats; c++) { + for (var i = 0; i < offsetStride; i++) { + _a = loData[idx]; _b = roData[i]; + switch (op) { + case E_ADD: res = _a + _b; break; + case E_SUB: res = _a - _b; break; + case E_MUL: res = _a * _b; break; + case E_DIV: res = _a / _b; break; + case E_MOD: res = _a % _b; break; + case E_AND: res = _a & _b; break; + case E_OR: res = _a | _b; break; + case E_XOR: res = _a ^ _b; break; + case E_EQL: res = _a == _b; break; + default: throw new Error('Unkown operation ' + op); + } + outData[idx] = res; + idx ++; + } + } + } + } else { + if (isLoScalar) { + for (var c = 0; c < offsetRepeats; c++) { + for (var i = 0; i < offsetStride; i++) { + _a = loData; _b = roData[idx]; + switch (op) { + case E_ADD: res = _a + _b; break; + case E_SUB: res = _a - _b; break; + case E_MUL: res = _a * _b; break; + case E_DIV: res = _a / _b; break; + case E_MOD: res = _a % _b; break; + case E_AND: res = _a & _b; break; + case E_OR: res = _a | _b; break; + case E_XOR: res = _a ^ _b; break; + case E_EQL: res = _a == _b; break; + default: throw new Error('Unkown operation ' + op); + } + outData[idx] = res; + idx ++; + } + } + } else { + for (var c = 0; c < offsetRepeats; c++) { + for (var i = 0; i < offsetStride; i++) { + _a = loData[idx]; _b = roData[i]; + switch (op) { + case E_ADD: res = _a + _b; break; + case E_SUB: res = _a - _b; break; + case E_MUL: res = _a * _b; break; + case E_DIV: res = _a / _b; break; + case E_MOD: res = _a % _b; break; + case E_AND: res = _a & _b; break; + case E_OR: res = _a | _b; break; + case E_XOR: res = _a ^ _b; break; + case E_EQL: res = _a == _b; break; + default: throw new Error('Unkown operation ' + op); + } + outData[idx] = res; + idx ++; + } + } + } + } + return out; + }, + + /** + * negtive + */ + neg : function () { + var data = this._array; + for (var i = 0; i < this._size; i++) { + data[i] = -data[i]; + } + return this; + }, + + /** + * @return {NDArray} this + */ + sin : function () { + return this._mathAdapter(Math.sin); + }, + + /** + * @return {NDArray} this + */ + cos : function () { + return this._mathAdapter(Math.cos); + }, + + /** + * @return {NDArray} this + */ + tan : function () { + return this._mathAdapter(Math.tan); + }, + + /** + * @return {NDArray} this + */ + abs : function () { + return this._mathAdapter(Math.abs); + }, + + /** + * @return {NDArray} this + */ + log : function () { + return this._mathAdapter(Math.log); + }, + + /** + * @return {NDArray} this + */ + sqrt : function () { + return this._mathAdapter(Math.sqrt); + }, + + /** + * @return {NDArray} this + */ + ceil : function () { + return this._mathAdapter(Math.ceil); + }, + + /** + * @return {NDArray} this + */ + floor : function () { + return this._mathAdapter(Math.floor); + }, + + /** + * @return {NDArray} this + */ + pow : function (exp) { + var data = this._array; + for (var i = 0; i < this._size; i++) { + data[i] = Math.pow(data[i], exp); + } + return this; + }, + + _mathAdapter : function (mathFunc) { + var data = this._array; + for (var i = 0; i < this._size; i++) { + data[i] = mathFunc(data[i]); + } + return this; + }, + + /** + * @param {Number} decimals + * @return {NDArray} this + */ + round : function (decimals) { + decimals = Math.floor(decimals || 0); + var offset = Math.pow(10, decimals); + var data = this._array; + if (decimals === 0) { + for (var i = 0; i < this._size; i++) { + data[i] = Math.round(data[i]); + } + } else { + for (var i = 0; i < this._size; i++) { + data[i] = Math.round(data[i] * offset) / offset; + } + } + return this; + }, + /** + * @param {Number} min + * @param {Number} max + * Clip to [min, max] + */ + clip : function (min, max) { + // TODO : Support array_like param + var data = this._array; + for (var i = 0; i < this._size; i++) { + data[i] = Math.max(Math.min(data[i], max), min); + } + return this; + }, + + /** + * Indexing array, support range indexing + * @param {string} index + * Index syntax can be an integer 1, 2, 3 + * Or more complex range indexing + * '1:2' + * '1:2, 1:2' + * '1:2, :' + * More about the indexing syntax can check the doc of numpy ndarray + * @param {NDArray} [out] + * @return {NDArray} New created sub array, or out if given + */ + get : function (index, out) { + if (typeof(index) == 'number') { + index = index.toString(); + } + var strides = calculateDimStrides(this._shape); + var res = this._parseRanges(index); + var ranges = res[0]; + var shape = res[1]; + + if (ranges.length > this._shape.length) { + throw new Error('Too many indices'); + } + // Get data + var len = ranges.length; + var data; + if (shape.length) { + out = new NDArray(this._dtype); + out.initFromShape(shape); + data = out._array; + } else { + data = []; + } + + var source = this._array; + var cursor = 0; + function getPiece(axis, offset) { + var range = ranges[axis]; + var stride = strides[axis]; + if (axis < len-1) { + if (range[2] > 0) { + for (var i = range[0]; i < range[1]; i += range[2]) { + getPiece(axis+1, offset + stride * i); + } + } else { + for (var i = range[0]; i > range[1]; i += range[2]) { + getPiece(axis+1, offset + stride * i); + } + } + } else { + if (range[2] > 0) { + for (var i = range[0]; i < range[1]; i += range[2]) { + for (var j = 0; j < stride; j++) { + data[cursor++] = source[i*stride + j + offset]; + } + } + } else { + for (var i = range[0]; i > range[1]; i += range[2]) { + for (var j = 0; j < stride; j++) { + data[cursor++] = source[i*stride + j + offset]; + } + } + } + } + } + + getPiece(0, 0); + + if (shape.length) { + // Return scalar + return out; + } else { + return data[0]; + } + + }, + + /** + * + * @param {string} index + * index syntax can be an integer 1, 2, 3 + * Or more complex range indexing + * '1:2' + * '1:2, 1:2' + * '1:2, :' + * More about the indexing syntax can check the doc of numpy ndarray + * @param {NDArray} ndarray Ndarray data source + * @return {NDArray} this + */ + set : function (index, narray) { + if (typeof(index) == 'number') { + index = index.toString(); + } + var strides = calculateDimStrides(this._shape); + var res = this._parseRanges(index); + var ranges = res[0]; + var shape = res[1]; + + if (ranges.length > this._shape.length) { + throw new Error('Too many indices'); + } + var isScalar = typeof(narray) == 'number'; + var len = ranges.length; + var data = this._array; + if (isScalar) { + // Set with a single scalar + var source = narray; + } else { + if (!arrayEqual(shape, narray.shape())) { + throw new Error(broadcastErrorMsg(shape, narray.shape())); + } + var source = narray._array; + } + var cursor = 0; + var setPiece = function (axis, offset) { + var range = ranges[axis]; + var stride = strides[axis]; + if (axis < len-1) { + if (range[2] > 0) { + for (var i = range[0]; i < range[1]; i += range[2]) { + setPiece(axis+1, offset + stride * i); + } + } else { + for (var i = range[0]; i > range[1]; i += range[2]) { + setPiece(axis+1, offset + stride * i); + } + } + } else { + if (range[2] > 0) { + for (var i = range[0]; i < range[1]; i += range[2]) { + for (var j = 0; j < stride; j++) { + if (isScalar) { + data[i*stride + j + offset] = source; + } else { + data[i*stride + j + offset] = source[cursor++]; + } + } + } + } else { + for (var i = range[0]; i > range[1]; i += range[2]) { + for (var j = 0; j < stride; j++) { + if (isScalar) { + data[i*stride + j + offset] = source; + } else { + data[i*stride + j + offset] = source[cursor++]; + } + } + } + } + } + }; + + setPiece(0, 0); + + return this; + }, + + /** + * Insert values along the given axis before the given indices. + * @param {Number|Array} obj + * Object that defines the index or indices before + * which values is inserted. + * @param {Number|Array|NDArray} values + * Values to insert + * @param {Number} [axis] + * @return {NDArray} this + */ + insert : kwargs(function (obj, values, axis) { + var data = this._array; + var isObjScalar = false; + if (typeof(obj) === 'number') { + obj = [obj]; + isObjScalar = true; + } + if (typeof(values) === 'number') { + values = new NDArray([values]); + } else if (values instanceof Array) { + values = new NDArray(values); + } + + if (typeof(axis) === 'undefined') { + this._shape = [this._size]; + axis = 0; + } + // Checking if indices is valid + var prev = obj[0]; + var axisSize = this._shape[axis]; + for (var i = 0; i < obj.length; i++) { + if (obj[i] < 0) { + obj[i] = axisSize + obj[i]; + } + if (obj[i] > axisSize) { + throw new Error(indexOutofBoundsErrorMsg(obj[i])); + } + if (obj[i] < prev) { + throw new Error('Index must be in ascending order'); + } + prev = obj[i]; + } + // Broadcasting + var targetShape = this._shape.slice(); + if (isObjScalar) { + targetShape.splice(axis, 1); + } else { + targetShape[axis] = obj.length; + } + + var sourceShape = values._shape; + var cs = sourceShape.length - 1; + var ct = targetShape.length - 1; + + var valueBroadcasted = values; + while (cs >= 0 && ct >= 0) { + if (sourceShape[cs] === 1) { + valueBroadcasted = values.repeat(targetShape[ct], cs); + } else if(sourceShape[cs] !== targetShape[ct]) { + throw new Error(broadcastErrorMsg(sourceShape, targetShape)); + } + cs --; + ct --; + } + values = valueBroadcasted; + + // Calculate indices to insert + var stride = calculateDimStride(this._shape, axis); + var axisSize = this._shape[axis]; + var offsetStride = axisSize * stride; + var offsetRepeats = this._size / offsetStride; + + var objLen = obj.length; + var indices = new Uint32Array(offsetRepeats * objLen); + + var cursor = 0; + for (var offset = 0; offset < this._size; offset += offsetStride) { + for (var i = 0; i < objLen; i++) { + var objIdx = obj[i]; + indices[cursor++] = offset + objIdx * stride; + } + } + + var resShape = this._shape.slice(); + resShape[axis] += obj.length; + var resSize = getSize(resShape); + if (this._array.length < resSize) { + var data = new ArrayConstructor[this._dtype](resSize); + } else { + var data = this._array; + } + var source = this._array; + var valuesArr = values._array; + + var idxCursor = indices.length - 1; + var end = this._size; + var start = indices[idxCursor]; + var dataCursor = resSize - 1; + var valueCursor = values._size - 1; + while (idxCursor >= 0) { + // Copy source data; + for (var i = end - 1; i >= start; i--) { + data[dataCursor--] = source[i]; + } + end = start; + start = indices[--idxCursor]; + // Copy inserted data; + for (var i = 0; i < stride; i++) { + if (valueCursor < 0) { + valueCursor = values._size - 1; + } + data[dataCursor--] = valuesArr[valueCursor--]; + } + } + // Copy the rest + for (var i = end - 1; i >= 0; i--) { + data[dataCursor--] = source[i]; + } + + this._array = data; + this._shape = resShape; + this._size = resSize; + + return this; + }), + + append : function () { + console.warn('TODO'); + }, + + /** + * Delete values along the axis + * @param {Array|Number} obj + * @param {Number} [axis] + * @return {NDArray} this + */ + 'delete' : kwargs(function (obj, axis) { + var data = this._array; + if (typeof(obj) === 'number') { + obj = [obj]; + } + var size = this._size; + + if (typeof(axis) === 'undefined') { + this._shape = [size]; + axis = 0; + } + + var stride = calculateDimStride(this._shape, axis); + var axisSize = this._shape[axis]; + + var offsetStride = stride * axisSize; + var cursor = 0; + for (var offset = 0; offset < size; offset += offsetStride) { + var start = 0; + var end = obj[0]; + var objCursor = 0; + while(objCursor < obj.length) { + if (end < 0) { + end = end + axisSize; + } + if (end > axisSize) { + throw new Error(indexOutofBoundsErrorMsg(end)); + } + if (end < start) { + throw new Error('Index must be in ascending order'); + } + for (var i = start; i < end; i++) { + for (var j = 0; j < stride; j++) { + data[cursor++] = data[i * stride + j + offset]; + } + } + start = end + 1; + end = obj[++objCursor]; + } + // Copy the rest + for (var i = start; i < axisSize; i++) { + for (var j = 0; j < stride; j++) { + data[cursor++] = data[i * stride + j + offset]; + } + } + } + this._shape[axis] -= obj.length; + this._size = getSize(this._shape); + + return this; + }), + + _parseRanges : function (index) { + var rangesStr = index.split(/\s*,\s*/); + + // Parse range of each axis + var ranges = []; + var shape = []; + var j = 0; + for (var i = 0; i < rangesStr.length; i++) { + if (rangesStr[i] === '...') { + var end = this._shape.length - (rangesStr.length - i); + while (j <= end) { + ranges.push([0, this._shape[j], 1]); + shape.push(this._shape[j]); + j++; + } + } else { + var range = parseRange(rangesStr[i], this._shape[j]); + ranges.push(range); + if(rangesStr[i].indexOf(':') >= 0) { + var size = Math.floor((range[1] - range[0]) / range[2]); + size = size < 0 ? 0 : size; + // Get a range not a item + shape.push(size); + } + j++; + } + } + // Copy the lower dimension size + for (; j < this._shape.length; j++) { + shape.push(this._shape[j]); + } + + return [ranges, shape]; + }, + + /** + * Export normal js array + * @return {Array} + */ + toArray : function () { + var data = this._array; + var cursor = 0; + + var shape = this._shape; + var dim = shape.length; + + function create(axis, out) { + var len = shape[axis]; + for (var i = 0; i < len; i++) { + if (axis < dim-1) { + create(axis+1, out[i] = []); + } else { + out[i] = data[cursor++]; + } + } + } + + var output = []; + create(0, output); + + return output; + }, + + /** + * Create a copy of self + * @return {NDArray} + */ + copy : function () { + var numArr = new NDArray(); + numArr._array = ArraySlice.call(this._array); + numArr._shape = this._shape.slice(); + numArr._dtype = this._dtype; + numArr._size = this._size; + + return numArr; + }, + + constructor : NDArray +}; + +/** + * + * @param {Number} [min=0] + * @param {Number} max + * @param {Number} [step=1] + * @param {string} [dtype] + * @return {NDArray} + */ +NDArray.range = kwargs(function (min, max, step, dtype) { + var args = ArraySlice.call(arguments); + // Last argument describe the data type of ndarray + var lastArg = args[args.length-1]; + if (typeof(lastArg) == 'string') { + var dtype = lastArg; + args.pop(); + } + if (args.length === 1) { + max = args[0]; + step = 1; + min = 0; + } else if(args.length == 2) { + step = 1; + } + dtype = dtype || 'number'; + + var array = new ArrayConstructor[dtype](Math.ceil((max - min)/step)); + var cursor = 0; + for (var i = min; i < max; i+=step) { + array[cursor++] = i; + } + var ndarray = new NDArray(); + ndarray._array = array; + ndarray._shape = [array.length]; + ndarray._dtype = dtype; + ndarray._size = array.length; + + return ndarray; + +}); + +/** + * + * @param {Array} shape + * @param {String} [dtype] + * @return {NDArray} + */ +NDArray.zeros = kwargs(function (shape, dtype) { + var ret = new NDArray(dtype); + ret.initFromShape(shape); + return ret; +}); + +/** + * Python like array indexing + * http://www.python.org/dev/peps/pep-0204/ + * + * @param {string} index + * index can be a simple integer 1,2,3, + * or a range 2:10, 2:10:1 + * example : + * 2:10 => [2, 10, 1], + * 10:2:-2 => [10, 2, -2], + * : => [0, dimSize, 1], + * ::-1 => [dimSize-1, -1, -1], + * @param {number} dimSize + * @return {Array} a tuple array [startOffset, endOffset, sliceStep] + */ +function parseRange(index, dimSize) { + if (index.indexOf(':') >= 0) { + // Range indexing; + var res = index.split(/\s*:\s*/); + + var step = parseInt(res[2] || 1, 10); + var start, end; + if (step === 0) { + throw new Error('Slice step cannot be zero'); + } + else if (step > 0) { + start = parseInt(res[0] || 0, 10); + end = parseInt(res[1] || dimSize, 10); + } + else { + start = parseInt(res[0] || dimSize - 1, 10); + end = parseInt(res[1] || -1, 10); + } + // Negtive offset + if (start < 0) { + start = dimSize + start; + } + // Negtive offset + if (end < 0 && res[1]) { + end = dimSize + end; + } + if (step > 0) { + // Clamp to [0-dimSize] + start = Math.max(Math.min(dimSize, start), 0); + // Clamp to [0-dimSize] + end = Math.max(Math.min(dimSize, end), 0); + } else { + // Clamp to [0-dimSize) + start = Math.max(Math.min(dimSize-1, start), -1); + // Clamp to [0-dimSize) + end = Math.max(Math.min(dimSize-1, end), -1); + } + return [start, end, step]; + } else { + var start = parseInt(index, 10); + // Negtive offset + if (start < 0) { + start = dimSize + start; + } + if (start < 0 || start > dimSize) { + throw new Error(indexOutofBoundsErrorMsg(index)); + } + // Clamp to [0-dimSize) + start = Math.max(Math.min(dimSize-1, start), 0); + return [start, start+1, 1]; + } +} + +function getSize(shape) { + var size = shape[0]; + for (var i = 1; i < shape.length; i++) { + size *= shape[i]; + } + return size; +} + +function getDimension(array) { + var dim = 1; + var el = array[0]; + while (el instanceof Array) { + el = el[0]; + dim ++; + } + return dim; +} + +function getShape(array) { + var shape = [array.length]; + var el = array[0]; + while (el instanceof Array) { + shape.push(el.length); + el = el[0]; + } + return shape; +} + +function calculateDimStride(shape, axis) { + if (axis == shape.length-1) { + return 1; + } + var stride = shape[axis+1]; + for (var i = axis+2; i < shape.length; i++) { + stride *= shape[i]; + } + return stride; +} + +function calculateDimStrides(shape) { + // Calculate stride of each axis + var strides = []; + var tmp = 1; + var len = getSize(shape); + for (var i = 0; i < shape.length; i++) { + tmp *= shape[i]; + strides.push(len / tmp); + } + + return strides; +} + +function arrayEqual(arr1, arr2) { + if (arr1.length !== arr2.length) { + return false; + } + for (var i = 0; i 0) { + sector.style.brushType = 'both'; + } + if (sector.highlightStyle.lineWidth > 0) { + sector.highlightStyle.brushType = 'both'; + } + ecData.pack( + sector, + this.chordSeries[0], + 0, + data[i], i, + group.name + ); + if (showLabel) { + var halfAngle = [_start + _end] / 2; + halfAngle %= 360; // Constrain to [0,360] + var isRightSide = halfAngle <= 90 + || halfAngle >= 270; + halfAngle = halfAngle * Math.PI / 180; + var v = [Math.cos(halfAngle), -Math.sin(halfAngle)]; + + var distance = this.showScaleText ? 35 + labelDistance : labelDistance; + var start = vec2.scale([], v, this.outerRadius + distance); + vec2.add(start, start, this.center); + + var labelShape = { + zlevel: this._zlevelBase - 1, + hoverable: false, + style: { + text: group.name, + textAlign: isRightSide ? 'left' : 'right', + color: labelColor + } + }; + if (rotateLabel) { + labelShape.rotation = isRightSide ? halfAngle : Math.PI + halfAngle; + if (isRightSide) { + labelShape.style.x = this.outerRadius + distance; + } else { + labelShape.style.x = -this.outerRadius - distance; + } + labelShape.style.y = 0; + labelShape.position = this.center; + } else { + labelShape.style.x = start[0]; + labelShape.style.y = start[1]; + } + labelShape.style.textColor = this.deepQuery( + [group, this.chordSerieSample], + 'itemStyle.normal.label.textStyle.color' + ) || '#fff'; + labelShape.style.textFont = this.getFont(this.deepQuery( + [group, this.chordSerieSample], + 'itemStyle.normal.label.textStyle' + )); + labelShape = new TextShape(labelShape); + this.shapeList.push(labelShape); + } + + sector.onmouseover = createMouseOver(i); + sector.onmouseout = createMouseOut(); + + sector = new SectorShape(sector); + this.shapeList.push(sector); + this.sectorShapes.push(sector); + } + }, + + _buildChords : function (angles, dataArr) { + var len = angles.length; + if (!len) { + return; + } + var len2 = angles[0][0].length; + + var ribbonLineStyle + = this.chordSerieSample.itemStyle.normal.chordStyle.lineStyle; + var ribbonLineStyleEmphsis + = this.chordSerieSample.itemStyle.emphasis.chordStyle.lineStyle; + + for (var i = 0; i < len; i++) { + for (var j = 0; j < len; j++) { + for (var k = 0; k < len2; k++) { + if (this.chordShapes[j][i][k]) { + continue; + } + + var angleIJ0 = angles[i][j][k][0]; + var angleJI0 = angles[j][i][k][0]; + + var angleIJ1 = angles[i][j][k][1]; + var angleJI1 = angles[j][i][k][1]; + + if ( + angleIJ0 - angleJI1 === 0 + || angleJI0 - angleJI1 === 0 + ) { + this.chordShapes[i][j][k] = null; + continue; + } + + var color; + if (len2 === 1) { + if (angleIJ1 - angleIJ0 <= angleJI1 - angleJI0) { + color = this.getColor(this.groups[i].name); + } else { + color = this.getColor(this.groups[j].name); + } + } else { + color = this.getColor(this.chordSeries[k].name); + } + var s0 = !this.clockWise ? (360 - angleIJ1) : angleIJ0; + var s1 = !this.clockWise ? (360 - angleIJ0) : angleIJ1; + var t0 = !this.clockWise ? (360 - angleJI1) : angleJI0; + var t1 = !this.clockWise ? (360 - angleJI0) : angleJI1; + var chord = { + zlevel: this._zlevelBase, + style: { + x: this.center[0], + y: this.center[1], + r: this.innerRadius, + source0: s0 - this.startAngle, + source1: s1 - this.startAngle, + target0: t0 - this.startAngle, + target1: t1 - this.startAngle, + brushType: 'both', + opacity: 0.5, + color: color, + lineWidth: ribbonLineStyle.width, + strokeColor: ribbonLineStyle.color + }, + clickable: this.chordSerieSample.clickable, + highlightStyle: { + brushType: 'both', + lineWidth: ribbonLineStyleEmphsis.width, + strokeColor: ribbonLineStyleEmphsis.color + } + }; + + ecData.pack( + chord, + this.chordSeries[k], + k, + dataArr[i][j][k], i + '-' +j, + this.groups[i].name, + this.groups[j].name, + dataArr[j][i][k] + ); + + chord = new RibbonShape(chord); + this.chordShapes[i][j][k] = chord; + this.shapeList.push(chord); + } + } + } + }, + + _buildScales : function ( + values, + unitPostfix, + angles, + unitValue + ) { + for (var i = 0; i < angles.length; i++) { + var subStartAngle = angles[i][0]; + var subEndAngle = angles[i][1]; + + var scaleAngle = subStartAngle; + while (scaleAngle < subEndAngle) { + var thelta = ((this.clockWise ? (360 - scaleAngle) : scaleAngle) + + this.startAngle) / 180 * Math.PI; + var v = [ + Math.cos(thelta), + -Math.sin(thelta) + ]; + var start = vec2.scale([], v, this.outerRadius + 1); + vec2.add(start, start, this.center); + var end = vec2.scale([], v, this.outerRadius + this.scaleLineLength); + vec2.add(end, end, this.center); + var scaleShape = { + zlevel: this._zlevelBase - 1, + hoverable: false, + style: { + xStart: start[0], + yStart: start[1], + xEnd: end[0], + yEnd: end[1], + lineCap: 'round', + brushType: 'stroke', + strokeColor: '#666', + lineWidth: 1 + } + }; + + scaleShape = new LineShape(scaleShape); + this.shapeList.push(scaleShape); + + scaleAngle += this.scaleUnitAngle; + } + if (!this.showScaleText) { + continue; + } + + var scaleTextAngle = subStartAngle; + var step = unitValue * 5 * this.scaleUnitAngle; + var scaleValues = NDArray.range(0, values[i], step).toArray(); + while (scaleTextAngle < subEndAngle) { + var thelta = this.clockWise + ? (360 - scaleTextAngle) : scaleTextAngle; + thelta = (thelta + this.startAngle) % 360; + var isRightSide = thelta <= 90 + || thelta >= 270; + var textShape = { + zlevel: this._zlevelBase - 1, + hoverable: false, + style: { + x: isRightSide + ? this.outerRadius + this.scaleLineLength + 4 + : -this.outerRadius - this.scaleLineLength - 4, + y: 0, + text: Math.round(scaleValues.shift()*10)/10 + + unitPostfix, + textAlign: isRightSide ? 'left' : 'right' + }, + position: this.center.slice(), + rotation: isRightSide + ? [thelta / 180 * Math.PI, 0, 0] + : [ + (thelta + 180) / 180 * Math.PI, + 0, 0 + ] + }; + + textShape = new TextShape(textShape); + this.shapeList.push(textShape); + scaleTextAngle += this.scaleUnitAngle * 5; + } + } + }, + + normalizeValue : function (values) { + var result = []; + var max = new NDArray(values).max(); + var unitPostfix, unitScale; + if (max > 10000) { + unitPostfix = 'k'; + unitScale = 1 / 1000; + } else if (max > 10000000) { + unitPostfix = 'm'; + unitScale = 1 / 1000000; + } else if (max > 10000000000) { + unitPostfix = 'b'; + unitScale = 1 / 1000000000; + } else { + unitPostfix = ''; + unitScale = 1; + } + + for (var i = 0; i < values.length; i++) { + result[i] = values[i] * unitScale; + } + return [result, unitPostfix]; + }, + + refresh : function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + + // Config + this.chordSeries = []; + + this.strokeFix = 0; + // Adjacency matrix + this.sectorShapes = []; + this.chordShapes = []; + + this.scaleLineLength = 4; + this.scaleUnitAngle = 4; + + this.legend = this.component.legend; + if (this.legend) { + this.getColor = function(param) { + return this.legend.getColor(param); + }; + this.isSelected = function(param) { + return this.legend.isSelected(param); + }; + } else { + var colorIndices = {}; + var colorMap = {}; + var count = 0; + this.getColor = function (key) { + if (colorMap[key]) { + return colorMap[key]; + } + if (colorIndices[key] === undefined) { + colorIndices[key] = count++; + } + // key is serie name + for (var i = 0; i < this.chordSeries.length; i++) { + if (this.chordSeries[i].name === key) { + colorMap[key] = this.query( + this.chordSeries[i], + 'itemStyle.normal.color' + ); + break; + } + } + if (!colorMap[key]) { + var len = this.groups.length; + // key is group name + for (var i = 0; i < len; i++) { + if (this.groups[i].name === key) { + colorMap[key] = this.query( + this.groups[i], + 'itemStyle.normal.color' + ); + break; + } + } + } + if (!colorMap[key]) { + colorMap[key] = this.zr.getColor(colorIndices[key]); + } + + return colorMap[key]; + }; + this.isSelected = function () { + return true; + }; + } + + this.backupShapeList(); + this._buildShape(); + }, + + reformOption : function (opt) { + var _merge = zrUtil.merge; + opt = _merge( + opt || {}, + this.ecTheme.chord + ); + opt.itemStyle.normal.label.textStyle = _merge( + opt.itemStyle.normal.label.textStyle || {}, + this.ecTheme.textStyle + ); + } + }; + + zrUtil.inherits(Chord, ChartBase); + zrUtil.inherits(Chord, ComponentBase); + + // 图表注册 + require('../chart').define('chord', Chord); + + return Chord; +}); +/** + * 图数据结构 + * @module echarts/data/Graph + * @author pissang(http://www.github.com/pissang) + */ +define('echarts/data/Graph',['require','zrender/tool/util'],function(require) { + + var util = require('zrender/tool/util'); + + + + /** + * @alias module:echarts/data/Graph + * @constructor + * @param {boolean} directed + */ + var Graph = function(directed) { + /** + * 是否是有向图 + * @type {boolean} + * @private + */ + this._directed = directed || false; + + /** + * [nodes description] + * @type {Array} + */ + this.nodes = []; + this.edges = []; + + this._nodesMap = {}; + this._edgesMap = {}; + }; + + /** + * 添加一个新的节点 + * @param {string} name 节点名称 + * @param {*} [data] 存储的数据 + */ + Graph.prototype.addNode = function(name, data) { + if (this._nodesMap[name]) { + return this._nodesMap[name]; + } + + var node = new Graph.Node(name, data); + + this.nodes.push(node); + + this._nodesMap[name] = node; + return node; + }; + + /** + * 获取节点 + * @param {string} name + * @return {module:echarts/data/Graph~Node} + */ + Graph.prototype.getNodeByName = function(name) { + return this._nodesMap[name]; + }; + + /** + * 添加边 + * @param {string|module:echarts/data/Graph~Node} n1 + * @param {string|module:echarts/data/Graph~Node} n2 + * @param {*} data + * @return {module:echarts/data/Graph~Edge} + */ + Graph.prototype.addEdge = function(n1, n2, data) { + if (typeof(n1) == 'string') { + n1 = this._nodesMap[n1]; + } + if (typeof(n2) == 'string') { + n2 = this._nodesMap[n2]; + } + if (!n1 || !n2) { + return; + } + + var key = n1.name + '-' + n2.name; + if (this._edgesMap[key]) { + return this._edgesMap[key]; + } + + var edge = new Graph.Edge(n1, n2, data); + + if (this._directed) { + n1.outEdges.push(edge); + n2.inEdges.push(edge); + } + n1.edges.push(edge); + n2.edges.push(edge); + + this.edges.push(edge); + this._edgesMap[key] = edge; + + return edge; + }; + + /** + * 移除边 + * @param {module:echarts/data/Graph~Edge} edge + */ + Graph.prototype.removeEdge = function(edge) { + var n1 = edge.node1; + var n2 = edge.node2; + var key = n1.name + '-' + n2.name; + if (this._directed) { + n1.outEdges.splice(util.indexOf(n1.outEdges, edge), 1); + n2.inEdges.splice(util.indexOf(n2.inEdges, edge), 1); + } + n1.edges.splice(util.indexOf(n1.edges, edge), 1); + n2.edges.splice(util.indexOf(n2.edges, edge), 1); + + delete this._edgesMap[key]; + this.edges.splice(util.indexOf(this.edges, edge), 1); + }; + + /** + * 移除节点(及其邻接边) + * @param {module:echarts/data/Graph~Node|string} node + */ + Graph.prototype.removeNode = function(node) { + if (typeof(node) === 'string') { + node = this._nodesMap[node]; + if (!node) { + return; + } + } + + delete this._nodesMap[node.name]; + this.nodes.splice(util.indexOf(this.nodes, node), 1); + + for (var i = 0; i < this.edges.length;) { + var edge = this.edges[i]; + if (edge.node1 == node || edge.node2 == node) { + this.removeEdge(edge); + } else { + i++; + } + } + }; + + /** + * 线性遍历所有节点 + * @param {Function} cb + * @param {*} context + */ + Graph.prototype.eachNode = function(cb, context) { + for (var i = 0; i < this.nodes.length; i++) { + cb.call(context, this.nodes[i]); + } + }; + + /** + * 线性遍历所有边 + * @param {Function} cb + * @param {*} context + */ + Graph.prototype.eachEdge = function(cb, context) { + for (var i = 0; i < this.edges.length; i++) { + cb.call(context, this.edges[i]); + } + }; + + /** + * 清空图 + */ + Graph.prototype.clear = function() { + this.nodes.length = 0; + this.edges.length = 0; + + this._nodesMap = {}; + this._edgesMap = {}; + }; + + /** + * 图节点 + * @alias module:echarts/data/Graph~Node + * @param {string} name + * @param {*} [data] + */ + var Node = function(name, data) { + /** + * 节点名称 + * @type {string} + */ + this.name = name; + /** + * 节点存储的数据 + * @type {*} + */ + this.data = data || null; + /** + * 入边,只在有向图上有效 + * @type {Array.} + */ + this.inEdges = []; + /** + * 出边,只在有向图上有效 + * @type {Array.} + */ + this.outEdges = []; + /** + * 邻接边 + * @type {Array.} + */ + this.edges = []; + }; + + /** + * 度 + * @return {number} + */ + Node.prototype.degree = function() { + return this.edges.length; + }; + + /** + * 入度,只在有向图上有效 + * @return {number} + */ + Node.prototype.inDegree = function() { + return this.inEdges.length; + }; + + /** + * 出度,只在有向图上有效 + * @return {number} + */ + Node.prototype.outDegree = function() { + return this.outEdges.length; + }; + + /** + * 图边 + * @alias module:echarts/data/Graph~Edge + * @param {module:echarts/data/Graph~Node} node1 + * @param {module:echarts/data/Graph~Node} node2 + * @param {extra} data + */ + var Edge = function(node1, node2, data) { + /** + * 节点1,如果是有向图则为源节点 + * @type {module:echarts/data/Graph~Node} + */ + this.node1 = node1; + /** + * 节点2,如果是有向图则为目标节点 + * @type {module:echarts/data/Graph~Node} + */ + this.node2 = node2; + + /** + * 边存储的数据 + * @type {*} + */ + this.data = data || null; + }; + + Graph.Node = Node; + Graph.Edge = Edge; + + /** + * 从邻接矩阵生成 + * ``` + * TARGET + * -1--2--3--4--5- + * 1| x x x x x + * 2| x x x x x + * 3| x x x x x SOURCE + * 4| x x x x x + * 5| x x x x x + * ``` + * 节点的行列总和会被写到`node.data.value` + * 对于有向图会计算每一行的和写到`node.data.outValue`, + * 计算每一列的和写到`node.data.inValue`。 + * 边的权重会被然后写到`edge.data.weight`。 + * 如果是有向图被写到`edge.data.sourceWeight`和`edge.data.targetWeight` + * + * @method module:echarts/data/Graph.fromMatrix + * @param {Array.} nodesData 节点信息,必须有`name`属性 + * @param {Array} matrix 邻接矩阵 + * @param {boolean} directed 是否是有向图 + * @return {module:echarts/data/Graph} + */ + Graph.fromMatrix = function(nodesData, matrix, directed) { + if ( + !matrix || !matrix.length + || (matrix[0].length !== matrix.length) + || (nodesData.length !== matrix.length) + ) { + // Not a valid data + return; + } + + var size = matrix.length; + var graph = new Graph(directed); + + for (var i = 0; i < size; i++) { + var node = graph.addNode(nodesData[i].name, {}); + node.data.value = 0; + if (directed) { + node.data.outValue = node.data.inValue = 0; + } + } + for (var i = 0; i < size; i++) { + for (var j = 0; j < size; j++) { + var item = matrix[i][j]; + if (directed) { + graph.nodes[i].outValue += item; + graph.nodes[j].inValue += item; + } + graph.nodes[i].value += item; + graph.nodes[j].value += item; + } + } + + for (var i = 0; i < size; i++) { + for (var j = i; j < size; j++) { + var item = matrix[i][j]; + if (item === 0) { + continue; + } + var n1 = graph.nodes[i]; + var n2 = graph.nodes[j]; + var edge = graph.addEdge(n1, n2, {}); + if (directed) { + edge.data.sourceWeight = item; + edge.data.targetWeight = matrix[j][i]; + } + edge.data.weight = item; + if (i !== j) { + if (directed) { + var inEdge = graph.addEdge(n2, n1, {}); + inEdge.sourceWeight = matrix[j][i]; + inEdge.targetWeight = item; + } + edge.data.weight += matrix[j][i]; + } + } + } + }; + + return Graph; +}); +// 1. Graph Drawing by Force-directed Placement +// 2. http://webatlas.fr/tempshare/ForceAtlas2_Paper.pdf +define('echarts/layout/forceLayoutWorker',['require','zrender/tool/vector'],function __echartsForceLayoutWorker(require) { + + + + var vec2; + // In web worker + var inWorker = typeof(window) === 'undefined' && typeof(require) === 'undefined'; + if (inWorker) { + vec2 = { + create: function(x, y) { + var out = new Float32Array(2); + out[0] = x || 0; + out[1] = y || 0; + return out; + }, + dist: function(a, b) { + var x = b[0] - a[0]; + var y = b[1] - a[1]; + return Math.sqrt(x*x + y*y); + }, + len: function(a) { + var x = a[0]; + var y = a[1]; + return Math.sqrt(x*x + y*y); + }, + scaleAndAdd: function(out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + return out; + }, + scale: function(out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + return out; + }, + add: function(out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + return out; + }, + sub: function(out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + return out; + }, + normalize: function(out, a) { + var x = a[0]; + var y = a[1]; + var len = x*x + y*y; + if (len > 0) { + //TODO: evaluate use of glm_invsqrt here? + len = 1 / Math.sqrt(len); + out[0] = a[0] * len; + out[1] = a[1] * len; + } + return out; + }, + negate: function(out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + return out; + }, + copy: function(out, a) { + out[0] = a[0]; + out[1] = a[1]; + return out; + }, + set: function(out, x, y) { + out[0] = x; + out[1] = y; + return out; + } + }; + } + else { + vec2 = require('zrender/tool/vector'); + } + var ArrayCtor = typeof(Float32Array) == 'undefined' ? Array : Float32Array; + + /**************************** + * Class: Region + ***************************/ + + function Region() { + + this.subRegions = []; + + this.nSubRegions = 0; + + this.node = null; + + this.mass = 0; + + this.centerOfMass = null; + + this.bbox = new ArrayCtor(4); + + this.size = 0; + } + + // Reset before update + Region.prototype.beforeUpdate = function() { + for (var i = 0; i < this.nSubRegions; i++) { + this.subRegions[i].beforeUpdate(); + } + this.mass = 0; + if (this.centerOfMass) { + this.centerOfMass[0] = 0; + this.centerOfMass[1] = 0; + } + this.nSubRegions = 0; + this.node = null; + }; + // Clear after update + Region.prototype.afterUpdate = function() { + this.subRegions.length = this.nSubRegions; + for (var i = 0; i < this.nSubRegions; i++) { + this.subRegions[i].afterUpdate(); + } + }; + + Region.prototype.addNode = function(node) { + if (this.nSubRegions === 0) { + if (this.node == null) { + this.node = node; + return; + } + else { + this._addNodeToSubRegion(this.node); + this.node = null; + } + } + this._addNodeToSubRegion(node); + + this._updateCenterOfMass(node); + }; + + Region.prototype.findSubRegion = function(x, y) { + for (var i = 0; i < this.nSubRegions; i++) { + var region = this.subRegions[i]; + if (region.contain(x, y)) { + return region; + } + } + }; + + Region.prototype.contain = function(x, y) { + return this.bbox[0] <= x + && this.bbox[2] >= x + && this.bbox[1] <= y + && this.bbox[3] >= y; + }; + + Region.prototype.setBBox = function(minX, minY, maxX, maxY) { + // Min + this.bbox[0] = minX; + this.bbox[1] = minY; + // Max + this.bbox[2] = maxX; + this.bbox[3] = maxY; + + this.size = (maxX - minX + maxY - minY) / 2; + }; + + Region.prototype._newSubRegion = function() { + var subRegion = this.subRegions[this.nSubRegions]; + if (!subRegion) { + subRegion = new Region(); + this.subRegions[this.nSubRegions] = subRegion; + } + this.nSubRegions++; + return subRegion; + }; + + Region.prototype._addNodeToSubRegion = function(node) { + var subRegion = this.findSubRegion(node.position[0], node.position[1]); + var bbox = this.bbox; + if (!subRegion) { + var cx = (bbox[0] + bbox[2]) / 2; + var cy = (bbox[1] + bbox[3]) / 2; + var w = (bbox[2] - bbox[0]) / 2; + var h = (bbox[3] - bbox[1]) / 2; + + var xi = node.position[0] >= cx ? 1 : 0; + var yi = node.position[1] >= cy ? 1 : 0; + + var subRegion = this._newSubRegion(); + // Min + subRegion.setBBox( + // Min + xi * w + bbox[0], + yi * h + bbox[1], + // Max + (xi + 1) * w + bbox[0], + (yi + 1) * h + bbox[1] + ); + } + + subRegion.addNode(node); + }; + + Region.prototype._updateCenterOfMass = function(node) { + // Incrementally update + if (this.centerOfMass == null) { + this.centerOfMass = vec2.create(); + } + var x = this.centerOfMass[0] * this.mass; + var y = this.centerOfMass[1] * this.mass; + x += node.position[0] * node.mass; + y += node.position[1] * node.mass; + this.mass += node.mass; + this.centerOfMass[0] = x / this.mass; + this.centerOfMass[1] = y / this.mass; + }; + + /**************************** + * Class: Graph Node + ***************************/ + function GraphNode() { + this.position = vec2.create(); + + this.force = vec2.create(); + this.forcePrev = vec2.create(); + + this.speed = vec2.create(); + this.speedPrev = vec2.create(); + + // If repulsionByDegree is true + // mass = inDegree + outDegree + 1 + // Else + // mass is manually set + this.mass = 1; + + this.inDegree = 0; + this.outDegree = 0; + } + + /**************************** + * Class: Graph Edge + ***************************/ + function GraphEdge(node1, node2) { + this.node1 = node1; + this.node2 = node2; + + this.weight = 1; + } + + /**************************** + * Class: ForceLayout + ***************************/ + function ForceLayout() { + + this.barnesHutOptimize = false; + this.barnesHutTheta = 1.5; + + this.repulsionByDegree = false; + + this.preventOverlap = false; + this.strongGravity = true; + + this.gravity = 1.0; + this.scaling = 1.0; + + this.edgeWeightInfluence = 1.0; + + this.center = [0, 0]; + this.width = 500; + this.height = 500; + + this.maxSpeedIncrease = 1.0; + + this.nodes = []; + this.edges = []; + + this.bbox = new ArrayCtor(4); + + this._rootRegion = new Region(); + this._rootRegion.centerOfMass = vec2.create(); + + this._massArr = null; + + this._k = 0; + } + + ForceLayout.prototype.initNodes = function(positionArr, massArr, sizeArr) { + + this.temperature = 1.0; + + var nNodes = positionArr.length / 2; + this.nodes.length = 0; + var haveSize = typeof(sizeArr) !== 'undefined'; + + for (var i = 0; i < nNodes; i++) { + var node = new GraphNode(); + node.position[0] = positionArr[i * 2]; + node.position[1] = positionArr[i * 2 + 1]; + node.mass = massArr[i]; + if (haveSize) { + node.size = sizeArr[i]; + } + this.nodes.push(node); + } + + this._massArr = massArr; + if (haveSize) { + this._sizeArr = sizeArr; + } + }; + + ForceLayout.prototype.initEdges = function(edgeArr, edgeWeightArr) { + var nEdges = edgeArr.length / 2; + this.edges.length = 0; + var edgeHaveWeight = typeof(edgeWeightArr) !== 'undefined'; + + for (var i = 0; i < nEdges; i++) { + var sIdx = edgeArr[i * 2]; + var tIdx = edgeArr[i * 2 + 1]; + var sNode = this.nodes[sIdx]; + var tNode = this.nodes[tIdx]; + + if (!sNode || !tNode) { + continue; + } + sNode.outDegree++; + tNode.inDegree++; + var edge = new GraphEdge(sNode, tNode); + + if (edgeHaveWeight) { + edge.weight = edgeWeightArr[i]; + } + + this.edges.push(edge); + } + }; + + ForceLayout.prototype.update = function() { + + var nNodes = this.nodes.length; + + this.updateBBox(); + + this._k = 0.4 * this.scaling * Math.sqrt(this.width * this.height / nNodes); + + if (this.barnesHutOptimize) { + this._rootRegion.setBBox( + this.bbox[0], this.bbox[1], + this.bbox[2], this.bbox[3] + ); + this._rootRegion.beforeUpdate(); + for (var i = 0; i < nNodes; i++) { + this._rootRegion.addNode(this.nodes[i]); + } + this._rootRegion.afterUpdate(); + } + else { + // Update center of mass of whole graph + var mass = 0; + var centerOfMass = this._rootRegion.centerOfMass; + vec2.set(centerOfMass, 0, 0); + for (var i = 0; i < nNodes; i++) { + var node = this.nodes[i]; + mass += node.mass; + vec2.scaleAndAdd(centerOfMass, centerOfMass, node.position, node.mass); + } + vec2.scale(centerOfMass, centerOfMass, 1 / mass); + } + + // Reset forces + for (var i = 0; i < nNodes; i++) { + var node = this.nodes[i]; + vec2.copy(node.forcePrev, node.force); + vec2.copy(node.speedPrev, node.speed); + vec2.set(node.force, 0, 0); + } + + // Compute forces + // Repulsion + for (var i = 0; i < nNodes; i++) { + var na = this.nodes[i]; + if (this.barnesHutOptimize) { + this.applyRegionToNodeRepulsion(this._rootRegion, na); + } + else { + for (var j = i + 1; j < nNodes; j++) { + var nb = this.nodes[j]; + this.applyNodeToNodeRepulsion(na, nb, false); + } + } + + // Gravity + if (this.gravity > 0) { + this.applyNodeGravity(na); + } + } + + // Attraction + for (var i = 0; i < this.edges.length; i++) { + this.applyEdgeAttraction(this.edges[i]); + } + + // Apply forces + // var speed = vec2.create(); + var v = vec2.create(); + for (var i = 0; i < nNodes; i++) { + var node = this.nodes[i]; + var speed = node.speed; + + // var swing = vec2.dist(node.force, node.forcePrev); + // // var swing = 30; + // vec2.scale(node.force, node.force, 1 / (1 + Math.sqrt(swing))); + vec2.scale(node.force, node.force, 1 / 30); + + // contraint force + var df = vec2.len(node.force) + 0.1; + var scale = Math.min(df, 500.0) / df; + vec2.scale(node.force, node.force, scale); + + vec2.add(speed, speed, node.force); + + vec2.scale(speed, speed, this.temperature); + + // Prevent swinging + // Limited the increase of speed up to 100% each step + // TODO adjust by nodes number + vec2.sub(v, speed, node.speedPrev); + var swing = vec2.len(v); + if (swing > 0) { + vec2.scale(v, v, 1 / swing); + var base = vec2.len(node.speedPrev); + if (base > 0) { + swing = Math.min(swing / base, this.maxSpeedIncrease) * base; + vec2.scaleAndAdd(speed, node.speedPrev, v, swing); + } + } + + // constraint speed + var ds = vec2.len(speed); + var scale = Math.min(ds, 100.0) / (ds + 0.1); + vec2.scale(speed, speed, scale); + + vec2.add(node.position, node.position, speed); + } + }; + + ForceLayout.prototype.applyRegionToNodeRepulsion = (function() { + var v = vec2.create(); + return function applyRegionToNodeRepulsion(region, node) { + if (region.node) { // Region is a leaf + this.applyNodeToNodeRepulsion(region.node, node, true); + } + else { + vec2.sub(v, node.position, region.centerOfMass); + var d2 = v[0] * v[0] + v[1] * v[1]; + if (d2 > this.barnesHutTheta * region.size * region.size) { + var factor = this._k * this._k * (node.mass + region.mass) / (d2 + 1); + vec2.scaleAndAdd(node.force, node.force, v, factor * 2); + } + else { + for (var i = 0; i < region.nSubRegions; i++) { + this.applyRegionToNodeRepulsion(region.subRegions[i], node); + } + } + } + }; + })(); + + ForceLayout.prototype.applyNodeToNodeRepulsion = (function() { + var v = vec2.create(); + return function applyNodeToNodeRepulsion(na, nb, oneWay) { + if (na == nb) { + return; + } + vec2.sub(v, na.position, nb.position); + var d2 = v[0] * v[0] + v[1] * v[1]; + + // PENDING + if (d2 === 0) { + return; + } + + var factor; + var k2 = this._k * this._k; + var mass = na.mass + nb.mass; + + if (this.preventOverlap) { + var d = Math.sqrt(d2); + d = d - na.size - nb.size; + if (d > 0) { + factor = k2 * mass / (d * d); + } + else if (d <= 0) { + // A stronger repulsion if overlap + factor = k2 * 10 * mass; + } + } + else { + // Divide factor by an extra `d` to normalize the `v` + factor = k2 * mass / d2; + } + + if (!oneWay) { + vec2.scaleAndAdd(na.force, na.force, v, factor * 2); + } + vec2.scaleAndAdd(nb.force, nb.force, v, -factor * 2); + }; + })(); + + ForceLayout.prototype.applyEdgeAttraction = (function() { + var v = vec2.create(); + return function applyEdgeAttraction(edge) { + var na = edge.node1; + var nb = edge.node2; + + vec2.sub(v, na.position, nb.position); + var d = vec2.len(v); + + var w; + if (this.edgeWeightInfluence === 0) { + w = 1; + } + else if (this.edgeWeightInfluence == 1) { + w = edge.weight; + } + else { + w = Math.pow(edge.weight, this.edgeWeightInfluence); + } + + var factor; + + if (this.preventOverlap) { + d = d - na.size - nb.size; + if (d <= 0) { + // No attraction + return; + } + } + + var factor = -w * d / this._k; + + vec2.scaleAndAdd(na.force, na.force, v, factor); + vec2.scaleAndAdd(nb.force, nb.force, v, -factor); + }; + })(); + + ForceLayout.prototype.applyNodeGravity = (function() { + var v = vec2.create(); + return function(node) { + // PENDING Move to centerOfMass or [0, 0] ? + // vec2.sub(v, this._rootRegion.centerOfMass, node.position); + // vec2.negate(v, node.position); + vec2.sub(v, this.center, node.position); + if (this.width > this.height) { + // Stronger gravity on y axis + v[1] *= this.width / this.height; + } + else { + // Stronger gravity on x axis + v[0] *= this.height / this.width; + } + var d = vec2.len(v) / 100; + + if (this.strongGravity) { + vec2.scaleAndAdd(node.force, node.force, v, d * this.gravity * node.mass); + } + else { + vec2.scaleAndAdd(node.force, node.force, v, this.gravity * node.mass / (d + 1)); + } + }; + })(); + + ForceLayout.prototype.updateBBox = function() { + var minX = Infinity; + var minY = Infinity; + var maxX = -Infinity; + var maxY = -Infinity; + for (var i = 0; i < this.nodes.length; i++) { + var pos = this.nodes[i].position; + minX = Math.min(minX, pos[0]); + minY = Math.min(minY, pos[1]); + maxX = Math.max(maxX, pos[0]); + maxY = Math.max(maxY, pos[1]); + } + this.bbox[0] = minX; + this.bbox[1] = minY; + this.bbox[2] = maxX; + this.bbox[3] = maxY; + }; + + ForceLayout.getWorkerCode = function() { + var str = __echartsForceLayoutWorker.toString(); + return str.slice(str.indexOf('{') + 1, str.lastIndexOf('return')); + }; + + ForceLayout.prototype.setToken = function(token) { + this._token = token; + }; + + ForceLayout.prototype.tokenMatch = function(token) { + return token === this._token; + }; + + /**************************** + * Main process + ***************************/ + + /* jshint ignore:start */ + if (inWorker) { + var forceLayout = null; + + self.onmessage = function(e) { + // Position read back + if (e.data instanceof ArrayBuffer) { + if (!forceLayout) { + return; + } + var positionArr = new Float32Array(e.data); + var nNodes = (positionArr.length - 1) / 2; + for (var i = 0; i < nNodes; i++) { + var node = forceLayout.nodes[i]; + node.position[0] = positionArr[i * 2 + 1]; + node.position[1] = positionArr[i * 2 + 2]; + } + return; + } + + switch(e.data.cmd) { + case 'init': + if (!forceLayout) { + forceLayout = new ForceLayout(); + } + forceLayout.initNodes(e.data.nodesPosition, e.data.nodesMass, e.data.nodesSize); + forceLayout.initEdges(e.data.edges, e.data.edgesWeight); + forceLayout._token = e.data.token; + break; + case 'updateConfig': + if (forceLayout) { + for (var name in e.data.config) { + forceLayout[name] = e.data.config[name]; + } + } + break; + case 'update': + var steps = e.data.steps; + + if (forceLayout) { + var nNodes = forceLayout.nodes.length; + var positionArr = new Float32Array(nNodes * 2 + 1); + + forceLayout.temperature = e.data.temperature; + + for (var i = 0; i < steps; i++) { + forceLayout.update(); + forceLayout.temperature *= e.data.coolDown; + } + // Callback + for (var i = 0; i < nNodes; i++) { + var node = forceLayout.nodes[i]; + positionArr[i * 2 + 1] = node.position[0]; + positionArr[i * 2 + 2] = node.position[1]; + } + + positionArr[0] = forceLayout._token; + + self.postMessage(positionArr.buffer, [positionArr.buffer]); + } + else { + // Not initialzied yet + var emptyArr = new Float32Array(); + // Post transfer object + self.postMessage(emptyArr.buffer, [emptyArr.buffer]); + } + break; + } + }; + } + /* jshint ignore:end */ + + return ForceLayout; +}); +/** + * 力导向布局 + * @module echarts/layout/Force + * @author pissang(http://github.com/pissang) + */ +define('echarts/layout/Force',['require','./forceLayoutWorker','zrender/tool/vector'],function(require) { + + var ForceLayoutWorker = require('./forceLayoutWorker'); + var vec2 = require('zrender/tool/vector'); + + var requestAnimationFrame = window.requestAnimationFrame + || window.msRequestAnimationFrame + || window.mozRequestAnimationFrame + || window.webkitRequestAnimationFrame + || function (func) {setTimeout(func, 16);}; + var ArrayCtor = typeof(Float32Array) == 'undefined' ? Array : Float32Array; + + var workerUrl; + + function getToken() { + return Math.round(Date.now() / 100) % 10000000; + } + + function createWorkerUrl() { + if ( + typeof(Worker) !== 'undefined' && + typeof(Blob) !== 'undefined' + ) { + try { + var blob = new Blob([ForceLayoutWorker.getWorkerCode()]); + workerUrl = window.URL.createObjectURL(blob); + } + catch (e) { + workerUrl = ''; + } + } + + return workerUrl; + } + + var ForceLayout = function(opts) { + + if (typeof(workerUrl) === 'undefined') { + createWorkerUrl(); + } + opts = opts || {}; + // 配置项 + this.width = opts.width || 500; + this.height = opts.height || 500; + this.center = opts.center || [this.width / 2, this.height / 2]; + this.ratioScaling = opts.ratioScaling || false; + this.scaling = opts.scaling || 1; + this.gravity = typeof(opts.gravity) !== 'undefined' + ? opts.gravity : 1; + this.large = opts.large || false; + + this.onupdate = opts.onupdate || function () {}; + this.temperature = opts.temperature || 1; + this.coolDown = opts.coolDown || 0.99; + + this._layout = null; + this._layoutWorker = null; + + this._token = 0; + + var self = this; + var _$onupdate = this._$onupdate; + this._$onupdate = function(e) { + _$onupdate.call(self, e); + }; + }; + + ForceLayout.prototype.updateConfig = function () { + var width = this.width; + var height = this.height; + var size = Math.min(width, height); + + var config = { + center: this.center, + width: this.ratioScaling ? width : size, + height: this.ratioScaling ? height : size, + scaling: this.scaling || 1.0, + gravity: this.gravity || 1.0, + barnesHutOptimize: this.large + }; + + if (this._layoutWorker) { + this._layoutWorker.postMessage({ + cmd: 'updateConfig', + config: config + }); + } + else { + for (var name in config) { + this._layout[name] = config[name]; + } + } + }; + + ForceLayout.prototype.init = function(graph, useWorker) { + if (workerUrl && useWorker) { + try { + if (!this._layoutWorker) { + this._layoutWorker = new Worker(workerUrl); + this._layoutWorker.onmessage = this._$onupdate; + } + this._layout = null; + } + catch (e) { // IE10-11 will throw security error when using blog url + this._layoutWorker = null; + if (!this._layout) { + this._layout = new ForceLayoutWorker(); + } + } + } + else { + if (!this._layout) { + this._layout = new ForceLayoutWorker(); + } + if (this._layoutWorker) { + this._layoutWorker.terminate(); + this._layoutWorker = null; + } + } + + this.temperature = 1; + + this.graph = graph; + + // 节点数据 + var len = graph.nodes.length; + var positionArr = new ArrayCtor(len * 2); + var massArr = new ArrayCtor(len); + var radiusArr = new ArrayCtor(len); + + for (var i = 0; i < len; i++) { + var n = graph.nodes[i]; + positionArr[i * 2] = n.layout.position[0]; + positionArr[i * 2 + 1] = n.layout.position[1]; + massArr[i] = n.layout.mass; + radiusArr[i] = n.layout.radius; + + n.layout.__index = i; + } + // 边数据 + len = graph.edges.length; + var edgeArr = new ArrayCtor(len * 2); + var edgeWeightArr = new ArrayCtor(len); + for (var i = 0; i < len; i++) { + var edge = graph.edges[i]; + edgeArr[i * 2] = edge.node1.layout.__index; + edgeArr[i * 2 + 1] = edge.node2.layout.__index; + edgeWeightArr[i] = edge.layout.weight || 1; + } + + this._token = getToken(); + + if (this._layoutWorker) { + + this._layoutWorker.postMessage({ + cmd: 'init', + nodesPosition: positionArr, + nodesMass: massArr, + nodesSize: radiusArr, + edges: edgeArr, + edgesWeight: edgeWeightArr, + token: this._token + }); + } + else { + this._layout.setToken(this._token); + this._layout.initNodes(positionArr, massArr, radiusArr); + this._layout.initEdges(edgeArr, edgeWeightArr); + } + + this.updateConfig(); + }; + + ForceLayout.prototype.step = function (steps) { + var nodes = this.graph.nodes; + if (this._layoutWorker) { + // Sync back + var positionArr = new ArrayCtor(nodes.length * 2 + 1); + for (var i = 0; i < nodes.length; i++) { + var n = nodes[i]; + positionArr[i * 2 + 1] = n.layout.position[0]; + positionArr[i * 2 + 2] = n.layout.position[1]; + } + this._layoutWorker.postMessage(positionArr.buffer, [positionArr.buffer]); + + this._layoutWorker.postMessage({ + cmd: 'update', + steps: steps, + temperature: this.temperature, + coolDown: this.coolDown + }); + for (var i = 0; i < steps; i++) { + this.temperature *= this.coolDown; + } + } + else { + + requestAnimationFrame(this._$onupdate); + + for (var i = 0; i < nodes.length; i++) { + var n = nodes[i]; + vec2.copy(this._layout.nodes[i].position, n.layout.position); + } + for (var i = 0; i < steps; i++) { + this._layout.temperature = this.temperature; + this._layout.update(); + this.temperature *= this.coolDown; + } + } + }; + + ForceLayout.prototype._$onupdate = function (e) { + if (this._layoutWorker) { + var positionArr = new Float32Array(e.data); + var token = positionArr[0]; + // If token is from current layout instance + if (token === this._token) { + for (var i = 0; i < this.graph.nodes.length; i++) { + var n = this.graph.nodes[i]; + n.layout.position[0] = positionArr[i * 2 + 1]; + n.layout.position[1] = positionArr[i * 2 + 2]; + } + this.onupdate && this.onupdate(); + } + } + else if (this._layout) { + if (this._layout.tokenMatch(this._token)) { + for (var i = 0; i < this.graph.nodes.length; i++) { + var n = this.graph.nodes[i]; + vec2.copy(n.layout.position, this._layout.nodes[i].position); + } + this.onupdate && this.onupdate(); + } + } + }; + + ForceLayout.prototype.dispose = function() { + if (this._layoutWorker) { + this._layoutWorker.terminate(); + } + this._layoutWorker = null; + this._layout = null; + this._token = 0; + }; + + return ForceLayout; +}); +/** + * echarts图表类:力导向图 + * + * @author pissang (https://github.com/pissang/) + * + */ + +define('echarts/chart/force',['require','../component/base','./base','../data/Graph','../layout/Force','zrender/shape/Line','zrender/shape/Image','../util/shape/Icon','../config','../util/ecData','zrender/tool/util','zrender/config','zrender/tool/vector','../chart'],function (require) { + + + var ComponentBase = require('../component/base'); + var ChartBase = require('./base'); + + var Graph = require('../data/Graph'); + var ForceLayout = require('../layout/Force'); + + // 图形依赖 + var LineShape = require('zrender/shape/Line'); + var ImageShape = require('zrender/shape/Image'); + var IconShape = require('../util/shape/Icon'); + + var ecConfig = require('../config'); + var ecData = require('../util/ecData'); + var zrUtil = require('zrender/tool/util'); + var zrConfig = require('zrender/config'); + var vec2 = require('zrender/tool/vector'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} series 数据 + * @param {Object} component 组件 + */ + function Force(ecTheme, messageCenter, zr, option, myChart) { + var self = this; + // 基类 + ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); + // 图表基类 + ChartBase.call(this); + + // 保存节点的位置,改变数据时能够有更好的动画效果 + this.__nodePositionMap = {}; + + this._graph = new Graph(true); + this._layout = new ForceLayout(); + + this._layout.onupdate = function() { + self._step(); + }; + + this._steps = 1; + + // 关闭可拖拽属性 + this.ondragstart = function() { + ondragstart.apply(self, arguments); + }; + this.ondragend = function() { + ondragend.apply(self, arguments); + }; + this.ondrop = function() {}; + this.shapeHandler.ondragstart = function() { + self.isDragstart = true; + }; + this.onmousemove = function() { + onmousemove.apply(self, arguments); + }; + this._init(); + } + + /** + * 绘制图形 + */ + Force.prototype = { + + constructor: Force, + + type : ecConfig.CHART_TYPE_FORCE, + + _init: function() { + // var self = this; + var legend = this.component.legend; + var series = this.series; + var serieName; + + this.clear(); + + for (var i = 0, l = series.length; i < l; i++) { + var serie = series[i]; + if (serie.type === ecConfig.CHART_TYPE_FORCE) { + series[i] = this.reformOption(series[i]); + serieName = series[i].name || ''; + + // 系列图例开关 + this.selectedMap[serieName] = + legend ? legend.isSelected(serieName) : true; + if (!this.selectedMap[serieName]) { + continue; + } + + this.buildMark(i); + + // 同步selected状态 + var categories = serie.categories; + for (var j = 0, len = categories.length; j < len; j++) { + if (categories[j].name) { + if (legend){ + this.selectedMap[j] = + legend.isSelected(categories[j].name); + } else { + this.selectedMap[j] = true; + } + } + } + + // TODO 多个 force + this._forceSerie = serie; + + this._initSerie(serie); + break; + } + } + }, + + _initSerie: function(serie) { + this._temperature = 1; + + var graph = this._graph; + graph.clear(); + + for (var i = 0, len = serie.nodes.length; i < len; i++) { + var n = serie.nodes[i]; + if ( + !n || n.ignore + || (n.category && !this.selectedMap[n.category]) + ) { + continue; + } + var node = graph.addNode(n.name, n); + node.rawIndex = i; + } + for (var i = 0, len = serie.links.length; i < len; i++) { + var e = serie.links[i]; + var n1 = e.source; + var n2 = e.target; + if (typeof(n1) === 'number') { + n1 = serie.nodes[n1]; + if (n1) { + n1 = n1.name; + } + } + if (typeof(n2) === 'number') { + n2 = serie.nodes[n2]; + if (n2) { + n2 = n2.name; + } + } + var edge = graph.addEdge(n1, n2, e); + if (edge) { + edge.rawIndex = i; + } + } + + this._buildLinkShapes(serie); + this._buildNodeShapes(serie); + + this._initLayout(serie); + + this._step(); + }, + + _initLayout: function(serie) { + var graph = this._graph; + var len = graph.nodes.length; + + var minRadius = this.query(serie, 'minRadius'); + var maxRadius = this.query(serie, 'maxRadius'); + + this._steps = serie.steps || 1; + + this._layout.center = this.parseCenter(this.zr, serie.center); + this._layout.width = this.parsePercent(serie.size, this.zr.getWidth()); + this._layout.height = this.parsePercent(serie.size, this.zr.getHeight()); + + this._layout.large = serie.large; + this._layout.scaling = serie.scaling; + this._layout.ratioScaling = serie.ratioScaling; + this._layout.gravity = serie.gravity; + this._layout.temperature = 1; + this._layout.coolDown = serie.coolDown; + + // 将值映射到minRadius-maxRadius的范围上 + var min = Infinity; var max = -Infinity; + for (var i = 0; i < len; i++) { + var gNode = graph.nodes[i]; + gNode.layout = { + radius: gNode.data.value || 1, + mass: 0 + }; + max = Math.max(gNode.data.value, max); + min = Math.min(gNode.data.value, min); + } + var divider = max - min; + for (var i = 0; i < len; i++) { + var gNode = graph.nodes[i]; + if (divider > 0) { + gNode.layout.radius = + (gNode.layout.radius - min) * (maxRadius - minRadius) / divider + + minRadius; + // 节点质量是归一的 + gNode.layout.mass = gNode.layout.radius / maxRadius; + } else { + gNode.layout.radius = (maxRadius - minRadius) / 2; + gNode.layout.mass = 0.5; + } + } + + for (var i = 0; i < len; i++) { + // var initPos; + var gNode = graph.nodes[i]; + if (typeof(this.__nodePositionMap[gNode.name]) !== 'undefined') { + gNode.layout.position = vec2.create(); + vec2.copy(gNode.layout.position, this.__nodePositionMap[gNode.name]); + } + else if (typeof(gNode.data.initial) !== 'undefined') { + gNode.layout.position = vec2.create(); + vec2.copy(gNode.layout.position, gNode.data.initial); + } + else { + var center = this._layout.center; + var size = Math.min(this._layout.width, this._layout.height); + gNode.layout.position = _randomInSquare( + center[0], center[1], size * 0.8 + ); + } + var style = gNode.shape.style; + var radius = gNode.layout.radius; + style.width = style.width || (radius * 2); + style.height = style.height || (radius * 2); + style.x = -style.width / 2; + style.y = -style.height / 2; + vec2.copy(gNode.shape.position, gNode.layout.position); + } + + // 边 + len = graph.edges.length; + max = -Infinity; + for (var i = 0; i < len; i++) { + var e = graph.edges[i]; + e.layout = { + weight: e.data.weight || 1 + }; + if (e.layout.weight > max) { + max = e.layout.weight; + } + } + // 权重归一 + for (var i = 0; i < len; i++) { + var e = graph.edges[i]; + e.layout.weight /= max; + } + + this._layout.init(graph, serie.useWorker); + }, + + _buildNodeShapes: function(serie) { + var graph = this._graph; + + var categories = this.query(serie, 'categories'); + var len = graph.nodes.length; + var legend = this.component.legend; + + for (var i = 0; i < len; i++) { + var gNode = graph.nodes[i]; + var node = gNode.data; + + var shape = new IconShape({ + style : { + x : 0, + y : 0 + }, + clickable: this.query(serie, 'clickable'), + highlightStyle : {} + }); + + var queryTarget = []; + var shapeNormalStyle = []; + var shapeEmphasisStyle = []; + + queryTarget.push(node); + if (node.itemStyle) { + shapeNormalStyle.push(node.itemStyle.normal); + shapeEmphasisStyle.push(node.itemStyle.emphasis); + } + if (typeof(node.category) !== 'undefined') { + var category = categories[node.category]; + if (category) { + // 使用 Legend.getColor 配置默认 category 的默认颜色 + category.itemStyle = category.itemStyle || {}; + category.itemStyle.normal = category.itemStyle.normal || {}; + category.itemStyle.normal.color = category.itemStyle.normal.color + || legend.getColor(category.name); + + queryTarget.push(category); + shapeNormalStyle.unshift(category.itemStyle.normal); + shapeEmphasisStyle.unshift(category.itemStyle.emphasis); + } + } + queryTarget.push(serie); + shapeNormalStyle.unshift(serie.itemStyle.normal.nodeStyle); + shapeEmphasisStyle.unshift(serie.itemStyle.emphasis.nodeStyle); + + shape.style.iconType = this.deepQuery(queryTarget, 'symbol'); + // 强制设定节点大小,否则默认映射到 minRadius 到 maxRadius 后的值 + shape.style.width = shape.style.height + = (this.deepQuery(queryTarget, 'symbolSize') || 0) * 2; + + if (shape.style.iconType.match('image')) { + shape.style.image = shape.style.iconType.replace( + new RegExp('^image:\\/\\/'), '' + ); + shape = new ImageShape({ + style: shape.style, + highlightStyle: shape.highlightStyle, + clickable: shape.clickable + }); + } + + // 节点样式 + for (var k = 0; k < shapeNormalStyle.length; k++) { + if (shapeNormalStyle[k]) { + zrUtil.merge(shape.style, shapeNormalStyle[k], true); + } + } + // 节点高亮样式 + for (var k = 0; k < shapeEmphasisStyle.length; k++) { + if (shapeEmphasisStyle[k]) { + zrUtil.merge(shape.highlightStyle, shapeEmphasisStyle[k], true); + } + } + + // 节点标签样式 + if (this.deepQuery(queryTarget, 'itemStyle.normal.label.show')) { + shape.style.text = node.name; + shape.style.textPosition = 'inside'; + var labelStyle = this.deepQuery( + queryTarget, 'itemStyle.normal.label.textStyle' + ) || {}; + shape.style.textColor = labelStyle.color || '#fff'; + shape.style.textAlign = labelStyle.align || 'center'; + shape.style.textBaseline = labelStyle.baseline || 'middle'; + shape.style.textFont = this.getFont(labelStyle); + } + + if (this.deepQuery(queryTarget, 'itemStyle.emphasis.label.show')) { + shape.highlightStyle.text = node.name; + shape.highlightStyle.textPosition = 'inside'; + var labelStyle = this.deepQuery( + queryTarget, 'itemStyle.emphasis.label.textStyle' + ) || {}; + shape.highlightStyle.textColor = labelStyle.color || '#fff'; + shape.highlightStyle.textAlign = labelStyle.align || 'center'; + shape.highlightStyle.textBaseline = labelStyle.baseline || 'middle'; + shape.highlightStyle.textFont = this.getFont(labelStyle); + } + + // 拖拽特性 + if (this.deepQuery(queryTarget, 'draggable')) { + this.setCalculable(shape); + shape.dragEnableTime = 0; + shape.draggable = true; + shape.ondragstart = this.shapeHandler.ondragstart; + shape.ondragover = null; + } + + var categoryName = ''; + if (typeof(node.category) !== 'undefined') { + var category = categories[node.category]; + categoryName = (category && category.name) || ''; + } + // !!Pack data before addShape + ecData.pack( + shape, + // category + { + name : categoryName + }, + // series index + 0, + // data + node, + // data index + gNode.rawIndex, + // name + node.name || '', + // value + node.value + ); + + this.shapeList.push(shape); + this.zr.addShape(shape); + + gNode.shape = shape; + } + }, + + _buildLinkShapes: function(serie) { + var graph = this._graph; + var len = graph.edges.length; + + for (var i = 0; i < len; i++) { + var gEdge = graph.edges[i]; + var link = gEdge.data; + var source = gEdge.node1; + var target = gEdge.node2; + + var linkShape = new LineShape({ + style : { + xStart : 0, + yStart : 0, + xEnd : 0, + yEnd : 0, + lineWidth : 1 + }, + clickable: this.query(serie, 'clickable'), + highlightStyle : {} + }); + + zrUtil.merge( + linkShape.style, + this.query(serie, 'itemStyle.normal.linkStyle'), + true + ); + zrUtil.merge( + linkShape.highlightStyle, + this.query(serie, 'itemStyle.emphasis.linkStyle'), + true + ); + if (typeof(link.itemStyle) !== 'undefined') { + if(link.itemStyle.normal){ + zrUtil.merge(linkShape.style, link.itemStyle.normal, true); + } + if(link.itemStyle.emphasis){ + zrUtil.merge( + linkShape.highlightStyle, + link.itemStyle.emphasis, + true + ); + } + } + + ecData.pack( + linkShape, + // serie + serie, + // serie index + 0, + // link data + { + source : source.data, + target : target.data, + weight : gEdge.data.weight || 0 + }, + // link data index + gEdge.rawIndex, + // source name - target name + source.name + ' - ' + target.name, + // link weight + gEdge.data.weight || 0, + // special + // 这一项只是为了表明这是条边 + true + ); + + this.shapeList.push(linkShape); + this.zr.addShape(linkShape); + gEdge.shape = linkShape; + + // Arrow shape + if (serie.linkSymbol && serie.linkSymbol !== 'none') { + var symbolShape = new IconShape({ + style: { + x: -5, + y: 0, + width: serie.linkSymbolSize[0], + height: serie.linkSymbolSize[1], + iconType: serie.linkSymbol, + brushType: 'fill', + // Use same style with link shape + color: linkShape.style.strokeColor, + opacity: linkShape.style.opacity, + shadowBlur: linkShape.style.shadowBlur, + shadowColor: linkShape.style.shadowColor, + shadowOffsetX: linkShape.style.shadowOffsetX, + shadowOffsetY: linkShape.style.shadowOffsetY + }, + highlightStyle: { + brushType: 'fill' + }, + position: [0, 0], + rotation: 0 + }); + linkShape._symbolShape = symbolShape; + this.shapeList.push(symbolShape); + this.zr.addShape(symbolShape); + } + } + }, + + _updateLinkShapes: function() { + var v = vec2.create(); + var edges = this._graph.edges; + for (var i = 0, len = edges.length; i < len; i++) { + var edge = edges[i]; + var sourceShape = edge.node1.shape; + var targetShape = edge.node2.shape; + + edge.shape.style.xStart = sourceShape.position[0]; + edge.shape.style.yStart = sourceShape.position[1]; + edge.shape.style.xEnd = targetShape.position[0]; + edge.shape.style.yEnd = targetShape.position[1]; + + this.zr.modShape(edge.shape.id); + + if (edge.shape._symbolShape) { + var symbolShape = edge.shape._symbolShape; + vec2.copy(symbolShape.position, targetShape.position); + + vec2.sub(v, sourceShape.position, targetShape.position); + vec2.normalize(v, v); + + vec2.scaleAndAdd( + symbolShape.position, symbolShape.position, + v, targetShape.style.width / 2 + 2 + ); + + var angle; + if (v[1] < 0) { + angle = 2 * Math.PI - Math.acos(-v[0]); + } + else { + angle = Math.acos(-v[0]); + } + symbolShape.rotation = angle - Math.PI / 2; + + this.zr.modShape(symbolShape.id); + } + } + }, + + _syncNodePositions: function() { + var graph = this._graph; + for (var i = 0; i < graph.nodes.length; i++) { + var gNode = graph.nodes[i]; + var position = gNode.layout.position; + var node = gNode.data; + var shape = gNode.shape; + if (shape.fixed || (node.fixX && node.fixY)) { + vec2.copy(position, shape.position); + } + else if (node.fixX) { + position[0] = shape.position[0]; + shape.position[1] = position[1]; + } + else if (node.fixY) { + position[1] = shape.position[1]; + shape.position[0] = position[0]; + } + else { + vec2.copy(shape.position, position); + } + + var nodeName = node.name; + if (nodeName) { + var gPos = this.__nodePositionMap[nodeName]; + if (!gPos) { + gPos = this.__nodePositionMap[nodeName] = vec2.create(); + } + vec2.copy(gPos, position); + } + + this.zr.modShape(shape.id); + } + }, + + _step: function(e) { + this._syncNodePositions(); + + this._updateLinkShapes(); + + this.zr.refreshNextFrame(); + + if (this._layout.temperature > 0.01) { + this._layout.step(this._steps); + } + }, + + refresh: function(newOption) { + if (newOption) { + this.option = newOption; + this.series = this.option.series; + } + this._init(); + }, + + dispose: function(){ + this.clear(); + this.shapeList = null; + this.effectList = null; + + this._layout.dispose(); + this._layout = null; + + this.__nodePositionMap = {}; + } + }; + + /** + * 拖拽开始 + */ + function ondragstart(param) { + if (!this.isDragstart || !param.target) { + // 没有在当前实例上发生拖拽行为则直接返回 + return; + } + + var shape = param.target; + shape.fixed = true; + + // 处理完拖拽事件后复位 + this.isDragstart = false; + + this.zr.on(zrConfig.EVENT.MOUSEMOVE, this.onmousemove); + } + + function onmousemove() { + this._layout.temperature = 0.8; + this._step(); + } + + /** + * 数据项被拖拽出去,重载基类方法 + */ + function ondragend(param, status) { + if (!this.isDragend || !param.target) { + // 没有在当前实例上发生拖拽行为则直接返回 + return; + } + var shape = param.target; + shape.fixed = false; + + // 别status = {}赋值啊!! + status.dragIn = true; + //你自己refresh的话把他设为false,设true就会重新调refresh接口 + status.needRefresh = false; + + // 处理完拖拽事件后复位 + this.isDragend = false; + + this.zr.un(zrConfig.EVENT.MOUSEMOVE, this.onmousemove); + } + + function _randomInSquare(x, y, size) { + var v = vec2.create(); + v[0] = (Math.random() - 0.5) * size + x; + v[1] = (Math.random() - 0.5) * size + y; + return v; + } + + /* + function _filter(array, callback){ + var len = array.length; + var result = []; + for(var i = 0; i < len; i++){ + if(callback(array[i], i)){ + result.push(array[i]); + } + } + return result; + } + */ + + zrUtil.inherits(Force, ChartBase); + zrUtil.inherits(Force, ComponentBase); + + // 图表注册 + require('../chart').define('force', Force); + + return Force; +}); + +/** + * zrender + * + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + * shape类:支持半平滑的polygon,折线面积图使用 + * 可配图形属性: + { + // 基础属性 + shape : 'halfSmoothPolygon', // 必须,shape类标识,需要显式指定 + id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 + zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 + invisible : {boolean}, // 默认为false,是否可见 + + // 样式属性,默认状态样式样式属性 + style : { + pointList : {Array}, // 必须,多边形各个顶角坐标 + }, + + // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 + highlightStyle : { + // 同style + } + + // 交互属性,详见shape.Base + + // 事件属性,详见shape.Base + } + 例子: + { + shape : 'halfSmoothPolygon', + id : '123456', + zlevel : 1, + style : { + pointList : [[10, 10], [300, 20], [298, 400], [50, 450]] + color : '#eee', + text : 'Baidu' + }, + myName : 'kener', // 可自带任何有效自定义属性 + + clickable : true, + onClick : function (eventPacket) { + alert(eventPacket.target.myName); + } + } + */ +define('echarts/util/shape/HalfSmoothPolygon',['require','zrender/shape/Base','zrender/shape/util/smoothBezier','zrender/tool/util','zrender/shape/Polygon'],function (require) { + var Base = require('zrender/shape/Base'); + var smoothBezier = require('zrender/shape/util/smoothBezier'); + var zrUtil = require('zrender/tool/util'); + + function HalfSmoothPolygon(options) { + Base.call(this, options); + } + + HalfSmoothPolygon.prototype = { + type : 'half-smooth-polygon', + /** + * 创建多边形路径 + * @param {Context2D} ctx Canvas 2D上下文 + * @param {Object} style 样式 + */ + buildPath : function (ctx, style) { + var pointList = style.pointList; + if (pointList.length < 2) { + // 少于2个点就不画了~ + return; + } + if (style.smooth) { + var controlPoints = smoothBezier( + pointList.slice(0, -2), style.smooth, false, style.smoothConstraint + ); + + ctx.moveTo(pointList[0][0], pointList[0][1]); + var cp1; + var cp2; + var p; + var l = pointList.length; + for (var i = 0; i < l - 3; i++) { + cp1 = controlPoints[i * 2]; + cp2 = controlPoints[i * 2 + 1]; + p = pointList[i + 1]; + ctx.bezierCurveTo( + cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1] + ); + } + ctx.lineTo(pointList[l - 2][0], pointList[l - 2][1]); + ctx.lineTo(pointList[l - 1][0], pointList[l - 1][1]); + ctx.lineTo(pointList[0][0], pointList[0][1]); + } + else { + require('zrender/shape/Polygon').prototype.buildPath( + ctx, style + ); + } + return; + } + }; + + zrUtil.inherits(HalfSmoothPolygon, Base); + + return HalfSmoothPolygon; +}); +/** + * echarts图表类:折线图 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/chart/line',['require','../component/base','./base','zrender/shape/BrokenLine','../util/shape/Icon','../util/shape/HalfSmoothPolygon','../component/axis','../component/grid','../component/dataZoom','../config','../util/ecData','zrender/tool/util','zrender/tool/color','../chart'],function (require) { + var ComponentBase = require('../component/base'); + var ChartBase = require('./base'); + + // 图形依赖 + var BrokenLineShape = require('zrender/shape/BrokenLine'); + var IconShape = require('../util/shape/Icon'); + var HalfSmoothPolygonShape = require('../util/shape/HalfSmoothPolygon'); + // 组件依赖 + require('../component/axis'); + require('../component/grid'); + require('../component/dataZoom'); + + var ecConfig = require('../config'); + var ecData = require('../util/ecData'); + var zrUtil = require('zrender/tool/util'); + var zrColor = require('zrender/tool/color'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} series 数据 + * @param {Object} component 组件 + */ + function Line(ecTheme, messageCenter, zr, option, myChart){ + // 基类 + ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); + // 图表基类 + ChartBase.call(this); + + this.refresh(option); + } + + Line.prototype = { + type: ecConfig.CHART_TYPE_LINE, + /** + * 绘制图形 + */ + _buildShape: function () { + var series = this.series; + this.finalPLMap = {}; // 完成的point list(PL) + this._sIndex2ColorMap = {}; // series默认颜色索引,seriesIndex索引到color + this._symbol = this.option.symbolList; + this._sIndex2ShapeMap = {}; // series拐点图形类型,seriesIndex索引到shape type + + this.selectedMap = {}; + this.xMarkMap = {}; + + // 水平垂直双向series索引 ,position索引到seriesIndex + var _position2sIndexMap = { + top: [ ], + bottom: [ ], + left: [ ], + right: [ ] + }; + var xAxisIndex; + var yAxisIndex; + var xAxis; + var yAxis; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type === this.type) { + series[i] = this.reformOption(series[i]); + xAxisIndex = series[i].xAxisIndex; + yAxisIndex = series[i].yAxisIndex; + xAxis = this.component.xAxis.getAxis(xAxisIndex); + yAxis = this.component.yAxis.getAxis(yAxisIndex); + if (xAxis.type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + ) { + _position2sIndexMap[xAxis.getPosition()].push(i); + } + else if (yAxis.type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + ) { + _position2sIndexMap[yAxis.getPosition()].push(i); + } + } + } + // console.log(_position2sIndexMap); + for (var position in _position2sIndexMap) { + if (_position2sIndexMap[position].length > 0) { + this._buildSinglePosition( + position, _position2sIndexMap[position] + ); + } + } + this.addShapeList(); + }, + + /** + * 构建单个方向上的折线图 + * + * @param {number} seriesIndex 系列索引 + */ + _buildSinglePosition: function (position, seriesArray) { + var mapData = this._mapData(seriesArray); + var locationMap = mapData.locationMap; + var maxDataLength = mapData.maxDataLength; + + if (maxDataLength === 0 || locationMap.length === 0) { + return; + } + switch (position) { + case 'bottom' : + case 'top' : + this._buildHorizontal(seriesArray, maxDataLength, locationMap, this.xMarkMap); + break; + case 'left' : + case 'right' : + this._buildVertical(seriesArray, maxDataLength, locationMap, this.xMarkMap); + break; + } + + for (var i = 0, l = seriesArray.length; i < l; i++) { + this.buildMark(seriesArray[i]); + } + }, + + /** + * 数据整形 + * 数组位置映射到系列索引 + */ + _mapData: function (seriesArray) { + var series = this.series; + var serie; // 临时映射变量 + var dataIndex = 0; // 堆积数据所在位置映射 + var stackMap = {}; // 堆积数据位置映射,堆积组在二维中的第几项 + var magicStackKey = '__kener__stack__'; // 堆积命名,非堆积数据安单一堆积处理 + var stackKey; // 临时映射变量 + var serieName; // 临时映射变量 + var legend = this.component.legend; + var locationMap = []; // 需要返回的东西:数组位置映射到系列索引 + var maxDataLength = 0; // 需要返回的东西:最大数据长度 + var iconShape; + // 计算需要显示的个数和分配位置并记在下面这个结构里 + for (var i = 0, l = seriesArray.length; i < l; i++) { + serie = series[seriesArray[i]]; + serieName = serie.name; + + this._sIndex2ShapeMap[seriesArray[i]] + = this._sIndex2ShapeMap[seriesArray[i]] + || this.query(serie,'symbol') + || this._symbol[i % this._symbol.length]; + + if (legend){ + this.selectedMap[serieName] = legend.isSelected(serieName); + + this._sIndex2ColorMap[seriesArray[i]] + = legend.getColor(serieName); + + iconShape = legend.getItemShape(serieName); + if (iconShape) { + // 回调legend,换一个更形象的icon + iconShape.style.iconType = 'legendLineIcon'; + iconShape.style.symbol = + this._sIndex2ShapeMap[seriesArray[i]]; + + legend.setItemShape(serieName, iconShape); + } + } else { + this.selectedMap[serieName] = true; + this._sIndex2ColorMap[seriesArray[i]] + = this.zr.getColor(seriesArray[i]); + } + + if (this.selectedMap[serieName]) { + stackKey = serie.stack || (magicStackKey + seriesArray[i]); + if (stackMap[stackKey] == null) { + stackMap[stackKey] = dataIndex; + locationMap[dataIndex] = [seriesArray[i]]; + dataIndex++; + } + else { + // 已经分配了位置就推进去就行 + locationMap[stackMap[stackKey]].push(seriesArray[i]); + } + } + // 兼职帮算一下最大长度 + maxDataLength = Math.max(maxDataLength, serie.data.length); + } + /* 调试输出 + var s = ''; + for (var i = 0, l = maxDataLength; i < l; i++) { + s = '['; + for (var j = 0, k = locationMap.length; j < k; j++) { + s +='[' + for (var m = 0, n = locationMap[j].length - 1; m < n; m++) { + s += series[locationMap[j][m]].data[i] + ',' + } + s += series[locationMap[j][locationMap[j].length - 1]] + .data[i]; + s += ']' + } + s += ']'; + console.log(s); + } + console.log(locationMap) + */ + + return { + locationMap: locationMap, + maxDataLength: maxDataLength + }; + }, + + /** + * 构建类目轴为水平方向的折线图系列 + */ + _buildHorizontal: function (seriesArray, maxDataLength, locationMap, xMarkMap) { + var series = this.series; + // 确定类目轴和数值轴,同一方向随便找一个即可 + var seriesIndex = locationMap[0][0]; + var serie = series[seriesIndex]; + var xAxisIndex = serie.xAxisIndex; + var categoryAxis = this.component.xAxis.getAxis(xAxisIndex); + var yAxisIndex; // 数值轴各异 + var valueAxis; // 数值轴各异 + + var x; + var y; + var lastYP; // 正向堆积处理 + var baseYP; + var lastYN; // 负向堆积处理 + var baseYN; + //var this.finalPLMap = {}; // 完成的point list(PL) + var curPLMap = {}; // 正在记录的point list(PL) + var data; + var value; + for (var i = 0, l = maxDataLength; i < l; i++) { + if (categoryAxis.getNameByIndex(i) == null) { + // 系列数据超出类目轴长度 + break; + } + x = categoryAxis.getCoordByIndex(i); + for (var j = 0, k = locationMap.length; j < k; j++) { + // 堆积数据用第一条valueAxis + yAxisIndex = series[locationMap[j][0]].yAxisIndex || 0; + valueAxis = this.component.yAxis.getAxis(yAxisIndex); + baseYP = lastYP = baseYN = lastYN = valueAxis.getCoord(0); + for (var m = 0, n = locationMap[j].length; m < n; m++) { + seriesIndex = locationMap[j][m]; + serie = series[seriesIndex]; + data = serie.data[i]; + value = data != null + ? (data.value != null + ? data.value + : data) + : '-'; + curPLMap[seriesIndex] = curPLMap[seriesIndex] || []; + xMarkMap[seriesIndex] = xMarkMap[seriesIndex] + || { + min: Number.POSITIVE_INFINITY, + max: Number.NEGATIVE_INFINITY, + sum: 0, + counter: 0, + average: 0 + }; + if (value === '-') { + // 空数据则把正在记录的curPLMap添加到finalPLMap中 + if (curPLMap[seriesIndex].length > 0) { + this.finalPLMap[seriesIndex] = + this.finalPLMap[seriesIndex] || []; + + this.finalPLMap[seriesIndex].push( + curPLMap[seriesIndex] + ); + + curPLMap[seriesIndex] = []; + } + continue; + } + //y = valueAxis.getCoord(value); + if (value >= 0) { + // 正向堆积 + lastYP -= m > 0 + ? valueAxis.getCoordSize(value) + : (baseYP - valueAxis.getCoord(value)); + y = lastYP; + } + else if (value < 0){ + // 负向堆积 + lastYN += m > 0 + ? valueAxis.getCoordSize(value) + : (valueAxis.getCoord(value) - baseYN); + y = lastYN; + } + curPLMap[seriesIndex].push( + [x, y, i, categoryAxis.getNameByIndex(i), x, baseYP] + ); + + if (xMarkMap[seriesIndex].min > value) { + xMarkMap[seriesIndex].min = value; + xMarkMap[seriesIndex].minY = y; + xMarkMap[seriesIndex].minX = x; + } + if (xMarkMap[seriesIndex].max < value) { + xMarkMap[seriesIndex].max = value; + xMarkMap[seriesIndex].maxY = y; + xMarkMap[seriesIndex].maxX = x; + } + xMarkMap[seriesIndex].sum += value; + xMarkMap[seriesIndex].counter++; + } + } + // 补充空数据的拖拽提示 + lastYP = this.component.grid.getY(); + var symbolSize; + for (var j = 0, k = locationMap.length; j < k; j++) { + for (var m = 0, n = locationMap[j].length; m < n; m++) { + seriesIndex = locationMap[j][m]; + serie = series[seriesIndex]; + data = serie.data[i]; + value = data != null + ? (data.value != null + ? data.value + : data) + : '-'; + if (value != '-') { + // 只关心空数据 + continue; + } + if (this.deepQuery( + [data, serie, this.option], 'calculable' + ) + ) { + symbolSize = this.deepQuery( + [data, serie], + 'symbolSize' + ); + lastYP += symbolSize * 2 + 5; + y = lastYP; + this.shapeList.push(this._getCalculableItem( + seriesIndex, i, categoryAxis.getNameByIndex(i), + x, y, 'horizontal' + )); + } + } + } + } + + // 把剩余未完成的curPLMap全部添加到finalPLMap中 + for (var sId in curPLMap) { + if (curPLMap[sId].length > 0) { + this.finalPLMap[sId] = this.finalPLMap[sId] || []; + this.finalPLMap[sId].push(curPLMap[sId]); + curPLMap[sId] = []; + } + } + + for (var j = 0, k = locationMap.length; j < k; j++) { + for (var m = 0, n = locationMap[j].length; m < n; m++) { + seriesIndex = locationMap[j][m]; + if (xMarkMap[seriesIndex].counter > 0) { + xMarkMap[seriesIndex].average = + (xMarkMap[seriesIndex].sum / xMarkMap[seriesIndex].counter).toFixed(2) + - 0; + } + y = this.component.yAxis.getAxis(series[seriesIndex].yAxisIndex || 0) + .getCoord(xMarkMap[seriesIndex].average); + xMarkMap[seriesIndex].averageLine = [ + [this.component.grid.getX(), y], + [this.component.grid.getXend(), y] + ]; + + xMarkMap[seriesIndex].minLine = [ + [this.component.grid.getX(), xMarkMap[seriesIndex].minY], + [this.component.grid.getXend(), xMarkMap[seriesIndex].minY] + ]; + xMarkMap[seriesIndex].maxLine = [ + [this.component.grid.getX(), xMarkMap[seriesIndex].maxY], + [this.component.grid.getXend(), xMarkMap[seriesIndex].maxY] + ]; + } + } + + this._buildBorkenLine(seriesArray, this.finalPLMap, categoryAxis, 'horizontal'); + }, + + /** + * 构建类目轴为垂直方向的折线图系列 + */ + _buildVertical: function (seriesArray, maxDataLength, locationMap, xMarkMap) { + var series = this.series; + // 确定类目轴和数值轴,同一方向随便找一个即可 + var seriesIndex = locationMap[0][0]; + var serie = series[seriesIndex]; + var yAxisIndex = serie.yAxisIndex; + var categoryAxis = this.component.yAxis.getAxis(yAxisIndex); + var xAxisIndex; // 数值轴各异 + var valueAxis; // 数值轴各异 + + var x; + var y; + var lastXP; // 正向堆积处理 + var baseXP; + var lastXN; // 负向堆积处理 + var baseXN; + //var this.finalPLMap = {}; // 完成的point list(PL) + var curPLMap = {}; // 正在记录的point list(PL) + var data; + var value; + for (var i = 0, l = maxDataLength; i < l; i++) { + if (categoryAxis.getNameByIndex(i) == null) { + // 系列数据超出类目轴长度 + break; + } + y = categoryAxis.getCoordByIndex(i); + for (var j = 0, k = locationMap.length; j < k; j++) { + // 堆积数据用第一条valueAxis + xAxisIndex = series[locationMap[j][0]].xAxisIndex || 0; + valueAxis = this.component.xAxis.getAxis(xAxisIndex); + baseXP = lastXP = baseXN = lastXN = valueAxis.getCoord(0); + for (var m = 0, n = locationMap[j].length; m < n; m++) { + seriesIndex = locationMap[j][m]; + serie = series[seriesIndex]; + data = serie.data[i]; + value = data != null + ? (data.value != null + ? data.value + : data) + : '-'; + curPLMap[seriesIndex] = curPLMap[seriesIndex] || []; + xMarkMap[seriesIndex] = xMarkMap[seriesIndex] + || { + min: Number.POSITIVE_INFINITY, + max: Number.NEGATIVE_INFINITY, + sum: 0, + counter: 0, + average: 0 + }; + if (value === '-') { + // 空数据则把正在记录的curPLMap添加到finalPLMap中 + if (curPLMap[seriesIndex].length > 0) { + this.finalPLMap[seriesIndex] = + this.finalPLMap[seriesIndex] || []; + + this.finalPLMap[seriesIndex].push( + curPLMap[seriesIndex] + ); + + curPLMap[seriesIndex] = []; + } + continue; + } + //x = valueAxis.getCoord(value); + if (value >= 0) { + // 正向堆积 + lastXP += m > 0 + ? valueAxis.getCoordSize(value) + : (valueAxis.getCoord(value) - baseXP); + x = lastXP; + } + else if (value < 0){ + // 负向堆积 + lastXN -= m > 0 + ? valueAxis.getCoordSize(value) + : (baseXN - valueAxis.getCoord(value)); + x = lastXN; + } + curPLMap[seriesIndex].push( + [x, y, i, categoryAxis.getNameByIndex(i), baseXP, y] + ); + + if (xMarkMap[seriesIndex].min > value) { + xMarkMap[seriesIndex].min = value; + xMarkMap[seriesIndex].minX = x; + xMarkMap[seriesIndex].minY = y; + } + if (xMarkMap[seriesIndex].max < value) { + xMarkMap[seriesIndex].max = value; + xMarkMap[seriesIndex].maxX = x; + xMarkMap[seriesIndex].maxY = y; + } + xMarkMap[seriesIndex].sum += value; + xMarkMap[seriesIndex].counter++; + } + } + // 补充空数据的拖拽提示 + lastXP = this.component.grid.getXend(); + var symbolSize; + for (var j = 0, k = locationMap.length; j < k; j++) { + for (var m = 0, n = locationMap[j].length; m < n; m++) { + seriesIndex = locationMap[j][m]; + serie = series[seriesIndex]; + data = serie.data[i]; + value = data != null + ? (data.value != null + ? data.value + : data) + : '-'; + if (value != '-') { + // 只关心空数据 + continue; + } + if (this.deepQuery( + [data, serie, this.option], 'calculable' + ) + ) { + symbolSize = this.deepQuery( + [data, serie], + 'symbolSize' + ); + lastXP -= symbolSize * 2 + 5; + x = lastXP; + this.shapeList.push(this._getCalculableItem( + seriesIndex, i, categoryAxis.getNameByIndex(i), + x, y, 'vertical' + )); + } + } + } + } + + // 把剩余未完成的curPLMap全部添加到finalPLMap中 + for (var sId in curPLMap) { + if (curPLMap[sId].length > 0) { + this.finalPLMap[sId] = this.finalPLMap[sId] || []; + this.finalPLMap[sId].push(curPLMap[sId]); + curPLMap[sId] = []; + } + } + + for (var j = 0, k = locationMap.length; j < k; j++) { + for (var m = 0, n = locationMap[j].length; m < n; m++) { + seriesIndex = locationMap[j][m]; + if (xMarkMap[seriesIndex].counter > 0) { + xMarkMap[seriesIndex].average = + (xMarkMap[seriesIndex].sum / xMarkMap[seriesIndex].counter).toFixed(2) + - 0; + } + + x = this.component.xAxis.getAxis(series[seriesIndex].xAxisIndex || 0) + .getCoord(xMarkMap[seriesIndex].average); + + xMarkMap[seriesIndex].averageLine = [ + [x, this.component.grid.getYend()], + [x, this.component.grid.getY()] + ]; + xMarkMap[seriesIndex].minLine = [ + [xMarkMap[seriesIndex].minX, this.component.grid.getYend()], + [xMarkMap[seriesIndex].minX, this.component.grid.getY()] + ]; + xMarkMap[seriesIndex].maxLine = [ + [xMarkMap[seriesIndex].maxX, this.component.grid.getYend()], + [xMarkMap[seriesIndex].maxX, this.component.grid.getY()] + ]; + } + } + + this._buildBorkenLine(seriesArray, this.finalPLMap, categoryAxis, 'vertical'); + }, + + /** + * 生成折线和折线上的拐点 + */ + _buildBorkenLine: function (seriesArray, pointList, categoryAxis, orient) { + var series = this.series; + + var data; + + // 堆积层叠需求,反顺序构建 + for (var sIdx = seriesArray.length - 1; sIdx >= 0; sIdx--) { + var seriesIndex = seriesArray[sIdx]; + var serie = series[seriesIndex]; + var seriesPL = pointList[seriesIndex]; + if (serie.type === this.type && seriesPL != null) { + var bbox = this._getBbox(seriesIndex, orient); + var defaultColor = this._sIndex2ColorMap[seriesIndex]; + // 折线相关,多级控制 + var lineWidth = this.query( + serie, 'itemStyle.normal.lineStyle.width' + ); + var lineType = this.query( + serie, 'itemStyle.normal.lineStyle.type' + ); + var lineColor = this.query( + serie, 'itemStyle.normal.lineStyle.color' + ); + var normalColor = this.getItemStyleColor( + this.query(serie, 'itemStyle.normal.color'), seriesIndex, -1 + ); + + // 填充相关 + var isFill = this.query(serie, 'itemStyle.normal.areaStyle') != null; + var fillNormalColor = this.query( + serie, 'itemStyle.normal.areaStyle.color' + ); + + for (var i = 0, l = seriesPL.length; i < l; i++) { + var singlePL = seriesPL[i]; + var isLarge = this._isLarge(orient, singlePL); + if (!isLarge) { // 非大数据模式才显示拐点symbol + for (var j = 0, k = singlePL.length; j < k; j++) { + data = serie.data[singlePL[j][2]]; + if (this.deepQuery( + [data, serie], 'showAllSymbol' + ) // 全显示 + || (categoryAxis.isMainAxis(singlePL[j][2]) + && this.deepQuery( + [data, serie], 'symbol' + ) != 'none' + ) // 主轴非空 + || this.deepQuery( + [data, serie, this.option], + 'calculable' + ) // 可计算 + ) { + this.shapeList.push(this._getSymbol( + seriesIndex, + singlePL[j][2], // dataIndex + singlePL[j][3], // name + singlePL[j][0], // x + singlePL[j][1], // y + orient + )); + } + } + } + else { + // 大数据模式截取pointList + singlePL = this._getLargePointList(orient, singlePL); + } + + // 折线图 + var brokenLineShape = new BrokenLineShape({ + zlevel: this._zlevelBase, + style: { + miterLimit: lineWidth, + pointList: singlePL, + strokeColor: lineColor + || normalColor + || defaultColor, + lineWidth: lineWidth, + lineType: lineType, + smooth: this._getSmooth(serie.smooth), + smoothConstraint: bbox, + shadowColor: this.query( + serie, + 'itemStyle.normal.lineStyle.shadowColor' + ), + shadowBlur: this.query( + serie, + 'itemStyle.normal.lineStyle.shadowBlur' + ), + shadowOffsetX: this.query( + serie, + 'itemStyle.normal.lineStyle.shadowOffsetX' + ), + shadowOffsetY: this.query( + serie, + 'itemStyle.normal.lineStyle.shadowOffsetY' + ) + }, + hoverable: false, + _main: true, + _seriesIndex: seriesIndex, + _orient: orient + }); + + ecData.pack( + brokenLineShape, + series[seriesIndex], seriesIndex, + 0, i, series[seriesIndex].name + ); + + this.shapeList.push(brokenLineShape); + + if (isFill) { + var halfSmoothPolygonShape = new HalfSmoothPolygonShape({ + zlevel: this._zlevelBase, + style: { + miterLimit: lineWidth, + pointList: zrUtil.clone(singlePL).concat([ + [ + singlePL[singlePL.length - 1][4], + singlePL[singlePL.length - 1][5] + ], + [ + singlePL[0][4], + singlePL[0][5] + ] + ]), + brushType: 'fill', + smooth: this._getSmooth(serie.smooth), + smoothConstraint: bbox, + color: fillNormalColor + ? fillNormalColor + : zrColor.alpha(defaultColor,0.5) + }, + hoverable: false, + _main: true, + _seriesIndex: seriesIndex, + _orient: orient + }); + ecData.pack( + halfSmoothPolygonShape, + series[seriesIndex], seriesIndex, + 0, i, series[seriesIndex].name + ); + this.shapeList.push(halfSmoothPolygonShape); + } + } + } + } + }, + + _getBbox: function(seriesIndex, orient) { + var bbox = this.component.grid.getBbox(); + var xMarkMap = this.xMarkMap[seriesIndex]; + if (orient === 'horizontal') { + bbox[0][1] = Math.min(xMarkMap.minY, xMarkMap.maxY); + bbox[1][1] = Math.max(xMarkMap.minY, xMarkMap.maxY); + } + else { + bbox[0][0] = Math.min(xMarkMap.minX, xMarkMap.maxX); + bbox[1][0] = Math.max(xMarkMap.minX, xMarkMap.maxX); + } + return bbox; + }, + + _isLarge: function(orient, singlePL) { + if (singlePL.length < 2) { + return false; + } + else { + return orient === 'horizontal' + ? (Math.abs(singlePL[0][0] - singlePL[1][0]) < 0.5) + : (Math.abs(singlePL[0][1] - singlePL[1][1]) < 0.5); + } + }, + + /** + * 大规模pointList优化 + */ + _getLargePointList: function(orient, singlePL) { + var total; + if (orient === 'horizontal') { + total = this.component.grid.getWidth(); + } + else { + total = this.component.grid.getHeight(); + } + + var len = singlePL.length; + var newList = []; + for (var i = 0; i < total; i++) { + newList[i] = singlePL[Math.floor(len / total * i)]; + } + return newList; + }, + + _getSmooth: function (isSmooth/*, pointList, orient*/) { + if (isSmooth) { + /* 不科学啊,发现0.3通用了 + var delta; + if (orient === 'horizontal') { + delta = Math.abs(pointList[0][0] - pointList[1][0]); + } + else { + delta = Math.abs(pointList[0][1] - pointList[1][1]); + } + */ + return 0.3; + } + else { + return 0; + } + }, + + /** + * 生成空数据所需的可计算提示图形 + */ + _getCalculableItem: function (seriesIndex, dataIndex, name, x, y, orient) { + var series = this.series; + var color = series[seriesIndex].calculableHolderColor + || this.ecTheme.calculableHolderColor; + + var itemShape = this._getSymbol( + seriesIndex, dataIndex, name, + x, y, orient + ); + itemShape.style.color = color; + itemShape.style.strokeColor = color; + itemShape.rotation = [0,0]; + itemShape.hoverable = false; + itemShape.draggable = false; + itemShape.style.text = undefined; + + return itemShape; + }, + + /** + * 生成折线图上的拐点图形 + */ + _getSymbol: function (seriesIndex, dataIndex, name, x, y, orient) { + var series = this.series; + var serie = series[seriesIndex]; + var data = serie.data[dataIndex]; + + var itemShape = this.getSymbolShape( + serie, seriesIndex, data, dataIndex, name, + x, y, + this._sIndex2ShapeMap[seriesIndex], + this._sIndex2ColorMap[seriesIndex], + '#fff', + orient === 'vertical' ? 'horizontal' : 'vertical' // 翻转 + ); + itemShape.zlevel = this._zlevelBase + 1; + + if (this.deepQuery([data, serie, this.option], 'calculable')) { + this.setCalculable(itemShape); + itemShape.draggable = true; + } + + return itemShape; + }, + + // 位置转换 + getMarkCoord: function (seriesIndex, mpData) { + var serie = this.series[seriesIndex]; + var xMarkMap = this.xMarkMap[seriesIndex]; + var xAxis = this.component.xAxis.getAxis(serie.xAxisIndex); + var yAxis = this.component.yAxis.getAxis(serie.yAxisIndex); + + if (mpData.type + && (mpData.type === 'max' || mpData.type === 'min' || mpData.type === 'average') + ) { + // 特殊值内置支持 + return [ + xMarkMap[mpData.type + 'X'], + xMarkMap[mpData.type + 'Y'], + xMarkMap[mpData.type + 'Line'], + xMarkMap[mpData.type] + ]; + } + + return [ + typeof mpData.xAxis != 'string' && xAxis.getCoordByIndex + ? xAxis.getCoordByIndex(mpData.xAxis || 0) + : xAxis.getCoord(mpData.xAxis || 0), + + typeof mpData.yAxis != 'string' && yAxis.getCoordByIndex + ? yAxis.getCoordByIndex(mpData.yAxis || 0) + : yAxis.getCoord(mpData.yAxis || 0) + ]; + }, + + /** + * 刷新 + */ + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + + this.backupShapeList(); + this._buildShape(); + }, + + ontooltipHover: function (param, tipShape) { + var seriesIndex = param.seriesIndex; + var dataIndex = param.dataIndex; + var seriesPL; + var singlePL; + var len = seriesIndex.length; + while (len--) { + seriesPL = this.finalPLMap[seriesIndex[len]]; + if (seriesPL) { + for (var i = 0, l = seriesPL.length; i < l; i++) { + singlePL = seriesPL[i]; + for (var j = 0, k = singlePL.length; j < k; j++) { + if (dataIndex === singlePL[j][2]) { + tipShape.push(this._getSymbol( + seriesIndex[len], // seriesIndex + singlePL[j][2], // dataIndex + singlePL[j][3], // name + singlePL[j][0], // x + singlePL[j][1], // y + 'horizontal' + )); + } + } + } + } + } + }, + + /** + * 动态数据增加动画 + */ + addDataAnimation: function (params) { + var series = this.series; + var aniMap = {}; // seriesIndex索引参数 + for (var i = 0, l = params.length; i < l; i++) { + aniMap[params[i][0]] = params[i]; + } + var x; + var dx; + var y; + var dy; + var seriesIndex; + var pointList; + var isHorizontal; // 是否横向布局, isHorizontal; + for (var i = this.shapeList.length - 1; i >= 0; i--) { + seriesIndex = this.shapeList[i]._seriesIndex; + if (aniMap[seriesIndex] && !aniMap[seriesIndex][3]) { + // 有数据删除才有移动的动画 + if (this.shapeList[i]._main && this.shapeList[i].style.pointList.length > 1) { + pointList = this.shapeList[i].style.pointList; + // 主线动画 + dx = Math.abs(pointList[0][0] - pointList[1][0]); + dy = Math.abs(pointList[0][1] - pointList[1][1]); + isHorizontal = + this.shapeList[i]._orient === 'horizontal'; + + if (aniMap[seriesIndex][2]) { + // 队头加入删除末尾 + if (this.shapeList[i].type === 'polygon') { + //区域图 + var len = pointList.length; + this.shapeList[i].style.pointList[len - 3] + = pointList[len - 2]; + isHorizontal + ? (this.shapeList[i].style.pointList[len - 3][0] + = pointList[len - 4][0] + ) + : (this.shapeList[i].style.pointList[len - 3][1] + = pointList[len - 4][1] + ); + this.shapeList[i].style.pointList[len - 2] + = pointList[len - 1]; + } + this.shapeList[i].style.pointList.pop(); + + isHorizontal ? (x = dx, y = 0) : (x = 0, y = -dy); + } + else { + // 队尾加入删除头部 + this.shapeList[i].style.pointList.shift(); + if (this.shapeList[i].type === 'polygon') { + //区域图 + var targetPoint = + this.shapeList[i].style.pointList.pop(); + isHorizontal + ? (targetPoint[0] = pointList[0][0]) + : (targetPoint[1] = pointList[0][1]); + this.shapeList[i].style.pointList.push( + targetPoint + ); + } + isHorizontal ? (x = -dx, y = 0) : (x = 0, y = dy); + } + + this.zr.modShape( + this.shapeList[i].id, + { + style: { + pointList: this.shapeList[i].style.pointList + } + }, + true + ); + } + else { + // 拐点动画 + if (aniMap[seriesIndex][2] + && this.shapeList[i]._dataIndex + === series[seriesIndex].data.length - 1 + ) { + // 队头加入删除末尾 + this.zr.delShape(this.shapeList[i].id); + continue; + } + else if (!aniMap[seriesIndex][2] + && this.shapeList[i]._dataIndex === 0 + ) { + // 队尾加入删除头部 + this.zr.delShape(this.shapeList[i].id); + continue; + } + } + this.shapeList[i].position = [0, 0]; + this.zr.animate(this.shapeList[i].id, '') + .when( + 500, + { position: [ x, y ] } + ) + .start(); + } + } + } + }; + + function legendLineIcon(ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + + var dy = height / 2; + + if (style.symbol.match('empty')) { + ctx.fillStyle = '#fff'; + } + style.brushType = 'both'; + + var symbol = style.symbol.replace('empty', '').toLowerCase(); + if (symbol.match('star')) { + dy = (symbol.replace('star','') - 0) || 5; + y -= 1; + symbol = 'star'; + } + else if (symbol === 'rectangle' || symbol === 'arrow') { + x += (width - height) / 2; + width = height; + } + + var imageLocation = ''; + if (symbol.match('image')) { + imageLocation = symbol.replace( + new RegExp('^image:\\/\\/'), '' + ); + symbol = 'image'; + x += Math.round((width - height) / 2) - 1; + width = height = height + 2; + } + symbol = IconShape.prototype.iconLibrary[symbol]; + + if (symbol) { + var x2 = style.x; + var y2 = style.y; + ctx.moveTo(x2, y2 + dy); + ctx.lineTo(x2 + 5, y2 + dy); + ctx.moveTo(x2 + style.width - 5, y2 + dy); + ctx.lineTo(x2 + style.width, y2 + dy); + + symbol(ctx, { + x: x + 4, + y: y + 4, + width: width - 8, + height: height - 8, + n: dy, + image: imageLocation + }); + + } + else { + ctx.moveTo(x, y + dy); + ctx.lineTo(x + width, y + dy); + } + } + IconShape.prototype.iconLibrary['legendLineIcon'] = legendLineIcon; + + zrUtil.inherits(Line, ChartBase); + zrUtil.inherits(Line, ComponentBase); + + // 图表注册 + require('../chart').define('line', Line); + + return Line; +}); +/** + * echarts图表类:柱形图 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/chart/bar',['require','../component/base','./base','zrender/shape/Rectangle','../component/axis','../component/grid','../component/dataZoom','../config','../util/ecData','zrender/tool/util','zrender/tool/color','../chart'],function (require) { + var ComponentBase = require('../component/base'); + var ChartBase = require('./base'); + + // 图形依赖 + var RectangleShape = require('zrender/shape/Rectangle'); + // 组件依赖 + require('../component/axis'); + require('../component/grid'); + require('../component/dataZoom'); + + var ecConfig = require('../config'); + var ecData = require('../util/ecData'); + var zrUtil = require('zrender/tool/util'); + var zrColor = require('zrender/tool/color'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} series 数据 + * @param {Object} component 组件 + */ + function Bar(ecTheme, messageCenter, zr, option, myChart){ + // 基类 + ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); + // 图表基类 + ChartBase.call(this); + + this.refresh(option); + } + + Bar.prototype = { + type: ecConfig.CHART_TYPE_BAR, + /** + * 绘制图形 + */ + _buildShape: function () { + var series = this.series; + this.selectedMap = {}; + this.xMarkMap = {}; + + // series默认颜色索引,seriesIndex索引到color + this._sIndex2colorMap = {}; + + // 水平垂直双向series索引 ,position索引到seriesIndex + var _position2sIndexMap = { + top: [ ], + bottom: [ ], + left: [ ], + right: [ ] + }; + var xAxisIndex; + var yAxisIndex; + var xAxis; + var yAxis; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type === ecConfig.CHART_TYPE_BAR) { + series[i] = this.reformOption(series[i]); + xAxisIndex = series[i].xAxisIndex; + yAxisIndex = series[i].yAxisIndex; + xAxis = this.component.xAxis.getAxis(xAxisIndex); + yAxis = this.component.yAxis.getAxis(yAxisIndex); + if (xAxis.type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + ) { + _position2sIndexMap[xAxis.getPosition()].push(i); + } + else if (yAxis.type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + ) { + _position2sIndexMap[yAxis.getPosition()].push(i); + } + } + } + // console.log(_position2sIndexMap) + for (var position in _position2sIndexMap) { + if (_position2sIndexMap[position].length > 0) { + this._buildSinglePosition( + position, _position2sIndexMap[position], this.xMarkMap + ); + } + } + + this.addShapeList(); + }, + + /** + * 构建单个方向上的柱形图 + * + * @param {number} seriesIndex 系列索引 + */ + _buildSinglePosition: function (position, seriesArray, xMarkMap) { + var mapData = this._mapData(seriesArray); + var locationMap = mapData.locationMap; + var maxDataLength = mapData.maxDataLength; + + if (maxDataLength === 0 || locationMap.length === 0) { + return; + } + + switch (position) { + case 'bottom' : + case 'top' : + this._buildHorizontal(maxDataLength, locationMap, seriesArray, xMarkMap); + break; + case 'left' : + case 'right' : + this._buildVertical(maxDataLength, locationMap, seriesArray, xMarkMap); + break; + } + }, + + /** + * 数据整形 + * 数组位置映射到系列索引 + */ + _mapData: function (seriesArray) { + var series = this.series; + var serie; // 临时映射变量 + var dataIndex = 0; // 堆积数据所在位置映射 + var stackMap = {}; // 堆积数据位置映射,堆积组在二维中的第几项 + var magicStackKey = '__kener__stack__'; // 堆积命名,非堆积数据安单一堆积处理 + var stackKey; // 临时映射变量 + var serieName; // 临时映射变量 + var legend = this.component.legend; + var locationMap = [ ]; // 需要返回的东西:数组位置映射到系列索引 + var maxDataLength = 0; // 需要返回的东西:最大数据长度 + var iconShape; + // 计算需要显示的个数和分配位置并记在下面这个结构里 + for (var i = 0, l = seriesArray.length; i < l; i++) { + serie = series[seriesArray[i]]; + serieName = serie.name; + if (legend){ + this.selectedMap[serieName] = legend.isSelected(serieName); + this._sIndex2colorMap[seriesArray[i]] = + legend.getColor(serieName); + + iconShape = legend.getItemShape(serieName); + if (iconShape) { + // 回调legend,换一个更形象的icon + if (serie.itemStyle.normal.barBorderWidth > 0) { + iconShape.style.x += 1; + iconShape.style.y += 1; + iconShape.style.width -= 2; + iconShape.style.height -= 2; + iconShape.style.strokeColor = + iconShape.highlightStyle.strokeColor = + serie.itemStyle.normal.barBorderColor; + iconShape.highlightStyle.lineWidth = 3; + iconShape.style.brushType = 'both'; + } + legend.setItemShape(serieName, iconShape); + } + } else { + this.selectedMap[serieName] = true; + this._sIndex2colorMap[seriesArray[i]] = + this.zr.getColor(seriesArray[i]); + } + + if (this.selectedMap[serieName]) { + stackKey = serie.stack || (magicStackKey + seriesArray[i]); + if (stackMap[stackKey] == null) { + stackMap[stackKey] = dataIndex; + locationMap[dataIndex] = [seriesArray[i]]; + dataIndex++; + } + else { + // 已经分配了位置就推进去就行 + locationMap[stackMap[stackKey]].push(seriesArray[i]); + } + } + // 兼职帮算一下最大长度 + maxDataLength = Math.max(maxDataLength, serie.data.length); + } + + /* 调试输出 + var s = ''; + for (var i = 0, l = maxDataLength; i < l; i++) { + s = '['; + for (var j = 0, k = locationMap.length; j < k; j++) { + s +='[' + for (var m = 0, n = locationMap[j].length - 1; m < n; m++) { + s += series[locationMap[j][m]].data[i] + ',' + } + s += series[locationMap[j][locationMap[j].length - 1]] + .data[i]; + s += ']' + } + s += ']'; + console.log(s); + } + console.log(locationMap) + */ + + return { + locationMap: locationMap, + maxDataLength: maxDataLength + }; + }, + + /** + * 构建类目轴为水平方向的柱形图系列 + */ + _buildHorizontal: function (maxDataLength, locationMap, seriesArray, xMarkMap) { + var series = this.series; + // 确定类目轴和数值轴,同一方向随便找一个即可 + var seriesIndex = locationMap[0][0]; + var serie = series[seriesIndex]; + var xAxisIndex = serie.xAxisIndex; + var categoryAxis = this.component.xAxis.getAxis(xAxisIndex); + var yAxisIndex; // 数值轴各异 + var valueAxis; // 数值轴各异 + + var size = this._mapSize(categoryAxis, locationMap); + var gap = size.gap; + var barGap = size.barGap; + var barWidthMap = size.barWidthMap; + var barWidth = size.barWidth; // 自适应宽度 + var barMinHeightMap = size.barMinHeightMap; + var barHeight; + var interval = size.interval; + + var x; + var y; + var lastYP; // 正向堆积处理 + var baseYP; + var lastYN; // 负向堆积处理 + var baseYN; + var barShape; + var data; + var value; + for (var i = 0, l = maxDataLength; i < l; i++) { + if (categoryAxis.getNameByIndex(i) == null) { + // 系列数据超出类目轴长度 + break; + } + x = categoryAxis.getCoordByIndex(i) - gap / 2; + for (var j = 0, k = locationMap.length; j < k; j++) { + // 堆积数据用第一条valueAxis + yAxisIndex = series[locationMap[j][0]].yAxisIndex || 0; + valueAxis = this.component.yAxis.getAxis(yAxisIndex); + baseYP = lastYP = baseYN = lastYN = valueAxis.getCoord(0); + for (var m = 0, n = locationMap[j].length; m < n; m++) { + seriesIndex = locationMap[j][m]; + serie = series[seriesIndex]; + data = serie.data[i]; + value = data != null + ? (data.value != null + ? data.value + : data) + : '-'; + xMarkMap[seriesIndex] = xMarkMap[seriesIndex] + || { + min: Number.POSITIVE_INFINITY, + max: Number.NEGATIVE_INFINITY, + sum: 0, + counter: 0, + average: 0 + }; + if (value === '-') { + // 空数据在做完后补充拖拽提示框 + continue; + } + //y = valueAxis.getCoord(value); + if (value > 0) { + // 正向堆积 + //barHeight = baseYP - y; + barHeight = m > 0 + ? valueAxis.getCoordSize(value) + : (baseYP - valueAxis.getCoord(value)); + // 非堆积数据最小高度有效 + if (n === 1 + && barMinHeightMap[seriesIndex] > barHeight + ) { + barHeight = barMinHeightMap[seriesIndex]; + } + lastYP -= barHeight; + y = lastYP; + } + else if (value < 0){ + // 负向堆积 + //barHeight = y - baseYN; + barHeight = m > 0 + ? valueAxis.getCoordSize(value) + : (valueAxis.getCoord(value) - baseYN); + // 非堆积数据最小高度有效 + if (n === 1 + && barMinHeightMap[seriesIndex] > barHeight + ) { + barHeight = barMinHeightMap[seriesIndex]; + } + y = lastYN; + lastYN += barHeight; + } + else { + // 0值 + barHeight = 0;//baseYP - y; + // 最小高度无效 + lastYP -= barHeight; + y = lastYP; + } + xMarkMap[seriesIndex][i] = + x + (barWidthMap[seriesIndex] || barWidth) / 2; + if (xMarkMap[seriesIndex].min > value) { + xMarkMap[seriesIndex].min = value; + xMarkMap[seriesIndex].minY = y; + xMarkMap[seriesIndex].minX = xMarkMap[seriesIndex][i]; + } + if (xMarkMap[seriesIndex].max < value) { + xMarkMap[seriesIndex].max = value; + xMarkMap[seriesIndex].maxY = y; + xMarkMap[seriesIndex].maxX = xMarkMap[seriesIndex][i]; + } + xMarkMap[seriesIndex].sum += value; + xMarkMap[seriesIndex].counter++; + + if (i % interval === 0) { + barShape = this._getBarItem( + seriesIndex, i, + categoryAxis.getNameByIndex(i), + x, y, + barWidthMap[seriesIndex] || barWidth, + barHeight, + 'vertical' + ); + this.shapeList.push(new RectangleShape(barShape)); + } + } + + // 补充空数据的拖拽提示框 + for (var m = 0, n = locationMap[j].length; m < n; m++) { + seriesIndex = locationMap[j][m]; + serie = series[seriesIndex]; + data = serie.data[i]; + value = data != null + ? (data.value != null + ? data.value + : data) + : '-'; + if (value != '-') { + // 只关心空数据 + continue; + } + + if (this.deepQuery( + [data, serie, this.option], 'calculable' + ) + ) { + lastYP -= this.ecTheme.island.r; + y = lastYP; + + barShape = this._getBarItem( + seriesIndex, i, + categoryAxis.getNameByIndex(i), + x + 0.5, y + 0.5, + (barWidthMap[seriesIndex] || barWidth) - 1, + this.ecTheme.island.r - 1, + 'vertical' + ); + barShape.hoverable = false; + barShape.draggable = false; + barShape.style.lineWidth = 1; + barShape.style.brushType = 'stroke'; + barShape.style.strokeColor = + serie.calculableHolderColor + || this.ecTheme.calculableHolderColor; + + this.shapeList.push(new RectangleShape(barShape)); + } + } + + x += ((barWidthMap[seriesIndex] || barWidth) + barGap); + } + } + + for (var j = 0, k = locationMap.length; j < k; j++) { + for (var m = 0, n = locationMap[j].length; m < n; m++) { + seriesIndex = locationMap[j][m]; + if (xMarkMap[seriesIndex].counter > 0) { + xMarkMap[seriesIndex].average = + (xMarkMap[seriesIndex].sum / xMarkMap[seriesIndex].counter).toFixed(2) + - 0; + } + + y = this.component.yAxis.getAxis(series[seriesIndex].yAxisIndex || 0) + .getCoord(xMarkMap[seriesIndex].average); + + xMarkMap[seriesIndex].averageLine = [ + [this.component.grid.getX(), y], + [this.component.grid.getXend(), y] + ]; + xMarkMap[seriesIndex].minLine = [ + [this.component.grid.getX(), xMarkMap[seriesIndex].minY], + [this.component.grid.getXend(), xMarkMap[seriesIndex].minY] + ]; + xMarkMap[seriesIndex].maxLine = [ + [this.component.grid.getX(), xMarkMap[seriesIndex].maxY], + [this.component.grid.getXend(), xMarkMap[seriesIndex].maxY] + ]; + + xMarkMap[seriesIndex].isHorizontal = true; + this.buildMark(seriesIndex); + } + } + }, + + /** + * 构建类目轴为垂直方向的柱形图系列 + */ + _buildVertical: function (maxDataLength, locationMap, seriesArray, xMarkMap) { + var series = this.series; + // 确定类目轴和数值轴,同一方向随便找一个即可 + var seriesIndex = locationMap[0][0]; + var serie = series[seriesIndex]; + var yAxisIndex = serie.yAxisIndex; + var categoryAxis = this.component.yAxis.getAxis(yAxisIndex); + var xAxisIndex; // 数值轴各异 + var valueAxis; // 数值轴各异 + + var size = this._mapSize(categoryAxis, locationMap); + var gap = size.gap; + var barGap = size.barGap; + var barWidthMap = size.barWidthMap; + var barWidth = size.barWidth; // 自适应宽度 + var barMinHeightMap = size.barMinHeightMap; + var barHeight; + var interval = size.interval; + + var x; + var y; + var lastXP; // 正向堆积处理 + var baseXP; + var lastXN; // 负向堆积处理 + var baseXN; + var barShape; + var data; + var value; + for (var i = 0, l = maxDataLength; i < l; i++) { + if (categoryAxis.getNameByIndex(i) == null) { + // 系列数据超出类目轴长度 + break; + } + y = categoryAxis.getCoordByIndex(i) + gap / 2; + for (var j = 0, k = locationMap.length; j < k; j++) { + // 堆积数据用第一条valueAxis + xAxisIndex = series[locationMap[j][0]].xAxisIndex || 0; + valueAxis = this.component.xAxis.getAxis(xAxisIndex); + baseXP = lastXP = baseXN = lastXN = valueAxis.getCoord(0); + for (var m = 0, n = locationMap[j].length; m < n; m++) { + seriesIndex = locationMap[j][m]; + serie = series[seriesIndex]; + data = serie.data[i]; + value = data != null + ? (data.value != null + ? data.value + : data) + : '-'; + xMarkMap[seriesIndex] = xMarkMap[seriesIndex] + || { + min: Number.POSITIVE_INFINITY, + max: Number.NEGATIVE_INFINITY, + sum: 0, + counter: 0, + average: 0 + }; + if (value === '-') { + // 空数据在做完后补充拖拽提示框 + continue; + } + //x = valueAxis.getCoord(value); + if (value > 0) { + // 正向堆积 + //barHeight = x - baseXP; + barHeight = m > 0 + ? valueAxis.getCoordSize(value) + : (valueAxis.getCoord(value) - baseXP); + // 非堆积数据最小高度有效 + if (n === 1 + && barMinHeightMap[seriesIndex] > barHeight + ) { + barHeight = barMinHeightMap[seriesIndex]; + } + x = lastXP; + lastXP += barHeight; + } + else if (value < 0){ + // 负向堆积 + //barHeight = baseXN - x; + barHeight = m > 0 + ? valueAxis.getCoordSize(value) + : (baseXN - valueAxis.getCoord(value)); + // 非堆积数据最小高度有效 + if (n === 1 + && barMinHeightMap[seriesIndex] > barHeight + ) { + barHeight = barMinHeightMap[seriesIndex]; + } + lastXN -= barHeight; + x = lastXN; + } + else { + // 0值 + barHeight = 0;//x - baseXP; + // 最小高度无效 + x = lastXP; + lastXP += barHeight; + } + + xMarkMap[seriesIndex][i] = + y - (barWidthMap[seriesIndex] || barWidth) / 2; + if (xMarkMap[seriesIndex].min > value) { + xMarkMap[seriesIndex].min = value; + xMarkMap[seriesIndex].minX = x + barHeight; + xMarkMap[seriesIndex].minY = xMarkMap[seriesIndex][i]; + } + if (xMarkMap[seriesIndex].max < value) { + xMarkMap[seriesIndex].max = value; + xMarkMap[seriesIndex].maxX = x + barHeight; + xMarkMap[seriesIndex].maxY = xMarkMap[seriesIndex][i]; + } + xMarkMap[seriesIndex].sum += value; + xMarkMap[seriesIndex].counter++; + + if (i % interval === 0) { + barShape = this._getBarItem( + seriesIndex, i, + categoryAxis.getNameByIndex(i), + x, y - (barWidthMap[seriesIndex] || barWidth), + barHeight, + barWidthMap[seriesIndex] || barWidth, + 'horizontal' + ); + this.shapeList.push(new RectangleShape(barShape)); + } + } + + // 补充空数据的拖拽提示框 + for (var m = 0, n = locationMap[j].length; m < n; m++) { + seriesIndex = locationMap[j][m]; + serie = series[seriesIndex]; + data = serie.data[i]; + value = data != null + ? (data.value != null + ? data.value + : data) + : '-'; + if (value != '-') { + // 只关心空数据 + continue; + } + + if (this.deepQuery( + [data, serie, this.option], 'calculable' + ) + ) { + x = lastXP; + lastXP += this.ecTheme.island.r; + + barShape = this._getBarItem( + seriesIndex, + i, + categoryAxis.getNameByIndex(i), + x + 0.5, y + 0.5 - (barWidthMap[seriesIndex] || barWidth), + this.ecTheme.island.r - 1, + (barWidthMap[seriesIndex] || barWidth) - 1, + 'horizontal' + ); + barShape.hoverable = false; + barShape.draggable = false; + barShape.style.lineWidth = 1; + barShape.style.brushType = 'stroke'; + barShape.style.strokeColor = + serie.calculableHolderColor + || this.ecTheme.calculableHolderColor; + + this.shapeList.push(new RectangleShape(barShape)); + } + } + + y -= ((barWidthMap[seriesIndex] || barWidth) + barGap); + } + } + + for (var j = 0, k = locationMap.length; j < k; j++) { + for (var m = 0, n = locationMap[j].length; m < n; m++) { + seriesIndex = locationMap[j][m]; + if (xMarkMap[seriesIndex].counter > 0) { + xMarkMap[seriesIndex].average = + (xMarkMap[seriesIndex].sum / xMarkMap[seriesIndex].counter).toFixed(2) + - 0; + } + + x = this.component.xAxis.getAxis(series[seriesIndex].xAxisIndex || 0) + .getCoord(xMarkMap[seriesIndex].average); + + xMarkMap[seriesIndex].averageLine = [ + [x, this.component.grid.getYend()], + [x, this.component.grid.getY()] + ]; + xMarkMap[seriesIndex].minLine = [ + [xMarkMap[seriesIndex].minX, this.component.grid.getYend()], + [xMarkMap[seriesIndex].minX, this.component.grid.getY()] + ]; + xMarkMap[seriesIndex].maxLine = [ + [xMarkMap[seriesIndex].maxX, this.component.grid.getYend()], + [xMarkMap[seriesIndex].maxX, this.component.grid.getY()] + ]; + + xMarkMap[seriesIndex].isHorizontal = false; + this.buildMark(seriesIndex); + } + } + }, + + /** + * 我真是自找麻烦啊,为啥要允许系列级个性化最小宽度和高度啊!!! + * @param {CategoryAxis} categoryAxis 类目坐标轴,需要知道类目间隔大小 + * @param {Array} locationMap 整形数据的系列索引 + */ + _mapSize: function (categoryAxis, locationMap, ignoreUserDefined) { + var series = this.series; + var seriesIndex; + var barWidthMap = {}; + var barMinHeightMap = {}; + var sBarWidth; + var sBarWidthCounter = 0; + var sBarWidthTotal = 0; + var barGap; + var barCategoryGap; + var hasFound; + var queryTarget; + var interval = 1; + + for (var j = 0, k = locationMap.length; j < k; j++) { + hasFound = false; // 同一堆积第一个barWidth生效 + for (var m = 0, n = locationMap[j].length; m < n; m++) { + seriesIndex = locationMap[j][m]; + queryTarget = series[seriesIndex]; + if (!ignoreUserDefined) { + if (!hasFound) { + sBarWidth = this.query( + queryTarget, + 'barWidth' + ); + if (sBarWidth != null) { + // 同一堆积第一个生效barWidth + barWidthMap[seriesIndex] = sBarWidth; + sBarWidthTotal += sBarWidth; + sBarWidthCounter++; + hasFound = true; + // 复位前面同一堆积但没被定义的 + for (var ii = 0, ll = m; ii < ll; ii++) { + var pSeriesIndex = locationMap[j][ii]; + barWidthMap[pSeriesIndex] = sBarWidth; + } + } + } else { + barWidthMap[seriesIndex] = sBarWidth; // 用找到的一个 + } + } + + barMinHeightMap[seriesIndex] = this.query(queryTarget, 'barMinHeight'); + barGap = barGap != null ? barGap : this.query(queryTarget, 'barGap'); + barCategoryGap = barCategoryGap != null + ? barCategoryGap : this.query(queryTarget, 'barCategoryGap'); + } + } + + var gap; + var barWidth; + if (locationMap.length != sBarWidthCounter) { + // 至少存在一个自适应宽度的柱形图 + if (!ignoreUserDefined) { + gap = typeof barCategoryGap === 'string' + && barCategoryGap.match(/%$/) + // 百分比 + ? Math.floor( + categoryAxis.getGap() + * (100 - parseFloat(barCategoryGap)) + / 100 + ) + // 数值 + : (categoryAxis.getGap() - barCategoryGap); + if (typeof barGap === 'string' && barGap.match(/%$/)) { + barGap = parseFloat(barGap) / 100; + barWidth = Math.floor( + (gap - sBarWidthTotal) + / ((locationMap.length - 1) * barGap + + locationMap.length - sBarWidthCounter) + ); + barGap = Math.floor(barWidth * barGap); + } + else { + barGap = parseFloat(barGap); + barWidth = Math.floor( + (gap - sBarWidthTotal + - barGap * (locationMap.length - 1) + ) + / (locationMap.length - sBarWidthCounter) + ); + } + // 无法满足用户定义的宽度设计,忽略用户宽度,打回重做 + if (barWidth <= 0) { + return this._mapSize(categoryAxis, locationMap, true); + } + } + else { + // 忽略用户定义的宽度设定 + gap = categoryAxis.getGap(); + barGap = 0; + barWidth = Math.floor(gap / locationMap.length); + // 已经忽略用户定义的宽度设定依然还无法满足显示,只能硬来了; + if (barWidth <= 0) { + interval = Math.floor(locationMap.length / gap); + barWidth = 1; + } + } + } + else { + // 全是自定义宽度,barGap无效,系列间隔决定barGap + gap = sBarWidthCounter > 1 + ? (typeof barCategoryGap === 'string' + && barCategoryGap.match(/%$/) + ) + // 百分比 + ? Math.floor( + categoryAxis.getGap() + * (100 - parseFloat(barCategoryGap)) + / 100 + ) + // 数值 + : (categoryAxis.getGap() - barCategoryGap) + // 只有一个 + : sBarWidthTotal; + barWidth = 0; + barGap = sBarWidthCounter > 1 + ? Math.floor( + (gap - sBarWidthTotal) / (sBarWidthCounter - 1) + ) + : 0; + if (barGap < 0) { + // 无法满足用户定义的宽度设计,忽略用户宽度,打回重做 + return this._mapSize(categoryAxis, locationMap, true); + } + } + + return { + barWidthMap: barWidthMap, + barMinHeightMap: barMinHeightMap , + gap: gap, + barWidth: barWidth, + barGap: barGap, + interval: interval + }; + }, + + /** + * 生成最终图形数据 + */ + _getBarItem: function (seriesIndex, dataIndex, name, x, y, width, height, orient) { + var series = this.series; + var barShape; + var serie = series[seriesIndex]; + var data = serie.data[dataIndex]; + // 多级控制 + var defaultColor = this._sIndex2colorMap[seriesIndex]; + var queryTarget = [data, serie]; + var normalColor = this.deepQuery( + queryTarget, + 'itemStyle.normal.color' + ) || defaultColor; + var emphasisColor = this.deepQuery( + queryTarget, + 'itemStyle.emphasis.color' + ); + var normal = this.deepMerge( + queryTarget, + 'itemStyle.normal' + ); + var normalBorderWidth = normal.barBorderWidth; + var emphasis = this.deepMerge( + queryTarget, + 'itemStyle.emphasis' + ); + barShape = { + zlevel: this._zlevelBase, + clickable: this.deepQuery(queryTarget, 'clickable'), + style: { + x: x, + y: y, + width: width, + height: height, + brushType: 'both', + color: this.getItemStyleColor(normalColor, seriesIndex, dataIndex, data), + radius: normal.barBorderRadius, + lineWidth: normalBorderWidth, + strokeColor: normal.barBorderColor + }, + highlightStyle: { + color: this.getItemStyleColor(emphasisColor, seriesIndex, dataIndex, data), + radius: emphasis.barBorderRadius, + lineWidth: emphasis.barBorderWidth, + strokeColor: emphasis.barBorderColor + }, + _orient: orient + }; + barShape.highlightStyle.color = barShape.highlightStyle.color + || (typeof barShape.style.color === 'string' + ? zrColor.lift(barShape.style.color, -0.3) + : barShape.style.color + ); + // 考虑线宽的显示优化 + if (normalBorderWidth > 0 + && barShape.style.height > normalBorderWidth + && barShape.style.width > normalBorderWidth + ) { + barShape.style.y += normalBorderWidth / 2; + barShape.style.height -= normalBorderWidth; + barShape.style.x += normalBorderWidth / 2; + barShape.style.width -= normalBorderWidth; + } + else { + // 太小了或者线宽小于0,废了边线 + barShape.style.brushType = 'fill'; + } + + barShape.highlightStyle.textColor = barShape.highlightStyle.color; + + barShape = this.addLabel(barShape, serie, data, name, orient); + if (barShape.style.textPosition === 'insideLeft' + || barShape.style.textPosition === 'insideRight' + || barShape.style.textPosition === 'insideTop' + || barShape.style.textPosition === 'insideBottom' + ) { + var gap = 5; + switch (barShape.style.textPosition) { + case 'insideLeft': + barShape.style.textX = barShape.style.x + gap; + barShape.style.textY = barShape.style.y + barShape.style.height / 2; + barShape.style.textAlign = 'left'; + barShape.style.textBaseline = 'middle'; + break; + case 'insideRight': + barShape.style.textX = barShape.style.x + barShape.style.width - gap; + barShape.style.textY = barShape.style.y + barShape.style.height / 2; + barShape.style.textAlign = 'right'; + barShape.style.textBaseline = 'middle'; + break; + case 'insideTop': + barShape.style.textX = barShape.style.x + barShape.style.width / 2; + barShape.style.textY = barShape.style.y + gap / 2; + barShape.style.textAlign = 'center'; + barShape.style.textBaseline = 'top'; + break; + case 'insideBottom': + barShape.style.textX = barShape.style.x + barShape.style.width / 2; + barShape.style.textY = barShape.style.y + barShape.style.height - gap / 2; + barShape.style.textAlign = 'center'; + barShape.style.textBaseline = 'bottom'; + break; + } + barShape.style.textPosition = 'specific'; + barShape.style.textColor = barShape.style.textColor || '#fff'; + } + + + + if (this.deepQuery([data, serie, this.option],'calculable')) { + this.setCalculable(barShape); + barShape.draggable = true; + } + + ecData.pack( + barShape, + series[seriesIndex], seriesIndex, + series[seriesIndex].data[dataIndex], dataIndex, + name + ); + + return barShape; + }, + + // 位置转换 + getMarkCoord: function (seriesIndex, mpData) { + var serie = this.series[seriesIndex]; + var xMarkMap = this.xMarkMap[seriesIndex]; + var xAxis = this.component.xAxis.getAxis(serie.xAxisIndex); + var yAxis = this.component.yAxis.getAxis(serie.yAxisIndex); + var dataIndex; + var pos; + if (mpData.type + && (mpData.type === 'max' || mpData.type === 'min' || mpData.type === 'average') + ) { + // 特殊值内置支持 + pos = [ + xMarkMap[mpData.type + 'X'], + xMarkMap[mpData.type + 'Y'], + xMarkMap[mpData.type + 'Line'], + xMarkMap[mpData.type] + ]; + } + else if (xMarkMap.isHorizontal) { + // 横向 + dataIndex = typeof mpData.xAxis === 'string' && xAxis.getIndexByName + ? xAxis.getIndexByName(mpData.xAxis) + : (mpData.xAxis || 0); + + var x = xMarkMap[dataIndex]; + x = x != null + ? x + : typeof mpData.xAxis != 'string' && xAxis.getCoordByIndex + ? xAxis.getCoordByIndex(mpData.xAxis || 0) + : xAxis.getCoord(mpData.xAxis || 0); + + pos = [x, yAxis.getCoord(mpData.yAxis || 0)]; + } + else { + // 纵向 + dataIndex = typeof mpData.yAxis === 'string' && yAxis.getIndexByName + ? yAxis.getIndexByName(mpData.yAxis) + : (mpData.yAxis || 0); + + var y = xMarkMap[dataIndex]; + y = y != null + ? y + : typeof mpData.yAxis != 'string' && yAxis.getCoordByIndex + ? yAxis.getCoordByIndex(mpData.yAxis || 0) + : yAxis.getCoord(mpData.yAxis || 0); + + pos = [xAxis.getCoord(mpData.xAxis || 0), y]; + } + + return pos; + }, + + /** + * 刷新 + */ + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + + this.backupShapeList(); + this._buildShape(); + }, + + /** + * 动态数据增加动画 + */ + addDataAnimation: function (params) { + var series = this.series; + var aniMap = {}; // seriesIndex索引参数 + for (var i = 0, l = params.length; i < l; i++) { + aniMap[params[i][0]] = params[i]; + } + var x; + var dx; + var y; + var dy; + var serie; + var seriesIndex; + var dataIndex; + for (var i = this.shapeList.length - 1; i >= 0; i--) { + seriesIndex = ecData.get(this.shapeList[i], 'seriesIndex'); + if (aniMap[seriesIndex] && !aniMap[seriesIndex][3]) { + // 有数据删除才有移动的动画 + if (this.shapeList[i].type === 'rectangle') { + // 主动画 + dataIndex = ecData.get(this.shapeList[i], 'dataIndex'); + serie = series[seriesIndex]; + if (aniMap[seriesIndex][2] + && dataIndex === serie.data.length - 1 + ) { + // 队头加入删除末尾 + this.zr.delShape(this.shapeList[i].id); + continue; + } + else if (!aniMap[seriesIndex][2] && dataIndex === 0) { + // 队尾加入删除头部 + this.zr.delShape(this.shapeList[i].id); + continue; + } + if (this.shapeList[i]._orient === 'horizontal') { + // 条形图 + dy = this.component.yAxis.getAxis( + serie.yAxisIndex || 0 + ).getGap(); + y = aniMap[seriesIndex][2] ? -dy : dy; + x = 0; + } + else { + // 柱形图 + dx = this.component.xAxis.getAxis( + serie.xAxisIndex || 0 + ).getGap(); + x = aniMap[seriesIndex][2] ? dx : -dx; + y = 0; + } + this.shapeList[i].position = [0, 0]; + this.zr.animate(this.shapeList[i].id, '') + .when( + 500, + { position: [x, y] } + ) + .start(); + } + } + } + } + }; + + zrUtil.inherits(Bar, ChartBase); + zrUtil.inherits(Bar, ComponentBase); + + // 图表注册 + require('../chart').define('bar', Bar); + + return Bar; +}); +/** + * echarts图表类:饼图 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/chart/pie',['require','../component/base','./base','zrender/shape/Text','zrender/shape/Ring','zrender/shape/Circle','zrender/shape/Sector','zrender/shape/BrokenLine','../config','../util/ecData','zrender/tool/util','zrender/tool/math','zrender/tool/color','../chart'],function (require) { + var ComponentBase = require('../component/base'); + var ChartBase = require('./base'); + + // 图形依赖 + var TextShape = require('zrender/shape/Text'); + var RingShape = require('zrender/shape/Ring'); + var CircleShape = require('zrender/shape/Circle'); + var SectorShape = require('zrender/shape/Sector'); + var BrokenLineShape = require('zrender/shape/BrokenLine'); + + var ecConfig = require('../config'); + var ecData = require('../util/ecData'); + var zrUtil = require('zrender/tool/util'); + var zrMath = require('zrender/tool/math'); + var zrColor = require('zrender/tool/color'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} series 数据 + * @param {Object} component 组件 + */ + function Pie(ecTheme, messageCenter, zr, option, myChart){ + // 基类 + ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); + // 图表基类 + ChartBase.call(this); + + var self = this; + /** + * 输出动态视觉引导线 + */ + self.shapeHandler.onmouseover = function (param) { + var shape = param.target; + var seriesIndex = ecData.get(shape, 'seriesIndex'); + var dataIndex = ecData.get(shape, 'dataIndex'); + var percent = ecData.get(shape, 'special'); + var lastAddRadius = shape._lastAddRadius; + + var startAngle = shape.style.startAngle; + var endAngle = shape.style.endAngle; + var defaultColor = shape.highlightStyle.color; + + // 文本标签,需要显示则会有返回 + var label = self.getLabel( + seriesIndex, dataIndex, percent, lastAddRadius, + startAngle, endAngle, defaultColor, + true + ); + if (label) { + self.zr.addHoverShape(label); + } + + // 文本标签视觉引导线,需要显示则会有返回 + var labelLine = self.getLabelLine( + seriesIndex, dataIndex, lastAddRadius, + shape.style.r0, shape.style.r, + startAngle, endAngle, defaultColor, + true + ); + if (labelLine) { + self.zr.addHoverShape(labelLine); + } + }; + + this.refresh(option); + } + + Pie.prototype = { + type: ecConfig.CHART_TYPE_PIE, + /** + * 绘制图形 + */ + _buildShape: function () { + var series = this.series; + var legend = this.component.legend; + this.selectedMap = {}; + this._selected = {}; + var center; + var radius; + + var pieCase; // 饼图箱子 + this._selectedMode = false; + var serieName; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type === ecConfig.CHART_TYPE_PIE) { + series[i] = this.reformOption(series[i]); + serieName = series[i].name || ''; + // 系列图例开关 + this.selectedMap[serieName] = + legend ? legend.isSelected(serieName) : true; + if (!this.selectedMap[serieName]) { + continue; + } + + center = this.parseCenter(this.zr, series[i].center); + radius = this.parseRadius(this.zr, series[i].radius); + this._selectedMode = this._selectedMode || series[i].selectedMode; + this._selected[i] = []; + if (this.deepQuery([series[i], this.option], 'calculable')) { + pieCase = { + zlevel: this._zlevelBase, + hoverable: false, + style: { + x: center[0], // 圆心横坐标 + y: center[1], // 圆心纵坐标 + // 圆环内外半径 + r0: radius[0] <= 10 ? 0 : radius[0] - 10, + r: radius[1] + 10, + brushType: 'stroke', + lineWidth: 1, + strokeColor: series[i].calculableHolderColor + || this.ecTheme.calculableHolderColor + } + }; + ecData.pack(pieCase, series[i], i, undefined, -1); + this.setCalculable(pieCase); + + pieCase = radius[0] <= 10 + ? new CircleShape(pieCase) + : new RingShape(pieCase); + this.shapeList.push(pieCase); + } + this._buildSinglePie(i); + this.buildMark(i); + } + } + + this.addShapeList(); + }, + + /** + * 构建单个饼图 + * + * @param {number} seriesIndex 系列索引 + */ + _buildSinglePie: function (seriesIndex) { + var series = this.series; + var serie = series[seriesIndex]; + var data = serie.data; + var legend = this.component.legend; + var itemName; + var totalSelected = 0; // 迭代累计选中且非0个数 + var totalSelectedValue0 = 0; // 迭代累计选中0只个数 + var totalValue = 0; // 迭代累计 + var maxValue = Number.NEGATIVE_INFINITY; + + // 计算需要显示的个数和总值 + for (var i = 0, l = data.length; i < l; i++) { + itemName = data[i].name; + if (legend){ + this.selectedMap[itemName] = legend.isSelected(itemName); + } else { + this.selectedMap[itemName] = true; + } + if (this.selectedMap[itemName] && !isNaN(data[i].value)) { + if (+data[i].value !== 0) { + totalSelected++; + } + else { + totalSelectedValue0++; + } + totalValue += +data[i].value; + maxValue = Math.max(maxValue, +data[i].value); + } + } + + if (totalValue === 0) { + return; + } + + var percent = 100; + var lastPercent; // 相邻细角度优化 + var lastAddRadius = 0; + var clockWise = serie.clockWise; + var startAngle = serie.startAngle.toFixed(2) - 0; + var endAngle; + var minAngle = serie.minAngle || 0.01; // #bugfixed + var totalAngle = 360 - (minAngle * totalSelected) + - 0.01 * totalSelectedValue0; + var defaultColor; + var roseType = serie.roseType; + var radius; + var r0; // 扇形内半径 + var r1; // 扇形外半径 + + for (var i = 0, l = data.length; i < l; i++) { + itemName = data[i].name; + if (!this.selectedMap[itemName] || isNaN(data[i].value)) { + continue; + } + // 默认颜色策略 + if (legend) { + // 有图例则从图例中获取颜色定义 + defaultColor = legend.getColor(itemName); + } + else { + // 全局颜色定义 + defaultColor = this.zr.getColor(i); + } + + lastPercent = percent; + percent = data[i].value / totalValue; + if (roseType != 'area') { + endAngle = clockWise + ? (startAngle - percent * totalAngle - (percent !== 0 ? minAngle : 0.01)) + : (percent * totalAngle + startAngle + (percent !== 0 ? minAngle : 0.01)); + } + else { + endAngle = clockWise + ? (startAngle - 360 / l) + : (360 / l + startAngle); + } + endAngle = endAngle.toFixed(2) - 0; + percent = (percent * 100).toFixed(2); + + radius = this.parseRadius(this.zr, serie.radius); + r0 = +radius[0]; + r1 = +radius[1]; + + if (roseType === 'radius') { + r1 = data[i].value / maxValue * (r1 - r0) * 0.8 + + (r1 - r0) * 0.2 + + r0; + } + else if (roseType === 'area') { + r1 = Math.sqrt(data[i].value / maxValue) * (r1 - r0) + r0; + } + + if (clockWise) { + var temp; + temp = startAngle; + startAngle = endAngle; + endAngle = temp; + } + + // 当前小角度需要检查前一个是否也是小角度,如果是得调整长度,不能完全避免,但能大大降低覆盖概率 + if (i > 0 + && Math.abs(startAngle - endAngle) < 15 // 约15度 + && lastPercent < 4 + && this._needLabel(serie, data[i], false) + && this.deepQuery( + [data[i], serie], 'itemStyle.normal.label.position' + ) != 'center' + ) { + // 都小就延长,前小后大就缩短 + lastAddRadius += (percent < 4 ? 20 : -20); + } + else { + lastAddRadius = 0; + } + + this._buildItem( + seriesIndex, i, percent, lastAddRadius, // 相邻最小角度优化 + data[i].selected, + r0, r1, + startAngle, endAngle, defaultColor + ); + if (!clockWise) { + startAngle = endAngle; + } + } + }, + + /** + * 构建单个扇形及指标 + */ + _buildItem: function ( + seriesIndex, dataIndex, percent, lastAddRadius, + isSelected, + r0, r1, + startAngle, endAngle, defaultColor + ) { + var series = this.series; + // 扇形 + var sector = this.getSector( + seriesIndex, dataIndex, percent, isSelected, + r0, r1, + startAngle, endAngle, defaultColor + ); + // 图形需要附加的私有数据 + ecData.pack( + sector, + series[seriesIndex], seriesIndex, + series[seriesIndex].data[dataIndex], dataIndex, + series[seriesIndex].data[dataIndex].name, + percent + ); + sector._lastAddRadius = lastAddRadius; + this.shapeList.push(sector); + + // 文本标签,需要显示则会有返回 + var label = this.getLabel( + seriesIndex, dataIndex, percent, lastAddRadius, + startAngle, endAngle, defaultColor, + false + ); + if (label) { + ecData.pack( + label, + series[seriesIndex], seriesIndex, + series[seriesIndex].data[dataIndex], dataIndex, + series[seriesIndex].data[dataIndex].name, + percent + ); + label._dataIndex = dataIndex; + this.shapeList.push(label); + } + + // 文本标签视觉引导线,需要显示则会有返回 + var labelLine = this.getLabelLine( + seriesIndex, dataIndex, lastAddRadius, + r0, r1, + startAngle, endAngle, defaultColor, + false + ); + if (labelLine) { + ecData.pack( + labelLine, + series[seriesIndex], seriesIndex, + series[seriesIndex].data[dataIndex], dataIndex, + series[seriesIndex].data[dataIndex].name, + percent + ); + labelLine._dataIndex = dataIndex; + this.shapeList.push(labelLine); + } + }, + + /** + * 构建扇形 + */ + getSector: function ( + seriesIndex, dataIndex, percent, isSelected, + r0, r1, + startAngle, endAngle, defaultColor + ) { + var series = this.series; + var serie = series[seriesIndex]; + var data = serie.data[dataIndex]; + var queryTarget = [data, serie]; + var center = this.parseCenter(this.zr, serie.center); + + // 多级控制 + var normal = this.deepMerge( + queryTarget, + 'itemStyle.normal' + ) || {}; + var emphasis = this.deepMerge( + queryTarget, + 'itemStyle.emphasis' + ) || {}; + var normalColor = this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) + || defaultColor; + + var emphasisColor = this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data) + || (typeof normalColor === 'string' + ? zrColor.lift(normalColor, -0.2) + : normalColor + ); + + var sector = { + zlevel: this._zlevelBase, + clickable: this.deepQuery(queryTarget, 'clickable'), + style: { + x: center[0], // 圆心横坐标 + y: center[1], // 圆心纵坐标 + r0: r0, // 圆环内半径 + r: r1, // 圆环外半径 + startAngle: startAngle, + endAngle: endAngle, + brushType: 'both', + color: normalColor, + lineWidth: normal.borderWidth, + strokeColor: normal.borderColor, + lineJoin: 'round' + }, + highlightStyle: { + color: emphasisColor, + lineWidth: emphasis.borderWidth, + strokeColor: emphasis.borderColor, + lineJoin: 'round' + }, + _seriesIndex: seriesIndex, + _dataIndex: dataIndex + }; + + if (isSelected) { + var midAngle = + ((sector.style.startAngle + sector.style.endAngle) / 2) + .toFixed(2) - 0; + sector.style._hasSelected = true; + sector.style._x = sector.style.x; + sector.style._y = sector.style.y; + var offset = this.query(serie, 'selectedOffset'); + sector.style.x += zrMath.cos(midAngle, true) * offset; + sector.style.y -= zrMath.sin(midAngle, true) * offset; + + this._selected[seriesIndex][dataIndex] = true; + } + else { + this._selected[seriesIndex][dataIndex] = false; + } + + + if (this._selectedMode) { + sector.onclick = this.shapeHandler.onclick; + } + + if (this.deepQuery([data, serie, this.option], 'calculable')) { + this.setCalculable(sector); + sector.draggable = true; + } + + // “normal下不显示,emphasis显示”添加事件响应 + if (this._needLabel(serie, data, true) // emphasis下显示文本 + || this._needLabelLine(serie, data, true) // emphasis下显示引导线 + ) { + sector.onmouseover = this.shapeHandler.onmouseover; + } + + sector = new SectorShape(sector); + return sector; + }, + + /** + * 需要显示则会有返回构建好的shape,否则返回undefined + */ + getLabel: function ( + seriesIndex, dataIndex, percent, lastAddRadius, + startAngle, endAngle, defaultColor, + isEmphasis + ) { + var series = this.series; + var serie = series[seriesIndex]; + var data = serie.data[dataIndex]; + + // 特定状态下是否需要显示文本标签 + if (!this._needLabel(serie, data, isEmphasis)) { + return; + } + + var status = isEmphasis ? 'emphasis' : 'normal'; + + // serie里有默认配置,放心大胆的用! + var itemStyle = zrUtil.merge( + zrUtil.clone(data.itemStyle) || {}, + serie.itemStyle + ); + // label配置 + var labelControl = itemStyle[status].label; + var textStyle = labelControl.textStyle || {}; + + var center = this.parseCenter(this.zr, serie.center); + var centerX = center[0]; // 圆心横坐标 + var centerY = center[1]; // 圆心纵坐标 + var x; + var y; + var midAngle = ((endAngle + startAngle) / 2 + 360) % 360; // 中值 + var radius = this.parseRadius(this.zr, serie.radius); // 标签位置半径 + var textAlign; + var textBaseline = 'middle'; + labelControl.position = labelControl.position + || itemStyle.normal.label.position; + if (labelControl.position === 'center') { + // center显示 + radius = radius[1]; + x = centerX; + y = centerY; + textAlign = 'center'; + } + else if (labelControl.position === 'inner'){ + // 内部显示 + radius = (radius[0] + radius[1]) / 2 + lastAddRadius; + x = Math.round( + centerX + radius * zrMath.cos(midAngle, true) + ); + y = Math.round( + centerY - radius * zrMath.sin(midAngle, true) + ); + defaultColor = '#fff'; + textAlign = 'center'; + + } + else { + // 外部显示,默认 labelControl.position === 'outer') + radius = radius[1] + - (-itemStyle[status].labelLine.length) + //- (-textStyle.fontSize) + + lastAddRadius; + x = centerX + radius * zrMath.cos(midAngle, true); + y = centerY - radius * zrMath.sin(midAngle, true); + textAlign = (midAngle >= 90 && midAngle <= 270) ? 'right' : 'left'; + } + + if (labelControl.position != 'center' + && labelControl.position != 'inner' + ) { + x += textAlign === 'left' ? 20 : -20; + } + data.__labelX = x - (textAlign === 'left' ? 5 : -5); + data.__labelY = y; + + return new TextShape({ + zlevel: this._zlevelBase + 1, + hoverable: false, + style: { + x: x, + y: y, + color: textStyle.color || defaultColor, + text: this.getLabelText(seriesIndex, dataIndex, percent, status), + textAlign: textStyle.align || textAlign, + textBaseline: textStyle.baseline || textBaseline, + textFont: this.getFont(textStyle) + }, + highlightStyle: { + brushType: 'fill' + }, + _seriesIndex: seriesIndex, + _dataIndex: dataIndex + }); + }, + + /** + * 根据lable.format计算label text + */ + getLabelText: function (seriesIndex, dataIndex, percent, status) { + var series = this.series; + var serie = series[seriesIndex]; + var data = serie.data[dataIndex]; + var formatter = this.deepQuery( + [data, serie], + 'itemStyle.' + status + '.label.formatter' + ); + + if (formatter) { + if (typeof formatter === 'function') { + return formatter.call( + this.myChart, + serie.name, + data.name, + data.value, + percent + ); + } + else if (typeof formatter === 'string') { + formatter = formatter.replace('{a}','{a0}') + .replace('{b}','{b0}') + .replace('{c}','{c0}') + .replace('{d}','{d0}'); + formatter = formatter.replace('{a0}', serie.name) + .replace('{b0}', data.name) + .replace('{c0}', data.value) + .replace('{d0}', percent); + + return formatter; + } + } + else { + return data.name; + } + }, + + /** + * 需要显示则会有返回构建好的shape,否则返回undefined + */ + getLabelLine: function ( + seriesIndex, dataIndex, lastAddRadius, + r0, r1, + startAngle, endAngle, defaultColor, + isEmphasis + ) { + var series = this.series; + var serie = series[seriesIndex]; + var data = serie.data[dataIndex]; + + // 特定状态下是否需要显示文本标签 + if (this._needLabelLine(serie, data, isEmphasis)) { + var status = isEmphasis ? 'emphasis' : 'normal'; + + // serie里有默认配置,放心大胆的用! + var itemStyle = zrUtil.merge( + zrUtil.clone(data.itemStyle) || {}, + serie.itemStyle + ); + // labelLine配置 + var labelLineControl = itemStyle[status].labelLine; + var lineStyle = labelLineControl.lineStyle || {}; + + var center = this.parseCenter(this.zr, serie.center); + var centerX = center[0]; // 圆心横坐标 + var centerY = center[1]; // 圆心纵坐标 + // 视觉引导线起点半径 + var midRadius = r1; + // 视觉引导线终点半径 + var maxRadius = this.parseRadius(this.zr, serie.radius)[1] + - (-labelLineControl.length) + + lastAddRadius; + var midAngle = ((endAngle + startAngle) / 2) % 360; // 角度中值 + var cosValue = zrMath.cos(midAngle, true); + var sinValue = zrMath.sin(midAngle, true); + // 三角函数缓存已在zrender/tool/math中做了 + return new BrokenLineShape({ + // shape: 'brokenLine', + zlevel: this._zlevelBase + 1, + hoverable: false, + style: { + pointList: [ + [ + centerX + midRadius * cosValue, + centerY - midRadius * sinValue + ], + [ + centerX + maxRadius * cosValue, + centerY - maxRadius * sinValue + ], + [ + data.__labelX, + data.__labelY + ] + ], + //xStart: centerX + midRadius * cosValue, + //yStart: centerY - midRadius * sinValue, + //xEnd: centerX + maxRadius * cosValue, + //yEnd: centerY - maxRadius * sinValue, + strokeColor: lineStyle.color || defaultColor, + lineType: lineStyle.type, + lineWidth: lineStyle.width + }, + _seriesIndex: seriesIndex, + _dataIndex: dataIndex + }); + } + else { + return; + } + }, + + /** + * 返回特定状态(normal or emphasis)下是否需要显示label标签文本 + * @param {Object} serie + * @param {Object} data + * @param {boolean} isEmphasis true is 'emphasis' and false is 'normal' + */ + _needLabel: function (serie, data, isEmphasis) { + return this.deepQuery( + [data, serie], + 'itemStyle.' + + (isEmphasis ? 'emphasis' : 'normal') + + '.label.show' + ); + }, + + /** + * 返回特定状态(normal or emphasis)下是否需要显示labelLine标签视觉引导线 + * @param {Object} serie + * @param {Object} data + * @param {boolean} isEmphasis true is 'emphasis' and false is 'normal' + */ + _needLabelLine: function (serie, data, isEmphasis) { + return this.deepQuery( + [data, serie], + 'itemStyle.' + + (isEmphasis ? 'emphasis' : 'normal') + +'.labelLine.show' + ); + }, + + /** + * 参数修正&默认值赋值,重载基类方法 + * @param {Object} opt 参数 + */ + reformOption: function (opt) { + // 常用方法快捷方式 + var _merge = zrUtil.merge; + opt = _merge( + opt || {}, + this.ecTheme.pie + ); + + // 通用字体设置 + opt.itemStyle.normal.label.textStyle = _merge( + opt.itemStyle.normal.label.textStyle || {}, + this.ecTheme.textStyle + ); + opt.itemStyle.emphasis.label.textStyle = _merge( + opt.itemStyle.emphasis.label.textStyle || {}, + this.ecTheme.textStyle + ); + + return opt; + }, + + /** + * 刷新 + */ + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + + this.backupShapeList(); + this._buildShape(); + }, + + /** + * 动态数据增加动画 + */ + addDataAnimation: function (params) { + var series = this.series; + var aniMap = {}; // seriesIndex索引参数 + for (var i = 0, l = params.length; i < l; i++) { + aniMap[params[i][0]] = params[i]; + } + + // 构建新的饼图匹配差异做动画 + var sectorMap = {}; + var textMap = {}; + var lineMap = {}; + var backupShapeList = this.shapeList; + this.shapeList = []; + + var seriesIndex; + var isHead; + var dataGrow; + var deltaIdxMap = {}; // 修正新增数据后会对dataIndex产生错位匹配 + for (var i = 0, l = params.length; i < l; i++) { + seriesIndex = params[i][0]; + isHead = params[i][2]; + dataGrow = params[i][3]; + if (series[seriesIndex] + && series[seriesIndex].type === ecConfig.CHART_TYPE_PIE + ) { + if (isHead) { + if (!dataGrow) { + sectorMap[ + seriesIndex + + '_' + + series[seriesIndex].data.length + ] = 'delete'; + } + deltaIdxMap[seriesIndex] = 1; + } + else { + if (!dataGrow) { + sectorMap[seriesIndex + '_-1'] = 'delete'; + deltaIdxMap[seriesIndex] = -1; + } + else { + deltaIdxMap[seriesIndex] = 0; + } + } + this._buildSinglePie(seriesIndex); + } + } + var dataIndex; + var key; + for (var i = 0, l = this.shapeList.length; i < l; i++) { + seriesIndex = this.shapeList[i]._seriesIndex; + dataIndex = this.shapeList[i]._dataIndex; + key = seriesIndex + '_' + dataIndex; + // map映射让n*n变n + switch (this.shapeList[i].type) { + case 'sector' : + sectorMap[key] = this.shapeList[i]; + break; + case 'text' : + textMap[key] = this.shapeList[i]; + break; + case 'broken-line' : + lineMap[key] = this.shapeList[i]; + break; + } + } + this.shapeList = []; + var targeSector; + for (var i = 0, l = backupShapeList.length; i < l; i++) { + seriesIndex = backupShapeList[i]._seriesIndex; + if (aniMap[seriesIndex]) { + dataIndex = backupShapeList[i]._dataIndex + + deltaIdxMap[seriesIndex]; + key = seriesIndex + '_' + dataIndex; + targeSector = sectorMap[key]; + if (!targeSector) { + continue; + } + if (backupShapeList[i].type === 'sector') { + if (targeSector != 'delete') { + // 原有扇形 + this.zr.animate(backupShapeList[i].id, 'style') + .when( + 400, + { + startAngle: targeSector.style.startAngle, + endAngle: targeSector.style.endAngle + } + ) + .start(); + } + else { + // 删除的扇形 + this.zr.animate(backupShapeList[i].id, 'style') + .when( + 400, + deltaIdxMap[seriesIndex] < 0 + ? { startAngle: backupShapeList[i].style.startAngle } + : { endAngle: backupShapeList[i].style.endAngle } + ) + .start(); + } + } + else if (backupShapeList[i].type === 'text' + || backupShapeList[i].type === 'broken-line' + ) { + if (targeSector === 'delete') { + // 删除逻辑一样 + this.zr.delShape(backupShapeList[i].id); + } + else { + // 懒得新建变量了,借用一下 + switch (backupShapeList[i].type) { + case 'text': + targeSector = textMap[key]; + this.zr.animate(backupShapeList[i].id, 'style') + .when( + 400, + { + x :targeSector.style.x, + y :targeSector.style.y + } + ) + .start(); + break; + case 'broken-line': + targeSector = lineMap[key]; + this.zr.animate(backupShapeList[i].id, 'style') + .when( + 400, + { + pointList:targeSector.style.pointList + } + ) + .start(); + break; + } + + } + } + } + } + this.shapeList = backupShapeList; + }, + + onclick: function (param) { + var series = this.series; + if (!this.isClick || !param.target) { + // 没有在当前实例上发生点击直接返回 + return; + } + this.isClick = false; + var offset; // 偏移 + var target = param.target; + var style = target.style; + var seriesIndex = ecData.get(target, 'seriesIndex'); + var dataIndex = ecData.get(target, 'dataIndex'); + + for (var i = 0, len = this.shapeList.length; i < len; i++) { + if (this.shapeList[i].id === target.id) { + seriesIndex = ecData.get(target, 'seriesIndex'); + dataIndex = ecData.get(target, 'dataIndex'); + // 当前点击的 + if (!style._hasSelected) { + var midAngle = + ((style.startAngle + style.endAngle) / 2) + .toFixed(2) - 0; + target.style._hasSelected = true; + this._selected[seriesIndex][dataIndex] = true; + target.style._x = target.style.x; + target.style._y = target.style.y; + offset = this.query( + series[seriesIndex], + 'selectedOffset' + ); + target.style.x += zrMath.cos(midAngle, true) + * offset; + target.style.y -= zrMath.sin(midAngle, true) + * offset; + } + else { + // 复位 + target.style.x = target.style._x; + target.style.y = target.style._y; + target.style._hasSelected = false; + this._selected[seriesIndex][dataIndex] = false; + } + + this.zr.modShape(target.id, target); + } + else if (this.shapeList[i].style._hasSelected + && this._selectedMode === 'single' + ) { + seriesIndex = ecData.get(this.shapeList[i], 'seriesIndex'); + dataIndex = ecData.get(this.shapeList[i], 'dataIndex'); + // 单选模式下需要取消其他已经选中的 + this.shapeList[i].style.x = this.shapeList[i].style._x; + this.shapeList[i].style.y = this.shapeList[i].style._y; + this.shapeList[i].style._hasSelected = false; + this._selected[seriesIndex][dataIndex] = false; + this.zr.modShape( + this.shapeList[i].id, this.shapeList[i] + ); + } + } + + this.messageCenter.dispatch( + ecConfig.EVENT.PIE_SELECTED, + param.event, + { + selected: this._selected, + target: ecData.get(target, 'name') + }, + this.myChart + ); + this.zr.refresh(); + } + }; + + zrUtil.inherits(Pie, ChartBase); + zrUtil.inherits(Pie, ComponentBase); + + // 图表注册 + require('../chart').define('pie', Pie); + + return Pie; }); define('_chart',['require','echarts/chart/gauge','echarts/chart/funnel','echarts/chart/scatter','echarts/chart/k','echarts/chart/radar','echarts/chart/chord','echarts/chart/force','echarts/chart/line','echarts/chart/bar','echarts/chart/pie'],function (require) { require("echarts/chart/gauge"); diff --git a/build/echarts-plain-map.js b/build/echarts-plain-map.js index 492d3a6..37afb1d 100644 --- a/build/echarts-plain-map.js +++ b/build/echarts-plain-map.js @@ -13,8 +13,7 @@ // Zepto.js may be freely distributed under the MIT license. /*! - * ZRender, a lightweight canvas library with a MVC architecture, data-driven - * and provides an event model like DOM. + * ZRender, a high performance canvas library. * * Copyright (c) 2013, Baidu Inc. * All rights reserved. @@ -33,4 +32,4 @@ * https://github.com/ecomfe/echarts/blob/master/LICENSE.txt */ -(function(e){var t,n,r;(function(e){function d(e,t){return h.call(e,t)}function v(e,t){var n,r,i,s,o,u,a,f,c,h,p=t&&t.split("/"),d=l.map,v=d&&d["*"]||{};if(e&&e.charAt(0)===".")if(t){p=p.slice(0,p.length-1),e=p.concat(e.split("/"));for(f=0;f0&&(e.splice(f-1,2),f-=2)}}e=e.join("/")}else e.indexOf("./")===0&&(e=e.substring(2));if((p||v)&&d){n=e.split("/");for(f=n.length;f>0;f-=1){r=n.slice(0,f).join("/");if(p)for(c=p.length;c>0;c-=1){i=d[p.slice(0,c).join("/")];if(i){i=i[r];if(i){s=i,o=f;break}}}if(s)break;!u&&v&&v[r]&&(u=v[r],a=f)}!s&&u&&(s=u,o=a),s&&(n.splice(0,o,s),e=n.join("/"))}return e}function m(t,n){return function(){return s.apply(e,p.call(arguments,0).concat([t,n]))}}function g(e){return function(t){return v(t,e)}}function y(e){return function(t){a[e]=t}}function b(t){if(d(f,t)){var n=f[t];delete f[t],c[t]=!0,i.apply(e,n)}if(!d(a,t)&&!d(c,t))throw new Error("No "+t);return a[t]}function w(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function E(e){return function(){return l&&l.config&&l.config[e]||{}}}var i,s,o,u,a={},f={},l={},c={},h=Object.prototype.hasOwnProperty,p=[].slice;o=function(e,t){var n,r=w(e),i=r[0];return e=r[1],i&&(i=v(i,t),n=b(i)),i?n&&n.normalize?e=n.normalize(e,g(t)):e=v(e,t):(e=v(e,t),r=w(e),i=r[0],e=r[1],i&&(n=b(i))),{f:i?i+"!"+e:e,n:e,pr:i,p:n}},u={require:function(e){return m(e)},exports:function(e){var t=a[e];return typeof t!="undefined"?t:a[e]={}},module:function(e){return{id:e,uri:"",exports:a[e],config:E(e)}}},i=function(t,n,r,i){var s,l,h,p,v,g=[],w;i=i||t;if(typeof r=="function"){n=!n.length&&r.length?["require","exports","module"]:n;for(v=0;v{b} : {c}",showDelay:20,hideDelay:100,transitionDuration:.4,backgroundColor:"rgba(0,0,0,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,axisPointer:{type:"line",lineStyle:{color:"#48b",width:2,type:"solid"},crossStyle:{color:"#1e90ff",width:1,type:"dashed"},shadowStyle:{color:"rgba(150,150,150,0.3)",width:"auto",type:"default"}},textStyle:{color:"#fff"}},dataZoom:{show:!1,orient:"horizontal",backgroundColor:"rgba(0,0,0,0)",dataBackgroundColor:"#eee",fillerColor:"rgba(144,197,237,0.2)",handleColor:"rgba(70,130,180,0.8)",realtime:!0},grid:{x:80,y:60,x2:80,y2:60,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},categoryAxis:{position:"bottom",name:"",nameLocation:"end",nameTextStyle:{},boundaryGap:!0,axisLine:{show:!0,onZero:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!0,interval:"auto",inside:!1,length:5,lineStyle:{color:"#333",width:1}},axisLabel:{show:!0,interval:"auto",rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}}},valueAxis:{position:"left",name:"",nameLocation:"end",nameTextStyle:{},boundaryGap:[0,0],precision:0,power:100,splitNumber:5,axisLine:{show:!0,onZero:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,inside:!1,length:5,lineStyle:{color:"#333",width:1}},axisLabel:{show:!0,rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}}},polar:{center:["50%","50%"],radius:"75%",startAngle:90,splitNumber:5,name:{show:!0,textStyle:{color:"#333"}},axisLine:{show:!0,lineStyle:{color:"#ccc",width:1,type:"solid"}},axisLabel:{show:!1,textStyle:{color:"#333"}},splitArea:{show:!0,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}},splitLine:{show:!0,lineStyle:{width:1,color:"#ccc"}},type:"polygon"},timeline:{show:!0,type:"time",notMerge:!1,realtime:!0,x:80,x2:80,y2:0,height:50,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,controlPosition:"left",autoPlay:!1,loop:!0,playInterval:2e3,lineStyle:{width:1,color:"#666",type:"dashed"},label:{show:!0,interval:"auto",rotate:0,textStyle:{color:"#333"}},checkpointStyle:{symbol:"auto",symbolSize:"auto",color:"auto",borderColor:"auto",borderWidth:"auto",label:{show:!1,textStyle:{color:"auto"}}},controlStyle:{normal:{color:"#333"},emphasis:{color:"#1e90ff"}},symbol:"emptyDiamond",symbolSize:4,currentIndex:0},bar:{xAxisIndex:0,yAxisIndex:0,barMinHeight:0,barGap:"30%",barCategoryGap:"20%",itemStyle:{normal:{borderColor:"#fff",borderRadius:0,borderWidth:0,label:{show:!1}},emphasis:{borderColor:"#fff",borderRadius:0,borderWidth:0,label:{show:!1}}}},line:{xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid",shadowColor:"rgba(0,0,0,0)",shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0}},emphasis:{label:{show:!1}}},symbolSize:2,showAllSymbol:!1},k:{xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{color:"#fff",color0:"#00aa11",lineStyle:{width:1,color:"#ff3200",color0:"#00aa11"}},emphasis:{}}},scatter:{xAxisIndex:0,yAxisIndex:0,symbolSize:4,large:!1,largeThreshold:2e3,itemStyle:{normal:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}},emphasis:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}}}},radar:{polarIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid"}},emphasis:{label:{show:!1}}},symbolSize:2},pie:{center:["50%","50%"],radius:[0,"75%"],clockWise:!0,startAngle:90,minAngle:0,selectedOffset:10,itemStyle:{normal:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1,type:"solid"}}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!1},labelLine:{show:!1,length:20,lineStyle:{width:1,type:"solid"}}}}},map:{mapType:"china",mapValuePrecision:0,showLegendSymbol:!0,hoverable:!0,itemStyle:{normal:{borderColor:"rgba(0,0,0,0)",borderWidth:1,areaStyle:{color:"#ccc"},label:{show:!1,textStyle:{color:"rgb(139,69,19)"}}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,areaStyle:{color:"rgba(255,215,0,0.8)"},label:{show:!1,textStyle:{color:"rgb(100,0,0)"}}}}},force:{center:["50%","50%"],size:"100%",coolDown:.99,minRadius:10,maxRadius:20,ratioScaling:!1,large:!1,useWorker:!1,steps:1,scaling:1,gravity:1,symbol:"circle",symbolSize:0,linkSymbol:null,linkSymbolSize:[10,15],draggable:!0,categories:[{}],itemStyle:{normal:{label:{show:!1},nodeStyle:{brushType:"both",color:"#f08c2e",strokeColor:"#5182ab",lineWidth:1},linkStyle:{strokeColor:"#5182ab"}},emphasis:{label:{show:!1},nodeStyle:{},linkStyle:{opacity:0}}}},chord:{radius:["65%","75%"],center:["50%","50%"],padding:2,sort:"none",sortSub:"none",startAngle:90,clockWise:!0,showScale:!1,showScaleText:!1,itemStyle:{normal:{label:{show:!0,rotate:!1,distance:10},lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:1,color:"#999"}}},emphasis:{lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:1,color:"#666"}}}},matrix:[]},gauge:{center:["50%","50%"],radius:"75%",startAngle:225,endAngle:-45,min:0,max:100,precision:0,splitNumber:10,axisLine:{show:!0,lineStyle:{color:[[.2,"#228b22"],[.8,"#48b"],[1,"#ff4500"]],width:30}},axisTick:{show:!0,splitNumber:5,length:8,lineStyle:{color:"#eee",width:1,type:"solid"}},axisLabel:{show:!0,textStyle:{color:"auto"}},splitLine:{show:!0,length:30,lineStyle:{color:"#eee",width:2,type:"solid"}},pointer:{show:!0,length:"80%",width:8,color:"auto"},title:{show:!0,offsetCenter:[0,"-40%"],textStyle:{color:"#333",fontSize:15}},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:40,offsetCenter:[0,"40%"],textStyle:{color:"auto",fontSize:30}}},funnel:{x:80,y:60,x2:80,y2:60,min:0,max:100,minSize:"0%",maxSize:"100%",sort:"descending",gap:0,itemStyle:{normal:{borderColor:"#fff",borderWidth:1,label:{show:!0,position:"outer"},labelLine:{show:!0,length:10,lineStyle:{width:1,type:"solid"}}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!0},labelLine:{show:!0}}}},island:{r:15,calculateStep:.1},markPoint:{symbol:"pin",symbolSize:10,large:!1,effect:{show:!1,loop:!0,period:15,scaleSize:2},itemStyle:{normal:{borderWidth:2,label:{show:!0,position:"inside"}},emphasis:{label:{show:!0}}}},markLine:{symbol:["circle","arrow"],symbolSize:[2,4],large:!1,effect:{show:!1,loop:!0,period:15,scaleSize:2},itemStyle:{normal:{borderWidth:1.5,label:{show:!0,position:"end"},lineStyle:{type:"dashed"}},emphasis:{label:{show:!1},lineStyle:{}}}},textStyle:{decoration:"none",fontFamily:"Arial, Verdana, sans-serif",fontFamily2:"微软雅黑",fontSize:12,fontStyle:"normal",fontWeight:"normal"},EVENT:{REFRESH:"refresh",RESTORE:"restore",RESIZE:"resize",CLICK:"click",HOVER:"hover",DATA_CHANGED:"dataChanged",DATA_ZOOM:"dataZoom",DATA_RANGE:"dataRange",LEGEND_SELECTED:"legendSelected",MAP_SELECTED:"mapSelected",PIE_SELECTED:"pieSelected",MAGIC_TYPE_CHANGED:"magicTypeChanged",DATA_VIEW_CHANGED:"dataViewChanged",TIMELINE_CHANGED:"timelineChanged",MAP_ROAM:"mapRoam",TOOLTIP_HOVER:"tooltipHover",TOOLTIP_IN_GRID:"tooltipInGrid",TOOLTIP_OUT_GRID:"tooltipOutGrid"},DRAG_ENABLE_TIME:120,EFFECT_ZLEVEL:7,symbolList:["circle","rectangle","triangle","diamond","emptyCircle","emptyRectangle","emptyTriangle","emptyDiamond"],loadingText:"Loading...",calculable:!1,calculableColor:"rgba(255,165,0,0.6)",calculableHolderColor:"#ccc",nameConnector:" & ",valueConnector:" : ",animation:!0,addDataAnimation:!0,animationThreshold:2e3,animationDuration:2e3,animationEasing:"ExponentialOut"};return e}),r("zrender/lib/excanvas",["require"],function(e){return document.createElement("canvas").getContext?G_vmlCanvasManager=!1:function(){function f(){return this.context_||(this.context_=new I(this))}function c(e,t,n){var r=l.call(arguments,2);return function(){return e.apply(t,r.concat(l.call(arguments)))}}function h(e){return String(e).replace(/&/g,"&").replace(/"/g,""")}function p(e,t,n){e.namespaces[t]||e.namespaces.add(t,n,"#default#VML")}function d(e){p(e,"g_vml_","urn:schemas-microsoft-com:vml"),p(e,"g_o_","urn:schemas-microsoft-com:office:office");if(!e.styleSheets.ex_canvas_){var t=e.createStyleSheet();t.owningElement.id="ex_canvas_",t.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}function m(e){var t=e.srcElement;switch(e.propertyName){case"width":t.getContext().clearRect(),t.style.width=t.attributes.width.nodeValue+"px",t.firstChild.style.width=t.clientWidth+"px";break;case"height":t.getContext().clearRect(),t.style.height=t.attributes.height.nodeValue+"px",t.firstChild.style.height=t.clientHeight+"px"}}function g(e){var t=e.srcElement;t.firstChild&&(t.firstChild.style.width=t.clientWidth+"px",t.firstChild.style.height=t.clientHeight+"px")}function E(){return[[1,0,0],[0,1,0],[0,0,1]]}function S(e,t){var n=E();for(var r=0;r<3;r++)for(var i=0;i<3;i++){var s=0;for(var o=0;o<3;o++)s+=e[r][o]*t[o][i];n[r][i]=s}return n}function x(e,t){t.fillStyle=e.fillStyle,t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY,t.strokeStyle=e.strokeStyle,t.globalAlpha=e.globalAlpha,t.font=e.font,t.textAlign=e.textAlign,t.textBaseline=e.textBaseline,t.arcScaleX_=e.arcScaleX_,t.arcScaleY_=e.arcScaleY_,t.lineScale_=e.lineScale_}function N(e){var t=e.indexOf("(",3),n=e.indexOf(")",t+1),r=e.substring(t+1,n).split(",");if(r.length!=4||e.charAt(3)!="a")r[3]=1;return r}function C(e){return parseFloat(e)/100}function k(e,t,n){return Math.min(n,Math.max(t,e))}function L(e){var t,n,r,i,s,o;i=parseFloat(e[0])/360%360,i<0&&i++,s=k(C(e[1]),0,1),o=k(C(e[2]),0,1);if(s==0)t=n=r=o;else{var u=o<.5?o*(1+s):o+s-o*s,a=2*o-u;t=A(a,u,i+1/3),n=A(a,u,i),r=A(a,u,i-1/3)}return"#"+y[Math.floor(t*255)]+y[Math.floor(n*255)]+y[Math.floor(r*255)]}function A(e,t,n){return n<0&&n++,n>1&&n--,6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function M(e){if(e in O)return O[e];var t,n=1;e=String(e);if(e.charAt(0)=="#")t=e;else if(/^rgb/.test(e)){var r=N(e),t="#",i;for(var s=0;s<3;s++)r[s].indexOf("%")!=-1?i=Math.floor(C(r[s])*255):i=+r[s],t+=y[k(i,0,255)];n=+r[3]}else if(/^hsl/.test(e)){var r=N(e);t=L(r),n=r[3]}else t=T[e]||e;return O[e]={color:t,alpha:n}}function P(e){if(D[e])return D[e];var t=document.createElement("div"),n=t.style,r;try{n.font=e,r=n.fontFamily.split(",")[0]}catch(i){}return D[e]={style:n.fontStyle||_.style,variant:n.fontVariant||_.variant,weight:n.fontWeight||_.weight,size:n.fontSize||_.size,family:r||_.family}}function H(e,t){var n={};for(var r in e)n[r]=e[r];var i=parseFloat(t.currentStyle.fontSize),s=parseFloat(e.size);return typeof e.size=="number"?n.size=e.size:e.size.indexOf("px")!=-1?n.size=s:e.size.indexOf("em")!=-1?n.size=i*s:e.size.indexOf("%")!=-1?n.size=i/100*s:e.size.indexOf("pt")!=-1?n.size=s/.75:n.size=i,n}function B(e){return e.style+" "+e.variant+" "+e.weight+" "+e.size+"px '"+e.family+"'"}function F(e){return j[e]||"square"}function I(e){this.m_=E(),this.mStack_=[],this.aStack_=[],this.currentPath_=[],this.strokeStyle="#000",this.fillStyle="#000",this.lineWidth=1,this.lineJoin="miter",this.lineCap="butt",this.miterLimit=o*1,this.globalAlpha=1,this.font="12px 微软雅黑",this.textAlign="left",this.textBaseline="alphabetic",this.canvas=e;var t="width:"+e.clientWidth+"px;height:"+e.clientHeight+"px;overflow:hidden;position:absolute",n=e.ownerDocument.createElement("div");n.style.cssText=t,e.appendChild(n);var r=n.cloneNode(!1);r.style.backgroundColor="#fff",r.style.filter="alpha(opacity=0)",e.appendChild(r),this.element_=n,this.arcScaleX_=1,this.arcScaleY_=1,this.lineScale_=1}function R(e,t,n,r){e.currentPath_.push({type:"bezierCurveTo",cp1x:t.x,cp1y:t.y,cp2x:n.x,cp2y:n.y,x:r.x,y:r.y}),e.currentX_=r.x,e.currentY_=r.y}function U(e,t){var n=M(e.strokeStyle),r=n.color,i=n.alpha*e.globalAlpha,s=e.lineScale_*e.lineWidth;s<1&&(i*=s),t.push("')}function z(t,n,r,i){var s=t.fillStyle,u=t.arcScaleX_,a=t.arcScaleY_,f=i.x-r.x,l=i.y-r.y;if(s instanceof $){var c=0,h={x:0,y:0},p=0,d=1;if(s.type_=="gradient"){var v=s.x0_/u,m=s.y0_/a,g=s.x1_/u,y=s.y1_/a,b=W(t,v,m),w=W(t,g,y),E=w.x-b.x,S=w.y-b.y;c=Math.atan2(E,S)*180/Math.PI,c<0&&(c+=360),c<1e-6&&(c=0)}else{var b=W(t,s.x0_,s.y0_);h={x:(b.x-r.x)/f,y:(b.y-r.y)/l},f/=u*o,l/=a*o;var x=e.max(f,l);p=2*s.r0_/x,d=2*s.r1_/x-p}var T=s.colors_;T.sort(function(e,t){return e.offset-t.offset});var N=T.length,C=T[0].color,k=T[N-1].color,L=T[0].alpha*t.globalAlpha,A=T[N-1].alpha*t.globalAlpha,O=[];for(var _=0;_')}else if(s instanceof J){if(f&&l){var P=-r.x,H=-r.y;n.push("')}}else{var B=M(t.fillStyle),j=B.color,F=B.alpha*t.globalAlpha;n.push('')}}function W(e,t,n){var r=e.m_;return{x:o*(t*r[0][0]+n*r[1][0]+r[2][0])-u,y:o*(t*r[0][1]+n*r[1][1]+r[2][1])-u}}function X(e){return isFinite(e[0][0])&&isFinite(e[0][1])&&isFinite(e[1][0])&&isFinite(e[1][1])&&isFinite(e[2][0])&&isFinite(e[2][1])}function V(e,t,n){if(!X(t))return;e.m_=t;if(n){var r=t[0][0]*t[1][1]-t[0][1]*t[1][0];e.lineScale_=s(i(r))}}function $(e){this.type_=e,this.x0_=0,this.y0_=0,this.r0_=0,this.x1_=0,this.y1_=0,this.r1_=0,this.colors_=[]}function J(e,t){Q(e);switch(t){case"repeat":case null:case"":this.repetition_="repeat";break;case"repeat-x":case"repeat-y":case"no-repeat":this.repetition_=t;break;default:K("SYNTAX_ERR")}this.src_=e.src,this.width_=e.width,this.height_=e.height}function K(e){throw new G(e)}function Q(e){(!e||e.nodeType!=1||e.tagName!="IMG")&&K("TYPE_MISMATCH_ERR"),e.readyState!="complete"&&K("INVALID_STATE_ERR")}function G(e){this.code=this[e],this.message=e+": DOM Exception "+this.code}var e=Math,t=e.round,n=e.sin,r=e.cos,i=e.abs,s=e.sqrt,o=10,u=o/2,a=+navigator.userAgent.match(/MSIE ([\d.]+)?/)[1],l=Array.prototype.slice;d(document);var v={init:function(e){var t=e||document;t.createElement("canvas"),t.attachEvent("onreadystatechange",c(this.init_,this,t))},init_:function(e){var t=e.getElementsByTagName("canvas");for(var n=0;n'),(f||l)&&w.push('
'),w.push('
'),(f||l)&&w.push("
"),w.push("
"),this.element_.insertAdjacentHTML("BeforeEnd",w.join(""))},q.stroke=function(e){var n=[],r=!1,i=10,s=10;n.push("f.x)f.x=c.x;if(a.y==null||c.yf.y)f.y=c.y}}n.push(' ">'),e?z(this,n,a,f):U(this,n),n.push(""),this.element_.insertAdjacentHTML("beforeEnd",n.join(""))},q.fill=function(){this.stroke(!0)},q.closePath=function(){this.currentPath_.push({type:"close"})},q.save=function(){var e={};x(this,e),this.aStack_.push(e),this.mStack_.push(this.m_),this.m_=S(E(),this.m_)},q.restore=function(){this.aStack_.length&&(x(this.aStack_.pop(),this),this.m_=this.mStack_.pop())},q.translate=function(e,t){var n=[[1,0,0],[0,1,0],[e,t,1]];V(this,S(n,this.m_),!1)},q.rotate=function(e){var t=r(e),i=n(e),s=[[t,i,0],[-i,t,0],[0,0,1]];V(this,S(s,this.m_),!1)},q.scale=function(e,t){this.arcScaleX_*=e,this.arcScaleY_*=t;var n=[[e,0,0],[0,t,0],[0,0,1]];V(this,S(n,this.m_),!0)},q.transform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,S(o,this.m_),!0)},q.setTransform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,o,!0)},q.drawText_=function(e,n,r,i,s){var u=this.m_,a=1e3,f=0,l=a,c={x:0,y:0},p=[],d=H(P(this.font),this.element_),v=B(d),m=this.element_.currentStyle,g=this.textAlign.toLowerCase();switch(g){case"left":case"center":case"right":break;case"end":g=m.direction=="ltr"?"right":"left";break;case"start":g=m.direction=="rtl"?"right":"left";break;default:g="left"}switch(this.textBaseline){case"hanging":case"top":c.y=d.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":c.y=-d.size/2.25}switch(g){case"right":f=a,l=.05;break;case"center":f=l=a/2}var y=W(this,n+c.x,r+c.y);p.push(''),s?U(this,p):z(this,p,{x:-f,y:0},{x:l,y:d.size});var b=u[0][0].toFixed(3)+","+u[1][0].toFixed(3)+","+u[0][1].toFixed(3)+","+u[1][1].toFixed(3)+",0,0",w=t(y.x/o)+","+t(y.y/o);p.push('','',''),this.element_.insertAdjacentHTML("beforeEnd",p.join(""))},q.fillText=function(e,t,n,r){this.drawText_(e,t,n,r,!1)},q.strokeText=function(e,t,n,r){this.drawText_(e,t,n,r,!0)},q.measureText=function(e){if(!this.textMeasureEl_){var t='';this.element_.insertAdjacentHTML("beforeEnd",t),this.textMeasureEl_=this.element_.lastChild}var n=this.element_.ownerDocument;return this.textMeasureEl_.innerHTML="",this.textMeasureEl_.style.font=this.font,this.textMeasureEl_.appendChild(n.createTextNode(e)),{width:this.textMeasureEl_.offsetWidth}},q.clip=function(){},q.arcTo=function(){},q.createPattern=function(e,t){return new J(e,t)},$.prototype.addColorStop=function(e,t){t=M(t),this.colors_.push({offset:e,color:t.color,alpha:t.alpha})};var Y=G.prototype=new Error;Y.INDEX_SIZE_ERR=1,Y.DOMSTRING_SIZE_ERR=2,Y.HIERARCHY_REQUEST_ERR=3,Y.WRONG_DOCUMENT_ERR=4,Y.INVALID_CHARACTER_ERR=5,Y.NO_DATA_ALLOWED_ERR=6,Y.NO_MODIFICATION_ALLOWED_ERR=7,Y.NOT_FOUND_ERR=8,Y.NOT_SUPPORTED_ERR=9,Y.INUSE_ATTRIBUTE_ERR=10,Y.INVALID_STATE_ERR=11,Y.SYNTAX_ERR=12,Y.INVALID_MODIFICATION_ERR=13,Y.NAMESPACE_ERR=14,Y.INVALID_ACCESS_ERR=15,Y.VALIDATION_ERR=16,Y.TYPE_MISMATCH_ERR=17,G_vmlCanvasManager=v,CanvasRenderingContext2D=I,CanvasGradient=$,CanvasPattern=J,DOMException=G}(),G_vmlCanvasManager}),r("zrender/tool/util",["require","../lib/excanvas"],function(e){function n(e){if(typeof e=="object"&&e!==null){var r=e;if(e instanceof Array){r=[];for(var i=0,s=e.length;if&&(f=e+c+n,u.width=f,r=!0),t+h>l&&(l=t+h+n,u.height=l,r=!0),e<-c&&(c=Math.ceil(-e/n)*n,f+=c,u.width=f,r=!0),t<-h&&(h=Math.ceil(-t/n)*n,l+=h,u.height=l,r=!0),r&&a.translate(c,h)}function v(){return{x:c,y:h}}function m(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n3&&(t=Array.prototype.slice.call(t,1));if(this._handlers[e]){var r=this._handlers[e],i=r.length;for(var s=0;s4&&(t=Array.prototype.slice.call(t,1,t.length-1));var r=t[t.length-1];if(this._handlers[e]){var i=this._handlers[e],s=i.length;for(var o=0;o1)for(var e in arguments)console.log(arguments[e])}}),r("zrender/tool/guid",[],function(){var e=2311;return function(){return"zrender__"+e++}}),r("zrender/Handler",["require","./config","./tool/env","./tool/event","./tool/util"],function(e){function a(e,t){return function(n){return e.call(t,n)}}function f(e){var t=o.length;while(t--){var n=o[t];e["_"+n+"Handler"]=a(u[n],e)}}function l(e,t,i){r.Dispatcher.call(this),this.root=e,this.storage=t,this.painter=i,this._lastX=this._lastY=this._mouseX=this._mouseY=0,this._findHover=a(h,this),this._domHover=i.getDomHover(),f(this),window.addEventListener?(window.addEventListener("resize",this._resizeHandler),n.os.tablet||n.os.phone?(e.addEventListener("touchstart",this._touchstartHandler),e.addEventListener("touchmove",this._touchmoveHandler),e.addEventListener("touchend",this._touchendHandler)):(e.addEventListener("click",this._clickHandler),e.addEventListener("mousewheel",this._mousewheelHandler),e.addEventListener("mousemove",this._mousemoveHandler),e.addEventListener("mousedown",this._mousedownHandler),e.addEventListener("mouseup",this._mouseupHandler)),e.addEventListener("DOMMouseScroll",this._mousewheelHandler),e.addEventListener("mouseout",this._mouseoutHandler)):(window.attachEvent("onresize",this._resizeHandler),e.attachEvent("onclick",this._clickHandler),e.attachEvent("onmousewheel",this._mousewheelHandler),e.attachEvent("onmousemove",this._mousemoveHandler),e.attachEvent("onmouseout",this._mouseoutHandler),e.attachEvent("onmousedown",this._mousedownHandler),e.attachEvent("onmouseup",this._mouseupHandler))}function h(e){if(this._draggingTarget&&this._draggingTarget.id==e.id||e.isSilent())return!1;var t=this._event;if(e.isCover(this._mouseX,this._mouseY)){e.hoverable&&this.storage.addHover(e);var n=e.parent;while(n){if(n.clipShape&&!n.clipShape.isCover(this._mouseX,this._mouseY))return!1;n=n.parent}return this._lastHover!=e&&(this._processOutShape(t),this._processDragLeave(t),this._lastHover=e,this._processDragEnter(t)),this._processOverShape(t),this._processDragOver(t),this._hasfound=1,!0}return!1}var t=e("./config"),n=e("./tool/env"),r=e("./tool/event"),i=e("./tool/util"),s=t.EVENT,o=["resize","click","mousewheel","mousemove","mouseout","mouseup","mousedown","touchstart","touchend","touchmove"],u={resize:function(e){e=e||window.event,this._lastHover=null,this._isMouseDown=0,this.dispatch(s.RESIZE,e)},click:function(e){e=this._zrenderEventFixed(e);var t=this._lastHover;(t&&t.clickable||!t)&&this._dispatchAgency(t,s.CLICK,e),this._mousemoveHandler(e)},mousewheel:function(e){e=this._zrenderEventFixed(e),this._dispatchAgency(this._lastHover,s.MOUSEWHEEL,e),this._mousemoveHandler(e)},mousemove:function(e){if(this.painter.isLoading())return;e=this._zrenderEventFixed(e),this._lastX=this._mouseX,this._lastY=this._mouseY,this._mouseX=r.getX(e),this._mouseY=r.getY(e),this._processDragStart(e),this._hasfound=0,this._event=e,this.storage.iterShape(this._findHover,{normal:"down"});if(!this._hasfound){if(!this._draggingTarget||this._lastHover&&this._lastHover!=this._draggingTarget)this._processOutShape(e),this._processDragLeave(e);this._lastHover=null,this.storage.delHover(),this.painter.clearHover()}this._draggingTarget&&(this.storage.drift(this._draggingTarget.id,this._mouseX-this._lastX,this._mouseY-this._lastY),this.storage.addHover(this._draggingTarget));var t="default";this._draggingTarget||this._hasfound&&this._lastHover.draggable?t="move":this._hasfound&&this._lastHover.clickable&&(t="pointer"),this.root.style.cursor=t,this._dispatchAgency(this._lastHover,s.MOUSEMOVE,e),(this._draggingTarget||this._hasfound||this.storage.hasHoverShape())&&this.painter.refreshHover()},mouseout:function(e){e=this._zrenderEventFixed(e);var t=e.toElement||e.relatedTarget;if(t!=this.root)while(t&&t.nodeType!=9){if(t==this.root){this._mousemoveHandler(e);return}t=t.parentNode}e.zrenderX=this._lastX,e.zrenderY=this._lastY,this.root.style.cursor="default",this._isMouseDown=0,this._processOutShape(e),this._processDrop(e),this._processDragEnd(e),this.painter.isLoading()||this.painter.refreshHover(),this.dispatch(s.GLOBALOUT,e)},mousedown:function(e){if(this._lastDownButton==2){this._lastDownButton=e.button,this._mouseDownTarget=null;return}this._lastMouseDownMoment=new Date,e=this._zrenderEventFixed(e),this._isMouseDown=1,this._mouseDownTarget=this._lastHover,this._dispatchAgency(this._lastHover,s.MOUSEDOWN,e),this._lastDownButton=e.button},mouseup:function(e){e=this._zrenderEventFixed(e),this.root.style.cursor="default",this._isMouseDown=0,this._mouseDownTarget=null,this._dispatchAgency(this._lastHover,s.MOUSEUP,e),this._processDrop(e),this._processDragEnd(e)},touchstart:function(e){e=this._zrenderEventFixed(e,!0),this._lastTouchMoment=new Date,this._mobildFindFixed(e),this._mousedownHandler(e)},touchmove:function(e){e=this._zrenderEventFixed(e,!0),this._mousemoveHandler(e),this._isDragging&&r.stop(e)},touchend:function(e){e=this._zrenderEventFixed(e,!0),this._mouseupHandler(e),new Date-this._lastTouchMoment1e-4||Math.abs(this.position[0])>1e-4||Math.abs(this.position[1])>1e-4||Math.abs(this.scale[0]-1)>1e-4||Math.abs(this.scale[1]-1)>1e-4},updateTransform:function(){this.updateNeedTransform(),this.parent?this.needTransform=this.needLocalTransform||this.parent.needTransform:this.needTransform=this.needLocalTransform;if(!this.needTransform)return;var e=this.transform||t.create();t.identity(e);if(this.needLocalTransform){if(this.scale&&(this.scale[0]!==1||this.scale[1]!==1)){n[0]=-this.scale[2]||0,n[1]=-this.scale[3]||0,(n[0]||n[1])&&t.translate(e,e,n),t.scale(e,e,this.scale);if(n[0]||n[1])n[0]=-n[0],n[1]=-n[1],t.translate(e,e,n)}if(this.rotation)if(this.rotation instanceof Array){if(this.rotation[0]!==0){n[0]=-this.rotation[1]||0,n[1]=-this.rotation[2]||0,(n[0]||n[1])&&t.translate(e,e,n),t.rotate(e,e,this.rotation[0]);if(n[0]||n[1])n[0]=-n[0],n[1]=-n[1],t.translate(e,e,n)}}else this.rotation!==0&&t.rotate(e,e,this.rotation);this.position&&(this.position[0]!==0||this.position[1]!==0)&&t.translate(e,e,this.position)}this.transform=e,this.parent&&this.parent.needTransform&&(this.needLocalTransform?t.mul(this.transform,this.parent.transform,this.transform):t.copy(this.transform,this.parent.transform))},setTransform:function(e){if(this.needTransform){var t=this.transform;e.transform(t[0],t[1],t[2],t[3],t[4],t[5])}}},r}),r("zrender/tool/color",["require","../tool/util"],function(e){function f(e){r=e}function l(){r=i}function c(e,t){return e|=0,t=t||r,t[e%t.length]}function h(e){s=e}function p(){o=s}function d(){return s}function v(e,r,i,s,o,u,a){n||(n=t.getContext());var f=n.createRadialGradient(e,r,i,s,o,u);for(var l=0,c=a.length;l1)for(var i=0,s=r-1;i1?Math.ceil(e):e});if(t.indexOf("hex")>-1)return"#"+((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1);if(t.indexOf("hs")>-1){var n=q(e.slice(1,3),function(e){return e+"%"});e[1]=n[0],e[2]=n[1]}return t.indexOf("a")>-1?(e.length===3&&e.push(1),e[3]=R(e[3],[0,1]),t+"("+e.slice(0,4).join(",")+")"):t+"("+e.slice(0,3).join(",")+")"}}function w(e){e=_(e),e.indexOf("rgba")<0&&(e=S(e));var t=[],n=0;return e.replace(/[\d.]+/g,function(e){n<3?e|=0:e=+e,t[n++]=e}),t}function E(e,t){var n=F(e),r=n[3];return typeof r=="undefined"&&(r=1),e.indexOf("hsb")>-1?n=U(n):e.indexOf("hsl")>-1&&(n=z(n)),t.indexOf("hsb")>-1||t.indexOf("hsv")>-1?n=X(n):t.indexOf("hsl")>-1&&(n=V(n)),n[3]=r,b(n,t)}function S(e){return E(e,"rgba")}function x(e){return E(e,"rgb")}function T(e){return E(e,"hex")}function N(e){return E(e,"hsva")}function C(e){return E(e,"hsv")}function k(e){return E(e,"hsba")}function L(e){return E(e,"hsb")}function A(e){return E(e,"hsla")}function O(e){return E(e,"hsl")}function M(e){for(var t in a)if(T(a[t])===T(e))return t;return null}function _(e){return String(e).replace(/\s+/g,"")}function D(e){a[e]&&(e=a[e]),e=_(e),e=e.replace(/hsv/i,"hsb");if(/^#[\da-f]{3}$/i.test(e)){e=parseInt(e.slice(1),16);var t=(e&3840)<<8,n=(e&240)<<4,r=e&15;e="#"+((1<<24)+(t<<4)+t+(n<<4)+n+(r<<4)+r).toString(16).slice(1)}return e}function P(e,t){var n=t>0?1:-1;typeof t=="undefined"&&(t=0),t=Math.abs(t)>1?1:Math.abs(t),e=x(e);var r=F(e);for(var i=0;i<3;i++)n===1?r[i]=r[i]*(1-t)|0:r[i]=(255-r[i])*t+r[i]|0;return"rgb("+r.join(",")+")"}function H(e){var t=F(S(e));return t=q(t,function(e){return 255-e}),b(t,"rgb")}function B(e,t,n){typeof n=="undefined"&&(n=.5),n=1-R(n,[0,1]);var r=n*2-1,i=F(S(e)),s=F(S(t)),o=i[3]-s[3],u=((r*o===-1?r:(r+o)/(1+r*o))+1)/2,a=1-u,f=[];for(var l=0;l<3;l++)f[l]=i[l]*u+s[l]*a;var c=i[3]*n+s[3]*(1-n);return c=Math.max(0,Math.min(1,c)),i[3]===1&&s[3]===1?b(f,"rgb"):(f[3]=c,b(f,"rgba"))}function j(){return"#"+Math.random().toString(16).slice(2,8)}function F(e){e=D(e);var t=e.match(u);if(t===null)throw new Error("The color format error");var n,r,i=[],s;if(t[2])n=t[2].replace("#","").split(""),s=[n[0]+n[1],n[2]+n[3],n[4]+n[5]],i=q(s,function(e){return R(parseInt(e,16),[0,255])});else if(t[4]){var o=t[4].split(",");r=o[3],s=o.slice(0,3),i=q(s,function(e){return e=Math.floor(e.indexOf("%")>0?parseInt(e,0)*2.55:e),R(e,[0,255])}),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}else if(t[5]||t[6]){var a=(t[5]||t[6]).split(","),f=parseInt(a[0],0)/360,l=a[1],c=a[2];r=a[3],i=q([l,c],function(e){return R(parseFloat(e)/100,[0,1])}),i.unshift(f),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}return i}function I(e,t){t===null&&(t=1);var n=F(S(e));return n[3]=R(Number(t).toFixed(4),[0,1]),b(n,"rgba")}function q(e,t){if(typeof t!="function")throw new TypeError;var n=e?e.length:0;for(var r=0;r=t[1]&&(e=t[1]),e}function U(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u=t*6;u===6&&(u=0);var a=u|0,f=r*(1-n),l=r*(1-n*(u-a)),c=r*(1-n*(1-(u-a))),h=0,p=0,d=0;a===0?(h=r,p=c,d=f):a===1?(h=l,p=r,d=f):a===2?(h=f,p=r,d=c):a===3?(h=f,p=l,d=r):a===4?(h=c,p=f,d=r):(h=r,p=f,d=l),i=h*255,s=p*255,o=d*255}return[i,s,o]}function z(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u;r<.5?u=r*(1+n):u=r+n-n*r;var a=2*r-u;i=255*W(a,u,t+1/3),s=255*W(a,u,t),o=255*W(a,u,t-1/3)}return[i,s,o]}function W(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function X(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=s,a,f;if(o===0)a=0,f=0;else{f=o/s;var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}function V(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=(s+i)/2,a,f;if(o===0)a=0,f=0;else{u<.5?f=o/(s+i):f=o/(2-s-i);var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}var t=e("../tool/util"),n,r=["#ff9277"," #dddd00"," #ffc877"," #bbe3ff"," #d5ffbb","#bbbbff"," #ddb000"," #b0dd00"," #e2bbff"," #ffbbe3","#ff7777"," #ff9900"," #83dd00"," #77e3ff"," #778fff","#c877ff"," #ff77ab"," #ff6600"," #aa8800"," #77c7ff","#ad77ff"," #ff77ff"," #dd0083"," #777700"," #00aa00","#0088aa"," #8400dd"," #aa0088"," #dd0000"," #772e00"],i=r,s="rgba(255,255,0,0.5)",o=s,u=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,a={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#789",lightslategrey:"#789",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#f0f",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"};return{customPalette:f,resetPalette:l,getColor:c,getHighlightColor:d,customHighlight:h,resetHighlight:p,getRadialGradient:v,getLinearGradient:m,getGradientColors:y,getStepColors:g,reverse:H,mix:B,lift:P,trim:_,random:j,toRGB:x,toRGBA:S,toHex:T,toHSL:O,toHSLA:A,toHSB:L,toHSBA:k,toHSV:C,toHSVA:N,toName:M,toColor:b,toArray:w,alpha:I,getData:F}}),r("zrender/shape/Base",["require","../tool/matrix","../tool/guid","../tool/util","./mixin/Transformable","../tool/event","../tool/area","../tool/area","../tool/color","../tool/area"],function(e){function o(t,n,r,i,s,o,a){s&&(t.font=s),t.textAlign=o,t.textBaseline=a;var f=u(n,r,i,s,o,a);n=(n+"").split("\n");var l=e("../tool/area").getTextHeight("国",s);switch(a){case"top":i=f.y;break;case"bottom":i=f.y+l;break;default:i=f.y+l/2}for(var c=0,h=n.length;c0&&e.stroke();break;default:e.fill()}this.drawText(e,n,this.style),e.restore()};var f=[["color","fillStyle"],["strokeColor","strokeStyle"],["opacity","globalAlpha"],["lineCap","lineCap"],["lineJoin","lineJoin"],["miterLimit","miterLimit"],["lineWidth","lineWidth"],["shadowBlur","shadowBlur"],["shadowColor","shadowColor"],["shadowOffsetX","shadowOffsetX"],["shadowOffsetY","shadowOffsetY"]];return a.prototype.setContext=function(e,t){for(var n=0,r=f.length;n=i.x&&t<=i.x+i.width&&n>=i.y&&n<=i.y+i.height?e("../tool/area").isInside(this,this.style,t,n):!1},a.prototype.drawText=function(e,t,n){if(typeof t.text=="undefined"||t.text===!1)return;var r=t.textColor||t.color||t.strokeColor;e.fillStyle=r;var i=10,s,u,a,f,l=t.textPosition||this.textPosition||"top";switch(l){case"inside":case"top":case"bottom":case"left":case"right":if(this.getRect){var c=(n||t).__rect||this.getRect(n||t);switch(l){case"inside":a=c.x+c.width/2,f=c.y+c.height/2,s="center",u="middle",t.brushType!="stroke"&&r==t.color&&(e.fillStyle="#fff");break;case"left":a=c.x-i,f=c.y+c.height/2,s="end",u="middle";break;case"right":a=c.x+c.width+i,f=c.y+c.height/2,s="start",u="middle";break;case"top":a=c.x+c.width/2,f=c.y-i,s="center",u="bottom";break;case"bottom":a=c.x+c.width/2,f=c.y+c.height+i,s="center",u="top"}}break;case"start":case"end":var h,p,d,v;if(typeof t.pointList!="undefined"){var m=t.pointList;if(m.length<2)return;var g=m.length;switch(l){case"start":h=m[0][0],p=m[1][0],d=m[0][1],v=m[1][1];break;case"end":h=m[g-2][0],p=m[g-1][0],d=m[g-2][1],v=m[g-1][1]}}else h=t.xStart||0,p=t.xEnd||0,d=t.yStart||0,v=t.yEnd||0;switch(l){case"start":s=h0&&l[0]===""&&l.shift();for(var c=0;c0){if(isNaN(l[0]))break;var h=null,p=[],d,v,m,g,y,b,w,E,S=o,x=u;switch(f){case"l":o+=l.shift(),u+=l.shift(),h="L",p.push(o,u);break;case"L":o=l.shift(),u=l.shift(),p.push(o,u);break;case"m":o+=l.shift(),u+=l.shift(),h="M",p.push(o,u),f="l";break;case"M":o=l.shift(),u=l.shift(),h="M",p.push(o,u),f="L";break;case"h":o+=l.shift(),h="L",p.push(o,u);break;case"H":o=l.shift(),h="L",p.push(o,u);break;case"v":u+=l.shift(),h="L",p.push(o,u);break;case"V":u=l.shift(),h="L",p.push(o,u);break;case"C":p.push(l.shift(),l.shift(),l.shift(),l.shift()),o=l.shift(),u=l.shift(),p.push(o,u);break;case"c":p.push(o+l.shift(),u+l.shift(),o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="C",p.push(o,u);break;case"S":d=o,v=u,m=s[s.length-1],m.command==="C"&&(d=o+(o-m.points[2]),v=u+(u-m.points[3])),p.push(d,v,l.shift(),l.shift()),o=l.shift(),u=l.shift(),h="C",p.push(o,u);break;case"s":d=o,v=u,m=s[s.length-1],m.command==="C"&&(d=o+(o-m.points[2]),v=u+(u-m.points[3])),p.push(d,v,o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="C",p.push(o,u);break;case"Q":p.push(l.shift(),l.shift()),o=l.shift(),u=l.shift(),p.push(o,u);break;case"q":p.push(o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="Q",p.push(o,u);break;case"T":d=o,v=u,m=s[s.length-1],m.command==="Q"&&(d=o+(o-m.points[0]),v=u+(u-m.points[1])),o=l.shift(),u=l.shift(),h="Q",p.push(d,v,o,u);break;case"t":d=o,v=u,m=s[s.length-1],m.command==="Q"&&(d=o+(o-m.points[0]),v=u+(u-m.points[1])),o+=l.shift(),u+=l.shift(),h="Q",p.push(d,v,o,u);break;case"A":g=l.shift(),y=l.shift(),b=l.shift(),w=l.shift(),E=l.shift(),S=o,x=u,o=l.shift(),u=l.shift(),h="A",p=this._convertPoint(S,x,o,u,w,E,g,y,b);break;case"a":g=l.shift(),y=l.shift(),b=l.shift(),w=l.shift(),E=l.shift(),S=o,x=u,o+=l.shift(),u+=l.shift(),h="A",p=this._convertPoint(S,x,o,u,w,E,g,y,b)}s.push({command:h||f,points:p})}(f==="z"||f==="Z")&&s.push({command:"z",points:[]})}return s},_convertPoint:function(e,t,n,r,i,s,o,u,a){var f=a*(Math.PI/180),l=Math.cos(f)*(e-n)/2+Math.sin(f)*(t-r)/2,c=-1*Math.sin(f)*(e-n)/2+Math.cos(f)*(t-r)/2,h=l*l/(o*o)+c*c/(u*u);h>1&&(o*=Math.sqrt(h),u*=Math.sqrt(h));var p=Math.sqrt((o*o*u*u-o*o*c*c-u*u*l*l)/(o*o*c*c+u*u*l*l));i===s&&(p*=-1),isNaN(p)&&(p=0);var d=p*o*c/u,v=p*-u*l/o,m=(e+n)/2+Math.cos(f)*d-Math.sin(f)*v,g=(t+r)/2+Math.sin(f)*d+Math.cos(f)*v,y=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},b=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(y(e)*y(t))},w=function(e,t){return(e[0]*t[1]=1&&(T=0),s===0&&T>0&&(T-=2*Math.PI),s===1&&T<0&&(T+=2*Math.PI),[m,g,o,u,E,T,f,s]},buildPath:function(e,t){var n=t.path,r=this.pathArray||this._parsePathData(n),i=t.x||0,s=t.y||0,o,u=t.pointList=[],a=[];for(var f=0,l=r.length;f0&&u.push(a),a=[]),o=r[f].points;for(var c=0,h=o.length;c0&&u.push(a);var p;for(var f=0,l=r.length;fg?m:g,x=m>g?1:m/g,T=m>g?g/m:1;e.translate(d,v),e.rotate(w),e.scale(x,T),e.arc(0,0,S,y,y+b,1-E),e.scale(1/x,1/T),e.rotate(-w),e.translate(-d,-v);break;case"z":e.closePath()}}return},getRect:function(e){if(e.__rect)return e.__rect;var t;e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0;var n=Number.MAX_VALUE,r=Number.MIN_VALUE,i=Number.MAX_VALUE,s=Number.MIN_VALUE,o=e.x||0,u=e.y||0,a=this.pathArray||this._parsePathData(e.path);for(var f=0;fr&&(r=l[c]+o)):(l[c]+us&&(s=l[c]+u))}var h;return n===Number.MAX_VALUE||r===Number.MIN_VALUE||i===Number.MAX_VALUE||s===Number.MIN_VALUE?h={x:0,y:0,width:0,height:0}:h={x:Math.round(n-t/2),y:Math.round(i-t/2),width:r-n+t,height:s-i+t},e.__rect=h,h}},e("../tool/util").inherits(n,t),n}),r("zrender/tool/area",["require","../tool/util","../shape/Path"],function(e){function a(e,r,i,s){if(!r||!e)return!1;var o=e.type;n=n||t.getContext();if(!g(r.__rect||e.getRect(r),i,s))return!1;var u=f(o,r,i,s);if(typeof u!="undefined")return u;if(o!="bezier-curve"&&e.buildPath&&n.isPointInPath)return l(e,n,r,i,s);if(n.getImageData)return c(e,r,i,s);switch(o){case"heart":case"droplet":case"ellipse":return!0;case"trochoid":var a=r.location=="out"?r.r1+r.r2+r.d:r.r1-r.r2+r.d;return y(r,i,s,a);case"rose":return y(r,i,s,r.maxr);default:return!1}}function f(e,t,n,r){switch(e){case"line":return d(t,n,r);case"broken-line":return v(t,n,r);case"text":return!0;case"ring":return m(t,n,r);case"rectangle":return!0;case"circle":return y(t,n,r,t.r);case"sector":return b(t,n,r);case"path":return E(t,n,r);case"polygon":case"star":case"isogon":return w(t,n,r);case"image":return!0}}function l(e,t,n,r,i){return t.beginPath(),e.buildPath(t,n),t.closePath(),t.isPointInPath(r,i)}function c(e,n,r,i){var s=n.__rect||e.getRect(n),o=t.getPixelContext(),u=t.getPixelOffset();return t.adjustCanvasSize(r,i),o.clearRect(s.x,s.y,s.width,s.height),o.beginPath(),e.brush(o,{style:n}),o.closePath(),h(o,r+u.x,i+u.y)}function h(e,t,n,r){var i;typeof r!="undefined"?(r=(r||1)>>1,i=e.getImageData(t-r,n-r,r+r,r+r).data):i=e.getImageData(t,n,1,1).data;var s=i.length;while(s--)if(i[s]!==0)return!0;return!1}function p(e,t,n,r){return!a(e,t,n,r)}function d(e,t,n){var r=e.xStart,i=e.yStart,s=e.xEnd,o=e.yEnd,u=Math.max(e.lineWidth,5),a=0,f=r,l,c;rc||np)return!1;if(r===s)return Math.abs(t-r)<=u/2;a=(i-o)/(r-s),f=(r*o-s*i)/(r-s);var d=(a*t-n+f)*(a*t-n+f)/(a*a+1);return d<=u/2*u/2}function v(e,t,n){var r=e.pointList,i={xStart:0,yStart:0,xEnd:0,yEnd:0,lineWidth:0};for(var s=0,o=r.length-1;s=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function y(e,t,n,r){return(t-e.x)*(t-e.x)+(n-e.y)*(n-e.y)0&&y({x:e.x,y:e.y},t,n,e.r0))return!1;if(Math.abs(e.endAngle-e.startAngle)>=360)return!0;var r=(360-Math.atan2(n-e.y,t-e.x)/Math.PI*180)%360,i=(360+e.endAngle)%360,s=(360+e.startAngle)%360;return i>s?r>=s&&r<=i:!(r>=i&&r<=s)}function w(e,t,n){var r,i,s=e.pointList,o=s.length,u=!1,a=!0,f;for(r=0;rs[i][1]?--n:++n;break}}else if(s[r][1]==s[i][1]&&n==s[r][1]&&(s[r][0]u&&(s=0,r={}),a}function x(e,r){var s=e+":"+r;if(i[s])return i[s];n=n||t.getContext(),n.save(),r&&(n.font=r),e=(e+"").split("\n");var a=(n.measureText("国").width+2)*e.length;return n.restore(),i[s]=a,++o>u&&(o=0,i={}),a}var t=e("../tool/util"),n,r={},i={},s=0,o=0,u=2e4;return{isInside:a,isOutside:p,getTextWidth:S,getTextHeight:x}}),r("zrender/shape/Text",["require","../tool/area","./Base","../tool/util"],function(e){function r(e){n.call(this,e)}var t=e("../tool/area"),n=e("./Base");return r.prototype={type:"text",brush:function(e,n){var r=this.style;n&&(r=this.getHighlightStyle(r,this.highlightStyle||{}));if(typeof r.text=="undefined"||r.text===!1)return;e.save(),this.setContext(e,r),this.setTransform(e),r.textFont&&(e.font=r.textFont),e.textAlign=r.textAlign||"start",e.textBaseline=r.textBaseline||"middle";var i=(r.text+"").split("\n"),s=t.getTextHeight("国",r.textFont),o=this.getRect(r),u=r.x,a;r.textBaseline=="top"?a=o.y:r.textBaseline=="bottom"?a=o.y+s:a=o.y+s/2;for(var f=0,l=i.length;f=t[1]&&(e=t[1]),e},o}),r("zrender/shape/Image",["require","./Base","../tool/util"],function(e){function s(e){i.call(this,e)}var t={},n=[],r,i=e("./Base");return s.prototype={type:"image",brush:function(e,i,s){var o=this.style||{};i&&(o=this.getHighlightStyle(o,this.highlightStyle||{}));var u=o.image,a=this;if(typeof u=="string"){var f=u;t[f]?u=t[f]:(u=new Image,u.onload=function(){u.onload=null,clearTimeout(r),n.push(a),r=setTimeout(function(){s&&s(n),n=[]},10)},t[f]=u,u.src=f)}if(u){if(u.nodeName.toUpperCase()=="IMG")if(window.ActiveXObject){if(u.readyState!="complete")return}else if(!u.complete)return;var l=o.width||u.width,c=o.height||u.height,h=o.x,p=o.y;if(!u.width||!u.height)return;e.save(),this.setContext(e,o),this.setTransform(e);if(o.sWidth&&o.sHeight){var d=o.sx||0,v=o.sy||0;e.drawImage(u,d,v,o.sWidth,o.sHeight,h,p,l,c)}else if(o.sx&&o.sy){var d=o.sx,v=o.sy,m=l-d,g=c-v;e.drawImage(u,d,v,m,g,h,p,l,c)}else e.drawImage(u,h,p,l,c);o.width=l,o.height=c,this.style.width=l,this.style.height=c,this.drawText(e,o,this.style),e.restore()}},buildPath:function(e,t){e.rect(t.x,t.y,t.width,t.height);return},getRect:function(e){return{x:e.x,y:e.y,width:e.width,height:e.height}}},e("../tool/util").inherits(s,i),s}),r("zrender/Painter",["require","./config","./tool/util","./tool/log","./tool/matrix","./loadingEffect/Base","./shape/Image"],function(e){function a(){return!1}function f(){}function l(e,t){this.root=e,this.storage=t,e.innerHTML="",this._width=this._getWidth(),this._height=this._getHeight();var n=document.createElement("div");this._domRoot=n,n.style.position="relative",n.style.overflow="hidden",n.style.width=this._width+"px",n.style.height=this._height+"px",e.appendChild(n),this._layers={},this._layerConfig={},this._loadingEffect=new s({}),this.shapeToImage=this._createShapeToImageProcessor(),this._bgDom=c("bg","div",this),n.appendChild(this._bgDom);var r=new h("_zrender_hover_",this);this._layers.hover=r,n.appendChild(r.dom),r.initContext(),r.onselectstart=a;var i=this;this.updatePainter=function(e,t){i.update(e,t)}}function c(e,t,n){var r=document.createElement(t),i=n._width,s=n._height;return r.style.position="absolute",r.style.left=0,r.style.top=0,r.style.width=i+"px",r.style.height=s+"px",r.setAttribute("width",i*o),r.setAttribute("height",s*o),r.setAttribute("data-zr-dom-id",e),r}function h(e,t){this.dom=c(e,"canvas",t),u&&u.initElement(this.dom),this.domBack=null,this.ctxBack=null,this.painter=t,this.unusedCount=0,this.config=null,this.dirty=!0,this.elCount=0}var t=e("./config"),n=e("./tool/util"),r=e("./tool/log"),i=e("./tool/matrix"),s=e("./loadingEffect/Base"),o=window.devicePixelRatio||1;o=Math.max(o,1);var u=window.G_vmlCanvasManager;return l.prototype.render=function(e){return this.isLoading()&&this.hideLoading(),this.refresh(e,!0),this},l.prototype.refresh=function(e,t){var n=this.storage.getShapeList(!0);return this._paintList(n,t),typeof e=="function"&&e(),this},l.prototype._paintList=function(e,n){typeof n=="undefined"&&(n=!1),this._updateLayerStatus(e);var s,o,a;for(var f in this._layers)f!=="hover"&&this._layers[f].unusedCount++;var l=[];for(var c=0,h=e.length;c=500?(delete this._layers[f],g.dom.parentNode.removeChild(g.dom)):g.unusedCount==1&&g.clear()}},l.prototype.getLayer=function(e,t){var n=this._layers[e];if(!n){n=new h(e,this);var r=t?t.dom:this._bgDom;r.nextSibling?r.parentNode.insertBefore(n.dom,r.nextSibling):r.parentNode.appendChild(n.dom),n.initContext(),this._layers[e]=n,n.config=this._layerConfig[e]}return n},l.prototype._updateLayerStatus=function(e){var t=this._layers,n={};for(var r in t)r!=="hover"&&(n[r]=t[r].elCount,t[r].elCount=0);for(var i=0,s=e.length;i0},s.prototype.addRoot=function(e){e instanceof n&&e.addChildrenToStorage(this),this.addToMap(e),this._roots.push(e)},s.prototype.delRoot=function(e){if(typeof e=="undefined"){for(var r=0;r=0&&(this.delFromMap(o.id),this._roots.splice(u,1),o instanceof n&&o.delChildrenFromStorage(this))},s.prototype.addToMap=function(e){return e instanceof n?e._storage=this:e.style.__rect=null,this._elements[e.id]=e,this},s.prototype.get=function(e){return this._elements[e]},s.prototype.delFromMap=function(e){var t=this._elements[e];return t&&(delete this._elements[e],t instanceof n&&(t._storage=null)),this},s.prototype.dispose=function(){this._elements=this._renderList=this._roots=this._hoverElements=null},s}),r("zrender/animation/easing",[],function(){var e={Linear:function(e){return e},QuadraticIn:function(e){return e*e},QuadraticOut:function(e){return e*(2-e)},QuadraticInOut:function(e){return(e*=2)<1?.5*e*e:-0.5*(--e*(e-2)-1)},CubicIn:function(e){return e*e*e},CubicOut:function(e){return--e*e*e+1},CubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},QuarticIn:function(e){return e*e*e*e},QuarticOut:function(e){return 1- --e*e*e*e},QuarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-0.5*((e-=2)*e*e*e-2)},QuinticIn:function(e){return e*e*e*e*e},QuinticOut:function(e){return--e*e*e*e*e+1},QuinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},SinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},SinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},SinusoidalInOut:function(e){return.5*(1-Math.cos(Math.PI*e))},ExponentialIn:function(e){return e===0?0:Math.pow(1024,e-1)},ExponentialOut:function(e){return e===1?1:1-Math.pow(2,-10*e)},ExponentialInOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)},CircularIn:function(e){return 1-Math.sqrt(1-e*e)},CircularOut:function(e){return Math.sqrt(1- --e*e)},CircularInOut:function(e){return(e*=2)<1?-0.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},ElasticIn:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),-(n*Math.pow(2,10*(e-=1))*Math.sin((e-t)*2*Math.PI/r)))},ElasticOut:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*e)*Math.sin((e-t)*2*Math.PI/r)+1)},ElasticInOut:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),(e*=2)<1?-0.5*n*Math.pow(2,10*(e-=1))*Math.sin((e-t)*2*Math.PI/r):n*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*2*Math.PI/r)*.5+1)},BackIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},BackOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},BackInOut:function(e){var t=2.5949095;return(e*=2)<1?.5*e*e*((t+1)*e-t):.5*((e-=2)*e*((t+1)*e+t)+2)},BounceIn:function(t){return 1-e.BounceOut(1-t)},BounceOut:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},BounceInOut:function(t){return t<.5?e.BounceIn(t*2)*.5:e.BounceOut(t*2-1)*.5+.5}};return e}),r("zrender/animation/Clip",["require","./easing"],function(e){function n(e){this._targetPool=e.target||{},this._targetPool instanceof Array||(this._targetPool=[this._targetPool]),this._life=e.life||1e3,this._delay=e.delay||0,this._startTime=(new Date).getTime()+this._delay,this._endTime=this._startTime+this._life*1e3,this.loop=typeof e.loop=="undefined"?!1:e.loop,this.gap=e.gap||0,this.easing=e.easing||"Linear",this.onframe=e.onframe,this.ondestroy=e.ondestroy,this.onrestart=e.onrestart}var t=e("./easing");return n.prototype={step:function(e){var n=(e-this._startTime)/this._life;if(n<0)return;n=Math.min(n,1);var r=typeof this.easing=="string"?t[this.easing]:this.easing,i=typeof r=="function"?r(n):n;return this.fire("frame",i),n==1?this.loop?(this.restart(),"restart"):(this._needsRemove=!0,"destroy"):null},restart:function(){var e=(new Date).getTime(),t=(e-this._startTime)%this._life;this._startTime=(new Date).getTime()-t+this.gap},fire:function(e,t){for(var n=0,r=this._targetPool.length;n=0&&this._clips.splice(t,1)},update:function(){var e=(new Date).getTime(),t=e-this._time,n=this._clips,r=n.length,i=[],s=[];for(var o=0;o=0;N--)if(x[N]<=t)break;N=Math.min(N,g-2)}else{for(N=k;Nt)break;N=Math.min(N-1,g-2)}k=N,L=t;var n=x[N+1]-x[N];if(n===0)return;O=(t-x[N])/n;if(u){_=T[N],M=T[N===0?N:N-1],D=T[N>g-2?g-1:N+1],P=T[N>g-3?g-1:N+2];if(b)p(M,_,D,P,O,O*O,O*O*O,s(e,v),E);else{var a;w?(a=p(M,_,D,P,O,O*O,O*O*O,H,1),a=m(H)):a=d(M,_,D,P,O,O*O,O*O*O),i(e,v,a)}}else if(b)c(T[N],T[N+1],O,s(e,v),E);else{var a;w?(c(T[N],T[N+1],O,H,1),a=m(H)):a=l(T[N],T[N+1],O),i(e,v,a)}for(N=0;N1?"."+e[1]:""))}return{parsePercent:t,parseCenter:n,parseRadius:r,addCommas:i}}),r("echarts/component/base",["require","../config","../util/ecQuery","../util/number","zrender/tool/util","zrender/tool/env"],function(e){function s(e,t,n,r,i){this.ecTheme=e,this.messageCenter=t,this.zr=n,this.option=r,this.series=r.series,this.myChart=i,this.component=i.component,this._zlevelBase=this.getZlevelBase(),this.shapeList=[],this.effectList=[];var s=this;s.hoverConnect=function(e){var t=(e.target||{}).hoverConnect;if(t){var n=10,r;if(t instanceof Array)for(var i=0,o=t.length;i4?a*r(2*i/s)/r(i/s):a/3);var l=i/s,c=-i/2,h=o+a*r(c),p=u+a*n(c);c+=l;var d=t.pointList=[];d.push([h,p]);for(var v=0,m=s*2-1,g;v=r.x-i&&e<=r.x+r.width+i&&t>=r.y-i&&t<=r.y+r.height+i?!0:!1}},t.inherits(C,N),C}),r("zrender/shape/util/dashedLineTo",[],function(){var e=[5,5];return function(t,n,r,i,s,o){if(t.setLineDash){e[0]=e[1]=o,t.setLineDash(e),t.moveTo(n,r),t.lineTo(i,s);return}o=typeof o!="number"?5:o;var u=i-n,a=s-r,f=Math.floor(Math.sqrt(u*u+a*a)/o);u/=f,a/=f;var l=!0;for(var c=0;ci-2?i-1:l+1],v=e[l>i-3?i-1:l+2]);var m=c*c,g=c*m;s.push([n(h[0],p[0],d[0],v[0],c,m,g),n(h[1],p[1],d[1],v[1],c,m,g)])}return s}}),r("zrender/shape/util/smoothBezier",["require","../../tool/vector"],function(e){var t=e("../../tool/vector");return function(e,n,r){var i=[],s=[],o=[],u=[],a,f;for(var l=0,c=e.length;l0&&(n.brushType=="stroke"||n.brushType=="both")&&(r||(e.beginPath(),this.buildPath(e,n),e.closePath()),e.stroke()),this.drawText(e,n,this.style),e.restore();return},buildPath:function(e,t){var s=t.pointList;if(s.length<2)return;if(t.smooth&&t.smooth!=="spline"){var o=r(s,t.smooth,!0);e.moveTo(s[0][0],s[0][1]);var u,a,f,l=s.length;for(var c=0;cn&&(n=s[o][0]),s[o][1]i&&(i=s[o][1]);var a;return e.brushType=="stroke"||e.brushType=="fill"?a=e.lineWidth||1:a=0,e.__rect={x:Math.round(t-a/2),y:Math.round(r-a/2),width:n-t+a,height:i-r+a},e.__rect}},e("../tool/util").inherits(s,t),s}),r("zrender/shape/BrokenLine",["require","./Base","./util/smoothSpline","./util/smoothBezier","./util/dashedLineTo","./Polygon","../tool/util"],function(e){function s(e){this.brushTypeOnly="stroke",this.textPosition="end",t.call(this,e)}var t=e("./Base"),n=e("./util/smoothSpline"),r=e("./util/smoothBezier"),i=e("./util/dashedLineTo");return s.prototype={type:"broken-line",buildPath:function(e,t){var s=t.pointList;if(s.length<2)return;var o=Math.min(t.pointList.length,Math.round(t.pointListLength||t.pointList.length));if(t.smooth&&t.smooth!=="spline"){var u=r(s,t.smooth);e.moveTo(s[0][0],s[0][1]);var a,f,l;for(var c=0;cs?a>u?l=Math.PI*2-l+f:l+=f:a>u?l+=Math.PI-f:l=Math.PI-l-f:s>o?u>a?l=Math.PI*2-l+f:l+=f:u>a?l+=Math.PI-f:l=Math.PI-l-f;var c=Math.PI/8,h=n===0?s:o,p=n===0?u:a,d=[[h+i*Math.cos(l-c),p-i*Math.sin(l-c)],[h+i*.6*Math.cos(l),p-i*.6*Math.sin(l)],[h+i*Math.cos(l+c),p-i*Math.sin(l+c)]];e.moveTo(h,p);for(var v=0,m=d.length;v=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height?this.style.smooth!=="spline"?a.isInside(i,this.style,e,t):a.isInside(o,this.style,e,t):!1}},c.inherits(h,t),h}),r("echarts/util/shape/normalIsCover",[],function(){return function(e,t){var n=this.getTansform(e,t);e=n[0],t=n[1];var r=this.style.__rect;return r||(r=this.style.__rect=this.getRect(this.style)),e>=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height}}),r("echarts/util/shape/Symbol",["require","zrender/shape/Base","zrender/shape/Polygon","zrender/tool/util","./normalIsCover"],function(e){function s(e){t.call(this,e)}var t=e("zrender/shape/Base"),n=e("zrender/shape/Polygon"),r=new n({}),i=e("zrender/tool/util");return s.prototype={type:"symbol",buildPath:function(e,t){var n=t.pointList,r=n.length;if(r===0)return;var i=1e4,s=Math.ceil(r/i),o,u,a=n[0]instanceof Array,f=t.size?t.size:2,l=f,c=f/2,h=Math.PI*2,p,d,v;for(var m=0;mr?r:u;for(var g=o;g0&&e.stroke();break;case"stroke":t.lineWidth>0&&e.stroke();break;default:e.fill()}}},getRect:function(e){return e.__rect||r.getRect(e)},isCover:e("./normalIsCover")},i.inherits(s,t),s}),r("echarts/util/ecData",[],function(){function e(e,t,n,r,i,s,o,u){var a;return typeof r!="undefined"&&(a=r.value==null?r:r.value),e._echartsData={_series:t,_seriesIndex:n,_data:r,_dataIndex:i,_name:s,_value:a,_special:o,_special2:u},e._echartsData}function t(e,t){var n=e._echartsData;if(!t)return n;switch(t){case"series":case"seriesIndex":case"data":case"dataIndex":case"name":case"value":case"special":case"special2":return n&&n["_"+t]}return null}function n(e,t,n){e._echartsData=e._echartsData||{};switch(t){case"series":case"seriesIndex":case"data":case"dataIndex":case"name":case"value":case"special":case"special2":e._echartsData["_"+t]=n}}function r(e,t){t._echartsData={_series:e._echartsData._series,_seriesIndex:e._echartsData._seriesIndex,_data:e._echartsData._data,_dataIndex:e._echartsData._dataIndex,_name:e._echartsData._name,_value:e._echartsData._value,_special:e._echartsData._special,_special2:e._echartsData._special2}}return{pack:e,set:n,get:t,clone:r}}),r("echarts/util/ecAnimation",["require","zrender/tool/util","zrender/shape/Polygon"],function(e){function n(e,n,r,i,s){var o=r.style.pointList,u=o.length,a;if(!n){a=[];if(r._orient!="vertical"){var f=o[0][1];for(var l=0;l1?t.symbol:[t.symbol[0],t.symbol[0]]:[t.symbol,t.symbol],t.symbolSize=t.symbolSize instanceof Array?t.symbolSize.length>1?t.symbolSize:[t.symbolSize[0],t.symbolSize[0]]:[t.symbolSize,t.symbolSize],t.symbolRotate=t.symbolRotate instanceof Array?t.symbolRotate.length>1?t.symbolRotate:[t.symbolRotate[0],t.symbolRotate[0]]:[t.symbolRotate,t.symbolRotate],t.name=n.name;var i=[],u=t.data,a,f=r.dataRange,c=r.legend,h,p,d,v,m,g,y=this.zr.getWidth(),b=this.zr.getHeight(),w;for(var E=0,S=u.length;E "+u[E][1].name:""),p),i.push(a)}return i},getMarkCoord:function(){return[0,0]},getSymbolShape:function(e,r,i,s,u,a,f,l,c,h,p){var d=[i,e],v=typeof i!="undefined"?typeof i.value!="undefined"?i.value:i:"-";l=this.deepQuery(d,"symbol")||l;var m=this.deepQuery(d,"symbolSize");m=typeof m=="function"?m(v):m;var g=this.deepQuery(d,"symbolRotate"),y=this.deepMerge(d,"itemStyle.normal"),b=this.deepMerge(d,"itemStyle.emphasis"),w=typeof y.borderWidth!="undefined"?y.borderWidth:y.lineStyle&&y.lineStyle.width;typeof w=="undefined"&&(w=l.match("empty")?2:0);var E=typeof b.borderWidth!="undefined"?b.borderWidth:b.lineStyle&&b.lineStyle.width;typeof E=="undefined"&&(E=w+2);var S=new n({style:{iconType:l.replace("empty","").toLowerCase(),x:a-m,y:f-m,width:m*2,height:m*2,brushType:"both",color:l.match("empty")?h:this.getItemStyleColor(y.color,r,s,i)||c,strokeColor:y.borderColor||this.getItemStyleColor(y.color,r,s,i)||c,lineWidth:w},highlightStyle:{color:l.match("empty")?h:this.getItemStyleColor(b.color,r,s,i),strokeColor:b.borderColor||y.borderColor||this.getItemStyleColor(y.color,r,s,i)||c,lineWidth:E},clickable:!0});return l.match("image")&&(S.style.image=l.replace(new RegExp("^image:\\/\\/"),""),S=new t({style:S.style,highlightStyle:S.highlightStyle,clickable:!0})),typeof g!="undefined"&&(S.rotation=[g*Math.PI/180,a,f]),l.match("star")&&(S.style.iconType="star",S.style.n=l.replace("empty","").replace("star","")-0||5),l=="none"&&(S.invisible=!0,S.hoverable=!1),S=this.addLabel(S,e,i,u,p),l.match("empty")&&(typeof S.style.textColor=="undefined"&&(S.style.textColor=S.style.strokeColor),typeof S.highlightStyle.textColor=="undefined"&&(S.highlightStyle.textColor=S.highlightStyle.strokeColor)),o.pack(S,e,r,i,s,u),S._x=a,S._y=f,S._dataIndex=s,S._seriesIndex=r,S},getLineMarkShape:function(e,t,n,i,s,o,u,a,f){var l=typeof n[0]!="undefined"?typeof n[0].value!="undefined"?n[0].value:n[0]:"-",c=typeof n[1]!="undefined"?typeof n[1].value!="undefined"?n[1].value:n[1]:"-",h=[this.query(n[0],"symbol")||e.symbol[0],this.query(n[1],"symbol")||e.symbol[1]],p=[this.query(n[0],"symbolSize")||e.symbolSize[0],this.query(n[1],"symbolSize")||e.symbolSize[1]];p[0]=typeof p[0]=="function"?p[0](l):p[0],p[1]=typeof p[1]=="function"?p[1](c):p[1];var d=[this.query(n[0],"symbolRotate")||e.symbolRotate[0],this.query(n[1],"symbolRotate")||e.symbolRotate[1]],v=[n[0],e],m=this.deepMerge(v,"itemStyle.normal");m.color=this.getItemStyleColor(m.color,t,i,n);var g=this.deepMerge(v,"itemStyle.emphasis");g.color=this.getItemStyleColor(g.color,t,i,n);var y=m.lineStyle,b=g.lineStyle,w=y.width;typeof w=="undefined"&&(w=m.borderWidth);var E=b.width;typeof E=="undefined"&&(typeof g.borderWidth!="undefined"?E=g.borderWidth:E=w+2);var S=new r({style:{smooth:e.smooth?"spline":!1,symbol:h,symbolSize:p,symbolRotate:d,xStart:s,yStart:o,xEnd:u,yEnd:a,brushType:"both",lineType:y.type,shadowColor:y.shadowColor||y.color||m.borderColor||m.color||f,shadowBlur:y.shadowBlur,shadowOffsetX:y.shadowOffsetX,shadowOffsetY:y.shadowOffsetY,color:m.color||f,strokeColor:y.color||m.borderColor||m.color||f,lineWidth:w,symbolBorderColor:m.borderColor||m.color||f,symbolBorder:m.borderWidth},highlightStyle:{shadowColor:b.shadowColor,shadowBlur:b.shadowBlur,shadowOffsetX:b.shadowOffsetX,shadowOffsetY:b.shadowOffsetY,color:g.color||m.color||f,strokeColor:b.color||y.color||g.borderColor||m.borderColor||g.color||m.color||f,lineWidth:E,symbolBorderColor:g.borderColor||m.borderColor||g.color||m.color||f,symbolBorder:typeof g.borderWidth=="undefined"?m.borderWidth+2:g.borderWidth},clickable:!0});return S=this.addLabel(S,e,n[0],n[0].name+" : "+n[1].name),S._x=u,S._y=a,S},getLargeMarkPoingShape:function(e,t){var n=this.series[e],r=this.component,s=t.data,o,u=r.dataRange,a=r.legend,f,l,c=[s[0],t],h,p,d;a&&(f=a.getColor(n.name));if(u){l=typeof s[0]!="undefined"?typeof s[0].value!="undefined"?s[0].value:s[0]:"-",f=isNaN(l)?f:u.getColor(l),h=this.deepQuery(c,"itemStyle.normal.color")||f,p=this.deepQuery(c,"itemStyle.emphasis.color")||h;if(h==null&&p==null)return}f=this.deepMerge(c,"itemStyle.normal").color||f;var v=this.deepQuery(c,"symbol")||"circle";v=v.replace("empty","").replace(/\d/g,""),d=this.deepMerge([s[0],t],"effect");var m=window.devicePixelRatio||1;return o=new i({style:{pointList:s,color:f,strokeColor:f,shadowColor:d.shadowColor||f,shadowBlur:(typeof d.shadowBlur!="undefined"?d.shadowBlur:8)*m,size:this.deepQuery(c,"symbolSize"),iconType:v,brushType:"fill",lineWidth:1},draggable:!1,hoverable:!1}),d.show&&(o.effect=d),o},backupShapeList:function(){this.shapeList&&this.shapeList.length>0?(this.lastShapeList=this.shapeList,this.shapeList=[]):this.lastShapeList=[]},addShapeList:function(){var e=this.option.animationThreshold/(this.canvasSupported?2:4),t=this.lastShapeList,n=this.shapeList,r=t.length>0?500:this.query(this.option,"animationDuration"),i=this.query(this.option,"animationEasing"),s,o={},u={};if(this.option.animation&&!this.option.renderAsImage&&n.length500?u.candle(this.zr,e,t,n,r):this.zr.addShape(t);break;case"ring":case"sector":case"circle":n>500?u.ring(this.zr,e,t,n+(o.get(t,"dataIndex")||0)%20*100,r):t.type=="sector"?u.sector(this.zr,e,t,n,r):this.zr.addShape(t);break;case"text":u.text(this.zr,e,t,n,r);break;case"polygon":n>500?u.polygon(this.zr,e,t,n,r):u.pointList(this.zr,e,t,n,r);break;case"chord":u.chord(this.zr,e,t,n,r);break;case"gauge-pointer":u.gaugePointer(this.zr,e,t,n,r);break;case"mark-line":u.markline(this.zr,e,t,n,r);break;case"line":u.line(this.zr,e,t,n,r);break;default:this.zr.addShape(t)}},animationMark:function(e,t,n){var r=n||this.shapeList;for(var i=0,s=r.length;i0&&(e&&this.zr.modLayer(s.EFFECT_ZLEVEL,{motionBlur:!1}),this.zr.delShape(this.effectList)),this.effectList=[]},addMark:function(e,t,n){var r=this.series[e];if(this.selectedMap[r.name]){var i=500,s=this.query(this.option,"animationEasing"),o=r[n].data,u=this.shapeList.length;r[n].data=t.data,this["_build"+n.replace("m","M")](e);for(var a=u,f=this.shapeList.length;a0?-1:1,t.style.r-=r,t.style.r=t.style.r<5?5:t.style.r;var i=s.get(t,"value"),o=i*f.option.island.calculateStep;o>1?i=Math.round(i-o*r):i=(i-o*r).toFixed(2)-0;var a=s.get(t,"name");t.style.text=a+":"+i,s.set(t,"value",i),s.set(t,"name",a),f.zr.modShape(t.id),f.zr.refresh(),u.stop(n)}}var t=e("../component/base"),n=e("./base"),r=e("zrender/shape/Circle"),i=e("../config"),s=e("../util/ecData"),o=e("zrender/tool/util"),u=e("zrender/tool/event");return a.prototype={type:i.CHART_TYPE_ISLAND,_combine:function(t,n){var r=e("zrender/tool/color"),i=e("../util/accMath"),o=i.accAdd(s.get(t,"value"),s.get(n,"value")),u=s.get(t,"name")+this._nameConnector+s.get(n,"name");t.style.text=u+this._valueConnector+o,s.set(t,"value",o),s.set(t,"name",u),t.style.r=this.option.island.r,t.style.color=r.mix(t.style.color,n.style.color)},refresh:function(e){e&&(e.island=this.reformOption(e.island),this.option=e,this._nameConnector=this.option.nameConnector,this._valueConnector=this.option.valueConnector)},getOption:function(){return this.option},resize:function(){var e=this.zr.getWidth(),t=this.zr.getHeight(),n=e/(this._zrWidth||e),r=t/(this._zrHeight||t);if(n==1&&r==1)return;this._zrWidth=e,this._zrHeight=t;for(var i=0,s=this.shapeList.length;i'+(t[0]||this._lang[0])+"

",this._textArea.style.cssText="display:block;margin:0 0 8px 0;padding:4px 6px;overflow:auto;width:"+(this._zrWidth-15)+"px;"+"height:"+(this._zrHeight-100)+"px;";var n=this.query(this.option,"toolbox.feature.dataView.optionToContent");typeof n!="function"?this._textArea.value=this._optionToContent():this._textArea.value=n(this.option),this._tDom.appendChild(this._textArea),this._buttonClose.style.cssText="float:right;padding:1px 6px;",this._buttonClose.innerHTML=t[1]||this._lang[1];var r=this;this._buttonClose.onclick=function(){r.hide()},this._tDom.appendChild(this._buttonClose),this.query(this.option,"toolbox.feature.dataView.readOnly")===!1?(this._buttonRefresh.style.cssText="float:right;margin-right:10px;padding:1px 6px;",this._buttonRefresh.innerHTML=t[2]||this._lang[2],this._buttonRefresh.onclick=function(){r._save()},this._tDom.appendChild(this._buttonRefresh),this._textArea.readOnly=!1,this._textArea.style.cursor="default"):(this._textArea.readOnly=!0,this._textArea.style.cursor="text"),this._sizeCssText="width:"+this._zrWidth+"px;"+"height:"+this._zrHeight+"px;"+"background-color:#fff;",this._tDom.style.cssText=this._gCssText+this._sizeCssText},_optionToContent:function(){var e,t,r,i,s,o,u=[],a="";if(this.option.xAxis){this.option.xAxis instanceof Array?u=this.option.xAxis:u=[this.option.xAxis];for(e=0,i=u.length;e10&&(this._sizeCssText="width:"+this._zrWidth+"px;"+"height:"+this._zrHeight+"px;"+"background-color:#fff;",this._tDom.style.cssText=this._gCssText+this._sizeCssText,this._textArea.style.cssText="display:block;margin:0 0 8px 0;padding:4px 6px;overflow:auto;width:"+(this._zrWidth-15)+"px;"+"height:"+(this._zrHeight-100)+"px;")},dispose:function(){window.removeEventListener?(this._tDom.removeEventListener("click",this._stop),this._tDom.removeEventListener("mousewheel",this._stop),this._tDom.removeEventListener("mousemove",this._stop),this._tDom.removeEventListener("mousedown",this._stop),this._tDom.removeEventListener("mouseup",this._stop),this._tDom.removeEventListener("touchstart",this._stop),this._tDom.removeEventListener("touchmove",this._stop),this._tDom.removeEventListener("touchend",this._stop)):(this._tDom.detachEvent("onclick",this._stop),this._tDom.detachEvent("onmousewheel",this._stop),this._tDom.detachEvent("onmousemove",this._stop),this._tDom.detachEvent("onmousedown",this._stop),this._tDom.detachEvent("onmouseup",this._stop)),this._buttonRefresh.onclick=null,this._buttonClose.onclick=null,this._hasShow&&(this._tDom.removeChild(this._textArea),this._tDom.removeChild(this._buttonRefresh),this._tDom.removeChild(this._buttonClose)),this._textArea=null,this._buttonRefresh=null,this._buttonClose=null,this.dom.firstChild.removeChild(this._tDom),this._tDom=null}},r.inherits(i,t),e("../component").define("dataView",i),i}),r("echarts/component/toolbox",["require","./base","zrender/shape/Line","zrender/shape/Image","zrender/shape/Rectangle","../util/shape/Icon","../config","zrender/tool/util","zrender/config","zrender/tool/event","./dataView","../component"],function(e){function h(e,n,r,i,s){t.call(this,e,n,r,i,s),this.dom=s.dom,this._magicType={},this._isSilence=!1,this._iconList,this._iconShapeMap={},this._featureTitle={},this._featureIcon={},this._featureColor={},this._enableColor="red",this._disableColor="#ccc",this._markShapeList=[];var o=this;o._onMark=function(e){o.__onMark(e)},o._onMarkUndo=function(e){o.__onMarkUndo(e)},o._onMarkClear=function(e){o.__onMarkClear(e)},o._onDataZoom=function(e){o.__onDataZoom(e)},o._onDataZoomReset=function(e){o.__onDataZoomReset(e)},o._onDataView=function(e){o.__onDataView(e)},o._onRestore=function(e){o.__onRestore(e)},o._onSaveAsImage=function(e){o.__onSaveAsImage(e)},o._onMagicType=function(e){o.__onMagicType(e)},o._onCustomHandler=function(e){o.__onCustomHandler(e)},o._onmousemove=function(e){return o.__onmousemove(e)},o._onmousedown=function(e){return o.__onmousedown(e)},o._onmouseup=function(e){return o.__onmouseup(e)},o._onclick=function(e){return o.__onclick(e)}}var t=e("./base"),n=e("zrender/shape/Line"),r=e("zrender/shape/Image"),i=e("zrender/shape/Rectangle"),s=e("../util/shape/Icon"),o=e("../config"),u=e("zrender/tool/util"),a=e("zrender/config"),f=e("zrender/tool/event"),l="stack",c="tiled";return h.prototype={type:o.COMPONENT_TYPE_TOOLBOX,_buildShape:function(){this._iconList=[];var e=this.option.toolbox;this._enableColor=e.effectiveColor,this._disableColor=e.disableColor;var t=e.feature,n=[];for(var r in t)if(t[r].show)switch(r){case"mark":n.push({key:r,name:"mark"}),n.push({key:r,name:"markUndo"}),n.push({key:r,name:"markClear"});break;case"magicType":for(var i=0,s=t[r].type.length;i0){var o,r;for(var i=0,s=n.length;i=1){var t=this._markShapeList[e-1];this.zr.delShape(t.id),this.zr.refresh(),this._markShapeList.pop(),e==1&&(this._iconDisable(this._iconShapeMap.markUndo),this._iconDisable(this._iconShapeMap.markClear))}}return!0},__onMarkClear:function(){this._marking&&(this._marking=!1);var e=this._markShapeList.length;if(e>0){while(e--)this.zr.delShape(this._markShapeList.pop().id);this._iconDisable(this._iconShapeMap.markUndo),this._iconDisable(this._iconShapeMap.markClear),this.zr.refresh()}return!0},__onDataZoom:function(e){var t=e.target;if(this._zooming||this._zoomStart)this._resetZoom(),this.zr.refresh(),this.dom.style.cursor="default";else{this._resetMark(),this.zr.modShape(t.id,{style:{strokeColor:this._enableColor}}),this.zr.refresh(),this._zoomStart=!0;var n=this;setTimeout(function(){n.zr&&n.zr.on(a.EVENT.MOUSEDOWN,n._onmousedown)&&n.zr.on(a.EVENT.MOUSEUP,n._onmouseup)&&n.zr.on(a.EVENT.MOUSEMOVE,n._onmousemove)},10),this.dom.style.cursor="crosshair"}return!0},__onDataZoomReset:function(){return this._zooming&&(this._zooming=!1),this._zoomQueue.pop(),this._zoomQueue.length>0?this.component.dataZoom.absoluteZoom(this._zoomQueue[this._zoomQueue.length-1]):(this.component.dataZoom.rectZoom(),this._iconDisable(this._iconShapeMap.dataZoomReset),this.zr.refresh()),!0},_resetMark:function(){this._marking=!1,this._markStart&&(this._markStart=!1,this._iconShapeMap.mark&&this.zr.modShape(this._iconShapeMap.mark.id,{style:{strokeColor:this._iconShapeMap.mark.highlightStyle.strokeColor}}),this.zr.un(a.EVENT.CLICK,this._onclick),this.zr.un(a.EVENT.MOUSEMOVE,this._onmousemove))},_resetZoom:function(){this._zooming=!1,this._zoomStart&&(this._zoomStart=!1,this._iconShapeMap.dataZoom&&this.zr.modShape(this._iconShapeMap.dataZoom.id,{style:{strokeColor:this._iconShapeMap.dataZoom.highlightStyle.strokeColor}}),this.zr.un(a.EVENT.MOUSEDOWN,this._onmousedown),this.zr.un(a.EVENT.MOUSEUP,this._onmouseup),this.zr.un(a.EVENT.MOUSEMOVE,this._onmousemove))},_iconDisable:function(e){e.type!="image"?this.zr.modShape(e.id,{hoverable:!1,clickable:!1,style:{strokeColor:this._disableColor}}):this.zr.modShape(e.id,{hoverable:!1,clickable:!1,style:{opacity:.3}})},_iconEnable:function(e){e.type!="image"?this.zr.modShape(e.id,{hoverable:!0,clickable:!0,style:{strokeColor:e.highlightStyle.strokeColor}}):this.zr.modShape(e.id,{hoverable:!0,clickable:!0,style:{opacity:.8}})},__onDataView:function(){return this._dataView.show(this.option),!0},__onRestore:function(){return this._resetMark(),this._resetZoom(),this.messageCenter.dispatch(o.EVENT.RESTORE,null,null,this.myChart),!0},__onSaveAsImage:function(){var e=this.option.toolbox.feature.saveAsImage,t=e.type||"png";t!="png"&&t!="jpeg"&&(t="png");var n;this.myChart.isConnected()?n=this.myChart.getConnectedDataURL(t):n=this.zr.toDataURL("image/"+t,this.option.backgroundColor&&this.option.backgroundColor.replace(" ","")=="rgba(0,0,0,0)"?"#fff":this.option.backgroundColor);var r=document.createElement("div");r.id="__echarts_download_wrap__",r.style.cssText="position:fixed;z-index:99999;display:block;top:0;left:0;background-color:rgba(33,33,33,0.5);text-align:center;width:100%;height:100%;line-height:"+document.documentElement.clientHeight+"px;";var i=document.createElement("a");i.href=n,i.setAttribute("download",(e.name?e.name:this.option.title&&(this.option.title.text||this.option.title.subtext)?this.option.title.text||this.option.title.subtext:"ECharts")+"."+t),i.innerHTML='图片另存为")+'"/>',r.appendChild(i),document.body.appendChild(r),i=null,r=null,setTimeout(function(){var e=document.getElementById("__echarts_download_wrap__");e&&(e.onclick=function(){var e=document.getElementById("__echarts_download_wrap__");e.onclick=null,e.innerHTML="",document.body.removeChild(e),e=null},e=null)},500);return},__onMagicType:function(e){this._resetMark();var t=e.target._name;return this._magicType[t]||(this._magicType[t]=!0,t==o.CHART_TYPE_LINE?this._magicType[o.CHART_TYPE_BAR]=!1:t==o.CHART_TYPE_BAR&&(this._magicType[o.CHART_TYPE_LINE]=!1),t==l?this._magicType[c]=!1:t==c&&(this._magicType[l]=!1),this.messageCenter.dispatch(o.EVENT.MAGIC_TYPE_CHANGED,e.event,{magicType:this._magicType},this.myChart)),!0},setMagicType:function(e){this._resetMark(),this._magicType=e,!this._isSilence&&this.messageCenter.dispatch(o.EVENT.MAGIC_TYPE_CHANGED,null,{magicType:this._magicType},this.myChart)},__onCustomHandler:function(e){var t=e.target.style.iconType,n=this.option.toolbox.feature[t].onclick;typeof n=="function"&&n(this.option)},reset:function(e,t){t&&this.clear();if(this.query(e,"toolbox.show")&&this.query(e,"toolbox.feature.magicType.show")){var n=e.toolbox.feature.magicType.type,r=n.length;this._magicMap={};while(r--)this._magicMap[n[r]]=!0;r=e.series.length;var i,s;while(r--){i=e.series[r].type,this._magicMap[i]&&(s=e.xAxis instanceof Array?e.xAxis[e.series[r].xAxisIndex||0]:e.xAxis,s&&(s.type||"category")=="category"&&(s.__boundaryGap=typeof s.boundaryGap!="undefined"?s.boundaryGap:!0),s=e.yAxis instanceof Array?e.yAxis[e.series[r].yAxisIndex||0]:e.yAxis,s&&s.type=="category"&&(s.__boundaryGap=typeof s.boundaryGap!="undefined"?s.boundaryGap:!0),e.series[r].__type=i,e.series[r].__itemStyle=u.clone(e.series[r].itemStyle||{}));if(this._magicMap[l]||this._magicMap[c])e.series[r].__stack=e.series[r].stack}}this._magicType=t?{}:this._magicType||{};for(var o in this._magicType)if(this._magicType[o]){this.option=e,this.getMagicOption();break}var a=e.dataZoom;if(a&&a.show){var f=typeof a.start!="undefined"&&a.start>=0&&a.start<=100?a.start:0,h=typeof a.end!="undefined"&&a.end>=0&&a.end<=100?a.end:100;f>h&&(f+=h,h=f-h,f-=h),this._zoomQueue=[{start:f,end:h,start2:0,end2:100}]}else this._zoomQueue=[]},getMagicOption:function(){var e;if(this._magicType[o.CHART_TYPE_LINE]||this._magicType[o.CHART_TYPE_BAR]){var t=this._magicType[o.CHART_TYPE_LINE]?!1:!0;for(var n=0,r=this.option.series.length;n0&&(this.zr.delShape(this._lastTipShape.tipShape),this._lastTipShape=!1,this.shapeList.length=2),e&&this.zr.refresh(),this.showing=!1},_show:function(e,t,n,r){var i=this._tDom.offsetHeight,s=this._tDom.offsetWidth;e&&(typeof e=="function"&&(e=e([t,n])),e instanceof Array&&(t=e[0],n=e[1])),t+s>this._zrWidth&&(t-=s+40),n+i>this._zrHeight&&(n-=i-20),n<20&&(n=0),this._tDom.style.cssText=this._gCssText+this._defaultCssText+(r?r:"")+"left:"+t+"px;top:"+n+"px;",(i<10||s<10)&&setTimeout(this._refixed,20),this.showing=!0},__refixed:function(){if(this._tDom){var e="",t=this._tDom.offsetHeight,n=this._tDom.offsetWidth;this._tDom.offsetLeft+n>this._zrWidth&&(e+="left:"+(this._zrWidth-n-20)+"px;"),this._tDom.offsetTop+t>this._zrHeight&&(e+="top:"+(this._zrHeight-t-10)+"px;"),e!==""&&(this._tDom.style.cssText+=e)}},__tryShow:function(){var e,t;if(!this._curTarget)this._findPolarTrigger()||this._findAxisTrigger();else{if(this._curTarget._type=="island"&&this.option.tooltip.show){this._showItemTrigger();return}var n=u.get(this._curTarget,"series"),r=u.get(this._curTarget,"data");e=this.deepQuery([r,n,this.option],"tooltip.show"),typeof n=="undefined"||typeof r=="undefined"||e===!1?(clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this._hidingTicket=setTimeout(this._hide,this._hideDelay)):(t=this.deepQuery([r,n,this.option],"tooltip.trigger"),t=="axis"?this._showAxisTrigger(n.xAxisIndex,n.yAxisIndex,u.get(this._curTarget,"dataIndex")):this._showItemTrigger())}},_findAxisTrigger:function(){if(!this.component.xAxis||!this.component.yAxis){this._hidingTicket=setTimeout(this._hide,this._hideDelay);return}var e=this.option.series,t,n;for(var r=0,i=e.length;r=r)break;a=t.getCoordByIndex(++n),o=a}return r-sh){a>=i&&(c=a);if(a<=i)break;a=t.getCoordByIndex(++n),l=a}return i-l>c-i?n-=n!==0?1:0:typeof t.getNameByIndex(n)=="undefined"&&(n-=1),n},_showAxisTrigger:function(e,t,n){!this._event.connectTrigger&&this.messageCenter.dispatch(o.EVENT.TOOLTIP_IN_GRID,this._event,null,this.myChart);if(typeof this.component.xAxis=="undefined"||typeof this.component.yAxis=="undefined"||typeof e=="undefined"||typeof t=="undefined"){clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this._hidingTicket=setTimeout(this._hide,this._hideDelay);return}var r=this.option.series,i=[],s=[],u,a,l,c,h,p,d="";if(this.option.tooltip.trigger=="axis"){if(this.option.tooltip.show===!1)return;c=this.option.tooltip.formatter,h=this.option.tooltip.position}if(e!=-1&&this.component.xAxis.getAxis(e).type==o.COMPONENT_TYPE_AXIS_CATEGORY){u=this.component.xAxis.getAxis(e);for(var v=0,m=r.length;v=0?this._showItemTrigger():(clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this._tDom.style.display="none");if(i.length>0){var g;if(typeof c=="function"){var y=[];for(var v=0,m=i.length;v"+this._encodeHTML(i[v].name||"")+" : ",g=i[v].data[n],g=typeof g!="undefined"?typeof g.value!="undefined"?g.value:g:"-",c+=g instanceof Array?g:this.numAddCommas(g);this._tDom.innerHTML=c}if(p===!1||!this.option.tooltip.showContent)return;this.hasAppend||(this._tDom.style.left=this._zrWidth/2+"px",this._tDom.style.top=this._zrHeight/2+"px",this.dom.firstChild.appendChild(this._tDom),this.hasAppend=!0),this._show(h,a+10,l+10,d)}},_showPolarTrigger:function(e,t){if(typeof this.component.polar=="undefined"||typeof e=="undefined"||typeof t=="undefined"||t<0)return!1;var n=this.option.series,r=[],i,s,o,u="";if(this.option.tooltip.trigger=="axis"){if(this.option.tooltip.show===!1)return!1;i=this.option.tooltip.formatter,s=this.option.tooltip.position}var a=this.option.polar[e].indicator[t].text;for(var l=0,c=n.length;l0){var h,p,d=[];for(var l=0,c=r.length;l"+this._encodeHTML(d[0][3])+" : "+this.numAddCommas(d[0][2]);for(var l=1,c=d.length;l"+this._encodeHTML(d[l][1])+"
",i+=this._encodeHTML(d[l][3])+" : "+this.numAddCommas(d[l][2]);this._tDom.innerHTML=i}if(o===!1||!this.option.tooltip.showContent)return;return this.hasAppend||(this._tDom.style.left=this._zrWidth/2+"px",this._tDom.style.top=this._zrHeight/2+"px",this.dom.firstChild.appendChild(this._tDom),this.hasAppend=!0),this._show(s,f.getX(this._event),f.getY(this._event),u),!0}},_showItemTrigger:function(){if(!this._curTarget)return;var e=u.get(this._curTarget,"series"),t=u.get(this._curTarget,"data"),n=u.get(this._curTarget,"name"),r=u.get(this._curTarget,"value"),i=u.get(this._curTarget,"special"),s=u.get(this._curTarget,"special2"),a,l,c,h="",p,d="";this._curTarget._type!="island"?(this.option.tooltip.trigger=="item"&&(a=this.option.tooltip.formatter,l=this.option.tooltip.position),this.query(e,"tooltip.trigger")=="item"&&(c=this.query(e,"tooltip.showContent")||c,a=this.query(e,"tooltip.formatter")||a,l=this.query(e,"tooltip.position")||l,h+=this._style(this.query(e,"tooltip"))),c=this.query(t,"tooltip.showContent")||c,a=this.query(t,"tooltip.formatter")||a,l=this.query(t,"tooltip.position")||l,h+=this._style(this.query(t,"tooltip"))):(c=this.deepQuery([t,e,this.option],"tooltip.showContent"),a=this.deepQuery([t,e,this.option],"tooltip.islandFormatter"),l=this.deepQuery([t,e,this.option],"tooltip.islandPosition"));if(typeof a=="function")this._curTicket=(e.name||"")+":"+u.get(this._curTarget,"dataIndex"),this._tDom.innerHTML=a.call(this.myChart,[e.name||"",n,r,i,s,t],this._curTicket,this._setContent);else if(typeof a=="string")this._curTicket=NaN,a=a.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}"),a=a.replace("{a0}",this._encodeHTML(e.name||"")).replace("{b0}",this._encodeHTML(n)).replace("{c0}",r instanceof Array?r:this.numAddCommas(r)),a=a.replace("{d}","{d0}").replace("{d0}",i||""),a=a.replace("{e}","{e0}").replace("{e0}",u.get(this._curTarget,"special2")||""),this._tDom.innerHTML=a;else{this._curTicket=NaN;if(e.type==o.CHART_TYPE_SCATTER)this._tDom.innerHTML=(typeof e.name!="undefined"?this._encodeHTML(e.name)+"
":"")+(n===""?"":this._encodeHTML(n)+" : ")+r+(typeof i=="undefined"?"":" ("+i+")");else if(e.type==o.CHART_TYPE_RADAR&&i){p=i,d+=this._encodeHTML(n===""?e.name||"":n),d+=d===""?"":"
";for(var v=0;v";this._tDom.innerHTML=d}else if(e.type==o.CHART_TYPE_CHORD)if(typeof s=="undefined")this._tDom.innerHTML=this._encodeHTML(n)+" ("+this.numAddCommas(r)+")";else{var m=this._encodeHTML(n),g=this._encodeHTML(i);this._tDom.innerHTML=(typeof e.name!="undefined"?this._encodeHTML(e.name)+"
":"")+m+" -> "+g+" ("+this.numAddCommas(r)+")"+"
"+g+" -> "+m+" ("+this.numAddCommas(s)+")"}else this._tDom.innerHTML=(typeof e.name!="undefined"?this._encodeHTML(e.name)+"
":"")+this._encodeHTML(n)+" : "+this.numAddCommas(r)+(typeof i=="undefined"?"":" ("+this.numAddCommas(i)+")")}if(!this._axisLineShape.invisible||!this._axisShadowShape.invisible)this._axisLineShape.invisible=!0,this.zr.modShape(this._axisLineShape.id),this._axisShadowShape.invisible=!0,this.zr.modShape(this._axisShadowShape.id),this.zr.refresh();if(c===!1||!this.option.tooltip.showContent)return;this.hasAppend||(this._tDom.style.left=this._zrWidth/2+"px",this._tDom.style.top=this._zrHeight/2+"px",this.dom.firstChild.appendChild(this._tDom),this.hasAppend=!0),this._show(l,f.getX(this._event)+20,f.getY(this._event)-20,h)},_styleAxisPointer:function(e,t,n,r,i,s,o,u){if(e.length>0){var a,f,l=this.option.tooltip.axisPointer,c=l.type,h={line:{},cross:{},shadow:{}};for(var p in h)h[p].color=l[p+"Style"].color,h[p].width=l[p+"Style"].width,h[p].type=l[p+"Style"].type;for(var d=0,v=e.length;d100?(this._axisCrossShape.style.textAlign="left",this._axisCrossShape.style.textX=o+10):(this._axisCrossShape.style.textAlign="right",this._axisCrossShape.style.textX=o-10),u-this.component.grid.getY()>50?(this._axisCrossShape.style.textBaseline="bottom",this._axisCrossShape.style.textY=u-10):(this._axisCrossShape.style.textBaseline="top",this._axisCrossShape.style.textY=u+10),this._axisCrossShape.invisible=!1,this.zr.modShape(this._axisCrossShape.id);else if(c=="shadow"){if(typeof h.shadow.width=="undefined"||h.shadow.width=="auto"||isNaN(h.shadow.width))h.shadow.width=s;t==r?Math.abs(this.component.grid.getX()-t)<2?(h.shadow.width/=2,t=r+=h.shadow.width/2):Math.abs(this.component.grid.getXend()-t)<2&&(h.shadow.width/=2,t=r-=h.shadow.width/2):n==i&&(Math.abs(this.component.grid.getY()-n)<2?(h.shadow.width/=2,n=i+=h.shadow.width/2):Math.abs(this.component.grid.getYend()-n)<2&&(h.shadow.width/=2,n=i-=h.shadow.width/2)),this._axisShadowShape.style={xStart:t,yStart:n,xEnd:r,yEnd:i,strokeColor:h.shadow.color,lineWidth:h.shadow.width},this._axisShadowShape.invisible=!1,this.zr.modShape(this._axisShadowShape.id)}this.zr.refresh()}},__onmousemove:function(e){clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket);var t=e.target,n=f.getX(e.event),r=f.getY(e.event);if(!t)this._curTarget=!1,this._event=e.event,this._event.zrenderX=n,this._event.zrenderY=r,this._needAxisTrigger&&this.component.grid&&l.isInside(s,this.component.grid.getArea(),n,r)?this._showingTicket=setTimeout(this._tryShow,this._showDelay):this._needAxisTrigger&&this.component.polar&&this.component.polar.isInside([n,r])!=-1?this._showingTicket=setTimeout(this._tryShow,this._showDelay):(!this._event.connectTrigger&&this.messageCenter.dispatch(o.EVENT.TOOLTIP_OUT_GRID,this._event,null,this.myChart),this._hidingTicket=setTimeout(this._hide,this._hideDelay));else{this._curTarget=t,this._event=e.event,this._event.zrenderX=n,this._event.zrenderY=r;var i;if(this._needAxisTrigger&&this.component.polar&&(i=this.component.polar.isInside([n,r]))!=-1){var u=this.option.series;for(var a=0,c=u.length;a0&&(this.zr.delShape(this._lastTipShape.tipShape),this.shapeList.length=2);for(var n=0,r=t.length;n0&&this.zr.delShape(this._lastTipShape.tipShape),this._lastTipShape=!1,this.shapeList.length=2;if(e){this.option=e,this.option.tooltip=this.reformOption(this.option.tooltip),this.option.tooltip.textStyle=h.merge(this.option.tooltip.textStyle,this.ecTheme.textStyle),this.option.tooltip.padding=this.reformCssArray(this.option.tooltip.padding),this._needAxisTrigger=!1,this.option.tooltip.trigger=="axis"&&(this._needAxisTrigger=!0);var t=this.option.series;for(var n=0,r=t.length;n0&&this.zr.delShape(this._lastTipShape.tipShape),this.clear(),this.shapeList=null,clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this.zr.un(a.EVENT.MOUSEMOVE,this._onmousemove),this.zr.un(a.EVENT.GLOBALOUT,this._onglobalout),this.hasAppend&&this.dom.firstChild.removeChild(this._tDom),this._tDom=null},_encodeHTML:function(e){return String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}},h.inherits(d,t),e("../component").define("tooltip",d),d}),r("zrender/shape/Ring",["require","./Base","../tool/util"],function(e){function n(e){t.call(this,e)}var t=e("./Base");return n.prototype={type:"ring",buildPath:function(e,t){e.arc(t.x,t.y,t.r,0,Math.PI*2,!1),e.moveTo(t.x+t.r0,t.y),e.arc(t.x,t.y,t.r0,0,Math.PI*2,!0);return},getRect:function(e){if(e.__rect)return e.__rect;var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,e.__rect={x:Math.round(e.x-e.r-t/2),y:Math.round(e.y-e.r-t/2),width:e.r*2+t,height:e.r*2+t},e.__rect}},e("../tool/util").inherits(n,t),n}),r("zrender/shape/Sector",["require","../tool/math","./Base","./Ring","./Polygon","../tool/util"],function(e){function r(e){n.call(this,e)}var t=e("../tool/math"),n=e("./Base");return r.prototype={type:"sector",buildPath:function(e,n){var r=n.x,i=n.y,s=typeof n.r0=="undefined"?0:n.r0,o=n.r,u=n.startAngle,a=n.endAngle;if(Math.abs(a-u)>=360){e.arc(r,i,o,0,Math.PI*2,!1),s!==0&&(e.moveTo(r+s,i),e.arc(r,i,s,0,Math.PI*2,!0));return}u=t.degreeToRadian(u),a=t.degreeToRadian(a);var f=Math.PI*2,l=t.cos(u),c=t.sin(u);e.moveTo(l*s+r,i-c*s),e.lineTo(l*o+r,i-c*o),e.arc(r,i,o,f-u,f-a,!0),e.lineTo(t.cos(a)*s+r,i-t.sin(a)*s),s!==0&&e.arc(r,i,s,f-a,f-u,!1);return},getRect:function(n){if(n.__rect)return n.__rect;var r=n.x,i=n.y,s=typeof n.r0=="undefined"?0:n.r0,o=n.r,u=n.startAngle,a=n.endAngle;if(Math.abs(a-u)>=360)return n.__rect=e("./Ring").prototype.getRect(n),n.__rect;u=(720+u)%360,a=(720+a)%360,a<=u&&(a+=360);var f=[];return u<=90&&a>=90&&f.push([r,i-o]),u<=180&&a>=180&&f.push([r-o,i]),u<=270&&a>=270&&f.push([r,i+o]),u<=360&&a>=360&&f.push([r+o,i]),u=t.degreeToRadian(u),a=t.degreeToRadian(a),f.push([t.cos(u)*s+r,i-t.sin(u)*s]),f.push([t.cos(u)*o+r,i-t.sin(u)*o]),f.push([t.cos(a)*o+r,i-t.sin(a)*o]),f.push([t.cos(a)*s+r,i-t.sin(a)*s]),n.__rect=e("./Polygon").prototype.getRect({brushType:n.brushType,lineWidth:n.lineWidth,pointList:f}),n.__rect}},e("../tool/util").inherits(r,n),r}),r("echarts/util/shape/Candle",["require","zrender/shape/Base","zrender/tool/util","./normalIsCover"],function(e){function r(e){t.call(this,e)}var t=e("zrender/shape/Base"),n=e("zrender/tool/util");return r.prototype={type:"candle",_numberOrder:function(e,t){return t-e},buildPath:function(e,t){var r=n.clone(t.y).sort(this._numberOrder);e.moveTo(t.x,r[3]),e.lineTo(t.x,r[2]),e.moveTo(t.x-t.width/2,r[2]),e.rect(t.x-t.width/2,r[2],t.width,r[1]-r[2]),e.moveTo(t.x,r[1]),e.lineTo(t.x,r[0])},getRect:function(e){if(!e.__rect){var t=0;if(e.brushType=="stroke"||e.brushType=="fill")t=e.lineWidth||1;var r=n.clone(e.y).sort(this._numberOrder);e.__rect={x:Math.round(e.x-e.width/2-t/2),y:Math.round(r[3]-t/2),width:e.width+t,height:r[0]-r[3]+t}}return e.__rect},isCover:e("./normalIsCover")},n.inherits(r,t),r}),r("echarts/component/legend",["require","./base","zrender/shape/Text","zrender/shape/Rectangle","zrender/shape/Sector","../util/shape/Icon","../util/shape/Candle","../config","zrender/tool/util","zrender/tool/area","../component"],function(e){function l(e,n,r,i,s){if(!this.query(i,"legend.data")){console.error("option.legend.data has not been defined.");return}t.call(this,e,n,r,i,s);var o=this;o._legendSelected=function(e){o.__legendSelected(e)},this._colorIndex=0,this._colorMap={},this._selectedMap={},this.refresh(i)}var t=e("./base"),n=e("zrender/shape/Text"),r=e("zrender/shape/Rectangle"),i=e("zrender/shape/Sector"),s=e("../util/shape/Icon"),o=e("../util/shape/Candle"),u=e("../config"),a=e("zrender/tool/util"),f=e("zrender/tool/area");l.prototype={type:u.COMPONENT_TYPE_LEGEND,_buildShape:function(){this._itemGroupLocation=this._getItemGroupLocation(),this._buildBackground(),this._buildItem();for(var e=0,t=this.shapeList.length;e=d-m&&(m=this._itemGroupLocation.x,g+=b+w):v-g<200&&b+(S==t-1||e[S+1]===""?0:w)>=v-g&&(this.legendOption.x=="right"?m-=this._itemGroupLocation.maxWidth+w:m+=this._itemGroupLocation.maxWidth+w,g=this._itemGroupLocation.y),o=this._getItemShapeByType(m,g,y,b,this._selectedMap[r]?E:"#ccc",i,E),o._name=r,o=new s(o),u={zlevel:this._zlevelBase,style:{x:m+y+5,y:g+b/2,color:this._selectedMap[r]?c.color==="auto"?E:c.color:"#ccc",text:p,textFont:h,textBaseline:"middle"},highlightStyle:{color:E,brushType:"fill"},hoverable:!!this.legendOption.selectedMode,clickable:!!this.legendOption.selectedMode},this.legendOption.orient=="vertical"&&this.legendOption.x=="right"&&(u.style.x-=y+10,u.style.textAlign="right"),u._name=r,u=new n(u),this.legendOption.selectedMode&&(o.onclick=u.onclick=this._legendSelected,o.onmouseover=u.onmouseover=this.hoverConnect,o.hoverConnect=u.id,u.hoverConnect=o.id),this.shapeList.push(o),this.shapeList.push(u),this.legendOption.orient=="horizontal"?m+=y+5+f.getTextWidth(p,h)+w:g+=b+w}this.legendOption.orient=="horizontal"&&this.legendOption.x=="center"&&g!=this._itemGroupLocation.y&&this._mLineOptimize()},_getName:function(e){return typeof e.name!="undefined"?e.name:e},_getFormatterName:function(e){var t=this.legendOption.formatter,n;return typeof t=="function"?n=t.call(this.myChart,e):typeof t=="string"?n=t.replace("{name}",e):n=e,n},_getFormatterNameFromData:function(e){var t=this._getName(e);return this._getFormatterName(t)},_mLineOptimize:function(){var e=[],t=this._itemGroupLocation.x;for(var n=2,r=this.shapeList.length;nh?(u=h,l+=i+n):u=Math.max(u,d),l+=i+n,d=0;continue}d+=r+f.getTextWidth(this._getFormatterNameFromData(e[m]),e[m].textStyle?this.getFont(a.merge(e[m].textStyle||{},s)):o)+n}l=Math.max(l,i),d-=n,d>h?(u=h,l+=i+n):u=Math.max(u,d)}else{for(var m=0;mp?(l=p,u+=v+n):l=Math.max(l,d),u+=v+n,d=0;continue}d+=i+n}u=Math.max(u,v),d-=n,d>p?(l=p,u+=v+n):l=Math.max(l,d)}h=this.zr.getWidth(),p=this.zr.getHeight();var g;switch(this.legendOption.x){case"center":g=Math.floor((h-u)/2);break;case"left":g=this.legendOption.padding[3]+this.legendOption.borderWidth;break;case"right":g=h-u-this.legendOption.padding[1]-this.legendOption.padding[3]-this.legendOption.borderWidth*2;break;default:g=this.parsePercent(this.legendOption.x,h)}var y;switch(this.legendOption.y){case"top":y=this.legendOption.padding[0]+this.legendOption.borderWidth;break;case"bottom":y=p-l-this.legendOption.padding[0]-this.legendOption.padding[2]-this.legendOption.borderWidth*2;break;case"center":y=Math.floor((p-l)/2);break;default:y=this.parsePercent(this.legendOption.y,p)}return{x:g,y:y,width:u,height:l,maxWidth:v}},_getSomethingByName:function(e){var t=this.option.series,n;for(var r=0,i=t.length;r=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height?!0:!1}},i.inherits(o,t),o}),r("echarts/component/timeline",["require","./base","zrender/shape/Rectangle","../util/shape/Icon","../util/shape/Chain","../config","zrender/tool/util","zrender/tool/area","zrender/tool/event","../component"],function(e){function f(e,n,r,i,u){t.call(this,e,n,r,i,u);var a=this;a._onclick=function(e){return a.__onclick(e)},a._ondrift=function(e,t){return a.__ondrift(this,e,t)},a._ondragend=function(){return a.__ondragend()},a._setCurrentOption=function(){var e=a.timelineOption;a.currentIndex%=e.data.length;var t=a.options[a.currentIndex]||{};a.myChart.setOption(t,e.notMerge),a.messageCenter.dispatch(s.EVENT.TIMELINE_CHANGED,null,{currentIndex:a.currentIndex,data:typeof e.data[a.currentIndex].name!="undefined"?e.data[a.currentIndex].name:e.data[a.currentIndex]},a.myChart)},a._onFrame=function(){a._setCurrentOption(),a._syncHandleShape(),a.timelineOption.autoPlay&&(a.playTicket=setTimeout(function(){a.currentIndex+=1;if(!a.timelineOption.loop&&a.currentIndex>=a.timelineOption.data.length){a.currentIndex=a.timelineOption.data.length-1,a.stop();return}a._onFrame()},a.timelineOption.playInterval))},this.setTheme(!1),this.options=this.option.options,this.currentIndex=this.timelineOption.currentIndex%this.timelineOption.data.length,!this.timelineOption.notMerge&&this.currentIndex!==0&&(this.options[this.currentIndex]=o.merge(this.options[this.currentIndex],this.options[0])),this.timelineOption.show&&(this._buildShape(),this._syncHandleShape()),this._setCurrentOption();if(this.timelineOption.autoPlay){var a=this;this.playTicket=setTimeout(function(){a.play()},this.ecTheme.animationDuration)}}function l(e,t){var n=2,i=t.x+n,s=t.y+n+2,o=t.width-n,u=t.height-n,a=t.symbol;if(a=="last")e.moveTo(i+o-2,s+u/3),e.lineTo(i+o-2,s),e.lineTo(i+2,s+u/2),e.lineTo(i+o-2,s+u),e.lineTo(i+o-2,s+u/3*2),e.moveTo(i,s),e.lineTo(i,s);else if(a=="next")e.moveTo(i+2,s+u/3),e.lineTo(i+2,s),e.lineTo(i+o-2,s+u/2),e.lineTo(i+2,s+u),e.lineTo(i+2,s+u/3*2),e.moveTo(i,s),e.lineTo(i,s);else if(a=="play")if(t.status=="stop")e.moveTo(i+2,s),e.lineTo(i+o-2,s+u/2),e.lineTo(i+2,s+u),e.lineTo(i+2,s);else{var f=t.brushType=="both"?2:3;e.rect(i+2,s,f,u),e.rect(i+o-f-2,s,f,u)}else if(a.match("image")){var l="";l=a.replace(new RegExp("^image:\\/\\/"),""),a=r.prototype.iconLibrary.image,a(e,{x:i,y:s,width:o,height:u,image:l})}}var t=e("./base"),n=e("zrender/shape/Rectangle"),r=e("../util/shape/Icon"),i=e("../util/shape/Chain"),s=e("../config"),o=e("zrender/tool/util"),u=e("zrender/tool/area"),a=e("zrender/tool/event");return f.prototype={type:s.COMPONENT_TYPE_TIMELINE,_buildShape:function(){this._location=this._getLocation(),this._buildBackground(),this._buildControl(),this._chainPoint=this._getChainPoint();if(this.timelineOption.label.show){var e=this._getInterval();for(var t=0,n=this._chainPoint.length;t3){var o=!1,a,f;n=0;while(!o&&n1){var v=c/h;v=v>50?50:v<20?5:v,c-=v*2;if(e.type=="number")for(var m=0;m0?"right":"left",S=[r*Math.PI/180,f,l-5]):S=!1,g.push({x:f,n:b,isEmpty:w,symbol:y,symbolSize:a[m].symbolSize||n,color:a[m].color,borderColor:a[m].borderColor,borderWidth:a[m].borderWidth,name:this._getReformedLabel(m),textColor:u.color,textAlign:E,textBaseline:u.baseline||"middle",textX:f,textY:l-(r?5:0),textFont:a[m].textStyle?this.getFont(u):s,rotation:S,showLabel:!1});return g},_buildBackground:function(){var e=this.timelineOption,t=e.padding,r=this._location.width,i=this._location.height;(e.borderWidth!==0||e.backgroundColor.replace(/\s/g,"")!="rgba(0,0,0,0)")&&this.shapeList.push(new n({zlevel:this._zlevelBase,hoverable:!1,style:{x:this._location.x-t[3],y:this._location.y-t[0],width:r+t[1]+t[3],height:i+t[0]+t[2],brushType:e.borderWidth===0?"fill":"both",color:e.backgroundColor,strokeColor:e.borderColor,lineWidth:e.borderWidth}}))},_buildControl:function(){var e=this,t=this.timelineOption,n=t.lineStyle,i=t.controlStyle;if(t.controlPosition=="none")return;var s=15,u=5,a;t.controlPosition=="left"?(a=this._location.x,this._location.x+=(s+u)*3):(a=this._location.x2-((s+u)*3-u),this._location.x2-=(s+u)*3);var f=this._location.y,l={zlevel:this._zlevelBase+1,style:{iconType:"timelineControl",symbol:"last",x:a,y:f,width:s,height:s,brushType:"stroke",color:i.normal.color,strokeColor:i.normal.color,lineWidth:n.width},highlightStyle:{color:i.emphasis.color,strokeColor:i.emphasis.color,lineWidth:n.width+1},clickable:!0};this._ctrLastShape=new r(l),this._ctrLastShape.onclick=function(){e.last()},this.shapeList.push(this._ctrLastShape),a+=s+u,this._ctrPlayShape=new r(o.clone(l)),this._ctrPlayShape.style.brushType="fill",this._ctrPlayShape.style.symbol="play",this._ctrPlayShape.style.status=this.timelineOption.autoPlay?"playing":"stop",this._ctrPlayShape.style.x=a,this._ctrPlayShape.onclick=function(){e._ctrPlayShape.style.status=="stop"?e.play():e.stop()},this.shapeList.push(this._ctrPlayShape),a+=s+u,this._ctrNextShape=new r(o.clone(l)),this._ctrNextShape.style.symbol="next",this._ctrNextShape.style.x=a,this._ctrNextShape.onclick=function(){e.next()},this.shapeList.push(this._ctrNextShape)},_buildChain:function(){var e=this.timelineOption,t=e.lineStyle;this._timelineShae={zlevel:this._zlevelBase,style:{x:this._location.x,y:this.subPixelOptimize(this._location.y,t.width),width:this._location.x2-this._location.x,height:this._location.height,chainPoint:this._chainPoint,brushType:"both",strokeColor:t.color,lineWidth:t.width,lineType:t.type},hoverable:!1,clickable:!0,onclick:this._onclick},this._timelineShae=new i(this._timelineShae),this.shapeList.push(this._timelineShae)},_buildHandle:function(){var e=this._chainPoint[this.currentIndex],t=e.symbolSize+1;t=t<5?5:t,this._handleShape={zlevel:this._zlevelBase+1,hoverable:!1,draggable:!0,style:{iconType:"diamond",n:e.n,x:e.x-t,y:this._location.y+this._location.height/4-t,width:t*2,height:t*2,brushType:"both",textPosition:"specific",textX:e.x,textY:this._location.y-this._location.height/4,textAlign:"center",textBaseline:"middle"},highlightStyle:{},ondrift:this._ondrift,ondragend:this._ondragend},this._handleShape=new r(this._handleShape),this.shapeList.push(this._handleShape)},_syncHandleShape:function(){if(!this.timelineOption.show)return;var e=this.timelineOption,t=e.checkpointStyle,n=this._chainPoint[this.currentIndex];this._handleShape.style.text=t.label.show?n.name:"",this._handleShape.style.textFont=n.textFont,this._handleShape.style.n=n.n,t.symbol=="auto"?this._handleShape.style.iconType=n.symbol!="none"?n.symbol:"diamond":(this._handleShape.style.iconType=t.symbol,t.symbol.match("star")&&(this._handleShape.style.n=t.symbol.replace("star","")-0||5,this._handleShape.style.iconType="star"));var r;t.symbolSize=="auto"?(r=n.symbolSize+2,r=r<5?5:r):r=t.symbolSize-0,this._handleShape.style.color=t.color=="auto"?n.color?n.color:e.controlStyle.emphasis.color:t.color,this._handleShape.style.textColor=t.label.textStyle.color=="auto"?this._handleShape.style.color:t.label.textStyle.color,this._handleShape.highlightStyle.strokeColor=this._handleShape.style.strokeColor=t.borderColor=="auto"?n.borderColor?n.borderColor:"#fff":t.borderColor,this._handleShape.style.lineWidth=t.borderWidth=="auto"?n.borderWidth?n.borderWidth:0:t.borderWidth-0,this._handleShape.highlightStyle.lineWidth=this._handleShape.style.lineWidth+1,this.zr.animate(this._handleShape.id,"style").when(500,{x:n.x-r,textX:n.x,y:this._location.y+this._location.height/4-r,width:r*2,height:r*2}).start("ExponentialOut")},_findChainIndex:function(e){var t=this._chainPoint,n=t.length;if(e<=t[0].x)return 0;if(e>=t[n-1].x)return n-1;for(var r=0;r=t[r].x&&e<=t[r+1].x)return Math.abs(e-t[r].x)=n[r-1].x-n[r-1].symbolSize?(e.style.x=n[r-1].x-n[r-1].symbolSize,i=r-1):(e.style.x+=t,i=this._findChainIndex(e.style.x));var s=n[i],o=s.symbolSize+2;e.style.iconType=s.symbol,e.style.n=s.n,e.style.textX=e.style.x+o/2,e.style.y=this._location.y+this._location.height/4-o,e.style.width=o*2,e.style.height=o*2,e.style.text=s.name;if(i==this.currentIndex)return!0;this.currentIndex=i;if(this.timelineOption.realtime){clearTimeout(this.playTicket);var u=this;this.playTicket=setTimeout(function(){u._setCurrentOption()},200)}return!0},__ondragend:function(){this.isDragend=!0},ondragend:function(e,t){if(!this.isDragend||!e.target)return;!this.timelineOption.realtime&&this._setCurrentOption(),t.dragOut=!0,t.dragIn=!0,t.needRefresh=!1,this.isDragend=!1,this._syncHandleShape();return},last:function(){return this.timelineOption.autoPlay&&this.stop(),this.currentIndex-=1,this.currentIndex<0&&(this.currentIndex=this.timelineOption.data.length-1),this._onFrame(),this.currentIndex},next:function(){return this.timelineOption.autoPlay&&this.stop(),this.currentIndex+=1,this.currentIndex>=this.timelineOption.data.length&&(this.currentIndex=0),this._onFrame(),this.currentIndex},play:function(e,t){return this._ctrPlayShape&&this._ctrPlayShape.style.status!="playing"&&(this._ctrPlayShape.style.status="playing",this.zr.modShape(this._ctrPlayShape.id),this.zr.refresh()),this.timelineOption.autoPlay=typeof t!="undefined"?t:!0,this.timelineOption.autoPlay||clearTimeout(this.playTicket),this.currentIndex=typeof e!="undefined"?e:this.currentIndex+1,this.currentIndex>=this.timelineOption.data.length&&(this.currentIndex=0),this._onFrame(),this.currentIndex},stop:function(){return this._ctrPlayShape&&this._ctrPlayShape.style.status!="stop"&&(this._ctrPlayShape.style.status="stop",this.zr.modShape(this._ctrPlayShape.id),this.zr.refresh()),this.timelineOption.autoPlay=!1,clearTimeout(this.playTicket),this.currentIndex},resize:function(){this.timelineOption.show&&(this.clear(),this._buildShape(),this._syncHandleShape())},setTheme:function(e){this.timelineOption=this.reformOption(o.clone(this.option.timeline)),this.timelineOption.padding=this.reformCssArray(this.timelineOption.padding),this.timelineOption.label.textStyle=o.merge(this.timelineOption.label.textStyle||{},this.ecTheme.textStyle),this.timelineOption.checkpointStyle.label.textStyle=o.merge(this.timelineOption.checkpointStyle.label.textStyle||{},this.ecTheme.textStyle),this.timelineOption.show&&e&&(this.clear(),this._buildShape(),this._syncHandleShape())},dispose:function(){this.clear(),this.shapeList=null,clearTimeout(this.playTicket)}},r.prototype.iconLibrary.timelineControl=l,o.inherits(f,t),e("../component").define("timeline",f),f}),r("zrender/loadingEffect/Bar",["require","./Base","../tool/util","../tool/color","../shape/Rectangle"],function(e){function s(e){t.call(this,e)}var t=e("./Base"),n=e("../tool/util"),r=e("../tool/color"),i=e("../shape/Rectangle");return n.inherits(s,t),s.prototype._start=function(e,t){var s=n.merge(this.options,{textStyle:{color:"#888"},backgroundColor:"rgba(250, 250, 250, 0.8)",effectOption:{x:0,y:this.canvasHeight/2-30,width:this.canvasWidth,height:5,brushType:"fill",timeInterval:100}}),o=this.createTextShape(s.textStyle),u=this.createBackgroundShape(s.backgroundColor),a=s.effectOption,f=new i({highlightStyle:n.clone(a)});f.highlightStyle.color=a.color||r.getLinearGradient(a.x,a.y,a.x+a.width,a.y+a.height,[[0,"#ff6400"],[.5,"#ffe100"],[1,"#b1ff00"]]);if(s.progress!=null){e(u),f.highlightStyle.width=this.adjust(s.progress,[0,1])*s.effectOption.width,e(f),e(o),t();return}return f.highlightStyle.width=0,setInterval(function(){e(u),f.highlightStyle.width=h&&(c[n].len=Math.ceil(Math.random()*400),r.xStart=-400,r.xEnd=-400+c[n].len,r.yStart=Math.ceil(Math.random()*p),r.yEnd=r.yStart),r.xStart+=c[n].animationX,r.xEnd+=c[n].animationX,e(c[n])}e(o),t()},a.timeInterval)},s}),r("zrender/loadingEffect/Ring",["require","./Base","../tool/util","../tool/color","../shape/Ring","../shape/Sector"],function(e){function o(e){t.call(this,e)}var t=e("./Base"),n=e("../tool/util"),r=e("../tool/color"),i=e("../shape/Ring"),s=e("../shape/Sector");return n.inherits(o,t),o.prototype._start=function(e,t){var o=n.merge(this.options,{textStyle:{color:"#07a"},backgroundColor:"rgba(250, 250, 250, 0.8)",effect:{x:this.canvasWidth/2,y:this.canvasHeight/2,r0:60,r:100,color:"#bbdcff",brushType:"fill",textPosition:"inside",textFont:"normal 30px verdana",textColor:"rgba(30, 144, 255, 0.6)",timeInterval:100}}),u=o.effect,a=o.textStyle;a.x==null&&(a.x=u.x),a.y==null&&(a.y=u.y+(u.r0+u.r)/2-5);var f=this.createTextShape(o.textStyle),l=this.createBackgroundShape(o.backgroundColor),c=u.x,h=u.y,p=u.r0+6,d=u.r-6,v=u.color,m=r.lift(v,.1),g=new i({highlightStyle:n.clone(u)}),y=[],b=r.getGradientColors(["#ff6400","#ffe100","#97ff00"],25),w=15,E=240;for(var S=0;S<16;S++)y.push(new s({highlightStyle:{x:c,y:h,r0:p,r:d,startAngle:E-w,endAngle:E,brushType:"fill",color:m},_color:r.getLinearGradient(c+p*Math.cos(E,!0),h-p*Math.sin(E,!0),c+p*Math.cos(E-w,!0),h-p*Math.sin(E-w,!0),[[0,b[S*2]],[1,b[S*2+1]]])})),E-=w;E=360;for(var S=0;S<4;S++)y.push(new s({highlightStyle:{x:c,y:h,r0:p,r:d,startAngle:E-w,endAngle:E,brushType:"fill",color:m},_color:r.getLinearGradient(c+p*Math.cos(E,!0),h-p*Math.sin(E,!0),c+p*Math.cos(E-w,!0),h-p*Math.sin(E-w,!0),[[0,b[S*2+32]],[1,b[S*2+33]]])})),E-=w;var x=0;if(o.progress!=null){e(l),x=this.adjust(o.progress,[0,1]).toFixed(2)*100/5,g.highlightStyle.text=x*5+"%",e(g);for(var S=0;S<20;S++)y[S].highlightStyle.color=S=20?-20:1,e(g);for(var n=0;n<20;n++)y[n].highlightStyle.color=n ");var u=-1;for(var a=0,f=o.length;a-1){o.splice(u,1),this._optionRestore.series[e][n].data.splice(u,1);var c=this.chart[i.type];c&&c.delMark(e,t.join(" > "),n)}return this},getDom:function(){return this.dom},getZrender:function(){return this._zr},getDataURL:function(e){if(!s)return"";if(this._chartList.length===0){var t="IMG"+this.id,n=document.getElementById(t);if(n)return n.src}var r=this.component.tooltip;r&&r.hideTip();switch(e){case"jpeg":break;default:e="png"}var i=this._option.backgroundColor;return i&&i.replace(" ","")=="rgba(0,0,0,0)"&&(i="#fff"),this._zr.toDataURL("image/"+e,i)},getImage:function(e){var t=this._optionRestore.title,n=document.createElement("img");return n.src=this.getDataURL(e),n.title=t&&t.text||"ECharts",n},getConnectedDataURL:function(t){if(!this.isConnected())return this.getDataURL(t);var n=this.dom,r={self:{img:this.getDataURL(t),left:n.offsetLeft,top:n.offsetTop,right:n.offsetLeft+n.offsetWidth,bottom:n.offsetTop+n.offsetHeight}},i=r.self.left,s=r.self.top,o=r.self.right,u=r.self.bottom;for(var a in this._connected)n=this._connected[a].getDom(),r[a]={img:this._connected[a].getDataURL(t),left:n.offsetLeft,top:n.offsetTop,right:n.offsetLeft+n.offsetWidth,bottom:n.offsetTop+n.offsetHeight},i=Math.min(i,r[a].left),s=Math.min(s,r[a].top),o=Math.max(o,r[a].right),u=Math.max(u,r[a].bottom);var f=document.createElement("div");f.style.position="absolute",f.style.left="-4000px",f.style.width=o-i+"px",f.style.height=u-s+"px",document.body.appendChild(f);var l=e("zrender").init(f),c=e("zrender/shape/Image");for(var a in r)l.addShape(new c({style:{x:r[a].left-i,y:r[a].top-s,image:r[a].img}}));l.render();var h=this._option.backgroundColor;h&&h.replace(/ /g,"")=="rgba(0,0,0,0)"&&(h="#fff");var p=l.toDataURL("image/png",h);return setTimeout(function(){l.dispose(),f.parentNode.removeChild(f),f=null},100),p},getConnectedImage:function(e){var t=this._optionRestore.title,n=document.createElement("img");return n.src=this.getConnectedDataURL(e),n.title=t&&t.text||"ECharts",n},on:function(e,t){return this._messageCenterOutSide.bind(e,t,this),this},un:function(e,t){return this._messageCenterOutSide.unbind(e,t),this},connect:function(e){if(!e)return this;this._connected||(this._connected={});if(e instanceof Array)for(var t=0,n=e.length;t=n/3?1:2),o=t.y+Math.sin(i)*r*(r>=n/3?1:2);i=t.angle-Math.PI/2,e.moveTo(s,o),e.lineTo(t.x+Math.cos(i)*r,t.y-Math.sin(i)*r),e.lineTo(t.x+Math.cos(t.angle)*n,t.y-Math.sin(t.angle)*n),e.lineTo(t.x-Math.cos(i)*r,t.y+Math.sin(i)*r),e.lineTo(s,o);return},getRect:function(e){if(e.__rect)return e.__rect;var t=e.width*2,n=e.x,r=e.y,i=n+Math.cos(e.angle)*e.r,s=r-Math.sin(e.angle)*e.r;return e.__rect={x:Math.min(n,i)-t,y:Math.min(r,s)-t,width:Math.abs(n-i)+t,height:Math.abs(r-s)+t},e.__rect},isCover:e("./normalIsCover")},n.inherits(r,t),r}),r("echarts/chart/gauge",["require","../component/base","./base","../util/shape/GaugePointer","zrender/shape/Text","zrender/shape/Line","zrender/shape/Rectangle","zrender/shape/Circle","zrender/shape/Sector","../config","../util/ecData","../util/accMath","zrender/tool/util","../chart"],function(e){function p(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this),this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("../util/shape/GaugePointer"),i=e("zrender/shape/Text"),s=e("zrender/shape/Line"),o=e("zrender/shape/Rectangle"),u=e("zrender/shape/Circle"),a=e("zrender/shape/Sector"),f=e("../config"),l=e("../util/ecData"),c=e("../util/accMath"),h=e("zrender/tool/util");return p.prototype={type:f.CHART_TYPE_GAUGE,_buildShape:function(){var e=this.series;this._paramsMap={};for(var t=0,n=e.length;t=110&&v<=250?"left":v<=70||v>=290?"right":"center",textBaseline:v>=10&&v<=170?"top":v>=190&&v<=350?"bottom":"middle",textFont:u,shadowColor:o.shadowColor,shadowBlur:o.shadowBlur,shadowOffsetX:o.shadowOffsetX,shadowOffsetY:o.shadowOffsetY}}))},_buildPointer:function(e){var t=this.series[e];if(!t.pointer.show)return;var n=t.max-t.min,i=t.pointer,s=this._paramsMap[e],o=this.parsePercent(i.length,s.radius[1]),a=this.parsePercent(i.width,s.radius[1]),f=s.center,c=this._getValue(e);c=c2?2:a/2,color:"#fff"}});l.pack(d,this.series[e],e,this.series[e].data[0],0,this.series[e].data[0].name,c),this.shapeList.push(d),this.shapeList.push(new u({zlevel:this._zlevelBase+2,hoverable:!1,style:{x:f[0],y:f[1],r:i.width/2.5,color:"#fff"}}))},_buildTitle:function(e){var t=this.series[e];if(!t.title.show)return;var n=t.data[0],r=typeof n.name!="undefined"?n.name:"";if(r!==""){var s=t.title,o=s.offsetCenter,u=s.textStyle,a=u.color,f=this._paramsMap[e],l=f.center[0]+this.parsePercent(o[0],f.radius[1]),c=f.center[1]+this.parsePercent(o[1],f.radius[1]);this.shapeList.push(new i({zlevel:this._zlevelBase+(Math.abs(l-f.center[0])+Math.abs(c-f.center[1]))=t)return n[r][1];return n[n.length-1][1]},_getSector:function(e,t,n,r,i,s,o){return new a({zlevel:this._zlevelBase,hoverable:!1,style:{x:e[0],y:e[1],r0:t,r:n,startAngle:r,endAngle:i,brushType:"fill",color:s,shadowColor:o.shadowColor,shadowBlur:o.shadowBlur,shadowOffsetX:o.shadowOffsetX,shadowOffsetY:o.shadowOffsetY}})},_getLabelText:function(e,t){if(e){if(typeof e=="function")return e.call(this.myChart,t);if(typeof e=="string")return e.replace("{value}",t)}return t},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()}},h.inherits(p,n),h.inherits(p,t),e("../chart").define("gauge",p),p}),r("echarts/chart/funnel",["require","../component/base","./base","zrender/shape/Text","zrender/shape/Line","zrender/shape/Polygon","../config","../util/ecData","../util/number","zrender/tool/util","zrender/tool/color","zrender/tool/area","../chart"],function(e){function h(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this),this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("zrender/shape/Text"),i=e("zrender/shape/Line"),s=e("zrender/shape/Polygon"),o=e("../config"),u=e("../util/ecData"),a=e("../util/number"),f=e("zrender/tool/util"),l=e("zrender/tool/color"),c=e("zrender/tool/area");return h.prototype={type:o.CHART_TYPE_FUNNEL,_buildShape:function(){var e=this.series,t=this.component.legend;this._paramsMap={},this._selected={},this.selectedMap={};var n;for(var r=0,i=e.length;r1?(i.height-(o-1)*h)/o:i.height,d,v=i.y,m=n.sort=="descending"?this._getItemWidth(e,u[0].value):a.parsePercent(n.minSize,i.width),g=n.sort=="descending"?1:0,y=i.centerX,b=[[y-m/2-(m===0?0:10),v-(m===0?10:5)],[y+m/2+(m===0?0:10),v-(m===0?10:5)]];for(var f=0,l=u.length;fc.getTextWidth(w,E)?T="#fff":T=l.reverse(n)):g.position=="left"?(S="right",x=b=="auto"?d.x-10:d.centerX-Math.max(o,u)/2-b):(S="left",x=b=="auto"?d.x+d.width+10:d.centerX+Math.max(o,u)/2+b);var N={zlevel:this._zlevelBase+1,style:{x:x,y:s+a/2,color:y.color||T,text:w,textAlign:y.align||S,textBaseline:y.baseline||"middle",textFont:E}};return m="emphasis",g=v[m].label||g,y=g.textStyle||y,b=v[m].labelLine.length||b,g.position=g.position||v.normal.label.position,w=this.getLabelText(e,t,m),E=this.getFont(y),T=n,g.position=="inner"||g.position=="inside"?(S="center",x=i+o/2,Math.max(o,u)/2>c.getTextWidth(w,E)?T="#fff":T=l.reverse(n)):g.position=="left"?(S="right",x=b=="auto"?d.x-10:d.centerX-Math.max(o,u)/2-b):(S="left",x=b=="auto"?d.x+d.width+10:d.centerX+Math.max(o,u)/2+b),N.highlightStyle={x:x,color:y.color||T,text:w,textAlign:y.align||S,textFont:E,brushType:"fill"},new r(N)},getLabelText:function(e,t,n){var r=this.series,i=r[e],s=i.data[t],o=this.deepQuery([s,i],"itemStyle."+n+".label.formatter");if(!o)return s.name;if(typeof o=="function")return o.call(this.myChart,i.name,s.name,s.value);if(typeof o=="string")return o=o.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}"),o=o.replace("{a0}",i.name).replace("{b0}",s.name).replace("{c0}",s.value),o},getLabelLine:function(e,t,n,r,s,o,u,a){var l=this.series[e],c=l.data[t],h=this._paramsMap[e].location,p=f.merge(f.clone(c.itemStyle)||{},l.itemStyle),d="normal",v=p[d].labelLine,m=p[d].labelLine.length,g=v.lineStyle||{},y=p[d].label;y.position=y.position||p.normal.label.position;var b;y.position=="inner"||y.position=="inside"?b=r+o/2:y.position=="left"?b=m=="auto"?h.x-10:h.centerX-Math.max(o,u)/2-m:b=m=="auto"?h.x+h.width+10:h.centerX+Math.max(o,u)/2+m;var w={zlevel:this._zlevelBase+1,hoverable:!1,style:{xStart:h.centerX,yStart:s+a/2,xEnd:b,yEnd:s+a/2,strokeColor:g.color||n,lineType:g.type,lineWidth:g.width}};return d="emphasis",v=p[d].labelLine||v,m=p[d].labelLine.length||m,g=v.lineStyle||g,y=p[d].label||y,y.position=y.position,y.position=="inner"||y.position=="inside"?b=r+o/2:y.position=="left"?b=m=="auto"?h.x-10:h.centerX-Math.max(o,u)/2-m:b=m=="auto"?h.x+h.width+10:h.centerX+Math.max(o,u)/2+m,w.highlightStyle={xEnd:b,strokeColor:g.color||n,lineType:g.type,lineWidth:g.width},new i(w)},_needLabel:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".label.show")},_needLabelLine:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".labelLine.show")},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()}},f.inherits(h,n),f.inherits(h,t),e("../chart").define("funnel",h),h}),r("echarts/component/categoryAxis",["require","./base","zrender/shape/Text","zrender/shape/Line","zrender/shape/Rectangle","../config","zrender/tool/util","zrender/tool/area","../component"],function(e){function a(e,n,r,i,s,o){if(i.data.length<1){console.error("option.data.length < 1.");return}t.call(this,e,n,r,i,s),this.grid=this.component.grid;for(var u in o)this[u]=o[u];this.refresh(i)}var t=e("./base"),n=e("zrender/shape/Text"),r=e("zrender/shape/Line"),i=e("zrender/shape/Rectangle"),s=e("../config"),o=e("zrender/tool/util"),u=e("zrender/tool/area");return a.prototype={type:s.COMPONENT_TYPE_AXIS_CATEGORY,_getReformedLabel:function(e){var t=typeof this.option.data[e].value!="undefined"?this.option.data[e].value:this.option.data[e],n=this.option.data[e].formatter||this.option.axisLabel.formatter;return n&&(typeof n=="function"?t=n.call(this.myChart,t):typeof n=="string"&&(t=n.replace("{value}",t))),t},_getInterval:function(){var e=this.option.axisLabel.interval;if(e=="auto"){var t=this.option.axisLabel.textStyle.fontSize,n=this.option.data,r=this.option.data.length;if(this.isHorizontal())if(r>3){var i=this.getGap(),s=!1,a,f,l=Math.floor(.5/i);l=l<1?1:l,e=Math.floor(15/i);while(!s&&e=0;c-=e){if(this.option.axisLabel.rotate!==0)f=t;else if(n[c].textStyle)f=u.getTextWidth(this._getReformedLabel(c),this.getFont(o.merge(n[c].textStyle,this.option.axisLabel.textStyle)));else{var h=this._getReformedLabel(c)+"",p=(h.match(/\w/g)||"").length,d=h.length-p;f=p*t*2/3+d*t}if(a3){var i=this.getGap();e=Math.floor(11/i);while(i*e-60?-u:0;if(this.isHorizontal()){var c=this.option.position=="bottom"?n.inside?this.grid.getYend()-i-1:this.grid.getYend()+1:n.inside?this.grid.getY()+1:this.grid.getY()-i-1,h;for(var p=l;p=0?f:0),o),e={_axisShape:"axisTick",zlevel:this._zlevelBase,hoverable:!1,style:{xStart:h,yStart:c,xEnd:h,yEnd:c+i,strokeColor:s,lineWidth:o}},this.shapeList.push(new r(e))}else{var d=this.option.position=="left"?n.inside?this.grid.getX()+1:this.grid.getX()-i-1:n.inside?this.grid.getXend()-i-1:this.grid.getXend()+1,v;for(var p=l;p=0?f:0),o),e={_axisShape:"axisTick",zlevel:this._zlevelBase,hoverable:!1,style:{xStart:d,yStart:v,xEnd:d+i,yEnd:v,strokeColor:s,lineWidth:o}},this.shapeList.push(new r(e))}},_buildAxisLabel:function(){var e,t=this.option.data,r=this.option.data.length,i=this.option.axisLabel.rotate,s=this.option.axisLabel.margin,u=this.option.axisLabel.clickable,a=this.option.axisLabel.textStyle,f;if(this.isHorizontal()){var l,c;this.option.position=="bottom"?(l=this.grid.getYend()+s,c="top"):(l=this.grid.getY()-s,c="bottom");for(var h=0;h0?this.option.position=="bottom"?"right":"left":this.option.position=="bottom"?"left":"right",e.rotation=[i*Math.PI/180,e.style.x,e.style.y]),this.shapeList.push(new n(this._axisLabelClickable(u,e)))}}else{var p,d;this.option.position=="left"?(p=this.grid.getX()-s,d="right"):(p=this.grid.getXend()+s,d="left");for(var h=0;h1?e-1:1)},getCoord:function(e){var t=this.option.data,n=t.length,r=this.getGap(),i=this.option.boundaryGap?r/2:0;for(var s=0;sthis.option.data.length-1)return this.isHorizontal()?this.grid.getXend():this.grid.getY();var t=this.getGap(),n=this.option.boundaryGap?t/2:0;return n+=e*t,this.isHorizontal()?n=this.grid.getX()+n:n=this.grid.getYend()-n,n},getNameByIndex:function(e){var t=this.option.data[e];return typeof t!="undefined"&&typeof t.value!="undefined"?t.value:t},getIndexByName:function(e){var t=this.option.data,n=t.length;for(var r=0;r0?this.option.position=="bottom"?"right":"left":this.option.position=="bottom"?"left":"right",e.rotation=[i*Math.PI/180,e.style.x,e.style.y]),this.shapeList.push(new n(this._axisLabelClickable(o,e)))}else{var c,h;this.option.position=="left"?(c=this.grid.getX()-s,h="right"):(c=this.grid.getXend()+s,h="left");for(var l=0;l=0?typeof t[h][l]!="undefined"?t[h][l]+=n:t[h][l]=n:typeof t[p][l]!="undefined"?t[p][l]+=n:t[p][l]=n,this.option.scale&&t[f].push(n)}}}for(var u in t){e=t[u];for(var l=0,c=e.length;l0?this.option.power:1:this._max>0?this._min=this._max/this.option.splitNumber:this._max=this._max/this.option.splitNumber),this._reformValue(this.option.scale)}else this._hasData=!0,this._min=this.option.min-0,this._max=this.option.max-0,this._customerValue()},_reformValue:function(e){var t=this.option.splitNumber,n=this.option.precision,r,i;n===0?i=this.option.power>1?this.option.power:1:(i=Math.pow(10,n),this._min*=i,this._max*=i,i=this.option.power);var s;if(this._min>=0&&this._max>=0){if(!e){while(this._max/i1?i/10:1,s=this._max-this._min,r=Math.ceil(s/t/i)*i,this._max=this._min+r*t}else if(this._min<=0&&this._max<=0){i=-i;if(!e){while(this._min/ii&&i!=-1)i/=10;n===0&&(this._min=Math.ceil(this._min/i)*i,this._max=Math.floor(this._max/i)*i)}i=i<-1?i/10:-1,s=this._min-this._max,r=-Math.ceil(s/t/i)*i,this._min=-r*t+this._max}else{s=this._max-this._min;while(s/ithis._max?this._max:e;var t;return this.isHorizontal()?t=this.grid.getX()+(e-this._min)/(this._max-this._min)*this.grid.getWidth():t=this.grid.getYend()-(e-this._min)/(this._max-this._min)*this.grid.getHeight(),t},getCoordSize:function(e){return this.isHorizontal()?Math.abs(e/(this._max-this._min)*this.grid.getWidth()):Math.abs(e/(this._max-this._min)*this.grid.getHeight())},getValueFromCoord:function(e){var t;return this.isHorizontal()?(e=ethis.grid.getXend()?this.grid.getXend():e,t=this._min+(e-this.grid.getX())/this.grid.getWidth()*(this._max-this._min)):(e=ethis.grid.getYend()?this.grid.getYend():e,t=this._max-(e-this.grid.getY())/this.grid.getHeight()*(this._max-this._min)),t.toFixed(2)-0}},o.inherits(u,t),e("../component").define("valueAxis",u),u}),r("echarts/component/axis",["require","./base","zrender/shape/Line","../config","../util/ecData","zrender/tool/util","zrender/tool/color","./categoryAxis","./valueAxis","../component"],function(e){function u(e,n,r,i,s,o){t.call(this,e,n,r,i,s),this.axisType=o,this._axisList=[],this.refresh(i)}var t=e("./base"),n=e("zrender/shape/Line"),r=e("../config"),i=e("../util/ecData"),s=e("zrender/tool/util"),o=e("zrender/tool/color");return u.prototype={type:r.COMPONENT_TYPE_AXIS,axisBase:{_buildAxisLine:function(){var e=this.option.axisLine.lineStyle.width,t=e/2,r={_axisShape:"axisLine",zlevel:this._zlevelBase+1,hoverable:!1};switch(this.option.position){case"left":r.style={xStart:this.grid.getX()-t,yStart:this.grid.getYend(),xEnd:this.grid.getX()-t,yEnd:this.grid.getY(),lineCap:"round"};break;case"right":r.style={xStart:this.grid.getXend()+t,yStart:this.grid.getYend(),xEnd:this.grid.getXend()+t,yEnd:this.grid.getY(),lineCap:"round"};break;case"bottom":r.style={xStart:this.grid.getX(),yStart:this.grid.getYend()+t,xEnd:this.grid.getXend(),yEnd:this.grid.getYend()+t,lineCap:"round"};break;case"top":r.style={xStart:this.grid.getX(),yStart:this.grid.getY()-t,xEnd:this.grid.getXend(),yEnd:this.grid.getY()-t,lineCap:"round"}}this.option.name!==""&&(r.style.text=this.option.name,r.style.textPosition=this.option.nameLocation,r.style.textFont=this.getFont(this.option.nameTextStyle),this.option.nameTextStyle.align&&(r.style.textAlign=this.option.nameTextStyle.align),this.option.nameTextStyle.baseline&&(r.style.textBaseline=this.option.nameTextStyle.baseline),this.option.nameTextStyle.color&&(r.style.textColor=this.option.nameTextStyle.color)),r.style.strokeColor=this.option.axisLine.lineStyle.color,r.style.lineWidth=e,this.isHorizontal()?r.style.yStart=r.style.yEnd=this.subPixelOptimize(r.style.yEnd,e):r.style.xStart=r.style.xEnd=this.subPixelOptimize(r.style.xEnd,e),r.style.lineType=this.option.axisLine.lineStyle.type,r=new n(r),this.shapeList.push(r)},_axisLabelClickable:function(e,t){return e?(i.pack(t,undefined,-1,undefined,-1,t.style.text),t.hoverable=!0,t.clickable=!0,t.highlightStyle={color:o.lift(t.style.color,1),brushType:"fill"},t):t},refixAxisShape:function(e,t){if(!this.option.axisLine.onZero)return;var n;if(this.isHorizontal()&&typeof t!="undefined")for(var r=0,i=this.shapeList.length;r2&&(e=[e[0],e[1]]);if(this.axisType=="xAxis"){if(!e[0].position||e[0].position!="bottom"&&e[0].position!="top")e[0].position="bottom";e.length>1&&(e[1].position=e[0].position=="bottom"?"top":"bottom");for(var t=0,n=e.length;t1&&(e[1].position=e[0].position=="left"?"right":"left");for(var t=0,n=e.length;t=0&&(o.isHorizontal()?t=o.getCoord(0):n=o.getCoord(0));if(typeof t!="undefined"||typeof n!="undefined"){s=i.length;while(s--)i[s].refixAxisShape(t,n)}},refresh:function(e){if(e||this._zrWidth!=this.zr.getWidth()||this._zrHeight!=this.zr.getHeight()){this.clear(),this.option=e||this.option,this.option.grid=this.reformOption(this.option.grid);var t=this.option.grid;this._zrWidth=this.zr.getWidth(),this._zrHeight=this.zr.getHeight(),this._x=this.parsePercent(t.x,this._zrWidth),this._y=this.parsePercent(t.y,this._zrHeight);var r=this.parsePercent(t.x2,this._zrWidth),i=this.parsePercent(t.y2,this._zrHeight);typeof t.width=="undefined"?this._width=this._zrWidth-this._x-r:this._width=this.parsePercent(t.width,this._zrWidth),typeof t.height=="undefined"?this._height=this._zrHeight-this._y-i:this._height=this.parsePercent(t.height,this._zrHeight),this._x=this.subPixelOptimize(this._x,t.borderWidth),this._y=this.subPixelOptimize(this._y,t.borderWidth),this.shapeList.push(new n({zlevel:this._zlevelBase,hoverable:!1,style:{x:this._x,y:this._y,width:this._width,height:this._height,brushType:t.borderWidth>0?"both":"fill",color:t.backgroundColor,strokeColor:t.borderColor,lineWidth:t.borderWidth}})),this.zr.addShape(this.shapeList[0])}}},i.inherits(s,t),e("../component").define("grid",s),s}),r("echarts/component/dataZoom",["require","./base","zrender/shape/Rectangle","zrender/shape/Polygon","../util/shape/Icon","../config","zrender/tool/util","../component","../component"],function(e){function u(e,n,r,i,s){t.call(this,e,n,r,i,s);var o=this;o._ondrift=function(e,t){return o.__ondrift(this,e,t)},o._ondragend=function(){return o.__ondragend()},this._fillerSize=28,this._handleSize=8,this._isSilence=!1,this._zoom={},this.option.dataZoom=this.reformOption(this.option.dataZoom),this.zoomOption=this.option.dataZoom,this._location=this._getLocation(),this._zoom=this._getZoom(),this._backupData(),this.option.dataZoom.show&&this._buildShape(),this._syncData()}var t=e("./base"),n=e("zrender/shape/Rectangle"),r=e("zrender/shape/Polygon"),i=e("../util/shape/Icon"),s=e("../config"),o=e("zrender/tool/util");return u.prototype={type:s.COMPONENT_TYPE_DATAZOOM,_buildShape:function(){this._buildBackground(),this._buildFiller(),this._buildHandle(),this._buildFrame();for(var e=0,t=this.shapeList.length;ep&&(h+=p,p=h-p,h-=p);var d=Math.round((p-h)/100*(this.zoomOption.orient=="horizontal"?this._location.width:this._location.height));return{start:h,end:p,start2:0,end2:100,size:d,xAxisIndex:i,yAxisIndex:o,seriesIndex:r,scatterMap:this._zoom.scatterMap||{}}},_backupData:function(){this._originalData={xAxis:{},yAxis:{},series:{}};var e=this.option.xAxis,t=this._zoom.xAxisIndex;for(var n=0,r=t.length;n1?1:0)),w=t/(i-(i>1?1:0)),E=1;this.zoomOption.orient=="horizontal"&&b<1?E=Math.floor(i*3/e):this.zoomOption.orient=="vertical"&&w<1&&(E=Math.floor(i*3/t));for(var a=0,f=i;athis._location.x?1:0),height:this._location.height-(t>this._location.y?1:0),lineWidth:1,brushType:"stroke",strokeColor:this.zoomOption.handleColor}},this._endFrameShape=o.clone(this._startFrameShape),this._startFrameShape=new n(this._startFrameShape),this._endFrameShape=new n(this._endFrameShape),this.shapeList.push(this._startFrameShape),this.shapeList.push(this._endFrameShape);return},_syncHandleShape:function(){this.zoomOption.orient=="horizontal"?(this._startShape.style.x=this._fillerShae.style.x-this._handleSize,this._endShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._zoom.start=Math.floor((this._startShape.style.x-this._location.x)/this._location.width*100),this._zoom.end=Math.ceil((this._endShape.style.x+this._handleSize-this._location.x)/this._location.width*100)):(this._startShape.style.y=this._fillerShae.style.y-this._handleSize,this._endShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._zoom.start=Math.floor((this._startShape.style.y-this._location.y)/this._location.height*100),this._zoom.end=Math.ceil((this._endShape.style.y+this._handleSize-this._location.y)/this._location.height*100)),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this._syncFrameShape(),this.zr.refresh()},_syncFillerShape:function(){var e,t;this.zoomOption.orient=="horizontal"?(e=this._startShape.style.x,t=this._endShape.style.x,this._fillerShae.style.x=Math.min(e,t)+this._handleSize,this._fillerShae.style.width=Math.abs(e-t)-this._handleSize,this._zoom.start=Math.floor((Math.min(e,t)-this._location.x)/this._location.width*100),this._zoom.end=Math.ceil((Math.max(e,t)+this._handleSize-this._location.x)/this._location.width*100)):(e=this._startShape.style.y,t=this._endShape.style.y,this._fillerShae.style.y=Math.min(e,t)+this._handleSize,this._fillerShae.style.height=Math.abs(e-t)-this._handleSize,this._zoom.start=Math.floor((Math.min(e,t)-this._location.y)/this._location.height*100),this._zoom.end=Math.ceil((Math.max(e,t)+this._handleSize-this._location.y)/this._location.height*100)),this.zr.modShape(this._fillerShae.id),this._syncFrameShape(),this.zr.refresh()},_syncFrameShape:function(){this.zoomOption.orient=="horizontal"?(this._startFrameShape.style.width=this._fillerShae.style.x-this._location.x,this._endFrameShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._endFrameShape.style.width=this._location.x+this._location.width-this._endFrameShape.style.x):(this._startFrameShape.style.height=this._fillerShae.style.y-this._location.y,this._endFrameShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._endFrameShape.style.height=this._location.y+this._location.height-this._endFrameShape.style.y),this.zr.modShape(this._startFrameShape.id),this.zr.modShape(this._endFrameShape.id)},_syncShape:function(){if(!this.zoomOption.show)return;this.zoomOption.orient=="horizontal"?(this._startShape.style.x=this._location.x+this._zoom.start/100*this._location.width,this._endShape.style.x=this._location.x+this._zoom.end/100*this._location.width-this._handleSize,this._fillerShae.style.x=this._startShape.style.x+this._handleSize,this._fillerShae.style.width=this._endShape.style.x-this._startShape.style.x-this._handleSize):(this._startShape.style.y=this._location.y+this._zoom.start/100*this._location.height,this._endShape.style.y=this._location.y+this._zoom.end/100*this._location.height-this._handleSize,this._fillerShae.style.y=this._startShape.style.y+this._handleSize,this._fillerShae.style.height=this._endShape.style.y-this._startShape.style.y-this._handleSize),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this.zr.modShape(this._fillerShae.id),this._syncFrameShape(),this.zr.refresh()},_syncData:function(e){var t,n,r,i,o;for(var u in this._originalData){t=this._originalData[u];for(var a in t){o=t[a];if(typeof o=="undefined")continue;i=o.length,n=Math.floor(this._zoom.start/100*i),r=Math.ceil(this._zoom.end/100*i),this.option[u][a].type!=s.CHART_TYPE_SCATTER?this.option[u][a].data=o.slice(n,r):this.option[u][a].data=this._synScatterData(a,o)}}!this._isSilence&&(this.zoomOption.realtime||e)&&this.messageCenter.dispatch(s.EVENT.DATA_ZOOM,null,{zoom:this._zoom},this.myChart)},_synScatterData:function(e,t){if(this._zoom.start===0&&this._zoom.end==100&&this._zoom.start2===0&&this._zoom.end2==100)return t;var n=[],r=this._zoom.scatterMap[e],i,s,o,u,a;this.zoomOption.orient=="horizontal"?(i=r.x.max-r.x.min,s=this._zoom.start/100*i+r.x.min,o=this._zoom.end/100*i+r.x.min,i=r.y.max-r.y.min,u=this._zoom.start2/100*i+r.y.min,a=this._zoom.end2/100*i+r.y.min):(i=r.x.max-r.x.min,s=this._zoom.start2/100*i+r.x.min,o=this._zoom.end2/100*i+r.x.min,i=r.y.max-r.y.min,u=this._zoom.start/100*i+r.y.min,a=this._zoom.end/100*i+r.y.min);var f;for(var l=0,c=t.length;l=s&&f[0]<=o&&f[1]>=u&&f[1]<=a&&n.push(t[l]);return n},__ondrift:function(e,t,n){this.zoomOption.zoomLock&&(e=this._fillerShae);var r=e._type=="filler"?this._handleSize:0;return this.zoomOption.orient=="horizontal"?e.style.x+t-r<=this._location.x?e.style.x=this._location.x+r:e.style.x+t+e.style.width+r>=this._location.x+this._location.width?e.style.x=this._location.x+this._location.width-e.style.width-r:e.style.x+=t:e.style.y+n-r<=this._location.y?e.style.y=this._location.y+r:e.style.y+n+e.style.height+r>=this._location.y+this._location.height?e.style.y=this._location.y+this._location.height-e.style.height-r:e.style.y+=n,e._type=="filler"?this._syncHandleShape():this._syncFillerShape(),this.zoomOption.realtime&&this._syncData(),!0},__ondragend:function(){this.isDragend=!0},ondragend:function(e,t){if(!this.isDragend||!e.target)return;!this.zoomOption.realtime&&this._syncData(),t.dragOut=!0,t.dragIn=!0,!this._isSilence&&!this.zoomOption.realtime&&this.messageCenter.dispatch(s.EVENT.DATA_ZOOM,null,{zoom:this._zoom},this.myChart),t.needRefresh=!1,this.isDragend=!1;return},ondataZoom:function(e,t){t.needRefresh=!0;return},absoluteZoom:function(e){this._zoom.start=e.start,this._zoom.end=e.end,this._zoom.start2=e.start2,this._zoom.end2=e.end2,this._syncShape(),this._syncData(!0);return},rectZoom:function(e){if(!e)return this._zoom.start=this._zoom.start2=0,this._zoom.end=this._zoom.end2=100,this._syncShape(),this._syncData(!0),this._zoom;var t=this.component.grid.getArea(),n={x:e.x,y:e.y,width:e.width,height:e.height};n.width<0&&(n.x+=n.width,n.width=-n.width),n.height<0&&(n.y+=n.height,n.height=-n.height);if(n.x>t.x+t.width||n.y>t.y+t.height)return!1;n.xt.x+t.width&&(n.width=t.x+t.width-n.x),n.y+n.height>t.y+t.height&&(n.height=t.y+t.height-n.y);var r,i=(n.x-t.x)/t.width,s=1-(n.x+n.width-t.x)/t.width,o=1-(n.y+n.height-t.y)/t.height,u=(n.y-t.y)/t.height;return this.zoomOption.orient=="horizontal"?(r=this._zoom.end-this._zoom.start,this._zoom.start+=r*i,this._zoom.end-=r*s,r=this._zoom.end2-this._zoom.start2,this._zoom.start2+=r*o,this._zoom.end2-=r*u):(r=this._zoom.end-this._zoom.start,this._zoom.start+=r*o,this._zoom.end-=r*u,r=this._zoom.end2-this._zoom.start2,this._zoom.start2+=r*i,this._zoom.end2-=r*s),this._syncShape(),this._syncData(!0),this._zoom},syncBackupData:function(e){var t,n=this._originalData.series,r=e.series,i;for(var s=0,o=r.length;s=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height?!0:!1}},r.inherits(i,t),i}),r("echarts/component/dataRange",["require","./base","zrender/shape/Text","zrender/shape/Rectangle","../util/shape/HandlePolygon","../config","zrender/tool/util","zrender/tool/area","zrender/tool/color","zrender/tool/color","../component"],function(e){function f(e,n,r,i,s){if(typeof this.query(i,"dataRange.min")=="undefined"||typeof this.query(i,"dataRange.max")=="undefined"){console.error("option.dataRange.min or option.dataRange.max has not been defined.");return}t.call(this,e,n,r,i,s);var o=this;o._ondrift=function(e,t){return o.__ondrift(this,e,t)},o._ondragend=function(){return o.__ondragend()},o._dataRangeSelected=function(e){return o.__dataRangeSelected(e)},this._selectedMap={},this._range={},this.refresh(i)}var t=e("./base"),n=e("zrender/shape/Text"),r=e("zrender/shape/Rectangle"),i=e("../util/shape/HandlePolygon"),s=e("../config"),o=e("zrender/tool/util"),u=e("zrender/tool/area"),a=e("zrender/tool/color");return f.prototype={type:s.COMPONENT_TYPE_DATARANGE,_textGap:10,_buildShape:function(){this._itemGroupLocation=this._getItemGroupLocation(),this._buildBackground(),this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable?this._buildGradient():this._buildItem();for(var e=0,t=this.shapeList.length;ep&&(h-=m)):(dv&&(d-=f))}return{x:h,y:d,width:s,height:o}},_getTextShape:function(e,t,n){return{zlevel:this._zlevelBase,style:{x:this.dataRangeOption.orient=="horizontal"?e:this._itemGroupLocation.x+this._itemGroupLocation.width/2,y:this.dataRangeOption.orient=="horizontal"?this._itemGroupLocation.y+this._itemGroupLocation.height/2:t,color:this.dataRangeOption.textStyle.color,text:n,textFont:this.getFont(this.dataRangeOption.textStyle),textBaseline:this.dataRangeOption.orient=="horizontal"?"middle":"top",textAlign:this.dataRangeOption.orient=="horizontal"?"left":"center"},hoverable:!1}},_getItemShape:function(e,t,n,r,i){return{zlevel:this._zlevelBase,style:{x:e,y:t+1,width:n,height:r-2,color:i},highlightStyle:{strokeColor:i,lineWidth:1},clickable:!0}},__ondrift:function(e,t,n){var r=this._calculableLocation.x,i=this._calculableLocation.y,s=this._calculableLocation.width,o=this._calculableLocation.height;return this.dataRangeOption.orient=="horizontal"?e.style.x+t<=r?e.style.x=r:e.style.x+t+e.style.width>=r+s?e.style.x=r+s-e.style.width:e.style.x+=t:e.style.y+n<=i?e.style.y=i:e.style.y+n+e.style.height>=i+o?e.style.y=i+o-e.style.height:e.style.y+=n,e._type=="filler"?this._syncHandleShape():this._syncFillerShape(e),this.dataRangeOption.realtime&&this._syncData(),!0},__ondragend:function(){this.isDragend=!0},ondragend:function(e,t){if(!this.isDragend||!e.target)return;!this.dataRangeOption.realtime&&this._syncData(),t.dragOut=!0,t.dragIn=!0,!this.dataRangeOption.realtime&&!1&&this.messageCenter.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:this._range.end,end:this._range.start}},this.myChart),t.needRefresh=!1,this.isDragend=!1;return},_syncShapeFromRange:function(){var e=this.dataRangeOption.range||{};this._range.end=typeof this._range.end!="undefined"?this._range.end:typeof e.start!="undefined"?e.start:0,this._range.start=typeof this._range.start!="undefined"?this._range.start:typeof e.end!="undefined"?e.end:100;if(this._range.start!=100||this._range.end!==0){if(this.dataRangeOption.orient=="horizontal"){var t=this._fillerShae.style.width;this._fillerShae.style.x+=t*(100-this._range.start)/100,this._fillerShae.style.width=t*(this._range.start-this._range.end)/100}else{var n=this._fillerShae.style.height;this._fillerShae.style.y+=n*(100-this._range.start)/100,this._fillerShae.style.height=n*(this._range.start-this._range.end)/100}this.zr.modShape(this._fillerShae.id),this._syncHandleShape()}},_syncHandleShape:function(){var e=this._calculableLocation.x,t=this._calculableLocation.y,n=this._calculableLocation.width,r=this._calculableLocation.height;this.dataRangeOption.orient=="horizontal"?(this._startShape.style.x=this._fillerShae.style.x,this._startMask.style.width=this._startShape.style.x-e,this._endShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._endMask.style.x=this._endShape.style.x,this._endMask.style.width=e+n-this._endShape.style.x,this._range.start=Math.ceil(100-(this._startShape.style.x-e)/n*100),this._range.end=Math.floor(100-(this._endShape.style.x-e)/n*100)):(this._startShape.style.y=this._fillerShae.style.y,this._startMask.style.height=this._startShape.style.y-t,this._endShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._endMask.style.y=this._endShape.style.y,this._endMask.style.height=t+r-this._endShape.style.y,this._range.start=Math.ceil(100-(this._startShape.style.y-t)/r*100),this._range.end=Math.floor(100-(this._endShape.style.y-t)/r*100)),this._syncShape()},_syncFillerShape:function(e){var t=this._calculableLocation.x,n=this._calculableLocation.y,r=this._calculableLocation.width,i=this._calculableLocation.height,s,o;this.dataRangeOption.orient=="horizontal"?(s=this._startShape.style.x,o=this._endShape.style.x,e.id==this._startShape.id&&s>=o?(o=s,this._endShape.style.x=s):e.id==this._endShape.id&&s>=o&&(s=o,this._startShape.style.x=s),this._fillerShae.style.x=s,this._fillerShae.style.width=o-s,this._startMask.style.width=s-t,this._endMask.style.x=o,this._endMask.style.width=t+r-o,this._range.start=Math.ceil(100-(s-t)/r*100),this._range.end=Math.floor(100-(o-t)/r*100)):(s=this._startShape.style.y,o=this._endShape.style.y,e.id==this._startShape.id&&s>=o?(o=s,this._endShape.style.y=s):e.id==this._endShape.id&&s>=o&&(s=o,this._startShape.style.y=s),this._fillerShae.style.y=s,this._fillerShae.style.height=o-s,this._startMask.style.height=s-n,this._endMask.style.y=o,this._endMask.style.height=n+i-o,this._range.start=Math.ceil(100-(s-n)/i*100),this._range.end=Math.floor(100-(o-n)/i*100)),this._syncShape()},_syncShape:function(){this._startShape.position=[this._startShape.style.x-this._startShape.style._x,this._startShape.style.y-this._startShape.style._y],this._startShape.style.text=this._textFormat(this._gap*this._range.start+this.dataRangeOption.min),this._startShape.style.color=this._startShape.highlightStyle.strokeColor=this.getColor(this._gap*this._range.start+this.dataRangeOption.min),this._endShape.position=[this._endShape.style.x-this._endShape.style._x,this._endShape.style.y-this._endShape.style._y],this._endShape.style.text=this._textFormat(this._gap*this._range.end+this.dataRangeOption.min),this._endShape.style.color=this._endShape.highlightStyle.strokeColor=this.getColor(this._gap*this._range.end+this.dataRangeOption.min),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this.zr.modShape(this._startMask.id),this.zr.modShape(this._endMask.id),this.zr.modShape(this._fillerShae.id),this.zr.refresh()},_syncData:function(){this.dataRangeOption.realtime&&this.messageCenter.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:this._range.end,end:this._range.start}},this.myChart)},__dataRangeSelected:function(e){var t=e.target._idx;this._selectedMap[t]=!this._selectedMap[t],this.messageCenter.dispatch(s.EVENT.REFRESH,null,null,this.myChart)},_textFormat:function(e,t){e=e.toFixed(this.dataRangeOption.precision),t=typeof t!="undefined"?t.toFixed(this.dataRangeOption.precision):"";if(this.dataRangeOption.formatter){if(typeof this.dataRangeOption.formatter=="string")return this.dataRangeOption.formatter.replace("{value}",e).replace("{value2}",t);if(typeof this.dataRangeOption.formatter=="function")return this.dataRangeOption.formatter.call(this.myChart,e,t)}return t!==""?e+" - "+t:e},refresh:function(e){if(e){this.option=e,this.option.dataRange=this.reformOption(this.option.dataRange),this.option.dataRange.padding=this.reformCssArray(this.option.dataRange.padding),this.dataRangeOption=this.option.dataRange;var t=this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable?100:this.dataRangeOption.splitNumber;this._colorList=a.getGradientColors(this.dataRangeOption.color,Math.max((t-this.dataRangeOption.color.length)/(this.dataRangeOption.color.length-1),0)+1);if(this._colorList.length>t){var n=this._colorList.length,r=[this._colorList[0]],i=n/(t-1);for(var s=1;sthis.dataRangeOption.max&&(e=this.dataRangeOption.max);if(this.dataRangeOption.calculable)if(e-(this._gap*this._range.start+this.dataRangeOption.min)>5e-5||e-(this._gap*this._range.end+this.dataRangeOption.min)<-0.00005)return null;var t=this._colorList.length-Math.ceil((e-this.dataRangeOption.min)/(this.dataRangeOption.max-this.dataRangeOption.min)*this._colorList.length);return t==this._colorList.length&&t--,this._selectedMap[t]?this._colorList[t]:null}},o.inherits(f,t),e("../component").define("dataRange",f),f}),r("echarts/chart/scatter",["require","../component/base","./base","../util/shape/Symbol","../component/axis","../component/grid","../component/dataZoom","../component/dataRange","../config","zrender/tool/util","zrender/tool/color","../chart"],function(e){function u(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this),this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("../util/shape/Symbol");e("../component/axis"),e("../component/grid"),e("../component/dataZoom"),e("../component/dataRange");var i=e("../config"),s=e("zrender/tool/util"),o=e("zrender/tool/color");return u.prototype={type:i.CHART_TYPE_SCATTER,_buildShape:function(){var e=this.series;this._sIndex2ColorMap={},this._symbol=this.option.symbolList,this._sIndex2ShapeMap={},this.selectedMap={},this.xMarkMap={};var t=this.component.legend,n=[],r,s,u,a;for(var f=0,l=e.length;fs[0]&&(i.min0=s[0],i.minY0=r[o][1],i.minX0=r[o][0]),i.max0s[1]&&(i.min1=s[1],i.minY1=r[o][1],i.minX1=r[o][0]),i.max1n.largeThreshold){this.shapeList.push(this._getLargeSymbol(r,this.getItemStyleColor(this.query(n,"itemStyle.normal.color"),o,-1)||this._sIndex2ColorMap[o]));continue}for(var u=0,a=r.length;u0&&this._buildSinglePosition(o,t[o]);this.addShapeList()},_buildSinglePosition:function(e,t){var n=this._mapData(t),r=n.locationMap,i=n.maxDataLength;if(i===0||r.length===0)return;this._buildHorizontal(t,i,r);for(var s=0,o=t.length;s0?a="left":Math.round(i[0])<0?a="right":a="center",f.margin?(p=f.margin,c=i[0]>0?p:-p,h=i[1]>0?p:-p,c=i[0]===0?0:c,h=i[1]===0?0:h,i=this._mapVector(i,o,1)):i=this._mapVector(i,o,1.2),u.textAlign=a,u.x=i[0]+c,u.y=i[1]+h,f.rotate?l=[f.rotate/180*Math.PI,i[0],i[1]]:l=[0,0,0],this.shapeList.push(new n({zlevel:this._zlevelBase,style:u,draggable:!1,hoverable:!1,rotation:l}))}},getIndicatorText:function(e,t){return this.polar[e]&&this.polar[e].__ecIndicator[t]&&this.polar[e].__ecIndicator[t].text},getDropBox:function(e){var e=e||0,t=this.polar[e],n=this.getCenter(e),r=t.__ecIndicator,i=r.length,s=[],o,u,a=t.type;if(a=="polygon"){for(var f=0;fu||u===undefined)&&(u=e),(e=1)a=Math.floor(a/l)*l-l;else{if(l===0)return u>0?(d=0,p=2*u):u===0?(d=0,p=100):(p=0,d=2*a),{max:p,min:d};c=(l+"").split(".")[1],h=c.length,a=Math.floor(a*Math.pow(10,h))/Math.pow(10,h)-l}Math.abs(a)<=l&&(a=0),u=a+Math.floor(l*Math.pow(10,h)*(n+1))/Math.pow(10,h)}else a=a>0?0:a;return r&&(u=u>0?u*1.2:u*.8,a=a>0?a*.8:a*1.2),{max:u,min:a}},_getDelta:function(e,t,n,r,i){var s=(e-t)/n,o,u;if(s>1)return i?(s=Math.ceil(s),s%i>0?(Math.ceil(s/i)+1)*i:s):(o=(s+"").split(".")[0],u=o.length,o.charAt(0)>=5?Math.pow(10,u):(o.charAt(0)-0+1)*Math.pow(10,u-1));if(s==1)return 1;if(s===0)return 0;if(!r){o=(s+"").split(".")[1],u=0;while(o[u]=="0")u++;return o[u]>=5?"0."+o.substring(0,u+1)-0+1/Math.pow(10,u):"0."+o.substring(0,u+1)-0+1/Math.pow(10,u+1)}return Math.ceil(s*Math.pow(10,r))/Math.pow(10,r)},getVector:function(e,t,n){e=e||0,t=t||0;var r=this.polar[e].__ecIndicator;if(t>=r.length)return;var i=this.polar[e].__ecIndicator[t],s=this.getCenter(e),o=i.vector,u=i.value.max,a=i.value.min,f;if(typeof n=="undefined")return s;switch(n){case"min":n=a;break;case"max":n=u;break;case"center":n=(u+a)/2}return u!=a?f=(n-a)/(u-a):f=.5,this._mapVector(o,s,f)},isInside:function(e){var t=this.getNearestIndex(e);return t?t.polarIndex:-1},getNearestIndex:function(e){var t,n,r,i,s,o,u,a,l;for(var c=0;ci[0])return{polarIndex:c,valueIndex:Math.floor((l+a/2)/a)%u}}},getIndicator:function(e){var e=e||0;return this.polar[e].indicator},refresh:function(e){e&&(this.option=e,this.polar=this.option.polar,this.series=this.option.series),this.clear(),this._buildShape()}},a.inherits(l,t),e("../component").define("polar",l),l}),r("echarts/chart/radar",["require","../component/base","./base","zrender/shape/Polygon","../component/polar","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../util/accMath","../chart"],function(e){function a(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this),this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("zrender/shape/Polygon");e("../component/polar");var i=e("../config"),s=e("../util/ecData"),o=e("zrender/tool/util"),u=e("zrender/tool/color");return a.prototype={type:i.CHART_TYPE_RADAR,_buildShape:function(){this.selectedMap={},this._symbol=this.option.symbolList,this._queryTarget,this._dropBoxList=[],this._radarDataCounter=0;var e=this.series,t=this.component.legend,n;for(var r=0,s=e.length;r\\/]*>)","gim"),r=new RegExp("\\s+","gim"),i=new RegExp("function.*?\\((.*?)\\)","i"),s=e.toString().replace(n,"").replace(r,"").match(i)[1].split(",");return t!==Object(t)&&(t={}),function(){var n=Array.prototype.slice.call(arguments),r=n[n.length-1];r&&r.constructor===Object?n.pop():r={};for(var i=0;i=0){var n=e.split(/\s*:\s*/),r=parseInt(n[2]||1,10),i,s;if(r===0)throw new Error("Slice step cannot be zero");return r>0?(i=parseInt(n[0]||0,10),s=parseInt(n[1]||t,10)):(i=parseInt(n[0]||t-1,10),s=parseInt(n[1]||-1,10)),i<0&&(i=t+i),s<0&&n[1]&&(s=t+s),r>0?(i=Math.max(Math.min(t,i),0),s=Math.max(Math.min(t,s),0)):(i=Math.max(Math.min(t-1,i),-1),s=Math.max(Math.min(t-1,s),-1)),[i,s,r]}var i=parseInt(e,10);i<0&&(i=t+i);if(i<0||i>t)throw new Error(N(e));return i=Math.max(Math.min(t-1,i),0),[i,i+1,1]}function g(e){var t=e[0];for(var n=1;n=this._shape.length)throw new Error(T(e[r]));if(e.length<=1)return this;var i=n.slice();for(var r=0;r=Math.ceil(e.length/2);s--)i[e[r]]=e[s],i[e[s]]=e[r];return this._transposelike(i,t)}),swapaxes:t(function(e,t,n){return this.transpose([e,t],n)}),rollaxis:t(function(e,t,n){if(e>=this._shape.length)throw new Error(T(e));var r=[];for(var i=0;i=this._shape.length||e<0)throw new Error(T(e));var s=this._shape.slice();s.splice(e,1);if(t&&!S(s,t._shape))throw new Error(x(s,t._shape));t||(t=new v(this._dtype),t.initFromShape(s));var o=t._array,u=w(this._shape,e),a=this._shape[e],f=u*a;return n.call(this,o,i,f,a,u),t}return r.call(this,i)},_withPreprocess2:function(e,t,n,r){var i=this._array;if(!this._size)return;if(t&&!S(this._shape,t._shape))throw new Error(x(this._shape,t._shape));t||(t=new v(this._dtype),t.initFromShape(this._shape));var s=t._array;if(typeof e!="undefined"){e<0&&(e=this._shape.length+e);if(e>=this._shape.length||e<0)throw new Error(T(e));if(e>=this._shape.length)throw new Error(T(e));var o=w(this._shape,e),u=this._shape[e],a=o*u;n.call(this,s,i,a,u,o)}else t.reshape([this._size]),r.call(this,s,i);return t},max:t(function(){function e(e,t,n,r,i){var s=0;for(var o=0;of&&(f=c),a+=i}e[s++]=f}}function t(e){var t=e[0];for(var n=1;nt&&(t=e[n]);return t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}()),min:t(function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h,a=c),f+=i}e[s++]=a}}function t(e){var t=e[0],n=0;for(var r=1;rt&&(n=r,t=e[r]);return n}return function(n,r){return this._withPreprocess1(n,r,e,t)}}()),argmin:t(function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h),a+=i}e[s++]=l-f}}function t(e){var t=e[0],n=e[0];for(var r=1;rn&&(n=e[r]);return n-t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}()),sort:t(function(e,t){e<0&&(e=this._shape.length+e);var n;t==="ascending"?n=function(e,t){return e-t}:t==="descending"&&(n=function(e,t){return t-e});var r=this._array,i=w(this._shape,e),s=this._shape[e],o=i*s,u=new Array(s);for(var a=0;as&&(s=a)}var f=s-i,l=t-e;for(var u=0;u=0&&y>=0){if(e._shape[g]==1)i.unshift(t._shape[y]),b=e.repeat(t._shape[y],g);else if(t._shape[y]==1)i.unshift(e._shape[g]),E=t.repeat(e._shape[g],y);else{if(t._shape[y]!=e._shape[g])throw new Error(x(e._shape,t._shape));i.unshift(e._shape[g])}g--,y--}for(var T=g;T>=0;T--)i.unshift(e._shape[T]);for(var T=y;T>=0;T--)i.unshift(t._shape[T]);e=b,t=E}if(!r)r=new v(this._dtype),r.initFromShape(i);else if(!S(i,r._shape))throw new Error(x(i,r._shape));var N=r._array,C,k,L,A;d?(C=t._shape.length-1,k=!1,L=e,A=t._array):m?(C=e._shape.length-1,k=!0,A=t,L=e._array):(C=Math.abs(e._shape.length-t._shape.length),k=e._shape.length>=t._shape.length,L=e._array,A=t._array);var O=w(i,C),M=i[C],_=O*M,D=r._size/_,P,H,B,j=0;if(k)if(m)for(var F=0;F0)for(var c=r[0];cr[1];c+=r[2])l(e+1,t+s*c);else if(r[2]>0)for(var c=r[0];cr[1];c+=r[2])for(var h=0;hthis._shape.length)throw new Error("Too many indices");var o=i.length,u;s.length?(t=new v(this._dtype),t.initFromShape(s),u=t._array):u=[];var a=this._array,f=0;return l(0,0),s.length?t:u[0]},set:function(e,t){typeof e=="number"&&(e=e.toString());var n=E(this._shape),r=this._parseRanges(e),i=r[0],s=r[1];if(i.length>this._shape.length)throw new Error("Too many indices");var o=typeof t=="number",u=i.length,a=this._array;if(o)var f=t;else{if(!S(s,t.shape()))throw new Error(x(s,t.shape()));var f=t._array}var l=0,c=function(e,t){var r=i[e],s=n[e];if(e0)for(var h=r[0];hr[1];h+=r[2])c(e+1,t+s*h);else if(r[2]>0)for(var h=r[0];hr[1];h+=r[2])for(var p=0;pu)throw new Error(N(e[a]));if(e[a]=0&&h>=0){if(l[c]===1)p=t.repeat(f[h],c);else if(l[c]!==f[h])throw new Error(x(l,f));c--,h--}t=p;var d=w(this._shape,n),u=this._shape[n],m=u*d,y=this._size/m,b=e.length,E=new Uint32Array(y*b),S=0;for(var T=0;T=0){for(var a=_-1;a>=D;a--)i[P--]=A[a];_=D,D=E[--M];for(var a=0;a=0;a--)i[P--]=A[a];return this._array=i,this._shape=k,this._size=L,this}),append:function(){console.warn("TODO")},"delete":t(function(e,t){var n=this._array;typeof e=="number"&&(e=[e]);var r=this._size;typeof t=="undefined"&&(this._shape=[r],t=0);var i=w(this._shape,t),s=this._shape[t],o=i*s,u=0;for(var a=0;as)throw new Error(N(l));if(l=0){var a=Math.floor((u[1]-u[0])/u[2]);a=a<0?0:a,r.push(a)}i++}for(;i0&&(E.style.brushType="both"),E.highlightStyle.lineWidth>0&&(E.highlightStyle.brushType="both"),a.pack(E,this.chordSeries[0],0,t[m],m,g.name);if(u){var S=[b+w]/2;S%=360;var x=S<=90||S>=270;S=S*Math.PI/180;var T=[Math.cos(S),-Math.sin(S)],N=this.showScaleText?35+h:h,C=l.scale([],T,this.outerRadius+N);l.add(C,C,this.center);var k={zlevel:this._zlevelBase-1,hoverable:!1,style:{text:g.name,textAlign:x?"left":"right",color:f}};c?(k.rotation=x?S:Math.PI+S,x?k.style.x=this.outerRadius+N:k.style.x=-this.outerRadius-N,k.style.y=0,k.position=this.center):(k.style.x=C[0],k.style.y=C[1]),k.style.textColor=this.deepQuery([g,this.chordSerieSample],"itemStyle.normal.label.textStyle.color")||"#fff",k.style.textFont=this.getFont(this.deepQuery([g,this.chordSerieSample],"itemStyle.normal.label.textStyle")),k=new r(k),this.shapeList.push(k)}E.onmouseover=d(m),E.onmouseout=v(),E=new s(E),this.shapeList.push(E),this.sectorShapes.push(E)}},_buildChords:function(e,t){var n=e.length;if(!n)return;var r=e[0][0].length,i=this.chordSerieSample.itemStyle.normal.chordStyle.lineStyle,s=this.chordSerieSample.itemStyle.emphasis.chordStyle.lineStyle;for(var u=0;u=270,E={zlevel:this._zlevelBase-1,hoverable:!1,style:{x:w?this.outerRadius+this.scaleLineLength+4:-this.outerRadius-this.scaleLineLength-4,y:0,text:Math.round(b.shift()*10)/10+t,textAlign:w?"left":"right"},position:this.center.slice(),rotation:w?[h/180*Math.PI,0,0]:[(h+180)/180*Math.PI,0,0]};E=new r(E),this.shapeList.push(E),g+=this.scaleUnitAngle*5}}},normalizeValue:function(e){var t=[],n=(new c(e)).max(),r,i;n>1e4?(r="k",i=.001):n>1e7?(r="m",i=1e-6):n>1e10?(r="b",i=1e-9):(r="",i=1);for(var s=0;s0&&(i=1/Math.sqrt(i),e[0]=t[0]*i,e[1]=t[1]*i),e},negate:function(e,t){return e[0]=-t[0],e[1]=-t[1],e},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e},set:function(e,t,n){return e[0]=t,e[1]=n,e}}:t=e("zrender/tool/vector");var r=typeof Float32Array=="undefined"?Array:Float32Array;i.prototype.beforeUpdate=function(){for(var e=0;e=e&&this.bbox[1]<=t&&this.bbox[3]>=t},i.prototype.setBBox=function(e,t,n,r){this.bbox[0]=e,this.bbox[1]=t,this.bbox[2]=n,this.bbox[3]=r,this.size=(n-e+r-t)/2},i.prototype._newSubRegion=function(){var e=this.subRegions[this.nSubRegions];return e||(e=new i,this.subRegions[this.nSubRegions]=e),this.nSubRegions++,e},i.prototype._addNodeToSubRegion=function(e){var t=this.findSubRegion(e.position[0],e.position[1]),n=this.bbox;if(!t){var r=(n[0]+n[2])/2,i=(n[1]+n[3])/2,s=(n[2]-n[0])/2,o=(n[3]-n[1])/2,u=e.position[0]>=r?1:0,a=e.position[1]>=i?1:0,t=this._newSubRegion();t.setBBox(u*s+n[0],a*o+n[1],(u+1)*s+n[0],(a+1)*o+n[1])}t.addNode(e)},i.prototype._updateCenterOfMass=function(e){this.centerOfMass==null&&(this.centerOfMass=t.create());var n=this.centerOfMass[0]*this.mass,r=this.centerOfMass[1]*this.mass;n+=e.position[0]*e.mass,r+=e.position[1]*e.mass,this.mass+=e.mass,this.centerOfMass[0]=n/this.mass,this.centerOfMass[1]=r/this.mass},a.prototype.initNodes=function(e,t,n){this.temperature=1;var r=e.length/2;this.nodes.length=0;var i=typeof n!="undefined";for(var o=0;o0&&this.applyNodeGravity(o)}for(var n=0;n0){t.scale(f,f,1/p);var d=t.len(s.speedPrev);d>0&&(p=Math.min(p/d,this.maxSpeedIncrease)*d,t.scaleAndAdd(l,s.speedPrev,f,p))}var v=t.len(l),h=Math.min(v,100)/(v+.1);t.scale(l,l,h),t.add(s.position,s.position,l)}},a.prototype.applyRegionToNodeRepulsion=function(){var e=t.create();return function(r,i){if(r.node)this.applyNodeToNodeRepulsion(r.node,i,!0);else{t.sub(e,i.position,r.centerOfMass);var s=e[0]*e[0]+e[1]*e[1];if(s>this.barnesHutTheta*r.size*r.size){var o=this._k*this._k*(i.mass+r.mass)/(s+1);t.scaleAndAdd(i.force,i.force,e,o*2)}else for(var u=0;u0?u=a*f/(l*l):l<=0&&(u=a*10*f)}else u=a*f/o;s||t.scaleAndAdd(r.force,r.force,e,u*2),t.scaleAndAdd(i.force,i.force,e,-u*2)}}(),a.prototype.applyEdgeAttraction=function(){var e=t.create();return function(r){var i=r.source,s=r.target;t.sub(e,i.position,s.position);var o=t.len(e),u;this.edgeWeightInfluence===0?u=1:this.edgeWeightInfluence==1?u=r.weight:u=Math.pow(r.weight,this.edgeWeightInfluence);var a;if(this.preventOverlap){o=o-i.size-s.size;if(o<=0)return}var a=-u*o/this._k;t.scaleAndAdd(i.force,i.force,e,a),t.scaleAndAdd(s.force,s.force,e,-a)}}(),a.prototype.applyNodeGravity=function(){var e=t.create();return function(n){t.sub(e,this.center,n.position),this.width>this.height?e[1]*=this.width/this.height:e[0]*=this.height/this.width;var r=t.len(e)/100;this.strongGravity?t.scaleAndAdd(n.force,n.force,e,r*this.gravity*n.mass):t.scaleAndAdd(n.force,n.force,e,this.gravity*n.mass/(r+1))}}(),a.prototype.updateBBox=function(){var e=Infinity,t=Infinity,n=-Infinity,r=-Infinity;for(var i=0;i.01){for(var r=0;r=0});var s,o;this._filteredLinks=x(this._rawLinks,function(e,r){s=e.source,o=e.target;var i=!0,u=typeof s=="string"?n[s]:t[s];typeof u=="undefined"&&(u=-1),u>=0?e.source=u:i=!1;var u=typeof o=="string"?n[o]:t[o];return typeof u=="undefined"&&(u=-1),u>=0?e.target=u:i=!1,e.rawIndex=r,i})},_initLayout:function(e){var t=this._filteredNodes,n=this._filteredLinks,r=this._nodeShapes,i=t.length,s=this.query(e,"minRadius"),o=this.query(e,"maxRadius");this._steps=e.steps||1,this._coolDown=e.coolDown||.99;var u=this.parseCenter(this.zr,e.center),f=this.parsePercent(e.size,this.zr.getWidth()),p=this.parsePercent(e.size,this.zr.getHeight()),d=Math.min(f,p),v=[];for(var m=0;m>1^-(o&1),u=u>>1^-(u&1),o+=r,u+=i,r=o,i=u,n.push([o/1024,u/1024])}return n}var r={world:{getGeoJson:function(n){e(["./geoJson/world_geo"],function(e){n(t(e))})}},china:{getGeoJson:function(n){e(["./geoJson/china_geo"],function(e){n(t(e))})}},"南海诸岛":{textCoord:[126,25],getPath:function(e,t){var n=[[[0,3.5],[7,11.2],[15,11.9],[30,7],[42,.7],[52,.7],[56,7.7],[59,.7],[64,.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]]],r="",i=e[0],s=e[1];for(var o=0,u=n.length;o180?n-360:n,r=90-(r/e.scale.y+e.offset.y),[n,r]}function o(e,t){return n.offset=e.offset,n.scale=e.scale,t instanceof Array?n.makePoint([t[0]*1,t[1]*1]):n.makePoint([t.x*1,t.y*1])}var n={formatPoint:function(e){return[(e[0]<-168.5&&e[1]>63.8?e[0]+360:e[0])+168.5,90-e[1]]},makePoint:function(e){var t=this,r=t.formatPoint(e);t._bbox.xmin>e[0]&&(t._bbox.xmin=e[0]),t._bbox.xmaxe[1]&&(t._bbox.ymin=e[1]),t._bbox.ymaxr&&(t.xmin=r),t.xmaxi&&(t.ymin=i),t.ymax1&&(r={geometry:{coordinates:r.geometry.coordinates.slice(5,6),type:r.geometry.type},id:r.id,properties:r.properties,type:r.type});break}return{type:"FeatureCollection",features:[r]}},_getProjectionData:function(e,t,n){var r=this._mapDataMap[e].projection,i=[],s=this._mapDataMap[e].bbox||r.getBbox(t,this._specialArea[e]),o;this._mapDataMap[e].hasRoam?o=this._mapDataMap[e].transform:o=this._getTransform(s,n,this._mapDataMap[e].rate);var u=this._mapDataMap[e].lastTransform||{scale:{}},a;o.left!=u.left||o.top!=u.top||o.scale.x!=u.scale.x||o.scale.y!=u.scale.y?(a=r.geoJson2Path(t,o,this._specialArea[e]),u=h.clone(o)):(o=this._mapDataMap[e].transform,a=this._mapDataMap[e].pathArray),this._mapDataMap[e].bbox=s,this._mapDataMap[e].transform=o,this._mapDataMap[e].lastTransform=u,this._mapDataMap[e].pathArray=a;var f=[o.left,o.top];for(var l=0,c=a.length;lv?(d=v*.75,l=h*d):(v=d,d=v*.75,c=p*v);var m={OffsetLeft:a[0],OffsetTop:a[1],scale:{x:d,y:v}},g=o.geoJson2Path(n,m);return this._getSingleProvince(t,g[0],s)},_getSingleProvince:function(e,t,n){var r,i=t.properties.name,s=m[i]||[0,0];if(g[i])r=this.geo2pos(e,g[i]);else if(t.cp)r=[t.cp[0]+s[0],t.cp[1]+s[1]];else{var o=this._mapDataMap[e].bbox;r=this.geo2pos(e,[o.left+o.width/2,o.top+o.height/2]),r[0]+=s[0],r[1]+=s[1]}return t.name=this._nameChange(e,i),t.position=n,t.textX=r[0],t.textY=r[1],t},_getTransform:function(e,t,n){var r=this.series,i,s,o,u,a,f,l,c=this.zr.getWidth(),h=this.zr.getHeight(),p=Math.round(Math.min(c,h)*.02);for(var d in t)i=r[d].mapLocation||{},o=i.x||o,a=i.y||a,f=i.width||f,l=i.height||l;s=this.parsePercent(o,c),s=isNaN(s)?p:s,u=this.parsePercent(a,h),u=isNaN(u)?p:u,typeof f=="undefined"?f=c-s-2*p:f=this.parsePercent(f,c),typeof l=="undefined"?l=h-u-2*p:l=this.parsePercent(l,h);var v=e.width,m=e.height,g=f/n/v,y=l/m;g>y?(g=y*n,f=v*g):(y=g,g=y*n,l=m*y);if(isNaN(o)){o=o||"center";switch(o+""){case"center":s=Math.floor((c-f)/2);break;case"right":s=c-f}}if(isNaN(a)){a=a||"center";switch(a+""){case"center":u=Math.floor((h-l)/2);break;case"bottom":u=h-l}}return{left:s,top:u,width:f,height:l,baseScale:1,scale:{x:g,y:y}}},_buildMap:function(e,t,n,l){var p=this.series,d=this.component.legend,v=this.component.dataRange,m,g,y,b,w,E=this.ecTheme.map,S,x,T,N,C,k;for(var L=0,A=t.length;L=r&&e<=r+s&&t>=i&&t<=i+o)return u}return},__onmousewheel:function(e){if(this.shapeList.length<=0)return;var t=e.event,n=d.getX(t),r=d.getY(t),i=d.getDelta(t),s=this._findMapTypeByPos(n,r);if(s){d.stop(t);var o=this._mapDataMap[s].transform,u=o.left,a=o.top,f=o.width,c=o.height,h=this.pos2geo(s,[n-u,r-a]);if(i>0){i=1.2;if(typeof this._scaleLimitMap[s].max!="undefined"&&o.baseScale>=this._scaleLimitMap[s].max)return}else{i=1/1.2;if(typeof this._scaleLimitMap[s].min!="undefined"&&o.baseScale<=this._scaleLimitMap[s].min)return}o.baseScale*=i,o.scale.x*=i,o.scale.y*=i,o.width=f*i,o.height=c*i,this._mapDataMap[s].hasRoam=!0,this._mapDataMap[s].transform=o,h=this.geo2pos(s,h),o.left-=h[0]-(n-u),o.top-=h[1]-(r-a),this._mapDataMap[s].transform=o,this.clearEffectShape(!0);for(var p=0,v=this.shapeList.length;p0?this.clear():this.backupShapeList(),this._buildShape(),this.zr.refreshHover()},ondataRange:function(e,t){this.component.dataRange&&(this.refresh(),t.needRefresh=!0);return},pos2geo:function(e,t){return this._mapDataMap[e].transform?this._mapDataMap[e].projection.pos2geo(this._mapDataMap[e].transform,t):null},getGeoByPos:function(e,t){if(!this._mapDataMap[e].transform)return null;var n=[this._mapDataMap[e].transform.left,this._mapDataMap[e].transform.top];return t instanceof Array?(t[0]-=n[0],t[1]-=n[1]):(t.x-=n[0],t.y-=n[1]),this.pos2geo(e,t)},geo2pos:function(e,t){return this._mapDataMap[e].transform?this._mapDataMap[e].projection.geo2pos(this._mapDataMap[e].transform,t):null},getPosByGeo:function(e,t){if(!this._mapDataMap[e].transform)return null;var n=this.geo2pos(e,t);return n[0]+=this._mapDataMap[e].transform.left,n[1]+=this._mapDataMap[e].transform.top,n},getMapPosition:function(e){return this._mapDataMap[e].transform?[this._mapDataMap[e].transform.left,this._mapDataMap[e].transform.top]:null},dispose:function(){this.clear(),this.shapeList=null,this.effectList=null,this._isAlive=!1,this._needRoam&&(this.zr.un(p.EVENT.MOUSEWHEEL,this._onmousewheel),this.zr.un(p.EVENT.MOUSEDOWN,this._onmousedown))}},h.inherits(y,n),h.inherits(y,t),e("../chart").define("map",y),y}),r("echarts/util/mapData/geoJson/an_hui_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3415",properties:{name:"六安市",cp:[116.3123,31.8329],childNum:6},geometry:{type:"Polygon",coordinates:["@@„„nJ‚UXUVƒ°U„ÑnU@mlLVaVln@@bn@VU@xlb@lšLnKlšƒVI„JšUVxnI@lVL@b„Ž°VX@˜b„x„nVVUnVVnU‚›@kX@VwV@„al¥UUnUWa@ƒ@wĸU„LU¥lKUa@aUI@alLVaUƒ¯anƒWkUKm@XV@VaXlW@aU_UWVUƒI¯@ma¯W¯™™I@UU@WWU@U@@UU@VkV@@WUUm@UaU@„lK@IUK„L@KWmXUWaXI@ƒ@a@a@U@U@KV¥lw„k°b²JVIVKlV@UX„la„Ul`œUVLVVVUšJ„U@Lnm@_VK@KUIW@™J@Xk@WW@U—ƒmm™XmWk@kK@aUUƒVmmkUwUmWL™@WmU@™UJmUULkKWakLWVkIƒlƒwULƒW@X°lUJ@°ULƒWV—wmJ@bmb¯Vkm@@WkWm¯wƒL@lkXƒWmXym¯UImJUbkV™@Vn¯„@V@lUbƒ@mk@maUxmlUbULWn@J—LmKUkWKkwUKƒbm„X„WxkVUKmLkVV@JUUWL@xkJUUƒV@X@VVlUbVX@xk¤šx‚¼œxWxn„‚nn@Þ¼„JVb°aVn„@šmlnXU„JlbVlkz@‚lUŽlXJmxVxXnWxXÈWlUŽ@šUxU@VX@xUL@šUÆmLnV@lWXk@@JlbXblnlJ"],encodeOffsets:[[118710,33351]]}},{type:"Feature",id:"3408",properties:{name:"安庆市",cp:[116.7517,30.5255],childNum:9},geometry:{type:"Polygon",coordinates:["@@n°‚znW„XlW@k„K°xXn‚l@Xn@l‚°Una@anI˜xXU„ŽVK@¯VIkW¯X@‚„VK„x„klJXUlKXblLVKnVVIšŽV@Xn‚@šŽXKVnVxlŽnn„UlmV@²óUkV™lW„b„lƒšƒn@VVVIn@lw@WVIXblV„@Èx‚aUaVIVVnKVLšK„ƒln@b²K@»U£ƒÑķƒġÝÅb™K™a@Im@ۍ„@kWÓkkmKÅnóJƒUÅ£›W@w„ĕ@wĉţ¯¯ƒUkK±l¯Uƒ¥UÑkÝUķ»Ý¥¯™JƒIUŽVbUl¯ÈV¼VJU¼Vb@bkLUl@„VJ@bUXǚ@lkVmXmKkLVxš‚Ž„VƒL@VkVVVlzW˜kbmLUUUbVbUV™šlÒnJlUnLllUL@bU„Vx„l‚LXVƦÈVU¦WJ"],encodeOffsets:[[118834,31759]]}},{type:"Feature",id:"3411",properties:{name:"滁州市",cp:[118.1909,32.536],childNum:7},geometry:{type:"Polygon",coordinates:["@@š„@`nnl@„xšK@X°KXV˜IXVlbXVWnX‚lL@šÈ»‚LVan@VJ„êVVn@‚X@laÞbVaƒyn@„_‚xnWVXnWl@VnUVkI@l‚nXKVLVV@V@kW@LlVô„@J@bVnnKnkVa@»lç@ƒnwšKma™UUUVњ@n™mWXalI@alVn@VwUaVU„@„nlaôJnU„VVXlJšaXXVK@UšV@VWx@nXVWšXVšUlLUbV‚ULVVnUVbUbVbš@@a„KÆnnKVK@U@UU@@a„@Vƒ°¯ÈJVIlķ@aa˜UaVKU_@mkxUI@aƒUlyU@@™wkKWmUbUnUVWbkJW_J@bƒn@Vm@@KULk@V@@bVbÅm@LW@UVVbkK@UkKWL@VULUKWIUJUbkK@_WVXU›Jka@XƒVa@kšy@aVIUUW@@m„UlLœKWÑUKVan@UkVmmIXKƒaVaUwVU@UmykU¯@±UUL@WUIVUU@KkIWaƒaU@kUUaǃUó»mKƒk¯@y@kWK@bkI¯`mn™l¯XWlkVUzUJlbUbVJl@nnm„@VULV`XnWƗbmUUn™JmUknƒJ¯km@ƒyk@kU›xL@VUbmnn¤lX@`™z@JmaULUVl@Xn@xllkXWa—aW@UVmUbƒ@mVXšWxXbWbUŽƒÒnVVnVVUL"],encodeOffsets:[[120004,33520]]}},{type:"Feature",id:"3418",properties:{name:"宣城市",cp:[118.8062,30.6244],childNum:7},geometry:{type:"Polygon",coordinates:["@@Vb@„XL˜JXxlIXxlVlV@I²¤šnlUnVšU@VULWVUJ@Lnb@lV@UnV@@VVVlLnbnJ‚UVkUUVWn@@anUVnVJVIV‚@@nUJVbUb‚„@VUbVK@bn@VbnIlxkllXVlXKWUXUlL°¤UVVb@bš„UlkXW‚ƒxXz@‚„Ila„UlƒnUlJVInVÆJ„U„LVUnV„K°@VnlVnxV@XLlK@wVL@KnUlJXU˜bnKVLX„lUw@VWlLXKm@@a„@VLnmlIVVnKn@škVašVlwk@@a@k@ƒVIUa™@maUa@wna@kmWƒ™UUmVUIVǗ@aƒKm™aƒ™kU™J@InmUUaVa„k‚lX@Vk@m@VU@wnK@alKVUkUkKƒbmUkmƒ@U£WVk@@UÝbbƒaÇx@b@WVUa¯ƒ@wVwUUV@VwnK@KWaŁ@KšIUyUI@WmXó™UbWaKm™@km@IUyƒIUaWKƒx@zUKUL@llVUnkLVVkJWX@VUKUVƒIkVWakb@VWb@n@JkXUlmL@xkL@`VxšLUÈUJ@Vm@@bmIUlUL@VUVVbknm@mKUw™KVÈ@J@LV±kkJUIƒl"],encodeOffsets:[[120803,31247]]}},{type:"Feature",id:"3412",properties:{name:"阜阳市",cp:[115.7629,32.9919],childNum:6},geometry:{type:"Polygon",coordinates:["@@V™nƒš@ša„k°aš±@‚¥@UUI@aUmlwUUx›b@¥XU@mmI@a@Kn@@_W@@W„I@mšUVVXUl@XaV@‚K@I@a„LX@aVI°K@KVL„UUw‚yXkšK@kšKÆbXnlK@k@a„JlU@w@U@»@aXKWƒn_‚JXkVKnƒ@°LlKXƒW@¯Uƒ@aUK@kmJUw™VƒIUJ™„kŽmL™K@kka@wUVm@@am@UkUbkK@nmVƒÒ¯VU„WVVmIƒƒULk@ƒƒma@kkKƒƒ@nUbUamU™`UUVUkKVkkƒW@@bkmƒnƒmUXVKXVƒL@VƒbU„m‚™bVXJ@nmKÅI@KWKUXVJUL@VUKUX@KUKWL@LUJmaXXm@kVVV@L@VUL@VlK@L@V@LUK@VUb@UUU@°@nVxU`‚Lkn@`@XVJ@X™Vm„k@UKmV¯LVVn±Wm@Ub@JlLUl„@VLk„@lmVVn@bnV@V°IV™šaVJXI°K°V@XXVlVVU„nšKVlUš„bWXnV@bV`U„„@@m@@‚ƒ@nxmn@bXVlL@¤nb„Ul¦šVVUnJVU„Vl@@bÞL"],encodeOffsets:[[118418,34392]]}},{type:"Feature",id:"3413",properties:{name:"宿州市",cp:[117.5208,33.6841],childNum:5},geometry:{type:"Polygon",coordinates:["@@@UWU@bkW@aWU@aUIkWV™lLXb„lVIUVV@‚mn@V_n@VaUK@I‚@UašanJVU„@lV„UVnnKVVlaUa„I@wnK‚Lnll@nVlk@wVKXkl@@b„bUJ@V‚U@U„UUyVk@aVUXwlWXX‚WU¹@aU™@WUI@mlUšn„J@Il@šaXbV@VKl@XxVL@W„IšJlb„@„al@„IUUm@@aVK@¥¯—@mUķ¯bWƒk£Vm@akm@VaÅ@UVWaƒ@UJWkƒJ—UƒbWbU@UlƒXk@ƒamV@K¯nk@ƒlU@Uxmz@bU`ÇbUbÅVm£U@Ww™x@akLUK@UlakwUJWVkLmaUal@n_ƒmVUnKVUUmÅXWa™@kJmx@XUJ@bVLXxl@VVUVV„UbkLWbU@@lUVV„VVX„›K@XkJ@nU@@bV@VxUVlb„U@xXLWŽn@UxVbVĊ„V@b@XV`mnkJ@kUKmbƒaU@VbnbÆx@XU@@`k@@bl„™@@bkL@WƒakXWaU@Vmkx@XWW@@wUUUbƒJ™U¯V™@¯ÞU@WxXŽlL@bkb@ŽlVlnb™JW@kkU@mbkaWJ—IVlmz¯`UnU@mb™@@„ƒ`@bkVlœnV@b@šV@„aVxn@Vx‚KXnl@nbVK„bVK@a„_V@Vƒ„w@W„LlwnK@UmIU@VWš@šUÈ@lKnal„wš@@V°@šaUmlUUw@„ƒV@@UXK"],encodeOffsets:[[119836,35061]]}},{type:"Feature",id:"3410",properties:{name:"黄山市",cp:[118.0481,29.9542],childNum:5},geometry:{type:"Polygon",coordinates:["@@lXnlWX@VUJVnUJVzXJVx„kVJlI²l‚U@K@IUǚLVxnLn@lmUaVU@UVKVknJ@an@@UVIVǙKUw@_lK@wnKVklW@I@mXa@UlaXblU„JVUVL@UXWlIUUlKVmkU@kVKVL@y„wXLVb„JVz@Jlnš@nŽ‚LXbVaôšnW@la@UVWUa@@a@mk@WIk@VwUa¯¥m@UUVK@ImK@aX£ƒkK›ÅV™a™™ƒ_@±ƒakXWW—LƒƒƒnU@@a@¯mK@L™JUWwUV™VmbXX@lWLn`mzUJUb™Lƒ„k@makVWmkX™ambkKknƒaƒ@ƒaƒb@‚U@Unm@—ƒWVƒ@VbUbUJWIk@@lmL@°UVUVm„nš™@@kmWkb@xƒ_m@@aU@b@JlŽUz™lWxXn„@‚b²@l`„IVl„UlL@VšK„nVbUl@VlIn@@b„bVWUk‚@@bX@Valb@bnb°Vn@„xVKlbVnV@V‚x„L@ln@UXVV‚L˜"],encodeOffsets:[[120747,31095]]}},{type:"Feature",id:"3414",properties:{name:"巢湖市",cp:[117.7734,31.4978],childNum:5},geometry:{type:"Polygon",coordinates:["@@VV@blL@ŽXlWnnšnŽ˜„@VXXl@@WšIX@VJ@LšxŎxlnšŽ@bXJVblX@VVbUVn@VbUVlb@LnJVbVLV‚XLšÒVL„ÒšV„bVIVylUXk°Wšknm°_lJ@aXL@l‚z°@„lnLô¼V‚È„VUUaVKU@WW@@UUa@knmVLlaV@„a@kšak±@UmwkKmk™lj™ÝUUkL@mlIVmnÝWkkUÝ@KƑĉ™a@»ƒmma@mX™¤¯Uƒw@ƒ@UU@bU±±L@akmƒ„™LUKmLUUUJVbbÇwƒ@kUWaUJ@Xkxm@UJUUm@™„k„ƒ‚ƒakXUšVl±ôU@kn"],encodeOffsets:[[119847,32007]]}},{type:"Feature",id:"3416",properties:{name:"亳州市",cp:[116.1914,33.4698],childNum:4},geometry:{type:"Polygon",coordinates:["@@lU@Un@@anUlw@KVmUwlaX_lKna@KU@@kWKUU@ankW™XK˜@@V²VVIÈU@al@VaÈamK@wU™@klaUƒV@XƒVUU»WUUbkmUkVmk@aÈw@mWU@VkIkVWKUÑķXȭºU¯lƒ@kkLWmÅa™L@l™LWlzVxƒVUK@L¯LUJ@bWƒK@b@JLU@Wbk@WVUU™V@nƒJ@XX@@`m@@L@bnJ@nWV@¦œa‚wVVkxVn@bVJ@V¦@Ž™²¯bƒl™b™@m„UšUŽƒŽ@¼ƒ¦Xb‚UV`@nnxUxWLkUkVWKkV@XV@@VVL@VX„@lVV@L@blL@`šL@xXKVL‚@„VnUš@lwnU@ml@XnV@@UVW°LnalƒUI@aUK@a‚a@U„kXW@I@mWL@UXK@UVW@U‚@@k„Wn‚@@V„@XblaVxšL@bVKXb„IlJ"],encodeOffsets:[[119183,34594]]}},{type:"Feature",id:"3417",properties:{name:"池州市",cp:[117.3889,30.2014],childNum:4},geometry:{type:"Polygon",coordinates:["@@„V°°ĊŤ@xƒĖ@xœXƤ„VôIÆmnLllXÔ@lƒÜŽn@@JšbšLÆaĢÞĸ„°VVUUKVanK@UV@VL„VVn„ln@‚xnklxXamk@WV@Xa˜@naVk„Klk™@mkUWwkJWw—IWK@ƒUaUwWIUyVIUmVI@UXWmkkW‚—KUUVWm@@kƒKw@U‚UUmkaULƒwm@¯Uma@akaUbW@@a@VlUXƒa@am@kJ@UVkUaƒm™L@UkKƒVUkƒJk_±@aƒ@WmXwÇkkaVaUa±ƒœwV@VkƒwnyUaW@UU¯amLk@m™@kmmU™™¯K@L@lUX¯ƒWlkXƒŽVb„bƒVUL@J@LVKnlJXnlb@`nXlalV@bnL@Vnb˜¼@lXbWlkL™K@zUJmIUxUVUVmX","@@llUL@VlxšL@a@UƒwXa¯@"],encodeOffsets:[[119543,30781],[120061,31152]]}},{type:"Feature",id:"3401",properties:{name:"合肥市",cp:[117.29,32.0581],childNum:4},geometry:{type:"Polygon",coordinates:["@@„L„xV‚ĊLÞkšVlVVXaWaXwW™nU„@‚anVVUX@˜bXblWkk@wWmk@VUVKnb@Išy@_kWm£nmVa@U‚KœwlVl@„zn@°l„IlmnVšIVmnV˜aXÅWmU_VK@Unƒmmk@UIVakaƒa™UƒÑUK™ÑWKUUKUamI@KkaVUUam@VUUa@UkWUaWI@a™kmōw™wUL@`mn@KƒV™IUVUUUK›Vk_ƒVkbWƒ@VkUULUJ±I¯aƒlkxU¦@L@V@V@b@b@„WJXbWVXn@LƒKVL@JkLƒŽV@Vbn@VV@XU@UlV@@VV@V@XXV@@VšJ°š°Xnb°@„JUVVXV`@bkXWŽUbU@WŽn@VLXlm„°bV„UbkK@bVJ@bVbkLV¦ƒKķV@x@„XbmVVVk¦"],encodeOffsets:[[119678,33323]]}},{type:"Feature",id:"3403",properties:{name:"蚌埠市",cp:[117.4109,33.1073],childNum:4},geometry:{type:"Polygon",coordinates:["@@VÒXLlUlJ@UXV@nÇx@bnlUVllnVaXVV¼UVW„U@V„²wVV@Vl@„VnwlIš@XbÆWVnUVmLUV„nm`k@VbnblKXUVIlxkb@VVLlK@bšwXxV@n¤ÆUVaÈaV_@anyVwV@„kl@°m@LnU„bl@„WVkV@Xa„a˜V„IXl‚IV‚„@XbVUÆ@XKWwUkmW@_UmnIlJXkWKXmV@‚w@_XV@Kl@kU@KlX@@UUUUKWLm@klJVUUmk@mXUWmXwƒ`m@„zUbÝakbW@m@UUƒéUIm@UbKǼ@™kKWXmWUkaWU—JWU¯L@W™Lƒwk@mm@_™ƒÅl™UVkmWUnV@VWLUb™bƑĬ¯l"],encodeOffsets:[[119543,33722]]}},{type:"Feature",id:"3402",properties:{name:"芜湖市",cp:[118.3557,31.0858],childNum:4},geometry:{type:"Polygon",coordinates:["@@„bVaV@XllLXU°ŽlL@V@VUnVl¯Ikš›VUVU@@b@lUXUWmb„n@¼šbƒĊ‚LÞ@lVXlmÞUnkJ@nlKVVšÞXklWVaVI@aUKn»lL@Kn@‚XXwlm@mn°@„V@Wy„wXlWVk™ƒ@aUaVU¯£kKWVXVWLUkkWlkkwmJUam@@aULVa@UƒVaUaVI@m‚@UUJUIUmmV@bm@UXVVUlVmImakKUU@UU@VmU@@kma@KVIXUVK@U™VmUkV™m±£@JkU@nlšk‚ƒLUlmb—@WbU@@XnlWb"],encodeOffsets:[[120814,31585]]}},{type:"Feature",id:"3406",properties:{name:"淮北市",cp:[116.6968,33.6896],childNum:3},geometry:{type:"MultiPolygon",coordinates:[["@@lnnK@¦n@@V‚V„@@VV@nIV„V@VW²a@b@bVnUVVV@V™z@lš@°UšV„IVaVV@x@ŽXX@WlwUnV@XblW„b@XlK@aš@kƒ@al@@_V@@WÅwmaUaV@„bnaVL@llInmU_@W@aƒUUĉUaVwm@XWK@wƒVkaVUUwU@@aV@@mlI@WœLWƒUUUƒVU@kV@XalKVaUƒVUUUk@WwUK@aVI@WƒUk@@UUU±xkb@lVš@xnLÇbUbk@@bÇVUJ±U@U—@WLXšml@bVVXL@lV@@LmbkLW`kbVxUn@LkxmV@bm@@VkV"],["@@VVVkV@¥@UV@U@VUUJƒkWakKUšlXVJ@bXV@blX@aXV@V"]],encodeOffsets:[[[119183,34594]],[[119836,35061]]]}},{type:"Feature",id:"3404",properties:{name:"淮南市",cp:[116.7847,32.7722],childNum:2},geometry:{type:"Polygon",coordinates:["@@°kƒīšaVaXK@U‚UVmnXUlšVÆkVKUUUmmU„ÑkU™UÝlĉKUƒwƒKƒbU@UxW@@lœmVUUVmUUƒmƒw—aW„kL¯K@Žm„ULWlIm`X„WL@b@¼@V@xkVƒI@b@l@lk„V°Ȯ¹ĸW"],encodeOffsets:[[119543,33722]]}},{type:"Feature",id:"3405",properties:{name:"马鞍山市",cp:[118.6304,31.5363],childNum:2},geometry:{type:"Polygon",coordinates:["@@šNJnllLnxV@laXLVKma„aXbVI„bVKVVVIVyn@n_ƒƒW@@ƒ„UnJlUVVXlLnaUWlV@VV„IXW@_W@XK@K@UVUUwVamÑXmmwƒw™KUnUK™çU@ƒJƒU¯@mŽ@nknWxWm@@LkKm¼VL@bUJUbkXWl"],encodeOffsets:[[121219,32288]]}},{type:"Feature",id:"3407",properties:{name:"铜陵市",cp:[117.9382,30.9375],childNum:3},geometry:{type:"MultiPolygon",coordinates:[["@@„ÒV¤@¼V²@aVV@Ž@„„x°Vš£nW‚@nbnaVXVW@k@aV@VUœUl™°JUkVm@U@UkK¯WVkKWkU@Ubƒakwmlwm@ƒkUmƒUUKU@@VmLUbVLUV¯U"],["@@LllUL@VlxšL@a@UƒwXamK"]],encodeOffsets:[[[120522,31529]],[[120094,31146]]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/ao_men_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"8200",properties:{name:"澳门",cp:[113.5715,22.1583],childNum:1},geometry:{type:"Polygon",coordinates:["@@HQFMDIDGBI@E@EEKEGCEIGGEKEMGSEU@CBEDAJAP@F@LBT@JCHMPOdADCFADAB@LFLDFFP@DAB@@AF@D@B@@FBD@FADHBBHAD@FAJ@JEDCJI`gFIJW"],encodeOffsets:[[116325,22699]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/bei_jing_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"110228",properties:{name:"密云县",cp:[117.0923,40.5121],childNum:1},geometry:{type:"Polygon",coordinates:["@@vIHZDZQtDLNMXIbHRCXXITbJ@H`LGPRDDJNCLHTOCWFGvGBUJMKGFO^IHWXITQCI’Y^AXGfRˆDXF`DJOLB~G\\DZIHHpErUVMhHb]\\M†BVF@FTP`@zTbD\\@~M\\K`H^EVODWICAakAQXoIcCOCIgGYNWFWNGGKKGaJEGMEIKYJUT_J_Go@_SyQaSFMEGTcYOQLIIi@EKAUPCV[EEXQCW|aMUMAaYCYNIDGGACIMGGSKDQGaF_C[GaB@GOIiOKAYL“mI@CN]F[SWWAcKKI@HMUimEKbeYQYISNUOcBKPIFBNgvDPGZYFSf]CMSIWGEUFgDIQ[MeDMJS@RR@LphFPCHaBAJKF@J]IBJO@HlO@@RKAMPJHCNDJTHFP@ZGNANBRFH@J_fM^ONJNF\\VTDJHDON@XRND\\XRCPVETCLBVKDFJINHRGPRV@\\CLJN@VbXbLVT"],encodeOffsets:[[119561,41684]]}},{type:"Feature",id:"110116",properties:{name:"怀柔区",cp:[116.6377,40.6219],childNum:1},geometry:{type:"Polygon",coordinates:["@@JHTVHXCHPfnDJGHNDJSB[JSBGVSAOH@PMPuDEHHXZN@PHF@ZLJ@LHVYJA\\OFWP]BMtMBSRGV[JeVAPQVIFENMD¡–@^NV\\JH@NNL@NM\\kTQ\\I^FNIpBHGTBFFAZQfKDIXQTLXFXNNVMVHRGpCFLlRLEVBBH`IVO\\G`RDPAXLXBXORHZEHTDLLN@VGTMrQNFPeASKG@GMOAKBYMK@GTUHUXSHMVDNMOUEOZMJML@^KRACMZEZMRQLUHE@OFENPR@DI\\ChMHIDG\\GJMDWHCKGMDCIQCHO_K@GaIJSWWQDaGWJMNCKRsCYGYuJUSaKaW@UIMDK@[QUHOGQJMEILCAUDKFSOUQD[WMC‚Q@WPMGCCIUSE[IMPMN]`e@IEGAQBMHM@YEOSGCIDMIGNOLB@QP@GkP@AI^J@ILEBIbADGEOog@KQQWSekWQQUOFKZLF@PUNmIaHIUeBCTSHENcJa@_IWSaGu`GLSBKJQFOXGDXVQVOBIHcDSJWBEFGTMH[^mLaXcHiKElTRKtFXZ`MHMPCNRDxZˆB\\ICIHK@KŽHbIVFZ@BPnGTGbDXRDJaZKRiGEFSFEJhjFNZFjn"],encodeOffsets:[[119314,41552]]}},{type:"Feature",id:"110111",properties:{name:"房山区",cp:[115.8453,39.7163],childNum:1},geometry:{type:"Polygon",coordinates:["@@h@bl@HRJDZ``TA\\VVD^H`\\pF\\JŒ`JGv@ZO\\GPSTEjPTR`FnEbDTDHEhLFMTK@ETSPULKEI@OVISKSJACEQNQbV˜IXGDIN@dMB[IIBcN]ZHNLP@XOWCFWŠCNRHTpATD@^NVNLED@Rh@jCEF}E[OOHUEW]W@QGGDIQSH_MmFmCUT_K]i@MHCMW—FCF‹E{BMHMPOHKS]CFNGBELDH_@BcAKOACESAOBELaXAROB@FODMEDWJAG[aE@UM@DImEWJMC@OeCA{aE[@{L@MINUCQXKfUJORCHqJBF@TCXWNQX]M[EAJO@@KMBQJIC]EWMCCUBEBFHKDOTMBGNGF]MWDBRDdMDQVyE@LPVHDCP@JVVMTG~HNSH[CmRUvHPHBbA\\PTNRC\\YNJ€PRARPJDDR"],encodeOffsets:[[118343,40770]]}},{type:"Feature",id:"110229",properties:{name:"延庆县",cp:[116.1543,40.5286],childNum:1},geometry:{type:"Polygon",coordinates:["@@^AXOPEB[ZIGU@KKI@YGE@OYMGWFGvCNO@OPGTBHUTA\\ITACIGMIHmCOeDGGWSUIGimYEEMgiFITEFEjHLQbYCIWQaCSHmHAOY@UEaJG@LGLDJ[J‡AwYQCDMNONGY_EWLsSQFkMO[NWAIGaIYL@HMBOKiOQDWEUDMQSF_QIUBWdg@[NaAKQ@M]OQ@WhgLUMMFYQDIRCEUZOOCIOJ[KIUMKL@HIDKVEBM`HJAJSJUdBLGNEdMBMO[BYEWJSNKNaD]PE\\SjOT_RQVEZPpƒNQXfŠNA~lNG`@PNLp¼RFLfbdKbATUh@FSNWjGFZVLFHVA~X¨PPROfFJbNJPLFbENJPrEFNPFRHDDJdENJLVEPBJTVTHGHFRFH@PXP\\ORQHW\\BjWFDERLPPBbB\\E`B\\D\\L`@F]FCnJ^AZL"],encodeOffsets:[[119262,41751]]}},{type:"Feature",id:"110109",properties:{name:"门头沟区",cp:[115.8,39.9957],childNum:1},geometry:{type:"Polygon",coordinates:["@@V@XMnGPY²‰JQNEhH\\AZMPDVTTDZCPiJkHSHCjIdFtEHITCNITQEKUAMCEIKCECABYESKFWAKBEIIHABGDCKCAIHMHALKEI\\CFIBILIJQZS]BBEECS@E@@C]COKI@CABAAEEDMGƒCH]A[M@CJWH—JaUMRFRBDTITLUJ@PFJKLOVST@FSLENgKGFSCaCmF_ESQiOSFOT[HYPu@IH‹_[IoE_[]GUC[USB__CYQI@Gakg@qZeHQNMNV\\FVLPgJAFJPRLCH[XcPELUT[JiV_EELFTADBXRTRLJC@fHXHHbPd`fR@NfT`@TLplHMpCEJHJBVLFŽ@JT‚VnG^KXDXHNVGRLRXFJVdDHSNWLGfEzA"],encodeOffsets:[[118635,41113]]}},{type:"Feature",id:"110114",properties:{name:"昌平区",cp:[116.1777,40.2134],childNum:1},geometry:{type:"Polygon",coordinates:["@@VNLJI\\JPPDYPFVQDCJZRNEVNhKXgR@^P@NLRbB\\Mh@XcVARJE`RTCNFV€XRCjPPLNA@GZKbJJHXB\\MNPjLdGbWnK\\]NGHSFEXATIdCJGPARUWUHCPWRELITAHKv_E@iYCaW_BQ\\Y@QIO@QDCIGZCEMWGFMFAFgHEDOCSqKCCFGAMKEAC@ODGCGs@WH@KQA@EE@CE@GEA@EH@GGUEEJEAYD@JM@@DAA@FHD@FTJEHUC@JUBKCKG@G[CIIQReAYhO@OXGDO@@FF@IHJFCPEBACBIAAKDOABXARHPNEHGbQAAKQFGIAM[C@WHKaGiCEGOA‹HUKCIokSCUSOCYN[BgGMFIR±ŠOZmHWNU@ShbbXDHVXXGJ^lZ@PZ\\Nb@\\FHJAD"],encodeOffsets:[[118750,41232]]}},{type:"Feature",id:"110115",properties:{name:"大兴区",cp:[116.4716,39.6352],childNum:1},geometry:{type:"Polygon",coordinates:["@@F\\E~DFN@BDFEpHFCHBBEGCDCJBHUDSBB@ELCPbF@B\\J@BJVAFJ\\ADKTCBGECFMT@BMN@@FH@DaNBEnvB@FPBATK@FHEFIAKFBFL@@PKBFJHC@FXBRAFCDMPDTOL@JIVFDHH@DDH@BGRFCDLD@N^@@CNA@KNOAEBCECFEGCFGMGFIPMOEJOLBADBBHGG@GCHIECY@INC@DMGS\\AIOZAAEYA@GT@KKMBEETCGMVINFxA@MJADB@FlA@HJA@NND@DFA@DVAZBBOFKH_JA@K^GBC@EFE„G@gAENMXKJigC@IbSJMqGOP£RGSMGE@kbQFDPEFiBSGGSBK]I{CDWCIDOic[C_G@SuSO@EWKCO@MNY@\\uZOPENQD[LKESSKGBKEG@EJGAGHoH¥CqhifeJkX_XFFGHFNEDFPENKHM^IFIVL^S`DVEnNnG`RTCJHH@R^XFXGVPP"],encodeOffsets:[[119042,40704]]}},{type:"Feature",id:"110113",properties:{name:"顺义区",cp:[116.7242,40.1619],childNum:1},geometry:{type:"Polygon",coordinates:["@@EhEBENXHFNYDJHCD@RJP@R[ZARX`DbjZF@bHXT`Jb@dIFMTGDSfAJVbGnJVM@OKELYPERVXRflXTT@NIfC\\NJRhCVEHFJXNT^DTeZEHYCOhuAMJELOdAVPTMOWBWNMNEJgl]@WGUFIC[T{EEDEHGCIGMI@SECUQI[D{A{GQESPUH]CsiMCmHUeoHENcAaDGCMDGMQCACCBaCGLMAHB@DIEQLOAAEEJ@CW@CDINGAAGKQOCgV@LG@BEGDKNeREFBNCFIDOPKD[@YRW@GFWDAFE@EHDDrLDTCPGF","@@KrJEH[\\B@FF@CHFBHUN‹AJKADGECBCMAG^E@EbI@BEGP"],encodeOffsets:[[119283,41084],[119377,41046]]}},{type:"Feature",id:"110117",properties:{name:"平谷区",cp:[117.1706,40.2052],childNum:1},geometry:{type:"Polygon",coordinates:["@@ZJZRafFLjn€VGNJ@LLBdXX\\T^EDMJ@”nZKLBjPPJ@HbA\\H`DbERHLCFK^BZaFWXQLAGMHa\\OLO@SBIpBdCLƒVQfElO@GSAKEDQTC@GEBKG@ORIJBDAPDFA@CaOq@GGQAAEJK@KMUGAAGEAa@MGMBGCGSIIW@WSUCMDOJeWOM@IUF{WMWaDIMgIoRoCOKeEOEAG_I[cg@wLIFENQFDVTFJ@HNDJGHCFFFS|D\\EJHV@Xk^IhMFMNAXPX"],encodeOffsets:[[119748,41190]]}},{type:"Feature",id:"110112",properties:{name:"通州区",cp:[116.7297,39.8131],childNum:1},geometry:{type:"Polygon",coordinates:["@@FDAJTGDNDCTDDEDBBE@DT@@EHCDGJ@EIZ@@FDBR@ATFBBVFFE@@HNA\\VE@CLIFNJFNJBCP]A@LJFA@HJEDD\\C@DBCHLAEPF@@DH@APHAERDF\\GIxDTM@CFLBBFJ@CNUPMHECGDBF]BMFPDLRBHHBJMDCX@@DFIBFPBRKJF@CGANBHKbDDABDRDHNNCHDbCdBFMpGHiOYMefKJMC}HWAUNW\\NNBNA„kNU|]HMTMN@MZBLFFF@RIRUT‘BMFIEGaAGGAOIIUGTSFcYKS@MSLYPKRUBU]EWDOI]CKGASgW@MTWKIMCS@uMAKKADMECGAKVUTSDy@IjWLMNBF@hƒHEF@FAD]H@LIBG`ELAPYAUB@CEB@CMC@MIB@GkB@ECAIB@NwBMEUJHNSDFFNALLS@@HZBBFYBJP[BHTCND@JMZ@FDGJHDH@GHAABCKAIPPFONEJNHEHHDEFFDADBFMP@L"],encodeOffsets:[[119329,40782]]}},{type:"Feature",id:"110105",properties:{name:"朝阳区",cp:[116.4977,39.949],childNum:2},geometry:{type:"MultiPolygon",coordinates:[["@@bFGHBHFBFIVFHHG@@FFB@HDFF@@FRB@LXGt@DHCH@PBDLFBNF@BEXCHEX@ZQ\\@LCPOJCDEAMFEfQLMHCAFH@@KhUNE^AAEHCFDNGVODMI@AEKADEN@CSJw[HCEFQGBBOG@@CE@FOKBDGCAD@C[FCGIB@IE@K^BDOIAEMMIJEDKF@[UMB@GF@EEAUEABSQ@CA@EY@FJI@CHGD@FS@@CAFCACFSCCDCMSHBIECMB@D]@@MKCDCQEAHG@CCG@CGUEIJK@SPOCCNEDQBDNDB@DJCDLFCBBALJB@BVGPBKVO@KHCCCD@FE@BNA@FNCTDDJA@FGB@NBDW@CL@hT@@ZHHQDDDAFSAANBC@HG@EFS@@DE@@PCB@Ue@CADNJB@FCBWA@LI^ix@FIHrH"],["@@HUN‹AJKADGECBCMAG^E@EbI@BEGPKrJEH[\\B@FF@CHFB"]],encodeOffsets:[[[119169,40992]],[[119398,41063]]]}},{type:"Feature",id:"110108",properties:{name:"海淀区",cp:[116.2202,40.0239],childNum:1},geometry:{type:"Polygon",coordinates:["@@plDJVLŒGPBFHjDbHGL@X\\DBNHJREBLRBHaFGŽMGOBQAWPBLCBBAJBDFADOIEJGE@@EP@HCPWP@ZgfBRQJJ\\D@HLHLDVA@IVDFGSI@EGC@EBB@CN@@IZCAGHGaEqGJG@EjwJ]@K@GSA@e_I@NE@CA@Kg@KC@ENCFƒAKQAW@WIMK@V‹@I@@F@^EDFB@HcIaDYCBRRDCHD@EFLN@FE@CJUPEJOJMTBPEDIFCMIAKNOGMRFJNDVBFLSRMJSDGJsFcEiJGDGTIlOjYD"],encodeOffsets:[[118834,41050]]}},{type:"Feature",id:"110106",properties:{name:"丰台区",cp:[116.2683,39.8309],childNum:1},geometry:{type:"Polygon",coordinates:["@@hMN@NFTQCFRCBJFA@HJ@@HJ@HJ\\FTACDŒ@@UNLXJX@@MA@@IECAQlDFEHBDI~D@GXCFMVDFCH@@NF@ANJC@FnAB@AMF@@EDCDDLGP@LUOAUH@AIABKAAEDCKID@CCACMWA@EGDEILA@OK@AELEJBFEEGL@BSOA@EuAFmMACbG@@EM@ANS@ENFDAHSDCL[BEIUBAII@A[E@OaKD@FAACTGVIACDHDAFGAEDoGEFACM@i€g@@QFCMKMU@]SCoBGSMQ‰DEXXDWPO@MKYGM^AdJJA\\cNB\\G^„DNHFCBFABDBJ@PL^D@DF@T@FDAF^A"],encodeOffsets:[[118958,40846]]}},{type:"Feature",id:"110107",properties:{name:"石景山区",cp:[116.1887,39.9346],childNum:1},geometry:{type:"Polygon",coordinates:["@@NQPHLMJBDNJEFCAONSPIFIVODIF@@EKMFEC@DGQCAQZDbCdJ@GEAFC@]@EJ@DCSB[EGII@@GI@@GEBAIQDDESRMEM@gNYTIRKJAJEJ[DFJKLGBGNBJLDCDAHGBJJAFBLEXTLZFBAFDLD"],encodeOffsets:[[118940,40953]]}},{type:"Feature",id:"110102",properties:{name:"西城区",cp:[116.3631,39.9353],childNum:1},geometry:{type:"Polygon",coordinates:["@@XBDA@EIACM@IJAD]BC@SFABISAD]H@@OAEDQEW@BLE„MD@FLDh@@LDBF@@M`J@fTB@H"],encodeOffsets:[[119175,40932]]}},{type:"Feature",id:"110101",properties:{name:"东城区",cp:[116.418,39.9367],childNum:1},geometry:{type:"Polygon",coordinates:["@@DBf@@VDA@OF@@CT@FEH@@GADBMTBBECCRCGG@YS@@gDK@A‘C@PG@C^TBAJEB@TADC^IB@J"],encodeOffsets:[[119182,40921]]}},{type:"Feature",id:"110104",properties:{name:"宣武区",cp:[116.3603,39.8852],childNum:1},geometry:{type:"Polygon",coordinates:["@@RBX@RFFCŽBFU@aK@WA}CCJGAEFkCBRFD@JB@@N"],encodeOffsets:[[119118,40855]]}},{type:"Feature",id:"110103",properties:{name:"崇文区",cp:[116.4166,39.8811],childNum:1},geometry:{type:"Polygon",coordinates:["@@XBL@@bEV’D@BX@AC@MHA@EIBCCDSEMmB@EIDBME@@MG@EDUCENWD@H"],encodeOffsets:[[119175,40829]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/china_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"xin_jiang",properties:{name:"新疆",cp:[84.9023,41.748],childNum:18},geometry:{type:"Polygon",coordinates:["@@@›ρȁôƧƦóəʵסʵóƪԫʵѵͩƧͩړ›υࡓɛʵ@ȃ@óᇑѵƨɝɚôóНѺͩɜ̏ԭʵôƧɞñ@υƩ—݇ȂóƩƧ@ѵȂυœƥŌਗ—॥ɛóʵѵƧѹ˜݇̍ࢯ˜əɞυ˜ρͩ̏óਙƨƧŋôōóš̍ͩóʵן›óŋړͪƧѶ@ɜԭ—ԫƦɛȄ̍›ɝȄöςƩȂ̏œñȀ̏œƩóóŎə˜@Ő̎@ɞȀɝŎôƨóנѵȄƧ@óŏɝœóɜôŎ̍ͨςŎ@ƨóôƨɞ݈ʶóƨφó̎Ȁƨ̍ԮòѸԮמ@ѺȀ@ƪၬֆòȂñ̐òȂɜ˜óƨ̒Ŏ̑߼@φρȀ@Ő๐ς̎Ƨφ@ɝφڔ೦Ԯǿࢰ@ƦŏԮƨƨȄƧ۬ɜʶڔŐɚɚóŐôƨ߼˜ôƧƧó̐ƥóŏѺǿƦȁφƧς˜ƨƧ̒@ɜƥƦυ̐ɛƪͩƩəƪʷ̑ə@ȃƨʵנŋྸōਚԭԪ—@ɝƨŋ̒օςʵôƧ"],encodeOffsets:[[98730,43786]]}},{type:"Feature",id:"xi_zang",properties:{name:"西藏",cp:[88.7695,31.6846],childNum:7},geometry:{type:"Polygon",coordinates:["@@ôŌנœôʶ̎ͪô™óŎƨŌਚƧ̐ôςͪφ—ɚɝࢰ—݈̎Ѻ—Ѷƨôʶ०ɜਘ˜Ʀŋφ›Ѷȁ̍—ôŏɚŋ@̑ə—@ŏò̍ɜ›óƥôʷƧ̍φѹԪ̍ע@Ѹʷɜ@ôñנ@Ѷɛɞô̐ŏѶƨѸƧƥōƦœôŏô—@ƧôƩ̒ŋƨŌƦǿô̎ɜȁ̒—óʶѶôôО̒›ςƥɜНφσɛȁ̎υƨఱƧŏ@ʵƥœ@ŌóóóͩƨƧóŋ̑õóɞóɝԩͪɝρôƧ̍ƧѹͨڑŎ̑ōóƧࢭͩ̏ѵɝóఱóóԪυô@̒ƥŌ̏Ƨ̑Ȅ݇ŎƧ›ѵӏ@ɛõŏɛȄôӒƧŌѵǿɝ˜Ƨŋԫ@̏ʴƥ@óǿ̑Ȁóǿ̍ςóóυô@ʶɛñρƦƩŐó̎óœѵó̑ͪࢯОóɜן˜Ƨ̏ƥȄ߻̎̏̐ןŎɝɜöɞƩȀôöɛȀóͪ̐ƨƪ̍̎ȂƥԪυО@φɞ˜ôƪ"],encodeOffsets:[[80911,35146]]}},{type:"Feature",id:"nei_meng_gu",properties:{name:"内蒙古",cp:[117.5977,44.3408],childNum:12},geometry:{type:"Polygon",coordinates:["@@ኊȁ૊ö߼ƩɜɛנñԮɛѶóԮô@ȁѸóמ̎ගѺၬ@߼ʶԮӒ߼̎@ŐѹӒ̒Ԫƨöග̑ѶȄ̒ς।œѶɚöɞɜʴڔôôȂ̎—ѺȀς—ƨ˜ƪóԪ—ɜôɛОਕڔԭ˜ѵ̍ѹȂԫ›ɛƥ̍Ȃóɜ̎ô@ʶ݊ੲࢮʵږͪנƨôȂƧ˜̐ͪ@ŐƦƨφԬѶɜôƦ@ŐƧôôƦəŐ̏›@ŐڒѶԬô̐ʳԩНςōôŏɞ@ƨȂѶəóƧ̒ػ̎ó̐Őנóƨô̒@ƨɚɚ@עԫɛɛ@ȁυͩƥʳòևρ—̑ࡗƧͪ༃ॣԮփ̎Ʀ@ôô@ôō@š@ȁѵóƨ̍υȃóʵɛƨƥóυȂóəƪ›̐ρƧͩɜԭڔȄ̎عƧȁ̐ŏó̍ɛ›ƥƧ̑óρŐ@Ƨ̏˜ɝəɛ˜߻ͩ̍ͩɝО̍ƪƧóóӓƨóƧʳ݇@ɝςƪœ@ʴƩ—ƧƦôƨɛȄə›Ƨŋυ›óͩѵ@ɝǿóŌן̍ɛ˜óО̍œ̑̏ôȁ̍ŏòȁñóƦͩ@ǿə@ɛƧ̑˜ρȁυô̍օѹœóȃə™@ȂσʵѷƪòƩ̍—ôó߻ۯôʳƧ™óšõʵѵóѹɜ̍ȂѹôɛŌφֈƩͨρóυӑóޟఱ̑݇ͪóƪƨŌóȄڔԬƩςםñ̑ȃѵŐԭŏƨȁɛǿρôõɚɛóƧОə@ѹ̐ѵöԪͨôͪɛ̒ןŏƧƥóôƥƧɛŌôóɝó@̒݇Ӓ̒Ō@Ŏԭࢰ"],encodeOffsets:[[99540,43830]]}},{type:"Feature",id:"qing_hai",properties:{name:"青海",cp:[96.2402,35.4199],childNum:8},geometry:{type:"Polygon",coordinates:["@@ƨ@ôƪ݈ȁƪ˜@φɝòóƨԮʶɛ̐ѹͪôОəóƧɞᇒѶ@ôږô@ǿѶ›ƪȁςœɜͩφ˜ςŋɞôѶɛƨŌɞ—@ɚςŐñԪॢͩƨȂɞóƨŐ̎ŏעӏ̎óƧƦôœ̒ȁɜ›ςͩ̒œɚɛƨôƨɝφɛóȁƨŋóóɚͩƨóóƩ@ƧəŋƦƩ̍@ƧƧôǿυ̑@ȁɞǿõŏρƥסɚƧóτԫɞœôƧƦ@ñȃòñƥóυôôѹѵ—@ŏ̏Ȅɝó@ȂəŌóəѹƦ@Ő̍Ōυ݈ԩŐƧóôƧ̑›ôʵɞƧ̑ѵôƩɞƧ̑œóНѵóôʵ̑˜ɛȂó̍ƥȀƧŋ̑Ōóƪ@ƨó˜óŐƥ›ƦŎѷƨѵƧ̏Őɝóѵɜן@óòɛ@ѷʸס@ԩ̎υѺƨ̎óʸôƦɛœñ̎@Őɚ˜@̒əŌóŐ̎˜"],encodeOffsets:[[91890,36945]]}},{type:"Feature",id:"si_chuan",properties:{name:"四川",cp:[102.9199,30.1904],childNum:21},geometry:{type:"Polygon",coordinates:["@@ô˜ôŋó̑Ԯ̒ɛОמͪƨōöͫ߼ƥôȃƨóóñôƧóƧôōڔŏƨŐ@Ŏô˜òƥѺŎ@ōɜóנ˜ôǿô›ƦôԮ̍ɜôɚ›Ƨ—ñɛɚȁ̍Ƨɛևυ@óóôŋρԭɝ@Ƨʸ̍ŏυɜƧƧóƧƨȁρ̍ƨȃɚ—ôʵφóô̑̏Ȃ̑ʵɜʵɞ@ƨʳסƩóŎə—óɜƧôƩƧρ˜óôôô@ŎƧƨƨƪѹ˜ó̍̍Ʃ@̏ѹНôޟ̍Ʃóƪυɝɛ—əƨôŎɛȀ@Ȃ@ñɝʶ@Ōρנ̏—õóɛͨƨȂѵОɛʵ@̏ƩŐó߼Ƨల̍φɜȂυτɛОρƦɝƨóƪ̒Ѷɝƨóʶ̒œóƨƨôԪŏφ݇̎ŋ@ŏѺƥôɚɚŋ@ȁɞô̐ȃ@ŐѶ˜óѺφóƦôñòòȄ"],encodeOffsets:[[104220,34336]]}},{type:"Feature",id:"hei_long_jiang",properties:{name:"黑龙江",cp:[128.1445,48.5156],childNum:13},geometry:{type:"Polygon",coordinates:["@@ᇔȂਚНƨŐѶŏöƥςŏñƧƦóƨȁ@óƨ—óȁφӑóóƨ˜óǿ̎̑ôНɞ—ó̑ɜə߼›̎ǿ̒ôڒӑφ@Ƨȁ̎̏ƥƩ̎ρశ˜ôȂςƨφ@נɞ݈˜̑ƥƧɛƨʵƧȃƥ@Ƨƥ@ŏ̑ԩôɝρρóɛƧ›ƩͩƧó߻ʸ̍ʷѹƥɞڕõ̍öɝυ—̍ȂƧ̐̑ŏóƨñŋѹóóȁ̍›̏Ԭõʸ̏ŏ@ǿ̍@ƧОυ@ñƨòȀƥŎ̑ŐѵóɛŌóȂԫōƧŎѹñ̍ʶóОן@Ƨ̎Ѷô@Ȃ@™óŎó@@ó̍ƥԭք༄।ƨͩ̒ࡘς˜ñֈƦʴφͪ@ȂɜɜסԬə@Ƨə̑@Ƨóןô̏ŏ̍ô̑ؼôƨѵɚƧȁɝ@óŐρŎԪО̏ʴ"],encodeOffsets:[[124380,54630]]}},{type:"Feature",id:"gan_su",properties:{name:"甘肃",cp:[95.7129,40.166],childNum:14},geometry:{type:"Polygon",coordinates:["@@ڔôԮࢯ@ō̑ŋ݈ӑ@̑ɞôóôɜŋƦƨôóƨƦנŐɜ̑óͩԩͧѶõѺ̏ɚ@ƨНɜôöəςóɜȀƧȂԮŐѶŏ̒ȄמòƪρړԫôȃƧŋôƩ݈ͩɚ@@ǿɜ@φͩóŏɜӑƧōôǿ̎›ôƥƪóõ›ö@ô—ƨ˜ôƧƦôó̒ɜ@ɞŌõʶ̏Ő@ȀóôƨȂ@ʶע@@ƥ୾ӑó̑óŋôʵóɛړ@@ƩöóƩóρ—ɛƨ̑@óʷƥƥ̎ɛƧ›ôōƧǿôͩѵôɝȃɞȁõƧρóó—@ōƧŏړŐóŎôƨóƨôòƧôóȄ߻ƦõͬƧŎםͩɜНԭ̑ô̒óŌó—ƥ@óƨɝ›σԬƨôעəςƦöŐɝȀ@Ȃφ̒óȀƨƨ̎@ƥƪɚŌ@ƨôƪƧôəͪôôƧŌôȂυɜƧɞƧóəɜ̑›ρͪɛœ̑Ȃó›ƨƥ̍ôסӐ̍ŐƧŏɝôƧȁॡͪòԩρŏ@əɝ˜ƧŋѵɜɝóρŌυ—ɛͪρ›ƩȂѵœ@Ȁڕó@ȄɜʶφࡔڔœƨͪѶͪԬʶôƩעʶɚʶƥôóƨςȂ"],encodeOffsets:[[98730,43740]]}},{type:"Feature",id:"yun_nan",properties:{name:"云南",cp:[101.8652,25.1807],childNum:16},geometry:{type:"Polygon",coordinates:["@@ôɞôɝ̒öôŌƧƨôͪôô@ŋƦ›@ʶƨŐô߻ƪŏ@̐ɜʶѶНƧȁɜͧöô̐˜ςן@ŋɞʵ@ò@ȁɜǿóōɚƧɜ˜φɞôƩ̎ƪóޠѺО@̐̎ƪô̎Ѻ—ƧƩƨƧ@ōóóôóς—ƪƨƨóôɛó̑ԭ—ƥŌɛǿɝƨɛͩô›@ǿƨȁѺŌɚɛ̍ןѶНɛƧôóƥȁƦͩôŎɞ—ƨ̑ɜ—òôφ@ƨʵ@ɛѹōóȃəƨυǿóʵρƧƧŌƩɛ̏ȄñƧƧȀɝ̍ԩʶƧ̑υ—óŌƥʳɚӑóНƥô̑›óӒѵʵѹœƧӐןôƪφõŌƪ̒ԫŌƧؼƨƨס›ρȁƧœƨȂóʶó@@ʴƨôôφ̎Ŏ@Ȁƨ—ƪɚƨœóƨôôôςóޤƧŌƩŋƧԪ"],encodeOffsets:[[100530,28800]]}},{type:"Feature",id:"guang_xi",properties:{name:"广西",cp:[108.2813,23.6426],childNum:14},geometry:{type:"Polygon",coordinates:["@@ƦŋѺ̎ڔʵƨŐ@ƦמȄƪôóȂɜŌɚͩɜ@öóɜôôȂƦôɜȁ@ɞφ›óȄ̎›ƨʶɞŋƨʴɚǿ̐̎Ԭ@ôñ@̏ƨ›ρ۫ô›ɚƨƨНƪŐ̎›ƥóƦʵƥŋ@ȃóƥƧ@@ŏɝǿôυƧȁѵɛ@əóŏ̑@@ə̍›óƧó—@ȁƩ˜ρóòНƥô@Ӓ̑@óŎ̍ƥσŎυ@̍ƨ@Ō̑ôóͪƨ̒óŌړœ̏Ŏ@ŌôȄѺŎ@ɜƧʶυ@ñóɛ˜Ƨ̒ɝ˜óōƥͪ"],encodeOffsets:[[107011,25335]]}},{type:"Feature",id:"hu_nan",properties:{name:"湖南",cp:[111.5332,27.3779],childNum:14},geometry:{type:"Polygon",coordinates:["@@@քɜОƨ@öŐמóƪôƩɚ̒Ő߼ȁςͩɜòƪ—ɜȀò—ñɝò—Ѻͪ@ŏƨŋóɝôǿƨ™ɚȃóəƨȃѵͩó̍@ȃƨóóƥƨƧ@ʵƦ›óͩɜ—ɛóñԭɛōυȂ̍ƧƦō@ɛƥ—ɛȀ̑œóʷóō̍œƩŏƧОəƧóœς۬Ƨœ@̐óòԫ@̏̍əȀƧʳɝŌóɞƧ˜ƨɜóŐƨò@ȄƧŌρŋóôԪОóʶ@̎óȄ"],encodeOffsets:[[111870,29161]]}},{type:"Feature",id:"shan_xi_1",properties:{name:"陕西",cp:[109.5996,35.6396],childNum:10},geometry:{type:"Polygon",coordinates:["@@ςôöƨɝȂɞȄѶóóͪƨȀóŎƨœ̍ɜƦƦôʸ̒@ɜƧς˜ƪôõô@ƪڔ@ôɜóʶôŌô̒୽Ӓ@Ʀ@Ѻ̎ɜѺɛѶôöʶô™ƨšóʴ߼۰óô̎˜ñƪѸƩτʶ@ȁòŋəѹóǿ̑ʵ@ȁ̒ʷυփô݉ôН̏ط@ȁƨóô̏ƪõ@ʳ̐ʵ@ɝɛŋƩŌɛóןôƧŋ̒ó@ŏ̐ƥ@ŏυ@ƧƧôן̏@ƥȂѹɜəœɛóԭ̎ƥóóœóȀן—ɛô@ŎѹōñƦ"],encodeOffsets:[[108001,33705]]}},{type:"Feature",id:"guang_dong",properties:{name:"广东",cp:[113.4668,22.8076],childNum:21},geometry:{type:"Polygon",coordinates:["@@@Ȃô˜ôƨ̎œ@ɚ̒@ôŐ@ɚѶɜƨȂóφɞȀ@Őƨ@ôƦ@ȄƦŌƥʶƦôôŎôʸ̒›ɜǿƦ˜@ɜƥŎ̎ƨφȁɜŎòƥԮŎƨōóŏɛƧɝəɞƧ߼ɜςȃñȄƦŎ̒ōôòƨəƨ˜ɚН@əƨ̏ƪʵυŌəɛóəԭŏəœóŏѹœρʵɝƦ̏™ƥʳѶ›öō̑óóŋρȀυƧƥɛѹōƧôן—ɛŏѵ@óŋôʵɝ›ƪԩõ@Ƨō̍@Ƨ@@ƦɝԮƪО@@","@@X¯aWĀ„@l"],encodeOffsets:[[112411,21916],[116325,22697]]}},{type:"Feature",id:"ji_lin",properties:{name:"吉林",cp:[126.4746,43.5938],childNum:9},geometry:{type:"Polygon",coordinates:["@@נ@ôН̎ʵѺòƨōԬŎôȁɜŋѶô̒ŏƦōñǿòƧφ@ƨН̎@@Ȁ̐Őöʷ̐ԫ̎œôȂѺôòŌôƧ̒Őƨ̏̎ȁφ˜@ŋƩͩםȃƨ—@ȁ̑ʶ@Ōóôɛœƥѹ̑—συ݇@ɜρƧȃࢯƨôœəȂɛōƩɛ̏υρóõœƪʴυφ@ʶôŌóœρք@ɜƧ@ɝǿƧͪρȀƩó̏ŐƨȂ̍غړȃɛԮƨͪ̏ςƩœôɚφȁƦôɜƧôʶφȄ"],encodeOffsets:[[126181,47341]]}},{type:"Feature",id:"he_bei",properties:{name:"河北",cp:[115.4004,37.9688],childNum:11},geometry:{type:"MultiPolygon",coordinates:[["@@Ʃ̒̏ŌѺ̒Ʃ˜óȄƧŌƥͪòôñȂ̎ŐóȂ̒̐̎›ôНɜ—נ̎ôŋɞȀѶ@ôͪφœƨŌɚœɜȃóƧƨƥƪ˜@ʳƩ›ɞρ݈@υНφʵɜ˜ƦρƨƧ̍ɝóɛѹ̍ρŏ̑ôóƨ@œƧƦôƨɛ@ƥƨ@ȂƦ@@ôəŐƧʶƨŌυœ̍̎ɛŋôōɝ@óƧ̍›ƦʵѵʳôʵɜŏςôƪŋƨŌɚ@ôНƥƧ@ōѸɛ̐ô̎ʵѵНԭ@̍̍Ƨò@ȁɝ@əρυͩƪ̏ƩõƧŎƧōóšॡȄɛʶɜȀ@ɞςѶƧœƥςɛŐ@ɚɜɜ@Ŏôôςœƪς"],["@@õə@Ƨɛ˜@ŐóƦφô"]],encodeOffsets:[[[117271,40455]],[[120061,41040]]]}},{type:"Feature",id:"hu_bei",properties:{name:"湖北",cp:[112.2363,31.1572],childNum:17},geometry:{type:"Polygon",coordinates:["@@ñȄυƦöŐƩ˜óנƨƨφ@@Ő̏Ʀ@Ő̑ôƨŌנóɜôƪŋɜŌѶօڔə݈òɞōɜŎôӏƦóƨô̒óôȃƨó̎ŐôƧƪ@ƨȁςƧə̑̎Н@̍Ƨŏρôԭͩԫ—̍ʵƧšóȀôɞƧŌ@Őѹͩñ˜òɞñ˜ɛǿƩ˜ɛñρͪ߻Ȃ̑ŏƪəƩóםôõŏƧ@ɛНƥȄó›̑ѺƧ›ôφóƨƨƦƪóɜŐôóòôƨóφ̐ƨóƦ̎"],encodeOffsets:[[112860,31905]]}},{type:"Feature",id:"gui_zhou",properties:{name:"贵州",cp:[106.6113,26.9385],childNum:9},geometry:{type:"Polygon",coordinates:["@@ɜȀƦŋԮ˜ô̒ɚ˜ôōעƪƧʴɝ@ɛʶ̒ʶ̐ȁƦœóȂô@ôŏ@ōô—ƨʶѸô@ʶƨ˜ɞó@ōτöòυƨ@@əƨô@ɛ̒@Ʀɜôȃ@̍ôʵԩНôóςŌƨŋ@ȃƧñôŏƧɛƨ—ôɝƧʵ̍œôȃυœ@ɝɛȂƥóóȁɛóõôɛ@əͪɛŋôȁƩóםȃ@ƥƧŏړʶѹ̍ƥŌƦȂóôɜƨѵО̎נəɜѹŋƧȂ@ȀóœɜͪɞƧ"],encodeOffsets:[[106651,27901]]}},{type:"Feature",id:"shan_dong",properties:{name:"山东",cp:[118.7402,36.4307],childNum:17},geometry:{type:"Polygon",coordinates:["@@Ʃ̐φͪɚςɞ@@Ȃƨñ̎̎Ԯ@ѶОƨƧڔ@φН̑ŋ@Ʃ̒ǿ̎@ƨɜԬςôʶ̐ʶöԫƨƧנƥɜŎôō̎@ôŏóρƧŏԫôóƧԩó@ƥɜƧԭóƨʵɛƨ߻ӑɜНԩ˜óô̑óƧʳə™óɛƧ@õȀƧœ̍ȃɛŐóŏυО̍—óɝƩ—ԩ@ƧɚԫȄɚʶƨ˜ɞʶԪ̐ړɛƪ̒"],encodeOffsets:[[118261,37036]]}},{type:"Feature",id:"jiang_xi",properties:{name:"江西",cp:[116.0156,27.29],childNum:11},geometry:{type:"Polygon",coordinates:["@@ƧȄôɚəȄ̎ʶԬ˜ԮͪςóƨŐƪ›τɞƦōƥƧ@ŏςôóŐôô̒ʷѶ—ƪƩƩǿ@ō̒ɛôυ@—Ƨȁѹɛəƨѹ̑ƨ̏óƥѵʷô̍ɛȁôŏɝǿƧԫƧ›ôʳƥōòȃρȄ߻ɛɝƨɞɚɜƨôŐƧŎԭōñƦòԮɜôɛ˜ôͪƥœ@ʶƧƨôƦƧô@Ȅô̎Ѷͪ"],encodeOffsets:[[117e3,29025]]}},{type:"Feature",id:"he_nan",properties:{name:"河南",cp:[113.4668,33.8818],childNum:17},geometry:{type:"Polygon",coordinates:["@@φ˜̎ƪ̐˜ɞȄɚ@@Ȃעó̎ŌѺ̒ôֆॢȃô™ƨŎƨōƪöƩ̑ڔɜԩ̏ɝʵƧ—əʵԬȃƨəԪ@@Ƨ̒ŏô̍υȁƧɚ̍ôóŋ@ɝƧŋõ̑σ—@ŏɜŋôɝ̒ƧɚôôطρóóɛƩ@óƨ̍ŏƧôóȄ̑ôƧóƥôóӐɛōɝŎ݇ñړɚѵֆ@ɞ̏ʶ@ʴƩöó̐"],encodeOffsets:[[113040,35416]]}},{type:"Feature",id:"liao_ning",properties:{name:"辽宁",cp:[122.3438,41.0889],childNum:14},geometry:{type:"Polygon",coordinates:["@@ƨʴƧôôӔƨô̎ƩɞН̎ͪ߼ͪɜ—ɞɚ̐—@ƨςŏ̒ôƦƨɜœô̎ƪôςǿƨͩɞȀƨ@@ɛςփô›óŋ@ʵφυƩʳö›॥փρѹס@əɛ@ͩࢯ@ѹʵρ—ƩʶφȀƧ݈̒۬óʸɝŎѵ@ԭԫןɛƧƨƥςɛ—υʶφО"],encodeOffsets:[[122131,42301]]}},{type:"Feature",id:"shan_xi_2",properties:{name:"山西",cp:[112.4121,37.6611],childNum:11},geometry:{type:"Polygon",coordinates:["@@ɚѺñŌɚšôȄѺ›̎ֆφóςȂ̒—ɜƨɚ@@Ȁƨŋôȃƪ—ѹ̑̐ŋƪ̑Ʃρρ›óó@ōɛɛ@əɜŏƦρƨ›ρѵ@ɝɛǿɜʵóօѹ̑̍ŋסô@ȁə@ɝȃ̏—̍Ʃυ—Ƨô@Ȃ̐ظóОó݊φք̑ʸ@Ȃ̒ʶôȀ"],encodeOffsets:[[113581,39645]]}},{type:"Feature",id:"an_hui",properties:{name:"安徽",cp:[117.2461,32.0361],childNum:17},geometry:{type:"Polygon",coordinates:["@@ó̎̑Ő@ƨƪ˜Ѷǿɜ̑φ—Ʀʵ̐˜Ƨѵôóƪôôυς—ƨȂɞŏ@̍ԫôò̑ƥ—óȃѶͩƧƥôŏѺœôŏƦ—@›ƥͩƧ—ôȁυó@̑ƧɛѵʵƩƪѵ˜̑ʸóóôŏρó@ŐƦƨƥŎσɝƩœ@̎̍Оɚ̒ρƨƧȂôɜςôóظəó̑ƨóɞɛŌ@Őτ˜ö̒ƨŌ@ɞôŌ̎óƨəφȂ"],encodeOffsets:[[119431,34741]]}},{type:"Feature",id:"fu_jian",properties:{name:"福建",cp:[118.3008,25.9277],childNum:9},geometry:{type:"Polygon",coordinates:["@@̎›óȁƨӑ̒—̎ɚƨͩφŐƨɝ̎ŋóŏρ—@ōƨ›òʳəóƨō̏˜õɛƧ@ƨѵƧōəŏóŋƧô̑ɝɛʳƥ@@óɛõ@Ƨ̑ƧóȁəƧ̑—Ƨ̐@ɚəОƧ—Ƨɚóñ̑ŎóʴƨœƨԬɞȀóŐɜȂó̎ѶʸôƦƧ̐Ѻ̒ɚƧѺɜƨȂ"],encodeOffsets:[[121321,28981]]}},{type:"Feature",id:"zhe_jiang",properties:{name:"浙江",cp:[120.498,29.0918],childNum:11},geometry:{type:"Polygon",coordinates:["@@Ѷʶƨɜ@̒φôóȂƨ˜Ʀͪ@œ̐˜Ѹ̍τȂ̒̑נŐמôƪƧôӑ̑›@ƥρͩƨօ̏@@υɝó@ŋɛ@ôƩəóƧѵυó@ƩɜŋƧ@̍ŌƧɞυŏƧͪ̍ə̑˜ƧӒôȂ̍œ@˜óφ̑ɜ@ŎƪȀ"],encodeOffsets:[[121051,30105]]}},{type:"Feature",id:"jiang_su",properties:{name:"江苏",cp:[120.0586,32.915],childNum:13},geometry:{type:"Polygon",coordinates:["@@ôɞ̎˜φНôŐɜŏ̎Ȅƨ›öǿƨ@ôɜɚšƨʴ̒ôôó@Ƨ̎əԮȃԪૉöͩ̐ƧòʵφƧôʵ@óړɜóŏɜǿƧ›ɝρσȁѷ̎̏—ƥ˜óŐѹ›óŐƨƦѵͪôȄƦ˜ñ̒Ԭó@̎ɝŐƧȁρ˜óφƩóóôƨѶ̏—ƥʶυ˜ɛ̒ѵȀ"],encodeOffsets:[[119161,35460]]}},{type:"Feature",id:"chong_qing",properties:{name:"重庆",cp:[107.7539,30.1904],childNum:40},geometry:{type:"Polygon",coordinates:["@@əȂòɜƨ˜ѺɛƦȁ̐@ƪ—õŏφƥòȃƥ̍Ƨôυ̏ƧôñóóôɛŏƩôƧƥôƧóυƨœ̒ѹôœƦȃ@փƥɛ̑@@ɜƧó@ɚƧ@ñφσõ@ŎɝôƧ—@ʵѷóƧʵó˜@ŎóŐó@ôȁƥ›ó̒υôóʶə˜ƧȄς̎ƧȂôƨƨƨφɛ̎Őƨʷɞ@ςԮóŌôôφ@ɜֈ̎ƨ"],encodeOffsets:[[111150,32446]]}},{type:"Feature",id:"ning_xia",properties:{name:"宁夏",cp:[105.9961,37.3096],childNum:5},geometry:{type:"Polygon",coordinates:["@@ల̒ôޠφӒςôƪͧυևɜŋѺó̎ȁ̍ɛ@ѹס@@ʵƧȁôó@ǿ̐ŏöʵɝŋɛ@ô̑ƥóóƨƧ—ó˜ôœó@ƩôóƦ̍œóȀƨŎɛӒôŐυͪɛ@@Ȁə@"],encodeOffsets:[[106831,38340]]}},{type:"Feature",id:"hai_nan",properties:{name:"海南",cp:[109.9512,19.2041],childNum:18},geometry:{type:"Polygon",coordinates:["@@φɜƦʶ̐ôφô̎@ƨŎö@τʵƦ˜ԩ۫õН̏óƥȃƧ@Ʃəםƨ̑Ʀ@ޤ"],encodeOffsets:[[111240,19846]]}},{type:"Feature",id:"tai_wan",properties:{name:"台湾",cp:[121.0254,23.5986],childNum:1},geometry:{type:"Polygon",coordinates:["@@ô—ƩɝöƧɝѵəޣ̏ρƩԭóōóͪρɞƧОôԪ݈ଦѶɜ̒ɛ"],encodeOffsets:[[124831,25650]]}},{type:"Feature",id:"bei_jing",properties:{name:"北京",cp:[116.4551,40.2539],childNum:19},geometry:{type:"Polygon",coordinates:["@@óóó›υóôƥ@ŏóóə@ƧŋƩŌρóɛŐóʶѶʴƥʶ̎œôƨɞ@óŎɜŌ̎̍φ›Ƨŋƨʵ"],encodeOffsets:[[120241,41176]]}},{type:"Feature",id:"tian_jin",properties:{name:"天津",cp:[117.4219,39.4189],childNum:18},geometry:{type:"Polygon",coordinates:["@@ôôɜ—@ƨöɚôœôôɚŏ@óƥ@@ȁƦƧɜ@óƧƨƥ@›ƧóəН̏óѷɜ@ŎƦƨóО"],encodeOffsets:[[119610,40545]]}},{type:"Feature",id:"shang_hai",properties:{name:"上海",cp:[121.4648,31.2891],childNum:19},geometry:{type:"Polygon",coordinates:["@@ɞςƨœɛȀôŐڔɛóυô̍ןŏ̑̒"],encodeOffsets:[[123840,31771]]}},{type:"Feature",id:"xiang_gang",properties:{name:"香港",cp:[114.2578,22.3242],childNum:1},geometry:{type:"Polygon",coordinates:["@@óɛƩ@ρ@óœôȀɚŎƨ@ö@@ōƨ@"],encodeOffsets:[[117361,22950]]}},{type:"Feature",id:"ao_men",properties:{name:"澳门",cp:[113.5547,22.1484],childNum:1},geometry:{type:"Polygon",coordinates:["@@X¯aWĀ„@l"],encodeOffsets:[[116325,22697]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/chong_qing_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"500242",properties:{name:"酉阳土家族苗族自治县",cp:[108.8196,28.8666],childNum:1},geometry:{type:"Polygon",coordinates:["@@XJ°œlJX@lbl@XbV@VLnJlxnbšƒUU@IVK@lVIVwnJlU@n@J@L@Jn@l_nWVLVln@@blLšmV@@xœÔ‚`nœ™xV‚ÈLlx„LVxVVšƒV_U»VWn_m¥XwVmnX°ƒlmUUVwÞaVƒk@a@mmIUa@™mwk@™ƒm@@U¯a@UV@@K™@ykkmwkV@kU@ƒÑƒVkKWLÅamaUm@kyU@WkU@Ua™IUašVaUUmUUa@aVLXKWa¯UUbmJXnWnX`l@@xkzWÆ@V„LU¦‚x@b@JkIkJ@LmbUamJwm@óxƒnk@V„@x„ŽVnUVmVUVŽUbVlUbkXWŽ"],encodeOffsets:[[110914,29695]]}},{type:"Feature",id:"500236",properties:{name:"奉节县",cp:[109.3909,30.9265],childNum:1},geometry:{type:"Polygon",coordinates:["@@WVXb‚UnK@x@b‚²kxmKkl¯_ƒVV°™VU@bnKVVV@@nkŽ@n›bn‚@š°@VLČUš@°WV@V™nU@InKVl@nU„b˜KnX„WlknLlKUwnalLša„VlUXmWk@UU@UWWIUyķ¹XaWW@X™ƒKUIVm„U@W@UVU@KV@n»VkUkÇmUmVIUmULUbm@ƒwUaƒKkkm¯ÑUL@bWVnx@VmxUI@„klmkkK@aƒK@IlJ@I¯ƒk@mak@mnkJVL@bV@Ub„„W`UUUV™I@VƒU@VVbUJVLUVVbUX„VVxk¦VJUnVxnVVUšJV@Ubl@@bXV@L"],encodeOffsets:[[111781,31658]]}},{type:"Feature",id:"500238",properties:{name:"巫溪县",cp:[109.3359,31.4813],childNum:1},geometry:{type:"Polygon",coordinates:["@@nLWbX‚VLVU„V@KšIVl@b„@lbšU„VnU@JÆU@V@n°KĢUl@VbÞKšVš@„_„V‚KXU‚U@KXƒ@wlkkU@mWKUU@UôJ@XV@œaVmÞIVaVLƒƒ@»kmƒ@ƒUkL™U@aU@WWƒLUUU™™KkbƒwWa@KU@kaƒXmW—LƒamVk@UmL@JmVUšU@¯X™@ċVUK¯@ÅnWK™LkKULWK@UXK@wW@™LkV@bVLƒlXn›`¯xU„°LnŽlV@n°Lnl"],encodeOffsets:[[111488,32361]]}},{type:"Feature",id:"500234",properties:{name:"开县",cp:[108.4131,31.2561],childNum:1},geometry:{type:"Polygon",coordinates:["@@n@na‚I„wš@@VVK„LVbVxnVÆUnanKWXamKmk¯K@mkUm¯KVƒ°w@Wm@UIUUlKUU@a¯KWanwmUXamKkUWUnU@KƒkUwWKXaWLUWkImaUUUƒƒKka±k@lƒ¯w™wmbUƒ™ƒkXm@UJkIW‚XXƒbƒmƒ„UJ™XUV@°šKlšlVXV@xmbnV@blV@VšœU`UL@V™a@bULlb°VXbܚ@V@bƒL@J„xnLVb@lVb@V@@z˜bXWšX„KVLV‚š@@bUVVL@b„„lVna@ll@„zl@@J"],encodeOffsets:[[111150,32434]]}},{type:"Feature",id:"500243",properties:{name:"彭水苗族土家族自治县",cp:[108.2043,29.3994],childNum:1},geometry:{type:"Polygon",coordinates:["@@„Jlb@nVV@bXb@ÆlL„Ul`nVKU¼VxkbW„nlUxlXX‚@°°WnnJ@VUn@J„k°L@VlV@nUJ„x@bVVVz@VnLla„KnalVlIUŽ„¼@nV@@anKUwVal@UlJœƒlI@akU@UWXKVI‚¯Uak@@KmkXWÜkXWykIWwXw@laXamkVUUym_XmlkkmmakwmIUKU@Wak@kaW@kI¯›WIk¦VŽƒUUƒmaUV@XkVUV±aUb¯b¯¥m@@ImJ—@mƒmL@kUKUkkJƒbV¦"],encodeOffsets:[[110408,29729]]}},{type:"Feature",id:"500235",properties:{name:"云阳县",cp:[108.8306,31.0089],childNum:1},geometry:{type:"Polygon",coordinates:["@@lb„LV„VVnblJVXXKWbXLVx„l@LmVXVVl‚nLWbnVmxXb°L@bVVkLVVVJn@@X‚‚œ_Wm„kUK@alUšKX@@xWL@VXLVKlLšKXLÆm@™mœa@ml@mU@UUmL@aVšUU¯„U°`lknLlw±@a@wmLVWaXU@KWU@ak@VaU@™IUVmUUwVmUIl¥UwƒUVWUaVUUKVIUa@UUUUJƒUUm™kƒ„nl@„@VWV@L¯aUb™Ulxƒ@@b@VULUx@VUxVV™U@bU@mxU„U@mUVŽklkkƒ@WxknlxK@amLƒKU„K"],encodeOffsets:[[111016,31742]]}},{type:"Feature",id:"500101",properties:{name:"万州区",cp:[108.3911,30.6958],childNum:1},geometry:{type:"Polygon",coordinates:["@@ĸĊVI„ƒ„n„aWWXlJVIn@lWš„V„našx°xk„l@²Ž‚LVƒ„LnK@b‚LkwlmXw„@lllkUnVV@VƒnwV@@ašVUUVw@UVwVK@U@a„@kwšVVa°b@KXU@U@ƒmk„ƒÇсaml™kUVmn@VULU˜m@kUVkUaƒwUWm@Uw¯„mKUUmVUUULUKU„W@XbWVkaWwkUU™ƒ™k@maUbmbVlk¦ƒxUVUIWVU„kJVVkL@UmJ™UUVU@lLUVU„lx„@@VbƒJ™U™L¯¤@Vƒ„"],encodeOffsets:[[110464,31551]]}},{type:"Feature",id:"500229",properties:{name:"城口县",cp:[108.7756,31.9098],childNum:1},geometry:{type:"Polygon",coordinates:["@@VK@w¯L@m@UÅV@ImVƒU™Vkaƒ@@aUk™J@LƒUUVUKmLmbÅVmUUwUaƒKUL@U™@ƒxJmbm@nVJ@X@VkV‚n™lƒLXx™@ƒb@bUVƒLU`UnƒbU@@ŽmVVX@JX@VLVVšklV—„‚`@bUL@V„LVKn@‚U@„UJkn@lmLmK@X@Jn@mb„nÞWVXnJ‚k„KČÑÆ@VK@knaÜmXlUČW°kôÇƁ@a@yÞ_VmƒUnU@K"],encodeOffsets:[[111893,32513]]}},{type:"Feature",id:"500116",properties:{name:"江津区",cp:[106.2158,28.9874],childNum:1},geometry:{type:"Polygon",coordinates:["@@„InWUUlU@LVašlX@°²lÒXxlK@Ul@@Un@UaVJ@I@W@UƒUUVUwVIUKUa‚UUVwn@Üx@XUlnn‚bœJ@¥VklKUUlk@ynU@kVƒUUVWnI@¥V£VWVIUKU@UVƒa@n@Vm@@nlUaVkUwƒJ@blLkLW@XWmXkmmLn™@m@U@UVm@™„UVUUlakUVa„ƒVkV@@wnaWUk@VwkƒlmVIkUUxmJ@U„™@KƒIkx±V@IUm@K@IUKkbWKUbn„m„@bmVnbmb@xkxUJ@ULW`@bX@WVXL@Vƒš¯„mk¯@UJ@VmLUaWnX@WJ@nkKkxW@UIV@@KkImmkK@UW@XaWIU@U‚ƒIkbWb„xXŽlLVbnV@bWlX@VxVLnl@nÆÞVÜ"],encodeOffsets:[[108585,30032]]}},{type:"Feature",id:"500240",properties:{name:"石柱土家族自治县",cp:[108.2813,30.1025],childNum:1},geometry:{type:"Polygon",coordinates:["@@„š@kl@š¼UbmVXJ@bV@nxVIVJULVVk@@LWbnJVU@bVbUJ@blLXnWV—@mbnV‚@V„„bn@VJVLnaVanbl@„šVšlVXxlbXUWaX@VƒUUVwUUVm@I@WmI@a„mlLœ™lK@alwnUV@kóVaƒÝk@UlbVK@™VU»VUUVWUƒ@U`ULkwm@@KmU@knKƒ»VkJkUmbƒLkbmK@UUyUU@aƒwm@@XXJ@VVLVVUbVnUJVX@K„„k`WXXJWXUbmW@bkL™Um`Xnƒb@JVL@LU@™°VVXKVnUxVLUbmJ"],encodeOffsets:[[110588,30769]]}},{type:"Feature",id:"500237",properties:{name:"巫山县",cp:[109.8853,31.1188],childNum:1},geometry:{type:"Polygon",coordinates:["@@kVƒU™bkKmbVxkLmKkllbV@@LXb„xlašLVšVV„KXXV@@bšVlK„V„@ln@¼°KXa„U@Ulw°JXalIUa„ÝWXW@kVU@ƒVUVWUUUamUw@aVamwn@VUUƒlLXWm£@wÇĉkKklmLUÒ¯ƒWn™@ğ±kwmaWm¼U@@LUV@V@XƒVUnVJ„LWš@‚XXWbĸºVzXJVXV@@VXlWn"],encodeOffsets:[[112399,31917]]}},{type:"Feature",id:"500102",properties:{name:"涪陵区",cp:[107.3364,29.6796],childNum:1},geometry:{type:"Polygon",coordinates:["@@nèVblĖVVnLšŽ„@šx‚V„n@nšJ@L„UVVX@lbUJV@@nn@VVVK@z„˜V@nzVJVUlmX@@_VVVbnaVal@@knW@wnaƒVK@aVI„J@£kUVW@‚wXUVJ„amƒ@Ikƒƒƒƒ_X¥ƒ@WwkKkwmŽ™šƒkUxƒnÅmm¥™WV@Um@UlVL@JU@@Xƒ@UVkKVk™KVk™Kkb@bmJVXU„VVUbU@@`W_UV¯b"],encodeOffsets:[[109508,30207]]}},{type:"Feature",id:"500230",properties:{name:"丰都县",cp:[107.8418,29.9048],childNum:1},geometry:{type:"Polygon",coordinates:["@@Þè@XUK@LlV@blbUJ@„„V@bnV‚@VVVXU@ƒlbXal@VXnKV@maXUރ@amk@aVKXV‚anbš£°mnIVaUKVwUmWLUUš¯V@@KUK@I„aWmn_šVlK@anXVaXWWIXWl_ƒƒ@LUWVIUmVaUUUK@UWI@Wn@VI@mkU@U¯Kƒl@ImVÅLƒwU¤óbUU@wWXkmm@LU@@VUIWVUL@JUnƒaƒx@Jn„ƒbUIWVx@ŽUXlV@¤ƒIUJ@bUL„Žmb@xmX@lk@UbmbUaUU@`W@kn"],encodeOffsets:[[110048,30713]]}},{type:"Feature",id:"500232",properties:{name:"武隆县",cp:[107.655,29.35],childNum:1},geometry:{type:"Polygon",coordinates:["@@l„„w„bVm@IVKXUVJ@UV@@KnnWlX@xVVôaV£„xÆKnUVm@UmIXm¯¯@WkWVwmkXƒlaUwV»ULmk_ƒVkK@ÅWa@aUU@mkaƒIƒb@‚n¼ƒnm‚_@mmK@UƒLUVVmI@aUJ@XWJ@U`UIkm±kk@@lULmUmKUnVšnlUVmI@VkVlx™bkIƒVmLUxkKUŽ‚Xš‚n¦Æn„mVw„lš™nlxlLXx„@W¦„`„„"],encodeOffsets:[[110262,30291]]}},{type:"Feature",id:"500119",properties:{name:"南川区",cp:[107.1716,29.1302],childNum:1},geometry:{type:"Polygon",coordinates:["@@VšUbVJVUn@VLX@WVXVVI@VUVWxU@mš@ĊX@@¼V°aVUX`@_V@VaUUVƒUWnI@alašLUlšLUllLVU„@@WV@@IUKVkn@@VlLVwnK„UlJšakwlU@UnJVUmkU™VmXa@wVK@UUw™@VƒVI@akƒ@alInwlKXUmaUW@wWLk™™KVak_ÇaUƒƒV@šXbƒLVxUlWIk@UK@V™@ƒkU@VbUVUlVnƒLUV@lVXmxkV@L@V@Vk@WbUwmL@JUI@xVxkx"],encodeOffsets:[[109463,29830]]}},{type:"Feature",id:"500241",properties:{name:"秀山土家族苗族自治县",cp:[109.0173,28.5205],childNum:1},geometry:{type:"Polygon",coordinates:["@@XlV@lzn@VŽnbÆbXKlL„U„ÒV@@llUnxll@zšŽ@LU@@V°b@Vn@š„l@VÑUƒnK@UšU@aUaƒkVm@K¯wƒklmnn„Ul`nI@almkIUwmWVkUaƒkkJmUUa@K@aU@@_m@@wUyVUUa@Umƒ@awl@Wka±„UkUykIWV™b@bUVk@›aU@UXU‚UIWakUWmUxUV@nUVWbšŽ@XXVVŽmXXŽ@VƒbVLkVWx"],encodeOffsets:[[111330,29183]]}},{type:"Feature",id:"500114",properties:{name:"黔江区",cp:[108.7207,29.4708],childNum:1},geometry:{type:"Polygon",coordinates:["@@VX@V@LV@VJUL@lVnnxlb@VXV‚XV@@W„@UIVK@kUKna@£VWUaVUUalIVJVIUW„_lm@bXKV@mn@J„UUw@KnIVll@VanLVmUkVKXLVKUIVamw@UaU_lw„KlwUWV_Ua@aUa@KUšwm›_›Ó@wU@™nkK@am@UkUKmXk`m@@I@K@I@mkVmIUxUJ@kUL@JVV™„lnklWnn`VzUVnlWbkb@WxXxlJXzWŽÛlWXnl@Ll@Vb°UJWLX@VlV@bkJ"],encodeOffsets:[[111106,30420]]}},{type:"Feature",id:"500117",properties:{name:"合川区",cp:[106.3257,30.108],childNum:1},geometry:{type:"Polygon",coordinates:["@@XKVXlK„ƒVL@UnV@aValXXK„U@WVwUaVU@IV@@aVW„L@U@anVV@@bVK@UVL@bnJWL@VnUnb˜@@JnIlVl‚@@bXIWbn@UKVLVKXLlaV@VVnK@bVL„m„IVƒ@KmknUUWVI@aVJ@_„WU_VmUwƒU@K™ƒVak@am¯mJU_UJUkU@WkIV`UI@JV@LmmU@@mƒbUzś™@„VK@nUKƒ„ƒb™akb@UWK@bkVVbV„Û@@`ƒXk@WŽ@n@lXL@bmb@VVJUn@JnUlnUlmX@`XLlbkJW@kzlb@`@b@b"],encodeOffsets:[[108529,31101]]}},{type:"Feature",id:"500222",properties:{name:"綦江县",cp:[106.6553,28.8171],childNum:1},geometry:{type:"Polygon",coordinates:["@@@¦‚@X„lVX@@UVKl„VUX@lanVlUVbXWVXVƒ„VVUnKVUlwUwU@UJ@nmVkUV™lwXam@VaUUUw@W@kk»mV@UmKkwVKVUU@@LUKVI@mV@XVWxnXVKUUUK@wWU@UUWnUlLXa‚mUI„am@wI@K@amIm‚UUkI@m‚akUkKWUUanƒ@wƒamLVxk@UVmUUL@Vm@kV@I@ak@@bWVXJlLVbVL@š@bn@@`Un„@WbUKULWVXbƒ@UVmbX„WVƒb@bVmxUKUƒV@šUn@V@V@nmšnKlnnWWXX@lKkK@a„IVxUlVb‚k@mn@@U@m„bVUV@VLUJUXU¤"],encodeOffsets:[[109137,29779]]}},{type:"Feature",id:"500233",properties:{name:"忠县",cp:[107.8967,30.3223],childNum:1},geometry:{type:"Polygon",coordinates:["@@VLÞĊ„U@Wš@¼V‚„@lk@w²mlšVUœ„llšVnI@VlKUUlIVƒXUVJVU„wl¥UkUKUIm@ƒaUƒ@mUna˜@XUWmkK@aVIUa@aUVmIXa@Kl@UUVKUIUJmwU@@aWInUVa™»k@@lƒ™¯n™¤mabWUUL@bnl@b݄WVnbU@mLUWk@Wbka@„WVUU@UmUmVkUULV„lVUx„l@L@VƒbÈÒlb"],encodeOffsets:[[110239,31146]]}},{type:"Feature",id:"500228",properties:{name:"梁平县",cp:[107.7429,30.6519],childNum:1},geometry:{type:"Polygon",coordinates:["@@XLV@VV@b°°nšƒnkb@bƒšnJWVXblIUVšxWnUJnVVLVU„JlUnLVK@UnUVJš²nKVbVKla@aXlJ„k„Klb„ƒ@U°£šKšV„IUa@ƒ@kwVƒVUkKV@VUkk›ƒUVk™±n@xklƒ@U@»™‚@XƒVÝĉUJnxWb@UX›KkVUbUKWUkVmkkLU`›b"],encodeOffsets:[[109980,31247]]}},{type:"Feature",id:"500113",properties:{name:"巴南区",cp:[106.7322,29.4214],childNum:1},geometry:{type:"Polygon",coordinates:["@@nxnVlJlUXLƒ¦@x@Vl@nKVVX@V_V@@KlVXU„@lKlxXIl@ÈĊ@Vl@n_VJlŽnVlnb„²VVVJVVmUUkĕUamçU@»W@@ĉn™V@XwVU@UUJWUXUW@UKm@UVUIVaU™UVmLUVƒUU„UWWXUakVmUkbW@UVkƒUL@VW@kUWƒ@mJUXVVU„@lmV@zklVVkLUl@¦›I"],encodeOffsets:[[108990,30061]]}},{type:"Feature",id:"500223",properties:{name:"潼南县",cp:[105.7764,30.1135],childNum:1},geometry:{type:"Polygon",coordinates:["@@@a@a@_kalyX@lIkaWK@_nWVkkmmV@IVmUI@Una@aWK@k@mkbWaknmJUk@mk@@kUal@Uaš@Wa@aXLlwUKlkkƒ@KmI@VUJ@Lk@@VUUmL@amJU£kKUaWakLmU@bVVUbnbWV@xkL@bUb‚xUxVbXJVbUVWIUVU@kLWxkKWV@n¯VUbU@@VVX@VmaUL@VUK@VVbn@lVnI‚@@lnLULm@Ub@Žl@na„@lK@XVVkJ@b@zl@@VnV@bVb@J@bnXV`lXXmVI@W@InbV@@aVKUblKVLUanLlmnLlK"],encodeOffsets:[[108529,31101]]}},{type:"Feature",id:"500118",properties:{name:"永川区",cp:[105.8643,29.2566],childNum:1},geometry:{type:"Polygon",coordinates:["@@@b܄nWVLX„lxV„VxXxlVn@@bVblK@a@UnLVJV@@UnLVU@VXaVKVXš@n`WUÿ@IUKlaUUUkWyUÛÅÝ@mmkUKUwW@Xk@amUUakKWƒwXaƒK@VVLklƒXVlkxV„UL@bm@Vxn`ƒIVxUVkLVšUšl@@lkXmmƒVUn@VV@Xb"],encodeOffsets:[[108192,30038]]}},{type:"Feature",id:"500231",properties:{name:"垫江县",cp:[107.4573,30.2454],childNum:1},geometry:{type:"Polygon",coordinates:["@@šĊ°¤nҘ¼œaV_lKnllUXVVLValUœLVW‚@XamwVIUKkaÇфa@U@KƒkVwkUUƒVKlVnU@aƒU@ƒVIka@akU@KVL@WÝçUV@Vmbů@L™KƒnnJW„ƒVkxlL@VX@VxmnXVWxUb@bkn"],encodeOffsets:[[109812,30961]]}},{type:"Feature",id:"500112",properties:{name:"渝北区",cp:[106.7212,29.8499],childNum:1},geometry:{type:"Polygon",coordinates:["@@@bVVXL‚a@lnbWn@L„@XVlK@VVLUVlbkLUKVVVL@VšnX‚VL@VV@UbVb@x@¦UxVb@bUJƒL@L„VVxlK@™nk@U@W„UVLlKXV„@VblU@UUKVU@wn@VJVanLlkX@VaVK™¯@a@U@U@ƒVaUK„kUUƒ±maUkm@UUkbm@@Vk@@JƒwU@Ub@I@JmwUL@aƒ@@KkVÇLkƒWkƒ@kUU@@xUVmKUnllUb"],encodeOffsets:[[109013,30381]]}},{type:"Feature",id:"500115",properties:{name:"长寿区",cp:[107.1606,29.9762],childNum:1},geometry:{type:"Polygon",coordinates:["@@VVšU„bX‚lX„¥l@XnVmlxUx„@@blVnnôĀlm@aVaXwWUnmUwW@@UkKlw„UXƒmI„mšL@KÆ°na@UUImyU@ƒ—@yULUUm@@mU@VIkaW@UUƒV@K™I@mƒmU™wƒ@™mKUnU‚UIƒlVLUb@„@V@V@bš°ULUbW@klmKUbUIm@@xUVVL"],encodeOffsets:[[109429,30747]]}},{type:"Feature",id:"500225",properties:{name:"大足县",cp:[105.7544,29.6136],childNum:1},geometry:{type:"Polygon",coordinates:["@@XUmaVaUU@anVlKXbValU@aV@@IXKš@@bV@VxVK@UXLlUšJXa@_‚@@aVK—ÅWVkwWaƒƒwUa@am@kUWLU@kWmX@ykI@W@UV@na@LlLV@UƒkwWƒUKmXX`mIVl@bXLWVkbkkƒx@`VXm@@J@U@UUKUxk@WbUIVl@VXLW„ƒJUkUlUImxXlmb@X@VUJUnVbšW@UV@@VVX@bnW@LVxUnlJUV@n„@VxVIn@l`„UVVVL"],encodeOffsets:[[108270,30578]]}},{type:"Feature",id:"500224",properties:{name:"铜梁县",cp:[106.0291,29.8059],childNum:1},geometry:{type:"Polygon",coordinates:["@@VblLV¤nI@bnKVV@Ul@@KVI@UnJ@Ll„klVLkxWK@bXb™@Vbk@Vb@ll@@nVlnIlmXblaXl@„W@_Ü@UƒUalU@aXL@Vlašb„a„ƒVL@mUL@ƒUUƒƒÇXUW›X_WaƒƒUƒ»m_™@UWULWb@UUVmK@VU@UImK@V@bkL„x‚„XblxXU˜ÆUL@b@@`Wb™IkVWK@VULUwU@@a™@WL@JU@@bkVUb"],encodeOffsets:[[108316,30527]]}},{type:"Feature",id:"500226",properties:{name:"荣昌县",cp:[105.5127,29.4708],childNum:1},geometry:{type:"Polygon",coordinates:["@@VI@U@WnaWknwVJVkVl„IXƒWK@UUkVJXal@VwVL@V@V@In@UW@_„wlllaXUWK@aUknJW_ۃ@aWaU@@UVm„UUaUImJVnÅUmVUm`kUUVWLnVU@VVmXƒK@„nxmŽULkx™ImJ@nU`@X@Vkn@`@nlV@nVJVaX„VLnK@bVV@nV@lbXWš@"],encodeOffsets:[[108012,30392]]}},{type:"Feature",id:"500227",properties:{name:"璧山县",cp:[106.2048,29.5807],childNum:1},geometry:{type:"Polygon",coordinates:["@@XzVlVVkbVL@JVĀXŽ‚¼V„„„XbW`XœWVȎ„„VVšŽVkV@@UXa@alK@IƒƒU@UKWUyUI@wVUUWVak@VUkƒW¹@WXI@yVIUK@kWwkѯ±W@™kUb@KkVVVmXƒJ"],encodeOffsets:[[108585,30032]]}},{type:"Feature",id:"500109",properties:{name:"北碚区",cp:[106.5674,29.8883],childNum:1},geometry:{type:"Polygon",coordinates:["@@X‚VLV@„„@JkL@bWb@VU@UlƜVy„a@nV@nn@KU@IVJU_lJXV@VlVIV`nIn°@b‚lUbš„„KVI@aUaVw@¥@wUaVaU@@UUKW™m@UUKUUVLlKkaVUUK@UkLWUƒ@@KXmma@kbWKUU@aUamLnÞ@VWLk@@Wm@ULU@@U™KUVWI"],encodeOffsets:[[108855,30449]]}},{type:"Feature",id:"500110",properties:{name:"万盛区",cp:[106.908,28.9325],childNum:1},geometry:{type:"Polygon",coordinates:["@@VIV@@wVJ@InKVxXal@@U@U@KlUnwUW@kVU„KUmVkUa@I@KW@@bk@@mƒU@m@k@a@aƒIUxmJk@ƒwULƒwkKmVVX@VXV@xVLVVULmWXwWUU@@nUJVL@KV@UVULlxnL@VnUl¼@l@XVxVVUbn@WbkxUšlVnU@m"],encodeOffsets:[[109452,29779]]}},{type:"Feature",id:"500107",properties:{name:"九龙坡区",cp:[106.3586,29.4049],childNum:1},geometry:{type:"Polygon",coordinates:["@@XK‚L@Vš@XbV@lW@UV@@VXIV@U™VKlL@KnnJ@VV@VU@I„@@mVUVWUUmL@V¯LUK@UV@UU@a@U@yU@WLUK@X@KUVmL@ƒ@aXI@w@ammVk@WÛwm@UxVVVbVLUJVxVU„V@V@X@JUIVbm@@Vk@@VkL@lVLUJ@zWJ@X"],encodeOffsets:[[108799,30241]]}},{type:"Feature",id:"500106",properties:{name:"沙坪坝区",cp:[106.3696,29.6191],childNum:1},geometry:{type:"Polygon",coordinates:["@@Xºl„UVl@UbVXUV@xVJVzXJVUšL@VV@VKn@@Xl@XK@UmÝnKVbVakkVm@k„ƒUK@UmIm@LkKULVšU@WJ@UU@@VkXU@Wa™@@UKWL"],encodeOffsets:[[108799,30241]]}},{type:"Feature",id:"500108",properties:{name:"南岸区",cp:[106.6663,29.5367],childNum:1},geometry:{type:"Polygon",coordinates:["@@VV„JVL@bUVVnl`XIlwXJlw°nnl‚IXW@UÇĉk@WJkwkLƒ@WVkU@LU@U`W@UXUV@n"],encodeOffsets:[[109092,30241]]}},{type:"Feature",id:"500105",properties:{name:"江北区",cp:[106.8311,29.6191],childNum:1},geometry:{type:"Polygon",coordinates:["@@nLVU@wV@lV„@Xll„ÈKlU@L„@@bVKnx@I@JVaV@„x@Il@@Un@laVVn@mkUIm`k@WXJmk¯mkxWIkxWJk_UmVUUKƒ@UU™@ƒ„@l"],encodeOffsets:[[109013,30319]]}},{type:"Feature",id:"500104",properties:{name:"大渡口区",cp:[106.4905,29.4214],childNum:1},geometry:{type:"Polygon",coordinates:["@@k@@U@w„¥WKkVkImUmwa@b@xWJ@b@„nKVU@L@WVLXKV@@z@V@bVVU@@VVL°K@U"],encodeOffsets:[[109080,30190]]}},{type:"Feature",id:"500111",properties:{name:"双桥区",cp:[105.7874,29.4928],childNum:1},geometry:{type:"Polygon",coordinates:["@@WwUwU@kK@KmbU@@V@XlJ@znWlXV@XK"],encodeOffsets:[[108372,30235]]}},{type:"Feature",id:"500103",properties:{name:"渝中区",cp:[106.5344,29.5477],childNum:1},geometry:{type:"Polygon",coordinates:["@@VLš@VV„@VL@aUKƒIUUƒ@@JUVU@"],encodeOffsets:[[109036,30257]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/fu_jian_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3507",properties:{name:"南平市",cp:[118.136,27.2845],childNum:10},geometry:{type:"Polygon",coordinates:["@@@knyƒk@ƒKU¥šwV@nkƒWƒzUmk@@lKUa@aVI@UƒKUamKUUVaUI‚@Xƒ@UV@K±IUVVlUbUbUL@KWUXmWk@KkXmmkŃKUƒ™a@amUƒbkUkKWUnwUƒÇwV™UUƒÝUKV£U™@ƒnKWwXLVKm¥@wUXkmWk@ƒ@wX@lU„@šyVImaXwVƒƒ@kŽƒnU@mbk@mlUXƒmU@mV@n@bnW@bUIWJ—ImVUKWbUK@nkKƒaU@W_VUUmWmL@UU@™bUWUL@V@bmVUz@`mUUVVbXL@V™L@lmLUxmVamXkW@xWbU„VbUxkU±@ÅUmmkLUbW@@`kLknVlV@lbXxlVUXVV™ŽU„U@UbWŽkIWVUUUJkI@llbUxVL@V™VƒUU°ULUmWXUV@VULWb@™xm@UaVLVKUa@ƒw@V›bkmVambUUm@@VkK@„@b„xlxX@‚„n¤@Xƒ@@lkLWV@Žn„V„kb@bWJXLWx@nkxmm™bXn@VWVUn@VnJ@bVXl@„™VJXnWbX`lL„UlJVI@Žœ@VXV@Vl@bn@@Æmn@VšxXU@mVIlxšVššnI„l@nVJ‚aXI@mlU@aXkVm°klmnVV_naš°@V@xܦXK„V‚nnUlVXbVK‚LXKV@naV@@VVl@@lXblXšWnLlbVK²nš@@‚VLUnlV@lƒXxô°‚V@UnaUUlKXLVUVVUbVVlUnJVX„@VW@an@lb„@nl@VU@anƒšUVW@kƒaUm@InVVKVU@kUW@Uam@km@kVa@a@™nwšU@WlI@mVI@WXaW_nƒ@™nƒlkkW@U‚¥@kV@Uw@wUƒ@@IXK‚¥VIn@nU@`@Xl@VV„LnašW‚bVaUwnU„@VIšKlV"],encodeOffsets:[[122119,28086]]}},{type:"Feature",id:"3504",properties:{name:"三明市",cp:[117.5317,26.3013],childNum:11},geometry:{type:"Polygon",coordinates:["@@lL@Un@VVna‚bnUlœa@U‚x@„VbULUKVbn@šw‚@XaVK@UVUXWVnVKV¯„VšU@UUKVwka@klJVIVVXUlJXVaV@VƒšUUVWkUWwkaU@UklmlK@_X@ValKnnÆV²@lVVwUaVƒXa@wlXnW‚bnUVwnK@kšK@UWKUaVUnV@_VynU@a@UVKVXšaV@@VnKnXVV‚UX`V@„blL@mVLXaVLnU˜JXIVJ@amX@a@mnUV@„nVWnkl@naV@„ml„@@KmKUam@UU@ƒ@UlKU™Vk™U™K@aVaUwV™U¥UIkJ@wmI@‚mbkwkVW@UXƒKULU`™IVKUa@LƒkkVmUU@WlULUWÅU@I@ƒWW™nU@@w@a@ƒUam_XyVIVWkkƒ@mwVKXUV@nw˜VXkWƒÅ™U@ƒaƒU¯KUnƒK@ƒ¯šmUƒLXŽVLnWVbVbUVm@Ub¯¼W@amƒ`kb™amLUUUƒ™aUXV`@x@XmJ@n@L@xkJUU@kU@mWm@kUUwUUVWl@VUkIƒy@kkaVUUm™IWVXbWxU@k„mVkK@nWVX¦WxU@@bkx@VU@WŽk@™kUbmJUUmkUW@_kKWKƒ@knV¤kIUKWLUbV‚@Wbk@@VWL@VkI@lUXVxUVU@@mWIƒV@a¯nUaƒaUV@„ƒJ™b@bÞ°VbUš@X™aUVmL@‚VXblŽnV„°˜n@Vnx„@VUUUlK@InJVb@„Vlnn@V™L@VWJU„x@XlJUVVVl@LUUUJ@Lƒ„@lUL°¦k˜V„VnV@„xV„„l@blLnlšLVaXll@šnVUn@‚xn@nml°‚X@lb"],encodeOffsets:[[119858,27754]]}},{type:"Feature",id:"3508",properties:{name:"龙岩市",cp:[116.8066,25.2026],childNum:7},geometry:{type:"Polygon",coordinates:["@@ša„I@ƒVU„bVb°m@b„UXJ@nV@VUUwVW@klJ@UXK@Ul@Xa‚@UVaXKVLlJU£lm„@XLlL@`VXnlVVnIVašll@XV@@Ulw@aV@XwW¥XU@mlLnUlƒV@XwWaXUšJVnUVlb@l„zlJUVk@UXVVVxlVn@nXV@@lVVlI@w@K@mnI@W@wU_VWšbV„VVnKšbla„_n‚bX@°»Van@VUUaUamXUKW„K@a@Ukƒ@wWkXƒWW@wUU™Kw@_lyƒwUkU@@Uƒ@kamVmƒXašUVUka@Wk@»UUUVƒKkbWU™VUbk@mkƒxkƒƒKnIVUmW@kUKmXUmVaU@kU@m@KUWVkIWJ@ŽU@UI@wUUUa@KW»nU@mVkUmm@XwWU@ƒUUmL@ƒw@mnƒVUU@aWak@@amxU@UxULWVXbVLU`mbUImVU„ƒbn‚V@@bVn@bnVWxLmyUbƒIUKƒ@aƒVm™akbV‚UXW„UlKWbkV@„WLUlk@@nšbƒb@lkKmU@ƒUIWJkw¯UUVVxm@@XkbWx—›XKƒlUzWJkUUL@bmKkVƒ@@VUIUlWV@X„K@VkbWx°xUb@LUbk@@VWb@LXJ@VWXU@@bUVV„VVn@VVlLn„@l„@‚xk¦Vx@bVJXbƒn@JlnXxV@@„nJ@X@V@lmx„bUn@xVL@VVKlL@l„„nLVaVL@xkl@LƒxVl°š„X„WVX„Vl„œJWnxlJ"],encodeOffsets:[[119194,26657]]}},{type:"Feature",id:"3509",properties:{name:"宁德市",cp:[119.6521,26.9824],childNum:9},geometry:{type:"Polygon",coordinates:["@@@LVKVaVaUkVU²J@LVU„@@W‚VJUbVVnLVb„L@VUJ@bVbkL@Žl@Vn„y„XmlU@™xV¦„L@Ž„lmz@lnL@bVVšbVb@l„nšKVk„Vl¤@zXV@šl@XJVLVKnXVK‚VnU@wUm@šKUƒ@UlVlw@U@U@ƒUaUKlU@kXKlmXIWKXaVIVUVK@KU@@k„JVUnLVJUL@V‚IVa@VnLšKUnl`Vb„V„V@š‚Vbn@Vzn@lKnVlI„VVKUalkXJl@XXVWVLVUUmVU@Unm„£lK@Uk@WUXK@U@WVwVkšƒĠkĢÇ°aUÅUwmaţƒɱUÇa™w„±V¹XalKôx„@„UVaÜʓͿVóbÅLƒJm„¯Vk¦ƒŽk@mamXkKUƒUL›akbk@mV@LkJWb@Vk„mXk@UVmaUV@amLUKUamI@KUaU@WbU@UUUƒUIWJUkm@šƒw™Kk„VJm@kxǁVƒUK@mUVUkmlkkVm@amwƒLVWU@UbVLkšUbƒ@VƒmK@XaVWU_VJnwV@@kUmWakxƒ@kwWakIWxnbUJ™zƒ@kVW@@x@„XllnVW@xn¦ULWKXxmL@„VšU¤VL„ÞVVUšÈxV„mxXVlLlV„anV@bšbV„„LlÆnnlW@LXlWnXV"],encodeOffsets:[[121816,27816]]}},{type:"Feature",id:"3501",properties:{name:"福州市",cp:[119.4543,25.9222],childNum:9},geometry:{type:"Polygon",coordinates:["@@lxna@nJ@xlIVJV¦UšVxUb@bšLšVUlVškL@V@„VVn@Vb‚Ln‚@LU„lJXblx„@lwXbVn@lU@mxUIV`UXWb@‚nLU„„@Val™UKVaV@UX„Knx‚bn@lUkllnUVnV‚@VLU„È‚lwn@UIlƒšL„x‚™n@VlXIVJV„VVV@XaV@Vb@LnJVbVLnK@bVUnbVUl@nWlƒ@UXalI@KnUl@laœbVKV„lLnWnbl@„l¥°Unƒ„IÆKôa΀U„a@UUwÇWǓIUWUÅVkƨm@ƒ@£@KmLU¤ULˣJ™kUƒVǟUUķ@ĉVƒKUk@Ñ°wôǚç@īšé@Åţ¥mīÛkm¼Å@ƒVķVó°ō¦U°ƒn@bVJXVVL@bUŽƒakLmx@xmxXzW`XbWnXV@bWLÛ@™aƒ@ƒaXbWVkaÝwU@mlWKkLWWkLUKULW@kVmVUU݁UamV—¤›n@xUVUzkJV¦lJU„"],encodeOffsets:[[121253,26511]]}},{type:"Feature",id:"3506",properties:{name:"漳州市",cp:[117.5757,24.3732],childNum:10},geometry:{type:"Polygon",coordinates:["@@@bl@Xb@bVVUŽm„@n„x‚@nKVV@„XVWxn@VnUl@nmVX¼@LVbVV@xVJV@@XIlJXU‚V@Ln‚@lVV@UbVnnWVL@lnXUVmJ„Ll„„wnll@VašUXVla„LVUVV@¼Xl@lbUV™VWbn„nUlb„@@VV@„aVUšmlUašUny@kU@Wkk@WaUVk@@ammk@@U@UlU@aUa@wl@šmXLllnL‚U@anVnU@L@VVV@KlXnWVnVanUšw@w@wm›nÅ@wƒaUam@Uk„mUl@@a„a@U@¥škôK‚wȯ°w@ŻkwǕaK›ÑÛk@ĕōřċ£ĵƒUKW»kÅŻLU@Ulġw@¤Vz™VUbkKUbmLmlULU¼UxmbXl@bWVƒb@bUnV‚UšVbULU@@VkbVL@`U@WX@ŽXV@b°„@b¯š@¤@Xm@@b@`U„VVUL"],encodeOffsets:[[119712,24953]]}},{type:"Feature",id:"3505",properties:{name:"泉州市",cp:[118.3228,25.1147],childNum:9},geometry:{type:"Polygon",coordinates:["@@Vl„xkz@`‚xšLVV@xXXW„Xl@xl„@V@bnV°™@„„LVm°L„V„bV@ƚX„Wl—UmxU@WVULnx„@llUXUJWzn`Vb@„@b@xV@šmXX@„@JÆVVXVKXkV@nVlU„l@KVbULšJV_VK„LVWX@lUVƒkIU¥lIVyVU@wœm˜£nUVWU@aƒm@UmWw@UX@@am™VUn@@aUUlUVanaWUXWmUnkšK@VšUlVVUUwš@XLWWX™ma@knm‚bVb„VXbVL‚@XJlInlšL„w˜mXóšw@çV»ÇçŋaķƧóƅóKġ°nÅUķƑUÇW@—¯xÇ°öÆlV„n@llšaš@„Lšbƒ`™@™„VšXVƒVx@V@bULVJUk‚Ç@ƒ¼ƒXUKk@mmULkaWbk@ƒx@UkL@a@K@U@UmKmbU@kV@UmVUbUmmXkW@LUU@U@KmVmU@bVmKkkWK™nk@@xVb@bkV@V@Vl@nn@bl@VUXbl@XlV@@lmz™VVbkŽ™nUVƒb"],encodeOffsets:[[120398,25797]]}},{type:"Feature",id:"3503",properties:{name:"莆田市",cp:[119.0918,25.3455],childNum:2},geometry:{type:"Polygon",coordinates:["@@VbނVVnUlUX@VKVLlKXXlKXL‚‚nkV@ÞxlbXUWa„b„@šbÜ@XK@aWUXmWaX_Wynw@wnwlK„bV@aUKWUUI@a„mV¯Ŏ¥ô¯ĸU„UÆ@n»¯aƿé@ţ¯nĉĬÝK™óó@™ÑU¼@è™xWô—nƒx™KmkkJWI@UKWaƒUUaamn@lnbWšXXWK™@VxUVkU™V@U™LmlnVWXXVmbUbkVVV@bm@UVnš@bW@@VXx‚n@V„n@bV‚UX"],encodeOffsets:[[121388,26264]]}},{type:"Feature",id:"3502",properties:{name:"厦门市",cp:[118.1689,24.6478],childNum:1},geometry:{type:"Polygon",coordinates:["@@@VlUV@nanL@V@V@L@blK@V„wl@XalbVKnnl@VL„W„»È@lVUIVK@a@UUw„WUU™šƒš@„_™aƒK™@™bkkm@UƒkõŁxóL™l@¦@Vƒb@bk@VŽƒnVln@Vb„b@xmÆnœ@x@x™x"],encodeOffsets:[[120747,25465]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/gan_su_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"6209",properties:{name:"酒泉市",cp:[96.2622,40.4517],childNum:8},geometry:{type:"Polygon",coordinates:["@@ÇnÅaĉ@ƒU¯¥›UŹ‚ƒ£™WUýUU±JkkUw‚yÞIČxĊĕĊ¯š¥ÆUkţ™UÅÓ±¼™IUx¯UƒÒƑ‚ݐŰƒKÝnğ°ÅU@Žƒ@Vn@þš¼¯šWnŎ°XLWlnVnbWnƒVXxmbƒa—bóUƒlǕUUa™IUmlU™ƒš¥™kƒ¥ĉwkkƒÝɛa@¯™™U¯°mVƒkVnKlƒōÑÇÑU@kl™UġŽkUŻnUW™@š¯ƒk»šmWV£UKnUƒmUw‚w@ƒUIVaX™šwm»Èmmwn¯ċ™¯LĉŽUƒJUalka±Va@U‚k@ƒÛф¯WmnUaɝ¤Ûmƒn¯m±x@wóxÛLġÒUx¯VƒÈ™JUbóz݃ÇKĉ¯ōlÝUŎWl¯nťbÝ@¯ǩLġmV@ƯĢkÆm™ĊkVťLɃmÝXó°@„ĢbVŽóVݦɱ@Ƨaġ„UV„ĠÇÈV¼UVţwmbJÇwˋa™XmǯKkkmŽƒbXšm¼V¼ǬŚ²¤ôŰÆƴô̐ŤǪnɆӨ¼ɆLÆłUĊšxŎƞȘǔˎǬǪnƨŮǬö°»šġ„„ÞÜÆĸÒĊ„ǀbƾèôÈ@¼¯þŤĸƧ°VĀ¯b@lÈĊ‚šʠń̐„ȘKǀŽֲॗţÿǕý@ʊǓƨóÆÑǖŃôw@΋ʈƆÅÈVVĊV„óĊÅ@ÞƒĬV@Þīš@°Ž„V@ĸĢƒ°XτƜĠ@ÈaÜ¥Őƅ‚™nğóĕVġUůƿŋ—ĕƒa±V—UťÇğÑ"],encodeOffsets:[[101892,40821]]}},{type:"Feature",id:"6207",properties:{name:"张掖市",cp:[99.7998,38.7433],childNum:9},geometry:{type:"Polygon",coordinates:["@@ÈÒŎÒk„mLUŽlŽU„¯nV°šš@°ɜb„ÞĠaÈ»ĸl‚š„LVUÈ@Ċ@ýUm„@@ÆVĠ¯Þm„LƯޏƒ„Ñ°VVwšJ²»ÆԚVlŤÅV™¦ĉ°ĉĖċwÝJzVxll²IVVVþšX„¤źœV°¦„VĊ@ÆbÈmǔLĸĠ¯Ģaô¯ĸmÆÛUƒlÇĸk°XyĊUǔV„ǩnmV»ƒa@ýnK°n@l¥@»ż„Ċ¤m皃@£ČU@mƒmVkÞUƐ±²¹°‚ĠwÅƑŃU¯™›V¯aÈŁšƒÇ»™ġn_°xŎKlxœklx„@Þw‚„„@Æm²b‚DzLlkšWXať¯ĊaœÑšK±w@wƒUÅçV±Uk™@@„¯š¯xƒU™±±UU°ōxVxÅÔō°ó¯UÝ¦óbÝþƒ@ĉÈóUV‚Ux„„@VŽUVÝwÅÈǎóVkk¯JǐkmmL@„™KÇx@bkš™@U°ķ²ó`ƒš™šmn¯°ƒUwlÅkUƒ`™¦ɛô™Žķz@ŽÅnÇ°U¼¯KmVk²ƒJƒ¼ƏÞķôš¤ULƒ@mnğ`™šÇnUxÇ@Ûÿ™U@ƒƒkŻŽ@x@móJkŃ¥VŹĉóÒĉlċ°ķ„Uƽ܃@›x"],encodeOffsets:[[99720,40090]]}},{type:"Feature",id:"6230",properties:{name:"甘南藏族自治州",cp:[102.9199,34.6893],childNum:9},geometry:{type:"Polygon",coordinates:["@@ލš™nKlnšwX¥WÝXk˜xÞUnƒ°aĊVnUUKlÞĶWXnĠ¥ô»„™@nmVL@¤°™Vz„JšanU@aÆwna@k›ƒU¯šyX_›aĉb™ƒ„wƒéXkWwÅaš¯V¥mƒ¯UƒƒI@ƒš@„mšb°aÈçšUš¥@»‚knwɜƇ°I°ÑÈmVU™¯Xa@w‚W@wšV¯Č¥l¯Uwnm@k˜aUaóKkk@™Ça™b@ŽÒWa¯IÇxÛam¼™VUƒxÒl‚@zÝÒ¯bÝaĉVĉwDŽW›zJ™mJn²mܯUƒ¯ĉ@ġ¤Åb@²nšmlƒ@@Ž„„U„ƒLVxšV™„U¼Ålma™b@ƒ°™l@WIUƒ¯@mƒ™@™™ó„™„@U›zţyƒXÇU™ÇVUUVLkbWakVWmUbkkƒKUÆ»nƒ°Knk@aƒUVmšnk»l¯Ģ›lw@_kKVU@ƒnaƒ@lUk@¯¥mV@kmbW™b¯Åõa@mkU@kƒÇŽkU@›`@™óó—bl¼Uxƒn„¼šlVȄx@blVkVVnƒ`XÈġÈ@ǃK£ÝJmUUnUĖmlU„mKUn™VÅaUw›Uĉ`¯n¯wW¼nxVŽ™š@bĉnƒ‚kIċŘkXUŽ±Ò™xšÈ@ŽX°`l„œV˜IȯĊV„ƒšVVan@VašUVażVmšblkÈW„ƒWIXa„alL@wVb„„V„¦lL@lĠ™n҄U‚nk‚šL@ÆÞkšÞšK‚bñþW¦Û„ċVƒ„ULUºkÈlŎUxÆxÞUUxšÒ‚x„@XbšL@lÆ@„ÒlXVln@„bm¼ƒJ@„Ån„šƒx@bnšĠm„xVXmbÈè@ŽĊ£ČW˜w"],encodeOffsets:[[105210,36349]]}},{type:"Feature",id:"6206",properties:{name:"武威市",cp:[103.0188,38.1061],childNum:4},geometry:{type:"Polygon",coordinates:["@@±¯¥@klwU»ƒƒÞÝmwKm¯™™ç@™kVÇUL¯lVUKġ„ġm@a@U„@X£°l°LŎÇ@aōVÝw™ÔƒKUŽÅš„WJ¯lm@ÛVWa™@klĉUmaƒLUanaƒ™ƒk¯J„™™±KkXóÜÅxƒ²Ç‚@„„nUÒĊb°@™ÆkL™Ž™XÇÆ@xÝn—xWxţ„¯¤ƒI@Æn„ƒVV„VlU²Æè„V@x²x™L›ÒĉbŦ°Wb™Xklބš@l¤šXĊ`„wl@ĢÈŎm@bšnV‚Ubƒ„@șÆÛLƒèǚUÒŦlĸ™`°ĮʟÆǓbĉôϚĊƚĢnŤé΀ÑĸĀĊ¦„@@l°lœ¦Ȯ¦ɆÞĊKŤ™ĵĸů„»mŁyġ™ķŭ@Çɱȭ¯mƧUĊķnŁŻ»UaU™˜ƛɞÝƨů"],encodeOffsets:[[106336,38543]]}},{type:"Feature",id:"6212",properties:{name:"陇南市",cp:[105.304,33.5632],childNum:9},geometry:{type:"Polygon",coordinates:["@@šÈÞ@l`UmVƒ¼œŽ‚@nnÆwVlnVVa„LVƒÈ_‚ÿރ@n„a„xÆ@„lš_š@VxnK@llLnxmÈŎJnbUxšI°Žl@n¦‚lÈIlmX¥„k°@šk‚J„k²é˜@klaUaVaU@@ÝnIWnmnx‚k„ºÞ„„aV™°„V@nw‚KšxôbÞ£šVšU„bšþšLn»mƒVw„IšJ°Ž@„nb@°°I„ġUkÇKVƒ™™@ů»lƒ„Lnmƒ£@anK@Ñ܍n@»mL@£™yk„UUmbUÞÝ@kyÇbó»™XUxƒWVzb±mÝbXaƒwUamL¯»@wUKVwm¯ĵJ°ÅUWVk„KVk°wÈVšVуlUšƒ¥škmVamknƒUw¯¯ƒbċ¥ÅKƒk™Kk„™VċVk£kKVw‚Ñ„a@kóyÛ¯ÇVk™ów›š—Xō¥Ç¼ów™Ž¯U±‚k„ƒ@x›IĉÒÅVmÈnšÜ@n°„bUbÝV‚ŽUnnJ¯Į@‚m¦nV܃@„„L°JXb‚Ñ@šaÈb@šllôLVb—b@lmnVxk°ċ¦U°™Ž@xX@xWbš°UVÇn¯Ò¯Jɛƈmxl@¼"],encodeOffsets:[[106527,34943]]}},{type:"Feature",id:"6210",properties:{name:"庆阳市",cp:[107.5342,36.2],childNum:8},geometry:{type:"Polygon",coordinates:["@@kw‚ĉ—»VamƒƒV¯wƒIóVkl¯™Km™Vō¯ÝWkL@bÝKō¦@Ž™„@š™Lx›@b@l™a@km@@l¯nm@UaÅ@ƒ„óWUXm¥™nƒw`@UUxķôÇ°ğ¦@„VJš_n‚‚IVŽnalxkX„JWn¯šnVƒLšxl¤nnVbklVX@xnxmV@bUK@nm@@xƒV—°±aÅnƒŽkUWnUaƒx@m™n@ƒ¯LƒššmUĀlU@lV@blLUblxklkIÇx¯°‚UXbšaVŽUnšV@°‚LUlnbšX@`°nVmbnÆmV‚kLmK™¦UŽ@X„y@kl@U„°K@¼XbW„ƒš@b„WnLVa„VšƒVz@xlVČ¥lbUxލlV„U@nÆWôn²™VJlU„Ƨ„LnmÜLXa˜n@mœw@wlUlV²mšblwšVȃlLލ„±@lVnUlxnkma@mškšJ@kXV‚U@mn@š¼VXUƒVƒlLnmVbôaVnWV»ÈUl°È¯ÆIn›ÆU@kk»mKkÆġk¯@»mƒk—¯@óÇlÇ@—Vykkl™Uml¯Þ™@w"],encodeOffsets:[[111229,36383]]}},{type:"Feature",id:"6204",properties:{name:"白银市",cp:[104.8645,36.5076],childNum:6},geometry:{type:"Polygon",coordinates:["@@VKUȚl@šè°šnŽ‚LnxÝބ„V¼kx@l‚¦²°ĊóĠ„™Ċ»š@ÈxšaĊxlwÈVŤa@¯²aÇ£ƒJk£lƒnUÞ@°šô™@y„wl»lIX¥Ǫnw@ÑÞWla„ÅlL@ƒUwĉakƒl@ƒš¯mwna°J„V¯nUVÓÞÑm£²óWaUƒÇ@óÝUçV»ÈkkW@¯‚xV@XlK@wX@Vmm_@wÈݙKU¯ÇwVwÅK¯VƒkƒJ™™™XkWVaƒImŽ¯Uk„ÇlVšœĀV°mxóšk„@¼ó„WxĉÜU@Ub‚zÛJÇk@‚ÆnVlԙ@kŽ„x™ô@ĬWL¯ƒƒK@aÛImm™@ƒIUaƒ@™™UŽÇêU¤VÒÇx¯ÒV„šš™lk@Wbĉ¦UbkWV_‚y¯Lƒaó„kŽ@b@nmbkx„°"],encodeOffsets:[[106077,37885]]}},{type:"Feature",id:"6211",properties:{name:"定西市",cp:[104.5569,35.0848],childNum:7},geometry:{type:"Polygon",coordinates:["@@„a‚V²wVJV_@„LlanÅllŦçÜӚ_šlnƒWaôk„xUš„bmV@È°lèšnk°l¦„`@nnL‚@ÈlÜIyVaV@ĊÛXwôƒ@»lƒô™nwU¯›ÿU™Èklƒ°Vn„JUblXšWšš„I„l°U„ƒVƒš—@aVVVmnL@„lƒ„UUw‚mkƒš£„bV¥VUVwۂƒlaÇÝރmk£ƒLUy¯L@WlkKW_XaWƒ—mƒ„ġU@a™k™‚ƒakXkmVwmŹVƒU™b™WƒónmwnWW£„KÈnV¥ƒ¥„ƒÆ_k™lW„bU¯„V°aôbnaVwmaōInÇmwkK@kmLUw™@™`ƒkÅ@ƒwƒb@m݄ĀÇ`U„ƒKUbmUUkÅxmm@›„»nUVk_Ý@™Ç™¦™VÇè¯b™aƒn™@@„„JV„°Žn„U¦™°ÆbXxWl„êƒxš„ĊaœbW`™zV°œ„@lmbÅx@bmV™bƒI™`™¦@ÒUVUI@ƃL@bš¼@ššŽ@„šlmxnL„°ULƒŽƒÞğޛ°kLUŽƒL™°™xVŽ„n„KVƒl@šzX@"],encodeOffsets:[[106122,36794]]}},{type:"Feature",id:"6205",properties:{name:"天水市",cp:[105.6445,34.6289],childNum:6},geometry:{type:"Polygon",coordinates:["@@UyȍVƒVUnn@ƒVU„`UblzšJnk‚@Vb„KU„°l„wš„„W°„nkVŽ‚UÈlš£°V@n¥šV„kl™kU˜±U„ƒn™ƒlw¯UkwmKUlmkUmnkym@ō@U„mWÈU°l°anlJškUKlU„¯Èm@kmWV»kkÝLUWUx±b™@¯ma@ƒ¯™IƒJUxn„m¼™K™ýƒa™V™Uݤóa™wLmxU@¯ƒUšƒb݃ƒ¹lmwmnXŽmJ@ÞV@UbVbkblŽ—@±êƒlI™l¯@ƒlW¦knÇJkm¥k@¯™Jmbóa¯bƒUV°ƒakXlšÅ`ƒ„„¦U¦ÇmƒLX¤mXnxm‚„ôšXša„VźUnŽUxlnlW„bššl@bĢV„ƒ˜nX„WbX`lLXk@Ž°KVz„Kl¤„nÞ݂Èkb„‚܁"],encodeOffsets:[[108180,35984]]}},{type:"Feature",id:"6201",properties:{name:"兰州市",cp:[103.5901,36.3043],childNum:5},geometry:{type:"MultiPolygon",coordinates:[["@@lW²LššƒŽ°I„l„šmbVb„KnbĊVlkš@XbÜU@Žkn°‚XIƒÆ™V„LšÓÞxŎUlôƒ„b°KzU`lXVaĊ¥Xal@šk™™Uƒ°ÑÈwUтV£ÈéVšš„@Vb„Jš@nnÜJ@b„L°„XK@īšóƒwlš@kÓmUÅmK@mƒ_k¥l¯™mkçǯ@nUƒaV™ƒwólXbm„™k™`ÛÔťèkkmÆkbƒK@U`UI±xUƒbWlX„mbVbÅÒólkƒƒIWJkšƒ@ƒz—KŻ¼™@™xUx󎃄¯LWb@ŽÅ҄„±¦U`nbťĀUšVb„LšŽ„U"],["@@ƒ¯lwna@mōȯK¯kW¤ƒ@@V@bĢnĢƒVLU‚°k"]],encodeOffsets:[[[105188,37649]],[[106077,37885]]]}},{type:"Feature",id:"6208",properties:{name:"平凉市",cp:[107.0728,35.321],childNum:7},geometry:{type:"Polygon",coordinates:["@@ÆLUxÈxV°šLÇÞ@xn`Ü@X@nĊŽÆwnJmwUx‚aUkšw@V@w„aVmlLXÝl@X‚VĢmV°@nl@UUUWK@w„ÿVI²Òlmš@nÝĊýVV@nšJ°„„šUłm@kV¼nK›ĢȤôK„blnKllVk²aĠ¥È¯ĸóVw@V‚_„xšmn¦VWôX„ƒÆ@Vbn@°m@kn@@lšb@k‚aœ@‚wšK@™šƒ@UlKVaƒWX™W²¹lӄw@_°›n@@_lKōķW™@ŽmLUWƒn™»Û@›l_Ç`ƒÛmm°ÅbWb@š—VWbƒUUKDŽÅaġlmkUġlƒ»—Lƒl™Um¦@Ž¯U™¤ÇkVUml¯ƒƒX™ƒƒx¯kVƒƒLUa@ml™IkyVaƒ_UV@„mmUVU„ÇŽVzUxUVU¦ƒa™¤l„nVxƒVk„@ƒmKUnUU@b™˜U„ƒ„","@@@Žż@™mlkƒġk"],encodeOffsets:[[107877,36338],[108439,36265]]}},{type:"Feature",id:"6229",properties:{name:"临夏回族自治州",cp:[103.2715,35.5737],childNum:8},geometry:{type:"Polygon",coordinates:["@@š@ż»˜L„y„@l™XI„Jl„ôkÆÑUanaWƒXkW@™yk@U„ƒLƒmUšwš¯„KVlKœ¯Ġ݄݄VKƒ¯mKnw™k@ƒ™@™™»@a„K@ÅVJVU@њ¥š_Uy¯š@£UKmn@‚ƒšó¼ğ¦WmĵXݎkŽVLmVĉU¯bm„ÝV—wWlXÞW¦™xkmmL™šÝŽœ„±U@Vގ™š@„ÅÈW°X„ܼƨyUĮnŽWŽnXÝxUx°lVXJlôV"],encodeOffsets:[[105548,37075]]}},{type:"Feature",id:"6203",properties:{name:"金昌市",cp:[102.074,38.5126],childNum:2},geometry:{type:"Polygon",coordinates:["@@šĢȼ™„Çł°bœU°šV‚ƒń‚ÆǖŰnšÆ„ōĬǔaʠůĭš_kķÆ¥VÑș„çÜKšÅ@DŽƒVaU™m@aōnġÇk@ƒxĉ_™Wk£™@݃±KÈ±aÅnƒ@ƒÝxƒ@kw›lkwōL¯wm`"],encodeOffsets:[[103849,38970]]}},{type:"Feature",id:"6202",properties:{name:"嘉峪关市",cp:[98.1738,39.8035],childNum:1},geometry:{type:"Polygon",coordinates:["@@llĊx„¦šl™¦š„kVVnšJVbǖV„kôV˜a„bnaWw„UXmmamUXkWKō¯Xm°™™»ĉÇ@UVƒK™ķkǼğb"],encodeOffsets:[[100182,40664]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/guang_dong_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"4418",properties:{name:"清远市",cp:[112.9175,24.3292],childNum:8},geometry:{type:"Polygon",coordinates:["@@lǯkÿƒaV¯™VaÈU„¥ÆDŽIlxšmnb‚Uœxl™„Uôl°kš„„Wl„š@ô™VwUanUl@„xVkšaX¥‚kU»„aš¯±@kka@ƒUwmUkwƒJk™˜„±k@ƒ™™L@ÝWUwV݃—xÇU¯ŽÇX@m™Åƒ@@yĉ£VmUwȗ»ÇšUn„lUnWU¯`Ukƒ@@„™x„Ž@bÇxX¼ƒVVš¯LšĀk‚ÝLƒ„¯@VŽƒĀ¯lnĊW¦kVÇôkUDŽUK@ţ™U@a™™ó܃UU»ƒ@™¦k@Vx„KVb„n‚š@„Æ™„l„@xšƒbWšnlU„lxÈlV„È°Æ„@¼™„@x„šWxœŎ‚V„šK°„š¥ššnƒÆkŎ@ÈÑm™„K@¥šk@™ô@„nôV"],encodeOffsets:[[115707,25527]]}},{type:"Feature",id:"4402",properties:{name:"韶关市",cp:[113.7964,24.7028],childNum:8},geometry:{type:"Polygon",coordinates:["@@W™Xk±Ñ@ƒUw™mUwĉwlmn@Æwn£mkIš¥ÇÅ@¥šaƒón£nWWwš£V`Þ@šnVml@xô¼„IV¥ƒkUmkamUkVWwÛ»móƒ£UVÅKmn@x™@kbmm¯a™Xka›VĉaUb݃ƒ²—‚lš„IlxnVVx@„lb@l²™°ƒbV¼lW¦™bUlƒwk@mVVbUxóš™@kƒƒX™ƒ¯lókƒVkš›wVma™nkwƒJÅȃ¦ÇVUbšŽU°„blĀ°ŽkÈ@x™¦Æܙ°@„°„¦óa™VUôlUlbXl@nÜV„„nKlŽnIVÞ°Wš„°U@bnm@¥šIVƒ²Ulƒ°VnalzXyl_Vyƒ¦lƒœLlxš„@ŽÞbšKm„knVWanwƒÑVwČº˜@n_ÞV„aVŽÜIœl@„˜KȚ„VJ@aš£È@˜™@km™„aV¯W@_ƒa¯KmbkÇkLmwƒ@Å¥"],encodeOffsets:[[117147,25549]]}},{type:"Feature",id:"4408",properties:{name:"湛江市",cp:[110.3577,20.9894],childNum:6},geometry:{type:"Polygon",coordinates:["@@@ƒkXƒ™@a„UUċlk„Jƒk„™@wVJXUWk°W@nKnwlUlš²ƒ„blU@‚lI„l@„XbW„šxnm@lW@w„wU‚JX¯VU°`ŎóˋkÝÝkÅ@ÇmğÈřmw™aĵV›xUہ»°™ĠǷnýmóX¥ɅĵҏÇ@°²ĊUĖ±ĮU¤Ç°™Ā¯ɐnżUĊĊĬV@脎@ԃÒU¼l¤nƒĠb„êVĠ°Èy„zVaV‚nUÆL„ašbVl„wÆ@"],encodeOffsets:[[113040,22416]]}},{type:"Feature",id:"4414",properties:{name:"梅州市",cp:[116.1255,24.1534],childNum:8},geometry:{type:"Polygon",coordinates:["@@„‚nԚlW¼x‚¦@lœVl™lLkè„a@zš¤ƒĖ„¼UxlnUKUbÝlU¼lb@„Vx„V„klJÈwV¯š@ĠlÛĖšnƒbkšÆźÞƒUÈôklmšL„¥‚LœW˜„„™nKUkVa°V„x@IVV@x°bUk„a™a@mV@„@y„w‚L„ÑUwVUšV„‚„U‚bÞVVann‚@XwÇÿš¯²aVamkXaÆ»@»nw@¥›UXaƒkbWa¯KUw@¥m@kwmLU»UU™J@kmU@UUWUƒ@ƒyƒanwmçÛl¯ƒŽ¯UƒmKUmƒwVkmÝXbW@XWÝbƒk¯@±‚w@»U@W¯Å@ƒÇ¥UƒU@ƒƒ™IU™ƒakJƒĀ„ꃰšþƒXkamŽ@Žƒ_J°m‚@X"],encodeOffsets:[[118125,24419]]}},{type:"Feature",id:"4416",properties:{name:"河源市",cp:[114.917,23.9722],childNum:6},geometry:{type:"Polygon",coordinates:["@@°VlmX¹laĢÒlm„@„„šVš£‚‚@¦Ģklynn¼lW°z„W„„°VbÈV@lÆbnn‚JškX„šVÆašÅ„W@™ƒUUw@ƒkaV»ÞkVaVLkmVwƒ»„ĕ™£@yƒblçkKkš›U@k¥‚wX»™kmӃ@Wn¯‚I„`@nlb„W™ý„¯ƒé„ÿlI@™XUmWUwƒ@@UJU„Ç„mKUV@x™„ţk¯¯LWƒƒnUxK@ű»Vwa¯š@¤WX@ŽÛ¦@¤ÇIȼWxXŽƒ@Wx—w›ŽUnVbÅèmVa±²UWl@Žk„lȄ¤nôܼXxlUnVlbVn„lU¦ƒJó»@wnkmU™‚Ý@U_™¤XxmXm¤„ô™b@¦Èƙ¦lJn"],encodeOffsets:[[117057,25167]]}},{type:"Feature",id:"4412",properties:{name:"肇庆市",cp:[112.1265,23.5822],childNum:7},geometry:{type:"Polygon",coordinates:["@@l@š¥„@V¼„Vôۚš@bšV@ŤVLȃlVÈólUX¥mĉ°k„ÿU°@„ƒÞKl™ÿ°KU™„UW»Èw@aƒšw@ƒ„@nm@w›£kÓVUVn„Kš™k¥™£Vamƒ@nkKkbÆǫma—kmLU¥™UmƒÛwmVU™mUƒJ—ÇaUxÇIn`mb@Þ¯b@„nJ@nl„U‚V„lVU„L›W¯—Û`Ç_¯`mš¯I™bĉWċzx±J™xš¯ÆUƒƒ_k@™šƒJ@Umb„šXôlLš˜n¦@¼ĊxlUXŽ˜xUbL‚Ġ„UnVĊwlšUš„b@lW„X„‚m²˜@ÞWxXš‚Unb"],encodeOffsets:[[114627,24818]]}},{type:"Feature",id:"4413",properties:{name:"惠州市",cp:[114.6204,23.1647],childNum:4},geometry:{type:"Polygon",coordinates:["@@lbšW°bnnlaš@@wnmÆLVUkÇlƒ@Xk‚V²±‚bnUÆçUaVmœ˜xXw„@WXwÇ»ÈJ@£Ü¥@XW@£°™‚bUx²¼@ƂLVw„mX„°K°Ťlšƒ@wVUnLȃVƒVIky±wkƒKU¯ƒÅkƒ™XġÑۃlwUwlm@m„nKWašÅm›¯óÇmğb¯alĉUwķbmb@lÞÒVn—šmĀŹ@VŽƒbVŽUnmakLm`@xĉkklVÔVJVn—lV„UnmJmaLUbl‚™zmŽkL™a™‚ō@@zš‚V¦UŽV²kJ„nÜU@˜VXUŽL@„lJƒL@bݤUnVŽ—b@xVnlK²„Vx°V„xlI„lkVl²k¤@n"],encodeOffsets:[[116776,24492]]}},{type:"Feature",id:"4409",properties:{name:"茂名市",cp:[111.0059,22.0221],childNum:5},geometry:{type:"Polygon",coordinates:["@@‚LnÇlk„KnkÆL„ƒUm™ÈxlUœJló°n@ššanŽš„„a@ƒ˜@X_@mÝóóU@a™aU¯mL¯ƒƒkV¯™ÇVwkw@V±Ŏ£@™™@šalw±Vk@m„Åm¯™ÿŃƧIÇ`ōô¯_UVW°IV‚ƒx@xkX@Žmn™wXƒWa@ƒƒkkJ@kVƒa±„k™kVmxmL@‚¯XXlWVUI@xƒš„lƒIklVȃV@b„šlW@„@nUxVblVxkôlx™n„‚y„šnIƻư„aXwlK„bVnƒŽXb‚L„¤„k‚L—èƒVV¼ƒŽ²IlĠVX„ynz°KVx°@VlœLlblKœš"],encodeOffsets:[[113761,23237]]}},{type:"Feature",id:"4407",properties:{name:"江门市",cp:[112.6318,22.1484],childNum:5},geometry:{type:"Polygon",coordinates:["@@lUXx°JWnnƚXVš„W„X@„šºVLV¯nU‚Vnb™ô„x‚aXmW™XIšŽUb°xlK„l¯œK˜xXÞ°ŽšXÈ¥Ü@„ĉޏU™‚çš»nóƒVma—x‚¯UÅU¥Ý¯@ƒƒç@ș@çĉÅUmU籃ĉKÝxÝ_ÅJƒk¯»ó¯nmèkǀšŽWxœ¼mnUÜġ°@¦@ƒxƒLkŽÇaVnUxV„™šVlnIlbnÆÆKX¦"],encodeOffsets:[[114852,22928]]}},{type:"Feature",id:"4417",properties:{name:"阳江市",cp:[111.8298,22.0715],childNum:4},geometry:{type:"Polygon",coordinates:["@@°„nKV°šb@bôVÞô@n„VlÒôÆUnlnn@lmkmVkƒaÈkÆƄ™k¥‚ÅÞ»ÆKXkW¥ÅLmÅkamJUkš™UƒVwUmÈbl„K„w‚@@¥Ģ¯VÛnm›»Xw™lƿ™@kbW™—aʵ@óL›l¯ƽ@™ƒƒLn°ƒÆ@nUl‚²kx™b@‚š@šō¤U²@ŽlxUxšÈU°lŽ„"],encodeOffsets:[[114053,22782]]}},{type:"Feature",id:"4453",properties:{name:"云浮市",cp:[111.7859,22.8516],childNum:5},geometry:{type:"Polygon",coordinates:["@@@V„Iš™l@„`V„°Å™šw²I‚wČyĊXša°Jn™°_È`Ü_°˜œX‚KVƒkUUƒVkƒ@mmI@ƒ°a@Ýnam_ÈJVwlĉX@„šlUšómaUmVU°UK™¹@ƒƒWƒXU™™WmÅXm¯IWwkVWlÅLݼÆl¦ƒšÅÅÇl„bUllnknm@kmVmóÅkуUW`—@@„ƒb™ƒm™b@™¯mkô›IkVÇwnš„VƒÅKmlƒLklmȁKƒšVĊK°²„`n˜¤n„U„bWl„xVx™LUx@°nXm`VklVxmnnx"],encodeOffsets:[[114053,23873]]}},{type:"Feature",id:"4401",properties:{name:"广州市",cp:[113.5107,23.2196],childNum:13},geometry:{type:"Polygon",coordinates:["@@Ș¼VxUnĊ¤@z„@šÆ@nÈW°ÈV˜w„ŽUÞVxÞX@ŽšK„šl@ބVaĊbœU@ml£k±lUƒkkJƒw¯UUw±ƒkLUm@w˜aUVmÞ£@a„KkI@ƒ‚KVUW@—ÛVƒmlIU±VU¥™@yğzƧǃƒšƽĠřšÅnī±m@ƒ²¯lƒ°@nÝÆóUll@XnÝVU¦mVV°—„V¼™Jƒn„b@°mbn„ƒ‚@²¯‚¯wVwƒ@@nmxX¤¯L@ŽVLU„m@@l"],encodeOffsets:[[115673,24019]]}},{type:"Feature",id:"4415",properties:{name:"汕尾市",cp:[115.5762,23.0438],childNum:4},geometry:{type:"Polygon",coordinates:["@@@‚„@VxnXWV@š„bVššJ„„V@ÞÅU¥Ċxš£UWU‚wÅUU¥WVUkĊÇnkV`°LV™„wƒƒnU@™„ƒlbĊ¯„Vnalšš@@çkUÝ¥ġaó¯ÅaÅLŻÆUýmy¯ó@ĉÆó„ȯw™ÆXbmLƒ‚@nknVxkx܄ĢҚW„Æl„V°„Ll‚²xlz"],encodeOffsets:[[118193,23806]]}},{type:"Feature",id:"4452",properties:{name:"揭阳市",cp:[116.1255,23.313],childNum:5},geometry:{type:"Polygon",coordinates:["@@V„Ȧ„Æ@X°V@@¼‚x²°@„lÞaWXX@‚aÞWlnUŽ„xVnnL„‚°V„@k‚mĢl@„ak™@mlk°aXƒ±„nwm±™²¯JV²@ƒwW˜—_mƒa„V»ƒU@m¯ĉUф™šJl™„ašbVn„lĸLlƅÛDZwÝ@ĉxó@è™@k™mbƒUĉ°kaƒ„@šmV„„ƒxUš¯KU_mlĉÈVlXUV¦ÆVxVŽVX™¤ĉwV¦ÝÆ"],encodeOffsets:[[118384,24036]]}},{type:"Feature",id:"4404",properties:{name:"珠海市",cp:[113.7305,22.1155],childNum:1},geometry:{type:"Polygon",coordinates:["@@„è@„Þ°V¦VƁ°˜wnb„UÆ»nçƏ@nxܤ²llU°VnÈJސ°UôéšķUklƒô£VVˌKÞV°£n¥ƒ£ȗ™Ýy¯¯mÅkw¯bÇĔğ@Ýn¯ĊƒVğōŁŻƒķJ@Ț","@@X¯kmèVbnJ‚™"],encodeOffsets:[[115774,22602],[116325,22697]]}},{type:"Feature",id:"4406",properties:{name:"佛山市",cp:[112.8955,23.1097],childNum:1},geometry:{type:"Polygon",coordinates:["@@Èb˜Ž„InVVšnUÜxn„šVV¦nK˜lnbÅǬlalL@mn„Ubš¤l¦™šƒLUmUVlԜ¤@xmnVl°_XVVmƒkVmș@kn@VƒUK@°KW£nw@m„@Ux°x°@±„mƒna@¯ƒa„mšIU»˜ƒU¯nUV¥ÞUWmk@Vk¯™Ukn›ÑWݐƒĊÛ@Ǧ™W¯Wݗw›Lk°ƒkL¯wVa™WJXšWnbƒwkVƒ™W@kĊ"],encodeOffsets:[[115088,23316]]}},{type:"Feature",id:"4451",properties:{name:"潮州市",cp:[116.7847,23.8293],childNum:3},geometry:{type:"Polygon",coordinates:["@@°ŽÜknèmx„b„z„@V‚VX@VnV@lšIVVV¼nKlxn@@¦Vx°LXbla„ŽWbœV°£¯™W@nW@™‚aUñVœwWš»@¥ŤÅUÝǓÝóV@ńǎkUVmƒIUwÅVWÇX¹›—@W„¯bkl@nlšƒb@‚kġŽn@l"],encodeOffsets:[[119161,24306]]}},{type:"Feature",id:"4405",properties:{name:"汕头市",cp:[117.1692,23.3405],childNum:2},geometry:{type:"Polygon",coordinates:["@@‚@U±°Iš±n²mx²ƒ˜@œWºXÈÆUVx„JUnlVȍ@ŃôUǔÞVçn»VyĢÛVm@»kaÝUǼóšÛÈķKċ¥X„¥Wwğk™ƒ¯@ƒwķKƒkUm™aƒbkš™IƒšVÒ°Ċ@n„VU¼ƒ‚„bn˜`X—„x"],encodeOffsets:[[119251,24059]]}},{type:"Feature",id:"4403",properties:{name:"深圳市",cp:[114.5435,22.5439],childNum:1},geometry:{type:"Polygon",coordinates:["@@ÞLš„@xšbV„šVšK°™X°Kô¥Vw@anU„胐š‚lkĊl@wn_lKnbVmU„aUź@nÿ˜™UmÝѯUƒbk„@ÆkxŻ@™aÇX—wƒJƒƒ¯LķÝUĕ™ó™ĸóêWº@b²nmĬ™Æ"],encodeOffsets:[[116404,23265]]}},{type:"Feature",id:"4419",properties:{name:"东莞市",cp:[113.8953,22.901],childNum:1},geometry:{type:"Polygon",coordinates:["@@Ŏ@ššblKnšykVa‚KnbnIVmUƒ˜kUmUIUә„ƒçmV@bUxó¦¯LW‚¯š™L™UUƒ™a@w™ƒÝKğŚ™ƾ„„ƨÈĠy"],encodeOffsets:[[116573,23670]]}},{type:"Feature",id:"4420",properties:{name:"中山市",cp:[113.4229,22.478],childNum:1},geometry:{type:"Polygon",coordinates:["@@‚XœÒlmšV°ôÞÅ@m„¯°k„±‚@@aX¹¯VݏÇIUmV¯kk‚±Û£mw@‚Őmèżmô™¼èVš"],encodeOffsets:[[115887,23209]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/guang_xi_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"4510",properties:{name:"百色市",cp:[106.6003,23.9227],childNum:12},geometry:{type:"Polygon",coordinates:["@@lklWXL@VšI‚l@XnJn@VUUalk@mK@kny@UlU@a°™„ƒUU@VmaU@Ua@UWw@ƒn@KmLm@alkšmnI‚m@an@VIUamWÅImwU@@a@K„X@JVL„UVmUaVkUa@m„@@Ulmkk°ƒUaVUlKXbVwVIkaVmUk@KVk@a„aW¯m@w„¥laœX@KmaškVmnUl@nxVKšInU@yVaVIV@na°KlxX@@_lmXšUV`VIV™V@„n@lšbn@@WUkValK@²yl@„„VUV@@K°L@KU@@UVaXIVVV@naVkVa@K@UUK@UUa™LWa—w@m@K@UVVƒ@mVUUVKnL„mVL„K‚bVK@UUIk›mI@mUIVK@IUK@VkLƒ@WU@mU@WmUk@ƒI@VƒJk@WwX_@amK@UUWkIƒ„ƒK@LVb@mVmakL@J@bU@Ux@xƒbmI@`ƒIwm@UbmKUaUWa¯UkJWV@XƒJUU¯LUmV@ma@kkamKwƒLUUmWVkkm@aVUUkVKnVVUmXK@UW@km@Ukkm@@W@U™kUy@I@aUUmbƒ¤U@kUmL@bmJU@Ua@wkLWWkL@Uƒ@VaU@ƒLUakKWbkUWVkKkLVLUV@JVbƒz@Vƒ„@ƒVmUU@kVmK¯@VƒU_™VWakVmIUKUaU@@bml@XU@@V@LmKUV„mVUKƒƒKƒbkaUXƒKUL@x@V@l@„mxU¦„V@ŽlL@V@Ln@@VV@„nlKUaV@nLUbmJnL@VWLkbmV„@@L„W‚„XLlx„VVIVV@x@V²blUVm„LVUœK@kWWXUlV@Xl`„LX„l@@VšŽƒn@VnbVš@lVUVUÈVbš@@`UXU`l@@XUVm@kš@xmVknUJVXUbmKULmbx@VlJ@LVbkKUbVLÇUUVƒUVmU@VaUkUKƒVUwmLkUUVVlƒbka™XmwƒKUšVVU@@V±Uk@VWUUm»XamU™bƒKk™`ƒ„™U@UnWW_kKmbUVUVmnUV@„nJVUlšUbU@UV@n@JmI@VmbnVUXlx¯ŽkKmnVV@L@V™bkV™Umm™@Ub¯LmlUƒL@VWLkmkLmmn£WmnKU_mW™š™bnbmxƒ@U¦UJU„@Xmlk¦@‚mnUUm@@Jn@lV„ÔVJnIVW„I@a„ƒÆK@I@aVK„IlŽÞnnl@nl`nbÆX²l@xV„@llbVn²ŽVVl@nn„V@IlW@Un@@kVa°KšnÈmVaVXUlaVƒÈU„VlwôUlynIVašan@lVXb‚Iš@n¥la@Kš_n‚@bÆx@XnJV„nKVz@`VXVšU`@bƒ¦UV@VšIlx„UnV‚K„XÈbšVllšbVbnVn@"],encodeOffsets:[[109126,25684]]}},{type:"Feature",id:"4512",properties:{name:"河池市",cp:[107.8638,24.5819],childNum:11},geometry:{type:"Polygon",coordinates:["@@lLVl„bVV@nXVlI@JVX„mšn„W°b„IVV@‚ln„@nalVUb„nW‚@kVkÒlbVKn²°bUŽlV²@˜X@`nb„aUI@ƒ°wlU@aXJVI@aVK@wUamIXm‚@XUV@@bV@Vm„ImnUUwVaVKXU‚nVK@akƒVwV@nL@UV`n@@X‚lnIUJl@X¦˜V@aUIVm@anƒV@UwnL@VlbVL@KVVXUWƒ„wUUVUka@UVJnUlbnalbVVn@°„„LV`Þ@šXVxV@@bVlUVVbXnWlXnmlš@XXWVXJmbUI@V„llUVkn@@VWV@Vnb„@VXUJVnn`lLVk„a„»lVšLnw@WV@lInw@WnU@U@m‚knUVó„K‚wUmUXUƒU@@wVJVIl@XKVVVbVI„J@Un@lŽVLnm„b@U@Ul@nUš°VUVJnnVJV@„@mVU@ƒ@wkUVwkKWk™yUUkU@alkÈ@lJ@x„Ilƒ@UUWVkUw@Kn@@kmaƒVUl™UUL™ÇƒUUKl@UUmL@aXU@mlUUwmKkUUVKVUƒaƒKUnK@U@Vl@XUWU„KlwX@šb@K‚@XkV@UwWJka@aUwmV@U™@@U@wUm@»kLWVkIWŽXnmV@VkbmKƒLUbk™Va@aƒa@@aVU@aVak£@ƒ±UkVU¯V™UUƒJVƒUIƒ@kxmUmWUbL›w@K@aU@@aVU@Kma@aka@_VWkk@UWVUKULWKULUš@KUnƒwVaUKƒxU@UmaƒL—m@kVmVa@UkƒmI@ƒ@KmIkxU@@K™U@mmakI@VƒLkmWkkJ™_U‚@V@L@n˜xXbšKVb@VVL@V@LUbUlmbU@UUWJUb@VV@@L¯K@LU@UVƒƒk@±z@‚kLUbVl@Xm@™akm@ƒU@UšUJU_™VWŽkn@`W@kw¯LmbU@UJUb@zmV™JULmwk@mVUn™lnb@L›Wkbƒ¦@x°nXŽƒb@bUl@LVlUnlbUJUxWakLUVVb¯„llkn@Vƒ@@nVbUlVbUnƒVUK@IƒW@L@bV@nxÆJnXVbUJm@@bnmJ™nkl@b‚nnK@L„m‚@Xx@VVbV@nb@UVVƒ„¯š@bkV@Vmz@lnLl@kŽVbUVm@mI@Wk™J@UWKkXkl"],encodeOffsets:[[109126,25684]]}},{type:"Feature",id:"4503",properties:{name:"桂林市",cp:[110.5554,25.318],childNum:13},geometry:{type:"Polygon",coordinates:["@@nU@J‚X@`XLm¦Vb`lšVXXWš@VblČnVšŽlanLnmVLšK@_Vaƒ¥@kUa„@VmVb„aV@XVVzlVVK@knKVmX£VKšLlbnš@b@llL@xĊôXaV@°È@¤„bn„V@@Wl_„V„U@W„nVamw„wVbn@„K‚VšLX@VmVUxlV@šnVV_nK@m‚I@Wn@@IšUĊ@@wVWX@@I°VVm@wmU@m@IUƒV™kƒlkUmmkÅV@@aV@@Wn_UKla@kšaV„šlVanb@k„@@KlVn@@aV@nIWW™UUaVU@™kKmwU@UImKk@UU@w@W@‚™k@™UkWƒ@mk_W@Ua@a™ƒƒ@—¯ƒmV£@mƒUUam@—kWakƒVama@UUm@nw@alaUmnUlVlIœV‚™šLVyk£Vm@k@UUJkƒK@kmKUw™KkWK@UXImyVwnI@m‚ƒkUlkUKkUVmƒw@kkJWUÈm@_k@@aƒaW@U„UJUwU@@IWKkƒmUUV@nVl@bVb@bU‚UXƒakw@ƒWUkbkKƒbm@™xUlkLm@@wmKUX@‚™UaVW™XVmU@@UUUƒxkmWXkKkUWaUaUb™L@`UL@LV`UXmK@VmakLVbkL‚xUJUIVbUVVb¯KƒV@Xnl@lVXbmÒnV@L@VWKkVUIWJkIƒŽUamUUbm@U„kU@JUbW@X„WxUam@kbVVUnUJmUUV@bƒU@UUV™@ƒVk@ƒbƒmULV¦U@V„U`VLUL@xVbn@UJ@nWJXXVŽVV@bkxVbUx‚Lšš@x„¦@šU‚lXUVVlULV@@šnŽU„ƒb@xl„nJVnlVknUlVUbmŽU@ƒbVš„x"],encodeOffsets:[[112399,26500]]}},{type:"Feature",id:"4501",properties:{name:"南宁市",cp:[108.479,23.1152],childNum:7},geometry:{type:"Polygon",coordinates:["@@lKnbnU‚@Ua@K„L„ƒlJVX@VnL@bW`Xxl@„I@U„Jl@nV@X‚V@nXV„@lK@UVL@JULVJ@nnJlœVJ@VULaƒLUKƒnmKULVVUŽ@nU„š`lIXlln„K@UlJnb@nšV@LV@lwnJ@L@„nJl„@VUbUn@l˜n„KnbVŽV@„wVLUb„xVm@LV™VKXLVKVLXU@VllUX@`lb@bnb‚L@ŽUV@bV@@b@Lœx‚KVanXVƒUUmVUUUaVUky‚UUa„ImK@mUUVUkKU_@W@UVVVIUW„UVaVU@UUKnƒ@k@al@ll@bnL@b„VUV˜X@Vœ@@b‚Knblmn@V_@aUalL@a@akK@kVKUKlwUUnV¥VmU_VWVIVaX@Va„alńK@LVJnalL@LnK„wlVUw‚mX@VXšƒlLUVnblaUmVUVwXU@Wm¯Va@ÞKnw@w™mšk„»‚UVW²a@_mW@U@I„y„LVUUKW@@™„LX@VUV@@yVU@UV@nwUUmJka@IU@ƒmƒVkaW@UwUX@`ƒ@kLWUk@mƒkUUm@k‚UUWkUƒkWxk@@VƒK@nV@UVaƒUUJmIkVƒ@UamLUbkVmamLka™@ƒ‚kmL¯WI@wJmwƒx@akU@aUKmbkaW_nW@_U@Wm@a@wkwUKmƒk@ƒbkb›w@mKUkkU@J@bW@kVWz@bVUa›VUx@„ULkJWbXVVXƒ`@œmJUVU@@Lk@WbU@UJlnXlm„Vx@Ln@‚b@K„LX„WJUUW@kƒaUVUbmV@nnV@n@lVLƒVmLX‚mXkV±@kxÅL›šUbJWIÅJ@I‚mXalkUamKkškL±aVwKƒUU@mÞnbWJX„m„@lbmKULWUUVkaƒbnn@Vl@VVV@VƒbVbnLWLXJWxXLV@@VV"],encodeOffsets:[[109958,23806]]}},{type:"Feature",id:"4502",properties:{name:"柳州市",cp:[109.3799,24.9774],childNum:7},geometry:{type:"Polygon",coordinates:["@@ƒwU™„aV@nVaUVklmkUUmmIkƒ@w„aVƒm@™U@VKUkVUkWV@™ƒ¥@w™™KVwUalw@aUUUWWXI@mVIm@Ua@wVKUKV_UƒV@U¥VK„n„al@„Uš@VU@V„V@aVUnVVIVmUUlan@VbXwWƒX@Va@IlVVƒn@VanVVb„lJXIVJlUXL@U@KmUnÑWakU@mkƒJUI@mk™@wUmmUV@JXaWIXWmaUIƒJƒkk@W„nJ@„ƒaUak@›kkJ@kUKU_ƒ@myUóWUkm¥kUmL@KUKm@k_UmVa@ƒk@@UmU@mm_—JWIUVUŽWLUlbVUJÇVUIVwƒKUVk@mU@n@lUL@Km@@l@L™VƒzJmUU¤m@UbV²U`U@@¼Vn@x@Vš@@VnUVx@blbXIVxU@Wl@@L™aW@kxƒLXVWVk@@U@VmLVŽ„L„bUVULVV‚lnLVxkV@nWV@bnKVVk@VL„VšÈVKšVVk„Unb@lm@@LVxUlVX@Vk„ƒJ@wkIÇ@kl@blVVVšzXllLUxlV@x@„UV@nƒ‚U@UImmUIUV™¯mVk@@V@VƒamnUKkm@@VƒIUJUaUUWLk@UJUI@xV@V„VWVnxƒLUômVV„@VkVVVUnV@UVkL@VVV@bVxla@bkXVJVn„`nU@bƒb@bVL@VnJ@„l@šV„aU@@_lW@UUU@Unƒlll@XLl@@UX@°bVWVanLlknVV@VVX@VVƒnUŽVLmbXJ@nllXX@`VXƒlmaXVWk@Wkƒw—J@„VL@J‚bnU@bn@@bVKUnVJVIVVVL²a@bV@@Vl@nUVakalmš„UL@VUL@V‚a@mXl@nK@UlK„L@Vl@@nkllb@š„Vnn@‚šnV„™V°l„šVInwlKXxlU°Žn@@ƒ‚I@UnVlakUJWkUK@anUWK@_ÞJ@U"],encodeOffsets:[[112399,26500]]}},{type:"Feature",id:"4514",properties:{name:"崇左市",cp:[107.3364,22.4725],childNum:7},geometry:{type:"Polygon",coordinates:["@@@JVzšl@V@Xn@ll@VlnX@@VWLnŽUVmUULVlUV@blnUlnXVV„K‚xnLlb@lnbU@Vn°KVV„I@WXUlI°VXb‚VVbnLVan@‚x„J@_nJ„a@wVwV@@a@IU@UU@WKXwWIXKmKUa„a@U‚UUUk@@Umm„albVUXVVKnL‚a@knƒWƒXImanÝV@„V‚LUx²blKl™nLVbklWbn@JÆIXJ‚IVaœ™ÆKlw²@lUnWWnK„UUK@k@mmU@mnUVaVU„b@lVXVXIWƒƒK@Lam@@KUwnƒWkkmVIV@Xal@@KV@VUnI@›„_UWWUkam@kkm@ka@mƒk@wkJWIUU@WXkW™XkWWLUUƒ@UakLƒW™XV±VIVWUU@anUWaUK@IU@Vak@@UUKWaƒ@m@ak@@wUkla@mUaUklakwVƒ¯¯@WWUkLkKmaƒ™kLUnV`UxWX@Jkn@bmlƒakkk@ƒb@l¯bm„ƒbJ›b@VXn„bVV@„ƒbƒJUkkKWVU@mœÛVUUW@UVUJWXkVkKmUL@WW@U„Vl@XXKW„XJ@XVlmbUxnnm@UlVnV@XVm¦VJb@šmLkKÇbXblVkn@l@bWnX`V@@IVV@ŽV„V°n@@_naÆVVbUVVbUJnzlVUl‚XkV@Vlx@X„VnxƒbƒKUK@b¯VVUV™L"],encodeOffsets:[[109227,23440]]}},{type:"Feature",id:"4513",properties:{name:"来宾市",cp:[109.7095,23.8403],childNum:6},geometry:{type:"Polygon",coordinates:["@@nVlw„@VJU„„IVVUšV°lU²V@„l¤Ub@bUV@b‚@„b@bUblšVa„KnLla@UnUWmXlJXUlKV@V_U±Van@V£nV‚I„yšU@K@kn@@LVK@k@mnVl@VU„LUxVJÈUVIU‚aVkXKVVUXJ˜In`@nnV@Vl@@„UbVnl`n@VL@LnKlVn¦VlôXV‚nz„@V`VL@llIœll@Vb„b@ƒmIXƒl@„l„IVJnbWXXJWb@IU‚nVVn@xlš@nVJ„I@W„U°LUaVUUaVJVIwlKUalKnb@UnLVWU_@KVK@_šKVa„@VKU¯VLVKn@la„aUkU@maVU„J@k™@Um@XmbkyVaUIUU@KV@laVn@KXKWUkUk@ƒaW™UUVw@aXKmƒVaUUkšmIƒlUU@wUa™xUmmU™¯™U@WƒLUmVIUym@UVmUa@wmw@çm@aWLU„™JUIUamKmL@™aƒx¯¥ƒkU¥U@±„k„UVmKU_mJUbkKm„ƒLÅǙ_@WWUXUmaVUkK™„UWW@nVxkUƒxmL@KkKmbUI@KƒLkƃbUbW@UbUJUXV`UnU¦mŽVVkxVLUL@llL@b@bkKVb@bU`m@knmaL@a›@@U—WVUƒU@amK@akkk@@b@lm„VL@VUVUbƒVVXUJUU@V@XV`lLUVVV@nnLƒJVbVlzUVVbVVnUVVU„"],encodeOffsets:[[111083,24599]]}},{type:"Feature",id:"4509",properties:{name:"玉林市",cp:[110.2148,22.3792],childNum:6},geometry:{type:"Polygon",coordinates:["@@VJUXVVXlWX@V™xVnX@@`ššULWŽUXÅbWK@mULUUmJ@n¯b@l@VULVx„x‚XU`VXXJVI„V@nm`@nUŽVXn@lWVn@b@Jn@nU@Lm`@Xn@WJƒ¦U@@VnL„lV@@Xl`nIlJnkVL„w@KVK@UšaVL@bVKX™lUUKVK@I„VšL„a@U@WšLUlVL@bU@@blb@VlbUxVbXUVJ@xVL„U„lV@VU„bVLnKl„XJ@L‚b@an@VanL@`VLšKV_UWl@U_„a@WVInlVUUUVm@I@W@wVakIWm@U@ƒXwlaVbnI@ƒm»Va@aXaVLšU„»@aVa@k™KkL@KmU@WƒzUK@wU@VWUUVUUKUa@mKmbUK@_nWVaUkVaUaVUVLXKVƒVUVmVI@UkKkLm`UkW@UwWW_„UaU@WakXmK@xUXƒJkƒUUWUk@Wl—mJ@km@@aUKzmyVk„a@kkWVUU¯lmU@@w‚kkmV@Vk@mÅIƒ‚Ukƒaƒ@Ub@m@UUU`mUbWaWmb™X™XKWIXUWm@љ@y@UkIUJUUWLUWƒL@UkVUxW@kaWbKWnXxW¦n„m`XLVlUbVbUx™I@JmLUKUb@VW@@bkL@b@VlU@xkš@L@lƒxXxWXX°V@VVVbUVV@UVVbULVnVJUb²b‚aUb@VVVVInlV@VnXaVUšlI„VUb"],encodeOffsets:[[112478,22872]]}},{type:"Feature",id:"4504",properties:{name:"梧州市",cp:[110.9949,23.5052],childNum:6},geometry:{type:"Polygon",coordinates:["@@VbXblVlLXWln„wVV@VV@UnšWUXVbš‚@VWXa@kVK„UaVaVkšUlyX@Vaƒ—VmUwUaVU@UÈymI@aU°@š™nWV@VaVaw@IV@VmnLVK@kmmna@™„™VbVI@aV@XbW`U„„LUVVx„@VbUV@bl@VLXblJn¦lL„°°@n™@K@UlLnK„a°LWbnJ„¦UÒV„UllLlVnKnbWnn„V`„w‚@@Xa±™n™l@XKV_„WVkVa@kVyUa@wU£UW@UIVW‚@@a—wWaX_WKkVmUULmak@UJUI@±m»™—k@m»VyUIm™nmmwnkUmVaVIUn_mW@»Vk„@VwkmmUXa@IƒaVm—mƒ@Wm_U@mIUWóLmUk@laXmmkUK@UmKULUUmWULƒ@VakU™@Ub@bƒ¼™VUKWb@bUbn¼@„mJUakbWx@„@VXnlJUb@x@X@JUnVVUVmkUJ@XƒbV`k@VXU`™LUK@_mKUbm@@b@„U`@nlV@b„UnbVbn@@`VbUbVV¯bm@@mJXb@bVnUllVXUlbUl@LU¦VVmŽkLVb@b™l@V@XlK@V@nUJUz„°mŽwmLmlXbWVU@UUUlƒIU@VVmV@@¦‚bXbWxX„WlXVWL@LUmkbU@@LVVVJUblzna@WVnš@@lƒIUVnbV@Vlƒbkbm@ULUKV°ULƒ@"],encodeOffsets:[[112973,24863]]}},{type:"Feature",id:"4511",properties:{name:"贺州市",cp:[111.3135,24.4006],childNum:4},geometry:{type:"Polygon",coordinates:["@@nL@xn@lKVkšwn@„alLlaXV@„lx„bVWV@aUa@aUk@mVUnVl„XL@JV@VxVIVƒX@„b@bl@@`ÇnXVlI@l„xUnlVVLkllV„@nmJUxnzWJ@VXLlŽšLVxnL@l„LlŽVI@V@lUnl¤Uz™Kš@„Vl@š„L‚l„Lnš‚b@VnVVU@k„a‚Knxn@VkVJ@ńUlakmWIUaVanm@_UK@UVWUa@klXam™U@Vmƒ™VIXW„@lUVknVlKVLXŽVXšW@b@VlšnnVL@KXL‚Kn@lb@UnW°@Va„X„WVb°aVa@I¯aUkUaVKVwƒaXk@a„a‚™@wkm@alanUVw@alK@Umkw@UƒaUmU@WXUaUK@UW@UaVWI@¥Xa@w@WWšVƒXwƒU@mKUXUWVU@a¯kl@akU@UULmK¯VUVW@U_m`U@@xVbUz@lUbUlƒXU`WLk@mš²šWb@Ž@ƒxU_mƒXmmamLkUkKVkUƒVу¥mIXa¯KƒbmLkK@V@Lmš¯@ƒ¯kKm¥kIWaUKk@@aVUUaƒ@UwVUƒKVƒX_WaU@@bUJUaƒš@šmbnn@lULmKUnU@@J‚xUbUbU@mX™š¯@VŽ@bnJÇz@VUVVbVxUn„˜UbW@kz™VUlUbVbƒŽUL@lWb"],encodeOffsets:[[113220,24947]]}},{type:"Feature",id:"4507",properties:{name:"钦州市",cp:[109.0283,22.0935],childNum:3},geometry:{type:"Polygon",coordinates:["@@@IlVVlnL‚@œxla„al@n„VLlx@x@bXnV@@`mXX`lbnaVL@blV@b„wnx‚I@xXJ°nK‚l„š@lbnKnblUVanKVb„@lUnJVI„VUb@V‚U@m„L@Ul@Xw„llVVXV@lVnlVn„l@XVlK„@@_VWVxX@lb„U„nV@@JlbnIlmnVV@UwVK@U@k°a@mnIVVVK@nXLÆaVWXVK™™@_W@Umšw@UXWWkUUVWUIVaƒUkJ™UVWbUmU@mkUJUU@UVab±aVaUIUmVKUaVUU@VUUaUUU@W¯XWWw„w@k@Kl™@wkV@U@alK@aX@@UmIUWUIƒ@mmkXU`U_WJUnUJmUk@@amLU@UVW@UkU@@VƒbUWVUk@@wmKkUWLUWX@JmIƒlUkkKWKkLWU@UKWa@bU@@a@_UKWƒUUUmJmw@nV_@ġğKóLmbU¼VÆ@xUXƒ@Um@wklVnUn›lkaUV@„lV²WVklWXXbWlkVkIm`UUƒLƒUU@UWƒx@XU@@lWLU@kbUbV`UXllUV@bmb@LnKVbULm‚šnVVIV`X@"],encodeOffsets:[[110881,22742]]}},{type:"Feature",id:"4508",properties:{name:"贵港市",cp:[109.9402,23.3459],childNum:3},geometry:{type:"Polygon",coordinates:["@@n@VzUJ‚nVŽ„K@XšVš°nVVnšwVb@xVV„knJl™VVUbn„WL@bUxVVXš„bl@lVXkWƒXwWaa@¥‚@nUUUV@„JVkVVV@XUWanknK‚xnƒ¯VyVI@m@UkL@W@Ušk@aUalKnUUV¥@KVkkaWVkUVkUm@aWanI@n@°aUUVaUa@_m@UamaƒV@akU@mV_@ƒa@KWIkƒmLUKƒaUVU@ƒkƒVUK@wUIWVUaVwka@Uka@aV@@aUKVk™K@X@Vƒb™KƒU@JULVLkVWšUL@aUK™b@VUL@LƒxUKmlkImJk_@WU@ƒkmK@UV@„¥XIm@@Wn_@KmVm@@I@aUmkXm@UWV@mn_@mƒUUJWIUWV_WƒwU@mUknVVmxU@@VUV@zU@UVW@ƒK@šX@VLUVƒKƒz@J@VnX@`±bUXVƒ¼™lšn@xmxÝL@‚Ubn°@XWVUxUVVnkbWVXV@Xš`ÆȄKnƒlLVanIV`nLVUlƒ²ƒV@V¦„l°¦„w‚b@šnKnLVbVJšIVƒXK@b‚n@ènx@xVbUnV‚"],encodeOffsets:[[112568,24255]]}},{type:"Feature",id:"4506",properties:{name:"防城港市",cp:[108.0505,21.9287],childNum:3},geometry:{type:"Polygon",coordinates:["@@XV@X°°U„lxkbVlVb@nkbVl@xl@@b@n„‚XbVL@Vl@UbV@@JVLXbmV@bVVUXUJU²šW„XlKVb„@VVXKlXšWlXXWV@VXJlI@x„l@nlbn@lln@lbXalIVK@ƒVwœUVb‚U@aXylUX@@aW@U_UJmU™nVKUamL@Kna@aVUkkVWU_ValaV@XK@kV@@W„wVXV@„V„KVVn_lJlUXkWaXWlkXU‚±kU@ƒVUlbœkVmUmlk™¯Ý™™W@mb@¦VxULm™kJUU@ma¯wƒmkX@VóJ±bUVUXÝWk™lWXXlƒxUaƒbƒIğ™Ç@U@mVUKkkm@UJm@XnWV@x"],encodeOffsets:[[110070,22174]]}},{type:"Feature",id:"4505",properties:{name:"北海市",cp:[109.314,21.6211],childNum:2},geometry:{type:"Polygon",coordinates:["@@VaVLnK@IšJVwUaVaUkWKn_mƒX¥WwXm‚LXalbU£UyV„Å@ݙwm@™°l›LÅUƒmk™mwÛaƑLÝUUm@ȣƃV_„Ó@£UƒƒUVƒ„™¼U°W̄™ÞVbXbôx@b@bmV@ǃ™UÝ@@ĢU`m@ŽnxnIVV‚VX„VL@`@bV@@aXbVL‚@XVlKXLlLVl„knJ@I‚WVXXKlVnL@xl@UVVX„a@UV@VlX@VUV@nK@bl@nVVIVmXIV`V_lWnn„@VJVXnJ"],encodeOffsets:[[112242,22444]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/gui_zhou_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"5203",properties:{name:"遵义市",cp:[106.908,28.1744],childNum:14},geometry:{type:"MultiPolygon",coordinates:[["@@@UnUlJn„w‚JU°VL@bnVšU„wlJ@XƒŽXVlU@klVUJknl„UllL@bUJ@xULUlƒ„UblVkblbnw‚UXmla@„wV@VK@L@UXaVKVLXWƒUVa@U@Im@@W@£UKUakKWIXU@al@@llUnL@W@Un@@VlUV@VIUanKl@Xb@lmxVb@b°bb@nlJVVnnJ@b@L‚V@ln„@LmV@Vx@blnVK„nlJXIlw„J@҄b@nlK@Un@UL@VVVVUUUVK„l„@VUVL„J@UVUUw„@Wm@™„UV„ÈVlbUb@JšLlŽX@@x„„ƒLmŽk@@nlx@bUJUzVJ„@@LVxUV@bWxnLnVVK@_‚K²xVbV@n¥@aVI@b„@l@Va„Knb@n‚`n„mmý„W@ƒU_šwV@VlVV@Vn@n„˜@nI@Jn@°¦VaUU@™„mVVWVaUńU@aVKnƒVbVUmmU@a@kUw™m@aUUmUUJ¯lakU‚aXaWUUaVƒkk„amkmUnVlULƒVlJ@XU@UJWUUw„k@aU@WbkWƒL@U@WU@@XUKmV@aUVwUĕUJUamUUVUÑm™nIVJ@kl@XalJVn@KVLœ¥@UWIXWmU@mVUKnUWLUKUaWUUKVU@U@anUny@UlUkK@w@a@aVUƒ»UkVw@Wmk—JƒÅmUUVmwXalLXWWUnam@XkƒJ@UVU@U@W„@@U@I@Wl@Ènlw@KXLWb„lVUkalKUU„VVaV@@wnIlaUmkUƒKWU@KkUkLWaƒKUUWUn@VƒK@LnnWJUIƒVkUWVnV@V™@@XƒK@VUIUJ@IWJkX@VVJ™IƒVkK@I@UVaUWk@m„@wnUWKk@mxk@@„lV@b„xmb@x@VUmLkUƒJ@nVV@b@VkLVbU`¯I›l@™U_UW@UU@™™ƒK¯wm@™xƒL¯¥kIƒ™ƒ‚@bkbƒ@Ua@ƒm@kkW@XVbmV@ŽkV@bWbUbV@„¦ƒxXlmVk@ƒ¦™bkaWL@KUImK@wUK@VUI™b@bmK@LÅy@akXW@kbWlXblL@ŽULUbƒ`@U™kUymX¯@mšUJUUJƒL@Lm@@WX@lU„VlšXll„@l@Èk°V°Ž„X@VU@UVll@XUJVXUVm@@VXLWlnV@Xƒšk@mVULnxV@@bm‚kL@VWLUbU@UVm@ƒb@ķ¥UnmJ@UUVƒkkJUšlÔU`UIW@ƒ°kLUlUI@WVI™U@mWKkXk@ƒ‚WU@bXšW„@J@xX@l@LVl@xšLVxXX@x‚KnxVknb‚KVV@U„L„WlXU`@nUlšX@llVXšVU„KlkUKlI@anKVLXKVaUIVWV_VK@VnLlU„»VKVL„m"],["@@@KlKkUUVVX"]],encodeOffsets:[[[108799,29239]],[[110532,27822]]]}},{type:"Feature",id:"5226",properties:{name:"黔东南苗族侗族自治州",cp:[108.4241,26.4166],childNum:17},geometry:{type:"MultiPolygon",coordinates:[["@@VV@XkV@bUbWJU¼Vb@Vnb@bš„@J@bƒL@LV@UVƒlUI@a™KULVb@bkJmx„šlLVxknVJk„‚xnKmnnL@bn`WIXlWLU@UxVbUVmKV„XI@JVIVJ@U„L@Wš@@UmUXUlV„UVJXImm@K„L@UVmVXV‚„LXblKlV@LXV„LlVVnkbmJ@xnXl@šbXa‚@Vana„ÒšL„m‚VnIl‚Þ¦°k@b„@@lV„nJlUnš‚VX_„@lVlK„šV„UUxVLVWVIXJšUlnnWlI@KUaUUVKn@VaVXV@na@ƒmw¯@mUkJUamI@lk@@am@@I„ƒUmVImUUw˜™@anUVaUU@LU@WaWUXWW„wV@VwnU@L@ynbl@@X@a„J@nW@@Vn@„lVLlxnI„lš@@UWKUƒnIlJXIVllIVVš¼XK@aVI„V‚@@bn@VKXLVKVVVInw„J@UWI@mX@WKnI@KmU„UVJUL@V„KW@@k„@aU@@W@InJWUXwWI@Wƒ@¯wkaVaUIl@nŽValIXWWI@UUm@anwWkXWWIUbk@UJmIUamKVUUUVVama¯VkIVVUlKnXVwX@@WVaUUVa@IlƒaVmƒkna›wk™UU@ƒU@mUVƒšUVwœl°LVbnJVU™¯la@mX@@UWKXU@aV_V@@JlkUƒ¯@V™nK@km¯k„U@ƒWUW@mmƒU@™kmlU@wkL@WƒUkL@VmLƒJ@b@V@bknUUVK@UVKUK@Uk@Wa@LUVVnUbmVk@@UU@@aƒV¯K@U@UU@WmUL@aU@WV—w@ƒ˜I„xXll@UX‚K@KXXVJna@wWaƒ£naUKV„m@UU@mUmalm@@XkVm@U@VƒLmWU@kkWxU@@bVV@VkXVlƒVƒ@UUk@@ƒmI@KUw„m@UmVƒUUwU@lwkV@IUa@mUaVIVKVa@w@U@™UJkb@n@bmJ@XmlVUxWXkJmUkUUVW™xUlU@ƒaULUšmbU@@‚WXkmƒL@xUV@nUxÇm@„XLWbnlƒnV‚nnUV˜U‚nVVz„@lbUVVlULVb@V@nUJkwm@Ux@bWbUK@UULka›JbƒU™U@U@lUK@XUJmn™J@bU@UwWa™x@zkJWnUJUUVšVV@bXn@xVb@J™L™m@X™w@`@bkb@VmXUV¯L@mW@@n@V@‚ƒL@K—IW@@aƒaUx¯@U„m@XbW@@L„V@bnVWVkKUzlV@bÆa@lnI@VV@@LnVVKUaV_VJVbnU@bn@‚‚nX@yVIVxXKVLlUVaXU°J","@@@KlKkUUVVX"],["@@UUVUkUmV@ln@VXVK@K"]],encodeOffsets:[[[110318,27214],[110532,27822]],[[112219,27394]]]}},{type:"Feature",id:"5224",properties:{name:"毕节地区",cp:[105.1611,27.0648],childNum:8},geometry:{type:"Polygon",coordinates:["@@UkVƒ@k‚W@Xn@@K„KVIVVIn™°@nWVzšl@V„_VaVK@kKWaXklaX@lW@bÆz@KnL@ašaVJ@UVL@xnLVJ@LXKlbša„¥l@nUWk„wƒ¥U@VaXa@amLkUƒKmƒ¯kƒmkIUaƒKUIWƒkKm@anw@mlwXIƒmƒUk¯@a@amUƒ`kkKWVkxmUUak_mJmw@w„mXUW¯X›_@WnI@aVwkWWýŃU@WLkU™aUbVV@lUVVnm@kUmV¯™kK™LƒwmVUUaWV™aaWw¯wƒÈ@VULUVUUƒK@nWJkI™l@Umxnbm@kbUJƒa¯bUbVxmLUV™aU@VUUWxkVVV@bUV@XWbnlUbƒbUJlbUV¯b@z„`WbXnmbƒaƒwUwVWUƒbUxmbU@Uam™@Vƒk™VaƒwVaUƒWI@mUKóz@lUlÅ@WIƒb@xXxml@XklULWKUmwUa¯KUXWJkaULmKkLWbkKUVƒImƒƒWa@kUaULƒW¯LƒK¯@kbƒL@b™x@J@bmnnlUšlzU`U@@Uƒb@„m‚n¦°bU„Vx@bkVm¼mx@mk™mVV@bkxVn„aVV@bU@mL@b²`lIVV@lXLlš„bVxn@@bl@XllIVšnbVšn°°wlbXw@mVa°lVnU@mš™VLVbn@@b„@@WVnUV@Xlxn`VznJVb@L@bV`V@šUnwšU„@WUXKV@UUlmUUlaXalLšm„bšIVbnJVIlVVaUUnWVXn‚VL‚k@ƒnWnblnlb²x„xVKVXlVXLVW„LlUVJna@wVL„¼@JVX@`@nnx@nWJU@Vx@XXKšŽUblxUš°„LVKVVlL@KnbVUnJ„IlUšƒnKl£VW„x„IlJ@nšVÞUVVnb‚VX@V_°lnK","@@@UmWUwkU@Um@@VkL@V@„„‚V„VkV@nbVa@ƒ"],encodeOffsets:[[108552,28412],[107213,27445]]}},{type:"Feature",id:"5227",properties:{name:"黔南布依族苗族自治州",cp:[107.2485,25.8398],childNum:12},geometry:{type:"Polygon",coordinates:["@@‚V@IöalK@UV@@KUaVIVVœLlaVbVWnX@‚@LnUlxl@naVLXVVaVU„J@lUUanWWI„@VlV@Xbƒb@V„n@VmVVbk@kU@V›V@X„J@zn`ULW@kK@_WVUK@LUb@Jlxn@nnWlU@@b„x@XVVU@UbVb‚@n`VI@VVLUlUIUV@KmL@VV@XIV@@lVLVmXV„@WLXLW@U`šnkb@Vl@UL@VVV„L„llX@`lIXb„J˜IXW„L‚aVL@ŽXXW‚Ģ™b@bmK@L@°@Vnxmxšn„K@xVn@VkL@V™Lƒakbl`VnnxVnUlššV@@VVXV`@šœk°JV_UalK@U@aUU@m„IlVnK‚V@U@wnaƒw@akU@ƒl@nwl@XLmV@xnƒl@VXUb@V@JlL„UšJUI@UlWUƒnLVUUaVwV@XKWkXJm_@amKnmmLwlƒUIlmUwkKƒ™nwlI@aUaVKšL@bVJ„kVUU@@K„K@a@I™ƒ@ama@UUaV»XIVa@alU@WUU¯IWVUbkVUKWLUwUJ@zmWm@@amVUaUIU`VbULmU@KU@@UmJ@kÅb@akUVylLXUmU@aƒU@KX@Wan@Vƒ°@Vw„b@bX@˜J@L„K@@U@mX@@n°KVUnW@Ula@a@_šx@WšnšK@IUa@wWm@aUUU™VVVIXmlI@yšwXbVxV@@ašInmVI@WVL@k@VšV„V‚aœIlbVK@VVLXa@aVwn@lxVI@m@UUaVKUkVUkaƒ@UymUV—VUmmU„mmkXaWK@ƒÈnVw@mVU@w„KlnXW@V@naV™VKUk@KVIUWƒ@mk@KXU@Um@@lVƒk@UVJna@UWaƒL@a@ƒXa@kmmVUUk@mkkƒamJ—ImJUUmIm±aUUkambkamVUU@VlbUbVVƒxX„WVUU@VUakU@UmUV‚U@mnUVVnUbVJ@b—UW¥kLVamVkUaWJU_UVWKk@@nl„UVVJUXm@Vm@UnVlmbnmJUbULU@@UUKWVIWxnJVb@xUL@bUJWIkxƒbkb@xVJƒbmU@kW±LkKUkVa@a¯am¥ULkalÑlKXUWƒXƒaVakImVƒ@ka@UUƒJ¯aƒX™mmb—KWU@wUUƒaUa™KmU@UXlWb—¼WLUKUb°„UlVbkbVL@VƒšƒJ@nVlUbUXmJ@VX@lbUbU@@bWb@VnLVJ@bVVUz„ŽVL@lnL@b™VVVULmKUk™Jkbm@ƒxVb@V—kƒKVnnV@b@ŽWXU‚„nV„l‚VVXVJUXlVXbWV@VU@Ubk@@KWbUUmL@JnXV°XJ@_‚`UbkXVVlÆkbƒ@VLXVV@‚V@k„KXX@`V@@n"],encodeOffsets:[[108912,26905]]}},{type:"Feature",id:"5222",properties:{name:"铜仁地区",cp:[108.6218,28.0096],childNum:10},geometry:{type:"Polygon",coordinates:["@@°a@aÈbVUlU@aVKnVV„VUlyX¹lWVa@U™VƒnUVU@m™@mUl@„mÞw„@‚xnIVbna@KVI‚J@kwV¥ƒUXÇVkVW@kkKWU@aXUWmnIVa°VXbmL@VVbnVVVUb™VbšJVbVKXkVKVanU@aWnWUWa@U™nk@mVIVK@wXxlLXbVJVlKœbl@VI@mšaXalVV„VbX@@ašalnkx@b@V‚b@Vnx@bVVUXn¤WXn@Vl@Vlzn@š`@I@KUU@ƒV£namVkXa@aVK‚nnU@anVlKƒa@UUU@amk@»kƒU¯@aš„VWnkWmkImU@akaVm@»VUV@UKnkW¯XWlkUKnIWaš@nmlIXmWUnwUwWm@wULmaUJkIUaƒaWa—klwkwmJmU@bkJ@XUJ¯W@XbWbUKUkWJUUVKnn@UmmXUWa@mU@@UI@WmXVykwm@kaULWwU@¯ƒlKUUVU@mU@UkmaUbmV@b—š‚xVnVUJVnƒ„@Jn@@bl@@knJVblInV°@nx@„mbU@UWUbm@ULVVVb@LkJmXkm™VWIUJUXUKVwƒV™UƒŽkLkUƒ@W`Um™kVmIUƒ@kƒ@@a¯lÝ¥kmJUƒn™KƒÑmbUb@Wb™ak@mWU@UbƒUVVkLlbUVƒkXaWK@LkxÇmk@@X@J@Vƒ@@X@VUV@V„IWln@mbXVWXkKWbnxVUnV„ƘInl@XUxVl„¼UV@b@b@xlLkV@VmzmV@b@VUVVLXVVbVLXKmVVLU‚@nnVWXXJ@V›¦UK@LUmkIWbk@@lUImJnšVÒVUnVVbVIVĖUxV‚@bnUVL@WV@@X@V„KlXXaV@@bƒlVxXVVIV@@WkI„UVKUkVmlnnŽƒbllU„VbXVWbblVkb°ŽVInVVV@bšnVx@l@bnVVnUŽUam„UL@bƒVVÆUbUXU‚ƒn@šVVUb"],encodeOffsets:[[110667,29785]]}},{type:"Feature",id:"5223",properties:{name:"黔西南布依族苗族自治州",cp:[105.5347,25.3949],childNum:8},geometry:{type:"Polygon",coordinates:["@@VL@Vl@@IXW@kVUVbnW@XlKVVnU„VlL@b„aVbƒb@xX‚°ÔUxV@kbm@VxkxWJœ„V¦ƒŽ@ÈnšVKšxWXJmV@n„Ò@xVbn@@blLk`VX@bššla²JVUlnn@U±lw@wnw@mlwVIX@@m@klKnk‚a„KnwmmXkƍVm„Uš¥l@nb°n@„aVwVmVIVnI@a„¯@mšU°ƒl@@VnI@JV@UV@b@IUbVJmXöºƒzllUbVa@aXUl@„U@llLnKVaUa@UmK@UšwV„bnKV@VwVK@UXƒV@Vbn@‚w@U„WnX‚@„a@m„I„™@UUKlaUaVk¯ƒVaVLXK˜»XaWk¯mƒkğwmW@mIƒVkwƒJUIšÇVwU™UkVKkƒm@UkmU@WÅwm£Vƒ„m¤¯IkJWa™_™lUbmJzÝJk„ƒUÇVU„ƒ‚@bU„Ýn™m¯LUb@`mL@VkL@VƒUmmk@UU±Umka@kUƒ@ķymUkk@mmkÝmUaUakImV@V@VÅLƒ¦ƒJUXmJXšWb@n°Æœx‚¼nV@LlbUŽUbmL¯@ÞbV¤nbVx@bUVlblIœ™@KVVUnVJUn@VlLUlmLUUUxmK@I@@VW@@bU@UJmUkLVVUl@b@V"],encodeOffsets:[[107157,25965]]}},{type:"Feature",id:"5202",properties:{name:"六盘水市",cp:[104.7546,26.0925],childNum:5},geometry:{type:"MultiPolygon",coordinates:[["@@ôyVL@nXJV„Ub„x‚bUŽlšU„@ŽšnŽVbV@naVw„a‚VUXVx„x„bnaWmXaƒ_@y°aVUkaVI„aVamkXa@WVU@aUUlUXwVV@UVšbVUnKUwVa°a„bVIlan@manw@VšklJXI@m„LVVVUVK@U„ǃk@KUa@UkaVU@UVWV_XWVXVWlLXKlLXaÆKšwVL@akKm@Uwƒ@@XUVk@VUI@wWK@aUV™I@UkK@ƒmL™Wƒ@kImJƒUÅVmkXUW@UJkx@nmx@xkxV²m@kmUV±Ikb™™@aUWl_kK@am@Ua@wƒÑ@mnUWIX™wULm™@DŽU¥›ƒXIlwUwn@laU@Vw¯ÓW@w„aUaƒb@akKƒUmVUUkL@WmXUaUV@lWX@Jk@@UUKULmLUJmzkKmVX°VšUnWKUL™ƒƒL@mU@UnVJ@b@„UV@Xƒ`m_@l@@bmbXJmnnš@°˜wnn@ŽVLX@V‚@nVl@nk@@b‚l@nn°WlXzW`XXVKnUlxVbUb@‚V„Xb@Ž‚VxÈbVlnbmn@ŽkVUL@„ƒŽmLUVVL"],["@@@ƒ@UmWUwkU@Um@@VkL@V@„„‚@„V@VkV@nbVa"]],encodeOffsets:[[[107089,27181]],[[107213,27479]]]}},{type:"Feature",id:"5204",properties:{name:"安顺市",cp:[105.9082,25.9882],childNum:6},geometry:{type:"Polygon",coordinates:["@@lL@bUK™xÅLWbkKWLkKUXUWWXU`UX@VUVlb@VVb@L„l°xXx‚bšbXUVb‚VnU„xšKlL°šnUlVn@UmVU@kUUVašblVXKV@ƄXþlXUxnU@mVK@_@ml@UU„@šblU@KnLVyUw„@@UmkšWVw@UVK@VXzVK@n„VVUUW@kVJnlaš@nKW™kaWL@U—™õb@JU@mU@@_WWƒL@lUU@WUUK„@lakÅUUlWVa_@`WIU¯mW@InKVVXa@Ll@VaV@@UXUWakUVWUIUW‚UkUƒƒmVXW@@amUUm„L˜l@UUa„wn@lašIVlnLVKUUšU@amK@kUKƒVyUU@aUImK@UXa@aV@VakaW@@UnIVWVaUkƒb@mWƒX@Vxm@UaU@W„@VULUxU@mLƒaUŽ™x@VnL@VVbUbmLkK@kƒVk@WV@bUbVakk„yõ¹nWUIVa@J@aVUU@@ImJ@Uk@¯„™V@nƒ°@bmJUUJUnUxƒbm@¯Žmak@™¦ƒVUnŎWlnnmxƒLbmlkL@l@nWVnlÆU„VnIlJ„@šXnK@„lL@VšJVU@bXL@xVJUl@VU@W„@Vxn@"],encodeOffsets:[[108237,26792]]}},{type:"Feature",id:"5201",properties:{name:"贵阳市",cp:[106.6992,26.7682],childNum:5},geometry:{type:"Polygon",coordinates:["@@nŽlLX„VJ„LVblJ„n°ln„„LlVnKlU@nUUa@WlX@l„n@‚Vb„@la@a„„šlJ°¦„Kšwn@°x„LVkUmmwUmk_la„bšK@UlK@UUm@wƒL™mnwmw@U@¯@KnL@aša‚ġXWW@UKbƒKWX—JƒIWakJ@_kWƒkƒKUU@UVKk@@Ula™mV_X@WKXKƒ@WUUnUK@kU@WJU@@UnK@LVUVJVkUK@UUJm_@UaVaV@UU@Wƒw@aV@Xkmmm@kw@IVa@KVLXU@`lLX@VKm_@yƒI@WœU@UlVl@UanU@Uƒm@U„aWaU@Ukƒ@XJmXVbkV@ŽƒIUVUbWUUKmbk@kwmV@K@mWUXUakb›KUUUJVb@LU@@VkL˜š@VXKlbXšmL™@kbm‚UI@lVXUVƒU@mULWy@UUL@VUx™Xnl@Vƒ@VxUzmK@LkV™aƒ@VVk@@n@`UL@nmV@bmJ@Xœ`WX°WVƒn@xnxnIl`VbnVlwXUlLl‚„_nV@b@bl°„V„nWJkx@nmx@b"],encodeOffsets:[[108945,27760]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/hai_nan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"469003",properties:{name:"儋州市",cp:[109.3291,19.5653],childNum:1},geometry:{type:"Polygon",coordinates:["@@஼jpnr’``ŽpRVHʘ̤žZt^JÖA˜[†CâlTébQhRPOhMBcRSQiROE[FYdGNOEIH]MgEAMLLIAG_WMCSL@ED]PCLYC[ZIHgjSxJTMbHNEFCMEE_HSDFHSLECRNSFDRICHNADGPI\\RZGIJTIAHLDQOHG`GTNCOIC@eIGDWHIS[kiE[FMbECZS@KKS[FDWsCeRuU_DUQNOE[LKGUBM¨EDQP@HWHGDImXƒCog_~‹I_fGDG|QDUWKBC\\ore|}[KLsISBHVXHCN`lNdQLOnFJSXcUEJMCKSHOUMDIm_‹DI`kNDIGEYFM\\YPEEIPMSGLIKOVAU_EBGQ@CIk`WGGDUM_XcIOLCJphHT_NCISG_R@V]\\OjSGAQSAKF]@q^mGFKSW^cQUC[]T}SGD@^_ˆaRUTO@OHATŸ”"],encodeOffsets:[[111506,20018]]}},{type:"Feature",id:"469005",properties:{name:"文昌市",cp:[110.8905,19.7823],childNum:1},geometry:{type:"Polygon",coordinates:["@@€hIJ¤Ī¯LQDaFßL[VQìw€G‚F~Z^Ab[€¹ZYöpFº lN®D´INQQk]U‘[GSU©S_­c‹}aoSiA£cŁ¡©EiQeU­qWoESKSSOmwŸćõWkàmJMAAMMCWHGoM]gA[FGZLZCTURFNBncVOXCdGB@TSbk\\gDOKMNKWQHIvXDJ\\VDTXPERHJMFNj@OwX@LOTGzL^GHN^@RPHPE^KTDhhtBjZL[Pg@MNGLEdHV[HbRb@JHEV_NKLBRTPZhERHJcH^HDRlZJOPGdDJPOpXTETaV[GOZXTARQTRLBLWDa^QAF`ENUPBP…\\Eji`yºEvåà"],encodeOffsets:[[113115,20665]]}},{type:"Feature",id:"469033",properties:{name:"乐东黎族自治县",cp:[109.0283,18.6301],childNum:1},geometry:{type:"Polygon",coordinates:["@@ªVLP`@PEdNRAHOPEAKHEVL`GZBJfvdTAXNNTZJFPrHHNpKTD\\ILHbEVd^J‚OHLh@NNBnHP`\\xH@NBRLJTlŽNv_^CTLd@bNDVFbxdFV€UPBTKOGEOUO@OEBXQP[H_EI\\EbeYa@UO_J‹MEJ_IEDKJUGMDcNUd_FMTEJSGoZ]EIYGO[YW‘gEQ]a@WHEDQKUSDUGAbYBUpSCYNiWqOSQEoF[UcQISWWNMSDe_cLQ_UBiKQOOASQAWgS­ā]ZaŽSPÝZ]XMXSŒ[^oVËNgNKlE RôEø"],encodeOffsets:[[111263,19164]]}},{type:"Feature",id:"4602",properties:{name:"三亚市",cp:[109.3716,18.3698],childNum:1},geometry:{type:"Polygon",coordinates:["@@®ĂhTBXTRPBRPjLVAR`dKf`TC‚NXMTXRJVdE\\FpTRrPjXZMTDVoZABaVHTCLVCRGF@X^bFR’hZXP\\ZHHMA[^wBWXJlW¤EJ[bCTOF‹WWMm@ILMGWQ@DQ^QNWFSHEbF`OXNbO„VNKTEPDTLTCCVTREfvfEHNbRAENH^RJXCFHNFRpVGHWISDOTMVCZeGamaLoLÛD¹¹ėgsia{OųE—Tt‰lɂwr}jŸR±E{L}j]HąKÃT[P"],encodeOffsets:[[111547,18737]]}},{type:"Feature",id:"469036",properties:{name:"琼中黎族苗族自治县",cp:[109.8413,19.0736],childNum:1},geometry:{type:"Polygon",coordinates:["@@bRFnHNbHŒgN@NPEnbXP@bND`NT\\@\\QZb@`@J]V@XhžDpW„nCJGHGXO@CR§FANHVKLF\\MPVR`CvVfQtDPKpGHG@S`WJP~^dSTHWX\\RHTFACQTIAUPOU@MG__IaYSFQK‘NSbORHXCZeTFJg„B`YBMNMFi~IVDV[tGJWXGDQRGF]ˆJrALgESLSAYDGIaFeXQLS\\MKSLSQYJY}eKO[EHiGSaK[Yw[bmdURgEK^_kcSGEOHKIAS]aFSU@Y]IWFUTYlkP_CUOUEkmYbSQK@EMWUuAU\\M@EpK^_ZMDQ^OXwC_ZODBrERURGVVZ\\DTXcFWNIAWJWAYUUFYEWLQQaCIZeDM`cLKRGpanJZQd"],encodeOffsets:[[112153,19488]]}},{type:"Feature",id:"469007",properties:{name:"东方市",cp:[108.8498,19.0414],childNum:1},geometry:{type:"Polygon",coordinates:["@@ºŸx‹JYZQ”IŠYXLl@dR\\WZEn]bA\\S~F`KXaDeTiNO^EEKWEDQXITBXaWaDQMUJOIaTWf@NJV@dSxGZ‰Fu_@WMKAUˆ}AQ@MwG_[GOAmMMg@GKP]IUcaFKG[JSCoLGMqGEOYIMSWMSBucIeYA_HUKGFBLOFGPQBcMOF_@KO©UAtERadwZQ\\@ÊJÒgòUĪRlR°KĮVŽLJ"],encodeOffsets:[[111208,19833]]}},{type:"Feature",id:"4601",properties:{name:"海口市",cp:[110.3893,19.8516],childNum:1},geometry:{type:"Polygon",coordinates:["@@ńZƂtĢ¬æßFuz¹j_Fi†[AOVOFME_RBb]XCAKQKRSBQWSPY\\HbUFSWSPoIOcCOHIPkYCQ]GdGGIFQYgSOAQLK`MFUIGa@aQ\\GGUFcHKNMh@\\OYKAigsCgLSF]GOQO]@GM]HyKSHKPW@Pxi@EMINYREXWRQ@MQcFGWIAwXGRH\\yDI`KJIdOCGRNPNtd\\UTMbQYi@]JeYOWaL[EcICMUJqWGDNZEXGJWFEXNbZRELFV]XQbAZFrYVUBCLNFCHmJaMIDDHXHEhQNXZ_TARFHVB@DTQIRR@YHAJVnAbKFUEMLd\\c^ÍÞ"],encodeOffsets:[[112711,20572]]}},{type:"Feature",id:"469006",properties:{name:"万宁市",cp:[110.3137,18.8388],childNum:1},geometry:{type:"Polygon",coordinates:["@@^J@ZTVbET^JBGLFPTHld]`FLQhcVanx\\\\ZbLHTGj\\FLP~fIZRZPVTQFSVAFJE^NDLEE[~LjsxVTG\\NZZNGlLRRGLJTV@hPZANN^@T\\NEPPbDZXO`d^HSvcJDIV\\XZAJUFCLNP@PQ¤@[ïKLÑIÏ]ÇE±I{uƒ­YśUćFcYUmsVeBSVgB[RO@aYYPO^]@UVaNeDShMLG\\EfFVE\\F`"],encodeOffsets:[[112657,19182]]}},{type:"Feature",id:"469027",properties:{name:"澄迈县",cp:[109.9937,19.7314],childNum:1},geometry:{type:"Polygon",coordinates:["@@T\\GJCXJH@fJDDPNCNJENN^NLHBNSx@DDYbBLLDRbjZTj@`XXTlG^Xr@PJLW\\WLTlWR@HDJTD@X_PO@STMDNTMVV@NLDM`M\\XM\\JNBH[PYZ‡úYzŸ`Ċ\\ÎÝd]c[NKVFLEBaUmBIZGQ@JQSR@CUAEGBQ`SWYRMFgWGCGJCbNnIDGMEDKVAZUEqBYRa^WEUFKYQMaFWXEHIFWMYHCrXVIIiaK@aMCUYNSIISTwXALKH@XWXIEIJQCG[IEQDE_XSBaa[AIPW@]RS[FWS[CD]PEBYNGFSaSyJG]@ugEUDQlGHiBKHUIoNSKqHFaPMICK]UUHIPDJMuCA[SCPIDIOILGAEmU[POPBVSJDREBGS[QXWSGcT}]IO_X@TGHoHOLCX\\ELT@LYTD‚aFENF\\lj"],encodeOffsets:[[112385,19987]]}},{type:"Feature",id:"469030",properties:{name:"白沙黎族自治县",cp:[109.3703,19.211],childNum:1},geometry:{type:"Polygon",coordinates:["@@D\\RV]dTXELnHr]^@LETBBRTHPi^[@U`QTHDJ`MGSogDIPKdJ`WVNHCXHl_DJR@AH`FBVPUJLHKNTJOFFZON[ZEHFCJlMJ_ŒCn`CJVNGPLTNDFIdVTWEIPmRKMc_kDMWGGUTAtJLK~\\f{pqD[LAVXRCH{HC`eŒJ`}@W^U@I@_Ya[R[@MSC_aMO@aWFmMOM@‹haGGMEmaQ[@MESHaIQJQ……MckBIw[AOSKKAMPSDSLOAV_@@`KJRbKRDfMdHZERgAWVsDMTUHqOUr@VQXTT@Tƒfg‚L^NH\\@heTCZaESNObHPƒHeZF\\X^ElM^F^"],encodeOffsets:[[111665,19890]]}},{type:"Feature",id:"469002",properties:{name:"琼海市",cp:[110.4208,19.224],childNum:1},geometry:{type:"Polygon",coordinates:["@@TP\\pATHTGlZDJGAQjE\\Rb@jVBDCN`JZ[NCNHNXbULPrP\\KNbMTLjJJRFP`“pNLZz^FLRHjVPZ@hxVKbHBHMNNJFRlLzGPnNHhIrHHADcPWdUAmEMVQDSKYHY\\EhBN^HpXGNDBNNBnIß‹Å_g{³So]ã@ORO@KMEDIVYB[WJUICudGTc]P_YWaCOOMFS[]@MMYBgOU@ISHKQQkKMHYY[MSHwUit}KF\\KFMCF]EIUBETSROUKTLT[NKTWREfJbCHBZKTFTKh"],encodeOffsets:[[112763,19595]]}},{type:"Feature",id:"469031",properties:{name:"昌江黎族自治县",cp:[109.0407,19.2137],childNum:1},geometry:{type:"Polygon",coordinates:["@@`ZĤd–`òüˆ˜ “BSPGP@VSbQ`‡@]HC~T^SE]N]FkW]E[fY„GGOPaTMbFDYfS@g[MGK]h„e@SSSRW@UVqrPVGNStCXUhBFQGYNcCeLQQaLI@_`@EUwcEaCUaMc@SK]Du`MSkKI‡~BVNL@X`‚EvYŠwHcTU@MIe@SXJbIPNVCRXbWbSAWJCRXFFL]FMPSjCfWb_L}E[TaBm^YF[XcQk@WK‰Z“JYRIZwŒ¹ "],encodeOffsets:[[111208,19833]]}},{type:"Feature",id:"469028",properties:{name:"临高县",cp:[109.6957,19.8063],childNum:1},geometry:{type:"Polygon",coordinates:["@@jD`hNd\\^dZädĒH´Op@ˆùZY\\OAGIMN[[W_NCNMKU@NUMSNCTSP@`O@WSCCI@GXQSkXKX[IK@OWqH]SkWW@_SiiYQaKCAKZaCCw@MTGAMKM]FMMIMDSM_HGHRPKCBGSJJIYH[QOJCHMBDGQJECMTDQKFGTCEGTF`NFEDMFaGSNwIiTGhYJD\\KZODC^@FTKND`XBHKJNKFBNhG^FJMPcHEZF\\QPRjQTAdgNOPgQaRSê"],encodeOffsets:[[112122,20431]]}},{type:"Feature",id:"469034",properties:{name:"陵水黎族自治县",cp:[109.9924,18.5415],childNum:1},geometry:{type:"Polygon",coordinates:["@@R]NC`YL]FoN@V[vBXVFNL@TRZalnVFVP`DlOZkVSXEE_F[EUFeH[NKTgfCbMVU^@P]ZObZP@\\QhATUfAtUasñiāEoI]eYǯ@aKmaeƒWuCºKÜKpnbHbYfUDSNCPJTRAHJTDJSfDNLHXC``VBNGTYCQDIXMDSP@xLNEFRNXBIpVNLXah@RgF@`qOML@LJNSPLbaHAh@Jdj"],encodeOffsets:[[112409,19261]]}},{type:"Feature",id:"469026",properties:{name:"屯昌县",cp:[110.0377,19.362],childNum:1},geometry:{type:"Polygon",coordinates:["@@\\OnVBFKHPJCJOJTDB\\vDINOCGJVVL^JDONEbrGTLpMVJLGjAHGRkVChF@vH^zIbTETMHAZOFC^\\DXT\\EffAP\\PdAV@UIYfS|S@YPICMeM@sC[_A]VQEwyHSMuNcAUlQJMVGMS@mVBZPFO\\CSFQK[LqDMACiUa@[QiFBRIHYCHkGSBS[oSOqB‡IE^QHCRWHIXsHU\\UC}JEjMNAN_ZƒAIhSEYfWDQGaPMTL’ERZTJb``NHV@"],encodeOffsets:[[112513,19852]]}},{type:"Feature",id:"469025",properties:{name:"定安县",cp:[110.3384,19.4698],childNum:1},geometry:{type:"Polygon",coordinates:["@@JjDNdJ\\FbKPXfZ^Ij@RZNaVSc[MsMOHQPDJcLIJ_zCG[HQxWJBHXdENRR@XQFWZQQGOFSWUCI[WCJuRGLXNMPLhCl[Ta@SqGgJMGOmyHkKEQMINMAGaGULgwY@UOGiKQ]EYyMK”oO_QEIIKiNSMa[LqOKOaVMWMGMDY\\_IKrL\\ERT[DEPYOUA@nNTUHINkRBVMdNvGTxzRF^U`BD\\@tfNDNOJ@Z{TeTJZ@VU€cB[OBOeeQT@^OXBJb\\AbWTF`RCJFH\\RDJIJFXW@WLGBKxWTSJJMTVZND@bbL"],encodeOffsets:[[112903,20139]]}},{type:"Feature",id:"469035",properties:{name:"保亭黎族苗族自治县",cp:[109.6284,18.6108],childNum:1},geometry:{type:"Polygon",coordinates:["@@FJp@fxpQ\\ApN\\GNPNBM`HLMrXLXj\\PEHnI@WUCEM\\GTc\\GZYHTPBHRCPTd€H\\K\\@HXi–BJILJJAVNTOZJNtFPC`YxDPWci@IBgbGKaTOIM@KNKrP@_hE@QbgKWUMJoWAQMFEKM@wTONCJWRCZDHSAM_UD_GWMKeCITSCGIQBGXUHQoMEEGWDQIG]FMQBMaFGueFeSQDUSDSKOCSFMLƒUaPWM_PaEGFETMX]RCRR@HXKN@JNnXXEŒSPaDI\\£FkXWIAX]xB\\GN"],encodeOffsets:[[112031,19071]]}},{type:"Feature",id:"469001",properties:{name:"五指山市",cp:[109.5282,18.8299],childNum:1},geometry:{type:"Polygon",coordinates:["@@TCNOLBTLBPx\\AJdl†NR†RIbJTGNF\\@RcIYbmHoLQdKN_fCJYbDRRXKZFVEZVXBXIJBXMdESW[CUYHUVQFQAqsEIMPYMSBUIIJKAIj•GW[@[LGScDOGQOAGSYZ[HSd[HFNVD@XmJFG[OWiWKNqGKN_MAMO[HoM[BoRewo@Y^HpITSFENc`MVCdHNIVCLJFI`NFIŒP`@VZbaf[FFJG`O\\WRFA@PVPFPPH"],encodeOffsets:[[111973,19401]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/hei_long_jiang_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"2311",properties:{name:"黑河市",cp:[127.1448,49.2957],childNum:6},geometry:{type:"Polygon",coordinates:["@@VÈÞ@Žkx˜nXŽ°VÈa°V@kôw„b‚š„JVškXlVUx„„@ŽlL@xkVV°ƒ„VbxlVUnVxk@ƒ„ƒKkŽVb„Il„@°kVl„@„™lÆnkll@@V„VXƒŽš@V„²bUlƒVlV„U„VÇn@nkJšŽlkVbœ@›x²V@n°VUnlKU„n`@n°bWLnVUblVUVVbknV`°kkŽl@@V°@nz„J@XšxlWXb°n@bƒĠlbXb™bVbƒJ@Všb„a@„„@lbUbšVmnœ@lšVmnIW‚œ@WbÞ@„n@x°@š„ĢaƐéϚnœ„‚lČ¯ĠŻÈwm@ôçU™mm£Xy°UV™›@wÈ£Ǫ¯kõÝçUњ™Uķ‚ƒĢkVфÆšÞU°nŎ¥ČUĊx°m°¦żVƐœx°ƒÇ£@y„UônރÆ@Èĉ°Kô¦šW„kWU—bÇ»@™ÈĕWÇÈ£ŤU@›n£ÆUUKVamanwŃmÝJ¯k@JƒIkaVaUUÇbkaÆÑkWmÝUۙ™Ý@™ƒwnU±ƒ@kkV¯KUkƒJƒ¼U¦ƒšÅ@ówķaķůV¥Uaó@Åwmƒƒ_kVƒwĉ‚ĉmmn_V»™a@U™ƒVwķóƒ‚U¦LǫéóXÇmōLǓÇķxÝkƒƒĉ™kmakbUĶ°@W¼„@bƒšÈÆ@Ė™L„l@„°J¯„mkl¯L݃±L—amJ@¼ƒ„™VƧUó„™UX˜ċb¯ńVbkÆÝI@llx„k°V²šV@Uxގ˜L@b„@b™`ƒšÇzkókݤ@ğ¯Wƒ™LĉǙLmmnċVkbUaƒL@Ž¯„‚bU°ğL݂Ý@"],encodeOffsets:[[127744,50102]]}},{type:"Feature",id:"2327",properties:{name:"大兴安岭地区",cp:[124.1016,52.2345],childNum:3},geometry:{type:"Polygon",coordinates:["@@k›ƒϙmƏêġb™ƒ¯@@wƒmÝ@XV@IlŽl@bUxl¯VlV™bV@ULVlUV™_kx™VVV™ÈÝJ@„¯šU„™lm¯x@xóÒĉ¼m„¯Wƒxţ@Uz¯ƒWwnUwťƒ@knƒWƒ£óVƒUUwğyó¦WI—Vmm™I@±kwÇ@@bƒ@ĉ¼ó@¯wó@¯aó¼›KՃaUwmWUwÅI@aƒKó@Ua™LƒaƒVÅwō¼UUÝl±I—¤VxÇx@zkJmnn‚mbnz™xlŽƒl¯ČkJl™°@„kb„Žmx@x™@kêmVnŽWxôXšxU°„bWLóJnÇWĵ„V¦™ŽƒUUb™b™ÆġK™šk¯™VU±aXmċÑUwĉKġ„k„™ŽVxk„ÇKkbƒIƒ‚ÛXWl¯bƒŽ™X¯K™bĊš„„ÞVƚnŽĸ²lxUŽ°n°òÈb‚¦—xVbƒŽƒ@¯„Vx@¯VķÞČlĊ°KĸŽȘI°¤ČIôŽò»ƨnȰKǬ¦ôWŎÈƨwlƒnKVXmbX`lbšwkVW‚XXŽ„L°a„ƾaĊ£nƒ°@°¥ŎzÞ¥‚»œalwôkƒJ„a@ĶK„£„bU°ĊxźVÈUĠ¥ƨ™VI@XU°x°Ln¥šw°UmwXm݁V¥ĢŽ°@nU@mÆ£š¯lKœšÜw@aÅU‚¥UaÝIkmV²‚nn@Ķ»@Uk¥VKÞ@ÞÛ@ƒkVmĢa@_ƒJómƒǖ¯Æw—óÇa@alƒUwšwĢřšk@wÆWXUWXƒWa™m@_ƒ»ÇéXaĸwVa@ÝKkUWkX‚kšKXxƒn@lĊV@¯m¯nřÆwš¥"],encodeOffsets:[[130084,52206]]}},{type:"Feature",id:"2301",properties:{name:"哈尔滨市",cp:[127.9688,45.368],childNum:11},geometry:{type:"Polygon",coordinates:["@@°`„_šJlUšŽ@„„@V¦°JUšŽnLôlnŤ@@šÈaUÒVbkbl¤ƒzk°ÇVÛô°IlVUVôU„xÆU„Ž@bźĀ„º@¦šb@l²‚UVlœ@°ÒĠxšnXxÆVô¼Þ@Üx²KލlƒVÑ°UȰôlwô@²ƒĸ°„lanV@„šVŎUll@bÈnÜm„wĢ@la@ÝÞb°UXb˜lŎ²ÆškšV‚I@ŽnJnĠŽ°knƒÜbĢwna@a˜kÞKƒĀ„a‚™œ‚‚IVbU¥wĠwkô˜xnLƒċVçkaUƒ±IUmnġW„°WôĉšalƒÞÅĵ¯@W¹XÝaƒb¯a±X¯ºLƒaVƒmkLóƒƒbkaƒVUKVkkKV_@aÝykk±L@ƒÅU@yV_™aU¥ówÇx™@UkVƒn@lƒkÅlwšWVwUkĉmkklW@šašbVwnWWƒ—wWL™™@Ušƒ™UƒÇLšÇmƒ„@wƒJĉƒL¥@ƒÝ_@a¯y„UWw¯ƒ¯Uġx¯aÝXVmaU£ó±›¯nwƒa¯óÅVƒXman™„Uƒ›lUXkWa@mkI„›ğaƒm™IklÇU™„kĊƒƒzkKƒš„lU„ōĬlš™„@ŽnX°@llUxŹ²mKĉVWwk@UbUK@bmVmI—ƒVmwaWxXlWȁšmºšÞÆbUxV@ĵńWÆĉLkWUbƒaWzkbĉ`U„±LklōwUVÝ£™UW`Uwk@mk¯VkaõVX@WbL™K@XƧºWzxƒK@lmX@bkVVÆk¼Vbk@Vn"],encodeOffsets:[[128712,46604]]}},{type:"Feature",id:"2302",properties:{name:"齐齐哈尔市",cp:[124.541,47.5818],childNum:11},geometry:{type:"Polygon",coordinates:["@@Þ@ށĠKV¯a°ƒ@„KVblaČU‚mnnšKĊȚKX„°ŽĠ@Þ£ôllÈy„™š_@a‚ƒ@a—KݍVwU@±™¯Uƒlkw@kÞJlÅUa°ŃČaW—šVôƒƨVšU„ƒ@»nI˜b²Kބ°Klkn°ƒ¯I@ƒƒkšK@ĕÇń™@aƒX»¯@VĵlaÿVamI@aÅÝउýƒĊȗJƒôȁÅkmƑۃ@kxġ@@l™aVk¯»ƒīŹaƒkƒ¥Å¯™JUaWU@@w™aƒ»„KUkÆkUm„UmwÛ±±UUbUŽUXƒwWwÆÝk™lkUanaWwnKl™kal¯ka™ƽa›kÅx™a¯@™amb¯V™lÇwÛĀ™V@x™šmêVƜVV‚aôV„wÈx@šˌx„¦VÞ¯VšlmX@‚ƒL@¯Ua¯LmV@„„°X„ċK™V™ƒ@UƒÈ@‚¥@w—ƒġIU™km¥Źwƒ¦¯lmn@°kxVV@¦óam„n¦l@nx™lĉVóšmx™n™ÒĉĀĊ¼„þ„šǔêÞ°ˌĠÞÒ°ĀɲĀƨźˤȤƨĊ°w@£nymwnkUUV¥ôÑVmkÆmUUVa™mVIkmô„lxkXÞþƒbl„ƒl@kV„ƆƒV„xV@š¼VÒ@šŽUŽšnnނJ"],encodeOffsets:[[127744,50102]]}},{type:"Feature",id:"2310",properties:{name:"牡丹江市",cp:[129.7815,44.7089],childNum:7},geometry:{type:"Polygon",coordinates:["@@U`lLUlVL„Ulb„aô„lKnŽU„„b‚K°¹²W°b„aÞb˜knyUlUkamř²L@m°@lšmš²n`ôÅlK„x„ÜKnxV@„l@œƒ›ÅXyW_k@™wm™ŹĕmƒX™»‚ƒÛ™l°ƒôšÈ„»š—ô˜ô_WW@Uœal»šwU@@wšUVƒš@VƒXI@w‚Ģ͑ÞȻ›aU_@mUkly@¯óV»XmWUXUWmnm¥nUUaWLk»Æ²IÇa™wÅaÝ°¯nUa±a™ƒ™@¦õÆğ„@„™@Åb›xU܁nÇłlb¯¦„ôó»mƒ—@±ƒUk@Wwƒa¯xU„V°ƒxXbǎŁUV™™ƒK@¹ƒKUaȯ@ōݙXƒal™ƒlÛkalÇUǫÇńÇakbÝƆ¯nlš¯Ž@¼™VUx@x¯W¼™Æ¯šmĖ„Ĭ¯ČƒVk‚ķÅmxœ°ô²V¤‚bUnÞW°bĢw°V°„XxƒV°z@bÞ`@„‚¦„KĊŽ„I@xƒŽn„™ÈÈK‚„šV™„@VššXK˜xX„mXUx™a™b@‚kXllĊnVlUx™XkxlÆk„m@U„Vlš@ÈwôxV¦šbU`@zÆV@„²KllÞz@b"],encodeOffsets:[[132672,46936]]}},{type:"Feature",id:"2312",properties:{name:"绥化市",cp:[126.7163,46.8018],childNum:10},geometry:{type:"Polygon",coordinates:["@@ऊþÆÞ@bnJUb‚ĀnblŽĊš„„ÞlĸwǔÈŎKÈnôWǬê‚KV¥„ĸôUxš„@VšbU¼m`nnĊŽĊ„xlUšmkaVÿšLšwš@°»UmbKmݙUšwUmVknKUUl¯ƒKU™ƒUȃ‚™nK@ĠkX±lX„°„L@¯¥@wV_m›ĵ¯Ww™L¯ƒUkōƒÇVU™l›w—V󁱃¯aƒVka°wVk°mÞ¯Ŧřƙl™²™Ŏk™U@ƒmUkb¯ƒķŽ±„ó@kxȯó¯VUÒk„ÝŽ±LÛwÝ@ó»ÅUWw™mğw¯Ñ›@UkV±@k™a@¥ƒ¹Źÿ@aƒÅVƒwóVVUkU¯JÜóÈUl¯„yk£laUaVÑÇb@™ţ@kmómK™V¯IU¥ƒ@@ƒ™kV™Iƒ`@ô™¼„blU„lƒ™bÈb@xÇKkĢɳaÅɆō@ƒŽVƒK@z™@@¥ÆKnÜ@@aۏUw›wnU‚ķ@ƒ_ƒV°Ž@„klVššnULVVÞbVl@°™@nx™n°LŚÆlV„ȃmU²@VmĠLƒx„n¯xkWƒzšJ‚wnLmbXbW°šÆ‚™²™@™Žšx@JVx„L‚Ā²Æ°I¯º‚È@ÒnÈ"],encodeOffsets:[[128352,48421]]}},{type:"Feature",id:"2307",properties:{name:"伊春市",cp:[129.1992,47.9608],childNum:3},geometry:{type:"Polygon",coordinates:["@@ƒKƒ¯kWW²ğl@ŽmLšÇ„„VVš„Lk°VVmLUlVn™xšVnނLnaVŽ¯¼™@™x™KUĀlb™n„`n„Æxô@VbU¦ĸŰĸbôxÆ@„™V¥„»„IVl°LUŽll@²„mV„x@ššÞܚÞVnŽlXÅÒlbÈaVVUblb„J@I°lÞIn‚Æ„mxnbUbVLÅVm¤@œţVǤXÈÇĖ@šÈ¼˜aXVÜaXbWŽnzŎašř„KôbšUlw@¯naÆKnUU¯Üa@mkkVUĊm„™żÝ‚ǖŽ‚K„™°L²lÆI@ƒ¯¥ĉƛVaÞk@ÝVaĠlnUVwƒœómaƒ@™wĉ@™a™VƒxamX@aƒ@UaÅLƒaVWƒ_nWm£nWm_ÅV¯ƒm@m„󤁚ݦƒ¯ÅalmX£ƒ™VWUŚw™mÇ@@IV™„WUw@ašI@„k@wŎ»Wƒ„ƒ™ÅVaœK›Ika@¥lUkUlwÅwVyÈwWU@a¯U°m—Ç@UçƒaVa¯mV»ÅwÝUlƒUk™V@k„mUk‚X£šw°@@ǃaÝIƒƒam™Ûam„¯lğmmI@J™U™l±ÅōŽ—kWa¯VÝa@Þkbġ@ƒxÛnÇm@akkōVōl±škšÅšťŚÝ°¯nUl¯xlb„U°b²„ô‚˜Uœxšk‚VÈUŎ„Vl°„šKXxĶ°nœU`@x°¦@"],encodeOffsets:[[131637,48556]]}},{type:"Feature",id:"2308",properties:{name:"佳木斯市",cp:[133.0005,47.5763],childNum:7},geometry:{type:"Polygon",coordinates:["@@nš„b‚„ÞJ„b@ȯ@™xW¤Vlƒn@lšUVlk„ÞVÆxU¼°nUb„bVèÈ@˜ŽnIn‚@šĢmlUw°™żƒ‚VUn@lnL@VôbšwĊ‚lœ„JķĸĢl„wôwƨxVVUƒŦšxšLź™Èš°`nnĠwŎJސĶwôJ„@¤Xn܄ĸlšn°¼È°lŽ„„Uš‚b„xš@„l@ÞÞÈm°„lôwšL°¼ĸ‚°Þ²nĠ@ôwÞ`ŤI„V„ÒĠU„„@„VJĸbƄ²@°ŽĊKšœ„JĶaĢȰ@ô¥°nš¤‚bČUš@Vx„mUw@a݁ţƒÇ™ķƒ@ĕķīU¯²@ÆmVÑô¯X¥ċç@™ĉ»U¥ÝţKWVÅkUVÝŎUmǍÝx¯aķxÛUóL¯a±óōb¯™ƒÑŃVÿƒ_Åķ„a@UƒK@wm@Van@UmmLVa—@VImmXUWƒÝUřƒKUwÝUUƒkVƒk@l¯X›‚Å_ƒJ¯k™Jm„ÅLƒa@¥U@¯Vƒz¯@ƒ`@¼šmxƥšŏKÛk@±laÛ@@Xm@™ƒ@xƽ@WŎnšˣĕÅ@@aÅ@@nÝbǏ¯@ƒ_U›kUWƒkb™wÝU@ç„Wlw@anIƒ¯lyœX°m°VšašÛšm@„mVwÞK°ƒšXlaXmm_ƒ@UƒkwÝK@ƒVI™ƒXmV»ƒI@aƒ¯ğW™bġaU_¯JU¯ġŽƒ„ĉ„k„ō`±nÝÆk„™bóĊ¯Xƒ‚ĢX‚mVn²JV„lbUè„ČmK—wlóğx‚xV¦UaJ›šƒbƑÿÝL—l@bmbġx"],encodeOffsets:[[132615,47740]]}},{type:"Feature",id:"2303",properties:{name:"鸡西市",cp:[132.7917,45.7361],childNum:4},geometry:{type:"Polygon",coordinates:["@@‚LšKVVnkšbVšÈb‚²U°VnklVlaÈL@anU°ÜmXV`œnôLƒèšxlŽšLX„˜L²ašVVmÈX@ķ˜lnU„Èl`ȹš@ŤŽ°U@x„KnnV„mlnnUl‚lVnnaŎwlVÞ҄@n¦šLVŽ°lšwVk„Lšaގl„n҄š@xmLÞ¤Wnœ¼‚WÈLVVUxlÈô„„WVaU_VKšKXUÆbn™‚nôK„bÞw°bÆWXamVwœK˜™Uw¯WUk„UlJUwVUa™@@kmyzm›ĉw@kVwškƒW¯ÅKU_Vmƒƒ™xU@aW@@kK@w„a@Kƒ@@kVUƒaky°_Vm™kna¯K@™ƒL™wġk@@IÇóX™ƒwVakmV@mwXUWanƒlĉ@ǙUw™KƒƒóšܛNJۄm°@›w—Å@ƒ±b¯Wƒ¹„WVwŹĕ¯kVmōb¯w@aƒwmV™UUb™V™IkaVwķ™xk¼›b@VXXó`󗙘ƒ¼Çó™¯„kŽÜš„š¼WŽn„źĖnššxl@X`WzœÆ"],encodeOffsets:[[133921,46716]]}},{type:"Feature",id:"2305",properties:{name:"双鸭山市",cp:[133.5938,46.7523],childNum:5},geometry:{type:"Polygon",coordinates:["@@™UƒƒUwó™mÑÞÑUÝÝUkmmŃyV¯ī„¥ƒUÿĉ¯mÇkaWbÅX¯aÝxƒaóLmmšÅaWV™LULV`UbƒXóƒkÇVwUUÇKX›»XmÝ£nK@wƒ™mÑkƒÝ™bƒKUl™x¯kU™Km¥ƒ@ÝÑkUōxmbUmkVkmmnkUƒmmƒL@w¯Vţ™@Ǻk_ƒÇmV—k@ĸVx‚VÈ°lLkllšUbōwƒnVW¼nlUx¯XmWUnÝ@™xÝUó¼¯J@LVbkJWnkb™W¯„ÝLUxƒn@‚™n™Ü™b¯U¯n›Wkz„°mJ@bkxƒX@èÞVšxlaX„lVVœ„`°@ȐÞa@mÆ@@bÆ@ˤĖm™Xōƾ@@wš„n@@WÜ@kb@²ÜlŐLƦ™nw™@»„_°@„y°UV@@¦„bÆKnƒšI°l„IÆ`œ°W@k„llUV„ÞVVx„LƚÞVX„WVnnUJ˜@UbnKVnm@Ubn@@x„L@VƒbÆĸ„`UĀƄ„Ò°šŎa²ô°bôKÜVĸw°bÞwȎVnÞōVUÆlXU"],encodeOffsets:[[137577,48578]]}},{type:"Feature",id:"2306",properties:{name:"大庆市",cp:[124.7717,46.4282],childNum:5},geometry:{type:"Polygon",coordinates:["@@mÇ@сǰ¹¯J±ÅÿƒKUw‚I@™wšš@š±Å‚™X¯WanamKx™I„ylX°wƒm„wğKUn±@nVDŽUƒÅkƙ¯Kšmmwš@@¯UkÝaUUVK™mU™lk@ƒ¯„U„`ĸ@V‚mœxVxܐ@bÛ@m‚ÅL@¦š@@y„L‚U„Ŏ@ÆɅɴblġÈL@wÇaša„ƒkkVƒaš»@ó¯_ÝJ™wÇaÅXny›U¯¥Å„@w™bÝa™Lmm@@ƒVUŽlbğVmš™¯Xƒm_ƒ`¯_Ux™m™L™a¯b@mƒaó¦Çk™¤V„@bóJknVx™VXx±aƒLUbVxkLVlLWlƒ@nX@VÅbWlÈnƒx„bWšÅbmŽ@xœbml°b™„XbW„XVmnn`ƒLmšnbmb@šk@mwU@@š¯Jlbk°lbkšmLXxmbVbkllšÅނxX„xVWVVa²VܲnxƒVVnÅlVlƒL„¼šb@xV@XŽVbšIÆ°„¦„lźb„Ĭ°¼Ulšb@kĢ@lw„@ƒÜlnȂƄóȘI„ĉ"],encodeOffsets:[[128352,48421]]}},{type:"Feature",id:"2304",properties:{name:"鹤岗市",cp:[130.4407,47.7081],childNum:3},geometry:{type:"Polygon",coordinates:["@@Þ¥‚™ô£nƒn@°„ÆUn`mXn¤mX„`UX„bÆKVb„@@bnW‚b„wšUšbĊ@šx„@nbšWVmƒ_mm@ó»Um„ŘWXkĠ»²¯‚¯nķšwŎ@ĊšŎK°bĸUnјKȦĠÈbÆknJššÆUĢV°IšŽšVƾƒwaV™ƒƒkÇ¯¯»™mķkۃWm@£ƒóIĵxݏōIğxmm¯_ǙŹš™K™wťŽ„UVUŽƧwóxƒxġkĸķƒIk›ĉ™xóa@UmK@kVmUŻ„¯šVxkŽġn™‚@mmJ¯n°V@bXVÇxUzÆxkxlVkV@¦lbœJ›LUbšÆƒ„X„ō¼@xƒl@™J@bVxƒXUš@JÈ@šn™xVÆUXš‚„W¤knÆb„°"],encodeOffsets:[[132998,49478]]}},{type:"Feature",id:"2309",properties:{name:"七台河市",cp:[131.2756,45.9558],childNum:2},geometry:{type:"Polygon",coordinates:["@@²mŎ_lƒĊƒ„ƒĢV°°IV`ĢbšaĠX„°@b„JU¼Wnš„UJ@„ÞLlxV„„@n`lIUa@K°Iô»ÞVšwÞ@VmnX°WVwmkX»‚U„mŎxVak™lkkKǯUUwÇWUn™U±b—KWƒ™Kk™w„çóK›mU_nW¯ÛmV@bÇKkbkUml¯U±VÇaU™™amlUU™LK›„k@ƒU@mwÛLƒŽƒwkLóÆm_™±™nkŽ¯@@n±KnŚlbkVV‚mz—lWXº@Ķ°"],encodeOffsets:[[133369,47228]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/he_bei_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"1308",properties:{name:"承德市",cp:[117.5757,41.4075],childNum:11},geometry:{type:"Polygon",coordinates:["@@lLnlmxn„„IVVlUnb@VVxXJWL@LގVnnV„J˜_@wkmšK„b‚x„wXk˜WXXšKlb²K@nVVVb„L@WlU²„lKVnUJVz@VVb@lżmVUVnbôaVX@°Ub@lWbXš@b@bVb°x„@VxÈLVlšaÆ@Þb²k°@lVUŽ@Xn@VW‚LXb@¤VXšKVVVLnm°_ƨ¤@aUIVa„alkX›°k„™V@„alwUVy„U@k󙰃na°UVUUmUÆw@mkLVUƒWVI„WšLnn@xlVnK„myU@ƒU°UXaV@U¥ƒU@Uƙ@aVUkWU¯ƒaU@WLUV@bkbmKULmKkUVUkmVIUwlWV²™Uml°U@W„LUwVm@UUK@_ƒKUUÜaXw@ƒVKUU@mVIUUlmnIVVVbÈVlKnbVKš@nI˜@nVnwVLVK„K„„˜Vnb@aUIVW@In™°@lVnIš@lWĢ@°UVL@b„@VyUUƒa@w@WUnU@Wǯ™K@UkkJWaÛbmk@mVaÞU@amkWƒ@mXUKkÿƒ£@a„kl@Um°UXwla„al@nmlXnW°znW@aƒwV™@ƒakbĉ¥VmU@ƒIƒVƒUƒJkUmWU™KbmkUaƒKkUVU@KV@@klw—™WaU@kmƒXVènbmlUUƒKƒX¯JkbƒI@JmIUWU@ƒLml@XkJ@U™kƒK@aVKwWa—IWwƒmUƒ@mU@J@UaċU™aUUƒVkI±ƒk@UUƒ@UbVVm@UVKƒLƒlkIWaULUWƒXUJU„ƒ@WbUb@lkXUxm@@JVn@J@b„nƒb@Vkx@bšLU‚Æn„JšaVXnKVVmzX‚°V@_lJXxWXƒK¯bÅamUƒ@lUI›bñJ@LÇKkIÇ`kxWL@„ƒ@@bUVUb¯xWKk„Å„VlULW@ƒŽn¦Ul@I™lmUUUVm@kWƒnkKma¯XUKWmnwVwÝL„mŽ™VUbUVWb@Lnxm„xVŽmbXx›¦@„nb@`™„ƒVƒ@kbƒLU„mVUlkbVXkºmnm@@xk¦šbĢÜlš"],encodeOffsets:[[118868,42784]]}},{type:"Feature",id:"1307",properties:{name:"张家口市",cp:[115.1477,40.8527],childNum:15},geometry:{type:"Polygon",coordinates:["@@k™ġۙal¥@wn@nml¹UWlaVknUVƒ„Kla„@„Ušƒ@_ma@ƒœ¥WwnaU‚wnƒmw@KXaVUVašUnmWUk°™lƒnUVUXWVw™IWVóKUI@WXƒxUU@mma@kUKWLkw@yk@ƒaVkUUċaUU@Wk@Unm@UVmLm±IUƒkJ™kWƒ@a„I@m@U„ƒVƒ„Ula„@VXVƒXmVwnkWKƒKU_k@m¥ƒmX_™JmnU@km@U@KmU™VƒU@U™@Umk@@LƒmW@Û£Wƒka@wk™@aƒI@mmk@mUa@UmUƒIƒwW@aWUƒbU@kbÇ@kwƒ@makVUk™U@aƒm@aU@mxkUƒbƒKUXUƒ±KXVWLUK@wkU@V™@WXUa@WbUxƒJIƒŽ@¦VèVVX@±ê¯KUIƒ`¯UULVx@Vƒ@UKƒIƒVkLmVkKmš@nUJÝbkIUJVXšVVxVbU„VJ„Un™°bV„mlU°„XnK@Ul@lVÈVUXšx@W„@VXšV‚KÞb„n@VnbV„m`ƒUx™kW@UVkL™Km¼@lUnUJVnV„XV@Vm@@LV„klƒIkl@VƒWlŽULWKUL@mJ„@blbUVUlmzUJUxm@UUbċÜk@Ub@VšLVV„¦ôbVŽmšUKUkU@m„„@VlVn¼WbUJ¯@@„°šnIllÈl˜@nXšWlLœk‚J@bkxlxkxlXUlklJƒšXL@bW„n`@nƎXxlL@xl@Xb‚LœKlVlIXblVUbUJW@lX@VL@VVŽšXšJšw„n@WnL°K„bVbl@VI@K„@U@nmVmV@XUWI@aXm@™VUUkWmn@lmUUk@mUmK@UnwVĉ@ƒƒmU_V@XJôVVUšLVUn@šllUnJl_n@šml@XŽlLlw²LVJUL@VmbVblVXmVnlš@Ť¦„nn@܎@bšl„@@XV`„Unb@VlLVb²J‚Xn¥ÆÑ@¥Þ@"],encodeOffsets:[[118868,42784]]}},{type:"Feature",id:"1306",properties:{name:"保定市",cp:[115.0488,39.0948],childNum:23},geometry:{type:"Polygon",coordinates:["@@VbXWš@@UlV@xVLXKWU²LV„VW„L„alVnwV@@b„n@bšVVllUnb„@lxÈ@laV@„aXV@b‚X„x„J‚nV@VVb@nnl@n„J@blšl@„ašƒU_VWUwVUškUm™Ukb±mVwœU@VIUW@UWk„@VU@ynL„m@IV@‚bnK„LVaVmnIlaXwV@@WVL°@@xnX„@V`V@VbUVVLVKnwnL@ll@@_V@VVnaÆ@œKVXÆ@nƒ@wƒKmU—™Wm@km@kÜKXU@ÑW±nIUwVƒ„Kla@I°wU±kškmm¯mƒ_ƒJnƒaƒwW@IVaUama@wƒUƒmU@mVw@aXk@mWa@£km@aƒ_kVmUnWW@¯bƒkUmk@ƒVÇm@@kUU™KUU™@UVUamVUaWIkb@xU@@amUkKƒVkam@@kVUkUWmKmUkLUb@xmJƒ™U@UImVÛVmnUwƒJƒU@VƒX@UWm@Ub°¦UšmxklmX@`ULU@@UW@@xkn¯@makV™UmxUb™°ƒlUšƒbUbƒnUJƒUUVƒa™LkbUU›JUU@mUUUƒJkaƒ@™xUIWJƒUnƒJ@V™zƒ@kb@`@bln@l™bƒŽ@X@š@š„@Xl‚bnbVb„@„„VJlInlšbVw@U„K„l@lbnan@Vb‚JôLn‚UzlV@lÈLVbVK@LVx—VWXX`WxXz‚bV`UXV¤nx@„bVlVnVlUL"],encodeOffsets:[[117304,40512]]}},{type:"Feature",id:"1302",properties:{name:"唐山市",cp:[118.4766,39.6826],childNum:11},geometry:{type:"Polygon",coordinates:["@@„@VVl@²„lJ„UVVšbČVVb‚@@InV„@‚V„nXx˜JXb‚xUL@b„Lšl@VlI@Wnk„KV@VXnJ@I„Jla°I„W„LVVnkmaUç„WVkôaܯ„@nV°wnJlaV@VUnUUaW¯wXWWwna@£UaWKU¯ƒ¯@aVUkKUamUUƒn»‚an™„IVwUWlkš@„LlWVakU@K„_lƒšbÞU°@šy°n„@„KÈkWW™ţ¥ĉōƒkġWUw¯£¯ƒÇwţwƒ@kK@kƒ¥ÝwÅbǤېťV™lW°@ĸ™x@VVVULVLkl@V@Xƒ`Ub@Xm@UWbƒk@ÆVbnLWV@lnXUbl‚@X¯lmU™VkKWLkK@_UK@U@UmmUxmVXLWVULkU@`W@ULUK@XlJXzV@@xml@VU@UX@Kk@WbUK@Xn`ƒXmJnšmškxUVbUVlVVxUbV@nKlL„kVKÞbVKXI°KVšmVUIUKULVxVJVLkV@Vƒ@UbU@WUU@UbUK@b@nƒV@VkLmb@b"],encodeOffsets:[[120398,41159]]}},{type:"Feature",id:"1309",properties:{name:"沧州市",cp:[116.8286,38.2104],childNum:15},geometry:{type:"Polygon",coordinates:["@@@ln@UȄŽl@Vn„l°aX@mXnVlU„`@bln@¤Xb@nWl@bUx@nnV‚„„V@xnbVbUb@J‚X„x„b‚mXa@k„UVwlW„k„KôVm@w™kkK@kl»Èƒm™VKXkla°@XVV@VI@ml@@Vn@VX@V@J„@VxUzVVšš²blVk¦@šĠ@@»š@VK@VÈLlK@XnJ@alIUl„a„VVbš@„n@a„U@WUIV@mUn@mKXml@lL@LnWšb@XV@@a„VVb„V„@VV„IVWÈb˜IÈ»ƒǟlWšaVUÅUƒƒ™Um@kVU™WVkaUwmaóUƒJUU¯ÑU¥mk™¯UaƒKÅnÇyóXmWÛX¯aċbÛa›J—W™ÝU¯»ƒaóóUm@IƒšVVl@bƒLUJWLX@@xšXUxl¤V@V„nVUV„XVbVš@Ž„@@VVn„°VŽ@ţU¯VƒUmƒUWV@mUXƒaƒbUKUwUaÇKn„ƒVk¦Wb@VnLmV@bkV@n„xW`Å_UVƒV@bƒUklVX@VmlUƒx@VVL@x—VWVL@VW@UUm@"],encodeOffsets:[[118485,39280]]}},{type:"Feature",id:"1301",properties:{name:"石家庄市",cp:[114.4995,38.1006],childNum:19},geometry:{type:"Polygon",coordinates:["@@la„@šy@U„I‚m„VXIVJšw„@lb„IVVnV‚@VVœIVVlašK„bVU„VVI„mVa„aV™„kš¯VanwšVlUnb°@lm@wX@@VV@VK@_nWlknwV™¯¥Van@VX‚@„W@U„V„IVxnmÜUnUVJV@„šnI@wValKnV@k‚mU£na@mVk°K„LVa@UU@UƒmknWWkXU@aWW@@km@UaU@@klK@UkaWaUnamm@U„a¯wWU@UkƒL@ŽUn@x™V™lUXVJUb™LmU@aUWUkmKkLUUm@mW—XƒaƒmmkkWUm@@U¯JUUm™kU¯@mKĉxÝwÝ¥LƒUóŽmwkUUUWVkKm™kKmLX„lxVLVxXJ@nVJnz@VWL@`nX@šƒxƒ@kVUUmJmIXx„JV„ƒnUVƒ@UVV„@LUšƒ`UXVVƒ„ƒlXL@l@b@VmX@b™xn°™UƒbkKWLXlW@@bƒK„mKULmakLUlmb@šXb@xmXU`V„b@`lLx@nWVXL@‚°WlXnlb„KVK„XVb@˜X@l_lJ@V@XnŽ„I"],encodeOffsets:[[116562,39691]]}},{type:"Feature",id:"1305",properties:{name:"邢台市",cp:[114.8071,37.2821],childNum:18},geometry:{type:"Polygon",coordinates:["@@nKlLnšlLXUVVlVnxô„V‚KÞ¦ÞxĊwnL°@lVnšVV°I@Vn@V‚lXnl„n„b˜WnXn@VVlKnLVlVX@bnVšKVaUIVWškšU@wVm@¯@U¥VmU_°lšK„k‚w@LX‚Va„U@wšUƒUUKlUóW@UVUœUlƒ°K„wlKU_na„KVnlKkkšWWa@IœJVa@IlJnU@„KVUUmVlaXUl@lm@kXWÝÑnkƒ™±™k@wğ›@@U@mKĉLmVJ@zmlnŽWLUÝJU_ƒ@@šmJkXUVlbklÝ@Ýa™b¯@¯±JÅwġaUU@ƒkU™@mVI±bUKƒL™WUXƒJkaƒLóKULWbUVkKmnk@@bmLUŽƒl@b@mnmJkUULƒaƒbnŽmn@lVV@¦n@„l@b‚znx@`Vz@b„xnV@xl„lbnKVx"],encodeOffsets:[[116764,38346]]}},{type:"Feature",id:"1304",properties:{name:"邯郸市",cp:[114.4775,36.535],childNum:18},geometry:{type:"Polygon",coordinates:["@@„bVKlVnInm‚@@a„kVnK@al@nmlLVUXaVKôL„Klb„IVWšX„KVL²a‚JnUš@lV@„VVĢbÆx²I°Ž°@šaÞbÞ@lkkaVUlWnI@™„@V`ÞI‚VXKmnk@y‚InUĊKƒÇkUUamUUkƒƒ@aU@U™ƒk@WUwVkVJVkkw°a@„mK@UX@VV„LVW@wšwVa@¯Xm@@lUIWaU@UWkXWmU@UwmUkKmn@lkVƒ²™VƒaULUVmJUUUwƒLma@™UmkIUm›L—mVšmx@b™LUamKÅL@VmbkU¯KÝamzkJUb±Vkb™L@lU@WIkJƒzkKmKƒnUalWkkKW@@nkbk@WW¯XUVUJ@XlJ@Xƒ@XlWLkUƒ`VUnaWa„UV@UVIƒaUxUUmVƒK@I@W@DŽU@@U@bƒ‚@nmKXmx™@UxkVWUX„@`VLlL@`™zX‚Ýb@b‚„@VUVkIUJVz°KVlnLlKnL„xlLVVUVlXUJ@nn‚„I@mVUlbn@@Žm„@bV„nV"],encodeOffsets:[[116528,37885]]}},{type:"Feature",id:"1303",properties:{name:"秦皇岛市",cp:[119.2126,40.0232],childNum:5},geometry:{type:"Polygon",coordinates:["@@lnV@Xb˜škx@lU@@LUVlV„LVbnl‚ašLXVVn‚l„I„V„U„JV@UnĊ¦la„bš@nJ°UmƒV@„wn@VU„JVI°bnWlXnWVLVK²b‚akk„lI@aUaVƒUwVUUalaVwnUVak¥šX@W‚kœLVÓm„mUK@_lWš@n_UK@alÅ@ğÅƑŃݍmƒ@їţÇlƒLƒ@¯m™z¯@ÝV™ak„ƒ`@LlVUbkXƒK™@klVXUxƒJmšbm¼V„nVVblLUV@b„°V°XLVb@¤mbXxWX°xXŽVbmVUVU@kbmI¯xmUƒ@Û°óbUl"],encodeOffsets:[[121411,41254]]}},{type:"Feature",id:"1311",properties:{name:"衡水市",cp:[115.8838,37.7161],childNum:11},geometry:{type:"Polygon",coordinates:["@@„KVlV@X°xƒb@VnnmbVŽXblb@VkL@lV@Vbn@@l‚@XX@bWVXlmXnlV„V@@VUbƒK¯LUl@nmbV¤n@l‚LXnlVUV@ln@lb„UlLnV@bV@@wlaXJVbnUVbVUš@VVšLVVn@VVX@@U‚KXU˜U@wUK@U„wVnk@UUWlk„V@a„UVUÆ`X_ƒw@mlU@anUmK@UXal¥„UmƒÈLVbVxVL„a„bVW@nXU‚Vn„„V°UŤV@Uƒ¯Um@Uƒ@@U™UaƒWVUmUUƒU@k£Vw™W@wW@XKƒIUa@wU@@al@UK@_mKXKƒbUU@aVKmš@Xmƒƒ±@kbÇakLğVaUw@a@ƒmkUJƒk@ykw@£ƒWX@lknk@WVkbUŽVnUVƒL@‚mVkI@JUb›I@JXb™XllkLUmƒLmbV`kLƒx¯Lk„›VUV@VôXkVVL„V™V@xƒVUbW@Kxƒl™L¯kV`UnV¦°@"],encodeOffsets:[[118024,38549]]}},{type:"Feature",id:"1310",properties:{name:"廊坊市",cp:[116.521,39.0509],childNum:9},geometry:{type:"MultiPolygon",coordinates:[["@@la„Ušš@šUnL@VWbklWxnIVV„V@X„JlbUlšXVbn@@K„mV@@X°WVInJmn²@lmVbnL@amKV_kwlmX@@LVamaXaƒaVU@UnJVanLlUkaW@UaVakK@IlKUU@an@ln@alKUƒkIVa@a@klaUKUV@UkUV¯šKVƒV@kUmƒU@@a¯ImJUU@VV@UL@Uƒ@@WXUWa@Ukwm™@ƒX@@w@al@@aVIUmVUUUVWUknK@I@™l¥kU±a™™UUVyUwƒ@@I@UUWm@@Uk@@nUJU@WU¯@kbWlULnšÇ„k¼@llLšl@xUnóŽƒLƒlkXUxƒV@lWb„I„`°nnn™llŽV²¯x@JkbƒLU„VxmJX²@ÒWVÛL@lln@‚Xn˜šnV„L"],["@@@kX@Valaa@KWI@UXW@WanaUIW@UaUKķŽk_W@UVUKUš@bƒ@UamxVXnJUbWVXLVbn@W°kb@U@Wó¼mIU¼k`V„@bVbl@„lX@lUôVlUœIV`lX„Vn@lUlVn@„l@UVaƒIUWl£Um™VWU@@UUKlUUUnƒVL@KšUnLVWUa›@™U"]],encodeOffsets:[[[119037,40467]],[[119970,40776]]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/he_nan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"4113",properties:{name:"南阳市",cp:[112.4011,33.0359],childNum:12},geometry:{type:"Polygon",coordinates:["@@lKl@nVV@„bn„@VVnm‚nL‚LXx@š„‚VLlKVU„IXWÜ@șlbl@XUĊUlwnW„LÞw‚m@ÞUVmnVl@nX‚JXLm@VnnJla„I@VkxVb„@VŽln„J@knKVn„@°aVanal@XK°b„‚@š¯VJXIš„VK@al@nV„k‚@nK„a‚b„@XL@blVVKVLXK„@VaVI°mVaX@V_@a@yUkVw„VšIVašJ°™@anIlaV@nKnXÆm@wUUV±UUWUKnaWwXUWmŁ¯Vƒam@kakImƒUKƒ»lan@VXXa˜W@@UlUUa@a@UlwUƒV@Xal@@anIVaUK@V™XmwVmUmV„LXl‚@nalLnal@„šnKlkV@@UnJ‚UXnl@nVl¦V@@VnJ@nUVVVVIn@Va„JƗn@@K@m„kƒa@kmWVaUI@a@™k@@aUL@mmaVIUKUVƒ@@IU@mƒUmmL@K@UUUU@mW@@nU@ğ»mVmbk@klW@UXnV@LƒJm„™lUnUJ™UUUWƒƒ@UnkKƒxmLa@ƒ@@lUU™bmUVWk@@nkUmam@UakJU_ƒVm@ÅlÇLUVmVUwULƒKU@ƒk@UƒVUlU@@Uƒ@UaUUWaŎƒzJƒaWLkl™b@bmL@„kKƒabWŽUVƒ_@mV@b¯JmXUbUK™¤ÇLUU@b@JkLWmkUWIkJ@VmX@JUbVXU`¯VV¯blK@LXKl„UV@Um@@Uk@kxWŽkbƒL@KkbmL@‚UXmaU@@l@x@blX@xUJ@bULUlULÇ@@VšnU`W@@nÛ¼U@@VmKUkm@VVX@@xǚ@bUbVb@VX@@x‚LUb@lƒ¼XLlbUlVVU„Ub@n"],encodeOffsets:[[113671,34364]]}},{type:"Feature",id:"4115",properties:{name:"信阳市",cp:[114.8291,32.0197],childNum:9},geometry:{type:"Polygon",coordinates:["@@VllInJlknJVkVU@mXlUÞ`VnV™VU@U@y„@nXlKV„nJVkXKWaXI‚b@yVk„VUkVwn@‚K@nW@k„KlUXVVUlbnUV`n@V_V@llX@@V„b@bV@@nlVUb¯‚WLnbmb@ŽnLnK˜b„U„bVWnLlaX@VVUX@Vln@`kL@ll@VXVJÈIVl@XÞJ°Una„LlylU@UXKlnn@lanLWWnbVI@KXKVL@LVWVL@UVKUIVWX@@XÆJ@In`@lJVI@a„WšÛnK@UlK@UU@VK„nlm„nXal„UllLUbVVšknJ@nV@Vm@a„l@@xnV„„lJVUU@™w@aƒk„@XW@_mWnUlŁUmVKV@VXwW»XƒWaUwnkWUkVUƒU@@@WlaUkkaƒIWVkm¯xmIUmƒLUVƒaUIó»m@mmwXk@a›mk¯¯l™@wƒmkLmmU@UbkUWJ@XUbƒJ@b@l@znÆmK@Xk@Ub@lm@ƒI@akmVKUUVUkU@U±JUbkƒ@IWmkxƒa@UUV™UWVkIUaW@UlLWn@VkJƒI@VkK@L@bmKƒkJmUUaUKWXk¼VxnJ@„V@@VULV¼ƒ@@UkaUlWL@U@W@IkKmL@KULUWULWKUXUJmIƒb—KƒŽƒ²UW™nWKUUkLUƒmUUam@UU™@ƒmUL@xkV@„VV@bmV@Vk@mwkUƒVUx@mbX‚ÇnVb„‚UL¯šWŽnUVLVb@xnlWnU@UVUVVUbVVlVkn@llVUXUWUXVbUJ@bmLUJnb@nVK@bl@@š@bVJUbnX@l„b"],encodeOffsets:[[116551,33385]]}},{type:"Feature",id:"4103",properties:{name:"洛阳市",cp:[112.0605,34.3158],childNum:11},geometry:{type:"Polygon",coordinates:["@@VVUllLXl@LWn@J„@bƒKUVmnL@`VblLnbV@„b@JmL@LnV@VV@¯„VJVnXL˜@nm@aÞ@‚a„k@m„IšmVbXL‚ynLšk°@°aVJnUV@UVVXk@WJ@VXLlUnJVnnƒ°U@»°U„wl@šb„WmUXƒÆ@VLXU@m@U„a@I›mkb™a@naWW@_@WXUV@@U‚ƒ²@„K@I±U@¥kKWLóLlƒa@£Um@kWKXU@mlLXUVKUU±J¯_@`UL¯Wmk@Wa„kkƒlUnƒVUVaU@KUU@mmK@_ƒa@KX@VaUIm±™k„aVKVUkw™@kaƒƒW@kbkL±UUaƒK@UUKVak£ƒ@UmmL@lƒIkmUƒ@Ualw@UƒJkbmIUmn@WKImWk@mUUnÝV@ŽnÝxƒKmXkxĉVWVk@kaċšÛ@WXƒJUV@zŽm„VWnbUbVbšLlUnŽ‚lUÒnWV—VWnk@@Vm@kxm@Un™l@Ll@@V@šXnƒškJV„šV@nlVXx˜U@l„n@aš@VLnWĊ¦nxš@lbVKXLl@ރVLƒ„XJl@XXl`lIXVl@Xl‚XUVšK„wV@lanx„zUbVJ@VVX@b"],encodeOffsets:[[114683,35551]]}},{type:"Feature",id:"4117",properties:{name:"驻马店市",cp:[114.1589,32.9041],childNum:10},geometry:{type:"Polygon",coordinates:["@@n@„b°UƂXnVlnLÜ@VLœm@n˜@na@J„„m@k„@lVšVxXX@„V`lLV„XVV@VVÞLVV°„²@lašbnxV@@b„Lšmlm„_VWnIWUna@lšLšbnV°ƒVL@KšV„LVUVaVLXK@mÆXna@wVm„a‚@Xw@KlL@a„@Va@wUkaWnIVƒla@Kn@Vn@VUl@nKVn„J@LnK@aVkVUUWƒ@VakUVanI‚²X‚W@UUU°KnUVLl@XaVK@ašU@KUI@W@_lm@KkLUKV_Uƒ@»@UVJ@XV@@mVL@K@U@Kk@VwUUm@kmWL@VkVkzƒKmb¯VÝI@WUkÇJUIUWk@@klK@_km@UVWUUW@kbmKUXƒaƒV—amLmK@namaXK°VakU@mU@@aƒa@UW@kkU@U`m@U_mVkaUVWUkVƒL@lmX@ŽLm@UxVlƒUUl@zaWJXbWLUlmIUƒkLmWƒ@@z@VUVUšUmÝ_kVWŽ@nUVUlmIklmIkJUkƒl@n@Lm@؃IUbm@UJUUVU@mmI@UU@k¥mUk@WmVmI@VU@klmLƒ™k@mbkKmb@WkƒKUŽVnUnnxšW@UVLUbmJ@bk@WbU@V„kx@V@bVbkV@V‚@‚—XWbUWm@kb„¼VLn„lJlb"],encodeOffsets:[[115920,33863]]}},{type:"Feature",id:"4116",properties:{name:"周口市",cp:[114.873,33.6951],childNum:10},geometry:{type:"Polygon",coordinates:["@@lšnb@xlJ@UnLlKXUlJl_„KnV@xVL@bkbVVUè@šWb@„Ubmš„ŽkšVšmbX„VJnUl@„a°@@b„LVbƒlXx˜InmnLVw‚anJÆw²IlmnXVl°VVbÈaVb„@lkn@VWnLlUVmÞUUklƒkƒVkUaVaVaUw™K@kkaVWmw„_„‚l@nU„VVb@b„aV@VV@zXJl@@kl@šlœk°WVnÆbnbUšVJ„Iš@VKVm@k™K@_kK@a@aU@@wW@@k@aUW@IUWVUnLlUlVXKVwmk@W@—VWa„¥@k@lnƒUIÇKUaU@ƒUUVmIUV™Uk¥ƒVma@¯k@Wanwmƒ„@@n@@m@UIVƒkUVamUXWƒaV™U_™@ƒmUVUImW@aUIĉK@VmI™b@lU@@n™JƒkU™@KƒIUmmLk@UVm@UŽm@@LkbU„mJXlbV‚@xUbƒ@@bkK@LWx@ƒbUn@xmbÅW@nWLUKUbUVƒK™U@LUK¯„mU@šVV@xULUŽVL@bU`WšUz¯aUamKUaƒ@@xkX@x"],encodeOffsets:[[116832,34527]]}},{type:"Feature",id:"4114",properties:{name:"商丘市",cp:[115.741,34.2828],childNum:8},geometry:{type:"Polygon",coordinates:["@@XVl@lLȃ„@VkV@V»UanƒWX@VaÆÇô@ÈaVX@xVJXUÞU‚aVLĸbXKl„V@šm°Vn_ny˜XX»mUk¥lK@a„_@yšInaVKVa°_@WXI@ƒ@K‚VnIlbnaV@„l„@‚a@_w@ƒlwUKm™Xa@UV@š»Vƒšw@kUKVUUm@w±VUXUKUwmJUUƒ@km@@±mXkmUI™@mm™KUwkbWakLWaUIkJmŽƒX@l@@VUX@JWbX@VbULWbƒlUVULknlV@bVJk„mb¯KknWmk@@nmVkx™@ƒVmU¯KUnUL™@ƒJUIV™maÅaUm¯X›l™kk@@lk@WI@yUUU@ƒb@aUaƒUmVk@ƒƒ`nxUXlb@lšLVxUbUbVbUll„k„VlÝVUnkVmKUXm@klƒ@ƒnUx@xnxƒn@`VX@V²x@V@b@„Wl@zU`VUVVb„L@Vƒb™W@bkXllkLWV@V„@VVÈwlVœ@@X˜K²Llb„WnnÆL@VnJWn"],encodeOffsets:[[118024,35680]]}},{type:"Feature",id:"4112",properties:{name:"三门峡市",cp:[110.8301,34.3158],childNum:6},geometry:{type:"Polygon",coordinates:["@@WKUmUI°ƒU@@UmU@KnK@IƒaU@makKUa@_‚KnmVU„L@a‚ƒ@IXm@KWkkKVkUU@aUW@UUIVaƒymwkbU@ƒx™LVUWWkk@WUkJk_WWk@WI„ƒUK݄k@WKULka™@mwĉ¥mXUK™@@bƒm@k—VWwkU@m™UUƒlI„™Wm@™@Uk@@KškVmn@lwn@@Ul@Xm˜UXUmVсkmkV™KUaVamaUXnƒ‚@ykLUKƒ@™WwKmKnUm@UmƒƒaU@mUk@kL@lƒxċxUnkVmnXxWb@`kzWJ@V—LmVUn™lmUL@lW@Ub@VšXUbš`VLUbUJ@nmnUlUUm@@bUJlnU„š‚U@lxkbƒ@@XƒJUnƒ@kb¯VVVmlXXlJlzn@VlkVW@bkK™bmškŽUbVb„lƒXVxšKÈnšwÞlĊKlšVnKlwX@lL@xlUnVn„@šl@lmX@ƄÈb°¼ÈwVJlx„_°xšašlšUÈxlUnbVxnL@lllšbm„n@nb‚@@V„L@V„@@„VLšJnIVVlKnV„_"],encodeOffsets:[[114661,35911]]}},{type:"Feature",id:"4107",properties:{name:"新乡市",cp:[114.2029,35.3595],childNum:9},geometry:{type:"Polygon",coordinates:["@@XVlL„K°bUblbUbšl@nX@W„XVVKVkš@@Žmb@„Ubn„W`kL„LƒV@VVLnKlVXIlVš@@a„@l£nWlƒkVa„@°bnUlLVlna‚bnUVUXKlU@ƒ@lk@a„I°y„@ôkUU@wšmôšnkWakml™UkVmkUlmUUm@nkUKWanamU„LXW@U‚VnUln„`l„œblL°KXV@ĠJ@L°„šJšUVw„anK@UUImmƒkK@¯±Um@IVmUmmÅnWaUK¯aUk„w@W±kVƒx™U™VƒwƒnÅJUIWaÝJóI—bm`ÝbÅImJUI¯¥¯@mU¯UƒJmnUVóUkl±V@zXl„bWVXL@bm„mº@@XmJUXU°llk„@nWJk@U„@¦U`m¯ŽWx"],encodeOffsets:[[116100,36349]]}},{type:"Feature",id:"4104",properties:{name:"平顶山市",cp:[112.9724,33.739],childNum:8},geometry:{type:"Polygon",coordinates:["@@l¤UbVL@V„LVb²VlKlaX@„„lbš@lxUVULƒbšln²VJUbW@@L„b@`nL@nVV@LVŽUbUVm„kVl„ƒlXbl@Xn°ŽVK@_°`²IVVV@VUVJnInaWK@Uš@„K„LÆ@nmlXXWVUUw@klKVa@knyVkVanI‚JXUl@XbVUl@@aša@mXk‚bnK@UlK@UUUVaXaWmkUm¥n—WmXaWaœkl@VmÞb„KVL@aVI@mUwVm„@KōméUL™KVaUk@kUK@U˜WXI@VlKXU‚@VVnInVV@VLlK@UUƒkKU_@ƒWWUwU™@klƒn@ƒƒ@Imb—@@m›nUKÛ@mKUkWVXxmbVLXŽVVU²VV@xÅnmWmLU@kbmJ@b¯š™IUb™JƒUUxVl@z@bU`W@Ub¯nUJUbƒ@WLUKULkU@aWKƒ@aƒbmL@ƒlmUk@@bUL™ƒWJUI™°@ƒŽ¯aWLk@mbUb¯b"],encodeOffsets:[[114942,34527]]}},{type:"Feature",id:"4101",properties:{name:"郑州市",cp:[113.4668,34.6234],childNum:8},geometry:{type:"Polygon",coordinates:["@@@nWVUKÅ@W„nVnI‚ŽV@œkƂšwV@šnn@lxÞlnôJ˜zXJl@nalUČVlƒl@²UlkôVVUnm„I°VnV°@°¦VJnIÆJÞan_VmU@ama™@kU˜¥kaUklw@UIV¥kVUI@ƒmmUÅmUlƒwVU@amU—JWbUakVƒ—Vé¯Im`ƒk—@ƒwVWmLkU¯ŽƒXkWmLmx@UUƒbm@@x™J@LbW@UUVWUkVKƒ@ka™IUamKUkkmmLƒUkJUVWXkWmnÅ@ƒKƒL™@@VXLmbmJUIUVU@ULWVkK@nWVXL@lVn@¤„b‚kôKXKlL@¦²V@JƒL±@„@VU@WV@X@`XXmb@Žšblaœn@Jƒb@V"],encodeOffsets:[[115617,35584]]}},{type:"Feature",id:"4105",properties:{name:"安阳市",cp:[114.5325,36.0022],childNum:6},geometry:{type:"Polygon",coordinates:["@@°kVaV¥kVmUkWkWVkVKUwkkmKUU@a„wWWXWakKWkXmlašIVmX¥ƒU@a„@WnK@kƒƒ™V™I¯ƒ@KğI@WU¯LkK›akƒƒ_kmmVU@VWXƒKnVmbXbVLmln@VVknlVUnVlkšlnXbmlmlXblnÈlWbn@@nšK@V„L„bVV°VVzšlnš@V™xƒI™b™ŽU@WLUa¯V™UkWõ@¯kkmxk¼l‚„XUlVbVLnlULmU@lƒLkVUlƒX@xW@¯mUƒ@UmIUW™L@aXa˜kU™¯anƒWk°@k™kKmmUIWaambUkkKmV¯aƒ@UblŽk„mXk¤ƒ@@b™@UbULWVnb@lUVVnmšnVVU„J@bWXX@WJkL@blVU°UV@XlWnXUbW@UVkVšVWbnLUJWLUK@Lnn@blVU‚„nUblxVUVJXU„a˜@Ub„LnUVV@mVIVVn@UbV@‚XbmbUV„_lVXUWanJVI@WkI@WVIVU°WXXl@la@mX@lLXl‚kVbœm‚X„ylIXJV@@kšKla²UVa„IVyÞb°LlVna@UÆKnLVbšK@anwU™"],encodeOffsets:[[117676,36917]]}},{type:"Feature",id:"4102",properties:{name:"开封市",cp:[114.5764,34.6124],childNum:6},geometry:{type:"Polygon",coordinates:["@@lUVbXa˜InV@bUV„x‚knVVÆnn@„VJlUU¦VJ@kxVllb—¦lVš@nb@bVŽUn˜aôJÞIXbVJÆI„m„xšUšV„w‚U²l@XƒxVl°bVLXb‚`XklUnmVblLœ@lmšx°LVK@UXIVašWlL@Ukƒ°KkVaVUXmmI@UÅKmmƒXka±K—L@W›@kUÇxUUƒ@@UXUlKkklW@ašX„a@UƒKUaVUUV_@yXk@ƒ@a@U±w@UUW@_„mmw@wVw„mUaÇbUa¯UUkmWkn±JÅxmIbUxmKmn—JWw„kUaƒK@a¯@ƒbk@mVUIWƒ—Lmwm@Ua@WJUb@LUl™@UUmLUbWJ@VL@VmXWWzUJUꄘ"],encodeOffsets:[[116641,35280]]}},{type:"Feature",id:"4108",properties:{name:"焦作市",cp:[112.8406,35.1508],childNum:8},geometry:{type:"Polygon",coordinates:["@@V@VL@x@bXŽWV@XkššlUŽWX@J„@nI@KlL„KšUVaV@œJlL@KUk@KÞL‚l²_‚@nWlL„UVVš@nLWVUJVn@anV@a„wÞUVLVx„b„@lW„@lbXn‚Vn@@¼šL°mšKVn@bnl@nVK@blb„L„W„U@VWLXV@nlKn@lVVbXw°nV_@¥Vƒl@XI@mlƒkkV¯VWnI@W‚@n¹nƒ@aWKXUƒaWk@yk@k„ċUkVmbk@WI—yóImÝkkwm@™mU@™xŁ›lU@mJƒX™ak@ƒx¯V@¼¯Vm„UmmIkVWK@UXIl@UWVUU@mVUI¯b¯@™lmKzWKUa™nƒJ@nƒlbÝ@@b"],encodeOffsets:[[114728,35888]]}},{type:"Feature",id:"4110",properties:{name:"许昌市",cp:[113.6975,34.0466],childNum:6},geometry:{type:"Polygon",coordinates:["@@lI„VnKlnVlnLVbšJlb„@ULVlUXVVX@‚a@KšI@wn@„aVV‚@nwnKlX„W°lVnKUX„x˜@„ln_°JVIXy‚XnW@U‚K@UXIVanKVVš@Vk@KVaXI‚@Vbn@nx˜KnaU™l™ƒn™Va@ƒXa@™VçUUla@aUK@wmUƒLk`kIWVkLmK@V@XUlƒn@JXV@nm„™bU‚óIƒmUa±@@ÑóVUUk@UlKVU@akWVUUlUUaUK@UUKWbUkÅJ@XWaƒ@XbmJ@nUJ@bUKƒLÝaUnk@›lXbWbXnm˜n¦lVXnWbUbVV@VkL@VmLaWl@n™b@bk@UVWak@WVImJUbUlmz@lUbkL@lVx"],encodeOffsets:[[115797,35089]]}},{type:"Feature",id:"4109",properties:{name:"濮阳市",cp:[115.1917,35.799],childNum:6},geometry:{type:"Polygon",coordinates:["@@lLXbW‚XXƒx@bVVnLllVxULUl‚XXlVlUnlŽU¦Ub¯l˜nœK@V‚bVb@šXbVL„KVxVVnIlašb„a„¥lU@wnalLnVVlVLXnlWVXn@@lVI@WnU@mƒÅW¥—aW_k@WwXy@kmƒ@wU„mš„š¦šlUxVLV@UwšJ°xš@VX„@Vb„@š`VX@VX@llšIVbnJlI„bšV„l„˜J@ƒmѯLóa@ƒƒKUa„k™ƒ™Xƒ@UK@wU@ƒlWUUݯImW¯aƒLUKU@ƒkƒ»k@mƒwƒa@UnKWI@ƒUU@akVWK—k@a±ƒbóUWKXUmk™KUmLƒbUx„„@lmLXŽƒ@@b„VW¦Un™JkbWnXl"],encodeOffsets:[[117642,36501]]}},{type:"Feature",id:"4111",properties:{name:"漯河市",cp:[113.8733,33.6951],childNum:3},geometry:{type:"Polygon",coordinates:["@@@Lƒ‚UnVxnIWa„@Xb@WÆIVlXaVL@VVLVbkVVŽUVlX@bUVkLV‚l@VVôU@Ò²@Vb„nôJVšanƒ@mWU@I„mVk@WkI@wmak™@wlW@w„@VbnLVb°bVyX™V_@aUKVVK@wUU@™™a™K@kmbXVmJUXƒ`kn™nƒK@aU@mw™akb±@¯ƒUUÝKUUU@WU@VkLUKU@mUmJUU@WVkL@UWJ—X@VVL@lVlUbšLVKnêƎ"],encodeOffsets:[[116348,34431]]}},{type:"Feature",id:"4106",properties:{name:"鹤壁市",cp:[114.3787,35.744],childNum:3},geometry:{type:"Polygon",coordinates:["@@ó™™n@xVVólƒ@¯zƒJ@bkl@@„kVWLUVmVXbVJnnlLlš¯@Xlm„°bVš—lWb@bšKVXnJ@VV„°nX@@w„WVklU„K@knVVKmkUKUaVkƒWkl»nwlŽ°lö@lXšV°UVbXKV@šša„Jšw@Um™™kUy¯UUUƒaƒK@U™L@mm@XaÇkkmWank"],encodeOffsets:[[117158,36338]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/hu_bei_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"4228",properties:{name:"恩施土家族苗族自治州",cp:[109.5007,30.2563],childNum:8},geometry:{type:"Polygon",coordinates:["@@VK‚bX@lbUVnL°„@VlVnUl@VUX@„aVƒmaXƒlašUUU@wmaVUn@Vƒnmmk@m™U@kna™aU¥Vam™X_@WƒU™mW@_kƒVaVKnL‚lœ@VVal@k¥@kUW@kUKVUlUVсW@kÇaU»ValmkUVUVak™@aƒV¯_@W‚UkmVUlU@aœƒƒalI@akkVWUaWXUWwœWVbÆ@„„l„alIVK@U™m@UU„W@al²a‚¯UağÇm@ƒbkk@wƒ@@W™aULmxƒIU‚™ƒb¯@U`UX™JmL¯aƒKX›WUL@aknmK™@aWUXaWm@I@UÅmVU@™™aUV@b™VƒI@WkU›bXkm@VakwUKULWKXmJ@XUK@ƒmL@KUwVaUI@KU@mmn™mXka@»V@@UUaƒw¯yVk@ƒUUVmmkÛÈU@mWUnmx„šmlUbV¦UlbWVUL@UUƒ™IUmÇKV„VbUVVxkn™LUxV`VX@š„„kJVVUXWaUVVlUnmKUbkI@WULmK@L@LVlƒLnmUIWV@aknƒ`VXUJIVlUVVbUX@¤mbnLm‚m@UXk@mm@Ukaƒ¥@kV@@KkU@aUKWbkLWVkIVŽk@UbVlmX@bU@@mmL@bn`@Ln@llVLVk„@XVVU@`VXUš‚¼k`VULka@VllVIn¤VU@@bl܃bkx@bkL›škKƒn@bn@@b@JUnV`UnVbVKlVXUlbn@°ƒVx„@@b„nVbUllVn@V—VK@UnW@UVUšlnk‚VÈޚxVb„VVI„xVaÆ@@aka@UVaU@@a„k@Wl@nbVIƎ@Jk@„L@VlXnlla@VJnw@UmwXU@aVK°ÒnllnLlb„xnKVaV@l¦²nVl@llL„x@XVVœ‚Ķš@našx@U@al™XUVa‚LÈþV°XxWXkK@šmLnlUb@b‚xnLVlVVkb@UJ@xWXXš"],encodeOffsets:[[112816,32052]]}},{type:"Feature",id:"4203",properties:{name:"十堰市",cp:[110.5115,32.3877],childNum:9},geometry:{type:"MultiPolygon",coordinates:[["@@@a@w@kV@nbVK@ƒnUla„@la„Ål@nlVakwWX@WkLšaVmšwV@anK@UlIXmWkk@@mmLkWlwk@U_mKXwWK@U¯K@UU@ƒVUa™kmƒkI™yUUVUmanU@mlwkƒ@_mWXaƒUWU@ǃ@U@aUaVwUKUIƒVkK@UWIXƒmaV@k@Vm@UnwlƒUamk@V@„ULUamxUJkU@Iƒ`WkkK¯XWak@@W@IUV™LWJkXkaÇVUKƒ@kUmbmUUƒUKƒbkKWUkI@ƒkKÝ@@aƒUm»nI@mƒU@UnWV_@aUmWbkLUl¯b@a›kkk@WkkJm_k@UV±@J@b›nU@@WÝIUJVbXL@nlJkx@„Wn@VkJmb—LmUƒ`VbUL@xVn„@XVƒŽ@„mVVnnJVbU„ƒx@„V„nVUbVVƒx@šn„™bUK@bƒ„@bƒJ„šm²„VU‚lbXzVJV„„JVbn@@Xmb@V@bVJÈ@‚Vnkn@°aVVV@šX„KnalLVmšUnnVKVlnLWlXX„Klk°š™šXŽWškLUVVV@nU@ml¯nmbk@W`Å@mb—LWm¯UƒxnêVèk@mbƒVƒnUK™@kKmXk@@JUI›lÛLllnbVnlJ@LULnlÆaVLnŽV@nkVJ„@lkô@²bÆm°w„L„WV@VXšKšVXI@W°ÆVšK„b°U„JVIVV„¦XKVL@l‚InaVÝnUl@@bX@‚™nmVL@lVL„lVLVUnbVW@xXn˜bœU°¤V@š™„a@kWKUUn@VlnL@UV@Ü»@mX@V_ƒakaÞ@VK‚¯@kkW"],["@@mUkUUm@nllVKXXVK"]],encodeOffsets:[[[113918,33739]],[[113817,32811]]]}},{type:"Feature",id:"4205",properties:{name:"宜昌市",cp:[111.1707,30.7617],childNum:9},geometry:{type:"Polygon",coordinates:["@@°`„U@blšUbUVlVkn‚ŽUbV¼Èb@l‚XUÒkVUVVL@lVX@ll¦k@UbU‚›@kmKULUbl„@`nXšŽ„V@XW`nšUbV¦šbmb@lšV@nnlmnU„m@UVnb@xVV™VkbW„nb‚VnVa@an@UaVU‚JXnWlXX@l„¦@ŽlKÆX„bX‚V@VV„@°¯°xXx‚XV@nV°UVWU_VWXkmaVnWVkn@lln@lb@UVLXWlnX@˜aXUmaVK@UXU„U@WVI‚W„XXV‚U@¥VKœ@‚Uގ„„‚a²LlV@kV@UanKma@UVUnK@UVLXyVL‚knJ@UV@@UXKWUXaV@Vb@mVLnKW„m@aUUm@@UkK@Ula„LXKWaXI@alKlmUk@wVKXL@m@WWn@UVa@K@wna@aW_XWWkXbVW@k@U¯WWwka@UUaVIVƒkU@m±@U@@wVKkaš_@VV@XUVwU¥‚šyUkm@V±ÈUKk»ÇL„m˜mLk@ó£kmWwƒm@U„IkWKXwWU@ƒkLƒwkbmaƒbkK@VƒLkmWIUKkUUƒÇIǫJ™XÅJULVŽÇLUVƒ@UK™@kI@WVI@UaƒWmXVVUL`±kÅLmKkƒƒkƒÅ@Ua›XXxWVXŽVbUXll@bkJ„b›„@bkVUVlnV@X"],encodeOffsets:[[112906,30961]]}},{type:"Feature",id:"4206",properties:{name:"襄樊市",cp:[111.9397,31.9263],childNum:7},geometry:{type:"Polygon",coordinates:["@@@Xl@Xb°WlLXl„_@JlVVInwVbVK@ƒ@UnlVbk„mx@VUnl@U@nbW„XJ@VlL„UVJVLUxVb@b@VȄ‚@XV„VWbnX@`l„kx@nmVnbUVVVšzlJn„šlVb„UV@@V°L@VXLWxnLV`l@kxlXnK@nl@XlWn„`Xnl@@UVa@VÈKš£VLVanW°U@UVU„@„`VIn‚mV@„nV@Xa@aVW@UšalkXKšblI„yƍXnlJXbl@@VV@nklU@`„nVK„LVKVb@V„U@UÈK„UVKšIlUX@V`lIVbn@nblVVmV@@XXJšUVV@knKVn@`@X‚VnK„wlLVmUUU@ƒU@aXL@WlU@UUW@UmU@KkLWaXkWmXUWm@U@ƒnk@UmK@U@UaUVUUKV_@al@namWUI@KUƒK@aV@WUIƒbƒ¥ULUJkIm™ƒK@U@K™V@U@a@UkU@K@wVaUwlU@mUƒULmKUkV@@anIWmUK@I¯„mKkl@LUb±lUakLmk@WwUKÝVUIm`¯n@Uk@makJU_@ƒƒJma¯ImwUVkKƒb™aUÅ@wWaU@VU@mXIVmmUkJkwm@mIlUKWzUK@VmLUV@VnbmLVbU@@lkU±KbƒƒÝV›@UL@¦VWUƒWXUJ@XƒVWV@VULnbWV—bW@kmWXUK@Vkam@kkm@UlmXUŽnbWlUXV`UX¯VmUU@Ul@Lll@nnJ@LƒnWmbmš@b™`ƒš","@@kUUm@nllVKXXVKmU"],encodeOffsets:[[113423,32597],[113794,32800]]}},{type:"Feature",id:"4211",properties:{name:"黄冈市",cp:[115.2686,30.6628],childNum:10},geometry:{type:"Polygon",coordinates:["@@VVUnWVXnVJ@„‚U@V@VXŽV@@IVJUnŽ@V@L@KlIVlVanLVbnVlI„ƒn@@a@Kl@@I„JlI@aXU@KlK„kVblJXU„VlU@V„bVkVKXn@VlxVa²I@VlVUxln@bšJXklaVWnLmÅ@y@k@ašI@W@aXIlVVaV@nnlKnLVW@IUa@a@K„UVVlI@wXKVV@IUƒla„@lUXwWƒnƒnalLlxXLll°@XwVKVaXIl™nb˜@nln@Va@U@k°ƒUmÆUVaXI„JV¯ÇUmmkU@WaKmakVm@U@aVKkkmKkVmIkÇ°£@aUUVaVVnKlkX‚mkƒ@ƒlUVaX@@Um@‚™UmlUXV„UVU@w‚K²¥Ua@I@UV™l@U™V±UIUÇ°»VkUmVI@a@U™m™ĉ™¯V±bŹĖğaÇL¯lmŽkX@‚óĀ@ŽmšÝêb±WkLƒn@xXx@Ž@b@V@LW@UbƒlţXƒ`kxWnXô¯¦ÆV@L@JVLƒxkK@V@bkz°l‚lXz@J„UlVla@XUV„bVKXnW`XXV@laVV@V„X@V¯xƒx@xULVbUJ@n@LU@VmmakbUK@b™IWWUUVkUmkLm@VJkb@nUJƒ@`V@kX™aUaVmmLkUmJ@Uk@U„±lkzmJUb@b„VUxVXU¤ƒL@JƒX@VlL@JkLUVU@mnUl„¦@V"],encodeOffsets:[[117181,32063]]}},{type:"Feature",id:"4210",properties:{name:"荆州市",cp:[113.291,30.0092],childNum:7},geometry:{type:"Polygon",coordinates:["@@ÈJV„lVVLXJln„K@UlL„anbla„xlK@„XVWxXLlƒJ@V„nXxlnô¤l@nKn—‚ƒÈKl¼VL²Ç‚Un@Vl™zŽV¦UxWVU@@U™`lbUL@xV@²@@nlVU„UJVb@VlbXx°XVWX_VKUwVKVa@UVKUUVk@KnblaUU@wnWl@UX@lÆ@@a„IVmUk„™šxVJ„U„bܙ@Uk@WWnk@Vƒ„™Vm@I@m@Un@m™XUlVlUnJ@knJVU°@@aÆLX@ƒllL@¦nJV@XblLVa²U@UlWš@VX@`@LV@@bXJlIXml_lJœU°b„KÆLnVVl‚@ö—Vƒ‚mXaVIĢllUlVnLVlX@@b‚ašnnxšV„L‚bn@°ÆXmmkĉƒ¯w±™™™Uċ@KÝÅƧŃÝ癙Uw¯ƒm™¯k@W‚kV@¯UIUJW¼kb™Uƒwk@W`@¦Uônb@VƚlÈ@VU@ƒƒ£UWWnUÆUnmJkUÇ£VWUI@aUU@WkI@Uƒa@JW@k£kaWVUKmnkKƒb™kkVWb—VmUUmwU@kk›@UakUUa@V@nlx@lUb±lUbnnWLUyk@UamœUK™@mlk@Wb@VXL@x@xWI@a¯Ž¯V@bVn@LkKmL@`XmKmVU@@bkL@V±bk@Uaƒa™L™KUVƒIƒ„™W™XamVVbUK@b@Lm@UWkxULWVUnm@UlUX"],encodeOffsets:[[113918,30764]]}},{type:"Feature",id:"4208",properties:{name:"荆门市",cp:[112.6758,30.9979],childNum:4},geometry:{type:"Polygon",coordinates:["@@n@lxlInVUnWJ@nUVV@Xb@xVƚb„alLVUnx°Jnb„I@„V`lInbl@@V°mn_VJÞUVLXx‚@nllKVb²kVa@KlknL°ƒ@JVLXnmJ@bU@VlnLVKV„@nX@lUšKVaXal@VKn@¥°L@Unw˜bnašV@KV@VUX@lVXI@KW@@IXWV@laVL„„KlaXUVVnkVWV@lwXblIXWVkVmšaU£VaUmVIkU@y@WakKUamU@UUK@kmK@w@@mK@LƒV¯™U@WwkmULƒamVVUU@ƒƒIƒbUKUa™kmƒm@UakLmxU@UÒWlULţÿmwkIUm@a‚kÈblW@UVƒUUk@JW@XkWWUkUKUIlw@aUWknWUUmnIWƒ™aUwVaۚƒaƒVUI™wƒšVlUnƒJ@bÅ@@kVWk@mX@xVVkbma@LUlVVUL@VUbULVxULW`UX@V@lUXWaXlWXX`@bmb@x@LUb@VmŽXX@‚@nWKUL@xVlknkL@bWJXbWLƒKkb@VlL@Vn@VV@bƒnX‚mLUK@nUaU@WbXVWL@VU@@V"],encodeOffsets:[[114548,31984]]}},{type:"Feature",id:"4212",properties:{name:"咸宁市",cp:[114.2578,29.6631],childNum:6},geometry:{type:"Polygon",coordinates:["@@ÞƂLČ@šV‚š²š°xĊ„nlWnŎ¯m@aƒK@„„°‚n„Jšwn™VIUaÆJšÅ@wšwV™XW@aV_l@²V°lĊwlaXLšwlUkalVVaX@lVXI@a˜UXJ@U°UU¥VIVKVklanLVa@VÈIVV@nk@aVa@mV_@a„K@klKUa@UnKWk@@lU@@UW@@nUWUwmaVIXƒ„lV@mLXblJ@kV@kk@KU@WƒkUWVÅwkLmW@UmL@lUL™KULƒak@maUUÝwUJƒIb›KUUƒ@š™aWK@kUWVkUwVw@™mÝ@™I@wkW@a›ww@LU¥™kƒJ@nVJƒIkVVnkV›UkyUIUl@xWUkaW@@°kz„ŽWxkLUWmzk@@bVVVš„b@‚@XlVœ@Vl@bVbUn™`Wn—@Wb„VVI@`„LVbXLV`mnU@@lƒL@LUŽƒak@ƒLk@WbUJn¦@lVb@xVb@n"],encodeOffsets:[[116303,30567]]}},{type:"Feature",id:"4213",properties:{name:"随州市",cp:[113.4338,31.8768],childNum:2},geometry:{type:"Polygon",coordinates:["@@„@nš`lw„k„ƒ„UmUVWX@lk„@VanUĠ¼V@@mX@@nVV‚VXLmJVLnK@b„V@@J„@VUn@VaVUUUVWVLV@@Kk_@almaVkUU@WVƒVUVLXmmk@wUaUKUV@°™@kmaUaÈmW„mUƒVklaX@lVnxl@@UnaUk@ƒVUVwVK„nš@VVn@VbVJUknUmmVmk_Vw„KUUm™Vak¥@UVKVIkW@UmIVWkIVƒkmmLkwmVUƒ@LƒUU@VVXL@JmLUbmK@UUKmkKUUmVUaUnÇlk¯™mJUnmLUaUJUaWL@UkJ™ƒUƒ@ƒaklkU@¯@KWLUmUUWVkbƒLƒŽUKkbU@WX@JX@@LWJkUW@UVU@@L™Umb—amx@V¯K@¦mŽULk@WbUb™LkVW@kVVxUb@x@LlV@V@b@VšU@L@V„LnšlJVIVK„¦„aVJ@XUŽ@b„LV‚@LVJnXmbk@@bU`VLUVV‚b@V@VnL@Vml@„@VXnWVXnWlXblK@LnV@VVX@VkV@XWK@b„VV@VV"],encodeOffsets:[[115830,33154]]}},{type:"Feature",id:"4209",properties:{name:"孝感市",cp:[113.9502,31.1188],childNum:7},geometry:{type:"Polygon",coordinates:["@@VnXK@L@°lVlk„b„@„VšlI@VXKVbVIVbnKVmnI°šlŽÈkVmVbnUVVlLnVL@VnLVanK@IWKUUV@„V@KV„nUlxnKlnU„lJUXnJ@VlXUJUL@Vl¦UbnšVVƒLUxl`UnnnmVVlnVK„bšmVX@a°Ý°LšaXJV@VUnKVXVK@LnKlLUbVVX@VwVJVn„@@UU¥V@@UUK@ƒmaUVUkkJ@L@K@UmVUI@JU@W@U@UV@ƒUIWmXUVmUUÇ@UVmIlmnmakK@akaW@UwVUkKVnUlKVwk™ƒVU_WKUkVW@UXaWkUa@w@VU@XaW±@IkbƒKƒb¯L@WƒXkWƒ@UakL@UV@UmVUmL@UXWVL@ašUƒVUUUVU@yUUƒIUa@wUKWVU@kƒ™™Wk¯UkwVKƒLUx™K@nVxUlUUWVUmw@wƒUUyXWlX¦WbUV@„U‚@blbUVVbXXƒl@lVL@bk@lxkVVnVx™¦ƒ`UnkL@V@L@Ž‚@@xnL@lVL@VnVVblLXb@‚@zlVUJVnUbV¤™bUnUlWXkJWakxU@UXml"],encodeOffsets:[[116033,32091]]}},{type:"Feature",id:"4201",properties:{name:"武汉市",cp:[114.3896,30.6628],childNum:1},geometry:{type:"Polygon",coordinates:["@@nbnm‚knJVUÈ@@Uƒ¥VknmV@VUlK@IkK@U„W@I„KV£UWVwƒU@aVanIly²kVƒl@@VnIlVnKUnVbšblWU@@_„‚VI@mlaUIn@lKVnUlVVXXšJ@aVLlanbUnV@@K@mVIUaVK@w„w°w@UƒW@UUUkbU@WWX_WmULƒaVU@WkbkUƒV@IWyk¯kly@a@UlL„wUK@I@KÅUW@ѱUm@wl¥kaƒ@@_Vw@ķƒa@akw@ƒkKW£XVUVwVwUaU@VUU™™xWKkbĉx¯k±Uk@U`@bWXUš™x@x™ÆÅIVbUJmš™xƒImƒ¯@ƒ™Umx™nUVVbnJV„@Lƒ@@ŽkV@bVnƒ@UVULlx°VXlššl„V@XUVL@xVb„JVV@zUVVVUV„™V@bUKWX@VnKUVVnU@@VlKVb„@lX„W@X°K„a„Lla@JX²Wb@ŽUV@@xVbXlWb@VUXVlXLV`Uš„lŽUxkLmVUŽlLUVVxX@lb@blL"],encodeOffsets:[[117e3,32097]]}},{type:"Feature",id:"4202",properties:{name:"黄石市",cp:[115.0159,29.9213],childNum:3},geometry:{type:"Polygon",coordinates:["@@VšUVV@VbUx„aWUœblUVmnKlX@bXJVIlVUxVVVIU‚zlx¯š@‚VbnL@x‚x@UVaXK„b˜@Xk‚WU_Vm²klW„XVK„Žl@nXV@@w„mlK²X‚aÞén™@ôÿ@lWn°kUKmmUљUmm@ƒwkImWU@UakL@bVLUVċ@™bUK@alIXKWK@™nXnKmkUVwƒ@¯b@L„lUL±W™n@KULUaW@kL@lƒL@bU`@nUb@bmlU@UÇJ@UUbmKkblŽUULUJV¦¯V@VWI—V@bWJkUW@UbkUlbkV"],encodeOffsets:[[117282,30685]]}},{type:"Feature",id:"429021",properties:{name:"神农架林区",cp:[110.4565,31.5802],childNum:1},geometry:{type:"Polygon",coordinates:["@@n`lIXll@lœl@b°aVklKXaVn@bU`mX@V„V@nmJn¼„V@bÞ@lL@„lJXVlL„aVLV„nVnalV„@VLÈUlblWXIšKVU@J„™š_‚@an™na‚X„m@KmI@mkk@KVkWWw¯w¯°ƒ@UUU@WƒaÅWkL@ƒ¥@kWWXkWmIUVVbm@@bUbmUU„ƒbW@UVk@mVkU@U¯ƒmKVUkaW@aULƒÆVbƒb@VÅ@Un@VƒLWl¯Lš„"],encodeOffsets:[[112624,32266]]}},{type:"Feature",id:"429006",properties:{name:"天门市",cp:[113.0273,30.6409],childNum:1},geometry:{type:"Polygon",coordinates:["@@@K@UlKVm„_š¥UwUmlUkwl@@aUK@k„kWWUaVUka@aV@ƒVUXaW¥Xk@WWIklm@ÅxmI™VÝUkxkaƒ„@bWJaUL@„W@™l¯UULU‚ƒbƒkV™Ua¯bm¤UnÇUkmUšUx˜b@VkXÇal@bVnlJnxŤĀVKXkVÑV@nwlKVbn@n„šlVbVL„a„J@„VV‚UnU„bVKlnXxV@°š„U@KnL"],encodeOffsets:[[116056,31636]]}},{type:"Feature",id:"429004",properties:{name:"仙桃市",cp:[113.3789,30.3003],childNum:1},geometry:{type:"Polygon",coordinates:["@@VK°VškX@@ƒVK‚bXI@a„ƒlblwÞVšUnJÆwn@lkXJ@X‚WVz„V@xnx‚VXUVVVkUw@mšLVw„KVU„@Um@alU@„@@KUƒmIUaVUšmnwmw™mb@aW@UkmKkUkVġkUJWbnU„õ˜@UkmUÅKƒL¯a›VkIk`WnkJƒ@xVLUVVbUbk@WlXbm„VxnxUblbUV™@@VUV@nVL"],encodeOffsets:[[115662,31259]]}},{type:"Feature",id:"429005",properties:{name:"潜江市",cp:[112.7637,30.3607],childNum:1},geometry:{type:"Polygon",coordinates:["@@UbVxšbX„mJVnXVlmVX@bkxVJVLVlXXWlX@@IVl„V‚U—aVwV™lnÈVVmn£°aVbUš„l„aVUK@mVU@Uš@VUkaVamwUwnƒWaXkl@VaUaVUUK@w„WI@aU@@K@_UW™@kX@V±VUbkKWaU@mI@¥kK„kW@ÅK@b¯@UVmI@lmIkVkUWVnšm@@V@n@JUnƒšU„@ŽmlXXl@@V"],encodeOffsets:[[115234,31118]]}},{type:"Feature",id:"4207",properties:{name:"鄂州市",cp:[114.7302,30.4102],childNum:1},geometry:{type:"Polygon",coordinates:["@@°¥WóXmlw„_ŤW„kVaX@@K@U@a@WwU@mWk@ƒULƒWkX±lUnV`XWl—@ƒaWLUb@Vw@wmKUa@°™kw‚yVUJUUVwkUUJWI@akWmLUnkV›aXVƒbUxUVWX¤lL@„lx@b„b@ĸUx@`„@lbk¦@x‚n²VƄX@"],encodeOffsets:[[117541,31349]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/hu_nan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"4312",properties:{name:"怀化市",cp:[109.9512,27.4438],childNum:12},geometry:{type:"Polygon",coordinates:["@@@n„‚@b@XnJ@k°x@aVUnl‚UXnV@@VnJWUJV„nIVV°ŽUbVVVL@Ž²LUVa°V@aV@nm‚UXblLXWVXVmVLVK@an_„`@X@l°„VlXXW`nX@Jmn@b„@nV@Lm`„bUb‚n@VUVl@nIVbUlƒV@LkJUnVV@xVblVUbU@ƒzUKU@mx@xUnn@@WV@lbUb@šnVWXX‚V@VIV@VUnJ@VUz@JWbXllI@VXVVL@ŽVn@„„Wlb@„Žl„XVlL„aV@VJ@XX`„kVwVl@bk„‚bUŽlVXIlƒnLVa„mVwV@@nV@XaVJVbX@lwV@n„@nV@VWnIVVUŽÆ@Xx‚a@I„UUKmk@mVƒ„IXmWUš™VJnUVU@anaVwk™›U@UXa@W™@m_@a¯@@K@UVƒ„bnK@blIlbXa@WW_n@VƒU@¯bmyƒUkUJÇÅ@WU@kWKÅwƒnm°KVkmankVWnXVWV@UƒƒwXkV@mƒ„UlLnaƒVaX@VUn@VnVK@xlnXWšU@a™@@klak™Vw™mUaV@™wmIÛ`m—@mVUXmlIXƒV‚I@K@aU@UaV_UK@wkUmmUKWXŽmVkUƒL@mƒƒU_nK‚™@aVU@Ukak»@U™™@ymUƒ„¯™ƒUUƒVKkam@™nka@ƒmwkLWb¯mkaƒ_VaVKUƒ™IUw@kKmU@WK@UnƒmaULkU@wUalWV¹U@@WUI@WU@‚_@W@U@mƒU@WbbUK@Um@@UmbUwWWkk@WU„a@anUUwlWUwUU@wlJVUnnV@@mnI@m‚K@U@w„a@wUm@_mƒVUUaVUkƒƒƒ_kċUk™VWLƒ@mlU@kn¥W@UwUWV@VÝU@lXLWVUbVLXlVIl‚knmU@VUJk@@„ƒ@™kVmwmVkxU@@XmVUb@xnKVLl@VxUxkIU`@bWVXX@JWL@bkb„¤@bmUUU¯Kƒkmb@V™VU„VVn@@„Vb@`lnœxmb„lUn‚bk„@xU„mV@bmWbUV@VJ„Il@nVUb‚K@nn@VbnJVIlJVkXJ@X@lmx@bnnWVXJWXU@UlU@mk@@llb°x„IUbnJ@VWbXVmI@JVX@bk‚@bWL@JUXUK@U@Uƒ`n@@Xm@XVW@@nX@@`ƒImxU@@JUI@KƒLmK@UÅUUV@VW@™¯kUU@UamVUUmJ@n„xmLKƒkmJkwkKm_mKXU@aƒU@b@Wk@ma@zUJVUmbUlU@™xnXlWlXXblK„¤V@@nUVVLkVš„l@Xb@VVK‚nXKVx@znW@X‚@@lVK@X@JXbWbnn@JUamLVVXIVxnK@aWUX@˜x@VnI@WlI@anV„IVxk‚l@lbXXšxVVVJVInbV@@ln¦ml@XXVWbkJWb","@@XLVKVXVKUa@UUUmV@l"],encodeOffsets:[[112050,28384],[112174,27394]]}},{type:"Feature",id:"4311",properties:{name:"永州市",cp:[111.709,25.752],childNum:10},geometry:{type:"Polygon",coordinates:["@@lxUXV‚lXUVnlVĢ„JVbUXVJV@XUW¯„VIUK@klW@Un@„nl@V`XUVL@l@šVx@„XXW`UnUbšxUlVnUšV„lb@VnJšUVVVInJlUšVnwVklKnw„LVJVšV@nIV@nbVa@KVVVUUa„KV_nVVJ@_VW„nV@n¥lI@anƒl¥X_VKlwVlULUVVVš@šU@VXL˜ƒ@IUmn@VU@wmKXUWU@m²šl@VIXWWkWUkWlkIVamUXamUnmWUU@@Un™lK@XJl@kVUk@mWKXkl@@aVU@UVWUUVa„In`VUVLnw@U@K@Uƒƒ@w@UVmUUƒ™°K@UnV@bV@Xk@KVm@amk„aU£VWUUmUUwm`UbULka›KXU@kVmU™@aV_UWVIn@˜y„XXK@klmV„V_kWVUn@WUU@UƒmaU@™wnwWanUmmXkƒam@UakLmK@b™xUUUU@Km¥Vaƒ¯@ƒkUaVUlm„UU@mUUÇmUk™Uyƒb™bUa™XUWWbÅLmL@V™aL@WWXUKmmk@a@UUK™XW¥kU@VƒUkxmVkUWbUJnVJ@nVJXzWxkŽ@lVbUX@VVL@`mbUnšŽUn™VV¼k@Ulm@mwLƒb@lmLUK@UamƒWkƒK@£Ua@ƒ›UkJkUmbVlkX@bWbUŽVŽnnUVl„@bšbVK@VX@lb„V@nU¤šx‚²„Knblb@x„V„ô@šlŽ@b@l@XWxnVl@„VV@XLVl‚LUŽUXV`šbXXmJU@@bm@UUkLW@UlUKWUUb™wUm™L@nklVVmVXXm@@bUKlÆn„‚XkllVUVVL@nUbV‚@V@nnV@xUn¯U@JW@UX@xĉ@™`m@@LV@b"],encodeOffsets:[[113671,26989]]}},{type:"Feature",id:"4305",properties:{name:"邵阳市",cp:[110.9619,26.8121],childNum:10},geometry:{type:"Polygon",coordinates:["@@XIlJšI„VVK@n@VVVKnLVwVmnLVK@U„@šw„J@wVIƚ°X@ÜȄUÈxll@kn@VwVaXJWXn@@WVL@UUKVKV_U@@aVK„x@U„aV@lk„@XylbUaV_šVnal@W„U@a„I@aV@@aVUl@Xm‚UXWaXml@@kk@ma@V_UnUV™UUWJUa@kkaWLUmk@@LUVWUkJWkK@¼UnWJƒIkV@b@JUIm@Ul™V™m@Uw@a@kWƒXWKUknW@ƒWUU@k™mx™UkVmIUJUU™VmI@UkaUƒV™UmVk™wVaVmX_WW@ƒUw@™@kUKWVU_k@ƒmm@@VkX@lVLUJƒX°WVU@UIVWUaƒIUġmkVUkWUVWkwWXk`mI@¥kUVƒUƒUn±@m›XkWknV„UVmmU@@XƒVƒUk`@Xƒƒƒk@¥¯»mbĉó@mkU@kU™ƒƒ™KmX@˜UnmL@lULkKUƒWUU@ƒbUaUnƒ@Vb@l„¦Ub@l™@UKmnƒKUnl„UVVbUVn„@`Vn@xƒb@x@VL@nmJ@nU@mmUVkI@xVVVxkXVxmV@bƒbXVl@Xl‚XVxna@Vn@@VVL‚aXaV@n„‚@@V@X`V@@XVJ@XV@UºkXVb@xlVVKnbm„@VXLV@n‚lL@VxšJV„ULUb„`lb°nXalKnx@„lbšmn@lbULV„„V°š„ƒnV@zšš@Vl¼lb@VUV@bšmLV`„„@n„KlVnU‚XWVLnnlV@xVLU`VbV@"],encodeOffsets:[[113535,28322]]}},{type:"Feature",id:"4310",properties:{name:"郴州市",cp:[113.2361,25.8673],childNum:10},geometry:{type:"Polygon",coordinates:["@@²zVaVlnVl@nšVk„Jl_XJlIVmnL@mV@VXn@lV@‚XzV@lyV¯²U@UlJ@XVKnVVIXl@UVLV`@n@J„I@mlI„KVLnUlVUVVLXašKVLl@nb@ŽW„XV°KUnVV„L@xVJ„L@b@LUVVVU„˜VXbmbVbn@@lUbm@x@XVVVŽ@@˜@bkImx@Vm@Xbƒb@l°XU¤„a‚L„mnL@bl@@™VUX@VxnV˜anLnƒWƒ¥XKVwnUWXmVIUWÆLVx„L„w@wVmlU@¥XƒWUkwlÇn_Uw„WV@VU°wnU—ƒy@aVškVlnL@lVn„w@VlJ@b„X„x@bVKnb@U@WVUl@@Vnbl@XLlK@aVLVKnxÞn@a„LlmUaVU™ƒm@ÅknUmaUKmVk@m™kk@UlWUkVm@w@kUU@W™U¯™¥@w„Ç@aVIlUV@kUWU@UUm»@k@mKVkUKUwƒaUaUa›@k„kUWJkImaU@UK™@maUzk`@zƒy@XmJkL@UUJmUkV@z›@kŽkVmK@¦UbWL@a@UbmKmwUK™Xk›VUUkmVkw@UUKmL@WUIWa—JW_k@@WmI@mk@WkWULUUVKUUVm@šU„bš@‚nUǃ@U@w„™V@Ua@aƒL@ak„›l@k™UƒJƒwó@@L@V@„™`@œƒJ@xnn™šmV@bkJmUó@ƒn—JW„UUmƒU@UV@Lk„WlnnmVXbmxšxV@nbV„V@XVm@UVlXU`ƒUŽkn@lWLƒW—zm@UJVXU`@bVšUn@lWVœLlbVKVan_VxnVVVUXV¤ƒbnl@bUn@LWlU@@amU@V¯L„šVVUn@V@x„„@V@L@VmxUKUVm_ƒJUbVV"],encodeOffsets:[[114930,26747]]}},{type:"Feature",id:"4307",properties:{name:"常德市",cp:[111.4014,29.2676],childNum:8},geometry:{type:"Polygon",coordinates:["@@l™U™mkUwUyV™@VW@¯Va—VmUU@KVUVUVLnaWƒnkUÓV_@mVU@݄w@ƒka@kVmƒUmK@IkaUamKkXWaUW@WUk„™@@KVU@aU@™L@J@XÇVUKVak_mWkLWakVUbmLUUmlUVKUU@kUWW@UImJ@xkLkKm@@Xƒ@ó݃@UUk@UKƒV™ƒULƒKƒXkWWbkaƒIUƒWU@mUk@WLaUJġ™ƒ@@XÈÆVIl‚„Vnz°aV@U„m@X`@XWbkakJ@amLƒaU„@V@L°@@bn`š@@XWb@VœVlšUxmb@bUVmVUI™šXVWnƒJU„@nnlVLƒV@JbWzk`m@UVK²V‚x„k„LVl„@Vn@V„„°xVKVkœVVlUblx@bU„‚Æœ@@nVnUll„kx@VW@@VkLWxUL@bÝ@kKkVõV@bkXVVUVƒ@ƒVkUkV›LkV™a™@@™ƒ¯xUxmX@JVb°WXkK@Vm@k„Vb™bn¤‚xUXkJƒblxnXÆK²l‚_@Wnašn@ŽUL@b‚JnIlV„@lUœ@@¯ô@lWȂIVKVm„U@aXaV@lwVXn@@K@UVKUUnU‚bn@lWšX„ƒlJnUšLšKV@„„l@²a@UlK@aV@naVX„WV_nKlL@KUm@a°U°@VXL@a@wWmXal@„k„@VLn›V@@bl@VnX@mwVa²aVU@mk@"],encodeOffsets:[[114976,30201]]}},{type:"Feature",id:"4331",properties:{name:"湘西土家族苗族自治州",cp:[109.7864,28.6743],childNum:8},geometry:{type:"Polygon",coordinates:["@@@KšL@wnK±nƒnm‚—@WUk„ƒÜÈn@n»@mVamk„mšU„„l@V™nmmU@wUan¯VKšLn„VWlInyWUœI@WWk@KXU˜n@mnUmU@WœƒmkV@ƒkXašaVaUm‚Ikƒƒ@kaƒX@ƒUm@UKWU@UkJWkXa@IVy@UmIUVU@UJU@WXWmU@™VakaU@@Xm@Vm@wnwV@VL„yV@VakUUa@wUUVmlI@K„UVkUamJk@VU@UmVaƒan_@KmUƒ@@anm@ImWX_WWUk¯ƒ@k@Wƒ_m`@bULUKUnUWWXkKWaVmnU@@b¯UUbVŽ±K@UKUUVa¯UUmJUƒVIXmI@UU@WmVmkUV@b¯w@lmI@W@aƒ@m¯LXbmJVLklWL@V@XXŽmbVVU@@VU²Ul@VlX@bš`Xx›zUmkUVÒlŽ@bXLWxXVlš@V„bkLma@nmVmULVbmVUb@lnzmbUÒVl@°nLV„lJkn@bmJk_ƒVmmkblxÈx@LUb„xVb@V™n@JmLVŽUš@„nV@¦VbnJ@lVVbkx™bm@UxVLV@n`UnVVV„kl°z„xVb@VU@@ÆlXnWm¦nbVK@XVVUVVl@X„KUV@nVL@WnIWŽXLVKVLlxUbVKXVWbn@@UnKVLVb„JšU@aVU°b"],encodeOffsets:[[112354,30325]]}},{type:"Feature",id:"4304",properties:{name:"衡阳市",cp:[112.4121,26.7902],childNum:9},geometry:{type:"Polygon",coordinates:["@@lšV@XV@„mXVlXL„W‚X@l@bVxn@šŽšUVkn@VJ@I@alU„JXIVm@»‚LXllIXVVU@Kl@VnXKlb@lVbXIVVUšmVVU`@nbl@@lXLVVVKVbnXWJ@VXbWxXb„Ul™VK„¦nLVVUVVbšb„K@U˜LnK@Un@VxlUV`UnnL@VVL@JV@VUnxnKVbV@@VšIVUnJUVUl@nW„XllIUa„KVbÞLV¼²`V@VIUwlaVmXa@IWanK@U@m„kVƒVUVaX@lšnaVLÈ@‚¥@kkJUWJUaƒXkaUm‚wVXJ@_lWUU@¥n_‚KkamUK„™@amKƒnKƒbV£¯W@k„aWan@@UnwlJ@a@—@UUU@W‚wn@Va@km@UanaWa—UVƒUUVU@K@aƒKUI@wƒKUUVm¯LWUXƒ@mak@UK™LWbUKVUkUmVUKƒLkJ@nƒJ@I@mU_UK@VWkUJmUUL@WkI@V±VU°kzU@Wy@kUm@UWU@@nmKUnkJWIk`ƒIUlm™k@mUUkUb±yUX@VUV@bk@WlXL@nVlUl‚k@WI@ŽkLmš@VV@XVmnnVWbnVUblJXkVl‚XXlWXUJk@±™@nXVWVnL@xUVm@Vn@J—„WK@U™V™@UUVUVKUkkxULW`k¦m„@bkJm¦U@ƒmUX@`UImUU`ƒLVbUVUU@LUbmaU@mJU@U™UIƒKmxkLUl"],encodeOffsets:[[114222,27484]]}},{type:"Feature",id:"4306",properties:{name:"岳阳市",cp:[113.2361,29.1357],childNum:7},geometry:{type:"Polygon",coordinates:["@@@wUklmUUmU@@UVm@wUaV_mmUKmwkIkJmUUnm@™™@UUƒbUKUƒmÛamm¯xVLkbÇƃUƒVUzkVUlƒUUKWLX¦W@ƒVUUUaƒKUbmLKm„@akU@aƒmVaUUVIVWkk@wkƒƒ@@xmLlmÅwmbVlXlÝIWVkK@kkVƒL@VWKU@Ublnaƒƒm@b@bšnW`@XUJk@UUWKƒk@UKƒnn‚@xmLUVm@kbVbV„nV@V„b‚@KnV„LWšXŽÆVĢ¦VblŽš„n„UJWz@ƙVóUVbkV™aÅx@¦lVUbVVknWKƒ„k@ƒwƒK™VU„Å„ƒl@zkb@`m_mJ@xX„mbVbœ@llV@n„@llbXL˜UXalUšl„alVnwnLVKlšVbX@@I„V@blJ@bVL@VVVUXȤ‚VnkVÑXmlbnš‚„VKkÑř@UmaVç@±XUlI„xlV„@VaX¯lUVVUšVJn—V@°°nŽ°„Vxĸł°¦šb²¦lJ@U@aUK@kUm@_m±VIXal@„Kl@„bV@K„K@k„m@UmUUaƒK@_UJƒaXU˜@Xmš_VmUk@WUk›@kU@a@m@UƒaUUU@al@ny‚XXWWwkly@¯n@@bnV@k@mVI‚„œVlUUmlU„JUw„I‚bXƒVaUal@K„b@ƒVKVkXVl@VkUU@ylUœVVaVL"],encodeOffsets:[[116888,29526]]}},{type:"Feature",id:"4309",properties:{name:"益阳市",cp:[111.731,28.3832],childNum:5},geometry:{type:"Polygon",coordinates:["@@„ŽÆxXL@l‚V„@ĢšVI‚bXKl@nVV@„XVŽ„JlbXalX„W„LVKš„„UVLl@VV„@ôބ@@Wn@lLlK@wnIVJX@VX@lVVUL‚VnkVVnKValUXblKnXl`UbVLÈU@W@IšKV@@bUV@Lš@lƒXV‚@VXXblWnLVblb@JnL„VUn@llb@„ƒx@ÞUV@nU`VÔmlX„mbUKUVUV@LVVUn˜ŽUb@°UXš@U‚VzVxnlVškšVnlVnaWƒ@wnIn`@_la@y„kƃVƒšU„L„xl@„ƒXLlmUUVakU@¥ÆwšblUUaôVšU@ÅXyVImƒ™ƒkUaġ¥ÅUWX™ƒKmU@Lƒa@UmUUƒUalan@VUnK@wm„m‚L@V„lXLVVl@VI@WX_™m@a™¯mKUkwW¥UK@_UWWLUVkUWL@WUIkVƒU@JƒwkLUUmJVI@WkXm@VmkKUIU@mmm_@VUV™@™„kJċwUU@KUWkkW@IWW@km@klwkWVkkU™V¯m@kWLU`mIkmkXm@@`@L@xUKWkU@VL@JUU@mbUKVa¯WVnL@`lXUVkU@xW@UbUWVU@UJ@„lnU@m‚nÈmVƒa@bUL™wUb™@@VkxmUUƒ™UV›K@IƒUƒmk@akm@wmIƒŽkK@b™VWXkm@wULUmm@UVW@Ub„mbkKƒVn„U@Wl„xV„U@UXmWUXmlnbUl¯Lmn"],encodeOffsets:[[113378,28981]]}},{type:"Feature",id:"4301",properties:{name:"长沙市",cp:[113.0823,28.2568],childNum:5},geometry:{type:"Polygon",coordinates:["@@lVUllXkx@lln@‚XX@JlXXl‚V@LVVČxlIšƒš@VU@Un`nnV@VJlLUnn@lW@XUJnIVVlK„x@I„VlUVJ@XXKlVVUXKVX@`VLX¦lxVŽnLš°‚an@„„‚bkmVaV@XL@U„KlU@llLXUÞJWkUknaÆxnŽ‚knK@w„@l„@xllUXUJVVUb„n@blV@bnƒ‚LnKVa„LVbVV„UX@W¥XKVL„VVklUVy„U„VÈÅlaUK°wnnÜbn‚V„VL„aVVš@šn@VmnVlIlJna„@Valkn@na@amwm@„UXw˜K@aUUVUUaVa—wWK@kU@UaW@kKUUƒƒ@k™W¯XWan@k„™mmÅ@@I@U@KmLkaVUƒKkLWVUƒk@UVmU@am@kkk¥ƒUƒVUK™„maUb@ŽUb™I@aƒKkkWm@W¯K¯b@VmaULVxUXlVk@UxVJVbUb@xULƒ@ULWW—LƒĕmxVVL@šVb™KUwƒaŲWwX@@WƒUWLU@VbkV@aU@@VUnmJ@VUn@VƒLUK@U‚mUIk@UÇmU@@UW@J@LƒbUmVI@aUmW@@bkXUx@lmLUbm@UbkJ@V@XmlUbkKm@ma@kUaVU@aUK@mImJUIkVƒUƒVUakbWwka@UWKkLUamKUXm`Å_U˜ƒULmaU@@lUV@X"],encodeOffsets:[[114582,28694]]}},{type:"Feature",id:"4302",properties:{name:"株洲市",cp:[113.5327,27.0319],childNum:6},geometry:{type:"Polygon",coordinates:["@@X‚‚Unw„Ė˜KXXVK„@VK@wVaUaUIVwl@kUVWUwVKnb@U°a°LXŽ‚@Xnll„L@bšJVa@VanbšƒVL„U„V@al@@UV¯ÅÇ@Ummk™w@¯ƒyVwnUVVVUkmWV—nKVUƒa@WXkVKn@lUVU„VVVXIlV°VnI@VlKnV@mwVm@LXKWkU¥wWwƒƒ@k@m„X@KX¯V@VUVa@VnKWkœƒV@VUkm@aWa@wkUWwkmV£VÿXUVL@mVIXaò@nW@ašUš@@am™@aUU„UmXmWUk@ƒƒnUW@_maVm™wUkamaUL@aƒwƒW@akI@UƒxUm@kmKUk™lUŽ@b„zV˜m¯xUVU@ƒXVxm`kÈlxXVW„@¦kVUn@xƒxƒKUwÅKVXUJWnXŽmVUxWL„¦XŽm„mK—bmUUwW@UV@šk@ƒšVLnŽlbLm`@¦VVkX@`WIUŽxVnlb„WVbXIV‚lI@l¦Ç@UKmbk™W@UbUVU„ƒl@n@VmLXb@JWbUnkbVxUJUxWXXlWL@V@V@XXJWx„zUVVVVKnXW`@bkIUl‚„nLVJUbUIWVXlWV@XklVbnn@xlš"],encodeOffsets:[[115774,28587]]}},{type:"Feature",id:"4308",properties:{name:"张家界市",cp:[110.5115,29.328],childNum:3},geometry:{type:"Polygon",coordinates:["@@@InWVw°wš„@š@šblUœKlUlV„U„@VUUUlW@aöUlUlLÞ@@aVKXwlK@UX@@UlwkƒVkUm@m›@ÅVƒ@akwVaUk›UUlUL¯wƒƒ@UUmƒ@UkƒKƒlw±UULVn@l_XyWwÅ@VUUmJUXU@@mmƒU@kxW@UaUIWbU@@mU@UxƒnUbmKk„WJkUValƒ@aUkUxƒlW_@WUIU@ƒbkKWUJVnUb™bWb„lU@nl›„@XnVmV@n—mWV@LXl@X›JXVmzkJUXmƒ™KULm°Vb@xnVmnUšk@ƒƒ™VƒnnlUb@nm¼m@Ûǃ„Vl@X˜mnm„²ŽmL@x™K@LUl@nULÆx@V@VXVWbXX˜l„@nLlm@bVKœX‚W„L°bnUš@VaVUš@šmšVw„JnwVK°zn@V‚Vb„a„@Ċ¼"],encodeOffsets:[[113288,30471]]}},{type:"Feature",id:"4313",properties:{name:"娄底市",cp:[111.6431,27.7185],childNum:5},geometry:{type:"Polygon",coordinates:["@@lL„nJ@xln@bnlV„‚„@JœLVUšŽV„nVlw@Uš@VašxVK@a„bnUmÇnV@km@ƒ‚I@VUVVXVaX@@wlVVUkW@_mKXU°‚UbVLnaV@‚V@IUKV@XlVL@w@K@_n@lWlnnJV_XK@l°nšU@WVU@kV@nbVK„V—lƒ@nLlƒ„LXU@ƒlmkw@nW@UKVa¯IVn@@aVUUKl@nXVKVn²a˜ŽXblKnLlmVI@KUU@akLUaVa‚UXm@aƒ@wVUVKnLnWlXl‚n@@U@anUVm@U‚Inm@IUK@UmKVmU_kVUwm@@VmL—K@VƒL™aUaVUUUmKƒ¥ULkšƒVWaXwWa@UXImWUaULUUWKk@WnXbWŽVWnk@UV@bU@@bƒJ@bƒV@XkŽmb™UU`VbkaWzƒ@klU@ƒb@VƒwUL@bV@U`ULVL@VUK@Xm@XWWIUbUxm@@lkkÇwƒVÛÇW@¯Å™UJ@xƒI™xƒ@@VULmKUnUxmKULUUm@@‚ULƒU™JkIWJ@b@LJUW„kJWnUV@nn˜Ü_nJšxU@VbšnUxlškb@lš@"],encodeOffsets:[[113682,28699]]}},{type:"Feature",id:"4303",properties:{name:"湘潭市",cp:[112.5439,27.7075],childNum:4},geometry:{type:"Polygon",coordinates:["@@Æ`n_VWnLVblKXL@VlbXxlaVb„U„VlUVJnInJ‚@VL@bUVVb@lnbn@lLVank@W@UlIVan@VanK@kVwlW@aX@Vn@bUJVn„a@K‚IX@@VV@nŽVÈl@VJn@VVL„K@UVm@UnIVm@UV@@blUUaV@XK„V@XW@XxƱ„bVxšLUa@™UKWk™@wmmUalk@WXUWkXUVJVaUImKƒVklJ@aX_mWULUUVUƒyXwWI@W@U@UXKWkXWVwU@±_U»ÝKUaƒLVbkJkƒWmXk@UVVŽmIUV™J@UU@UamLmwUVU@mnJ@VUnmV@b@Vm@kkWmXmKULUV@x„Ž@bWnVUbVblK@bVV@LUJknmKkLWa—±bUmULmWk@VLUV@bm@U°JUbVLX@@mlxkn@„WVƒKk„mK@k„"],encodeOffsets:[[114683,28576]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/jiang_su_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3209",properties:{name:"盐城市",cp:[120.2234,33.5577],childNum:8},geometry:{type:"Polygon",coordinates:["@@„n@‚°ĀÞ°@¦ULWKkx@bkLWb@lUlVXXJVbƒnUKmxXV@bm@@Xš‚„LޚܦXlVnš‚mzVJ@n@‚²ÞôkƃÞaȰĉ‚wnljÜó„éVÛnĊīČlj‚ĉ@ō@KÞUlU@ƒkklÇÈњÑlġXɛ@UġƒƒaU@U_ƒW@n™@kaUL@VW@kKmkUV@bkbWW@bkzma@ƒJWI@KUKULƒ@U¦™`@XUJ™U@KmXƒw¯KXkmy@aUIWJXXmV@K¯UU@@bVL@¤VLXbV@@JVXVK@„„JVn@bkKmakVVXUVVVlI@`U@nzVVƒb@¤n@@UlKXLVVšI@V@nV@V‚@ÈUx@šóVōšƒkÅWó@mU@bk@Ýwk@WbXxm@@J@zV@kVƒbV‚nLWVUX™WUXUŽWLUŽ@Wl°z@VkxU@UVWIxWJkbƒĬ„nW@@bUl"],encodeOffsets:[[122344,34504]]}},{type:"Feature",id:"3203",properties:{name:"徐州市",cp:[117.5208,34.3268],childNum:7},geometry:{type:"Polygon",coordinates:["@@XKVX@WnIVx@K°Lnll@@I°K„nVašU°x²mlxš@VanU@aƒk@akmV@@w™@Ua@aUwVwUw@w›@UK@£kaĉlóIÇVkŽ±@@kUKmVkIkxW@Ua¯UUm@UVI@WVI„JV@ƒ@Um@Uana„U@m‚I@J@XV@XaVlkXƒVaUUWLUyVIXmWak@ƒXkJókƒJUL@KWkk@ULU@Wa™lUIkJmI™mk„VbVš@lV°kXUKWKULU„mb@VUlVnƒb@VV@IVKUUmU@ak@@bmV@xklƒUƒU@UKmV@nƒJVbkXƒKUamLUJ¯UUVmI™bVV—Ll`@LƒLU`m@kXUVU@V„lxUK@xkIWbUKƒx@V‚kVVn™b¯@@U™@ƒxk‚mbkLÇK™b™@@XnJ@LmVklƒ@@XƒlUƒVkxƒakVVb@bVnUbU@@x˜VUšVb@š„ŽnIĊ`šXVVôJš_„K@xlU²Klk„U„@VaVVÈm@kVUVmnamUUaVƒXIVJ„@‚ç@¥nkVLn›„@@XVK@VUX@JVUV@UnVJVLUJVLUVlšnI„b‚KnU@m°™VanI@anV‚KVL„an„lK„blš„KÞk@¦@¤@„VKnLVK„L„KVzlWšLX@VmV@VbnU°@Ualk™˜WXLVU„KWkUUWšƒ@£Wa"],encodeOffsets:[[121005,35213]]}},{type:"Feature",id:"3206",properties:{name:"南通市",cp:[121.1023,32.1625],childNum:7},geometry:{type:"Polygon",coordinates:["@@VJ@bnzWl°L„xnW@LšVVI@Wš_V¥„@VKVL@LXJ„I‚@nbly@aXXla@aVUnllLX@@UVKlbš@@m„XV`V@„bĢ„lkČÇƃȘ¯šwnĕVĉVÿšUƒUĠƒŦğlXÑVǵ@±ōLʵĖ¯lÇbÝÞ¯xk@Çkķé™n¯@ğŽġƴǫ@kVVlUbƒL@xULǂóLUl¤@nkVV°VLkxVb@l™aUXUKWĖklVX@¤UšƒUkb"],encodeOffsets:[[123087,33385]]}},{type:"Feature",id:"3208",properties:{name:"淮安市",cp:[118.927,33.4039],childNum:5},geometry:{type:"Polygon",coordinates:["@@šnźUôÒɴ胚l¦nĖV‚kbmš„X@xVlVL@xUb@bUJVnUx‚šœ„lKVLÈx‚m„zXV@lW@XV‚b@bȚVxnb‚ƒVIXa°L„aÆVVaXUlK@aXIƄVlXKVUlIXalK@alwXLVK@¥Ý¯¯ÿ@ƒmVk@aX@ƒm„īlaXI‚wXJVUV@lw@U¯yb›UaƒUġUÅaUKVknaġm@kUm@wÆIV±nLÆw„ÇnUUkƒ@ƅÝU¯JÝI¯¦Ul@bƒ@@VVL@l@LƒLÅmƒL@b™@UaVaUWmLUKV¹KƒLWKX¥WI@mXk@UmaUVUU@VmL@W™bkIUWƒUmVóIkbmm™@UbVLUxmJkU@bkJWbnXU`Wz™KUÞÈlVb™Lmx@„kè@Æ"],encodeOffsets:[[121062,33975]]}},{type:"Feature",id:"3205",properties:{name:"苏州市",cp:[120.6519,31.3989],childNum:6},geometry:{type:"Polygon",coordinates:["@@ôèĊVnX°¤²„lxƒÈÜ@²x@J@b@X‚`nIUƙUUV@bl@VVnL@L@xƒJ@X@blJXnW@@`XbW„kVƒ@UbVxƒXUxkV@LóxVbUVWš²šVJĸklUǬ@ĢƳĠ°@šmƒī°»ÈÇ¥ULUU±a@bU@¯ƒU@KnImUVWUk™mXUVU@lIVaUUVWKUbUkWKU¥n£WakJUkUL›K¯L™KkƒVIn@VaUƒVUUƒ›UkVk@ƒU@amUkJƒ@UUlwX¥W@@UkVmk@JUakL›@kk¯ÝmJUn@nmVXlmbVVkn@„UJ@±WUxV¯a¯KōbżÇxUxƒšUUlWL"],encodeOffsets:[[122794,31917]]}},{type:"Feature",id:"3213",properties:{name:"宿迁市",cp:[118.5535,33.7775],childNum:4},geometry:{type:"Polygon",coordinates:["@@XbWnUJVzXKVVUbW„klUWbU@@W@IJ@nƒVmbVbn@@V@„UŽƒIUJ@XUJ@VVn°VVbX@lwlJnUVL@l²@lÈUôJĊklb@¤VLœ@@xVxUxVx@bVbš@@xU@ln„mnX˜mXLVmV@X@lxVnVJôL„LXa‚x@b„@@KVL@bn@@m@™@alLUUVaU¥nIV±‚I@mXI@aWWXU@LlUXWW_XWmaUwǙ@aaWUX@@kWUƒynÇwUKkL›ƒ™VwUmVI@aVa@wUKUk@wƒWn™laUmĕk¥„™ɳçóÑŹV™mmzkVmm@a@Ióƒk@@LWU@`—„WbXLWlkImJVn@`nXVbXŽmL@Vn@‚l@nUVl°Xx°U@LVĠ@z°˜@¦UV@Xn@VJmV"],encodeOffsets:[[121005,34560]]}},{type:"Feature",id:"3207",properties:{name:"连云港市",cp:[119.1248,34.552],childNum:5},geometry:{type:"Polygon",coordinates:["@@@‚lzXxmÆV„„@@¦„@l`XnlKšXXm‚KnLla„b„@„xmbm@kL@V@Vl@@VUXšJX„mbš@@„°Æ@èÈzlW°XĢJlÈ`lInbšWV_@mš™@UUķnƒôw°ÆmnaVƒVÛVmĸ»Ģw±Ý@@mUIny™UmWkۥݙƒK™@Wn@@aWUnwVL„mUaWIUWVk@kkJUVWLUkŃWJ@bkLWVUbÅUƒb¯KWbUJ„WXX`WXkV@KWVXX@bWJ@nJU²mJV¦UbVVkK@b@š@nm@@aUK@Lƒ@@awWbƒKóKUIUmkwW@U@UnWK—nmWƒn@b„l@bmVUb™@kw±n¯w™VUb"],encodeOffsets:[[121253,35264]]}},{type:"Feature",id:"3210",properties:{name:"扬州市",cp:[119.4653,32.8162],childNum:5},geometry:{type:"Polygon",coordinates:["@@VUXblVVV„b@xV@kz„V@l‚wVLUbVV@VU@VbUbl‚b@nkĶ°IÞV@Ɔ„VlmVƒÈÅxmKU²ÅJ@xVn@lĢnmbUlVLÆbĢV„V‚bœV‚aXk‚@VXKVVWšXVWXUmKU„aWaU@™¥@£XW‚UUV@@ynam_VWkUVUna@ÆV@mnkWmXkWU„W@k„@@akklƒlWUI@UnKl¥™I@VVma@a@I@U@a@anK@UmK@ÅVUnJl™kI@aVwka@mVIUW@UWL@WÅbmIƒƒULka™UWƒUxkLUKWlXL@VƒImƒÅVƒU™mĉL™Uól¯I±l@ÒUbVbUVVXUJUnVV@lnbl@"],encodeOffsets:[[121928,33244]]}},{type:"Feature",id:"3201",properties:{name:"南京市",cp:[118.8062,31.9208],childNum:3},geometry:{type:"Polygon",coordinates:["@@k@ma@kUUVmVIUWVUUaVa@Ѳk°Jôk@Wmk¯KmX¯aUakKƒƒWU„@XU‚LXaV@@mUaVUUl@VmkaUXm@ƒWUUna°IlmV™m™IUW‚@Uk@@aV@VVX@„V‚I°»nm„U@VKVan@m»UaU@U_@WlIUa™aVaUala@¯n@‚ƒkaUkUUWKU@mwkUUmmL@K@ƒLmUUVƒKƒVÅImU—JƒƒVkVVLšèVLVU@W„L„V„š@nVÜULVŽUL@bW@XbWbkJƒUUVUxVXmVk@WUUkVmIƒV@„nbnVWbƒJU„kUULƒa@Jma@XkK@VVL@L@JƒLUVU@V¼ƒnXlƒbm@kbUKmn@lVb@VXXV‚UV@b@LVbÆxXbl@@lV@U„VV@XVK²VlIš`„UbVbUlVVn@WXn@@VUV@„@KmbVLXқLkKƒV@nX@VVUV@b™nVllbšmnb„IWVXU@`lLlknVnmlLlbUmVInK°nUƒU@l@VU@Vn@„ƒ@alI„`VIXaVaVa"],encodeOffsets:[[121928,33244]]}},{type:"Feature",id:"3212",properties:{name:"泰州市",cp:[120.0586,32.5525],childNum:5},geometry:{type:"Polygon",coordinates:["@@lUU@@y@In@WwXal@Þxl@@anVô@ÆX„lŎ™ôU@™Vw@ÇUU@@m@U™JUUWKkL@Vm@@£„aUUmyV@@_kJUUVUUWlUnblL@aUmƒI@ƒULUW@IU@WaUK@£UK@aV@°V@LnUWWXIla„VV™@£UWlkXĕVLVWšb@kUalwUKU¯lU@mk£VôKȁVK@w„KVaUkķlUI±™ğ¥ÝUŹš™Ž¯ôm¦ƒĸ™‚@XXK@VVXUJ@nlbUx@blJkšmIUV@ÆnL@VmL@b@b@V@J@bnb‚U@UšJk¦mL@VVJkXk„ll@bƒ@@lƒXXVWlXnml@nÅU@ŽmbUVlVUXn`mb@zU@V‚VWX@¤š¦V@Xb"],encodeOffsets:[[122592,34015]]}},{type:"Feature",id:"3202",properties:{name:"无锡市",cp:[120.3442,31.5527],childNum:3},geometry:{type:"Polygon",coordinates:["@@nLƒÒlxUVkL™am@™ƒkVWUULUxVVVbUV@bVLU‚nnź™ÞVĠ¦X™VUUaôw@KlUVw„WUwVa„@lUXƒWa@_X@WmkI@a@W„I@w@KmKUUk@@aVUšVVÅmJ_@W@a@I±wÛ@ƑÇkw±ƒ¯£mWĉUóçƒK¯VkUWK@XkV¯UWabƒmUa™UUb™lln@b@xƒbXŽWX`@„VxUblL@bn@Vb@`m@XbWnn@l¤„n@xnVlU„™VLÆWœkV@VbÞJ‚_nƒl@nKVU@aU™U@mVk°WVLUV¯bVXŽ˜bXlVn@VmL@x—V@bl„š‚@œnW@X@VVJ@²VJVU"],encodeOffsets:[[123064,32513]]}},{type:"Feature",id:"3204",properties:{name:"常州市",cp:[119.4543,31.5582],childNum:3},geometry:{type:"Polygon",coordinates:["@@„L˜ŽnxUbVVƒL@xnnW‚nn@VVXn@‚yœImx„„°ƒšL„a‚¥n@VkšKVw„W@nX„VJ@b‚@UVn„ƒ@UnUV@L‚b@`VLklVÞn„Æ@VaXLl™ÈJšmmVUK@aVUUaUUVwVKXVlUš„n@šblKVUkw„ÑmKUVUI@±UI@U@WmX@›™kƒ@a˜U@wnK@UUmWk—aWU°aVUUK¯XUl@nVŽVš@bUVmLk@m„`ÝIUaU@›lÅXUKƒškVmU@wƒmk£m@XmWan@@_Uam@@akKVaUw@ƒW_XW„a@w@akmm@mL@UJmnUKƒ@@XnJWLkKUb@„Vxk„WƒL—aWVUImVULUK@L@lkLVVVllb„m@@°kbVbUbšbVbkJ@XV`V@Vbn¼"],encodeOffsets:[[122097,32389]]}},{type:"Feature",id:"3211",properties:{name:"镇江市",cp:[119.4763,31.9702],childNum:4},geometry:{type:"Polygon",coordinates:["@@šVĊKšn„VÆUn„„J@UWKXkVLlKVwX„šVlbVK„„nJÆaš„ķn¥°óÇIkšWKUbÅ@mƒUÝlkUK@_a@KVUVm„@mƒVU@@aUIWƒ@mƒXUx™LUlm@¦ƒb™K¯„ƒƒnw›Jzm@UW@UmmXmm@w„KUUVamw—ƒKm@UbUL@ŽƒVmn¯¼JƒUW@UUU@@bl@@VŽVXšJšnnU‚‚k¯JmbVV„Xn@VWlbUnk@VVUŽVb@nU@WbKWVƒ@XV„„lLVb°bnW°Lnl@X"],encodeOffsets:[[122097,32997]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/jiang_xi_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3607",properties:{name:"赣州市",cp:[115.2795,25.8124],childNum:18},geometry:{type:"Polygon",coordinates:["@@„`l@Èbln„@„KVLl@„V@bȎlnšKXkVlVL@„lJnb„¦VKVVnX„W@w°@VU„mln„UV`šU„bVUV@„xnKVI°KXKVkVL@al@Xa„LVlULWV™VVL@b„x@VXVmb@x@V™VV@nn¤„šlb°b°KXXWbX`lbXx‚z@x„`VIVUnK„L‚x„WXLVKVbVLVU@wnW°b„@nalX„‚mXVJn@U²mKkVl„U@@xlnœaVmlKnœ@JVLlŽnVššl@XXÆèVlUX@xVLXVšb°W@wnUWmXk@K‚LVwUmUkUKUw@wVaVK@kƒ@WnkUKWkwlmXL@KVUlLVKXmWU„L@ašL@malaVk@aa‚ašƒnXš@VVUblb„Jn˜ƒXa„V‚wn£„K@UWmUk@ƒUaWIV@b™JW@KmmU@aUUUkmKkVKlUU™nKVU„lVaV£Å¥WUUK@UkUUw@m@mIkƒƒUUWƒLƒK¯Uw°¯@wUKUbƒKmƒ@kkKUL@UUKV¥U@manw@k@U@Wm@@U@Wwkm„wWaUU@UUmV¯kwƒ@@kmƒkKkUW@UK@ÅV@XWWkXa@Ul@Va@KVaUUU@ƒaXwla@UkVWaXk@K@lmkUmV@Vmbk@ƒ»XIƒ¥VUkƒVUVU@anKVUƒKUalU@wX@˜™@a@K—@ÝwƒL@ŽUnÇlUIkJmn@ŽƒbVVb@VmnkLƒV¯U@ƒ±l—IWmƒ@kaUI@aÇU@K@KUIkbWbƒJUIUyƒX¯ƒUbU@méUUmUk„WK—xWIkJm@V¥U_UJUwmVkšƒUU@ƒƒƒ@knƒwm@UmkWJkL@n@VW@@‚U@knm@kUml@xÅxƒ@@XUJlb„@VX„JVxn@lbV„@lULnV@VlnV@bWV@bXL@lVLVb„V@blLn@Vl„K@xln@bX@lašLVbnKUVVb„KlXVVkxƒV@nnVUb‚lV@@z—°WWkbƒIk‚WL@LUJ@bUI@b™`@UmI@mkK¯XW™™mUV¯@UUVUUam@@VULWUJƒIm`IUJ›KUkW@Uxn‚WbnnmlXbmIUVmV@Vnb@V™LUKWLnÒVVV@V„UL@„kJUV@bƒÈ@ŽšV°šŽ@XVV@l@xUz"],encodeOffsets:[[116753,26596]]}},{type:"Feature",id:"3608",properties:{name:"吉安市",cp:[114.884,26.9659],childNum:12},geometry:{type:"Polygon",coordinates:["@@lxnb@V@bV@ln@‚n„‚lInš@blVXK‚nk¼@VUKWL@b™L@`UXU`ƒ@V¦XLĠ@lJ„¦@„nV@l°nn@‚mVXnaš@nb‚K„n@l„IVƒš@VanJ@_lKVVnš„L@L‚K@Vn@VbšUVanKlLnbnJVbšnWVnVVanI@‚Vb@L„bVKVanXVbVJVU@aXLll„bôlƼXxVLVK@Xn@ƒxnVVVmb@LnVVKVXV@@mnaVXUVnV˜K@_UaUmšwnKV_‚anKVLš»„K@¯ÝU@›™U@kWlUn™lknK‚VnaUkma@ƒUIUwl»Åw@ƒVwV@n™‚n@ÈXlKVmna@kVw@anm‚@n_WWk@™™mUkUK@Im›kLUn›bkm@wV@kƒlUnLV±m@UInWƒkWmbƒ@¯amX@xUVUKUaULWKƒXwƒKmLUVUJƒ_@wyWwkaW_XaWW¯L¯akaƒ™m£@mUUš@U@wnaWU@Uƒw@aUKšUXUVKUkƒKWbk@@bUKUlWL¯LUJmLƒwU@UVƒa™VU_ƒVkmƒnUV¯@@xƒXmWUUULƒ¥makI@ƒUKUkWl™LkmǍ@aƒUk@UKƒLƒ@kmÇak@ƒ_VlkL@`lbnšlLVanLnbmVÆln@škJlbknmKUbÝmmwULUK@bkLWKULUUma@Kk@UV@L@llbVzšxUxnl@bVLmŽšŽ@IVJXœVlƒLV`@bn²@J™@™V@Xmbñ@WbUJ@bm@@LUĬU‚„¦lV@xXb@blnUV"],encodeOffsets:[[116652,27608]]}},{type:"Feature",id:"3611",properties:{name:"上饶市",cp:[117.8613,28.7292],childNum:12},geometry:{type:"Polygon",coordinates:["@@„„@„V‚š„„I°`nm¤²@bVJUVVXUl@Vmb@xV@XbmVVœ@lkLmbn`VbnU‚@Va„UnbVllUXV„a@w°VW@_VWšLššnVlbšLVbnl„KšnVK@IUW@_@am@™‚ÑUólK@U@WU@VwU@UI@aUU‚aXƒƒ@kwmJV@yX@k‚anƒƒ@mkwVmmI@aUU@aUUW@kVkV@@anKš»„XVWnIVUl`@_„W@wlUœV@UWKnU‚bnŽ°InJl„UV@VnI‚b„Wn@VklL@l@Vn²m@U`kI@bWJƒnV@°VXnJm„XVmx@VVL@bkLmWULUmU@ƒbWXb@llnX@‚xkxVV„nVV@¤nL‚nVxnJVXX@˜ššbn`VI„b„@„blmlLnaV@„blWXnlUnbl@„ƒšKVanUVmm_XK@kWWnašU@UnaWUXa›ƒXamUkKmXUWƒLX¯WakKm™nUWwXa@KW_„aXWW_@WnIVl@XU‚LnWVknK@ImyUUÆbXK„Û@W@IÆUnƒVÝlkVK@mUIVwkUVaUm@aVIVyXIƒaÈwmmk@UnanVUmÅaó»lwšW@kkUVmUK@WKLƒUmWULkamK™Lk@Wa@wk@UU@U@mbUIWVKUXWmkUmVm›U@LkakKƒw@w@U™¯ƒ‚ƒUUn¯l@bmn@xkJWxkL@VkI@mƒkmJUI@V@b@VVxnbWlkÈkVƒLƒbkKmVƒL@V@²nxW‚kLUL@xlKVx„bXmVnšWJ@ޙ°@n™xUKUw±`UImVmnU@kalm@akwƒU@UUJmxU@@Uƒ@kU@Um@@Kn™ƒVm@k™KmkU@@WUnkLWxkVUwmKmLkU™bmKUbVŽ@xUnkJ@n±ŽšUxVXUšWJ@LUb™lUnm@ƒW@nknUJUVm@kXllknVbÆK„VVbš¼V„@šUl"],encodeOffsets:[[119194,29751]]}},{type:"Feature",id:"3604",properties:{name:"九江市",cp:[115.4224,29.3774],childNum:12},geometry:{type:"Polygon",coordinates:["@@WUkVUkmaƒVUb@mVUam_nalK@kU›nUWaU@@wna@UVkUWVUUI@a‚±n£m¯_ƒJ™ƒU@ƒƒƒĉ¦Ul@UV™Km™mLlm@ğ¹m`Uk¯@@UVK¯™@UUK@amkmKkVVUa@UkUƒKƒŽUa™L@VVXUJ™@ƒnƒ@™š™WUbƒnVb¯V@LÅlÝIƒJÅkݙm@Ua™WUU@UmUXmmwVUUKWUX±mUam@kWƒzUaVmÇw@aÅLmKXƒ‚UWKkL@W¯IƒwVw™lkUƒJ@Um@ÛÈWŽKUxWkƒaUU@KkLVl@„UKUX±KUb@nVVUbUVmaUlUL@„ƒaUL@‚@nUlWzX`@„V@lx²„@Vlb@bšVÞ@°nl@UxVL@lUbVV@n²xVUVmnUÞb‚a„J@IšV°xnbl@nbÆ@VwnK@VnXlK°xnUlVX„V@Vl@L@lk@W_XK@KƒkWxUL@J„nVx@aX@VVUa˜IXlmL@bVVX@VbnK‚a²XVWƒk°a„@UnV¤nbmLmW@XbmJUbVL„aÞK„L@K@U@aVKlbV@nXlJœxV@VnšŽVȚ„ÞKôbźĕČmV@ĊšŽ²xÆIšV@Þ¦ĸ¼ÞVlŽVÞnxln°Jœk‚LXWVUVUVwnJVI@yn@lXlaXmWI@w—»ma@UmK@akKkXmW@_kaWakKWk@@K@IšWƒkUa„ƒ"],encodeOffsets:[[119487,30319]]}},{type:"Feature",id:"3610",properties:{name:"抚州市",cp:[116.4441,27.4933],childNum:11},geometry:{type:"Polygon",coordinates:["@@°V°UnÜ@n@lnLlV@bšV°L„lnLllVzVVXlV„V@@L@xX@WlX„m@UVƒL@V@n„°škVmVUnKlaXxVbšnlU@lVVnaVI@aX@V„šJš@V„@b„b@šVbš‚@X@lUL@Ž@VlIVm@wUVanLšalVnKnLVxlUXwlKVm@k@Una@mWIXKWUÛVƒk@a@UVWn@@kl@@W„XlW@_Um@UVK@a„LnalInWV@@xnI@¥‚K„—šm@kKmƒnk@mlI„¤laXbVblknV@U‚KXVlUXa‚@@Unw@±mU@ak_±a@ƒUJUIƒVKW_Xa@aWU™šK@mmUVa@IXa@UWmšannlmX¯WKXwVUVwƒ@XUlK@klJXa@kƒkmm@Uwƒw@¯ƒW¯kw@WmbULƒaUUU@mVUU™WmkUb™KmkkK@aƒkUƒ¯¥Uƒl—ƒm@akU@mš@KVIVV@KUkUVUkaƒUWb—„mƒIkaVaUU™@mW™„b‚b@bUlkb‚b@n™K@bƒKXVWnULkKUV@LWKknlxXŽVLml@X„Ž@lULUb@xVxVLVlVnUxK@LWlXnmV@x¯X™aWUUK@wVWUkÅçm`@mn@bUx@lmbUnkLÇWm@mšU@Ux@„Æxk¼VxVJ@„nbVlmbUmLklmškVlX@‚VœšV@°Þ"],encodeOffsets:[[118508,28396]]}},{type:"Feature",id:"3609",properties:{name:"宜春市",cp:[115.0159,28.3228],childNum:10},geometry:{type:"Polygon",coordinates:["@@@VlbnK@b@JšLlUnx±ĀXxÆW„X@lš@V„@@blJ@nX@˜xUbVVUbVV@b—VmnmJœ„@bmbm@klUbƒLmbœš@lVb@xUX@bVVVbV¤@LVV„bXlVw‚LXÜÇn@@V„IlVškUx„x°J@XlKXLV„‚WnLÆK@bÈxUnVb„ylXn@Vbn‚W²XV‚LVVUŽnxWnnV@VVVšXVbn@ޚÆl„IÞJÆk@K°UUa„mVa@UUUš»@wV@VƒkkUKUVW£U@UmW@@aXkVUnVlKVV„UUkVmU™@kWaUanU„VVamIX¥W@@aUaUVW@_mW@UnIVVn@VbVm@bVL@anKVUkƒWK„UXV‚Ikx‚@na„bVK„b@nVJ„_V›@Vw„‚VUVVXUlUUaV@X@VblašbnKlkVaXaƒ¯@m@U„KVUn@WƒXkW@@w@KU@UƒWkUUUykkmKƒk¯K™U@akUmK@k@mmÛ¯V¯U@‚ƒL™¼UKmLbU`mL™xVnVb@`—LmUVUUWmb@nU@UWULmU@KnaUUmU„wmJ¯IUJWIkVkaWVUIUlWaUIUVkKmbUIƒÒlVUnnŽ@VlLUJ@bUX¯@ƒaWVUKUXƒKUbm@UwKWa@a@VkUWn™@Uak@mbX„WJXbm@mL—aWVk@™wƒL@WmanU@knwWmkaWL—KWUXaƒU@¥l„UVVVbnwƒ¥nKV™»@aUk@a@UƒJ@kƒmLma™@mbUWnm@ULǺ@LXnmxUŽm@UbkbW@@akLmWk@UXmJmUkV@VUXVlULmKUxkL@lmXnJ@X‚l°Vnb@bU@WbKUX@VmKUX"],encodeOffsets:[[116652,28666]]}},{type:"Feature",id:"3601",properties:{name:"南昌市",cp:[116.0046,28.6633],childNum:6},geometry:{type:"Polygon",coordinates:["@@šXš™„@„mš@VIUW@UšKVb„„LlV@VVbUŽlUnLnl@bVL@V°šUL@V°@Vln_Ġºn@‚knKnššLVU@VkĊ¥Vk@™Uƒ™»UaƒUÅLUalmkklWn@VUVIlm@m„Xn@VmškVa@KXIV™UWVw‚™²@m@U@VK@k@W™Ua@™ƒa@aUƒ™@™IUƒW@@bUJmbUU@kkV™mUaWwkbmLUVUn™lWbUbklmL™akbUaW@U@VbkVWVUUUVƒUx@‚Uœƒ`UI@mƒaULƒamb@lwJWUƒVXLl„UVmL@bUK@aUnUam@UUmJ@VnX@`UXVŽVb@bX@W¦nJUbƒUmVVbXb@lVšUnVlƒVUUkLmUUVWl@bX@VnV@X¤VUVLllU„U@@x™¼VV@V"],encodeOffsets:[[118249,29700]]}},{type:"Feature",id:"3602",properties:{name:"景德镇市",cp:[117.334,29.3225],childNum:3},geometry:{type:"Polygon",coordinates:["@@VVX@Vbmz„xUlU@mbmL@V²xVbUVVblbX@šVškVykValKVI@bn@n`lVWnX@l„L@™WKnƒVIVa@¯nK@alIXJVIVWUw‚ƒn@nU˜„nK@alI@a@anKm_™a—™W@UWmIUwmmK@£UUƒmUUlwwW@km@kWaX„aV@VnVKnXlK@aUK@UnwWUnƒmIUW@¯mU„XI@alJV_n@m±@U@kkKUlm@ƒXamJ@UVUkƒmI¯JmamVXL@V›UkV@xƒX@`k_UVmJUXƒW™¼mL@bU@UllX@VV@bVV@bnJUnlx@n„Žm„b@lWŽ@zU‚nIlx„@W„bVV@bVJV@UxV@@X@VkLVôÒ‚šn@@b@`VX@J"],encodeOffsets:[[119903,30409]]}},{type:"Feature",id:"3603",properties:{name:"萍乡市",cp:[113.9282,27.4823],childNum:4},geometry:{type:"Polygon",coordinates:["@@VWnL@UVW‚LXaV@@ama¯Uk@WmInW@klKVwnLVKUkVW@UlUnVnIVWl@nXlK@bX@laVan@VnwWm@KȹVK¯m@kmU@ƒƒ¥kIğ@WKU¥„@V_VW@_šK@aXKVL@Ul»mWLkU@am™kJƒm@kmU@@a@UmakwU@›„Xlƒ@VXk`UIW¼kWWX@‚œ@l‚xV¦XlW@Ubn„@ŽmUkL@UmJ¯UkUWVUaƒUlm@UXWl„nUJ@LmLU˜nXll@bUVUUmVUn„Ž@¦šxlŽnn@VÆÈU°kbV„VxllnL@VnVVUl@V„„anL"],encodeOffsets:[[116652,28666]]}},{type:"Feature",id:"3606",properties:{name:"鹰潭市",cp:[117.0813,28.2349],childNum:3},geometry:{type:"Polygon",coordinates:["@@@XV@nlšL@lUnš„mŽ@Ln@@VlV„@@VV@nwVI@V„Vlx@bknlbV@nmnUVJ‚_²‚VxVLšw@mš¯@ÝXIm™nUWƒaUwkL@wVKlKXmw@±@U„KnUlL„a„KlUlÇXkmaUw@U@a@Uƒ™UkwUJ@zWJ™w@WbkVWUL@VmUklUaWakbƒ£kJ@nmln„lL@Ž™nƒ˜L@¦mJ@wU@mXkJmbƒK@bUL@VVn@`kXƒW@Xk@@lm@UX@V@b„lÜUXVWLXJ@nmb@V@l"],encodeOffsets:[[119599,29025]]}},{type:"Feature",id:"3605",properties:{name:"新余市",cp:[114.95,27.8174],childNum:2},geometry:{type:"Polygon",coordinates:["@@m@@WULUKWwÅ»ókƒakkWK@bUVUIUamWUbULƒa@KUa@mJUbmUXU™mUamImakKmLUb™VUam@@UL@KƒKm™UUkL@`mIUb™@U„@V@bVl@bš¼UŽmL„¦mxUaUUƒVkŽ@¦„VWbXV˜LXKlbXnmx@lmVnb@X„Kšxl@XU˜bnKn@WaXIWƒnal@Vbš@XmlV@U@bXb‚LVxn@Va„LVWVLXU„b°@VW@aVIkK@UmVmkU„ÑVJnalLVUVJXbVkVJXUlblUXJVI°JnI"],encodeOffsets:[[118182,28542]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/ji_lin_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"2224",properties:{name:"延边朝鲜族自治州",cp:[129.397,43.2587],childNum:8},geometry:{type:"Polygon",coordinates:["@@Wxĵ„mš@„ó¤VX@@xܼƨš²xWxƒV„V@„XVƒ„„„ƒbWšXllaÞU°Ċ„@ô¼„LôÝWanV¥ƒÑnĉ°¥šÅX¥°¯@w°w@»°k£°mÈŹ‚mÈbƃŎ¦„K°z@Žkxl¦UbU¤šššklV„KŤÞȰ@@bšV@nVVUlÞ¦lUllœVlU°ÑU¯Vƒ°w„bXxl@VŽ²„˜@n„ô¼ƒó°™kmVk²ĕ‚w@wV™ÞÞ@@Ġƒö»˜¯œ@‚„šbnb°mÞ¯°V°„ÈJmX¥mam™UřƒUƒlaU¯™ƒ@w™Kk—l±n@@wƒkÝVUUl±¯I¯b™a™lƒ@™kLmakbƒ@ġƒŹé°™Þb°šékƒƒLm™„wX™‚aÅb@bVlƒbVb—ÒVbUb›UUanwƒakbVŽUV›ak„¯„UŽƒLmxV°UxnôŻX@J„Xkl‚bkbĉaƒbƒWU„ƒ@ƒk„WUU¯@@klmƒ@@™Å@aƒwWXlKkI@WbUaVIUanUƒƒ@ĕƒ¯K™„mUnWUwm@£ċèkUmbUmm@@nkJUalwk@@nmWUan_óaWmnw±KœIƒwl@UmƒI@an@@mlUÅmV_™KUkƒ@U`@_ƒKUmU™@U¯™mmb¯@kb™ImV¯ƒƒLkbƒKƒƒÛ@ÇnɱJóaÝĢkb@„›x—ÒÇllœ@‚Ž²V‚„ÆUVV„UÇ°X„óxlV¯„lV@bƒV@n—x›@—¤@„șŎnxV¼knšJ‚nšKX°˜¦UlnVbUbÆVnÞWVX¦llšb@l°œVJôÒnLVbšbXŽ"],encodeOffsets:[[131086,44798]]}},{type:"Feature",id:"2202",properties:{name:"吉林市",cp:[126.8372,43.6047],childNum:6},geometry:{type:"Polygon",coordinates:["@@ôl‚zšaÈV°„šK@„mŽ—LWl™nšVxUV‚È@ŽÝĬUÈn‚ôLša‚„²VmĀkV@„ĠĊnU@b„V@b˜@nl°UVnÞaôJ@bš™V„¦mlkššbmVXx¯@Vxm„nbƒ„šbÈK‚V@bÈL„wĠyônšmnbÜ@nn„V˜x@n²K‚„„J@k„al@nxÞU„Lź±Vwkw¯LWWUš™kŎīVwƒw„°y„Vĕ°wÈVlkÛ»@wW@Uô£@ƒn™ĶƒXwW™aUamKóÑUI¯›@k™akkW¥XUmÝÅUVaUa‚mVk—¥W¯™Lm™IlmU»mwȚō@ƒ˜£kJUÇk@am¯y¯UVwƒa@wġx¦ƒKƒƒ¯X°Ċ¯¦U°ċWULÅa±b¯@UkÅWmVƒ™ƒkIUlóŽċ¹™`óIƒlX„WŽXxmbUƒLݏƒbƧ@ƒx¯bƒÈ—l@xƒš¯zƒaݤ@nšm„VWb²bmn¯J¯Ò@n„š"],encodeOffsets:[[128701,44303]]}},{type:"Feature",id:"2208",properties:{name:"白城市",cp:[123.0029,45.2637],childNum:5},geometry:{type:"Polygon",coordinates:["@@ó™ǩŁ@WlwUaƑwÛÅÇéĉamKƒōÇ@Iƒ™ôġVƒȁÑŹçƒ™ÝUƧċĉwóóÝ@Ƒ»ğL¯ll²@ƆÅV@¦m‚Åb@nmlU²VxšlUn™@VbnW„bÇbk҃š„n@èlnlšU҄Ž°Lšx@¼ĉb@҄šUŽċxՃènLVxƒÒƒbÅJ±a@_ÅJÅnƒŽVb„Kl„nUÜĊ@„Uš™xXVÆn„mšVššJÞ¯V™ĠwšƒXw°xWL„x„KV¦ôU„wVÝǬóÞޙ¼‚‚„ÞkŽVôȘxބU„lVn¦ÞšĊa°w„b°@šbÆw„lŤL²`„z°@V@@™nJVnl@@¥nUmmn„@mwnmmUnk@mlwUaƒLnƒ›wn¯°anƒWakI„ƒÇmXwÆamUXUlJXa‚UUklKUknmÞV@‚K@VWÞ@VkUwVƒ"],encodeOffsets:[[127350,46553]]}},{type:"Feature",id:"2207",properties:{name:"松原市",cp:[124.0906,44.7198],childNum:5},geometry:{type:"Polygon",coordinates:["@@„šźèȂÒU„óĢ„š@JŎȄ‚‚LnŽĊbÈêÜƃxVbkx@XǪłôš„kÞ`„šW„b@n°ašbšKšnVw°`š_X`W„š¦„ĊIkmVšakw‚K„x°UÞb„U@lšƒl@°¦œVW„šaÞbšxÞI@mVI@ƒVkŚUWK„¥nL‚a@ƒ„@ȍ„@°ƒÆ@nU@KÞalkUwVékUWw„™kU›VkkƒJk¯@»ókƒV¯ÆÇI@bĉô¯@™ķw¯nmmÅL¯wƒVƒUÞy@UówÇLkmm@@UóxkkĉmL¯wVwkWWX™mLõm@kűV_ƒƒô»ÛƒÆ¯@™Va™VšaĠVlmğwķUóÝƽ£ÇJkbǫaƽLW@nxݤkzƒy¯XɅm@VšôÇX¯Ė¯ºÝnUŽnLVlUÔmV"],encodeOffsets:[[126068,45580]]}},{type:"Feature",id:"2201",properties:{name:"长春市",cp:[125.8154,44.2584],childNum:5},geometry:{type:"Polygon",coordinates:["@@„U°xÆKnn°mĸxš°@Ċó@aÈJ°Å„Uôl@¼l°„IllœUlVƒšXxlVUêVxkllnÈUVll@Vx²IÞ¤VUlVnIôlރlwô_„›„bVaĶLXÅÞÇ@K˜¯@wÛaƒçn¥š¯WXyW¯XwƒUmmÛ@ma™nómğzƒxÇK@aUÇL™a„ƒmanƒUw°@WwnU™al™nkƒ¥šU™@aóIÝbUm¯Vmk—@@aƒU@amVğĉ@ƒlUnÿ±Uƒ™bóKmVÇÞī@ÇVUUw‚™šmXk˜Kn@ƒ™L¯ƒÇU™byókōè@b‚n@lÝX@x¯ô@ƙUV_maXm@aóƒJWxnX@ŽVVnĖVnUJ@nōÆǼV¼kxƒLklÝw@xƒx@zV`ÅbmxU±xU„nnm‚kn‚ŽğU™bUŽ‚šUb@šÅ°Ü„󼄄U`Ʋ@lön‚KšnXWlXUx°xnKĊllôw@Vn@lnÈKôx@VÝz„V"],encodeOffsets:[[128262,45940]]}},{type:"Feature",id:"2206",properties:{name:"白山市",cp:[127.2217,42.0941],childNum:5},geometry:{type:"Polygon",coordinates:["@@Ušl¦kÒÆ°„IlÒU¤ôz„¼lJš„U„n‚ÆXVl°@²aÆbVKČXV¯°¥¯ĉ°W„„„L‚¥Ģw@x„bUx°V°zn‚‚b@ÈlVŽlIœ@˜w@m„U@akU°ƒkUôwWƒÈ¯VUƒVUƒÅ±U›@kÈk˜Ñœw@ƒlaÞġƒUÞ£@ƅ‚KnÑĢ¯@W‚aUaVUVkkw@a¯@¯™Ý™ƒVXnW@@WkXmK@xkKUb@bW@Uw¯„mmb@WKUbmUbUaWbƒJĉIVW@I—l±LkšmU™bUm™@ƒnkKWa¯n™@„`Ubma™„ĉL@bƚ—@W`ƒL@n¯‚Xb‚@kb@x™Lƒ„™@V‚kL±™™mlUIU¥mL@lÅx@_laƒƒ@U—aƒV@kmmƒK„£ƒƒLƒƒmKUnÅKVbmXVlèĉUUbml„ĢŤƒIlŽ¯bǦœl‚@ô¼Ģ„@x°„l¤„n„a„l@x™b"],encodeOffsets:[[129567,43262]]}},{type:"Feature",id:"2205",properties:{name:"通化市",cp:[125.9583,41.8579],childNum:7},geometry:{type:"Polygon",coordinates:["@@ÆlXnĠxĢ°lÈ°š„K„°kXm‚@¦Vbk„ŤJšnݤk„VÞVVkȄb°y„™@w˜k„Ç°a„wƨ@„aސ„K‚VnaWwXWƒ„kôJš_ČºôVkƒ»óyV£kуJůlÑk¥V™ša@wƒkƒbƒmk£¯ƒ@wġƒó»@›kÈ¥°ak„JÆ£ƒġnkVaĊVkçWUnUaÆLVmnL„„‚KU™±@—„m@a¯U„bmV¯m@_ƒK™™U™ƒaƒÅ™Wó¹ƒ@UanmWak@@wmI@y™@mk„JVa™@UaƒIkJ@n™@Um±kkxƒm™Ik„ƒbÇm@Ž°bXn„V@Ž°ÈmlÞ¼¯XVº¯Lm„kWWXLmVVlknƒ@@lnWƙ„Vxbmšnšm„¯lÝaVȁè@¼V„„b™„ÆŽ°ÞUVšJ„„kx›I—xƒƒƒIV¤™ÒXxmn"],encodeOffsets:[[128273,43330]]}},{type:"Feature",id:"2203",properties:{name:"四平市",cp:[124.541,43.4894],childNum:5},geometry:{type:"Polygon",coordinates:["@@Ɇn°W„zlyÞ£mwX@ƾKǬblaÈIƾ¤ôÞĸVĠxnmmVƒ²w‚VnwÆaU_@y„w@wÞxlk„KlwU»È»ŎÅ@mVIUmmĕUU@mWXw„Iô‚@bWnnbU`‚šV@Å°ó@wÞW@km@aŎ烙@m°Ñ°Inm±aXaƒU™n@mƑšU¦@šÇŽ¯aU£šaU™ġ¦ÅҙJōUŻókUÇ@™¥¯ak¯mUVak@@aċçÅaUƒm¦Ý`XbƄ@n`ƒI™xĊÞōÞml@šUb@Wl™_¯JkšÇUÝÆÅb@n™„llUb¯„±a@ƒ—ƒWĉJġĀ¯™Unóšm¤œxôaVnƒxôI@x„V@bmƙ„@lnLmޯޙxVb¯þ"],encodeOffsets:[[126293,45124]]}},{type:"Feature",id:"2204",properties:{name:"辽源市",cp:[125.343,42.7643],childNum:3},geometry:{type:"Polygon",coordinates:["@@żôŎVšIÆÑĢ¥Vš™bV¤°bȍ@™V¥ƒ™Þ£lÇUUUÝlƒÞ£™mţIlƒUa@¥nlWƒ¯ƒL¯™kÇġ¯ğwWmÅk¯UƒVU„„bWlXlmnƒbUx¯xVVknlŽUbV„ÇKUb@„™VnbmlnzUº±bmJUbWÈnèm҄š@X`WL"],encodeOffsets:[[127879,44168]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/liao_ning_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"2102",properties:{name:"大连市",cp:[122.2229,39.4409],childNum:5},geometry:{type:"Polygon",coordinates:["@@‚IÞmVk@wXWÜbnwlLnU„@‚nLlbXW@a‚wnbl@XL‚aš@Ċ¥@LULnJ@xVnmV@VXXV@VJkn@VÜKXXôJlb„xl@„IVbnJVLUbn‚lnVw„JVU@ƒXU‚aUUlwn@°ƒn„VKnV°_VJšwl@nwlV„IXWlIVVnK@IWmkIVaVU@WÈUlmU@U„WUalkXġŻ@kIƒ»mm™akUm›ĉUŁV»²ġVĕ@aUU؍IɃ`ȃ@kƒw@ƒUƒmwĉ™@ƒWķсIĉÇbÝLkymbIƒwÇmÛbmbU„¯ÜõÈkÆVbŎxnXVÆnšǪ¦„bš¤Uš™xÝnĉÒmĊVȄ¤Èš„bƼ„Ā„„ÆÆބźb„VVbX„‚°²¤"],encodeOffsets:[[124786,41102]]}},{type:"Feature",id:"2113",properties:{name:"朝阳市",cp:[120.0696,41.4899],childNum:6},geometry:{type:"Polygon",coordinates:["@@na@UVI@m„ÑW™kaV¥UI@wl@„aÈbšm@wVašk„@@K@kƒ™@a@UUmƒUUalmU@KÇUű¯@±kUKVkUaƒaU@¥m@@¯k@WLUmkn@mmIkm@amU@wVmkU@Klk@U—m˜aXIWWUL™aULVbƒmk@UUmUk±™_Uym@mbkImaX¯WW™xWKzU@WƒkJWwkV™@Um@UbVVVVXb@VWX—@WŽ@Vkb@V™nUK±aUUlwX™ÇWKknU@mmUkƒLUVƒVUUVƒUaƒw™bkKmwnIƒ™kJ@nmbƒ`kmVkLWwUm@UUU™K@UmaUa@UUaWK@mUƒ¯Wkk¯VmUUŽ„xVXUVmL¯ymXkWUbmXUKƒVknWx¯JVnkLƒl@VVxnxlĀVL²WlX„l@bÝVUn@bnlÜaXblIVl@šš@Ȧ@VmbXV‚@@x„VVnUn@`°@VnXU@K@„VV@VmbnVn@ln@b„xƒ°Ub@bšLV`Ånƒ„W@@lUšnnWVU@Vbkl@Xl`XxV„UblŽkX@Ž°¦V„UVVbUlkV›@UbVbkLUxmJkXšš@b‚bœxVKÆlXX˜bnŽnala@ƒUk@U„VVklKVUXKVU°KVan@VUnLšKVL„WVaU_@mmUXa@m˜wXwVkVWXk‚k@›„k@klm@wXKl@U@KVUUUVaUƒV@„alL„xUx@b°°VnnVšxlIXJmx„LUVlV@bnX@Všb„aVx‚@XJ@b‚n@VŽVXȄl@llX@lU„Vô°°@ބVbn@‚V„k„@VW"],encodeOffsets:[[123919,43262]]}},{type:"Feature",id:"2106",properties:{name:"丹东市",cp:[124.541,40.4242],childNum:4},geometry:{type:"Polygon",coordinates:["@@lzXJ‚U@š²x‚@@Vš„@bUVmKUn„°n@lnVK„„nV@n@VlV„°WbXn@‚VzƒJ@¦@bkb‚bUl@bkbƒJ¯zƒWULWbklV„nb™¦VJ@„„K°U„kl@@W„bVn°@„Všm²U˜nX`„UÜLXmVXlKVbUVVnUbn˜ƒX@VUL@lUbWxš@²kl`n@Vlb„@nUVWVLVU@aV@²bl@ÈmšxWX„VÈU„JV„l@„„la„WnX‚KÈkÈ@Va°bÆm„@XV°IVV°UnalƒVUn@UwVU„@@VVJ„I@bl@XK@wWmXU‚UVbkJVXnJVI@mƒknwlKXL@`l@VI@UUaVKÞn„aVm@aÇ£XW„U@aÇUU@mbkKm£™@WW™ƒL@@Kk@kl›U—bWKUkUU¯UõÛƒmUUaVU„U@WU_W@kVkJƒ_WKkV@bUL™¯¯ƒ±mk¯ġƒğÑ@UmwƒKUakƒ™ƒa@a„m¥ÝƒIUWmk@w™mţ—L›KʝbȗKWĢklVbƒX@VV‚knÇV@XUVUblJXn@J"],encodeOffsets:[[126372,40967]]}},{type:"Feature",id:"2112",properties:{name:"铁岭市",cp:[124.2773,42.7423],childNum:7},geometry:{type:"Polygon",coordinates:["@@XJm@¯šmXUlnVbUJƒU@bV@UJWL@VXLmJVbkXlJXxVL@b@V@n@b@`Vbk@lxknV@VV™V@bUL@bV@@bVK@VXLWLXJ@LV@nbWJ@IUV„x@LVJUXVxVx@VV@@LXJWL@VU@@L@VnL@bVVmVX@@VVInJmbnLWVnVULVVU@VVmX@@JVz‚l@„nVVKVXރ@mk_lm„UUWV_nJlUÞÑÞVVUVƒVL„UVJ@I„Vna‚@@KV@XwWknwnKlalU„w„aĉݚwšJl_@aUaƒKUUU@WU@WXUÆ@@UVK@n@UnVVšblK@bœllb@b„bW@Xbl@UlnLl°°bš¦nKlVnI„V@UWU@WXkƒw@am@nm@aVw@I@KUaVIm±XÑlknJVnVJšaX_VaUaVKmwnkmmn@lU@U@mnašXlKUmUIVmklaUK@UlUVUW@U™kVm™a@UUU@JmUU@@bmb—KWV¯XUKm@ka@UVKVk@aUKmLkKUUÝUmbXbÇJ@k@WU_@m™™@klm@UXKVaUI@KWUXaƒÇWk™aWUkWUL±U@lUU@ƒUJƒI@V¯JmIm@@aU@Uwƒa™@UV@VkI›V¯aUkƒWkb@bVL„@@VVVUXW@Uaƒ@@b—‚ÝbUV݄@ŽƒLmUkVUbVllLUV@LššXŽWbUXm@U`@„kxlnnJlbnIllšLX„lVlUXmVK„n‚V@L"],encodeOffsets:[[126720,43572]]}},{type:"Feature",id:"2101",properties:{name:"沈阳市",cp:[123.1238,42.1216],childNum:5},geometry:{type:"Polygon",coordinates:["@@ȚĊÜ°„b„L‚lÞxUbUn±‚@ÈnVÆL@xnLšlUVƒbƒxkImJkn@V±LUxkV@bšbšKVKnzVl@L°@Va„xÞUlbôxVVœ@@V±bnŽ@llXL˜ŽöXĶŽnal@nkVJVI@aU@@aVK@ašUUUU@lmkwl@Ua@_@a@m@U@aUKWwkIlWUanIWK@UXKVIU@@a„VVIUa‚mVknW°™n@WI@KUƒmULWnkVkUWƒ™KkkmJkamIkmlw@ƒV_n@VWXaW™™@KVUkKUkValUnV„K@ÞƒVUÞa˜@a„@VbX@VWUU@Uƒ@UK@ala@IkKmUUa@U@ƒVƒkk™WVwU_@KÜUXbl@V¥XUVmƒƒƒXa‚kŃlUUkIm`UIUJW@UIKmkm@UUJƒImmU@ƒVUXU`mIUbUK@LƒJUU™l@Xƒ@UbƒJ™kU@ƒŽn„m@Uam@@ƒ™aUmLKƒwƒ™mWXUK@kUaÇa@JUIUa@aƒKVUƒUXmƒUy™_@lmbkLUKWLX`‚n@bVL@JXL„‚WX@Vnb@Vm@UbnVmL@V@x@LUbVV@V@LƒUVl@mb¯U@xU@UVVV@X@VVblJ@bn„VKUn„x@llnL±¤™b@k`VXÆK@„kV@¼kl@bWIUl@VmLnbm@@JXXmb"],encodeOffsets:[[125359,43139]]}},{type:"Feature",id:"2104",properties:{name:"抚顺市",cp:[124.585,41.8579],childNum:4},geometry:{type:"Polygon",coordinates:["@@„XVl°bœUlJ@UVUš@„bVxV@@bn@nJ°I@U„J‚I„VV@V@k²VVKlXXVšb‚lÈX„ŽWbXV@LVJUbWL@Vkn@lšš@nV`@X@lÈIWanaÞVVVlLnKVL@bUlUL@Vlbn@VL°WXU˜Lna@aV@nV@IVV@VšbUnšl@V‚XnKVa@U„UnyWkXaƒaVk@ašašbnm@_WKXmWanU@alaU—l@XJVLVxX@˜wnKnVlwƒƒ™@V_@a¯¥@UkKWUaUU‚anK@IƒaU@WUaVw@klUVyUUVUUÇ@Iôbša@mnUma@kXa@UWak@Wa—l@a›@WUƒLmU@U`mIUU™`mUk@@UUK±nkJƒbUam@kwm@@a@UU@Ua@@K@ƒVK@kmKU_UKƒUUaĉWmkkL@`™LƒnmlkLkbmK@k™@Ulmb@b™„@Ž„xUVƒIUlmVXXƒxm@™JUUk@WUk@ƒakx±@¯x¯Umb™KUUVmUU¯UmVVn™WkÆ„lWb„„„ŽUnWVU¦k@WaÛV@LV`UxšXllU„@„@VVbnVlL@J"],encodeOffsets:[[126754,42992]]}},{type:"Feature",id:"2114",properties:{name:"葫芦岛市",cp:[120.1575,40.578],childNum:4},geometry:{type:"Polygon",coordinates:["@@ll°X„ŽnV‚@XLVb@VVbnb@VšLVV@VVnXxlKnU‚l„_na@mlI„šmJnxlLša„xVbU„VV„UVU„KVlnnV@lmXLšÈWŽkxVV²bVLšm@Ula@UX˜@XW@UWaUUUUVan@V‚š@lUXxlIX„V@‚yXLšw‚ŽXXW°nblJnan@Vzš`l²nVVVl@„nUaVKšbVKnXVaUaVUšyšnXK@kVK‚@X@m@m‚LXa„LWƒU¯„w@™ƒa@UVw„¥°™ó¯¯y¯ƒUǯ»›w¯Iƒm—¯Ç™UUl™¯»ţKċÑţķm¯w@mU_ómk¼VnU`±IkbVlƒnnŽU¼±Lk`@X™Wl¦UbmVUxkXVlkbllU„Vb@bkVmx@XVV@Jb±aULkKWXkWmX¯aUJmIkVm@ƒxU@n„"],encodeOffsets:[[122097,41575]]}},{type:"Feature",id:"2109",properties:{name:"阜新市",cp:[122.0032,42.2699],childNum:4},geometry:{type:"Polygon",coordinates:["@@šXnb°lš„VlnXVJ„LlVnl@zÆxnK@b„blKVLn@@V„aVLVK@L@Vl@XVVInVVKVwlUXwlKšL„ššVVb@aV@X„lUXbVW@n„lWnXKV@@V@XUVVLUVV@@bVVV@@ln@VbVUXV‚I„xVanJ@UšIVWšL@UV@@¤V@nInw˜W„k„lnIVx‚lnzUVÇJ¦VVÜLĸUnW@aV_šWĊXXa‚Knkl@nm™L™a@alUVw²K@UlmnIlJ„w„aVU™kmK@wÅKmU@DzVmVaÝwkƒKƒaÛ¯șĉķ¥ğ¥ƒ@kUWkƏī݃ƒ@@akU„K@KWIUm¯nƒU¯JmwUVmIkJÇLm@™UImJUU@aW@U@@nUb™JƒaƒbXVWn@UVmX@V@b„š@l@Lƒ@™lUb@x™nÇaƒbk@@xVJU¦lbXšƒÒ@nUJ@Vmb"],encodeOffsets:[[123919,43262]]}},{type:"Feature",id:"2107",properties:{name:"锦州市",cp:[121.6626,41.4294],childNum:5},geometry:{type:"Polygon",coordinates:["@@nJ@nlmVnXKl@@°n@@¦‚V„bVbUlVL²l°@ƲÈV@LV‚knVb„VVnnWVU‚@XmWU„a„bšIVa@mV@X@@bVVnIVJ@š‚nÈKlInJVUnx°I„V°mVnXJ@LƒLlV@b„@ބƐĬXllV„@Ġ¦ĸ¦naWW@In@manK@UVkXJ@alk@»lU@ƒÅLUWl_@ša²£‚Kkm@kƒwVmULmƒ@akIUa@U@WUUVU™aÝ@ğ›wkƒƒmĉ£UWƒ@@bÇL@m—a@_mKƒlƒXUwKƒLţÓ@UWw@K@U„I@m™U@UV¥„@°UnJ°@@_™KUwƒW@UnaWUmmI@m™ķwUaÇLóVĵwݙUUW™¯šƒ¦Ux@V„b@šƒxV°X„ƒKWbK@n@nW‚@UL@lWL™m™zUVVbUbmWXXWJ—b˜n@Vkl@LlVUn@xnV@bln"],encodeOffsets:[[123694,42391]]}},{type:"Feature",id:"2103",properties:{name:"鞍山市",cp:[123.0798,40.6055],childNum:4},geometry:{type:"Polygon",coordinates:["@@l„œxĠŽÞ@šbV@@w°Vna‚@Uk„V@K@UUUVa@K@w@UnKmUVan@@Uma@UXWƒWK@IUK@amW_XKVLlKna@kmKVak@VU„@VmšU@anIÆan@‚a„šUVnb@blLV`ÞLlU„bna‚Kn@naVU@¥°IVK@anUUKVaƒUVak™@mJƒkXƒ™UVwkƒVUUa°U@Wƒ@WlkXWlIXUlJlaœx‚IVVXLšll@nLV@lLXl„KĊzš¥maUƒlkXaVK„X°y„Ila@aVkala@a@¥„IUy@WmXaƒ¯kU@U@mmUƒƒULkmm@ƒ¯VmnLVU@a™ƒ@U@±w@™VWIkymLUUkJWXƒJkUmxk@™xUI¯`mUULmƒ¯„m@kxVVbWV@„UVƒIUx@bkšVšVVšxUbVV@V@zšJVXU‚lnk@@lkLƒlƒLUU±Jkšm@UIUVƒLUVU@™K@UƒnnV@l@Ll„ƒaUJ@zn`@nWlƒIUVUUUV±Ln‚@nmL@VUVkLVlUxVLVlÅXma™@@akLmWUX@JUnVJVkXJ@X@`WX„VUVUIlb„W@bVUVL@`Un@¦U`@bUV@z@Jm@@XV`„LUL¯J@IVKmKÅI@J™nWVnLnšVxV¤™z@bmV@VUV@bUL"],encodeOffsets:[[125123,42447]]}},{type:"Feature",id:"2105",properties:{name:"本溪市",cp:[124.1455,41.1987],childNum:3},geometry:{type:"Polygon",coordinates:["@@lb@Vn„lnVVUb@šVJ@nnJ@bmXUx@xVbkbkŽWLUxnl@Ul@„xWx@nUV@¼Ull„knkK@bmbnl‚LVJX@VIVJn_lJVVšXUmnU°VVVUnVVšLna°V°w²@lw„bl@XVl@VVšIn@„wWWnUVk„JVUƒw@šƒ@anaVkš@@lnLlalKnk„mšK@_lKnlĊXVb„VVLV`nL@lUL@„@L@‚VbV@@V@bn@lxn@Vb„alI²mVL@Vl@nVš_VVnJV_‚@nV„K‚V@Xœ‚@b˜kXbl@XblylUUkš™@Xa@UVIlK@UUWVU„Llm@UUUnKWU@K@UXm„XVa@U°KVUUWUk@ašUVKkaWkƒKUknaWa@U—@m@mk@ƒaUJk@@_WKkLmx„l@nUJmIUWlIUaVWVXn@xWLk@@aƒJUI@Uƒ@UVVxm@UVk„mb¯VUU¯JWUƒ@Ån¯aUbÇ@ÇlLmWƒXkbƒƒk@UƒƒIÇVƒUXW™wÇnk@±aU@@bUVUKUXmVƒ@kaUm@k_±l™@XwVa@kVK@U„Wm—VaUmVUUakLUWWnÛKƒVW_—m±V™nƒU¯@Umƒa@Xk@ƒl¯V"],encodeOffsets:[[126552,41839]]}},{type:"Feature",id:"2108",properties:{name:"营口市",cp:[122.4316,40.4297],childNum:4},geometry:{type:"Polygon",coordinates:["@@ĊĖƐn¤„„°Ċ¯ŎWšô„@xXb‚wnKl@nX@VUVƒKmL@VU@Ux݄@Vlb„x„U@VUb@b‚kœ`‚IUlVUn„V@@UV@@JnXlK@bš@nbÆWUkUKVwUklKVU@UnK@mm²KVUVVVU„JXk@mm_@yVI„bkƒ@K@kmU„m@VšLV@VU„KVUVJn@l™²IVV„K„klK@kl@kmVUW™I@y@UUUVa™wUUU™l™@akmmVaUKmIUaƒJk@ƒwkaóIWWÛL@UlmUIU@WW@UnUUm@wmIVK@Kĉ¦™@bWKk@max@bWXkamKƒ@mVkKmxÛaWX@xUlÝnJ"],encodeOffsets:[[124786,41102]]}},{type:"Feature",id:"2110",properties:{name:"辽阳市",cp:[123.4094,41.1383],childNum:5},geometry:{type:"Polygon",coordinates:["@@š`Vz„‚Wn„VUV„L@bVbVJ@IÈbVb@lVLXW‚n„š„x‚LnKVŽšb@„n@Vbn@mƒ„V@šl„IVa„@@WškVV„I@KVLVanJV_VW„UV@nn„JVI‚Vn@na@alLlmkƒVk@»VU@mXwƒwk@@VmkVwXKllaUa@wVwnW@amI@mUI@™VaUUkmmƒ@UkaƒL@ƒUIĉyƒLWkkKU@mKk@™kWKUUJ›wkbkIWVkJWXkl@X„‚@X¯VVbUVl„UxšVW„„lnIš@l‚Ub„VUbVLmV@bUL¯J@¦UVmbm@LmbƒakVÝKU_kK@amaVUƒ™bm@ÅbmJ@b™VUnƒ@UVl@UbnL"],encodeOffsets:[[125562,42194]]}},{type:"Feature",id:"2111",properties:{name:"盘锦市",cp:[121.9482,41.0449],childNum:3},geometry:{type:"Polygon",coordinates:["@@Vbĸx‚š@nnJVnXŽmb@V„XVxšL@`¯@mI¯Vƒ@U¦@VšV@nƒJ@V@LXx@VŤÔ„K‚LVx„W„knL@`˜b@nÈK@a„@VXĊ¤„nVK@aVU@UnU@ašyU£Uwm™mKXUšm@IÆJnLUL@J°IVKƒKU_@Wn@@I@yVU@aV_@¥Vm@_UKUV@aƒXkaVJVUƒUXW@_@WWIUlUIVm@IVW@IU@@VU@mƒUVVkJ›_l@aVa@UƒVƒwka@UރVwV@@UnK„LVU@UmWk@mLxWa@wóƒUVUIÇÆĉ¦¯¦¯xʟJ"],encodeOffsets:[[124392,41822]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/nei_meng_gu_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"1507",properties:{name:"呼伦贝尔市",cp:[120.8057,50.2185],childNum:13},geometry:{type:"Polygon",coordinates:["@@„m@Łkƒ™Žƒklƒôƒ@£kJ°ý™ɅķÑó¤ğLĉÅlÇğŁW¯¯›™ƥóÿlwkţÈéÝƛó™°ÞÅxV¤ĉĖWƒ¯lȭţυ̃ɱÿķƅˋğɱřÝţϙȍƧĊţ@¯kWKUKm¹Å@ķJU@ƧÑƧ„ō¥˹Ɔ@L@„Þ‚VLnš@VōČWJX¦@JŻbU@ţÞmVU@ȁýóbkWWLƒƒÅ™¯UWġkmóƒ±UŹôV¼ƽ¼ƒł̥ĖƽǬʉxĉŽŻȗKΕ̛ʵƨʟÞ˹»Ƨţ»Ǖō˷Ȍ±ȚʊĠUɾɜɨmÜ֞߼˸ƅȂ¯ǖKˢğÈÒǔnƾŎՂ@šĊbôô̐¼ƒ@ĊôĊŽÞĀ™xšĖƧL±ŽœŽ‚Uš°U„°ĬƒČ°ÜƒêɴȂVł°@ƒ„nxŎèƒbȄÞȌ΀ǸlŽ²IlxĊl²ÒmšôĖ™Èl„ĵºm„ÈêVþ„xɛČʉÇĵVmš„ÒƒÈɆôƐŰǀĊ°ÆǬĮƾb„yĊ@ĠšƒXǀċm»ôw°Ûk¥Çm¯ç™kkÇǫţǕéX_ĶWǖīŎaÆĵĸĊ@ȚȘ‚™ĊLĢĉ„VÆĉʊÇĕóaU¥šĉ°mkÅ°ġUĠřk°mƒÑČÿ˜ÛƒWĸ£ʠšÆxÈÞŎÞ»ʈ²ĊÇČalÒ°Ť±ĸz„ŽĊKȲm¤Ŏ@Ò°¼nyȂUźīǖƳÈē°@šÝĶƒ@ƒÈkl¥Ççkxk™›JXÇƒUÅ@˜£k»„óƿīÛ@lÅJl¥óý@¯ƽġƍÅan™ċ™°é¯¹"],encodeOffsets:[[128194,51014]]}},{type:"Feature",id:"1529",properties:{name:"阿拉善盟",cp:[102.019,40.1001],childNum:3},geometry:{type:"Polygon",coordinates:["@@™ƏnǟƨʫšŹɆÿ°¯ÆV²ˢ™żÿ@ÝÆŁȰ¯ȀƳĉó™™@ğkyš¹@īš›ƒwl£Źƒƒ¯Ŧé@™ÇÇxŋĉƩUUŃōL™Ç™ĵóÝnƒóç@™™ó@ġƒƱ„¥ƒç™WUçÆōƒ@é—çťK™çȭVһƽ̻aW¥ȁ£ʵNJǓƲɳޗǔlżÞmĠóĬȂɲȮ@ÈĢŮźÔnĶŻǠšŎȭœгŃċóȭţΗÆƑÞƧÅΫóȘǫɱȁġlÛkÇ°ȁÈnšõl¯ô„ÞɛÝkĢóWĊ„zÇɼʝ@ÇÈķlUČÅÜķnέƒǓKȮŎŎb°ĢǀŌ@ȼôĬmĠğŰōĖƧbЇƧōx@ķó£Ål±ĀƧīXÝġƃêĉK°Ýʇƅ@ΌʉżÅÒϱʈ@˺ƾ֛।࡬ţશóЈèʞUš¤Ґ_޸Ƒʠɽ̦ÝɜL׈ɛϜóȂJϚÈ@ǟͪaÞ»Ȯź"],encodeOffsets:[[107764,42750]]}},{type:"Feature",id:"1525",properties:{name:"锡林郭勒盟",cp:[115.6421,44.176],childNum:12},geometry:{type:"Polygon",coordinates:["@@ʶĬĊIȘƨƨŽ@ĬÛĢșŤĉĬƒĀóšU‚ÈŚÜènŦƐȤȄłϰUƨťƾÑ܆ğɲƜǔÈèʈƲĊƞƒšɆ¯̼V˺Ò˺ȂŤVĢêU܃x„Āˌ˘ƨ„Æ°ѢmÞżU¼ÆlŎ@ĊçŎnÈÒͪŎźƒĸU°lżwUb°°°Vš£ÞlĠĉĊLޏɆnźÞ„n¦ĊaȂīġŃ¯Iĉůl»kƒ„™Çý„¥Ŏ¯ƒén£ġљÝȭxƒÇ™@Åçķ»óƱŎ¥™çWÿmlóa£Çb™yVÅČÇV»ÝU¯™KĉýǕċţnġ¯»ÇōUm»ğƒÑ™wƏbċÇŎċwˋÈÛÿʉÑ°Łkw@óÇ»ĉw™¥VÑŹU™mW»ğğljVÿŤÅźī@ř¯ğnõƐ@ÞÅnŁVljóJƒwĊÑkĕÝw¯nk¥ŏaó¦ĉƒV¦Å`ğуÑÝ@mwn¯m±@óƒÛKˍƏǓ±UšÝ™a¯lƒōšșk„èƒĬގn@ŤġŰk°ċx@œĉ`Ƨĕ°@ţÒĉwmĉ@ƒƒnƒƒa„™¥ķnƒÞĉVóÆókĉŽķ@ÝkƧƧÛaƒ°Ç@ÝÈU˜óbݼ@„ÛÒV°™@V¼ˋL™ÞɅŤŹǠVÞȗŤÇĖŚōbȁƜ"],encodeOffsets:[[113817,44421]]}},{type:"Feature",id:"1506",properties:{name:"鄂尔多斯市",cp:[108.9734,39.2487],childNum:8},geometry:{type:"Polygon",coordinates:["@@ĶL²ĬVłƑkkl@Ȏ™ŘWńÈĬȗ¯™ºlz@ĠššĊôŦô„ÒĠ°kÞܚ™n@¤„UĸèĸbŌÈXŽĸLlÒĢxɲÆ¤ÈÛƾJÈÝ°UšÅĶ»²VW¯ĸJôšbk‚V@ôlbnĊyÈzVôašb@ĸ‚ÞUl°yǬ²Ǭm°ššk„±lbn°@È»˜JX„VŎÑÆJ@k„LšƒÆl²™Ġ²ʊůĊġ‚řóƛÞÅ@m„ƒmLUÿóĉƧ@™»L@„›`ČĸmšȗÑţů±ĉğl¯Ā™wǎƒçƧŤÛI@±ÜĉǓçō°Uwô™ǫůķƳř±bÅ£™ÓÇwnÑó@ȁƽ@™ƒÇƧĢón»ŏĕóĊ¯b„Å™™VȯÅImƒōKU„™LǓ±Ýxċ—ŋ˜V±Āȗ°™„Źl±šÛ@WÒȁŚŹНŚÅèŌô„¼°ȰɞȂVĊ"],encodeOffsets:[[109542,39983]]}},{type:"Feature",id:"1504",properties:{name:"赤峰市",cp:[118.6743,43.2642],childNum:10},geometry:{type:"Polygon",coordinates:["@@ɲŁĢljĊwƾōÞĭ°_ŎŃźȹƒUČÿl»¯ôķVÿǬƽ™ɅġÅÑǫ»̐ʟȣU™¯wVWݍÈġW»Þ¹m݃ɛŎÿŎōͩůV¹›ō™éċ™óŹÅVVĢǩʈ@Ėċ@ķšÛšV°¯xÇÅţ¥™»°Ûô™ĉʟ„¥WýČ¥™w‚灻±mnÅķ¥ˋVƒbUÒġ»ÅxğLƧ™ƒbWĖÅxš¦U°ÝVóŰlô²@š¥ÜÞÛô„V@²±`š¦™„™¯Ý@„ŽÅ„VÒō¼ôš™¤V²ŹĬÇĊƑƒţxƒç¯Lk»ʟlƽýmłÝÆƏ@mö°Ġ@ŚŹĬţÆUĀĠNJĠŽX¼šnźVUҚ¦Ċxȼ@ôlx¯łʊÒÜĀˌÇČxƍČÈƐašx„ÒĠŽn¼ŎVȐ‚¼Ģ°ŤmǖČĊþšLV°ÞŽU¼ċÈUƚzÈa‚¤ôbkŽ‚nXĀšè"],encodeOffsets:[[122232,46328]]}},{type:"Feature",id:"1508",properties:{name:"巴彦淖尔市",cp:[107.5562,41.3196],childNum:7},geometry:{type:"Polygon",coordinates:["@@²@Ζǀݴʶհĸ„˜ƒ¦Ķ™̒Uˌ¼ӾÇƾ¼̨UÞĉ˜Ƨ—éÝ»ƒĕĉ—ƐȍœōǪakó‚ó¯a@™ôţ™aV¯Þ¯°@²él¥ĵğťwōxó¯k±š—Vó@™aóbUÇyĉzmŽkaóŽU@l™aó‚ķIX°±Uĵ¼™Æ¯VÇÞƽIÇÜÅ£ɱŽġwkÑķKWŋÇķaķçƒV@£šmۙlÝğ¯ƒÑťóǿƴȯ°Åł@ÞŻĀˡš±ŽÅU¯°ɅĀ™źƧʬmǠšƐ"],encodeOffsets:[[107764,42750]]}},{type:"Feature",id:"1505",properties:{name:"通辽市",cp:[121.4758,43.9673],childNum:8},geometry:{type:"Polygon",coordinates:["@@ôƲĸ¼Æèš@„ÈȮwƾ»ʠĢ¥VÆ@²¥@»Ŏњ¯ĊJŤ£k»ÆÇX¯̼ōšī°aX£ôƒƾȁź¥„ƒ™aôŤ™ĢL°ƒĸ@Ȯ¼ÈÒʈŚôVXůÆaĠƛÈKƒķšĉôÿ@ğÈĉ™»ÇVn™ĉV›wXĠÝ°šČÿĸwVƒ™¯¯ǵ±™ĉ‚ǫ™ÅÅm»²Ż±ƽIm¥ţÈķ@¯šƧJV»ÞUÝç¯UġºU£ţŽóaÅÅlƒƒ™Ƨī¯K¯Þ݃ğL̑ȍƽ@ōŎōĀƑɜnÞݺX¼ÇĢގUX°xVšʠȤ̏Ǭ¼ÆÒɆĢšŽǫƾUĀóĸ°‚k¼ċĀƑVŹȺōń¯`ÝĮƽŎĉxġNJɱłō¦"],encodeOffsets:[[122097,46379]]}},{type:"Feature",id:"1509",properties:{name:"乌兰察布市",cp:[112.5769,41.77],childNum:11},geometry:{type:"Polygon",coordinates:["@@ʠǠÞĸɲȺƒÒȂƛŎaƙÈĕȘţUÝźǟɆţšÝˌKU»š@U¯ÜÑ@ƒÞ»ôaV—ÞÇÈ@„¯ÜbƨƨÞlĸ@ĊôlôÅĊU„Ýĸmš¦ƒŽ„bm„„„Ċ@n‚ĊxŤÑ@¯‚ƨĖĊ_@›Čwl¯™ƒȭL›Ý„»ƽ¯ķů„Ǔ@ÇǓbċ™ÅÅÆwÿĠÇU£óaƒ¥¯aŎğĠţkw°»¯ůlÝĵkǻݰɱƧǫaóôɱ»Çk¯ŃóƒʇŐŻ›ĉNJŻĢ„Ž¯ÒÈUl°ƒx°n„Ò™Ĭón™Ċğ°ÇŚĉ¦ʵVƒ°°ĬÛżÇJȁńʇʹó˂ƽŎ›Æţ¦"],encodeOffsets:[[112984,43763]]}},{type:"Feature",id:"1522",properties:{name:"兴安盟",cp:[121.3879,46.1426],childNum:6},geometry:{type:"Polygon",coordinates:["@@ÆXnlŎ°@LVLĠþœxĊUȮĊnU„ĠV@żaW¯XIŎġƒ¥Ý@K@w@K@I˺ŻŎ¦ƨƒƨÒŎIÆ@X@VºnX°lŎ@ƾĉˤƒȘǷȘÑÝݚÞbVţĸÿŤxÈĖƐŽêÇKnĸ¥ô@›ķÞUnÒl@UŚaƒīˋƒ¯ÑƧx@±kXřƐƏÛéV™ˋ»lō¯ĉ„ÅÇÓǫޗĖġV@ğ»›°ĵ„ÇÞǓ¼¯m˜ÛÅŃĉĠÇƾb²çƒ™šéż¯VƒƒğÞml»ōÑV痻V¯™¯šĕÆU¯y°k¯¯V»ôDŽѰa@Źk™ġKţšóŽšbƒ„Ź¦ƽȂó„W¤¯b™Ĭ̻ŎW°ÅÈl¼ţ¤ĉI™°ōÒ@¼±¦Å@UŽġ¦ʟŽƽ¼šÞĢÒm¤„êō°ƒ¦Èþƒšl„k¼ĊŰ°JĢńȁĬ„°ƒżn‚ÇbV„ݼ@¼óĸţ¤@°Ånšl"],encodeOffsets:[[122412,48482]]}},{type:"Feature",id:"1502",properties:{name:"包头市",cp:[110.3467,41.4899],childNum:5},geometry:{type:"Polygon",coordinates:["@@źxżĀǔÆǬVȘĀŤ¥œÅƾōôˁʈͳȂŃÈIÜŻ¯ī„¯ōm™¯ɱĖ¯ƒķÒÝIÝ»ÅV™ƒlÅôфġ™ğVmÞnnƒWçkW܁XƝÆwU»Șĕš£ĉÑ𱱚Åk™„ƒK@lÅIō҃UW‚—IǼ¯@m‚kaƒ²™l¯™ǫnǫ±¯zkŽÝVķUô™˜l²ô°ŎwŦxĶĠk¦±ê¯@Ý°U°šbóŤ@š°bôlôǩb›ŎƏȎĊ˜„ĖÞ¼˜ê—ƨÝĊ"],encodeOffsets:[[112017,43465]]}},{type:"Feature",id:"1501",properties:{name:"呼和浩特市",cp:[111.4124,40.4901],childNum:6},geometry:{type:"Polygon",coordinates:["@@ʶUĊ¥ÈřĠ¯šĉômšīƒÑ¯m„wk¯ÇV°ÑƒżġĊljǓɱţǓ›ƝóX¯ƒɛÒóa@nÝÆôƜŚĉĢʉŰĊҙ¤ȗĖV¼ÅxWƞۂlXXèm„ÝmUnšĠƒĢóÒkƚ„ÆUÞ¼ÞJĸÑ°„ɲĕš°Ŏn"],encodeOffsets:[[114098,42312]]}},{type:"Feature",id:"1503",properties:{name:"乌海市",cp:[106.886,39.4739],childNum:1},geometry:{type:"Polygon",coordinates:["@@Ș°ÇīXњŗ@ȍlkƒlUŁ±īĵKō¼VŽÇôXĸ¯Ž@šťê„°ź„k¤„x™œ@Ĭ"],encodeOffsets:[[109317,40799]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/ning_xia_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"6403",properties:{name:"吴忠市",cp:[106.853,37.3755],childNum:4},geometry:{type:"Polygon",coordinates:["@@nLV‚@šVLšaÞbn@@l˜š@bUVlUV„zVx™¤kÞVèšXnš‚@nm°a@UƒÑ„@VŽXnV@Va„UšŽVKUUU@@U‚@@KVa@U²@‚wXkWnk„±lLnU@UmmVKnIVWnI@UK›@UK@@UVKXkmWLWUXmlkVwUyVa@w„w@aVI„K@aVÈw„KlLVV@LnV„VVnU‚ܲ°WÈIUÆ@nÞ¼‚‚@¦™@UÞUVW@UxUxVn„b„K‚b¯ÞU`VbǬ™V@XXÆVVl°InmnUôƒ°¯‚anam£œWVX‚KXmškôaVU@ƒVak@@wmaƒn@K@UÛUWKXUƒÇƒ@UI™b@alW@akLUKV@@Ukw±Iš›nL@kmwkWmk@JUIƒůVmnnU@m@UƒK„VKlkUwkƒƒnVUKmbkI±š—KƒkmVkKƒb@U@aƒVkUmn™`kIlaUK@UUKmbUIݚUa@mUa@aƒ„m@UUULUK@bmKkbWI@WXwlkXƒWa@k@kKƒLVkkK@L@JUVmzUKlwUUnW˜£XVlKUwVU@aXI@aWaUw@W@_nam@¯‚UkWVkUWaU@nwmJkUVkWVUmUkJ@ImbUaƒ@@WÅ_mJknmak@@mƒXƒaUV@„ƒxUšƒ„@‚ƒ„@VUnkVƒ@Vn@`ULUbWLXVW@kbUJ@XW`@ƒnÅĖWJƒ@—m°@xƒxšbnUa‚w²lƒÞ°xŤIVVULۂWbšbkVVXÆ`UbVL„@kx°LlV@Vœ„WbƒJn@bl¤ULV„°@lmL@ƒƒ£U@@aUwmKULVxUVVx@„™@kU™@mK¯LÇa¯@"],encodeOffsets:[[108124,38605]]}},{type:"Feature",id:"6405",properties:{name:"中卫市",cp:[105.4028,36.9525],childNum:3},geometry:{type:"Polygon",coordinates:["@@°@Èb°KnLš@lVš@@ƒUwVUUwVKnLVx@bV@„¤@„nK@k‚¯UƒVKk£@a‚m„IXa›ƒ@UkU¯Klwƒ@UKVaÅ_UWlU™aXa܁VKUUţJ¯w„ݱkxVbmŽ™a„w@wn¯˜„@XIÆĕ„m‚@X_@WVIlaX@WUXKVaVK@_Um„@lUVm@U„ƒ@„ƒV™„w@ƒVUÛwm@@W@ImKUkU@Ua‚aXƒ@wWaUKkw@UVaUamLU™nk@»±`¯@k—W@Ua™ykbƒI„„@VWJkLWUkJƒwU@ƒn¤mL¯wm@Umƒ²XVWbnV@bmxƒVkxUblLUV@kVWKU¼ƒŽkUƒ@mn@JnV@bUnmJUn@„k‚@XlxšLVVnKlLVV@š@LkKULVbk`WL@lkXW@kVƒ@UÞUlÇX™lkaUbmV¯@@L@šƒV@bkb@xƒlW„—bƒbW@—±@UJ@IU@mVk„VxV@@l„Illœn@Vm@ƒVUbl„@JLmKÛXmVkU›KULU`@LĉwƒKUX„lVUl@Vb„JX¦̼bÞxŎxɜĖĠ„Ŏaô@"],encodeOffsets:[[108124,38605]]}},{type:"Feature",id:"6404",properties:{name:"固原市",cp:[106.1389,35.9363],childNum:6},geometry:{type:"MultiPolygon",coordinates:[["@@Vnn@°xnK‚£„mV@„xlIXVlKXI@Uƒƒ„JlašzVbX@l˜°@²_@¼mlVšnKVbUb@VlxVLXb@xW„bVbV@VlnL@J@Xn@Üx„b„W@nl@nblmnIÆ`@X„@Vbna@aVUUWVkƒ@kbWakbU@VwšW@_l@nmn@@alVlk@UkmVak@@a‚UXaƒL@¯@KVa@axWI@KnkVaVJn_lJ@„X@‚m@nVanUVb@mXLlJ„VWnLla„VVaVX@KXVVkVKlknKVa@aVU@KXb@klJUknUmƒ@K@_UW@alIUamaU¯kJma@IUK@U„@@UW@@aXLVƒVJVaXIƒKlaUkUV@ambUUJkIWJ@wUI™V@JU@UwV@@Um@™nU`@UkUmVUxWUUV@aÅb@aWXkKUUƒUUaWK@wnm@IVU@aXwm@UmVaUalk@anKUwlƒUwlkK@wmaƒUkmmIk@VmkUUbW@UVUnW@kV@xkVmbVnU‚™@UbUV@a›k@kkW@„kLW¤@„nV@VU@W_UV™UU`VLUV@IUVõVULU@UUUJ@wmkUJ@šWI@l@bkKkbVVƒbVbUL@UUJ@Vm@@L@xbVVVLVlVwX@Vb@bmUkbk@@JWIUVÅw@Km@UkWKXxWLÅ@UVUnWK@xkVW„@KULwWVXVWzXVVKVXkV›V@VUbV@U„VV@š@LXxVL@V„b‚Ž„LnKVLVxXVmb@l"],["@@@J@aƒU@LWK¯UUxVVn@Ġ„„LUW@UbUUUa@KUX"]],encodeOffsets:[[[108023,37052]],[[108541,36299]]]}},{type:"Feature",id:"6401",properties:{name:"银川市",cp:[106.3586,38.1775],childNum:4},geometry:{type:"Polygon",coordinates:["@@šUšwVK@UVWÞUšbšw„V@knV˜@@KU_VK@K„ƒn@W_XWlL@Vn@Ċw@Ulaœ@Wanamī@aƒ»ŋó@aÆÅɲÿUaV_°ÝaƒLƒaUmVwVwX@VUVݚ@@¥Ý»@mVÅÇJ¯XÛ±VUmƒUmU@KUUkKƒLÇxUŽ@bƒLUJ@bƒx@xUbVzUxklWnXV‚KnXWlUL@V@ŽVLœ@VL@ŽmJUXmJULnn@VmVkKƒ²mlXWlx±@@VUb@L@@VV@VVUL™ƒVUbU@WmUƒ@„Ò@V¯bmn@VŽƒ„@lVnUšnVWŽXVl@¦VVUn@x‚š@‚XL@¦‚lXxš„Vb"],encodeOffsets:[[108563,39803]]}},{type:"Feature",id:"6402",properties:{name:"石嘴山市",cp:[106.4795,39.0015],childNum:2},geometry:{type:"Polygon",coordinates:["@@U¯ķó±ÇÛ¯™ķmbXb›@kb@Vĉxm@@UkKWXX`m@ƒ„@LULV`@L—@mU@lƒU™x™aÝVUX@VUL™x™VkLWVšš@J„nVLXVlŽUV@zl‚VL@V@b„„n@lU²WVLlLVbUŽVxUx@xǀL˜xôҜk‚K²ŽVa‚U@wXa@W™ÈĉUa@‚bÈk„m@¯"],encodeOffsets:[[109542,39938]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/qing_hai_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"6328",properties:{name:"海西蒙古族藏族自治州",cp:[94.9768,37.1118],childNum:7},geometry:{type:"MultiPolygon",coordinates:[["@@„V£°š@laœXô±źwš™ô@„Ulƒża܍n™Kƒw@U„aƒ™ša²L‚mÈLƚÈxlaUa„wÞmÜbÞUšnJ°a„kôƒ‚ÑkwÝVğwÇ@ÝkkV¯¥@ò„»„nŤ¥XImw@mVwša@Åw™mLkaW—wƒ¥l»kçƒó„»@ƒWÑĉŽğ@ĉ„™‚Ń„UwóřVómĵ»™™Ý@VǕ¯kšÝĊÅk™°ÓUklkU±šI„ÇÞkƒ±@šƽJƒ™@UġIk@W¦™VÑșÓÅnťKULnŽ¯X›ƒ@¯mUÛ@WřmóKknōbƒxÝ@ƒŽU@kw@ÿÇLţšÝUkšmwƒŽk™lċVŚU¦™ŽƒLkUWlÅÑ@aƒ@ÅѱUóġŹ¼ƒÈĉmŻ@@wkw™Kl¯U™ġ@—„lÇU™Ó¯_ƒ‚Waĉ²Åló¼VbknƒKǎÅ@ƧĢō°Ý@ğ„W™ÅxUUm@™‚ÝXۂW„ULUè¯@mbUaƒLƒbUWġxIUJWz™a¯b™y™@ōÈóLU`ÇXUl™UĉV¯n›mÛbǕLklƒUĉVƒšóaġ„ƏbġKţnkbÝmmnÝWȭȃŽÝXţWókUÇl¯U¯‚ġUɅĀ@°¯„„š¯„VÆnmJ@ĊķnóJUbÝXUlVškL@lVxnnmb@¤Vzš`ÞÞŤ@„VnÆJV„°b„UôJkzlŽkl@²óš@ÆÇ°kĖƒšÇbÛU@lmb™XV˜kzƒV™ŽɅĀXˢlń„ĬŹ@›éÅ@ĉńÆ°ğbUšlŽɜ_°‚@xŦ˜škbVbƒKĢ„ŤVŎŽ°@żÈźlĊ„ôKôb@nôxŦ„Æ@ôŽŎL@þÆb@šnnšWˌbÈx‚InaŎxlU@Ѳ±ƒğVUĢƒƨbɲ@Þ¥ôUUķWVô¯ĊWʶnôaŤˁ@£nmnIôŽǪK°xUXô@Ŧa°m‚kXÆÞVŎkĊ°ÞLȄôyVašIlwX°UVwĢÑÜKôw@nV@œm°nmŽn„Ü‚ɞ£VbmŽXnƒ°ÜÒ@xx@V‚b²UlbkxVnšJUnVVĊ°KȚm°nxÇnn¤±¦@ŽUXVV@„lV„„bmVVȁŽVxšÒ™°šIšbźaȃšbVwš@šƒVL„™ƾÑ@ƒŦô¯ĊkôÑ"],["@@„@šƒ„@n„òVœa‚w²bVxšxÜaČVô_ĊJšIVmšL„a°@Ŏ¥XlK@ƒšk„l„KVbUb˜@nUĢn‚aÈ@lmǬ»Ġ¯œn‚mnƒƨVy™Ñǖ™Ġ»ɲInŽ‚@@ÅĢƳ@¯°™ôV„KÈbVIÇ¥¯@Ýó„™@ÑnīWKšƒk™‚k@¥š™¯™Åa™Xƒ±VÅw@±Ġ¯@»™š™n™Wmw@ƒ™@¯ƒVƒUUWçƒKĉ„a±VkkƒV¯w™x@šUJ‚x@bknÇb™mÅ@Uw±U¯¦UŽ™Kmš¯I¯Žť¼ğĊ™@ǃŹÈ¯@Ý»ÇnˡJƒbÛèÇnƒ„ÅK¯„ġĠŹW¼Ålm„@¤n²ƒŽÝb@b„š¯lƒ¯@ƒšÅ¤W„™¼nV@x„„°@Vx„@lbUblbX¼W‚œšÇ²lšUŽ@¼ŽV¦@bÇlVxUbVxÞbVšœbm¦ƒVV„"]],encodeOffsets:[[[100452,39719]],[[91980,35742]]]}},{type:"Feature",id:"6327",properties:{name:"玉树藏族自治州",cp:[93.5925,33.9368],childNum:6},geometry:{type:"Polygon",coordinates:["@@ɆÿĢV°°VÈklVôŤXÞW„ȮÇÞXnmÞnlaŤmĢLƐaĢƒôb„™ĊU„VlkǖKÜaœn°mĊUšVVkÈWV_ôKŎǚ@šz°ašbXyVI‚JĢwVX„a„KVbna°@VçVKXƒÜÞWšn@VVÆwXšĠƒÞ@Ŏ¯ƨġÆ@ȍ„LlmUaô»ÆkĊ±Xb„°`šÔV‚kȘƒĢ@Všk°šLlx@xż@Ċn„Çź»ôĢ²VÆ҄@@bÆÒXklV„KšV¥Æ™ČUšk‚l„nxl™çƒ¥ċç@±m¥ƒwÅJƒ@™™™Vƒ„mÈIléÈa°U¥™™@kÞV‚K²ÑWƒ°w²Ñ‚K²ñšyƐ„ÝšVmw„»kkWĉ—JWUƒVÅwƒL™mÅ@@ƒmw„kn¥Vу»°™°@@»„¯„Lla„JônV‚UůƒU@W¯Umѯ¯k@WykU@¯„wV¥ƒkVwţƒk»šwWǜĉĶçšK„ƒÞ™ÇaĉbƒI™lUƒ@kwƒWƒXUƒ°w™±@UšKn£Wĉ—KWxƒkĕVƒšamwXw™@™„Wmnk@aƒVkƒ™bĉLƒl™Imm„wUÇ‚Wx™nÝJn@¥Æ™kwƒaXƒÜĉ™¯ÅV¯¤mkƒx¯kķܙ²VWôŹVUƒƒ@V£™¥@ƒ°wn@™m@¯@UbUôķŽmn@ÆÛ@ÇýVaUÇĊVƒ@Çlğ—¯xÝŤ™lVÈÈVƒx„ƒ¤Vx™„kK@™@ƒx@„kVƒĖġ¥kIWbXŽŎx@nƒxÅUW`ƒ_—@±ŽUa™LUxƒK¯„WbkVlb—bmŽƒLÛÆWIUwƒWkwÝV@kI›ŽéUb›UUk™V¯Km¯k@Umݐ¯m¯›m—L›Þĉ‚ÛUm™ġ£UxkKm°™Lw›šk@kšƒVm„ƒKVUk›@¯a¯Ģ™móKUU™x™ImlÅn™™ÇbXèVVU„°„@ŽšŽ@„‚xXnmš™ššŽ@¼ğ°@²ÆxU‚„²šWÆb°š™š@¦llš™„XLmĬ@҃šÞô°@ȦUJÇaƒLóU¯š@°ġƴ@Ɓ@mɱJğ¼ǕššÒUzƧ‚m„n›mğ°ǫ¼knÇ@bġmmV—@VaUaƒLƒk™l@„kLW‚ō¦¯@ƒb™KUn™JĉIó`ċUÛb™wUw±ax›bñUmƒƒ@™„ƒ@—bƒaƒbǏÅXm˜„ƒÝ„ÅôVbގ™bl„UšÞVޚ„U‚°„VUxƒ@U„V„@l`™¼nL@Ċ„LW„„¤kXķWġXUVVVķ„UbVb@°kVVxÈa‚@ȦĊbšaźJ„U@Ț„„˜Vœƒlš@XkôaWƒĢ™Þ@laĸUÆb²mÞLĠ™ÞÑôbšÒĊa„JVbm¦"],encodeOffsets:[[93285,37030]]}},{type:"Feature",id:"6326",properties:{name:"果洛藏族自治州",cp:[99.3823,34.0466],childNum:6},geometry:{type:"Polygon",coordinates:["@@ÞVŤ™ÈK@ĀlxV@„Þ@„wŎalmôLšnXÆÜ@nV‚°@œ„°WmVKŦLÆmȚԂҚUX¥l@ĢJVš@„ŽƾI@w™W°™™Ån¥›kÅÝVwôƒÈç„@lÑĊĕša„JnaÆLVw°kny°UnkÆVȍĊll¦„Vƾ@@™nUźƒÈǂIn°X„wÞKô¦VWV£„@£°ókċ±I™™am¯Va™»ČĉV¥°™@m„k„¥l@„Ċm@ašU™mwXƒ@wÆxšmĢ_„`VnÆbšKVw„@@ƒnUVğVmVVöIlŽl@@çÛmƒ£UDŽw°@VUƒ¯»m¯ƒJōĖÅLƒa@»ĉĢ±`U_k`ÇçšóƒkX™lK@ƒakÝރš£WċkÝ™kxƒJݯÅw™xķxmIÅx„@k±J@ýŋš›¤UœkŽmV™°ÅÝxkwmġƒnÝVU„š¦ƒŤlmšóXk¤™UKƒç™@mVkK@klīƒ£mš¯VUbƒW¯¼ċb¯ĵam¼mVX„m@k¤ÇX‚ÇbƒUƒ„¯J¯„¯È@˜™bVXVҙ¤V¼kxݚV„@l‚V—„WxÛ¦Wš¯šmKnlŽkŽ‚šU‚@nƑUĉ„Ý@ǺۄċUĉ¥™UƒÞŏ™z±òL±Ò¯xX„±ÒLÝU@lššV¦¯‚ÇbkêÇJƒnU„šš@š„‚ÆI„xn¦‚‚@²Č脦‚è"],encodeOffsets:[[99709,36130]]}},{type:"Feature",id:"6325",properties:{name:"海南藏族自治州",cp:[100.3711,35.9418],childNum:5},geometry:{type:"Polygon",coordinates:["@@VxƒŽńƒš@ĊĠŽĊXÒ°UƾĕÞm°£nb@‚@LUUW„Ûº@nlÆǬšĠ£ÞV°UXb‚VȂǵ„éƒ@kWanm°@™x„z„K°¯ĠVšƒVƒkw™Lnm°kÞxÆa„¥@‚wnĉƏ@™œ_l›š_VwšmĸèŤÅČU@™˜Wn@ÑmKU™nğƒK@ƒ°¯UÿV£nmšLl™„UƒUÛé±óókkmƒnƒakV@Ç°óÝXƒWəÞťIţxmm™VÛUVȂÓnWyȁĉkƒVš°WnkĊa„¥‚_œK°ÿWna@ƒmU¯wƒlÝIU¤UXó¥ÝLƒx¯WmJÇÈŹ„mV@šƽ@ƒUk¥ĉkċŽÅUml¯Vmz¯lUxÅKmbƒI™bĉĖk҃@Çèó„UxÆޜlm¦šÆ¯ššX@x™Ž@Ž„²ÝlƒÈ™JV²klVl¯ÔlšĉƙްlUǖÞ@ššĶ¼nŽUôôŚ"],encodeOffsets:[[101712,37632]]}},{type:"Feature",id:"6322",properties:{name:"海北藏族自治州",cp:[100.3711,37.9138],childNum:4},geometry:{type:"Polygon",coordinates:["@@ōmġxƽUm±Lǿþġԙ@kxmWƒb¯I¯‚mIUx@bƒbŹVǎƒkĵbƒlĉI¯¥ƒUšm@ƒÆ¯È@šašóšUlƒČ»@w›œ»›wXaƒƒó°ţç݄kUƒaV¥ÅbÝw¯lmnšKlxU„™„ğU¯°ƒLƒyšw¯@mnXb‚l„@ƒêȁǶUWa¯VÝUğ¤ǫ™kÅ@mܹXƒVV@K@ma¯¤ÝnƽĖ¯V@„ƒ¼„ôlèk¼„¦˜xXŽlbnKšÆx@Ž™bUx@nnxWJţ¦ƒmƒ¼ñ@Ž°¦lUÞlÈ@ĠxÞUlxÒó„ƒl¯bmI™ŽÝVÛaÝnƒxVbkbÇwřÇKn±K™b„šƒb@V„xšLmŽÛŽŻbk„ƒVó@™šŹxó²›Wkb™@¯U¤ƒźĊ@lUX„°lÆôU„ƒlLX‚aœV°wšxUb°xÜôÈKVkÈmlwškÈKšwšK™™VUŤĉŎ»„»„Il¥na°LV»²¯Üy@wĢƒ°ĸwlwĢw°±„_lVkš@°ƒbƒÆ¯zƒ‚„š„@l_„@Ģ±lŚVlUaރ„LVƒnKlnȏ°IllČa˜wÞÑ°x„UU™@wƒVkmĠLô»„KÞýôaÞ¥ôĀÞmƁ„™‚mUƒŎV¥Èl°²°a²¥V„@@w„amm@Ñn@Æ£żƒVƒĠ£@W„¯Þƒšl@š»@Uk@"],encodeOffsets:[[105087,37992]]}},{type:"Feature",id:"6323",properties:{name:"黄南藏族自治州",cp:[101.5686,35.1178],childNum:4},geometry:{type:"Polygon",coordinates:["@@ôl²ôÜê„VƒVkš™KmnU¤VĀ¯°@„„LmĠVšnLÈL@alb@al@n°Vš_XmWUÈamaVIn@n‚aV£œóVWƒ™U£°ašxÈ¥@™‚aĊwȹ@óša™ƒğbm@k„w@mƒaÆw@ƒ„In¯mmƒ@UkkWƒÑÅ@@kċÅçVkÝJÅkVykŹl¥@¯š™ĢU܃X¥òý—mmX™ÝÅlmU@£™Wly™XW»Åbƒl@aI›»k@klm@UxUUƒVƒ¼¯Xƒl™aUnķ‚ƒI@x™@¯„ƒK™„ĉUU`óšlČ¯ô@¤ƒÞJ„k°xVŽ„n@ŽmbXŽ¯Ā›L`ƒ¦ĉbml¯X™ŽUŽl„ȂĊXzm‚ȁÔU‚ÜVšUnnŤwŦJɚ݄XÞW¯ô@ÈlU„b„mln"],encodeOffsets:[[103984,36344]]}},{type:"Feature",id:"6321",properties:{name:"海东地区",cp:[102.3706,36.2988],childNum:6},geometry:{type:"Polygon",coordinates:["@@@҄bš¤ÆI°ôU¼š°UŽnnWx™š@b¯L@lUUWbXxWl„ƨnxVUllš„XVŽUŽnL@lȀý²KVnƾ‚ĢwV»ƒ@mÞ£nÆƒÞÑmL™ƒKUaVżĕƒWVk²ƒƒÆÝ@ƒXw°@„ô™@a°wóUUmIk™™aVmÞwmknyƒ¹VÿƧnŏm£X»˜™naV±„Ýw@ašb@aƒm¯„ĉVó¦kÝWKUU@WanU™b@ôǺĉxb@šÇ¦™w¯bV¤„šUX›ôU¤bmm@UJnbÇbXVWn™`¯Umk@@bka@bÇK"],encodeOffsets:[[104108,37030]]}},{type:"Feature",id:"6301",properties:{name:"西宁市",cp:[101.4038,36.8207],childNum:4},geometry:{type:"Polygon",coordinates:["@@@kmKVUƒWk™VkUmwƒƧXkWwXaVV@k°K@aš™XwmmV™¯V»¯óÅJ™£ƒamŽ—X@šċVţÆķç™nUx™`kœ›`@šÅmĊx@Žƒ¦U¦„blVރŤèô¯„„Wbœx›¼œŽ@xċ¼k„™V™ô™bÇ@Å°@„™n„V°¦ĊJ„kĶa„lȍźU„a@aVwnJ°°J„anXlwš@ĢÓ"],encodeOffsets:[[104356,38042]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/shang_hai_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"310230",properties:{name:"崇明县",cp:[121.5637,31.5383],childNum:1},geometry:{type:"Polygon",coordinates:["@@uŏu»GPIV±ÐɃŜ{\\qJmC[W\\t„¾ÕjÕp‡nα|ěÔe`²„ †nZzZ~V|B^IpUbU†{bs\\a\\OvQ’Kªs†Mň£RAhQĤ‹lA`GĂA@ĥWĝO“"],encodeOffsets:[[124908,32105]]}},{type:"Feature",id:"310119",properties:{name:"南汇区",cp:[121.8755,30.954],childNum:1},geometry:{type:"Polygon",coordinates:["@@`y”ĉNǕDwǏ»ƒÖLxCdJ`HB@LBTD@CPFXANC@@PGBKNECCBB@EBFHEDDDSNKAUNBDMNqf[HcDCCcF…@EFGLEBa@ACoCCDDD@LGHD@DJFBBJED@BGAEGGFKIGDBDLBAD@FHBEF@RFDMLE@SGANFFJBANPH@@E@FJjRIACDMDOEKLFD@DbDAJI@AP@BGHFBCBGDCC@DCA@CECGH@FKCEHFJGBFDIHACEDNJDCVFBDCRKRLDLITB@CjNJI^DBCfNVDHDFKHAFGDIICDWBIF@@CFAjFJNJBBHD@CJ@AEFJ@@DH@BFBCPDBMFEQGDIFCNDHIP@HDABFACBJFHEBSZC@DP@@JDBƤ~"],encodeOffsets:[[124854,31907]]}},{type:"Feature",id:"310120",properties:{name:"奉贤区",cp:[121.5747,30.8475],childNum:1},geometry:{type:"Polygon",coordinates:["@@~T~JjZdDbLXDLCB_J@@FHFZJJIAGH@HGR@BENBLID@@LFCDF\\FpDBDb@FAHKFE†@dEDDdC\\GreNMACVMLBTMCCFCEGFAA@DAFDLMHA@OD@BMEWDOC@AS@KGAI_DcKw„ÕísƝ‘åĆctKbMBQ@EGEBEJ@@MBKL@BJB@FIBGKE@ABG@@FMFCPL@AjCD@ZOFCJIDICIlKJHNGJALH@@FPDCTJDGDBNCn"],encodeOffsets:[[124274,31722]]}},{type:"Feature",id:"310115",properties:{name:"浦东新区",cp:[121.6928,31.2561],childNum:1},geometry:{type:"Polygon",coordinates:["@@EN@JJLNHjLJNR^GRYVBNZJRBV@PDvbLNDN@LGNER@nCNQNuT_TIVFV\\Z\\XnDrI|[Ʉś²ÏJUHOƣ}CA@IO@@CYDATGFIEDAEBBAGCO@GJMCEDCJRHEFANOCADAEG@@CI@FE@BDIC@AGIAIMiEEB@DE@AJCXJDCJEHGBELGCUCeMAD]CIJiM@DSAKJKCLQDQACUECDMIFCBDJGECHAEIWCK@GLMCCGEACNKCEJG@MMBMC@@CIJUINT@JAJSTEPZZCP"],encodeOffsets:[[124383,31915]]}},{type:"Feature",id:"310116",properties:{name:"金山区",cp:[121.2657,30.8112],childNum:1},geometry:{type:"Polygon",coordinates:["@@L@BIHFN@@EE@@EFBDGDAADVDD@@EF@CA@IIsRE@GDAF@BF@CV@|FBCHBLCNHAFCADBMDCFZXHILBVEEQA@MWFARJJ@DCX@@TEFBLHAAERE@AJABRPBNK\\BrJ\\VHGND@CNADKDADQjGAGNC@GJ@FCFFHC@JF@@dLBDSFADHVG\\DTEPDDHJALIJkJDJCDIPE@YDCBiK@DONE@EH@BAF@HLJA@EIA@ALKNA@@FIFAFHR@NALadsæąyQY@ƒA±DʼnXUVI^BF@FFF@HBJEDFFGFEBSRkVEXGHFBMFIVW@GAEEFOIAIPKABGWEKFSCQLQBSEIBC\\FdBLRR@JGACFDDEF@AWB@LJJYNABBA@CUEGPaO_AIE@MYMFIGAEFECHSAAKAO\\[JEDB@E@MMA@@AGBKMGDFFCDDFEDFJF@NPBAFLHFH@EDDHBADDC@DDCDHHCDDFDABDAD@FEFOBCJ[D@HEDDNJBDDHABJIBBvGLBJAH"],encodeOffsets:[[123901,31695]]}},{type:"Feature",id:"310118",properties:{name:"青浦区",cp:[121.1751,31.1909],childNum:1},geometry:{type:"Polygon",coordinates:["@@RUNKdOFDJCbRFMLAHPLDN@JGL@@APBWYCKN@TU@SHGCEJIDIJKVIZVNM`iNY@CIE@CA@KBOEGEUFCCSADEIEFCDDDIDDHC@CKIeDCG@IG@DHWFEEGCH@@GO@@O]CNpeEQDBFME[JC]DGF@CKOA@QSB@GB@@GW@@ED@AQIJIAAFE@@DO@CFI@KNG@CDACAFEGKGBEGBDCCAIFCCLIECFI@MBCLDHGNAHSF@DMB@EEKBA@@C]DEICFG@ADBHGFKCDAKKHKD@@FHGAANGEEFCHKCECBCKG@ADKCNE\\[A[I@@mGBDQQEO@BCE@AI[AML@JGACLOAFKEMM@EQKC@CUCBCCBCHEA@FF@@FM@GEAJK@GNF@EXPH@FD@M^@HIADJCFDBER@DK@@DE@CAKFOCCBDHIBCNSB@GFC@GQEEOWFICGDUAEJIDBTAHJHEB@DIF@NE@H|HBDBEH@DKBAHEF@HEEUB@FGFGCCCE@AHOB@NH@PRLVNNFBX@RC€PbAvMtBfH@DJF@ELBFA@EH@HNED@FFB@HLC@CJ@@DJ@PIRf@HE@CFF@GPHD@DKE@FFBEFFD@DEFCA@DD@IjCRFBAHFDKD@HF@@PM@H@BlbDJDBFEF@DLXB@HCD@@IFCBIFEJD@FDC@FBALLF@PAACJERACAJCBD@EL@JD"],encodeOffsets:[[124061,32028]]}},{type:"Feature",id:"310117",properties:{name:"松江区",cp:[121.1984,31.0268],childNum:1},geometry:{type:"Polygon",coordinates:["@@@DLDFRN@FNELPBDKHB@INK\\BBJF@ADP@RFCRHA@nJ@B\\[\\MFLDBCH@DLDADFGLEDFFMHBBGH@EC@GLLLCBLDHEAGBCH@DEFJ^C@DB@LAFFA@CNE@GTMBGHKCAD@NEJFDKJDDJEDBCDHAAFLHFHBEBDDCH@LMJ@DEP@@CF@BEJBJIBRC@@FX@@HA@@HTA@RPBDLE@CHD^\\INFAERCfFMo^D@PP@@HG@HDFFXECGH@@JDHfCLJ@DGDCCCJCCEDJFCFTBDDVEHFPFLAB@NBFCFKFC@CHIACNOHWHCAAFIDD@CDAGEI@ACFMF@R@R_@GQED@EGFEQEDE_IAHKAEXCQUOQCUDEN@ZI\\DDmAMHCICDSOC@EG@BKHIGMIBCGOCSF[CUHCGEBCTKA@cE@@IGDEEEDI@@HMDBHiHCRCBCLMB@DMCGH[UqI[AMLOAAQIB@BQFBFGBAKFE@SW@CDI@QIEBNXB@FRUFKAGJYWDENCCADBBEMGKDGAAD{EU@@DAEE@CB@HQFJt@JDBE@@FC@"],encodeOffsets:[[123933,31687]]}},{type:"Feature",id:"310114",properties:{name:"嘉定区",cp:[121.2437,31.3625],childNum:1},geometry:{type:"Polygon",coordinates:["@@F@LI@IDKJADKIEJICADGACFECCJ@HKCAFOHAJI@aCBEE@ICAEB[GFGCKL@FGEIFADMLCAEJM@ELQECEIG@BE^QKKLQCA@EHBIGQ[GEHOMGGDHKH@JOECFCjCBEFDNCACMBCILGTABDLEEOEIG@GFIMM@CGKFBFCDE@@GEAGEEACIcGaHMFITIHDN[AKF@FS@OA@BK@IHM@KCGOKBENaQIDECcPMLQVFHFB@BFBKLGD@FAJOVGIACQ@A`LPCB@JEF@RU@ANS@@RCL\\HIFpRBFRBBDKLLDADJDGBFDABHBEDNF@DGBBBADKDAHC@\\JJFBDEH[DEFDH\\LX@XLBLbT@DNJLDCEL@VJABJNDHB@HBHYFBAA@GNFB@@AFB@AFABFLFBHFCL@HJBAFBLC@DN@HN"],encodeOffsets:[[124213,32254]]}},{type:"Feature",id:"310113",properties:{name:"宝山区",cp:[121.4346,31.4051],childNum:1},geometry:{type:"Polygon",coordinates:["@@ˆmÖoÖiƒ½[s[YEUJU`SCIEBCCWJY_LIICDWU@@FaBCJIB[ICH[@@CDKEE@MK@@IMCAEBCH@AMFI@SMGEFGB@FK@BHCAIFJNQD@FEBDFMBKGACG@ECWH@@CDDTOEEBGEK@GC@EE@GPHFR\\JHGA@FDBKRLL]RAFH@FJFDKR@FINBFKDCNEBFJEHK@DLEH\\HFADB@JFFDA@bIJGBEPDBGLI@DDEFBDCHDBIJJFCLIBCL@JKJE@ADHDBHJ@HIBBDFHBBAEIJ@BJFAVL¢ˆ"],encodeOffsets:[[124300,32302]]}},{type:"Feature",id:"310112",properties:{name:"闵行区",cp:[121.4992,31.0838],childNum:1},geometry:{type:"Polygon",coordinates:["@@T@@ELE\\BCMJGJSNEbGdHDJFBJAFIEIFCEWG@@gMENSFCVJFAxR~B@IH@AIiI@GE@FGEAFQPDRiV[\\DFSGMHAXHDOMCJCDETBBNVJJI@DD@ANNNH@FILDDMFBDHNDHKL@XDFGLD@EHGFD@DDB@CDDHCDAEAHG@ABOJ@BIaC@CECLKPFNCDCJBiQEIF@@@OGBMIAEEBMTHF@NKEC@QFEGA@EBCKAACHCLJHEFHHB@AFCAIEACIC@HG@KCCDC[ECEED@KC@KJMAAFQ@GHG@BHIJYIGE@EI@A`KDWCaKcCiY}I}S[CYJM@CFDVPRRVWDFžLBBG`JCFRFEFFHC@RF@HQ`Q@E@ENBDJ@HFCB@DCCEJBBGDGXMPBDGJ@DEDELEDMA@DJF@DMZ_jMNYUUJILCJIJDFGH@TSVM@DLXZ"],encodeOffsets:[[124165,32010]]}},{type:"Feature",id:"310110",properties:{name:"杨浦区",cp:[121.528,31.2966],childNum:1},geometry:{type:"Polygon",coordinates:["@@V@CXJDKJZ`XIDDFADJvSRMDM@mFQHM@KCMKMuaOCU@BDAJSX@HKJGD@PNJCJWAGT@R"],encodeOffsets:[[124402,32064]]}},{type:"Feature",id:"310107",properties:{name:"普陀区",cp:[121.3879,31.2602],childNum:1},geometry:{type:"Polygon",coordinates:["@@F@@FHDL@HFFAPFCSDC@@XGFDH@BDLHNACEFA@ERCIMJEDBAGL@@EHAFENHHJ\\ONQBQCIBC[MKACKI@GGGH@I_G@CW@[DMHCDIBMTDHN@JNHEH@FJFPKFACSBKHDJNABDMDECAFiDEDFDIPG@GLHCNH"],encodeOffsets:[[124248,32045]]}},{type:"Feature",id:"310104",properties:{name:"徐汇区",cp:[121.4333,31.1607],childNum:1},geometry:{type:"Polygon",coordinates:["@@RADL\\NCPHFfLJaJ@FWLGMGIK@IFMDOYYFOTSBI@IMSAMSACFIDNDCPWGGBHNET[CU\\QjOCERFBEHF@@HjJBJG@@J"],encodeOffsets:[[124327,31941]]}},{type:"Feature",id:"310105",properties:{name:"长宁区",cp:[121.3852,31.2115],childNum:1},geometry:{type:"Polygon",coordinates:["@@HFFB@HF@DCAELENSJADCNG\\CX@@D`H@JHGHHJ@BINBFUGEDO[MCKQB}AwQEBUIEDMTNF@hH@FXEDFJEJIB"],encodeOffsets:[[124250,31987]]}},{type:"Feature",id:"310108",properties:{name:"闸北区",cp:[121.4511,31.2794],childNum:1},geometry:{type:"Polygon",coordinates:["@@CSG@BQGODUPWTOBQAAFMECKBGEMFKEOHADDJARMR[PGI@TEJBNG@ADBFND@JL@@NFFCL@D\\@DG\\JJADI"],encodeOffsets:[[124385,32068]]}},{type:"Feature",id:"310109",properties:{name:"虹口区",cp:[121.4882,31.2788],childNum:1},geometry:{type:"Polygon",coordinates:["@@bA@E@QHSXBDIMI@OHCLI@GTWBIACQAYIOFGCENBBARSPOXCVHPARH@DT"],encodeOffsets:[[124385,32068]]}},{type:"Feature",id:"310101",properties:{name:"黄浦区",cp:[121.4868,31.219],childNum:1},geometry:{type:"Polygon",coordinates:["@@NEHFLAFDHDPEAMZUHQQ]IMKJG@EPERABHBGRUCCNGV"],encodeOffsets:[[124379,31992]]}},{type:"Feature",id:"310103",properties:{name:"卢湾区",cp:[121.4758,31.2074],childNum:1},geometry:{type:"Polygon",coordinates:["@@VDHQGABAFQFOH@LIiKKHEXI@IbAFZB"],encodeOffsets:[[124385,31974]]}},{type:"Feature",id:"310106",properties:{name:"静安区",cp:[121.4484,31.2286],childNum:1},geometry:{type:"Polygon",coordinates:["@@DLLB\\NPGLFHUDMYABEeKEVMAAJ"],encodeOffsets:[[124343,31979]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/shan_dong_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3706",properties:{name:"烟台市",cp:[120.7397,37.5128],childNum:9},geometry:{type:"Polygon",coordinates:["@@ŤLšLllVń²è°xżĢĠÆl҄šŤbœ„V¤ĊXnŽlĢVĊ„Òš„È°ĊŰÞè˜L„±@џn»VUźċ²»ÆkôVɆkĊŃ²kŤVVwUUVmUaƒ@KkU@ƒmUmmk@UwUkmW@UVIXa@ƒmw@a™KULƒaƒx@Uk@UbWU@yULmK¯@kXƒVUwm@@JUUknWKUVƒLUbU@™wWykIƒa@w@mUI@ašUVynIWa„k„@@W„bl@@knmƒK@wnIl™°Kna@V¥ğ@ġUķ»™¥@UōJƒX¯¤k@™wmI¯‚k@mwƒak@@šlX@bUJ@VƒbknWxkLkxlŽšLVlkLmŽšb@bU@ƒbU@VbU`Vb@n„L@Žmb—U@˜VnUVmnU@mm™@kIUWVIUK›VkkUJUnmL@VmLUaVWaXamU@™™U@KUUmVƒU—JƒU™VÇwğn™mƒ@mXĉV@l¯xnô"],encodeOffsets:[[122446,38042]]}},{type:"Feature",id:"3713",properties:{name:"临沂市",cp:[118.3118,35.2936],childNum:10},geometry:{type:"Polygon",coordinates:["@@˜bXlƒl@zlV@lXXmŽkbVVlš„U@Vn@@Vmb@XšKšVX„WJ@XXl@„‚ŽÈbVLšUl`„@XXV@VVUxVbUxVbš¦„@‚WnXVJ@bnVUzl@„°Æx„U„KlU@mUUnUlUVWVUnVV@XX°V@Všll@Vk„aXVl@Ux@bmbXLlKlb@b@bUJn@@„„b@n°x°K@an@@UlLVKVbXb@bVVnK°LVa@UVa@™Xw‚KVxnLšU°@naV@UWUkWƒULmV—wÝKUUla@aó_@mƒK@aUU@ƒWUkwVm@aVI°W„@@IUw@a±¯@¥kUVUm@a‚wkw™@ƒK@kVKk@maXalI@alL„WXblaVLVU„V@LnKš@„l@w˜aXašLlnUl„LšmV@n°J@_VmnIVym£UKmI@WnIVm@anUVmÇ_kġIÅWUXÇm@U@ݯÅ@ƒ™@naWƒ™IVW@IkK@klKn@naWIƒmk@ƒaƒbkKkLWn™WkLWmk_ƒ@UaVƒUKmLUw@mn£WwUmU™ƒaóV@UkUm@UKULUwmJUX@WW@XҙzVblJXŽWXk@UVWK—X‚¤UL@xU@ƒ@ƒVUaU@@XmVkLmWkXUyÝLmKXnVŽ@n@l™x@bWLnVVn™`knULmxUl„„WLXŽVb@VƒK@z¯x¯¼Wx™KUn@bk@ƒlƒVVVz"],encodeOffsets:[[120241,36119]]}},{type:"Feature",id:"3707",properties:{name:"潍坊市",cp:[119.0918,36.524],childNum:9},geometry:{type:"Polygon",coordinates:["@@l@@UšK@Ž@L@bX@@VlL@JƒLUVnX@`ÜXn`V²mJ@bU@@n„b@l°xnnĸVƚ°@„ƒĊ£Þ@lWnÑnkʶJmó°w@kk»V@»ƒ¥k@V@kw@wVm„a˜Å„mšaô£ŎƒXI@mln„Kla@mV_UKƒ@kUkw@alW™IU»™mƒ—@WUIl±UUÅU›bkJƒ@a@wUKUaVIÆmXIWaka@m@Ul£XKVw@ƒUIƒJUkmJ™ƒVkU@a„ƒWK—ImVƒ@UxmL@bX`WXU@U`ÇkUak@@°UblXk‚mLUKmL@VULóƒƒVk@@Vlbn@Ub@ċaUJUbƒIUlVLUVVbVKX„VlVXU@mb¯@™VmKUwLWx@šUb@VUb¯KmLUU@aWaUaULkK@Vm@@b¯L¯w@mƒa@ƒm@UUU@U¦lJUXƒVƒmkb@nm„XVWŽkb™IVxUV@VUbWLXVƒLW`Ux@nk@Vn@x@VkJ@œV`mXkŽ@V„xV@lVššI@VULš˜VU„IV`°bVXXx„V@VWVnL@xV„Ub"],encodeOffsets:[[121332,37840]]}},{type:"Feature",id:"3702",properties:{name:"青岛市",cp:[120.4651,36.3373],childNum:6},geometry:{type:"Polygon",coordinates:["@@„@nU˜JXLƒ„@blVU‚š„nIVl„IVJ@„UxWLk¤@V@nlbXbWJÅnUJVbVL@x@b„ŽlIœaÆVVVk²VJ@X„˜šnV¼šJkX@blxlV„@VLU`@nkbƒLkm@nWJō„ó¤™bƒn—ƃbUn@xlxU@l@„¦@¼UŽl¼ĊUnW„@šnĠmÈxšU„V˜I„VnUVV@LšV@šnVWbXb‚UVbnK@UnKVmVIllœUVLUJVXlJš@nnV@nmVUUm@—˜Vna@ƒK@mUaV_UaV@„aV@@a™anlKUk™KklwlKXwlm„a@UVI@akW@™l@„bnxl@°nJšxl@°£„WŎIUÑn»lašmô¹Ŏ¥VaUUkƒmkġWɱIUUŹ`›@kk@ĉƨřV¥_Ç@™Ĭƒ¤ÝL¯m¯£ƽóķwUW±ī¯kōaĉĕ™kğmó°ƒbW@UKkLUaƒVmz@V@ŽUxVn"],encodeOffsets:[[122389,36580]]}},{type:"Feature",id:"3717",properties:{name:"菏泽市",cp:[115.6201,35.2057],childNum:9},geometry:{type:"Polygon",coordinates:["@@@¥šIVUÈmÞ»@UlU@Un@VW@UVmkk@aVUUKVÝ@UVknK@UV@VVnIVƒ@wnƒmwmKXaWaXI@UV@Vy²blkVKkam™U@kb@Um@VmUkmƒKmkXKWwkU@Ulƒ@UnK@UVUUm‚KXwšUVL„w‚K„U„@@Wl@@wUkV¥—@@I@W@_V@VWUw@UUa@aƒaWa—@@_mKUw™l¯amzmV—@WK™nU@kƒWLķaUKbÝVmV@UWÇbÛ@ƒX™°UbW@XŽm„Vlk²UJUbmLÇxÅWUzl‚¯Ll„@VkK™XUbWJ@bU@¯@™ƒkbƒLmKka™„@l™_WšXºVbUz@J‚n²V@¤lX„Ž„nV°šLn`WbXLôVlKVUšxXn˜lXLlU@bVV@„XJWLUVnVV@„„@n‚l„°nn‚V„KÈbVXÆJU°VnXV„kV@@xVL„@šWlb"],encodeOffsets:[[118654,36726]]}},{type:"Feature",id:"3708",properties:{name:"济宁市",cp:[116.8286,35.3375],childNum:11},geometry:{type:"Polygon",coordinates:["@@nam_nKlVLXa„Il`š_@KVVXI@m@w‚ƒ„@@k@Kšnô@n`VbV@@L„L@KVVn@VX@‚VL„Jl„š@VUUƒU@Uam@Uk„wšKWaXamkJmIUVUÈblašUnV@kVKl@@lXL°kVJ@VÈnVJUX@V‚LXl@xVLnU‚@VK„V@a„IUaV@„bĊU„x„K‚kVJXUlV„ƒ„UVašI@WUI@KlUnw„mWk@WXIWƒ™U™L@Wna@Um@@UƒVk™UUlanWW@kkU@y„kWk—aWVUlÝbUU@kƒJUIU@@ƒ™JmaókƒLKǃUUkKWLk@WbkUUaƒbmKn¯°¥V@XwV@VanaVaU_@Wlk@WÈ@VUÈVVۂm„aklKȯlLVUX@lK@aX@@kV@VmV@VwnJV_UWUwƒX™am@kW@wVUkKVIUUVmU@UV@IVK@aUL@aƒV@Lm„UKmx@ŽômLkUWJ@šnXmlUxUL@Vkn›VUšU„@V™L™`Ub±LkV@kUKÇbÛ@ƒU™Wó_mJƒ@Wk@@Xƒ@ƒVLƒxUK™VWxLVnUV@VmL@Vk„@VlVXxWLnl‚Ln„VlUnn@@VlaV@nšlbULkl±aUzU@@VWJXbWbnLnxm„@xU„mJUUU@@VmLUl@VUÞVLUV@bllUn@VUXm@@VkV@VݼÇnUV™J@¦nnƒlnVlL@„Þb°KVV"],encodeOffsets:[[118834,36844]]}},{type:"Feature",id:"3714",properties:{name:"德州市",cp:[116.6858,37.2107],childNum:11},geometry:{type:"Polygon",coordinates:["@@„¤@VmbVXnVVbVJššX@Žll@z„lVInl@„@bVxUbĠ‚l@Èbla„IšxXVWb@L™@n‚ULWVXXšWWLnL@`@LUVVL@lVn„JšU@UUk‚a„™nš‚Vôô„b°¼V‚ސXš˜‚œIÜbČa˜bôW„XÞWÈzÆmnLVJ°ÈnlV²lbnW@™@UƒUV™šmnwmkkKWƒkla@mVIUKUa™aUwmn™JU@@amIk@@bVlkX@mmUklUUƒƒa@_UaUUƒV@wƒw™WkXmW@I@WUaÝU@UXaWUU@UUVW@UUUWUn¥nUVa@m@k@alU@wk™LWa@UUm@@wnmU™wla@anKn_@alK@ݙ_ƒ@@WUUUmlkaƒIƒyU@UwU_Wa¯yU_mWUwkImm@InWWUk@@UVWV—kW¯U@VƒL@b¯b@l±¦@šVV@lUbV„@škxVnUšl¼XV@b@lV@nIWxnbƒ‚™@UU™LƒxÅxm¯ƒaUƒ™wU@mUÅVÝKULm@bmKUXó@"],encodeOffsets:[[118542,37801]]}},{type:"Feature",id:"3716",properties:{name:"滨州市",cp:[117.8174,37.4963],childNum:7},geometry:{type:"Polygon",coordinates:["@@Vb@`„bV„kVlnV@nlWUk@al@nJ@bV@šInmVxšbVbVLUJ@nkb‚lX„lLnlmx™nUš„V@V@šmXn˜lbĸ@nnVx‚b@lnXV@UJ@nVxšxnxVbÆVn¯ƒĕ‚@@wÈçUÇlķVIœb‚@„Çmk@¥k@UkUK@aWakUóJW_UW@wkkWK@U@Kš@XUƒƒUkmUUalKXala@U@kkWlkÈl@kšV„mVIVmU_‚a„ƒƒwnwVW@wƒwUƒ@wU£ƒwkJWIyUI±bk‚VUJ@nmV™Ukl„Xmx@lnbW„kVƒUkLWŽƒxkKUUmUkb™J±—LÇxUKmkUmkkW™™a„mUaVkšJÆ_²KĠ@U„W@w„U‚¥nUWwK@aÝUkÅVaVK@akLWƒƒƒ¯I@bnbVx¯JW„ñšWbUL@šƒŽnV@VmbkUUV@IÇak@@bWak@WJUœJWL@bXV@„‚@„V„Jlb@zUlUŽUImšnbV‚mz@°UV@V™bV@@V@L@xLmKUnmJVX„J@VkLW@UVUL@b"],encodeOffsets:[[120083,38442]]}},{type:"Feature",id:"3715",properties:{name:"聊城市",cp:[115.9167,36.4032],childNum:8},geometry:{type:"Polygon",coordinates:["@@ô@VWnL‚an@VKÞLÆUnVV@šxV„„bn°Æw„wšKVVš@„maXwmJU@@k@aWUk»V™Umlw@™UƒVa@kUU@™²¥@k°a@a„K@U›ƒU@mmm@ów—ѱ¥¯@@w™Kmw—I›¥kU¯UmakJmIUaƒVkKUkm@VUUa™Uƒ@UaƒKUK¯@™w™UVŽUIUKVw™k™¥™wƒbVŽ@xn„@lWnXxlL@`„XlJX¦l°XxW¦@¦Ul™n@Ž™@@Um@@VXVmx@¯bllUnUJ@VULVn@b„xV‚VL@b„„VlnVVblV„ÈnVlIVJœLô„lJ@xl²„"],encodeOffsets:[[118542,37801]]}},{type:"Feature",id:"3705",properties:{name:"东营市",cp:[118.7073,37.5513],childNum:5},geometry:{type:"Polygon",coordinates:["@@ͬUǪlô@°Uœw°ōĠ¯š»Ģ炻XÇ@w™wƑa™ÇƒkwVƑ¯@řķUmm¯w@kƒa@mV@@anIU±m_ÛW@_mWVU„K@IkK@UW@@a@K@™L@Vk@±U@UV@lm@mUU@kLm„„xV¤@xV„„x@xUXmx„xƒ„bV`UnUJƒn™U@lÇkkllX@l@VkbWbkLVbnVVl„„WV™@@L@VXLll@xVXX`ôIlVXb@bVLVll@@¦nlƒÈ@›aUJkĸVÈÇè@x"],encodeOffsets:[[121005,39066]]}},{type:"Feature",id:"3701",properties:{name:"济南市",cp:[117.1582,36.8701],childNum:5},geometry:{type:"Polygon",coordinates:["@@²¦˜Òôxn@nn‚@V‚œ„°VlXU˜UX@Vl@XVmX@JnnlJVxnXV`°zXbV`VxV@„z„JlbkŽVnVV@X„@š`@ÞkL@bm`mL@bkbšxnVm@xn@VV‚@XbšKl@xkV@b@l@nUbmVm¦XVVV@VUXVVV@XVWb@VÞVVb@X@JnXlWšX„x@x„UVV@aVKVUX@lK@UƒIUWnIVmnL‚K@w@K@UU@ša@UVU@¯nyUman™VJVVk@ykaƒIƒU@@ƒWU@aXK‚IV›XIl@Xb@al@Èb@JVUlVna@UmU„@™VKXaò™Xƒ°IUwma@aU@UU@wVW@фw@a™I±`kbƒUkw™UmJ@UkmÇUUkmKknUVƒ@mJUkaWkƒa@KmKkUƒLmyXa¯_@WmImmbƒLmUkVUbUVƒJ™bƒUkkWJkUƒl™IUm™k™Lƒ›„lK@knaVmkI@mWaƒLUK™UU@@VmLUVLWK@UUUƒWUkkVmx@„Vl™¦"],encodeOffsets:[[119014,37041]]}},{type:"Feature",id:"3709",properties:{name:"泰安市",cp:[117.0264,36.0516],childNum:5},geometry:{type:"Polygon",coordinates:["@@n¼šŽW„nxšL@x°@š¥Uk@ƒnwlUVl„XVV@VXL‚KVUnK@UV@šVVL„KXb@nlJUnmb@lkLƒ‚„œšKšlVnšJ„klVXIll„Vša„IVUValUnV„K‚annnJ@X°`Wbnz„KlVnL‚Ž@L„bXl‚bVlnI„@VUU@UmVƒ@U@Uš¥@VmV@@_Ua@m°@@ƒ„kmUUm@UVmn@nX‚@@a„anJVUVL„mlIVJn@nkVLVa@KVmVLXVVLš@@U°bn@VaV@@K@aVkœbWaXUVymU@aUImWXƒ@™¥UaVwUaVwUUU@WWƒ@k_™VUKÇa@ƒƒnmxkV@LVJ@X™JUbƒVƒ„kUWVUIlƒLƒwĉVƒaU@VbƒJ@bƒUUL@mVUK@wWkK@UVWUIÇm@UUI¯lWK@kk@UL@lmU™VkbÇaUVVnJlIn‚WbXb™LƒxVln@VbV@V„UV™@kƒƒIUK@UWm@UU@LƒK@KU@Uam_ó@™m@L@lƒ@„@x@nWJUU@L™`k_ƒJWbUKkmLn`mb"],encodeOffsets:[[118834,36844]]}},{type:"Feature",id:"3710",properties:{name:"威海市",cp:[121.9482,37.1393],childNum:4},geometry:{type:"Polygon",coordinates:["@@VbUnVVUxĊ¼š¼ô@Þф¯‚WǬLŎUÆW„¹Uǃō¯ÑƒÝkţ™™ţóġ™óL™ł̥U™wm¥kÝmkkKóbÝ@U¦@‚mb¯LkšmJ@x„Lmn@lk@ƒa@Xƒ@ƒlXbmJUz™V@bVJ@n@x„blJXzšxV@Va„KVUXLlmVV@In@Vx„UlW°@nLVK@zXVVal@@V„w„bVKšL@bnx@„WbUJ@VnXVlVxl@nnnV@„lV@L„‚"],encodeOffsets:[[124842,38312]]}},{type:"Feature",id:"3711",properties:{name:"日照市",cp:[119.2786,35.5023],childNum:3},geometry:{type:"Polygon",coordinates:["@@UaVUUKVk„JVaVIČb@Vam@ka@Ul@„Uô„VK@UnKVLnKlkWVa@¯l@VbÈlV_V@XWW_@anKVwUmVw@@Uny„UVblKVLX@„aô¯ó¥mÛĊÿÈ¥š™Þ¹lUīƒ¯Kĉ¼ʟbÇV™U™ŽUŽ™XmakJUnmV@bUnmJ@XnJVLn¤UzmJUn@`¯ImŽU@™nƒKVkkm™KWb—b@xƒk™@mL@KƒUUVUKkbWaƒXkK@bkJWbnbl@UL@l„Lš@lxx@b‚nUVlV@¦²°@bVx@Jƒ@¯XUJ@bUnlxVŽ„X@‚VV@b„L@nô`@bkbVVÞL˜xnU"],encodeOffsets:[[121883,36895]]}},{type:"Feature",id:"3703",properties:{name:"淄博市",cp:[118.0371,36.6064],childNum:4},geometry:{type:"Polygon",coordinates:["@@nƒlKV@nVn@@kVU‚@²VVaUƒ@wmKXU@UƒUWwUW¯aU_ƒJUV™—VK@U™JU™@kUƒw@UlnWU_@›lI@U@wUml@@mVwX_„KWUXKVa@UVUUwšJlaXWUnƒ@mla„n„UVWkIV¥V@VVVI@a@akakLWKna@aVwk@WUƒbUlk@™k@U¯UWWU@mUUVUXkVmVVV@nkVƒLƒVÅwƒ¯k@WVXb›aUl@bV@@b@xkVVXVxkJ@nk@@ŽVLUlVb‚VXUVVUzV‚™LVbUbV„VWVkLmškJ@n±@UxU„VVkV@bƒx@ÒUX@xVVV@°J„„X„lK@bULUblÆÞV@b‚LXxmV¦ƒV@xƒXVŽğ@±LÅ`™IUlVbƒnšbXšllVnnlVLÈw˜K²ŽšIlanVVVlL„wXlK„VlUXƒma@knwƒWlkšVnU@mVIUl²aVJ‚zXJlI"],encodeOffsets:[[121129,37891]]}},{type:"Feature",id:"3704",properties:{name:"枣庄市",cp:[117.323,34.8926],childNum:2},geometry:{type:"Polygon",coordinates:["@@‚yUU„U„kl@@aVmšLXw°»°w@y„L@UUaWXKƒƒVknwVKlmš_UmmUXK@ašw@k@mUWmUL@ƒ@™@£@KƒbÝV@akw™aULmƒƒbUK™LUU@lm@—°mL@nUJVxVXU`mIUxU@UnU@@lW@@bkLW@UVkKÇ°kLlŽƒbnUÜÇUUVÇ@@Xkl@XV`UbmbUbU@WxU@¯¦m°nL„aVblVXal@XKlLVVȄ‚L„KôlnbšI@„V@VJ„I@lVVÞaVkXU"],encodeOffsets:[[120241,36119]]}},{type:"Feature",id:"3712",properties:{name:"莱芜市",cp:[117.6526,36.2714],childNum:1},geometry:{type:"Polygon",coordinates:["@@lmnLVlÈVln@VnIšVlx„Vla²_šJlUUUVƒVw²@@mlIn™lKXU‚UUƒVaUašKUVyUUWVUUaVkUK@l@@mlIUwUWlU@w@aU@@LU@Ubm@¯a@V™@UKWUUKUn@LUbUKmlm@UIkJƒnUKUVmIƒb@b@mWm@Un@VVnnVƒl@„¯@@nVb@`U@Un@Ž™¦@V@VU„VnV@"],encodeOffsets:[[120173,37334]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/shan_xi_1_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"6108",properties:{name:"榆林市",cp:[109.8743,38.205],childNum:12},geometry:{type:"Polygon",coordinates:["@@™ýVƒnIW»ƒW@»kUÇL—݃U¯¥ÇIUWWїUWwX¯mƒ@»n@ÜÈķô™@a±kȱƒw„ÑmwçċmU»ÆkkVyIm™ĉÿ@ƒÝ¹ƒWnwÇVš™Åaƒzmmĉ¦ó™kVmx™xU¼VškVm_UlVlk„°IV‚kmJa›¦k™™LmmV@XmKnšlUô›VXbƒbƒ@UaÇLğܙ™Åwƒ£mKnmċwÅ@UkƒbmaVƒƒƒn@m¯aU™Jm_k˜@kWXyl@@kÅamw™LU™Þ™ƒ™mWÅzUKƒš™Uk±@™b@nnK‚bX¤mzVšŽVxÇn„‚¯„@ÒknWƒƒVUbkķÈÑWkk@Va™™U@„mUkbƒÝÅ@Ý¥ÇbkĬ™XV`kLǍVmalUUa™nV±nwmkƒJ@Inƒ°KVw¯UnÅ@¥™ƒ™U±bUU˜±œmWbÛKWnUm`UƒVK@bmnœm‚Èż@V„L@xƒxmš„Ť°nŽ@VmK™²VlšlKk„ô@„êÜV@VXLlmš¦UššV°Ș¯²ÿ@¥š@ƁĊ˜²IšmĶnnb°b„KVƒĸLl„Þ@UȮš™Ü°IVƒÞÝސlŽœx@ŽķĀWŽ„Ux„èƐ@š°ŽXnšlĊĖ°m„nƒšV„²V°ÒƦ„aބ„˜@zll@bÞĀšlš¼nKĊ¼óȂb²±šIǪÒ¯ĖV@„lxnVlk„JlaXwŌĉ„„@VnŽššlÆĕ„UÆLœèŌŤôxȚlUœ@šxlaUċĕXm„IWmnkšVVƒ„VW_@aÈWUUmk@ƒ¯çVm»™±W¯n¥V™mkXw±ÇVwƒ"],encodeOffsets:[[113592,39645]]}},{type:"Feature",id:"6106",properties:{name:"延安市",cp:[109.1052,36.4252],childNum:13},geometry:{type:"Polygon",coordinates:["@@@kkÇmIšmUwVkUƒƒU²WmšVkm@m`mIĢĕUƒVa@™mXƒƒÿVVkyUýšĕ@l_UmnƒW„KVkţ™™¥™aƒwğ@™@aôƒ„ƒWa„kUmƒa¯¯™a±£kx™mmxUwÝ@xmU™b¯K™wó„Ý@kmm¹Ub@lklVbmnnVUV@x›UknƧJUX@ŽƒLÇWkw™LķƧÅwWJk„ƒLkþĉxWz™JUnǚkš@Ɛk¼ÜÔÈKšè@°lșÆk¦l„n@l¼@l¯L™°UU™VÇ°ƒ¹—`m¼mXk‚™bUaƒV@U¯x@¦™Ç™„UUmlmUVm„nnmlkw™@@šƒ¦Å‚ÇLmx¯Iklš„@¦mÆ°VUx¯Lm„@J„InlmxU²šmVbkV‚bUnȎlKU_šWlīÈaÞ¦Æ@„ÞlanV@ƒšVšUbl@XlÇÒĸlŽVa„UX„lm@Ñ°ƒƒÈmUw‚U™nyW£amL@mša²@lšV„™VLÆynX„šÝšVššKnxÆb@lk@WzXŽ@ll—n`šIV‚°b@n„m„„‚Unb„aVlÆ@ČxmnnL„¤ÆxššĠÛÈKVb„@„aWaœU‚ókVm™nL@W‚UnnšKlšœ¥‚bnIlU¯JlƒUkVkn`lUU™V»šwnwlUôšĊ¥nn„yÆb"],encodeOffsets:[[113074,37862]]}},{type:"Feature",id:"6107",properties:{name:"汉中市",cp:[106.886,33.0139],childNum:11},geometry:{type:"Polygon",coordinates:["@@lKnb@n„lWb°bkxĸwVb@ł„nlŽ„ƒĊ¥šL@XŽl™ÈƒVblÈK‚b„akVwôml²`‚nœ@‚nVKœl˜k²xŎƒ°¦VU„JĊw@çnWçރVkUóÛ@¥kwš™šUmƒX¯WšÑkƒ@UymIUwlUn¥‚mUk²a°¯V»@™ÝVș„ÝċÅÅVl»@l@a°±@_kammÅb™a@ƒƒm@ż™KknõĠ—@mšƒ„¯LÅw›‚—LVxmb@¼kV™@mw¯wVakKW»X±¼¯Vkxƒb„¼WŽ@nx@x±bóakbƒ@ÝmU™@ķÓÛL™kƒVUm™k¯¤ÝLUlÝ@Ýz™š„x@x™°™™™bƒmƒX¯aUJW¯—k@bÇWƒwÛwWxƒ@XWlb@Žƒ„VŽÈUlwšLnl°VlUô¦œU°¤VšUxVXUxlbkVVlƒI„°„ÅVlU°m@k„ÇU¯xUlƒLUlVL@b™°ĠInĠ°ÈnK‚„@xÞa²n‚aUyšXUKVkšWô¼Èa‚z°JXUVÇV_„JVƒšz@Žnb"],encodeOffsets:[[109137,34392]]}},{type:"Feature",id:"6109",properties:{name:"安康市",cp:[109.1162,32.7722],childNum:10},geometry:{type:"Polygon",coordinates:["@@„bĊaƨèšwôô„¼šb°ašXVƒÞVUÞ@‚aXƒm¥kImx¯¯ƒV@anU@UÇéğL@ƒ¯¥V£mƒ@ÝÈb„K‚™„X°wČÿ˜ƒ„b@xÈblxȯĊ„„mÆUVƒ„nÈ@ƨÜLĢ¥ƒŹnƒ°Vnn˜K„aô_ȃšwU‚aXmnW‚¯kl›LXƒÇ™ō¦ÝaÅVmbğUn¥±wÅéVƒan¥ƒ„U„»°am¥„£ƒÝ@ƒ„wVw™¥nU„уUmmVwmķIÅaóVWxkblb@ból@œğÒĉ¤ċXƒ˜¯X™xk„Ç@óÆÅx@š™xķ_kmݎǣkblb@`¯²@bk‚‚@k¼ÆUČƃÞǚÞU@šU¼¯°±bVlnm¦kVVxnJVz@‚l„™ÒXW°n„™V™šlx@¦ôÜVUl݄Xèm@è"],encodeOffsets:[[110644,34521]]}},{type:"Feature",id:"6110",properties:{name:"商洛市",cp:[109.8083,33.761],childNum:7},geometry:{type:"Polygon",coordinates:["@@²nl‚ôbš„°aVwnKÞIš`°wšXôw°VĊ°@ŽÅš„ÞÆV„zÞK@xšŽ@a‚LŚ@b@ŽnLlƒ@šln„mnLVw„a„bVƒ‚VnbU¼„Vƒ°„bl„šbÈ@ĶŦb˜@nÇ@amIyUI@ĠVmôƒU™ƒVwkwlanJ„¯lwó¥@an°Jš_„‚@š™nóƒó@£l¥UwmašÑ@ƒUm±V_ƒJ—£›J—UW¥¯@ƒ_k¯¼mUƒVUè¯b@wmL™»ğVmağI¯¤ċIUW™XƒKĵ¦ķaƒJUb™IƒlUóVmk@WÅÅÇ@ƒmU„ÅVƒnĉƒÇ°kwÇa@wƒa—„ċĀ¯xƒWšƒLÇa@Þn„U¤°¦@„ĠKÈê@VmV@b„U°°nwlJn¦W„bÝ@VŽ"],encodeOffsets:[[111454,34628]]}},{type:"Feature",id:"6103",properties:{name:"宝鸡市",cp:[107.1826,34.3433],childNum:10},geometry:{type:"Polygon",coordinates:["@@@ƒ„£@›°Išb@¯°ynŹƒaUƒlƒU£„Umšĵĉ@@ylUÞ@@£kWU¯WaU£¯ÇV¥ƒ@kb¯wƒn™¥ÇkUÇnUƒ@¯±›kULm›@m±_kŽónUxlŽƒbaÇLkŽUaDŽkšW@™Kĉ¦ƒ„kƒm@ŁUaķxlw¯aXaƒk@mmakL@šmšÛŽ@¼m„@l„XV`ƒn™KUš°°@²š¤UÈ@VxmôƒxKl„VV²aVw„Xla„Vlx@UVnŽÇnk°ƒVVL™lkI™šƒJÇk¯V@šknƘn@lznmlVkzVŽ„VVxš@Ux„z@x±¼VxxU„l‚kb˜@„¼Čk˜VXlĠkôV²w‚LUKlwœJ@a‚IV¥Þƒn¯Ün„‚„@nk˜l²kÆ@š°„aVbnI@™š‚Ťn"],encodeOffsets:[[110408,35815]]}},{type:"Feature",id:"6105",properties:{name:"渭南市",cp:[109.7864,35.0299],childNum:11},geometry:{type:"Polygon",coordinates:["@@@ÈôL„xUŽ°„Þ@mŽÈnl¤nUôL‚wX`@ÞÝL™ŽUšmLô„„ŽôbVbnºlnÞ@ôƒšx°LšanV‚wÞ@Vxnwšnlw²¤šb°°„bVnƒlXbƒ„ó„@bš‚Ġ@„xšbš¦ŤšV™Xġ„£W¥ƽɽƒó@ýóƝÝ»„£X™mƅšĊkUƒ„@™™šó„kťaĵŽÇ@™akƒƒa„¯ƒUV»maUU„ƒaƒbUxmKƒnkm@™k„mK@ƒxó@¯n¯KǦ@ôÅèlxkx°nƒƾ¯KU¯WķL@VÝIUb™yWbX¼Ç°"],encodeOffsets:[[111589,35657]]}},{type:"Feature",id:"6104",properties:{name:"咸阳市",cp:[108.4131,34.8706],childNum:14},geometry:{type:"Polygon",coordinates:["@@šIXyĊwlý„KlƒXIVaķƒ™»a›£„¯aVU@a™‚wÈō‚ašL²»‚VœUln°WȯW»XašzVaÞJ@Uƒ»@¯Ýbğwly@£kÑţ±Wу@ka™IUƒƒnƒ@¯ƒómţU™b™U¯lÇIÝb@¤Ý@kV@zĊ@™ĶnƒVV¤k„V„„bmź¯z@°™a¯J@œƒ¤@„„bUx™bƒ„@`™xUÔ±ºVXœW‚„UnUJ‚LĢ¯ÈKlblmÈXŎ°šU„°LšŽlkÞKš@Èxl_°ĶUÒkblš"],encodeOffsets:[[111229,36394]]}},{type:"Feature",id:"6101",properties:{name:"西安市",cp:[109.1162,34.2004],childNum:5},geometry:{type:"Polygon",coordinates:["@@°²@‚„mVVÈÈlš¦„m°xla„@U¦°ÈV¤XbV°lXÞaÈJ°kšVšaŤVôn°„„@„mV„šJlb„@XÒŤ²lÒ@¤kzĠxÞa@°„¼ĸK°XV‚°L„ƽ¯mlwkwÆç@óÈ¥°L°mô@„w@aƙK@b™@wÝLƒyÅUƒÝƙ@ĉ¯¯Uóx™W¯x™_ÝJmLUx¯b™ƒóak±mÝUU„™W¯b™aƒ»óó™xƧçĉbƒaĉxƒIUV¯¥ō„±w—l"],encodeOffsets:[[110206,34532]]}},{type:"Feature",id:"6102",properties:{name:"铜川市",cp:[109.0393,35.1947],childNum:2},geometry:{type:"Polygon",coordinates:["@@ÆxĸƨšKlxÈX„K@VWƨIlmœV@wVUmUnmUalk@kVaUaóaƒóƒnKV™šÞK@ÝW_xóKmVk£ÇmnÝ@¯ƒVƒwóK@ǯXkm›VU±¼™KbÇŎx‚š@bUV°bƒœ¤‚bš¼ĸ„Ub"],encodeOffsets:[[111477,36192]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/shan_xi_2_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"1409",properties:{name:"忻州市",cp:[112.4561,38.8971],childNum:14},geometry:{type:"Polygon",coordinates:["@@Vx@lnbn¦WlnnUšmš°š²VšV‚VVVnUn„ºlz@l„„@Jƒ@kXWVXl@Lƒa@„ƒKUL„ŽlbnKlLnK‚LnKÆXn°šbVV@bUVl°Un@LnaVJUbW@UX²l‚@ČwlVVIšWnkÆa°„„anV‚Kn°™UW¯@™aVUVk@Un@„aV@ValwUanmWU„k@WVUUanaVwnLVl°@nk@mVU@UVK@w„LVKVU@ƒ„K@UUKVUV@@bnL„a‚V„aôšlIXmlKX_°KVV@bVV„@šzV`kblI„V„Ul‚šL@bnV@V„Ċll„„VlIXW@k„a‚U²blKšVnIlJ„albXXlWVn°JnšnL@l@XlJlaX@„X˜W²@l_VmnKšU„blU@mnkVK„¯@U@ƒma@kX¥VƒmakkƒLƒa@aƒ@WIUUVXWWnk@a°a@kkm@kUUmJm@WUUUIk`m@V—kaWWkX™KmƒXk¯ƒ@WKƒLkak@±bƒw@ƒaƒa@akaƒ@ma¯@ƒL—KÇÅkKWbkmġ™±ÅUƒLUK™VVkƒm¯LUVVbƒ„UwUW¯bm„ƒULƒxWJ—@ƒklmkUm@@KnwVkVK@akwƒ@@a¯bƒKkn›VUI™b¯mmbk@UbmKUL@xUUƒ@klmLUŽlVXI‚VVVUVUœU`mLXVWbXnW`Ų°xmŽxU@mĉƒƒwU@mbU@UƒmbkVW¦kJ™@ƒX@`¯Im@UlUVVnb@bWJXnmbƒJUU™UUaƒ@UamIkaƒxƒ@@x@b"],encodeOffsets:[[113614,39657]]}},{type:"Feature",id:"1411",properties:{name:"吕梁市",cp:[111.3574,37.7325],childNum:13},geometry:{type:"Polygon",coordinates:["@@@a@w„@„wlbnJVb„@VbšVVV„InaWmXI@a‚aUmVUVkn@°J@_„Wš@lIX¥lUnaV„V@naV@„xĊ„n‚V@‚wn¯wƱX_WmXaWUnKV_V›VUUUUWJkUVnKlk¯™@@kmKUaŁ±KkU@WmI@WUIlUUmVwXƒ‚w@ƒUlUVwœV‚@„Lnb‚W@anU@UšaVkô@l»n@na˜JnUÈLVaƃUUVm„VKVƒ²L@mU_lK@UVWkU‚a@a@U¯aUaƒÑóÑUb™„ƒKk@@aƒk¯mVaUwVƒÑkWUmK@UUKmXUWÝwUa™LUU@aWJUUU@Ua݄U@WL@VKVaVI@WnU@alIVKƒƒ@kIƒmIkJ@™m@ƒ™@@_™K@xƒ@kaW@U„@Vmn@ŽUK@mIƒJUXV¤XXWlkKƒkkK@XmJVakImJU@ó™¯LWKUV@nUVƒLkxmKkLma@kXKmmƒLƒab™LmK@V@mXVÆUxƒX@`nL„aV@@VmLUVnLlLš˜„b@„šŽ°²nx@b‚VUxlb@V¯bUV@zV‚XVĊXVx@lVn@VnnmŽUš@LlJXVƒz¯VWVXbšV@bmn™VUVk„Çþń@XVxmbUlV„Uln„W„@„Xl‚@VLXÒ@bÞJ°¦„L˜ò„@nU‚b@°„X@ŽXbmVU„V„nb@x‚x"],encodeOffsets:[[113614,39657]]}},{type:"Feature",id:"1410",properties:{name:"临汾市",cp:[111.4783,36.1615],childNum:17},geometry:{type:"Polygon",coordinates:["@@nW‚@@UnLšK‚a„b„KnnWL@lnblKnLlw„KVU@mVUXL°KôšV@nIlJUbnI@WlL„llLXkWWU£VW„InJ‚@VL@nm@UVƒX@lb„@@wšL@`‚@„šn@V@lw„@n„VmVX„WmwnUlƒœa@_lK„wVlUn°xVKVXXWlUšVVI@K@K„n°KœwlVlU@kna@V_„Wn‚m„UVm@kXml_@m„LlKXw°m@_ôJVUV@X™l@UaV@Va°I„lk»VwUkVmwUmmVn@V¯@KƒU—wmK@U¯wUVÝ@mJƒU—nWK™@@UnKVa„_lykUmKÛnm@™x@ƒUUlwVk™ƒXW@ƒa@Uƒ@@K@ƒkIV™nammVakUlƒ@wX@@kƒ™¯@ƒVVbml@„„°UbULmlVbnbÅK±VƒKVXUJWa@ULWaUU@@U@aWK@UkxUKƒLUUUJ±UkL@V±kk@kam@UV@l@LWl@n@VVUx„LlUUx@VUV™U@aƒIUl™L@°mLU‚ƒbkUUaWUUaUU@aWK—LWJ@bUL@VUVVbU@m@a@kmKmnĉlUK™XƒWUblb—xmIkƒƒU@xWb@lkšVx™LXŽmzVV@bklVVUzm˜@bk„@Vx@xlŽU„@lUbVnl@„Wxnl@n@ŽUbV„mL‚mƒb@`X@lUX@@xlnkLWaUJnnWV™Vn@l„@bULVV@l™V@XnJVX"],encodeOffsets:[[113063,37784]]}},{type:"Feature",id:"1407",properties:{name:"晋中市",cp:[112.7747,37.37],childNum:11},geometry:{type:"Polygon",coordinates:["@@@šlInJ„lJ„@‚„ULkJ@bmV@XUJUb‚L@UXKV@ރVbV@VVXI@bVVšKVbÞxVXnWVL@VnLV‚lX„ÒUŽVxUb°n„l@bl@„LšƒVaô҄ÒVb°b@VnLnnV@lmn@lb„U„V@„‚JœUVV‚Xkl@lUzmJ@xšXkl‚bUn„JVšUb„nU‚lb„V@nlLX@lakšV`Ub°š@XVJnU‚L²KlxnI@KV@lbUbVV„KnVl@„zlm@Uš@nŽšI@WUaVl@@mVU„@XkW@ƒnkVKVƒ„_Vw„y@knwVa‚@XalU„@šVnml@„X@V„L‚KVaÞbnnlJšI„mVKn„VVVInVlU„@„m@™mXK@UmyUI@mWUUakamw@wUwmLkakwVƒmK™w@wUam£y@am_ƒW@™UU@knmm„amU@WUa@knw@ƒUUUUV@nƒJm@mVUkKVUUUkKmwƒKULƒKUImV@lUn™nŽm@mbUK@°™bUnmbUmkkƒWUb@am@UXkK@a±@™V™@ĉř„V‚UXVxUVkLWl¯@@bULUlm@@nm`—XƒlWakIkm›VUbUL@Vm@kIƒ@@Kšm@—VaX‚I@W@aU@kUƒVU_™KƒbƒJkkǎ™b@nkKmL™wÅW@kVUUƒVU@WUIƒJmIXmma@_kyVaUUlkUm@ƒkU›x¯Lƒm@L@LUJ™UkVWXUWUL¯wVmUkƒxkL@`›bk„mVnxƒXUWUnmƒƒ@kxU@"],encodeOffsets:[[114087,37682]]}},{type:"Feature",id:"1408",properties:{name:"运城市",cp:[111.1487,35.2002],childNum:13},geometry:{type:"Polygon",coordinates:["@@„Vl„nJ˜wkaVa„XšWVLĊknmnL‚l@@bn‚V@UaVU@UVK@aXI˜KXL@bVVVbXVVblV„aVnK@¯šKVk„J@bšVVU@UVwkVƒKVwUUm@@Xk@K@kVUn@lbl@²l@UlK²VVIVV„KVLlw@VXL@b@VV@VŽXbVK‚@XbVIUW„L‚U²ÆLmaUankVKVaƒ¯@ƒnkUa„U°@„š‚n@@kWa„UVaXUW@IXKVw@U™ƒ„™WU@W@@UUƒU@mn@ƒ`m@UUULkUmJ™IUƒ@@UƒK@U@›anƒ™ak_@wmKUwmakV™kmK™V™k¯b™wƒ`kwUIÇx¯»ÇaŃmn@@™mƒmUkV@wkKW@kxmL™UkĉLÝk™xÝw¯lóVU„mV@ĀVVX¦W¤kz@`Vx°„²ĸ‚š@„Ul@x„êĸNJ°¤V„VlXLWnXxmV@nUl@„"],encodeOffsets:[[113232,36597]]}},{type:"Feature",id:"1402",properties:{name:"大同市",cp:[113.7854,39.8035],childNum:8},geometry:{type:"Polygon",coordinates:["@@²£šyl@Ȑ˜Ė@bĸŽĢbĸ„˜X„a‚KŤnn@ŎôllÈx„nVnÞDŽV@b‚nXllL°KšbVb@J@b—„‚„@ŽU„„xlKXLlKlXk„@Ulk„JlkUƒVKXUƒÇVIVm@_nǚLšašl‚w„VnU@UUwma@aƒaÝaLmUk@@Wƒ@U@@X™wVWÝUUUk@@VmLƒKV»nwUw™aUL@`mzƒJUIVƒUaUw™KUaVIlJôanÑlLVUn@ša„@VV„@@UUwVK°Vn_lJÆLœéW@UUUÅ@»lm@aÞIVwXW˜UUkkm@U@aƒU@mwU£VWU_kWmƒXwW_°yUkkK@UÇK@kkUVymóK—U@KWIƒbUak@mJ@bkbmLkŽ™UmƒkVU„W¦@lnb@„@Vƒ°ULml@nkVƒa™VmLUnk`±@—XƒWW@kbǦXŽ¯„WxI@xmbmxXlWV„„@bŎUz@J‚b@bÞb™ŽU@Wbk@ƒxk@WX¯VۙƒWÝbÝUkVUU@alI@a@akLWa™m@U¯UUmÇL@K@aU@¯VUkƒKmX@`@œkJ@nV‚Ub@lbVÆXVW„ULU`VbkLUV@XWl@bXJ˜@VbV@Vl"],encodeOffsets:[[115335,41209]]}},{type:"Feature",id:"1404",properties:{name:"长治市",cp:[112.8625,36.4746],childNum:12},geometry:{type:"Polygon",coordinates:["@@Uk™Lky@I‚JVa@mÞaWšy@_W@_WƒXVlUVwš@nw°K@m„UƒVaƒmVkU@mmmnLVUmKXa™U@IlKVUnK@UmWkX@WV_Vƒ@akU@a„KWIXyƒIUVmUn™Ua@WaXUVKVmkUWVkUƒLU@@VƒbƒKbƒIUmƒ@mbVL—x›WUUkn±V¯wƒbÅJUbmLkbmKÅKƒbVnUbƒV™KUb™KUbmLKmƒb™aƒKkUm@UŽnn‚VnxUVlUxl¼ƒk¯JUbU@Vbk@WšU@UVóI@`¯nWxkLƒK@nk`Wn@lUnƒVnm‚ƒXU`@mb@lkV@„VnklVVUblz@`nbWnnJ„IVJ@XUVV„UV@lÆXšxnKlL@mšaȍll„I„ašLV`„UlVV@@b@XJWUb@˜™n@L„@lJn@@UVKVaœUlnlJXb„k˜Wn_@mn@VkVK@a°@XklKVUUwVWUšƒĊƚ@šU²@@blLVWn@@bVa„XllVnnaVmša@¯VLnan@‚šmVm@knUVJ"],encodeOffsets:[[116269,37637]]}},{type:"Feature",id:"1406",properties:{name:"朔州市",cp:[113.0713,39.6991],childNum:5},geometry:{type:"Polygon",coordinates:["@@XXWVXVWnnlnn@èƼ@„„xlš„ŽV„nblšššVŽÈUVl‚š@„blnœL܃ĊmUkU@Ua‚—@WI@aXk@WVUlKUaV_VKXƒWUUÅka@VaU@mlI@›@_nW„LVl°UV@@b@LÈKVn°V@VšnXblK@b@bkJ@bVVlUÞVÞa„Xܚ°UXWl@„wl@XaV@šÝa@aa@IVyƍ@aƒƒXUWknwna@w‚JXw°ƒWÈ¥kI@W@kmKm™¯IUmkXWWkaƒbkImJ™UkL±aVƒb@lWXkJƒUkƒĉkƒ@UmU@a™KkƒVƒUkJlaU_™yƒ@UU@aUU¯LW`kLWnkJó™ƒbUƒbmK@aU@UVVL@VƒL@„UVULƒK@xUL@VUV@nml¯@UkmKUxmbVbUV@XƒlXVmnVbkxUbU@ƒbm@@VUlUVšb°@VX¯šm‚"],encodeOffsets:[[114615,40562]]}},{type:"Feature",id:"1405",properties:{name:"晋城市",cp:[112.7856,35.6342],childNum:6},geometry:{type:"Polygon",coordinates:["@@lV„Lšb„an‚LnKVašLVašL„UVaUm„aÆLnLlanKVaÆI„a°x²UlmVVœX˜wUKna„@Vn„J‚a„L„a@UV@@alUkKVKnkmmVwUk„w@ƒ™@kxWUXƒW@@mƒk@aUa@a¯aƒLkKmwkUm@kL@K@aWIXmƒVƒXƒWkUVakL@UVKƒw@aUK@UUKmLU@¯n™KUwVƒUIWJUWmka™@UXƒJƒk@UkmW@kLWKVƒx@bmI@VUaVU@a¯@UUmVKmX@±`kÝKVxUL±akL@V™bƒLkKmVƒ@XWVUbƒVXb@lm@@lW@@xk„lVUbnnmbUšlJ@„@L„@@V„b@‚WXš„UlkxVV@„šwn@ÜmnLlVkzƒ`UbmL@Vš@XL˜m„VnIÞ@VU°x@VnL˜x„V@LU°"],encodeOffsets:[[115223,36895]]}},{type:"Feature",id:"1401",properties:{name:"太原市",cp:[112.3352,37.9413],childNum:5},geometry:{type:"Polygon",coordinates:["@@„@VV@wVKnLVal@na°nšaVJœUlm„L°a@b„@lx@bULUlmx@Ln@lVkn„l˜@XI„w‚K„Vnƒ°aVXVx„ƒUaVU°K„nUlšUVL„KÆVš²Ģ‚lnXalLÈƘL„KUaVkUanmWU™a@WwkUWU¯y¯Ñ@anIl@@aVU„m„I„ymUƒLUUVakaU@@LmJkw±LKmVUI@W¯™VaU_l™kbW@kK@mƒUkaVƒmVaU™ƒIVmalk™W@wnIVy@klkWUU›VI@ƒƒUƒVkam@knU@mmmK@bblVUX@VkLV`@n±KU„ULƒ‚UnVVńUbÇKmV—Imbm@k¼ó@Ul™b@VmV@bXmaƒK@›UUxkV‚V@„xW„UxVnkVVJ@XnJ@XlV²LƂVbnL@lš@°"],encodeOffsets:[[114503,39134]]}},{type:"Feature",id:"1403",properties:{name:"阳泉市",cp:[113.4778,38.0951],childNum:3},geometry:{type:"Polygon",coordinates:["@@°@nb„@lb@b„b„b‚@„x²al@lb„KXU@m‚kUWkkmUUƒVwV@XUW@™naVklKXblKnL‚ƒnLVanImaXKlL„ašV@U@KUKW„alƒXK@£WKXUV@VU„ƒUUVW„_V™@W@@K„@šƒUƒƒIWmXUmƒULƒn™JkImmÝaUbLƒK@UƒWk@mn™Uƒ@kVWb@Ubmx@lƒzUxƒ`U„ULml@„XWlƒ@UV@nk@U‚Vb@X™Jm™@@Vknƒyk@ƒzƒJƒnUV@bk@mJ@b°Ò°zXVlVXx‚@šbXVmnVbUlVb"],encodeOffsets:[[115864,39336]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/si_chuan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"5133",properties:{name:"甘孜藏族自治州",cp:[99.9207,31.0803],childNum:18},geometry:{type:"Polygon",coordinates:["@@ƒaXamƒ¯wm@±°wUwV@UaVw²Kš™„U@UƒU„¥‚a„ƒ@£Þ™ôx‚Knkm™X¥™IUƒÝUwlk°V„@ƒÈ™‚KUwlkUyV¹„mšx²Xll„ÑW»š„l„w°UŎ„nƒ„„˜Jœƒl¯°V@wôIVÇn™nUllšLšVǚLô¼XW£@±„@¥k_ÇJƒkUéƒkšƒƒwXa@ƒšLlw²™Vx„b‚mš¼ÈxlLȃ„VWÞn¯mǙÑUÝlÛkwlĉmƒULmwUJ™ç@wkm@ÑlUX™ƒÑôġƒVa™ƒUф¯@wķÓkbV„mnU@@y¯IķKƒV@¹šaƒé@k„mÞU°¥@a¯@anKlblU„¥@óğç@Çw@wkla„çݱk¯±@ğÝUÛmݯwƒ@kb±¯akXWÜkXUÆÇUš¤X_Ɛw„V@¤ƒXU‚ƒbUƒŽƒIUlÇUkŽġ@™aXČmlUlèUV@„mVk¦Vxš@¦±š¯ƒƒ¯¯anlWš¯nƒƒÅw@w°KVak£m@klƒKknÇU™»óKšīlaUaV£@™™¯@ƙU™VƒÛÝÇXƒÇl—ÓlŹ„»WUğJ¯£mx™Lĵô›ºX„VlUll²bl„„lŽƒxónn°ÝšU¼mJUš¯nƒƒƒV@êĉ°Uĸ™w™@mƒ@¯kmXamѯaUwÝKU¥„mÅn¥Wmn™ƒ¹n±ƑƆÇôXê±NJnšƒ‚UôlĖkȂVÒ¯¼VnƒȮ¯ĀnƆ˜Ģ@Žk°V°¯ĢVlkšVxm¼X²™Ŏ@ŽVxknWÜ°U‚¯n™Æݜ@`„ôݲÒƒ‚Çzn‚mX@x„è°K°Å„UČĬóĖ݄ƒ˜ó¼ÅêƒÒƒbmšk@V„Ž˜„@ҁl@nĉܛê—x@Ėml՛J¯¦óxȭ°ÝmŽ¯Lĵè›Ā@Ɓ„l°żƒ‚šX@xmŽkV@z@‚„°blŽnÞ°J@bn@ƼUVƒUóŽóLƒ°X°ÝLƒxUn„°ƒĬƒn@lnL@ŽÆ@šn„KÆxnUnV˜InĬmÆnxŎ¼ĊIĢóÞ@ĊƒƨbUƒ‚mV¥lkƒ‚wnL„mšÅÆ¥Xƒ˜wU@w‚wUÞ™@alUUŚU™Vkkm°aU—°Ó°w°U„ƒ„b°aš²K˜¯œĕ˜@ÈbޏĊaš»„XVm°In„‚Ĭk¼Vb„ašJšôš£VĊan™‚k„ů™™nƒÜU@anKnĮ‚bÈmƎš»nI‚霣Ġ™"],encodeOffsets:[[103073,33295]]}},{type:"Feature",id:"5132",properties:{name:"阿坝藏族羌族自治州",cp:[102.4805,32.4536],childNum:13},geometry:{type:"Polygon",coordinates:["@@l@@þ²I@lƒ„VL°wnJ°Uĸ™Ŏè„Ilw„V°¤nĮ™¤Ý„lè„L@„ƒ„@x„l™è²ôĊ_ĊġVÈôJżīlbXšÆÈVŽkxÇVƒ„n°„¦Üb@è@nn@@°šUÈ¥WDŽ_Uala¯¯UǙkƒ»„mVwk»˜k²°VxlL@¤œ_@x‚`ȍ‚Ėöb˜š@l²alX„a@bnK°¦VK@nnWmx@nUnl@@lƒlĉk°l°UXkmW@Unš`k„ÇL„ŽW„ÛÈVxšVVlVk@l„IXb@ylXÈW˜Į„WŤzœy@šmIƒŽ²šJ‚š@nŽ°@V„„J°a„Å@ƒŎkVǚk™aUw„KVw™™Vƒ„@nkm™@±ôkô™ĊJš¼šInÑm±nIššÞ‚XȃĊxĊUÈbÜyÈ£Vkw@kVUV™„m@ša„»ÜbÈmƒUXwÝxƒUn¥@°ġ™Å‚aœJVk™aW¯Û@W¥—UŏĶ™@¯kUƒŃ@ašI@mmanwސ‚W@œ™mw°»Uřk¹±W„xVx¯¦U°ƒzţW™w@°ÇVÑk¯@„y°aš£š@šmšnl¼„ašÝÝakwUƒ±aĉImlĵn@ƒm@kkVƒ¯Ñm™ĸ™°x„l™œ@˜ƒXVÞmlÛݙĉUÅ¥mwÅ¥VaUw›™XġċaVůÛŹlwU¯U™ó±™xÛV±¯¯n¯mċƒLmnĊm‚™@™_kJWaXmwUƒĉK™»™@mwX݃UDŽkKÇw™»nƒaUw±škx™K@„Wb„x™„„lVê„lÈIl`@¦ƒŽ@²X¤Wó»™KUșŽ™KkkmVmšUÈóJ@x¯Uk°›„—Iƒƒm„ōƒ¯Vƒxƒk™ŽX¼ƒÒkk±W™wƒnUºVzklVxLǚ@„ƒŽ¯UklVxސV„šJW¦nšmlLówݚ@¤ƒ„bƒ¦„V@VƒV™š±LUxVbU@Vx¯x@²n‚°xn„Wb„b"],encodeOffsets:[[103073,33295]]}},{type:"Feature",id:"5134",properties:{name:"凉山彝族自治州",cp:[101.9641,27.6746],childNum:17},geometry:{type:"Polygon",coordinates:["@@ĶóšKnw°¤ĠIXVƒ¼kź˜Ôk‚„ÈWŽÞȄÜUVšÅš°@šš‚@U¤Vbkb™ĬôLš¼ÈVlm„Llkn@l¤Ub¯L@xÆx„„°mX™mk°b„°°„²™@¥‚™Uwl¥nU@ƒVUkçVnkWċšbĢ@lÈVVk„J„‚V„aV„W@£ƒUƏxW`™£ÈVVÅlWXÛlW°b²la„@°xnÞVÜĠÞ²@l°Þ²ƒèkblŽ@xÈx@Ġènal£nU‚Dz@‚ÞK„nn¤@¼˜°U¼„nV‚šXU‚šbn™ĠUVbUlVš°LX„@lV„èÜUnK@_ƒyXVyUwmIU»Vƒ„kÇ¥šÿkkV¯m±n@ƒn¯ÜanVVƄz@Ž‚bœwÜb„m@wša@kƒmk»@™a@VUUó„w˜@nb°mš„XŽmnVbގVôanwšJ‚ak£lw„˜šLšÅnÝ@wl¥IÇӃ@U™™Lƒ¼kVǃÅó¯kVmmw@ƒn_‚Vn»°LÅ»@éÇçŹīVÇÝ@ÝğU™ƒaVݙ™š¯ķlŭġlƒ@óÞۂċ@¯nkUӄ—m±™IVġUwóKUn±¯—K›w»ƒKݐV„nl@„óxUwţ›£ĉƒUmŗÇ݃K™„ÝUlmKƒ£UVŽ@ÞȎW¦„Ò@Ĭšnny‚@nÒmœVŽ—¼@°Vbl@VlnUUwl™°a@„œ„@llnk°lbnKWĀnŽU„VxUŽ‚²Å‚m¦Û›ÇŚƒaU„Vbš@¦m`móX™Umm™xÅ@±Þn虲™U¯»m™ƒV—m@wƒU@wݚÝmLƒa@„™VÇUk„l°¯„VlkVƒ¦UšmxƒaULUèVx@„kIUxmWV¼¯VmȯšU„nl›È—@m»Å™ƒVWxÅbÅğW@kƒm@kVV¦mlnn@‚ō„l¦Åƙxkœ"],encodeOffsets:[[102466,28756]]}},{type:"Feature",id:"5107",properties:{name:"绵阳市",cp:[104.7327,31.8713],childNum:8},geometry:{type:"Polygon",coordinates:["@@„ńlV°š@Őĵ˜VX»ÆUĊќJ‚w„@È»m»š£°Kšk@ÇnÑƍš@„w°JUwnw@wšbVbš@VlźLUw„aƒ»„aUklyUUVakwWXwWƒUxkLƒmn¥mšwk™˜UX™lJ„w@aƒIk°X„¥Wƒ²l¥šaU™„IlmkklƒÈL@m°nlWU™aW—š@Vƒ„@UaV¥@ašk@Çk¹ƒK@a™K@kƒKkšÇX@VU@kx±V™èkIWwUVUkkKÇ@ƒa@wkml¯@kUWn£Wa„aVwnaV݃w¯@UaWx—n›JńUxUšma@L@„mbUŽU±VVnkxUƙ„VŽm@kkKW°„X@¤ÇUkÆÇnU¦¯ŽkƒmLVwÅK@UóbÇƁVƒ¦™L@‚±êX¦mVޚkÜÝnWU—„›@kšƒŽ¯wķšnš°ÒU„lln@@„ĶmnkĊJ²bV„lxÞb™Þƒbk»™m™n™@™¤¯bƒz@Žl°UÒ¯È@ŽšxŤX„yV¯°¥Uwƒw²XlºVŚ¯¼nx›š@ŽXݏmxnb@n™J@b"],encodeOffsets:[[106448,33694]]}},{type:"Feature",id:"5117",properties:{name:"达州市",cp:[107.6111,31.333],childNum:7},geometry:{type:"Polygon",coordinates:["@@Uxn°‚bnŽlUnÒƃnn@n‚¤„LnxlU„ššV@„Æl„x°XXxl`XœƒVW‚œL˜è—„±nÈbƒŽ°b@š²x°Kܼ°ĉ„V¦lJnU@¦šÞ‚JÞğ„mšLÞ»šxU„lb„VÆann„alŽ„VƍX@lnŎV„mU™maÅXƒa@aWmœ@‚£@wĉJVƒkk‚kkmƒnk@ƒmna@šal„Kš™‚J@Þwm‚ÅŃ@ambkUƒƒ@™™KUġKU@m‚ak¯±ƒ„a@aĉÑÅaVwšXlwƒ±—V¥l@@a™kƒ›@@£šmƒĉÝónWV@ŽnÝÇÇx—UmbƒaVkkk@m„@m°ƒÝýXm›akÅīƒ@@ƒmb@@xmšnbƒ@mxšŽkWL@ƒ¯b@WUXmWœWKkbm@kx™Xmm@LUl„xlêóK™nUš„all™LƒlLó°m¯JVšU„K„„@x˜K²Āô¦l°"],encodeOffsets:[[109519,31917]]}},{type:"Feature",id:"5108",properties:{name:"广元市",cp:[105.6885,32.2284],childNum:5},geometry:{type:"Polygon",coordinates:["@@ÆL„Ċx°»Ŧ¦˜W„™šLȄ@xÞKÜ°ÞnVxÅĀlÒnJ°a@w„V¯l@XWknKnw˜VȚ°XXa˜lX°VI°b„W„nšaššš¥@ƒw°™n@šyÆ@nkÞ@°¯lJn„°IÈl‚UšlXÅ@ķlUV¥VUUÝޙUUƒ@UwƒJUkĉm@ýƒƒlk™WUwVwWJk@VUK™lUkaVƒUƒmLk„m@ƒƒ@Uƒ›Ik`@„™UmlUkV¯ÇXKÝ_mm¯@Uƒ`kwmƒl¼±KV¯—¯Vk±Vk±kzma™KUnDZ™bk¦±ŽX„ƒ¦¯Wl„J@bƒxkIWš—Vlš™xnŽm¦„nlKVwX„WxXŽlxUbVVkzVlƒb„¼ƒbVxŹKUk™@Ua™a@xmxVx¯Iƒx™@ŎmÒ@șl¯L™¤n¼"],encodeOffsets:[[107146,33452]]}},{type:"Feature",id:"5118",properties:{name:"雅安市",cp:[102.6672,29.8938],childNum:8},geometry:{type:"Polygon",coordinates:["@@ln@xšèVInxVKn„‚ĊklxkÜVޚÒnÈm°nxš@š¼ĊLV„nx‚WXblIš`š@nmĉn‚KȄôÅlUÑmU„K²¹@ÇÅVÓůVýÞW„‚UVmX„ÆbnwšKUÿ‚™@UmmIUb¯¥Uwƒ™¯™Çmš™„çmanUm»UUƒl—kƒ¤ƒa¯bV™U_WĕmÇŚ±ĢUlƒUl™ÛVƒçkUƒ@WŽ¯KU™VkUağVmš™aV™WUƒmV»—¯@»m£ƒmÝLŽ±@ÈmVk¤mb@ôƒ¦kVkamL@b°‚@b¯¦ÝVƒn@l„ê™b@º„UĸL°J@zV@nmUƒlaĸÔ@xƒ°VҚ„Ub„‚óĢ„ÒWškV@Ò"],encodeOffsets:[[104727,30797]]}},{type:"Feature",id:"5115",properties:{name:"宜宾市",cp:[104.6558,28.548],childNum:10},geometry:{type:"Polygon",coordinates:["@@VlÈnl‚XnWLX`m„²nV‚@b°xĢçlnšVm‚nn„@@„°‚UzšlV°nޘÒkxl„w„`UnVb„mšL@albÞKÈۚmܼ°@Xǚ@wmW@ńKĊL„lV„šLVŎçÞL²±‚ğkw@Uƒy@¹lKX™lKVa@w™™Č@‚w@a˜ÇU¯n™@@wġak—™aō‚ƒƒK@Å»VakUWmķwkbğ¥mL™akš™@ġރ°¯xVVÞ@VšxVš—VWx„XlxU‚™@k²WVŃULmèULVĊklĠ„VœJVx±nŃ¯¦mwğ@mƒƒlğkkl±@kšUk@¯±Ç™Kƒ—kxl¤b™Imx"],encodeOffsets:[[106099,29279]]}},{type:"Feature",id:"5111",properties:{name:"乐山市",cp:[103.5791,29.1742],childNum:9},geometry:{type:"Polygon",coordinates:["@@kšVŽk„ššÆkšV²UlºÈIlxƒLXèÜlU„„XU‚mkƒbVè„x°@„@¼°Knnn@m˜ÆIUbnJ@bVI°b°±@nK@mVakkƒKl¯nbšmĸ„èl@VnÈl‚UUw„wmwnm°¥„L„™lLnU@Va™ImbkƒmK„ƒƒnk@mƒb™ƒƒLV„JVUUƒ„VnkVmb@a¯JUaÆkk¥„IW¥„Klw—ÑmÝU¯™kVy¯@ƒƒ@mmn™Ukmġè¯w@aU±mnƒW_XKWmkÇmUkóbUÝUanmW™ƒ¯nma—@ƒxVôUV@šb@‚l¼„n@l™b@xƒnÛa›xa@ƒyUÅmUÛbm°@„m‚n²U°ll™ĀȦƒlU„V¼nJVxUz‚W„z@`mL"],encodeOffsets:[[105480,29993]]}},{type:"Feature",id:"5113",properties:{name:"南充市",cp:[106.2048,31.1517],childNum:7},geometry:{type:"Polygon",coordinates:["@@ȲVmšLnblyl²²UUl˜°U°²L‚»„knlx„_VŽ°@nnÞ`WL°ÈUŽVlnkšV@ƒl_œJV„‚@„„n@lƒnKV£™Çšƒ„UV¯šm„@laX˜U„‚UbVx„@VkôJU°Jn™@™‚wUk°wnUƒV_nJmknmm¯Vwk¯ó¥±ÿ—L@wƒƒƒLVU™kU›bX¯mykI@a±Kk¦ULmaXƒƒVm¯ƒK—z±ƒklUIVbÇJšƒkL¯™l™ƒU™ÿ™UƒlUkJƒUmŽUUkVVklKk@@a™U@„™J„²ƒxƒ¦kĬ@¼±ºXnWb—xƒU@xƒx@lšL@b„Llº@șl@bU¦Vbƒ@U„™@X˜‚bVškX¯m@nÇKk„llknƒJVš"],encodeOffsets:[[107989,32282]]}},{type:"Feature",id:"5119",properties:{name:"巴中市",cp:[107.0618,31.9977],childNum:4},geometry:{type:"Polygon",coordinates:["@@V„U„lbkVšŽVLUŽl@XI‚ŽUxVxšXkl„„@þĊnVl„IVx„@VVݚVÞUVU¦kV@ĸWÆô²š@VÞnš@Vaôb²W@‚K@XUmÑUW°¯°Ina@y„_lWn¼lLUbô¼„Kla@™nkUyô—Æx°@šn£™Ý@¥mVkIU¥Ċƒ‚¯Û»¯L±w@™¯a„Ça²m˜ƒ—ç›KX„UW›k_Ww¯WƒwÅk@ƒ™Uƒ™kVmwƒK£@mmmńmÑkVmamnnlmIU`V„m¯xVlx@šmš¯IV‚óIUlƒ@UwVaƒ—VW‚kbƒ@™nU°ƒV™„šÈU¤"],encodeOffsets:[[108957,32569]]}},{type:"Feature",id:"5105",properties:{name:"泸州市",cp:[105.4578,28.493],childNum:5},geometry:{type:"Polygon",coordinates:["@@VVXwVKn„˜wnVƒn„l@b¯xmKUbVn°°X°@blLšènV„@Vn‚l@U„LnmmUna„VV_ĶV@wnJ„„l@@kkKVólaUwnJm„wUlm@ašUaôKVnJWbޚ@VšwVLX¥VVš_Þ`šw„WƒÞŹmmnIn¥Wƒ@k„WV¯@ƒ°kI™ŽƒLk¼Ç@k¤±Xk˜™nmݯUlÅÛKWV¯kƒlUwkLƒÓ™@U—@ƒ‚w@ġXV„˜WX„š@UbVbšV›š_kÇV™lU°lnwŎ¦ÞaƯnmm¯šU„™m¥nkVmkƒl_ó¥¯UÇl¯@™ƒ™L™kƒ`¯ķLUy¯@mw—¼ķ°ġ_řU°mlšnÇVUޚ„@‚ƒš_ƒJUnV‚UXšbl˜Ģb@x@mšV°—È‚b@‚xċ@šš@xUbkLWškL@º„zV‚@lxĠ±²"],encodeOffsets:[[107674,29639]]}},{type:"Feature",id:"5101",properties:{name:"成都市",cp:[103.9526,30.7617],childNum:11},geometry:{type:"Polygon",coordinates:["@@°n°m²°ÜUšw²ŽôVš°ŽVkxÜźUŰČb‚ŽĢlaÈL„»ƒ@k„wVǂ@„ƒnÛƻșUÝ°Kl_„V°Uš`Vbn@VbÈLšaVU@ƨ»V™nIl™šUUa„±lIk±š@VnKmÅ@WaƒK¦™lVōškK™Ý@maXÇmw¯IU‚@kƒVƒwUmVIƒƒƒç—ÿƒU±ŽÅ@¯È@xƒK@wƒLUbÇKō@mÝ£@yóUóóUxkI@WlIUaƒbƒaŽVĀ™LmxÅaWƒUnVƒÝXUþÆ°UÔÈÆ@±ºƒLnVVÒkóÆ"],encodeOffsets:[[105492,31534]]}},{type:"Feature",id:"5120",properties:{name:"资阳市",cp:[104.9744,30.1575],childNum:4},geometry:{type:"Polygon",coordinates:["@@„è„„UJVn„x„U@lV°JnxWÈnbÞ@šŽlLŎ™Ušk‚¥„LXbÆ@nŽmLU‚@zlbXmlnVynL„çšJVb‚UnómUnamU„an¥lKV_²aValWô„n@nƒ‚bVœK°¯VblW@kkƒlUnlV£°W@w„UXk°KVwƒmVkwVyVI@wkmƒVÅ_Umm@Uÿmbk£™xUaVw±V¼V¤kLWxU@Uk™bƒyƒXšómƒ°V@@zÝÒkKƒn™±U@@_VVkƒÇaVwnLWalm@@kkVVl™¦kIV`±n@w„Kƒƒk²™aƒVUUV¤™nkxmUkVWVnLUbVbƒ`kUU„mLU‚mX@`ÅbǚXbWLXŽ›n"],encodeOffsets:[[106695,31062]]}},{type:"Feature",id:"5104",properties:{name:"攀枝花市",cp:[101.6895,26.7133],childNum:3},geometry:{type:"Polygon",coordinates:["@@„b‚KÞnޙ@x„V@x˜n„Unš°¼šVš±mç²ÝÆ@šwnnšVWŽnôn_@¥‚™UaVƒ„bƙœÈ܎n¥Æ±VUwVƒmXÿmLkal¯km@k›ƒ@ƒ¯bkšVxmVUkk@Ua@¯˜»Un›mс@mz™m@īƒÑX¥Ç@ݙxU¦ƒšÅŽÇUkx@šlb„UWVX„mV@xĵĖ±@@Ž¯xUšÆLnÆm„šx@nXL±lUUVwKWak@WxkbšÞƒŽĉbUn@‚ƒ@@xó¦„Ŏ"],encodeOffsets:[[103602,27816]]}},{type:"Feature",id:"5114",properties:{name:"眉山市",cp:[103.8098,30.0146],childNum:6},geometry:{type:"Polygon",coordinates:["@@„šVx°¦VanJVnš@„b„aVbkJ@XlJVwôôôV@zÞ¤@nƎÈLVa„K@x„L@w°ÇÆ@²„V˜ĀœmWXKWașÆa@_nWVnKVƒlV„_UaVamKXUWwnmmwœÑm£@ynUƒkWƒĉUkWVkkV±çkJmkKƒšƒK¯¦mnnxƒxVxVÇkUmk@ƒçķ™nmak°„LllUb@nmL@‚¯²¯aUJ@amIVaÅJn—m@mm¯L@»ƒŽ¯@ƒwUç„anlVƒWVƒÛkWç„KkwÇJk¹±V™UÅl™™ġV™²ÈƂnXĖV`Uš°a„b„£˜l„kVVn¼mVnbƒè™šÈn°š"],encodeOffsets:[[105683,30685]]}},{type:"Feature",id:"5116",properties:{name:"广安市",cp:[106.6333,30.4376],childNum:5},geometry:{type:"Polygon",coordinates:["@@„VlIV‚„kšVšĀ„Vkš°šlK™„ÈIUaVJlk²„˜y„Ln°„UW„nbVKl¥²L@blJnzW°œalV°Inô¯‚K„kšKkkƒbV™šmôLkéƒwVk@KnnšWlwn@laXL›ŽnXVW@X°a@„XKl™nw„@man™@w‚@na@„„@ƒw™ĕġġ™wUkUWb@mk@™¦ƒ¥mUÛb±yÅn@bml@kV@„ƒlknVbmVnlmš—bÇk¯bWyk@V_UamJ@I—@WaƒVXamIVWkUkbVaƒUUxƒ@VnkVU¼›bkKUxmK™„@WšƒxnV@n"],encodeOffsets:[[108518,31208]]}},{type:"Feature",id:"5106",properties:{name:"德阳市",cp:[104.48,31.1133],childNum:6},geometry:{type:"Polygon",coordinates:["@@nUW¥²é@šK„¥‚UÈÅôa@VÆLUxnKl„°V¥ÈmlÅÈV@£ƒWX¯lLln@UšƒVÅlwUm²U‚VVna@ƒ@KnbV™VwƃœI˜mXwWƒkIVwÝĕVUa™IƒèmKUzkmWnka@y™@l²kJƒ²Vb™VkšmJUšƧ¼@UV™bÇKUam@Ua™_¯VƒUk`¯LVÞǚżm܃„@Uȃx@l„ƒ¼ÇKkbWŽœšVxUbƦnxƦĊV"],encodeOffsets:[[106594,32457]]}},{type:"Feature",id:"5110",properties:{name:"内江市",cp:[104.8535,29.6136],childNum:4},geometry:{type:"Polygon",coordinates:["@@²èlUUllXĊVX„„lmV@zn¤›ÒnxmnXxlUnVlwšmU£VV„Ušbl±„„ƒL@x²mU_lJš¥UklU@ln@‚kXbmKUxÈbl„UU@`V@š²„mlLÞÑ@yU@„¯ôn‚™„W„zšaVlV@XwlKU£‚»—aVaUwm@mwUVUwkƒlVDzLlƒ„KV™m_@ykUmƒ@mU™çkKmxkIU‚Ý„@LUJ@n±„kº‚LXb™¼@mmIXa™@mamnkW™ƒKUƒƒxƒ_U`UklwUw™mUbƒV™²ƒakbƒmkn@`„UmҙšVxUb™I™`UƒaÝÈ"],encodeOffsets:[[106774,30342]]}},{type:"Feature",id:"5109",properties:{name:"遂宁市",cp:[105.5347,30.6683],childNum:4},geometry:{type:"Polygon",coordinates:["@@ÞĖUxlJX„Vb°@„xUÞmbUxƒbXbm¤VX@lk°ln@x„bÈ@lLVlVUXxlJšç²UlwV@@UÈWl™„L„w@w„V˜wXaWm²¹@»lī„¥„wƒ±šI@ƒšV@bl@kLUllUVVn@mmU„wX™ċbVb@VUkbmamšW@kƒa@™™k@ƒlaUa™@¯b@šmmwó@@lkXUa¯°›LU‚am„m@óƒkXUb±bU`kLm¦ƒbnVmbnVmô"],encodeOffsets:[[107595,31270]]}},{type:"Feature",id:"5103",properties:{name:"自贡市",cp:[104.6667,29.2786],childNum:3},geometry:{type:"Polygon",coordinates:["@@lIÞDŽbVŽš_šJVaUwš™nуV@_lm„nla„bš±„UVašnVxkxVlV_„`„wV„„LšlXnmnbš@WbnJ@nš»WaKl¹²ƒ@mVI@KރVlJnw@aW¯¯¯UmVanL°w@aƒk„mmU—xmƒULWxUUÝKōèU™KUƒƒkĉKƒL@ÆnX@x™‚Wȯ@Û»™nÇÜÝLka@b™KƒnUaVmƒ_ƒxkƒLX¦ƒJl¦ÅlVb°I@bnaUŽmlƒUV„UVƒIUŽ„Kš„„a@nml„„ƒŽnLl„našJUbV@"],encodeOffsets:[[106752,30347]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/tai_wan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"7100",properties:{name:"台湾",cp:[121.0295,23.6082],childNum:1},geometry:{type:"Polygon",coordinates:["@@\\sŽ@pS}aekgKSu™SsMß`¡CqZ·be@Q^o@‹gieMp‹‰]}•}Ľc_Kk…{™ù“A¡r‰[uom@эĥJiq©mʼnq¯Bq]ÙYgSåk_gwU­isTE…“‘ĕiqiUEkue_‰OSsZ‹aWKo¡­q“ycY£w}‹ĩ™ĕS§Z©S™N¥SyLÑ¡±Ks^IY‰PdƒY[Uo†Fp}´\\¬\\j]ˆe܍ò‹¤¡–ā a\\bn™U㺹Ìs¼j®[cíȈEŽĝĆ`ļf¶Š®K|VØDdKGpVnU‚FjpH—F`†B’[pMºxÖjbpÎxp€¬‚|ΟÜÒCŠ²®‚ÜAp„ZG~€Šd˜ÞàV¨|¸€`|Œ²tx~\\~|dFf^zG€ĄŚhœdL\\hĸž¼†ŠOªP®lV`p\\]Xpll˜æ¤œCpQ|oF}fMRi†NSon_²qämœM„NM‹\\•"],encodeOffsets:[[124853,25650]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/tian_jin_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"120225",properties:{name:"蓟县",cp:[117.4672,40.004],childNum:1},geometry:{type:"Polygon",coordinates:["@@EUDAEI@WNMNCBFAHFFNACDJDPBD@@GD@DIFFHEFGDBDEQOFG@EI_KG@OcJQM]RMEKBGPG@[LaCIICBWKCEEG@WBQHCDFD@HSLEJI@IHWECFGAAEKCGDBFCBSBIDCKKHEADMJMFABKOKEQAA@IEEG@GIQAEK@OZEESMOL“lu@SLUTYFQCMG@@SQUAYKAACA@IB@BDB@B@DC@@BGAEFAA@BEGKJCC@AGAIHA@@JC@QEIP@@A@EGIDC@O@C@@@@CJCWKABFLBBEBSQGBAAMIEM@AKBcJEN@BEBCFMAEFEF@J@BG@BFABECKFG@AFQ@@F@BEB@@A@@AAAKAE@GFGDECEFEECBKIKDELDFEDYH@EIACDCHKBEB@BAAC@ADBHABKJIAIJICEDGDCD@@A@A@DHCHJHDFEFGBKRKBGIK@GIMHSBCH_BOJECCJCFKKMD@DNJEDEGC@OJCJHRUL@HRJ@H[DCNKDZHCTFDHCFFKR`TANVDFZRDLFARB@HPAPG`ILAR@TERNDFNHDLCLDDCXDYbHF@FEB@LDDVE@JPNfXPINCVDJJD@NJPAJHLXHDNANHhB@DPNLRMTBFRBHHr@`NBFEBOCCBIAQJDHCHLHFA@HSDCRLFTB@HEFLNF@PELBDJALFLTC@EPFLLP@tUHQJDfIHGTB^JTCPDLKAIBATFPADIEGECEMJ@JIAIHGECFEAGDI\\SPOXAFCL@BQTQBBTMZECYGAHA@GJAE@HCAEME@IECFKJADDBABLTHHG@ILEAMNDJCDHEBF@@JNFJELDFKTOT@JETBFFHBHEHKI@@IJEJ@XKEOUMS@AF@CEB"],encodeOffsets:[[120575,41009]]}},{type:"Feature",id:"120114",properties:{name:"武清区",cp:[117.0621,39.4121],childNum:1},geometry:{type:"Polygon",coordinates:["@@FWôµ@IFCLIB@EHNBp]AGEAKAEDMGZKFGBGME@ILGP@HEFB@BXMEAHUGC@IHCLOD@X[NWHWPKAEF[@EKIOL@EKGBNMJ@EIEHKBIC@BAKMIACCFQZCF]DB@ERAKADIHGEIBCGIIECFaGLZO@EFCNGAGDGAKL@BMG@IE@ADSDEH[JGC@CGA@BMDeK@EIACFE@@GG@FIAMM@CCGC@EM@ADE@CFMAAGHBDKIEAJG@DOGCDEKAGIS@KFCHKAEHIE]BeKNO[IFIOELC@A]GMBKVYCDDgGAICARc@MW@AQE@DGI@@AQ@@BKBAIQQYEFW@CEADIGGBCEIiMEMF_LGEKMBBDWEBGRC@E_CHYGCH_IAED@FFBQh@FGJaJ}AHRAREF@bE\\C@CT`FHC@\\BBF@BID@HGDDJ@@FAHKBARECKDAZBJIVNHCTA@EREAMLHDAFFBVFFC@RNRETHD@FOJMACH@CAB@P@DF@@FGDWE@FFSIEMKQDYCCHKb^JADOCIDGNDBdBCFJB@EC\\A@BJEA@JAAAD@HHD@LFBCFF@BERDHNhZQHMBGHOACCEBWEGD@PSJKCGEUD@CINLFGHE@AJK@HDABBHTB@F`DBFLBBHEDARCFG@ABJBAPVFE^FBGLGCFG_BMLEXGAAFE@@JNRVJHFALFBEHQJCTbNDHCF@PlFLJSXCHFHfVBTNJ\\BPJXC^FAVNFCHFB@FFH@JF@\\ABCFD\\BDMCAAJKQBGAILOEGHILECQLWFENJHADC@QxNHFJNLDFA@CBA@D˜UÂmR@FBL@BD"],encodeOffsets:[[119959,40574]]}},{type:"Feature",id:"120115",properties:{name:"宝坻区",cp:[117.4274,39.5913],childNum:1},geometry:{type:"Polygon",coordinates:["@@TZbB@JHD@DODCLM@AP@LL@BNH@ETFN@`E@DNG@CHLBCJA@AICFKDDBKA@\\N@AFNAGRBFjFFFL@DHLBLFQPcXAZMJ]GAVHAIZJFNE@JpDRRDCLFDGXA@EFF@CFFPDfEBDB@DCHCFCJDJIJBLI@I@CB@@ADBB@FALADGDC@@H@BB@FZGFCCE@@FMLALJDAFFFEFDFCB@@AHCF@L@@BBB@BB@FC@E@@R@BEL@HEFD@G@AH@AIB@@@FEFEBALDDEFAFO^IF@JCBBFPNJJ@D@PRDCEKBAXL@BIFD@T@JE@BHHJORFDI@@B@JGH@@B@BDDLIFFHCD@D@DEE@BAAAB@DAF@B@H@NGLJLMRDNMfGIEPMI@GDAKK@KIDIJ@GE@CFDN@FE@GFEPGV@TCDFKHBBF@RW@DD@@ID@TJFKIKLI@EP@IGBCLAEKLEN@KSHIGYACSD@SEAMBBMGEBMQBCMIGKFB[D@HDLPHDBC@IFITDLG@IIIFGVBNJDLN@VIRI@YIAIHIC@CLKZCBEE@JECEIHEAKGDGECBGEEM@@DA@CCCBBEGA[GEDBBoNAAH]MKiIAWKQoIIPMFQAEEDMH@FMSUYIeF@EK@BIOEKJEBICFKaKPFAFSE@LWCCFMHDDEKESBOGBKIEIODLG@CCDEQCEDWEMDIEIB@EHGEEDAEAa@@HqDEJGF[AECCFa@WCEIKAAEQB@FCAE^YDERDDJBLNABD@AJGLJF@FNIAMLH@FPKLJ@FE\\BFOLGXMXW\\C@KPGD@JHDGVFBWN@AEAGFO@KH@JNFAHEHYLNHFCLBFBBHo^MAFGA@KJED@Jó¶EX"],encodeOffsets:[[119959,40574]]}},{type:"Feature",id:"120223",properties:{name:"静海县",cp:[116.9824,38.8312],childNum:1},geometry:{type:"Polygon",coordinates:["@@NGFMDATCNDR@CCbINEHNJA@C\\EEGVE@IhE–[˜w”epc¢·²›^QEKIEKIgiQDkehY£uSDBMkUDOJDHC@GF@CAFBFEN@C‹Q@BeP@@G@HD@@MHQKi@[IGCOCESE@GMA_OcCGDu`aˆ@VZzKDkJBLNXGDqKEWE@cFEFA@ƒISIi@@KMABJGBcMuFEzGVH\\ATSEUBeALCEMG@CEBUHUCGXaBPtUBBFIBFTDFF@DDKBFNGBJPHXDDMDCLJ^mBIHIL@LR\\@LCR[@@z@NFD@LLBNb@RHDBNTPT\\F@BJF@BXCFBHHBDLFB@HODADE@@JHVXCPDHCFTLBBFNCDCCCU@@GAABEHHZHBCAEdEjFDD@GfD@DXFCHF@ERFDLBH@"],encodeOffsets:[[119688,40010]]}},{type:"Feature",id:"120221",properties:{name:"宁河县",cp:[117.6801,39.3853],childNum:1},geometry:{type:"Polygon",coordinates:["@@BFLBFJXDb@DEFD\\BHEFIrC@Gb@FBCBFFGH@FJAJFNCXFFCRDCFDDH@CKJPJFALPHTALFCFGCENDDKXF@ETEBO‚bLELJDFALIPFAJL@@FfEZJTVENG@CNFFRBNEJOpJLRBXjJNLG^BBpMAAFC\\HHBAFDADDB@@CN@FFAHFDCHLHFBJGFCFUNKJJTD\\XUXF\\^F@DDDQXXBRLRCBDFEVCDLVDpUl@LEDJHAPRFGL@CETGPBTCDDVI@CFF@GFDCCVGLKEK[Y@MECISG@BKNSCGCKWEAaEBEKNGFSECO@GGM@GYI@DÅCMLHPTF@DJHAVVNKEGDETJ^[TJNNd@NOAMFYJ@@GFANDPEJB^aOadSTQSI@MHBDIEOKCG@EEFCKCqXO@@DMFENCDDHCCGJ]AKFoDaGGHYFDHKJiCMFGC@EQ@AEHGAC@IEAATKOHGIC@IXIFEoƒGE[JCFCDHNmRADFZMF[EEBMO{GU@AOW@@]ZeHBDEHBKEfQkuIWBs‡@EC@d[@[^EDMTKCEEcI@cDAB@FCBCACmOCG{PYHeBgPwPFDDALFFFCHQGSD@BHFAR[TaFYXMASUiGFL@DQNCJI@@D@PLDN`ETEFIGMCGBCE‘~CAIFDPEHGEQPHJADFJGHCJLB"],encodeOffsets:[[120145,40295]]}},{type:"Feature",id:"120109",properties:{name:"大港区",cp:[117.3875,38.757],childNum:1},geometry:{type:"Polygon",coordinates:["@@JFFL°_`ONJKDDFIFZN xlb~yFVNRŒrdJGzDPVFBCTNND\\UR@E`F@@Ip@IWGUoawOEE@ÏDgK{İEEMFëC—b…™@—KwOCDHHKBDJCDEEEAGHOABFABMCgDLSQ@CFEB‰MgYIDQINE@AUSwSAdYEHQMEyK[KI@GRMLE@@OqOoBOnpJ@BmEAFHL^FDB[C@BBDVFAHFJENB@sNEjQAMYsUgCSBGDJH@\\LjGR@NC@@G@HO@AfR@DŒM@EFEADBE@@HGDICCPlVANTC¤vgZlfRChjLJ"],encodeOffsets:[[120065,39771]]}},{type:"Feature",id:"120107",properties:{name:"塘沽区",cp:[117.6801,38.9987],childNum:1},geometry:{type:"Polygon",coordinates:["@@|ODHnPBDADEDA@CB@ddJFFLDNSFC\\]\\@@cFDˆ@nACOMW@M@ITURBRZNHNWRQšoO•j½f‡cqŸAqeiDÿÍyÓįFL|Ch@ÐFFxPpbHVJXo@@JCTR^BPABQA]^MB@bE@@FQBFVJRH@FXtPNZSBAja@@NƒDTŽLJrQTHFXZFB`"],encodeOffsets:[[120391,40118]]}},{type:"Feature",id:"120111",properties:{name:"西青区",cp:[117.1829,39.0022],childNum:1},geometry:{type:"Polygon",coordinates:["@@@LHAHRHATh`LHNHDG`HDGZ`D@FQDAHXFACNAFLVRTBFOfHDCVBFQH@HSXHEPFB@LDBF[bDbLFKJBFLADBDjLvCPEI]FGEIGCBEUSjcFiBIVWfaHCjN^HtwBBFGPBJGjFBEGECGDONMFAP]TDHQOWCMGAMHKIJEIGQ]aDlUG]VGEGDC„{PEbBZmE@@GH@BCA@FMQCFMYMJECELCMI_P¯`]R±œ¡¸od“f—x•\\gF@JUFFH[F@DIBGMMFaJDDQ@MCSDCBENMH"],encodeOffsets:[[119688,40010]]}},{type:"Feature",id:"120113",properties:{name:"北辰区",cp:[117.1761,39.2548],childNum:1},geometry:{type:"Polygon",coordinates:["@@ROHFFGCOJEDB’}DFHANDJHFEFSM_KC@O@CJ@DIRM@CEKKA…L…FKACHoLSJSIBETDJaEIIE]E]K[MYUYQILC@GF[MGNKEK@A@BCWECAIFEFYAGFOMI[OFuDiKACBCEKIAELaKaCE\\CA@KEAFOWGGTG@ERUACDeGEPSAUQKHE`FNjNFJADHHCJFB@DEXZFRRBJLA@AR@@BJ@CHF@BRX@@NQdDBBJhHCCZDLUNA^H@BKDPFEJ\\JMPfL^AJFFGLBDGLET@HJLBCFHDCPH@BIJFCLGABHNBDEF@BCN@@FHDDDN@BNEJH@@HF@DEJB@FfLNC@AHB@DHD\\IFGTCBCF@@JNH@ALKHBHCHBDMFEP@KYbHDEJF"],encodeOffsets:[[120139,40273]]}},{type:"Feature",id:"120110",properties:{name:"东丽区",cp:[117.4013,39.1223],childNum:1},geometry:{type:"Polygon",coordinates:["@@ZV\\N^L^FJFFJIbSCAFTJTIpKDGLB†E†KLBjHTVNBZWbE\\SBQGE@ATCRHDGEEKECBECxOhOfAZGA_YEEWSGqRKIS„C@Mb@BiTAMYsOEWG@IQEURA@EF@@acUOXQRYCUDCHDTEF[SUEgAYDcVGJM`iAWDWLQRMHUHgDsDBLHJFCFDFGHBFFVEAGHCJN@RJF‡PIhBD\\FENCPWA@LFBAFHBEJUEARCDIAEDQBRNa^"],encodeOffsets:[[120048,40134]]}},{type:"Feature",id:"120108",properties:{name:"汉沽区",cp:[117.8888,39.2191],childNum:1},geometry:{type:"Polygon",coordinates:["@@LMEI\\MTABKN@FCDMH@COAcH[AoēA™M¡Wa[Meq™pQRMXMGQYQASV@J@NNXDPmBAtJXlveRLFGACFGAYf@^X@BPV@|HNPFA\\FNEEYBCnQGMDCDE\\IHFp„EFWJ@JJDGHLPBSFB@JBDGHBFR@@FHDNEjDLICGZEHGbHpCLE^BHIDDCGDCFMNE@CP@rWLDEDFFH@"],encodeOffsets:[[120859,40235]]}},{type:"Feature",id:"120112",properties:{name:"津南区",cp:[117.3958,38.9603],childNum:1},geometry:{type:"Polygon",coordinates:["@@TLv@CNHFFBHGZFETNPhCVGNGRQXKXCjBN_HIdUZChBVF\\TFECSDGVCZDRQPWdVNA^]RBBAAOQ]DSE@F_Q@[VMCSMADUECOHycI‹qMQEU}zkaŸwENRDENB@ADG@@HF@YnaAOFƒ|CDFHUHH^kVbCR^JHIFLJNGHBDNPXGRSCO^EBMNCPDHHFAFiEIHOAEH"],encodeOffsets:[[120045,39982]]}},{type:"Feature",id:"120103",properties:{name:"河西区",cp:[117.2365,39.0804],childNum:1},geometry:{type:"Polygon",coordinates:["@@d@hZNFdcLYXKRCtCMOFSYEGHEAGEDMu@SKAAsx]GMTGt"],encodeOffsets:[[119992,40041]]}},{type:"Feature",id:"120102",properties:{name:"河东区",cp:[117.2571,39.1209],childNum:1},geometry:{type:"Polygon",coordinates:["@@ZBVFFIGABEEA@KXBDOFM[EACJgˆOIE@QIMGDBHUFEEGAEHECEDGIAKQDWLKZcdQPEP@FOFBJTJ@HNORJf@DBCN"],encodeOffsets:[[120063,40098]]}},{type:"Feature",id:"120104",properties:{name:"南开区",cp:[117.1527,39.1065],childNum:1},geometry:{type:"Polygon",coordinates:["@@NMVDCG\\E^B@HlB@YEDS@C…HsNSiMGDebUXAJEjidVTAFHDFJ"],encodeOffsets:[[119940,40093]]}},{type:"Feature",id:"120105",properties:{name:"河北区",cp:[117.2145,39.1615],childNum:1},geometry:{type:"Polygon",coordinates:["@@DBXFADB@L@LFHM\\NHED@JKZRb]QMRAFCJBDCBQYADMCAe@QIMP@GSIAIPE@E[EGH@ZEF]^HJAXK@KF"],encodeOffsets:[[119980,40125]]}},{type:"Feature",id:"120106",properties:{name:"红桥区",cp:[117.1596,39.1663],childNum:1},geometry:{type:"Polygon",coordinates:["@@J\\PNHEZBFEJELEL@BWGI^]FEkA@G]A[FDHUCMNEHJ^"],encodeOffsets:[[119942,40112]]}},{type:"Feature",id:"120101",properties:{name:"和平区",cp:[117.2008,39.1189],childNum:1},geometry:{type:"Polygon",coordinates:["@@D†T@FCHG\\FFOROMEgYc@"],encodeOffsets:[[119992,40041]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/world_geo",[],function(){return{type:"FeatureCollection",offset:{x:170,y:90},features:[{type:"Feature",id:"AFG",properties:{name:"Afghanistan"},geometry:{type:"Polygon",coordinates:["@@ࡪ͇وŐǬϠڐŶӂʮǚڦ۾njƀ̚ІɣʪҴMوǯʲĹ،˒˰Nj˖ϪԈiżŬĘͺβ̈Ҕȏĝʱʪ¡ý۷ͪ˟̊ǰώĊԼϖׂ×ࢀAƬʋӧĥяƹ७ĭࣗǭӫλȤΣĪллΛ–͑ɳ̡ߛ€ͦ։՗ɅΥԕ²ԋ͡ɿ̳þٝŋğɻسDҵӇ‡܍થΓבôǝȁԇņ࠿űටіހހåզُƚßՔ˟ڢάҢιŮɲؒ΂ਸ"],encodeOffsets:[[62680,36506]]}},{type:"Feature",id:"AGO",properties:{name:"Angola"},geometry:{type:"MultiPolygon",coordinates:[["@@ȸصʌԋȘ˕͐ѯ֊æˤŠҬşŲɀɂӨԶ®ƤіHñ̡৴RfՉǞ͕ūԑÖԫ˪̷­ৃȼüκsԴŴϦ¹ĘʹĩСƨϿů̿î́ყZᦵ֤ۋպԽ໳΁᎝Š׋Ж₭—ŵÏԃϞկ~ԉƝЙDžÿՈŜ݊̂ޒªΰ˚ݶȨΆӘռːϐĘج«ӊʣ̜ɡԚȵԎ®Ǩʶͬʭ߼ǣ֚сՐĄǎΌŔʒg̎ĸៜ["],["@@ɉėɣلͼδʪƘ̀˽̩ǯƍɍλ"]],encodeOffsets:[[[16719,-6018]],[[12736,-5820]]]}},{type:"Feature",id:"ALB",properties:{name:"Albania"},geometry:{type:"Polygon",coordinates:["@@Ń˷ŢέΒȳiə˗ŧ»˙ϷСƛÐgȂү˰ñАîֶŖʼƗƂÉˌθаÂƿɨôǴɥȪďȨ̂"],encodeOffsets:[[21085,42860]]}},{type:"Feature",id:"ARE",properties:{name:"United Arab Emirates"},geometry:{type:"Polygon",coordinates:["@@Ƭ¤ŒɱڂƂ۞uԖ{ֺ֪ظՠՎԮdž˹ŖڑѕGçճƪŝϝǑE΅ʓΏuͷǝDZᡋъ͏࡚Ț"],encodeOffsets:[[52818,24828]]}},{type:"Feature",id:"ARG",properties:{name:"Argentina"},geometry:{type:"MultiPolygon",coordinates:[["@@ߗ§ѓ̔ԑx࣑@Aሞ͒ϵрؿનԋ୲ȿϙп"],["@@Ӵ؇͠ڰॠ“ƊǷ໶ോۊŷਆاࡾ͡Ŧχࠡ౧ࡒɭ़ŷڔƈނ٢ƎݐжLjфӝiڣۻҩ֟΁ॅࠃ૭ଧȽڥɣࡹT࠷ǽȇÝիËѫ੨ܙŗ׃Հν§Ч߯ઁఛ҉။ǩउĎǰԅǣػƺщԋ̏ࡱř̪͕߱ɗŜ࠳֨ʧҠˆʢѧޛʻڭԹūࡋȣ҇ߏEڃљʋؿؙࠞߦǝ˿ݭ঳Ӄձটލͧ΅Ͽ˔ࢍ֔ӡΟ¨ީƀ᎓ŒΑӪhؾ֓Ą̃̏óࢺ٤φˈՒĭьѾܔ̬૘ěӲξDŽę̈́ϵǚˢΜϛ͈ȝॺ͸Ǣƙ਀ȠࡲɤݢԊ̨ʭࠐEޚَոo۰ӒࠎDޜɓƶϭฐԬࡺÿࠀ̜ބռ߂צԺʥ͢Ǭ˔ඔࣶд̀ࢎĹɂ۬ݺશȱ"]],encodeOffsets:[[[-67072,-56524]],[[-66524,-22605]]]}},{type:"Feature",id:"ARM",properties:{name:"Armenia"},geometry:{type:"Polygon",coordinates:["@@୞ƀǨə͌ƣǛɁ҄˽ʁˋΦɫϘƏl׋̣}΃ӢHżχCʝɤǩuͧʖرȼĄФƛ̒"],encodeOffsets:[[44629,42079]]}},{type:"Feature",id:"ATF",properties:{name:"French Southern and Antarctic Lands"},geometry:{type:"Polygon",coordinates:["@@ը˃ߐĿˆDžɽϣಇÃq҂ŮΎÊǢ"],encodeOffsets:[[70590,-49792]]}},{type:"Feature",id:"AUS",properties:{name:"Australia"},geometry:{type:"MultiPolygon",coordinates:[["@@ߺ́ҜŘپNJԎÉÐঽ˽́ēگ̉ɰ׍בǧ®ԫ€ԭܘŗֈӝܸtϬռõ"],["@@̢ڇբ̈́˦ΡЖ͟đϋǴܛŸнɄĹɬܕąѥ˖֭࣬ѭצЋ֞λŋȯӔՃࣧ͜ͲȂ;ηȴźƢࢹ׬ԩϸ͋ڀڹʀڭtӏËԳА܋µݓơϵɩݡjӕǕ׻χއثЭ̫ٱ˫гʝܧ͕нɅػʼnׁªˇӕ̇व‰ޡ·ϫ͙ԕέ۟ψԥƪżѬҝǃ݁؉ܩɪӉƄӑÔ߿ʐիԮƻْțьЭ;߱ĸˢРȯزЧ׉ݝƷѮҬŶӞ͘ЬãجہܑԿ˽͏ڛٽΊ~ҀԿ،ѹ̀ǂȘઃԚןz߯Цຓāછ̝ख़˫ߡÈࢻљܯȗljѱ̳Ϳ܉qՅõݑƶ׿ğֽԁ҃ʕœуʁЗˋؕ֛Bࢽ՜ҋDŽlӖкŘƚȒ‡̠ĺאģӼѻࡖƏӒ˜ӎͭնsʚϋͰĽڄӓڔřΪτε˳ެиʑʞ͗aјеڎă˄țʦĠӠǢȸŘрęӮΎ؀Úٕ΢׀ۀˬЦΪٜ̰ϤàɴĻڎ̺ԚĤŶȀɞüҬoࢨʖҚώɊ҆ӲѐœͲvҘט܎ΠܩΦǚ̗Ј˂ТψǻĸٖҠаȮͨцƜ`ɼτĭdɂτŦОŔبϫҲӽՂMՖÿDZҦДڪϜɘſȾκӒԘ̒јıۺǂeі؛ˢ҂Ū֎ȻҀ·ۼɋʈĐԶʵӬʊ͂ñȠNJϬеɡ͉҇ͻ˿ƒĮͱʙп̗ЭÔʁڜҫ٨ˏѠ́؈ӻʂBѰɍŶʷߤ˵ֈ˼ǐҊǠόľҤʰڞŝОÔʔīӔŌنLjǠŽˬȮѾdžҦtʈ̸̾ʂЩÎՃȾķ˜Λ̨ёÚӇ‡̥"]],encodeOffsets:[[[148888,-41771]],[[147008,-14093]]]}},{type:"Feature",id:"AUT",properties:{name:"Austria"},geometry:{type:"Polygon",coordinates:["@@Û΃ӁCǎǻ˧էLJƗܽsщȏۛÞயɐȉ̊ࠧƣĭDžԗŢѕxϝƶźȴƬʪ²ьɹŤɜݎ•׸ƮЖ}ˀǣþƜšո̠ń̒ϰز˓ӀΆ̐ÚٶʱЂªϰǁãŃČ̅"],encodeOffsets:[[17388,49279]]}},{type:"Feature",id:"AZE",properties:{name:"Azerbaijan"},geometry:{type:"MultiPolygon",coordinates:[["@@ʞɣψDGŻ΄ӡֽŒщϰƃ͆Ǫv"],["@@ϊËƞɈԈͺѴѵђ׭ϺŸʸɧۗãƣٵƟ̭̍ȝvзȽ¥ԻѲ̂дʝʚ̿×যإk׌ϗƐΥɬʂˌ҃˾ǜɂ͋ƤǧɚȶƎضʍҐ¹ŘIJбҔɔŚʀ…׀ԙ"]],encodeOffsets:[[[46083,40694]],[[48511,42210]]]}},{type:"Feature",id:"BDI",properties:{name:"Burundi"},geometry:{type:"Polygon",coordinates:["@@Á০ɃϢԜßʲӎҀŸͧǸȏT˗ȹǭ͛ѫ̧̥΍Ÿ"],encodeOffsets:[[30045,-4607]]}},{type:"Feature",id:"BEL",properties:{name:"Belgium"},geometry:{type:"Polygon",coordinates:["@@؜áުǪՐοҦȝħ֧ɕĝһܿϦћßדІϷͶϷ`ũ̒ڪǔ"],encodeOffsets:[[3395,52579]]}},{type:"Feature",id:"BEN",properties:{name:"Benin"},geometry:{type:"Polygon",coordinates:["@@ۛįȹ׆žኞǛǦЮ̇̌ʱʞņѶ̀ĨǠξЪĀȀʤˮʘ̠F٘ә˩ȎӽǓͷĘɧСԳʵʳǁՉt՗µണ"],encodeOffsets:[[2757,6410]]}},{type:"Feature",id:"BFA",properties:{name:"Burkina Faso"},geometry:{type:"Polygon",coordinates:["@@ֹɐϽ‹̍Ƀϗǰƥ˦ϙǾÅӦɮΤo˴ښۢŬּɲȴОœΚǢŘɎٴϖdžˀ޼ΒҦŢɀLJՠJáСŔϣӀչ€НॺȏmֻǿʣЩÿǟν˿ħ݁lϳâ˓ƉωÖร¡qӉŘم"],encodeOffsets:[[-2895,9874]]}},{type:"Feature",id:"BGD",properties:{name:"Bangladesh"},geometry:{type:"Polygon",coordinates:["@@i׽̉ŶÆگʉѬµєDžКΕӨޟ’ü΋˃ҳΧǠũƵʃĠ͗øŽۖ̅لƜԒԫɤȆ̪Հ̼؅Ѽ֮̔ږεВ£ô׏ߞřު^Ӟƛϯ܅ϕµʷӍҢѥƎ՞ɶFѶ೯"],encodeOffsets:[[94897,22571]]}},{type:"Feature",id:"BGR",properties:{name:"Bulgaria"},geometry:{type:"Polygon",coordinates:["@@ʎΉ͚Ö٦ſ௾«иɌবȜ̩ؒӴĕѥΏ̫׹˔ӏܣŒࡥ˃Uлޅÿס̊ڧɱة|Ñ֊сːƒŢĝĴƘˌ͌ˀСδ÷̬ȸȐ"],encodeOffsets:[[23201,45297]]}},{type:"Feature",id:"BHS",properties:{name:"The Bahamas"},geometry:{type:"MultiPolygon",coordinates:[["@@ȵ£ɇӜ̿ʐǾՔʨ‘ۣ̎Jӥ"],["@@ࣷƅÏ̴Ђäֈ{~ɕ"],["@@ƟׯƷņ`ѮϓͪCĪڐϗ"]],encodeOffsets:[[[-79395,24330]],[[-79687,27218]],[[-78848,27229]]]}},{type:"Feature",id:"BIH",properties:{name:"Bosnia and Herzegovina"},geometry:{type:"Polygon",coordinates:["@@̦FȿσМ͓ūЃȡ™ƽû˙țūҥݓ͈ͅΘ͋Ȅϭ̾ǻʺЩϾǬΒ̞ȕǼǨϾnܠƓ׈\\Ϟȅ"],encodeOffsets:[[19462,45937]]}},{type:"Feature",id:"BLR",properties:{name:"Belarus"},geometry:{type:"Polygon",coordinates:["@@߼Mࣰ̈́ȚӄېːÿϔԜƚ͖ࣘࢮɁŢȻѲĴࠒȧĊЁǷɧՄս΂Ƴ»Ʊ֦Ʃʎɡ͝ǿڳˆljÿȠ˧ȸ՝ܝ¹ʵȁÃхͭĆݷ¡əȞ̿ƥ́ŨڍjफȬࡕàٱmҡɩГeϐʷϴԌǢLͰɷ͌™ϊ"],encodeOffsets:[[24048,55207]]}},{type:"Feature",id:"BLZ",properties:{name:"Belize"},geometry:{type:"Polygon",coordinates:["@@OŮĸžƴı̞ԔDŽZHūDŽGaɭƋεôŻĕ̝ÀăīщǓɟƱǓ̅ʣ@àॆPژ"],encodeOffsets:[[-91282,18236]]}},{type:"Feature",id:"BMU",properties:{name:"Bermuda"},geometry:{type:"Polygon",coordinates:["@@OEMA]NOGNG\\Q^McMOI_OK@CQSGa@WNLVWHFLJXVFGJ`ZRTDLeeWKIHGIK@@[MQNi`]VDTBHCJAPBJLVFjT^LV\\RJZRn^RH`TfJjZHHOTTFJP_NOX[EYQQKMEJOLANJH@HQHAARF@ZEPS[U_IcRQXE@EEKKOCGGCQCOGISKYGUC"],encodeOffsets:[[-66334,33083]]}},{type:"Feature",id:"BOL",properties:{name:"Bolivia"},geometry:{type:"Polygon",coordinates:["@@य़”͟گӳ؈વȲ۫ݹ؅ŗ͡୆ҋऺˆ߾ѳ΢ŏ؆ЫֲՌ࣢αۺȖ˰ƭ̶͠рh܎¤נǸ˶ܩഠزíѠnȈʪ݀;Ѷ͂સƚęؽļ͓ãࣰ֛ݫऴƑ̻ͦ֨ǕΐʑՈTӦʟšӟǐʕZγʓa͒এྖ“ūӟĜͧҞɽȤԹƫڋɯρĄӏʿǥaʶ޳јޭ^ัʓЕ݋sҋͥ৕ƉǸ"],encodeOffsets:[[-64354,-22563]]}},{type:"Feature",id:"BRA",properties:{name:"Brazil"},geometry:{type:"Polygon",coordinates:["@@૮ନॆࠄ֠΂ۼҪjڤуӞеLJǒӜŖӼBҦ̡ƴ̿Ƌ̻œį͔ýޔƿʤ֥ɪ΃ǏࢱLjÈଜʝҴˀǦăӐɰςƬڌȣԺҝɾěͨŬӠྕ”͑ঐʔbYδǏʖ™ӠӥʠՇSΏʒ֧ǖ̼ͥळƒ࣯ݬä֜Ļ͔Ěؾષƙѵ́ܿͽȇʩџmرîӃƟϡĪÈ౨ۏӷݏv҄ͅ֏¶DzΰұԞΓݴɜƶA΢ԖʎċҔɊ̈Ôϼ०ֲێNJŔŴݴŸϚᘰpθſӔύ̬LؐӀƒǚē†͐ӯĔYՀ࿖k˦̂ɸˉǐӷǂļҨѻٸÆnjʲشȞΊƐĮΤ׸ʆ¯Ǯ܅ðśՊ’֞ϓɒǀþجŅڜȿʐȤ؀žल̮͎̾ŏʂѪšȜȗʼnσ̀ŵȖϷɷ̏ƅ܏ɌыÔϳԬϿЮ¥Ģǒˆ˜ϠƦ˚ɢҬíȲŠҚçøǢƗǘĎʐͺõЈĒӔDZξǥʺɪȊ•ŘɿДÒ͒͊ʴؤӼޒ˺¢ȺҫҼ฽҈Ƒxׅمەʾʩ๤ƁŠࡃٔր੐̟ඊԡШӱƏҫ঎ʶ࿐ѹఴŽఔ۝੸व٪ʏܖ‘̦˅˸੭Ɣԗͯ൹ёշஅୡՙोثܯȿgɻءÒ༽ɹಓęօˇͧƫ૱࡛઱ƛࢁڹηȟԋ࣯Fೕ͓סύवʗ঩ڝ܅࠯ũطƔҫƽࡓȏЧחҥट๕݉ڗ֯Ͻϥߛ։ӑɷӈψЊӟֲڇҬࡹՠ̹{ࡅٰձę"],encodeOffsets:[[-59008,-30941]]}},{type:"Feature",id:"BRN",properties:{name:"Brunei"},geometry:{type:"Polygon",coordinates:["@@ͬ̾܎Ң›Я·՛Б€ǭ˹ϥѦ"],encodeOffsets:[[116945,4635]]}},{type:"Feature",id:"BTN",properties:{name:"Bhutan"},geometry:{type:"Polygon",coordinates:["@@΂ˍÏԩۇ{ۿÈՇſޅ͊kǚ֌زҒɈ׸șѺqπɥ"],encodeOffsets:[[93898,28439]]}},{type:"Feature",id:"BWA",properties:{name:"Botswana"},geometry:{type:"Polygon",coordinates:["@@ǜƭ˄ӡॎइήĝD̑ʚՑٰŹ՚ϝ஑أݭع˩֓ʧ́ҙãƧГďʽ՝țہ¤БɾΟĸХșȵГЉʧпϑ׻đȇ̐üԠӽߚɧŲAរࠤˆ|Ჾش„ಖ͎̎΍՜ͤʮDӂȎưÙ͔ڣ"],encodeOffsets:[[26265,-18980]]}},{type:"Feature",id:"CAF",properties:{name:"Central African Republic"},geometry:{type:"Polygon",coordinates:["@@ۜÚƺɎƔgȾȏ੔͐Τ͠Ѭ̌ĉ̐ʂüߺ½߆ϴ؊ࣺю;ՐƜĪΫӜԿF΃ƋΓÄʻ̆ʍٖοҢͻT˗֠ѫΖεɆԋغͩƊˉˣęաpكĘ̹ïųȱ˕}ͧDzधнϥĎŗÝʥԕطǐؙĊ՗̴ۓ˸҉˓͛яùדգ²֩Ƙԅѻѯޱėʐ›Ϧϧ˔̳Ѡï̠ЇѮæʢċΞÞٴȬƴц࡜"],encodeOffsets:[[15647,7601]]}},{type:"Feature",id:"CAN",properties:{name:"Canada"},geometry:{type:"MultiPolygon",coordinates:[["@@؎œުxЯ΅̵Å੥Φȿˬ͆ʸ̎С"],["@@Хcઝ˂ޯІ̄î૆Ɂ࡮Η|Ʒ"],["@@хŝൡϢʥ̘ݩ̌Ưʈࡻư͕ҜðȚࢨǿԨŵ߄ė˺̃дЋ࠼΍Όҩ"],["@@։ܿո˴֠ǵ̏̉ݚɱϰȴ࠼ʵʹ؛טƞņѿʼԷΝ݉ϝ‹փǂǾیɻńইܯԅ†צЂ߫Ȳࣙ¹࿅~ŹʠԼ̐λɬ۸Ԓࢄ೾Զӎܲ̂϶™Njɫ҅Չ"],["@@@@@@@@߰äʥ॓ܶگͯDԑϪ̵ϮчʾƻτºˎЂŋ"],["@@͡ѳχîəʢ Î͖ʦΆkɈǣ"],["@@ঝҧץnǿɪزϲ଼SiǍ"],["@@ƼυјżӨɗं˽४ʽöЍؤÞ׶˥ݙ˃ಳȬҽϚ࠭ҁ஡ѣ˿Ӯଗăܴдņڌ˺ޔ؈å"],["@@ष¥ȿЪΦҼޖŜپɷXέħřձʛ"],["@@Է̍ଉʬۃğଫϘ݊ʼטζࢼʃԎƯʦDžԠ͍"],["@@G࡭૰ڄ৐եʡح߾֥࢚؈ؖܨ°ईஞÝఔūૼй¼зس҃פ҇ŃУ࿩חୡŻࢃʨʣуߵ۽ʓοই֩ளÇڏΡÇձ঍Ŀਉڻ࣭ु͙ڏ±উంƕϜ޻ϼّ୲ǔ༞εࡀ͋׺Ѕ੆ɳࢸΟ൶µࣴąƍܫʼࡋ،ळనߗ٨˚ҔࡺѭೢףѶഎЀ॒לҮהç֭֘܌৷لলࢤνݾ˫ಾגȘ෸ɫࡸć۠ɚ޴˵ਚӣʮ͙ຄÛ}۷˪ਜ਼ގſ،ӵ௖Ұߦऔ֌ϸٺݣબੳघ৙͵Յ૤Ӂݰӓംɏբˍͬ܃ټŏͶͅÖऻ؍́׽̏൯̗੏ۑ෇ƋᅛǮుPࢇÍ۱׽ੳω௉૗ॵޡ܌Ɛഘૄᄈ۪సČݔЫߍ֟ˊࣟ˜هતп൸ŨࡆीÎ؍ժ̥ਣսᇷԁ࠯ͽय؁ٓ֍܆ฤ۞഍ƒणĹջӆBନύʐ֛ƛ˧ɚٙىʱٹ̕ϡΥŽˏ¥čȹ໽A౥MϛƷࢵ؃Ŀßˍ͝ޗBࠛGϛƅƊǑøʯeďષлࡽſউ҅Ɂ@˷ƂĥŦnĔȂ̎ЂҦʘӺǙܴǵނ࢕ЂľƬūĺɳ@ǛƆ¥ȤǍēɥ€¾ĊȡĊćɚٵːڹ˪ࠑ͘߁̨ݧʃ˝Sਕɔڻʼnࠁʺ࡫Ɔו¾ʻƜƫҤ˳IE͓჏BᮝA᭯@ᡃ@ᠿ@៙@ᢡ@ࠛ@᠁@ᛷ@őF྽ࠜ׵δຽΐҳݖŤԨ੻ΨƧڴ৭؎iѠҲКwՌෙ՘࡭ॠՁ׾ޑϚ֣ΈѿѢࡇ˕ࠇҹݛւדπࠋɸࠟ|JⷎNᷲ༬ȭ೘Й࢘û݆ΖৰˀఢĹ఼τ൘Ⱦ־ΑظȠȊЄ׈ęෆݫ૦֬ŖّਔƐ͆ʖৰ·౼Λዸ̭ୄƛࠖÄଊэ஁зຶǷᗘIJܒƦࣆԋࣴьࡩΦժ˼৾žڦĎڴȩࡊҗरä๢ϛಬƄ௬oĭԺݞƦದ˵KߑՖڠڰuϞࡊ࣑԰কͺäघশ؎ૌƇࡘχଞॅݗЭ༠ǝ"],["@@нϿሎʬୠщॊіސ˟یࠛфΒ׭ࡰ݊Ŭ࠲Ƈश͹ՆࠉʼץථеະЉĝσൡã՚͓˱ູ̯Ƃฃɪঋ»ཅ˷ᒃű๻āҕІଫɮݙģਛږ֔ĚಘƜஈ›રƦྷȞᅗã஗jѷ̴ዎͲಗ[ืɚ۶ـגͮᖬԠ࡬Nj"],["@@݉ևಹך˸Ş૸’ٔȁ"],["@@öɵࢿ|ࣟjࣿőʑ¼ऍѾ˜̠ИÈነěชң"],["@@ڎԽޤڴᒆΈ෺ࢅůջဒʒߒͮሀыୄЏŊν༚Ȑ࢘՗᎐ܸͩ͹ߐ޻໯ϹጘչೲȁீޙೖÇʽכ้ঋਗά೓߲ઙĿŁӕࢪӥଜϯΌɟմࠩ́׿੕ɪᑏڨஎܣ࢔ԕƎ̉ᗱͲᅩӤ৳Ц̌ʂయќ௥Т`ʑᝡƅ܃˾ֆؤ཈dႸņ˫̜̊оચࠊɳϊ͕˾౿Рၳ˺՞ɆࢷԺ݋´ڏ˸҇ʛ຿ŅᵝȈᄫʚഹŴۥ̐࢞Ϧ஝Hˉ࡚٦ݨࡺ΄ᓪɢأի"],["@@৊ǯຄńɖʑ޷Е౜αƱݳ൝͗߳ê׉͎ᐡٮjˎ႖ĽएռসР"],["@@࣓عय़ŒԽ݆`кѮΨ࠰ɮც‡ྈȱళݟ৉Ǎ"],["@@ᕍЙѷςኹѺήΤ׌ؘܰւࠑԦᭊƀ஬ǧᒰ±ࠄʑࣖΝ੍ɃᏝןਫי@ν"],["@@ҙ͙௝Øৱɖ҂Ϛீɨܼ̬̍ˇ"],["@@ٞϵ€љϣس൱đࣗƈjӬ൝ÝÁٮࣜౌ˺ஂµÜŎ"],["@@̙͢ݠƘࢢ™ƪЩԝЋ᭗Žᑯη౩mŅ˜პϊ④ij୯Ʈପࠐ߈ɾᛄ˳๶ӻฺÛறߨޔ̪ࢄĭ˲Џ"],["@@ढ˓ကFܨˡȑ́८ȍՔȧଊ™௬ë೸ǼႊðീÏ࣒ͅȊ΍ԽɟభǷ੽ĸᜱŻႫcഫļᖁ˔̃ҦĹжࡇξ჋ĺঅʼ͂ΈႾÁ"],["@@ŗ٣٩̇޹£༝Ϋ഍ŹଗǼ@@ුؼႮծಆ[ସŬ"],["@@ϣy༽Âɡɼၜ]מƻĵĩ"],["@@༩ʋఝ˔ڼˎ௮Đஈſ˩ʥ"],["@@৽ǏඉBbŤࡴʦҌદǝ"],["@@కǥۃȚέ͂áΎજ‘ӪÅ৐̇ɫ̣"],["@@͜Ε൏Ĥ൩˘ሏŒߺʠ৫ȮÕ͐࿶ŕᗢ̫ٞЍ"],["@@০˕ଽʟ༇ك๥Óდņࣗ΄^̦ڔɢ໡Oए˨ՑϠ׌ώ׊ʲࡴÎοȖዜ¨੶҅මǵ൞ǃڒև"],["@@ᖢßᅮŅ໤ɫ™ɡᏅη᎙ǟݻȉᆬJጡԙേʃ෯ۇႿƓՙǡᡷěୈĿׇƭ۞бߙ˽ಛʃЋ͡୫ʣŞȏ෬lȳᖟԋᔧɴឿŻధĸཟªĿЖ༊Ȑб؆ԢÐᖤγ଩բഹLjڼ͘๰Ȩʄ̊஋͠ΥѠᘞ—ڒĝ಼̪ቃĬ᰽Á๣˸۩ͼগʘȁ˺దLjঘ‚࿲ƌం̺ਬ©ࣤɽٔҒૐƈບĢᢲ–Ҁĝ᝚ƚᆔÁᆒÁ"]],encodeOffsets:[[[-65192,47668]],[[-63289,50284]],[[-126474,49675]],[[-57481,51904]],[[-135895,55337]],[[-81168,63651]],[[-83863,64216]],[[-87205,67234]],[[-77686,68761]],[[-97943,70767]],[[-92720,71166]],[[-116907,74877]],[[-107008,75183]],[[-78172,74858]],[[-88639,74914]],[[-102764,75617]],[[-95433,74519]],[[-123351,73097]],[[-95859,76780]],[[-100864,78562]],[[-110808,78031]],[[-96956,78949]],[[-118987,79509]],[[-96092,79381]],[[-112831,79562]],[[-112295,80489]],[[-98130,79931]],[[-102461,80205]],[[-89108,81572]],[[-70144,85101]]]}},{type:"Feature",id:"CHE",properties:{name:"Switzerland"},geometry:{type:"Polygon",coordinates:["@@ƫŹȳϞƵіwá΅χƙةŀǻ͹ЏơƄһ˵Л¡αǶ˽ςБſ^ϠؚҾɈϤûɲƞ܎MǦǼ࣒ʱ"],encodeOffsets:[[9825,48666]]}},{type:"Feature",id:"CHL",properties:{name:"Chile"},geometry:{type:"MultiPolygon",coordinates:[["@@Bም࣒@Ԓw˧ͻܛʻЭ‚ӻä؏ʨ࢟ŨੑҸ࡫Ҏୃशۘǭ୼֗૜̟ѢϬ˘ֺޠΎװı"],["@@͢୅؆ŘĺɁ˿ࢍࣵг€ඓǫ˓ʦ͡ץԹջ߁̛ރĀ߿ԫࡹϮฏɔƵCޛӑࠍpۯٍշFޙʮࠏԉ̧ɣݡȟࡱƚ৿ͷǡȞॹϜ͇ˡΛ϶ǙĚ̓νǃĜӱ̫૗ѽܓĮыˇՑ٣υôࢹ̧̐֔ÄgؽΒө᎔őުſݝPЙȷݷ̣Ɖ޹Σoॅ˚१ג@@ਲ਼ӔˁՒʄӰх֒Ņ෤Φ߰ࢴٰౣʔߞݒ˸ඊत̏Ѯგ֝ɠʿ਻ՉŠ˂ல˺༒ϮָʍࠎéूΠ„Ԩപ׈എΤబȗ఼ʤۚĵਞӮਆưྺ˒ნˀሤÕ൘ǩ஄ќɌɦњЬֱŐ؅ѴΡ˅߽Ҍह"]],encodeOffsets:[[[-70281,-53899]],[[-69857,-22010]]]}},{type:"Feature",id:"CHN",properties:{name:"China"},geometry:{type:"MultiPolygon",coordinates:[["@@ԑഓΫۏѷ܂ĩخӶࠜڦَϨʡƣԓ","@@ܩЗۏʺyܢаϠࣾɾӚoȊ͍σσșӟ"],["@@ฬˍ঺ׯͼ߃౨Cܰͨ൸ʜѳݱ͙̭˽ः֡ࠇ৵ƪܝ̑ɜܙť঳ѕwLяթӺͯһಙαƀѹܩŒЍ˂ֽ׭ऑҋۃա୭ʑأϽࣝɭ҂ϴǭ͞ږ֠ѹѲܷ̓ॉ׏ԫթ࠙¡ѓϻѸ֩یƏ„ϕڔʕस׶ݚ͝լuƌѱஓɻϻҏࠇућיࣜҥͦࠝԞޓ֮٥_دՅɯȪ҃ӶʻŻۃɇڗҷ÷ؗࣧڹિޭোିޡୟۻृĩԣύ̃˘Ӈй୭сࢵŹ˻ࢱҭ·ə؎Ȧ͘ૻːЇƍࡍɔЏ΀ƄӜޏƶЙܑ̀҃ࠇīڡJ҉ȳѥūŶ॥҃x÷Ȣ}Ύ؝ʓεƸر͂ʔۤՏǎȧޜࢱƓĴাߔۮ”ۚ{٠νȨ˭ӶӭÙࣟŲ˴ΜϿԺ׳Ν۵ȸॷ՗އسڳĿοɦѹr׷Țґɇ֋رëڌԟǭওĈोȖڿτٵǔ˯ЖҽŦࡓոکʴΑȩଢ଼טࠛՒɽऐ׾ő‚іͭјĐۆࣙঠ൧ͼʝ٦ةϼƫʌųӎˆ͜ԛȔ˟ďɇިʈȔśȠߤЈ׈ǐࢸő͆՜ંIJͮ̚೜ҔŠȐãӐּɔݱฦဘͲјȈ؆ຒဠˡҲϞ¢ࡆۦĀٖ֔͢èɚו۸ѽப̿׆ڱ͕ঙ̢ηূƝଆŝ৪ԻԲġϤޟӲӿऒnჄȉ૤Ŝࠦůఔԛ৮BόʽঐҌബ̈ాŒঘ̒׾҈ך˰Ƌˤˍ͔ѴըӀùࡺǝ࠸Ѿ౲͚؞֊נʆ௠ŐڐĥĠ̘ݿזګː٥̳ࠣžӇŃɏΆר࠾Цو৚̓ஆՎQτݸࢾҲːWҪңȦۜмਰƲ૜vసʡ݈̱԰ࡏ̀α̊ԩ̶ࠕ"]],encodeOffsets:[[[124701,24980],[112988,19127]],[[130722,50955]]]}},{type:"Feature",id:"CIV",properties:{name:"Ivory Coast"},geometry:{type:"Polygon",coordinates:["@@ϣUוǒ՟Wহƥ׍ʍ̯ࠫNjvÞۖĄŀ}ͨΣΚˉÈʕɲǾώčО ʔƄB¸ξÝnjĄŜ̸ĶȹڨȗΎæ˸ǘÞŊúɸųٮOƸʖƢgʎĦžΫȞłΌŰϚǽƦ˥Ϙǯ̎ɄϾŒֺɏɠ஡Ο۷ɕेθܣ›ͧ"],encodeOffsets:[[-2924,5115]]}},{type:"Feature",id:"CMR",properties:{name:"Cameroon"},geometry:{type:"Polygon",coordinates:["@@Ľ°ӻŇԝŒЋÅ൅nŬڒ͟֊ϧƚǟϖɋŦXɶɎתЎ߸ʒRԄӮ͈bҾΉ־˲ĀΔȌͺžь҆ΊǞךDzȊŢѨɜ՚۾ٲ¬˨ĠƲͫͰ‚ˌʂ¶ͮ՟Ê֏‹֏ҜޅҷTʁÏϥČǻЅӸөμƛŠΏˆ׃ſɩх࡛ȫƳÝٳČΝåʡЈѭð̴̟џϨ˓œϥĘʏÓґڛȤڷɜ੗"],encodeOffsets:[[13390,2322]]}},{type:"Feature",id:"COD",properties:{name:"Democratic Republic of the Congo"},geometry:{type:"Polygon",coordinates:["@@»ঙͶŕˑ̗͓ɟ͍ѫǯϷ±ګț͍Oهʍɹ‹ԃŗÝýҟɄϡÂ৥ưޝċѧǘӣӤҹҒ੕ͥĒ૿ƙɣĵʇՙȊχƫষĻࡇɨƫט͝ɲƴìٟࣟR·Ҧ̳ΨٟŠȋѰԣ˅ڧŞ˫ϢՕüϽqµʾ́rϥºԳųιtȻû®ৄ˩̸ÕԬŬԒǝ͖eՊ৳Qò̢ѕG­ƣԵɁӧűȿҫŠˣş։å͏Ѱȗ˖ʋԌȷض៛\\̍ķʑh΋œşʼɊʀμƎɎ̪ǰɚđ˼͐ҜSÄʃ̼ƩӶՄӨШɆːƒ۔θࠆϬўքМĪˌt̰Ǝ̆«ӊŀݖǐԾʦ҈¸Ԕúה͜ѐҊ˔۔˷՘ؚ̳ĉظǏʦԖŘÞϦčनоͨDZ˖~ŴȲ̺ðلėբoˤĚԘۙϘķɤƖϲÅҶDzȦΫ݊֏"],encodeOffsets:[[31574,3594]]}},{type:"Feature",id:"COG",properties:{name:"Republic of the Congo"},geometry:{type:"Polygon",coordinates:["@@̿˾ʩƗͻγۏࢸٖҪ̓֌˾ɂ֦ĺäό҆Зݐ•ʴЈł֒ĝڀЉӺζ঄ȽǘسçɻѢÔξ੘ڸɛڜȣÔҒѰ޲ԆѼ֪Ɨդ±·ԓʥ҇ǏԽĿݕ¬Ӊƍ̅s̯ĩˋփЛϫѝηࠅ„ۓɅˏӧЧӵՃ̻ƪÃʄқT˻͏əĒ"],encodeOffsets:[[13308,-4895]]}},{type:"Feature",id:"COL",properties:{name:"Colombia"},geometry:{type:"Polygon",coordinates:["@@ΫȤЭ˨ʅƅ܉Ŝȱΰƽ_࠿Ӓŕʺ̼ڛтȢ̦иÊΞՆ͐Ѵ̳ȦDŽӦȏސǸɚƃ܄ͻ҄ņТ˔ÑǂʠțӶĺŬѢـהΌĚT˦ƺ܂ӖϸՊfäǪڂéڌъ͞ȊОК̖»ɚɛǍ˱գƕɇп͗ʋʓ̷Ĺ׵ɷӭѢÇņϭȄȁâ͹ij̵ˆǫȸéȨ̉ઊĄӦŃעܡͼĚ؂­ӐĪ̔ƟƱҍȇ˯ß׻ǜ֑ʆʟ†ȉэл̨ȃɠ̋ʰ࠹ǁĻǏӸɷˊ˥́࿕lZԿӰē…͏ǙĔҿƑK؏ώ̫ƀӓoηϙᘯп҂ʣpժࡤٟϾԍị̈ƤҧɝصŀӵࢤϳɐˍІ֑Њɡā"],encodeOffsets:[[-77182,-155]]}},{type:"Feature",id:"CRI",properties:{name:"Costa Rica"},geometry:{type:"Polygon",coordinates:["@@җȆǟǮĬƤ‰ȄɷȪͥǔ́ņÅʖəƮÄʑǗȩȓɸˑĊŗǞLʮŎˆʁŠȖnjŴňֆɝȖŊˊéƔǥʜÇȪDzɈҙ͖ͷЂΩ͗õLͷǪűűıƱëǟ©Ǖ"],encodeOffsets:[[-84956,8423]]}},{type:"Feature",id:"CUB",properties:{name:"Cuba"},geometry:{type:"Polygon",coordinates:["@@ܨÑڊW߄˹̭ͮ޺Ĩ̔ȡ܈ԳԺϛˢ\\ԆǟÕʁئ“ٌ΅ıȟ֑Ń֡¥׃âளą֜Ҷ΁ɔէÈ̃ʐȥӎӃ޵ɦʥǬભž̋ǐ̀ɀࠗ¨׿ѧΏ[ťȳеğΫĂѺʸǼ̤ϞȈіǎَĄȰĢ"],encodeOffsets:[[-84242,23746]]}},{type:"Feature",id:"-99",properties:{name:"Northern Cyprus"},geometry:{type:"Polygon",coordinates:["@@ÐJŨȮ؄Yކʢ֧ΧÔƿęˆLJÙűj¥iĎѾNjVɫïƿ¬"],encodeOffsets:[[33518,35984]]}},{type:"Feature",id:"CYP",properties:{name:"Cyprus"},geometry:{type:"Polygon",coordinates:["@@€ãࡱͿЩŊȟͶЎŒǀ«ɬðnjUÒ½j覎ŲiLjÚ̇"],encodeOffsets:[[34789,35900]]}},{type:"Feature",id:"CZE",properties:{name:"Czech Republic"},geometry:{type:"Polygon",coordinates:["@@ϯǂЁ©ٵʲ̏Ùҿ΅ر˔ӃΰѕȬėΠƧʠؒǾ̸Ⱦ׾ǎɂdžɜīϒĖЊ˓ؼñ¿ɳҘǧŲɒּĥĄʿز»ϮЯʡCŽƯȕ—ÅȑLJ¡wý˹ēϋbšȁ"],encodeOffsets:[[17368,49764]]}},{type:"Feature",id:"DEU",properties:{name:"Germany"},geometry:{type:"Polygon",coordinates:["@@d͗ࡔțS̗ࡢǂҾɰॊͧІˋȞёɹɣ̨̙Ⱥ҅ß́Έ՛ϑĕɛĬɁDž׽Ǎ̷ȽؑǽƨʟĘΟіȫӄί̑ϯ̟ŃŢշýƛʿǤЕ~׷ƭݍ–ţɛыɺʩ±࣑ʲǥǻ܍Nń״ьֺ௅ƸЇɘ´ςǗȐĨ֨ƗࢢԎ@Ɉ͂Ⱦޔƿ˴ǐDz۰°Ƽȃ֮вȓ̀ӈٌōՠŸ"],encodeOffsets:[[10161,56303]]}},{type:"Feature",id:"DJI",properties:{name:"Djibouti"},geometry:{type:"Polygon",coordinates:["@@ȤʹΑӏȩήɯ̱҇ȅƬȭÏҷb_ʮßɶ˴Ѐ̐ϊήñʪȴ"],encodeOffsets:[[44116,13005]]}},{type:"Feature",id:"DNK",properties:{name:"Denmark"},geometry:{type:"MultiPolygon",coordinates:[["@@ԋڹ࢟ӄŝΒ௼˨ˎу"],["@@ȵ̓ʡĞ؁؁ɮХ՟ŷًŎͽҲ}࡬Ɣɪʌʦ݌À̐ɴڮʂƒѝʟ˙ĶɽҘŵ"]],encodeOffsets:[[[12995,56945]],[[11175,57814]]]}},{type:"Feature",id:"DOM",properties:{name:"Dominican Republic"},geometry:{type:"Polygon",coordinates:["@@ŀƞپIӾɏɜtƴ̕Ҡhʡϐ‰Ю̷̯ͿЍǼϫ•ˡ¢ƱƵ͑½ŷȲˣťͳֻɏƆ§ʎjɬɍʦȲƚÞ͒óҜ"],encodeOffsets:[[-73433,20188]]}},{type:"Feature",id:"DZA",properties:{name:"Algeria"},geometry:{type:"Polygon",coordinates:["@@ᮩཽᝩ࿷இϑटćU՘ϵƌԹʊȧЀᬻᆴᬻᆴṕᎠfnj@ÊQ঺ബب࠼Ÿێɦ͎тচͪ˜جӢòϞ̶સƚƸ͜ɛDz̃ࢲ¹Ԟ́ՠ߰ҠࣦƢՌΎ߶ʰ෎Ƭർæшůߊͨ࣌P΀ȝֺ¾ǟћƄߟȡۙԭҵôمۊԃRȯԮ͹Ϊຝ˖ݏ°ϵƧۇÔϥŃҟòՇͫΗӺؓŽέ̘ҵϼƸڒϷςՃ"],encodeOffsets:[[12288,24035]]}},{type:"Feature",id:"ECU",properties:{name:"Ecuador"},geometry:{type:"Polygon",coordinates:["@@҂غǻξ͍ϵԉςǞʀƙބ̎ŴƺԼ͆զÍ΄ҢǸ׀Ͱࡀӑƾ`Ȳί܊śʆƆЮ˧άȣŞٓʽճࣷ࢟য়ͧԥܵǃ֣Ӆ΋ΙъͻĞ΍áw̮ʈȨıΔ"],encodeOffsets:[[-82229,-3486]]}},{type:"Feature",id:"EGY",properties:{name:"Egypt"},geometry:{type:"Polygon",coordinates:["@@ɽͷǹىɫѩȝƥ˩˔ϛϒ׵ஸđùΐࢯԪࡋٌವ̴ҙ˒ӃݮछǗƣ‚ճ঒ݭƨǣΏ@Ὁ@⁩@@ᶶ@Ჴʥڲɐ԰Żά̤Ж૦b߲ɝ࠲ʛϴſ٨ˊΌʊݎêװŃɮеȜ˜ڨȣټ³аɄւ෽"],encodeOffsets:[[35761,30210]]}},{type:"Feature",id:"ERI",properties:{name:"Eritrea"},geometry:{type:"Polygon",coordinates:["@@˻˖ΉӰϋ˒ɏܷ̄ͶֻXȭǬӯȡԛϢʽط঑ǬęʹβఀĊ֒ˆʴؤƐьӒӦঃɴޗҢУବߏҲӍҖӝˀ˿аʧʩȳέò"],encodeOffsets:[[43368,12844]]}},{type:"Feature",id:"ESP",properties:{name:"Spain"},geometry:{type:"Polygon",coordinates:["@@¦״΃θஒ؆ਊƱ૾NࣂƝۦªമƒͰ͛໺ϡ̨ǺीϝআŊ®ӥߓ֓ઁǯõ˱ԩү͕ہ͞ӑӟϑǹճىǗש٥੧_ߟhՃ͍̓ͅЩê̵˴ʃӚ޷žé˦̶̀Śɬ̃ʢɶրͳԌδè’ЈƎŬZپϲɪɻфөˆƝŁӹCɁЬ΃ū̥ɇ"],encodeOffsets:[[-9251,42886]]}},{type:"Feature",id:"EST",properties:{name:"Estonia"},geometry:{type:"Polygon",coordinates:["@@ĮӸ̱ŁՓ̘ñӘਫ਼ɼ੔Ũ࣮Ƒࢂ|Ŵƣׯӝʞ޵ΫˉۙDܡ̸ρļ܏Ʃ"],encodeOffsets:[[24897,59181]]}},{type:"Feature",id:"ETH",properties:{name:"Ethiopia"},geometry:{type:"Polygon",coordinates:["@@ԜϡӰȢȮǫּWܸ͵ɐ̃όˑΊӯ˼˕̏ω˳Ͽàɵ`ʭҸaȮÐȆƫǽ̴̕ҧ̴Й̛͎ᩨঽۺNᛛᡃફ™ݟףաeɯ˅ַB͹˴ލΙʝΓ֕àȃĬȟwˇT੟܌ב@˹ˢ@ҾѧƘӻࣴϥȚƧʹэЦԧÒ˸ӐҀrŲʰ[ݲʞࢠЊɾĎ΄ήٜԔи΀ࠠƆܠ঒ǫʾظ"],encodeOffsets:[[38816,15319]]}},{type:"Feature",id:"FIN",properties:{name:"Finland"},geometry:{type:"Polygon",coordinates:["@@ūיಀ֓ޡى঎ख़֡ܛݴس΅յఘֻ́ѓޭӟᅡੵໃá๑̯ൃǯӡҞ߿ˠȈࠢСݶАӪނՆ኎࣮֖Ǭē΢ୟЈ˳͜uಒ಻ֲ૩ЪԊɞतѻલ¦ࣘȭߠϊЬ؞ಬ˶઄ͯΡכ"],encodeOffsets:[[29279,70723]]}},{type:"Feature",id:"FJI",properties:{name:"Fiji"},geometry:{type:"MultiPolygon",coordinates:[["@@̂ʍƓѭԳŗҩļąτ͖̀ϤĻȼƐ"],["@@՛ǯŅ̼оǤˊ°Ӱˀ@ЧՕȷ"],["@@é­@ШǨžĽЗ"]],encodeOffsets:[[[182655,-17756]],[[183669,-17204]],[[-184235,-16897]]]}},{type:"Feature",id:"FLK",properties:{name:"Falkland Islands"},geometry:{type:"Polygon",coordinates:["@@৘Ԍ܎ȿԌʹڦϙʥ̋ଋʥϙ̌܋ϙпϚ"],encodeOffsets:[[-62668,-53094]]}},{type:"Feature",id:"FRA",properties:{name:"France"},geometry:{type:"MultiPolygon",coordinates:[["@@ˣ٭ϡǠș֢ǜ̺ը͎Ɯܛ"],["@@הЅќà݀ϥȊñʎjЈɗெƷыֹŃ׳ɱƝϣü‚ɇؙҽ]ϟВƀ˾ρ“ʁʚ̿̅ʯɐٱҖŃĩηݿӅစɬ௧˗ĩԑঅʼnिϞ̧ǹ໹Ϣͯ͜ѢԎdžူࢁࢤإю౹͒čؖઠǾථɏˇॎߌέዠپʨێܾǞŪ̑ϸ_ϸ͵"]],encodeOffsets:[[[9790,43165]],[[3675,51589]]]}},{type:"Feature",id:"GAB",properties:{name:"Gabon"},geometry:{type:"Polygon",coordinates:["@@ࡹࡔ։ۚԙࢄ‚˨ǾˎȲؔǜخ˴¶௢SOৠЌÆԞőӼňľ¯ÓνɼѡشèȾǗεঃЊӹĞٿŁ֑ʳЇݏ–҅Иãϋ֥Ĺ˽Ɂ̈́֋ٕҩ"],encodeOffsets:[[11361,-4074]]}},{type:"Feature",id:"GBR",properties:{name:"United Kingdom"},geometry:{type:"MultiPolygon",coordinates:[["@@҉ֽًǦԱ[ǦҊǥ҈۴–ࣔԳ"],["@@࣋ࣧࡦŘऄIɕۅݯݩࢄÃäĕݠ঱ֺƇԬढ़ʈͧৰDžķ՝ѓʗͲѣݱѯ૳Rෝɱϻǒ։ϿޥĪם͍ҁǘ௼ࢨݪǺOBಽƔʃͰ࢜ʺҡҐdžռఢ÷D@ŮӤ֛Ԯ_\\৵ƨȧɬ̨ϒˡɴҍЇ·߶щє̨ࢆٶھڤá০ì"]],encodeOffsets:[[[-5797,55864]],[[-3077,60043]]]}},{type:"Feature",id:"GEO",properties:{name:"Georgia"},geometry:{type:"Polygon",coordinates:["@@Ųάȿִӟ̲ҭĬ̯ʴĺIJ܄ƝఆƋଦЕƦƻԚƂ޶ǭʴ·Նșɓřвғŗıҏºصʎȵƍଢ଼ſ߳Юࣅ¡"],encodeOffsets:[[42552,42533]]}},{type:"Feature",id:"GHA",properties:{name:"Ghana"},geometry:{type:"Polygon",coordinates:["@@೉ӯҳ˽ݳʑݡʆœͨηܤɖैΠ۸ɟ஢ŗنrӊฤ¢ϊÕ˔ƊϴáÕʿΖџC؍Ąڍɂ̫ȅݳäйɢՓȈ̍"],encodeOffsets:[[1086,6072]]}},{type:"Feature",id:"GIN",properties:{name:"Guinea"},geometry:{type:"Polygon",coordinates:["@@ʃtǡͷʁJǏǴÈͶΗԨɕħǵmɳ³V̮Ƈɘ‚ʔǻΜɹ̜ڥDțǁɵoƝǷīɹ҅σρӼ͛͢ɋŊȿǖħϊūȂʓƐώЦʮeɖƘȄDƄŎï˨ĢĖd˶МU؀ȱȄlÚĤҜáŨ´¶̭ƆBɖŒƔƒɸɇάãɲǺ˖ŒȬŠǚuȈȁĴɳΆΙǣɏ˙ǴĊŀį«ʡʲʍǗÝå˷Ș΍Ⱥڧ̷ĵăśÞNj·νƃA"],encodeOffsets:[[-8641,7871]]}},{type:"Feature",id:"GMB",properties:{name:"Gambia"},geometry:{type:"Polygon",coordinates:["@@ņόࣶzȎȦˊ`ͨȷʼIˢƚǞʏεȋιdέǰ̷ȗƭQȫŝއl"],encodeOffsets:[[-17245,13468]]}},{type:"Feature",id:"GNB",properties:{name:"Guinea Bissau"},geometry:{type:"Polygon",coordinates:["@@҅ΘΝÈȕʀLŸʯǴÁǶѼƌ˦ɦĨ༈•c˵ġĕð˧ƃōȃCɕƗʭfύХ"],encodeOffsets:[[-15493,11306]]}},{type:"Feature",id:"GNQ",properties:{name:"Equatorial Guinea"},geometry:{type:"Polygon",coordinates:["@@ƿŴ़̀െmPয়௡T˳µ"],encodeOffsets:[[9721,1035]]}},{type:"Feature",id:"GRC",properties:{name:"Greece"},geometry:{type:"MultiPolygon",coordinates:[["@@Ҡ˱ٺ¶شÑqƣҜĶĿʛ௃íTƒਁǎƺΦ"],["@@ʹՁȥĥԟ|ѫĀৱɓ׌ҿяƋҳAѻўƿȁȊԅрЁ̓ǿҴϯжʑ^ӅޥɠʜѕՓĕ͈ݏ֏Yۍμ̿ڦƧ֒͝ϮљӐÉʆϸТ¼˚˘Ũjɚռö͌ȀҖgƒƦdž„ت{ڨɲע̉ކĀVмЦɝ"]],encodeOffsets:[[[24269,36562]],[[27243,42560]]]}},{type:"Feature",id:"GRL",properties:{name:"Greenland"},geometry:{type:"Polygon",coordinates:["@@ᬜԆ᱒›ੴ̴ᲈĄ䀦Ŀ㉊ڗ༅͕ộ™⭏ćшƫᲐĠᡚ́࿈ʴۦ̝इӧᒞ̺✘͚ᠼNjҾΫ⃝ױӃȕ᧑ơወ¡ছؕگկ€ध৚շಽ“൧ˇ༂ѽȢ܋࣍ýઞܡህÑঈ΁˟̑இŽ୥E੆֩\\Ϗပΐћɣଌȿ઼ԣ͈ڱກlj٫͖ਣӘ˼֭উѵᕖ•୆¯ᖯܵᗿڏឧ́ओIࢅ͓ୟࢱᅵכׅ“૧ȷ஽ȝܛԱ[כыտോڧͺٿϗ۝љࠍஅ½఍ۈဿLࠁҢ֕ࠐฝਲэոŗݮ୓ޢ̢ئ֗̒ࠪচొ̺ͨΘǬڀॡ̕қůݯţਏ˜Éְ͢҂ެ\\႔ɟ෿Քݩ˾࠷ş۫ȼम޴ԝ̺ڗ׈ৡࢼ੯͚XΚᖷӮᄻÖᖟ‘Ꮕ×ইˌวՈᕂ˄ၚ¬≹ɖ቉΄Ś͜ẊИᶎИ̪͘ᗗ̠ܺͰ᯲ז௢ĚΓϘጲɜᣚƂᣖRࣺʽᕺҨፘ̽୺áპ˙ፅҐŘή"],encodeOffsets:[[-47886,84612]]}},{type:"Feature",id:"GTM",properties:{name:"Guatemala"},geometry:{type:"Polygon",coordinates:["@@ћƦԻfϩǖҍΌrʖĮȠšƾКۆ઄Ft˸Ƌ¾ġǺ̵Ț̹ˬϜDBӂ޸BަUOڗßॅʤ@˚ƱòŰʘŃϥ͍ЉɻÏljâǑǧɇȟ½¬ıƿġ˽Ƀ}ŭ"],encodeOffsets:[[-92257,14065]]}},{type:"Feature",id:"GUF",properties:{name:"French Guiana"},geometry:{type:"Polygon",coordinates:["@@͉͑ГÑŗʀȉ–ʹɩνǦɈΪòϤƢή͛ӸáֺѪܠ˸ğؤȥࢸۿƔ·ӻޑʳأ"],encodeOffsets:[[-53817,2565]]}},{type:"Feature",id:"GUY",properties:{name:"Guyana"},geometry:{type:"Polygon",coordinates:["@@ր̯Դյzџ̈́o҈Чͪ̇Ƈݱԛɕ°ȣƹџϊ؏ːAŎӃԢܳȱ‰ҫî˙ɡϟƥ˅—ġǑЭ¦ԫЀÓϴɋьƆܐɸ̐ȕϸ˿ŶŊτțȘѩ™ْ֩ɬɲiϲԬƊȾƾ˽̸ô̬ږӲ"],encodeOffsets:[[-61192,8568]]}},{type:"Feature",id:"HND",properties:{name:"Honduras"},geometry:{type:"Polygon",coordinates:["@@ơˀʭòÐʹŗĞǣÒσij‹ŔʩƈǷǚʛìǨɈáǒÐNJЊɼϦ͎ĔȂƨʊ\\þ垦ϸùϲv˒ĢİĦˎ©ȪÉɘnǖòϨśƄkʲƿʐį̏Źɜɳ˽jśŕ̇ŋɃAȅŃǙœƛźĕ{ŇȩăRaǥ̉ɳƹıđĽʛǞǹɣǫPȟqlЭūQĿȓʽ“"],encodeOffsets:[[-89412,13297]]}},{type:"Feature",id:"HRV",properties:{name:"Croatia"},geometry:{type:"Polygon",coordinates:["@@Ȳ͗ˊʇ͓̓ϝȆׇ[ܟƔϽmǻǧ̝ȖǫΑЪϽǼʹϮ̽͌ȃ͆Ηݔ͇ġƛ߃̶ӣ̢ޑʠ۹ؤǞØϥΞe˲եƄʱγʝˮn̆Šbג…Ƹƚ˸ƍͤgGɼ̈ĒĈͺڞɠˊĻؼέۜlj̼Ų"],encodeOffsets:[[19282,47011]]}},{type:"Feature",id:"HTI",properties:{name:"Haiti"},geometry:{type:"Polygon",coordinates:["@@Ԣ™ܰƁôқÝ͑ȱƙɎʥiɫ֏ƜЅÍԡÔϽƿ҉ʾö˔ޜśيã̢ȈϧθP͎ՋžȌɶ"],encodeOffsets:[[-74946,20394]]}},{type:"Feature",id:"HUN",properties:{name:"Hungary"},geometry:{type:"Polygon",coordinates:["@@˨ըǍǼӂDÜ΄ђɋ̲ğ۸ļäǚͮ~ЦžĜÃЂŀȠȢˠ¼࣒ʭǴĒҲɭÎɣԡǭЉ֫ԕ֭کǁԽš١ə̻űۛNJػήˉļǍ˴ƗV"],encodeOffsets:[[16592,47977]]}},{type:"Feature",id:"IDN",properties:{name:"Indonesia"},geometry:{type:"MultiPolygon",coordinates:[["@@Λe૝ך޴ǒѴʭ̎ʭ»ɩ"],["@@ܙȁijĶø˸ΰԢࠨͬĐǓfʫշع"],["@@̢ɣԲèȼΥॿǛ׉őҍP̀ӚҤPɤ̖"],["@@ūұ౅ʅૣľE̬ښǪՂʥ֔Üݬ̮"],["@@ྔċȂΌ༘З̪կీƵਐӿय़͋ऍ͸ݻwࢍØ޻ưঅ͎؝ČΓŁ໕ΌƣΰޑØּߤ৶·ڴ͡ΒÛŘ̗"],["@@ѝֱćنƬ̠Ǭ˴ȒʗCЏ"],["@@̿˥ׅƸǏΰࡘ¢Ⱦˣ"],["@@̨ٝۿΌۯìӃÅׇˆȦҦਠ”ऎʕ"],["@@ɼയ࢈ԉ۰ࢼ८ԔݜBܘ̉خ̛ࣘLJbᩑbᩑݟې࡟ǜȷʇ੡}ΦۂՈɺɕࣲЕ۸࿃܆ۗêృަʛУ͑óȏ̮GκٛЮ̢ࣞ״gëɠ௵DͩԄݥƺΡдଈȰњ˜ഘ·Ƃ̹"],["@@ڭ࠭كlj߱ǐඓ¥ܽŧţٍݪݛҒϠ༪˸çϯλŪιӯ͙݉ߒ੿Ƶ˿ݲॻQտ҅ʙ̐͡Мی࠙͗ȻɶŊ͖؅ӲØࠌ֕ʭîও”றՓũίʚʌޜŽ߸ΛPʻֺΎվŤښф౎ǮΎ܎ذپʛ੖śॴ–ࠨ؎Ʀȉ"],["@@©ܽџĈŷԝΌѷɽĵ͹Ւʟ੺ǚڤ˨̨ÔҝӸóĀ΃"],["@@सާহį˫ֵšݿַ߱u࠷͕౻ŭ̚ॕϙͫԤ׳´лːৃ̟̩Оս¯ۗĬŹૺнɺЕܘŝ݀ĮުԂ֐Ɩָ֗ӅըǠ՜ÑӪъЖôߒɽۆǶњୠ͔̈̆क़ॲ@ܰƙӍݷآߓơϭ"],["@@छkۻ۰અۊέԚٍۄзؾٕ୴۪݅ʙܠ̳ڀݵՊѭܘمҺࢗऒóђզ‘ಢNjݔࠓٮ֫ҪΓߔࣙࡢ_ۺֹӠ۳٘ϥͳۉӖ̞̅sƜו̊ҵؠõФՏɁ਱‘ಟ"]],encodeOffsets:[[[123613,-10485]],[[127423,-10383]],[[120730,-8289]],[[125854,-8288]],[[111231,-6940]],[[137959,-6363]],[[130304,-3542]],[[133603,-3168]],[[137363,-1179]],[[128247,1454]],[[131777,1160]],[[120705,1872]],[[108358,-5992]]]}},{type:"Feature",id:"IND",properties:{name:"India"},geometry:{type:"Polygon",coordinates:["@@ࣚটďۅͮїѕ׽ŒɾएࠜՑ୞חՑϟ͛޻ࠀͅߊЭરһସʼnӜёٮāৠȝ۪bĪͪŋՖÞβԠǮìڋlǙކ͉Ոƀ܀Çۈ|ÐԪ΁ˎڴŀވشॸ՘۶ȷ״ΞЀԹ˳Λ࣠űÜ͇̍Ʒèԫ׷Ʋછׅ~ӓҩ۵§ХϏۗځȒࢇȏ˹ĚΣгȥѵ೰ɵEƍ՝ҡѦʸӎϖ¶ϰ܆ӝƜީ]ߝŚóאБ¤ڕζ֭̓؆ѻԿ̻ȅ̩Ԭɣƛԑ̆كžەţֱ̫Zਛǩ´ك҃ӻ௃֡ळ঩كՋ࠷ջCϭлȹݳ̝Ͻ«ʥٙǪધ®ۡΣߙI෗ѣ¡ϣٙʰˣދʃ˱֯͵ʍߑ޸ϳ୴͑ࡒ̍Јѿ߰ȻੂơՀޅ଼Α࿀ʣ੾HৰǍ޾௣ԉףĶ઱৲И̤ʝͤড܊֖֔ᇜCǗܞҽюĩ٨ջϘऒࢢঊÙ࢞ࢢՄ࡞ࠄࡈ_״ܒӠڳд֪݂̇̕Ьβ౤ȱपŰߺ۸"],encodeOffsets:[[79706,36346]]}},{type:"Feature",id:"IRL",properties:{name:"Ireland"},geometry:{type:"Polygon",coordinates:["@@ƒ׷ًݣ๯ӹ஑Ŷڼ࢚ѭࡢତڄٌϼǦ҇ǥ҉Բ\\ٌǥ"],encodeOffsets:[[-6346,55161]]}},{type:"Feature",id:"IRN",properties:{name:"Iran"},geometry:{type:"Polygon",coordinates:["@@݈njװӔ֚{τƾװýघэڤğ।ݓظ‰òۻ΁਷ɱؑκŭΫҡˠڡàՓِƙæեݿݿжѵ͸ԓߦυx݉ДƋêϯ௉ѡ̓উཌྷʪࣷȖेŊΧਐЕƪ٣ƭࡑНਇ˦ࡑ٦߳ʈ֗ߘا૪ҍƋՕ˦̻͝ҭѴS҂ˍ@Ɛ،ѝٔ਍Ң׉ߜȜپц̂ÙӬտʨխ৊ҟڨǐʼʿ६ּʈƄͅъϯ־ő̤~রئ̀Øʞʙ́гԼѱȾ¦ˈإߖǩ׎у஠ƟಾɞĄȞ"],encodeOffsets:[[55216,38092]]}},{type:"Feature",id:"IRQ",properties:{name:"Iraq"},geometry:{type:"Polygon",coordinates:["@@րʧÚӫх́țٽ׊ߛ਎ҡўٓƏ؋ˎ@TҁҮѳӿ¤֟ê؝߭༟äᛍၖఫךৡɪ͹৾ᇶ࢔͆৬āؘҢȺјԾΰž঎Ň̐ɉЖƚծ৉"],encodeOffsets:[[46511,36842]]}},{type:"Feature",id:"ISL",properties:{name:"Iceland"},geometry:{type:"Polygon",coordinates:["@@șիॊֵથٙᝓֹܣƵૉŮᚑˈࠠψᆧЪ๪ǎ—ʘᄋȜ֨նౠŰಸ֭౨Ҝ੒ʃൌ҄ආÑ"],encodeOffsets:[[-14856,68051]]}},{type:"Feature",id:"ISR",properties:{name:"Israel"},geometry:{type:"Polygon",coordinates:["@@ƥ˅̣Ŝǫ֓ɂĥɋř—ɛЄŖp͛нഉց෾ʔˢ˶ɞϼǠيŤɆzVˬCþƦɤ\\`·ŕŵhM"],encodeOffsets:[[36578,33495]]}},{type:"Feature",id:"ITA",properties:{name:"Italy"},geometry:{type:"MultiPolygon",coordinates:[["@@̟ڋŲʹǭѝٝ̈́ёĞ୩ѐŞќজûࡪĠْò"],["@@Ԍ׭ş૕ϣÂ΁˫͇ɞ‘২ȓӒҨ¥рʼ"],["@@ரɏĝЯȬΧڝŪہ̗²зĻʇˠё߀чцۛदڱچLȲȃɽǗݪ̥ؠʩܜѫĔƿƽ̛үϼܳƐΝի؈̷ıѫΗ¹҅ܛΕÝHʲǢҊǼǶ͝ӤʱшΑŀʛδգƴεͶثÆٿϜޑմ֯ӜʿࠪйĮہˤϯŕӝϵΓÕĪθҕńɏٲ̆ʰʙ̀”ʂβǵМ¢Ҽ˶ƢƃА€ǼͺتĿψƚâΆԘšĮdžࠨƤȊ̉"]],encodeOffsets:[[[15893,39149]],[[9432,42200]],[[12674,47890]]]}},{type:"Feature",id:"JAM",properties:{name:"Jamaica"},geometry:{type:"Polygon",coordinates:["@@֢÷ҀȫƔɯןeʭƗҹƊӑ̪ĶȔΜÎȒƒ"],encodeOffsets:[[-79431,18935]]}},{type:"Feature",id:"JOR",properties:{name:"Jordan"},geometry:{type:"Polygon",coordinates:["@@Ʀˆपͫ࿪ࣆͺ৽Džų၅у࠸࠿ˣƛƑ˭ٙřȩ̡εʵधƆƒŨоഊo͜Ůʚ@Ԥ"],encodeOffsets:[[36399,33172]]}},{type:"Feature",id:"JPN",properties:{name:"Japan"},geometry:{type:"MultiPolygon",coordinates:[["@@ņ˽ҿԕΉːљțɝӭշʈRЊҬԆӌīΊΜؠǹ"],["@@́ڡƤсѩף੹Ѓ๏½ணॡ͔֡“غษȃষЃঝe࡞أ֗෗իΝН͜ȶݶՏʒͿ־ߐʶѲՈࡌѢ؞ָာʤ࣎ǣࢠ๺֔Б௾ࡀӌ͜ՈਈƟा΢ՎࣀƸҞୗ}ڻޥࡍbࢁ"],["@@נǵרΤȈहఝɯ݁࠱೓ָқँण]ř࠴д٨࣌²ʖ୐ʜټন࢓٤˯"]],encodeOffsets:[[[137870,34969]],[[144360,38034]],[[147365,45235]]]}},{type:"Feature",id:"KAZ",properties:{name:"Kazakhstan"},geometry:{type:"Polygon",coordinates:["@@ӕƹ્דο׹̹KɱЊ੫‚ǡێХNÚࡆ৓ؘ෷ßডũߣݶۋ͆ಥ׼ƽðᓗӹᶽљ£יچ֧ɼॕǩχ˧±ȲȶΖDž̊অ˺ϛݮҩɆ…˜ࠊāŽؘ܎ƎܼűƲࠎƭԲ࠿£܍ȴঃσ޵ǭяƌĐўՙ֘دw܉֬ӞِʕǢڢऊࡺӣŀؘჄࣴಾtᇢ׉঺ͻࢼΠ೰j੺ѥʔʠ୼—ɂЊഷ׀߮Цƿɮ߮ɔ؅ֺϬ˼Ḯ̈ШȺᑆ̴ݰΒຢǹ˄ࢉ࢚Ȳઆ˹éҝ߮´ᑌߎ̭ˁ੶٭ሠᒑ҄ѰୄӛீɎҪƯКӟטNjΨΥ઎ŒѾԣٕ֓ۥÿ¡ࡅұϝဟˢ؅ຑїȇဗͱݲลֻɓäӏԭŬу̠ఝĖඃx̧ġ஥ΞӉǧŽӹ൩̂փşȉρ"],encodeOffsets:[[72666,43281]]}},{type:"Feature",id:"KEN",properties:{name:"Kenya"},geometry:{type:"Polygon",coordinates:["@@ӾۙיͱȹΕ̿Õšףˑ͹Ǐ֑ͷ˥஻ࡀËӤᵁႌƙĢSࢺʊ;а֌̨ؔσ॰įтЉ׎ԬԈ֬ֆѨƗ@ҽ˺ˡג@੠܋ˈSȠxȄī֖ßʞΔގΚͺ˳ָAܽ॑Xᵣ"],encodeOffsets:[[41977,-878]]}},{type:"Feature",id:"KGZ",properties:{name:"Kyrgyzstan"},geometry:{type:"Polygon",coordinates:["@@ȊςքŠ൪́žӺӊǨ஦Ν̨Ģ඄wఞĕф̟Ԯūşȏ೛ғ̙ͭઁıͅ՛ࢷŒׇǏߣЇŜȟʇȓཟŵਡ˘࣫ÝĂӜࣴƕ̮ʸٖĉ੾؂঻ѸױȽإ͂۶ծʟĊ"],encodeOffsets:[[72666,43281]]}},{type:"Feature",id:"KHM",properties:{name:"Cambodia"},geometry:{type:"Polygon",coordinates:["@@΁Ѭыࢄȣ২ՠۨઘdž߀ťۚ͡Ϟׄݖ̱Ȝ֕Ļ৕ඳ٧τԙࢥÓܫͷ۱Ū"],encodeOffsets:[[105982,10888]]}},{type:"Feature",id:"KOR",properties:{name:"South Korea"},geometry:{type:"Polygon",coordinates:["@@ܨযȺխPॷ̓ҥݽljڥΏݳïĥҚƼـχ࢔ذƚֻܘÂúϒ‡͞Ϝצ¢ΨÈŨȮ"],encodeOffsets:[[131431,39539]]}},{type:"Feature",id:"CS-KM",properties:{name:"Kosovo"},geometry:{type:"Polygon",coordinates:["@@›ǣŃPĘ́ȩĐdzɦƾȌȪÒŜ˨ư²Ţşƾ¿ŌƅƒŸǎƻŢLĥȳijij„×ȉӹŻ"],encodeOffsets:[[21261,43062]]}},{type:"Feature",id:"KWT",properties:{name:"Kuwait"},geometry:{type:"Polygon",coordinates:["@@Ǭχõȓ˔هשuȽАݟĆ؞߮֠é"],encodeOffsets:[[49126,30696]]}},{type:"Feature",id:"LAO",properties:{name:"Laos"},geometry:{type:"Polygon",coordinates:["@@˚Ϝœ܆ڹܸ¿ٕࠦھٍÎǛ̉ӯyʣƨࢯԅoݬȸࢮ֧ž³ԎηʸǴ̲ܐնøȡ҄wŵ०ѦŬӮڏϖޅਚO͚ܹ՝ɗʉ̟৔ԉۦ঳Ռ݋َ׏ɄץƵ࠿ݕ̲ϝ׃ۙ͢"],encodeOffsets:[[107745,14616]]}},{type:"Feature",id:"LBN",properties:{name:"Lebanon"},geometry:{type:"Polygon",coordinates:["@@ɣ[ýƥ˫D̘ۄмעfˆϘ§Ɛͣқ̓ȷҟ"],encodeOffsets:[[36681,34077]]}},{type:"Feature",id:"LBR",properties:{name:"Liberia"},geometry:{type:"Polygon",coordinates:["@@ɗQࡽАޅٖ܏Ң֣ըȪː¬ʔϜҘϺϺǶnɖĨΘԧÇ͵ǐdzʂIǢ͸ʄsŸʓĎНǽύʖɱˊÇΤΙ~ͧăĿÝە"],encodeOffsets:[[-7897,4470]]}},{type:"Feature",id:"LBY",properties:{name:"Libya"},geometry:{type:"Polygon",coordinates:["@@ק̷ҿҤ೧βρՄڑϸϻƷ̗ҶήӹؔͬΘñՈńҠÓϦƨۈ¯϶˕ݐШȜðΠėΒ־͔ʶːЦʌ´٦দ́ΜðۮƓ૞ϓЀݛݮǍஆΙࣆйЦɔЖϮț٠˂Ф؄ЀׂŘ଒ǣ˺ϑ̺Iˌƛ࠴ıȲˣ̣ЕżΫɏԯʦڱ@Ჳ@ᶵ@့ॱGYΙ‧ྐ‧ྒࡓҟ"],encodeOffsets:[[15208,23412]]}},{type:"Feature",id:"LKA",properties:{name:"Sri Lanka"},geometry:{type:"Polygon",coordinates:["@@ų࢓ΙʇܵȓЍڜƫீϠ഼׆ұϺסО࢓"],encodeOffsets:[[83751,7704]]}},{type:"Feature",id:"LSO",properties:{name:"Lesotho"},geometry:{type:"Polygon",coordinates:["@@̆ʩʳУƛ˛ҳſƹˍ̛ċؿ٨҄ՐҖ͢ϼǠξʵ"],encodeOffsets:[[29674,-29650]]}},{type:"Feature",id:"LTU",properties:{name:"Lithuania"},geometry:{type:"Polygon",coordinates:["@@ãɊĚɲχƄࢡƨDZ۸२ʴඬÁࠜĊŞǩ҂Ã߲СĀϓۏˏșӃ࣯̓߻NȫʶљĜ"],encodeOffsets:[[23277,55632]]}},{type:"Feature",id:"LUX",properties:{name:"Luxembourg"},geometry:{type:"Polygon",coordinates:["@@ǘȏ³ρʍiȉòĞҼɖŽ"],encodeOffsets:[[6189,51332]]}},{type:"Feature",id:"LVA",properties:{name:"Latvia"},geometry:{type:"Polygon",coordinates:["@@†نЮՆߊ˼ڜعڪhNJ٤ܐƪςĻܢ̷ۚCКȕîС˒ӷ͕ࣗԛƙ߱ТҁÄŝǪࠛĉණÂ१ʳ"],encodeOffsets:[[21562,57376]]}},{type:"Feature",id:"MAR",properties:{name:"Morocco"},geometry:{type:"Polygon",coordinates:["@@ԒΥߜÎࢊȃκU͂՟ºԝ̄ࢱɜDZƷ͛ષƙϝ̵ӡñ—ثঙ͍ͩсۍɥ࠻ŷഫاRহŷ@@@p҉Ա˓ȑϡ@̥Ŋ۹ě˛ٻʿÕЁ੕ୟ࣡ˣୋ΅ϗĵ̡ቅãaD ϶͒ɮ˞ѪÃ˶̀פҴՖ˲ƊɞӬp҂̤Բ̪֔Ւ࡬f\\ц͔ްĢڎָтɠۮۮȿਸ਼͊ܢŔѶդ֨ࡈϦخΐ֘࢈˄ԪؤI"],encodeOffsets:[[-5318,36614]]}},{type:"Feature",id:"MDA",properties:{name:"Moldova"},geometry:{type:"Polygon",coordinates:["@@ȨŮ֒ĊؤʽΊϞɥÑ˵̪ƏŨΗ̊ɇÏűƾčɝ×ӷ|ĉŜǫãÒƭɱˍƥ˽ɁĝƯϦĘΪςӝԂˉΠʹʠʯĈ"],encodeOffsets:[[27259,49379]]}},{type:"Feature",id:"MDG",properties:{name:"Madagascar"},geometry:{type:"Polygon",coordinates:["@@ɠΥȺ։Ɗঢ়ɒϽĉЗƩʙ˷ӰǁʝLjثõΥɵȗ¿܅ͧওб୅ԯཧ͑ୟϛইہȣܻΡӛɊڙ̜ɳѺÇݘ̑ڠù؂Ʈ؄ϰƢD˪Дِø՚șЈǃՌãޠ̊ҺŔՒмŒҶǤ̶Ʋτ\\ӐӎۖԮʦцŗάΦĵҪ׎fԐ˦ϔ̊ί"],encodeOffsets:[[50733,-12769]]}},{type:"Feature",id:"MEX",properties:{name:"Mexico"},geometry:{type:"Polygon",coordinates:["@@͙݅ƥ؁Õ૷ąЧƤқʺЧǚٳ֎سȞӏ͢бࢾɝΐΙ݄ɾٚĎؼưՊƠՖ΂ȨӬè۸Ƣʖ֬ɚࢶȚݔ‡ԚîȬDZ…ЙҋԁȥԝƸƥűγɁٽɅɎǭcǃY̝ԓƳIJķPŭޥV޷AAӁϛC̺˫̶șĢǹƌ½s˷ઃEЙۅŢƽĭȟqʕ्ࣞџ˘ۇɖҷÓګ́чĉץɜؿDŽ޹ϬؿŠ्ϸ۱ВɃɤҹº࡯ˈΓϦࣗӊсՌȧЦ˪ĈđʈȖɔJ̄˱Ϙùͮ˭ъ݋࠴ࡋڀУԼܝ΄ƷȴŸԲѓȞӹФȽהҍæӣѸϿФ™ˀҍو̓٠^͔؇ͬ˫™ӑɴƇͿƔЕĆف̀΋خׁƒȡŸÓŎ˽Ƭ\\ǜթʮɇǴ̕Նё˨ޯʠρɸϿ²ѷКƒͶϡ̨ϑqƭΝ̱ƫJɛԞջӎ؃РїɈ„ؚŵҖЏʺֿϒŏŇɃɖԭȰӷӦÖÚΊ³̸̼ŽϜ٩׶ӱɶ̱Հ̷վϳڦͿݲॖÞ੪ĞÿǑ౔СኀףဪPژ@DΌผ@̪̕јˇԀσ˨ѭȾҥѢʩۤʥՊڒۊhפͱфֹ̄ӯӸӏȂחɾЃپʹ׮ȁ͞|"],encodeOffsets:[[-99471,26491]]}},{type:"Feature",id:"MKD",properties:{name:"Macedonia"},geometry:{type:"Polygon",coordinates:["@@ńOœǤӺżȊ˺¶ϴbтˏÒ։DžƒƑƥҕh͋ǿջõΑȴšήń˸"],encodeOffsets:[[21085,42860]]}},{type:"Feature",id:"MLI",properties:{name:"Mali"},geometry:{type:"Polygon",coordinates:["@@˰ƶƘӶˊpזɻӄǖ͖ÇŴȈ⁚^ȈךƣļЛ⋈Л⋆౾dᬼᆳᬼᆳȨϿԺʉ϶ƋV՗ठĈFካҟ֗íԭݛƃ଩ï̳̗ա՟IȿLjҥš޻ΑDžʿٳϕŗɍΙǡНŔɱȳūֻڙۡp˳ɭΣÆӥ΋ůȝŁŽάʍĥơhƷʕ٭PɷŴʼnùʱʎ¬ʢĿİdzĉ˚Ǥɐ΅ΚijɴȇȂǙvȫş˕őɱǹΫäɷɈƓ„ɕőƅAµ̮žʾí̽͘ʀǓӔԺ"],encodeOffsets:[[-12462,14968]]}},{type:"Feature",id:"MMR",properties:{name:"Myanmar"},geometry:{type:"Polygon",coordinates:["@@ӫηץ›ϥࣥΟƳО݅ՔؗΈօ̭ܵ̃ƹȪу֖ڙĪҷ_ϵ͠ދң޵Сࡷăذʴ٠˯ӼæࣸͽѤ˛৔Ʊਗ਼εۢօуॕ׳ҽöԳȠ̂ਪǫ޾څॺļ̢ӭņ׭ۆÅڰ̊ŵj׾дȦęΤȐ˺Ž࢈ڂȑϐۘ¨ЦҪ۶}Ӕજ׆׸ƱçԬ̎ƸÛ͈ӮÚˮӵξȧ|ٟ“ۙߓۭijঽࢲƔȨޛՐǍʓۣز́ζƷ؞ʔ~΍܏յdẕӓȗ"],encodeOffsets:[[101933,20672]]}},{type:"Feature",id:"MNE",properties:{name:"Montenegro"},geometry:{type:"Polygon",coordinates:["@@ÁǀηЯÊˋǫÞɽ˞εǖĢƜŬҦ˚ȜƾüɠƟŬśˠě͌ǧçïƽȋɧó"],encodeOffsets:[[20277,43521]]}},{type:"Feature",id:"MNG",properties:{name:"Mongolia"},geometry:{type:"Polygon",coordinates:["@@ࢮƢ྄ܤ౬Єܴʳ࢚]֘Ͻ࠼‰ௐɁࠈגͿӶࢊࢊश΍ނįনɍLjؿஜΛߐƺਫ਼ŌࡆōࠖЗԚѕެT੒Ƌޜȼૈƒ௸פԌĝѰ˭ৌêХهק࠽ɐ΅ӈńࠤŽ٦̴ڬˏހוğ̗ڏĦ௟ŏןʅ؝։౱͙࠷ѽࡹǞҿúѳէˎ͓ƌˣי˯׽҇গ̑ఽ‹ഫ̇এҋϋʾ৭AఓԜࠥŰૣśჃȊऑmӱԀϣޠԱĢ৩ԼଅŞুƞ̡θ͖চׅڲன̀۷Ѿəז"],encodeOffsets:[[89858,50481]]}},{type:"Feature",id:"MOZ",properties:{name:"Mozambique"},geometry:{type:"Polygon",coordinates:["@@لæ৞ʁɖńגt̚ʦԌaऀ͜ڞӤƊϕ“࠷ľ݅ಿƨЫʣ׷͙׍՗Եޏ͉ृСॉ͓ࣕƵוׯ΋ȗí׳ЌُǔӱZʣƪ¦{ࠗƋϷȤƝűΓΗ̗ۗ˳য়ҕρ̳ðΟɊÉíѵّRïϊůϖí̠ƬपɓװГஂࢬ॔ɜ؆ŶúĨӶƉʞ˜غǐ׌E੠ѥ˒ЏÔǹȼϳǰ۫gÅ̼āװᢈۘӚЕɴüͨɅ¸͵ǯϷØסոԱʲ׌ζǰíઊΙ؈̣˖̅]ɽદɾٔ"],encodeOffsets:[[35390,-11796]]}},{type:"Feature",id:"MRT",properties:{name:"Mauritania"},geometry:{type:"Polygon",coordinates:["@@և־ԗؤ֍ɞГʚҵUЧǽйð˽ˏïҐɺаŀߊģࠨĵкČмɑЎѵδǾˬᾔMǃ௎ȴќ߀øᒸ᪂©F౞Ṗ᎟౽cМ⋅М⋇ƤĻȇי⁙]ųȇ͕ÈӃǕוɼˉoƗӵ˯Ƶ"],encodeOffsets:[[-12462,14968]]}},{type:"Feature",id:"MWI",properties:{name:"Malawi"},geometry:{type:"Polygon",coordinates:["@@ɽٓɾથ̆^̤˕Κ؇îઉεǯʱ׋շԲ×עǰϸ·ͶͧɆɳûәЖѵɔʮޮ˄̈LJۢǚڼƞɪɉ܌Ѕϐ࠘ƽǜɵ˶Ϲɾଡ"],encodeOffsets:[[35390,-11796]]}},{type:"Feature",id:"MYS",properties:{name:"Malaysia"},geometry:{type:"MultiPolygon",coordinates:[["@@àћֈĶ˞ΈȘýӸԓΜ֛¶֣ęϡĆ˿Öӻ̒ɵͤݑe˳׫Éߑخ঵ښįђӟ֚ś̡۠ҜĠؔȃΤƤƮۈρ"],["@@أ˹ܯƚॱ@̅ॗ͓̇љୟۅǵߑɾЕóөщ՛Òէǟַӆƕ֘؜˽ٮǀǜ܆άǂ৖Ǻ׾ڔЬՐϦѥǮ˺В¸՜œа٪אшڀͼHќыžιֆɻ۬ʧÑ֝͡¥ƮЧ"]],encodeOffsets:[[[103502,6354]],[[121466,4586]]]}},{type:"Feature",id:"NAM",properties:{name:"Namibia"},geometry:{type:"Polygon",coordinates:["@@رٌؖ͡ȃࠊȷ،˯ಒm৒ŅҞ͛Όѡۜѳ৘ǽՆۃࠐ»٢КdžԊƞհ}ԄϝŶÐ₮˜׌Е᎞ş໴΂یȒհµͨȍPéӁȍʭC՛͍ͣΎಕ̍سƒ{Ჽࠣ‡BយA᷋ݣѕҋÕՇDŽϗÔƗάͩɰГг"],encodeOffsets:[[16738,-29262]]}},{type:"Feature",id:"NCL",properties:{name:"New Caledonia"},geometry:{type:"Polygon",coordinates:["@@ېԵѨϭ͉ȫҥɪ׹ϚէѼ։פś˶β[Һ˹φ˷ˎɻ"],encodeOffsets:[[169759,-21585]]}},{type:"Feature",id:"NER",properties:{name:"Niger"},geometry:{type:"Polygon",coordinates:["@@nּॹȐОҿպœϤâТբ̴̘ପðݜƄîԮҠ֘Eኬஈϒᝪ࿸᮪ཾ೨αӀңר̸ȸಯ̾ɓ`ˋΔ˽ǻί͕ၻ«ધੳߋγૉΔ̵CեբmčЃʁµˋƻm֩ंȟ’ځҷٱʔҍ¸ʏşӯ~ӷΧѓq৯ѢЉȵѓb̿͆ࡅ̼ࣗıɕǻşӗʋ͹ÍݣٗӚ̟E˭ʗ"],encodeOffsets:[[2207,12227]]}},{type:"Feature",id:"NGA",properties:{name:"Nigeria"},geometry:{type:"Polygon",coordinates:["@@ࢍ̡͉¬͓ȉڥl҇Ղˡ؊שֆكYݍB¶തs՘ǂՊʶʴТԴėɨǔ͸ȍӾ˪ÎݤʌͺŠӘɖǼࣘIJࡆ̻̀ͅєaЊȶৰѡєrӸΨӰ}ʐŠҎ·ٲʓڂҸȠ‘֪ँƼnͬͯğƱ«˧۽ٱɛՙšѧDZȉǝי҅ΉŽыȋ͹ÿΓֽ˱ҽΊ͇aԃӭʑQЍ߷ɍש"],encodeOffsets:[[8705,4887]]}},{type:"Feature",id:"NIC",properties:{name:"Nicaragua"},geometry:{type:"Polygon",coordinates:["@@̃ˆϽͺȁ˲Ο˄сϜĤžƒŵÚÒʾ”ŀȔŬRkЮȠrǬOǺɤʜǝĒľƺIJ̊ɴbǦĄQňȪĖ|ƜŹǚ›ȆńɄB̈ŌŜŖ˾iïă§ȉĐ̫ȗ˹ěͷυ®ɏtϙŹĉýΫÌɛǣɋ ɩźƏȩDZʛÈƓǦˉêȕʼnօɞųŇ"],encodeOffsets:[[-87769,11355]]}},{type:"Feature",id:"NLD",properties:{name:"Netherlands"},geometry:{type:"Polygon",coordinates:["@@ۦyǀ˳Ƚޓɇ́ԍ@ƘࢡҥȞՏπީǩ؛âѠɲ݀ఆଲΘ"],encodeOffsets:[[6220,54795]]}},{type:"Feature",id:"NOR",properties:{name:"Norway"},geometry:{type:"MultiPolygon",coordinates:[["@@᥆ؙઍɣऄՅෛ͵ڵû΢לઃͰಫ˵Ы؝ߟωࣗȮ઱¥णѼԉɝԷ“ūփནƊɝҵ߭Hևױ࠿झಫ஁̨˹̇ͫ࠯bձ޿¾૟՞э˥ধֻۧυӛ֝Ԫဋঁ૫ȟ୏є̛ࣚˇ኶ޞզᕠ۶ဌࢂ໤୦፺ྴඦلᘼ੊ᇎπ൪­౮ۢ໖›ພǘ"],["@@ም΅๝Ȝ׆ɐԕˎეǚͮ̿ொȍ"],["@@᪖صᑟͥұأ݅ǁЍۡৣᅵԢނ̘ఽʐ࿕܂ٷڄᘎ̜Ң̋஦\\͊˼௾ˆ੖̋"],["@@࿮̏ఝҍ᝱ı៙ƖƫɴஹdँϬᣴɼ௞ȫࡘʤᑺȽ"]],encodeOffsets:[[[28842,72894]],[[25318,79723]],[[18690,81615]],[[26059,82338]]]}},{type:"Feature",id:"NPL",properties:{name:"Nepal"},geometry:{type:"Polygon",coordinates:["@@ÝαŌՕĩͩ۩aয়Ȟ٭ĂӛђଷŊયҼ߉Ю߿͆͜޼ՒϠΒȪڪʳࡔշҾť˰ЕٶǓۀσौȕঔć"],encodeOffsets:[[90236,28546]]}},{type:"Feature",id:"NZL",properties:{name:"New Zealand"},geometry:{type:"MultiPolygon",coordinates:[["@@Ȓ΋װ;ʐΡBΝ̹ϳչإїͷ̴З٭Yܗ̓ɣջӋࡗڇϓнʇޝlխˢࣱÐƗ̰Ҍذ੐ࠦժǀ׾͌ܜѰԎѦώظ͈ɆŰҶלϴȆΧ"],["@@،ࢫlָϜɯŲًڰ˛֨ãӒ͎юĭȯݗʯӫٛjɡʭþαūƻͅҏзֹ٭ͯƟɘΕŨӞ۔˟ҨࣛͲz̦؈̌ƚ٨Ÿլͻ֜vƪБΎڋݔΗת̸àҚұٺɑʂݡ"]],encodeOffsets:[[[177173,-41901]],[[178803,-37024]]]}},{type:"Feature",id:"OMN",properties:{name:"Oman"},geometry:{type:"MultiPolygon",coordinates:[["@@ֹ̻ϟªǩȧƉэļ֗ÿĻϯFԽ̻ćХȓǯԹP͡ɃJͻПɷҩĂ֗˳ϱ³˝טٿ൴ᠾ࠾֖၂ϩתv͸ʔΐFΆϞǒƩŞèմіHϖֵҸ̧؞ŋӼƳϜӕɨ˧̞ŃCȉ̩ԃƅɽΟˏ"],["@@ʼnƳDž˺ʔ˺ľñā΍"]],encodeOffsets:[[[60274,21621]],[[57745,26518]]]}},{type:"Feature",id:"PAK",properties:{name:"Pakistan"},geometry:{type:"Polygon",coordinates:["@@تϻʞ٥൨ͻ߹۷ऩůౣȲЫα̖݁̈֩ڴгܑӟ`׳ࠃࡇՃ࡝࢝ࢡউÚऑࢡռϗĪ٧ҾэǘܝᇛD֓֕؛Ɇʣ؀٭٘໻ǁിeஃŝ̈́ঊொѢéϰГƌw݊ߥφͷԔеѶඨѕࡀŲԈŅǞȂגóદĈ܎ҶӈشCĠɼٞŌ̴ý͢ʀ±ԌΦԖ՘Ɇͥ֊ߜɴ̢•͒мΜĩмȣΤӬμࣘǮ८ĮѐƺӨĦ"],encodeOffsets:[[76962,38025]]}},{type:"Feature",id:"PAN",properties:{name:"Panama"},geometry:{type:"Polygon",coordinates:["@@˫ʎǵҒȺɢɅÎƿˤлɸοÁǝ̇ͻɁǽ‡ĉǩВҗɯŅŧŭϷ©ơԈŋƛˡ¸ǝ͸·ÈɓİέCǻĩŶªǖìǠƲŲIJǩŲK͸͘ö̠̝iDZͲ›ĀæɴȵЮÔΨɄԜǞ˺ʤҬ·‹ĉҶ…ώơ˜ʧ̈́ɵĹūȜӵǁʟ˓ÒŅС"],encodeOffsets:[[-79750,7398]]}},{type:"Feature",id:"PER",properties:{name:"Peru"},geometry:{type:"Polygon",coordinates:["@@ɥљћɋࡅӘñΈရࡊທࣾ٫԰ΏۜƐʎ܅ાࠣ༄ߍီ΅Ϥ˃ؤٷպױͼ˖ϒПߢʼךڢՎIJΓʇȧx̭ΎâͼĝΚщӆΌDŽ֤ԦܶৠͨࣸࢠʾմŝٔɢĂ֒ЉˎЅϴɏӶࢣضĿҨɞ̤ƣԎð٠Ͻթࡣʤoрҁݳ œųۍlj॥ֱÓϻɉ̇ČғԕʍBΡɛƵΔݳҲԝDZί֐µ͆҃ݐuېӸÇ౧ϢĩӄƠܪടǷ˵£ןg܍͟пƮ̵ȕ˯β۹Ջ࣡"],encodeOffsets:[[-71260,-18001]]}},{type:"Feature",id:"PHL",properties:{name:"Philippines"},geometry:{type:"MultiPolygon",coordinates:[["@@Đ֏ºҽ˹ޑ̫ࡨϽэˎإʉϿ঩Ӧɿ؊ʰЎՑЈˁΑЃثҵƑʖ͢۾ՌʀҜ̈́̔ϝٔɰƎϒרv·ٰڼЋêхÐ̱"],["@@̟ˡˁՍ˃ʝԫ׈ǦɤɂɾĢԸҨ¸Ɖ֣جߺāߡ"],["@@ૣߕЬט؈԰Ԏ׊Ѱ࠲Ʈۅևҧѳֿ"],["@@Ԏʹ՘BgΗϳΣՕʧ‡ϸÒєŽА"],["@@ʀभ٫ɞj˭ȶԯЍȋ•עʧªƁԘӶãY͈ԣٜ߮mɴ̻"],["@@ɟܩέоѓ٘ܚ‰̡̈"],["@@ԮʉʶɖüɇƍΑ˼׻ɛۥӷ˥ƁڳȊڝѾġϊIJਾүăҙ˜ȫēϯٻЮ̵Ѵɍ̯՗ԊރůлȆ¨ΎˀɊʣȘŇ̡бӚűμߨͺˡĔೄ˜ހԘA"]],encodeOffsets:[[[129410,8617]],[[126959,10526]],[[121349,9540]],[[124809,12178]],[[128515,12455]],[[124445,13384]],[[124234,18949]]]}},{type:"Feature",id:"PNG",properties:{name:"Papua New Guinea"},geometry:{type:"MultiPolygon",coordinates:[["@@ɽčε͔ρՔǷ٘ŜĆĜʡʬȏРՑЈ˵ŝɽ"],["@@ѯçƃɽҟȱћȟѽBۏʔӑɺêʺݬũҠàŶЖŦrĆѽӐÜʂ˼Ҹ̚ġӸԌfǜƏgү˯ԡ"],["@@ݤտղࢻӖ„‘ω٬ƛʥǁࣀΝġʏ֋ÏȷɔܟĦࡕŴٷ՚ӉҦѧ݀ભπ܇ʇԡˣńإڇ˿һƖࢅ–aᩒaᩒภ׃༊ӓׄїҴхŸӵඔԱȲѽޛěȄ֕"],["@@ʿɡǁӸȝ͘ϝ˞ӍΪ؇ʚɺȮҒɻ˸ȁΜȫʹΛ͊ˏĶѧ"]],encodeOffsets:[[[159622,-6983]],[[155631,-5609]],[[150725,-7565]],[[156816,-4607]]]}},{type:"Feature",id:"POL",properties:{name:"Poland"},geometry:{type:"Polygon",coordinates:["@@·՜à̂ȹ̧҆̚ɺɤȝђָʘ಼ϴ੒˴࠼ƙÚȱ߸Yਚħ໶^њěȬʵšωɸ͋KͯԋǡʸϳfϏцܻěɽзįރۥɒϗǿ¶ߙ͔؁šЇĒӹǵч̖Ήŕ³¼ϭаر¼ăˀֻĦűɑҗǨÀɴػòЉ˔"],encodeOffsets:[[15378,52334]]}},{type:"Feature",id:"PRI",properties:{name:"Puerto Rico"},geometry:{type:"Polygon",coordinates:["@@јõưǕɋɃمLӫ‡·άŢŬیK"],encodeOffsets:[[-67873,18960]]}},{type:"Feature",id:"PRK",properties:{name:"North Korea"},geometry:{type:"Polygon",coordinates:["@@Şƥ͉ºη˵ʣ˷Ž׽ѣȅƫƧ̓ʝ֓ƏηɥηįġͰƋӈσŧȭΧÇץ¡͝ϛϑˆÁùСdžĵƿʙé‡ǀɑüɥƆɰφȤİõƶɆҒÅƎөĠЇɤۄբऒҌ־׮Ўˁܪ‹ſѺಚβͰҼժӹ"],encodeOffsets:[[133776,43413]]}},{type:"Feature",id:"PRT",properties:{name:"Portugal"},geometry:{type:"Polygon",coordinates:["@@̦Ɉ΄ŬɂЫӺDƞłӪ‡ɼуϱɩYٽƍū‘Їγçʹԋɵտ̄ʡřɫ̵̿ê˥ͷɓѷŠџġŸڂÿԬϓþȩ͈äռͰ̨ÒͼǪԎkΤǙ̠™˲"],encodeOffsets:[[-9251,42886]]}},{type:"Feature",id:"PRY",properties:{name:"Paraguay"},geometry:{type:"Polygon",coordinates:["@@ͦ৖tҌЖ݌าʔޮ]޴їbʵʞҳÇଛࢲLJ΄ǐ֦ɩǀʣþޓİ͓̼›̀ƌ̢ƳAҥŕӻǑӛƍݏށ١ړƇऻŸࡑɮࠢ౨ťψࡽ͢ਅبۉŸ໵ൌ"],encodeOffsets:[[-64189,-22783]]}},{type:"Feature",id:"QAT",properties:{name:"Qatar"},geometry:{type:"Polygon",coordinates:["@@ÇؔɨѲɰĜʬˁdӯǽӳɵÑʫǖ"],encodeOffsets:[[52030,25349]]}},{type:"Feature",id:"ROU",properties:{name:"Romania"},geometry:{type:"Polygon",coordinates:["@@δǶԴġՠGϸȳ˺źبĄɄȠΠ@ʰćʺʟˊΟӞԁ€ρėΩưϥϒƹЂƊϠƟpɏПǹʯĀɻ৥ӳĖ̪ؑফțзɋ௽¬٥ƀ͙ÕʍΊƵƦȚƘȷŀ˃ȋөʔßΌԟȢĥˌҕͤڪǂԖ֮Њ֬ԢǮ"],encodeOffsets:[[23256,49032]]}},{type:"Feature",id:"RUS",properties:{name:"Russia"},geometry:{type:"MultiPolygon",coordinates:[["@@ࡌ๫కˤԫ்ࠌࡳyוُԒսٱƻ۸Ĥࠊħ࣢Țٌš૴ӯࠜôରަϮͭϴϐŠɔ։̆ߵuࠟΎࡑ"],["@@໵]ਙĨȒτ୊˚ࢢƧψƃęɱäɉ"],["@@֦Ƚțؐᗸű࿨޻࠭λ൛ēsࠑͳǩ޽~ٗ̊ૣʖȉθ࡟Ǝॗʼnҗ̎Ǽ̸৓ȥϚЃӉΣ@„Ꮪٛᔺ࠳ïԷ"],["@@ः©ƭˌੲΖ@ַ"],["@@ળ»@ָň–܈E௒ʉïŗࡽȩ"],["@@ౡMႣĤƧ¬ߘͪੀþஞ͏ĸə"],["@@ॿͩഉø༛ͨȪ˖༨ųᑔɗ"],["@@ډرᶽzඃȣမղҎ׀૎ǂᕞ™ᴬѽ"],["@@ӹóᩣŊɟώູɦūҒ࡮Ƕ…Ҟသܒޙĺ፨݆ɩϢሤѺ᪪բ᫠ǀ෴̸࿐Ŋאͩ֟ʻᲗз᢭Џᤙߝఫࠍ೉߱Ǡۥྎۏ"],["@@ɨгސȲឤYቈЧڬ̿ȽѧङʝᕅүفʟਬşఖɃݴDŽєաτɔഊƂ᧪ƑȴϽ↲ů´ٜᄼƥഄLബѷϮ՝ӹΙੌڋ೔Ϳ߸ࢦഖϙ෢ɦྼʵؤʀൖş؅ޮૐζ䢀ձܐӿᔲٛ₎DŽာƑ۪΍Ĺؙਜʇ૴Ǥ๰vཚǑཪĢะݛਪˎڷ՞ϐώᧆɻფºᝂБ୲ν@”MKઇσઝÖݶҁԄەϲɧĮΏɑɝ༧Ǿ᚝مݛĭ౽ן௛ԧ̱ϣய׊ᔗڇϣ̸ߵΫ૱Ř˓ց৙߽Šͻड़ȋő௣ޭ‹Ϋ۱Δα฽ѕ̅ॡభȳʥ࡟ே޳ׂ̳έ௬ҵለИ୘܀ԆªϾರȊຊ੒คࡺຢڢڮஆ৷ëԍۗᒉइۍਖᓧ˷ᑃටۚԧሙɕಝēÔ؊ಯŶ਩ЭᢵƠ᪏ʟᨩ࿛ủጝ೚ŁаՃࠄȅ՞оईÃௌऍ†܍ځ࠽ë্ϛഉ్௓˯ׇଙ঑ଇॻթӹ૩ӱՉYՇФૻؙſ˩ŝƦKѐіxŦ঴ɛܚܞ̒৶Ʃ֢ࠈ˾ऄ͚̮Ѵݲ൷ʛܯͧ౧Dͻ߄হװหˎ̵ࠖ̉Ԫ̿βԯࡐ̲݇షʢ૛uਯƱۛлҤȥXҩұˑݷࢻRσஅՍ৙̈́োéѯˮԋĞ௷ףેƑޛȻੑƌޫSԙіࠕИࡅŎ੝ŋߏƹ஛ΜLJـধɎށİवΎࢉࢉ΀ӵࠇב௏ɂ࠻Š֗Ͼ࢙^ܳʴ౫Ѓྃܣࢭơ͡çѽԤઍőΧΦחnjЙӠҩưிɍୃӜ҃ѯሟᒒੵٮ̮˂ᑋߍ߭³êҞઅ˺࢙ȱ˃ࢊມǺݯΑᑅ̳Чȹḭ̇ϫ˻؆ֹ߭ɓǀɭ߭ХസֿɁЉ୻˜ʓʟ੹Ѧ೯iࢻΟহͼᇡ׊ಽsჃࣳĿؗࡹӤڡउʖǡӝُ܊֫ذx՚֗ďѝѐƋϥӽ߿Ƒ࠳ࢁކߕĉ֣ࣼফԇ͹ƝɇωÌֿԚɿ†ՅȚʳΈ޵ǮԙƁƥƼଥЖఅƌ܃ƞĹıੱ܂य़̈́ܩӴؒƈۤ۰ҹͪఌ΄uȀݯƉ‚ώѠɼ߼ÖƄ˪ȅҪ΀ѰWʚఉ˚ӭUԯЀ١ƃ੩̐lǒ̗θڟ¤éʼɀǞ՝ӈࢋąʭ¦Ƀȑ̽”ȷ՞ȟ˨NJĀڴ‡͞Ȁʍɢ֥ƪ¼Ʋ΁ƴՃվǸɨĉЂࠑȨѱijšȼࢭɂˑӸíТЙȖάˊʝ޶װӞųƤक़ҬࢡЎᅢ੶ޮӠ͂єగּΆնݳش֢ܜ঍ग़ޢي౿֔ŬךڶüොͶࢀ̈൦ԕᘨȧṺो٤ЋÆ֓टѳ൏ɡ⏷ٔ؟Ńൌ؛ÂϵÆ࡫ઌʯڂɓňРԑΰ՘͈᎖Թ۾Ȳ֣؜ዦࠖޢµ޸̋Ӫ׀۫ԄЪԊءԶᚠˑӔҹ੡ĻNҳڌ˽ಜǼȶ՚ჶАᰪܞي£ࠣԙਬĕ׼˼༾xఢΐफ़ԏॖ֌ࢡӢѪˤ២ʫ୒ʿᴾॣ֚ѰࡡѺ{ǴৣĈˢЌ҅ټ}ː༄ݾրކزǒᕮɛǬұߕڽԺˋ˒חȏଵऒԧέ֕࿫஝०ŭ̢ͮऎɎɞжܮЎөӌϼֈࣿêȫҲڢࡈણۆຒ֦șװмnѴүͧ߷࣐Ƶϥ؄ඤͦლ¬༈ӏݛ۪ċࣆศǞ፾™ᆘŌہѮংւॲx࿎иᕠŐ˪ɲᕂþیȋሴҀ໲aɶδߤΨጤΈ෸˗ଥȷበŹ"],["@@ⵙ͕ໞીےĦقÃᒈӋʟͿ"],["@@૽ōݱÛśƏঙƑ࣫ȦӐʾል~࿞ƶ౨XǢɧӘȬߊƐఞǿ͗ŷ"],["@@ᆳĿᚉʎඅ͎٣׾଩ǔᔆָᆎȎ࿌чኬ߻ȹݯ"]],encodeOffsets:[[[147096,51966]],[[23277,55632]],[[-179214,68183]],[[184320,72533]],[[-182982,72595]],[[147051,74970]],[[154350,76887]],[[148569,77377]],[[58917,72418]],[[109538,78822]],[[107598,80187]],[[52364,82481]],[[102339,80775]]]}},{type:"Feature",id:"RWA",properties:{name:"Rwanda"},geometry:{type:"Polygon",coordinates:["@@ͬӃµӵʏŁѿÆʱӍԛàþҠŘތԄʎɺȰďԈʸ"],encodeOffsets:[[31150,-1161]]}},{type:"Feature",id:"ESH",properties:{name:"Western Sahara"},geometry:{type:"Polygon",coordinates:["@@oҊŸ@@ÉeNjEౝ᪁ª‚ᒷ޿÷ȳћDŽ்ᾓNǽ˫˜΢bCቆäĶ̢ΆϘˤୌୠ࣢Ђ੖ˀÖ˜ټۺĜ̦ʼnϢ@˔ȒԲ‚"],encodeOffsets:[[-9005,27772]]}},{type:"Feature",id:"SAU",properties:{name:"Saudi Arabia"},geometry:{type:"Polygon",coordinates:["@@ʼnΪʩʨÝͲѡ̞҃۴ʁۆׇ׀ϑƐ֋ߠīא–ӾӕञϿ͠ґǨˡӖ°ȎɹѦʕȊ͝زԟڴѓ־лIžҦœ̌ļͲनƅζʶȪ̢ٚŚƒˮˤƜ࠷ࡀ၆фdžŴৢɩబיᛎၕ༠ãݠąȾЏתv͠ܥаȓƠִ̏Λ¼΍ċ˩ł˯ʎɽŐ˟ŲȵʬǕɶÒdž͍Žș࡙͐ᡌщǞDzϪש֕၁ᠽ࠽ᝑ͑޷ϙ׻ࢥϹƕɁˬ͏§߻ĎƷČॹmɫùΉɔɝЭĒΟρˋ"],encodeOffsets:[[43807,16741]]}},{type:"Feature",id:"SDN",properties:{name:"Sudan"},geometry:{type:"Polygon",coordinates:["@@śhdмĵ̀џͨĵ؄ĶبϳÌÍȇԍ©Ȭʕðԍңңл؅џđ۹Ӫͅǥđʓџǃ…ǥ࠵@řǦ؃†̡ƝɳîѝӬƟɲ؃ŗɱϵɏݣ˿ǁʳğå ̅ʎÃʼƌΔE΄ӛՀĩάZȰ̱ʜUӦǭ͖̍µĎ̰ɒΖħΐˢʴǫȞɞ԰ϨئܦÏ¥ ZΚॲH@း@Ὂ@ῼ@˔ࠗȁƳŪࡻ্̰͌ȷҠ̳ыӑأƏ˅ʳĉ֑α௿ĚͳƅܟͿࠟԓзέٛč΃Љɽʝ࢟Dij"],encodeOffsets:[[34779,9692]]}},{type:"Feature",id:"SDS",properties:{name:"South Sudan"},geometry:{type:"Polygon",coordinates:["@@Xٽűʯѿq˷ӏԨÑюХƨͳϦșӼࣳ֫օԫԇԫϭסFگȟՕȊ΋ɭ݉֐ȥάҵDZϱÆɣƕϗĸԗۚƉˊعͪɅԌΕζ֟ѬS˘ҡͼ֯͠ʴĠ̀ǂɐݤɲ϶؄ŘƠɱўӫɴí̢ƞ؄…Śǥ࠶@†ǦѠDŽĒʔ͆ǦۺөѠĒм؆ҤҤïԎȫʖԎªÎȈϴËĵاĶ؃ѠͧĶ˿cлŜg"],encodeOffsets:[[34779,9692]]}},{type:"Feature",id:"SEN",properties:{name:"Senegal"},geometry:{type:"Polygon",coordinates:["@@΍ٺн̚φDŽРמȦќ˾ːкïШǾҶVДʙ֎ɝԘأֈֽžԹǔӓ̾ɿî͗ʽŧ³қâÙģȃk׿ȲЛV༇–ɥħ˥‚ѻƋƏ٢ވkȬŞƮR̸ȘήǯκcζȌǝʐˡƙʻJͧȸˉ_ȍȥࣵy"],encodeOffsets:[[-17114,13922]]}},{type:"Feature",id:"SLB",properties:{name:"Solomon Islands"},geometry:{type:"MultiPolygon",coordinates:[["@@ɾ˿חN͉ԬԈȯǜ‰"],["@@͝mԧĎǫżÀͮֈƁ˜ǭƎə"],["@@ųƹحܰǫԈ˺@̠ڥʹЗ"],["@@–ǛڅΦҟ̠̿˪ŰĐϮȫېϭȢˉ"],["@@Ǘ³οȒ·Ί¨ƖԈΡͰ˛"]],encodeOffsets:[[[166010,-10734]],[[164713,-10109]],[[165561,-9830]],[[163713,-8537]],[[161320,-7524]]]}},{type:"Feature",id:"SLE",properties:{name:"Sierra Leone"},geometry:{type:"Polygon",coordinates:["@@ɧØ؁ͺѩ҈Ƨ̬Ĺت҆τĬɺƞǸɶpȜǂڦCɺ̛ǼˁʓƈɗṶɴ´ϹϹϛҗ«ʓȩˏ"],encodeOffsets:[[-11713,6949]]}},{type:"Feature",id:"SLV",properties:{name:"El Salvador"},geometry:{type:"Polygon",coordinates:["@@ġȡӡ^̡Ą΍ǘұÀʃǶ~Ů˾ɄǀĢ«IJȠ¾ʜëǸǙʪƇŒœτĴǤÑŘĝÏͳ"],encodeOffsets:[[-89900,13706]]}},{type:"Feature",id:"-99",properties:{name:"Somaliland"},geometry:{type:"Polygon",coordinates:["@@ϛԩד۫۹Mᩧা͍̜̳К̳ҨǾ̖̲҈˚ƹǒΏϜΗкGߊɌࣴĴ݌ʼиÆ̚ƶӎˆKaE΋Aࡑ@ѫ"],encodeOffsets:[[50113,9679]]}},{type:"Feature",id:"SOM",properties:{name:"Somalia"},geometry:{type:"Polygon",coordinates:["@@ѼĎЊ˾͈FpɵýӧHѳǯ̣ʁࣥЙयԱ੷ܝ௷ܓवধ଩ࡁڹష࠯޳ٕँৱȗѷȍȣӽۚWᵤܾ॒ɰˆբfݠפબšᛜᡄה۬ϜԪ@ѬBࡒFΌLbːhϰŰ"],encodeOffsets:[[50923,11857]]}},{type:"Feature",id:"SRB",properties:{name:"Republic of Serbia"},geometry:{type:"Polygon",coordinates:["@@Ԡȡà΋Ӫʓ˄ȌȸĿșƗƶƥȷȏø̫Тγ͋ʿƗˋĞijƑšϳa˹µƒØĴĴĦȴšKǍƼƑ ŋƆƽÀšŠƯ±ś˧ȩÑèð͋Ǩ˟ĜūŜɟƠȢšŬЄЛ͔ɀτ̥Ë͔́ˉʈȱ͘٢ɚԾ™ҖͣĦˋ"],encodeOffsets:[[21376,46507]]}},{type:"Feature",id:"SUR",properties:{name:"Suriname"},geometry:{type:"Polygon",coordinates:["@@৔ǙĞưڶÔࣚɥѩܟâֹͤӽƥίóϩɉΛӓDzЇđ͹öčʏƘǗ÷ǡҙèԡܴōӄˏBωؐƺѠ¯ȤԜɖƈݲ"],encodeOffsets:[[-58518,6117]]}},{type:"Feature",id:"SVK",properties:{name:"Slovakia"},geometry:{type:"Polygon",coordinates:["@@´»ΊŖш̕ӺǶЈđ؂Ţߚ͓ɷɓǏ͹dzđ࣑ʮ˟»ȟȡЁĿěÄХŽͭ}ãǙ۷Ļ̱ĠёɌċ̆äńŢȂόa˺ĔxþLj¢ÆȒȖ˜žưʢD"],encodeOffsets:[[19306,50685]]}},{type:"Feature",id:"SVN",properties:{name:"Slovenia"},geometry:{type:"Polygon",coordinates:["@@ۜÝъȐܾtLjƘƘUǎ˳ڝɟć͹̇đHɻͣh˷ƎƷƙב†ȈúȫΨĞа"],encodeOffsets:[[14138,47626]]}},{type:"Feature",id:"SWE",properties:{name:"Sweden"},geometry:{type:"Polygon",coordinates:["@@ࠁוƀԥ೹ڭྱܡؓஃײףߦүޗॅ࢑ȝ͍තӋ޿৳ĆӅڗঃˉߐ۳॔ٓஐφӜּۨ˦ন՝ю½ૠղ߀࠰ä̧ͬ˺ಬஂࡀञֈײ߮GɞҶཔƉŬքԸ”૪Щ಼ֱv಑˴͛ฃʃ"],encodeOffsets:[[22716,67302]]}},{type:"Feature",id:"SWZ",properties:{name:"Swaziland"},geometry:{type:"Polygon",coordinates:["@@ǡύӭěԅҖS̄ɰ̀ĂʔʐÒшƵŰϕðω"],encodeOffsets:[[32842,-27375]]}},{type:"Feature",id:"SYR",properties:{name:"Syria"},geometry:{type:"Polygon",coordinates:["@@࿩ࣅऩͬgNŖŶ_ΈȸҠҜ̈́Əͤϗ¨ÿٞȶΌɤȀɤȀ°Ҹ˞Ǐऎɺ҂ƿۖFॴ̀Ґaक़žїԽҡȹĂؗͅ৫ᇵ࢓"],encodeOffsets:[[39724,34180]]}},{type:"Feature",id:"TCD",properties:{name:"Chad"},geometry:{type:"Polygon",coordinates:["@@ĎЄաnDզΓ̶δ૊ੴߌ¬ન͖ၼǼΰΓ˾_ˌ̽ɔȷರࡔҠ…ྑ…ྏ¦ ܥÐϧإɝԯǬȝˡʳĨΏɑΕč̯̎¶Ǯ͕Vӥ̲ʛYȯՏƛэͽ؉ࣹ߅ϳ߹¾ʁûĊ̏ѫ̋Σ͟੓͏ȽȐƓhƹɍۛÙƀɪ˅ׄşΐλƜӷӪǼІϦċʂÐҸSқކŒ֐É֐ͭՠ"],encodeOffsets:[[14844,13169]]}},{type:"Feature",id:"TGO",properties:{name:"Togo"},geometry:{type:"Polygon",coordinates:["@@ڱdzȇ̎ɡՔãкȆݴɁ̬ăڎD؎ΕѠÖˀ݂kŅѵʲʝ̈̋ŽЭǜǥኝȺׅ"],encodeOffsets:[[1911,6290]]}},{type:"Feature",id:"THA",properties:{name:"Thailand"},geometry:{type:"Polygon",coordinates:["@@ݭϬܗeŬڈ݉Káऋґ௯˙ݏÌ؋ն΀ދưܭҶӓԚĭѤѧ˝·ևĵßќۇςƣƭͧ͒ƝжҁӄПЌƏӳǃҲĠԾʚ߬ТࡸҤ޶͟ތ`϶ĩҸ֕ښȩф̄ƺ̮ܶ·ֆՓؘН݆ΠƴϦࣦצœӬθӔȘθʷ´ԍ֨ȷࢭpݫࢰԆʤƧӰzǜَ̊ÍٖڽÀࠥںܷ›܅˙ϛ޿ŦગDž՟ۧȤ১"],encodeOffsets:[[105047,12480]]}},{type:"Feature",id:"TJK",properties:{name:"Tajikistan"},geometry:{type:"Polygon",coordinates:["@@̭ʷࣳƖāӛ࣬Þਢ˗འŶɈާˠĐԜȓ‡͛ŴӍࡿBׁØԻϕύĉ̉ǯͩˠþ۸ʩ¢ĞʲғȐα̇ė͹Żūԇj˕ϩ˯nj؋ˑʱĺӀࡘǹض؟ȨɔφۮŸЌҬˌբ૲ȜǩϵŤɹΎv"],encodeOffsets:[[72719,41211]]}},{type:"Feature",id:"TKM",properties:{name:"Turkmenistan"},geometry:{type:"Polygon",coordinates:["@@ñۼطŠॣݔڣĠगюׯþσƽ֙|ׯӓ݇NjƻרŪ࢞ٽ˶Ɏֺ֏¸Ȇ۾ߊȵ݈ˎؓԎʉӔڱɋď؛ʿհψ˨ॖǪ֨ɻךڅњ¤ॆ\\Əцܖ̂۾ӦଆѹĜڡ͐ǣࣦžˮƳаࡽ०ׇոЃ࢞Щ૤Ϋwԥʩ€Ѕɤſ̙۽NjǙڥӁʭڏŵǫϟهŏࡩ͈"],encodeOffsets:[[62680,36506]]}},{type:"Feature",id:"TLS",properties:{name:"East Timor"},geometry:{type:"Polygon",coordinates:["@@IJȤܢȌז†ˀŀ͆Ľ̯ɫ࢕ο۳ʋeʬďǔ"],encodeOffsets:[[127968,-9106]]}},{type:"Feature",id:"TTO",properties:{name:"Trinidad and Tobago"},geometry:{type:"Polygon",coordinates:["@@ӚŊǮ‡‘صۭġƯúʒɲiͪ"],encodeOffsets:[[-63160,11019]]}},{type:"Feature",id:"TUN",properties:{name:"Tunisia"},geometry:{type:"Polygon",coordinates:["@@ΩພԭͺQȰۉԄóنԮҶȢۚƃߠǠќࣶͺךĵ}ы܊̲ÒljпЫMϱ̆ȽōܫփхDŽқѤaɄЍ͊ſ³٥Хʋʵˏֽ͓ĘΑïΟЧț"],encodeOffsets:[[9710,31035]]}},{type:"Feature",id:"TUR",properties:{name:"Turkey"},geometry:{type:"MultiPolygon",coordinates:[["@@஺͗ঐżܤõলѬࣆ¢ߴЭƜ̑ăУزȻͨʕֻʇˀ५ǏʻҠڧЕƙ̏Ɋ঍ňίŽॗŽҏbॳ̿ەEҁǀऍɹ˝ǐ¯ҷɣǿɣǿ̱Ϡ͈͂ԟí۱ȖֿәౣĥڹҊࣟ†ȗΑׇij߻҄ࣻeӽ࠶ؗҰЦٸՓВठߨಒ’Μྀٔŏ৞հ঒ʄർlุף"],["@@۫ҏ˃Ϻ\\ǦȦĦʺՂХɞࡦ˄ܤőĴ͓ܼ˓Ƶȵি±Ωʷ"]],encodeOffsets:[[[37800,42328]],[[27845,41668]]]}},{type:"Feature",id:"TZA",properties:{name:"United Republic of Tanzania"},geometry:{type:"Polygon",coordinates:["@@ƚġᵂႋÌӣ஼࠿ϱਙ¸Ӊՠ̩~ɓɳԓ¶ʭÇГ̌Ճΐ̰ࠡǿڝӣࣿ͛ԋb̙ʥבsɕŃঢ়ʂكåɽଢ˵ϺǛɶࠗƾӉʨՕƘͯƘΗɈґ੖ӣҺǗӤČѨƯޞΎ ̨̦͜ѬȺǮS˘ǷȐ·ͨʐł¶Ӷͫӄ̎Ķऄ[ႎà"],encodeOffsets:[[34718,-972]]}},{type:"Feature",id:"UGA",properties:{name:"Uganda"},geometry:{type:"Polygon",coordinates:["@@ः\\̍ĵԇʷȯĐPوȜ͎²ڬǰϸ͎Ѭ͔ɠ˒̘͵Ŗ¼চΌɮՖȉڰȠעEԬϮЊ׍İсτ९̧ؓЯ֋ʉͽTࢹႍß"],encodeOffsets:[[32631,-1052]]}},{type:"Feature",id:"UKR",properties:{name:"Ukraine"},geometry:{type:"Polygon",coordinates:["@@̾“ɄȒʮ¥ࢌĆ՞Ӈȿǝêʻڠ£̘ηkǑ੪̏٢Ƅ԰ϿӮVఊ˙XʙͿѯȆҩƃ˩߻Õџɻύڡã֑˕޽«ܣ̻¸ԹЪȭࡨ¼Ǐ̛ँơଛӟұǠȄЂࣽʘƨLjߪ˪ʑȔಯɆË̼ީĻ̷ҧٱةϟƠЁƉϑƺɂĞƦ˾ɲˎÑƮǬäĊśӸ{ɞØƽĎÐŲ̉ɈŧΘ̩ƐÒ˶ϝɦΉŽأʾ֑ĉȧŭΟ@Ƀȟاă˹ŹϷȴ՟HԳĢγǵÍɤұɮǐͺɸɔȀµɑϘބۦиİĜɾхܼДҢɪٲnࡖßबȫڎi͂ŧ̀Ʀɚȝݸ¢ͮąÄцʶȂܞº"],encodeOffsets:[[32549,53353]]}},{type:"Feature",id:"URY",properties:{name:"Uruguay"},geometry:{type:"Polygon",coordinates:["@@ղĚࡆٯ̺|ࡺ՟ڈҫӠֱχЉɸӇεՇॉұاǚғěޥΰ֫ԟҬÞլǾȈS࠸ɤࡺȾڦ"],encodeOffsets:[[-59008,-30941]]}},{type:"Feature",id:"USA",properties:{name:"United States of America"},geometry:{type:"MultiPolygon",coordinates:[["@@ũƕȽŤ|ɾƓ̨¦ĤƤƎÍǔ¸þÜe͐ƙƬñƌőɊ̍q¯͟ǵˏſ"],["@@˭ÑƟǮīèQÀĈî̘āɘŹëĵ"],["@@ĝ҉|Úĸа•"],["@@­µÓŻˆŃȒ’ɤŚêÃʐ˥"],["@@ıĉ˱ƴªÖŸĈȘijȝ"],["@@Ƭңʼƛז½࡬ƅࠂʹڼŊਖɓ˞Tݨʄ߂̧ࠒ͗ں˩ٶˏĈəȢĉ½ĉɦǎĔ¦ȣǜƅɴ@ŬĹĽƫ࢖ЁǶށǚܳʗӹЁҥȁ̍mēĦť˸Ɓɂ@ঊ҆ࡾƀસмfĐ÷ʰƉǒϜƆࠜHޘAˎ͞ŀàࢶ؄ϜƸ౦N໾BĎȺː¦Φž̖Ϣʲٺٚي˨ə֜ƜώʏAଧռӅƢ˝࣋Пࡷ̃ࢱʝѻӿƛȋSѽˤѽΒsė̬ʦȇãʇ֥ƋЗhةƥλ¥ӥ¥۫ʏఀǂʠǃ୳ʥ՗C|ĺʭɷʚǹ׽ؑ٧×Ɏȁª˟ɀǪҍȼƭ^ͅˏ͛ҿڡûʺֲѕ͎įۦljεǴՑևƀׂ˓˜ߛʊÍĖ̃ŠࡁՕدࢇʝցӱнÁэ̱ţ˭इձӁЍЅӽŻׯƪ׍ˬܗώשLεЊঅ֥—͛ȿԡʣŃЯĺƁς͋ȖѻܢϹٞű͢Ǥ֐ɽҦٻ۲͟źࡑϡƭ¦СϼՃȺोŁݗĤٙÍΏſƲɟaͽǴǓLJō̵Ů́ǃ؍€طѺܻĿ؏ȚԹÏۻȝއح࠳γҝБȕϗUׅ¨ЕDŽ˹͝{׭ȂٽʺɽЄȁטӷӐ̃ӰуֺףͲۉgՉڑۣʦѡʪȽҦ˧Ѯӿτїˈ̩̖ป@C΋ڗ@ဩOቿפ౓ТĀǒ੩ĝॕÝƙіխӚϻĴğʌһ¦̝ɪޭĊɉƌĹҢࠁࡊ۩ୠˆȚχˤٯ۴řۆ҃ҞȀۢ…ܜˍ٢͠ߊĸނĺނƱૼˇܘʓ϶ĸǐ௒˷҂ߋȺɜƇې˷ێᛸ@᠂@ࠜ@ᢢ@៚@ᡀ@ᡄ@᭰@ᮞBაAF͔˴J"],["@@࠽͋ѕɐŽЀބ̘҆Ÿ֐ÉΤʻܫЍ"],["@@ԧŽսƾԛɮࠦƞښùĂ͑"],["@@԰DžԾĒڸɛ࠲őéĝُDZٕǾ͋Ʋݍµȧôº̈́"],["@@؊ϛώnjහ»¹ȕ౾ƛࡨČᄚ˅ྤā٨ʼn૦Ǝౢʧࣲŝ@@MᷱIⷍࠠ{ࠌɵהρݜցࠈҺࡈ˖Ҁѡ֤·ޒϙՂ׽࡮य़ේ՗xՋұЙҥ͂ݍˌʃܺએںҍߎ߯Ä೷rটʌ჉ࢎߩDŽ฽̜୑í࿻ϬৃΨटǯǦ׏ҫÁঁǫ݉˱झdzťӶϚࠚࣀʶɱɂੱҵֵ֑௅ױؚСߏ׿ࣗΗࡁʱȻωಽѡ˅ϿছΫֽÞ޷ɻ࡝˹ۧ˫෹ʉſƘऀϾࠔʸࣆҠਬĨвΈ୘ԊȈǚب̒ƢْђӸॹʫ˓Ơҕ̧շюɧ̝̽м࠿ͳԩBïԄƲ̮ե̚થLJ܁ЀַȬIӈ٩Ϊ͘ӘۆҸ̚њںÖ־ƇڴМ؎ï٘ʼƻϨҹưج͖ԩWࢻǽʯȃڏȄஏĥ௷ȬΛ͸੟Ӧ୾ΘመШ۔@ŕнᄢŽڽԶਕ͌ױр߫ΨଽˈҺѲ๰‚ਗ਼ϦȨФ࡬ЎࠊĪཪώޜÉಐ҄ౚǭ"]],encodeOffsets:[[[-159275,19542]],[[-159825,21140]],[[-160520,21686]],[[-161436,21834]],[[-163169,22510]],[[-97093,50575]],[[-156678,58487]],[[-169553,61348]],[[-175853,65314]],[[-158789,72856]]]}},{type:"Feature",id:"UZB",properties:{name:"Uzbekistan"},geometry:{type:"Polygon",coordinates:["@@xԦૣά࢝ЪշЄ॥׈Яࡾ˭ƴࣥ͏ǤěڢଅѺ۽ӥܕ́Ɛхॅ[ᶾᓘӺƾïದ׻یͅߤݵঢŪ෸à৔ؗÙࡅЦMǢۍ੬ɲЉ̺Lπ׺૎הӖƺʠĉ۵խئ́ײȾ়ѷ੽؁ٕĊ΍uţɺǪ϶૱țˋաЋҫۭ ɓυؠȧǺصҿࡗهǰҳN"],encodeOffsets:[[68116,38260]]}},{type:"Feature",id:"VEN",properties:{name:"Venezuela"},geometry:{type:"Polygon",coordinates:["@@yȣӱĭ˜ϡYѭυӥ͆ڙδÆȌ؈ʻ̒§َਸ਼΀řІ̎ˆ̞ןל_մҵ˧ݮQ࣌ĔӖϕٞĻҼʾXɄਨ¼৖\\܉ʛ˼Їڦ×ِЯƆڧѬn͢ȣڕӱó̫˾̷ȽƽԫƉjϱɫɱّ֪Őʁ̭͍ऱ̽׿Žʏȣڛɀثņƿýϔɑ‘֝ŜՉ܆ï°ǭ׷ʅĭΣΉƏسȝNjʱٷÅҧѼʯ࠺ɟ̧̌Ȅюм…ȊʅʠǛ֒à׼Ȉ˰ƲҎ̓Ơӏĩ؁®ͻęסܢӥńઉăȧ̊ȷê‡ǬĴ̶áͺȃȂŅϮѡÈɸӮĺ׶ʔ̸͘ʌɈрդƖ"],encodeOffsets:[[-73043,12059]]}},{type:"Feature",id:"VNM",properties:{name:"Vietnam"},geometry:{type:"Polygon",coordinates:["@@૭ܗ۫ߍȁ׍٠ࢭ޺ળނԱԞګϪ།ŕ๓۫փ१եۇ۫਷ޱ̧ՠʀ֬دӌܬ͸ࢦÔσԚප٨ļ৖ț֖ƶࡀɃצٍאՋ݌ۥ঴৓Ԋʊ̠՞ɘ͙ܺਙPϕކӭڐҊȴڢIࠈĬܒ҄К̿ސƵƃӛАͿࡎɓ"],encodeOffsets:[[110644,22070]]}},{type:"Feature",id:"VUT",properties:{name:"Vanuatu"},geometry:{type:"MultiPolygon",coordinates:[["@@ˣō˭ςŒɤՆӗ"],["@@ƌڱɥŀǩ­ťɴi٢Дʵ"]],encodeOffsets:[[[171874,-16861]],[[171119,-15292]]]}},{type:"Feature",id:"PSE",properties:{name:"West Bank"},geometry:{type:"Polygon",coordinates:["@@@ԣŭʙЃŕ˜ɜɌŚɁĦǬ̤֔ś"],encodeOffsets:[[36399,33172]]}},{type:"Feature",id:"YEM",properties:{name:"Yemen"},geometry:{type:"Polygon",coordinates:["@@؉ɥNjύo˹࠷Οഇϻݩףυ±ʥºӭΑ՗lj۷©ɃµǿɛəÕŻɇеlˍœ׉¨ɓӬzҠƍʜǑتʋΊǚ¤đϨĸNJ™ξςˌđΠɞЮΊɓɬúॺnƸċ߼č͐¨ɂ˫ϺƖ׼ࢦ޸Ϛᝒ͒ڀ൳˞ח"],encodeOffsets:[[54384,17051]]}},{type:"Feature",id:"ZAF",properties:{name:"South Africa"},geometry:{type:"Polygon",coordinates:["@@ǏŧΣяɻћӇ׻ोࢁףԋًϣ࢛͙ѓ«ŇɷԛŰеDž࣫NJԙĹΏ¬ࡿͩܓƃԱͅϡoΣ̚˳fαϒŸśŏɦLӰ˙֞˔ƴs٤ս޼х܈AF׽તДдͪɯƘΫϘÓՈǃҌÖݤіB᷌ɨűӾߙûԟȈ̏׼ĒрϒЊʨȶДЦȚΠķВɽۂ£՞ȜĐʾƨДҚäʨ͂˪֔ݮغஒؤ΂UОƛ˲Ķ҂ċД஁ɔׯƫऩî̟чƶʏÑāʓɯ̿T̃ԆҕӮĜǢώْQȿؑıۥɑϛֵщ","@@νʶϻǟҕ҃͡Տـ٧̜ČƺˎҴƀƜ˜ʴФ̅ʪ"],encodeOffsets:[[32278,-29959],[29674,-29650]]}},{type:"Feature",id:"ZMB",properties:{name:"Zambia"},geometry:{type:"Polygon",coordinates:["@@ІϏɊ܋ƝɩǙڻLjۡ˃̇ʭޭѶɓᢇۗĂׯٍřӍͯĹ̛̅ßܵۓҭխ˳o˗ĬऱĠƯÚOêͧȎկ¶ۋȑչԾ֣یžᦶშYí̂Ű̀ƧЀĪТėʺ̂q¶ʽϾrՖûˬϡڨŝԤˆȌѯ٠ş̴ΧΈҥ٠Që࣠ɱƳח͞ɧƬļࡈƬসȉψʈ՚ɤĶ଀ƚͦđΘɇͰƗՖƗӊʧ"],encodeOffsets:[[33546,-9452]]}},{type:"Feature",id:"ZWE",properties:{name:"Zimbabwe"},geometry:{type:"Polygon",coordinates:["@@ҁČ˱ĵНƜ΁VՙϞٯźʙՒC̒έĞ्ई˃ӢǛƮ͓ڤलğ˘ī˴pҮծܶ۔̜àĺ̆ӎͰَŚÆ̻۬hϴǯǺȻАÓѦˑF੟Ǐ׋—عƊʝħӵŵùɛ؅ࢫ॓"],encodeOffsets:[[31941,-22785]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/xiang_gang_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"8100",properties:{name:"香港",cp:[114.2784,22.3057],childNum:1},geometry:{type:"Polygon",coordinates:["@@™@}ScTʟ@cWuJÁ–]„l¦RLj¼BĄà˜ ŽH@TOHCTDDDHDNAT@PEHDDNJLX@BABALHFF@DKHADBBLDHHFBLEJB@GDBBFBADDB@@KFAFBBJJA@BB@@FFDDADFF@FADDDBJC@AFBD@@DDD@DAA@D@DB@DHHBFJBBFEHDFAN@DGDC@DLCBDDCFDlAFBFCBEF@BC@GDAB@FD@DZJ‚X´HĐMja@Ý`p_PCZ@lLnRGSDMFK|a\\Y}­ƒ§™Mën"],encodeOffsets:[[117078,22678]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/xin_jiang_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"6528",properties:{name:"巴音郭楞蒙古自治州",cp:[88.1653,39.6002],childNum:9},geometry:{type:"Polygon",coordinates:["@@˜@ÈÒĊanwŎV„™Ȯ¦ͪŃĢ„ÜōȂçČéƐżLɆóĊ‚ĊaʊŁ±¯²Um»ˌmÈ»V™ʠţWÑůǓ郙ôƑƒğÆīŎī@Ƿ™wô™˺LÞ¯ƨVǪуšĢ™ȘV°wĢŽôk°¯ƒ»΀@Ȃ»ĸŽǔ@΀ƒ͔ôôLɆó̐ÝɜLɲōͪƒƨóŤK@ī@IU܃ÛmȻţǩÝ˹ÛljťǓǫō@Ɲ²¯VçōKͿŁΗÇţ»ƽ™ɅƑLÓŏÅÅɱV@ÝĊU¯ÑĊĭÞLšÞŎJ±̃XȣˌōlƒUÈ¯ŎKÆƅ°™XÑܱnŗġV¯™óaUƒƧUōŁ„Ñ™±„çɲ¥lĉkğ°ƒk¥˜ƒnğţL¯ÝÝUƽĬ΁lķ°@„ō„XÿݯV»ŹLʉÞɱŤĉó°ÝJ™¦ÝKÝ£ţܙÈĉ@ƒxǩUċƑ@ky͓¹™`U²ĉVġ»ğa¯¥ť@ĉ™‚ó@ŻÛÛJƒw¯nó¯ġWƽʩķÝɛwĉĕݼȭÞķō@ó£Å΀ƑŽ¯ôȯÞ¯Ȱ™ÆōèĉXǼó@ݚnºƒĸ„ÞVƜĸȚUʶõˀĵĖɱŎÝĖVࢰӒѢ°˘nϚVˌ™ÈmɼĵŦW¤öʊõʔ@°ÈXVŽ™ènŎȁb¯ǫĉ„±Èğ`ġwōÔğ»mVVŽ„Ý¥ó@™ĸķô@ššbX„ĶmV²²`Þ_˜˜ɴbͪÈ°„ÞWĸÈŌmބškɲŽÈUÆ»n¼ǬVķĸźô¯°n¦ɄǜÈ"],encodeOffsets:[[86986,44534]]}},{type:"Feature",id:"6532",properties:{name:"和田地区",cp:[81.167,36.9855],childNum:8},geometry:{type:"Polygon",coordinates:["@@ƨ¥šèź٨ΘƑᩄbUࢯÞĕɲōĶĕöʿVʵķșUƛƒÝ„ķm¹Þ™ô@È»ĊWŎçšÅ°ȯȰÝ°óƒÆͿĉ»̽çnƒmɱĵƧºóU™™ƽ@±wóL¯°̻L±Æ¯Vƴķb¯VÇ¥ğ²Ǖbk¥ÇKlÅɱġ@у™óK@™ÇaÝXğţxĉČǫķê¯K@уaŹ„ƑKƒ¼¯Vóaónġw™óÞéU™ġbóĉğÇl¹™aUóğKW„Vůn›ÇŋƑ›ķnʇ»óxĉw™çÇ°Åw™°ċ„XŽ™„ób±ƒkÈÇJ—ƒm²ţx@ÒݎšŦǺn„ó¼n°ÇbUÒ±¼XĸĠłƽXmwĉºƒzÈÜmnxmx²ĖmҚbnŽƧêUºĊêÆVóĖóUĉ¼ÅĬƑ°ɆƆŻŚlłÞLš¼nĠƒ¼@ޙšÞź@ŎÞ°VšɄɴжϼِ͈Ŏ„"],encodeOffsets:[[81293,39764]]}},{type:"Feature",id:"6522",properties:{name:"哈密地区",cp:[93.7793,42.9236],childNum:3},geometry:{type:"Polygon",coordinates:["@@WnŐÆĶLĢ¦ţºź„lxÅĸƽŚ‚Ʉ—Į˜è@ô²ÞUĔƐńV°¯ĸX¦Ɛm̐bƒ»Ɇa΀šĢ™ƐLˤ™ȘÑnƒІljĸÿn¯ĶaŎ¯ĢĕȘ¯°΂œla¯¥™ǕǔwˤӱlťО̻nŻmɃĕċţUw°WUóƨÅţķ°ýV±óÅǓéʉ¯ƽŁƒéōǖȁÝƏůǕw˹ǫȗǓƧǕVý™é@ĬţLƧôͩ„ɱŎɛK̏ÞɅôóK@²@°ōؚ¼lŦ¯ŰóƜÛlV¼ķ¼ƒ°kȰ™Ű„ĠƒǬ™ŚÝŎmĖ`@ÇÜn„"],encodeOffsets:[[93387,44539]]}},{type:"Feature",id:"6529",properties:{name:"阿克苏地区",cp:[82.9797,41.0229],childNum:10},geometry:{type:"Polygon",coordinates:["@@VƚxˌŎÞŎƒ°n„ȂÒ°²VĊ¯VğƾˍǬƨÞÞKÈÞĊVźôɆÞĢèŌôWČ²ŤVÞĸʶbl‚¯ôn_VÆĸlmÞnVź_ĸ¼Ȯmǖ„šéĸW°°„ĸJ„kʠ¼Æw°¤ÈƒlxɆzČºĶI²ÆǔUš°ô@Þ¦‚ƒUnUĠ¼ŎÓĢxĠ_²ÇĊƒǬ°ŽȂamōšçUÇW@¯öʓõʉX£ĶťnɻšÇUˋmϙ¯˗ӑѡᩃaΗƒœɜ°xWƴUxɃÒˣ¤Ʌwğ„ʉōóÝŹ±°ȗ@¯„ƃ²¼","@@ō™гwȁ¥Ƨ°ŹÑķV™¼ÞêĊ»‚lĵšm¦ÅW@ĀôÈźaɜxÈbÞÆĶIОŘnIÇŃÛÝĊÑĠƏ"],encodeOffsets:[[80022,41294],[83914,41474]]}},{type:"Feature",id:"6543",properties:{name:"阿勒泰地区",cp:[88.2971,47.0929],childNum:7},geometry:{type:"Polygon",coordinates:["@@ɲˣĊIÈ¥‚ÅU±Ċýkō°ƒĉƽó»ĶƽXóʵʵ™ȯƑÅȁɅ¯ĉ@ÇሗK֛@@ˤV֜ʵрƒǬVĸƑŎ@ƆϯÑóŽķ@ʇ»ķ¦έmlÈĸĊX¼WźÛÞÝѸ‚ĢČþ„ĀĊôάVö¼ĊUƨ°°èŎČUÜƐóôVôôŽ²êȘlˌç°`n²ǬŽĊaš™ƒÛ°±kğmm»š@°ÝɆÛÅÇVaݍVm͔ğôÝÈb‚„@„ƒ™n¯š™ÜUĢÑĊ@źīżWŤÈǖWôŁÆI²ÓƨL@ŽĊX„mmÑÆ»ȰÑkƒĶō@ý°m—¯"],encodeOffsets:[[92656,48460]]}},{type:"Feature",id:"6531",properties:{name:"喀什地区",cp:[77.168,37.8534],childNum:13},geometry:{type:"Polygon",coordinates:["@@Č@°ƒĠ„ôÓô@Ŏĉ@Ƴĸ@Ť£ĢlVôWVóřXĉŤêÞ@ƐÒĢÑlèÈV@šĠIk°ÆŘ@ÈÈĀ@ǶťÒğ@š„@ÒĉlŻ_@šƧĖÅĬōÆ@bźÞnƒƒlVœÝĬšWƼʇ„ƒÝÅ@ÇÅÈwWóĉ±ğz‚ĬČƨƂÝIĉݯbÇÑĉƒ¯ʈV°xUŰĊ¤ƪ_ôÓɚI@lȚXȮ™ŎlɴȘ՘š„¦ɲÆʈ_ɴŽźŽôÞʊŎĠƒɆxˤ£ɄÑVwXƳ¯w›ɛŹ٧™çƧ¦ōƒُ͇еϻɃɳU™Ý¯@ōÝŹš™@݄»mğ™»ÝKkŁżřɅƅƒ¯ÆīĊ»ôVôĕÅUĉéV¹ƨém™anѱĕnwmwnÇۄyĉ¹ŹlŏkĵèķmōÞġKñÔċKÅèĉzƒŽ„ômxȗÿƿI@þÅČÝKÝ°@¼ÈVºš@ÅĢšÆUċłn„ÝÆǕČĵJm£ÝJ¦@ĊƒxV°ƏLċ¼ǩ™@™m@ÅĢómÇÆğ¹Çš™ÆšĖÞKšx„wô¦ÆÑÆL²ÆƾŽU„Ž±ŚÅŻĖ@ĬŤÈñ„@ǔÇx„Èǃ","@@VÇ™ţ°ğUĠ¯mk¯ó¥ķIġÿƏbƒ„ĉa±ÒĸĀlKU„_m»nwšŽ„m@ÈŤ¦ĉbÞ°±Þżł̦°ĢŁVé"],encodeOffsets:[[76624,39196],[81507,40877]]}},{type:"Feature",id:"6542",properties:{name:"塔城地区",cp:[86.6272,45.8514],childNum:7},geometry:{type:"Polygon",coordinates:["@@ήnĸ¥ʈ¼ĸ@ôϰÒ@ƅƒōUķƑǫʶпU֛܃LګK@΋ĸ@Æ£ÞġÅĠċšLV݄»™@Å»Ýnm¯š»nŻĊ@nķŃ@¯ómóÛÝǟ¯aÝóȭ¥ƒšōUmxĉbÇї@›bUº¯X¯ÆƧbVÒĉnǕw¯°ƑŽV„—ŽÇ@kx±Uƒšɱn™ŽÅKƒ„¯ƒĠǠU°ɜL@°ƒxnĬ‚ĀŋŎÇLƒŽğšϱÞέƜkôÅĀǕłƒĸĊŤUŰĢ°„¦ȂϰÜɨ°x@°żǠÆƈČVĠ»ČL°ÇšbĊÑ̐óÞlĶwބɆVÞwǬxǪţȼÜLŐĶˢ@","@@óKĵĀV͈ĉłƾNJÆŤƒzXl°ƒÆL²¼źŽôÈĢǔ™¦l„ô°ɜÞʊĠğŃm»ʵƳƑʝȗīV¥¯ĉ°Ñ@ŃÅI™»ĉmğn™ƒašƒċƨbš™Vğ—w›ġ¯@Uōa™ĉÝJğÑÆŎkŎÞĀlźƒ¦"],encodeOffsets:[[87593,48184],[86884,45760]]}},{type:"Feature",id:"6523",properties:{name:"昌吉回族自治州",cp:[89.6814,44.4507],childNum:7},geometry:{type:"MultiPolygon",coordinates:[["@@መL@È°ĊȂɆƒÆĊ£„ťôWÓɆbĢÅŎƒÆ¦ČÑW¥°ķU¯ƏŃVē±Ý@ó—ç˜ĭɃƾřÆķkwŹƒŤ¹ġ¥ĵKŏÅXmˍщwǓ¤Ƒ@wóōVķ£ɱšġôÛa±Òȁ„óèţIVŽƽ¼k¤ó¹ġJmx—»ÝUƒ²™@ÅƃĸǫŎ„ĊmŎǬ՘"],["@@Þô°bÞǠôÜôn@°ĸń˜Ƕkłƒ¼UޙKğȂÆÝĢŤķ@@ΌڬL܄K@ˣȂ˭lĉńW¥ĵVÆý@ŃÞēUŃȗƅ@ŹƩǕĉ»k»Ç™VğóřX™ŻKƏŽċêȁèÛŎġƒͩń"]],encodeOffsets:[[[90113,46080]],[[87638,44579]]]}},{type:"Feature",id:"6530",properties:{name:"克孜勒苏柯尔克孜自治州",cp:[74.6301,39.5233],childNum:4},geometry:{type:"Polygon",coordinates:["@@ˎǫĠƽ°UUĉ¯±ȁÑmƒ„¯Ýōˋō™wUű»ÅƑ°ƒȘ@²¯ɳʇ`ɱŃ¥՗™ɳȗōkȭšșW@kəJóÔƩ`ĉ£Vů¯wU°ʇĊ„ÈÒ°aĊÞÞJŁċƧīĠyĊ²XôÇxÈÆÆ@„ÞʈƒÅ»™XÞīU›Ƒkm„ŹÝ@aŎÅÆīƨĕ@™ż`Ċk@љƒĠ@ŦÑ@ǵÇÿ@ÇÅŗl¯ğJ@™ÇUkçġÒƏÑÝ@ţéWĊôŚUŽóXUġkţ¤ķ@@ƴōĊó@óÔğƒ¯„ċ@@Қ¤kôˣŰ͓„k»ƒKX¯ċwƧôğɐšÒôIVƙš¯UķǬķšnŽ™¼ôb°ÒȰVVÈÞ°ƒĸó¤V¼°„V°²êƒlĢ҂Uƨ¦ôȰƴĊVV¼ǖIċĊ„ÞɜéšnČW˸Ǹša„řÈw±īšçĸ¤ĊšôšwšŽĸUĢ¦˜éǖĬ„Āô¼lÞkÒ°x°ƆÞx„šÆV²ǔ»„b°wގȘ¥°n„šŎV@°„„ʠè‚ŰȂb"],encodeOffsets:[[80269,42396]]}},{type:"Feature",id:"6521",properties:{name:"吐鲁番地区",cp:[89.6375,42.4127],childNum:3},geometry:{type:"Polygon",coordinates:["@@ôK„ĉǪa²¼lÜô@ʠê°Ĭ™ôȂƒ²ÑÜbĢóɲ™ĸ¤ŎUô@xƒŽǔ£ъxˎmƒÈÛ@‚_nĕÞōšř„ǫƒğšůlȯ„¯ĸ»U»Ükôƛ°ůkť™»Ŏŗ@¯@±͓óͿ„Ǔ@ķȁ¼Ϳ@Ƒ¼¯°ólġ¯xȗUġšƑ™ǩÒƧUÝ°˹Kóššx@ǸōĬÅĬƑĠ󃄚ǔêÆ°XÒʟŤUšÇ¼ˋnn¼±V²°ȂUŌݜbʟǔɅô@żǬaҎÈ"],encodeOffsets:[[90248,44371]]}},{type:"Feature",id:"6540",properties:{name:"伊犁哈萨克自治州",cp:[82.5513,43.5498],childNum:10},geometry:{type:"MultiPolygon",coordinates:[["@@ĉ„ÆŘȁ̐mÞ¯ĀX°±¼@ƾ¯ƴ°ŎÝþŋ¦WÜÞbȂĉźUœÇmwVUȂóô@ȰÝ΀nÆJn™ƾ™ʠ™ŌLČóǪ¯œ¥ǔaǖšŌaôÝĢLšx„ƒÆLšɲm„™²VlwÈ@˜Uƒƒ°¯ǖxĊmUÑƨa°Å°WV¹œa›ÇɃÈm¥°¯ŹóĸķǫUm»Å¼ÇVɱ™l݃ŋnķÇÝX¯ƒͩÇɳa——Ý`±_U±ĵnWƒ™a@™ĸóšķ™¯ǓV±ÅĵJċ¹ɅykwDŽ¯£Åxʟ»ƒlķI¯ƒX¯ķ‚™êǕƒȭnķ»Ź`±„kÞ@Žš„Ýô@Þ°xšŤŎIƨÆUxōš¯²ǔĬǬlUŚ"],["@@ÞĀlźƒ¦¯ĸŤKޙšƒċƨbš™Vğ—w›ġ¯@ţƽJ"]],encodeOffsets:[[[82722,44337]],[[86817,45456]]]}},{type:"Feature",id:"6527",properties:{name:"博尔塔拉蒙古自治州",cp:[81.8481,44.6979],childNum:3},geometry:{type:"Polygon",coordinates:["@@ήƛϲÝĠ™„ÈKŌōÿmī„w@¯ɛKV¯ğǟ°Ƒ™wġKóÞŋbǕ™Ǔb›¦ǩ°ċôŋKʟšƽšmšÅImŽͿŽȯÞó@ȁôUVnx›ÈŹVȁĊÝabŻ£¯°l„óxȂŤĸkĊšÞyĊêĊmĢxV„ƨÈŽĠX„ŽΘÆĠÔź‚Ɇţ°LXƾŤŤb"],encodeOffsets:[[84555,46311]]}},{type:"Feature",id:"6501",properties:{name:"乌鲁木齐市",cp:[87.9236,43.5883],childNum:4},geometry:{type:"Polygon",coordinates:["@@šŽWŽôŚUĠȚl¼Ċ¼ƪǖ@źȘƆ@ýlܚXVŘޙš¦V¼kĖó҃èkĊȁˮ֜@ǫ՗nōƒĉǬō„ķÆŚ@„±ÞV˜¼nwĢIôºl£ƾ»UŤJôçšó¯īʟéó@kÛ±»ǩbƒĊóLҍÇǫb@ŻɆóʠǓ›aŋÞȁVʉłĉbĉɅô"],encodeOffsets:[[88887,44146]]}},{type:"Feature",id:"6502",properties:{name:"克拉玛依市",cp:[85.2869,45.5054],childNum:2},geometry:{type:"MultiPolygon",coordinates:[["@@ɜÞʊĊýVaŃm»ʵƳƑʝȗīV¥¯ĉ°Ñ@ŃÅI™»ĉmğn™ƒaݚţL°ķóKĵĀV͈ĉłƾNJÆŤƒzXl°ƒÆL²¼źŽôÈĢǔ™¦l„ô°"],["@@ƾIŤ@UUwōa™ĉÝJğÑÆŎkŎ"]],encodeOffsets:[[[87424,47245]],[[86817,45456]]]}},{type:"Feature",id:"659002",properties:{name:"阿拉尔市",cp:[81.2769,40.6549],childNum:1},geometry:{type:"Polygon",coordinates:["@@nIÇŃÛÝĊÑĠƏō™гwȁ¥Ƨ°ŹÑķV™¼ÞêĊ»‚lĵšm¦ÅW@ĀôÈźaɜxÈbÞÆĶIОŘ"],encodeOffsets:[[83824,41929]]}},{type:"Feature",id:"659003",properties:{name:"图木舒克市",cp:[79.1345,39.8749],childNum:1},geometry:{type:"Polygon",coordinates:["@@VéVÇ™ţ°ğUĠ¯mk¯ó¥ķIġÿƏbƒ„ĉa±ÒĸĀlKU„_m»nwšŽ„m@ÈŤ¦ĉbÞ°±Þżł̦°ĢŁ"],encodeOffsets:[[81496,40962]]}},{type:"Feature",id:"659004",properties:{name:"五家渠市",cp:[87.5391,44.3024],childNum:1},geometry:{type:"Polygon",coordinates:["@@„çôÑlĕU»™¥ÝšUŗ™WkÛ@þVńÝĔ@ńÅþĶUX¦Æƒ"],encodeOffsets:[[89674,45636]]}},{type:"Feature",id:"659001",properties:{name:"石河子市",cp:[86.0229,44.2914],childNum:1},geometry:{type:"Polygon",coordinates:["@@lŁ—ǵm‚ĉ@mż™¼n°ÞmƼš@"],encodeOffsets:[[88178,45529]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/xi_zang_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"5424",properties:{name:"那曲地区",cp:[88.1982,33.3215],childNum:10},geometry:{type:"Polygon",coordinates:["@@ƨʔĸbܺÞwnxźbÞ°ô@„ĶŽĸIȼĊJŎÈôUšÝƒ¤ǔLސŎ@ĢŽȘblƒôL„ÇźçȤôLš¥ÞIÞ¯Ķxʊťƨ™ƿÑĉXVķŦ¯ȂKÇǕšÑ¯IUš£¯Óƿ£VĕōÞÿÆwƒƑ„£ǖxÞĕ±ÇÝaUÑȃU¯‚UōÈ݃wWŁĵ™±Ý„óĢÿ°IÞ±mÅĢ¯mÿ„¥°UnÑŤĢĕĶwǬŻͪwŎ¼źÇĢ„ĠĕˎŁ°óƨ¼Èa‚m@¥°wǔ„ǖ°ŽƨÇŤœšġƨ„ŎŃôbÈÛŎĊ°@Ġw²ÑÞJƃÆb²ƒ°êĊUނlȲƒV„ÈKĊÒĸĉ›»ÅôťUÅǃk¯@ǂÑklǁÅl™Ģ™VÑóƒ@°@„ÛĸƒV¯ƒÇĊ™n¯Uĕšƽ¯m›¯b™È@Ò°Ĭƒbĵ›¼„‚kxķýÇJk£ÝaUÑÅóĶǟkÓʉnĉƒÝ¼Ƒ„ó»Þmn£m™Č¯@ƒȮÿV¯ĸƒ™k@Ýówƒ»ğ„ġ±ǓLō„ƒšV¼Əèķĉ™è±b@Òţ„UÑóakƒl£™Ó@¯L@™ÇlUóȁš¯aġÈÅĕÝLķ¯Ė¯@WĬ—x‚ÒÈnW°ţôU²ǓÓġ²V°¯ôƒǔÝL—ċšk™š»Ý»Ýš¯ÞƒVƒwۄÝÇōͩÈĉċ»ĉm¯£W¥ţKkóġƏW@¯±kōŽÈ›b@җšÇaƒÆ¯a™„ƒkóŽÛƒÇ¦Ýa¯šÝ™ĉ@ǻۄmƒǓxķƛ¯lVĀÅÞġb™™ÇJUÅV™ĖƑW™zō»ōšƒW™n@è¯ÞóVkwƩnkźÇބҙޯƒƒýğÇUxÆÈnè±bĉÝ»ÈуwšwÞ@m»ÈV@ýÇ°ķ™xƒa„ݯXċ¥ƒÈóW@ôkxlnxVÈóĊkŤġ¼@°¯ŰƑL̻۱ŎÝV—Þ›VƒÇÞŎÇakƞ‚š@èğŎĸżšƾ°ÒšLÞôĠKȰĖźVÈÒĠ„¤™VôšŽU„ÈþťL@ôǬÞlÜÈnÇÒUŚ™@šĊƨW°™°Xƒ‚@ČÇþ„ƴĉÒķ¦@ŽĢôWĀôłUÞĢǬ™ź°¼š@ƒôV°„bUÆnzm¤ƽĸƒÈ"],encodeOffsets:[[88133,36721]]}},{type:"Feature",id:"5425",properties:{name:"阿里地区",cp:[82.3645,32.7667],childNum:7},geometry:{type:"Polygon",coordinates:["@@„Çƾķn£myVŃaU¯„ó™@¯»šŹġǫVÝóŁXÿġó@ĸ¥ĊуƳÈý@ċ„Wš¯X¯ĉƧ‚™š@VřÈÑÇmkÛǫÝ@óŦKÇýVƒ™U󚏃£ğÇÑŹUȯĕğLÝó™K¯Ñ™ƽķŻĠō@灙lƝÈbƍÈ݂„œU˜ÝÞU²ō̼ůƒK°ů@¯UK±—ĊƧbōÇmçÈġƒóšÅób™™źóš¥kīƯól™ç™KôĵUƒÅ„VŃķ¥nÅŏm¯¹Å‚™»@ÑǍóxÝkʇȤU¤ķb@ƒ¯ĊÇx¯ĸĉKm°šĀk¦l„„KnĬȀƾÛ¦WÆŐmNJĉ°ōUţ¤UšŎ°šŎKÞłÆ„Ǔ¦ƒÞ™‚™„ř¯bmUÝl¯Um™ğl¯£șwŎǫaÝnĉĶƒk@¯™K™šō»ĉn™aÞ»ťnkml™ĸ¥UŚŻkÑťƒĉV™ôó°LôīĠU„ÿĉǕÅz±Kƒ¤„²ō¤¯Ė¯UÝ¥Vĵ™óÈťÝwķșÑk¤ó„™ƒWýĵĕ™„VĠƒV󍃎Ǔ„ķ°k±VU±ţ¦UǟÝřJVљ¥XUċUŎlÛƆǕÆȗƆ¯wŏÞÅ@™šĉl݁óŽƒÒ™nUôńlxólÝôێ±™™LÛôÝL@‚ġ¯X¯ÇUżóa󤛼XÒġŎóLk¦‚ôżĸĠ™¼™KġƆô¦„ÆƑÔĉĶ¯ImÒ°¦n°¯Þl˜ÝČn„ƒÒšKĠޚĕkƒlýƾťœšôI‚ĖŤÒnƜm¼¯lnżóÞ@Ůó¦™ôƽĖċŚn°Ý°ôÈUƜƒblÞóŽ@Žǖô°UÈƆ°X„þôŽô‚lѢšŽ²Ėm¦°š@¤™XŽĊblܚzkºƒĖmX„šŎWVšóÞn°lĠxȚa°»żLźƒ„b@Æ°XĠÝȚxĊĕŤaȚ‚°È@„„@èŤ¦Ü¼œW˜ÞkŽÈ@V°lŤkŎ±²¦ƐUšlj°aÈÑŎbĢƒŎbÆ¥ÞIȘlššôVÈU‚™šb„kɲĶn„mnXb̼òƾĖŎ@ĢȂÑôÓĠĖʊšĊÔ"],encodeOffsets:[[88133,36721]]}},{type:"Feature",id:"5423",properties:{name:"日喀则地区",cp:[86.2427,29.5093],childNum:18},geometry:{type:"Polygon",coordinates:["@@ĶĖXþš„ôƒl£šÒĸÇÞxÇŦšôUĶÞ¦°V°ĕŎ£ƒ±„£²LÆyĊǖƒĀğVóĬ¯KóôUš‚ĊŦ„lҙżVÆķ¦kšlnŦmݼšbĊmŎ¼š™šL@°„lĊĵÞmǬbƍȚx°¤Ġknš°VÞkVn°aƒŚš‚š„Ýǔ¥ÅƒÝŁōL¯™ōV™Ť£ŎVĊ¯nljƏXÅÜ¥ǿƽmīƒLkƒl¥™ÿn¯ĊL°ķÈw°ĉ@ƑĸaV£ʈȣÞlôwȎ@Қ¼Æ°ºŐnmÆĸ¦UńƃV„óĶšLšèôkÅ°lĬ™¦Źôššôa™Æ„ôÇĢnèŎÈƨa˜ĉ²‚VLĢ»lţôĉUǂwkmlw@óôX„ÇȦ°WƒÞ„b‚wĸšÈ¯@þÇUn¼Ý@™x„xÇńÞ¼ĊŽ²amçÅÇVwĠȄþ°„šÝƒÑÈÝlŹƪmlxôU°Ý@çšm„XŎ™Ŏ¼šyƒXšĕÆUVÈIššĢaÆÝUÿ°kĸƜǔwn„܃ȼĊ@ޚ°™Þbȥ܄ô„lšƒ°b„ÅÈb˜™@ќa‚ǯUU¯Vġš»ƒ™¯aV¯Ç°Å™mnÑŤçǬVǬ™±ĉ¯¥Vĕ¯Ýk£˜ō—w@±ġÛ°ÇVїƒ@ۘa@ČL™Ƴ™„ƒÇa¯¤ÝIĵ¼U¥ƿōķÅţŻókÝóĕ‚¥¯™U»Æ£X¯ġŃÛkÝ°V°ó¼¯èWôÞĖ„ȎƒŽkĀƧĀówm¥¯JŹÝJݙōVVŁaݐƑ@ƒ˜ğŭǂ¯_ƒ˜ĵ—›VnxŃón›ƒĵxÇĖĉVÝÈğV™Ò󃯐±Żĉ£ķÆÅL™Ljĉý˜ţۃ¯VƒnV¤ÝÈ@°ÅÞݤ™ŰğŁm¦ÝxóKƒ¥ɱÈUĠôêVôÛ¼ÇWÝçĵaō¦óĖƧlÇĢƑŽnŎDŽV¼¼‚ºÛ@m¦ƽ„ĉmm¯ÝKÛç¯bŏłĬ™bƒ¼ÅLmŽ„xť°ÅU™šÝXkŽÝmĉ¦W„¯K„ÒknÝaV„Ýè¯KɅńÝKnÞ¯¼"],encodeOffsets:[[84117,30927]]}},{type:"Feature",id:"5426",properties:{name:"林芝地区",cp:[95.4602,29.1138],childNum:7},geometry:{type:"Polygon",coordinates:["@@‚VÈłVôÈk@š°K@ŽšÔk¤l„ôbVÒŤƒ@ѲašçĸĊƐçU»„™ŎƒǔKĢ²Ġƒ„¼ôx@ޚlƨĬ„Ul¯ÈLV‚šÞJ„°Ünʊ„wÜbXê‚VÞ¯°ššanaU°wƼɴÑWÑ°mÈýÈam¥Þ£Ť@„¥ôblÞĢ„ź¥ôxÈÅmݚ™ƒĕŃV»ĉōŤōnóƒ»ÈīķIUƒĠÑ°ġĸLÞ¯VÒƂ@Ābš¼WôÈ@V¼ôóŤKÈÑU»šwVǫżnWÒÈx™¼‚lŦ£ĊōŤx²¯@ƒÆƒU¯šçÆ@„¤°£„é°k°lšůÈó@¯ŤÇÈĉƒkkÿó¥ÝXķљÜ@ÒóŚÝ¯°ĉówÇ±¦ÅJUÒĉĀķw¯°mĖ¯„±akxÝÅnƒ™»lуK@¯lU™¯UVѯóĊ¯mōğVǓƅƒÞƒWÝÈÛ@ƿô¯ÜġzÅþ¯ólmôʇġĊÅUͿřŏȁˋŁóÇˡōƧƒÇb™w°Ķôk¦šÒƒnUþġҙÔkǔķèó@ƒ²@ŘōńĵyƒzġaݤÅIƒ¤Ƀť¦ğѯ¤ķbóš¯ó±ŽU²°¤ČÜVnÈƂ„ŚŎ°ôĢ„þÆzèVĀǎĀǘƒXŹÑ¯¤ówċķk¦šłUÒġzÇ@ƒ™ÆÝx@²Þ@Ƥ„Uô¦Uš°x„U"],encodeOffsets:[[94737,30809]]}},{type:"Feature",id:"5421",properties:{name:"昌都地区",cp:[97.0203,30.7068],childNum:11},geometry:{type:"Polygon",coordinates:["@@™ŽVĖm°ĉš„ÈU°ķ„ƒÜ¯@@ô„UÒġškš‚ÆkÈlŽÒ@Èl°È„VÆóŦƂœ¼‚a„ÅĢ™Ʉwnōw@¥Ŏ¦°ŹÞmVš°wnÿƒw„wÝw@¯šmÞŗ°wĠ˜ĸkÞğlĔ²¦°@„ĕĸwVóšal@nĢÇĊn°@¦šŽźUXçǔůĸVš™ÆK„ÈÝĠš²ÅĔô@lšŽÈ_m˜„zǖl„šaU¼ôwV°¯¦‚ĬÈa„l@Čǎ„¼™„nŽ˜I„xô»ɜ@ƨ¥ɆŁ„ŃǪȁkƛƨȍʊȡóĭ›@—ÈÇVƒůރĸƅmēƨť™ÅÈʉVǵ°ġVŭÅɧ°ÿnɛš£mƒķ²ŃóÑUĉ°mÇ»¯@mxUĀ¯èţ°ȁÝç„ġU¯ÆÇţÈ@°Çô™Ű¯k¯lƒê¯¤ƒ£Å@™èV°Å„@„±°ţwĉŎť¤kš»ÇwXÑŻmUǬ™xV¼ÇÒţLóôU»Ç@X󙻂a@ÿŁUÑÝ°ķK¯ĢğÒV„ĸJÇĬ„¼môţŎĊŎU¼Æ„„Ė™šnÞÇÆówŹ¦ġƒkÝóaƒ¦ţ@ݤn¦ÇbÇþ¯nXÒɳÒÅ»¯xVmb™b¯™Ý°UWéÛaƒxʉÛmƒ¯ÝI™‚UÇKk°ƒVƧīķ„U°ȭĀ@„ċ°nšm¤Ýnô¼ƒƒÞ»Ċ„ʊmlÔĵǠÆôVÒÞbl¤ÈIĸþlwƒœ»ĶŽ„a¯ī@њǰanœƾ°"],encodeOffsets:[[97302,31917]]}},{type:"Feature",id:"5422",properties:{name:"山南地区",cp:[92.2083,28.3392],childNum:12},geometry:{type:"Polygon",coordinates:["@@°ÞUĖ°¦²ĊôÇÜLǖĀɜŽȘŰÞLĸźêÞ@UÜUŤ°ɞ¯Ü„°WŦĀmŎ„¦ĢyVљŁl¥Čĸôx°£źÒ„Wȗ‚ÿȍUÿ‚çÅyƒýóġō¯ƒřŁmÇÛUċŽ¯£V±²°ôô™ĸa°£ĠÒŦ¥ɄŽ„£ÆJÞ£Ģb„yĶzŎŃ@ŗ„±ô@ĸçlǓšÓĢÑVý„m™Ñl¥ĵó‚¯̻̥™ƛǫÝһÇƧĉyţ¼ҍēVĶĉŎ°ĸmšÞVÝĸ™ÒÛaċ„ó™ŹĖƒèÈÈl¼k¤ÝX@`ސŏ¼Æō¼ÇçĉKUÝÝ£ğ¤@¦ġl¯Òġĉ¯óš™móxÝÞğVšƴċK@—b@ܘ„UÒ¯ÈĢÜ@²˜x—Ŏl¤"],encodeOffsets:[[92363,29672]]}},{type:"Feature",id:"5401",properties:{name:"拉萨市",cp:[91.1865,30.1465],childNum:8},geometry:{type:"Polygon",coordinates:["@@Ŏ²l@°‚XĢƐlôŤLX¦°¤ĊnČ¼ÇĊŎͪÞÈ܃„x„U°Ýޙ޼™¼lšČ™˜ŽÞK„Ǔ°óU¯Ģ±ǔÔV±ŤóX¯ÇmÑ˜wXī°@°ĕĸÞKÆĖĢÇ°bȂ™ÇŁUƒV¯wV™ó¥ƒVÅ£Ý@@±ÞwšÅ‚„È@ƒ¥nōťÿ¯Xۃɝ°ţ¯ÛVVÝ@ŹéķÝKȗůɛǕÿÛKóÈǫšǫUţèmҚn¯Æ°ÈU‚°b„š™¼UĢV°°V"],encodeOffsets:[[92059,30696]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/yun_nan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"5308",properties:{name:"普洱市",cp:[100.7446,23.4229],childNum:10},geometry:{type:"Polygon",coordinates:["@@U‚ô²‚a@Ž²²Ķ¥œV°šĶ²bl¤kVxl‚@œ°‚Ś²@˜„„y„@ô¦¯„@xƒxVxU„VššbVšÜm¼Ŏ„„ĢmºXXWÆ@ĀœšmŽmXU°ÅÒm¼Þx°w„@°‚XêĠ°»nV°U„l@k„@V±ôī@£‚ƒČŃÆ£„KÞý@¥‚k@y„a@—nWV„UVƒšwƒmƒ£Jƒknm@wmkn‚X„˜šX„¥mUUlUnbš¯°ŽnkƒVInlIUw°n™mk@@mlanXlanmšk@wVWUw™_@éĠašnmUaÜ£ƒmXƒ¥¯@@„óUmݯ¯ÞÝlKnxô£š»„»Ġ„J°aV„UÝÿV¥ÛbƒI@wmŽón¯yÛL@ƒWkŎmș`IWa¯K@¯mUnmaXm™bmak„¯ŽƒĢ™ÒÝm¯mV¯KÇb¯KۜWW™X@a™V™knċLUWV™kXóW@k™a@ƒób¯Uƒwmb¥UUlaU¥U£maķšƒKXkƒmÝ@kwmѯk±ċbUUVakaġ¦ƒƒkL@`ƒœ™a¯xƒm™Åƒ™LUWƒ@ċnŎUV°LkL@b°°@¤š²ƒ‚šnôôk„l°kè›ÒÈzV¤È„WôôƒnV@„ƒ¦@¼Ux"],encodeOffsets:[[101903,23637]]}},{type:"Feature",id:"5325",properties:{name:"红河哈尼族彝族自治州",cp:[103.0408,23.6041],childNum:13},geometry:{type:"Polygon",coordinates:["@@°°nÞôV@ƒ°@„¦WŽ„nÛ¤Vbmn™ğb@êš`VxUX@xš„ƏÞUnn˜WÞĸĢƒšÈ@ŽÇè@zÛÜWšÅêlš²„˜KnV¯ĖĊx@bk@@„°JÆ£Èbl„nnm°nlUkVUUwVm„Kn„‚nVŽÞxVLX¥laX@@xl@VzȎVmšk@b°šÈĸmŽV¦`W„XšƒbUb‚bX¼°x@ašVVkn@lþnXUlVxŤÅ„y‚IUƒka‚IŎĊ@lXx@b„z@‚ô„ƒ¥„_V@l‚n@„ôy@al_l`nmƒÈ»@kƒmXwWK™U¯»™a™Å@wƒmUÝKUa™UUƒ™wWƒ@w²»@kƃV£—mm£VKkÑV@@»nwƒ¥™ƒ@kƙnllIVlnLVakalknJšWmnaUaVÑVVލn¥m@ƒ„¯Uÿl™@™™™VçƒaXaV¯UyVLVkš@nJlšXLlŽkxlbla²Òl@nVJVkšx„KlkUaVķÝÑU@Åm¯@±™Uó°ğńķĠmU™Ñ@ǯ¯Å¼@nml@°¯¯`@w™£@¯Çƒk@ƒ»nmċ¯U»™I™Ž¯LÇĶÛn@bó°™U›šwmŽ¯„™Umǯa„™ƒ™ƒI@ykIƒVUŽ¯bƒIğŽƒ¼™¼ó¤mwkLÝÞ"],encodeOffsets:[[104243,23429]]}},{type:"Feature",id:"5326",properties:{name:"文山壮族苗族自治州",cp:[104.8865,23.5712],childNum:8},geometry:{type:"Polygon",coordinates:["@@šwô„š@²¯maUmôUÆxš@Xš˜bÞInlVUVw„JVaU„K°¥„xmÞXnlKlnna°@ĊČ„ÆwUmnkl@°ƒƒ£nyn@VV@Vak™ƒ@@kÞ݄bmx°Vnw°klÞInĖÞVlKl™@Xa°„„KlV„U@šJnx‚U@ÈĢbUKlm@ak_‚wšanWUk°ƒl»„k@Wk@lwU_ƒ@UalóU¥ƒÇnƒ™kJWƒ@mVXx±bƒK@nV±a@™Åa™£ÝK²ƒWknamKknǏk¯ƒaV™™V¯ĀƒU™„™Ò¥ƒI@mm¯¯xōW@@`k@ó»ƒUU¯lm£ÅWlĵ„w@mmwÅmWU@y±U—xmwU„¯Uƒ¥Ý¥¯£m@kŽÇVUV°VbklƒL™wUlUIm‚k@±ÑkbkalwkWKk™mI™@UlUKVzU°Wb„bU蚚@škšVĀƒ°@„n‚m¦ÝŽUUUÒVbmbXn™‚mIkllbUbmKUkkJmkŚ@lš„„¦mx@¼U@lÒULn¤˜nU¤Å„@l±¼@xX„šxV„šVVbÞLVŽ„n@xšÆšb°¼šV"],encodeOffsets:[[106504,25037]]}},{type:"Feature",id:"5303",properties:{name:"曲靖市",cp:[103.9417,25.7025],childNum:9},geometry:{type:"Polygon",coordinates:["@@ȦlKÞĕUV¯Um¯„ÇVUnVVUƒĉn™ĊÇƾLn°°È„JÆw„@lbÞa„¦V„XJ°¯W¯„aÞJVkUša„ƒ@lKnÅmWUk¯a¯»@m±@уkkbWWX_WÓU»_l™kÑm@U»m@l@IWċn¯l@VanV„UV™UVwVx„KȄVmUē‚@„ƒn@VÝÆL„w„VVwnVlmkUVÑÇ°ka@k™ÿÝaÞUl£™›—ċĕX±±ĉƒa@UnVnalónk@wl™UVmkÝJ—aW™™@ÅwóVVnnb±°™@óƒ™xXLWx„n@lǼn„m‚k_k`@bózƒ‚m@kU@ƒ`„¦óƒ@nWš@ÜÅXWw@ƒyƒb¦@ÒlnUb@x™lܐk‚@²Ç@Uƒ¯bmy@kV@bƒb„¦U`lLVx@b—Ll¼Þ¤@„°VVބU@WސUb›J@nnš@lnnm„šxUŽƒUUbƒK@šÇwklkUƒVWakn@ŽlbU@@„ULVxkKUn‚°¯Ò@¼™„kmƒ¦m@kl™Ȱ@lU„l¦„@Vl°wšnnþĊUÆbUx™b„ŽV„šĖU°„a‚nnašV„al@@b"],encodeOffsets:[[106099,27653]]}},{type:"Feature",id:"5323",properties:{name:"楚雄彝族自治州",cp:[101.6016,25.3619],childNum:10},geometry:{type:"Polygon",coordinates:["@@mҁXU`Wnšš™@Xl±¦š„Uxnbl°knmKUx„„ƒxVôUx°¼ôÒȄ°JlnÞKĠœW°¦ƒ„Vx²JVwš_°¥@UV@@wnymknK¯I@‚™²b°ƒš£V¥šwU‚V„¤nLškÆJÈwôô°„l»Č¯ƒġVƒUU@@ƒ°ƒƒÝXl@U»°Å„@U„¯@w±¯VmUUlm@m™„ÑnIVyUwmak£Vwm±—@Çw@nƒ@UxkwlÇnL‚mkř@±Žk™ka@kóJV¯Ç»U£lw¯™Xalbl¥¯UXƒ@a˜™UaÈL@ÇVIVƒkaU¯mm™akLWkUJ¯Umxnšƒ@ƒkUx¯xƒ„mWÅīÝkkbƒŤƒbkxWmXwWk¯wƒKkƒƒLŤċń„@¤óĬU²ƒ@@lƒk¯VmU¯¼@xV@k°l°kbUš°nm‚VnUš@°„š„UVèރÆbUÒÞnU¦›V—¼lô„@Vl"],encodeOffsets:[[103433,26196]]}},{type:"Feature",id:"5329",properties:{name:"大理白族自治州",cp:[99.9536,25.6805],childNum:12},geometry:{type:"Polygon",coordinates:["@@lbœKVIUa˜@²m@b™xôÒÜxXLmbnšl@š„„K°šš¼k„Uô‚xôlV¦nJ„Uš™Ænšm„@šx„ÆwšbXšÆôô„LUVwôK@wlmšaVwœ@WknmƒIUmlnJla@_™@kÝmKUašÑm¯Xw°aUaVl»²JV„bÆJkôĶĀ²VVk„mšbVwUó„wƒƒVwnLlmk¯maVw™ƒ²¥Wkš@™™XmV_‚WnÑUkƒ@k󘻜UV¥ÝmVÑÅa݄UçƒVƒ™@¯V™Umn¯mV™lak¯l¯U@@wğŽW鯁ƒ@¯xÝw¯š¯Jċa¯U¥mLU¤„bÞȤƒbÇLWUwmIUVW¼kbš`U„Vb¯L±ĊÛkƒÿÝKkwƒKţê™UĉþƒÈƒV¯ÞVbUŽ°KVšk²Ý‚mI—ƒmV@kƒm™UkšVxm„¯KXÈķJU¦V°ULWxšL@môƒšb@bkx±LnVUŽVLnkÜWnwlLŃmW@kkJU_ƒV„šWĊ„Þ"],encodeOffsets:[[101408,26770]]}},{type:"Feature",id:"5309",properties:{name:"临沧市",cp:[99.613,24.0546],childNum:8},geometry:{type:"Polygon",coordinates:["@@‚xĢ„l`²X°ŽV„šx@x°Þ°KXašğUњW‚bnIl`X²°b„xl°„„šV@xVxk¦mb„l@xšXV‚ÆzX¤™Æ˜k°„kx@lźêlaX»VUnJVx‚XÈK„aÝȣƒaV£nKV¦°‚Čb°I°™n»ÆÑV¯nWn›™@ÿXÅWWn¹ƒġōƒn»‚ÛU™™aU™VƒUw„w@w°ƒó¥ƒ@ƒz—ƒ±@ř›¯@kUwlk£±aĵŽ¯™›Uĵ¦±±@bó±VÝ@ó¤ƒw¯I@mńóm±XŽ¯IólƒK@š°Ullb™zkKlln@@ԙºƒUmVk²ôҙx™ŎUVóLƒb„ŽmÈnŽmbnl‚a„x@z„@Ǝ„¦kš"],encodeOffsets:[[101251,24734]]}},{type:"Feature",id:"5334",properties:{name:"迪庆藏族自治州",cp:[99.4592,27.9327],childNum:3},geometry:{type:"Polygon",coordinates:["@@W™Xwƒ™@akk@y›—k°īX¥›Uóķ¯w@n»UaVaUۃ¯ƒmV¼k‚™Þċô@n¯xÛÒm„V‚¯Ô@xƒ‚@šk™wm™Åa@ƒUa‚݁¯VŃyV„a@ÿšn»ÝVmank™mmÞÅôƒ@n£±›ğzÇmU¦™Vm„nÜmbn@°nV@xmzÅ@mºV¦k°ln¤š¼õô„n@xkƃIUxUš@Ťƒ¦VšmVkmkXW¤XzVx@ƚx™¼ƒÞ¯b@lVš™ĸގV„m¼XŽm¦V„ŽÞ@Ǝš¹Vón¥ÆKn„‚KX¯x@èĊȱłXšaÆxnlV@UÛlȻkğV¥„m²ljmÅÞĕƒƛm°„ÆmX¤mznƃŽV¦ÞVVb°bnÞWbnŽ°l@V„È@„‚VĵĊ±@ó„InxÆw„¥@£Þ›W¯ĸ£UƒUK‚ƒk±akkkbmWmÈķ„aÆÇU—ȃÆW@wmknmU¯"],encodeOffsets:[[102702,28401]]}},{type:"Feature",id:"5306",properties:{name:"昭通市",cp:[104.0955,27.6031],childNum:11},geometry:{type:"Polygon",coordinates:["@@mƒnK@wmƒUř¥mšóXǓŏmX@Ž—VƒmL@xţ™nk@mlUšŻÒğŋ@ƒL@mmLkm™š@b™XŎW¼ka¯lÇŹ¯aÇ»™ÝÝ_@m„@@a™@UklwUm@ak@ƒb™UmbmƒbV¯™ĕUƒƒšaVwÅaĉVmý™m¯xUkƒ@k¥VƒUXƒ¤VÈm`@„—ńÇÜ@Ākn‚ĔkƞÆĠ„™Þš‚U„VôƆÞI@ŽUxƦn„l@ĊĊnxUÒ°¦Vb¯WUnWŽIml@xn„Ubô¤‚¼ÈxlI„»šKVš„@ÈԂJkšUĖ±ÆVb@nœ„VÜVUVƒšL„wĠl„kn„Ġ@nx°¥Æ„²mUwƒ@m™mÅUl¯UњÑUm„Lll„Il±š@VkwƒW@w°@U»™kUóI°ƒ„»ĢтL„™š`nUĠ²lm„bôV@n„JUxƦX¦l@š‚ŎUƒV„@lV„KVřV£UaÞU™ƒnW@¯VU@ó™"],encodeOffsets:[[107787,28244]]}},{type:"Feature",id:"5301",properties:{name:"昆明市",cp:[102.9199,25.4663],childNum:11},geometry:{type:"Polygon",coordinates:["@@n@Vk‚VUn²°@xƒ°Vƒ@¯ÆV¼k@WŽ„Þ¯„@„@‚VVU„„Ģċ°k¼V„Ċxœ¤Ōœx°mVkƒÑȏšL‚°„x°Xœ°VmĊLVxUĖ°bX¦VW@kšȯlkn@„¥lnšƒ@»°Ñ¯VmlLUwVK@ƒV@ka@lmXb„UlVlkÈx@™„LVa„VV™wnƒmm@km™@mœIVaݏ@XƒVUݯU@ƒÝ£k»˜K@aUwkKV_ƒ¥„a@alU@nz°aV„È@@±lÛšk@wVakm@т¥„a„z‚@XxÆW@ÛX™@m@ƒy@aWw@kōĉJlbV„JƒzţÆUwVkmWkým@Ul™U@b¯wVºƒU™VUêšĠƒXUaUbVĊUŽWXUmkK™™WnUUU™V™ƒƒVV™Ý@kk±‚™¯ƒƒLkƒš±WkXlVklƒ@ƒwXbmLƒ›VUIVmk@Ubma@kkaVKUƒ™kmlXLWn™J¯ÒĊ°@zkºlLUŤn@@n›ô@lƁnmKkÈlxVw„@@mÈx˜@n²Uxl¤nbVxUzmJƒÒnš"],encodeOffsets:[[104828,25999]]}},{type:"Feature",id:"5307",properties:{name:"丽江市",cp:[100.448,26.955],childNum:5},geometry:{type:"Polygon",coordinates:["@@l@™„@w°ÓUnƒÜÑ°w@mČóšÝlU»n°„„VÜUbVbm¼@Ž°xôĸœVW¦¯Ĭlœ˜@zll@b„šWxXš‚a„X@ÆĠÆaXwl@XaƦn¼˜Jn@mnKW¯È»V¯°ak™VanXVwl@VyUĕVU„bÈīlaUk°ƒk¯lƒ²V˜Ukƛô@ƒ„I@mVwĊa„™ƒVaka„™ÆbUŽVLšaXIWKUw™ƒ„aWÑÅKUaVk°ƒ@Uw„ƒ¯¥›XğÝLkm¯Iǃóѯ»™aƒnUl±UĵÿlóÅIƒaU‚±Ik¼UŽVb¯bWxn°™ÒVbnLlޚ@@`kbmIkŽVn„JmnXl›@Ux™bkn@xóLUxVŽƒKóóŐW™™aÅxƒŽ™wƒ@™nÅm™šƒV™„ƒôX„ƒLlVU¤ƒb¦m¼™Ž@ĀƒbU‚„zUƂ°ÞVb@„Æbnššx"],encodeOffsets:[[101937,28227]]}},{type:"Feature",id:"5328",properties:{name:"西双版纳傣族自治州",cp:[100.8984,21.8628],childNum:3},geometry:{type:"Polygon",coordinates:["@@l²°ŽnÒlxÞ@„nWl„Lĸ™nbV¤V¦kbVV‚¦na„x°Vôa@„šb@lôXlWUšVXČKlmššU@bšWXXܛ°LÈa°LnU°‚ÞnšÑ„ġ°lƒnbšaƒ¯¯KWƒœó@kmK@UšĉV@k°„VV¹„a@y‚_ċl_nÓlL@anI@ƒóWl£VU—ƒl™kĕl™šKVw„U@™kVƒam¯ÅL@bƒ‚Ýk@Vn„UbÇbÝwÅ@ċ¥¯lk‚¼ÅŽ™Ò°b@¦nlUn@ŽÇV„mƁbWôU@ÝÅōm™¯ƒaU™™mk™WWw—@±ƒ™n¯U™è™a™Lƒ¯mƒL™škwƒl@°mnÈÒ¯šów@V™xƒĀU¤°Įƒ°Xl"],encodeOffsets:[[102376,22579]]}},{type:"Feature",id:"5305",properties:{name:"保山市",cp:[99.0637,24.9884],childNum:5},geometry:{type:"Polygon",coordinates:["@@X°„Il‚@¦ƒŽÈ¼m¼ÞaÞÅl„ÈxV¼šlVôÈÆlLޣȺlkUƒ‚ƒUw„¯UĕVwĊ@n¦mlnVĸIWÇ°LnƒUwl™šV„n@lnU˜„nJށl±U™¯LVUa°Ý„U„ÇĊýšVŤé„LlxÞL„ĀÜl²ĉ°KUaVƒ™_Źé@klw¯ƒlÅ—šW£ÅyU™W@wƒknal¥Uw@w™Uƒƒk¯ƒw¯aW±k_mJa™XVҙĠWb¯L¯Ý@w™wUƒ¯±Wk_ġƒwƒwōKmb@¤„bk°lĖƒô„UJƒšVnÅlťUš¯°VbnbWxX„m„ÞššWUĀ™L™yWzÛKmbUxVKkn݃kŽVšĀċ¤Ux„@Ž¯Žm@ƒ¦"],encodeOffsets:[[100440,25943]]}},{type:"Feature",id:"5304",properties:{name:"玉溪市",cp:[101.9312,23.8898],childNum:9},geometry:{type:"Polygon",coordinates:["@@l„„L°xXlWxXnlw„a„ţlaÞlÆĬnX„ƒ°wVw„l„@m™nw°VVIXllKšbnnV°lbU„UJ@ÈÇKVb—š@bW„°Vk¦kaWb°škxV¤È¼U°ôI@llblš²š@‚@œó@mm@VţkKl¹@yĉ¯°ÑšIXmWKnkšlV„ULlb@lnbVal@UnVJœU‚„nKWa„x„@lkkUlW²X„™‚l„K°„šl²@lšÞUŽ„U‚„UšVšVVXmššlLVnXWVUĉVaVb„W™ğVéšU„VU¹W»aVa„aW™Xƒ‚_U¥nÇķ¯™@a™lUnǍUyk@@wW@kbW¦UKÝwUmmƒƒLUnVxUVVlk¯mmnƒmkÇaŤ¯I@ƒl@@aĉw°ĕmU—L±ƒk™ÆéX™ÜÛ@yÈç@™Çġ„Ýķ—XmmÝVՙƒ™lmnkbmWkb@nl@nŽmš¯VxkJmUJ„ml¯™°makVVnVƒ¦™Wƒ—Wmnl@xmn„l‚I„¤„n™xU„ƒVUŽmX@˜ƒb@zl@¦Ýþ"],encodeOffsets:[[103703,24874]]}},{type:"Feature",id:"5333",properties:{name:"怒江傈僳族自治州",cp:[99.1516,26.5594],childNum:4},geometry:{type:"Polygon",coordinates:["@@WyX£lWlnnUU™„¥@ţV™Vw„JlÅ@wƒmö󙻂£kml¯U¥n¹Æ@ny@wmU@¯mnamÛnƒšUV¥ÈnĠy²œm¤„@ÆónݚnmlnbÞU‚¥„aV£kU„KWƒ„óšƒmIU¥ókwVólƒ™»¯™ƒL™ƒk@m™naWKÛwóњw@a±n—@VbUJ›LkaƒÝXĉƒ™„UV`lI@lnXÆƑkKmxÛXmlUKVmU²Klw@a™aó„@n™KXwVKU¯V¥mUnkm¥ĉ@UxVĖƒ°Vx„V„klmޙkKWĀkVWšnl°Lnm@°ŽUxlV@nk¦™JVÈ°ŽVÒ@nX°@ÆlUômlnôƒ²nxmłnVV„¯x@Èm°XblVUšl°@xkXU¤WXX‚W„Xƃ„mkÅJmށw±bƒxUīkKmÅVUĖÝèV„kx@š›lX„lnk¤ƒLkŽ‚Ėk¦‚xUššL°‚¯Ė@LnK@b°xVI„¥Ua°Ñ@»nm@¹‚KŎÞÈWln²n"],encodeOffsets:[[101071,28891]]}},{type:"Feature",id:"5331",properties:{name:"德宏傣族景颇族自治州",cp:[98.1299,24.5874],childNum:5},geometry:{type:"Polygon",coordinates:["@@„¥n@°@ƒVwČ£™ÿUlÞ„lmULVwnaÜLXyšzšKVÿ™XݙnƒWƒXwmaUa°¯V™ŦŽÆkUm„™VIƒ„ókĕl¯ƒa@£nama™@¯m¯œó@óyţbġkÅm±ÛammVkƒLwU`Wk@VƒkUmŃlUUKmbkkUVUwƒ¦óŽ°¼šbn°ô¦lºƒz@xšŽ¯„™@UŽ°nƒšU¤ţU„°VƆ@ÈmlnzÞl°¦Æa„xUxƒLkxWƒn@‚š²ŰšW„™‚@°ÈXl°Llx"],encodeOffsets:[[100440,25943]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/zhe_jiang_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3311",properties:{name:"丽水市",cp:[119.5642,28.1854],childNum:9},geometry:{type:"Polygon",coordinates:["@@@V‚bVl@Xn‚UXƒKVŽ@¦nxlUXV‚n„KVmnL‚UV@bn¤lLXK˜²„`nnlJXIVJ‚I„Vnn°KnnVll@VLXWV@UkVaVK„zV@„ƒšVVaUK@U»VUl@@WnUUƒ@wVLn@Vwl@XW°LVbn@VU‚@X„l`@XnKVbkl@XVJlUnlV„„xlL@lnXl„@VšUnV°°„@a„UVLXblWVXn@VVUV@Lš¤VLV„U‚VbnalLUUVX_laVa„WVzXKV@@a@KUmImmXama@kU@yVIUK‚aVa@kXK@aWU@VIUmW@kkVm„Uš@VwUa@K@k@Uƒ`@kUKVk@UV@VaUm²Vy@klUUWUkVmUa@_ƒKVaXa›XmƒU@mUlWkaUXƒ@mmkL@w™JƒnVVÅbWKXa™@@I@aƒJUUÇ@V„UL™W@akLmb@K@a™XXw@mƒVmUVkUy@£@aU@@VkUWm@kUKƒXUWU_mW@wkkmJUUkLWWUXƒW@IkJ@k@mW_kӃ_Ul™Lƒm@I@aUa¯m@kƒa¯LUJƒ@mVVxUb™a@LUKkXƒbm@Uak@@a@Um`ƒIUbUJ@nUVW@@LnVV@lšUbVlUX@`š@blXklW„Ušm„Xlm¦U@@V¯bml@š@nUb@llnn@VbX@lV@ŽUVULmU@JVn„bVbkb™VWxU@@nUVk@"],encodeOffsets:[[121546,28992]]}},{type:"Feature",id:"3301",properties:{name:"杭州市",cp:[119.5313,29.8773],childNum:6},geometry:{type:"Polygon",coordinates:["@@X@l„°KXXlW„b@²„`šššb‚I„šX`l@„@bWl@n@VnLUV@V„@°¦@šl@XVlU@š@xVbUb@Vkb@‚@XVJVz™J@Lޚ@VmLUxUJ@LU„Vx‚b„xXUl@VaÈw„b‚aÞa@Vl@XUVx@V@V„LlbnV„al@lb„Vnn‚LnKnL@VlbVJXalIšb@KUU@mVInJ˜„U„Vl@xUšVLnUš@UÞaV@lkV@UanK„L@UlKVUnbÆmn@@nUlVnVJl@@UXU„L@WVIVJVxVLXV@IÜKnbn@V¥V@@I@ƒƒ„y°b@UUwnk°ÆƨVlUšçXm›£aƒÇ™IkVƒ@WV@@aWIUWUIkb@WW@UnƒK@UU@kaWVkƒVIVVnU@UWVUV@VmVkKkWIkVWaULU`UImJUImm—U@ƒƒwmwUV™IUWVkUamaU@mV—kƒb@KVU@aVU@anKULVJ‚U@kÛU™JUV›kkƒVakU@ƒaVwkW@UWkXmWaULUaUK@XƒJUUmƒVU@UVƒUkJ@ImwmKU@k„@lU„W@@akKm„kamIkWl_UwVm@UkaVUUaƒ@UamakbWlkL@aUalU@mkL@U@U™lmK@XkKm@Ýakb@xƒnXbƒ`ƒnUUU@›™U@™wU@@ƒmKkkƒV¯U@lULUbVbUb@V‚a@L™ºÝb@bLmK™x@VUL@bk@mxULWl"],encodeOffsets:[[121185,30184]]}},{type:"Feature",id:"3303",properties:{name:"温州市",cp:[120.498,27.8119],childNum:9},geometry:{type:"Polygon",coordinates:["@@ll@xnXV`VX„WVL@lXnlV@UV@@b@¤VzUlnV„U@nWxšW@b@LnalK@bšXVKUƒÈ@VV„I@b@Jš@WbXLÆaUU„mšI@xlKnn„@VWlbkXV‚@n„VWnœ‚WbUb„L@`VbUnVlVXkV@lUz±‚VnUbU@@VUlVL@l„_@V@l@LVbV@XLV`VÈlxn@lU@aœaVV‚k„@XJ@nl@@LU`°LVb„L°a@a„UVy@anI@a„a‚nV@²wÜJX@VšVV°k„na@WVk„aWwU@m@™ƒkƒaUĕ™ÝšÝŤnÈa„aóI›»@±X™WkUķ@kV±kw™ƒUkWw„™UƒÝ»ÛkɳlImaUaWóXÿǬk‚UnWVmmk™KţnŏÞğl™„UlUx@XWb„V@JkXƒ°mb@VULVxUVk@@LWWk@WIkšƒUkJmUkVmI@yƒ@Ua™kLm‚U@mUUUkaVk™@mK@UlUU@UmKmbUUUJ@n@KVLUL@VkJWXX`mnULWlkL@JVLVb@°kxkU@LVŽ™V@„VLV`UL@VUX"],encodeOffsets:[[122502,28334]]}},{type:"Feature",id:"3302",properties:{name:"宁波市",cp:[121.5967,29.6466],childNum:6},geometry:{type:"Polygon",coordinates:["@@Ċ¦ĸĀ°‚nXÞVšKškƨƑźÿ°»n„@wô¥ÜbœU°ÆXÞWóçĉݱIUƒÈ¥@U°wÆ»²mm_@aXƒVKÞVlk@akk›̅@£X»VwƏXWa¯aȗb™KƽۃĊ™xƒLóŽk@ƒƒƒ@¯nƒKUL@xkL›ÑkWULUUmJUXVŽU@mŽUX¯@V`mbXbV@@nn¤WXšx@škJ@nVVUVl²UbÝVUVk@Wx@V@„ƒVXzmlaƒL@VlLU`„XUVVVUnl@VbnJlnUVVnƒlUKkbmnn„VxlJnxmbU@UL@KUV™X@xmb@lk@mnVVUš™è"],encodeOffsets:[[123784,30977]]}},{type:"Feature",id:"3309",properties:{name:"舟山市",cp:[122.2559,30.2234],childNum:3},geometry:{type:"Polygon",coordinates:["@@l΢ƒʠþÆVĢLĊƒǬXĊ܄XôV„ÑÆw„ƒlšƏÈóVĭVǓ@ƒĉwɛkmK@ĉXīWaĉUĵÝmƒ¯ĉƒwĉ±±nż¯x@VǦV„²JĊÞôèÝXÅW¯›VÛaó¦@xƒŽmŽ¯¼ŹĀ"],encodeOffsets:[[124437,30983]]}},{type:"Feature",id:"3310",properties:{name:"台州市",cp:[121.1353,28.6688],childNum:7},geometry:{type:"Polygon",coordinates:["@@lV„IVWVz@bXJl@Xal@°„nLll@nVxnV„K@UJVbƒ¦°„k`UIWJXnƚ@bUJ„Xl@lb„Wn@UzVV@bVVšmVnnJVXna‚bšKUKnUVVUnVLlKVLXa„Jm£@mU@WanaU_°@VWnV@UVWnIVVVKlXœÒlK@wVK„L°m„@„„l@ô„Kšw„ĉƾůUƒl£@»UƒVk„m@ƅUƒƒaÛIŏmUk@m„w@a™£ƒWk@ţšƒIm±@ankôUlaU™Uw¯ƒōaƒbÇbţm™ÞšÞVĖ„b„l@š@n‚VXxƒbUl@XmbƒŽ¯lUUU™W@ÛI±xU@mƒb@bmJ@bUzƒV@b¯bƒKUa¯KV_@Kk@@mWIƒ@lUU›b@bkVm@kwUÇU_WKU@Ux™@ƒVUnllX@Vn‚J@UXV@bWL@lUbbVLUJ@z‚V@lnbWbnnnJVŽ@L"],encodeOffsets:[[123312,29526]]}},{type:"Feature",id:"3307",properties:{name:"金华市",cp:[120.0037,29.1028],childNum:8},geometry:{type:"Polygon",coordinates:["@@nbVb„@VbUVlb@VUnVxk`lXnJlbnƒlL@bX@Vƒ@klƒV@nLnx@JlI„V‚U@VUVn„VV„I@WVLVbVKXbWnXl@VlXUx„b@ŽlVUbl„œlVUšIÜVnalKX@@bV@@aUUlUƒwUw„@naWW„UVaUUšaVb„LlxXJVk°ƒUƒlkU¥@k„a@LVlXLVlšVWznVn@lxšJl_@WX_@mVa„a@alU@kVVna„KVLlK„b@UUaVašbnUWmXU@k@yVI@ařWmXIVJl_¯ƒ„¥UaVI@ƒLmUUw@mkkmK¯ƒk@Wbk@WI@aUyUXƒJkU@bU@WLUyƒXUbkbW`UVVkKmbUaVUƒUK™£@KVUUUm@UWkXWaUKƒV@b¯ƒ¯mU™V@UkƒmW@kkKƒwUƒmkkVUI@WlkUamL@Wk_Wƒ@UVm@Ua¯KWXk@Uxm@UK@xV„mV@Xk@UVV¼@‚VLUb™Uƒ„U@ƒyULUbVlU@@XlVUVVbƒU@lXXVW@XUVl@@VUVƒÈn@VVU„@lVa@„U„mL@`X@`WL@VUX@lUL@xlx"],encodeOffsets:[[122119,29948]]}},{type:"Feature",id:"3308",properties:{name:"衢州市",cp:[118.6853,28.8666],childNum:5},geometry:{type:"Polygon",coordinates:["@@XkVKnwl@@aVK@UšwnL‚K@aÞaš¹@Kb@UVaUaVaVK@k°V„UllnL@„V@šxV@œšV@VV„m„_Wa„m@wlaÞbn@lL@WnLšk@V@VlK@nkVVb@blKXklakw@wVK@kVW@UXK@_‚W@_nKVƒ@ƒUb@kVƒUUm@„ÇVU@Uk@VU@WUXWW@k„VUaVUkU@WWXUKk@Ukmm¯LmmƒUJUIWJkImmƒ_—±WLkKm£@aVUmKUnƒLmWUkVmw@¥U„LVWm@WUka@UmmLmm@@bUX™@@WUIm@UVUK@UVUUU™VVJmb@b„Xn‚mVƒ¼nnn¦mJUVƒL„V@VW@UzUlVnUbl`UnVl@XU@kl@bmÈUx™Vk@@J@„ƒ¼W@ÅaVVnzmVƒ„@WJk@kWJ@ƒlXbWbXxmVnšlLXb@°lKVXnWšbWV„„X„mbV@Xl‚bšI@Kn@@x@šVLlm"],encodeOffsets:[[121185,30184]]}},{type:"Feature",id:"3306",properties:{name:"绍兴市",cp:[120.564,29.7565],childNum:6},geometry:{type:"Polygon",coordinates:["@@„x@„˜VnnVJnIVJV_VKXblUXJlŽlLUŽUnU@UVVX@ŽmVUUUJl„XUlbV@@V„LVmX@@XlaVJVXXJ@b‚@XU„@lUšJ„È‚bœ¤Ō„JšçV™UUnml@@kna@wšWVU@LVKV@namwkIUwmƒnmlaVL„kUmVUkmmIUak@VmUUVUƒWV_kK@U„K‚bnkWy„U@ƒ@UXwl@VUÞUVak±VUUU@mlI@™™wXWƒIWbUKkLUKVmUUmVVL™LambUWmIUm™nUU@aUUVym@ƒXkak@ƒW@z@lWVXnmV™aUbVb@VƒakLUKƒLmbUU@lkV@bƒbUb@nW`@Xk`™Ikwm@mUXy™UUkWKUk@Kƒb@lV¦klV„¯„UlWIkwƒKUa™bVVUbƒVXXmbƒ@Vx„xkVVV@bU@@aW@kLmb@lVUIVKmL@bUV@bUV@L„a˜lnUV@nbVbUlVXšJVUnx"],encodeOffsets:[[122997,30561]]}},{type:"Feature",id:"3304",properties:{name:"嘉兴市",cp:[120.9155,30.6354],childNum:6},geometry:{type:"Polygon",coordinates:["@@@blIX@@VÜVUnn@l‚k„lKnI°Þl`²LVKVbnbVaVLUVn@W¦@VkVVb„@VI„`@blLnL‚aX@„VVb@U‚@XlVa„@@kVaUKV»U_lWXUƒƒ@alb„k@VllnLVKn@@UVIUw@y°IVVXU@VV@lw„m@wVkƾaœJ‚LkΡƧƒ™l™LÝUmW¯ķÿĉ¥ƒIŋŽWn™èkVƧU¯ÅmlVx@V¯aƒz„Ž@„@JU@U¦m@@šnVmn@V„LV‚"],encodeOffsets:[[123233,31382]]}},{type:"Feature",id:"3305",properties:{name:"湖州市",cp:[119.8608,30.7782],childNum:4},geometry:{type:"Polygon",coordinates:["@@kLlƒkm@VmÛU@UW@kJ@aUƒK@UnmmU@™maÛL@JWUUKUwUIUJ@XƒKWV@Vk@UIUmVk@mm@ÅnmaUVkL@VƒKmLVbU@klU@ÝbV™@mVUKV™@wUkVƒ—ƒmIUJ@nVV@L™akJWbUIka@UmKmLKmmƒUUVk@@nmLX`WXUV@Ž@nUl™kmlU@Ub„„ƒxVVšIlV„Žšnn„@@n˜„UҚ@„°n@@xmb@„VbnV@šš„@b@`@L@L@x@blVklVbnnV@‚aXb°VlU@W„b°U„LXWVUV™„™VwÈwÜ»ĸaĠnUVw²X@V@lVU@wlaUUVm@knUV›"],encodeOffsets:[[123379,31500]]}}],UTF8Encoding:!0}}),r("echarts/util/shape/HalfSmoothPolygon",["require","zrender/shape/Base","zrender/shape/util/smoothBezier","zrender/tool/util","zrender/shape/Polygon"],function(e){function i(e){t.call(this,e)}var t=e("zrender/shape/Base"),n=e("zrender/shape/util/smoothBezier"),r=e("zrender/tool/util");return i.prototype={type:"half-smooth-polygon",buildPath:function(t,r){var i=r.pointList;if(i.length<2)return;if(r.smooth){var s=n(i.slice(0,-2),r.smooth);t.moveTo(i[0][0],i[0][1]);var o,u,a,f=i.length;for(var l=0;l0&&this._buildSinglePosition(f,t[f]);this.addShapeList()},_buildSinglePosition:function(e,t){var n=this._mapData(t),r=n.locationMap,i=n.maxDataLength;if(i===0||r.length===0)return;switch(e){case"bottom":case"top":this._buildHorizontal(t,i,r,this.xMarkMap);break;case"left":case"right":this._buildVertical(t,i,r,this.xMarkMap)}for(var s=0,o=t.length;s0&&(this.finalPLMap[s]=this.finalPLMap[s]||[],this.finalPLMap[s].push(g[s]),g[s]=[]);continue}b>=0?(p-=T>0?l.getCoordSize(b):d-l.getCoord(b),h=p):b<0&&(v+=T>0?l.getCoordSize(b):l.getCoord(b)-m,h=v),g[s].push([c,h,w,a.getNameByIndex(w),c,d]),r[s].min>b&&(r[s].min=b,r[s].minY=h,r[s].minX=c),r[s].max0&&(this.finalPLMap[k]=this.finalPLMap[k]||[],this.finalPLMap[k].push(g[k]),g[k]=[]);for(var S=0,x=n.length;S0&&(r[s].average=(r[s].sum/r[s].counter).toFixed(2)-0),h=this.component.yAxis.getAxis(i[s].yAxisIndex||0).getCoord(r[s].average),r[s].averageLine=[[this.component.grid.getX(),h],[this.component.grid.getXend(),h]],r[s].minLine=[[this.component.grid.getX(),r[s].minY],[this.component.grid.getXend(),r[s].minY]],r[s].maxLine=[[this.component.grid.getX(),r[s].maxY],[this.component.grid.getXend(),r[s].maxY]];this._buildBorkenLine(e,this.finalPLMap,a,"horizontal")},_buildVertical:function(e,t,n,r){var i=this.series,s=n[0][0],o=i[s],u=o.yAxisIndex,a=this.component.yAxis.getAxis(u),f,l,c,h,p,d,v,m,g={},y,b;for(var w=0,E=t;w0&&(this.finalPLMap[s]=this.finalPLMap[s]||[],this.finalPLMap[s].push(g[s]),g[s]=[]);continue}b>=0?(p+=T>0?l.getCoordSize(b):l.getCoord(b)-d,c=p):b<0&&(v-=T>0?l.getCoordSize(b):m-l.getCoord(b),c=v),g[s].push([c,h,w,a.getNameByIndex(w),d,h]),r[s].min>b&&(r[s].min=b,r[s].minX=c,r[s].minY=h),r[s].max0&&(this.finalPLMap[k]=this.finalPLMap[k]||[],this.finalPLMap[k].push(g[k]),g[k]=[]);for(var S=0,x=n.length;S0&&(r[s].average=(r[s].sum/r[s].counter).toFixed(2)-0),c=this.component.xAxis.getAxis(i[s].xAxisIndex||0).getCoord(r[s].average),r[s].averageLine=[[c,this.component.grid.getYend()],[c,this.component.grid.getY()]],r[s].minLine=[[r[s].minX,this.component.grid.getYend()],[r[s].minX,this.component.grid.getY()]],r[s].maxLine=[[r[s].maxX,this.component.grid.getYend()],[r[s].maxX,this.component.grid.getY()]];this._buildBorkenLine(e,this.finalPLMap,a,"vertical")},_buildBorkenLine:function(e,t,n,i){var o=this.series,l,c,h,p,d,v,m,g,y,b,w,E,S,x,T;for(var N=e.length-1;N>=0;N--){T=e[N],g=o[T],b=t[T];if(g.type==this.type&&typeof b!="undefined"){l=this._sIndex2ColorMap[T],c=this.query(g,"itemStyle.normal.lineStyle.width"),h=this.query(g,"itemStyle.normal.lineStyle.type"),p=this.query(g,"itemStyle.normal.lineStyle.color"),d=this.getItemStyleColor(this.query(g,"itemStyle.normal.color"),T,-1),v=typeof this.query(g,"itemStyle.normal.areaStyle")!="undefined",m=this.query(g,"itemStyle.normal.areaStyle.color");for(var C=0,k=b.length;C=0;r--){f=this.shapeList[r]._seriesIndex;if(n[f]&&!n[f][3]){if(this.shapeList[r]._main&&this.shapeList[r].style.pointList.length>1){l=this.shapeList[r].style.pointList,o=Math.abs(l[0][0]-l[1][0]),a=Math.abs(l[0][1]-l[1][1]),c=this.shapeList[r]._orient=="horizontal";if(n[f][2]){if(this.shapeList[r].type=="polygon"){var h=l.length;this.shapeList[r].style.pointList[h-3]=l[h-2],c?this.shapeList[r].style.pointList[h-3][0]=l[h-4][0]:this.shapeList[r].style.pointList[h-3][1]=l[h-4][1],this.shapeList[r].style.pointList[h-2]=l[h-1]}this.shapeList[r].style.pointList.pop(),c?(s=o,u=0):(s=0,u=-a)}else{this.shapeList[r].style.pointList.shift();if(this.shapeList[r].type=="polygon"){var p=this.shapeList[r].style.pointList.pop();c?p[0]=l[0][0]:p[1]=l[0][1],this.shapeList[r].style.pointList.push(p)}c?(s=-o,u=0):(s=0,u=a)}this.zr.modShape(this.shapeList[r].id,{style:{pointList:this.shapeList[r].style.pointList}},!0)}else{if(n[f][2]&&this.shapeList[r]._dataIndex==t[f].data.length-1){this.zr.delShape(this.shapeList[r].id);continue}if(!n[f][2]&&this.shapeList[r]._dataIndex===0){this.zr.delShape(this.shapeList[r].id);continue}}this.shapeList[r].position=[0,0],this.zr.animate(this.shapeList[r].id,"").when(500,{position:[s,u]}).start()}}}},i.prototype.iconLibrary.legendLineIcon=c,a.inherits(l,n),a.inherits(l,t),e("../chart").define("line",l),l}),r("echarts/chart/bar",["require","../component/base","./base","zrender/shape/Rectangle","../component/axis","../component/grid","../component/dataZoom","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../chart"],function(e){function a(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this),this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("zrender/shape/Rectangle");e("../component/axis"),e("../component/grid"),e("../component/dataZoom");var i=e("../config"),s=e("../util/ecData"),o=e("zrender/tool/util"),u=e("zrender/tool/color");return a.prototype={type:i.CHART_TYPE_BAR,_buildShape:function(){var e=this.series;this.selectedMap={},this.xMarkMap={},this._sIndex2colorMap={};var t={top:[],bottom:[],left:[],right:[]},n,r,s,o;for(var u=0,a=e.length;u0&&this._buildSinglePosition(f,t[f],this.xMarkMap);this.addShapeList()},_buildSinglePosition:function(e,t,n){var r=this._mapData(t),i=r.locationMap,s=r.maxDataLength;if(s===0||i.length===0)return;switch(e){case"bottom":case"top":this._buildHorizontal(s,i,t,n);break;case"left":case"right":this._buildVertical(s,i,t,n)}},_mapData:function(e){var t=this.series,n,r=0,i={},s="__kener__stack__",o,u,a=this.component.legend,f=[],l=0,c;for(var h=0,p=e.length;h0&&(c.style.x+=1,c.style.y+=1,c.style.width-=2,c.style.height-=2,c.style.strokeColor=c.highlightStyle.strokeColor=n.itemStyle.normal.borderColor,c.highlightStyle.lineWidth=3,c.style.brushType="both"),a.setItemShape(u,c))):(this.selectedMap[u]=!0,this._sIndex2colorMap[e[h]]=this.zr.getColor(e[h])),this.selectedMap[u]&&(o=n.stack||s+e[h],typeof i[o]=="undefined"?(i[o]=r,f[r]=[e[h]],r++):f[i[o]].push(e[h])),l=Math.max(l,n.data.length);return{locationMap:f,maxDataLength:l}},_buildHorizontal:function(e,t,n,i){var s=this.series,o=t[0][0],u=s[o],a=u.xAxisIndex,f=this.component.xAxis.getAxis(a),l,c,h=this._mapSize(f,t),p=h.gap,d=h.barGap,v=h.barWidthMap,m=h.barWidth,g=h.barMinHeightMap,y,b=h.interval,w,E,S,x,T,N,C,k,L;for(var A=0,O=e;A0?(y=D>0?c.getCoordSize(L):x-c.getCoord(L),P==1&&g[o]>y&&(y=g[o]),S-=y,E=S):L<0?(y=D>0?c.getCoordSize(L):c.getCoord(L)-N,P==1&&g[o]>y&&(y=g[o]),E=T,T+=y):(y=0,S-=y,E=S),i[o][A]=w+(v[o]||m)/2,i[o].min>L&&(i[o].min=L,i[o].minY=E,i[o].minX=i[o][A]),i[o].max0&&(i[o].average=(i[o].sum/i[o].counter).toFixed(2)-0),E=this.component.yAxis.getAxis(s[o].yAxisIndex||0).getCoord(i[o].average),i[o].averageLine=[[this.component.grid.getX(),E],[this.component.grid.getXend(),E]],i[o].minLine=[[this.component.grid.getX(),i[o].minY],[this.component.grid.getXend(),i[o].minY]],i[o].maxLine=[[this.component.grid.getX(),i[o].maxY],[this.component.grid.getXend(),i[o].maxY]],i[o].isHorizontal=!0,this.buildMark(o)},_buildVertical:function(e,t,n,i){var s=this.series,o=t[0][0],u=s[o],a=u.yAxisIndex,f=this.component.yAxis.getAxis(a),l,c,h=this._mapSize(f,t),p=h.gap,d=h.barGap,v=h.barWidthMap,m=h.barWidth,g=h.barMinHeightMap,y,b=h.interval,w,E,S,x,T,N,C,k,L;for(var A=0,O=e;A0?(y=D>0?c.getCoordSize(L):c.getCoord(L)-x,P==1&&g[o]>y&&(y=g[o]),w=S,S+=y):L<0?(y=D>0?c.getCoordSize(L):N-c.getCoord(L),P==1&&g[o]>y&&(y=g[o]),T-=y,w=T):(y=0,w=S,S+=y),i[o][A]=E-(v[o]||m)/2,i[o].min>L&&(i[o].min=L,i[o].minX=w+y,i[o].minY=i[o][A]),i[o].max0&&(i[o].average=(i[o].sum/i[o].counter).toFixed(2)-0),w=this.component.xAxis.getAxis(s[o].xAxisIndex||0).getCoord(i[o].average),i[o].averageLine=[[w,this.component.grid.getYend()],[w,this.component.grid.getY()]],i[o].minLine=[[i[o].minX,this.component.grid.getYend()],[i[o].minX,this.component.grid.getY()]],i[o].maxLine=[[i[o].maxX,this.component.grid.getYend()],[i[o].maxX,this.component.grid.getY()]],i[o].isHorizontal=!1,this.buildMark(o)},_mapSize:function(e,t,n){var r=this.series,i,s={},o={},u,a=0,f=0,l,c,h,p,d=1;for(var v=0,m=t.length;v1?typeof c=="string"&&c.match(/%$/)?Math.floor(e.getGap()*(100-parseFloat(c))/100):e.getGap()-c:f,x=0,l=a>1?Math.floor((S-f)/(a-1)):0;if(l<0)return this._mapSize(e,t,!0)}return{barWidthMap:s,barMinHeightMap:o,gap:S,barWidth:x,barGap:l,interval:d}},_getBarItem:function(e,t,n,r,i,o,a,f){var l=this.series,c,h=l[e],p=h.data[t],d=this._sIndex2colorMap[e],v=[p,h],m=this.deepQuery(v,"itemStyle.normal.color")||d,g=this.deepQuery(v,"itemStyle.emphasis.color"),y=this.deepMerge(v,"itemStyle.normal"),b=y.borderWidth,w=this.deepMerge(v,"itemStyle.emphasis");c={zlevel:this._zlevelBase,clickable:!0,style:{x:r,y:i,width:o,height:a,brushType:"both",color:this.getItemStyleColor(m,e,t,p),radius:y.borderRadius,lineWidth:b,strokeColor:y.borderColor},highlightStyle:{color:this.getItemStyleColor(g,e,t,p),radius:w.borderRadius,lineWidth:w.borderWidth,strokeColor:w.borderColor},_orient:f},c.highlightStyle.color=c.highlightStyle.color||(typeof c.style.color=="string"?u.lift(c.style.color,-0.3):c.style.color),b>0&&c.style.height>b&&c.style.width>b?(c.style.y+=b/2,c.style.height-=b,c.style.x+=b/2,c.style.width-=b):c.style.brushType="fill",c.highlightStyle.textColor=c.highlightStyle.color,c=this.addLabel(c,h,p,n,f);if(c.style.textPosition=="insideLeft"||c.style.textPosition=="insideRight"||c.style.textPosition=="insideTop"||c.style.textPosition=="insideBottom"){var E=5;switch(c.style.textPosition){case"insideLeft":c.style.textX=c.style.x+E,c.style.textY=c.style.y+c.style.height/2,c.style.textAlign="left",c.style.textBaseline="middle";break;case"insideRight":c.style.textX=c.style.x+c.style.width-E,c.style.textY=c.style.y+c.style.height/2,c.style.textAlign="right",c.style.textBaseline="middle";break;case"insideTop":c.style.textX=c.style.x+c.style.width/2,c.style.textY=c.style.y+E/2,c.style.textAlign="center",c.style.textBaseline="top";break;case"insideBottom":c.style.textX=c.style.x+c.style.width/2,c.style.textY=c.style.y+c.style.height-E/2,c.style.textAlign="center",c.style.textBaseline="bottom"}c.style.textPosition="specific",c.style.textColor=c.style.textColor||"#fff"}return this.deepQuery([p,h,this.option],"calculable")&&(this.setCalculable(c),c.draggable=!0),s.pack(c,l[e],e,l[e].data[t],t,n),c},getMarkCoord:function(e,t){var n=this.series[e],r=this.xMarkMap[e],i=this.component.xAxis.getAxis(n.xAxisIndex),s=this.component.yAxis.getAxis(n.yAxisIndex),o,u;if(!t.type||t.type!="max"&&t.type!="min"&&t.type!="average")if(r.isHorizontal){o=typeof t.xAxis=="string"&&i.getIndexByName?i.getIndexByName(t.xAxis):t.xAxis||0;var a=r[o];a=typeof a!="undefined"?a:typeof t.xAxis!="string"&&i.getCoordByIndex?i.getCoordByIndex(t.xAxis||0):i.getCoord(t.xAxis||0),u=[a,s.getCoord(t.yAxis||0)]}else{o=typeof t.yAxis=="string"&&s.getIndexByName?s.getIndexByName(t.yAxis):t.yAxis||0;var f=r[o];f=typeof f!="undefined"?f:typeof t.yAxis!="string"&&s.getCoordByIndex?s.getCoordByIndex(t.yAxis||0):s.getCoord(t.yAxis||0),u=[i.getCoord(t.xAxis||0),f]}else u=[r[t.type+"X"],r[t.type+"Y"],r[t.type+"Line"],r[t.type]];return u},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},addDataAnimation:function(e){var t=this.series,n={};for(var r=0,i=e.length;r=0;r--){c=s.get(this.shapeList[r],"seriesIndex");if(n[c]&&!n[c][3]&&this.shapeList[r].type=="rectangle"){h=s.get(this.shapeList[r],"dataIndex"),l=t[c];if(n[c][2]&&h==l.data.length-1){this.zr.delShape(this.shapeList[r].id);continue}if(!n[c][2]&&h===0){this.zr.delShape(this.shapeList[r].id);continue}this.shapeList[r]._orient=="horizontal"?(f=this.component.yAxis.getAxis(l.yAxisIndex||0).getGap(),a=n[c][2]?-f:f,o=0):(u=this.component.xAxis.getAxis(l.xAxisIndex||0).getGap(),o=n[c][2]?u:-u,a=0),this.shapeList[r].position=[0,0],this.zr.animate(this.shapeList[r].id,"").when(500,{position:[o,a]}).start()}}}},o.inherits(a,n),o.inherits(a,t),e("../chart").define("bar",a),a}),r("echarts/chart/pie",["require","../component/base","./base","zrender/shape/Text","zrender/shape/Ring","zrender/shape/Circle","zrender/shape/Sector","zrender/shape/BrokenLine","../config","../util/ecData","zrender/tool/util","zrender/tool/math","zrender/tool/color","../chart"],function(e){function p(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this);var u=this;u.shapeHandler.onmouseover=function(e){var t=e.target,n=f.get(t,"seriesIndex"),r=f.get(t,"dataIndex"),i=f.get(t,"special"),s=t._lastAddRadius,o=t.style.startAngle,a=t.style.endAngle,l=t.highlightStyle.color,c=u.getLabel(n,r,i,s,o,a,l,!0);c&&u.zr.addHoverShape(c);var h=u.getLabelLine(n,r,s,t.style.r0,t.style.r,o,a,l,!0);h&&u.zr.addHoverShape(h)},this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("zrender/shape/Text"),i=e("zrender/shape/Ring"),s=e("zrender/shape/Circle"),o=e("zrender/shape/Sector"),u=e("zrender/shape/BrokenLine"),a=e("../config"),f=e("../util/ecData"),l=e("zrender/tool/util"),c=e("zrender/tool/math"),h=e("zrender/tool/color");return p.prototype={type:a.CHART_TYPE_PIE,_buildShape:function(){var e=this.series,t=this.component.legend;this.selectedMap={},this._selected={};var n,r,o;this._selectedMode=!1;var u;for(var l=0,c=e.length;l0&&Math.abs(m-g)<15&&p<4&&this._needLabel(n,r[l],!1)&&this.deepQuery([r[l],n],"itemStyle.normal.label.position")!="center"?d+=h<4?20:-20:d=0,this._buildItem(e,l,h,d,r[l].selected,x,T,m,g,w),v||(m=g)}},_buildItem:function(e,t,n,r,i,s,o,u,a,l){var c=this.series,h=this.getSector(e,t,n,i,s,o,u,a,l);f.pack(h,c[e],e,c[e].data[t],t,c[e].data[t].name,n),h._lastAddRadius=r,this.shapeList.push(h);var p=this.getLabel(e,t,n,r,u,a,l,!1);p&&(f.pack(p,c[e],e,c[e].data[t],t,c[e].data[t].name,n),p._dataIndex=t,this.shapeList.push(p));var d=this.getLabelLine(e,t,r,s,o,u,a,l,!1);d&&(f.pack(d,c[e],e,c[e].data[t],t,c[e].data[t].name,n),d._dataIndex=t,this.shapeList.push(d))},getSector:function(e,t,n,r,i,s,u,a,f){var l=this.series,p=l[e],d=p.data[t],v=[d,p],m=this.parseCenter(this.zr,p.center),g=this.deepMerge(v,"itemStyle.normal")||{},y=this.deepMerge(v,"itemStyle.emphasis")||{},b=this.getItemStyleColor(g.color,e,t,d)||f,w=this.getItemStyleColor(y.color,e,t,d)||(typeof b=="string"?h.lift(b,-0.2):b),E={zlevel:this._zlevelBase,clickable:!0,style:{x:m[0],y:m[1],r0:i,r:s,startAngle:u,endAngle:a,brushType:"both",color:b,lineWidth:g.borderWidth,strokeColor:g.borderColor,lineJoin:"round"},highlightStyle:{color:w,lineWidth:y.borderWidth,strokeColor:y.borderColor,lineJoin:"round"},_seriesIndex:e,_dataIndex:t};if(r){var S=((E.style.startAngle+E.style.endAngle)/2).toFixed(2)-0;E.style._hasSelected=!0,E.style._x=E.style.x,E.style._y=E.style.y;var x=this.query(p,"selectedOffset");E.style.x+=c.cos(S,!0)*x,E.style.y-=c.sin(S,!0)*x,this._selected[e][t]=!0}else this._selected[e][t]=!1;this._selectedMode&&(E.onclick=this.shapeHandler.onclick),this.deepQuery([d,p,this.option],"calculable")&&(this.setCalculable(E),E.draggable=!0);if(this._needLabel(p,d,!0)||this._needLabelLine(p,d,!0))E.onmouseover=this.shapeHandler.onmouseover;return E=new o(E),E},getLabel:function(e,t,n,i,s,o,u,a){var f=this.series,h=f[e],p=h.data[t];if(!this._needLabel(h,p,a))return;var d=a?"emphasis":"normal",v=l.merge(l.clone(p.itemStyle)||{},h.itemStyle),m=v[d].label,g=m.textStyle||{},y=this.parseCenter(this.zr,h.center),b=y[0],w=y[1],E,S,x=((o+s)/2+360)%360,T=this.parseRadius(this.zr,h.radius),N,C="middle";return m.position=m.position||v.normal.label.position,m.position=="center"?(T=T[1],E=b,S=w,N="center"):m.position=="inner"?(T=(T[0]+T[1])/2+i,E=Math.round(b+T*c.cos(x,!0)),S=Math.round(w-T*c.sin(x,!0)),u="#fff",N="center"):(T=T[1]- -v[d].labelLine.length+i,E=b+T*c.cos(x,!0),S=w-T*c.sin(x,!0),N=x>=90&&x<=270?"right":"left"),m.position!="center"&&m.position!="inner"&&(E+=N=="left"?20:-20),p.__labelX=E-(N=="left"?5:-5),p.__labelY=S,new r({zlevel:this._zlevelBase+1,hoverable:!1,style:{x:E,y:S,color:g.color||u,text:this.getLabelText(e,t,n,d),textAlign:g.align||N,textBaseline:g.baseline||C,textFont:this.getFont(g)},highlightStyle:{brushType:"fill"},_seriesIndex:e,_dataIndex:t})},getLabelText:function(e,t,n,r){var i=this.series,s=i[e],o=s.data[t],u=this.deepQuery([o,s],"itemStyle."+r+".label.formatter");if(!u)return o.name;if(typeof u=="function")return u.call(this.myChart,s.name,o.name,o.value,n);if(typeof u=="string")return u=u.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}").replace("{d}","{d0}"),u=u.replace("{a0}",s.name).replace("{b0}",o.name).replace("{c0}",o.value).replace("{d0}",n),u},getLabelLine:function(e,t,n,r,i,s,o,a,f){var h=this.series,p=h[e],d=p.data[t];if(this._needLabelLine(p,d,f)){var v=f?"emphasis":"normal",m=l.merge(l.clone(d.itemStyle)||{},p.itemStyle),g=m[v].labelLine,y=g.lineStyle||{},b=this.parseCenter(this.zr,p.center),w=b[0],E=b[1],S=i,x=this.parseRadius(this.zr,p.radius)[1]- -g.length+n,T=(o+s)/2%360,N=c.cos(T,!0),C=c.sin(T,!0);return new u({zlevel:this._zlevelBase+1,hoverable:!1,style:{pointList:[[w+S*N,E-S*C],[w+x*N,E-x*C],[d.__labelX,d.__labelY]],strokeColor:y.color||a,lineType:y.type,lineWidth:y.width},_seriesIndex:e,_dataIndex:t})}return},_needLabel:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".label.show")},_needLabelLine:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".labelLine.show")},reformOption:function(e){var t=l.merge;return e=t(e||{},this.ecTheme.pie),e.itemStyle.normal.label.textStyle=t(e.itemStyle.normal.label.textStyle||{},this.ecTheme.textStyle),e.itemStyle.emphasis.label.textStyle=t(e.itemStyle.emphasis.label.textStyle||{},this.ecTheme.textStyle),e},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},addDataAnimation:function(e){var t=this.series,n={};for(var r=0,i=e.length;r0&&(e.splice(f-1,2),f-=2)}}e=e.join("/")}else e.indexOf("./")===0&&(e=e.substring(2));if((p||v)&&d){n=e.split("/");for(f=n.length;f>0;f-=1){r=n.slice(0,f).join("/");if(p)for(c=p.length;c>0;c-=1){i=d[p.slice(0,c).join("/")];if(i){i=i[r];if(i){s=i,o=f;break}}}if(s)break;!u&&v&&v[r]&&(u=v[r],a=f)}!s&&u&&(s=u,o=a),s&&(n.splice(0,o,s),e=n.join("/"))}return e}function m(t,n){return function(){return s.apply(e,p.call(arguments,0).concat([t,n]))}}function g(e){return function(t){return v(t,e)}}function y(e){return function(t){a[e]=t}}function b(t){if(d(f,t)){var n=f[t];delete f[t],c[t]=!0,i.apply(e,n)}if(!d(a,t)&&!d(c,t))throw new Error("No "+t);return a[t]}function w(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function E(e){return function(){return l&&l.config&&l.config[e]||{}}}var i,s,o,u,a={},f={},l={},c={},h=Object.prototype.hasOwnProperty,p=[].slice;o=function(e,t){var n,r=w(e),i=r[0];return e=r[1],i&&(i=v(i,t),n=b(i)),i?n&&n.normalize?e=n.normalize(e,g(t)):e=v(e,t):(e=v(e,t),r=w(e),i=r[0],e=r[1],i&&(n=b(i))),{f:i?i+"!"+e:e,n:e,pr:i,p:n}},u={require:function(e){return m(e)},exports:function(e){var t=a[e];return typeof t!="undefined"?t:a[e]={}},module:function(e){return{id:e,uri:"",exports:a[e],config:E(e)}}},i=function(t,n,r,i){var s,l,h,p,v,g=[],w;i=i||t;if(typeof r=="function"){n=!n.length&&r.length?["require","exports","module"]:n;for(v=0;v{b} : {c}",showDelay:20,hideDelay:100,transitionDuration:.4,backgroundColor:"rgba(0,0,0,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,axisPointer:{type:"line",lineStyle:{color:"#48b",width:2,type:"solid"},crossStyle:{color:"#1e90ff",width:1,type:"dashed"},shadowStyle:{color:"rgba(150,150,150,0.3)",width:"auto",type:"default"}},textStyle:{color:"#fff"}},dataZoom:{show:!1,orient:"horizontal",backgroundColor:"rgba(0,0,0,0)",dataBackgroundColor:"#eee",fillerColor:"rgba(144,197,237,0.2)",handleColor:"rgba(70,130,180,0.8)",realtime:!0},grid:{x:80,y:60,x2:80,y2:60,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},categoryAxis:{position:"bottom",name:"",nameLocation:"end",nameTextStyle:{},boundaryGap:!0,axisLine:{show:!0,onZero:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!0,interval:"auto",inside:!1,length:5,lineStyle:{color:"#333",width:1}},axisLabel:{show:!0,interval:"auto",rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}}},valueAxis:{position:"left",name:"",nameLocation:"end",nameTextStyle:{},boundaryGap:[0,0],precision:0,power:100,splitNumber:5,axisLine:{show:!0,onZero:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,inside:!1,length:5,lineStyle:{color:"#333",width:1}},axisLabel:{show:!0,rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}}},polar:{center:["50%","50%"],radius:"75%",startAngle:90,splitNumber:5,name:{show:!0,textStyle:{color:"#333"}},axisLine:{show:!0,lineStyle:{color:"#ccc",width:1,type:"solid"}},axisLabel:{show:!1,textStyle:{color:"#333"}},splitArea:{show:!0,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}},splitLine:{show:!0,lineStyle:{width:1,color:"#ccc"}},type:"polygon"},timeline:{show:!0,type:"time",notMerge:!1,realtime:!0,x:80,x2:80,y2:0,height:50,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,controlPosition:"left",autoPlay:!1,loop:!0,playInterval:2e3,lineStyle:{width:1,color:"#666",type:"dashed"},label:{show:!0,interval:"auto",rotate:0,textStyle:{color:"#333"}},checkpointStyle:{symbol:"auto",symbolSize:"auto",color:"auto",borderColor:"auto",borderWidth:"auto",label:{show:!1,textStyle:{color:"auto"}}},controlStyle:{normal:{color:"#333"},emphasis:{color:"#1e90ff"}},symbol:"emptyDiamond",symbolSize:4,currentIndex:0},roamController:{show:!1,x:"left",y:"top",width:80,height:120,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,handlerColor:"#6495ed",fillerColor:"#fff",step:15,mapTypeControl:null},bar:{clickable:!0,xAxisIndex:0,yAxisIndex:0,barMinHeight:0,barGap:"30%",barCategoryGap:"20%",itemStyle:{normal:{barBorderColor:"#fff",barBorderRadius:0,barBorderWidth:0,label:{show:!1}},emphasis:{barBorderColor:"#fff",barBorderRadius:0,barBorderWidth:0,label:{show:!1}}}},line:{clickable:!0,xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid",shadowColor:"rgba(0,0,0,0)",shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0}},emphasis:{label:{show:!1}}},symbolSize:2,showAllSymbol:!1},k:{clickable:!0,xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{color:"#fff",color0:"#00aa11",lineStyle:{width:1,color:"#ff3200",color0:"#00aa11"}},emphasis:{}}},scatter:{clickable:!0,xAxisIndex:0,yAxisIndex:0,symbolSize:4,large:!1,largeThreshold:2e3,itemStyle:{normal:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}},emphasis:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}}}},radar:{clickable:!0,polarIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid"}},emphasis:{label:{show:!1}}},symbolSize:2},pie:{clickable:!0,center:["50%","50%"],radius:[0,"75%"],clockWise:!0,startAngle:90,minAngle:0,selectedOffset:10,itemStyle:{normal:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1,type:"solid"}}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!1},labelLine:{show:!1,length:20,lineStyle:{width:1,type:"solid"}}}}},map:{mapType:"china",mapValuePrecision:0,showLegendSymbol:!0,hoverable:!0,clickable:!0,itemStyle:{normal:{borderColor:"rgba(0,0,0,0)",borderWidth:1,areaStyle:{color:"#ccc"},label:{show:!1,textStyle:{color:"rgb(139,69,19)"}}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,areaStyle:{color:"rgba(255,215,0,0.8)"},label:{show:!1,textStyle:{color:"rgb(100,0,0)"}}}}},force:{center:["50%","50%"],size:"100%",coolDown:.99,minRadius:10,maxRadius:20,ratioScaling:!1,large:!1,useWorker:!1,steps:1,scaling:1,gravity:1,symbol:"circle",symbolSize:0,linkSymbol:null,linkSymbolSize:[10,15],draggable:!0,clickable:!0,categories:[{}],itemStyle:{normal:{label:{show:!1},nodeStyle:{brushType:"both",color:"#f08c2e",strokeColor:"#5182ab",lineWidth:1},linkStyle:{strokeColor:"#5182ab"}},emphasis:{label:{show:!1},nodeStyle:{},linkStyle:{opacity:0}}}},chord:{clickable:!0,radius:["65%","75%"],center:["50%","50%"],padding:2,sort:"none",sortSub:"none",startAngle:90,clockWise:!0,showScale:!1,showScaleText:!1,itemStyle:{normal:{label:{show:!0,rotate:!1,distance:10},lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:1,color:"#999"}}},emphasis:{lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:1,color:"#666"}}}},matrix:[]},gauge:{center:["50%","50%"],radius:"75%",startAngle:225,endAngle:-45,min:0,max:100,precision:0,splitNumber:10,axisLine:{show:!0,lineStyle:{color:[[.2,"#228b22"],[.8,"#48b"],[1,"#ff4500"]],width:30}},axisTick:{show:!0,splitNumber:5,length:8,lineStyle:{color:"#eee",width:1,type:"solid"}},axisLabel:{show:!0,textStyle:{color:"auto"}},splitLine:{show:!0,length:30,lineStyle:{color:"#eee",width:2,type:"solid"}},pointer:{show:!0,length:"80%",width:8,color:"auto"},title:{show:!0,offsetCenter:[0,"-40%"],textStyle:{color:"#333",fontSize:15}},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:40,offsetCenter:[0,"40%"],textStyle:{color:"auto",fontSize:30}}},funnel:{clickable:!0,x:80,y:60,x2:80,y2:60,min:0,max:100,minSize:"0%",maxSize:"100%",sort:"descending",gap:0,itemStyle:{normal:{borderColor:"#fff",borderWidth:1,label:{show:!0,position:"outer"},labelLine:{show:!0,length:10,lineStyle:{width:1,type:"solid"}}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!0},labelLine:{show:!0}}}},island:{r:15,calculateStep:.1},markPoint:{clickable:!0,symbol:"pin",symbolSize:10,large:!1,effect:{show:!1,loop:!0,period:15,scaleSize:2},itemStyle:{normal:{borderWidth:2,label:{show:!0,position:"inside"}},emphasis:{label:{show:!0}}}},markLine:{clickable:!0,symbol:["circle","arrow"],symbolSize:[2,4],large:!1,effect:{show:!1,loop:!0,period:15,scaleSize:2},itemStyle:{normal:{borderWidth:1.5,label:{show:!0,position:"end"},lineStyle:{type:"dashed"}},emphasis:{label:{show:!1},lineStyle:{}}}},textStyle:{decoration:"none",fontFamily:"Arial, Verdana, sans-serif",fontFamily2:"微软雅黑",fontSize:12,fontStyle:"normal",fontWeight:"normal"},EVENT:{REFRESH:"refresh",RESTORE:"restore",RESIZE:"resize",CLICK:"click",DBLCLICK:"dblclick",HOVER:"hover",MOUSEOUT:"mouseout",DATA_CHANGED:"dataChanged",DATA_ZOOM:"dataZoom",DATA_RANGE:"dataRange",LEGEND_SELECTED:"legendSelected",MAP_SELECTED:"mapSelected",PIE_SELECTED:"pieSelected",MAGIC_TYPE_CHANGED:"magicTypeChanged",DATA_VIEW_CHANGED:"dataViewChanged",TIMELINE_CHANGED:"timelineChanged",MAP_ROAM:"mapRoam",TOOLTIP_HOVER:"tooltipHover",TOOLTIP_IN_GRID:"tooltipInGrid",TOOLTIP_OUT_GRID:"tooltipOutGrid",ROAMCONTROLLER:"roamController"},DRAG_ENABLE_TIME:120,EFFECT_ZLEVEL:7,symbolList:["circle","rectangle","triangle","diamond","emptyCircle","emptyRectangle","emptyTriangle","emptyDiamond"],loadingText:"Loading...",calculable:!1,calculableColor:"rgba(255,165,0,0.6)",calculableHolderColor:"#ccc",nameConnector:" & ",valueConnector:": ",animation:!0,addDataAnimation:!0,animationThreshold:2e3,animationDuration:2e3,animationEasing:"ExponentialOut"};return e}),r("zrender/dep/excanvas",["require"],function(e){return document.createElement("canvas").getContext?G_vmlCanvasManager=!1:function(){function f(){return this.context_||(this.context_=new I(this))}function c(e,t,n){var r=l.call(arguments,2);return function(){return e.apply(t,r.concat(l.call(arguments)))}}function h(e){return String(e).replace(/&/g,"&").replace(/"/g,""")}function p(e,t,n){e.namespaces[t]||e.namespaces.add(t,n,"#default#VML")}function d(e){p(e,"g_vml_","urn:schemas-microsoft-com:vml"),p(e,"g_o_","urn:schemas-microsoft-com:office:office");if(!e.styleSheets.ex_canvas_){var t=e.createStyleSheet();t.owningElement.id="ex_canvas_",t.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}function m(e){var t=e.srcElement;switch(e.propertyName){case"width":t.getContext().clearRect(),t.style.width=t.attributes.width.nodeValue+"px",t.firstChild.style.width=t.clientWidth+"px";break;case"height":t.getContext().clearRect(),t.style.height=t.attributes.height.nodeValue+"px",t.firstChild.style.height=t.clientHeight+"px"}}function g(e){var t=e.srcElement;t.firstChild&&(t.firstChild.style.width=t.clientWidth+"px",t.firstChild.style.height=t.clientHeight+"px")}function E(){return[[1,0,0],[0,1,0],[0,0,1]]}function S(e,t){var n=E();for(var r=0;r<3;r++)for(var i=0;i<3;i++){var s=0;for(var o=0;o<3;o++)s+=e[r][o]*t[o][i];n[r][i]=s}return n}function x(e,t){t.fillStyle=e.fillStyle,t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY,t.strokeStyle=e.strokeStyle,t.globalAlpha=e.globalAlpha,t.font=e.font,t.textAlign=e.textAlign,t.textBaseline=e.textBaseline,t.arcScaleX_=e.arcScaleX_,t.arcScaleY_=e.arcScaleY_,t.lineScale_=e.lineScale_}function N(e){var t=e.indexOf("(",3),n=e.indexOf(")",t+1),r=e.substring(t+1,n).split(",");if(r.length!=4||e.charAt(3)!="a")r[3]=1;return r}function C(e){return parseFloat(e)/100}function k(e,t,n){return Math.min(n,Math.max(t,e))}function L(e){var t,n,r,i,s,o;i=parseFloat(e[0])/360%360,i<0&&i++,s=k(C(e[1]),0,1),o=k(C(e[2]),0,1);if(s==0)t=n=r=o;else{var u=o<.5?o*(1+s):o+s-o*s,a=2*o-u;t=A(a,u,i+1/3),n=A(a,u,i),r=A(a,u,i-1/3)}return"#"+y[Math.floor(t*255)]+y[Math.floor(n*255)]+y[Math.floor(r*255)]}function A(e,t,n){return n<0&&n++,n>1&&n--,6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function M(e){if(e in O)return O[e];var t,n=1;e=String(e);if(e.charAt(0)=="#")t=e;else if(/^rgb/.test(e)){var r=N(e),t="#",i;for(var s=0;s<3;s++)r[s].indexOf("%")!=-1?i=Math.floor(C(r[s])*255):i=+r[s],t+=y[k(i,0,255)];n=+r[3]}else if(/^hsl/.test(e)){var r=N(e);t=L(r),n=r[3]}else t=T[e]||e;return O[e]={color:t,alpha:n}}function P(e){if(D[e])return D[e];var t=document.createElement("div"),n=t.style,r;try{n.font=e,r=n.fontFamily.split(",")[0]}catch(i){}return D[e]={style:n.fontStyle||_.style,variant:n.fontVariant||_.variant,weight:n.fontWeight||_.weight,size:n.fontSize||_.size,family:r||_.family}}function H(e,t){var n={};for(var r in e)n[r]=e[r];var i=parseFloat(t.currentStyle.fontSize),s=parseFloat(e.size);return typeof e.size=="number"?n.size=e.size:e.size.indexOf("px")!=-1?n.size=s:e.size.indexOf("em")!=-1?n.size=i*s:e.size.indexOf("%")!=-1?n.size=i/100*s:e.size.indexOf("pt")!=-1?n.size=s/.75:n.size=i,n}function B(e){return e.style+" "+e.variant+" "+e.weight+" "+e.size+"px '"+e.family+"'"}function F(e){return j[e]||"square"}function I(e){this.m_=E(),this.mStack_=[],this.aStack_=[],this.currentPath_=[],this.strokeStyle="#000",this.fillStyle="#000",this.lineWidth=1,this.lineJoin="miter",this.lineCap="butt",this.miterLimit=o*1,this.globalAlpha=1,this.font="12px 微软雅黑",this.textAlign="left",this.textBaseline="alphabetic",this.canvas=e;var t="width:"+e.clientWidth+"px;height:"+e.clientHeight+"px;overflow:hidden;position:absolute",n=e.ownerDocument.createElement("div");n.style.cssText=t,e.appendChild(n);var r=n.cloneNode(!1);r.style.backgroundColor="#fff",r.style.filter="alpha(opacity=0)",e.appendChild(r),this.element_=n,this.arcScaleX_=1,this.arcScaleY_=1,this.lineScale_=1}function R(e,t,n,r){e.currentPath_.push({type:"bezierCurveTo",cp1x:t.x,cp1y:t.y,cp2x:n.x,cp2y:n.y,x:r.x,y:r.y}),e.currentX_=r.x,e.currentY_=r.y}function U(e,t){var n=M(e.strokeStyle),r=n.color,i=n.alpha*e.globalAlpha,s=e.lineScale_*e.lineWidth;s<1&&(i*=s),t.push("')}function z(t,n,r,i){var s=t.fillStyle,u=t.arcScaleX_,a=t.arcScaleY_,f=i.x-r.x,l=i.y-r.y;if(s instanceof $){var c=0,h={x:0,y:0},p=0,d=1;if(s.type_=="gradient"){var v=s.x0_/u,m=s.y0_/a,g=s.x1_/u,y=s.y1_/a,b=W(t,v,m),w=W(t,g,y),E=w.x-b.x,S=w.y-b.y;c=Math.atan2(E,S)*180/Math.PI,c<0&&(c+=360),c<1e-6&&(c=0)}else{var b=W(t,s.x0_,s.y0_);h={x:(b.x-r.x)/f,y:(b.y-r.y)/l},f/=u*o,l/=a*o;var x=e.max(f,l);p=2*s.r0_/x,d=2*s.r1_/x-p}var T=s.colors_;T.sort(function(e,t){return e.offset-t.offset});var N=T.length,C=T[0].color,k=T[N-1].color,L=T[0].alpha*t.globalAlpha,A=T[N-1].alpha*t.globalAlpha,O=[];for(var _=0;_')}else if(s instanceof J){if(f&&l){var P=-r.x,H=-r.y;n.push("')}}else{var B=M(t.fillStyle),j=B.color,F=B.alpha*t.globalAlpha;n.push('')}}function W(e,t,n){var r=e.m_;return{x:o*(t*r[0][0]+n*r[1][0]+r[2][0])-u,y:o*(t*r[0][1]+n*r[1][1]+r[2][1])-u}}function X(e){return isFinite(e[0][0])&&isFinite(e[0][1])&&isFinite(e[1][0])&&isFinite(e[1][1])&&isFinite(e[2][0])&&isFinite(e[2][1])}function V(e,t,n){if(!X(t))return;e.m_=t;if(n){var r=t[0][0]*t[1][1]-t[0][1]*t[1][0];e.lineScale_=s(i(r))}}function $(e){this.type_=e,this.x0_=0,this.y0_=0,this.r0_=0,this.x1_=0,this.y1_=0,this.r1_=0,this.colors_=[]}function J(e,t){Q(e);switch(t){case"repeat":case null:case"":this.repetition_="repeat";break;case"repeat-x":case"repeat-y":case"no-repeat":this.repetition_=t;break;default:K("SYNTAX_ERR")}this.src_=e.src,this.width_=e.width,this.height_=e.height}function K(e){throw new G(e)}function Q(e){(!e||e.nodeType!=1||e.tagName!="IMG")&&K("TYPE_MISMATCH_ERR"),e.readyState!="complete"&&K("INVALID_STATE_ERR")}function G(e){this.code=this[e],this.message=e+": DOM Exception "+this.code}var e=Math,t=e.round,n=e.sin,r=e.cos,i=e.abs,s=e.sqrt,o=10,u=o/2,a=+navigator.userAgent.match(/MSIE ([\d.]+)?/)[1],l=Array.prototype.slice;d(document);var v={init:function(e){var t=e||document;t.createElement("canvas"),t.attachEvent("onreadystatechange",c(this.init_,this,t))},init_:function(e){var t=e.getElementsByTagName("canvas");for(var n=0;n'),(f||l)&&w.push('
'),w.push('
'),(f||l)&&w.push("
"),w.push("
"),this.element_.insertAdjacentHTML("BeforeEnd",w.join(""))},q.stroke=function(e){var n=[],r=!1,i=10,s=10;n.push("f.x)f.x=c.x;if(a.y==null||c.yf.y)f.y=c.y}}n.push(' ">'),e?z(this,n,a,f):U(this,n),n.push(""),this.element_.insertAdjacentHTML("beforeEnd",n.join(""))},q.fill=function(){this.stroke(!0)},q.closePath=function(){this.currentPath_.push({type:"close"})},q.save=function(){var e={};x(this,e),this.aStack_.push(e),this.mStack_.push(this.m_),this.m_=S(E(),this.m_)},q.restore=function(){this.aStack_.length&&(x(this.aStack_.pop(),this),this.m_=this.mStack_.pop())},q.translate=function(e,t){var n=[[1,0,0],[0,1,0],[e,t,1]];V(this,S(n,this.m_),!1)},q.rotate=function(e){var t=r(e),i=n(e),s=[[t,i,0],[-i,t,0],[0,0,1]];V(this,S(s,this.m_),!1)},q.scale=function(e,t){this.arcScaleX_*=e,this.arcScaleY_*=t;var n=[[e,0,0],[0,t,0],[0,0,1]];V(this,S(n,this.m_),!0)},q.transform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,S(o,this.m_),!0)},q.setTransform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,o,!0)},q.drawText_=function(e,n,r,i,s){var u=this.m_,a=1e3,f=0,l=a,c={x:0,y:0},p=[],d=H(P(this.font),this.element_),v=B(d),m=this.element_.currentStyle,g=this.textAlign.toLowerCase();switch(g){case"left":case"center":case"right":break;case"end":g=m.direction=="ltr"?"right":"left";break;case"start":g=m.direction=="rtl"?"right":"left";break;default:g="left"}switch(this.textBaseline){case"hanging":case"top":c.y=d.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":c.y=-d.size/2.25}switch(g){case"right":f=a,l=.05;break;case"center":f=l=a/2}var y=W(this,n+c.x,r+c.y);p.push(''),s?U(this,p):z(this,p,{x:-f,y:0},{x:l,y:d.size});var b=u[0][0].toFixed(3)+","+u[1][0].toFixed(3)+","+u[0][1].toFixed(3)+","+u[1][1].toFixed(3)+",0,0",w=t(y.x/o)+","+t(y.y/o);p.push('','',''),this.element_.insertAdjacentHTML("beforeEnd",p.join(""))},q.fillText=function(e,t,n,r){this.drawText_(e,t,n,r,!1)},q.strokeText=function(e,t,n,r){this.drawText_(e,t,n,r,!0)},q.measureText=function(e){if(!this.textMeasureEl_){var t='';this.element_.insertAdjacentHTML("beforeEnd",t),this.textMeasureEl_=this.element_.lastChild}var n=this.element_.ownerDocument;return this.textMeasureEl_.innerHTML="",this.textMeasureEl_.style.font=this.font,this.textMeasureEl_.appendChild(n.createTextNode(e)),{width:this.textMeasureEl_.offsetWidth}},q.clip=function(){},q.arcTo=function(){},q.createPattern=function(e,t){return new J(e,t)},$.prototype.addColorStop=function(e,t){t=M(t),this.colors_.push({offset:e,color:t.color,alpha:t.alpha})};var Y=G.prototype=new Error;Y.INDEX_SIZE_ERR=1,Y.DOMSTRING_SIZE_ERR=2,Y.HIERARCHY_REQUEST_ERR=3,Y.WRONG_DOCUMENT_ERR=4,Y.INVALID_CHARACTER_ERR=5,Y.NO_DATA_ALLOWED_ERR=6,Y.NO_MODIFICATION_ALLOWED_ERR=7,Y.NOT_FOUND_ERR=8,Y.NOT_SUPPORTED_ERR=9,Y.INUSE_ATTRIBUTE_ERR=10,Y.INVALID_STATE_ERR=11,Y.SYNTAX_ERR=12,Y.INVALID_MODIFICATION_ERR=13,Y.NAMESPACE_ERR=14,Y.INVALID_ACCESS_ERR=15,Y.VALIDATION_ERR=16,Y.TYPE_MISMATCH_ERR=17,G_vmlCanvasManager=v,CanvasRenderingContext2D=I,CanvasGradient=$,CanvasPattern=J,DOMException=G}(),G_vmlCanvasManager}),r("zrender/tool/util",["require","../dep/excanvas"],function(e){function n(e){if(typeof e=="object"&&e!==null){var r=e;if(e instanceof Array){r=[];for(var i=0,s=e.length;if&&(f=e+c+n,u.width=f,r=!0),t+h>l&&(l=t+h+n,u.height=l,r=!0),e<-c&&(c=Math.ceil(-e/n)*n,f+=c,u.width=f,r=!0),t<-h&&(h=Math.ceil(-t/n)*n,l+=h,u.height=l,r=!0),r&&a.translate(c,h)}function v(){return{x:c,y:h}}function m(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n3&&(t=Array.prototype.slice.call(t,1));var r=this._handlers[e],i=r.length;for(var s=0;s4&&(t=Array.prototype.slice.call(t,1,t.length-1));var r=t[t.length-1],i=this._handlers[e],s=i.length;for(var o=0;o1)for(var e in arguments)console.log(arguments[e])}}),r("zrender/tool/guid",[],function(){var e=2311;return function(){return"zrender__"+e++}}),r("zrender/tool/vector",[],function(){var e=typeof Float32Array=="undefined"?Array:Float32Array,t={create:function(t,n){var r=new e(2);return r[0]=t||0,r[1]=n||0,r},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e},set:function(e,t,n){return e[0]=t,e[1]=n,e},add:function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e},scaleAndAdd:function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e},sub:function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e},len:function(e){return Math.sqrt(this.lenSquare(e))},lenSquare:function(e){return e[0]*e[0]+e[1]*e[1]},mul:function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e},div:function(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e},dot:function(e,t){return e[0]*t[0]+e[1]*t[1]},scale:function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e},normalize:function(e,n){var r=t.len(n);return r===0?(e[0]=0,e[1]=0):(e[0]=n[0]/r,e[1]=n[1]/r),e},distance:function(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))},distanceSquare:function(e,t){return(e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])},negate:function(e,t){return e[0]=-t[0],e[1]=-t[1],e},lerp:function(e,t,n,r){return e[0]=t[0]+r*(n[0]-t[0]),e[1]=t[1]+r*(n[1]-t[1]),e},applyTransform:function(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[2]*i+n[4],e[1]=n[1]*r+n[3]*i+n[5],e},min:function(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e},max:function(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}};return t.length=t.len,t.lengthSquare=t.lenSquare,t.dist=t.distance,t.distSquare=t.distanceSquare,t}),r("zrender/tool/matrix",[],function(){var e=typeof Float32Array=="undefined"?Array:Float32Array,t={create:function(){var n=new e(6);return t.identity(n),n},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},mul:function(e,t,n){return e[0]=t[0]*n[0]+t[2]*n[1],e[1]=t[1]*n[0]+t[3]*n[1],e[2]=t[0]*n[2]+t[2]*n[3],e[3]=t[1]*n[2]+t[3]*n[3],e[4]=t[0]*n[4]+t[2]*n[5]+t[4],e[5]=t[1]*n[4]+t[3]*n[5]+t[5],e},translate:function(e,t,n){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+n[0],e[5]=t[5]+n[1],e},rotate:function(e,t,n){var r=t[0],i=t[2],s=t[4],o=t[1],u=t[3],a=t[5],f=Math.sin(n),l=Math.cos(n);return e[0]=r*l+o*f,e[1]=-r*f+o*l,e[2]=i*l+u*f,e[3]=-i*f+l*u,e[4]=l*s+f*a,e[5]=l*a-f*s,e},scale:function(e,t,n){var r=n[0],i=n[1];return e[0]=t[0]*r,e[1]=t[1]*i,e[2]=t[2]*r,e[3]=t[3]*i,e[4]=t[4]*r,e[5]=t[5]*i,e},invert:function(e,t){var n=t[0],r=t[2],i=t[4],s=t[1],o=t[3],u=t[5],a=n*o-s*r;return a?(a=1/a,e[0]=o*a,e[1]=-s*a,e[2]=-r*a,e[3]=n*a,e[4]=(r*u-o*i)*a,e[5]=(s*i-n*u)*a,e):null},mulVector:function(e,t,n){var r=t[0],i=t[2],s=t[4],o=t[1],u=t[3],a=t[5];return e[0]=n[0]*r+n[1]*i+s,e[1]=n[0]*o+n[1]*u+a,e}};return t}),r("zrender/Handler",["require","./config","./tool/env","./tool/event","./tool/util","./tool/vector","./tool/matrix","./mixin/Eventful"],function(e){function c(e,t){return function(n){return e.call(t,n)}}function h(e,t){return function(n,r,i){return e.call(t,n,r,i)}}function p(e){var t=f.length;while(t--){var n=f[t];e["_"+n+"Handler"]=c(l[n],e)}}function m(e,t,n){if(this._draggingTarget&&this._draggingTarget.id==e.id||e.isSilent())return!1;var r=this._event;if(e.isCover(t,n)){e.hoverable&&this.storage.addHover(e);var i=e.parent;while(i){if(i.clipShape&&!i.clipShape.isCover(this._mouseX,this._mouseY))return!1;i=i.parent}return this._lastHover!=e&&(this._processOutShape(r),this._processDragLeave(r),this._lastHover=e,this._processDragEnter(r)),this._processOverShape(r),this._processDragOver(r),this._hasfound=1,!0}return!1}var t=e("./config"),n=e("./tool/env"),r=e("./tool/event"),i=e("./tool/util"),s=e("./tool/vector"),o=e("./tool/matrix"),u=t.EVENT,a=e("./mixin/Eventful"),f=["resize","click","dblclick","mousewheel","mousemove","mouseout","mouseup","mousedown","touchstart","touchend","touchmove"],l={resize:function(e){e=e||window.event,this._lastHover=null,this._isMouseDown=0,this.dispatch(u.RESIZE,e)},click:function(e){e=this._zrenderEventFixed(e);var t=this._lastHover;(t&&t.clickable||!t)&&this._dispatchAgency(t,u.CLICK,e),this._mousemoveHandler(e)},dblclick:function(e){e=this._zrenderEventFixed(e);var t=this._lastHover;(t&&t.clickable||!t)&&this._dispatchAgency(t,u.DBLCLICK,e),this._mousemoveHandler(e)},mousewheel:function(e){e=this._zrenderEventFixed(e);var t=e.wheelDelta||-e.detail,n=t>0?1.1:1/1.1,r=this.painter.getLayers(),i=!1;for(var s in r)if(s!=="hover"){var o=r[s],a=o.position;if(o.zoomable){o.__zoom=o.__zoom||1;var f=o.__zoom;f*=n,f=Math.max(Math.min(o.maxZoom,f),o.minZoom),n=f/o.__zoom,o.__zoom=f,a[0]-=(this._mouseX-a[0])*(n-1),a[1]-=(this._mouseY-a[1])*(n-1),o.scale[0]*=n,o.scale[1]*=n,o.dirty=!0,i=!0}}i&&this.painter.refresh(),this._dispatchAgency(this._lastHover,u.MOUSEWHEEL,e),this._mousemoveHandler(e)},mousemove:function(e){if(this.painter.isLoading())return;e=this._zrenderEventFixed(e),this._lastX=this._mouseX,this._lastY=this._mouseY,this._mouseX=r.getX(e),this._mouseY=r.getY(e);var t=this._mouseX-this._lastX,n=this._mouseY-this._lastY;this._processDragStart(e),this._hasfound=0,this._event=e,this._iterateAndFindHover();if(!this._hasfound){if(!this._draggingTarget||this._lastHover&&this._lastHover!=this._draggingTarget)this._processOutShape(e),this._processDragLeave(e);this._lastHover=null,this.storage.delHover(),this.painter.clearHover()}var i="default";if(this._draggingTarget)this.storage.drift(this._draggingTarget.id,t,n),this.storage.addHover(this._draggingTarget);else if(this._isMouseDown){var s=this.painter.getLayers(),o=!1;for(var a in s)if(a!=="hover"){var f=s[a];f.panable&&(i="move",f.position[0]+=t,f.position[1]+=n,o=!0,f.dirty=!0)}o&&this.painter.refresh()}this._draggingTarget||this._hasfound&&this._lastHover.draggable?i="move":this._hasfound&&this._lastHover.clickable&&(i="pointer"),this.root.style.cursor=i,this._dispatchAgency(this._lastHover,u.MOUSEMOVE,e),(this._draggingTarget||this._hasfound||this.storage.hasHoverShape())&&this.painter.refreshHover()},mouseout:function(e){e=this._zrenderEventFixed(e);var t=e.toElement||e.relatedTarget;if(t!=this.root)while(t&&t.nodeType!=9){if(t==this.root){this._mousemoveHandler(e);return}t=t.parentNode}e.zrenderX=this._lastX,e.zrenderY=this._lastY,this.root.style.cursor="default",this._isMouseDown=0,this._processOutShape(e),this._processDrop(e),this._processDragEnd(e),this.painter.isLoading()||this.painter.refreshHover(),this.dispatch(u.GLOBALOUT,e)},mousedown:function(e){if(this._lastDownButton==2){this._lastDownButton=e.button,this._mouseDownTarget=null;return}this._lastMouseDownMoment=new Date,e=this._zrenderEventFixed(e),this._isMouseDown=1,this._mouseDownTarget=this._lastHover,this._dispatchAgency(this._lastHover,u.MOUSEDOWN,e),this._lastDownButton=e.button},mouseup:function(e){e=this._zrenderEventFixed(e),this.root.style.cursor="default",this._isMouseDown=0,this._mouseDownTarget=null,this._dispatchAgency(this._lastHover,u.MOUSEUP,e),this._processDrop(e),this._processDragEnd(e)},touchstart:function(e){e=this._zrenderEventFixed(e,!0),this._lastTouchMoment=new Date,this._mobildFindFixed(e),this._mousedownHandler(e)},touchmove:function(e){e=this._zrenderEventFixed(e,!0),this._mousemoveHandler(e),this._isDragging&&r.stop(e)},touchend:function(e){e=this._zrenderEventFixed(e,!0),this._mouseupHandler(e);var t=new Date;t-this._lastTouchMoment=0;u--){var a=t[u];n!==a.zlevel&&(r=this.painter.getLayer(a.zlevel,r),i[0]=this._mouseX,i[1]=this._mouseY,r.needTransform&&(o.invert(e,r.transform),s.applyTransform(i,i,e)));if(this._findHover(a,i[0],i[1]))break}}}();var v=[{x:10},{x:-20},{x:10,y:10},{y:-20}];return d.prototype._mobildFindFixed=function(e){this._lastHover=null,this._mouseX=e.zrenderX,this._mouseY=e.zrenderY,this._event=e,this._iterateAndFindHover();for(var t=0;!this._lastHover&&t-n&&en||e<-n}function l(e,t,n,r,i){var s=1-i;return s*s*(s*e+3*i*t)+i*i*(i*r+3*s*n)}function c(e,t,n,r,i){var s=1-i;return 3*(((t-e)*s+2*(n-t)*i)*s+(r-n)*i*i)}function h(e,t,n,s,o,u){var f=s+3*(t-n)-e,l=3*(n-t*2+e),c=3*(t-e),h=e-o,p=l*l-3*f*c,d=l*c-9*f*h,v=c*c-3*l*h,m=0;if(a(p)&&a(d))if(a(l))u[0]=0;else{var g=-c/l;g>=0&&g<=1&&(u[m++]=g)}else{var y=d*d-4*p*v;if(a(y)){var b=d/p,g=-l/f+b,w=-b/2;g>=0&&g<=1&&(u[m++]=g),w>=0&&w<=1&&(u[m++]=w)}else if(y>0){var E=Math.sqrt(y),S=p*l+1.5*f*(-d+E),x=p*l+1.5*f*(-d-E);S<0?S=-Math.pow(-S,i):S=Math.pow(S,i),x<0?x=-Math.pow(-x,i):x=Math.pow(x,i);var g=(-l-(S+x))/(3*f);g>=0&&g<=1&&(u[m++]=g)}else{var T=(2*p*l-3*f*d)/(2*Math.sqrt(p*p*p)),N=Math.acos(T)/3,C=Math.sqrt(p),k=Math.cos(N),g=(-l-2*C*k)/(3*f),w=(-l+C*(k+r*Math.sin(N)))/(3*f),L=(-l+C*(k-r*Math.sin(N)))/(3*f);g>=0&&g<=1&&(u[m++]=g),w>=0&&w<=1&&(u[m++]=w),L>=0&&L<=1&&(u[m++]=L)}}return m}function p(e,t,n,r,i){var s=6*n-12*t+6*e,o=9*t+3*r-3*e-9*n,u=3*t-3*e,l=0;if(a(o)){if(f(s)){var c=-u/s;c>=0&&c<=1&&(i[l++]=c)}}else{var h=s*s-4*o*u;if(a(h))i[0]=-s/(2*o);else if(h>0){var p=Math.sqrt(h),c=(-s+p)/(2*o),d=(-s-p)/(2*o);c>=0&&c<=1&&(i[l++]=c),d>=0&&d<=1&&(i[l++]=d)}}return l}function d(e,t,n,r,i,s){var o=(t-e)*i+e,u=(n-t)*i+t,a=(r-n)*i+n,f=(u-o)*i+o,l=(a-u)*i+u,c=(l-f)*i+f;s[0]=e,s[1]=o,s[2]=f,s[3]=c,s[4]=c,s[5]=l,s[6]=a,s[7]=r}function v(e,r,i,a,f,c,h,p,d,v,m){var g,y=.005,b=Infinity;s[0]=d,s[1]=v;for(var w=0;w<1;w+=.05){o[0]=l(e,i,f,h,w),o[1]=l(r,a,c,p,w);var E=t.distSquare(s,o);E=0&&E=0&&c<=1&&(i[l++]=c)}}else{var h=o*o-4*s*u;if(a(h)){var c=-o/(2*s);c>=0&&c<=1&&(i[l++]=c)}else if(h>0){var p=Math.sqrt(h),c=(-o+p)/(2*s),d=(-o-p)/(2*s);c>=0&&c<=1&&(i[l++]=c),d>=0&&d<=1&&(i[l++]=d)}}return l}function b(e,t,n){var r=e+n-2*t;return r===0?.5:(e-t)/r}function w(e,r,i,a,f,l,c,h,p){var d,v=.005,g=Infinity;s[0]=c,s[1]=h;for(var y=0;y<1;y+=.05){o[0]=m(e,i,f,y),o[1]=m(r,a,l,y);var b=t.distSquare(s,o);b=0&&bt+u&&o>r+u||oe+u&&s>n+u||st+h&&c>i+h&&c>o+h&&c>a+h||ce+h&&l>r+h&&l>s+h&&l>u+h||lt+l&&f>i+l&&f>o+l||fe+l&&a>r+l&&a>s+l||an||h+ci&&(i+=f);var p=Math.atan2(a,u);return p<0&&(p+=f),p>=r&&p<=i||p+f>=r&&p+f<=i}function b(e,t,n,r){var t=Math.max(t,10);for(var i=0,s=e.length-1;in*n}function E(e,t,n,r,i,s){return i>=e&&i<=e+n&&s>=t&&s<=t+r}function S(e,t,n,r,i){return(r-e)*(r-e)+(i-t)*(i-t)=360)return!0;var r=(360-Math.atan2(n-e.y,t-e.x)/Math.PI*180)%360,i=(360+e.endAngle)%360,s=(360+e.startAngle)%360;return i>s?r>=s&&r<=i:!(r>=i&&r<=s)}function T(e,t,n){var r=e.length,i=0;for(var s=0,o=r-1;st&&s>r||si?o:0}function L(){var e=k[0];k[0]=k[1],k[1]=e}function A(e,t,r,i,s,o,u,a,f,l){if(l>t&&l>i&&l>o&&l>a||l1&&L(),d=n.cubicAt(t,i,o,a,k[0]),p>1&&(v=n.cubicAt(t,i,o,a,k[1]))),p==2?gt&&a>i&&a>o||a=0&&l<=1){var c=0,h=n.quadraticAt(t,i,o,l);for(var p=0;pu)continue;C[p]u?0:on||u<-n)return 0;var a=Math.sqrt(n*n-u*u);C[0]=-a,C[1]=a,s?(r=l(i),i=l(r)):(r=l(r),i=l(i)),r>i&&(i+=f);var c=0;for(var h=0;h<2;h++){var p=C[h];if(p+e>o){var d=Math.atan2(u,p),v=s?1:-1;d<0&&(d=f+d);if(d>=r&&d<=i||d+f>=r&&d+f<=i)d>Math.PI/2&&d0){h&&(s+=N(o,u,a,f,r,i));if(s!==0)return!0}a=b[b.length-2],f=b[b.length-1],l=!1}switch(d.command){case"M":o=b[0],u=b[1];break;case"L":if(c&&v(o,u,b[0],b[1],t,r,i))return!0;h&&(s+=N(o,u,b[0],b[1],r,i)),o=b[0],u=b[1];break;case"C":if(c&&m(o,u,b[0],b[1],b[2],b[3],b[4],b[5],t,r,i))return!0;h&&(s+=A(o,u,b[0],b[1],b[2],b[3],b[4],b[5],r,i)),o=b[4],u=b[5];break;case"Q":if(c&&g(o,u,b[0],b[1],b[2],b[3],t,r,i))return!0;h&&(s+=O(o,u,b[0],b[1],b[2],b[3],r,i)),o=b[2],u=b[3];break;case"A":var w=b[0],E=b[1],S=b[2],x=b[3],T=b[4],C=b[5],k=Math.cos(T)*S+w,L=Math.sin(T)*x+E;s+=N(o,u,k,L);var _=(r-w)*x/S+w;if(c&&y(w,E,x,T,T+C,1-b[7],t,_,i))return!0;h&&(s+=M(w,E,x,T,T+C,1-b[7],_,i)),o=Math.cos(T+C)*S+w,u=Math.sin(T+C)*x+E;break;case"z":if(c&&v(o,u,a,f,t,r,i))return!0;l=!0}}return h&&(s+=N(o,u,a,f,r,i)),s!==0}function D(e,n){var s=e+":"+n;if(i[s])return i[s];r=r||t.getContext(),r.save(),n&&(r.font=n),e=(e+"").split("\n");var u=0;for(var f=0,l=e.length;fa&&(o=0,i={}),u}function P(e,n){var i=e+":"+n;if(s[i])return s[i];r=r||t.getContext(),r.save(),n&&(r.font=n),e=(e+"").split("\n");var o=(r.measureText("国").width+2)*e.length;return r.restore(),s[i]=o,++u>a&&(u=0,s={}),o}var t=e("./util"),n=e("./curve"),r,i={},s={},o=0,u=0,a=5e3,f=Math.PI*2,C=[-1,-1,-1],k=[-1,-1];return{isInside:c,isOutside:d,getTextWidth:D,getTextHeight:P,isInsidePath:_,isInsidePolygon:T,isInsideSector:x,isInsideCircle:S,isInsideLine:v,isInsideRect:E,isInsideBrokenLine:b}}),r("zrender/mixin/Transformable",["require","../tool/matrix","../tool/vector"],function(e){function s(e){return e>-i&&ei||e<-i}var t=e("../tool/matrix"),n=e("../tool/vector"),r=[0,0],i=5e-5,u=function(){this.position||(this.position=[0,0]),typeof this.rotation=="undefined"&&(this.rotation=[0,0,0]),this.scale||(this.scale=[1,1,0,0]),this.needLocalTransform=!1,this.needTransform=!1};return u.prototype={constructor:u,updateNeedTransform:function(){this.needLocalTransform=o(this.rotation[0])||o(this.position[0])||o(this.position[1])||o(this.scale[0]-1)||o(this.scale[1]-1)},updateTransform:function(){this.updateNeedTransform(),this.parent?this.needTransform=this.needLocalTransform||this.parent.needTransform:this.needTransform=this.needLocalTransform;if(!this.needTransform)return;var e=this.transform||t.create();t.identity(e);if(this.needLocalTransform){if(o(this.scale[0])||o(this.scale[1])){r[0]=-this.scale[2]||0,r[1]=-this.scale[3]||0;var n=o(r[0])||o(r[1]);n&&t.translate(e,e,r),t.scale(e,e,this.scale),n&&(r[0]=-r[0],r[1]=-r[1],t.translate(e,e,r))}if(this.rotation instanceof Array){if(this.rotation[0]!==0){r[0]=-this.rotation[1]||0,r[1]=-this.rotation[2]||0;var n=o(r[0])||o(r[1]);n&&t.translate(e,e,r),t.rotate(e,e,this.rotation[0]),n&&(r[0]=-r[0],r[1]=-r[1],t.translate(e,e,r))}}else this.rotation!==0&&t.rotate(e,e,this.rotation);(o(this.position[0])||o(this.position[1]))&&t.translate(e,e,this.position)}this.transform=e,this.parent&&this.parent.needTransform&&(this.needLocalTransform?t.mul(this.transform,this.parent.transform,this.transform):t.copy(this.transform,this.parent.transform))},setTransform:function(e){if(this.needTransform){var t=this.transform;e.transform(t[0],t[1],t[2],t[3],t[4],t[5])}},lookAt:function(){var e=n.create();return function(r){this.transform||(this.transform=t.create());var i=this.transform;n.sub(e,r,this.position);if(s(e[0])&&s(e[1]))return;n.normalize(e,e),i[2]=e[0]*this.scale[1],i[3]=e[1]*this.scale[1],i[0]=e[1]*this.scale[0],i[1]=-e[0]*this.scale[0],i[4]=this.position[0],i[5]=this.position[1],this.decomposeTransform()}}(),decomposeTransform:function(){if(!this.transform)return;var e=this.transform,t=e[0]*e[0]+e[1]*e[1],n=this.position,r=this.scale,i=this.rotation;o(t-1)&&(t=Math.sqrt(t));var s=e[2]*e[2]+e[3]*e[3];o(s-1)&&(s=Math.sqrt(s)),n[0]=e[4],n[1]=e[5],r[0]=t,r[1]=s,r[2]=r[3]=0,i[0]=Math.atan2(-e[1]/s,e[0]/t),i[1]=i[2]=0}},u}),r("zrender/tool/color",["require","../tool/util"],function(e){function f(e){r=e}function l(){r=i}function c(e,t){return e|=0,t=t||r,t[e%t.length]}function h(e){s=e}function p(){o=s}function d(){return s}function v(e,r,i,s,o,u,a){n||(n=t.getContext());var f=n.createRadialGradient(e,r,i,s,o,u);for(var l=0,c=a.length;l1)for(var i=0,s=r-1;i1?Math.ceil(e):e});if(t.indexOf("hex")>-1)return"#"+((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1);if(t.indexOf("hs")>-1){var n=q(e.slice(1,3),function(e){return e+"%"});e[1]=n[0],e[2]=n[1]}return t.indexOf("a")>-1?(e.length===3&&e.push(1),e[3]=R(e[3],[0,1]),t+"("+e.slice(0,4).join(",")+")"):t+"("+e.slice(0,3).join(",")+")"}}function w(e){e=_(e),e.indexOf("rgba")<0&&(e=S(e));var t=[],n=0;return e.replace(/[\d.]+/g,function(e){n<3?e|=0:e=+e,t[n++]=e}),t}function E(e,t){var n=F(e),r=n[3];return typeof r=="undefined"&&(r=1),e.indexOf("hsb")>-1?n=U(n):e.indexOf("hsl")>-1&&(n=z(n)),t.indexOf("hsb")>-1||t.indexOf("hsv")>-1?n=X(n):t.indexOf("hsl")>-1&&(n=V(n)),n[3]=r,b(n,t)}function S(e){return E(e,"rgba")}function x(e){return E(e,"rgb")}function T(e){return E(e,"hex")}function N(e){return E(e,"hsva")}function C(e){return E(e,"hsv")}function k(e){return E(e,"hsba")}function L(e){return E(e,"hsb")}function A(e){return E(e,"hsla")}function O(e){return E(e,"hsl")}function M(e){for(var t in a)if(T(a[t])===T(e))return t;return null}function _(e){return String(e).replace(/\s+/g,"")}function D(e){a[e]&&(e=a[e]),e=_(e),e=e.replace(/hsv/i,"hsb");if(/^#[\da-f]{3}$/i.test(e)){e=parseInt(e.slice(1),16);var t=(e&3840)<<8,n=(e&240)<<4,r=e&15;e="#"+((1<<24)+(t<<4)+t+(n<<4)+n+(r<<4)+r).toString(16).slice(1)}return e}function P(e,t){var n=t>0?1:-1;typeof t=="undefined"&&(t=0),t=Math.abs(t)>1?1:Math.abs(t),e=x(e);var r=F(e);for(var i=0;i<3;i++)n===1?r[i]=r[i]*(1-t)|0:r[i]=(255-r[i])*t+r[i]|0;return"rgb("+r.join(",")+")"}function H(e){var t=F(S(e));return t=q(t,function(e){return 255-e}),b(t,"rgb")}function B(e,t,n){typeof n=="undefined"&&(n=.5),n=1-R(n,[0,1]);var r=n*2-1,i=F(S(e)),s=F(S(t)),o=i[3]-s[3],u=((r*o===-1?r:(r+o)/(1+r*o))+1)/2,a=1-u,f=[];for(var l=0;l<3;l++)f[l]=i[l]*u+s[l]*a;var c=i[3]*n+s[3]*(1-n);return c=Math.max(0,Math.min(1,c)),i[3]===1&&s[3]===1?b(f,"rgb"):(f[3]=c,b(f,"rgba"))}function j(){return"#"+Math.random().toString(16).slice(2,8)}function F(e){e=D(e);var t=e.match(u);if(t===null)throw new Error("The color format error");var n,r,i=[],s;if(t[2])n=t[2].replace("#","").split(""),s=[n[0]+n[1],n[2]+n[3],n[4]+n[5]],i=q(s,function(e){return R(parseInt(e,16),[0,255])});else if(t[4]){var o=t[4].split(",");r=o[3],s=o.slice(0,3),i=q(s,function(e){return e=Math.floor(e.indexOf("%")>0?parseInt(e,0)*2.55:e),R(e,[0,255])}),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}else if(t[5]||t[6]){var a=(t[5]||t[6]).split(","),f=parseInt(a[0],0)/360,l=a[1],c=a[2];r=a[3],i=q([l,c],function(e){return R(parseFloat(e)/100,[0,1])}),i.unshift(f),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}return i}function I(e,t){t===null&&(t=1);var n=F(S(e));return n[3]=R(Number(t).toFixed(4),[0,1]),b(n,"rgba")}function q(e,t){if(typeof t!="function")throw new TypeError;var n=e?e.length:0;for(var r=0;r=t[1]&&(e=t[1]),e}function U(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u=t*6;u===6&&(u=0);var a=u|0,f=r*(1-n),l=r*(1-n*(u-a)),c=r*(1-n*(1-(u-a))),h=0,p=0,d=0;a===0?(h=r,p=c,d=f):a===1?(h=l,p=r,d=f):a===2?(h=f,p=r,d=c):a===3?(h=f,p=l,d=r):a===4?(h=c,p=f,d=r):(h=r,p=f,d=l),i=h*255,s=p*255,o=d*255}return[i,s,o]}function z(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u;r<.5?u=r*(1+n):u=r+n-n*r;var a=2*r-u;i=255*W(a,u,t+1/3),s=255*W(a,u,t),o=255*W(a,u,t-1/3)}return[i,s,o]}function W(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function X(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=s,a,f;if(o===0)a=0,f=0;else{f=o/s;var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}function V(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=(s+i)/2,a,f;if(o===0)a=0,f=0;else{u<.5?f=o/(s+i):f=o/(2-s-i);var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}var t=e("../tool/util"),n,r=["#ff9277"," #dddd00"," #ffc877"," #bbe3ff"," #d5ffbb","#bbbbff"," #ddb000"," #b0dd00"," #e2bbff"," #ffbbe3","#ff7777"," #ff9900"," #83dd00"," #77e3ff"," #778fff","#c877ff"," #ff77ab"," #ff6600"," #aa8800"," #77c7ff","#ad77ff"," #ff77ff"," #dd0083"," #777700"," #00aa00","#0088aa"," #8400dd"," #aa0088"," #dd0000"," #772e00"],i=r,s="rgba(255,255,0,0.5)",o=s,u=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,a={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#789",lightslategrey:"#789",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#f0f",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"};return{customPalette:f,resetPalette:l,getColor:c,getHighlightColor:d,customHighlight:h,resetHighlight:p,getRadialGradient:v,getLinearGradient:m,getGradientColors:y,getStepColors:g,reverse:H,mix:B,lift:P,trim:_,random:j,toRGB:x,toRGBA:S,toHex:T,toHSL:O,toHSLA:A,toHSB:L,toHSBA:k,toHSV:C,toHSVA:N,toName:M,toColor:b,toArray:w,alpha:I,getData:F}}),r("zrender/shape/Base",["require","../tool/matrix","../tool/guid","../tool/util","../tool/log","../mixin/Transformable","../mixin/Eventful","../tool/area","../tool/area","../tool/color","../tool/area"],function(e){function u(t,n,r,i,s,o,u){s&&(t.font=s),t.textAlign=o,t.textBaseline=u;var f=a(n,r,i,s,o,u);n=(n+"").split("\n");var l=e("../tool/area").getTextHeight("国",s);switch(u){case"top":i=f.y;break;case"bottom":i=f.y+l;break;default:i=f.y+l/2}for(var c=0,h=n.length;c0&&e.stroke();break;default:e.fill()}this.drawText(e,n,this.style),e.restore()};var l=[["color","fillStyle"],["strokeColor","strokeStyle"],["opacity","globalAlpha"],["lineCap","lineCap"],["lineJoin","lineJoin"],["miterLimit","miterLimit"],["lineWidth","lineWidth"],["shadowBlur","shadowBlur"],["shadowColor","shadowColor"],["shadowOffsetX","shadowOffsetX"],["shadowOffsetY","shadowOffsetY"]];return f.prototype.setContext=function(e,t){for(var n=0,r=l.length;n=i.x&&t<=i.x+i.width&&n>=i.y&&n<=i.y+i.height?e("../tool/area").isInside(this,this.style,t,n):!1},f.prototype.drawText=function(e,t,n){if(typeof t.text=="undefined"||t.text===!1)return;var r=t.textColor||t.color||t.strokeColor;e.fillStyle=r;var i=10,s,o,a,f,l=t.textPosition||this.textPosition||"top";switch(l){case"inside":case"top":case"bottom":case"left":case"right":if(this.getRect){var c=(n||t).__rect||this.getRect(n||t);switch(l){case"inside":a=c.x+c.width/2,f=c.y+c.height/2,s="center",o="middle",t.brushType!="stroke"&&r==t.color&&(e.fillStyle="#fff");break;case"left":a=c.x-i,f=c.y+c.height/2,s="end",o="middle";break;case"right":a=c.x+c.width+i,f=c.y+c.height/2,s="start",o="middle";break;case"top":a=c.x+c.width/2,f=c.y-i,s="center",o="bottom";break;case"bottom":a=c.x+c.width/2,f=c.y+c.height+i,s="center",o="top"}}break;case"start":case"end":var h,p,d,v;if(typeof t.pointList!="undefined"){var m=t.pointList;if(m.length<2)return;var g=m.length;switch(l){case"start":h=m[0][0],p=m[1][0],d=m[0][1],v=m[1][1];break;case"end":h=m[g-2][0],p=m[g-1][0],d=m[g-2][1],v=m[g-1][1]}}else h=t.xStart||0,p=t.xEnd||0,d=t.yStart||0,v=t.yEnd||0;switch(l){case"start":s=hi&&(c=u+a,u*=i/c,a*=i/c),f+l>i&&(c=f+l,f*=i/c,l*=i/c),a+f>s&&(c=a+f,a*=s/c,f*=s/c),u+l>s&&(c=u+l,u*=s/c,l*=s/c),e.moveTo(n+u,r),e.lineTo(n+i-a,r),a!==0&&e.quadraticCurveTo(n+i,r,n+i,r+a),e.lineTo(n+i,r+s-f),f!==0&&e.quadraticCurveTo(n+i,r+s,n+i-f,r+s),e.lineTo(n+l,r+s),l!==0&&e.quadraticCurveTo(n,r+s,n,r+s-l),e.lineTo(n,r+u),u!==0&&e.quadraticCurveTo(n,r,n+u,r)},buildPath:function(e,t){t.radius?this._buildRadiusPath(e,t):(e.moveTo(t.x,t.y),e.lineTo(t.x+t.width,t.y),e.lineTo(t.x+t.width,t.y+t.height),e.lineTo(t.x,t.y+t.height),e.lineTo(t.x,t.y)),e.closePath();return},getRect:function(e){if(e.__rect)return e.__rect;var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,e.__rect={x:Math.round(e.x-t/2),y:Math.round(e.y-t/2),width:e.width+t,height:e.height+t},e.__rect}},e("../tool/util").inherits(n,t),n}),r("zrender/loadingEffect/Base",["require","../tool/util","../shape/Text","../shape/Rectangle"],function(e){function o(e){this.setOptions(e)}var t=e("../tool/util"),n=e("../shape/Text"),r=e("../shape/Rectangle"),i="Loading...",s="normal 16px Arial";return o.prototype.createTextShape=function(e){return new n({highlightStyle:t.merge({x:this.canvasWidth/2,y:this.canvasHeight/2,text:i,textAlign:"center",textBaseline:"middle",textFont:s,color:"#333",brushType:"fill"},e,!0)})},o.prototype.createBackgroundShape=function(e){return new r({highlightStyle:{x:0,y:0,width:this.canvasWidth,height:this.canvasHeight,brushType:"fill",color:e}})},o.prototype.start=function(e){function t(t){e.storage.addHover(t)}function n(){e.refreshHover()}this.canvasWidth=e._width,this.canvasHeight=e._height,this.loadingTimer=this._start(t,n)},o.prototype._start=function(){return setInterval(function(){},1e4)},o.prototype.stop=function(){clearInterval(this.loadingTimer)},o.prototype.setOptions=function(e){this.options=e||{}},o.prototype.adjust=function(e,t){return e<=t[0]?e=t[0]:e>=t[1]&&(e=t[1]),e},o.prototype.getLocation=function(e,t,n){var r=e.x!=null?e.x:"center";switch(r){case"center":r=Math.floor((this.canvasWidth-t)/2);break;case"left":r=0;break;case"right":r=this.canvasWidth-t}var i=e.y!=null?e.y:"center";switch(i){case"center":i=Math.floor((this.canvasHeight-n)/2);break;case"top":i=0;break;case"bottom":i=this.canvasHeight-n}return{x:r,y:i,width:t,height:n}},o}),r("zrender/shape/Image",["require","./Base","../tool/util"],function(e){var t=[],n,r=e("./Base"),i=function(e){r.call(this,e),this._imageCache={}};return i.prototype={type:"image",brush:function(e,r,i){var s=this.style||{};r&&(s=this.getHighlightStyle(s,this.highlightStyle||{}));var o=s.image,u=this;if(typeof o=="string"){var a=o;this._imageCache[a]?o=this._imageCache[a]:(o=new Image,o.onload=function(){o.onload=null,clearTimeout(n),t.push(u),n=setTimeout(function(){i&&i(t),t=[]},10)},o.src=a,this._imageCache[a]=o)}if(o){if(o.nodeName.toUpperCase()=="IMG")if(window.ActiveXObject){if(o.readyState!="complete")return}else if(!o.complete)return;var f=s.width||o.width,l=s.height||o.height,c=s.x,h=s.y;if(!o.width||!o.height)return;e.save(),this.setContext(e,s),this.setTransform(e);if(s.sWidth&&s.sHeight){var p=s.sx||0,d=s.sy||0;e.drawImage(o,p,d,s.sWidth,s.sHeight,c,h,f,l)}else if(s.sx&&s.sy){var p=s.sx,d=s.sy,v=f-p,m=l-d;e.drawImage(o,p,d,v,m,c,h,f,l)}else e.drawImage(o,c,h,f,l);s.width||(s.width=f),s.height||(s.height=l),this.style.width||(this.style.width=f),this.style.height||(this.style.height=l),this.drawText(e,s,this.style),e.restore()}},getRect:function(e){return{x:e.x,y:e.y,width:e.width,height:e.height}},clearCache:function(){this._imageCache={}}},e("../tool/util").inherits(i,r),i}),r("zrender/Painter",["require","./config","./tool/util","./tool/log","./tool/matrix","./loadingEffect/Base","./mixin/Transformable","./shape/Image"],function(e){function f(){return!1}function l(){}function h(e,t,n){var r=document.createElement(t),i=n._width,s=n._height;return r.style.position="absolute",r.style.left=0,r.style.top=0,r.style.width=i+"px",r.style.height=s+"px",r.setAttribute("width",i*u),r.setAttribute("height",s*u),r.setAttribute("data-zr-dom-id",e),r}var t=e("./config"),n=e("./tool/util"),r=e("./tool/log"),i=e("./tool/matrix"),s=e("./loadingEffect/Base"),o=e("./mixin/Transformable"),u=window.devicePixelRatio||1;u=Math.max(u,1);var a=window.G_vmlCanvasManager,c=function(e,t){this.root=e,this.storage=t,e.innerHTML="",this._width=this._getWidth(),this._height=this._getHeight();var n=document.createElement("div");this._domRoot=n,n.style.position="relative",n.style.overflow="hidden",n.style.width=this._width+"px",n.style.height=this._height+"px",e.appendChild(n),this._layers={},this._layerConfig={},this._loadingEffect=new s({}),this.shapeToImage=this._createShapeToImageProcessor(),this._bgDom=h("bg","div",this),n.appendChild(this._bgDom),this._bgDom.onselectstart=f,this._bgDom.style["-webkit-user-select"]="none",this._bgDom.style["user-select"]="none";var r=new p("_zrender_hover_",this);this._layers.hover=r,n.appendChild(r.dom),r.initContext(),r.dom.onselectstart=f,r.dom.style["-webkit-user-select"]="none",r.dom.style["user-select"]="none";var i=this;this.updatePainter=function(e,t){i.refreshShapes(e,t)}};c.prototype.render=function(e){return this.isLoading()&&this.hideLoading(),this.refresh(e,!0),this},c.prototype.refresh=function(e,t){var n=this.storage.getShapeList(!0);return this._paintList(n,t),typeof e=="function"&&e(),this},c.prototype._paintList=function(e,n){typeof n=="undefined"&&(n=!1),this._updateLayerStatus(e);var s,o,u;for(var f in this._layers)f!=="hover"&&(this._layers[f].unusedCount++,this._layers[f].updateTransform());var l=[];for(var c=0,h=e.length;c0},s.prototype.addRoot=function(e){e instanceof n&&e.addChildrenToStorage(this),this.addToMap(e),this._roots.push(e)},s.prototype.delRoot=function(e){if(typeof e=="undefined"){for(var r=0;r=0&&(this.delFromMap(o.id),this._roots.splice(u,1),o instanceof n&&o.delChildrenFromStorage(this))},s.prototype.addToMap=function(e){return e instanceof n&&(e._storage=this),e.modSelf(),this._elements[e.id]=e,this},s.prototype.get=function(e){return this._elements[e]},s.prototype.delFromMap=function(e){var t=this._elements[e];return t&&(delete this._elements[e],t instanceof n&&(t._storage=null)),this},s.prototype.dispose=function(){this._elements=this._renderList=this._roots=this._hoverElements=null},s}),r("zrender/animation/easing",[],function(){var e={Linear:function(e){return e},QuadraticIn:function(e){return e*e},QuadraticOut:function(e){return e*(2-e)},QuadraticInOut:function(e){return(e*=2)<1?.5*e*e:-0.5*(--e*(e-2)-1)},CubicIn:function(e){return e*e*e},CubicOut:function(e){return--e*e*e+1},CubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},QuarticIn:function(e){return e*e*e*e},QuarticOut:function(e){return 1- --e*e*e*e},QuarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-0.5*((e-=2)*e*e*e-2)},QuinticIn:function(e){return e*e*e*e*e},QuinticOut:function(e){return--e*e*e*e*e+1},QuinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},SinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},SinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},SinusoidalInOut:function(e){return.5*(1-Math.cos(Math.PI*e))},ExponentialIn:function(e){return e===0?0:Math.pow(1024,e-1)},ExponentialOut:function(e){return e===1?1:1-Math.pow(2,-10*e)},ExponentialInOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)},CircularIn:function(e){return 1-Math.sqrt(1-e*e)},CircularOut:function(e){return Math.sqrt(1- --e*e)},CircularInOut:function(e){return(e*=2)<1?-0.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},ElasticIn:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),-(n*Math.pow(2,10*(e-=1))*Math.sin((e-t)*2*Math.PI/r)))},ElasticOut:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*e)*Math.sin((e-t)*2*Math.PI/r)+1)},ElasticInOut:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),(e*=2)<1?-0.5*n*Math.pow(2,10*(e-=1))*Math.sin((e-t)*2*Math.PI/r):n*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*2*Math.PI/r)*.5+1)},BackIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},BackOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},BackInOut:function(e){var t=2.5949095;return(e*=2)<1?.5*e*e*((t+1)*e-t):.5*((e-=2)*e*((t+1)*e+t)+2)},BounceIn:function(t){return 1-e.BounceOut(1-t)},BounceOut:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},BounceInOut:function(t){return t<.5?e.BounceIn(t*2)*.5:e.BounceOut(t*2-1)*.5+.5}};return e}),r("zrender/animation/Clip",["require","./easing"],function(e){function n(e){this._targetPool=e.target||{},this._targetPool instanceof Array||(this._targetPool=[this._targetPool]),this._life=e.life||1e3,this._delay=e.delay||0,this._startTime=(new Date).getTime()+this._delay,this._endTime=this._startTime+this._life*1e3,this.loop=typeof e.loop=="undefined"?!1:e.loop,this.gap=e.gap||0,this.easing=e.easing||"Linear",this.onframe=e.onframe,this.ondestroy=e.ondestroy,this.onrestart=e.onrestart}var t=e("./easing");return n.prototype={step:function(e){var n=(e-this._startTime)/this._life;if(n<0)return;n=Math.min(n,1);var r=typeof this.easing=="string"?t[this.easing]:this.easing,i=typeof r=="function"?r(n):n;return this.fire("frame",i),n==1?this.loop?(this.restart(),"restart"):(this._needsRemove=!0,"destroy"):null},restart:function(){var e=(new Date).getTime(),t=(e-this._startTime)%this._life;this._startTime=(new Date).getTime()-t+this.gap},fire:function(e,t){for(var n=0,r=this._targetPool.length;n=0&&this._clips.splice(t,1)},_update:function(){var e=(new Date).getTime(),t=e-this._time,n=this._clips,r=n.length,i=[],s=[];for(var o=0;o=0;N--)if(x[N]<=t)break;N=Math.min(N,g-2)}else{for(N=k;Nt)break;N=Math.min(N-1,g-2)}k=N,L=t;var n=x[N+1]-x[N];if(n===0)return;O=(t-x[N])/n;if(u){_=T[N],M=T[N===0?N:N-1],D=T[N>g-2?g-1:N+1],P=T[N>g-3?g-1:N+2];if(b)p(M,_,D,P,O,O*O,O*O*O,s(e,v),E);else{var a;w?(a=p(M,_,D,P,O,O*O,O*O*O,H,1),a=m(H)):a=d(M,_,D,P,O,O*O,O*O*O),i(e,v,a)}}else if(b)c(T[N],T[N+1],O,s(e,v),E);else{var a;w?(c(T[N],T[N+1],O,H,1),a=m(H)):a=l(T[N],T[N+1],O),i(e,v,a)}for(N=0;N1?"."+e[1]:""))}return{parsePercent:t,parseCenter:n,parseRadius:r,addCommas:i}}),r("echarts/component/base",["require","../config","../util/ecQuery","../util/number","zrender/tool/util","zrender/tool/env"],function(e){function s(e,t,n,r,i){this.ecTheme=e,this.messageCenter=t,this.zr=n,this.option=r,this.series=r.series,this.myChart=i,this.component=i.component,this._zlevelBase=this.getZlevelBase(),this.shapeList=[],this.effectList=[];var s=this;s.hoverConnect=function(e){var t=(e.target||{}).hoverConnect;if(t){var n=10,r;if(t instanceof Array)for(var i=0,o=t.length;i4?a*r(2*i/s)/r(i/s):a/3);var l=i/s,c=-i/2,h=o+a*r(c),p=u+a*n(c);c+=l;var d=t.pointList=[];d.push([h,p]);for(var v=0,m=s*2-1,g;v=r.x-i&&e<=r.x+r.width+i&&t>=r.y-i&&t<=r.y+r.height+i?!0:!1}},t.inherits(C,N),C}),r("zrender/shape/util/dashedLineTo",[],function(){var e=[5,5];return function(t,n,r,i,s,o){if(t.setLineDash){e[0]=e[1]=o,t.setLineDash(e),t.moveTo(n,r),t.lineTo(i,s);return}o=typeof o!="number"?5:o;var u=i-n,a=s-r,f=Math.floor(Math.sqrt(u*u+a*a)/o);u/=f,a/=f;var l=!0;for(var c=0;cs-2?s-1:c+1],m=e[c>s-3?s-1:c+2]);var g=h*h,y=h*g;o.push([n(p[0],d[0],v[0],m[0],h,g,y),n(p[1],d[1],v[1],m[1],h,g,y)])}return o}}),r("zrender/shape/util/smoothBezier",["require","../../tool/vector"],function(e){var t=e("../../tool/vector");return function(e,n,r,i){var s=[],o=[],u=[],a=[],f,l,c=!!i,h,p;if(c){h=[Infinity,Infinity],p=[-Infinity,-Infinity];for(var d=0,v=e.length;d0&&(n.brushType=="stroke"||n.brushType=="both")&&(r||(e.beginPath(),this.buildPath(e,n)),e.stroke()),this.drawText(e,n,this.style),e.restore();return},buildPath:function(e,t){var s=t.pointList;if(s.length<2)return;if(t.smooth&&t.smooth!=="spline"){var o=r(s,t.smooth,!0,t.smoothConstraint);e.moveTo(s[0][0],s[0][1]);var u,a,f,l=s.length;for(var c=0;cn&&(n=s[o][0]),s[o][1]i&&(i=s[o][1]);var a;return e.brushType=="stroke"||e.brushType=="fill"?a=e.lineWidth||1:a=0,e.__rect={x:Math.round(t-a/2),y:Math.round(r-a/2),width:n-t+a,height:i-r+a},e.__rect}},e("../tool/util").inherits(s,t),s}),r("zrender/shape/BrokenLine",["require","./Base","./util/smoothSpline","./util/smoothBezier","./util/dashedLineTo","./Polygon","../tool/util"],function(e){var t=e("./Base"),n=e("./util/smoothSpline"),r=e("./util/smoothBezier"),i=e("./util/dashedLineTo"),s=function(e){this.brushTypeOnly="stroke",this.textPosition="end",t.call(this,e)};return s.prototype={type:"broken-line",buildPath:function(e,t){var s=t.pointList;if(s.length<2)return;var o=Math.min(t.pointList.length,Math.round(t.pointListLength||t.pointList.length));if(t.smooth&&t.smooth!=="spline"){var u=r(s,t.smooth,!1,t.smoothConstraint);e.moveTo(s[0][0],s[0][1]);var a,f,l;for(var c=0;cs?a>u?l=Math.PI*2-l+f:l+=f:a>u?l+=Math.PI-f:l=Math.PI-l-f:s>o?u>a?l=Math.PI*2-l+f:l+=f:u>a?l+=Math.PI-f:l=Math.PI-l-f;var c=Math.PI/8,h=n===0?s:o,p=n===0?u:a,d=[[h+i*Math.cos(l-c),p-i*Math.sin(l-c)],[h+i*.6*Math.cos(l),p-i*.6*Math.sin(l)],[h+i*Math.cos(l+c),p-i*Math.sin(l+c)]];e.moveTo(h,p);for(var v=0,m=d.length;v=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height?this.style.smooth!=="spline"?a.isInside(i,this.style,e,t):a.isInside(o,this.style,e,t):!1}},c.inherits(h,t),h}),r("echarts/util/shape/normalIsCover",[],function(){return function(e,t){var n=this.getTansform(e,t);e=n[0],t=n[1];var r=this.style.__rect;return r||(r=this.style.__rect=this.getRect(this.style)),e>=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height}}),r("echarts/util/shape/Symbol",["require","zrender/shape/Base","zrender/shape/Polygon","zrender/tool/util","./normalIsCover"],function(e){function s(e){t.call(this,e)}var t=e("zrender/shape/Base"),n=e("zrender/shape/Polygon"),r=new n({}),i=e("zrender/tool/util");return s.prototype={type:"symbol",buildPath:function(e,t){var n=t.pointList,r=n.length;if(r===0)return;var i=1e4,s=Math.ceil(r/i),o,u,a=n[0]instanceof Array,f=t.size?t.size:2,l=f,c=f/2,h=Math.PI*2,p,d,v;for(var m=0;mr?r:u;for(var g=o;g0&&e.stroke();break;case"stroke":t.lineWidth>0&&e.stroke();break;default:e.fill()}}},getRect:function(e){return e.__rect||r.getRect(e)},isCover:e("./normalIsCover")},i.inherits(s,t),s}),r("echarts/util/ecData",[],function(){function e(e,t,n,r,i,s,o,u){var a;return typeof r!="undefined"&&(a=r.value==null?r:r.value),e._echartsData={_series:t,_seriesIndex:n,_data:r,_dataIndex:i,_name:s,_value:a,_special:o,_special2:u},e._echartsData}function t(e,t){var n=e._echartsData;if(!t)return n;switch(t){case"series":case"seriesIndex":case"data":case"dataIndex":case"name":case"value":case"special":case"special2":return n&&n["_"+t]}return null}function n(e,t,n){e._echartsData=e._echartsData||{};switch(t){case"series":case"seriesIndex":case"data":case"dataIndex":case"name":case"value":case"special":case"special2":e._echartsData["_"+t]=n}}function r(e,t){t._echartsData={_series:e._echartsData._series,_seriesIndex:e._echartsData._seriesIndex,_data:e._echartsData._data,_dataIndex:e._echartsData._dataIndex,_name:e._echartsData._name,_value:e._echartsData._value,_special:e._echartsData._special,_special2:e._echartsData._special2}}return{pack:e,set:n,get:t,clone:r}}),r("echarts/util/ecAnimation",["require","zrender/tool/util","zrender/shape/Polygon"],function(e){function n(e,n,r,i,s){var o=r.style.pointList,u=o.length,a;if(!n){a=[];if(r._orient!="vertical"){var f=o[0][1];for(var l=0;l1?t.symbol:[t.symbol[0],t.symbol[0]]:[t.symbol,t.symbol],t.symbolSize=t.symbolSize instanceof Array?t.symbolSize.length>1?t.symbolSize:[t.symbolSize[0],t.symbolSize[0]]:[t.symbolSize,t.symbolSize],t.symbolRotate=t.symbolRotate instanceof Array?t.symbolRotate.length>1?t.symbolRotate:[t.symbolRotate[0],t.symbolRotate[0]]:[t.symbolRotate,t.symbolRotate],t.name=n.name;var i=[],u=t.data,a,f=r.dataRange,c=r.legend,h,p,d,v,m,g,y=this.zr.getWidth(),b=this.zr.getHeight(),w;for(var E=0,S=u.length;E "+u[E][1].name:""),p),i.push(a)}return i},getMarkCoord:function(){return[0,0]},getSymbolShape:function(e,r,i,s,u,a,f,l,c,h,p){var d=[i,e],v=i!=null?i.value!=null?i.value:i:"-";l=this.deepQuery(d,"symbol")||l;var m=this.deepQuery(d,"symbolSize");m=typeof m=="function"?m(v):m;var g=this.deepQuery(d,"symbolRotate"),y=this.deepMerge(d,"itemStyle.normal"),b=this.deepMerge(d,"itemStyle.emphasis"),w=y.borderWidth!=null?y.borderWidth:y.lineStyle&&y.lineStyle.width;w==null&&(w=l.match("empty")?2:0);var E=b.borderWidth!=null?b.borderWidth:b.lineStyle&&b.lineStyle.width;E==null&&(E=w+2);var S=new n({style:{iconType:l.replace("empty","").toLowerCase(),x:a-m,y:f-m,width:m*2,height:m*2,brushType:"both",color:l.match("empty")?h:this.getItemStyleColor(y.color,r,s,i)||c,strokeColor:y.borderColor||this.getItemStyleColor(y.color,r,s,i)||c,lineWidth:w},highlightStyle:{color:l.match("empty")?h:this.getItemStyleColor(b.color,r,s,i),strokeColor:b.borderColor||y.borderColor||this.getItemStyleColor(y.color,r,s,i)||c,lineWidth:E},clickable:this.deepQuery(d,"clickable")});return l.match("image")&&(S.style.image=l.replace(new RegExp("^image:\\/\\/"),""),S=new t({style:S.style,highlightStyle:S.highlightStyle,clickable:this.deepQuery(d,"clickable")})),g!=null&&(S.rotation=[g*Math.PI/180,a,f]),l.match("star")&&(S.style.iconType="star",S.style.n=l.replace("empty","").replace("star","")-0||5),l==="none"&&(S.invisible=!0,S.hoverable=!1),S=this.addLabel(S,e,i,u,p),l.match("empty")&&(S.style.textColor==null&&(S.style.textColor=S.style.strokeColor),S.highlightStyle.textColor==null&&(S.highlightStyle.textColor=S.highlightStyle.strokeColor)),o.pack(S,e,r,i,s,u),S._x=a,S._y=f,S._dataIndex=s,S._seriesIndex=r,S},getLineMarkShape:function(e,t,n,i,s,o,u,a,f){var l=n[0]!=null?n[0].value!=null?n[0].value:n[0]:"-",c=n[1]!=null?n[1].value!=null?n[1].value:n[1]:"-",h=[this.query(n[0],"symbol")||e.symbol[0],this.query(n[1],"symbol")||e.symbol[1]],p=[this.query(n[0],"symbolSize")||e.symbolSize[0],this.query(n[1],"symbolSize")||e.symbolSize[1]];p[0]=typeof p[0]=="function"?p[0](l):p[0],p[1]=typeof p[1]=="function"?p[1](c):p[1];var d=[this.query(n[0],"symbolRotate")||e.symbolRotate[0],this.query(n[1],"symbolRotate")||e.symbolRotate[1]],v=[n[0],e],m=this.deepMerge(v,"itemStyle.normal");m.color=this.getItemStyleColor(m.color,t,i,n);var g=this.deepMerge(v,"itemStyle.emphasis");g.color=this.getItemStyleColor(g.color,t,i,n);var y=m.lineStyle,b=g.lineStyle,w=y.width;w==null&&(w=m.borderWidth);var E=b.width;E==null&&(E=g.borderWidth!=null?g.borderWidth:w+2);var S=new r({style:{smooth:e.smooth?"spline":!1,symbol:h,symbolSize:p,symbolRotate:d,xStart:s,yStart:o,xEnd:u,yEnd:a,brushType:"both",lineType:y.type,shadowColor:y.shadowColor||y.color||m.borderColor||m.color||f,shadowBlur:y.shadowBlur,shadowOffsetX:y.shadowOffsetX,shadowOffsetY:y.shadowOffsetY,color:m.color||f,strokeColor:y.color||m.borderColor||m.color||f,lineWidth:w,symbolBorderColor:m.borderColor||m.color||f,symbolBorder:m.borderWidth},highlightStyle:{shadowColor:b.shadowColor,shadowBlur:b.shadowBlur,shadowOffsetX:b.shadowOffsetX,shadowOffsetY:b.shadowOffsetY,color:g.color||m.color||f,strokeColor:b.color||y.color||g.borderColor||m.borderColor||g.color||m.color||f,lineWidth:E,symbolBorderColor:g.borderColor||m.borderColor||g.color||m.color||f,symbolBorder:g.borderWidth==null?m.borderWidth+2:g.borderWidth},clickable:this.deepQuery(v,"clickable")});return S=this.addLabel(S,e,n[0],n[0].name+" : "+n[1].name),S._x=u,S._y=a,S},getLargeMarkPoingShape:function(e,t){var n=this.series[e],r=this.component,s=t.data,o,u=r.dataRange,a=r.legend,f,l,c=[s[0],t],h,p,d;a&&(f=a.getColor(n.name));if(u){l=s[0]!=null?s[0].value!=null?s[0].value:s[0]:"-",f=isNaN(l)?f:u.getColor(l),h=this.deepQuery(c,"itemStyle.normal.color")||f,p=this.deepQuery(c,"itemStyle.emphasis.color")||h;if(h==null&&p==null)return}f=this.deepMerge(c,"itemStyle.normal").color||f;var v=this.deepQuery(c,"symbol")||"circle";v=v.replace("empty","").replace(/\d/g,""),d=this.deepMerge([s[0],t],"effect");var m=window.devicePixelRatio||1;return o=new i({style:{pointList:s,color:f,strokeColor:f,shadowColor:d.shadowColor||f,shadowBlur:(d.shadowBlur!=null?d.shadowBlur:8)*m,size:this.deepQuery(c,"symbolSize"),iconType:v,brushType:"fill",lineWidth:1},draggable:!1,hoverable:!1}),d.show&&(o.effect=d),o},backupShapeList:function(){this.shapeList&&this.shapeList.length>0?(this.lastShapeList=this.shapeList,this.shapeList=[]):this.lastShapeList=[]},addShapeList:function(){var e=this.option.animationThreshold/(this.canvasSupported?2:4),t=this.lastShapeList,n=this.shapeList,r=t.length>0?500:this.query(this.option,"animationDuration"),i=this.query(this.option,"animationEasing"),s,o={},u={};if(this.option.animation&&!this.option.renderAsImage&&n.length500?u.candle(this.zr,e,t,n,r):this.zr.addShape(t);break;case"ring":case"sector":case"circle":n>500?u.ring(this.zr,e,t,n+(o.get(t,"dataIndex")||0)%20*100,r):t.type==="sector"?u.sector(this.zr,e,t,n,r):this.zr.addShape(t);break;case"text":u.text(this.zr,e,t,n,r);break;case"polygon":n>500?u.polygon(this.zr,e,t,n,r):u.pointList(this.zr,e,t,n,r);break;case"chord":u.chord(this.zr,e,t,n,r);break;case"gauge-pointer":u.gaugePointer(this.zr,e,t,n,r);break;case"mark-line":u.markline(this.zr,e,t,n,r);break;case"line":u.line(this.zr,e,t,n,r);break;default:this.zr.addShape(t)}},animationMark:function(e,t,n){var r=n||this.shapeList;for(var i=0,s=r.length;i0&&(e&&this.zr.modLayer(s.EFFECT_ZLEVEL,{motionBlur:!1}),this.zr.delShape(this.effectList)),this.effectList=[]},addMark:function(e,t,n){var r=this.series[e];if(this.selectedMap[r.name]){var i=500,s=this.query(this.option,"animationEasing"),o=r[n].data,u=this.shapeList.length;r[n].data=t.data,this["_build"+n.replace("m","M")](e);if(this.option.animation&&!this.option.renderAsImage)this.animationMark(i,s,this.shapeList.slice(u));else{for(var a=u,f=this.shapeList.length;a0?-1:1,t.style.r-=r,t.style.r=t.style.r<5?5:t.style.r;var i=s.get(t,"value"),o=i*f.option.island.calculateStep;o>1?i=Math.round(i-o*r):i=(i-o*r).toFixed(2)-0;var a=s.get(t,"name");t.style.text=a+":"+i,s.set(t,"value",i),s.set(t,"name",a),f.zr.modShape(t.id),f.zr.refresh(),u.stop(n)}}var t=e("../component/base"),n=e("./base"),r=e("zrender/shape/Circle"),i=e("../config"),s=e("../util/ecData"),o=e("zrender/tool/util"),u=e("zrender/tool/event");return a.prototype={type:i.CHART_TYPE_ISLAND,_combine:function(t,n){var r=e("zrender/tool/color"),i=e("../util/accMath"),o=i.accAdd(s.get(t,"value"),s.get(n,"value")),u=s.get(t,"name")+this._nameConnector+s.get(n,"name");t.style.text=u+this._valueConnector+o,s.set(t,"value",o),s.set(t,"name",u),t.style.r=this.option.island.r,t.style.color=r.mix(t.style.color,n.style.color)},refresh:function(e){e&&(e.island=this.reformOption(e.island),this.option=e,this._nameConnector=this.option.nameConnector,this._valueConnector=this.option.valueConnector)},getOption:function(){return this.option},resize:function(){var e=this.zr.getWidth(),t=this.zr.getHeight(),n=e/(this._zrWidth||e),r=t/(this._zrHeight||t);if(n===1&&r===1)return;this._zrWidth=e,this._zrHeight=t;for(var i=0,s=this.shapeList.length;i'+(t[0]||this._lang[0])+"

",this._textArea.style.cssText="display:block;margin:0 0 8px 0;padding:4px 6px;overflow:auto;width:"+(this._zrWidth-15)+"px;"+"height:"+(this._zrHeight-100)+"px;";var n=this.query(this.option,"toolbox.feature.dataView.optionToContent");typeof n!="function"?this._textArea.value=this._optionToContent():this._textArea.value=n(this.option),this._tDom.appendChild(this._textArea),this._buttonClose.style.cssText="float:right;padding:1px 6px;",this._buttonClose.innerHTML=t[1]||this._lang[1];var r=this;this._buttonClose.onclick=function(){r.hide()},this._tDom.appendChild(this._buttonClose),this.query(this.option,"toolbox.feature.dataView.readOnly")===!1?(this._buttonRefresh.style.cssText="float:right;margin-right:10px;padding:1px 6px;",this._buttonRefresh.innerHTML=t[2]||this._lang[2],this._buttonRefresh.onclick=function(){r._save()},this._tDom.appendChild(this._buttonRefresh),this._textArea.readOnly=!1,this._textArea.style.cursor="default"):(this._textArea.readOnly=!0,this._textArea.style.cursor="text"),this._sizeCssText="width:"+this._zrWidth+"px;"+"height:"+this._zrHeight+"px;"+"background-color:#fff;",this._tDom.style.cssText=this._gCssText+this._sizeCssText},_optionToContent:function(){var e,t,r,i,s,o,u=[],a="";if(this.option.xAxis){this.option.xAxis instanceof Array?u=this.option.xAxis:u=[this.option.xAxis];for(e=0,i=u.length;e10&&(this._sizeCssText="width:"+this._zrWidth+"px;"+"height:"+this._zrHeight+"px;"+"background-color:#fff;",this._tDom.style.cssText=this._gCssText+this._sizeCssText,this._textArea.style.cssText="display:block;margin:0 0 8px 0;padding:4px 6px;overflow:auto;width:"+(this._zrWidth-15)+"px;"+"height:"+(this._zrHeight-100)+"px;")},dispose:function(){window.removeEventListener?(this._tDom.removeEventListener("click",this._stop),this._tDom.removeEventListener("mousewheel",this._stop),this._tDom.removeEventListener("mousemove",this._stop),this._tDom.removeEventListener("mousedown",this._stop),this._tDom.removeEventListener("mouseup",this._stop),this._tDom.removeEventListener("touchstart",this._stop),this._tDom.removeEventListener("touchmove",this._stop),this._tDom.removeEventListener("touchend",this._stop)):(this._tDom.detachEvent("onclick",this._stop),this._tDom.detachEvent("onmousewheel",this._stop),this._tDom.detachEvent("onmousemove",this._stop),this._tDom.detachEvent("onmousedown",this._stop),this._tDom.detachEvent("onmouseup",this._stop)),this._buttonRefresh.onclick=null,this._buttonClose.onclick=null,this._hasShow&&(this._tDom.removeChild(this._textArea),this._tDom.removeChild(this._buttonRefresh),this._tDom.removeChild(this._buttonClose)),this._textArea=null,this._buttonRefresh=null,this._buttonClose=null,this.dom.firstChild.removeChild(this._tDom),this._tDom=null}},r.inherits(i,t),e("../component").define("dataView",i),i}),r("echarts/component/toolbox",["require","./base","zrender/shape/Line","zrender/shape/Image","zrender/shape/Rectangle","../util/shape/Icon","../config","zrender/tool/util","zrender/config","zrender/tool/event","./dataView","../component"],function(e){function h(e,n,r,i,s){t.call(this,e,n,r,i,s),this.dom=s.dom,this._magicType={},this._magicMap={},this._isSilence=!1,this._iconList,this._iconShapeMap={},this._featureTitle={},this._featureIcon={},this._featureColor={},this._enableColor="red",this._disableColor="#ccc",this._markShapeList=[];var o=this;o._onMark=function(e){o.__onMark(e)},o._onMarkUndo=function(e){o.__onMarkUndo(e)},o._onMarkClear=function(e){o.__onMarkClear(e)},o._onDataZoom=function(e){o.__onDataZoom(e)},o._onDataZoomReset=function(e){o.__onDataZoomReset(e)},o._onDataView=function(e){o.__onDataView(e)},o._onRestore=function(e){o.__onRestore(e)},o._onSaveAsImage=function(e){o.__onSaveAsImage(e)},o._onMagicType=function(e){o.__onMagicType(e)},o._onCustomHandler=function(e){o.__onCustomHandler(e)},o._onmousemove=function(e){return o.__onmousemove(e)},o._onmousedown=function(e){return o.__onmousedown(e)},o._onmouseup=function(e){return o.__onmouseup(e)},o._onclick=function(e){return o.__onclick(e)}}var t=e("./base"),n=e("zrender/shape/Line"),r=e("zrender/shape/Image"),i=e("zrender/shape/Rectangle"),s=e("../util/shape/Icon"),o=e("../config"),u=e("zrender/tool/util"),a=e("zrender/config"),f=e("zrender/tool/event"),l="stack",c="tiled";return h.prototype={type:o.COMPONENT_TYPE_TOOLBOX,_buildShape:function(){this._iconList=[];var e=this.option.toolbox;this._enableColor=e.effectiveColor,this._disableColor=e.disableColor;var t=e.feature,n=[];for(var r in t)if(t[r].show)switch(r){case"mark":n.push({key:r,name:"mark"}),n.push({key:r,name:"markUndo"}),n.push({key:r,name:"markClear"});break;case"magicType":for(var i=0,s=t[r].type.length;i0){var o,r;for(var i=0,s=n.length;i=1){var t=this._markShapeList[e-1];this.zr.delShape(t.id),this.zr.refresh(),this._markShapeList.pop(),e===1&&(this._iconDisable(this._iconShapeMap.markUndo),this._iconDisable(this._iconShapeMap.markClear))}}return!0},__onMarkClear:function(){this._marking&&(this._marking=!1);var e=this._markShapeList.length;if(e>0){while(e--)this.zr.delShape(this._markShapeList.pop().id);this._iconDisable(this._iconShapeMap.markUndo),this._iconDisable(this._iconShapeMap.markClear),this.zr.refresh()}return!0},__onDataZoom:function(e){var t=e.target;if(this._zooming||this._zoomStart)this._resetZoom(),this.zr.refresh(),this.dom.style.cursor="default";else{this._resetMark(),this.zr.modShape(t.id,{style:{strokeColor:this._enableColor}}),this.zr.refresh(),this._zoomStart=!0;var n=this;setTimeout(function(){n.zr&&n.zr.on(a.EVENT.MOUSEDOWN,n._onmousedown)&&n.zr.on(a.EVENT.MOUSEUP,n._onmouseup)&&n.zr.on(a.EVENT.MOUSEMOVE,n._onmousemove)},10),this.dom.style.cursor="crosshair"}return!0},__onDataZoomReset:function(){return this._zooming&&(this._zooming=!1),this._zoomQueue.pop(),this._zoomQueue.length>0?this.component.dataZoom.absoluteZoom(this._zoomQueue[this._zoomQueue.length-1]):(this.component.dataZoom.rectZoom(),this._iconDisable(this._iconShapeMap.dataZoomReset),this.zr.refresh()),!0},_resetMark:function(){this._marking=!1,this._markStart&&(this._markStart=!1,this._iconShapeMap.mark&&this.zr.modShape(this._iconShapeMap.mark.id,{style:{strokeColor:this._iconShapeMap.mark.highlightStyle.strokeColor}}),this.zr.un(a.EVENT.CLICK,this._onclick),this.zr.un(a.EVENT.MOUSEMOVE,this._onmousemove))},_resetZoom:function(){this._zooming=!1,this._zoomStart&&(this._zoomStart=!1,this._iconShapeMap.dataZoom&&this.zr.modShape(this._iconShapeMap.dataZoom.id,{style:{strokeColor:this._iconShapeMap.dataZoom.highlightStyle.strokeColor}}),this.zr.un(a.EVENT.MOUSEDOWN,this._onmousedown),this.zr.un(a.EVENT.MOUSEUP,this._onmouseup),this.zr.un(a.EVENT.MOUSEMOVE,this._onmousemove))},_iconDisable:function(e){e.type!="image"?this.zr.modShape(e.id,{hoverable:!1,clickable:!1,style:{strokeColor:this._disableColor}}):this.zr.modShape(e.id,{hoverable:!1,clickable:!1,style:{opacity:.3}})},_iconEnable:function(e){e.type!="image"?this.zr.modShape(e.id,{hoverable:!0,clickable:!0,style:{strokeColor:e.highlightStyle.strokeColor}}):this.zr.modShape(e.id,{hoverable:!0,clickable:!0,style:{opacity:.8}})},__onDataView:function(){return this._dataView.show(this.option),!0},__onRestore:function(){return this._resetMark(),this._resetZoom(),this.messageCenter.dispatch(o.EVENT.RESTORE,null,null,this.myChart),!0},__onSaveAsImage:function(){var e=this.option.toolbox.feature.saveAsImage,t=e.type||"png";t!="png"&&t!="jpeg"&&(t="png");var n;this.myChart.isConnected()?n=this.myChart.getConnectedDataURL(t):n=this.zr.toDataURL("image/"+t,this.option.backgroundColor&&this.option.backgroundColor.replace(" ","")==="rgba(0,0,0,0)"?"#fff":this.option.backgroundColor);var r=document.createElement("div");r.id="__echarts_download_wrap__",r.style.cssText="position:fixed;z-index:99999;display:block;top:0;left:0;background-color:rgba(33,33,33,0.5);text-align:center;width:100%;height:100%;line-height:"+document.documentElement.clientHeight+"px;";var i=document.createElement("a");i.href=n,i.setAttribute("download",(e.name?e.name:this.option.title&&(this.option.title.text||this.option.title.subtext)?this.option.title.text||this.option.title.subtext:"ECharts")+"."+t),i.innerHTML='图片另存为")+'"/>',r.appendChild(i),document.body.appendChild(r),i=null,r=null,setTimeout(function(){var e=document.getElementById("__echarts_download_wrap__");e&&(e.onclick=function(){var e=document.getElementById("__echarts_download_wrap__");e.onclick=null,e.innerHTML="",document.body.removeChild(e),e=null},e=null)},500);return},__onMagicType:function(e){this._resetMark();var t=e.target._name;return this._magicType[t]||(this._magicType[t]=!0,t===o.CHART_TYPE_LINE?this._magicType[o.CHART_TYPE_BAR]=!1:t===o.CHART_TYPE_BAR&&(this._magicType[o.CHART_TYPE_LINE]=!1),t===l?this._magicType[c]=!1:t===c&&(this._magicType[l]=!1),this.messageCenter.dispatch(o.EVENT.MAGIC_TYPE_CHANGED,e.event,{magicType:this._magicType},this.myChart)),!0},setMagicType:function(e){this._resetMark(),this._magicType=e,!this._isSilence&&this.messageCenter.dispatch(o.EVENT.MAGIC_TYPE_CHANGED,null,{magicType:this._magicType},this.myChart)},__onCustomHandler:function(e){var t=e.target.style.iconType,n=this.option.toolbox.feature[t].onclick;typeof n=="function"&&n.call(this,this.option)},reset:function(e,t){t&&this.clear();if(this.query(e,"toolbox.show")&&this.query(e,"toolbox.feature.magicType.show")){var n=e.toolbox.feature.magicType.type,r=n.length;this._magicMap={};while(r--)this._magicMap[n[r]]=!0;r=e.series.length;var i,s;while(r--){i=e.series[r].type,this._magicMap[i]&&(s=e.xAxis instanceof Array?e.xAxis[e.series[r].xAxisIndex||0]:e.xAxis,s&&(s.type||"category")==="category"&&(s.__boundaryGap=s.boundaryGap!=null?s.boundaryGap:!0),s=e.yAxis instanceof Array?e.yAxis[e.series[r].yAxisIndex||0]:e.yAxis,s&&s.type==="category"&&(s.__boundaryGap=s.boundaryGap!=null?s.boundaryGap:!0),e.series[r].__type=i,e.series[r].__itemStyle=u.clone(e.series[r].itemStyle||{}));if(this._magicMap[l]||this._magicMap[c])e.series[r].__stack=e.series[r].stack}}this._magicType=t?{}:this._magicType||{};for(var o in this._magicType)if(this._magicType[o]){this.option=e,this.getMagicOption();break}var a=e.dataZoom;if(a&&a.show){var f=a.start!=null&&a.start>=0&&a.start<=100?a.start:0,h=a.end!=null&&a.end>=0&&a.end<=100?a.end:100;f>h&&(f+=h,h=f-h,f-=h),this._zoomQueue=[{start:f,end:h,start2:0,end2:100}]}else this._zoomQueue=[]},getMagicOption:function(){var e;if(this._magicType[o.CHART_TYPE_LINE]||this._magicType[o.CHART_TYPE_BAR]){var t=this._magicType[o.CHART_TYPE_LINE]?!1:!0;for(var n=0,r=this.option.series.length;n0&&(this.zr.delShape(this._lastTipShape.tipShape),this._lastTipShape=!1,this.shapeList.length=2),e&&this.zr.refresh(),this.showing=!1},_show:function(e,t,n,r){var i=this._tDom.offsetHeight,s=this._tDom.offsetWidth;e&&(typeof e=="function"&&(e=e([t,n])),e instanceof Array&&(t=e[0],n=e[1])),t+s>this._zrWidth&&(t-=s+40),n+i>this._zrHeight&&(n-=i-20),n<20&&(n=0),this._tDom.style.cssText=this._gCssText+this._defaultCssText+(r?r:"")+"left:"+t+"px;top:"+n+"px;",(i<10||s<10)&&setTimeout(this._refixed,20),this.showing=!0},__refixed:function(){if(this._tDom){var e="",t=this._tDom.offsetHeight,n=this._tDom.offsetWidth;this._tDom.offsetLeft+n>this._zrWidth&&(e+="left:"+(this._zrWidth-n-20)+"px;"),this._tDom.offsetTop+t>this._zrHeight&&(e+="top:"+(this._zrHeight-t-10)+"px;"),e!==""&&(this._tDom.style.cssText+=e)}},__tryShow:function(){var e,t;if(!this._curTarget)this._findPolarTrigger()||this._findAxisTrigger();else{if(this._curTarget._type==="island"&&this.option.tooltip.show){this._showItemTrigger();return}var n=u.get(this._curTarget,"series"),r=u.get(this._curTarget,"data");e=this.deepQuery([r,n,this.option],"tooltip.show"),n==null||r==null||!e?(clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this._hidingTicket=setTimeout(this._hide,this._hideDelay)):(t=this.deepQuery([r,n,this.option],"tooltip.trigger"),t==="axis"?this._showAxisTrigger(n.xAxisIndex,n.yAxisIndex,u.get(this._curTarget,"dataIndex")):this._showItemTrigger())}},_findAxisTrigger:function(){if(!this.component.xAxis||!this.component.yAxis){this._hidingTicket=setTimeout(this._hide,this._hideDelay);return}var e=this.option.series,t,n;for(var r=0,i=e.length;rh){l=a;if(!(a>=i))break;c=a,a=t.getCoordByIndex(++n)}return n<=0?n=0:i-l>=c-i?n-=1:t.getNameByIndex(n)==null&&(n-=1),n},_showAxisTrigger:function(e,t,n){!this._event.connectTrigger&&this.messageCenter.dispatch(o.EVENT.TOOLTIP_IN_GRID,this._event,null,this.myChart);if(this.component.xAxis==null||this.component.yAxis==null||e==null||t==null){clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this._hidingTicket=setTimeout(this._hide,this._hideDelay);return}var r=this.option.series,i=[],s=[],u,a,l,c,h,p,d="";if(this.option.tooltip.trigger==="axis"){if(!this.option.tooltip.show)return;c=this.option.tooltip.formatter,h=this.option.tooltip.position}if(e!=-1&&this.component.xAxis.getAxis(e).type===o.COMPONENT_TYPE_AXIS_CATEGORY){u=this.component.xAxis.getAxis(e);for(var v=0,m=r.length;v=0?this._showItemTrigger():(clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this._tDom.style.display="none");if(i.length>0){var g;if(typeof c=="function"){var y=[];for(var v=0,m=i.length;v"+this._encodeHTML(i[v].name||"")+" : ",g=i[v].data[n],g=g!=null?g.value!=null?g.value:g:"-",c+=g instanceof Array?g:this.numAddCommas(g);this._tDom.innerHTML=c}if(p===!1||!this.option.tooltip.showContent)return;this.hasAppend||(this._tDom.style.left=this._zrWidth/2+"px",this._tDom.style.top=this._zrHeight/2+"px",this.dom.firstChild.appendChild(this._tDom),this.hasAppend=!0),this._show(h,a+10,l+10,d)}},_showPolarTrigger:function(e,t){if(this.component.polar==null||e==null||t==null||t<0)return!1;var n=this.option.series,r=[],i,s,o,u="";if(this.option.tooltip.trigger==="axis"){if(!this.option.tooltip.show)return!1;i=this.option.tooltip.formatter,s=this.option.tooltip.position}var a=this.option.polar[e].indicator[t].text;for(var l=0,c=n.length;l0){var h,p,d=[];for(var l=0,c=r.length;l"+this._encodeHTML(d[0][3])+" : "+this.numAddCommas(d[0][2]);for(var l=1,c=d.length;l"+this._encodeHTML(d[l][1])+"
",i+=this._encodeHTML(d[l][3])+" : "+this.numAddCommas(d[l][2]);this._tDom.innerHTML=i}if(o===!1||!this.option.tooltip.showContent)return;return this.hasAppend||(this._tDom.style.left=this._zrWidth/2+"px",this._tDom.style.top=this._zrHeight/2+"px",this.dom.firstChild.appendChild(this._tDom),this.hasAppend=!0),this._show(s,f.getX(this._event),f.getY(this._event),u),!0}},_showItemTrigger:function(){if(!this._curTarget)return;var e=u.get(this._curTarget,"series"),t=u.get(this._curTarget,"data"),n=u.get(this._curTarget,"name"),r=u.get(this._curTarget,"value"),i=u.get(this._curTarget,"special"),s=u.get(this._curTarget,"special2"),a,l,c,h="",p,d="";this._curTarget._type!="island"?(this.option.tooltip.trigger==="item"&&(a=this.option.tooltip.formatter,l=this.option.tooltip.position),this.query(e,"tooltip.trigger")==="item"&&(c=this.query(e,"tooltip.showContent")||c,a=this.query(e,"tooltip.formatter")||a,l=this.query(e,"tooltip.position")||l,h+=this._style(this.query(e,"tooltip"))),c=this.query(t,"tooltip.showContent")||c,a=this.query(t,"tooltip.formatter")||a,l=this.query(t,"tooltip.position")||l,h+=this._style(this.query(t,"tooltip"))):(c=this.deepQuery([t,e,this.option],"tooltip.showContent"),a=this.deepQuery([t,e,this.option],"tooltip.islandFormatter"),l=this.deepQuery([t,e,this.option],"tooltip.islandPosition"));if(typeof a=="function")this._curTicket=(e.name||"")+":"+u.get(this._curTarget,"dataIndex"),this._tDom.innerHTML=a.call(this.myChart,[e.name||"",n,r,i,s,t],this._curTicket,this._setContent);else if(typeof a=="string")this._curTicket=NaN,a=a.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}"),a=a.replace("{a0}",this._encodeHTML(e.name||"")).replace("{b0}",this._encodeHTML(n)).replace("{c0}",r instanceof Array?r:this.numAddCommas(r)),a=a.replace("{d}","{d0}").replace("{d0}",i||""),a=a.replace("{e}","{e0}").replace("{e0}",u.get(this._curTarget,"special2")||""),this._tDom.innerHTML=a;else{this._curTicket=NaN;if(e.type===o.CHART_TYPE_SCATTER)this._tDom.innerHTML=""+(e.name!=null?this._encodeHTML(e.name)+"
":"")+(n===""?"":this._encodeHTML(n)+" : ")+r+(i==null?"":" ("+i+")");else if(e.type===o.CHART_TYPE_RADAR&&i){p=i,d+=this._encodeHTML(n===""?e.name||"":n),d+=d===""?"":"
";for(var v=0;v";this._tDom.innerHTML=d}else if(e.type===o.CHART_TYPE_CHORD)if(s==null)this._tDom.innerHTML=this._encodeHTML(n)+" ("+this.numAddCommas(r)+")";else{var m=this._encodeHTML(n),g=this._encodeHTML(i);this._tDom.innerHTML=""+(e.name!=null?this._encodeHTML(e.name)+"
":"")+m+" -> "+g+" ("+this.numAddCommas(r)+")"+"
"+g+" -> "+m+" ("+this.numAddCommas(s)+")"}else this._tDom.innerHTML=""+(e.name!=null?this._encodeHTML(e.name)+"
":"")+this._encodeHTML(n)+" : "+this.numAddCommas(r)+(i==null?"":" ("+this.numAddCommas(i)+")")}if(!this._axisLineShape.invisible||!this._axisShadowShape.invisible)this._axisLineShape.invisible=!0,this.zr.modShape(this._axisLineShape.id),this._axisShadowShape.invisible=!0,this.zr.modShape(this._axisShadowShape.id),this.zr.refresh();if(c===!1||!this.option.tooltip.showContent)return;this.hasAppend||(this._tDom.style.left=this._zrWidth/2+"px",this._tDom.style.top=this._zrHeight/2+"px",this.dom.firstChild.appendChild(this._tDom),this.hasAppend=!0),this._show(l,f.getX(this._event)+20,f.getY(this._event)-20,h)},_styleAxisPointer:function(e,t,n,r,i,s,o,u){if(e.length>0){var a,f,l=this.option.tooltip.axisPointer,c=l.type,h={line:{},cross:{},shadow:{}};for(var p in h)h[p].color=l[p+"Style"].color,h[p].width=l[p+"Style"].width,h[p].type=l[p+"Style"].type;for(var d=0,v=e.length;d100?(this._axisCrossShape.style.textAlign="left",this._axisCrossShape.style.textX=o+10):(this._axisCrossShape.style.textAlign="right",this._axisCrossShape.style.textX=o-10),u-this.component.grid.getY()>50?(this._axisCrossShape.style.textBaseline="bottom",this._axisCrossShape.style.textY=u-10):(this._axisCrossShape.style.textBaseline="top",this._axisCrossShape.style.textY=u+10),this._axisCrossShape.invisible=!1,this.zr.modShape(this._axisCrossShape.id);else if(c==="shadow"){if(h.shadow.width==null||h.shadow.width==="auto"||isNaN(h.shadow.width))h.shadow.width=s;t===r?Math.abs(this.component.grid.getX()-t)<2?(h.shadow.width/=2,t=r+=h.shadow.width/2):Math.abs(this.component.grid.getXend()-t)<2&&(h.shadow.width/=2,t=r-=h.shadow.width/2):n===i&&(Math.abs(this.component.grid.getY()-n)<2?(h.shadow.width/=2,n=i+=h.shadow.width/2):Math.abs(this.component.grid.getYend()-n)<2&&(h.shadow.width/=2,n=i-=h.shadow.width/2)),this._axisShadowShape.style={xStart:t,yStart:n,xEnd:r,yEnd:i,strokeColor:h.shadow.color,lineWidth:h.shadow.width},this._axisShadowShape.invisible=!1,this.zr.modShape(this._axisShadowShape.id)}this.zr.refresh()}},__onmousemove:function(e){clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket);var t=e.target,n=f.getX(e.event),r=f.getY(e.event);if(!t)this._curTarget=!1,this._event=e.event,this._event.zrenderX=n,this._event.zrenderY=r,this._needAxisTrigger&&this.component.grid&&l.isInside(s,this.component.grid.getArea(),n,r)?this._showingTicket=setTimeout(this._tryShow,this._showDelay):this._needAxisTrigger&&this.component.polar&&this.component.polar.isInside([n,r])!=-1?this._showingTicket=setTimeout(this._tryShow,this._showDelay):(!this._event.connectTrigger&&this.messageCenter.dispatch(o.EVENT.TOOLTIP_OUT_GRID,this._event,null,this.myChart),this._hidingTicket=setTimeout(this._hide,this._hideDelay));else{this._curTarget=t,this._event=e.event,this._event.zrenderX=n,this._event.zrenderY=r;var i;if(this._needAxisTrigger&&this.component.polar&&(i=this.component.polar.isInside([n,r]))!=-1){var u=this.option.series;for(var a=0,c=u.length;a0&&(this.zr.delShape(this._lastTipShape.tipShape),this.shapeList.length=2);for(var n=0,r=t.length;n0&&this.zr.delShape(this._lastTipShape.tipShape),this._lastTipShape=!1,this.shapeList.length=2;if(e){this.option=e,this.option.tooltip=this.reformOption(this.option.tooltip),this.option.tooltip.textStyle=h.merge(this.option.tooltip.textStyle,this.ecTheme.textStyle),this.option.tooltip.padding=this.reformCssArray(this.option.tooltip.padding),this._needAxisTrigger=!1,this.option.tooltip.trigger==="axis"&&(this._needAxisTrigger=!0);var t=this.option.series;for(var n=0,r=t.length;n0&&this.zr.delShape(this._lastTipShape.tipShape),this.clear(),this.shapeList=null,clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this.zr.un(a.EVENT.MOUSEMOVE,this._onmousemove),this.zr.un(a.EVENT.GLOBALOUT,this._onglobalout),this.hasAppend&&this.dom.firstChild.removeChild(this._tDom),this._tDom=null},_encodeHTML:function(e){return String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}},h.inherits(d,t),e("../component").define("tooltip",d),d}),r("zrender/shape/Ring",["require","./Base","../tool/util"],function(e){var t=e("./Base"),n=function(e){t.call(this,e)};return n.prototype={type:"ring",buildPath:function(e,t){e.arc(t.x,t.y,t.r,0,Math.PI*2,!1),e.moveTo(t.x+t.r0,t.y),e.arc(t.x,t.y,t.r0,0,Math.PI*2,!0);return},getRect:function(e){if(e.__rect)return e.__rect;var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,e.__rect={x:Math.round(e.x-e.r-t/2),y:Math.round(e.y-e.r-t/2),width:e.r*2+t,height:e.r*2+t},e.__rect}},e("../tool/util").inherits(n,t),n}),r("zrender/shape/Sector",["require","../tool/math","./Base","./Ring","./Polygon","../tool/util"],function(e){var t=e("../tool/math"),n=e("./Base"),r=function(e){n.call(this,e)};return r.prototype={type:"sector",buildPath:function(e,n){var r=n.x,i=n.y,s=typeof n.r0=="undefined"?0:n.r0,o=n.r,u=n.startAngle,a=n.endAngle;if(Math.abs(a-u)>=360){e.arc(r,i,o,0,Math.PI*2,!1),s!==0&&(e.moveTo(r+s,i),e.arc(r,i,s,0,Math.PI*2,!0));return}u=t.degreeToRadian(u),a=t.degreeToRadian(a);var f=Math.PI*2,l=t.cos(u),c=t.sin(u);e.moveTo(l*s+r,i-c*s),e.lineTo(l*o+r,i-c*o),e.arc(r,i,o,f-u,f-a,!0),e.lineTo(t.cos(a)*s+r,i-t.sin(a)*s),s!==0&&e.arc(r,i,s,f-a,f-u,!1),e.closePath();return},getRect:function(n){if(n.__rect)return n.__rect;var r=n.x,i=n.y,s=typeof n.r0=="undefined"?0:n.r0,o=n.r,u=n.startAngle,a=n.endAngle;if(Math.abs(a-u)>=360)return n.__rect=e("./Ring").prototype.getRect(n),n.__rect;u=(720+u)%360,a=(720+a)%360,a<=u&&(a+=360);var f=[];return u<=90&&a>=90&&f.push([r,i-o]),u<=180&&a>=180&&f.push([r-o,i]),u<=270&&a>=270&&f.push([r,i+o]),u<=360&&a>=360&&f.push([r+o,i]),u=t.degreeToRadian(u),a=t.degreeToRadian(a),f.push([t.cos(u)*s+r,i-t.sin(u)*s]),f.push([t.cos(u)*o+r,i-t.sin(u)*o]),f.push([t.cos(a)*o+r,i-t.sin(a)*o]),f.push([t.cos(a)*s+r,i-t.sin(a)*s]),n.__rect=e("./Polygon").prototype.getRect({brushType:n.brushType,lineWidth:n.lineWidth,pointList:f}),n.__rect}},e("../tool/util").inherits(r,n),r}),r("echarts/util/shape/Candle",["require","zrender/shape/Base","zrender/tool/util","./normalIsCover"],function(e){function r(e){t.call(this,e)}var t=e("zrender/shape/Base"),n=e("zrender/tool/util");return r.prototype={type:"candle",_numberOrder:function(e,t){return t-e},buildPath:function(e,t){var r=n.clone(t.y).sort(this._numberOrder);e.moveTo(t.x,r[3]),e.lineTo(t.x,r[2]),e.moveTo(t.x-t.width/2,r[2]),e.rect(t.x-t.width/2,r[2],t.width,r[1]-r[2]),e.moveTo(t.x,r[1]),e.lineTo(t.x,r[0])},getRect:function(e){if(!e.__rect){var t=0;if(e.brushType=="stroke"||e.brushType=="fill")t=e.lineWidth||1;var r=n.clone(e.y).sort(this._numberOrder);e.__rect={x:Math.round(e.x-e.width/2-t/2),y:Math.round(r[3]-t/2),width:e.width+t,height:r[0]-r[3]+t}}return e.__rect},isCover:e("./normalIsCover")},n.inherits(r,t),r}),r("echarts/component/legend",["require","./base","zrender/shape/Text","zrender/shape/Rectangle","zrender/shape/Sector","../util/shape/Icon","../util/shape/Candle","../config","zrender/tool/util","zrender/tool/area","../component"],function(e){function l(e,n,r,i,s){if(!this.query(i,"legend.data")){console.error("option.legend.data has not been defined.");return}t.call(this,e,n,r,i,s);var o=this;o._legendSelected=function(e){o.__legendSelected(e)},this._colorIndex=0,this._colorMap={},this._selectedMap={},this.refresh(i)}var t=e("./base"),n=e("zrender/shape/Text"),r=e("zrender/shape/Rectangle"),i=e("zrender/shape/Sector"),s=e("../util/shape/Icon"),o=e("../util/shape/Candle"),u=e("../config"),a=e("zrender/tool/util"),f=e("zrender/tool/area");l.prototype={type:u.COMPONENT_TYPE_LEGEND,_buildShape:function(){this._itemGroupLocation=this._getItemGroupLocation(),this._buildBackground(),this._buildItem();for(var e=0,t=this.shapeList.length;e=d-m&&(m=this._itemGroupLocation.x,g+=b+w):v-g<200&&b+(S===t-1||e[S+1]===""?0:w)>=v-g&&(this.legendOption.x==="right"?m-=this._itemGroupLocation.maxWidth+w:m+=this._itemGroupLocation.maxWidth+w,g=this._itemGroupLocation.y),o=this._getItemShapeByType(m,g,y,b,this._selectedMap[r]?E:"#ccc",i,E),o._name=r,o=new s(o),u={zlevel:this._zlevelBase,style:{x:m+y+5,y:g+b/2,color:this._selectedMap[r]?c.color==="auto"?E:c.color:"#ccc",text:p,textFont:h,textBaseline:"middle"},highlightStyle:{color:E,brushType:"fill"},hoverable:!!this.legendOption.selectedMode,clickable:!!this.legendOption.selectedMode},this.legendOption.orient==="vertical"&&this.legendOption.x==="right"&&(u.style.x-=y+10,u.style.textAlign="right"),u._name=r,u=new n(u),this.legendOption.selectedMode&&(o.onclick=u.onclick=this._legendSelected,o.onmouseover=u.onmouseover=this.hoverConnect,o.hoverConnect=u.id,u.hoverConnect=o.id),this.shapeList.push(o),this.shapeList.push(u),this.legendOption.orient==="horizontal"?m+=y+5+f.getTextWidth(p,h)+w:g+=b+w}this.legendOption.orient==="horizontal"&&this.legendOption.x==="center"&&g!=this._itemGroupLocation.y&&this._mLineOptimize()},_getName:function(e){return typeof e.name!="undefined"?e.name:e},_getFormatterName:function(e){var t=this.legendOption.formatter,n;return typeof t=="function"?n=t.call(this.myChart,e):typeof t=="string"?n=t.replace("{name}",e):n=e,n},_getFormatterNameFromData:function(e){var t=this._getName(e);return this._getFormatterName(t)},_mLineOptimize:function(){var e=[],t=this._itemGroupLocation.x;for(var n=2,r=this.shapeList.length;nh?(u=h,l+=i+n):u=Math.max(u,d),l+=i+n,d=0;continue}d+=r+f.getTextWidth(this._getFormatterNameFromData(e[m]),e[m].textStyle?this.getFont(a.merge(e[m].textStyle||{},s)):o)+n}l=Math.max(l,i),d-=n,d>h?(u=h,l+=i+n):u=Math.max(u,d)}else{for(var m=0;mp?(l=p,u+=v+n):l=Math.max(l,d),u+=v+n,d=0;continue}d+=i+n}u=Math.max(u,v),d-=n,d>p?(l=p,u+=v+n):l=Math.max(l,d)}h=this.zr.getWidth(),p=this.zr.getHeight();var g;switch(this.legendOption.x){case"center":g=Math.floor((h-u)/2);break;case"left":g=this.legendOption.padding[3]+this.legendOption.borderWidth;break;case"right":g=h-u-this.legendOption.padding[1]-this.legendOption.padding[3]-this.legendOption.borderWidth*2;break;default:g=this.parsePercent(this.legendOption.x,h)}var y;switch(this.legendOption.y){case"top":y=this.legendOption.padding[0]+this.legendOption.borderWidth;break;case"bottom":y=p-l-this.legendOption.padding[0]-this.legendOption.padding[2]-this.legendOption.borderWidth*2;break;case"center":y=Math.floor((p-l)/2);break;default:y=this.parsePercent(this.legendOption.y,p)}return{x:g,y:y,width:u,height:l,maxWidth:v}},_getSomethingByName:function(e){var t=this.option.series,n;for(var r=0,i=t.length;r=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height?!0:!1}},i.inherits(o,t),o}),r("echarts/component/timeline",["require","./base","zrender/shape/Rectangle","../util/shape/Icon","../util/shape/Chain","../config","zrender/tool/util","zrender/tool/area","zrender/tool/event","../component"],function(e){function f(e,n,r,i,u){t.call(this,e,n,r,i,u);var a=this;a._onclick=function(e){return a.__onclick(e)},a._ondrift=function(e,t){return a.__ondrift(this,e,t)},a._ondragend=function(){return a.__ondragend()},a._setCurrentOption=function(){var e=a.timelineOption;a.currentIndex%=e.data.length;var t=a.options[a.currentIndex]||{};a.myChart.setOption(t,e.notMerge),a.messageCenter.dispatch(s.EVENT.TIMELINE_CHANGED,null,{currentIndex:a.currentIndex,data:e.data[a.currentIndex].name!=null?e.data[a.currentIndex].name:e.data[a.currentIndex]},a.myChart)},a._onFrame=function(){a._setCurrentOption(),a._syncHandleShape(),a.timelineOption.autoPlay&&(a.playTicket=setTimeout(function(){a.currentIndex+=1;if(!a.timelineOption.loop&&a.currentIndex>=a.timelineOption.data.length){a.currentIndex=a.timelineOption.data.length-1,a.stop();return}a._onFrame()},a.timelineOption.playInterval))},this.setTheme(!1),this.options=this.option.options,this.currentIndex=this.timelineOption.currentIndex%this.timelineOption.data.length,!this.timelineOption.notMerge&&this.currentIndex!==0&&(this.options[this.currentIndex]=o.merge(this.options[this.currentIndex],this.options[0])),this.timelineOption.show&&(this._buildShape(),this._syncHandleShape()),this._setCurrentOption();if(this.timelineOption.autoPlay){var a=this;this.playTicket=setTimeout(function(){a.play()},this.ecTheme.animationDuration)}}function l(e,t){var n=2,i=t.x+n,s=t.y+n+2,o=t.width-n,u=t.height-n,a=t.symbol;if(a==="last")e.moveTo(i+o-2,s+u/3),e.lineTo(i+o-2,s),e.lineTo(i+2,s+u/2),e.lineTo(i+o-2,s+u),e.lineTo(i+o-2,s+u/3*2),e.moveTo(i,s),e.lineTo(i,s);else if(a==="next")e.moveTo(i+2,s+u/3),e.lineTo(i+2,s),e.lineTo(i+o-2,s+u/2),e.lineTo(i+2,s+u),e.lineTo(i+2,s+u/3*2),e.moveTo(i,s),e.lineTo(i,s);else if(a==="play")if(t.status==="stop")e.moveTo(i+2,s),e.lineTo(i+o-2,s+u/2),e.lineTo(i+2,s+u),e.lineTo(i+2,s);else{var f=t.brushType==="both"?2:3;e.rect(i+2,s,f,u),e.rect(i+o-f-2,s,f,u)}else if(a.match("image")){var l="";l=a.replace(new RegExp("^image:\\/\\/"),""),a=r.prototype.iconLibrary.image,a(e,{x:i,y:s,width:o,height:u,image:l})}}var t=e("./base"),n=e("zrender/shape/Rectangle"),r=e("../util/shape/Icon"),i=e("../util/shape/Chain"),s=e("../config"),o=e("zrender/tool/util"),u=e("zrender/tool/area"),a=e("zrender/tool/event");return f.prototype={type:s.COMPONENT_TYPE_TIMELINE,_buildShape:function(){this._location=this._getLocation(),this._buildBackground(),this._buildControl(),this._chainPoint=this._getChainPoint();if(this.timelineOption.label.show){var e=this._getInterval();for(var t=0,n=this._chainPoint.length;t3){var o=!1,a,f;n=0;while(!o&&n1){var v=c/h;v=v>50?50:v<20?5:v,c-=v*2;if(e.type==="number")for(var m=0;m0?"right":"left",S=[r*Math.PI/180,f,l-5]):S=!1,g.push({x:f,n:b,isEmpty:w,symbol:y,symbolSize:a[m].symbolSize||n,color:a[m].color,borderColor:a[m].borderColor,borderWidth:a[m].borderWidth,name:this._getReformedLabel(m),textColor:u.color,textAlign:E,textBaseline:u.baseline||"middle",textX:f,textY:l-(r?5:0),textFont:a[m].textStyle?this.getFont(u):s,rotation:S,showLabel:!1});return g},_buildBackground:function(){var e=this.timelineOption,t=e.padding,r=this._location.width,i=this._location.height;(e.borderWidth!==0||e.backgroundColor.replace(/\s/g,"")!="rgba(0,0,0,0)")&&this.shapeList.push(new n({zlevel:this._zlevelBase,hoverable:!1,style:{x:this._location.x-t[3],y:this._location.y-t[0],width:r+t[1]+t[3],height:i+t[0]+t[2],brushType:e.borderWidth===0?"fill":"both",color:e.backgroundColor,strokeColor:e.borderColor,lineWidth:e.borderWidth}}))},_buildControl:function(){var e=this,t=this.timelineOption,n=t.lineStyle,i=t.controlStyle;if(t.controlPosition==="none")return;var s=15,u=5,a;t.controlPosition==="left"?(a=this._location.x,this._location.x+=(s+u)*3):(a=this._location.x2-((s+u)*3-u),this._location.x2-=(s+u)*3);var f=this._location.y,l={zlevel:this._zlevelBase+1,style:{iconType:"timelineControl",symbol:"last",x:a,y:f,width:s,height:s,brushType:"stroke",color:i.normal.color,strokeColor:i.normal.color,lineWidth:n.width},highlightStyle:{color:i.emphasis.color,strokeColor:i.emphasis.color,lineWidth:n.width+1},clickable:!0};this._ctrLastShape=new r(l),this._ctrLastShape.onclick=function(){e.last()},this.shapeList.push(this._ctrLastShape),a+=s+u,this._ctrPlayShape=new r(o.clone(l)),this._ctrPlayShape.style.brushType="fill",this._ctrPlayShape.style.symbol="play",this._ctrPlayShape.style.status=this.timelineOption.autoPlay?"playing":"stop",this._ctrPlayShape.style.x=a,this._ctrPlayShape.onclick=function(){e._ctrPlayShape.style.status==="stop"?e.play():e.stop()},this.shapeList.push(this._ctrPlayShape),a+=s+u,this._ctrNextShape=new r(o.clone(l)),this._ctrNextShape.style.symbol="next",this._ctrNextShape.style.x=a,this._ctrNextShape.onclick=function(){e.next()},this.shapeList.push(this._ctrNextShape)},_buildChain:function(){var e=this.timelineOption,t=e.lineStyle;this._timelineShae={zlevel:this._zlevelBase,style:{x:this._location.x,y:this.subPixelOptimize(this._location.y,t.width),width:this._location.x2-this._location.x,height:this._location.height,chainPoint:this._chainPoint,brushType:"both",strokeColor:t.color,lineWidth:t.width,lineType:t.type},hoverable:!1,clickable:!0,onclick:this._onclick},this._timelineShae=new i(this._timelineShae),this.shapeList.push(this._timelineShae)},_buildHandle:function(){var e=this._chainPoint[this.currentIndex],t=e.symbolSize+1;t=t<5?5:t,this._handleShape={zlevel:this._zlevelBase+1,hoverable:!1,draggable:!0,style:{iconType:"diamond",n:e.n,x:e.x-t,y:this._location.y+this._location.height/4-t,width:t*2,height:t*2,brushType:"both",textPosition:"specific",textX:e.x,textY:this._location.y-this._location.height/4,textAlign:"center",textBaseline:"middle"},highlightStyle:{},ondrift:this._ondrift,ondragend:this._ondragend},this._handleShape=new r(this._handleShape),this.shapeList.push(this._handleShape)},_syncHandleShape:function(){if(!this.timelineOption.show)return;var e=this.timelineOption,t=e.checkpointStyle,n=this._chainPoint[this.currentIndex];this._handleShape.style.text=t.label.show?n.name:"",this._handleShape.style.textFont=n.textFont,this._handleShape.style.n=n.n,t.symbol==="auto"?this._handleShape.style.iconType=n.symbol!="none"?n.symbol:"diamond":(this._handleShape.style.iconType=t.symbol,t.symbol.match("star")&&(this._handleShape.style.n=t.symbol.replace("star","")-0||5,this._handleShape.style.iconType="star"));var r;t.symbolSize==="auto"?(r=n.symbolSize+2,r=r<5?5:r):r=t.symbolSize-0,this._handleShape.style.color=t.color==="auto"?n.color?n.color:e.controlStyle.emphasis.color:t.color,this._handleShape.style.textColor=t.label.textStyle.color==="auto"?this._handleShape.style.color:t.label.textStyle.color,this._handleShape.highlightStyle.strokeColor=this._handleShape.style.strokeColor=t.borderColor==="auto"?n.borderColor?n.borderColor:"#fff":t.borderColor,this._handleShape.style.lineWidth=t.borderWidth==="auto"?n.borderWidth?n.borderWidth:0:t.borderWidth-0,this._handleShape.highlightStyle.lineWidth=this._handleShape.style.lineWidth+1,this.zr.animate(this._handleShape.id,"style").when(500,{x:n.x-r,textX:n.x,y:this._location.y+this._location.height/4-r,width:r*2,height:r*2}).start("ExponentialOut")},_findChainIndex:function(e){var t=this._chainPoint,n=t.length;if(e<=t[0].x)return 0;if(e>=t[n-1].x)return n-1;for(var r=0;r=t[r].x&&e<=t[r+1].x)return Math.abs(e-t[r].x)=n[r-1].x-n[r-1].symbolSize?(e.style.x=n[r-1].x-n[r-1].symbolSize,i=r-1):(e.style.x+=t,i=this._findChainIndex(e.style.x));var s=n[i],o=s.symbolSize+2;e.style.iconType=s.symbol,e.style.n=s.n,e.style.textX=e.style.x+o/2,e.style.y=this._location.y+this._location.height/4-o,e.style.width=o*2,e.style.height=o*2,e.style.text=s.name;if(i===this.currentIndex)return!0;this.currentIndex=i;if(this.timelineOption.realtime){clearTimeout(this.playTicket);var u=this;this.playTicket=setTimeout(function(){u._setCurrentOption()},200)}return!0},__ondragend:function(){this.isDragend=!0},ondragend:function(e,t){if(!this.isDragend||!e.target)return;!this.timelineOption.realtime&&this._setCurrentOption(),t.dragOut=!0,t.dragIn=!0,t.needRefresh=!1,this.isDragend=!1,this._syncHandleShape();return},last:function(){return this.timelineOption.autoPlay&&this.stop(),this.currentIndex-=1,this.currentIndex<0&&(this.currentIndex=this.timelineOption.data.length-1),this._onFrame(),this.currentIndex},next:function(){return this.timelineOption.autoPlay&&this.stop(),this.currentIndex+=1,this.currentIndex>=this.timelineOption.data.length&&(this.currentIndex=0),this._onFrame(),this.currentIndex},play:function(e,t){return this._ctrPlayShape&&this._ctrPlayShape.style.status!="playing"&&(this._ctrPlayShape.style.status="playing",this.zr.modShape(this._ctrPlayShape.id),this.zr.refresh()),this.timelineOption.autoPlay=t!=null?t:!0,this.timelineOption.autoPlay||clearTimeout(this.playTicket),this.currentIndex=e!=null?e:this.currentIndex+1,this.currentIndex>=this.timelineOption.data.length&&(this.currentIndex=0),this._onFrame(),this.currentIndex},stop:function(){return this._ctrPlayShape&&this._ctrPlayShape.style.status!="stop"&&(this._ctrPlayShape.style.status="stop",this.zr.modShape(this._ctrPlayShape.id),this.zr.refresh()),this.timelineOption.autoPlay=!1,clearTimeout(this.playTicket),this.currentIndex},resize:function(){this.timelineOption.show&&(this.clear(),this._buildShape(),this._syncHandleShape())},setTheme:function(e){this.timelineOption=this.reformOption(o.clone(this.option.timeline)),this.timelineOption.padding=this.reformCssArray(this.timelineOption.padding),this.timelineOption.label.textStyle=o.merge(this.timelineOption.label.textStyle||{},this.ecTheme.textStyle),this.timelineOption.checkpointStyle.label.textStyle=o.merge(this.timelineOption.checkpointStyle.label.textStyle||{},this.ecTheme.textStyle),this.timelineOption.show&&e&&(this.clear(),this._buildShape(),this._syncHandleShape())},dispose:function(){this.clear(),this.shapeList=null,clearTimeout(this.playTicket)}},r.prototype.iconLibrary.timelineControl=l,o.inherits(f,t),e("../component").define("timeline",f),f}),r("zrender/loadingEffect/Bar",["require","./Base","../tool/util","../tool/color","../shape/Rectangle"],function(e){function s(e){t.call(this,e)}var t=e("./Base"),n=e("../tool/util"),r=e("../tool/color"),i=e("../shape/Rectangle");return n.inherits(s,t),s.prototype._start=function(e,t){var s=n.merge(this.options,{textStyle:{color:"#888"},backgroundColor:"rgba(250, 250, 250, 0.8)",effectOption:{x:0,y:this.canvasHeight/2-30,width:this.canvasWidth,height:5,brushType:"fill",timeInterval:100}}),o=this.createTextShape(s.textStyle),u=this.createBackgroundShape(s.backgroundColor),a=s.effectOption,f=new i({highlightStyle:n.clone(a)});f.highlightStyle.color=a.color||r.getLinearGradient(a.x,a.y,a.x+a.width,a.y+a.height,[[0,"#ff6400"],[.5,"#ffe100"],[1,"#b1ff00"]]);if(s.progress!=null){e(u),f.highlightStyle.width=this.adjust(s.progress,[0,1])*s.effectOption.width,e(f),e(o),t();return}return f.highlightStyle.width=0,setInterval(function(){e(u),f.highlightStyle.width=h&&(c[n].len=Math.ceil(Math.random()*400),r.xStart=-400,r.xEnd=-400+c[n].len,r.yStart=Math.ceil(Math.random()*p),r.yEnd=r.yStart),r.xStart+=c[n].animationX,r.xEnd+=c[n].animationX,e(c[n])}e(o),t()},a.timeInterval)},s}),r("zrender/loadingEffect/Ring",["require","./Base","../tool/util","../tool/color","../shape/Ring","../shape/Sector"],function(e){function o(e){t.call(this,e)}var t=e("./Base"),n=e("../tool/util"),r=e("../tool/color"),i=e("../shape/Ring"),s=e("../shape/Sector");return n.inherits(o,t),o.prototype._start=function(e,t){var o=n.merge(this.options,{textStyle:{color:"#07a"},backgroundColor:"rgba(250, 250, 250, 0.8)",effect:{x:this.canvasWidth/2,y:this.canvasHeight/2,r0:60,r:100,color:"#bbdcff",brushType:"fill",textPosition:"inside",textFont:"normal 30px verdana",textColor:"rgba(30, 144, 255, 0.6)",timeInterval:100}}),u=o.effect,a=o.textStyle;a.x==null&&(a.x=u.x),a.y==null&&(a.y=u.y+(u.r0+u.r)/2-5);var f=this.createTextShape(o.textStyle),l=this.createBackgroundShape(o.backgroundColor),c=u.x,h=u.y,p=u.r0+6,d=u.r-6,v=u.color,m=r.lift(v,.1),g=new i({highlightStyle:n.clone(u)}),y=[],b=r.getGradientColors(["#ff6400","#ffe100","#97ff00"],25),w=15,E=240;for(var S=0;S<16;S++)y.push(new s({highlightStyle:{x:c,y:h,r0:p,r:d,startAngle:E-w,endAngle:E,brushType:"fill",color:m},_color:r.getLinearGradient(c+p*Math.cos(E,!0),h-p*Math.sin(E,!0),c+p*Math.cos(E-w,!0),h-p*Math.sin(E-w,!0),[[0,b[S*2]],[1,b[S*2+1]]])})),E-=w;E=360;for(var S=0;S<4;S++)y.push(new s({highlightStyle:{x:c,y:h,r0:p,r:d,startAngle:E-w,endAngle:E,brushType:"fill",color:m},_color:r.getLinearGradient(c+p*Math.cos(E,!0),h-p*Math.sin(E,!0),c+p*Math.cos(E-w,!0),h-p*Math.sin(E-w,!0),[[0,b[S*2+32]],[1,b[S*2+33]]])})),E-=w;var x=0;if(o.progress!=null){e(l),x=this.adjust(o.progress,[0,1]).toFixed(2)*100/5,g.highlightStyle.text=x*5+"%",e(g);for(var S=0;S<20;S++)y[S].highlightStyle.color=S=20?-20:1,e(g);for(var n=0;n<20;n++)y[n].highlightStyle.color=n ");var u=-1;for(var a=0,f=o.length;a-1){o.splice(u,1),this._optionRestore.series[e][n].data.splice(u,1);var c=this.chart[i.type];c&&c.delMark(e,t.join(" > "),n)}return this},getDom:function(){return this.dom},getZrender:function(){return this._zr},getDataURL:function(e){if(!s)return"";if(this._chartList.length===0){var t="IMG"+this.id,n=document.getElementById(t);if(n)return n.src}var r=this.component.tooltip;r&&r.hideTip();switch(e){case"jpeg":break;default:e="png"}var i=this._option.backgroundColor;return i&&i.replace(" ","")==="rgba(0,0,0,0)"&&(i="#fff"),this._zr.toDataURL("image/"+e,i)},getImage:function(e){var t=this._optionRestore.title,n=document.createElement("img");return n.src=this.getDataURL(e),n.title=t&&t.text||"ECharts",n},getConnectedDataURL:function(t){if(!this.isConnected())return this.getDataURL(t);var n=this.dom,r={self:{img:this.getDataURL(t),left:n.offsetLeft,top:n.offsetTop,right:n.offsetLeft+n.offsetWidth,bottom:n.offsetTop+n.offsetHeight}},i=r.self.left,s=r.self.top,o=r.self.right,u=r.self.bottom;for(var a in this._connected)n=this._connected[a].getDom(),r[a]={img:this._connected[a].getDataURL(t),left:n.offsetLeft,top:n.offsetTop,right:n.offsetLeft+n.offsetWidth,bottom:n.offsetTop+n.offsetHeight},i=Math.min(i,r[a].left),s=Math.min(s,r[a].top),o=Math.max(o,r[a].right),u=Math.max(u,r[a].bottom);var f=document.createElement("div");f.style.position="absolute",f.style.left="-4000px",f.style.width=o-i+"px",f.style.height=u-s+"px",document.body.appendChild(f);var l=e("zrender").init(f),c=e("zrender/shape/Image");for(var a in r)l.addShape(new c({style:{x:r[a].left-i,y:r[a].top-s,image:r[a].img}}));l.render();var h=this._option.backgroundColor;h&&h.replace(/ /g,"")==="rgba(0,0,0,0)"&&(h="#fff");var p=l.toDataURL("image/png",h);return setTimeout(function(){l.dispose(),f.parentNode.removeChild(f),f=null},100),p},getConnectedImage:function(e){var t=this._optionRestore.title,n=document.createElement("img");return n.src=this.getConnectedDataURL(e),n.title=t&&t.text||"ECharts",n},on:function(e,t){return this._messageCenterOutSide.bind(e,t,this),this},un:function(e,t){return this._messageCenterOutSide.unbind(e,t),this},connect:function(e){if(!e)return this;this._connected||(this._connected={});if(e instanceof Array)for(var t=0,n=e.length;t=n/3?1:2),o=t.y+Math.sin(i)*r*(r>=n/3?1:2);i=t.angle-Math.PI/2,e.moveTo(s,o),e.lineTo(t.x+Math.cos(i)*r,t.y-Math.sin(i)*r),e.lineTo(t.x+Math.cos(t.angle)*n,t.y-Math.sin(t.angle)*n),e.lineTo(t.x-Math.cos(i)*r,t.y+Math.sin(i)*r),e.lineTo(s,o);return},getRect:function(e){if(e.__rect)return e.__rect;var t=e.width*2,n=e.x,r=e.y,i=n+Math.cos(e.angle)*e.r,s=r-Math.sin(e.angle)*e.r;return e.__rect={x:Math.min(n,i)-t,y:Math.min(r,s)-t,width:Math.abs(n-i)+t,height:Math.abs(r-s)+t},e.__rect},isCover:e("./normalIsCover")},n.inherits(r,t),r}),r("echarts/chart/gauge",["require","../component/base","./base","../util/shape/GaugePointer","zrender/shape/Text","zrender/shape/Line","zrender/shape/Rectangle","zrender/shape/Circle","zrender/shape/Sector","../config","../util/ecData","../util/accMath","zrender/tool/util","../chart"],function(e){function p(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this),this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("../util/shape/GaugePointer"),i=e("zrender/shape/Text"),s=e("zrender/shape/Line"),o=e("zrender/shape/Rectangle"),u=e("zrender/shape/Circle"),a=e("zrender/shape/Sector"),f=e("../config"),l=e("../util/ecData"),c=e("../util/accMath"),h=e("zrender/tool/util");return p.prototype={type:f.CHART_TYPE_GAUGE,_buildShape:function(){var e=this.series;this._paramsMap={};for(var t=0,n=e.length;t=110&&v<=250?"left":v<=70||v>=290?"right":"center",textBaseline:v>=10&&v<=170?"top":v>=190&&v<=350?"bottom":"middle",textFont:u,shadowColor:o.shadowColor,shadowBlur:o.shadowBlur,shadowOffsetX:o.shadowOffsetX,shadowOffsetY:o.shadowOffsetY}}))},_buildPointer:function(e){var t=this.series[e];if(!t.pointer.show)return;var n=t.max-t.min,i=t.pointer,s=this._paramsMap[e],o=this.parsePercent(i.length,s.radius[1]),a=this.parsePercent(i.width,s.radius[1]),f=s.center,c=this._getValue(e);c=c2?2:a/2,color:"#fff"}});l.pack(d,this.series[e],e,this.series[e].data[0],0,this.series[e].data[0].name,c),this.shapeList.push(d),this.shapeList.push(new u({zlevel:this._zlevelBase+2,hoverable:!1,style:{x:f[0],y:f[1],r:i.width/2.5,color:"#fff"}}))},_buildTitle:function(e){var t=this.series[e];if(!t.title.show)return;var n=t.data[0],r=n.name!=null?n.name:"";if(r!==""){var s=t.title,o=s.offsetCenter,u=s.textStyle,a=u.color,f=this._paramsMap[e],l=f.center[0]+this.parsePercent(o[0],f.radius[1]),c=f.center[1]+this.parsePercent(o[1],f.radius[1]);this.shapeList.push(new i({zlevel:this._zlevelBase+(Math.abs(l-f.center[0])+Math.abs(c-f.center[1]))=t)return n[r][1];return n[n.length-1][1]},_getSector:function(e,t,n,r,i,s,o){return new a({zlevel:this._zlevelBase,hoverable:!1,style:{x:e[0],y:e[1],r0:t,r:n,startAngle:r,endAngle:i,brushType:"fill",color:s,shadowColor:o.shadowColor,shadowBlur:o.shadowBlur,shadowOffsetX:o.shadowOffsetX,shadowOffsetY:o.shadowOffsetY}})},_getLabelText:function(e,t){if(e){if(typeof e=="function")return e.call(this.myChart,t);if(typeof e=="string")return e.replace("{value}",t)}return t},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()}},h.inherits(p,n),h.inherits(p,t),e("../chart").define("gauge",p),p}),r("echarts/chart/funnel",["require","../component/base","./base","zrender/shape/Text","zrender/shape/Line","zrender/shape/Polygon","../config","../util/ecData","../util/number","zrender/tool/util","zrender/tool/color","zrender/tool/area","../chart"],function(e){function h(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this),this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("zrender/shape/Text"),i=e("zrender/shape/Line"),s=e("zrender/shape/Polygon"),o=e("../config"),u=e("../util/ecData"),a=e("../util/number"),f=e("zrender/tool/util"),l=e("zrender/tool/color"),c=e("zrender/tool/area");return h.prototype={type:o.CHART_TYPE_FUNNEL,_buildShape:function(){var e=this.series,t=this.component.legend;this._paramsMap={},this._selected={},this.selectedMap={};var n;for(var r=0,i=e.length;r1?(i.height-(o-1)*h)/o:i.height,d,v=i.y,m=n.sort==="descending"?this._getItemWidth(e,u[0].value):a.parsePercent(n.minSize,i.width),g=n.sort==="descending"?1:0,y=i.centerX,b=[[y-m/2-(m===0?0:10),v-(m===0?10:5)],[y+m/2+(m===0?0:10),v-(m===0?10:5)]];for(var f=0,l=u.length;fc.getTextWidth(w,E)?T="#fff":T=l.reverse(n)):g.position==="left"?(S="right",x=b==="auto"?d.x-10:d.centerX-Math.max(o,u)/2-b):(S="left",x=b==="auto"?d.x+d.width+10:d.centerX+Math.max(o,u)/2+b);var N={zlevel:this._zlevelBase+1,style:{x:x,y:s+a/2,color:y.color||T,text:w,textAlign:y.align||S,textBaseline:y.baseline||"middle",textFont:E}};return m="emphasis",g=v[m].label||g,y=g.textStyle||y,b=v[m].labelLine.length||b,g.position=g.position||v.normal.label.position,w=this.getLabelText(e,t,m),E=this.getFont(y),T=n,g.position==="inner"||g.position==="inside"?(S="center",x=i+o/2,Math.max(o,u)/2>c.getTextWidth(w,E)?T="#fff":T=l.reverse(n)):g.position==="left"?(S="right",x=b==="auto"?d.x-10:d.centerX-Math.max(o,u)/2-b):(S="left",x=b==="auto"?d.x+d.width+10:d.centerX+Math.max(o,u)/2+b),N.highlightStyle={x:x,color:y.color||T,text:w,textAlign:y.align||S,textFont:E,brushType:"fill"},new r(N)},getLabelText:function(e,t,n){var r=this.series,i=r[e],s=i.data[t],o=this.deepQuery([s,i],"itemStyle."+n+".label.formatter");if(!o)return s.name;if(typeof o=="function")return o.call(this.myChart,i.name,s.name,s.value);if(typeof o=="string")return o=o.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}"),o=o.replace("{a0}",i.name).replace("{b0}",s.name).replace("{c0}",s.value),o},getLabelLine:function(e,t,n,r,s,o,u,a){var l=this.series[e],c=l.data[t],h=this._paramsMap[e].location,p=f.merge(f.clone(c.itemStyle)||{},l.itemStyle),d="normal",v=p[d].labelLine,m=p[d].labelLine.length,g=v.lineStyle||{},y=p[d].label;y.position=y.position||p.normal.label.position;var b;y.position==="inner"||y.position==="inside"?b=r+o/2:y.position==="left"?b=m==="auto"?h.x-10:h.centerX-Math.max(o,u)/2-m:b=m==="auto"?h.x+h.width+10:h.centerX+Math.max(o,u)/2+m;var w={zlevel:this._zlevelBase+1,hoverable:!1,style:{xStart:h.centerX,yStart:s+a/2,xEnd:b,yEnd:s+a/2,strokeColor:g.color||n,lineType:g.type,lineWidth:g.width}};return d="emphasis",v=p[d].labelLine||v,m=p[d].labelLine.length||m,g=v.lineStyle||g,y=p[d].label||y,y.position=y.position,y.position==="inner"||y.position==="inside"?b=r+o/2:y.position==="left"?b=m==="auto"?h.x-10:h.centerX-Math.max(o,u)/2-m:b=m==="auto"?h.x+h.width+10:h.centerX+Math.max(o,u)/2+m,w.highlightStyle={xEnd:b,strokeColor:g.color||n,lineType:g.type,lineWidth:g.width},new i(w)},_needLabel:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".label.show")},_needLabelLine:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".labelLine.show")},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()}},f.inherits(h,n),f.inherits(h,t),e("../chart").define("funnel",h),h}),r("echarts/component/categoryAxis",["require","./base","zrender/shape/Text","zrender/shape/Line","zrender/shape/Rectangle","../config","zrender/tool/util","zrender/tool/area","../component"],function(e){function a(e,n,r,i,s,o){if(i.data.length<1){console.error("option.data.length < 1.");return}t.call(this,e,n,r,i,s),this.grid=this.component.grid;for(var u in o)this[u]=o[u];this.refresh(i)}var t=e("./base"),n=e("zrender/shape/Text"),r=e("zrender/shape/Line"),i=e("zrender/shape/Rectangle"),s=e("../config"),o=e("zrender/tool/util"),u=e("zrender/tool/area");return a.prototype={type:s.COMPONENT_TYPE_AXIS_CATEGORY,_getReformedLabel:function(e){var t=typeof this.option.data[e].value!="undefined"?this.option.data[e].value:this.option.data[e],n=this.option.data[e].formatter||this.option.axisLabel.formatter;return n&&(typeof n=="function"?t=n.call(this.myChart,t):typeof n=="string"&&(t=n.replace("{value}",t))),t},_getInterval:function(){var e=this.option.axisLabel.interval;if(e=="auto"){var t=this.option.axisLabel.textStyle.fontSize,n=this.option.data,r=this.option.data.length;if(this.isHorizontal())if(r>3){var i=this.getGap(),s=!1,a,f,l=Math.floor(.5/i);l=l<1?1:l,e=Math.floor(15/i);while(!s&&e=0;c-=e){if(this.option.axisLabel.rotate!==0)f=t;else if(n[c].textStyle)f=u.getTextWidth(this._getReformedLabel(c),this.getFont(o.merge(n[c].textStyle,this.option.axisLabel.textStyle)));else{var h=this._getReformedLabel(c)+"",p=(h.match(/\w/g)||"").length,d=h.length-p;f=p*t*2/3+d*t}if(a3){var i=this.getGap();e=Math.floor(11/i);while(i*e-60?-u:0;if(this.isHorizontal()){var c=this.option.position=="bottom"?n.inside?this.grid.getYend()-i-1:this.grid.getYend()+1:n.inside?this.grid.getY()+1:this.grid.getY()-i-1,h;for(var p=l;p=0?f:0),o),e={_axisShape:"axisTick",zlevel:this._zlevelBase,hoverable:!1,style:{xStart:h,yStart:c,xEnd:h,yEnd:c+i,strokeColor:s,lineWidth:o}},this.shapeList.push(new r(e))}else{var d=this.option.position=="left"?n.inside?this.grid.getX()+1:this.grid.getX()-i-1:n.inside?this.grid.getXend()-i-1:this.grid.getXend()+1,v;for(var p=l;p=0?f:0),o),e={_axisShape:"axisTick",zlevel:this._zlevelBase,hoverable:!1,style:{xStart:d,yStart:v,xEnd:d+i,yEnd:v,strokeColor:s,lineWidth:o}},this.shapeList.push(new r(e))}},_buildAxisLabel:function(){var e,t=this.option.data,r=this.option.data.length,i=this.option.axisLabel.rotate,s=this.option.axisLabel.margin,u=this.option.axisLabel.clickable,a=this.option.axisLabel.textStyle,f;if(this.isHorizontal()){var l,c;this.option.position=="bottom"?(l=this.grid.getYend()+s,c="top"):(l=this.grid.getY()-s,c="bottom");for(var h=0;h0?this.option.position=="bottom"?"right":"left":this.option.position=="bottom"?"left":"right",e.rotation=[i*Math.PI/180,e.style.x,e.style.y]),this.shapeList.push(new n(this._axisLabelClickable(u,e)))}}else{var p,d;this.option.position=="left"?(p=this.grid.getX()-s,d="right"):(p=this.grid.getXend()+s,d="left");for(var h=0;h1?e-1:1)},getCoord:function(e){var t=this.option.data,n=t.length,r=this.getGap(),i=this.option.boundaryGap?r/2:0;for(var s=0;sthis.option.data.length-1)return this.isHorizontal()?this.grid.getXend():this.grid.getY();var t=this.getGap(),n=this.option.boundaryGap?t/2:0;return n+=e*t,this.isHorizontal()?n=this.grid.getX()+n:n=this.grid.getYend()-n,n},getNameByIndex:function(e){var t=this.option.data[e];return typeof t!="undefined"&&typeof t.value!="undefined"?t.value:t},getIndexByName:function(e){var t=this.option.data,n=t.length;for(var r=0;r0?this.option.position==="bottom"?"right":"left":this.option.position==="bottom"?"left":"right",e.rotation=[i*Math.PI/180,e.style.x,e.style.y]),this.shapeList.push(new n(this._axisLabelClickable(o,e)))}else{var c,h;this.option.position==="left"?(c=this.grid.getX()-s,h="right"):(c=this.grid.getXend()+s,h="left");for(var l=0;l=0?t[h][l]!=null?t[h][l]+=n:t[h][l]=n:t[p][l]!=null?t[p][l]+=n:t[p][l]=n,this.option.scale&&t[f].push(n)}}}for(var u in t){e=t[u];for(var l=0,c=e.length;l0?this.option.power:1:this._max>0?this._min=this._max/this.option.splitNumber:this._max=this._max/this.option.splitNumber),this._reformValue(this.option.scale)}else this._hasData=!0,this._min=this.option.min-0,this._max=this.option.max-0,this._customerValue()},_reformValue:function(e){var t=this.option.splitNumber,n=this.option.precision,r,i;n===0?i=this.option.power>1?this.option.power:1:(i=Math.pow(10,n),this._min*=i,this._max*=i,i=this.option.power);var s;if(this._min>=0&&this._max>=0){if(!e){while(this._max/i1?i/10:1,s=this._max-this._min,r=Math.ceil(s/t/i)*i,this._max=this._min+r*t}else if(this._min<=0&&this._max<=0){i=-i;if(!e){while(this._min/ii&&i!=-1)i/=10;n===0&&(this._min=Math.ceil(this._min/i)*i,this._max=Math.floor(this._max/i)*i)}i=i<-1?i/10:-1,s=this._min-this._max,r=-Math.ceil(s/t/i)*i,this._min=-r*t+this._max}else{s=this._max-this._min;while(s/ithis._max?this._max:e;var t;return this.isHorizontal()?t=this.grid.getX()+(e-this._min)/(this._max-this._min)*this.grid.getWidth():t=this.grid.getYend()-(e-this._min)/(this._max-this._min)*this.grid.getHeight(),t},getCoordSize:function(e){return this.isHorizontal()?Math.abs(e/(this._max-this._min)*this.grid.getWidth()):Math.abs(e/(this._max-this._min)*this.grid.getHeight())},getValueFromCoord:function(e){var t;return this.isHorizontal()?(e=ethis.grid.getXend()?this.grid.getXend():e,t=this._min+(e-this.grid.getX())/this.grid.getWidth()*(this._max-this._min)):(e=ethis.grid.getYend()?this.grid.getYend():e,t=this._max-(e-this.grid.getY())/this.grid.getHeight()*(this._max-this._min)),t.toFixed(2)-0}},o.inherits(u,t),e("../component").define("valueAxis",u),u}),r("echarts/component/axis",["require","./base","zrender/shape/Line","../config","../util/ecData","zrender/tool/util","zrender/tool/color","./categoryAxis","./valueAxis","../component"],function(e){function u(e,n,r,i,s,o){t.call(this,e,n,r,i,s),this.axisType=o,this._axisList=[],this.refresh(i)}var t=e("./base"),n=e("zrender/shape/Line"),r=e("../config"),i=e("../util/ecData"),s=e("zrender/tool/util"),o=e("zrender/tool/color");return u.prototype={type:r.COMPONENT_TYPE_AXIS,axisBase:{_buildAxisLine:function(){var e=this.option.axisLine.lineStyle.width,t=e/2,r={_axisShape:"axisLine",zlevel:this._zlevelBase+1,hoverable:!1};switch(this.option.position){case"left":r.style={xStart:this.grid.getX()-t,yStart:this.grid.getYend(),xEnd:this.grid.getX()-t,yEnd:this.grid.getY(),lineCap:"round"};break;case"right":r.style={xStart:this.grid.getXend()+t,yStart:this.grid.getYend(),xEnd:this.grid.getXend()+t,yEnd:this.grid.getY(),lineCap:"round"};break;case"bottom":r.style={xStart:this.grid.getX(),yStart:this.grid.getYend()+t,xEnd:this.grid.getXend(),yEnd:this.grid.getYend()+t,lineCap:"round"};break;case"top":r.style={xStart:this.grid.getX(),yStart:this.grid.getY()-t,xEnd:this.grid.getXend(),yEnd:this.grid.getY()-t,lineCap:"round"}}this.option.name!==""&&(r.style.text=this.option.name,r.style.textPosition=this.option.nameLocation,r.style.textFont=this.getFont(this.option.nameTextStyle),this.option.nameTextStyle.align&&(r.style.textAlign=this.option.nameTextStyle.align),this.option.nameTextStyle.baseline&&(r.style.textBaseline=this.option.nameTextStyle.baseline),this.option.nameTextStyle.color&&(r.style.textColor=this.option.nameTextStyle.color)),r.style.strokeColor=this.option.axisLine.lineStyle.color,r.style.lineWidth=e,this.isHorizontal()?r.style.yStart=r.style.yEnd=this.subPixelOptimize(r.style.yEnd,e):r.style.xStart=r.style.xEnd=this.subPixelOptimize(r.style.xEnd,e),r.style.lineType=this.option.axisLine.lineStyle.type,r=new n(r),this.shapeList.push(r)},_axisLabelClickable:function(e,t){return e?(i.pack(t,undefined,-1,undefined,-1,t.style.text),t.hoverable=!0,t.clickable=!0,t.highlightStyle={color:o.lift(t.style.color,1),brushType:"fill"},t):t},refixAxisShape:function(e,t){if(!this.option.axisLine.onZero)return;var n;if(this.isHorizontal()&&t!=null)for(var r=0,i=this.shapeList.length;r2&&(e=[e[0],e[1]]);if(this.axisType==="xAxis"){if(!e[0].position||e[0].position!="bottom"&&e[0].position!="top")e[0].position="bottom";e.length>1&&(e[1].position=e[0].position==="bottom"?"top":"bottom");for(var t=0,n=e.length;t1&&(e[1].position=e[0].position==="left"?"right":"left");for(var t=0,n=e.length;t=0&&(o.isHorizontal()?t=o.getCoord(0):n=o.getCoord(0));if(typeof t!="undefined"||typeof n!="undefined"){s=i.length;while(s--)i[s].refixAxisShape(t,n)}},refresh:function(e){if(e||this._zrWidth!=this.zr.getWidth()||this._zrHeight!=this.zr.getHeight()){this.clear(),this.option=e||this.option,this.option.grid=this.reformOption(this.option.grid);var t=this.option.grid;this._zrWidth=this.zr.getWidth(),this._zrHeight=this.zr.getHeight(),this._x=this.parsePercent(t.x,this._zrWidth),this._y=this.parsePercent(t.y,this._zrHeight);var r=this.parsePercent(t.x2,this._zrWidth),i=this.parsePercent(t.y2,this._zrHeight);typeof t.width=="undefined"?this._width=this._zrWidth-this._x-r:this._width=this.parsePercent(t.width,this._zrWidth),this._width=this._width<=0?10:this._width,typeof t.height=="undefined"?this._height=this._zrHeight-this._y-i:this._height=this.parsePercent(t.height,this._zrHeight),this._height=this._height<=0?10:this._height,this._x=this.subPixelOptimize(this._x,t.borderWidth),this._y=this.subPixelOptimize(this._y,t.borderWidth),this.shapeList.push(new n({zlevel:this._zlevelBase,hoverable:!1,style:{x:this._x,y:this._y,width:this._width,height:this._height,brushType:t.borderWidth>0?"both":"fill",color:t.backgroundColor,strokeColor:t.borderColor,lineWidth:t.borderWidth}})),this.zr.addShape(this.shapeList[0])}}},i.inherits(s,t),e("../component").define("grid",s),s}),r("echarts/component/dataZoom",["require","./base","zrender/shape/Rectangle","zrender/shape/Polygon","../util/shape/Icon","../config","zrender/tool/util","../component","../component"],function(e){function u(e,n,r,i,s){t.call(this,e,n,r,i,s);var o=this;o._ondrift=function(e,t){return o.__ondrift(this,e,t)},o._ondragend=function(){return o.__ondragend()},this._fillerSize=28,this._handleSize=8,this._isSilence=!1,this._zoom={},this.option.dataZoom=this.reformOption(this.option.dataZoom),this.zoomOption=this.option.dataZoom,this._location=this._getLocation(),this._zoom=this._getZoom(),this._backupData(),this.option.dataZoom.show&&this._buildShape(),this._syncData()}var t=e("./base"),n=e("zrender/shape/Rectangle"),r=e("zrender/shape/Polygon"),i=e("../util/shape/Icon"),s=e("../config"),o=e("zrender/tool/util");return u.prototype={type:s.COMPONENT_TYPE_DATAZOOM,_buildShape:function(){this._buildBackground(),this._buildFiller(),this._buildHandle(),this._buildFrame();for(var e=0,t=this.shapeList.length;ep&&(h+=p,p=h-p,h-=p);var d=Math.round((p-h)/100*(this.zoomOption.orient=="horizontal"?this._location.width:this._location.height));return{start:h,end:p,start2:0,end2:100,size:d,xAxisIndex:i,yAxisIndex:o,seriesIndex:r,scatterMap:this._zoom.scatterMap||{}}},_backupData:function(){this._originalData={xAxis:{},yAxis:{},series:{}};var e=this.option.xAxis,t=this._zoom.xAxisIndex;for(var n=0,r=t.length;n1?1:0)),w=t/(i-(i>1?1:0)),E=1;this.zoomOption.orient=="horizontal"&&b<1?E=Math.floor(i*3/e):this.zoomOption.orient=="vertical"&&w<1&&(E=Math.floor(i*3/t));for(var a=0,f=i;athis._location.x?1:0),height:this._location.height-(t>this._location.y?1:0),lineWidth:1,brushType:"stroke",strokeColor:this.zoomOption.handleColor}},this._endFrameShape=o.clone(this._startFrameShape),this._startFrameShape=new n(this._startFrameShape),this._endFrameShape=new n(this._endFrameShape),this.shapeList.push(this._startFrameShape),this.shapeList.push(this._endFrameShape);return},_syncHandleShape:function(){this.zoomOption.orient=="horizontal"?(this._startShape.style.x=this._fillerShae.style.x-this._handleSize,this._endShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._zoom.start=Math.floor((this._startShape.style.x-this._location.x)/this._location.width*100),this._zoom.end=Math.ceil((this._endShape.style.x+this._handleSize-this._location.x)/this._location.width*100)):(this._startShape.style.y=this._fillerShae.style.y-this._handleSize,this._endShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._zoom.start=Math.floor((this._startShape.style.y-this._location.y)/this._location.height*100),this._zoom.end=Math.ceil((this._endShape.style.y+this._handleSize-this._location.y)/this._location.height*100)),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this._syncFrameShape(),this.zr.refresh()},_syncFillerShape:function(){var e,t;this.zoomOption.orient=="horizontal"?(e=this._startShape.style.x,t=this._endShape.style.x,this._fillerShae.style.x=Math.min(e,t)+this._handleSize,this._fillerShae.style.width=Math.abs(e-t)-this._handleSize,this._zoom.start=Math.floor((Math.min(e,t)-this._location.x)/this._location.width*100),this._zoom.end=Math.ceil((Math.max(e,t)+this._handleSize-this._location.x)/this._location.width*100)):(e=this._startShape.style.y,t=this._endShape.style.y,this._fillerShae.style.y=Math.min(e,t)+this._handleSize,this._fillerShae.style.height=Math.abs(e-t)-this._handleSize,this._zoom.start=Math.floor((Math.min(e,t)-this._location.y)/this._location.height*100),this._zoom.end=Math.ceil((Math.max(e,t)+this._handleSize-this._location.y)/this._location.height*100)),this.zr.modShape(this._fillerShae.id),this._syncFrameShape(),this.zr.refresh()},_syncFrameShape:function(){this.zoomOption.orient=="horizontal"?(this._startFrameShape.style.width=this._fillerShae.style.x-this._location.x,this._endFrameShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._endFrameShape.style.width=this._location.x+this._location.width-this._endFrameShape.style.x):(this._startFrameShape.style.height=this._fillerShae.style.y-this._location.y,this._endFrameShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._endFrameShape.style.height=this._location.y+this._location.height-this._endFrameShape.style.y),this.zr.modShape(this._startFrameShape.id),this.zr.modShape(this._endFrameShape.id)},_syncShape:function(){if(!this.zoomOption.show)return;this.zoomOption.orient=="horizontal"?(this._startShape.style.x=this._location.x+this._zoom.start/100*this._location.width,this._endShape.style.x=this._location.x+this._zoom.end/100*this._location.width-this._handleSize,this._fillerShae.style.x=this._startShape.style.x+this._handleSize,this._fillerShae.style.width=this._endShape.style.x-this._startShape.style.x-this._handleSize):(this._startShape.style.y=this._location.y+this._zoom.start/100*this._location.height,this._endShape.style.y=this._location.y+this._zoom.end/100*this._location.height-this._handleSize,this._fillerShae.style.y=this._startShape.style.y+this._handleSize,this._fillerShae.style.height=this._endShape.style.y-this._startShape.style.y-this._handleSize),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this.zr.modShape(this._fillerShae.id),this._syncFrameShape(),this.zr.refresh()},_syncData:function(e){var t,n,r,i,o;for(var u in this._originalData){t=this._originalData[u];for(var a in t){o=t[a];if(typeof o=="undefined")continue;i=o.length,n=Math.floor(this._zoom.start/100*i),r=Math.ceil(this._zoom.end/100*i),this.option[u][a].type!=s.CHART_TYPE_SCATTER?this.option[u][a].data=o.slice(n,r):this.option[u][a].data=this._synScatterData(a,o)}}!this._isSilence&&(this.zoomOption.realtime||e)&&this.messageCenter.dispatch(s.EVENT.DATA_ZOOM,null,{zoom:this._zoom},this.myChart)},_synScatterData:function(e,t){if(this._zoom.start===0&&this._zoom.end==100&&this._zoom.start2===0&&this._zoom.end2==100)return t;var n=[],r=this._zoom.scatterMap[e],i,s,o,u,a;this.zoomOption.orient=="horizontal"?(i=r.x.max-r.x.min,s=this._zoom.start/100*i+r.x.min,o=this._zoom.end/100*i+r.x.min,i=r.y.max-r.y.min,u=this._zoom.start2/100*i+r.y.min,a=this._zoom.end2/100*i+r.y.min):(i=r.x.max-r.x.min,s=this._zoom.start2/100*i+r.x.min,o=this._zoom.end2/100*i+r.x.min,i=r.y.max-r.y.min,u=this._zoom.start/100*i+r.y.min,a=this._zoom.end/100*i+r.y.min);var f;for(var l=0,c=t.length;l=s&&f[0]<=o&&f[1]>=u&&f[1]<=a&&n.push(t[l]);return n},__ondrift:function(e,t,n){this.zoomOption.zoomLock&&(e=this._fillerShae);var r=e._type=="filler"?this._handleSize:0;return this.zoomOption.orient=="horizontal"?e.style.x+t-r<=this._location.x?e.style.x=this._location.x+r:e.style.x+t+e.style.width+r>=this._location.x+this._location.width?e.style.x=this._location.x+this._location.width-e.style.width-r:e.style.x+=t:e.style.y+n-r<=this._location.y?e.style.y=this._location.y+r:e.style.y+n+e.style.height+r>=this._location.y+this._location.height?e.style.y=this._location.y+this._location.height-e.style.height-r:e.style.y+=n,e._type=="filler"?this._syncHandleShape():this._syncFillerShape(),this.zoomOption.realtime&&this._syncData(),!0},__ondragend:function(){this.isDragend=!0},ondragend:function(e,t){if(!this.isDragend||!e.target)return;!this.zoomOption.realtime&&this._syncData(),t.dragOut=!0,t.dragIn=!0,!this._isSilence&&!this.zoomOption.realtime&&this.messageCenter.dispatch(s.EVENT.DATA_ZOOM,null,{zoom:this._zoom},this.myChart),t.needRefresh=!1,this.isDragend=!1;return},ondataZoom:function(e,t){t.needRefresh=!0;return},absoluteZoom:function(e){this._zoom.start=e.start,this._zoom.end=e.end,this._zoom.start2=e.start2,this._zoom.end2=e.end2,this._syncShape(),this._syncData(!0);return},rectZoom:function(e){if(!e)return this._zoom.start=this._zoom.start2=0,this._zoom.end=this._zoom.end2=100,this._syncShape(),this._syncData(!0),this._zoom;var t=this.component.grid.getArea(),n={x:e.x,y:e.y,width:e.width,height:e.height};n.width<0&&(n.x+=n.width,n.width=-n.width),n.height<0&&(n.y+=n.height,n.height=-n.height);if(n.x>t.x+t.width||n.y>t.y+t.height)return!1;n.xt.x+t.width&&(n.width=t.x+t.width-n.x),n.y+n.height>t.y+t.height&&(n.height=t.y+t.height-n.y);var r,i=(n.x-t.x)/t.width,s=1-(n.x+n.width-t.x)/t.width,o=1-(n.y+n.height-t.y)/t.height,u=(n.y-t.y)/t.height;return this.zoomOption.orient=="horizontal"?(r=this._zoom.end-this._zoom.start,this._zoom.start+=r*i,this._zoom.end-=r*s,r=this._zoom.end2-this._zoom.start2,this._zoom.start2+=r*o,this._zoom.end2-=r*u):(r=this._zoom.end-this._zoom.start,this._zoom.start+=r*o,this._zoom.end-=r*u,r=this._zoom.end2-this._zoom.start2,this._zoom.start2+=r*i,this._zoom.end2-=r*s),this._syncShape(),this._syncData(!0),this._zoom},syncBackupData:function(e){var t,n=this._originalData.series,r=e.series,i;for(var s=0,o=r.length;s=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height?!0:!1}},r.inherits(i,t),i}),r("echarts/component/dataRange",["require","./base","zrender/shape/Text","zrender/shape/Rectangle","../util/shape/HandlePolygon","../config","zrender/tool/util","zrender/tool/area","zrender/tool/color","zrender/tool/color","../component"],function(e){function f(e,n,r,i,s){if(typeof this.query(i,"dataRange.min")=="undefined"||typeof this.query(i,"dataRange.max")=="undefined"){console.error("option.dataRange.min or option.dataRange.max has not been defined.");return}t.call(this,e,n,r,i,s);var o=this;o._ondrift=function(e,t){return o.__ondrift(this,e,t)},o._ondragend=function(){return o.__ondragend()},o._dataRangeSelected=function(e){return o.__dataRangeSelected(e)},this._selectedMap={},this._range={},this.refresh(i)}var t=e("./base"),n=e("zrender/shape/Text"),r=e("zrender/shape/Rectangle"),i=e("../util/shape/HandlePolygon"),s=e("../config"),o=e("zrender/tool/util"),u=e("zrender/tool/area"),a=e("zrender/tool/color");return f.prototype={type:s.COMPONENT_TYPE_DATARANGE,_textGap:10,_buildShape:function(){this._itemGroupLocation=this._getItemGroupLocation(),this._buildBackground(),this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable?this._buildGradient():this._buildItem();for(var e=0,t=this.shapeList.length;ep&&(h-=m)):(dv&&(d-=f))}return{x:h,y:d,width:s,height:o}},_getTextShape:function(e,t,n){return{zlevel:this._zlevelBase,style:{x:this.dataRangeOption.orient=="horizontal"?e:this._itemGroupLocation.x+this._itemGroupLocation.width/2,y:this.dataRangeOption.orient=="horizontal"?this._itemGroupLocation.y+this._itemGroupLocation.height/2:t,color:this.dataRangeOption.textStyle.color,text:n,textFont:this.getFont(this.dataRangeOption.textStyle),textBaseline:this.dataRangeOption.orient=="horizontal"?"middle":"top",textAlign:this.dataRangeOption.orient=="horizontal"?"left":"center"},hoverable:!1}},_getItemShape:function(e,t,n,r,i){return{zlevel:this._zlevelBase,style:{x:e,y:t+1,width:n,height:r-2,color:i},highlightStyle:{strokeColor:i,lineWidth:1},clickable:!0}},__ondrift:function(e,t,n){var r=this._calculableLocation.x,i=this._calculableLocation.y,s=this._calculableLocation.width,o=this._calculableLocation.height;return this.dataRangeOption.orient=="horizontal"?e.style.x+t<=r?e.style.x=r:e.style.x+t+e.style.width>=r+s?e.style.x=r+s-e.style.width:e.style.x+=t:e.style.y+n<=i?e.style.y=i:e.style.y+n+e.style.height>=i+o?e.style.y=i+o-e.style.height:e.style.y+=n,e._type=="filler"?this._syncHandleShape():this._syncFillerShape(e),this.dataRangeOption.realtime&&this._syncData(),!0},__ondragend:function(){this.isDragend=!0},ondragend:function(e,t){if(!this.isDragend||!e.target)return;!this.dataRangeOption.realtime&&this._syncData(),t.dragOut=!0,t.dragIn=!0,!this.dataRangeOption.realtime&&!1&&this.messageCenter.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:this._range.end,end:this._range.start}},this.myChart),t.needRefresh=!1,this.isDragend=!1;return},_syncShapeFromRange:function(){var e=this.dataRangeOption.range||{};this._range.end=typeof this._range.end!="undefined"?this._range.end:typeof e.start!="undefined"?e.start:0,this._range.start=typeof this._range.start!="undefined"?this._range.start:typeof e.end!="undefined"?e.end:100;if(this._range.start!=100||this._range.end!==0){if(this.dataRangeOption.orient=="horizontal"){var t=this._fillerShae.style.width;this._fillerShae.style.x+=t*(100-this._range.start)/100,this._fillerShae.style.width=t*(this._range.start-this._range.end)/100}else{var n=this._fillerShae.style.height;this._fillerShae.style.y+=n*(100-this._range.start)/100,this._fillerShae.style.height=n*(this._range.start-this._range.end)/100}this.zr.modShape(this._fillerShae.id),this._syncHandleShape()}},_syncHandleShape:function(){var e=this._calculableLocation.x,t=this._calculableLocation.y,n=this._calculableLocation.width,r=this._calculableLocation.height;this.dataRangeOption.orient=="horizontal"?(this._startShape.style.x=this._fillerShae.style.x,this._startMask.style.width=this._startShape.style.x-e,this._endShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._endMask.style.x=this._endShape.style.x,this._endMask.style.width=e+n-this._endShape.style.x,this._range.start=Math.ceil(100-(this._startShape.style.x-e)/n*100),this._range.end=Math.floor(100-(this._endShape.style.x-e)/n*100)):(this._startShape.style.y=this._fillerShae.style.y,this._startMask.style.height=this._startShape.style.y-t,this._endShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._endMask.style.y=this._endShape.style.y,this._endMask.style.height=t+r-this._endShape.style.y,this._range.start=Math.ceil(100-(this._startShape.style.y-t)/r*100),this._range.end=Math.floor(100-(this._endShape.style.y-t)/r*100)),this._syncShape()},_syncFillerShape:function(e){var t=this._calculableLocation.x,n=this._calculableLocation.y,r=this._calculableLocation.width,i=this._calculableLocation.height,s,o;this.dataRangeOption.orient=="horizontal"?(s=this._startShape.style.x,o=this._endShape.style.x,e.id==this._startShape.id&&s>=o?(o=s,this._endShape.style.x=s):e.id==this._endShape.id&&s>=o&&(s=o,this._startShape.style.x=s),this._fillerShae.style.x=s,this._fillerShae.style.width=o-s,this._startMask.style.width=s-t,this._endMask.style.x=o,this._endMask.style.width=t+r-o,this._range.start=Math.ceil(100-(s-t)/r*100),this._range.end=Math.floor(100-(o-t)/r*100)):(s=this._startShape.style.y,o=this._endShape.style.y,e.id==this._startShape.id&&s>=o?(o=s,this._endShape.style.y=s):e.id==this._endShape.id&&s>=o&&(s=o,this._startShape.style.y=s),this._fillerShae.style.y=s,this._fillerShae.style.height=o-s,this._startMask.style.height=s-n,this._endMask.style.y=o,this._endMask.style.height=n+i-o,this._range.start=Math.ceil(100-(s-n)/i*100),this._range.end=Math.floor(100-(o-n)/i*100)),this._syncShape()},_syncShape:function(){this._startShape.position=[this._startShape.style.x-this._startShape.style._x,this._startShape.style.y-this._startShape.style._y],this._startShape.style.text=this._textFormat(this._gap*this._range.start+this.dataRangeOption.min),this._startShape.style.color=this._startShape.highlightStyle.strokeColor=this.getColor(this._gap*this._range.start+this.dataRangeOption.min),this._endShape.position=[this._endShape.style.x-this._endShape.style._x,this._endShape.style.y-this._endShape.style._y],this._endShape.style.text=this._textFormat(this._gap*this._range.end+this.dataRangeOption.min),this._endShape.style.color=this._endShape.highlightStyle.strokeColor=this.getColor(this._gap*this._range.end+this.dataRangeOption.min),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this.zr.modShape(this._startMask.id),this.zr.modShape(this._endMask.id),this.zr.modShape(this._fillerShae.id),this.zr.refresh()},_syncData:function(){this.dataRangeOption.realtime&&this.messageCenter.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:this._range.end,end:this._range.start}},this.myChart)},__dataRangeSelected:function(e){var t=e.target._idx;this._selectedMap[t]=!this._selectedMap[t],this.messageCenter.dispatch(s.EVENT.REFRESH,null,null,this.myChart)},_textFormat:function(e,t){e=e.toFixed(this.dataRangeOption.precision),t=typeof t!="undefined"?t.toFixed(this.dataRangeOption.precision):"";if(this.dataRangeOption.formatter){if(typeof this.dataRangeOption.formatter=="string")return this.dataRangeOption.formatter.replace("{value}",e).replace("{value2}",t);if(typeof this.dataRangeOption.formatter=="function")return this.dataRangeOption.formatter.call(this.myChart,e,t)}return t!==""?e+" - "+t:e},refresh:function(e){if(e){this.option=e,this.option.dataRange=this.reformOption(this.option.dataRange),this.option.dataRange.padding=this.reformCssArray(this.option.dataRange.padding),this.dataRangeOption=this.option.dataRange;var t=this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable?100:this.dataRangeOption.splitNumber;this._colorList=a.getGradientColors(this.dataRangeOption.color,Math.max((t-this.dataRangeOption.color.length)/(this.dataRangeOption.color.length-1),0)+1);if(this._colorList.length>t){var n=this._colorList.length,r=[this._colorList[0]],i=n/(t-1);for(var s=1;sthis.dataRangeOption.max&&(e=this.dataRangeOption.max);if(this.dataRangeOption.calculable)if(e-(this._gap*this._range.start+this.dataRangeOption.min)>5e-5||e-(this._gap*this._range.end+this.dataRangeOption.min)<-0.00005)return null;var t=this._colorList.length-Math.ceil((e-this.dataRangeOption.min)/(this.dataRangeOption.max-this.dataRangeOption.min)*this._colorList.length);return t==this._colorList.length&&t--,this._selectedMap[t]?this._colorList[t]:null}},o.inherits(f,t),e("../component").define("dataRange",f),f}),r("echarts/chart/scatter",["require","../component/base","./base","../util/shape/Symbol","../component/axis","../component/grid","../component/dataZoom","../component/dataRange","../config","zrender/tool/util","zrender/tool/color","../chart"],function(e){function u(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this),this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("../util/shape/Symbol");e("../component/axis"),e("../component/grid"),e("../component/dataZoom"),e("../component/dataRange");var i=e("../config"),s=e("zrender/tool/util"),o=e("zrender/tool/color");return u.prototype={type:i.CHART_TYPE_SCATTER,_buildShape:function(){var e=this.series;this._sIndex2ColorMap={},this._symbol=this.option.symbolList,this._sIndex2ShapeMap={},this.selectedMap={},this.xMarkMap={};var t=this.component.legend,n=[],r,s,u,a;for(var f=0,l=e.length;fs[0]&&(i.min0=s[0],i.minY0=r[o][1],i.minX0=r[o][0]),i.max0s[1]&&(i.min1=s[1],i.minY1=r[o][1],i.minX1=r[o][0]),i.max1n.largeThreshold){this.shapeList.push(this._getLargeSymbol(r,this.getItemStyleColor(this.query(n,"itemStyle.normal.color"),o,-1)||this._sIndex2ColorMap[o]));continue}for(var u=0,a=r.length;u0&&this._buildSinglePosition(o,t[o]);this.addShapeList()},_buildSinglePosition:function(e,t){var n=this._mapData(t),r=n.locationMap,i=n.maxDataLength;if(i===0||r.length===0)return;this._buildHorizontal(t,i,r);for(var s=0,o=t.length;s0?a="left":Math.round(i[0])<0?a="right":a="center",f.margin?(p=f.margin,c=i[0]>0?p:-p,h=i[1]>0?p:-p,c=i[0]===0?0:c,h=i[1]===0?0:h,i=this._mapVector(i,o,1)):i=this._mapVector(i,o,1.2),u.textAlign=a,u.x=i[0]+c,u.y=i[1]+h,f.rotate?l=[f.rotate/180*Math.PI,i[0],i[1]]:l=[0,0,0],this.shapeList.push(new n({zlevel:this._zlevelBase,style:u,draggable:!1,hoverable:!1,rotation:l}))}},getIndicatorText:function(e,t){return this.polar[e]&&this.polar[e].__ecIndicator[t]&&this.polar[e].__ecIndicator[t].text},getDropBox:function(e){var e=e||0,t=this.polar[e],n=this.getCenter(e),r=t.__ecIndicator,i=r.length,s=[],o,u,a=t.type;if(a=="polygon"){for(var f=0;fu||u===undefined)&&(u=e),(e=1)a=Math.floor(a/l)*l-l;else{if(l===0)return u>0?(d=0,p=2*u):u===0?(d=0,p=100):(p=0,d=2*a),{max:p,min:d};c=(l+"").split(".")[1],h=c.length,a=Math.floor(a*Math.pow(10,h))/Math.pow(10,h)-l}Math.abs(a)<=l&&(a=0),u=a+Math.floor(l*Math.pow(10,h)*(n+1))/Math.pow(10,h)}else a=a>0?0:a;return r&&(u=u>0?u*1.2:u*.8,a=a>0?a*.8:a*1.2),{max:u,min:a}},_getDelta:function(e,t,n,r,i){var s=(e-t)/n,o,u;if(s>1)return i?(s=Math.ceil(s),s%i>0?(Math.ceil(s/i)+1)*i:s):(o=(s+"").split(".")[0],u=o.length,o.charAt(0)>=5?Math.pow(10,u):(o.charAt(0)-0+1)*Math.pow(10,u-1));if(s==1)return 1;if(s===0)return 0;if(!r){o=(s+"").split(".")[1],u=0;while(o[u]=="0")u++;return o[u]>=5?"0."+o.substring(0,u+1)-0+1/Math.pow(10,u):"0."+o.substring(0,u+1)-0+1/Math.pow(10,u+1)}return Math.ceil(s*Math.pow(10,r))/Math.pow(10,r)},getVector:function(e,t,n){e=e||0,t=t||0;var r=this.polar[e].__ecIndicator;if(t>=r.length)return;var i=this.polar[e].__ecIndicator[t],s=this.getCenter(e),o=i.vector,u=i.value.max,a=i.value.min,f;if(typeof n=="undefined")return s;switch(n){case"min":n=a;break;case"max":n=u;break;case"center":n=(u+a)/2}return u!=a?f=(n-a)/(u-a):f=.5,this._mapVector(o,s,f)},isInside:function(e){var t=this.getNearestIndex(e);return t?t.polarIndex:-1},getNearestIndex:function(e){var t,n,r,i,s,o,u,a,l;for(var c=0;ci[0])return{polarIndex:c,valueIndex:Math.floor((l+a/2)/a)%u}}},getIndicator:function(e){var e=e||0;return this.polar[e].indicator},refresh:function(e){e&&(this.option=e,this.polar=this.option.polar,this.series=this.option.series),this.clear(),this._buildShape()}},a.inherits(l,t),e("../component").define("polar",l),l}),r("echarts/chart/radar",["require","../component/base","./base","zrender/shape/Polygon","../component/polar","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../util/accMath","../chart"],function(e){function a(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this),this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("zrender/shape/Polygon");e("../component/polar");var i=e("../config"),s=e("../util/ecData"),o=e("zrender/tool/util"),u=e("zrender/tool/color");return a.prototype={type:i.CHART_TYPE_RADAR,_buildShape:function(){this.selectedMap={},this._symbol=this.option.symbolList,this._queryTarget,this._dropBoxList=[],this._radarDataCounter=0;var e=this.series,t=this.component.legend,n;for(var r=0,s=e.length;r=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height)return i.isInsidePath(this._pathProxy.pathCommands,0,"fill",e,t)}},r.inherits(s,t),s}),r("echarts/util/kwargs",[],function(){function e(e,t){var n=new RegExp("(\\/\\*[\\w\\'\\,\\(\\)\\s\\r\\n\\*]*\\*\\/)|(\\/\\/[\\w\\s\\'][^\\n\\r]*$)|(\\/]*>)","gim"),r=new RegExp("\\s+","gim"),i=new RegExp("function.*?\\((.*?)\\)","i"),s=e.toString().replace(n,"").replace(r,"").match(i)[1].split(",");return t!==Object(t)&&(t={}),function(){var n=Array.prototype.slice.call(arguments),r=n[n.length-1];r&&r.constructor===Object?n.pop():r={};for(var i=0;i=0){var n=e.split(/\s*:\s*/),r=parseInt(n[2]||1,10),i,s;if(r===0)throw new Error("Slice step cannot be zero");return r>0?(i=parseInt(n[0]||0,10),s=parseInt(n[1]||t,10)):(i=parseInt(n[0]||t-1,10),s=parseInt(n[1]||-1,10)),i<0&&(i=t+i),s<0&&n[1]&&(s=t+s),r>0?(i=Math.max(Math.min(t,i),0),s=Math.max(Math.min(t,s),0)):(i=Math.max(Math.min(t-1,i),-1),s=Math.max(Math.min(t-1,s),-1)),[i,s,r]}var i=parseInt(e,10);i<0&&(i=t+i);if(i<0||i>t)throw new Error(N(e));return i=Math.max(Math.min(t-1,i),0),[i,i+1,1]}function g(e){var t=e[0];for(var n=1;n=this._shape.length)throw new Error(T(e[r]));if(e.length<=1)return this;var i=n.slice();for(var r=0;r=Math.ceil(e.length/2);s--)i[e[r]]=e[s],i[e[s]]=e[r];return this._transposelike(i,t)}),swapaxes:t(function(e,t,n){return this.transpose([e,t],n)}),rollaxis:t(function(e,t,n){if(e>=this._shape.length)throw new Error(T(e));var r=[];for(var i=0;i=this._shape.length||e<0)throw new Error(T(e));var s=this._shape.slice();s.splice(e,1);if(t&&!S(s,t._shape))throw new Error(x(s,t._shape));t||(t=new v(this._dtype),t.initFromShape(s));var o=t._array,u=w(this._shape,e),a=this._shape[e],f=u*a;return n.call(this,o,i,f,a,u),t}return r.call(this,i)},_withPreprocess2:function(e,t,n,r){var i=this._array;if(!this._size)return;if(t&&!S(this._shape,t._shape))throw new Error(x(this._shape,t._shape));t||(t=new v(this._dtype),t.initFromShape(this._shape));var s=t._array;if(typeof e!="undefined"){e<0&&(e=this._shape.length+e);if(e>=this._shape.length||e<0)throw new Error(T(e));if(e>=this._shape.length)throw new Error(T(e));var o=w(this._shape,e),u=this._shape[e],a=o*u;n.call(this,s,i,a,u,o)}else t.reshape([this._size]),r.call(this,s,i);return t},max:t(function(){function e(e,t,n,r,i){var s=0;for(var o=0;of&&(f=c),a+=i}e[s++]=f}}function t(e){var t=e[0];for(var n=1;nt&&(t=e[n]);return t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}()),min:t(function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h,a=c),f+=i}e[s++]=a}}function t(e){var t=e[0],n=0;for(var r=1;rt&&(n=r,t=e[r]);return n}return function(n,r){return this._withPreprocess1(n,r,e,t)}}()),argmin:t(function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h),a+=i}e[s++]=l-f}}function t(e){var t=e[0],n=e[0];for(var r=1;rn&&(n=e[r]);return n-t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}()),sort:t(function(e,t){e<0&&(e=this._shape.length+e);var n;t==="ascending"?n=function(e,t){return e-t}:t==="descending"&&(n=function(e,t){return t-e});var r=this._array,i=w(this._shape,e),s=this._shape[e],o=i*s,u=new Array(s);for(var a=0;as&&(s=a)}var f=s-i,l=t-e;for(var u=0;u=0&&y>=0){if(e._shape[g]==1)i.unshift(t._shape[y]),b=e.repeat(t._shape[y],g);else if(t._shape[y]==1)i.unshift(e._shape[g]),E=t.repeat(e._shape[g],y);else{if(t._shape[y]!=e._shape[g])throw new Error(x(e._shape,t._shape));i.unshift(e._shape[g])}g--,y--}for(var T=g;T>=0;T--)i.unshift(e._shape[T]);for(var T=y;T>=0;T--)i.unshift(t._shape[T]);e=b,t=E}if(!r)r=new v(this._dtype),r.initFromShape(i);else if(!S(i,r._shape))throw new Error(x(i,r._shape));var N=r._array,C,k,L,A;d?(C=t._shape.length-1,k=!1,L=e,A=t._array):m?(C=e._shape.length-1,k=!0,A=t,L=e._array):(C=Math.abs(e._shape.length-t._shape.length),k=e._shape.length>=t._shape.length,L=e._array,A=t._array);var O=w(i,C),M=i[C],_=O*M,D=r._size/_,P,H,B,j=0;if(k)if(m)for(var F=0;F0)for(var c=r[0];cr[1];c+=r[2])l(e+1,t+s*c);else if(r[2]>0)for(var c=r[0];cr[1];c+=r[2])for(var h=0;hthis._shape.length)throw new Error("Too many indices");var o=i.length,u;s.length?(t=new v(this._dtype),t.initFromShape(s),u=t._array):u=[];var a=this._array,f=0;return l(0,0),s.length?t:u[0]},set:function(e,t){typeof e=="number"&&(e=e.toString());var n=E(this._shape),r=this._parseRanges(e),i=r[0],s=r[1];if(i.length>this._shape.length)throw new Error("Too many indices");var o=typeof t=="number",u=i.length,a=this._array;if(o)var f=t;else{if(!S(s,t.shape()))throw new Error(x(s,t.shape()));var f=t._array}var l=0,c=function(e,t){var r=i[e],s=n[e];if(e0)for(var h=r[0];hr[1];h+=r[2])c(e+1,t+s*h);else if(r[2]>0)for(var h=r[0];hr[1];h+=r[2])for(var p=0;pu)throw new Error(N(e[a]));if(e[a]=0&&h>=0){if(l[c]===1)p=t.repeat(f[h],c);else if(l[c]!==f[h])throw new Error(x(l,f));c--,h--}t=p;var d=w(this._shape,n),u=this._shape[n],m=u*d,y=this._size/m,b=e.length,E=new Uint32Array(y*b),S=0;for(var T=0;T=0){for(var a=_-1;a>=D;a--)i[P--]=A[a];_=D,D=E[--M];for(var a=0;a=0;a--)i[P--]=A[a];return this._array=i,this._shape=k,this._size=L,this}),append:function(){console.warn("TODO")},"delete":t(function(e,t){var n=this._array;typeof e=="number"&&(e=[e]);var r=this._size;typeof t=="undefined"&&(this._shape=[r],t=0);var i=w(this._shape,t),s=this._shape[t],o=i*s,u=0;for(var a=0;as)throw new Error(N(l));if(l=0){var a=Math.floor((u[1]-u[0])/u[2]);a=a<0?0:a,r.push(a)}i++}for(;i0&&(E.style.brushType="both"),E.highlightStyle.lineWidth>0&&(E.highlightStyle.brushType="both"),a.pack(E,this.chordSeries[0],0,t[m],m,g.name);if(u){var S=[b+w]/2;S%=360;var x=S<=90||S>=270;S=S*Math.PI/180;var T=[Math.cos(S),-Math.sin(S)],N=this.showScaleText?35+h:h,C=l.scale([],T,this.outerRadius+N);l.add(C,C,this.center);var k={zlevel:this._zlevelBase-1,hoverable:!1,style:{text:g.name,textAlign:x?"left":"right",color:f}};c?(k.rotation=x?S:Math.PI+S,x?k.style.x=this.outerRadius+N:k.style.x=-this.outerRadius-N,k.style.y=0,k.position=this.center):(k.style.x=C[0],k.style.y=C[1]),k.style.textColor=this.deepQuery([g,this.chordSerieSample],"itemStyle.normal.label.textStyle.color")||"#fff",k.style.textFont=this.getFont(this.deepQuery([g,this.chordSerieSample],"itemStyle.normal.label.textStyle")),k=new r(k),this.shapeList.push(k)}E.onmouseover=d(m),E.onmouseout=v(),E=new s(E),this.shapeList.push(E),this.sectorShapes.push(E)}},_buildChords:function(e,t){var n=e.length;if(!n)return;var r=e[0][0].length,i=this.chordSerieSample.itemStyle.normal.chordStyle.lineStyle,s=this.chordSerieSample.itemStyle.emphasis.chordStyle.lineStyle;for(var u=0;u=270,E={zlevel:this._zlevelBase-1,hoverable:!1,style:{x:w?this.outerRadius+this.scaleLineLength+4:-this.outerRadius-this.scaleLineLength-4,y:0,text:Math.round(b.shift()*10)/10+t,textAlign:w?"left":"right"},position:this.center.slice(),rotation:w?[h/180*Math.PI,0,0]:[(h+180)/180*Math.PI,0,0]};E=new r(E),this.shapeList.push(E),g+=this.scaleUnitAngle*5}}},normalizeValue:function(e){var t=[],n=(new c(e)).max(),r,i;n>1e4?(r="k",i=.001):n>1e7?(r="m",i=1e-6):n>1e10?(r="b",i=1e-9):(r="",i=1);for(var s=0;s0&&(i=1/Math.sqrt(i),e[0]=t[0]*i,e[1]=t[1]*i),e},negate:function(e,t){return e[0]=-t[0],e[1]=-t[1],e},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e},set:function(e,t,n){return e[0]=t,e[1]=n,e}}:t=e("zrender/tool/vector");var r=typeof Float32Array=="undefined"?Array:Float32Array;i.prototype.beforeUpdate=function(){for(var e=0;e=e&&this.bbox[1]<=t&&this.bbox[3]>=t},i.prototype.setBBox=function(e,t,n,r){this.bbox[0]=e,this.bbox[1]=t,this.bbox[2]=n,this.bbox[3]=r,this.size=(n-e+r-t)/2},i.prototype._newSubRegion=function(){var e=this.subRegions[this.nSubRegions];return e||(e=new i,this.subRegions[this.nSubRegions]=e),this.nSubRegions++,e},i.prototype._addNodeToSubRegion=function(e){var t=this.findSubRegion(e.position[0],e.position[1]),n=this.bbox;if(!t){var r=(n[0]+n[2])/2,i=(n[1]+n[3])/2,s=(n[2]-n[0])/2,o=(n[3]-n[1])/2,u=e.position[0]>=r?1:0,a=e.position[1]>=i?1:0,t=this._newSubRegion();t.setBBox(u*s+n[0],a*o+n[1],(u+1)*s+n[0],(a+1)*o+n[1])}t.addNode(e)},i.prototype._updateCenterOfMass=function(e){this.centerOfMass==null&&(this.centerOfMass=t.create());var n=this.centerOfMass[0]*this.mass,r=this.centerOfMass[1]*this.mass;n+=e.position[0]*e.mass,r+=e.position[1]*e.mass,this.mass+=e.mass,this.centerOfMass[0]=n/this.mass,this.centerOfMass[1]=r/this.mass},a.prototype.initNodes=function(e,t,n){this.temperature=1;var r=e.length/2;this.nodes.length=0;var i=typeof n!="undefined";for(var o=0;o0&&this.applyNodeGravity(o)}for(var n=0;n0){t.scale(f,f,1/p);var d=t.len(s.speedPrev);d>0&&(p=Math.min(p/d,this.maxSpeedIncrease)*d,t.scaleAndAdd(l,s.speedPrev,f,p))}var v=t.len(l),h=Math.min(v,100)/(v+.1);t.scale(l,l,h),t.add(s.position,s.position,l)}},a.prototype.applyRegionToNodeRepulsion=function(){var e=t.create();return function(r,i){if(r.node)this.applyNodeToNodeRepulsion(r.node,i,!0);else{t.sub(e,i.position,r.centerOfMass);var s=e[0]*e[0]+e[1]*e[1];if(s>this.barnesHutTheta*r.size*r.size){var o=this._k*this._k*(i.mass+r.mass)/(s+1);t.scaleAndAdd(i.force,i.force,e,o*2)}else for(var u=0;u0?u=a*f/(l*l):l<=0&&(u=a*10*f)}else u=a*f/o;s||t.scaleAndAdd(r.force,r.force,e,u*2),t.scaleAndAdd(i.force,i.force,e,-u*2)}}(),a.prototype.applyEdgeAttraction=function(){var e=t.create();return function(r){var i=r.node1,s=r.node2;t.sub(e,i.position,s.position);var o=t.len(e),u;this.edgeWeightInfluence===0?u=1:this.edgeWeightInfluence==1?u=r.weight:u=Math.pow(r.weight,this.edgeWeightInfluence);var a;if(this.preventOverlap){o=o-i.size-s.size;if(o<=0)return}var a=-u*o/this._k;t.scaleAndAdd(i.force,i.force,e,a),t.scaleAndAdd(s.force,s.force,e,-a)}}(),a.prototype.applyNodeGravity=function(){var e=t.create();return function(n){t.sub(e,this.center,n.position),this.width>this.height?e[1]*=this.width/this.height:e[0]*=this.height/this.width;var r=t.len(e)/100;this.strongGravity?t.scaleAndAdd(n.force,n.force,e,r*this.gravity*n.mass):t.scaleAndAdd(n.force,n.force,e,this.gravity*n.mass/(r+1))}}(),a.prototype.updateBBox=function(){var e=Infinity,t=Infinity,n=-Infinity,r=-Infinity;for(var i=0;i0?(a.layout.radius=(a.layout.radius-s)*(i-r)/f+r,a.layout.mass=a.layout.radius/i):(a.layout.radius=(i-r)/2,a.layout.mass=.5)}for(var u=0;uo&&(o=v.layout.weight)}for(var u=0;u.01&&this._layout.step(this._steps)},refresh:function(e){e&&(this.option=e,this.series=this.option.series),this._init()},dispose:function(){this.clear(),this.shapeList=null,this.effectList=null,this._layout.dispose(),this._layout=null,this.__nodePositionMap={}}},l.inherits(p,n),l.inherits(p,t),e("../chart").define("force",p),p}),r("zrender/shape/Path",["require","./Base","./util/PathProxy","../tool/util"],function(e){var t=e("./Base"),n=e("./util/PathProxy"),r=n.PathSegment,i=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},s=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(i(e)*i(t))},o=function(e,t){return(e[0]*t[1]0&&p[0]===""&&p.shift();for(var d=0;d0){if(isNaN(p[0]))break;var v=null,m=[],g,y,b,w,E,S,x,T,N=f,C=l;switch(h){case"l":f+=p.shift(),l+=p.shift(),v="L",m.push(f,l);break;case"L":f=p.shift(),l=p.shift(),m.push(f,l);break;case"m":f+=p.shift(),l+=p.shift(),v="M",m.push(f,l),h="l";break;case"M":f=p.shift(),l=p.shift(),v="M",m.push(f,l),h="L";break;case"h":f+=p.shift(),v="L",m.push(f,l);break;case"H":f=p.shift(),v="L",m.push(f,l);break;case"v":l+=p.shift(),v="L",m.push(f,l);break;case"V":l=p.shift(),v="L",m.push(f,l);break;case"C":m.push(p.shift(),p.shift(),p.shift(),p.shift()),f=p.shift(),l=p.shift(),m.push(f,l);break;case"c":m.push(f+p.shift(),l+p.shift(),f+p.shift(),l+p.shift()),f+=p.shift(),l+=p.shift(),v="C",m.push(f,l);break;case"S":g=f,y=l,b=a[a.length-1],b.command==="C"&&(g=f+(f-b.points[2]),y=l+(l-b.points[3])),m.push(g,y,p.shift(),p.shift()),f=p.shift(),l=p.shift(),v="C",m.push(f,l);break;case"s":g=f,y=l,b=a[a.length-1],b.command==="C"&&(g=f+(f-b.points[2]),y=l+(l-b.points[3])),m.push(g,y,f+p.shift(),l+p.shift()),f+=p.shift(),l+=p.shift(),v="C",m.push(f,l);break;case"Q":m.push(p.shift(),p.shift()),f=p.shift(),l=p.shift(),m.push(f,l);break;case"q":m.push(f+p.shift(),l+p.shift()),f+=p.shift(),l+=p.shift(),v="Q",m.push(f,l);break;case"T":g=f,y=l,b=a[a.length-1],b.command==="Q"&&(g=f+(f-b.points[0]),y=l+(l-b.points[1])),f=p.shift(),l=p.shift(),v="Q",m.push(g,y,f,l);break;case"t":g=f,y=l,b=a[a.length-1],b.command==="Q"&&(g=f+(f-b.points[0]),y=l+(l-b.points[1])),f+=p.shift(),l+=p.shift(),v="Q",m.push(g,y,f,l);break;case"A":w=p.shift(),E=p.shift(),S=p.shift(),x=p.shift(),T=p.shift(),N=f,C=l,f=p.shift(),l=p.shift(),v="A",m=this._convertPoint(N,C,f,l,x,T,w,E,S);break;case"a":w=p.shift(),E=p.shift(),S=p.shift(),x=p.shift(),T=p.shift(),N=f,C=l,f+=p.shift(),l+=p.shift(),v="A",m=this._convertPoint(N,C,f,l,x,T,w,E,S)}for(var k=0,L=m.length;k1&&(a*=Math.sqrt(d),f*=Math.sqrt(d));var v=Math.sqrt((a*a*f*f-a*a*p*p-f*f*h*h)/(a*a*p*p+f*f*h*h));i===u&&(v*=-1),isNaN(v)&&(v=0);var m=v*a*p/f,g=v*-f*h/a,y=(e+n)/2+Math.cos(c)*m-Math.sin(c)*g,b=(t+r)/2+Math.sin(c)*m+Math.cos(c)*g,w=o([1,0],[(h-m)/a,(p-g)/f]),E=[(h-m)/a,(p-g)/f],S=[(-1*h-m)/a,(-1*p-g)/f],x=o(E,S);return s(E,S)<=-1&&(x=Math.PI),s(E,S)>=1&&(x=0),u===0&&x>0&&(x-=2*Math.PI),u===1&&x<0&&(x+=2*Math.PI),[y,b,a,f,w,x,c,u]},buildPath:function(e,t){var n=t.path,r=t.x||0,i=t.y||0;t.pathArray=t.pathArray||this.buildPathArray(n,r,i);var s=t.pathArray,o=t.pointList=[],u=[];for(var a=0,f=s.length;a0&&o.push(u),u=[]);var l=s[a].points;for(var c=0,h=l.length;c0&&o.push(u);for(var a=0,f=s.length;ag?m:g,x=m>g?1:m/g,T=m>g?g/m:1;e.translate(d,v),e.rotate(w),e.scale(x,T),e.arc(0,0,S,y,y+b,1-E),e.scale(1/x,1/T),e.rotate(-w),e.translate(-d,-v);break;case"z":e.closePath()}}return},getRect:function(e){if(e.__rect)return e.__rect;var t;e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0;var n=Number.MAX_VALUE,r=Number.MIN_VALUE,i=Number.MAX_VALUE,s=Number.MIN_VALUE,o=e.x||0,u=e.y||0,a=e.pathArray||this.buildPathArray(e.path);for(var f=0;fr&&(r=l[c])):(l[c]+us&&(s=l[c]))}var h;return n===Number.MAX_VALUE||r===Number.MIN_VALUE||i===Number.MAX_VALUE||s===Number.MIN_VALUE?h={x:0,y:0,width:0,height:0}:h={x:Math.round(n-t/2),y:Math.round(i-t/2),width:r-n+t,height:s-i+t},e.__rect=h,h}},e("../tool/util").inherits(u,t),u}),r("zrender/shape/Ellipse",["require","./Base","../tool/util"],function(e){var t=e("./Base"),n=function(e){t.call(this,e)};return n.prototype={type:"ellipse",buildPath:function(e,t){var n=.5522848,r=t.x,i=t.y,s=t.a,o=t.b,u=s*n,a=o*n;e.moveTo(r-s,i),e.bezierCurveTo(r-s,i-a,r-u,i-o,r,i-o),e.bezierCurveTo(r+u,i-o,r+s,i-a,r+s,i),e.bezierCurveTo(r+s,i+a,r+u,i+o,r,i+o),e.bezierCurveTo(r-u,i+o,r-s,i+a,r-s,i),e.closePath()},getRect:function(e){if(e.__rect)return e.__rect;var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,e.__rect={x:Math.round(e.x-e.a-t/2),y:Math.round(e.y-e.b-t/2),width:e.a*2+t,height:e.b*2+t},e.__rect}},e("../tool/util").inherits(n,t),n}),r("echarts/component/roamController",["require","./base","zrender/shape/Rectangle","zrender/shape/Sector","zrender/shape/Circle","../config","zrender/tool/util","zrender/tool/color","zrender/tool/event","../component"],function(e){function f(e,n,r,i,s){if(!i.roamController||!i.roamController.show)return;if(!i.roamController.mapTypeControl){console.error("option.roamController.mapTypeControl has not been defined.");return}t.call(this,e,n,r,i,s),this.rcOption=i.roamController;var o=this;this._drictionMouseDown=function(e){return o.__drictionMouseDown(e)},this._drictionMouseUp=function(e){return o.__drictionMouseUp(e)},this._drictionMouseMove=function(e){return o.__drictionMouseMove(e)},this._drictionMouseOut=function(e){return o.__drictionMouseOut(e)},this._scaleHandler=function(e){return o.__scaleHandler(e)},this.refresh(i)}var t=e("./base"),n=e("zrender/shape/Rectangle"),r=e("zrender/shape/Sector"),i=e("zrender/shape/Circle"),s=e("../config"),o=e("zrender/tool/util"),u=e("zrender/tool/color"),a=e("zrender/tool/event");return f.prototype={type:s.COMPONENT_TYPE_ROAMCONTROLLER,_buildShape:function(){this._itemGroupLocation=this._getItemGroupLocation(),this._buildBackground(),this._buildItem();for(var e=0,t=this.shapeList.length;e",textX:n+t/2+4,textY:i-.5,textAlign:"center",textBaseline:"middle",textPosition:"specific",textColor:this.rcOption.fillerColor,textFont:Math.floor(t/2)+"px arial"},highlightStyle:{color:u.lift(this.rcOption.handlerColor,-0.2),brushType:"fill"},clickable:!0};switch(e){case"up":s.rotation=[Math.PI/2,n,i];break;case"left":s.rotation=[Math.PI,n,i];break;case"down":s.rotation=[-Math.PI/2,n,i]}return s=new r(s),s._roamType=e,s.onmousedown=this._drictionMouseDown,s.onmouseup=this._drictionMouseUp,s.onmousemove=this._drictionMouseMove,s.onmouseout=this._drictionMouseOut,s},_getScaleShape:function(e){var t=this._itemGroupLocation.width,n=this._itemGroupLocation.height-t;n=n<0?20:n;var r=Math.min(t/2-5,n)/2,s=this._itemGroupLocation.x+(e==="scaleDown"?t-r:r),o=this._itemGroupLocation.y+this._itemGroupLocation.height-r,a={zlevel:this._zlevelBase,style:{x:s,y:o,r:r,color:this.rcOption.handlerColor,text:e==="scaleDown"?"-":"+",textX:s,textY:o-2,textAlign:"center",textBaseline:"middle",textPosition:"specific",textColor:this.rcOption.fillerColor,textFont:Math.floor(r)+"px verdana"},highlightStyle:{color:u.lift(this.rcOption.handlerColor,-0.2),brushType:"fill"},clickable:!0};return a=new i(a),a._roamType=e,a.onmousedown=this._scaleHandler,a},_buildBackground:function(){var e=this.rcOption.padding[0],t=this.rcOption.padding[1],r=this.rcOption.padding[2],i=this.rcOption.padding[3];this.shapeList.push(new n({zlevel:this._zlevelBase,hoverable:!1,style:{x:this._itemGroupLocation.x-i,y:this._itemGroupLocation.y-e,width:this._itemGroupLocation.width+i+t,height:this._itemGroupLocation.height+e+r,brushType:this.rcOption.borderWidth===0?"fill":"both",color:this.rcOption.backgroundColor,strokeColor:this.rcOption.borderColor,lineWidth:this.rcOption.borderWidth}}))},_getItemGroupLocation:function(){var e=this.rcOption.padding,t=this.rcOption.width,n=this.rcOption.height,r=this.zr.getWidth(),i=this.zr.getHeight(),s;switch(this.rcOption.x){case"center":s=Math.floor((r-t)/2);break;case"left":s=e[3]+this.rcOption.borderWidth;break;case"right":s=r-t-e[1]-e[3]-this.rcOption.borderWidth*2;break;default:s=this.parsePercent(this.rcOption.x,r)}var o;switch(this.rcOption.y){case"top":o=e[0]+this.rcOption.borderWidth;break;case"bottom":o=i-n-e[0]-e[2]-this.rcOption.borderWidth*2;break;case"center":o=Math.floor((i-n)/2);break;default:o=this.parsePercent(this.rcOption.y,i)}return{x:s,y:o,r:t/2,width:t,height:n}},__drictionMouseDown:function(e){this.mousedown=!0,this._drictionHandlerOn(e)},__drictionMouseUp:function(e){this.mousedown=!1,this._drictionHandlerOff(e)},__drictionMouseMove:function(e){this.mousedown&&this._drictionHandlerOn(e)},__drictionMouseOut:function(e){this._drictionHandlerOff(e)},_drictionHandlerOn:function(e){this._dispatchEvent(e.event,e.target._roamType),clearInterval(this.dircetionTimer);var t=this;this.dircetionTimer=setInterval(function(){t._dispatchEvent(e.event,e.target._roamType)},100),a.stop(e.event)},_drictionHandlerOff:function(e){clearInterval(this.dircetionTimer)},__scaleHandler:function(e){this._dispatchEvent(e.event,e.target._roamType),a.stop(e.event)},_dispatchEvent:function(e,t){this.messageCenter.dispatch(s.EVENT.ROAMCONTROLLER,e,{roamType:t,mapTypeControl:this.rcOption.mapTypeControl,step:this.rcOption.step},this.myChart)},refresh:function(e){e&&(this.option=e||this.option,this.option.roamController=this.reformOption(this.option.roamController),this.option.roamController.padding=this.reformCssArray(this.option.roamController.padding),this.rcOption=this.option.roamController),this.clear(),this._buildShape()}},o.inherits(f,t),e("../component").define("roamController",f),f}),r("echarts/util/mapData/params",["require"],function(e){function t(e){if(!e.UTF8Encoding)return e;var t=e.features;for(var r=0;r>1^-(o&1),u=u>>1^-(u&1),o+=r,u+=i,r=o,i=u,n.push([o/1024,u/1024])}return n}var r={none:{getGeoJson:function(e){e({type:"FeatureCollection",features:[{type:"Feature",geometry:{coordinates:[],encodeOffsets:[],type:"Polygon"},properties:{}}]})}},world:{getGeoJson:function(n){e(["./geoJson/world_geo"],function(e){n(t(e))})}},china:{getGeoJson:function(n){e(["./geoJson/china_geo"],function(e){n(t(e))})}},"南海诸岛":{textCoord:[126,25],getPath:function(e,t){var n=[[[0,3.5],[7,11.2],[15,11.9],[30,7],[42,.7],[52,.7],[56,7.7],[59,.7],[64,.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]]],r="",i=e[0],s=e[1];for(var o=0,u=n.length;o180?n-360:n,r=90-(r/e.scale.y+e.offset.y),[n,r]}function o(e,t){return n.offset=e.offset,n.scale=e.scale,t instanceof Array?n.makePoint([t[0]*1,t[1]*1]):n.makePoint([t.x*1,t.y*1])}var n={formatPoint:function(e){return[(e[0]<-168.5&&e[1]>63.8?e[0]+360:e[0])+168.5,90-e[1]]},makePoint:function(e){var t=this,r=t.formatPoint(e);t._bbox.xmin>e[0]&&(t._bbox.xmin=e[0]),t._bbox.xmaxe[1]&&(t._bbox.ymin=e[1]),t._bbox.ymaxr&&(t.xmin=r),t.xmaxi&&(t.ymin=i),t.ymax1&&(r={geometry:{coordinates:r.geometry.coordinates.slice(5,6),type:r.geometry.type},id:r.id,properties:r.properties,type:r.type});break}return{type:"FeatureCollection",features:[r]}},_getProjectionData:function(e,t,n){var r=this._mapDataMap[e].projection,i=[],s=this._mapDataMap[e].bbox||r.getBbox(t,this._specialArea[e]),o;this._mapDataMap[e].hasRoam?o=this._mapDataMap[e].transform:o=this._getTransform(s,n,this._mapDataMap[e].rate);var u=this._mapDataMap[e].lastTransform||{scale:{}},a;o.left!=u.left||o.top!=u.top||o.scale.x!=u.scale.x||o.scale.y!=u.scale.y?(a=r.geoJson2Path(t,o,this._specialArea[e]),u=h.clone(o)):(o=this._mapDataMap[e].transform,a=this._mapDataMap[e].pathArray),this._mapDataMap[e].bbox=s,this._mapDataMap[e].transform=o,this._mapDataMap[e].lastTransform=u,this._mapDataMap[e].pathArray=a;var f=[o.left,o.top];for(var l=0,c=a.length;lv?(d=v*.75,l=h*d):(v=d,d=v*.75,c=p*v);var m={OffsetLeft:a[0],OffsetTop:a[1],scale:{x:d,y:v}},g=o.geoJson2Path(n,m);return this._getSingleProvince(t,g[0],s)},_getSingleProvince:function(e,t,n){var r,i=t.properties.name,s=m[i]||[0,0];if(g[i])r=this.geo2pos(e,g[i]);else if(t.cp)r=[t.cp[0]+s[0],t.cp[1]+s[1]];else{var o=this._mapDataMap[e].bbox;r=this.geo2pos(e,[o.left+o.width/2,o.top+o.height/2]),r[0]+=s[0],r[1]+=s[1]}return t.name=this._nameChange(e,i),t.position=n,t.textX=r[0],t.textY=r[1],t},_getTransform:function(e,t,n){var r=this.series,i,s,o,u,a,f,l,c=this.zr.getWidth(),h=this.zr.getHeight(),p=Math.round(Math.min(c,h)*.02);for(var d in t)i=r[d].mapLocation||{},o=i.x||o,a=i.y||a,f=i.width||f,l=i.height||l;s=this.parsePercent(o,c),s=isNaN(s)?p:s,u=this.parsePercent(a,h),u=isNaN(u)?p:u,f=f==null?c-s-2*p:this.parsePercent(f,c),l=l==null?h-u-2*p:this.parsePercent(l,h);var v=e.width,m=e.height,g=f/n/v,y=l/m;g>y?(g=y*n,f=v*g):(y=g,g=y*n,l=m*y);if(isNaN(o)){o=o||"center";switch(o+""){case"center":s=Math.floor((c-f)/2);break;case"right":s=c-f}}if(isNaN(a)){a=a||"center";switch(a+""){case"center":u=Math.floor((h-l)/2);break;case"bottom":u=h-l}}return{left:s,top:u,width:f,height:l,baseScale:1,scale:{x:g,y:y}}},_buildMap:function(e,t,n,l){var p=this.series,d=this.component.legend,v=this.component.dataRange,m,g,y,b,w,E=this.ecTheme.map,S,x,T,N,C,k;for(var L=0,A=t.length;L=r&&e<=r+s&&t>=i&&t<=i+o)return u}return},__onmousewheel:function(e){if(this.shapeList.length<=0)return;var t=e.event,n=d.getX(t),r=d.getY(t),i=d.getDelta(t),s,o=e.mapTypeControl;o||(o={},s=this._findMapTypeByPos(n,r),s&&this._roamMap[s]&&this._roamMap[s]!="move"&&(o[s]=!0));var u=!1;for(s in o)if(o[s]){u=!0;var a=this._mapDataMap[s].transform,f=a.left,c=a.top,h=a.width,p=a.height,v=this.pos2geo(s,[n-f,r-c]);if(i>0){i=1.2;if(this._scaleLimitMap[s].max!=null&&a.baseScale>=this._scaleLimitMap[s].max)return}else{i=1/1.2;if(this._scaleLimitMap[s].min!=null&&a.baseScale<=this._scaleLimitMap[s].min)return}a.baseScale*=i,a.scale.x*=i,a.scale.y*=i,a.width=h*i,a.height=p*i,this._mapDataMap[s].hasRoam=!0,this._mapDataMap[s].transform=a,v=this.geo2pos(s,v),a.left-=v[0]-(n-f),a.top-=v[1]-(r-c),this._mapDataMap[s].transform=a,this.clearEffectShape(!0);for(var m=0,g=this.shapeList.length;m0?this.clear():this.backupShapeList(),this._buildShape(),this.zr.refreshHover()},ondataRange:function(e,t){this.component.dataRange&&(this.refresh(),t.needRefresh=!0);return},pos2geo:function(e,t){return this._mapDataMap[e].transform?this._mapDataMap[e].projection.pos2geo(this._mapDataMap[e].transform,t):null},getGeoByPos:function(e,t){if(!this._mapDataMap[e].transform)return null;var n=[this._mapDataMap[e].transform.left,this._mapDataMap[e].transform.top];return t instanceof Array?(t[0]-=n[0],t[1]-=n[1]):(t.x-=n[0],t.y-=n[1]),this.pos2geo(e,t)},geo2pos:function(e,t){return this._mapDataMap[e].transform?this._mapDataMap[e].projection.geo2pos(this._mapDataMap[e].transform,t):null},getPosByGeo:function(e,t){if(!this._mapDataMap[e].transform)return null;var n=this.geo2pos(e,t);return n[0]+=this._mapDataMap[e].transform.left,n[1]+=this._mapDataMap[e].transform.top,n},getMapPosition:function(e){return this._mapDataMap[e].transform?[this._mapDataMap[e].transform.left,this._mapDataMap[e].transform.top]:null},dispose:function(){this.clear(),this.shapeList=null,this.effectList=null,this._isAlive=!1,this.zr.un(p.EVENT.MOUSEWHEEL,this._onmousewheel),this.zr.un(p.EVENT.MOUSEDOWN,this._onmousedown),this.messageCenter.unbind(l.EVENT.ROAMCONTROLLER,this._onroamcontroller)}},h.inherits(y,n),h.inherits(y,t),e("../chart").define("map",y),y}),r("echarts/util/mapData/geoJson/an_hui_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3415",properties:{name:"六安市",cp:[116.3123,31.8329],childNum:6},geometry:{type:"Polygon",coordinates:["@@„„nJ‚UXUVƒ°U„ÑnU@mlLVaVln@@bn@VU@xlb@lšLnKlšƒVI„JšUVxnI@lVL@b„Ž°VX@˜b„x„nVVUnVVnU‚›@kX@VwV@„al¥UUnUWa@ƒ@wĸU„LU¥lKUa@aUI@alLVaUƒ¯anƒWkUKm@XV@VaXlW@aU_UWVUƒI¯@ma¯W¯™™I@UU@WWU@U@@UU@VkV@@WUUm@UaU@„lK@IUK„L@KWmXUWaXI@ƒ@a@a@U@U@KV¥lw„k°b²JVIVKlV@UX„la„Ul`œUVLVVVUšJ„U@Lnm@_VK@KUIW@™J@Xk@WW@U—ƒmm™XmWk@kK@aUUƒVmmkUwUmWL™@WmU@™UJmUULkKWakLWVkIƒlƒwULƒW@X°lUJ@°ULƒWV—wmJ@bmb¯Vkm@@WkWm¯wƒL@lkXƒWmXym¯UImJUbkV™@Vn¯„@V@lUbƒ@mk@maUxmlUbULWn@J—LmKUkWKkwUKƒbm„X„WxkVUKmLkVV@JUUWL@xkJUUƒV@X@VVlUbVX@xk¤šx‚¼œxWxn„‚nn@Þ¼„JVb°aVn„@šmlnXU„JlbVlkz@‚lUŽlXJmxVxXnWxXÈWlUŽ@šUxU@VX@xUL@šUÆmLnV@lWXk@@JlbXblnlJ"],encodeOffsets:[[118710,33351]]}},{type:"Feature",id:"3408",properties:{name:"安庆市",cp:[116.7517,30.5255],childNum:9},geometry:{type:"Polygon",coordinates:["@@n°‚znW„XlW@k„K°xXn‚l@Xn@l‚°Una@anI˜xXU„ŽVK@¯VIkW¯X@‚„VK„x„klJXUlKXblLVKnVVIšŽV@Xn‚@šŽXKVnVxlŽnn„UlmV@²óUkV™lW„b„lƒšƒn@VVVIn@lw@WVIXblV„@Èx‚aUaVIVVnKVLšK„ƒln@b²K@»U£ƒÑķƒġÝÅb™K™a@Im@ۍ„@kWÓkkmKÅnóJƒUÅ£›W@w„ĕ@wĉţ¯¯ƒUkK±l¯Uƒ¥UÑkÝUķ»Ý¥¯™JƒIUŽVbUl¯ÈV¼VJU¼Vb@bkLUl@„VJ@bUXǚ@lkVmXmKkLVxš‚Ž„VƒL@VkVVVlzW˜kbmLUUUbVbUV™šlÒnJlUnLllUL@bU„Vx„l‚LXVƦÈVU¦WJ"],encodeOffsets:[[118834,31759]]}},{type:"Feature",id:"3411",properties:{name:"滁州市",cp:[118.1909,32.536],childNum:7},geometry:{type:"Polygon",coordinates:["@@š„@`nnl@„xšK@X°KXV˜IXVlbXVWnX‚lL@šÈ»‚LVan@VJ„êVVn@‚X@laÞbVaƒyn@„_‚xnWVXnWl@VnUVkI@l‚nXKVLVV@V@kW@LlVô„@J@bVnnKnkVa@»lç@ƒnwšKma™UUUVњ@n™mWXalI@alVn@VwUaVU„@„nlaôJnU„VVXlJšaXXVK@UšV@VWx@nXVWšXVšUlLUbV‚ULVVnUVbUbVbš@@a„KÆnnKVK@U@UU@@a„@Vƒ°¯ÈJVIlķ@aa˜UaVKU_@mkxUI@aƒUlyU@@™wkKWmUbUnUVWbkJW_J@bƒn@Vm@@KULk@V@@bVbÅm@LW@UVVbkK@UkKWL@VULUKWIUJUbkK@_WVXU›Jka@XƒVa@kšy@aVIUUW@@m„UlLœKWÑUKVan@UkVmmIXKƒaVaUwVU@UmykU¯@±UUL@WUIVUU@KkIWaƒaU@kUUaǃUó»mKƒk¯@y@kWK@bkI¯`mn™l¯XWlkVUzUJlbUbVJl@nnm„@VULV`XnWƗbmUUn™JmUknƒJ¯km@ƒyk@kU›xL@VUbmnn¤lX@`™z@JmaULUVl@Xn@xllkXWa—aW@UVmUbƒ@mVXšWxXbWbUŽƒÒnVVnVVUL"],encodeOffsets:[[120004,33520]]}},{type:"Feature",id:"3418",properties:{name:"宣城市",cp:[118.8062,30.6244],childNum:7},geometry:{type:"Polygon",coordinates:["@@Vb@„XL˜JXxlIXxlVlV@I²¤šnlUnVšU@VULWVUJ@Lnb@lV@UnV@@VVVlLnbnJ‚UVkUUVWn@@anUVnVJVIV‚@@nUJVbUb‚„@VUbVK@bn@VbnIlxkllXVlXKWUXUlL°¤UVVb@bš„UlkXW‚ƒxXz@‚„Ila„UlƒnUlJVInVÆJ„U„LVUnV„K°@VnlVnxV@XLlK@wVL@KnUlJXU˜bnKVLX„lUw@VWlLXKm@@a„@VLnmlIVVnKn@škVašVlwk@@a@k@ƒVIUa™@maUa@wna@kmWƒ™UUmVUIVǗ@aƒKm™aƒ™kU™J@InmUUaVa„k‚lX@Vk@m@VU@wnK@alKVUkUkKƒbmUkmƒ@U£WVk@@UÝbbƒaÇx@b@WVUa¯ƒ@wVwUUV@VwnK@KWaŁ@KšIUyUI@WmXó™UbWaKm™@km@IUyƒIUaWKƒx@zUKUL@llVUnkLVVkJWX@VUKUVƒIkVWakb@VWb@n@JkXUlmL@xkL@`VxšLUÈUJ@Vm@@bmIUlUL@VUVVbknm@mKUw™KVÈ@J@LV±kkJUIƒl"],encodeOffsets:[[120803,31247]]}},{type:"Feature",id:"3412",properties:{name:"阜阳市",cp:[115.7629,32.9919],childNum:6},geometry:{type:"Polygon",coordinates:["@@V™nƒš@ša„k°aš±@‚¥@UUI@aUmlwUUx›b@¥XU@mmI@a@Kn@@_W@@W„I@mšUVVXUl@XaV@‚K@I@a„LX@aVI°K@KVL„UUw‚yXkšK@kšKÆbXnlK@k@a„JlU@w@U@»@aXKWƒn_‚JXkVKnƒ@°LlKXƒW@¯Uƒ@aUK@kmJUw™VƒIUJ™„kŽmL™K@kka@wUVm@@am@UkUbkK@nmVƒÒ¯VU„WVVmIƒƒULk@ƒƒma@kkKƒƒ@nUbUamU™`UUVUkKVkkƒW@@bkmƒnƒmUXVKXVƒL@VƒbU„m‚™bVXJ@nmKÅI@KWKUXVJUL@VUKUX@KUKWL@LUJmaXXm@kVVV@L@VUL@VlK@L@V@LUK@VUb@UUU@°@nVxU`‚Lkn@`@XVJ@X™Vm„k@UKmV¯LVVn±Wm@Ub@JlLUl„@VLk„@lmVVn@bnV@V°IV™šaVJXI°K°V@XXVlVVU„nšKVlUš„bWXnV@bV`U„„@@m@@‚ƒ@nxmn@bXVlL@¤nb„Ul¦šVVUnJVU„Vl@@bÞL"],encodeOffsets:[[118418,34392]]}},{type:"Feature",id:"3413",properties:{name:"宿州市",cp:[117.5208,33.6841],childNum:5},geometry:{type:"Polygon",coordinates:["@@@UWU@bkW@aWU@aUIkWV™lLXb„lVIUVV@‚mn@V_n@VaUK@I‚@UašanJVU„@lV„UVnnKVVlaUa„I@wnK‚Lnll@nVlk@wVKXkl@@b„bUJ@V‚U@U„UUyVk@aVUXwlWXX‚WU¹@aU™@WUI@mlUšn„J@Il@šaXbV@VKl@XxVL@W„IšJlb„@„al@„IUUm@@aVK@¥¯—@mUķ¯bWƒk£Vm@akm@VaÅ@UVWaƒ@UJWkƒJ—UƒbWbU@UlƒXk@ƒamV@K¯nk@ƒlU@Uxmz@bU`ÇbUbÅVm£U@Ww™x@akLUK@UlakwUJWVkLmaUal@n_ƒmVUnKVUUmÅXWa™@kJmx@XUJ@bVLXxl@VVUVV„UbkLWbU@@lUVV„VVX„›K@XkJ@nU@@bV@VxUVlb„U@xXLWŽn@UxVbVĊ„V@b@XV`mnkJ@kUKmbƒaU@VbnbÆx@XU@@`k@@bl„™@@bkL@WƒakXWaU@Vmkx@XWW@@wUUUbƒJ™U¯V™@¯ÞU@WxXŽlL@bkb@ŽlVlnb™JW@kkU@mbkaWJ—IVlmz¯`UnU@mb™@@„ƒ`@bkVlœnV@b@šV@„aVxn@Vx‚KXnl@nbVK„bVK@a„_V@Vƒ„w@W„LlwnK@UmIU@VWš@šUÈ@lKnal„wš@@V°@šaUmlUUw@„ƒV@@UXK"],encodeOffsets:[[119836,35061]]}},{type:"Feature",id:"3410",properties:{name:"黄山市",cp:[118.0481,29.9542],childNum:5},geometry:{type:"Polygon",coordinates:["@@lXnlWX@VUJVnUJVzXJVx„kVJlI²l‚U@K@IUǚLVxnLn@lmUaVU@UVKVknJ@an@@UVIVǙKUw@_lK@wnKVklW@I@mXa@UlaXblU„JVUVL@UXWlIUUlKVmkU@kVKVL@y„wXLVb„JVz@Jlnš@nŽ‚LXbVaôšnW@la@UVWUa@@a@mk@WIk@VwUa¯¥m@UUVK@ImK@aX£ƒkK›ÅV™a™™ƒ_@±ƒakXWW—LƒƒƒnU@@a@¯mK@L™JUWwUV™VmbXX@lWLn`mzUJUb™Lƒ„k@makVWmkX™ambkKknƒaƒ@ƒaƒb@‚U@Unm@—ƒWVƒ@VbUbUJWIk@@lmL@°UVUVm„nš™@@kmWkb@xƒ_m@@aU@b@JlŽUz™lWxXn„@‚b²@l`„IVl„UlL@VšK„nVbUl@VlIn@@b„bVWUk‚@@bX@Valb@bnb°Vn@„xVKlbVnV@V‚x„L@ln@UXVV‚L˜"],encodeOffsets:[[120747,31095]]}},{type:"Feature",id:"3414",properties:{name:"巢湖市",cp:[117.7734,31.4978],childNum:5},geometry:{type:"Polygon",coordinates:["@@VV@blL@ŽXlWnnšnŽ˜„@VXXl@@WšIX@VJ@LšxŎxlnšŽ@bXJVblX@VVbUVn@VbUVlb@LnJVbVLV‚XLšÒVL„ÒšV„bVIVylUXk°Wšknm°_lJ@aXL@l‚z°@„lnLô¼V‚È„VUUaVKU@WW@@UUa@knmVLlaV@„a@kšak±@UmwkKmk™lj™ÝUUkL@mlIVmnÝWkkUÝ@KƑĉ™a@»ƒmma@mX™¤¯Uƒw@ƒ@UU@bU±±L@akmƒ„™LUKmLUUUJVbbÇwƒ@kUWaUJ@Xkxm@UJUUm@™„k„ƒ‚ƒakXUšVl±ôU@kn"],encodeOffsets:[[119847,32007]]}},{type:"Feature",id:"3416",properties:{name:"亳州市",cp:[116.1914,33.4698],childNum:4},geometry:{type:"Polygon",coordinates:["@@lU@Un@@anUlw@KVmUwlaX_lKna@KU@@kWKUU@ankW™XK˜@@V²VVIÈU@al@VaÈamK@wU™@klaUƒV@XƒVUU»WUUbkmUkVmk@aÈw@mWU@VkIkVWKUÑķXȭºU¯lƒ@kkLWmÅa™L@l™LWlzVxƒVUK@L¯LUJ@bWƒK@b@JLU@Wbk@WVUU™V@nƒJ@XX@@`m@@L@bnJ@nWV@¦œa‚wVVkxVn@bVJ@V¦@Ž™²¯bƒl™b™@m„UšUŽƒŽ@¼ƒ¦Xb‚UV`@nnxUxWLkUkVWKkV@XV@@VVL@VX„@lVV@L@blL@`šL@xXKVL‚@„VnUš@lwnU@ml@XnV@@UVW°LnalƒUI@aUK@a‚a@U„kXW@I@mWL@UXK@UVW@U‚@@k„Wn‚@@V„@XblaVxšL@bVKXb„IlJ"],encodeOffsets:[[119183,34594]]}},{type:"Feature",id:"3417",properties:{name:"池州市",cp:[117.3889,30.2014],childNum:4},geometry:{type:"Polygon",coordinates:["@@„V°°ĊŤ@xƒĖ@xœXƤ„VôIÆmnLllXÔ@lƒÜŽn@@JšbšLÆaĢÞĸ„°VVUUKVanK@UV@VL„VVn„ln@‚xnklxXamk@WV@Xa˜@naVk„Klk™@mkUWwkJWw—IWK@ƒUaUwWIUyVIUmVI@UXWmkkW‚—KUUVWm@@kƒKw@U‚UUmkaULƒwm@¯Uma@akaUbW@@a@VlUXƒa@am@kJ@UVkUaƒm™L@UkKƒVUkƒJk_±@aƒ@WmXwÇkkaVaUa±ƒœwV@VkƒwnyUaW@UU¯amLk@m™@kmmU™™¯K@L@lUX¯ƒWlkXƒŽVb„bƒVUL@J@LVKnlJXnlb@`nXlalV@bnL@Vnb˜¼@lXbWlkL™K@zUJmIUxUVUVmX","@@llUL@VlxšL@a@UƒwXa¯@"],encodeOffsets:[[119543,30781],[120061,31152]]}},{type:"Feature",id:"3401",properties:{name:"合肥市",cp:[117.29,32.0581],childNum:4},geometry:{type:"Polygon",coordinates:["@@„L„xV‚ĊLÞkšVlVVXaWaXwW™nU„@‚anVVUX@˜bXblWkk@wWmk@VUVKnb@Išy@_kWm£nmVa@U‚KœwlVl@„zn@°l„IlmnVšIVmnV˜aXÅWmU_VK@Unƒmmk@UIVakaƒa™UƒÑUK™ÑWKUUKUamI@KkaVUUam@VUUa@UkWUaWI@a™kmōw™wUL@`mn@KƒV™IUVUUUK›Vk_ƒVkbWƒ@VkUULUJ±I¯aƒlkxU¦@L@V@V@b@b@„WJXbWVXn@LƒKVL@JkLƒŽV@Vbn@VV@XU@UlV@@VV@V@XXV@@VšJ°š°Xnb°@„JUVVXV`@bkXWŽUbU@WŽn@VLXlm„°bV„UbkK@bVJ@bVbkLV¦ƒKķV@x@„XbmVVVk¦"],encodeOffsets:[[119678,33323]]}},{type:"Feature",id:"3403",properties:{name:"蚌埠市",cp:[117.4109,33.1073],childNum:4},geometry:{type:"Polygon",coordinates:["@@VÒXLlUlJ@UXV@nÇx@bnlUVllnVaXVV¼UVW„U@V„²wVV@Vl@„VnwlIš@XbÆWVnUVmLUV„nm`k@VbnblKXUVIlxkb@VVLlK@bšwXxV@n¤ÆUVaÈaV_@anyVwV@„kl@°m@LnU„bl@„WVkV@Xa„a˜V„IXl‚IV‚„@XbVUÆ@XKWwUkmW@_UmnIlJXkWKXmV@‚w@_XV@Kl@kU@KlX@@UUUUKWLm@klJVUUmk@mXUWmXwƒ`m@„zUbÝakbW@m@UUƒéUIm@UbKǼ@™kKWXmWUkaWU—JWU¯L@W™Lƒwk@mm@_™ƒÅl™UVkmWUnV@VWLUb™bƑĬ¯l"],encodeOffsets:[[119543,33722]]}},{type:"Feature",id:"3402",properties:{name:"芜湖市",cp:[118.3557,31.0858],childNum:4},geometry:{type:"Polygon",coordinates:["@@„bVaV@XllLXU°ŽlL@V@VUnVl¯Ikš›VUVU@@b@lUXUWmb„n@¼šbƒĊ‚LÞ@lVXlmÞUnkJ@nlKVVšÞXklWVaVI@aUKn»lL@Kn@‚XXwlm@mn°@„V@Wy„wXlWVk™ƒ@aUaVU¯£kKWVXVWLUkkWlkkwmJUam@@aULVa@UƒVaUaVI@m‚@UUJUIUmmV@bm@UXVVUlVmImakKUU@UU@VmU@@kma@KVIXUVK@U™VmUkV™m±£@JkU@nlšk‚ƒLUlmb—@WbU@@XnlWb"],encodeOffsets:[[120814,31585]]}},{type:"Feature",id:"3406",properties:{name:"淮北市",cp:[116.6968,33.6896],childNum:3},geometry:{type:"MultiPolygon",coordinates:[["@@lnnK@¦n@@V‚V„@@VV@nIV„V@VW²a@b@bVnUVVV@V™z@lš@°UšV„IVaVV@x@ŽXX@WlwUnV@XblW„b@XlK@aš@kƒ@al@@_V@@WÅwmaUaV@„bnaVL@llInmU_@W@aƒUUĉUaVwm@XWK@wƒVkaVUUwU@@aV@@mlI@WœLWƒUUUƒVU@kV@XalKVaUƒVUUUk@WwUK@aVI@WƒUk@@UUU±xkb@lVš@xnLÇbUbk@@bÇVUJ±U@U—@WLXšml@bVVXL@lV@@LmbkLW`kbVxUn@LkxmV@bm@@VkV"],["@@VVVkV@¥@UV@U@VUUJƒkWakKUšlXVJ@bXV@blX@aXV@V"]],encodeOffsets:[[[119183,34594]],[[119836,35061]]]}},{type:"Feature",id:"3404",properties:{name:"淮南市",cp:[116.7847,32.7722],childNum:2},geometry:{type:"Polygon",coordinates:["@@°kƒīšaVaXK@U‚UVmnXUlšVÆkVKUUUmmU„ÑkU™UÝlĉKUƒwƒKƒbU@UxW@@lœmVUUVmUUƒmƒw—aW„kL¯K@Žm„ULWlIm`X„WL@b@¼@V@xkVƒI@b@l@lk„V°Ȯ¹ĸW"],encodeOffsets:[[119543,33722]]}},{type:"Feature",id:"3405",properties:{name:"马鞍山市",cp:[118.6304,31.5363],childNum:2},geometry:{type:"Polygon",coordinates:["@@šNJnllLnxV@laXLVKma„aXbVI„bVKVVVIVyn@n_ƒƒW@@ƒ„UnJlUVVXlLnaUWlV@VV„IXW@_W@XK@K@UVUUwVamÑXmmwƒw™KUnUK™çU@ƒJƒU¯@mŽ@nknWxWm@@LkKm¼VL@bUJUbkXWl"],encodeOffsets:[[121219,32288]]}},{type:"Feature",id:"3407",properties:{name:"铜陵市",cp:[117.9382,30.9375],childNum:3},geometry:{type:"MultiPolygon",coordinates:[["@@„ÒV¤@¼V²@aVV@Ž@„„x°Vš£nW‚@nbnaVXVW@k@aV@VUœUl™°JUkVm@U@UkK¯WVkKWkU@Ubƒakwmlwm@ƒkUmƒUUKU@@VmLUbVLUV¯U"],["@@LllUL@VlxšL@a@UƒwXamK"]],encodeOffsets:[[[120522,31529]],[[120094,31146]]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/ao_men_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"8200",properties:{name:"澳门",cp:[113.5715,22.1583],childNum:1},geometry:{type:"Polygon",coordinates:["@@HQFMDIDGBI@E@EEKEGCEIGGEKEMGSEU@CBEDAJAP@F@LBT@JCHMPOdADCFADAB@LFLDFFP@DAB@@AF@D@B@@FBD@FADHBBHAD@FAJ@JEDCJI`gFIJW"],encodeOffsets:[[116325,22699]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/bei_jing_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"110228",properties:{name:"密云县",cp:[117.0923,40.5121],childNum:1},geometry:{type:"Polygon",coordinates:["@@vIHZDZQtDLNMXIbHRCXXITbJ@H`LGPRDDJNCLHTOCWFGvGBUJMKGFO^IHWXITQCI’Y^AXGfRˆDXF`DJOLB~G\\DZIHHpErUVMhHb]\\M†BVF@FTP`@zTbD\\@~M\\K`H^EVODWICAakAQXoIcCOCIgGYNWFWNGGKKGaJEGMEIKYJUT_J_Go@_SyQaSFMEGTcYOQLIIi@EKAUPCV[EEXQCW|aMUMAaYCYNIDGGACIMGGSKDQGaF_C[GaB@GOIiOKAYL“mI@CN]F[SWWAcKKI@HMUimEKbeYQYISNUOcBKPIFBNgvDPGZYFSf]CMSIWGEUFgDIQ[MeDMJS@RR@LphFPCHaBAJKF@J]IBJO@HlO@@RKAMPJHCNDJTHFP@ZGNANBRFH@J_fM^ONJNF\\VTDJHDON@XRND\\XRCPVETCLBVKDFJINHRGPRV@\\CLJN@VbXbLVT"],encodeOffsets:[[119561,41684]]}},{type:"Feature",id:"110116",properties:{name:"怀柔区",cp:[116.6377,40.6219],childNum:1},geometry:{type:"Polygon",coordinates:["@@JHTVHXCHPfnDJGHNDJSB[JSBGVSAOH@PMPuDEHHXZN@PHF@ZLJ@LHVYJA\\OFWP]BMtMBSRGV[JeVAPQVIFENMD¡–@^NV\\JH@NNL@NM\\kTQ\\I^FNIpBHGTBFFAZQfKDIXQTLXFXNNVMVHRGpCFLlRLEVBBH`IVO\\G`RDPAXLXBXORHZEHTDLLN@VGTMrQNFPeASKG@GMOAKBYMK@GTUHUXSHMVDNMOUEOZMJML@^KRACMZEZMRQLUHE@OFENPR@DI\\ChMHIDG\\GJMDWHCKGMDCIQCHO_K@GaIJSWWQDaGWJMNCKRsCYGYuJUSaKaW@UIMDK@[QUHOGQJMEILCAUDKFSOUQD[WMC‚Q@WPMGCCIUSE[IMPMN]`e@IEGAQBMHM@YEOSGCIDMIGNOLB@QP@GkP@AI^J@ILEBIbADGEOog@KQQWSekWQQUOFKZLF@PUNmIaHIUeBCTSHENcJa@_IWSaGu`GLSBKJQFOXGDXVQVOBIHcDSJWBEFGTMH[^mLaXcHiKElTRKtFXZ`MHMPCNRDxZˆB\\ICIHK@KŽHbIVFZ@BPnGTGbDXRDJaZKRiGEFSFEJhjFNZFjn"],encodeOffsets:[[119314,41552]]}},{type:"Feature",id:"110111",properties:{name:"房山区",cp:[115.8453,39.7163],childNum:1},geometry:{type:"Polygon",coordinates:["@@h@bl@HRJDZ``TA\\VVD^H`\\pF\\JŒ`JGv@ZO\\GPSTEjPTR`FnEbDTDHEhLFMTK@ETSPULKEI@OVISKSJACEQNQbV˜IXGDIN@dMB[IIBcN]ZHNLP@XOWCFWŠCNRHTpATD@^NVNLED@Rh@jCEF}E[OOHUEW]W@QGGDIQSH_MmFmCUT_K]i@MHCMW—FCF‹E{BMHMPOHKS]CFNGBELDH_@BcAKOACESAOBELaXAROB@FODMEDWJAG[aE@UM@DImEWJMC@OeCA{aE[@{L@MINUCQXKfUJORCHqJBF@TCXWNQX]M[EAJO@@KMBQJIC]EWMCCUBEBFHKDOTMBGNGF]MWDBRDdMDQVyE@LPVHDCP@JVVMTG~HNSH[CmRUvHPHBbA\\PTNRC\\YNJ€PRARPJDDR"],encodeOffsets:[[118343,40770]]}},{type:"Feature",id:"110229",properties:{name:"延庆县",cp:[116.1543,40.5286],childNum:1},geometry:{type:"Polygon",coordinates:["@@^AXOPEB[ZIGU@KKI@YGE@OYMGWFGvCNO@OPGTBHUTA\\ITACIGMIHmCOeDGGWSUIGimYEEMgiFITEFEjHLQbYCIWQaCSHmHAOY@UEaJG@LGLDJ[J‡AwYQCDMNONGY_EWLsSQFkMO[NWAIGaIYL@HMBOKiOQDWEUDMQSF_QIUBWdg@[NaAKQ@M]OQ@WhgLUMMFYQDIRCEUZOOCIOJ[KIUMKL@HIDKVEBM`HJAJSJUdBLGNEdMBMO[BYEWJSNKNaD]PE\\SjOT_RQVEZPpƒNQXfŠNA~lNG`@PNLp¼RFLfbdKbATUh@FSNWjGFZVLFHVA~X¨PPROfFJbNJPLFbENJPrEFNPFRHDDJdENJLVEPBJTVTHGHFRFH@PXP\\ORQHW\\BjWFDERLPPBbB\\E`B\\D\\L`@F]FCnJ^AZL"],encodeOffsets:[[119262,41751]]}},{type:"Feature",id:"110109",properties:{name:"门头沟区",cp:[115.8,39.9957],childNum:1},geometry:{type:"Polygon",coordinates:["@@V@XMnGPY²‰JQNEhH\\AZMPDVTTDZCPiJkHSHCjIdFtEHITCNITQEKUAMCEIKCECABYESKFWAKBEIIHABGDCKCAIHMHALKEI\\CFIBILIJQZS]BBEECS@E@@C]COKI@CABAAEEDMGƒCH]A[M@CJWH—JaUMRFRBDTITLUJ@PFJKLOVST@FSLENgKGFSCaCmF_ESQiOSFOT[HYPu@IH‹_[IoE_[]GUC[USB__CYQI@Gakg@qZeHQNMNV\\FVLPgJAFJPRLCH[XcPELUT[JiV_EELFTADBXRTRLJC@fHXHHbPd`fR@NfT`@TLplHMpCEJHJBVLFŽ@JT‚VnG^KXDXHNVGRLRXFJVdDHSNWLGfEzA"],encodeOffsets:[[118635,41113]]}},{type:"Feature",id:"110114",properties:{name:"昌平区",cp:[116.1777,40.2134],childNum:1},geometry:{type:"Polygon",coordinates:["@@VNLJI\\JPPDYPFVQDCJZRNEVNhKXgR@^P@NLRbB\\Mh@XcVARJE`RTCNFV€XRCjPPLNA@GZKbJJHXB\\MNPjLdGbWnK\\]NGHSFEXATIdCJGPARUWUHCPWRELITAHKv_E@iYCaW_BQ\\Y@QIO@QDCIGZCEMWGFMFAFgHEDOCSqKCCFGAMKEAC@ODGCGs@WH@KQA@EE@CE@GEA@EH@GGUEEJEAYD@JM@@DAA@FHD@FTJEHUC@JUBKCKG@G[CIIQReAYhO@OXGDO@@FF@IHJFCPEBACBIAAKDOABXARHPNEHGbQAAKQFGIAM[C@WHKaGiCEGOA‹HUKCIokSCUSOCYN[BgGMFIR±ŠOZmHWNU@ShbbXDHVXXGJ^lZ@PZ\\Nb@\\FHJAD"],encodeOffsets:[[118750,41232]]}},{type:"Feature",id:"110115",properties:{name:"大兴区",cp:[116.4716,39.6352],childNum:1},geometry:{type:"Polygon",coordinates:["@@F\\E~DFN@BDFEpHFCHBBEGCDCJBHUDSBB@ELCPbF@B\\J@BJVAFJ\\ADKTCBGECFMT@BMN@@FH@DaNBEnvB@FPBATK@FHEFIAKFBFL@@PKBFJHC@FXBRAFCDMPDTOL@JIVFDHH@DDH@BGRFCDLD@N^@@CNA@KNOAEBCECFEGCFGMGFIPMOEJOLBADBBHGG@GCHIECY@INC@DMGS\\AIOZAAEYA@GT@KKMBEETCGMVINFxA@MJADB@FlA@HJA@NND@DFA@DVAZBBOFKH_JA@K^GBC@EFE„G@gAENMXKJigC@IbSJMqGOP£RGSMGE@kbQFDPEFiBSGGSBK]I{CDWCIDOic[C_G@SuSO@EWKCO@MNY@\\uZOPENQD[LKESSKGBKEG@EJGAGHoH¥CqhifeJkX_XFFGHFNEDFPENKHM^IFIVL^S`DVEnNnG`RTCJHH@R^XFXGVPP"],encodeOffsets:[[119042,40704]]}},{type:"Feature",id:"110113",properties:{name:"顺义区",cp:[116.7242,40.1619],childNum:1},geometry:{type:"Polygon",coordinates:["@@EhEBENXHFNYDJHCD@RJP@R[ZARX`DbjZF@bHXT`Jb@dIFMTGDSfAJVbGnJVM@OKELYPERVXRflXTT@NIfC\\NJRhCVEHFJXNT^DTeZEHYCOhuAMJELOdAVPTMOWBWNMNEJgl]@WGUFIC[T{EEDEHGCIGMI@SECUQI[D{A{GQESPUH]CsiMCmHUeoHENcAaDGCMDGMQCACCBaCGLMAHB@DIEQLOAAEEJ@CW@CDINGAAGKQOCgV@LG@BEGDKNeREFBNCFIDOPKD[@YRW@GFWDAFE@EHDDrLDTCPGF","@@KrJEH[\\B@FF@CHFBHUN‹AJKADGECBCMAG^E@EbI@BEGP"],encodeOffsets:[[119283,41084],[119377,41046]]}},{type:"Feature",id:"110117",properties:{name:"平谷区",cp:[117.1706,40.2052],childNum:1},geometry:{type:"Polygon",coordinates:["@@ZJZRafFLjn€VGNJ@LLBdXX\\T^EDMJ@”nZKLBjPPJ@HbA\\H`DbERHLCFK^BZaFWXQLAGMHa\\OLO@SBIpBdCLƒVQfElO@GSAKEDQTC@GEBKG@ORIJBDAPDFA@CaOq@GGQAAEJK@KMUGAAGEAa@MGMBGCGSIIW@WSUCMDOJeWOM@IUF{WMWaDIMgIoRoCOKeEOEAG_I[cg@wLIFENQFDVTFJ@HNDJGHCFFFS|D\\EJHV@Xk^IhMFMNAXPX"],encodeOffsets:[[119748,41190]]}},{type:"Feature",id:"110112",properties:{name:"通州区",cp:[116.7297,39.8131],childNum:1},geometry:{type:"Polygon",coordinates:["@@FDAJTGDNDCTDDEDBBE@DT@@EHCDGJ@EIZ@@FDBR@ATFBBVFFE@@HNA\\VE@CLIFNJFNJBCP]A@LJFA@HJEDD\\C@DBCHLAEPF@@DH@APHAERDF\\GIxDTM@CFLBBFJ@CNUPMHECGDBF]BMFPDLRBHHBJMDCX@@DFIBFPBRKJF@CGANBHKbDDABDRDHNNCHDbCdBFMpGHiOYMefKJMC}HWAUNW\\NNBNA„kNU|]HMTMN@MZBLFFF@RIRUT‘BMFIEGaAGGAOIIUGTSFcYKS@MSLYPKRUBU]EWDOI]CKGASgW@MTWKIMCS@uMAKKADMECGAKVUTSDy@IjWLMNBF@hƒHEF@FAD]H@LIBG`ELAPYAUB@CEB@CMC@MIB@GkB@ECAIB@NwBMEUJHNSDFFNALLS@@HZBBFYBJP[BHTCND@JMZ@FDGJHDH@GHAABCKAIPPFONEJNHEHHDEFFDADBFMP@L"],encodeOffsets:[[119329,40782]]}},{type:"Feature",id:"110105",properties:{name:"朝阳区",cp:[116.4977,39.949],childNum:2},geometry:{type:"MultiPolygon",coordinates:[["@@bFGHBHFBFIVFHHG@@FFB@HDFF@@FRB@LXGt@DHCH@PBDLFBNF@BEXCHEX@ZQ\\@LCPOJCDEAMFEfQLMHCAFH@@KhUNE^AAEHCFDNGVODMI@AEKADEN@CSJw[HCEFQGBBOG@@CE@FOKBDGCAD@C[FCGIB@IE@K^BDOIAEMMIJEDKF@[UMB@GF@EEAUEABSQ@CA@EY@FJI@CHGD@FS@@CAFCACFSCCDCMSHBIECMB@D]@@MKCDCQEAHG@CCG@CGUEIJK@SPOCCNEDQBDNDB@DJCDLFCBBALJB@BVGPBKVO@KHCCCD@FE@BNA@FNCTDDJA@FGB@NBDW@CL@hT@@ZHHQDDDAFSAANBC@HG@EFS@@DE@@PCB@Ue@CADNJB@FCBWA@LI^ix@FIHrH"],["@@HUN‹AJKADGECBCMAG^E@EbI@BEGPKrJEH[\\B@FF@CHFB"]],encodeOffsets:[[[119169,40992]],[[119398,41063]]]}},{type:"Feature",id:"110108",properties:{name:"海淀区",cp:[116.2202,40.0239],childNum:1},geometry:{type:"Polygon",coordinates:["@@plDJVLŒGPBFHjDbHGL@X\\DBNHJREBLRBHaFGŽMGOBQAWPBLCBBAJBDFADOIEJGE@@EP@HCPWP@ZgfBRQJJ\\D@HLHLDVA@IVDFGSI@EGC@EBB@CN@@IZCAGHGaEqGJG@EjwJ]@K@GSA@e_I@NE@CA@Kg@KC@ENCFƒAKQAW@WIMK@V‹@I@@F@^EDFB@HcIaDYCBRRDCHD@EFLN@FE@CJUPEJOJMTBPEDIFCMIAKNOGMRFJNDVBFLSRMJSDGJsFcEiJGDGTIlOjYD"],encodeOffsets:[[118834,41050]]}},{type:"Feature",id:"110106",properties:{name:"丰台区",cp:[116.2683,39.8309],childNum:1},geometry:{type:"Polygon",coordinates:["@@hMN@NFTQCFRCBJFA@HJ@@HJ@HJ\\FTACDŒ@@UNLXJX@@MA@@IECAQlDFEHBDI~D@GXCFMVDFCH@@NF@ANJC@FnAB@AMF@@EDCDDLGP@LUOAUH@AIABKAAEDCKID@CCACMWA@EGDEILA@OK@AELEJBFEEGL@BSOA@EuAFmMACbG@@EM@ANS@ENFDAHSDCL[BEIUBAII@A[E@OaKD@FAACTGVIACDHDAFGAEDoGEFACM@i€g@@QFCMKMU@]SCoBGSMQ‰DEXXDWPO@MKYGM^AdJJA\\cNB\\G^„DNHFCBFABDBJ@PL^D@DF@T@FDAF^A"],encodeOffsets:[[118958,40846]]}},{type:"Feature",id:"110107",properties:{name:"石景山区",cp:[116.1887,39.9346],childNum:1},geometry:{type:"Polygon",coordinates:["@@NQPHLMJBDNJEFCAONSPIFIVODIF@@EKMFEC@DGQCAQZDbCdJ@GEAFC@]@EJ@DCSB[EGII@@GI@@GEBAIQDDESRMEM@gNYTIRKJAJEJ[DFJKLGBGNBJLDCDAHGBJJAFBLEXTLZFBAFDLD"],encodeOffsets:[[118940,40953]]}},{type:"Feature",id:"110102",properties:{name:"西城区",cp:[116.3631,39.9353],childNum:1},geometry:{type:"Polygon",coordinates:["@@XBDA@EIACM@IJAD]BC@SFABISAD]H@@OAEDQEW@BLE„MD@FLDh@@LDBF@@M`J@fTB@H"],encodeOffsets:[[119175,40932]]}},{type:"Feature",id:"110101",properties:{name:"东城区",cp:[116.418,39.9367],childNum:1},geometry:{type:"Polygon",coordinates:["@@DBf@@VDA@OF@@CT@FEH@@GADBMTBBECCRCGG@YS@@gDK@A‘C@PG@C^TBAJEB@TADC^IB@J"],encodeOffsets:[[119182,40921]]}},{type:"Feature",id:"110104",properties:{name:"宣武区",cp:[116.3603,39.8852],childNum:1},geometry:{type:"Polygon",coordinates:["@@RBX@RFFCŽBFU@aK@WA}CCJGAEFkCBRFD@JB@@N"],encodeOffsets:[[119118,40855]]}},{type:"Feature",id:"110103",properties:{name:"崇文区",cp:[116.4166,39.8811],childNum:1},geometry:{type:"Polygon",coordinates:["@@XBL@@bEV’D@BX@AC@MHA@EIBCCDSEMmB@EIDBME@@MG@EDUCENWD@H"],encodeOffsets:[[119175,40829]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/china_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"xin_jiang",properties:{name:"新疆",cp:[84.9023,41.748],childNum:18},geometry:{type:"Polygon",coordinates:["@@@›ρȁôƧƦóəʵסʵóƪԫʵѵͩƧͩړ›υࡓɛʵ@ȃ@óᇑѵƨɝɚôóНѺͩɜ̏ԭʵôƧɞñ@υƩ—݇ȂóƩƧ@ѵȂυœƥŌਗ—॥ɛóʵѵƧѹ˜݇̍ࢯ˜əɞυ˜ρͩ̏óਙƨƧŋôōóš̍ͩóʵן›óŋړͪƧѶ@ɜԭ—ԫƦɛȄ̍›ɝȄöςƩȂ̏œñȀ̏œƩóóŎə˜@Ő̎@ɞȀɝŎôƨóנѵȄƧ@óŏɝœóɜôŎ̍ͨςŎ@ƨóôƨɞ݈ʶóƨφó̎Ȁƨ̍ԮòѸԮמ@ѺȀ@ƪၬֆòȂñ̐òȂɜ˜óƨ̒Ŏ̑߼@φρȀ@Ő๐ς̎Ƨφ@ɝφڔ೦Ԯǿࢰ@ƦŏԮƨƨȄƧ۬ɜʶڔŐɚɚóŐôƨ߼˜ôƧƧó̐ƥóŏѺǿƦȁφƧς˜ƨƧ̒@ɜƥƦυ̐ɛƪͩƩəƪʷ̑ə@ȃƨʵנŋྸōਚԭԪ—@ɝƨŋ̒օςʵôƧ"],encodeOffsets:[[98730,43786]]}},{type:"Feature",id:"xi_zang",properties:{name:"西藏",cp:[88.7695,31.6846],childNum:7},geometry:{type:"Polygon",coordinates:["@@ôŌנœôʶ̎ͪô™óŎƨŌਚƧ̐ôςͪφ—ɚɝࢰ—݈̎Ѻ—Ѷƨôʶ०ɜਘ˜Ʀŋφ›Ѷȁ̍—ôŏɚŋ@̑ə—@ŏò̍ɜ›óƥôʷƧ̍φѹԪ̍ע@Ѹʷɜ@ôñנ@Ѷɛɞô̐ŏѶƨѸƧƥōƦœôŏô—@ƧôƩ̒ŋƨŌƦǿô̎ɜȁ̒—óʶѶôôО̒›ςƥɜНφσɛȁ̎υƨఱƧŏ@ʵƥœ@ŌóóóͩƨƧóŋ̑õóɞóɝԩͪɝρôƧ̍ƧѹͨڑŎ̑ōóƧࢭͩ̏ѵɝóఱóóԪυô@̒ƥŌ̏Ƨ̑Ȅ݇ŎƧ›ѵӏ@ɛõŏɛȄôӒƧŌѵǿɝ˜Ƨŋԫ@̏ʴƥ@óǿ̑Ȁóǿ̍ςóóυô@ʶɛñρƦƩŐó̎óœѵó̑ͪࢯОóɜן˜Ƨ̏ƥȄ߻̎̏̐ןŎɝɜöɞƩȀôöɛȀóͪ̐ƨƪ̍̎ȂƥԪυО@φɞ˜ôƪ"],encodeOffsets:[[80911,35146]]}},{type:"Feature",id:"nei_meng_gu",properties:{name:"内蒙古",cp:[117.5977,44.3408],childNum:12},geometry:{type:"Polygon",coordinates:["@@ኊȁ૊ö߼ƩɜɛנñԮɛѶóԮô@ȁѸóמ̎ගѺၬ@߼ʶԮӒ߼̎@ŐѹӒ̒Ԫƨöග̑ѶȄ̒ς।œѶɚöɞɜʴڔôôȂ̎—ѺȀς—ƨ˜ƪóԪ—ɜôɛОਕڔԭ˜ѵ̍ѹȂԫ›ɛƥ̍Ȃóɜ̎ô@ʶ݊ੲࢮʵږͪנƨôȂƧ˜̐ͪ@ŐƦƨφԬѶɜôƦ@ŐƧôôƦəŐ̏›@ŐڒѶԬô̐ʳԩНςōôŏɞ@ƨȂѶəóƧ̒ػ̎ó̐Őנóƨô̒@ƨɚɚ@עԫɛɛ@ȁυͩƥʳòևρ—̑ࡗƧͪ༃ॣԮփ̎Ʀ@ôô@ôō@š@ȁѵóƨ̍υȃóʵɛƨƥóυȂóəƪ›̐ρƧͩɜԭڔȄ̎عƧȁ̐ŏó̍ɛ›ƥƧ̑óρŐ@Ƨ̏˜ɝəɛ˜߻ͩ̍ͩɝО̍ƪƧóóӓƨóƧʳ݇@ɝςƪœ@ʴƩ—ƧƦôƨɛȄə›Ƨŋυ›óͩѵ@ɝǿóŌן̍ɛ˜óО̍œ̑̏ôȁ̍ŏòȁñóƦͩ@ǿə@ɛƧ̑˜ρȁυô̍օѹœóȃə™@ȂσʵѷƪòƩ̍—ôó߻ۯôʳƧ™óšõʵѵóѹɜ̍ȂѹôɛŌφֈƩͨρóυӑóޟఱ̑݇ͪóƪƨŌóȄڔԬƩςםñ̑ȃѵŐԭŏƨȁɛǿρôõɚɛóƧОə@ѹ̐ѵöԪͨôͪɛ̒ןŏƧƥóôƥƧɛŌôóɝó@̒݇Ӓ̒Ō@Ŏԭࢰ"],encodeOffsets:[[99540,43830]]}},{type:"Feature",id:"qing_hai",properties:{name:"青海",cp:[96.2402,35.4199],childNum:8},geometry:{type:"Polygon",coordinates:["@@ƨ@ôƪ݈ȁƪ˜@φɝòóƨԮʶɛ̐ѹͪôОəóƧɞᇒѶ@ôږô@ǿѶ›ƪȁςœɜͩφ˜ςŋɞôѶɛƨŌɞ—@ɚςŐñԪॢͩƨȂɞóƨŐ̎ŏעӏ̎óƧƦôœ̒ȁɜ›ςͩ̒œɚɛƨôƨɝφɛóȁƨŋóóɚͩƨóóƩ@ƧəŋƦƩ̍@ƧƧôǿυ̑@ȁɞǿõŏρƥסɚƧóτԫɞœôƧƦ@ñȃòñƥóυôôѹѵ—@ŏ̏Ȅɝó@ȂəŌóəѹƦ@Ő̍Ōυ݈ԩŐƧóôƧ̑›ôʵɞƧ̑ѵôƩɞƧ̑œóНѵóôʵ̑˜ɛȂó̍ƥȀƧŋ̑Ōóƪ@ƨó˜óŐƥ›ƦŎѷƨѵƧ̏Őɝóѵɜן@óòɛ@ѷʸס@ԩ̎υѺƨ̎óʸôƦɛœñ̎@Őɚ˜@̒əŌóŐ̎˜"],encodeOffsets:[[91890,36945]]}},{type:"Feature",id:"si_chuan",properties:{name:"四川",cp:[102.9199,30.1904],childNum:21},geometry:{type:"Polygon",coordinates:["@@ô˜ôŋó̑Ԯ̒ɛОמͪƨōöͫ߼ƥôȃƨóóñôƧóƧôōڔŏƨŐ@Ŏô˜òƥѺŎ@ōɜóנ˜ôǿô›ƦôԮ̍ɜôɚ›Ƨ—ñɛɚȁ̍Ƨɛևυ@óóôŋρԭɝ@Ƨʸ̍ŏυɜƧƧóƧƨȁρ̍ƨȃɚ—ôʵφóô̑̏Ȃ̑ʵɜʵɞ@ƨʳסƩóŎə—óɜƧôƩƧρ˜óôôô@ŎƧƨƨƪѹ˜ó̍̍Ʃ@̏ѹНôޟ̍Ʃóƪυɝɛ—əƨôŎɛȀ@Ȃ@ñɝʶ@Ōρנ̏—õóɛͨƨȂѵОɛʵ@̏ƩŐó߼Ƨల̍φɜȂυτɛОρƦɝƨóƪ̒Ѷɝƨóʶ̒œóƨƨôԪŏφ݇̎ŋ@ŏѺƥôɚɚŋ@ȁɞô̐ȃ@ŐѶ˜óѺφóƦôñòòȄ"],encodeOffsets:[[104220,34336]]}},{type:"Feature",id:"hei_long_jiang",properties:{name:"黑龙江",cp:[128.1445,48.5156],childNum:13},geometry:{type:"Polygon",coordinates:["@@ᇔȂਚНƨŐѶŏöƥςŏñƧƦóƨȁ@óƨ—óȁφӑóóƨ˜óǿ̎̑ôНɞ—ó̑ɜə߼›̎ǿ̒ôڒӑφ@Ƨȁ̎̏ƥƩ̎ρశ˜ôȂςƨφ@נɞ݈˜̑ƥƧɛƨʵƧȃƥ@Ƨƥ@ŏ̑ԩôɝρρóɛƧ›ƩͩƧó߻ʸ̍ʷѹƥɞڕõ̍öɝυ—̍ȂƧ̐̑ŏóƨñŋѹóóȁ̍›̏Ԭõʸ̏ŏ@ǿ̍@ƧОυ@ñƨòȀƥŎ̑ŐѵóɛŌóȂԫōƧŎѹñ̍ʶóОן@Ƨ̎Ѷô@Ȃ@™óŎó@@ó̍ƥԭք༄।ƨͩ̒ࡘς˜ñֈƦʴφͪ@ȂɜɜסԬə@Ƨə̑@Ƨóןô̏ŏ̍ô̑ؼôƨѵɚƧȁɝ@óŐρŎԪО̏ʴ"],encodeOffsets:[[124380,54630]]}},{type:"Feature",id:"gan_su",properties:{name:"甘肃",cp:[95.7129,40.166],childNum:14},geometry:{type:"Polygon",coordinates:["@@ڔôԮࢯ@ō̑ŋ݈ӑ@̑ɞôóôɜŋƦƨôóƨƦנŐɜ̑óͩԩͧѶõѺ̏ɚ@ƨНɜôöəςóɜȀƧȂԮŐѶŏ̒ȄמòƪρړԫôȃƧŋôƩ݈ͩɚ@@ǿɜ@φͩóŏɜӑƧōôǿ̎›ôƥƪóõ›ö@ô—ƨ˜ôƧƦôó̒ɜ@ɞŌõʶ̏Ő@ȀóôƨȂ@ʶע@@ƥ୾ӑó̑óŋôʵóɛړ@@ƩöóƩóρ—ɛƨ̑@óʷƥƥ̎ɛƧ›ôōƧǿôͩѵôɝȃɞȁõƧρóó—@ōƧŏړŐóŎôƨóƨôòƧôóȄ߻ƦõͬƧŎםͩɜНԭ̑ô̒óŌó—ƥ@óƨɝ›σԬƨôעəςƦöŐɝȀ@Ȃφ̒óȀƨƨ̎@ƥƪɚŌ@ƨôƪƧôəͪôôƧŌôȂυɜƧɞƧóəɜ̑›ρͪɛœ̑Ȃó›ƨƥ̍ôסӐ̍ŐƧŏɝôƧȁॡͪòԩρŏ@əɝ˜ƧŋѵɜɝóρŌυ—ɛͪρ›ƩȂѵœ@Ȁڕó@ȄɜʶφࡔڔœƨͪѶͪԬʶôƩעʶɚʶƥôóƨςȂ"],encodeOffsets:[[98730,43740]]}},{type:"Feature",id:"yun_nan",properties:{name:"云南",cp:[101.8652,25.1807],childNum:16},geometry:{type:"Polygon",coordinates:["@@ôɞôɝ̒öôŌƧƨôͪôô@ŋƦ›@ʶƨŐô߻ƪŏ@̐ɜʶѶНƧȁɜͧöô̐˜ςן@ŋɞʵ@ò@ȁɜǿóōɚƧɜ˜φɞôƩ̎ƪóޠѺО@̐̎ƪô̎Ѻ—ƧƩƨƧ@ōóóôóς—ƪƨƨóôɛó̑ԭ—ƥŌɛǿɝƨɛͩô›@ǿƨȁѺŌɚɛ̍ןѶНɛƧôóƥȁƦͩôŎɞ—ƨ̑ɜ—òôφ@ƨʵ@ɛѹōóȃəƨυǿóʵρƧƧŌƩɛ̏ȄñƧƧȀɝ̍ԩʶƧ̑υ—óŌƥʳɚӑóНƥô̑›óӒѵʵѹœƧӐןôƪφõŌƪ̒ԫŌƧؼƨƨס›ρȁƧœƨȂóʶó@@ʴƨôôφ̎Ŏ@Ȁƨ—ƪɚƨœóƨôôôςóޤƧŌƩŋƧԪ"],encodeOffsets:[[100530,28800]]}},{type:"Feature",id:"guang_xi",properties:{name:"广西",cp:[108.2813,23.6426],childNum:14},geometry:{type:"Polygon",coordinates:["@@ƦŋѺ̎ڔʵƨŐ@ƦמȄƪôóȂɜŌɚͩɜ@öóɜôôȂƦôɜȁ@ɞφ›óȄ̎›ƨʶɞŋƨʴɚǿ̐̎Ԭ@ôñ@̏ƨ›ρ۫ô›ɚƨƨНƪŐ̎›ƥóƦʵƥŋ@ȃóƥƧ@@ŏɝǿôυƧȁѵɛ@əóŏ̑@@ə̍›óƧó—@ȁƩ˜ρóòНƥô@Ӓ̑@óŎ̍ƥσŎυ@̍ƨ@Ō̑ôóͪƨ̒óŌړœ̏Ŏ@ŌôȄѺŎ@ɜƧʶυ@ñóɛ˜Ƨ̒ɝ˜óōƥͪ"],encodeOffsets:[[107011,25335]]}},{type:"Feature",id:"hu_nan",properties:{name:"湖南",cp:[111.5332,27.3779],childNum:14},geometry:{type:"Polygon",coordinates:["@@@քɜОƨ@öŐמóƪôƩɚ̒Ő߼ȁςͩɜòƪ—ɜȀò—ñɝò—Ѻͪ@ŏƨŋóɝôǿƨ™ɚȃóəƨȃѵͩó̍@ȃƨóóƥƨƧ@ʵƦ›óͩɜ—ɛóñԭɛōυȂ̍ƧƦō@ɛƥ—ɛȀ̑œóʷóō̍œƩŏƧОəƧóœς۬Ƨœ@̐óòԫ@̏̍əȀƧʳɝŌóɞƧ˜ƨɜóŐƨò@ȄƧŌρŋóôԪОóʶ@̎óȄ"],encodeOffsets:[[111870,29161]]}},{type:"Feature",id:"shan_xi_1",properties:{name:"陕西",cp:[109.5996,35.6396],childNum:10},geometry:{type:"Polygon",coordinates:["@@ςôöƨɝȂɞȄѶóóͪƨȀóŎƨœ̍ɜƦƦôʸ̒@ɜƧς˜ƪôõô@ƪڔ@ôɜóʶôŌô̒୽Ӓ@Ʀ@Ѻ̎ɜѺɛѶôöʶô™ƨšóʴ߼۰óô̎˜ñƪѸƩτʶ@ȁòŋəѹóǿ̑ʵ@ȁ̒ʷυփô݉ôН̏ط@ȁƨóô̏ƪõ@ʳ̐ʵ@ɝɛŋƩŌɛóןôƧŋ̒ó@ŏ̐ƥ@ŏυ@ƧƧôן̏@ƥȂѹɜəœɛóԭ̎ƥóóœóȀן—ɛô@ŎѹōñƦ"],encodeOffsets:[[108001,33705]]}},{type:"Feature",id:"guang_dong",properties:{name:"广东",cp:[113.4668,22.8076],childNum:21},geometry:{type:"Polygon",coordinates:["@@@Ȃô˜ôƨ̎œ@ɚ̒@ôŐ@ɚѶɜƨȂóφɞȀ@Őƨ@ôƦ@ȄƦŌƥʶƦôôŎôʸ̒›ɜǿƦ˜@ɜƥŎ̎ƨφȁɜŎòƥԮŎƨōóŏɛƧɝəɞƧ߼ɜςȃñȄƦŎ̒ōôòƨəƨ˜ɚН@əƨ̏ƪʵυŌəɛóəԭŏəœóŏѹœρʵɝƦ̏™ƥʳѶ›öō̑óóŋρȀυƧƥɛѹōƧôן—ɛŏѵ@óŋôʵɝ›ƪԩõ@Ƨō̍@Ƨ@@ƦɝԮƪО@@","@@X¯aWĀ„@l"],encodeOffsets:[[112411,21916],[116325,22697]]}},{type:"Feature",id:"ji_lin",properties:{name:"吉林",cp:[126.4746,43.5938],childNum:9},geometry:{type:"Polygon",coordinates:["@@נ@ôН̎ʵѺòƨōԬŎôȁɜŋѶô̒ŏƦōñǿòƧφ@ƨН̎@@Ȁ̐Őöʷ̐ԫ̎œôȂѺôòŌôƧ̒Őƨ̏̎ȁφ˜@ŋƩͩםȃƨ—@ȁ̑ʶ@Ōóôɛœƥѹ̑—συ݇@ɜρƧȃࢯƨôœəȂɛōƩɛ̏υρóõœƪʴυφ@ʶôŌóœρք@ɜƧ@ɝǿƧͪρȀƩó̏ŐƨȂ̍غړȃɛԮƨͪ̏ςƩœôɚφȁƦôɜƧôʶφȄ"],encodeOffsets:[[126181,47341]]}},{type:"Feature",id:"he_bei",properties:{name:"河北",cp:[115.4004,37.9688],childNum:11},geometry:{type:"MultiPolygon",coordinates:[["@@Ʃ̒̏ŌѺ̒Ʃ˜óȄƧŌƥͪòôñȂ̎ŐóȂ̒̐̎›ôНɜ—נ̎ôŋɞȀѶ@ôͪφœƨŌɚœɜȃóƧƨƥƪ˜@ʳƩ›ɞρ݈@υНφʵɜ˜ƦρƨƧ̍ɝóɛѹ̍ρŏ̑ôóƨ@œƧƦôƨɛ@ƥƨ@ȂƦ@@ôəŐƧʶƨŌυœ̍̎ɛŋôōɝ@óƧ̍›ƦʵѵʳôʵɜŏςôƪŋƨŌɚ@ôНƥƧ@ōѸɛ̐ô̎ʵѵНԭ@̍̍Ƨò@ȁɝ@əρυͩƪ̏ƩõƧŎƧōóšॡȄɛʶɜȀ@ɞςѶƧœƥςɛŐ@ɚɜɜ@Ŏôôςœƪς"],["@@õə@Ƨɛ˜@ŐóƦφô"]],encodeOffsets:[[[117271,40455]],[[120061,41040]]]}},{type:"Feature",id:"hu_bei",properties:{name:"湖北",cp:[112.2363,31.1572],childNum:17},geometry:{type:"Polygon",coordinates:["@@ñȄυƦöŐƩ˜óנƨƨφ@@Ő̏Ʀ@Ő̑ôƨŌנóɜôƪŋɜŌѶօڔə݈òɞōɜŎôӏƦóƨô̒óôȃƨó̎ŐôƧƪ@ƨȁςƧə̑̎Н@̍Ƨŏρôԭͩԫ—̍ʵƧšóȀôɞƧŌ@Őѹͩñ˜òɞñ˜ɛǿƩ˜ɛñρͪ߻Ȃ̑ŏƪəƩóםôõŏƧ@ɛНƥȄó›̑ѺƧ›ôφóƨƨƦƪóɜŐôóòôƨóφ̐ƨóƦ̎"],encodeOffsets:[[112860,31905]]}},{type:"Feature",id:"gui_zhou",properties:{name:"贵州",cp:[106.6113,26.9385],childNum:9},geometry:{type:"Polygon",coordinates:["@@ɜȀƦŋԮ˜ô̒ɚ˜ôōעƪƧʴɝ@ɛʶ̒ʶ̐ȁƦœóȂô@ôŏ@ōô—ƨʶѸô@ʶƨ˜ɞó@ōτöòυƨ@@əƨô@ɛ̒@Ʀɜôȃ@̍ôʵԩНôóςŌƨŋ@ȃƧñôŏƧɛƨ—ôɝƧʵ̍œôȃυœ@ɝɛȂƥóóȁɛóõôɛ@əͪɛŋôȁƩóםȃ@ƥƧŏړʶѹ̍ƥŌƦȂóôɜƨѵО̎נəɜѹŋƧȂ@ȀóœɜͪɞƧ"],encodeOffsets:[[106651,27901]]}},{type:"Feature",id:"shan_dong",properties:{name:"山东",cp:[118.7402,36.4307],childNum:17},geometry:{type:"Polygon",coordinates:["@@Ʃ̐φͪɚςɞ@@Ȃƨñ̎̎Ԯ@ѶОƨƧڔ@φН̑ŋ@Ʃ̒ǿ̎@ƨɜԬςôʶ̐ʶöԫƨƧנƥɜŎôō̎@ôŏóρƧŏԫôóƧԩó@ƥɜƧԭóƨʵɛƨ߻ӑɜНԩ˜óô̑óƧʳə™óɛƧ@õȀƧœ̍ȃɛŐóŏυО̍—óɝƩ—ԩ@ƧɚԫȄɚʶƨ˜ɞʶԪ̐ړɛƪ̒"],encodeOffsets:[[118261,37036]]}},{type:"Feature",id:"jiang_xi",properties:{name:"江西",cp:[116.0156,27.29],childNum:11},geometry:{type:"Polygon",coordinates:["@@ƧȄôɚəȄ̎ʶԬ˜ԮͪςóƨŐƪ›τɞƦōƥƧ@ŏςôóŐôô̒ʷѶ—ƪƩƩǿ@ō̒ɛôυ@—Ƨȁѹɛəƨѹ̑ƨ̏óƥѵʷô̍ɛȁôŏɝǿƧԫƧ›ôʳƥōòȃρȄ߻ɛɝƨɞɚɜƨôŐƧŎԭōñƦòԮɜôɛ˜ôͪƥœ@ʶƧƨôƦƧô@Ȅô̎Ѷͪ"],encodeOffsets:[[117e3,29025]]}},{type:"Feature",id:"he_nan",properties:{name:"河南",cp:[113.4668,33.8818],childNum:17},geometry:{type:"Polygon",coordinates:["@@φ˜̎ƪ̐˜ɞȄɚ@@Ȃעó̎ŌѺ̒ôֆॢȃô™ƨŎƨōƪöƩ̑ڔɜԩ̏ɝʵƧ—əʵԬȃƨəԪ@@Ƨ̒ŏô̍υȁƧɚ̍ôóŋ@ɝƧŋõ̑σ—@ŏɜŋôɝ̒ƧɚôôطρóóɛƩ@óƨ̍ŏƧôóȄ̑ôƧóƥôóӐɛōɝŎ݇ñړɚѵֆ@ɞ̏ʶ@ʴƩöó̐"],encodeOffsets:[[113040,35416]]}},{type:"Feature",id:"liao_ning",properties:{name:"辽宁",cp:[122.3438,41.0889],childNum:14},geometry:{type:"Polygon",coordinates:["@@ƨʴƧôôӔƨô̎ƩɞН̎ͪ߼ͪɜ—ɞɚ̐—@ƨςŏ̒ôƦƨɜœô̎ƪôςǿƨͩɞȀƨ@@ɛςփô›óŋ@ʵφυƩʳö›॥փρѹס@əɛ@ͩࢯ@ѹʵρ—ƩʶφȀƧ݈̒۬óʸɝŎѵ@ԭԫןɛƧƨƥςɛ—υʶφО"],encodeOffsets:[[122131,42301]]}},{type:"Feature",id:"shan_xi_2",properties:{name:"山西",cp:[112.4121,37.6611],childNum:11},geometry:{type:"Polygon",coordinates:["@@ɚѺñŌɚšôȄѺ›̎ֆφóςȂ̒—ɜƨɚ@@Ȁƨŋôȃƪ—ѹ̑̐ŋƪ̑Ʃρρ›óó@ōɛɛ@əɜŏƦρƨ›ρѵ@ɝɛǿɜʵóօѹ̑̍ŋסô@ȁə@ɝȃ̏—̍Ʃυ—Ƨô@Ȃ̐ظóОó݊φք̑ʸ@Ȃ̒ʶôȀ"],encodeOffsets:[[113581,39645]]}},{type:"Feature",id:"an_hui",properties:{name:"安徽",cp:[117.2461,32.0361],childNum:17},geometry:{type:"Polygon",coordinates:["@@ó̎̑Ő@ƨƪ˜Ѷǿɜ̑φ—Ʀʵ̐˜Ƨѵôóƪôôυς—ƨȂɞŏ@̍ԫôò̑ƥ—óȃѶͩƧƥôŏѺœôŏƦ—@›ƥͩƧ—ôȁυó@̑ƧɛѵʵƩƪѵ˜̑ʸóóôŏρó@ŐƦƨƥŎσɝƩœ@̎̍Оɚ̒ρƨƧȂôɜςôóظəó̑ƨóɞɛŌ@Őτ˜ö̒ƨŌ@ɞôŌ̎óƨəφȂ"],encodeOffsets:[[119431,34741]]}},{type:"Feature",id:"fu_jian",properties:{name:"福建",cp:[118.3008,25.9277],childNum:9},geometry:{type:"Polygon",coordinates:["@@̎›óȁƨӑ̒—̎ɚƨͩφŐƨɝ̎ŋóŏρ—@ōƨ›òʳəóƨō̏˜õɛƧ@ƨѵƧōəŏóŋƧô̑ɝɛʳƥ@@óɛõ@Ƨ̑ƧóȁəƧ̑—Ƨ̐@ɚəОƧ—Ƨɚóñ̑ŎóʴƨœƨԬɞȀóŐɜȂó̎ѶʸôƦƧ̐Ѻ̒ɚƧѺɜƨȂ"],encodeOffsets:[[121321,28981]]}},{type:"Feature",id:"zhe_jiang",properties:{name:"浙江",cp:[120.498,29.0918],childNum:11},geometry:{type:"Polygon",coordinates:["@@Ѷʶƨɜ@̒φôóȂƨ˜Ʀͪ@œ̐˜Ѹ̍τȂ̒̑נŐמôƪƧôӑ̑›@ƥρͩƨօ̏@@υɝó@ŋɛ@ôƩəóƧѵυó@ƩɜŋƧ@̍ŌƧɞυŏƧͪ̍ə̑˜ƧӒôȂ̍œ@˜óφ̑ɜ@ŎƪȀ"],encodeOffsets:[[121051,30105]]}},{type:"Feature",id:"jiang_su",properties:{name:"江苏",cp:[120.0586,32.915],childNum:13},geometry:{type:"Polygon",coordinates:["@@ôɞ̎˜φНôŐɜŏ̎Ȅƨ›öǿƨ@ôɜɚšƨʴ̒ôôó@Ƨ̎əԮȃԪૉöͩ̐ƧòʵφƧôʵ@óړɜóŏɜǿƧ›ɝρσȁѷ̎̏—ƥ˜óŐѹ›óŐƨƦѵͪôȄƦ˜ñ̒Ԭó@̎ɝŐƧȁρ˜óφƩóóôƨѶ̏—ƥʶυ˜ɛ̒ѵȀ"],encodeOffsets:[[119161,35460]]}},{type:"Feature",id:"chong_qing",properties:{name:"重庆",cp:[107.7539,30.1904],childNum:40},geometry:{type:"Polygon",coordinates:["@@əȂòɜƨ˜ѺɛƦȁ̐@ƪ—õŏφƥòȃƥ̍Ƨôυ̏ƧôñóóôɛŏƩôƧƥôƧóυƨœ̒ѹôœƦȃ@փƥɛ̑@@ɜƧó@ɚƧ@ñφσõ@ŎɝôƧ—@ʵѷóƧʵó˜@ŎóŐó@ôȁƥ›ó̒υôóʶə˜ƧȄς̎ƧȂôƨƨƨφɛ̎Őƨʷɞ@ςԮóŌôôφ@ɜֈ̎ƨ"],encodeOffsets:[[111150,32446]]}},{type:"Feature",id:"ning_xia",properties:{name:"宁夏",cp:[105.9961,37.3096],childNum:5},geometry:{type:"Polygon",coordinates:["@@ల̒ôޠφӒςôƪͧυևɜŋѺó̎ȁ̍ɛ@ѹס@@ʵƧȁôó@ǿ̐ŏöʵɝŋɛ@ô̑ƥóóƨƧ—ó˜ôœó@ƩôóƦ̍œóȀƨŎɛӒôŐυͪɛ@@Ȁə@"],encodeOffsets:[[106831,38340]]}},{type:"Feature",id:"hai_nan",properties:{name:"海南",cp:[109.9512,19.2041],childNum:18},geometry:{type:"Polygon",coordinates:["@@φɜƦʶ̐ôφô̎@ƨŎö@τʵƦ˜ԩ۫õН̏óƥȃƧ@Ʃəםƨ̑Ʀ@ޤ"],encodeOffsets:[[111240,19846]]}},{type:"Feature",id:"tai_wan",properties:{name:"台湾",cp:[121.0254,23.5986],childNum:1},geometry:{type:"Polygon",coordinates:["@@ô—ƩɝöƧɝѵəޣ̏ρƩԭóōóͪρɞƧОôԪ݈ଦѶɜ̒ɛ"],encodeOffsets:[[124831,25650]]}},{type:"Feature",id:"bei_jing",properties:{name:"北京",cp:[116.4551,40.2539],childNum:19},geometry:{type:"Polygon",coordinates:["@@óóó›υóôƥ@ŏóóə@ƧŋƩŌρóɛŐóʶѶʴƥʶ̎œôƨɞ@óŎɜŌ̎̍φ›Ƨŋƨʵ"],encodeOffsets:[[120241,41176]]}},{type:"Feature",id:"tian_jin",properties:{name:"天津",cp:[117.4219,39.4189],childNum:18},geometry:{type:"Polygon",coordinates:["@@ôôɜ—@ƨöɚôœôôɚŏ@óƥ@@ȁƦƧɜ@óƧƨƥ@›ƧóəН̏óѷɜ@ŎƦƨóО"],encodeOffsets:[[119610,40545]]}},{type:"Feature",id:"shang_hai",properties:{name:"上海",cp:[121.4648,31.2891],childNum:19},geometry:{type:"Polygon",coordinates:["@@ɞςƨœɛȀôŐڔɛóυô̍ןŏ̑̒"],encodeOffsets:[[123840,31771]]}},{type:"Feature",id:"xiang_gang",properties:{name:"香港",cp:[114.2578,22.3242],childNum:1},geometry:{type:"Polygon",coordinates:["@@óɛƩ@ρ@óœôȀɚŎƨ@ö@@ōƨ@"],encodeOffsets:[[117361,22950]]}},{type:"Feature",id:"ao_men",properties:{name:"澳门",cp:[113.5547,22.1484],childNum:1},geometry:{type:"Polygon",coordinates:["@@X¯aWĀ„@l"],encodeOffsets:[[116325,22697]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/chong_qing_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"500242",properties:{name:"酉阳土家族苗族自治县",cp:[108.8196,28.8666],childNum:1},geometry:{type:"Polygon",coordinates:["@@XJ°œlJX@lbl@XbV@VLnJlxnbšƒUU@IVK@lVIVwnJlU@n@J@L@Jn@l_nWVLVln@@blLšmV@@xœÔ‚`nœ™xV‚ÈLlx„LVxVVšƒV_U»VWn_m¥XwVmnX°ƒlmUUVwÞaVƒk@a@mmIUa@™mwk@™ƒm@@U¯a@UV@@K™@ykkmwkV@kU@ƒÑƒVkKWLÅamaUm@kyU@WkU@Ua™IUašVaUUmUUa@aVLXKWa¯UUbmJXnWnX`l@@xkzWÆ@V„LU¦‚x@b@JkIkJ@LmbUamJwm@óxƒnk@V„@x„ŽVnUVmVUVŽUbVlUbkXWŽ"],encodeOffsets:[[110914,29695]]}},{type:"Feature",id:"500236",properties:{name:"奉节县",cp:[109.3909,30.9265],childNum:1},geometry:{type:"Polygon",coordinates:["@@WVXb‚UnK@x@b‚²kxmKkl¯_ƒVV°™VU@bnKVVV@@nkŽ@n›bn‚@š°@VLČUš@°WV@V™nU@InKVl@nU„b˜KnX„WlknLlKUwnalLša„VlUXmWk@UU@UWWIUyķ¹XaWW@X™ƒKUIVm„U@W@UVU@KV@n»VkUkÇmUmVIUmULUbm@ƒwUaƒKkkm¯ÑUL@bWVnx@VmxUI@„klmkkK@aƒK@IlJ@I¯ƒk@mak@mnkJVL@bV@Ub„„W`UUUV™I@VƒU@VVbUJVLUVVbUX„VVxk¦VJUnVxnVVUšJV@Ubl@@bXV@L"],encodeOffsets:[[111781,31658]]}},{type:"Feature",id:"500238",properties:{name:"巫溪县",cp:[109.3359,31.4813],childNum:1},geometry:{type:"Polygon",coordinates:["@@nLWbX‚VLVU„V@KšIVl@b„@lbšU„VnU@JÆU@V@n°KĢUl@VbÞKšVš@„_„V‚KXU‚U@KXƒ@wlkkU@mWKUU@UôJ@XV@œaVmÞIVaVLƒƒ@»kmƒ@ƒUkL™U@aU@WWƒLUUU™™KkbƒwWa@KU@kaƒXmW—LƒamVk@UmL@JmVUšU@¯X™@ċVUK¯@ÅnWK™LkKULWK@UXK@wW@™LkV@bVLƒlXn›`¯xU„°LnŽlV@n°Lnl"],encodeOffsets:[[111488,32361]]}},{type:"Feature",id:"500234",properties:{name:"开县",cp:[108.4131,31.2561],childNum:1},geometry:{type:"Polygon",coordinates:["@@n@na‚I„wš@@VVK„LVbVxnVÆUnanKWXamKmk¯K@mkUm¯KVƒ°w@Wm@UIUUlKUU@a¯KWanwmUXamKkUWUnU@KƒkUwWKXaWLUWkImaUUUƒƒKka±k@lƒ¯w™wmbUƒ™ƒkXm@UJkIW‚XXƒbƒmƒ„UJ™XUV@°šKlšlVXV@xmbnV@blV@VšœU`UL@V™a@bULlb°VXbܚ@V@bƒL@J„xnLVb@lVb@V@@z˜bXWšX„KVLV‚š@@bUVVL@b„„lVna@ll@„zl@@J"],encodeOffsets:[[111150,32434]]}},{type:"Feature",id:"500243",properties:{name:"彭水苗族土家族自治县",cp:[108.2043,29.3994],childNum:1},geometry:{type:"Polygon",coordinates:["@@„Jlb@nVV@bXb@ÆlL„Ul`nVKU¼VxkbW„nlUxlXX‚@°°WnnJ@VUn@J„k°L@VlV@nUJ„x@bVVVz@VnLla„KnalVlIUŽ„¼@nV@@anKUwVal@UlJœƒlI@akU@UWXKVI‚¯Uak@@KmkXWÜkXWykIWwXw@laXamkVUUym_XmlkkmmakwmIUKU@Wak@kaW@kI¯›WIk¦VŽƒUUƒmaUV@XkVUV±aUb¯b¯¥m@@ImJ—@mƒmL@kUKUkkJƒbV¦"],encodeOffsets:[[110408,29729]]}},{type:"Feature",id:"500235",properties:{name:"云阳县",cp:[108.8306,31.0089],childNum:1},geometry:{type:"Polygon",coordinates:["@@lb„LV„VVnblJVXXKWbXLVx„l@LmVXVVl‚nLWbnVmxXb°L@bVVkLVVVJn@@X‚‚œ_Wm„kUK@alUšKX@@xWL@VXLVKlLšKXLÆm@™mœa@ml@mU@UUmL@aVšUU¯„U°`lknLlw±@a@wmLVWaXU@KWU@ak@VaU@™IUVmUUwVmUIl¥UwƒUVWUaVUUKVIUa@UUUUJƒUUm™kƒ„nl@„@VWV@L¯aUb™Ulxƒ@@b@VULUx@VUxVV™U@bU@mxU„U@mUVŽklkkƒ@WxknlxK@amLƒKU„K"],encodeOffsets:[[111016,31742]]}},{type:"Feature",id:"500101",properties:{name:"万州区",cp:[108.3911,30.6958],childNum:1},geometry:{type:"Polygon",coordinates:["@@ĸĊVI„ƒ„n„aWWXlJVIn@lWš„V„našx°xk„l@²Ž‚LVƒ„LnK@b‚LkwlmXw„@lllkUnVV@VƒnwV@@ašVUUVw@UVwVK@U@a„@kwšVVa°b@KXU@U@ƒmk„ƒÇсaml™kUVmn@VULU˜m@kUVkUaƒwUWm@Uw¯„mKUUmVUUULUKU„W@XbWVkaWwkUU™ƒ™k@maUbmbVlk¦ƒxUVUIWVU„kJVVkL@UmJ™UUVU@lLUVU„lx„@@VbƒJ™U™L¯¤@Vƒ„"],encodeOffsets:[[110464,31551]]}},{type:"Feature",id:"500229",properties:{name:"城口县",cp:[108.7756,31.9098],childNum:1},geometry:{type:"Polygon",coordinates:["@@VK@w¯L@m@UÅV@ImVƒU™Vkaƒ@@aUk™J@LƒUUVUKmLmbÅVmUUwUaƒKUL@U™@ƒxJmbm@nVJ@X@VkV‚n™lƒLXx™@ƒb@bUVƒLU`UnƒbU@@ŽmVVX@JX@VLVVšklV—„‚`@bUL@V„LVKn@‚U@„UJkn@lmLmK@X@Jn@mb„nÞWVXnJ‚k„KČÑÆ@VK@knaÜmXlUČW°kôÇƁ@a@yÞ_VmƒUnU@K"],encodeOffsets:[[111893,32513]]}},{type:"Feature",id:"500116",properties:{name:"江津区",cp:[106.2158,28.9874],childNum:1},geometry:{type:"Polygon",coordinates:["@@„InWUUlU@LVašlX@°²lÒXxlK@Ul@@Un@UaVJ@I@W@UƒUUVUwVIUKUa‚UUVwn@Üx@XUlnn‚bœJ@¥VklKUUlk@ynU@kVƒUUVWnI@¥V£VWVIUKU@UVƒa@n@Vm@@nlUaVkUwƒJ@blLkLW@XWmXkmmLn™@m@U@UVm@™„UVUUlakUVa„ƒVkV@@wnaWUk@VwkƒlmVIkUUxmJ@U„™@KƒIkx±V@IUm@K@IUKkbWKUbn„m„@bmVnbmb@xkxUJ@ULW`@bX@WVXL@Vƒš¯„mk¯@UJ@VmLUaWnX@WJ@nkKkxW@UIV@@KkImmkK@UW@XaWIU@U‚ƒIkbWb„xXŽlLVbnV@bWlX@VxVLnl@nÆÞVÜ"],encodeOffsets:[[108585,30032]]}},{type:"Feature",id:"500240",properties:{name:"石柱土家族自治县",cp:[108.2813,30.1025],childNum:1},geometry:{type:"Polygon",coordinates:["@@„š@kl@š¼UbmVXJ@bV@nxVIVJULVVk@@LWbnJVU@bVbUJ@blLXnWV—@mbnV‚@V„„bn@VJVLnaVanbl@„šVšlVXxlbXUWaX@VƒUUVwUUVm@I@WmI@a„mlLœ™lK@alwnUV@kóVaƒÝk@UlbVK@™VU»VUUVWUƒ@U`ULkwm@@KmU@knKƒ»VkJkUmbƒLkbmK@UUyUU@aƒwm@@XXJ@VVLVVUbVnUJVX@K„„k`WXXJWXUbmW@bkL™Um`Xnƒb@JVL@LU@™°VVXKVnUxVLUbmJ"],encodeOffsets:[[110588,30769]]}},{type:"Feature",id:"500237",properties:{name:"巫山县",cp:[109.8853,31.1188],childNum:1},geometry:{type:"Polygon",coordinates:["@@kVƒU™bkKmbVxkLmKkllbV@@LXb„xlašLVšVV„KXXV@@bšVlK„V„@ln@¼°KXa„U@Ulw°JXalIUa„ÝWXW@kVU@ƒVUVWUUUamUw@aVamwn@VUUƒlLXWm£@wÇĉkKklmLUÒ¯ƒWn™@ğ±kwmaWm¼U@@LUV@V@XƒVUnVJ„LWš@‚XXWbĸºVzXJVXV@@VXlWn"],encodeOffsets:[[112399,31917]]}},{type:"Feature",id:"500102",properties:{name:"涪陵区",cp:[107.3364,29.6796],childNum:1},geometry:{type:"Polygon",coordinates:["@@nèVblĖVVnLšŽ„@šx‚V„n@nšJ@L„UVVX@lbUJV@@nn@VVVK@z„˜V@nzVJVUlmX@@_VVVbnaVal@@knW@wnaƒVK@aVI„J@£kUVW@‚wXUVJ„amƒ@Ikƒƒƒƒ_X¥ƒ@WwkKkwmŽ™šƒkUxƒnÅmm¥™WV@Um@UlVL@JU@@Xƒ@UVkKVk™KVk™Kkb@bmJVXU„VVUbU@@`W_UV¯b"],encodeOffsets:[[109508,30207]]}},{type:"Feature",id:"500230",properties:{name:"丰都县",cp:[107.8418,29.9048],childNum:1},geometry:{type:"Polygon",coordinates:["@@Þè@XUK@LlV@blbUJ@„„V@bnV‚@VVVXU@ƒlbXal@VXnKV@maXUރ@amk@aVKXV‚anbš£°mnIVaUKVwUmWLUUš¯V@@KUK@I„aWmn_šVlK@anXVaXWWIXWl_ƒƒ@LUWVIUmVaUUUK@UWI@Wn@VI@mkU@U¯Kƒl@ImVÅLƒwU¤óbUU@wWXkmm@LU@@VUIWVUL@JUnƒaƒx@Jn„ƒbUIWVx@ŽUXlV@¤ƒIUJ@bUL„Žmb@xmX@lk@UbmbUaUU@`W@kn"],encodeOffsets:[[110048,30713]]}},{type:"Feature",id:"500232",properties:{name:"武隆县",cp:[107.655,29.35],childNum:1},geometry:{type:"Polygon",coordinates:["@@l„„w„bVm@IVKXUVJ@UV@@KnnWlX@xVVôaV£„xÆKnUVm@UmIXm¯¯@WkWVwmkXƒlaUwV»ULmk_ƒVkK@ÅWa@aUU@mkaƒIƒb@‚n¼ƒnm‚_@mmK@UƒLUVVmI@aUJ@XWJ@U`UIkm±kk@@lULmUmKUnVšnlUVmI@VkVlx™bkIƒVmLUxkKUŽ‚Xš‚n¦Æn„mVw„lš™nlxlLXx„@W¦„`„„"],encodeOffsets:[[110262,30291]]}},{type:"Feature",id:"500119",properties:{name:"南川区",cp:[107.1716,29.1302],childNum:1},geometry:{type:"Polygon",coordinates:["@@VšUbVJVUn@VLX@WVXVVI@VUVWxU@mš@ĊX@@¼V°aVUX`@_V@VaUUVƒUWnI@alašLUlšLUllLVU„@@WV@@IUKVkn@@VlLVwnK„UlJšakwlU@UnJVUmkU™VmXa@wVK@UUw™@VƒVI@akƒ@alInwlKXUmaUW@wWLk™™KVak_ÇaUƒƒV@šXbƒLVxUlWIk@UK@V™@ƒkU@VbUVUlVnƒLUV@lVXmxkV@L@V@Vk@WbUwmL@JUI@xVxkx"],encodeOffsets:[[109463,29830]]}},{type:"Feature",id:"500241",properties:{name:"秀山土家族苗族自治县",cp:[109.0173,28.5205],childNum:1},geometry:{type:"Polygon",coordinates:["@@XlV@lzn@VŽnbÆbXKlL„U„ÒV@@llUnxll@zšŽ@LU@@V°b@Vn@š„l@VÑUƒnK@UšU@aUaƒkVm@K¯wƒklmnn„Ul`nI@almkIUwmWVkUaƒkkJmUUa@K@aU@@_m@@wUyVUUa@Umƒ@awl@Wka±„UkUykIWV™b@bUVk@›aU@UXU‚UIWakUWmUxUV@nUVWbšŽ@XXVVŽmXXŽ@VƒbVLkVWx"],encodeOffsets:[[111330,29183]]}},{type:"Feature",id:"500114",properties:{name:"黔江区",cp:[108.7207,29.4708],childNum:1},geometry:{type:"Polygon",coordinates:["@@VX@V@LV@VJUL@lVnnxlb@VXV‚XV@@W„@UIVK@kUKna@£VWUaVUUalIVJVIUW„_lm@bXKV@mn@J„UUw@KnIVll@VanLVmUkVKXLVKUIVamw@UaU_lw„KlwUWV_Ua@aUa@KUšwm›_›Ó@wU@™nkK@am@UkUKmXk`m@@I@K@I@mkVmIUxUJ@kUL@JVV™„lnklWnn`VzUVnlWbkb@WxXxlJXzWŽÛlWXnl@Ll@Vb°UJWLX@VlV@bkJ"],encodeOffsets:[[111106,30420]]}},{type:"Feature",id:"500117",properties:{name:"合川区",cp:[106.3257,30.108],childNum:1},geometry:{type:"Polygon",coordinates:["@@XKVXlK„ƒVL@UnV@aValXXK„U@WVwUaVU@IV@@aVW„L@U@anVV@@bVK@UVL@bnJWL@VnUnb˜@@JnIlVl‚@@bXIWbn@UKVLVKXLlaV@VVnK@bVL„m„IVƒ@KmknUUWVI@aVJ@_„WU_VmUwƒU@K™ƒVak@am¯mJU_UJUkU@WkIV`UI@JV@LmmU@@mƒbUzś™@„VK@nUKƒ„ƒb™akb@UWK@bkVVbV„Û@@`ƒXk@WŽ@n@lXL@bmb@VVJUn@JnUlnUlmX@`XLlbkJW@kzlb@`@b@b"],encodeOffsets:[[108529,31101]]}},{type:"Feature",id:"500222",properties:{name:"綦江县",cp:[106.6553,28.8171],childNum:1},geometry:{type:"Polygon",coordinates:["@@@¦‚@X„lVX@@UVKl„VUX@lanVlUVbXWVXVƒ„VVUnKVUlwUwU@UJ@nmVkUV™lwXam@VaUUUw@W@kk»mV@UmKkwVKVUU@@LUKVI@mV@XVWxnXVKUUUK@wWU@UUWnUlLXa‚mUI„am@wI@K@amIm‚UUkI@m‚akUkKWUUanƒ@wƒamLVxk@UVmUUL@Vm@kV@I@ak@@bWVXJlLVbVL@š@bn@@`Un„@WbUKULWVXbƒ@UVmbX„WVƒb@bVmxUKUƒV@šUn@V@V@nmšnKlnnWWXX@lKkK@a„IVxUlVb‚k@mn@@U@m„bVUV@VLUJUXU¤"],encodeOffsets:[[109137,29779]]}},{type:"Feature",id:"500233",properties:{name:"忠县",cp:[107.8967,30.3223],childNum:1},geometry:{type:"Polygon",coordinates:["@@VLÞĊ„U@Wš@¼V‚„@lk@w²mlšVUœ„llšVnI@VlKUUlIVƒXUVJVU„wl¥UkUKUIm@ƒaUƒ@mUna˜@XUWmkK@aVIUa@aUVmIXa@Kl@UUVKUIUJmwU@@aWInUVa™»k@@lƒ™¯n™¤mabWUUL@bnl@b݄WVnbU@mLUWk@Wbka@„WVUU@UmUmVkUULV„lVUx„l@L@VƒbÈÒlb"],encodeOffsets:[[110239,31146]]}},{type:"Feature",id:"500228",properties:{name:"梁平县",cp:[107.7429,30.6519],childNum:1},geometry:{type:"Polygon",coordinates:["@@XLV@VV@b°°nšƒnkb@bƒšnJWVXblIUVšxWnUJnVVLVU„JlUnLVK@UnUVJš²nKVbVKla@aXlJ„k„Klb„ƒ@U°£šKšV„IUa@ƒ@kwVƒVUkKV@VUkk›ƒUVk™±n@xklƒ@U@»™‚@XƒVÝĉUJnxWb@UX›KkVUbUKWUkVmkkLU`›b"],encodeOffsets:[[109980,31247]]}},{type:"Feature",id:"500113",properties:{name:"巴南区",cp:[106.7322,29.4214],childNum:1},geometry:{type:"Polygon",coordinates:["@@nxnVlJlUXLƒ¦@x@Vl@nKVVX@V_V@@KlVXU„@lKlxXIl@ÈĊ@Vl@n_VJlŽnVlnb„²VVVJVVmUUkĕUamçU@»W@@ĉn™V@XwVU@UUJWUXUW@UKm@UVUIVaU™UVmLUVƒUU„UWWXUakVmUkbW@UVkƒUL@VW@kUWƒ@mJUXVVU„@lmV@zklVVkLUl@¦›I"],encodeOffsets:[[108990,30061]]}},{type:"Feature",id:"500223",properties:{name:"潼南县",cp:[105.7764,30.1135],childNum:1},geometry:{type:"Polygon",coordinates:["@@@a@a@_kalyX@lIkaWK@_nWVkkmmV@IVmUI@Una@aWK@k@mkbWaknmJUk@mk@@kUal@Uaš@Wa@aXLlwUKlkkƒ@KmI@VUJ@Lk@@VUUmL@amJU£kKUaWakLmU@bVVUbnbWV@xkL@bUb‚xUxVbXJVbUVWIUVU@kLWxkKWV@n¯VUbU@@VVX@VmaUL@VUK@VVbn@lVnI‚@@lnLULm@Ub@Žl@na„@lK@XVVkJ@b@zl@@VnV@bVb@J@bnXV`lXXmVI@W@InbV@@aVKUblKVLUanLlmnLlK"],encodeOffsets:[[108529,31101]]}},{type:"Feature",id:"500118",properties:{name:"永川区",cp:[105.8643,29.2566],childNum:1},geometry:{type:"Polygon",coordinates:["@@@b܄nWVLX„lxV„VxXxlVn@@bVblK@a@UnLVJV@@UnLVU@VXaVKVXš@n`WUÿ@IUKlaUUUkWyUÛÅÝ@mmkUKUwW@Xk@amUUakKWƒwXaƒK@VVLklƒXVlkxV„UL@bm@Vxn`ƒIVxUVkLVšUšl@@lkXmmƒVUn@VV@Xb"],encodeOffsets:[[108192,30038]]}},{type:"Feature",id:"500231",properties:{name:"垫江县",cp:[107.4573,30.2454],childNum:1},geometry:{type:"Polygon",coordinates:["@@šĊ°¤nҘ¼œaV_lKnllUXVVLValUœLVW‚@XamwVIUKkaÇфa@U@KƒkVwkUUƒVKlVnU@aƒU@ƒVIka@akU@KVL@WÝçUV@Vmbů@L™KƒnnJW„ƒVkxlL@VX@VxmnXVWxUb@bkn"],encodeOffsets:[[109812,30961]]}},{type:"Feature",id:"500112",properties:{name:"渝北区",cp:[106.7212,29.8499],childNum:1},geometry:{type:"Polygon",coordinates:["@@@bVVXL‚a@lnbWn@L„@XVlK@VVLUVlbkLUKVVVL@VšnX‚VL@VV@UbVb@x@¦UxVb@bUJƒL@L„VVxlK@™nk@U@W„UVLlKXV„@VblU@UUKVU@wn@VJVanLlkX@VaVK™¯@a@U@U@ƒVaUK„kUUƒ±maUkm@UUkbm@@Vk@@JƒwU@Ub@I@JmwUL@aƒ@@KkVÇLkƒWkƒ@kUU@@xUVmKUnllUb"],encodeOffsets:[[109013,30381]]}},{type:"Feature",id:"500115",properties:{name:"长寿区",cp:[107.1606,29.9762],childNum:1},geometry:{type:"Polygon",coordinates:["@@VVšU„bX‚lX„¥l@XnVmlxUx„@@blVnnôĀlm@aVaXwWUnmUwW@@UkKlw„UXƒmI„mšL@KÆ°na@UUImyU@ƒ—@yULUUm@@mU@VIkaW@UUƒV@K™I@mƒmU™wƒ@™mKUnU‚UIƒlVLUb@„@V@V@bš°ULUbW@klmKUbUIm@@xUVVL"],encodeOffsets:[[109429,30747]]}},{type:"Feature",id:"500225",properties:{name:"大足县",cp:[105.7544,29.6136],childNum:1},geometry:{type:"Polygon",coordinates:["@@XUmaVaUU@anVlKXbValU@aV@@IXKš@@bV@VxVK@UXLlUšJXa@_‚@@aVK—ÅWVkwWaƒƒwUa@am@kUWLU@kWmX@ykI@W@UV@na@LlLV@UƒkwWƒUKmXX`mIVl@bXLWVkbkkƒx@`VXm@@J@U@UUKUxk@WbUIVl@VXLW„ƒJUkUlUImxXlmb@X@VUJUnVbšW@UV@@VVX@bnW@LVxUnlJUV@n„@VxVIn@l`„UVVVL"],encodeOffsets:[[108270,30578]]}},{type:"Feature",id:"500224",properties:{name:"铜梁县",cp:[106.0291,29.8059],childNum:1},geometry:{type:"Polygon",coordinates:["@@VblLV¤nI@bnKVV@Ul@@KVI@UnJ@Ll„klVLkxWK@bXb™@Vbk@Vb@ll@@nVlnIlmXblaXl@„W@_Ü@UƒUalU@aXL@Vlašb„a„ƒVL@mUL@ƒUUƒƒÇXUW›X_WaƒƒUƒ»m_™@UWULWb@UUVmK@VU@UImK@V@bkL„x‚„XblxXU˜ÆUL@b@@`Wb™IkVWK@VULUwU@@a™@WL@JU@@bkVUb"],encodeOffsets:[[108316,30527]]}},{type:"Feature",id:"500226",properties:{name:"荣昌县",cp:[105.5127,29.4708],childNum:1},geometry:{type:"Polygon",coordinates:["@@VI@U@WnaWknwVJVkVl„IXƒWK@UUkVJXal@VwVL@V@V@In@UW@_„wlllaXUWK@aUknJW_ۃ@aWaU@@UVm„UUaUImJVnÅUmVUm`kUUVWLnVU@VVmXƒK@„nxmŽULkx™ImJ@nU`@X@Vkn@`@nlV@nVJVaX„VLnK@bVV@nV@lbXWš@"],encodeOffsets:[[108012,30392]]}},{type:"Feature",id:"500227",properties:{name:"璧山县",cp:[106.2048,29.5807],childNum:1},geometry:{type:"Polygon",coordinates:["@@XzVlVVkbVL@JVĀXŽ‚¼V„„„XbW`XœWVȎ„„VVšŽVkV@@UXa@alK@IƒƒU@UKWUyUI@wVUUWVak@VUkƒW¹@WXI@yVIUK@kWwkѯ±W@™kUb@KkVVVmXƒJ"],encodeOffsets:[[108585,30032]]}},{type:"Feature",id:"500109",properties:{name:"北碚区",cp:[106.5674,29.8883],childNum:1},geometry:{type:"Polygon",coordinates:["@@X‚VLV@„„@JkL@bWb@VU@UlƜVy„a@nV@nn@KU@IVJU_lJXV@VlVIV`nIn°@b‚lUbš„„KVI@aUaVw@¥@wUaVaU@@UUKW™m@UUKUUVLlKkaVUUK@UkLWUƒ@@KXmma@kbWKUU@aUamLnÞ@VWLk@@Wm@ULU@@U™KUVWI"],encodeOffsets:[[108855,30449]]}},{type:"Feature",id:"500110",properties:{name:"万盛区",cp:[106.908,28.9325],childNum:1},geometry:{type:"Polygon",coordinates:["@@VIV@@wVJ@InKVxXal@@U@U@KlUnwUW@kVU„KUmVkUa@I@KW@@bk@@mƒU@m@k@a@aƒIUxmJk@ƒwULƒwkKmVVX@VXV@xVLVVULmWXwWUU@@nUJVL@KV@UVULlxnL@VnUl¼@l@XVxVVUbn@WbkxUšlVnU@m"],encodeOffsets:[[109452,29779]]}},{type:"Feature",id:"500107",properties:{name:"九龙坡区",cp:[106.3586,29.4049],childNum:1},geometry:{type:"Polygon",coordinates:["@@XK‚L@Vš@XbV@lW@UV@@VXIV@U™VKlL@KnnJ@VV@VU@I„@@mVUVWUUmL@V¯LUK@UV@UU@a@U@yU@WLUK@X@KUVmL@ƒ@aXI@w@ammVk@WÛwm@UxVVVbVLUJVxVU„V@V@X@JUIVbm@@Vk@@VkL@lVLUJ@zWJ@X"],encodeOffsets:[[108799,30241]]}},{type:"Feature",id:"500106",properties:{name:"沙坪坝区",cp:[106.3696,29.6191],childNum:1},geometry:{type:"Polygon",coordinates:["@@Xºl„UVl@UbVXUV@xVJVzXJVUšL@VV@VKn@@Xl@XK@UmÝnKVbVakkVm@k„ƒUK@UmIm@LkKULVšU@WJ@UU@@VkXU@Wa™@@UKWL"],encodeOffsets:[[108799,30241]]}},{type:"Feature",id:"500108",properties:{name:"南岸区",cp:[106.6663,29.5367],childNum:1},geometry:{type:"Polygon",coordinates:["@@VV„JVL@bUVVnl`XIlwXJlw°nnl‚IXW@UÇĉk@WJkwkLƒ@WVkU@LU@U`W@UXUV@n"],encodeOffsets:[[109092,30241]]}},{type:"Feature",id:"500105",properties:{name:"江北区",cp:[106.8311,29.6191],childNum:1},geometry:{type:"Polygon",coordinates:["@@nLVU@wV@lV„@Xll„ÈKlU@L„@@bVKnx@I@JVaV@„x@Il@@Un@laVVn@mkUIm`k@WXJmk¯mkxWIkxWJk_UmVUUKƒ@UU™@ƒ„@l"],encodeOffsets:[[109013,30319]]}},{type:"Feature",id:"500104",properties:{name:"大渡口区",cp:[106.4905,29.4214],childNum:1},geometry:{type:"Polygon",coordinates:["@@k@@U@w„¥WKkVkImUmwa@b@xWJ@b@„nKVU@L@WVLXKV@@z@V@bVVU@@VVL°K@U"],encodeOffsets:[[109080,30190]]}},{type:"Feature",id:"500111",properties:{name:"双桥区",cp:[105.7874,29.4928],childNum:1},geometry:{type:"Polygon",coordinates:["@@WwUwU@kK@KmbU@@V@XlJ@znWlXV@XK"],encodeOffsets:[[108372,30235]]}},{type:"Feature",id:"500103",properties:{name:"渝中区",cp:[106.5344,29.5477],childNum:1},geometry:{type:"Polygon",coordinates:["@@VLš@VV„@VL@aUKƒIUUƒ@@JUVU@"],encodeOffsets:[[109036,30257]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/fu_jian_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3507",properties:{name:"南平市",cp:[118.136,27.2845],childNum:10},geometry:{type:"Polygon",coordinates:["@@@knyƒk@ƒKU¥šwV@nkƒWƒzUmk@@lKUa@aVI@UƒKUamKUUVaUI‚@Xƒ@UV@K±IUVVlUbUbUL@KWUXmWk@KkXmmkŃKUƒ™a@amUƒbkUkKWUnwUƒÇwV™UUƒÝUKV£U™@ƒnKWwXLVKm¥@wUXkmWk@ƒ@wX@lU„@šyVImaXwVƒƒ@kŽƒnU@mbk@mlUXƒmU@mV@n@bnW@bUIWJ—ImVUKWbUK@nkKƒaU@W_VUUmWmL@UU@™bUWUL@V@bmVUz@`mUUVVbXL@V™L@lmLUxmVamXkW@xWbU„VbUxkU±@ÅUmmkLUbW@@`kLknVlV@lbXxlVUXVV™ŽU„U@UbWŽkIWVUUUJkI@llbUxVL@V™VƒUU°ULUmWXUV@VULWb@™xm@UaVLVKUa@ƒw@V›bkmVambUUm@@VkK@„@b„xlxX@‚„n¤@Xƒ@@lkLWV@Žn„V„kb@bWJXLWx@nkxmm™bXn@VWVUn@VnJ@bVXl@„™VJXnWbX`lL„UlJVI@Žœ@VXV@Vl@bn@@Æmn@VšxXU@mVIlxšVššnI„l@nVJ‚aXI@mlU@aXkVm°klmnVV_naš°@V@xܦXK„V‚nnUlVXbVK‚LXKV@naV@@VVl@@lXblXšWnLlbVK²nš@@‚VLUnlV@lƒXxô°‚V@UnaUUlKXLVUVVUbVVlUnJVX„@VW@an@lb„@nl@VU@anƒšUVW@kƒaUm@InVVKVU@kUW@Uam@km@kVa@a@™nwšU@WlI@mVI@WXaW_nƒ@™nƒlkkW@U‚¥@kV@Uw@wUƒ@@IXK‚¥VIn@nU@`@Xl@VV„LnašW‚bVaUwnU„@VIšKlV"],encodeOffsets:[[122119,28086]]}},{type:"Feature",id:"3504",properties:{name:"三明市",cp:[117.5317,26.3013],childNum:11},geometry:{type:"Polygon",coordinates:["@@lL@Un@VVna‚bnUlœa@U‚x@„VbULUKVbn@šw‚@XaVK@UVUXWVnVKV¯„VšU@UUKVwka@klJVIVVXUlJXVaV@VƒšUUVWkUWwkaU@UklmlK@_X@ValKnnÆV²@lVVwUaVƒXa@wlXnW‚bnUVwnK@kšK@UWKUaVUnV@_VynU@a@UVKVXšaV@@VnKnXVV‚UX`V@„blL@mVLXaVLnU˜JXIVJ@amX@a@mnUV@„nVWnkl@naV@„ml„@@KmKUam@UU@ƒ@UlKU™Vk™U™K@aVaUwV™U¥UIkJ@wmI@‚mbkwkVW@UXƒKULU`™IVKUa@LƒkkVmUU@WlULUWÅU@I@ƒWW™nU@@w@a@ƒUam_XyVIVWkkƒ@mwVKXUV@nw˜VXkWƒÅ™U@ƒaƒU¯KUnƒK@ƒ¯šmUƒLXŽVLnWVbVbUVm@Ub¯¼W@amƒ`kb™amLUUUƒ™aUXV`@x@XmJ@n@L@xkJUU@kU@mWm@kUUwUUVWl@VUkIƒy@kkaVUUm™IWVXbWxU@k„mVkK@nWVX¦WxU@@bkx@VU@WŽk@™kUbmJUUmkUW@_kKWKƒ@knV¤kIUKWLUbV‚@Wbk@@VWL@VkI@lUXVxUVU@@mWIƒV@a¯nUaƒaUV@„ƒJ™b@bÞ°VbUš@X™aUVmL@‚VXblŽnV„°˜n@Vnx„@VUUUlK@InJVb@„Vlnn@V™L@VWJU„x@XlJUVVVl@LUUUJ@Lƒ„@lUL°¦k˜V„VnV@„xV„„l@blLnlšLVaXll@šnVUn@‚xn@nml°‚X@lb"],encodeOffsets:[[119858,27754]]}},{type:"Feature",id:"3508",properties:{name:"龙岩市",cp:[116.8066,25.2026],childNum:7},geometry:{type:"Polygon",coordinates:["@@ša„I@ƒVU„bVb°m@b„UXJ@nV@VUUwVW@klJ@UXK@Ul@Xa‚@UVaXKVLlJU£lm„@XLlL@`VXnlVVnIVašll@XV@@Ulw@aV@XwW¥XU@mlLnUlƒV@XwWaXUšJVnUVlb@l„zlJUVk@UXVVVxlVn@nXV@@lVVlI@w@K@mnI@W@wU_VWšbV„VVnKšbla„_n‚bX@°»Van@VUUaUamXUKW„K@a@Ukƒ@wWkXƒWW@wUU™Kw@_lyƒwUkU@@Uƒ@kamVmƒXašUVUka@Wk@»UUUVƒKkbWU™VUbk@mkƒxkƒƒKnIVUmW@kUKmXUmVaU@kU@m@KUWVkIWJ@ŽU@UI@wUUUa@KW»nU@mVkUmm@XwWU@ƒUUmL@ƒw@mnƒVUU@aWak@@amxU@UxULWVXbVLU`mbUImVU„ƒbn‚V@@bVn@bnVWxLmyUbƒIUKƒ@aƒVm™akbV‚UXW„UlKWbkV@„WLUlk@@nšbƒb@lkKmU@ƒUIWJkw¯UUVVxm@@XkbWx—›XKƒlUzWJkUUL@bmKkVƒ@@VUIUlWV@X„K@VkbWx°xUb@LUbk@@VWb@LXJ@VWXU@@bUVV„VVn@VVlLn„@l„@‚xk¦Vx@bVJXbƒn@JlnXxV@@„nJ@X@V@lmx„bUn@xVL@VVKlL@l„„nLVaVL@xkl@LƒxVl°š„X„WVX„Vl„œJWnxlJ"],encodeOffsets:[[119194,26657]]}},{type:"Feature",id:"3509",properties:{name:"宁德市",cp:[119.6521,26.9824],childNum:9},geometry:{type:"Polygon",coordinates:["@@@LVKVaVaUkVU²J@LVU„@@W‚VJUbVVnLVb„L@VUJ@bVbkL@Žl@Vn„y„XmlU@™xV¦„L@Ž„lmz@lnL@bVVšbVb@l„nšKVk„Vl¤@zXV@šl@XJVLVKnXVK‚VnU@wUm@šKUƒ@UlVlw@U@U@ƒUaUKlU@kXKlmXIWKXaVIVUVK@KU@@k„JVUnLVJUL@V‚IVa@VnLšKUnl`Vb„V„V@š‚Vbn@Vzn@lKnVlI„VVKUalkXJl@XXVWVLVUUmVU@Unm„£lK@Uk@WUXK@U@WVwVkšƒĠkĢÇ°aUÅUwmaţƒɱUÇa™w„±V¹XalKôx„@„UVaÜʓͿVóbÅLƒJm„¯Vk¦ƒŽk@mamXkKUƒUL›akbk@mV@LkJWb@Vk„mXk@UVmaUV@amLUKUamI@KUaU@WbU@UUUƒUIWJUkm@šƒw™Kk„VJm@kxǁVƒUK@mUVUkmlkkVm@amwƒLVWU@UbVLkšUbƒ@VƒmK@XaVWU_VJnwV@@kUmWakxƒ@kwWakIWxnbUJ™zƒ@kVW@@x@„XllnVW@xn¦ULWKXxmL@„VšU¤VL„ÞVVUšÈxV„mxXVlLlV„anV@bšbV„„LlÆnnlW@LXlWnXV"],encodeOffsets:[[121816,27816]]}},{type:"Feature",id:"3501",properties:{name:"福州市",cp:[119.4543,25.9222],childNum:9},geometry:{type:"Polygon",coordinates:["@@lxna@nJ@xlIVJV¦UšVxUb@bšLšVUlVškL@V@„VVn@Vb‚Ln‚@LU„lJXblx„@lwXbVn@lU@mxUIV`UXWb@‚nLU„„@Val™UKVaV@UX„Knx‚bn@lUkllnUVnV‚@VLU„È‚lwn@UIlƒšL„x‚™n@VlXIVJV„VVV@XaV@Vb@LnJVbVLnK@bVUnbVUl@nWlƒ@UXalI@KnUl@laœbVKV„lLnWnbl@„l¥°Unƒ„IÆKôa΀U„a@UUwÇWǓIUWUÅVkƨm@ƒ@£@KmLU¤ULˣJ™kUƒVǟUUķ@ĉVƒKUk@Ñ°wôǚç@īšé@Åţ¥mīÛkm¼Å@ƒVķVó°ō¦U°ƒn@bVJXVVL@bUŽƒakLmx@xmxXzW`XbWnXV@bWLÛ@™aƒ@ƒaXbWVkaÝwU@mlWKkLWWkLUKULW@kVmVUU݁UamV—¤›n@xUVUzkJV¦lJU„"],encodeOffsets:[[121253,26511]]}},{type:"Feature",id:"3506",properties:{name:"漳州市",cp:[117.5757,24.3732],childNum:10},geometry:{type:"Polygon",coordinates:["@@@bl@Xb@bVVUŽm„@n„x‚@nKVV@„XVWxn@VnUl@nmVX¼@LVbVV@xVJV@@XIlJXU‚V@Ln‚@lVV@UbVnnWVL@lnXUVmJ„Ll„„wnll@VašUXVla„LVUVV@¼Xl@lbUV™VWbn„nUlb„@@VV@„aVUšmlUašUny@kU@Wkk@WaUVk@@ammk@@U@UlU@aUa@wl@šmXLllnL‚U@anVnU@L@VVV@KlXnWVnVanUšw@w@wm›nÅ@wƒaUam@Uk„mUl@@a„a@U@¥škôK‚wȯ°w@ŻkwǕaK›ÑÛk@ĕōřċ£ĵƒUKW»kÅŻLU@Ulġw@¤Vz™VUbkKUbmLmlULU¼UxmbXl@bWVƒb@bUnV‚UšVbULU@@VkbVL@`U@WX@ŽXV@b°„@b¯š@¤@Xm@@b@`U„VVUL"],encodeOffsets:[[119712,24953]]}},{type:"Feature",id:"3505",properties:{name:"泉州市",cp:[118.3228,25.1147],childNum:9},geometry:{type:"Polygon",coordinates:["@@Vl„xkz@`‚xšLVV@xXXW„Xl@xl„@V@bnV°™@„„LVm°L„V„bV@ƚX„Wl—UmxU@WVULnx„@llUXUJWzn`Vb@„@b@xV@šmXX@„@JÆVVXVKXkV@nVlU„l@KVbULšJV_VK„LVWX@lUVƒkIU¥lIVyVU@wœm˜£nUVWU@aƒm@UmWw@UX@@am™VUn@@aUUlUVanaWUXWmUnkšK@VšUlVVUUwš@XLWWX™ma@knm‚bVb„VXbVL‚@XJlInlšL„w˜mXóšw@çV»ÇçŋaķƧóƅóKġ°nÅUķƑUÇW@—¯xÇ°öÆlV„n@llšaš@„Lšbƒ`™@™„VšXVƒVx@V@bULVJUk‚Ç@ƒ¼ƒXUKk@mmULkaWbk@ƒx@UkL@a@K@U@UmKmbU@kV@UmVUbUmmXkW@LUU@U@KmVmU@bVmKkkWK™nk@@xVb@bkV@V@Vl@nn@bl@VUXbl@XlV@@lmz™VVbkŽ™nUVƒb"],encodeOffsets:[[120398,25797]]}},{type:"Feature",id:"3503",properties:{name:"莆田市",cp:[119.0918,25.3455],childNum:2},geometry:{type:"Polygon",coordinates:["@@VbނVVnUlUX@VKVLlKXXlKXL‚‚nkV@ÞxlbXUWa„b„@šbÜ@XK@aWUXmWaX_Wynw@wnwlK„bV@aUKWUUI@a„mV¯Ŏ¥ô¯ĸU„UÆ@n»¯aƿé@ţ¯nĉĬÝK™óó@™ÑU¼@è™xWô—nƒx™KmkkJWI@UKWaƒUUaamn@lnbWšXXWK™@VxUVkU™V@U™LmlnVWXXVmbUbkVVV@bm@UVnš@bW@@VXx‚n@V„n@bV‚UX"],encodeOffsets:[[121388,26264]]}},{type:"Feature",id:"3502",properties:{name:"厦门市",cp:[118.1689,24.6478],childNum:1},geometry:{type:"Polygon",coordinates:["@@@VlUV@nanL@V@V@L@blK@V„wl@XalbVKnnl@VL„W„»È@lVUIVK@a@UUw„WUU™šƒš@„_™aƒK™@™bkkm@UƒkõŁxóL™l@¦@Vƒb@bk@VŽƒnVln@Vb„b@xmÆnœ@x@x™x"],encodeOffsets:[[120747,25465]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/gan_su_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"6209",properties:{name:"酒泉市",cp:[96.2622,40.4517],childNum:8},geometry:{type:"Polygon",coordinates:["@@ÇnÅaĉ@ƒU¯¥›UŹ‚ƒ£™WUýUU±JkkUw‚yÞIČxĊĕĊ¯š¥ÆUkţ™UÅÓ±¼™IUx¯UƒÒƑ‚ݐŰƒKÝnğ°ÅU@Žƒ@Vn@þš¼¯šWnŎ°XLWlnVnbWnƒVXxmbƒa—bóUƒlǕUUa™IUmlU™ƒš¥™kƒ¥ĉwkkƒÝɛa@¯™™U¯°mVƒkVnKlƒōÑÇÑU@kl™UġŽkUŻnUW™@š¯ƒk»šmWV£UKnUƒmUw‚w@ƒUIVaX™šwm»Èmmwn¯ċ™¯LĉŽUƒJUalka±Va@U‚k@ƒÛф¯WmnUaɝ¤Ûmƒn¯m±x@wóxÛLġÒUx¯VƒÈ™JUbóz݃ÇKĉ¯ōlÝUŎWl¯nťbÝ@¯ǩLġmV@ƯĢkÆm™ĊkVťLɃmÝXó°@„ĢbVŽóVݦɱ@Ƨaġ„UV„ĠÇÈV¼UVţwmbJÇwˋa™XmǯKkkmŽƒbXšm¼V¼ǬŚ²¤ôŰÆƴô̐ŤǪnɆӨ¼ɆLÆłUĊšxŎƞȘǔˎǬǪnƨŮǬö°»šġ„„ÞÜÆĸÒĊ„ǀbƾèôÈ@¼¯þŤĸƧ°VĀ¯b@lÈĊ‚šʠń̐„ȘKǀŽֲॗţÿǕý@ʊǓƨóÆÑǖŃôw@΋ʈƆÅÈVVĊV„óĊÅ@ÞƒĬV@Þīš@°Ž„V@ĸĢƒ°XτƜĠ@ÈaÜ¥Őƅ‚™nğóĕVġUůƿŋ—ĕƒa±V—UťÇğÑ"],encodeOffsets:[[101892,40821]]}},{type:"Feature",id:"6207",properties:{name:"张掖市",cp:[99.7998,38.7433],childNum:9},geometry:{type:"Polygon",coordinates:["@@ÈÒŎÒk„mLUŽlŽU„¯nV°šš@°ɜb„ÞĠaÈ»ĸl‚š„LVUÈ@Ċ@ýUm„@@ÆVĠ¯Þm„LƯޏƒ„Ñ°VVwšJ²»ÆԚVlŤÅV™¦ĉ°ĉĖċwÝJzVxll²IVVVþšX„¤źœV°¦„VĊ@ÆbÈmǔLĸĠ¯Ģaô¯ĸmÆÛUƒlÇĸk°XyĊUǔV„ǩnmV»ƒa@ýnK°n@l¥@»ż„Ċ¤m皃@£ČU@mƒmVkÞUƐ±²¹°‚ĠwÅƑŃU¯™›V¯aÈŁšƒÇ»™ġn_°xŎKlxœklx„@Þw‚„„@Æm²b‚DzLlkšWXať¯ĊaœÑšK±w@wƒUÅçV±Uk™@@„¯š¯xƒU™±±UU°ōxVxÅÔō°ó¯UÝ¦óbÝþƒ@ĉÈóUV‚Ux„„@VŽUVÝwÅÈǎóVkk¯JǐkmmL@„™KÇx@bkš™@U°ķ²ó`ƒš™šmn¯°ƒUwlÅkUƒ`™¦ɛô™Žķz@ŽÅnÇ°U¼¯KmVk²ƒJƒ¼ƏÞķôš¤ULƒ@mnğ`™šÇnUxÇ@Ûÿ™U@ƒƒkŻŽ@x@móJkŃ¥VŹĉóÒĉlċ°ķ„Uƽ܃@›x"],encodeOffsets:[[99720,40090]]}},{type:"Feature",id:"6230",properties:{name:"甘南藏族自治州",cp:[102.9199,34.6893],childNum:9},geometry:{type:"Polygon",coordinates:["@@ލš™nKlnšwX¥WÝXk˜xÞUnƒ°aĊVnUUKlÞĶWXnĠ¥ô»„™@nmVL@¤°™Vz„JšanU@aÆwna@k›ƒU¯šyX_›aĉb™ƒ„wƒéXkWwÅaš¯V¥mƒ¯UƒƒI@ƒš@„mšb°aÈçšUš¥@»‚knwɜƇ°I°ÑÈmVU™¯Xa@w‚W@wšV¯Č¥l¯Uwnm@k˜aUaóKkk@™Ça™b@ŽÒWa¯IÇxÛam¼™VUƒxÒl‚@zÝÒ¯bÝaĉVĉwDŽW›zJ™mJn²mܯUƒ¯ĉ@ġ¤Åb@²nšmlƒ@@Ž„„U„ƒLVxšV™„U¼Ålma™b@ƒ°™l@WIUƒ¯@mƒ™@™™ó„™„@U›zţyƒXÇU™ÇVUUVLkbWakVWmUbkkƒKUÆ»nƒ°Knk@aƒUVmšnk»l¯Ģ›lw@_kKVU@ƒnaƒ@lUk@¯¥mV@kmbW™b¯Åõa@mkU@kƒÇŽkU@›`@™óó—bl¼Uxƒn„¼šlVȄx@blVkVVnƒ`XÈġÈ@ǃK£ÝJmUUnUĖmlU„mKUn™VÅaUw›Uĉ`¯n¯wW¼nxVŽ™š@bĉnƒ‚kIċŘkXUŽ±Ò™xšÈ@ŽX°`l„œV˜IȯĊV„ƒšVVan@VašUVażVmšblkÈW„ƒWIXa„alL@wVb„„V„¦lL@lĠ™n҄U‚nk‚šL@ÆÞkšÞšK‚bñþW¦Û„ċVƒ„ULUºkÈlŎUxÆxÞUUxšÒ‚x„@XbšL@lÆ@„ÒlXVln@„bm¼ƒJ@„Ån„šƒx@bnšĠm„xVXmbÈè@ŽĊ£ČW˜w"],encodeOffsets:[[105210,36349]]}},{type:"Feature",id:"6206",properties:{name:"武威市",cp:[103.0188,38.1061],childNum:4},geometry:{type:"Polygon",coordinates:["@@±¯¥@klwU»ƒƒÞÝmwKm¯™™ç@™kVÇUL¯lVUKġ„ġm@a@U„@X£°l°LŎÇ@aōVÝw™ÔƒKUŽÅš„WJ¯lm@ÛVWa™@klĉUmaƒLUanaƒ™ƒk¯J„™™±KkXóÜÅxƒ²Ç‚@„„nUÒĊb°@™ÆkL™Ž™XÇÆ@xÝn—xWxţ„¯¤ƒI@Æn„ƒVV„VlU²Æè„V@x²x™L›ÒĉbŦ°Wb™Xklބš@l¤šXĊ`„wl@ĢÈŎm@bšnV‚Ubƒ„@șÆÛLƒèǚUÒŦlĸ™`°ĮʟÆǓbĉôϚĊƚĢnŤé΀ÑĸĀĊ¦„@@l°lœ¦Ȯ¦ɆÞĊKŤ™ĵĸů„»mŁyġ™ķŭ@Çɱȭ¯mƧUĊķnŁŻ»UaU™˜ƛɞÝƨů"],encodeOffsets:[[106336,38543]]}},{type:"Feature",id:"6212",properties:{name:"陇南市",cp:[105.304,33.5632],childNum:9},geometry:{type:"Polygon",coordinates:["@@šÈÞ@l`UmVƒ¼œŽ‚@nnÆwVlnVVa„LVƒÈ_‚ÿރ@n„a„xÆ@„lš_š@VxnK@llLnxmÈŎJnbUxšI°Žl@n¦‚lÈIlmX¥„k°@šk‚J„k²é˜@klaUaVaU@@ÝnIWnmnx‚k„ºÞ„„aV™°„V@nw‚KšxôbÞ£šVšU„bšþšLn»mƒVw„IšJ°Ž@„nb@°°I„ġUkÇKVƒ™™@ů»lƒ„Lnmƒ£@anK@Ñ܍n@»mL@£™yk„UUmbUÞÝ@kyÇbó»™XUxƒWVzb±mÝbXaƒwUamL¯»@wUKVwm¯ĵJ°ÅUWVk„KVk°wÈVšVуlUšƒ¥škmVamknƒUw¯¯ƒbċ¥ÅKƒk™Kk„™VċVk£kKVw‚Ñ„a@kóyÛ¯ÇVk™ów›š—Xō¥Ç¼ów™Ž¯U±‚k„ƒ@x›IĉÒÅVmÈnšÜ@n°„bUbÝV‚ŽUnnJ¯Į@‚m¦nV܃@„„L°JXb‚Ñ@šaÈb@šllôLVb—b@lmnVxk°ċ¦U°™Ž@xX@xWbš°UVÇn¯Ò¯Jɛƈmxl@¼"],encodeOffsets:[[106527,34943]]}},{type:"Feature",id:"6210",properties:{name:"庆阳市",cp:[107.5342,36.2],childNum:8},geometry:{type:"Polygon",coordinates:["@@kw‚ĉ—»VamƒƒV¯wƒIóVkl¯™Km™Vō¯ÝWkL@bÝKō¦@Ž™„@š™Lx›@b@l™a@km@@l¯nm@UaÅ@ƒ„óWUXm¥™nƒw`@UUxķôÇ°ğ¦@„VJš_n‚‚IVŽnalxkX„JWn¯šnVƒLšxl¤nnVbklVX@xnxmV@bUK@nm@@xƒV—°±aÅnƒŽkUWnUaƒx@m™n@ƒ¯LƒššmUĀlU@lV@blLUblxklkIÇx¯°‚UXbšaVŽUnšV@°‚LUlnbšX@`°nVmbnÆmV‚kLmK™¦UŽ@X„y@kl@U„°K@¼XbW„ƒš@b„WnLVa„VšƒVz@xlVČ¥lbUxލlV„U@nÆWôn²™VJlU„Ƨ„LnmÜLXa˜n@mœw@wlUlV²mšblwšVȃlLލ„±@lVnUlxnkma@mškšJ@kXV‚U@mn@š¼VXUƒVƒlLnmVbôaVnWV»ÈUl°È¯ÆIn›ÆU@kk»mKkÆġk¯@»mƒk—¯@óÇlÇ@—Vykkl™Uml¯Þ™@w"],encodeOffsets:[[111229,36383]]}},{type:"Feature",id:"6204",properties:{name:"白银市",cp:[104.8645,36.5076],childNum:6},geometry:{type:"Polygon",coordinates:["@@VKUȚl@šè°šnŽ‚LnxÝބ„V¼kx@l‚¦²°ĊóĠ„™Ċ»š@ÈxšaĊxlwÈVŤa@¯²aÇ£ƒJk£lƒnUÞ@°šô™@y„wl»lIX¥Ǫnw@ÑÞWla„ÅlL@ƒUwĉakƒl@ƒš¯mwna°J„V¯nUVÓÞÑm£²óWaUƒÇ@óÝUçV»ÈkkW@¯‚xV@XlK@wX@Vmm_@wÈݙKU¯ÇwVwÅK¯VƒkƒJ™™™XkWVaƒImŽ¯Uk„ÇlVšœĀV°mxóšk„@¼ó„WxĉÜU@Ub‚zÛJÇk@‚ÆnVlԙ@kŽ„x™ô@ĬWL¯ƒƒK@aÛImm™@ƒIUaƒ@™™UŽÇêU¤VÒÇx¯ÒV„šš™lk@Wbĉ¦UbkWV_‚y¯Lƒaó„kŽ@b@nmbkx„°"],encodeOffsets:[[106077,37885]]}},{type:"Feature",id:"6211",properties:{name:"定西市",cp:[104.5569,35.0848],childNum:7},geometry:{type:"Polygon",coordinates:["@@„a‚V²wVJV_@„LlanÅllŦçÜӚ_šlnƒWaôk„xUš„bmV@È°lèšnk°l¦„`@nnL‚@ÈlÜIyVaV@ĊÛXwôƒ@»lƒô™nwU¯›ÿU™Èklƒ°Vn„JUblXšWšš„I„l°U„ƒVƒš—@aVVVmnL@„lƒ„UUw‚mkƒš£„bV¥VUVwۂƒlaÇÝރmk£ƒLUy¯L@WlkKW_XaWƒ—mƒ„ġU@a™k™‚ƒakXkmVwmŹVƒU™b™WƒónmwnWW£„KÈnV¥ƒ¥„ƒÆ_k™lW„bU¯„V°aôbnaVwmaōInÇmwkK@kmLUw™@™`ƒkÅ@ƒwƒb@m݄ĀÇ`U„ƒKUbmUUkÅxmm@›„»nUVk_Ý@™Ç™¦™VÇè¯b™aƒn™@@„„JV„°Žn„U¦™°ÆbXxWl„êƒxš„ĊaœbW`™zV°œ„@lmbÅx@bmV™bƒI™`™¦@ÒUVUI@ƃL@bš¼@ššŽ@„šlmxnL„°ULƒŽƒÞğޛ°kLUŽƒL™°™xVŽ„n„KVƒl@šzX@"],encodeOffsets:[[106122,36794]]}},{type:"Feature",id:"6205",properties:{name:"天水市",cp:[105.6445,34.6289],childNum:6},geometry:{type:"Polygon",coordinates:["@@UyȍVƒVUnn@ƒVU„`UblzšJnk‚@Vb„KU„°l„wš„„W°„nkVŽ‚UÈlš£°V@n¥šV„kl™kU˜±U„ƒn™ƒlw¯UkwmKUlmkUmnkym@ō@U„mWÈU°l°anlJškUKlU„¯Èm@kmWV»kkÝLUWUx±b™@¯ma@ƒ¯™IƒJUxn„m¼™K™ýƒa™V™Uݤóa™wLmxU@¯ƒUšƒb݃ƒ¹lmwmnXŽmJ@ÞV@UbVbkblŽ—@±êƒlI™l¯@ƒlW¦knÇJkm¥k@¯™Jmbóa¯bƒUV°ƒakXlšÅ`ƒ„„¦U¦ÇmƒLX¤mXnxm‚„ôšXša„VźUnŽUxlnlW„bššl@bĢV„ƒ˜nX„WbX`lLXk@Ž°KVz„Kl¤„nÞ݂Èkb„‚܁"],encodeOffsets:[[108180,35984]]}},{type:"Feature",id:"6201",properties:{name:"兰州市",cp:[103.5901,36.3043],childNum:5},geometry:{type:"MultiPolygon",coordinates:[["@@lW²LššƒŽ°I„l„šmbVb„KnbĊVlkš@XbÜU@Žkn°‚XIƒÆ™V„LšÓÞxŎUlôƒ„b°KzU`lXVaĊ¥Xal@šk™™Uƒ°ÑÈwUтV£ÈéVšš„@Vb„Jš@nnÜJ@b„L°„XK@īšóƒwlš@kÓmUÅmK@mƒ_k¥l¯™mkçǯ@nUƒaV™ƒwólXbm„™k™`ÛÔťèkkmÆkbƒK@U`UI±xUƒbWlX„mbVbÅÒólkƒƒIWJkšƒ@ƒz—KŻ¼™@™xUx󎃄¯LWb@ŽÅ҄„±¦U`nbťĀUšVb„LšŽ„U"],["@@ƒ¯lwna@mōȯK¯kW¤ƒ@@V@bĢnĢƒVLU‚°k"]],encodeOffsets:[[[105188,37649]],[[106077,37885]]]}},{type:"Feature",id:"6208",properties:{name:"平凉市",cp:[107.0728,35.321],childNum:7},geometry:{type:"Polygon",coordinates:["@@ÆLUxÈxV°šLÇÞ@xn`Ü@X@nĊŽÆwnJmwUx‚aUkšw@V@w„aVmlLXÝl@X‚VĢmV°@nl@UUUWK@w„ÿVI²Òlmš@nÝĊýVV@nšJ°„„šUłm@kV¼nK›ĢȤôK„blnKllVk²aĠ¥È¯ĸóVw@V‚_„xšmn¦VWôX„ƒÆ@Vbn@°m@kn@@lšb@k‚aœ@‚wšK@™šƒ@UlKVaƒWX™W²¹lӄw@_°›n@@_lKōķW™@ŽmLUWƒn™»Û@›l_Ç`ƒÛmm°ÅbWb@š—VWbƒUUKDŽÅaġlmkUġlƒ»—Lƒl™Um¦@Ž¯U™¤ÇkVUml¯ƒƒX™ƒƒx¯kVƒƒLUa@ml™IkyVaƒ_UV@„mmUVU„ÇŽVzUxUVU¦ƒa™¤l„nVxƒVk„@ƒmKUnUU@b™˜U„ƒ„","@@@Žż@™mlkƒġk"],encodeOffsets:[[107877,36338],[108439,36265]]}},{type:"Feature",id:"6229",properties:{name:"临夏回族自治州",cp:[103.2715,35.5737],childNum:8},geometry:{type:"Polygon",coordinates:["@@š@ż»˜L„y„@l™XI„Jl„ôkÆÑUanaWƒXkW@™yk@U„ƒLƒmUšwš¯„KVlKœ¯Ġ݄݄VKƒ¯mKnw™k@ƒ™@™™»@a„K@ÅVJVU@њ¥š_Uy¯š@£UKmn@‚ƒšó¼ğ¦WmĵXݎkŽVLmVĉU¯bm„ÝV—wWlXÞW¦™xkmmL™šÝŽœ„±U@Vގ™š@„ÅÈW°X„ܼƨyUĮnŽWŽnXÝxUx°lVXJlôV"],encodeOffsets:[[105548,37075]]}},{type:"Feature",id:"6203",properties:{name:"金昌市",cp:[102.074,38.5126],childNum:2},geometry:{type:"Polygon",coordinates:["@@šĢȼ™„Çł°bœU°šV‚ƒń‚ÆǖŰnšÆ„ōĬǔaʠůĭš_kķÆ¥VÑș„çÜKšÅ@DŽƒVaU™m@aōnġÇk@ƒxĉ_™Wk£™@݃±KÈ±aÅnƒ@ƒÝxƒ@kw›lkwōL¯wm`"],encodeOffsets:[[103849,38970]]}},{type:"Feature",id:"6202",properties:{name:"嘉峪关市",cp:[98.1738,39.8035],childNum:1},geometry:{type:"Polygon",coordinates:["@@llĊx„¦šl™¦š„kVVnšJVbǖV„kôV˜a„bnaWw„UXmmamUXkWKō¯Xm°™™»ĉÇ@UVƒK™ķkǼğb"],encodeOffsets:[[100182,40664]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/guang_dong_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"4418",properties:{name:"清远市",cp:[112.9175,24.3292],childNum:8},geometry:{type:"Polygon",coordinates:["@@lǯkÿƒaV¯™VaÈU„¥ÆDŽIlxšmnb‚Uœxl™„Uôl°kš„„Wl„š@ô™VwUanUl@„xVkšaX¥‚kU»„aš¯±@kka@ƒUwmUkwƒJk™˜„±k@ƒ™™L@ÝWUwV݃—xÇU¯ŽÇX@m™Åƒ@@yĉ£VmUwȗ»ÇšUn„lUnWU¯`Ukƒ@@„™x„Ž@bÇxX¼ƒVVš¯LšĀk‚ÝLƒ„¯@VŽƒĀ¯lnĊW¦kVÇôkUDŽUK@ţ™U@a™™ó܃UU»ƒ@™¦k@Vx„KVb„n‚š@„Æ™„l„@xšƒbWšnlU„lxÈlV„È°Æ„@¼™„@x„šWxœŎ‚V„šK°„š¥ššnƒÆkŎ@ÈÑm™„K@¥šk@™ô@„nôV"],encodeOffsets:[[115707,25527]]}},{type:"Feature",id:"4402",properties:{name:"韶关市",cp:[113.7964,24.7028],childNum:8},geometry:{type:"Polygon",coordinates:["@@W™Xk±Ñ@ƒUw™mUwĉwlmn@Æwn£mkIš¥ÇÅ@¥šaƒón£nWWwš£V`Þ@šnVml@xô¼„IV¥ƒkUmkamUkVWwÛ»móƒ£UVÅKmn@x™@kbmm¯a™Xka›VĉaUb݃ƒ²—‚lš„IlxnVVx@„lb@l²™°ƒbV¼lW¦™bUlƒwk@mVVbUxóš™@kƒƒX™ƒ¯lókƒVkš›wVma™nkwƒJÅȃ¦ÇVUbšŽU°„blĀ°ŽkÈ@x™¦Æܙ°@„°„¦óa™VUôlUlbXl@nÜV„„nKlŽnIVÞ°Wš„°U@bnm@¥šIVƒ²Ulƒ°VnalzXyl_Vyƒ¦lƒœLlxš„@ŽÞbšKm„knVWanwƒÑVwČº˜@n_ÞV„aVŽÜIœl@„˜KȚ„VJ@aš£È@˜™@km™„aV¯W@_ƒa¯KmbkÇkLmwƒ@Å¥"],encodeOffsets:[[117147,25549]]}},{type:"Feature",id:"4408",properties:{name:"湛江市",cp:[110.3577,20.9894],childNum:6},geometry:{type:"Polygon",coordinates:["@@@ƒkXƒ™@a„UUċlk„Jƒk„™@wVJXUWk°W@nKnwlUlš²ƒ„blU@‚lI„l@„XbW„šxnm@lW@w„wU‚JX¯VU°`ŎóˋkÝÝkÅ@ÇmğÈřmw™aĵV›xUہ»°™ĠǷnýmóX¥ɅĵҏÇ@°²ĊUĖ±ĮU¤Ç°™Ā¯ɐnżUĊĊĬV@脎@ԃÒU¼l¤nƒĠb„êVĠ°Èy„zVaV‚nUÆL„ašbVl„wÆ@"],encodeOffsets:[[113040,22416]]}},{type:"Feature",id:"4414",properties:{name:"梅州市",cp:[116.1255,24.1534],childNum:8},geometry:{type:"Polygon",coordinates:["@@„‚nԚlW¼x‚¦@lœVl™lLkè„a@zš¤ƒĖ„¼UxlnUKUbÝlU¼lb@„Vx„V„klJÈwV¯š@ĠlÛĖšnƒbkšÆźÞƒUÈôklmšL„¥‚LœW˜„„™nKUkVa°V„x@IVV@x°bUk„a™a@mV@„@y„w‚L„ÑUwVUšV„‚„U‚bÞVVann‚@XwÇÿš¯²aVamkXaÆ»@»nw@¥›UXaƒkbWa¯KUw@¥m@kwmLU»UU™J@kmU@UUWUƒ@ƒyƒanwmçÛl¯ƒŽ¯UƒmKUmƒwVkmÝXbW@XWÝbƒk¯@±‚w@»U@W¯Å@ƒÇ¥UƒU@ƒƒ™IU™ƒakJƒĀ„ꃰšþƒXkamŽ@Žƒ_J°m‚@X"],encodeOffsets:[[118125,24419]]}},{type:"Feature",id:"4416",properties:{name:"河源市",cp:[114.917,23.9722],childNum:6},geometry:{type:"Polygon",coordinates:["@@°VlmX¹laĢÒlm„@„„šVš£‚‚@¦Ģklynn¼lW°z„W„„°VbÈV@lÆbnn‚JškX„šVÆašÅ„W@™ƒUUw@ƒkaV»ÞkVaVLkmVwƒ»„ĕ™£@yƒblçkKkš›U@k¥‚wX»™kmӃ@Wn¯‚I„`@nlb„W™ý„¯ƒé„ÿlI@™XUmWUwƒ@@UJU„Ç„mKUV@x™„ţk¯¯LWƒƒnUxK@ű»Vwa¯š@¤WX@ŽÛ¦@¤ÇIȼWxXŽƒ@Wx—w›ŽUnVbÅèmVa±²UWl@Žk„lȄ¤nôܼXxlUnVlbVn„lU¦ƒJó»@wnkmU™‚Ý@U_™¤XxmXm¤„ô™b@¦Èƙ¦lJn"],encodeOffsets:[[117057,25167]]}},{type:"Feature",id:"4412",properties:{name:"肇庆市",cp:[112.1265,23.5822],childNum:7},geometry:{type:"Polygon",coordinates:["@@l@š¥„@V¼„Vôۚš@bšV@ŤVLȃlVÈólUX¥mĉ°k„ÿU°@„ƒÞKl™ÿ°KU™„UW»Èw@aƒšw@ƒ„@nm@w›£kÓVUVn„Kš™k¥™£Vamƒ@nkKkbÆǫma—kmLU¥™UmƒÛwmVU™mUƒJ—ÇaUxÇIn`mb@Þ¯b@„nJ@nl„U‚V„lVU„L›W¯—Û`Ç_¯`mš¯I™bĉWċzx±J™xš¯ÆUƒƒ_k@™šƒJ@Umb„šXôlLš˜n¦@¼ĊxlUXŽ˜xUbL‚Ġ„UnVĊwlšUš„b@lW„X„‚m²˜@ÞWxXš‚Unb"],encodeOffsets:[[114627,24818]]}},{type:"Feature",id:"4413",properties:{name:"惠州市",cp:[114.6204,23.1647],childNum:4},geometry:{type:"Polygon",coordinates:["@@lbšW°bnnlaš@@wnmÆLVUkÇlƒ@Xk‚V²±‚bnUÆçUaVmœ˜xXw„@WXwÇ»ÈJ@£Ü¥@XW@£°™‚bUx²¼@ƂLVw„mX„°K°Ťlšƒ@wVUnLȃVƒVIky±wkƒKU¯ƒÅkƒ™XġÑۃlwUwlm@m„nKWašÅm›¯óÇmğb¯alĉUwķbmb@lÞÒVn—šmĀŹ@VŽƒbVŽUnmakLm`@xĉkklVÔVJVn—lV„UnmJmaLUbl‚™zmŽkL™a™‚ō@@zš‚V¦UŽV²kJ„nÜU@˜VXUŽL@„lJƒL@bݤUnVŽ—b@xVnlK²„Vx°V„xlI„lkVl²k¤@n"],encodeOffsets:[[116776,24492]]}},{type:"Feature",id:"4409",properties:{name:"茂名市",cp:[111.0059,22.0221],childNum:5},geometry:{type:"Polygon",coordinates:["@@‚LnÇlk„KnkÆL„ƒUm™ÈxlUœJló°n@ššanŽš„„a@ƒ˜@X_@mÝóóU@a™aU¯mL¯ƒƒkV¯™ÇVwkw@V±Ŏ£@™™@šalw±Vk@m„Åm¯™ÿŃƧIÇ`ōô¯_UVW°IV‚ƒx@xkX@Žmn™wXƒWa@ƒƒkkJ@kVƒa±„k™kVmxmL@‚¯XXlWVUI@xƒš„lƒIklVȃV@b„šlW@„@nUxVblVxkôlx™n„‚y„šnIƻư„aXwlK„bVnƒŽXb‚L„¤„k‚L—èƒVV¼ƒŽ²IlĠVX„ynz°KVx°@VlœLlblKœš"],encodeOffsets:[[113761,23237]]}},{type:"Feature",id:"4407",properties:{name:"江门市",cp:[112.6318,22.1484],childNum:5},geometry:{type:"Polygon",coordinates:["@@lUXx°JWnnƚXVš„W„X@„šºVLV¯nU‚Vnb™ô„x‚aXmW™XIšŽUb°xlK„l¯œK˜xXÞ°ŽšXÈ¥Ü@„ĉޏU™‚çš»nóƒVma—x‚¯UÅU¥Ý¯@ƒƒç@ș@çĉÅUmU籃ĉKÝxÝ_ÅJƒk¯»ó¯nmèkǀšŽWxœ¼mnUÜġ°@¦@ƒxƒLkŽÇaVnUxV„™šVlnIlbnÆÆKX¦"],encodeOffsets:[[114852,22928]]}},{type:"Feature",id:"4417",properties:{name:"阳江市",cp:[111.8298,22.0715],childNum:4},geometry:{type:"Polygon",coordinates:["@@°„nKV°šb@bôVÞô@n„VlÒôÆUnlnn@lmkmVkƒaÈkÆƄ™k¥‚ÅÞ»ÆKXkW¥ÅLmÅkamJUkš™UƒVwUmÈbl„K„w‚@@¥Ģ¯VÛnm›»Xw™lƿ™@kbW™—aʵ@óL›l¯ƽ@™ƒƒLn°ƒÆ@nUl‚²kx™b@‚š@šō¤U²@ŽlxUxšÈU°lŽ„"],encodeOffsets:[[114053,22782]]}},{type:"Feature",id:"4453",properties:{name:"云浮市",cp:[111.7859,22.8516],childNum:5},geometry:{type:"Polygon",coordinates:["@@@V„Iš™l@„`V„°Å™šw²I‚wČyĊXša°Jn™°_È`Ü_°˜œX‚KVƒkUUƒVkƒ@mmI@ƒ°a@Ýnam_ÈJVwlĉX@„šlUšómaUmVU°UK™¹@ƒƒWƒXU™™WmÅXm¯IWwkVWlÅLݼÆl¦ƒšÅÅÇl„bUllnknm@kmVmóÅkуUW`—@@„ƒb™ƒm™b@™¯mkô›IkVÇwnš„VƒÅKmlƒLklmȁKƒšVĊK°²„`n˜¤n„U„bWl„xVx™LUx@°nXm`VklVxmnnx"],encodeOffsets:[[114053,23873]]}},{type:"Feature",id:"4401",properties:{name:"广州市",cp:[113.5107,23.2196],childNum:13},geometry:{type:"Polygon",coordinates:["@@Ș¼VxUnĊ¤@z„@šÆ@nÈW°ÈV˜w„ŽUÞVxÞX@ŽšK„šl@ބVaĊbœU@ml£k±lUƒkkJƒw¯UUw±ƒkLUm@w˜aUVmÞ£@a„KkI@ƒ‚KVUW@—ÛVƒmlIU±VU¥™@yğzƧǃƒšƽĠřšÅnī±m@ƒ²¯lƒ°@nÝÆóUll@XnÝVU¦mVV°—„V¼™Jƒn„b@°mbn„ƒ‚@²¯‚¯wVwƒ@@nmxX¤¯L@ŽVLU„m@@l"],encodeOffsets:[[115673,24019]]}},{type:"Feature",id:"4415",properties:{name:"汕尾市",cp:[115.5762,23.0438],childNum:4},geometry:{type:"Polygon",coordinates:["@@@‚„@VxnXWV@š„bVššJ„„V@ÞÅU¥Ċxš£UWU‚wÅUU¥WVUkĊÇnkV`°LV™„wƒƒnU@™„ƒlbĊ¯„Vnalšš@@çkUÝ¥ġaó¯ÅaÅLŻÆUýmy¯ó@ĉÆó„ȯw™ÆXbmLƒ‚@nknVxkx܄ĢҚW„Æl„V°„Ll‚²xlz"],encodeOffsets:[[118193,23806]]}},{type:"Feature",id:"4452",properties:{name:"揭阳市",cp:[116.1255,23.313],childNum:5},geometry:{type:"Polygon",coordinates:["@@V„Ȧ„Æ@X°V@@¼‚x²°@„lÞaWXX@‚aÞWlnUŽ„xVnnL„‚°V„@k‚mĢl@„ak™@mlk°aXƒ±„nwm±™²¯JV²@ƒwW˜—_mƒa„V»ƒU@m¯ĉUф™šJl™„ašbVn„lĸLlƅÛDZwÝ@ĉxó@è™@k™mbƒUĉ°kaƒ„@šmV„„ƒxUš¯KU_mlĉÈVlXUV¦ÆVxVŽVX™¤ĉwV¦ÝÆ"],encodeOffsets:[[118384,24036]]}},{type:"Feature",id:"4404",properties:{name:"珠海市",cp:[113.7305,22.1155],childNum:1},geometry:{type:"Polygon",coordinates:["@@„è@„Þ°V¦VƁ°˜wnb„UÆ»nçƏ@nxܤ²llU°VnÈJސ°UôéšķUklƒô£VVˌKÞV°£n¥ƒ£ȗ™Ýy¯¯mÅkw¯bÇĔğ@Ýn¯ĊƒVğōŁŻƒķJ@Ț","@@X¯kmèVbnJ‚™"],encodeOffsets:[[115774,22602],[116325,22697]]}},{type:"Feature",id:"4406",properties:{name:"佛山市",cp:[112.8955,23.1097],childNum:1},geometry:{type:"Polygon",coordinates:["@@Èb˜Ž„InVVšnUÜxn„šVV¦nK˜lnbÅǬlalL@mn„Ubš¤l¦™šƒLUmUVlԜ¤@xmnVl°_XVVmƒkVmș@kn@VƒUK@°KW£nw@m„@Ux°x°@±„mƒna@¯ƒa„mšIU»˜ƒU¯nUV¥ÞUWmk@Vk¯™Ukn›ÑWݐƒĊÛ@Ǧ™W¯Wݗw›Lk°ƒkL¯wVa™WJXšWnbƒwkVƒ™W@kĊ"],encodeOffsets:[[115088,23316]]}},{type:"Feature",id:"4451",properties:{name:"潮州市",cp:[116.7847,23.8293],childNum:3},geometry:{type:"Polygon",coordinates:["@@°ŽÜknèmx„b„z„@V‚VX@VnV@lšIVVV¼nKlxn@@¦Vx°LXbla„ŽWbœV°£¯™W@nW@™‚aUñVœwWš»@¥ŤÅUÝǓÝóV@ńǎkUVmƒIUwÅVWÇX¹›—@W„¯bkl@nlšƒb@‚kġŽn@l"],encodeOffsets:[[119161,24306]]}},{type:"Feature",id:"4405",properties:{name:"汕头市",cp:[117.1692,23.3405],childNum:2},geometry:{type:"Polygon",coordinates:["@@‚@U±°Iš±n²mx²ƒ˜@œWºXÈÆUVx„JUnlVȍ@ŃôUǔÞVçn»VyĢÛVm@»kaÝUǼóšÛÈķKċ¥X„¥Wwğk™ƒ¯@ƒwķKƒkUm™aƒbkš™IƒšVÒ°Ċ@n„VU¼ƒ‚„bn˜`X—„x"],encodeOffsets:[[119251,24059]]}},{type:"Feature",id:"4403",properties:{name:"深圳市",cp:[114.5435,22.5439],childNum:1},geometry:{type:"Polygon",coordinates:["@@ÞLš„@xšbV„šVšK°™X°Kô¥Vw@anU„胐š‚lkĊl@wn_lKnbVmU„aUź@nÿ˜™UmÝѯUƒbk„@ÆkxŻ@™aÇX—wƒJƒƒ¯LķÝUĕ™ó™ĸóêWº@b²nmĬ™Æ"],encodeOffsets:[[116404,23265]]}},{type:"Feature",id:"4419",properties:{name:"东莞市",cp:[113.8953,22.901],childNum:1},geometry:{type:"Polygon",coordinates:["@@Ŏ@ššblKnšykVa‚KnbnIVmUƒ˜kUmUIUә„ƒçmV@bUxó¦¯LW‚¯š™L™UUƒ™a@w™ƒÝKğŚ™ƾ„„ƨÈĠy"],encodeOffsets:[[116573,23670]]}},{type:"Feature",id:"4420",properties:{name:"中山市",cp:[113.4229,22.478],childNum:1},geometry:{type:"Polygon",coordinates:["@@‚XœÒlmšV°ôÞÅ@m„¯°k„±‚@@aX¹¯VݏÇIUmV¯kk‚±Û£mw@‚Őmèżmô™¼èVš"],encodeOffsets:[[115887,23209]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/guang_xi_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"4510",properties:{name:"百色市",cp:[106.6003,23.9227],childNum:12},geometry:{type:"Polygon",coordinates:["@@lklWXL@VšI‚l@XnJn@VUUalk@mK@kny@UlU@a°™„ƒUU@VmaU@Ua@UWw@ƒn@KmLm@alkšmnI‚m@an@VIUamWÅImwU@@a@K„X@JVL„UVmUaVkUa@m„@@Ulmkk°ƒUaVUlKXbVwVIkaVmUk@KVk@a„aW¯m@w„¥laœX@KmaškVmnUl@nxVKšInU@yVaVIV@na°KlxX@@_lmXšUV`VIV™V@„n@lšbn@@WUkValK@²yl@„„VUV@@K°L@KU@@UVaXIVVV@naVkVa@K@UUK@UUa™LWa—w@m@K@UVVƒ@mVUUVKnL„mVL„K‚bVK@UUIk›mI@mUIVK@IUK@VkLƒ@WU@mU@WmUk@ƒI@VƒJk@WwX_@amK@UUWkIƒ„ƒK@LVb@mVmakL@J@bU@Ux@xƒbmI@`ƒIwm@UbmKUaUWa¯UkJWV@XƒJUU¯LUmV@ma@kkamKwƒLUUmWVkkm@aVUUkVKnVVUmXK@UW@km@Ukkm@@W@U™kUy@I@aUUmbƒ¤U@kUmL@bmJU@Ua@wkLWWkL@Uƒ@VaU@ƒLUakKWbkUWVkKkLVLUV@JVbƒz@Vƒ„@ƒVmUU@kVmK¯@VƒU_™VWakVmIUKUaU@@bml@XU@@V@LmKUV„mVUKƒƒKƒbkaUXƒKUL@x@V@l@„mxU¦„V@ŽlL@V@Ln@@VV@„nlKUaV@nLUbmJnL@VWLkbmV„@@L„W‚„XLlx„VVIVV@x@V²blUVm„LVUœK@kWWXUlV@Xl`„LX„l@@VšŽƒn@VnbVš@lVUVUÈVbš@@`UXU`l@@XUVm@kš@xmVknUJVXUbmKULmbx@VlJ@LVbkKUbVLÇUUVƒUVmU@VaUkUKƒVUwmLkUUVVlƒbka™XmwƒKUšVVU@@V±Uk@VWUUm»XamU™bƒKk™`ƒ„™U@UnWW_kKmbUVUVmnUV@„nJVUlšUbU@UV@n@JmI@VmbnVUXlx¯ŽkKmnVV@L@V™bkV™Umm™@Ub¯LmlUƒL@VWLkmkLmmn£WmnKU_mW™š™bnbmxƒ@U¦UJU„@Xmlk¦@‚mnUUm@@Jn@lV„ÔVJnIVW„I@a„ƒÆK@I@aVK„IlŽÞnnl@nl`nbÆX²l@xV„@llbVn²ŽVVl@nn„V@IlW@Un@@kVa°KšnÈmVaVXUlaVƒÈU„VlwôUlynIVašan@lVXb‚Iš@n¥la@Kš_n‚@bÆx@XnJV„nKVz@`VXVšU`@bƒ¦UV@VšIlx„UnV‚K„XÈbšVllšbVbnVn@"],encodeOffsets:[[109126,25684]]}},{type:"Feature",id:"4512",properties:{name:"河池市",cp:[107.8638,24.5819],childNum:11},geometry:{type:"Polygon",coordinates:["@@lLVl„bVV@nXVlI@JVX„mšn„W°b„IVV@‚ln„@nalVUb„nW‚@kVkÒlbVKn²°bUŽlV²@˜X@`nb„aUI@ƒ°wlU@aXJVI@aVK@wUamIXm‚@XUV@@bV@Vm„ImnUUwVaVKXU‚nVK@akƒVwV@nL@UV`n@@X‚lnIUJl@X¦˜V@aUIVm@anƒV@UwnL@VlbVL@KVVXUWƒ„wUUVUka@UVJnUlbnalbVVn@°„„LV`Þ@šXVxV@@bVlUVVbXnWlXnmlš@XXWVXJmbUI@V„llUVkn@@VWV@Vnb„@VXUJVnn`lLVk„a„»lVšLnw@WV@lInw@WnU@U@m‚knUVó„K‚wUmUXUƒU@@wVJVIl@XKVVVbVI„J@Un@lŽVLnm„b@U@Ul@nUš°VUVJnnVJV@„@mVU@ƒ@wkUVwkKWk™yUUkU@alkÈ@lJ@x„Ilƒ@UUWVkUw@Kn@@kmaƒVUl™UUL™ÇƒUUKl@UUmL@aXU@mlUUwmKkUUVKVUƒaƒKUnK@U@Vl@XUWU„KlwX@šb@K‚@XkV@UwWJka@aUwmV@U™@@U@wUm@»kLWVkIWŽXnmV@VkbmKƒLUbk™Va@aƒa@@aVU@aVak£@ƒ±UkVU¯V™UUƒJVƒUIƒ@kxmUmWUbL›w@K@aU@@aVU@Kma@aka@_VWkk@UWVUKULWKULUš@KUnƒwVaUKƒxU@UmaƒL—m@kVmVa@UkƒmI@ƒ@KmIkxU@@K™U@mmakI@VƒLkmWkkJ™_U‚@V@L@n˜xXbšKVb@VVL@V@LUbUlmbU@UUWJUb@VV@@L¯K@LU@UVƒƒk@±z@‚kLUbVl@Xm@™akm@ƒU@UšUJU_™VWŽkn@`W@kw¯LmbU@UJUb@zmV™JULmwk@mVUn™lnb@L›Wkbƒ¦@x°nXŽƒb@bUl@LVlUnlbUJUxWakLUVVb¯„llkn@Vƒ@@nVbUlVbUnƒVUK@IƒW@L@bV@nxÆJnXVbUJm@@bnmJ™nkl@b‚nnK@L„m‚@Xx@VVbV@nb@UVVƒ„¯š@bkV@Vmz@lnLl@kŽVbUVm@mI@Wk™J@UWKkXkl"],encodeOffsets:[[109126,25684]]}},{type:"Feature",id:"4503",properties:{name:"桂林市",cp:[110.5554,25.318],childNum:13},geometry:{type:"Polygon",coordinates:["@@nU@J‚X@`XLm¦Vb`lšVXXWš@VblČnVšŽlanLnmVLšK@_Vaƒ¥@kUa„@VmVb„aV@XVVzlVVK@knKVmX£VKšLlbnš@b@llL@xĊôXaV@°È@¤„bn„V@@Wl_„V„U@W„nVamw„wVbn@„K‚VšLX@VmVUxlV@šnVV_nK@m‚I@Wn@@IšUĊ@@wVWX@@I°VVm@wmU@m@IUƒV™kƒlkUmmkÅV@@aV@@Wn_UKla@kšaV„šlVanb@k„@@KlVn@@aV@nIWW™UUaVU@™kKmwU@UImKk@UU@w@W@‚™k@™UkWƒ@mk_W@Ua@a™ƒƒ@—¯ƒmV£@mƒUUam@—kWakƒVama@UUm@nw@alaUmnUlVlIœV‚™šLVyk£Vm@k@UUJkƒK@kmKUw™KkWK@UXImyVwnI@m‚ƒkUlkUKkUVmƒw@kkJWUÈm@_k@@aƒaW@U„UJUwU@@IWKkƒmUUV@nVl@bVb@bU‚UXƒakw@ƒWUkbkKƒbm@™xUlkLm@@wmKUX@‚™UaVW™XVmU@@UUUƒxkmWXkKkUWaUaUb™L@`UL@LV`UXmK@VmakLVbkL‚xUJUIVbUVVb¯KƒV@Xnl@lVXbmÒnV@L@VWKkVUIWJkIƒŽUamUUbm@U„kU@JUbW@X„WxUam@kbVVUnUJmUUV@bƒU@UUV™@ƒVk@ƒbƒmULV¦U@V„U`VLUL@xVbn@UJ@nWJXXVŽVV@bkxVbUx‚Lšš@x„¦@šU‚lXUVVlULV@@šnŽU„ƒb@xl„nJVnlVknUlVUbmŽU@ƒbVš„x"],encodeOffsets:[[112399,26500]]}},{type:"Feature",id:"4501",properties:{name:"南宁市",cp:[108.479,23.1152],childNum:7},geometry:{type:"Polygon",coordinates:["@@lKnbnU‚@Ua@K„L„ƒlJVX@VnL@bW`Xxl@„I@U„Jl@nV@X‚V@nXV„@lK@UVL@JULVJ@nnJlœVJ@VULaƒLUKƒnmKULVVUŽ@nU„š`lIXlln„K@UlJnb@nšV@LV@lwnJ@L@„nJl„@VUbUn@l˜n„KnbVŽV@„wVLUb„xVm@LV™VKXLVKVLXU@VllUX@`lb@bnb‚L@ŽUV@bV@@b@Lœx‚KVanXVƒUUmVUUUaVUky‚UUa„ImK@mUUVUkKU_@W@UVVVIUW„UVaVU@UUKnƒ@k@al@ll@bnL@b„VUV˜X@Vœ@@b‚Knblmn@V_@aUalL@a@akK@kVKUKlwUUnV¥VmU_VWVIVaX@Va„alńK@LVJnalL@LnK„wlVUw‚mX@VXšƒlLUVnblaUmVUVwXU@Wm¯Va@ÞKnw@w™mšk„»‚UVW²a@_mW@U@I„y„LVUUKW@@™„LX@VUV@@yVU@UV@nwUUmJka@IU@ƒmƒVkaW@UwUX@`ƒ@kLWUk@mƒkUUm@k‚UUWkUƒkWxk@@VƒK@nV@UVaƒUUJmIkVƒ@UamLUbkVmamLka™@ƒ‚kmL¯WI@wJmwƒx@akU@aUKmbkaW_nW@_U@Wm@a@wkwUKmƒk@ƒbkb›w@mKUkkU@J@bW@kVWz@bVUa›VUx@„ULkJWbXVVXƒ`@œmJUVU@@Lk@WbU@UJlnXlm„Vx@Ln@‚b@K„LX„WJUUW@kƒaUVUbmV@nnV@n@lVLƒVmLX‚mXkV±@kxÅL›šUbJWIÅJ@I‚mXalkUamKkškL±aVwKƒUU@mÞnbWJX„m„@lbmKULWUUVkaƒbnn@Vl@VVV@VƒbVbnLWLXJWxXLV@@VV"],encodeOffsets:[[109958,23806]]}},{type:"Feature",id:"4502",properties:{name:"柳州市",cp:[109.3799,24.9774],childNum:7},geometry:{type:"Polygon",coordinates:["@@ƒwU™„aV@nVaUVklmkUUmmIkƒ@w„aVƒm@™U@VKUkVUkWV@™ƒ¥@w™™KVwUalw@aUUUWWXI@mVIm@Ua@wVKUKV_UƒV@U¥VK„n„al@„Uš@VU@V„V@aVUnVVIVmUUlan@VbXwWƒX@Va@IlVVƒn@VanVVb„lJXIVJlUXL@U@KmUnÑWakU@mkƒJUI@mk™@wUmmUV@JXaWIXWmaUIƒJƒkk@W„nJ@„ƒaUak@›kkJ@kUKU_ƒ@myUóWUkm¥kUmL@KUKm@k_UmVa@ƒk@@UmU@mm_—JWIUVUŽWLUlbVUJÇVUIVwƒKUVk@mU@n@lUL@Km@@l@L™VƒzJmUU¤m@UbV²U`U@@¼Vn@x@Vš@@VnUVx@blbXIVxU@Wl@@L™aW@kxƒLXVWVk@@U@VmLVŽ„L„bUVULVV‚lnLVxkV@nWV@bnKVVk@VL„VšÈVKšVVk„Unb@lm@@LVxUlVX@Vk„ƒJ@wkIÇ@kl@blVVVšzXllLUxlV@x@„UV@nƒ‚U@UImmUIUV™¯mVk@@V@VƒamnUKkm@@VƒIUJUaUUWLk@UJUI@xV@V„VWVnxƒLUômVV„@VkVVVUnV@UVkL@VVV@bVxla@bkXVJVn„`nU@bƒb@bVL@VnJ@„l@šV„aU@@_lW@UUU@Unƒlll@XLl@@UX@°bVWVanLlknVV@VVX@VVƒnUŽVLmbXJ@nllXX@`VXƒlmaXVWk@Wkƒw—J@„VL@J‚bnU@bn@@bVKUnVJVIVVVL²a@bV@@Vl@nUVakalmš„UL@VUL@V‚a@mXl@nK@UlK„L@Vl@@nkllb@š„Vnn@‚šnV„™V°l„šVInwlKXxlU°Žn@@ƒ‚I@UnVlakUJWkUK@anUWK@_ÞJ@U"],encodeOffsets:[[112399,26500]]}},{type:"Feature",id:"4514",properties:{name:"崇左市",cp:[107.3364,22.4725],childNum:7},geometry:{type:"Polygon",coordinates:["@@@JVzšl@V@Xn@ll@VlnX@@VWLnŽUVmUULVlUV@blnUlnXVV„K‚xnLlb@lnbU@Vn°KVV„I@WXUlI°VXb‚VVbnLVan@‚x„J@_nJ„a@wVwV@@a@IU@UU@WKXwWIXKmKUa„a@U‚UUUk@@Umm„albVUXVVKnL‚a@knƒWƒXImanÝV@„V‚LUx²blKl™nLVbklWbn@JÆIXJ‚IVaœ™ÆKlw²@lUnWWnK„UUK@k@mmU@mnUVaVU„b@lVXVXIWƒƒK@Lam@@KUwnƒWkkmVIV@Xal@@KV@VUnI@›„_UWWUkam@kkm@ka@mƒk@wkJWIUU@WXkW™XkWWLUUƒ@UakLƒW™XV±VIVWUU@anUWaUK@IU@Vak@@UUKWaƒ@m@ak@@wUkla@mUaUklakwVƒ¯¯@WWUkLkKmaƒ™kLUnV`UxWX@Jkn@bmlƒakkk@ƒb@l¯bm„ƒbJ›b@VXn„bVV@„ƒbƒJUkkKWVU@mœÛVUUW@UVUJWXkVkKmUL@WW@U„Vl@XXKW„XJ@XVlmbUxnnm@UlVnV@XVm¦VJb@šmLkKÇbXblVkn@l@bWnX`V@@IVV@ŽV„V°n@@_naÆVVbUVVbUJnzlVUl‚XkV@Vlx@X„VnxƒbƒKUK@b¯VVUV™L"],encodeOffsets:[[109227,23440]]}},{type:"Feature",id:"4513",properties:{name:"来宾市",cp:[109.7095,23.8403],childNum:6},geometry:{type:"Polygon",coordinates:["@@nVlw„@VJU„„IVVUšV°lU²V@„l¤Ub@bUV@b‚@„b@bUblšVa„KnLla@UnUWmXlJXUlKV@V_U±Van@V£nV‚I„yšU@K@kn@@LVK@k@mnVl@VU„LUxVJÈUVIU‚aVkXKVVUXJ˜In`@nnV@Vl@@„UbVnl`n@VL@LnKlVn¦VlôXV‚nz„@V`VL@llIœll@Vb„b@ƒmIXƒl@„l„IVJnbWXXJWb@IU‚nVVn@xlš@nVJ„I@W„U°LUaVUUaVJVIwlKUalKnb@UnLVWU_@KVK@_šKVa„@VKU¯VLVKn@la„aUkU@maVU„J@k™@Um@XmbkyVaUIUU@KV@laVn@KXKWUkUk@ƒaW™UUVw@aXKmƒVaUUkšmIƒlUU@wUa™xUmmU™¯™U@WƒLUmVIUym@UVmUa@wmw@çm@aWLU„™JUIUamKmL@™aƒx¯¥ƒkU¥U@±„k„UVmKU_mJUbkKm„ƒLÅǙ_@WWUXUmaVUkK™„UWW@nVxkUƒxmL@KkKmbUI@KƒLkƃbUbW@UbUJUXV`UnU¦mŽVVkxVLUL@llL@b@bkKVb@bU`m@knmaL@a›@@U—WVUƒU@amK@akkk@@b@lm„VL@VUVUbƒVVXUJUU@V@XV`lLUVVV@nnLƒJVbVlzUVVbVVnUVVU„"],encodeOffsets:[[111083,24599]]}},{type:"Feature",id:"4509",properties:{name:"玉林市",cp:[110.2148,22.3792],childNum:6},geometry:{type:"Polygon",coordinates:["@@VJUXVVXlWX@V™xVnX@@`ššULWŽUXÅbWK@mULUUmJ@n¯b@l@VULVx„x‚XU`VXXJVI„V@nm`@nUŽVXn@lWVn@b@Jn@nU@Lm`@Xn@WJƒ¦U@@VnL„lV@@Xl`nIlJnkVL„w@KVK@UšaVL@bVKX™lUUKVK@I„VšL„a@U@WšLUlVL@bU@@blb@VlbUxVbXUVJ@xVL„U„lV@VU„bVLnKl„XJ@L‚b@an@VanL@`VLšKV_UWl@U_„a@WVInlVUUUVm@I@W@wVakIWm@U@ƒXwlaVbnI@ƒm»Va@aXaVLšU„»@aVa@k™KkL@KmU@WƒzUK@wU@VWUUVUUKUa@mKmbUK@_nWVaUkVaUaVUVLXKVƒVUVmVI@UkKkLm`UkW@UwWW_„UaU@WakXmK@xUXƒJkƒUUWUk@Wl—mJ@km@@aUKzmyVk„a@kkWVUU¯lmU@@w‚kkmV@Vk@mÅIƒ‚Ukƒaƒ@Ub@m@UUU`mUbWaWmb™X™XKWIXUWm@љ@y@UkIUJUUWLUWƒL@UkVUxW@kaWbKWnXxW¦n„m`XLVlUbVbUx™I@JmLUKUb@VW@@bkL@b@VlU@xkš@L@lƒxXxWXX°V@VVVbUVV@UVVbULVnVJUb²b‚aUb@VVVVInlV@VnXaVUšlI„VUb"],encodeOffsets:[[112478,22872]]}},{type:"Feature",id:"4504",properties:{name:"梧州市",cp:[110.9949,23.5052],childNum:6},geometry:{type:"Polygon",coordinates:["@@VbXblVlLXWln„wVV@VV@UnšWUXVbš‚@VWXa@kVK„UaVaVkšUlyX@Vaƒ—VmUwUaVU@UÈymI@aU°@š™nWV@VaVaw@IV@VmnLVK@kmmna@™„™VbVI@aV@XbW`U„„LUVVx„@VbUV@bl@VLXblJn¦lL„°°@n™@K@UlLnK„a°LWbnJ„¦UÒV„UllLlVnKnbWnn„V`„w‚@@Xa±™n™l@XKV_„WVkVa@kVyUa@wU£UW@UIVW‚@@a—wWaX_WKkVmUULmak@UJUI@±m»™—k@m»VyUIm™nmmwnkUmVaVIUn_mW@»Vk„@VwkmmUXa@IƒaVm—mƒ@Wm_U@mIUWóLmUk@laXmmkUK@UmKULUUmWULƒ@VakU™@Ub@bƒ¼™VUKWb@bUbn¼@„mJUakbWx@„@VXnlJUb@x@X@JUnVVUVmkUJ@XƒbV`k@VXU`™LUK@_mKUbm@@b@„U`@nlV@b„UnbVbn@@`VbUbVV¯bm@@mJXb@bVnUllVXUlbUl@LU¦VVmŽkLVb@b™l@V@XlK@V@nUJUz„°mŽwmLmlXbWVU@UUUlƒIU@VVmV@@¦‚bXbWxX„WlXVWL@LUmkbU@@LVVVJUblzna@WVnš@@lƒIUVnbV@Vlƒbkbm@ULUKV°ULƒ@"],encodeOffsets:[[112973,24863]]}},{type:"Feature",id:"4511",properties:{name:"贺州市",cp:[111.3135,24.4006],childNum:4},geometry:{type:"Polygon",coordinates:["@@nL@xn@lKVkšwn@„alLlaXV@„lx„bVWV@aUa@aUk@mVUnVl„XL@JV@VxVIVƒX@„b@bl@@`ÇnXVlI@l„xUnlVVLkllV„@nmJUxnzWJ@VXLlŽšLVxnL@l„LlŽVI@V@lUnl¤Uz™Kš@„Vl@š„L‚l„Lnš‚b@VnVVU@k„a‚Knxn@VkVJ@ńUlakmWIUaVanm@_UK@UVWUa@klXam™U@Vmƒ™VIXW„@lUVknVlKVLXŽVXšW@b@VlšnnVL@KXL‚Kn@lb@UnW°@Va„X„WVb°aVa@I¯aUkUaVKVwƒaXk@a„a‚™@wkm@alanUVw@alK@Umkw@UƒaUmU@WXUaUK@UW@UaVWI@¥Xa@w@WWšVƒXwƒU@mKUXUWVU@a¯kl@akU@UULmK¯VUVW@U_m`U@@xVbUz@lUbUlƒXU`WLk@mš²šWb@Ž@ƒxU_mƒXmmamLkUkKVkUƒVу¥mIXa¯KƒbmLkK@V@Lmš¯@ƒ¯kKm¥kIWaUKk@@aVUUaƒ@UwVUƒKVƒX_WaU@@bUJUaƒš@šmbnn@lULmKUnU@@J‚xUbUbU@mX™š¯@VŽ@bnJÇz@VUVVbVxUn„˜UbW@kz™VUlUbVbƒŽUL@lWb"],encodeOffsets:[[113220,24947]]}},{type:"Feature",id:"4507",properties:{name:"钦州市",cp:[109.0283,22.0935],childNum:3},geometry:{type:"Polygon",coordinates:["@@@IlVVlnL‚@œxla„al@n„VLlx@x@bXnV@@`mXX`lbnaVL@blV@b„wnx‚I@xXJ°nK‚l„š@lbnKnblUVanKVb„@lUnJVI„VUb@V‚U@m„L@Ul@Xw„llVVXV@lVnlVn„l@XVlK„@@_VWVxX@lb„U„nV@@JlbnIlmnVV@UwVK@U@k°a@mnIVVVK@nXLÆaVWXVK™™@_W@Umšw@UXWWkUUVWUIVaƒUkJ™UVWbUmU@mkUJUU@UVab±aVaUIUmVKUaVUU@VUUaUUU@W¯XWWw„w@k@Kl™@wkV@U@alK@aX@@UmIUWUIƒ@mmkXU`U_WJUnUJmUk@@amLU@UVW@UkU@@VƒbUWVUk@@wmKkUWLUWX@JmIƒlUkkKWKkLWU@UKWa@bU@@a@_UKWƒUUUmJmw@nV_@ġğKóLmbU¼VÆ@xUXƒ@Um@wklVnUn›lkaUV@„lV²WVklWXXbWlkVkIm`UUƒLƒUU@UWƒx@XU@@lWLU@kbUbV`UXllUV@bmb@LnKVbULm‚šnVVIV`X@"],encodeOffsets:[[110881,22742]]}},{type:"Feature",id:"4508",properties:{name:"贵港市",cp:[109.9402,23.3459],childNum:3},geometry:{type:"Polygon",coordinates:["@@n@VzUJ‚nVŽ„K@XšVš°nVVnšwVb@xVV„knJl™VVUbn„WL@bUxVVXš„bl@lVXkWƒXwWaa@¥‚@nUUUV@„JVkVVV@XUWanknK‚xnƒ¯VyVI@m@UkL@W@Ušk@aUalKnUUV¥@KVkkaWVkUVkUm@aWanI@n@°aUUVaUa@_m@UamaƒV@akU@mV_@ƒa@KWIkƒmLUKƒaUVU@ƒkƒVUK@wUIWVUaVwka@Uka@aV@@aUKVk™K@X@Vƒb™KƒU@JULVLkVWšUL@aUK™b@VUL@LƒxUKmlkImJk_@WU@ƒkmK@UV@„¥XIm@@Wn_@KmVm@@I@aUmkXm@UWV@mn_@mƒUUJWIUWV_WƒwU@mUknVVmxU@@VUV@zU@UVW@ƒK@šX@VLUVƒKƒz@J@VnX@`±bUXVƒ¼™lšn@xmxÝL@‚Ubn°@XWVUxUVVnkbWVXV@Xš`ÆȄKnƒlLVanIV`nLVUlƒ²ƒV@V¦„l°¦„w‚b@šnKnLVbVJšIVƒXK@b‚n@ènx@xVbUnV‚"],encodeOffsets:[[112568,24255]]}},{type:"Feature",id:"4506",properties:{name:"防城港市",cp:[108.0505,21.9287],childNum:3},geometry:{type:"Polygon",coordinates:["@@XV@X°°U„lxkbVlVb@nkbVl@xl@@b@n„‚XbVL@Vl@UbV@@JVLXbmV@bVVUXUJU²šW„XlKVb„@VVXKlXšWlXXWV@VXJlI@x„l@nlbn@lln@lbXalIVK@ƒVwœUVb‚U@aXylUX@@aW@U_UJmU™nVKUamL@Kna@aVUkkVWU_ValaV@XK@kV@@W„wVXV@„V„KVVn_lJlUXkWaXWlkXU‚±kU@ƒVUlbœkVmUmlk™¯Ý™™W@mb@¦VxULm™kJUU@ma¯wƒmkX@VóJ±bUVUXÝWk™lWXXlƒxUaƒbƒIğ™Ç@U@mVUKkkm@UJm@XnWV@x"],encodeOffsets:[[110070,22174]]}},{type:"Feature",id:"4505",properties:{name:"北海市",cp:[109.314,21.6211],childNum:2},geometry:{type:"Polygon",coordinates:["@@VaVLnK@IšJVwUaVaUkWKn_mƒX¥WwXm‚LXalbU£UyV„Å@ݙwm@™°l›LÅUƒmk™mwÛaƑLÝUUm@ȣƃV_„Ó@£UƒƒUVƒ„™¼U°W̄™ÞVbXbôx@b@bmV@ǃ™UÝ@@ĢU`m@ŽnxnIVV‚VX„VL@`@bV@@aXbVL‚@XVlKXLlLVl„knJ@I‚WVXXKlVnL@xl@UVVX„a@UV@VlX@VUV@nK@bl@nVVIVmXIV`V_lWnn„@VJVXnJ"],encodeOffsets:[[112242,22444]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/gui_zhou_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"5203",properties:{name:"遵义市",cp:[106.908,28.1744],childNum:14},geometry:{type:"MultiPolygon",coordinates:[["@@@UnUlJn„w‚JU°VL@bnVšU„wlJ@XƒŽXVlU@klVUJknl„UllL@bUJ@xULUlƒ„UblVkblbnw‚UXmla@„wV@VK@L@UXaVKVLXWƒUVa@U@Im@@W@£UKUakKWIXU@al@@llUnL@W@Un@@VlUV@VIUanKl@Xb@lmxVb@b°bb@nlJVVnnJ@b@L‚V@ln„@LmV@Vx@blnVK„nlJXIlw„J@҄b@nlK@Un@UL@VVVVUUUVK„l„@VUVL„J@UVUUw„@Wm@™„UV„ÈVlbUb@JšLlŽX@@x„„ƒLmŽk@@nlx@bUJUzVJ„@@LVxUV@bWxnLnVVK@_‚K²xVbV@n¥@aVI@b„@l@Va„Knb@n‚`n„mmý„W@ƒU_šwV@VlVV@Vn@n„˜@nI@Jn@°¦VaUU@™„mVVWVaUńU@aVKnƒVbVUmmU@a@kUw™m@aUUmUUJ¯lakU‚aXaWUUaVƒkk„amkmUnVlULƒVlJ@XU@UJWUUw„k@aU@WbkWƒL@U@WU@@XUKmV@aUVwUĕUJUamUUVUÑm™nIVJ@kl@XalJVn@KVLœ¥@UWIXWmU@mVUKnUWLUKUaWUUKVU@U@anUny@UlUkK@w@a@aVUƒ»UkVw@Wmk—JƒÅmUUVmwXalLXWWUnam@XkƒJ@UVU@U@W„@@U@I@Wl@Ènlw@KXLWb„lVUkalKUU„VVaV@@wnIlaUmkUƒKWU@KkUkLWaƒKUUWUn@VƒK@LnnWJUIƒVkUWVnV@V™@@XƒK@VUIUJ@IWJkX@VVJ™IƒVkK@I@UVaUWk@m„@wnUWKk@mxk@@„lV@b„xmb@x@VUmLkUƒJ@nVV@b@VkLVbU`¯I›l@™U_UW@UU@™™ƒK¯wm@™xƒL¯¥kIƒ™ƒ‚@bkbƒ@Ua@ƒm@kkW@XVbmV@ŽkV@bWbUbV@„¦ƒxXlmVk@ƒ¦™bkaWL@KUImK@wUK@VUI™b@bmK@LÅy@akXW@kbWlXblL@ŽULUbƒ`@U™kUymX¯@mšUJUUJƒL@Lm@@WX@lU„VlšXll„@l@Èk°V°Ž„X@VU@UVll@XUJVXUVm@@VXLWlnV@Xƒšk@mVULnxV@@bm‚kL@VWLUbU@UVm@ƒb@ķ¥UnmJ@UUVƒkkJUšlÔU`UIW@ƒ°kLUlUI@WVI™U@mWKkXk@ƒ‚WU@bXšW„@J@xX@l@LVl@xšLVxXX@x‚KnxVknb‚KVV@U„L„WlXU`@nUlšX@llVXšVU„KlkUKlI@anKVLXKVaUIVWV_VK@VnLlU„»VKVL„m"],["@@@KlKkUUVVX"]],encodeOffsets:[[[108799,29239]],[[110532,27822]]]}},{type:"Feature",id:"5226",properties:{name:"黔东南苗族侗族自治州",cp:[108.4241,26.4166],childNum:17},geometry:{type:"MultiPolygon",coordinates:[["@@VV@XkV@bUbWJU¼Vb@Vnb@bš„@J@bƒL@LV@UVƒlUI@a™KULVb@bkJmx„šlLVxknVJk„‚xnKmnnL@bn`WIXlWLU@UxVbUVmKV„XI@JVIVJ@U„L@Wš@@UmUXUlV„UVJXImm@K„L@UVmVXV‚„LXblKlV@LXV„LlVVnkbmJ@xnXl@šbXa‚@Vana„ÒšL„m‚VnIl‚Þ¦°k@b„@@lV„nJlUnš‚VX_„@lVlK„šV„UUxVLVWVIXJšUlnnWlI@KUaUUVKn@VaVXV@na@ƒmw¯@mUkJUamI@lk@@am@@I„ƒUmVImUUw˜™@anUVaUU@LU@WaWUXWW„wV@VwnU@L@ynbl@@X@a„J@nW@@Vn@„lVLlxnI„lš@@UWKUƒnIlJXIVllIVVš¼XK@aVI„V‚@@bn@VKXLVKVVVInw„J@UWI@mX@WKnI@KmU„UVJUL@V„KW@@k„@aU@@W@InJWUXwWI@Wƒ@¯wkaVaUIl@nŽValIXWWI@UUm@anwWkXWWIUbk@UJmIUamKVUUUVVama¯VkIVVUlKnXVwX@@WVaUUVa@IlƒaVmƒkna›wk™UU@ƒU@mUVƒšUVwœl°LVbnJVU™¯la@mX@@UWKXU@aV_V@@JlkUƒ¯@V™nK@km¯k„U@ƒWUW@mmƒU@™kmlU@wkL@WƒUkL@VmLƒJ@b@V@bknUUVK@UVKUK@Uk@Wa@LUVVnUbmVk@@UU@@aƒV¯K@U@UU@WmUL@aU@WV—w@ƒ˜I„xXll@UX‚K@KXXVJna@wWaƒ£naUKV„m@UU@mUmalm@@XkVm@U@VƒLmWU@kkWxU@@bVV@VkXVlƒVƒ@UUk@@ƒmI@KUw„m@UmVƒUUwU@lwkV@IUa@mUaVIVKVa@w@U@™UJkb@n@bmJ@XmlVUxWXkJmUkUUVW™xUlU@ƒaULUšmbU@@‚WXkmƒL@xUV@nUxÇm@„XLWbnlƒnV‚nnUV˜U‚nVVz„@lbUVVlULVb@V@nUJkwm@Ux@bWbUK@UULka›JbƒU™U@U@lUK@XUJmn™J@bU@UwWa™x@zkJWnUJUUVšVV@bXn@xVb@J™L™m@X™w@`@bkb@VmXUV¯L@mW@@n@V@‚ƒL@K—IW@@aƒaUx¯@U„m@XbW@@L„V@bnVWVkKUzlV@bÆa@lnI@VV@@LnVVKUaV_VJVbnU@bn@‚‚nX@yVIVxXKVLlUVaXU°J","@@@KlKkUUVVX"],["@@UUVUkUmV@ln@VXVK@K"]],encodeOffsets:[[[110318,27214],[110532,27822]],[[112219,27394]]]}},{type:"Feature",id:"5224",properties:{name:"毕节地区",cp:[105.1611,27.0648],childNum:8},geometry:{type:"Polygon",coordinates:["@@UkVƒ@k‚W@Xn@@K„KVIVVIn™°@nWVzšl@V„_VaVK@kKWaXklaX@lW@bÆz@KnL@ašaVJ@UVL@xnLVJ@LXKlbša„¥l@nUWk„wƒ¥U@VaXa@amLkUƒKmƒ¯kƒmkIUaƒKUIWƒkKm@anw@mlwXIƒmƒUk¯@a@amUƒ`kkKWVkxmUUak_mJmw@w„mXUW¯X›_@WnI@aVwkWWýŃU@WLkU™aUbVV@lUVVnm@kUmV¯™kK™LƒwmVUUaWV™aaWw¯wƒÈ@VULUVUUƒK@nWJkI™l@Umxnbm@kbUJƒa¯bUbVxmLUV™aU@VUUWxkVVV@bUV@XWbnlUbƒbUJlbUV¯b@z„`WbXnmbƒaƒwUwVWUƒbUxmbU@Uam™@Vƒk™VaƒwVaUƒWI@mUKóz@lUlÅ@WIƒb@xXxml@XklULWKUmwUa¯KUXWJkaULmKkLWbkKUVƒImƒƒWa@kUaULƒW¯LƒK¯@kbƒL@b™x@J@bmnnlUšlzU`U@@Uƒb@„m‚n¦°bU„Vx@bkVm¼mx@mk™mVV@bkxVn„aVV@bU@mL@b²`lIVV@lXLlš„bVxn@@bl@XllIVšnbVšn°°wlbXw@mVa°lVnU@mš™VLVbn@@b„@@WVnUV@Xlxn`VznJVb@L@bV`V@šUnwšU„@WUXKV@UUlmUUlaXalLšm„bšIVbnJVIlVVaUUnWVXn‚VL‚k@ƒnWnblnlb²x„xVKVXlVXLVW„LlUVJna@wVL„¼@JVX@`@nnx@nWJU@Vx@XXKšŽUblxUš°„LVKVVlL@KnbVUnJ„IlUšƒnKl£VW„x„IlJ@nšVÞUVVnb‚VX@V_°lnK","@@@UmWUwkU@Um@@VkL@V@„„‚V„VkV@nbVa@ƒ"],encodeOffsets:[[108552,28412],[107213,27445]]}},{type:"Feature",id:"5227",properties:{name:"黔南布依族苗族自治州",cp:[107.2485,25.8398],childNum:12},geometry:{type:"Polygon",coordinates:["@@‚V@IöalK@UV@@KUaVIVVœLlaVbVWnX@‚@LnUlxl@naVLXVVaVU„J@lUUanWWI„@VlV@Xbƒb@V„n@VmVVbk@kU@V›V@X„J@zn`ULW@kK@_WVUK@LUb@Jlxn@nnWlU@@b„x@XVVU@UbVb‚@n`VI@VVLUlUIUV@KmL@VV@XIV@@lVLVmXV„@WLXLW@U`šnkb@Vl@UL@VVV„L„llX@`lIXb„J˜IXW„L‚aVL@ŽXXW‚Ģ™b@bmK@L@°@Vnxmxšn„K@xVn@VkL@V™Lƒakbl`VnnxVnUlššV@@VVXV`@šœk°JV_UalK@U@aUU@m„IlVnK‚V@U@wnaƒw@akU@ƒl@nwl@XLmV@xnƒl@VXUb@V@JlL„UšJUI@UlWUƒnLVUUaVwV@XKWkXJm_@amKnmmLwlƒUIlmUwkKƒ™nwlI@aUaVKšL@bVJ„kVUU@@K„K@a@I™ƒ@ama@UUaV»XIVa@alU@WUU¯IWVUbkVUKWLUwUJ@zmWm@@amVUaUIU`VbULmU@KU@@UmJ@kÅb@akUVylLXUmU@aƒU@KX@Wan@Vƒ°@Vw„b@bX@˜J@L„K@@U@mX@@n°KVUnW@Ula@a@_šx@WšnšK@IUa@wWm@aUUU™VVVIXmlI@yšwXbVxV@@ašInmVI@WVL@k@VšV„V‚aœIlbVK@VVLXa@aVwn@lxVI@m@UUaVKUkVUkaƒ@UymUV—VUmmU„mmkXaWK@ƒÈnVw@mVU@w„KlnXW@V@naV™VKUk@KVIUWƒ@mk@KXU@Um@@lVƒk@UVJna@UWaƒL@a@ƒXa@kmmVUUk@mkkƒamJ—ImJUUmIm±aUUkambkamVUU@VlbUbVVƒxX„WVUU@VUakU@UmUV‚U@mnUVVnUbVJ@b—UW¥kLVamVkUaWJU_UVWKk@@nl„UVVJUXm@Vm@UnVlmbnmJUbULU@@UUKWVIWxnJVb@xUL@bUJWIkxƒbkb@xVJƒbmU@kW±LkKUkVa@a¯am¥ULkalÑlKXUWƒXƒaVakImVƒ@ka@UUƒJ¯aƒX™mmb—KWU@wUUƒaUa™KmU@UXlWb—¼WLUKUb°„UlVbkbVL@VƒšƒJ@nVlUbUXmJ@VX@lbUbU@@bWb@VnLVJ@bVVUz„ŽVL@lnL@b™VVVULmKUk™Jkbm@ƒxVb@V—kƒKVnnV@b@ŽWXU‚„nV„l‚VVXVJUXlVXbWV@VU@Ubk@@KWbUUmL@JnXV°XJ@_‚`UbkXVVlÆkbƒ@VLXVV@‚V@k„KXX@`V@@n"],encodeOffsets:[[108912,26905]]}},{type:"Feature",id:"5222",properties:{name:"铜仁地区",cp:[108.6218,28.0096],childNum:10},geometry:{type:"Polygon",coordinates:["@@°a@aÈbVUlU@aVKnVV„VUlyX¹lWVa@U™VƒnUVU@m™@mUl@„mÞw„@‚xnIVbna@KVI‚J@kwV¥ƒUXÇVkVW@kkKWU@aXUWmnIVa°VXbmL@VVbnVVVUb™VbšJVbVKXkVKVanU@aWnWUWa@U™nk@mVIVK@wXxlLXbVJVlKœbl@VI@mšaXalVV„VbX@@ašalnkx@b@V‚b@Vnx@bVVUXn¤WXn@Vl@Vlzn@š`@I@KUU@ƒV£namVkXa@aVK‚nnU@anVlKƒa@UUU@amk@»kƒU¯@aš„VWnkWmkImU@akaVm@»VUV@UKnkW¯XWlkUKnIWaš@nmlIXmWUnwUwWm@wULmaUJkIUaƒaWa—klwkwmJmU@bkJ@XUJ¯W@XbWbUKUkWJUUVKnn@UmmXUWa@mU@@UI@WmXVykwm@kaULWwU@¯ƒlKUUVU@mU@UkmaUbmV@b—š‚xVnVUJVnƒ„@Jn@@bl@@knJVblInV°@nx@„mbU@UWUbm@ULVVVb@LkJmXkm™VWIUJUXUKVwƒV™UƒŽkLkUƒ@W`Um™kVmIUƒ@kƒ@@a¯lÝ¥kmJUƒn™KƒÑmbUb@Wb™ak@mWU@UbƒUVVkLlbUVƒkXaWK@LkxÇmk@@X@J@Vƒ@@X@VUV@V„IWln@mbXVWXkKWbnxVUnV„ƘInl@XUxVl„¼UV@b@b@xlLkV@VmzmV@b@VUVVLXVVbVLXKmVVLU‚@nnVWXXJ@V›¦UK@LUmkIWbk@@lUImJnšVÒVUnVVbVIVĖUxV‚@bnUVL@WV@@X@V„KlXXaV@@bƒlVxXVVIV@@WkI„UVKUkVmlnnŽƒbllU„VbXVWbblVkb°ŽVInVVV@bšnVx@l@bnVVnUŽUam„UL@bƒVVÆUbUXU‚ƒn@šVVUb"],encodeOffsets:[[110667,29785]]}},{type:"Feature",id:"5223",properties:{name:"黔西南布依族苗族自治州",cp:[105.5347,25.3949],childNum:8},geometry:{type:"Polygon",coordinates:["@@VL@Vl@@IXW@kVUVbnW@XlKVVnU„VlL@b„aVbƒb@xX‚°ÔUxV@kbm@VxkxWJœ„V¦ƒŽ@ÈnšVKšxWXJmV@n„Ò@xVbn@@blLk`VX@bššla²JVUlnn@U±lw@wnw@mlwVIX@@m@klKnk‚a„KnwmmXkƍVm„Uš¥l@nb°n@„aVwVmVIVnI@a„¯@mšU°ƒl@@VnI@JV@UV@b@IUbVJmXöºƒzllUbVa@aXUl@„U@llLnKVaUa@UmK@UšwV„bnKV@VwVK@UXƒV@Vbn@‚w@U„WnX‚@„a@m„I„™@UUKlaUaVk¯ƒVaVLXK˜»XaWk¯mƒkğwmW@mIƒVkwƒJUIšÇVwU™UkVKkƒm@UkmU@WÅwm£Vƒ„m¤¯IkJWa™_™lUbmJzÝJk„ƒUÇVU„ƒ‚@bU„Ýn™m¯LUb@`mL@VkL@VƒUmmk@UU±Umka@kUƒ@ķymUkk@mmkÝmUaUakImV@V@VÅLƒ¦ƒJUXmJXšWb@n°Æœx‚¼nV@LlbUŽUbmL¯@ÞbV¤nbVx@bUVlblIœ™@KVVUnVJUn@VlLUlmLUUUxmK@I@@VW@@bU@UJmUkLVVUl@b@V"],encodeOffsets:[[107157,25965]]}},{type:"Feature",id:"5202",properties:{name:"六盘水市",cp:[104.7546,26.0925],childNum:5},geometry:{type:"MultiPolygon",coordinates:[["@@ôyVL@nXJV„Ub„x‚bUŽlšU„@ŽšnŽVbV@naVw„a‚VUXVx„x„bnaWmXaƒ_@y°aVUkaVI„aVamkXa@WVU@aUUlUXwVV@UVšbVUnKUwVa°a„bVIlan@manw@VšklJXI@m„LVVVUVK@U„ǃk@KUa@UkaVU@UVWV_XWVXVWlLXKlLXaÆKšwVL@akKm@Uwƒ@@XUVk@VUI@wWK@aUV™I@UkK@ƒmL™Wƒ@kImJƒUÅVmkXUW@UJkx@nmx@xkxV²m@kmUV±Ikb™™@aUWl_kK@am@Ua@wƒÑ@mnUWIX™wULm™@DŽU¥›ƒXIlwUwn@laU@Vw¯ÓW@w„aUaƒb@akKƒUmVUUkL@WmXUaUV@lWX@Jk@@UUKULmLUJmzkKmVX°VšUnWKUL™ƒƒL@mU@UnVJ@b@„UV@Xƒ`m_@l@@bmbXJmnnš@°˜wnn@ŽVLX@V‚@nVl@nk@@b‚l@nn°WlXzW`XXVKnUlxVbUb@‚V„Xb@Ž‚VxÈbVlnbmn@ŽkVUL@„ƒŽmLUVVL"],["@@@ƒ@UmWUwkU@Um@@VkL@V@„„‚@„V@VkV@nbVa"]],encodeOffsets:[[[107089,27181]],[[107213,27479]]]}},{type:"Feature",id:"5204",properties:{name:"安顺市",cp:[105.9082,25.9882],childNum:6},geometry:{type:"Polygon",coordinates:["@@lL@bUK™xÅLWbkKWLkKUXUWWXU`UX@VUVlb@VVb@L„l°xXx‚bšbXUVb‚VnU„xšKlL°šnUlVn@UmVU@kUUVašblVXKV@ƄXþlXUxnU@mVK@_@ml@UU„@šblU@KnLVyUw„@@UmkšWVw@UVK@VXzVK@n„VVUUW@kVJnlaš@nKW™kaWL@U—™õb@JU@mU@@_WWƒL@lUU@WUUK„@lakÅUUlWVa_@`WIU¯mW@InKVVXa@Ll@VaV@@UXUWakUVWUIUW‚UkUƒƒmVXW@@amUUm„L˜l@UUa„wn@lašIVlnLVKUUšU@amK@kUKƒVyUU@aUImK@UXa@aV@VakaW@@UnIVWVaUkƒb@mWƒX@Vxm@UaU@W„@VULUxU@mLƒaUŽ™x@VnL@VVbUbmLkK@kƒVk@WV@bUbVakk„yõ¹nWUIVa@J@aVUU@@ImJ@Uk@¯„™V@nƒ°@bmJUUJUnUxƒbm@¯Žmak@™¦ƒVUnŎWlnnmxƒLbmlkL@l@nWVnlÆU„VnIlJ„@šXnK@„lL@VšJVU@bXL@xVJUl@VU@W„@Vxn@"],encodeOffsets:[[108237,26792]]}},{type:"Feature",id:"5201",properties:{name:"贵阳市",cp:[106.6992,26.7682],childNum:5},geometry:{type:"Polygon",coordinates:["@@nŽlLX„VJ„LVblJ„n°ln„„LlVnKlU@nUUa@WlX@l„n@‚Vb„@la@a„„šlJ°¦„Kšwn@°x„LVkUmmwUmk_la„bšK@UlK@UUm@wƒL™mnwmw@U@¯@KnL@aša‚ġXWW@UKbƒKWX—JƒIWakJ@_kWƒkƒKUU@UVKk@@Ula™mV_X@WKXKƒ@WUUnUK@kU@WJU@@UnK@LVUVJVkUK@UUJm_@UaVaV@UU@Wƒw@aV@Xkmmm@kw@IVa@KVLXU@`lLX@VKm_@yƒI@WœU@UlVl@UanU@Uƒm@U„aWaU@Ukƒ@XJmXVbkV@ŽƒIUVUbWUUKmbk@kwmV@K@mWUXUakb›KUUUJVb@LU@@VkL˜š@VXKlbXšmL™@kbm‚UI@lVXUVƒU@mULWy@UUL@VUx™Xnl@Vƒ@VxUzmK@LkV™aƒ@VVk@@n@`UL@nmV@bmJ@Xœ`WX°WVƒn@xnxnIl`VbnVlwXUlLl‚„_nV@b@bl°„V„nWJkx@nmx@b"],encodeOffsets:[[108945,27760]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/hai_nan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"469003",properties:{name:"儋州市",cp:[109.3291,19.5653],childNum:1},geometry:{type:"Polygon",coordinates:["@@஼jpnr’``ŽpRVHʘ̤žZt^JÖA˜[†CâlTébQhRPOhMBcRSQiROE[FYdGNOEIH]MgEAMLLIAG_WMCSL@ED]PCLYC[ZIHgjSxJTMbHNEFCMEE_HSDFHSLECRNSFDRICHNADGPI\\RZGIJTIAHLDQOHG`GTNCOIC@eIGDWHIS[kiE[FMbECZS@KKS[FDWsCeRuU_DUQNOE[LKGUBM¨EDQP@HWHGDImXƒCog_~‹I_fGDG|QDUWKBC\\ore|}[KLsISBHVXHCN`lNdQLOnFJSXcUEJMCKSHOUMDIm_‹DI`kNDIGEYFM\\YPEEIPMSGLIKOVAU_EBGQ@CIk`WGGDUM_XcIOLCJphHT_NCISG_R@V]\\OjSGAQSAKF]@q^mGFKSW^cQUC[]T}SGD@^_ˆaRUTO@OHATŸ”"],encodeOffsets:[[111506,20018]]}},{type:"Feature",id:"469005",properties:{name:"文昌市",cp:[110.8905,19.7823],childNum:1},geometry:{type:"Polygon",coordinates:["@@€hIJ¤Ī¯LQDaFßL[VQìw€G‚F~Z^Ab[€¹ZYöpFº lN®D´INQQk]U‘[GSU©S_­c‹}aoSiA£cŁ¡©EiQeU­qWoESKSSOmwŸćõWkàmJMAAMMCWHGoM]gA[FGZLZCTURFNBncVOXCdGB@TSbk\\gDOKMNKWQHIvXDJ\\VDTXPERHJMFNj@OwX@LOTGzL^GHN^@RPHPE^KTDhhtBjZL[Pg@MNGLEdHV[HbRb@JHEV_NKLBRTPZhERHJcH^HDRlZJOPGdDJPOpXTETaV[GOZXTARQTRLBLWDa^QAF`ENUPBP…\\Eji`yºEvåà"],encodeOffsets:[[113115,20665]]}},{type:"Feature",id:"469033",properties:{name:"乐东黎族自治县",cp:[109.0283,18.6301],childNum:1},geometry:{type:"Polygon",coordinates:["@@ªVLP`@PEdNRAHOPEAKHEVL`GZBJfvdTAXNNTZJFPrHHNpKTD\\ILHbEVd^J‚OHLh@NNBnHP`\\xH@NBRLJTlŽNv_^CTLd@bNDVFbxdFV€UPBTKOGEOUO@OEBXQP[H_EI\\EbeYa@UO_J‹MEJ_IEDKJUGMDcNUd_FMTEJSGoZ]EIYGO[YW‘gEQ]a@WHEDQKUSDUGAbYBUpSCYNiWqOSQEoF[UcQISWWNMSDe_cLQ_UBiKQOOASQAWgS­ā]ZaŽSPÝZ]XMXSŒ[^oVËNgNKlE RôEø"],encodeOffsets:[[111263,19164]]}},{type:"Feature",id:"4602",properties:{name:"三亚市",cp:[109.3716,18.3698],childNum:1},geometry:{type:"Polygon",coordinates:["@@®ĂhTBXTRPBRPjLVAR`dKf`TC‚NXMTXRJVdE\\FpTRrPjXZMTDVoZABaVHTCLVCRGF@X^bFR’hZXP\\ZHHMA[^wBWXJlW¤EJ[bCTOF‹WWMm@ILMGWQ@DQ^QNWFSHEbF`OXNbO„VNKTEPDTLTCCVTREfvfEHNbRAENH^RJXCFHNFRpVGHWISDOTMVCZeGamaLoLÛD¹¹ėgsia{OųE—Tt‰lɂwr}jŸR±E{L}j]HąKÃT[P"],encodeOffsets:[[111547,18737]]}},{type:"Feature",id:"469036",properties:{name:"琼中黎族苗族自治县",cp:[109.8413,19.0736],childNum:1},geometry:{type:"Polygon",coordinates:["@@bRFnHNbHŒgN@NPEnbXP@bND`NT\\@\\QZb@`@J]V@XhžDpW„nCJGHGXO@CR§FANHVKLF\\MPVR`CvVfQtDPKpGHG@S`WJP~^dSTHWX\\RHTFACQTIAUPOU@MG__IaYSFQK‘NSbORHXCZeTFJg„B`YBMNMFi~IVDV[tGJWXGDQRGF]ˆJrALgESLSAYDGIaFeXQLS\\MKSLSQYJY}eKO[EHiGSaK[Yw[bmdURgEK^_kcSGEOHKIAS]aFSU@Y]IWFUTYlkP_CUOUEkmYbSQK@EMWUuAU\\M@EpK^_ZMDQ^OXwC_ZODBrERURGVVZ\\DTXcFWNIAWJWAYUUFYEWLQQaCIZeDM`cLKRGpanJZQd"],encodeOffsets:[[112153,19488]]}},{type:"Feature",id:"469007",properties:{name:"东方市",cp:[108.8498,19.0414],childNum:1},geometry:{type:"Polygon",coordinates:["@@ºŸx‹JYZQ”IŠYXLl@dR\\WZEn]bA\\S~F`KXaDeTiNO^EEKWEDQXITBXaWaDQMUJOIaTWf@NJV@dSxGZ‰Fu_@WMKAUˆ}AQ@MwG_[GOAmMMg@GKP]IUcaFKG[JSCoLGMqGEOYIMSWMSBucIeYA_HUKGFBLOFGPQBcMOF_@KO©UAtERadwZQ\\@ÊJÒgòUĪRlR°KĮVŽLJ"],encodeOffsets:[[111208,19833]]}},{type:"Feature",id:"4601",properties:{name:"海口市",cp:[110.3893,19.8516],childNum:1},geometry:{type:"Polygon",coordinates:["@@ńZƂtĢ¬æßFuz¹j_Fi†[AOVOFME_RBb]XCAKQKRSBQWSPY\\HbUFSWSPoIOcCOHIPkYCQ]GdGGIFQYgSOAQLK`MFUIGa@aQ\\GGUFcHKNMh@\\OYKAigsCgLSF]GOQO]@GM]HyKSHKPW@Pxi@EMINYREXWRQ@MQcFGWIAwXGRH\\yDI`KJIdOCGRNPNtd\\UTMbQYi@]JeYOWaL[EcICMUJqWGDNZEXGJWFEXNbZRELFV]XQbAZFrYVUBCLNFCHmJaMIDDHXHEhQNXZ_TARFHVB@DTQIRR@YHAJVnAbKFUEMLd\\c^ÍÞ"],encodeOffsets:[[112711,20572]]}},{type:"Feature",id:"469006",properties:{name:"万宁市",cp:[110.3137,18.8388],childNum:1},geometry:{type:"Polygon",coordinates:["@@^J@ZTVbET^JBGLFPTHld]`FLQhcVanx\\\\ZbLHTGj\\FLP~fIZRZPVTQFSVAFJE^NDLEE[~LjsxVTG\\NZZNGlLRRGLJTV@hPZANN^@T\\NEPPbDZXO`d^HSvcJDIV\\XZAJUFCLNP@PQ¤@[ïKLÑIÏ]ÇE±I{uƒ­YśUćFcYUmsVeBSVgB[RO@aYYPO^]@UVaNeDShMLG\\EfFVE\\F`"],encodeOffsets:[[112657,19182]]}},{type:"Feature",id:"469027",properties:{name:"澄迈县",cp:[109.9937,19.7314],childNum:1},geometry:{type:"Polygon",coordinates:["@@T\\GJCXJH@fJDDPNCNJENN^NLHBNSx@DDYbBLLDRbjZTj@`XXTlG^Xr@PJLW\\WLTlWR@HDJTD@X_PO@STMDNTMVV@NLDM`M\\XM\\JNBH[PYZ‡úYzŸ`Ċ\\ÎÝd]c[NKVFLEBaUmBIZGQ@JQSR@CUAEGBQ`SWYRMFgWGCGJCbNnIDGMEDKVAZUEqBYRa^WEUFKYQMaFWXEHIFWMYHCrXVIIiaK@aMCUYNSIISTwXALKH@XWXIEIJQCG[IEQDE_XSBaa[AIPW@]RS[FWS[CD]PEBYNGFSaSyJG]@ugEUDQlGHiBKHUIoNSKqHFaPMICK]UUHIPDJMuCA[SCPIDIOILGAEmU[POPBVSJDREBGS[QXWSGcT}]IO_X@TGHoHOLCX\\ELT@LYTD‚aFENF\\lj"],encodeOffsets:[[112385,19987]]}},{type:"Feature",id:"469030",properties:{name:"白沙黎族自治县",cp:[109.3703,19.211],childNum:1},geometry:{type:"Polygon",coordinates:["@@D\\RV]dTXELnHr]^@LETBBRTHPi^[@U`QTHDJ`MGSogDIPKdJ`WVNHCXHl_DJR@AH`FBVPUJLHKNTJOFFZON[ZEHFCJlMJ_ŒCn`CJVNGPLTNDFIdVTWEIPmRKMc_kDMWGGUTAtJLK~\\f{pqD[LAVXRCH{HC`eŒJ`}@W^U@I@_Ya[R[@MSC_aMO@aWFmMOM@‹haGGMEmaQ[@MESHaIQJQ……MckBIw[AOSKKAMPSDSLOAV_@@`KJRbKRDfMdHZERgAWVsDMTUHqOUr@VQXTT@Tƒfg‚L^NH\\@heTCZaESNObHPƒHeZF\\X^ElM^F^"],encodeOffsets:[[111665,19890]]}},{type:"Feature",id:"469002",properties:{name:"琼海市",cp:[110.4208,19.224],childNum:1},geometry:{type:"Polygon",coordinates:["@@TP\\pATHTGlZDJGAQjE\\Rb@jVBDCN`JZ[NCNHNXbULPrP\\KNbMTLjJJRFP`“pNLZz^FLRHjVPZ@hxVKbHBHMNNJFRlLzGPnNHhIrHHADcPWdUAmEMVQDSKYHY\\EhBN^HpXGNDBNNBnIß‹Å_g{³So]ã@ORO@KMEDIVYB[WJUICudGTc]P_YWaCOOMFS[]@MMYBgOU@ISHKQQkKMHYY[MSHwUit}KF\\KFMCF]EIUBETSROUKTLT[NKTWREfJbCHBZKTFTKh"],encodeOffsets:[[112763,19595]]}},{type:"Feature",id:"469031",properties:{name:"昌江黎族自治县",cp:[109.0407,19.2137],childNum:1},geometry:{type:"Polygon",coordinates:["@@`ZĤd–`òüˆ˜ “BSPGP@VSbQ`‡@]HC~T^SE]N]FkW]E[fY„GGOPaTMbFDYfS@g[MGK]h„e@SSSRW@UVqrPVGNStCXUhBFQGYNcCeLQQaLI@_`@EUwcEaCUaMc@SK]Du`MSkKI‡~BVNL@X`‚EvYŠwHcTU@MIe@SXJbIPNVCRXbWbSAWJCRXFFL]FMPSjCfWb_L}E[TaBm^YF[XcQk@WK‰Z“JYRIZwŒ¹ "],encodeOffsets:[[111208,19833]]}},{type:"Feature",id:"469028",properties:{name:"临高县",cp:[109.6957,19.8063],childNum:1},geometry:{type:"Polygon",coordinates:["@@jD`hNd\\^dZädĒH´Op@ˆùZY\\OAGIMN[[W_NCNMKU@NUMSNCTSP@`O@WSCCI@GXQSkXKX[IK@OWqH]SkWW@_SiiYQaKCAKZaCCw@MTGAMKM]FMMIMDSM_HGHRPKCBGSJJIYH[QOJCHMBDGQJECMTDQKFGTCEGTF`NFEDMFaGSNwIiTGhYJD\\KZODC^@FTKND`XBHKJNKFBNhG^FJMPcHEZF\\QPRjQTAdgNOPgQaRSê"],encodeOffsets:[[112122,20431]]}},{type:"Feature",id:"469034",properties:{name:"陵水黎族自治县",cp:[109.9924,18.5415],childNum:1},geometry:{type:"Polygon",coordinates:["@@R]NC`YL]FoN@V[vBXVFNL@TRZalnVFVP`DlOZkVSXEE_F[EUFeH[NKTgfCbMVU^@P]ZObZP@\\QhATUfAtUasñiāEoI]eYǯ@aKmaeƒWuCºKÜKpnbHbYfUDSNCPJTRAHJTDJSfDNLHXC``VBNGTYCQDIXMDSP@xLNEFRNXBIpVNLXah@RgF@`qOML@LJNSPLbaHAh@Jdj"],encodeOffsets:[[112409,19261]]}},{type:"Feature",id:"469026",properties:{name:"屯昌县",cp:[110.0377,19.362],childNum:1},geometry:{type:"Polygon",coordinates:["@@\\OnVBFKHPJCJOJTDB\\vDINOCGJVVL^JDONEbrGTLpMVJLGjAHGRkVChF@vH^zIbTETMHAZOFC^\\DXT\\EffAP\\PdAV@UIYfS|S@YPICMeM@sC[_A]VQEwyHSMuNcAUlQJMVGMS@mVBZPFO\\CSFQK[LqDMACiUa@[QiFBRIHYCHkGSBS[oSOqB‡IE^QHCRWHIXsHU\\UC}JEjMNAN_ZƒAIhSEYfWDQGaPMTL’ERZTJb``NHV@"],encodeOffsets:[[112513,19852]]}},{type:"Feature",id:"469025",properties:{name:"定安县",cp:[110.3384,19.4698],childNum:1},geometry:{type:"Polygon",coordinates:["@@JjDNdJ\\FbKPXfZ^Ij@RZNaVSc[MsMOHQPDJcLIJ_zCG[HQxWJBHXdENRR@XQFWZQQGOFSWUCI[WCJuRGLXNMPLhCl[Ta@SqGgJMGOmyHkKEQMINMAGaGULgwY@UOGiKQ]EYyMK”oO_QEIIKiNSMa[LqOKOaVMWMGMDY\\_IKrL\\ERT[DEPYOUA@nNTUHINkRBVMdNvGTxzRF^U`BD\\@tfNDNOJ@Z{TeTJZ@VU€cB[OBOeeQT@^OXBJb\\AbWTF`RCJFH\\RDJIJFXW@WLGBKxWTSJJMTVZND@bbL"],encodeOffsets:[[112903,20139]]}},{type:"Feature",id:"469035",properties:{name:"保亭黎族苗族自治县",cp:[109.6284,18.6108],childNum:1},geometry:{type:"Polygon",coordinates:["@@FJp@fxpQ\\ApN\\GNPNBM`HLMrXLXj\\PEHnI@WUCEM\\GTc\\GZYHTPBHRCPTd€H\\K\\@HXi–BJILJJAVNTOZJNtFPC`YxDPWci@IBgbGKaTOIM@KNKrP@_hE@QbgKWUMJoWAQMFEKM@wTONCJWRCZDHSAM_UD_GWMKeCITSCGIQBGXUHQoMEEGWDQIG]FMQBMaFGueFeSQDUSDSKOCSFMLƒUaPWM_PaEGFETMX]RCRR@HXKN@JNnXXEŒSPaDI\\£FkXWIAX]xB\\GN"],encodeOffsets:[[112031,19071]]}},{type:"Feature",id:"469001",properties:{name:"五指山市",cp:[109.5282,18.8299],childNum:1},geometry:{type:"Polygon",coordinates:["@@TCNOLBTLBPx\\AJdl†NR†RIbJTGNF\\@RcIYbmHoLQdKN_fCJYbDRRXKZFVEZVXBXIJBXMdESW[CUYHUVQFQAqsEIMPYMSBUIIJKAIj•GW[@[LGScDOGQOAGSYZ[HSd[HFNVD@XmJFG[OWiWKNqGKN_MAMO[HoM[BoRewo@Y^HpITSFENc`MVCdHNIVCLJFI`NFIŒP`@VZbaf[FFJG`O\\WRFA@PVPFPPH"],encodeOffsets:[[111973,19401]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/hei_long_jiang_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"2311",properties:{name:"黑河市",cp:[127.1448,49.2957],childNum:6},geometry:{type:"Polygon",coordinates:["@@VÈÞ@Žkx˜nXŽ°VÈa°V@kôw„b‚š„JVškXlVUx„„@ŽlL@xkVV°ƒ„VbxlVUnVxk@ƒ„ƒKkŽVb„Il„@°kVl„@„™lÆnkll@@V„VXƒŽš@V„²bUlƒVlV„U„VÇn@nkJšŽlkVbœ@›x²V@n°VUnlKU„n`@n°bWLnVUblVUVVbknV`°kkŽl@@V°@nz„J@XšxlWXb°n@bƒĠlbXb™bVbƒJ@Všb„a@„„@lbUbšVmnœ@lšVmnIW‚œ@WbÞ@„n@x°@š„ĢaƐéϚnœ„‚lČ¯ĠŻÈwm@ôçU™mm£Xy°UV™›@wÈ£Ǫ¯kõÝçUњ™Uķ‚ƒĢkVфÆšÞU°nŎ¥ČUĊx°m°¦żVƐœx°ƒÇ£@y„UônރÆ@Èĉ°Kô¦šW„kWU—bÇ»@™ÈĕWÇÈ£ŤU@›n£ÆUUKVamanwŃmÝJ¯k@JƒIkaVaUUÇbkaÆÑkWmÝUۙ™Ý@™ƒwnU±ƒ@kkV¯KUkƒJƒ¼U¦ƒšÅ@ówķaķůV¥Uaó@Åwmƒƒ_kVƒwĉ‚ĉmmn_V»™a@U™ƒVwķóƒ‚U¦LǫéóXÇmōLǓÇķxÝkƒƒĉ™kmakbUĶ°@W¼„@bƒšÈÆ@Ė™L„l@„°J¯„mkl¯L݃±L—amJ@¼ƒ„™VƧUó„™UX˜ċb¯ńVbkÆÝI@llx„k°V²šV@Uxގ˜L@b„@b™`ƒšÇzkókݤ@ğ¯Wƒ™LĉǙLmmnċVkbUaƒL@Ž¯„‚bU°ğL݂Ý@"],encodeOffsets:[[127744,50102]]}},{type:"Feature",id:"2327",properties:{name:"大兴安岭地区",cp:[124.1016,52.2345],childNum:3},geometry:{type:"Polygon",coordinates:["@@k›ƒϙmƏêġb™ƒ¯@@wƒmÝ@XV@IlŽl@bUxl¯VlV™bV@ULVlUV™_kx™VVV™ÈÝJ@„¯šU„™lm¯x@xóÒĉ¼m„¯Wƒxţ@Uz¯ƒWwnUwťƒ@knƒWƒ£óVƒUUwğyó¦WI—Vmm™I@±kwÇ@@bƒ@ĉ¼ó@¯wó@¯aó¼›KՃaUwmWUwÅI@aƒKó@Ua™LƒaƒVÅwō¼UUÝl±I—¤VxÇx@zkJmnn‚mbnz™xlŽƒl¯ČkJl™°@„kb„Žmx@x™@kêmVnŽWxôXšxU°„bWLóJnÇWĵ„V¦™ŽƒUUb™b™ÆġK™šk¯™VU±aXmċÑUwĉKġ„k„™ŽVxk„ÇKkbƒIƒ‚ÛXWl¯bƒŽ™X¯K™bĊš„„ÞVƚnŽĸ²lxUŽ°n°òÈb‚¦—xVbƒŽƒ@¯„Vx@¯VķÞČlĊ°KĸŽȘI°¤ČIôŽò»ƨnȰKǬ¦ôWŎÈƨwlƒnKVXmbX`lbšwkVW‚XXŽ„L°a„ƾaĊ£nƒ°@°¥ŎzÞ¥‚»œalwôkƒJ„a@ĶK„£„bU°ĊxźVÈUĠ¥ƨ™VI@XU°x°Ln¥šw°UmwXm݁V¥ĢŽ°@nU@mÆ£š¯lKœšÜw@aÅU‚¥UaÝIkmV²‚nn@Ķ»@Uk¥VKÞ@ÞÛ@ƒkVmĢa@_ƒJómƒǖ¯Æw—óÇa@alƒUwšwĢřšk@wÆWXUWXƒWa™m@_ƒ»ÇéXaĸwVa@ÝKkUWkX‚kšKXxƒn@lĊV@¯m¯nřÆwš¥"],encodeOffsets:[[130084,52206]]}},{type:"Feature",id:"2301",properties:{name:"哈尔滨市",cp:[127.9688,45.368],childNum:11},geometry:{type:"Polygon",coordinates:["@@°`„_šJlUšŽ@„„@V¦°JUšŽnLôlnŤ@@šÈaUÒVbkbl¤ƒzk°ÇVÛô°IlVUVôU„xÆU„Ž@bźĀ„º@¦šb@l²‚UVlœ@°ÒĠxšnXxÆVô¼Þ@Üx²KލlƒVÑ°UȰôlwô@²ƒĸ°„lanV@„šVŎUll@bÈnÜm„wĢ@la@ÝÞb°UXb˜lŎ²ÆškšV‚I@ŽnJnĠŽ°knƒÜbĢwna@a˜kÞKƒĀ„a‚™œ‚‚IVbU¥wĠwkô˜xnLƒċVçkaUƒ±IUmnġW„°WôĉšalƒÞÅĵ¯@W¹XÝaƒb¯a±X¯ºLƒaVƒmkLóƒƒbkaƒVUKVkkKV_@aÝykk±L@ƒÅU@yV_™aU¥ówÇx™@UkVƒn@lƒkÅlwšWVwUkĉmkklW@šašbVwnWWƒ—wWL™™@Ušƒ™UƒÇLšÇmƒ„@wƒJĉƒL¥@ƒÝ_@a¯y„UWw¯ƒ¯Uġx¯aÝXVmaU£ó±›¯nwƒa¯óÅVƒXman™„Uƒ›lUXkWa@mkI„›ğaƒm™IklÇU™„kĊƒƒzkKƒš„lU„ōĬlš™„@ŽnX°@llUxŹ²mKĉVWwk@UbUK@bmVmI—ƒVmwaWxXlWȁšmºšÞÆbUxV@ĵńWÆĉLkWUbƒaWzkbĉ`U„±LklōwUVÝ£™UW`Uwk@mk¯VkaõVX@WbL™K@XƧºWzxƒK@lmX@bkVVÆk¼Vbk@Vn"],encodeOffsets:[[128712,46604]]}},{type:"Feature",id:"2302",properties:{name:"齐齐哈尔市",cp:[124.541,47.5818],childNum:11},geometry:{type:"Polygon",coordinates:["@@Þ@ށĠKV¯a°ƒ@„KVblaČU‚mnnšKĊȚKX„°ŽĠ@Þ£ôllÈy„™š_@a‚ƒ@a—KݍVwU@±™¯Uƒlkw@kÞJlÅUa°ŃČaW—šVôƒƨVšU„ƒ@»nI˜b²Kބ°Klkn°ƒ¯I@ƒƒkšK@ĕÇń™@aƒX»¯@VĵlaÿVamI@aÅÝउýƒĊȗJƒôȁÅkmƑۃ@kxġ@@l™aVk¯»ƒīŹaƒkƒ¥Å¯™JUaWU@@w™aƒ»„KUkÆkUm„UmwÛ±±UUbUŽUXƒwWwÆÝk™lkUanaWwnKl™kal¯ka™ƽa›kÅx™a¯@™amb¯V™lÇwÛĀ™V@x™šmêVƜVV‚aôV„wÈx@šˌx„¦VÞ¯VšlmX@‚ƒL@¯Ua¯LmV@„„°X„ċK™V™ƒ@UƒÈ@‚¥@w—ƒġIU™km¥Źwƒ¦¯lmn@°kxVV@¦óam„n¦l@nx™lĉVóšmx™n™ÒĉĀĊ¼„þ„šǔêÞ°ˌĠÞÒ°ĀɲĀƨźˤȤƨĊ°w@£nymwnkUUV¥ôÑVmkÆmUUVa™mVIkmô„lxkXÞþƒbl„ƒl@kV„ƆƒV„xV@š¼VÒ@šŽUŽšnnނJ"],encodeOffsets:[[127744,50102]]}},{type:"Feature",id:"2310",properties:{name:"牡丹江市",cp:[129.7815,44.7089],childNum:7},geometry:{type:"Polygon",coordinates:["@@U`lLUlVL„Ulb„aô„lKnŽU„„b‚K°¹²W°b„aÞb˜knyUlUkamř²L@m°@lšmš²n`ôÅlK„x„ÜKnxV@„l@œƒ›ÅXyW_k@™wm™ŹĕmƒX™»‚ƒÛ™l°ƒôšÈ„»š—ô˜ô_WW@Uœal»šwU@@wšUVƒš@VƒXI@w‚Ģ͑ÞȻ›aU_@mUkly@¯óV»XmWUXUWmnm¥nUUaWLk»Æ²IÇa™wÅaÝ°¯nUa±a™ƒ™@¦õÆğ„@„™@Åb›xU܁nÇłlb¯¦„ôó»mƒ—@±ƒUk@Wwƒa¯xU„V°ƒxXbǎŁUV™™ƒK@¹ƒKUaȯ@ōݙXƒal™ƒlÛkalÇUǫÇńÇakbÝƆ¯nlš¯Ž@¼™VUx@x¯W¼™Æ¯šmĖ„Ĭ¯ČƒVk‚ķÅmxœ°ô²V¤‚bUnÞW°bĢw°V°„XxƒV°z@bÞ`@„‚¦„KĊŽ„I@xƒŽn„™ÈÈK‚„šV™„@VššXK˜xX„mXUx™a™b@‚kXllĊnVlUx™XkxlÆk„m@U„Vlš@ÈwôxV¦šbU`@zÆV@„²KllÞz@b"],encodeOffsets:[[132672,46936]]}},{type:"Feature",id:"2312",properties:{name:"绥化市",cp:[126.7163,46.8018],childNum:10},geometry:{type:"Polygon",coordinates:["@@ऊþÆÞ@bnJUb‚ĀnblŽĊš„„ÞlĸwǔÈŎKÈnôWǬê‚KV¥„ĸôUxš„@VšbU¼m`nnĊŽĊ„xlUšmkaVÿšLšwš@°»UmbKmݙUšwUmVknKUUl¯ƒKU™ƒUȃ‚™nK@ĠkX±lX„°„L@¯¥@wV_m›ĵ¯Ww™L¯ƒUkōƒÇVU™l›w—V󁱃¯aƒVka°wVk°mÞ¯Ŧřƙl™²™Ŏk™U@ƒmUkb¯ƒķŽ±„ó@kxȯó¯VUÒk„ÝŽ±LÛwÝ@ó»ÅUWw™mğw¯Ñ›@UkV±@k™a@¥ƒ¹Źÿ@aƒÅVƒwóVVUkU¯JÜóÈUl¯„yk£laUaVÑÇb@™ţ@kmómK™V¯IU¥ƒ@@ƒ™kV™Iƒ`@ô™¼„blU„lƒ™bÈb@xÇKkĢɳaÅɆō@ƒŽVƒK@z™@@¥ÆKnÜ@@aۏUw›wnU‚ķ@ƒ_ƒV°Ž@„klVššnULVVÞbVl@°™@nx™n°LŚÆlV„ȃmU²@VmĠLƒx„n¯xkWƒzšJ‚wnLmbXbW°šÆ‚™²™@™Žšx@JVx„L‚Ā²Æ°I¯º‚È@ÒnÈ"],encodeOffsets:[[128352,48421]]}},{type:"Feature",id:"2307",properties:{name:"伊春市",cp:[129.1992,47.9608],childNum:3},geometry:{type:"Polygon",coordinates:["@@ƒKƒ¯kWW²ğl@ŽmLšÇ„„VVš„Lk°VVmLUlVn™xšVnނLnaVŽ¯¼™@™x™KUĀlb™n„`n„Æxô@VbU¦ĸŰĸbôxÆ@„™V¥„»„IVl°LUŽll@²„mV„x@ššÞܚÞVnŽlXÅÒlbÈaVVUblb„J@I°lÞIn‚Æ„mxnbUbVLÅVm¤@œţVǤXÈÇĖ@šÈ¼˜aXVÜaXbWŽnzŎašř„KôbšUlw@¯naÆKnUU¯Üa@mkkVUĊm„™żÝ‚ǖŽ‚K„™°L²lÆI@ƒ¯¥ĉƛVaÞk@ÝVaĠlnUVwƒœómaƒ@™wĉ@™a™VƒxamX@aƒ@UaÅLƒaVWƒ_nWm£nWm_ÅV¯ƒm@m„󤁚ݦƒ¯ÅalmX£ƒ™VWUŚw™mÇ@@IV™„WUw@ašI@„k@wŎ»Wƒ„ƒ™ÅVaœK›Ika@¥lUkUlwÅwVyÈwWU@a¯U°m—Ç@UçƒaVa¯mV»ÅwÝUlƒUk™V@k„mUk‚X£šw°@@ǃaÝIƒƒam™Ûam„¯lğmmI@J™U™l±ÅōŽ—kWa¯VÝa@Þkbġ@ƒxÛnÇm@akkōVōl±škšÅšťŚÝ°¯nUl¯xlb„U°b²„ô‚˜Uœxšk‚VÈUŎ„Vl°„šKXxĶ°nœU`@x°¦@"],encodeOffsets:[[131637,48556]]}},{type:"Feature",id:"2308",properties:{name:"佳木斯市",cp:[133.0005,47.5763],childNum:7},geometry:{type:"Polygon",coordinates:["@@nš„b‚„ÞJ„b@ȯ@™xW¤Vlƒn@lšUVlk„ÞVÆxU¼°nUb„bVèÈ@˜ŽnIn‚@šĢmlUw°™żƒ‚VUn@lnL@VôbšwĊ‚lœ„JķĸĢl„wôwƨxVVUƒŦšxšLź™Èš°`nnĠwŎJސĶwôJ„@¤Xn܄ĸlšn°¼È°lŽ„„Uš‚b„xš@„l@ÞÞÈm°„lôwšL°¼ĸ‚°Þ²nĠ@ôwÞ`ŤI„V„ÒĠU„„@„VJĸbƄ²@°ŽĊKšœ„JĶaĢȰ@ô¥°nš¤‚bČUš@Vx„mUw@a݁ţƒÇ™ķƒ@ĕķīU¯²@ÆmVÑô¯X¥ċç@™ĉ»U¥ÝţKWVÅkUVÝŎUmǍÝx¯aķxÛUóL¯a±óōb¯™ƒÑŃVÿƒ_Åķ„a@UƒK@wm@Van@UmmLVa—@VImmXUWƒÝUřƒKUwÝUUƒkVƒk@l¯X›‚Å_ƒJ¯k™Jm„ÅLƒa@¥U@¯Vƒz¯@ƒ`@¼šmxƥšŏKÛk@±laÛ@@Xm@™ƒ@xƽ@WŎnšˣĕÅ@@aÅ@@nÝbǏ¯@ƒ_U›kUWƒkb™wÝU@ç„Wlw@anIƒ¯lyœX°m°VšašÛšm@„mVwÞK°ƒšXlaXmm_ƒ@UƒkwÝK@ƒVI™ƒXmV»ƒI@aƒ¯ğW™bġaU_¯JU¯ġŽƒ„ĉ„k„ō`±nÝÆk„™bóĊ¯Xƒ‚ĢX‚mVn²JV„lbUè„ČmK—wlóğx‚xV¦UaJ›šƒbƑÿÝL—l@bmbġx"],encodeOffsets:[[132615,47740]]}},{type:"Feature",id:"2303",properties:{name:"鸡西市",cp:[132.7917,45.7361],childNum:4},geometry:{type:"Polygon",coordinates:["@@‚LšKVVnkšbVšÈb‚²U°VnklVlaÈL@anU°ÜmXV`œnôLƒèšxlŽšLX„˜L²ašVVmÈX@ķ˜lnU„Èl`ȹš@ŤŽ°U@x„KnnV„mlnnUl‚lVnnaŎwlVÞ҄@n¦šLVŽ°lšwVk„Lšaގl„n҄š@xmLÞ¤Wnœ¼‚WÈLVVUxlÈô„„WVaU_VKšKXUÆbn™‚nôK„bÞw°bÆWXamVwœK˜™Uw¯WUk„UlJUwVUa™@@kmyzm›ĉw@kVwškƒW¯ÅKU_Vmƒƒ™xU@aW@@kK@w„a@Kƒ@@kVUƒaky°_Vm™kna¯K@™ƒL™wġk@@IÇóX™ƒwVakmV@mwXUWanƒlĉ@ǙUw™KƒƒóšܛNJۄm°@›w—Å@ƒ±b¯Wƒ¹„WVwŹĕ¯kVmōb¯w@aƒwmV™UUb™V™IkaVwķ™xk¼›b@VXXó`󗙘ƒ¼Çó™¯„kŽÜš„š¼WŽn„źĖnššxl@X`WzœÆ"],encodeOffsets:[[133921,46716]]}},{type:"Feature",id:"2305",properties:{name:"双鸭山市",cp:[133.5938,46.7523],childNum:5},geometry:{type:"Polygon",coordinates:["@@™UƒƒUwó™mÑÞÑUÝÝUkmmŃyV¯ī„¥ƒUÿĉ¯mÇkaWbÅX¯aÝxƒaóLmmšÅaWV™LULV`UbƒXóƒkÇVwUUÇKX›»XmÝ£nK@wƒ™mÑkƒÝ™bƒKUl™x¯kU™Km¥ƒ@ÝÑkUōxmbUmkVkmmnkUƒmmƒL@w¯Vţ™@Ǻk_ƒÇmV—k@ĸVx‚VÈ°lLkllšUbōwƒnVW¼nlUx¯XmWUnÝ@™xÝUó¼¯J@LVbkJWnkb™W¯„ÝLUxƒn@‚™n™Ü™b¯U¯n›Wkz„°mJ@bkxƒX@èÞVšxlaX„lVVœ„`°@ȐÞa@mÆ@@bÆ@ˤĖm™Xōƾ@@wš„n@@WÜ@kb@²ÜlŐLƦ™nw™@»„_°@„y°UV@@¦„bÆKnƒšI°l„IÆ`œ°W@k„llUV„ÞVVx„LƚÞVX„WVnnUJ˜@UbnKVnm@Ubn@@x„L@VƒbÆĸ„`UĀƄ„Ò°šŎa²ô°bôKÜVĸw°bÞwȎVnÞōVUÆlXU"],encodeOffsets:[[137577,48578]]}},{type:"Feature",id:"2306",properties:{name:"大庆市",cp:[124.7717,46.4282],childNum:5},geometry:{type:"Polygon",coordinates:["@@mÇ@сǰ¹¯J±ÅÿƒKUw‚I@™wšš@š±Å‚™X¯WanamKx™I„ylX°wƒm„wğKUn±@nVDŽUƒÅkƙ¯Kšmmwš@@¯UkÝaUUVK™mU™lk@ƒ¯„U„`ĸ@V‚mœxVxܐ@bÛ@m‚ÅL@¦š@@y„L‚U„Ŏ@ÆɅɴblġÈL@wÇaša„ƒkkVƒaš»@ó¯_ÝJ™wÇaÅXny›U¯¥Å„@w™bÝa™Lmm@@ƒVUŽlbğVmš™¯Xƒm_ƒ`¯_Ux™m™L™a¯b@mƒaó¦Çk™¤V„@bóJknVx™VXx±aƒLUbVxkLVlLWlƒ@nX@VÅbWlÈnƒx„bWšÅbmŽ@xœbml°b™„XbW„XVmnn`ƒLmšnbmb@šk@mwU@@š¯Jlbk°lbkšmLXxmbVbkllšÅނxX„xVWVVa²VܲnxƒVVnÅlVlƒL„¼šb@xV@XŽVbšIÆ°„¦„lźb„Ĭ°¼Ulšb@kĢ@lw„@ƒÜlnȂƄóȘI„ĉ"],encodeOffsets:[[128352,48421]]}},{type:"Feature",id:"2304",properties:{name:"鹤岗市",cp:[130.4407,47.7081],childNum:3},geometry:{type:"Polygon",coordinates:["@@Þ¥‚™ô£nƒn@°„ÆUn`mXn¤mX„`UX„bÆKVb„@@bnW‚b„wšUšbĊ@šx„@nbšWVmƒ_mm@ó»Um„ŘWXkĠ»²¯‚¯nķšwŎ@ĊšŎK°bĸUnјKȦĠÈbÆknJššÆUĢV°IšŽšVƾƒwaV™ƒƒkÇ¯¯»™mķkۃWm@£ƒóIĵxݏōIğxmm¯_ǙŹš™K™wťŽ„UVUŽƧwóxƒxġkĸķƒIk›ĉ™xóa@UmK@kVmUŻ„¯šVxkŽġn™‚@mmJ¯n°V@bXVÇxUzÆxkxlVkV@¦lbœJ›LUbšÆƒ„X„ō¼@xƒl@™J@bVxƒXUš@JÈ@šn™xVÆUXš‚„W¤knÆb„°"],encodeOffsets:[[132998,49478]]}},{type:"Feature",id:"2309",properties:{name:"七台河市",cp:[131.2756,45.9558],childNum:2},geometry:{type:"Polygon",coordinates:["@@²mŎ_lƒĊƒ„ƒĢV°°IV`ĢbšaĠX„°@b„JU¼Wnš„UJ@„ÞLlxV„„@n`lIUa@K°Iô»ÞVšwÞ@VmnX°WVwmkX»‚U„mŎxVak™lkkKǯUUwÇWUn™U±b—KWƒ™Kk™w„çóK›mU_nW¯ÛmV@bÇKkbkUml¯U±VÇaU™™amlUU™LK›„k@ƒU@mwÛLƒŽƒwkLóÆm_™±™nkŽ¯@@n±KnŚlbkVV‚mz—lWXº@Ķ°"],encodeOffsets:[[133369,47228]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/he_bei_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"1308",properties:{name:"承德市",cp:[117.5757,41.4075],childNum:11},geometry:{type:"Polygon",coordinates:["@@lLnlmxn„„IVVlUnb@VVxXJWL@LގVnnV„J˜_@wkmšK„b‚x„wXk˜WXXšKlb²K@nVVVb„L@WlU²„lKVnUJVz@VVb@lżmVUVnbôaVX@°Ub@lWbXš@b@bVb°x„@VxÈLVlšaÆ@Þb²k°@lVUŽ@Xn@VW‚LXb@¤VXšKVVVLnm°_ƨ¤@aUIVa„alkX›°k„™V@„alwUVy„U@k󙰃na°UVUUmUÆw@mkLVUƒWVI„WšLnn@xlVnK„myU@ƒU°UXaV@U¥ƒU@Uƙ@aVUkWU¯ƒaU@WLUV@bkbmKULmKkUVUkmVIUwlWV²™Uml°U@W„LUwVm@UUK@_ƒKUUÜaXw@ƒVKUU@mVIUUlmnIVVVbÈVlKnbVKš@nI˜@nVnwVLVK„K„„˜Vnb@aUIVW@In™°@lVnIš@lWĢ@°UVL@b„@VyUUƒa@w@WUnU@Wǯ™K@UkkJWaÛbmk@mVaÞU@amkWƒ@mXUKkÿƒ£@a„kl@Um°UXwla„al@nmlXnW°znW@aƒwV™@ƒakbĉ¥VmU@ƒIƒVƒUƒJkUmWU™KbmkUaƒKkUVU@KV@@klw—™WaU@kmƒXVènbmlUUƒKƒX¯JkbƒI@JmIUWU@ƒLml@XkJ@U™kƒK@aVKwWa—IWwƒmUƒ@mU@J@UaċU™aUUƒVkI±ƒk@UUƒ@UbVVm@UVKƒLƒlkIWaULUWƒXUJU„ƒ@WbUb@lkXUxm@@JVn@J@b„nƒb@Vkx@bšLU‚Æn„JšaVXnKVVmzX‚°V@_lJXxWXƒK¯bÅamUƒ@lUI›bñJ@LÇKkIÇ`kxWL@„ƒ@@bUVUb¯xWKk„Å„VlULW@ƒŽn¦Ul@I™lmUUUVm@kWƒnkKma¯XUKWmnwVwÝL„mŽ™VUbUVWb@Lnxm„xVŽmbXx›¦@„nb@`™„ƒVƒ@kbƒLU„mVUlkbVXkºmnm@@xk¦šbĢÜlš"],encodeOffsets:[[118868,42784]]}},{type:"Feature",id:"1307",properties:{name:"张家口市",cp:[115.1477,40.8527],childNum:15},geometry:{type:"Polygon",coordinates:["@@k™ġۙal¥@wn@nml¹UWlaVknUVƒ„Kla„@„Ušƒ@_ma@ƒœ¥WwnaU‚wnƒmw@KXaVUVašUnmWUk°™lƒnUVUXWVw™IWVóKUI@WXƒxUU@mma@kUKWLkw@yk@ƒaVkUUċaUU@Wk@Unm@UVmLm±IUƒkJ™kWƒ@a„I@m@U„ƒVƒ„Ula„@VXVƒXmVwnkWKƒKU_k@m¥ƒmX_™JmnU@km@U@KmU™VƒU@U™@Umk@@LƒmW@Û£Wƒka@wk™@aƒI@mmk@mUa@UmUƒIƒwW@aWUƒbU@kbÇ@kwƒ@makVUk™U@aƒm@aU@mxkUƒbƒKUXUƒ±KXVWLUK@wkU@V™@WXUa@WbUxƒJIƒŽ@¦VèVVX@±ê¯KUIƒ`¯UULVx@Vƒ@UKƒIƒVkLmVkKmš@nUJÝbkIUJVXšVVxVbU„VJ„Un™°bV„mlU°„XnK@Ul@lVÈVUXšx@W„@VXšV‚KÞb„n@VnbV„m`ƒUx™kW@UVkL™Km¼@lUnUJVnV„XV@Vm@@LV„klƒIkl@VƒWlŽULWKUL@mJ„@blbUVUlmzUJUxm@UUbċÜk@Ub@VšLVV„¦ôbVŽmšUKUkU@m„„@VlVn¼WbUJ¯@@„°šnIllÈl˜@nXšWlLœk‚J@bkxlxkxlXUlklJƒšXL@bW„n`@nƎXxlL@xl@Xb‚LœKlVlIXblVUbUJW@lX@VL@VVŽšXšJšw„n@WnL°K„bVbl@VI@K„@U@nmVmV@XUWI@aXm@™VUUkWmn@lmUUk@mUmK@UnwVĉ@ƒƒmU_V@XJôVVUšLVUn@šllUnJl_n@šml@XŽlLlw²LVJUL@VmbVblVXmVnlš@Ť¦„nn@܎@bšl„@@XV`„Unb@VlLVb²J‚Xn¥ÆÑ@¥Þ@"],encodeOffsets:[[118868,42784]]}},{type:"Feature",id:"1306",properties:{name:"保定市",cp:[115.0488,39.0948],childNum:23},geometry:{type:"Polygon",coordinates:["@@VbXWš@@UlV@xVLXKWU²LV„VW„L„alVnwV@@b„n@bšVVllUnb„@lxÈ@laV@„aXV@b‚X„x„J‚nV@VVb@nnl@n„J@blšl@„ašƒU_VWUwVUškUm™Ukb±mVwœU@VIUW@UWk„@VU@ynL„m@IV@‚bnK„LVaVmnIlaXwV@@WVL°@@xnX„@V`V@VbUVVLVKnwnL@ll@@_V@VVnaÆ@œKVXÆ@nƒ@wƒKmU—™Wm@km@kÜKXU@ÑW±nIUwVƒ„Kla@I°wU±kškmm¯mƒ_ƒJnƒaƒwW@IVaUama@wƒUƒmU@mVw@aXk@mWa@£km@aƒ_kVmUnWW@¯bƒkUmk@ƒVÇm@@kUU™KUU™@UVUamVUaWIkb@xU@@amUkKƒVkam@@kVUkUWmKmUkLUb@xmJƒ™U@UImVÛVmnUwƒJƒU@VƒX@UWm@Ub°¦UšmxklmX@`ULU@@UW@@xkn¯@makV™UmxUb™°ƒlUšƒbUbƒnUJƒUUVƒa™LkbUU›JUU@mUUUƒJkaƒ@™xUIWJƒUnƒJ@V™zƒ@kb@`@bln@l™bƒŽ@X@š@š„@Xl‚bnbVb„@„„VJlInlšbVw@U„K„l@lbnan@Vb‚JôLn‚UzlV@lÈLVbVK@LVx—VWXX`WxXz‚bV`UXV¤nx@„bVlVnVlUL"],encodeOffsets:[[117304,40512]]}},{type:"Feature",id:"1302",properties:{name:"唐山市",cp:[118.4766,39.6826],childNum:11},geometry:{type:"Polygon",coordinates:["@@„@VVl@²„lJ„UVVšbČVVb‚@@InV„@‚V„nXx˜JXb‚xUL@b„Lšl@VlI@Wnk„KV@VXnJ@I„Jla°I„W„LVVnkmaUç„WVkôaܯ„@nV°wnJlaV@VUnUUaW¯wXWWwna@£UaWKU¯ƒ¯@aVUkKUamUUƒn»‚an™„IVwUWlkš@„LlWVakU@K„_lƒšbÞU°@šy°n„@„KÈkWW™ţ¥ĉōƒkġWUw¯£¯ƒÇwţwƒ@kK@kƒ¥ÝwÅbǤېťV™lW°@ĸ™x@VVVULVLkl@V@Xƒ`Ub@Xm@UWbƒk@ÆVbnLWV@lnXUbl‚@X¯lmU™VkKWLkK@_UK@U@UmmUxmVXLWVULkU@`W@ULUK@XlJXzV@@xml@VU@UX@Kk@WbUK@Xn`ƒXmJnšmškxUVbUVlVVxUbV@nKlL„kVKÞbVKXI°KVšmVUIUKULVxVJVLkV@Vƒ@UbU@WUU@UbUK@b@nƒV@VkLmb@b"],encodeOffsets:[[120398,41159]]}},{type:"Feature",id:"1309",properties:{name:"沧州市",cp:[116.8286,38.2104],childNum:15},geometry:{type:"Polygon",coordinates:["@@@ln@UȄŽl@Vn„l°aX@mXnVlU„`@bln@¤Xb@nWl@bUx@nnV‚„„V@xnbVbUb@J‚X„x„b‚mXa@k„UVwlW„k„KôVm@w™kkK@kl»Èƒm™VKXkla°@XVV@VI@ml@@Vn@VX@V@J„@VxUzVVšš²blVk¦@šĠ@@»š@VK@VÈLlK@XnJ@alIUl„a„VVbš@„n@a„U@WUIV@mUn@mKXml@lL@LnWšb@XV@@a„VVb„V„@VV„IVWÈb˜IÈ»ƒǟlWšaVUÅUƒƒ™Um@kVU™WVkaUwmaóUƒJUU¯ÑU¥mk™¯UaƒKÅnÇyóXmWÛX¯aċbÛa›J—W™ÝU¯»ƒaóóUm@IƒšVVl@bƒLUJWLX@@xšXUxl¤V@V„nVUV„XVbVš@Ž„@@VVn„°VŽ@ţU¯VƒUmƒUWV@mUXƒaƒbUKUwUaÇKn„ƒVk¦Wb@VnLmV@bkV@n„xW`Å_UVƒV@bƒUklVX@VmlUƒx@VVL@x—VWVL@VW@UUm@"],encodeOffsets:[[118485,39280]]}},{type:"Feature",id:"1301",properties:{name:"石家庄市",cp:[114.4995,38.1006],childNum:19},geometry:{type:"Polygon",coordinates:["@@la„@šy@U„I‚m„VXIVJšw„@lb„IVVnV‚@VVœIVVlašK„bVU„VVI„mVa„aV™„kš¯VanwšVlUnb°@lm@wX@@VV@VK@_nWlknwV™¯¥Van@VX‚@„W@U„V„IVxnmÜUnUVJV@„šnI@wValKnV@k‚mU£na@mVk°K„LVa@UU@UƒmknWWkXU@aWW@@km@UaU@@klK@UkaWaUnamm@U„a¯wWU@UkƒL@ŽUn@x™V™lUXVJUb™LmU@aUWUkmKkLUUm@mW—XƒaƒmmkkWUm@@U¯JUUm™kU¯@mKĉxÝwÝ¥LƒUóŽmwkUUUWVkKm™kKmLX„lxVLVxXJ@nVJnz@VWL@`nX@šƒxƒ@kVUUmJmIXx„JV„ƒnUVƒ@UVV„@LUšƒ`UXVVƒ„ƒlXL@l@b@VmX@b™xn°™UƒbkKWLXlW@@bƒK„mKULmakLUlmb@šXb@xmXU`V„b@`lLx@nWVXL@‚°WlXnlb„KVK„XVb@˜X@l_lJ@V@XnŽ„I"],encodeOffsets:[[116562,39691]]}},{type:"Feature",id:"1305",properties:{name:"邢台市",cp:[114.8071,37.2821],childNum:18},geometry:{type:"Polygon",coordinates:["@@nKlLnšlLXUVVlVnxô„V‚KÞ¦ÞxĊwnL°@lVnšVV°I@Vn@V‚lXnl„n„b˜WnXn@VVlKnLVlVX@bnVšKVaUIVWškšU@wVm@¯@U¥VmU_°lšK„k‚w@LX‚Va„U@wšUƒUUKlUóW@UVUœUlƒ°K„wlKU_na„KVnlKkkšWWa@IœJVa@IlJnU@„KVUUmVlaXUl@lm@kXWÝÑnkƒ™±™k@wğ›@@U@mKĉLmVJ@zmlnŽWLUÝJU_ƒ@@šmJkXUVlbklÝ@Ýa™b¯@¯±JÅwġaUU@ƒkU™@mVI±bUKƒL™WUXƒJkaƒLóKULWbUVkKmnk@@bmLUŽƒl@b@mnmJkUULƒaƒbnŽmn@lVV@¦n@„l@b‚znx@`Vz@b„xnV@xl„lbnKVx"],encodeOffsets:[[116764,38346]]}},{type:"Feature",id:"1304",properties:{name:"邯郸市",cp:[114.4775,36.535],childNum:18},geometry:{type:"Polygon",coordinates:["@@„bVKlVnInm‚@@a„kVnK@al@nmlLVUXaVKôL„Klb„IVWšX„KVL²a‚JnUš@lV@„VVĢbÆx²I°Ž°@šaÞbÞ@lkkaVUlWnI@™„@V`ÞI‚VXKmnk@y‚InUĊKƒÇkUUamUUkƒƒ@aU@U™ƒk@WUwVkVJVkkw°a@„mK@UX@VV„LVW@wšwVa@¯Xm@@lUIWaU@UWkXWmU@UwmUkKmn@lkVƒ²™VƒaULUVmJUUUwƒLma@™UmkIUm›L—mVšmx@b™LUamKÅL@VmbkU¯KÝamzkJUb±Vkb™L@lU@WIkJƒzkKmKƒnUalWkkKW@@nkbk@WW¯XUVUJ@XlJ@Xƒ@XlWLkUƒ`VUnaWa„UV@UVIƒaUxUUmVƒK@I@W@DŽU@@U@bƒ‚@nmKXmx™@UxkVWUX„@`VLlL@`™zX‚Ýb@b‚„@VUVkIUJVz°KVlnLlKnL„xlLVVUVlXUJ@nn‚„I@mVUlbn@@Žm„@bV„nV"],encodeOffsets:[[116528,37885]]}},{type:"Feature",id:"1303",properties:{name:"秦皇岛市",cp:[119.2126,40.0232],childNum:5},geometry:{type:"Polygon",coordinates:["@@lnV@Xb˜škx@lU@@LUVlV„LVbnl‚ašLXVVn‚l„I„V„U„JV@UnĊ¦la„bš@nJ°UmƒV@„wn@VU„JVI°bnWlXnWVLVK²b‚akk„lI@aUaVƒUwVUUalaVwnUVak¥šX@W‚kœLVÓm„mUK@_lWš@n_UK@alÅ@ğÅƑŃݍmƒ@їţÇlƒLƒ@¯m™z¯@ÝV™ak„ƒ`@LlVUbkXƒK™@klVXUxƒJmšbm¼V„nVVblLUV@b„°V°XLVb@¤mbXxWX°xXŽVbmVUVU@kbmI¯xmUƒ@Û°óbUl"],encodeOffsets:[[121411,41254]]}},{type:"Feature",id:"1311",properties:{name:"衡水市",cp:[115.8838,37.7161],childNum:11},geometry:{type:"Polygon",coordinates:["@@„KVlV@X°xƒb@VnnmbVŽXblb@VkL@lV@Vbn@@l‚@XX@bWVXlmXnlV„V@@VUbƒK¯LUl@nmbV¤n@l‚LXnlVUV@ln@lb„UlLnV@bV@@wlaXJVbnUVbVUš@VVšLVVn@VVX@@U‚KXU˜U@wUK@U„wVnk@UUWlk„V@a„UVUÆ`X_ƒw@mlU@anUmK@UXal¥„UmƒÈLVbVxVL„a„bVW@nXU‚Vn„„V°UŤV@Uƒ¯Um@Uƒ@@U™UaƒWVUmUUƒU@k£Vw™W@wW@XKƒIUa@wU@@al@UK@_mKXKƒbUU@aVKmš@Xmƒƒ±@kbÇakLğVaUw@a@ƒmkUJƒk@ykw@£ƒWX@lknk@WVkbUŽVnUVƒL@‚mVkI@JUb›I@JXb™XllkLUmƒLmbV`kLƒx¯Lk„›VUV@VôXkVVL„V™V@xƒVUbW@Kxƒl™L¯kV`UnV¦°@"],encodeOffsets:[[118024,38549]]}},{type:"Feature",id:"1310",properties:{name:"廊坊市",cp:[116.521,39.0509],childNum:9},geometry:{type:"MultiPolygon",coordinates:[["@@la„Ušš@šUnL@VWbklWxnIVV„V@X„JlbUlšXVbn@@K„mV@@X°WVInJmn²@lmVbnL@amKV_kwlmX@@LVamaXaƒaVU@UnJVanLlUkaW@UaVakK@IlKUU@an@ln@alKUƒkIVa@a@klaUKUV@UkUV¯šKVƒV@kUmƒU@@a¯ImJUU@VV@UL@Uƒ@@WXUWa@Ukwm™@ƒX@@w@al@@aVIUmVUUUVWUknK@I@™l¥kU±a™™UUVyUwƒ@@I@UUWm@@Uk@@nUJU@WU¯@kbWlULnšÇ„k¼@llLšl@xUnóŽƒLƒlkXUxƒV@lWb„I„`°nnn™llŽV²¯x@JkbƒLU„VxmJX²@ÒWVÛL@lln@‚Xn˜šnV„L"],["@@@kX@Valaa@KWI@UXW@WanaUIW@UaUKķŽk_W@UVUKUš@bƒ@UamxVXnJUbWVXLVbn@W°kb@U@Wó¼mIU¼k`V„@bVbl@„lX@lUôVlUœIV`lX„Vn@lUlVn@„l@UVaƒIUWl£Um™VWU@@UUKlUUUnƒVL@KšUnLVWUa›@™U"]],encodeOffsets:[[[119037,40467]],[[119970,40776]]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/he_nan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"4113",properties:{name:"南阳市",cp:[112.4011,33.0359],childNum:12},geometry:{type:"Polygon",coordinates:["@@lKl@nVV@„bn„@VVnm‚nL‚LXx@š„‚VLlKVU„IXWÜ@șlbl@XUĊUlwnW„LÞw‚m@ÞUVmnVl@nX‚JXLm@VnnJla„I@VkxVb„@VŽln„J@knKVn„@°aVanal@XK°b„‚@š¯VJXIš„VK@al@nV„k‚@nK„a‚b„@XL@blVVKVLXK„@VaVI°mVaX@V_@a@yUkVw„VšIVašJ°™@anIlaV@nKnXÆm@wUUV±UUWUKnaWwXUWmŁ¯Vƒam@kakImƒUKƒ»lan@VXXa˜W@@UlUUa@a@UlwUƒV@Xal@@anIVaUK@V™XmwVmUmV„LXl‚@nalLnal@„šnKlkV@@UnJ‚UXnl@nVl¦V@@VnJ@nUVVVVIn@Va„JƗn@@K@m„kƒa@kmWVaUI@a@™k@@aUL@mmaVIUKUVƒ@@IU@mƒUmmL@K@UUUU@mW@@nU@ğ»mVmbk@klW@UXnV@LƒJm„™lUnUJ™UUUWƒƒ@UnkKƒxmLa@ƒ@@lUU™bmUVWk@@nkUmam@UakJU_ƒVm@ÅlÇLUVmVUwULƒKU@ƒk@UƒVUlU@@Uƒ@UaUUWaŎƒzJƒaWLkl™b@bmL@„kKƒabWŽUVƒ_@mV@b¯JmXUbUK™¤ÇLUU@b@JkLWmkUWIkJ@VmX@JUbVXU`¯VV¯blK@LXKl„UV@Um@@Uk@kxWŽkbƒL@KkbmL@‚UXmaU@@l@x@blX@xUJ@bULUlULÇ@@VšnU`W@@nÛ¼U@@VmKUkm@VVX@@xǚ@bUbVb@VX@@x‚LUb@lƒ¼XLlbUlVVU„Ub@n"],encodeOffsets:[[113671,34364]]}},{type:"Feature",id:"4115",properties:{name:"信阳市",cp:[114.8291,32.0197],childNum:9},geometry:{type:"Polygon",coordinates:["@@VllInJlknJVkVU@mXlUÞ`VnV™VU@U@y„@nXlKV„nJVkXKWaXI‚b@yVk„VUkVwn@‚K@nW@k„KlUXVVUlbnUV`n@V_V@llX@@V„b@bV@@nlVUb¯‚WLnbmb@ŽnLnK˜b„U„bVWnLlaX@VVUX@Vln@`kL@ll@VXVJÈIVl@XÞJ°Una„LlylU@UXKlnn@lanLWWnbVI@KXKVL@LVWVL@UVKUIVWX@@XÆJ@In`@lJVI@a„WšÛnK@UlK@UU@VK„nlm„nXal„UllLUbVVšknJ@nV@Vm@a„l@@xnV„„lJVUU@™w@aƒk„@XW@_mWnUlŁUmVKV@VXwW»XƒWaUwnkWUkVUƒU@@@WlaUkkaƒIWVkm¯xmIUmƒLUVƒaUIó»m@mmwXk@a›mk¯¯l™@wƒmkLmmU@UbkUWJ@XUbƒJ@b@l@znÆmK@Xk@Ub@lm@ƒI@akmVKUUVUkU@U±JUbkƒ@IWmkxƒa@UUV™UWVkIUaW@UlLWn@VkJƒI@VkK@L@bmKƒkJmUUaUKWXk¼VxnJ@„V@@VULV¼ƒ@@UkaUlWL@U@W@IkKmL@KULUWULWKUXUJmIƒb—KƒŽƒ²UW™nWKUUkLUƒmUUam@UU™@ƒmUL@xkV@„VV@bmV@Vk@mwkUƒVUx@mbX‚ÇnVb„‚UL¯šWŽnUVLVb@xnlWnU@UVUVVUbVVlVkn@llVUXUWUXVbUJ@bmLUJnb@nVK@bl@@š@bVJUbnX@l„b"],encodeOffsets:[[116551,33385]]}},{type:"Feature",id:"4103",properties:{name:"洛阳市",cp:[112.0605,34.3158],childNum:11},geometry:{type:"Polygon",coordinates:["@@VVUllLXl@LWn@J„@bƒKUVmnL@`VblLnbV@„b@JmL@LnV@VV@¯„VJVnXL˜@nm@aÞ@‚a„k@m„IšmVbXL‚ynLšk°@°aVJnUV@UVVXk@WJ@VXLlUnJVnnƒ°U@»°U„wl@šb„WmUXƒÆ@VLXU@m@U„a@I›mkb™a@naWW@_@WXUV@@U‚ƒ²@„K@I±U@¥kKWLóLlƒa@£Um@kWKXU@mlLXUVKUU±J¯_@`UL¯Wmk@Wa„kkƒlUnƒVUVaU@KUU@mmK@_ƒa@KX@VaUIm±™k„aVKVUkw™@kaƒƒW@kbkL±UUaƒK@UUKVak£ƒ@UmmL@lƒIkmUƒ@Ualw@UƒJkbmIUmn@WKImWk@mUUnÝV@ŽnÝxƒKmXkxĉVWVk@kaċšÛ@WXƒJUV@zŽm„VWnbUbVbšLlUnŽ‚lUÒnWV—VWnk@@Vm@kxm@Un™l@Ll@@V@šXnƒškJV„šV@nlVXx˜U@l„n@aš@VLnWĊ¦nxš@lbVKXLl@ރVLƒ„XJl@XXl`lIXVl@Xl‚XUVšK„wV@lanx„zUbVJ@VVX@b"],encodeOffsets:[[114683,35551]]}},{type:"Feature",id:"4117",properties:{name:"驻马店市",cp:[114.1589,32.9041],childNum:10},geometry:{type:"Polygon",coordinates:["@@n@„b°UƂXnVlnLÜ@VLœm@n˜@na@J„„m@k„@lVšVxXX@„V`lLV„XVV@VVÞLVV°„²@lašbnxV@@b„Lšmlm„_VWnIWUna@lšLšbnV°ƒVL@KšV„LVUVaVLXK@mÆXna@wVm„a‚@Xw@KlL@a„@Va@wUkaWnIVƒla@Kn@Vn@VUl@nKVn„J@LnK@aVkVUUWƒ@VakUVanI‚²X‚W@UUU°KnUVLl@XaVK@ašU@KUI@W@_lm@KkLUKV_Uƒ@»@UVJ@XV@@mVL@K@U@Kk@VwUUm@kmWL@VkVkzƒKmb¯VÝI@WUkÇJUIUWk@@klK@_km@UVWUUW@kbmKUXƒaƒV—amLmK@namaXK°VakU@mU@@aƒa@UW@kkU@U`m@U_mVkaUVWUkVƒL@lmX@ŽLm@UxVlƒUUl@zaWJXbWLUlmIUƒkLmWƒ@@z@VUVUšUmÝ_kVWŽ@nUVUlmIklmIkJUkƒl@n@Lm@؃IUbm@UJUUVU@mmI@UU@k¥mUk@WmVmI@VU@klmLƒ™k@mbkKmb@WkƒKUŽVnUnnxšW@UVLUbmJ@bk@WbU@V„kx@V@bVbkV@V‚@‚—XWbUWm@kb„¼VLn„lJlb"],encodeOffsets:[[115920,33863]]}},{type:"Feature",id:"4116",properties:{name:"周口市",cp:[114.873,33.6951],childNum:10},geometry:{type:"Polygon",coordinates:["@@lšnb@xlJ@UnLlKXUlJl_„KnV@xVL@bkbVVUè@šWb@„Ubmš„ŽkšVšmbX„VJnUl@„a°@@b„LVbƒlXx˜InmnLVw‚anJÆw²IlmnXVl°VVbÈaVb„@lkn@VWnLlUVmÞUUklƒkƒVkUaVaVaUw™K@kkaVWmw„_„‚l@nU„VVb@b„aV@VV@zXJl@@kl@šlœk°WVnÆbnbUšVJ„Iš@VKVm@k™K@_kK@a@aU@@wW@@k@aUW@IUWVUnLlUlVXKVwmk@W@—VWa„¥@k@lnƒUIÇKUaU@ƒUUVmIUV™Uk¥ƒVma@¯k@Wanwmƒ„@@n@@m@UIVƒkUVamUXWƒaV™U_™@ƒmUVUImW@aUIĉK@VmI™b@lU@@n™JƒkU™@KƒIUmmLk@UVm@UŽm@@LkbU„mJXlbV‚@xUbƒ@@bkK@LWx@ƒbUn@xmbÅW@nWLUKUbUVƒK™U@LUK¯„mU@šVV@xULUŽVL@bU`WšUz¯aUamKUaƒ@@xkX@x"],encodeOffsets:[[116832,34527]]}},{type:"Feature",id:"4114",properties:{name:"商丘市",cp:[115.741,34.2828],childNum:8},geometry:{type:"Polygon",coordinates:["@@XVl@lLȃ„@VkV@V»UanƒWX@VaÆÇô@ÈaVX@xVJXUÞU‚aVLĸbXKl„V@šm°Vn_ny˜XX»mUk¥lK@a„_@yšInaVKVa°_@WXI@ƒ@K‚VnIlbnaV@„l„@‚a@_w@ƒlwUKm™Xa@UV@š»Vƒšw@kUKVUUm@w±VUXUKUwmJUUƒ@km@@±mXkmUI™@mm™KUwkbWakLWaUIkJmŽƒX@l@@VUX@JWbX@VbULWbƒlUVULknlV@bVJk„mb¯KknWmk@@nmVkx™@ƒVmU¯KUnUL™@ƒJUIV™maÅaUm¯X›l™kk@@lk@WI@yUUU@ƒb@aUaƒUmVk@ƒƒ`nxUXlb@lšLVxUbUbVbUll„k„VlÝVUnkVmKUXm@klƒ@ƒnUx@xnxƒn@`VX@V²x@V@b@„Wl@zU`VUVVb„L@Vƒb™W@bkXllkLWV@V„@VVÈwlVœ@@X˜K²Llb„WnnÆL@VnJWn"],encodeOffsets:[[118024,35680]]}},{type:"Feature",id:"4112",properties:{name:"三门峡市",cp:[110.8301,34.3158],childNum:6},geometry:{type:"Polygon",coordinates:["@@WKUmUI°ƒU@@UmU@KnK@IƒaU@makKUa@_‚KnmVU„L@a‚ƒ@IXm@KWkkKVkUU@aUW@UUIVaƒymwkbU@ƒx™LVUWWkk@WUkJk_WWk@WI„ƒUK݄k@WKULka™@mwĉ¥mXUK™@@bƒm@k—VWwkU@m™UUƒlI„™Wm@™@Uk@@KškVmn@lwn@@Ul@Xm˜UXUmVсkmkV™KUaVamaUXnƒ‚@ykLUKƒ@™WwKmKnUm@UmƒƒaU@mUk@kL@lƒxċxUnkVmnXxWb@`kzWJ@V—LmVUn™lmUL@lW@Ub@VšXUbš`VLUbUJ@nmnUlUUm@@bUJlnU„š‚U@lxkbƒ@@XƒJUnƒ@kb¯VVVmlXXlJlzn@VlkVW@bkK™bmškŽUbVb„lƒXVxšKÈnšwÞlĊKlšVnKlwX@lL@xlUnVn„@šl@lmX@ƄÈb°¼ÈwVJlx„_°xšašlšUÈxlUnbVxnL@lllšbm„n@nb‚@@V„L@V„@@„VLšJnIVVlKnV„_"],encodeOffsets:[[114661,35911]]}},{type:"Feature",id:"4107",properties:{name:"新乡市",cp:[114.2029,35.3595],childNum:9},geometry:{type:"Polygon",coordinates:["@@XVlL„K°bUblbUbšl@nX@W„XVVKVkš@@Žmb@„Ubn„W`kL„LƒV@VVLnKlVXIlVš@@a„@l£nWlƒkVa„@°bnUlLVlna‚bnUVUXKlU@ƒ@lk@a„I°y„@ôkUU@wšmôšnkWakml™UkVmkUlmUUm@nkUKWanamU„LXW@U‚VnUln„`l„œblL°KXV@ĠJ@L°„šJšUVw„anK@UUImmƒkK@¯±Um@IVmUmmÅnWaUK¯aUk„w@W±kVƒx™U™VƒwƒnÅJUIWaÝJóI—bm`ÝbÅImJUI¯¥¯@mU¯UƒJmnUVóUkl±V@zXl„bWVXL@bm„mº@@XmJUXU°llk„@nWJk@U„@¦U`m¯ŽWx"],encodeOffsets:[[116100,36349]]}},{type:"Feature",id:"4104",properties:{name:"平顶山市",cp:[112.9724,33.739],childNum:8},geometry:{type:"Polygon",coordinates:["@@l¤UbVL@V„LVb²VlKlaX@„„lbš@lxUVULƒbšln²VJUbW@@L„b@`nL@nVV@LVŽUbUVm„kVl„ƒlXbl@Xn°ŽVK@_°`²IVVV@VUVJnInaWK@Uš@„K„LÆ@nmlXXWVUUw@klKVa@knyVkVanI‚JXUl@XbVUl@@aša@mXk‚bnK@UlK@UUUVaXaWmkUm¥n—WmXaWaœkl@VmÞb„KVL@aVI@mUwVm„@KōméUL™KVaUk@kUK@U˜WXI@VlKXU‚@VVnInVV@VLlK@UUƒkKU_@ƒWWUwU™@klƒn@ƒƒ@Imb—@@m›nUKÛ@mKUkWVXxmbVLXŽVVU²VV@xÅnmWmLU@kbmJ@b¯š™IUb™JƒUUxVl@z@bU`W@Ub¯nUJUbƒ@WLUKULkU@aWKƒ@aƒbmL@ƒlmUk@@bUL™ƒWJUI™°@ƒŽ¯aWLk@mbUb¯b"],encodeOffsets:[[114942,34527]]}},{type:"Feature",id:"4101",properties:{name:"郑州市",cp:[113.4668,34.6234],childNum:8},geometry:{type:"Polygon",coordinates:["@@@nWVUKÅ@W„nVnI‚ŽV@œkƂšwV@šnn@lxÞlnôJ˜zXJl@nalUČVlƒl@²UlkôVVUnm„I°VnV°@°¦VJnIÆJÞan_VmU@ama™@kU˜¥kaUklw@UIV¥kVUI@ƒmmUÅmUlƒwVU@amU—JWbUakVƒ—Vé¯Im`ƒk—@ƒwVWmLkU¯ŽƒXkWmLmx@UUƒbm@@x™J@LbW@UUVWUkVKƒ@ka™IUamKUkkmmLƒUkJUVWXkWmnÅ@ƒKƒL™@@VXLmbmJUIUVU@ULWVkK@nWVXL@lVn@¤„b‚kôKXKlL@¦²V@JƒL±@„@VU@WV@X@`XXmb@Žšblaœn@Jƒb@V"],encodeOffsets:[[115617,35584]]}},{type:"Feature",id:"4105",properties:{name:"安阳市",cp:[114.5325,36.0022],childNum:6},geometry:{type:"Polygon",coordinates:["@@°kVaV¥kVmUkWkWVkVKUwkkmKUU@a„wWWXWakKWkXmlašIVmX¥ƒU@a„@WnK@kƒƒ™V™I¯ƒ@KğI@WU¯LkK›akƒƒ_kmmVU@VWXƒKnVmbXbVLmln@VVknlVUnVlkšlnXbmlmlXblnÈlWbn@@nšK@V„L„bVV°VVzšlnš@V™xƒI™b™ŽU@WLUa¯V™UkWõ@¯kkmxk¼l‚„XUlVbVLnlULmU@lƒLkVUlƒX@xW@¯mUƒ@UmIUW™L@aXa˜kU™¯anƒWk°@k™kKmmUIWaambUkkKmV¯aƒ@UblŽk„mXk¤ƒ@@b™@UbULWVnb@lUVVnmšnVVU„J@bWXX@WJkL@blVU°UV@XlWnXUbW@UVkVšVWbnLUJWLUK@Lnn@blVU‚„nUblxVUVJXU„a˜@Ub„LnUVV@mVIVVn@UbV@‚XbmbUV„_lVXUWanJVI@WkI@WVIVU°WXXl@la@mX@lLXl‚kVbœm‚X„ylIXJV@@kšKla²UVa„IVyÞb°LlVna@UÆKnLVbšK@anwU™"],encodeOffsets:[[117676,36917]]}},{type:"Feature",id:"4102",properties:{name:"开封市",cp:[114.5764,34.6124],childNum:6},geometry:{type:"Polygon",coordinates:["@@lUVbXa˜InV@bUV„x‚knVVÆnn@„VJlUU¦VJ@kxVllb—¦lVš@nb@bVŽUn˜aôJÞIXbVJÆI„m„xšUšV„w‚U²l@XƒxVl°bVLXb‚`XklUnmVblLœ@lmšx°LVK@UXIVašWlL@Ukƒ°KkVaVUXmmI@UÅKmmƒXka±K—L@W›@kUÇxUUƒ@@UXUlKkklW@ašX„a@UƒKUaVUUV_@yXk@ƒ@a@U±w@UUW@_„mmw@wVw„mUaÇbUa¯UUkmWkn±JÅxmIbUxmKmn—JWw„kUaƒK@a¯@ƒbk@mVUIWƒ—Lmwm@Ua@WJUb@LUl™@UUmLUbWJ@VL@VmXWWzUJUꄘ"],encodeOffsets:[[116641,35280]]}},{type:"Feature",id:"4108",properties:{name:"焦作市",cp:[112.8406,35.1508],childNum:8},geometry:{type:"Polygon",coordinates:["@@V@VL@x@bXŽWV@XkššlUŽWX@J„@nI@KlL„KšUVaV@œJlL@KUk@KÞL‚l²_‚@nWlL„UVVš@nLWVUJVn@anV@a„wÞUVLVx„b„@lW„@lbXn‚Vn@@¼šL°mšKVn@bnl@nVK@blb„L„W„U@VWLXV@nlKn@lVVbXw°nV_@¥Vƒl@XI@mlƒkkV¯VWnI@W‚@n¹nƒ@aWKXUƒaWk@yk@k„ċUkVmbk@WI—yóImÝkkwm@™mU@™xŁ›lU@mJƒX™ak@ƒx¯V@¼¯Vm„UmmIkVWK@UXIl@UWVUU@mVUI¯b¯@™lmKzWKUa™nƒJ@nƒlbÝ@@b"],encodeOffsets:[[114728,35888]]}},{type:"Feature",id:"4110",properties:{name:"许昌市",cp:[113.6975,34.0466],childNum:6},geometry:{type:"Polygon",coordinates:["@@lI„VnKlnVlnLVbšJlb„@ULVlUXVVX@‚a@KšI@wn@„aVV‚@nwnKlX„W°lVnKUX„x˜@„ln_°JVIXy‚XnW@U‚K@UXIVanKVVš@Vk@KVaXI‚@Vbn@nx˜KnaU™l™ƒn™Va@ƒXa@™VçUUla@aUK@wmUƒLk`kIWVkLmK@V@XUlƒn@JXV@nm„™bU‚óIƒmUa±@@ÑóVUUk@UlKVU@akWVUUlUUaUK@UUKWbUkÅJ@XWaƒ@XbmJ@nUJ@bUKƒLÝaUnk@›lXbWbXnm˜n¦lVXnWbUbVV@VkL@VmLaWl@n™b@bk@UVWak@WVImJUbUlmz@lUbkL@lVx"],encodeOffsets:[[115797,35089]]}},{type:"Feature",id:"4109",properties:{name:"濮阳市",cp:[115.1917,35.799],childNum:6},geometry:{type:"Polygon",coordinates:["@@lLXbW‚XXƒx@bVVnLllVxULUl‚XXlVlUnlŽU¦Ub¯l˜nœK@V‚bVb@šXbVL„KVxVVnIlašb„a„¥lU@wnalLnVVlVLXnlWVXn@@lVI@WnU@mƒÅW¥—aW_k@WwXy@kmƒ@wU„mš„š¦šlUxVLV@UwšJ°xš@VX„@Vb„@š`VX@VX@llšIVbnJlI„bšV„l„˜J@ƒmѯLóa@ƒƒKUa„k™ƒ™Xƒ@UK@wU@ƒlWUUݯImW¯aƒLUKU@ƒkƒ»k@mƒwƒa@UnKWI@ƒUU@akVWK—k@a±ƒbóUWKXUmk™KUmLƒbUx„„@lmLXŽƒ@@b„VW¦Un™JkbWnXl"],encodeOffsets:[[117642,36501]]}},{type:"Feature",id:"4111",properties:{name:"漯河市",cp:[113.8733,33.6951],childNum:3},geometry:{type:"Polygon",coordinates:["@@@Lƒ‚UnVxnIWa„@Xb@WÆIVlXaVL@VVLVbkVVŽUVlX@bUVkLV‚l@VVôU@Ò²@Vb„nôJVšanƒ@mWU@I„mVk@WkI@wmak™@wlW@w„@VbnLVb°bVyX™V_@aUKVVK@wUU@™™a™K@kmbXVmJUXƒ`kn™nƒK@aU@mw™akb±@¯ƒUUÝKUUU@WU@VkLUKU@mUmJUU@WVkL@UWJ—X@VVL@lVlUbšLVKnêƎ"],encodeOffsets:[[116348,34431]]}},{type:"Feature",id:"4106",properties:{name:"鹤壁市",cp:[114.3787,35.744],childNum:3},geometry:{type:"Polygon",coordinates:["@@ó™™n@xVVólƒ@¯zƒJ@bkl@@„kVWLUVmVXbVJnnlLlš¯@Xlm„°bVš—lWb@bšKVXnJ@VV„°nX@@w„WVklU„K@knVVKmkUKUaVkƒWkl»nwlŽ°lö@lXšV°UVbXKV@šša„Jšw@Um™™kUy¯UUUƒaƒK@U™L@mm@XaÇkkmWank"],encodeOffsets:[[117158,36338]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/hu_bei_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"4228",properties:{name:"恩施土家族苗族自治州",cp:[109.5007,30.2563],childNum:8},geometry:{type:"Polygon",coordinates:["@@VK‚bX@lbUVnL°„@VlVnUl@VUX@„aVƒmaXƒlašUUU@wmaVUn@Vƒnmmk@m™U@kna™aU¥Vam™X_@WƒU™mW@_kƒVaVKnL‚lœ@VVal@k¥@kUW@kUKVUlUVсW@kÇaU»ValmkUVUVak™@aƒV¯_@W‚UkmVUlU@aœƒƒalI@akkVWUaWXUWwœWVbÆ@„„l„alIVK@U™m@UU„W@al²a‚¯UağÇm@ƒbkk@wƒ@@W™aULmxƒIU‚™ƒb¯@U`UX™JmL¯aƒKX›WUL@aknmK™@aWUXaWm@I@UÅmVU@™™aUV@b™VƒI@WkU›bXkm@VakwUKULWKXmJ@XUK@ƒmL@KUwVaUI@KU@mmn™mXka@»V@@UUaƒw¯yVk@ƒUUVmmkÛÈU@mWUnmx„šmlUbV¦UlbWVUL@UUƒ™IUmÇKV„VbUVVxkn™LUxV`VX@š„„kJVVUXWaUVVlUnmKUbkI@WULmK@L@LVlƒLnmUIWV@aknƒ`VXUJIVlUVVbUX@¤mbnLm‚m@UXk@mm@Ukaƒ¥@kV@@KkU@aUKWbkLWVkIVŽk@UbVlmX@bU@@mmL@bn`@Ln@llVLVk„@XVVU@`VXUš‚¼k`VULka@VllVIn¤VU@@bl܃bkx@bkL›škKƒn@bn@@b@JUnV`UnVbVKlVXUlbn@°ƒVx„@@b„nVbUllVn@V—VK@UnW@UVUšlnk‚VÈޚxVb„VVI„xVaÆ@@aka@UVaU@@a„k@Wl@nbVIƎ@Jk@„L@VlXnlla@VJnw@UmwXU@aVK°ÒnllnLlb„xnKVaV@l¦²nVl@llL„x@XVVœ‚Ķš@našx@U@al™XUVa‚LÈþV°XxWXkK@šmLnlUb@b‚xnLVlVVkb@UJ@xWXXš"],encodeOffsets:[[112816,32052]]}},{type:"Feature",id:"4203",properties:{name:"十堰市",cp:[110.5115,32.3877],childNum:9},geometry:{type:"MultiPolygon",coordinates:[["@@@a@w@kV@nbVK@ƒnUla„@la„Ål@nlVakwWX@WkLšaVmšwV@anK@UlIXmWkk@@mmLkWlwk@U_mKXwWK@U¯K@UU@ƒVUa™kmƒkI™yUUVUmanU@mlwkƒ@_mWXaƒUWU@ǃ@U@aUaVwUKUIƒVkK@UWIXƒmaV@k@Vm@UnwlƒUamk@V@„ULUamxUJkU@Iƒ`WkkK¯XWak@@W@IUV™LWJkXkaÇVUKƒ@kUmbmUUƒUKƒbkKWUkI@ƒkKÝ@@aƒUm»nI@mƒU@UnWV_@aUmWbkLUl¯b@a›kkk@WkkJm_k@UV±@J@b›nU@@WÝIUJVbXL@nlJkx@„Wn@VkJmb—LmUƒ`VbUL@xVn„@XVƒŽ@„mVVnnJVbU„ƒx@„V„nVUbVVƒx@šn„™bUK@bƒ„@bƒJ„šm²„VU‚lbXzVJV„„JVbn@@Xmb@V@bVJÈ@‚Vnkn@°aVVV@šX„KnalLVmšUnnVKVlnLWlXX„Klk°š™šXŽWškLUVVV@nU@ml¯nmbk@W`Å@mb—LWm¯UƒxnêVèk@mbƒVƒnUK™@kKmXk@@JUI›lÛLllnbVnlJ@LULnlÆaVLnŽV@nkVJ„@lkô@²bÆm°w„L„WV@VXšKšVXI@W°ÆVšK„b°U„JVIVV„¦XKVL@l‚InaVÝnUl@@bX@‚™nmVL@lVL„lVLVUnbVW@xXn˜bœU°¤V@š™„a@kWKUUn@VlnL@UV@Ü»@mX@V_ƒakaÞ@VK‚¯@kkW"],["@@mUkUUm@nllVKXXVK"]],encodeOffsets:[[[113918,33739]],[[113817,32811]]]}},{type:"Feature",id:"4205",properties:{name:"宜昌市",cp:[111.1707,30.7617],childNum:9},geometry:{type:"Polygon",coordinates:["@@°`„U@blšUbUVlVkn‚ŽUbV¼Èb@l‚XUÒkVUVVL@lVX@ll¦k@UbU‚›@kmKULUbl„@`nXšŽ„V@XW`nšUbV¦šbmb@lšV@nnlmnU„m@UVnb@xVV™VkbW„nb‚VnVa@an@UaVU‚JXnWlXX@l„¦@ŽlKÆX„bX‚V@VV„@°¯°xXx‚XV@nV°UVWU_VWXkmaVnWVkn@lln@lb@UVLXWlnX@˜aXUmaVK@UXU„U@WVI‚W„XXV‚U@¥VKœ@‚Uގ„„‚a²LlV@kV@UanKma@UVUnK@UVLXyVL‚knJ@UV@@UXKWUXaV@Vb@mVLnKW„m@aUUm@@UkK@Ula„LXKWaXI@alKlmUk@wVKXL@m@WWn@UVa@K@wna@aW_XWWkXbVW@k@U¯WWwka@UUaVIVƒkU@m±@U@@wVKkaš_@VV@XUVwU¥‚šyUkm@V±ÈUKk»ÇL„m˜mLk@ó£kmWwƒm@U„IkWKXwWU@ƒkLƒwkbmaƒbkK@VƒLkmWIUKkUUƒÇIǫJ™XÅJULVŽÇLUVƒ@UK™@kI@WVI@UaƒWmXVVUL`±kÅLmKkƒƒkƒÅ@Ua›XXxWVXŽVbUXll@bkJ„b›„@bkVUVlnV@X"],encodeOffsets:[[112906,30961]]}},{type:"Feature",id:"4206",properties:{name:"襄樊市",cp:[111.9397,31.9263],childNum:7},geometry:{type:"Polygon",coordinates:["@@@Xl@Xb°WlLXl„_@JlVVInwVbVK@ƒ@UnlVbk„mx@VUnl@U@nbW„XJ@VlL„UVJVLUxVb@b@VȄ‚@XV„VWbnX@`l„kx@nmVnbUVVVšzlJn„šlVb„UV@@V°L@VXLWxnLV`l@kxlXnK@nl@XlWn„`Xnl@@UVa@VÈKš£VLVanW°U@UVU„@„`VIn‚mV@„nV@Xa@aVW@UšalkXKšblI„yƍXnlJXbl@@VV@nklU@`„nVK„LVKVb@V„U@UÈK„UVKšIlUX@V`lIVbn@nblVVmV@@XXJšUVV@knKVn@`@X‚VnK„wlLVmUUU@ƒU@aXL@WlU@UUW@UmU@KkLWaXkWmXUWm@U@ƒnk@UmK@U@UaUVUUKV_@al@namWUI@KUƒK@aV@WUIƒbƒ¥ULUJkIm™ƒK@U@K™V@U@a@UkU@K@wVaUwlU@mUƒULmKUkV@@anIWmUK@I¯„mKkl@LUb±lUakLmk@WwUKÝVUIm`¯n@Uk@makJU_@ƒƒJma¯ImwUVkKƒb™aUÅ@wWaU@VU@mXIVmmUkJkwm@mIlUKWzUK@VmLUV@VnbmLVbU@@lkU±KbƒƒÝV›@UL@¦VWUƒWXUJ@XƒVWV@VULnbWV—bW@kmWXUK@Vkam@kkm@UlmXUŽnbWlUXV`UX¯VmUU@Ul@Lll@nnJ@LƒnWmbmš@b™`ƒš","@@kUUm@nllVKXXVKmU"],encodeOffsets:[[113423,32597],[113794,32800]]}},{type:"Feature",id:"4211",properties:{name:"黄冈市",cp:[115.2686,30.6628],childNum:10},geometry:{type:"Polygon",coordinates:["@@VVUnWVXnVJ@„‚U@V@VXŽV@@IVJUnŽ@V@L@KlIVlVanLVbnVlI„ƒn@@a@Kl@@I„JlI@aXU@KlK„kVblJXU„VlU@V„bVkVKXn@VlxVa²I@VlVUxln@bšJXklaVWnLmÅ@y@k@ašI@W@aXIlVVaV@nnlKnLVW@IUa@a@K„UVVlI@wXKVV@IUƒla„@lUXwWƒnƒnalLlxXLll°@XwVKVaXIl™nb˜@nln@Va@U@k°ƒUmÆUVaXI„JV¯ÇUmmkU@WaKmakVm@U@aVKkkmKkVmIkÇ°£@aUUVaVVnKlkX‚mkƒ@ƒlUVaX@@Um@‚™UmlUXV„UVU@w‚K²¥Ua@I@UV™l@U™V±UIUÇ°»VkUmVI@a@U™m™ĉ™¯V±bŹĖğaÇL¯lmŽkX@‚óĀ@ŽmšÝêb±WkLƒn@xXx@Ž@b@V@LW@UbƒlţXƒ`kxWnXô¯¦ÆV@L@JVLƒxkK@V@bkz°l‚lXz@J„UlVla@XUV„bVKXnW`XXV@laVV@V„X@V¯xƒx@xULVbUJ@n@LU@VmmakbUK@b™IWWUUVkUmkLm@VJkb@nUJƒ@`V@kX™aUaVmmLkUmJ@Uk@U„±lkzmJUb@b„VUxVXU¤ƒL@JƒX@VlL@JkLUVU@mnUl„¦@V"],encodeOffsets:[[117181,32063]]}},{type:"Feature",id:"4210",properties:{name:"荆州市",cp:[113.291,30.0092],childNum:7},geometry:{type:"Polygon",coordinates:["@@ÈJV„lVVLXJln„K@UlL„anbla„xlK@„XVWxXLlƒJ@V„nXxlnô¤l@nKn—‚ƒÈKl¼VL²Ç‚Un@Vl™zŽV¦UxWVU@@U™`lbUL@xV@²@@nlVU„UJVb@VlbXx°XVWX_VKUwVKVa@UVKUUVk@KnblaUU@wnWl@UX@lÆ@@a„IVmUk„™šxVJ„U„bܙ@Uk@WWnk@Vƒ„™Vm@I@m@Un@m™XUlVlUnJ@knJVU°@@aÆLX@ƒllL@¦nJV@XblLVa²U@UlWš@VX@`@LV@@bXJlIXml_lJœU°b„KÆLnVVl‚@ö—Vƒ‚mXaVIĢllUlVnLVlX@@b‚ašnnxšV„L‚bn@°ÆXmmkĉƒ¯w±™™™Uċ@KÝÅƧŃÝ癙Uw¯ƒm™¯k@W‚kV@¯UIUJW¼kb™Uƒwk@W`@¦Uônb@VƚlÈ@VU@ƒƒ£UWWnUÆUnmJkUÇ£VWUI@aUU@WkI@Uƒa@JW@k£kaWVUKmnkKƒb™kkVWb—VmUUmwU@kk›@UakUUa@V@nlx@lUb±lUbnnWLUyk@UamœUK™@mlk@Wb@VXL@x@xWI@a¯Ž¯V@bVn@LkKmL@`XmKmVU@@bkL@V±bk@Uaƒa™L™KUVƒIƒ„™W™XamVVbUK@b@Lm@UWkxULWVUnm@UlUX"],encodeOffsets:[[113918,30764]]}},{type:"Feature",id:"4208",properties:{name:"荆门市",cp:[112.6758,30.9979],childNum:4},geometry:{type:"Polygon",coordinates:["@@n@lxlInVUnWJ@nUVV@Xb@xVƚb„alLVUnx°Jnb„I@„V`lInbl@@V°mn_VJÞUVLXx‚@nllKVb²kVa@KlknL°ƒ@JVLXnmJ@bU@VlnLVKV„@nX@lUšKVaXal@VKn@¥°L@Unw˜bnašV@KV@VUX@lVXI@KW@@IXWV@laVL„„KlaXUVVnkVWV@lwXblIXWVkVmšaU£VaUmVIkU@y@WakKUamU@UUK@kmK@w@@mK@LƒV¯™U@WwkmULƒamVVUU@ƒƒIƒbUKUa™kmƒm@UakLmxU@UÒWlULţÿmwkIUm@a‚kÈblW@UVƒUUk@JW@XkWWUkUKUIlw@aUWknWUUmnIWƒ™aUwVaۚƒaƒVUI™wƒšVlUnƒJ@bÅ@@kVWk@mX@xVVkbma@LUlVVUL@VUbULVxULW`UX@V@lUXWaXlWXX`@bmb@x@LUb@VmŽXX@‚@nWKUL@xVlknkL@bWJXbWLƒKkb@VlL@Vn@VV@bƒnX‚mLUK@nUaU@WbXVWL@VU@@V"],encodeOffsets:[[114548,31984]]}},{type:"Feature",id:"4212",properties:{name:"咸宁市",cp:[114.2578,29.6631],childNum:6},geometry:{type:"Polygon",coordinates:["@@ÞƂLČ@šV‚š²š°xĊ„nlWnŎ¯m@aƒK@„„°‚n„Jšwn™VIUaÆJšÅ@wšwV™XW@aV_l@²V°lĊwlaXLšwlUkalVVaX@lVXI@a˜UXJ@U°UU¥VIVKVklanLVa@VÈIVV@nk@aVa@mV_@a„K@klKUa@UnKWk@@lU@@UW@@nUWUwmaVIXƒ„lV@mLXblJ@kV@kk@KU@WƒkUWVÅwkLmW@UmL@lUL™KULƒak@maUUÝwUJƒIb›KUUƒ@š™aWK@kUWVkUwVw@™mÝ@™I@wkW@a›ww@LU¥™kƒJ@nVJƒIkVVnkV›UkyUIUl@xWUkaW@@°kz„ŽWxkLUWmzk@@bVVVš„b@‚@XlVœ@Vl@bVbUn™`Wn—@Wb„VVI@`„LVbXLV`mnU@@lƒL@LUŽƒak@ƒLk@WbUJn¦@lVb@xVb@n"],encodeOffsets:[[116303,30567]]}},{type:"Feature",id:"4213",properties:{name:"随州市",cp:[113.4338,31.8768],childNum:2},geometry:{type:"Polygon",coordinates:["@@„@nš`lw„k„ƒ„UmUVWX@lk„@VanUĠ¼V@@mX@@nVV‚VXLmJVLnK@b„V@@J„@VUn@VaVUUUVWVLV@@Kk_@almaVkUU@WVƒVUVLXmmk@wUaUKUV@°™@kmaUaÈmW„mUƒVklaX@lVnxl@@UnaUk@ƒVUVwVK„nš@VVn@VbVJUknUmmVmk_Vw„KUUm™Vak¥@UVKVIkW@UmIVWkIVƒkmmLkwmVUƒ@LƒUU@VVXL@JmLUbmK@UUKmkKUUmVUaUnÇlk¯™mJUnmLUaUJUaWL@UkJ™ƒUƒ@ƒaklkU@¯@KWLUmUUWVkbƒLƒŽUKkbU@WX@JX@@LWJkUW@UVU@@L™Umb—amx@V¯K@¦mŽULk@WbUb™LkVW@kVVxUb@x@LlV@V@b@VšU@L@V„LnšlJVIVK„¦„aVJ@XUŽ@b„LV‚@LVJnXmbk@@bU`VLUVV‚b@V@VnL@Vml@„@VXnWVXnWlXblK@LnV@VVX@VkV@XWK@b„VV@VV"],encodeOffsets:[[115830,33154]]}},{type:"Feature",id:"4209",properties:{name:"孝感市",cp:[113.9502,31.1188],childNum:7},geometry:{type:"Polygon",coordinates:["@@VnXK@L@°lVlk„b„@„VšlI@VXKVbVIVbnKVmnI°šlŽÈkVmVbnUVVlLnVL@VnLVanK@IWKUUV@„V@KV„nUlxnKlnU„lJUXnJ@VlXUJUL@Vl¦UbnšVVƒLUxl`UnnnmVVlnVK„bšmVX@a°Ý°LšaXJV@VUnKVXVK@LnKlLUbVVX@VwVJVn„@@UU¥V@@UUK@ƒmaUVUkkJ@L@K@UmVUI@JU@W@U@UV@ƒUIWmXUVmUUÇ@UVmIlmnmakK@akaW@UwVUkKVnUlKVwk™ƒVU_WKUkVW@UXaWkUa@w@VU@XaW±@IkbƒKƒb¯L@WƒXkWƒ@UakL@UV@UmVUmL@UXWVL@ašUƒVUUUVU@yUUƒIUa@wUKWVU@kƒ™™Wk¯UkwVKƒLUx™K@nVxUlUUWVUmw@wƒUUyXWlX¦WbUV@„U‚@blbUVVbXXƒl@lVL@bk@lxkVVnVx™¦ƒ`UnkL@V@L@Ž‚@@xnL@lVL@VnVVblLXb@‚@zlVUJVnUbV¤™bUnUlWXkJWakxU@UXml"],encodeOffsets:[[116033,32091]]}},{type:"Feature",id:"4201",properties:{name:"武汉市",cp:[114.3896,30.6628],childNum:1},geometry:{type:"Polygon",coordinates:["@@nbnm‚knJVUÈ@@Uƒ¥VknmV@VUlK@IkK@U„W@I„KV£UWVwƒU@aVanIly²kVƒl@@VnIlVnKUnVbšblWU@@_„‚VI@mlaUIn@lKVnUlVVXXšJ@aVLlanbUnV@@K@mVIUaVK@w„w°w@UƒW@UUUkbU@WWX_WmULƒaVU@WkbkUƒV@IWyk¯kly@a@UlL„wUK@I@KÅUW@ѱUm@wl¥kaƒ@@_Vw@ķƒa@akw@ƒkKW£XVUVwVwUaU@VUU™™xWKkbĉx¯k±Uk@U`@bWXUš™x@x™ÆÅIVbUJmš™xƒImƒ¯@ƒ™Umx™nUVVbnJV„@Lƒ@@ŽkV@bVnƒ@UVULlx°VXlššl„V@XUVL@xVb„JVV@zUVVVUV„™V@bUKWX@VnKUVVnU@@VlKVb„@lX„W@X°K„a„Lla@JX²Wb@ŽUV@@xVbXlWb@VUXVlXLV`Uš„lŽUxkLmVUŽlLUVVxX@lb@blL"],encodeOffsets:[[117e3,32097]]}},{type:"Feature",id:"4202",properties:{name:"黄石市",cp:[115.0159,29.9213],childNum:3},geometry:{type:"Polygon",coordinates:["@@VšUVV@VbUx„aWUœblUVmnKlX@bXJVIlVUxVVVIU‚zlx¯š@‚VbnL@x‚x@UVaXK„b˜@Xk‚WU_Vm²klW„XVK„Žl@nXV@@w„mlK²X‚aÞén™@ôÿ@lWn°kUKmmUљUmm@ƒwkImWU@UakL@bVLUVċ@™bUK@alIXKWK@™nXnKmkUVwƒ@¯b@L„lUL±W™n@KULUaW@kL@lƒL@bU`@nUb@bmlU@UÇJ@UUbmKkblŽUULUJV¦¯V@VWI—V@bWJkUW@UbkUlbkV"],encodeOffsets:[[117282,30685]]}},{type:"Feature",id:"429021",properties:{name:"神农架林区",cp:[110.4565,31.5802],childNum:1},geometry:{type:"Polygon",coordinates:["@@n`lIXll@lœl@b°aVklKXaVn@bU`mX@V„V@nmJn¼„V@bÞ@lL@„lJXVlL„aVLV„nVnalV„@VLÈUlblWXIšKVU@J„™š_‚@an™na‚X„m@KmI@mkk@KVkWWw¯w¯°ƒ@UUU@WƒaÅWkL@ƒ¥@kWWXkWmIUVVbm@@bUbmUU„ƒbW@UVk@mVkU@U¯ƒmKVUkaW@aULƒÆVbƒb@VÅ@Un@VƒLWl¯Lš„"],encodeOffsets:[[112624,32266]]}},{type:"Feature",id:"429006",properties:{name:"天门市",cp:[113.0273,30.6409],childNum:1},geometry:{type:"Polygon",coordinates:["@@@K@UlKVm„_š¥UwUmlUkwl@@aUK@k„kWWUaVUka@aV@ƒVUXaW¥Xk@WWIklm@ÅxmI™VÝUkxkaƒ„@bWJaUL@„W@™l¯UULU‚ƒbƒkV™Ua¯bm¤UnÇUkmUšUx˜b@VkXÇal@bVnlJnxŤĀVKXkVÑV@nwlKVbn@n„šlVbVL„a„J@„VV‚UnU„bVKlnXxV@°š„U@KnL"],encodeOffsets:[[116056,31636]]}},{type:"Feature",id:"429004",properties:{name:"仙桃市",cp:[113.3789,30.3003],childNum:1},geometry:{type:"Polygon",coordinates:["@@VK°VškX@@ƒVK‚bXI@a„ƒlblwÞVšUnJÆwn@lkXJ@X‚WVz„V@xnx‚VXUVVVkUw@mšLVw„KVU„@Um@alU@„@@KUƒmIUaVUšmnwmw™mb@aW@UkmKkUkVġkUJWbnU„õ˜@UkmUÅKƒL¯a›VkIk`WnkJƒ@xVLUVVbUbk@WlXbm„VxnxUblbUV™@@VUV@nVL"],encodeOffsets:[[115662,31259]]}},{type:"Feature",id:"429005",properties:{name:"潜江市",cp:[112.7637,30.3607],childNum:1},geometry:{type:"Polygon",coordinates:["@@UbVxšbX„mJVnXVlmVX@bkxVJVLVlXXWlX@@IVl„V‚U—aVwV™lnÈVVmn£°aVbUš„l„aVUK@mVU@Uš@VUkaVamwUwnƒWaXkl@VaUaVUUK@w„WI@aU@@K@_UW™@kX@V±VUbkKWaU@mI@¥kK„kW@ÅK@b¯@UVmI@lmIkVkUWVnšm@@V@n@JUnƒšU„@ŽmlXXl@@V"],encodeOffsets:[[115234,31118]]}},{type:"Feature",id:"4207",properties:{name:"鄂州市",cp:[114.7302,30.4102],childNum:1},geometry:{type:"Polygon",coordinates:["@@°¥WóXmlw„_ŤW„kVaX@@K@U@a@WwU@mWk@ƒULƒWkX±lUnV`XWl—@ƒaWLUb@Vw@wmKUa@°™kw‚yVUJUUVwkUUJWI@akWmLUnkV›aXVƒbUxUVWX¤lL@„lx@b„b@ĸUx@`„@lbk¦@x‚n²VƄX@"],encodeOffsets:[[117541,31349]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/hu_nan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"4312",properties:{name:"怀化市",cp:[109.9512,27.4438],childNum:12},geometry:{type:"Polygon",coordinates:["@@@n„‚@b@XnJ@k°x@aVUnl‚UXnV@@VnJWUJV„nIVV°ŽUbVVVL@Ž²LUVa°V@aV@nm‚UXblLXWVXVmVLVK@an_„`@X@l°„VlXXW`nX@Jmn@b„@nV@Lm`„bUb‚n@VUVl@nIVbUlƒV@LkJUnVV@xVblVUbU@ƒzUKU@mx@xUnn@@WV@lbUb@šnVWXX‚V@VIV@VUnJ@VUz@JWbXllI@VXVVL@ŽVn@„„Wlb@„Žl„XVlL„aV@VJ@XX`„kVwVl@bk„‚bUŽlVXIlƒnLVa„mVwV@@nV@XaVJVbX@lwV@n„@nV@VWnIVVUŽÆ@Xx‚a@I„UUKmk@mVƒ„IXmWUš™VJnUVU@anaVwk™›U@UXa@W™@m_@a¯@@K@UVƒ„bnK@blIlbXa@WW_n@VƒU@¯bmyƒUkUJÇÅ@WU@kWKÅwƒnm°KVkmankVWnXVWV@UƒƒwXkV@mƒ„UlLnaƒVaX@VUn@VnVK@xlnXWšU@a™@@klak™Vw™mUaV@™wmIÛ`m—@mVUXmlIXƒV‚I@K@aU@UaV_UK@wkUmmUKWXŽmVkUƒL@mƒƒU_nK‚™@aVU@Ukak»@U™™@ymUƒ„¯™ƒUUƒVKkam@™nka@ƒmwkLWb¯mkaƒ_VaVKUƒ™IUw@kKmU@WK@UnƒmaULkU@wUalWV¹U@@WUI@WU@‚_@W@U@mƒU@WbbUK@Um@@UmbUwWWkk@WU„a@anUUwlWUwUU@wlJVUnnV@@mnI@m‚K@U@w„a@wUm@_mƒVUUaVUkƒƒƒ_kċUk™VWLƒ@mlU@kn¥W@UwUWV@VÝU@lXLWVUbVLXlVIl‚knmU@VUJk@@„ƒ@™kVmwmVkxU@@XmVUb@xnKVLl@VxUxkIU`@bWVXX@JWL@bkb„¤@bmUUU¯Kƒkmb@V™VU„VVn@@„Vb@`lnœxmb„lUn‚bk„@xU„mV@bmWbUV@VJ„Il@nVUb‚K@nn@VbnJVIlJVkXJ@X@lmx@bnnWVXJWXU@UlU@mk@@llb°x„IUbnJ@VWbXVmI@JVX@bk‚@bWL@JUXUK@U@Uƒ`n@@Xm@XVW@@nX@@`ƒImxU@@JUI@KƒLmK@UÅUUV@VW@™¯kUU@UamVUUmJ@n„xmLKƒkmJkwkKm_mKXU@aƒU@b@Wk@ma@zUJVUmbUlU@™xnXlWlXXblK„¤V@@nUVVLkVš„l@Xb@VVK‚nXKVx@znW@X‚@@lVK@X@JXbWbnn@JUamLVVXIVxnK@aWUX@˜x@VnI@WlI@anV„IVxk‚l@lbXXšxVVVJVInbV@@ln¦ml@XXVWbkJWb","@@XLVKVXVKUa@UUUmV@l"],encodeOffsets:[[112050,28384],[112174,27394]]}},{type:"Feature",id:"4311",properties:{name:"永州市",cp:[111.709,25.752],childNum:10},geometry:{type:"Polygon",coordinates:["@@lxUXV‚lXUVnlVĢ„JVbUXVJV@XUW¯„VIUK@klW@Un@„nl@V`XUVL@l@šVx@„XXW`UnUbšxUlVnUšV„lb@VnJšUVVVInJlUšVnwVklKnw„LVJVšV@nIV@nbVa@KVVVUUa„KV_nVVJ@_VW„nV@n¥lI@anƒl¥X_VKlwVlULUVVVš@šU@VXL˜ƒ@IUmn@VU@wmKXUWU@m²šl@VIXWWkWUkWlkIVamUXamUnmWUU@@Un™lK@XJl@kVUk@mWKXkl@@aVU@UVWUUVa„In`VUVLnw@U@K@Uƒƒ@w@UVmUUƒ™°K@UnV@bV@Xk@KVm@amk„aU£VWUUmUUwm`UbULka›KXU@kVmU™@aV_UWVIn@˜y„XXK@klmV„V_kWVUn@WUU@UƒmaU@™wnwWanUmmXkƒam@UakLmK@b™xUUUU@Km¥Vaƒ¯@ƒkUaVUlm„UU@mUUÇmUk™Uyƒb™bUa™XUWWbÅLmL@V™aL@WWXUKmmk@a@UUK™XW¥kU@VƒUkxmVkUWbUJnVJ@nVJXzWxkŽ@lVbUX@VVL@`mbUnšŽUn™VV¼k@Ulm@mwLƒb@lmLUK@UamƒWkƒK@£Ua@ƒ›UkJkUmbVlkX@bWbUŽVŽnnUVl„@bšbVK@VX@lb„V@nU¤šx‚²„Knblb@x„V„ô@šlŽ@b@l@XWxnVl@„VV@XLVl‚LUŽUXV`šbXXmJU@@bm@UUkLW@UlUKWUUb™wUm™L@nklVVmVXXm@@bUKlÆn„‚XkllVUVVL@nUbV‚@V@nnV@xUn¯U@JW@UX@xĉ@™`m@@LV@b"],encodeOffsets:[[113671,26989]]}},{type:"Feature",id:"4305",properties:{name:"邵阳市",cp:[110.9619,26.8121],childNum:10},geometry:{type:"Polygon",coordinates:["@@XIlJšI„VVK@n@VVVKnLVwVmnLVK@U„@šw„J@wVIƚ°X@ÜȄUÈxll@kn@VwVaXJWXn@@WVL@UUKVKV_U@@aVK„x@U„aV@lk„@XylbUaV_šVnal@W„U@a„I@aV@@aVUl@Xm‚UXWaXml@@kk@ma@V_UnUV™UUWJUa@kkaWLUmk@@LUVWUkJWkK@¼UnWJƒIkV@b@JUIm@Ul™V™m@Uw@a@kWƒXWKUknW@ƒWUU@k™mx™UkVmIUJUU™VmI@UkaUƒV™UmVk™wVaVmX_WW@ƒUw@™@kUKWVU_k@ƒmm@@VkX@lVLUJƒX°WVU@UIVWUaƒIUġmkVUkWUVWkwWXk`mI@¥kUVƒUƒUn±@m›XkWknV„UVmmU@@XƒVƒUk`@Xƒƒƒk@¥¯»mbĉó@mkU@kU™ƒƒ™KmX@˜UnmL@lULkKUƒWUU@ƒbUaUnƒ@Vb@l„¦Ub@l™@UKmnƒKUnl„UVVbUVn„@`Vn@xƒb@x@VL@nmJ@nU@mmUVkI@xVVVxkXVxmV@bƒbXVl@Xl‚XVxna@Vn@@VVL‚aXaV@n„‚@@V@X`V@@XVJ@XV@UºkXVb@xlVVKnbm„@VXLV@n‚lL@VxšJV„ULUb„`lb°nXalKnx@„lbšmn@lbULV„„V°š„ƒnV@zšš@Vl¼lb@VUV@bšmLV`„„@n„KlVnU‚XWVLnnlV@xVLU`VbV@"],encodeOffsets:[[113535,28322]]}},{type:"Feature",id:"4310",properties:{name:"郴州市",cp:[113.2361,25.8673],childNum:10},geometry:{type:"Polygon",coordinates:["@@²zVaVlnVl@nšVk„Jl_XJlIVmnL@mV@VXn@lV@‚XzV@lyV¯²U@UlJ@XVKnVVIXl@UVLV`@n@J„I@mlI„KVLnUlVUVVLXašKVLl@nb@ŽW„XV°KUnVV„L@xVJ„L@b@LUVVVU„˜VXbmbVbn@@lUbm@x@XVVVŽ@@˜@bkImx@Vm@Xbƒb@l°XU¤„a‚L„mnL@bl@@™VUX@VxnV˜anLnƒWƒ¥XKVwnUWXmVIUWÆLVx„L„w@wVmlU@¥XƒWUkwlÇn_Uw„WV@VU°wnU—ƒy@aVškVlnL@lVn„w@VlJ@b„X„x@bVKnb@U@WVUl@@Vnbl@XLlK@aVLVKnxÞn@a„LlmUaVU™ƒm@ÅknUmaUKmVk@m™kk@UlWUkVm@w@kUU@W™U¯™¥@w„Ç@aVIlUV@kUWU@UUm»@k@mKVkUKUwƒaUaUa›@k„kUWJkImaU@UK™@maUzk`@zƒy@XmJkL@UUJmUkV@z›@kŽkVmK@¦UbWL@a@UbmKmwUK™Xk›VUUkmVkw@UUKmL@WUIWa—JW_k@@WmI@mk@WkWULUUVKUUVm@šU„bš@‚nUǃ@U@w„™V@Ua@aƒL@ak„›l@k™UƒJƒwó@@L@V@„™`@œƒJ@xnn™šmV@bkJmUó@ƒn—JW„UUmƒU@UV@Lk„WlnnmVXbmxšxV@nbV„V@XVm@UVlXU`ƒUŽkn@lWLƒW—zm@UJVXU`@bVšUn@lWVœLlbVKVan_VxnVVVUXV¤ƒbnl@bUn@LWlU@@amU@V¯L„šVVUn@V@x„„@V@L@VmxUKUVm_ƒJUbVV"],encodeOffsets:[[114930,26747]]}},{type:"Feature",id:"4307",properties:{name:"常德市",cp:[111.4014,29.2676],childNum:8},geometry:{type:"Polygon",coordinates:["@@l™U™mkUwUyV™@VW@¯Va—VmUU@KVUVUVLnaWƒnkUÓV_@mVU@݄w@ƒka@kVmƒUmK@IkaUamKkXWaUW@WUk„™@@KVU@aU@™L@J@XÇVUKVak_mWkLWakVUbmLUUmlUVKUU@kUWW@UImJ@xkLkKm@@Xƒ@ó݃@UUk@UKƒV™ƒULƒKƒXkWWbkaƒIUƒWU@mUk@WLaUJġ™ƒ@@XÈÆVIl‚„Vnz°aV@U„m@X`@XWbkakJ@amLƒaU„@V@L°@@bn`š@@XWb@VœVlšUxmb@bUVmVUI™šXVWnƒJU„@nnlVLƒV@JbWzk`m@UVK²V‚x„k„LVl„@Vn@V„„°xVKVkœVVlUblx@bU„‚Æœ@@nVnUll„kx@VW@@VkLWxUL@bÝ@kKkVõV@bkXVVUVƒ@ƒVkUkV›LkV™a™@@™ƒ¯xUxmX@JVb°WXkK@Vm@k„Vb™bn¤‚xUXkJƒblxnXÆK²l‚_@Wnašn@ŽUL@b‚JnIlV„@lUœ@@¯ô@lWȂIVKVm„U@aXaV@lwVXn@@K@UVKUUnU‚bn@lWšX„ƒlJnUšLšKV@„„l@²a@UlK@aV@naVX„WV_nKlL@KUm@a°U°@VXL@a@wWmXal@„k„@VLn›V@@bl@VnX@mwVa²aVU@mk@"],encodeOffsets:[[114976,30201]]}},{type:"Feature",id:"4331",properties:{name:"湘西土家族苗族自治州",cp:[109.7864,28.6743],childNum:8},geometry:{type:"Polygon",coordinates:["@@@KšL@wnK±nƒnm‚—@WUk„ƒÜÈn@n»@mVamk„mšU„„l@V™nmmU@wUan¯VKšLn„VWlInyWUœI@WWk@KXU˜n@mnUmU@WœƒmkV@ƒkXašaVaUm‚Ikƒƒ@kaƒX@ƒUm@UKWU@UkJWkXa@IVy@UmIUVU@UJU@WXWmU@™VakaU@@Xm@Vm@wnwV@VL„yV@VakUUa@wUUVmlI@K„UVkUamJk@VU@UmVaƒan_@KmUƒ@@anm@ImWX_WWUk¯ƒ@k@Wƒ_m`@bULUKUnUWWXkKWaVmnU@@b¯UUbVŽ±K@UKUUVa¯UUmJUƒVIXmI@UU@WmVmkUV@b¯w@lmI@W@aƒ@m¯LXbmJVLklWL@V@XXŽmbVVU@@VU²Ul@VlX@bš`Xx›zUmkUVÒlŽ@bXLWxXVlš@V„bkLma@nmVmULVbmVUb@lnzmbUÒVl@°nLV„lJkn@bmJk_ƒVmmkblxÈx@LUb„xVb@V™n@JmLVŽUš@„nV@¦VbnJ@lVVbkx™bm@UxVLV@n`UnVVV„kl°z„xVb@VU@@ÆlXnWm¦nbVK@XVVUVVl@X„KUV@nVL@WnIWŽXLVKVLlxUbVKXVWbn@@UnKVLVb„JšU@aVU°b"],encodeOffsets:[[112354,30325]]}},{type:"Feature",id:"4304",properties:{name:"衡阳市",cp:[112.4121,26.7902],childNum:9},geometry:{type:"Polygon",coordinates:["@@lšV@XV@„mXVlXL„W‚X@l@bVxn@šŽšUVkn@VJ@I@alU„JXIVm@»‚LXllIXVVU@Kl@VnXKlb@lVbXIVVUšmVVU`@nbl@@lXLVVVKVbnXWJ@VXbWxXb„Ul™VK„¦nLVVUVVbšb„K@U˜LnK@Un@VxlUV`UnnL@VVL@JV@VUnxnKVbV@@VšIVUnJUVUl@nW„XllIUa„KVbÞLV¼²`V@VIUwlaVmXa@IWanK@U@m„kVƒVUVaX@lšnaVLÈ@‚¥@kkJUWJUaƒXkaUm‚wVXJ@_lWUU@¥n_‚KkamUK„™@amKƒnKƒbV£¯W@k„aWan@@UnwlJ@a@—@UUU@W‚wn@Va@km@UanaWa—UVƒUUVU@K@aƒKUI@wƒKUUVm¯LWUXƒ@mak@UK™LWbUKVUkUmVUKƒLkJ@nƒJ@I@mU_UK@VWkUJmUUL@WkI@V±VU°kzU@Wy@kUm@UWU@@nmKUnkJWIk`ƒIUlm™k@mUUkUb±yUX@VUV@bk@WlXL@nVlUl‚k@WI@ŽkLmš@VV@XVmnnVWbnVUblJXkVl‚XXlWXUJk@±™@nXVWVnL@xUVm@Vn@J—„WK@U™V™@UUVUVKUkkxULW`k¦m„@bkJm¦U@ƒmUX@`UImUU`ƒLVbUVUU@LUbmaU@mJU@U™UIƒKmxkLUl"],encodeOffsets:[[114222,27484]]}},{type:"Feature",id:"4306",properties:{name:"岳阳市",cp:[113.2361,29.1357],childNum:7},geometry:{type:"Polygon",coordinates:["@@@wUklmUUmU@@UVm@wUaV_mmUKmwkIkJmUUnm@™™@UUƒbUKUƒmÛamm¯xVLkbÇƃUƒVUzkVUlƒUUKWLX¦W@ƒVUUUaƒKUbmLKm„@akU@aƒmVaUUVIVWkk@wkƒƒ@@xmLlmÅwmbVlXlÝIWVkK@kkVƒL@VWKU@Ublnaƒƒm@b@bšnW`@XUJk@UUWKƒk@UKƒnn‚@xmLUVm@kbVbV„nV@V„b‚@KnV„LWšXŽÆVĢ¦VblŽš„n„UJWz@ƙVóUVbkV™aÅx@¦lVUbVVknWKƒ„k@ƒwƒK™VU„Å„ƒl@zkb@`m_mJ@xX„mbVbœ@llV@n„@llbXL˜UXalUšl„alVnwnLVKlšVbX@@I„V@blJ@bVL@VVVUXȤ‚VnkVÑXmlbnš‚„VKkÑř@UmaVç@±XUlI„xlV„@VaX¯lUVVUšVJn—V@°°nŽ°„Vxĸł°¦šb²¦lJ@U@aUK@kUm@_m±VIXal@„Kl@„bV@K„K@k„m@UmUUaƒK@_UJƒaXU˜@Xmš_VmUk@WUk›@kU@a@m@UƒaUUU@al@ny‚XXWWwkly@¯n@@bnV@k@mVI‚„œVlUUmlU„JUw„I‚bXƒVaUal@K„b@ƒVKVkXVl@VkUU@ylUœVVaVL"],encodeOffsets:[[116888,29526]]}},{type:"Feature",id:"4309",properties:{name:"益阳市",cp:[111.731,28.3832],childNum:5},geometry:{type:"Polygon",coordinates:["@@„ŽÆxXL@l‚V„@ĢšVI‚bXKl@nVV@„XVŽ„JlbXalX„W„LVKš„„UVLl@VV„@ôބ@@Wn@lLlK@wnIVJX@VX@lVVUL‚VnkVVnKValUXblKnXl`UbVLÈU@W@IšKV@@bUV@Lš@lƒXV‚@VXXblWnLVblb@JnL„VUn@llb@„ƒx@ÞUV@nU`VÔmlX„mbUKUVUV@LVVUn˜ŽUb@°UXš@U‚VzVxnlVškšVnlVnaWƒ@wnIn`@_la@y„kƃVƒšU„L„xl@„ƒXLlmUUVakU@¥ÆwšblUUaôVšU@ÅXyVImƒ™ƒkUaġ¥ÅUWX™ƒKmU@Lƒa@UmUUƒUalan@VUnK@wm„m‚L@V„lXLVVl@VI@WX_™m@a™¯mKUkwW¥UK@_UWWLUVkUWL@WUIkVƒU@JƒwkLUUmJVI@WkXm@VmkKUIU@mmm_@VUV™@™„kJċwUU@KUWkkW@IWW@km@klwkWVkkU™V¯m@kWLU`mIkmkXm@@`@L@xUKWkU@VL@JUU@mbUKVa¯WVnL@`lXUVkU@xW@UbUWVU@UJ@„lnU@m‚nÈmVƒa@bUL™wUb™@@VkxmUUƒ™UV›K@IƒUƒmk@akm@wmIƒŽkK@b™VWXkm@wULUmm@UVW@Ub„mbkKƒVn„U@Wl„xV„U@UXmWUXmlnbUl¯Lmn"],encodeOffsets:[[113378,28981]]}},{type:"Feature",id:"4301",properties:{name:"长沙市",cp:[113.0823,28.2568],childNum:5},geometry:{type:"Polygon",coordinates:["@@lVUllXkx@lln@‚XX@JlXXl‚V@LVVČxlIšƒš@VU@Un`nnV@VJlLUnn@lW@XUJnIVVlK„x@I„VlUVJ@XXKlVVUXKVX@`VLX¦lxVŽnLš°‚an@„„‚bkmVaV@XL@U„KlU@llLXUÞJWkUknaÆxnŽ‚knK@w„@l„@xllUXUJVVUb„n@blV@bnƒ‚LnKVa„LVbVV„UX@W¥XKVL„VVklUVy„U„VÈÅlaUK°wnnÜbn‚V„VL„aVVš@šn@VmnVlIlJna„@Valkn@na@amwm@„UXw˜K@aUUVUUaVa—wWK@kU@UaW@kKUUƒƒ@k™W¯XWan@k„™mmÅ@@I@U@KmLkaVUƒKkLWVUƒk@UVmU@am@kkk¥ƒUƒVUK™„maUb@ŽUb™I@aƒKkkWm@W¯K¯b@VmaULVxUXlVk@UxVJVbUb@xULƒ@ULWW—LƒĕmxVVL@šVb™KUwƒaŲWwX@@WƒUWLU@VbkV@aU@@VUnmJ@VUn@VƒLUK@U‚mUIk@UÇmU@@UW@J@LƒbUmVI@aUmW@@bkXUx@lmLUbm@UbkJ@V@XmlUbkKm@ma@kUaVU@aUK@mImJUIkVƒUƒVUakbWwka@UWKkLUamKUXm`Å_U˜ƒULmaU@@lUV@X"],encodeOffsets:[[114582,28694]]}},{type:"Feature",id:"4302",properties:{name:"株洲市",cp:[113.5327,27.0319],childNum:6},geometry:{type:"Polygon",coordinates:["@@X‚‚Unw„Ė˜KXXVK„@VK@wVaUaUIVwl@kUVWUwVKnb@U°a°LXŽ‚@Xnll„L@bšJVa@VanbšƒVL„U„V@al@@UV¯ÅÇ@Ummk™w@¯ƒyVwnUVVVUkmWV—nKVUƒa@WXkVKn@lUVU„VVVXIlV°VnI@VlKnV@mwVm@LXKWkU¥wWwƒƒ@k@m„X@KX¯V@VUVa@VnKWkœƒV@VUkm@aWa@wkUWwkmV£VÿXUVL@mVIXaò@nW@ašUš@@am™@aUU„UmXmWUk@ƒƒnUW@_maVm™wUkamaUL@aƒwƒW@akI@UƒxUm@kmKUk™lUŽ@b„zV˜m¯xUVU@ƒXVxm`kÈlxXVW„@¦kVUn@xƒxƒKUwÅKVXUJWnXŽmVUxWL„¦XŽm„mK—bmUUwW@UV@šk@ƒšVLnŽlbLm`@¦VVkX@`WIUŽxVnlb„WVbXIV‚lI@l¦Ç@UKmbk™W@UbUVU„ƒl@n@VmLXb@JWbUnkbVxUJUxWXXlWL@V@V@XXJWx„zUVVVVKnXW`@bkIUl‚„nLVJUbUIWVXlWV@XklVbnn@xlš"],encodeOffsets:[[115774,28587]]}},{type:"Feature",id:"4308",properties:{name:"张家界市",cp:[110.5115,29.328],childNum:3},geometry:{type:"Polygon",coordinates:["@@@InWVw°wš„@š@šblUœKlUlV„U„@VUUUlW@aöUlUlLÞ@@aVKXwlK@UX@@UlwkƒVkUm@m›@ÅVƒ@akwVaUk›UUlUL¯wƒƒ@UUmƒ@UkƒKƒlw±UULVn@l_XyWwÅ@VUUmJUXU@@mmƒU@kxW@UaUIWbU@@mU@UxƒnUbmKk„WJkUValƒ@aUkUxƒlW_@WUIU@ƒbkKWUJVnUb™bWb„lU@nl›„@XnVmV@n—mWV@LXl@X›JXVmzkJUXmƒ™KULm°Vb@xnVmnUšk@ƒƒ™VƒnnlUb@nm¼m@Ûǃ„Vl@X˜mnm„²ŽmL@x™K@LUl@nULÆx@V@VXVWbXX˜l„@nLlm@bVKœX‚W„L°bnUš@VaVUš@šmšVw„JnwVK°zn@V‚Vb„a„@Ċ¼"],encodeOffsets:[[113288,30471]]}},{type:"Feature",id:"4313",properties:{name:"娄底市",cp:[111.6431,27.7185],childNum:5},geometry:{type:"Polygon",coordinates:["@@lL„nJ@xln@bnlV„‚„@JœLVUšŽV„nVlw@Uš@VašxVK@a„bnUmÇnV@km@ƒ‚I@VUVVXVaX@@wlVVUkW@_mKXU°‚UbVLnaV@‚V@IUKV@XlVL@w@K@_n@lWlnnJV_XK@l°nšU@WVU@kV@nbVK„V—lƒ@nLlƒ„LXU@ƒlmkw@nW@UKVa¯IVn@@aVUUKl@nXVKVn²a˜ŽXblKnLlmVI@KUU@akLUaVa‚UXm@aƒ@wVUVKnLnWlXl‚n@@U@anUVm@U‚Inm@IUK@UmKVmU_kVUwm@@VmL—K@VƒL™aUaVUUUmKƒ¥ULkšƒVWaXwWa@UXImWUaULUUWKk@WnXbWŽVWnk@UV@bU@@bƒJ@bƒV@XkŽmb™UU`VbkaWzƒ@klU@ƒb@VƒwUL@bV@U`ULVL@VUK@Xm@XWWIUbUxm@@lkkÇwƒVÛÇW@¯Å™UJ@xƒI™xƒ@@VULmKUnUxmKULUUm@@‚ULƒU™JkIWJ@b@LJUW„kJWnUV@nn˜Ü_nJšxU@VbšnUxlškb@lš@"],encodeOffsets:[[113682,28699]]}},{type:"Feature",id:"4303",properties:{name:"湘潭市",cp:[112.5439,27.7075],childNum:4},geometry:{type:"Polygon",coordinates:["@@Æ`n_VWnLVblKXL@VlbXxlaVb„U„VlUVJnInJ‚@VL@bUVVb@lnbn@lLVank@W@UlIVan@VanK@kVwlW@aX@Vn@bUJVn„a@K‚IX@@VV@nŽVÈl@VJn@VVL„K@UVm@UnIVm@UV@@blUUaV@XK„V@XW@XxƱ„bVxšLUa@™UKWk™@wmmUalk@WXUWkXUVJVaUImKƒVklJ@aX_mWULUUVUƒyXwWI@W@U@UXKWkXWVwU@±_U»ÝKUaƒLVbkJkƒWmXk@UVVŽmIUV™J@UU@UamLmwUVU@mnJ@VUnmV@b@Vm@kkWmXmKULUV@x„Ž@bWnVUbVblK@bVV@LUJknmKkLWa—±bUmULmWk@VLUV@bm@U°JUbVLX@@mlxkn@„WVƒKk„mK@k„"],encodeOffsets:[[114683,28576]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/jiang_su_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3209",properties:{name:"盐城市",cp:[120.2234,33.5577],childNum:8},geometry:{type:"Polygon",coordinates:["@@„n@‚°ĀÞ°@¦ULWKkx@bkLWb@lUlVXXJVbƒnUKmxXV@bm@@Xš‚„LޚܦXlVnš‚mzVJ@n@‚²ÞôkƃÞaȰĉ‚wnljÜó„éVÛnĊīČlj‚ĉ@ō@KÞUlU@ƒkklÇÈњÑlġXɛ@UġƒƒaU@U_ƒW@n™@kaUL@VW@kKmkUV@bkbWW@bkzma@ƒJWI@KUKULƒ@U¦™`@XUJ™U@KmXƒw¯KXkmy@aUIWJXXmV@K¯UU@@bVL@¤VLXbV@@JVXVK@„„JVn@bkKmakVVXUVVVlI@`U@nzVVƒb@¤n@@UlKXLVVšI@V@nV@V‚@ÈUx@šóVōšƒkÅWó@mU@bk@Ýwk@WbXxm@@J@zV@kVƒbV‚nLWVUX™WUXUŽWLUŽ@Wl°z@VkxU@UVWIxWJkbƒĬ„nW@@bUl"],encodeOffsets:[[122344,34504]]}},{type:"Feature",id:"3203",properties:{name:"徐州市",cp:[117.5208,34.3268],childNum:7},geometry:{type:"Polygon",coordinates:["@@XKVX@WnIVx@K°Lnll@@I°K„nVašU°x²mlxš@VanU@aƒk@akmV@@w™@Ua@aUwVwUw@w›@UK@£kaĉlóIÇVkŽ±@@kUKmVkIkxW@Ua¯UUm@UVI@WVI„JV@ƒ@Um@Uana„U@m‚I@J@XV@XaVlkXƒVaUUWLUyVIXmWak@ƒXkJókƒJUL@KWkk@ULU@Wa™lUIkJmI™mk„VbVš@lV°kXUKWKULU„mb@VUlVnƒb@VV@IVKUUmU@ak@@bmV@xklƒUƒU@UKmV@nƒJVbkXƒKUamLUJ¯UUVmI™bVV—Ll`@LƒLU`m@kXUVU@V„lxUK@xkIWbUKƒx@V‚kVVn™b¯@@U™@ƒxk‚mbkLÇK™b™@@XnJ@LmVklƒ@@XƒlUƒVkxƒakVVb@bVnUbU@@x˜VUšVb@š„ŽnIĊ`šXVVôJš_„K@xlU²Klk„U„@VaVVÈm@kVUVmnamUUaVƒXIVJ„@‚ç@¥nkVLn›„@@XVK@VUX@JVUV@UnVJVLUJVLUVlšnI„b‚KnU@m°™VanI@anV‚KVL„an„lK„blš„KÞk@¦@¤@„VKnLVK„L„KVzlWšLX@VmV@VbnU°@Ualk™˜WXLVU„KWkUUWšƒ@£Wa"],encodeOffsets:[[121005,35213]]}},{type:"Feature",id:"3206",properties:{name:"南通市",cp:[121.1023,32.1625],childNum:7},geometry:{type:"Polygon",coordinates:["@@VJ@bnzWl°L„xnW@LšVVI@Wš_V¥„@VKVL@LXJ„I‚@nbly@aXXla@aVUnllLX@@UVKlbš@@m„XV`V@„bĢ„lkČÇƃȘ¯šwnĕVĉVÿšUƒUĠƒŦğlXÑVǵ@±ōLʵĖ¯lÇbÝÞ¯xk@Çkķé™n¯@ğŽġƴǫ@kVVlUbƒL@xULǂóLUl¤@nkVV°VLkxVb@l™aUXUKWĖklVX@¤UšƒUkb"],encodeOffsets:[[123087,33385]]}},{type:"Feature",id:"3208",properties:{name:"淮安市",cp:[118.927,33.4039],childNum:5},geometry:{type:"Polygon",coordinates:["@@šnźUôÒɴ胚l¦nĖV‚kbmš„X@xVlVL@xUb@bUJVnUx‚šœ„lKVLÈx‚m„zXV@lW@XV‚b@bȚVxnb‚ƒVIXa°L„aÆVVaXUlK@aXIƄVlXKVUlIXalK@alwXLVK@¥Ý¯¯ÿ@ƒmVk@aX@ƒm„īlaXI‚wXJVUV@lw@U¯yb›UaƒUġUÅaUKVknaġm@kUm@wÆIV±nLÆw„ÇnUUkƒ@ƅÝU¯JÝI¯¦Ul@bƒ@@VVL@l@LƒLÅmƒL@b™@UaVaUWmLUKV¹KƒLWKX¥WI@mXk@UmaUVUU@VmL@W™bkIUWƒUmVóIkbmm™@UbVLUxmJkU@bkJWbnXU`Wz™KUÞÈlVb™Lmx@„kè@Æ"],encodeOffsets:[[121062,33975]]}},{type:"Feature",id:"3205",properties:{name:"苏州市",cp:[120.6519,31.3989],childNum:6},geometry:{type:"Polygon",coordinates:["@@ôèĊVnX°¤²„lxƒÈÜ@²x@J@b@X‚`nIUƙUUV@bl@VVnL@L@xƒJ@X@blJXnW@@`XbW„kVƒ@UbVxƒXUxkV@LóxVbUVWš²šVJĸklUǬ@ĢƳĠ°@šmƒī°»ÈÇ¥ULUU±a@bU@¯ƒU@KnImUVWUk™mXUVU@lIVaUUVWKUbUkWKU¥n£WakJUkUL›K¯L™KkƒVIn@VaUƒVUUƒ›UkVk@ƒU@amUkJƒ@UUlwX¥W@@UkVmk@JUakL›@kk¯ÝmJUn@nmVXlmbVVkn@„UJ@±WUxV¯a¯KōbżÇxUxƒšUUlWL"],encodeOffsets:[[122794,31917]]}},{type:"Feature",id:"3213",properties:{name:"宿迁市",cp:[118.5535,33.7775],childNum:4},geometry:{type:"Polygon",coordinates:["@@XbWnUJVzXKVVUbW„klUWbU@@W@IJ@nƒVmbVbn@@V@„UŽƒIUJ@XUJ@VVn°VVbX@lwlJnUVL@l²@lÈUôJĊklb@¤VLœ@@xVxUxVx@bVbš@@xU@ln„mnX˜mXLVmV@X@lxVnVJôL„LXa‚x@b„@@KVL@bn@@m@™@alLUUVaU¥nIV±‚I@mXI@aWWXU@LlUXWW_XWmaUwǙ@aaWUX@@kWUƒynÇwUKkL›ƒ™VwUmVI@aVa@wUKUk@wƒWn™laUmĕk¥„™ɳçóÑŹV™mmzkVmm@a@Ióƒk@@LWU@`—„WbXLWlkImJVn@`nXVbXŽmL@Vn@‚l@nUVl°Xx°U@LVĠ@z°˜@¦UV@Xn@VJmV"],encodeOffsets:[[121005,34560]]}},{type:"Feature",id:"3207",properties:{name:"连云港市",cp:[119.1248,34.552],childNum:5},geometry:{type:"Polygon",coordinates:["@@@‚lzXxmÆV„„@@¦„@l`XnlKšXXm‚KnLla„b„@„xmbm@kL@V@Vl@@VUXšJX„mbš@@„°Æ@èÈzlW°XĢJlÈ`lInbšWV_@mš™@UUķnƒôw°ÆmnaVƒVÛVmĸ»Ģw±Ý@@mUIny™UmWkۥݙƒK™@Wn@@aWUnwVL„mUaWIUWVk@kkJUVWLUkŃWJ@bkLWVUbÅUƒb¯KWbUJ„WXX`WXkV@KWVXX@bWJ@nJU²mJV¦UbVVkK@b@š@nm@@aUK@Lƒ@@awWbƒKóKUIUmkwW@U@UnWK—nmWƒn@b„l@bmVUb™@kw±n¯w™VUb"],encodeOffsets:[[121253,35264]]}},{type:"Feature",id:"3210",properties:{name:"扬州市",cp:[119.4653,32.8162],childNum:5},geometry:{type:"Polygon",coordinates:["@@VUXblVVV„b@xV@kz„V@l‚wVLUbVV@VU@VbUbl‚b@nkĶ°IÞV@Ɔ„VlmVƒÈÅxmKU²ÅJ@xVn@lĢnmbUlVLÆbĢV„V‚bœV‚aXk‚@VXKVVWšXVWXUmKU„aWaU@™¥@£XW‚UUV@@ynam_VWkUVUna@ÆV@mnkWmXkWU„W@k„@@akklƒlWUI@UnKl¥™I@VVma@a@I@U@a@anK@UmK@ÅVUnJl™kI@aVwka@mVIUW@UWL@WÅbmIƒƒULka™UWƒUxkLUKWlXL@VƒImƒÅVƒU™mĉL™Uól¯I±l@ÒUbVbUVVXUJUnVV@lnbl@"],encodeOffsets:[[121928,33244]]}},{type:"Feature",id:"3201",properties:{name:"南京市",cp:[118.8062,31.9208],childNum:3},geometry:{type:"Polygon",coordinates:["@@k@ma@kUUVmVIUWVUUaVa@Ѳk°Jôk@Wmk¯KmX¯aUakKƒƒWU„@XU‚LXaV@@mUaVUUl@VmkaUXm@ƒWUUna°IlmV™m™IUW‚@Uk@@aV@VVX@„V‚I°»nm„U@VKVan@m»UaU@U_@WlIUa™aVaUala@¯n@‚ƒkaUkUUWKU@mwkUUmmL@K@ƒLmUUVƒKƒVÅImU—JƒƒVkVVLšèVLVU@W„L„V„š@nVÜULVŽUL@bW@XbWbkJƒUUVUxVXmVk@WUUkVmIƒV@„nbnVWbƒJU„kUULƒa@Jma@XkK@VVL@L@JƒLUVU@V¼ƒnXlƒbm@kbUKmn@lVb@VXXV‚UV@b@LVbÆxXbl@@lV@U„VV@XVK²VlIš`„UbVbUlVVn@WXn@@VUV@„@KmbVLXқLkKƒV@nX@VVUV@b™nVllbšmnb„IWVXU@`lLlknVnmlLlbUmVInK°nUƒU@l@VU@Vn@„ƒ@alI„`VIXaVaVa"],encodeOffsets:[[121928,33244]]}},{type:"Feature",id:"3212",properties:{name:"泰州市",cp:[120.0586,32.5525],childNum:5},geometry:{type:"Polygon",coordinates:["@@lUU@@y@In@WwXal@Þxl@@anVô@ÆX„lŎ™ôU@™Vw@ÇUU@@m@U™JUUWKkL@Vm@@£„aUUmyV@@_kJUUVUUWlUnblL@aUmƒI@ƒULUW@IU@WaUK@£UK@aV@°V@LnUWWXIla„VV™@£UWlkXĕVLVWšb@kUalwUKU¯lU@mk£VôKȁVK@w„KVaUkķlUI±™ğ¥ÝUŹš™Ž¯ôm¦ƒĸ™‚@XXK@VVXUJ@nlbUx@blJkšmIUV@ÆnL@VmL@b@b@V@J@bnb‚U@UšJk¦mL@VVJkXk„ll@bƒ@@lƒXXVWlXnml@nÅU@ŽmbUVlVUXn`mb@zU@V‚VWX@¤š¦V@Xb"],encodeOffsets:[[122592,34015]]}},{type:"Feature",id:"3202",properties:{name:"无锡市",cp:[120.3442,31.5527],childNum:3},geometry:{type:"Polygon",coordinates:["@@nLƒÒlxUVkL™am@™ƒkVWUULUxVVVbUV@bVLU‚nnź™ÞVĠ¦X™VUUaôw@KlUVw„WUwVa„@lUXƒWa@_X@WmkI@a@W„I@w@KmKUUk@@aVUšVVÅmJ_@W@a@I±wÛ@ƑÇkw±ƒ¯£mWĉUóçƒK¯VkUWK@XkV¯UWabƒmUa™UUb™lln@b@xƒbXŽWX`@„VxUblL@bn@Vb@`m@XbWnn@l¤„n@xnVlU„™VLÆWœkV@VbÞJ‚_nƒl@nKVU@aU™U@mVk°WVLUV¯bVXŽ˜bXlVn@VmL@x—V@bl„š‚@œnW@X@VVJ@²VJVU"],encodeOffsets:[[123064,32513]]}},{type:"Feature",id:"3204",properties:{name:"常州市",cp:[119.4543,31.5582],childNum:3},geometry:{type:"Polygon",coordinates:["@@„L˜ŽnxUbVVƒL@xnnW‚nn@VVXn@‚yœImx„„°ƒšL„a‚¥n@VkšKVw„W@nX„VJ@b‚@UVn„ƒ@UnUV@L‚b@`VLklVÞn„Æ@VaXLl™ÈJšmmVUK@aVUUaUUVwVKXVlUš„n@šblKVUkw„ÑmKUVUI@±UI@U@WmX@›™kƒ@a˜U@wnK@UUmWk—aWU°aVUUK¯XUl@nVŽVš@bUVmLk@m„`ÝIUaU@›lÅXUKƒškVmU@wƒmk£m@XmWan@@_Uam@@akKVaUw@ƒW_XW„a@w@akmm@mL@UJmnUKƒ@@XnJWLkKUb@„Vxk„WƒL—aWVUImVULUK@L@lkLVVVllb„m@@°kbVbUbšbVbkJ@XV`V@Vbn¼"],encodeOffsets:[[122097,32389]]}},{type:"Feature",id:"3211",properties:{name:"镇江市",cp:[119.4763,31.9702],childNum:4},geometry:{type:"Polygon",coordinates:["@@šVĊKšn„VÆUn„„J@UWKXkVLlKVwX„šVlbVK„„nJÆaš„ķn¥°óÇIkšWKUbÅ@mƒUÝlkUK@_a@KVUVm„@mƒVU@@aUIWƒ@mƒXUx™LUlm@¦ƒb™K¯„ƒƒnw›Jzm@UW@UmmXmm@w„KUUVamw—ƒKm@UbUL@ŽƒVmn¯¼JƒUW@UUU@@bl@@VŽVXšJšnnU‚‚k¯JmbVV„Xn@VWlbUnk@VVUŽVb@nU@WbKWVƒ@XV„„lLVb°bnW°Lnl@X"],encodeOffsets:[[122097,32997]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/jiang_xi_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3607",properties:{name:"赣州市",cp:[115.2795,25.8124],childNum:18},geometry:{type:"Polygon",coordinates:["@@„`l@Èbln„@„KVLl@„V@bȎlnšKXkVlVL@„lJnb„¦VKVVnX„W@w°@VU„mln„UV`šU„bVUV@„xnKVI°KXKVkVL@al@Xa„LVlULWV™VVL@b„x@VXVmb@x@V™VV@nn¤„šlb°b°KXXWbX`lbXx‚z@x„`VIVUnK„L‚x„WXLVKVbVLVU@wnW°b„@nalX„‚mXVJn@U²mKkVl„U@@xlnœaVmlKnœ@JVLlŽnVššl@XXÆèVlUX@xVLXVšb°W@wnUWmXk@K‚LVwUmUkUKUw@wVaVK@kƒ@WnkUKWkwlmXL@KVUlLVKXmWU„L@ašL@malaVk@aa‚ašƒnXš@VVUblb„Jn˜ƒXa„V‚wn£„K@UWmUk@ƒUaWIV@b™JW@KmmU@aUUUkmKkVKlUU™nKVU„lVaV£Å¥WUUK@UkUUw@m@mIkƒƒUUWƒLƒK¯Uw°¯@wUKUbƒKmƒ@kkKUL@UUKV¥U@manw@k@U@Wm@@U@Wwkm„wWaUU@UUmV¯kwƒ@@kmƒkKkUW@UK@ÅV@XWWkXa@Ul@Va@KVaUUU@ƒaXwla@UkVWaXk@K@lmkUmV@Vmbk@ƒ»XIƒ¥VUkƒVUVU@anKVUƒKUalU@wX@˜™@a@K—@ÝwƒL@ŽUnÇlUIkJmn@ŽƒbVVb@VmnkLƒV¯U@ƒ±l—IWmƒ@kaUI@aÇU@K@KUIkbWbƒJUIUyƒX¯ƒUbU@méUUmUk„WK—xWIkJm@V¥U_UJUwmVkšƒUU@ƒƒƒ@knƒwm@UmkWJkL@n@VW@@‚U@knm@kUml@xÅxƒ@@XUJlb„@VX„JVxn@lbV„@lULnV@VlnV@bWV@bXL@lVLVb„V@blLn@Vl„K@xln@bX@lašLVbnKUVVb„KlXVVkxƒV@nnVUb‚lV@@z—°WWkbƒIk‚WL@LUJ@bUI@b™`@UmI@mkK¯XW™™mUV¯@UUVUUam@@VULWUJƒIm`IUJ›KUkW@Uxn‚WbnnmlXbmIUVmV@Vnb@V™LUKWLnÒVVV@V„UL@„kJUV@bƒÈ@ŽšV°šŽ@XVV@l@xUz"],encodeOffsets:[[116753,26596]]}},{type:"Feature",id:"3608",properties:{name:"吉安市",cp:[114.884,26.9659],childNum:12},geometry:{type:"Polygon",coordinates:["@@lxnb@V@bV@ln@‚n„‚lInš@blVXK‚nk¼@VUKWL@b™L@`UXU`ƒ@V¦XLĠ@lJ„¦@„nV@l°nn@‚mVXnaš@nb‚K„n@l„IVƒš@VanJ@_lKVVnš„L@L‚K@Vn@VbšUVanKlLnbnJVbšnWVnVVanI@‚Vb@L„bVKVanXVbVJVU@aXLll„bôlƼXxVLVK@Xn@ƒxnVVVmb@LnVVKVXV@@mnaVXUVnV˜K@_UaUmšwnKV_‚anKVLš»„K@¯ÝU@›™U@kWlUn™lknK‚VnaUkma@ƒUIUwl»Åw@ƒVwV@n™‚n@ÈXlKVmna@kVw@anm‚@n_WWk@™™mUkUK@Im›kLUn›bkm@wV@kƒlUnLV±m@UInWƒkWmbƒ@¯amX@xUVUKUaULWKƒXwƒKmLUVUJƒ_@wyWwkaW_XaWW¯L¯akaƒ™m£@mUUš@U@wnaWU@Uƒw@aUKšUXUVKUkƒKWbk@@bUKUlWL¯LUJmLƒwU@UVƒa™VU_ƒVkmƒnUV¯@@xƒXmWUUULƒ¥makI@ƒUKUkWl™LkmǍ@aƒUk@UKƒLƒ@kmÇak@ƒ_VlkL@`lbnšlLVanLnbmVÆln@škJlbknmKUbÝmmwULUK@bkLWKULUUma@Kk@UV@L@llbVzšxUxnl@bVLmŽšŽ@IVJXœVlƒLV`@bn²@J™@™V@Xmbñ@WbUJ@bm@@LUĬU‚„¦lV@xXb@blnUV"],encodeOffsets:[[116652,27608]]}},{type:"Feature",id:"3611",properties:{name:"上饶市",cp:[117.8613,28.7292],childNum:12},geometry:{type:"Polygon",coordinates:["@@„„@„V‚š„„I°`nm¤²@bVJUVVXUl@Vmb@xV@XbmVVœ@lkLmbn`VbnU‚@Va„UnbVllUXV„a@w°VW@_VWšLššnVlbšLVbnl„KšnVK@IUW@_@am@™‚ÑUólK@U@WU@VwU@UI@aUU‚aXƒƒ@kwmJV@yX@k‚anƒƒ@mkwVmmI@aUU@aUUW@kVkV@@anKš»„XVWnIVUl`@_„W@wlUœV@UWKnU‚bnŽ°InJl„UV@VnI‚b„Wn@VklL@l@Vn²m@U`kI@bWJƒnV@°VXnJm„XVmx@VVL@bkLmWULUmU@ƒbWXb@llnX@‚xkxVV„nVV@¤nL‚nVxnJVXX@˜ššbn`VI„b„@„blmlLnaV@„blWXnlUnbl@„ƒšKVanUVmm_XK@kWWnašU@UnaWUXa›ƒXamUkKmXUWƒLX¯WakKm™nUWwXa@KW_„aXWW_@WnIVl@XU‚LnWVknK@ImyUUÆbXK„Û@W@IÆUnƒVÝlkVK@mUIVwkUVaUm@aVIVyXIƒaÈwmmk@UnanVUmÅaó»lwšW@kkUVmUK@WKLƒUmWULkamK™Lk@Wa@wk@UU@U@mbUIWVKUXWmkUmVm›U@LkakKƒw@w@U™¯ƒ‚ƒUUn¯l@bmn@xkJWxkL@VkI@mƒkmJUI@V@b@VVxnbWlkÈkVƒLƒbkKmVƒL@V@²nxW‚kLUL@xlKVx„bXmVnšWJ@ޙ°@n™xUKUw±`UImVmnU@kalm@akwƒU@UUJmxU@@Uƒ@kU@Um@@Kn™ƒVm@k™KmkU@@WUnkLWxkVUwmKmLkU™bmKUbVŽ@xUnkJ@n±ŽšUxVXUšWJ@LUb™lUnm@ƒW@nknUJUVm@kXllknVbÆK„VVbš¼V„@šUl"],encodeOffsets:[[119194,29751]]}},{type:"Feature",id:"3604",properties:{name:"九江市",cp:[115.4224,29.3774],childNum:12},geometry:{type:"Polygon",coordinates:["@@WUkVUkmaƒVUb@mVUam_nalK@kU›nUWaU@@wna@UVkUWVUUI@a‚±n£m¯_ƒJ™ƒU@ƒƒƒĉ¦Ul@UV™Km™mLlm@ğ¹m`Uk¯@@UVK¯™@UUK@amkmKkVVUa@UkUƒKƒŽUa™L@VVXUJ™@ƒnƒ@™š™WUbƒnVb¯V@LÅlÝIƒJÅkݙm@Ua™WUU@UmUXmmwVUUKWUX±mUam@kWƒzUaVmÇw@aÅLmKXƒ‚UWKkL@W¯IƒwVw™lkUƒJ@Um@ÛÈWŽKUxWkƒaUU@KkLVl@„UKUX±KUb@nVVUbUVmaUlUL@„ƒaUL@‚@nUlWzX`@„V@lx²„@Vlb@bšVÞ@°nl@UxVL@lUbVV@n²xVUVmnUÞb‚a„J@IšV°xnbl@nbÆ@VwnK@VnXlK°xnUlVX„V@Vl@L@lk@W_XK@KƒkWxUL@J„nVx@aX@VVUa˜IXlmL@bVVX@VbnK‚a²XVWƒk°a„@UnV¤nbmLmW@XbmJUbVL„aÞK„L@K@U@aVKlbV@nXlJœxV@VnšŽVȚ„ÞKôbźĕČmV@ĊšŽ²xÆIšV@Þ¦ĸ¼ÞVlŽVÞnxln°Jœk‚LXWVUVUVwnJVI@yn@lXlaXmWI@w—»ma@UmK@akKkXmW@_kaWakKWk@@K@IšWƒkUa„ƒ"],encodeOffsets:[[119487,30319]]}},{type:"Feature",id:"3610",properties:{name:"抚州市",cp:[116.4441,27.4933],childNum:11},geometry:{type:"Polygon",coordinates:["@@°V°UnÜ@n@lnLlV@bšV°L„lnLllVzVVXlV„V@@L@xX@WlX„m@UVƒL@V@n„°škVmVUnKlaXxVbšnlU@lVVnaVI@aX@V„šJš@V„@b„b@šVbš‚@X@lUL@Ž@VlIVm@wUVanLšalVnKnLVxlUXwlKVm@k@Una@mWIXKWUÛVƒk@a@UVWn@@kl@@W„XlW@_Um@UVK@a„LnalInWV@@xnI@¥‚K„—šm@kKmƒnk@mlI„¤laXbVblknV@U‚KXVlUXa‚@@Unw@±mU@ak_±a@ƒUJUIƒVKW_Xa@aWU™šK@mmUVa@IXa@UWmšannlmX¯WKXwVUVwƒ@XUlK@klJXa@kƒkmm@Uwƒw@¯ƒW¯kw@WmbULƒaUUU@mVUU™WmkUb™KmkkK@aƒkUƒ¯¥Uƒl—ƒm@akU@mš@KVIVV@KUkUVUkaƒUWb—„mƒIkaVaUU™@mW™„b‚b@bUlkb‚b@n™K@bƒKXVWnULkKUV@LWKknlxXŽVLml@X„Ž@lULUb@xVxVLVlVnUxK@LWlXnmV@x¯X™aWUUK@wVWUkÅçm`@mn@bUx@lmbUnkLÇWm@mšU@Ux@„Æxk¼VxVJ@„nbVlmbUmLklmškVlX@‚VœšV@°Þ"],encodeOffsets:[[118508,28396]]}},{type:"Feature",id:"3609",properties:{name:"宜春市",cp:[115.0159,28.3228],childNum:10},geometry:{type:"Polygon",coordinates:["@@@VlbnK@b@JšLlUnx±ĀXxÆW„X@lš@V„@@blJ@nX@˜xUbVVUbVV@b—VmnmJœ„@bmbm@klUbƒLmbœš@lVb@xUX@bVVVbV¤@LVV„bXlVw‚LXÜÇn@@V„IlVškUx„x°J@XlKXLV„‚WnLÆK@bÈxUnVb„ylXn@Vbn‚W²XV‚LVVUŽnxWnnV@VVVšXVbn@ޚÆl„IÞJÆk@K°UUa„mVa@UUUš»@wV@VƒkkUKUVW£U@UmW@@aXkVUnVlKVV„UUkVmU™@kWaUanU„VVamIX¥W@@aUaUVW@_mW@UnIVVn@VbVm@bVL@anKVUkƒWK„UXV‚Ikx‚@na„bVK„b@nVJ„_V›@Vw„‚VUVVXUlUUaV@X@VblašbnKlkVaXaƒ¯@m@U„KVUn@WƒXkW@@w@KU@UƒWkUUUykkmKƒk¯K™U@akUmK@k@mmÛ¯V¯U@‚ƒL™¼UKmLbU`mL™xVnVb@`—LmUVUUWmb@nU@UWULmU@KnaUUmU„wmJ¯IUJWIkVkaWVUIUlWaUIUVkKmbUIƒÒlVUnnŽ@VlLUJ@bUX¯@ƒaWVUKUXƒKUbm@UwKWa@a@VkUWn™@Uak@mbX„WJXbm@mL—aWVk@™wƒL@WmanU@knwWmkaWL—KWUXaƒU@¥l„UVVVbnwƒ¥nKV™»@aUk@a@UƒJ@kƒmLma™@mbUWnm@ULǺ@LXnmxUŽm@UbkbW@@akLmWk@UXmJmUkV@VUXVlULmKUxkL@lmXnJ@X‚l°Vnb@bU@WbKUX@VmKUX"],encodeOffsets:[[116652,28666]]}},{type:"Feature",id:"3601",properties:{name:"南昌市",cp:[116.0046,28.6633],childNum:6},geometry:{type:"Polygon",coordinates:["@@šXš™„@„mš@VIUW@UšKVb„„LlV@VVbUŽlUnLnl@bVL@V°šUL@V°@Vln_Ġºn@‚knKnššLVU@VkĊ¥Vk@™Uƒ™»UaƒUÅLUalmkklWn@VUVIlm@m„Xn@VmškVa@KXIV™UWVw‚™²@m@U@VK@k@W™Ua@™ƒa@aUƒ™@™IUƒW@@bUJmbUU@kkV™mUaWwkbmLUVUn™lWbUbklmL™akbUaW@U@VbkVWVUUUVƒUx@‚Uœƒ`UI@mƒaULƒamb@lwJWUƒVXLl„UVmL@bUK@aUnUam@UUmJ@VnX@`UXVŽVb@bX@W¦nJUbƒUmVVbXb@lVšUnVlƒVUUkLmUUVWl@bX@VnV@X¤VUVLllU„U@@x™¼VV@V"],encodeOffsets:[[118249,29700]]}},{type:"Feature",id:"3602",properties:{name:"景德镇市",cp:[117.334,29.3225],childNum:3},geometry:{type:"Polygon",coordinates:["@@VVX@Vbmz„xUlU@mbmL@V²xVbUVVblbX@šVškVykValKVI@bn@n`lVWnX@l„L@™WKnƒVIVa@¯nK@alIXJVIVWUw‚ƒn@nU˜„nK@alI@a@anKm_™a—™W@UWmIUwmmK@£UUƒmUUlwwW@km@kWaX„aV@VnVKnXlK@aUK@UnwWUnƒmIUW@¯mU„XI@alJV_n@m±@U@kkKUlm@ƒXamJ@UVUkƒmI¯JmamVXL@V›UkV@xƒX@`k_UVmJUXƒW™¼mL@bU@UllX@VV@bVV@bnJUnlx@n„Žm„b@lWŽ@zU‚nIlx„@W„bVV@bVJV@UxV@@X@VkLVôÒ‚šn@@b@`VX@J"],encodeOffsets:[[119903,30409]]}},{type:"Feature",id:"3603",properties:{name:"萍乡市",cp:[113.9282,27.4823],childNum:4},geometry:{type:"Polygon",coordinates:["@@VWnL@UVW‚LXaV@@ama¯Uk@WmInW@klKVwnLVKUkVW@UlUnVnIVWl@nXlK@bX@laVan@VnwWm@KȹVK¯m@kmU@ƒƒ¥kIğ@WKU¥„@V_VW@_šK@aXKVL@Ul»mWLkU@am™kJƒm@kmU@@a@UmakwU@›„Xlƒ@VXk`UIW¼kWWX@‚œ@l‚xV¦XlW@Ubn„@ŽmUkL@UmJ¯UkUWVUaƒUlm@UXWl„nUJ@LmLU˜nXll@bUVUUmVUn„Ž@¦šxlŽnn@VÆÈU°kbV„VxllnL@VnVVUl@V„„anL"],encodeOffsets:[[116652,28666]]}},{type:"Feature",id:"3606",properties:{name:"鹰潭市",cp:[117.0813,28.2349],childNum:3},geometry:{type:"Polygon",coordinates:["@@@XV@nlšL@lUnš„mŽ@Ln@@VlV„@@VV@nwVI@V„Vlx@bknlbV@nmnUVJ‚_²‚VxVLšw@mš¯@ÝXIm™nUWƒaUwkL@wVKlKXmw@±@U„KnUlL„a„KlUlÇXkmaUw@U@a@Uƒ™UkwUJ@zWJ™w@WbkVWUL@VmUklUaWakbƒ£kJ@nmln„lL@Ž™nƒ˜L@¦mJ@wU@mXkJmbƒK@bUL@VVn@`kXƒW@Xk@@lm@UX@V@b„lÜUXVWLXJ@nmb@V@l"],encodeOffsets:[[119599,29025]]}},{type:"Feature",id:"3605",properties:{name:"新余市",cp:[114.95,27.8174],childNum:2},geometry:{type:"Polygon",coordinates:["@@m@@WULUKWwÅ»ókƒakkWK@bUVUIUamWUbULƒa@KUa@mJUbmUXU™mUamImakKmLUb™VUam@@UL@KƒKm™UUkL@`mIUb™@U„@V@bVl@bš¼UŽmL„¦mxUaUUƒVkŽ@¦„VWbXV˜LXKlbXnmx@lmVnb@X„Kšxl@XU˜bnKn@WaXIWƒnal@Vbš@XmlV@U@bXb‚LVxn@Va„LVWVLXU„b°@VW@aVIkK@UmVmkU„ÑVJnalLVUVJXbVkVJXUlblUXJVI°JnI"],encodeOffsets:[[118182,28542]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/ji_lin_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"2224",properties:{name:"延边朝鲜族自治州",cp:[129.397,43.2587],childNum:8},geometry:{type:"Polygon",coordinates:["@@Wxĵ„mš@„ó¤VX@@xܼƨš²xWxƒV„V@„XVƒ„„„ƒbWšXllaÞU°Ċ„@ô¼„LôÝWanV¥ƒÑnĉ°¥šÅX¥°¯@w°w@»°k£°mÈŹ‚mÈbƃŎ¦„K°z@Žkxl¦UbU¤šššklV„KŤÞȰ@@bšV@nVVUlÞ¦lUllœVlU°ÑU¯Vƒ°w„bXxl@VŽ²„˜@n„ô¼ƒó°™kmVk²ĕ‚w@wV™ÞÞ@@Ġƒö»˜¯œ@‚„šbnb°mÞ¯°V°„ÈJmX¥mam™UřƒUƒlaU¯™ƒ@w™Kk—l±n@@wƒkÝVUUl±¯I¯b™a™lƒ@™kLmakbƒ@ġƒŹé°™Þb°šékƒƒLm™„wX™‚aÅb@bVlƒbVb—ÒVbUb›UUanwƒakbVŽUV›ak„¯„UŽƒLmxV°UxnôŻX@J„Xkl‚bkbĉaƒbƒWU„ƒ@ƒk„WUU¯@@klmƒ@@™Å@aƒwWXlKkI@WbUaVIUanUƒƒ@ĕƒ¯K™„mUnWUwm@£ċèkUmbUmm@@nkJUalwk@@nmWUan_óaWmnw±KœIƒwl@UmƒI@an@@mlUÅmV_™KUkƒ@U`@_ƒKUmU™@U¯™mmb¯@kb™ImV¯ƒƒLkbƒKƒƒÛ@ÇnɱJóaÝĢkb@„›x—ÒÇllœ@‚Ž²V‚„ÆUVV„UÇ°X„óxlV¯„lV@bƒV@n—x›@—¤@„șŎnxV¼knšJ‚nšKX°˜¦UlnVbUbÆVnÞWVX¦llšb@l°œVJôÒnLVbšbXŽ"],encodeOffsets:[[131086,44798]]}},{type:"Feature",id:"2202",properties:{name:"吉林市",cp:[126.8372,43.6047],childNum:6},geometry:{type:"Polygon",coordinates:["@@ôl‚zšaÈV°„šK@„mŽ—LWl™nšVxUV‚È@ŽÝĬUÈn‚ôLša‚„²VmĀkV@„ĠĊnU@b„V@b˜@nl°UVnÞaôJ@bš™V„¦mlkššbmVXx¯@Vxm„nbƒ„šbÈK‚V@bÈL„wĠyônšmnbÜ@nn„V˜x@n²K‚„„J@k„al@nxÞU„Lź±Vwkw¯LWWUš™kŎīVwƒw„°y„Vĕ°wÈVlkÛ»@wW@Uô£@ƒn™ĶƒXwW™aUamKóÑUI¯›@k™akkW¥XUmÝÅUVaUa‚mVk—¥W¯™Lm™IlmU»mwȚō@ƒ˜£kJUÇk@am¯y¯UVwƒa@wġx¦ƒKƒƒ¯X°Ċ¯¦U°ċWULÅa±b¯@UkÅWmVƒ™ƒkIUlóŽċ¹™`óIƒlX„WŽXxmbUƒLݏƒbƧ@ƒx¯bƒÈ—l@xƒš¯zƒaݤ@nšm„VWb²bmn¯J¯Ò@n„š"],encodeOffsets:[[128701,44303]]}},{type:"Feature",id:"2208",properties:{name:"白城市",cp:[123.0029,45.2637],childNum:5},geometry:{type:"Polygon",coordinates:["@@ó™ǩŁ@WlwUaƑwÛÅÇéĉamKƒōÇ@Iƒ™ôġVƒȁÑŹçƒ™ÝUƧċĉwóóÝ@Ƒ»ğL¯ll²@ƆÅV@¦m‚Åb@nmlU²VxšlUn™@VbnW„bÇbk҃š„n@èlnlšU҄Ž°Lšx@¼ĉb@҄šUŽċxՃènLVxƒÒƒbÅJ±a@_ÅJÅnƒŽVb„Kl„nUÜĊ@„Uš™xXVÆn„mšVššJÞ¯V™ĠwšƒXw°xWL„x„KV¦ôU„wVÝǬóÞޙ¼‚‚„ÞkŽVôȘxބU„lVn¦ÞšĊa°w„b°@šbÆw„lŤL²`„z°@V@@™nJVnl@@¥nUmmn„@mwnmmUnk@mlwUaƒLnƒ›wn¯°anƒWakI„ƒÇmXwÆamUXUlJXa‚UUklKUknmÞV@‚K@VWÞ@VkUwVƒ"],encodeOffsets:[[127350,46553]]}},{type:"Feature",id:"2207",properties:{name:"松原市",cp:[124.0906,44.7198],childNum:5},geometry:{type:"Polygon",coordinates:["@@„šźèȂÒU„óĢ„š@JŎȄ‚‚LnŽĊbÈêÜƃxVbkx@XǪłôš„kÞ`„šW„b@n°ašbšKšnVw°`š_X`W„š¦„ĊIkmVšakw‚K„x°UÞb„U@lšƒl@°¦œVW„šaÞbšxÞI@mVI@ƒVkŚUWK„¥nL‚a@ƒ„@ȍ„@°ƒÆ@nU@KÞalkUwVékUWw„™kU›VkkƒJk¯@»ókƒV¯ÆÇI@bĉô¯@™ķw¯nmmÅL¯wƒVƒUÞy@UówÇLkmm@@UóxkkĉmL¯wVwkWWX™mLõm@kűV_ƒƒô»ÛƒÆ¯@™Va™VšaĠVlmğwķUóÝƽ£ÇJkbǫaƽLW@nxݤkzƒy¯XɅm@VšôÇX¯Ė¯ºÝnUŽnLVlUÔmV"],encodeOffsets:[[126068,45580]]}},{type:"Feature",id:"2201",properties:{name:"长春市",cp:[125.8154,44.2584],childNum:5},geometry:{type:"Polygon",coordinates:["@@„U°xÆKnn°mĸxš°@Ċó@aÈJ°Å„Uôl@¼l°„IllœUlVƒšXxlVUêVxkllnÈUVll@Vx²IÞ¤VUlVnIôlރlwô_„›„bVaĶLXÅÞÇ@K˜¯@wÛaƒçn¥š¯WXyW¯XwƒUmmÛ@ma™nómğzƒxÇK@aUÇL™a„ƒmanƒUw°@WwnU™al™nkƒ¥šU™@aóIÝbUm¯Vmk—@@aƒU@amVğĉ@ƒlUnÿ±Uƒ™bóKmVÇÞī@ÇVUUw‚™šmXk˜Kn@ƒ™L¯ƒÇU™byókōè@b‚n@lÝX@x¯ô@ƙUV_maXm@aóƒJWxnX@ŽVVnĖVnUJ@nōÆǼV¼kxƒLklÝw@xƒx@zV`ÅbmxU±xU„nnm‚kn‚ŽğU™bUŽ‚šUb@šÅ°Ü„󼄄U`Ʋ@lön‚KšnXWlXUx°xnKĊllôw@Vn@lnÈKôx@VÝz„V"],encodeOffsets:[[128262,45940]]}},{type:"Feature",id:"2206",properties:{name:"白山市",cp:[127.2217,42.0941],childNum:5},geometry:{type:"Polygon",coordinates:["@@Ušl¦kÒÆ°„IlÒU¤ôz„¼lJš„U„n‚ÆXVl°@²aÆbVKČXV¯°¥¯ĉ°W„„„L‚¥Ģw@x„bUx°V°zn‚‚b@ÈlVŽlIœ@˜w@m„U@akU°ƒkUôwWƒÈ¯VUƒVUƒÅ±U›@kÈk˜Ñœw@ƒlaÞġƒUÞ£@ƅ‚KnÑĢ¯@W‚aUaVUVkkw@a¯@¯™Ý™ƒVXnW@@WkXmK@xkKUb@bW@Uw¯„mmb@WKUbmUbUaWbƒJĉIVW@I—l±LkšmU™bUm™@ƒnkKWa¯n™@„`Ubma™„ĉL@bƚ—@W`ƒL@n¯‚Xb‚@kb@x™Lƒ„™@V‚kL±™™mlUIU¥mL@lÅx@_laƒƒ@U—aƒV@kmmƒK„£ƒƒLƒƒmKUnÅKVbmXVlèĉUUbml„ĢŤƒIlŽ¯bǦœl‚@ô¼Ģ„@x°„l¤„n„a„l@x™b"],encodeOffsets:[[129567,43262]]}},{type:"Feature",id:"2205",properties:{name:"通化市",cp:[125.9583,41.8579],childNum:7},geometry:{type:"Polygon",coordinates:["@@ÆlXnĠxĢ°lÈ°š„K„°kXm‚@¦Vbk„ŤJšnݤk„VÞVVkȄb°y„™@w˜k„Ç°a„wƨ@„aސ„K‚VnaWwXWƒ„kôJš_ČºôVkƒ»óyV£kуJůlÑk¥V™ša@wƒkƒbƒmk£¯ƒ@wġƒó»@›kÈ¥°ak„JÆ£ƒġnkVaĊVkçWUnUaÆLVmnL„„‚KU™±@—„m@a¯U„bmV¯m@_ƒK™™U™ƒaƒÅ™Wó¹ƒ@UanmWak@@wmI@y™@mk„JVa™@UaƒIkJ@n™@Um±kkxƒm™Ik„ƒbÇm@Ž°bXn„V@Ž°ÈmlÞ¼¯XVº¯Lm„kWWXLmVVlknƒ@@lnWƙ„Vxbmšnšm„¯lÝaVȁè@¼V„„b™„ÆŽ°ÞUVšJ„„kx›I—xƒƒƒIV¤™ÒXxmn"],encodeOffsets:[[128273,43330]]}},{type:"Feature",id:"2203",properties:{name:"四平市",cp:[124.541,43.4894],childNum:5},geometry:{type:"Polygon",coordinates:["@@Ɇn°W„zlyÞ£mwX@ƾKǬblaÈIƾ¤ôÞĸVĠxnmmVƒ²w‚VnwÆaU_@y„w@wÞxlk„KlwU»È»ŎÅ@mVIUmmĕUU@mWXw„Iô‚@bWnnbU`‚šV@Å°ó@wÞW@km@aŎ烙@m°Ñ°Inm±aXaƒU™n@mƑšU¦@šÇŽ¯aU£šaU™ġ¦ÅҙJōUŻókUÇ@™¥¯ak¯mUVak@@aċçÅaUƒm¦Ý`XbƄ@n`ƒI™xĊÞōÞml@šUb@Wl™_¯JkšÇUÝÆÅb@n™„llUb¯„±a@ƒ—ƒWĉJġĀ¯™Unóšm¤œxôaVnƒxôI@x„V@bmƙ„@lnLmޯޙxVb¯þ"],encodeOffsets:[[126293,45124]]}},{type:"Feature",id:"2204",properties:{name:"辽源市",cp:[125.343,42.7643],childNum:3},geometry:{type:"Polygon",coordinates:["@@żôŎVšIÆÑĢ¥Vš™bV¤°bȍ@™V¥ƒ™Þ£lÇUUUÝlƒÞ£™mţIlƒUa@¥nlWƒ¯ƒL¯™kÇġ¯ğwWmÅk¯UƒVU„„bWlXlmnƒbUx¯xVVknlŽUbV„ÇKUb@„™VnbmlnzUº±bmJUbWÈnèm҄š@X`WL"],encodeOffsets:[[127879,44168]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/liao_ning_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"2102",properties:{name:"大连市",cp:[122.2229,39.4409],childNum:5},geometry:{type:"Polygon",coordinates:["@@‚IÞmVk@wXWÜbnwlLnU„@‚nLlbXW@a‚wnbl@XL‚aš@Ċ¥@LULnJ@xVnmV@VXXV@VJkn@VÜKXXôJlb„xl@„IVbnJVLUbn‚lnVw„JVU@ƒXU‚aUUlwn@°ƒn„VKnV°_VJšwl@nwlV„IXWlIVVnK@IWmkIVaVU@WÈUlmU@U„WUalkXġŻ@kIƒ»mm™akUm›ĉUŁV»²ġVĕ@aUU؍IɃ`ȃ@kƒw@ƒUƒmwĉ™@ƒWķсIĉÇbÝLkymbIƒwÇmÛbmbU„¯ÜõÈkÆVbŎxnXVÆnšǪ¦„bš¤Uš™xÝnĉÒmĊVȄ¤Èš„bƼ„Ā„„ÆÆބźb„VVbX„‚°²¤"],encodeOffsets:[[124786,41102]]}},{type:"Feature",id:"2113",properties:{name:"朝阳市",cp:[120.0696,41.4899],childNum:6},geometry:{type:"Polygon",coordinates:["@@na@UVI@m„ÑW™kaV¥UI@wl@„aÈbšm@wVašk„@@K@kƒ™@a@UUmƒUUalmU@KÇUű¯@±kUKVkUaƒaU@¥m@@¯k@WLUmkn@mmIkm@amU@wVmkU@Klk@U—m˜aXIWWUL™aULVbƒmk@UUmUk±™_Uym@mbkImaX¯WW™xWKzU@WƒkJWwkV™@Um@UbVVVVXb@VWX—@WŽ@Vkb@V™nUK±aUUlwX™ÇWKknU@mmUkƒLUVƒVUUVƒUaƒw™bkKmwnIƒ™kJ@nmbƒ`kmVkLWwUm@UUU™K@UmaUa@UUaWK@mUƒ¯Wkk¯VmUUŽ„xVXUVmL¯ymXkWUbmXUKƒVknWx¯JVnkLƒl@VVxnxlĀVL²WlX„l@bÝVUn@bnlÜaXblIVl@šš@Ȧ@VmbXV‚@@x„VVnUn@`°@VnXU@K@„VV@VmbnVn@ln@b„xƒ°Ub@bšLV`Ånƒ„W@@lUšnnWVU@Vbkl@Xl`XxV„UblŽkX@Ž°¦V„UVVbUlkV›@UbVbkLUxmJkXšš@b‚bœxVKÆlXX˜bnŽnala@ƒUk@U„VVklKVUXKVU°KVan@VUnLšKVL„WVaU_@mmUXa@m˜wXwVkVWXk‚k@›„k@klm@wXKl@U@KVUUUVaUƒV@„alL„xUx@b°°VnnVšxlIXJmx„LUVlV@bnX@Všb„aVx‚@XJ@b‚n@VŽVXȄl@llX@lU„Vô°°@ބVbn@‚V„k„@VW"],encodeOffsets:[[123919,43262]]}},{type:"Feature",id:"2106",properties:{name:"丹东市",cp:[124.541,40.4242],childNum:4},geometry:{type:"Polygon",coordinates:["@@lzXJ‚U@š²x‚@@Vš„@bUVmKUn„°n@lnVK„„nV@n@VlV„°WbXn@‚VzƒJ@¦@bkb‚bUl@bkbƒJ¯zƒWULWbklV„nb™¦VJ@„„K°U„kl@@W„bVn°@„Všm²U˜nX`„UÜLXmVXlKVbUVVnUbn˜ƒX@VUL@lUbWxš@²kl`n@Vlb„@nUVWVLVU@aV@²bl@ÈmšxWX„VÈU„JV„l@„„la„WnX‚KÈkÈ@Va°bÆm„@XV°IVV°UnalƒVUn@UwVU„@@VVJ„I@bl@XK@wWmXU‚UVbkJVXnJVI@mƒknwlKXL@`l@VI@UUaVKÞn„aVm@aÇ£XW„U@aÇUU@mbkKm£™@WW™ƒL@@Kk@kl›U—bWKUkUU¯UõÛƒmUUaVU„U@WU_W@kVkJƒ_WKkV@bUL™¯¯ƒ±mk¯ġƒğÑ@UmwƒKUakƒ™ƒa@a„m¥ÝƒIUWmk@w™mţ—L›KʝbȗKWĢklVbƒX@VV‚knÇV@XUVUblJXn@J"],encodeOffsets:[[126372,40967]]}},{type:"Feature",id:"2112",properties:{name:"铁岭市",cp:[124.2773,42.7423],childNum:7},geometry:{type:"Polygon",coordinates:["@@XJm@¯šmXUlnVbUJƒU@bV@UJWL@VXLmJVbkXlJXxVL@b@V@n@b@`Vbk@lxknV@VV™V@bUL@bV@@bVK@VXLWLXJ@LV@nbWJ@IUV„x@LVJUXVxVx@VV@@LXJWL@VU@@L@VnL@bVVmVX@@VVInJmbnLWVnVULVVU@VVmX@@JVz‚l@„nVVKVXރ@mk_lm„UUWV_nJlUÞÑÞVVUVƒVL„UVJ@I„Vna‚@@KV@XwWknwnKlalU„w„aĉݚwšJl_@aUaƒKUUU@WU@WXUÆ@@UVK@n@UnVVšblK@bœllb@b„bW@Xbl@UlnLl°°bš¦nKlVnI„V@UWU@WXkƒw@am@nm@aVw@I@KUaVIm±XÑlknJVnVJšaX_VaUaVKmwnkmmn@lU@U@mnašXlKUmUIVmklaUK@UlUVUW@U™kVm™a@UUU@JmUU@@bmb—KWV¯XUKm@ka@UVKVk@aUKmLkKUUÝUmbXbÇJ@k@WU_@m™™@klm@UXKVaUI@KWUXaƒÇWk™aWUkWUL±U@lUU@ƒUJƒI@V¯JmIm@@aU@Uwƒa™@UV@VkI›V¯aUkƒWkb@bVL„@@VVVUXW@Uaƒ@@b—‚ÝbUV݄@ŽƒLmUkVUbVllLUV@LššXŽWbUXm@U`@„kxlnnJlbnIllšLX„lVlUXmVK„n‚V@L"],encodeOffsets:[[126720,43572]]}},{type:"Feature",id:"2101",properties:{name:"沈阳市",cp:[123.1238,42.1216],childNum:5},geometry:{type:"Polygon",coordinates:["@@ȚĊÜ°„b„L‚lÞxUbUn±‚@ÈnVÆL@xnLšlUVƒbƒxkImJkn@V±LUxkV@bšbšKVKnzVl@L°@Va„xÞUlbôxVVœ@@V±bnŽ@llXL˜ŽöXĶŽnal@nkVJVI@aU@@aVK@ašUUUU@lmkwl@Ua@_@a@m@U@aUKWwkIlWUanIWK@UXKVIU@@a„VVIUa‚mVknW°™n@WI@KUƒmULWnkVkUWƒ™KkkmJkamIkmlw@ƒV_n@VWXaW™™@KVUkKUkValUnV„K@ÞƒVUÞa˜@a„@VbX@VWUU@Uƒ@UK@ala@IkKmUUa@U@ƒVƒkk™WVwU_@KÜUXbl@V¥XUVmƒƒƒXa‚kŃlUUkIm`UIUJW@UIKmkm@UUJƒImmU@ƒVUXU`mIUbUK@LƒJUU™l@Xƒ@UbƒJ™kU@ƒŽn„m@Uam@@ƒ™aUmLKƒwƒ™mWXUK@kUaÇa@JUIUa@aƒKVUƒUXmƒUy™_@lmbkLUKWLX`‚n@bVL@JXL„‚WX@Vnb@Vm@UbnVmL@V@x@LUbVV@V@LƒUVl@mb¯U@xU@UVVV@X@VVblJ@bn„VKUn„x@llnL±¤™b@k`VXÆK@„kV@¼kl@bWIUl@VmLnbm@@JXXmb"],encodeOffsets:[[125359,43139]]}},{type:"Feature",id:"2104",properties:{name:"抚顺市",cp:[124.585,41.8579],childNum:4},geometry:{type:"Polygon",coordinates:["@@„XVl°bœUlJ@UVUš@„bVxV@@bn@nJ°I@U„J‚I„VV@V@k²VVKlXXVšb‚lÈX„ŽWbXV@LVJUbWL@Vkn@lšš@nV`@X@lÈIWanaÞVVVlLnKVL@bUlUL@Vlbn@VL°WXU˜Lna@aV@nV@IVV@VšbUnšl@V‚XnKVa@U„UnyWkXaƒaVk@ašašbnm@_WKXmWanU@alaU—l@XJVLVxX@˜wnKnVlwƒƒ™@V_@a¯¥@UkKWUaUU‚anK@IƒaU@WUaVw@klUVyUUVUUÇ@Iôbša@mnUma@kXa@UWak@Wa—l@a›@WUƒLmU@U`mIUU™`mUk@@UUK±nkJƒbUam@kwm@@a@UU@Ua@@K@ƒVK@kmKU_UKƒUUaĉWmkkL@`™LƒnmlkLkbmK@k™@Ulmb@b™„@Ž„xUVƒIUlmVXXƒxm@™JUUk@WUk@ƒakx±@¯x¯Umb™KUUVmUU¯UmVVn™WkÆ„lWb„„„ŽUnWVU¦k@WaÛV@LV`UxšXllU„@„@VVbnVlL@J"],encodeOffsets:[[126754,42992]]}},{type:"Feature",id:"2114",properties:{name:"葫芦岛市",cp:[120.1575,40.578],childNum:4},geometry:{type:"Polygon",coordinates:["@@ll°X„ŽnV‚@XLVb@VVbnb@VšLVV@VVnXxlKnU‚l„_na@mlI„šmJnxlLša„xVbU„VV„UVU„KVlnnV@lmXLšÈWŽkxVV²bVLšm@Ula@UX˜@XW@UWaUUUUVan@V‚š@lUXxlIX„V@‚yXLšw‚ŽXXW°nblJnan@Vzš`l²nVVVl@„nUaVKšbVKnXVaUaVUšyšnXK@kVK‚@X@m@m‚LXa„LWƒU¯„w@™ƒa@UVw„¥°™ó¯¯y¯ƒUǯ»›w¯Iƒm—¯Ç™UUl™¯»ţKċÑţķm¯w@mU_ómk¼VnU`±IkbVlƒnnŽU¼±Lk`@X™Wl¦UbmVUxkXVlkbllU„Vb@bkVmx@XVV@Jb±aULkKWXkWmX¯aUJmIkVm@ƒxU@n„"],encodeOffsets:[[122097,41575]]}},{type:"Feature",id:"2109",properties:{name:"阜新市",cp:[122.0032,42.2699],childNum:4},geometry:{type:"Polygon",coordinates:["@@šXnb°lš„VlnXVJ„LlVnl@zÆxnK@b„blKVLn@@V„aVLVK@L@Vl@XVVInVVKVwlUXwlKšL„ššVVb@aV@X„lUXbVW@n„lWnXKV@@V@XUVVLUVV@@bVVV@@ln@VbVUXV‚I„xVanJ@UšIVWšL@UV@@¤V@nInw˜W„k„lnIVx‚lnzUVÇJ¦VVÜLĸUnW@aV_šWĊXXa‚Knkl@nm™L™a@alUVw²K@UlmnIlJ„w„aVU™kmK@wÅKmU@DzVmVaÝwkƒKƒaÛ¯șĉķ¥ğ¥ƒ@kUWkƏī݃ƒ@@akU„K@KWIUm¯nƒU¯JmwUVmIkJÇLm@™UImJUU@aW@U@@nUb™JƒaƒbXVWn@UVmX@V@b„š@l@Lƒ@™lUb@x™nÇaƒbk@@xVJU¦lbXšƒÒ@nUJ@Vmb"],encodeOffsets:[[123919,43262]]}},{type:"Feature",id:"2107",properties:{name:"锦州市",cp:[121.6626,41.4294],childNum:5},geometry:{type:"Polygon",coordinates:["@@nJ@nlmVnXKl@@°n@@¦‚V„bVbUlVL²l°@ƲÈV@LV‚knVb„VVnnWVU‚@XmWU„a„bšIVa@mV@X@@bVVnIVJ@š‚nÈKlInJVUnx°I„V°mVnXJ@LƒLlV@b„@ބƐĬXllV„@Ġ¦ĸ¦naWW@In@manK@UVkXJ@alk@»lU@ƒÅLUWl_@ša²£‚Kkm@kƒwVmULmƒ@akIUa@U@WUUVU™aÝ@ğ›wkƒƒmĉ£UWƒ@@bÇL@m—a@_mKƒlƒXUwKƒLţÓ@UWw@K@U„I@m™U@UV¥„@°UnJ°@@_™KUwƒW@UnaWUmmI@m™ķwUaÇLóVĵwݙUUW™¯šƒ¦Ux@V„b@šƒxV°X„ƒKWbK@n@nW‚@UL@lWL™m™zUVVbUbmWXXWJ—b˜n@Vkl@LlVUn@xnV@bln"],encodeOffsets:[[123694,42391]]}},{type:"Feature",id:"2103",properties:{name:"鞍山市",cp:[123.0798,40.6055],childNum:4},geometry:{type:"Polygon",coordinates:["@@l„œxĠŽÞ@šbV@@w°Vna‚@Uk„V@K@UUUVa@K@w@UnKmUVan@@Uma@UXWƒWK@IUK@amW_XKVLlKna@kmKVak@VU„@VmšU@anIÆan@‚a„šUVnb@blLV`ÞLlU„bna‚Kn@naVU@¥°IVK@anUUKVaƒUVak™@mJƒkXƒ™UVwkƒVUUa°U@Wƒ@WlkXWlIXUlJlaœx‚IVVXLšll@nLV@lLXl„KĊzš¥maUƒlkXaVK„X°y„Ila@aVkala@a@¥„IUy@WmXaƒ¯kU@U@mmUƒƒULkmm@ƒ¯VmnLVU@a™ƒ@U@±w@™VWIkymLUUkJWXƒJkUmxk@™xUI¯`mUULmƒ¯„m@kxVVbWV@„UVƒIUx@bkšVšVVšxUbVV@V@zšJVXU‚lnk@@lkLƒlƒLUU±Jkšm@UIUVƒLUVU@™K@UƒnnV@l@Ll„ƒaUJ@zn`@nWlƒIUVUUUV±Ln‚@nmL@VUVkLVlUxVLVlÅXma™@@akLmWUX@JUnVJVkXJ@X@`WX„VUVUIlb„W@bVUVL@`Un@¦U`@bUV@z@Jm@@XV`„LUL¯J@IVKmKÅI@J™nWVnLnšVxV¤™z@bmV@VUV@bUL"],encodeOffsets:[[125123,42447]]}},{type:"Feature",id:"2105",properties:{name:"本溪市",cp:[124.1455,41.1987],childNum:3},geometry:{type:"Polygon",coordinates:["@@lb@Vn„lnVVUb@šVJ@nnJ@bmXUx@xVbkbkŽWLUxnl@Ul@„xWx@nUV@¼Ull„knkK@bmbnl‚LVJX@VIVJn_lJVVšXUmnU°VVVUnVVšLna°V°w²@lw„bl@XVl@VVšIn@„wWWnUVk„JVUƒw@šƒ@anaVkš@@lnLlalKnk„mšK@_lKnlĊXVb„VVLV`nL@lUL@„@L@‚VbV@@V@bn@lxn@Vb„alI²mVL@Vl@nVš_VVnJV_‚@nV„K‚V@Xœ‚@b˜kXbl@XblylUUkš™@Xa@UVIlK@UUWVU„Llm@UUUnKWU@K@UXm„XVa@U°KVUUWUk@ašUVKkaWkƒKUknaWa@U—@m@mk@ƒaUJk@@_WKkLmx„l@nUJmIUWlIUaVWVXn@xWLk@@aƒJUI@Uƒ@UVVxm@UVk„mb¯VUU¯JWUƒ@Ån¯aUbÇ@ÇlLmWƒXkbƒƒk@UƒƒIÇVƒUXW™wÇnk@±aU@@bUVUKUXmVƒ@kaUm@k_±l™@XwVa@kVK@U„Wm—VaUmVUUakLUWWnÛKƒVW_—m±V™nƒU¯@Umƒa@Xk@ƒl¯V"],encodeOffsets:[[126552,41839]]}},{type:"Feature",id:"2108",properties:{name:"营口市",cp:[122.4316,40.4297],childNum:4},geometry:{type:"Polygon",coordinates:["@@ĊĖƐn¤„„°Ċ¯ŎWšô„@xXb‚wnKl@nX@VUVƒKmL@VU@Ux݄@Vlb„x„U@VUb@b‚kœ`‚IUlVUn„V@@UV@@JnXlK@bš@nbÆWUkUKVwUklKVU@UnK@mm²KVUVVVU„JXk@mm_@yVI„bkƒ@K@kmU„m@VšLV@VU„KVUVJn@l™²IVV„K„klK@kl@kmVUW™I@y@UUUVa™wUUU™l™@akmmVaUKmIUaƒJk@ƒwkaóIWWÛL@UlmUIU@WW@UnUUm@wmIVK@Kĉ¦™@bWKk@max@bWXkamKƒ@mVkKmxÛaWX@xUlÝnJ"],encodeOffsets:[[124786,41102]]}},{type:"Feature",id:"2110",properties:{name:"辽阳市",cp:[123.4094,41.1383],childNum:5},geometry:{type:"Polygon",coordinates:["@@š`Vz„‚Wn„VUV„L@bVbVJ@IÈbVb@lVLXW‚n„š„x‚LnKVŽšb@„n@Vbn@mƒ„V@šl„IVa„@@WškVV„I@KVLVanJV_VW„UV@nn„JVI‚Vn@na@alLlmkƒVk@»VU@mXwƒwk@@VmkVwXKllaUa@wVwnW@amI@mUI@™VaUUkmmƒ@UkaƒL@ƒUIĉyƒLWkkKU@mKk@™kWKUUJ›wkbkIWVkJWXkl@X„‚@X¯VVbUVl„UxšVW„„lnIš@l‚Ub„VUbVLmV@bUL¯J@¦UVmbm@LmbƒakVÝKU_kK@amaVUƒ™bm@ÅbmJ@b™VUnƒ@UVl@UbnL"],encodeOffsets:[[125562,42194]]}},{type:"Feature",id:"2111",properties:{name:"盘锦市",cp:[121.9482,41.0449],childNum:3},geometry:{type:"Polygon",coordinates:["@@Vbĸx‚š@nnJVnXŽmb@V„XVxšL@`¯@mI¯Vƒ@U¦@VšV@nƒJ@V@LXx@VŤÔ„K‚LVx„W„knL@`˜b@nÈK@a„@VXĊ¤„nVK@aVU@UnU@ašyU£Uwm™mKXUšm@IÆJnLUL@J°IVKƒKU_@Wn@@I@yVU@aV_@¥Vm@_UKUV@aƒXkaVJVUƒUXW@_@WWIUlUIVm@IVW@IU@@VU@mƒUVVkJ›_l@aVa@UƒVƒwka@UރVwV@@UnK„LVU@UmWk@mLxWa@wóƒUVUIÇÆĉ¦¯¦¯xʟJ"],encodeOffsets:[[124392,41822]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/nei_meng_gu_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"1507",properties:{name:"呼伦贝尔市",cp:[120.8057,50.2185],childNum:13},geometry:{type:"Polygon",coordinates:["@@„m@Łkƒ™Žƒklƒôƒ@£kJ°ý™ɅķÑó¤ğLĉÅlÇğŁW¯¯›™ƥóÿlwkţÈéÝƛó™°ÞÅxV¤ĉĖWƒ¯lȭţυ̃ɱÿķƅˋğɱřÝţϙȍƧĊţ@¯kWKUKm¹Å@ķJU@ƧÑƧ„ō¥˹Ɔ@L@„Þ‚VLnš@VōČWJX¦@JŻbU@ţÞmVU@ȁýóbkWWLƒƒÅ™¯UWġkmóƒ±UŹôV¼ƽ¼ƒł̥ĖƽǬʉxĉŽŻȗKΕ̛ʵƨʟÞ˹»Ƨţ»Ǖō˷Ȍ±ȚʊĠUɾɜɨmÜ֞߼˸ƅȂ¯ǖKˢğÈÒǔnƾŎՂ@šĊbôô̐¼ƒ@ĊôĊŽÞĀ™xšĖƧL±ŽœŽ‚Uš°U„°ĬƒČ°ÜƒêɴȂVł°@ƒ„nxŎèƒbȄÞȌ΀ǸlŽ²IlxĊl²ÒmšôĖ™Èl„ĵºm„ÈêVþ„xɛČʉÇĵVmš„ÒƒÈɆôƐŰǀĊ°ÆǬĮƾb„yĊ@ĠšƒXǀċm»ôw°Ûk¥Çm¯ç™kkÇǫţǕéX_ĶWǖīŎaÆĵĸĊ@ȚȘ‚™ĊLĢĉ„VÆĉʊÇĕóaU¥šĉ°mkÅ°ġUĠřk°mƒÑČÿ˜ÛƒWĸ£ʠšÆxÈÞŎÞ»ʈ²ĊÇČalÒ°Ť±ĸz„ŽĊKȲm¤Ŏ@Ò°¼nyȂUźīǖƳÈē°@šÝĶƒ@ƒÈkl¥Ççkxk™›JXÇƒUÅ@˜£k»„óƿīÛ@lÅJl¥óý@¯ƽġƍÅan™ċ™°é¯¹"],encodeOffsets:[[128194,51014]]}},{type:"Feature",id:"1529",properties:{name:"阿拉善盟",cp:[102.019,40.1001],childNum:3},geometry:{type:"Polygon",coordinates:["@@™ƏnǟƨʫšŹɆÿ°¯ÆV²ˢ™żÿ@ÝÆŁȰ¯ȀƳĉó™™@ğkyš¹@īš›ƒwl£Źƒƒ¯Ŧé@™ÇÇxŋĉƩUUŃōL™Ç™ĵóÝnƒóç@™™ó@ġƒƱ„¥ƒç™WUçÆōƒ@é—çťK™çȭVһƽ̻aW¥ȁ£ʵNJǓƲɳޗǔlżÞmĠóĬȂɲȮ@ÈĢŮźÔnĶŻǠšŎȭœгŃċóȭţΗÆƑÞƧÅΫóȘǫɱȁġlÛkÇ°ȁÈnšõl¯ô„ÞɛÝkĢóWĊ„zÇɼʝ@ÇÈķlUČÅÜķnέƒǓKȮŎŎb°ĢǀŌ@ȼôĬmĠğŰōĖƧbЇƧōx@ķó£Ål±ĀƧīXÝġƃêĉK°Ýʇƅ@ΌʉżÅÒϱʈ@˺ƾ֛।࡬ţશóЈèʞUš¤Ґ_޸Ƒʠɽ̦ÝɜL׈ɛϜóȂJϚÈ@ǟͪaÞ»Ȯź"],encodeOffsets:[[107764,42750]]}},{type:"Feature",id:"1525",properties:{name:"锡林郭勒盟",cp:[115.6421,44.176],childNum:12},geometry:{type:"Polygon",coordinates:["@@ʶĬĊIȘƨƨŽ@ĬÛĢșŤĉĬƒĀóšU‚ÈŚÜènŦƐȤȄłϰUƨťƾÑ܆ğɲƜǔÈèʈƲĊƞƒšɆ¯̼V˺Ò˺ȂŤVĢêU܃x„Āˌ˘ƨ„Æ°ѢmÞżU¼ÆlŎ@ĊçŎnÈÒͪŎźƒĸU°lżwUb°°°Vš£ÞlĠĉĊLޏɆnźÞ„n¦ĊaȂīġŃ¯Iĉůl»kƒ„™Çý„¥Ŏ¯ƒén£ġљÝȭxƒÇ™@Åçķ»óƱŎ¥™çWÿmlóa£Çb™yVÅČÇV»ÝU¯™KĉýǕċţnġ¯»ÇōUm»ğƒÑ™wƏbċÇŎċwˋÈÛÿʉÑ°Łkw@óÇ»ĉw™¥VÑŹU™mW»ğğljVÿŤÅźī@ř¯ğnõƐ@ÞÅnŁVljóJƒwĊÑkĕÝw¯nk¥ŏaó¦ĉƒV¦Å`ğуÑÝ@mwn¯m±@óƒÛKˍƏǓ±UšÝ™a¯lƒōšșk„èƒĬގn@ŤġŰk°ċx@œĉ`Ƨĕ°@ţÒĉwmĉ@ƒƒnƒƒa„™¥ķnƒÞĉVóÆókĉŽķ@ÝkƧƧÛaƒ°Ç@ÝÈU˜óbݼ@„ÛÒV°™@V¼ˋL™ÞɅŤŹǠVÞȗŤÇĖŚōbȁƜ"],encodeOffsets:[[113817,44421]]}},{type:"Feature",id:"1506",properties:{name:"鄂尔多斯市",cp:[108.9734,39.2487],childNum:8},geometry:{type:"Polygon",coordinates:["@@ĶL²ĬVłƑkkl@Ȏ™ŘWńÈĬȗ¯™ºlz@ĠššĊôŦô„ÒĠ°kÞܚ™n@¤„UĸèĸbŌÈXŽĸLlÒĢxɲÆ¤ÈÛƾJÈÝ°UšÅĶ»²VW¯ĸJôšbk‚V@ôlbnĊyÈzVôašb@ĸ‚ÞUl°yǬ²Ǭm°ššk„±lbn°@È»˜JX„VŎÑÆJ@k„LšƒÆl²™Ġ²ʊůĊġ‚řóƛÞÅ@m„ƒmLUÿóĉƧ@™»L@„›`ČĸmšȗÑţů±ĉğl¯Ā™wǎƒçƧŤÛI@±ÜĉǓçō°Uwô™ǫůķƳř±bÅ£™ÓÇwnÑó@ȁƽ@™ƒÇƧĢón»ŏĕóĊ¯b„Å™™VȯÅImƒōKU„™LǓ±Ýxċ—ŋ˜V±Āȗ°™„Źl±šÛ@WÒȁŚŹНŚÅèŌô„¼°ȰɞȂVĊ"],encodeOffsets:[[109542,39983]]}},{type:"Feature",id:"1504",properties:{name:"赤峰市",cp:[118.6743,43.2642],childNum:10},geometry:{type:"Polygon",coordinates:["@@ɲŁĢljĊwƾōÞĭ°_ŎŃźȹƒUČÿl»¯ôķVÿǬƽ™ɅġÅÑǫ»̐ʟȣU™¯wVWݍÈġW»Þ¹m݃ɛŎÿŎōͩůV¹›ō™éċ™óŹÅVVĢǩʈ@Ėċ@ķšÛšV°¯xÇÅţ¥™»°Ûô™ĉʟ„¥WýČ¥™w‚灻±mnÅķ¥ˋVƒbUÒġ»ÅxğLƧ™ƒbWĖÅxš¦U°ÝVóŰlô²@š¥ÜÞÛô„V@²±`š¦™„™¯Ý@„ŽÅ„VÒō¼ôš™¤V²ŹĬÇĊƑƒţxƒç¯Lk»ʟlƽýmłÝÆƏ@mö°Ġ@ŚŹĬţÆUĀĠNJĠŽX¼šnźVUҚ¦Ċxȼ@ôlx¯łʊÒÜĀˌÇČxƍČÈƐašx„ÒĠŽn¼ŎVȐ‚¼Ģ°ŤmǖČĊþšLV°ÞŽU¼ċÈUƚzÈa‚¤ôbkŽ‚nXĀšè"],encodeOffsets:[[122232,46328]]}},{type:"Feature",id:"1508",properties:{name:"巴彦淖尔市",cp:[107.5562,41.3196],childNum:7},geometry:{type:"Polygon",coordinates:["@@²@Ζǀݴʶհĸ„˜ƒ¦Ķ™̒Uˌ¼ӾÇƾ¼̨UÞĉ˜Ƨ—éÝ»ƒĕĉ—ƐȍœōǪakó‚ó¯a@™ôţ™aV¯Þ¯°@²él¥ĵğťwōxó¯k±š—Vó@™aóbUÇyĉzmŽkaóŽU@l™aó‚ķIX°±Uĵ¼™Æ¯VÇÞƽIÇÜÅ£ɱŽġwkÑķKWŋÇķaķçƒV@£šmۙlÝğ¯ƒÑťóǿƴȯ°Åł@ÞŻĀˡš±ŽÅU¯°ɅĀ™źƧʬmǠšƐ"],encodeOffsets:[[107764,42750]]}},{type:"Feature",id:"1505",properties:{name:"通辽市",cp:[121.4758,43.9673],childNum:8},geometry:{type:"Polygon",coordinates:["@@ôƲĸ¼Æèš@„ÈȮwƾ»ʠĢ¥VÆ@²¥@»Ŏњ¯ĊJŤ£k»ÆÇX¯̼ōšī°aX£ôƒƾȁź¥„ƒ™aôŤ™ĢL°ƒĸ@Ȯ¼ÈÒʈŚôVXůÆaĠƛÈKƒķšĉôÿ@ğÈĉ™»ÇVn™ĉV›wXĠÝ°šČÿĸwVƒ™¯¯ǵ±™ĉ‚ǫ™ÅÅm»²Ż±ƽIm¥ţÈķ@¯šƧJV»ÞUÝç¯UġºU£ţŽóaÅÅlƒƒ™Ƨī¯K¯Þ݃ğL̑ȍƽ@ōŎōĀƑɜnÞݺX¼ÇĢގUX°xVšʠȤ̏Ǭ¼ÆÒɆĢšŽǫƾUĀóĸ°‚k¼ċĀƑVŹȺōń¯`ÝĮƽŎĉxġNJɱłō¦"],encodeOffsets:[[122097,46379]]}},{type:"Feature",id:"1509",properties:{name:"乌兰察布市",cp:[112.5769,41.77],childNum:11},geometry:{type:"Polygon",coordinates:["@@ʠǠÞĸɲȺƒÒȂƛŎaƙÈĕȘţUÝźǟɆţšÝˌKU»š@U¯ÜÑ@ƒÞ»ôaV—ÞÇÈ@„¯ÜbƨƨÞlĸ@ĊôlôÅĊU„Ýĸmš¦ƒŽ„bm„„„Ċ@n‚ĊxŤÑ@¯‚ƨĖĊ_@›Čwl¯™ƒȭL›Ý„»ƽ¯ķů„Ǔ@ÇǓbċ™ÅÅÆwÿĠÇU£óaƒ¥¯aŎğĠţkw°»¯ůlÝĵkǻݰɱƧǫaóôɱ»Çk¯ŃóƒʇŐŻ›ĉNJŻĢ„Ž¯ÒÈUl°ƒx°n„Ò™Ĭón™Ċğ°ÇŚĉ¦ʵVƒ°°ĬÛżÇJȁńʇʹó˂ƽŎ›Æţ¦"],encodeOffsets:[[112984,43763]]}},{type:"Feature",id:"1522",properties:{name:"兴安盟",cp:[121.3879,46.1426],childNum:6},geometry:{type:"Polygon",coordinates:["@@ÆXnlŎ°@LVLĠþœxĊUȮĊnU„ĠV@żaW¯XIŎġƒ¥Ý@K@w@K@I˺ŻŎ¦ƨƒƨÒŎIÆ@X@VºnX°lŎ@ƾĉˤƒȘǷȘÑÝݚÞbVţĸÿŤxÈĖƐŽêÇKnĸ¥ô@›ķÞUnÒl@UŚaƒīˋƒ¯ÑƧx@±kXřƐƏÛéV™ˋ»lō¯ĉ„ÅÇÓǫޗĖġV@ğ»›°ĵ„ÇÞǓ¼¯m˜ÛÅŃĉĠÇƾb²çƒ™šéż¯VƒƒğÞml»ōÑV痻V¯™¯šĕÆU¯y°k¯¯V»ôDŽѰa@Źk™ġKţšóŽšbƒ„Ź¦ƽȂó„W¤¯b™Ĭ̻ŎW°ÅÈl¼ţ¤ĉI™°ōÒ@¼±¦Å@UŽġ¦ʟŽƽ¼šÞĢÒm¤„êō°ƒ¦Èþƒšl„k¼ĊŰ°JĢńȁĬ„°ƒżn‚ÇbV„ݼ@¼óĸţ¤@°Ånšl"],encodeOffsets:[[122412,48482]]}},{type:"Feature",id:"1502",properties:{name:"包头市",cp:[110.3467,41.4899],childNum:5},geometry:{type:"Polygon",coordinates:["@@źxżĀǔÆǬVȘĀŤ¥œÅƾōôˁʈͳȂŃÈIÜŻ¯ī„¯ōm™¯ɱĖ¯ƒķÒÝIÝ»ÅV™ƒlÅôфġ™ğVmÞnnƒWçkW܁XƝÆwU»Șĕš£ĉÑ𱱚Åk™„ƒK@lÅIō҃UW‚—IǼ¯@m‚kaƒ²™l¯™ǫnǫ±¯zkŽÝVķUô™˜l²ô°ŎwŦxĶĠk¦±ê¯@Ý°U°šbóŤ@š°bôlôǩb›ŎƏȎĊ˜„ĖÞ¼˜ê—ƨÝĊ"],encodeOffsets:[[112017,43465]]}},{type:"Feature",id:"1501",properties:{name:"呼和浩特市",cp:[111.4124,40.4901],childNum:6},geometry:{type:"Polygon",coordinates:["@@ʶUĊ¥ÈřĠ¯šĉômšīƒÑ¯m„wk¯ÇV°ÑƒżġĊljǓɱţǓ›ƝóX¯ƒɛÒóa@nÝÆôƜŚĉĢʉŰĊҙ¤ȗĖV¼ÅxWƞۂlXXèm„ÝmUnšĠƒĢóÒkƚ„ÆUÞ¼ÞJĸÑ°„ɲĕš°Ŏn"],encodeOffsets:[[114098,42312]]}},{type:"Feature",id:"1503",properties:{name:"乌海市",cp:[106.886,39.4739],childNum:1},geometry:{type:"Polygon",coordinates:["@@Ș°ÇīXњŗ@ȍlkƒlUŁ±īĵKō¼VŽÇôXĸ¯Ž@šťê„°ź„k¤„x™œ@Ĭ"],encodeOffsets:[[109317,40799]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/ning_xia_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"6403",properties:{name:"吴忠市",cp:[106.853,37.3755],childNum:4},geometry:{type:"Polygon",coordinates:["@@nLV‚@šVLšaÞbn@@l˜š@bUVlUV„zVx™¤kÞVèšXnš‚@nm°a@UƒÑ„@VŽXnV@Va„UšŽVKUUU@@U‚@@KVa@U²@‚wXkWnk„±lLnU@UmmVKnIVWnI@UK›@UK@@UVKXkmWLWUXmlkVwUyVa@w„w@aVI„K@aVÈw„KlLVV@LnV„VVnU‚ܲ°WÈIUÆ@nÞ¼‚‚@¦™@UÞUVW@UxUxVn„b„K‚b¯ÞU`VbǬ™V@XXÆVVl°InmnUôƒ°¯‚anam£œWVX‚KXmškôaVU@ƒVak@@wmaƒn@K@UÛUWKXUƒÇƒ@UI™b@alW@akLUKV@@Ukw±Iš›nL@kmwkWmk@JUIƒůVmnnU@m@UƒK„VKlkUwkƒƒnVUKmbkI±š—KƒkmVkKƒb@U@aƒVkUmn™`kIlaUK@UUKmbUIݚUa@mUa@aƒ„m@UUULUK@bmKkbWI@WXwlkXƒWa@k@kKƒLVkkK@L@JUVmzUKlwUUnW˜£XVlKUwVU@aXI@aWaUw@W@_nam@¯‚UkWVkUWaU@nwmJkUVkWVUmUkJ@ImbUaƒ@@WÅ_mJknmak@@mƒXƒaUV@„ƒxUšƒ„@‚ƒ„@VUnkVƒ@Vn@`ULUbWLXVW@kbUJ@XW`@ƒnÅĖWJƒ@—m°@xƒxšbnUa‚w²lƒÞ°xŤIVVULۂWbšbkVVXÆ`UbVL„@kx°LlV@Vœ„WbƒJn@bl¤ULV„°@lmL@ƒƒ£U@@aUwmKULVxUVVx@„™@kU™@mK¯LÇa¯@"],encodeOffsets:[[108124,38605]]}},{type:"Feature",id:"6405",properties:{name:"中卫市",cp:[105.4028,36.9525],childNum:3},geometry:{type:"Polygon",coordinates:["@@°@Èb°KnLš@lVš@@ƒUwVUUwVKnLVx@bV@„¤@„nK@k‚¯UƒVKk£@a‚m„IXa›ƒ@UkU¯Klwƒ@UKVaÅ_UWlU™aXa܁VKUUţJ¯w„ݱkxVbmŽ™a„w@wn¯˜„@XIÆĕ„m‚@X_@WVIlaX@WUXKVaVK@_Um„@lUVm@U„ƒ@„ƒV™„w@ƒVUÛwm@@W@ImKUkU@Ua‚aXƒ@wWaUKkw@UVaUamLU™nk@»±`¯@k—W@Ua™ykbƒI„„@VWJkLWUkJƒwU@ƒn¤mL¯wm@Umƒ²XVWbnV@bmxƒVkxUblLUV@kVWKU¼ƒŽkUƒ@mn@JnV@bUnmJUn@„k‚@XlxšLVVnKlLVV@š@LkKULVbk`WL@lkXW@kVƒ@UÞUlÇX™lkaUbmV¯@@L@šƒV@bkb@xƒlW„—bƒbW@—±@UJ@IU@mVk„VxV@@l„Illœn@Vm@ƒVUbl„@JLmKÛXmVkU›KULU`@LĉwƒKUX„lVUl@Vb„JX¦̼bÞxŎxɜĖĠ„Ŏaô@"],encodeOffsets:[[108124,38605]]}},{type:"Feature",id:"6404",properties:{name:"固原市",cp:[106.1389,35.9363],childNum:6},geometry:{type:"MultiPolygon",coordinates:[["@@Vnn@°xnK‚£„mV@„xlIXVlKXI@Uƒƒ„JlašzVbX@l˜°@²_@¼mlVšnKVbUb@VlxVLXb@xW„bVbV@VlnL@J@Xn@Üx„b„W@nl@nblmnIÆ`@X„@Vbna@aVUUWVkƒ@kbWakbU@VwšW@_l@nmn@@alVlk@UkmVak@@a‚UXaƒL@¯@KVa@axWI@KnkVaVJn_lJ@„X@‚m@nVanUVb@mXLlJ„VWnLla„VVaVX@KXVVkVKlknKVa@aVU@KXb@klJUknUmƒ@K@_UW@alIUamaU¯kJma@IUK@U„@@UW@@aXLVƒVJVaXIƒKlaUkUV@ambUUJkIWJ@wUI™V@JU@UwV@@Um@™nU`@UkUmVUxWUUV@aÅb@aWXkKUUƒUUaWK@wnm@IVU@aXwm@UmVaUalk@anKUwlƒUwlkK@wmaƒUkmmIk@VmkUUbW@UVUnW@kV@xkVmbVnU‚™@UbUV@a›k@kkW@„kLW¤@„nV@VU@W_UV™UU`VLUV@IUVõVULU@UUUJ@wmkUJ@šWI@l@bkKkbVVƒbVbUL@UUJ@Vm@@L@xbVVVLVlVwX@Vb@bmUkbk@@JWIUVÅw@Km@UkWKXxWLÅ@UVUnWK@xkVW„@KULwWVXVWzXVVKVXkV›V@VUbV@U„VV@š@LXxVL@V„b‚Ž„LnKVLVxXVmb@l"],["@@@J@aƒU@LWK¯UUxVVn@Ġ„„LUW@UbUUUa@KUX"]],encodeOffsets:[[[108023,37052]],[[108541,36299]]]}},{type:"Feature",id:"6401",properties:{name:"银川市",cp:[106.3586,38.1775],childNum:4},geometry:{type:"Polygon",coordinates:["@@šUšwVK@UVWÞUšbšw„V@knV˜@@KU_VK@K„ƒn@W_XWlL@Vn@Ċw@Ulaœ@Wanamī@aƒ»ŋó@aÆÅɲÿUaV_°ÝaƒLƒaUmVwVwX@VUVݚ@@¥Ý»@mVÅÇJ¯XÛ±VUmƒUmU@KUUkKƒLÇxUŽ@bƒLUJ@bƒx@xUbVzUxklWnXV‚KnXWlUL@V@ŽVLœ@VL@ŽmJUXmJULnn@VmVkKƒ²mlXWlx±@@VUb@L@@VV@VVUL™ƒVUbU@WmUƒ@„Ò@V¯bmn@VŽƒ„@lVnUšnVWŽXVl@¦VVUn@x‚š@‚XL@¦‚lXxš„Vb"],encodeOffsets:[[108563,39803]]}},{type:"Feature",id:"6402",properties:{name:"石嘴山市",cp:[106.4795,39.0015],childNum:2},geometry:{type:"Polygon",coordinates:["@@U¯ķó±ÇÛ¯™ķmbXb›@kb@Vĉxm@@UkKWXX`m@ƒ„@LULV`@L—@mU@lƒU™x™aÝVUX@VUL™x™VkLWVšš@J„nVLXVlŽUV@zl‚VL@V@b„„n@lU²WVLlLVbUŽVxUx@xǀL˜xôҜk‚K²ŽVa‚U@wXa@W™ÈĉUa@‚bÈk„m@¯"],encodeOffsets:[[109542,39938]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/qing_hai_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"6328",properties:{name:"海西蒙古族藏族自治州",cp:[94.9768,37.1118],childNum:7},geometry:{type:"MultiPolygon",coordinates:[["@@„V£°š@laœXô±źwš™ô@„Ulƒża܍n™Kƒw@U„aƒ™ša²L‚mÈLƚÈxlaUa„wÞmÜbÞUšnJ°a„kôƒ‚ÑkwÝVğwÇ@ÝkkV¯¥@ò„»„nŤ¥XImw@mVwša@Åw™mLkaW—wƒ¥l»kçƒó„»@ƒWÑĉŽğ@ĉ„™‚Ń„UwóřVómĵ»™™Ý@VǕ¯kšÝĊÅk™°ÓUklkU±šI„ÇÞkƒ±@šƽJƒ™@UġIk@W¦™VÑșÓÅnťKULnŽ¯X›ƒ@¯mUÛ@WřmóKknōbƒxÝ@ƒŽU@kw@ÿÇLţšÝUkšmwƒŽk™lċVŚU¦™ŽƒLkUWlÅÑ@aƒ@ÅѱUóġŹ¼ƒÈĉmŻ@@wkw™Kl¯U™ġ@—„lÇU™Ó¯_ƒ‚Waĉ²Åló¼VbknƒKǎÅ@ƧĢō°Ý@ğ„W™ÅxUUm@™‚ÝXۂW„ULUè¯@mbUaƒLƒbUWġxIUJWz™a¯b™y™@ōÈóLU`ÇXUl™UĉV¯n›mÛbǕLklƒUĉVƒšóaġ„ƏbġKţnkbÝmmnÝWȭȃŽÝXţWókUÇl¯U¯‚ġUɅĀ@°¯„„š¯„VÆnmJ@ĊķnóJUbÝXUlVškL@lVxnnmb@¤Vzš`ÞÞŤ@„VnÆJV„°b„UôJkzlŽkl@²óš@ÆÇ°kĖƒšÇbÛU@lmb™XV˜kzƒV™ŽɅĀXˢlń„ĬŹ@›éÅ@ĉńÆ°ğbUšlŽɜ_°‚@xŦ˜škbVbƒKĢ„ŤVŎŽ°@żÈźlĊ„ôKôb@nôxŦ„Æ@ôŽŎL@þÆb@šnnšWˌbÈx‚InaŎxlU@Ѳ±ƒğVUĢƒƨbɲ@Þ¥ôUUķWVô¯ĊWʶnôaŤˁ@£nmnIôŽǪK°xUXô@Ŧa°m‚kXÆÞVŎkĊ°ÞLȄôyVašIlwX°UVwĢÑÜKôw@nV@œm°nmŽn„Ü‚ɞ£VbmŽXnƒ°ÜÒ@xx@V‚b²UlbkxVnšJUnVVĊ°KȚm°nxÇnn¤±¦@ŽUXVV@„lV„„bmVVȁŽVxšÒ™°šIšbźaȃšbVwš@šƒVL„™ƾÑ@ƒŦô¯ĊkôÑ"],["@@„@šƒ„@n„òVœa‚w²bVxšxÜaČVô_ĊJšIVmšL„a°@Ŏ¥XlK@ƒšk„l„KVbUb˜@nUĢn‚aÈ@lmǬ»Ġ¯œn‚mnƒƨVy™Ñǖ™Ġ»ɲInŽ‚@@ÅĢƳ@¯°™ôV„KÈbVIÇ¥¯@Ýó„™@ÑnīWKšƒk™‚k@¥š™¯™Åa™Xƒ±VÅw@±Ġ¯@»™š™n™Wmw@ƒ™@¯ƒVƒUUWçƒKĉ„a±VkkƒV¯w™x@šUJ‚x@bknÇb™mÅ@Uw±U¯¦UŽ™Kmš¯I¯Žť¼ğĊ™@ǃŹÈ¯@Ý»ÇnˡJƒbÛèÇnƒ„ÅK¯„ġĠŹW¼Ålm„@¤n²ƒŽÝb@b„š¯lƒ¯@ƒšÅ¤W„™¼nV@x„„°@Vx„@lbUblbX¼W‚œšÇ²lšUŽ@¼ŽV¦@bÇlVxUbVxÞbVšœbm¦ƒVV„"]],encodeOffsets:[[[100452,39719]],[[91980,35742]]]}},{type:"Feature",id:"6327",properties:{name:"玉树藏族自治州",cp:[93.5925,33.9368],childNum:6},geometry:{type:"Polygon",coordinates:["@@ɆÿĢV°°VÈklVôŤXÞW„ȮÇÞXnmÞnlaŤmĢLƐaĢƒôb„™ĊU„VlkǖKÜaœn°mĊUšVVkÈWV_ôKŎǚ@šz°ašbXyVI‚JĢwVX„a„KVbna°@VçVKXƒÜÞWšn@VVÆwXšĠƒÞ@Ŏ¯ƨġÆ@ȍ„LlmUaô»ÆkĊ±Xb„°`šÔV‚kȘƒĢ@Všk°šLlx@xż@Ċn„Çź»ôĢ²VÆ҄@@bÆÒXklV„KšV¥Æ™ČUšk‚l„nxl™çƒ¥ċç@±m¥ƒwÅJƒ@™™™Vƒ„mÈIléÈa°U¥™™@kÞV‚K²ÑWƒ°w²Ñ‚K²ñšyƐ„ÝšVmw„»kkWĉ—JWUƒVÅwƒL™mÅ@@ƒmw„kn¥Vу»°™°@@»„¯„Lla„JônV‚UůƒU@W¯Umѯ¯k@WykU@¯„wV¥ƒkVwţƒk»šwWǜĉĶçšK„ƒÞ™ÇaĉbƒI™lUƒ@kwƒWƒXUƒ°w™±@UšKn£Wĉ—KWxƒkĕVƒšamwXw™@™„Wmnk@aƒVkƒ™bĉLƒl™Imm„wUÇ‚Wx™nÝJn@¥Æ™kwƒaXƒÜĉ™¯ÅV¯¤mkƒx¯kķܙ²VWôŹVUƒƒ@V£™¥@ƒ°wn@™m@¯@UbUôķŽmn@ÆÛ@ÇýVaUÇĊVƒ@Çlğ—¯xÝŤ™lVÈÈVƒx„ƒ¤Vx™„kK@™@ƒx@„kVƒĖġ¥kIWbXŽŎx@nƒxÅUW`ƒ_—@±ŽUa™LUxƒK¯„WbkVlb—bmŽƒLÛÆWIUwƒWkwÝV@kI›ŽéUb›UUk™V¯Km¯k@Umݐ¯m¯›m—L›Þĉ‚ÛUm™ġ£UxkKm°™Lw›šk@kšƒVm„ƒKVUk›@¯a¯Ģ™móKUU™x™ImlÅn™™ÇbXèVVU„°„@ŽšŽ@„‚xXnmš™ššŽ@¼ğ°@²ÆxU‚„²šWÆb°š™š@¦llš™„XLmĬ@҃šÞô°@ȦUJÇaƒLóU¯š@°ġƴ@Ɓ@mɱJğ¼ǕššÒUzƧ‚m„n›mğ°ǫ¼knÇ@bġmmV—@VaUaƒLƒk™l@„kLW‚ō¦¯@ƒb™KUn™JĉIó`ċUÛb™wUw±ax›bñUmƒƒ@™„ƒ@—bƒaƒbǏÅXm˜„ƒÝ„ÅôVbގ™bl„UšÞVޚ„U‚°„VUxƒ@U„V„@l`™¼nL@Ċ„LW„„¤kXķWġXUVVVķ„UbVb@°kVVxÈa‚@ȦĊbšaźJ„U@Ț„„˜Vœƒlš@XkôaWƒĢ™Þ@laĸUÆb²mÞLĠ™ÞÑôbšÒĊa„JVbm¦"],encodeOffsets:[[93285,37030]]}},{type:"Feature",id:"6326",properties:{name:"果洛藏族自治州",cp:[99.3823,34.0466],childNum:6},geometry:{type:"Polygon",coordinates:["@@ÞVŤ™ÈK@ĀlxV@„Þ@„wŎalmôLšnXÆÜ@nV‚°@œ„°WmVKŦLÆmȚԂҚUX¥l@ĢJVš@„ŽƾI@w™W°™™Ån¥›kÅÝVwôƒÈç„@lÑĊĕša„JnaÆLVw°kny°UnkÆVȍĊll¦„Vƾ@@™nUźƒÈǂIn°X„wÞKô¦VWV£„@£°ókċ±I™™am¯Va™»ČĉV¥°™@m„k„¥l@„Ċm@ašU™mwXƒ@wÆxšmĢ_„`VnÆbšKVw„@@ƒnUVğVmVVöIlŽl@@çÛmƒ£UDŽw°@VUƒ¯»m¯ƒJōĖÅLƒa@»ĉĢ±`U_k`ÇçšóƒkX™lK@ƒakÝރš£WċkÝ™kxƒJݯÅw™xķxmIÅx„@k±J@ýŋš›¤UœkŽmV™°ÅÝxkwmġƒnÝVU„š¦ƒŤlmšóXk¤™UKƒç™@mVkK@klīƒ£mš¯VUbƒW¯¼ċb¯ĵam¼mVX„m@k¤ÇX‚ÇbƒUƒ„¯J¯„¯È@˜™bVXVҙ¤V¼kxݚV„@l‚V—„WxÛ¦Wš¯šmKnlŽkŽ‚šU‚@nƑUĉ„Ý@ǺۄċUĉ¥™UƒÞŏ™z±òL±Ò¯xX„±ÒLÝU@lššV¦¯‚ÇbkêÇJƒnU„šš@š„‚ÆI„xn¦‚‚@²Č脦‚è"],encodeOffsets:[[99709,36130]]}},{type:"Feature",id:"6325",properties:{name:"海南藏族自治州",cp:[100.3711,35.9418],childNum:5},geometry:{type:"Polygon",coordinates:["@@VxƒŽńƒš@ĊĠŽĊXÒ°UƾĕÞm°£nb@‚@LUUW„Ûº@nlÆǬšĠ£ÞV°UXb‚VȂǵ„éƒ@kWanm°@™x„z„K°¯ĠVšƒVƒkw™Lnm°kÞxÆa„¥@‚wnĉƏ@™œ_l›š_VwšmĸèŤÅČU@™˜Wn@ÑmKU™nğƒK@ƒ°¯UÿV£nmšLl™„UƒUÛé±óókkmƒnƒakV@Ç°óÝXƒWəÞťIţxmm™VÛUVȂÓnWyȁĉkƒVš°WnkĊa„¥‚_œK°ÿWna@ƒmU¯wƒlÝIU¤UXó¥ÝLƒx¯WmJÇÈŹ„mV@šƽ@ƒUk¥ĉkċŽÅUml¯Vmz¯lUxÅKmbƒI™bĉĖk҃@Çèó„UxÆޜlm¦šÆ¯ššX@x™Ž@Ž„²ÝlƒÈ™JV²klVl¯ÔlšĉƙްlUǖÞ@ššĶ¼nŽUôôŚ"],encodeOffsets:[[101712,37632]]}},{type:"Feature",id:"6322",properties:{name:"海北藏族自治州",cp:[100.3711,37.9138],childNum:4},geometry:{type:"Polygon",coordinates:["@@ōmġxƽUm±Lǿþġԙ@kxmWƒb¯I¯‚mIUx@bƒbŹVǎƒkĵbƒlĉI¯¥ƒUšm@ƒÆ¯È@šašóšUlƒČ»@w›œ»›wXaƒƒó°ţç݄kUƒaV¥ÅbÝw¯lmnšKlxU„™„ğU¯°ƒLƒyšw¯@mnXb‚l„@ƒêȁǶUWa¯VÝUğ¤ǫ™kÅ@mܹXƒVV@K@ma¯¤ÝnƽĖ¯V@„ƒ¼„ôlèk¼„¦˜xXŽlbnKšÆx@Ž™bUx@nnxWJţ¦ƒmƒ¼ñ@Ž°¦lUÞlÈ@ĠxÞUlxÒó„ƒl¯bmI™ŽÝVÛaÝnƒxVbkbÇwřÇKn±K™b„šƒb@V„xšLmŽÛŽŻbk„ƒVó@™šŹxó²›Wkb™@¯U¤ƒźĊ@lUX„°lÆôU„ƒlLX‚aœV°wšxUb°xÜôÈKVkÈmlwškÈKšwšK™™VUŤĉŎ»„»„Il¥na°LV»²¯Üy@wĢƒ°ĸwlwĢw°±„_lVkš@°ƒbƒÆ¯zƒ‚„š„@l_„@Ģ±lŚVlUaރ„LVƒnKlnȏ°IllČa˜wÞÑ°x„UU™@wƒVkmĠLô»„KÞýôaÞ¥ôĀÞmƁ„™‚mUƒŎV¥Èl°²°a²¥V„@@w„amm@Ñn@Æ£żƒVƒĠ£@W„¯Þƒšl@š»@Uk@"],encodeOffsets:[[105087,37992]]}},{type:"Feature",id:"6323",properties:{name:"黄南藏族自治州",cp:[101.5686,35.1178],childNum:4},geometry:{type:"Polygon",coordinates:["@@ôl²ôÜê„VƒVkš™KmnU¤VĀ¯°@„„LmĠVšnLÈL@alb@al@n°Vš_XmWUÈamaVIn@n‚aV£œóVWƒ™U£°ašxÈ¥@™‚aĊwȹ@óša™ƒğbm@k„w@mƒaÆw@ƒ„In¯mmƒ@UkkWƒÑÅ@@kċÅçVkÝJÅkVykŹl¥@¯š™ĢU܃X¥òý—mmX™ÝÅlmU@£™Wly™XW»Åbƒl@aI›»k@klm@UxUUƒVƒ¼¯Xƒl™aUnķ‚ƒI@x™@¯„ƒK™„ĉUU`óšlČ¯ô@¤ƒÞJ„k°xVŽ„n@ŽmbXŽ¯Ā›L`ƒ¦ĉbml¯X™ŽUŽl„ȂĊXzm‚ȁÔU‚ÜVšUnnŤwŦJɚ݄XÞW¯ô@ÈlU„b„mln"],encodeOffsets:[[103984,36344]]}},{type:"Feature",id:"6321",properties:{name:"海东地区",cp:[102.3706,36.2988],childNum:6},geometry:{type:"Polygon",coordinates:["@@@҄bš¤ÆI°ôU¼š°UŽnnWx™š@b¯L@lUUWbXxWl„ƨnxVUllš„XVŽUŽnL@lȀý²KVnƾ‚ĢwV»ƒ@mÞ£nÆƒÞÑmL™ƒKUaVżĕƒWVk²ƒƒÆÝ@ƒXw°@„ô™@a°wóUUmIk™™aVmÞwmknyƒ¹VÿƧnŏm£X»˜™naV±„Ýw@ašb@aƒm¯„ĉVó¦kÝWKUU@WanU™b@ôǺĉxb@šÇ¦™w¯bV¤„šUX›ôU¤bmm@UJnbÇbXVWn™`¯Umk@@bka@bÇK"],encodeOffsets:[[104108,37030]]}},{type:"Feature",id:"6301",properties:{name:"西宁市",cp:[101.4038,36.8207],childNum:4},geometry:{type:"Polygon",coordinates:["@@@kmKVUƒWk™VkUmwƒƧXkWwXaVV@k°K@aš™XwmmV™¯V»¯óÅJ™£ƒamŽ—X@šċVţÆķç™nUx™`kœ›`@šÅmĊx@Žƒ¦U¦„blVރŤèô¯„„Wbœx›¼œŽ@xċ¼k„™V™ô™bÇ@Å°@„™n„V°¦ĊJ„kĶa„lȍźU„a@aVwnJ°°J„anXlwš@ĢÓ"],encodeOffsets:[[104356,38042]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/shang_hai_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"310230",properties:{name:"崇明县",cp:[121.5637,31.5383],childNum:1},geometry:{type:"Polygon",coordinates:["@@uŏu»GPIV±ÐɃŜ{\\qJmC[W\\t„¾ÕjÕp‡nα|ěÔe`²„ †nZzZ~V|B^IpUbU†{bs\\a\\OvQ’Kªs†Mň£RAhQĤ‹lA`GĂA@ĥWĝO“"],encodeOffsets:[[124908,32105]]}},{type:"Feature",id:"310119",properties:{name:"南汇区",cp:[121.8755,30.954],childNum:1},geometry:{type:"Polygon",coordinates:["@@`y”ĉNǕDwǏ»ƒÖLxCdJ`HB@LBTD@CPFXANC@@PGBKNECCBB@EBFHEDDDSNKAUNBDMNqf[HcDCCcF…@EFGLEBa@ACoCCDDD@LGHD@DJFBBJED@BGAEGGFKIGDBDLBAD@FHBEF@RFDMLE@SGANFFJBANPH@@E@FJjRIACDMDOEKLFD@DbDAJI@AP@BGHFBCBGDCC@DCA@CECGH@FKCEHFJGBFDIHACEDNJDCVFBDCRKRLDLITB@CjNJI^DBCfNVDHDFKHAFGDIICDWBIF@@CFAjFJNJBBHD@CJ@AEFJ@@DH@BFBCPDBMFEQGDIFCNDHIP@HDABFACBJFHEBSZC@DP@@JDBƤ~"],encodeOffsets:[[124854,31907]]}},{type:"Feature",id:"310120",properties:{name:"奉贤区",cp:[121.5747,30.8475],childNum:1},geometry:{type:"Polygon",coordinates:["@@~T~JjZdDbLXDLCB_J@@FHFZJJIAGH@HGR@BENBLID@@LFCDF\\FpDBDb@FAHKFE†@dEDDdC\\GreNMACVMLBTMCCFCEGFAA@DAFDLMHA@OD@BMEWDOC@AS@KGAI_DcKw„ÕísƝ‘åĆctKbMBQ@EGEBEJ@@MBKL@BJB@FIBGKE@ABG@@FMFCPL@AjCD@ZOFCJIDICIlKJHNGJALH@@FPDCTJDGDBNCn"],encodeOffsets:[[124274,31722]]}},{type:"Feature",id:"310115",properties:{name:"浦东新区",cp:[121.6928,31.2561],childNum:1},geometry:{type:"Polygon",coordinates:["@@EN@JJLNHjLJNR^GRYVBNZJRBV@PDvbLNDN@LGNER@nCNQNuT_TIVFV\\Z\\XnDrI|[Ʉś²ÏJUHOƣ}CA@IO@@CYDATGFIEDAEBBAGCO@GJMCEDCJRHEFANOCADAEG@@CI@FE@BDIC@AGIAIMiEEB@DE@AJCXJDCJEHGBELGCUCeMAD]CIJiM@DSAKJKCLQDQACUECDMIFCBDJGECHAEIWCK@GLMCCGEACNKCEJG@MMBMC@@CIJUINT@JAJSTEPZZCP"],encodeOffsets:[[124383,31915]]}},{type:"Feature",id:"310116",properties:{name:"金山区",cp:[121.2657,30.8112],childNum:1},geometry:{type:"Polygon",coordinates:["@@L@BIHFN@@EE@@EFBDGDAADVDD@@EF@CA@IIsRE@GDAF@BF@CV@|FBCHBLCNHAFCADBMDCFZXHILBVEEQA@MWFARJJ@DCX@@TEFBLHAAERE@AJABRPBNK\\BrJ\\VHGND@CNADKDADQjGAGNC@GJ@FCFFHC@JF@@dLBDSFADHVG\\DTEPDDHJALIJkJDJCDIPE@YDCBiK@DONE@EH@BAF@HLJA@EIA@ALKNA@@FIFAFHR@NALadsæąyQY@ƒA±DʼnXUVI^BF@FFF@HBJEDFFGFEBSRkVEXGHFBMFIVW@GAEEFOIAIPKABGWEKFSCQLQBSEIBC\\FdBLRR@JGACFDDEF@AWB@LJJYNABBA@CUEGPaO_AIE@MYMFIGAEFECHSAAKAO\\[JEDB@E@MMA@@AGBKMGDFFCDDFEDFJF@NPBAFLHFH@EDDHBADDC@DDCDHHCDDFDABDAD@FEFOBCJ[D@HEDDNJBDDHABJIBBvGLBJAH"],encodeOffsets:[[123901,31695]]}},{type:"Feature",id:"310118",properties:{name:"青浦区",cp:[121.1751,31.1909],childNum:1},geometry:{type:"Polygon",coordinates:["@@RUNKdOFDJCbRFMLAHPLDN@JGL@@APBWYCKN@TU@SHGCEJIDIJKVIZVNM`iNY@CIE@CA@KBOEGEUFCCSADEIEFCDDDIDDHC@CKIeDCG@IG@DHWFEEGCH@@GO@@O]CNpeEQDBFME[JC]DGF@CKOA@QSB@GB@@GW@@ED@AQIJIAAFE@@DO@CFI@KNG@CDACAFEGKGBEGBDCCAIFCCLIECFI@MBCLDHGNAHSF@DMB@EEKBA@@C]DEICFG@ADBHGFKCDAKKHKD@@FHGAANGEEFCHKCECBCKG@ADKCNE\\[A[I@@mGBDQQEO@BCE@AI[AML@JGACLOAFKEMM@EQKC@CUCBCCBCHEA@FF@@FM@GEAJK@GNF@EXPH@FD@M^@HIADJCFDBER@DK@@DE@CAKFOCCBDHIBCNSB@GFC@GQEEOWFICGDUAEJIDBTAHJHEB@DIF@NE@H|HBDBEH@DKBAHEF@HEEUB@FGFGCCCE@AHOB@NH@PRLVNNFBX@RC€PbAvMtBfH@DJF@ELBFA@EH@HNED@FFB@HLC@CJ@@DJ@PIRf@HE@CFF@GPHD@DKE@FFBEFFD@DEFCA@DD@IjCRFBAHFDKD@HF@@PM@H@BlbDJDBFEF@DLXB@HCD@@IFCBIFEJD@FDC@FBALLF@PAACJERACAJCBD@EL@JD"],encodeOffsets:[[124061,32028]]}},{type:"Feature",id:"310117",properties:{name:"松江区",cp:[121.1984,31.0268],childNum:1},geometry:{type:"Polygon",coordinates:["@@@DLDFRN@FNELPBDKHB@INK\\BBJF@ADP@RFCRHA@nJ@B\\[\\MFLDBCH@DLDADFGLEDFFMHBBGH@EC@GLLLCBLDHEAGBCH@DEFJ^C@DB@LAFFA@CNE@GTMBGHKCAD@NEJFDKJDDJEDBCDHAAFLHFHBEBDDCH@LMJ@DEP@@CF@BEJBJIBRC@@FX@@HA@@HTA@RPBDLE@CHD^\\INFAERCfFMo^D@PP@@HG@HDFFXECGH@@JDHfCLJ@DGDCCCJCCEDJFCFTBDDVEHFPFLAB@NBFCFKFC@CHIACNOHWHCAAFIDD@CDAGEI@ACFMF@R@R_@GQED@EGFEQEDE_IAHKAEXCQUOQCUDEN@ZI\\DDmAMHCICDSOC@EG@BKHIGMIBCGOCSF[CUHCGEBCTKA@cE@@IGDEEEDI@@HMDBHiHCRCBCLMB@DMCGH[UqI[AMLOAAQIB@BQFBFGBAKFE@SW@CDI@QIEBNXB@FRUFKAGJYWDENCCADBBEMGKDGAAD{EU@@DAEE@CB@HQFJt@JDBE@@FC@"],encodeOffsets:[[123933,31687]]}},{type:"Feature",id:"310114",properties:{name:"嘉定区",cp:[121.2437,31.3625],childNum:1},geometry:{type:"Polygon",coordinates:["@@F@LI@IDKJADKIEJICADGACFECCJ@HKCAFOHAJI@aCBEE@ICAEB[GFGCKL@FGEIFADMLCAEJM@ELQECEIG@BE^QKKLQCA@EHBIGQ[GEHOMGGDHKH@JOECFCjCBEFDNCACMBCILGTABDLEEOEIG@GFIMM@CGKFBFCDE@@GEAGEEACIcGaHMFITIHDN[AKF@FS@OA@BK@IHM@KCGOKBENaQIDECcPMLQVFHFB@BFBKLGD@FAJOVGIACQ@A`LPCB@JEF@RU@ANS@@RCL\\HIFpRBFRBBDKLLDADJDGBFDABHBEDNF@DGBBBADKDAHC@\\JJFBDEH[DEFDH\\LX@XLBLbT@DNJLDCEL@VJABJNDHB@HBHYFBAA@GNFB@@AFB@AFABFLFBHFCL@HJBAFBLC@DN@HN"],encodeOffsets:[[124213,32254]]}},{type:"Feature",id:"310113",properties:{name:"宝山区",cp:[121.4346,31.4051],childNum:1},geometry:{type:"Polygon",coordinates:["@@ˆmÖoÖiƒ½[s[YEUJU`SCIEBCCWJY_LIICDWU@@FaBCJIB[ICH[@@CDKEE@MK@@IMCAEBCH@AMFI@SMGEFGB@FK@BHCAIFJNQD@FEBDFMBKGACG@ECWH@@CDDTOEEBGEK@GC@EE@GPHFR\\JHGA@FDBKRLL]RAFH@FJFDKR@FINBFKDCNEBFJEHK@DLEH\\HFADB@JFFDA@bIJGBEPDBGLI@DDEFBDCHDBIJJFCLIBCL@JKJE@ADHDBHJ@HIBBDFHBBAEIJ@BJFAVL¢ˆ"],encodeOffsets:[[124300,32302]]}},{type:"Feature",id:"310112",properties:{name:"闵行区",cp:[121.4992,31.0838],childNum:1},geometry:{type:"Polygon",coordinates:["@@T@@ELE\\BCMJGJSNEbGdHDJFBJAFIEIFCEWG@@gMENSFCVJFAxR~B@IH@AIiI@GE@FGEAFQPDRiV[\\DFSGMHAXHDOMCJCDETBBNVJJI@DD@ANNNH@FILDDMFBDHNDHKL@XDFGLD@EHGFD@DDB@CDDHCDAEAHG@ABOJ@BIaC@CECLKPFNCDCJBiQEIF@@@OGBMIAEEBMTHF@NKEC@QFEGA@EBCKAACHCLJHEFHHB@AFCAIEACIC@HG@KCCDC[ECEED@KC@KJMAAFQ@GHG@BHIJYIGE@EI@A`KDWCaKcCiY}I}S[CYJM@CFDVPRRVWDFžLBBG`JCFRFEFFHC@RF@HQ`Q@E@ENBDJ@HFCB@DCCEJBBGDGXMPBDGJ@DEDELEDMA@DJF@DMZ_jMNYUUJILCJIJDFGH@TSVM@DLXZ"],encodeOffsets:[[124165,32010]]}},{type:"Feature",id:"310110",properties:{name:"杨浦区",cp:[121.528,31.2966],childNum:1},geometry:{type:"Polygon",coordinates:["@@V@CXJDKJZ`XIDDFADJvSRMDM@mFQHM@KCMKMuaOCU@BDAJSX@HKJGD@PNJCJWAGT@R"],encodeOffsets:[[124402,32064]]}},{type:"Feature",id:"310107",properties:{name:"普陀区",cp:[121.3879,31.2602],childNum:1},geometry:{type:"Polygon",coordinates:["@@F@@FHDL@HFFAPFCSDC@@XGFDH@BDLHNACEFA@ERCIMJEDBAGL@@EHAFENHHJ\\ONQBQCIBC[MKACKI@GGGH@I_G@CW@[DMHCDIBMTDHN@JNHEH@FJFPKFACSBKHDJNABDMDECAFiDEDFDIPG@GLHCNH"],encodeOffsets:[[124248,32045]]}},{type:"Feature",id:"310104",properties:{name:"徐汇区",cp:[121.4333,31.1607],childNum:1},geometry:{type:"Polygon",coordinates:["@@RADL\\NCPHFfLJaJ@FWLGMGIK@IFMDOYYFOTSBI@IMSAMSACFIDNDCPWGGBHNET[CU\\QjOCERFBEHF@@HjJBJG@@J"],encodeOffsets:[[124327,31941]]}},{type:"Feature",id:"310105",properties:{name:"长宁区",cp:[121.3852,31.2115],childNum:1},geometry:{type:"Polygon",coordinates:["@@HFFB@HF@DCAELENSJADCNG\\CX@@D`H@JHGHHJ@BINBFUGEDO[MCKQB}AwQEBUIEDMTNF@hH@FXEDFJEJIB"],encodeOffsets:[[124250,31987]]}},{type:"Feature",id:"310108",properties:{name:"闸北区",cp:[121.4511,31.2794],childNum:1},geometry:{type:"Polygon",coordinates:["@@CSG@BQGODUPWTOBQAAFMECKBGEMFKEOHADDJARMR[PGI@TEJBNG@ADBFND@JL@@NFFCL@D\\@DG\\JJADI"],encodeOffsets:[[124385,32068]]}},{type:"Feature",id:"310109",properties:{name:"虹口区",cp:[121.4882,31.2788],childNum:1},geometry:{type:"Polygon",coordinates:["@@bA@E@QHSXBDIMI@OHCLI@GTWBIACQAYIOFGCENBBARSPOXCVHPARH@DT"],encodeOffsets:[[124385,32068]]}},{type:"Feature",id:"310101",properties:{name:"黄浦区",cp:[121.4868,31.219],childNum:1},geometry:{type:"Polygon",coordinates:["@@NEHFLAFDHDPEAMZUHQQ]IMKJG@EPERABHBGRUCCNGV"],encodeOffsets:[[124379,31992]]}},{type:"Feature",id:"310103",properties:{name:"卢湾区",cp:[121.4758,31.2074],childNum:1},geometry:{type:"Polygon",coordinates:["@@VDHQGABAFQFOH@LIiKKHEXI@IbAFZB"],encodeOffsets:[[124385,31974]]}},{type:"Feature",id:"310106",properties:{name:"静安区",cp:[121.4484,31.2286],childNum:1},geometry:{type:"Polygon",coordinates:["@@DLLB\\NPGLFHUDMYABEeKEVMAAJ"],encodeOffsets:[[124343,31979]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/shan_dong_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3706",properties:{name:"烟台市",cp:[120.7397,37.5128],childNum:9},geometry:{type:"Polygon",coordinates:["@@ŤLšLllVń²è°xżĢĠÆl҄šŤbœ„V¤ĊXnŽlĢVĊ„Òš„È°ĊŰÞè˜L„±@џn»VUźċ²»ÆkôVɆkĊŃ²kŤVVwUUVmUaƒ@KkU@ƒmUmmk@UwUkmW@UVIXa@ƒmw@a™KULƒaƒx@Uk@UbWU@yULmK¯@kXƒVUwm@@JUUknWKUVƒLUbU@™wWykIƒa@w@mUI@ašUVynIWa„k„@@W„bl@@knmƒK@wnIl™°Kna@V¥ğ@ġUķ»™¥@UōJƒX¯¤k@™wmI¯‚k@mwƒak@@šlX@bUJ@VƒbknWxkLkxlŽšLVlkLmŽšb@bU@ƒbU@VbU`Vb@n„L@Žmb—U@˜VnUVmnU@mm™@kIUWVIUK›VkkUJUnmL@VmLUaVWaXamU@™™U@KUUmVƒU—JƒU™VÇwğn™mƒ@mXĉV@l¯xnô"],encodeOffsets:[[122446,38042]]}},{type:"Feature",id:"3713",properties:{name:"临沂市",cp:[118.3118,35.2936],childNum:10},geometry:{type:"Polygon",coordinates:["@@˜bXlƒl@zlV@lXXmŽkbVVlš„U@Vn@@Vmb@XšKšVX„WJ@XXl@„‚ŽÈbVLšUl`„@XXV@VVUxVbUxVbš¦„@‚WnXVJ@bnVUzl@„°Æx„U„KlU@mUUnUlUVWVUnVV@XX°V@Všll@Vk„aXVl@Ux@bmbXLlKlb@b@bUJn@@„„b@n°x°K@an@@UlLVKVbXb@bVVnK°LVa@UVa@™Xw‚KVxnLšU°@naV@UWUkWƒULmV—wÝKUUla@aó_@mƒK@aUU@ƒWUkwVm@aVI°W„@@IUw@a±¯@¥kUVUm@a‚wkw™@ƒK@kVKk@maXalI@alL„WXblaVLVU„V@LnKš@„l@w˜aXašLlnUl„LšmV@n°J@_VmnIVym£UKmI@WnIVm@anUVmÇ_kġIÅWUXÇm@U@ݯÅ@ƒ™@naWƒ™IVW@IkK@klKn@naWIƒmk@ƒaƒbkKkLWn™WkLWmk_ƒ@UaVƒUKmLUw@mn£WwUmU™ƒaóV@UkUm@UKULUwmJUX@WW@XҙzVblJXŽWXk@UVWK—X‚¤UL@xU@ƒ@ƒVUaU@@XmVkLmWkXUyÝLmKXnVŽ@n@l™x@bWLnVVn™`knULmxUl„„WLXŽVb@VƒK@z¯x¯¼Wx™KUn@bk@ƒlƒVVVz"],encodeOffsets:[[120241,36119]]}},{type:"Feature",id:"3707",properties:{name:"潍坊市",cp:[119.0918,36.524],childNum:9},geometry:{type:"Polygon",coordinates:["@@l@@UšK@Ž@L@bX@@VlL@JƒLUVnX@`ÜXn`V²mJ@bU@@n„b@l°xnnĸVƚ°@„ƒĊ£Þ@lWnÑnkʶJmó°w@kk»V@»ƒ¥k@V@kw@wVm„a˜Å„mšaô£ŎƒXI@mln„Kla@mV_UKƒ@kUkw@alW™IU»™mƒ—@WUIl±UUÅU›bkJƒ@a@wUKUaVIÆmXIWaka@m@Ul£XKVw@ƒUIƒJUkmJ™ƒVkU@a„ƒWK—ImVƒ@UxmL@bX`WXU@U`ÇkUak@@°UblXk‚mLUKmL@VULóƒƒVk@@Vlbn@Ub@ċaUJUbƒIUlVLUVVbVKX„VlVXU@mb¯@™VmKUwLWx@šUb@VUb¯KmLUU@aWaUaULkK@Vm@@b¯L¯w@mƒa@ƒm@UUU@U¦lJUXƒVƒmkb@nm„XVWŽkb™IVxUV@VUbWLXVƒLW`Ux@nk@Vn@x@VkJ@œV`mXkŽ@V„xV@lVššI@VULš˜VU„IV`°bVXXx„V@VWVnL@xV„Ub"],encodeOffsets:[[121332,37840]]}},{type:"Feature",id:"3702",properties:{name:"青岛市",cp:[120.4651,36.3373],childNum:6},geometry:{type:"Polygon",coordinates:["@@„@nU˜JXLƒ„@blVU‚š„nIVl„IVJ@„UxWLk¤@V@nlbXbWJÅnUJVbVL@x@b„ŽlIœaÆVVVk²VJ@X„˜šnV¼šJkX@blxlV„@VLU`@nkbƒLkm@nWJō„ó¤™bƒn—ƃbUn@xlxU@l@„¦@¼UŽl¼ĊUnW„@šnĠmÈxšU„V˜I„VnUVV@LšV@šnVWbXb‚UVbnK@UnKVmVIllœUVLUJVXlJš@nnV@nmVUUm@—˜Vna@ƒK@mUaV_UaV@„aV@@a™anlKUk™KklwlKXwlm„a@UVI@akW@™l@„bnxl@°nJšxl@°£„WŎIUÑn»lašmô¹Ŏ¥VaUUkƒmkġWɱIUUŹ`›@kk@ĉƨřV¥_Ç@™Ĭƒ¤ÝL¯m¯£ƽóķwUW±ī¯kōaĉĕ™kğmó°ƒbW@UKkLUaƒVmz@V@ŽUxVn"],encodeOffsets:[[122389,36580]]}},{type:"Feature",id:"3717",properties:{name:"菏泽市",cp:[115.6201,35.2057],childNum:9},geometry:{type:"Polygon",coordinates:["@@@¥šIVUÈmÞ»@UlU@Un@VW@UVmkk@aVUUKVÝ@UVknK@UV@VVnIVƒ@wnƒmwmKXaWaXI@UV@Vy²blkVKkam™U@kb@Um@VmUkmƒKmkXKWwkU@Ulƒ@UnK@UVUUm‚KXwšUVL„w‚K„U„@@Wl@@wUkV¥—@@I@W@_V@VWUw@UUa@aƒaWa—@@_mKUw™l¯amzmV—@WK™nU@kƒWLķaUKbÝVmV@UWÇbÛ@ƒX™°UbW@XŽm„Vlk²UJUbmLÇxÅWUzl‚¯Ll„@VkK™XUbWJ@bU@¯@™ƒkbƒLmKka™„@l™_WšXºVbUz@J‚n²V@¤lX„Ž„nV°šLn`WbXLôVlKVUšxXn˜lXLlU@bVV@„XJWLUVnVV@„„@n‚l„°nn‚V„KÈbVXÆJU°VnXV„kV@@xVL„@šWlb"],encodeOffsets:[[118654,36726]]}},{type:"Feature",id:"3708",properties:{name:"济宁市",cp:[116.8286,35.3375],childNum:11},geometry:{type:"Polygon",coordinates:["@@nam_nKlVLXa„Il`š_@KVVXI@m@w‚ƒ„@@k@Kšnô@n`VbV@@L„L@KVVn@VX@‚VL„Jl„š@VUUƒU@Uam@Uk„wšKWaXamkJmIUVUÈblašUnV@kVKl@@lXL°kVJ@VÈnVJUX@V‚LXl@xVLnU‚@VK„V@a„IUaV@„bĊU„x„K‚kVJXUlV„ƒ„UVašI@WUI@KlUnw„mWk@WXIWƒ™U™L@Wna@Um@@UƒVk™UUlanWW@kkU@y„kWk—aWVUlÝbUU@kƒJUIU@@ƒ™JmaókƒLKǃUUkKWLk@WbkUUaƒbmKn¯°¥V@XwV@VanaVaU_@Wlk@WÈ@VUÈVVۂm„aklKȯlLVUX@lK@aX@@kV@VmV@VwnJV_UWUwƒX™am@kW@wVUkKVIUUVmU@UV@IVK@aUL@aƒV@Lm„UKmx@ŽômLkUWJ@šnXmlUxUL@Vkn›VUšU„@V™L™`Ub±LkV@kUKÇbÛ@ƒU™Wó_mJƒ@Wk@@Xƒ@ƒVLƒxUK™VWxLVnUV@VmL@Vk„@VlVXxWLnl‚Ln„VlUnn@@VlaV@nšlbULkl±aUzU@@VWJXbWbnLnxm„@xU„mJUUU@@VmLUl@VUÞVLUV@bllUn@VUXm@@VkV@VݼÇnUV™J@¦nnƒlnVlL@„Þb°KVV"],encodeOffsets:[[118834,36844]]}},{type:"Feature",id:"3714",properties:{name:"德州市",cp:[116.6858,37.2107],childNum:11},geometry:{type:"Polygon",coordinates:["@@„¤@VmbVXnVVbVJššX@Žll@z„lVInl@„@bVxUbĠ‚l@Èbla„IšxXVWb@L™@n‚ULWVXXšWWLnL@`@LUVVL@lVn„JšU@UUk‚a„™nš‚Vôô„b°¼V‚ސXš˜‚œIÜbČa˜bôW„XÞWÈzÆmnLVJ°ÈnlV²lbnW@™@UƒUV™šmnwmkkKWƒkla@mVIUKUa™aUwmn™JU@@amIk@@bVlkX@mmUklUUƒƒa@_UaUUƒV@wƒw™WkXmW@I@WUaÝU@UXaWUU@UUVW@UUUWUn¥nUVa@m@k@alU@wk™LWa@UUm@@wnmU™wla@anKn_@alK@ݙ_ƒ@@WUUUmlkaƒIƒyU@UwU_Wa¯yU_mWUwkImm@InWWUk@@UVWV—kW¯U@VƒL@b¯b@l±¦@šVV@lUbV„@škxVnUšl¼XV@b@lV@nIWxnbƒ‚™@UU™LƒxÅxm¯ƒaUƒ™wU@mUÅVÝKULm@bmKUXó@"],encodeOffsets:[[118542,37801]]}},{type:"Feature",id:"3716",properties:{name:"滨州市",cp:[117.8174,37.4963],childNum:7},geometry:{type:"Polygon",coordinates:["@@Vb@`„bV„kVlnV@nlWUk@al@nJ@bV@šInmVxšbVbVLUJ@nkb‚lX„lLnlmx™nUš„V@V@šmXn˜lbĸ@nnVx‚b@lnXV@UJ@nVxšxnxVbÆVn¯ƒĕ‚@@wÈçUÇlķVIœb‚@„Çmk@¥k@UkUK@aWakUóJW_UW@wkkWK@U@Kš@XUƒƒUkmUUalKXala@U@kkWlkÈl@kšV„mVIVmU_‚a„ƒƒwnwVW@wƒwUƒ@wU£ƒwkJWIyUI±bk‚VUJ@nmV™Ukl„Xmx@lnbW„kVƒUkLWŽƒxkKUUmUkb™J±—LÇxUKmkUmkkW™™a„mUaVkšJÆ_²KĠ@U„W@w„U‚¥nUWwK@aÝUkÅVaVK@akLWƒƒƒ¯I@bnbVx¯JW„ñšWbUL@šƒŽnV@VmbkUUV@IÇak@@bWak@WJUœJWL@bXV@„‚@„V„Jlb@zUlUŽUImšnbV‚mz@°UV@V™bV@@V@L@xLmKUnmJVX„J@VkLW@UVUL@b"],encodeOffsets:[[120083,38442]]}},{type:"Feature",id:"3715",properties:{name:"聊城市",cp:[115.9167,36.4032],childNum:8},geometry:{type:"Polygon",coordinates:["@@ô@VWnL‚an@VKÞLÆUnVV@šxV„„bn°Æw„wšKVVš@„maXwmJU@@k@aWUk»V™Umlw@™UƒVa@kUU@™²¥@k°a@a„K@U›ƒU@mmm@ów—ѱ¥¯@@w™Kmw—I›¥kU¯UmakJmIUaƒVkKUkm@VUUa™Uƒ@UaƒKUK¯@™w™UVŽUIUKVw™k™¥™wƒbVŽ@xn„@lWnXxlL@`„XlJX¦l°XxW¦@¦Ul™n@Ž™@@Um@@VXVmx@¯bllUnUJ@VULVn@b„xV‚VL@b„„VlnVVblV„ÈnVlIVJœLô„lJ@xl²„"],encodeOffsets:[[118542,37801]]}},{type:"Feature",id:"3705",properties:{name:"东营市",cp:[118.7073,37.5513],childNum:5},geometry:{type:"Polygon",coordinates:["@@ͬUǪlô@°Uœw°ōĠ¯š»Ģ炻XÇ@w™wƑa™ÇƒkwVƑ¯@řķUmm¯w@kƒa@mV@@anIU±m_ÛW@_mWVU„K@IkK@UW@@a@K@™L@Vk@±U@UV@lm@mUU@kLm„„xV¤@xV„„x@xUXmx„xƒ„bV`UnUJƒn™U@lÇkkllX@l@VkbWbkLVbnVVl„„WV™@@L@VXLll@xVXX`ôIlVXb@bVLVll@@¦nlƒÈ@›aUJkĸVÈÇè@x"],encodeOffsets:[[121005,39066]]}},{type:"Feature",id:"3701",properties:{name:"济南市",cp:[117.1582,36.8701],childNum:5},geometry:{type:"Polygon",coordinates:["@@²¦˜Òôxn@nn‚@V‚œ„°VlXU˜UX@Vl@XVmX@JnnlJVxnXV`°zXbV`VxV@„z„JlbkŽVnVV@X„@š`@ÞkL@bm`mL@bkbšxnVm@xn@VV‚@XbšKl@xkV@b@l@nUbmVm¦XVVV@VUXVVV@XVWb@VÞVVb@X@JnXlWšX„x@x„UVV@aVKVUX@lK@UƒIUWnIVmnL‚K@w@K@UU@ša@UVU@¯nyUman™VJVVk@ykaƒIƒU@@ƒWU@aXK‚IV›XIl@Xb@al@Èb@JVUlVna@UmU„@™VKXaò™Xƒ°IUwma@aU@UU@wVW@фw@a™I±`kbƒUkw™UmJ@UkmÇUUkmKknUVƒ@mJUkaWkƒa@KmKkUƒLmyXa¯_@WmImmbƒLmUkVUbUVƒJ™bƒUkkWJkUƒl™IUm™k™Lƒ›„lK@knaVmkI@mWaƒLUK™UU@@VmLUVLWK@UUUƒWUkkVmx@„Vl™¦"],encodeOffsets:[[119014,37041]]}},{type:"Feature",id:"3709",properties:{name:"泰安市",cp:[117.0264,36.0516],childNum:5},geometry:{type:"Polygon",coordinates:["@@n¼šŽW„nxšL@x°@š¥Uk@ƒnwlUVl„XVV@VXL‚KVUnK@UV@šVVL„KXb@nlJUnmb@lkLƒ‚„œšKšlVnšJ„klVXIll„Vša„IVUValUnV„K‚annnJ@X°`Wbnz„KlVnL‚Ž@L„bXl‚bVlnI„@VUU@UmVƒ@U@Uš¥@VmV@@_Ua@m°@@ƒ„kmUUm@UVmn@nX‚@@a„anJVUVL„mlIVJn@nkVLVa@KVmVLXVVLš@@U°bn@VaV@@K@aVkœbWaXUVymU@aUImWXƒ@™¥UaVwUaVwUUU@WWƒ@k_™VUKÇa@ƒƒnmxkV@LVJ@X™JUbƒVƒ„kUWVUIlƒLƒwĉVƒaU@VbƒJ@bƒUUL@mVUK@wWkK@UVWUIÇm@UUI¯lWK@kk@UL@lmU™VkbÇaUVVnJlIn‚WbXb™LƒxVln@VbV@V„UV™@kƒƒIUK@UWm@UU@LƒK@KU@Uam_ó@™m@L@lƒ@„@x@nWJUU@L™`k_ƒJWbUKkmLn`mb"],encodeOffsets:[[118834,36844]]}},{type:"Feature",id:"3710",properties:{name:"威海市",cp:[121.9482,37.1393],childNum:4},geometry:{type:"Polygon",coordinates:["@@VbUnVVUxĊ¼š¼ô@Þф¯‚WǬLŎUÆW„¹Uǃō¯ÑƒÝkţ™™ţóġ™óL™ł̥U™wm¥kÝmkkKóbÝ@U¦@‚mb¯LkšmJ@x„Lmn@lk@ƒa@Xƒ@ƒlXbmJUz™V@bVJ@n@x„blJXzšxV@Va„KVUXLlmVV@In@Vx„UlW°@nLVK@zXVVal@@V„w„bVKšL@bnx@„WbUJ@VnXVlVxl@nnnV@„lV@L„‚"],encodeOffsets:[[124842,38312]]}},{type:"Feature",id:"3711",properties:{name:"日照市",cp:[119.2786,35.5023],childNum:3},geometry:{type:"Polygon",coordinates:["@@UaVUUKVk„JVaVIČb@Vam@ka@Ul@„Uô„VK@UnKVLnKlkWVa@¯l@VbÈlV_V@XWW_@anKVwUmVw@@Uny„UVblKVLX@„aô¯ó¥mÛĊÿÈ¥š™Þ¹lUīƒ¯Kĉ¼ʟbÇV™U™ŽUŽ™XmakJUnmV@bUnmJ@XnJVLn¤UzmJUn@`¯ImŽU@™nƒKVkkm™KWb—b@xƒk™@mL@KƒUUVUKkbWaƒXkK@bkJWbnbl@UL@l„Lš@lxx@b‚nUVlV@¦²°@bVx@Jƒ@¯XUJ@bUnlxVŽ„X@‚VV@b„L@nô`@bkbVVÞL˜xnU"],encodeOffsets:[[121883,36895]]}},{type:"Feature",id:"3703",properties:{name:"淄博市",cp:[118.0371,36.6064],childNum:4},geometry:{type:"Polygon",coordinates:["@@nƒlKV@nVn@@kVU‚@²VVaUƒ@wmKXU@UƒUWwUW¯aU_ƒJUV™—VK@U™JU™@kUƒw@UlnWU_@›lI@U@wUml@@mVwX_„KWUXKVa@UVUUwšJlaXWUnƒ@mla„n„UVWkIV¥V@VVVI@a@akakLWKna@aVwk@WUƒbUlk@™k@U¯UWWU@mUUVUXkVmVVV@nkVƒLƒVÅwƒ¯k@WVXb›aUl@bV@@b@xkVVXVxkJ@nk@@ŽVLUlVb‚VXUVVUzV‚™LVbUbV„VWVkLmškJ@n±@UxU„VVkV@bƒx@ÒUX@xVVV@°J„„X„lK@bULUblÆÞV@b‚LXxmV¦ƒV@xƒXVŽğ@±LÅ`™IUlVbƒnšbXšllVnnlVLÈw˜K²ŽšIlanVVVlL„wXlK„VlUXƒma@knwƒWlkšVnU@mVIUl²aVJ‚zXJlI"],encodeOffsets:[[121129,37891]]}},{type:"Feature",id:"3704",properties:{name:"枣庄市",cp:[117.323,34.8926],childNum:2},geometry:{type:"Polygon",coordinates:["@@‚yUU„U„kl@@aVmšLXw°»°w@y„L@UUaWXKƒƒVknwVKlmš_UmmUXK@ašw@k@mUWmUL@ƒ@™@£@KƒbÝV@akw™aULmƒƒbUK™LUU@lm@—°mL@nUJVxVXU`mIUxU@UnU@@lW@@bkLW@UVkKÇ°kLlŽƒbnUÜÇUUVÇ@@Xkl@XV`UbmbUbU@WxU@¯¦m°nL„aVblVXal@XKlLVVȄ‚L„KôlnbšI@„V@VJ„I@lVVÞaVkXU"],encodeOffsets:[[120241,36119]]}},{type:"Feature",id:"3712",properties:{name:"莱芜市",cp:[117.6526,36.2714],childNum:1},geometry:{type:"Polygon",coordinates:["@@lmnLVlÈVln@VnIšVlx„Vla²_šJlUUUVƒVw²@@mlIn™lKXU‚UUƒVaUašKUVyUUWVUUaVkUK@l@@mlIUwUWlU@w@aU@@LU@Ubm@¯a@V™@UKWUUKUn@LUbUKmlm@UIkJƒnUKUVmIƒb@b@mWm@Un@VVnnVƒl@„¯@@nVb@`U@Un@Ž™¦@V@VU„VnV@"],encodeOffsets:[[120173,37334]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/shan_xi_1_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"6108",properties:{name:"榆林市",cp:[109.8743,38.205],childNum:12},geometry:{type:"Polygon",coordinates:["@@™ýVƒnIW»ƒW@»kUÇL—݃U¯¥ÇIUWWїUWwX¯mƒ@»n@ÜÈķô™@a±kȱƒw„ÑmwçċmU»ÆkkVyIm™ĉÿ@ƒÝ¹ƒWnwÇVš™Åaƒzmmĉ¦ó™kVmx™xU¼VškVm_UlVlk„°IV‚kmJa›¦k™™LmmV@XmKnšlUô›VXbƒbƒ@UaÇLğܙ™Åwƒ£mKnmċwÅ@UkƒbmaVƒƒƒn@m¯aU™Jm_k˜@kWXyl@@kÅamw™LU™Þ™ƒ™mWÅzUKƒš™Uk±@™b@nnK‚bX¤mzVšŽVxÇn„‚¯„@ÒknWƒƒVUbkķÈÑWkk@Va™™U@„mUkbƒÝÅ@Ý¥ÇbkĬ™XV`kLǍVmalUUa™nV±nwmkƒJ@Inƒ°KVw¯UnÅ@¥™ƒ™U±bUU˜±œmWbÛKWnUm`UƒVK@bmnœm‚Èż@V„L@xƒxmš„Ť°nŽ@VmK™²VlšlKk„ô@„êÜV@VXLlmš¦UššV°Ș¯²ÿ@¥š@ƁĊ˜²IšmĶnnb°b„KVƒĸLl„Þ@UȮš™Ü°IVƒÞÝސlŽœx@ŽķĀWŽ„Ux„èƐ@š°ŽXnšlĊĖ°m„nƒšV„²V°ÒƦ„aބ„˜@zll@bÞĀšlš¼nKĊ¼óȂb²±šIǪÒ¯ĖV@„lxnVlk„JlaXwŌĉ„„@VnŽššlÆĕ„UÆLœèŌŤôxȚlUœ@šxlaUċĕXm„IWmnkšVVƒ„VW_@aÈWUUmk@ƒ¯çVm»™±W¯n¥V™mkXw±ÇVwƒ"],encodeOffsets:[[113592,39645]]}},{type:"Feature",id:"6106",properties:{name:"延安市",cp:[109.1052,36.4252],childNum:13},geometry:{type:"Polygon",coordinates:["@@@kkÇmIšmUwVkUƒƒU²WmšVkm@m`mIĢĕUƒVa@™mXƒƒÿVVkyUýšĕ@l_UmnƒW„KVkţ™™¥™aƒwğ@™@aôƒ„ƒWa„kUmƒa¯¯™a±£kx™mmxUwÝ@xmU™b¯K™wó„Ý@kmm¹Ub@lklVbmnnVUV@x›UknƧJUX@ŽƒLÇWkw™LķƧÅwWJk„ƒLkþĉxWz™JUnǚkš@Ɛk¼ÜÔÈKšè@°lșÆk¦l„n@l¼@l¯L™°UU™VÇ°ƒ¹—`m¼mXk‚™bUaƒV@U¯x@¦™Ç™„UUmlmUVm„nnmlkw™@@šƒ¦Å‚ÇLmx¯Iklš„@¦mÆ°VUx¯Lm„@J„InlmxU²šmVbkV‚bUnȎlKU_šWlīÈaÞ¦Æ@„ÞlanV@ƒšVšUbl@XlÇÒĸlŽVa„UX„lm@Ñ°ƒƒÈmUw‚U™nyW£amL@mša²@lšV„™VLÆynX„šÝšVššKnxÆb@lk@WzXŽ@ll—n`šIV‚°b@n„m„„‚Unb„aVlÆ@ČxmnnL„¤ÆxššĠÛÈKVb„@„aWaœU‚ókVm™nL@W‚UnnšKlšœ¥‚bnIlU¯JlƒUkVkn`lUU™V»šwnwlUôšĊ¥nn„yÆb"],encodeOffsets:[[113074,37862]]}},{type:"Feature",id:"6107",properties:{name:"汉中市",cp:[106.886,33.0139],childNum:11},geometry:{type:"Polygon",coordinates:["@@lKnb@n„lWb°bkxĸwVb@ł„nlŽ„ƒĊ¥šL@XŽl™ÈƒVblÈK‚b„akVwôml²`‚nœ@‚nVKœl˜k²xŎƒ°¦VU„JĊw@çnWçރVkUóÛ@¥kwš™šUmƒX¯WšÑkƒ@UymIUwlUn¥‚mUk²a°¯V»@™ÝVș„ÝċÅÅVl»@l@a°±@_kammÅb™a@ƒƒm@ż™KknõĠ—@mšƒ„¯LÅw›‚—LVxmb@¼kV™@mw¯wVakKW»X±¼¯Vkxƒb„¼WŽ@nx@x±bóakbƒ@ÝmU™@ķÓÛL™kƒVUm™k¯¤ÝLUlÝ@Ýz™š„x@x™°™™™bƒmƒX¯aUJW¯—k@bÇWƒwÛwWxƒ@XWlb@Žƒ„VŽÈUlwšLnl°VlUô¦œU°¤VšUxVXUxlbkVVlƒI„°„ÅVlU°m@k„ÇU¯xUlƒLUlVL@b™°ĠInĠ°ÈnK‚„@xÞa²n‚aUyšXUKVkšWô¼Èa‚z°JXUVÇV_„JVƒšz@Žnb"],encodeOffsets:[[109137,34392]]}},{type:"Feature",id:"6109",properties:{name:"安康市",cp:[109.1162,32.7722],childNum:10},geometry:{type:"Polygon",coordinates:["@@„bĊaƨèšwôô„¼šb°ašXVƒÞVUÞ@‚aXƒm¥kImx¯¯ƒV@anU@UÇéğL@ƒ¯¥V£mƒ@ÝÈb„K‚™„X°wČÿ˜ƒ„b@xÈblxȯĊ„„mÆUVƒ„nÈ@ƨÜLĢ¥ƒŹnƒ°Vnn˜K„aô_ȃšwU‚aXmnW‚¯kl›LXƒÇ™ō¦ÝaÅVmbğUn¥±wÅéVƒan¥ƒ„U„»°am¥„£ƒÝ@ƒ„wVw™¥nU„уUmmVwmķIÅaóVWxkblb@ból@œğÒĉ¤ċXƒ˜¯X™xk„Ç@óÆÅx@š™xķ_kmݎǣkblb@`¯²@bk‚‚@k¼ÆUČƃÞǚÞU@šU¼¯°±bVlnm¦kVVxnJVz@‚l„™ÒXW°n„™V™šlx@¦ôÜVUl݄Xèm@è"],encodeOffsets:[[110644,34521]]}},{type:"Feature",id:"6110",properties:{name:"商洛市",cp:[109.8083,33.761],childNum:7},geometry:{type:"Polygon",coordinates:["@@²nl‚ôbš„°aVwnKÞIš`°wšXôw°VĊ°@ŽÅš„ÞÆV„zÞK@xšŽ@a‚LŚ@b@ŽnLlƒ@šln„mnLVw„a„bVƒ‚VnbU¼„Vƒ°„bl„šbÈ@ĶŦb˜@nÇ@amIyUI@ĠVmôƒU™ƒVwkwlanJ„¯lwó¥@an°Jš_„‚@š™nóƒó@£l¥UwmašÑ@ƒUm±V_ƒJ—£›J—UW¥¯@ƒ_k¯¼mUƒVUè¯b@wmL™»ğVmağI¯¤ċIUW™XƒKĵ¦ķaƒJUb™IƒlUóVmk@WÅÅÇ@ƒmU„ÅVƒnĉƒÇ°kwÇa@wƒa—„ċĀ¯xƒWšƒLÇa@Þn„U¤°¦@„ĠKÈê@VmV@b„U°°nwlJn¦W„bÝ@VŽ"],encodeOffsets:[[111454,34628]]}},{type:"Feature",id:"6103",properties:{name:"宝鸡市",cp:[107.1826,34.3433],childNum:10},geometry:{type:"Polygon",coordinates:["@@@ƒ„£@›°Išb@¯°ynŹƒaUƒlƒU£„Umšĵĉ@@ylUÞ@@£kWU¯WaU£¯ÇV¥ƒ@kb¯wƒn™¥ÇkUÇnUƒ@¯±›kULm›@m±_kŽónUxlŽƒbaÇLkŽUaDŽkšW@™Kĉ¦ƒ„kƒm@ŁUaķxlw¯aXaƒk@mmakL@šmšÛŽ@¼m„@l„XV`ƒn™KUš°°@²š¤UÈ@VxmôƒxKl„VV²aVw„Xla„Vlx@UVnŽÇnk°ƒVVL™lkI™šƒJÇk¯V@šknƘn@lznmlVkzVŽ„VVxš@Ux„z@x±¼VxxU„l‚kb˜@„¼Čk˜VXlĠkôV²w‚LUKlwœJ@a‚IV¥Þƒn¯Ün„‚„@nk˜l²kÆ@š°„aVbnI@™š‚Ťn"],encodeOffsets:[[110408,35815]]}},{type:"Feature",id:"6105",properties:{name:"渭南市",cp:[109.7864,35.0299],childNum:11},geometry:{type:"Polygon",coordinates:["@@@ÈôL„xUŽ°„Þ@mŽÈnl¤nUôL‚wX`@ÞÝL™ŽUšmLô„„ŽôbVbnºlnÞ@ôƒšx°LšanV‚wÞ@Vxnwšnlw²¤šb°°„bVnƒlXbƒ„ó„@bš‚Ġ@„xšbš¦ŤšV™Xġ„£W¥ƽɽƒó@ýóƝÝ»„£X™mƅšĊkUƒ„@™™šó„kťaĵŽÇ@™akƒƒa„¯ƒUV»maUU„ƒaƒbUxmKƒnkm@™k„mK@ƒxó@¯n¯KǦ@ôÅèlxkx°nƒƾ¯KU¯WķL@VÝIUb™yWbX¼Ç°"],encodeOffsets:[[111589,35657]]}},{type:"Feature",id:"6104",properties:{name:"咸阳市",cp:[108.4131,34.8706],childNum:14},geometry:{type:"Polygon",coordinates:["@@šIXyĊwlý„KlƒXIVaķƒ™»a›£„¯aVU@a™‚wÈō‚ašL²»‚VœUln°WȯW»XašzVaÞJ@Uƒ»@¯Ýbğwly@£kÑţ±Wу@ka™IUƒƒnƒ@¯ƒómţU™b™U¯lÇIÝb@¤Ý@kV@zĊ@™ĶnƒVV¤k„V„„bmź¯z@°™a¯J@œƒ¤@„„bUx™bƒ„@`™xUÔ±ºVXœW‚„UnUJ‚LĢ¯ÈKlblmÈXŎ°šU„°LšŽlkÞKš@Èxl_°ĶUÒkblš"],encodeOffsets:[[111229,36394]]}},{type:"Feature",id:"6101",properties:{name:"西安市",cp:[109.1162,34.2004],childNum:5},geometry:{type:"Polygon",coordinates:["@@°²@‚„mVVÈÈlš¦„m°xla„@U¦°ÈV¤XbV°lXÞaÈJ°kšVšaŤVôn°„„@„mV„šJlb„@XÒŤ²lÒ@¤kzĠxÞa@°„¼ĸK°XV‚°L„ƽ¯mlwkwÆç@óÈ¥°L°mô@„w@aƙK@b™@wÝLƒyÅUƒÝƙ@ĉ¯¯Uóx™W¯x™_ÝJmLUx¯b™ƒóak±mÝUU„™W¯b™aƒ»óó™xƧçĉbƒaĉxƒIUV¯¥ō„±w—l"],encodeOffsets:[[110206,34532]]}},{type:"Feature",id:"6102",properties:{name:"铜川市",cp:[109.0393,35.1947],childNum:2},geometry:{type:"Polygon",coordinates:["@@ÆxĸƨšKlxÈX„K@VWƨIlmœV@wVUmUnmUalk@kVaUaóaƒóƒnKV™šÞK@ÝW_xóKmVk£ÇmnÝ@¯ƒVƒwóK@ǯXkm›VU±¼™KbÇŎx‚š@bUV°bƒœ¤‚bš¼ĸ„Ub"],encodeOffsets:[[111477,36192]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/shan_xi_2_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"1409",properties:{name:"忻州市",cp:[112.4561,38.8971],childNum:14},geometry:{type:"Polygon",coordinates:["@@Vx@lnbn¦WlnnUšmš°š²VšV‚VVVnUn„ºlz@l„„@Jƒ@kXWVXl@Lƒa@„ƒKUL„ŽlbnKlLnK‚LnKÆXn°šbVV@bUVl°Un@LnaVJUbW@UX²l‚@ČwlVVIšWnkÆa°„„anV‚Kn°™UW¯@™aVUVk@Un@„aV@ValwUanmWU„k@WVUUanaVwnLVl°@nk@mVU@UVK@w„LVKVU@ƒ„K@UUKVUV@@bnL„a‚V„aôšlIXmlKX_°KVV@bVV„@šzV`kblI„V„Ul‚šL@bnV@V„Ċll„„VlIXW@k„a‚U²blKšVnIlJ„albXXlWVn°JnšnL@l@XlJlaX@„X˜W²@l_VmnKšU„blU@mnkVK„¯@U@ƒma@kX¥VƒmakkƒLƒa@aƒ@WIUUVXWWnk@a°a@kkm@kUUmJm@WUUUIk`m@V—kaWWkX™KmƒXk¯ƒ@WKƒLkak@±bƒw@ƒaƒa@akaƒ@ma¯@ƒL—KÇÅkKWbkmġ™±ÅUƒLUK™VVkƒm¯LUVVbƒ„UwUW¯bm„ƒULƒxWJ—@ƒklmkUm@@KnwVkVK@akwƒ@@a¯bƒKkn›VUI™b¯mmbk@UbmKUL@xUUƒ@klmLUŽlVXI‚VVVUVUœU`mLXVWbXnW`Ų°xmŽxU@mĉƒƒwU@mbU@UƒmbkVW¦kJ™@ƒX@`¯Im@UlUVVnb@bWJXnmbƒJUU™UUaƒ@UamIkaƒxƒ@@x@b"],encodeOffsets:[[113614,39657]]}},{type:"Feature",id:"1411",properties:{name:"吕梁市",cp:[111.3574,37.7325],childNum:13},geometry:{type:"Polygon",coordinates:["@@@a@w„@„wlbnJVb„@VbšVVV„InaWmXI@a‚aUmVUVkn@°J@_„Wš@lIX¥lUnaV„V@naV@„xĊ„n‚V@‚wn¯wƱX_WmXaWUnKV_V›VUUUUWJkUVnKlk¯™@@kmKUaŁ±KkU@WmI@WUIlUUmVwXƒ‚w@ƒUlUVwœV‚@„Lnb‚W@anU@UšaVkô@l»n@na˜JnUÈLVaƃUUVm„VKVƒ²L@mU_lK@UVWkU‚a@a@U¯aUaƒÑóÑUb™„ƒKk@@aƒk¯mVaUwVƒÑkWUmK@UUKmXUWÝwUa™LUU@aWJUUU@Ua݄U@WL@VKVaVI@WnU@alIVKƒƒ@kIƒmIkJ@™m@ƒ™@@_™K@xƒ@kaW@U„@Vmn@ŽUK@mIƒJUXV¤XXWlkKƒkkK@XmJVakImJU@ó™¯LWKUV@nUVƒLkxmKkLma@kXKmmƒLƒab™LmK@V@mXVÆUxƒX@`nL„aV@@VmLUVnLlLš˜„b@„šŽ°²nx@b‚VUxlb@V¯bUV@zV‚XVĊXVx@lVn@VnnmŽUš@LlJXVƒz¯VWVXbšV@bmn™VUVk„Çþń@XVxmbUlV„Uln„W„@„Xl‚@VLXÒ@bÞJ°¦„L˜ò„@nU‚b@°„X@ŽXbmVU„V„nb@x‚x"],encodeOffsets:[[113614,39657]]}},{type:"Feature",id:"1410",properties:{name:"临汾市",cp:[111.4783,36.1615],childNum:17},geometry:{type:"Polygon",coordinates:["@@nW‚@@UnLšK‚a„b„KnnWL@lnblKnLlw„KVU@mVUXL°KôšV@nIlJUbnI@WlL„llLXkWWU£VW„InJ‚@VL@nm@UVƒX@lb„@@wšL@`‚@„šn@V@lw„@n„VmVX„WmwnUlƒœa@_lK„wVlUn°xVKVXXWlUšVVI@K@K„n°KœwlVlU@kna@V_„Wn‚m„UVm@kXml_@m„LlKXw°m@_ôJVUV@X™l@UaV@Va°I„lk»VwUkVmwUmmVn@V¯@KƒU—wmK@U¯wUVÝ@mJƒU—nWK™@@UnKVa„_lykUmKÛnm@™x@ƒUUlwVk™ƒXW@ƒa@Uƒ@@K@ƒkIV™nammVakUlƒ@wX@@kƒ™¯@ƒVVbml@„„°UbULmlVbnbÅK±VƒKVXUJWa@ULWaUU@@U@aWK@UkxUKƒLUUUJ±UkL@V±kk@kam@UV@l@LWl@n@VVUx„LlUUx@VUV™U@aƒIUl™L@°mLU‚ƒbkUUaWUUaUU@aWK—LWJ@bUL@VUVVbU@m@a@kmKmnĉlUK™XƒWUblb—xmIkƒƒU@xWb@lkšVx™LXŽmzVV@bklVVUzm˜@bk„@Vx@xlŽU„@lUbVnl@„Wxnl@n@ŽUbV„mL‚mƒb@`X@lUX@@xlnkLWaUJnnWV™Vn@l„@bULVV@l™V@XnJVX"],encodeOffsets:[[113063,37784]]}},{type:"Feature",id:"1407",properties:{name:"晋中市",cp:[112.7747,37.37],childNum:11},geometry:{type:"Polygon",coordinates:["@@@šlInJ„lJ„@‚„ULkJ@bmV@XUJUb‚L@UXKV@ރVbV@VVXI@bVVšKVbÞxVXnWVL@VnLV‚lX„ÒUŽVxUb°n„l@bl@„LšƒVaô҄ÒVb°b@VnLnnV@lmn@lb„U„V@„‚JœUVV‚Xkl@lUzmJ@xšXkl‚bUn„JVšUb„nU‚lb„V@nlLX@lakšV`Ub°š@XVJnU‚L²KlxnI@KV@lbUbVV„KnVl@„zlm@Uš@nŽšI@WUaVl@@mVU„@XkW@ƒnkVKVƒ„_Vw„y@knwVa‚@XalU„@šVnml@„X@V„L‚KVaÞbnnlJšI„mVKn„VVVInVlU„@„m@™mXK@UmyUI@mWUUakamw@wUwmLkakwVƒmK™w@wUam£y@am_ƒW@™UU@knmm„amU@WUa@knw@ƒUUUUV@nƒJm@mVUkKVUUUkKmwƒKULƒKUImV@lUn™nŽm@mbUK@°™bUnmbUmkkƒWUb@am@UXkK@a±@™V™@ĉř„V‚UXVxUVkLWl¯@@bULUlm@@nm`—XƒlWakIkm›VUbUL@Vm@kIƒ@@Kšm@—VaX‚I@W@aU@kUƒVU_™KƒbƒJkkǎ™b@nkKmL™wÅW@kVUUƒVU@WUIƒJmIXmma@_kyVaUUlkUm@ƒkU›x¯Lƒm@L@LUJ™UkVWXUWUL¯wVmUkƒxkL@`›bk„mVnxƒXUWUnmƒƒ@kxU@"],encodeOffsets:[[114087,37682]]}},{type:"Feature",id:"1408",properties:{name:"运城市",cp:[111.1487,35.2002],childNum:13},geometry:{type:"Polygon",coordinates:["@@„Vl„nJ˜wkaVa„XšWVLĊknmnL‚l@@bn‚V@UaVU@UVK@aXI˜KXL@bVVVbXVVblV„aVnK@¯šKVk„J@bšVVU@UVwkVƒKVwUUm@@Xk@K@kVUn@lbl@²l@UlK²VVIVV„KVLlw@VXL@b@VV@VŽXbVK‚@XbVIUW„L‚U²ÆLmaUankVKVaƒ¯@ƒnkUa„U°@„š‚n@@kWa„UVaXUW@IXKVw@U™ƒ„™WU@W@@UUƒU@mn@ƒ`m@UUULkUmJ™IUƒ@@UƒK@U@›anƒ™ak_@wmKUwmakV™kmK™V™k¯b™wƒ`kwUIÇx¯»ÇaŃmn@@™mƒmUkV@wkKW@kxmL™UkĉLÝk™xÝw¯lóVU„mV@ĀVVX¦W¤kz@`Vx°„²ĸ‚š@„Ul@x„êĸNJ°¤V„VlXLWnXxmV@nUl@„"],encodeOffsets:[[113232,36597]]}},{type:"Feature",id:"1402",properties:{name:"大同市",cp:[113.7854,39.8035],childNum:8},geometry:{type:"Polygon",coordinates:["@@²£šyl@Ȑ˜Ė@bĸŽĢbĸ„˜X„a‚KŤnn@ŎôllÈx„nVnÞDŽV@b‚nXllL°KšbVb@J@b—„‚„@ŽU„„xlKXLlKlXk„@Ulk„JlkUƒVKXUƒÇVIVm@_nǚLšašl‚w„VnU@UUwma@aƒaÝaLmUk@@Wƒ@U@@X™wVWÝUUUk@@VmLƒKV»nwUw™aUL@`mzƒJUIVƒUaUw™KUaVIlJôanÑlLVUn@ša„@VV„@@UUwVK°Vn_lJÆLœéW@UUUÅ@»lm@aÞIVwXW˜UUkkm@U@aƒU@mwU£VWU_kWmƒXwW_°yUkkK@UÇK@kkUVymóK—U@KWIƒbUak@mJ@bkbmLkŽ™UmƒkVU„W¦@lnb@„@Vƒ°ULml@nkVƒa™VmLUnk`±@—XƒWW@kbǦXŽ¯„WxI@xmbmxXlWV„„@bŎUz@J‚b@bÞb™ŽU@Wbk@ƒxk@WX¯VۙƒWÝbÝUkVUU@alI@a@akLWa™m@U¯UUmÇL@K@aU@¯VUkƒKmX@`@œkJ@nV‚Ub@lbVÆXVW„ULU`VbkLUV@XWl@bXJ˜@VbV@Vl"],encodeOffsets:[[115335,41209]]}},{type:"Feature",id:"1404",properties:{name:"长治市",cp:[112.8625,36.4746],childNum:12},geometry:{type:"Polygon",coordinates:["@@Uk™Lky@I‚JVa@mÞaWšy@_W@_WƒXVlUVwš@nw°K@m„UƒVaƒmVkU@mmmnLVUmKXa™U@IlKVUnK@UmWkX@WV_Vƒ@akU@a„KWIXyƒIUVmUn™Ua@WaXUVKVmkUWVkUƒLU@@VƒbƒKbƒIUmƒ@mbVL—x›WUUkn±V¯wƒbÅJUbmLkbmKÅKƒbVnUbƒV™KUb™KUbmLKmƒb™aƒKkUm@UŽnn‚VnxUVlUxl¼ƒk¯JUbU@Vbk@WšU@UVóI@`¯nWxkLƒK@nk`Wn@lUnƒVnm‚ƒXU`@mb@lkV@„VnklVVUblz@`nbWnnJ„IVJ@XUVV„UV@lÆXšxnKlL@mšaȍll„I„ašLV`„UlVV@@b@XJWUb@˜™n@L„@lJn@@UVKVaœUlnlJXb„k˜Wn_@mn@VkVK@a°@XklKVUUwVWUšƒĊƚ@šU²@@blLVWn@@bVa„XllVnnaVmša@¯VLnan@‚šmVm@knUVJ"],encodeOffsets:[[116269,37637]]}},{type:"Feature",id:"1406",properties:{name:"朔州市",cp:[113.0713,39.6991],childNum:5},geometry:{type:"Polygon",coordinates:["@@XXWVXVWnnlnn@èƼ@„„xlš„ŽV„nblšššVŽÈUVl‚š@„blnœL܃ĊmUkU@Ua‚—@WI@aXk@WVUlKUaV_VKXƒWUUÅka@VaU@mlI@›@_nW„LVl°UV@@b@LÈKVn°V@VšnXblK@b@bkJ@bVVlUÞVÞa„Xܚ°UXWl@„wl@XaV@šÝa@aa@IVyƍ@aƒƒXUWknwna@w‚JXw°ƒWÈ¥kI@W@kmKm™¯IUmkXWWkaƒbkImJ™UkL±aVƒb@lWXkJƒUkƒĉkƒ@UmU@a™KkƒVƒUkJlaU_™yƒ@UU@aUU¯LW`kLWnkJó™ƒbUƒbmK@aU@UVVL@VƒL@„UVULƒK@xUL@VUV@nml¯@UkmKUxmbVbUV@XƒlXVmnVbkxUbU@ƒbm@@VUlUVšb°@VX¯šm‚"],encodeOffsets:[[114615,40562]]}},{type:"Feature",id:"1405",properties:{name:"晋城市",cp:[112.7856,35.6342],childNum:6},geometry:{type:"Polygon",coordinates:["@@lV„Lšb„an‚LnKVašLVašL„UVaUm„aÆLnLlanKVaÆI„a°x²UlmVVœX˜wUKna„@Vn„J‚a„L„a@UV@@alUkKVKnkmmVwUk„w@ƒ™@kxWUXƒW@@mƒk@aUa@a¯aƒLkKmwkUm@kL@K@aWIXmƒVƒXƒWkUVakL@UVKƒw@aUK@UUKmLU@¯n™KUwVƒUIWJUWmka™@UXƒJƒk@UkmW@kLWKVƒx@bmI@VUaVU@a¯@UUmVKmX@±`kÝKVxUL±akL@V™bƒLkKmVƒ@XWVUbƒVXb@lm@@lW@@xk„lVUbnnmbUšlJ@„@L„@@V„b@‚WXš„UlkxVV@„šwn@ÜmnLlVkzƒ`UbmL@Vš@XL˜m„VnIÞ@VU°x@VnL˜x„V@LU°"],encodeOffsets:[[115223,36895]]}},{type:"Feature",id:"1401",properties:{name:"太原市",cp:[112.3352,37.9413],childNum:5},geometry:{type:"Polygon",coordinates:["@@„@VV@wVKnLVal@na°nšaVJœUlm„L°a@b„@lx@bULUlmx@Ln@lVkn„l˜@XI„w‚K„Vnƒ°aVXVx„ƒUaVU°K„nUlšUVL„KÆVš²Ģ‚lnXalLÈƘL„KUaVkUanmWU™a@WwkUWU¯y¯Ñ@anIl@@aVU„m„I„ymUƒLUUVakaU@@LmJkw±LKmVUI@W¯™VaU_l™kbW@kK@mƒUkaVƒmVaU™ƒIVmalk™W@wnIVy@klkWUU›VI@ƒƒUƒVkam@knU@mmmK@bblVUX@VkLV`@n±KU„ULƒ‚UnVVńUbÇKmV—Imbm@k¼ó@Ul™b@VmV@bXmaƒK@›UUxkV‚V@„xW„UxVnkVVJ@XnJ@XlV²LƂVbnL@lš@°"],encodeOffsets:[[114503,39134]]}},{type:"Feature",id:"1403",properties:{name:"阳泉市",cp:[113.4778,38.0951],childNum:3},geometry:{type:"Polygon",coordinates:["@@°@nb„@lb@b„b„b‚@„x²al@lb„KXU@m‚kUWkkmUUƒVwV@XUW@™naVklKXblKnL‚ƒnLVanImaXKlL„ašV@U@KUKW„alƒXK@£WKXUV@VU„ƒUUVW„_V™@W@@K„@šƒUƒƒIWmXUmƒULƒn™JkImmÝaUbLƒK@UƒWk@mn™Uƒ@kVWb@Ubmx@lƒzUxƒ`U„ULml@„XWlƒ@UV@nk@U‚Vb@X™Jm™@@Vknƒyk@ƒzƒJƒnUV@bk@mJ@b°Ò°zXVlVXx‚@šbXVmnVbUlVb"],encodeOffsets:[[115864,39336]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/si_chuan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"5133",properties:{name:"甘孜藏族自治州",cp:[99.9207,31.0803],childNum:18},geometry:{type:"Polygon",coordinates:["@@ƒaXamƒ¯wm@±°wUwV@UaVw²Kš™„U@UƒU„¥‚a„ƒ@£Þ™ôx‚Knkm™X¥™IUƒÝUwlk°V„@ƒÈ™‚KUwlkUyV¹„mšx²Xll„ÑW»š„l„w°UŎ„nƒ„„˜Jœƒl¯°V@wôIVÇn™nUllšLšVǚLô¼XW£@±„@¥k_ÇJƒkUéƒkšƒƒwXa@ƒšLlw²™Vx„b‚mš¼ÈxlLȃ„VWÞn¯mǙÑUÝlÛkwlĉmƒULmwUJ™ç@wkm@ÑlUX™ƒÑôġƒVa™ƒUф¯@wķÓkbV„mnU@@y¯IķKƒV@¹šaƒé@k„mÞU°¥@a¯@anKlblU„¥@óğç@Çw@wkla„çݱk¯±@ğÝUÛmݯwƒ@kb±¯akXWÜkXUÆÇUš¤X_Ɛw„V@¤ƒXU‚ƒbUƒŽƒIUlÇUkŽġ@™aXČmlUlèUV@„mVk¦Vxš@¦±š¯ƒƒ¯¯anlWš¯nƒƒÅw@w°KVak£m@klƒKknÇU™»óKšīlaUaV£@™™¯@ƙU™VƒÛÝÇXƒÇl—ÓlŹ„»WUğJ¯£mx™Lĵô›ºX„VlUll²bl„„lŽƒxónn°ÝšU¼mJUš¯nƒƒƒV@êĉ°Uĸ™w™@mƒ@¯kmXamѯaUwÝKU¥„mÅn¥Wmn™ƒ¹n±ƑƆÇôXê±NJnšƒ‚UôlĖkȂVÒ¯¼VnƒȮ¯ĀnƆ˜Ģ@Žk°V°¯ĢVlkšVxm¼X²™Ŏ@ŽVxknWÜ°U‚¯n™Æݜ@`„ôݲÒƒ‚Çzn‚mX@x„è°K°Å„UČĬóĖ݄ƒ˜ó¼ÅêƒÒƒbmšk@V„Ž˜„@ҁl@nĉܛê—x@Ėml՛J¯¦óxȭ°ÝmŽ¯Lĵè›Ā@Ɓ„l°żƒ‚šX@xmŽkV@z@‚„°blŽnÞ°J@bn@ƼUVƒUóŽóLƒ°X°ÝLƒxUn„°ƒĬƒn@lnL@ŽÆ@šn„KÆxnUnV˜InĬmÆnxŎ¼ĊIĢóÞ@ĊƒƨbUƒ‚mV¥lkƒ‚wnL„mšÅÆ¥Xƒ˜wU@w‚wUÞ™@alUUŚU™Vkkm°aU—°Ó°w°U„ƒ„b°aš²K˜¯œĕ˜@ÈbޏĊaš»„XVm°In„‚Ĭk¼Vb„ašJšôš£VĊan™‚k„ů™™nƒÜU@anKnĮ‚bÈmƎš»nI‚霣Ġ™"],encodeOffsets:[[103073,33295]]}},{type:"Feature",id:"5132",properties:{name:"阿坝藏族羌族自治州",cp:[102.4805,32.4536],childNum:13},geometry:{type:"Polygon",coordinates:["@@l@@þ²I@lƒ„VL°wnJ°Uĸ™Ŏè„Ilw„V°¤nĮ™¤Ý„lè„L@„ƒ„@x„l™è²ôĊ_ĊġVÈôJżīlbXšÆÈVŽkxÇVƒ„n°„¦Üb@è@nn@@°šUÈ¥WDŽ_Uala¯¯UǙkƒ»„mVwk»˜k²°VxlL@¤œ_@x‚`ȍ‚Ėöb˜š@l²alX„a@bnK°¦VK@nnWmx@nUnl@@lƒlĉk°l°UXkmW@Unš`k„ÇL„ŽW„ÛÈVxšVVlVk@l„IXb@ylXÈW˜Į„WŤzœy@šmIƒŽ²šJ‚š@nŽ°@V„„J°a„Å@ƒŎkVǚk™aUw„KVw™™Vƒ„@nkm™@±ôkô™ĊJš¼šInÑm±nIššÞ‚XȃĊxĊUÈbÜyÈ£Vkw@kVUV™„m@ša„»ÜbÈmƒUXwÝxƒUn¥@°ġ™Å‚aœJVk™aW¯Û@W¥—UŏĶ™@¯kUƒŃ@ašI@mmanwސ‚W@œ™mw°»Uřk¹±W„xVx¯¦U°ƒzţW™w@°ÇVÑk¯@„y°aš£š@šmšnl¼„ašÝÝakwUƒ±aĉImlĵn@ƒm@kkVƒ¯Ñm™ĸ™°x„l™œ@˜ƒXVÞmlÛݙĉUÅ¥mwÅ¥VaUw›™XġċaVůÛŹlwU¯U™ó±™xÛV±¯¯n¯mċƒLmnĊm‚™@™_kJWaXmwUƒĉK™»™@mwX݃UDŽkKÇw™»nƒaUw±škx™K@„Wb„x™„„lVê„lÈIl`@¦ƒŽ@²X¤Wó»™KUșŽ™KkkmVmšUÈóJ@x¯Uk°›„—Iƒƒm„ōƒ¯Vƒxƒk™ŽX¼ƒÒkk±W™wƒnUºVzklVxLǚ@„ƒŽ¯UklVxސV„šJW¦nšmlLówݚ@¤ƒ„bƒ¦„V@VƒV™š±LUxVbU@Vx¯x@²n‚°xn„Wb„b"],encodeOffsets:[[103073,33295]]}},{type:"Feature",id:"5134",properties:{name:"凉山彝族自治州",cp:[101.9641,27.6746],childNum:17},geometry:{type:"Polygon",coordinates:["@@ĶóšKnw°¤ĠIXVƒ¼kź˜Ôk‚„ÈWŽÞȄÜUVšÅš°@šš‚@U¤Vbkb™ĬôLš¼ÈVlm„Llkn@l¤Ub¯L@xÆx„„°mX™mk°b„°°„²™@¥‚™Uwl¥nU@ƒVUkçVnkWċšbĢ@lÈVVk„J„‚V„aV„W@£ƒUƏxW`™£ÈVVÅlWXÛlW°b²la„@°xnÞVÜĠÞ²@l°Þ²ƒèkblŽ@xÈx@Ġènal£nU‚Dz@‚ÞK„nn¤@¼˜°U¼„nV‚šXU‚šbn™ĠUVbUlVš°LX„@lV„èÜUnK@_ƒyXVyUwmIU»Vƒ„kÇ¥šÿkkV¯m±n@ƒn¯ÜanVVƄz@Ž‚bœwÜb„m@wša@kƒmk»@™a@VUUó„w˜@nb°mš„XŽmnVbގVôanwšJ‚ak£lw„˜šLšÅnÝ@wl¥IÇӃ@U™™Lƒ¼kVǃÅó¯kVmmw@ƒn_‚Vn»°LÅ»@éÇçŹīVÇÝ@ÝğU™ƒaVݙ™š¯ķlŭġlƒ@óÞۂċ@¯nkUӄ—m±™IVġUwóKUn±¯—K›w»ƒKݐV„nl@„óxUwţ›£ĉƒUmŗÇ݃K™„ÝUlmKƒ£UVŽ@ÞȎW¦„Ò@Ĭšnny‚@nÒmœVŽ—¼@°Vbl@VlnUUwl™°a@„œ„@llnk°lbnKWĀnŽU„VxUŽ‚²Å‚m¦Û›ÇŚƒaU„Vbš@¦m`móX™Umm™xÅ@±Þn虲™U¯»m™ƒV—m@wƒU@wݚÝmLƒa@„™VÇUk„l°¯„VlkVƒ¦UšmxƒaULUèVx@„kIUxmWV¼¯VmȯšU„nl›È—@m»Å™ƒVWxÅbÅğW@kƒm@kVV¦mlnn@‚ō„l¦Åƙxkœ"],encodeOffsets:[[102466,28756]]}},{type:"Feature",id:"5107",properties:{name:"绵阳市",cp:[104.7327,31.8713],childNum:8},geometry:{type:"Polygon",coordinates:["@@„ńlV°š@Őĵ˜VX»ÆUĊќJ‚w„@È»m»š£°Kšk@ÇnÑƍš@„w°JUwnw@wšbVbš@VlźLUw„aƒ»„aUklyUUVakwWXwWƒUxkLƒmn¥mšwk™˜UX™lJ„w@aƒIk°X„¥Wƒ²l¥šaU™„IlmkklƒÈL@m°nlWU™aW—š@Vƒ„@UaV¥@ašk@Çk¹ƒK@a™K@kƒKkšÇX@VU@kx±V™èkIWwUVUkkKÇ@ƒa@wkml¯@kUWn£Wa„aVwnaV݃w¯@UaWx—n›JńUxUšma@L@„mbUŽU±VVnkxUƙ„VŽm@kkKW°„X@¤ÇUkÆÇnU¦¯ŽkƒmLVwÅK@UóbÇƁVƒ¦™L@‚±êX¦mVޚkÜÝnWU—„›@kšƒŽ¯wķšnš°ÒU„lln@@„ĶmnkĊJ²bV„lxÞb™Þƒbk»™m™n™@™¤¯bƒz@Žl°UÒ¯È@ŽšxŤX„yV¯°¥Uwƒw²XlºVŚ¯¼nx›š@ŽXݏmxnb@n™J@b"],encodeOffsets:[[106448,33694]]}},{type:"Feature",id:"5117",properties:{name:"达州市",cp:[107.6111,31.333],childNum:7},geometry:{type:"Polygon",coordinates:["@@Uxn°‚bnŽlUnÒƃnn@n‚¤„LnxlU„ššV@„Æl„x°XXxl`XœƒVW‚œL˜è—„±nÈbƒŽ°b@š²x°Kܼ°ĉ„V¦lJnU@¦šÞ‚JÞğ„mšLÞ»šxU„lb„VÆann„alŽ„VƍX@lnŎV„mU™maÅXƒa@aWmœ@‚£@wĉJVƒkk‚kkmƒnk@ƒmna@šal„Kš™‚J@Þwm‚ÅŃ@ambkUƒƒ@™™KUġKU@m‚ak¯±ƒ„a@aĉÑÅaVwšXlwƒ±—V¥l@@a™kƒ›@@£šmƒĉÝónWV@ŽnÝÇÇx—UmbƒaVkkk@m„@m°ƒÝýXm›akÅīƒ@@ƒmb@@xmšnbƒ@mxšŽkWL@ƒ¯b@WUXmWœWKkbm@kx™Xmm@LUl„xlêóK™nUš„all™LƒlLó°m¯JVšU„K„„@x˜K²Āô¦l°"],encodeOffsets:[[109519,31917]]}},{type:"Feature",id:"5108",properties:{name:"广元市",cp:[105.6885,32.2284],childNum:5},geometry:{type:"Polygon",coordinates:["@@ÆL„Ċx°»Ŧ¦˜W„™šLȄ@xÞKÜ°ÞnVxÅĀlÒnJ°a@w„V¯l@XWknKnw˜VȚ°XXa˜lX°VI°b„W„nšaššš¥@ƒw°™n@šyÆ@nkÞ@°¯lJn„°IÈl‚UšlXÅ@ķlUV¥VUUÝޙUUƒ@UwƒJUkĉm@ýƒƒlk™WUwVwWJk@VUK™lUkaVƒUƒmLk„m@ƒƒ@Uƒ›Ik`@„™UmlUkV¯ÇXKÝ_mm¯@Uƒ`kwmƒl¼±KV¯—¯Vk±Vk±kzma™KUnDZ™bk¦±ŽX„ƒ¦¯Wl„J@bƒxkIWš—Vlš™xnŽm¦„nlKVwX„WxXŽlxUbVVkzVlƒb„¼ƒbVxŹKUk™@Ua™a@xmxVx¯Iƒx™@ŎmÒ@șl¯L™¤n¼"],encodeOffsets:[[107146,33452]]}},{type:"Feature",id:"5118",properties:{name:"雅安市",cp:[102.6672,29.8938],childNum:8},geometry:{type:"Polygon",coordinates:["@@ln@xšèVInxVKn„‚ĊklxkÜVޚÒnÈm°nxš@š¼ĊLV„nx‚WXblIš`š@nmĉn‚KȄôÅlUÑmU„K²¹@ÇÅVÓůVýÞW„‚UVmX„ÆbnwšKUÿ‚™@UmmIUb¯¥Uwƒ™¯™Çmš™„çmanUm»UUƒl—kƒ¤ƒa¯bV™U_WĕmÇŚ±ĢUlƒUl™ÛVƒçkUƒ@WŽ¯KU™VkUağVmš™aV™WUƒmV»—¯@»m£ƒmÝLŽ±@ÈmVk¤mb@ôƒ¦kVkamL@b°‚@b¯¦ÝVƒn@l„ê™b@º„UĸL°J@zV@nmUƒlaĸÔ@xƒ°VҚ„Ub„‚óĢ„ÒWškV@Ò"],encodeOffsets:[[104727,30797]]}},{type:"Feature",id:"5115",properties:{name:"宜宾市",cp:[104.6558,28.548],childNum:10},geometry:{type:"Polygon",coordinates:["@@VlÈnl‚XnWLX`m„²nV‚@b°xĢçlnšVm‚nn„@@„°‚UzšlV°nޘÒkxl„w„`UnVb„mšL@albÞKÈۚmܼ°@Xǚ@wmW@ńKĊL„lV„šLVŎçÞL²±‚ğkw@Uƒy@¹lKX™lKVa@w™™Č@‚w@a˜ÇU¯n™@@wġak—™aō‚ƒƒK@Å»VakUWmķwkbğ¥mL™akš™@ġރ°¯xVVÞ@VšxVš—VWx„XlxU‚™@k²WVŃULmèULVĊklĠ„VœJVx±nŃ¯¦mwğ@mƒƒlğkkl±@kšUk@¯±Ç™Kƒ—kxl¤b™Imx"],encodeOffsets:[[106099,29279]]}},{type:"Feature",id:"5111",properties:{name:"乐山市",cp:[103.5791,29.1742],childNum:9},geometry:{type:"Polygon",coordinates:["@@kšVŽk„ššÆkšV²UlºÈIlxƒLXèÜlU„„XU‚mkƒbVè„x°@„@¼°Knnn@m˜ÆIUbnJ@bVI°b°±@nK@mVakkƒKl¯nbšmĸ„èl@VnÈl‚UUw„wmwnm°¥„L„™lLnU@Va™ImbkƒmK„ƒƒnk@mƒb™ƒƒLV„JVUUƒ„VnkVmb@a¯JUaÆkk¥„IW¥„Klw—ÑmÝU¯™kVy¯@ƒƒ@mmn™Ukmġè¯w@aU±mnƒW_XKWmkÇmUkóbUÝUanmW™ƒ¯nma—@ƒxVôUV@šb@‚l¼„n@l™b@xƒnÛa›xa@ƒyUÅmUÛbm°@„m‚n²U°ll™ĀȦƒlU„V¼nJVxUz‚W„z@`mL"],encodeOffsets:[[105480,29993]]}},{type:"Feature",id:"5113",properties:{name:"南充市",cp:[106.2048,31.1517],childNum:7},geometry:{type:"Polygon",coordinates:["@@ȲVmšLnblyl²²UUl˜°U°²L‚»„knlx„_VŽ°@nnÞ`WL°ÈUŽVlnkšV@ƒl_œJV„‚@„„n@lƒnKV£™Çšƒ„UV¯šm„@laX˜U„‚UbVx„@VkôJU°Jn™@™‚wUk°wnUƒV_nJmknmm¯Vwk¯ó¥±ÿ—L@wƒƒƒLVU™kU›bX¯mykI@a±Kk¦ULmaXƒƒVm¯ƒK—z±ƒklUIVbÇJšƒkL¯™l™ƒU™ÿ™UƒlUkJƒUmŽUUkVVklKk@@a™U@„™J„²ƒxƒ¦kĬ@¼±ºXnWb—xƒU@xƒx@lšL@b„Llº@șl@bU¦Vbƒ@U„™@X˜‚bVškX¯m@nÇKk„llknƒJVš"],encodeOffsets:[[107989,32282]]}},{type:"Feature",id:"5119",properties:{name:"巴中市",cp:[107.0618,31.9977],childNum:4},geometry:{type:"Polygon",coordinates:["@@V„U„lbkVšŽVLUŽl@XI‚ŽUxVxšXkl„„@þĊnVl„IVx„@VVݚVÞUVU¦kV@ĸWÆô²š@VÞnš@Vaôb²W@‚K@XUmÑUW°¯°Ina@y„_lWn¼lLUbô¼„Kla@™nkUyô—Æx°@šn£™Ý@¥mVkIU¥Ċƒ‚¯Û»¯L±w@™¯a„Ça²m˜ƒ—ç›KX„UW›k_Ww¯WƒwÅk@ƒ™Uƒ™kVmwƒK£@mmmńmÑkVmamnnlmIU`V„m¯xVlx@šmš¯IV‚óIUlƒ@UwVaƒ—VW‚kbƒ@™nU°ƒV™„šÈU¤"],encodeOffsets:[[108957,32569]]}},{type:"Feature",id:"5105",properties:{name:"泸州市",cp:[105.4578,28.493],childNum:5},geometry:{type:"Polygon",coordinates:["@@VVXwVKn„˜wnVƒn„l@b¯xmKUbVn°°X°@blLšènV„@Vn‚l@U„LnmmUna„VV_ĶV@wnJ„„l@@kkKVólaUwnJm„wUlm@ašUaôKVnJWbޚ@VšwVLX¥VVš_Þ`šw„WƒÞŹmmnIn¥Wƒ@k„WV¯@ƒ°kI™ŽƒLk¼Ç@k¤±Xk˜™nmݯUlÅÛKWV¯kƒlUwkLƒÓ™@U—@ƒ‚w@ġXV„˜WX„š@UbVbšV›š_kÇV™lU°lnwŎ¦ÞaƯnmm¯šU„™m¥nkVmkƒl_ó¥¯UÇl¯@™ƒ™L™kƒ`¯ķLUy¯@mw—¼ķ°ġ_řU°mlšnÇVUޚ„@‚ƒš_ƒJUnV‚UXšbl˜Ģb@x@mšV°—È‚b@‚xċ@šš@xUbkLWškL@º„zV‚@lxĠ±²"],encodeOffsets:[[107674,29639]]}},{type:"Feature",id:"5101",properties:{name:"成都市",cp:[103.9526,30.7617],childNum:11},geometry:{type:"Polygon",coordinates:["@@°n°m²°ÜUšw²ŽôVš°ŽVkxÜźUŰČb‚ŽĢlaÈL„»ƒ@k„wVǂ@„ƒnÛƻșUÝ°Kl_„V°Uš`Vbn@VbÈLšaVU@ƨ»V™nIl™šUUa„±lIk±š@VnKmÅ@WaƒK¦™lVōškK™Ý@maXÇmw¯IU‚@kƒVƒwUmVIƒƒƒç—ÿƒU±ŽÅ@¯È@xƒK@wƒLUbÇKō@mÝ£@yóUóóUxkI@WlIUaƒbƒaŽVĀ™LmxÅaWƒUnVƒÝXUþÆ°UÔÈÆ@±ºƒLnVVÒkóÆ"],encodeOffsets:[[105492,31534]]}},{type:"Feature",id:"5120",properties:{name:"资阳市",cp:[104.9744,30.1575],childNum:4},geometry:{type:"Polygon",coordinates:["@@„è„„UJVn„x„U@lV°JnxWÈnbÞ@šŽlLŎ™Ušk‚¥„LXbÆ@nŽmLU‚@zlbXmlnVynL„çšJVb‚UnómUnamU„an¥lKV_²aValWô„n@nƒ‚bVœK°¯VblW@kkƒlUnlV£°W@w„UXk°KVwƒmVkwVyVI@wkmƒVÅ_Umm@Uÿmbk£™xUaVw±V¼V¤kLWxU@Uk™bƒyƒXšómƒ°V@@zÝÒkKƒn™±U@@_VVkƒÇaVwnLWalm@@kkVVl™¦kIV`±n@w„Kƒƒk²™aƒVUUV¤™nkxmUkVWVnLUbVbƒ`kUU„mLU‚mX@`ÅbǚXbWLXŽ›n"],encodeOffsets:[[106695,31062]]}},{type:"Feature",id:"5104",properties:{name:"攀枝花市",cp:[101.6895,26.7133],childNum:3},geometry:{type:"Polygon",coordinates:["@@„b‚KÞnޙ@x„V@x˜n„Unš°¼šVš±mç²ÝÆ@šwnnšVWŽnôn_@¥‚™UaVƒ„bƙœÈ܎n¥Æ±VUwVƒmXÿmLkal¯km@k›ƒ@ƒ¯bkšVxmVUkk@Ua@¯˜»Un›mс@mz™m@īƒÑX¥Ç@ݙxU¦ƒšÅŽÇUkx@šlb„UWVX„mV@xĵĖ±@@Ž¯xUšÆLnÆm„šx@nXL±lUUVwKWak@WxkbšÞƒŽĉbUn@‚ƒ@@xó¦„Ŏ"],encodeOffsets:[[103602,27816]]}},{type:"Feature",id:"5114",properties:{name:"眉山市",cp:[103.8098,30.0146],childNum:6},geometry:{type:"Polygon",coordinates:["@@„šVx°¦VanJVnš@„b„aVbkJ@XlJVwôôôV@zÞ¤@nƎÈLVa„K@x„L@w°ÇÆ@²„V˜ĀœmWXKWașÆa@_nWVnKVƒlV„_UaVamKXUWwnmmwœÑm£@ynUƒkWƒĉUkWVkkV±çkJmkKƒšƒK¯¦mnnxƒxVxVÇkUmk@ƒçķ™nmak°„LllUb@nmL@‚¯²¯aUJ@amIVaÅJn—m@mm¯L@»ƒŽ¯@ƒwUç„anlVƒWVƒÛkWç„KkwÇJk¹±V™UÅl™™ġV™²ÈƂnXĖV`Uš°a„b„£˜l„kVVn¼mVnbƒè™šÈn°š"],encodeOffsets:[[105683,30685]]}},{type:"Feature",id:"5116",properties:{name:"广安市",cp:[106.6333,30.4376],childNum:5},geometry:{type:"Polygon",coordinates:["@@„VlIV‚„kšVšĀ„Vkš°šlK™„ÈIUaVJlk²„˜y„Ln°„UW„nbVKl¥²L@blJnzW°œalV°Inô¯‚K„kšKkkƒbV™šmôLkéƒwVk@KnnšWlwn@laXL›ŽnXVW@X°a@„XKl™nw„@man™@w‚@na@„„@ƒw™ĕġġ™wUkUWb@mk@™¦ƒ¥mUÛb±yÅn@bml@kV@„ƒlknVbmVnlmš—bÇk¯bWyk@V_UamJ@I—@WaƒVXamIVWkUkbVaƒUUxƒ@VnkVU¼›bkKUxmK™„@WšƒxnV@n"],encodeOffsets:[[108518,31208]]}},{type:"Feature",id:"5106",properties:{name:"德阳市",cp:[104.48,31.1133],childNum:6},geometry:{type:"Polygon",coordinates:["@@nUW¥²é@šK„¥‚UÈÅôa@VÆLUxnKl„°V¥ÈmlÅÈV@£ƒWX¯lLln@UšƒVÅlwUm²U‚VVna@ƒ@KnbV™VwƃœI˜mXwWƒkIVwÝĕVUa™IƒèmKUzkmWnka@y™@l²kJƒ²Vb™VkšmJUšƧ¼@UV™bÇKUam@Ua™_¯VƒUk`¯LVÞǚżm܃„@Uȃx@l„ƒ¼ÇKkbWŽœšVxUbƦnxƦĊV"],encodeOffsets:[[106594,32457]]}},{type:"Feature",id:"5110",properties:{name:"内江市",cp:[104.8535,29.6136],childNum:4},geometry:{type:"Polygon",coordinates:["@@²èlUUllXĊVX„„lmV@zn¤›ÒnxmnXxlUnVlwšmU£VV„Ušbl±„„ƒL@x²mU_lJš¥UklU@ln@‚kXbmKUxÈbl„UU@`V@š²„mlLÞÑ@yU@„¯ôn‚™„W„zšaVlV@XwlKU£‚»—aVaUwm@mwUVUwkƒlVDzLlƒ„KV™m_@ykUmƒ@mU™çkKmxkIU‚Ý„@LUJ@n±„kº‚LXb™¼@mmIXa™@mamnkW™ƒKUƒƒxƒ_U`UklwUw™mUbƒV™²ƒakbƒmkn@`„UmҙšVxUb™I™`UƒaÝÈ"],encodeOffsets:[[106774,30342]]}},{type:"Feature",id:"5109",properties:{name:"遂宁市",cp:[105.5347,30.6683],childNum:4},geometry:{type:"Polygon",coordinates:["@@ÞĖUxlJX„Vb°@„xUÞmbUxƒbXbm¤VX@lk°ln@x„bÈ@lLVlVUXxlJšç²UlwV@@UÈWl™„L„w@w„V˜wXaWm²¹@»lī„¥„wƒ±šI@ƒšV@bl@kLUllUVVn@mmU„wX™ċbVb@VUkbmamšW@kƒa@™™k@ƒlaUa™@¯b@šmmwó@@lkXUa¯°›LU‚am„m@óƒkXUb±bU`kLm¦ƒbnVmbnVmô"],encodeOffsets:[[107595,31270]]}},{type:"Feature",id:"5103",properties:{name:"自贡市",cp:[104.6667,29.2786],childNum:3},geometry:{type:"Polygon",coordinates:["@@lIÞDŽbVŽš_šJVaUwš™nуV@_lm„nla„bš±„UVašnVxkxVlV_„`„wV„„LšlXnmnbš@WbnJ@nš»WaKl¹²ƒ@mVI@KރVlJnw@aW¯¯¯UmVanL°w@aƒk„mmU—xmƒULWxUUÝKōèU™KUƒƒkĉKƒL@ÆnX@x™‚Wȯ@Û»™nÇÜÝLka@b™KƒnUaVmƒ_ƒxkƒLX¦ƒJl¦ÅlVb°I@bnaUŽmlƒUV„UVƒIUŽ„Kš„„a@nml„„ƒŽnLl„našJUbV@"],encodeOffsets:[[106752,30347]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/tai_wan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"7100",properties:{name:"台湾",cp:[121.0295,23.6082],childNum:1},geometry:{type:"Polygon",coordinates:["@@\\sŽ@pS}aekgKSu™SsMß`¡CqZ·be@Q^o@‹gieMp‹‰]}•}Ľc_Kk…{™ù“A¡r‰[uom@эĥJiq©mʼnq¯Bq]ÙYgSåk_gwU­isTE…“‘ĕiqiUEkue_‰OSsZ‹aWKo¡­q“ycY£w}‹ĩ™ĕS§Z©S™N¥SyLÑ¡±Ks^IY‰PdƒY[Uo†Fp}´\\¬\\j]ˆe܍ò‹¤¡–ā a\\bn™U㺹Ìs¼j®[cíȈEŽĝĆ`ļf¶Š®K|VØDdKGpVnU‚FjpH—F`†B’[pMºxÖjbpÎxp€¬‚|ΟÜÒCŠ²®‚ÜAp„ZG~€Šd˜ÞàV¨|¸€`|Œ²tx~\\~|dFf^zG€ĄŚhœdL\\hĸž¼†ŠOªP®lV`p\\]Xpll˜æ¤œCpQ|oF}fMRi†NSon_²qämœM„NM‹\\•"],encodeOffsets:[[124853,25650]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/tian_jin_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"120225",properties:{name:"蓟县",cp:[117.4672,40.004],childNum:1},geometry:{type:"Polygon",coordinates:["@@EUDAEI@WNMNCBFAHFFNACDJDPBD@@GD@DIFFHEFGDBDEQOFG@EI_KG@OcJQM]RMEKBGPG@[LaCIICBWKCEEG@WBQHCDFD@HSLEJI@IHWECFGAAEKCGDBFCBSBIDCKKHEADMJMFABKOKEQAA@IEEG@GIQAEK@OZEESMOL“lu@SLUTYFQCMG@@SQUAYKAACA@IB@BDB@B@DC@@BGAEFAA@BEGKJCC@AGAIHA@@JC@QEIP@@A@EGIDC@O@C@@@@CJCWKABFLBBEBSQGBAAMIEM@AKBcJEN@BEBCFMAEFEF@J@BG@BFABECKFG@AFQ@@F@BEB@@A@@AAAKAE@GFGDECEFEECBKIKDELDFEDYH@EIACDCHKBEB@BAAC@ADBHABKJIAIJICEDGDCD@@A@A@DHCHJHDFEFGBKRKBGIK@GIMHSBCH_BOJECCJCFKKMD@DNJEDEGC@OJCJHRUL@HRJ@H[DCNKDZHCTFDHCFFKR`TANVDFZRDLFARB@HPAPG`ILAR@TERNDFNHDLCLDDCXDYbHF@FEB@LDDVE@JPNfXPINCVDJJD@NJPAJHLXHDNANHhB@DPNLRMTBFRBHHr@`NBFEBOCCBIAQJDHCHLHFA@HSDCRLFTB@HEFLNF@PELBDJALFLTC@EPFLLP@tUHQJDfIHGTB^JTCPDLKAIBATFPADIEGECEMJ@JIAIHGECFEAGDI\\SPOXAFCL@BQTQBBTMZECYGAHA@GJAE@HCAEME@IECFKJADDBABLTHHG@ILEAMNDJCDHEBF@@JNFJELDFKTOT@JETBFFHBHEHKI@@IJEJ@XKEOUMS@AF@CEB"],encodeOffsets:[[120575,41009]]}},{type:"Feature",id:"120114",properties:{name:"武清区",cp:[117.0621,39.4121],childNum:1},geometry:{type:"Polygon",coordinates:["@@FWôµ@IFCLIB@EHNBp]AGEAKAEDMGZKFGBGME@ILGP@HEFB@BXMEAHUGC@IHCLOD@X[NWHWPKAEF[@EKIOL@EKGBNMJ@EIEHKBIC@BAKMIACCFQZCF]DB@ERAKADIHGEIBCGIIECFaGLZO@EFCNGAGDGAKL@BMG@IE@ADSDEH[JGC@CGA@BMDeK@EIACFE@@GG@FIAMM@CCGC@EM@ADE@CFMAAGHBDKIEAJG@DOGCDEKAGIS@KFCHKAEHIE]BeKNO[IFIOELC@A]GMBKVYCDDgGAICARc@MW@AQE@DGI@@AQ@@BKBAIQQYEFW@CEADIGGBCEIiMEMF_LGEKMBBDWEBGRC@E_CHYGCH_IAED@FFBQh@FGJaJ}AHRAREF@bE\\C@CT`FHC@\\BBF@BID@HGDDJ@@FAHKBARECKDAZBJIVNHCTA@EREAMLHDAFFBVFFC@RNRETHD@FOJMACH@CAB@P@DF@@FGDWE@FFSIEMKQDYCCHKb^JADOCIDGNDBdBCFJB@EC\\A@BJEA@JAAAD@HHD@LFBCFF@BERDHNhZQHMBGHOACCEBWEGD@PSJKCGEUD@CINLFGHE@AJK@HDABBHTB@F`DBFLBBHEDARCFG@ABJBAPVFE^FBGLGCFG_BMLEXGAAFE@@JNRVJHFALFBEHQJCTbNDHCF@PlFLJSXCHFHfVBTNJ\\BPJXC^FAVNFCHFB@FFH@JF@\\ABCFD\\BDMCAAJKQBGAILOEGHILECQLWFENJHADC@QxNHFJNLDFA@CBA@D˜UÂmR@FBL@BD"],encodeOffsets:[[119959,40574]]}},{type:"Feature",id:"120115",properties:{name:"宝坻区",cp:[117.4274,39.5913],childNum:1},geometry:{type:"Polygon",coordinates:["@@TZbB@JHD@DODCLM@AP@LL@BNH@ETFN@`E@DNG@CHLBCJA@AICFKDDBKA@\\N@AFNAGRBFjFFFL@DHLBLFQPcXAZMJ]GAVHAIZJFNE@JpDRRDCLFDGXA@EFF@CFFPDfEBDB@DCHCFCJDJIJBLI@I@CB@@ADBB@FALADGDC@@H@BB@FZGFCCE@@FMLALJDAFFFEFDFCB@@AHCF@L@@BBB@BB@FC@E@@R@BEL@HEFD@G@AH@AIB@@@FEFEBALDDEFAFO^IF@JCBBFPNJJ@D@PRDCEKBAXL@BIFD@T@JE@BHHJORFDI@@B@JGH@@B@BDDLIFFHCD@D@DEE@BAAAB@DAF@B@H@NGLJLMRDNMfGIEPMI@GDAKK@KIDIJ@GE@CFDN@FE@GFEPGV@TCDFKHBBF@RW@DD@@ID@TJFKIKLI@EP@IGBCLAEKLEN@KSHIGYACSD@SEAMBBMGEBMQBCMIGKFB[D@HDLPHDBC@IFITDLG@IIIFGVBNJDLN@VIRI@YIAIHIC@CLKZCBEE@JECEIHEAKGDGECBGEEM@@DA@CCCBBEGA[GEDBBoNAAH]MKiIAWKQoIIPMFQAEEDMH@FMSUYIeF@EK@BIOEKJEBICFKaKPFAFSE@LWCCFMHDDEKESBOGBKIEIODLG@CCDEQCEDWEMDIEIB@EHGEEDAEAa@@HqDEJGF[AECCFa@WCEIKAAEQB@FCAE^YDERDDJBLNABD@AJGLJF@FNIAMLH@FPKLJ@FE\\BFOLGXMXW\\C@KPGD@JHDGVFBWN@AEAGFO@KH@JNFAHEHYLNHFCLBFBBHo^MAFGA@KJED@Jó¶EX"],encodeOffsets:[[119959,40574]]}},{type:"Feature",id:"120223",properties:{name:"静海县",cp:[116.9824,38.8312],childNum:1},geometry:{type:"Polygon",coordinates:["@@NGFMDATCNDR@CCbINEHNJA@C\\EEGVE@IhE–[˜w”epc¢·²›^QEKIEKIgiQDkehY£uSDBMkUDOJDHC@GF@CAFBFEN@C‹Q@BeP@@G@HD@@MHQKi@[IGCOCESE@GMA_OcCGDu`aˆ@VZzKDkJBLNXGDqKEWE@cFEFA@ƒISIi@@KMABJGBcMuFEzGVH\\ATSEUBeALCEMG@CEBUHUCGXaBPtUBBFIBFTDFF@DDKBFNGBJPHXDDMDCLJ^mBIHIL@LR\\@LCR[@@z@NFD@LLBNb@RHDBNTPT\\F@BJF@BXCFBHHBDLFB@HODADE@@JHVXCPDHCFTLBBFNCDCCCU@@GAABEHHZHBCAEdEjFDD@GfD@DXFCHF@ERFDLBH@"],encodeOffsets:[[119688,40010]]}},{type:"Feature",id:"120221",properties:{name:"宁河县",cp:[117.6801,39.3853],childNum:1},geometry:{type:"Polygon",coordinates:["@@BFLBFJXDb@DEFD\\BHEFIrC@Gb@FBCBFFGH@FJAJFNCXFFCRDCFDDH@CKJPJFALPHTALFCFGCENDDKXF@ETEBO‚bLELJDFALIPFAJL@@FfEZJTVENG@CNFFRBNEJOpJLRBXjJNLG^BBpMAAFC\\HHBAFDADDB@@CN@FFAHFDCHLHFBJGFCFUNKJJTD\\XUXF\\^F@DDDQXXBRLRCBDFEVCDLVDpUl@LEDJHAPRFGL@CETGPBTCDDVI@CFF@GFDCCVGLKEK[Y@MECISG@BKNSCGCKWEAaEBEKNGFSECO@GGM@GYI@DÅCMLHPTF@DJHAVVNKEGDETJ^[TJNNd@NOAMFYJ@@GFANDPEJB^aOadSTQSI@MHBDIEOKCG@EEFCKCqXO@@DMFENCDDHCCGJ]AKFoDaGGHYFDHKJiCMFGC@EQ@AEHGAC@IEAATKOHGIC@IXIFEoƒGE[JCFCDHNmRADFZMF[EEBMO{GU@AOW@@]ZeHBDEHBKEfQkuIWBs‡@EC@d[@[^EDMTKCEEcI@cDAB@FCBCACmOCG{PYHeBgPwPFDDALFFFCHQGSD@BHFAR[TaFYXMASUiGFL@DQNCJI@@D@PLDN`ETEFIGMCGBCE‘~CAIFDPEHGEQPHJADFJGHCJLB"],encodeOffsets:[[120145,40295]]}},{type:"Feature",id:"120109",properties:{name:"大港区",cp:[117.3875,38.757],childNum:1},geometry:{type:"Polygon",coordinates:["@@JFFL°_`ONJKDDFIFZN xlb~yFVNRŒrdJGzDPVFBCTNND\\UR@E`F@@Ip@IWGUoawOEE@ÏDgK{İEEMFëC—b…™@—KwOCDHHKBDJCDEEEAGHOABFABMCgDLSQ@CFEB‰MgYIDQINE@AUSwSAdYEHQMEyK[KI@GRMLE@@OqOoBOnpJ@BmEAFHL^FDB[C@BBDVFAHFJENB@sNEjQAMYsUgCSBGDJH@\\LjGR@NC@@G@HO@AfR@DŒM@EFEADBE@@HGDICCPlVANTC¤vgZlfRChjLJ"],encodeOffsets:[[120065,39771]]}},{type:"Feature",id:"120107",properties:{name:"塘沽区",cp:[117.6801,38.9987],childNum:1},geometry:{type:"Polygon",coordinates:["@@|ODHnPBDADEDA@CB@ddJFFLDNSFC\\]\\@@cFDˆ@nACOMW@M@ITURBRZNHNWRQšoO•j½f‡cqŸAqeiDÿÍyÓįFL|Ch@ÐFFxPpbHVJXo@@JCTR^BPABQA]^MB@bE@@FQBFVJRH@FXtPNZSBAja@@NƒDTŽLJrQTHFXZFB`"],encodeOffsets:[[120391,40118]]}},{type:"Feature",id:"120111",properties:{name:"西青区",cp:[117.1829,39.0022],childNum:1},geometry:{type:"Polygon",coordinates:["@@@LHAHRHATh`LHNHDG`HDGZ`D@FQDAHXFACNAFLVRTBFOfHDCVBFQH@HSXHEPFB@LDBF[bDbLFKJBFLADBDjLvCPEI]FGEIGCBEUSjcFiBIVWfaHCjN^HtwBBFGPBJGjFBEGECGDONMFAP]TDHQOWCMGAMHKIJEIGQ]aDlUG]VGEGDC„{PEbBZmE@@GH@BCA@FMQCFMYMJECELCMI_P¯`]R±œ¡¸od“f—x•\\gF@JUFFH[F@DIBGMMFaJDDQ@MCSDCBENMH"],encodeOffsets:[[119688,40010]]}},{type:"Feature",id:"120113",properties:{name:"北辰区",cp:[117.1761,39.2548],childNum:1},geometry:{type:"Polygon",coordinates:["@@ROHFFGCOJEDB’}DFHANDJHFEFSM_KC@O@CJ@DIRM@CEKKA…L…FKACHoLSJSIBETDJaEIIE]E]K[MYUYQILC@GF[MGNKEK@A@BCWECAIFEFYAGFOMI[OFuDiKACBCEKIAELaKaCE\\CA@KEAFOWGGTG@ERUACDeGEPSAUQKHE`FNjNFJADHHCJFB@DEXZFRRBJLA@AR@@BJ@CHF@BRX@@NQdDBBJhHCCZDLUNA^H@BKDPFEJ\\JMPfL^AJFFGLBDGLET@HJLBCFHDCPH@BIJFCLGABHNBDEF@BCN@@FHDDDN@BNEJH@@HF@DEJB@FfLNC@AHB@DHD\\IFGTCBCF@@JNH@ALKHBHCHBDMFEP@KYbHDEJF"],encodeOffsets:[[120139,40273]]}},{type:"Feature",id:"120110",properties:{name:"东丽区",cp:[117.4013,39.1223],childNum:1},geometry:{type:"Polygon",coordinates:["@@ZV\\N^L^FJFFJIbSCAFTJTIpKDGLB†E†KLBjHTVNBZWbE\\SBQGE@ATCRHDGEEKECBECxOhOfAZGA_YEEWSGqRKIS„C@Mb@BiTAMYsOEWG@IQEURA@EF@@acUOXQRYCUDCHDTEF[SUEgAYDcVGJM`iAWDWLQRMHUHgDsDBLHJFCFDFGHBFFVEAGHCJN@RJF‡PIhBD\\FENCPWA@LFBAFHBEJUEARCDIAEDQBRNa^"],encodeOffsets:[[120048,40134]]}},{type:"Feature",id:"120108",properties:{name:"汉沽区",cp:[117.8888,39.2191],childNum:1},geometry:{type:"Polygon",coordinates:["@@LMEI\\MTABKN@FCDMH@COAcH[AoēA™M¡Wa[Meq™pQRMXMGQYQASV@J@NNXDPmBAtJXlveRLFGACFGAYf@^X@BPV@|HNPFA\\FNEEYBCnQGMDCDE\\IHFp„EFWJ@JJDGHLPBSFB@JBDGHBFR@@FHDNEjDLICGZEHGbHpCLE^BHIDDCGDCFMNE@CP@rWLDEDFFH@"],encodeOffsets:[[120859,40235]]}},{type:"Feature",id:"120112",properties:{name:"津南区",cp:[117.3958,38.9603],childNum:1},geometry:{type:"Polygon",coordinates:["@@TLv@CNHFFBHGZFETNPhCVGNGRQXKXCjBN_HIdUZChBVF\\TFECSDGVCZDRQPWdVNA^]RBBAAOQ]DSE@F_Q@[VMCSMADUECOHycI‹qMQEU}zkaŸwENRDENB@ADG@@HF@YnaAOFƒ|CDFHUHH^kVbCR^JHIFLJNGHBDNPXGRSCO^EBMNCPDHHFAFiEIHOAEH"],encodeOffsets:[[120045,39982]]}},{type:"Feature",id:"120103",properties:{name:"河西区",cp:[117.2365,39.0804],childNum:1},geometry:{type:"Polygon",coordinates:["@@d@hZNFdcLYXKRCtCMOFSYEGHEAGEDMu@SKAAsx]GMTGt"],encodeOffsets:[[119992,40041]]}},{type:"Feature",id:"120102",properties:{name:"河东区",cp:[117.2571,39.1209],childNum:1},geometry:{type:"Polygon",coordinates:["@@ZBVFFIGABEEA@KXBDOFM[EACJgˆOIE@QIMGDBHUFEEGAEHECEDGIAKQDWLKZcdQPEP@FOFBJTJ@HNORJf@DBCN"],encodeOffsets:[[120063,40098]]}},{type:"Feature",id:"120104",properties:{name:"南开区",cp:[117.1527,39.1065],childNum:1},geometry:{type:"Polygon",coordinates:["@@NMVDCG\\E^B@HlB@YEDS@C…HsNSiMGDebUXAJEjidVTAFHDFJ"],encodeOffsets:[[119940,40093]]}},{type:"Feature",id:"120105",properties:{name:"河北区",cp:[117.2145,39.1615],childNum:1},geometry:{type:"Polygon",coordinates:["@@DBXFADB@L@LFHM\\NHED@JKZRb]QMRAFCJBDCBQYADMCAe@QIMP@GSIAIPE@E[EGH@ZEF]^HJAXK@KF"],encodeOffsets:[[119980,40125]]}},{type:"Feature",id:"120106",properties:{name:"红桥区",cp:[117.1596,39.1663],childNum:1},geometry:{type:"Polygon",coordinates:["@@J\\PNHEZBFEJELEL@BWGI^]FEkA@G]A[FDHUCMNEHJ^"],encodeOffsets:[[119942,40112]]}},{type:"Feature",id:"120101",properties:{name:"和平区",cp:[117.2008,39.1189],childNum:1},geometry:{type:"Polygon",coordinates:["@@D†T@FCHG\\FFOROMEgYc@"],encodeOffsets:[[119992,40041]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/world_geo",[],function(){return{type:"FeatureCollection",offset:{x:170,y:90},features:[{type:"Feature",id:"AFG",properties:{name:"Afghanistan"},geometry:{type:"Polygon",coordinates:["@@ࡪ͇وŐǬϠڐŶӂʮǚڦ۾njƀ̚ІɣʪҴMوǯʲĹ،˒˰Nj˖ϪԈiżŬĘͺβ̈Ҕȏĝʱʪ¡ý۷ͪ˟̊ǰώĊԼϖׂ×ࢀAƬʋӧĥяƹ७ĭࣗǭӫλȤΣĪллΛ–͑ɳ̡ߛ€ͦ։՗ɅΥԕ²ԋ͡ɿ̳þٝŋğɻسDҵӇ‡܍થΓבôǝȁԇņ࠿űටіހހåզُƚßՔ˟ڢάҢιŮɲؒ΂ਸ"],encodeOffsets:[[62680,36506]]}},{type:"Feature",id:"AGO",properties:{name:"Angola"},geometry:{type:"MultiPolygon",coordinates:[["@@ȸصʌԋȘ˕͐ѯ֊æˤŠҬşŲɀɂӨԶ®ƤіHñ̡৴RfՉǞ͕ūԑÖԫ˪̷­ৃȼüκsԴŴϦ¹ĘʹĩСƨϿů̿î́ყZᦵ֤ۋպԽ໳΁᎝Š׋Ж₭—ŵÏԃϞկ~ԉƝЙDžÿՈŜ݊̂ޒªΰ˚ݶȨΆӘռːϐĘج«ӊʣ̜ɡԚȵԎ®Ǩʶͬʭ߼ǣ֚сՐĄǎΌŔʒg̎ĸៜ["],["@@ɉėɣلͼδʪƘ̀˽̩ǯƍɍλ"]],encodeOffsets:[[[16719,-6018]],[[12736,-5820]]]}},{type:"Feature",id:"ALB",properties:{name:"Albania"},geometry:{type:"Polygon",coordinates:["@@Ń˷ŢέΒȳiə˗ŧ»˙ϷСƛÐgȂү˰ñАîֶŖʼƗƂÉˌθаÂƿɨôǴɥȪďȨ̂"],encodeOffsets:[[21085,42860]]}},{type:"Feature",id:"ARE",properties:{name:"United Arab Emirates"},geometry:{type:"Polygon",coordinates:["@@Ƭ¤ŒɱڂƂ۞uԖ{ֺ֪ظՠՎԮdž˹ŖڑѕGçճƪŝϝǑE΅ʓΏuͷǝDZᡋъ͏࡚Ț"],encodeOffsets:[[52818,24828]]}},{type:"Feature",id:"ARG",properties:{name:"Argentina"},geometry:{type:"MultiPolygon",coordinates:[["@@ߗ§ѓ̔ԑx࣑@Aሞ͒ϵрؿનԋ୲ȿϙп"],["@@Ӵ؇͠ڰॠ“ƊǷ໶ോۊŷਆاࡾ͡Ŧχࠡ౧ࡒɭ़ŷڔƈނ٢ƎݐжLjфӝiڣۻҩ֟΁ॅࠃ૭ଧȽڥɣࡹT࠷ǽȇÝիËѫ੨ܙŗ׃Հν§Ч߯ઁఛ҉။ǩउĎǰԅǣػƺщԋ̏ࡱř̪͕߱ɗŜ࠳֨ʧҠˆʢѧޛʻڭԹūࡋȣ҇ߏEڃљʋؿؙࠞߦǝ˿ݭ঳Ӄձটލͧ΅Ͽ˔ࢍ֔ӡΟ¨ީƀ᎓ŒΑӪhؾ֓Ą̃̏óࢺ٤φˈՒĭьѾܔ̬૘ěӲξDŽę̈́ϵǚˢΜϛ͈ȝॺ͸Ǣƙ਀ȠࡲɤݢԊ̨ʭࠐEޚَոo۰ӒࠎDޜɓƶϭฐԬࡺÿࠀ̜ބռ߂צԺʥ͢Ǭ˔ඔࣶд̀ࢎĹɂ۬ݺશȱ"]],encodeOffsets:[[[-67072,-56524]],[[-66524,-22605]]]}},{type:"Feature",id:"ARM",properties:{name:"Armenia"},geometry:{type:"Polygon",coordinates:["@@୞ƀǨə͌ƣǛɁ҄˽ʁˋΦɫϘƏl׋̣}΃ӢHżχCʝɤǩuͧʖرȼĄФƛ̒"],encodeOffsets:[[44629,42079]]}},{type:"Feature",id:"ATF",properties:{name:"French Southern and Antarctic Lands"},geometry:{type:"Polygon",coordinates:["@@ը˃ߐĿˆDžɽϣಇÃq҂ŮΎÊǢ"],encodeOffsets:[[70590,-49792]]}},{type:"Feature",id:"AUS",properties:{name:"Australia"},geometry:{type:"MultiPolygon",coordinates:[["@@ߺ́ҜŘپNJԎÉÐঽ˽́ēگ̉ɰ׍בǧ®ԫ€ԭܘŗֈӝܸtϬռõ"],["@@̢ڇբ̈́˦ΡЖ͟đϋǴܛŸнɄĹɬܕąѥ˖֭࣬ѭצЋ֞λŋȯӔՃࣧ͜ͲȂ;ηȴźƢࢹ׬ԩϸ͋ڀڹʀڭtӏËԳА܋µݓơϵɩݡjӕǕ׻χއثЭ̫ٱ˫гʝܧ͕нɅػʼnׁªˇӕ̇व‰ޡ·ϫ͙ԕέ۟ψԥƪżѬҝǃ݁؉ܩɪӉƄӑÔ߿ʐիԮƻْțьЭ;߱ĸˢРȯزЧ׉ݝƷѮҬŶӞ͘ЬãجہܑԿ˽͏ڛٽΊ~ҀԿ،ѹ̀ǂȘઃԚןz߯Цຓāછ̝ख़˫ߡÈࢻљܯȗljѱ̳Ϳ܉qՅõݑƶ׿ğֽԁ҃ʕœуʁЗˋؕ֛Bࢽ՜ҋDŽlӖкŘƚȒ‡̠ĺאģӼѻࡖƏӒ˜ӎͭնsʚϋͰĽڄӓڔřΪτε˳ެиʑʞ͗aјеڎă˄țʦĠӠǢȸŘрęӮΎ؀Úٕ΢׀ۀˬЦΪٜ̰ϤàɴĻڎ̺ԚĤŶȀɞüҬoࢨʖҚώɊ҆ӲѐœͲvҘט܎ΠܩΦǚ̗Ј˂ТψǻĸٖҠаȮͨцƜ`ɼτĭdɂτŦОŔبϫҲӽՂMՖÿDZҦДڪϜɘſȾκӒԘ̒јıۺǂeі؛ˢ҂Ū֎ȻҀ·ۼɋʈĐԶʵӬʊ͂ñȠNJϬеɡ͉҇ͻ˿ƒĮͱʙп̗ЭÔʁڜҫ٨ˏѠ́؈ӻʂBѰɍŶʷߤ˵ֈ˼ǐҊǠόľҤʰڞŝОÔʔīӔŌنLjǠŽˬȮѾdžҦtʈ̸̾ʂЩÎՃȾķ˜Λ̨ёÚӇ‡̥"]],encodeOffsets:[[[148888,-41771]],[[147008,-14093]]]}},{type:"Feature",id:"AUT",properties:{name:"Austria"},geometry:{type:"Polygon",coordinates:["@@Û΃ӁCǎǻ˧էLJƗܽsщȏۛÞயɐȉ̊ࠧƣĭDžԗŢѕxϝƶźȴƬʪ²ьɹŤɜݎ•׸ƮЖ}ˀǣþƜšո̠ń̒ϰز˓ӀΆ̐ÚٶʱЂªϰǁãŃČ̅"],encodeOffsets:[[17388,49279]]}},{type:"Feature",id:"AZE",properties:{name:"Azerbaijan"},geometry:{type:"MultiPolygon",coordinates:[["@@ʞɣψDGŻ΄ӡֽŒщϰƃ͆Ǫv"],["@@ϊËƞɈԈͺѴѵђ׭ϺŸʸɧۗãƣٵƟ̭̍ȝvзȽ¥ԻѲ̂дʝʚ̿×যإk׌ϗƐΥɬʂˌ҃˾ǜɂ͋ƤǧɚȶƎضʍҐ¹ŘIJбҔɔŚʀ…׀ԙ"]],encodeOffsets:[[[46083,40694]],[[48511,42210]]]}},{type:"Feature",id:"BDI",properties:{name:"Burundi"},geometry:{type:"Polygon",coordinates:["@@Á০ɃϢԜßʲӎҀŸͧǸȏT˗ȹǭ͛ѫ̧̥΍Ÿ"],encodeOffsets:[[30045,-4607]]}},{type:"Feature",id:"BEL",properties:{name:"Belgium"},geometry:{type:"Polygon",coordinates:["@@؜áުǪՐοҦȝħ֧ɕĝһܿϦћßדІϷͶϷ`ũ̒ڪǔ"],encodeOffsets:[[3395,52579]]}},{type:"Feature",id:"BEN",properties:{name:"Benin"},geometry:{type:"Polygon",coordinates:["@@ۛįȹ׆žኞǛǦЮ̇̌ʱʞņѶ̀ĨǠξЪĀȀʤˮʘ̠F٘ә˩ȎӽǓͷĘɧСԳʵʳǁՉt՗µണ"],encodeOffsets:[[2757,6410]]}},{type:"Feature",id:"BFA",properties:{name:"Burkina Faso"},geometry:{type:"Polygon",coordinates:["@@ֹɐϽ‹̍Ƀϗǰƥ˦ϙǾÅӦɮΤo˴ښۢŬּɲȴОœΚǢŘɎٴϖdžˀ޼ΒҦŢɀLJՠJáСŔϣӀչ€НॺȏmֻǿʣЩÿǟν˿ħ݁lϳâ˓ƉωÖร¡qӉŘم"],encodeOffsets:[[-2895,9874]]}},{type:"Feature",id:"BGD",properties:{name:"Bangladesh"},geometry:{type:"Polygon",coordinates:["@@i׽̉ŶÆگʉѬµєDžКΕӨޟ’ü΋˃ҳΧǠũƵʃĠ͗øŽۖ̅لƜԒԫɤȆ̪Հ̼؅Ѽ֮̔ږεВ£ô׏ߞřު^Ӟƛϯ܅ϕµʷӍҢѥƎ՞ɶFѶ೯"],encodeOffsets:[[94897,22571]]}},{type:"Feature",id:"BGR",properties:{name:"Bulgaria"},geometry:{type:"Polygon",coordinates:["@@ʎΉ͚Ö٦ſ௾«иɌবȜ̩ؒӴĕѥΏ̫׹˔ӏܣŒࡥ˃Uлޅÿס̊ڧɱة|Ñ֊сːƒŢĝĴƘˌ͌ˀСδ÷̬ȸȐ"],encodeOffsets:[[23201,45297]]}},{type:"Feature",id:"BHS",properties:{name:"The Bahamas"},geometry:{type:"MultiPolygon",coordinates:[["@@ȵ£ɇӜ̿ʐǾՔʨ‘ۣ̎Jӥ"],["@@ࣷƅÏ̴Ђäֈ{~ɕ"],["@@ƟׯƷņ`ѮϓͪCĪڐϗ"]],encodeOffsets:[[[-79395,24330]],[[-79687,27218]],[[-78848,27229]]]}},{type:"Feature",id:"BIH",properties:{name:"Bosnia and Herzegovina"},geometry:{type:"Polygon",coordinates:["@@̦FȿσМ͓ūЃȡ™ƽû˙țūҥݓ͈ͅΘ͋Ȅϭ̾ǻʺЩϾǬΒ̞ȕǼǨϾnܠƓ׈\\Ϟȅ"],encodeOffsets:[[19462,45937]]}},{type:"Feature",id:"BLR",properties:{name:"Belarus"},geometry:{type:"Polygon",coordinates:["@@߼Mࣰ̈́ȚӄېːÿϔԜƚ͖ࣘࢮɁŢȻѲĴࠒȧĊЁǷɧՄս΂Ƴ»Ʊ֦Ʃʎɡ͝ǿڳˆljÿȠ˧ȸ՝ܝ¹ʵȁÃхͭĆݷ¡əȞ̿ƥ́ŨڍjफȬࡕàٱmҡɩГeϐʷϴԌǢLͰɷ͌™ϊ"],encodeOffsets:[[24048,55207]]}},{type:"Feature",id:"BLZ",properties:{name:"Belize"},geometry:{type:"Polygon",coordinates:["@@OŮĸžƴı̞ԔDŽZHūDŽGaɭƋεôŻĕ̝ÀăīщǓɟƱǓ̅ʣ@àॆPژ"],encodeOffsets:[[-91282,18236]]}},{type:"Feature",id:"BMU",properties:{name:"Bermuda"},geometry:{type:"Polygon",coordinates:["@@OEMA]NOGNG\\Q^McMOI_OK@CQSGa@WNLVWHFLJXVFGJ`ZRTDLeeWKIHGIK@@[MQNi`]VDTBHCJAPBJLVFjT^LV\\RJZRn^RH`TfJjZHHOTTFJP_NOX[EYQQKMEJOLANJH@HQHAARF@ZEPS[U_IcRQXE@EEKKOCGGCQCOGISKYGUC"],encodeOffsets:[[-66334,33083]]}},{type:"Feature",id:"BOL",properties:{name:"Bolivia"},geometry:{type:"Polygon",coordinates:["@@य़”͟گӳ؈વȲ۫ݹ؅ŗ͡୆ҋऺˆ߾ѳ΢ŏ؆ЫֲՌ࣢αۺȖ˰ƭ̶͠рh܎¤נǸ˶ܩഠزíѠnȈʪ݀;Ѷ͂સƚęؽļ͓ãࣰ֛ݫऴƑ̻ͦ֨ǕΐʑՈTӦʟšӟǐʕZγʓa͒এྖ“ūӟĜͧҞɽȤԹƫڋɯρĄӏʿǥaʶ޳јޭ^ัʓЕ݋sҋͥ৕ƉǸ"],encodeOffsets:[[-64354,-22563]]}},{type:"Feature",id:"BRA",properties:{name:"Brazil"},geometry:{type:"Polygon",coordinates:["@@૮ନॆࠄ֠΂ۼҪjڤуӞеLJǒӜŖӼBҦ̡ƴ̿Ƌ̻œį͔ýޔƿʤ֥ɪ΃ǏࢱLjÈଜʝҴˀǦăӐɰςƬڌȣԺҝɾěͨŬӠྕ”͑ঐʔbYδǏʖ™ӠӥʠՇSΏʒ֧ǖ̼ͥळƒ࣯ݬä֜Ļ͔Ěؾષƙѵ́ܿͽȇʩџmرîӃƟϡĪÈ౨ۏӷݏv҄ͅ֏¶DzΰұԞΓݴɜƶA΢ԖʎċҔɊ̈Ôϼ०ֲێNJŔŴݴŸϚᘰpθſӔύ̬LؐӀƒǚē†͐ӯĔYՀ࿖k˦̂ɸˉǐӷǂļҨѻٸÆnjʲشȞΊƐĮΤ׸ʆ¯Ǯ܅ðśՊ’֞ϓɒǀþجŅڜȿʐȤ؀žल̮͎̾ŏʂѪšȜȗʼnσ̀ŵȖϷɷ̏ƅ܏ɌыÔϳԬϿЮ¥Ģǒˆ˜ϠƦ˚ɢҬíȲŠҚçøǢƗǘĎʐͺõЈĒӔDZξǥʺɪȊ•ŘɿДÒ͒͊ʴؤӼޒ˺¢ȺҫҼ฽҈Ƒxׅمەʾʩ๤ƁŠࡃٔր੐̟ඊԡШӱƏҫ঎ʶ࿐ѹఴŽఔ۝੸व٪ʏܖ‘̦˅˸੭Ɣԗͯ൹ёշஅୡՙोثܯȿgɻءÒ༽ɹಓęօˇͧƫ૱࡛઱ƛࢁڹηȟԋ࣯Fೕ͓סύवʗ঩ڝ܅࠯ũطƔҫƽࡓȏЧחҥट๕݉ڗ֯Ͻϥߛ։ӑɷӈψЊӟֲڇҬࡹՠ̹{ࡅٰձę"],encodeOffsets:[[-59008,-30941]]}},{type:"Feature",id:"BRN",properties:{name:"Brunei"},geometry:{type:"Polygon",coordinates:["@@ͬ̾܎Ң›Я·՛Б€ǭ˹ϥѦ"],encodeOffsets:[[116945,4635]]}},{type:"Feature",id:"BTN",properties:{name:"Bhutan"},geometry:{type:"Polygon",coordinates:["@@΂ˍÏԩۇ{ۿÈՇſޅ͊kǚ֌زҒɈ׸șѺqπɥ"],encodeOffsets:[[93898,28439]]}},{type:"Feature",id:"BWA",properties:{name:"Botswana"},geometry:{type:"Polygon",coordinates:["@@ǜƭ˄ӡॎइήĝD̑ʚՑٰŹ՚ϝ஑أݭع˩֓ʧ́ҙãƧГďʽ՝țہ¤БɾΟĸХșȵГЉʧпϑ׻đȇ̐üԠӽߚɧŲAរࠤˆ|Ჾش„ಖ͎̎΍՜ͤʮDӂȎưÙ͔ڣ"],encodeOffsets:[[26265,-18980]]}},{type:"Feature",id:"CAF",properties:{name:"Central African Republic"},geometry:{type:"Polygon",coordinates:["@@ۜÚƺɎƔgȾȏ੔͐Τ͠Ѭ̌ĉ̐ʂüߺ½߆ϴ؊ࣺю;ՐƜĪΫӜԿF΃ƋΓÄʻ̆ʍٖοҢͻT˗֠ѫΖεɆԋغͩƊˉˣęաpكĘ̹ïųȱ˕}ͧDzधнϥĎŗÝʥԕطǐؙĊ՗̴ۓ˸҉˓͛яùדգ²֩Ƙԅѻѯޱėʐ›Ϧϧ˔̳Ѡï̠ЇѮæʢċΞÞٴȬƴц࡜"],encodeOffsets:[[15647,7601]]}},{type:"Feature",id:"CAN",properties:{name:"Canada"},geometry:{type:"MultiPolygon",coordinates:[["@@؎œުxЯ΅̵Å੥Φȿˬ͆ʸ̎С"],["@@Хcઝ˂ޯІ̄î૆Ɂ࡮Η|Ʒ"],["@@хŝൡϢʥ̘ݩ̌Ưʈࡻư͕ҜðȚࢨǿԨŵ߄ė˺̃дЋ࠼΍Όҩ"],["@@։ܿո˴֠ǵ̏̉ݚɱϰȴ࠼ʵʹ؛טƞņѿʼԷΝ݉ϝ‹փǂǾیɻńইܯԅ†צЂ߫Ȳࣙ¹࿅~ŹʠԼ̐λɬ۸Ԓࢄ೾Զӎܲ̂϶™Njɫ҅Չ"],["@@@@@@@@߰äʥ॓ܶگͯDԑϪ̵ϮчʾƻτºˎЂŋ"],["@@͡ѳχîəʢ Î͖ʦΆkɈǣ"],["@@ঝҧץnǿɪزϲ଼SiǍ"],["@@ƼυјżӨɗं˽४ʽöЍؤÞ׶˥ݙ˃ಳȬҽϚ࠭ҁ஡ѣ˿Ӯଗăܴдņڌ˺ޔ؈å"],["@@ष¥ȿЪΦҼޖŜپɷXέħřձʛ"],["@@Է̍ଉʬۃğଫϘ݊ʼטζࢼʃԎƯʦDžԠ͍"],["@@G࡭૰ڄ৐եʡح߾֥࢚؈ؖܨ°ईஞÝఔūૼй¼зس҃פ҇ŃУ࿩חୡŻࢃʨʣуߵ۽ʓοই֩ளÇڏΡÇձ঍Ŀਉڻ࣭ु͙ڏ±উంƕϜ޻ϼّ୲ǔ༞εࡀ͋׺Ѕ੆ɳࢸΟ൶µࣴąƍܫʼࡋ،ळనߗ٨˚ҔࡺѭೢףѶഎЀ॒לҮהç֭֘܌৷لলࢤνݾ˫ಾגȘ෸ɫࡸć۠ɚ޴˵ਚӣʮ͙ຄÛ}۷˪ਜ਼ގſ،ӵ௖Ұߦऔ֌ϸٺݣબੳघ৙͵Յ૤Ӂݰӓംɏբˍͬ܃ټŏͶͅÖऻ؍́׽̏൯̗੏ۑ෇ƋᅛǮుPࢇÍ۱׽ੳω௉૗ॵޡ܌Ɛഘૄᄈ۪సČݔЫߍ֟ˊࣟ˜هતп൸ŨࡆीÎ؍ժ̥ਣսᇷԁ࠯ͽय؁ٓ֍܆ฤ۞഍ƒणĹջӆBନύʐ֛ƛ˧ɚٙىʱٹ̕ϡΥŽˏ¥čȹ໽A౥MϛƷࢵ؃Ŀßˍ͝ޗBࠛGϛƅƊǑøʯeďષлࡽſউ҅Ɂ@˷ƂĥŦnĔȂ̎ЂҦʘӺǙܴǵނ࢕ЂľƬūĺɳ@ǛƆ¥ȤǍēɥ€¾ĊȡĊćɚٵːڹ˪ࠑ͘߁̨ݧʃ˝Sਕɔڻʼnࠁʺ࡫Ɔו¾ʻƜƫҤ˳IE͓჏BᮝA᭯@ᡃ@ᠿ@៙@ᢡ@ࠛ@᠁@ᛷ@őF྽ࠜ׵δຽΐҳݖŤԨ੻ΨƧڴ৭؎iѠҲКwՌෙ՘࡭ॠՁ׾ޑϚ֣ΈѿѢࡇ˕ࠇҹݛւדπࠋɸࠟ|JⷎNᷲ༬ȭ೘Й࢘û݆ΖৰˀఢĹ఼τ൘Ⱦ־ΑظȠȊЄ׈ęෆݫ૦֬ŖّਔƐ͆ʖৰ·౼Λዸ̭ୄƛࠖÄଊэ஁зຶǷᗘIJܒƦࣆԋࣴьࡩΦժ˼৾žڦĎڴȩࡊҗरä๢ϛಬƄ௬oĭԺݞƦದ˵KߑՖڠڰuϞࡊ࣑԰কͺäघশ؎ૌƇࡘχଞॅݗЭ༠ǝ"],["@@нϿሎʬୠщॊіސ˟یࠛфΒ׭ࡰ݊Ŭ࠲Ƈश͹ՆࠉʼץථеະЉĝσൡã՚͓˱ູ̯Ƃฃɪঋ»ཅ˷ᒃű๻āҕІଫɮݙģਛږ֔ĚಘƜஈ›રƦྷȞᅗã஗jѷ̴ዎͲಗ[ืɚ۶ـגͮᖬԠ࡬Nj"],["@@݉ևಹך˸Ş૸’ٔȁ"],["@@öɵࢿ|ࣟjࣿőʑ¼ऍѾ˜̠ИÈነěชң"],["@@ڎԽޤڴᒆΈ෺ࢅůջဒʒߒͮሀыୄЏŊν༚Ȑ࢘՗᎐ܸͩ͹ߐ޻໯ϹጘչೲȁீޙೖÇʽכ้ঋਗά೓߲ઙĿŁӕࢪӥଜϯΌɟմࠩ́׿੕ɪᑏڨஎܣ࢔ԕƎ̉ᗱͲᅩӤ৳Ц̌ʂయќ௥Т`ʑᝡƅ܃˾ֆؤ཈dႸņ˫̜̊оચࠊɳϊ͕˾౿Рၳ˺՞ɆࢷԺ݋´ڏ˸҇ʛ຿ŅᵝȈᄫʚഹŴۥ̐࢞Ϧ஝Hˉ࡚٦ݨࡺ΄ᓪɢأի"],["@@৊ǯຄńɖʑ޷Е౜αƱݳ൝͗߳ê׉͎ᐡٮjˎ႖ĽएռসР"],["@@࣓عय़ŒԽ݆`кѮΨ࠰ɮც‡ྈȱళݟ৉Ǎ"],["@@ᕍЙѷςኹѺήΤ׌ؘܰւࠑԦᭊƀ஬ǧᒰ±ࠄʑࣖΝ੍ɃᏝןਫי@ν"],["@@ҙ͙௝Øৱɖ҂Ϛீɨܼ̬̍ˇ"],["@@ٞϵ€љϣس൱đࣗƈjӬ൝ÝÁٮࣜౌ˺ஂµÜŎ"],["@@̙͢ݠƘࢢ™ƪЩԝЋ᭗Žᑯη౩mŅ˜პϊ④ij୯Ʈପࠐ߈ɾᛄ˳๶ӻฺÛறߨޔ̪ࢄĭ˲Џ"],["@@ढ˓ကFܨˡȑ́८ȍՔȧଊ™௬ë೸ǼႊðീÏ࣒ͅȊ΍ԽɟభǷ੽ĸᜱŻႫcഫļᖁ˔̃ҦĹжࡇξ჋ĺঅʼ͂ΈႾÁ"],["@@ŗ٣٩̇޹£༝Ϋ഍ŹଗǼ@@ුؼႮծಆ[ସŬ"],["@@ϣy༽Âɡɼၜ]מƻĵĩ"],["@@༩ʋఝ˔ڼˎ௮Đஈſ˩ʥ"],["@@৽ǏඉBbŤࡴʦҌદǝ"],["@@కǥۃȚέ͂áΎજ‘ӪÅ৐̇ɫ̣"],["@@͜Ε൏Ĥ൩˘ሏŒߺʠ৫ȮÕ͐࿶ŕᗢ̫ٞЍ"],["@@০˕ଽʟ༇ك๥Óდņࣗ΄^̦ڔɢ໡Oए˨ՑϠ׌ώ׊ʲࡴÎοȖዜ¨੶҅මǵ൞ǃڒև"],["@@ᖢßᅮŅ໤ɫ™ɡᏅη᎙ǟݻȉᆬJጡԙേʃ෯ۇႿƓՙǡᡷěୈĿׇƭ۞бߙ˽ಛʃЋ͡୫ʣŞȏ෬lȳᖟԋᔧɴឿŻధĸཟªĿЖ༊Ȑб؆ԢÐᖤγ଩բഹLjڼ͘๰Ȩʄ̊஋͠ΥѠᘞ—ڒĝ಼̪ቃĬ᰽Á๣˸۩ͼগʘȁ˺దLjঘ‚࿲ƌం̺ਬ©ࣤɽٔҒૐƈບĢᢲ–Ҁĝ᝚ƚᆔÁᆒÁ"]],encodeOffsets:[[[-65192,47668]],[[-63289,50284]],[[-126474,49675]],[[-57481,51904]],[[-135895,55337]],[[-81168,63651]],[[-83863,64216]],[[-87205,67234]],[[-77686,68761]],[[-97943,70767]],[[-92720,71166]],[[-116907,74877]],[[-107008,75183]],[[-78172,74858]],[[-88639,74914]],[[-102764,75617]],[[-95433,74519]],[[-123351,73097]],[[-95859,76780]],[[-100864,78562]],[[-110808,78031]],[[-96956,78949]],[[-118987,79509]],[[-96092,79381]],[[-112831,79562]],[[-112295,80489]],[[-98130,79931]],[[-102461,80205]],[[-89108,81572]],[[-70144,85101]]]}},{type:"Feature",id:"CHE",properties:{name:"Switzerland"},geometry:{type:"Polygon",coordinates:["@@ƫŹȳϞƵіwá΅χƙةŀǻ͹ЏơƄһ˵Л¡αǶ˽ςБſ^ϠؚҾɈϤûɲƞ܎MǦǼ࣒ʱ"],encodeOffsets:[[9825,48666]]}},{type:"Feature",id:"CHL",properties:{name:"Chile"},geometry:{type:"MultiPolygon",coordinates:[["@@Bም࣒@Ԓw˧ͻܛʻЭ‚ӻä؏ʨ࢟ŨੑҸ࡫Ҏୃशۘǭ୼֗૜̟ѢϬ˘ֺޠΎװı"],["@@͢୅؆ŘĺɁ˿ࢍࣵг€ඓǫ˓ʦ͡ץԹջ߁̛ރĀ߿ԫࡹϮฏɔƵCޛӑࠍpۯٍշFޙʮࠏԉ̧ɣݡȟࡱƚ৿ͷǡȞॹϜ͇ˡΛ϶ǙĚ̓νǃĜӱ̫૗ѽܓĮыˇՑ٣υôࢹ̧̐֔ÄgؽΒө᎔őުſݝPЙȷݷ̣Ɖ޹Σoॅ˚१ג@@ਲ਼ӔˁՒʄӰх֒Ņ෤Φ߰ࢴٰౣʔߞݒ˸ඊत̏Ѯგ֝ɠʿ਻ՉŠ˂ல˺༒ϮָʍࠎéूΠ„Ԩപ׈എΤబȗ఼ʤۚĵਞӮਆưྺ˒ნˀሤÕ൘ǩ஄ќɌɦњЬֱŐ؅ѴΡ˅߽Ҍह"]],encodeOffsets:[[[-70281,-53899]],[[-69857,-22010]]]}},{type:"Feature",id:"CHN",properties:{name:"China"},geometry:{type:"MultiPolygon",coordinates:[["@@ԑഓΫۏѷ܂ĩخӶࠜڦَϨʡƣԓ","@@ܩЗۏʺyܢаϠࣾɾӚoȊ͍σσșӟ"],["@@ฬˍ঺ׯͼ߃౨Cܰͨ൸ʜѳݱ͙̭˽ः֡ࠇ৵ƪܝ̑ɜܙť঳ѕwLяթӺͯһಙαƀѹܩŒЍ˂ֽ׭ऑҋۃա୭ʑأϽࣝɭ҂ϴǭ͞ږ֠ѹѲܷ̓ॉ׏ԫթ࠙¡ѓϻѸ֩یƏ„ϕڔʕस׶ݚ͝լuƌѱஓɻϻҏࠇућיࣜҥͦࠝԞޓ֮٥_دՅɯȪ҃ӶʻŻۃɇڗҷ÷ؗࣧڹિޭোିޡୟۻृĩԣύ̃˘Ӈй୭сࢵŹ˻ࢱҭ·ə؎Ȧ͘ૻːЇƍࡍɔЏ΀ƄӜޏƶЙܑ̀҃ࠇīڡJ҉ȳѥūŶ॥҃x÷Ȣ}Ύ؝ʓεƸر͂ʔۤՏǎȧޜࢱƓĴাߔۮ”ۚ{٠νȨ˭ӶӭÙࣟŲ˴ΜϿԺ׳Ν۵ȸॷ՗އسڳĿοɦѹr׷Țґɇ֋رëڌԟǭওĈोȖڿτٵǔ˯ЖҽŦࡓոکʴΑȩଢ଼טࠛՒɽऐ׾ő‚іͭјĐۆࣙঠ൧ͼʝ٦ةϼƫʌųӎˆ͜ԛȔ˟ďɇިʈȔśȠߤЈ׈ǐࢸő͆՜ંIJͮ̚೜ҔŠȐãӐּɔݱฦဘͲјȈ؆ຒဠˡҲϞ¢ࡆۦĀٖ֔͢èɚו۸ѽப̿׆ڱ͕ঙ̢ηূƝଆŝ৪ԻԲġϤޟӲӿऒnჄȉ૤Ŝࠦůఔԛ৮BόʽঐҌബ̈ాŒঘ̒׾҈ך˰Ƌˤˍ͔ѴըӀùࡺǝ࠸Ѿ౲͚؞֊נʆ௠ŐڐĥĠ̘ݿזګː٥̳ࠣžӇŃɏΆר࠾Цو৚̓ஆՎQτݸࢾҲːWҪңȦۜмਰƲ૜vసʡ݈̱԰ࡏ̀α̊ԩ̶ࠕ"]],encodeOffsets:[[[124701,24980],[112988,19127]],[[130722,50955]]]}},{type:"Feature",id:"CIV",properties:{name:"Ivory Coast"},geometry:{type:"Polygon",coordinates:["@@ϣUוǒ՟Wহƥ׍ʍ̯ࠫNjvÞۖĄŀ}ͨΣΚˉÈʕɲǾώčО ʔƄB¸ξÝnjĄŜ̸ĶȹڨȗΎæ˸ǘÞŊúɸųٮOƸʖƢgʎĦžΫȞłΌŰϚǽƦ˥Ϙǯ̎ɄϾŒֺɏɠ஡Ο۷ɕेθܣ›ͧ"],encodeOffsets:[[-2924,5115]]}},{type:"Feature",id:"CMR",properties:{name:"Cameroon"},geometry:{type:"Polygon",coordinates:["@@Ľ°ӻŇԝŒЋÅ൅nŬڒ͟֊ϧƚǟϖɋŦXɶɎתЎ߸ʒRԄӮ͈bҾΉ־˲ĀΔȌͺžь҆ΊǞךDzȊŢѨɜ՚۾ٲ¬˨ĠƲͫͰ‚ˌʂ¶ͮ՟Ê֏‹֏ҜޅҷTʁÏϥČǻЅӸөμƛŠΏˆ׃ſɩх࡛ȫƳÝٳČΝåʡЈѭð̴̟џϨ˓œϥĘʏÓґڛȤڷɜ੗"],encodeOffsets:[[13390,2322]]}},{type:"Feature",id:"COD",properties:{name:"Democratic Republic of the Congo"},geometry:{type:"Polygon",coordinates:["@@»ঙͶŕˑ̗͓ɟ͍ѫǯϷ±ګț͍Oهʍɹ‹ԃŗÝýҟɄϡÂ৥ưޝċѧǘӣӤҹҒ੕ͥĒ૿ƙɣĵʇՙȊχƫষĻࡇɨƫט͝ɲƴìٟࣟR·Ҧ̳ΨٟŠȋѰԣ˅ڧŞ˫ϢՕüϽqµʾ́rϥºԳųιtȻû®ৄ˩̸ÕԬŬԒǝ͖eՊ৳Qò̢ѕG­ƣԵɁӧűȿҫŠˣş։å͏Ѱȗ˖ʋԌȷض៛\\̍ķʑh΋œşʼɊʀμƎɎ̪ǰɚđ˼͐ҜSÄʃ̼ƩӶՄӨШɆːƒ۔θࠆϬўքМĪˌt̰Ǝ̆«ӊŀݖǐԾʦ҈¸Ԕúה͜ѐҊ˔۔˷՘ؚ̳ĉظǏʦԖŘÞϦčनоͨDZ˖~ŴȲ̺ðلėբoˤĚԘۙϘķɤƖϲÅҶDzȦΫ݊֏"],encodeOffsets:[[31574,3594]]}},{type:"Feature",id:"COG",properties:{name:"Republic of the Congo"},geometry:{type:"Polygon",coordinates:["@@̿˾ʩƗͻγۏࢸٖҪ̓֌˾ɂ֦ĺäό҆Зݐ•ʴЈł֒ĝڀЉӺζ঄ȽǘسçɻѢÔξ੘ڸɛڜȣÔҒѰ޲ԆѼ֪Ɨդ±·ԓʥ҇ǏԽĿݕ¬Ӊƍ̅s̯ĩˋփЛϫѝηࠅ„ۓɅˏӧЧӵՃ̻ƪÃʄқT˻͏əĒ"],encodeOffsets:[[13308,-4895]]}},{type:"Feature",id:"COL",properties:{name:"Colombia"},geometry:{type:"Polygon",coordinates:["@@ΫȤЭ˨ʅƅ܉Ŝȱΰƽ_࠿Ӓŕʺ̼ڛтȢ̦иÊΞՆ͐Ѵ̳ȦDŽӦȏސǸɚƃ܄ͻ҄ņТ˔ÑǂʠțӶĺŬѢـהΌĚT˦ƺ܂ӖϸՊfäǪڂéڌъ͞ȊОК̖»ɚɛǍ˱գƕɇп͗ʋʓ̷Ĺ׵ɷӭѢÇņϭȄȁâ͹ij̵ˆǫȸéȨ̉ઊĄӦŃעܡͼĚ؂­ӐĪ̔ƟƱҍȇ˯ß׻ǜ֑ʆʟ†ȉэл̨ȃɠ̋ʰ࠹ǁĻǏӸɷˊ˥́࿕lZԿӰē…͏ǙĔҿƑK؏ώ̫ƀӓoηϙᘯп҂ʣpժࡤٟϾԍị̈ƤҧɝصŀӵࢤϳɐˍІ֑Њɡā"],encodeOffsets:[[-77182,-155]]}},{type:"Feature",id:"CRI",properties:{name:"Costa Rica"},geometry:{type:"Polygon",coordinates:["@@җȆǟǮĬƤ‰ȄɷȪͥǔ́ņÅʖəƮÄʑǗȩȓɸˑĊŗǞLʮŎˆʁŠȖnjŴňֆɝȖŊˊéƔǥʜÇȪDzɈҙ͖ͷЂΩ͗õLͷǪűűıƱëǟ©Ǖ"],encodeOffsets:[[-84956,8423]]}},{type:"Feature",id:"CUB",properties:{name:"Cuba"},geometry:{type:"Polygon",coordinates:["@@ܨÑڊW߄˹̭ͮ޺Ĩ̔ȡ܈ԳԺϛˢ\\ԆǟÕʁئ“ٌ΅ıȟ֑Ń֡¥׃âளą֜Ҷ΁ɔէÈ̃ʐȥӎӃ޵ɦʥǬભž̋ǐ̀ɀࠗ¨׿ѧΏ[ťȳеğΫĂѺʸǼ̤ϞȈіǎَĄȰĢ"],encodeOffsets:[[-84242,23746]]}},{type:"Feature",id:"-99",properties:{name:"Northern Cyprus"},geometry:{type:"Polygon",coordinates:["@@ÐJŨȮ؄Yކʢ֧ΧÔƿęˆLJÙűj¥iĎѾNjVɫïƿ¬"],encodeOffsets:[[33518,35984]]}},{type:"Feature",id:"CYP",properties:{name:"Cyprus"},geometry:{type:"Polygon",coordinates:["@@€ãࡱͿЩŊȟͶЎŒǀ«ɬðnjUÒ½j覎ŲiLjÚ̇"],encodeOffsets:[[34789,35900]]}},{type:"Feature",id:"CZE",properties:{name:"Czech Republic"},geometry:{type:"Polygon",coordinates:["@@ϯǂЁ©ٵʲ̏Ùҿ΅ر˔ӃΰѕȬėΠƧʠؒǾ̸Ⱦ׾ǎɂdžɜīϒĖЊ˓ؼñ¿ɳҘǧŲɒּĥĄʿز»ϮЯʡCŽƯȕ—ÅȑLJ¡wý˹ēϋbšȁ"],encodeOffsets:[[17368,49764]]}},{type:"Feature",id:"DEU",properties:{name:"Germany"},geometry:{type:"Polygon",coordinates:["@@d͗ࡔțS̗ࡢǂҾɰॊͧІˋȞёɹɣ̨̙Ⱥ҅ß́Έ՛ϑĕɛĬɁDž׽Ǎ̷ȽؑǽƨʟĘΟіȫӄί̑ϯ̟ŃŢշýƛʿǤЕ~׷ƭݍ–ţɛыɺʩ±࣑ʲǥǻ܍Nń״ьֺ௅ƸЇɘ´ςǗȐĨ֨ƗࢢԎ@Ɉ͂Ⱦޔƿ˴ǐDz۰°Ƽȃ֮вȓ̀ӈٌōՠŸ"],encodeOffsets:[[10161,56303]]}},{type:"Feature",id:"DJI",properties:{name:"Djibouti"},geometry:{type:"Polygon",coordinates:["@@ȤʹΑӏȩήɯ̱҇ȅƬȭÏҷb_ʮßɶ˴Ѐ̐ϊήñʪȴ"],encodeOffsets:[[44116,13005]]}},{type:"Feature",id:"DNK",properties:{name:"Denmark"},geometry:{type:"MultiPolygon",coordinates:[["@@ԋڹ࢟ӄŝΒ௼˨ˎу"],["@@ȵ̓ʡĞ؁؁ɮХ՟ŷًŎͽҲ}࡬Ɣɪʌʦ݌À̐ɴڮʂƒѝʟ˙ĶɽҘŵ"]],encodeOffsets:[[[12995,56945]],[[11175,57814]]]}},{type:"Feature",id:"DOM",properties:{name:"Dominican Republic"},geometry:{type:"Polygon",coordinates:["@@ŀƞپIӾɏɜtƴ̕Ҡhʡϐ‰Ю̷̯ͿЍǼϫ•ˡ¢ƱƵ͑½ŷȲˣťͳֻɏƆ§ʎjɬɍʦȲƚÞ͒óҜ"],encodeOffsets:[[-73433,20188]]}},{type:"Feature",id:"DZA",properties:{name:"Algeria"},geometry:{type:"Polygon",coordinates:["@@ᮩཽᝩ࿷இϑटćU՘ϵƌԹʊȧЀᬻᆴᬻᆴṕᎠfnj@ÊQ঺ബب࠼Ÿێɦ͎тচͪ˜جӢòϞ̶સƚƸ͜ɛDz̃ࢲ¹Ԟ́ՠ߰ҠࣦƢՌΎ߶ʰ෎Ƭർæшůߊͨ࣌P΀ȝֺ¾ǟћƄߟȡۙԭҵôمۊԃRȯԮ͹Ϊຝ˖ݏ°ϵƧۇÔϥŃҟòՇͫΗӺؓŽέ̘ҵϼƸڒϷςՃ"],encodeOffsets:[[12288,24035]]}},{type:"Feature",id:"ECU",properties:{name:"Ecuador"},geometry:{type:"Polygon",coordinates:["@@҂غǻξ͍ϵԉςǞʀƙބ̎ŴƺԼ͆զÍ΄ҢǸ׀Ͱࡀӑƾ`Ȳί܊śʆƆЮ˧άȣŞٓʽճࣷ࢟য়ͧԥܵǃ֣Ӆ΋ΙъͻĞ΍áw̮ʈȨıΔ"],encodeOffsets:[[-82229,-3486]]}},{type:"Feature",id:"EGY",properties:{name:"Egypt"},geometry:{type:"Polygon",coordinates:["@@ɽͷǹىɫѩȝƥ˩˔ϛϒ׵ஸđùΐࢯԪࡋٌವ̴ҙ˒ӃݮछǗƣ‚ճ঒ݭƨǣΏ@Ὁ@⁩@@ᶶ@Ჴʥڲɐ԰Żά̤Ж૦b߲ɝ࠲ʛϴſ٨ˊΌʊݎêװŃɮеȜ˜ڨȣټ³аɄւ෽"],encodeOffsets:[[35761,30210]]}},{type:"Feature",id:"ERI",properties:{name:"Eritrea"},geometry:{type:"Polygon",coordinates:["@@˻˖ΉӰϋ˒ɏܷ̄ͶֻXȭǬӯȡԛϢʽط঑ǬęʹβఀĊ֒ˆʴؤƐьӒӦঃɴޗҢУବߏҲӍҖӝˀ˿аʧʩȳέò"],encodeOffsets:[[43368,12844]]}},{type:"Feature",id:"ESP",properties:{name:"Spain"},geometry:{type:"Polygon",coordinates:["@@¦״΃θஒ؆ਊƱ૾NࣂƝۦªമƒͰ͛໺ϡ̨ǺीϝআŊ®ӥߓ֓ઁǯõ˱ԩү͕ہ͞ӑӟϑǹճىǗש٥੧_ߟhՃ͍̓ͅЩê̵˴ʃӚ޷žé˦̶̀Śɬ̃ʢɶրͳԌδè’ЈƎŬZپϲɪɻфөˆƝŁӹCɁЬ΃ū̥ɇ"],encodeOffsets:[[-9251,42886]]}},{type:"Feature",id:"EST",properties:{name:"Estonia"},geometry:{type:"Polygon",coordinates:["@@ĮӸ̱ŁՓ̘ñӘਫ਼ɼ੔Ũ࣮Ƒࢂ|Ŵƣׯӝʞ޵ΫˉۙDܡ̸ρļ܏Ʃ"],encodeOffsets:[[24897,59181]]}},{type:"Feature",id:"ETH",properties:{name:"Ethiopia"},geometry:{type:"Polygon",coordinates:["@@ԜϡӰȢȮǫּWܸ͵ɐ̃όˑΊӯ˼˕̏ω˳Ͽàɵ`ʭҸaȮÐȆƫǽ̴̕ҧ̴Й̛͎ᩨঽۺNᛛᡃફ™ݟףաeɯ˅ַB͹˴ލΙʝΓ֕àȃĬȟwˇT੟܌ב@˹ˢ@ҾѧƘӻࣴϥȚƧʹэЦԧÒ˸ӐҀrŲʰ[ݲʞࢠЊɾĎ΄ήٜԔи΀ࠠƆܠ঒ǫʾظ"],encodeOffsets:[[38816,15319]]}},{type:"Feature",id:"FIN",properties:{name:"Finland"},geometry:{type:"Polygon",coordinates:["@@ūיಀ֓ޡى঎ख़֡ܛݴس΅յఘֻ́ѓޭӟᅡੵໃá๑̯ൃǯӡҞ߿ˠȈࠢСݶАӪނՆ኎࣮֖Ǭē΢ୟЈ˳͜uಒ಻ֲ૩ЪԊɞतѻલ¦ࣘȭߠϊЬ؞ಬ˶઄ͯΡכ"],encodeOffsets:[[29279,70723]]}},{type:"Feature",id:"FJI",properties:{name:"Fiji"},geometry:{type:"MultiPolygon",coordinates:[["@@̂ʍƓѭԳŗҩļąτ͖̀ϤĻȼƐ"],["@@՛ǯŅ̼оǤˊ°Ӱˀ@ЧՕȷ"],["@@é­@ШǨžĽЗ"]],encodeOffsets:[[[182655,-17756]],[[183669,-17204]],[[-184235,-16897]]]}},{type:"Feature",id:"FLK",properties:{name:"Falkland Islands"},geometry:{type:"Polygon",coordinates:["@@৘Ԍ܎ȿԌʹڦϙʥ̋ଋʥϙ̌܋ϙпϚ"],encodeOffsets:[[-62668,-53094]]}},{type:"Feature",id:"FRA",properties:{name:"France"},geometry:{type:"MultiPolygon",coordinates:[["@@ˣ٭ϡǠș֢ǜ̺ը͎Ɯܛ"],["@@הЅќà݀ϥȊñʎjЈɗெƷыֹŃ׳ɱƝϣü‚ɇؙҽ]ϟВƀ˾ρ“ʁʚ̿̅ʯɐٱҖŃĩηݿӅစɬ௧˗ĩԑঅʼnिϞ̧ǹ໹Ϣͯ͜ѢԎdžူࢁࢤإю౹͒čؖઠǾථɏˇॎߌέዠپʨێܾǞŪ̑ϸ_ϸ͵"]],encodeOffsets:[[[9790,43165]],[[3675,51589]]]}},{type:"Feature",id:"GAB",properties:{name:"Gabon"},geometry:{type:"Polygon",coordinates:["@@ࡹࡔ։ۚԙࢄ‚˨ǾˎȲؔǜخ˴¶௢SOৠЌÆԞőӼňľ¯ÓνɼѡشèȾǗεঃЊӹĞٿŁ֑ʳЇݏ–҅Иãϋ֥Ĺ˽Ɂ̈́֋ٕҩ"],encodeOffsets:[[11361,-4074]]}},{type:"Feature",id:"GBR",properties:{name:"United Kingdom"},geometry:{type:"MultiPolygon",coordinates:[["@@҉ֽًǦԱ[ǦҊǥ҈۴–ࣔԳ"],["@@࣋ࣧࡦŘऄIɕۅݯݩࢄÃäĕݠ঱ֺƇԬढ़ʈͧৰDžķ՝ѓʗͲѣݱѯ૳Rෝɱϻǒ։ϿޥĪם͍ҁǘ௼ࢨݪǺOBಽƔʃͰ࢜ʺҡҐdžռఢ÷D@ŮӤ֛Ԯ_\\৵ƨȧɬ̨ϒˡɴҍЇ·߶щє̨ࢆٶھڤá০ì"]],encodeOffsets:[[[-5797,55864]],[[-3077,60043]]]}},{type:"Feature",id:"GEO",properties:{name:"Georgia"},geometry:{type:"Polygon",coordinates:["@@Ųάȿִӟ̲ҭĬ̯ʴĺIJ܄ƝఆƋଦЕƦƻԚƂ޶ǭʴ·Նșɓřвғŗıҏºصʎȵƍଢ଼ſ߳Юࣅ¡"],encodeOffsets:[[42552,42533]]}},{type:"Feature",id:"GHA",properties:{name:"Ghana"},geometry:{type:"Polygon",coordinates:["@@೉ӯҳ˽ݳʑݡʆœͨηܤɖैΠ۸ɟ஢ŗنrӊฤ¢ϊÕ˔ƊϴáÕʿΖџC؍Ąڍɂ̫ȅݳäйɢՓȈ̍"],encodeOffsets:[[1086,6072]]}},{type:"Feature",id:"GIN",properties:{name:"Guinea"},geometry:{type:"Polygon",coordinates:["@@ʃtǡͷʁJǏǴÈͶΗԨɕħǵmɳ³V̮Ƈɘ‚ʔǻΜɹ̜ڥDțǁɵoƝǷīɹ҅σρӼ͛͢ɋŊȿǖħϊūȂʓƐώЦʮeɖƘȄDƄŎï˨ĢĖd˶МU؀ȱȄlÚĤҜáŨ´¶̭ƆBɖŒƔƒɸɇάãɲǺ˖ŒȬŠǚuȈȁĴɳΆΙǣɏ˙ǴĊŀį«ʡʲʍǗÝå˷Ș΍Ⱥڧ̷ĵăśÞNj·νƃA"],encodeOffsets:[[-8641,7871]]}},{type:"Feature",id:"GMB",properties:{name:"Gambia"},geometry:{type:"Polygon",coordinates:["@@ņόࣶzȎȦˊ`ͨȷʼIˢƚǞʏεȋιdέǰ̷ȗƭQȫŝއl"],encodeOffsets:[[-17245,13468]]}},{type:"Feature",id:"GNB",properties:{name:"Guinea Bissau"},geometry:{type:"Polygon",coordinates:["@@҅ΘΝÈȕʀLŸʯǴÁǶѼƌ˦ɦĨ༈•c˵ġĕð˧ƃōȃCɕƗʭfύХ"],encodeOffsets:[[-15493,11306]]}},{type:"Feature",id:"GNQ",properties:{name:"Equatorial Guinea"},geometry:{type:"Polygon",coordinates:["@@ƿŴ़̀െmPয়௡T˳µ"],encodeOffsets:[[9721,1035]]}},{type:"Feature",id:"GRC",properties:{name:"Greece"},geometry:{type:"MultiPolygon",coordinates:[["@@Ҡ˱ٺ¶شÑqƣҜĶĿʛ௃íTƒਁǎƺΦ"],["@@ʹՁȥĥԟ|ѫĀৱɓ׌ҿяƋҳAѻўƿȁȊԅрЁ̓ǿҴϯжʑ^ӅޥɠʜѕՓĕ͈ݏ֏Yۍμ̿ڦƧ֒͝ϮљӐÉʆϸТ¼˚˘Ũjɚռö͌ȀҖgƒƦdž„ت{ڨɲע̉ކĀVмЦɝ"]],encodeOffsets:[[[24269,36562]],[[27243,42560]]]}},{type:"Feature",id:"GRL",properties:{name:"Greenland"},geometry:{type:"Polygon",coordinates:["@@ᬜԆ᱒›ੴ̴ᲈĄ䀦Ŀ㉊ڗ༅͕ộ™⭏ćшƫᲐĠᡚ́࿈ʴۦ̝इӧᒞ̺✘͚ᠼNjҾΫ⃝ױӃȕ᧑ơወ¡ছؕگկ€ध৚շಽ“൧ˇ༂ѽȢ܋࣍ýઞܡህÑঈ΁˟̑இŽ୥E੆֩\\Ϗပΐћɣଌȿ઼ԣ͈ڱກlj٫͖ਣӘ˼֭উѵᕖ•୆¯ᖯܵᗿڏឧ́ओIࢅ͓ୟࢱᅵכׅ“૧ȷ஽ȝܛԱ[כыտോڧͺٿϗ۝љࠍஅ½఍ۈဿLࠁҢ֕ࠐฝਲэոŗݮ୓ޢ̢ئ֗̒ࠪচొ̺ͨΘǬڀॡ̕қůݯţਏ˜Éְ͢҂ެ\\႔ɟ෿Քݩ˾࠷ş۫ȼम޴ԝ̺ڗ׈ৡࢼ੯͚XΚᖷӮᄻÖᖟ‘Ꮕ×ইˌวՈᕂ˄ၚ¬≹ɖ቉΄Ś͜ẊИᶎИ̪͘ᗗ̠ܺͰ᯲ז௢ĚΓϘጲɜᣚƂᣖRࣺʽᕺҨፘ̽୺áპ˙ፅҐŘή"],encodeOffsets:[[-47886,84612]]}},{type:"Feature",id:"GTM",properties:{name:"Guatemala"},geometry:{type:"Polygon",coordinates:["@@ћƦԻfϩǖҍΌrʖĮȠšƾКۆ઄Ft˸Ƌ¾ġǺ̵Ț̹ˬϜDBӂ޸BަUOڗßॅʤ@˚ƱòŰʘŃϥ͍ЉɻÏljâǑǧɇȟ½¬ıƿġ˽Ƀ}ŭ"],encodeOffsets:[[-92257,14065]]}},{type:"Feature",id:"GUF",properties:{name:"French Guiana"},geometry:{type:"Polygon",coordinates:["@@͉͑ГÑŗʀȉ–ʹɩνǦɈΪòϤƢή͛ӸáֺѪܠ˸ğؤȥࢸۿƔ·ӻޑʳأ"],encodeOffsets:[[-53817,2565]]}},{type:"Feature",id:"GUY",properties:{name:"Guyana"},geometry:{type:"Polygon",coordinates:["@@ր̯Դյzџ̈́o҈Чͪ̇Ƈݱԛɕ°ȣƹџϊ؏ːAŎӃԢܳȱ‰ҫî˙ɡϟƥ˅—ġǑЭ¦ԫЀÓϴɋьƆܐɸ̐ȕϸ˿ŶŊτțȘѩ™ْ֩ɬɲiϲԬƊȾƾ˽̸ô̬ږӲ"],encodeOffsets:[[-61192,8568]]}},{type:"Feature",id:"HND",properties:{name:"Honduras"},geometry:{type:"Polygon",coordinates:["@@ơˀʭòÐʹŗĞǣÒσij‹ŔʩƈǷǚʛìǨɈáǒÐNJЊɼϦ͎ĔȂƨʊ\\þ垦ϸùϲv˒ĢİĦˎ©ȪÉɘnǖòϨśƄkʲƿʐį̏Źɜɳ˽jśŕ̇ŋɃAȅŃǙœƛźĕ{ŇȩăRaǥ̉ɳƹıđĽʛǞǹɣǫPȟqlЭūQĿȓʽ“"],encodeOffsets:[[-89412,13297]]}},{type:"Feature",id:"HRV",properties:{name:"Croatia"},geometry:{type:"Polygon",coordinates:["@@Ȳ͗ˊʇ͓̓ϝȆׇ[ܟƔϽmǻǧ̝ȖǫΑЪϽǼʹϮ̽͌ȃ͆Ηݔ͇ġƛ߃̶ӣ̢ޑʠ۹ؤǞØϥΞe˲եƄʱγʝˮn̆Šbג…Ƹƚ˸ƍͤgGɼ̈ĒĈͺڞɠˊĻؼέۜlj̼Ų"],encodeOffsets:[[19282,47011]]}},{type:"Feature",id:"HTI",properties:{name:"Haiti"},geometry:{type:"Polygon",coordinates:["@@Ԣ™ܰƁôқÝ͑ȱƙɎʥiɫ֏ƜЅÍԡÔϽƿ҉ʾö˔ޜśيã̢ȈϧθP͎ՋžȌɶ"],encodeOffsets:[[-74946,20394]]}},{type:"Feature",id:"HUN",properties:{name:"Hungary"},geometry:{type:"Polygon",coordinates:["@@˨ըǍǼӂDÜ΄ђɋ̲ğ۸ļäǚͮ~ЦžĜÃЂŀȠȢˠ¼࣒ʭǴĒҲɭÎɣԡǭЉ֫ԕ֭کǁԽš١ə̻űۛNJػήˉļǍ˴ƗV"],encodeOffsets:[[16592,47977]]}},{type:"Feature",id:"IDN",properties:{name:"Indonesia"},geometry:{type:"MultiPolygon",coordinates:[["@@Λe૝ך޴ǒѴʭ̎ʭ»ɩ"],["@@ܙȁijĶø˸ΰԢࠨͬĐǓfʫշع"],["@@̢ɣԲèȼΥॿǛ׉őҍP̀ӚҤPɤ̖"],["@@ūұ౅ʅૣľE̬ښǪՂʥ֔Üݬ̮"],["@@ྔċȂΌ༘З̪կీƵਐӿय़͋ऍ͸ݻwࢍØ޻ưঅ͎؝ČΓŁ໕ΌƣΰޑØּߤ৶·ڴ͡ΒÛŘ̗"],["@@ѝֱćنƬ̠Ǭ˴ȒʗCЏ"],["@@̿˥ׅƸǏΰࡘ¢Ⱦˣ"],["@@̨ٝۿΌۯìӃÅׇˆȦҦਠ”ऎʕ"],["@@ɼയ࢈ԉ۰ࢼ८ԔݜBܘ̉خ̛ࣘLJbᩑbᩑݟې࡟ǜȷʇ੡}ΦۂՈɺɕࣲЕ۸࿃܆ۗêృަʛУ͑óȏ̮GκٛЮ̢ࣞ״gëɠ௵DͩԄݥƺΡдଈȰњ˜ഘ·Ƃ̹"],["@@ڭ࠭كlj߱ǐඓ¥ܽŧţٍݪݛҒϠ༪˸çϯλŪιӯ͙݉ߒ੿Ƶ˿ݲॻQտ҅ʙ̐͡Мی࠙͗ȻɶŊ͖؅ӲØࠌ֕ʭîও”றՓũίʚʌޜŽ߸ΛPʻֺΎվŤښф౎ǮΎ܎ذپʛ੖śॴ–ࠨ؎Ʀȉ"],["@@©ܽџĈŷԝΌѷɽĵ͹Ւʟ੺ǚڤ˨̨ÔҝӸóĀ΃"],["@@सާহį˫ֵšݿַ߱u࠷͕౻ŭ̚ॕϙͫԤ׳´лːৃ̟̩Оս¯ۗĬŹૺнɺЕܘŝ݀ĮުԂ֐Ɩָ֗ӅըǠ՜ÑӪъЖôߒɽۆǶњୠ͔̈̆क़ॲ@ܰƙӍݷآߓơϭ"],["@@छkۻ۰અۊέԚٍۄзؾٕ୴۪݅ʙܠ̳ڀݵՊѭܘمҺࢗऒóђզ‘ಢNjݔࠓٮ֫ҪΓߔࣙࡢ_ۺֹӠ۳٘ϥͳۉӖ̞̅sƜו̊ҵؠõФՏɁ਱‘ಟ"]],encodeOffsets:[[[123613,-10485]],[[127423,-10383]],[[120730,-8289]],[[125854,-8288]],[[111231,-6940]],[[137959,-6363]],[[130304,-3542]],[[133603,-3168]],[[137363,-1179]],[[128247,1454]],[[131777,1160]],[[120705,1872]],[[108358,-5992]]]}},{type:"Feature",id:"IND",properties:{name:"India"},geometry:{type:"Polygon",coordinates:["@@ࣚটďۅͮїѕ׽ŒɾएࠜՑ୞חՑϟ͛޻ࠀͅߊЭરһସʼnӜёٮāৠȝ۪bĪͪŋՖÞβԠǮìڋlǙކ͉Ոƀ܀Çۈ|ÐԪ΁ˎڴŀވشॸ՘۶ȷ״ΞЀԹ˳Λ࣠űÜ͇̍Ʒèԫ׷Ʋછׅ~ӓҩ۵§ХϏۗځȒࢇȏ˹ĚΣгȥѵ೰ɵEƍ՝ҡѦʸӎϖ¶ϰ܆ӝƜީ]ߝŚóאБ¤ڕζ֭̓؆ѻԿ̻ȅ̩Ԭɣƛԑ̆كžەţֱ̫Zਛǩ´ك҃ӻ௃֡ळ঩كՋ࠷ջCϭлȹݳ̝Ͻ«ʥٙǪધ®ۡΣߙI෗ѣ¡ϣٙʰˣދʃ˱֯͵ʍߑ޸ϳ୴͑ࡒ̍Јѿ߰ȻੂơՀޅ଼Α࿀ʣ੾HৰǍ޾௣ԉףĶ઱৲И̤ʝͤড܊֖֔ᇜCǗܞҽюĩ٨ջϘऒࢢঊÙ࢞ࢢՄ࡞ࠄࡈ_״ܒӠڳд֪݂̇̕Ьβ౤ȱपŰߺ۸"],encodeOffsets:[[79706,36346]]}},{type:"Feature",id:"IRL",properties:{name:"Ireland"},geometry:{type:"Polygon",coordinates:["@@ƒ׷ًݣ๯ӹ஑Ŷڼ࢚ѭࡢତڄٌϼǦ҇ǥ҉Բ\\ٌǥ"],encodeOffsets:[[-6346,55161]]}},{type:"Feature",id:"IRN",properties:{name:"Iran"},geometry:{type:"Polygon",coordinates:["@@݈njװӔ֚{τƾװýघэڤğ।ݓظ‰òۻ΁਷ɱؑκŭΫҡˠڡàՓِƙæեݿݿжѵ͸ԓߦυx݉ДƋêϯ௉ѡ̓উཌྷʪࣷȖेŊΧਐЕƪ٣ƭࡑНਇ˦ࡑ٦߳ʈ֗ߘا૪ҍƋՕ˦̻͝ҭѴS҂ˍ@Ɛ،ѝٔ਍Ң׉ߜȜپц̂ÙӬտʨխ৊ҟڨǐʼʿ६ּʈƄͅъϯ־ő̤~রئ̀Øʞʙ́гԼѱȾ¦ˈإߖǩ׎у஠ƟಾɞĄȞ"],encodeOffsets:[[55216,38092]]}},{type:"Feature",id:"IRQ",properties:{name:"Iraq"},geometry:{type:"Polygon",coordinates:["@@րʧÚӫх́țٽ׊ߛ਎ҡўٓƏ؋ˎ@TҁҮѳӿ¤֟ê؝߭༟äᛍၖఫךৡɪ͹৾ᇶ࢔͆৬āؘҢȺјԾΰž঎Ň̐ɉЖƚծ৉"],encodeOffsets:[[46511,36842]]}},{type:"Feature",id:"ISL",properties:{name:"Iceland"},geometry:{type:"Polygon",coordinates:["@@șիॊֵથٙᝓֹܣƵૉŮᚑˈࠠψᆧЪ๪ǎ—ʘᄋȜ֨նౠŰಸ֭౨Ҝ੒ʃൌ҄ආÑ"],encodeOffsets:[[-14856,68051]]}},{type:"Feature",id:"ISR",properties:{name:"Israel"},geometry:{type:"Polygon",coordinates:["@@ƥ˅̣Ŝǫ֓ɂĥɋř—ɛЄŖp͛нഉց෾ʔˢ˶ɞϼǠيŤɆzVˬCþƦɤ\\`·ŕŵhM"],encodeOffsets:[[36578,33495]]}},{type:"Feature",id:"ITA",properties:{name:"Italy"},geometry:{type:"MultiPolygon",coordinates:[["@@̟ڋŲʹǭѝٝ̈́ёĞ୩ѐŞќজûࡪĠْò"],["@@Ԍ׭ş૕ϣÂ΁˫͇ɞ‘২ȓӒҨ¥рʼ"],["@@ரɏĝЯȬΧڝŪہ̗²зĻʇˠё߀чцۛदڱچLȲȃɽǗݪ̥ؠʩܜѫĔƿƽ̛үϼܳƐΝի؈̷ıѫΗ¹҅ܛΕÝHʲǢҊǼǶ͝ӤʱшΑŀʛδգƴεͶثÆٿϜޑմ֯ӜʿࠪйĮہˤϯŕӝϵΓÕĪθҕńɏٲ̆ʰʙ̀”ʂβǵМ¢Ҽ˶ƢƃА€ǼͺتĿψƚâΆԘšĮdžࠨƤȊ̉"]],encodeOffsets:[[[15893,39149]],[[9432,42200]],[[12674,47890]]]}},{type:"Feature",id:"JAM",properties:{name:"Jamaica"},geometry:{type:"Polygon",coordinates:["@@֢÷ҀȫƔɯןeʭƗҹƊӑ̪ĶȔΜÎȒƒ"],encodeOffsets:[[-79431,18935]]}},{type:"Feature",id:"JOR",properties:{name:"Jordan"},geometry:{type:"Polygon",coordinates:["@@Ʀˆपͫ࿪ࣆͺ৽Džų၅у࠸࠿ˣƛƑ˭ٙřȩ̡εʵधƆƒŨоഊo͜Ůʚ@Ԥ"],encodeOffsets:[[36399,33172]]}},{type:"Feature",id:"JPN",properties:{name:"Japan"},geometry:{type:"MultiPolygon",coordinates:[["@@ņ˽ҿԕΉːљțɝӭշʈRЊҬԆӌīΊΜؠǹ"],["@@́ڡƤсѩף੹Ѓ๏½ணॡ͔֡“غษȃষЃঝe࡞أ֗෗իΝН͜ȶݶՏʒͿ־ߐʶѲՈࡌѢ؞ָာʤ࣎ǣࢠ๺֔Б௾ࡀӌ͜ՈਈƟा΢ՎࣀƸҞୗ}ڻޥࡍbࢁ"],["@@נǵרΤȈहఝɯ݁࠱೓ָқँण]ř࠴д٨࣌²ʖ୐ʜټন࢓٤˯"]],encodeOffsets:[[[137870,34969]],[[144360,38034]],[[147365,45235]]]}},{type:"Feature",id:"KAZ",properties:{name:"Kazakhstan"},geometry:{type:"Polygon",coordinates:["@@ӕƹ્דο׹̹KɱЊ੫‚ǡێХNÚࡆ৓ؘ෷ßডũߣݶۋ͆ಥ׼ƽðᓗӹᶽљ£יچ֧ɼॕǩχ˧±ȲȶΖDž̊অ˺ϛݮҩɆ…˜ࠊāŽؘ܎ƎܼűƲࠎƭԲ࠿£܍ȴঃσ޵ǭяƌĐўՙ֘دw܉֬ӞِʕǢڢऊࡺӣŀؘჄࣴಾtᇢ׉঺ͻࢼΠ೰j੺ѥʔʠ୼—ɂЊഷ׀߮Цƿɮ߮ɔ؅ֺϬ˼Ḯ̈ШȺᑆ̴ݰΒຢǹ˄ࢉ࢚Ȳઆ˹éҝ߮´ᑌߎ̭ˁ੶٭ሠᒑ҄ѰୄӛீɎҪƯКӟטNjΨΥ઎ŒѾԣٕ֓ۥÿ¡ࡅұϝဟˢ؅ຑїȇဗͱݲลֻɓäӏԭŬу̠ఝĖඃx̧ġ஥ΞӉǧŽӹ൩̂փşȉρ"],encodeOffsets:[[72666,43281]]}},{type:"Feature",id:"KEN",properties:{name:"Kenya"},geometry:{type:"Polygon",coordinates:["@@ӾۙיͱȹΕ̿Õšףˑ͹Ǐ֑ͷ˥஻ࡀËӤᵁႌƙĢSࢺʊ;а֌̨ؔσ॰įтЉ׎ԬԈ֬ֆѨƗ@ҽ˺ˡג@੠܋ˈSȠxȄī֖ßʞΔގΚͺ˳ָAܽ॑Xᵣ"],encodeOffsets:[[41977,-878]]}},{type:"Feature",id:"KGZ",properties:{name:"Kyrgyzstan"},geometry:{type:"Polygon",coordinates:["@@ȊςքŠ൪́žӺӊǨ஦Ν̨Ģ඄wఞĕф̟Ԯūşȏ೛ғ̙ͭઁıͅ՛ࢷŒׇǏߣЇŜȟʇȓཟŵਡ˘࣫ÝĂӜࣴƕ̮ʸٖĉ੾؂঻ѸױȽإ͂۶ծʟĊ"],encodeOffsets:[[72666,43281]]}},{type:"Feature",id:"KHM",properties:{name:"Cambodia"},geometry:{type:"Polygon",coordinates:["@@΁Ѭыࢄȣ২ՠۨઘdž߀ťۚ͡Ϟׄݖ̱Ȝ֕Ļ৕ඳ٧τԙࢥÓܫͷ۱Ū"],encodeOffsets:[[105982,10888]]}},{type:"Feature",id:"KOR",properties:{name:"South Korea"},geometry:{type:"Polygon",coordinates:["@@ܨযȺխPॷ̓ҥݽljڥΏݳïĥҚƼـχ࢔ذƚֻܘÂúϒ‡͞Ϝצ¢ΨÈŨȮ"],encodeOffsets:[[131431,39539]]}},{type:"Feature",id:"CS-KM",properties:{name:"Kosovo"},geometry:{type:"Polygon",coordinates:["@@›ǣŃPĘ́ȩĐdzɦƾȌȪÒŜ˨ư²Ţşƾ¿ŌƅƒŸǎƻŢLĥȳijij„×ȉӹŻ"],encodeOffsets:[[21261,43062]]}},{type:"Feature",id:"KWT",properties:{name:"Kuwait"},geometry:{type:"Polygon",coordinates:["@@Ǭχõȓ˔هשuȽАݟĆ؞߮֠é"],encodeOffsets:[[49126,30696]]}},{type:"Feature",id:"LAO",properties:{name:"Laos"},geometry:{type:"Polygon",coordinates:["@@˚Ϝœ܆ڹܸ¿ٕࠦھٍÎǛ̉ӯyʣƨࢯԅoݬȸࢮ֧ž³ԎηʸǴ̲ܐնøȡ҄wŵ०ѦŬӮڏϖޅਚO͚ܹ՝ɗʉ̟৔ԉۦ঳Ռ݋َ׏ɄץƵ࠿ݕ̲ϝ׃ۙ͢"],encodeOffsets:[[107745,14616]]}},{type:"Feature",id:"LBN",properties:{name:"Lebanon"},geometry:{type:"Polygon",coordinates:["@@ɣ[ýƥ˫D̘ۄмעfˆϘ§Ɛͣқ̓ȷҟ"],encodeOffsets:[[36681,34077]]}},{type:"Feature",id:"LBR",properties:{name:"Liberia"},geometry:{type:"Polygon",coordinates:["@@ɗQࡽАޅٖ܏Ң֣ըȪː¬ʔϜҘϺϺǶnɖĨΘԧÇ͵ǐdzʂIǢ͸ʄsŸʓĎНǽύʖɱˊÇΤΙ~ͧăĿÝە"],encodeOffsets:[[-7897,4470]]}},{type:"Feature",id:"LBY",properties:{name:"Libya"},geometry:{type:"Polygon",coordinates:["@@ק̷ҿҤ೧βρՄڑϸϻƷ̗ҶήӹؔͬΘñՈńҠÓϦƨۈ¯϶˕ݐШȜðΠėΒ־͔ʶːЦʌ´٦দ́ΜðۮƓ૞ϓЀݛݮǍஆΙࣆйЦɔЖϮț٠˂Ф؄ЀׂŘ଒ǣ˺ϑ̺Iˌƛ࠴ıȲˣ̣ЕżΫɏԯʦڱ@Ჳ@ᶵ@့ॱGYΙ‧ྐ‧ྒࡓҟ"],encodeOffsets:[[15208,23412]]}},{type:"Feature",id:"LKA",properties:{name:"Sri Lanka"},geometry:{type:"Polygon",coordinates:["@@ų࢓ΙʇܵȓЍڜƫீϠ഼׆ұϺסО࢓"],encodeOffsets:[[83751,7704]]}},{type:"Feature",id:"LSO",properties:{name:"Lesotho"},geometry:{type:"Polygon",coordinates:["@@̆ʩʳУƛ˛ҳſƹˍ̛ċؿ٨҄ՐҖ͢ϼǠξʵ"],encodeOffsets:[[29674,-29650]]}},{type:"Feature",id:"LTU",properties:{name:"Lithuania"},geometry:{type:"Polygon",coordinates:["@@ãɊĚɲχƄࢡƨDZ۸२ʴඬÁࠜĊŞǩ҂Ã߲СĀϓۏˏșӃ࣯̓߻NȫʶљĜ"],encodeOffsets:[[23277,55632]]}},{type:"Feature",id:"LUX",properties:{name:"Luxembourg"},geometry:{type:"Polygon",coordinates:["@@ǘȏ³ρʍiȉòĞҼɖŽ"],encodeOffsets:[[6189,51332]]}},{type:"Feature",id:"LVA",properties:{name:"Latvia"},geometry:{type:"Polygon",coordinates:["@@†نЮՆߊ˼ڜعڪhNJ٤ܐƪςĻܢ̷ۚCКȕîС˒ӷ͕ࣗԛƙ߱ТҁÄŝǪࠛĉණÂ१ʳ"],encodeOffsets:[[21562,57376]]}},{type:"Feature",id:"MAR",properties:{name:"Morocco"},geometry:{type:"Polygon",coordinates:["@@ԒΥߜÎࢊȃκU͂՟ºԝ̄ࢱɜDZƷ͛ષƙϝ̵ӡñ—ثঙ͍ͩсۍɥ࠻ŷഫاRহŷ@@@p҉Ա˓ȑϡ@̥Ŋ۹ě˛ٻʿÕЁ੕ୟ࣡ˣୋ΅ϗĵ̡ቅãaD ϶͒ɮ˞ѪÃ˶̀פҴՖ˲ƊɞӬp҂̤Բ̪֔Ւ࡬f\\ц͔ްĢڎָтɠۮۮȿਸ਼͊ܢŔѶդ֨ࡈϦخΐ֘࢈˄ԪؤI"],encodeOffsets:[[-5318,36614]]}},{type:"Feature",id:"MDA",properties:{name:"Moldova"},geometry:{type:"Polygon",coordinates:["@@ȨŮ֒ĊؤʽΊϞɥÑ˵̪ƏŨΗ̊ɇÏűƾčɝ×ӷ|ĉŜǫãÒƭɱˍƥ˽ɁĝƯϦĘΪςӝԂˉΠʹʠʯĈ"],encodeOffsets:[[27259,49379]]}},{type:"Feature",id:"MDG",properties:{name:"Madagascar"},geometry:{type:"Polygon",coordinates:["@@ɠΥȺ։Ɗঢ়ɒϽĉЗƩʙ˷ӰǁʝLjثõΥɵȗ¿܅ͧওб୅ԯཧ͑ୟϛইہȣܻΡӛɊڙ̜ɳѺÇݘ̑ڠù؂Ʈ؄ϰƢD˪Дِø՚șЈǃՌãޠ̊ҺŔՒмŒҶǤ̶Ʋτ\\ӐӎۖԮʦцŗάΦĵҪ׎fԐ˦ϔ̊ί"],encodeOffsets:[[50733,-12769]]}},{type:"Feature",id:"MEX",properties:{name:"Mexico"},geometry:{type:"Polygon",coordinates:["@@͙݅ƥ؁Õ૷ąЧƤқʺЧǚٳ֎سȞӏ͢бࢾɝΐΙ݄ɾٚĎؼưՊƠՖ΂ȨӬè۸Ƣʖ֬ɚࢶȚݔ‡ԚîȬDZ…ЙҋԁȥԝƸƥűγɁٽɅɎǭcǃY̝ԓƳIJķPŭޥV޷AAӁϛC̺˫̶șĢǹƌ½s˷ઃEЙۅŢƽĭȟqʕ्ࣞџ˘ۇɖҷÓګ́чĉץɜؿDŽ޹ϬؿŠ्ϸ۱ВɃɤҹº࡯ˈΓϦࣗӊсՌȧЦ˪ĈđʈȖɔJ̄˱Ϙùͮ˭ъ݋࠴ࡋڀУԼܝ΄ƷȴŸԲѓȞӹФȽהҍæӣѸϿФ™ˀҍو̓٠^͔؇ͬ˫™ӑɴƇͿƔЕĆف̀΋خׁƒȡŸÓŎ˽Ƭ\\ǜթʮɇǴ̕Նё˨ޯʠρɸϿ²ѷКƒͶϡ̨ϑqƭΝ̱ƫJɛԞջӎ؃РїɈ„ؚŵҖЏʺֿϒŏŇɃɖԭȰӷӦÖÚΊ³̸̼ŽϜ٩׶ӱɶ̱Հ̷վϳڦͿݲॖÞ੪ĞÿǑ౔СኀףဪPژ@DΌผ@̪̕јˇԀσ˨ѭȾҥѢʩۤʥՊڒۊhפͱфֹ̄ӯӸӏȂחɾЃپʹ׮ȁ͞|"],encodeOffsets:[[-99471,26491]]}},{type:"Feature",id:"MKD",properties:{name:"Macedonia"},geometry:{type:"Polygon",coordinates:["@@ńOœǤӺżȊ˺¶ϴbтˏÒ։DžƒƑƥҕh͋ǿջõΑȴšήń˸"],encodeOffsets:[[21085,42860]]}},{type:"Feature",id:"MLI",properties:{name:"Mali"},geometry:{type:"Polygon",coordinates:["@@˰ƶƘӶˊpזɻӄǖ͖ÇŴȈ⁚^ȈךƣļЛ⋈Л⋆౾dᬼᆳᬼᆳȨϿԺʉ϶ƋV՗ठĈFካҟ֗íԭݛƃ଩ï̳̗ա՟IȿLjҥš޻ΑDžʿٳϕŗɍΙǡНŔɱȳūֻڙۡp˳ɭΣÆӥ΋ůȝŁŽάʍĥơhƷʕ٭PɷŴʼnùʱʎ¬ʢĿİdzĉ˚Ǥɐ΅ΚijɴȇȂǙvȫş˕őɱǹΫäɷɈƓ„ɕőƅAµ̮žʾí̽͘ʀǓӔԺ"],encodeOffsets:[[-12462,14968]]}},{type:"Feature",id:"MMR",properties:{name:"Myanmar"},geometry:{type:"Polygon",coordinates:["@@ӫηץ›ϥࣥΟƳО݅ՔؗΈօ̭ܵ̃ƹȪу֖ڙĪҷ_ϵ͠ދң޵Сࡷăذʴ٠˯ӼæࣸͽѤ˛৔Ʊਗ਼εۢօуॕ׳ҽöԳȠ̂ਪǫ޾څॺļ̢ӭņ׭ۆÅڰ̊ŵj׾дȦęΤȐ˺Ž࢈ڂȑϐۘ¨ЦҪ۶}Ӕજ׆׸ƱçԬ̎ƸÛ͈ӮÚˮӵξȧ|ٟ“ۙߓۭijঽࢲƔȨޛՐǍʓۣز́ζƷ؞ʔ~΍܏յdẕӓȗ"],encodeOffsets:[[101933,20672]]}},{type:"Feature",id:"MNE",properties:{name:"Montenegro"},geometry:{type:"Polygon",coordinates:["@@ÁǀηЯÊˋǫÞɽ˞εǖĢƜŬҦ˚ȜƾüɠƟŬśˠě͌ǧçïƽȋɧó"],encodeOffsets:[[20277,43521]]}},{type:"Feature",id:"MNG",properties:{name:"Mongolia"},geometry:{type:"Polygon",coordinates:["@@ࢮƢ྄ܤ౬Єܴʳ࢚]֘Ͻ࠼‰ௐɁࠈגͿӶࢊࢊश΍ނįনɍLjؿஜΛߐƺਫ਼ŌࡆōࠖЗԚѕެT੒Ƌޜȼૈƒ௸פԌĝѰ˭ৌêХهק࠽ɐ΅ӈńࠤŽ٦̴ڬˏހוğ̗ڏĦ௟ŏןʅ؝։౱͙࠷ѽࡹǞҿúѳէˎ͓ƌˣי˯׽҇গ̑ఽ‹ഫ̇এҋϋʾ৭AఓԜࠥŰૣśჃȊऑmӱԀϣޠԱĢ৩ԼଅŞুƞ̡θ͖চׅڲன̀۷Ѿəז"],encodeOffsets:[[89858,50481]]}},{type:"Feature",id:"MOZ",properties:{name:"Mozambique"},geometry:{type:"Polygon",coordinates:["@@لæ৞ʁɖńגt̚ʦԌaऀ͜ڞӤƊϕ“࠷ľ݅ಿƨЫʣ׷͙׍՗Եޏ͉ृСॉ͓ࣕƵוׯ΋ȗí׳ЌُǔӱZʣƪ¦{ࠗƋϷȤƝűΓΗ̗ۗ˳য়ҕρ̳ðΟɊÉíѵّRïϊůϖí̠ƬपɓװГஂࢬ॔ɜ؆ŶúĨӶƉʞ˜غǐ׌E੠ѥ˒ЏÔǹȼϳǰ۫gÅ̼āװᢈۘӚЕɴüͨɅ¸͵ǯϷØסոԱʲ׌ζǰíઊΙ؈̣˖̅]ɽદɾٔ"],encodeOffsets:[[35390,-11796]]}},{type:"Feature",id:"MRT",properties:{name:"Mauritania"},geometry:{type:"Polygon",coordinates:["@@և־ԗؤ֍ɞГʚҵUЧǽйð˽ˏïҐɺаŀߊģࠨĵкČмɑЎѵδǾˬᾔMǃ௎ȴќ߀øᒸ᪂©F౞Ṗ᎟౽cМ⋅М⋇ƤĻȇי⁙]ųȇ͕ÈӃǕוɼˉoƗӵ˯Ƶ"],encodeOffsets:[[-12462,14968]]}},{type:"Feature",id:"MWI",properties:{name:"Malawi"},geometry:{type:"Polygon",coordinates:["@@ɽٓɾથ̆^̤˕Κ؇îઉεǯʱ׋շԲ×עǰϸ·ͶͧɆɳûәЖѵɔʮޮ˄̈LJۢǚڼƞɪɉ܌Ѕϐ࠘ƽǜɵ˶Ϲɾଡ"],encodeOffsets:[[35390,-11796]]}},{type:"Feature",id:"MYS",properties:{name:"Malaysia"},geometry:{type:"MultiPolygon",coordinates:[["@@àћֈĶ˞ΈȘýӸԓΜ֛¶֣ęϡĆ˿Öӻ̒ɵͤݑe˳׫Éߑخ঵ښįђӟ֚ś̡۠ҜĠؔȃΤƤƮۈρ"],["@@أ˹ܯƚॱ@̅ॗ͓̇љୟۅǵߑɾЕóөщ՛Òէǟַӆƕ֘؜˽ٮǀǜ܆άǂ৖Ǻ׾ڔЬՐϦѥǮ˺В¸՜œа٪אшڀͼHќыžιֆɻ۬ʧÑ֝͡¥ƮЧ"]],encodeOffsets:[[[103502,6354]],[[121466,4586]]]}},{type:"Feature",id:"NAM",properties:{name:"Namibia"},geometry:{type:"Polygon",coordinates:["@@رٌؖ͡ȃࠊȷ،˯ಒm৒ŅҞ͛Όѡۜѳ৘ǽՆۃࠐ»٢КdžԊƞհ}ԄϝŶÐ₮˜׌Е᎞ş໴΂یȒհµͨȍPéӁȍʭC՛͍ͣΎಕ̍سƒ{Ჽࠣ‡BយA᷋ݣѕҋÕՇDŽϗÔƗάͩɰГг"],encodeOffsets:[[16738,-29262]]}},{type:"Feature",id:"NCL",properties:{name:"New Caledonia"},geometry:{type:"Polygon",coordinates:["@@ېԵѨϭ͉ȫҥɪ׹ϚէѼ։פś˶β[Һ˹φ˷ˎɻ"],encodeOffsets:[[169759,-21585]]}},{type:"Feature",id:"NER",properties:{name:"Niger"},geometry:{type:"Polygon",coordinates:["@@nּॹȐОҿպœϤâТբ̴̘ପðݜƄîԮҠ֘Eኬஈϒᝪ࿸᮪ཾ೨αӀңר̸ȸಯ̾ɓ`ˋΔ˽ǻί͕ၻ«ધੳߋγૉΔ̵CեբmčЃʁµˋƻm֩ंȟ’ځҷٱʔҍ¸ʏşӯ~ӷΧѓq৯ѢЉȵѓb̿͆ࡅ̼ࣗıɕǻşӗʋ͹ÍݣٗӚ̟E˭ʗ"],encodeOffsets:[[2207,12227]]}},{type:"Feature",id:"NGA",properties:{name:"Nigeria"},geometry:{type:"Polygon",coordinates:["@@ࢍ̡͉¬͓ȉڥl҇Ղˡ؊שֆكYݍB¶തs՘ǂՊʶʴТԴėɨǔ͸ȍӾ˪ÎݤʌͺŠӘɖǼࣘIJࡆ̻̀ͅєaЊȶৰѡєrӸΨӰ}ʐŠҎ·ٲʓڂҸȠ‘֪ँƼnͬͯğƱ«˧۽ٱɛՙšѧDZȉǝי҅ΉŽыȋ͹ÿΓֽ˱ҽΊ͇aԃӭʑQЍ߷ɍש"],encodeOffsets:[[8705,4887]]}},{type:"Feature",id:"NIC",properties:{name:"Nicaragua"},geometry:{type:"Polygon",coordinates:["@@̃ˆϽͺȁ˲Ο˄сϜĤžƒŵÚÒʾ”ŀȔŬRkЮȠrǬOǺɤʜǝĒľƺIJ̊ɴbǦĄQňȪĖ|ƜŹǚ›ȆńɄB̈ŌŜŖ˾iïă§ȉĐ̫ȗ˹ěͷυ®ɏtϙŹĉýΫÌɛǣɋ ɩźƏȩDZʛÈƓǦˉêȕʼnօɞųŇ"],encodeOffsets:[[-87769,11355]]}},{type:"Feature",id:"NLD",properties:{name:"Netherlands"},geometry:{type:"Polygon",coordinates:["@@ۦyǀ˳Ƚޓɇ́ԍ@ƘࢡҥȞՏπީǩ؛âѠɲ݀ఆଲΘ"],encodeOffsets:[[6220,54795]]}},{type:"Feature",id:"NOR",properties:{name:"Norway"},geometry:{type:"MultiPolygon",coordinates:[["@@᥆ؙઍɣऄՅෛ͵ڵû΢לઃͰಫ˵Ы؝ߟωࣗȮ઱¥णѼԉɝԷ“ūփནƊɝҵ߭Hևױ࠿झಫ஁̨˹̇ͫ࠯bձ޿¾૟՞э˥ধֻۧυӛ֝Ԫဋঁ૫ȟ୏є̛ࣚˇ኶ޞզᕠ۶ဌࢂ໤୦፺ྴඦلᘼ੊ᇎπ൪­౮ۢ໖›ພǘ"],["@@ም΅๝Ȝ׆ɐԕˎეǚͮ̿ொȍ"],["@@᪖صᑟͥұأ݅ǁЍۡৣᅵԢނ̘ఽʐ࿕܂ٷڄᘎ̜Ң̋஦\\͊˼௾ˆ੖̋"],["@@࿮̏ఝҍ᝱ı៙ƖƫɴஹdँϬᣴɼ௞ȫࡘʤᑺȽ"]],encodeOffsets:[[[28842,72894]],[[25318,79723]],[[18690,81615]],[[26059,82338]]]}},{type:"Feature",id:"NPL",properties:{name:"Nepal"},geometry:{type:"Polygon",coordinates:["@@ÝαŌՕĩͩ۩aয়Ȟ٭ĂӛђଷŊયҼ߉Ю߿͆͜޼ՒϠΒȪڪʳࡔշҾť˰ЕٶǓۀσौȕঔć"],encodeOffsets:[[90236,28546]]}},{type:"Feature",id:"NZL",properties:{name:"New Zealand"},geometry:{type:"MultiPolygon",coordinates:[["@@Ȓ΋װ;ʐΡBΝ̹ϳչإїͷ̴З٭Yܗ̓ɣջӋࡗڇϓнʇޝlխˢࣱÐƗ̰Ҍذ੐ࠦժǀ׾͌ܜѰԎѦώظ͈ɆŰҶלϴȆΧ"],["@@،ࢫlָϜɯŲًڰ˛֨ãӒ͎юĭȯݗʯӫٛjɡʭþαūƻͅҏзֹ٭ͯƟɘΕŨӞ۔˟ҨࣛͲz̦؈̌ƚ٨Ÿլͻ֜vƪБΎڋݔΗת̸àҚұٺɑʂݡ"]],encodeOffsets:[[[177173,-41901]],[[178803,-37024]]]}},{type:"Feature",id:"OMN",properties:{name:"Oman"},geometry:{type:"MultiPolygon",coordinates:[["@@ֹ̻ϟªǩȧƉэļ֗ÿĻϯFԽ̻ćХȓǯԹP͡ɃJͻПɷҩĂ֗˳ϱ³˝טٿ൴ᠾ࠾֖၂ϩתv͸ʔΐFΆϞǒƩŞèմіHϖֵҸ̧؞ŋӼƳϜӕɨ˧̞ŃCȉ̩ԃƅɽΟˏ"],["@@ʼnƳDž˺ʔ˺ľñā΍"]],encodeOffsets:[[[60274,21621]],[[57745,26518]]]}},{type:"Feature",id:"PAK",properties:{name:"Pakistan"},geometry:{type:"Polygon",coordinates:["@@تϻʞ٥൨ͻ߹۷ऩůౣȲЫα̖݁̈֩ڴгܑӟ`׳ࠃࡇՃ࡝࢝ࢡউÚऑࢡռϗĪ٧ҾэǘܝᇛD֓֕؛Ɇʣ؀٭٘໻ǁിeஃŝ̈́ঊொѢéϰГƌw݊ߥφͷԔеѶඨѕࡀŲԈŅǞȂגóદĈ܎ҶӈشCĠɼٞŌ̴ý͢ʀ±ԌΦԖ՘Ɇͥ֊ߜɴ̢•͒мΜĩмȣΤӬμࣘǮ८ĮѐƺӨĦ"],encodeOffsets:[[76962,38025]]}},{type:"Feature",id:"PAN",properties:{name:"Panama"},geometry:{type:"Polygon",coordinates:["@@˫ʎǵҒȺɢɅÎƿˤлɸοÁǝ̇ͻɁǽ‡ĉǩВҗɯŅŧŭϷ©ơԈŋƛˡ¸ǝ͸·ÈɓİέCǻĩŶªǖìǠƲŲIJǩŲK͸͘ö̠̝iDZͲ›ĀæɴȵЮÔΨɄԜǞ˺ʤҬ·‹ĉҶ…ώơ˜ʧ̈́ɵĹūȜӵǁʟ˓ÒŅС"],encodeOffsets:[[-79750,7398]]}},{type:"Feature",id:"PER",properties:{name:"Peru"},geometry:{type:"Polygon",coordinates:["@@ɥљћɋࡅӘñΈရࡊທࣾ٫԰ΏۜƐʎ܅ાࠣ༄ߍီ΅Ϥ˃ؤٷպױͼ˖ϒПߢʼךڢՎIJΓʇȧx̭ΎâͼĝΚщӆΌDŽ֤ԦܶৠͨࣸࢠʾմŝٔɢĂ֒ЉˎЅϴɏӶࢣضĿҨɞ̤ƣԎð٠Ͻթࡣʤoрҁݳ œųۍlj॥ֱÓϻɉ̇ČғԕʍBΡɛƵΔݳҲԝDZί֐µ͆҃ݐuېӸÇ౧ϢĩӄƠܪടǷ˵£ןg܍͟пƮ̵ȕ˯β۹Ջ࣡"],encodeOffsets:[[-71260,-18001]]}},{type:"Feature",id:"PHL",properties:{name:"Philippines"},geometry:{type:"MultiPolygon",coordinates:[["@@Đ֏ºҽ˹ޑ̫ࡨϽэˎإʉϿ঩Ӧɿ؊ʰЎՑЈˁΑЃثҵƑʖ͢۾ՌʀҜ̈́̔ϝٔɰƎϒרv·ٰڼЋêхÐ̱"],["@@̟ˡˁՍ˃ʝԫ׈ǦɤɂɾĢԸҨ¸Ɖ֣جߺāߡ"],["@@ૣߕЬט؈԰Ԏ׊Ѱ࠲Ʈۅևҧѳֿ"],["@@Ԏʹ՘BgΗϳΣՕʧ‡ϸÒєŽА"],["@@ʀभ٫ɞj˭ȶԯЍȋ•עʧªƁԘӶãY͈ԣٜ߮mɴ̻"],["@@ɟܩέоѓ٘ܚ‰̡̈"],["@@ԮʉʶɖüɇƍΑ˼׻ɛۥӷ˥ƁڳȊڝѾġϊIJਾүăҙ˜ȫēϯٻЮ̵Ѵɍ̯՗ԊރůлȆ¨ΎˀɊʣȘŇ̡бӚűμߨͺˡĔೄ˜ހԘA"]],encodeOffsets:[[[129410,8617]],[[126959,10526]],[[121349,9540]],[[124809,12178]],[[128515,12455]],[[124445,13384]],[[124234,18949]]]}},{type:"Feature",id:"PNG",properties:{name:"Papua New Guinea"},geometry:{type:"MultiPolygon",coordinates:[["@@ɽčε͔ρՔǷ٘ŜĆĜʡʬȏРՑЈ˵ŝɽ"],["@@ѯçƃɽҟȱћȟѽBۏʔӑɺêʺݬũҠàŶЖŦrĆѽӐÜʂ˼Ҹ̚ġӸԌfǜƏgү˯ԡ"],["@@ݤտղࢻӖ„‘ω٬ƛʥǁࣀΝġʏ֋ÏȷɔܟĦࡕŴٷ՚ӉҦѧ݀ભπ܇ʇԡˣńإڇ˿һƖࢅ–aᩒaᩒภ׃༊ӓׄїҴхŸӵඔԱȲѽޛěȄ֕"],["@@ʿɡǁӸȝ͘ϝ˞ӍΪ؇ʚɺȮҒɻ˸ȁΜȫʹΛ͊ˏĶѧ"]],encodeOffsets:[[[159622,-6983]],[[155631,-5609]],[[150725,-7565]],[[156816,-4607]]]}},{type:"Feature",id:"POL",properties:{name:"Poland"},geometry:{type:"Polygon",coordinates:["@@·՜à̂ȹ̧҆̚ɺɤȝђָʘ಼ϴ੒˴࠼ƙÚȱ߸Yਚħ໶^њěȬʵšωɸ͋KͯԋǡʸϳfϏцܻěɽзįރۥɒϗǿ¶ߙ͔؁šЇĒӹǵч̖Ήŕ³¼ϭаر¼ăˀֻĦűɑҗǨÀɴػòЉ˔"],encodeOffsets:[[15378,52334]]}},{type:"Feature",id:"PRI",properties:{name:"Puerto Rico"},geometry:{type:"Polygon",coordinates:["@@јõưǕɋɃمLӫ‡·άŢŬیK"],encodeOffsets:[[-67873,18960]]}},{type:"Feature",id:"PRK",properties:{name:"North Korea"},geometry:{type:"Polygon",coordinates:["@@Şƥ͉ºη˵ʣ˷Ž׽ѣȅƫƧ̓ʝ֓ƏηɥηįġͰƋӈσŧȭΧÇץ¡͝ϛϑˆÁùСdžĵƿʙé‡ǀɑüɥƆɰφȤİõƶɆҒÅƎөĠЇɤۄբऒҌ־׮Ўˁܪ‹ſѺಚβͰҼժӹ"],encodeOffsets:[[133776,43413]]}},{type:"Feature",id:"PRT",properties:{name:"Portugal"},geometry:{type:"Polygon",coordinates:["@@̦Ɉ΄ŬɂЫӺDƞłӪ‡ɼуϱɩYٽƍū‘Їγçʹԋɵտ̄ʡřɫ̵̿ê˥ͷɓѷŠџġŸڂÿԬϓþȩ͈äռͰ̨ÒͼǪԎkΤǙ̠™˲"],encodeOffsets:[[-9251,42886]]}},{type:"Feature",id:"PRY",properties:{name:"Paraguay"},geometry:{type:"Polygon",coordinates:["@@ͦ৖tҌЖ݌าʔޮ]޴їbʵʞҳÇଛࢲLJ΄ǐ֦ɩǀʣþޓİ͓̼›̀ƌ̢ƳAҥŕӻǑӛƍݏށ١ړƇऻŸࡑɮࠢ౨ťψࡽ͢ਅبۉŸ໵ൌ"],encodeOffsets:[[-64189,-22783]]}},{type:"Feature",id:"QAT",properties:{name:"Qatar"},geometry:{type:"Polygon",coordinates:["@@ÇؔɨѲɰĜʬˁdӯǽӳɵÑʫǖ"],encodeOffsets:[[52030,25349]]}},{type:"Feature",id:"ROU",properties:{name:"Romania"},geometry:{type:"Polygon",coordinates:["@@δǶԴġՠGϸȳ˺źبĄɄȠΠ@ʰćʺʟˊΟӞԁ€ρėΩưϥϒƹЂƊϠƟpɏПǹʯĀɻ৥ӳĖ̪ؑফțзɋ௽¬٥ƀ͙ÕʍΊƵƦȚƘȷŀ˃ȋөʔßΌԟȢĥˌҕͤڪǂԖ֮Њ֬ԢǮ"],encodeOffsets:[[23256,49032]]}},{type:"Feature",id:"RUS",properties:{name:"Russia"},geometry:{type:"MultiPolygon",coordinates:[["@@ࡌ๫కˤԫ்ࠌࡳyוُԒսٱƻ۸Ĥࠊħ࣢Țٌš૴ӯࠜôରަϮͭϴϐŠɔ։̆ߵuࠟΎࡑ"],["@@໵]ਙĨȒτ୊˚ࢢƧψƃęɱäɉ"],["@@֦Ƚțؐᗸű࿨޻࠭λ൛ēsࠑͳǩ޽~ٗ̊ૣʖȉθ࡟Ǝॗʼnҗ̎Ǽ̸৓ȥϚЃӉΣ@„Ꮪٛᔺ࠳ïԷ"],["@@ः©ƭˌੲΖ@ַ"],["@@ળ»@ָň–܈E௒ʉïŗࡽȩ"],["@@ౡMႣĤƧ¬ߘͪੀþஞ͏ĸə"],["@@ॿͩഉø༛ͨȪ˖༨ųᑔɗ"],["@@ډرᶽzඃȣမղҎ׀૎ǂᕞ™ᴬѽ"],["@@ӹóᩣŊɟώູɦūҒ࡮Ƕ…Ҟသܒޙĺ፨݆ɩϢሤѺ᪪բ᫠ǀ෴̸࿐Ŋאͩ֟ʻᲗз᢭Џᤙߝఫࠍ೉߱Ǡۥྎۏ"],["@@ɨгސȲឤYቈЧڬ̿ȽѧङʝᕅүفʟਬşఖɃݴDŽєաτɔഊƂ᧪ƑȴϽ↲ů´ٜᄼƥഄLബѷϮ՝ӹΙੌڋ೔Ϳ߸ࢦഖϙ෢ɦྼʵؤʀൖş؅ޮૐζ䢀ձܐӿᔲٛ₎DŽာƑ۪΍Ĺؙਜʇ૴Ǥ๰vཚǑཪĢะݛਪˎڷ՞ϐώᧆɻფºᝂБ୲ν@”MKઇσઝÖݶҁԄەϲɧĮΏɑɝ༧Ǿ᚝مݛĭ౽ן௛ԧ̱ϣய׊ᔗڇϣ̸ߵΫ૱Ř˓ց৙߽Šͻड़ȋő௣ޭ‹Ϋ۱Δα฽ѕ̅ॡభȳʥ࡟ே޳ׂ̳έ௬ҵለИ୘܀ԆªϾರȊຊ੒คࡺຢڢڮஆ৷ëԍۗᒉइۍਖᓧ˷ᑃටۚԧሙɕಝēÔ؊ಯŶ਩ЭᢵƠ᪏ʟᨩ࿛ủጝ೚ŁаՃࠄȅ՞оईÃௌऍ†܍ځ࠽ë্ϛഉ్௓˯ׇଙ঑ଇॻթӹ૩ӱՉYՇФૻؙſ˩ŝƦKѐіxŦ঴ɛܚܞ̒৶Ʃ֢ࠈ˾ऄ͚̮Ѵݲ൷ʛܯͧ౧Dͻ߄হװหˎ̵ࠖ̉Ԫ̿βԯࡐ̲݇షʢ૛uਯƱۛлҤȥXҩұˑݷࢻRσஅՍ৙̈́োéѯˮԋĞ௷ףેƑޛȻੑƌޫSԙіࠕИࡅŎ੝ŋߏƹ஛ΜLJـধɎށİवΎࢉࢉ΀ӵࠇב௏ɂ࠻Š֗Ͼ࢙^ܳʴ౫Ѓྃܣࢭơ͡çѽԤઍőΧΦחnjЙӠҩưிɍୃӜ҃ѯሟᒒੵٮ̮˂ᑋߍ߭³êҞઅ˺࢙ȱ˃ࢊມǺݯΑᑅ̳Чȹḭ̇ϫ˻؆ֹ߭ɓǀɭ߭ХസֿɁЉ୻˜ʓʟ੹Ѧ೯iࢻΟহͼᇡ׊ಽsჃࣳĿؗࡹӤڡउʖǡӝُ܊֫ذx՚֗ďѝѐƋϥӽ߿Ƒ࠳ࢁކߕĉ֣ࣼফԇ͹ƝɇωÌֿԚɿ†ՅȚʳΈ޵ǮԙƁƥƼଥЖఅƌ܃ƞĹıੱ܂य़̈́ܩӴؒƈۤ۰ҹͪఌ΄uȀݯƉ‚ώѠɼ߼ÖƄ˪ȅҪ΀ѰWʚఉ˚ӭUԯЀ١ƃ੩̐lǒ̗θڟ¤éʼɀǞ՝ӈࢋąʭ¦Ƀȑ̽”ȷ՞ȟ˨NJĀڴ‡͞Ȁʍɢ֥ƪ¼Ʋ΁ƴՃվǸɨĉЂࠑȨѱijšȼࢭɂˑӸíТЙȖάˊʝ޶װӞųƤक़ҬࢡЎᅢ੶ޮӠ͂єగּΆնݳش֢ܜ঍ग़ޢي౿֔ŬךڶüොͶࢀ̈൦ԕᘨȧṺो٤ЋÆ֓टѳ൏ɡ⏷ٔ؟Ńൌ؛ÂϵÆ࡫ઌʯڂɓňРԑΰ՘͈᎖Թ۾Ȳ֣؜ዦࠖޢµ޸̋Ӫ׀۫ԄЪԊءԶᚠˑӔҹ੡ĻNҳڌ˽ಜǼȶ՚ჶАᰪܞي£ࠣԙਬĕ׼˼༾xఢΐफ़ԏॖ֌ࢡӢѪˤ២ʫ୒ʿᴾॣ֚ѰࡡѺ{ǴৣĈˢЌ҅ټ}ː༄ݾրކزǒᕮɛǬұߕڽԺˋ˒חȏଵऒԧέ֕࿫஝०ŭ̢ͮऎɎɞжܮЎөӌϼֈࣿêȫҲڢࡈણۆຒ֦șװмnѴүͧ߷࣐Ƶϥ؄ඤͦლ¬༈ӏݛ۪ċࣆศǞ፾™ᆘŌہѮংւॲx࿎иᕠŐ˪ɲᕂþیȋሴҀ໲aɶδߤΨጤΈ෸˗ଥȷበŹ"],["@@ⵙ͕ໞીےĦقÃᒈӋʟͿ"],["@@૽ōݱÛśƏঙƑ࣫ȦӐʾል~࿞ƶ౨XǢɧӘȬߊƐఞǿ͗ŷ"],["@@ᆳĿᚉʎඅ͎٣׾଩ǔᔆָᆎȎ࿌чኬ߻ȹݯ"]],encodeOffsets:[[[147096,51966]],[[23277,55632]],[[-179214,68183]],[[184320,72533]],[[-182982,72595]],[[147051,74970]],[[154350,76887]],[[148569,77377]],[[58917,72418]],[[109538,78822]],[[107598,80187]],[[52364,82481]],[[102339,80775]]]}},{type:"Feature",id:"RWA",properties:{name:"Rwanda"},geometry:{type:"Polygon",coordinates:["@@ͬӃµӵʏŁѿÆʱӍԛàþҠŘތԄʎɺȰďԈʸ"],encodeOffsets:[[31150,-1161]]}},{type:"Feature",id:"ESH",properties:{name:"Western Sahara"},geometry:{type:"Polygon",coordinates:["@@oҊŸ@@ÉeNjEౝ᪁ª‚ᒷ޿÷ȳћDŽ்ᾓNǽ˫˜΢bCቆäĶ̢ΆϘˤୌୠ࣢Ђ੖ˀÖ˜ټۺĜ̦ʼnϢ@˔ȒԲ‚"],encodeOffsets:[[-9005,27772]]}},{type:"Feature",id:"SAU",properties:{name:"Saudi Arabia"},geometry:{type:"Polygon",coordinates:["@@ʼnΪʩʨÝͲѡ̞҃۴ʁۆׇ׀ϑƐ֋ߠīא–ӾӕञϿ͠ґǨˡӖ°ȎɹѦʕȊ͝زԟڴѓ־лIžҦœ̌ļͲनƅζʶȪ̢ٚŚƒˮˤƜ࠷ࡀ၆фdžŴৢɩబיᛎၕ༠ãݠąȾЏתv͠ܥаȓƠִ̏Λ¼΍ċ˩ł˯ʎɽŐ˟ŲȵʬǕɶÒdž͍Žș࡙͐ᡌщǞDzϪש֕၁ᠽ࠽ᝑ͑޷ϙ׻ࢥϹƕɁˬ͏§߻ĎƷČॹmɫùΉɔɝЭĒΟρˋ"],encodeOffsets:[[43807,16741]]}},{type:"Feature",id:"SDN",properties:{name:"Sudan"},geometry:{type:"Polygon",coordinates:["@@śhdмĵ̀џͨĵ؄ĶبϳÌÍȇԍ©Ȭʕðԍңңл؅џđ۹Ӫͅǥđʓџǃ…ǥ࠵@řǦ؃†̡ƝɳîѝӬƟɲ؃ŗɱϵɏݣ˿ǁʳğå ̅ʎÃʼƌΔE΄ӛՀĩάZȰ̱ʜUӦǭ͖̍µĎ̰ɒΖħΐˢʴǫȞɞ԰ϨئܦÏ¥ ZΚॲH@း@Ὂ@ῼ@˔ࠗȁƳŪࡻ্̰͌ȷҠ̳ыӑأƏ˅ʳĉ֑α௿ĚͳƅܟͿࠟԓзέٛč΃Љɽʝ࢟Dij"],encodeOffsets:[[34779,9692]]}},{type:"Feature",id:"SDS",properties:{name:"South Sudan"},geometry:{type:"Polygon",coordinates:["@@Xٽűʯѿq˷ӏԨÑюХƨͳϦșӼࣳ֫օԫԇԫϭסFگȟՕȊ΋ɭ݉֐ȥάҵDZϱÆɣƕϗĸԗۚƉˊعͪɅԌΕζ֟ѬS˘ҡͼ֯͠ʴĠ̀ǂɐݤɲ϶؄ŘƠɱўӫɴí̢ƞ؄…Śǥ࠶@†ǦѠDŽĒʔ͆ǦۺөѠĒм؆ҤҤïԎȫʖԎªÎȈϴËĵاĶ؃ѠͧĶ˿cлŜg"],encodeOffsets:[[34779,9692]]}},{type:"Feature",id:"SEN",properties:{name:"Senegal"},geometry:{type:"Polygon",coordinates:["@@΍ٺн̚φDŽРמȦќ˾ːкïШǾҶVДʙ֎ɝԘأֈֽžԹǔӓ̾ɿî͗ʽŧ³қâÙģȃk׿ȲЛV༇–ɥħ˥‚ѻƋƏ٢ވkȬŞƮR̸ȘήǯκcζȌǝʐˡƙʻJͧȸˉ_ȍȥࣵy"],encodeOffsets:[[-17114,13922]]}},{type:"Feature",id:"SLB",properties:{name:"Solomon Islands"},geometry:{type:"MultiPolygon",coordinates:[["@@ɾ˿חN͉ԬԈȯǜ‰"],["@@͝mԧĎǫżÀͮֈƁ˜ǭƎə"],["@@ųƹحܰǫԈ˺@̠ڥʹЗ"],["@@–ǛڅΦҟ̠̿˪ŰĐϮȫېϭȢˉ"],["@@Ǘ³οȒ·Ί¨ƖԈΡͰ˛"]],encodeOffsets:[[[166010,-10734]],[[164713,-10109]],[[165561,-9830]],[[163713,-8537]],[[161320,-7524]]]}},{type:"Feature",id:"SLE",properties:{name:"Sierra Leone"},geometry:{type:"Polygon",coordinates:["@@ɧØ؁ͺѩ҈Ƨ̬Ĺت҆τĬɺƞǸɶpȜǂڦCɺ̛ǼˁʓƈɗṶɴ´ϹϹϛҗ«ʓȩˏ"],encodeOffsets:[[-11713,6949]]}},{type:"Feature",id:"SLV",properties:{name:"El Salvador"},geometry:{type:"Polygon",coordinates:["@@ġȡӡ^̡Ą΍ǘұÀʃǶ~Ů˾ɄǀĢ«IJȠ¾ʜëǸǙʪƇŒœτĴǤÑŘĝÏͳ"],encodeOffsets:[[-89900,13706]]}},{type:"Feature",id:"-99",properties:{name:"Somaliland"},geometry:{type:"Polygon",coordinates:["@@ϛԩד۫۹Mᩧা͍̜̳К̳ҨǾ̖̲҈˚ƹǒΏϜΗкGߊɌࣴĴ݌ʼиÆ̚ƶӎˆKaE΋Aࡑ@ѫ"],encodeOffsets:[[50113,9679]]}},{type:"Feature",id:"SOM",properties:{name:"Somalia"},geometry:{type:"Polygon",coordinates:["@@ѼĎЊ˾͈FpɵýӧHѳǯ̣ʁࣥЙयԱ੷ܝ௷ܓवধ଩ࡁڹష࠯޳ٕँৱȗѷȍȣӽۚWᵤܾ॒ɰˆբfݠפબšᛜᡄה۬ϜԪ@ѬBࡒFΌLbːhϰŰ"],encodeOffsets:[[50923,11857]]}},{type:"Feature",id:"SRB",properties:{name:"Republic of Serbia"},geometry:{type:"Polygon",coordinates:["@@Ԡȡà΋Ӫʓ˄ȌȸĿșƗƶƥȷȏø̫Тγ͋ʿƗˋĞijƑšϳa˹µƒØĴĴĦȴšKǍƼƑ ŋƆƽÀšŠƯ±ś˧ȩÑèð͋Ǩ˟ĜūŜɟƠȢšŬЄЛ͔ɀτ̥Ë͔́ˉʈȱ͘٢ɚԾ™ҖͣĦˋ"],encodeOffsets:[[21376,46507]]}},{type:"Feature",id:"SUR",properties:{name:"Suriname"},geometry:{type:"Polygon",coordinates:["@@৔ǙĞưڶÔࣚɥѩܟâֹͤӽƥίóϩɉΛӓDzЇđ͹öčʏƘǗ÷ǡҙèԡܴōӄˏBωؐƺѠ¯ȤԜɖƈݲ"],encodeOffsets:[[-58518,6117]]}},{type:"Feature",id:"SVK",properties:{name:"Slovakia"},geometry:{type:"Polygon",coordinates:["@@´»ΊŖш̕ӺǶЈđ؂Ţߚ͓ɷɓǏ͹dzđ࣑ʮ˟»ȟȡЁĿěÄХŽͭ}ãǙ۷Ļ̱ĠёɌċ̆äńŢȂόa˺ĔxþLj¢ÆȒȖ˜žưʢD"],encodeOffsets:[[19306,50685]]}},{type:"Feature",id:"SVN",properties:{name:"Slovenia"},geometry:{type:"Polygon",coordinates:["@@ۜÝъȐܾtLjƘƘUǎ˳ڝɟć͹̇đHɻͣh˷ƎƷƙב†ȈúȫΨĞа"],encodeOffsets:[[14138,47626]]}},{type:"Feature",id:"SWE",properties:{name:"Sweden"},geometry:{type:"Polygon",coordinates:["@@ࠁוƀԥ೹ڭྱܡؓஃײףߦүޗॅ࢑ȝ͍තӋ޿৳ĆӅڗঃˉߐ۳॔ٓஐφӜּۨ˦ন՝ю½ૠղ߀࠰ä̧ͬ˺ಬஂࡀञֈײ߮GɞҶཔƉŬքԸ”૪Щ಼ֱv಑˴͛ฃʃ"],encodeOffsets:[[22716,67302]]}},{type:"Feature",id:"SWZ",properties:{name:"Swaziland"},geometry:{type:"Polygon",coordinates:["@@ǡύӭěԅҖS̄ɰ̀ĂʔʐÒшƵŰϕðω"],encodeOffsets:[[32842,-27375]]}},{type:"Feature",id:"SYR",properties:{name:"Syria"},geometry:{type:"Polygon",coordinates:["@@࿩ࣅऩͬgNŖŶ_ΈȸҠҜ̈́Əͤϗ¨ÿٞȶΌɤȀɤȀ°Ҹ˞Ǐऎɺ҂ƿۖFॴ̀Ґaक़žїԽҡȹĂؗͅ৫ᇵ࢓"],encodeOffsets:[[39724,34180]]}},{type:"Feature",id:"TCD",properties:{name:"Chad"},geometry:{type:"Polygon",coordinates:["@@ĎЄաnDզΓ̶δ૊ੴߌ¬ન͖ၼǼΰΓ˾_ˌ̽ɔȷರࡔҠ…ྑ…ྏ¦ ܥÐϧإɝԯǬȝˡʳĨΏɑΕč̯̎¶Ǯ͕Vӥ̲ʛYȯՏƛэͽ؉ࣹ߅ϳ߹¾ʁûĊ̏ѫ̋Σ͟੓͏ȽȐƓhƹɍۛÙƀɪ˅ׄşΐλƜӷӪǼІϦċʂÐҸSқކŒ֐É֐ͭՠ"],encodeOffsets:[[14844,13169]]}},{type:"Feature",id:"TGO",properties:{name:"Togo"},geometry:{type:"Polygon",coordinates:["@@ڱdzȇ̎ɡՔãкȆݴɁ̬ăڎD؎ΕѠÖˀ݂kŅѵʲʝ̈̋ŽЭǜǥኝȺׅ"],encodeOffsets:[[1911,6290]]}},{type:"Feature",id:"THA",properties:{name:"Thailand"},geometry:{type:"Polygon",coordinates:["@@ݭϬܗeŬڈ݉Káऋґ௯˙ݏÌ؋ն΀ދưܭҶӓԚĭѤѧ˝·ևĵßќۇςƣƭͧ͒ƝжҁӄПЌƏӳǃҲĠԾʚ߬ТࡸҤ޶͟ތ`϶ĩҸ֕ښȩф̄ƺ̮ܶ·ֆՓؘН݆ΠƴϦࣦצœӬθӔȘθʷ´ԍ֨ȷࢭpݫࢰԆʤƧӰzǜَ̊ÍٖڽÀࠥںܷ›܅˙ϛ޿ŦગDž՟ۧȤ১"],encodeOffsets:[[105047,12480]]}},{type:"Feature",id:"TJK",properties:{name:"Tajikistan"},geometry:{type:"Polygon",coordinates:["@@̭ʷࣳƖāӛ࣬Þਢ˗འŶɈާˠĐԜȓ‡͛ŴӍࡿBׁØԻϕύĉ̉ǯͩˠþ۸ʩ¢ĞʲғȐα̇ė͹Żūԇj˕ϩ˯nj؋ˑʱĺӀࡘǹض؟ȨɔφۮŸЌҬˌբ૲ȜǩϵŤɹΎv"],encodeOffsets:[[72719,41211]]}},{type:"Feature",id:"TKM",properties:{name:"Turkmenistan"},geometry:{type:"Polygon",coordinates:["@@ñۼطŠॣݔڣĠगюׯþσƽ֙|ׯӓ݇NjƻרŪ࢞ٽ˶Ɏֺ֏¸Ȇ۾ߊȵ݈ˎؓԎʉӔڱɋď؛ʿհψ˨ॖǪ֨ɻךڅњ¤ॆ\\Əцܖ̂۾ӦଆѹĜڡ͐ǣࣦžˮƳаࡽ०ׇոЃ࢞Щ૤Ϋwԥʩ€Ѕɤſ̙۽NjǙڥӁʭڏŵǫϟهŏࡩ͈"],encodeOffsets:[[62680,36506]]}},{type:"Feature",id:"TLS",properties:{name:"East Timor"},geometry:{type:"Polygon",coordinates:["@@IJȤܢȌז†ˀŀ͆Ľ̯ɫ࢕ο۳ʋeʬďǔ"],encodeOffsets:[[127968,-9106]]}},{type:"Feature",id:"TTO",properties:{name:"Trinidad and Tobago"},geometry:{type:"Polygon",coordinates:["@@ӚŊǮ‡‘صۭġƯúʒɲiͪ"],encodeOffsets:[[-63160,11019]]}},{type:"Feature",id:"TUN",properties:{name:"Tunisia"},geometry:{type:"Polygon",coordinates:["@@ΩພԭͺQȰۉԄóنԮҶȢۚƃߠǠќࣶͺךĵ}ы܊̲ÒljпЫMϱ̆ȽōܫփхDŽқѤaɄЍ͊ſ³٥Хʋʵˏֽ͓ĘΑïΟЧț"],encodeOffsets:[[9710,31035]]}},{type:"Feature",id:"TUR",properties:{name:"Turkey"},geometry:{type:"MultiPolygon",coordinates:[["@@஺͗ঐżܤõলѬࣆ¢ߴЭƜ̑ăУزȻͨʕֻʇˀ५ǏʻҠڧЕƙ̏Ɋ঍ňίŽॗŽҏbॳ̿ەEҁǀऍɹ˝ǐ¯ҷɣǿɣǿ̱Ϡ͈͂ԟí۱ȖֿәౣĥڹҊࣟ†ȗΑׇij߻҄ࣻeӽ࠶ؗҰЦٸՓВठߨಒ’Μྀٔŏ৞հ঒ʄർlุף"],["@@۫ҏ˃Ϻ\\ǦȦĦʺՂХɞࡦ˄ܤőĴ͓ܼ˓Ƶȵি±Ωʷ"]],encodeOffsets:[[[37800,42328]],[[27845,41668]]]}},{type:"Feature",id:"TZA",properties:{name:"United Republic of Tanzania"},geometry:{type:"Polygon",coordinates:["@@ƚġᵂႋÌӣ஼࠿ϱਙ¸Ӊՠ̩~ɓɳԓ¶ʭÇГ̌Ճΐ̰ࠡǿڝӣࣿ͛ԋb̙ʥבsɕŃঢ়ʂكåɽଢ˵ϺǛɶࠗƾӉʨՕƘͯƘΗɈґ੖ӣҺǗӤČѨƯޞΎ ̨̦͜ѬȺǮS˘ǷȐ·ͨʐł¶Ӷͫӄ̎Ķऄ[ႎà"],encodeOffsets:[[34718,-972]]}},{type:"Feature",id:"UGA",properties:{name:"Uganda"},geometry:{type:"Polygon",coordinates:["@@ः\\̍ĵԇʷȯĐPوȜ͎²ڬǰϸ͎Ѭ͔ɠ˒̘͵Ŗ¼চΌɮՖȉڰȠעEԬϮЊ׍İсτ९̧ؓЯ֋ʉͽTࢹႍß"],encodeOffsets:[[32631,-1052]]}},{type:"Feature",id:"UKR",properties:{name:"Ukraine"},geometry:{type:"Polygon",coordinates:["@@̾“ɄȒʮ¥ࢌĆ՞Ӈȿǝêʻڠ£̘ηkǑ੪̏٢Ƅ԰ϿӮVఊ˙XʙͿѯȆҩƃ˩߻Õџɻύڡã֑˕޽«ܣ̻¸ԹЪȭࡨ¼Ǐ̛ँơଛӟұǠȄЂࣽʘƨLjߪ˪ʑȔಯɆË̼ީĻ̷ҧٱةϟƠЁƉϑƺɂĞƦ˾ɲˎÑƮǬäĊśӸ{ɞØƽĎÐŲ̉ɈŧΘ̩ƐÒ˶ϝɦΉŽأʾ֑ĉȧŭΟ@Ƀȟاă˹ŹϷȴ՟HԳĢγǵÍɤұɮǐͺɸɔȀµɑϘބۦиİĜɾхܼДҢɪٲnࡖßबȫڎi͂ŧ̀Ʀɚȝݸ¢ͮąÄцʶȂܞº"],encodeOffsets:[[32549,53353]]}},{type:"Feature",id:"URY",properties:{name:"Uruguay"},geometry:{type:"Polygon",coordinates:["@@ղĚࡆٯ̺|ࡺ՟ڈҫӠֱχЉɸӇεՇॉұاǚғěޥΰ֫ԟҬÞլǾȈS࠸ɤࡺȾڦ"],encodeOffsets:[[-59008,-30941]]}},{type:"Feature",id:"USA",properties:{name:"United States of America"},geometry:{type:"MultiPolygon",coordinates:[["@@ũƕȽŤ|ɾƓ̨¦ĤƤƎÍǔ¸þÜe͐ƙƬñƌőɊ̍q¯͟ǵˏſ"],["@@˭ÑƟǮīèQÀĈî̘āɘŹëĵ"],["@@ĝ҉|Úĸа•"],["@@­µÓŻˆŃȒ’ɤŚêÃʐ˥"],["@@ıĉ˱ƴªÖŸĈȘijȝ"],["@@Ƭңʼƛז½࡬ƅࠂʹڼŊਖɓ˞Tݨʄ߂̧ࠒ͗ں˩ٶˏĈəȢĉ½ĉɦǎĔ¦ȣǜƅɴ@ŬĹĽƫ࢖ЁǶށǚܳʗӹЁҥȁ̍mēĦť˸Ɓɂ@ঊ҆ࡾƀસмfĐ÷ʰƉǒϜƆࠜHޘAˎ͞ŀàࢶ؄ϜƸ౦N໾BĎȺː¦Φž̖Ϣʲٺٚي˨ə֜ƜώʏAଧռӅƢ˝࣋Пࡷ̃ࢱʝѻӿƛȋSѽˤѽΒsė̬ʦȇãʇ֥ƋЗhةƥλ¥ӥ¥۫ʏఀǂʠǃ୳ʥ՗C|ĺʭɷʚǹ׽ؑ٧×Ɏȁª˟ɀǪҍȼƭ^ͅˏ͛ҿڡûʺֲѕ͎įۦljεǴՑևƀׂ˓˜ߛʊÍĖ̃ŠࡁՕدࢇʝցӱнÁэ̱ţ˭इձӁЍЅӽŻׯƪ׍ˬܗώשLεЊঅ֥—͛ȿԡʣŃЯĺƁς͋ȖѻܢϹٞű͢Ǥ֐ɽҦٻ۲͟źࡑϡƭ¦СϼՃȺोŁݗĤٙÍΏſƲɟaͽǴǓLJō̵Ů́ǃ؍€طѺܻĿ؏ȚԹÏۻȝއح࠳γҝБȕϗUׅ¨ЕDŽ˹͝{׭ȂٽʺɽЄȁטӷӐ̃ӰуֺףͲۉgՉڑۣʦѡʪȽҦ˧Ѯӿτїˈ̩̖ป@C΋ڗ@ဩOቿפ౓ТĀǒ੩ĝॕÝƙіխӚϻĴğʌһ¦̝ɪޭĊɉƌĹҢࠁࡊ۩ୠˆȚχˤٯ۴řۆ҃ҞȀۢ…ܜˍ٢͠ߊĸނĺނƱૼˇܘʓ϶ĸǐ௒˷҂ߋȺɜƇې˷ێᛸ@᠂@ࠜ@ᢢ@៚@ᡀ@ᡄ@᭰@ᮞBაAF͔˴J"],["@@࠽͋ѕɐŽЀބ̘҆Ÿ֐ÉΤʻܫЍ"],["@@ԧŽսƾԛɮࠦƞښùĂ͑"],["@@԰DžԾĒڸɛ࠲őéĝُDZٕǾ͋Ʋݍµȧôº̈́"],["@@؊ϛώnjහ»¹ȕ౾ƛࡨČᄚ˅ྤā٨ʼn૦Ǝౢʧࣲŝ@@MᷱIⷍࠠ{ࠌɵהρݜցࠈҺࡈ˖Ҁѡ֤·ޒϙՂ׽࡮य़ේ՗xՋұЙҥ͂ݍˌʃܺએںҍߎ߯Ä೷rটʌ჉ࢎߩDŽ฽̜୑í࿻ϬৃΨटǯǦ׏ҫÁঁǫ݉˱झdzťӶϚࠚࣀʶɱɂੱҵֵ֑௅ױؚСߏ׿ࣗΗࡁʱȻωಽѡ˅ϿছΫֽÞ޷ɻ࡝˹ۧ˫෹ʉſƘऀϾࠔʸࣆҠਬĨвΈ୘ԊȈǚب̒ƢْђӸॹʫ˓Ơҕ̧շюɧ̝̽м࠿ͳԩBïԄƲ̮ե̚થLJ܁ЀַȬIӈ٩Ϊ͘ӘۆҸ̚њںÖ־ƇڴМ؎ï٘ʼƻϨҹưج͖ԩWࢻǽʯȃڏȄஏĥ௷ȬΛ͸੟Ӧ୾ΘመШ۔@ŕнᄢŽڽԶਕ͌ױр߫ΨଽˈҺѲ๰‚ਗ਼ϦȨФ࡬ЎࠊĪཪώޜÉಐ҄ౚǭ"]],encodeOffsets:[[[-159275,19542]],[[-159825,21140]],[[-160520,21686]],[[-161436,21834]],[[-163169,22510]],[[-97093,50575]],[[-156678,58487]],[[-169553,61348]],[[-175853,65314]],[[-158789,72856]]]}},{type:"Feature",id:"UZB",properties:{name:"Uzbekistan"},geometry:{type:"Polygon",coordinates:["@@xԦૣά࢝ЪշЄ॥׈Яࡾ˭ƴࣥ͏ǤěڢଅѺ۽ӥܕ́Ɛхॅ[ᶾᓘӺƾïದ׻یͅߤݵঢŪ෸à৔ؗÙࡅЦMǢۍ੬ɲЉ̺Lπ׺૎הӖƺʠĉ۵խئ́ײȾ়ѷ੽؁ٕĊ΍uţɺǪ϶૱țˋաЋҫۭ ɓυؠȧǺصҿࡗهǰҳN"],encodeOffsets:[[68116,38260]]}},{type:"Feature",id:"VEN",properties:{name:"Venezuela"},geometry:{type:"Polygon",coordinates:["@@yȣӱĭ˜ϡYѭυӥ͆ڙδÆȌ؈ʻ̒§َਸ਼΀řІ̎ˆ̞ןל_մҵ˧ݮQ࣌ĔӖϕٞĻҼʾXɄਨ¼৖\\܉ʛ˼Їڦ×ِЯƆڧѬn͢ȣڕӱó̫˾̷ȽƽԫƉjϱɫɱّ֪Őʁ̭͍ऱ̽׿Žʏȣڛɀثņƿýϔɑ‘֝ŜՉ܆ï°ǭ׷ʅĭΣΉƏسȝNjʱٷÅҧѼʯ࠺ɟ̧̌Ȅюм…ȊʅʠǛ֒à׼Ȉ˰ƲҎ̓Ơӏĩ؁®ͻęסܢӥńઉăȧ̊ȷê‡ǬĴ̶áͺȃȂŅϮѡÈɸӮĺ׶ʔ̸͘ʌɈрդƖ"],encodeOffsets:[[-73043,12059]]}},{type:"Feature",id:"VNM",properties:{name:"Vietnam"},geometry:{type:"Polygon",coordinates:["@@૭ܗ۫ߍȁ׍٠ࢭ޺ળނԱԞګϪ།ŕ๓۫փ१եۇ۫਷ޱ̧ՠʀ֬دӌܬ͸ࢦÔσԚප٨ļ৖ț֖ƶࡀɃצٍאՋ݌ۥ঴৓Ԋʊ̠՞ɘ͙ܺਙPϕކӭڐҊȴڢIࠈĬܒ҄К̿ސƵƃӛАͿࡎɓ"],encodeOffsets:[[110644,22070]]}},{type:"Feature",id:"VUT",properties:{name:"Vanuatu"},geometry:{type:"MultiPolygon",coordinates:[["@@ˣō˭ςŒɤՆӗ"],["@@ƌڱɥŀǩ­ťɴi٢Дʵ"]],encodeOffsets:[[[171874,-16861]],[[171119,-15292]]]}},{type:"Feature",id:"PSE",properties:{name:"West Bank"},geometry:{type:"Polygon",coordinates:["@@@ԣŭʙЃŕ˜ɜɌŚɁĦǬ̤֔ś"],encodeOffsets:[[36399,33172]]}},{type:"Feature",id:"YEM",properties:{name:"Yemen"},geometry:{type:"Polygon",coordinates:["@@؉ɥNjύo˹࠷Οഇϻݩףυ±ʥºӭΑ՗lj۷©ɃµǿɛəÕŻɇеlˍœ׉¨ɓӬzҠƍʜǑتʋΊǚ¤đϨĸNJ™ξςˌđΠɞЮΊɓɬúॺnƸċ߼č͐¨ɂ˫ϺƖ׼ࢦ޸Ϛᝒ͒ڀ൳˞ח"],encodeOffsets:[[54384,17051]]}},{type:"Feature",id:"ZAF",properties:{name:"South Africa"},geometry:{type:"Polygon",coordinates:["@@ǏŧΣяɻћӇ׻ोࢁףԋًϣ࢛͙ѓ«ŇɷԛŰеDž࣫NJԙĹΏ¬ࡿͩܓƃԱͅϡoΣ̚˳fαϒŸśŏɦLӰ˙֞˔ƴs٤ս޼х܈AF׽તДдͪɯƘΫϘÓՈǃҌÖݤіB᷌ɨűӾߙûԟȈ̏׼ĒрϒЊʨȶДЦȚΠķВɽۂ£՞ȜĐʾƨДҚäʨ͂˪֔ݮغஒؤ΂UОƛ˲Ķ҂ċД஁ɔׯƫऩî̟чƶʏÑāʓɯ̿T̃ԆҕӮĜǢώْQȿؑıۥɑϛֵщ","@@νʶϻǟҕ҃͡Տـ٧̜ČƺˎҴƀƜ˜ʴФ̅ʪ"],encodeOffsets:[[32278,-29959],[29674,-29650]]}},{type:"Feature",id:"ZMB",properties:{name:"Zambia"},geometry:{type:"Polygon",coordinates:["@@ІϏɊ܋ƝɩǙڻLjۡ˃̇ʭޭѶɓᢇۗĂׯٍřӍͯĹ̛̅ßܵۓҭխ˳o˗ĬऱĠƯÚOêͧȎկ¶ۋȑչԾ֣یžᦶშYí̂Ű̀ƧЀĪТėʺ̂q¶ʽϾrՖûˬϡڨŝԤˆȌѯ٠ş̴ΧΈҥ٠Që࣠ɱƳח͞ɧƬļࡈƬসȉψʈ՚ɤĶ଀ƚͦđΘɇͰƗՖƗӊʧ"],encodeOffsets:[[33546,-9452]]}},{type:"Feature",id:"ZWE",properties:{name:"Zimbabwe"},geometry:{type:"Polygon",coordinates:["@@ҁČ˱ĵНƜ΁VՙϞٯźʙՒC̒έĞ्ई˃ӢǛƮ͓ڤलğ˘ī˴pҮծܶ۔̜àĺ̆ӎͰَŚÆ̻۬hϴǯǺȻАÓѦˑF੟Ǐ׋—عƊʝħӵŵùɛ؅ࢫ॓"],encodeOffsets:[[31941,-22785]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/xiang_gang_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"8100",properties:{name:"香港",cp:[114.2784,22.3057],childNum:1},geometry:{type:"Polygon",coordinates:["@@™@}ScTʟ@cWuJÁ–]„l¦RLj¼BĄà˜ ŽH@TOHCTDDDHDNAT@PEHDDNJLX@BABALHFF@DKHADBBLDHHFBLEJB@GDBBFBADDB@@KFAFBBJJA@BB@@FFDDADFF@FADDDBJC@AFBD@@DDD@DAA@D@DB@DHHBFJBBFEHDFAN@DGDC@DLCBDDCFDlAFBFCBEF@BC@GDAB@FD@DZJ‚X´HĐMja@Ý`p_PCZ@lLnRGSDMFK|a\\Y}­ƒ§™Mën"],encodeOffsets:[[117078,22678]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/xin_jiang_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"6528",properties:{name:"巴音郭楞蒙古自治州",cp:[88.1653,39.6002],childNum:9},geometry:{type:"Polygon",coordinates:["@@˜@ÈÒĊanwŎV„™Ȯ¦ͪŃĢ„ÜōȂçČéƐżLɆóĊ‚ĊaʊŁ±¯²Um»ˌmÈ»V™ʠţWÑůǓ郙ôƑƒğÆīŎī@Ƿ™wô™˺LÞ¯ƨVǪуšĢ™ȘV°wĢŽôk°¯ƒ»΀@Ȃ»ĸŽǔ@΀ƒ͔ôôLɆó̐ÝɜLɲōͪƒƨóŤK@ī@IU܃ÛmȻţǩÝ˹ÛljťǓǫō@Ɲ²¯VçōKͿŁΗÇţ»ƽ™ɅƑLÓŏÅÅɱV@ÝĊU¯ÑĊĭÞLšÞŎJ±̃XȣˌōlƒUÈ¯ŎKÆƅ°™XÑܱnŗġV¯™óaUƒƧUōŁ„Ñ™±„çɲ¥lĉkğ°ƒk¥˜ƒnğţL¯ÝÝUƽĬ΁lķ°@„ō„XÿݯV»ŹLʉÞɱŤĉó°ÝJ™¦ÝKÝ£ţܙÈĉ@ƒxǩUċƑ@ky͓¹™`U²ĉVġ»ğa¯¥ť@ĉ™‚ó@ŻÛÛJƒw¯nó¯ġWƽʩķÝɛwĉĕݼȭÞķō@ó£Å΀ƑŽ¯ôȯÞ¯Ȱ™ÆōèĉXǼó@ݚnºƒĸ„ÞVƜĸȚUʶõˀĵĖɱŎÝĖVࢰӒѢ°˘nϚVˌ™ÈmɼĵŦW¤öʊõʔ@°ÈXVŽ™ènŎȁb¯ǫĉ„±Èğ`ġwōÔğ»mVVŽ„Ý¥ó@™ĸķô@ššbX„ĶmV²²`Þ_˜˜ɴbͪÈ°„ÞWĸÈŌmބškɲŽÈUÆ»n¼ǬVķĸźô¯°n¦ɄǜÈ"],encodeOffsets:[[86986,44534]]}},{type:"Feature",id:"6532",properties:{name:"和田地区",cp:[81.167,36.9855],childNum:8},geometry:{type:"Polygon",coordinates:["@@ƨ¥šèź٨ΘƑᩄbUࢯÞĕɲōĶĕöʿVʵķșUƛƒÝ„ķm¹Þ™ô@È»ĊWŎçšÅ°ȯȰÝ°óƒÆͿĉ»̽çnƒmɱĵƧºóU™™ƽ@±wóL¯°̻L±Æ¯Vƴķb¯VÇ¥ğ²Ǖbk¥ÇKlÅɱġ@у™óK@™ÇaÝXğţxĉČǫķê¯K@уaŹ„ƑKƒ¼¯Vóaónġw™óÞéU™ġbóĉğÇl¹™aUóğKW„Vůn›ÇŋƑ›ķnʇ»óxĉw™çÇ°Åw™°ċ„XŽ™„ób±ƒkÈÇJ—ƒm²ţx@ÒݎšŦǺn„ó¼n°ÇbUÒ±¼XĸĠłƽXmwĉºƒzÈÜmnxmx²ĖmҚbnŽƧêUºĊêÆVóĖóUĉ¼ÅĬƑ°ɆƆŻŚlłÞLš¼nĠƒ¼@ޙšÞź@ŎÞ°VšɄɴжϼِ͈Ŏ„"],encodeOffsets:[[81293,39764]]}},{type:"Feature",id:"6522",properties:{name:"哈密地区",cp:[93.7793,42.9236],childNum:3},geometry:{type:"Polygon",coordinates:["@@WnŐÆĶLĢ¦ţºź„lxÅĸƽŚ‚Ʉ—Į˜è@ô²ÞUĔƐńV°¯ĸX¦Ɛm̐bƒ»Ɇa΀šĢ™ƐLˤ™ȘÑnƒІljĸÿn¯ĶaŎ¯ĢĕȘ¯°΂œla¯¥™ǕǔwˤӱlťО̻nŻmɃĕċţUw°WUóƨÅţķ°ýV±óÅǓéʉ¯ƽŁƒéōǖȁÝƏůǕw˹ǫȗǓƧǕVý™é@ĬţLƧôͩ„ɱŎɛK̏ÞɅôóK@²@°ōؚ¼lŦ¯ŰóƜÛlV¼ķ¼ƒ°kȰ™Ű„ĠƒǬ™ŚÝŎmĖ`@ÇÜn„"],encodeOffsets:[[93387,44539]]}},{type:"Feature",id:"6529",properties:{name:"阿克苏地区",cp:[82.9797,41.0229],childNum:10},geometry:{type:"Polygon",coordinates:["@@VƚxˌŎÞŎƒ°n„ȂÒ°²VĊ¯VğƾˍǬƨÞÞKÈÞĊVźôɆÞĢèŌôWČ²ŤVÞĸʶbl‚¯ôn_VÆĸlmÞnVź_ĸ¼Ȯmǖ„šéĸW°°„ĸJ„kʠ¼Æw°¤ÈƒlxɆzČºĶI²ÆǔUš°ô@Þ¦‚ƒUnUĠ¼ŎÓĢxĠ_²ÇĊƒǬ°ŽȂamōšçUÇW@¯öʓõʉX£ĶťnɻšÇUˋmϙ¯˗ӑѡᩃaΗƒœɜ°xWƴUxɃÒˣ¤Ʌwğ„ʉōóÝŹ±°ȗ@¯„ƃ²¼","@@ō™гwȁ¥Ƨ°ŹÑķV™¼ÞêĊ»‚lĵšm¦ÅW@ĀôÈźaɜxÈbÞÆĶIОŘnIÇŃÛÝĊÑĠƏ"],encodeOffsets:[[80022,41294],[83914,41474]]}},{type:"Feature",id:"6543",properties:{name:"阿勒泰地区",cp:[88.2971,47.0929],childNum:7},geometry:{type:"Polygon",coordinates:["@@ɲˣĊIÈ¥‚ÅU±Ċýkō°ƒĉƽó»ĶƽXóʵʵ™ȯƑÅȁɅ¯ĉ@ÇሗK֛@@ˤV֜ʵрƒǬVĸƑŎ@ƆϯÑóŽķ@ʇ»ķ¦έmlÈĸĊX¼WźÛÞÝѸ‚ĢČþ„ĀĊôάVö¼ĊUƨ°°èŎČUÜƐóôVôôŽ²êȘlˌç°`n²ǬŽĊaš™ƒÛ°±kğmm»š@°ÝɆÛÅÇVaݍVm͔ğôÝÈb‚„@„ƒ™n¯š™ÜUĢÑĊ@źīżWŤÈǖWôŁÆI²ÓƨL@ŽĊX„mmÑÆ»ȰÑkƒĶō@ý°m—¯"],encodeOffsets:[[92656,48460]]}},{type:"Feature",id:"6531",properties:{name:"喀什地区",cp:[77.168,37.8534],childNum:13},geometry:{type:"Polygon",coordinates:["@@Č@°ƒĠ„ôÓô@Ŏĉ@Ƴĸ@Ť£ĢlVôWVóřXĉŤêÞ@ƐÒĢÑlèÈV@šĠIk°ÆŘ@ÈÈĀ@ǶťÒğ@š„@ÒĉlŻ_@šƧĖÅĬōÆ@bźÞnƒƒlVœÝĬšWƼʇ„ƒÝÅ@ÇÅÈwWóĉ±ğz‚ĬČƨƂÝIĉݯbÇÑĉƒ¯ʈV°xUŰĊ¤ƪ_ôÓɚI@lȚXȮ™ŎlɴȘ՘š„¦ɲÆʈ_ɴŽźŽôÞʊŎĠƒɆxˤ£ɄÑVwXƳ¯w›ɛŹ٧™çƧ¦ōƒُ͇еϻɃɳU™Ý¯@ōÝŹš™@݄»mğ™»ÝKkŁżřɅƅƒ¯ÆīĊ»ôVôĕÅUĉéV¹ƨém™anѱĕnwmwnÇۄyĉ¹ŹlŏkĵèķmōÞġKñÔċKÅèĉzƒŽ„ômxȗÿƿI@þÅČÝKÝ°@¼ÈVºš@ÅĢšÆUċłn„ÝÆǕČĵJm£ÝJ¦@ĊƒxV°ƏLċ¼ǩ™@™m@ÅĢómÇÆğ¹Çš™ÆšĖÞKšx„wô¦ÆÑÆL²ÆƾŽU„Ž±ŚÅŻĖ@ĬŤÈñ„@ǔÇx„Èǃ","@@VÇ™ţ°ğUĠ¯mk¯ó¥ķIġÿƏbƒ„ĉa±ÒĸĀlKU„_m»nwšŽ„m@ÈŤ¦ĉbÞ°±Þżł̦°ĢŁVé"],encodeOffsets:[[76624,39196],[81507,40877]]}},{type:"Feature",id:"6542",properties:{name:"塔城地区",cp:[86.6272,45.8514],childNum:7},geometry:{type:"Polygon",coordinates:["@@ήnĸ¥ʈ¼ĸ@ôϰÒ@ƅƒōUķƑǫʶпU֛܃LګK@΋ĸ@Æ£ÞġÅĠċšLV݄»™@Å»Ýnm¯š»nŻĊ@nķŃ@¯ómóÛÝǟ¯aÝóȭ¥ƒšōUmxĉbÇї@›bUº¯X¯ÆƧbVÒĉnǕw¯°ƑŽV„—ŽÇ@kx±Uƒšɱn™ŽÅKƒ„¯ƒĠǠU°ɜL@°ƒxnĬ‚ĀŋŎÇLƒŽğšϱÞέƜkôÅĀǕłƒĸĊŤUŰĢ°„¦ȂϰÜɨ°x@°żǠÆƈČVĠ»ČL°ÇšbĊÑ̐óÞlĶwބɆVÞwǬxǪţȼÜLŐĶˢ@","@@óKĵĀV͈ĉłƾNJÆŤƒzXl°ƒÆL²¼źŽôÈĢǔ™¦l„ô°ɜÞʊĠğŃm»ʵƳƑʝȗīV¥¯ĉ°Ñ@ŃÅI™»ĉmğn™ƒašƒċƨbš™Vğ—w›ġ¯@Uōa™ĉÝJğÑÆŎkŎÞĀlźƒ¦"],encodeOffsets:[[87593,48184],[86884,45760]]}},{type:"Feature",id:"6523",properties:{name:"昌吉回族自治州",cp:[89.6814,44.4507],childNum:7},geometry:{type:"MultiPolygon",coordinates:[["@@መL@È°ĊȂɆƒÆĊ£„ťôWÓɆbĢÅŎƒÆ¦ČÑW¥°ķU¯ƏŃVē±Ý@ó—ç˜ĭɃƾřÆķkwŹƒŤ¹ġ¥ĵKŏÅXmˍщwǓ¤Ƒ@wóōVķ£ɱšġôÛa±Òȁ„óèţIVŽƽ¼k¤ó¹ġJmx—»ÝUƒ²™@ÅƃĸǫŎ„ĊmŎǬ՘"],["@@Þô°bÞǠôÜôn@°ĸń˜Ƕkłƒ¼UޙKğȂÆÝĢŤķ@@ΌڬL܄K@ˣȂ˭lĉńW¥ĵVÆý@ŃÞēUŃȗƅ@ŹƩǕĉ»k»Ç™VğóřX™ŻKƏŽċêȁèÛŎġƒͩń"]],encodeOffsets:[[[90113,46080]],[[87638,44579]]]}},{type:"Feature",id:"6530",properties:{name:"克孜勒苏柯尔克孜自治州",cp:[74.6301,39.5233],childNum:4},geometry:{type:"Polygon",coordinates:["@@ˎǫĠƽ°UUĉ¯±ȁÑmƒ„¯Ýōˋō™wUű»ÅƑ°ƒȘ@²¯ɳʇ`ɱŃ¥՗™ɳȗōkȭšșW@kəJóÔƩ`ĉ£Vů¯wU°ʇĊ„ÈÒ°aĊÞÞJŁċƧīĠyĊ²XôÇxÈÆÆ@„ÞʈƒÅ»™XÞīU›Ƒkm„ŹÝ@aŎÅÆīƨĕ@™ż`Ċk@љƒĠ@ŦÑ@ǵÇÿ@ÇÅŗl¯ğJ@™ÇUkçġÒƏÑÝ@ţéWĊôŚUŽóXUġkţ¤ķ@@ƴōĊó@óÔğƒ¯„ċ@@Қ¤kôˣŰ͓„k»ƒKX¯ċwƧôğɐšÒôIVƙš¯UķǬķšnŽ™¼ôb°ÒȰVVÈÞ°ƒĸó¤V¼°„V°²êƒlĢ҂Uƨ¦ôȰƴĊVV¼ǖIċĊ„ÞɜéšnČW˸Ǹša„řÈw±īšçĸ¤ĊšôšwšŽĸUĢ¦˜éǖĬ„Āô¼lÞkÒ°x°ƆÞx„šÆV²ǔ»„b°wގȘ¥°n„šŎV@°„„ʠè‚ŰȂb"],encodeOffsets:[[80269,42396]]}},{type:"Feature",id:"6521",properties:{name:"吐鲁番地区",cp:[89.6375,42.4127],childNum:3},geometry:{type:"Polygon",coordinates:["@@ôK„ĉǪa²¼lÜô@ʠê°Ĭ™ôȂƒ²ÑÜbĢóɲ™ĸ¤ŎUô@xƒŽǔ£ъxˎmƒÈÛ@‚_nĕÞōšř„ǫƒğšůlȯ„¯ĸ»U»Ükôƛ°ůkť™»Ŏŗ@¯@±͓óͿ„Ǔ@ķȁ¼Ϳ@Ƒ¼¯°ólġ¯xȗUġšƑ™ǩÒƧUÝ°˹Kóššx@ǸōĬÅĬƑĠ󃄚ǔêÆ°XÒʟŤUšÇ¼ˋnn¼±V²°ȂUŌݜbʟǔɅô@żǬaҎÈ"],encodeOffsets:[[90248,44371]]}},{type:"Feature",id:"6540",properties:{name:"伊犁哈萨克自治州",cp:[82.5513,43.5498],childNum:10},geometry:{type:"MultiPolygon",coordinates:[["@@ĉ„ÆŘȁ̐mÞ¯ĀX°±¼@ƾ¯ƴ°ŎÝþŋ¦WÜÞbȂĉźUœÇmwVUȂóô@ȰÝ΀nÆJn™ƾ™ʠ™ŌLČóǪ¯œ¥ǔaǖšŌaôÝĢLšx„ƒÆLšɲm„™²VlwÈ@˜Uƒƒ°¯ǖxĊmUÑƨa°Å°WV¹œa›ÇɃÈm¥°¯ŹóĸķǫUm»Å¼ÇVɱ™l݃ŋnķÇÝX¯ƒͩÇɳa——Ý`±_U±ĵnWƒ™a@™ĸóšķ™¯ǓV±ÅĵJċ¹ɅykwDŽ¯£Åxʟ»ƒlķI¯ƒX¯ķ‚™êǕƒȭnķ»Ź`±„kÞ@Žš„Ýô@Þ°xšŤŎIƨÆUxōš¯²ǔĬǬlUŚ"],["@@ÞĀlźƒ¦¯ĸŤKޙšƒċƨbš™Vğ—w›ġ¯@ţƽJ"]],encodeOffsets:[[[82722,44337]],[[86817,45456]]]}},{type:"Feature",id:"6527",properties:{name:"博尔塔拉蒙古自治州",cp:[81.8481,44.6979],childNum:3},geometry:{type:"Polygon",coordinates:["@@ήƛϲÝĠ™„ÈKŌōÿmī„w@¯ɛKV¯ğǟ°Ƒ™wġKóÞŋbǕ™Ǔb›¦ǩ°ċôŋKʟšƽšmšÅImŽͿŽȯÞó@ȁôUVnx›ÈŹVȁĊÝabŻ£¯°l„óxȂŤĸkĊšÞyĊêĊmĢxV„ƨÈŽĠX„ŽΘÆĠÔź‚Ɇţ°LXƾŤŤb"],encodeOffsets:[[84555,46311]]}},{type:"Feature",id:"6501",properties:{name:"乌鲁木齐市",cp:[87.9236,43.5883],childNum:4},geometry:{type:"Polygon",coordinates:["@@šŽWŽôŚUĠȚl¼Ċ¼ƪǖ@źȘƆ@ýlܚXVŘޙš¦V¼kĖó҃èkĊȁˮ֜@ǫ՗nōƒĉǬō„ķÆŚ@„±ÞV˜¼nwĢIôºl£ƾ»UŤJôçšó¯īʟéó@kÛ±»ǩbƒĊóLҍÇǫb@ŻɆóʠǓ›aŋÞȁVʉłĉbĉɅô"],encodeOffsets:[[88887,44146]]}},{type:"Feature",id:"6502",properties:{name:"克拉玛依市",cp:[85.2869,45.5054],childNum:2},geometry:{type:"MultiPolygon",coordinates:[["@@ɜÞʊĊýVaŃm»ʵƳƑʝȗīV¥¯ĉ°Ñ@ŃÅI™»ĉmğn™ƒaݚţL°ķóKĵĀV͈ĉłƾNJÆŤƒzXl°ƒÆL²¼źŽôÈĢǔ™¦l„ô°"],["@@ƾIŤ@UUwōa™ĉÝJğÑÆŎkŎ"]],encodeOffsets:[[[87424,47245]],[[86817,45456]]]}},{type:"Feature",id:"659002",properties:{name:"阿拉尔市",cp:[81.2769,40.6549],childNum:1},geometry:{type:"Polygon",coordinates:["@@nIÇŃÛÝĊÑĠƏō™гwȁ¥Ƨ°ŹÑķV™¼ÞêĊ»‚lĵšm¦ÅW@ĀôÈźaɜxÈbÞÆĶIОŘ"],encodeOffsets:[[83824,41929]]}},{type:"Feature",id:"659003",properties:{name:"图木舒克市",cp:[79.1345,39.8749],childNum:1},geometry:{type:"Polygon",coordinates:["@@VéVÇ™ţ°ğUĠ¯mk¯ó¥ķIġÿƏbƒ„ĉa±ÒĸĀlKU„_m»nwšŽ„m@ÈŤ¦ĉbÞ°±Þżł̦°ĢŁ"],encodeOffsets:[[81496,40962]]}},{type:"Feature",id:"659004",properties:{name:"五家渠市",cp:[87.5391,44.3024],childNum:1},geometry:{type:"Polygon",coordinates:["@@„çôÑlĕU»™¥ÝšUŗ™WkÛ@þVńÝĔ@ńÅþĶUX¦Æƒ"],encodeOffsets:[[89674,45636]]}},{type:"Feature",id:"659001",properties:{name:"石河子市",cp:[86.0229,44.2914],childNum:1},geometry:{type:"Polygon",coordinates:["@@lŁ—ǵm‚ĉ@mż™¼n°ÞmƼš@"],encodeOffsets:[[88178,45529]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/xi_zang_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"5424",properties:{name:"那曲地区",cp:[88.1982,33.3215],childNum:10},geometry:{type:"Polygon",coordinates:["@@ƨʔĸbܺÞwnxźbÞ°ô@„ĶŽĸIȼĊJŎÈôUšÝƒ¤ǔLސŎ@ĢŽȘblƒôL„ÇźçȤôLš¥ÞIÞ¯Ķxʊťƨ™ƿÑĉXVķŦ¯ȂKÇǕšÑ¯IUš£¯Óƿ£VĕōÞÿÆwƒƑ„£ǖxÞĕ±ÇÝaUÑȃU¯‚UōÈ݃wWŁĵ™±Ý„óĢÿ°IÞ±mÅĢ¯mÿ„¥°UnÑŤĢĕĶwǬŻͪwŎ¼źÇĢ„ĠĕˎŁ°óƨ¼Èa‚m@¥°wǔ„ǖ°ŽƨÇŤœšġƨ„ŎŃôbÈÛŎĊ°@Ġw²ÑÞJƃÆb²ƒ°êĊUނlȲƒV„ÈKĊÒĸĉ›»ÅôťUÅǃk¯@ǂÑklǁÅl™Ģ™VÑóƒ@°@„ÛĸƒV¯ƒÇĊ™n¯Uĕšƽ¯m›¯b™È@Ò°Ĭƒbĵ›¼„‚kxķýÇJk£ÝaUÑÅóĶǟkÓʉnĉƒÝ¼Ƒ„ó»Þmn£m™Č¯@ƒȮÿV¯ĸƒ™k@Ýówƒ»ğ„ġ±ǓLō„ƒšV¼Əèķĉ™è±b@Òţ„UÑóakƒl£™Ó@¯L@™ÇlUóȁš¯aġÈÅĕÝLķ¯Ė¯@WĬ—x‚ÒÈnW°ţôU²ǓÓġ²V°¯ôƒǔÝL—ċšk™š»Ý»Ýš¯ÞƒVƒwۄÝÇōͩÈĉċ»ĉm¯£W¥ţKkóġƏW@¯±kōŽÈ›b@җšÇaƒÆ¯a™„ƒkóŽÛƒÇ¦Ýa¯šÝ™ĉ@ǻۄmƒǓxķƛ¯lVĀÅÞġb™™ÇJUÅV™ĖƑW™zō»ōšƒW™n@è¯ÞóVkwƩnkźÇބҙޯƒƒýğÇUxÆÈnè±bĉÝ»ÈуwšwÞ@m»ÈV@ýÇ°ķ™xƒa„ݯXċ¥ƒÈóW@ôkxlnxVÈóĊkŤġ¼@°¯ŰƑL̻۱ŎÝV—Þ›VƒÇÞŎÇakƞ‚š@èğŎĸżšƾ°ÒšLÞôĠKȰĖźVÈÒĠ„¤™VôšŽU„ÈþťL@ôǬÞlÜÈnÇÒUŚ™@šĊƨW°™°Xƒ‚@ČÇþ„ƴĉÒķ¦@ŽĢôWĀôłUÞĢǬ™ź°¼š@ƒôV°„bUÆnzm¤ƽĸƒÈ"],encodeOffsets:[[88133,36721]]}},{type:"Feature",id:"5425",properties:{name:"阿里地区",cp:[82.3645,32.7667],childNum:7},geometry:{type:"Polygon",coordinates:["@@„Çƾķn£myVŃaU¯„ó™@¯»šŹġǫVÝóŁXÿġó@ĸ¥ĊуƳÈý@ċ„Wš¯X¯ĉƧ‚™š@VřÈÑÇmkÛǫÝ@óŦKÇýVƒ™U󚏃£ğÇÑŹUȯĕğLÝó™K¯Ñ™ƽķŻĠō@灙lƝÈbƍÈ݂„œU˜ÝÞU²ō̼ůƒK°ů@¯UK±—ĊƧbōÇmçÈġƒóšÅób™™źóš¥kīƯól™ç™KôĵUƒÅ„VŃķ¥nÅŏm¯¹Å‚™»@ÑǍóxÝkʇȤU¤ķb@ƒ¯ĊÇx¯ĸĉKm°šĀk¦l„„KnĬȀƾÛ¦WÆŐmNJĉ°ōUţ¤UšŎ°šŎKÞłÆ„Ǔ¦ƒÞ™‚™„ř¯bmUÝl¯Um™ğl¯£șwŎǫaÝnĉĶƒk@¯™K™šō»ĉn™aÞ»ťnkml™ĸ¥UŚŻkÑťƒĉV™ôó°LôīĠU„ÿĉǕÅz±Kƒ¤„²ō¤¯Ė¯UÝ¥Vĵ™óÈťÝwķșÑk¤ó„™ƒWýĵĕ™„VĠƒV󍃎Ǔ„ķ°k±VU±ţ¦UǟÝřJVљ¥XUċUŎlÛƆǕÆȗƆ¯wŏÞÅ@™šĉl݁óŽƒÒ™nUôńlxólÝôێ±™™LÛôÝL@‚ġ¯X¯ÇUżóa󤛼XÒġŎóLk¦‚ôżĸĠ™¼™KġƆô¦„ÆƑÔĉĶ¯ImÒ°¦n°¯Þl˜ÝČn„ƒÒšKĠޚĕkƒlýƾťœšôI‚ĖŤÒnƜm¼¯lnżóÞ@Ůó¦™ôƽĖċŚn°Ý°ôÈUƜƒblÞóŽ@Žǖô°UÈƆ°X„þôŽô‚lѢšŽ²Ėm¦°š@¤™XŽĊblܚzkºƒĖmX„šŎWVšóÞn°lĠxȚa°»żLźƒ„b@Æ°XĠÝȚxĊĕŤaȚ‚°È@„„@èŤ¦Ü¼œW˜ÞkŽÈ@V°lŤkŎ±²¦ƐUšlj°aÈÑŎbĢƒŎbÆ¥ÞIȘlššôVÈU‚™šb„kɲĶn„mnXb̼òƾĖŎ@ĢȂÑôÓĠĖʊšĊÔ"],encodeOffsets:[[88133,36721]]}},{type:"Feature",id:"5423",properties:{name:"日喀则地区",cp:[86.2427,29.5093],childNum:18},geometry:{type:"Polygon",coordinates:["@@ĶĖXþš„ôƒl£šÒĸÇÞxÇŦšôUĶÞ¦°V°ĕŎ£ƒ±„£²LÆyĊǖƒĀğVóĬ¯KóôUš‚ĊŦ„lҙżVÆķ¦kšlnŦmݼšbĊmŎ¼š™šL@°„lĊĵÞmǬbƍȚx°¤Ġknš°VÞkVn°aƒŚš‚š„Ýǔ¥ÅƒÝŁōL¯™ōV™Ť£ŎVĊ¯nljƏXÅÜ¥ǿƽmīƒLkƒl¥™ÿn¯ĊL°ķÈw°ĉ@ƑĸaV£ʈȣÞlôwȎ@Қ¼Æ°ºŐnmÆĸ¦UńƃV„óĶšLšèôkÅ°lĬ™¦Źôššôa™Æ„ôÇĢnèŎÈƨa˜ĉ²‚VLĢ»lţôĉUǂwkmlw@óôX„ÇȦ°WƒÞ„b‚wĸšÈ¯@þÇUn¼Ý@™x„xÇńÞ¼ĊŽ²amçÅÇVwĠȄþ°„šÝƒÑÈÝlŹƪmlxôU°Ý@çšm„XŎ™Ŏ¼šyƒXšĕÆUVÈIššĢaÆÝUÿ°kĸƜǔwn„܃ȼĊ@ޚ°™Þbȥ܄ô„lšƒ°b„ÅÈb˜™@ќa‚ǯUU¯Vġš»ƒ™¯aV¯Ç°Å™mnÑŤçǬVǬ™±ĉ¯¥Vĕ¯Ýk£˜ō—w@±ġÛ°ÇVїƒ@ۘa@ČL™Ƴ™„ƒÇa¯¤ÝIĵ¼U¥ƿōķÅţŻókÝóĕ‚¥¯™U»Æ£X¯ġŃÛkÝ°V°ó¼¯èWôÞĖ„ȎƒŽkĀƧĀówm¥¯JŹÝJݙōVVŁaݐƑ@ƒ˜ğŭǂ¯_ƒ˜ĵ—›VnxŃón›ƒĵxÇĖĉVÝÈğV™Ò󃯐±Żĉ£ķÆÅL™Ljĉý˜ţۃ¯VƒnV¤ÝÈ@°ÅÞݤ™ŰğŁm¦ÝxóKƒ¥ɱÈUĠôêVôÛ¼ÇWÝçĵaō¦óĖƧlÇĢƑŽnŎDŽV¼¼‚ºÛ@m¦ƽ„ĉmm¯ÝKÛç¯bŏłĬ™bƒ¼ÅLmŽ„xť°ÅU™šÝXkŽÝmĉ¦W„¯K„ÒknÝaV„Ýè¯KɅńÝKnÞ¯¼"],encodeOffsets:[[84117,30927]]}},{type:"Feature",id:"5426",properties:{name:"林芝地区",cp:[95.4602,29.1138],childNum:7},geometry:{type:"Polygon",coordinates:["@@‚VÈłVôÈk@š°K@ŽšÔk¤l„ôbVÒŤƒ@ѲašçĸĊƐçU»„™ŎƒǔKĢ²Ġƒ„¼ôx@ޚlƨĬ„Ul¯ÈLV‚šÞJ„°Ünʊ„wÜbXê‚VÞ¯°ššanaU°wƼɴÑWÑ°mÈýÈam¥Þ£Ť@„¥ôblÞĢ„ź¥ôxÈÅmݚ™ƒĕŃV»ĉōŤōnóƒ»ÈīķIUƒĠÑ°ġĸLÞ¯VÒƂ@Ābš¼WôÈ@V¼ôóŤKÈÑU»šwVǫżnWÒÈx™¼‚lŦ£ĊōŤx²¯@ƒÆƒU¯šçÆ@„¤°£„é°k°lšůÈó@¯ŤÇÈĉƒkkÿó¥ÝXķљÜ@ÒóŚÝ¯°ĉówÇ±¦ÅJUÒĉĀķw¯°mĖ¯„±akxÝÅnƒ™»lуK@¯lU™¯UVѯóĊ¯mōğVǓƅƒÞƒWÝÈÛ@ƿô¯ÜġzÅþ¯ólmôʇġĊÅUͿřŏȁˋŁóÇˡōƧƒÇb™w°Ķôk¦šÒƒnUþġҙÔkǔķèó@ƒ²@ŘōńĵyƒzġaݤÅIƒ¤Ƀť¦ğѯ¤ķbóš¯ó±ŽU²°¤ČÜVnÈƂ„ŚŎ°ôĢ„þÆzèVĀǎĀǘƒXŹÑ¯¤ówċķk¦šłUÒġzÇ@ƒ™ÆÝx@²Þ@Ƥ„Uô¦Uš°x„U"],encodeOffsets:[[94737,30809]]}},{type:"Feature",id:"5421",properties:{name:"昌都地区",cp:[97.0203,30.7068],childNum:11},geometry:{type:"Polygon",coordinates:["@@™ŽVĖm°ĉš„ÈU°ķ„ƒÜ¯@@ô„UÒġškš‚ÆkÈlŽÒ@Èl°È„VÆóŦƂœ¼‚a„ÅĢ™Ʉwnōw@¥Ŏ¦°ŹÞmVš°wnÿƒw„wÝw@¯šmÞŗ°wĠ˜ĸkÞğlĔ²¦°@„ĕĸwVóšal@nĢÇĊn°@¦šŽźUXçǔůĸVš™ÆK„ÈÝĠš²ÅĔô@lšŽÈ_m˜„zǖl„šaU¼ôwV°¯¦‚ĬÈa„l@Čǎ„¼™„nŽ˜I„xô»ɜ@ƨ¥ɆŁ„ŃǪȁkƛƨȍʊȡóĭ›@—ÈÇVƒůރĸƅmēƨť™ÅÈʉVǵ°ġVŭÅɧ°ÿnɛš£mƒķ²ŃóÑUĉ°mÇ»¯@mxUĀ¯èţ°ȁÝç„ġU¯ÆÇţÈ@°Çô™Ű¯k¯lƒê¯¤ƒ£Å@™èV°Å„@„±°ţwĉŎť¤kš»ÇwXÑŻmUǬ™xV¼ÇÒţLóôU»Ç@X󙻂a@ÿŁUÑÝ°ķK¯ĢğÒV„ĸJÇĬ„¼môţŎĊŎU¼Æ„„Ė™šnÞÇÆówŹ¦ġƒkÝóaƒ¦ţ@ݤn¦ÇbÇþ¯nXÒɳÒÅ»¯xVmb™b¯™Ý°UWéÛaƒxʉÛmƒ¯ÝI™‚UÇKk°ƒVƧīķ„U°ȭĀ@„ċ°nšm¤Ýnô¼ƒƒÞ»Ċ„ʊmlÔĵǠÆôVÒÞbl¤ÈIĸþlwƒœ»ĶŽ„a¯ī@њǰanœƾ°"],encodeOffsets:[[97302,31917]]}},{type:"Feature",id:"5422",properties:{name:"山南地区",cp:[92.2083,28.3392],childNum:12},geometry:{type:"Polygon",coordinates:["@@°ÞUĖ°¦²ĊôÇÜLǖĀɜŽȘŰÞLĸźêÞ@UÜUŤ°ɞ¯Ü„°WŦĀmŎ„¦ĢyVљŁl¥Čĸôx°£źÒ„Wȗ‚ÿȍUÿ‚çÅyƒýóġō¯ƒřŁmÇÛUċŽ¯£V±²°ôô™ĸa°£ĠÒŦ¥ɄŽ„£ÆJÞ£Ģb„yĶzŎŃ@ŗ„±ô@ĸçlǓšÓĢÑVý„m™Ñl¥ĵó‚¯̻̥™ƛǫÝһÇƧĉyţ¼ҍēVĶĉŎ°ĸmšÞVÝĸ™ÒÛaċ„ó™ŹĖƒèÈÈl¼k¤ÝX@`ސŏ¼Æō¼ÇçĉKUÝÝ£ğ¤@¦ġl¯Òġĉ¯óš™móxÝÞğVšƴċK@—b@ܘ„UÒ¯ÈĢÜ@²˜x—Ŏl¤"],encodeOffsets:[[92363,29672]]}},{type:"Feature",id:"5401",properties:{name:"拉萨市",cp:[91.1865,30.1465],childNum:8},geometry:{type:"Polygon",coordinates:["@@Ŏ²l@°‚XĢƐlôŤLX¦°¤ĊnČ¼ÇĊŎͪÞÈ܃„x„U°Ýޙ޼™¼lšČ™˜ŽÞK„Ǔ°óU¯Ģ±ǔÔV±ŤóX¯ÇmÑ˜wXī°@°ĕĸÞKÆĖĢÇ°bȂ™ÇŁUƒV¯wV™ó¥ƒVÅ£Ý@@±ÞwšÅ‚„È@ƒ¥nōťÿ¯Xۃɝ°ţ¯ÛVVÝ@ŹéķÝKȗůɛǕÿÛKóÈǫšǫUţèmҚn¯Æ°ÈU‚°b„š™¼UĢV°°V"],encodeOffsets:[[92059,30696]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/yun_nan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"5308",properties:{name:"普洱市",cp:[100.7446,23.4229],childNum:10},geometry:{type:"Polygon",coordinates:["@@U‚ô²‚a@Ž²²Ķ¥œV°šĶ²bl¤kVxl‚@œ°‚Ś²@˜„„y„@ô¦¯„@xƒxVxU„VššbVšÜm¼Ŏ„„ĢmºXXWÆ@ĀœšmŽmXU°ÅÒm¼Þx°w„@°‚XêĠ°»nV°U„l@k„@V±ôī@£‚ƒČŃÆ£„KÞý@¥‚k@y„a@—nWV„UVƒšwƒmƒ£Jƒknm@wmkn‚X„˜šX„¥mUUlUnbš¯°ŽnkƒVInlIUw°n™mk@@mlanXlanmšk@wVWUw™_@éĠašnmUaÜ£ƒmXƒ¥¯@@„óUmݯ¯ÞÝlKnxô£š»„»Ġ„J°aV„UÝÿV¥ÛbƒI@wmŽón¯yÛL@ƒWkŎmș`IWa¯K@¯mUnmaXm™bmak„¯ŽƒĢ™ÒÝm¯mV¯KÇb¯KۜWW™X@a™V™knċLUWV™kXóW@k™a@ƒób¯Uƒwmb¥UUlaU¥U£maķšƒKXkƒmÝ@kwmѯk±ċbUUVakaġ¦ƒƒkL@`ƒœ™a¯xƒm™Åƒ™LUWƒ@ċnŎUV°LkL@b°°@¤š²ƒ‚šnôôk„l°kè›ÒÈzV¤È„WôôƒnV@„ƒ¦@¼Ux"],encodeOffsets:[[101903,23637]]}},{type:"Feature",id:"5325",properties:{name:"红河哈尼族彝族自治州",cp:[103.0408,23.6041],childNum:13},geometry:{type:"Polygon",coordinates:["@@°°nÞôV@ƒ°@„¦WŽ„nÛ¤Vbmn™ğb@êš`VxUX@xš„ƏÞUnn˜WÞĸĢƒšÈ@ŽÇè@zÛÜWšÅêlš²„˜KnV¯ĖĊx@bk@@„°JÆ£Èbl„nnm°nlUkVUUwVm„Kn„‚nVŽÞxVLX¥laX@@xl@VzȎVmšk@b°šÈĸmŽV¦`W„XšƒbUb‚bX¼°x@ašVVkn@lþnXUlVxŤÅ„y‚IUƒka‚IŎĊ@lXx@b„z@‚ô„ƒ¥„_V@l‚n@„ôy@al_l`nmƒÈ»@kƒmXwWK™U¯»™a™Å@wƒmUÝKUa™UUƒ™wWƒ@w²»@kƃV£—mm£VKkÑV@@»nwƒ¥™ƒ@kƙnllIVlnLVakalknJšWmnaUaVÑVVލn¥m@ƒ„¯Uÿl™@™™™VçƒaXaV¯UyVLVkš@nJlšXLlŽkxlbla²Òl@nVJVkšx„KlkUaVķÝÑU@Åm¯@±™Uó°ğńķĠmU™Ñ@ǯ¯Å¼@nml@°¯¯`@w™£@¯Çƒk@ƒ»nmċ¯U»™I™Ž¯LÇĶÛn@bó°™U›šwmŽ¯„™Umǯa„™ƒ™ƒI@ykIƒVUŽ¯bƒIğŽƒ¼™¼ó¤mwkLÝÞ"],encodeOffsets:[[104243,23429]]}},{type:"Feature",id:"5326",properties:{name:"文山壮族苗族自治州",cp:[104.8865,23.5712],childNum:8},geometry:{type:"Polygon",coordinates:["@@šwô„š@²¯maUmôUÆxš@Xš˜bÞInlVUVw„JVaU„K°¥„xmÞXnlKlnna°@ĊČ„ÆwUmnkl@°ƒƒ£nyn@VV@Vak™ƒ@@kÞ݄bmx°Vnw°klÞInĖÞVlKl™@Xa°„„KlV„U@šJnx‚U@ÈĢbUKlm@ak_‚wšanWUk°ƒl»„k@Wk@lwU_ƒ@UalóU¥ƒÇnƒ™kJWƒ@mVXx±bƒK@nV±a@™Åa™£ÝK²ƒWknamKknǏk¯ƒaV™™V¯ĀƒU™„™Ò¥ƒI@mm¯¯xōW@@`k@ó»ƒUU¯lm£ÅWlĵ„w@mmwÅmWU@y±U—xmwU„¯Uƒ¥Ý¥¯£m@kŽÇVUV°VbklƒL™wUlUIm‚k@±ÑkbkalwkWKk™mI™@UlUKVzU°Wb„bU蚚@škšVĀƒ°@„n‚m¦ÝŽUUUÒVbmbXn™‚mIkllbUbmKUkkJmkŚ@lš„„¦mx@¼U@lÒULn¤˜nU¤Å„@l±¼@xX„šxV„šVVbÞLVŽ„n@xšÆšb°¼šV"],encodeOffsets:[[106504,25037]]}},{type:"Feature",id:"5303",properties:{name:"曲靖市",cp:[103.9417,25.7025],childNum:9},geometry:{type:"Polygon",coordinates:["@@ȦlKÞĕUV¯Um¯„ÇVUnVVUƒĉn™ĊÇƾLn°°È„JÆw„@lbÞa„¦V„XJ°¯W¯„aÞJVkUša„ƒ@lKnÅmWUk¯a¯»@m±@уkkbWWX_WÓU»_l™kÑm@U»m@l@IWċn¯l@VanV„UV™UVwVx„KȄVmUē‚@„ƒn@VÝÆL„w„VVwnVlmkUVÑÇ°ka@k™ÿÝaÞUl£™›—ċĕX±±ĉƒa@UnVnalónk@wl™UVmkÝJ—aW™™@ÅwóVVnnb±°™@óƒ™xXLWx„n@lǼn„m‚k_k`@bózƒ‚m@kU@ƒ`„¦óƒ@nWš@ÜÅXWw@ƒyƒb¦@ÒlnUb@x™lܐk‚@²Ç@Uƒ¯bmy@kV@bƒb„¦U`lLVx@b—Ll¼Þ¤@„°VVބU@WސUb›J@nnš@lnnm„šxUŽƒUUbƒK@šÇwklkUƒVWakn@ŽlbU@@„ULVxkKUn‚°¯Ò@¼™„kmƒ¦m@kl™Ȱ@lU„l¦„@Vl°wšnnþĊUÆbUx™b„ŽV„šĖU°„a‚nnašV„al@@b"],encodeOffsets:[[106099,27653]]}},{type:"Feature",id:"5323",properties:{name:"楚雄彝族自治州",cp:[101.6016,25.3619],childNum:10},geometry:{type:"Polygon",coordinates:["@@mҁXU`Wnšš™@Xl±¦š„Uxnbl°knmKUx„„ƒxVôUx°¼ôÒȄ°JlnÞKĠœW°¦ƒ„Vx²JVwš_°¥@UV@@wnymknK¯I@‚™²b°ƒš£V¥šwU‚V„¤nLškÆJÈwôô°„l»Č¯ƒġVƒUU@@ƒ°ƒƒÝXl@U»°Å„@U„¯@w±¯VmUUlm@m™„ÑnIVyUwmak£Vwm±—@Çw@nƒ@UxkwlÇnL‚mkř@±Žk™ka@kóJV¯Ç»U£lw¯™Xalbl¥¯UXƒ@a˜™UaÈL@ÇVIVƒkaU¯mm™akLWkUJ¯Umxnšƒ@ƒkUx¯xƒ„mWÅīÝkkbƒŤƒbkxWmXwWk¯wƒKkƒƒLŤċń„@¤óĬU²ƒ@@lƒk¯VmU¯¼@xV@k°l°kbUš°nm‚VnUš@°„š„UVèރÆbUÒÞnU¦›V—¼lô„@Vl"],encodeOffsets:[[103433,26196]]}},{type:"Feature",id:"5329",properties:{name:"大理白族自治州",cp:[99.9536,25.6805],childNum:12},geometry:{type:"Polygon",coordinates:["@@lbœKVIUa˜@²m@b™xôÒÜxXLmbnšl@š„„K°šš¼k„Uô‚xôlV¦nJ„Uš™Ænšm„@šx„ÆwšbXšÆôô„LUVwôK@wlmšaVwœ@WknmƒIUmlnJla@_™@kÝmKUašÑm¯Xw°aUaVl»²JV„bÆJkôĶĀ²VVk„mšbVwUó„wƒƒVwnLlmk¯maVw™ƒ²¥Wkš@™™XmV_‚WnÑUkƒ@k󘻜UV¥ÝmVÑÅa݄UçƒVƒ™@¯V™Umn¯mV™lak¯l¯U@@wğŽW鯁ƒ@¯xÝw¯š¯Jċa¯U¥mLU¤„bÞȤƒbÇLWUwmIUVW¼kbš`U„Vb¯L±ĊÛkƒÿÝKkwƒKţê™UĉþƒÈƒV¯ÞVbUŽ°KVšk²Ý‚mI—ƒmV@kƒm™UkšVxm„¯KXÈķJU¦V°ULWxšL@môƒšb@bkx±LnVUŽVLnkÜWnwlLŃmW@kkJU_ƒV„šWĊ„Þ"],encodeOffsets:[[101408,26770]]}},{type:"Feature",id:"5309",properties:{name:"临沧市",cp:[99.613,24.0546],childNum:8},geometry:{type:"Polygon",coordinates:["@@‚xĢ„l`²X°ŽV„šx@x°Þ°KXašğUњW‚bnIl`X²°b„xl°„„šV@xVxk¦mb„l@xšXV‚ÆzX¤™Æ˜k°„kx@lźêlaX»VUnJVx‚XÈK„aÝȣƒaV£nKV¦°‚Čb°I°™n»ÆÑV¯nWn›™@ÿXÅWWn¹ƒġōƒn»‚ÛU™™aU™VƒUw„w@w°ƒó¥ƒ@ƒz—ƒ±@ř›¯@kUwlk£±aĵŽ¯™›Uĵ¦±±@bó±VÝ@ó¤ƒw¯I@mńóm±XŽ¯IólƒK@š°Ullb™zkKlln@@ԙºƒUmVk²ôҙx™ŎUVóLƒb„ŽmÈnŽmbnl‚a„x@z„@Ǝ„¦kš"],encodeOffsets:[[101251,24734]]}},{type:"Feature",id:"5334",properties:{name:"迪庆藏族自治州",cp:[99.4592,27.9327],childNum:3},geometry:{type:"Polygon",coordinates:["@@W™Xwƒ™@akk@y›—k°īX¥›Uóķ¯w@n»UaVaUۃ¯ƒmV¼k‚™Þċô@n¯xÛÒm„V‚¯Ô@xƒ‚@šk™wm™Åa@ƒUa‚݁¯VŃyV„a@ÿšn»ÝVmank™mmÞÅôƒ@n£±›ğzÇmU¦™Vm„nÜmbn@°nV@xmzÅ@mºV¦k°ln¤š¼õô„n@xkƃIUxUš@Ťƒ¦VšmVkmkXW¤XzVx@ƚx™¼ƒÞ¯b@lVš™ĸގV„m¼XŽm¦V„ŽÞ@Ǝš¹Vón¥ÆKn„‚KX¯x@èĊȱłXšaÆxnlV@UÛlȻkğV¥„m²ljmÅÞĕƒƛm°„ÆmX¤mznƃŽV¦ÞVVb°bnÞWbnŽ°l@V„È@„‚VĵĊ±@ó„InxÆw„¥@£Þ›W¯ĸ£UƒUK‚ƒk±akkkbmWmÈķ„aÆÇU—ȃÆW@wmknmU¯"],encodeOffsets:[[102702,28401]]}},{type:"Feature",id:"5306",properties:{name:"昭通市",cp:[104.0955,27.6031],childNum:11},geometry:{type:"Polygon",coordinates:["@@mƒnK@wmƒUř¥mšóXǓŏmX@Ž—VƒmL@xţ™nk@mlUšŻÒğŋ@ƒL@mmLkm™š@b™XŎW¼ka¯lÇŹ¯aÇ»™ÝÝ_@m„@@a™@UklwUm@ak@ƒb™UmbmƒbV¯™ĕUƒƒšaVwÅaĉVmý™m¯xUkƒ@k¥VƒUXƒ¤VÈm`@„—ńÇÜ@Ākn‚ĔkƞÆĠ„™Þš‚U„VôƆÞI@ŽUxƦn„l@ĊĊnxUÒ°¦Vb¯WUnWŽIml@xn„Ubô¤‚¼ÈxlI„»šKVš„@ÈԂJkšUĖ±ÆVb@nœ„VÜVUVƒšL„wĠl„kn„Ġ@nx°¥Æ„²mUwƒ@m™mÅUl¯UњÑUm„Lll„Il±š@VkwƒW@w°@U»™kUóI°ƒ„»ĢтL„™š`nUĠ²lm„bôV@n„JUxƦX¦l@š‚ŎUƒV„@lV„KVřV£UaÞU™ƒnW@¯VU@ó™"],encodeOffsets:[[107787,28244]]}},{type:"Feature",id:"5301",properties:{name:"昆明市",cp:[102.9199,25.4663],childNum:11},geometry:{type:"Polygon",coordinates:["@@n@Vk‚VUn²°@xƒ°Vƒ@¯ÆV¼k@WŽ„Þ¯„@„@‚VVU„„Ģċ°k¼V„Ċxœ¤Ōœx°mVkƒÑȏšL‚°„x°Xœ°VmĊLVxUĖ°bX¦VW@kšȯlkn@„¥lnšƒ@»°Ñ¯VmlLUwVK@ƒV@ka@lmXb„UlVlkÈx@™„LVa„VV™wnƒmm@km™@mœIVaݏ@XƒVUݯU@ƒÝ£k»˜K@aUwkKV_ƒ¥„a@alU@nz°aV„È@@±lÛšk@wVakm@т¥„a„z‚@XxÆW@ÛX™@m@ƒy@aWw@kōĉJlbV„JƒzţÆUwVkmWkým@Ul™U@b¯wVºƒU™VUêšĠƒXUaUbVĊUŽWXUmkK™™WnUUU™V™ƒƒVV™Ý@kk±‚™¯ƒƒLkƒš±WkXlVklƒ@ƒwXbmLƒ›VUIVmk@Ubma@kkaVKUƒ™kmlXLWn™J¯ÒĊ°@zkºlLUŤn@@n›ô@lƁnmKkÈlxVw„@@mÈx˜@n²Uxl¤nbVxUzmJƒÒnš"],encodeOffsets:[[104828,25999]]}},{type:"Feature",id:"5307",properties:{name:"丽江市",cp:[100.448,26.955],childNum:5},geometry:{type:"Polygon",coordinates:["@@l@™„@w°ÓUnƒÜÑ°w@mČóšÝlU»n°„„VÜUbVbm¼@Ž°xôĸœVW¦¯Ĭlœ˜@zll@b„šWxXš‚a„X@ÆĠÆaXwl@XaƦn¼˜Jn@mnKW¯È»V¯°ak™VanXVwl@VyUĕVU„bÈīlaUk°ƒk¯lƒ²V˜Ukƛô@ƒ„I@mVwĊa„™ƒVaka„™ÆbUŽVLšaXIWKUw™ƒ„aWÑÅKUaVk°ƒ@Uw„ƒ¯¥›XğÝLkm¯Iǃóѯ»™aƒnUl±UĵÿlóÅIƒaU‚±Ik¼UŽVb¯bWxn°™ÒVbnLlޚ@@`kbmIkŽVn„JmnXl›@Ux™bkn@xóLUxVŽƒKóóŐW™™aÅxƒŽ™wƒ@™nÅm™šƒV™„ƒôX„ƒLlVU¤ƒb¦m¼™Ž@ĀƒbU‚„zUƂ°ÞVb@„Æbnššx"],encodeOffsets:[[101937,28227]]}},{type:"Feature",id:"5328",properties:{name:"西双版纳傣族自治州",cp:[100.8984,21.8628],childNum:3},geometry:{type:"Polygon",coordinates:["@@l²°ŽnÒlxÞ@„nWl„Lĸ™nbV¤V¦kbVV‚¦na„x°Vôa@„šb@lôXlWUšVXČKlmššU@bšWXXܛ°LÈa°LnU°‚ÞnšÑ„ġ°lƒnbšaƒ¯¯KWƒœó@kmK@UšĉV@k°„VV¹„a@y‚_ċl_nÓlL@anI@ƒóWl£VU—ƒl™kĕl™šKVw„U@™kVƒam¯ÅL@bƒ‚Ýk@Vn„UbÇbÝwÅ@ċ¥¯lk‚¼ÅŽ™Ò°b@¦nlUn@ŽÇV„mƁbWôU@ÝÅōm™¯ƒaU™™mk™WWw—@±ƒ™n¯U™è™a™Lƒ¯mƒL™škwƒl@°mnÈÒ¯šów@V™xƒĀU¤°Įƒ°Xl"],encodeOffsets:[[102376,22579]]}},{type:"Feature",id:"5305",properties:{name:"保山市",cp:[99.0637,24.9884],childNum:5},geometry:{type:"Polygon",coordinates:["@@X°„Il‚@¦ƒŽÈ¼m¼ÞaÞÅl„ÈxV¼šlVôÈÆlLޣȺlkUƒ‚ƒUw„¯UĕVwĊ@n¦mlnVĸIWÇ°LnƒUwl™šV„n@lnU˜„nJށl±U™¯LVUa°Ý„U„ÇĊýšVŤé„LlxÞL„ĀÜl²ĉ°KUaVƒ™_Źé@klw¯ƒlÅ—šW£ÅyU™W@wƒknal¥Uw@w™Uƒƒk¯ƒw¯aW±k_mJa™XVҙĠWb¯L¯Ý@w™wUƒ¯±Wk_ġƒwƒwōKmb@¤„bk°lĖƒô„UJƒšVnÅlťUš¯°VbnbWxX„m„ÞššWUĀ™L™yWzÛKmbUxVKkn݃kŽVšĀċ¤Ux„@Ž¯Žm@ƒ¦"],encodeOffsets:[[100440,25943]]}},{type:"Feature",id:"5304",properties:{name:"玉溪市",cp:[101.9312,23.8898],childNum:9},geometry:{type:"Polygon",coordinates:["@@l„„L°xXlWxXnlw„a„ţlaÞlÆĬnX„ƒ°wVw„l„@m™nw°VVIXllKšbnnV°lbU„UJ@ÈÇKVb—š@bW„°Vk¦kaWb°škxV¤È¼U°ôI@llblš²š@‚@œó@mm@VţkKl¹@yĉ¯°ÑšIXmWKnkšlV„ULlb@lnbVal@UnVJœU‚„nKWa„x„@lkkUlW²X„™‚l„K°„šl²@lšÞUŽ„U‚„UšVšVVXmššlLVnXWVUĉVaVb„W™ğVéšU„VU¹W»aVa„aW™Xƒ‚_U¥nÇķ¯™@a™lUnǍUyk@@wW@kbW¦UKÝwUmmƒƒLUnVxUVVlk¯mmnƒmkÇaŤ¯I@ƒl@@aĉw°ĕmU—L±ƒk™ÆéX™ÜÛ@yÈç@™Çġ„Ýķ—XmmÝVՙƒ™lmnkbmWkb@nl@nŽmš¯VxkJmUJ„ml¯™°makVVnVƒ¦™Wƒ—Wmnl@xmn„l‚I„¤„n™xU„ƒVUŽmX@˜ƒb@zl@¦Ýþ"],encodeOffsets:[[103703,24874]]}},{type:"Feature",id:"5333",properties:{name:"怒江傈僳族自治州",cp:[99.1516,26.5594],childNum:4},geometry:{type:"Polygon",coordinates:["@@WyX£lWlnnUU™„¥@ţV™Vw„JlÅ@wƒmö󙻂£kml¯U¥n¹Æ@ny@wmU@¯mnamÛnƒšUV¥ÈnĠy²œm¤„@ÆónݚnmlnbÞU‚¥„aV£kU„KWƒ„óšƒmIU¥ókwVólƒ™»¯™ƒL™ƒk@m™naWKÛwóњw@a±n—@VbUJ›LkaƒÝXĉƒ™„UV`lI@lnXÆƑkKmxÛXmlUKVmU²Klw@a™aó„@n™KXwVKU¯V¥mUnkm¥ĉ@UxVĖƒ°Vx„V„klmޙkKWĀkVWšnl°Lnm@°ŽUxlV@nk¦™JVÈ°ŽVÒ@nX°@ÆlUômlnôƒ²nxmłnVV„¯x@Èm°XblVUšl°@xkXU¤WXX‚W„Xƃ„mkÅJmށw±bƒxUīkKmÅVUĖÝèV„kx@š›lX„lnk¤ƒLkŽ‚Ėk¦‚xUššL°‚¯Ė@LnK@b°xVI„¥Ua°Ñ@»nm@¹‚KŎÞÈWln²n"],encodeOffsets:[[101071,28891]]}},{type:"Feature",id:"5331",properties:{name:"德宏傣族景颇族自治州",cp:[98.1299,24.5874],childNum:5},geometry:{type:"Polygon",coordinates:["@@„¥n@°@ƒVwČ£™ÿUlÞ„lmULVwnaÜLXyšzšKVÿ™XݙnƒWƒXwmaUa°¯V™ŦŽÆkUm„™VIƒ„ókĕl¯ƒa@£nama™@¯m¯œó@óyţbġkÅm±ÛammVkƒLwU`Wk@VƒkUmŃlUUKmbkkUVUwƒ¦óŽ°¼šbn°ô¦lºƒz@xšŽ¯„™@UŽ°nƒšU¤ţU„°VƆ@ÈmlnzÞl°¦Æa„xUxƒLkxWƒn@‚š²ŰšW„™‚@°ÈXl°Llx"],encodeOffsets:[[100440,25943]]}}],UTF8Encoding:!0}}),r("echarts/util/mapData/geoJson/zhe_jiang_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3311",properties:{name:"丽水市",cp:[119.5642,28.1854],childNum:9},geometry:{type:"Polygon",coordinates:["@@@V‚bVl@Xn‚UXƒKVŽ@¦nxlUXV‚n„KVmnL‚UV@bn¤lLXK˜²„`nnlJXIVJ‚I„Vnn°KnnVll@VLXWV@UkVaVK„zV@„ƒšVVaUK@U»VUl@@WnUUƒ@wVLn@Vwl@XW°LVbn@VU‚@X„l`@XnKVbkl@XVJlUnlV„„xlL@lnXl„@VšUnV°°„@a„UVLXblWVXn@VVUV@Lš¤VLV„U‚VbnalLUUVX_laVa„WVzXKV@@a@KUmImmXama@kU@yVIUK‚aVa@kXK@aWU@VIUmW@kkVm„Uš@VwUa@K@k@Uƒ`@kUKVk@UV@VaUm²Vy@klUUWUkVmUa@_ƒKVaXa›XmƒU@mUlWkaUXƒ@mmkL@w™JƒnVVÅbWKXa™@@I@aƒJUUÇ@V„UL™W@akLmb@K@a™XXw@mƒVmUVkUy@£@aU@@VkUWm@kUKƒXUWU_mW@wkkmJUUkLWWUXƒW@IkJ@k@mW_kӃ_Ul™Lƒm@I@aUa¯m@kƒa¯LUJƒ@mVVxUb™a@LUKkXƒbm@Uak@@a@Um`ƒIUbUJ@nUVW@@LnVV@lšUbVlUX@`š@blXklW„Ušm„Xlm¦U@@V¯bml@š@nUb@llnn@VbX@lV@ŽUVULmU@JVn„bVbkb™VWxU@@nUVk@"],encodeOffsets:[[121546,28992]]}},{type:"Feature",id:"3301",properties:{name:"杭州市",cp:[119.5313,29.8773],childNum:6},geometry:{type:"Polygon",coordinates:["@@X@l„°KXXlW„b@²„`šššb‚I„šX`l@„@bWl@n@VnLUV@V„@°¦@šl@XVlU@š@xVbUb@Vkb@‚@XVJVz™J@Lޚ@VmLUxUJ@LU„Vx‚b„xXUl@VaÈw„b‚aÞa@Vl@XUVx@V@V„LlbnV„al@lb„Vnn‚LnKnL@VlbVJXalIšb@KUU@mVInJ˜„U„Vl@xUšVLnUš@UÞaV@lkV@UanK„L@UlKVUnbÆmn@@nUlVnVJl@@UXU„L@WVIVJVxVLXV@IÜKnbn@V¥V@@I@ƒƒ„y°b@UUwnk°ÆƨVlUšçXm›£aƒÇ™IkVƒ@WV@@aWIUWUIkb@WW@UnƒK@UU@kaWVkƒVIVVnU@UWVUV@VmVkKkWIkVWaULU`UImJUImm—U@ƒƒwmwUV™IUWVkUamaU@mV—kƒb@KVU@aVU@anKULVJ‚U@kÛU™JUV›kkƒVakU@ƒaVwkW@UWkXmWaULUaUK@XƒJUUmƒVU@UVƒUkJ@ImwmKU@k„@lU„W@@akKm„kamIkWl_UwVm@UkaVUUaƒ@UamakbWlkL@aUalU@mkL@U@U™lmK@XkKm@Ýakb@xƒnXbƒ`ƒnUUU@›™U@™wU@@ƒmKkkƒV¯U@lULUbVbUb@V‚a@L™ºÝb@bLmK™x@VUL@bk@mxULWl"],encodeOffsets:[[121185,30184]]}},{type:"Feature",id:"3303",properties:{name:"温州市",cp:[120.498,27.8119],childNum:9},geometry:{type:"Polygon",coordinates:["@@ll@xnXV`VX„WVL@lXnlV@UV@@b@¤VzUlnV„U@nWxšW@b@LnalK@bšXVKUƒÈ@VV„I@b@Jš@WbXLÆaUU„mšI@xlKnn„@VWlbkXV‚@n„VWnœ‚WbUb„L@`VbUnVlVXkV@lUz±‚VnUbU@@VUlVL@l„_@V@l@LVbV@XLV`VÈlxn@lU@aœaVV‚k„@XJ@nl@@LU`°LVb„L°a@a„UVy@anI@a„a‚nV@²wÜJX@VšVV°k„na@WVk„aWwU@m@™ƒkƒaUĕ™ÝšÝŤnÈa„aóI›»@±X™WkUķ@kV±kw™ƒUkWw„™UƒÝ»ÛkɳlImaUaWóXÿǬk‚UnWVmmk™KţnŏÞğl™„UlUx@XWb„V@JkXƒ°mb@VULVxUVk@@LWWk@WIkšƒUkJmUkVmI@yƒ@Ua™kLm‚U@mUUUkaVk™@mK@UlUU@UmKmbUUUJ@n@KVLUL@VkJWXX`mnULWlkL@JVLVb@°kxkU@LVŽ™V@„VLV`UL@VUX"],encodeOffsets:[[122502,28334]]}},{type:"Feature",id:"3302",properties:{name:"宁波市",cp:[121.5967,29.6466],childNum:6},geometry:{type:"Polygon",coordinates:["@@Ċ¦ĸĀ°‚nXÞVšKškƨƑźÿ°»n„@wô¥ÜbœU°ÆXÞWóçĉݱIUƒÈ¥@U°wÆ»²mm_@aXƒVKÞVlk@akk›̅@£X»VwƏXWa¯aȗb™KƽۃĊ™xƒLóŽk@ƒƒƒ@¯nƒKUL@xkL›ÑkWULUUmJUXVŽU@mŽUX¯@V`mbXbV@@nn¤WXšx@škJ@nVVUVl²UbÝVUVk@Wx@V@„ƒVXzmlaƒL@VlLU`„XUVVVUnl@VbnJlnUVVnƒlUKkbmnn„VxlJnxmbU@UL@KUV™X@xmb@lk@mnVVUš™è"],encodeOffsets:[[123784,30977]]}},{type:"Feature",id:"3309",properties:{name:"舟山市",cp:[122.2559,30.2234],childNum:3},geometry:{type:"Polygon",coordinates:["@@l΢ƒʠþÆVĢLĊƒǬXĊ܄XôV„ÑÆw„ƒlšƏÈóVĭVǓ@ƒĉwɛkmK@ĉXīWaĉUĵÝmƒ¯ĉƒwĉ±±nż¯x@VǦV„²JĊÞôèÝXÅW¯›VÛaó¦@xƒŽmŽ¯¼ŹĀ"],encodeOffsets:[[124437,30983]]}},{type:"Feature",id:"3310",properties:{name:"台州市",cp:[121.1353,28.6688],childNum:7},geometry:{type:"Polygon",coordinates:["@@lV„IVWVz@bXJl@Xal@°„nLll@nVxnV„K@UJVbƒ¦°„k`UIWJXnƚ@bUJ„Xl@lb„Wn@UzVV@bVVšmVnnJVXna‚bšKUKnUVVUnVLlKVLXa„Jm£@mU@WanaU_°@VWnV@UVWnIVVVKlXœÒlK@wVK„L°m„@„„l@ô„Kšw„ĉƾůUƒl£@»UƒVk„m@ƅUƒƒaÛIŏmUk@m„w@a™£ƒWk@ţšƒIm±@ankôUlaU™Uw¯ƒōaƒbÇbţm™ÞšÞVĖ„b„l@š@n‚VXxƒbUl@XmbƒŽ¯lUUU™W@ÛI±xU@mƒb@bmJ@bUzƒV@b¯bƒKUa¯KV_@Kk@@mWIƒ@lUU›b@bkVm@kwUÇU_WKU@Ux™@ƒVUnllX@Vn‚J@UXV@bWL@lUbbVLUJ@z‚V@lnbWbnnnJVŽ@L"],encodeOffsets:[[123312,29526]]}},{type:"Feature",id:"3307",properties:{name:"金华市",cp:[120.0037,29.1028],childNum:8},geometry:{type:"Polygon",coordinates:["@@nbVb„@VbUVlb@VUnVxk`lXnJlbnƒlL@bX@Vƒ@klƒV@nLnx@JlI„V‚U@VUVn„VV„I@WVLVbVKXbWnXl@VlXUx„b@ŽlVUbl„œlVUšIÜVnalKX@@bV@@aUUlUƒwUw„@naWW„UVaUUšaVb„LlxXJVk°ƒUƒlkU¥@k„a@LVlXLVlšVWznVn@lxšJl_@WX_@mVa„a@alU@kVVna„KVLlK„b@UUaVašbnUWmXU@k@yVI@ařWmXIVJl_¯ƒ„¥UaVI@ƒLmUUw@mkkmK¯ƒk@Wbk@WI@aUyUXƒJkU@bU@WLUyƒXUbkbW`UVVkKmbUaVUƒUK™£@KVUUUm@UWkXWaUKƒV@b¯ƒ¯mU™V@UkƒmW@kkKƒwUƒmkkVUI@WlkUamL@Wk_Wƒ@UVm@Ua¯KWXk@Uxm@UK@xV„mV@Xk@UVV¼@‚VLUb™Uƒ„U@ƒyULUbVlU@@XlVUVVbƒU@lXXVW@XUVl@@VUVƒÈn@VVU„@lVa@„U„mL@`X@`WL@VUX@lUL@xlx"],encodeOffsets:[[122119,29948]]}},{type:"Feature",id:"3308",properties:{name:"衢州市",cp:[118.6853,28.8666],childNum:5},geometry:{type:"Polygon",coordinates:["@@XkVKnwl@@aVK@UšwnL‚K@aÞaš¹@Kb@UVaUaVaVK@k°V„UllnL@„V@šxV@œšV@VV„m„_Wa„m@wlaÞbn@lL@WnLšk@V@VlK@nkVVb@blKXklakw@wVK@kVW@UXK@_‚W@_nKVƒ@ƒUb@kVƒUUm@„ÇVU@Uk@VU@WUXWW@k„VUaVUkU@WWXUKk@Ukmm¯LmmƒUJUIWJkImmƒ_—±WLkKm£@aVUmKUnƒLmWUkVmw@¥U„LVWm@WUka@UmmLmm@@bUX™@@WUIm@UVUK@UVUUU™VVJmb@b„Xn‚mVƒ¼nnn¦mJUVƒL„V@VW@UzUlVnUbl`UnVl@XU@kl@bmÈUx™Vk@@J@„ƒ¼W@ÅaVVnzmVƒ„@WJk@kWJ@ƒlXbWbXxmVnšlLXb@°lKVXnWšbWV„„X„mbV@Xl‚bšI@Kn@@x@šVLlm"],encodeOffsets:[[121185,30184]]}},{type:"Feature",id:"3306",properties:{name:"绍兴市",cp:[120.564,29.7565],childNum:6},geometry:{type:"Polygon",coordinates:["@@„x@„˜VnnVJnIVJV_VKXblUXJlŽlLUŽUnU@UVVX@ŽmVUUUJl„XUlbV@@V„LVmX@@XlaVJVXXJ@b‚@XU„@lUšJ„È‚bœ¤Ō„JšçV™UUnml@@kna@wšWVU@LVKV@namwkIUwmƒnmlaVL„kUmVUkmmIUak@VmUUVUƒWV_kK@U„K‚bnkWy„U@ƒ@UXwl@VUÞUVak±VUUU@mlI@™™wXWƒIWbUKkLUKVmUUmVVL™LambUWmIUm™nUU@aUUVym@ƒXkak@ƒW@z@lWVXnmV™aUbVb@VƒakLUKƒLmbUU@lkV@bƒbUb@nW`@Xk`™Ikwm@mUXy™UUkWKUk@Kƒb@lV¦klV„¯„UlWIkwƒKUa™bVVUbƒVXXmbƒ@Vx„xkVVV@bU@@aW@kLmb@lVUIVKmL@bUV@bUV@L„a˜lnUV@nbVbUlVXšJVUnx"],encodeOffsets:[[122997,30561]]}},{type:"Feature",id:"3304",properties:{name:"嘉兴市",cp:[120.9155,30.6354],childNum:6},geometry:{type:"Polygon",coordinates:["@@@blIX@@VÜVUnn@l‚k„lKnI°Þl`²LVKVbnbVaVLUVn@W¦@VkVVb„@VI„`@blLnL‚aX@„VVb@U‚@XlVa„@@kVaUKV»U_lWXUƒƒ@alb„k@VllnLVKn@@UVIUw@y°IVVXU@VV@lw„m@wVkƾaœJ‚LkΡƧƒ™l™LÝUmW¯ķÿĉ¥ƒIŋŽWn™èkVƧU¯ÅmlVx@V¯aƒz„Ž@„@JU@U¦m@@šnVmn@V„LV‚"],encodeOffsets:[[123233,31382]]}},{type:"Feature",id:"3305",properties:{name:"湖州市",cp:[119.8608,30.7782],childNum:4},geometry:{type:"Polygon",coordinates:["@@kLlƒkm@VmÛU@UW@kJ@aUƒK@UnmmU@™maÛL@JWUUKUwUIUJ@XƒKWV@Vk@UIUmVk@mm@ÅnmaUVkL@VƒKmLVbU@klU@ÝbV™@mVUKV™@wUkVƒ—ƒmIUJ@nVV@L™akJWbUIka@UmKmLKmmƒUUVk@@nmLX`WXUV@Ž@nUl™kmlU@Ub„„ƒxVVšIlV„Žšnn„@@n˜„UҚ@„°n@@xmb@„VbnV@šš„@b@`@L@L@x@blVklVbnnV@‚aXb°VlU@W„b°U„LXWVUV™„™VwÈwÜ»ĸaĠnUVw²X@V@lVU@wlaUUVm@knUV›"],encodeOffsets:[[123379,31500]]}}],UTF8Encoding:!0}}),r("echarts/util/shape/HalfSmoothPolygon",["require","zrender/shape/Base","zrender/shape/util/smoothBezier","zrender/tool/util","zrender/shape/Polygon"],function(e){function i(e){t.call(this,e)}var t=e("zrender/shape/Base"),n=e("zrender/shape/util/smoothBezier"),r=e("zrender/tool/util");return i.prototype={type:"half-smooth-polygon",buildPath:function(t,r){var i=r.pointList;if(i.length<2)return;if(r.smooth){var s=n(i.slice(0,-2),r.smooth,!1,r.smoothConstraint);t.moveTo(i[0][0],i[0][1]);var o,u,a,f=i.length;for(var l=0;l0&&this._buildSinglePosition(f,t[f]);this.addShapeList()},_buildSinglePosition:function(e,t){var n=this._mapData(t),r=n.locationMap,i=n.maxDataLength;if(i===0||r.length===0)return;switch(e){case"bottom":case"top":this._buildHorizontal(t,i,r,this.xMarkMap);break;case"left":case"right":this._buildVertical(t,i,r,this.xMarkMap)}for(var s=0,o=t.length;s0&&(this.finalPLMap[s]=this.finalPLMap[s]||[],this.finalPLMap[s].push(g[s]),g[s]=[]);continue}b>=0?(p-=T>0?l.getCoordSize(b):d-l.getCoord(b),h=p):b<0&&(v+=T>0?l.getCoordSize(b):l.getCoord(b)-m,h=v),g[s].push([c,h,w,a.getNameByIndex(w),c,d]),r[s].min>b&&(r[s].min=b,r[s].minY=h,r[s].minX=c),r[s].max0&&(this.finalPLMap[k]=this.finalPLMap[k]||[],this.finalPLMap[k].push(g[k]),g[k]=[]);for(var S=0,x=n.length;S0&&(r[s].average=(r[s].sum/r[s].counter).toFixed(2)-0),h=this.component.yAxis.getAxis(i[s].yAxisIndex||0).getCoord(r[s].average),r[s].averageLine=[[this.component.grid.getX(),h],[this.component.grid.getXend(),h]],r[s].minLine=[[this.component.grid.getX(),r[s].minY],[this.component.grid.getXend(),r[s].minY]],r[s].maxLine=[[this.component.grid.getX(),r[s].maxY],[this.component.grid.getXend(),r[s].maxY]];this._buildBorkenLine(e,this.finalPLMap,a,"horizontal")},_buildVertical:function(e,t,n,r){var i=this.series,s=n[0][0],o=i[s],u=o.yAxisIndex,a=this.component.yAxis.getAxis(u),f,l,c,h,p,d,v,m,g={},y,b;for(var w=0,E=t;w0&&(this.finalPLMap[s]=this.finalPLMap[s]||[],this.finalPLMap[s].push(g[s]),g[s]=[]);continue}b>=0?(p+=T>0?l.getCoordSize(b):l.getCoord(b)-d,c=p):b<0&&(v-=T>0?l.getCoordSize(b):m-l.getCoord(b),c=v),g[s].push([c,h,w,a.getNameByIndex(w),d,h]),r[s].min>b&&(r[s].min=b,r[s].minX=c,r[s].minY=h),r[s].max0&&(this.finalPLMap[k]=this.finalPLMap[k]||[],this.finalPLMap[k].push(g[k]),g[k]=[]);for(var S=0,x=n.length;S0&&(r[s].average=(r[s].sum/r[s].counter).toFixed(2)-0),c=this.component.xAxis.getAxis(i[s].xAxisIndex||0).getCoord(r[s].average),r[s].averageLine=[[c,this.component.grid.getYend()],[c,this.component.grid.getY()]],r[s].minLine=[[r[s].minX,this.component.grid.getYend()],[r[s].minX,this.component.grid.getY()]],r[s].maxLine=[[r[s].maxX,this.component.grid.getYend()],[r[s].maxX,this.component.grid.getY()]];this._buildBorkenLine(e,this.finalPLMap,a,"vertical")},_buildBorkenLine:function(e,t,n,i){var o=this.series,l;for(var c=e.length-1;c>=0;c--){var h=e[c],p=o[h],d=t[h];if(p.type===this.type&&d!=null){var v=this._getBbox(h,i),m=this._sIndex2ColorMap[h],g=this.query(p,"itemStyle.normal.lineStyle.width"),y=this.query(p,"itemStyle.normal.lineStyle.type"),b=this.query(p,"itemStyle.normal.lineStyle.color"),w=this.getItemStyleColor(this.query(p,"itemStyle.normal.color"),h,-1),E=this.query(p,"itemStyle.normal.areaStyle")!=null,S=this.query(p,"itemStyle.normal.areaStyle.color");for(var x=0,T=d.length;x=0;r--){f=this.shapeList[r]._seriesIndex;if(n[f]&&!n[f][3]){if(this.shapeList[r]._main&&this.shapeList[r].style.pointList.length>1){l=this.shapeList[r].style.pointList,o=Math.abs(l[0][0]-l[1][0]),a=Math.abs(l[0][1]-l[1][1]),c=this.shapeList[r]._orient==="horizontal";if(n[f][2]){if(this.shapeList[r].type==="polygon"){var h=l.length;this.shapeList[r].style.pointList[h-3]=l[h-2],c?this.shapeList[r].style.pointList[h-3][0]=l[h-4][0]:this.shapeList[r].style.pointList[h-3][1]=l[h-4][1],this.shapeList[r].style.pointList[h-2]=l[h-1]}this.shapeList[r].style.pointList.pop(),c?(s=o,u=0):(s=0,u=-a)}else{this.shapeList[r].style.pointList.shift();if(this.shapeList[r].type==="polygon"){var p=this.shapeList[r].style.pointList.pop();c?p[0]=l[0][0]:p[1]=l[0][1],this.shapeList[r].style.pointList.push(p)}c?(s=-o,u=0):(s=0,u=a)}this.zr.modShape(this.shapeList[r].id,{style:{pointList:this.shapeList[r].style.pointList}},!0)}else{if(n[f][2]&&this.shapeList[r]._dataIndex===t[f].data.length-1){this.zr.delShape(this.shapeList[r].id);continue}if(!n[f][2]&&this.shapeList[r]._dataIndex===0){this.zr.delShape(this.shapeList[r].id);continue}}this.shapeList[r].position=[0,0],this.zr.animate(this.shapeList[r].id,"").when(500,{position:[s,u]}).start()}}}},i.prototype.iconLibrary.legendLineIcon=c,a.inherits(l,n),a.inherits(l,t),e("../chart").define("line",l),l}),r("echarts/chart/bar",["require","../component/base","./base","zrender/shape/Rectangle","../component/axis","../component/grid","../component/dataZoom","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../chart"],function(e){function a(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this),this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("zrender/shape/Rectangle");e("../component/axis"),e("../component/grid"),e("../component/dataZoom");var i=e("../config"),s=e("../util/ecData"),o=e("zrender/tool/util"),u=e("zrender/tool/color");return a.prototype={type:i.CHART_TYPE_BAR,_buildShape:function(){var e=this.series;this.selectedMap={},this.xMarkMap={},this._sIndex2colorMap={};var t={top:[],bottom:[],left:[],right:[]},n,r,s,o;for(var u=0,a=e.length;u0&&this._buildSinglePosition(f,t[f],this.xMarkMap);this.addShapeList()},_buildSinglePosition:function(e,t,n){var r=this._mapData(t),i=r.locationMap,s=r.maxDataLength;if(s===0||i.length===0)return;switch(e){case"bottom":case"top":this._buildHorizontal(s,i,t,n);break;case"left":case"right":this._buildVertical(s,i,t,n)}},_mapData:function(e){var t=this.series,n,r=0,i={},s="__kener__stack__",o,u,a=this.component.legend,f=[],l=0,c;for(var h=0,p=e.length;h0&&(c.style.x+=1,c.style.y+=1,c.style.width-=2,c.style.height-=2,c.style.strokeColor=c.highlightStyle.strokeColor=n.itemStyle.normal.barBorderColor,c.highlightStyle.lineWidth=3,c.style.brushType="both"),a.setItemShape(u,c))):(this.selectedMap[u]=!0,this._sIndex2colorMap[e[h]]=this.zr.getColor(e[h])),this.selectedMap[u]&&(o=n.stack||s+e[h],i[o]==null?(i[o]=r,f[r]=[e[h]],r++):f[i[o]].push(e[h])),l=Math.max(l,n.data.length);return{locationMap:f,maxDataLength:l}},_buildHorizontal:function(e,t,n,i){var s=this.series,o=t[0][0],u=s[o],a=u.xAxisIndex,f=this.component.xAxis.getAxis(a),l,c,h=this._mapSize(f,t),p=h.gap,d=h.barGap,v=h.barWidthMap,m=h.barWidth,g=h.barMinHeightMap,y,b=h.interval,w,E,S,x,T,N,C,k,L;for(var A=0,O=e;A0?(y=D>0?c.getCoordSize(L):x-c.getCoord(L),P===1&&g[o]>y&&(y=g[o]),S-=y,E=S):L<0?(y=D>0?c.getCoordSize(L):c.getCoord(L)-N,P===1&&g[o]>y&&(y=g[o]),E=T,T+=y):(y=0,S-=y,E=S),i[o][A]=w+(v[o]||m)/2,i[o].min>L&&(i[o].min=L,i[o].minY=E,i[o].minX=i[o][A]),i[o].max0&&(i[o].average=(i[o].sum/i[o].counter).toFixed(2)-0),E=this.component.yAxis.getAxis(s[o].yAxisIndex||0).getCoord(i[o].average),i[o].averageLine=[[this.component.grid.getX(),E],[this.component.grid.getXend(),E]],i[o].minLine=[[this.component.grid.getX(),i[o].minY],[this.component.grid.getXend(),i[o].minY]],i[o].maxLine=[[this.component.grid.getX(),i[o].maxY],[this.component.grid.getXend(),i[o].maxY]],i[o].isHorizontal=!0,this.buildMark(o)},_buildVertical:function(e,t,n,i){var s=this.series,o=t[0][0],u=s[o],a=u.yAxisIndex,f=this.component.yAxis.getAxis(a),l,c,h=this._mapSize(f,t),p=h.gap,d=h.barGap,v=h.barWidthMap,m=h.barWidth,g=h.barMinHeightMap,y,b=h.interval,w,E,S,x,T,N,C,k,L;for(var A=0,O=e;A0?(y=D>0?c.getCoordSize(L):c.getCoord(L)-x,P===1&&g[o]>y&&(y=g[o]),w=S,S+=y):L<0?(y=D>0?c.getCoordSize(L):N-c.getCoord(L),P===1&&g[o]>y&&(y=g[o]),T-=y,w=T):(y=0,w=S,S+=y),i[o][A]=E-(v[o]||m)/2,i[o].min>L&&(i[o].min=L,i[o].minX=w+y,i[o].minY=i[o][A]),i[o].max0&&(i[o].average=(i[o].sum/i[o].counter).toFixed(2)-0),w=this.component.xAxis.getAxis(s[o].xAxisIndex||0).getCoord(i[o].average),i[o].averageLine=[[w,this.component.grid.getYend()],[w,this.component.grid.getY()]],i[o].minLine=[[i[o].minX,this.component.grid.getYend()],[i[o].minX,this.component.grid.getY()]],i[o].maxLine=[[i[o].maxX,this.component.grid.getYend()],[i[o].maxX,this.component.grid.getY()]],i[o].isHorizontal=!1,this.buildMark(o)},_mapSize:function(e,t,n){var r=this.series,i,s={},o={},u,a=0,f=0,l,c,h,p,d=1;for(var v=0,m=t.length;v1?typeof c=="string"&&c.match(/%$/)?Math.floor(e.getGap()*(100-parseFloat(c))/100):e.getGap()-c:f,x=0,l=a>1?Math.floor((S-f)/(a-1)):0;if(l<0)return this._mapSize(e,t,!0)}return{barWidthMap:s,barMinHeightMap:o,gap:S,barWidth:x,barGap:l,interval:d}},_getBarItem:function(e,t,n,r,i,o,a,f){var l=this.series,c,h=l[e],p=h.data[t],d=this._sIndex2colorMap[e],v=[p,h],m=this.deepQuery(v,"itemStyle.normal.color")||d,g=this.deepQuery(v,"itemStyle.emphasis.color"),y=this.deepMerge(v,"itemStyle.normal"),b=y.barBorderWidth,w=this.deepMerge(v,"itemStyle.emphasis");c={zlevel:this._zlevelBase,clickable:this.deepQuery(v,"clickable"),style:{x:r,y:i,width:o,height:a,brushType:"both",color:this.getItemStyleColor(m,e,t,p),radius:y.barBorderRadius,lineWidth:b,strokeColor:y.barBorderColor},highlightStyle:{color:this.getItemStyleColor(g,e,t,p),radius:w.barBorderRadius,lineWidth:w.barBorderWidth,strokeColor:w.barBorderColor},_orient:f},c.highlightStyle.color=c.highlightStyle.color||(typeof c.style.color=="string"?u.lift(c.style.color,-0.3):c.style.color),b>0&&c.style.height>b&&c.style.width>b?(c.style.y+=b/2,c.style.height-=b,c.style.x+=b/2,c.style.width-=b):c.style.brushType="fill",c.highlightStyle.textColor=c.highlightStyle.color,c=this.addLabel(c,h,p,n,f);if(c.style.textPosition==="insideLeft"||c.style.textPosition==="insideRight"||c.style.textPosition==="insideTop"||c.style.textPosition==="insideBottom"){var E=5;switch(c.style.textPosition){case"insideLeft":c.style.textX=c.style.x+E,c.style.textY=c.style.y+c.style.height/2,c.style.textAlign="left",c.style.textBaseline="middle";break;case"insideRight":c.style.textX=c.style.x+c.style.width-E,c.style.textY=c.style.y+c.style.height/2,c.style.textAlign="right",c.style.textBaseline="middle";break;case"insideTop":c.style.textX=c.style.x+c.style.width/2,c.style.textY=c.style.y+E/2,c.style.textAlign="center",c.style.textBaseline="top";break;case"insideBottom":c.style.textX=c.style.x+c.style.width/2,c.style.textY=c.style.y+c.style.height-E/2,c.style.textAlign="center",c.style.textBaseline="bottom"}c.style.textPosition="specific",c.style.textColor=c.style.textColor||"#fff"}return this.deepQuery([p,h,this.option],"calculable")&&(this.setCalculable(c),c.draggable=!0),s.pack(c,l[e],e,l[e].data[t],t,n),c},getMarkCoord:function(e,t){var n=this.series[e],r=this.xMarkMap[e],i=this.component.xAxis.getAxis(n.xAxisIndex),s=this.component.yAxis.getAxis(n.yAxisIndex),o,u;if(!t.type||t.type!=="max"&&t.type!=="min"&&t.type!=="average")if(r.isHorizontal){o=typeof t.xAxis=="string"&&i.getIndexByName?i.getIndexByName(t.xAxis):t.xAxis||0;var a=r[o];a=a!=null?a:typeof t.xAxis!="string"&&i.getCoordByIndex?i.getCoordByIndex(t.xAxis||0):i.getCoord(t.xAxis||0),u=[a,s.getCoord(t.yAxis||0)]}else{o=typeof t.yAxis=="string"&&s.getIndexByName?s.getIndexByName(t.yAxis):t.yAxis||0;var f=r[o];f=f!=null?f:typeof t.yAxis!="string"&&s.getCoordByIndex?s.getCoordByIndex(t.yAxis||0):s.getCoord(t.yAxis||0),u=[i.getCoord(t.xAxis||0),f]}else u=[r[t.type+"X"],r[t.type+"Y"],r[t.type+"Line"],r[t.type]];return u},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},addDataAnimation:function(e){var t=this.series,n={};for(var r=0,i=e.length;r=0;r--){c=s.get(this.shapeList[r],"seriesIndex");if(n[c]&&!n[c][3]&&this.shapeList[r].type==="rectangle"){h=s.get(this.shapeList[r],"dataIndex"),l=t[c];if(n[c][2]&&h===l.data.length-1){this.zr.delShape(this.shapeList[r].id);continue}if(!n[c][2]&&h===0){this.zr.delShape(this.shapeList[r].id);continue}this.shapeList[r]._orient==="horizontal"?(f=this.component.yAxis.getAxis(l.yAxisIndex||0).getGap(),a=n[c][2]?-f:f,o=0):(u=this.component.xAxis.getAxis(l.xAxisIndex||0).getGap(),o=n[c][2]?u:-u,a=0),this.shapeList[r].position=[0,0],this.zr.animate(this.shapeList[r].id,"").when(500,{position:[o,a]}).start()}}}},o.inherits(a,n),o.inherits(a,t),e("../chart").define("bar",a),a}),r("echarts/chart/pie",["require","../component/base","./base","zrender/shape/Text","zrender/shape/Ring","zrender/shape/Circle","zrender/shape/Sector","zrender/shape/BrokenLine","../config","../util/ecData","zrender/tool/util","zrender/tool/math","zrender/tool/color","../chart"],function(e){function p(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this);var u=this;u.shapeHandler.onmouseover=function(e){var t=e.target,n=f.get(t,"seriesIndex"),r=f.get(t,"dataIndex"),i=f.get(t,"special"),s=t._lastAddRadius,o=t.style.startAngle,a=t.style.endAngle,l=t.highlightStyle.color,c=u.getLabel(n,r,i,s,o,a,l,!0);c&&u.zr.addHoverShape(c);var h=u.getLabelLine(n,r,s,t.style.r0,t.style.r,o,a,l,!0);h&&u.zr.addHoverShape(h)},this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("zrender/shape/Text"),i=e("zrender/shape/Ring"),s=e("zrender/shape/Circle"),o=e("zrender/shape/Sector"),u=e("zrender/shape/BrokenLine"),a=e("../config"),f=e("../util/ecData"),l=e("zrender/tool/util"),c=e("zrender/tool/math"),h=e("zrender/tool/color");return p.prototype={type:a.CHART_TYPE_PIE,_buildShape:function(){var e=this.series,t=this.component.legend;this.selectedMap={},this._selected={};var n,r,o;this._selectedMode=!1;var u;for(var l=0,c=e.length;l0&&Math.abs(m-g)<15&&p<4&&this._needLabel(n,r[l],!1)&&this.deepQuery([r[l],n],"itemStyle.normal.label.position")!="center"?d+=h<4?20:-20:d=0,this._buildItem(e,l,h,d,r[l].selected,x,T,m,g,w),v||(m=g)}},_buildItem:function(e,t,n,r,i,s,o,u,a,l){var c=this.series,h=this.getSector(e,t,n,i,s,o,u,a,l);f.pack(h,c[e],e,c[e].data[t],t,c[e].data[t].name,n),h._lastAddRadius=r,this.shapeList.push(h);var p=this.getLabel(e,t,n,r,u,a,l,!1);p&&(f.pack(p,c[e],e,c[e].data[t],t,c[e].data[t].name,n),p._dataIndex=t,this.shapeList.push(p));var d=this.getLabelLine(e,t,r,s,o,u,a,l,!1);d&&(f.pack(d,c[e],e,c[e].data[t],t,c[e].data[t].name,n),d._dataIndex=t,this.shapeList.push(d))},getSector:function(e,t,n,r,i,s,u,a,f){var l=this.series,p=l[e],d=p.data[t],v=[d,p],m=this.parseCenter(this.zr,p.center),g=this.deepMerge(v,"itemStyle.normal")||{},y=this.deepMerge(v,"itemStyle.emphasis")||{},b=this.getItemStyleColor(g.color,e,t,d)||f,w=this.getItemStyleColor(y.color,e,t,d)||(typeof b=="string"?h.lift(b,-0.2):b),E={zlevel:this._zlevelBase,clickable:this.deepQuery(v,"clickable"),style:{x:m[0],y:m[1],r0:i,r:s,startAngle:u,endAngle:a,brushType:"both",color:b,lineWidth:g.borderWidth,strokeColor:g.borderColor,lineJoin:"round"},highlightStyle:{color:w,lineWidth:y.borderWidth,strokeColor:y.borderColor,lineJoin:"round"},_seriesIndex:e,_dataIndex:t};if(r){var S=((E.style.startAngle+E.style.endAngle)/2).toFixed(2)-0;E.style._hasSelected=!0,E.style._x=E.style.x,E.style._y=E.style.y;var x=this.query(p,"selectedOffset");E.style.x+=c.cos(S,!0)*x,E.style.y-=c.sin(S,!0)*x,this._selected[e][t]=!0}else this._selected[e][t]=!1;this._selectedMode&&(E.onclick=this.shapeHandler.onclick),this.deepQuery([d,p,this.option],"calculable")&&(this.setCalculable(E),E.draggable=!0);if(this._needLabel(p,d,!0)||this._needLabelLine(p,d,!0))E.onmouseover=this.shapeHandler.onmouseover;return E=new o(E),E},getLabel:function(e,t,n,i,s,o,u,a){var f=this.series,h=f[e],p=h.data[t];if(!this._needLabel(h,p,a))return;var d=a?"emphasis":"normal",v=l.merge(l.clone(p.itemStyle)||{},h.itemStyle),m=v[d].label,g=m.textStyle||{},y=this.parseCenter(this.zr,h.center),b=y[0],w=y[1],E,S,x=((o+s)/2+360)%360,T=this.parseRadius(this.zr,h.radius),N,C="middle";return m.position=m.position||v.normal.label.position,m.position==="center"?(T=T[1],E=b,S=w,N="center"):m.position==="inner"?(T=(T[0]+T[1])/2+i,E=Math.round(b+T*c.cos(x,!0)),S=Math.round(w-T*c.sin(x,!0)),u="#fff",N="center"):(T=T[1]- -v[d].labelLine.length+i,E=b+T*c.cos(x,!0),S=w-T*c.sin(x,!0),N=x>=90&&x<=270?"right":"left"),m.position!="center"&&m.position!="inner"&&(E+=N==="left"?20:-20),p.__labelX=E-(N==="left"?5:-5),p.__labelY=S,new r({zlevel:this._zlevelBase+1,hoverable:!1,style:{x:E,y:S,color:g.color||u,text:this.getLabelText(e,t,n,d),textAlign:g.align||N,textBaseline:g.baseline||C,textFont:this.getFont(g)},highlightStyle:{brushType:"fill"},_seriesIndex:e,_dataIndex:t})},getLabelText:function(e,t,n,r){var i=this.series,s=i[e],o=s.data[t],u=this.deepQuery([o,s],"itemStyle."+r+".label.formatter");if(!u)return o.name;if(typeof u=="function")return u.call(this.myChart,s.name,o.name,o.value,n);if(typeof u=="string")return u=u.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}").replace("{d}","{d0}"),u=u.replace("{a0}",s.name).replace("{b0}",o.name).replace("{c0}",o.value).replace("{d0}",n),u},getLabelLine:function(e,t,n,r,i,s,o,a,f){var h=this.series,p=h[e],d=p.data[t];if(this._needLabelLine(p,d,f)){var v=f?"emphasis":"normal",m=l.merge(l.clone(d.itemStyle)||{},p.itemStyle),g=m[v].labelLine,y=g.lineStyle||{},b=this.parseCenter(this.zr,p.center),w=b[0],E=b[1],S=i,x=this.parseRadius(this.zr,p.radius)[1]- -g.length+n,T=(o+s)/2%360,N=c.cos(T,!0),C=c.sin(T,!0);return new u({zlevel:this._zlevelBase+1,hoverable:!1,style:{pointList:[[w+S*N,E-S*C],[w+x*N,E-x*C],[d.__labelX,d.__labelY]],strokeColor:y.color||a,lineType:y.type,lineWidth:y.width},_seriesIndex:e,_dataIndex:t})}return},_needLabel:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".label.show")},_needLabelLine:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".labelLine.show")},reformOption:function(e){var t=l.merge;return e=t(e||{},this.ecTheme.pie),e.itemStyle.normal.label.textStyle=t(e.itemStyle.normal.label.textStyle||{},this.ecTheme.textStyle),e.itemStyle.emphasis.label.textStyle=t(e.itemStyle.emphasis.label.textStyle||{},this.ecTheme.textStyle),e},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},addDataAnimation:function(e){var t=this.series,n={};for(var r=0,i=e.length;r{b} : {c}', // 数据孤岛内容格式器 showDelay: 20, // 显示延迟,添加显示延迟可以避免频繁切换,单位ms hideDelay: 100, // 隐藏延迟,单位ms - transitionDuration : 0.4, // 动画变换时间,单位s + transitionDuration: 0.4, // 动画变换时间,单位s backgroundColor: 'rgba(0,0,0,0.7)', // 提示背景颜色,默认为透明度为0.7的黑色 borderColor: '#333', // 提示边框颜色 borderRadius: 4, // 提示边框圆角,单位px,默认为4 borderWidth: 0, // 提示边框线宽,单位px,默认为0(无边框) padding: 5, // 提示内边距,单位px,默认各方向内边距为5, // 接受数组分别设定上右下左边距,同css - axisPointer : { // 坐标轴指示器,坐标轴触发有效 - type : 'line', // 默认为直线,可选为:'line' | 'shadow' | 'cross' - lineStyle : { // 直线指示器样式设置 + axisPointer: { // 坐标轴指示器,坐标轴触发有效 + type: 'line', // 默认为直线,可选为:'line' | 'shadow' | 'cross' + lineStyle: { // 直线指示器样式设置 color: '#48b', width: 2, type: 'solid' @@ -649,7 +650,7 @@ define('echarts/config',[],function() { width: 1, type: 'dashed' }, - shadowStyle : { // 阴影指示器样式设置 + shadowStyle: { // 阴影指示器样式设置 color: 'rgba(150,150,150,0.3)', // 阴影颜色 width: 'auto', // 阴影大小 type: 'default' @@ -663,8 +664,8 @@ define('echarts/config',[],function() { // 区域缩放控制器 dataZoom: { show: false, - orient: 'horizontal', // 布局方式,默认为水平布局,可选为: - // 'horizontal' ¦ 'vertical' + orient: 'horizontal', // 布局方式,默认为水平布局,可选为: + // 'horizontal' ¦ 'vertical' // x: {number}, // 水平安放位置,默认为根据grid参数适配,可选为: // {number}(x坐标,单位px) // y: {number}, // 垂直安放位置,默认为根据grid参数适配,可选为: @@ -715,7 +716,7 @@ define('echarts/config',[],function() { axisTick: { // 坐标轴小标记 show: true, // 属性show控制显示与否,默认不显示 interval: 'auto', - inside : false, // 控制小标记是否在grid里 + inside: false, // 控制小标记是否在grid里 // onGap: null, length :5, // 属性length控制线长 lineStyle: { // 属性lineStyle控制线条样式 @@ -776,7 +777,7 @@ define('echarts/config',[],function() { }, axisTick: { // 坐标轴小标记 show: false, // 属性show控制显示与否,默认不显示 - inside : false, // 控制小标记是否在grid里 + inside: false, // 控制小标记是否在grid里 length :5, // 属性length控制线长 lineStyle: { // 属性lineStyle控制线条样式 color: '#333', @@ -809,12 +810,12 @@ define('echarts/config',[],function() { } }, - polar : { - center : ['50%', '50%'], // 默认全局居中 - radius : '75%', - startAngle : 90, - splitNumber : 5, - name : { + polar: { + center: ['50%', '50%'], // 默认全局居中 + radius: '75%', + startAngle: 90, + splitNumber: 5, + name: { show: true, // formatter: null, textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE @@ -836,28 +837,28 @@ define('echarts/config',[],function() { color: '#333' } }, - splitArea : { - show : true, - areaStyle : { + splitArea: { + show: true, + areaStyle: { color: ['rgba(250,250,250,0.3)','rgba(200,200,200,0.3)'] } }, - splitLine : { - show : true, - lineStyle : { - width : 1, - color : '#ccc' + splitLine: { + show: true, + lineStyle: { + width: 1, + color: '#ccc' } }, type: 'polygon' - //indicator : [] + // indicator: [ ] }, - timeline : { + timeline: { show: true, - type : 'time', // 模式是时间类型,支持 number - notMerge : false, - realtime : true, + type: 'time', // 模式是时间类型,支持 number + notMerge: false, + realtime: true, x: 80, // y: {number}, x2: 80, @@ -865,17 +866,17 @@ define('echarts/config',[],function() { // width: {totalWidth} - x - x2, height: 50, backgroundColor: 'rgba(0,0,0,0)', // 时间轴背景颜色 - borderColor : '#ccc', // 时间轴边框颜色 - borderWidth : 0, // 时间轴边框线宽,单位px,默认为0(无边框) - padding : 5, // 时间轴内边距,单位px,默认各方向内边距为5, - controlPosition : 'left', // 'right' | 'none' - autoPlay : false, - loop : true, - playInterval : 2000, // 播放时间间隔,单位ms - lineStyle : { - width : 1, - color : '#666', - type : 'dashed' + borderColor: '#ccc', // 时间轴边框颜色 + borderWidth: 0, // 时间轴边框线宽,单位px,默认为0(无边框) + padding: 5, // 时间轴内边距,单位px,默认各方向内边距为5, + controlPosition: 'left', // 'right' | 'none' + autoPlay: false, + loop: true, + playInterval: 2000, // 播放时间间隔,单位ms + lineStyle: { + width: 1, + color: '#666', + type: 'dashed' }, label: { // 文本标签 show: true, @@ -886,12 +887,12 @@ define('echarts/config',[],function() { color: '#333' } }, - checkpointStyle : { - symbol : 'auto', - symbolSize : 'auto', - color : 'auto', - borderColor : 'auto', - borderWidth : 'auto', + checkpointStyle: { + symbol: 'auto', + symbolSize: 'auto', + color: 'auto', + borderColor: 'auto', + borderWidth: 'auto', label: { // 文本标签 show: false, textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE @@ -899,31 +900,53 @@ define('echarts/config',[],function() { } } }, - controlStyle : { - normal : { color : '#333'}, - emphasis : { color : '#1e90ff'} + controlStyle: { + normal: { color: '#333'}, + emphasis: { color: '#1e90ff'} }, - symbol : 'emptyDiamond', - symbolSize : 4, - currentIndex : 0 - // data : [] + symbol: 'emptyDiamond', + symbolSize: 4, + currentIndex: 0 + // data: [] + }, + + roamController: { + show: false, + x: 'left', // 水平安放位置,默认为全图左对齐,可选为: + // 'center' ¦ 'left' ¦ 'right' + // ¦ {number}(x坐标,单位px) + y: 'top', // 垂直安放位置,默认为全图顶端,可选为: + // 'top' ¦ 'bottom' ¦ 'center' + // ¦ {number}(y坐标,单位px) + width: 80, + height: 120, + backgroundColor: 'rgba(0,0,0,0)', + borderColor: '#ccc', // 图例边框颜色 + borderWidth: 0, // 图例边框线宽,单位px,默认为0(无边框) + padding: 5, // 图例内边距,单位px,默认各方向内边距为5, + // 接受数组分别设定上右下左边距,同css + handlerColor: '#6495ed', + fillerColor: '#fff', + step: 15, // 移动幅度 + mapTypeControl: null }, // 柱形图默认参数 bar: { + clickable: true, // stack: null xAxisIndex: 0, yAxisIndex: 0, barMinHeight: 0, // 最小高度改为0 // barWidth: null, // 默认自适应 barGap: '30%', // 柱间距离,默认为柱形宽度的30%,可设固定值 - barCategoryGap : '20%', // 类目间柱形距离,默认为类目间距的20%,可设固定值 + barCategoryGap: '20%', // 类目间柱形距离,默认为类目间距的20%,可设固定值 itemStyle: { normal: { // color: '各异', - borderColor: '#fff', // 柱条边线 - borderRadius: 0, // 柱条边线圆角,单位px,默认为0 - borderWidth: 0, // 柱条边线线宽,单位px,默认为1 + barBorderColor: '#fff', // 柱条边线 + barBorderRadius: 0, // 柱条边线圆角,单位px,默认为0 + barBorderWidth: 0, // 柱条边线线宽,单位px,默认为1 label: { show: false // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 @@ -934,9 +957,9 @@ define('echarts/config',[],function() { }, emphasis: { // color: '各异', - borderColor: '#fff', // 柱条边线 - borderRadius: 0, // 柱条边线圆角,单位px,默认为0 - borderWidth: 0, // 柱条边线线宽,单位px,默认为1 + barBorderColor: '#fff', // 柱条边线 + barBorderRadius: 0, // 柱条边线圆角,单位px,默认为0 + barBorderWidth: 0, // 柱条边线线宽,单位px,默认为1 label: { show: false // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 @@ -950,6 +973,7 @@ define('echarts/config',[],function() { // 折线图默认参数 line: { + clickable: true, // stack: null xAxisIndex: 0, yAxisIndex: 0, @@ -966,7 +990,7 @@ define('echarts/config',[],function() { lineStyle: { width: 2, type: 'solid', - shadowColor : 'rgba(0,0,0,0)', //默认透明 + shadowColor: 'rgba(0,0,0,0)', //默认透明 shadowBlur: 0, shadowOffsetX: 0, shadowOffsetY: 0 @@ -983,19 +1007,20 @@ define('echarts/config',[],function() { } } }, - //smooth : false, - //symbol: null, // 拐点图形类型 - symbolSize: 2, // 拐点图形大小 - //symbolRotate : null, // 拐点图形旋转控制 - showAllSymbol: false // 标志图形默认只有主轴显示(随主轴标签间隔隐藏策略) + // smooth: false, + // symbol: null, // 拐点图形类型 + symbolSize: 2, // 拐点图形大小 + // symbolRotate: null, // 拐点图形旋转控制 + showAllSymbol: false // 标志图形默认只有主轴显示(随主轴标签间隔隐藏策略) }, // K线图默认参数 k: { + clickable: true, xAxisIndex: 0, yAxisIndex: 0, - // barWidth : null // 默认自适应 - // barMaxWidth : null // 默认自适应 + // barWidth: null // 默认自适应 + // barMaxWidth: null // 默认自适应 itemStyle: { normal: { color: '#fff', // 阳线填充颜色 @@ -1015,20 +1040,21 @@ define('echarts/config',[],function() { // 散点图默认参数 scatter: { + clickable: true, xAxisIndex: 0, yAxisIndex: 0, - //symbol: null, // 图形类型 - symbolSize: 4, // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 - //symbolRotate : null, // 图形旋转控制 - large: false, // 大规模散点图 - largeThreshold: 2000,// 大规模阀值,large为true且数据量>largeThreshold才启用大规模模式 + // symbol: null, // 图形类型 + symbolSize: 4, // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 + // symbolRotate: null, // 图形旋转控制 + large: false, // 大规模散点图 + largeThreshold: 2000, // 大规模阀值,large为true且数据量>largeThreshold才启用大规模模式 itemStyle: { normal: { // color: 各异, label: { show: false, // 标签文本格式器,同Tooltip.formatter,不支持回调 - formatter : function (a, b, c) { + formatter: function (a, b, c) { if (typeof c[2] != 'undefined') { return c[2]; } @@ -1046,7 +1072,7 @@ define('echarts/config',[],function() { label: { show: false, // 标签文本格式器,同Tooltip.formatter,不支持回调 - formatter : function (a, b, c) { + formatter: function (a, b, c) { if (typeof c[2] != 'undefined') { return c[2]; } @@ -1063,7 +1089,8 @@ define('echarts/config',[],function() { }, // 雷达图默认参数 - radar : { + radar: { + clickable: true, polarIndex: 0, itemStyle: { normal: { @@ -1083,21 +1110,22 @@ define('echarts/config',[],function() { } } }, - //symbol: null, // 拐点图形类型 - symbolSize: 2 // 可计算特性参数,空数据拖拽提示图形大小 - //symbolRotate : null, // 图形旋转控制 + // symbol: null, // 拐点图形类型 + symbolSize: 2 // 可计算特性参数,空数据拖拽提示图形大小 + // symbolRotate: null, // 图形旋转控制 }, // 饼图默认参数 pie: { - center : ['50%', '50%'], // 默认全局居中 - radius : [0, '75%'], - clockWise : true, // 默认顺时针 + clickable: true, + center: ['50%', '50%'], // 默认全局居中 + radius: [0, '75%'], + clockWise: true, // 默认顺时针 startAngle: 90, minAngle: 0, // 最小角度改为0 selectedOffset: 10, // 选中是扇区偏移量 // selectedMode: false, // 选择模式,默认关闭,可选single,multiple - // roseType : null, // 南丁格尔玫瑰图模式,'radius'(半径) | 'area'(面积) + // roseType: null, // 南丁格尔玫瑰图模式,'radius'(半径) | 'area'(面积) itemStyle: { normal: { // color: 各异, @@ -1145,19 +1173,20 @@ define('echarts/config',[],function() { map: { mapType: 'china', // 各省的mapType暂时都用中文 //mapLocation: { - // x : 'center' | 'left' | 'right' | 'x%' | {number}, - // y : 'center' | 'top' | 'bottom' | 'x%' | {number} + // x: 'center' | 'left' | 'right' | 'x%' | {number}, + // y: 'center' | 'top' | 'bottom' | 'x%' | {number} // width // 自适应 // height // 自适应 //}, - // mapValueCalculation: 'sum', // 数值合并方式,默认加和,可选为: - // 'sum' | 'average' | 'max' | 'min' - mapValuePrecision : 0, // 地图数值计算结果小数精度 - showLegendSymbol : true, // 显示图例颜色标识(系列标识的小圆点),存在legend时生效 - // selectedMode: false, // 选择模式,默认关闭,可选single,multiple + // mapValueCalculation: 'sum', // 数值合并方式,默认加和,可选为: + // 'sum' | 'average' | 'max' | 'min' + mapValuePrecision: 0, // 地图数值计算结果小数精度 + showLegendSymbol: true, // 显示图例颜色标识(系列标识的小圆点),存在legend时生效 + // selectedMode: false, // 选择模式,默认关闭,可选single,multiple hoverable: true, - // roam : false, // 是否开启缩放及漫游模式 - // scaleLimit : null, + clickable: true, + // roam: false, // 是否开启缩放及漫游模式 + // scaleLimit: null, itemStyle: { normal: { // color: 各异, @@ -1190,7 +1219,7 @@ define('echarts/config',[],function() { } }, - force : { + force: { // 布局中心 center: ['50%', '50%'], @@ -1201,8 +1230,8 @@ define('echarts/config',[],function() { coolDown: 0.99, // 数据映射到圆的半径的最小值和最大值 - minRadius : 10, - maxRadius : 20, + minRadius: 10, + maxRadius: 20, // 是否根据屏幕比例拉伸 ratioScaling: false, @@ -1218,10 +1247,10 @@ define('echarts/config',[],function() { steps: 1, // 布局缩放因子,并不完全精确, 效果跟布局大小类似 - scaling : 1.0, + scaling: 1.0, // 向心力因子,越大向心力越大( 所有顶点会往 center 的位置收拢 ) - gravity : 1, + gravity: 1, symbol: 'circle', // symbolSize 为 0 的话使用映射到minRadius-maxRadius后的值 @@ -1230,9 +1259,10 @@ define('echarts/config',[],function() { linkSymbol: null, linkSymbolSize: [10, 15], draggable: true, + clickable: true, // 分类里如果有样式会覆盖节点默认样式 - categories : [{ + categories: [{ // itemStyle // symbol // symbolSize @@ -1245,14 +1275,14 @@ define('echarts/config',[],function() { show: false // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE }, - nodeStyle : { - brushType : 'both', - color : '#f08c2e', - strokeColor : '#5182ab', + nodeStyle: { + brushType: 'both', + color: '#f08c2e', + strokeColor: '#5182ab', lineWidth: 1 }, - linkStyle : { - strokeColor : '#5182ab' + linkStyle: { + strokeColor: '#5182ab' } }, emphasis: { @@ -1261,8 +1291,8 @@ define('echarts/config',[],function() { show: false // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE }, - nodeStyle : {}, - linkStyle : { + nodeStyle: {}, + linkStyle: { opacity: 0 } } @@ -1289,44 +1319,45 @@ define('echarts/config',[],function() { // }] }, - chord : { - radius : ['65%', '75%'], - center : ['50%', '50%'], - padding : 2, - sort : 'none', // can be 'none', 'ascending', 'descending' - sortSub : 'none', // can be 'none', 'ascending', 'descending' - startAngle : 90, - clockWise : true, - showScale : false, - showScaleText : false, - itemStyle : { - normal : { - label : { - show : true, + chord: { + clickable: true, + radius: ['65%', '75%'], + center: ['50%', '50%'], + padding: 2, + sort: 'none', // can be 'none', 'ascending', 'descending' + sortSub: 'none', // can be 'none', 'ascending', 'descending' + startAngle: 90, + clockWise: true, + showScale: false, + showScaleText: false, + itemStyle: { + normal: { + label: { + show: true, rotate: false, distance: 10 // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE }, - lineStyle : { - width : 0, - color : '#000' + lineStyle: { + width: 0, + color: '#000' }, - chordStyle : { - lineStyle : { - width : 1, - color : '#999' + chordStyle: { + lineStyle: { + width: 1, + color: '#999' } } }, - emphasis : { - lineStyle : { - width : 0, - color : '#000' + emphasis: { + lineStyle: { + width: 0, + color: '#000' }, - chordStyle : { - lineStyle : { - width : 1, - color : '#666' + chordStyle: { + lineStyle: { + width: 1, + color: '#666' } } } @@ -1346,14 +1377,14 @@ define('echarts/config',[],function() { * * Row based */ - matrix : [] + matrix: [ ] }, - gauge : { - center : ['50%', '50%'], // 默认全局居中 - radius : '75%', + gauge: { + center: ['50%', '50%'], // 默认全局居中 + radius: '75%', startAngle: 225, - endAngle : -45, + endAngle: -45, min: 0, // 最小值 max: 100, // 最大值 precision: 0, // 小数精度,默认为0,无小数点 @@ -1391,37 +1422,38 @@ define('echarts/config',[],function() { type: 'solid' } }, - pointer : { - show : true, - length : '80%', - width : 8, - color : 'auto' + pointer: { + show: true, + length: '80%', + width: 8, + color: 'auto' }, - title : { - show : true, - offsetCenter: [0, '-40%'], // x, y,单位px - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + title: { + show: true, + offsetCenter: [0, '-40%'], // x, y,单位px + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE color: '#333', - fontSize : 15 + fontSize: 15 } }, - detail : { - show : true, + detail: { + show: true, backgroundColor: 'rgba(0,0,0,0)', borderWidth: 0, borderColor: '#ccc', width: 100, height: 40, - offsetCenter: [0, '40%'], // x, y,单位px + offsetCenter: [0, '40%'], // x, y,单位px // formatter: null, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE color: 'auto', - fontSize : 30 + fontSize: 30 } } }, - funnel : { + funnel: { + clickable: true, x: 80, y: 60, x2: 80, @@ -1432,8 +1464,8 @@ define('echarts/config',[],function() { max: 100, minSize: '0%', maxSize: '100%', - sort : 'descending', // 'ascending', 'descending' - gap : 0, + sort: 'descending', // 'ascending', 'descending' + gap: 0, itemStyle: { normal: { // color: 各异, @@ -1474,30 +1506,31 @@ define('echarts/config',[],function() { calculateStep: 0.1 // 滚轮可计算步长 0.1 = 10% }, - markPoint : { + markPoint: { + clickable: true, symbol: 'pin', // 标注类型 symbolSize: 10, // 标注大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 - //symbolRotate : null, // 标注旋转控制 - large : false, - effect : { + // symbolRotate: null, // 标注旋转控制 + large: false, + effect: { show: false, loop: true, period: 15, // 运动周期,无单位,值越大越慢 - scaleSize : 2 // 放大倍数,以markPoint点size为基准 - // color : 'gold', - // shadowColor : 'rgba(255,215,0,0.8)', - // shadowBlur : 0 // 炫光模糊 + scaleSize: 2 // 放大倍数,以markPoint点size为基准 + // color: 'gold', + // shadowColor: 'rgba(255,215,0,0.8)', + // shadowBlur: 0 // 炫光模糊 }, itemStyle: { normal: { // color: 各异, - // borderColor: 各异, // 标注边线颜色,优先于color - borderWidth: 2, // 标注边线线宽,单位px,默认为1 + // borderColor: 各异, // 标注边线颜色,优先于color + borderWidth: 2, // 标注边线线宽,单位px,默认为1 label: { show: true, // 标签文本格式器,同Tooltip.formatter,不支持回调 - // formatter : null, - position: 'inside' // 可选为'left'|'right'|'top'|'bottom' + // formatter: null, + position: 'inside' // 可选为'left'|'right'|'top'|'bottom' // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE } }, @@ -1506,7 +1539,7 @@ define('echarts/config',[],function() { label: { show: true // 标签文本格式器,同Tooltip.formatter,不支持回调 - // formatter : null, + // formatter: null, // position: 'inside' // 'left'|'right'|'top'|'bottom' // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE } @@ -1514,33 +1547,34 @@ define('echarts/config',[],function() { } }, - markLine : { + markLine: { + clickable: true, // 标线起始和结束的symbol介绍类型,如果都一样,可以直接传string symbol: ['circle', 'arrow'], // 标线起始和结束的symbol大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 symbolSize: [2, 4], // 标线起始和结束的symbol旋转控制 - //symbolRotate : null, - //smooth : false, - large : false, - effect : { + //symbolRotate: null, + //smooth: false, + large: false, + effect: { show: false, loop: true, - period: 15, // 运动周期,无单位,值越大越慢 - scaleSize : 2 // 放大倍数,以markLine线lineWidth为基准 - // color : 'gold', - // shadowColor : 'rgba(255,215,0,0.8)', - // shadowBlur : lineWidth * 2 // 炫光模糊,默认等于scaleSize计算所得 + period: 15, // 运动周期,无单位,值越大越慢 + scaleSize: 2 // 放大倍数,以markLine线lineWidth为基准 + // color: 'gold', + // shadowColor: 'rgba(255,215,0,0.8)', + // shadowBlur: lineWidth * 2 // 炫光模糊,默认等于scaleSize计算所得 }, itemStyle: { normal: { - // color: 各异, // 标线主色,线色,symbol主色 + // color: 各异, // 标线主色,线色,symbol主色 // borderColor: 随color, // 标线symbol边框颜色,优先于color - borderWidth: 1.5, // 标线symbol边框线宽,单位px,默认为2 + borderWidth: 1.5, // 标线symbol边框线宽,单位px,默认为2 label: { show: true, // 标签文本格式器,同Tooltip.formatter,不支持回调 - // formatter : null, + // formatter: null, // 可选为 'start'|'end'|'left'|'right'|'top'|'bottom' position: 'end' // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE @@ -1549,7 +1583,7 @@ define('echarts/config',[],function() { // color: 随borderColor, // 主色,线色,优先级高于borderColor和color // width: 随borderWidth, // 优先于borderWidth type: 'dashed' - // shadowColor : 'rgba(0,0,0,0)', //默认透明 + // shadowColor: 'rgba(0,0,0,0)', //默认透明 // shadowBlur: 0, // shadowOffsetX: 0, // shadowOffsetY: 0 @@ -1560,11 +1594,11 @@ define('echarts/config',[],function() { label: { show: false // 标签文本格式器,同Tooltip.formatter,不支持回调 - // formatter : null, + // formatter: null, // position: 'inside' // 'left'|'right'|'top'|'bottom' // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE }, - lineStyle : {} + lineStyle: {} } } }, @@ -1585,7 +1619,9 @@ define('echarts/config',[],function() { RESTORE: 'restore', RESIZE: 'resize', CLICK: 'click', + DBLCLICK: 'dblclick', HOVER: 'hover', + MOUSEOUT: 'mouseout', //MOUSEWHEEL: 'mousewheel', // -------业务交互逻辑 DATA_CHANGED: 'dataChanged', @@ -1597,27 +1633,28 @@ define('echarts/config',[],function() { MAGIC_TYPE_CHANGED: 'magicTypeChanged', DATA_VIEW_CHANGED: 'dataViewChanged', TIMELINE_CHANGED: 'timelineChanged', - MAP_ROAM : 'mapRoam', + MAP_ROAM: 'mapRoam', // -------内部通信 TOOLTIP_HOVER: 'tooltipHover', TOOLTIP_IN_GRID: 'tooltipInGrid', - TOOLTIP_OUT_GRID: 'tooltipOutGrid' + TOOLTIP_OUT_GRID: 'tooltipOutGrid', + ROAMCONTROLLER: 'roamController' }, - DRAG_ENABLE_TIME : 120, // 降低图表内元素拖拽敏感度,单位ms,不建议外部干预 - EFFECT_ZLEVEL : 7, + DRAG_ENABLE_TIME: 120, // 降低图表内元素拖拽敏感度,单位ms,不建议外部干预 + EFFECT_ZLEVEL: 7, // 主题,默认标志图形类型列表 - symbolList : [ + symbolList: [ 'circle', 'rectangle', 'triangle', 'diamond', 'emptyCircle', 'emptyRectangle', 'emptyTriangle', 'emptyDiamond' ], - loadingText : 'Loading...', + loadingText: 'Loading...', // 可计算特性配置,孤岛,提示颜色 - calculable: false, // 默认关闭可计算特性 - calculableColor: 'rgba(255,165,0,0.6)', // 拖拽提示边框颜色 - calculableHolderColor: '#ccc', // 可计算占位提示颜色 + calculable: false, // 默认关闭可计算特性 + calculableColor: 'rgba(255,165,0,0.6)', // 拖拽提示边框颜色 + calculableHolderColor: '#ccc', // 可计算占位提示颜色 nameConnector: ' & ', - valueConnector: ' : ', - animation: true, + valueConnector: ': ', + animation: true, // 过渡动画是否开启 addDataAnimation: true, // 动态数据接口是否开启动画效果 animationThreshold: 2000, // 动画元素阀值,产生的图形原素超过2000不出动画 animationDuration: 2000, @@ -1660,7 +1697,7 @@ define('echarts/config',[],function() { // * Optimize. There is always room for speed improvements. // AMD by kener.linfeng@gmail.com -define('zrender/lib/excanvas',['require'],function(require) { +define('zrender/dep/excanvas',['require'],function(require) { // Only add this code if we do not already have a canvas implementation if (!document.createElement('canvas').getContext) { @@ -3086,7 +3123,7 @@ return G_vmlCanvasManager; * getContext:获取一个自由使用的canvas 2D context,使用原生方法,如isPointInPath,measureText等 */ define( - 'zrender/tool/util',['require','../lib/excanvas'],function(require) { + 'zrender/tool/util',['require','../dep/excanvas'],function(require) { // 用于处理merge时无法遍历Date等对象的问题 var BUILTIN_OBJECT = { '[object Function]': 1, @@ -3164,7 +3201,8 @@ define( function getContext() { if (!_ctx) { - require('../lib/excanvas'); + require('../dep/excanvas'); + /* jshint ignore:start */ if (G_vmlCanvasManager) { var _div = document.createElement('div'); _div.style.position = 'absolute'; @@ -3177,6 +3215,7 @@ define( else { _ctx = document.createElement('canvas').getContext('2d'); } + /* jshint ignore:end */ } return _ctx; } @@ -3258,11 +3297,11 @@ define( /** * 查询数组中元素的index */ - function indexOf(array, value){ + function indexOf(array, value) { if (array.indexOf) { return array.indexOf(value); } - for(var i = 0, len=array.length; i 3) { + args = Array.prototype.slice.call(args, 1); + } + + var _h = this._handlers[type]; + var len = _h.length; + for (var i = 0; i < len;) { + // Optimize advise from backbone + switch (argLen) { + case 1: + _h[i]['h'].call(_h[i]['ctx']); + break; + case 2: + _h[i]['h'].call(_h[i]['ctx'], args[1]); + break; + case 3: + _h[i]['h'].call(_h[i]['ctx'], args[1], args[2]); + break; + default: + // have more than 2 given arguments + _h[i]['h'].apply(_h[i]['ctx'], args); + break; + } + + if (_h[i]['one']) { + _h.splice(i, 1); + len--; + } + else { + i++; + } + } + } + + return this; + }; + + /** + * 带有context的事件分发, 最后一个参数是事件回调的context + * @param {string} type 事件类型 + */ + Eventful.prototype.dispatchWithContext = function (type) { + if (this._handlers[type]) { + var args = arguments; + var argLen = args.length; + + if (argLen > 4) { + args = Array.prototype.slice.call(args, 1, args.length - 1); + } + var ctx = args[args.length - 1]; + + var _h = this._handlers[type]; + var len = _h.length; + for (var i = 0; i < len;) { + // Optimize advise from backbone + switch (argLen) { + case 1: + _h[i]['h'].call(ctx); + break; + case 2: + _h[i]['h'].call(ctx, args[1]); + break; + case 3: + _h[i]['h'].call(ctx, args[1], args[2]); + break; + default: + // have more than 2 given arguments + _h[i]['h'].apply(ctx, args); + break; + } + + if (_h[i]['one']) { + _h.splice(i, 1); + len--; + } + else { + i++; + } + } + } + + return this; + }; + + // 对象可以通过 onxxxx 绑定事件 + /** + * @event module:zrender/mixin/Eventful#onclick + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#onmouseover + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#onmouseout + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#onmousemove + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#onmousewheel + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#onmousedown + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#onmouseup + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#ondragstart + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#ondragend + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#ondragenter + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#ondragleave + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#ondragover + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#ondrop + * @type {Function} + * @default null + */ + + return Eventful; +}); + +/** + * 事件辅助类 + * @module zrender/tool/event * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * getX:获取事件横坐标 - * getY:或者事件纵坐标 - * getDelta:或者鼠标滚轮变化 - * stop:停止事件传播 - * Dispatcher:事件分发器 */ define( - 'zrender/tool/event',[],function() { + 'zrender/tool/event',['require','../mixin/Eventful'],function(require) { + var Eventful = require('../mixin/Eventful'); + /** * 提取鼠标(手指)x坐标 - * + * @memberOf module:zrender/tool/event * @param {Event} e 事件. * @return {number} 鼠标(手指)x坐标. */ @@ -3332,7 +3635,7 @@ define( /** * 提取鼠标y坐标 - * + * @memberOf module:zrender/tool/event * @param {Event} e 事件. * @return {number} 鼠标(手指)y坐标. */ @@ -3345,229 +3648,40 @@ define( /** * 提取鼠标滚轮变化 - * + * @memberOf module:zrender/tool/event * @param {Event} e 事件. * @return {number} 滚轮变化,正值说明滚轮是向上滚动,如果是负值说明滚轮是向下滚动 */ function getDelta(e) { - return typeof e.wheelDelta != 'undefined' && e.wheelDelta + return typeof e.zrenderDelta != 'undefined' && e.zrenderDelta + || typeof e.wheelDelta != 'undefined' && e.wheelDelta || typeof e.detail != 'undefined' && -e.detail; } /** * 停止冒泡和阻止默认行为 - * - * @type {Function} + * @memberOf module:zrender/tool/event + * @method * @param {Event} e : event对象 */ var stop = typeof window.addEventListener === 'function' ? function (e) { e.preventDefault(); e.stopPropagation(); + e.cancelBubble = true; } : function (e) { e.returnValue = false; e.cancelBubble = true; }; - - /** - * 事件分发器 - */ - function Dispatcher() { - this._handlers = {}; - } - /** - * 单次触发绑定,dispatch后销毁 - * - * @param {string} event 事件字符串 - * @param {Function} handler 响应函数 - * @param {Object} [context] - */ - Dispatcher.prototype.one = function(event, handler, context) { - - var _h = this._handlers; - - if(!handler || !event) { - return this; - } - - if(!_h[event]) { - _h[event] = []; - } - - _h[event].push({ - h : handler, - one : true, - ctx: context || this - }); - - return this; - }; - - /** - * 事件绑定 - * - * @param {string} event 事件字符串 - * @param {Function} handler : 响应函数 - * @param {Object} [context] - */ - Dispatcher.prototype.bind = function(event, handler, context) { - - var _h = this._handlers; - - if(!handler || !event) { - return this; - } - - if(!_h[event]) { - _h[event] = []; - } - - _h[event].push({ - h : handler, - one : false, - ctx: context || this - }); - - return this; - }; - - /** - * 事件解绑定 - * - * @param {string} event 事件字符串 - * @param {Function} handler : 响应函数 - */ - Dispatcher.prototype.unbind = function(event, handler) { - - var _h = this._handlers; - - if(!event) { - this._handlers = {}; - return this; - } - - if(handler) { - if(_h[event]) { - var newList = []; - for (var i = 0, l = _h[event].length; i < l; i++) { - if (_h[event][i]['h'] != handler) { - newList.push(_h[event][i]); - } - } - _h[event] = newList; - } - - if(_h[event] && _h[event].length === 0) { - delete _h[event]; - } - } - else { - delete _h[event]; - } - - return this; - }; - - /** - * 事件分发 - * - * @param {string} type : 事件类型 - */ - Dispatcher.prototype.dispatch = function(type) { - var args = arguments; - var argLen = args.length; - - if (argLen > 3) { - args = Array.prototype.slice.call(args, 1); - } - - if(this._handlers[type]) { - var _h = this._handlers[type]; - var len = _h.length; - for (var i = 0; i < len;) { - // Optimize advise from backbone - switch (argLen) { - case 1: - _h[i]['h'].call(_h[i]['ctx']); - break; - case 2: - _h[i]['h'].call(_h[i]['ctx'], args[1]); - break; - case 3: - _h[i]['h'].call(_h[i]['ctx'], args[1], args[2]); - break; - default: - // have more than 2 given arguments - _h[i]['h'].apply(_h[i]['ctx'], args); - break; - } - - if (_h[i]['one']) { - _h.splice(i, 1); - len--; - } else { - i++; - } - } - } - - return this; - }; - - /** - * 带有context的事件分发, 最后一个参数是事件回调的context - * - * @param {string} type : 事件类型 - */ - Dispatcher.prototype.dispatchWithContext = function(type) { - var args = arguments; - var argLen = args.length; - - if (argLen > 4) { - args = Array.prototype.slice.call(args, 1, args.length - 1); - } - var ctx = args[args.length - 1]; - - if(this._handlers[type]) { - var _h = this._handlers[type]; - var len = _h.length; - for (var i = 0; i < len;) { - // Optimize advise from backbone - switch (argLen) { - case 1: - _h[i]['h'].call(ctx); - break; - case 2: - _h[i]['h'].call(ctx, args[1]); - break; - case 3: - _h[i]['h'].call(ctx, args[1], args[2]); - break; - default: - // have more than 2 given arguments - _h[i]['h'].apply(ctx, args); - break; - } - - if (_h[i]['one']) { - _h.splice(i, 1); - len--; - } else { - i++; - } - } - } - - return this; - }; - + return { getX : getX, getY : getY, getDelta : getDelta, stop : stop, - Dispatcher : Dispatcher + // 做向上兼容 + Dispatcher : Eventful }; } ); @@ -3584,7 +3698,7 @@ define('zrender/tool/env',[],function() { // (c) 2010-2013 Thomas Fuchs // Zepto.js may be freely distributed under the MIT license. - function detect( ua ) { + function detect(ua) { var os = this.os = {}; var browser = this.browser = {}; var webkit = ua.match(/Web[kK]it[\/]{0,1}([\d.]+)/); @@ -3647,44 +3761,110 @@ define('zrender/tool/env',[],function() { // 原生canvas支持 canvasSupported : document.createElement('canvas').getContext ? true : false - } + }; } - return detect( navigator.userAgent ); + return detect(navigator.userAgent); }); -/** - * zrender: config默认配置项 - * - * @desc zrender是一个轻量级的Canvas类库,MVC封装,数据驱动,提供类Dom事件模型。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define( - 'zrender/config',{ - EVENT : { // 支持事件列表 - RESIZE : 'resize', // 窗口大小变化 - CLICK : 'click', // 鼠标按钮被(手指)按下,事件对象是:目标图形元素或空 - - MOUSEWHEEL : 'mousewheel', // 鼠标滚轮变化,事件对象是:目标图形元素或空 - MOUSEMOVE : 'mousemove', // 鼠标(手指)被移动,事件对象是:目标图形元素或空 - MOUSEOVER : 'mouseover', // 鼠标移到某图形元素之上,事件对象是:目标图形元素 - MOUSEOUT : 'mouseout', // 鼠标从某图形元素移开,事件对象是:目标图形元素 - MOUSEDOWN : 'mousedown', // 鼠标按钮(手指)被按下,事件对象是:目标图形元素或空 - MOUSEUP : 'mouseup', // 鼠标按键(手指)被松开,事件对象是:目标图形元素或空 - - // - GLOBALOUT : 'globalout', // 全局离开,MOUSEOUT触发比较频繁,一次离开优化绑定 +define('zrender/config',[],function () { + /** + * config默认配置项 + * @exports zrender/config + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + */ + var config = { + /** + * @namespace module:zrender/config.EVENT + */ + EVENT : { + /** + * 窗口大小变化 + * @type {string} + */ + RESIZE : 'resize', + /** + * 鼠标按钮被(手指)按下,事件对象是:目标图形元素或空 + * @type {string} + */ + CLICK : 'click', + /** + * 双击事件 + * @type {string} + */ + DBLCLICK : 'dblclick', + /** + * 鼠标滚轮变化,事件对象是:目标图形元素或空 + * @type {string} + */ + MOUSEWHEEL : 'mousewheel', + /** + * 鼠标(手指)被移动,事件对象是:目标图形元素或空 + * @type {string} + */ + MOUSEMOVE : 'mousemove', + /** + * 鼠标移到某图形元素之上,事件对象是:目标图形元素 + * @type {string} + */ + MOUSEOVER : 'mouseover', + /** + * 鼠标从某图形元素移开,事件对象是:目标图形元素 + * @type {string} + */ + MOUSEOUT : 'mouseout', + /** + * 鼠标按钮(手指)被按下,事件对象是:目标图形元素或空 + * @type {string} + */ + MOUSEDOWN : 'mousedown', + /** + * 鼠标按键(手指)被松开,事件对象是:目标图形元素或空 + * @type {string} + */ + MOUSEUP : 'mouseup', + /** + * 全局离开,MOUSEOUT触发比较频繁,一次离开优化绑定 + * @type {string} + */ + GLOBALOUT : 'globalout', // // 一次成功元素拖拽的行为事件过程是: // dragstart > dragenter > dragover [> dragleave] > drop > dragend - DRAGSTART : 'dragstart', // 开始拖拽时触发,事件对象是:被拖拽图形元素 - DRAGEND : 'dragend', // 拖拽完毕时触发(在drop之后触发),事件对象是:被拖拽图形元素 - DRAGENTER : 'dragenter', // 拖拽图形元素进入目标图形元素时触发,事件对象是:目标图形元素 - DRAGOVER : 'dragover', // 拖拽图形元素在目标图形元素上移动时触发,事件对象是:目标图形元素 - DRAGLEAVE : 'dragleave', // 拖拽图形元素离开目标图形元素时触发,事件对象是:目标图形元素 - DROP : 'drop', // 拖拽图形元素放在目标图形元素内时触发,事件对象是:目标图形元素 - - touchClickDelay : 300 // touch end - start < delay is click + /** + * 开始拖拽时触发,事件对象是:被拖拽图形元素 + * @type {string} + */ + DRAGSTART : 'dragstart', + /** + * 拖拽完毕时触发(在drop之后触发),事件对象是:被拖拽图形元素 + * @type {string} + */ + DRAGEND : 'dragend', + /** + * 拖拽图形元素进入目标图形元素时触发,事件对象是:目标图形元素 + * @type {string} + */ + DRAGENTER : 'dragenter', + /** + * 拖拽图形元素在目标图形元素上移动时触发,事件对象是:目标图形元素 + * @type {string} + */ + DRAGOVER : 'dragover', + /** + * 拖拽图形元素离开目标图形元素时触发,事件对象是:目标图形元素 + * @type {string} + */ + DRAGLEAVE : 'dragleave', + /** + * 拖拽图形元素放在目标图形元素内时触发,事件对象是:目标图形元素 + * @type {string} + */ + DROP : 'drop', + /** + * touch end - start < delay is click + * @type {number} + */ + touchClickDelay : 300 }, // 是否异常捕获 @@ -3697,18 +3877,19 @@ define( * 2 : 控制台输出,调试用 */ debugMode: 0 - } -); -/** - * zrender: 日志记录 - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - */ + }; + return config; +}); + define( 'zrender/tool/log',['require','../config'],function (require) { var config = require('../config'); + /** + * @exports zrender/tool/log + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + */ return function() { if (config.debugMode === 0) { return; @@ -3752,15 +3933,450 @@ define( } ); +define( + 'zrender/tool/vector',[],function () { + var ArrayCtor = typeof Float32Array === 'undefined' + ? Array + : Float32Array; + /** + * 二维向量类 + * @exports zrender/tool/vector + */ + var vector = { + /** + * 创建一个向量 + * @param {number} [x=0] + * @param {number} [y=0] + * @return {Float32Array|Array.} + */ + create: function (x, y) { + var out = new ArrayCtor(2); + out[0] = x || 0; + out[1] = y || 0; + return out; + }, + + /** + * 复制一个向量 + * @return {Float32Array|Array.} out + * @return {Float32Array|Array.} v + */ + copy: function (out, v) { + out[0] = v[0]; + out[1] = v[1]; + return out; + }, + + /** + * 设置向量的两个项 + * @param {Float32Array|Array.} out + * @param {number} a + * @param {number} b + * @return {Float32Array|Array.} 结果 + */ + set: function (out, a, b) { + out[0] = a; + out[1] = b; + return out; + }, + + /** + * 向量相加 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + */ + add: function (out, v1, v2) { + out[0] = v1[0] + v2[0]; + out[1] = v1[1] + v2[1]; + return out; + }, + + /** + * 向量缩放后相加 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + * @param {number} a + */ + scaleAndAdd: function (out, v1, v2, a) { + out[0] = v1[0] + v2[0] * a; + out[1] = v1[1] + v2[1] * a; + return out; + }, + + /** + * 向量相减 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + */ + sub: function (out, v1, v2) { + out[0] = v1[0] - v2[0]; + out[1] = v1[1] - v2[1]; + return out; + }, + + /** + * 向量长度 + * @param {Float32Array|Array.} v + * @return {number} + */ + len: function (v) { + return Math.sqrt(this.lenSquare(v)); + }, + + /** + * 向量长度平方 + * @param {Float32Array|Array.} v + * @return {number} + */ + lenSquare: function (v) { + return v[0] * v[0] + v[1] * v[1]; + }, + + /** + * 向量乘法 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + */ + mul: function (out, v1, v2) { + out[0] = v1[0] * v2[0]; + out[1] = v1[1] * v2[1]; + return out; + }, + + /** + * 向量除法 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + */ + div: function (out, v1, v2) { + out[0] = v1[0] / v2[0]; + out[1] = v1[1] / v2[1]; + return out; + }, + + /** + * 向量点乘 + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + * @return {number} + */ + dot: function (v1, v2) { + return v1[0] * v2[0] + v1[1] * v2[1]; + }, + + /** + * 向量缩放 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v + * @param {number} s + */ + scale: function (out, v, s) { + out[0] = v[0] * s; + out[1] = v[1] * s; + return out; + }, + + /** + * 向量归一化 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v + */ + normalize: function (out, v) { + var d = vector.len(v); + if (d === 0) { + out[0] = 0; + out[1] = 0; + } + else { + out[0] = v[0] / d; + out[1] = v[1] / d; + } + return out; + }, + + /** + * 计算向量间距离 + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + * @return {number} + */ + distance: function (v1, v2) { + return Math.sqrt( + (v1[0] - v2[0]) * (v1[0] - v2[0]) + + (v1[1] - v2[1]) * (v1[1] - v2[1]) + ); + }, + + /** + * 向量距离平方 + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + * @return {number} + */ + distanceSquare: function (v1, v2) { + return (v1[0] - v2[0]) * (v1[0] - v2[0]) + + (v1[1] - v2[1]) * (v1[1] - v2[1]); + }, + + /** + * 求负向量 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v + */ + negate: function (out, v) { + out[0] = -v[0]; + out[1] = -v[1]; + return out; + }, + + /** + * 插值两个点 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + * @param {number} t + */ + lerp: function (out, v1, v2, t) { + // var ax = v1[0]; + // var ay = v1[1]; + out[0] = v1[0] + t * (v2[0] - v1[0]); + out[1] = v1[1] + t * (v2[1] - v1[1]); + return out; + }, + + /** + * 矩阵左乘向量 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v + * @param {Float32Array|Array.} m + */ + applyTransform: function (out, v, m) { + var x = v[0]; + var y = v[1]; + out[0] = m[0] * x + m[2] * y + m[4]; + out[1] = m[1] * x + m[3] * y + m[5]; + return out; + }, + /** + * 求两个向量最小值 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + */ + min: function (out, v1, v2) { + out[0] = Math.min(v1[0], v2[0]); + out[1] = Math.min(v1[1], v2[1]); + return out; + }, + /** + * 求两个向量最大值 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + */ + max: function (out, v1, v2) { + out[0] = Math.max(v1[0], v2[0]); + out[1] = Math.max(v1[1], v2[1]); + return out; + } + }; + + vector.length = vector.len; + vector.lengthSquare = vector.lenSquare; + vector.dist = vector.distance; + vector.distSquare = vector.distanceSquare; + + return vector; + } +); + +define( + 'zrender/tool/matrix',[],function () { + + var ArrayCtor = typeof Float32Array === 'undefined' + ? Array + : Float32Array; + /** + * 3x2矩阵操作类 + * @exports zrender/tool/matrix + */ + var matrix = { + /** + * 创建一个单位矩阵 + * @return {Float32Array|Array.} + */ + create : function() { + var out = new ArrayCtor(6); + matrix.identity(out); + + return out; + }, + /** + * 设置矩阵为单位矩阵 + * @param {Float32Array|Array.} out + */ + identity : function(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = 0; + out[5] = 0; + return out; + }, + /** + * 复制矩阵 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} m + */ + copy: function(out, m) { + out[0] = m[0]; + out[1] = m[1]; + out[2] = m[2]; + out[3] = m[3]; + out[4] = m[4]; + out[5] = m[5]; + return out; + }, + /** + * 矩阵相乘 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} m1 + * @param {Float32Array|Array.} m2 + */ + mul : function (out, m1, m2) { + out[0] = m1[0] * m2[0] + m1[2] * m2[1]; + out[1] = m1[1] * m2[0] + m1[3] * m2[1]; + out[2] = m1[0] * m2[2] + m1[2] * m2[3]; + out[3] = m1[1] * m2[2] + m1[3] * m2[3]; + out[4] = m1[0] * m2[4] + m1[2] * m2[5] + m1[4]; + out[5] = m1[1] * m2[4] + m1[3] * m2[5] + m1[5]; + return out; + }, + /** + * 平移变换 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} a + * @param {Float32Array|Array.} v + */ + translate : function(out, a, v) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4] + v[0]; + out[5] = a[5] + v[1]; + return out; + }, + /** + * 旋转变换 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} a + * @param {number} rad + */ + rotate : function(out, a, rad) { + var aa = a[0]; + var ac = a[2]; + var atx = a[4]; + var ab = a[1]; + var ad = a[3]; + var aty = a[5]; + var st = Math.sin(rad); + var ct = Math.cos(rad); + + out[0] = aa * ct + ab * st; + out[1] = -aa * st + ab * ct; + out[2] = ac * ct + ad * st; + out[3] = -ac * st + ct * ad; + out[4] = ct * atx + st * aty; + out[5] = ct * aty - st * atx; + return out; + }, + /** + * 缩放变换 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} a + * @param {Float32Array|Array.} v + */ + scale : function(out, a, v) { + var vx = v[0]; + var vy = v[1]; + out[0] = a[0] * vx; + out[1] = a[1] * vy; + out[2] = a[2] * vx; + out[3] = a[3] * vy; + out[4] = a[4] * vx; + out[5] = a[5] * vy; + return out; + }, + /** + * 求逆矩阵 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} a + */ + invert : function(out, a) { + + var aa = a[0]; + var ac = a[2]; + var atx = a[4]; + var ab = a[1]; + var ad = a[3]; + var aty = a[5]; + + var det = aa * ad - ab * ac; + if (!det) { + return null; + } + det = 1.0 / det; + + out[0] = ad * det; + out[1] = -ab * det; + out[2] = -ac * det; + out[3] = aa * det; + out[4] = (ac * aty - ad * atx) * det; + out[5] = (ab * atx - aa * aty) * det; + return out; + }, + + /** + * 矩阵左乘向量 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} a + * @param {Float32Array|Array.} v + */ + mulVector : function(out, a, v) { + var aa = a[0]; + var ac = a[2]; + var atx = a[4]; + var ab = a[1]; + var ad = a[3]; + var aty = a[5]; + + out[0] = v[0] * aa + v[1] * ac + atx; + out[1] = v[0] * ab + v[1] * ad + aty; + + return out; + } + }; + + return matrix; + } +); + /** * Handler控制模块 - * + * @module zrender/Handler * @author Kener (@Kener-林峰, linzhifeng@baidu.com) * errorrik (errorrik@gmail.com) */ define( - 'zrender/Handler',['require','./config','./tool/env','./tool/event','./tool/util'],function (require) { + 'zrender/Handler',['require','./config','./tool/env','./tool/event','./tool/util','./tool/vector','./tool/matrix','./mixin/Eventful'],function (require) { @@ -3768,10 +4384,14 @@ define( var env = require('./tool/env'); var eventTool = require('./tool/event'); var util = require('./tool/util'); + var vec2 = require('./tool/vector'); + var mat2d = require('./tool/matrix'); var EVENT = config.EVENT; + var Eventful = require('./mixin/Eventful'); + var domHandlerNames = [ - 'resize', 'click', + 'resize', 'click', 'dblclick', 'mousewheel', 'mousemove', 'mouseout', 'mouseup', 'mousedown', 'touchstart', 'touchend', 'touchmove' ]; @@ -3779,8 +4399,8 @@ define( var domHandlers = { /** * 窗口大小改变响应函数 - * - * @param {event} event dom事件对象 + * @inner + * @param {Event} event */ resize: function (event) { event = event || window.event; @@ -3793,15 +4413,15 @@ define( /** * 点击响应函数 - * - * @param {event} event dom事件对象 + * @inner + * @param {Event} event */ click: function (event) { event = this._zrenderEventFixed(event); - //分发config.EVENT.CLICK事件 + // 分发config.EVENT.CLICK事件 var _lastHover = this._lastHover; - if (( _lastHover && _lastHover.clickable ) + if ((_lastHover && _lastHover.clickable) || !_lastHover ) { this._dispatchAgency(_lastHover, EVENT.CLICK, event); @@ -3809,24 +4429,81 @@ define( this._mousemoveHandler(event); }, + + /** + * 双击响应函数 + * @inner + * @param {Event} event + */ + dblclick: function (event) { + event = this._zrenderEventFixed(event); + + // 分发config.EVENT.DBLCLICK事件 + var _lastHover = this._lastHover; + if ((_lastHover && _lastHover.clickable) + || !_lastHover + ) { + this._dispatchAgency(_lastHover, EVENT.DBLCLICK, event); + } + + this._mousemoveHandler(event); + }, + /** * 鼠标滚轮响应函数 - * - * @param {event} event dom事件对象 + * @inner + * @param {Event} event */ mousewheel: function (event) { event = this._zrenderEventFixed(event); - //分发config.EVENT.MOUSEWHEEL事件 + // http://www.sitepoint.com/html5-javascript-mouse-wheel/ + // https://developer.mozilla.org/en-US/docs/DOM/DOM_event_reference/mousewheel + var delta = event.wheelDelta // Webkit + || -event.detail; // Firefox + var scale = delta > 0 ? 1.1 : 1 / 1.1; + + var layers = this.painter.getLayers(); + + var needsRefresh = false; + for (var z in layers) { + if (z !== 'hover') { + var layer = layers[z]; + var pos = layer.position; + if (layer.zoomable) { + layer.__zoom = layer.__zoom || 1; + var newZoom = layer.__zoom; + newZoom *= scale; + newZoom = Math.max( + Math.min(layer.maxZoom, newZoom), + layer.minZoom + ); + scale = newZoom / layer.__zoom; + layer.__zoom = newZoom; + // Keep the mouse center when scaling + pos[0] -= (this._mouseX - pos[0]) * (scale - 1); + pos[1] -= (this._mouseY - pos[1]) * (scale - 1); + layer.scale[0] *= scale; + layer.scale[1] *= scale; + layer.dirty = true; + needsRefresh = true; + } + } + } + if (needsRefresh) { + this.painter.refresh(); + } + + // 分发config.EVENT.MOUSEWHEEL事件 this._dispatchAgency(this._lastHover, EVENT.MOUSEWHEEL, event); this._mousemoveHandler(event); }, /** * 鼠标(手指)移动响应函数 - * - * @param {event} event dom事件对象 + * @inner + * @param {Event} event */ mousemove: function (event) { if (this.painter.isLoading()) { @@ -3838,15 +4515,18 @@ define( this._lastY = this._mouseY; this._mouseX = eventTool.getX(event); this._mouseY = eventTool.getY(event); + var dx = this._mouseX - this._lastX; + var dy = this._mouseY - this._lastY; // 可能出现config.EVENT.DRAGSTART事件 // 避免手抖点击误认为拖拽 - //if (this._mouseX - this._lastX > 1 || this._mouseY - this._lastY > 1) { - this._processDragStart(event); - //} + // if (this._mouseX - this._lastX > 1 || this._mouseY - this._lastY > 1) { + this._processDragStart(event); + // } this._hasfound = 0; this._event = event; - this.storage.iterShape(this._findHover, { normal: 'down'}); + + this._iterateAndFindHover(); // 找到的在迭代函数里做了处理,没找到得在迭代完后处理 if (!this._hasfound) { @@ -3865,18 +4545,39 @@ define( this.storage.delHover(); this.painter.clearHover(); } - //如果存在拖拽中元素,被拖拽的图形元素最后addHover + + // set cursor for root element + var cursor = 'default'; + + // 如果存在拖拽中元素,被拖拽的图形元素最后addHover if (this._draggingTarget) { - this.storage.drift( - this._draggingTarget.id, - this._mouseX - this._lastX, - this._mouseY - this._lastY - ); + this.storage.drift(this._draggingTarget.id, dx, dy); this.storage.addHover(this._draggingTarget); } + else if (this._isMouseDown) { + // Layer dragging + var layers = this.painter.getLayers(); + + var needsRefresh = false; + for (var z in layers) { + if (z !== 'hover') { + var layer = layers[z]; + if (layer.panable) { + // PENDING + cursor = 'move'; + // Keep the mouse center when scaling + layer.position[0] += dx; + layer.position[1] += dy; + needsRefresh = true; + layer.dirty = true; + } + } + } + if (needsRefresh) { + this.painter.refresh(); + } + } - // set cursor for root element - var cursor = 'default'; if (this._draggingTarget || (this._hasfound && this._lastHover.draggable)) { cursor = 'move'; } @@ -3895,8 +4596,8 @@ define( /** * 鼠标(手指)离开响应函数 - * - * @param {event} event dom事件对象 + * @inner + * @param {Event} event */ mouseout: function (event) { event = this._zrenderEventFixed(event); @@ -3931,8 +4632,8 @@ define( /** * 鼠标(手指)按下响应函数 - * - * @param {event} event dom事件对象 + * @inner + * @param {Event} event */ mousedown: function (event) { if (this._lastDownButton == 2) { @@ -3946,7 +4647,7 @@ define( event = this._zrenderEventFixed(event); this._isMouseDown = 1; - //分发config.EVENT.MOUSEDOWN事件 + // 分发config.EVENT.MOUSEDOWN事件 this._mouseDownTarget = this._lastHover; this._dispatchAgency(this._lastHover, EVENT.MOUSEDOWN, event); this._lastDownButton = event.button; @@ -3954,16 +4655,16 @@ define( /** * 鼠标(手指)抬起响应函数 - * - * @param {event} event dom事件对象 + * @inner + * @param {Event} event */ - mouseup:function (event) { + mouseup: function (event) { event = this._zrenderEventFixed(event); this.root.style.cursor = 'default'; this._isMouseDown = 0; this._mouseDownTarget = null; - //分发config.EVENT.MOUSEUP事件 + // 分发config.EVENT.MOUSEUP事件 this._dispatchAgency(this._lastHover, EVENT.MOUSEUP, event); this._processDrop(event); this._processDragEnd(event); @@ -3971,23 +4672,23 @@ define( /** * Touch开始响应函数 - * - * @param {event} event dom事件对象 + * @inner + * @param {Event} event */ touchstart: function (event) { - //eventTool.stop(event);// 阻止浏览器默认事件,重要 + // eventTool.stop(event);// 阻止浏览器默认事件,重要 event = this._zrenderEventFixed(event, true); this._lastTouchMoment = new Date(); - //平板补充一次findHover + // 平板补充一次findHover this._mobildFindFixed(event); this._mousedownHandler(event); }, /** * Touch移动响应函数 - * - * @param {event} event dom事件对象 + * @inner + * @param {Event} event */ touchmove: function (event) { event = this._zrenderEventFixed(event, true); @@ -3999,17 +4700,25 @@ define( /** * Touch结束响应函数 - * - * @param {event} event dom事件对象 + * @inner + * @param {Event} event */ touchend: function (event) { - //eventTool.stop(event);// 阻止浏览器默认事件,重要 + // eventTool.stop(event);// 阻止浏览器默认事件,重要 event = this._zrenderEventFixed(event, true); this._mouseupHandler(event); - - if (new Date() - this._lastTouchMoment < EVENT.touchClickDelay) { + + var now = new Date(); + if (now - this._lastTouchMoment < EVENT.touchClickDelay) { this._mobildFindFixed(event); this._clickHandler(event); + if (now - this._lastClickMoment < EVENT.touchClickDelay / 2) { + this._dblclickHandler(event); + if (this._lastHover && this._lastHover.clickable) { + eventTool.stop(event);// 阻止浏览器默认事件,重要 + } + } + this._lastClickMoment = now; } this.painter.clearHover(); } @@ -4023,38 +4732,47 @@ define( * @param {Object} context 运行时this环境 * @return {Function} */ - function bind1Arg( handler, context ) { - return function ( e ) { - return handler.call( context, e ); + function bind1Arg(handler, context) { + return function (e) { + return handler.call(context, e); }; } + /**function bind2Arg(handler, context) { + return function (arg1, arg2) { + return handler.call(context, arg1, arg2); + }; + }*/ + function bind3Arg(handler, context) { + return function (arg1, arg2, arg3) { + return handler.call(context, arg1, arg2, arg3); + }; + } /** * 为控制类实例初始化dom 事件处理函数 * * @inner - * @param {Handler} instance 控制类实例 + * @param {module:zrender/Handler} instance 控制类实例 */ - function initDomHandler( instance ) { + function initDomHandler(instance) { var len = domHandlerNames.length; - while ( len-- ) { - var name = domHandlerNames[ len ]; - instance[ '_' + name + 'Handler' ] = bind1Arg( domHandlers[ name ], instance ); + while (len--) { + var name = domHandlerNames[len]; + instance['_' + name + 'Handler'] = bind1Arg(domHandlers[name], instance); } } /** - * 控制类 (C) - * + * @alias module:zrender/Handler + * @constructor + * @extends module:zrender/mixin/Eventful * @param {HTMLElement} root 绘图区域 - * @param {storage} storage Storage实例 - * @param {painter} painter Painter实例 - * - * 分发事件支持详见config.EVENT + * @param {module:zrender/Storage} storage Storage实例 + * @param {module:zrender/Painter} painter Painter实例 */ - function Handler(root, storage, painter) { + var Handler = function(root, storage, painter) { // 添加事件分发器特性 - eventTool.Dispatcher.call(this); + Eventful.call(this); this.root = root; this.storage = storage; @@ -4076,7 +4794,7 @@ define( this._mouseX = this._mouseY = 0; - this._findHover = bind1Arg(findHover, this); + this._findHover = bind3Arg(findHover, this); this._domHover = painter.getDomHover(); initDomHandler(this); @@ -4093,6 +4811,7 @@ define( else { // mobile的click/move/up/down自己模拟 root.addEventListener('click', this._clickHandler); + root.addEventListener('dblclick', this._dblclickHandler); root.addEventListener('mousewheel', this._mousewheelHandler); root.addEventListener('mousemove', this._mousemoveHandler); root.addEventListener('mousedown', this._mousedownHandler); @@ -4105,13 +4824,14 @@ define( window.attachEvent('onresize', this._resizeHandler); root.attachEvent('onclick', this._clickHandler); + root.attachEvent('ondblclick ', this._dblclickHandler); root.attachEvent('onmousewheel', this._mousewheelHandler); root.attachEvent('onmousemove', this._mousemoveHandler); root.attachEvent('onmouseout', this._mouseoutHandler); root.attachEvent('onmousedown', this._mousedownHandler); root.attachEvent('onmouseup', this._mouseupHandler); } - } + }; /** * 自定义事件绑定 @@ -4142,6 +4862,7 @@ define( switch (eventName) { case EVENT.RESIZE: case EVENT.CLICK: + case EVENT.DBLCLICK: case EVENT.MOUSEWHEEL: case EVENT.MOUSEMOVE: case EVENT.MOUSEDOWN: @@ -4153,7 +4874,7 @@ define( }; /** - * 释放 + * 释放,解绑所有事件 */ Handler.prototype.dispose = function () { var root = this.root; @@ -4170,6 +4891,7 @@ define( else { // mobile的click自己模拟 root.removeEventListener('click', this._clickHandler); + root.removeEventListener('dblclick', this._dblclickHandler); root.removeEventListener('mousewheel', this._mousewheelHandler); root.removeEventListener('mousemove', this._mousemoveHandler); root.removeEventListener('mousedown', this._mousedownHandler); @@ -4182,6 +4904,7 @@ define( window.detachEvent('onresize', this._resizeHandler); root.detachEvent('onclick', this._clickHandler); + root.detachEvent('dblclick', this._dblclickHandler); root.detachEvent('onmousewheel', this._mousewheelHandler); root.detachEvent('onmousemove', this._mousemoveHandler); root.detachEvent('onmouseout', this._mouseoutHandler); @@ -4226,7 +4949,7 @@ define( _draggingTarget.invisible = true; this.storage.mod(_draggingTarget.id); - //分发config.EVENT.DRAGSTART事件 + // 分发config.EVENT.DRAGSTART事件 this._dispatchAgency( _draggingTarget, EVENT.DRAGSTART, @@ -4244,7 +4967,7 @@ define( */ Handler.prototype._processDragEnter = function (event) { if (this._draggingTarget) { - //分发config.EVENT.DRAGENTER事件 + // 分发config.EVENT.DRAGENTER事件 this._dispatchAgency( this._lastHover, EVENT.DRAGENTER, @@ -4262,7 +4985,7 @@ define( */ Handler.prototype._processDragOver = function (event) { if (this._draggingTarget) { - //分发config.EVENT.DRAGOVER事件 + // 分发config.EVENT.DRAGOVER事件 this._dispatchAgency( this._lastHover, EVENT.DRAGOVER, @@ -4280,7 +5003,7 @@ define( */ Handler.prototype._processDragLeave = function (event) { if (this._draggingTarget) { - //分发config.EVENT.DRAGLEAVE事件 + // 分发config.EVENT.DRAGLEAVE事件 this._dispatchAgency( this._lastHover, EVENT.DRAGLEAVE, @@ -4302,7 +5025,7 @@ define( this.storage.mod(this._draggingTarget.id); this.painter.refresh(); - //分发config.EVENT.DROP事件 + // 分发config.EVENT.DROP事件 this._dispatchAgency( this._lastHover, EVENT.DROP, @@ -4320,7 +5043,7 @@ define( */ Handler.prototype._processDragEnd = function (event) { if (this._draggingTarget) { - //分发config.EVENT.DRAGEND事件 + // 分发config.EVENT.DRAGEND事件 this._dispatchAgency( this._draggingTarget, EVENT.DRAGEND, @@ -4341,7 +5064,7 @@ define( * @param {Object} event 事件对象 */ Handler.prototype._processOverShape = function (event) { - //分发config.EVENT.MOUSEOVER事件 + // 分发config.EVENT.MOUSEOVER事件 this._dispatchAgency(this._lastHover, EVENT.MOUSEOVER, event); }; @@ -4352,7 +5075,7 @@ define( * @param {Object} event 事件对象 */ Handler.prototype._processOutShape = function (event) { - //分发config.EVENT.MOUSEOUT事件 + // 分发config.EVENT.MOUSEOUT事件 this._dispatchAgency(this._lastHover, EVENT.MOUSEOUT, event); }; @@ -4381,7 +5104,8 @@ define( } while (el) { - el[eventHandler] && el[eventHandler](eventPacket); + el[eventHandler] + && (eventPacket.cancelBubble = el[eventHandler](eventPacket)); el.dispatch(eventName, eventPacket); el = el.parent; @@ -4398,20 +5122,53 @@ define( } } else if (!draggedShape) { - //无hover目标,无拖拽对象,原生事件分发 + // 无hover目标,无拖拽对象,原生事件分发 this.dispatch(eventName, { type: eventName, event: event }); } }; + + /** + * 迭代寻找hover shape + * @private + * @method + */ + Handler.prototype._iterateAndFindHover = (function() { + var invTransform = mat2d.create(); + return function() { + var list = this.storage.getShapeList(); + var currentZLevel; + var currentLayer; + var tmp = [ 0, 0 ]; + for (var i = list.length - 1; i >= 0 ; i--) { + var shape = list[i]; + + if (currentZLevel !== shape.zlevel) { + currentLayer = this.painter.getLayer(shape.zlevel, currentLayer); + tmp[0] = this._mouseX; + tmp[1] = this._mouseY; + + if (currentLayer.needTransform) { + mat2d.invert(invTransform, currentLayer.transform); + vec2.applyTransform(tmp, tmp, invTransform); + } + } + + if (this._findHover(shape, tmp[0], tmp[1])) { + break; + } + } + }; + })(); // touch指尖错觉的尝试偏移量配置 var MOBILE_TOUCH_OFFSETS = [ { x: 10 }, { x: -20 }, - { x: 10, y: 10}, - { y: -20} + { x: 10, y: 10 }, + { y: -20 } ]; // touch有指尖错觉,四向尝试,让touch上的点击更好触发事件 @@ -4421,12 +5178,15 @@ define( this._mouseY = event.zrenderY; this._event = event; - this.storage.iterShape(this._findHover, { normal: 'down'}); - for ( var i = 0; !this._lastHover && i < MOBILE_TOUCH_OFFSETS.length ; i++ ) { + + this._iterateAndFindHover(); + + for (var i = 0; !this._lastHover && i < MOBILE_TOUCH_OFFSETS.length ; i++) { var offset = MOBILE_TOUCH_OFFSETS[ i ]; - offset.x && ( this._mouseX += offset.x ); - offset.y && ( this._mouseX += offset.y ); - this.storage.iterShape(this._findHover, { normal: 'down'}); + offset.x && (this._mouseX += offset.x); + offset.y && (this._mouseX += offset.y); + + this._iterateAndFindHover(); } if (this._lastHover) { @@ -4438,19 +5198,21 @@ define( /** * 迭代函数,查找hover到的图形元素并即时做些事件分发 * - * @private - * @param {Object} e 图形元素 + * @inner + * @param {Object} shape 图形元素 + * @param {number} x + * @param {number} y */ - function findHover(shape) { + function findHover(shape, x, y) { if ( - ( this._draggingTarget && this._draggingTarget.id == shape.id ) //迭代到当前拖拽的图形上 + (this._draggingTarget && this._draggingTarget.id == shape.id) // 迭代到当前拖拽的图形上 || shape.isSilent() // 打酱油的路过,啥都不响应的shape~ ) { return false; } var event = this._event; - if (shape.isCover(this._mouseX, this._mouseY)) { + if (shape.isCover(x, y)) { if (shape.hoverable) { this.storage.addHover(shape); } @@ -4467,23 +5229,23 @@ define( if (this._lastHover != shape) { this._processOutShape(event); - //可能出现config.EVENT.DRAGLEAVE事件 + // 可能出现config.EVENT.DRAGLEAVE事件 this._processDragLeave(event); this._lastHover = shape; - //可能出现config.EVENT.DRAGENTER事件 + // 可能出现config.EVENT.DRAGENTER事件 this._processDragEnter(event); } this._processOverShape(event); - //可能出现config.EVENT.DRAGOVER + // 可能出现config.EVENT.DRAGOVER this._processDragOver(event); this._hasfound = 1; - return true; //找到则中断迭代查找 + return true; // 找到则中断迭代查找 } return false; @@ -4495,7 +5257,7 @@ define( * @private */ Handler.prototype._zrenderEventFixed = function (event, isTouch) { - if ( event.zrenderFixed ) { + if (event.zrenderFixed) { return event; } @@ -4534,3088 +5296,3358 @@ define( return event; }; - util.merge(Handler.prototype, eventTool.Dispatcher.prototype, true); + util.merge(Handler.prototype, Eventful.prototype, true); return Handler; } ); /** - * zrender: 3x2矩阵操作类 - * - * author: https://github.com/pissang + * @module zrender/tool/curve + * @author pissang(https://www.github.com/pissang) */ +define('zrender/tool/curve',['require','./vector'],function(require) { -define( - 'zrender/tool/matrix',[],function() { - - var ArrayCtor = typeof Float32Array === 'undefined' - ? Array - : Float32Array; - - var matrix = { - create : function() { - var out = new ArrayCtor(6); - matrix.identity(out); - - return out; - }, - identity : function(out) { - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 1; - out[4] = 0; - out[5] = 0; - }, - copy: function(out, m) { - out[0] = m[0]; - out[1] = m[1]; - out[2] = m[2]; - out[3] = m[3]; - out[4] = m[4]; - out[5] = m[5]; - }, - mul : function(out, m1, m2) { - out[0] = m1[0] * m2[0] + m1[2] * m2[1]; - out[1] = m1[1] * m2[0] + m1[3] * m2[1]; - out[2] = m1[0] * m2[2] + m1[2] * m2[3]; - out[3] = m1[1] * m2[2] + m1[3] * m2[3]; - out[4] = m1[0] * m2[4] + m1[2] * m2[5] + m1[4]; - out[5] = m1[1] * m2[4] + m1[3] * m2[5] + m1[5]; - return out; - }, - translate : function(out, a, v) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4] + v[0]; - out[5] = a[5] + v[1]; - return out; - }, - rotate : function(out, a, rad) { - var aa = a[0], ac = a[2], atx = a[4]; - var ab = a[1], ad = a[3], aty = a[5]; - var st = Math.sin(rad); - var ct = Math.cos(rad); - - out[0] = aa*ct + ab*st; - out[1] = -aa*st + ab*ct; - out[2] = ac*ct + ad*st; - out[3] = -ac*st + ct*ad; - out[4] = ct*atx + st*aty; - out[5] = ct*aty - st*atx; - return out; - }, - scale : function(out, a, v) { - var vx = v[0], vy = v[1]; - out[0] = a[0] * vx; - out[1] = a[1] * vy; - out[2] = a[2] * vx; - out[3] = a[3] * vy; - out[4] = a[4] * vx; - out[5] = a[5] * vy; - return out; - }, - /** - * 求逆矩阵 - */ - invert : function(out, a) { - - var aa = a[0], ac = a[2], atx = a[4]; - var ab = a[1], ad = a[3], aty = a[5]; - - var det = aa * ad - ab * ac; - if(!det){ - return null; - } - det = 1.0 / det; + var vector = require('./vector'); - out[0] = ad * det; - out[1] = -ab * det; - out[2] = -ac * det; - out[3] = aa * det; - out[4] = (ac * aty - ad * atx) * det; - out[5] = (ab * atx - aa * aty) * det; - return out; - }, + - /** - * 矩阵左乘向量 - */ - mulVector : function(out, a, v) { - var aa = a[0], ac = a[2], atx = a[4]; - var ab = a[1], ad = a[3], aty = a[5]; + var EPSILON = 1e-4; - out[0] = v[0] * aa + v[1] * ac + atx; - out[1] = v[0] * ab + v[1] * ad + aty; + var THREE_SQRT = Math.sqrt(3); + var ONE_THIRD = 1 / 3; - return out; - } - }; + // 临时变量 + var _v0 = vector.create(); + var _v1 = vector.create(); + var _v2 = vector.create(); + // var _v3 = vector.create(); - return matrix; + function isAroundZero(val) { + return val > -EPSILON && val < EPSILON; } -); -define('zrender/shape/mixin/Transformable',['require','../../tool/matrix'],function(require) { - - var matrix = require('../../tool/matrix'); - var origin = [0, 0]; - - var Transformable = function() { - - if (!this.position) { - this.position = [0, 0]; - } - if (typeof(this.rotation) == 'undefined') { - this.rotation = [0, 0, 0]; - } - if (!this.scale) { - this.scale = [1, 1, 0, 0]; - } + function isNotAroundZero(val) { + return val > EPSILON || val < -EPSILON; + } + /* + function evalCubicCoeff(a, b, c, d, t) { + return ((a * t + b) * t + c) * t + d; + } + */ - this.needLocalTransform = false; - this.needTransform = false; - }; + /** + * 计算三次贝塞尔值 + * @memberOf module:zrender/tool/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} p3 + * @param {number} t + * @return {number} + */ + function cubicAt(p0, p1, p2, p3, t) { + var onet = 1 - t; + return onet * onet * (onet * p0 + 3 * t * p1) + + t * t * (t * p3 + 3 * onet * p2); + } + + /** + * 计算三次贝塞尔导数值 + * @memberOf module:zrender/tool/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} p3 + * @param {number} t + * @return {number} + */ + function cubicDerivativeAt(p0, p1, p2, p3, t) { + var onet = 1 - t; + return 3 * ( + ((p1 - p0) * onet + 2 * (p2 - p1) * t) * onet + + (p3 - p2) * t * t + ); + } - Transformable.prototype = { - - constructor: Transformable, + /** + * 计算三次贝塞尔方程根,使用盛金公式 + * @memberOf module:zrender/tool/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} p3 + * @param {number} val + * @param {Array.} roots + * @return {number} 有效根数目 + */ + function cubicRootAt(p0, p1, p2, p3, val, roots) { + // Evaluate roots of cubic functions + var a = p3 + 3 * (p1 - p2) - p0; + var b = 3 * (p2 - p1 * 2 + p0); + var c = 3 * (p1 - p0); + var d = p0 - val; - updateNeedTransform: function() { - this.needLocalTransform = Math.abs(this.rotation[0]) > 0.0001 - || Math.abs(this.position[0]) > 0.0001 - || Math.abs(this.position[1]) > 0.0001 - || Math.abs(this.scale[0] - 1) > 0.0001 - || Math.abs(this.scale[1] - 1) > 0.0001; - }, + var A = b * b - 3 * a * c; + var B = b * c - 9 * a * d; + var C = c * c - 3 * b * d; - updateTransform: function() { - - this.updateNeedTransform(); + var n = 0; - if (this.parent) { - this.needTransform = this.needLocalTransform || this.parent.needTransform; - } else { - this.needTransform = this.needLocalTransform; - } - - if (!this.needTransform) { - return; + if (isAroundZero(A) && isAroundZero(B)) { + if (isAroundZero(b)) { + roots[0] = 0; } - - var m = this.transform || matrix.create(); - matrix.identity(m); - - if (this.needLocalTransform) { - if (this.scale && (this.scale[0] !== 1 || this.scale[1] !== 1)) { - origin[0] = -this.scale[2] || 0; - origin[1] = -this.scale[3] || 0; - if (origin[0] || origin[1]) { - matrix.translate( - m, m, origin - ); - } - matrix.scale(m, m, this.scale); - if (origin[0] || origin[1]) { - origin[0] = -origin[0]; - origin[1] = -origin[1]; - matrix.translate( - m, m, origin - ); - } + else { + var t1 = -c / b; //t1, t2, t3, b is not zero + if (t1 >=0 && t1 <= 1) { + roots[n++] = t1; } + } + } + else { + var disc = B * B - 4 * A * C; - if (this.rotation) { - if (this.rotation instanceof Array) { - if (this.rotation[0] !== 0) { - origin[0] = -this.rotation[1] || 0; - origin[1] = -this.rotation[2] || 0; - if (origin[0] || origin[1]) { - matrix.translate( - m, m, origin - ); - } - matrix.rotate(m, m, this.rotation[0]); - if (origin[0] || origin[1]) { - origin[0] = -origin[0]; - origin[1] = -origin[1]; - matrix.translate( - m, m, origin - ); - } - } - } - else { - if (this.rotation !== 0) { - matrix.rotate(m, m, this.rotation); - } - } + if (isAroundZero(disc)) { + var K = B / A; + var t1 = -b / a + K; // t1, a is not zero + var t2 = -K / 2; // t2, t3 + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; } - - if (this.position && (this.position[0] !==0 || this.position[1] !== 0)) { - matrix.translate(m, m, this.position); + if (t2 >= 0 && t2 <= 1) { + roots[n++] = t2; } } - - // 保存这个变换矩阵 - this.transform = m; - - // 应用父节点变换 - if (this.parent && this.parent.needTransform) { - if (this.needLocalTransform) { - matrix.mul(this.transform, this.parent.transform, this.transform); - } else { - matrix.copy(this.transform, this.parent.transform); + else if (disc > 0) { + var discSqrt = Math.sqrt(disc); + var Y1 = A * b + 1.5 * a * (-B + discSqrt); + var Y2 = A * b + 1.5 * a * (-B - discSqrt); + if (Y1 < 0) { + Y1 = -Math.pow(-Y1, ONE_THIRD); + } + else { + Y1 = Math.pow(Y1, ONE_THIRD); + } + if (Y2 < 0) { + Y2 = -Math.pow(-Y2, ONE_THIRD); + } + else { + Y2 = Math.pow(Y2, ONE_THIRD); + } + var t1 = (-b - (Y1 + Y2)) / (3 * a); + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; } } - }, - - setTransform: function(ctx) { - if (this.needTransform) { - var m = this.transform; - ctx.transform( - m[0], m[1], - m[2], m[3], - m[4], m[5] - ); + else { + var T = (2 * A * b - 3 * a * B) / (2 * Math.sqrt(A * A * A)); + var theta = Math.acos(T) / 3; + var ASqrt = Math.sqrt(A); + var tmp = Math.cos(theta); + + var t1 = (-b - 2 * ASqrt * tmp) / (3 * a); + var t2 = (-b + ASqrt * (tmp + THREE_SQRT * Math.sin(theta))) / (3 * a); + var t3 = (-b + ASqrt * (tmp - THREE_SQRT * Math.sin(theta))) / (3 * a); + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + if (t2 >= 0 && t2 <= 1) { + roots[n++] = t2; + } + if (t3 >= 0 && t3 <= 1) { + roots[n++] = t3; + } } } - }; - - return Transformable; -}); -/** - * zrender : 颜色辅助类 - * - * author: CrossDo (chenhuaimu@baidu.com) - * - * getColor:获取色板颜色 - * customPalette : 自定义调色板 - * resetPalette : 重置调色板 - * - * getHighlightColor : 获取默认高亮颜色 - * customHighlight : 自定义默认高亮颜色 - * resetHighlight : 重置默认高亮颜色 - * - * getRadialGradient : 径向渐变 - * getLinearGradient : 线性渐变 - * getGradientColors : 获取颜色之间渐变颜色数组 - * getStepColors : 获取两种颜色之间渐变颜色数组 - * reverse : 颜色翻转 - * mix : 颜色混合 - * lift : 颜色升降 - * trim : 清除空格 - * random : 随机颜色 - * toRGB : 转为RGB格式 - * toRGBA : 转为RGBA格式 - * toHex : 转为#RRGGBB格式 - * toHSL : 转为HSL格式 - * toHSLA : 转为HSLA格式 - * toHSB : 转为HSB格式 - * toHSBA : 转为HSBA格式 - * toHSV : 转为HSV格式 - * toHSVA : 转为HSVA格式 - * toName : 转为颜色名字 - * toColor: 颜色值数组转为指定格式颜色 - * toArray: 返回颜色值数组 - * alpha : 设置颜色的透明度 - **/ -define( 'zrender/tool/color',['require','../tool/util'],function(require) { - var util = require('../tool/util'); - - var _ctx; - - // Color palette is an array containing the default colors for the chart's - // series. - // When all colors are used, new colors are selected from the start again. - // Defaults to: - // 默认色板 - var palette = [ - '#ff9277', ' #dddd00', ' #ffc877', ' #bbe3ff', ' #d5ffbb', - '#bbbbff', ' #ddb000', ' #b0dd00', ' #e2bbff', ' #ffbbe3', - '#ff7777', ' #ff9900', ' #83dd00', ' #77e3ff', ' #778fff', - '#c877ff', ' #ff77ab', ' #ff6600', ' #aa8800', ' #77c7ff', - '#ad77ff', ' #ff77ff', ' #dd0083', ' #777700', ' #00aa00', - '#0088aa', ' #8400dd', ' #aa0088', ' #dd0000', ' #772e00' - ]; - var _palette = palette; - - var highlightColor = 'rgba(255,255,0,0.5)'; - var _highlightColor = highlightColor; - - // 颜色格式 - /*jshint maxlen: 330 */ - var colorRegExp = /^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i; - - var _nameColors = { - aliceblue : '#f0f8ff', - antiquewhite : '#faebd7', - aqua : '#0ff', - aquamarine : '#7fffd4', - azure : '#f0ffff', - beige : '#f5f5dc', - bisque : '#ffe4c4', - black : '#000', - blanchedalmond : '#ffebcd', - blue : '#00f', - blueviolet : '#8a2be2', - brown : '#a52a2a', - burlywood : '#deb887', - cadetblue : '#5f9ea0', - chartreuse : '#7fff00', - chocolate : '#d2691e', - coral : '#ff7f50', - cornflowerblue : '#6495ed', - cornsilk : '#fff8dc', - crimson : '#dc143c', - cyan : '#0ff', - darkblue : '#00008b', - darkcyan : '#008b8b', - darkgoldenrod : '#b8860b', - darkgray : '#a9a9a9', - darkgrey : '#a9a9a9', - darkgreen : '#006400', - darkkhaki : '#bdb76b', - darkmagenta : '#8b008b', - darkolivegreen : '#556b2f', - darkorange : '#ff8c00', - darkorchid : '#9932cc', - darkred : '#8b0000', - darksalmon : '#e9967a', - darkseagreen : '#8fbc8f', - darkslateblue : '#483d8b', - darkslategray : '#2f4f4f', - darkslategrey : '#2f4f4f', - darkturquoise : '#00ced1', - darkviolet : '#9400d3', - deeppink : '#ff1493', - deepskyblue : '#00bfff', - dimgray : '#696969', - dimgrey : '#696969', - dodgerblue : '#1e90ff', - firebrick : '#b22222', - floralwhite : '#fffaf0', - forestgreen : '#228b22', - fuchsia : '#f0f', - gainsboro : '#dcdcdc', - ghostwhite : '#f8f8ff', - gold : '#ffd700', - goldenrod : '#daa520', - gray : '#808080', - grey : '#808080', - green : '#008000', - greenyellow : '#adff2f', - honeydew : '#f0fff0', - hotpink : '#ff69b4', - indianred : '#cd5c5c', - indigo : '#4b0082', - ivory : '#fffff0', - khaki : '#f0e68c', - lavender : '#e6e6fa', - lavenderblush : '#fff0f5', - lawngreen : '#7cfc00', - lemonchiffon : '#fffacd', - lightblue : '#add8e6', - lightcoral : '#f08080', - lightcyan : '#e0ffff', - lightgoldenrodyellow : '#fafad2', - lightgray : '#d3d3d3', - lightgrey : '#d3d3d3', - lightgreen : '#90ee90', - lightpink : '#ffb6c1', - lightsalmon : '#ffa07a', - lightseagreen : '#20b2aa', - lightskyblue : '#87cefa', - lightslategray : '#789', - lightslategrey : '#789', - lightsteelblue : '#b0c4de', - lightyellow : '#ffffe0', - lime : '#0f0', - limegreen : '#32cd32', - linen : '#faf0e6', - magenta : '#f0f', - maroon : '#800000', - mediumaquamarine : '#66cdaa', - mediumblue : '#0000cd', - mediumorchid : '#ba55d3', - mediumpurple : '#9370d8', - mediumseagreen : '#3cb371', - mediumslateblue : '#7b68ee', - mediumspringgreen : '#00fa9a', - mediumturquoise : '#48d1cc', - mediumvioletred : '#c71585', - midnightblue : '#191970', - mintcream : '#f5fffa', - mistyrose : '#ffe4e1', - moccasin : '#ffe4b5', - navajowhite : '#ffdead', - navy : '#000080', - oldlace : '#fdf5e6', - olive : '#808000', - olivedrab : '#6b8e23', - orange : '#ffa500', - orangered : '#ff4500', - orchid : '#da70d6', - palegoldenrod : '#eee8aa', - palegreen : '#98fb98', - paleturquoise : '#afeeee', - palevioletred : '#d87093', - papayawhip : '#ffefd5', - peachpuff : '#ffdab9', - peru : '#cd853f', - pink : '#ffc0cb', - plum : '#dda0dd', - powderblue : '#b0e0e6', - purple : '#800080', - red : '#f00', - rosybrown : '#bc8f8f', - royalblue : '#4169e1', - saddlebrown : '#8b4513', - salmon : '#fa8072', - sandybrown : '#f4a460', - seagreen : '#2e8b57', - seashell : '#fff5ee', - sienna : '#a0522d', - silver : '#c0c0c0', - skyblue : '#87ceeb', - slateblue : '#6a5acd', - slategray : '#708090', - slategrey : '#708090', - snow : '#fffafa', - springgreen : '#00ff7f', - steelblue : '#4682b4', - tan : '#d2b48c', - teal : '#008080', - thistle : '#d8bfd8', - tomato : '#ff6347', - turquoise : '#40e0d0', - violet : '#ee82ee', - wheat : '#f5deb3', - white : '#fff', - whitesmoke : '#f5f5f5', - yellow : '#ff0', - yellowgreen : '#9acd32' - }; - - /** - * 自定义调色板 - */ - function customPalette(userPalete) { - palette = userPalete; + return n; } /** - * 复位默认色板 + * 计算三次贝塞尔方程极限值的位置 + * @memberOf module:zrender/tool/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} p3 + * @param {Array.} extrema + * @return {number} 有效数目 */ - function resetPalette() { - palette = _palette; + function cubicExtrema(p0, p1, p2, p3, extrema) { + var b = 6 * p2 - 12 * p1 + 6 * p0; + var a = 9 * p1 + 3 * p3 - 3 * p0 - 9 * p2; + var c = 3 * p1 - 3 * p0; + + var n = 0; + if (isAroundZero(a)) { + if (isNotAroundZero(b)) { + var t1 = -c / b; + if (t1 >= 0 && t1 <=1) { + extrema[n++] = t1; + } + } + } + else { + var disc = b * b - 4 * a * c; + if (isAroundZero(disc)) { + extrema[0] = -b / (2 * a); + } + else if (disc > 0) { + var discSqrt = Math.sqrt(disc); + var t1 = (-b + discSqrt) / (2 * a); + var t2 = (-b - discSqrt) / (2 * a); + if (t1 >= 0 && t1 <= 1) { + extrema[n++] = t1; + } + if (t2 >= 0 && t2 <= 1) { + extrema[n++] = t2; + } + } + } + return n; } /** - * 获取色板颜色 - * - * @param {number} idx : 色板位置 - * @param {array} [userPalete] : 自定义色板 - * - * @return {color} 颜色#000000~#ffffff + * 细分三次贝塞尔曲线 + * @memberOf module:zrender/tool/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} p3 + * @param {number} t + * @param {Array.} out */ - function getColor(idx, userPalete) { - idx = idx | 0; - userPalete = userPalete || palette; - return userPalete[idx % userPalete.length]; + function cubicSubdivide(p0, p1, p2, p3, t, out) { + var p01 = (p1 - p0) * t + p0; + var p12 = (p2 - p1) * t + p1; + var p23 = (p3 - p2) * t + p2; + + var p012 = (p12 - p01) * t + p01; + var p123 = (p23 - p12) * t + p12; + + var p0123 = (p123 - p012) * t + p012; + // Seg0 + out[0] = p0; + out[1] = p01; + out[2] = p012; + out[3] = p0123; + // Seg1 + out[4] = p0123; + out[5] = p123; + out[6] = p23; + out[7] = p3; } /** - * 自定义默认高亮颜色 + * 投射点到三次贝塞尔曲线上,返回投射距离。 + * 投射点有可能会有一个或者多个,这里只返回其中距离最短的一个。 + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @param {number} x3 + * @param {number} y3 + * @param {number} x + * @param {number} y + * @param {Array.} [out] 投射点 + * @return {number} */ - function customHighlight(userHighlightColor) { - highlightColor = userHighlightColor; + function cubicProjectPoint( + x0, y0, x1, y1, x2, y2, x3, y3, + x, y, out + ) { + // http://pomax.github.io/bezierinfo/#projections + var t; + var interval = 0.005; + var d = Infinity; + + _v0[0] = x; + _v0[1] = y; + + // 先粗略估计一下可能的最小距离的 t 值 + // PENDING + for (var _t = 0; _t < 1; _t += 0.05) { + _v1[0] = cubicAt(x0, x1, x2, x3, _t); + _v1[1] = cubicAt(y0, y1, y2, y3, _t); + var d1 = vector.distSquare(_v0, _v1); + if (d1 < d) { + t = _t; + d = d1; + } + } + d = Infinity; + + // At most 32 iteration + for (var i = 0; i < 32; i++) { + if (interval < EPSILON) { + break; + } + var prev = t - interval; + var next = t + interval; + // t - interval + _v1[0] = cubicAt(x0, x1, x2, x3, prev); + _v1[1] = cubicAt(y0, y1, y2, y3, prev); + + var d1 = vector.distSquare(_v1, _v0); + + if (prev >= 0 && d1 < d) { + t = prev; + d = d1; + } + else { + // t + interval + _v2[0] = cubicAt(x0, x1, x2, x3, next); + _v2[1] = cubicAt(y0, y1, y2, y3, next); + var d2 = vector.distSquare(_v2, _v0); + + if (next <= 1 && d2 < d) { + t = next; + d = d2; + } + else { + interval *= 0.5; + } + } + } + // t + if (out) { + out[0] = cubicAt(x0, x1, x2, x3, t); + out[1] = cubicAt(y0, y1, y2, y3, t); + } + // console.log(interval, i); + return Math.sqrt(d); } /** - * 重置默认高亮颜色 + * 计算二次方贝塞尔值 + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} t + * @return {number} */ - function resetHighlight() { - _highlightColor = highlightColor; + function quadraticAt(p0, p1, p2, t) { + var onet = 1 - t; + return onet * (onet * p0 + 2 * t * p1) + t * t * p2; } /** - * 获取默认高亮颜色 + * 计算二次方贝塞尔导数值 + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} t + * @return {number} */ - function getHighlightColor() { - return highlightColor; + function quadraticDerivativeAt(p0, p1, p2, t) { + return 2 * ((1 - t) * (p1 - p0) + t * (p2 - p1)); } /** - * 径向渐变 - * - * @param {number} x0 渐变起点 - * @param {number} y0 - * @param {number} r0 - * @param {number} x1 渐变终点 - * @param {number} y1 - * @param {number} r1 - * @param {Array} colorList 颜色列表 + * 计算二次方贝塞尔方程根 + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} t + * @param {Array.} roots + * @return {number} 有效根数目 */ - function getRadialGradient(x0, y0, r0, x1, y1, r1, colorList) { - if (!_ctx) { - _ctx = util.getContext(); + function quadraticRootAt(p0, p1, p2, val, roots) { + var a = p0 - 2 * p1 + p2; + var b = 2 * (p1 - p0); + var c = p0 - val; + + var n = 0; + if (isAroundZero(a)) { + if (isNotAroundZero(b)) { + var t1 = -c / b; + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + } } - var gradient = _ctx.createRadialGradient(x0, y0, r0, x1, y1, r1); - for ( var i = 0, l = colorList.length; i < l; i++) { - gradient.addColorStop(colorList[i][0], colorList[i][1]); + else { + var disc = b * b - 4 * a * c; + if (isAroundZero(disc)) { + var t1 = -b / (2 * a); + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + } + else if (disc > 0) { + var discSqrt = Math.sqrt(disc); + var t1 = (-b + discSqrt) / (2 * a); + var t2 = (-b - discSqrt) / (2 * a); + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + if (t2 >= 0 && t2 <= 1) { + roots[n++] = t2; + } + } } - gradient.__nonRecursion = true; - return gradient; + return n; } /** - * 线性渐变 - * @param {Object} x0 渐变起点 - * @param {Object} y0 - * @param {Object} x1 渐变终点 - * @param {Object} y1 - * @param {Array} colorList 颜色列表 + * 计算二次贝塞尔方程极限值 + * @memberOf module:zrender/tool/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @return {number} */ - function getLinearGradient(x0, y0, x1, y1, colorList) { - if (!_ctx) { - _ctx = util.getContext(); + function quadraticExtremum(p0, p1, p2) { + var divider = p0 + p2 - 2 * p1; + if (divider === 0) { + // p1 is center of p0 and p2 + return 0.5; } - var gradient = _ctx.createLinearGradient(x0, y0, x1, y1); - for ( var i = 0, l = colorList.length; i < l; i++) { - gradient.addColorStop(colorList[i][0], colorList[i][1]); + else { + return (p0 - p1) / divider; } - gradient.__nonRecursion = true; - return gradient; } /** - * 获取两种颜色之间渐变颜色数组 - * @param {color} start 起始颜色 - * @param {color} end 结束颜色 - * @param {number} step 渐变级数 - * @return {Array} 颜色数组 + * 投射点到二次贝塞尔曲线上,返回投射距离。 + * 投射点有可能会有一个或者多个,这里只返回其中距离最短的一个。 + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @param {number} x + * @param {number} y + * @param {Array.} out 投射点 + * @return {number} */ - function getStepColors(start, end, step) { - start = toRGBA(start); - end = toRGBA(end); - start = getData(start); - end = getData(end); + function quadraticProjectPoint( + x0, y0, x1, y1, x2, y2, + x, y, out + ) { + // http://pomax.github.io/bezierinfo/#projections + var t; + var interval = 0.005; + var d = Infinity; + + _v0[0] = x; + _v0[1] = y; + + // 先粗略估计一下可能的最小距离的 t 值 + // PENDING + for (var _t = 0; _t < 1; _t += 0.05) { + _v1[0] = quadraticAt(x0, x1, x2, _t); + _v1[1] = quadraticAt(y0, y1, y2, _t); + var d1 = vector.distSquare(_v0, _v1); + if (d1 < d) { + t = _t; + d = d1; + } + } + d = Infinity; + + // At most 32 iteration + for (var i = 0; i < 32; i++) { + if (interval < EPSILON) { + break; + } + var prev = t - interval; + var next = t + interval; + // t - interval + _v1[0] = quadraticAt(x0, x1, x2, prev); + _v1[1] = quadraticAt(y0, y1, y2, prev); - var colors = []; - var stepR = (end[0] - start[0]) / step; - var stepG = (end[1] - start[1]) / step; - var stepB = (end[2] - start[2]) / step; - // 生成颜色集合 - // fix by linfeng 颜色堆积 - for (var i = 0, r = start[0], g = start[1], b = start[2]; i < step; i++ - ) { - colors[i] = toColor([ - adjust(Math.floor(r), [0, 255]), - adjust(Math.floor(g), [0, 255]), - adjust(Math.floor(b), [0, 255]) - ]); - r += stepR; - g += stepG; - b += stepB; - } - r = end[0]; - g = end[1]; - b = end[2]; - colors[i] = toColor([r, g, b]); - return colors; - } + var d1 = vector.distSquare(_v1, _v0); - /** - * 获取指定级数的渐变颜色数组 - * @param {Array} colors 颜色组 - * @param {number=20} step 渐变级数 - * @return {Array} 颜色数组 - */ - function getGradientColors(colors, step) { - var ret = []; - var len = colors.length; - if (step === undefined) { - step = 20; - } - if (len === 1) { - ret = getStepColors(colors[0], colors[0], step); - } else if (len > 1) { - for ( var i = 0, n = len - 1; i < n; i++) { - var steps = getStepColors(colors[i], colors[i + 1], step); - if (i < n - 1) { - steps.pop(); + if (prev >= 0 && d1 < d) { + t = prev; + d = d1; + } + else { + // t + interval + _v2[0] = quadraticAt(x0, x1, x2, next); + _v2[1] = quadraticAt(y0, y1, y2, next); + var d2 = vector.distSquare(_v2, _v0); + if (next <= 1 && d2 < d) { + t = next; + d = d2; + } + else { + interval *= 0.5; } - ret = ret.concat(steps); } } - return ret; + // t + if (out) { + out[0] = quadraticAt(x0, x1, x2, t); + out[1] = quadraticAt(y0, y1, y2, t); + } + // console.log(interval, i); + return Math.sqrt(d); } - /** - * 颜色值数组转为指定格式颜色,例如:
- * data = [60,20,20,0.1] format = 'rgba' - * 返回:rgba(60,20,20,0.1) - * @param {Array} data 颜色值数组 - * @param {string} format 格式,默认rgb - * @return {string} 颜色 - */ - function toColor(data, format) { - format = format || 'rgb'; - if (data && (data.length === 3 || data.length === 4)) { - data = map(data, - function(c) { - return c > 1 ? Math.ceil(c) : c; - }); + return { - if (format.indexOf('hex') > -1) { - return '#' + ((1 << 24) + (data[0] << 16) + (data[1] << 8) + (+data[2])).toString(16).slice(1); - } else if (format.indexOf('hs') > -1) { - var sx = map(data.slice(1, 3), - function(c) { - return c + '%'; - }); - data[1] = sx[0]; - data[2] = sx[1]; - } + cubicAt: cubicAt, - if (format.indexOf('a') > -1) { - if (data.length === 3) { - data.push(1); - } - data[3] = adjust(data[3], [0, 1]); - return format + '(' + data.slice(0, 4).join(',') + ')'; - } + cubicDerivativeAt: cubicDerivativeAt, - return format + '(' + data.slice(0, 3).join(',') + ')'; - } - } + cubicRootAt: cubicRootAt, - /** - * 返回颜色值数组 - * - * @param {color} color 颜色 - * @return {Array} 颜色值数组 - */ - function toArray(color) { - color = trim(color); - if (color.indexOf('rgba') < 0) { - color = toRGBA(color); - } + cubicExtrema: cubicExtrema, - var data = []; - var i = 0; - color.replace(/[\d.]+/g, function (n) { - if (i < 3) { - n = n | 0; - } else { - // Alpha - n = +n; - } - data[i++] = n; - }); - return data; - } + cubicSubdivide: cubicSubdivide, - /** - * 颜色格式转化 - * - * @param {Array} data 颜色值数组 - * @param {string} format 格式,默认rgb - * @return {string} 颜色 - */ - function convert(color, format) { - var data = getData(color); - var alpha = data[3]; - if(typeof alpha === 'undefined') { - alpha = 1; - } + cubicProjectPoint: cubicProjectPoint, - if (color.indexOf('hsb') > -1) { - data = _HSV_2_RGB(data); - } else if (color.indexOf('hsl') > -1) { - data = _HSL_2_RGB(data); - } + quadraticAt: quadraticAt, - if (format.indexOf('hsb') > -1 || format.indexOf('hsv') > -1) { - data = _RGB_2_HSB(data); - } else if (format.indexOf('hsl') > -1) { - data = _RGB_2_HSL(data); - } + quadraticDerivativeAt: quadraticDerivativeAt, - data[3] = alpha; + quadraticRootAt: quadraticRootAt, - return toColor(data, format); - } + quadraticExtremum: quadraticExtremum, - /** - * 转换为rgba格式的颜色 - * - * @param {string} color 颜色 - * @return {string} rgba颜色,rgba(r,g,b,a) - */ - function toRGBA(color) { - return convert(color, 'rgba'); - } + quadraticProjectPoint: quadraticProjectPoint + }; +}); +/** + * zrender: 图形空间辅助类 + * + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * pissang (https://www.github.com/pissang) + * + * isInside:是否在区域内部 + * isOutside:是否在区域外部 + * getTextWidth:测算单行文本宽度 + */ +define( + 'zrender/tool/area',['require','./util','./curve'],function (require) { - /** - * 转换为rgb数字格式的颜色 - * - * @param {string} color 颜色 - * @return {string} rgb颜色,rgb(0,0,0)格式 - */ - function toRGB(color) { - return convert(color, 'rgb'); - } + - /** - * 转换为16进制颜色 - * - * @param {string} color 颜色 - * @return {string} 16进制颜色,#rrggbb格式 - */ - function toHex(color) { - return convert(color, 'hex'); - } + var util = require('./util'); + var curve = require('./curve'); - /** - * 转换为HSV颜色 - * - * @param {string} color 颜色 - * @return {string} HSVA颜色,hsva(h,s,v,a) - */ - function toHSVA(color) { - return convert(color, 'hsva'); - } + var _ctx; + + var _textWidthCache = {}; + var _textHeightCache = {}; + var _textWidthCacheCounter = 0; + var _textHeightCacheCounter = 0; + var TEXT_CACHE_MAX = 5000; + + var PI2 = Math.PI * 2; - /** - * 转换为HSV颜色 - * - * @param {string} color 颜色 - * @return {string} HSV颜色,hsv(h,s,v) - */ - function toHSV(color) { - return convert(color, 'hsv'); - } + function normalizeRadian(angle) { + angle %= PI2; + if (angle < 0) { + angle += PI2; + } + return angle; + } + /** + * 包含判断 + * + * @param {Object} shape : 图形 + * @param {Object} area : 目标区域 + * @param {number} x : 横坐标 + * @param {number} y : 纵坐标 + */ + function isInside(shape, area, x, y) { + if (!area || !shape) { + // 无参数或不支持类型 + return false; + } + var zoneType = shape.type; - /** - * 转换为HSBA颜色 - * - * @param {string} color 颜色 - * @return {string} HSBA颜色,hsba(h,s,b,a) - */ - function toHSBA(color) { - return convert(color, 'hsba'); - } + _ctx = _ctx || util.getContext(); - /** - * 转换为HSB颜色 - * - * @param {string} color 颜色 - * @return {string} HSB颜色,hsb(h,s,b) - */ - function toHSB(color) { - return convert(color, 'hsb'); - } + // 未实现或不可用时(excanvas不支持)则数学运算,主要是line,brokenLine,ring + var _mathReturn = _mathMethod(shape, area, x, y); + if (typeof _mathReturn != 'undefined') { + return _mathReturn; + } - /** - * 转换为HSLA颜色 - * - * @param {string} color 颜色 - * @return {string} HSLA颜色,hsla(h,s,l,a) - */ - function toHSLA(color) { - return convert(color, 'hsla'); - } + if (shape.buildPath && _ctx.isPointInPath) { + return _buildPathMethod(shape, _ctx, area, x, y); + } - /** - * 转换为HSL颜色 - * - * @param {string} color 颜色 - * @return {string} HSL颜色,hsl(h,s,l) - */ - function toHSL(color) { - return convert(color, 'hsl'); - } + // 上面的方法都行不通时 + switch (zoneType) { + case 'heart': // 心形---------10 // Todo,不精确 + case 'droplet':// 水滴----------11 // Todo,不精确 + case 'ellipse': // Todo,不精确 + return true; + // 旋轮曲线 不准确 + case 'trochoid': + var _r = area.location == 'out' + ? area.r1 + area.r2 + area.d + : area.r1 - area.r2 + area.d; + return isInsideCircle(area, x, y, _r); + // 玫瑰线 不准确 + case 'rose' : + return isInsideCircle(area, x, y, area.maxr); + // 路径,椭圆,曲线等-----------------13 + default: + return false; // Todo,暂不支持 + } + } - /** - * 转换颜色名 - * - * @param {string} color 颜色 - * @return {string} 颜色名 - */ - function toName(color) { - for ( var key in _nameColors) { - if (toHex(_nameColors[key]) === toHex(color)) { - return key; + /** + * 用数学方法判断,三个方法中最快,但是支持的shape少 + * + * @param {Object} shape : 图形 + * @param {Object} area :目标区域 + * @param {number} x : 横坐标 + * @param {number} y : 纵坐标 + * @return {boolean=} true表示坐标处在图形中 + */ + function _mathMethod(shape, area, x, y) { + var zoneType = shape.type; + // 在矩形内则部分图形需要进一步判断 + switch (zoneType) { + // 贝塞尔曲线 + case 'bezier-curve': + if (typeof(area.cpX2) === 'undefined') { + return isInsideQuadraticStroke( + area.xStart, area.yStart, + area.cpX1, area.cpY1, + area.xEnd, area.yEnd, + area.lineWidth, x, y + ); + } + return isInsideCubicStroke( + area.xStart, area.yStart, + area.cpX1, area.cpY1, + area.cpX2, area.cpY2, + area.xEnd, area.yEnd, + area.lineWidth, x, y + ); + // 线 + case 'line': + return isInsideLine( + area.xStart, area.yStart, + area.xEnd, area.yEnd, + area.lineWidth, x, y + ); + // 折线 + case 'broken-line': + return isInsideBrokenLine( + area.pointList, area.lineWidth, x, y + ); + // 圆环 + case 'ring': + return isInsideRing( + area.x, area.y, area.r0, area.r, x, y + ); + // 圆形 + case 'circle': + return isInsideCircle( + area.x, area.y, area.r, x, y + ); + // 扇形 + case 'sector': + return isInsideSector(area, x, y); + // 多边形 + case 'path': + return isInsidePath( + area.pathArray, Math.max(area.lineWidth, 5), + area.brushType, x, y + ); + case 'polygon': + case 'star': + case 'isogon': + return isInsidePolygon(area.pointList, x, y); + // 文本 + case 'text': + var rect = area.__rect || shape.getRect(area); + return isInsideRect( + rect.x, rect.y, rect.width, rect.height, x, y + ); + // 矩形 + case 'rectangle': + // 图片 + case 'image': + return isInsideRect( + area.x, area.y, area.width, area.height, x, y + ); } } - return null; - } - /** - * 移除颜色中多余空格 - * - * @param {string} color 颜色 - * @return {string} 无空格颜色 - */ - function trim(color) { - return String(color).replace(/\s+/g, ''); - } + /** + * 通过buildPath方法来判断,三个方法中较快,但是不支持线条类型的shape, + * 而且excanvas不支持isPointInPath方法 + * + * @param {Object} shape : shape + * @param {Object} context : 上下文 + * @param {Object} area :目标区域 + * @param {number} x : 横坐标 + * @param {number} y : 纵坐标 + * @return {boolean} true表示坐标处在图形中 + */ + function _buildPathMethod(shape, context, area, x, y) { + // 图形类实现路径创建了则用类的path + context.beginPath(); + shape.buildPath(context, area); + context.closePath(); + return context.isPointInPath(x, y); + } - /** - * 颜色规范化 - * - * @param {string} color 颜色 - * @return {string} 规范化后的颜色 - */ - function normalize(color) { - // 颜色名 - if (_nameColors[color]) { - color = _nameColors[color]; + /** + * !isInside + */ + function isOutside(shape, area, x, y) { + return !isInside(shape, area, x, y); } - // 去掉空格 - color = trim(color); - // hsv与hsb等价 - color = color.replace(/hsv/i, 'hsb'); - // rgb转为rrggbb - if (/^#[\da-f]{3}$/i.test(color)) { - color = parseInt(color.slice(1), 16); - var r = (color & 0xf00) << 8; - var g = (color & 0xf0) << 4; - var b = color & 0xf; - color = '#'+ ((1 << 24) + (r << 4) + r + (g << 4) + g + (b << 4) + b).toString(16).slice(1); + /** + * 线段包含判断 + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @param {number} lineWidth + * @param {number} x + * @param {number} y + * @return {boolean} + */ + function isInsideLine(x0, y0, x1, y1, lineWidth, x, y) { + if (lineWidth === 0) { + return false; + } + var _l = Math.max(lineWidth, 5); + var _a = 0; + var _b = x0; + // Quick reject + if ( + (y > y0 + _l && y > y1 + _l) + || (y < y0 - _l && y < y1 - _l) + || (x > x0 + _l && x > x1 + _l) + || (x < x0 - _l && x < x1 - _l) + ) { + return false; + } + + if (x0 !== x1) { + _a = (y0 - y1) / (x0 - x1); + _b = (x0 * y1 - x1 * y0) / (x0 - x1) ; + } + else { + return Math.abs(x - x0) <= _l / 2; + } + var tmp = _a * x - y + _b; + var _s = tmp * tmp / (_a * _a + 1); + return _s <= _l / 2 * _l / 2; + } + + /** + * 三次贝塞尔曲线描边包含判断 + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @param {number} x3 + * @param {number} y3 + * @param {number} lineWidth + * @param {number} x + * @param {number} y + * @return {boolean} + */ + function isInsideCubicStroke( + x0, y0, x1, y1, x2, y2, x3, y3, + lineWidth, x, y + ) { + if (lineWidth === 0) { + return false; + } + var _l = Math.max(lineWidth, 5); + // Quick reject + if ( + (y > y0 + _l && y > y1 + _l && y > y2 + _l && y > y3 + _l) + || (y < y0 - _l && y < y1 - _l && y < y2 - _l && y < y3 - _l) + || (x > x0 + _l && x > x1 + _l && x > x2 + _l && x > x3 + _l) + || (x < x0 - _l && x < x1 - _l && x < x2 - _l && x < x3 - _l) + ) { + return false; + } + var d = curve.cubicProjectPoint( + x0, y0, x1, y1, x2, y2, x3, y3, + x, y, null + ); + return d <= _l / 2; } - // 或者使用以下正则替换,不过 chrome 下性能相对差点 - // color = color.replace(/^#([\da-f])([\da-f])([\da-f])$/i, '#$1$1$2$2$3$3'); - return color; - } - /** - * 颜色加深或减淡,当level>0加深,当level<0减淡 - * - * @param {string} color 颜色 - * @param {number} level 升降程度,取值区间[-1,1] - * @return {string} 加深或减淡后颜色值 - */ - function lift(color, level) { - var direct = level > 0 ? 1 : -1; - if (typeof level === 'undefined') { - level = 0; + /** + * 二次贝塞尔曲线描边包含判断 + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @param {number} lineWidth + * @param {number} x + * @param {number} y + * @return {boolean} + */ + function isInsideQuadraticStroke( + x0, y0, x1, y1, x2, y2, + lineWidth, x, y + ) { + if (lineWidth === 0) { + return false; + } + var _l = Math.max(lineWidth, 5); + // Quick reject + if ( + (y > y0 + _l && y > y1 + _l && y > y2 + _l) + || (y < y0 - _l && y < y1 - _l && y < y2 - _l) + || (x > x0 + _l && x > x1 + _l && x > x2 + _l) + || (x < x0 - _l && x < x1 - _l && x < x2 - _l) + ) { + return false; + } + var d = curve.quadraticProjectPoint( + x0, y0, x1, y1, x2, y2, + x, y, null + ); + return d <= _l / 2; } - level = Math.abs(level) > 1 ? 1 : Math.abs(level); - color = toRGB(color); - var data = getData(color); - for ( var i = 0; i < 3; i++) { - if (direct === 1) { - data[i] = data[i] * (1 - level) | 0; + + /** + * 圆弧描边包含判断 + * @param {number} cx + * @param {number} cy + * @param {number} r + * @param {number} startAngle + * @param {number} endAngle + * @param {boolean} anticlockwise + * @param {number} lineWidth + * @param {number} x + * @param {number} y + * @return {Boolean} + */ + function isInsideArcStroke( + cx, cy, r, startAngle, endAngle, anticlockwise, + lineWidth, x, y + ) { + if (lineWidth === 0) { + return false; + } + var _l = Math.max(lineWidth, 5); + + x -= cx; + y -= cy; + var d = Math.sqrt(x * x + y * y); + if ((d - _l > r) || (d + _l < r)) { + return false; + } + if (anticlockwise) { + startAngle = normalizeRadian(endAngle); + endAngle = normalizeRadian(startAngle); } else { - data[i] = ((255 - data[i]) * level + data[i]) | 0; + startAngle = normalizeRadian(startAngle); + endAngle = normalizeRadian(endAngle); + } + if (startAngle > endAngle) { + endAngle += PI2; } + + var angle = Math.atan2(y, x); + if (angle < 0) { + angle += PI2; + } + return (angle >= startAngle && angle <= endAngle) + || (angle + PI2 >= startAngle && angle + PI2 <= endAngle); } - return 'rgb(' + data.join(',') + ')'; - } - /** - * 颜色翻转,[255-r,255-g,255-b,1-a] - * - * @param {string} color 颜色 - * @return {string} 翻转颜色 - */ - function reverse(color) { - var data = getData(toRGBA(color)); - data = map(data, - function(c) { - return 255 - c; - }); - return toColor(data, 'rgb'); - } + function isInsideBrokenLine(points, lineWidth, x, y) { + var lineWidth = Math.max(lineWidth, 10); + for (var i = 0, l = points.length - 1; i < l; i++) { + var x0 = points[i][0]; + var y0 = points[i][1]; + var x1 = points[i + 1][0]; + var y1 = points[i + 1][1]; - /** - * 简单两种颜色混合 - * - * @param {string} color1 第一种颜色 - * @param {string} color2 第二种颜色 - * @param {string} weight 混合权重[0-1] - * @return {string} 结果色,rgb(r,g,b)或rgba(r,g,b,a) - */ - function mix(color1, color2, weight) { - if(typeof weight === 'undefined') { - weight = 0.5; + if (isInsideLine(x0, y0, x1, y1, lineWidth, x, y)) { + return true; + } + } + + return false; } - weight = 1 - adjust(weight, [0, 1]); - var w = weight * 2 - 1; - var data1 = getData(toRGBA(color1)); - var data2 = getData(toRGBA(color2)); + function isInsideRing(cx, cy, r0, r, x, y) { + var d = (x - cx) * (x - cx) + (y - cy) * (y - cy); + return (d < r * r) && (d > r0 * r0); + } - var d = data1[3] - data2[3]; + /** + * 矩形包含判断 + */ + function isInsideRect(x0, y0, width, height, x, y) { + return x >= x0 && x <= (x0 + width) + && y >= y0 && y <= (y0 + height); + } - var weight1 = (((w * d === -1) ? w : (w + d) / (1 + w * d)) + 1) / 2; - var weight2 = 1 - weight1; + /** + * 圆形包含判断 + */ + function isInsideCircle(x0, y0, r, x, y) { + return (x - x0) * (x - x0) + (y - y0) * (y - y0) + < r * r; + } - var data = []; + /** + * 扇形包含判断 + */ + function isInsideSector(area, x, y) { + if (!isInsideRing(area.x, area.y, area.r0 || 0, area.r, x, y)) { + // 大圆外或者小圆内直接false + return false; + } - for ( var i = 0; i < 3; i++) { - data[i] = data1[i] * weight1 + data2[i] * weight2; + // 判断夹角 + if (Math.abs(area.endAngle - area.startAngle) >= 360) { + // 大于360度的扇形,在环内就为true + return true; + } + + var angle = (360 + - Math.atan2(y - area.y, x - area.x) / Math.PI + * 180) + % 360; + var endA = (360 + area.endAngle) % 360; + var startA = (360 + area.startAngle) % 360; + if (endA > startA) { + return (angle >= startA && angle <= endA); + } + + return !(angle >= endA && angle <= startA); } - var alpha = data1[3] * weight + data2[3] * (1 - weight); - alpha = Math.max(0, Math.min(1, alpha)); + /** + * 多边形包含判断 + * 与 canvas 一样采用 non-zero winding rule + */ + function isInsidePolygon(points, x, y) { + var N = points.length; + var w = 0; - if (data1[3] === 1 && data2[3] === 1) {// 不考虑透明度 - return toColor(data, 'rgb'); + for (var i = 0, j = N - 1; i < N; i++) { + var x0 = points[j][0]; + var y0 = points[j][1]; + var x1 = points[i][0]; + var y1 = points[i][1]; + w += windingLine(x0, y0, x1, y1, x, y); + j = i; + } + return w !== 0; } - data[3] = alpha; - return toColor(data, 'rgba'); - } - /** - * 随机颜色 - * - * @return {string} 颜色值,#rrggbb格式 - */ - function random() { - return '#' + Math.random().toString(16).slice(2, 8); - } + function windingLine(x0, y0, x1, y1, x, y) { + if ((y > y0 && y > y1) || (y < y0 && y < y1)) { + return 0; + } + if (y1 == y0) { + return 0; + } + var dir = y1 < y0 ? 1 : -1; + var t = (y - y0) / (y1 - y0); + var x_ = t * (x1 - x0) + x0; - /** - * 获取颜色值数组,返回值范围:
- * RGB 范围[0-255]
- * HSL/HSV/HSB 范围[0-1]
- * A透明度范围[0-1] - * 支持格式: - * #rgb - * #rrggbb - * rgb(r,g,b) - * rgb(r%,g%,b%) - * rgba(r,g,b,a) - * hsb(h,s,b) // hsv与hsb等价 - * hsb(h%,s%,b%) - * hsba(h,s,b,a) - * hsl(h,s,l) - * hsl(h%,s%,l%) - * hsla(h,s,l,a) - * - * @param {string} color 颜色 - * @return {Array} 颜色值数组或null - */ - function getData(color) { - color = normalize(color); - var r = color.match(colorRegExp); - if (r === null) { - throw new Error('The color format error'); // 颜色格式错误 + return x_ > x ? dir : 0; } - var d; - var a; - var data = []; - var rgb; - if (r[2]) { - // #rrggbb - d = r[2].replace('#', '').split(''); - rgb = [d[0] + d[1], d[2] + d[3], d[4] + d[5]]; - data = map(rgb, - function(c) { - return adjust(parseInt(c, 16), [0, 255]); - }); + // 临时数组 + var roots = [-1, -1, -1]; + var extrema = [-1, -1]; + function swapExtrema() { + var tmp = extrema[0]; + extrema[0] = extrema[1]; + extrema[1] = tmp; } - else if (r[4]) { - // rgb rgba - var rgba = (r[4]).split(','); - a = rgba[3]; - rgb = rgba.slice(0, 3); - data = map( - rgb, - function(c) { - c = Math.floor( - c.indexOf('%') > 0 ? parseInt(c, 0) * 2.55 : c - ); - return adjust(c, [0, 255]); + function windingCubic(x0, y0, x1, y1, x2, y2, x3, y3, x, y) { + // Quick reject + if ( + (y > y0 && y > y1 && y > y2 && y > y3) + || (y < y0 && y < y1 && y < y2 && y < y3) + ) { + return 0; + } + var nRoots = curve.cubicRootAt(y0, y1, y2, y3, y, roots); + if (nRoots === 0) { + return 0; + } + else { + var w = 0; + var nExtrema = -1; + var y0_, y1_; + for (var i = 0; i < nRoots; i++) { + var t = roots[i]; + var x_ = curve.cubicAt(x0, x1, x2, x3, t); + if (x_ < x) { // Quick reject + continue; + } + if (nExtrema < 0) { + nExtrema = curve.cubicExtrema(y0, y1, y2, y3, extrema); + if (extrema[1] < extrema[0] && nExtrema > 1) { + swapExtrema(); + } + y0_ = curve.cubicAt(y0, y1, y2, y3, extrema[0]); + if (nExtrema > 1) { + y1_ = curve.cubicAt(y0, y1, y2, y3, extrema[1]); + } + } + if (nExtrema == 2) { + // 分成三段单调函数 + if (t < extrema[0]) { + w += y0_ < y0 ? 1 : -1; + } + else if (t < extrema[1]) { + w += y1_ < y0_ ? 1 : -1; + } + else { + w += y3 < y1_ ? 1 : -1; + } + } + else { + // 分成两段单调函数 + if (t < extrema[0]) { + w += y0_ < y0 ? 1 : -1; + } + else { + w += y3 < y0_ ? 1 : -1; + } + } } - ); - - if(typeof a !== 'undefined') { - data.push(adjust(parseFloat(a), [0, 1])); + return w; } } - else if (r[5] || r[6]) { - // hsb hsba hsl hsla - var hsxa = (r[5] || r[6]).split(','); - var h = parseInt(hsxa[0], 0) / 360; - var s = hsxa[1]; - var x = hsxa[2]; - a = hsxa[3]; - data = map([s, x], - function(c) { - return adjust(parseFloat(c) / 100, [0, 1]); - }); - data.unshift(h); - if( typeof a !== 'undefined') { - data.push(adjust(parseFloat(a), [0, 1])); + + function windingQuadratic(x0, y0, x1, y1, x2, y2, x, y) { + // Quick reject + if ( + (y > y0 && y > y1 && y > y2) + || (y < y0 && y < y1 && y < y2) + ) { + return 0; + } + var nRoots = curve.quadraticRootAt(y0, y1, y2, y, roots); + if (nRoots === 0) { + return 0; + } + else { + var t = curve.quadraticExtremum(y0, y1, y2); + if (t >=0 && t <= 1) { + var w = 0; + var y_ = curve.quadraticAt(y0, y1, y2, t); + for (var i = 0; i < nRoots; i++) { + var x_ = curve.quadraticAt(x0, x1, x2, roots[i]); + if (x_ > x) { + continue; + } + if (roots[i] < t) { + w += y_ < y0 ? 1 : -1; + } + else { + w += y2 < y_ ? 1 : -1; + } + } + return w; + } + else { + var x_ = curve.quadraticAt(x0, x1, x2, roots[0]); + if (x_ > x) { + return 0; + } + return y2 < y0 ? 1 : -1; + } } } - return data; - } + + // TODO + // Arc 旋转 + function windingArc( + cx, cy, r, startAngle, endAngle, anticlockwise, x, y + ) { + y -= cy; + if (y > r || y < -r) { + return 0; + } + var tmp = Math.sqrt(r * r - y * y); + roots[0] = -tmp; + roots[1] = tmp; - /** - * 设置颜色透明度 - * @param {string} color 颜色 - * @param {number} alpha 透明度,区间[0,1] - * @return {string} rgba颜色值 - */ - function alpha(color, a) { - if (a === null) { - a = 1; + if (anticlockwise) { + startAngle = normalizeRadian(endAngle); + endAngle = normalizeRadian(startAngle); + } else { + startAngle = normalizeRadian(startAngle); + endAngle = normalizeRadian(endAngle); + } + if (startAngle > endAngle) { + endAngle += PI2; + } + + var w = 0; + for (var i = 0; i < 2; i++) { + var x_ = roots[i]; + if (x_ + cx > x) { + var angle = Math.atan2(y, x_); + var dir = anticlockwise ? 1 : -1; + if (angle < 0) { + angle = PI2 + angle; + } + if ( + (angle >= startAngle && angle <= endAngle) + || (angle + PI2 >= startAngle && angle + PI2 <= endAngle) + ) { + if (angle > Math.PI / 2 && angle < Math.PI * 1.5) { + dir = -dir; + } + w += dir; + } + } + } + return w; } - var data = getData(toRGBA(color)); - data[3] = adjust(Number(a).toFixed(4), [0, 1]); - return toColor(data, 'rgba'); - } + /** + * 路径包含判断 + * 与 canvas 一样采用 non-zero winding rule + */ + function isInsidePath(pathArray, lineWidth, brushType, x, y) { + var w = 0; + var xi = 0; + var yi = 0; + var x0 = 0; + var y0 = 0; + var beginSubpath = true; - // 数组映射 - function map(array, fun) { - if (typeof fun !== 'function') { - throw new TypeError(); - } - var len = array ? array.length : 0; - for ( var i = 0; i < len; i++) { - array[i] = fun(array[i]); - } - return array; - } + var hasStroke = brushType === 'stroke' || brushType === 'both'; + var hasFill = brushType === 'fill' || brushType === 'both'; - // 调整值区间 - function adjust(value, region) { - // < to <= & > to >= - // modify by linzhifeng 2014-05-25 because -0 == 0 - if (value <= region[0]) { - value = region[0]; - } - else if (value >= region[1]) { - value = region[1]; + // var roots = [-1, -1, -1]; + for (var i = 0; i < pathArray.length; i++) { + var seg = pathArray[i]; + var p = seg.points; + // Begin a new subpath + if (beginSubpath || seg.command === 'M') { + if (i > 0) { + // Close previous subpath + if (hasFill) { + w += windingLine(xi, yi, x0, y0, x, y); + } + if (w !== 0) { + return true; + } + } + x0 = p[p.length - 2]; + y0 = p[p.length - 1]; + beginSubpath = false; + } + switch (seg.command) { + case 'M': + xi = p[0]; + yi = p[1]; + break; + case 'L': + if (hasStroke) { + if (isInsideLine( + xi, yi, p[0], p[1], lineWidth, x, y + )) { + return true; + } + } + if (hasFill) { + w += windingLine(xi, yi, p[0], p[1], x, y); + } + xi = p[0]; + yi = p[1]; + break; + case 'C': + if (hasStroke) { + if (isInsideCubicStroke( + xi, yi, p[0], p[1], p[2], p[3], p[4], p[5], + lineWidth, x, y + )) { + return true; + } + } + if (hasFill) { + w += windingCubic( + xi, yi, p[0], p[1], p[2], p[3], p[4], p[5], x, y + ); + } + xi = p[4]; + yi = p[5]; + break; + case 'Q': + if (hasStroke) { + if (isInsideQuadraticStroke( + xi, yi, p[0], p[1], p[2], p[3], + lineWidth, x, y + )) { + return true; + } + } + if (hasFill) { + w += windingQuadratic( + xi, yi, p[0], p[1], p[2], p[3], x, y + ); + } + xi = p[2]; + yi = p[3]; + break; + case 'A': + // TODO Arc 旋转 + // TODO Arc 判断的开销比较大 + var cx = p[0]; + var cy = p[1]; + var rx = p[2]; + var ry = p[3]; + var theta = p[4]; + var dTheta = p[5]; + var x1 = Math.cos(theta) * rx + cx; + var y1 = Math.sin(theta) * ry + cy; + w += windingLine(xi, yi, x1, y1); + // zr 使用scale来模拟椭圆, 这里也对x做一定的缩放 + var _x = (x - cx) * ry / rx + cx; + if (hasStroke) { + if (isInsideArcStroke( + cx, cy, ry, theta, theta + dTheta, 1 - p[7], + lineWidth, _x, y + )) { + return true; + } + } + if (hasFill) { + w += windingArc( + cx, cy, ry, theta, theta + dTheta, 1 - p[7], + _x, y + ); + } + xi = Math.cos(theta + dTheta) * rx + cx; + yi = Math.sin(theta + dTheta) * ry + cy; + break; + case 'z': + if (hasStroke) { + if (isInsideLine( + xi, yi, x0, y0, lineWidth, x, y + )) { + return true; + } + } + beginSubpath = true; + break; + } + } + if (hasFill) { + w += windingLine(xi, yi, x0, y0, x, y); + } + return w !== 0; } - return value; - } - // 参见 http:// www.easyrgb.com/index.php?X=MATH - function _HSV_2_RGB(data) { - var H = data[0]; - var S = data[1]; - var V = data[2]; - // HSV from 0 to 1 - var R, G, B; - if (S === 0) { - R = V * 255; - G = V * 255; - B = V * 255; - } else { - var h = H * 6; - if (h === 6) { - h = 0; + /** + * 测算多行文本宽度 + * @param {Object} text + * @param {Object} textFont + */ + function getTextWidth(text, textFont) { + var key = text + ':' + textFont; + if (_textWidthCache[key]) { + return _textWidthCache[key]; } - var i = h | 0; - var v1 = V * (1 - S); - var v2 = V * (1 - S * (h - i)); - var v3 = V * (1 - S * (1 - (h - i))); - var r = 0; - var g = 0; - var b = 0; + _ctx = _ctx || util.getContext(); + _ctx.save(); - if (i === 0) { - r = V; - g = v3; - b = v1; - } else if (i === 1) { - r = v2; - g = V; - b = v1; - } else if (i === 2) { - r = v1; - g = V; - b = v3; - } else if (i === 3) { - r = v1; - g = v2; - b = V; - } else if (i === 4) { - r = v3; - g = v1; - b = V; - } else { - r = V; - g = v1; - b = v2; + if (textFont) { + _ctx.font = textFont; + } + + text = (text + '').split('\n'); + var width = 0; + for (var i = 0, l = text.length; i < l; i++) { + width = Math.max( + _ctx.measureText(text[i]).width, + width + ); } + _ctx.restore(); - // RGB results from 0 to 255 - R = r * 255; - G = g * 255; - B = b * 255; + _textWidthCache[key] = width; + if (++_textWidthCacheCounter > TEXT_CACHE_MAX) { + // 内存释放 + _textWidthCacheCounter = 0; + _textWidthCache = {}; + } + + return width; } - return [ R, G, B ]; - } + + /** + * 测算多行文本高度 + * @param {Object} text + * @param {Object} textFont + */ + function getTextHeight(text, textFont) { + var key = text + ':' + textFont; + if (_textHeightCache[key]) { + return _textHeightCache[key]; + } + + _ctx = _ctx || util.getContext(); - function _HSL_2_RGB(data) { - var H = data[0]; - var S = data[1]; - var L = data[2]; - // HSL from 0 to 1 - var R, G, B; - if (S === 0) { - R = L * 255; - G = L * 255; - B = L * 255; - } else { - var v2; - if (L < 0.5) { - v2 = L * (1 + S); - } else { - v2 = (L + S) - (S * L); + _ctx.save(); + if (textFont) { + _ctx.font = textFont; } + + text = (text + '').split('\n'); + // 比较粗暴 + var height = (_ctx.measureText('国').width + 2) * text.length; - var v1 = 2 * L - v2; + _ctx.restore(); - R = 255 * _HUE_2_RGB(v1, v2, H + (1 / 3)); - G = 255 * _HUE_2_RGB(v1, v2, H); - B = 255 * _HUE_2_RGB(v1, v2, H - (1 / 3)); + _textHeightCache[key] = height; + if (++_textHeightCacheCounter > TEXT_CACHE_MAX) { + // 内存释放 + _textHeightCacheCounter = 0; + _textHeightCache = {}; + } + return height; } - return [ R, G, B ]; + + return { + isInside : isInside, + isOutside : isOutside, + getTextWidth : getTextWidth, + getTextHeight : getTextHeight, + + isInsidePath: isInsidePath, + isInsidePolygon: isInsidePolygon, + isInsideSector: isInsideSector, + isInsideCircle: isInsideCircle, + isInsideLine: isInsideLine, + isInsideRect: isInsideRect, + isInsideBrokenLine: isInsideBrokenLine + }; } +); - function _HUE_2_RGB(v1, v2, vH) { - if (vH < 0) { - vH += 1; - } - if (vH > 1) { - vH -= 1; - } - if ((6 * vH) < 1) { - return (v1 + (v2 - v1) * 6 * vH); +/** + * 提供变换扩展 + * @module zrender/mixin/Transformable + * @author pissang (https://www.github.com/pissang) + */ +define('zrender/mixin/Transformable',['require','../tool/matrix','../tool/vector'],function (require) { + + + + var matrix = require('../tool/matrix'); + var vector = require('../tool/vector'); + var origin = [ 0, 0 ]; + + var EPSILON = 5e-5; + + function isAroundZero(val) { + return val > -EPSILON && val < EPSILON; + } + function isNotAroundZero(val) { + return val > EPSILON || val < -EPSILON; + } + + /** + * @alias module:zrender/mixin/Transformable + * @constructor + */ + var Transformable = function () { + + if (!this.position) { + /** + * 平移 + * @type {Array.} + * @default [0, 0] + */ + this.position = [ 0, 0 ]; } - if ((2 * vH) < 1) { - return (v2); + if (typeof(this.rotation) == 'undefined') { + /** + * 旋转,可以通过数组二三项指定旋转的原点 + * @type {Array.} + * @default [0, 0, 0] + */ + this.rotation = [ 0, 0, 0 ]; } - if ((3 * vH) < 2) { - return (v1 + (v2 - v1) * ((2 / 3) - vH) * 6); + if (!this.scale) { + /** + * 缩放,可以通过数组三四项指定缩放的原点 + * @type {Array.} + * @default [1, 1, 0, 0] + */ + this.scale = [ 1, 1, 0, 0 ]; } - return v1; - } - function _RGB_2_HSB(data) { - // RGB from 0 to 255 - var R = (data[0] / 255); - var G = (data[1] / 255); - var B = (data[2] / 255); + this.needLocalTransform = false; - var vMin = Math.min(R, G, B); // Min. value of RGB - var vMax = Math.max(R, G, B); // Max. value of RGB - var delta = vMax - vMin; // Delta RGB value - var V = vMax; - var H; - var S; + /** + * 是否有坐标变换 + * @type {boolean} + * @readOnly + */ + this.needTransform = false; + }; - // HSV results from 0 to 1 - if (delta === 0) { - H = 0; - S = 0; - } else { - S = delta / vMax; + Transformable.prototype = { + + constructor: Transformable, - var deltaR = (((vMax - R) / 6) + (delta / 2)) / delta; - var deltaG = (((vMax - G) / 6) + (delta / 2)) / delta; - var deltaB = (((vMax - B) / 6) + (delta / 2)) / delta; + updateNeedTransform: function () { + this.needLocalTransform = isNotAroundZero(this.rotation[0]) + || isNotAroundZero(this.position[0]) + || isNotAroundZero(this.position[1]) + || isNotAroundZero(this.scale[0] - 1) + || isNotAroundZero(this.scale[1] - 1); + }, - if (R === vMax) { - H = deltaB - deltaG; - } else if (G === vMax) { - H = (1 / 3) + deltaR - deltaB; - } else if (B === vMax) { - H = (2 / 3) + deltaG - deltaR; - } + /** + * 判断是否需要有坐标变换,更新needTransform属性。 + * 如果有坐标变换, 则从position, rotation, scale以及父节点的transform计算出自身的transform矩阵 + */ + updateTransform: function () { + + this.updateNeedTransform(); - if (H < 0) { - H += 1; + if (this.parent) { + this.needTransform = this.needLocalTransform || this.parent.needTransform; } - if (H > 1) { - H -= 1; + else { + this.needTransform = this.needLocalTransform; + } + + if (!this.needTransform) { + return; } - } - H = H * 360; - S = S * 100; - V = V * 100; - return [ H, S, V ]; - } - function _RGB_2_HSL(data) { - // RGB from 0 to 255 - var R = (data[0] / 255); - var G = (data[1] / 255); - var B = (data[2] / 255); + var m = this.transform || matrix.create(); + matrix.identity(m); - var vMin = Math.min(R, G, B); // Min. value of RGB - var vMax = Math.max(R, G, B); // Max. value of RGB - var delta = vMax - vMin; // Delta RGB value + if (this.needLocalTransform) { + if ( + isNotAroundZero(this.scale[0]) + || isNotAroundZero(this.scale[1]) + ) { + origin[0] = -this.scale[2] || 0; + origin[1] = -this.scale[3] || 0; + var haveOrigin = isNotAroundZero(origin[0]) + || isNotAroundZero(origin[1]); + if (haveOrigin) { + matrix.translate( + m, m, origin + ); + } + matrix.scale(m, m, this.scale); + if (haveOrigin) { + origin[0] = -origin[0]; + origin[1] = -origin[1]; + matrix.translate( + m, m, origin + ); + } + } - var L = (vMax + vMin) / 2; - var H; - var S; - // HSL results from 0 to 1 - if (delta === 0) { - H = 0; - S = 0; - } else { - if (L < 0.5) { - S = delta / (vMax + vMin); - } else { - S = delta / (2 - vMax - vMin); + if (this.rotation instanceof Array) { + if (this.rotation[0] !== 0) { + origin[0] = -this.rotation[1] || 0; + origin[1] = -this.rotation[2] || 0; + var haveOrigin = isNotAroundZero(origin[0]) + || isNotAroundZero(origin[1]); + if (haveOrigin) { + matrix.translate( + m, m, origin + ); + } + matrix.rotate(m, m, this.rotation[0]); + if (haveOrigin) { + origin[0] = -origin[0]; + origin[1] = -origin[1]; + matrix.translate( + m, m, origin + ); + } + } + } + else { + if (this.rotation !== 0) { + matrix.rotate(m, m, this.rotation); + } + } + + if ( + isNotAroundZero(this.position[0]) || isNotAroundZero(this.position[1]) + ) { + matrix.translate(m, m, this.position); + } } - var deltaR = (((vMax - R) / 6) + (delta / 2)) / delta; - var deltaG = (((vMax - G) / 6) + (delta / 2)) / delta; - var deltaB = (((vMax - B) / 6) + (delta / 2)) / delta; + // 保存这个变换矩阵 + this.transform = m; - if (R === vMax) { - H = deltaB - deltaG; - } else if (G === vMax) { - H = (1 / 3) + deltaR - deltaB; - } else if (B === vMax) { - H = (2 / 3) + deltaG - deltaR; + // 应用父节点变换 + if (this.parent && this.parent.needTransform) { + if (this.needLocalTransform) { + matrix.mul(this.transform, this.parent.transform, this.transform); + } + else { + matrix.copy(this.transform, this.parent.transform); + } } - - if (H < 0) { - H += 1; + }, + /** + * 将自己的transform应用到context上 + * @param {Context2D} ctx + */ + setTransform: function (ctx) { + if (this.needTransform) { + var m = this.transform; + ctx.transform( + m[0], m[1], + m[2], m[3], + m[4], m[5] + ); } - - if (H > 1) { - H -= 1; + }, + /** + * 设置图形的朝向 + * @param {Array.|Float32Array} target + * @method + */ + lookAt: (function () { + var v = vector.create(); + return function(target) { + if (!this.transform) { + this.transform = matrix.create(); + } + var m = this.transform; + vector.sub(v, target, this.position); + if (isAroundZero(v[0]) && isAroundZero(v[1])) { + return; + } + vector.normalize(v, v); + // Y Axis + // TODO Scale origin ? + m[2] = v[0] * this.scale[1]; + m[3] = v[1] * this.scale[1]; + // X Axis + m[0] = v[1] * this.scale[0]; + m[1] = -v[0] * this.scale[0]; + // Position + m[4] = this.position[0]; + m[5] = this.position[1]; + + this.decomposeTransform(); + }; + })(), + /** + * 分解`transform`矩阵到`position`, `rotation`, `scale` + */ + decomposeTransform: function () { + if (!this.transform) { + return; } + var m = this.transform; + var sx = m[0] * m[0] + m[1] * m[1]; + var position = this.position; + var scale = this.scale; + var rotation = this.rotation; + if (isNotAroundZero(sx - 1)) { + sx = Math.sqrt(sx); + } + var sy = m[2] * m[2] + m[3] * m[3]; + if (isNotAroundZero(sy - 1)) { + sy = Math.sqrt(sy); + } + position[0] = m[4]; + position[1] = m[5]; + scale[0] = sx; + scale[1] = sy; + scale[2] = scale[3] = 0; + rotation[0] = Math.atan2(-m[1] / sy, m[0] / sx); + rotation[1] = rotation[2] = 0; } - - H = H * 360; - S = S * 100; - L = L * 100; - - return [ H, S, L ]; - } - - return { - customPalette : customPalette, - resetPalette : resetPalette, - getColor : getColor, - getHighlightColor : getHighlightColor, - customHighlight : customHighlight, - resetHighlight : resetHighlight, - getRadialGradient : getRadialGradient, - getLinearGradient : getLinearGradient, - getGradientColors : getGradientColors, - getStepColors : getStepColors, - reverse : reverse, - mix : mix, - lift : lift, - trim : trim, - random : random, - toRGB : toRGB, - toRGBA : toRGBA, - toHex : toHex, - toHSL : toHSL, - toHSLA : toHSLA, - toHSB : toHSB, - toHSBA : toHSBA, - toHSV : toHSV, - toHSVA : toHSVA, - toName : toName, - toColor : toColor, - toArray : toArray, - alpha : alpha, - getData : getData }; -}); + return Transformable; +}); /** - * zrender : shape基类 - * - * desc: zrender是一个轻量级的Canvas类库,MVC封装,数据驱动,提供类Dom事件模型。 - * author: Kener (@Kener-林峰, linzhifeng@baidu.com) - * errorrik (errorrik@gmail.com) - * - * 可配图形属性: - { - // 基础属性,详见各shape - shape : {string}, // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 变换 - position : {array}, // 默认为[0, 0], shape的坐标 - rotation : {number|array}, // 默认为[0, 0, 0],shape绕自身旋转的角度,不被translate 影响 - // 后两个值为旋转的origin - scale : {array}, // 默认为[1, 1, 0, 0], shape纵横缩放比例,不被translate影响 - // 后两个值为缩放的origin - - // 样式属性,详见各shape,默认状态样式属性 - style : {Object}, - - // 样式属性,详见各shape,高亮样式属性,当不存在highlightStyle时使用默认样式扩展显示 - highlightStyle : {Object}, - - // 交互属性,zrender支持,非图形类实现 - hoverable : {boolean}, // 默认为true,可悬浮响应,默认悬浮响应为高亮显示 - // 可在onbrush中捕获并阻塞高亮绘画 - clickable : {boolean}, // 默认为false,可点击响应,影响鼠标hover时图标是否为可点击样式 - // 为false则阻断点击事件抛出,为true可在onclick中捕获 - draggable : {boolean}, // 默认为false,可拖拽响应,默认拖拽响应改变图形位置, - // 可在ondrift中捕获并阻塞默认拖拽行为 - - // 事件属性 - onbrush : {Function}, // 默认为null,当前图形被刷画时回调,可用于实现自定义绘画 - // 回传参数为: - // @param {2D Context} context 当前canvas context - // @param {Object} shape 当前shape - // @param {boolean} isHighlight 是否高亮 - // @return {boolean} 回调返回true则不执行默认绘画 - ondrift : {Function}, // 默认为null,当前图形被拖拽改变位置时回调,可用于限制拖拽范围 - // 回传参数为: - // @param {Object} shape 当前shape - // @param {number} dx x方向变化 - // @param {number} dy y方向变化 - onclick : {Function}, // 默认为null,当前图形点击响应,回传参数为: - // @param {Object} eventPacket 对象内容如下: - // @param {string} eventPacket.type 事件类型,EVENT.CLICK - // @param {event} eventPacket.event 原始dom事件对象 - // @param {Object} eventPacket.target 当前图形shape对象 - // @return {boolean} 回调返回true则阻止抛出全局事件 - - onmousewheel : {Function}, // 默认为null,当前图形上鼠标滚轮触发,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.MOUSEWHEEL - // @return {boolean} 回调返回true则阻止抛出全局事件 - - onmousemove : {Function}, // 默认为null,当前图上形鼠标(或手指)移动触发,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.MOUSEMOVE - // @return {boolean} 回调返回true则阻止抛出全局事件 - - onmouseover : {Function}, // 默认为null,鼠标(或手指)移动到当前图形上触发,回传参数格式同onclick: - // 事件类型为confit.EVENT.MOUSEOVER - // @return {boolean} 回调返回true则阻止抛出全局事件 - - onmouseout : {Function}, // 默认为null,鼠标(或手指)从当前图形移开,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.MOUSEOUT - // @return {boolean} 回调返回true则阻止抛出全局事件 - - onmousedown : {Function}, // 默认为null,鼠标按钮(或手指)按下,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.MOUSEDOWN - // @return {boolean} 回调返回true则阻止抛出全局事件 - - onmouseup : {Function}, // 默认为null,鼠标按钮(或手指)松开,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.MOUSEUP - // @return {boolean} 回调返回true则阻止抛出全局事件 - - ondragstart : {Function}, // 默认为null,开始拖拽时触发,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.DRAGSTART - // @return {boolean} 回调返回true则阻止抛出全局事件 - - ondragend : {Function}, // 默认为null,拖拽完毕时触发,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.DRAGEND - // @return {boolean} 回调返回true则阻止抛出全局事件 - - ondragenter : {Function}, // 默认为null,拖拽图形元素进入目标图形元素时触发 - // 回传参数格式同onclick,其中: - // @param {string} eventPacket.type 事件类型,EVENT.DRAGENTER - // @param {Object} eventPacket.target 目标图形元素shape对象 - // @param {Object} eventPacket.dragged 拖拽图形元素shape对象 - // @return {boolean} 回调返回true则阻止抛出全局事件 - - ondragover : {Function}, // 默认为null,拖拽图形元素在目标图形元素上移动时触发, - // 回传参数格式同onclick,其中: - // @param {string} eventPacket.type 事件类型,EVENT.DRAGOVER - // @param {Object} eventPacket.target 目标图形元素shape对象 - // @param {Object} eventPacket.dragged 拖拽图形元素shape对象 - // @return {boolean} 回调返回true则阻止抛出全局事件 - - ondragleave : {Function}, // 默认为null,拖拽图形元素离开目标图形元素时触发, - // 回传参数格式同onclick,其中: - // @param {string} eventPacket.type 事件类型,EVENT.DRAGLEAVE - // @param {Object} eventPacket.target 目标图形元素shape对象 - // @param {Object} eventPacket.dragged 拖拽图形元素shape对象 - // @return {boolean} 回调返回true则阻止抛出全局事件 - - ondrop : {Function}, // 默认为null,拖拽图形元素放在目标图形元素内时触发, - // 回传参数格式同onclick,其中: - // @param {string} eventPacket.type 事件类型,EVENT.DRAG - // @param {Object} eventPacket.target 目标图形元素shape对象 - // @param {Object} eventPacket.dragged 拖拽图形元素shape对象 - // @return {boolean} 回调返回true则阻止抛出全局事件 - } + * 颜色辅助类 + * @module zrender/tool/color + * @author CrossDo (chenhuaimu@baidu.com) */ -define( - 'zrender/shape/Base',['require','../tool/matrix','../tool/guid','../tool/util','./mixin/Transformable','../tool/event','../tool/area','../tool/area','../tool/color','../tool/area'],function(require) { - var matrix = require('../tool/matrix'); - var guid = require('../tool/guid'); - var util = require('../tool/util'); - - var Transformable = require('./mixin/Transformable'); - var Dispatcher = require('../tool/event').Dispatcher; - - function _fillText(ctx, text, x, y, textFont, textAlign, textBaseline) { - if (textFont) { - ctx.font = textFont; - } - ctx.textAlign = textAlign; - ctx.textBaseline = textBaseline; - var rect = _getTextRect( - text, x, y, textFont, textAlign, textBaseline - ); - - text = (text + '').split('\n'); - var lineHeight = require('../tool/area').getTextHeight('国', textFont); - - switch (textBaseline) { - case 'top': - y = rect.y; - break; - case 'bottom': - y = rect.y + lineHeight; - break; - default: - y = rect.y + lineHeight / 2; - } - - for (var i = 0, l = text.length; i < l; i++) { - ctx.fillText(text[i], x, y); - y += lineHeight; - } - } - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * - * @inner - * @param {Object} style - */ - function _getTextRect(text, x, y, textFont, textAlign, textBaseline) { - var area = require('../tool/area'); - var width = area.getTextWidth(text, textFont); - var lineHeight = area.getTextHeight('国', textFont); - - text = (text + '').split('\n'); - - switch (textAlign) { - case 'end': - case 'right': - x -= width; - break; - case 'center': - x -= (width / 2); - break; - } - - switch (textBaseline) { - case 'top': - break; - case 'bottom': - y -= lineHeight * text.length; - break; - default: - y -= lineHeight * text.length / 2; - } - - return { - x : x, - y : y, - width : width, - height : lineHeight * text.length - }; - } - - function Base( options ) { - - options = options || {}; - - this.id = options.id || guid(); - - for ( var key in options ) { - this[ key ] = options[ key ]; - } - - this.style = this.style || {}; - - this.parent = null; - - this.__dirty = true; +define('zrender/tool/color',['require','../tool/util'],function(require) { + var util = require('../tool/util'); - Transformable.call(this); - Dispatcher.call(this); - } + var _ctx; - Base.prototype.invisible = false; + // Color palette is an array containing the default colors for the chart's + // series. + // When all colors are used, new colors are selected from the start again. + // Defaults to: + // 默认色板 + var palette = [ + '#ff9277', ' #dddd00', ' #ffc877', ' #bbe3ff', ' #d5ffbb', + '#bbbbff', ' #ddb000', ' #b0dd00', ' #e2bbff', ' #ffbbe3', + '#ff7777', ' #ff9900', ' #83dd00', ' #77e3ff', ' #778fff', + '#c877ff', ' #ff77ab', ' #ff6600', ' #aa8800', ' #77c7ff', + '#ad77ff', ' #ff77ff', ' #dd0083', ' #777700', ' #00aa00', + '#0088aa', ' #8400dd', ' #aa0088', ' #dd0000', ' #772e00' + ]; + var _palette = palette; - Base.prototype.ignore = false; + var highlightColor = 'rgba(255,255,0,0.5)'; + var _highlightColor = highlightColor; - Base.prototype.zlevel = 0; + // 颜色格式 + /*jshint maxlen: 330 */ + var colorRegExp = /^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i; - Base.prototype.draggable = false; + var _nameColors = { + aliceblue : '#f0f8ff', + antiquewhite : '#faebd7', + aqua : '#0ff', + aquamarine : '#7fffd4', + azure : '#f0ffff', + beige : '#f5f5dc', + bisque : '#ffe4c4', + black : '#000', + blanchedalmond : '#ffebcd', + blue : '#00f', + blueviolet : '#8a2be2', + brown : '#a52a2a', + burlywood : '#deb887', + cadetblue : '#5f9ea0', + chartreuse : '#7fff00', + chocolate : '#d2691e', + coral : '#ff7f50', + cornflowerblue : '#6495ed', + cornsilk : '#fff8dc', + crimson : '#dc143c', + cyan : '#0ff', + darkblue : '#00008b', + darkcyan : '#008b8b', + darkgoldenrod : '#b8860b', + darkgray : '#a9a9a9', + darkgrey : '#a9a9a9', + darkgreen : '#006400', + darkkhaki : '#bdb76b', + darkmagenta : '#8b008b', + darkolivegreen : '#556b2f', + darkorange : '#ff8c00', + darkorchid : '#9932cc', + darkred : '#8b0000', + darksalmon : '#e9967a', + darkseagreen : '#8fbc8f', + darkslateblue : '#483d8b', + darkslategray : '#2f4f4f', + darkslategrey : '#2f4f4f', + darkturquoise : '#00ced1', + darkviolet : '#9400d3', + deeppink : '#ff1493', + deepskyblue : '#00bfff', + dimgray : '#696969', + dimgrey : '#696969', + dodgerblue : '#1e90ff', + firebrick : '#b22222', + floralwhite : '#fffaf0', + forestgreen : '#228b22', + fuchsia : '#f0f', + gainsboro : '#dcdcdc', + ghostwhite : '#f8f8ff', + gold : '#ffd700', + goldenrod : '#daa520', + gray : '#808080', + grey : '#808080', + green : '#008000', + greenyellow : '#adff2f', + honeydew : '#f0fff0', + hotpink : '#ff69b4', + indianred : '#cd5c5c', + indigo : '#4b0082', + ivory : '#fffff0', + khaki : '#f0e68c', + lavender : '#e6e6fa', + lavenderblush : '#fff0f5', + lawngreen : '#7cfc00', + lemonchiffon : '#fffacd', + lightblue : '#add8e6', + lightcoral : '#f08080', + lightcyan : '#e0ffff', + lightgoldenrodyellow : '#fafad2', + lightgray : '#d3d3d3', + lightgrey : '#d3d3d3', + lightgreen : '#90ee90', + lightpink : '#ffb6c1', + lightsalmon : '#ffa07a', + lightseagreen : '#20b2aa', + lightskyblue : '#87cefa', + lightslategray : '#789', + lightslategrey : '#789', + lightsteelblue : '#b0c4de', + lightyellow : '#ffffe0', + lime : '#0f0', + limegreen : '#32cd32', + linen : '#faf0e6', + magenta : '#f0f', + maroon : '#800000', + mediumaquamarine : '#66cdaa', + mediumblue : '#0000cd', + mediumorchid : '#ba55d3', + mediumpurple : '#9370d8', + mediumseagreen : '#3cb371', + mediumslateblue : '#7b68ee', + mediumspringgreen : '#00fa9a', + mediumturquoise : '#48d1cc', + mediumvioletred : '#c71585', + midnightblue : '#191970', + mintcream : '#f5fffa', + mistyrose : '#ffe4e1', + moccasin : '#ffe4b5', + navajowhite : '#ffdead', + navy : '#000080', + oldlace : '#fdf5e6', + olive : '#808000', + olivedrab : '#6b8e23', + orange : '#ffa500', + orangered : '#ff4500', + orchid : '#da70d6', + palegoldenrod : '#eee8aa', + palegreen : '#98fb98', + paleturquoise : '#afeeee', + palevioletred : '#d87093', + papayawhip : '#ffefd5', + peachpuff : '#ffdab9', + peru : '#cd853f', + pink : '#ffc0cb', + plum : '#dda0dd', + powderblue : '#b0e0e6', + purple : '#800080', + red : '#f00', + rosybrown : '#bc8f8f', + royalblue : '#4169e1', + saddlebrown : '#8b4513', + salmon : '#fa8072', + sandybrown : '#f4a460', + seagreen : '#2e8b57', + seashell : '#fff5ee', + sienna : '#a0522d', + silver : '#c0c0c0', + skyblue : '#87ceeb', + slateblue : '#6a5acd', + slategray : '#708090', + slategrey : '#708090', + snow : '#fffafa', + springgreen : '#00ff7f', + steelblue : '#4682b4', + tan : '#d2b48c', + teal : '#008080', + thistle : '#d8bfd8', + tomato : '#ff6347', + turquoise : '#40e0d0', + violet : '#ee82ee', + wheat : '#f5deb3', + white : '#fff', + whitesmoke : '#f5f5f5', + yellow : '#ff0', + yellowgreen : '#9acd32' + }; - Base.prototype.clickable = false; + /** + * 自定义调色板 + */ + function customPalette(userPalete) { + palette = userPalete; + } - Base.prototype.hoverable = true; + /** + * 复位默认色板 + */ + function resetPalette() { + palette = _palette; + } - Base.prototype.z = 0; + /** + * 获取色板颜色 + * @memberOf module:zrender/tool/color + * @param {number} idx 色板位置 + * @param {Array.} [userPalete] 自定义色板 + * @return {string} 颜色 + */ + function getColor(idx, userPalete) { + idx = idx | 0; + userPalete = userPalete || palette; + return userPalete[idx % userPalete.length]; + } - /** - * 画刷 - * - * @param ctx 画布句柄 - * @param isHighlight 是否为高亮状态 - * @param updateCallback 需要异步加载资源的shape可以通过这个callback(e) - * 让painter更新视图,base.brush没用,需要的话重载brush - */ - Base.prototype.brush = function (ctx, isHighlight) { - var style = this.style; - - if (this.brushTypeOnly) { - style.brushType = this.brushTypeOnly; - } + /** + * 自定义默认高亮颜色 + */ + function customHighlight(userHighlightColor) { + highlightColor = userHighlightColor; + } - if (isHighlight) { - // 根据style扩展默认高亮样式 - style = this.getHighlightStyle( - style, - this.highlightStyle || {}, - this.brushTypeOnly - ); - } + /** + * 重置默认高亮颜色 + */ + function resetHighlight() { + _highlightColor = highlightColor; + } - if (this.brushTypeOnly == 'stroke') { - style.strokeColor = style.strokeColor || style.color; - } + /** + * 获取默认高亮颜色 + */ + function getHighlightColor() { + return highlightColor; + } - ctx.save(); + /** + * 径向渐变 + * @memberOf module:zrender/tool/color + * @param {number} x0 渐变起点 + * @param {number} y0 + * @param {number} r0 + * @param {number} x1 渐变终点 + * @param {number} y1 + * @param {number} r1 + * @param {Array} colorList 颜色列表 + * @return {CanvasGradient} + */ + function getRadialGradient(x0, y0, r0, x1, y1, r1, colorList) { + if (!_ctx) { + _ctx = util.getContext(); + } + var gradient = _ctx.createRadialGradient(x0, y0, r0, x1, y1, r1); + for (var i = 0, l = colorList.length; i < l; i++) { + gradient.addColorStop(colorList[i][0], colorList[i][1]); + } + gradient.__nonRecursion = true; + return gradient; + } - this.setContext(ctx, style); + /** + * 线性渐变 + * @param {Object} x0 渐变起点 + * @param {Object} y0 + * @param {Object} x1 渐变终点 + * @param {Object} y1 + * @param {Array} colorList 颜色列表 + */ + function getLinearGradient(x0, y0, x1, y1, colorList) { + if (!_ctx) { + _ctx = util.getContext(); + } + var gradient = _ctx.createLinearGradient(x0, y0, x1, y1); + for (var i = 0, l = colorList.length; i < l; i++) { + gradient.addColorStop(colorList[i][0], colorList[i][1]); + } + gradient.__nonRecursion = true; + return gradient; + } - // 设置transform - this.setTransform(ctx); + /** + * 获取两种颜色之间渐变颜色数组 + * @param {color} start 起始颜色 + * @param {color} end 结束颜色 + * @param {number} step 渐变级数 + * @return {Array} 颜色数组 + */ + function getStepColors(start, end, step) { + start = toRGBA(start); + end = toRGBA(end); + start = getData(start); + end = getData(end); - ctx.beginPath(); - this.buildPath(ctx, style); - if (this.brushTypeOnly != 'stroke') { - ctx.closePath(); - } + var colors = []; + var stepR = (end[0] - start[0]) / step; + var stepG = (end[1] - start[1]) / step; + var stepB = (end[2] - start[2]) / step; + // 生成颜色集合 + // fix by linfeng 颜色堆积 + for (var i = 0, r = start[0], g = start[1], b = start[2]; i < step; i++ + ) { + colors[i] = toColor([ + adjust(Math.floor(r), [ 0, 255 ]), + adjust(Math.floor(g), [ 0, 255 ]), + adjust(Math.floor(b), [ 0, 255 ]) + ]); + r += stepR; + g += stepG; + b += stepB; + } + r = end[0]; + g = end[1]; + b = end[2]; + colors[i] = toColor([ r, g, b ]); + return colors; + } - switch (style.brushType) { - case 'both': - ctx.fill(); - case 'stroke': - style.lineWidth > 0 && ctx.stroke(); - break; - default: - ctx.fill(); + /** + * 获取指定级数的渐变颜色数组 + * @memberOf module:zrender/tool/color + * @param {Array.} colors 颜色组 + * @param {number} [step=20] 渐变级数 + * @return {Array.} 颜色数组 + */ + function getGradientColors(colors, step) { + var ret = []; + var len = colors.length; + if (step === undefined) { + step = 20; + } + if (len === 1) { + ret = getStepColors(colors[0], colors[0], step); + } + else if (len > 1) { + for (var i = 0, n = len - 1; i < n; i++) { + var steps = getStepColors(colors[i], colors[i + 1], step); + if (i < n - 1) { + steps.pop(); + } + ret = ret.concat(steps); } + } + return ret; + } - this.drawText(ctx, style, this.style); - - ctx.restore(); - }; - - var STYLE_CTX_MAP = [ - ['color', 'fillStyle'], - ['strokeColor', 'strokeStyle'], - ['opacity', 'globalAlpha'], - ['lineCap', 'lineCap'], - ['lineJoin', 'lineJoin'], - ['miterLimit', 'miterLimit'], - ['lineWidth', 'lineWidth'], - ['shadowBlur', 'shadowBlur'], - ['shadowColor', 'shadowColor'], - ['shadowOffsetX', 'shadowOffsetX'], - ['shadowOffsetY', 'shadowOffsetY'] - ]; - - /** - * 画布通用设置 - * - * TODO Performance - * - * @param ctx 画布句柄 - * @param style 通用样式 - */ - Base.prototype.setContext = function (ctx, style) { - for (var i = 0, len = STYLE_CTX_MAP.length; i < len; i++) { - var styleProp = STYLE_CTX_MAP[i][0]; - var styleValue = style[styleProp]; - var ctxProp = STYLE_CTX_MAP[i][1]; - - if (typeof styleValue != 'undefined') { - ctx[ctxProp] = styleValue; + /** + * 颜色值数组转为指定格式颜色,例如:
+ * data = [60,20,20,0.1] format = 'rgba' + * 返回:rgba(60,20,20,0.1) + * @param {Array} data 颜色值数组 + * @param {string} format 格式,默认rgb + * @return {string} 颜色 + */ + function toColor(data, format) { + format = format || 'rgb'; + if (data && (data.length === 3 || data.length === 4)) { + data = map(data, + function(c) { + return c > 1 ? Math.ceil(c) : c; } - } - }; - - /** - * 根据默认样式扩展高亮样式 - * - * @param ctx Canvas 2D上下文 - * @param {Object} style 默认样式 - * @param {Object} highlightStyle 高亮样式 - */ - Base.prototype.getHighlightStyle = function (style, highlightStyle, brushTypeOnly) { - var newStyle = {}; - for (var k in style) { - newStyle[k] = style[k]; - } + ); - var color = require('../tool/color'); - var highlightColor = color.getHighlightColor(); - // 根据highlightStyle扩展 - if (style.brushType != 'stroke') { - // 带填充则用高亮色加粗边线 - newStyle.strokeColor = highlightColor; - newStyle.lineWidth = (style.lineWidth || 1) - + this.getHighlightZoom(); - newStyle.brushType = 'both'; + if (format.indexOf('hex') > -1) { + return '#' + ((1 << 24) + (data[0] << 16) + (data[1] << 8) + (+data[2])).toString(16).slice(1); } - else { - if (brushTypeOnly != 'stroke') { - // 描边型的则用原色加工高亮 - newStyle.strokeColor = highlightColor; - newStyle.lineWidth = (style.lineWidth || 1) - + this.getHighlightZoom(); - } - else { - // 线型的则用原色加工高亮 - newStyle.strokeColor = highlightStyle.strokeColor - || color.mix( - style.strokeColor, - color.toRGB(highlightColor) - ); - } + else if (format.indexOf('hs') > -1) { + var sx = map(data.slice(1, 3), + function(c) { + return c + '%'; + } + ); + data[1] = sx[0]; + data[2] = sx[1]; } - // 可自定义覆盖默认值 - for (var k in highlightStyle) { - if (typeof highlightStyle[k] != 'undefined') { - newStyle[k] = highlightStyle[k]; + if (format.indexOf('a') > -1) { + if (data.length === 3) { + data.push(1); } + data[3] = adjust(data[3], [ 0, 1 ]); + return format + '(' + data.slice(0, 4).join(',') + ')'; } - return newStyle; - }; - - /** - * 高亮放大效果参数 - * 当前统一设置为6,如有需要差异设置,通过this.type判断实例类型 - */ - Base.prototype.getHighlightZoom = function () { - return this.type != 'text' ? 6 : 2; - }; - - /** - * 默认漂移 - * - * @param dx 横坐标变化 - * @param dy 纵坐标变化 - */ - Base.prototype.drift = function (dx, dy) { - this.position[0] += dx; - this.position[1] += dy; - }; - - /** - * 获取鼠标坐标变换 - * TODO Performance - */ - Base.prototype.getTansform = (function() { - - var invTransform = []; - - return function (x, y) { - var originPos = [x, y]; - // 对鼠标的坐标也做相同的变换 - if (this.needTransform && this.transform) { - matrix.invert(invTransform, this.transform); - - matrix.mulVector(originPos, invTransform, [x, y, 1]); + return format + '(' + data.slice(0, 3).join(',') + ')'; + } + } - if (x == originPos[0] && y == originPos[1]) { - // 避免外部修改导致的needTransform不准确 - this.updateNeedTransform(); - } - } - return originPos; - }; - })(); - - /** - * 默认区域包含判断 - * - * @param x 横坐标 - * @param y 纵坐标 - */ - Base.prototype.isCover = function (x, y) { - var originPos = this.getTansform(x, y); - x = originPos[0]; - y = originPos[1]; + /** + * 颜色字符串转换为rgba数组 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {Array.} 颜色值数组 + */ + function toArray(color) { + color = trim(color); + if (color.indexOf('rgba') < 0) { + color = toRGBA(color); + } - // 快速预判并保留判断矩形 - var rect = this.style.__rect; - if (!rect) { - rect = this.style.__rect = this.getRect(this.style); + var data = []; + var i = 0; + color.replace(/[\d.]+/g, function (n) { + if (i < 3) { + n = n | 0; } - - if (x >= rect.x - && x <= (rect.x + rect.width) - && y >= rect.y - && y <= (rect.y + rect.height) - ) { - // 矩形内 - return require('../tool/area').isInside(this, this.style, x, y); + else { + // Alpha + n = +n; } - - return false; - }; + data[i++] = n; + }); + return data; + } - /** - * 附加文本 - * - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - * @param {Object} normalStyle 默认样式,用于定位文字显示 - */ - Base.prototype.drawText = function (ctx, style, normalStyle) { - if (typeof(style.text) == 'undefined' || style.text === false ) { - return; - } - // 字体颜色策略 - var textColor = style.textColor || style.color || style.strokeColor; - ctx.fillStyle = textColor; + /** + * 颜色格式转化 + * + * @param {string} color 颜色值数组 + * @param {string} format 格式,默认rgb + * @return {string} 颜色 + */ + function convert(color, format) { + var data = getData(color); + var alpha = data[3]; + if (typeof alpha === 'undefined') { + alpha = 1; + } - /* - if (style.textPosition == 'inside') { - ctx.shadowColor = 'rgba(0,0,0,0)'; // 内部文字不带shadowColor - } - */ + if (color.indexOf('hsb') > -1) { + data = _HSV_2_RGB(data); + } + else if (color.indexOf('hsl') > -1) { + data = _HSL_2_RGB(data); + } - // 文本与图形间空白间隙 - var dd = 10; - var al; // 文本水平对齐 - var bl; // 文本垂直对齐 - var tx; // 文本横坐标 - var ty; // 文本纵坐标 + if (format.indexOf('hsb') > -1 || format.indexOf('hsv') > -1) { + data = _RGB_2_HSB(data); + } + else if (format.indexOf('hsl') > -1) { + data = _RGB_2_HSL(data); + } - var textPosition = style.textPosition // 用户定义 - || this.textPosition // shape默认 - || 'top'; // 全局默认 + data[3] = alpha; - switch (textPosition) { - case 'inside': - case 'top': - case 'bottom': - case 'left': - case 'right': - if (this.getRect) { - var rect = (normalStyle || style).__rect - || this.getRect(normalStyle || style); + return toColor(data, format); + } - switch (textPosition) { - case 'inside': - tx = rect.x + rect.width / 2; - ty = rect.y + rect.height / 2; - al = 'center'; - bl = 'middle'; - if (style.brushType != 'stroke' - && textColor == style.color - ) { - ctx.fillStyle = '#fff'; - } - break; - case 'left': - tx = rect.x - dd; - ty = rect.y + rect.height / 2; - al = 'end'; - bl = 'middle'; - break; - case 'right': - tx = rect.x + rect.width + dd; - ty = rect.y + rect.height / 2; - al = 'start'; - bl = 'middle'; - break; - case 'top': - tx = rect.x + rect.width / 2; - ty = rect.y - dd; - al = 'center'; - bl = 'bottom'; - break; - case 'bottom': - tx = rect.x + rect.width / 2; - ty = rect.y + rect.height + dd; - al = 'center'; - bl = 'top'; - break; - } - } - break; - case 'start': - case 'end': - var xStart; - var xEnd; - var yStart; - var yEnd; - if (typeof style.pointList != 'undefined') { - var pointList = style.pointList; - if (pointList.length < 2) { - // 少于2个点就不画了~ - return; - } - var length = pointList.length; - switch (textPosition) { - case 'start': - xStart = pointList[0][0]; - xEnd = pointList[1][0]; - yStart = pointList[0][1]; - yEnd = pointList[1][1]; - break; - case 'end': - xStart = pointList[length - 2][0]; - xEnd = pointList[length - 1][0]; - yStart = pointList[length - 2][1]; - yEnd = pointList[length - 1][1]; - break; - } - } - else { - xStart = style.xStart || 0; - xEnd = style.xEnd || 0; - yStart = style.yStart || 0; - yEnd = style.yEnd || 0; - } + /** + * 转换为rgba格式的颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} rgba颜色,rgba(r,g,b,a) + */ + function toRGBA(color) { + return convert(color, 'rgba'); + } - switch (textPosition) { - case 'start': - al = xStart < xEnd ? 'end' : 'start'; - bl = yStart < yEnd ? 'bottom' : 'top'; - tx = xStart; - ty = yStart; - break; - case 'end': - al = xStart < xEnd ? 'start' : 'end'; - bl = yStart < yEnd ? 'top' : 'bottom'; - tx = xEnd; - ty = yEnd; - break; - } - dd -= 4; - if (xStart != xEnd) { - tx -= (al == 'end' ? dd : -dd); - } - else { - al = 'center'; - } + /** + * 转换为rgb数字格式的颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} rgb颜色,rgb(0,0,0)格式 + */ + function toRGB(color) { + return convert(color, 'rgb'); + } - if (yStart != yEnd) { - ty -= (bl == 'bottom' ? dd : -dd); - } - else { - bl = 'middle'; - } - break; - case 'specific': - tx = style.textX || 0; - ty = style.textY || 0; - al = 'start'; - bl = 'middle'; - break; - } + /** + * 转换为16进制颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} 16进制颜色,#rrggbb格式 + */ + function toHex(color) { + return convert(color, 'hex'); + } - if (tx != null && ty != null) { - _fillText( - ctx, - style.text, - tx, ty, - style.textFont, - style.textAlign || al, - style.textBaseline || bl - ); - } - }; - // TODO - Base.prototype.isSilent = function () { - return !( - this.hoverable || this.draggable - || this.onmousemove || this.onmouseover || this.onmouseout - || this.onmousedown || this.onmouseup || this.onclick - || this.ondragenter || this.ondragover || this.ondragleave - || this.ondrop - ); - }; + /** + * 转换为HSV颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} HSVA颜色,hsva(h,s,v,a) + */ + function toHSVA(color) { + return convert(color, 'hsva'); + } - util.merge(Base.prototype, Transformable.prototype, true); - util.merge(Base.prototype, Dispatcher.prototype, true); + /** + * 转换为HSV颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} HSV颜色,hsv(h,s,v) + */ + function toHSV(color) { + return convert(color, 'hsv'); + } - return Base; + /** + * 转换为HSBA颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} HSBA颜色,hsba(h,s,b,a) + */ + function toHSBA(color) { + return convert(color, 'hsba'); } -); -/** - * zrender - * - * author: CrossDo (chenhuaimu@baidu.com) - * - * shape类:路径 - * 可配图形属性: - { - // 基础属性 - shape : 'path', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 + /** + * 转换为HSB颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} HSB颜色,hsb(h,s,b) + */ + function toHSB(color) { + return convert(color, 'hsb'); + } - // 样式属性,默认状态样式样式属性 - style : { - path : {string},// 必须,路径。例如:M 0 0 L 0 10 L 10 10 Z (一个三角形) - //M = moveto - //L = lineto - //H = horizontal lineto - //V = vertical lineto - //C = curveto - //S = smooth curveto - //Q = quadratic Belzier curve - //T = smooth quadratic Belzier curveto - //Z = closepath - - - x : {number}, // 必须,x轴坐标 - y : {number}, // 必须,y轴坐标 - - - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为top,附加文本位置。 - // inside | left | right | top | bottom - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, + /** + * 转换为HSLA颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} HSLA颜色,hsla(h,s,l,a) + */ + function toHSLA(color) { + return convert(color, 'hsla'); + } - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } + /** + * 转换为HSL颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} HSL颜色,hsl(h,s,l) + */ + function toHSL(color) { + return convert(color, 'hsl'); + } - // 交互属性,详见shape.Base + /** + * 转换颜色名 + * + * @param {string} color 颜色 + * @return {string} 颜色名 + */ + function toName(color) { + for (var key in _nameColors) { + if (toHex(_nameColors[key]) === toHex(color)) { + return key; + } + } + return null; + } - // 事件属性,详见shape.Base - } + /** + * 移除颜色中多余空格 + * + * @param {string} color 颜色 + * @return {string} 无空格颜色 + */ + function trim(color) { + return String(color).replace(/\s+/g, ''); + } - **/ + /** + * 颜色规范化 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} 规范化后的颜色 + */ + function normalize(color) { + // 颜色名 + if (_nameColors[color]) { + color = _nameColors[color]; + } + // 去掉空格 + color = trim(color); + // hsv与hsb等价 + color = color.replace(/hsv/i, 'hsb'); + // rgb转为rrggbb + if (/^#[\da-f]{3}$/i.test(color)) { + color = parseInt(color.slice(1), 16); + var r = (color & 0xf00) << 8; + var g = (color & 0xf0) << 4; + var b = color & 0xf; -define('zrender/shape/Path',['require','./Base','../tool/util'],function (require) { - var Base = require('./Base'); - - function Path(options) { - Base.call(this, options); + color = '#' + ((1 << 24) + (r << 4) + r + (g << 4) + g + (b << 4) + b).toString(16).slice(1); + } + // 或者使用以下正则替换,不过 chrome 下性能相对差点 + // color = color.replace(/^#([\da-f])([\da-f])([\da-f])$/i, '#$1$1$2$2$3$3'); + return color; } - Path.prototype = { - type: 'path', - - _parsePathData : function(data) { - if (!data) { - return []; + /** + * 颜色加深或减淡,当level>0加深,当level<0减淡 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @param {number} level 升降程度,取值区间[-1,1] + * @return {string} 加深或减淡后颜色值 + */ + function lift(color, level) { + var direct = level > 0 ? 1 : -1; + if (typeof level === 'undefined') { + level = 0; + } + level = Math.abs(level) > 1 ? 1 : Math.abs(level); + color = toRGB(color); + var data = getData(color); + for (var i = 0; i < 3; i++) { + if (direct === 1) { + data[i] = data[i] * (1 - level) | 0; } + else { + data[i] = ((255 - data[i]) * level + data[i]) | 0; + } + } + return 'rgb(' + data.join(',') + ')'; + } - // command string - var cs = data; + /** + * 颜色翻转,[255-r,255-g,255-b,1-a] + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} 翻转颜色 + */ + function reverse(color) { + var data = getData(toRGBA(color)); + data = map(data, + function(c) { + return 255 - c; + } + ); + return toColor(data, 'rgb'); + } - // command chars - var cc = [ - 'm', 'M', 'l', 'L', 'v', 'V', 'h', 'H', 'z', 'Z', - 'c', 'C', 'q', 'Q', 't', 'T', 's', 'S', 'a', 'A' - ]; - - cs = cs.replace(/-/g, ' -'); - cs = cs.replace(/ /g, ' '); - cs = cs.replace(/ /g, ','); - cs = cs.replace(/,,/g, ','); - + /** + * 简单两种颜色混合 + * @memberOf module:zrender/tool/color + * @param {string} color1 第一种颜色 + * @param {string} color2 第二种颜色 + * @param {number} weight 混合权重[0-1] + * @return {string} 结果色,rgb(r,g,b)或rgba(r,g,b,a) + */ + function mix(color1, color2, weight) { + if (typeof weight === 'undefined') { + weight = 0.5; + } + weight = 1 - adjust(weight, [ 0, 1 ]); - var n; - // create pipes so that we can split the data - for (n = 0; n < cc.length; n++) { - cs = cs.replace(new RegExp(cc[n], 'g'), '|' + cc[n]); - } + var w = weight * 2 - 1; + var data1 = getData(toRGBA(color1)); + var data2 = getData(toRGBA(color2)); - // create array - var arr = cs.split('|'); - var ca = []; - // init context point - var cpx = 0; - var cpy = 0; - for (n = 1; n < arr.length; n++) { - var str = arr[n]; - var c = str.charAt(0); - str = str.slice(1); - str = str.replace(new RegExp('e,-', 'g'), 'e-'); + var d = data1[3] - data2[3]; - var p = str.split(','); - if (p.length > 0 && p[0] === '') { - p.shift(); - } + var weight1 = (((w * d === -1) ? w : (w + d) / (1 + w * d)) + 1) / 2; + var weight2 = 1 - weight1; - for (var i = 0; i < p.length; i++) { - p[i] = parseFloat(p[i]); - } - while (p.length > 0) { - if (isNaN(p[0])) { - break; - } - var cmd = null; - var points = []; + var data = []; - var ctlPtx; - var ctlPty; - var prevCmd; + for (var i = 0; i < 3; i++) { + data[i] = data1[i] * weight1 + data2[i] * weight2; + } - var rx; - var ry; - var psi; - var fa; - var fs; + var alpha = data1[3] * weight + data2[3] * (1 - weight); + alpha = Math.max(0, Math.min(1, alpha)); - var x1 = cpx; - var y1 = cpy; + if (data1[3] === 1 && data2[3] === 1) {// 不考虑透明度 + return toColor(data, 'rgb'); + } + data[3] = alpha; + return toColor(data, 'rgba'); + } - // convert l, H, h, V, and v to L - switch (c) { - case 'l': - cpx += p.shift(); - cpy += p.shift(); - cmd = 'L'; - points.push(cpx, cpy); - break; - case 'L': - cpx = p.shift(); - cpy = p.shift(); - points.push(cpx, cpy); - break; - case 'm': - cpx += p.shift(); - cpy += p.shift(); - cmd = 'M'; - points.push(cpx, cpy); - c = 'l'; - break; - case 'M': - cpx = p.shift(); - cpy = p.shift(); - cmd = 'M'; - points.push(cpx, cpy); - c = 'L'; - break; + /** + * 随机颜色 + * + * @return {string} 颜色值,#rrggbb格式 + */ + function random() { + return '#' + Math.random().toString(16).slice(2, 8); + } - case 'h': - cpx += p.shift(); - cmd = 'L'; - points.push(cpx, cpy); - break; - case 'H': - cpx = p.shift(); - cmd = 'L'; - points.push(cpx, cpy); - break; - case 'v': - cpy += p.shift(); - cmd = 'L'; - points.push(cpx, cpy); - break; - case 'V': - cpy = p.shift(); - cmd = 'L'; - points.push(cpx, cpy); - break; - case 'C': - points.push(p.shift(), p.shift(), p.shift(), p.shift()); - cpx = p.shift(); - cpy = p.shift(); - points.push(cpx, cpy); - break; - case 'c': - points.push( - cpx + p.shift(), cpy + p.shift(), - cpx + p.shift(), cpy + p.shift() - ); - cpx += p.shift(); - cpy += p.shift(); - cmd = 'C'; - points.push(cpx, cpy); - break; - case 'S': - ctlPtx = cpx; - ctlPty = cpy; - prevCmd = ca[ca.length - 1]; - if (prevCmd.command === 'C') { - ctlPtx = cpx + (cpx - prevCmd.points[2]); - ctlPty = cpy + (cpy - prevCmd.points[3]); - } - points.push(ctlPtx, ctlPty, p.shift(), p.shift()); - cpx = p.shift(); - cpy = p.shift(); - cmd = 'C'; - points.push(cpx, cpy); - break; - case 's': - ctlPtx = cpx, ctlPty = cpy; - prevCmd = ca[ca.length - 1]; - if (prevCmd.command === 'C') { - ctlPtx = cpx + (cpx - prevCmd.points[2]); - ctlPty = cpy + (cpy - prevCmd.points[3]); - } - points.push( - ctlPtx, ctlPty, - cpx + p.shift(), cpy + p.shift() - ); - cpx += p.shift(); - cpy += p.shift(); - cmd = 'C'; - points.push(cpx, cpy); - break; - case 'Q': - points.push(p.shift(), p.shift()); - cpx = p.shift(); - cpy = p.shift(); - points.push(cpx, cpy); - break; - case 'q': - points.push(cpx + p.shift(), cpy + p.shift()); - cpx += p.shift(); - cpy += p.shift(); - cmd = 'Q'; - points.push(cpx, cpy); - break; - case 'T': - ctlPtx = cpx, ctlPty = cpy; - prevCmd = ca[ca.length - 1]; - if (prevCmd.command === 'Q') { - ctlPtx = cpx + (cpx - prevCmd.points[0]); - ctlPty = cpy + (cpy - prevCmd.points[1]); - } - cpx = p.shift(); - cpy = p.shift(); - cmd = 'Q'; - points.push(ctlPtx, ctlPty, cpx, cpy); - break; - case 't': - ctlPtx = cpx, ctlPty = cpy; - prevCmd = ca[ca.length - 1]; - if (prevCmd.command === 'Q') { - ctlPtx = cpx + (cpx - prevCmd.points[0]); - ctlPty = cpy + (cpy - prevCmd.points[1]); - } - cpx += p.shift(); - cpy += p.shift(); - cmd = 'Q'; - points.push(ctlPtx, ctlPty, cpx, cpy); - break; - case 'A': - rx = p.shift(); - ry = p.shift(); - psi = p.shift(); - fa = p.shift(); - fs = p.shift(); - - x1 = cpx, y1 = cpy; - cpx = p.shift(), cpy = p.shift(); - cmd = 'A'; - points = this._convertPoint( - x1, y1, cpx, cpy, fa, fs, rx, ry, psi - ); - break; - case 'a': - rx = p.shift(); - ry = p.shift(); - psi = p.shift(); - fa = p.shift(); - fs = p.shift(); - - x1 = cpx, y1 = cpy; - cpx += p.shift(); - cpy += p.shift(); - cmd = 'A'; - points = this._convertPoint( - x1, y1, cpx, cpy, fa, fs, rx, ry, psi - ); - break; + /** + * 获取颜色值数组,返回值范围:
+ * RGB 范围[0-255]
+ * HSL/HSV/HSB 范围[0-1]
+ * A透明度范围[0-1] + * 支持格式: + * #rgb + * #rrggbb + * rgb(r,g,b) + * rgb(r%,g%,b%) + * rgba(r,g,b,a) + * hsb(h,s,b) // hsv与hsb等价 + * hsb(h%,s%,b%) + * hsba(h,s,b,a) + * hsl(h,s,l) + * hsl(h%,s%,l%) + * hsla(h,s,l,a) + * + * @param {string} color 颜色 + * @return {Array.} 颜色值数组或null + */ + function getData(color) { + color = normalize(color); + var r = color.match(colorRegExp); + if (r === null) { + throw new Error('The color format error'); // 颜色格式错误 + } + var d; + var a; + var data = []; + var rgb; - } + if (r[2]) { + // #rrggbb + d = r[2].replace('#', '').split(''); + rgb = [ d[0] + d[1], d[2] + d[3], d[4] + d[5] ]; + data = map(rgb, + function(c) { + return adjust(parseInt(c, 16), [ 0, 255 ]); + } + ); - ca.push({ - command : cmd || c, - points : points - }); + } + else if (r[4]) { + // rgb rgba + var rgba = (r[4]).split(','); + a = rgba[3]; + rgb = rgba.slice(0, 3); + data = map( + rgb, + function(c) { + c = Math.floor( + c.indexOf('%') > 0 ? parseInt(c, 0) * 2.55 : c + ); + return adjust(c, [ 0, 255 ]); } + ); - if (c === 'z' || c === 'Z') { - ca.push({ - command : 'z', - points : [] - }); + if (typeof a !== 'undefined') { + data.push(adjust(parseFloat(a), [ 0, 1 ])); + } + } + else if (r[5] || r[6]) { + // hsb hsba hsl hsla + var hsxa = (r[5] || r[6]).split(','); + var h = parseInt(hsxa[0], 0) / 360; + var s = hsxa[1]; + var x = hsxa[2]; + a = hsxa[3]; + data = map([ s, x ], + function(c) { + return adjust(parseFloat(c) / 100, [ 0, 1 ]); } + ); + data.unshift(h); + if (typeof a !== 'undefined') { + data.push(adjust(parseFloat(a), [ 0, 1 ])); } + } + return data; + } - return ca; + /** + * 设置颜色透明度 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @param {number} a 透明度,区间[0,1] + * @return {string} rgba颜色值 + */ + function alpha(color, a) { + if (a === null) { + a = 1; + } + var data = getData(toRGBA(color)); + data[3] = adjust(Number(a).toFixed(4), [ 0, 1 ]); - }, + return toColor(data, 'rgba'); + } - _convertPoint : function(x1, y1, x2, y2, fa, fs, rx, ry, psiDeg) { - var psi = psiDeg * (Math.PI / 180.0); - var xp = Math.cos(psi) * (x1 - x2) / 2.0 - + Math.sin(psi) * (y1 - y2) / 2.0; - var yp = -1 * Math.sin(psi) * (x1 - x2) / 2.0 - + Math.cos(psi) * (y1 - y2) / 2.0; + // 数组映射 + function map(array, fun) { + if (typeof fun !== 'function') { + throw new TypeError(); + } + var len = array ? array.length : 0; + for (var i = 0; i < len; i++) { + array[i] = fun(array[i]); + } + return array; + } - var lambda = (xp * xp) / (rx * rx) + (yp * yp) / (ry * ry); + // 调整值区间 + function adjust(value, region) { + // < to <= & > to >= + // modify by linzhifeng 2014-05-25 because -0 == 0 + if (value <= region[0]) { + value = region[0]; + } + else if (value >= region[1]) { + value = region[1]; + } + return value; + } - if (lambda > 1) { - rx *= Math.sqrt(lambda); - ry *= Math.sqrt(lambda); + // 参见 http:// www.easyrgb.com/index.php?X=MATH + function _HSV_2_RGB(data) { + var H = data[0]; + var S = data[1]; + var V = data[2]; + // HSV from 0 to 1 + var R; + var G; + var B; + if (S === 0) { + R = V * 255; + G = V * 255; + B = V * 255; + } + else { + var h = H * 6; + if (h === 6) { + h = 0; } + var i = h | 0; + var v1 = V * (1 - S); + var v2 = V * (1 - S * (h - i)); + var v3 = V * (1 - S * (1 - (h - i))); + var r = 0; + var g = 0; + var b = 0; - var f = Math.sqrt((((rx * rx) * (ry * ry)) - - ((rx * rx) * (yp * yp)) - - ((ry * ry) * (xp * xp))) / ((rx * rx) * (yp * yp) - + (ry * ry) * (xp * xp)) - ); - - if (fa === fs) { - f *= -1; + if (i === 0) { + r = V; + g = v3; + b = v1; } - if (isNaN(f)) { - f = 0; + else if (i === 1) { + r = v2; + g = V; + b = v1; } - - var cxp = f * rx * yp / ry; - var cyp = f * -ry * xp / rx; - - var cx = (x1 + x2) / 2.0 - + Math.cos(psi) * cxp - - Math.sin(psi) * cyp; - var cy = (y1 + y2) / 2.0 - + Math.sin(psi) * cxp - + Math.cos(psi) * cyp; - - var vMag = function(v) { - return Math.sqrt(v[0] * v[0] + v[1] * v[1]); - }; - var vRatio = function(u, v) { - return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v)); - }; - var vAngle = function(u, v) { - return (u[0] * v[1] < u[1] * v[0] ? -1 : 1) - * Math.acos(vRatio(u, v)); - }; - var theta = vAngle([ 1, 0 ], [ (xp - cxp) / rx, (yp - cyp) / ry ]); - var u = [ (xp - cxp) / rx, (yp - cyp) / ry ]; - var v = [ (-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry ]; - var dTheta = vAngle(u, v); - - if (vRatio(u, v) <= -1) { - dTheta = Math.PI; + else if (i === 2) { + r = v1; + g = V; + b = v3; } - if (vRatio(u, v) >= 1) { - dTheta = 0; + else if (i === 3) { + r = v1; + g = v2; + b = V; } - if (fs === 0 && dTheta > 0) { - dTheta = dTheta - 2 * Math.PI; + else if (i === 4) { + r = v3; + g = v1; + b = V; } - if (fs === 1 && dTheta < 0) { - dTheta = dTheta + 2 * Math.PI; + else { + r = V; + g = v1; + b = v2; } - return [ cx, cy, rx, ry, theta, dTheta, psi, fs ]; - }, - /** - * 创建路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - var path = style.path; + // RGB results from 0 to 255 + R = r * 255; + G = g * 255; + B = b * 255; + } + return [ R, G, B ]; + } - var pathArray = this.pathArray || this._parsePathData(path); + function _HSL_2_RGB(data) { + var H = data[0]; + var S = data[1]; + var L = data[2]; + // HSL from 0 to 1 + var R; + var G; + var B; + if (S === 0) { + R = L * 255; + G = L * 255; + B = L * 255; + } + else { + var v2; + if (L < 0.5) { + v2 = L * (1 + S); + } + else { + v2 = (L + S) - (S * L); + } - // 平移坐标 - var x = style.x || 0; - var y = style.y || 0; + var v1 = 2 * L - v2; - var p; - // 记录边界点,用于判断inside - var pointList = style.pointList = []; - var singlePointList = []; - for (var i = 0, l = pathArray.length; i < l; i++) { - if (pathArray[i].command.toUpperCase() == 'M') { - singlePointList.length > 0 - && pointList.push(singlePointList); - singlePointList = []; - } - p = pathArray[i].points; - for (var j = 0, k = p.length; j < k; j += 2) { - singlePointList.push([p[j] + x, p[j+1] + y]); - } - } - singlePointList.length > 0 && pointList.push(singlePointList); - - var c; - for (var i = 0, l = pathArray.length; i < l; i++) { - c = pathArray[i].command; - p = pathArray[i].points; - // 平移变换 - for (var j = 0, k = p.length; j < k; j++) { - if (j % 2 === 0) { - p[j] += x; - } else { - p[j] += y; - } - } - switch (c) { - case 'L': - ctx.lineTo(p[0], p[1]); - break; - case 'M': - ctx.moveTo(p[0], p[1]); - break; - case 'C': - ctx.bezierCurveTo(p[0], p[1], p[2], p[3], p[4], p[5]); - break; - case 'Q': - ctx.quadraticCurveTo(p[0], p[1], p[2], p[3]); - break; - case 'A': - var cx = p[0]; - var cy = p[1]; - var rx = p[2]; - var ry = p[3]; - var theta = p[4]; - var dTheta = p[5]; - var psi = p[6]; - var fs = p[7]; - var r = (rx > ry) ? rx : ry; - var scaleX = (rx > ry) ? 1 : rx / ry; - var scaleY = (rx > ry) ? ry / rx : 1; + R = 255 * _HUE_2_RGB(v1, v2, H + (1 / 3)); + G = 255 * _HUE_2_RGB(v1, v2, H); + B = 255 * _HUE_2_RGB(v1, v2, H - (1 / 3)); + } + return [ R, G, B ]; + } - ctx.translate(cx, cy); - ctx.rotate(psi); - ctx.scale(scaleX, scaleY); - ctx.arc(0, 0, r, theta, theta + dTheta, 1 - fs); - ctx.scale(1 / scaleX, 1 / scaleY); - ctx.rotate(-psi); - ctx.translate(-cx, -cy); - break; - case 'z': - ctx.closePath(); - break; - } - } + function _HUE_2_RGB(v1, v2, vH) { + if (vH < 0) { + vH += 1; + } + if (vH > 1) { + vH -= 1; + } + if ((6 * vH) < 1) { + return (v1 + (v2 - v1) * 6 * vH); + } + if ((2 * vH) < 1) { + return (v2); + } + if ((3 * vH) < 2) { + return (v1 + (v2 - v1) * ((2 / 3) - vH) * 6); + } + return v1; + } - return; - }, + function _RGB_2_HSB(data) { + // RGB from 0 to 255 + var R = (data[0] / 255); + var G = (data[1] / 255); + var B = (data[2] / 255); - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style 样式 - */ - getRect : function(style) { - if (style.__rect) { - return style.__rect; + var vMin = Math.min(R, G, B); // Min. value of RGB + var vMax = Math.max(R, G, B); // Max. value of RGB + var delta = vMax - vMin; // Delta RGB value + var V = vMax; + var H; + var S; + + // HSV results from 0 to 1 + if (delta === 0) { + H = 0; + S = 0; + } + else { + S = delta / vMax; + + var deltaR = (((vMax - R) / 6) + (delta / 2)) / delta; + var deltaG = (((vMax - G) / 6) + (delta / 2)) / delta; + var deltaB = (((vMax - B) / 6) + (delta / 2)) / delta; + + if (R === vMax) { + H = deltaB - deltaG; } - - var lineWidth; - if (style.brushType == 'stroke' || style.brushType == 'fill') { - lineWidth = style.lineWidth || 1; + else if (G === vMax) { + H = (1 / 3) + deltaR - deltaB; } - else { - lineWidth = 0; + else if (B === vMax) { + H = (2 / 3) + deltaG - deltaR; } - var minX = Number.MAX_VALUE; - var maxX = Number.MIN_VALUE; + if (H < 0) { + H += 1; + } + if (H > 1) { + H -= 1; + } + } + H = H * 360; + S = S * 100; + V = V * 100; + return [ H, S, V ]; + } - var minY = Number.MAX_VALUE; - var maxY = Number.MIN_VALUE; + function _RGB_2_HSL(data) { + // RGB from 0 to 255 + var R = (data[0] / 255); + var G = (data[1] / 255); + var B = (data[2] / 255); - // 平移坐标 - var x = style.x || 0; - var y = style.y || 0; + var vMin = Math.min(R, G, B); // Min. value of RGB + var vMax = Math.max(R, G, B); // Max. value of RGB + var delta = vMax - vMin; // Delta RGB value - var pathArray = this.pathArray || this._parsePathData(style.path); - for (var i = 0; i < pathArray.length; i++) { - var p = pathArray[i].points; + var L = (vMax + vMin) / 2; + var H; + var S; + // HSL results from 0 to 1 + if (delta === 0) { + H = 0; + S = 0; + } + else { + if (L < 0.5) { + S = delta / (vMax + vMin); + } + else { + S = delta / (2 - vMax - vMin); + } - for (var j = 0; j < p.length; j++) { - if (j % 2 === 0) { - if (p[j] + x < minX) { - minX = p[j] + x; - } - if (p[j] + x > maxX) { - maxX = p[j] + x; - } - } - else { - if (p[j] + y < minY) { - minY = p[j] + y; - } - if (p[j] + y > maxY) { - maxY = p[j] + y; - } - } - } + var deltaR = (((vMax - R) / 6) + (delta / 2)) / delta; + var deltaG = (((vMax - G) / 6) + (delta / 2)) / delta; + var deltaB = (((vMax - B) / 6) + (delta / 2)) / delta; + + if (R === vMax) { + H = deltaB - deltaG; + } + else if (G === vMax) { + H = (1 / 3) + deltaR - deltaB; + } + else if (B === vMax) { + H = (2 / 3) + deltaG - deltaR; } - var rect; - if (minX === Number.MAX_VALUE - || maxX === Number.MIN_VALUE - || minY === Number.MAX_VALUE - || maxY === Number.MIN_VALUE - ) { - rect = { - x : 0, - y : 0, - width : 0, - height : 0 - }; + if (H < 0) { + H += 1; } - else { - rect = { - x : Math.round(minX - lineWidth / 2), - y : Math.round(minY - lineWidth / 2), - width : maxX - minX + lineWidth, - height : maxY - minY + lineWidth - }; + + if (H > 1) { + H -= 1; } - style.__rect = rect; - return rect; } - }; - require('../tool/util').inherits(Path, Base); - return Path; + H = H * 360; + S = S * 100; + L = L * 100; + + return [ H, S, L ]; + } + + return { + customPalette : customPalette, + resetPalette : resetPalette, + getColor : getColor, + getHighlightColor : getHighlightColor, + customHighlight : customHighlight, + resetHighlight : resetHighlight, + getRadialGradient : getRadialGradient, + getLinearGradient : getLinearGradient, + getGradientColors : getGradientColors, + getStepColors : getStepColors, + reverse : reverse, + mix : mix, + lift : lift, + trim : trim, + random : random, + toRGB : toRGB, + toRGBA : toRGBA, + toHex : toHex, + toHSL : toHSL, + toHSLA : toHSLA, + toHSB : toHSB, + toHSBA : toHSBA, + toHSV : toHSV, + toHSVA : toHSVA, + toName : toName, + toColor : toColor, + toArray : toArray, + alpha : alpha, + getData : getData + }; }); + + /** - * zrender: 图形空间辅助类 - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * isInside:是否在区域内部 - * isOutside:是否在区域外部 - * getTextWidth:测算单行文本宽度 + * shape基类 + * @module zrender/shape/Base + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * errorrik (errorrik@gmail.com) + */ + +/** + * @typedef {Object} IBaseShapeStyle + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ + +/** + * @typedef {Object} module:zrender/shape/Base~IBoundingRect + * @property {number} x 左上角顶点x轴坐标 + * @property {number} y 左上角顶点y轴坐标 + * @property {number} width 包围盒矩形宽度 + * @property {number} height 包围盒矩形高度 */ + define( - 'zrender/tool/area',['require','../tool/util','../shape/Path'],function(require) { + 'zrender/shape/Base',['require','../tool/matrix','../tool/guid','../tool/util','../tool/log','../mixin/Transformable','../mixin/Eventful','../tool/area','../tool/area','../tool/color','../tool/area'],function(require) { + var matrix = require('../tool/matrix'); + var guid = require('../tool/guid'); var util = require('../tool/util'); + var log = require('../tool/log'); - var _ctx; - - var _textWidthCache = {}; - var _textHeightCache = {}; - var _textWidthCacheCounter = 0; - var _textHeightCacheCounter = 0; - var TEXT_CACHE_MAX = 20000; - - /** - * 包含判断 - * - * @param {Object} shape : 图形 - * @param {Object} area : 目标区域 - * @param {number} x : 横坐标 - * @param {number} y : 纵坐标 - */ - function isInside(shape, area, x, y) { - if (!area || !shape) { - // 无参数或不支持类型 - return false; - } - var zoneType = shape.type; - - _ctx = _ctx || util.getContext(); + var Transformable = require('../mixin/Transformable'); + var Eventful = require('../mixin/Eventful'); - if (!_isInsideRectangle(area.__rect || shape.getRect(area), x, y)) { - // 不在矩形区域内直接返回false - return false; + function _fillText(ctx, text, x, y, textFont, textAlign, textBaseline) { + if (textFont) { + ctx.font = textFont; } - - // 未实现或不可用时(excanvas不支持)则数学运算,主要是line,brokenLine,ring - var _mathReturn = _mathMethod(zoneType, area, x, y); - if (typeof _mathReturn != 'undefined') { - return _mathReturn; + ctx.textAlign = textAlign; + ctx.textBaseline = textBaseline; + var rect = _getTextRect( + text, x, y, textFont, textAlign, textBaseline + ); + + text = (text + '').split('\n'); + var lineHeight = require('../tool/area').getTextHeight('国', textFont); + + switch (textBaseline) { + case 'top': + y = rect.y; + break; + case 'bottom': + y = rect.y + lineHeight; + break; + default: + y = rect.y + lineHeight / 2; } - - if (zoneType != 'bezier-curve' - && shape.buildPath - && _ctx.isPointInPath - ) { - return _buildPathMethod(shape, _ctx, area, x, y); + + for (var i = 0, l = text.length; i < l; i++) { + ctx.fillText(text[i], x, y); + y += lineHeight; } - else if (_ctx.getImageData) { - return _pixelMethod(shape, area, x, y); + } + + /** + * 返回矩形区域,用于局部刷新和文字定位 + * @inner + * @param {string} text + * @param {number} x + * @param {number} y + * @param {string} textFont + * @param {string} textAlign + * @param {string} textBaseline + */ + function _getTextRect(text, x, y, textFont, textAlign, textBaseline) { + var area = require('../tool/area'); + var width = area.getTextWidth(text, textFont); + var lineHeight = area.getTextHeight('国', textFont); + + text = (text + '').split('\n'); + + switch (textAlign) { + case 'end': + case 'right': + x -= width; + break; + case 'center': + x -= (width / 2); + break; } - // 上面的方法都行不通时 - switch (zoneType) { - case 'heart': //心形---------10 // Todo,不精确 - case 'droplet':// 水滴----------11 // Todo,不精确 - case 'ellipse': // Todo,不精确 - return true; - // 旋轮曲线 不准确 - case 'trochoid': - var _r = area.location == 'out' - ? area.r1 + area.r2 + area.d - : area.r1 - area.r2 + area.d; - return _isInsideCircle(area, x, y, _r); - // 玫瑰线 不准确 - case 'rose' : - return _isInsideCircle(area, x, y, area.maxr); - //路径,椭圆,曲线等-----------------13 + switch (textBaseline) { + case 'top': + break; + case 'bottom': + y -= lineHeight * text.length; + break; default: - return false; // Todo,暂不支持 + y -= lineHeight * text.length / 2; } + + return { + x : x, + y : y, + width : width, + height : lineHeight * text.length + }; } /** - * 用数学方法判断,三个方法中最快,但是支持的shape少 - * - * @param {string} zoneType : 图形类型 - * @param {Object} area :目标区域 - * @param {number} x : 横坐标 - * @param {number} y : 纵坐标 - * @return {boolean=} true表示坐标处在图形中 + * @alias module:zrender/shape/Base + * @constructor + * @extends module:zrender/mixin/Transformable + * @extends module:zrender/mixin/Eventful + * @param {Object} options 关于shape的配置项,可以是shape的自有属性,也可以是自定义的属性。 */ - function _mathMethod(zoneType, area, x, y) { - // 在矩形内则部分图形需要进一步判断 - switch (zoneType) { - //线-----------------------1 - case 'line': - return _isInsideLine(area, x, y); - //折线----------------------2 - case 'broken-line': - return _isInsideBrokenLine(area, x, y); - //文本----------------------3 - case 'text': - return true; - //圆环----------------------4 - case 'ring': - return _isInsideRing(area, x, y); - //矩形----------------------5 - case 'rectangle': - return true; - //圆形----------------------6 - case 'circle': - return _isInsideCircle(area, x, y, area.r); - //扇形----------------------7 - case 'sector': - return _isInsideSector(area, x, y); - //多边形---------------------8 - case 'path': - return _isInsidePath(area, x, y); - case 'polygon': - case 'star': - case 'isogon': - return _isInsidePolygon(area, x, y); - //图片----------------------9 - case 'image': - return true; + var Base = function(options) { + + options = options || {}; + + /** + * Shape id, 全局唯一 + * @type {string} + */ + this.id = options.id || guid(); + + for (var key in options) { + this[key] = options[key]; } - } + /** + * 基础绘制样式 + * @type {module:zrender/shape/Base~IBaseShapeStyle} + */ + this.style = this.style || {}; + + /** + * 高亮样式 + * @type {module:zrender/shape/Base~IBaseShapeStyle} + */ + this.highlightStyle = this.highlightStyle || null; + + /** + * 父节点 + * @readonly + * @type {module:zrender/Group} + * @default null + */ + this.parent = null; + + this.__dirty = true; + + Transformable.call(this); + Eventful.call(this); + }; /** - * 通过buildPath方法来判断,三个方法中较快,但是不支持线条类型的shape, - * 而且excanvas不支持isPointInPath方法 - * - * @param {Object} shape : shape - * @param {Object} context : 上下文 - * @param {Object} area :目标区域 - * @param {number} x : 横坐标 - * @param {number} y : 纵坐标 - * @return {boolean} true表示坐标处在图形中 + * 图形是否可见,为true时不绘制图形,但是仍能触发鼠标事件 + * @name module:zrender/shape/Base#invisible + * @type {boolean} + * @default false */ - function _buildPathMethod(shape, context, area, x, y) { - // 图形类实现路径创建了则用类的path - context.beginPath(); - shape.buildPath(context, area); - context.closePath(); - return context.isPointInPath(x, y); - } + Base.prototype.invisible = false; /** - * 通过像素值来判断,三个方法中最慢,但是支持广,不足之处是excanvas不支持像素处理 - * - * @param {Object} shape shape类 - * @param {Object} area 目标区域 - * @param {number} x 横坐标 - * @param {number} y 纵坐标 - * @return {boolean} true表示坐标处在图形中 + * 图形是否忽略,为true时忽略图形的绘制以及事件触发 + * @name module:zrender/shape/Base#ignore + * @type {boolean} + * @default false */ - function _pixelMethod(shape, area, x, y) { - var _rect = area.__rect || shape.getRect(area); - var _context = util.getPixelContext(); - var _offset = util.getPixelOffset(); + Base.prototype.ignore = false; - util.adjustCanvasSize(x, y); - _context.clearRect(_rect.x, _rect.y, _rect.width, _rect.height); - _context.beginPath(); - shape.brush(_context, {style : area}); - _context.closePath(); + /** + * z层level,决定绘画在哪层canvas中 + * @name module:zrender/shape/Base#zlevel + * @type {number} + * @default 0 + */ + Base.prototype.zlevel = 0; - return _isPainted(_context, x + _offset.x, y + _offset.y); - } + /** + * 是否可拖拽 + * @name module:zrender/shape/Base#draggable + * @type {boolean} + * @default false + */ + Base.prototype.draggable = false; /** - * 坐标像素值,判断坐标是否被作色 - * - * @param {Object} context : 上下文 - * @param {number} x : 横坐标 - * @param {number} y : 纵坐标 - * @param {number=} unit : 触发的精度,越大越容易触发,可选,缺省是为1 - * @return {boolean} 已经被画过返回true + * 是否可点击 + * @name module:zrender/shape/Base#clickable + * @type {boolean} + * @default false + */ + Base.prototype.clickable = false; + + /** + * 是否可以hover + * @name module:zrender/shape/Base#hoverable + * @type {boolean} + * @default true + */ + Base.prototype.hoverable = true; + + /** + * z值,跟zlevel一样影响shape绘制的前后顺序,z值大的shape会覆盖在z值小的上面, + * 但是并不会创建新的canvas,所以优先级低于zlevel,而且频繁改动的开销比zlevel小很多。 + * + * @name module:zrender/shape/Base#z + * @type {number} + * @default 0 */ - function _isPainted(context, x, y, unit) { - var pixelsData; + Base.prototype.z = 0; - if (typeof unit != 'undefined') { - unit = (unit || 1 ) >> 1; - pixelsData = context.getImageData( - x - unit, - y - unit, - unit + unit, - unit + unit - ).data; + /** + * 绘制图形 + * + * @param {CanvasRenderingContext2D} ctx + * @param {boolean} [isHighlight=false] 是否使用高亮属性 + * @param {Function} [updateCallback] + * 需要异步加载资源的shape可以通过这个callback(e), + * 让painter更新视图,base.brush没用,需要的话重载brush + */ + Base.prototype.brush = function (ctx, isHighlight) { + var style = this.style; + + if (this.brushTypeOnly) { + style.brushType = this.brushTypeOnly; } - else { - pixelsData = context.getImageData(x, y, 1, 1).data; + + if (isHighlight) { + // 根据style扩展默认高亮样式 + style = this.getHighlightStyle( + style, + this.highlightStyle || {}, + this.brushTypeOnly + ); } - var len = pixelsData.length; - while (len--) { - if (pixelsData[len] !== 0) { - return true; - } + if (this.brushTypeOnly == 'stroke') { + style.strokeColor = style.strokeColor || style.color; } - return false; - } + ctx.save(); - /** - * !isInside - */ - function isOutside(shape, area, x, y) { - return !isInside(shape, area, x, y); - } + this.setContext(ctx, style); - /** - * 线段包含判断 - */ - function _isInsideLine(area, x, y) { - var _x1 = area.xStart; - var _y1 = area.yStart; - var _x2 = area.xEnd; - var _y2 = area.yEnd; - var _l = Math.max(area.lineWidth, 5); - var _a = 0; - var _b = _x1; + // 设置transform + this.setTransform(ctx); - var minX, maxX; - if (_x1 < _x2) { - minX = _x1 - _l; maxX = _x2 + _l; - } else { - minX = _x2 - _l; maxX = _x1 + _l; - } + ctx.beginPath(); + this.buildPath(ctx, style); - var minY, maxY; - if (_y1 < _y2) { - minY = _y1 - _l; maxY = _y2 + _l; - } else { - minY = _y2 - _l; maxY = _y1 + _l; + switch (style.brushType) { + /* jshint ignore:start */ + case 'both': + ctx.fill(); + case 'stroke': + style.lineWidth > 0 && ctx.stroke(); + break; + /* jshint ignore:end */ + default: + ctx.fill(); } + + this.drawText(ctx, style, this.style); - if (x < minX || x > maxX || y < minY || y > maxY) { - return false; + ctx.restore(); + }; + + var STYLE_CTX_MAP = [ + [ 'color', 'fillStyle' ], + [ 'strokeColor', 'strokeStyle' ], + [ 'opacity', 'globalAlpha' ], + [ 'lineCap', 'lineCap' ], + [ 'lineJoin', 'lineJoin' ], + [ 'miterLimit', 'miterLimit' ], + [ 'lineWidth', 'lineWidth' ], + [ 'shadowBlur', 'shadowBlur' ], + [ 'shadowColor', 'shadowColor' ], + [ 'shadowOffsetX', 'shadowOffsetX' ], + [ 'shadowOffsetY', 'shadowOffsetY' ] + ]; + + /** + * 设置 fillStyle, strokeStyle, shadow 等通用绘制样式 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Base~IBaseShapeStyle} style + */ + Base.prototype.setContext = function (ctx, style) { + for (var i = 0, len = STYLE_CTX_MAP.length; i < len; i++) { + var styleProp = STYLE_CTX_MAP[i][0]; + var styleValue = style[styleProp]; + var ctxProp = STYLE_CTX_MAP[i][1]; + + if (typeof styleValue != 'undefined') { + ctx[ctxProp] = styleValue; + } + } + }; + + /** + * 根据默认样式扩展高亮样式 + * + * @param {module:zrender/shape/Base~IBaseShapeStyle} style 默认样式 + * @param {module:zrender/shape/Base~IBaseShapeStyle} highlightStyle 高亮样式 + * @param {string} brushTypeOnly + */ + Base.prototype.getHighlightStyle = function (style, highlightStyle, brushTypeOnly) { + var newStyle = {}; + for (var k in style) { + newStyle[k] = style[k]; } - if (_x1 !== _x2) { - _a = (_y1 - _y2) / (_x1 - _x2); - _b = (_x1 * _y2 - _x2 * _y1) / (_x1 - _x2) ; + var color = require('../tool/color'); + var highlightColor = color.getHighlightColor(); + // 根据highlightStyle扩展 + if (style.brushType != 'stroke') { + // 带填充则用高亮色加粗边线 + newStyle.strokeColor = highlightColor; + newStyle.lineWidth = (style.lineWidth || 1) + + this.getHighlightZoom(); + newStyle.brushType = 'both'; } else { - return Math.abs(x - _x1) <= _l / 2; + if (brushTypeOnly != 'stroke') { + // 描边型的则用原色加工高亮 + newStyle.strokeColor = highlightColor; + newStyle.lineWidth = (style.lineWidth || 1) + + this.getHighlightZoom(); + } + else { + // 线型的则用原色加工高亮 + newStyle.strokeColor = highlightStyle.strokeColor + || color.mix( + style.strokeColor, + color.toRGB(highlightColor) + ); + } } - var _s = (_a * x - y + _b) * (_a * x - y + _b) / (_a * _a + 1); - return _s <= _l / 2 * _l / 2; - } - - function _isInsideBrokenLine(area, x, y) { - var pointList = area.pointList; - var lineArea = { - xStart : 0, - yStart : 0, - xEnd : 0, - yEnd : 0, - lineWidth : 0 - }; - for (var i = 0, l = pointList.length - 1; i < l; i++) { - lineArea.xStart = pointList[i][0]; - lineArea.yStart = pointList[i][1]; - lineArea.xEnd = pointList[i + 1][0]; - lineArea.yEnd = pointList[i + 1][1]; - lineArea.lineWidth = Math.max(area.lineWidth, 10); - - if (_isInsideLine(lineArea, x, y)) { - return true; + // 可自定义覆盖默认值 + for (var k in highlightStyle) { + if (typeof highlightStyle[k] != 'undefined') { + newStyle[k] = highlightStyle[k]; } } - return false; - } + return newStyle; + }; - function _isInsideRing(area, x, y) { - return _isInsideCircle(area, x, y, area.r) - && !_isInsideCircle({x: area.x, y: area.y}, x, y, area.r0 || 0); - } + // 高亮放大效果参数 + // 当前统一设置为6,如有需要差异设置,通过this.type判断实例类型 + Base.prototype.getHighlightZoom = function () { + return this.type != 'text' ? 6 : 2; + }; /** - * 矩形包含判断 + * 移动位置 + * @param {number} dx 横坐标变化 + * @param {number} dy 纵坐标变化 */ - function _isInsideRectangle(area, x, y) { - return x >= area.x - && x <= (area.x + area.width) - && y >= area.y - && y <= (area.y + area.height); - } + Base.prototype.drift = function (dx, dy) { + this.position[0] += dx; + this.position[1] += dy; + }; /** - * 圆形包含判断 + * 变换鼠标位置到 shape 的局部坐标空间 + * @method + * @param {number} x + * @param {number} y + * @return {Array.} */ - function _isInsideCircle(area, x, y, r) { - return (x - area.x) * (x - area.x) + (y - area.y) * (y - area.y) - < r * r; - } + Base.prototype.getTansform = (function() { + + var invTransform = []; + + return function (x, y) { + var originPos = [ x, y ]; + // 对鼠标的坐标也做相同的变换 + if (this.needTransform && this.transform) { + matrix.invert(invTransform, this.transform); + + matrix.mulVector(originPos, invTransform, [ x, y, 1 ]); + + if (x == originPos[0] && y == originPos[1]) { + // 避免外部修改导致的needTransform不准确 + this.updateNeedTransform(); + } + } + return originPos; + }; + })(); /** - * 扇形包含判断 + * 构建绘制的Path + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Base~IBaseShapeStyle} style */ - function _isInsideSector(area, x, y) { - if (!_isInsideCircle(area, x, y, area.r) - || (area.r0 > 0 - && _isInsideCircle( - { - x : area.x, - y : area.y - }, - x, y, - area.r0 - ) - ) - ){ - // 大圆外或者小圆内直接false - return false; + Base.prototype.buildPath = function (ctx, style) { + log('buildPath not implemented in ' + this.type); + }; + + /** + * 计算返回包围盒矩形 + * @param {module:zrender/shape/Base~IBaseShapeStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + Base.prototype.getRect = function (style) { + log('getRect not implemented in ' + this.type); + }; + + /** + * 判断鼠标位置是否在图形内 + * @param {number} x + * @param {number} y + * @return {boolean} + */ + Base.prototype.isCover = function (x, y) { + var originPos = this.getTansform(x, y); + x = originPos[0]; + y = originPos[1]; + + // 快速预判并保留判断矩形 + var rect = this.style.__rect; + if (!rect) { + rect = this.style.__rect = this.getRect(this.style); } - // 判断夹角 - if (Math.abs(area.endAngle - area.startAngle) >= 360) { - // 大于360度的扇形,在环内就为true - return true; + if (x >= rect.x + && x <= (rect.x + rect.width) + && y >= rect.y + && y <= (rect.y + rect.height) + ) { + // 矩形内 + return require('../tool/area').isInside(this, this.style, x, y); } - var angle = (360 - - Math.atan2(y - area.y, x - area.x) / Math.PI - * 180) - % 360; - var endA = (360 + area.endAngle) % 360; - var startA = (360 + area.startAngle) % 360; - if (endA > startA) { - return (angle >= startA && angle <= endA); - } - - return !(angle >= endA && angle <= startA); - } + return false; + }; /** - * 多边形包含判断 - * 警告:下面这段代码会很难看,建议跳过~ + * 绘制附加文本 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Base~IBaseShapeStyle} style 样式 + * @param {module:zrender/shape/Base~IBaseShapeStyle} normalStyle 默认样式,用于定位文字显示 */ - function _isInsidePolygon(area, x, y) { - /** - * 射线判别法 - * 如果一个点在多边形内部,任意角度做射线肯定会与多边形要么有一个交点,要么有与多边形边界线重叠 - * 如果一个点在多边形外部,任意角度做射线要么与多边形有一个交点, - * 要么有两个交点,要么没有交点,要么有与多边形边界线重叠。 - */ - var i; - var j; - var polygon = area.pointList; - var N = polygon.length; - var inside = false; - var redo = true; - var v; - - for (i = 0; i < N; ++i) { - // 是否在顶点上 - if (polygon[i][0] == x && polygon[i][1] == y ) { - redo = false; - inside = true; - break; - } + Base.prototype.drawText = function (ctx, style, normalStyle) { + if (typeof(style.text) == 'undefined' || style.text === false) { + return; } + // 字体颜色策略 + var textColor = style.textColor || style.color || style.strokeColor; + ctx.fillStyle = textColor; + + // 文本与图形间空白间隙 + var dd = 10; + var al; // 文本水平对齐 + var bl; // 文本垂直对齐 + var tx; // 文本横坐标 + var ty; // 文本纵坐标 + + var textPosition = style.textPosition // 用户定义 + || this.textPosition // shape默认 + || 'top'; // 全局默认 + + switch (textPosition) { + case 'inside': + case 'top': + case 'bottom': + case 'left': + case 'right': + if (this.getRect) { + var rect = (normalStyle || style).__rect + || this.getRect(normalStyle || style); - if (redo) { - redo = false; - inside = false; - for (i = 0,j = N - 1; i < N; j = i++) { - if ((polygon[i][1] < y && y < polygon[j][1]) - || (polygon[j][1] < y && y < polygon[i][1]) - ) { - if (x <= polygon[i][0] || x <= polygon[j][0]) { - v = (y - polygon[i][1]) - * (polygon[j][0] - polygon[i][0]) - / (polygon[j][1] - polygon[i][1]) - + polygon[i][0]; - if (x < v) { // 在线的左侧 - inside = !inside; - } - else if (x == v) { // 在线上 - inside = true; + switch (textPosition) { + case 'inside': + tx = rect.x + rect.width / 2; + ty = rect.y + rect.height / 2; + al = 'center'; + bl = 'middle'; + if (style.brushType != 'stroke' + && textColor == style.color + ) { + ctx.fillStyle = '#fff'; + } + break; + case 'left': + tx = rect.x - dd; + ty = rect.y + rect.height / 2; + al = 'end'; + bl = 'middle'; + break; + case 'right': + tx = rect.x + rect.width + dd; + ty = rect.y + rect.height / 2; + al = 'start'; + bl = 'middle'; + break; + case 'top': + tx = rect.x + rect.width / 2; + ty = rect.y - dd; + al = 'center'; + bl = 'bottom'; + break; + case 'bottom': + tx = rect.x + rect.width / 2; + ty = rect.y + rect.height + dd; + al = 'center'; + bl = 'top'; break; - } } } - else if (y == polygon[i][1]) { - if (x < polygon[i][0]) { // 交点在顶点上 - polygon[i][1] > polygon[j][1] ? --y : ++y; - //redo = true; - break; + break; + case 'start': + case 'end': + var xStart; + var xEnd; + var yStart; + var yEnd; + if (typeof style.pointList != 'undefined') { + var pointList = style.pointList; + if (pointList.length < 2) { + // 少于2个点就不画了~ + return; + } + var length = pointList.length; + switch (textPosition) { + case 'start': + xStart = pointList[0][0]; + xEnd = pointList[1][0]; + yStart = pointList[0][1]; + yEnd = pointList[1][1]; + break; + case 'end': + xStart = pointList[length - 2][0]; + xEnd = pointList[length - 1][0]; + yStart = pointList[length - 2][1]; + yEnd = pointList[length - 1][1]; + break; } } - else if (polygon[i][1] == polygon[j][1] // 在水平的边界线上 - && y == polygon[i][1] - && ((polygon[i][0] < x && x < polygon[j][0]) - || (polygon[j][0] < x && x < polygon[i][0])) - ) { - inside = true; - break; + else { + xStart = style.xStart || 0; + xEnd = style.xEnd || 0; + yStart = style.yStart || 0; + yEnd = style.yEnd || 0; } - } - } - return inside; - } - - /** - * 路径包含判断,依赖多边形判断 - */ - function _isInsidePath(area, x, y) { - if (!area.pointList) { - require('../shape/Path').prototype.buildPath(_ctx, area); - } - var pointList = area.pointList; - var insideCatch = false; - for (var i = 0, l = pointList.length; i < l; i++) { - insideCatch = _isInsidePolygon( - { pointList : pointList[i] }, x, y - ); - - if (insideCatch) { - break; - } - } - return insideCatch; - } + switch (textPosition) { + case 'start': + al = xStart < xEnd ? 'end' : 'start'; + bl = yStart < yEnd ? 'bottom' : 'top'; + tx = xStart; + ty = yStart; + break; + case 'end': + al = xStart < xEnd ? 'start' : 'end'; + bl = yStart < yEnd ? 'top' : 'bottom'; + tx = xEnd; + ty = yEnd; + break; + } + dd -= 4; + if (xStart != xEnd) { + tx -= (al == 'end' ? dd : -dd); + } + else { + al = 'center'; + } - /** - * 测算多行文本宽度 - * @param {Object} text - * @param {Object} textFont - */ - function getTextWidth(text, textFont) { - var key = text+':'+textFont; - if (_textWidthCache[key]) { - return _textWidthCache[key]; + if (yStart != yEnd) { + ty -= (bl == 'bottom' ? dd : -dd); + } + else { + bl = 'middle'; + } + break; + case 'specific': + tx = style.textX || 0; + ty = style.textY || 0; + al = 'start'; + bl = 'middle'; + break; } - _ctx = _ctx || util.getContext(); - _ctx.save(); - if (textFont) { - _ctx.font = textFont; - } - - text = (text + '').split('\n'); - var width = 0; - for (var i = 0, l = text.length; i < l; i++) { - width = Math.max( - _ctx.measureText(text[i]).width, - width + if (tx != null && ty != null) { + _fillText( + ctx, + style.text, + tx, ty, + style.textFont, + style.textAlign || al, + style.textBaseline || bl ); } - _ctx.restore(); + }; - _textWidthCache[key] = width; - if (++_textWidthCacheCounter > TEXT_CACHE_MAX) { - // 内存释放 - _textWidthCacheCounter = 0; - _textWidthCache = {}; + Base.prototype.modSelf = function() { + this.__dirty = true; + if (this.style) { + this.style.__rect = null; } - - return width; - } - + }; + /** - * 测算多行文本高度 - * @param {Object} text - * @param {Object} textFont + * 图形是否会触发事件 + * @return {boolean} */ - function getTextHeight(text, textFont) { - var key = text+':'+textFont; - if (_textHeightCache[key]) { - return _textHeightCache[key]; - } - - _ctx = _ctx || util.getContext(); - - _ctx.save(); - if (textFont) { - _ctx.font = textFont; - } - - text = (text + '').split('\n'); - //比较粗暴 - var height = (_ctx.measureText('国').width + 2) * text.length; - - _ctx.restore(); + // TODO, 通过 bind 绑定的事件 + Base.prototype.isSilent = function () { + return !( + this.hoverable || this.draggable || this.clickable + || this.onmousemove || this.onmouseover || this.onmouseout + || this.onmousedown || this.onmouseup || this.onclick + || this.ondragenter || this.ondragover || this.ondragleave + || this.ondrop + ); + }; - _textHeightCache[key] = height; - if (++_textHeightCacheCounter > TEXT_CACHE_MAX) { - // 内存释放 - _textHeightCacheCounter = 0; - _textHeightCache = {}; - } - return height; - } + util.merge(Base.prototype, Transformable.prototype, true); + util.merge(Base.prototype, Eventful.prototype, true); - return { - isInside : isInside, - isOutside : isOutside, - getTextWidth : getTextWidth, - getTextHeight : getTextHeight - }; + return Base; } ); /** - * zrender - * + * @module zrender/shape/Text * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:文字 - * 可配图形属性: - { - // 基础属性 - shape : 'text', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,横坐标 - y : {number}, // 必须,纵坐标 - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',线条颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 必须,文本内容 - textFont : {string}, // 默认为null,文本文字样式,eg:'bold 18px verdana' - textAlign : {string}, // 默认为start,文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认为middle,文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - maxWidth : {number} // 默认为null,最大宽度 - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'text', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - color : 'red', - text : 'Baidu' - }, - myName : 'kener', //可自带任何有效自定义属性 + * @example + * var Text = require('zrender/shape/Text'); + * var shape = new Text({ + * style: { + * text: 'Label', + * x: 100, + * y: 100, + * textFont: '14px Arial' + * } + * }); + * zr.addShape(shape); + */ - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } +/** + * @typedef {Object} ITextStyle + * @property {number} x 横坐标 + * @property {number} y 纵坐标 + * @property {string} text 文本内容 + * @property {number} [maxWidth=null] 最大宽度限制 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 */ + define( 'zrender/shape/Text',['require','../tool/area','./Base','../tool/util'],function (require) { var area = require('../tool/area'); var Base = require('./Base'); - function Text(options) { + /** + * @alias module:zrender/shape/Text + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var Text = function (options) { Base.call(this, options); - } + /** + * 文字绘制样式 + * @name module:zrender/shape/Text#style + * @type {module:zrender/shape/Text~ITextStyle} + */ + /** + * 文字高亮绘制样式 + * @name module:zrender/shape/Text#highlightStyle + * @type {module:zrender/shape/Text~ITextStyle} + */ + }; Text.prototype = { type: 'text', - /** - * 画刷,重载基类方法 - * @param {Context2D} ctx Canvas 2D上下文 - * @param isHighlight 是否为高亮状态 - */ - brush : function(ctx, isHighlight) { + brush : function (ctx, isHighlight) { var style = this.style; if (isHighlight) { // 根据style扩展默认高亮样式 @@ -7687,7 +8719,7 @@ define( ); } } - else{ + else { switch (style.brushType) { case 'fill': ctx.fillText(text[i], x, y); @@ -7711,10 +8743,11 @@ define( }, /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style + * 返回文字包围盒矩形 + * @param {module:zrender/shape/Text~ITextStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} */ - getRect : function(style) { + getRect : function (style) { if (style.__rect) { return style.__rect; } @@ -7722,7 +8755,7 @@ define( var width = area.getTextWidth(style.text, style.textFont); var height = area.getTextHeight(style.text, style.textFont); - var textX = style.x; //默认start == left + var textX = style.x; // 默认start == left if (style.textAlign == 'end' || style.textAlign == 'right') { textX -= width; } @@ -7758,105 +8791,85 @@ define( } ); + /** - * zrender - * + * 矩形 + * @module zrender/shape/Rectangle * @author Kener (@Kener-林峰, linzhifeng@baidu.com) , * strwind (@劲风FEI, yaofeifei@baidu.com) - * - * shape类:矩形 - * 可配图形属性: - { - // 基础属性 - shape : 'rectangle', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,左上角横坐标 - y : {number}, // 必须,左上角纵坐标 - width : {number}, // 必须,宽度 - height : {number}, // 必须,高度 - radius : {array}, // 默认为[0],圆角 - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为top,附加文本位置。 - // inside | left | right | top | bottom - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'rectangle', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - width : 150, - height : 50, - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 + * @example + * var Rectangle = require('zrender/shape/Rectangle'); + * var shape = new Rectangle({ + * style: { + * x: 0, + * y: 0, + * width: 100, + * height: 100, + * radius: 20 + * } + * }); + * zr.addShape(shape); + */ - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } +/** + * @typedef {Object} IRectangleStyle + * @property {number} x 左上角x坐标 + * @property {number} y 左上角y坐标 + * @property {number} width 宽度 + * @property {number} height 高度 + * @property {number|Array.} radius 矩形圆角,可以用数组分别指定四个角的圆角 + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic */ define( 'zrender/shape/Rectangle',['require','./Base','../tool/util'],function (require) { var Base = require('./Base'); - function Rectangle(options) { + /** + * @alias module:zrender/shape/Rectangle + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var Rectangle = function (options) { Base.call(this, options); - } + /** + * 矩形绘制样式 + * @name module:zrender/shape/Rectangle#style + * @type {module:zrender/shape/Rectangle~IRectangleStyle} + */ + /** + * 矩形高亮绘制样式 + * @name module:zrender/shape/Rectangle#highlightStyle + * @type {module:zrender/shape/Rectangle~IRectangleStyle} + */ + }; Rectangle.prototype = { type: 'rectangle', - /** - * 绘制圆角矩形 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - _buildRadiusPath: function(ctx, style) { - //左上、右上、右下、左下角的半径依次为r1、r2、r3、r4 - //r缩写为1 相当于 [1, 1, 1, 1] - //r缩写为[1] 相当于 [1, 1, 1, 1] - //r缩写为[1, 2] 相当于 [1, 2, 1, 2] - //r缩写为[1, 2, 3] 相当于 [1, 2, 3, 2] + _buildRadiusPath: function (ctx, style) { + // 左上、右上、右下、左下角的半径依次为r1、r2、r3、r4 + // r缩写为1 相当于 [1, 1, 1, 1] + // r缩写为[1] 相当于 [1, 1, 1, 1] + // r缩写为[1, 2] 相当于 [1, 2, 1, 2] + // r缩写为[1, 2, 3] 相当于 [1, 2, 3, 2] var x = style.x; var y = style.y; var width = style.width; @@ -7867,30 +8880,54 @@ define( var r3; var r4; - if(typeof r === 'number') { + if (typeof r === 'number') { r1 = r2 = r3 = r4 = r; } - else if(r instanceof Array) { + else if (r instanceof Array) { if (r.length === 1) { r1 = r2 = r3 = r4 = r[0]; } - else if(r.length === 2) { + else if (r.length === 2) { r1 = r3 = r[0]; r2 = r4 = r[1]; } - else if(r.length === 3) { + else if (r.length === 3) { r1 = r[0]; r2 = r4 = r[1]; r3 = r[2]; - } else { + } + else { r1 = r[0]; r2 = r[1]; r3 = r[2]; r4 = r[3]; } - } else { + } + else { r1 = r2 = r3 = r4 = 0; } + + var total; + if (r1 + r2 > width) { + total = r1 + r2; + r1 *= width / total; + r2 *= width / total; + } + if (r3 + r4 > width) { + total = r3 + r4; + r3 *= width / total; + r4 *= width / total; + } + if (r2 + r3 > height) { + total = r2 + r3; + r2 *= height / total; + r3 *= height / total; + } + if (r1 + r4 > height) { + total = r1 + r4; + r1 *= height / total; + r4 *= height / total; + } ctx.moveTo(x + r1, y); ctx.lineTo(x + width - r2, y); r2 !== 0 && ctx.quadraticCurveTo( @@ -7910,26 +8947,29 @@ define( /** * 创建矩形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 + * @param {CanvasRenderingContext2D} ctx + * @param {Object} style */ - buildPath : function(ctx, style) { - if(!style.radius) { + buildPath : function (ctx, style) { + if (!style.radius) { ctx.moveTo(style.x, style.y); ctx.lineTo(style.x + style.width, style.y); ctx.lineTo(style.x + style.width, style.y + style.height); ctx.lineTo(style.x, style.y + style.height); ctx.lineTo(style.x, style.y); - //ctx.rect(style.x, style.y, style.width, style.height); - } else { + // ctx.rect(style.x, style.y, style.width, style.height); + } + else { this._buildRadiusPath(ctx, style); } + ctx.closePath(); return; }, /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style + * 计算返回矩形包围盒矩阵 + * @param {module:zrender/shape/Rectangle~IRectangleStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} */ getRect : function(style) { if (style.__rect) { @@ -7958,6 +8998,7 @@ define( return Rectangle; } ); + /** * zrender: loading特效类 * @@ -8059,7 +9100,8 @@ define( }; Base.prototype._start = function (/*addShapeHandle, refreshHandle*/) { - return setInterval(function(){}, 10000); + return setInterval(function () { + }, 10000); }; Base.prototype.stop = function () { @@ -8079,101 +9121,119 @@ define( } return value; }; + + Base.prototype.getLocation = function(loc, totalWidth, totalHeight) { + var x = loc.x != null ? loc.x : 'center'; + switch (x) { + case 'center' : + x = Math.floor((this.canvasWidth - totalWidth) / 2); + break; + case 'left' : + x = 0; + break; + case 'right' : + x = this.canvasWidth - totalWidth; + break; + } + var y = loc.y != null ? loc.y : 'center'; + switch (y) { + case 'center' : + y = Math.floor((this.canvasHeight - totalHeight) / 2); + break; + case 'top' : + y = 0; + break; + case 'bottom' : + y = this.canvasHeight - totalHeight; + break; + } + return { + x : x, + y : y, + width : totalWidth, + height : totalHeight + }; + }; return Base; } ); /** - * zrender - * - * @author lang( shenyi01@baidu.com ) - * - * shape类:图片 - * 可配图形属性: - { - // 基础属性 - shape : 'image', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,左上角横坐标 - y : {number}, // 必须,左上角纵坐标 - width : {number}, // 可选,宽度 - height : {number}, // 可选,高度 - sx : {number}, // 可选, 从图片中裁剪的x - sy : {number}, // 可选, 从图片中裁剪的y - sWidth : {number}, // 可选, 从图片中裁剪的宽度 - sHeight : {number}, // 可选, 从图片中裁剪的高度 - image : {string|Image} // 必须,图片url或者图片对象 - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为top,附加文本位置。 - // inside | left | right | top | bottom - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'image', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - width : 150, - height : 50, - image : 'tests.jpg', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 + * 图片绘制 + * @module zrender/shape/Image + * @author pissang(https://www.github.com/pissang) + * @example + * var ImageShape = require('zrender/shape/Image'); + * var image = new ImageShape({ + * style: { + * image: 'test.jpg', + * x: 100, + * y: 100 + * } + * }); + * zr.addShape(image); + */ - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } +/** + * @typedef {Object} IImageStyle + * @property {string|HTMLImageElement|HTMLCanvasElement} image 图片url或者图片对象 + * @property {number} x 左上角横坐标 + * @property {number} y 左上角纵坐标 + * @property {number} [width] 绘制到画布上的宽度,默认为图片宽度 + * @property {number} [height] 绘制到画布上的高度,默认为图片高度 + * @property {number} [sx=0] 从图片中裁剪的左上角横坐标 + * @property {number} [sy=0] 从图片中裁剪的左上角纵坐标 + * @property {number} [sWidth] 从图片中裁剪的宽度,默认为图片高度 + * @property {number} [sHeight] 从图片中裁剪的高度,默认为图片高度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic */ define( 'zrender/shape/Image',['require','./Base','../tool/util'],function (require) { - var _cache = {}; + var _needsRefresh = []; var _refreshTimeout; var Base = require('./Base'); - function ZImage(options) { + /** + * @alias zrender/shape/Image + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var ZImage = function(options) { Base.call(this, options); - } + + this._imageCache = {}; + /** + * 图片绘制样式 + * @name module:zrender/shape/Image#style + * @type {module:zrender/shape/Image~IImageStyle} + */ + /** + * 图片高亮绘制样式 + * @name module:zrender/shape/Image#highlightStyle + * @type {module:zrender/shape/Image~IImageStyle} + */ + }; ZImage.prototype = { + type: 'image', + brush : function(ctx, isHighlight, refresh) { var style = this.style || {}; @@ -8189,29 +9249,28 @@ define( if (typeof(image) === 'string') { var src = image; - if (_cache[src]) { - image = _cache[src]; - } - else { - image = new Image();//document.createElement('image'); - image.onload = function(){ + if (this._imageCache[src]) { + image = this._imageCache[src]; + } else { + image = new Image(); + image.onload = function () { image.onload = null; clearTimeout(_refreshTimeout); - _needsRefresh.push( me ); + _needsRefresh.push(me); // 防止因为缓存短时间内触发多次onload事件 - _refreshTimeout = setTimeout(function(){ - refresh && refresh( _needsRefresh ); + _refreshTimeout = setTimeout(function () { + refresh && refresh(_needsRefresh); // 清空needsRefresh _needsRefresh = []; }, 10); }; - _cache[src] = image; image.src = src; + this._imageCache[src] = image; } } if (image) { - //图片已经加载完成 + // 图片已经加载完成 if (image.nodeName.toUpperCase() == 'IMG') { if (window.ActiveXObject) { if (image.readyState != 'complete') { @@ -8225,7 +9284,6 @@ define( } } // Else is canvas - var width = style.width || image.width; var height = style.height || image.height; var x = style.x; @@ -8266,11 +9324,18 @@ define( ctx.drawImage(image, x, y, width, height); } // 如果没设置宽和高的话自动根据图片宽高设置 - style.width = width; - style.height = height; - this.style.width = width; - this.style.height = height; - + if (!style.width) { + style.width = width; + } + if (!style.height) { + style.height = height; + } + if (!this.style.width) { + this.style.width = width; + } + if (!this.style.height) { + this.style.height = height; + } this.drawText(ctx, style, this.style); @@ -8279,26 +9344,21 @@ define( }, /** - * 创建路径,用于判断hover时调用isPointInPath~ - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - ctx.rect(style.x, style.y, style.width, style.height); - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style + * 计算返回图片的包围盒矩形 + * @param {module:zrender/shape/Image~IImageStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} */ - getRect : function(style) { + getRect: function(style) { return { x : style.x, y : style.y, width : style.width, height : style.height }; + }, + + clearCache: function() { + this._imageCache = {}; } }; @@ -8306,55 +9366,55 @@ define( return ZImage; } ); + /** * Painter绘图模块 - * + * @module zrender/Painter * @author Kener (@Kener-林峰, linzhifeng@baidu.com) * errorrik (errorrik@gmail.com) + * pissang (https://www.github.com/pissang) */ - - - -define( - 'zrender/Painter',['require','./config','./tool/util','./tool/log','./tool/matrix','./loadingEffect/Base','./shape/Image'],function (require) { - + define( + 'zrender/Painter',['require','./config','./tool/util','./tool/log','./tool/matrix','./loadingEffect/Base','./mixin/Transformable','./shape/Image'],function (require) { var config = require('./config'); var util = require('./tool/util'); + // var vec2 = require('./tool/vector'); var log = require('./tool/log'); var matrix = require('./tool/matrix'); var BaseLoadingEffect = require('./loadingEffect/Base'); + var Transformable = require('./mixin/Transformable'); // retina 屏幕优化 var devicePixelRatio = window.devicePixelRatio || 1; devicePixelRatio = Math.max(devicePixelRatio, 1); - var vmlCanvasManager = window.G_vmlCanvasManager; + var vmlCanvasManager = window['G_vmlCanvasManager']; - /** - * 返回false的方法,用于避免页面被选中 - * - * @inner - */ + + // 返回false的方法,用于避免页面被选中 function returnFalse() { return false; } - /** - * 什么都不干的空方法 - * - * @inner - */ + // 什么都不干的空方法 function doNothing() {} /** - * 绘图类 (V) - * - * @param {HTMLElement} root 绘图区域 - * @param {storage} storage Storage实例 + * @alias module:zrender/Painter + * @constructor + * @param {HTMLElement} root 绘图容器 + * @param {module:zrender/Storage} storage */ - function Painter(root, storage) { + var Painter = function (root, storage) { + /** + * 绘图容器 + * @type {HTMLElement} + */ this.root = root; + /** + * @type {module:zrender/Storage} + */ this.storage = storage; root.innerHTML = ''; @@ -8364,7 +9424,7 @@ define( var domRoot = document.createElement('div'); this._domRoot = domRoot; - //domRoot.onselectstart = returnFalse; // 避免页面选中的尴尬 + // domRoot.onselectstart = returnFalse; // 避免页面选中的尴尬 domRoot.style.position = 'relative'; domRoot.style.overflow = 'hidden'; domRoot.style.width = this._width + 'px'; @@ -8382,6 +9442,10 @@ define( // 背景 this._bgDom = createDom('bg', 'div', this); domRoot.appendChild(this._bgDom); + this._bgDom.onselectstart = returnFalse; + this._bgDom.style['-webkit-user-select'] = 'none'; + this._bgDom.style['user-select'] = 'none'; + // this._bgDom.style[' -webkit-touch-callout'] = 'none'; // 高亮 var hoverLayer = new Layer('_zrender_hover_', this); @@ -8389,18 +9453,21 @@ define( domRoot.appendChild(hoverLayer.dom); hoverLayer.initContext(); - hoverLayer.onselectstart = returnFalse; + hoverLayer.dom.onselectstart = returnFalse; + hoverLayer.dom.style['-webkit-user-select'] = 'none'; + hoverLayer.dom.style['user-select'] = 'none'; + // hoverLayer.dom.style[' -webkit-touch-callout'] = 'none'; var me = this; - this.updatePainter = function(shapeList, callback) { - me.update(shapeList, callback); + this.updatePainter = function (shapeList, callback) { + me.refreshShapes(shapeList, callback); }; - } + }; /** * 首次绘图,创建各种dom和context * - * @param {Function=} callback 绘画结束后的回调函数 + * @param {Function} callback 绘画结束后的回调函数 */ Painter.prototype.render = function (callback) { if (this.isLoading()) { @@ -8414,9 +9481,8 @@ define( /** * 刷新 - * - * @param {Function=} callback 刷新结束后的回调函数 - * @param {Boolean} paintAll 强制绘制所有shape + * @param {Function} callback 刷新结束后的回调函数 + * @param {boolean} paintAll 强制绘制所有shape */ Painter.prototype.refresh = function (callback, paintAll) { var list = this.storage.getShapeList(true); @@ -8429,7 +9495,7 @@ define( return this; }; - Painter.prototype._paintList = function(list, paintAll) { + Painter.prototype._paintList = function (list, paintAll) { if (typeof(paintAll) == 'undefined') { paintAll = false; @@ -8444,6 +9510,7 @@ define( for (var id in this._layers) { if (id !== 'hover') { this._layers[id].unusedCount++; + this._layers[id].updateTransform(); } } @@ -8453,6 +9520,10 @@ define( var shape = list[i]; if (currentZLevel !== shape.zlevel) { + if (currentLayer && currentLayer.needTransform) { + ctx.restore(); + } + currentLayer = this.getLayer(shape.zlevel, currentLayer); ctx = currentLayer.ctx; currentZLevel = shape.zlevel; @@ -8463,6 +9534,11 @@ define( if (currentLayer.dirty || paintAll) { currentLayer.clear(); } + + if (currentLayer.needTransform) { + ctx.save(); + currentLayer.setTransform(ctx); + } } // Start group clipping @@ -8504,14 +9580,15 @@ define( try { shape.brush(ctx, false, this.updatePainter); } - catch(error) { + catch (error) { log( error, 'brush error of ' + shape.type, shape ); } - } else { + } + else { shape.brush(ctx, false, this.updatePainter); } } @@ -8525,23 +9602,33 @@ define( shape.__dirty = false; } + if (currentLayer && currentLayer.needTransform) { + ctx.restore(); + } + for (var id in this._layers) { if (id !== 'hover') { var layer = this._layers[id]; layer.dirty = false; // 删除过期的层 - if (layer.unusedCount >= 500) { - delete this._layers[id]; - layer.dom.parentNode.removeChild(layer.dom); - } - else if (layer.unusedCount == 1) { + // PENDING + // if (layer.unusedCount >= 500) { + // this.delLayer(id); + // } + if (layer.unusedCount == 1) { layer.clear(); } } } }; - Painter.prototype.getLayer = function(zlevel, prevLayer) { + /** + * 获取 zlevel 所在层,如果不存在则会创建一个新的层 + * @param {number} zlevel + * @param {module:zrender/Painter~Layer} [prevLayer] + * 在需要创建新的层时需要使用,新创建层的dom节点会插在该层后面 + */ + Painter.prototype.getLayer = function (zlevel, prevLayer) { // Change draw layer var currentLayer = this._layers[zlevel]; if (!currentLayer) { @@ -8553,7 +9640,8 @@ define( currentLayer.dom, prevDom.nextSibling ); - } else { + } + else { prevDom.parentNode.appendChild( currentLayer.dom ); @@ -8562,13 +9650,25 @@ define( this._layers[zlevel] = currentLayer; - currentLayer.config = this._layerConfig[zlevel]; + if (this._layerConfig[zlevel]) { + util.merge(currentLayer, this._layerConfig[zlevel], true); + } + + currentLayer.updateTransform(); } return currentLayer; }; - Painter.prototype._updateLayerStatus = function(list) { + /** + * 获取所有已创建的层 + * @param {Array.} [prevLayer] + */ + Painter.prototype.getLayers = function () { + return this._layers; + }; + + Painter.prototype._updateLayerStatus = function (list) { var layers = this._layers; @@ -8605,12 +9705,11 @@ define( }; /** - * 视图更新 - * - * @param {Array} shapeList 需要更新的图形元素列表 - * @param {Function} callback 视图更新后回调函数 + * 指定的图形列表 + * @param {Array.} shapeList 需要更新的图形元素列表 + * @param {Function} [callback] 视图更新后回调函数 */ - Painter.prototype.update = function (shapeList, callback) { + Painter.prototype.refreshShapes = function (shapeList, callback) { for (var i = 0, l = shapeList.length; i < l; i++) { var shape = shapeList[i]; this.storage.mod(shape.id); @@ -8647,23 +9746,55 @@ define( /** * 修改指定zlevel的绘制参数 + * + * @param {string} zlevel + * @param {Object} config 配置对象 + * @param {string} [config.clearColor=0] 每次清空画布的颜色 + * @param {string} [config.motionBlur=false] 是否开启动态模糊 + * @param {number} [config.lastFrameAlpha=0.7] + * 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显 + * @param {Array.} [position] 层的平移 + * @param {Array.} [rotation] 层的旋转 + * @param {Array.} [scale] 层的缩放 + * @param {boolean} [zoomable=false] 层是否支持鼠标缩放操作 + * @param {boolean} [panable=false] 层是否支持鼠标平移操作 */ Painter.prototype.modLayer = function (zlevel, config) { if (config) { if (!this._layerConfig[zlevel]) { this._layerConfig[zlevel] = config; - } else { + } + else { util.merge(this._layerConfig[zlevel], config, true); } var layer = this._layers[zlevel]; if (layer) { - layer.config = this._layerConfig[zlevel]; + util.merge(layer, this._layerConfig[zlevel], true); } } }; + /** + * 删除指定层 + * @param {number} zlevel 层所在的zlevel + */ + Painter.prototype.delLayer = function (zlevel) { + var layer = this._layers[zlevel]; + if (!layer) { + return; + } + // Save config + this.modLayer(zlevel, { + position: layer.position, + rotation: layer.rotation, + scale: layer.scale + }); + layer.dom.parentNode.removeChild(layer.dom); + delete this._layers[zlevel]; + }; + /** * 刷新hover层 */ @@ -8733,7 +9864,7 @@ define( domRoot.style.display = ''; // 优化没有实际改变的resize - if (this._width != width || height != this._height){ + if (this._width != width || height != this._height) { this._width = width; this._height = height; @@ -8753,9 +9884,10 @@ define( /** * 清除单独的一个层 + * @param {number} zLevel */ - Painter.prototype.clearLayer = function (k) { - var layer = this._layers[k]; + Painter.prototype.clearLayer = function (zLevel) { + var layer = this._layers[zLevel]; if (layer) { layer.clear(); } @@ -8782,6 +9914,12 @@ define( return this._layers.hover.dom; }; + /** + * 图像导出 + * @param {string} type + * @param {string} [backgroundColor='#fff'] 背景色 + * @return {string} 图片的Base64 url + */ Painter.prototype.toDataURL = function (type, backgroundColor, args) { if (vmlCanvasManager) { return null; @@ -8801,20 +9939,21 @@ define( ); ctx.fill(); - //升序遍历,shape上的zlevel指定绘画图层的z轴层叠 + var self = this; + // 升序遍历,shape上的zlevel指定绘画图层的z轴层叠 this.storage.iterShape( function (shape) { if (!shape.invisible) { - if (!shape.onbrush //没有onbrush - //有onbrush并且调用执行返回false或undefined则继续粉刷 + if (!shape.onbrush // 没有onbrush + // 有onbrush并且调用执行返回false或undefined则继续粉刷 || (shape.onbrush && !shape.onbrush(ctx, false)) ) { if (config.catchBrushException) { try { - shape.brush(ctx, false, this.updatePainter); + shape.brush(ctx, false, self.updatePainter); } - catch(error) { + catch (error) { log( error, 'brush error of ' + shape.type, @@ -8823,7 +9962,7 @@ define( } } else { - shape.brush(ctx, false, this.updatePainter); + shape.brush(ctx, false, self.updatePainter); } } } @@ -8850,7 +9989,7 @@ define( return this._height; }; - Painter.prototype._getWidth = function() { + Painter.prototype._getWidth = function () { var root = this.root; var stl = root.currentStyle || document.defaultView.getComputedStyle(root); @@ -8870,22 +10009,24 @@ define( - parseInt(stl.paddingBottom, 10)).toFixed(0) - 0; }; - /** - * 鼠标悬浮刷画 - */ Painter.prototype._brushHover = function (shape) { var ctx = this._layers.hover.ctx; - if (!shape.onbrush //没有onbrush - //有onbrush并且调用执行返回false或undefined则继续粉刷 + if (!shape.onbrush // 没有onbrush + // 有onbrush并且调用执行返回false或undefined则继续粉刷 || (shape.onbrush && !shape.onbrush(ctx, true)) ) { + var layer = this.getLayer(shape.zlevel); + if (layer.needTransform) { + ctx.save(); + layer.setTransform(ctx); + } // Retina 优化 if (config.catchBrushException) { try { shape.brush(ctx, true, this.updatePainter); } - catch(error) { + catch (error) { log( error, 'hoverBrush error of ' + shape.type, shape ); @@ -8894,6 +10035,9 @@ define( else { shape.brush(ctx, true, this.updatePainter); } + if (layer.needTransform) { + ctx.restore(); + } } }; @@ -8916,14 +10060,14 @@ define( rotation : shape.rotation, scale : shape.scale }; - shape.position = [0, 0, 0]; + shape.position = [ 0, 0, 0 ]; shape.rotation = 0; - shape.scale = [1, 1]; + shape.scale = [ 1, 1 ]; if (shape) { shape.brush(ctx, false); } - var ImageShape = require( './shape/Image' ); + var ImageShape = require('./shape/Image'); var imgShape = new ImageShape({ id : id, style : { @@ -8953,10 +10097,10 @@ define( return doNothing; } - var painter = this; + var me = this; return function (id, e, width, height) { - return painter._shapeToImage( + return me._shapeToImage( id, e, width, height, devicePixelRatio ); }; @@ -8989,11 +10133,19 @@ define( return newDom; } - /***************************************** - * Layer - *****************************************/ - function Layer(id, painter) { + /** + * @alias module:zrender/Painter~Layer + * @constructor + * @extends module:zrender/mixin/Transformable + * @param {string} id + * @param {module:zrender/Painter} painter + */ + var Layer = function(id, painter) { this.dom = createDom(id, 'canvas', painter); + this.dom.onselectstart = returnFalse; // 避免页面选中的尴尬 + this.dom.style['-webkit-user-select'] = 'none'; + this.dom.style['user-select'] = 'none'; + // this.dom.style[' -webkit-touch-callout'] = 'none'; vmlCanvasManager && vmlCanvasManager.initElement(this.dom); this.domBack = null; @@ -9008,16 +10160,53 @@ define( this.dirty = true; this.elCount = 0; - } - Layer.prototype.initContext = function() { + // Configs + /** + * 每次清空画布的颜色 + * @type {string} + * @default 0 + */ + this.clearColor = 0; + /** + * 是否开启动态模糊 + * @type {boolean} + * @default false + */ + this.motionBlur = false; + /** + * 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显 + * @type {number} + * @default 0.7 + */ + this.lastFrameAlpha = 0.7; + /** + * 层是否支持鼠标平移操作 + * @type {boolean} + * @default false + */ + this.zoomable = false; + /** + * 层是否支持鼠标缩放操作 + * @type {boolean} + * @default false + */ + this.panable = false; + + this.maxZoom = Infinity; + this.minZoom = 0; + + Transformable.call(this); + }; + + Layer.prototype.initContext = function () { this.ctx = this.dom.getContext('2d'); if (devicePixelRatio != 1) { this.ctx.scale(devicePixelRatio, devicePixelRatio); } - } + }; - Layer.prototype.createBackBuffer = function() { + Layer.prototype.createBackBuffer = function () { if (vmlCanvasManager) { // IE 8- should not support back buffer return; } @@ -9029,7 +10218,11 @@ define( } }; - Layer.prototype.resize = function(width, height) { + /** + * @param {number} width + * @param {number} height + */ + Layer.prototype.resize = function (width, height) { this.dom.style.width = width + 'px'; this.dom.style.height = height + 'px'; @@ -9050,65 +10243,41 @@ define( } }; - Layer.prototype.clear = function() { - var config = this.config; + /** + * 清空该层画布 + */ + Layer.prototype.clear = function () { var dom = this.dom; var ctx = this.ctx; var width = dom.width; var height = dom.height; - if (config) { - var haveClearColor = - typeof(config.clearColor) !== 'undefined' - && !vmlCanvasManager; - var haveMotionBLur = config.motionBlur && !vmlCanvasManager; - var lastFrameAlpha = config.lastFrameAlpha; - if (typeof(lastFrameAlpha) == 'undefined') { - lastFrameAlpha = 0.7; - } - - if (haveMotionBLur) { - if (!this.domBack) { - this.createBackBuffer(); - } + var haveClearColor = this.clearColor && !vmlCanvasManager; + var haveMotionBLur = this.motionBlur && !vmlCanvasManager; + var lastFrameAlpha = this.lastFrameAlpha; - this.ctxBack.globalCompositeOperation = 'copy'; - this.ctxBack.drawImage( - dom, 0, 0, - width / devicePixelRatio, - height / devicePixelRatio - ); - } + if (haveMotionBLur) { + if (!this.domBack) { + this.createBackBuffer(); + } - if (haveClearColor) { - ctx.save(); - ctx.fillStyle = this.config.clearColor; - ctx.fillRect( - 0, 0, - width / devicePixelRatio, - height / devicePixelRatio - ); - ctx.restore(); - } - else { - ctx.clearRect( - 0, 0, - width / devicePixelRatio, - height / devicePixelRatio - ); - } + this.ctxBack.globalCompositeOperation = 'copy'; + this.ctxBack.drawImage( + dom, 0, 0, + width / devicePixelRatio, + height / devicePixelRatio + ); + } - if (haveMotionBLur) { - var domBack = this.domBack; - ctx.save(); - ctx.globalAlpha = lastFrameAlpha; - ctx.drawImage( - domBack, 0, 0, - width / devicePixelRatio, - height / devicePixelRatio - ); - ctx.restore(); - } + if (haveClearColor) { + ctx.save(); + ctx.fillStyle = this.config.clearColor; + ctx.fillRect( + 0, 0, + width / devicePixelRatio, + height / devicePixelRatio + ); + ctx.restore(); } else { ctx.clearRect( @@ -9117,35 +10286,84 @@ define( height / devicePixelRatio ); } + + if (haveMotionBLur) { + var domBack = this.domBack; + ctx.save(); + ctx.globalAlpha = lastFrameAlpha; + ctx.drawImage( + domBack, 0, 0, + width / devicePixelRatio, + height / devicePixelRatio + ); + ctx.restore(); + } }; + util.merge(Layer.prototype, Transformable.prototype); + return Painter; } ); -define('zrender/shape/Group',['require','../tool/guid','../tool/util','../tool/event','./mixin/Transformable'],function(require) { +/** + * Group是一个容器,可以插入子节点,Group的变换也会被应用到子节点上 + * @module zrender/Group + * @example + * var Group = require('zrender/Group'); + * var Circle = require('zrender/shape/Circle'); + * var g = new Group(); + * g.position[0] = 100; + * g.position[1] = 100; + * g.addChild(new Circle({ + * style: { + * x: 100, + * y: 100, + * r: 20, + * brushType: 'fill' + * } + * })); + * zr.addGroup(g); + */ +define('zrender/Group',['require','./tool/guid','./tool/util','./mixin/Transformable','./mixin/Eventful'],function(require) { - var guid = require('../tool/guid'); - var util = require('../tool/util'); + var guid = require('./tool/guid'); + var util = require('./tool/util'); - var Dispatcher = require('../tool/event').Dispatcher; var Transformable = require('./mixin/Transformable'); + var Eventful = require('./mixin/Eventful'); /** - * @constructor zrender.shape.Group + * @alias module:zrender/Group + * @constructor + * @extends module:zrender/mixin/Transformable + * @extends module:zrender/mixin/Eventful */ - function Group(options) { + var Group = function(options) { options = options || {}; + /** + * Group id + * @type {string} + */ this.id = options.id || guid(); for (var key in options) { this[key] = options[key]; } + /** + * @type {string} + */ this.type = 'group'; + /** + * 用于裁剪的图形(shape),所有 Group 内的图形在绘制时都会被这个图形裁剪 + * 该图形会继承Group的变换 + * @type {module:zrender/shape/Base} + * @see http://www.w3.org/TR/2dcontext/#clipping-region + */ this.clipShape = null; this._children = []; @@ -9156,19 +10374,37 @@ define('zrender/shape/Group',['require','../tool/guid','../tool/util','../tool/e // Mixin Transformable.call(this); - Dispatcher.call(this); - } + Eventful.call(this); + }; + /** + * 是否忽略该 Group 及其所有子节点 + * @type {boolean} + * @default false + */ Group.prototype.ignore = false; + /** + * 复制并返回一份新的包含所有儿子节点的数组 + * @return {Array.} + */ Group.prototype.children = function() { return this._children.slice(); }; + /** + * 获取指定 index 的儿子节点 + * @param {number} idx + * @return {module:zrender/Group|module:zrender/shape/Base} + */ Group.prototype.childAt = function(idx) { return this._children[idx]; }; + /** + * 添加子节点,可以是Shape或者Group + * @param {module:zrender/Group|module:zrender/shape/Base} child + */ Group.prototype.addChild = function(child) { if (child == this) { return; @@ -9194,6 +10430,10 @@ define('zrender/shape/Group',['require','../tool/guid','../tool/util','../tool/e } }; + /** + * 移除子节点 + * @param {module:zrender/Group|module:zrender/shape/Base} child + */ Group.prototype.removeChild = function(child) { var idx = util.indexOf(this._children, child); @@ -9210,7 +10450,12 @@ define('zrender/shape/Group',['require','../tool/guid','../tool/util','../tool/e } }; - Group.prototype.each = function(cb, context) { + /** + * 遍历所有子节点 + * @param {Function} cb + * @param {} context + */ + Group.prototype.eachChild = function(cb, context) { var haveContext = !!context; for (var i = 0; i < this._children.length; i++) { var child = this._children[i]; @@ -9222,9 +10467,13 @@ define('zrender/shape/Group',['require','../tool/guid','../tool/util','../tool/e } }; - Group.prototype.iterate = function(cb, context) { + /** + * 深度优先遍历所有子孙节点 + * @param {Function} cb + * @param {} context + */ + Group.prototype.traverse = function(cb, context) { var haveContext = !!context; - for (var i = 0; i < this._children.length; i++) { var child = this._children[i]; if (haveContext) { @@ -9234,7 +10483,7 @@ define('zrender/shape/Group',['require','../tool/guid','../tool/util','../tool/e } if (child.type === 'group') { - child.iterate(cb, context); + child.traverse(cb, context); } } }; @@ -9252,34 +10501,37 @@ define('zrender/shape/Group',['require','../tool/guid','../tool/util','../tool/e Group.prototype.delChildrenFromStorage = function(storage) { for (var i = 0; i < this._children.length; i++) { var child = this._children[i]; - storage.delFromMap(child); + storage.delFromMap(child.id); if (child.type === 'group') { child.delChildrenFromStorage(storage); } } }; + Group.prototype.modSelf = function() { + this.__dirty = true; + }; + util.merge(Group.prototype, Transformable.prototype, true); - util.merge(Group.prototype, Dispatcher.prototype, true); + util.merge(Group.prototype, Eventful.prototype, true); return Group; }); /** * Storage内容仓库模块 - * + * @module zrender/Storage * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * errorrik (errorrik@gmail.com) + * @author errorrik (errorrik@gmail.com) + * @author pissang (https://github.com/pissang/) */ - - define( - 'zrender/Storage',['require','./tool/util','./shape/Group'],function (require) { + 'zrender/Storage',['require','./tool/util','./Group'],function (require) { var util = require('./tool/util'); - var Group = require('./shape/Group'); + var Group = require('./Group'); var defaultIterateOption = { hover: false, @@ -9298,9 +10550,10 @@ define( } /** * 内容仓库 (M) - * + * @alias module:zrender/Storage + * @constructor */ - function Storage() { + var Storage = function () { // 所有常规形状,id索引的map this._elements = {}; @@ -9312,16 +10565,17 @@ define( this._shapeList = []; this._shapeListOffset = 0; - } + }; /** * 遍历迭代器 * * @param {Function} fun 迭代回调函数,return true终止迭代 - * @param {Object=} option 迭代参数,缺省为仅降序遍历常规形状 - * hover : true 是否迭代高亮层数据 - * normal : 'down' | 'up' 是否迭代常规数据,迭代时是否指定及z轴顺序 - * update : false 是否更新shapeList + * @param {Object} [option] 迭代参数,缺省为仅降序遍历普通层图形 + * @param {boolean} [option.hover=true] 是否是高亮层图形 + * @param {string} [option.normal='up'] 是否是普通层图形,迭代时是否指定及z轴顺序 + * @param {boolean} [option.update=false] 是否在迭代前更新形状列表 + * */ Storage.prototype.iterShape = function (fun, option) { if (!option) { @@ -9329,7 +10583,7 @@ define( } if (option.hover) { - //高亮层数据遍历 + // 高亮层数据遍历 for (var i = 0, l = this._hoverElements.length; i < l; i++) { var el = this._hoverElements[i]; el.updateTransform(); @@ -9343,7 +10597,7 @@ define( this.updateShapeList(); } - //遍历: 'down' | 'up' + // 遍历: 'down' | 'up' switch (option.normal) { case 'down': // 降序遍历,高层优先 @@ -9356,7 +10610,7 @@ define( break; // case 'up': default: - //升序遍历,底层优先 + // 升序遍历,底层优先 for (var i = 0, l = this._shapeList.length; i < l; i++) { if (fun(this._shapeList[i])) { return this; @@ -9368,7 +10622,12 @@ define( return this; }; - Storage.prototype.getHoverShapes = function(update) { + /** + * 返回hover层的形状数组 + * @param {boolean} [update=false] 是否在返回前更新图形的变换 + * @return {Array.} + */ + Storage.prototype.getHoverShapes = function (update) { if (update) { for (var i = 0, l = this._hoverElements.length; i < l; i++) { this._hoverElements[i].updateTransform(); @@ -9377,15 +10636,25 @@ define( return this._hoverElements; }; - Storage.prototype.getShapeList = function(update) { + /** + * 返回所有图形的绘制队列 + * @param {boolean} [update=false] 是否在返回前更新该数组 + * 详见{@link module:zrender/shape/Base.prototype.updateShapeList} + * @return {Array.} + */ + Storage.prototype.getShapeList = function (update) { if (update) { this.updateShapeList(); } return this._shapeList; }; - - Storage.prototype.updateShapeList = function() { + /** + * 更新图形的绘制队列。 + * 每次绘制前都会调用,该方法会先深度优先遍历整个树,更新所有Group和Shape的变换并且把所有可见的Shape保存到数组中, + * 最后根据绘制的优先级(zlevel > z > 插入顺序)排序得到绘制队列 + */ + Storage.prototype.updateShapeList = function () { this._shapeListOffset = 0; for (var i = 0, len = this._roots.length; i < len; i++) { var root = this._roots[i]; @@ -9400,7 +10669,7 @@ define( this._shapeList.sort(shapeCompareFunc); }; - Storage.prototype._updateAndAddShape = function(el) { + Storage.prototype._updateAndAddShape = function (el) { if (el.ignore) { return; @@ -9440,24 +10709,23 @@ define( // Mark group clean here el.__dirty = false; - } else { + } + else { this._shapeList[this._shapeListOffset++] = el; } }; /** - * 修改 + * 修改图形(Shape)或者组(Group) * - * @param {string} idx 唯一标识 + * @param {string} elId 唯一标识 * @param {Object} [params] 参数 */ Storage.prototype.mod = function (elId, params) { var el = this._elements[elId]; if (el) { - if (!(el instanceof Group)) { - el.style.__rect = null; - } - el.__dirty = true; + + el.modSelf(); if (params) { // 如果第二个参数直接使用 shape @@ -9478,7 +10746,8 @@ define( } } util.merge(el, target, true); - } else { + } + else { util.merge(el, params, true); } } @@ -9488,16 +10757,17 @@ define( }; /** - * 常规形状位置漂移,形状自身定义漂移函数 - * - * @param {string} idx 形状唯一标识 + * 移动指定的图形(Shape)或者组(Group)的位置 + * @param {string} shapeId 形状唯一标识 + * @param {number} dx + * @param {number} dy */ Storage.prototype.drift = function (shapeId, dx, dy) { var shape = this._elements[shapeId]; if (shape) { shape.needTransform = true; - if (!shape.ondrift //ondrift - //有onbrush并且调用执行返回false或undefined则继续 + if (!shape.ondrift // ondrift + // 有onbrush并且调用执行返回false或undefined则继续 || (shape.ondrift && !shape.ondrift(dx, dy)) ) { shape.drift(dx, dy); @@ -9510,7 +10780,7 @@ define( /** * 添加高亮层数据 * - * @param {Object} params 参数 + * @param {module:zrender/shape/Base} shape */ Storage.prototype.addHover = function (shape) { shape.updateNeedTransform(); @@ -9519,21 +10789,24 @@ define( }; /** - * 删除高亮层数据 + * 清空高亮层数据 */ Storage.prototype.delHover = function () { this._hoverElements = []; return this; }; + /** + * 是否有图形在高亮层里 + * @return {boolean} + */ Storage.prototype.hasHoverShape = function () { return this._hoverElements.length > 0; }; /** - * 添加到根节点 - * - * @param {Shape|Group} el 参数 + * 添加图形(Shape)或者组(Group)到根节点 + * @param {module:zrender/shape/Shape|module:zrender/Group} el */ Storage.prototype.addRoot = function (el) { if (el instanceof Group) { @@ -9544,6 +10817,10 @@ define( this._roots.push(el); }; + /** + * 删除指定的图形(Shape)或者组(Group) + * @param {string|Array.} [elId] 如果为空清空整个Storage + */ Storage.prototype.delRoot = function (elId) { if (typeof(elId) == 'undefined') { // 不指定elId清空 @@ -9571,7 +10848,8 @@ define( var el; if (typeof(elId) == 'string') { el = this._elements[elId]; - } else { + } + else { el = elId; } @@ -9585,37 +10863,21 @@ define( } }; - /** - * 添加 - * - * @param {Shape|Group} el 参数 - */ Storage.prototype.addToMap = function (el) { if (el instanceof Group) { el._storage = this; - } else { - el.style.__rect = null; } + el.modSelf(); this._elements[el.id] = el; return this; }; - /** - * 根据指定的elId获取相应的shape属性 - * - * @param {string=} idx 唯一标识 - */ Storage.prototype.get = function (elId) { return this._elements[elId]; }; - /** - * 删除,elId不指定则全清空 - * - * @param {string} idx 唯一标识 - */ Storage.prototype.delFromMap = function (elId) { var el = this._elements[elId]; if (el) { @@ -9631,7 +10893,7 @@ define( /** - * 释放 + * 清空并且释放Storage */ Storage.prototype.dispose = function () { this._elements = @@ -9644,40 +10906,69 @@ define( } ); -/** - * 缓动代码来自 https://github.com/sole/tween.js/blob/master/src/Tween.js - * author: lang(shenyi01@baidu.com) - */ define( 'zrender/animation/easing',[],function() { - var Easing = { + /** + * 缓动代码来自 https://github.com/sole/tween.js/blob/master/src/Tween.js + * @see http://sole.github.io/tween.js/examples/03_graphs.html + * @exports zrender/animation/easing + */ + var easing = { // 线性 - Linear: function(k) { + /** + * @param {number} k + * @return {number} + */ + Linear: function (k) { return k; }, // 二次方的缓动(t^2) - QuadraticIn: function(k) { + /** + * @param {number} k + * @return {number} + */ + QuadraticIn: function (k) { return k * k; }, - QuadraticOut: function(k) { + /** + * @param {number} k + * @return {number} + */ + QuadraticOut: function (k) { return k * (2 - k); }, - QuadraticInOut: function(k) { + /** + * @param {number} k + * @return {number} + */ + QuadraticInOut: function (k) { if ((k *= 2) < 1) { return 0.5 * k * k; } - return - 0.5 * (--k * (k - 2) - 1); + return -0.5 * (--k * (k - 2) - 1); }, // 三次方的缓动(t^3) - CubicIn: function(k) { + /** + * @param {number} k + * @return {number} + */ + CubicIn: function (k) { return k * k * k; }, - CubicOut: function(k) { + /** + * @param {number} k + * @return {number} + */ + CubicOut: function (k) { return --k * k * k + 1; }, - CubicInOut: function(k) { + /** + * @param {number} k + * @return {number} + */ + CubicInOut: function (k) { if ((k *= 2) < 1) { return 0.5 * k * k * k; } @@ -9685,28 +10976,51 @@ define( }, // 四次方的缓动(t^4) - QuarticIn: function(k) { + /** + * @param {number} k + * @return {number} + */ + QuarticIn: function (k) { return k * k * k * k; }, - QuarticOut: function(k) { + /** + * @param {number} k + * @return {number} + */ + QuarticOut: function (k) { return 1 - (--k * k * k * k); }, - QuarticInOut: function(k) { + /** + * @param {number} k + * @return {number} + */ + QuarticInOut: function (k) { if ((k *= 2) < 1) { return 0.5 * k * k * k * k; } - return - 0.5 * ((k -= 2) * k * k * k - 2); + return -0.5 * ((k -= 2) * k * k * k - 2); }, // 五次方的缓动(t^5) - QuinticIn: function(k) { + /** + * @param {number} k + * @return {number} + */ + QuinticIn: function (k) { return k * k * k * k * k; }, - - QuinticOut: function(k) { + /** + * @param {number} k + * @return {number} + */ + QuinticOut: function (k) { return --k * k * k * k * k + 1; }, - QuinticInOut: function(k) { + /** + * @param {number} k + * @return {number} + */ + QuinticInOut: function (k) { if ((k *= 2) < 1) { return 0.5 * k * k * k * k * k; } @@ -9714,24 +11028,48 @@ define( }, // 正弦曲线的缓动(sin(t)) - SinusoidalIn: function(k) { + /** + * @param {number} k + * @return {number} + */ + SinusoidalIn: function (k) { return 1 - Math.cos(k * Math.PI / 2); }, - SinusoidalOut: function(k) { + /** + * @param {number} k + * @return {number} + */ + SinusoidalOut: function (k) { return Math.sin(k * Math.PI / 2); }, - SinusoidalInOut: function(k) { + /** + * @param {number} k + * @return {number} + */ + SinusoidalInOut: function (k) { return 0.5 * (1 - Math.cos(Math.PI * k)); }, // 指数曲线的缓动(2^t) - ExponentialIn: function(k) { + /** + * @param {number} k + * @return {number} + */ + ExponentialIn: function (k) { return k === 0 ? 0 : Math.pow(1024, k - 1); }, - ExponentialOut: function(k) { - return k === 1 ? 1 : 1 - Math.pow(2, - 10 * k); + /** + * @param {number} k + * @return {number} + */ + ExponentialOut: function (k) { + return k === 1 ? 1 : 1 - Math.pow(2, -10 * k); }, - ExponentialInOut: function(k) { + /** + * @param {number} k + * @return {number} + */ + ExponentialInOut: function (k) { if (k === 0) { return 0; } @@ -9741,26 +11079,44 @@ define( if ((k *= 2) < 1) { return 0.5 * Math.pow(1024, k - 1); } - return 0.5 * (- Math.pow(2, - 10 * (k - 1)) + 2); + return 0.5 * (-Math.pow(2, -10 * (k - 1)) + 2); }, // 圆形曲线的缓动(sqrt(1-t^2)) - CircularIn: function(k) { + /** + * @param {number} k + * @return {number} + */ + CircularIn: function (k) { return 1 - Math.sqrt(1 - k * k); }, - CircularOut: function(k) { + /** + * @param {number} k + * @return {number} + */ + CircularOut: function (k) { return Math.sqrt(1 - (--k * k)); }, - CircularInOut: function(k) { + /** + * @param {number} k + * @return {number} + */ + CircularInOut: function (k) { if ((k *= 2) < 1) { - return - 0.5 * (Math.sqrt(1 - k * k) - 1); + return -0.5 * (Math.sqrt(1 - k * k) - 1); } return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1); }, // 创建类似于弹簧在停止前来回振荡的动画 - ElasticIn: function(k) { - var s, a = 0.1, p = 0.4; + /** + * @param {number} k + * @return {number} + */ + ElasticIn: function (k) { + var s; + var a = 0.1; + var p = 0.4; if (k === 0) { return 0; } @@ -9769,14 +11125,21 @@ define( } if (!a || a < 1) { a = 1; s = p / 4; - }else{ + } + else { s = p * Math.asin(1 / a) / (2 * Math.PI); } - return - (a * Math.pow(2, 10 * (k -= 1)) * + return -(a * Math.pow(2, 10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p)); }, - ElasticOut: function(k) { - var s, a = 0.1, p = 0.4; + /** + * @param {number} k + * @return {number} + */ + ElasticOut: function (k) { + var s; + var a = 0.1; + var p = 0.4; if (k === 0) { return 0; } @@ -9786,14 +11149,20 @@ define( if (!a || a < 1) { a = 1; s = p / 4; } - else{ + else { s = p * Math.asin(1 / a) / (2 * Math.PI); } - return (a * Math.pow(2, - 10 * k) * + return (a * Math.pow(2, -10 * k) * Math.sin((k - s) * (2 * Math.PI) / p) + 1); }, - ElasticInOut: function(k) { - var s, a = 0.1, p = 0.4; + /** + * @param {number} k + * @return {number} + */ + ElasticInOut: function (k) { + var s; + var a = 0.1; + var p = 0.4; if (k === 0) { return 0; } @@ -9803,11 +11172,11 @@ define( if (!a || a < 1) { a = 1; s = p / 4; } - else{ + else { s = p * Math.asin(1 / a) / (2 * Math.PI); } if ((k *= 2) < 1) { - return - 0.5 * (a * Math.pow(2, 10 * (k -= 1)) + return -0.5 * (a * Math.pow(2, 10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p)); } return a * Math.pow(2, -10 * (k -= 1)) @@ -9816,15 +11185,27 @@ define( }, // 在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动 - BackIn: function(k) { + /** + * @param {number} k + * @return {number} + */ + BackIn: function (k) { var s = 1.70158; return k * k * ((s + 1) * k - s); }, - BackOut: function(k) { + /** + * @param {number} k + * @return {number} + */ + BackOut: function (k) { var s = 1.70158; return --k * k * ((s + 1) * k + s) + 1; }, - BackInOut: function(k) { + /** + * @param {number} k + * @return {number} + */ + BackInOut: function (k) { var s = 1.70158 * 1.525; if ((k *= 2) < 1) { return 0.5 * (k * k * ((s + 1) * k - s)); @@ -9833,30 +11214,44 @@ define( }, // 创建弹跳效果 - BounceIn: function(k) { - return 1 - Easing.BounceOut(1 - k); + /** + * @param {number} k + * @return {number} + */ + BounceIn: function (k) { + return 1 - easing.BounceOut(1 - k); }, - BounceOut: function(k) { + /** + * @param {number} k + * @return {number} + */ + BounceOut: function (k) { if (k < (1 / 2.75)) { return 7.5625 * k * k; } else if (k < (2 / 2.75)) { return 7.5625 * (k -= (1.5 / 2.75)) * k + 0.75; - } else if (k < (2.5 / 2.75)) { + } + else if (k < (2.5 / 2.75)) { return 7.5625 * (k -= (2.25 / 2.75)) * k + 0.9375; - } else { + } + else { return 7.5625 * (k -= (2.625 / 2.75)) * k + 0.984375; } }, - BounceInOut: function(k) { + /** + * @param {number} k + * @return {number} + */ + BounceInOut: function (k) { if (k < 0.5) { - return Easing.BounceIn(k * 2) * 0.5; + return easing.BounceIn(k * 2) * 0.5; } - return Easing.BounceOut(k * 2 - 1) * 0.5 + 0.5; + return easing.BounceOut(k * 2 - 1) * 0.5 + 0.5; } }; - return Easing; + return easing; } ); @@ -9882,20 +11277,20 @@ define( this._targetPool = options.target || {}; if (!(this._targetPool instanceof Array)) { - this._targetPool = [this._targetPool]; + this._targetPool = [ this._targetPool ]; } - //生命周期 + // 生命周期 this._life = options.life || 1000; - //延时 + // 延时 this._delay = options.delay || 0; - //开始时间 - this._startTime = new Date().getTime() + this._delay;//单位毫秒 + // 开始时间 + this._startTime = new Date().getTime() + this._delay;// 单位毫秒 - //结束时间 + // 结束时间 this._endTime = this._startTime + this._life * 1000; - //是否循环 + // 是否循环 this.loop = typeof options.loop == 'undefined' ? false : options.loop; @@ -9912,7 +11307,7 @@ define( step : function (time) { var percent = (time - this._startTime) / this._life; - //还没开始 + // 还没开始 if (percent < 0) { return; } @@ -9967,17 +11362,9 @@ define( /** * 动画主类, 调度和管理所有动画控制器 - * + * + * @module zrender/animation/Animation * @author pissang(https://github.com/pissang) - * - * @class : Animation - * @config : stage(optional) 绘制类, 需要提供update接口 - * @config : onframe(optional) - * @method : add - * @method : remove - * @method : update - * @method : start - * @method : stop */ define( 'zrender/animation/Animation',['require','./Clip','../tool/color','../tool/util','../tool/event'],function(require) { @@ -9993,11 +11380,41 @@ define( || window.msRequestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame - || function(func){setTimeout(func, 16);}; + || function (func) { + setTimeout(func, 16); + }; var arraySlice = Array.prototype.slice; - function Animation(options) { + /** + * @typedef {Object} IZRenderStage + * @property {Function} update + */ + + /** + * @alias module:zrender/animation/Animation + * @constructor + * @param {Object} [options] + * @param {Function} [options.onframe] + * @param {IZRenderStage} [options.stage] + * @example + * var animation = new Animation(); + * var obj = { + * x: 100, + * y: 100 + * }; + * animation.animate(node.position) + * .when(1000, { + * x: 500, + * y: 500 + * }) + * .when(2000, { + * x: 100, + * y: 100 + * }) + * .start('spline'); + */ + var Animation = function (options) { options = options || {}; @@ -10013,19 +11430,27 @@ define( this._time = 0; Dispatcher.call(this); - } + }; Animation.prototype = { - add : function(clip) { + /** + * 添加动画片段 + * @param {module:zrender/animation/Clip} clip + */ + add: function(clip) { this._clips.push(clip); }, - remove : function(clip) { + /** + * 删除动画片段 + * @param {module:zrender/animation/Clip} clip + */ + remove: function(clip) { var idx = util.indexOf(this._clips, clip); if (idx >= 0) { this._clips.splice(idx, 1); } }, - update : function() { + _update: function() { var time = new Date().getTime(); var delta = time - this._time; @@ -10051,10 +11476,11 @@ define( // Remove the finished clip for (var i = 0; i < len;) { if (clips[i]._needsRemove) { - clips[i] = clips[len-1]; + clips[i] = clips[len - 1]; clips.pop(); len--; - } else { + } + else { i++; } } @@ -10070,14 +11496,17 @@ define( this.dispatch('frame', delta); }, - start : function() { + /** + * 开始运行动画 + */ + start: function () { var self = this; this._running = true; function step() { if (self._running) { - self.update(); + self._update(); requestAnimationFrame(step); } } @@ -10085,15 +11514,32 @@ define( this._time = new Date().getTime(); requestAnimationFrame(step); }, - stop : function() { + /** + * 停止运行动画 + */ + stop: function () { this._running = false; }, - clear : function() { + /** + * 清除所有动画片段 + */ + clear : function () { this._clips = []; }, - animate : function(target, options) { + /** + * 对一个目标创建一个animator对象,可以指定目标中的属性使用动画 + * @param {Object} target + * @param {Object} options + * @param {boolean} [options.loop=false] 是否循环播放动画 + * @param {Function} [options.getter=null] + * 如果指定getter函数,会通过getter函数取属性值 + * @param {Function} [options.setter=null] + * 如果指定setter函数,会通过setter函数设置属性值 + * @return {module:zrender/animation/Animation~Animator} + */ + animate : function (target, options) { options = options || {}; - var deferred = new Deferred( + var deferred = new Animator( target, options.loop, options.getter, @@ -10125,7 +11571,8 @@ define( for (var i = 0; i < len; i++) { out[i] = _interpolateNumber(p0[i], p1[i], percent); } - } else { + } + else { var len2 = p0[0].length; for (var i = 0; i < len; i++) { for (var j = 0; j < len2; j++) { @@ -10157,7 +11604,8 @@ define( p0[i], p1[i], p2[i], p3[i], t, t2, t3 ); } - } else { + } + else { var len2 = p0[0].length; for (var i = 0; i < len; i++) { for (var j = 0; j < len2; j++) { @@ -10174,7 +11622,7 @@ define( var v0 = (p2 - p0) * 0.5; var v1 = (p3 - p1) * 0.5; return (2 * (p1 - p2) + v0 + v1) * t3 - + (- 3 * (p1 - p2) - 2 * v0 - v1) * t2 + + (-3 * (p1 - p2) - 2 * v0 - v1) * t2 + v0 * t + p1; } @@ -10187,10 +11635,12 @@ define( ret.push(arraySlice.call(value[i])); } return ret; - } else { + } + else { return arraySlice.call(value); } - } else { + } + else { return value; } } @@ -10203,7 +11653,15 @@ define( return 'rgba(' + rgba.join(',') + ')'; } - function Deferred(target, loop, getter, setter) { + /** + * @alias module:zrender/animation/Animation~Animator + * @constructor + * @param {Object} target + * @param {boolean} loop + * @param {Function} getter + * @param {Function} setter + */ + var Animator = function(target, loop, getter, setter) { this._tracks = {}; this._target = target; @@ -10221,12 +11679,18 @@ define( this._onframeList = []; this._clipList = []; - } + }; - Deferred.prototype = { + Animator.prototype = { + /** + * 设置动画关键帧 + * @param {number} time 关键帧时间,单位是ms + * @param {Object} props 关键帧的属性值,key-value表示 + * @return {module:zrender/animation/Animation~Animator} + */ when : function(time /* ms */, props) { for (var propName in props) { - if (! this._tracks[propName]) { + if (!this._tracks[propName]) { this._tracks[propName] = []; // If time is 0 // Then props is given initialize value @@ -10248,11 +11712,22 @@ define( } return this; }, - during : function(callback) { + /** + * 添加动画每一帧的回调函数 + * @param {Function} callback + * @return {module:zrender/animation/Animation~Animator} + */ + during: function (callback) { this._onframeList.push(callback); return this; }, - start : function(easing) { + /** + * 开始执行动画 + * @param {string|Function} easing + * 动画缓动函数,详见{@link module:zrender/animation/easing} + * @return {module:zrender/animation/Animation~Animator} + */ + start: function (easing) { var self = this; var setter = this._setter; @@ -10273,7 +11748,7 @@ define( } }; - var createTrackClip = function(keyframes, propName) { + var createTrackClip = function (keyframes, propName) { var trackLen = keyframes.length; if (!trackLen) { return; @@ -10295,8 +11770,9 @@ define( }); var trackMaxTime; if (trackLen) { - trackMaxTime = keyframes[trackLen-1].time; - }else{ + trackMaxTime = keyframes[trackLen - 1].time; + } + else { return; } // Percents of each keyframe @@ -10323,15 +11799,19 @@ define( var cacheKey = 0; var cachePercent = 0; var start; - var i, w; - var p0, p1, p2, p3; + var i; + var w; + var p0; + var p1; + var p2; + var p3; if (isValueColor) { - var rgba = [0, 0, 0, 0]; + var rgba = [ 0, 0, 0, 0 ]; } - var onframe = function(target, percent) { + var onframe = function (target, percent) { // Find the range keyframes // kf1-----kf2---------current--------kf3 // find kf2 and kf3 and do interpolation @@ -10343,22 +11823,24 @@ define( break; } } - i = Math.min(i, trackLen-2); - } else { + i = Math.min(i, trackLen - 2); + } + else { for (i = cacheKey; i < trackLen; i++) { if (kfPercents[i] > percent) { break; } } - i = Math.min(i-1, trackLen-2); + i = Math.min(i - 1, trackLen - 2); } cacheKey = i; cachePercent = percent; - var range = (kfPercents[i+1] - kfPercents[i]); + var range = (kfPercents[i + 1] - kfPercents[i]); if (range === 0) { return; - } else { + } + else { w = (percent - kfPercents[i]) / range; } if (useSpline) { @@ -10368,21 +11850,23 @@ define( p3 = kfValues[i > trackLen - 3 ? trackLen - 1 : i + 2]; if (isValueArray) { _catmullRomInterpolateArray( - p0, p1, p2, p3, w, w*w, w*w*w, + p0, p1, p2, p3, w, w * w, w * w * w, getter(target, propName), arrDim ); - } else { + } + else { var value; if (isValueColor) { value = _catmullRomInterpolateArray( - p0, p1, p2, p3, w, w*w, w*w*w, + p0, p1, p2, p3, w, w * w, w * w * w, rgba, 1 ); value = rgba2String(rgba); - } else { + } + else { value = _catmullRomInterpolate( - p0, p1, p2, p3, w, w*w, w*w*w + p0, p1, p2, p3, w, w * w, w * w * w ); } setter( @@ -10391,23 +11875,26 @@ define( value ); } - } else { + } + else { if (isValueArray) { _interpolateArray( - kfValues[i], kfValues[i+1], w, + kfValues[i], kfValues[i + 1], w, getter(target, propName), arrDim ); - } else { + } + else { var value; if (isValueColor) { _interpolateArray( - kfValues[i], kfValues[i+1], w, + kfValues[i], kfValues[i + 1], w, rgba, 1 ); value = rgba2String(rgba); - } else { - value = _interpolateNumber(kfValues[i], kfValues[i+1], w); + } + else { + value = _interpolateNumber(kfValues[i], kfValues[i + 1], w); } setter( target, @@ -10444,6 +11931,9 @@ define( } return this; }, + /** + * 停止动画 + */ stop : function() { for (var i = 0; i < this._clipList.length; i++) { var clip = this._clipList[i]; @@ -10451,12 +11941,22 @@ define( } this._clipList = []; }, - delay : function(time){ + /** + * 设置动画延迟开始的时间 + * @param {number} time 单位ms + * @return {module:zrender/animation/Animation~Animator} + */ + delay : function (time) { this._delay = time; return this; }, - done : function(func) { - this._doneList.push(func); + /** + * 添加动画结束的回调 + * @param {Function} cb + * @return {module:zrender/animation/Animation~Animator} + */ + done : function(cb) { + this._doneList.push(cb); return this; } }; @@ -10466,8 +11966,7 @@ define( ); /*! - * ZRender, a lightweight canvas library with a MVC architecture, data-driven - * and provides an event model like DOM. + * ZRender, a high performance canvas library. * * Copyright (c) 2013, Baidu Inc. * All rights reserved. @@ -10475,16 +11974,8 @@ define( * LICENSE * https://github.com/ecomfe/zrender/blob/master/LICENSE.txt */ - -/** - * zrender: core核心类 - * - * @desc zrender是一个轻量级的Canvas类库,MVC封装,数据驱动,提供类Dom事件模型。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ define( - 'zrender/zrender',['require','./lib/excanvas','./tool/util','./tool/log','./tool/guid','./Handler','./Painter','./Storage','./animation/Animation','./tool/env'],function(require) { + 'zrender/zrender',['require','./dep/excanvas','./tool/util','./tool/log','./tool/guid','./Handler','./Painter','./Storage','./animation/Animation','./tool/env'],function(require) { /* * HTML5 Canvas for Internet Explorer! * Modern browsers like Firefox, Safari, Chrome and Opera support @@ -10497,7 +11988,7 @@ define( * http://explorercanvas.googlecode.com/svn/trunk/excanvas.js */ // 核心代码会生成一个全局变量 G_vmlCanvasManager,模块改造后借用于快速判断canvas支持 - require('./lib/excanvas'); + require('./dep/excanvas'); var util = require('./tool/util'); var log = require('./tool/log'); @@ -10508,37 +11999,43 @@ define( var Storage = require('./Storage'); var Animation = require('./animation/Animation'); - var _instances = {}; //ZRender实例map索引 + var _instances = {}; // ZRender实例map索引 + /** + * @exports zrender + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * pissang (https://www.github.com/pissang) + */ var zrender = {}; - zrender.version = '2.0.2'; + /** + * @type {string} + */ + zrender.version = '2.0.4'; /** - * zrender初始化 - * 不让外部直接new ZRender实例,为啥? - * 不为啥,提供全局可控同时减少全局污染和降低命名冲突的风险! + * 创建zrender实例 * - * @param {HTMLElement} dom dom对象,不帮你做document.getElementById了 - * @param {Object=} params 个性化参数,如自定义shape集合,带进来就好 - * - * @return {ZRender} ZRender实例 - */ - zrender.init = function(dom, params) { - var zi = new ZRender(guid(), dom, params || {}); - _instances[zi.id] = zi; - return zi; + * @param {HTMLElement} dom 绘图容器 + * @return {module:zrender~ZRender} ZRender实例 + */ + // 不让外部直接new ZRender实例,为啥? + // 不为啥,提供全局可控同时减少全局污染和降低命名冲突的风险! + zrender.init = function(dom) { + var zr = new ZRender(guid(), dom); + _instances[zr.id] = zr; + return zr; }; /** - * zrender实例销毁,记在_instances里的索引也会删除了 - * 管生就得管死,可以通过zrender.dispose(zi)销毁指定ZRender实例 - * 当然也可以直接zi.dispose()自己销毁 - * - * @param {ZRender=} zi ZRender对象,不传则销毁全部 + * zrender实例销毁 + * @param {module:zrender~ZRender} zr ZRender对象,不传则销毁全部 */ - zrender.dispose = function (zi) { - if (zi) { - zi.dispose(); + // 在_instances里的索引也会删除了 + // 管生就得管死,可以通过zrender.dispose(zr)销毁指定ZRender实例 + // 当然也可以直接zr.dispose()自己销毁 + zrender.dispose = function (zr) { + if (zr) { + zr.dispose(); } else { for (var key in _instances) { @@ -10552,8 +12049,8 @@ define( /** * 获取zrender实例 - * * @param {string} id ZRender对象索引 + * @return {module:zrender~ZRender} */ zrender.getInstance = function (id) { return _instances[id]; @@ -10574,29 +12071,33 @@ define( }; function getFrameCallback(zrInstance) { - return function(){ - var animatingShapes = zrInstance.animatingShapes; - for (var i = 0, l = animatingShapes.length; i < l; i++) { - zrInstance.storage.mod(animatingShapes[i].id); + return function () { + var animatingElements = zrInstance.animatingElements; + for (var i = 0, l = animatingElements.length; i < l; i++) { + zrInstance.storage.mod(animatingElements[i].id); } - if (animatingShapes.length || zrInstance._needsRefreshNextFrame) { + if (animatingElements.length || zrInstance._needsRefreshNextFrame) { zrInstance.refresh(); } }; } /** - * ZRender接口类,对外可用的所有接口都在这里!! - * storage(M)、painter(V)、handler(C)为内部私有类,外部接口不可见 - * 非get接口统一返回支持链式调用~ + * ZRender接口类,对外可用的所有接口都在这里 + * 非get接口统一返回支持链式调用 * + * @constructor + * @alias module:zrender~ZRender * @param {string} id 唯一标识 * @param {HTMLElement} dom dom对象,不帮你做document.getElementById - * * @return {ZRender} ZRender实例 */ - function ZRender(id, dom) { + var ZRender = function(id, dom) { + /** + * 实例 id + * @type {string} + */ this.id = id; this.env = require('./tool/env'); @@ -10605,19 +12106,23 @@ define( this.handler = new Handler(dom, this.storage, this.painter); // 动画控制 - this.animatingShapes = []; + this.animatingElements = []; + /** + * @type {module:zrender/animation/Animation} + */ this.animation = new Animation({ - stage : { - update : getFrameCallback(this) + stage: { + update: getFrameCallback(this) } }); this.animation.start(); this._needsRefreshNextFrame = false; - } + }; /** * 获取实例唯一标识 + * @return {string} */ ZRender.prototype.getId = function () { return this.id; @@ -10626,7 +12131,7 @@ define( /** * 添加图形形状到根节点 * - * @param {zrender.shape.Base} shape 形状对象,可用属性全集,详见各shape + * @param {module:zrender/shape/Base} shape 形状对象,可用属性全集,详见各shape */ ZRender.prototype.addShape = function (shape) { this.storage.addRoot(shape); @@ -10636,7 +12141,7 @@ define( /** * 添加组到根节点 * - * @param {zrender.shape.Group} group + * @param {module:zrender/Group} group */ ZRender.prototype.addGroup = function(group) { this.storage.addRoot(group); @@ -10677,7 +12182,7 @@ define( /** * 修改组 * - * @param {string} shapeId + * @param {string} groupId * @param {Object} group */ ZRender.prototype.modGroup = function (groupId, group) { @@ -10686,10 +12191,19 @@ define( }; /** - * 修改指定zlevel的绘制配置项,例如clearColor + * 修改指定zlevel的绘制配置项 * * @param {string} zLevel - * @param {Object} config 配置对象, 目前支持clearColor + * @param {Object} config 配置对象 + * @param {string} [config.clearColor=0] 每次清空画布的颜色 + * @param {string} [config.motionBlur=false] 是否开启动态模糊 + * @param {number} [config.lastFrameAlpha=0.7] + * 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显 + * @param {Array.} [config.position] 层的平移 + * @param {Array.} [config.rotation] 层的旋转 + * @param {Array.} [config.scale] 层的缩放 + * @param {boolean} [config.zoomable=false] 层是否支持鼠标缩放操作 + * @param {boolean} [config.panable=false] 层是否支持鼠标平移操作 */ ZRender.prototype.modLayer = function (zLevel, config) { this.painter.modLayer(zLevel, config); @@ -10710,7 +12224,6 @@ define( * 渲染 * * @param {Function} callback 渲染结束后回调函数 - * todo:增加缓动函数 */ ZRender.prototype.render = function (callback) { this.painter.render(callback); @@ -10729,16 +12242,16 @@ define( return this; }; - // TODO - // 好像会有奇怪的问题 + /** + * 标记视图在浏览器下一帧需要绘制 + */ ZRender.prototype.refreshNextFrame = function() { this._needsRefreshNextFrame = true; return this; }; /** - * 高亮层更新 - * + * 绘制高亮层 * @param {Function} callback 视图更新后回调函数 */ ZRender.prototype.refreshHover = function (callback) { @@ -10749,14 +12262,17 @@ define( /** * 视图更新 * - * @param {Array} shapeList 需要更新的图形元素列表 + * @param {Array.} shapeList 需要更新的图形列表 * @param {Function} callback 视图更新后回调函数 */ - ZRender.prototype.update = function (shapeList, callback) { - this.painter.update(shapeList, callback); + ZRender.prototype.refreshShapes = function (shapeList, callback) { + this.painter.refreshShapes(shapeList, callback); return this; }; + /** + * 调整视图大小 + */ ZRender.prototype.resize = function() { this.painter.resize(); return this; @@ -10765,23 +12281,25 @@ define( /** * 动画 * - * @param {string} shapeId 形状对象唯一标识 + * @param {string|module:zrender/Group|module:zrender/shape/Base} el 动画对象 * @param {string} path 需要添加动画的属性获取路径,可以通过a.b.c来获取深层的属性 - * @param {boolean} loop 动画是否循环 - * @return {Object} 动画的Deferred对象 - * Example: - * zr.animate(circleId, 'style', false) - * .when(1000, { x: 10} ) - * .done(function(){ console.log('Animation done')}) - * .start() - */ - ZRender.prototype.animate = function (shapeId, path, loop) { - var shape = this.storage.get(shapeId); - if (shape) { + * @param {boolean} [loop] 动画是否循环 + * @return {module:zrender/animation/Animation~Animator} + * @example: + * zr.animate(circle.id, 'style', false) + * .when(1000, {x: 10} ) + * .done(function(){ // Animation done }) + * .start() + */ + ZRender.prototype.animate = function (el, path, loop) { + if (typeof(el) === 'string') { + el = this.storage.get(el); + } + if (el) { var target; if (path) { var pathSplitted = path.split('.'); - var prop = shape; + var prop = el; for (var i = 0, l = pathSplitted.length; i < l; i++) { if (!prop) { continue; @@ -10793,41 +12311,41 @@ define( } } else { - target = shape; + target = el; } if (!target) { log( 'Property "' + path - + '" is not existed in shape ' - + shapeId + + '" is not existed in element ' + + el.id ); return; } - var animatingShapes = this.animatingShapes; - if (typeof shape.__aniCount === 'undefined') { + var animatingElements = this.animatingElements; + if (typeof el.__aniCount === 'undefined') { // 正在进行的动画记数 - shape.__aniCount = 0; + el.__aniCount = 0; } - if (shape.__aniCount === 0) { - animatingShapes.push(shape); + if (el.__aniCount === 0) { + animatingElements.push(el); } - shape.__aniCount++; + el.__aniCount++; - return this.animation.animate(target, {loop : loop}) - .done(function() { - shape.__aniCount --; - if (shape.__aniCount === 0) { - // 从animatingShapes里移除 - var idx = util.indexOf(animatingShapes, shape); - animatingShapes.splice(idx, 1); + return this.animation.animate(target, { loop: loop }) + .done(function () { + el.__aniCount--; + if (el.__aniCount === 0) { + // 从animatingElements里移除 + var idx = util.indexOf(animatingElements, el); + animatingElements.splice(idx, 1); } }); } else { - log('Shape "'+ shapeId + '" not existed'); + log('Element not existed'); } }; @@ -10871,7 +12389,10 @@ define( }; /** - * 图像导出 + * 图像导出 + * @param {string} type + * @param {string} [backgroundColor='#fff'] 背景色 + * @return {string} 图片的Base64 url */ ZRender.prototype.toDataURL = function(type, backgroundColor, args) { return this.painter.toDataURL(type, backgroundColor, args); @@ -10879,6 +12400,9 @@ define( /** * 将常规shape转成image shape + * @param {module:zrender/shape/Base} e + * @param {number} width + * @param {number} height */ ZRender.prototype.shapeToImage = function(e, width, height) { var id = guid(); @@ -10910,7 +12434,7 @@ define( /** * 事件触发 * - * @param {string} event 事件名称,resize,hover,drag,etc~ + * @param {string} eventName 事件名称,resize,hover,drag,etc * @param {event=} event event dom事件对象 */ ZRender.prototype.trigger = function (eventName, event) { @@ -10940,12 +12464,12 @@ define( this.handler.dispose(); this.animation = - this.animatingShapes = + this.animatingElements = this.storage = this.painter = this.handler = null; - //释放后告诉全局删除对自己的索引,没想到啥好方法 + // 释放后告诉全局删除对自己的索引,没想到啥好方法 zrender.delInstance(this.id); }; @@ -11164,12 +12688,12 @@ define('echarts/component/base',['require','../config','../util/ecQuery','../uti * 基类方法 */ Base.prototype = { - canvasSupported : require('zrender/tool/env').canvasSupported, + canvasSupported: require('zrender/tool/env').canvasSupported, /** * 获取zlevel基数配置 * @param {Object} contentType */ - getZlevelBase : function (contentType) { + getZlevelBase: function (contentType) { contentType = contentType || this.type + ''; switch (contentType) { @@ -11195,6 +12719,7 @@ define('echarts/component/base',['require','../config','../util/ecQuery','../uti case ecConfig.COMPONENT_TYPE_DATARANGE: case ecConfig.COMPONENT_TYPE_DATAZOOM : case ecConfig.COMPONENT_TYPE_TIMELINE : + case ecConfig.COMPONENT_TYPE_ROAMCONTROLLER : return 4; case ecConfig.CHART_TYPE_ISLAND : @@ -11220,7 +12745,7 @@ define('echarts/component/base',['require','../config','../util/ecQuery','../uti * * @return {Object} 修正后的参数 */ - reformOption : function (opt) { + reformOption: function (opt) { return zrUtil.merge( opt || {}, zrUtil.clone(this.ecTheme[this.type] || {}) @@ -11230,7 +12755,7 @@ define('echarts/component/base',['require','../config','../util/ecQuery','../uti /** * css类属性数组补全,如padding,margin等~ */ - reformCssArray : function (p) { + reformCssArray: function (p) { if (p instanceof Array) { switch (p.length + '') { case '4': @@ -11250,9 +12775,9 @@ define('echarts/component/base',['require','../config','../util/ecQuery','../uti } }, - getShapeById : function(id) { + getShapeById: function(id) { for (var i = 0, l = this.shapeList.length; i < l; i++) { - if (this.shapeList[i].id == id) { + if (this.shapeList[i].id === id) { return this.shapeList[i]; } } @@ -11262,7 +12787,7 @@ define('echarts/component/base',['require','../config','../util/ecQuery','../uti /** * 获取自定义和默认配置合并后的字体设置 */ - getFont : function (textStyle) { + getFont: function (textStyle) { var finalTextStyle = zrUtil.merge( zrUtil.clone(textStyle) || {}, this.ecTheme.textStyle @@ -11273,16 +12798,16 @@ define('echarts/component/base',['require','../config','../util/ecQuery','../uti + finalTextStyle.fontFamily; }, - getItemStyleColor : function (itemColor, seriesIndex, dataIndex, data) { - return typeof itemColor == 'function' + getItemStyleColor: function (itemColor, seriesIndex, dataIndex, data) { + return typeof itemColor === 'function' ? itemColor(seriesIndex, dataIndex, data) : itemColor; }, // 亚像素优化 - subPixelOptimize : function (position, lineWidth) { - if (lineWidth % 2 == 1) { - //position += position == Math.ceil(position) ? 0.5 : 0; + subPixelOptimize: function (position, lineWidth) { + if (lineWidth % 2 === 1) { + //position += position === Math.ceil(position) ? 0.5 : 0; position = Math.floor(position) + 0.5; } else { @@ -11292,7 +12817,7 @@ define('echarts/component/base',['require','../config','../util/ecQuery','../uti }, - resize : function () { + resize: function () { this.refresh && this.refresh(); this.clearEffectShape && this.clearEffectShape(true); var self = this; @@ -11313,20 +12838,20 @@ define('echarts/component/base',['require','../config','../util/ecQuery','../uti /** * 释放后实例不可用 */ - dispose : function () { + dispose: function () { this.clear(); this.shapeList = null; this.effectList = null; }, - query : ecQuery.query, - deepQuery : ecQuery.deepQuery, - deepMerge : ecQuery.deepMerge, + query: ecQuery.query, + deepQuery: ecQuery.deepQuery, + deepMerge: ecQuery.deepMerge, - parsePercent : number.parsePercent, - parseCenter : number.parseCenter, - parseRadius : number.parseRadius, - numAddCommas : number.addCommas + parsePercent: number.parsePercent, + parseCenter: number.parseCenter, + parseRadius: number.parseRadius, + numAddCommas: number.addCommas }; return Base; @@ -11337,48 +12862,30 @@ define('echarts/component/base',['require','../config','../util/ecQuery','../uti * * @author Kener (@Kener-林峰, linzhifeng@baidu.com) * - * sin:正弦函数,自动缓存 - * cos:余弦函数,自动缓存 + * sin:正弦函数 + * cos:余弦函数 * degreeToRadian:角度转弧度 * radianToDegree:弧度转角度 */ define( - 'zrender/tool/math',[],function() { - /* - var _cache = { - sin : {}, //sin缓存 - cos : {} //cos缓存 - }; - */ + 'zrender/tool/math',[],function () { + var _radians = Math.PI / 180; /** - * @param angle 弧度(角度)参数 - * @param isDegrees angle参数是否为角度计算,默认为false,angle为以弧度计量的角度 + * @param {number} angle 弧度(角度)参数 + * @param {boolean} isDegrees angle参数是否为角度计算,默认为false,angle为以弧度计量的角度 */ function sin(angle, isDegrees) { return Math.sin(isDegrees ? angle * _radians : angle); - /* - angle = (isDegrees ? angle * _radians : angle).toFixed(4); - if(typeof _cache.sin[angle] == 'undefined') { - _cache.sin[angle] = Math.sin(angle); - } - return _cache.sin[angle]; - */ } /** - * @param radians 弧度参数 + * @param {number} angle 弧度(角度)参数 + * @param {boolean} isDegrees angle参数是否为角度计算,默认为false,angle为以弧度计量的角度 */ function cos(angle, isDegrees) { return Math.cos(isDegrees ? angle * _radians : angle); - /* - angle = (isDegrees ? angle * _radians : angle).toFixed(4); - if(typeof _cache.cos[angle] == 'undefined') { - _cache.cos[angle] = Math.cos(angle); - } - return _cache.cos[angle]; - */ } /** @@ -11405,82 +12912,53 @@ define( }; } ); + /** - * zrender - * + * n角星(n>3) + * @module zrender/shape/Star * @author sushuang (宿爽, sushuang@baidu.com) - * - * shape类:n角星(n>3) - * 可配图形属性: - { - // 基础属性 - shape : 'star', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,n角星外接圆心横坐标 - y : {number}, // 必须,n角星外接圆心纵坐标 - r : {number}, // 必须,n角星外接圆半径 - r0 : {number}, // n角星内部顶点(凹点)的外接圆半径, - // 如果不指定此参数,则自动计算:取相隔外部顶点连线的交点作内部顶点 - n : {number}, // 必须,指明几角星 - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - lineJoin : {string}, // 默认为miter,线段连接样式。miter | round | bevel - - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为outside,附加文本位置。 - // outside | inside - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'star', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - r : 150, - n : 5, - color : '#eee' - }, - myName : 'kener', // 可自带任何有效自定义属性 + * @example + * var Star = require('zrender/shape/Star'); + * var shape = new Star({ + * style: { + * x: 200, + * y: 100, + * r: 150, + * n: 5, + * text: '五角星' + * } + * }); + * zr.addShape(shape); + */ - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } +/** + * @typedef {Object} IStarStyle + * @property {number} x n角星外接圆心x坐标 + * @property {number} y n角星外接圆心y坐标 + * @property {number} r n角星外接圆半径 + * @property {number} [r0] n角星内部顶点(凹点)的外接圆半径。 + * 如果不指定此参数,则自动计算:取相隔外部顶点连线的交点作内部顶点。 + * @property {number} n 指明几角星 + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic */ + define( 'zrender/shape/Star',['require','../tool/math','./Base','../tool/util'],function (require) { @@ -11491,21 +12969,39 @@ define( var Base = require('./Base'); - function Star(options) { + /** + * @alias module:zrender/shape/Star + * @param {Object} options + * @constructor + * @extends module:zrender/shape/Base + */ + var Star = function(options) { Base.call(this, options); - } + /** + * n角星绘制样式 + * @name module:zrender/shape/Star#style + * @type {module:zrender/shape/Star~IStarStyle} + */ + /** + * n角星高亮绘制样式 + * @name module:zrender/shape/Star#highlightStyle + * @type {module:zrender/shape/Star~IStarStyle} + */ + }; Star.prototype = { type: 'star', /** * 创建n角星(n>3)路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Star~IStarStyle} style */ buildPath : function(ctx, style) { var n = style.n; - if (!n || n < 2) { return; } + if (!n || n < 2) { + return; + } var x = style.x; var y = style.y; @@ -11530,26 +13026,29 @@ define( // 记录边界点,用于判断inside var pointList = style.pointList = []; - pointList.push([xStart, yStart]); - for (var i = 0, end = n * 2 - 1, ri; i < end; i ++) { + pointList.push([ xStart, yStart ]); + for (var i = 0, end = n * 2 - 1, ri; i < end; i++) { ri = i % 2 === 0 ? r0 : r; - pointList.push([x + ri * cos(deg), y + ri * sin(deg)]); + pointList.push([ x + ri * cos(deg), y + ri * sin(deg) ]); deg += dStep; } - pointList.push([xStart, yStart]); + pointList.push([ xStart, yStart ]); // 绘制 ctx.moveTo(pointList[0][0], pointList[0][1]); - for (var i = 0; i < pointList.length; i ++) { + for (var i = 0; i < pointList.length; i++) { ctx.lineTo(pointList[i][0], pointList[i][1]); } + + ctx.closePath(); return; }, /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style + * 返回n角星包围盒矩形 + * @param {module:zrender/shape/Star~IStarStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} */ getRect : function(style) { if (style.__rect) { @@ -11578,97 +13077,88 @@ define( return Star; } ); + /** - * zrender - * + * @module zrender/shape/Heart * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:心形 - * 可配图形属性: - { - // 基础属性 - shape : 'heart', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,心形内部尖端横坐标 - y : {number}, // 必须,心形内部尖端纵坐标 - a : {number}, // 必须,心形横宽(中轴线到水平边缘最宽处距离) - b : {number}, // 必须,心形纵高(内尖到外尖距离) - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为outside,附加文本位置。 - // outside | inside - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'heart', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - a : 50, - b : 80, - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 + * @example + * var Heart = require('zrender/shape/Heart'); + * var shape = new Heart({ + * style: { + * x: 100, + * y: 100, + * a: 40, + * b: 40, + * brushType: 'both', + * color: 'blue', + * strokeColor: 'red', + * lineWidth: 3, + * text: 'Heart' + * } + * }); + * zr.addShape(shape); + */ - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } +/** + * @typedef {Object} IHeartStyle + * @property {number} x 心形内部尖端横坐标 + * @property {number} y 心形内部尖端纵坐标 + * @property {number} a 心形横宽(中轴线到水平边缘最宽处距离) + * @property {number} b 心形纵高(内尖到外尖距离) + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic */ define( 'zrender/shape/Heart',['require','./Base','../tool/util'],function (require) { + + var Base = require('./Base'); - function Heart(options) { + /** + * @alias module:zrender/shape/Heart + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var Heart = function (options) { Base.call(this, options); - } + /** + * 心形绘制样式 + * @name module:zrender/shape/Heart#style + * @type {module:zrender/shape/Heart~IHeartStyle} + */ + /** + * 心形高亮绘制样式 + * @name module:zrender/shape/Heart#highlightStyle + * @type {module:zrender/shape/Heart~IHeartStyle} + */ + }; Heart.prototype = { type: 'heart', /** * 创建扇形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Heart~IHeartStyle} style */ - buildPath : function(ctx, style) { + buildPath : function (ctx, style) { ctx.moveTo(style.x, style.y); ctx.bezierCurveTo( style.x + style.a / 2, @@ -11686,14 +13176,16 @@ define( style.x, style.y ); + ctx.closePath(); return; }, /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style + * 计算返回心形的包围盒矩形 + * @param {module:zrender/shape/Heart~IHeartStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} */ - getRect : function(style) { + getRect : function (style) { if (style.__rect) { return style.__rect; } @@ -11720,95 +13212,87 @@ define( return Heart; } ); + /** - * zrender - * + * 水滴形状 + * @module zrender/shape/Droplet * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:水滴 - * 可配图形属性: - { - // 基础属性 - shape : 'heart', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,水滴中心横坐标 - y : {number}, // 必须,水滴中心纵坐标 - a : {number}, // 必须,水滴横宽(中心到水平边缘最宽处距离) - b : {number}, // 必须,水滴纵高(中心到尖端距离) - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为outside,附加文本位置。 - // outside | inside - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'droplet', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - a : 50, - b : 80, - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 + * @example + * var Droplet = require('zrender/shape/Droplet'); + * var shape = new Droplet({ + * style: { + * x: 100, + * y: 100, + * a: 40, + * b: 40, + * brushType: 'both', + * color: 'blue', + * strokeColor: 'red', + * lineWidth: 3, + * text: 'Droplet' + * } + * }); + * zr.addShape(shape); + */ - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } +/** + * @typedef {Object} IDropletStyle + * @property {number} x 水滴中心x坐标 + * @property {number} y 水滴中心y坐标 + * @property {number} a 水滴横宽(中心到水平边缘最宽处距离) + * @property {number} b 水滴纵高(中心到尖端距离) + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic */ define( 'zrender/shape/Droplet',['require','./Base','../tool/util'],function (require) { + + var Base = require('./Base'); - function Droplet(options) { + /** + * @alias module:zrender/shape/Droplet + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var Droplet = function(options) { Base.call(this, options); - } + /** + * 水滴绘制样式 + * @name module:zrender/shape/Droplet#style + * @type {module:zrender/shape/Droplet~IDropletStyle} + */ + /** + * 水滴高亮绘制样式 + * @name module:zrender/shape/Droplet#highlightStyle + * @type {module:zrender/shape/Droplet~IDropletStyle} + */ + }; Droplet.prototype = { type: 'droplet', /** - * 创建扇形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 + * 创建水滴路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Droplet~IDropletStyle} style */ buildPath : function(ctx, style) { ctx.moveTo(style.x, style.y + style.a); @@ -11828,11 +13312,13 @@ define( style.x, style.y + style.a ); + ctx.closePath(); }, /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style + * 计算返回水滴的包围盒矩形 + * @param {module:zrender/shape/Droplet~IDropletStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} */ getRect : function(style) { if (style.__rect) { @@ -11861,6 +13347,7 @@ define( return Droplet; } ); + /** * echarts扩展zrender shape * @@ -11915,9 +13402,6 @@ define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/S ctx.moveTo(style.x + 13 * dx, style.y + 10 * dy); ctx.lineTo(style.x + 13 * dx, style.y + style.height); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); } function _iconMarkUndo(ctx, style) { @@ -11935,9 +13419,6 @@ define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/S ctx.moveTo(style.x + 10 * dx, style.y + 13 * dy); ctx.lineTo(style.x + style.width, style.y + 13 * dy); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); } function _iconMarkClear(ctx, style) { @@ -11962,9 +13443,6 @@ define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/S ctx.lineTo(style.x + 3 * dx, style.y + style.height); ctx.lineTo(style.x + 13 * dx, style.y + style.height); ctx.lineTo(style.x + style.width, style.y + 5 * dy); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); } function _iconDataZoom(ctx, style) { @@ -11982,9 +13460,6 @@ define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/S ctx.lineTo(style.x + style.width, style.y + style.height); ctx.lineTo(style.x + style.width, style.y + 3 * dy); ctx.lineTo(style.x + 8 * dx, style.y + 3 * dy); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); } function _iconDataZoomReset(ctx, style) { @@ -12006,9 +13481,6 @@ define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/S ctx.moveTo(style.x + 10 * dx, style.y + 10 * dy); ctx.lineTo(style.x + 14 * dx, style.y + 13 * dy); ctx.lineTo(style.x + 10 * dx, style.y + style.height); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); } function _iconRestore(ctx, style) { @@ -12028,9 +13500,6 @@ define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/S ctx.moveTo(style.x + 13 * dx, style.y); ctx.lineTo(style.x + style.width, style.y + 4 * dy); ctx.lineTo(style.x + 11 * dx, style.y + 5 * dy); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); } function _iconLineChart(ctx, style) { @@ -12045,9 +13514,6 @@ define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/S ctx.lineTo(style.x + 7 * dx, style.y + 6 * dy); ctx.lineTo(style.x + 11 * dx, style.y + 11 * dy); ctx.lineTo(style.x + 15 * dx, style.y + 2 * dy); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); } function _iconBarChart(ctx, style) { @@ -12070,9 +13536,6 @@ define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/S ctx.lineTo(style.x + 11 * dx, style.y + 9 * dy); ctx.lineTo(style.x + 12 * dx, style.y + 9 * dy); ctx.lineTo(style.x + 12 * dx, style.y + 14 * dy); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); } function _iconStackChart(ctx, style) { @@ -12085,9 +13548,6 @@ define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/S while (len--) { ctx.rect(x, y + dy * len + 2, width, 2); } - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); } function _iconTiledChart(ctx, style) { @@ -12100,9 +13560,6 @@ define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/S while (len--) { ctx.rect(x + dx * len, y, 2, height); } - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); } function _iconDataView(ctx, style) { @@ -12125,9 +13582,6 @@ define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/S ctx.moveTo(style.x + 3 * dx, style.y + 12 * dx); ctx.lineTo(style.x + 9 * dx, style.y + 12 * dx); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); } function _iconSave(ctx, style) { @@ -12150,9 +13604,6 @@ define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/S ctx.lineTo(style.x + 10 * dx, style.y + 13 * dy); ctx.lineTo(style.x + 10 * dx, style.y + 11 * dy); ctx.lineTo(style.x + 6 * dx, style.y + 11 * dy); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); } function _iconCross(ctx, style) { @@ -12182,10 +13633,12 @@ define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/S 0, Math.PI * 2 ); + ctx.closePath(); } function _iconRectangle(ctx, style) { ctx.rect(style.x, style.y, style.width, style.height); + ctx.closePath(); } function _iconTriangle(ctx, style) { @@ -12198,6 +13651,7 @@ define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/S ctx.lineTo(x + symbolSize, y + symbolSize); ctx.lineTo(x - symbolSize, y + symbolSize); ctx.lineTo(x, y - symbolSize); + ctx.closePath(); } function _iconDiamond(ctx, style) { @@ -12211,6 +13665,7 @@ define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/S ctx.lineTo(x, y + symbolSize); ctx.lineTo(x - symbolSize, y); ctx.lineTo(x, y - symbolSize); + ctx.closePath(); } function _iconArrow(ctx, style) { @@ -12222,6 +13677,7 @@ define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/S ctx.lineTo(x + 8 * dx, y + style.height / 4 * 3); ctx.lineTo(x + 15 * dx, y + style.height); ctx.lineTo(x + 8 * dx, y); + ctx.closePath(); } function _iconStar(ctx, style) { @@ -12270,6 +13726,7 @@ define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/S Math.PI / 5 ); ctx.lineTo(x + width, y + height + r * 1.5); + ctx.closePath(); } function _iconImage(ctx, style) { @@ -12331,6 +13788,7 @@ define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/S ctx.lineTo(style.x + style.width, style.y + style.height); ctx.lineTo(style.x, style.y + style.height); ctx.lineTo(style.x, style.y); + ctx.closePath(); } return; @@ -12394,11 +13852,10 @@ define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/S * author: Kener (@Kener-林峰, linzhifeng@baidu.com) * errorrik (errorrik@gmail.com) */ - define( 'zrender/shape/util/dashedLineTo',[],function (/* require */) { - var dashPattern = [5, 5]; + var dashPattern = [ 5, 5 ]; /** * 虚线lineTo */ @@ -12427,7 +13884,8 @@ define( for (var i = 0; i < numDashes; ++i) { if (flag) { ctx.moveTo(x1, y1); - } else { + } + else { ctx.lineTo(x1, y1); } flag = !flag; @@ -12440,102 +13898,85 @@ define( ); /** - * zrender - * + * 直线 + * @module zrender/shape/Line * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:直线 - * 可配图形属性: - { - // 基础属性 - shape : 'line', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - xStart : {number}, // 必须,起点横坐标 - yStart : {number}, // 必须,起点纵坐标 - xEnd : {number}, // 必须,终点横坐标 - yEnd : {number}, // 必须,终点纵坐标 - strokeColor : {color}, // 默认为'#000',线条颜色(轮廓),支持rgba - lineType : {string}, // 默认为solid,线条类型,solid | dashed | dotted - lineWidth : {number}, // 默认为1,线条宽度 - lineCap : {string}, // 默认为butt,线帽样式。butt | round | square - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为end,附加文本位置。 - // inside | start | end - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#000' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'line', - id : '123456', - zlevel : 1, - style : { - xStart : 100, - yStart : 100, - xEnd : 200, - yEnd : 200, - strokeColor : '#eee', - lineWidth : 20, - text : 'Baidu' - }, - myName : 'kener', //可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } + * @example + * var Line = require('zrender/shape/Line'); + * var shape = new Line({ + * style: { + * xStart: 0, + * yStart: 0, + * xEnd: 100, + * yEnd: 100, + * strokeColor: '#000', + * lineWidth: 10 + * } + * }); + * zr.addShape(line); + */ +/** + * @typedef {Object} ILineStyle + * @property {number} xStart 起点x坐标 + * @property {number} yStart 起点y坐标 + * @property {number} xEnd 终止点x坐标 + * @property {number} yEnd 终止点y坐标 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic */ define( 'zrender/shape/Line',['require','./Base','./util/dashedLineTo','../tool/util'],function (require) { var Base = require('./Base'); var dashedLineTo = require('./util/dashedLineTo'); - function Line(options) { - this.brushTypeOnly = 'stroke'; //线条只能描边,填充后果自负 + /** + * @alias module:zrender/shape/Line + * @param {Object} options + * @constructor + * @extends module:zrender/shape/Base + */ + var Line = function (options) { + this.brushTypeOnly = 'stroke'; // 线条只能描边,填充后果自负 this.textPosition = 'end'; Base.call(this, options); - } + + /** + * 直线绘制样式 + * @name module:zrender/shape/Line#style + * @type {module:zrender/shape/Line~ILineStyle} + */ + /** + * 直线高亮绘制样式 + * @name module:zrender/shape/Line#highlightStyle + * @type {module:zrender/shape/Line~ILineStyle} + */ + }; Line.prototype = { type: 'line', /** * 创建线条路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Line~ILineStyle} style */ - buildPath : function(ctx, style) { + buildPath : function (ctx, style) { if (!style.lineType || style.lineType == 'solid') { - //默认为实线 + // 默认为实线 ctx.moveTo(style.xStart, style.yStart); ctx.lineTo(style.xEnd, style.yEnd); } @@ -12554,10 +13995,11 @@ define( }, /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style + * 计算返回线条的包围盒矩形 + * @param {module:zrender/shape/Line~ILineStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} */ - getRect : function(style) { + getRect : function (style) { if (style.__rect) { return style.__rect; } @@ -12580,117 +14022,16 @@ define( return Line; } ); -/** - * zrender: 向量操作类 - * - * author : https://github.com/pissang - */ -define( - 'zrender/tool/vector',[],function() { - var ArrayCtor = typeof Float32Array === 'undefined' - ? Array - : Float32Array; - - var vector = { - create : function(x, y) { - var out = new ArrayCtor(2); - out[0] = x || 0; - out[1] = y || 0; - return out; - }, - copy : function(out, v) { - out[0] = v[0]; - out[1] = v[1]; - }, - set : function(out, a, b) { - out[0] = a; - out[1] = b; - }, - add : function(out, v1, v2) { - out[0] = v1[0] + v2[0]; - out[1] = v1[1] + v2[1]; - return out; - }, - scaleAndAdd : function(out, v1, v2, a) { - out[0] = v1[0] + v2[0] * a; - out[1] = v1[1] + v2[1] * a; - return out; - }, - sub : function(out, v1, v2) { - out[0] = v1[0] - v2[0]; - out[1] = v1[1] - v2[1]; - return out; - }, - length : function(v) { - return Math.sqrt(this.lengthSquare(v)); - }, - lengthSquare : function(v) { - return v[0] * v[0] + v[1] * v[1]; - }, - mul : function(out, v1, v2) { - out[0] = v1[0] * v2[0]; - out[1] = v1[1] * v2[1]; - return out; - }, - dot : function(v1, v2) { - return v1[0] * v2[0] + v1[1] * v2[1]; - }, - scale : function(out, v, s) { - out[0] = v[0] * s; - out[1] = v[1] * s; - return out; - }, - normalize : function(out, v) { - var d = vector.length(v); - if(d === 0){ - out[0] = 0; - out[1] = 0; - }else{ - out[0] = v[0]/d; - out[1] = v[1]/d; - } - return out; - }, - distance : function(v1, v2) { - return Math.sqrt( - (v1[0] - v2[0]) * (v1[0] - v2[0]) + - (v1[1] - v2[1]) * (v1[1] - v2[1]) - ); - }, - negate : function(out, v) { - out[0] = -v[0]; - out[1] = -v[1]; - }, - middle : function(out, v1, v2) { - out[0] = (v1[0] + v2[0])/2; - out[1] = (v1[1] + v2[1])/2; - return out; - }, - applyTransform: function(out, v, m) { - var x = v[0]; - var y = v[1]; - out[0] = m[0] * x + m[2] * y + m[4]; - out[1] = m[1] * x + m[3] * y + m[5]; - return out; - } - }; - - vector.len = vector.length; - vector.dist = vector.distance; - return vector; - } -); /** - * 多线段平滑曲线 Catmull-Rom spline - * - * author: Kener (@Kener-林峰, linzhifeng@baidu.com) - * errorrik (errorrik@gmail.com) + * Catmull-Rom spline 插值折线 + * @module zrender/shape/util/smoothSpline + * @author pissang (https://www.github.com/pissang) + * Kener (@Kener-林峰, linzhifeng@baidu.com) + * errorrik (errorrik@gmail.com) */ - - define( - 'zrender/shape/util/smoothSpline',['require','../../tool/vector'],function ( require ) { + 'zrender/shape/util/smoothSpline',['require','../../tool/vector'],function (require) { var vector = require('../../tool/vector'); /** @@ -12700,26 +14041,30 @@ define( var v0 = (p2 - p0) * 0.5; var v1 = (p3 - p1) * 0.5; return (2 * (p1 - p2) + v0 + v1) * t3 - + (- 3 * (p1 - p2) - 2 * v0 - v1) * t2 + + (-3 * (p1 - p2) - 2 * v0 - v1) * t2 + v0 * t + p1; } /** - * 多线段平滑曲线 Catmull-Rom spline + * @alias module:zrender/shape/util/smoothSpline + * @param {Array} points 线段顶点数组 + * @param {boolean} isLoop + * @param {Array} constraint + * @return {Array} */ - return function (points, isLoop) { + return function (points, isLoop, constraint) { var len = points.length; var ret = []; var distance = 0; for (var i = 1; i < len; i++) { - distance += vector.distance(points[i-1], points[i]); + distance += vector.distance(points[i - 1], points[i]); } var segs = distance / 5; segs = segs < len ? len : segs; for (var i = 0; i < segs; i++) { - var pos = i / (segs-1) * (isLoop ? len : len - 1); + var pos = i / (segs - 1) * (isLoop ? len : len - 1); var idx = Math.floor(pos); var w = pos - idx; @@ -12732,8 +14077,9 @@ define( p0 = points[idx === 0 ? idx : idx - 1]; p2 = points[idx > len - 2 ? len - 1 : idx + 1]; p3 = points[idx > len - 3 ? len - 1 : idx + 2]; - } else { - p0 = points[(idx -1 + len) % len]; + } + else { + p0 = points[(idx - 1 + len) % len]; p2 = points[(idx + 1) % len]; p3 = points[(idx + 2) % len]; } @@ -12753,19 +14099,27 @@ define( /** * 贝塞尔平滑曲线 - * - * author: Kener (@Kener-林峰, linzhifeng@baidu.com) - * errorrik (errorrik@gmail.com) + * @module zrender/shape/util/smoothBezier + * @author pissang (https://www.github.com/pissang) + * Kener (@Kener-林峰, linzhifeng@baidu.com) + * errorrik (errorrik@gmail.com) */ - define( - 'zrender/shape/util/smoothBezier',['require','../../tool/vector'],function ( require ) { + 'zrender/shape/util/smoothBezier',['require','../../tool/vector'],function (require) { var vector = require('../../tool/vector'); /** - * 贝塞尔平滑曲线 + * 贝塞尔平滑曲线 + * @alias module:zrender/shape/util/smoothBezier + * @param {Array} points 线段顶点数组 + * @param {number} smooth 平滑等级, 0-1 + * @param {boolean} isLoop + * @param {Array} constraint 将计算出来的控制点约束在一个包围盒内 + * 比如 [[0, 0], [100, 100]], 这个包围盒会与 + * 整个折线的包围盒做一个并集用来约束控制点。 + * @param {Array} 计算出来的控制点数组 */ - return function (points, smooth, isLoop) { + return function (points, smooth, isLoop, constraint) { var cps = []; var v = []; @@ -12774,6 +14128,20 @@ define( var prevPoint; var nextPoint; + var hasConstraint = !!constraint; + var min, max; + if (hasConstraint) { + min = [Infinity, Infinity]; + max = [-Infinity, -Infinity]; + for (var i = 0, len = points.length; i < len; i++) { + vector.min(min, min, points[i]); + vector.max(max, max, points[i]); + } + // 与指定的包围盒做并集 + vector.min(min, min, constraint[0]); + vector.max(max, max, constraint[1]); + } + for (var i = 0, len = points.length; i < len; i++) { var point = points[i]; var prevPoint; @@ -12796,20 +14164,29 @@ define( vector.sub(v, nextPoint, prevPoint); - //use degree to scale the handle length + // use degree to scale the handle length vector.scale(v, v, smooth); var d0 = vector.distance(point, prevPoint); var d1 = vector.distance(point, nextPoint); var sum = d0 + d1; - d0 /= sum; - d1 /= sum; + if (sum !== 0) { + d0 /= sum; + d1 /= sum; + } vector.scale(v1, v, -d0); vector.scale(v2, v, d1); - - cps.push(vector.add([], point, v1)); - cps.push(vector.add([], point, v2)); + var cp0 = vector.add([], point, v1); + var cp1 = vector.add([], point, v2); + if (hasConstraint) { + vector.max(cp0, cp0, min); + vector.min(cp0, cp0, max); + vector.max(cp1, cp1, min); + vector.min(cp1, cp1, max); + } + cps.push(cp0); + cps.push(cp1); } if (isLoop) { @@ -12822,73 +14199,44 @@ define( ); /** - * zrender - * + * 多边形 + * @module zrender/shape/Polygon * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:多边形 - * 可配图形属性: - { - // 基础属性 - shape : 'polygon', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - pointList : {Array}, // 必须,多边形各个顶角坐标 - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为top,附加文本位置。 - // inside | left | right | top | bottom - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'polygon', - id : '123456', - zlevel : 1, - style : { - pointList : [[10, 10], [300, 20], [298, 400], [50, 450]] - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 + * @example + * var Polygon = require('zrender/shape/Polygon'); + * var shape = new Polygon({ + * style: { + * // 100x100的正方形 + * pointList: [[0, 0], [100, 0], [100, 100], [0, 100]], + * color: 'blue' + * } + * }); + * zr.addShape(shape); + */ - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } +/** + * @typedef {Object} IPolygonStyle + * @property {string} pointList 多边形顶点数组 + * @property {string} [smooth=''] 是否做平滑插值, 平滑算法可以选择 bezier, spline + * @property {number} [smoothConstraint] 平滑约束 + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic */ define( 'zrender/shape/Polygon',['require','./Base','./util/smoothSpline','./util/smoothBezier','./util/dashedLineTo','../tool/util'],function (require) { @@ -12897,21 +14245,29 @@ define( var smoothBezier = require('./util/smoothBezier'); var dashedLineTo = require('./util/dashedLineTo'); - - function Polygon(options) { + /** + * @alias module:zrender/shape/Polygon + * @param {Object} options + * @constructor + * @extends module:zrender/shape/Base + */ + var Polygon = function (options) { Base.call(this, options); - } + /** + * 多边形绘制样式 + * @name module:zrender/shape/Polygon#style + * @type {module:zrender/shape/Polygon~IPolygonStyle} + */ + /** + * 多边形高亮绘制样式 + * @name module:zrender/shape/Polygon#highlightStyle + * @type {module:zrender/shape/Polygon~IPolygonStyle} + */ + }; Polygon.prototype = { type: 'polygon', - /** - * 画刷 - * @param ctx 画布句柄 - * @param isHighlight 是否为高亮状态 - * @param updateCallback 需要异步加载资源的shape可以通过这个callback(e) - * 让painter更新视图,base.brush没用,需要的话重载brush - */ brush : function (ctx, isHighlight) { var style = this.style; if (isHighlight) { @@ -12963,7 +14319,6 @@ define( if (!hasPath) { ctx.beginPath(); this.buildPath(ctx, style); - ctx.closePath(); } ctx.stroke(); } @@ -12977,10 +14332,10 @@ define( /** * 创建多边形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Polygon~IPolygonStyle} style */ - buildPath : function(ctx, style) { + buildPath : function (ctx, style) { // 虽然能重用brokenLine,但底层图形基于性能考虑,重复代码减少调用吧 var pointList = style.pointList; // 开始点和结束点重复 @@ -13004,7 +14359,7 @@ define( if (style.smooth && style.smooth !== 'spline') { var controlPoints = smoothBezier( - pointList, style.smooth, true + pointList, style.smooth, true, style.smoothConstraint ); ctx.moveTo(pointList[0][0], pointList[0][1]); @@ -13027,10 +14382,10 @@ define( } if (!style.lineType || style.lineType == 'solid') { - //默认为实线 - ctx.moveTo(pointList[0][0],pointList[0][1]); + // 默认为实线 + ctx.moveTo(pointList[0][0], pointList[0][1]); for (var i = 1, l = pointList.length; i < l; i++) { - ctx.lineTo(pointList[i][0],pointList[i][1]); + ctx.lineTo(pointList[i][0], pointList[i][1]); } ctx.lineTo(pointList[0][0], pointList[0][1]); } @@ -13042,7 +14397,7 @@ define( || (style.lineWidth || 1) * (style.lineType == 'dashed' ? 5 : 1); style._dashLength = dashLength; - ctx.moveTo(pointList[0][0],pointList[0][1]); + ctx.moveTo(pointList[0][0], pointList[0][1]); for (var i = 1, l = pointList.length; i < l; i++) { dashedLineTo( ctx, @@ -13065,10 +14420,11 @@ define( }, /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style + * 计算返回多边形包围盒矩阵 + * @param {module:zrender/shape/Polygon~IPolygonStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} */ - getRect : function(style) { + getRect : function (style) { if (style.__rect) { return style.__rect; } @@ -13079,7 +14435,7 @@ define( var maxY = Number.MIN_VALUE; var pointList = style.pointList; - for(var i = 0, l = pointList.length; i < l; i++) { + for (var i = 0, l = pointList.length; i < l; i++) { if (pointList[i][0] < minX) { minX = pointList[i][0]; } @@ -13116,77 +14472,46 @@ define( return Polygon; } ); -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:折线 - * 可配图形属性: - { - // 基础属性 - shape : 'brokenLine', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - pointList : {Array}, // 必须,各个顶角坐标 - smooth : {Number}, // 默认为0 - strokeColor : {color}, // 默认为'#000',线条颜色(轮廓),支持rgba - lineType : {string}, // 默认为solid,线条类型,solid | dashed | dotted - lineWidth : {number}, // 默认为1,线条宽度 - lineCap : {string}, // 默认为butt,线帽样式。butt | round | square - lineJoin : {string}, // 默认为miter,线段连接样式。miter | round | bevel - miterLimit : {number}, // 默认为10,最大斜接长度,仅当lineJoin为miter时生效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为end,附加文本位置。 - // start | end - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#000' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - // 交互属性,详见shape.Base - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'brokenLine', - id : '123456', - zlevel : 1, - style : { - pointList : [[10, 10], [300, 20], [298, 400], [50, 450]], - strokeColor : '#eee', - lineWidth : 20, - text : 'Baidu' - }, - myName : 'kener', //可自带任何有效自定义属性 +/** + * 折线 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @module zrender/shape/BrokenLine + * @example + * var BrokenLine = require('zrender/shape/BrokenLine'); + * var shape = new BrokenLine({ + * style: { + * pointList: [[0, 0], [100, 100], [100, 0]], + * smooth: 'bezier', + * strokeColor: 'purple' + * } + * }); + * zr.addShape(shape); + */ - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } +/** + * @typedef {Object} IBrokenLineStyle + * @property {Array.} pointList 顶点坐标数组 + * @property {string} [smooth=''] 是否做平滑插值, 平滑算法可以选择 bezier, spline + * @property {number} [smoothConstraint] 平滑约束 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {string} [lineJoin='miter'] 线段连接样式,可以是 miter, round, bevel + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic */ define( 'zrender/shape/BrokenLine',['require','./Base','./util/smoothSpline','./util/smoothBezier','./util/dashedLineTo','./Polygon','../tool/util'],function (require) { @@ -13195,19 +14520,35 @@ define( var smoothBezier = require('./util/smoothBezier'); var dashedLineTo = require('./util/dashedLineTo'); - function BrokenLine( options ) { - this.brushTypeOnly = 'stroke'; //线条只能描边,填充后果自负 + /** + * @alias module:zrender/shape/BrokenLine + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var BrokenLine = function(options) { + this.brushTypeOnly = 'stroke'; // 线条只能描边,填充后果自负 this.textPosition = 'end'; Base.call(this, options); - } + /** + * 贝赛尔曲线绘制样式 + * @name module:zrender/shape/BrokenLine#style + * @type {module:zrender/shape/BrokenLine~IBrokenLineStyle} + */ + /** + * 贝赛尔曲线高亮绘制样式 + * @name module:zrender/shape/BrokenLine#highlightStyle + * @type {module:zrender/shape/BrokenLine~IBrokenLineStyle} + */ + }; BrokenLine.prototype = { type: 'broken-line', /** * 创建多边形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/BrokenLine~IBrokenLineStyle} style */ buildPath : function(ctx, style) { var pointList = style.pointList; @@ -13223,7 +14564,7 @@ define( if (style.smooth && style.smooth !== 'spline') { var controlPoints = smoothBezier( - pointList, style.smooth + pointList, style.smooth, false, style.smoothConstraint ); ctx.moveTo(pointList[0][0], pointList[0][1]); @@ -13245,10 +14586,10 @@ define( len = pointList.length; } if (!style.lineType || style.lineType == 'solid') { - //默认为实线 - ctx.moveTo(pointList[0][0],pointList[0][1]); + // 默认为实线 + ctx.moveTo(pointList[0][0], pointList[0][1]); for (var i = 1; i < len; i++) { - ctx.lineTo(pointList[i][0],pointList[i][1]); + ctx.lineTo(pointList[i][0], pointList[i][1]); } } else if (style.lineType == 'dashed' @@ -13256,7 +14597,7 @@ define( ) { var dashLength = (style.lineWidth || 1) * (style.lineType == 'dashed' ? 5 : 1); - ctx.moveTo(pointList[0][0],pointList[0][1]); + ctx.moveTo(pointList[0][0], pointList[0][1]); for (var i = 1; i < len; i++) { dashedLineTo( ctx, @@ -13271,8 +14612,9 @@ define( }, /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style + * 计算返回折线包围盒矩形。 + * @param {IZRenderBezierCurveStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} */ getRect : function(style) { return require('./Polygon').prototype.getRect(style); @@ -13337,9 +14679,11 @@ define('echarts/util/shape/MarkLine',['require','zrender/shape/Base','./Icon','z // 设置transform this.setTransform(ctx); + ctx.save(); ctx.beginPath(); this.buildLinePath(ctx, style); ctx.stroke(); + ctx.restore(); this.brushSymbol(ctx, style, 0); this.brushSymbol(ctx, style, 1); @@ -14529,92 +15873,82 @@ define('echarts/util/ecAnimation',['require','zrender/tool/util','zrender/shape/ }); /** - * zrender - * + * 圆形 + * @module zrender/shape/Circle * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:圆 - * 可配图形属性: - { - // 基础属性 - shape : 'circle', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,圆心横坐标 - y : {number}, // 必须,圆心纵坐标 - r : {number}, // 必须,圆半径 - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为top,附加文本位置。 - // inside | left | right | top | bottom - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'circle', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - r : 50, - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 + * @example + * var Circle = require('zrender/shape/Circle'); + * var shape = new Circle({ + * style: { + * x: 100, + * y: 100, + * r: 40, + * brushType: 'both', + * color: 'blue', + * strokeColor: 'red', + * lineWidth: 3, + * text: 'Circle' + * } + * }); + * zr.addShape(shape); + */ - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } +/** + * @typedef {Object} ICircleStyle + * @property {number} x 圆心x坐标 + * @property {number} y 圆心y坐标 + * @property {number} r 半径 + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic */ define( 'zrender/shape/Circle',['require','./Base','../tool/util'],function (require) { + + var Base = require('./Base'); - function Circle(options) { + /** + * @alias module:zrender/shape/Circle + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var Circle = function(options) { Base.call(this, options); - } + /** + * 圆形绘制样式 + * @name module:zrender/shape/Circle#style + * @type {module:zrender/shape/Circle~ICircleStyle} + */ + /** + * 圆形高亮绘制样式 + * @name module:zrender/shape/Circle#highlightStyle + * @type {module:zrender/shape/Circle~ICircleStyle} + */ + }; Circle.prototype = { type: 'circle', /** * 创建圆形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Circle~ICircleStyle} style */ buildPath : function (ctx, style) { ctx.arc(style.x, style.y, style.r, 0, Math.PI * 2, true); @@ -14622,8 +15956,9 @@ define( }, /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style + * 计算返回圆形的包围盒矩形 + * @param {module:zrender/shape/Circle~ICircleStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} */ getRect : function (style) { if (style.__rect) { @@ -14652,6 +15987,7 @@ define( return Circle; } ); + /** * echarts图表特效基类 * @@ -14932,8 +16268,20 @@ define('echarts/util/accMath',[],function() { // 说明:javascript的除法结果会有误差,在两个浮点数相除的时候会比较明显。这个函数返回较为精确的除法结果。 // 调用:accDiv(arg1,arg2) // 返回值:arg1除以arg2的精确结果 - function accDiv(arg1, arg2) { - return accMul(arg1, 1 / arg2); + function accDiv(arg1,arg2){ + var s1 = arg1.toString(); + var s2 = arg2.toString(); + var m = 0; + try { + m = s2.split('.')[1].length; + } + catch(e) {} + try { + m -= s1.split('.')[1].length; + } + catch(e) {} + + return (s1.replace('.', '') - 0) / (s2.replace('.', '') - 0) * Math.pow(10, m); } // 乘法函数,用来得到精确的乘法结果 @@ -14941,18 +16289,17 @@ define('echarts/util/accMath',[],function() { // 调用:accMul(arg1,arg2) // 返回值:arg1乘以arg2的精确结果 function accMul(arg1, arg2) { - var m = 0; var s1 = arg1.toString(); - var s2 = arg2.toString(); + var s2 = arg2.toString(); + var m = 0; try { m += s1.split('.')[1].length; } catch(e) {} - try { m += s2.split('.')[1].length; } - catch(e){} + catch(e) {} return (s1.replace('.', '') - 0) * (s2.replace('.', '') - 0) / Math.pow(10, m); } @@ -14964,12 +16311,10 @@ define('echarts/util/accMath',[],function() { function accAdd(arg1, arg2) { var r1 = 0; var r2 = 0; - try { r1 = arg1.toString().split('.')[1].length; } catch(e) {} - try { r2 = arg2.toString().split('.')[1].length; } @@ -15021,11 +16366,11 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon this.selectedMap = {}; this.lastShapeList = []; this.shapeHandler = { - onclick : function () { + onclick: function () { self.isClick = true; }, - ondragover : function (param) { + ondragover: function (param) { // 返回触发可计算特性的图形提示 var calculableShape = param.target; calculableShape.highlightStyle = calculableShape.highlightStyle || {}; @@ -15038,7 +16383,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon highlightStyle.brushType = 'stroke'; highlightStyle.strokeColor = self.ecTheme.calculableColor; - highlightStyle.lineWidth = calculableShape.type == 'icon' ? 30 : 10; + highlightStyle.lineWidth = calculableShape.type === 'icon' ? 30 : 10; self.zr.addHoverShape(calculableShape); @@ -15052,14 +16397,14 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon },20); }, - ondrop : function (param) { + ondrop: function (param) { // 排除一些非数据的拖拽进入 - if (typeof ecData.get(param.dragged, 'data') != 'undefined') { + if (ecData.get(param.dragged, 'data') != null) { self.isDrop = true; } }, - ondragend : function () { + ondragend: function () { self.isDragend = true; } }; @@ -15072,7 +16417,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon /** * 图形拖拽特性 */ - setCalculable : function (shape) { + setCalculable: function (shape) { shape.dragEnableTime = this.ecTheme.DRAG_ENABLE_TIME; shape.ondragover = this.shapeHandler.ondragover; shape.ondragend = this.shapeHandler.ondragend; @@ -15083,7 +16428,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon /** * 数据项被拖拽进来 */ - ondrop : function (param, status) { + ondrop: function (param, status) { if (!this.isDrop || !param.target) { // 没有在当前实例上发生拖拽行为则直接返回 return; @@ -15097,22 +16442,22 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon var series = this.series; var data; var legend = this.component.legend; - if (dataIndex == -1) { + if (dataIndex === -1) { // 落到calculableCase上,数据被拖拽进某个饼图|雷达|漏斗,增加数据 data = { - value : ecData.get(dragged, 'value'), - name : ecData.get(dragged, 'name') + value: ecData.get(dragged, 'value'), + name: ecData.get(dragged, 'name') }; // 修饼图数值不为负值 - if (this.type == ecConfig.CHART_TYPE_PIE && data.value < 0) { + if (this.type === ecConfig.CHART_TYPE_PIE && data.value < 0) { data.value = 0; } var hasFind = false; var sData = series[seriesIndex].data; for (var i = 0, l = sData.length; i < l; i++) { - if (sData[i].name == data.name && sData[i].value == '-') { + if (sData[i].name === data.name && sData[i].value === '-') { series[seriesIndex].data[i].value = data.value; hasFind = true; } @@ -15127,7 +16472,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon else { // 落到数据item上,数据被拖拽到某个数据项上,数据修改 data = this.option.series[seriesIndex].data[dataIndex] || '-'; - if (typeof data.value != 'undefined') { + if (data.value != null) { if (data.value != '-') { this.option.series[seriesIndex].data[dataIndex].value = accMath.accAdd( @@ -15140,10 +16485,10 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon ecData.get(dragged, 'value'); } - if (this.type == ecConfig.CHART_TYPE_FUNNEL - || this.type == ecConfig.CHART_TYPE_PIE + if (this.type === ecConfig.CHART_TYPE_FUNNEL + || this.type === ecConfig.CHART_TYPE_PIE ) { - legend && legend.getRelatedAmount(data.name) == 1 + legend && legend.getRelatedAmount(data.name) === 1 && this.component.legend.del(data.name); data.name += this.option.nameConnector + ecData.get(dragged, 'name'); legend && legend.add( @@ -15184,7 +16529,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon /** * 数据项被拖拽出去 */ - ondragend : function (param, status) { + ondragend: function (param, status) { if (!this.isDragend || !param.target) { // 没有在当前实例上发生拖拽行为则直接返回 return; @@ -15197,7 +16542,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon var series = this.series; // 删除被拖拽走的数据 - if (typeof series[seriesIndex].data[dataIndex].value != 'undefined') { + if (series[seriesIndex].data[dataIndex].value != null) { series[seriesIndex].data[dataIndex].value = '-'; // 清理可能有且唯一的legend data var name = series[seriesIndex].data[dataIndex].name; @@ -15224,7 +16569,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon /** * 图例选择 */ - onlegendSelected : function (param, status) { + onlegendSelected: function (param, status) { var legendSelected = param.selected; for (var itemName in this.selectedMap) { if (this.selectedMap[itemName] != legendSelected[itemName]) { @@ -15239,7 +16584,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon /** * 添加文本 */ - addLabel : function (tarShape, serie, data, name, orient) { + addLabel: function (tarShape, serie, data, name, orient) { // 多级控制 var queryTarget = [data, serie]; var nLabel = this.deepMerge(queryTarget, 'itemStyle.normal.label'); @@ -15252,8 +16597,8 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon tarShape.style.text = this._getLabelText( serie, data, name, 'normal' ); - tarShape.style.textPosition = typeof nLabel.position == 'undefined' - ? (orient == 'horizontal' ? 'right' : 'top') + tarShape.style.textPosition = nLabel.position == null + ? (orient === 'horizontal' ? 'right' : 'top') : nLabel.position; tarShape.style.textColor = nTextStyle.color; tarShape.style.textFont = this.getFont(nTextStyle); @@ -15264,8 +16609,8 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon ); tarShape.highlightStyle.textPosition = nLabel.show ? tarShape.style.textPosition - : (typeof eLabel.position == 'undefined' - ? (orient == 'horizontal' ? 'right' : 'top') + : (eLabel.position == null + ? (orient === 'horizontal' ? 'right' : 'top') : eLabel.position); tarShape.highlightStyle.textColor = eTextStyle.color; tarShape.highlightStyle.textFont = this.getFont(eTextStyle); @@ -15277,12 +16622,12 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon /** * 根据lable.format计算label text */ - _getLabelText : function (serie, data, name, status) { + _getLabelText: function (serie, data, name, status) { var formatter = this.deepQuery( [data, serie], 'itemStyle.' + status + '.label.formatter' ); - if (!formatter && status == 'emphasis') { + if (!formatter && status === 'emphasis') { // emphasis时需要看看normal下是否有formatter formatter = this.deepQuery( [data, serie], @@ -15290,14 +16635,14 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon ); } - var value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' + var value = data != null + ? (data.value != null ? data.value : data) : '-'; if (formatter) { - if (typeof formatter == 'function') { + if (typeof formatter === 'function') { return formatter.call( this.myChart, serie.name, @@ -15305,7 +16650,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon value ); } - else if (typeof formatter == 'string') { + else if (typeof formatter === 'string') { formatter = formatter.replace('{a}','{a0}') .replace('{b}','{b0}') .replace('{c}','{c0}'); @@ -15324,7 +16669,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon /** * 标线标注 */ - buildMark : function (seriesIndex) { + buildMark: function (seriesIndex) { var serie = this.series[seriesIndex]; if (this.selectedMap[serie.name]) { serie.markPoint && this._buildMarkPoint(seriesIndex); @@ -15335,7 +16680,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon /** * 标注逻辑 */ - _buildMarkPoint : function (seriesIndex) { + _buildMarkPoint: function (seriesIndex) { var attachStyle = (this.markAttachStyle || {})[seriesIndex]; var serie = this.series[seriesIndex]; var _zlevelBase = this.getZlevelBase(); @@ -15345,12 +16690,10 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon for (var i = 0, l = markPoint.data.length; i < l; i++) { mpData = markPoint.data[i]; pos = this.getMarkCoord(seriesIndex, mpData); - markPoint.data[i].x = typeof mpData.x != 'undefined' - ? mpData.x : pos[0]; - markPoint.data[i].y = typeof mpData.y != 'undefined' - ? mpData.y : pos[1]; + markPoint.data[i].x = mpData.x != null ? mpData.x : pos[0]; + markPoint.data[i].y = mpData.y != null ? mpData.y : pos[1]; if (mpData.type - && (mpData.type == 'max' || mpData.type == 'min') + && (mpData.type === 'max' || mpData.type === 'min') ) { // 特殊值内置支持 markPoint.data[i].value = pos[3]; @@ -15370,8 +16713,8 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon this.shapeList.push(shapeList[i]); } // 个别特殊图表需要自己addShape - if (this.type == ecConfig.CHART_TYPE_FORCE - || this.type == ecConfig.CHART_TYPE_CHORD + if (this.type === ecConfig.CHART_TYPE_FORCE + || this.type === ecConfig.CHART_TYPE_CHORD ) { for (var i = 0, l = shapeList.length; i < l; i++) { this.zr.addShape(shapeList[i]); @@ -15382,7 +16725,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon /** * 标线逻辑 */ - _buildMarkLine : function (seriesIndex) { + _buildMarkLine: function (seriesIndex) { var attachStyle = (this.markAttachStyle || {})[seriesIndex]; var serie = this.series[seriesIndex]; var _zlevelBase = this.getZlevelBase(); @@ -15392,7 +16735,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon for (var i = 0, l = markLine.data.length; i < l; i++) { mlData = markLine.data[i]; if (mlData.type - && (mlData.type == 'max' || mlData.type == 'min' || mlData.type == 'average') + && (mlData.type === 'max' || mlData.type === 'min' || mlData.type === 'average') ) { // 特殊值内置支持 pos = this.getMarkCoord(seriesIndex, mlData); @@ -15409,14 +16752,10 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon ]; } - markLine.data[i][0].x = typeof mlData[0].x != 'undefined' - ? mlData[0].x : pos[0][0]; - markLine.data[i][0].y = typeof mlData[0].y != 'undefined' - ? mlData[0].y : pos[0][1]; - markLine.data[i][1].x = typeof mlData[1].x != 'undefined' - ? mlData[1].x : pos[1][0]; - markLine.data[i][1].y = typeof mlData[1].y != 'undefined' - ? mlData[1].y : pos[1][1]; + markLine.data[i][0].x = mlData[0].x != null ? mlData[0].x : pos[0][0]; + markLine.data[i][0].y = mlData[0].y != null ? mlData[0].y : pos[0][1]; + markLine.data[i][1].x = mlData[1].x != null ? mlData[1].x : pos[1][0]; + markLine.data[i][1].y = mlData[1].y != null ? mlData[1].y : pos[1][1]; } var shapeList = this._markLine(seriesIndex, markLine); @@ -15429,8 +16768,8 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon this.shapeList.push(shapeList[i]); } // 个别特殊图表需要自己addShape - if (this.type == ecConfig.CHART_TYPE_FORCE - || this.type == ecConfig.CHART_TYPE_CHORD + if (this.type === ecConfig.CHART_TYPE_FORCE + || this.type === ecConfig.CHART_TYPE_CHORD ) { for (var i = 0, l = shapeList.length; i < l; i++) { this.zr.addShape(shapeList[i]); @@ -15441,7 +16780,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon /** * 标注多级控制构造 */ - _markPoint : function (seriesIndex, mpOption) { + _markPoint: function (seriesIndex, mpOption) { var serie = this.series[seriesIndex]; var component = this.component; zrUtil.merge( @@ -15467,7 +16806,10 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon if (!mpOption.large) { for (var i = 0, l = data.length; i < l; i++) { - value = typeof data[i] != 'undefined' && typeof data[i].value != 'undefined' + if (data[i].x == null || data[i].y == null) { + continue; + } + value = data[i] != null && data[i].value != null ? data[i].value : ''; // 图例 @@ -15494,8 +16836,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon // 标准化一些参数 data[i].tooltip = data[i].tooltip || {trigger:'item'}; // tooltip.trigger指定为item - data[i].name = typeof data[i].name != 'undefined' - ? data[i].name : ''; + data[i].name = data[i].name != null ? data[i].name : ''; data[i].value = value; // 复用getSymbolShape @@ -15518,7 +16859,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon itemShape.effect = effect; } - if (serie.type == ecConfig.CHART_TYPE_MAP) { + if (serie.type === ecConfig.CHART_TYPE_MAP) { itemShape._geo = this.getMarkGeo(data[i]); } @@ -15545,7 +16886,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon /** * 标线多级控制构造 */ - _markLine : function (seriesIndex, mlOption) { + _markLine: function (seriesIndex, mlOption) { var serie = this.series[seriesIndex]; var component = this.component; zrUtil.merge( @@ -15587,13 +16928,21 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon var zrHeight = this.zr.getHeight(); var mergeData; for (var i = 0, l = data.length; i < l; i++) { + if (data[i][0].x == null + || data[i][0].y == null + || data[i][1].x == null + || data[i][1].y == null + ) { + continue; + } + // 图例 if (legend) { color = legend.getColor(serie.name); } // 组装一个mergeData mergeData = this.deepMerge(data[i]); - value = typeof mergeData != 'undefined' && typeof mergeData.value != 'undefined' + value = mergeData != null && mergeData.value != null ? mergeData.value : ''; // 值域 @@ -15616,12 +16965,9 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon // 标准化一些参数 data[i][0].tooltip = mergeData.tooltip || {trigger:'item'}; // tooltip.trigger指定为item - data[i][0].name = typeof data[i][0].name != 'undefined' - ? data[i][0].name : ''; - data[i][1].name = typeof data[i][1].name != 'undefined' - ? data[i][1].name : ''; - data[i][0].value = typeof data[i][0].value != 'undefined' - ? data[i][0].value : ''; + data[i][0].name = data[i][0].name != null ? data[i][0].name : ''; + data[i][1].name = data[i][1].name != null ? data[i][1].name : ''; + data[i][0].value = data[i][0].value != null ? data[i][0].value : ''; itemShape = this.getLineMarkShape( mlOption, // markLine @@ -15644,7 +16990,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon itemShape.effect = effect; } - if (serie.type == ecConfig.CHART_TYPE_MAP) { + if (serie.type === ecConfig.CHART_TYPE_MAP) { itemShape._geo = [ this.getMarkGeo(data[i][0]), this.getMarkGeo(data[i][1]) @@ -15656,7 +17002,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon itemShape, serie, seriesIndex, data[i][0], i, - data[i][0].name + (data[i][1].name !== '' + data[i][0].name + (data[i][1].name !== '' // 不要帮我代码规范 ? (' > ' + data[i][1].name) : ''), value @@ -15667,7 +17013,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon return pList; }, - getMarkCoord : function () { + getMarkCoord: function () { // 无转换位置 return [0, 0]; }, @@ -15675,7 +17021,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon /** * symbol构造器 */ - getSymbolShape : function ( + getSymbolShape: function ( serie, seriesIndex, // 系列 data, dataIndex, name, // 数据 x, y, // 坐标 @@ -15684,15 +17030,15 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon orient // 走向,用于默认文字定位 ) { var queryTarget = [data, serie]; - var value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' + var value = data != null + ? (data.value != null ? data.value : data) : '-'; symbol = this.deepQuery(queryTarget, 'symbol') || symbol; var symbolSize = this.deepQuery(queryTarget, 'symbolSize'); - symbolSize = typeof symbolSize == 'function' + symbolSize = typeof symbolSize === 'function' ? symbolSize(value) : symbolSize; var symbolRotate = this.deepQuery(queryTarget, 'symbolRotate'); @@ -15705,60 +17051,60 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon queryTarget, 'itemStyle.emphasis' ); - var nBorderWidth = typeof normal.borderWidth != 'undefined' + var nBorderWidth = normal.borderWidth != null ? normal.borderWidth : (normal.lineStyle && normal.lineStyle.width); - if (typeof nBorderWidth == 'undefined') { + if (nBorderWidth == null) { nBorderWidth = symbol.match('empty') ? 2 : 0; } - var eBorderWidth = typeof emphasis.borderWidth != 'undefined' + var eBorderWidth = emphasis.borderWidth != null ? emphasis.borderWidth : (emphasis.lineStyle && emphasis.lineStyle.width); - if (typeof eBorderWidth == 'undefined') { + if (eBorderWidth == null) { eBorderWidth = nBorderWidth + 2; } var itemShape = new IconShape({ - style : { - iconType : symbol.replace('empty', '').toLowerCase(), - x : x - symbolSize, - y : y - symbolSize, - width : symbolSize * 2, - height : symbolSize * 2, - brushType : 'both', - color : symbol.match('empty') + style: { + iconType: symbol.replace('empty', '').toLowerCase(), + x: x - symbolSize, + y: y - symbolSize, + width: symbolSize * 2, + height: symbolSize * 2, + brushType: 'both', + color: symbol.match('empty') ? emptyColor : (this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) || color), - strokeColor : normal.borderColor + strokeColor: normal.borderColor || this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) || color, lineWidth: nBorderWidth }, - highlightStyle : { - color : symbol.match('empty') + highlightStyle: { + color: symbol.match('empty') ? emptyColor : this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data), - strokeColor : emphasis.borderColor + strokeColor: emphasis.borderColor || normal.borderColor || this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) || color, lineWidth: eBorderWidth }, - clickable : true + clickable: this.deepQuery(queryTarget, 'clickable') }); if (symbol.match('image')) { itemShape.style.image = symbol.replace(new RegExp('^image:\\/\\/'), ''); itemShape = new ImageShape({ - style : itemShape.style, - highlightStyle : itemShape.highlightStyle, - clickable : true + style: itemShape.style, + highlightStyle: itemShape.highlightStyle, + clickable: this.deepQuery(queryTarget, 'clickable') }); } - if (typeof symbolRotate != 'undefined') { + if (symbolRotate != null) { itemShape.rotation = [ symbolRotate * Math.PI / 180, x, y ]; @@ -15770,7 +17116,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon (symbol.replace('empty', '').replace('star','') - 0) || 5; } - if (symbol == 'none') { + if (symbol === 'none') { itemShape.invisible = true; itemShape.hoverable = false; } @@ -15789,10 +17135,10 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon ); if (symbol.match('empty')) { - if (typeof itemShape.style.textColor == 'undefined') { + if (itemShape.style.textColor == null) { itemShape.style.textColor = itemShape.style.strokeColor; } - if (typeof itemShape.highlightStyle.textColor == 'undefined') { + if (itemShape.highlightStyle.textColor == null) { itemShape.highlightStyle.textColor = itemShape.highlightStyle.strokeColor; } @@ -15817,7 +17163,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon /** * 标线构造器 */ - getLineMarkShape : function ( + getLineMarkShape: function ( mlOption, // 系列 seriesIndex, // 系列索引 data, // 数据 @@ -15826,13 +17172,13 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon xEnd, yEnd, // 坐标 color // 默认color,来自legend或dataRange全局分配 ) { - var value0 = typeof data[0] != 'undefined' - ? (typeof data[0].value != 'undefined' + var value0 = data[0] != null + ? (data[0].value != null ? data[0].value : data[0]) : '-'; - var value1 = typeof data[1] != 'undefined' - ? (typeof data[1].value != 'undefined' + var value1 = data[1] != null + ? (data[1].value != null ? data[1].value : data[1]) : '-'; @@ -15844,10 +17190,10 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon this.query(data[0], 'symbolSize') || mlOption.symbolSize[0], this.query(data[1], 'symbolSize') || mlOption.symbolSize[1] ]; - symbolSize[0] = typeof symbolSize[0] == 'function' + symbolSize[0] = typeof symbolSize[0] === 'function' ? symbolSize[0](value0) : symbolSize[0]; - symbolSize[1] = typeof symbolSize[1] == 'function' + symbolSize[1] = typeof symbolSize[1] === 'function' ? symbolSize[1](value1) : symbolSize[1]; var symbolRotate = [ @@ -15872,75 +17218,72 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon var elineStyle = emphasis.lineStyle; var nBorderWidth = nlineStyle.width; - if (typeof nBorderWidth == 'undefined') { + if (nBorderWidth == null) { nBorderWidth = normal.borderWidth; } var eBorderWidth = elineStyle.width; - if (typeof eBorderWidth == 'undefined') { - if (typeof emphasis.borderWidth != 'undefined') { - eBorderWidth = emphasis.borderWidth; - } - else { - eBorderWidth = nBorderWidth + 2; - } + if (eBorderWidth == null) { + eBorderWidth = emphasis.borderWidth != null + ? emphasis.borderWidth + : (nBorderWidth + 2); } var itemShape = new MarkLineShape({ - style : { - smooth : mlOption.smooth ? 'spline' : false, - symbol : symbol, - symbolSize : symbolSize, - symbolRotate : symbolRotate, - //data : [data[0].name,data[1].name], - xStart : xStart, - yStart : yStart, // 坐标 - xEnd : xEnd, - yEnd : yEnd, // 坐标 - brushType : 'both', - lineType : nlineStyle.type, - shadowColor : nlineStyle.shadowColor - || nlineStyle.color - || normal.borderColor - || normal.color - || color, + style: { + smooth: mlOption.smooth ? 'spline' : false, + symbol: symbol, + symbolSize: symbolSize, + symbolRotate: symbolRotate, + // data: [data[0].name,data[1].name], + xStart: xStart, + yStart: yStart, // 坐标 + xEnd: xEnd, + yEnd: yEnd, // 坐标 + brushType: 'both', + lineType: nlineStyle.type, + shadowColor: nlineStyle.shadowColor + || nlineStyle.color + || normal.borderColor + || normal.color + || color, shadowBlur: nlineStyle.shadowBlur, shadowOffsetX: nlineStyle.shadowOffsetX, shadowOffsetY: nlineStyle.shadowOffsetY, - color : normal.color || color, - strokeColor : nlineStyle.color - || normal.borderColor - || normal.color - || color, + color: normal.color || color, + strokeColor: nlineStyle.color + || normal.borderColor + || normal.color + || color, lineWidth: nBorderWidth, symbolBorderColor: normal.borderColor || normal.color || color, symbolBorder: normal.borderWidth }, - highlightStyle : { - shadowColor : elineStyle.shadowColor, + highlightStyle: { + shadowColor: elineStyle.shadowColor, shadowBlur: elineStyle.shadowBlur, shadowOffsetX: elineStyle.shadowOffsetX, shadowOffsetY: elineStyle.shadowOffsetY, - color : emphasis.color|| normal.color || color, - strokeColor : elineStyle.color - || nlineStyle.color - || emphasis.borderColor - || normal.borderColor - || emphasis.color - || normal.color - || color, + color: emphasis.color|| normal.color || color, + strokeColor: elineStyle.color + || nlineStyle.color + || emphasis.borderColor + || normal.borderColor + || emphasis.color + || normal.color + || color, lineWidth: eBorderWidth, symbolBorderColor: emphasis.borderColor || normal.borderColor || emphasis.color || normal.color || color, - symbolBorder: typeof emphasis.borderWidth == 'undefined' + symbolBorder: emphasis.borderWidth == null ? (normal.borderWidth + 2) : (emphasis.borderWidth) }, - clickable : true + clickable: this.deepQuery(queryTarget, 'clickable') }); itemShape = this.addLabel( @@ -15959,7 +17302,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon /** * 大规模标注构造器 */ - getLargeMarkPoingShape : function(seriesIndex, mpOption) { + getLargeMarkPoingShape: function(seriesIndex, mpOption) { var serie = this.series[seriesIndex]; var component = this.component; var data = mpOption.data; @@ -15980,8 +17323,8 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon } // 值域 if (dataRange) { - value = typeof data[0] != 'undefined' - ? (typeof data[0].value != 'undefined' + value = data[0] != null + ? (data[0].value != null ? data[0].value : data[0]) : '-'; @@ -16013,20 +17356,20 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon //console.log(data) itemShape = new SymbolShape({ - style : { - pointList : data, - color : color, + style: { + pointList: data, + color: color, strokeColor: color, - shadowColor : effect.shadowColor || color, - shadowBlur : (typeof effect.shadowBlur != 'undefined' ? effect.shadowBlur : 8) + shadowColor: effect.shadowColor || color, + shadowBlur: (effect.shadowBlur != null ? effect.shadowBlur : 8) * devicePixelRatio, - size : this.deepQuery(queryTarget, 'symbolSize'), - iconType : symbol, + size: this.deepQuery(queryTarget, 'symbolSize'), + iconType: symbol, brushType: 'fill', lineWidth:1 }, - draggable : false, - hoverable : false + draggable: false, + hoverable: false }); if (effect.show) { @@ -16036,7 +17379,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon return itemShape; }, - backupShapeList : function () { + backupShapeList: function () { if (this.shapeList && this.shapeList.length > 0) { this.lastShapeList = this.shapeList; this.shapeList = []; @@ -16046,7 +17389,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon } }, - addShapeList : function () { + addShapeList: function () { var maxLenth = this.option.animationThreshold / (this.canvasSupported ? 2 : 4); var lastShapeList = this.lastShapeList; var shapeList = this.shapeList; @@ -16115,12 +17458,12 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon } }, - _getAnimationKey : function(shape) { + _getAnimationKey: function(shape) { if (this.type != ecConfig.CHART_TYPE_MAP) { return ecData.get(shape, 'seriesIndex') + '_' + ecData.get(shape, 'dataIndex') + (shape._mark ? shape._mark : '') - + (this.type == ecConfig.CHART_TYPE_RADAR + + (this.type === ecConfig.CHART_TYPE_RADAR ? ecData.get(shape, 'special') : ''); } else { @@ -16133,7 +17476,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon /** * 动画过渡 */ - _animateMod : function (oldShape, newShape, duration, easing) { + _animateMod: function (oldShape, newShape, duration, easing) { switch (newShape.type) { case 'broken-line' : case 'half-smooth-polygon' : @@ -16166,7 +17509,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon easing ); } - else if (newShape.type == 'sector') { + else if (newShape.type === 'sector') { ecAnimation.sector(this.zr, oldShape, newShape, duration, easing); } else { @@ -16208,7 +17551,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon * @param {string=} easing 缓动效果 * @param {Array=} addShapeList 指定特效对象,不知道默认使用this.shapeList */ - animationMark : function (duration , easing, addShapeList) { + animationMark: function (duration , easing, addShapeList) { var shapeList = addShapeList || this.shapeList; for (var i = 0, l = shapeList.length; i < l; i++) { if (!shapeList[i]._mark) { @@ -16223,7 +17566,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon * 特效动画 * @param {Array=} addShapeList 指定特效对象,不知道默认使用this.shapeList */ - animationEffect : function (addShapeList) { + animationEffect: function (addShapeList) { !addShapeList && this.clearEffectShape(); var shapeList = addShapeList || this.shapeList; var zlevel = ecConfig.EFFECT_ZLEVEL; @@ -16231,8 +17574,8 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon this.zr.modLayer( zlevel, { - motionBlur : true, - lastFrameAlpha : 0.95 + motionBlur: true, + lastFrameAlpha: 0.95 } ); } @@ -16248,11 +17591,11 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon } }, - clearEffectShape : function (clearMotionBlur) { + clearEffectShape: function (clearMotionBlur) { if (this.zr && this.effectList && this.effectList.length > 0) { clearMotionBlur && this.zr.modLayer( ecConfig.EFFECT_ZLEVEL, - { motionBlur : false} + { motionBlur: false } ); this.zr.delShape(this.effectList); } @@ -16265,7 +17608,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon * @param {Object} markData 标线标注对象,支持多个 * @param {string} markType 标线标注类型 */ - addMark : function (seriesIndex, markData, markType) { + addMark: function (seriesIndex, markData, markType) { var serie = this.series[seriesIndex]; if (this.selectedMap[serie.name]) { var duration = 500; @@ -16276,14 +17619,16 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon serie[markType].data = markData.data; this['_build' + markType.replace('m', 'M')](seriesIndex); - for (var i = lastLength, l = this.shapeList.length; i < l; i++) { - this.zr.addShape(this.shapeList[i]); - } - this.zr.refresh(); - if (this.option.animation && !this.option.renderAsImage) { + // animationMark就会addShape this.animationMark(duration, easing, this.shapeList.slice(lastLength)); } + else { + for (var i = lastLength, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + this.zr.refresh(); + } // 还原,复用_buildMarkX serie[markType].data = oriMarkData; } @@ -16295,7 +17640,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon * @param {string} markName 标线标注名称 * @param {string} markType 标线标注类型 */ - delMark : function (seriesIndex, markName, markType) { + delMark: function (seriesIndex, markName, markType) { markType = markType.replace('mark', '').replace('large', '').toLowerCase(); var serie = this.series[seriesIndex]; if (this.selectedMap[serie.name]) { @@ -16304,9 +17649,9 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon var len = 2; while(len--) { for (var i = 0, l = shapeList[len].length; i < l; i++) { - if (shapeList[len][i]._mark == markType - && ecData.get(shapeList[len][i], 'seriesIndex') == seriesIndex - && ecData.get(shapeList[len][i], 'name') == markName + if (shapeList[len][i]._mark === markType + && ecData.get(shapeList[len][i], 'seriesIndex') === seriesIndex + && ecData.get(shapeList[len][i], 'name') === markName ) { this.zr.delShape(shapeList[len][i].id); shapeList[len].splice(i, 1); @@ -16426,14 +17771,14 @@ define('echarts/chart/island',['require','../component/base','./base','zrender/s } Island.prototype = { - type : ecConfig.CHART_TYPE_ISLAND, + type: ecConfig.CHART_TYPE_ISLAND, /** * 孤岛合并 * * @param {string} tarShapeIndex 目标索引 * @param {Object} srcShape 源目标,合入目标后删除 */ - _combine : function (tarShape, srcShape) { + _combine: function (tarShape, srcShape) { var zrColor = require('zrender/tool/color'); var accMath = require('../util/accMath'); var value = accMath.accAdd( @@ -16458,7 +17803,7 @@ define('echarts/chart/island',['require','../component/base','./base','zrender/s /** * 刷新 */ - refresh : function (newOption) { + refresh: function (newOption) { if (newOption) { newOption.island = this.reformOption(newOption.island); this.option = newOption; @@ -16468,16 +17813,16 @@ define('echarts/chart/island',['require','../component/base','./base','zrender/s } }, - getOption : function () { + getOption: function () { return this.option; }, - resize : function () { + resize: function () { var newWidth = this.zr.getWidth(); var newHieght = this.zr.getHeight(); var xScale = newWidth / (this._zrWidth || newWidth); var yScale = newHieght / (this._zrHeight || newHieght); - if (xScale == 1 && yScale == 1) { + if (xScale === 1 && yScale === 1) { return; } this._zrWidth = newWidth; @@ -16495,29 +17840,29 @@ define('echarts/chart/island',['require','../component/base','./base','zrender/s } }, - add : function (shape) { + add: function (shape) { var name = ecData.get(shape, 'name'); var value = ecData.get(shape, 'value'); - var seriesName = typeof ecData.get(shape, 'series') != 'undefined' + var seriesName = ecData.get(shape, 'series') != null ? ecData.get(shape, 'series').name : ''; var font = this.getFont(this.option.island.textStyle); var islandShape = { - zlevel : this._zlevelBase, - style : { - x : shape.style.x, - y : shape.style.y, - r : this.option.island.r, - color : shape.style.color || shape.style.strokeColor, - text : name + this._valueConnector + value, - textFont : font + zlevel: this._zlevelBase, + style: { + x: shape.style.x, + y: shape.style.y, + r: this.option.island.r, + color: shape.style.color || shape.style.strokeColor, + text: name + this._valueConnector + value, + textFont: font }, - draggable : true, - hoverable : true, - onmousewheel : this.shapeHandler.onmousewheel, - _type : 'island' + draggable: true, + hoverable: true, + onmousewheel: this.shapeHandler.onmousewheel, + _type: 'island' }; - if (islandShape.style.color == '#fff') { + if (islandShape.style.color === '#fff') { islandShape.style.color = shape.style.strokeColor; } this.setCalculable(islandShape); @@ -16533,7 +17878,7 @@ define('echarts/chart/island',['require','../component/base','./base','zrender/s this.zr.addShape(islandShape); }, - del : function (shape) { + del: function (shape) { this.zr.delShape(shape.id); var newShapeList = []; for (var i = 0, l = this.shapeList.length; i < l; i++) { @@ -16547,7 +17892,7 @@ define('echarts/chart/island',['require','../component/base','./base','zrender/s /** * 数据项被拖拽进来, 重载基类方法 */ - ondrop : function (param, status) { + ondrop: function (param, status) { if (!this.isDrop || !param.target) { // 没有在当前实例上发生拖拽行为则直接返回 return; @@ -16570,7 +17915,7 @@ define('echarts/chart/island',['require','../component/base','./base','zrender/s /** * 数据项被拖拽出去, 重载基类方法 */ - ondragend : function (param, status) { + ondragend: function (param, status) { var target = param.target; // 拖拽安放目标 if (!this.isDragend) { // 拖拽的不是孤岛数据,如果没有图表接受孤岛数据,需要新增孤岛数据 @@ -17137,7 +18482,7 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre this.dom = myChart.dom; this._magicType = {}; - //this._magicMap; + this._magicMap = {}; this._isSilence = false; this._iconList; @@ -17206,8 +18551,8 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre } Toolbox.prototype = { - type : ecConfig.COMPONENT_TYPE_TOOLBOX, - _buildShape : function () { + type: ecConfig.COMPONENT_TYPE_TOOLBOX, + _buildShape: function () { this._iconList = []; var toolboxOption = this.option.toolbox; this._enableColor = toolboxOption.effectiveColor; @@ -17218,28 +18563,28 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre if (feature[key].show) { switch (key) { case 'mark' : - iconName.push({key : key, name : 'mark'}); - iconName.push({key : key, name : 'markUndo'}); - iconName.push({key : key, name : 'markClear'}); + iconName.push({ key: key, name: 'mark' }); + iconName.push({ key: key, name: 'markUndo' }); + iconName.push({ key: key, name: 'markClear' }); break; case 'magicType' : for (var i = 0, l = feature[key].type.length; i < l; i++) { feature[key].title[feature[key].type[i] + 'Chart'] = feature[key].title[feature[key].type[i]]; - iconName.push({key : key, name : feature[key].type[i] + 'Chart'}); + iconName.push({ key: key, name: feature[key].type[i] + 'Chart' }); } break; case 'dataZoom' : - iconName.push({key : key, name : 'dataZoom'}); - iconName.push({key : key, name : 'dataZoomReset'}); + iconName.push({ key: key, name: 'dataZoom' }); + iconName.push({ key: key, name: 'dataZoomReset' }); break; case 'saveAsImage' : if (this.canvasSupported) { - iconName.push({key : key, name : 'saveAsImage'}); + iconName.push({ key: key, name: 'saveAsImage' }); } break; default : - iconName.push({key : key, name : key}); + iconName.push({ key: key, name: key }); break; } } @@ -17280,7 +18625,7 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre /** * 构建所有图例元素 */ - _buildItem : function () { + _buildItem: function () { var toolboxOption = this.option.toolbox; var iconLength = this._iconList.length; var lastX = this._itemGroupLocation.x; @@ -17296,7 +18641,7 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre var textPosition; var textAlign; var textBaseline; - if (toolboxOption.orient == 'horizontal') { + if (toolboxOption.orient === 'horizontal') { textPosition = this._itemGroupLocation.y / this.zr.getHeight() < 0.5 ? 'bottom' : 'top'; textAlign = this._itemGroupLocation.x / this.zr.getWidth() < 0.5 @@ -17320,31 +18665,31 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre for (var i = 0; i < iconLength; i++) { // 图形 itemShape = { - type : 'icon', - zlevel : this._zlevelBase, - style : { - x : lastX, - y : lastY, - width : itemSize, - height : itemSize, - iconType : this._iconList[i], - lineWidth : 1, - strokeColor : this._featureColor[this._iconList[i]] - || color[i % color.length], + type: 'icon', + zlevel: this._zlevelBase, + style: { + x: lastX, + y: lastY, + width: itemSize, + height: itemSize, + iconType: this._iconList[i], + lineWidth: 1, + strokeColor: this._featureColor[this._iconList[i]] + || color[i % color.length], brushType: 'stroke' }, - highlightStyle : { - lineWidth : 1, - text : toolboxOption.showTitle - ? this._featureTitle[this._iconList[i]] - : undefined, - textFont : textFont, - textPosition : textPosition, - strokeColor : this._featureColor[this._iconList[i]] - || color[i % color.length] + highlightStyle: { + lineWidth: 1, + text: toolboxOption.showTitle + ? this._featureTitle[this._iconList[i]] + : undefined, + textFont: textFont, + textPosition: textPosition, + strokeColor: this._featureColor[this._iconList[i]] + || color[i % color.length] }, - hoverable : true, - clickable : true + hoverable: true, + clickable: true }; if (this._featureIcon[this._iconList[i]]) { @@ -17356,23 +18701,23 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre itemShape.type = 'image'; } - if (toolboxOption.orient == 'horizontal') { + if (toolboxOption.orient === 'horizontal') { // 修正左对齐第一个或右对齐最后一个 - if (i === 0 && textAlign == 'left') { + if (i === 0 && textAlign === 'left') { itemShape.highlightStyle.textPosition = 'specific'; itemShape.highlightStyle.textAlign = textAlign; itemShape.highlightStyle.textBaseline = textBaseline; itemShape.highlightStyle.textX = lastX; - itemShape.highlightStyle.textY = textBaseline == 'top' + itemShape.highlightStyle.textY = textBaseline === 'top' ? lastY + itemSize + 10 : lastY - 10; } - if (i == iconLength - 1 && textAlign == 'right') { + if (i === iconLength - 1 && textAlign === 'right') { itemShape.highlightStyle.textPosition = 'specific'; itemShape.highlightStyle.textAlign = textAlign; itemShape.highlightStyle.textBaseline = textBaseline; itemShape.highlightStyle.textX = lastX + itemSize; - itemShape.highlightStyle.textY = textBaseline == 'top' + itemShape.highlightStyle.textY = textBaseline === 'top' ? lastY + itemSize + 10 : lastY - 10; } @@ -17425,16 +18770,16 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre break; } - if (itemShape.type == 'icon') { + if (itemShape.type === 'icon') { itemShape = new IconShape(itemShape); } - else if (itemShape.type == 'image') { + else if (itemShape.type === 'image') { itemShape = new ImageShape(itemShape); } this.shapeList.push(itemShape); this._iconShapeMap[this._iconList[i]] = itemShape; - if (toolboxOption.orient == 'horizontal') { + if (toolboxOption.orient === 'horizontal') { lastX += itemSize + itemGap; } else { @@ -17443,7 +18788,7 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre } }, - _buildBackground : function () { + _buildBackground: function () { var toolboxOption = this.option.toolbox; var pTop = toolboxOption.padding[0]; var pRight = toolboxOption.padding[1]; @@ -17451,18 +18796,17 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre var pLeft = toolboxOption.padding[3]; this.shapeList.push(new RectangleShape({ - zlevel : this._zlevelBase, + zlevel: this._zlevelBase, hoverable :false, - style : { - x : this._itemGroupLocation.x - pLeft, - y : this._itemGroupLocation.y - pTop, - width : this._itemGroupLocation.width + pLeft + pRight, - height : this._itemGroupLocation.height + pTop + pBottom, - brushType : toolboxOption.borderWidth === 0 - ? 'fill' : 'both', - color : toolboxOption.backgroundColor, - strokeColor : toolboxOption.borderColor, - lineWidth : toolboxOption.borderWidth + style: { + x: this._itemGroupLocation.x - pLeft, + y: this._itemGroupLocation.y - pTop, + width: this._itemGroupLocation.width + pLeft + pRight, + height: this._itemGroupLocation.height + pTop + pBottom, + brushType: toolboxOption.borderWidth === 0 ? 'fill' : 'both', + color: toolboxOption.backgroundColor, + strokeColor: toolboxOption.borderColor, + lineWidth: toolboxOption.borderWidth } })); }, @@ -17470,7 +18814,7 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre /** * 根据选项计算图例实体的位置坐标 */ - _getItemGroupLocation : function () { + _getItemGroupLocation: function () { var toolboxOption = this.option.toolbox; var iconLength = this._iconList.length; var itemGap = toolboxOption.itemGap; @@ -17478,7 +18822,7 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre var totalWidth = 0; var totalHeight = 0; - if (toolboxOption.orient == 'horizontal') { + if (toolboxOption.orient === 'horizontal') { // 水平布局,计算总宽度,别忘减去最后一个的itemGap totalWidth = (itemSize + itemGap) * iconLength - itemGap; totalHeight = itemSize; @@ -17532,14 +18876,14 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre } return { - x : x, - y : y, - width : totalWidth, - height : totalHeight + x: x, + y: y, + width: totalWidth, + height: totalHeight }; }, - __onmousemove : function (param) { + __onmousemove: function (param) { if (this._marking) { this._markShape.style.xEnd = zrEvent.getX(param.event); this._markShape.style.yEnd = zrEvent.getY(param.event); @@ -17560,7 +18904,7 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre } }, - __onmousedown : function (param) { + __onmousedown: function (param) { if (param.target) { return; } @@ -17569,19 +18913,19 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre var y = zrEvent.getY(param.event); var zoomOption = this.option.dataZoom || {}; this._zoomShape = new RectangleShape({ - zlevel : this._zlevelBase, - style : { - x : x, - y : y, - width : 1, - height : 1, + zlevel: this._zlevelBase, + style: { + x: x, + y: y, + width: 1, + height: 1, brushType: 'both' }, - highlightStyle : { - lineWidth : 2, + highlightStyle: { + lineWidth: 2, color: zoomOption.fillerColor || ecConfig.dataZoom.fillerColor, - strokeColor : zoomOption.handleColor + strokeColor: zoomOption.handleColor || ecConfig.dataZoom.handleColor, brushType: 'both' } @@ -17590,7 +18934,7 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre return true; // 阻塞全局事件 }, - __onmouseup : function (/*param*/) { + __onmouseup: function (/*param*/) { if (!this._zoomShape || Math.abs(this._zoomShape.style.width) < 10 || Math.abs(this._zoomShape.style.height) < 10 @@ -17604,10 +18948,10 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre var zoom = this.component.dataZoom.rectZoom(this._zoomShape.style); if (zoom) { this._zoomQueue.push({ - start : zoom.start, - end : zoom.end, - start2 : zoom.start2, - end2 : zoom.end2 + start: zoom.start, + end: zoom.end, + start2: zoom.start2, + end2: zoom.end2 }); this._iconEnable(this._iconShapeMap['dataZoomReset']); this.zr.refresh(); @@ -17616,7 +18960,7 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre return true; // 阻塞全局事件 }, - __onclick : function (param) { + __onclick: function (param) { if (param.target) { return; } @@ -17633,31 +18977,31 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre var x = zrEvent.getX(param.event); var y = zrEvent.getY(param.event); this._markShape = new LineShape({ - zlevel : this._zlevelBase, - style : { - xStart : x, - yStart : y, - xEnd : x, - yEnd : y, - lineWidth : this.query( - this.option, - 'toolbox.feature.mark.lineStyle.width' - ), - strokeColor : this.query( - this.option, - 'toolbox.feature.mark.lineStyle.color' - ), - lineType : this.query( + zlevel: this._zlevelBase, + style: { + xStart: x, + yStart: y, + xEnd: x, + yEnd: y, + lineWidth: this.query( this.option, - 'toolbox.feature.mark.lineStyle.type' - ) + 'toolbox.feature.mark.lineStyle.width' + ), + strokeColor: this.query( + this.option, + 'toolbox.feature.mark.lineStyle.color' + ), + lineType: this.query( + this.option, + 'toolbox.feature.mark.lineStyle.type' + ) } }); this.zr.addHoverShape(this._markShape); } }, - __onMark : function (param) { + __onMark: function (param) { var target = param.target; if (this._marking || this._markStart) { // 取消 @@ -17681,7 +19025,7 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre return true; // 阻塞全局事件 }, - __onMarkUndo : function () { + __onMarkUndo: function () { if (this._marking) { this._marking = false; } else { @@ -17691,7 +19035,7 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre this.zr.delShape(target.id); this.zr.refresh(); this._markShapeList.pop(); - if (len == 1) { + if (len === 1) { this._iconDisable(this._iconShapeMap['markUndo']); this._iconDisable(this._iconShapeMap['markClear']); } @@ -17700,7 +19044,7 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre return true; }, - __onMarkClear : function () { + __onMarkClear: function () { if (this._marking) { this._marking = false; } @@ -17716,7 +19060,7 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre return true; }, - __onDataZoom : function (param) { + __onDataZoom: function (param) { var target = param.target; if (this._zooming || this._zoomStart) { // 取消 @@ -17744,7 +19088,7 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre return true; // 阻塞全局事件 }, - __onDataZoomReset : function () { + __onDataZoomReset: function () { if (this._zooming) { this._zooming = false; } @@ -17764,7 +19108,7 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre return true; }, - _resetMark : function () { + _resetMark: function () { this._marking = false; if (this._markStart) { this._markStart = false; @@ -17787,7 +19131,7 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre } }, - _resetZoom : function () { + _resetZoom: function () { this._zooming = false; if (this._zoomStart) { this._zoomStart = false; @@ -17811,61 +19155,61 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre } }, - _iconDisable : function (target) { + _iconDisable: function (target) { if (target.type != 'image') { this.zr.modShape(target.id, { - hoverable : false, - clickable : false, - style : { - strokeColor : this._disableColor + hoverable: false, + clickable: false, + style: { + strokeColor: this._disableColor } }); } else { this.zr.modShape(target.id, { - hoverable : false, - clickable : false, - style : { - opacity : 0.3 + hoverable: false, + clickable: false, + style: { + opacity: 0.3 } }); } }, - _iconEnable : function (target) { + _iconEnable: function (target) { if (target.type != 'image') { this.zr.modShape(target.id, { - hoverable : true, - clickable : true, - style : { - strokeColor : target.highlightStyle.strokeColor + hoverable: true, + clickable: true, + style: { + strokeColor: target.highlightStyle.strokeColor } }); } else { this.zr.modShape(target.id, { - hoverable : true, - clickable : true, - style : { - opacity : 0.8 + hoverable: true, + clickable: true, + style: { + opacity: 0.8 } }); } }, - __onDataView : function () { + __onDataView: function () { this._dataView.show(this.option); return true; }, - __onRestore : function (){ + __onRestore: function (){ this._resetMark(); this._resetZoom(); this.messageCenter.dispatch(ecConfig.EVENT.RESTORE, null, null, this.myChart); return true; }, - __onSaveAsImage : function () { + __onSaveAsImage: function () { var saveOption = this.option.toolbox.feature.saveAsImage; var imgType = saveOption.type || 'png'; if (imgType != 'png' && imgType != 'jpeg') { @@ -17877,7 +19221,7 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre image = this.zr.toDataURL( 'image/' + imgType, this.option.backgroundColor - && this.option.backgroundColor.replace(' ','') == 'rgba(0,0,0,0)' + && this.option.backgroundColor.replace(' ','') === 'rgba(0,0,0,0)' ? '#fff' : this.option.backgroundColor ); } @@ -17949,30 +19293,30 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre return; }, - __onMagicType : function (param) { + __onMagicType: function (param) { this._resetMark(); var itemName = param.target._name; if (!this._magicType[itemName]) { // 启用 this._magicType[itemName] = true; // 折柱互斥 - if (itemName == ecConfig.CHART_TYPE_LINE) { + if (itemName === ecConfig.CHART_TYPE_LINE) { this._magicType[ecConfig.CHART_TYPE_BAR] = false; } - else if (itemName == ecConfig.CHART_TYPE_BAR) { + else if (itemName === ecConfig.CHART_TYPE_BAR) { this._magicType[ecConfig.CHART_TYPE_LINE] = false; } // 堆积平铺互斥 - if (itemName == _MAGICTYPE_STACK) { + if (itemName === _MAGICTYPE_STACK) { this._magicType[_MAGICTYPE_TILED] = false; } - else if (itemName == _MAGICTYPE_TILED) { + else if (itemName === _MAGICTYPE_TILED) { this._magicType[_MAGICTYPE_STACK] = false; } this.messageCenter.dispatch( ecConfig.EVENT.MAGIC_TYPE_CHANGED, param.event, - {magicType : this._magicType}, + { magicType: this._magicType }, this.myChart ); } @@ -17980,29 +19324,29 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre return true; }, - setMagicType : function (magicType) { + setMagicType: function (magicType) { this._resetMark(); this._magicType = magicType; !this._isSilence && this.messageCenter.dispatch( ecConfig.EVENT.MAGIC_TYPE_CHANGED, null, - {magicType : this._magicType}, + { magicType: this._magicType }, this.myChart ); }, // 用户自定义扩展toolbox方法 - __onCustomHandler : function (param) { + __onCustomHandler: function (param) { var target = param.target.style.iconType; var featureHandler = this.option.toolbox.feature[target].onclick; if (typeof featureHandler === 'function') { - featureHandler(this.option); + featureHandler.call(this, this.option); } }, // 重置备份还原状态等 - reset : function (newOption, isRestore) { + reset: function (newOption, isRestore) { isRestore && this.clear(); if (this.query(newOption, 'toolbox.show') @@ -18024,15 +19368,15 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre axis = newOption.xAxis instanceof Array ? newOption.xAxis[newOption.series[len].xAxisIndex || 0] : newOption.xAxis; - if (axis && (axis.type || 'category') == 'category') { - axis.__boundaryGap = typeof axis.boundaryGap != 'undefined' + if (axis && (axis.type || 'category') === 'category') { + axis.__boundaryGap = axis.boundaryGap != null ? axis.boundaryGap : true; } axis = newOption.yAxis instanceof Array ? newOption.yAxis[newOption.series[len].yAxisIndex || 0] : newOption.yAxis; - if (axis && axis.type == 'category') { - axis.__boundaryGap = typeof axis.boundaryGap != 'undefined' + if (axis && axis.type === 'category') { + axis.__boundaryGap = axis.boundaryGap != null ? axis.boundaryGap : true; } newOption.series[len].__type = oriType; @@ -18060,11 +19404,11 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre // 框选缩放 var zoomOption = newOption.dataZoom; if (zoomOption && zoomOption.show) { - var start = typeof zoomOption.start != 'undefined' + var start = zoomOption.start != null && zoomOption.start >= 0 && zoomOption.start <= 100 ? zoomOption.start : 0; - var end = typeof zoomOption.end != 'undefined' + var end = zoomOption.end != null && zoomOption.end >= 0 && zoomOption.end <= 100 ? zoomOption.end : 100; @@ -18075,10 +19419,10 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre start = start - end; } this._zoomQueue = [{ - start : start, - end : end, - start2 : 0, - end2 : 100 + start: start, + end: end, + start2: 0, + end2: 100 }]; } else { @@ -18086,7 +19430,7 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre } }, - getMagicOption : function (){ + getMagicOption: function (){ var axis; if (this._magicType[ecConfig.CHART_TYPE_LINE] || this._magicType[ecConfig.CHART_TYPE_BAR] @@ -18106,13 +19450,13 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre axis = this.option.xAxis instanceof Array ? this.option.xAxis[this.option.series[i].xAxisIndex || 0] : this.option.xAxis; - if (axis && (axis.type || 'category') == 'category') { + if (axis && (axis.type || 'category') === 'category') { axis.boundaryGap = boundaryGap ? true : axis.__boundaryGap; } axis = this.option.yAxis instanceof Array ? this.option.yAxis[this.option.series[i].yAxisIndex || 0] : this.option.yAxis; - if (axis && axis.type == 'category') { + if (axis && axis.type === 'category') { axis.boundaryGap = boundaryGap ? true : axis.__boundaryGap; } } @@ -18136,11 +19480,11 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre return this.option; }, - silence : function (s) { + silence: function (s) { this._isSilence = s; }, - resize : function () { + resize: function () { this._resetMark(); this.clear(); if (this.option && this.option.toolbox && this.option.toolbox.show) { @@ -18151,13 +19495,13 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre } }, - hideDataView : function () { + hideDataView: function () { if (this._dataView) { this._dataView.hide(); } }, - clear : function(notMark) { + clear: function(notMark) { if (this.zr) { this.zr.delShape(this.shapeList); this.shapeList = []; @@ -18172,7 +19516,7 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre /** * 释放后实例不可用 */ - dispose : function () { + dispose: function () { if (this._dataView) { this._dataView.dispose(); this._dataView = null; @@ -18185,7 +19529,7 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre /** * 刷新 */ - refresh : function (newOption) { + refresh: function (newOption) { if (newOption) { this._resetMark(); this._resetZoom(); @@ -18247,8 +19591,8 @@ define('echarts/component/title',['require','./base','zrender/shape/Text','zrend } Title.prototype = { - type : ecConfig.COMPONENT_TYPE_TITLE, - _buildShape : function () { + type: ecConfig.COMPONENT_TYPE_TITLE, + _buildShape: function () { // 标题元素组的位置参数,通过计算所得x, y, width, height this._itemGroupLocation = this._getItemGroupLocation(); @@ -18263,7 +19607,7 @@ define('echarts/component/title',['require','./base','zrender/shape/Text','zrend /** * 构建所有标题元素 */ - _buildItem : function () { + _buildItem: function () { var text = this.titleOption.text; var link = this.titleOption.link; var target = this.titleOption.target; @@ -18279,16 +19623,16 @@ define('echarts/component/title',['require','./base','zrender/shape/Text','zrend var height = this._itemGroupLocation.height; var textShape = { - zlevel : this._zlevelBase, - style : { - y : y, - color : this.titleOption.textStyle.color, + zlevel: this._zlevelBase, + style: { + y: y, + color: this.titleOption.textStyle.color, text: text, textFont: font, textBaseline: 'top' }, highlightStyle: { - color : zrColor.lift(this.titleOption.textStyle.color, 1), + color: zrColor.lift(this.titleOption.textStyle.color, 1), brushType: 'fill' }, hoverable: false @@ -18307,16 +19651,16 @@ define('echarts/component/title',['require','./base','zrender/shape/Text','zrend } var subtextShape = { - zlevel : this._zlevelBase, - style : { - y : y + height, - color : this.titleOption.subtextStyle.color, + zlevel: this._zlevelBase, + style: { + y: y + height, + color: this.titleOption.subtextStyle.color, text: subtext, textFont: subfont, textBaseline: 'bottom' }, highlightStyle: { - color : zrColor.lift(this.titleOption.subtextStyle.color, 1), + color: zrColor.lift(this.titleOption.subtextStyle.color, 1), brushType: 'fill' }, hoverable: false @@ -18366,25 +19710,24 @@ define('echarts/component/title',['require','./base','zrender/shape/Text','zrend subtext !== '' && this.shapeList.push(new TextShape(subtextShape)); }, - _buildBackground : function () { + _buildBackground: function () { var pTop = this.titleOption.padding[0]; var pRight = this.titleOption.padding[1]; var pBottom = this.titleOption.padding[2]; var pLeft = this.titleOption.padding[3]; this.shapeList.push(new RectangleShape({ - zlevel : this._zlevelBase, + zlevel: this._zlevelBase, hoverable :false, - style : { - x : this._itemGroupLocation.x - pLeft, - y : this._itemGroupLocation.y - pTop, - width : this._itemGroupLocation.width + pLeft + pRight, - height : this._itemGroupLocation.height + pTop + pBottom, - brushType : this.titleOption.borderWidth === 0 - ? 'fill' : 'both', - color : this.titleOption.backgroundColor, - strokeColor : this.titleOption.borderColor, - lineWidth : this.titleOption.borderWidth + style: { + x: this._itemGroupLocation.x - pLeft, + y: this._itemGroupLocation.y - pTop, + width: this._itemGroupLocation.width + pLeft + pRight, + height: this._itemGroupLocation.height + pTop + pBottom, + brushType: this.titleOption.borderWidth === 0 ? 'fill' : 'both', + color: this.titleOption.backgroundColor, + strokeColor: this.titleOption.borderColor, + lineWidth: this.titleOption.borderWidth } })); }, @@ -18392,7 +19735,7 @@ define('echarts/component/title',['require','./base','zrender/shape/Text','zrend /** * 根据选项计算标题实体的位置坐标 */ - _getItemGroupLocation : function () { + _getItemGroupLocation: function () { var text = this.titleOption.text; var subtext = this.titleOption.subtext; var font = this.getFont(this.titleOption.textStyle); @@ -18452,17 +19795,17 @@ define('echarts/component/title',['require','./base','zrender/shape/Text','zrend } return { - x : x, - y : y, - width : totalWidth, - height : totalHeight + x: x, + y: y, + width: totalWidth, + height: totalHeight }; }, /** * 刷新 */ - refresh : function (newOption) { + refresh: function (newOption) { if (newOption) { this.option = newOption; @@ -18647,7 +19990,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr this._axisLineShape && this.zr.delShape(this._axisLineShape.id); this._axisLineShape = new LineShape({ zlevel: this._zlevelBase, - invisible : true, + invisible: true, hoverable: false }); this.shapeList.push(this._axisLineShape); @@ -18656,7 +19999,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr this._axisShadowShape && this.zr.delShape(this._axisShadowShape.id); this._axisShadowShape = new LineShape({ zlevel: 1, // grid上,chart下 - invisible : true, + invisible: true, hoverable: false }); this.shapeList.push(this._axisShadowShape); @@ -18665,7 +20008,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr this._axisCrossShape && this.zr.delShape(this._axisCrossShape.id); this._axisCrossShape = new CrossShape({ zlevel: this._zlevelBase, - invisible : true, + invisible: true, hoverable: false }); this.shapeList.push(this._axisCrossShape); @@ -18676,16 +20019,13 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr } Tooltip.prototype = { - type : ecConfig.COMPONENT_TYPE_TOOLTIP, + type: ecConfig.COMPONENT_TYPE_TOOLTIP, // 通用样式 - _gCssText : 'position:absolute;' - + 'display:block;' - + 'border-style:solid;' - + 'white-space:nowrap;', + _gCssText: 'position:absolute;display:block;border-style:solid;white-space:nowrap;', /** * 根据配置设置dom样式 */ - _style : function (opt) { + _style: function (opt) { if (!opt) { return ''; } @@ -18718,15 +20058,15 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr cssText.push('background-Color:' + opt.backgroundColor); } - if (typeof opt.borderWidth != 'undefined') { + if (opt.borderWidth != null) { cssText.push('border-width:' + opt.borderWidth + 'px'); } - if (typeof opt.borderColor != 'undefined') { + if (opt.borderColor != null) { cssText.push('border-color:' + opt.borderColor); } - if (typeof opt.borderRadius != 'undefined') { + if (opt.borderRadius != null) { cssText.push( 'border-radius:' + opt.borderRadius + 'px' ); @@ -18769,7 +20109,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr var padding = opt.padding; - if (typeof padding != 'undefined') { + if (padding != null) { padding = this.reformCssArray(padding); cssText.push( 'padding:' + padding[0] + 'px ' @@ -18784,7 +20124,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr return cssText; }, - __hide : function () { + __hide: function () { if (this._tDom) { this._tDom.style.display = 'none'; } @@ -18813,11 +20153,11 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr this.showing = false; }, - _show : function (position, x, y, specialCssText) { + _show: function (position, x, y, specialCssText) { var domHeight = this._tDom.offsetHeight; var domWidth = this._tDom.offsetWidth; if (position) { - if (typeof position == 'function') { + if (typeof position === 'function') { position = position([x, y]); } if (position instanceof Array) { @@ -18850,7 +20190,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr this.showing = true; }, - __refixed : function () { + __refixed: function () { if (this._tDom) { var cssText = ''; var domHeight = this._tDom.offsetHeight; @@ -18867,7 +20207,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr } }, - __tryShow : function () { + __tryShow: function () { var needShow; var trigger; if (!this._curTarget) { @@ -18876,7 +20216,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr } else { // 数据项事件 - if (this._curTarget._type == 'island' && this.option.tooltip.show) { + if (this._curTarget._type === 'island' && this.option.tooltip.show) { this._showItemTrigger(); return; } @@ -18886,10 +20226,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr [data, serie, this.option], 'tooltip.show' ); - if (typeof serie == 'undefined' - || typeof data == 'undefined' - || needShow === false - ) { + if (serie == null || data == null || !needShow) { // 不响应tooltip的数据对象延时隐藏 clearTimeout(this._hidingTicket); clearTimeout(this._showingTicket); @@ -18901,7 +20238,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr 'tooltip.trigger' ); - trigger == 'axis' + trigger === 'axis' ? this._showAxisTrigger( serie.xAxisIndex, serie.yAxisIndex, ecData.get(this._curTarget, 'dataIndex') @@ -18914,7 +20251,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr /** * 直角系 */ - _findAxisTrigger : function () { + _findAxisTrigger: function () { if (!this.component.xAxis || !this.component.yAxis) { this._hidingTicket = setTimeout(this._hide, this._hideDelay); return; @@ -18924,15 +20261,12 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr var yAxisIndex; for (var i = 0, l = series.length; i < l; i++) { // 找到第一个axis触发tooltip的系列 - if (this.deepQuery( - [series[i], this.option], 'tooltip.trigger' - ) == 'axis' - ) { + if (this.deepQuery([series[i], this.option], 'tooltip.trigger') === 'axis') { xAxisIndex = series[i].xAxisIndex || 0; yAxisIndex = series[i].yAxisIndex || 0; if (this.component.xAxis.getAxis(xAxisIndex) && this.component.xAxis.getAxis(xAxisIndex).type - == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY ) { // 横轴为类目轴 this._showAxisTrigger(xAxisIndex, yAxisIndex, @@ -18944,7 +20278,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr } else if (this.component.yAxis.getAxis(yAxisIndex) && this.component.yAxis.getAxis(yAxisIndex).type - == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY ) { // 纵轴为类目轴 this._showAxisTrigger(xAxisIndex, yAxisIndex, @@ -18961,7 +20295,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr } } } - if (this.option.tooltip.axisPointer.type == 'cross') { + if (this.option.tooltip.axisPointer.type === 'cross') { this._showAxisTrigger(-1, -1, -1); } }, @@ -18969,7 +20303,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr /** * 极坐标 */ - _findPolarTrigger : function () { + _findPolarTrigger: function () { if (!this.component.polar) { return false; } @@ -18995,34 +20329,35 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr /** * 根据坐标轴事件带的属性获取最近的axisDataIndex */ - _getNearestDataIndex : function (direction, categoryAxis) { + _getNearestDataIndex: function (direction, categoryAxis) { var dataIndex = -1; var x = zrEvent.getX(this._event); var y = zrEvent.getY(this._event); - if (direction == 'x') { + if (direction === 'x') { // 横轴为类目轴 var left; var right; var xEnd = this.component.grid.getXend(); var curCoord = categoryAxis.getCoordByIndex(dataIndex); while (curCoord < xEnd) { + right = curCoord; if (curCoord <= x) { left = curCoord; } - if (curCoord >= x) { + else { break; } curCoord = categoryAxis.getCoordByIndex(++dataIndex); - right = curCoord; } - if (x - left < right - x) { - dataIndex -= dataIndex !== 0 ? 1 : 0; + if (dataIndex <= 0) { + dataIndex = 0; + } + else if (x - left <= right - x) { + dataIndex -= 1; } else { // 离右边近,看是否为最后一个 - if (typeof categoryAxis.getNameByIndex(dataIndex) - == 'undefined' - ) { + if (categoryAxis.getNameByIndex(dataIndex) == null) { dataIndex -= 1; } } @@ -19035,24 +20370,25 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr var yStart = this.component.grid.getY(); var curCoord = categoryAxis.getCoordByIndex(dataIndex); while (curCoord > yStart) { + top = curCoord; if (curCoord >= y) { bottom = curCoord; } - if (curCoord <= y) { + else { break; } curCoord = categoryAxis.getCoordByIndex(++dataIndex); - top = curCoord; } - if (y - top > bottom - y) { - dataIndex -= dataIndex !== 0 ? 1 : 0; + if (dataIndex <= 0) { + dataIndex = 0; + } + else if (y - top >= bottom - y) { + dataIndex -= 1; } else { // 离上方边近,看是否为最后一个 - if (typeof categoryAxis.getNameByIndex(dataIndex) - == 'undefined' - ) { + if (categoryAxis.getNameByIndex(dataIndex) == null) { dataIndex -= 1; } } @@ -19064,17 +20400,17 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr /** * 直角系 */ - _showAxisTrigger : function (xAxisIndex, yAxisIndex, dataIndex) { + _showAxisTrigger: function (xAxisIndex, yAxisIndex, dataIndex) { !this._event.connectTrigger && this.messageCenter.dispatch( ecConfig.EVENT.TOOLTIP_IN_GRID, this._event, null, this.myChart ); - if (typeof this.component.xAxis == 'undefined' - || typeof this.component.yAxis == 'undefined' - || typeof xAxisIndex == 'undefined' - || typeof yAxisIndex == 'undefined' + if (this.component.xAxis == null + || this.component.yAxis == null + || xAxisIndex == null + || yAxisIndex == null // || dataIndex < 0 ) { // 不响应tooltip的数据对象延时隐藏 @@ -19094,8 +20430,8 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr var position; var showContent; var specialCssText = ''; - if (this.option.tooltip.trigger == 'axis') { - if (this.option.tooltip.show === false) { + if (this.option.tooltip.trigger === 'axis') { + if (!this.option.tooltip.show) { return; } formatter = this.option.tooltip.formatter; @@ -19104,7 +20440,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr if (xAxisIndex != -1 && this.component.xAxis.getAxis(xAxisIndex).type - == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY ) { // 横轴为类目轴,找到所有用这条横轴并且axis触发的系列数据 categoryAxis = this.component.xAxis.getAxis(xAxisIndex); @@ -19112,8 +20448,8 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr if (!this._isSelected(series[i].name)) { continue; } - if (series[i].xAxisIndex == xAxisIndex - && this.deepQuery([series[i], this.option], 'tooltip.trigger') == 'axis' + if (series[i].xAxisIndex === xAxisIndex + && this.deepQuery([series[i], this.option], 'tooltip.trigger') === 'axis' ) { showContent = this.query(series[i], 'tooltip.showContent') || showContent; @@ -19123,17 +20459,24 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr || position; specialCssText += this._style(this.query(series[i], 'tooltip')); - seriesArray.push(series[i]); - seriesIndex.push(i); + if (series[i].stack != null) { + seriesArray.unshift(series[i]); + seriesIndex.unshift(i); + } + else { + seriesArray.push(series[i]); + seriesIndex.push(i); + } } } + // 寻找高亮元素 this.messageCenter.dispatch( ecConfig.EVENT.TOOLTIP_HOVER, this._event, { - seriesIndex : seriesIndex, - dataIndex : dataIndex + seriesIndex: seriesIndex, + dataIndex: dataIndex }, this.myChart ); @@ -19151,7 +20494,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr } else if (yAxisIndex != -1 && this.component.yAxis.getAxis(yAxisIndex).type - == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY ) { // 纵轴为类目轴,找到所有用这条纵轴并且axis触发的系列数据 categoryAxis = this.component.yAxis.getAxis(yAxisIndex); @@ -19159,8 +20502,8 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr if (!this._isSelected(series[i].name)) { continue; } - if (series[i].yAxisIndex == yAxisIndex - && this.deepQuery([series[i], this.option], 'tooltip.trigger') == 'axis' + if (series[i].yAxisIndex === yAxisIndex + && this.deepQuery([series[i], this.option], 'tooltip.trigger') === 'axis' ) { showContent = this.query(series[i], 'tooltip.showContent') || showContent; @@ -19178,8 +20521,8 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr ecConfig.EVENT.TOOLTIP_HOVER, this._event, { - seriesIndex : seriesIndex, - dataIndex : dataIndex + seriesIndex: seriesIndex, + dataIndex: dataIndex }, this.myChart ); @@ -19217,12 +20560,12 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr if (seriesArray.length > 0) { var data; - if (typeof formatter == 'function') { + if (typeof formatter === 'function') { var params = []; for (var i = 0, l = seriesArray.length; i < l; i++) { data = seriesArray[i].data[dataIndex]; - data = typeof data != 'undefined' - ? (typeof data.value != 'undefined' + data = data != null + ? (data.value != null ? data.value : data) : '-'; @@ -19238,7 +20581,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr this.myChart, params, this._curTicket, this._setContent ); } - else if (typeof formatter == 'string') { + else if (typeof formatter === 'string') { this._curTicket = NaN; formatter = formatter.replace('{a}','{a0}') .replace('{b}','{b0}') @@ -19253,8 +20596,8 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr this._encodeHTML(categoryAxis.getNameByIndex(dataIndex)) ); data = seriesArray[i].data[dataIndex]; - data = typeof data != 'undefined' - ? (typeof data.value != 'undefined' + data = data != null + ? (data.value != null ? data.value : data) : '-'; @@ -19277,8 +20620,8 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr + this._encodeHTML(seriesArray[i].name || '') + ' : '; data = seriesArray[i].data[dataIndex]; - data = typeof data != 'undefined' - ? (typeof data.value != 'undefined' + data = data != null + ? (data.value != null ? data.value : data) : '-'; @@ -19288,6 +20631,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr this._tDom.innerHTML = formatter; } + // don't modify, just false, showContent == undefined == true if (showContent === false || !this.option.tooltip.showContent) { // 只用tooltip的行为,不显示主体 return; @@ -19306,10 +20650,10 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr /** * 极坐标 */ - _showPolarTrigger : function (polarIndex, dataIndex) { - if (typeof this.component.polar == 'undefined' - || typeof polarIndex == 'undefined' - || typeof dataIndex == 'undefined' + _showPolarTrigger: function (polarIndex, dataIndex) { + if (this.component.polar == null + || polarIndex == null + || dataIndex == null || dataIndex < 0 ) { return false; @@ -19321,8 +20665,8 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr var position; var showContent; var specialCssText = ''; - if (this.option.tooltip.trigger == 'axis') { - if (this.option.tooltip.show === false) { + if (this.option.tooltip.trigger === 'axis') { + if (!this.option.tooltip.show) { return false; } formatter = this.option.tooltip.formatter; @@ -19335,8 +20679,8 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr if (!this._isSelected(series[i].name)) { continue; } - if (series[i].polarIndex == polarIndex - && this.deepQuery([series[i], this.option], 'tooltip.trigger') == 'axis' + if (series[i].polarIndex === polarIndex + && this.deepQuery([series[i], this.option], 'tooltip.trigger') === 'axis' ) { showContent = this.query(series[i], 'tooltip.showContent') || showContent; @@ -19360,14 +20704,14 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr if (!this._isSelected(data.name)) { continue; } - data = typeof data != 'undefined' + data = data != null ? data : {name:'', value: {dataIndex:'-'}}; params.push([ seriesArray[i].name || '', data.name, - typeof data.value[dataIndex].value != 'undefined' + data.value[dataIndex].value != null ? data.value[dataIndex].value : data.value[dataIndex], indicatorName ]); @@ -19376,13 +20720,13 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr if (params.length <= 0) { return; } - if (typeof formatter == 'function') { + if (typeof formatter === 'function') { this._curTicket = 'axis:' + dataIndex; this._tDom.innerHTML = formatter.call( this.myChart, params, this._curTicket, this._setContent ); } - else if (typeof formatter == 'string') { + else if (typeof formatter === 'string') { formatter = formatter.replace('{a}','{a0}') .replace('{b}','{b0}') .replace('{c}','{c0}') @@ -19420,6 +20764,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr this._tDom.innerHTML = formatter; } + // don't modify, just false, showContent == undefined == true if (showContent === false || !this.option.tooltip.showContent) { // 只用tooltip的行为,不显示主体 return; @@ -19441,7 +20786,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr } }, - _showItemTrigger : function () { + _showItemTrigger: function () { if (!this._curTarget) { return; } @@ -19460,12 +20805,12 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr var html = ''; if (this._curTarget._type != 'island') { // 全局 - if (this.option.tooltip.trigger == 'item') { + if (this.option.tooltip.trigger === 'item') { formatter = this.option.tooltip.formatter; position = this.option.tooltip.position; } // 系列 - if (this.query(serie, 'tooltip.trigger') == 'item') { + if (this.query(serie, 'tooltip.trigger') === 'item') { showContent = this.query(serie, 'tooltip.showContent') || showContent; formatter = this.query(serie, 'tooltip.formatter') @@ -19489,7 +20834,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr position = this.deepQuery([data, serie, this.option], 'tooltip.islandPosition'); } - if (typeof formatter == 'function') { + if (typeof formatter === 'function') { this._curTicket = (serie.name || '') + ':' + ecData.get(this._curTarget, 'dataIndex'); @@ -19507,7 +20852,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr this._setContent ); } - else if (typeof formatter == 'string') { + else if (typeof formatter === 'string') { this._curTicket = NaN; formatter = formatter.replace('{a}','{a0}') .replace('{b}','{b0}') @@ -19528,18 +20873,14 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr } else { this._curTicket = NaN; - if (serie.type == ecConfig.CHART_TYPE_SCATTER) { - this._tDom.innerHTML = (typeof serie.name != 'undefined' - ? (this._encodeHTML(serie.name) + '
') - : '' - ) - + (name === '' ? '' : (this._encodeHTML(name) + ' : ')) - + value - + (typeof special == 'undefined' - ? '' : (' (' + special + ')') - ); - } - else if (serie.type == ecConfig.CHART_TYPE_RADAR && special) { + if (serie.type === ecConfig.CHART_TYPE_SCATTER) { + this._tDom.innerHTML = '' + + (serie.name != null ? (this._encodeHTML(serie.name) + '
') : '') + + (name === '' ? '' : (this._encodeHTML(name) + ' : ')) + + value + + (special == null ? '' : (' (' + special + ')')); + } + else if (serie.type === ecConfig.CHART_TYPE_RADAR && special) { indicator = special; html += this._encodeHTML(name === '' ? (serie.name || '') : name); html += html === '' ? '' : '
'; @@ -19549,8 +20890,8 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr } this._tDom.innerHTML = html; } - else if (serie.type == ecConfig.CHART_TYPE_CHORD) { - if (typeof special2 == 'undefined') { + else if (serie.type === ecConfig.CHART_TYPE_CHORD) { + if (special2 == null) { // 外环上 this._tDom.innerHTML = this._encodeHTML(name) + ' (' + this.numAddCommas(value) + ')'; @@ -19559,25 +20900,21 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr var name1 = this._encodeHTML(name); var name2 = this._encodeHTML(special); // 内部弦上 - this._tDom.innerHTML = (typeof serie.name != 'undefined' - ? (this._encodeHTML(serie.name) + '
') : '' - ) - + name1 + ' -> ' + name2 - + ' (' + this.numAddCommas(value) + ')' - + '
' - + name2 + ' -> ' + name1 - + ' (' + this.numAddCommas(special2) + ')'; + this._tDom.innerHTML = '' + + (serie.name != null ? (this._encodeHTML(serie.name) + '
') : '') + + name1 + ' -> ' + name2 + + ' (' + this.numAddCommas(value) + ')' + + '
' + + name2 + ' -> ' + name1 + + ' (' + this.numAddCommas(special2) + ')'; } } else { - this._tDom.innerHTML = (typeof serie.name != 'undefined' - ? (this._encodeHTML(serie.name) + '
') : '' - ) - + this._encodeHTML(name) + ' : ' - + this.numAddCommas(value) + - (typeof special == 'undefined' - ? '' : (' ('+ this.numAddCommas(special) +')') - ); + this._tDom.innerHTML = '' + + (serie.name != null ? (this._encodeHTML(serie.name) + '
') : '') + + this._encodeHTML(name) + ' : ' + + this.numAddCommas(value) + + (special == null ? '' : (' ('+ this.numAddCommas(special) +')')); } } @@ -19591,6 +20928,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr this.zr.refresh(); } + // don't modify, just false, showContent == undefined == true if (showContent === false || !this.option.tooltip.showContent) { // 只用tooltip的行为,不显示主体 return; @@ -19614,16 +20952,16 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr /** * 设置坐标轴指示器样式 */ - _styleAxisPointer : function (seriesArray, xStart, yStart, xEnd, yEnd, gap, x, y) { + _styleAxisPointer: function (seriesArray, xStart, yStart, xEnd, yEnd, gap, x, y) { if (seriesArray.length > 0) { var queryTarget; var curType; var axisPointer = this.option.tooltip.axisPointer; var pointType = axisPointer.type; var style = { - line : {}, - cross : {}, - shadow : {} + line: { }, + cross: { }, + shadow: { } }; for (var pType in style) { style[pType].color = axisPointer[pType + 'Style'].color; @@ -19633,7 +20971,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr for (var i = 0, l = seriesArray.length; i < l; i++) { if (this.deepQuery( [seriesArray[i], this.option], 'tooltip.trigger' - ) == 'axis' + ) === 'axis' ) { queryTarget = seriesArray[i]; curType = this.query(queryTarget, 'tooltip.axisPointer.type'); @@ -19655,35 +20993,35 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr } } - if (pointType == 'line') { + if (pointType === 'line') { this._axisLineShape.style = { - xStart : xStart, - yStart : yStart, - xEnd : xEnd, - yEnd : yEnd, - strokeColor : style.line.color, - lineWidth : style.line.width, - lineType : style.line.type + xStart: xStart, + yStart: yStart, + xEnd: xEnd, + yEnd: yEnd, + strokeColor: style.line.color, + lineWidth: style.line.width, + lineType: style.line.type }; this._axisLineShape.invisible = false; this.zr.modShape(this._axisLineShape.id); } - else if (pointType == 'cross') { + else if (pointType === 'cross') { this._axisCrossShape.style = { brushType: 'stroke', - rect : this.component.grid.getArea(), - x : x, - y : y, - text : ('( ' + rect: this.component.grid.getArea(), + x: x, + y: y, + text: ('( ' + this.component.xAxis.getAxis(0).getValueFromCoord(x) + ' , ' + this.component.yAxis.getAxis(0).getValueFromCoord(y) + ' )' - ).replace(' , ', ' ').replace(' , ', ' '), - textPosition : 'specific', - strokeColor : style.cross.color, - lineWidth : style.cross.width, - lineType : style.cross.type + ).replace(' , ', ' ').replace(' , ', ' '), + textPosition: 'specific', + strokeColor: style.cross.color, + lineWidth: style.cross.width, + lineType: style.cross.type }; if (this.component.grid.getXend() - x > 100) { // 右侧有空间 this._axisCrossShape.style.textAlign = 'left'; @@ -19704,14 +21042,14 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr this._axisCrossShape.invisible = false; this.zr.modShape(this._axisCrossShape.id); } - else if (pointType == 'shadow') { - if (typeof style.shadow.width == 'undefined' - || style.shadow.width == 'auto' + else if (pointType === 'shadow') { + if (style.shadow.width == null + || style.shadow.width === 'auto' || isNaN(style.shadow.width) ) { style.shadow.width = gap; } - if (xStart == xEnd) { + if (xStart === xEnd) { // 纵向 if (Math.abs(this.component.grid.getX() - xStart) < 2) { // 最左边 @@ -19724,7 +21062,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr xStart = xEnd = xEnd - style.shadow.width / 2; } } - else if (yStart == yEnd) { + else if (yStart === yEnd) { // 横向 if (Math.abs(this.component.grid.getY() - yStart) < 2) { // 最上边 @@ -19738,12 +21076,12 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr } } this._axisShadowShape.style = { - xStart : xStart, - yStart : yStart, - xEnd : xEnd, - yEnd : yEnd, - strokeColor : style.shadow.color, - lineWidth : style.shadow.width + xStart: xStart, + yStart: yStart, + xEnd: xEnd, + yEnd: yEnd, + strokeColor: style.shadow.color, + lineWidth: style.shadow.width }; this._axisShadowShape.invisible = false; this.zr.modShape(this._axisShadowShape.id); @@ -19752,7 +21090,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr } }, - __onmousemove : function (param) { + __onmousemove: function (param) { clearTimeout(this._hidingTicket); clearTimeout(this._showingTicket); var target = param.target; @@ -19801,10 +21139,10 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr // 看用这个polar的系列数据是否是axis触发,如果是设置_curTarget为nul var series = this.option.series; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].polarIndex == polarIndex + if (series[i].polarIndex === polarIndex && this.deepQuery( [series[i], this.option], 'tooltip.trigger' - ) == 'axis' + ) === 'axis' ) { this._curTarget = null; break; @@ -19819,7 +21157,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr /** * zrender事件响应:鼠标离开绘图区域 */ - __onglobalout : function () { + __onglobalout: function () { clearTimeout(this._hidingTicket); clearTimeout(this._showingTicket); this._hidingTicket = setTimeout(this._hide, this._hideDelay); @@ -19828,18 +21166,18 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr /** * 异步回调填充内容 */ - __setContent : function (ticket, content) { + __setContent: function (ticket, content) { if (!this._tDom) { return; } - if (ticket == this._curTicket) { + if (ticket === this._curTicket) { this._tDom.innerHTML = content; } setTimeout(this._refixed, 20); }, - ontooltipHover : function (param, tipShape) { + ontooltipHover: function (param, tipShape) { if (!this._lastTipShape // 不存在或者存在但dataIndex发生变化才需要重绘 || (this._lastTipShape && this._lastTipShape.dataIndex != param.dataIndex) ) { @@ -19863,24 +21201,24 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr this.zr.addShape(tipShape[i]); } this._lastTipShape = { - dataIndex : param.dataIndex, - tipShape : tipShape + dataIndex: param.dataIndex, + tipShape: tipShape }; } }, - ondragend : function () { + ondragend: function () { this._hide(); }, /** * 图例选择 */ - onlegendSelected : function (param) { + onlegendSelected: function (param) { this._selectedMap = param.selected; }, - _setSelectedMap : function () { + _setSelectedMap: function () { if (this.component.legend) { this._selectedMap = zrUtil.clone(this.component.legend.getSelectedMap()); } @@ -19889,8 +21227,8 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr } }, - _isSelected : function (itemName) { - if (typeof this._selectedMap[itemName] != 'undefined') { + _isSelected: function (itemName) { + if (this._selectedMap[itemName] != null) { return this._selectedMap[itemName]; } else { @@ -19904,20 +21242,20 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr * {seriesIndex: 0, seriesName:'', dataInex:0} line、bar、scatter、k、radar * {seriesIndex: 0, seriesName:'', name:''} map、pie、chord */ - showTip : function (params) { + showTip: function (params) { if (!params) { return; } var seriesIndex; var series = this.option.series; - if (typeof params.seriesIndex != 'undefined') { + if (params.seriesIndex != null) { seriesIndex = params.seriesIndex; } else { var seriesName = params.seriesName; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].name == seriesName) { + if (series[i].name === seriesName) { seriesIndex = i; break; } @@ -19925,13 +21263,13 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr } var serie = series[seriesIndex]; - if (typeof serie == 'undefined') { + if (serie == null) { return; } var chart = this.myChart.chart[serie.type]; var isAxisTrigger = this.deepQuery( [serie, this.option], 'tooltip.trigger' - ) == 'axis'; + ) === 'axis'; if (!chart) { return; @@ -19944,8 +21282,8 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr case ecConfig.CHART_TYPE_LINE : case ecConfig.CHART_TYPE_BAR : case ecConfig.CHART_TYPE_K : - if (typeof this.component.xAxis == 'undefined' - || typeof this.component.yAxis == 'undefined' + if (this.component.xAxis == null + || this.component.yAxis == null || serie.data.length <= dataIndex ) { return; @@ -19953,26 +21291,26 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr var xAxisIndex = serie.xAxisIndex || 0; var yAxisIndex = serie.yAxisIndex || 0; if (this.component.xAxis.getAxis(xAxisIndex).type - == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY ) { // 横轴是类目 this._event = { - zrenderX : this.component.xAxis.getAxis(xAxisIndex) - .getCoordByIndex(dataIndex), - zrenderY : this.component.grid.getY() - + (this.component.grid.getYend() - - this.component.grid.getY() - ) / 4 + zrenderX: this.component.xAxis.getAxis(xAxisIndex) + .getCoordByIndex(dataIndex), + zrenderY: this.component.grid.getY() + + (this.component.grid.getYend() + - this.component.grid.getY() + ) / 4 }; } else { // 纵轴是类目 this._event = { - zrenderX : this.component.grid.getX() - + (this.component.grid.getXend() + zrenderX: this.component.grid.getX() + + (this.component.grid.getXend() - this.component.grid.getX() - ) / 4, - zrenderY : this.component.yAxis.getAxis(yAxisIndex) + ) / 4, + zrenderY: this.component.yAxis.getAxis(yAxisIndex) .getCoordByIndex(dataIndex) }; } @@ -19983,7 +21321,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr ); break; case ecConfig.CHART_TYPE_RADAR : - if (typeof this.component.polar == 'undefined' + if (this.component.polar == null || serie.data[0].value.length <= dataIndex ) { return; @@ -19993,8 +21331,8 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr polarIndex, dataIndex, 'max' ); this._event = { - zrenderX : vector[0], - zrenderY : vector[1] + zrenderX: vector[0], + zrenderY: vector[1] }; this._showPolarTrigger( polarIndex, @@ -20015,8 +21353,8 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr case ecConfig.CHART_TYPE_SCATTER : var dataIndex = params.dataIndex; for (var i = 0, l = shapeList.length; i < l; i++) { - if (ecData.get(shapeList[i], 'seriesIndex') == seriesIndex - && ecData.get(shapeList[i], 'dataIndex') == dataIndex + if (ecData.get(shapeList[i], 'seriesIndex') === seriesIndex + && ecData.get(shapeList[i], 'dataIndex') === dataIndex ) { this._curTarget = shapeList[i]; x = shapeList[i].style.x; @@ -20029,9 +21367,9 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr case ecConfig.CHART_TYPE_RADAR : var dataIndex = params.dataIndex; for (var i = 0, l = shapeList.length; i < l; i++) { - if (shapeList[i].type == 'polygon' - && ecData.get(shapeList[i], 'seriesIndex') == seriesIndex - && ecData.get(shapeList[i], 'dataIndex') == dataIndex + if (shapeList[i].type === 'polygon' + && ecData.get(shapeList[i], 'seriesIndex') === seriesIndex + && ecData.get(shapeList[i], 'dataIndex') === dataIndex ) { this._curTarget = shapeList[i]; var vector = this.component.polar.getCenter( @@ -20046,9 +21384,9 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr case ecConfig.CHART_TYPE_PIE : var name = params.name; for (var i = 0, l = shapeList.length; i < l; i++) { - if (shapeList[i].type == 'sector' - && ecData.get(shapeList[i], 'seriesIndex') == seriesIndex - && ecData.get(shapeList[i], 'name') == name + if (shapeList[i].type === 'sector' + && ecData.get(shapeList[i], 'seriesIndex') === seriesIndex + && ecData.get(shapeList[i], 'name') === name ) { this._curTarget = shapeList[i]; var style = this._curTarget.style; @@ -20064,9 +21402,9 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr var name = params.name; var mapType = serie.mapType; for (var i = 0, l = shapeList.length; i < l; i++) { - if (shapeList[i].type == 'text' - && shapeList[i]._mapType == mapType - && shapeList[i].style._name == name + if (shapeList[i].type === 'text' + && shapeList[i]._mapType === mapType + && shapeList[i].style._name === name ) { this._curTarget = shapeList[i]; x = this._curTarget.style.x + this._curTarget.position[0]; @@ -20078,8 +21416,8 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr case ecConfig.CHART_TYPE_CHORD: var name = params.name; for (var i = 0, l = shapeList.length; i < l; i++) { - if (shapeList[i].type == 'sector' - && ecData.get(shapeList[i], 'name') == name + if (shapeList[i].type === 'sector' + && ecData.get(shapeList[i], 'name') === name ) { this._curTarget = shapeList[i]; var style = this._curTarget.style; @@ -20090,8 +21428,8 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr this.zr.trigger( zrConfig.EVENT.MOUSEMOVE, { - zrenderX : x, - zrenderY : y + zrenderX: x, + zrenderY: y } ); return; @@ -20101,8 +21439,8 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr case ecConfig.CHART_TYPE_FORCE: var name = params.name; for (var i = 0, l = shapeList.length; i < l; i++) { - if (shapeList[i].type == 'circle' - && ecData.get(shapeList[i], 'name') == name + if (shapeList[i].type === 'circle' + && ecData.get(shapeList[i], 'name') === name ) { this._curTarget = shapeList[i]; x = this._curTarget.position[0]; @@ -20112,10 +21450,10 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr } break; } - if (typeof x != 'undefined' && typeof y != 'undefined') { + if (x != null && y != null) { this._event = { - zrenderX : x, - zrenderY : y + zrenderX: x, + zrenderY: y }; this.zr.addHoverShape(this._curTarget); this.zr.refreshHover(); @@ -20127,14 +21465,14 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr /** * 关闭,公开接口 */ - hideTip : function () { + hideTip: function () { this._hide(); }, /** * 刷新 */ - refresh : function (newOption) { + refresh: function (newOption) { // this._selectedMap; // this._defaultCssText; // css样式缓存 // this._needAxisTrigger; // 坐标轴触发 @@ -20165,13 +21503,13 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr ); this._needAxisTrigger = false; - if (this.option.tooltip.trigger == 'axis') { + if (this.option.tooltip.trigger === 'axis') { this._needAxisTrigger = true; } var series = this.option.series; for (var i = 0, l = series.length; i < l; i++) { - if (this.query(series[i], 'tooltip.trigger') == 'axis') { + if (this.query(series[i], 'tooltip.trigger') === 'axis') { this._needAxisTrigger = true; break; } @@ -20186,14 +21524,17 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr this._axisLineWidth = this.option.tooltip.axisPointer.lineStyle.width; } if (this.showing) { - this._tryShow(); + var self = this; + setTimeout(function(){ + self.zr.trigger(zrConfig.EVENT.MOUSEMOVE, self.zr.handler._event); + },50); } }, /** * 释放后实例不可用,重载基类方法 */ - dispose : function () { + dispose: function () { if (this._lastTipShape && this._lastTipShape.tipShape.length > 0) { this.zr.delShape(this._lastTipShape.tipShape); } @@ -20214,7 +21555,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr /** * html转码的方法 */ - _encodeHTML : function (source) { + _encodeHTML: function (source) { return String(source) .replace(/&/g, '&') .replace(/= zrWidth - lastX ) { lastX = this._itemGroupLocation.x; @@ -20839,10 +22157,11 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren if (zrHeight - lastY < 200 // 最后200px做分行预判 && (itemHeight // 分行的最后一个不用算itemGap - + (i == dataLength - 1 || data[i+1] === '' ? 0 : itemGap) - ) >= zrHeight - lastY + + (i === dataLength - 1 || data[i + 1] === '' ? 0 : itemGap) + ) + >= zrHeight - lastY ) { - this.legendOption.x == 'right' + this.legendOption.x === 'right' ? lastX -= this._itemGroupLocation.maxWidth + itemGap : lastX += this._itemGroupLocation.maxWidth + itemGap; lastY = this._itemGroupLocation.y; @@ -20862,28 +22181,28 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren // 文字 textShape = { - // shape : 'text', - zlevel : this._zlevelBase, - style : { - x : lastX + itemWidth + 5, - y : lastY + itemHeight / 2, - color : this._selectedMap[itemName] + // shape: 'text', + zlevel: this._zlevelBase, + style: { + x: lastX + itemWidth + 5, + y: lastY + itemHeight / 2, + color: this._selectedMap[itemName] ? (dataTextStyle.color === 'auto' ? color : dataTextStyle.color) : '#ccc', text: formattedName, textFont: dataFont, textBaseline: 'middle' }, - highlightStyle : { - color : color, + highlightStyle: { + color: color, brushType: 'fill' }, - hoverable : !!this.legendOption.selectedMode, - clickable : !!this.legendOption.selectedMode + hoverable: !!this.legendOption.selectedMode, + clickable: !!this.legendOption.selectedMode }; - if (this.legendOption.orient == 'vertical' - && this.legendOption.x == 'right' + if (this.legendOption.orient === 'vertical' + && this.legendOption.x === 'right' ) { textShape.style.x -= (itemWidth + 10); textShape.style.textAlign = 'right'; @@ -20901,7 +22220,7 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren this.shapeList.push(itemShape); this.shapeList.push(textShape); - if (this.legendOption.orient == 'horizontal') { + if (this.legendOption.orient === 'horizontal') { lastX += itemWidth + 5 + zrArea.getTextWidth(formattedName, dataFont) + itemGap; @@ -20911,8 +22230,8 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren } } - if (this.legendOption.orient == 'horizontal' - && this.legendOption.x == 'center' + if (this.legendOption.orient === 'horizontal' + && this.legendOption.x === 'center' && lastY != this._itemGroupLocation.y ) { // 多行橫排居中优化 @@ -20920,17 +22239,17 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren } }, - _getName : function(data) { + _getName: function(data) { return typeof data.name != 'undefined' ? data.name : data; }, _getFormatterName: function(itemName) { var formatter = this.legendOption.formatter; var formattedName; - if (typeof formatter == 'function') { + if (typeof formatter === 'function') { formattedName = formatter.call(this.myChart, itemName); } - else if (typeof formatter == 'string') { + else if (typeof formatter === 'string') { formattedName = formatter.replace('{name}', itemName); } else { @@ -20945,11 +22264,11 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren }, // 多行橫排居中优化 - _mLineOptimize : function () { + _mLineOptimize: function () { var lineOffsetArray = []; // 每行宽度 var lastX = this._itemGroupLocation.x; for (var i = 2, l = this.shapeList.length; i < l; i++) { - if (this.shapeList[i].style.x == lastX) { + if (this.shapeList[i].style.x === lastX) { lineOffsetArray.push( ( this._itemGroupLocation.width @@ -20964,7 +22283,7 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren ) / 2 ); } - else if (i == l - 1) { + else if (i === l - 1) { lineOffsetArray.push( ( this._itemGroupLocation.width @@ -20982,7 +22301,7 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren } var curLineIndex = -1; for (var i = 1, l = this.shapeList.length; i < l; i++) { - if (this.shapeList[i].style.x == lastX) { + if (this.shapeList[i].style.x === lastX) { curLineIndex++; } if (lineOffsetArray[curLineIndex] === 0) { @@ -20994,24 +22313,24 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren } }, - _buildBackground : function () { + _buildBackground: function () { var pTop = this.legendOption.padding[0]; var pRight = this.legendOption.padding[1]; var pBottom = this.legendOption.padding[2]; var pLeft = this.legendOption.padding[3]; this.shapeList.push(new RectangleShape({ - zlevel : this._zlevelBase, + zlevel: this._zlevelBase, hoverable :false, - style : { - x : this._itemGroupLocation.x - pLeft, - y : this._itemGroupLocation.y - pTop, - width : this._itemGroupLocation.width + pLeft + pRight, - height : this._itemGroupLocation.height + pTop + pBottom, - brushType : this.legendOption.borderWidth === 0 ? 'fill' : 'both', - color : this.legendOption.backgroundColor, - strokeColor : this.legendOption.borderColor, - lineWidth : this.legendOption.borderWidth + style: { + x: this._itemGroupLocation.x - pLeft, + y: this._itemGroupLocation.y - pTop, + width: this._itemGroupLocation.width + pLeft + pRight, + height: this._itemGroupLocation.height + pTop + pBottom, + brushType: this.legendOption.borderWidth === 0 ? 'fill' : 'both', + color: this.legendOption.backgroundColor, + strokeColor: this.legendOption.borderColor, + lineWidth: this.legendOption.borderWidth } })); }, @@ -21019,7 +22338,7 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren /** * 根据选项计算图例实体的位置坐标 */ - _getItemGroupLocation : function () { + _getItemGroupLocation: function () { var data = this.legendOption.data; var dataLength = data.length; var itemGap = this.legendOption.itemGap; @@ -21035,7 +22354,7 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren var temp = 0; // 宽高计算,用于多行判断 var maxWidth = 0; // 垂直布局有用 - if (this.legendOption.orient == 'horizontal') { + if (this.legendOption.orient === 'horizontal') { // 水平布局,计算总宽度 totalHeight = itemHeight; for (var i = 0; i < dataLength; i++) { @@ -21160,85 +22479,85 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren } return { - x : x, - y : y, - width : totalWidth, - height : totalHeight, - maxWidth : maxWidth + x: x, + y: y, + width: totalWidth, + height: totalHeight, + maxWidth: maxWidth }; }, /** * 根据名称返回series数据或data */ - _getSomethingByName : function (name) { + _getSomethingByName: function (name) { var series = this.option.series; var data; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].name == name) { + if (series[i].name === name) { // 系列名称优先 return { - type : series[i].type, - series : series[i], - seriesIndex : i, - data : null, - dataIndex : -1 + type: series[i].type, + series: series[i], + seriesIndex: i, + data: null, + dataIndex: -1 }; } if ( - series[i].type == ecConfig.CHART_TYPE_PIE - || series[i].type == ecConfig.CHART_TYPE_RADAR - || series[i].type == ecConfig.CHART_TYPE_CHORD - || series[i].type == ecConfig.CHART_TYPE_FORCE - || series[i].type == ecConfig.CHART_TYPE_FUNNEL + series[i].type === ecConfig.CHART_TYPE_PIE + || series[i].type === ecConfig.CHART_TYPE_RADAR + || series[i].type === ecConfig.CHART_TYPE_CHORD + || series[i].type === ecConfig.CHART_TYPE_FORCE + || series[i].type === ecConfig.CHART_TYPE_FUNNEL ) { data = series[i].type != ecConfig.CHART_TYPE_FORCE ? series[i].data // 饼图、雷达图、和弦图得查找里面的数据名字 : series[i].categories; // 力导布局查找categories配置 for (var j = 0, k = data.length; j < k; j++) { - if (data[j].name == name) { + if (data[j].name === name) { return { - type : series[i].type, - series : series[i], - seriesIndex : i, - data : data[j], - dataIndex : j + type: series[i].type, + series: series[i], + seriesIndex: i, + data: data[j], + dataIndex: j }; } } } } return { - type : 'bar', - series : null, - seriesIndex : -1, - data : null, - dataIndex : -1 + type: 'bar', + series: null, + seriesIndex: -1, + data: null, + dataIndex: -1 }; }, - _getItemShapeByType : function (x, y, width, height, color, itemType, defaultColor) { + _getItemShapeByType: function (x, y, width, height, color, itemType, defaultColor) { var highlightColor = color === '#ccc' ? defaultColor : color; var itemShape = { - zlevel : this._zlevelBase, - style : { - iconType : 'legendicon' + itemType, - x : x, - y : y, - width : width, - height : height, - color : color, - strokeColor : color, - lineWidth : 2 + zlevel: this._zlevelBase, + style: { + iconType: 'legendicon' + itemType, + x: x, + y: y, + width: width, + height: height, + color: color, + strokeColor: color, + lineWidth: 2 }, highlightStyle: { - color : highlightColor, - strokeColor : highlightColor, - lineWidth : 1 + color: highlightColor, + strokeColor: highlightColor, + lineWidth: 1 }, - hoverable : this.legendOption.selectedMode, - clickable : this.legendOption.selectedMode + hoverable: this.legendOption.selectedMode, + clickable: this.legendOption.selectedMode }; var imageLocation; @@ -21250,15 +22569,15 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren } // 特殊设置 switch (itemType) { - case 'line' : + case 'line': itemShape.style.brushType = 'stroke'; itemShape.highlightStyle.lineWidth = 3; break; - case 'radar' : - case 'scatter' : + case 'radar': + case 'scatter': itemShape.highlightStyle.lineWidth = 3; break; - case 'k' : + case 'k': itemShape.style.brushType = 'both'; itemShape.highlightStyle.lineWidth = 3; itemShape.highlightStyle.color = @@ -21269,7 +22588,7 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren || '#ff3200') : color; break; - case 'image' : + case 'image': itemShape.style.iconType = 'image'; itemShape.style.image = imageLocation; if (color === '#ccc') { @@ -21280,7 +22599,7 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren return itemShape; }, - __legendSelected : function (param) { + __legendSelected: function (param) { var itemName = param.target._name; if (this.legendOption.selectedMode === 'single') { for (var k in this._selectedMap) { @@ -21292,8 +22611,8 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren ecConfig.EVENT.LEGEND_SELECTED, param.event, { - selected : this._selectedMap, - target : itemName + selected: this._selectedMap, + target: itemName }, this.myChart ); @@ -21302,7 +22621,7 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren /** * 刷新 */ - refresh : function (newOption) { + refresh: function (newOption) { if (newOption) { this.option = newOption || this.option; this.option.legend = this.reformOption(this.option.legend); @@ -21335,9 +22654,9 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren } else { if (something.data - && (something.type == ecConfig.CHART_TYPE_PIE - || something.type == ecConfig.CHART_TYPE_FORCE - || something.type == ecConfig.CHART_TYPE_FUNNEL) + && (something.type === ecConfig.CHART_TYPE_PIE + || something.type === ecConfig.CHART_TYPE_FORCE + || something.type === ecConfig.CHART_TYPE_FUNNEL) ) { queryTarget = [something.data, something.series]; } @@ -21364,28 +22683,28 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren this._buildShape(); }, - getRelatedAmount : function(name) { + getRelatedAmount: function(name) { var amount = 0; var series = this.option.series; var data; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].name == name) { + if (series[i].name === name) { // 系列名称优先 amount++; } if ( - series[i].type == ecConfig.CHART_TYPE_PIE - || series[i].type == ecConfig.CHART_TYPE_RADAR - || series[i].type == ecConfig.CHART_TYPE_CHORD - || series[i].type == ecConfig.CHART_TYPE_FORCE - || series[i].type == ecConfig.CHART_TYPE_FUNNEL + series[i].type === ecConfig.CHART_TYPE_PIE + || series[i].type === ecConfig.CHART_TYPE_RADAR + || series[i].type === ecConfig.CHART_TYPE_CHORD + || series[i].type === ecConfig.CHART_TYPE_FORCE + || series[i].type === ecConfig.CHART_TYPE_FUNNEL ) { data = series[i].type != ecConfig.CHART_TYPE_FORCE ? series[i].data // 饼图、雷达图、和弦图得查找里面的数据名字 : series[i].categories; // 力导布局查找categories配置 for (var j = 0, k = data.length; j < k; j++) { - if (data[j].name == name && data[j].value != '-') { + if (data[j].name === name && data[j].value != '-') { amount++; } } @@ -21394,25 +22713,25 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren return amount; }, - setColor : function (legendName, color) { + setColor: function (legendName, color) { this._colorMap[legendName] = color; }, - getColor : function (legendName) { + getColor: function (legendName) { if (!this._colorMap[legendName]) { this._colorMap[legendName] = this.zr.getColor(this._colorIndex++); } return this._colorMap[legendName]; }, - hasColor : function (legendName) { + hasColor: function (legendName) { return this._colorMap[legendName] ? this._colorMap[legendName] : false; }, - add : function (name, color){ + add: function (name, color){ var data = this.legendOption.data; for (var i = 0, dataLength = data.length; i < dataLength; i++) { - if (this._getName(data[i]) == name) { + if (this._getName(data[i]) === name) { // 已有就不重复加了 return; } @@ -21422,10 +22741,10 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren this._selectedMap[name] = true; }, - del : function (name){ + del: function (name){ var data = this.legendOption.data; for (var i = 0, dataLength = data.length; i < dataLength; i++) { - if (this._getName(data[i]) == name) { + if (this._getName(data[i]) === name) { return this.legendOption.data.splice(i, 1); } } @@ -21436,14 +22755,14 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren * @param {Object} name * @param {Object} itemShape */ - getItemShape : function (name) { - if (typeof name == 'undefined') { + getItemShape: function (name) { + if (name == null) { return; } var shape; for (var i = 0, l = this.shapeList.length; i < l; i++) { shape = this.shapeList[i]; - if (shape._name == name && shape.type != 'text') { + if (shape._name === name && shape.type != 'text') { return shape; } } @@ -21454,11 +22773,11 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren * @param {Object} name * @param {Object} itemShape */ - setItemShape : function (name, itemShape) { + setItemShape: function (name, itemShape) { var shape; for (var i = 0, l = this.shapeList.length; i < l; i++) { shape = this.shapeList[i]; - if (shape._name == name && shape.type != 'text') { + if (shape._name === name && shape.type != 'text') { if (!this._selectedMap[name]) { itemShape.style.color = '#ccc'; itemShape.style.strokeColor = '#ccc'; @@ -21468,7 +22787,7 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren } }, - isSelected : function (itemName) { + isSelected: function (itemName) { if (typeof this._selectedMap[itemName] != 'undefined') { return this._selectedMap[itemName]; } @@ -21478,11 +22797,11 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren } }, - getSelectedMap : function () { + getSelectedMap: function () { return this._selectedMap; }, - setSelected : function(itemName, selectStatus) { + setSelected: function(itemName, selectStatus) { if (this.legendOption.selectedMode === 'single') { for (var k in this._selectedMap) { this._selectedMap[k] = false; @@ -21493,8 +22812,8 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren ecConfig.EVENT.LEGEND_SELECTED, null, { - selected : this._selectedMap, - target : itemName + selected: this._selectedMap, + target: itemName }, this.myChart ); @@ -21503,7 +22822,7 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren /** * 图例选择 */ - onlegendSelected : function (param, status) { + onlegendSelected: function (param, status) { var legendSelected = param.selected; for (var itemName in legendSelected) { if (this._selectedMap[itemName] != legendSelected[itemName]) { @@ -21517,70 +22836,70 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren }; var legendIcon = { - line : function (ctx, style) { + line: function (ctx, style) { var dy = style.height / 2; ctx.moveTo(style.x, style.y + dy); ctx.lineTo(style.x + style.width,style.y + dy); }, - pie : function (ctx, style) { + pie: function (ctx, style) { var x = style.x; var y = style.y; var width = style.width; var height = style.height; SectorShape.prototype.buildPath(ctx, { - x : x + width / 2, - y : y + height + 2, - r : height + 2, - r0 : 6, - startAngle : 45, - endAngle : 135 + x: x + width / 2, + y: y + height + 2, + r: height + 2, + r0: 6, + startAngle: 45, + endAngle: 135 }); }, /* - chord : function (ctx, style) { + chord: function (ctx, style) { var x = style.x; var y = style.y; var width = style.width; var height = style.height; ctx.moveTo(x, y + height); BeziercurveShape.prototype.buildPath(ctx, { - xStart : x, - yStart : y + height, - cpX1 : x + width, - cpY1 : y + height, - cpX2 : x, - cpY2 : y + 4, - xEnd : x + width, - yEnd : y + 4 + xStart: x, + yStart: y + height, + cpX1: x + width, + cpY1: y + height, + cpX2: x, + cpY2: y + 4, + xEnd: x + width, + yEnd: y + 4 }); ctx.lineTo(x + width, y); BeziercurveShape.prototype.buildPath(ctx, { - xStart : x + width, - yStart : y, - cpX1 : x, - cpY1 : y, - cpX2 : x + width, - cpY2 : y + height - 4, - xEnd : x, - yEnd : y + height - 4 + xStart: x + width, + yStart: y, + cpX1: x, + cpY1: y, + cpX2: x + width, + cpY2: y + height - 4, + xEnd: x, + yEnd: y + height - 4 }); ctx.lineTo(x, y + height); }, */ - k : function (ctx, style) { + k: function (ctx, style) { var x = style.x; var y = style.y; var width = style.width; var height = style.height; CandleShape.prototype.buildPath(ctx, { - x : x + width / 2, - y : [y + 1, y + 1, y + height - 6, y + height], - width : width - 6 + x: x + width / 2, + y: [y + 1, y + 1, y + height - 6, y + height], + width: width - 6 }); }, - bar : function (ctx, style) { + bar: function (ctx, style) { var x = style.x; var y = style.y +1; var width = style.width; @@ -21604,7 +22923,7 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren ctx.quadraticCurveTo(x, y, x + r, y); }, - force : function (ctx, style) { + force: function (ctx, style) { IconShape.prototype.iconLibrary.circle(ctx, style); }, @@ -21691,10 +23010,12 @@ define('echarts/util/shape/Chain',['require','zrender/shape/Base','./Icon','zren // 设置transform this.setTransform(ctx); + ctx.save(); ctx.beginPath(); this.buildLinePath(ctx, style); ctx.stroke(); - + ctx.restore(); + this.brushSymbol(ctx, style); ctx.restore(); @@ -21875,9 +23196,9 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle null, { currentIndex: self.currentIndex, - data : typeof timelineOption.data[self.currentIndex].name != 'undefined' - ? timelineOption.data[self.currentIndex].name - : timelineOption.data[self.currentIndex] + data: timelineOption.data[self.currentIndex].name != null + ? timelineOption.data[self.currentIndex].name + : timelineOption.data[self.currentIndex] }, self.myChart ); @@ -21940,8 +23261,8 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle } Timeline.prototype = { - type : ecConfig.COMPONENT_TYPE_TIMELINE, - _buildShape : function () { + type: ecConfig.COMPONENT_TYPE_TIMELINE, + _buildShape: function () { // 位置参数,通过计算所得x, y, width, height this._location = this._getLocation(); this._buildBackground(); @@ -21965,7 +23286,7 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle /** * 根据选项计算实体的位置坐标 */ - _getLocation : function () { + _getLocation: function () { var timelineOption = this.timelineOption; var padding = timelineOption.padding; @@ -21974,7 +23295,7 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle var x = this.parsePercent(timelineOption.x, zrWidth); var x2 = this.parsePercent(timelineOption.x2, zrWidth); var width; - if (typeof timelineOption.width == 'undefined') { + if (timelineOption.width == null) { width = zrWidth - x - x2; x2 = zrWidth - x2; } @@ -21987,7 +23308,7 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle var height = this.parsePercent(timelineOption.height, zrHeight); var y; var y2; - if (typeof timelineOption.y != 'undefined') { + if (timelineOption.y != null) { y = this.parsePercent(timelineOption.y, zrHeight); y2 = y + height; } @@ -21997,27 +23318,27 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle } return { - x : x + padding[3], - y : y + padding[0], - x2 : x2 - padding[1], - y2 : y2 - padding[2], - width : width - padding[1] - padding[3], - height : height - padding[0] - padding[2] + x: x + padding[3], + y: y + padding[0], + x2: x2 - padding[1], + y2: y2 - padding[2], + width: width - padding[1] - padding[3], + height: height - padding[0] - padding[2] }; }, - _getReformedLabel : function (idx) { + _getReformedLabel: function (idx) { var timelineOption = this.timelineOption; - var data = typeof timelineOption.data[idx].name != 'undefined' + var data = timelineOption.data[idx].name != null ? timelineOption.data[idx].name : timelineOption.data[idx]; var formatter = timelineOption.data[idx].formatter || timelineOption.label.formatter; if (formatter) { - if (typeof formatter == 'function') { + if (typeof formatter === 'function') { data = formatter.call(this.myChart, data); } - else if (typeof formatter == 'string') { + else if (typeof formatter === 'string') { data = formatter.replace('{value}', data); } } @@ -22027,11 +23348,11 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle /** * 计算标签显示挑选间隔 */ - _getInterval : function () { + _getInterval: function () { var chainPoint = this._chainPoint; var timelineOption = this.timelineOption; var interval = timelineOption.label.interval; - if (interval == 'auto') { + if (interval === 'auto') { // 麻烦的自适应计算 var fontSize = timelineOption.label.textStyle.fontSize; var data = timelineOption.data; @@ -22090,7 +23411,7 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle /** * 根据选项计算时间链条上的坐标及symbolList */ - _getChainPoint : function() { + _getChainPoint: function() { var timelineOption = this.timelineOption; var symbol = timelineOption.symbol.toLowerCase(); var symbolSize = timelineOption.symbolSize; @@ -22105,14 +23426,14 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle var len = data.length; function _getName(i) { - return typeof data[i].name != 'undefined' ? data[i].name : data[i]; + return data[i].name != null ? data[i].name : data[i]; } var xList = []; if (len > 1) { var boundaryGap = width / len; boundaryGap = boundaryGap > 50 ? 50 : (boundaryGap < 20 ? 5 : boundaryGap); width -= boundaryGap * 2; - if (timelineOption.type == 'number') { + if (timelineOption.type === 'number') { // 平均分布 for (var i = 0; i < len; i++) { xList.push(x + boundaryGap + width / (len - 1) * i); @@ -22171,30 +23492,30 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle } list.push({ - x : x, - n : n, - isEmpty : isEmpty, - symbol : curSymbol, - symbolSize : data[i].symbolSize || symbolSize, - color : data[i].color, - borderColor : data[i].borderColor, - borderWidth : data[i].borderWidth, - name : this._getReformedLabel(i), - textColor : dataTextStyle.color, - textAlign : textAlign, - textBaseline : dataTextStyle.baseline || 'middle', - textX : x, - textY : y - (rotate ? 5 : 0), - textFont : data[i].textStyle ? this.getFont(dataTextStyle) : textFont, - rotation : rotation, - showLabel : false + x: x, + n: n, + isEmpty: isEmpty, + symbol: curSymbol, + symbolSize: data[i].symbolSize || symbolSize, + color: data[i].color, + borderColor: data[i].borderColor, + borderWidth: data[i].borderWidth, + name: this._getReformedLabel(i), + textColor: dataTextStyle.color, + textAlign: textAlign, + textBaseline: dataTextStyle.baseline || 'middle', + textX: x, + textY: y - (rotate ? 5 : 0), + textFont: data[i].textStyle ? this.getFont(dataTextStyle) : textFont, + rotation: rotation, + showLabel: false }); } return list; }, - _buildBackground : function () { + _buildBackground: function () { var timelineOption = this.timelineOption; var padding = timelineOption.padding; var width = this._location.width; @@ -22205,35 +23526,34 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle ) { // 背景 this.shapeList.push(new RectangleShape({ - zlevel : this._zlevelBase, + zlevel: this._zlevelBase, hoverable :false, - style : { - x : this._location.x - padding[3], - y : this._location.y - padding[0], - width : width + padding[1] + padding[3], - height : height + padding[0] + padding[2], - brushType : timelineOption.borderWidth === 0 - ? 'fill' : 'both', - color : timelineOption.backgroundColor, - strokeColor : timelineOption.borderColor, - lineWidth : timelineOption.borderWidth + style: { + x: this._location.x - padding[3], + y: this._location.y - padding[0], + width: width + padding[1] + padding[3], + height: height + padding[0] + padding[2], + brushType: timelineOption.borderWidth === 0 ? 'fill' : 'both', + color: timelineOption.backgroundColor, + strokeColor: timelineOption.borderColor, + lineWidth: timelineOption.borderWidth } })); } }, - _buildControl : function() { + _buildControl: function() { var self = this; var timelineOption = this.timelineOption; var lineStyle = timelineOption.lineStyle; var controlStyle = timelineOption.controlStyle; - if (timelineOption.controlPosition == 'none') { + if (timelineOption.controlPosition === 'none') { return; } var iconSize = 15; var iconGap = 5; var x; - if (timelineOption.controlPosition == 'left') { + if (timelineOption.controlPosition === 'left') { x = this._location.x; this._location.x += (iconSize + iconGap) * 3; } @@ -22244,25 +23564,25 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle var y = this._location.y; var iconStyle = { - zlevel : this._zlevelBase + 1, - style : { - iconType : 'timelineControl', - symbol : 'last', - x : x, - y : y, - width : iconSize, - height : iconSize, - brushType : 'stroke', + zlevel: this._zlevelBase + 1, + style: { + iconType: 'timelineControl', + symbol: 'last', + x: x, + y: y, + width: iconSize, + height: iconSize, + brushType: 'stroke', color: controlStyle.normal.color, - strokeColor : controlStyle.normal.color, - lineWidth : lineStyle.width + strokeColor: controlStyle.normal.color, + lineWidth: lineStyle.width }, - highlightStyle : { - color : controlStyle.emphasis.color, - strokeColor : controlStyle.emphasis.color, - lineWidth : lineStyle.width + 1 + highlightStyle: { + color: controlStyle.emphasis.color, + strokeColor: controlStyle.emphasis.color, + lineWidth: lineStyle.width + 1 }, - clickable : true + clickable: true }; this._ctrLastShape = new IconShape(iconStyle); @@ -22278,7 +23598,7 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle this._ctrPlayShape.style.status = this.timelineOption.autoPlay ? 'playing' : 'stop'; this._ctrPlayShape.style.x = x; this._ctrPlayShape.onclick = function() { - if (self._ctrPlayShape.style.status == 'stop') { + if (self._ctrPlayShape.style.status === 'stop') { self.play(); } else { @@ -22300,25 +23620,25 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle /** * 构建时间轴 */ - _buildChain : function () { + _buildChain: function () { var timelineOption = this.timelineOption; var lineStyle = timelineOption.lineStyle; this._timelineShae = { - zlevel : this._zlevelBase, - style : { - x : this._location.x, - y : this.subPixelOptimize(this._location.y, lineStyle.width), - width : this._location.x2 - this._location.x, - height : this._location.height, - chainPoint : this._chainPoint, + zlevel: this._zlevelBase, + style: { + x: this._location.x, + y: this.subPixelOptimize(this._location.y, lineStyle.width), + width: this._location.x2 - this._location.x, + height: this._location.height, + chainPoint: this._chainPoint, brushType:'both', - strokeColor : lineStyle.color, - lineWidth : lineStyle.width, - lineType : lineStyle.type + strokeColor: lineStyle.color, + lineWidth: lineStyle.width, + lineType: lineStyle.type }, - hoverable : false, - clickable : true, - onclick : this._onclick + hoverable: false, + clickable: true, + onclick: this._onclick }; this._timelineShae = new ChainShape(this._timelineShae); @@ -22328,32 +23648,32 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle /** * 构建拖拽手柄 */ - _buildHandle : function () { + _buildHandle: function () { var curPoint = this._chainPoint[this.currentIndex]; var symbolSize = curPoint.symbolSize + 1; symbolSize = symbolSize < 5 ? 5 : symbolSize; this._handleShape = { - zlevel : this._zlevelBase + 1, - hoverable : false, - draggable : true, - style : { - iconType : 'diamond', - n : curPoint.n, - x : curPoint.x - symbolSize, - y : this._location.y + this._location.height / 4 - symbolSize, - width : symbolSize * 2, - height : symbolSize * 2, + zlevel: this._zlevelBase + 1, + hoverable: false, + draggable: true, + style: { + iconType: 'diamond', + n: curPoint.n, + x: curPoint.x - symbolSize, + y: this._location.y + this._location.height / 4 - symbolSize, + width: symbolSize * 2, + height: symbolSize * 2, brushType:'both', - textPosition : 'specific', - textX : curPoint.x, - textY : this._location.y - this._location.height / 4, - textAlign : 'center', - textBaseline : 'middle' + textPosition: 'specific', + textX: curPoint.x, + textY: this._location.y - this._location.height / 4, + textAlign: 'center', + textBaseline: 'middle' }, - highlightStyle : {}, - ondrift : this._ondrift, - ondragend : this._ondragend + highlightStyle: {}, + ondrift: this._ondrift, + ondragend: this._ondragend }; this._handleShape = new IconShape(this._handleShape); @@ -22363,7 +23683,7 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle /** * 同步拖拽图形样式 */ - _syncHandleShape : function() { + _syncHandleShape: function() { if (!this.timelineOption.show) { return; } @@ -22376,7 +23696,7 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle this._handleShape.style.textFont = curPoint.textFont; this._handleShape.style.n = curPoint.n; - if (cpStyle.symbol == 'auto') { + if (cpStyle.symbol === 'auto') { this._handleShape.style.iconType = curPoint.symbol != 'none' ? curPoint.symbol : 'diamond'; } @@ -22389,7 +23709,7 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle } var symbolSize; - if (cpStyle.symbolSize == 'auto') { + if (cpStyle.symbolSize === 'auto') { symbolSize = curPoint.symbolSize + 2; symbolSize = symbolSize < 5 ? 5 : symbolSize; } @@ -22397,20 +23717,20 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle symbolSize = cpStyle.symbolSize - 0; } - this._handleShape.style.color = cpStyle.color == 'auto' + this._handleShape.style.color = cpStyle.color === 'auto' ? (curPoint.color ? curPoint.color : timelineOption.controlStyle.emphasis.color ) : cpStyle.color; - this._handleShape.style.textColor = cpStyle.label.textStyle.color == 'auto' + this._handleShape.style.textColor = cpStyle.label.textStyle.color === 'auto' ? this._handleShape.style.color : cpStyle.label.textStyle.color; this._handleShape.highlightStyle.strokeColor = - this._handleShape.style.strokeColor = cpStyle.borderColor == 'auto' + this._handleShape.style.strokeColor = cpStyle.borderColor === 'auto' ? (curPoint.borderColor ? curPoint.borderColor : '#fff') : cpStyle.borderColor; - this._handleShape.style.lineWidth = cpStyle.borderWidth == 'auto' + this._handleShape.style.lineWidth = cpStyle.borderWidth === 'auto' ? (curPoint.borderWidth ? curPoint.borderWidth : 0) : (cpStyle.borderWidth - 0); this._handleShape.highlightStyle.lineWidth = this._handleShape.style.lineWidth + 1; @@ -22419,17 +23739,17 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle .when( 500, { - x : curPoint.x - symbolSize, - textX : curPoint.x, - y : this._location.y + this._location.height / 4 - symbolSize, - width : symbolSize * 2, - height : symbolSize * 2 + x: curPoint.x - symbolSize, + textX: curPoint.x, + y: this._location.y + this._location.height / 4 - symbolSize, + width: symbolSize * 2, + height: symbolSize * 2 } ) .start('ExponentialOut'); }, - _findChainIndex : function(x) { + _findChainIndex: function(x) { var chainPoint = this._chainPoint; var len = chainPoint.length; if (x <= chainPoint[0].x) { @@ -22447,10 +23767,10 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle } }, - __onclick : function(param) { + __onclick: function(param) { var x = zrEvent.getX(param.event); var newIndex = this._findChainIndex(x); - if (newIndex == this.currentIndex) { + if (newIndex === this.currentIndex) { return true; // 啥事都没发生 } @@ -22463,7 +23783,7 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle /** * 拖拽范围控制 */ - __ondrift : function (shape, dx) { + __ondrift: function (shape, dx) { this.timelineOption.autoPlay && this.stop(); // 停止自动播放 var chainPoint = this._chainPoint; @@ -22492,7 +23812,7 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle shape.style.text = curPoint.name; //console.log(newIndex) - if (newIndex == this.currentIndex) { + if (newIndex === this.currentIndex) { return true; // 啥事都没发生 } @@ -22508,14 +23828,14 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle return true; }, - __ondragend : function () { + __ondragend: function () { this.isDragend = true; }, /** * 数据项被拖拽出去 */ - ondragend : function (param, status) { + ondragend: function (param, status) { if (!this.isDragend || !param.target) { // 没有在当前实例上发生拖拽行为则直接返回 return; @@ -22532,7 +23852,7 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle return; }, - last : function () { + last: function () { this.timelineOption.autoPlay && this.stop(); // 停止自动播放 this.currentIndex -= 1; @@ -22544,7 +23864,7 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle return this.currentIndex; }, - next : function () { + next: function () { this.timelineOption.autoPlay && this.stop(); // 停止自动播放 this.currentIndex += 1; @@ -22556,7 +23876,7 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle return this.currentIndex; }, - play : function (targetIndex, autoPlay) { + play: function (targetIndex, autoPlay) { if (this._ctrPlayShape && this._ctrPlayShape.style.status != 'playing') { this._ctrPlayShape.style.status = 'playing'; this.zr.modShape(this._ctrPlayShape.id); @@ -22564,15 +23884,13 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle } - this.timelineOption.autoPlay = typeof autoPlay != 'undefined' - ? autoPlay : true; + this.timelineOption.autoPlay = autoPlay != null ? autoPlay : true; if (!this.timelineOption.autoPlay) { clearTimeout(this.playTicket); } - this.currentIndex = typeof targetIndex != 'undefined' - ? targetIndex : (this.currentIndex + 1); + this.currentIndex = targetIndex != null ? targetIndex : (this.currentIndex + 1); if (this.currentIndex >= this.timelineOption.data.length) { this.currentIndex = 0; } @@ -22581,7 +23899,7 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle return this.currentIndex; }, - stop : function () { + stop: function () { if (this._ctrPlayShape && this._ctrPlayShape.style.status != 'stop') { this._ctrPlayShape.style.status = 'stop'; this.zr.modShape(this._ctrPlayShape.id); @@ -22598,7 +23916,7 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle /** * 避免dataZoom带来两次refresh,不设refresh接口,resize重复一下buildshape逻辑 */ - resize : function () { + resize: function () { if (this.timelineOption.show) { this.clear(); this._buildShape(); @@ -22606,7 +23924,7 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle } }, - setTheme : function(needRefresh) { + setTheme: function(needRefresh) { this.timelineOption = this.reformOption(zrUtil.clone(this.option.timeline)); // 补全padding属性 this.timelineOption.padding = this.reformCssArray( @@ -22632,7 +23950,7 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle /** * 释放后实例不可用,重载基类方法 */ - dispose : function () { + dispose: function () { this.clear(); this.shapeList = null; @@ -22649,7 +23967,7 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle var symbol = style.symbol; - if (symbol == 'last') { + if (symbol === 'last') { ctx.moveTo(x + width - 2, y + height / 3); ctx.lineTo(x + width - 2, y); ctx.lineTo(x + 2, y + height / 2); @@ -22658,7 +23976,7 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle ctx.moveTo(x, y); ctx.lineTo(x, y); } - else if (symbol == 'next') { + else if (symbol === 'next') { ctx.moveTo(x + 2, y + height / 3); ctx.lineTo(x + 2, y); ctx.lineTo(x + width - 2, y + height / 2); @@ -22667,15 +23985,15 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle ctx.moveTo(x, y); ctx.lineTo(x, y); } - else if (symbol == 'play') { - if (style.status == 'stop') { + else if (symbol === 'play') { + if (style.status === 'stop') { ctx.moveTo(x + 2, y); ctx.lineTo(x + width - 2, y + height / 2); ctx.lineTo(x + 2, y + height); ctx.lineTo(x + 2, y); } else { - var delta = style.brushType == 'both' ? 2 : 3; + var delta = style.brushType === 'both' ? 2 : 3; ctx.rect(x + 2, y, delta, height); ctx.rect(x + width - delta - 2, y, delta, height); } @@ -22687,11 +24005,11 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle ); symbol = IconShape.prototype.iconLibrary.image; symbol(ctx, { - x : x, - y : y, - width : width, - height : height, - image : imageLocation + x: x, + y: y, + width: width, + height: height, + image: imageLocation }); } } @@ -22760,7 +24078,7 @@ define( effectOption.y, effectOption.x + effectOption.width, effectOption.y + effectOption.height, - [[0, '#ff6400'], [0.5, '#ffe100'], [1, '#b1ff00']] + [ [ 0, '#ff6400' ], [ 0.5, '#ffe100' ], [ 1, '#b1ff00' ] ] ); if (options.progress != null) { @@ -22768,7 +24086,7 @@ define( addShapeHandle(background); barShape.highlightStyle.width = - this.adjust(options.progress, [0,1]) + this.adjust(options.progress, [ 0, 1 ]) * options.effectOption.width; addShapeHandle(barShape); @@ -22781,7 +24099,7 @@ define( // 循环显示 barShape.highlightStyle.width = 0; return setInterval( - function() { + function () { addShapeHandle(background); if (barShape.highlightStyle.width < effectOption.width) { @@ -22855,7 +24173,7 @@ define( var canvasHeight = this.canvasHeight; // 初始化动画元素 - for(var i = 0; i < n; i++) { + for (var i = 0; i < n; i++) { var color = effectOption.color == 'random' ? zrColor.alpha(zrColor.random(), 0.3) : effectOption.color; @@ -22878,10 +24196,10 @@ define( function () { addShapeHandle(background); - for(var i = 0; i < n; i++) { + for (var i = 0; i < n; i++) { var style = shapeList[i].highlightStyle; - if (style.y - shapeList[i].animationY + style.r <= 0){ + if (style.y - shapeList[i].animationY + style.r <= 0) { shapeList[i].highlightStyle.y = canvasHeight + style.r; shapeList[i].highlightStyle.x = Math.ceil( Math.random() * canvasWidth @@ -22954,7 +24272,7 @@ define( var canvasHeight = this.canvasHeight; // 初始化动画元素 - for(var i = 0; i < n; i++) { + for (var i = 0; i < n; i++) { var xStart = -Math.ceil(Math.random() * 1000); var len = Math.ceil(Math.random() * 400); var pos = Math.ceil(Math.random() * canvasHeight); @@ -22981,10 +24299,10 @@ define( function() { addShapeHandle(background); - for(var i = 0; i < n; i++) { + for (var i = 0; i < n; i++) { var style = shapeList[i].highlightStyle; - if (style.xStart >= canvasWidth){ + if (style.xStart >= canvasWidth) { shapeList[i].len = Math.ceil(Math.random() * 400); style.xStart = -400; @@ -23083,12 +24401,12 @@ define( // 初始化动画元素 var shapeList = []; var clolrList = zrColor.getGradientColors( - ['#ff6400', '#ffe100', '#97ff00'], 25 + [ '#ff6400', '#ffe100', '#97ff00' ], 25 ); var preAngle = 15; var endAngle = 240; - for(var i = 0; i < 16; i++) { + for (var i = 0; i < 16; i++) { shapeList.push(new SectorShape({ highlightStyle : { x : x, @@ -23106,15 +24424,15 @@ define( x + r0 * Math.cos(endAngle - preAngle, true), y - r0 * Math.sin(endAngle - preAngle, true), [ - [0, clolrList[i * 2]], - [1, clolrList[i * 2 + 1]] + [ 0, clolrList[i * 2] ], + [ 1, clolrList[i * 2 + 1] ] ] ) })); endAngle -= preAngle; } endAngle = 360; - for(var i = 0; i < 4; i++) { + for (var i = 0; i < 4; i++) { shapeList.push(new SectorShape({ highlightStyle : { x : x, @@ -23132,8 +24450,8 @@ define( x + r0 * Math.cos(endAngle - preAngle, true), y - r0 * Math.sin(endAngle - preAngle, true), [ - [0, clolrList[i * 2 + 32]], - [1, clolrList[i * 2 + 33]] + [ 0, clolrList[i * 2 + 32] ], + [ 1, clolrList[i * 2 + 33] ] ] ) })); @@ -23145,11 +24463,11 @@ define( // 指定进度 addShapeHandle(background); - n = this.adjust(options.progress, [0,1]).toFixed(2) * 100 / 5; + n = this.adjust(options.progress, [ 0, 1 ]).toFixed(2) * 100 / 5; shapeRing.highlightStyle.text = n * 5 + '%'; addShapeHandle(shapeRing); - for(var i = 0; i < 20; i++) { + for (var i = 0; i < 20; i++) { shapeList[i].highlightStyle.color = i < n ? shapeList[i]._color : darkColor; addShapeHandle(shapeList[i]); @@ -23167,10 +24485,10 @@ define( n += n >= 20 ? -20 : 1; - //shapeRing.highlightStyle.text = n * 5 + '%'; + // shapeRing.highlightStyle.text = n * 5 + '%'; addShapeHandle(shapeRing); - for(var i = 0; i < 20; i++) { + for (var i = 0; i < 20; i++) { shapeList[i].highlightStyle.color = i < n ? shapeList[i]._color : darkColor; addShapeHandle(shapeList[i]); @@ -23189,10 +24507,11 @@ define( define( - 'zrender/loadingEffect/Spin',['require','./Base','../tool/util','../tool/color','../shape/Sector'],function (require) { + 'zrender/loadingEffect/Spin',['require','./Base','../tool/util','../tool/color','../tool/area','../shape/Sector'],function (require) { var Base = require('./Base'); var util = require('../tool/util'); var zrColor = require('../tool/color'); + var zrArea = require('../tool/area'); var SectorShape = require('../shape/Sector'); function Spin(options) { @@ -23207,12 +24526,30 @@ define( * @param {Object} refreshHandle */ Spin.prototype._start = function (addShapeHandle, refreshHandle) { + var options = util.merge( + this.options, + { + textStyle : { + color : '#fff', + textAlign : 'start' + }, + backgroundColor : 'rgba(0, 0, 0, 0.8)' + } + ); + var textShape = this.createTextShape(options.textStyle); + + var textGap = 10; + var textWidth = zrArea.getTextWidth( + textShape.highlightStyle.text, textShape.highlightStyle.textFont + ); + var textHeight = zrArea.getTextHeight( + textShape.highlightStyle.text, textShape.highlightStyle.textFont + ); + // 特效默认配置 var effectOption = util.merge( this.options.effect || {}, { - x : this.canvasWidth / 2 - 80, - y : this.canvasHeight / 2, r0 : 9, r : 15, n : 18, @@ -23220,23 +24557,17 @@ define( timeInterval : 100 } ); - - var options = util.merge( - this.options, - { - textStyle : { - color : '#fff', - x : effectOption.x + effectOption.r + 10, - y : effectOption.y, - textAlign : 'start' - }, - backgroundColor : 'rgba(0, 0, 0, 0.8)' - } + + var location = this.getLocation( + this.options.textStyle, + textWidth + textGap + effectOption.r * 2, + Math.max(effectOption.r * 2, textHeight) ); - - var textShape = this.createTextShape(options.textStyle); + effectOption.x = location.x + effectOption.r; + effectOption.y = textShape.highlightStyle.y = location.y + location.height / 2; + textShape.highlightStyle.x = effectOption.x + effectOption.r + textGap; + var background = this.createBackgroundShape(options.backgroundColor); - var n = effectOption.n; var x = effectOption.x; var y = effectOption.y; @@ -23247,7 +24578,7 @@ define( // 初始化动画元素 var shapeList = []; var preAngle = Math.round(180 / n); - for(var i = 0; i < n; i++) { + for (var i = 0; i < n; i++) { shapeList[i] = new SectorShape({ highlightStyle : { x : x, @@ -23262,13 +24593,13 @@ define( }); } - var pos = [0, x, y]; + var pos = [ 0, x, y ]; return setInterval( function() { addShapeHandle(background); pos[0] -= 0.3; - for(var i = 0; i < n; i++) { + for (var i = 0; i < n; i++) { shapeList[i].rotation = pos; addShapeHandle(shapeList[i]); } @@ -23286,9 +24617,10 @@ define( define( - 'zrender/loadingEffect/Whirling',['require','./Base','../tool/util','../shape/Ring','../shape/Droplet','../shape/Circle'],function (require) { + 'zrender/loadingEffect/Whirling',['require','./Base','../tool/util','../tool/area','../shape/Ring','../shape/Droplet','../shape/Circle'],function (require) { var Base = require('./Base'); var util = require('../tool/util'); + var zrArea = require('../tool/area'); var RingShape = require('../shape/Ring'); var DropletShape = require('../shape/Droplet'); var CircleShape = require('../shape/Circle'); @@ -23305,12 +24637,30 @@ define( * @param {Object} refreshHandle */ Whirling.prototype._start = function (addShapeHandle, refreshHandle) { + var options = util.merge( + this.options, + { + textStyle : { + color : '#888', + textAlign : 'start' + }, + backgroundColor : 'rgba(250, 250, 250, 0.8)' + } + ); + var textShape = this.createTextShape(options.textStyle); + + var textGap = 10; + var textWidth = zrArea.getTextWidth( + textShape.highlightStyle.text, textShape.highlightStyle.textFont + ); + var textHeight = zrArea.getTextHeight( + textShape.highlightStyle.text, textShape.highlightStyle.textFont + ); + // 特效默认配置 var effectOption = util.merge( this.options.effect || {}, { - x : this.canvasWidth / 2 - 80, - y : this.canvasHeight / 2, r : 18, colorIn : '#fff', colorOut : '#555', @@ -23318,23 +24668,17 @@ define( timeInterval : 50 } ); - - var options = util.merge( - this.options, - { - textStyle : { - color : '#888', - x : effectOption.x + effectOption.r + 10, - y : effectOption.y, - textAlign : 'start' - }, - backgroundColor : 'rgba(250, 250, 250, 0.8)' - } + + var location = this.getLocation( + this.options.textStyle, + textWidth + textGap + effectOption.r * 2, + Math.max(effectOption.r * 2, textHeight) ); - - var textShape = this.createTextShape(options.textStyle); + effectOption.x = location.x + effectOption.r; + effectOption.y = textShape.highlightStyle.y = location.y + location.height / 2; + textShape.highlightStyle.x = effectOption.x + effectOption.r + textGap; + var background = this.createBackgroundShape(options.backgroundColor); - // 初始化动画元素 var droplet = new DropletShape({ highlightStyle : { @@ -23360,7 +24704,7 @@ define( } }); - var pos = [0, effectOption.x, effectOption.y]; + var pos = [ 0, effectOption.x, effectOption.y ]; droplet.highlightStyle.x = circleIn.highlightStyle.x @@ -23425,16 +24769,16 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool var zrUtil = require('zrender/tool/util'); var zrEvent = require('zrender/tool/event'); - var self = {}; + var self = { }; var _canvasSupported = require('zrender/tool/env').canvasSupported; var _idBase = new Date() - 0; - var _instances = {}; // ECharts实例map索引 + var _instances = { }; // ECharts实例map索引 var DOM_ATTRIBUTE_KEY = '_echarts_instance_'; - self.version = '2.0.2'; + self.version = '2.0.4'; self.dependencies = { - zrender : '2.0.2' + zrender: '2.0.4' }; /** * 入口方法 @@ -23505,12 +24849,12 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool this._connected = false; this._status = { // 用于图表间通信 - dragIn : false, - dragOut : false, - needRefresh : false + dragIn: false, + dragOut: false, + needRefresh: false }; this._curEventType = false; // 破循环信号灯 - this._chartList = []; // 图表实例 + this._chartList = [ ]; // 图表实例 this._messageCenter = new MessageCenter(); @@ -23540,7 +24884,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool * @type {Array} */ var ZR_EVENT_LISTENS = [ - 'CLICK', 'MOUSEOVER', + 'CLICK', 'DBLCLICK', 'MOUSEOVER', 'MOUSEOUT', 'DRAGSTART', 'DRAGEND', 'DRAGENTER', 'DRAGOVER', 'DRAGLEAVE', 'DROP' ]; @@ -23572,19 +24916,19 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * 初始化::构造函数 */ - _init : function () { + _init: function () { var self = this; var _zr = require('zrender').init(this.dom); this._zr = _zr; - + // wrap: n,e,d,t for name event data this this._messageCenter.dispatch = function(type, event, eventPackage, that) { - eventPackage = eventPackage || {}; + eventPackage = eventPackage || { }; eventPackage.type = type; eventPackage.event = event; self._messageCenter.dispatchWithContext(type, eventPackage, that); - if (type != 'HOVER') { + if (type != 'HOVER' && type != 'MOUSEOUT') { // 频繁事件直接抛出 setTimeout(function(){ self._messageCenterOutSide.dispatchWithContext( type, eventPackage, that @@ -23602,13 +24946,15 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool return self.__onevent(param); }; for (var e in ecConfig.EVENT) { - if (e != 'CLICK' && e != 'HOVER' && e != 'MAP_ROAM') { + if (e != 'CLICK' && e != 'DBLCLICK' + && e != 'HOVER' && e != 'MOUSEOUT' && e != 'MAP_ROAM' + ) { this._messageCenter.bind(ecConfig.EVENT[e], this._onevent, this); } } - var eventBehaviors = {}; + var eventBehaviors = { }; this._onzrevent = function (param) { return self[eventBehaviors[ param.type ]](param); }; @@ -23621,35 +24967,39 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool _zr.on(eventValue, this._onzrevent); } - this.chart = {}; // 图表索引 - this.component = {}; // 组件索引 + this.chart = { }; // 图表索引 + this.component = { }; // 组件索引 // 内置图表 // 孤岛 var Island = require('./chart/island'); - this._island = new Island(this._themeConfig, this._messageCenter, _zr, {}, this); + this._island = new Island(this._themeConfig, this._messageCenter, _zr, { }, this); this.chart.island = this._island; // 内置通用组件 // 工具箱 var Toolbox = require('./component/toolbox'); - this._toolbox = new Toolbox(this._themeConfig, this._messageCenter, _zr, {}, this); + this._toolbox = new Toolbox(this._themeConfig, this._messageCenter, _zr, { }, this); this.component.toolbox = this._toolbox; var componentLibrary = require('./component'); componentLibrary.define('title', require('./component/title')); componentLibrary.define('tooltip', require('./component/tooltip')); componentLibrary.define('legend', require('./component/legend')); + + if (_zr.getWidth() === 0 || _zr.getHeight() === 0) { + console.error('Dom’s width & height should be ready before init.'); + } }, /** * ECharts事件处理中心 */ - __onevent : function (param){ + __onevent: function (param){ param.__echartsId = param.__echartsId || this.id; // 来自其他联动图表的事件 - var fromMyself = (param.__echartsId == this.id); + var fromMyself = (param.__echartsId === this.id); if (!this._curEventType) { this._curEventType = param.type; @@ -23706,9 +25056,9 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool this._zr.trigger( 'mousemove', { - connectTrigger : true, - zrenderX : grid.getX() + param.x * grid.getWidth(), - zrenderY : grid.getY() + param.y * grid.getHeight() + connectTrigger: true, + zrenderX: grid.getX() + param.x * grid.getWidth(), + zrenderY: grid.getY() + param.y * grid.getHeight() } ); } @@ -23732,7 +25082,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool } // 多图联动,只做自己的一级事件分发,避免级联事件循环 - if (this._connected && fromMyself && this._curEventType == param.type) { + if (this._connected && fromMyself && this._curEventType === param.type) { for (var c in this._connected) { this._connected[c].connectedEventHandler(param); } @@ -23748,7 +25098,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * 点击事件,响应zrender事件,包装后分发到Echarts层 */ - _onclick : function (param) { + _onclick: function (param) { callChartListMethodReverse(this, 'onclick', param); if (param.target) { @@ -23763,11 +25113,30 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool } } }, + + /** + * 双击事件,响应zrender事件,包装后分发到Echarts层 + */ + _ondblclick: function (param) { + callChartListMethodReverse(this, 'ondblclick', param); - /** - * 鼠标移入事件,响应zrender事件,包装后分发到Echarts层 - */ - _onmouseover : function (param) { + if (param.target) { + var ecData = this._eventPackage(param.target); + if (ecData && ecData.seriesIndex != null) { + this._messageCenter.dispatch( + ecConfig.EVENT.DBLCLICK, + param.event, + ecData, + this + ); + } + } + }, + + /** + * 鼠标移入事件,响应zrender事件,包装后分发到Echarts层 + */ + _onmouseover: function (param) { if (param.target) { var ecData = this._eventPackage(param.target); if (ecData && ecData.seriesIndex != null) { @@ -23780,16 +25149,33 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool } } }, + + /** + * 鼠标移出事件,响应zrender事件,包装后分发到Echarts层 + */ + _onmouseout: function (param) { + if (param.target) { + var ecData = this._eventPackage(param.target); + if (ecData && ecData.seriesIndex != null) { + this._messageCenter.dispatch( + ecConfig.EVENT.MOUSEOUT, + param.event, + ecData, + this + ); + } + } + }, /** * dragstart回调,可计算特性实现 */ - _ondragstart : function (param) { + _ondragstart: function (param) { // 复位用于图表间通信拖拽标识 this._status = { - dragIn : false, - dragOut : false, - needRefresh : false + dragIn: false, + dragOut: false, + needRefresh: false }; callChartListMethodReverse(this, 'ondragstart', param); @@ -23798,28 +25184,28 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * dragging回调,可计算特性实现 */ - _ondragenter : function (param) { + _ondragenter: function (param) { callChartListMethodReverse(this, 'ondragenter', param); }, /** * dragstart回调,可计算特性实现 */ - _ondragover : function (param) { + _ondragover: function (param) { callChartListMethodReverse(this, 'ondragover', param); }, /** * dragstart回调,可计算特性实现 */ - _ondragleave : function (param) { + _ondragleave: function (param) { callChartListMethodReverse(this, 'ondragleave', param); }, /** * dragstart回调,可计算特性实现 */ - _ondrop : function (param) { + _ondrop: function (param) { callChartListMethodReverse(this, 'ondrop', param, this._status); this._island.ondrop(param, this._status); }, @@ -23827,7 +25213,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * dragdone回调 ,可计算特性实现 */ - _ondragend : function (param) { + _ondragend: function (param) { callChartListMethodReverse(this, 'ondragend', param, this._status); this._timeline && this._timeline.ondragend(param, this._status); @@ -23851,7 +25237,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * 图例选择响应 */ - _onlegendSelected : function (param) { + _onlegendSelected: function (param) { // 用于图表间通信 this._status.needRefresh = false; callChartListMethodReverse(this, 'onlegendSelected', param, this._status); @@ -23864,7 +25250,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * 数据区域缩放响应 */ - _ondataZoom : function (param) { + _ondataZoom: function (param) { // 用于图表间通信 this._status.needRefresh = false; callChartListMethodReverse(this, 'ondataZoom', param, this._status); @@ -23877,7 +25263,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * 值域漫游响应 */ - _ondataRange : function (param) { + _ondataRange: function (param) { this._clearEffect(); // 用于图表间通信 this._status.needRefresh = false; @@ -23892,7 +25278,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * 动态类型切换响应 */ - _onmagicTypeChanged : function () { + _onmagicTypeChanged: function () { this._clearEffect(); this._render(this._toolbox.getMagicOption()); }, @@ -23900,7 +25286,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * 数据视图修改响应 */ - _ondataViewChanged : function (param) { + _ondataViewChanged: function (param) { this._syncBackupData(param.option); this._messageCenter.dispatch( ecConfig.EVENT.DATA_CHANGED, @@ -23914,22 +25300,22 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * tooltip与图表间通信 */ - _tooltipHover : function (param) { - var tipShape = []; + _tooltipHover: function (param) { + var tipShape = [ ]; callChartListMethodReverse(this, 'ontooltipHover', param, tipShape); }, /** * 还原 */ - _onrestore : function () { + _onrestore: function () { this.restore(); }, /** * 刷新 */ - _onrefresh : function (param) { + _onrefresh: function (param) { this._refreshInside = true; this.refresh(param); this._refreshInside = false; @@ -23938,14 +25324,14 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * 数据修改后的反向同步dataZoom持有的备份数据 */ - _syncBackupData : function (curOption) { + _syncBackupData: function (curOption) { this.component.dataZoom && this.component.dataZoom.syncBackupData(curOption); }, /** * 打包Echarts层的事件附件 */ - _eventPackage : function (target) { + _eventPackage: function (target) { if (target) { var ecData = require('./util/ecData'); @@ -23959,12 +25345,13 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool ) : dataIndex; return { - seriesIndex : seriesIndex, - dataIndex : dataIndex, - data : ecData.get(target, 'data'), - name : ecData.get(target, 'name'), - value : ecData.get(target, 'value'), - special : ecData.get(target, 'special') + seriesIndex: seriesIndex, + seriesName: (ecData.get(target, 'series') || { }).name, + dataIndex: dataIndex, + data: ecData.get(target, 'data'), + name: ecData.get(target, 'name'), + value: ecData.get(target, 'value'), + special: ecData.get(target, 'special') }; } return; @@ -23973,7 +25360,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * 图表渲染 */ - _render : function (magicOption) { + _render: function (magicOption) { this._mergeGlobalConifg(magicOption); var bgColor = magicOption.backgroundColor; @@ -23996,18 +25383,18 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool } this._zr.clearAnimation(); - this._chartList = []; + this._chartList = [ ]; var chartLibrary = require('./chart'); var componentLibrary = require('./component'); if (magicOption.xAxis || magicOption.yAxis) { - magicOption.grid = magicOption.grid || {}; - magicOption.dataZoom = magicOption.dataZoom || {}; + magicOption.grid = magicOption.grid || { }; + magicOption.dataZoom = magicOption.dataZoom || { }; } var componentList = [ - 'title', 'legend', 'tooltip', 'dataRange', + 'title', 'legend', 'tooltip', 'dataRange', 'roamController', 'grid', 'dataZoom', 'xAxis', 'yAxis', 'polar' ]; @@ -24044,7 +25431,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool var ChartClass; var chartType; var chart; - var chartMap = {}; // 记录已经初始化的图表 + var chartMap = { }; // 记录已经初始化的图表 for (var i = 0, l = magicOption.series.length; i < l; i++) { chartType = magicOption.series[i].type; if (!chartType) { @@ -24127,7 +25514,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * 还原 */ - restore : function () { + restore: function () { this._clearEffect(); this._option = zrUtil.clone(this._optionRestore); this._disposeChartList(); @@ -24140,9 +25527,9 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool * 刷新 * @param {Object=} param,可选参数,用于附带option,内部同步用,外部不建议带入数据修改,无法同步 */ - refresh : function (param) { + refresh: function (param) { this._clearEffect(); - param = param || {}; + param = param || { }; var magicOption = param.option; // 外部调用的refresh且有option带入 @@ -24172,7 +25559,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * 释放图表实例 */ - _disposeChartList : function () { + _disposeChartList: function () { this._clearEffect(); // 停止动画 @@ -24190,13 +25577,13 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool } } - this._chartList = []; + this._chartList = [ ]; }, /** * 非图表全局属性merge~~ */ - _mergeGlobalConifg : function (magicOption) { + _mergeGlobalConifg: function (magicOption) { var mergeList = [ // 背景颜色 'backgroundColor', @@ -24244,7 +25631,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool * @param {boolean=} notMerge 多次调用时option选项是默认是合并(merge)的, * 如果不需求,可以通过notMerger参数为true阻止与上次option的合并 */ - setOption : function (option, notMerge) { + setOption: function (option, notMerge) { if (!option.timeline) { return this._setOption(option, notMerge); } @@ -24259,7 +25646,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool * @param {boolean=} notMerge 多次调用时option选项是默认是合并(merge)的, * 如果不需求,可以通过notMerger参数为true阻止与上次option的合并 */ - _setOption : function (option, notMerge) { + _setOption: function (option, notMerge) { if (!notMerge && this._option) { this._option = zrUtil.merge( this.getOption(), @@ -24298,7 +25685,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * 返回内部持有的当前显示option克隆 */ - getOption : function () { + getOption: function () { var magicOption = zrUtil.clone(this._option); var self = this; @@ -24338,7 +25725,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool * @param {boolean=} notMerge 多次调用时option选项是默认是合并(merge)的, * 如果不需求,可以通过notMerger参数为true阻止与上次option的合并。 */ - setSeries : function (series, notMerge) { + setSeries: function (series, notMerge) { if (!notMerge) { this.setOption({series: series}); } @@ -24352,7 +25739,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * 返回内部持有的当前显示series克隆 */ - getSeries : function () { + getSeries: function () { return this.getOption().series; }, @@ -24360,7 +25747,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool * timelineOption接口,配置图表实例任何可配置选项 * @param {Object} option */ - _setTimelineOption : function(option) { + _setTimelineOption: function(option) { this._timeline && this._timeline.dispose(); var Timeline = require('./component/timeline'); var timeline = new Timeline( @@ -24381,7 +25768,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool * @param {boolean=} dataGrow 是否增长数据队列长度,默认,不指定或false时移出目标数组对位数据 * @param {string=} additionData 是否增加类目轴(饼图为图例)数据,附加操作同isHead和dataGrow */ - addData : function (seriesIdx, data, isHead, dataGrow, additionData) { + addData: function (seriesIdx, data, isHead, dataGrow, additionData) { var params = seriesIdx instanceof Array ? seriesIdx : [[seriesIdx, data, isHead, dataGrow, additionData]]; @@ -24416,7 +25803,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool var legend; var legendData; - if (seriesItem.type == ecConfig.CHART_TYPE_PIE + if (seriesItem.type === ecConfig.CHART_TYPE_PIE && (legend = optionRestore.legend) && (legendData = legend.data) ) { @@ -24438,8 +25825,8 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool var mAxisData; var axisIdx = seriesItem.xAxisIndex || 0; - if (typeof optionRestore.xAxis[axisIdx].type == 'undefined' - || optionRestore.xAxis[axisIdx].type == 'category' + if (optionRestore.xAxis[axisIdx].type == null + || optionRestore.xAxis[axisIdx].type === 'category' ) { axisData = optionRestore.xAxis[axisIdx].data; mAxisData = magicOption.xAxis[axisIdx].data; @@ -24454,7 +25841,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool // y轴类目 axisIdx = seriesItem.yAxisIndex || 0; - if (optionRestore.yAxis[axisIdx].type == 'category') { + if (optionRestore.yAxis[axisIdx].type === 'category') { axisData = optionRestore.yAxis[axisIdx].data; mAxisData = magicOption.yAxis[axisIdx].data; @@ -24511,15 +25898,15 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool * @param {number} seriesIdx 系列索引 * @param {Object} markData [标注 | 标线]对象,支持多个 */ - addMarkPoint : function (seriesIdx, markData) { + addMarkPoint: function (seriesIdx, markData) { return this._addMark(seriesIdx, markData, 'markPoint'); }, - addMarkLine : function (seriesIdx, markData) { + addMarkLine: function (seriesIdx, markData) { return this._addMark(seriesIdx, markData, 'markLine'); }, - _addMark : function (seriesIdx, markData, markType) { + _addMark: function (seriesIdx, markData, markType) { var series = this._option.series; var seriesItem; @@ -24529,18 +25916,16 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool var markOpt = seriesItem[markType]; var markOptR = seriesRItem[markType]; - markOpt = seriesItem[markType] = markOpt || {data: []}; - markOptR = seriesRItem[markType] = markOptR || {data: []}; + markOpt = seriesItem[markType] = markOpt || {data: [ ]}; + markOptR = seriesRItem[markType] = markOptR || {data: [ ]}; for (var key in markData) { - if (key == 'data') { + if (key === 'data') { // 数据concat markOpt.data = markOpt.data.concat(markData.data); markOptR.data = markOptR.data.concat(markData.data); } - else if (typeof markData[key] != 'object' - || typeof markOpt[key] == 'undefined' - ) { + else if (typeof markData[key] != 'object' || markOpt[key] == null) { // 简单类型或新值直接赋值 markOpt[key] = markOptR[key] = markData[key]; } @@ -24563,15 +25948,15 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool * @param {number} seriesIdx 系列索引 * @param {string} markName [标注 | 标线]名称 */ - delMarkPoint : function (seriesIdx, markName) { + delMarkPoint: function (seriesIdx, markName) { return this._delMark(seriesIdx, markName, 'markPoint'); }, - delMarkLine : function (seriesIdx, markName) { + delMarkLine: function (seriesIdx, markName) { return this._delMark(seriesIdx, markName, 'markLine'); }, - _delMark : function (seriesIdx, markName, markType) { + _delMark: function (seriesIdx, markName, markType) { var series = this._option.series; var seriesItem; var mark; @@ -24593,14 +25978,14 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool for (var i = 0, l = dataArray.length; i < l; i++) { var dataItem = dataArray[i]; if (dataItem instanceof Array) { - if (dataItem[0].name == markName[0] - && dataItem[1].name == markName[1] + if (dataItem[0].name === markName[0] + && dataItem[1].name === markName[1] ) { targetIndex = i; break; } } - else if (dataItem.name == markName[0]) { + else if (dataItem.name === markName[0]) { targetIndex = i; break; } @@ -24620,14 +26005,14 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * 获取当前dom */ - getDom : function () { + getDom: function () { return this.dom; }, /** * 获取当前zrender实例,可用于添加额为的shape和深度控制 */ - getZrender : function () { + getZrender: function () { return this._zr; }, @@ -24636,7 +26021,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool * @param {string} imgType 图片类型,支持png|jpeg,默认为png * @return imgDataURL */ - getDataURL : function (imgType) { + getDataURL: function (imgType) { if (!_canvasSupported) { return ''; } @@ -24662,7 +26047,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool } var bgColor = this._option.backgroundColor; - if (bgColor && bgColor.replace(' ','') == 'rgba(0,0,0,0)') { + if (bgColor && bgColor.replace(' ','') === 'rgba(0,0,0,0)') { bgColor = '#fff'; } @@ -24674,7 +26059,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool * @param {string} imgType 图片类型,支持png|jpeg,默认为png * @return img dom */ - getImage : function (imgType) { + getImage: function (imgType) { var title = this._optionRestore.title; var imgDom = document.createElement('img'); imgDom.src = this.getDataURL(imgType); @@ -24687,19 +26072,19 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool * @param {string} imgType 图片类型,支持png|jpeg,默认为png * @return imgDataURL */ - getConnectedDataURL : function (imgType) { + getConnectedDataURL: function (imgType) { if (!this.isConnected()) { return this.getDataURL(imgType); } var tempDom = this.dom; var imgList = { - 'self' : { - img : this.getDataURL(imgType), - left : tempDom.offsetLeft, - top : tempDom.offsetTop, - right : tempDom.offsetLeft + tempDom.offsetWidth, - bottom : tempDom.offsetTop + tempDom.offsetHeight + 'self': { + img: this.getDataURL(imgType), + left: tempDom.offsetLeft, + top: tempDom.offsetTop, + right: tempDom.offsetLeft + tempDom.offsetWidth, + bottom: tempDom.offsetTop + tempDom.offsetHeight } }; @@ -24711,11 +26096,11 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool for (var c in this._connected) { tempDom = this._connected[c].getDom(); imgList[c] = { - img : this._connected[c].getDataURL(imgType), - left : tempDom.offsetLeft, - top : tempDom.offsetTop, - right : tempDom.offsetLeft + tempDom.offsetWidth, - bottom : tempDom.offsetTop + tempDom.offsetHeight + img: this._connected[c].getDataURL(imgType), + left: tempDom.offsetLeft, + top: tempDom.offsetTop, + right: tempDom.offsetLeft + tempDom.offsetWidth, + bottom: tempDom.offsetTop + tempDom.offsetHeight }; minLeft = Math.min(minLeft, imgList[c].left); @@ -24736,17 +26121,17 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool var ImageShape = require('zrender/shape/Image'); for (var c in imgList) { zrImg.addShape(new ImageShape({ - style : { - x : imgList[c].left - minLeft, - y : imgList[c].top - minTop, - image : imgList[c].img + style: { + x: imgList[c].left - minLeft, + y: imgList[c].top - minTop, + image: imgList[c].img } })); } zrImg.render(); var bgColor = this._option.backgroundColor; - if (bgColor && bgColor.replace(/ /g, '') == 'rgba(0,0,0,0)') { + if (bgColor && bgColor.replace(/ /g, '') === 'rgba(0,0,0,0)') { bgColor = '#fff'; } @@ -24766,7 +26151,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool * @param {string} imgType 图片类型,支持png|jpeg,默认为png * @return img dom */ - getConnectedImage : function (imgType) { + getConnectedImage: function (imgType) { var title = this._optionRestore.title; var imgDom = document.createElement('img'); imgDom.src = this.getConnectedDataURL(imgType); @@ -24779,7 +26164,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool * @param {Object} eventName 事件名称 * @param {Object} eventListener 事件响应函数 */ - on : function (eventName, eventListener) { + on: function (eventName, eventListener) { this._messageCenterOutSide.bind(eventName, eventListener, this); return this; }, @@ -24789,7 +26174,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool * @param {Object} eventName 事件名称 * @param {Object} eventListener 事件响应函数 */ - un : function (eventName, eventListener) { + un: function (eventName, eventListener) { this._messageCenterOutSide.unbind(eventName, eventListener); return this; }, @@ -24798,13 +26183,13 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool * 多图联动 * @param connectTarget{ECharts | Array } connectTarget 联动目标 */ - connect : function (connectTarget) { + connect: function (connectTarget) { if (!connectTarget) { return this; } if (!this._connected) { - this._connected = {}; + this._connected = { }; } if (connectTarget instanceof Array) { @@ -24823,7 +26208,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool * 解除多图联动 * @param connectTarget{ECharts | Array } connectTarget 解除联动目标 */ - disConnect : function (connectTarget) { + disConnect: function (connectTarget) { if (!connectTarget || !this._connected) { return this; } @@ -24849,7 +26234,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * 联动事件响应 */ - connectedEventHandler : function (param) { + connectedEventHandler: function (param) { if (param.__echartsId != this.id) { // 来自其他联动图表的事件 this._onevent(param); @@ -24859,7 +26244,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * 是否存在多图联动 */ - isConnected : function () { + isConnected: function () { return !!this._connected; }, @@ -24867,20 +26252,20 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool * 显示loading过渡 * @param {Object} loadingOption */ - showLoading : function (loadingOption) { + showLoading: function (loadingOption) { var effectList = { - bar : require('zrender/loadingEffect/Bar'), - bubble : require('zrender/loadingEffect/Bubble'), - dynamicLine : require('zrender/loadingEffect/DynamicLine'), - ring : require('zrender/loadingEffect/Ring'), - spin : require('zrender/loadingEffect/Spin'), - whirling : require('zrender/loadingEffect/Whirling') + bar: require('zrender/loadingEffect/Bar'), + bubble: require('zrender/loadingEffect/Bubble'), + dynamicLine: require('zrender/loadingEffect/DynamicLine'), + ring: require('zrender/loadingEffect/Ring'), + spin: require('zrender/loadingEffect/Spin'), + whirling: require('zrender/loadingEffect/Whirling') }; this._toolbox.hideDataView(); - loadingOption = loadingOption || {}; + loadingOption = loadingOption || { }; - var textStyle = loadingOption.textStyle || {}; + var textStyle = loadingOption.textStyle || { }; loadingOption.textStyle = textStyle; var finalTextStyle = zrUtil.merge( @@ -24901,11 +26286,11 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool textStyle.y = loadingOption.y; } - loadingOption.effectOption = loadingOption.effectOption || {}; + loadingOption.effectOption = loadingOption.effectOption || { }; loadingOption.effectOption.textStyle = textStyle; var Effect = loadingOption.effect; - if (typeof Effect == 'string' || Effect == null) { + if (typeof Effect === 'string' || Effect == null) { Effect = effectList[loadingOption.effect || 'spin']; } this._zr.showLoading(new Effect(loadingOption.effectOption)); @@ -24915,7 +26300,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * 隐藏loading过渡 */ - hideLoading : function () { + hideLoading: function () { this._zr.hideLoading(); return this; }, @@ -24923,7 +26308,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * 主题设置 */ - setTheme : function (theme) { + setTheme: function (theme) { if (theme) { if (typeof theme === 'string') { // 默认主题 @@ -24935,12 +26320,12 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool } } else { - theme = theme || {}; + theme = theme || { }; } // 复位默认配置 // this._themeConfig会被别的对象引用持有 - // 所以不能改成this._themeConfig = {}; + // 所以不能改成this._themeConfig = { }; for (var key in this._themeConfig) { delete this._themeConfig[key]; } @@ -24949,10 +26334,10 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool } // 颜色数组随theme,不merge - theme.color && (this._themeConfig.color = []); + theme.color && (this._themeConfig.color = [ ]); // 默认标志图形类型列表,不merge - theme.symbolList && (this._themeConfig.symbolList = []); + theme.symbolList && (this._themeConfig.symbolList = [ ]); // 应用新主题 zrUtil.merge(this._themeConfig, zrUtil.clone(theme), true); @@ -24969,7 +26354,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * 视图区域大小变化更新,不默认绑定,供使用方按需调用 */ - resize : function () { + resize: function () { var self = this; return function(){ self._clearEffect(); @@ -24996,26 +26381,26 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool }; }, - _clearEffect : function() { - this._zr.modLayer(ecConfig.EFFECT_ZLEVEL, {motionBlur : false}); + _clearEffect: function() { + this._zr.modLayer(ecConfig.EFFECT_ZLEVEL, { motionBlur: false }); this._zr.painter.clearLayer(ecConfig.EFFECT_ZLEVEL); }, /** * 清除已渲染内容 ,clear后echarts实例可用 */ - clear : function () { + clear: function () { this._disposeChartList(); this._zr.clear(); - this._option = {}; - this._optionRestore = {}; + this._option = { }; + this._optionRestore = { }; return this; }, /** * 释放,dispose后echarts实例不可用 */ - dispose : function () { + dispose: function () { var key = this.dom.getAttribute(DOM_ATTRIBUTE_KEY); key && delete _instances[key]; @@ -25174,16 +26559,16 @@ define('echarts/chart/gauge',['require','../component/base','./base','../util/sh } Gauge.prototype = { - type : ecConfig.CHART_TYPE_GAUGE, + type: ecConfig.CHART_TYPE_GAUGE, /** * 绘制图形 */ - _buildShape : function () { + _buildShape: function () { var series = this.series; // 复用参数索引 this._paramsMap = {}; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type == ecConfig.CHART_TYPE_GAUGE) { + if (series[i].type === ecConfig.CHART_TYPE_GAUGE) { series[i] = this.reformOption(series[i]); this._buildSingleGauge(i); this.buildMark(i); @@ -25198,14 +26583,14 @@ define('echarts/chart/gauge',['require','../component/base','./base','../util/sh * * @param {number} seriesIndex 系列索引 */ - _buildSingleGauge : function (seriesIndex) { + _buildSingleGauge: function (seriesIndex) { var serie = this.series[seriesIndex]; this._paramsMap[seriesIndex] = { - center : this.parseCenter(this.zr, serie.center), - radius : this.parseRadius(this.zr, serie.radius), - startAngle : serie.startAngle.toFixed(2) - 0, - endAngle : serie.endAngle.toFixed(2) - 0 + center: this.parseCenter(this.zr, serie.center), + radius: this.parseRadius(this.zr, serie.radius), + startAngle: serie.startAngle.toFixed(2) - 0, + endAngle: serie.endAngle.toFixed(2) - 0 }; this._paramsMap[seriesIndex].totalAngle = this._paramsMap[seriesIndex].startAngle - this._paramsMap[seriesIndex].endAngle; @@ -25228,7 +26613,7 @@ define('echarts/chart/gauge',['require','../component/base','./base','../util/sh }, // 轴线 - _buildAxisLine : function (seriesIndex) { + _buildAxisLine: function (seriesIndex) { var serie = this.series[seriesIndex]; if (!serie.axisLine.show) { return; @@ -25266,7 +26651,7 @@ define('echarts/chart/gauge',['require','../component/base','./base','../util/sh }, // 坐标轴分割线 - _buildSplitLine : function (seriesIndex) { + _buildSplitLine: function (seriesIndex) { var serie = this.series[seriesIndex]; if (!serie.splitLine.show) { return; @@ -25296,19 +26681,19 @@ define('echarts/chart/gauge',['require','../component/base','./base','../util/sh sinAngle = Math.sin(angle); cosAngle = Math.cos(angle); this.shapeList.push(new LineShape({ - zlevel : this._zlevelBase + 1, - hoverable : false, - style : { - xStart : center[0] + cosAngle * r, - yStart : center[1] - sinAngle * r, - xEnd : center[0] + cosAngle * r0, - yEnd : center[1] - sinAngle * r0, - strokeColor : color == 'auto' - ? this._getColor(seriesIndex, min + total / splitNumber * i) - : color, - lineType : lineStyle.type, - lineWidth : lineStyle.width, - shadowColor : lineStyle.shadowColor, + zlevel: this._zlevelBase + 1, + hoverable: false, + style: { + xStart: center[0] + cosAngle * r, + yStart: center[1] - sinAngle * r, + xEnd: center[0] + cosAngle * r0, + yEnd: center[1] - sinAngle * r0, + strokeColor: color === 'auto' + ? this._getColor(seriesIndex, min + total / splitNumber * i) + : color, + lineType: lineStyle.type, + lineWidth: lineStyle.width, + shadowColor: lineStyle.shadowColor, shadowBlur: lineStyle.shadowBlur, shadowOffsetX: lineStyle.shadowOffsetX, shadowOffsetY: lineStyle.shadowOffsetY @@ -25318,7 +26703,7 @@ define('echarts/chart/gauge',['require','../component/base','./base','../util/sh }, // 小标记 - _buildAxisTick : function (seriesIndex) { + _buildAxisTick: function (seriesIndex) { var serie = this.series[seriesIndex]; if (!serie.axisTick.show) { return; @@ -25353,19 +26738,19 @@ define('echarts/chart/gauge',['require','../component/base','./base','../util/sh sinAngle = Math.sin(angle); cosAngle = Math.cos(angle); this.shapeList.push(new LineShape({ - zlevel : this._zlevelBase + 1, - hoverable : false, - style : { - xStart : center[0] + cosAngle * r, - yStart : center[1] - sinAngle * r, - xEnd : center[0] + cosAngle * r0, - yEnd : center[1] - sinAngle * r0, - strokeColor : color == 'auto' - ? this._getColor(seriesIndex, min + total / l * i) - : color, - lineType : lineStyle.type, - lineWidth : lineStyle.width, - shadowColor : lineStyle.shadowColor, + zlevel: this._zlevelBase + 1, + hoverable: false, + style: { + xStart: center[0] + cosAngle * r, + yStart: center[1] - sinAngle * r, + xEnd: center[0] + cosAngle * r0, + yEnd: center[1] - sinAngle * r0, + strokeColor: color === 'auto' + ? this._getColor(seriesIndex, min + total / l * i) + : color, + lineType: lineStyle.type, + lineWidth: lineStyle.width, + shadowColor: lineStyle.shadowColor, shadowBlur: lineStyle.shadowBlur, shadowOffsetX: lineStyle.shadowOffsetX, shadowOffsetY: lineStyle.shadowOffsetY @@ -25375,7 +26760,7 @@ define('echarts/chart/gauge',['require','../component/base','./base','../util/sh }, // 坐标轴文本 - _buildAxisLabel : function (seriesIndex) { + _buildAxisLabel: function (seriesIndex) { var serie = this.series[seriesIndex]; if (!serie.axisLabel.show) { return; @@ -25402,31 +26787,33 @@ define('echarts/chart/gauge',['require','../component/base','./base','../util/sh var cosAngle; var value; for (var i = 0; i <= splitNumber; i++) { - value = min + accMath.accMul(accMath.accDiv(total , splitNumber) , i); + value = accMath.accAdd( + min , accMath.accMul(accMath.accDiv(total , splitNumber), i) + ); angle = startAngle - totalAngle / splitNumber * i; sinAngle = Math.sin(angle * Math.PI / 180); cosAngle = Math.cos(angle * Math.PI / 180); angle = (angle + 360) % 360; this.shapeList.push(new TextShape({ - zlevel : this._zlevelBase + 1, - hoverable : false, - style : { - x : center[0] + cosAngle * r0, - y : center[1] - sinAngle * r0, - color : color == 'auto' ? this._getColor(seriesIndex, value) : color, - text : this._getLabelText(serie.axisLabel.formatter, value), - textAlign : (angle >= 110 && angle <= 250) - ? 'left' - : (angle <= 70 || angle >= 290) - ? 'right' - : 'center', - textBaseline : (angle >= 10 && angle <= 170) - ? 'top' - : (angle >= 190 && angle <= 350) - ? 'bottom' - : 'middle', - textFont : textFont, - shadowColor : textStyle.shadowColor, + zlevel: this._zlevelBase + 1, + hoverable: false, + style: { + x: center[0] + cosAngle * r0, + y: center[1] - sinAngle * r0, + color: color === 'auto' ? this._getColor(seriesIndex, value) : color, + text: this._getLabelText(serie.axisLabel.formatter, value), + textAlign: (angle >= 110 && angle <= 250) + ? 'left' + : (angle <= 70 || angle >= 290) + ? 'right' + : 'center', + textBaseline: (angle >= 10 && angle <= 170) + ? 'top' + : (angle >= 190 && angle <= 350) + ? 'bottom' + : 'middle', + textFont: textFont, + shadowColor: textStyle.shadowColor, shadowBlur: textStyle.shadowBlur, shadowOffsetX: textStyle.shadowOffsetX, shadowOffsetY: textStyle.shadowOffsetY @@ -25435,13 +26822,13 @@ define('echarts/chart/gauge',['require','../component/base','./base','../util/sh } }, - _buildPointer : function (seriesIndex) { - var serie = this.series[seriesIndex]; + _buildPointer: function (seriesIndex) { + var serie = this.series[seriesIndex]; if (!serie.pointer.show) { return; } - var total = serie.max - serie.min; - var pointer = serie.pointer; + var total = serie.max - serie.min; + var pointer = serie.pointer; var params = this._paramsMap[seriesIndex]; var length = this.parsePercent(pointer.length, params.radius[1]); @@ -25451,28 +26838,28 @@ define('echarts/chart/gauge',['require','../component/base','./base','../util/sh value = value < serie.max ? value : serie.max; var angle = (params.startAngle - params.totalAngle / total * (value - serie.min)) * Math.PI / 180; - var color = pointer.color == 'auto' + var color = pointer.color === 'auto' ? this._getColor(seriesIndex, value) : pointer.color; var pointShape = new GaugePointerShape({ - zlevel : this._zlevelBase + 1, - style : { - x : center[0], - y : center[1], - r : length, - startAngle : params.startAngle * Math.PI / 180, - angle : angle, - color : color, - width : width, - shadowColor : pointer.shadowColor, + zlevel: this._zlevelBase + 1, + style: { + x: center[0], + y: center[1], + r: length, + startAngle: params.startAngle * Math.PI / 180, + angle: angle, + color: color, + width: width, + shadowColor: pointer.shadowColor, shadowBlur: pointer.shadowBlur, shadowOffsetX: pointer.shadowOffsetX, shadowOffsetY: pointer.shadowOffsetY }, - highlightStyle : { - brushType : 'fill', - width : width > 2 ? 2 : (width / 2), - color : '#fff' + highlightStyle: { + brushType: 'fill', + width: width > 2 ? 2 : (width / 2), + color: '#fff' } }); ecData.pack( @@ -25485,26 +26872,26 @@ define('echarts/chart/gauge',['require','../component/base','./base','../util/sh this.shapeList.push(pointShape); this.shapeList.push(new CircleShape({ - zlevel : this._zlevelBase + 2, - hoverable : false, - style : { - x : center[0], - y : center[1], - r : pointer.width / 2.5, - color : '#fff' + zlevel: this._zlevelBase + 2, + hoverable: false, + style: { + x: center[0], + y: center[1], + r: pointer.width / 2.5, + color: '#fff' } })); }, - _buildTitle : function(seriesIndex) { + _buildTitle: function(seriesIndex) { var serie = this.series[seriesIndex]; if (!serie.title.show) { return; } var data = serie.data[0]; - var name = typeof data.name != 'undefined' ? data.name : ''; - if (name !== '') { + var name = data.name != null ? data.name : ''; + if (name !== '') { // 不要帮我代码规范 var title = serie.title; var offsetCenter = title.offsetCenter; var textStyle = title.textStyle; @@ -25513,18 +26900,18 @@ define('echarts/chart/gauge',['require','../component/base','./base','../util/sh var x = params.center[0] + this.parsePercent(offsetCenter[0], params.radius[1]); var y = params.center[1] + this.parsePercent(offsetCenter[1], params.radius[1]); this.shapeList.push(new TextShape({ - zlevel : this._zlevelBase + zlevel: this._zlevelBase + (Math.abs(x - params.center[0]) + Math.abs(y - params.center[1])) < textStyle.fontSize * 2 ? 2 : 1, - hoverable : false, - style : { - x : x, - y : y, - color: textColor == 'auto' ? this._getColor(seriesIndex) : textColor, + hoverable: false, + style: { + x: x, + y: y, + color: textColor === 'auto' ? this._getColor(seriesIndex) : textColor, text: name, textAlign: 'center', - textFont : this.getFont(textStyle), - shadowColor : textStyle.shadowColor, + textFont: this.getFont(textStyle), + shadowColor: textStyle.shadowColor, shadowBlur: textStyle.shadowBlur, shadowOffsetX: textStyle.shadowOffsetX, shadowOffsetY: textStyle.shadowOffsetY @@ -25533,7 +26920,7 @@ define('echarts/chart/gauge',['require','../component/base','./base','../util/sh } }, - _buildDetail : function(seriesIndex) { + _buildDetail: function(seriesIndex) { var serie = this.series[seriesIndex]; if (!serie.detail.show) { return; @@ -25552,22 +26939,22 @@ define('echarts/chart/gauge',['require','../component/base','./base','../util/sh var y = params.center[1] + this.parsePercent(offsetCenter[1], params.radius[1]); this.shapeList.push(new RectangleShape({ - zlevel : this._zlevelBase - + (Math.abs(x+detail.width/2 - params.center[0]) - + Math.abs(y+detail.height/2 - params.center[1])) - < textStyle.fontSize ? 2 : 1, - hoverable : false, - style : { - x : x, - y : y, - width : detail.width, - height : detail.height, + zlevel: this._zlevelBase + + (Math.abs(x+detail.width/2 - params.center[0]) + + Math.abs(y+detail.height/2 - params.center[1])) < textStyle.fontSize + ? 2 : 1, + hoverable: false, + style: { + x: x, + y: y, + width: detail.width, + height: detail.height, brushType: 'both', - color: color == 'auto' ? this._getColor(seriesIndex, value) : color, - lineWidth : detail.borderWidth, - strokeColor : detail.borderColor, + color: color === 'auto' ? this._getColor(seriesIndex, value) : color, + lineWidth: detail.borderWidth, + strokeColor: detail.borderColor, - shadowColor : detail.shadowColor, + shadowColor: detail.shadowColor, shadowBlur: detail.shadowBlur, shadowOffsetX: detail.shadowOffsetX, shadowOffsetY: detail.shadowOffsetY, @@ -25575,20 +26962,20 @@ define('echarts/chart/gauge',['require','../component/base','./base','../util/sh text: this._getLabelText(detail.formatter, value), textFont: this.getFont(textStyle), textPosition: 'inside', - textColor : textColor == 'auto' ? this._getColor(seriesIndex, value) : textColor + textColor: textColor === 'auto' ? this._getColor(seriesIndex, value) : textColor } })); }, - _getValue : function(seriesIndex) { + _getValue: function(seriesIndex) { var data = this.series[seriesIndex].data[0]; - return typeof data.value != 'undefined' ? data.value : data; + return data.value != null ? data.value : data; }, /** * 颜色索引 */ - _colorMap : function (seriesIndex) { + _colorMap: function (seriesIndex) { var serie = this.series[seriesIndex]; var min = serie.min; var total = serie.max - min; @@ -25606,8 +26993,8 @@ define('echarts/chart/gauge',['require','../component/base','./base','../util/sh /** * 自动颜色 */ - _getColor : function (seriesIndex, value) { - if (typeof value == 'undefined') { + _getColor: function (seriesIndex, value) { + if (value == null) { value = this._getValue(seriesIndex); } @@ -25623,20 +27010,20 @@ define('echarts/chart/gauge',['require','../component/base','./base','../util/sh /** * 构建扇形 */ - _getSector : function (center, r0, r, startAngle, endAngle, color, lineStyle) { + _getSector: function (center, r0, r, startAngle, endAngle, color, lineStyle) { return new SectorShape ({ - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : center[0], // 圆心横坐标 - y : center[1], // 圆心纵坐标 - r0 : r0, // 圆环内半径 - r : r, // 圆环外半径 - startAngle : startAngle, - endAngle : endAngle, - brushType : 'fill', - color : color, - shadowColor : lineStyle.shadowColor, + zlevel: this._zlevelBase, + hoverable: false, + style: { + x: center[0], // 圆心横坐标 + y: center[1], // 圆心纵坐标 + r0: r0, // 圆环内半径 + r: r, // 圆环外半径 + startAngle: startAngle, + endAngle: endAngle, + brushType: 'fill', + color: color, + shadowColor: lineStyle.shadowColor, shadowBlur: lineStyle.shadowBlur, shadowOffsetX: lineStyle.shadowOffsetX, shadowOffsetY: lineStyle.shadowOffsetY @@ -25647,12 +27034,12 @@ define('echarts/chart/gauge',['require','../component/base','./base','../util/sh /** * 根据lable.format计算label text */ - _getLabelText : function (formatter, value) { + _getLabelText: function (formatter, value) { if (formatter) { - if (typeof formatter == 'function') { + if (typeof formatter === 'function') { return formatter.call(this.myChart, value); } - else if (typeof formatter == 'string') { + else if (typeof formatter === 'string') { return formatter.replace('{value}', value); } } @@ -25662,7 +27049,7 @@ define('echarts/chart/gauge',['require','../component/base','./base','../util/sh /** * 刷新 */ - refresh : function (newOption) { + refresh: function (newOption) { if (newOption) { this.option = newOption; this.series = newOption.series; @@ -25720,11 +27107,11 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s } Funnel.prototype = { - type : ecConfig.CHART_TYPE_FUNNEL, + type: ecConfig.CHART_TYPE_FUNNEL, /** * 绘制图形 */ - _buildShape : function () { + _buildShape: function () { var series = this.series; var legend = this.component.legend; // 复用参数索引 @@ -25734,12 +27121,11 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s var serieName; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type == ecConfig.CHART_TYPE_FUNNEL) { + if (series[i].type === ecConfig.CHART_TYPE_FUNNEL) { series[i] = this.reformOption(series[i]); serieName = series[i].name || ''; // 系列图例开关 - this.selectedMap[serieName] = - legend ? legend.isSelected(serieName) : true; + this.selectedMap[serieName] = legend ? legend.isSelected(serieName) : true; if (!this.selectedMap[serieName]) { continue; } @@ -25756,14 +27142,14 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s * * @param {number} seriesIndex 系列索引 */ - _buildSingleFunnel : function (seriesIndex) { + _buildSingleFunnel: function (seriesIndex) { var legend = this.component.legend; var serie = this.series[seriesIndex]; var data = this._mapData(seriesIndex); var location = this._getLocation(seriesIndex); this._paramsMap[seriesIndex] = { - location : location, - data : data + location: location, + data: data }; var itemName; @@ -25792,10 +27178,10 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s ? (location.height - (total - 1) * gap) / total : location.height; var width; var lastY = location.y; - var lastWidth = serie.sort == 'descending' + var lastWidth = serie.sort === 'descending' ? this._getItemWidth(seriesIndex, selectedData[0].value) : number.parsePercent(serie.minSize, location.width); - var next = serie.sort == 'descending' ? 1 : 0; + var next = serie.sort === 'descending' ? 1 : 0; var centerX = location.centerX; var pointList = [ [ @@ -25812,7 +27198,7 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s if (this.selectedMap[itemName] && !isNaN(selectedData[i].value)) { width = i <= l - 2 ? this._getItemWidth(seriesIndex, selectedData[i + next].value) - : serie.sort == 'descending' + : serie.sort === 'descending' ? number.parsePercent(serie.minSize, location.width) : number.parsePercent(serie.maxSize, location.width); this._buildItem( @@ -25842,24 +27228,24 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s } }, - _buildFunnelCase : function(seriesIndex) { + _buildFunnelCase: function(seriesIndex) { var serie = this.series[seriesIndex]; if (this.deepQuery([serie, this.option], 'calculable')) { var location = this._paramsMap[seriesIndex].location; var gap = 10; var funnelCase = { - hoverable : false, - style : { - pointListd : [ + hoverable: false, + style: { + pointListd: [ [location.x - gap, location.y - gap], [location.x + location.width + gap, location.y - gap], [location.x + location.width + gap, location.y + location.height + gap], [location.x - gap, location.y + location.height + gap] ], - brushType : 'stroke', - lineWidth : 1, - strokeColor : serie.calculableHolderColor - || this.ecTheme.calculableHolderColor + brushType: 'stroke', + lineWidth: 1, + strokeColor: serie.calculableHolderColor + || this.ecTheme.calculableHolderColor } }; ecData.pack(funnelCase, serie, seriesIndex, undefined, -1); @@ -25878,7 +27264,7 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s var y = this.parsePercent(gridOption.y, zrHeight); var width; - if (typeof gridOption.width == 'undefined') { + if (gridOption.width == null) { width = zrWidth - x - this.parsePercent(gridOption.x2, zrWidth); } else { @@ -25886,7 +27272,7 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s } var height; - if (typeof gridOption.height == 'undefined') { + if (gridOption.height == null) { height = zrHeight - y - this.parsePercent(gridOption.y2, zrHeight); } else { @@ -25894,25 +27280,25 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s } return { - x : x, - y : y, - width : width, - height : height, - centerX : x + width / 2 + x: x, + y: y, + width: width, + height: height, + centerX: x + width / 2 }; }, - _mapData : function(seriesIndex) { + _mapData: function(seriesIndex) { var serie = this.series[seriesIndex]; var funnelData = zrUtil.clone(serie.data); for (var i = 0, l = funnelData.length; i < l; i++) { funnelData[i]._index = i; } function numDescending (a, b) { - if (a.value == '-') { + if (a.value === '-') { return 1; } - else if (b.value == '-') { + else if (b.value === '-') { return -1; } return b.value - a.value; @@ -25921,7 +27307,7 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s return -numDescending(a, b); } if (serie.sort != 'none') { - funnelData.sort(serie.sort == 'descending' ? numDescending : numAscending); + funnelData.sort(serie.sort === 'descending' ? numDescending : numAscending); } return funnelData; @@ -25930,7 +27316,7 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s /** * 构建单个扇形及指标 */ - _buildItem : function ( + _buildItem: function ( seriesIndex, dataIndex, defaultColor, x, y, topWidth, bottomWidth, height ) { @@ -25996,7 +27382,7 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s /** * 根据值计算宽度 */ - _getItemWidth : function (seriesIndex, value) { + _getItemWidth: function (seriesIndex, value) { var serie = this.series[seriesIndex]; var location = this._paramsMap[seriesIndex].location; var min = serie.min; @@ -26009,7 +27395,7 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s /** * 构建扇形 */ - getPolygon : function ( + getPolygon: function ( seriesIndex, dataIndex, defaultColor, x, y, topWidth, bottomWidth, height ) { @@ -26030,30 +27416,30 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s || defaultColor; var emphasisColor = this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data) - || (typeof normalColor == 'string' + || (typeof normalColor === 'string' ? zrColor.lift(normalColor, -0.2) : normalColor ); var polygon = { - zlevel : this._zlevelBase, - clickable : true, - style : { - pointList : [ + zlevel: this._zlevelBase, + clickable: this.deepQuery(queryTarget, 'clickable'), + style: { + pointList: [ [x, y], [x + topWidth, y], [x + topWidth - (topWidth - bottomWidth) / 2, y + height], [x + (topWidth - bottomWidth) / 2, y + height] ], - brushType : 'both', - color : normalColor, - lineWidth : normal.borderWidth, - strokeColor : normal.borderColor + brushType: 'both', + color: normalColor, + lineWidth: normal.borderWidth, + strokeColor: normal.borderColor }, - highlightStyle : { - color : emphasisColor, - lineWidth : emphasis.borderWidth, - strokeColor : emphasis.borderColor + highlightStyle: { + color: emphasisColor, + lineWidth: emphasis.borderWidth, + strokeColor: emphasis.borderColor } }; @@ -26068,7 +27454,7 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s /** * 需要显示则会有返回构建好的shape,否则返回undefined */ - getLabel : function ( + getLabel: function ( seriesIndex, dataIndex, defaultColor, x, y, topWidth, bottomWidth, height ) { @@ -26093,7 +27479,7 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s var textColor = defaultColor; labelControl.position = labelControl.position || itemStyle.normal.label.position; - if (labelControl.position == 'inner' || labelControl.position == 'inside') { + if (labelControl.position === 'inner' || labelControl.position === 'inside') { // 内部 textAlign = 'center'; textX = x + topWidth / 2; @@ -26104,31 +27490,31 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s textColor = zrColor.reverse(defaultColor); } } - else if (labelControl.position == 'left'){ + else if (labelControl.position === 'left'){ // 左侧显示 textAlign = 'right'; - textX = lineLength == 'auto' + textX = lineLength === 'auto' ? (location.x - 10) : (location.centerX - Math.max(topWidth, bottomWidth) / 2 - lineLength); } else { - // 右侧显示,默认 labelControl.position == 'outer' || 'right) + // 右侧显示,默认 labelControl.position === 'outer' || 'right) textAlign = 'left'; - textX = lineLength == 'auto' + textX = lineLength === 'auto' ? (location.x + location.width + 10) : (location.centerX + Math.max(topWidth, bottomWidth) / 2 + lineLength); } var textShape = { - zlevel : this._zlevelBase + 1, - style : { - x : textX, - y : y + height / 2, - color : textStyle.color || textColor, - text : text, - textAlign : textStyle.align || textAlign, - textBaseline : textStyle.baseline || 'middle', - textFont : textFont + zlevel: this._zlevelBase + 1, + style: { + x: textX, + y: y + height / 2, + color: textStyle.color || textColor, + text: text, + textAlign: textStyle.align || textAlign, + textBaseline: textStyle.baseline || 'middle', + textFont: textFont } }; @@ -26142,7 +27528,7 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s text = this.getLabelText(seriesIndex, dataIndex, status); textFont = this.getFont(textStyle); textColor = defaultColor; - if (labelControl.position == 'inner' || labelControl.position == 'inside') { + if (labelControl.position === 'inner' || labelControl.position === 'inside') { // 内部 textAlign = 'center'; textX = x + topWidth / 2; @@ -26153,27 +27539,27 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s textColor = zrColor.reverse(defaultColor); } } - else if (labelControl.position == 'left'){ + else if (labelControl.position === 'left'){ // 左侧显示 textAlign = 'right'; - textX = lineLength == 'auto' + textX = lineLength === 'auto' ? (location.x - 10) : (location.centerX - Math.max(topWidth, bottomWidth) / 2 - lineLength); } else { - // 右侧显示,默认 labelControl.position == 'outer' || 'right) + // 右侧显示,默认 labelControl.position === 'outer' || 'right) textAlign = 'left'; - textX = lineLength == 'auto' + textX = lineLength === 'auto' ? (location.x + location.width + 10) : (location.centerX + Math.max(topWidth, bottomWidth) / 2 + lineLength); } textShape.highlightStyle = { - x : textX, - color : textStyle.color || textColor, - text : text, - textAlign : textStyle.align || textAlign, - textFont : textFont, - brushType : 'fill' + x: textX, + color: textStyle.color || textColor, + text: text, + textAlign: textStyle.align || textAlign, + textFont: textFont, + brushType: 'fill' }; return new TextShape(textShape); @@ -26182,7 +27568,7 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s /** * 根据lable.format计算label text */ - getLabelText : function (seriesIndex, dataIndex, status) { + getLabelText: function (seriesIndex, dataIndex, status) { var series = this.series; var serie = series[seriesIndex]; var data = serie.data[dataIndex]; @@ -26192,7 +27578,7 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s ); if (formatter) { - if (typeof formatter == 'function') { + if (typeof formatter === 'function') { return formatter.call( this.myChart, serie.name, @@ -26200,7 +27586,7 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s data.value ); } - else if (typeof formatter == 'string') { + else if (typeof formatter === 'string') { formatter = formatter.replace('{a}','{a0}') .replace('{b}','{b0}') .replace('{c}','{c0}'); @@ -26219,7 +27605,7 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s /** * 需要显示则会有返回构建好的shape,否则返回undefined */ - getLabelLine : function ( + getLabelLine: function ( seriesIndex, dataIndex, defaultColor, x, y, topWidth, bottomWidth, height ) { @@ -26242,33 +27628,33 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s labelControl.position = labelControl.position || itemStyle.normal.label.position; var xEnd; - if (labelControl.position == 'inner' || labelControl.position == 'inside') { + if (labelControl.position === 'inner' || labelControl.position === 'inside') { // 内部 xEnd = x + topWidth / 2; } - else if (labelControl.position == 'left'){ + else if (labelControl.position === 'left'){ // 左侧显示 - xEnd = lineLength == 'auto' + xEnd = lineLength === 'auto' ? (location.x - 10) : (location.centerX - Math.max(topWidth, bottomWidth) / 2 - lineLength); } else { - // 右侧显示,默认 labelControl.position == 'outer' || 'right) - xEnd = lineLength == 'auto' + // 右侧显示,默认 labelControl.position === 'outer' || 'right) + xEnd = lineLength === 'auto' ? (location.x + location.width + 10) : (location.centerX + Math.max(topWidth, bottomWidth) / 2 + lineLength); } var lineShape = { - zlevel : this._zlevelBase + 1, - hoverable : false, - style : { - xStart : location.centerX, - yStart : y + height / 2, - xEnd : xEnd, - yEnd : y + height / 2, - strokeColor : lineStyle.color || defaultColor, - lineType : lineStyle.type, - lineWidth : lineStyle.width + zlevel: this._zlevelBase + 1, + hoverable: false, + style: { + xStart: location.centerX, + yStart: y + height / 2, + xEnd: xEnd, + yEnd: y + height / 2, + strokeColor: lineStyle.color || defaultColor, + lineType: lineStyle.type, + lineWidth: lineStyle.width } }; @@ -26280,27 +27666,27 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s labelControl = itemStyle[status].label || labelControl; labelControl.position = labelControl.position; - if (labelControl.position == 'inner' || labelControl.position == 'inside') { + if (labelControl.position === 'inner' || labelControl.position === 'inside') { // 内部 xEnd = x + topWidth / 2; } - else if (labelControl.position == 'left'){ + else if (labelControl.position === 'left'){ // 左侧显示 - xEnd = lineLength == 'auto' + xEnd = lineLength === 'auto' ? (location.x - 10) : (location.centerX - Math.max(topWidth, bottomWidth) / 2 - lineLength); } else { - // 右侧显示,默认 labelControl.position == 'outer' || 'right) - xEnd = lineLength == 'auto' + // 右侧显示,默认 labelControl.position === 'outer' || 'right) + xEnd = lineLength === 'auto' ? (location.x + location.width + 10) : (location.centerX + Math.max(topWidth, bottomWidth) / 2 + lineLength); } lineShape.highlightStyle = { - xEnd : xEnd, - strokeColor : lineStyle.color || defaultColor, - lineType : lineStyle.type, - lineWidth : lineStyle.width + xEnd: xEnd, + strokeColor: lineStyle.color || defaultColor, + lineType: lineStyle.type, + lineWidth: lineStyle.width }; return new LineShape(lineShape); @@ -26312,7 +27698,7 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s * @param {Object} data * @param {boolean} isEmphasis true is 'emphasis' and false is 'normal' */ - _needLabel : function (serie, data, isEmphasis) { + _needLabel: function (serie, data, isEmphasis) { return this.deepQuery( [data, serie], 'itemStyle.' @@ -26327,7 +27713,7 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s * @param {Object} data * @param {boolean} isEmphasis true is 'emphasis' and false is 'normal' */ - _needLabelLine : function (serie, data, isEmphasis) { + _needLabelLine: function (serie, data, isEmphasis) { return this.deepQuery( [data, serie], 'itemStyle.' @@ -26339,7 +27725,7 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s /** * 刷新 */ - refresh : function (newOption) { + refresh: function (newOption) { if (newOption) { this.option = newOption; this.series = newOption.series; @@ -27104,8 +28490,8 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z } ValueAxis.prototype = { - type : ecConfig.COMPONENT_TYPE_AXIS_VALUE, - _buildShape : function () { + type: ecConfig.COMPONENT_TYPE_AXIS_VALUE, + _buildShape: function () { this._hasData = false; this._calculateValue(); if (!this._hasData) { @@ -27123,7 +28509,7 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z }, // 小标记 - _buildAxisTick : function () { + _buildAxisTick: function () { var axShape; var data = this._valueList; var dataLength = this._valueList.length; @@ -27134,7 +28520,7 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z if (this.isHorizontal()) { // 横向 - var yPosition = this.option.position == 'bottom' + var yPosition = this.option.position === 'bottom' ? (tickOption.inside ? (this.grid.getYend() - length - 1) : (this.grid.getYend()) + 1) : (tickOption.inside @@ -27144,16 +28530,16 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z // 亚像素优化 x = this.subPixelOptimize(this.getCoord(data[i]), lineWidth); axShape = { - _axisShape : 'axisTick', - zlevel : this._zlevelBase, - hoverable : false, - style : { - xStart : x, - yStart : yPosition, - xEnd : x, - yEnd : yPosition + length, - strokeColor : color, - lineWidth : lineWidth + _axisShape: 'axisTick', + zlevel: this._zlevelBase, + hoverable: false, + style: { + xStart: x, + yStart: yPosition, + xEnd: x, + yEnd: yPosition + length, + strokeColor: color, + lineWidth: lineWidth } }; this.shapeList.push(new LineShape(axShape)); @@ -27161,7 +28547,7 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z } else { // 纵向 - var xPosition = this.option.position == 'left' + var xPosition = this.option.position === 'left' ? (tickOption.inside ? (this.grid.getX() + 1) : (this.grid.getX() - length - 1)) : (tickOption.inside @@ -27172,16 +28558,16 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z // 亚像素优化 y = this.subPixelOptimize(this.getCoord(data[i]), lineWidth); axShape = { - _axisShape : 'axisTick', - zlevel : this._zlevelBase, - hoverable : false, - style : { - xStart : xPosition, - yStart : y, - xEnd : xPosition + length, - yEnd : y, - strokeColor : color, - lineWidth : lineWidth + _axisShape: 'axisTick', + zlevel: this._zlevelBase, + hoverable: false, + style: { + xStart: xPosition, + yStart: y, + xEnd: xPosition + length, + yEnd: y, + strokeColor: color, + lineWidth: lineWidth } }; this.shapeList.push(new LineShape(axShape)); @@ -27190,7 +28576,7 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z }, // 坐标轴文本 - _buildAxisLabel : function () { + _buildAxisLabel: function () { var axShape; var data = this._valueList; var dataLength = this._valueList.length; @@ -27203,7 +28589,7 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z // 横向 var yPosition; var baseLine; - if (this.option.position == 'bottom') { + if (this.option.position === 'bottom') { yPosition = this.grid.getYend() + margin; baseLine = 'top'; } @@ -27214,24 +28600,24 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z for (var i = 0; i < dataLength; i++) { axShape = { - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : this.getCoord(data[i]), - y : yPosition, - color : typeof textStyle.color == 'function' - ? textStyle.color(data[i]) : textStyle.color, - text : this._valueLabel[i], - textFont : this.getFont(textStyle), - textAlign : textStyle.align || 'center', - textBaseline : textStyle.baseline || baseLine + zlevel: this._zlevelBase, + hoverable: false, + style: { + x: this.getCoord(data[i]), + y: yPosition, + color: typeof textStyle.color === 'function' + ? textStyle.color(data[i]) : textStyle.color, + text: this._valueLabel[i], + textFont: this.getFont(textStyle), + textAlign: textStyle.align || 'center', + textBaseline: textStyle.baseline || baseLine } }; if (rotate) { axShape.style.textAlign = rotate > 0 - ? (this.option.position == 'bottom' + ? (this.option.position === 'bottom' ? 'right' : 'left') - : (this.option.position == 'bottom' + : (this.option.position === 'bottom' ? 'left' : 'right'); axShape.rotation = [ rotate * Math.PI / 180, @@ -27248,7 +28634,7 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z // 纵向 var xPosition; var align; - if (this.option.position == 'left') { + if (this.option.position === 'left') { xPosition = this.grid.getX() - margin; align = 'right'; } @@ -27259,23 +28645,23 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z for (var i = 0; i < dataLength; i++) { axShape = { - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : xPosition, - y : this.getCoord(data[i]), - color : typeof textStyle.color == 'function' - ? textStyle.color(data[i]) : textStyle.color, - text : this._valueLabel[i], - textFont : this.getFont(textStyle), - textAlign : textStyle.align || align, - textBaseline : textStyle.baseline - || (i === 0 && this.option.name !== '') - ? 'bottom' - : (i == (dataLength - 1) - && this.option.name !== '') - ? 'top' - : 'middle' + zlevel: this._zlevelBase, + hoverable: false, + style: { + x: xPosition, + y: this.getCoord(data[i]), + color: typeof textStyle.color === 'function' + ? textStyle.color(data[i]) : textStyle.color, + text: this._valueLabel[i], + textFont: this.getFont(textStyle), + textAlign: textStyle.align || align, + textBaseline: textStyle.baseline + || (i === 0 && this.option.name !== '') + ? 'bottom' + : (i === (dataLength - 1) + && this.option.name !== '') + ? 'top' + : 'middle' } }; @@ -27293,7 +28679,7 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z } }, - _buildSplitLine : function () { + _buildSplitLine: function () { var axShape; var data = this._valueList; var dataLength = this._valueList.length; @@ -27314,16 +28700,16 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z // 亚像素优化 x = this.subPixelOptimize(this.getCoord(data[i]), lineWidth); axShape = { - zlevel : this._zlevelBase, - hoverable : false, - style : { - xStart : x, - yStart : sy, - xEnd : x, - yEnd : ey, - strokeColor : color[i % colorLength], - lineType : lineType, - lineWidth : lineWidth + zlevel: this._zlevelBase, + hoverable: false, + style: { + xStart: x, + yStart: sy, + xEnd: x, + yEnd: ey, + strokeColor: color[i % colorLength], + lineType: lineType, + lineWidth: lineWidth } }; this.shapeList.push(new LineShape(axShape)); @@ -27340,16 +28726,16 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z // 亚像素优化 y = this.subPixelOptimize(this.getCoord(data[i]), lineWidth); axShape = { - zlevel : this._zlevelBase, - hoverable : false, - style : { - xStart : sx, - yStart : y, - xEnd : ex, - yEnd : y, - strokeColor : color[i % colorLength], - lineType : lineType, - lineWidth : lineWidth + zlevel: this._zlevelBase, + hoverable: false, + style: { + xStart: sx, + yStart: y, + xEnd: ex, + yEnd: y, + strokeColor: color[i % colorLength], + lineType: lineType, + lineWidth: lineWidth } }; this.shapeList.push(new LineShape(axShape)); @@ -27357,22 +28743,22 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z } }, - _buildSplitArea : function () { + _buildSplitArea: function () { var axShape; var color = this.option.splitArea.areaStyle.color; if (!(color instanceof Array)) { // 非数组一律认为是单一颜色的字符串,单一颜色则用一个背景,颜色错误不负责啊!!! axShape = { - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : this.grid.getX(), - y : this.grid.getY(), - width : this.grid.getWidth(), - height : this.grid.getHeight(), - color : color - // type : this.option.splitArea.areaStyle.type, + zlevel: this._zlevelBase, + hoverable: false, + style: { + x: this.grid.getX(), + y: this.grid.getY(), + width: this.grid.getWidth(), + height: this.grid.getHeight(), + color: color + // type: this.option.splitArea.areaStyle.type, } }; this.shapeList.push(new RectangleShape(axShape)); @@ -27395,15 +28781,15 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z ? this.getCoord(data[i]) : this.grid.getXend(); axShape = { - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : lastX, - y : y, - width : curX - lastX, - height : height, - color : color[i % colorLength] - // type : this.option.splitArea.areaStyle.type, + zlevel: this._zlevelBase, + hoverable: false, + style: { + x: lastX, + y: y, + width: curX - lastX, + height: height, + color: color[i % colorLength] + // type: this.option.splitArea.areaStyle.type, } }; this.shapeList.push(new RectangleShape(axShape)); @@ -27422,15 +28808,15 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z ? this.getCoord(data[i]) : this.grid.getY(); axShape = { - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : x, - y : curY, - width : width, - height : lastYend - curY, - color : color[i % colorLength] - // type : this.option.splitArea.areaStyle.type + zlevel: this._zlevelBase, + hoverable: false, + style: { + x: x, + y: curY, + width: width, + height: lastYend - curY, + color: color[i % colorLength] + // type: this.option.splitArea.areaStyle.type } }; this.shapeList.push(new RectangleShape(axShape)); @@ -27443,7 +28829,7 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z /** * 极值计算 */ - _calculateValue : function () { + _calculateValue: function () { if (isNaN(this.option.min - 0) || isNaN(this.option.max - 0)) { // 有一个没指定都得算 // 数据整形 @@ -27482,10 +28868,10 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z data[key] = data[key] || []; oriData = this.series[i].data; for (var j = 0, k = oriData.length; j < k; j++) { - value = typeof oriData[j].value != 'undefined' + value = oriData[j].value != null ? oriData[j].value : oriData[j]; - if (this.series[i].type == ecConfig.CHART_TYPE_SCATTER) { + if (this.series[i].type === ecConfig.CHART_TYPE_SCATTER) { if (this.option.xAxisIndex != -1) { data[key].push(value[0]); } @@ -27493,7 +28879,7 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z data[key].push(value[1]); } } - else if (this.series[i].type == ecConfig.CHART_TYPE_K) { + else if (this.series[i].type === ecConfig.CHART_TYPE_K) { data[key].push(value[0]); data[key].push(value[1]); data[key].push(value[2]); @@ -27513,15 +28899,15 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z data[key] = data[key] || []; // scale下还需要记录每一个量 oriData = this.series[i].data; for (var j = 0, k = oriData.length; j < k; j++) { - value = typeof oriData[j].value != 'undefined' + value = oriData[j].value != null ? oriData[j].value : oriData[j]; - if (value == '-') { + if (value === '-') { continue; } value = value - 0; if (value >= 0) { - if (typeof data[keyP][j] != 'undefined') { + if (data[keyP][j] != null) { data[keyP][j] += value; } else { @@ -27529,7 +28915,7 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z } } else { - if (typeof data[keyN][j] != 'undefined') { + if (data[keyN][j] != null) { data[keyN][j] += value; } else { @@ -27568,14 +28954,15 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z } //console.log(this._min,this._max,'vvvvv111111') + var gap = Math.abs(this._max - this._min); this._min = isNaN(this.option.min - 0) - ? (this._min - Math.abs(this._min * this.option.boundaryGap[0])) + ? (this._min - Math.abs(gap * this.option.boundaryGap[0])) : (this.option.min - 0); // 指定min忽略boundaryGay[0] this._max = isNaN(this.option.max - 0) - ? (this._max + Math.abs(this._max * this.option.boundaryGap[1])) + ? (this._max + Math.abs(gap * this.option.boundaryGap[1])) : (this.option.max - 0); // 指定max忽略boundaryGay[1] - if (this._min == this._max) { + if (this._min === this._max) { if (this._max === 0) { // 修复全0数据 this._max = this.option.power > 0 ? this.option.power : 1; @@ -27674,7 +29061,7 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z (this._min == -2.4 && this._max == 0.6) ? 'success' : 'failed'); * -------- */ - _reformValue : function (scale) { + _reformValue: function (scale) { var splitNumber = this.option.splitNumber; var precision = this.option.precision; var splitGap; @@ -27752,7 +29139,7 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z // 正数部分的分隔数 var partSplitNumber = Math.round(this._max / total * splitNumber); // 修正数据范围极度偏正向,留给负数一个 - partSplitNumber -= (partSplitNumber == splitNumber ? 1 : 0); + partSplitNumber -= (partSplitNumber === splitNumber ? 1 : 0); // 修正数据范围极度偏负向,留给正数一个 partSplitNumber += partSplitNumber === 0 ? 1 : 0; splitGap = (Math.ceil(Math.max( @@ -27784,7 +29171,7 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z this._reformLabelData(); }, - _customerValue : function () { + _customerValue: function () { var splitNumber = this.option.splitNumber; var precision = this.option.precision; var splitGap = (this._max - this._min) / splitNumber; @@ -27796,15 +29183,15 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z this._reformLabelData(); }, - _reformLabelData : function () { + _reformLabelData: function () { this._valueLabel = []; var formatter = this.option.axisLabel.formatter; if (formatter) { for (var i = 0, l = this._valueList.length; i < l; i++) { - if (typeof formatter == 'function') { + if (typeof formatter === 'function') { this._valueLabel.push(formatter.call(this.myChart, this._valueList[i])); } - else if (typeof formatter == 'string') { + else if (typeof formatter === 'string') { this._valueLabel.push( formatter.replace('{value}',this._valueList[i]) ); @@ -27820,7 +29207,7 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z }, - getExtremum : function () { + getExtremum: function () { this._calculateValue(); return { min: this._min, @@ -27831,7 +29218,7 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z /** * 刷新 */ - refresh : function (newOption, newSeries) { + refresh: function (newOption, newSeries) { if (newOption) { this.option = this.reformOption(newOption); // 通用字体设置 @@ -27848,7 +29235,7 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z }, // 根据值换算位置 - getCoord : function (value) { + getCoord: function (value) { value = value < this._min ? this._min : value; value = value > this._max ? this._max : value; @@ -27871,14 +29258,14 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z return result; // Math.floor可能引起一些偏差,但性能会更好 /* 准确更重要 - return (value == this._min || value == this._max) + return (value === this._min || value === this._max) ? result : Math.floor(result); */ }, // 根据值换算绝对大小 - getCoordSize : function (value) { + getCoordSize: function (value) { if (!this.isHorizontal()) { // 纵向 return Math.abs(value / (this._max - this._min) * this.grid.getHeight()); @@ -27890,7 +29277,7 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z }, // 根据位置换算值 - getValueFromCoord : function(coord) { + getValueFromCoord: function(coord) { var result; if (!this.isHorizontal()) { // 纵向 @@ -27968,56 +29355,56 @@ define('echarts/component/axis',['require','./base','zrender/shape/Line','../con } Axis.prototype = { - type : ecConfig.COMPONENT_TYPE_AXIS, - axisBase : { + type: ecConfig.COMPONENT_TYPE_AXIS, + axisBase: { // 轴线 - _buildAxisLine : function () { + _buildAxisLine: function () { var lineWidth = this.option.axisLine.lineStyle.width; var halfLineWidth = lineWidth / 2; var axShape = { - _axisShape : 'axisLine', - zlevel : this._zlevelBase + 1, - hoverable : false + _axisShape: 'axisLine', + zlevel: this._zlevelBase + 1, + hoverable: false }; switch (this.option.position) { case 'left' : axShape.style = { - xStart : this.grid.getX() - halfLineWidth, - yStart : this.grid.getYend(), - xEnd : this.grid.getX() - halfLineWidth, - yEnd : this.grid.getY(), - lineCap : 'round' + xStart: this.grid.getX() - halfLineWidth, + yStart: this.grid.getYend(), + xEnd: this.grid.getX() - halfLineWidth, + yEnd: this.grid.getY(), + lineCap: 'round' }; break; case 'right' : axShape.style = { - xStart : this.grid.getXend() + halfLineWidth, - yStart : this.grid.getYend(), - xEnd : this.grid.getXend() + halfLineWidth, - yEnd : this.grid.getY(), - lineCap : 'round' + xStart: this.grid.getXend() + halfLineWidth, + yStart: this.grid.getYend(), + xEnd: this.grid.getXend() + halfLineWidth, + yEnd: this.grid.getY(), + lineCap: 'round' }; break; case 'bottom' : axShape.style = { - xStart : this.grid.getX(), - yStart : this.grid.getYend() + halfLineWidth, - xEnd : this.grid.getXend(), - yEnd : this.grid.getYend() + halfLineWidth, - lineCap : 'round' + xStart: this.grid.getX(), + yStart: this.grid.getYend() + halfLineWidth, + xEnd: this.grid.getXend(), + yEnd: this.grid.getYend() + halfLineWidth, + lineCap: 'round' }; break; case 'top' : axShape.style = { - xStart : this.grid.getX(), - yStart : this.grid.getY() - halfLineWidth, - xEnd : this.grid.getXend(), - yEnd : this.grid.getY() - halfLineWidth, - lineCap : 'round' + xStart: this.grid.getX(), + yStart: this.grid.getY() - halfLineWidth, + xEnd: this.grid.getXend(), + yEnd: this.grid.getY() - halfLineWidth, + lineCap: 'round' }; break; } - if (this.option.name !== '') { + if (this.option.name !== '') { // 别帮我代码规范 axShape.style.text = this.option.name; axShape.style.textPosition = this.option.nameLocation; axShape.style.textFont = this.getFont(this.option.nameTextStyle); @@ -28054,7 +29441,7 @@ define('echarts/component/axis',['require','./base','zrender/shape/Line','../con this.shapeList.push(axShape); }, - _axisLabelClickable : function(clickable, axShape) { + _axisLabelClickable: function(clickable, axShape) { if (clickable) { ecData.pack( axShape, undefined, -1, undefined, -1, axShape.style.text @@ -28062,7 +29449,7 @@ define('echarts/component/axis',['require','./base','zrender/shape/Line','../con axShape.hoverable = true; axShape.clickable = true; axShape.highlightStyle = { - color : zrColor.lift(axShape.style.color, 1), + color: zrColor.lift(axShape.style.color, 1), brushType: 'fill' }; return axShape; @@ -28072,15 +29459,15 @@ define('echarts/component/axis',['require','./base','zrender/shape/Line','../con } }, - refixAxisShape : function(zeroX, zeroY) { + refixAxisShape: function(zeroX, zeroY) { if (!this.option.axisLine.onZero) { return; } var tickLength; - if (this.isHorizontal() && typeof zeroY != 'undefined') { + if (this.isHorizontal() && zeroY != null) { // 横向布局调整纵向y for (var i = 0, l = this.shapeList.length; i < l; i++) { - if (this.shapeList[i]._axisShape == 'axisLine') { + if (this.shapeList[i]._axisShape === 'axisLine') { this.shapeList[i].style.yStart = this.shapeList[i].style.yEnd = this.subPixelOptimize( @@ -28088,7 +29475,7 @@ define('echarts/component/axis',['require','./base','zrender/shape/Line','../con ); this.zr.modShape(this.shapeList[i].id); } - else if (this.shapeList[i]._axisShape == 'axisTick') { + else if (this.shapeList[i]._axisShape === 'axisTick') { tickLength = this.shapeList[i].style.yEnd - this.shapeList[i].style.yStart; this.shapeList[i].style.yStart = zeroY - tickLength; @@ -28097,10 +29484,10 @@ define('echarts/component/axis',['require','./base','zrender/shape/Line','../con } } } - if (!this.isHorizontal() && typeof zeroX != 'undefined') { + if (!this.isHorizontal() && zeroX != null) { // 纵向布局调整横向x for (var i = 0, l = this.shapeList.length; i < l; i++) { - if (this.shapeList[i]._axisShape == 'axisLine') { + if (this.shapeList[i]._axisShape === 'axisLine') { this.shapeList[i].style.xStart = this.shapeList[i].style.xEnd = this.subPixelOptimize( @@ -28108,7 +29495,7 @@ define('echarts/component/axis',['require','./base','zrender/shape/Line','../con ); this.zr.modShape(this.shapeList[i].id); } - else if (this.shapeList[i]._axisShape == 'axisTick') { + else if (this.shapeList[i]._axisShape === 'axisTick') { tickLength = this.shapeList[i].style.xEnd - this.shapeList[i].style.xStart; this.shapeList[i].style.xStart = zeroX; @@ -28119,22 +29506,22 @@ define('echarts/component/axis',['require','./base','zrender/shape/Line','../con } }, - getPosition : function () { + getPosition: function () { return this.option.position; }, - isHorizontal : function() { - return this.option.position == 'bottom' || this.option.position == 'top'; + isHorizontal: function() { + return this.option.position === 'bottom' || this.option.position === 'top'; } }, /** * 参数修正&默认值赋值,重载基类方法 * @param {Object} opt 参数 */ - reformOption : function (opt) { + reformOption: function (opt) { // 不写或传了个空数值默认为数值轴 if (!opt || (opt instanceof Array && opt.length === 0)) { - opt = [{type : ecConfig.COMPONENT_TYPE_AXIS_VALUE}]; + opt = [ { type: ecConfig.COMPONENT_TYPE_AXIS_VALUE } ]; } else if (!(opt instanceof Array)){ opt = [opt]; @@ -28145,7 +29532,7 @@ define('echarts/component/axis',['require','./base','zrender/shape/Line','../con opt = [opt[0],opt[1]]; } - if (this.axisType == 'xAxis') { + if (this.axisType === 'xAxis') { // 横轴位置默认配置 if (!opt[0].position // 没配置或配置错 || (opt[0].position != 'bottom' @@ -28154,8 +29541,7 @@ define('echarts/component/axis',['require','./base','zrender/shape/Line','../con opt[0].position = 'bottom'; } if (opt.length > 1) { - opt[1].position = opt[0].position == 'bottom' - ? 'top' : 'bottom'; + opt[1].position = opt[0].position === 'bottom' ? 'top' : 'bottom'; } for (var i = 0, l = opt.length; i < l; i++) { @@ -28176,8 +29562,7 @@ define('echarts/component/axis',['require','./base','zrender/shape/Line','../con } if (opt.length > 1) { - opt[1].position = opt[0].position == 'left' - ? 'right' : 'left'; + opt[1].position = opt[0].position === 'left' ? 'right' : 'left'; } for (var i = 0, l = opt.length; i < l; i++) { @@ -28195,11 +29580,11 @@ define('echarts/component/axis',['require','./base','zrender/shape/Line','../con /** * 刷新 */ - refresh : function (newOption) { + refresh: function (newOption) { var axisOption; if (newOption) { this.option = newOption; - if (this.axisType == 'xAxis') { + if (this.axisType === 'xAxis') { this.option.xAxis = this.reformOption(newOption.xAxis); axisOption = this.option.xAxis; } @@ -28229,7 +29614,7 @@ define('echarts/component/axis',['require','./base','zrender/shape/Line','../con ); } else if (axisOption && axisOption[i]) { - this._axisList[i] = axisOption[i].type == 'category' + this._axisList[i] = axisOption[i].type === 'category' ? new CategoryAxis( this.ecTheme, this.messageCenter, this.zr, axisOption[i], this.myChart, this.axisBase @@ -28248,11 +29633,11 @@ define('echarts/component/axis',['require','./base','zrender/shape/Line','../con * 根据值换算位置 * @param {number} idx 坐标轴索引0~1 */ - getAxis : function (idx) { + getAxis: function (idx) { return this._axisList[idx]; }, - clear : function () { + clear: function () { for (var i = 0, l = this._axisList.length; i < l; i++) { this._axisList[i].dispose && this._axisList[i].dispose(); } @@ -28299,45 +29684,52 @@ define('echarts/component/grid',['require','./base','zrender/shape/Rectangle','. } Grid.prototype = { - type : ecConfig.COMPONENT_TYPE_GRID, + type: ecConfig.COMPONENT_TYPE_GRID, - getX : function () { + getX: function () { return this._x; }, - getY : function () { + getY: function () { return this._y; }, - getWidth : function () { + getWidth: function () { return this._width; }, - getHeight : function () { + getHeight: function () { return this._height; }, - getXend : function () { + getXend: function () { return this._x + this._width; }, - getYend : function () { + getYend: function () { return this._y + this._height; }, - getArea : function () { + getArea: function () { return { - x : this._x, - y : this._y, - width : this._width, - height : this._height + x: this._x, + y: this._y, + width: this._width, + height: this._height }; }, + getBbox: function() { + return [ + [ this._x, this._y ], + [ this.getXend(), this.getYend() ] + ]; + }, + /** * 实在找不到合适的地方做了,各种粗暴的写法~ -_- */ - refixAxisShape : function(component) { + refixAxisShape: function(component) { var zeroX; var zeroY; var axisList = component.xAxis._axisList.concat(component.yAxis._axisList); @@ -28362,7 +29754,7 @@ define('echarts/component/grid',['require','./base','zrender/shape/Rectangle','. } }, - refresh : function (newOption) { + refresh: function (newOption) { if (newOption || this._zrWidth != this.zr.getWidth() || this._zrHeight != this.zr.getHeight() @@ -28386,6 +29778,7 @@ define('echarts/component/grid',['require','./base','zrender/shape/Rectangle','. else { this._width = this.parsePercent(gridOption.width, this._zrWidth); } + this._width = this._width <= 0 ? 10 : this._width; if (typeof gridOption.height == 'undefined') { this._height = this._zrHeight - this._y - y2; @@ -28393,23 +29786,24 @@ define('echarts/component/grid',['require','./base','zrender/shape/Rectangle','. else { this._height = this.parsePercent(gridOption.height, this._zrHeight); } + this._height = this._height <= 0 ? 10 : this._height; this._x = this.subPixelOptimize(this._x, gridOption.borderWidth); this._y = this.subPixelOptimize(this._y, gridOption.borderWidth); this.shapeList.push(new RectangleShape({ - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : this._x, - y : this._y, - width : this._width, - height : this._height, - brushType : gridOption.borderWidth > 0 ? 'both' : 'fill', - color : gridOption.backgroundColor, + zlevel: this._zlevelBase, + hoverable: false, + style: { + x: this._x, + y: this._y, + width: this._width, + height: this._height, + brushType: gridOption.borderWidth > 0 ? 'both' : 'fill', + color: gridOption.backgroundColor, strokeColor: gridOption.borderColor, - lineWidth : gridOption.borderWidth - // type : this.option.splitArea.areaStyle.type, + lineWidth: gridOption.borderWidth + // type: this.option.splitArea.areaStyle.type, } })); this.zr.addShape(this.shapeList[0]); @@ -28713,11 +30107,13 @@ define('echarts/component/dataZoom',['require','./base','zrender/shape/Rectangle var axisOption = zrUtil.clone(this.option.xAxis); if (axisOption instanceof Array) { axisOption[0].type = 'value'; + axisOption[0].scale = true; axisOption[0].boundary = [0, 0]; axisOption[1] && (axisOption[1].type = 'value', axisOption[1].boundary = [0, 0]); } else { axisOption.type = 'value'; + axisOption.scale = true; axisOption.boundary = [0, 0]; } var vAxis = new Axis( @@ -28739,10 +30135,12 @@ define('echarts/component/dataZoom',['require','./base','zrender/shape/Rectangle axisOption = zrUtil.clone(this.option.yAxis); if (axisOption instanceof Array) { axisOption[0].type = 'value'; + axisOption[0].scale = true; axisOption[1] && (axisOption[1].type = 'value', axisOption[1].boundary = [0, 0]); } else { axisOption.type = 'value'; + axisOption.scale = true; axisOption.boundary = [0, 0]; } vAxis = new Axis( @@ -30879,11 +32277,11 @@ define('echarts/chart/scatter',['require','../component/base','./base','../util/ } Scatter.prototype = { - type : ecConfig.CHART_TYPE_SCATTER, + type: ecConfig.CHART_TYPE_SCATTER, /** * 绘制图形 */ - _buildShape : function () { + _buildShape: function () { var series = this.series; this._sIndex2ColorMap = {}; // series默认颜色索引,seriesIndex索引到color this._symbol = this.option.symbolList; @@ -30901,7 +32299,7 @@ define('echarts/chart/scatter',['require','../component/base','./base','../util/ for (var i = 0, l = series.length; i < l; i++) { serie = series[i]; serieName = serie.name; - if (serie.type == ecConfig.CHART_TYPE_SCATTER) { + if (serie.type === ecConfig.CHART_TYPE_SCATTER) { series[i] = this.reformOption(series[i]); this._sIndex2ShapeMap[i] = this.query(serie, 'symbol') || this._symbol[i % this._symbol.length]; @@ -30963,7 +32361,7 @@ define('echarts/chart/scatter',['require','../component/base','./base','../util/ /** * 构建类目轴为水平方向的散点图系列 */ - _buildSeries : function (seriesArray) { + _buildSeries: function (seriesArray) { if (seriesArray.length === 0) { return; } @@ -30991,12 +32389,12 @@ define('echarts/chart/scatter',['require','../component/base','./base','../util/ pointList[seriesIndex] = []; for (var i = 0, l = serie.data.length; i < l; i++) { data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' + value = data != null + ? (data.value != null ? data.value : data) : '-'; - if (value == '-' || value.length < 2) { + if (value === '-' || value.length < 2) { // 数据格式不符 continue; } @@ -31020,18 +32418,18 @@ define('echarts/chart/scatter',['require','../component/base','./base','../util/ this._buildPointList(pointList); }, - _markMap : function (xAxis, yAxis, data, pointList) { + _markMap: function (xAxis, yAxis, data, pointList) { var xMarkMap = { - min0 : Number.POSITIVE_INFINITY, - max0 : Number.NEGATIVE_INFINITY, - sum0 : 0, - counter0 : 0, - average0 : 0, - min1 : Number.POSITIVE_INFINITY, - max1 : Number.NEGATIVE_INFINITY, - sum1 : 0, - counter1 : 0, - average1 : 0 + min0: Number.POSITIVE_INFINITY, + max0: Number.NEGATIVE_INFINITY, + sum0: 0, + counter0: 0, + average0: 0, + min1: Number.POSITIVE_INFINITY, + max1: Number.NEGATIVE_INFINITY, + sum1: 0, + counter1: 0, + average1: 0 }; var value; for (var i = 0, l = pointList.length; i < l; i++) { @@ -31114,7 +32512,7 @@ define('echarts/chart/scatter',['require','../component/base','./base','../util/ /** * 生成折线和折线上的拐点 */ - _buildPointList : function (pointList) { + _buildPointList: function (pointList) { var series = this.series; var serie; var seriesPL; @@ -31164,7 +32562,7 @@ define('echarts/chart/scatter',['require','../component/base','./base','../util/ /** * 生成折线图上的拐点图形 */ - _getSymbol : function (seriesIndex, dataIndex, name, x, y) { + _getSymbol: function (seriesIndex, dataIndex, name, x, y) { var series = this.series; var serie = series[seriesIndex]; var data = serie.data[dataIndex]; @@ -31196,24 +32594,24 @@ define('echarts/chart/scatter',['require','../component/base','./base','../util/ return itemShape; }, - _getLargeSymbol : function (pointList, nColor) { + _getLargeSymbol: function (pointList, nColor) { return new SymbolShape({ - zlevel : this._zlevelBase, - _main : true, + zlevel: this._zlevelBase, + _main: true, hoverable: false, - style : { - pointList : pointList, - color : nColor, - strokeColor : nColor + style: { + pointList: pointList, + color: nColor, + strokeColor: nColor }, - highlightStyle : { - pointList : [] + highlightStyle: { + pointList: [ ] } }); }, // 位置转换 - getMarkCoord : function (seriesIndex, mpData) { + getMarkCoord: function (seriesIndex, mpData) { var serie = this.series[seriesIndex]; var xMarkMap = this.xMarkMap[seriesIndex]; var xAxis = this.component.xAxis.getAxis(serie.xAxisIndex); @@ -31221,12 +32619,11 @@ define('echarts/chart/scatter',['require','../component/base','./base','../util/ var pos; if (mpData.type - && (mpData.type == 'max' || mpData.type == 'min' || mpData.type == 'average') + && (mpData.type === 'max' || mpData.type === 'min' || mpData.type === 'average') ) { // 特殊值内置支持 // 默认取纵值 - var valueIndex = typeof mpData.valueIndex != 'undefined' - ? mpData.valueIndex : 1; + var valueIndex = mpData.valueIndex != null ? mpData.valueIndex : 1; pos = [ xMarkMap[mpData.type + 'X' + valueIndex], xMarkMap[mpData.type + 'Y' + valueIndex], @@ -31252,7 +32649,7 @@ define('echarts/chart/scatter',['require','../component/base','./base','../util/ /** * 刷新 */ - refresh : function (newOption) { + refresh: function (newOption) { if (newOption) { this.option = newOption; this.series = newOption.series; @@ -31267,7 +32664,7 @@ define('echarts/chart/scatter',['require','../component/base','./base','../util/ * @param {Object} param * @param {Object} status */ - ondataRange : function (param, status) { + ondataRange: function (param, status) { if (this.component.dataRange) { this.refresh(); status.needRefresh = true; @@ -31323,25 +32720,25 @@ define('echarts/chart/k',['require','../component/base','./base','../util/shape/ } K.prototype = { - type : ecConfig.CHART_TYPE_K, + type: ecConfig.CHART_TYPE_K, /** * 绘制图形 */ - _buildShape : function () { + _buildShape: function () { var series = this.series; this.selectedMap = {}; // 水平垂直双向series索引 ,position索引到seriesIndex var _position2sIndexMap = { - top : [], - bottom : [] + top: [ ], + bottom: [ ] }; var xAxis; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type == ecConfig.CHART_TYPE_K) { + if (series[i].type === ecConfig.CHART_TYPE_K) { series[i] = this.reformOption(series[i]); xAxis = this.component.xAxis.getAxis(series[i].xAxisIndex); - if (xAxis.type == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + if (xAxis.type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY ) { _position2sIndexMap[xAxis.getPosition()].push(i); } @@ -31364,7 +32761,7 @@ define('echarts/chart/k',['require','../component/base','./base','../util/shape/ * * @param {number} seriesIndex 系列索引 */ - _buildSinglePosition : function (position, seriesArray) { + _buildSinglePosition: function (position, seriesArray) { var mapData = this._mapData(seriesArray); var locationMap = mapData.locationMap; var maxDataLength = mapData.maxDataLength; @@ -31383,7 +32780,7 @@ define('echarts/chart/k',['require','../component/base','./base','../util/shape/ * 数据整形 * 数组位置映射到系列索引 */ - _mapData : function (seriesArray) { + _mapData: function (seriesArray) { var series = this.series; var serie; // 临时映射变量 var serieName; // 临时映射变量 @@ -31407,15 +32804,15 @@ define('echarts/chart/k',['require','../component/base','./base','../util/shape/ maxDataLength = Math.max(maxDataLength, serie.data.length); } return { - locationMap : locationMap, - maxDataLength : maxDataLength + locationMap: locationMap, + maxDataLength: maxDataLength }; }, /** * 构建类目轴为水平方向的K线图系列 */ - _buildHorizontal : function (seriesArray, maxDataLength, locationMap) { + _buildHorizontal: function (seriesArray, maxDataLength, locationMap) { var series = this.series; // 确定类目轴和数值轴,同一方向随便找一个即可 var seriesIndex; @@ -31447,18 +32844,18 @@ define('echarts/chart/k',['require','../component/base','./base','../util/shape/ pointList[seriesIndex] = []; for (var i = 0, l = maxDataLength; i < l; i++) { - if (typeof categoryAxis.getNameByIndex(i) == 'undefined') { + if (categoryAxis.getNameByIndex(i) == null) { // 系列数据超出类目轴长度 break; } data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' + value = data != null + ? (data.value != null ? data.value : data) : '-'; - if (value == '-' || value.length != 4) { + if (value === '-' || value.length != 4) { // 数据格式不符 continue; } @@ -31481,7 +32878,7 @@ define('echarts/chart/k',['require','../component/base','./base','../util/shape/ /** * 生成K线 */ - _buildKLine : function (seriesArray, pointList) { + _buildKLine: function (seriesArray, pointList) { var series = this.series; // normal: var nLineWidth; @@ -31514,9 +32911,7 @@ define('echarts/chart/k',['require','../component/base','./base','../util/shape/ seriesPL = this._getLargePointList(seriesPL); } - if (serie.type == ecConfig.CHART_TYPE_K - && typeof seriesPL != 'undefined' - ) { + if (serie.type === ecConfig.CHART_TYPE_K && seriesPL != null) { // 多级控制 queryTarget = serie; nLineWidth = this.query( @@ -31638,14 +33033,14 @@ define('echarts/chart/k',['require','../component/base','./base','../util/shape/ // console.log(this.shapeList) }, - _isLarge : function(singlePL) { + _isLarge: function(singlePL) { return singlePL[0][1] < 0.5; }, /** * 大规模pointList优化 */ - _getLargePointList : function(singlePL) { + _getLargePointList: function(singlePL) { var total = this.component.grid.getWidth(); var len = singlePL.length; var newList = []; @@ -31658,7 +33053,7 @@ define('echarts/chart/k',['require','../component/base','./base','../util/shape/ /** * 生成K线图上的图形 */ - _getCandle : function ( + _getCandle: function ( seriesIndex, dataIndex, name, x, width, y0, y1, y2, y3, nColor, nLinewidth, nLineColor, @@ -31666,21 +33061,23 @@ define('echarts/chart/k',['require','../component/base','./base','../util/shape/ ) { var series = this.series; var itemShape = { - zlevel : this._zlevelBase, - clickable: true, - style : { - x : x, - y : [y0, y1, y2, y3], - width : width, - color : nColor, - strokeColor : nLineColor, - lineWidth : nLinewidth, - brushType : 'both' + zlevel: this._zlevelBase, + clickable: this.deepQuery( + [series[seriesIndex].data[dataIndex], series[seriesIndex]], 'clickable' + ), + style: { + x: x, + y: [y0, y1, y2, y3], + width: width, + color: nColor, + strokeColor: nLineColor, + lineWidth: nLinewidth, + brushType: 'both' }, - highlightStyle : { - color : eColor, - strokeColor : eLineColor, - lineWidth : eLinewidth + highlightStyle: { + color: eColor, + strokeColor: eLineColor, + lineWidth: eLinewidth }, _seriesIndex: seriesIndex }; @@ -31696,7 +33093,7 @@ define('echarts/chart/k',['require','../component/base','./base','../util/shape/ }, // 位置转换 - getMarkCoord : function (seriesIndex, mpData) { + getMarkCoord: function (seriesIndex, mpData) { var serie = this.series[seriesIndex]; var xAxis = this.component.xAxis.getAxis(serie.xAxisIndex); var yAxis = this.component.yAxis.getAxis(serie.yAxisIndex); @@ -31715,7 +33112,7 @@ define('echarts/chart/k',['require','../component/base','./base','../util/shape/ /** * 刷新 */ - refresh : function (newOption) { + refresh: function (newOption) { if (newOption) { this.option = newOption; this.series = newOption.series; @@ -31728,7 +33125,7 @@ define('echarts/chart/k',['require','../component/base','./base','../util/shape/ /** * 动画设定 */ - addDataAnimation : function (params) { + addDataAnimation: function (params) { var series = this.series; var aniMap = {}; // seriesIndex索引参数 for (var i = 0, l = params.length; i < l; i++) { @@ -31744,11 +33141,11 @@ define('echarts/chart/k',['require','../component/base','./base','../util/shape/ seriesIndex = this.shapeList[i]._seriesIndex; if (aniMap[seriesIndex] && !aniMap[seriesIndex][3]) { // 有数据删除才有移动的动画 - if (this.shapeList[i].type == 'candle') { + if (this.shapeList[i].type === 'candle') { dataIndex = ecData.get(this.shapeList[i], 'dataIndex'); serie = series[seriesIndex]; if (aniMap[seriesIndex][2] - && dataIndex == serie.data.length - 1 + && dataIndex === serie.data.length - 1 ) { // 队头加入删除末尾 this.zr.delShape(this.shapeList[i].id); @@ -31767,7 +33164,7 @@ define('echarts/chart/k',['require','../component/base','./base','../util/shape/ this.zr.animate(this.shapeList[i].id, '') .when( 500, - {position : [x, y]} + { position: [ x, y ] } ) .start(); } @@ -31974,7 +33371,7 @@ define('echarts/component/polar',['require','./base','zrender/shape/Text','zrend if (axisLabel.show) { style = {}; style.textFont = this.getFont(); - //Todo: bug fix + style = zrUtil.merge(style, axisLabel); style.lineWidth = style.width; @@ -31984,6 +33381,10 @@ define('echarts/component/polar',['require','./base','zrender/shape/Text','zrend offset = axisLabel.offset || 10; interval = axisLabel.interval || 0; + if (!value) { + return; + } + for (var j = 1 ; j <= splitNumber; j += interval + 1) { newStyle = zrUtil.merge({}, style); text = @@ -32843,7 +34244,6 @@ define('echarts/component/polar',['require','./base','zrender/shape/Text','zrend * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 * @author Neil (杨骥, yangji01@baidu.com) - * */ define('echarts/chart/radar',['require','../component/base','./base','zrender/shape/Polygon','../component/polar','../config','../util/ecData','zrender/tool/util','zrender/tool/color','../util/accMath','../chart'],function (require) { @@ -32866,6 +34266,8 @@ define('echarts/component/polar',['require','./base','zrender/shape/Text','zrend * @param {ZRender} zr zrender实例 * @param {Object} series 数据 * @param {Object} component 组件 + * @constructor + * @exports Radar */ function Radar(ecTheme, messageCenter, zr, option, myChart) { // 基类 @@ -32891,8 +34293,8 @@ define('echarts/component/polar',['require','./base','zrender/shape/Text','zrend var series = this.series; var legend = this.component.legend; var serieName; - for (var i = 0, l = series.length; i < l ; i ++) { - if (series[i].type == ecConfig.CHART_TYPE_RADAR) { + for (var i = 0, l = series.length; i < l ; i++) { + if (series[i].type === ecConfig.CHART_TYPE_RADAR) { this.serie = this.reformOption(series[i]); serieName = this.serie.name || ''; // 系列图例开关 @@ -32928,13 +34330,12 @@ define('echarts/component/polar',['require','./base','zrender/shape/Text','zrend var pointList; var calculable = this.deepQuery(this._queryTarget, 'calculable'); - for (var i = 0; i < data.length; i ++) { + for (var i = 0; i < data.length; i++) { name = data[i].name || ''; // 图例开关 this.selectedMap[name] = legend - ? legend.isSelected(name) - : true; + ? legend.isSelected(name) : true; if (!this.selectedMap[name]) { continue; } @@ -32959,7 +34360,8 @@ define('echarts/component/polar',['require','./base','zrender/shape/Text','zrend pointList = this._getPointList(this.serie.polarIndex, data[i]); // 添加拐点形状 - this._addSymbol(pointList, defaultColor, i, index, this.serie.polarIndex); + this._addSymbol( + pointList, defaultColor, i, index, this.serie.polarIndex); // 添加数据形状 this._addDataShape( pointList, defaultColor, data[i], @@ -33001,7 +34403,7 @@ define('echarts/component/polar',['require','./base','zrender/shape/Text','zrend * @param {object} data 数据 * @param {number} serieIndex */ - _addSymbol : function (pointList, defaultColor, dataIndex, seriesIndex, polarIndex) { + _addSymbol :function (pointList, defaultColor, dataIndex, seriesIndex, polarIndex) { var series = this.series; var itemShape; var polar = this.component.polar; @@ -33073,7 +34475,8 @@ define('echarts/component/polar',['require','./base','zrender/shape/Text','zrend brushType : nIsAreaFill ? 'both' : 'stroke', color : nAreaColor || nColor - || zrColor.alpha(defaultColor,0.5), + || (typeof defaultColor === 'string' + ? zrColor.alpha(defaultColor,0.5) : defaultColor), strokeColor : nColor || defaultColor, lineWidth : nLineWidth, lineType : nLineType @@ -33090,7 +34493,8 @@ define('echarts/component/polar',['require','./base','zrender/shape/Text','zrend ) || nAreaColor || nColor - || zrColor.alpha(defaultColor,0.5), + || (typeof defaultColor === 'string' + ? zrColor.alpha(defaultColor,0.5) : defaultColor), strokeColor : this.getItemStyleColor( this.deepQuery( queryTarget, 'itemStyle.emphasis.color' @@ -33158,7 +34562,8 @@ define('echarts/component/polar',['require','./base','zrender/shape/Text','zrend return; } - var target = param.target; // 被拖拽图形元素 + // 被拖拽图形元素 + var target = param.target; var seriesIndex = ecData.get(target, 'seriesIndex'); var dataIndex = ecData.get(target, 'dataIndex'); @@ -33200,7 +34605,7 @@ define('echarts/component/polar',['require','./base','zrender/shape/Text','zrend var legend = this.component.legend; var value; - if (dataIndex == -1) { + if (dataIndex === -1) { data = { value : ecData.get(dragged, 'value'), name : ecData.get(dragged, 'name') @@ -33221,7 +34626,7 @@ define('echarts/component/polar',['require','./base','zrender/shape/Text','zrend data.name += this.option.nameConnector + ecData.get(dragged, 'name'); value = ecData.get(dragged, 'value'); - for (var i = 0 ; i < value.length; i ++) { + for (var i = 0 ; i < value.length; i++) { data.value[i] = accMath.accAdd(data.value[i], value[i]); } @@ -33263,56 +34668,316 @@ define('echarts/component/polar',['require','./base','zrender/shape/Text','zrend return Radar; }); /** - * zrender - * - * @author pissang (https://github.com/pissang) - * - * shape类:chord - * 可配图形属性: - { - // 基础属性 - shape : 'chord', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 + * Path 代理,可以在`buildPath`中用于替代`ctx`, 会保存每个path操作的命令到pathCommands属性中 + * 可以用于 isInsidePath 判断以及获取boundingRect + * + * @module zrender/shape/util/PathProxy + * @author pissang (http://www.github.com/pissang) + * + * @example + * var SomeShape = function() { + * this._pathProxy = new PathProxy(); + * ... + * } + * SomeShape.prototype.buildPath = function(ctx, style) { + * this._pathProxy.begin(ctx); + * .moveTo(style.x, style.y); + * .lineTo(style.x1, style.y1); + * ... + * .closePath(); + * }, + * SomeShape.prototype.getRect = function(style) { + * if (!style._rect) { + * // 这里必须要在 buildPath 之后才能调用 + * style._rect = this._pathProxy.fastBoundingRect(); + * } + * return this.style._rect; + * }, + * SomeShape.prototype.isCover = function(x, y) { + * var rect = this.getRect(this.style); + * if (x >= rect.x + * && x <= (rect.x + rect.width) + * && y >= rect.y + * && y <= (rect.y + rect.height) + * ) { + * return area.isInsidePath( + * this._pathProxy.pathCommands, 0, 'fill', x, y + * ); + * } + * } + */ +define('zrender/shape/util/PathProxy',['require','../../tool/vector'],function (require) { + + var vector = require('../../tool/vector'); + // var computeBoundingBox = require('../../tool/computeBoundingBox'); - // 样式属性,默认状态样式样式属性 - style : { - center : {array}, - source0 : {number}, - source1 : {number}, - target0 : {number}, - target1 : {number}, - r : {number}, - }, + var PathSegment = function(command, points) { + this.command = command; + this.points = points || null; + }; - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } + /** + * @alias module:zrender/shape/tool/PathProxy + * @constructor + */ + var PathProxy = function () { - // 交互属性,详见shape.Base + /** + * Path描述的数组,用于`isInsidePath`的判断 + * @type {Array.} + */ + this.pathCommands = []; - // 事件属性,详见shape.Base - } + this._ctx = null; + + this._min = []; + this._max = []; + }; + + /** + * 快速计算Path包围盒(并不是最小包围盒) + * @return {Object} + */ + PathProxy.prototype.fastBoundingRect = function () { + var min = this._min; + var max = this._max; + min[0] = min[1] = Infinity; + max[0] = max[1] = -Infinity; + for (var i = 0; i < this.pathCommands.length; i++) { + var seg = this.pathCommands[i]; + var p = seg.points; + switch (seg.command) { + case 'M': + vector.min(min, min, p); + vector.max(max, max, p); + break; + case 'L': + vector.min(min, min, p); + vector.max(max, max, p); + break; + case 'C': + for (var j = 0; j < 6; j += 2) { + min[0] = Math.min(min[0], min[0], p[j]); + min[1] = Math.min(min[1], min[1], p[j + 1]); + max[0] = Math.max(max[0], max[0], p[j]); + max[1] = Math.max(max[1], max[1], p[j + 1]); + } + break; + case 'Q': + for (var j = 0; j < 4; j += 2) { + min[0] = Math.min(min[0], min[0], p[j]); + min[1] = Math.min(min[1], min[1], p[j + 1]); + max[0] = Math.max(max[0], max[0], p[j]); + max[1] = Math.max(max[1], max[1], p[j + 1]); + } + break; + case 'A': + var cx = p[0]; + var cy = p[1]; + var rx = p[2]; + var ry = p[3]; + min[0] = Math.min(min[0], min[0], cx - rx); + min[1] = Math.min(min[1], min[1], cy - ry); + max[0] = Math.max(max[0], max[0], cx + rx); + max[1] = Math.max(max[1], max[1], cy + ry); + break; + } + } + + return { + x: min[0], + y: min[1], + width: max[0] - min[0], + height: max[1] - min[1] + }; + }; + + /** + * @param {CanvasRenderingContext2D} ctx + * @return {PathProxy} + */ + PathProxy.prototype.begin = function (ctx) { + this._ctx = ctx || null; + // 清空pathCommands + this.pathCommands.length = 0; + + return this; + }; + + /** + * @param {number} x + * @param {number} y + * @return {PathProxy} + */ + PathProxy.prototype.moveTo = function (x, y) { + this.pathCommands.push(new PathSegment('M', [x, y])); + if (this._ctx) { + this._ctx.moveTo(x, y); + } + return this; + }; + + /** + * @param {number} x + * @param {number} y + * @return {PathProxy} + */ + PathProxy.prototype.lineTo = function (x, y) { + this.pathCommands.push(new PathSegment('L', [x, y])); + if (this._ctx) { + this._ctx.lineTo(x, y); + } + return this; + }; + + /** + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @param {number} x3 + * @param {number} y3 + * @return {PathProxy} + */ + PathProxy.prototype.bezierCurveTo = function (x1, y1, x2, y2, x3, y3) { + this.pathCommands.push(new PathSegment('C', [x1, y1, x2, y2, x3, y3])); + if (this._ctx) { + this._ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3); + } + return this; + }; + + /** + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @return {PathProxy} + */ + PathProxy.prototype.quadraticCurveTo = function (x1, y1, x2, y2) { + this.pathCommands.push(new PathSegment('A', [x1, y1, x2, y2])); + if (this._ctx) { + this._ctx.quadraticCurveTo(x1, y1, x2, y2); + } + return this; + }; + + /** + * @param {number} cx + * @param {number} cy + * @param {number} r + * @param {number} startAngle + * @param {number} endAngle + * @param {boolean} anticlockwise + * @return {PathProxy} + */ + PathProxy.prototype.arc = function (cx, cy, r, startAngle, endAngle, anticlockwise) { + this.pathCommands.push(new PathSegment( + 'A', [cx, cy, r, r, startAngle, endAngle - startAngle, 0, anticlockwise ? 0 : 1] + )); + if (this._ctx) { + this._ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise); + } + return this; + }; + + // TODO + PathProxy.prototype.arcTo = function (x1, y1, x2, y2, radius) { + if (this._ctx) { + this._ctx.arcTo(x1, y1, x2, y2, radius); + } + return this; + }; + + // TODO + PathProxy.prototype.rect = function (x, y, w, h) { + if (this._ctx) { + this._ctx.rect(x, y, w, h); + } + return this; + }; + + /** + * @return {PathProxy} + */ + PathProxy.prototype.closePath = function () { + this.pathCommands.push(new PathSegment('z')); + if (this._ctx) { + this._ctx.closePath(); + } + return this; + }; + + /** + * 是否没有Path命令 + * @return {boolean} + */ + PathProxy.prototype.isEmpty = function() { + return this.pathCommands.length === 0; + }; + + PathProxy.PathSegment = PathSegment; + + return PathProxy; +}); +/** + * @module echarts/util/shape/Ribbon + * @author pissang (https://github.com/pissang) + */ +/** + * @typedef {Object} IRibbonStyle + * @property {number} x + * @property {number} y + * @property {number} source0 + * @property {number} source1 + * @property {number} target0 + * @property {number} target1 + * @property {number} r + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic */ -define('echarts/util/shape/Chord',['require','zrender/shape/Base','zrender/tool/util'],function (require) { +define('echarts/util/shape/Ribbon',['require','zrender/shape/Base','zrender/shape/util/PathProxy','zrender/tool/util','zrender/tool/area'],function (require) { var Base = require('zrender/shape/Base'); + var PathProxy = require('zrender/shape/util/PathProxy'); var zrUtil = require('zrender/tool/util'); - var _ctx = zrUtil.getContext(); + var area = require('zrender/tool/area'); + + // var _ctx = zrUtil.getContext(); - function ChordShape(options) { + function RibbonShape(options) { Base.call(this, options); + + this._pathProxy = new PathProxy(); } - ChordShape.prototype = { + RibbonShape.prototype = { type : 'chord', // center, source0, source1, target0, target1, r buildPath : function (ctx, style) { + + var path = this._pathProxy; + path.begin(ctx); + var PI2 = Math.PI * 2; - var cx = style.center[0]; - var cy = style.center[1]; + var cx = style.x; + var cy = style.y; var r = style.r; var s0 = style.source0 / 180 * Math.PI; var s1 = style.source1 / 180 * Math.PI; @@ -33327,9 +34992,9 @@ define('echarts/util/shape/Chord',['require','zrender/shape/Base','zrender/tool/ var tx1 = cx + Math.cos(PI2 - t1) * r; var ty1 = cy - Math.sin(PI2 - t1) * r; - ctx.moveTo(sx0, sy0); - ctx.arc(cx, cy, style.r, s0, s1, false); - ctx.bezierCurveTo( + path.moveTo(sx0, sy0); + path.arc(cx, cy, style.r, s0, s1, false); + path.bezierCurveTo( (cx - sx1) * 0.70 + sx1, (cy - sy1) * 0.70 + sy1, (cx - tx0) * 0.70 + tx0, @@ -33337,12 +35002,13 @@ define('echarts/util/shape/Chord',['require','zrender/shape/Base','zrender/tool/ tx0, ty0 ); // Chord to self - if (style.source0 === style.target0 && - style.source1 === style.target1) { + if (style.source0 === style.target0 + && style.source1 === style.target1 + ) { return; } - ctx.arc(cx, cy, style.r, t0, t1, false); - ctx.bezierCurveTo( + path.arc(cx, cy, style.r, t0, t1, false); + path.bezierCurveTo( (cx - tx1) * 0.70 + tx1, (cy - ty1) * 0.70 + ty1, (cx - sx0) * 0.70 + sx0, @@ -33351,34 +35017,33 @@ define('echarts/util/shape/Chord',['require','zrender/shape/Base','zrender/tool/ ); }, - getRect : function (){ - return { - x : 0, - y : 0, - width : 0, - height : 0 - }; + getRect : function (style) { + if (style.__rect) { + return style.__rect; + } + if (!this._pathProxy.isEmpty()) { + this.buildPath(null, style); + } + return this._pathProxy.fastBoundingRect(); }, isCover : function (x, y) { - if (!_ctx.isPointInPath) { // In ie - return false; + var rect = this.getRect(this.style); + if (x >= rect.x + && x <= (rect.x + rect.width) + && y >= rect.y + && y <= (rect.y + rect.height) + ) { + return area.isInsidePath( + this._pathProxy.pathCommands, 0, 'fill', x, y + ); } - var originPos = this.getTansform(x, y); - x = originPos[0]; - y = originPos[1]; - - _ctx.beginPath(); - ChordShape.prototype.buildPath.call(null, _ctx, this.style); - _ctx.closePath(); - - return _ctx.isPointInPath(x, y); } }; - zrUtil.inherits(ChordShape, Base); + zrUtil.inherits(RibbonShape, Base); - return ChordShape; + return RibbonShape; }); define('echarts/util/kwargs',[],function (){ function kwargs(func, defaults) { @@ -35742,7 +37407,7 @@ return NDArray; * */ -define('echarts/chart/chord',['require','../component/base','./base','zrender/shape/Text','zrender/shape/Line','zrender/shape/Sector','../util/shape/Chord','../config','../util/ecData','zrender/tool/util','zrender/tool/vector','../util/ndarray','../chart'],function (require) { +define('echarts/chart/chord',['require','../component/base','./base','zrender/shape/Text','zrender/shape/Line','zrender/shape/Sector','../util/shape/Ribbon','../config','../util/ecData','zrender/tool/util','zrender/tool/vector','../util/ndarray','../chart'],function (require) { var ComponentBase = require('../component/base'); @@ -35752,7 +37417,7 @@ define('echarts/chart/chord',['require','../component/base','./base','zrender/sh var TextShape = require('zrender/shape/Text'); var LineShape = require('zrender/shape/Line'); var SectorShape = require('zrender/shape/Sector'); - var ChordShape = require('../util/shape/Chord'); + var RibbonShape = require('../util/shape/Ribbon'); var ecConfig = require('../config'); var ecData = require('../util/ecData'); @@ -35772,11 +37437,11 @@ define('echarts/chart/chord',['require','../component/base','./base','zrender/sh } Chord.prototype = { - type : ecConfig.CHART_TYPE_CHORD, + type: ecConfig.CHART_TYPE_CHORD, /** * 绘制图形 */ - _buildShape : function () { + _buildShape: function () { var series = this.series; this.selectedMap = {}; this.chordSeries = []; @@ -35970,7 +37635,7 @@ define('echarts/chart/chord',['require','../component/base','./base','zrender/sh this.addShapeList(); }, - _filterData : function (dataMat, groups) { + _filterData: function (dataMat, groups) { var indices = []; var groupsFilted = []; // Filter by selected group @@ -36012,7 +37677,7 @@ define('echarts/chart/chord',['require','../component/base','./base','zrender/sh return [dataMat, groupsFilted2]; }, - _buildSectors : function (angles, data) { + _buildSectors: function (angles, data) { var len = this.groups.length; var len2 = this.chordSeries.length; @@ -36092,21 +37757,21 @@ define('echarts/chart/chord',['require','../component/base','./base','zrender/sh var _end = (this.clockWise ? (360 - angle[0]) : angle[1]) + this.startAngle; var sector = { - zlevel : this._zlevelBase, - style : { - x : this.center[0], - y : this.center[1], - r0 : this.innerRadius, - r : this.outerRadius, - startAngle : _start, - endAngle : _end, - brushType : 'fill', + zlevel: this._zlevelBase, + style: { + x: this.center[0], + y: this.center[1], + r0: this.innerRadius, + r: this.outerRadius, + startAngle: _start, + endAngle: _end, + brushType: 'fill', opacity: 1, - color : this.getColor(group.name) + color: this.getColor(group.name) }, - clickable: true, - highlightStyle : { - brushType : 'fill' + clickable: this.chordSerieSample.clickable, + highlightStyle: { + brushType: 'fill' } }; sector.style.lineWidth = this.deepQuery( @@ -36151,12 +37816,12 @@ define('echarts/chart/chord',['require','../component/base','./base','zrender/sh vec2.add(start, start, this.center); var labelShape = { - zlevel : this._zlevelBase - 1, - hoverable : false, - style : { - text : group.name, - textAlign : isRightSide ? 'left' : 'right', - color : labelColor + zlevel: this._zlevelBase - 1, + hoverable: false, + style: { + text: group.name, + textAlign: isRightSide ? 'left' : 'right', + color: labelColor } }; if (rotateLabel) { @@ -36200,9 +37865,9 @@ define('echarts/chart/chord',['require','../component/base','./base','zrender/sh } var len2 = angles[0][0].length; - var chordLineStyle + var ribbonLineStyle = this.chordSerieSample.itemStyle.normal.chordStyle.lineStyle; - var chordLineStyleEmphsis + var ribbonLineStyleEmphsis = this.chordSerieSample.itemStyle.emphasis.chordStyle.lineStyle; for (var i = 0; i < len; i++) { @@ -36218,8 +37883,10 @@ define('echarts/chart/chord',['require','../component/base','./base','zrender/sh var angleIJ1 = angles[i][j][k][1]; var angleJI1 = angles[j][i][k][1]; - if (angleIJ0 - angleJI1 === 0 || - angleJI0 - angleJI1 === 0) { + if ( + angleIJ0 - angleJI1 === 0 + || angleJI0 - angleJI1 === 0 + ) { this.chordShapes[i][j][k] = null; continue; } @@ -36239,25 +37906,26 @@ define('echarts/chart/chord',['require','../component/base','./base','zrender/sh var t0 = !this.clockWise ? (360 - angleJI1) : angleJI0; var t1 = !this.clockWise ? (360 - angleJI0) : angleJI1; var chord = { - zlevel : this._zlevelBase, - style : { - center : this.center, - r : this.innerRadius, - source0 : s0 - this.startAngle, - source1 : s1 - this.startAngle, - target0 : t0 - this.startAngle, - target1 : t1 - this.startAngle, - brushType : 'both', - opacity : 0.5, - color : color, - lineWidth : chordLineStyle.width, - strokeColor : chordLineStyle.color + zlevel: this._zlevelBase, + style: { + x: this.center[0], + y: this.center[1], + r: this.innerRadius, + source0: s0 - this.startAngle, + source1: s1 - this.startAngle, + target0: t0 - this.startAngle, + target1: t1 - this.startAngle, + brushType: 'both', + opacity: 0.5, + color: color, + lineWidth: ribbonLineStyle.width, + strokeColor: ribbonLineStyle.color }, - clickable: true, - highlightStyle : { - brushType : 'both', - lineWidth : chordLineStyleEmphsis.width, - strokeColor : chordLineStyleEmphsis.color + clickable: this.chordSerieSample.clickable, + highlightStyle: { + brushType: 'both', + lineWidth: ribbonLineStyleEmphsis.width, + strokeColor: ribbonLineStyleEmphsis.color } }; @@ -36271,7 +37939,7 @@ define('echarts/chart/chord',['require','../component/base','./base','zrender/sh dataArr[j][i][k] ); - chord = new ChordShape(chord); + chord = new RibbonShape(chord); this.chordShapes[i][j][k] = chord; this.shapeList.push(chord); } @@ -36302,16 +37970,16 @@ define('echarts/chart/chord',['require','../component/base','./base','zrender/sh var end = vec2.scale([], v, this.outerRadius + this.scaleLineLength); vec2.add(end, end, this.center); var scaleShape = { - zlevel : this._zlevelBase - 1, - hoverable : false, - style : { - xStart : start[0], - yStart : start[1], - xEnd : end[0], - yEnd : end[1], - lineCap : 'round', - brushType : 'stroke', - strokeColor : '#666', + zlevel: this._zlevelBase - 1, + hoverable: false, + style: { + xStart: start[0], + yStart: start[1], + xEnd: end[0], + yEnd: end[1], + lineCap: 'round', + brushType: 'stroke', + strokeColor: '#666', lineWidth: 1 } }; @@ -36335,19 +38003,19 @@ define('echarts/chart/chord',['require','../component/base','./base','zrender/sh var isRightSide = thelta <= 90 || thelta >= 270; var textShape = { - zlevel : this._zlevelBase - 1, - hoverable : false, - style : { - x : isRightSide + zlevel: this._zlevelBase - 1, + hoverable: false, + style: { + x: isRightSide ? this.outerRadius + this.scaleLineLength + 4 : -this.outerRadius - this.scaleLineLength - 4, - y : 0, - text : Math.round(scaleValues.shift()*10)/10 + y: 0, + text: Math.round(scaleValues.shift()*10)/10 + unitPostfix, - textAlign : isRightSide ? 'left' : 'right' + textAlign: isRightSide ? 'left' : 'right' }, - position : this.center.slice(), - rotation : isRightSide + position: this.center.slice(), + rotation: isRightSide ? [thelta / 180 * Math.PI, 0, 0] : [ (thelta + 180) / 180 * Math.PI, @@ -36392,28 +38060,9 @@ define('echarts/chart/chord',['require','../component/base','./base','zrender/sh this.series = newOption.series; } - /* - this.legend; - this.getColor; - this.isSelected; - this.chordSerieSample; - */ // Config this.chordSeries = []; - /* - this.groups; - this.startAngle; - this.clockWise; - this.innerRadius; - this.outerRadius; - this.padding; - this.sortGroups; - this.sortSubGroups; - this.center; - this.showScale; - this.showScaleText; - this.dataMat; - */ + this.strokeFix = 0; // Adjacency matrix this.sectorShapes = []; @@ -36500,9 +38149,356 @@ define('echarts/chart/chord',['require','../component/base','./base','zrender/sh return Chord; }); +/** + * 图数据结构 + * @module echarts/data/Graph + * @author pissang(http://www.github.com/pissang) + */ +define('echarts/data/Graph',['require','zrender/tool/util'],function(require) { + + var util = require('zrender/tool/util'); + + + + /** + * @alias module:echarts/data/Graph + * @constructor + * @param {boolean} directed + */ + var Graph = function(directed) { + /** + * 是否是有向图 + * @type {boolean} + * @private + */ + this._directed = directed || false; + + /** + * [nodes description] + * @type {Array} + */ + this.nodes = []; + this.edges = []; + + this._nodesMap = {}; + this._edgesMap = {}; + }; + + /** + * 添加一个新的节点 + * @param {string} name 节点名称 + * @param {*} [data] 存储的数据 + */ + Graph.prototype.addNode = function(name, data) { + if (this._nodesMap[name]) { + return this._nodesMap[name]; + } + + var node = new Graph.Node(name, data); + + this.nodes.push(node); + + this._nodesMap[name] = node; + return node; + }; + + /** + * 获取节点 + * @param {string} name + * @return {module:echarts/data/Graph~Node} + */ + Graph.prototype.getNodeByName = function(name) { + return this._nodesMap[name]; + }; + + /** + * 添加边 + * @param {string|module:echarts/data/Graph~Node} n1 + * @param {string|module:echarts/data/Graph~Node} n2 + * @param {*} data + * @return {module:echarts/data/Graph~Edge} + */ + Graph.prototype.addEdge = function(n1, n2, data) { + if (typeof(n1) == 'string') { + n1 = this._nodesMap[n1]; + } + if (typeof(n2) == 'string') { + n2 = this._nodesMap[n2]; + } + if (!n1 || !n2) { + return; + } + + var key = n1.name + '-' + n2.name; + if (this._edgesMap[key]) { + return this._edgesMap[key]; + } + + var edge = new Graph.Edge(n1, n2, data); + + if (this._directed) { + n1.outEdges.push(edge); + n2.inEdges.push(edge); + } + n1.edges.push(edge); + n2.edges.push(edge); + + this.edges.push(edge); + this._edgesMap[key] = edge; + + return edge; + }; + + /** + * 移除边 + * @param {module:echarts/data/Graph~Edge} edge + */ + Graph.prototype.removeEdge = function(edge) { + var n1 = edge.node1; + var n2 = edge.node2; + var key = n1.name + '-' + n2.name; + if (this._directed) { + n1.outEdges.splice(util.indexOf(n1.outEdges, edge), 1); + n2.inEdges.splice(util.indexOf(n2.inEdges, edge), 1); + } + n1.edges.splice(util.indexOf(n1.edges, edge), 1); + n2.edges.splice(util.indexOf(n2.edges, edge), 1); + + delete this._edgesMap[key]; + this.edges.splice(util.indexOf(this.edges, edge), 1); + }; + + /** + * 移除节点(及其邻接边) + * @param {module:echarts/data/Graph~Node|string} node + */ + Graph.prototype.removeNode = function(node) { + if (typeof(node) === 'string') { + node = this._nodesMap[node]; + if (!node) { + return; + } + } + + delete this._nodesMap[node.name]; + this.nodes.splice(util.indexOf(this.nodes, node), 1); + + for (var i = 0; i < this.edges.length;) { + var edge = this.edges[i]; + if (edge.node1 == node || edge.node2 == node) { + this.removeEdge(edge); + } else { + i++; + } + } + }; + + /** + * 线性遍历所有节点 + * @param {Function} cb + * @param {*} context + */ + Graph.prototype.eachNode = function(cb, context) { + for (var i = 0; i < this.nodes.length; i++) { + cb.call(context, this.nodes[i]); + } + }; + + /** + * 线性遍历所有边 + * @param {Function} cb + * @param {*} context + */ + Graph.prototype.eachEdge = function(cb, context) { + for (var i = 0; i < this.edges.length; i++) { + cb.call(context, this.edges[i]); + } + }; + + /** + * 清空图 + */ + Graph.prototype.clear = function() { + this.nodes.length = 0; + this.edges.length = 0; + + this._nodesMap = {}; + this._edgesMap = {}; + }; + + /** + * 图节点 + * @alias module:echarts/data/Graph~Node + * @param {string} name + * @param {*} [data] + */ + var Node = function(name, data) { + /** + * 节点名称 + * @type {string} + */ + this.name = name; + /** + * 节点存储的数据 + * @type {*} + */ + this.data = data || null; + /** + * 入边,只在有向图上有效 + * @type {Array.} + */ + this.inEdges = []; + /** + * 出边,只在有向图上有效 + * @type {Array.} + */ + this.outEdges = []; + /** + * 邻接边 + * @type {Array.} + */ + this.edges = []; + }; + + /** + * 度 + * @return {number} + */ + Node.prototype.degree = function() { + return this.edges.length; + }; + + /** + * 入度,只在有向图上有效 + * @return {number} + */ + Node.prototype.inDegree = function() { + return this.inEdges.length; + }; + + /** + * 出度,只在有向图上有效 + * @return {number} + */ + Node.prototype.outDegree = function() { + return this.outEdges.length; + }; + + /** + * 图边 + * @alias module:echarts/data/Graph~Edge + * @param {module:echarts/data/Graph~Node} node1 + * @param {module:echarts/data/Graph~Node} node2 + * @param {extra} data + */ + var Edge = function(node1, node2, data) { + /** + * 节点1,如果是有向图则为源节点 + * @type {module:echarts/data/Graph~Node} + */ + this.node1 = node1; + /** + * 节点2,如果是有向图则为目标节点 + * @type {module:echarts/data/Graph~Node} + */ + this.node2 = node2; + + /** + * 边存储的数据 + * @type {*} + */ + this.data = data || null; + }; + + Graph.Node = Node; + Graph.Edge = Edge; + + /** + * 从邻接矩阵生成 + * ``` + * TARGET + * -1--2--3--4--5- + * 1| x x x x x + * 2| x x x x x + * 3| x x x x x SOURCE + * 4| x x x x x + * 5| x x x x x + * ``` + * 节点的行列总和会被写到`node.data.value` + * 对于有向图会计算每一行的和写到`node.data.outValue`, + * 计算每一列的和写到`node.data.inValue`。 + * 边的权重会被然后写到`edge.data.weight`。 + * 如果是有向图被写到`edge.data.sourceWeight`和`edge.data.targetWeight` + * + * @method module:echarts/data/Graph.fromMatrix + * @param {Array.} nodesData 节点信息,必须有`name`属性 + * @param {Array} matrix 邻接矩阵 + * @param {boolean} directed 是否是有向图 + * @return {module:echarts/data/Graph} + */ + Graph.fromMatrix = function(nodesData, matrix, directed) { + if ( + !matrix || !matrix.length + || (matrix[0].length !== matrix.length) + || (nodesData.length !== matrix.length) + ) { + // Not a valid data + return; + } + + var size = matrix.length; + var graph = new Graph(directed); + + for (var i = 0; i < size; i++) { + var node = graph.addNode(nodesData[i].name, {}); + node.data.value = 0; + if (directed) { + node.data.outValue = node.data.inValue = 0; + } + } + for (var i = 0; i < size; i++) { + for (var j = 0; j < size; j++) { + var item = matrix[i][j]; + if (directed) { + graph.nodes[i].outValue += item; + graph.nodes[j].inValue += item; + } + graph.nodes[i].value += item; + graph.nodes[j].value += item; + } + } + + for (var i = 0; i < size; i++) { + for (var j = i; j < size; j++) { + var item = matrix[i][j]; + if (item === 0) { + continue; + } + var n1 = graph.nodes[i]; + var n2 = graph.nodes[j]; + var edge = graph.addEdge(n1, n2, {}); + if (directed) { + edge.data.sourceWeight = item; + edge.data.targetWeight = matrix[j][i]; + } + edge.data.weight = item; + if (i !== j) { + if (directed) { + var inEdge = graph.addEdge(n2, n1, {}); + inEdge.sourceWeight = matrix[j][i]; + inEdge.targetWeight = item; + } + edge.data.weight += matrix[j][i]; + } + } + } + }; + + return Graph; +}); // 1. Graph Drawing by Force-directed Placement // 2. http://webatlas.fr/tempshare/ForceAtlas2_Paper.pdf -define('echarts/chart/forceLayoutWorker',['require','zrender/tool/vector'],function __echartsForceLayoutWorker(require) { +define('echarts/layout/forceLayoutWorker',['require','zrender/tool/vector'],function __echartsForceLayoutWorker(require) { @@ -36575,7 +38571,8 @@ define('echarts/chart/forceLayoutWorker',['require','zrender/tool/vector'],funct return out; } }; - } else { + } + else { vec2 = require('zrender/tool/vector'); } var ArrayCtor = typeof(Float32Array) == 'undefined' ? Array : Float32Array; @@ -36627,7 +38624,8 @@ define('echarts/chart/forceLayoutWorker',['require','zrender/tool/vector'],funct if (this.node == null) { this.node = node; return; - } else { + } + else { this._addNodeToSubRegion(this.node); this.node = null; } @@ -36740,9 +38738,9 @@ define('echarts/chart/forceLayoutWorker',['require','zrender/tool/vector'],funct /**************************** * Class: Graph Edge ***************************/ - function GraphEdge(source, target) { - this.source = source; - this.target = target; + function GraphEdge(node1, node2) { + this.node1 = node1; + this.node2 = node2; this.weight = 1; } @@ -36853,7 +38851,8 @@ define('echarts/chart/forceLayoutWorker',['require','zrender/tool/vector'],funct this._rootRegion.addNode(this.nodes[i]); } this._rootRegion.afterUpdate(); - } else { + } + else { // Update center of mass of whole graph var mass = 0; var centerOfMass = this._rootRegion.centerOfMass; @@ -36880,7 +38879,8 @@ define('echarts/chart/forceLayoutWorker',['require','zrender/tool/vector'],funct var na = this.nodes[i]; if (this.barnesHutOptimize) { this.applyRegionToNodeRepulsion(this._rootRegion, na); - } else { + } + else { for (var j = i + 1; j < nNodes; j++) { var nb = this.nodes[j]; this.applyNodeToNodeRepulsion(na, nb, false); @@ -36947,13 +38947,15 @@ define('echarts/chart/forceLayoutWorker',['require','zrender/tool/vector'],funct return function applyRegionToNodeRepulsion(region, node) { if (region.node) { // Region is a leaf this.applyNodeToNodeRepulsion(region.node, node, true); - } else { + } + else { vec2.sub(v, node.position, region.centerOfMass); var d2 = v[0] * v[0] + v[1] * v[1]; if (d2 > this.barnesHutTheta * region.size * region.size) { var factor = this._k * this._k * (node.mass + region.mass) / (d2 + 1); vec2.scaleAndAdd(node.force, node.force, v, factor * 2); - } else { + } + else { for (var i = 0; i < region.nSubRegions; i++) { this.applyRegionToNodeRepulsion(region.subRegions[i], node); } @@ -36985,11 +38987,13 @@ define('echarts/chart/forceLayoutWorker',['require','zrender/tool/vector'],funct d = d - na.size - nb.size; if (d > 0) { factor = k2 * mass / (d * d); - } else if (d <= 0) { + } + else if (d <= 0) { // A stronger repulsion if overlap factor = k2 * 10 * mass; } - } else { + } + else { // Divide factor by an extra `d` to normalize the `v` factor = k2 * mass / d2; } @@ -37004,8 +39008,8 @@ define('echarts/chart/forceLayoutWorker',['require','zrender/tool/vector'],funct ForceLayout.prototype.applyEdgeAttraction = (function() { var v = vec2.create(); return function applyEdgeAttraction(edge) { - var na = edge.source; - var nb = edge.target; + var na = edge.node1; + var nb = edge.node2; vec2.sub(v, na.position, nb.position); var d = vec2.len(v); @@ -37013,9 +39017,11 @@ define('echarts/chart/forceLayoutWorker',['require','zrender/tool/vector'],funct var w; if (this.edgeWeightInfluence === 0) { w = 1; - } else if (this.edgeWeightInfluence == 1) { + } + else if (this.edgeWeightInfluence == 1) { w = edge.weight; - } else { + } + else { w = Math.pow(edge.weight, this.edgeWeightInfluence); } @@ -37046,7 +39052,8 @@ define('echarts/chart/forceLayoutWorker',['require','zrender/tool/vector'],funct if (this.width > this.height) { // Stronger gravity on y axis v[1] *= this.width / this.height; - } else { + } + else { // Stronger gravity on x axis v[0] *= this.height / this.width; } @@ -37054,7 +39061,8 @@ define('echarts/chart/forceLayoutWorker',['require','zrender/tool/vector'],funct if (this.strongGravity) { vec2.scaleAndAdd(node.force, node.force, v, d * this.gravity * node.mass); - } else { + } + else { vec2.scaleAndAdd(node.force, node.force, v, this.gravity * node.mass / (d + 1)); } }; @@ -37083,13 +39091,22 @@ define('echarts/chart/forceLayoutWorker',['require','zrender/tool/vector'],funct return str.slice(str.indexOf('{') + 1, str.lastIndexOf('return')); }; + ForceLayout.prototype.setToken = function(token) { + this._token = token; + }; + + ForceLayout.prototype.tokenMatch = function(token) { + return token === this._token; + }; + /**************************** * Main process ***************************/ + /* jshint ignore:start */ if (inWorker) { var forceLayout = null; - + self.onmessage = function(e) { // Position read back if (e.data instanceof ArrayBuffer) { @@ -37131,23 +39148,22 @@ define('echarts/chart/forceLayoutWorker',['require','zrender/tool/vector'],funct forceLayout.temperature = e.data.temperature; - if (e.data.temperature > 0.01) { - for (var i = 0; i < steps; i++) { - forceLayout.update(); - forceLayout.temperature *= e.data.coolDown; - } - // Callback - for (var i = 0; i < nNodes; i++) { - var node = forceLayout.nodes[i]; - positionArr[i * 2 + 1] = node.position[0]; - positionArr[i * 2 + 2] = node.position[1]; - } - - positionArr[0] = forceLayout._token; + for (var i = 0; i < steps; i++) { + forceLayout.update(); + forceLayout.temperature *= e.data.coolDown; + } + // Callback + for (var i = 0; i < nNodes; i++) { + var node = forceLayout.nodes[i]; + positionArr[i * 2 + 1] = node.position[0]; + positionArr[i * 2 + 2] = node.position[1]; } + positionArr[0] = forceLayout._token; + self.postMessage(positionArr.buffer, [positionArr.buffer]); - } else { + } + else { // Not initialzied yet var emptyArr = new Float32Array(); // Post transfer object @@ -37157,6 +39173,259 @@ define('echarts/chart/forceLayoutWorker',['require','zrender/tool/vector'],funct } }; } + /* jshint ignore:end */ + + return ForceLayout; +}); +/** + * 力导向布局 + * @module echarts/layout/Force + * @author pissang(http://github.com/pissang) + */ +define('echarts/layout/Force',['require','./forceLayoutWorker','zrender/tool/vector'],function(require) { + + var ForceLayoutWorker = require('./forceLayoutWorker'); + var vec2 = require('zrender/tool/vector'); + + var requestAnimationFrame = window.requestAnimationFrame + || window.msRequestAnimationFrame + || window.mozRequestAnimationFrame + || window.webkitRequestAnimationFrame + || function (func) {setTimeout(func, 16);}; + var ArrayCtor = typeof(Float32Array) == 'undefined' ? Array : Float32Array; + + var workerUrl; + + function getToken() { + return Math.round(Date.now() / 100) % 10000000; + } + + function createWorkerUrl() { + if ( + typeof(Worker) !== 'undefined' && + typeof(Blob) !== 'undefined' + ) { + try { + var blob = new Blob([ForceLayoutWorker.getWorkerCode()]); + workerUrl = window.URL.createObjectURL(blob); + } + catch (e) { + workerUrl = ''; + } + } + + return workerUrl; + } + + var ForceLayout = function(opts) { + + if (typeof(workerUrl) === 'undefined') { + createWorkerUrl(); + } + opts = opts || {}; + // 配置项 + this.width = opts.width || 500; + this.height = opts.height || 500; + this.center = opts.center || [this.width / 2, this.height / 2]; + this.ratioScaling = opts.ratioScaling || false; + this.scaling = opts.scaling || 1; + this.gravity = typeof(opts.gravity) !== 'undefined' + ? opts.gravity : 1; + this.large = opts.large || false; + + this.onupdate = opts.onupdate || function () {}; + this.temperature = opts.temperature || 1; + this.coolDown = opts.coolDown || 0.99; + + this._layout = null; + this._layoutWorker = null; + + this._token = 0; + + var self = this; + var _$onupdate = this._$onupdate; + this._$onupdate = function(e) { + _$onupdate.call(self, e); + }; + }; + + ForceLayout.prototype.updateConfig = function () { + var width = this.width; + var height = this.height; + var size = Math.min(width, height); + + var config = { + center: this.center, + width: this.ratioScaling ? width : size, + height: this.ratioScaling ? height : size, + scaling: this.scaling || 1.0, + gravity: this.gravity || 1.0, + barnesHutOptimize: this.large + }; + + if (this._layoutWorker) { + this._layoutWorker.postMessage({ + cmd: 'updateConfig', + config: config + }); + } + else { + for (var name in config) { + this._layout[name] = config[name]; + } + } + }; + + ForceLayout.prototype.init = function(graph, useWorker) { + if (workerUrl && useWorker) { + try { + if (!this._layoutWorker) { + this._layoutWorker = new Worker(workerUrl); + this._layoutWorker.onmessage = this._$onupdate; + } + this._layout = null; + } + catch (e) { // IE10-11 will throw security error when using blog url + this._layoutWorker = null; + if (!this._layout) { + this._layout = new ForceLayoutWorker(); + } + } + } + else { + if (!this._layout) { + this._layout = new ForceLayoutWorker(); + } + if (this._layoutWorker) { + this._layoutWorker.terminate(); + this._layoutWorker = null; + } + } + + this.temperature = 1; + + this.graph = graph; + + // 节点数据 + var len = graph.nodes.length; + var positionArr = new ArrayCtor(len * 2); + var massArr = new ArrayCtor(len); + var radiusArr = new ArrayCtor(len); + + for (var i = 0; i < len; i++) { + var n = graph.nodes[i]; + positionArr[i * 2] = n.layout.position[0]; + positionArr[i * 2 + 1] = n.layout.position[1]; + massArr[i] = n.layout.mass; + radiusArr[i] = n.layout.radius; + + n.layout.__index = i; + } + // 边数据 + len = graph.edges.length; + var edgeArr = new ArrayCtor(len * 2); + var edgeWeightArr = new ArrayCtor(len); + for (var i = 0; i < len; i++) { + var edge = graph.edges[i]; + edgeArr[i * 2] = edge.node1.layout.__index; + edgeArr[i * 2 + 1] = edge.node2.layout.__index; + edgeWeightArr[i] = edge.layout.weight || 1; + } + + this._token = getToken(); + + if (this._layoutWorker) { + + this._layoutWorker.postMessage({ + cmd: 'init', + nodesPosition: positionArr, + nodesMass: massArr, + nodesSize: radiusArr, + edges: edgeArr, + edgesWeight: edgeWeightArr, + token: this._token + }); + } + else { + this._layout.setToken(this._token); + this._layout.initNodes(positionArr, massArr, radiusArr); + this._layout.initEdges(edgeArr, edgeWeightArr); + } + + this.updateConfig(); + }; + + ForceLayout.prototype.step = function (steps) { + var nodes = this.graph.nodes; + if (this._layoutWorker) { + // Sync back + var positionArr = new ArrayCtor(nodes.length * 2 + 1); + for (var i = 0; i < nodes.length; i++) { + var n = nodes[i]; + positionArr[i * 2 + 1] = n.layout.position[0]; + positionArr[i * 2 + 2] = n.layout.position[1]; + } + this._layoutWorker.postMessage(positionArr.buffer, [positionArr.buffer]); + + this._layoutWorker.postMessage({ + cmd: 'update', + steps: steps, + temperature: this.temperature, + coolDown: this.coolDown + }); + for (var i = 0; i < steps; i++) { + this.temperature *= this.coolDown; + } + } + else { + + requestAnimationFrame(this._$onupdate); + + for (var i = 0; i < nodes.length; i++) { + var n = nodes[i]; + vec2.copy(this._layout.nodes[i].position, n.layout.position); + } + for (var i = 0; i < steps; i++) { + this._layout.temperature = this.temperature; + this._layout.update(); + this.temperature *= this.coolDown; + } + } + }; + + ForceLayout.prototype._$onupdate = function (e) { + if (this._layoutWorker) { + var positionArr = new Float32Array(e.data); + var token = positionArr[0]; + // If token is from current layout instance + if (token === this._token) { + for (var i = 0; i < this.graph.nodes.length; i++) { + var n = this.graph.nodes[i]; + n.layout.position[0] = positionArr[i * 2 + 1]; + n.layout.position[1] = positionArr[i * 2 + 2]; + } + this.onupdate && this.onupdate(); + } + } + else if (this._layout) { + if (this._layout.tokenMatch(this._token)) { + for (var i = 0; i < this.graph.nodes.length; i++) { + var n = this.graph.nodes[i]; + vec2.copy(n.layout.position, this._layout.nodes[i].position); + } + this.onupdate && this.onupdate(); + } + } + }; + + ForceLayout.prototype.dispose = function() { + if (this._layoutWorker) { + this._layoutWorker.terminate(); + } + this._layoutWorker = null; + this._layout = null; + this._token = 0; + }; return ForceLayout; }); @@ -37167,16 +39436,18 @@ define('echarts/chart/forceLayoutWorker',['require','zrender/tool/vector'],funct * */ -define('echarts/chart/force',['require','../component/base','./base','./forceLayoutWorker','zrender/shape/Line','../util/shape/Icon','../config','../util/ecData','zrender/tool/util','zrender/config','zrender/tool/vector','../util/ndarray','../chart'],function (require) { +define('echarts/chart/force',['require','../component/base','./base','../data/Graph','../layout/Force','zrender/shape/Line','zrender/shape/Image','../util/shape/Icon','../config','../util/ecData','zrender/tool/util','zrender/config','zrender/tool/vector','../chart'],function (require) { var ComponentBase = require('../component/base'); var ChartBase = require('./base'); - var ForceLayout = require('./forceLayoutWorker'); + var Graph = require('../data/Graph'); + var ForceLayout = require('../layout/Force'); // 图形依赖 var LineShape = require('zrender/shape/Line'); + var ImageShape = require('zrender/shape/Image'); var IconShape = require('../util/shape/Icon'); var ecConfig = require('../config'); @@ -37185,33 +39456,6 @@ define('echarts/chart/force',['require','../component/base','./base','./forceLay var zrConfig = require('zrender/config'); var vec2 = require('zrender/tool/vector'); - var NDArray = require('../util/ndarray'); - var ArrayCtor = typeof(Float32Array) == 'undefined' ? Array : Float32Array; - - var requestAnimationFrame = window.requestAnimationFrame - || window.msRequestAnimationFrame - || window.mozRequestAnimationFrame - || window.webkitRequestAnimationFrame - || function (func){setTimeout(func, 16);}; - - // Use inline web worker - var workerUrl; - if ( - typeof(Worker) !== 'undefined' && - typeof(Blob) !== 'undefined' - ) { - try { - var blob = new Blob([ForceLayout.getWorkerCode()]); - workerUrl = window.URL.createObjectURL(blob); - } catch(e) { - workerUrl = ''; - } - } - - function getToken() { - return Math.round(new Date().getTime() / 100) % 10000000; - } - /** * 构造函数 * @param {Object} messageCenter echart消息中心 @@ -37227,21 +39471,16 @@ define('echarts/chart/force',['require','../component/base','./base','./forceLay ChartBase.call(this); // 保存节点的位置,改变数据时能够有更好的动画效果 - // TODO this.__nodePositionMap = {}; - this._nodeShapes = []; - this._linkShapes = []; + this._graph = new Graph(true); + this._layout = new ForceLayout(); - this._updating = true; - - this._filteredNodes = null; - this._filteredLinks = null; - this._rawNodes = null; - this._rawLinks = null; + this._layout.onupdate = function() { + self._step(); + }; this._steps = 1; - this._coolDown = 0.99; // 关闭可拖拽属性 this.ondragstart = function() { @@ -37267,55 +39506,15 @@ define('echarts/chart/force',['require','../component/base','./base','./forceLay constructor: Force, - type : ecConfig.CHART_TYPE_FORCE, - - _init: function() { - var self = this; - - this.clear(); - - this._updating = true; - - this._buildShape(); - - if (this._layoutWorker) { - this._layoutWorker.onmessage = function(e) { - if (self._temperature < 0.01) { - requestAnimationFrame(function() { - self._step.call(self, e); - }); - } else { - self._step.call(self, e); - } - }; - - this._layoutWorker.postMessage({ - cmd: 'update', - steps: this._steps, - temperature: this._temperature, - coolDown: this._coolDown - }); - } - else { - var cb = function() { - if (self._updating) { - self._step(); - requestAnimationFrame(cb); - } - }; - - requestAnimationFrame(cb); - } - }, + type : ecConfig.CHART_TYPE_FORCE, - _buildShape: function() { + _init: function() { + // var self = this; var legend = this.component.legend; var series = this.series; var serieName; - this._temperature = 1; - - this.shapeList.length = 0; + this.clear(); for (var i = 0, l = series.length; i < l; i++) { var serie = series[i]; @@ -37323,28 +39522,6 @@ define('echarts/chart/force',['require','../component/base','./base','./forceLay series[i] = this.reformOption(series[i]); serieName = series[i].name || ''; - if (workerUrl && serie.useWorker) { - try { - if (!this._layoutWorker) { - this._layoutWorker = new Worker(workerUrl); - } - this._layout = null; - } catch(e) { // IE10-11 will throw security error when using blog url - this._layoutWorker = null; - if (!this._layout) { - this._layout = new ForceLayout(); - } - } - } else { - if (!this._layout) { - this._layout = new ForceLayout(); - } - if (this._layoutWorker) { - this._layoutWorker.terminate(); - this._layoutWorker = null; - } - } - // 系列图例开关 this.selectedMap[serieName] = legend ? legend.isSelected(serieName) : true; @@ -37367,217 +39544,173 @@ define('echarts/chart/force',['require','../component/base','./base','./forceLay } } - this._preProcessData(serie); - - this._nodeShapes.length = 0; - this._linkShapes.length = 0; - - this._buildLinkShapes(serie); - this._buildNodeShapes(serie); - - this._initLayout(serie); - - this._updateLinkShapes(); - // TODO 多个 force this._forceSerie = serie; + + this._initSerie(serie); break; } } }, - _preProcessData: function(serie) { - this._rawNodes = this.query(serie, 'nodes'); - this._rawLinks = zrUtil.clone(this.query(serie, 'links')); + _initSerie: function(serie) { + this._temperature = 1; - var filteredNodeList = []; - var filteredNodeMap = {}; - var cursor = 0; - var self = this; - this._filteredNodes = _filter(this._rawNodes, function (node, i) { - if (!node) { - return; - } - if (node.ignore) { - return; - } - var idx = -1; + var graph = this._graph; + graph.clear(); + + for (var i = 0, len = serie.nodes.length; i < len; i++) { + var n = serie.nodes[i]; if ( - typeof(node.category) == 'undefined' - || self.selectedMap[node.category] + !n || n.ignore + || (n.category && !this.selectedMap[n.category]) ) { - idx = cursor++; + continue; } - if (node.name) { - filteredNodeMap[node.name] = idx; + var node = graph.addNode(n.name, n); + node.rawIndex = i; + } + for (var i = 0, len = serie.links.length; i < len; i++) { + var e = serie.links[i]; + var n1 = e.source; + var n2 = e.target; + if (typeof(n1) === 'number') { + n1 = serie.nodes[n1]; + if (n1) { + n1 = n1.name; + } } - filteredNodeList[i] = idx; - - return idx >= 0; - }); - var source; - var target; - this._filteredLinks = _filter(this._rawLinks, function (link, i){ - source = link.source; - target = link.target; - var ret = true; - var idx = typeof(source) === 'string' - ? filteredNodeMap[source] // source 用 node id 表示 - : filteredNodeList[source]; // source 用 node index 表示 - if (typeof(idx) == 'undefined') { - idx = -1; + if (typeof(n2) === 'number') { + n2 = serie.nodes[n2]; + if (n2) { + n2 = n2.name; + } } - - if (idx >= 0) { - link.source = idx; - } else { - ret = false; + var edge = graph.addEdge(n1, n2, e); + if (edge) { + edge.rawIndex = i; } + } - var idx = typeof(target) === 'string' - ? filteredNodeMap[target] // target 用 node id 表示 - : filteredNodeList[target]; // target 用 node index 表示 - if (typeof(idx) == 'undefined') { - idx = -1; - } + this._buildLinkShapes(serie); + this._buildNodeShapes(serie); - if (idx >= 0) { - link.target = idx; - } else { - ret = false; - } - // 保存原始链接中的index - link.rawIndex = i; + this._initLayout(serie); - return ret; - }); + this._step(); }, _initLayout: function(serie) { - - var nodes = this._filteredNodes; - var links = this._filteredLinks; - var shapes = this._nodeShapes; - var len = nodes.length; + var graph = this._graph; + var len = graph.nodes.length; var minRadius = this.query(serie, 'minRadius'); var maxRadius = this.query(serie, 'maxRadius'); + this._steps = serie.steps || 1; - this._coolDown = serie.coolDown || 0.99; - var center = this.parseCenter(this.zr, serie.center); - var width = this.parsePercent(serie.size, this.zr.getWidth()); - var height = this.parsePercent(serie.size, this.zr.getHeight()); - var size = Math.min(width, height); + this._layout.center = this.parseCenter(this.zr, serie.center); + this._layout.width = this.parsePercent(serie.size, this.zr.getWidth()); + this._layout.height = this.parsePercent(serie.size, this.zr.getHeight()); + + this._layout.large = serie.large; + this._layout.scaling = serie.scaling; + this._layout.ratioScaling = serie.ratioScaling; + this._layout.gravity = serie.gravity; + this._layout.temperature = 1; + this._layout.coolDown = serie.coolDown; // 将值映射到minRadius-maxRadius的范围上 - var radius = []; + var min = Infinity; var max = -Infinity; for (var i = 0; i < len; i++) { - var node = nodes[i]; - radius.push(node.value || 1); + var gNode = graph.nodes[i]; + gNode.layout = { + radius: gNode.data.value || 1, + mass: 0 + }; + max = Math.max(gNode.data.value, max); + min = Math.min(gNode.data.value, min); } - - var arr = new NDArray(radius); - radius = arr.map(minRadius, maxRadius).toArray(); - var max = arr.max(); - if (max === 0) { - return; + var divider = max - min; + for (var i = 0; i < len; i++) { + var gNode = graph.nodes[i]; + if (divider > 0) { + gNode.layout.radius = + (gNode.layout.radius - min) * (maxRadius - minRadius) / divider + + minRadius; + // 节点质量是归一的 + gNode.layout.mass = gNode.layout.radius / maxRadius; + } else { + gNode.layout.radius = (maxRadius - minRadius) / 2; + gNode.layout.mass = 0.5; + } } - var massArr = arr.mul(1/max, arr).toArray(); - var positionArr = new ArrayCtor(len * 2); for (var i = 0; i < len; i++) { - var initPos; - var node = nodes[i]; - if (typeof(this.__nodePositionMap[node.name]) !== 'undefined') { - initPos = vec2.create(); - vec2.copy(initPos, this.__nodePositionMap[node.name]); - } else if (typeof(node.initial) !== 'undefined') { - initPos = Array.prototype.slice.call(node.initial); - } else { - initPos = _randomInSquare( + // var initPos; + var gNode = graph.nodes[i]; + if (typeof(this.__nodePositionMap[gNode.name]) !== 'undefined') { + gNode.layout.position = vec2.create(); + vec2.copy(gNode.layout.position, this.__nodePositionMap[gNode.name]); + } + else if (typeof(gNode.data.initial) !== 'undefined') { + gNode.layout.position = vec2.create(); + vec2.copy(gNode.layout.position, gNode.data.initial); + } + else { + var center = this._layout.center; + var size = Math.min(this._layout.width, this._layout.height); + gNode.layout.position = _randomInSquare( center[0], center[1], size * 0.8 ); } - var style = shapes[i].style; - style.width = style.width || (radius[i] * 2); - style.height = style.height || (radius[i] * 2); + var style = gNode.shape.style; + var radius = gNode.layout.radius; + style.width = style.width || (radius * 2); + style.height = style.height || (radius * 2); style.x = -style.width / 2; style.y = -style.height / 2; - shapes[i].position = initPos; - - positionArr[i * 2] = initPos[0]; - positionArr[i * 2 + 1] = initPos[1]; + vec2.copy(gNode.shape.position, gNode.layout.position); } - len = links.length; - var edgeArr = new ArrayCtor(len * 2); - var edgeWeightArr = new ArrayCtor(len); + // 边 + len = graph.edges.length; + max = -Infinity; for (var i = 0; i < len; i++) { - var link = links[i]; - edgeArr[i * 2] = link.source; - edgeArr[i * 2 + 1] = link.target; - edgeWeightArr[i] = link.weight || 1; + var e = graph.edges[i]; + e.layout = { + weight: e.data.weight || 1 + }; + if (e.layout.weight > max) { + max = e.layout.weight; + } } - - arr = new NDArray(edgeWeightArr); - var max = arr.max(); - if (max === 0) { - return; + // 权重归一 + for (var i = 0; i < len; i++) { + var e = graph.edges[i]; + e.layout.weight /= max; } - var edgeWeightArr = arr.mul(1 / max, arr)._array; - - var config = { - center: center, - width: serie.ratioScaling ? width : size, - height: serie.ratioScaling ? height : size, - scaling: serie.scaling || 1.0, - gravity: serie.gravity || 1.0, - barnesHutOptimize: serie.large - }; - - if (this._layoutWorker) { - - this._token = getToken(); - - this._layoutWorker.postMessage({ - cmd: 'init', - nodesPosition: positionArr, - nodesMass: massArr, - nodesSize: radius, - edges: edgeArr, - edgesWeight: edgeWeightArr, - token: this._token - }); - - this._layoutWorker.postMessage({ - cmd: 'updateConfig', - config: config - }); - } else { - - zrUtil.merge(this._layout, config, true); - this._layout.initNodes(positionArr, massArr, radius); - this._layout.initEdges(edgeArr, edgeWeightArr); - } + this._layout.init(graph, serie.useWorker); }, _buildNodeShapes: function(serie) { + var graph = this._graph; + var categories = this.query(serie, 'categories'); - var nodes = this._filteredNodes; - var len = nodes.length; + var len = graph.nodes.length; var legend = this.component.legend; for (var i = 0; i < len; i++) { - var node = nodes[i]; + var gNode = graph.nodes[i]; + var node = gNode.data; var shape = new IconShape({ style : { x : 0, y : 0 }, - clickable : true, + clickable: this.query(serie, 'clickable'), highlightStyle : {} }); @@ -37613,6 +39746,17 @@ define('echarts/chart/force',['require','../component/base','./base','./forceLay shape.style.width = shape.style.height = (this.deepQuery(queryTarget, 'symbolSize') || 0) * 2; + if (shape.style.iconType.match('image')) { + shape.style.image = shape.style.iconType.replace( + new RegExp('^image:\\/\\/'), '' + ); + shape = new ImageShape({ + style: shape.style, + highlightStyle: shape.highlightStyle, + clickable: shape.clickable + }); + } + // 节点样式 for (var k = 0; k < shapeNormalStyle.length; k++) { if (shapeNormalStyle[k]) { @@ -37624,7 +39768,7 @@ define('echarts/chart/force',['require','../component/base','./base','./forceLay if (shapeEmphasisStyle[k]) { zrUtil.merge(shape.highlightStyle, shapeEmphasisStyle[k], true); } - } + } // 节点标签样式 if (this.deepQuery(queryTarget, 'itemStyle.normal.label.show')) { @@ -37677,29 +39821,29 @@ define('echarts/chart/force',['require','../component/base','./base','./forceLay // data node, // data index - zrUtil.indexOf(this._rawNodes, node), + gNode.rawIndex, // name node.name || '', // value node.value ); - this._nodeShapes.push(shape); this.shapeList.push(shape); this.zr.addShape(shape); + + gNode.shape = shape; } }, _buildLinkShapes: function(serie) { - - var nodes = this._filteredNodes; - var links = this._filteredLinks; - var len = links.length; + var graph = this._graph; + var len = graph.edges.length; for (var i = 0; i < len; i++) { - var link = links[i]; - var source = nodes[link.source]; - var target = nodes[link.target]; + var gEdge = graph.edges[i]; + var link = gEdge.data; + var source = gEdge.node1; + var target = gEdge.node2; var linkShape = new LineShape({ style : { @@ -37709,7 +39853,7 @@ define('echarts/chart/force',['require','../component/base','./base','./forceLay yEnd : 0, lineWidth : 1 }, - clickable : true, + clickable: this.query(serie, 'clickable'), highlightStyle : {} }); @@ -37736,7 +39880,6 @@ define('echarts/chart/force',['require','../component/base','./base','./forceLay } } - var link = this._rawLinks[link.rawIndex]; ecData.pack( linkShape, // serie @@ -37745,24 +39888,24 @@ define('echarts/chart/force',['require','../component/base','./base','./forceLay 0, // link data { - source : link.source, - target : link.target, - weight : link.weight || 0 + source : source.data, + target : target.data, + weight : gEdge.data.weight || 0 }, // link data index - link.rawIndex, + gEdge.rawIndex, // source name - target name source.name + ' - ' + target.name, // link weight - link.weight || 0, + gEdge.data.weight || 0, // special // 这一项只是为了表明这是条边 true ); - this._linkShapes.push(linkShape); this.shapeList.push(linkShape); this.zr.addShape(linkShape); + gEdge.shape = linkShape; // Arrow shape if (serie.linkSymbol && serie.linkSymbol !== 'none') { @@ -37797,22 +39940,21 @@ define('echarts/chart/force',['require','../component/base','./base','./forceLay _updateLinkShapes: function() { var v = vec2.create(); - var links = this._filteredLinks; - for (var i = 0, len = links.length; i < len; i++) { - var link = links[i]; - var linkShape = this._linkShapes[i]; - var sourceShape = this._nodeShapes[link.source]; - var targetShape = this._nodeShapes[link.target]; - - linkShape.style.xStart = sourceShape.position[0]; - linkShape.style.yStart = sourceShape.position[1]; - linkShape.style.xEnd = targetShape.position[0]; - linkShape.style.yEnd = targetShape.position[1]; - - this.zr.modShape(linkShape.id); - - if (linkShape._symbolShape) { - var symbolShape = linkShape._symbolShape; + var edges = this._graph.edges; + for (var i = 0, len = edges.length; i < len; i++) { + var edge = edges[i]; + var sourceShape = edge.node1.shape; + var targetShape = edge.node2.shape; + + edge.shape.style.xStart = sourceShape.position[0]; + edge.shape.style.yStart = sourceShape.position[1]; + edge.shape.style.xEnd = targetShape.position[0]; + edge.shape.style.yEnd = targetShape.position[1]; + + this.zr.modShape(edge.shape.id); + + if (edge.shape._symbolShape) { + var symbolShape = edge.shape._symbolShape; vec2.copy(symbolShape.position, targetShape.position); vec2.sub(v, sourceShape.position, targetShape.position); @@ -37826,34 +39968,36 @@ define('echarts/chart/force',['require','../component/base','./base','./forceLay var angle; if (v[1] < 0) { angle = 2 * Math.PI - Math.acos(-v[0]); - } else { + } + else { angle = Math.acos(-v[0]); } - symbolShape.rotation = angle - Math.PI / 2; + symbolShape.rotation = angle - Math.PI / 2; this.zr.modShape(symbolShape.id); } } }, - _update: function(e) { - - this._layout.temperature = this._temperature; - this._layout.update(); - - for (var i = 0; i < this._layout.nodes.length; i++) { - var position = this._layout.nodes[i].position; - var shape = this._nodeShapes[i]; - var node = this._filteredNodes[i]; + _syncNodePositions: function() { + var graph = this._graph; + for (var i = 0; i < graph.nodes.length; i++) { + var gNode = graph.nodes[i]; + var position = gNode.layout.position; + var node = gNode.data; + var shape = gNode.shape; if (shape.fixed || (node.fixX && node.fixY)) { vec2.copy(position, shape.position); - } else if (node.fixX) { + } + else if (node.fixX) { position[0] = shape.position[0]; shape.position[1] = position[1]; - } else if (node.fixY) { + } + else if (node.fixY) { position[1] = shape.position[1]; shape.position[0] = position[0]; - } else { + } + else { vec2.copy(shape.position, position); } @@ -37865,92 +40009,21 @@ define('echarts/chart/force',['require','../component/base','./base','./forceLay } vec2.copy(gPos, position); } - } - - this._temperature *= this._coolDown; - }, - - _updateWorker: function(e) { - if (!this._updating) { - return; - } - - var positionArr = new Float32Array(e.data); - var token = positionArr[0]; - var ret = token === this._token; - // If token is from current layout instance - if (ret) { - var nNodes = (positionArr.length - 1) / 2; - - for (var i = 0; i < nNodes; i++) { - var shape = this._nodeShapes[i]; - var node = this._filteredNodes[i]; - - var x = positionArr[i * 2 + 1]; - var y = positionArr[i * 2 + 2]; - - if (shape.fixed || (node.fixX && node.fixY)) { - positionArr[i * 2 + 1] = shape.position[0]; - positionArr[i * 2 + 2] = shape.position[1]; - } else if (node.fixX) { - positionArr[i * 2 + 1] = shape.position[0]; - shape.position[1] = y; - } else if (node.fixY) { - positionArr[i * 2 + 2] = shape.position[1]; - shape.position[0] = x; - } else { - shape.position[0] = x; - shape.position[1] = y; - } - - var nodeName = node.name; - if (nodeName) { - var gPos = this.__nodePositionMap[nodeName]; - if (!gPos) { - gPos = this.__nodePositionMap[nodeName] = vec2.create(); - } - vec2.copy(gPos, shape.position); - } - } - - this._layoutWorker.postMessage(positionArr.buffer, [positionArr.buffer]); - } - - var self = this; - self._layoutWorker.postMessage({ - cmd: 'update', - steps: this._steps, - temperature: this._temperature, - coolDown: this._coolDown - }); - for (var i = 0; i < this._steps; i++) { - this._temperature *= this._coolDown; + this.zr.modShape(shape.id); } - - return ret; }, - _step: function(e){ - if (this._layoutWorker) { - var res = this._updateWorker(e); - if (!res) { - return; - } - } else { - if (this._temperature < 0.01) { - return; - } - this._update(); - } + _step: function(e) { + this._syncNodePositions(); this._updateLinkShapes(); - for (var i = 0; i < this._nodeShapes.length; i++) { - this.zr.modShape(this._nodeShapes[i].id); - } + this.zr.refreshNextFrame(); - this.zr.refresh(); + if (this._layout.temperature > 0.01) { + this._layout.step(this._steps); + } }, refresh: function(newOption) { @@ -37958,20 +40031,16 @@ define('echarts/chart/force',['require','../component/base','./base','./forceLay this.option = newOption; this.series = this.option.series; } - this.clear(); - this._buildShape(); + this._init(); }, dispose: function(){ - this._updating = false; this.clear(); this.shapeList = null; this.effectList = null; - if (this._layoutWorker) { - this._layoutWorker.terminate(); - } - this._layoutWorker = null; + this._layout.dispose(); + this._layout = null; this.__nodePositionMap = {}; } @@ -37996,7 +40065,8 @@ define('echarts/chart/force',['require','../component/base','./base','./forceLay } function onmousemove() { - this._temperature = 0.8; + this._layout.temperature = 0.8; + this._step(); } /** @@ -38022,12 +40092,13 @@ define('echarts/chart/force',['require','../component/base','./base','./forceLay } function _randomInSquare(x, y, size) { - return [ - (Math.random() - 0.5) * size + x, - (Math.random() - 0.5) * size + y - ]; + var v = vec2.create(); + v[0] = (Math.random() - 0.5) * size + x; + v[1] = (Math.random() - 0.5) * size + y; + return v; } + /* function _filter(array, callback){ var len = array.length; var result = []; @@ -38038,6 +40109,7 @@ define('echarts/chart/force',['require','../component/base','./base','./forceLay } return result; } + */ zrUtil.inherits(Force, ChartBase); zrUtil.inherits(Force, ComponentBase); @@ -38049,116 +40121,640 @@ define('echarts/chart/force',['require','../component/base','./base','./forceLay }); /** - * zrender - * - * author: loutongbing@baidu.com - * - * shape类:椭圆 - * Todo:excanvas bug ~ 连续scale保持?? IE8下不建议使用 - * 可配图形属性: - { - // 基础属性 - shape : 'ellipse', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 + * SVG Path + * @module zrender/shape/Path + * @see http://www.w3.org/TR/2011/REC-SVG11-20110816/paths.html#PathData + * @author: CrossDo (chenhuaimu@baidu.com) + */ - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,椭圆心横坐标 - y : {number}, // 必须,椭圆心纵坐标 - a : {number}, // 必须,椭圆横轴半径 - b : {number}, // 必须,椭圆纵轴半径 - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为top,附加文本位置。 - // inside | left | right | top | bottom - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, +/** + * @typedef {Object} IPathStyle + * @property {string} path path描述数据, 详见 {@link http://www.w3.org/TR/2011/REC-SVG11-20110816/paths.html#PathData} + * @property {number} x x轴位移 + * @property {number} y y轴位移 + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ +define('zrender/shape/Path',['require','./Base','./util/PathProxy','../tool/util'],function (require) { - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } + var Base = require('./Base'); + var PathProxy = require('./util/PathProxy'); + var PathSegment = PathProxy.PathSegment; - // 交互属性,详见shape.Base + var vMag = function(v) { + return Math.sqrt(v[0] * v[0] + v[1] * v[1]); + }; + var vRatio = function(u, v) { + return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v)); + }; + var vAngle = function(u, v) { + return (u[0] * v[1] < u[1] * v[0] ? -1 : 1) + * Math.acos(vRatio(u, v)); + }; + /** + * @alias module:zrender/shape/Path + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var Path = function (options) { + Base.call(this, options); + /** + * Path绘制样式 + * @name module:zrender/shape/Path#style + * @type {module:zrender/shape/Path~IPathStyle} + */ + /** + * Path高亮绘制样式 + * @name module:zrender/shape/Path#highlightStyle + * @type {module:zrender/shape/Path~IPathStyle} + */ + }; - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'ellipse', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - a : 100, - b : 50, - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 + Path.prototype = { + type: 'path', - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } + buildPathArray : function (data, x, y) { + if (!data) { + return []; + } + + // 平移 + x = x || 0; + y = y || 0; + // command string + var cs = data; + + // command chars + var cc = [ + 'm', 'M', 'l', 'L', 'v', 'V', 'h', 'H', 'z', 'Z', + 'c', 'C', 'q', 'Q', 't', 'T', 's', 'S', 'a', 'A' + ]; + + cs = cs.replace(/-/g, ' -'); + cs = cs.replace(/ /g, ' '); + cs = cs.replace(/ /g, ','); + cs = cs.replace(/,,/g, ','); + + var n; + // create pipes so that we can split the data + for (n = 0; n < cc.length; n++) { + cs = cs.replace(new RegExp(cc[n], 'g'), '|' + cc[n]); + } + + // create array + var arr = cs.split('|'); + var ca = []; + // init context point + var cpx = 0; + var cpy = 0; + for (n = 1; n < arr.length; n++) { + var str = arr[n]; + var c = str.charAt(0); + str = str.slice(1); + str = str.replace(new RegExp('e,-', 'g'), 'e-'); + + var p = str.split(','); + if (p.length > 0 && p[0] === '') { + p.shift(); + } + + for (var i = 0; i < p.length; i++) { + p[i] = parseFloat(p[i]); + } + while (p.length > 0) { + if (isNaN(p[0])) { + break; + } + var cmd = null; + var points = []; + + var ctlPtx; + var ctlPty; + var prevCmd; + + var rx; + var ry; + var psi; + var fa; + var fs; + + var x1 = cpx; + var y1 = cpy; + + // convert l, H, h, V, and v to L + switch (c) { + case 'l': + cpx += p.shift(); + cpy += p.shift(); + cmd = 'L'; + points.push(cpx, cpy); + break; + case 'L': + cpx = p.shift(); + cpy = p.shift(); + points.push(cpx, cpy); + break; + case 'm': + cpx += p.shift(); + cpy += p.shift(); + cmd = 'M'; + points.push(cpx, cpy); + c = 'l'; + break; + case 'M': + cpx = p.shift(); + cpy = p.shift(); + cmd = 'M'; + points.push(cpx, cpy); + c = 'L'; + break; + + case 'h': + cpx += p.shift(); + cmd = 'L'; + points.push(cpx, cpy); + break; + case 'H': + cpx = p.shift(); + cmd = 'L'; + points.push(cpx, cpy); + break; + case 'v': + cpy += p.shift(); + cmd = 'L'; + points.push(cpx, cpy); + break; + case 'V': + cpy = p.shift(); + cmd = 'L'; + points.push(cpx, cpy); + break; + case 'C': + points.push(p.shift(), p.shift(), p.shift(), p.shift()); + cpx = p.shift(); + cpy = p.shift(); + points.push(cpx, cpy); + break; + case 'c': + points.push( + cpx + p.shift(), cpy + p.shift(), + cpx + p.shift(), cpy + p.shift() + ); + cpx += p.shift(); + cpy += p.shift(); + cmd = 'C'; + points.push(cpx, cpy); + break; + case 'S': + ctlPtx = cpx; + ctlPty = cpy; + prevCmd = ca[ca.length - 1]; + if (prevCmd.command === 'C') { + ctlPtx = cpx + (cpx - prevCmd.points[2]); + ctlPty = cpy + (cpy - prevCmd.points[3]); + } + points.push(ctlPtx, ctlPty, p.shift(), p.shift()); + cpx = p.shift(); + cpy = p.shift(); + cmd = 'C'; + points.push(cpx, cpy); + break; + case 's': + ctlPtx = cpx, ctlPty = cpy; + prevCmd = ca[ca.length - 1]; + if (prevCmd.command === 'C') { + ctlPtx = cpx + (cpx - prevCmd.points[2]); + ctlPty = cpy + (cpy - prevCmd.points[3]); + } + points.push( + ctlPtx, ctlPty, + cpx + p.shift(), cpy + p.shift() + ); + cpx += p.shift(); + cpy += p.shift(); + cmd = 'C'; + points.push(cpx, cpy); + break; + case 'Q': + points.push(p.shift(), p.shift()); + cpx = p.shift(); + cpy = p.shift(); + points.push(cpx, cpy); + break; + case 'q': + points.push(cpx + p.shift(), cpy + p.shift()); + cpx += p.shift(); + cpy += p.shift(); + cmd = 'Q'; + points.push(cpx, cpy); + break; + case 'T': + ctlPtx = cpx, ctlPty = cpy; + prevCmd = ca[ca.length - 1]; + if (prevCmd.command === 'Q') { + ctlPtx = cpx + (cpx - prevCmd.points[0]); + ctlPty = cpy + (cpy - prevCmd.points[1]); + } + cpx = p.shift(); + cpy = p.shift(); + cmd = 'Q'; + points.push(ctlPtx, ctlPty, cpx, cpy); + break; + case 't': + ctlPtx = cpx, ctlPty = cpy; + prevCmd = ca[ca.length - 1]; + if (prevCmd.command === 'Q') { + ctlPtx = cpx + (cpx - prevCmd.points[0]); + ctlPty = cpy + (cpy - prevCmd.points[1]); + } + cpx += p.shift(); + cpy += p.shift(); + cmd = 'Q'; + points.push(ctlPtx, ctlPty, cpx, cpy); + break; + case 'A': + rx = p.shift(); + ry = p.shift(); + psi = p.shift(); + fa = p.shift(); + fs = p.shift(); + + x1 = cpx, y1 = cpy; + cpx = p.shift(), cpy = p.shift(); + cmd = 'A'; + points = this._convertPoint( + x1, y1, cpx, cpy, fa, fs, rx, ry, psi + ); + break; + case 'a': + rx = p.shift(); + ry = p.shift(); + psi = p.shift(); + fa = p.shift(); + fs = p.shift(); + + x1 = cpx, y1 = cpy; + cpx += p.shift(); + cpy += p.shift(); + cmd = 'A'; + points = this._convertPoint( + x1, y1, cpx, cpy, fa, fs, rx, ry, psi + ); + break; + } + + // 平移变换 + for (var j = 0, l = points.length; j < l; j += 2) { + points[j] += x; + points[j + 1] += y; + } + ca.push(new PathSegment( + cmd || c, points + )); + } + + if (c === 'z' || c === 'Z') { + ca.push(new PathSegment('z', [])); + } + } + + return ca; + }, + + _convertPoint : function (x1, y1, x2, y2, fa, fs, rx, ry, psiDeg) { + var psi = psiDeg * (Math.PI / 180.0); + var xp = Math.cos(psi) * (x1 - x2) / 2.0 + + Math.sin(psi) * (y1 - y2) / 2.0; + var yp = -1 * Math.sin(psi) * (x1 - x2) / 2.0 + + Math.cos(psi) * (y1 - y2) / 2.0; + + var lambda = (xp * xp) / (rx * rx) + (yp * yp) / (ry * ry); + + if (lambda > 1) { + rx *= Math.sqrt(lambda); + ry *= Math.sqrt(lambda); + } + + var f = Math.sqrt((((rx * rx) * (ry * ry)) + - ((rx * rx) * (yp * yp)) + - ((ry * ry) * (xp * xp))) / ((rx * rx) * (yp * yp) + + (ry * ry) * (xp * xp)) + ); + + if (fa === fs) { + f *= -1; + } + if (isNaN(f)) { + f = 0; + } + + var cxp = f * rx * yp / ry; + var cyp = f * -ry * xp / rx; + + var cx = (x1 + x2) / 2.0 + + Math.cos(psi) * cxp + - Math.sin(psi) * cyp; + var cy = (y1 + y2) / 2.0 + + Math.sin(psi) * cxp + + Math.cos(psi) * cyp; + + var theta = vAngle([ 1, 0 ], [ (xp - cxp) / rx, (yp - cyp) / ry ]); + var u = [ (xp - cxp) / rx, (yp - cyp) / ry ]; + var v = [ (-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry ]; + var dTheta = vAngle(u, v); + + if (vRatio(u, v) <= -1) { + dTheta = Math.PI; + } + if (vRatio(u, v) >= 1) { + dTheta = 0; + } + if (fs === 0 && dTheta > 0) { + dTheta = dTheta - 2 * Math.PI; + } + if (fs === 1 && dTheta < 0) { + dTheta = dTheta + 2 * Math.PI; + } + return [ cx, cy, rx, ry, theta, dTheta, psi, fs ]; + }, + + /** + * 创建路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Path~IPathStyle} style + */ + buildPath : function (ctx, style) { + var path = style.path; + + // 平移坐标 + var x = style.x || 0; + var y = style.y || 0; + + style.pathArray = style.pathArray || this.buildPathArray(path, x, y); + var pathArray = style.pathArray; + + // 记录边界点,用于判断inside + var pointList = style.pointList = []; + var singlePointList = []; + for (var i = 0, l = pathArray.length; i < l; i++) { + if (pathArray[i].command.toUpperCase() == 'M') { + singlePointList.length > 0 + && pointList.push(singlePointList); + singlePointList = []; + } + var p = pathArray[i].points; + for (var j = 0, k = p.length; j < k; j += 2) { + singlePointList.push([p[j], p[j + 1]]); + } + } + singlePointList.length > 0 && pointList.push(singlePointList); + + for (var i = 0, l = pathArray.length; i < l; i++) { + var c = pathArray[i].command; + var p = pathArray[i].points; + switch (c) { + case 'L': + ctx.lineTo(p[0], p[1]); + break; + case 'M': + ctx.moveTo(p[0], p[1]); + break; + case 'C': + ctx.bezierCurveTo(p[0], p[1], p[2], p[3], p[4], p[5]); + break; + case 'Q': + ctx.quadraticCurveTo(p[0], p[1], p[2], p[3]); + break; + case 'A': + var cx = p[0]; + var cy = p[1]; + var rx = p[2]; + var ry = p[3]; + var theta = p[4]; + var dTheta = p[5]; + var psi = p[6]; + var fs = p[7]; + var r = (rx > ry) ? rx : ry; + var scaleX = (rx > ry) ? 1 : rx / ry; + var scaleY = (rx > ry) ? ry / rx : 1; + + ctx.translate(cx, cy); + ctx.rotate(psi); + ctx.scale(scaleX, scaleY); + ctx.arc(0, 0, r, theta, theta + dTheta, 1 - fs); + ctx.scale(1 / scaleX, 1 / scaleY); + ctx.rotate(-psi); + ctx.translate(-cx, -cy); + break; + case 'z': + ctx.closePath(); + break; + } + } + + return; + }, + + /** + * 计算返回Path包围盒矩形。 + * @param {module:zrender/shape/Path~IPathStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect : function (style) { + if (style.__rect) { + return style.__rect; + } + + var lineWidth; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } + else { + lineWidth = 0; + } + + var minX = Number.MAX_VALUE; + var maxX = Number.MIN_VALUE; + + var minY = Number.MAX_VALUE; + var maxY = Number.MIN_VALUE; + + // 平移坐标 + var x = style.x || 0; + var y = style.y || 0; + + var pathArray = style.pathArray || this.buildPathArray(style.path); + for (var i = 0; i < pathArray.length; i++) { + var p = pathArray[i].points; + + for (var j = 0; j < p.length; j++) { + if (j % 2 === 0) { + if (p[j] + x < minX) { + minX = p[j]; + } + if (p[j] + x > maxX) { + maxX = p[j]; + } + } + else { + if (p[j] + y < minY) { + minY = p[j]; + } + if (p[j] + y > maxY) { + maxY = p[j]; + } + } + } + } + + var rect; + if (minX === Number.MAX_VALUE + || maxX === Number.MIN_VALUE + || minY === Number.MAX_VALUE + || maxY === Number.MIN_VALUE + ) { + rect = { + x : 0, + y : 0, + width : 0, + height : 0 + }; + } + else { + rect = { + x : Math.round(minX - lineWidth / 2), + y : Math.round(minY - lineWidth / 2), + width : maxX - minX + lineWidth, + height : maxY - minY + lineWidth + }; + } + style.__rect = rect; + return rect; + } + }; + + require('../tool/util').inherits(Path, Base); + return Path; +}); + +/** + * 水滴形状 + * @module zrender/shape/Ellipse + * @author loutongbing@baidu.com + * @example + * var Ellipse = require('zrender/shape/Ellipse'); + * var shape = new Ellipse({ + * style: { + * x: 100, + * y: 100, + * a: 40, + * b: 20, + * brushType: 'both', + * color: 'blue', + * strokeColor: 'red', + * lineWidth: 3, + * text: 'Ellipse' + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} IEllipseStyle + * @property {number} x 圆心x坐标 + * @property {number} y 圆心y坐标 + * @property {number} a 横轴半径 + * @property {number} b 纵轴半径 + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic */ define( 'zrender/shape/Ellipse',['require','./Base','../tool/util'],function (require) { var Base = require('./Base'); - function Ellipse(options) { + /** + * @alias module:zrender/shape/Ellipse + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var Ellipse = function(options) { Base.call(this, options); - } + /** + * 椭圆绘制样式 + * @name module:zrender/shape/Ellipse#style + * @type {module:zrender/shape/Ellipse~IEllipseStyle} + */ + /** + * 椭圆高亮绘制样式 + * @name module:zrender/shape/Ellipse#highlightStyle + * @type {module:zrender/shape/Ellipse~IEllipseStyle} + */ + }; Ellipse.prototype = { type: 'ellipse', /** - * 创建圆形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 + * 构建椭圆的Path + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Ellipse~IEllipseStyle} style */ buildPath : function(ctx, style) { var k = 0.5522848; var x = style.x; var y = style.y; - var a =style.a; + var a = style.a; var b = style.b; var ox = a * k; // 水平控制点偏移量 var oy = b * k; // 垂直控制点偏移量 - //从椭圆的左端点开始顺时针绘制四条三次贝塞尔曲线 + // 从椭圆的左端点开始顺时针绘制四条三次贝塞尔曲线 ctx.moveTo(x - a, y); ctx.bezierCurveTo(x - a, y - oy, x - ox, y - b, x, y - b); ctx.bezierCurveTo(x + ox, y - b, x + a, y - oy, x + a, y); ctx.bezierCurveTo(x + a, y + oy, x + ox, y + b, x, y + b); ctx.bezierCurveTo(x - ox, y + b, x - a, y + oy, x - a, y); + ctx.closePath(); }, /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style + /** + * 计算返回椭圆包围盒矩形。 + * @param {module:zrender/shape/Ellipse~IEllipseStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} */ getRect : function(style) { if (style.__rect) { @@ -38187,6 +40783,342 @@ define( return Ellipse; } ); + +/** + * echarts组件:漫游控制器 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * + */ +define('echarts/component/roamController',['require','./base','zrender/shape/Rectangle','zrender/shape/Sector','zrender/shape/Circle','../config','zrender/tool/util','zrender/tool/color','zrender/tool/event','../component'],function (require) { + var Base = require('./base'); + + // 图形依赖 + var RectangleShape = require('zrender/shape/Rectangle'); + var SectorShape = require('zrender/shape/Sector'); + var CircleShape = require('zrender/shape/Circle'); + + var ecConfig = require('../config'); + var zrUtil = require('zrender/tool/util'); + var zrColor = require('zrender/tool/color'); + var zrEvent = require('zrender/tool/event'); + + /** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} option 图表参数 + */ + function RoamController(ecTheme, messageCenter, zr, option, myChart) { + if (!option.roamController || !option.roamController.show) { + return; + } + if (!option.roamController.mapTypeControl) { + console.error('option.roamController.mapTypeControl has not been defined.'); + return; + } + + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + + this.rcOption = option.roamController; + + var self = this; + this._drictionMouseDown = function(params) { + return self.__drictionMouseDown(params); + }; + this._drictionMouseUp = function(params) { + return self.__drictionMouseUp(params); + }; + this._drictionMouseMove = function(params) { + return self.__drictionMouseMove(params); + }; + this._drictionMouseOut = function(params) { + return self.__drictionMouseOut(params); + }; + this._scaleHandler = function(params) { + return self.__scaleHandler(params); + }; + this.refresh(option); + } + + RoamController.prototype = { + type: ecConfig.COMPONENT_TYPE_ROAMCONTROLLER, + _buildShape: function () { + // 元素组的位置参数,通过计算所得x, y, width, height + this._itemGroupLocation = this._getItemGroupLocation(); + + this._buildBackground(); + this._buildItem(); + + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + }, + + /** + * 构建所有漫游控制器元素 + */ + _buildItem: function () { + this.shapeList.push(this._getDirectionShape('up')); + this.shapeList.push(this._getDirectionShape('down')); + this.shapeList.push(this._getDirectionShape('left')); + this.shapeList.push(this._getDirectionShape('right')); + this.shapeList.push(this._getScaleShape('scaleUp')); + this.shapeList.push(this._getScaleShape('scaleDown')); + }, + + _getDirectionShape: function(direction) { + var r = this._itemGroupLocation.r; + var x = this._itemGroupLocation.x + r; + var y = this._itemGroupLocation.y + r; + + var sectorShape = { + zlevel: this._zlevelBase, + style: { + x: x, // 圆心横坐标 + y: y, // 圆心纵坐标 + r: r, // 圆环外半径 + startAngle: -45, + endAngle: 45, + color: this.rcOption.handlerColor, + text: '>', + textX: x + r / 2 + 4, + textY: y - 0.5, + textAlign: 'center', + textBaseline: 'middle', + textPosition: 'specific', + textColor: this.rcOption.fillerColor, + textFont: Math.floor(r / 2) + 'px arial' + }, + highlightStyle: { + color: zrColor.lift(this.rcOption.handlerColor, -0.2), + brushType: 'fill' + }, + clickable: true + }; + switch (direction) { + case 'up': + sectorShape.rotation = [Math.PI / 2, x, y]; + break; + case 'left': + sectorShape.rotation = [Math.PI, x, y]; + break; + case 'down': + sectorShape.rotation = [-Math.PI / 2, x, y]; + break; + } + + sectorShape = new SectorShape(sectorShape); + sectorShape._roamType = direction; + sectorShape.onmousedown = this._drictionMouseDown; + sectorShape.onmouseup = this._drictionMouseUp; + sectorShape.onmousemove = this._drictionMouseMove; + sectorShape.onmouseout = this._drictionMouseOut; + + return sectorShape; + }, + + _getScaleShape: function(text) { + var width = this._itemGroupLocation.width; + var height = this._itemGroupLocation.height - width; + height = height < 0 ? 20 : height; // 确保height不为负 + + var r = Math.min(width / 2 - 5, height) / 2; + var x = this._itemGroupLocation.x + + (text === 'scaleDown' ? (width - r) : r); + var y = this._itemGroupLocation.y + this._itemGroupLocation.height - r; + + var scaleShape = { + zlevel: this._zlevelBase, + style: { + x: x, + y: y, + r: r, + color: this.rcOption.handlerColor, + text: text === 'scaleDown' ? '-' : '+', + textX: x, + textY: y - 2, + textAlign: 'center', + textBaseline: 'middle', + textPosition: 'specific', + textColor: this.rcOption.fillerColor, + textFont: Math.floor(r) + 'px verdana' + }, + highlightStyle: { + color: zrColor.lift(this.rcOption.handlerColor, -0.2), + brushType: 'fill' + }, + clickable: true + }; + + scaleShape = new CircleShape(scaleShape); + scaleShape._roamType = text; + scaleShape.onmousedown = this._scaleHandler; + + return scaleShape; + }, + + _buildBackground: function () { + var pTop = this.rcOption.padding[0]; + var pRight = this.rcOption.padding[1]; + var pBottom = this.rcOption.padding[2]; + var pLeft = this.rcOption.padding[3]; + + this.shapeList.push(new RectangleShape({ + zlevel: this._zlevelBase, + hoverable :false, + style: { + x: this._itemGroupLocation.x - pLeft, + y: this._itemGroupLocation.y - pTop, + width: this._itemGroupLocation.width + pLeft + pRight, + height: this._itemGroupLocation.height + pTop + pBottom, + brushType: this.rcOption.borderWidth === 0 ? 'fill' : 'both', + color: this.rcOption.backgroundColor, + strokeColor: this.rcOption.borderColor, + lineWidth: this.rcOption.borderWidth + } + })); + }, + + /** + * 根据选项计算漫游控制器实体的位置坐标 + */ + _getItemGroupLocation: function () { + var padding = this.rcOption.padding; + var width = this.rcOption.width; + var height = this.rcOption.height; + + var zrWidth = this.zr.getWidth(); + var zrHeight = this.zr.getHeight(); + var x; + switch (this.rcOption.x) { + case 'center' : + x = Math.floor((zrWidth - width) / 2); + break; + case 'left' : + x = padding[3] + this.rcOption.borderWidth; + break; + case 'right' : + x = zrWidth + - width + - padding[1] + - padding[3] + - this.rcOption.borderWidth * 2; + break; + default : + x = this.parsePercent(this.rcOption.x, zrWidth); + break; + } + + var y; + switch (this.rcOption.y) { + case 'top' : + y = padding[0] + this.rcOption.borderWidth; + break; + case 'bottom' : + y = zrHeight + - height + - padding[0] + - padding[2] + - this.rcOption.borderWidth * 2; + break; + case 'center' : + y = Math.floor((zrHeight - height) / 2); + break; + default : + y = this.parsePercent(this.rcOption.y, zrHeight); + break; + } + + return { + x: x, + y: y, + r: width / 2, + width: width, + height: height + }; + }, + + __drictionMouseDown: function(params) { + this.mousedown = true; + this._drictionHandlerOn(params); + }, + + __drictionMouseUp: function(params) { + this.mousedown = false; + this._drictionHandlerOff(params); + }, + + __drictionMouseMove: function(params) { + if (this.mousedown) { + this._drictionHandlerOn(params); + } + }, + + __drictionMouseOut: function(params) { + this._drictionHandlerOff(params); + }, + + _drictionHandlerOn: function(params) { + this._dispatchEvent(params.event, params.target._roamType); + clearInterval(this.dircetionTimer); + var self = this; + this.dircetionTimer = setInterval(function() { + self._dispatchEvent(params.event, params.target._roamType); + }, 100); + zrEvent.stop(params.event); + }, + + _drictionHandlerOff: function(params) { + clearInterval(this.dircetionTimer); + }, + + __scaleHandler: function(params) { + this._dispatchEvent(params.event, params.target._roamType); + zrEvent.stop(params.event); + }, + + _dispatchEvent: function(event, roamType){ + this.messageCenter.dispatch( + ecConfig.EVENT.ROAMCONTROLLER, + event, + { + roamType: roamType, + mapTypeControl: this.rcOption.mapTypeControl, + step: this.rcOption.step + }, + this.myChart + ); + }, + /** + * 刷新 + */ + refresh: function (newOption) { + if (newOption) { + this.option = newOption || this.option; + this.option.roamController = this.reformOption(this.option.roamController); + // 补全padding属性 + this.option.roamController.padding = this.reformCssArray( + this.option.roamController.padding + ); + this.rcOption = this.option.roamController; + } + this.clear(); + this._buildShape(); + } + }; + + + zrUtil.inherits(RoamController, Base); + + require('../component').define('roamController', RoamController); + + return RoamController; +}); + + + /** * 地图参数 * key为地图类型: { @@ -38254,6 +41186,24 @@ define('echarts/util/mapData/params',['require'],function (require) { } var mapParams = { + 'none': { + getGeoJson: function(callback) { + callback({ + type: 'FeatureCollection', + features: [{ + type: 'Feature', + geometry: { + coordinates: [], + encodeOffsets: [], + type: 'Polygon' + }, + properties: { + + } + }] + }); + } + }, 'world': { getGeoJson: function (callback) { require(['./geoJson/world_geo'], function (md){ @@ -38268,10 +41218,10 @@ define('echarts/util/mapData/params',['require'],function (require) { }); } }, - '南海诸岛' : { - textCoord : [126, 25], - getPath : function (leftTop, scale) { - // scale.x : width = 10.51 : 64 + '南海诸岛': { + textCoord: [126, 25], + getPath: function (leftTop, scale) { + // scale.x: width = 10.51 : 64 var pList = [ [ [0,3.5],[7,11.2],[15,11.9],[30,7],[42,0.7],[52,0.7], @@ -38573,8 +41523,8 @@ define('echarts/util/mapData/params',['require'],function (require) { }; return { - decode : decode, - params : mapParams + decode: decode, + params: mapParams }; }); /** @@ -38615,8 +41565,8 @@ define('echarts/util/mapData/textFixed',[],function() { */ define('echarts/util/mapData/geoCoord',[],function() { return { - 'Russia' : [100, 60], - 'United States of America' : [-99, 38] + 'Russia': [ 100, 60 ], + 'United States of America': [ -99, 38 ] }; }); /** @@ -38646,10 +41596,10 @@ define('echarts/util/projection/svg',['require','zrender/shape/Path'],function(r var width = toFloat(svgNode.getAttribute('width')); var height = toFloat(svgNode.getAttribute('height')); return { - left : x, - top : y, - width : width, - height : height + left: x, + top: y, + width: width, + height: height }; } @@ -38665,7 +41615,7 @@ define('echarts/util/projection/svg',['require','zrender/shape/Path'],function(r // Common attributes obj.scale = scale; obj.properties = { - name : root.getAttribute('name') || '' + name: root.getAttribute('name') || '' }; obj.id = root.id; extendCommonAttributes(obj, root); @@ -38747,11 +41697,11 @@ define('echarts/util/projection/svg',['require','zrender/shape/Path'],function(r var shapeBuilders = { path: function(xmlNode, scale) { var path = xmlNode.getAttribute('d'); - var rect = PathShape.prototype.getRect({path : path}); + var rect = PathShape.prototype.getRect({ path : path }); return { shapeType: 'path', - path : path, - cp : [ + path: path, + cp: [ (rect.x + rect.width / 2) * scale[0], (rect.y + rect.height / 2) * scale[1] ] @@ -38770,7 +41720,7 @@ define('echarts/util/projection/svg',['require','zrender/shape/Path'],function(r y: y, width: width, height: height, - cp : [ + cp: [ (x + width / 2) * scale[0], (y + height / 2) * scale[1] ] @@ -38789,7 +41739,7 @@ define('echarts/util/projection/svg',['require','zrender/shape/Path'],function(r yStart: y1, xEnd: x2, yEnd: y2, - cp : [ + cp: [ (x1 + x2) * 0.5 * scale[0], (y1 + y2) * 0.5 * scale[1] ] @@ -38852,7 +41802,7 @@ define('echarts/util/projection/svg',['require','zrender/shape/Path'],function(r return { shapeType: 'polygon', pointList: points, - cp : [ + cp: [ (min[0] + max[0]) / 2 * scale[0], (min[1] + max[1]) / 2 * scale[0] ] @@ -38867,10 +41817,10 @@ define('echarts/util/projection/svg',['require','zrender/shape/Path'],function(r }; return { - getBbox : getBbox, - geoJson2Path : geoJson2Path, - pos2geo : pos2geo, - geo2pos : geo2pos + getBbox: getBbox, + geoJson2Path: geoJson2Path, + pos2geo: pos2geo, + geo2pos: geo2pos }; }); /** @@ -38923,10 +41873,10 @@ define('echarts/util/projection/normal',[],function() { } json.srcSize = { - left : convertorParse.xmin.toFixed(4)*1, - top : convertorParse.ymin.toFixed(4)*1, - width : (convertorParse.xmax - convertorParse.xmin).toFixed(4)*1, - height : (convertorParse.ymax - convertorParse.ymin).toFixed(4)*1 + left: convertorParse.xmin.toFixed(4)*1, + top: convertorParse.ymin.toFixed(4)*1, + width: (convertorParse.xmax - convertorParse.xmin).toFixed(4)*1, + height: (convertorParse.ymax - convertorParse.ymin).toFixed(4)*1 }; return json; @@ -38934,13 +41884,13 @@ define('echarts/util/projection/normal',[],function() { var convertor = { //调整俄罗斯东部到地图右侧与俄罗斯相连 - formatPoint : function (p) { + formatPoint: function (p) { return [ ((p[0] < -168.5 && p[1] > 63.8) ? p[0] + 360 : p[0]) + 168.5, 90 - p[1] ]; }, - makePoint : function (p) { + makePoint: function (p) { var self = this; var point = self.formatPoint(p); // for cp @@ -38954,11 +41904,11 @@ define('echarts/util/projection/normal',[],function() { + convertor.offset.top; return [x, y]; }, - Point : function (coordinates) { + Point: function (coordinates) { coordinates = this.makePoint(coordinates); return coordinates.join(','); }, - LineString : function (coordinates) { + LineString: function (coordinates) { var str = ''; var point; for (var i = 0, len = coordinates.length; i < len; i++) { @@ -38971,28 +41921,28 @@ define('echarts/util/projection/normal',[],function() { } return str; }, - Polygon : function (coordinates) { + Polygon: function (coordinates) { var str = ''; for (var i = 0, len = coordinates.length; i < len; i++) { str = str + convertor.LineString(coordinates[i]) + 'z'; } return str; }, - MultiPoint : function (coordinates) { + MultiPoint: function (coordinates) { var arr = []; for (var i = 0, len = coordinates.length; i < len; i++) { arr.push(convertor.Point(coordinates[i])); } return arr; }, - MultiLineString : function (coordinates) { + MultiLineString: function (coordinates) { var str = ''; for (var i = 0, len = coordinates.length; i < len; i++) { str += convertor.LineString(coordinates[i]); } return str; }, - MultiPolygon : function (coordinates) { + MultiPolygon: function (coordinates) { var str = ''; for (var i = 0, len = coordinates.length; i < len; i++) { str += convertor.Polygon(coordinates[i]); @@ -39002,9 +41952,9 @@ define('echarts/util/projection/normal',[],function() { }; var convertorParse = { - formatPoint : convertor.formatPoint, + formatPoint: convertor.formatPoint, - makePoint : function (p) { + makePoint: function (p) { var self = this; var point = self.formatPoint(p); var x = point[0]; @@ -39014,30 +41964,30 @@ define('echarts/util/projection/normal',[],function() { if (self.ymin > y) { self.ymin = y; } if (self.ymax < y) { self.ymax = y; } }, - Point : function (coordinates) { + Point: function (coordinates) { this.makePoint(coordinates); }, - LineString : function (coordinates) { + LineString: function (coordinates) { for (var i = 0, len = coordinates.length; i < len; i++) { this.makePoint(coordinates[i]); } }, - Polygon : function (coordinates) { + Polygon: function (coordinates) { for (var i = 0, len = coordinates.length; i < len; i++) { this.LineString(coordinates[i]); } }, - MultiPoint : function (coordinates) { + MultiPoint: function (coordinates) { for (var i = 0, len = coordinates.length; i < len; i++) { this.Point(coordinates[i]); } }, - MultiLineString : function (coordinates) { + MultiLineString: function (coordinates) { for (var i = 0, len = coordinates.length; i < len; i++) { this.LineString(coordinates[i]); } }, - MultiPolygon : function (coordinates) { + MultiPolygon: function (coordinates) { for (var i = 0, len = coordinates.length; i < len; i++) { this.Polygon(coordinates[i]); } @@ -39054,10 +42004,10 @@ define('echarts/util/projection/normal',[],function() { } transform.offset = { - x : json.srcSize.left, - y : json.srcSize.top, - left : transform.OffsetLeft || 0, - top : transform.OffsetTop || 0 + x: json.srcSize.left, + y: json.srcSize.top, + left: transform.OffsetLeft || 0, + top: transform.OffsetTop || 0 }; convertor.scale = transform.scale; @@ -39093,23 +42043,23 @@ define('echarts/util/projection/normal',[],function() { shapeType = gm.type; shapeCoordinates = gm.coordinates; convertor._bbox = { - xmin : 360, - xmax : -360, - ymin : 180, - ymax : -180 + xmin: 360, + xmax: -360, + ymin: 180, + ymax: -180 }; str = convertor[shapeType](shapeCoordinates); pathArray.push({ - //type : shapeType, - path : str, - cp : shape.properties.cp - ? convertor.makePoint(shape.properties.cp) - : convertor.makePoint([ - (convertor._bbox.xmin + convertor._bbox.xmax) / 2, - (convertor._bbox.ymin + convertor._bbox.ymax) / 2 - ]), - properties : shape.properties, - id : shape.id + // type: shapeType, + path: str, + cp: shape.properties.cp + ? convertor.makePoint(shape.properties.cp) + : convertor.makePoint([ + (convertor._bbox.xmin + convertor._bbox.xmax) / 2, + (convertor._bbox.ymin + convertor._bbox.ymax) / 2 + ]), + properties: shape.properties, + id: shape.id }); } @@ -39151,10 +42101,10 @@ define('echarts/util/projection/normal',[],function() { } return { - getBbox : getBbox, - geoJson2Path : geoJson2Path, - pos2geo : pos2geo, - geo2pos : geo2pos + getBbox: getBbox, + geoJson2Path: geoJson2Path, + pos2geo: pos2geo, + geo2pos: geo2pos }; }); /** @@ -39164,7 +42114,7 @@ define('echarts/util/projection/normal',[],function() { * @author Kener (@Kener-林峰, linzhifeng@baidu.com) * */ -define('echarts/chart/map',['require','../component/base','./base','zrender/shape/Text','zrender/shape/Path','zrender/shape/Circle','zrender/shape/Rectangle','zrender/shape/Line','zrender/shape/Polygon','zrender/shape/Ellipse','../component/dataRange','../config','../util/ecData','zrender/tool/util','zrender/config','zrender/tool/event','../util/mapData/params','../util/mapData/textFixed','../util/mapData/geoCoord','../util/projection/svg','../util/projection/normal','../util/projection/normal','../chart'],function (require) { +define('echarts/chart/map',['require','../component/base','./base','zrender/shape/Text','zrender/shape/Path','zrender/shape/Circle','zrender/shape/Rectangle','zrender/shape/Line','zrender/shape/Polygon','zrender/shape/Ellipse','../component/dataRange','../component/roamController','../config','../util/ecData','zrender/tool/util','zrender/config','zrender/tool/event','../util/mapData/params','../util/mapData/textFixed','../util/mapData/geoCoord','../util/projection/svg','../util/projection/normal','../util/projection/normal','../chart'],function (require) { var ComponentBase = require('../component/base'); var ChartBase = require('./base'); @@ -39178,6 +42128,7 @@ define('echarts/chart/map',['require','../component/base','./base','zrender/shap var EllipseShape = require('zrender/shape/Ellipse'); // 组件依赖 require('../component/dataRange'); + require('../component/roamController'); var ecConfig = require('../config'); var ecData = require('../util/ecData'); @@ -39203,21 +42154,26 @@ define('echarts/chart/map',['require','../component/base','./base','zrender/shap ChartBase.call(this); var self = this; - self._onmousewheel = function(param){ - return self.__onmousewheel(param); + self._onmousewheel = function(params) { + return self.__onmousewheel(params); }; - self._onmousedown = function(param){ - return self.__onmousedown(param); + self._onmousedown = function(params) { + return self.__onmousedown(params); }; - self._onmousemove = function(param){ - return self.__onmousemove(param); + self._onmousemove = function(params) { + return self.__onmousemove(params); }; - self._onmouseup = function(param){ - return self.__onmouseup(param); + self._onmouseup = function(params) { + return self.__onmouseup(params); + }; + self._onroamcontroller = function(params) { + return self.__onroamcontroller(params); }; this._isAlive = true; // 活着标记 this._selectedMode = {}; // 选择模式 + this._activeMapType = {}; // 当前活跃的地图类型 + this._clickable = {}; // 悬浮高亮模式,索引到图表 this._hoverable = {}; // 悬浮高亮模式,索引到图表 this._showLegendSymbol = {}; // 显示图例颜色标识 this._selected = {}; // 地图选择状态 @@ -39232,7 +42188,6 @@ define('echarts/chart/map',['require','../component/base','./base','zrender/shap // 漫游相关信息 this._roamMap = {}; this._scaleLimitMap = {}; - this._needRoam; this._mx; this._my; this._mousedown; @@ -39240,10 +42195,10 @@ define('echarts/chart/map',['require','../component/base','./base','zrender/shap this._curMapType; // 当前移动的地图类型 this.refresh(option); - if (this._needRoam) { - this.zr.on(zrConfig.EVENT.MOUSEWHEEL, this._onmousewheel); - this.zr.on(zrConfig.EVENT.MOUSEDOWN, this._onmousedown); - } + + this.zr.on(zrConfig.EVENT.MOUSEWHEEL, this._onmousewheel); + this.zr.on(zrConfig.EVENT.MOUSEDOWN, this._onmousedown); + messageCenter.bind(ecConfig.EVENT.ROAMCONTROLLER, this._onroamcontroller); } Map.prototype = { @@ -39265,7 +42220,6 @@ define('echarts/chart/map',['require','../component/base','./base','zrender/shap var mapSeries = {}; var mapValuePrecision = {}; var valueCalculation = {}; - this._needRoam = false; for (var i = 0, l = series.length; i < l; i++) { if (series[i].type == ecConfig.CHART_TYPE_MAP) { // map series[i] = this.reformOption(series[i]); @@ -39279,7 +42233,6 @@ define('echarts/chart/map',['require','../component/base','./base','zrender/shap && zrUtil.merge(this._scaleLimitMap[mapType], series[i].scaleLimit, true); this._roamMap[mapType] = series[i].roam || this._roamMap[mapType]; - this._needRoam = this._needRoam || this._roamMap[mapType]; this._nameMap[mapType] = this._nameMap[mapType] || {}; series[i].nameMap @@ -39299,14 +42252,18 @@ define('echarts/chart/map',['require','../component/base','./base','zrender/shap this._selectedMode[mapType] = this._selectedMode[mapType] || series[i].selectedMode; - if (typeof this._hoverable[mapType] == 'undefined' - || this._hoverable[mapType] // false 1票否决 - ) { + if (this._hoverable[mapType] == null || this._hoverable[mapType]) { + // false 1票否决 this._hoverable[mapType] = series[i].hoverable; } - if (typeof this._showLegendSymbol[mapType] == 'undefined' - || this._showLegendSymbol[mapType] // false 1票否决 + if (this._clickable[mapType] == null || this._clickable[mapType]) { + // false 1票否决 + this._clickable[mapType] = series[i].clickable; + } + if (this._showLegendSymbol[mapType] == null + || this._showLegendSymbol[mapType] ) { + // false 1票否决 this._showLegendSymbol[mapType] = series[i].showLegendSymbol; } @@ -39330,12 +42287,10 @@ define('echarts/chart/map',['require','../component/base','./base','zrender/shap data[j][key]; } else if (!isNaN(data[j].value)) { - typeof valueData[mapType][name].value - == 'undefined' + valueData[mapType][name].value == null && (valueData[mapType][name].value = 0); - valueData[mapType][name].value += - data[j].value; + valueData[mapType][name].value += data[j].value; } } //索引有该区域的系列样式 @@ -39712,19 +42667,13 @@ define('echarts/chart/map',['require','../component/base','./base','zrender/shap //y = isNaN(cusY) ? padding : cusY; y = this.parsePercent(cusY, zrHeight); y = isNaN(y) ? padding : y; - if (typeof width == 'undefined') { - width = zrWidth - x - 2 * padding; - } - else { - width = this.parsePercent(width, zrWidth); - } - - if (typeof height == 'undefined') { - height = zrHeight - y - 2 * padding; - } - else { - height = this.parsePercent(height, zrHeight); - } + + width = width == null + ? (zrWidth - x - 2 * padding) + : (this.parsePercent(width, zrWidth)); + height = height == null + ? (zrHeight - y - 2 * padding) + : (this.parsePercent(height, zrHeight)); var mapWidth = bbox.width; var mapHeight = bbox.height; @@ -39913,7 +42862,8 @@ define('echarts/chart/map',['require','../component/base','./base','zrender/shap // 文字标签避免覆盖单独一个shape textShape = { zlevel : this._zlevelBase + 1, - hoverable: this._hoverable[mapType], + //hoverable: this._hoverable[mapType], + //clickable: this._clickable[mapType], position : zrUtil.clone(style.position), _mapType : mapType, _geo : this.pos2geo( @@ -39958,14 +42908,15 @@ define('echarts/chart/map',['require','../component/base','./base','zrender/shap shape = { zlevel : this._zlevelBase, - hoverable: this._hoverable[mapType], + //hoverable: this._hoverable[mapType], + //clickable: this._clickable[mapType], position : zrUtil.clone(style.position), style : style, highlightStyle : highlightStyle, _style: zrUtil.clone(style), _mapType: mapType }; - if (typeof style.scale != 'undefined') { + if (style.scale != null) { shape.scale = zrUtil.clone(style.scale); } @@ -39988,7 +42939,9 @@ define('echarts/chart/map',['require','../component/base','./base','zrender/shap break; default : shape = new PathShape(shape); - shape.pathArray = shape._parsePathData(shape.style.path); + if (shape.buildPathArray) { + shape.style.pathArray = shape.buildPathArray(shape.style.path); + } break; } @@ -40000,20 +42953,24 @@ define('echarts/chart/map',['require','../component/base','./base','zrender/shap shape.style = shape.highlightStyle; } + textShape.clickable = shape.clickable = + this._clickable[mapType] + && (data.clickable == null || data.clickable); + if (this._selectedMode[mapType]) { - this._selected[name] = typeof this._selected[name] != 'undefined' + this._selected[name] = this._selected[name] != null ? this._selected[name] : data.selected; this._mapTypeMap[name] = mapType; - if (typeof data.selectable == 'undefined' || data.selectable) { + if (data.selectable == null || data.selectable) { shape.clickable = textShape.clickable = true; shape.onclick = textShape.onclick = this.shapeHandler.onclick; } } if (this._hoverable[mapType] - && (typeof data.hoverable == 'undefined' || data.hoverable) + && (data.hoverable == null || data.hoverable) ) { textShape.hoverable = shape.hoverable = true; shape.hoverConnect = textShape.id; @@ -40060,6 +43017,9 @@ define('echarts/chart/map',['require','../component/base','./base','zrender/shap this._mapDataMap[mapType].transform.left, this._mapDataMap[mapType].transform.top ]; + if (mapType == 'none') { + position = [0, 0]; + } for (var sIdx in mapSeries) { this._seriesIndexToMapType[sIdx] = mapType; this.markAttachStyle[sIdx] = { @@ -40125,9 +43085,10 @@ define('echarts/chart/map',['require','../component/base','./base','zrender/shap var height; for (var mapType in this._mapDataMap) { transform = this._mapDataMap[mapType].transform; - if (!transform || !this._roamMap[mapType]) { + if (!transform || !this._roamMap[mapType] || !this._activeMapType[mapType]) { continue; } + left = transform.left; top = transform.top; width = transform.width; @@ -40146,105 +43107,121 @@ define('echarts/chart/map',['require','../component/base','./base','zrender/shap /** * 滚轮缩放 */ - __onmousewheel : function (param) { + __onmousewheel : function (params) { if (this.shapeList.length <= 0) { return; } - var event = param.event; + + var event = params.event; var mx = zrEvent.getX(event); var my = zrEvent.getY(event); var delta = zrEvent.getDelta(event); //delta = delta > 0 ? (-1) : 1; - var mapType = this._findMapTypeByPos(mx, my); - if (mapType) { - zrEvent.stop(event); - var transform = this._mapDataMap[mapType].transform; - var left = transform.left; - var top = transform.top; - var width = transform.width; - var height = transform.height; - // 位置转经纬度 - var geoAndPos = this.pos2geo(mapType, [mx - left, my - top]); - if (delta > 0) { - delta = 1.2; // 放大 - if (typeof this._scaleLimitMap[mapType].max != 'undefined' - && transform.baseScale >= this._scaleLimitMap[mapType].max - ) { - return; // 缩放限制 - } - } - else { - delta = 1 / 1.2; // 缩小 - if (typeof this._scaleLimitMap[mapType].min != 'undefined' - && transform.baseScale <= this._scaleLimitMap[mapType].min - ) { - return; // 缩放限制 - } - } - transform.baseScale *= delta; - transform.scale.x *= delta; - transform.scale.y *= delta; - transform.width = width * delta; - transform.height = height * delta; - - this._mapDataMap[mapType].hasRoam = true; - this._mapDataMap[mapType].transform = transform; - // 经纬度转位置 - geoAndPos = this.geo2pos(mapType, geoAndPos); - // 保持视觉中心 - transform.left -= geoAndPos[0] - (mx - left); - transform.top -= geoAndPos[1] - (my - top); - this._mapDataMap[mapType].transform = transform; - - this.clearEffectShape(true); - for (var i = 0, l = this.shapeList.length; i < l; i++) { - if(this.shapeList[i]._mapType == mapType) { - this.shapeList[i].position[0] = transform.left; - this.shapeList[i].position[1] = transform.top; - if (this.shapeList[i].type == 'path' - || this.shapeList[i].type == 'symbol' - || this.shapeList[i].type == 'circle' - || this.shapeList[i].type == 'rectangle' - || this.shapeList[i].type == 'polygon' - || this.shapeList[i].type == 'line' - || this.shapeList[i].type == 'ellipse' + var mapType; + var mapTypeControl = params.mapTypeControl; + if (!mapTypeControl) { + mapTypeControl = {}; + mapType = this._findMapTypeByPos(mx, my); + if (mapType && this._roamMap[mapType] && this._roamMap[mapType] != 'move') { + mapTypeControl[mapType] = true; + } + } + + var haveScale = false; + for (mapType in mapTypeControl) { + if (mapTypeControl[mapType]) { + haveScale = true; + var transform = this._mapDataMap[mapType].transform; + var left = transform.left; + var top = transform.top; + var width = transform.width; + var height = transform.height; + // 位置转经纬度 + var geoAndPos = this.pos2geo(mapType, [mx - left, my - top]); + if (delta > 0) { + delta = 1.2; // 放大 + if (this._scaleLimitMap[mapType].max != null + && transform.baseScale >= this._scaleLimitMap[mapType].max ) { - this.shapeList[i].scale[0] *= delta; - this.shapeList[i].scale[1] *= delta; - } - else if (this.shapeList[i].type == 'mark-line') { - this.shapeList[i].style.pointListLength = undefined; - this.shapeList[i].style.pointList = false; - geoAndPos = this.geo2pos(mapType, this.shapeList[i]._geo[0]); - this.shapeList[i].style.xStart = geoAndPos[0]; - this.shapeList[i].style.yStart = geoAndPos[1]; - geoAndPos = this.geo2pos(mapType, this.shapeList[i]._geo[1]); - this.shapeList[i]._x = this.shapeList[i].style.xEnd = geoAndPos[0]; - this.shapeList[i]._y = this.shapeList[i].style.yEnd = geoAndPos[1]; + return; // 缩放限制 } - else if (this.shapeList[i].type == 'icon') { - geoAndPos = this.geo2pos(mapType, this.shapeList[i]._geo); - this.shapeList[i].style.x = this.shapeList[i].style._x = - geoAndPos[0] - this.shapeList[i].style.width / 2; - this.shapeList[i].style.y = this.shapeList[i].style._y = - geoAndPos[1] - this.shapeList[i].style.height / 2; + } + else { + delta = 1 / 1.2; // 缩小 + if (this._scaleLimitMap[mapType].min != null + && transform.baseScale <= this._scaleLimitMap[mapType].min + ) { + return; // 缩放限制 } - else { - geoAndPos = this.geo2pos(mapType, this.shapeList[i]._geo); - this.shapeList[i].style.x = geoAndPos[0]; - this.shapeList[i].style.y = geoAndPos[1]; - if (this.shapeList[i].type == 'text') { - this.shapeList[i]._style.x = this.shapeList[i].highlightStyle.x - = geoAndPos[0]; - this.shapeList[i]._style.y = this.shapeList[i].highlightStyle.y - = geoAndPos[1]; + } + + transform.baseScale *= delta; + transform.scale.x *= delta; + transform.scale.y *= delta; + transform.width = width * delta; + transform.height = height * delta; + + this._mapDataMap[mapType].hasRoam = true; + this._mapDataMap[mapType].transform = transform; + // 经纬度转位置 + geoAndPos = this.geo2pos(mapType, geoAndPos); + // 保持视觉中心 + transform.left -= geoAndPos[0] - (mx - left); + transform.top -= geoAndPos[1] - (my - top); + this._mapDataMap[mapType].transform = transform; + + this.clearEffectShape(true); + for (var i = 0, l = this.shapeList.length; i < l; i++) { + if(this.shapeList[i]._mapType == mapType) { + this.shapeList[i].position[0] = transform.left; + this.shapeList[i].position[1] = transform.top; + if (this.shapeList[i].type == 'path' + || this.shapeList[i].type == 'symbol' + || this.shapeList[i].type == 'circle' + || this.shapeList[i].type == 'rectangle' + || this.shapeList[i].type == 'polygon' + || this.shapeList[i].type == 'line' + || this.shapeList[i].type == 'ellipse' + ) { + this.shapeList[i].scale[0] *= delta; + this.shapeList[i].scale[1] *= delta; + } + else if (this.shapeList[i].type == 'mark-line') { + this.shapeList[i].style.pointListLength = undefined; + this.shapeList[i].style.pointList = false; + geoAndPos = this.geo2pos(mapType, this.shapeList[i]._geo[0]); + this.shapeList[i].style.xStart = geoAndPos[0]; + this.shapeList[i].style.yStart = geoAndPos[1]; + geoAndPos = this.geo2pos(mapType, this.shapeList[i]._geo[1]); + this.shapeList[i]._x = this.shapeList[i].style.xEnd = geoAndPos[0]; + this.shapeList[i]._y = this.shapeList[i].style.yEnd = geoAndPos[1]; + } + else if (this.shapeList[i].type == 'icon') { + geoAndPos = this.geo2pos(mapType, this.shapeList[i]._geo); + this.shapeList[i].style.x = this.shapeList[i].style._x = + geoAndPos[0] - this.shapeList[i].style.width / 2; + this.shapeList[i].style.y = this.shapeList[i].style._y = + geoAndPos[1] - this.shapeList[i].style.height / 2; } + else { + geoAndPos = this.geo2pos(mapType, this.shapeList[i]._geo); + this.shapeList[i].style.x = geoAndPos[0]; + this.shapeList[i].style.y = geoAndPos[1]; + if (this.shapeList[i].type == 'text') { + this.shapeList[i]._style.x = this.shapeList[i].highlightStyle.x + = geoAndPos[0]; + this.shapeList[i]._style.y = this.shapeList[i].highlightStyle.y + = geoAndPos[1]; + } + } + + this.zr.modShape(this.shapeList[i].id); } - - this.zr.modShape(this.shapeList[i].id); } } - + } + if (haveScale) { + zrEvent.stop(event); this.zr.refresh(); var self = this; @@ -40258,31 +43235,30 @@ define('echarts/chart/map',['require','../component/base','./base','zrender/shap this.messageCenter.dispatch( ecConfig.EVENT.MAP_ROAM, - param.event, + params.event, {type : 'scale'}, this.myChart ); } }, - __onmousedown : function (param) { + __onmousedown : function (params) { if (this.shapeList.length <= 0) { return; } - var target = param.target; + var target = params.target; if (target && target.draggable) { return; } - var event = param.event; + var event = params.event; var mx = zrEvent.getX(event); var my = zrEvent.getY(event); var mapType = this._findMapTypeByPos(mx, my); - if (mapType) { + if (mapType && this._roamMap[mapType] && this._roamMap[mapType] != 'scale') { this._mousedown = true; this._mx = mx; this._my = my; this._curMapType = mapType; - this.zr.on(zrConfig.EVENT.MOUSEUP, this._onmouseup); var self = this; setTimeout(function (){ @@ -40292,11 +43268,11 @@ define('echarts/chart/map',['require','../component/base','./base','zrender/shap }, - __onmousemove : function (param) { + __onmousemove : function (params) { if (!this._mousedown || !this._isAlive) { return; } - var event = param.event; + var event = params.event; var mx = zrEvent.getX(event); var my = zrEvent.getY(event); var transform = this._mapDataMap[this._curMapType].transform; @@ -40317,7 +43293,7 @@ define('echarts/chart/map',['require','../component/base','./base','zrender/shap this.messageCenter.dispatch( ecConfig.EVENT.MAP_ROAM, - param.event, + params.event, {type : 'move'}, this.myChart ); @@ -40329,8 +43305,8 @@ define('echarts/chart/map',['require','../component/base','./base','zrender/shap zrEvent.stop(event); }, - __onmouseup : function (param) { - var event = param.event; + __onmouseup : function (params) { + var event = params.event; this._mx = zrEvent.getX(event); this._my = zrEvent.getY(event); this._mousedown = false; @@ -40343,17 +43319,95 @@ define('echarts/chart/map',['require','../component/base','./base','zrender/shap },120); }, + __onroamcontroller: function(params) { + var event = params.event; + event.zrenderX = this.zr.getWidth() / 2; + event.zrenderY = this.zr.getHeight() / 2; + var mapTypeControl = params.mapTypeControl; + var top = 0; + var left = 0; + var step = params.step; + + switch(params.roamType) { + case 'scaleUp': + event.zrenderDelta = 1; + this.__onmousewheel({ + event: event, + mapTypeControl: mapTypeControl + }); + return; + case 'scaleDown': + event.zrenderDelta = -1; + this.__onmousewheel({ + event: event, + mapTypeControl: mapTypeControl + }); + return; + case 'up': + top = -step; + break; + case 'down': + top = step; + break; + case 'left': + left = -step; + break; + case 'right': + left = step; + break; + } + + var transform; + var curMapType; + for (curMapType in mapTypeControl) { + if (!this._mapDataMap[curMapType] || !this._activeMapType[curMapType]) { + continue; + } + transform = this._mapDataMap[curMapType].transform; + transform.hasRoam = true; + transform.left -= left; + transform.top -= top; + this._mapDataMap[curMapType].transform = transform; + } + for (var i = 0, l = this.shapeList.length; i < l; i++) { + curMapType = this.shapeList[i]._mapType; + if (!mapTypeControl[curMapType] || !this._activeMapType[curMapType]) { + continue; + } + transform = this._mapDataMap[curMapType].transform; + this.shapeList[i].position[0] = transform.left; + this.shapeList[i].position[1] = transform.top; + this.zr.modShape(this.shapeList[i].id); + } + + this.messageCenter.dispatch( + ecConfig.EVENT.MAP_ROAM, + params.event, + {type : 'move'}, + this.myChart + ); + + this.clearEffectShape(true); + this.zr.refresh(); + + clearTimeout(this.dircetionTimer); + var self = this; + this.dircetionTimer = setTimeout(function() { + self.animationEffect(); + }, 150); + }, + /** * 点击响应 */ - onclick : function (param) { - if (!this.isClick || !param.target || this._justMove || param.target.type == 'icon') { + onclick : function (params) { + if (!this.isClick || !params.target || this._justMove || params.target.type == 'icon') { // 没有在当前实例上发生点击直接返回 return; } this.isClick = false; - var target = param.target; + var target = params.target; var name = target.style._name; var len = this.shapeList.length; var mapType = target._mapType || ''; @@ -40394,7 +43448,7 @@ define('echarts/chart/map',['require','../component/base','./base','zrender/shap } this.messageCenter.dispatch( ecConfig.EVENT.MAP_SELECTED, - param.event, + params.event, { selected : this._selected, target : name @@ -40407,7 +43461,7 @@ define('echarts/chart/map',['require','../component/base','./base','zrender/shap setTimeout(function(){ self.zr.trigger( zrConfig.EVENT.MOUSEMOVE, - param.event + params.event ); },100); }, @@ -40541,10 +43595,11 @@ define('echarts/chart/map',['require','../component/base','./base','zrender/shap this.shapeList = null; this.effectList = null; this._isAlive = false; - if (this._needRoam) { - this.zr.un(zrConfig.EVENT.MOUSEWHEEL, this._onmousewheel); - this.zr.un(zrConfig.EVENT.MOUSEDOWN, this._onmousedown); - } + this.zr.un(zrConfig.EVENT.MOUSEWHEEL, this._onmousewheel); + this.zr.un(zrConfig.EVENT.MOUSEDOWN, this._onmousedown); + this.messageCenter.unbind( + ecConfig.EVENT.ROAMCONTROLLER, this._onroamcontroller + ); } }; @@ -40734,7 +43789,7 @@ define('echarts/util/shape/HalfSmoothPolygon',['require','zrender/shape/Base','z } if (style.smooth) { var controlPoints = smoothBezier( - pointList.slice(0, -2), style.smooth + pointList.slice(0, -2), style.smooth, false, style.smoothConstraint ); ctx.moveTo(pointList[0][0], pointList[0][1]); @@ -40809,11 +43864,11 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha } Line.prototype = { - type : ecConfig.CHART_TYPE_LINE, + type: ecConfig.CHART_TYPE_LINE, /** * 绘制图形 */ - _buildShape : function () { + _buildShape: function () { var series = this.series; this.finalPLMap = {}; // 完成的point list(PL) this._sIndex2ColorMap = {}; // series默认颜色索引,seriesIndex索引到color @@ -40825,27 +43880,27 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha // 水平垂直双向series索引 ,position索引到seriesIndex var _position2sIndexMap = { - top : [], - bottom : [], - left : [], - right : [] + top: [ ], + bottom: [ ], + left: [ ], + right: [ ] }; var xAxisIndex; var yAxisIndex; var xAxis; var yAxis; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type == this.type) { + if (series[i].type === this.type) { series[i] = this.reformOption(series[i]); xAxisIndex = series[i].xAxisIndex; yAxisIndex = series[i].yAxisIndex; xAxis = this.component.xAxis.getAxis(xAxisIndex); yAxis = this.component.yAxis.getAxis(yAxisIndex); - if (xAxis.type == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + if (xAxis.type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY ) { _position2sIndexMap[xAxis.getPosition()].push(i); } - else if (yAxis.type == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + else if (yAxis.type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY ) { _position2sIndexMap[yAxis.getPosition()].push(i); } @@ -40867,7 +43922,7 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha * * @param {number} seriesIndex 系列索引 */ - _buildSinglePosition : function (position, seriesArray) { + _buildSinglePosition: function (position, seriesArray) { var mapData = this._mapData(seriesArray); var locationMap = mapData.locationMap; var maxDataLength = mapData.maxDataLength; @@ -40895,7 +43950,7 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha * 数据整形 * 数组位置映射到系列索引 */ - _mapData : function (seriesArray) { + _mapData: function (seriesArray) { var series = this.series; var serie; // 临时映射变量 var dataIndex = 0; // 堆积数据所在位置映射 @@ -40940,7 +43995,7 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha if (this.selectedMap[serieName]) { stackKey = serie.stack || (magicStackKey + seriesArray[i]); - if (typeof stackMap[stackKey] == 'undefined') { + if (stackMap[stackKey] == null) { stackMap[stackKey] = dataIndex; locationMap[dataIndex] = [seriesArray[i]]; dataIndex++; @@ -40973,15 +44028,15 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha */ return { - locationMap : locationMap, - maxDataLength : maxDataLength + locationMap: locationMap, + maxDataLength: maxDataLength }; }, /** * 构建类目轴为水平方向的折线图系列 */ - _buildHorizontal : function (seriesArray, maxDataLength, locationMap, xMarkMap) { + _buildHorizontal: function (seriesArray, maxDataLength, locationMap, xMarkMap) { var series = this.series; // 确定类目轴和数值轴,同一方向随便找一个即可 var seriesIndex = locationMap[0][0]; @@ -41002,7 +44057,7 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha var data; var value; for (var i = 0, l = maxDataLength; i < l; i++) { - if (typeof categoryAxis.getNameByIndex(i) == 'undefined') { + if (categoryAxis.getNameByIndex(i) == null) { // 系列数据超出类目轴长度 break; } @@ -41016,21 +44071,21 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha seriesIndex = locationMap[j][m]; serie = series[seriesIndex]; data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' + value = data != null + ? (data.value != null ? data.value : data) : '-'; curPLMap[seriesIndex] = curPLMap[seriesIndex] || []; xMarkMap[seriesIndex] = xMarkMap[seriesIndex] || { - min : Number.POSITIVE_INFINITY, - max : Number.NEGATIVE_INFINITY, - sum : 0, - counter : 0, - average : 0 + min: Number.POSITIVE_INFINITY, + max: Number.NEGATIVE_INFINITY, + sum: 0, + counter: 0, + average: 0 }; - if (value == '-') { + if (value === '-') { // 空数据则把正在记录的curPLMap添加到finalPLMap中 if (curPLMap[seriesIndex].length > 0) { this.finalPLMap[seriesIndex] = @@ -41085,8 +44140,8 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha seriesIndex = locationMap[j][m]; serie = series[seriesIndex]; data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' + value = data != null + ? (data.value != null ? data.value : data) : '-'; @@ -41154,7 +44209,7 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha /** * 构建类目轴为垂直方向的折线图系列 */ - _buildVertical : function (seriesArray, maxDataLength, locationMap, xMarkMap) { + _buildVertical: function (seriesArray, maxDataLength, locationMap, xMarkMap) { var series = this.series; // 确定类目轴和数值轴,同一方向随便找一个即可 var seriesIndex = locationMap[0][0]; @@ -41175,7 +44230,7 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha var data; var value; for (var i = 0, l = maxDataLength; i < l; i++) { - if (typeof categoryAxis.getNameByIndex(i) == 'undefined') { + if (categoryAxis.getNameByIndex(i) == null) { // 系列数据超出类目轴长度 break; } @@ -41189,21 +44244,21 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha seriesIndex = locationMap[j][m]; serie = series[seriesIndex]; data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' + value = data != null + ? (data.value != null ? data.value : data) : '-'; curPLMap[seriesIndex] = curPLMap[seriesIndex] || []; xMarkMap[seriesIndex] = xMarkMap[seriesIndex] || { - min : Number.POSITIVE_INFINITY, - max : Number.NEGATIVE_INFINITY, - sum : 0, - counter : 0, - average : 0 + min: Number.POSITIVE_INFINITY, + max: Number.NEGATIVE_INFINITY, + sum: 0, + counter: 0, + average: 0 }; - if (value == '-') { + if (value === '-') { // 空数据则把正在记录的curPLMap添加到finalPLMap中 if (curPLMap[seriesIndex].length > 0) { this.finalPLMap[seriesIndex] = @@ -41258,8 +44313,8 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha seriesIndex = locationMap[j][m]; serie = series[seriesIndex]; data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' + value = data != null + ? (data.value != null ? data.value : data) : '-'; @@ -41328,62 +44383,42 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha /** * 生成折线和折线上的拐点 */ - _buildBorkenLine : function (seriesArray, pointList, categoryAxis, orient) { + _buildBorkenLine: function (seriesArray, pointList, categoryAxis, orient) { var series = this.series; - var defaultColor; - - // 折线相关 - var lineWidth; - var lineType; - var lineColor; - var normalColor; - - // 填充相关 - var isFill; - var fillNormalColor; - var serie; var data; - var seriesPL; - var singlePL; - var brokenLineShape; - var halfSmoothPolygonShape; - - var isLarge; // 堆积层叠需求,反顺序构建 - var seriesIndex; for (var sIdx = seriesArray.length - 1; sIdx >= 0; sIdx--) { - seriesIndex = seriesArray[sIdx]; - serie = series[seriesIndex]; - seriesPL = pointList[seriesIndex]; - if (serie.type == this.type && typeof seriesPL != 'undefined') { - defaultColor = this._sIndex2ColorMap[seriesIndex]; - // 多级控制 - lineWidth = this.query( + var seriesIndex = seriesArray[sIdx]; + var serie = series[seriesIndex]; + var seriesPL = pointList[seriesIndex]; + if (serie.type === this.type && seriesPL != null) { + var bbox = this._getBbox(seriesIndex, orient); + var defaultColor = this._sIndex2ColorMap[seriesIndex]; + // 折线相关,多级控制 + var lineWidth = this.query( serie, 'itemStyle.normal.lineStyle.width' ); - lineType = this.query( + var lineType = this.query( serie, 'itemStyle.normal.lineStyle.type' ); - lineColor = this.query( + var lineColor = this.query( serie, 'itemStyle.normal.lineStyle.color' ); - normalColor = this.getItemStyleColor( + var normalColor = this.getItemStyleColor( this.query(serie, 'itemStyle.normal.color'), seriesIndex, -1 ); - isFill = typeof this.query( - serie, 'itemStyle.normal.areaStyle' - ) != 'undefined'; - - fillNormalColor = this.query( + // 填充相关 + var isFill = this.query(serie, 'itemStyle.normal.areaStyle') != null; + var fillNormalColor = this.query( serie, 'itemStyle.normal.areaStyle.color' ); for (var i = 0, l = seriesPL.length; i < l; i++) { - singlePL = seriesPL[i]; - isLarge = this._isLarge(orient, singlePL); + var singlePL = seriesPL[i]; + var isLarge = this._isLarge(orient, singlePL); if (!isLarge) { // 非大数据模式才显示拐点symbol for (var j = 0, k = singlePL.length; j < k; j++) { data = serie.data[singlePL[j][2]]; @@ -41417,18 +44452,19 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha } // 折线图 - brokenLineShape = new BrokenLineShape({ - zlevel : this._zlevelBase, - style : { + var brokenLineShape = new BrokenLineShape({ + zlevel: this._zlevelBase, + style: { miterLimit: lineWidth, - pointList : singlePL, - strokeColor : lineColor - || normalColor - || defaultColor, - lineWidth : lineWidth, - lineType : lineType, - smooth : this._getSmooth(serie.smooth), - shadowColor : this.query( + pointList: singlePL, + strokeColor: lineColor + || normalColor + || defaultColor, + lineWidth: lineWidth, + lineType: lineType, + smooth: this._getSmooth(serie.smooth), + smoothConstraint: bbox, + shadowColor: this.query( serie, 'itemStyle.normal.lineStyle.shadowColor' ), @@ -41445,10 +44481,10 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha 'itemStyle.normal.lineStyle.shadowOffsetY' ) }, - hoverable : false, - _main : true, - _seriesIndex : seriesIndex, - _orient : orient + hoverable: false, + _main: true, + _seriesIndex: seriesIndex, + _orient: orient }); ecData.pack( @@ -41460,11 +44496,11 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha this.shapeList.push(brokenLineShape); if (isFill) { - halfSmoothPolygonShape = new HalfSmoothPolygonShape({ - zlevel : this._zlevelBase, - style : { + var halfSmoothPolygonShape = new HalfSmoothPolygonShape({ + zlevel: this._zlevelBase, + style: { miterLimit: lineWidth, - pointList : zrUtil.clone(singlePL).concat([ + pointList: zrUtil.clone(singlePL).concat([ [ singlePL[singlePL.length - 1][4], singlePL[singlePL.length - 1][5] @@ -41474,16 +44510,17 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha singlePL[0][5] ] ]), - brushType : 'fill', - smooth : this._getSmooth(serie.smooth), - color : fillNormalColor - ? fillNormalColor - : zrColor.alpha(defaultColor,0.5) + brushType: 'fill', + smooth: this._getSmooth(serie.smooth), + smoothConstraint: bbox, + color: fillNormalColor + ? fillNormalColor + : zrColor.alpha(defaultColor,0.5) }, - hoverable : false, - _main : true, - _seriesIndex : seriesIndex, - _orient : orient + hoverable: false, + _main: true, + _seriesIndex: seriesIndex, + _orient: orient }); ecData.pack( halfSmoothPolygonShape, @@ -41497,12 +44534,26 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha } }, - _isLarge : function(orient, singlePL) { + _getBbox: function(seriesIndex, orient) { + var bbox = this.component.grid.getBbox(); + var xMarkMap = this.xMarkMap[seriesIndex]; + if (orient === 'horizontal') { + bbox[0][1] = Math.min(xMarkMap.minY, xMarkMap.maxY); + bbox[1][1] = Math.max(xMarkMap.minY, xMarkMap.maxY); + } + else { + bbox[0][0] = Math.min(xMarkMap.minX, xMarkMap.maxX); + bbox[1][0] = Math.max(xMarkMap.minX, xMarkMap.maxX); + } + return bbox; + }, + + _isLarge: function(orient, singlePL) { if (singlePL.length < 2) { return false; } else { - return orient == 'horizontal' + return orient === 'horizontal' ? (Math.abs(singlePL[0][0] - singlePL[1][0]) < 0.5) : (Math.abs(singlePL[0][1] - singlePL[1][1]) < 0.5); } @@ -41511,9 +44562,9 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha /** * 大规模pointList优化 */ - _getLargePointList : function(orient, singlePL) { + _getLargePointList: function(orient, singlePL) { var total; - if (orient == 'horizontal') { + if (orient === 'horizontal') { total = this.component.grid.getWidth(); } else { @@ -41528,11 +44579,11 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha return newList; }, - _getSmooth : function (isSmooth/*, pointList, orient*/) { + _getSmooth: function (isSmooth/*, pointList, orient*/) { if (isSmooth) { /* 不科学啊,发现0.3通用了 var delta; - if (orient == 'horizontal') { + if (orient === 'horizontal') { delta = Math.abs(pointList[0][0] - pointList[1][0]); } else { @@ -41549,7 +44600,7 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha /** * 生成空数据所需的可计算提示图形 */ - _getCalculableItem : function (seriesIndex, dataIndex, name, x, y, orient) { + _getCalculableItem: function (seriesIndex, dataIndex, name, x, y, orient) { var series = this.series; var color = series[seriesIndex].calculableHolderColor || this.ecTheme.calculableHolderColor; @@ -41571,7 +44622,7 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha /** * 生成折线图上的拐点图形 */ - _getSymbol : function (seriesIndex, dataIndex, name, x, y, orient) { + _getSymbol: function (seriesIndex, dataIndex, name, x, y, orient) { var series = this.series; var serie = series[seriesIndex]; var data = serie.data[dataIndex]; @@ -41582,7 +44633,7 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha this._sIndex2ShapeMap[seriesIndex], this._sIndex2ColorMap[seriesIndex], '#fff', - orient == 'vertical' ? 'horizontal' : 'vertical' // 翻转 + orient === 'vertical' ? 'horizontal' : 'vertical' // 翻转 ); itemShape.zlevel = this._zlevelBase + 1; @@ -41595,14 +44646,14 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha }, // 位置转换 - getMarkCoord : function (seriesIndex, mpData) { + getMarkCoord: function (seriesIndex, mpData) { var serie = this.series[seriesIndex]; var xMarkMap = this.xMarkMap[seriesIndex]; var xAxis = this.component.xAxis.getAxis(serie.xAxisIndex); var yAxis = this.component.yAxis.getAxis(serie.yAxisIndex); if (mpData.type - && (mpData.type == 'max' || mpData.type == 'min' || mpData.type == 'average') + && (mpData.type === 'max' || mpData.type === 'min' || mpData.type === 'average') ) { // 特殊值内置支持 return [ @@ -41627,7 +44678,7 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha /** * 刷新 */ - refresh : function (newOption) { + refresh: function (newOption) { if (newOption) { this.option = newOption; this.series = newOption.series; @@ -41637,7 +44688,7 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha this._buildShape(); }, - ontooltipHover : function (param, tipShape) { + ontooltipHover: function (param, tipShape) { var seriesIndex = param.seriesIndex; var dataIndex = param.dataIndex; var seriesPL; @@ -41649,7 +44700,7 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha for (var i = 0, l = seriesPL.length; i < l; i++) { singlePL = seriesPL[i]; for (var j = 0, k = singlePL.length; j < k; j++) { - if (dataIndex == singlePL[j][2]) { + if (dataIndex === singlePL[j][2]) { tipShape.push(this._getSymbol( seriesIndex[len], // seriesIndex singlePL[j][2], // dataIndex @@ -41668,7 +44719,7 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha /** * 动态数据增加动画 */ - addDataAnimation : function (params) { + addDataAnimation: function (params) { var series = this.series; var aniMap = {}; // seriesIndex索引参数 for (var i = 0, l = params.length; i < l; i++) { @@ -41691,11 +44742,11 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha dx = Math.abs(pointList[0][0] - pointList[1][0]); dy = Math.abs(pointList[0][1] - pointList[1][1]); isHorizontal = - this.shapeList[i]._orient == 'horizontal'; + this.shapeList[i]._orient === 'horizontal'; if (aniMap[seriesIndex][2]) { // 队头加入删除末尾 - if (this.shapeList[i].type == 'polygon') { + if (this.shapeList[i].type === 'polygon') { //区域图 var len = pointList.length; this.shapeList[i].style.pointList[len - 3] @@ -41717,7 +44768,7 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha else { // 队尾加入删除头部 this.shapeList[i].style.pointList.shift(); - if (this.shapeList[i].type == 'polygon') { + if (this.shapeList[i].type === 'polygon') { //区域图 var targetPoint = this.shapeList[i].style.pointList.pop(); @@ -41734,7 +44785,7 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha this.zr.modShape( this.shapeList[i].id, { - style : { + style: { pointList: this.shapeList[i].style.pointList } }, @@ -41745,7 +44796,7 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha // 拐点动画 if (aniMap[seriesIndex][2] && this.shapeList[i]._dataIndex - == series[seriesIndex].data.length - 1 + === series[seriesIndex].data.length - 1 ) { // 队头加入删除末尾 this.zr.delShape(this.shapeList[i].id); @@ -41763,7 +44814,7 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha this.zr.animate(this.shapeList[i].id, '') .when( 500, - {position : [x, y]} + { position: [ x, y ] } ) .start(); } @@ -41790,7 +44841,7 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha y -= 1; symbol = 'star'; } - else if (symbol == 'rectangle' || symbol == 'arrow') { + else if (symbol === 'rectangle' || symbol === 'arrow') { x += (width - height) / 2; width = height; } @@ -41815,12 +44866,12 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha ctx.lineTo(x2 + style.width, y2 + dy); symbol(ctx, { - x : x + 4, - y : y + 4, - width : width - 8, - height : height - 8, - n : dy, - image : imageLocation + x: x + 4, + y: y + 4, + width: width - 8, + height: height - 8, + n: dy, + image: imageLocation }); } @@ -41879,11 +44930,11 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap } Bar.prototype = { - type : ecConfig.CHART_TYPE_BAR, + type: ecConfig.CHART_TYPE_BAR, /** * 绘制图形 */ - _buildShape : function () { + _buildShape: function () { var series = this.series; this.selectedMap = {}; this.xMarkMap = {}; @@ -41893,27 +44944,27 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap // 水平垂直双向series索引 ,position索引到seriesIndex var _position2sIndexMap = { - top : [], - bottom : [], - left : [], - right : [] + top: [ ], + bottom: [ ], + left: [ ], + right: [ ] }; var xAxisIndex; var yAxisIndex; var xAxis; var yAxis; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type == ecConfig.CHART_TYPE_BAR) { + if (series[i].type === ecConfig.CHART_TYPE_BAR) { series[i] = this.reformOption(series[i]); xAxisIndex = series[i].xAxisIndex; yAxisIndex = series[i].yAxisIndex; xAxis = this.component.xAxis.getAxis(xAxisIndex); yAxis = this.component.yAxis.getAxis(yAxisIndex); - if (xAxis.type == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + if (xAxis.type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY ) { _position2sIndexMap[xAxis.getPosition()].push(i); } - else if (yAxis.type == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + else if (yAxis.type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY ) { _position2sIndexMap[yAxis.getPosition()].push(i); } @@ -41936,7 +44987,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap * * @param {number} seriesIndex 系列索引 */ - _buildSinglePosition : function (position, seriesArray, xMarkMap) { + _buildSinglePosition: function (position, seriesArray, xMarkMap) { var mapData = this._mapData(seriesArray); var locationMap = mapData.locationMap; var maxDataLength = mapData.maxDataLength; @@ -41961,7 +45012,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap * 数据整形 * 数组位置映射到系列索引 */ - _mapData : function (seriesArray) { + _mapData: function (seriesArray) { var series = this.series; var serie; // 临时映射变量 var dataIndex = 0; // 堆积数据所在位置映射 @@ -41970,7 +45021,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap var stackKey; // 临时映射变量 var serieName; // 临时映射变量 var legend = this.component.legend; - var locationMap = []; // 需要返回的东西:数组位置映射到系列索引 + var locationMap = [ ]; // 需要返回的东西:数组位置映射到系列索引 var maxDataLength = 0; // 需要返回的东西:最大数据长度 var iconShape; // 计算需要显示的个数和分配位置并记在下面这个结构里 @@ -41985,14 +45036,14 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap iconShape = legend.getItemShape(serieName); if (iconShape) { // 回调legend,换一个更形象的icon - if (serie.itemStyle.normal.borderWidth > 0) { + if (serie.itemStyle.normal.barBorderWidth > 0) { iconShape.style.x += 1; iconShape.style.y += 1; iconShape.style.width -= 2; iconShape.style.height -= 2; iconShape.style.strokeColor = iconShape.highlightStyle.strokeColor = - serie.itemStyle.normal.borderColor; + serie.itemStyle.normal.barBorderColor; iconShape.highlightStyle.lineWidth = 3; iconShape.style.brushType = 'both'; } @@ -42006,7 +45057,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap if (this.selectedMap[serieName]) { stackKey = serie.stack || (magicStackKey + seriesArray[i]); - if (typeof stackMap[stackKey] == 'undefined') { + if (stackMap[stackKey] == null) { stackMap[stackKey] = dataIndex; locationMap[dataIndex] = [seriesArray[i]]; dataIndex++; @@ -42040,15 +45091,15 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap */ return { - locationMap : locationMap, - maxDataLength : maxDataLength + locationMap: locationMap, + maxDataLength: maxDataLength }; }, /** * 构建类目轴为水平方向的柱形图系列 */ - _buildHorizontal : function (maxDataLength, locationMap, seriesArray, xMarkMap) { + _buildHorizontal: function (maxDataLength, locationMap, seriesArray, xMarkMap) { var series = this.series; // 确定类目轴和数值轴,同一方向随便找一个即可 var seriesIndex = locationMap[0][0]; @@ -42077,7 +45128,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap var data; var value; for (var i = 0, l = maxDataLength; i < l; i++) { - if (typeof categoryAxis.getNameByIndex(i) == 'undefined') { + if (categoryAxis.getNameByIndex(i) == null) { // 系列数据超出类目轴长度 break; } @@ -42091,20 +45142,20 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap seriesIndex = locationMap[j][m]; serie = series[seriesIndex]; data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' + value = data != null + ? (data.value != null ? data.value : data) : '-'; xMarkMap[seriesIndex] = xMarkMap[seriesIndex] || { - min : Number.POSITIVE_INFINITY, - max : Number.NEGATIVE_INFINITY, - sum : 0, - counter : 0, - average : 0 + min: Number.POSITIVE_INFINITY, + max: Number.NEGATIVE_INFINITY, + sum: 0, + counter: 0, + average: 0 }; - if (value == '-') { + if (value === '-') { // 空数据在做完后补充拖拽提示框 continue; } @@ -42116,7 +45167,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap ? valueAxis.getCoordSize(value) : (baseYP - valueAxis.getCoord(value)); // 非堆积数据最小高度有效 - if (n == 1 + if (n === 1 && barMinHeightMap[seriesIndex] > barHeight ) { barHeight = barMinHeightMap[seriesIndex]; @@ -42131,7 +45182,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap ? valueAxis.getCoordSize(value) : (valueAxis.getCoord(value) - baseYN); // 非堆积数据最小高度有效 - if (n == 1 + if (n === 1 && barMinHeightMap[seriesIndex] > barHeight ) { barHeight = barMinHeightMap[seriesIndex]; @@ -42179,8 +45230,8 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap seriesIndex = locationMap[j][m]; serie = series[seriesIndex]; data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' + value = data != null + ? (data.value != null ? data.value : data) : '-'; @@ -42254,7 +45305,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap /** * 构建类目轴为垂直方向的柱形图系列 */ - _buildVertical : function (maxDataLength, locationMap, seriesArray, xMarkMap) { + _buildVertical: function (maxDataLength, locationMap, seriesArray, xMarkMap) { var series = this.series; // 确定类目轴和数值轴,同一方向随便找一个即可 var seriesIndex = locationMap[0][0]; @@ -42283,7 +45334,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap var data; var value; for (var i = 0, l = maxDataLength; i < l; i++) { - if (typeof categoryAxis.getNameByIndex(i) == 'undefined') { + if (categoryAxis.getNameByIndex(i) == null) { // 系列数据超出类目轴长度 break; } @@ -42297,20 +45348,20 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap seriesIndex = locationMap[j][m]; serie = series[seriesIndex]; data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' + value = data != null + ? (data.value != null ? data.value : data) : '-'; xMarkMap[seriesIndex] = xMarkMap[seriesIndex] || { - min : Number.POSITIVE_INFINITY, - max : Number.NEGATIVE_INFINITY, - sum : 0, - counter : 0, - average : 0 + min: Number.POSITIVE_INFINITY, + max: Number.NEGATIVE_INFINITY, + sum: 0, + counter: 0, + average: 0 }; - if (value == '-') { + if (value === '-') { // 空数据在做完后补充拖拽提示框 continue; } @@ -42322,7 +45373,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap ? valueAxis.getCoordSize(value) : (valueAxis.getCoord(value) - baseXP); // 非堆积数据最小高度有效 - if (n == 1 + if (n === 1 && barMinHeightMap[seriesIndex] > barHeight ) { barHeight = barMinHeightMap[seriesIndex]; @@ -42337,7 +45388,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap ? valueAxis.getCoordSize(value) : (baseXN - valueAxis.getCoord(value)); // 非堆积数据最小高度有效 - if (n == 1 + if (n === 1 && barMinHeightMap[seriesIndex] > barHeight ) { barHeight = barMinHeightMap[seriesIndex]; @@ -42386,8 +45437,8 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap seriesIndex = locationMap[j][m]; serie = series[seriesIndex]; data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' + value = data != null + ? (data.value != null ? data.value : data) : '-'; @@ -42464,7 +45515,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap * @param {CategoryAxis} categoryAxis 类目坐标轴,需要知道类目间隔大小 * @param {Array} locationMap 整形数据的系列索引 */ - _mapSize : function (categoryAxis, locationMap, ignoreUserDefined) { + _mapSize: function (categoryAxis, locationMap, ignoreUserDefined) { var series = this.series; var seriesIndex; var barWidthMap = {}; @@ -42489,7 +45540,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap queryTarget, 'barWidth' ); - if (typeof sBarWidth != 'undefined') { + if (sBarWidth != null) { // 同一堆积第一个生效barWidth barWidthMap[seriesIndex] = sBarWidth; sBarWidthTotal += sBarWidth; @@ -42506,22 +45557,10 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap } } - barMinHeightMap[seriesIndex] = this.query( - queryTarget, - 'barMinHeight' - ); - barGap = typeof barGap != 'undefined' - ? barGap - : this.query( - queryTarget, - 'barGap' - ); - barCategoryGap = typeof barCategoryGap != 'undefined' - ? barCategoryGap - : this.query( - queryTarget, - 'barCategoryGap' - ); + barMinHeightMap[seriesIndex] = this.query(queryTarget, 'barMinHeight'); + barGap = barGap != null ? barGap : this.query(queryTarget, 'barGap'); + barCategoryGap = barCategoryGap != null + ? barCategoryGap : this.query(queryTarget, 'barCategoryGap'); } } @@ -42530,7 +45569,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap if (locationMap.length != sBarWidthCounter) { // 至少存在一个自适应宽度的柱形图 if (!ignoreUserDefined) { - gap = typeof barCategoryGap == 'string' + gap = typeof barCategoryGap === 'string' && barCategoryGap.match(/%$/) // 百分比 ? Math.floor( @@ -42540,7 +45579,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap ) // 数值 : (categoryAxis.getGap() - barCategoryGap); - if (typeof barGap == 'string' && barGap.match(/%$/)) { + if (typeof barGap === 'string' && barGap.match(/%$/)) { barGap = parseFloat(barGap) / 100; barWidth = Math.floor( (gap - sBarWidthTotal) @@ -42578,7 +45617,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap else { // 全是自定义宽度,barGap无效,系列间隔决定barGap gap = sBarWidthCounter > 1 - ? (typeof barCategoryGap == 'string' + ? (typeof barCategoryGap === 'string' && barCategoryGap.match(/%$/) ) // 百分比 @@ -42604,19 +45643,19 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap } return { - barWidthMap : barWidthMap, - barMinHeightMap : barMinHeightMap , - gap : gap, - barWidth : barWidth, - barGap : barGap, - interval : interval + barWidthMap: barWidthMap, + barMinHeightMap: barMinHeightMap , + gap: gap, + barWidth: barWidth, + barGap: barGap, + interval: interval }; }, /** * 生成最终图形数据 */ - _getBarItem : function (seriesIndex, dataIndex, name, x, y, width, height, orient) { + _getBarItem: function (seriesIndex, dataIndex, name, x, y, width, height, orient) { var series = this.series; var barShape; var serie = series[seriesIndex]; @@ -42636,35 +45675,35 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap queryTarget, 'itemStyle.normal' ); - var normalBorderWidth = normal.borderWidth; + var normalBorderWidth = normal.barBorderWidth; var emphasis = this.deepMerge( queryTarget, 'itemStyle.emphasis' ); barShape = { - zlevel : this._zlevelBase, - clickable: true, - style : { - x : x, - y : y, - width : width, - height : height, - brushType : 'both', - color : this.getItemStyleColor(normalColor, seriesIndex, dataIndex, data), - radius : normal.borderRadius, - lineWidth : normalBorderWidth, - strokeColor : normal.borderColor + zlevel: this._zlevelBase, + clickable: this.deepQuery(queryTarget, 'clickable'), + style: { + x: x, + y: y, + width: width, + height: height, + brushType: 'both', + color: this.getItemStyleColor(normalColor, seriesIndex, dataIndex, data), + radius: normal.barBorderRadius, + lineWidth: normalBorderWidth, + strokeColor: normal.barBorderColor }, - highlightStyle : { - color : this.getItemStyleColor(emphasisColor, seriesIndex, dataIndex, data), - radius : emphasis.borderRadius, - lineWidth : emphasis.borderWidth, - strokeColor : emphasis.borderColor + highlightStyle: { + color: this.getItemStyleColor(emphasisColor, seriesIndex, dataIndex, data), + radius: emphasis.barBorderRadius, + lineWidth: emphasis.barBorderWidth, + strokeColor: emphasis.barBorderColor }, - _orient : orient + _orient: orient }; barShape.highlightStyle.color = barShape.highlightStyle.color - || (typeof barShape.style.color == 'string' + || (typeof barShape.style.color === 'string' ? zrColor.lift(barShape.style.color, -0.3) : barShape.style.color ); @@ -42686,32 +45725,32 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap barShape.highlightStyle.textColor = barShape.highlightStyle.color; barShape = this.addLabel(barShape, serie, data, name, orient); - if (barShape.style.textPosition == 'insideLeft' - || barShape.style.textPosition == 'insideRight' - || barShape.style.textPosition == 'insideTop' - || barShape.style.textPosition == 'insideBottom' + if (barShape.style.textPosition === 'insideLeft' + || barShape.style.textPosition === 'insideRight' + || barShape.style.textPosition === 'insideTop' + || barShape.style.textPosition === 'insideBottom' ) { var gap = 5; switch (barShape.style.textPosition) { - case 'insideLeft' : + case 'insideLeft': barShape.style.textX = barShape.style.x + gap; barShape.style.textY = barShape.style.y + barShape.style.height / 2; barShape.style.textAlign = 'left'; barShape.style.textBaseline = 'middle'; break; - case 'insideRight' : + case 'insideRight': barShape.style.textX = barShape.style.x + barShape.style.width - gap; barShape.style.textY = barShape.style.y + barShape.style.height / 2; barShape.style.textAlign = 'right'; barShape.style.textBaseline = 'middle'; break; - case 'insideTop' : + case 'insideTop': barShape.style.textX = barShape.style.x + barShape.style.width / 2; barShape.style.textY = barShape.style.y + gap / 2; barShape.style.textAlign = 'center'; barShape.style.textBaseline = 'top'; break; - case 'insideBottom' : + case 'insideBottom': barShape.style.textX = barShape.style.x + barShape.style.width / 2; barShape.style.textY = barShape.style.y + barShape.style.height - gap / 2; barShape.style.textAlign = 'center'; @@ -42740,7 +45779,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap }, // 位置转换 - getMarkCoord : function (seriesIndex, mpData) { + getMarkCoord: function (seriesIndex, mpData) { var serie = this.series[seriesIndex]; var xMarkMap = this.xMarkMap[seriesIndex]; var xAxis = this.component.xAxis.getAxis(serie.xAxisIndex); @@ -42748,7 +45787,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap var dataIndex; var pos; if (mpData.type - && (mpData.type == 'max' || mpData.type == 'min' || mpData.type == 'average') + && (mpData.type === 'max' || mpData.type === 'min' || mpData.type === 'average') ) { // 特殊值内置支持 pos = [ @@ -42760,12 +45799,12 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap } else if (xMarkMap.isHorizontal) { // 横向 - dataIndex = typeof mpData.xAxis == 'string' && xAxis.getIndexByName + dataIndex = typeof mpData.xAxis === 'string' && xAxis.getIndexByName ? xAxis.getIndexByName(mpData.xAxis) : (mpData.xAxis || 0); var x = xMarkMap[dataIndex]; - x = typeof x != 'undefined' + x = x != null ? x : typeof mpData.xAxis != 'string' && xAxis.getCoordByIndex ? xAxis.getCoordByIndex(mpData.xAxis || 0) @@ -42775,12 +45814,12 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap } else { // 纵向 - dataIndex = typeof mpData.yAxis == 'string' && yAxis.getIndexByName + dataIndex = typeof mpData.yAxis === 'string' && yAxis.getIndexByName ? yAxis.getIndexByName(mpData.yAxis) : (mpData.yAxis || 0); var y = xMarkMap[dataIndex]; - y = typeof y != 'undefined' + y = y != null ? y : typeof mpData.yAxis != 'string' && yAxis.getCoordByIndex ? yAxis.getCoordByIndex(mpData.yAxis || 0) @@ -42795,7 +45834,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap /** * 刷新 */ - refresh : function (newOption) { + refresh: function (newOption) { if (newOption) { this.option = newOption; this.series = newOption.series; @@ -42808,7 +45847,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap /** * 动态数据增加动画 */ - addDataAnimation : function (params) { + addDataAnimation: function (params) { var series = this.series; var aniMap = {}; // seriesIndex索引参数 for (var i = 0, l = params.length; i < l; i++) { @@ -42825,12 +45864,12 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap seriesIndex = ecData.get(this.shapeList[i], 'seriesIndex'); if (aniMap[seriesIndex] && !aniMap[seriesIndex][3]) { // 有数据删除才有移动的动画 - if (this.shapeList[i].type == 'rectangle') { + if (this.shapeList[i].type === 'rectangle') { // 主动画 dataIndex = ecData.get(this.shapeList[i], 'dataIndex'); serie = series[seriesIndex]; if (aniMap[seriesIndex][2] - && dataIndex == serie.data.length - 1 + && dataIndex === serie.data.length - 1 ) { // 队头加入删除末尾 this.zr.delShape(this.shapeList[i].id); @@ -42841,7 +45880,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap this.zr.delShape(this.shapeList[i].id); continue; } - if (this.shapeList[i]._orient == 'horizontal') { + if (this.shapeList[i]._orient === 'horizontal') { // 条形图 dy = this.component.yAxis.getAxis( serie.yAxisIndex || 0 @@ -42861,7 +45900,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap this.zr.animate(this.shapeList[i].id, '') .when( 500, - {position : [x, y]} + { position: [x, y] } ) .start(); } @@ -42956,11 +45995,11 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap } Pie.prototype = { - type : ecConfig.CHART_TYPE_PIE, + type: ecConfig.CHART_TYPE_PIE, /** * 绘制图形 */ - _buildShape : function () { + _buildShape: function () { var series = this.series; var legend = this.component.legend; this.selectedMap = {}; @@ -42972,7 +46011,7 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap this._selectedMode = false; var serieName; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type == ecConfig.CHART_TYPE_PIE) { + if (series[i].type === ecConfig.CHART_TYPE_PIE) { series[i] = this.reformOption(series[i]); serieName = series[i].name || ''; // 系列图例开关 @@ -42988,18 +46027,18 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap this._selected[i] = []; if (this.deepQuery([series[i], this.option], 'calculable')) { pieCase = { - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : center[0], // 圆心横坐标 - y : center[1], // 圆心纵坐标 + zlevel: this._zlevelBase, + hoverable: false, + style: { + x: center[0], // 圆心横坐标 + y: center[1], // 圆心纵坐标 // 圆环内外半径 - r0 : radius[0] <= 10 ? 0 : radius[0] - 10, - r : radius[1] + 10, - brushType : 'stroke', + r0: radius[0] <= 10 ? 0 : radius[0] - 10, + r: radius[1] + 10, + brushType: 'stroke', lineWidth: 1, - strokeColor : series[i].calculableHolderColor - || this.ecTheme.calculableHolderColor + strokeColor: series[i].calculableHolderColor + || this.ecTheme.calculableHolderColor } }; ecData.pack(pieCase, series[i], i, undefined, -1); @@ -43023,7 +46062,7 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap * * @param {number} seriesIndex 系列索引 */ - _buildSinglePie : function (seriesIndex) { + _buildSinglePie: function (seriesIndex) { var series = this.series; var serie = series[seriesIndex]; var data = serie.data; @@ -43053,6 +46092,10 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap maxValue = Math.max(maxValue, +data[i].value); } } + + if (totalValue === 0) { + return; + } var percent = 100; var lastPercent; // 相邻细角度优化 @@ -43103,12 +46146,12 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap r0 = +radius[0]; r1 = +radius[1]; - if (roseType == 'radius') { + if (roseType === 'radius') { r1 = data[i].value / maxValue * (r1 - r0) * 0.8 + (r1 - r0) * 0.2 + r0; } - else if (roseType == 'area') { + else if (roseType === 'area') { r1 = Math.sqrt(data[i].value / maxValue) * (r1 - r0) + r0; } @@ -43150,7 +46193,7 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap /** * 构建单个扇形及指标 */ - _buildItem : function ( + _buildItem: function ( seriesIndex, dataIndex, percent, lastAddRadius, isSelected, r0, r1, @@ -43215,7 +46258,7 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap /** * 构建扇形 */ - getSector : function ( + getSector: function ( seriesIndex, dataIndex, percent, isSelected, r0, r1, startAngle, endAngle, defaultColor @@ -43239,35 +46282,35 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap || defaultColor; var emphasisColor = this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data) - || (typeof normalColor == 'string' + || (typeof normalColor === 'string' ? zrColor.lift(normalColor, -0.2) : normalColor ); var sector = { - zlevel : this._zlevelBase, - clickable : true, - style : { - x : center[0], // 圆心横坐标 - y : center[1], // 圆心纵坐标 - r0 : r0, // 圆环内半径 - r : r1, // 圆环外半径 - startAngle : startAngle, - endAngle : endAngle, - brushType : 'both', - color : normalColor, - lineWidth : normal.borderWidth, - strokeColor : normal.borderColor, + zlevel: this._zlevelBase, + clickable: this.deepQuery(queryTarget, 'clickable'), + style: { + x: center[0], // 圆心横坐标 + y: center[1], // 圆心纵坐标 + r0: r0, // 圆环内半径 + r: r1, // 圆环外半径 + startAngle: startAngle, + endAngle: endAngle, + brushType: 'both', + color: normalColor, + lineWidth: normal.borderWidth, + strokeColor: normal.borderColor, lineJoin: 'round' }, - highlightStyle : { - color : emphasisColor, - lineWidth : emphasis.borderWidth, - strokeColor : emphasis.borderColor, + highlightStyle: { + color: emphasisColor, + lineWidth: emphasis.borderWidth, + strokeColor: emphasis.borderColor, lineJoin: 'round' }, - _seriesIndex : seriesIndex, - _dataIndex : dataIndex + _seriesIndex: seriesIndex, + _dataIndex: dataIndex }; if (isSelected) { @@ -43311,7 +46354,7 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap /** * 需要显示则会有返回构建好的shape,否则返回undefined */ - getLabel : function ( + getLabel: function ( seriesIndex, dataIndex, percent, lastAddRadius, startAngle, endAngle, defaultColor, isEmphasis @@ -43347,14 +46390,14 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap var textBaseline = 'middle'; labelControl.position = labelControl.position || itemStyle.normal.label.position; - if (labelControl.position == 'center') { + if (labelControl.position === 'center') { // center显示 radius = radius[1]; x = centerX; y = centerY; textAlign = 'center'; } - else if (labelControl.position == 'inner'){ + else if (labelControl.position === 'inner'){ // 内部显示 radius = (radius[0] + radius[1]) / 2 + lastAddRadius; x = Math.round( @@ -43368,51 +46411,48 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap } else { - // 外部显示,默认 labelControl.position == 'outer') + // 外部显示,默认 labelControl.position === 'outer') radius = radius[1] - (-itemStyle[status].labelLine.length) //- (-textStyle.fontSize) + lastAddRadius; x = centerX + radius * zrMath.cos(midAngle, true); y = centerY - radius * zrMath.sin(midAngle, true); - textAlign = (midAngle >= 90 && midAngle <= 270) - ? 'right' : 'left'; + textAlign = (midAngle >= 90 && midAngle <= 270) ? 'right' : 'left'; } if (labelControl.position != 'center' && labelControl.position != 'inner' ) { - x += textAlign == 'left' ? 20 : -20; + x += textAlign === 'left' ? 20 : -20; } - data.__labelX = x - (textAlign == 'left' ? 5 : -5); + data.__labelX = x - (textAlign === 'left' ? 5 : -5); data.__labelY = y; return new TextShape({ - zlevel : this._zlevelBase + 1, - hoverable : false, - style : { - x : x, - y : y, - color : textStyle.color || defaultColor, - text : this.getLabelText( - seriesIndex, dataIndex, percent, status - ), - textAlign : textStyle.align || textAlign, - textBaseline : textStyle.baseline || textBaseline, - textFont : this.getFont(textStyle) + zlevel: this._zlevelBase + 1, + hoverable: false, + style: { + x: x, + y: y, + color: textStyle.color || defaultColor, + text: this.getLabelText(seriesIndex, dataIndex, percent, status), + textAlign: textStyle.align || textAlign, + textBaseline: textStyle.baseline || textBaseline, + textFont: this.getFont(textStyle) }, - highlightStyle : { - brushType : 'fill' + highlightStyle: { + brushType: 'fill' }, - _seriesIndex : seriesIndex, - _dataIndex : dataIndex + _seriesIndex: seriesIndex, + _dataIndex: dataIndex }); }, /** * 根据lable.format计算label text */ - getLabelText : function (seriesIndex, dataIndex, percent, status) { + getLabelText: function (seriesIndex, dataIndex, percent, status) { var series = this.series; var serie = series[seriesIndex]; var data = serie.data[dataIndex]; @@ -43422,7 +46462,7 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap ); if (formatter) { - if (typeof formatter == 'function') { + if (typeof formatter === 'function') { return formatter.call( this.myChart, serie.name, @@ -43431,7 +46471,7 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap percent ); } - else if (typeof formatter == 'string') { + else if (typeof formatter === 'string') { formatter = formatter.replace('{a}','{a0}') .replace('{b}','{b0}') .replace('{c}','{c0}') @@ -43452,7 +46492,7 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap /** * 需要显示则会有返回构建好的shape,否则返回undefined */ - getLabelLine : function ( + getLabelLine: function ( seriesIndex, dataIndex, lastAddRadius, r0, r1, startAngle, endAngle, defaultColor, @@ -43489,11 +46529,11 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap var sinValue = zrMath.sin(midAngle, true); // 三角函数缓存已在zrender/tool/math中做了 return new BrokenLineShape({ - // shape : 'brokenLine', - zlevel : this._zlevelBase + 1, - hoverable : false, - style : { - pointList : [ + // shape: 'brokenLine', + zlevel: this._zlevelBase + 1, + hoverable: false, + style: { + pointList: [ [ centerX + midRadius * cosValue, centerY - midRadius * sinValue @@ -43507,16 +46547,16 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap data.__labelY ] ], - //xStart : centerX + midRadius * cosValue, - //yStart : centerY - midRadius * sinValue, - //xEnd : centerX + maxRadius * cosValue, - //yEnd : centerY - maxRadius * sinValue, - strokeColor : lineStyle.color || defaultColor, - lineType : lineStyle.type, - lineWidth : lineStyle.width + //xStart: centerX + midRadius * cosValue, + //yStart: centerY - midRadius * sinValue, + //xEnd: centerX + maxRadius * cosValue, + //yEnd: centerY - maxRadius * sinValue, + strokeColor: lineStyle.color || defaultColor, + lineType: lineStyle.type, + lineWidth: lineStyle.width }, - _seriesIndex : seriesIndex, - _dataIndex : dataIndex + _seriesIndex: seriesIndex, + _dataIndex: dataIndex }); } else { @@ -43530,7 +46570,7 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap * @param {Object} data * @param {boolean} isEmphasis true is 'emphasis' and false is 'normal' */ - _needLabel : function (serie, data, isEmphasis) { + _needLabel: function (serie, data, isEmphasis) { return this.deepQuery( [data, serie], 'itemStyle.' @@ -43545,7 +46585,7 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap * @param {Object} data * @param {boolean} isEmphasis true is 'emphasis' and false is 'normal' */ - _needLabelLine : function (serie, data, isEmphasis) { + _needLabelLine: function (serie, data, isEmphasis) { return this.deepQuery( [data, serie], 'itemStyle.' @@ -43558,7 +46598,7 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap * 参数修正&默认值赋值,重载基类方法 * @param {Object} opt 参数 */ - reformOption : function (opt) { + reformOption: function (opt) { // 常用方法快捷方式 var _merge = zrUtil.merge; opt = _merge( @@ -43582,7 +46622,7 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap /** * 刷新 */ - refresh : function (newOption) { + refresh: function (newOption) { if (newOption) { this.option = newOption; this.series = newOption.series; @@ -43595,7 +46635,7 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap /** * 动态数据增加动画 */ - addDataAnimation : function (params) { + addDataAnimation: function (params) { var series = this.series; var aniMap = {}; // seriesIndex索引参数 for (var i = 0, l = params.length; i < l; i++) { @@ -43618,7 +46658,7 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap isHead = params[i][2]; dataGrow = params[i][3]; if (series[seriesIndex] - && series[seriesIndex].type == ecConfig.CHART_TYPE_PIE + && series[seriesIndex].type === ecConfig.CHART_TYPE_PIE ) { if (isHead) { if (!dataGrow) { @@ -43673,17 +46713,15 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap if (!targeSector) { continue; } - if (backupShapeList[i].type == 'sector') { + if (backupShapeList[i].type === 'sector') { if (targeSector != 'delete') { // 原有扇形 this.zr.animate(backupShapeList[i].id, 'style') .when( 400, { - startAngle : - targeSector.style.startAngle, - endAngle : - targeSector.style.endAngle + startAngle: targeSector.style.startAngle, + endAngle: targeSector.style.endAngle } ) .start(); @@ -43694,22 +46732,16 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap .when( 400, deltaIdxMap[seriesIndex] < 0 - ? { - startAngle : - backupShapeList[i].style.startAngle - } - : { - endAngle : - backupShapeList[i].style.endAngle - } + ? { startAngle: backupShapeList[i].style.startAngle } + : { endAngle: backupShapeList[i].style.endAngle } ) .start(); } } - else if (backupShapeList[i].type == 'text' - || backupShapeList[i].type == 'broken-line' + else if (backupShapeList[i].type === 'text' + || backupShapeList[i].type === 'broken-line' ) { - if (targeSector == 'delete') { + if (targeSector === 'delete') { // 删除逻辑一样 this.zr.delShape(backupShapeList[i].id); } @@ -43748,7 +46780,7 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap this.shapeList = backupShapeList; }, - onclick : function (param) { + onclick: function (param) { var series = this.series; if (!this.isClick || !param.target) { // 没有在当前实例上发生点击直接返回 @@ -43762,7 +46794,7 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap var dataIndex = ecData.get(target, 'dataIndex'); for (var i = 0, len = this.shapeList.length; i < len; i++) { - if (this.shapeList[i].id == target.id) { + if (this.shapeList[i].id === target.id) { seriesIndex = ecData.get(target, 'seriesIndex'); dataIndex = ecData.get(target, 'dataIndex'); // 当前点击的 @@ -43794,7 +46826,7 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap this.zr.modShape(target.id, target); } else if (this.shapeList[i].style._hasSelected - && this._selectedMode == 'single' + && this._selectedMode === 'single' ) { seriesIndex = ecData.get(this.shapeList[i], 'seriesIndex'); dataIndex = ecData.get(this.shapeList[i], 'dataIndex'); @@ -43813,8 +46845,8 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap ecConfig.EVENT.PIE_SELECTED, param.event, { - selected : this._selected, - target : ecData.get(target, 'name') + selected: this._selected, + target: ecData.get(target, 'name') }, this.myChart ); diff --git a/build/echarts-plain-original.js b/build/echarts-plain-original.js index 84c4adc..60f1a04 100644 --- a/build/echarts-plain-original.js +++ b/build/echarts-plain-original.js @@ -425,10 +425,10 @@ define('echarts/config',[],function() { CHART_TYPE_MAP: 'map', CHART_TYPE_K: 'k', CHART_TYPE_ISLAND: 'island', - CHART_TYPE_FORCE : 'force', - CHART_TYPE_CHORD : 'chord', - CHART_TYPE_GAUGE : 'gauge', - CHART_TYPE_FUNNEL : 'funnel', + CHART_TYPE_FORCE: 'force', + CHART_TYPE_CHORD: 'chord', + CHART_TYPE_GAUGE: 'gauge', + CHART_TYPE_FUNNEL: 'funnel', // 组件类型 COMPONENT_TYPE_TITLE: 'title', @@ -446,6 +446,7 @@ define('echarts/config',[],function() { COMPONENT_TYPE_AXIS_CATEGORY: 'categoryAxis', COMPONENT_TYPE_AXIS_VALUE: 'valueAxis', COMPONENT_TYPE_TIMELINE: 'timeline', + COMPONENT_TYPE_ROAMCONTROLLER: 'roamController', // 全图默认背景 backgroundColor: 'rgba(0,0,0,0)', @@ -459,11 +460,11 @@ define('echarts/config',[],function() { // 图表标题 title: { text: '', - //link: null, // 超链接跳转 - //target: null, // 仅支持self | blank + // link: null, // 超链接跳转 + // target: null, // 仅支持self | blank subtext: '', - //sublink: null, // 超链接跳转 - //subtarget: null, // 仅支持self | blank + // sublink: null, // 超链接跳转 + // subtarget: null, // 仅支持self | blank x: 'left', // 水平安放位置,默认为左对齐,可选为: // 'center' ¦ 'left' ¦ 'right' // ¦ {number}(x坐标,单位px) @@ -476,7 +477,7 @@ define('echarts/config',[],function() { borderWidth: 0, // 标题边框线宽,单位px,默认为0(无边框) padding: 5, // 标题内边距,单位px,默认各方向内边距为5, // 接受数组分别设定上右下左边距,同css - itemGap: 5, // 主副标题纵向间隔,单位px,默认为10, + itemGap: 5, // 主副标题纵向间隔,单位px,默认为10, textStyle: { fontSize: 18, fontWeight: 'bolder', @@ -509,7 +510,7 @@ define('echarts/config',[],function() { textStyle: { color: '#333' // 图例文字颜色 }, - selectedMode: true // 选择模式,默认开启图例开关 + selectedMode: true // 选择模式,默认开启图例开关 // selected: null, // 配置默认选中状态,可配合LEGEND.SELECTED事件做动态数据载入 // data: [], // 图例内容(详见legend.data,数组中每一项代表一个item }, @@ -540,15 +541,15 @@ define('echarts/config',[],function() { calculable: false, // 是否值域漫游,启用后无视splitNumber,线性渐变 realtime: true, color:['#006edd','#e0ffff'],//颜色 - //formatter: null, - //text:['高','低'], // 文本,默认为数值文本 + // formatter: null, + // text:['高','低'], // 文本,默认为数值文本 textStyle: { color: '#333' // 值域文字颜色 } }, toolbox: { - show : false, + show: false, orient: 'horizontal', // 布局方式,默认为水平布局,可选为: // 'horizontal' ¦ 'vertical' x: 'right', // 水平安放位置,默认为全图右对齐,可选为: @@ -557,9 +558,9 @@ define('echarts/config',[],function() { y: 'top', // 垂直安放位置,默认为全图顶端,可选为: // 'top' ¦ 'bottom' ¦ 'center' // ¦ {number}(y坐标,单位px) - color : ['#1e90ff','#22bb22','#4b0082','#d2691e'], - disableColor : '#ddd', - effectiveColor : 'red', + color: ['#1e90ff','#22bb22','#4b0082','#d2691e'], + disableColor: '#ddd', + effectiveColor: 'red', backgroundColor: 'rgba(0,0,0,0)', // 工具箱背景颜色 borderColor: '#ccc', // 工具箱边框颜色 borderWidth: 0, // 工具箱边框线宽,单位px,默认为0(无边框) @@ -567,55 +568,55 @@ define('echarts/config',[],function() { // 接受数组分别设定上右下左边距,同css itemGap: 10, // 各个item之间的间隔,单位px,默认为10, // 横向布局时为水平间隔,纵向布局时为纵向间隔 - itemSize: 16, // 工具箱图形宽度 - showTitle : true, - //textStyle : {}, - feature : { - mark : { - show : false, - title : { - mark : '辅助线开关', - markUndo : '删除辅助线', - markClear : '清空辅助线' + itemSize: 16, // 工具箱图形宽度 + showTitle: true, + // textStyle: { }, + feature: { + mark: { + show: false, + title: { + mark: '辅助线开关', + markUndo: '删除辅助线', + markClear: '清空辅助线' }, - lineStyle : { - width : 1, - color : '#1e90ff', - type : 'dashed' + lineStyle: { + width: 1, + color: '#1e90ff', + type: 'dashed' } }, - dataZoom : { - show : false, - title : { - dataZoom : '区域缩放', - dataZoomReset : '区域缩放后退' + dataZoom: { + show: false, + title: { + dataZoom: '区域缩放', + dataZoomReset: '区域缩放后退' } }, - dataView : { - show : false, - title : '数据视图', + dataView: { + show: false, + title: '数据视图', readOnly: false, - lang : ['Data View', 'close', 'refresh'] + lang: ['Data View', 'close', 'refresh'] }, magicType: { - show : false, - title : { - line : '折线图切换', - bar : '柱形图切换', - stack : '堆积', - tiled : '平铺' + show: false, + title: { + line: '折线图切换', + bar: '柱形图切换', + stack: '堆积', + tiled: '平铺' }, - type : [] // 'line', 'bar', 'stack', 'tiled' + type: [ ] // 'line', 'bar', 'stack', 'tiled' }, - restore : { - show : false, - title : '还原' + restore: { + show: false, + title: '还原' }, - saveAsImage : { - show : false, - title : '保存为图片', - type : 'png', - lang : ['点击保存'] + saveAsImage: { + show: false, + title: '保存为图片', + type: 'png', + lang: ['点击保存'] } } }, @@ -625,21 +626,21 @@ define('echarts/config',[],function() { show: true, showContent: true, // tooltip主体内容 trigger: 'item', // 触发类型,默认数据触发,见下图,可选为:'item' ¦ 'axis' - // position : null // 位置 {Array} | {Function} + // position: null // 位置 {Array} | {Function} // formatter: null // 内容格式器:{string}(Template) ¦ {Function} islandFormatter: '{a}
{b} : {c}', // 数据孤岛内容格式器 showDelay: 20, // 显示延迟,添加显示延迟可以避免频繁切换,单位ms hideDelay: 100, // 隐藏延迟,单位ms - transitionDuration : 0.4, // 动画变换时间,单位s + transitionDuration: 0.4, // 动画变换时间,单位s backgroundColor: 'rgba(0,0,0,0.7)', // 提示背景颜色,默认为透明度为0.7的黑色 borderColor: '#333', // 提示边框颜色 borderRadius: 4, // 提示边框圆角,单位px,默认为4 borderWidth: 0, // 提示边框线宽,单位px,默认为0(无边框) padding: 5, // 提示内边距,单位px,默认各方向内边距为5, // 接受数组分别设定上右下左边距,同css - axisPointer : { // 坐标轴指示器,坐标轴触发有效 - type : 'line', // 默认为直线,可选为:'line' | 'shadow' | 'cross' - lineStyle : { // 直线指示器样式设置 + axisPointer: { // 坐标轴指示器,坐标轴触发有效 + type: 'line', // 默认为直线,可选为:'line' | 'shadow' | 'cross' + lineStyle: { // 直线指示器样式设置 color: '#48b', width: 2, type: 'solid' @@ -649,7 +650,7 @@ define('echarts/config',[],function() { width: 1, type: 'dashed' }, - shadowStyle : { // 阴影指示器样式设置 + shadowStyle: { // 阴影指示器样式设置 color: 'rgba(150,150,150,0.3)', // 阴影颜色 width: 'auto', // 阴影大小 type: 'default' @@ -663,8 +664,8 @@ define('echarts/config',[],function() { // 区域缩放控制器 dataZoom: { show: false, - orient: 'horizontal', // 布局方式,默认为水平布局,可选为: - // 'horizontal' ¦ 'vertical' + orient: 'horizontal', // 布局方式,默认为水平布局,可选为: + // 'horizontal' ¦ 'vertical' // x: {number}, // 水平安放位置,默认为根据grid参数适配,可选为: // {number}(x坐标,单位px) // y: {number}, // 垂直安放位置,默认为根据grid参数适配,可选为: @@ -715,7 +716,7 @@ define('echarts/config',[],function() { axisTick: { // 坐标轴小标记 show: true, // 属性show控制显示与否,默认不显示 interval: 'auto', - inside : false, // 控制小标记是否在grid里 + inside: false, // 控制小标记是否在grid里 // onGap: null, length :5, // 属性length控制线长 lineStyle: { // 属性lineStyle控制线条样式 @@ -776,7 +777,7 @@ define('echarts/config',[],function() { }, axisTick: { // 坐标轴小标记 show: false, // 属性show控制显示与否,默认不显示 - inside : false, // 控制小标记是否在grid里 + inside: false, // 控制小标记是否在grid里 length :5, // 属性length控制线长 lineStyle: { // 属性lineStyle控制线条样式 color: '#333', @@ -809,12 +810,12 @@ define('echarts/config',[],function() { } }, - polar : { - center : ['50%', '50%'], // 默认全局居中 - radius : '75%', - startAngle : 90, - splitNumber : 5, - name : { + polar: { + center: ['50%', '50%'], // 默认全局居中 + radius: '75%', + startAngle: 90, + splitNumber: 5, + name: { show: true, // formatter: null, textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE @@ -836,28 +837,28 @@ define('echarts/config',[],function() { color: '#333' } }, - splitArea : { - show : true, - areaStyle : { + splitArea: { + show: true, + areaStyle: { color: ['rgba(250,250,250,0.3)','rgba(200,200,200,0.3)'] } }, - splitLine : { - show : true, - lineStyle : { - width : 1, - color : '#ccc' + splitLine: { + show: true, + lineStyle: { + width: 1, + color: '#ccc' } }, type: 'polygon' - //indicator : [] + // indicator: [ ] }, - timeline : { + timeline: { show: true, - type : 'time', // 模式是时间类型,支持 number - notMerge : false, - realtime : true, + type: 'time', // 模式是时间类型,支持 number + notMerge: false, + realtime: true, x: 80, // y: {number}, x2: 80, @@ -865,17 +866,17 @@ define('echarts/config',[],function() { // width: {totalWidth} - x - x2, height: 50, backgroundColor: 'rgba(0,0,0,0)', // 时间轴背景颜色 - borderColor : '#ccc', // 时间轴边框颜色 - borderWidth : 0, // 时间轴边框线宽,单位px,默认为0(无边框) - padding : 5, // 时间轴内边距,单位px,默认各方向内边距为5, - controlPosition : 'left', // 'right' | 'none' - autoPlay : false, - loop : true, - playInterval : 2000, // 播放时间间隔,单位ms - lineStyle : { - width : 1, - color : '#666', - type : 'dashed' + borderColor: '#ccc', // 时间轴边框颜色 + borderWidth: 0, // 时间轴边框线宽,单位px,默认为0(无边框) + padding: 5, // 时间轴内边距,单位px,默认各方向内边距为5, + controlPosition: 'left', // 'right' | 'none' + autoPlay: false, + loop: true, + playInterval: 2000, // 播放时间间隔,单位ms + lineStyle: { + width: 1, + color: '#666', + type: 'dashed' }, label: { // 文本标签 show: true, @@ -886,12 +887,12 @@ define('echarts/config',[],function() { color: '#333' } }, - checkpointStyle : { - symbol : 'auto', - symbolSize : 'auto', - color : 'auto', - borderColor : 'auto', - borderWidth : 'auto', + checkpointStyle: { + symbol: 'auto', + symbolSize: 'auto', + color: 'auto', + borderColor: 'auto', + borderWidth: 'auto', label: { // 文本标签 show: false, textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE @@ -899,31 +900,53 @@ define('echarts/config',[],function() { } } }, - controlStyle : { - normal : { color : '#333'}, - emphasis : { color : '#1e90ff'} + controlStyle: { + normal: { color: '#333'}, + emphasis: { color: '#1e90ff'} }, - symbol : 'emptyDiamond', - symbolSize : 4, - currentIndex : 0 - // data : [] + symbol: 'emptyDiamond', + symbolSize: 4, + currentIndex: 0 + // data: [] + }, + + roamController: { + show: false, + x: 'left', // 水平安放位置,默认为全图左对齐,可选为: + // 'center' ¦ 'left' ¦ 'right' + // ¦ {number}(x坐标,单位px) + y: 'top', // 垂直安放位置,默认为全图顶端,可选为: + // 'top' ¦ 'bottom' ¦ 'center' + // ¦ {number}(y坐标,单位px) + width: 80, + height: 120, + backgroundColor: 'rgba(0,0,0,0)', + borderColor: '#ccc', // 图例边框颜色 + borderWidth: 0, // 图例边框线宽,单位px,默认为0(无边框) + padding: 5, // 图例内边距,单位px,默认各方向内边距为5, + // 接受数组分别设定上右下左边距,同css + handlerColor: '#6495ed', + fillerColor: '#fff', + step: 15, // 移动幅度 + mapTypeControl: null }, // 柱形图默认参数 bar: { + clickable: true, // stack: null xAxisIndex: 0, yAxisIndex: 0, barMinHeight: 0, // 最小高度改为0 // barWidth: null, // 默认自适应 barGap: '30%', // 柱间距离,默认为柱形宽度的30%,可设固定值 - barCategoryGap : '20%', // 类目间柱形距离,默认为类目间距的20%,可设固定值 + barCategoryGap: '20%', // 类目间柱形距离,默认为类目间距的20%,可设固定值 itemStyle: { normal: { // color: '各异', - borderColor: '#fff', // 柱条边线 - borderRadius: 0, // 柱条边线圆角,单位px,默认为0 - borderWidth: 0, // 柱条边线线宽,单位px,默认为1 + barBorderColor: '#fff', // 柱条边线 + barBorderRadius: 0, // 柱条边线圆角,单位px,默认为0 + barBorderWidth: 0, // 柱条边线线宽,单位px,默认为1 label: { show: false // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 @@ -934,9 +957,9 @@ define('echarts/config',[],function() { }, emphasis: { // color: '各异', - borderColor: '#fff', // 柱条边线 - borderRadius: 0, // 柱条边线圆角,单位px,默认为0 - borderWidth: 0, // 柱条边线线宽,单位px,默认为1 + barBorderColor: '#fff', // 柱条边线 + barBorderRadius: 0, // 柱条边线圆角,单位px,默认为0 + barBorderWidth: 0, // 柱条边线线宽,单位px,默认为1 label: { show: false // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 @@ -950,6 +973,7 @@ define('echarts/config',[],function() { // 折线图默认参数 line: { + clickable: true, // stack: null xAxisIndex: 0, yAxisIndex: 0, @@ -966,7 +990,7 @@ define('echarts/config',[],function() { lineStyle: { width: 2, type: 'solid', - shadowColor : 'rgba(0,0,0,0)', //默认透明 + shadowColor: 'rgba(0,0,0,0)', //默认透明 shadowBlur: 0, shadowOffsetX: 0, shadowOffsetY: 0 @@ -983,19 +1007,20 @@ define('echarts/config',[],function() { } } }, - //smooth : false, - //symbol: null, // 拐点图形类型 - symbolSize: 2, // 拐点图形大小 - //symbolRotate : null, // 拐点图形旋转控制 - showAllSymbol: false // 标志图形默认只有主轴显示(随主轴标签间隔隐藏策略) + // smooth: false, + // symbol: null, // 拐点图形类型 + symbolSize: 2, // 拐点图形大小 + // symbolRotate: null, // 拐点图形旋转控制 + showAllSymbol: false // 标志图形默认只有主轴显示(随主轴标签间隔隐藏策略) }, // K线图默认参数 k: { + clickable: true, xAxisIndex: 0, yAxisIndex: 0, - // barWidth : null // 默认自适应 - // barMaxWidth : null // 默认自适应 + // barWidth: null // 默认自适应 + // barMaxWidth: null // 默认自适应 itemStyle: { normal: { color: '#fff', // 阳线填充颜色 @@ -1015,20 +1040,21 @@ define('echarts/config',[],function() { // 散点图默认参数 scatter: { + clickable: true, xAxisIndex: 0, yAxisIndex: 0, - //symbol: null, // 图形类型 - symbolSize: 4, // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 - //symbolRotate : null, // 图形旋转控制 - large: false, // 大规模散点图 - largeThreshold: 2000,// 大规模阀值,large为true且数据量>largeThreshold才启用大规模模式 + // symbol: null, // 图形类型 + symbolSize: 4, // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 + // symbolRotate: null, // 图形旋转控制 + large: false, // 大规模散点图 + largeThreshold: 2000, // 大规模阀值,large为true且数据量>largeThreshold才启用大规模模式 itemStyle: { normal: { // color: 各异, label: { show: false, // 标签文本格式器,同Tooltip.formatter,不支持回调 - formatter : function (a, b, c) { + formatter: function (a, b, c) { if (typeof c[2] != 'undefined') { return c[2]; } @@ -1046,7 +1072,7 @@ define('echarts/config',[],function() { label: { show: false, // 标签文本格式器,同Tooltip.formatter,不支持回调 - formatter : function (a, b, c) { + formatter: function (a, b, c) { if (typeof c[2] != 'undefined') { return c[2]; } @@ -1063,7 +1089,8 @@ define('echarts/config',[],function() { }, // 雷达图默认参数 - radar : { + radar: { + clickable: true, polarIndex: 0, itemStyle: { normal: { @@ -1083,21 +1110,22 @@ define('echarts/config',[],function() { } } }, - //symbol: null, // 拐点图形类型 - symbolSize: 2 // 可计算特性参数,空数据拖拽提示图形大小 - //symbolRotate : null, // 图形旋转控制 + // symbol: null, // 拐点图形类型 + symbolSize: 2 // 可计算特性参数,空数据拖拽提示图形大小 + // symbolRotate: null, // 图形旋转控制 }, // 饼图默认参数 pie: { - center : ['50%', '50%'], // 默认全局居中 - radius : [0, '75%'], - clockWise : true, // 默认顺时针 + clickable: true, + center: ['50%', '50%'], // 默认全局居中 + radius: [0, '75%'], + clockWise: true, // 默认顺时针 startAngle: 90, minAngle: 0, // 最小角度改为0 selectedOffset: 10, // 选中是扇区偏移量 // selectedMode: false, // 选择模式,默认关闭,可选single,multiple - // roseType : null, // 南丁格尔玫瑰图模式,'radius'(半径) | 'area'(面积) + // roseType: null, // 南丁格尔玫瑰图模式,'radius'(半径) | 'area'(面积) itemStyle: { normal: { // color: 各异, @@ -1145,19 +1173,20 @@ define('echarts/config',[],function() { map: { mapType: 'china', // 各省的mapType暂时都用中文 //mapLocation: { - // x : 'center' | 'left' | 'right' | 'x%' | {number}, - // y : 'center' | 'top' | 'bottom' | 'x%' | {number} + // x: 'center' | 'left' | 'right' | 'x%' | {number}, + // y: 'center' | 'top' | 'bottom' | 'x%' | {number} // width // 自适应 // height // 自适应 //}, - // mapValueCalculation: 'sum', // 数值合并方式,默认加和,可选为: - // 'sum' | 'average' | 'max' | 'min' - mapValuePrecision : 0, // 地图数值计算结果小数精度 - showLegendSymbol : true, // 显示图例颜色标识(系列标识的小圆点),存在legend时生效 - // selectedMode: false, // 选择模式,默认关闭,可选single,multiple + // mapValueCalculation: 'sum', // 数值合并方式,默认加和,可选为: + // 'sum' | 'average' | 'max' | 'min' + mapValuePrecision: 0, // 地图数值计算结果小数精度 + showLegendSymbol: true, // 显示图例颜色标识(系列标识的小圆点),存在legend时生效 + // selectedMode: false, // 选择模式,默认关闭,可选single,multiple hoverable: true, - // roam : false, // 是否开启缩放及漫游模式 - // scaleLimit : null, + clickable: true, + // roam: false, // 是否开启缩放及漫游模式 + // scaleLimit: null, itemStyle: { normal: { // color: 各异, @@ -1190,7 +1219,7 @@ define('echarts/config',[],function() { } }, - force : { + force: { // 布局中心 center: ['50%', '50%'], @@ -1201,8 +1230,8 @@ define('echarts/config',[],function() { coolDown: 0.99, // 数据映射到圆的半径的最小值和最大值 - minRadius : 10, - maxRadius : 20, + minRadius: 10, + maxRadius: 20, // 是否根据屏幕比例拉伸 ratioScaling: false, @@ -1218,10 +1247,10 @@ define('echarts/config',[],function() { steps: 1, // 布局缩放因子,并不完全精确, 效果跟布局大小类似 - scaling : 1.0, + scaling: 1.0, // 向心力因子,越大向心力越大( 所有顶点会往 center 的位置收拢 ) - gravity : 1, + gravity: 1, symbol: 'circle', // symbolSize 为 0 的话使用映射到minRadius-maxRadius后的值 @@ -1230,9 +1259,10 @@ define('echarts/config',[],function() { linkSymbol: null, linkSymbolSize: [10, 15], draggable: true, + clickable: true, // 分类里如果有样式会覆盖节点默认样式 - categories : [{ + categories: [{ // itemStyle // symbol // symbolSize @@ -1245,14 +1275,14 @@ define('echarts/config',[],function() { show: false // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE }, - nodeStyle : { - brushType : 'both', - color : '#f08c2e', - strokeColor : '#5182ab', + nodeStyle: { + brushType: 'both', + color: '#f08c2e', + strokeColor: '#5182ab', lineWidth: 1 }, - linkStyle : { - strokeColor : '#5182ab' + linkStyle: { + strokeColor: '#5182ab' } }, emphasis: { @@ -1261,8 +1291,8 @@ define('echarts/config',[],function() { show: false // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE }, - nodeStyle : {}, - linkStyle : { + nodeStyle: {}, + linkStyle: { opacity: 0 } } @@ -1289,44 +1319,45 @@ define('echarts/config',[],function() { // }] }, - chord : { - radius : ['65%', '75%'], - center : ['50%', '50%'], - padding : 2, - sort : 'none', // can be 'none', 'ascending', 'descending' - sortSub : 'none', // can be 'none', 'ascending', 'descending' - startAngle : 90, - clockWise : true, - showScale : false, - showScaleText : false, - itemStyle : { - normal : { - label : { - show : true, + chord: { + clickable: true, + radius: ['65%', '75%'], + center: ['50%', '50%'], + padding: 2, + sort: 'none', // can be 'none', 'ascending', 'descending' + sortSub: 'none', // can be 'none', 'ascending', 'descending' + startAngle: 90, + clockWise: true, + showScale: false, + showScaleText: false, + itemStyle: { + normal: { + label: { + show: true, rotate: false, distance: 10 // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE }, - lineStyle : { - width : 0, - color : '#000' + lineStyle: { + width: 0, + color: '#000' }, - chordStyle : { - lineStyle : { - width : 1, - color : '#999' + chordStyle: { + lineStyle: { + width: 1, + color: '#999' } } }, - emphasis : { - lineStyle : { - width : 0, - color : '#000' + emphasis: { + lineStyle: { + width: 0, + color: '#000' }, - chordStyle : { - lineStyle : { - width : 1, - color : '#666' + chordStyle: { + lineStyle: { + width: 1, + color: '#666' } } } @@ -1346,14 +1377,14 @@ define('echarts/config',[],function() { * * Row based */ - matrix : [] + matrix: [ ] }, - gauge : { - center : ['50%', '50%'], // 默认全局居中 - radius : '75%', + gauge: { + center: ['50%', '50%'], // 默认全局居中 + radius: '75%', startAngle: 225, - endAngle : -45, + endAngle: -45, min: 0, // 最小值 max: 100, // 最大值 precision: 0, // 小数精度,默认为0,无小数点 @@ -1391,37 +1422,38 @@ define('echarts/config',[],function() { type: 'solid' } }, - pointer : { - show : true, - length : '80%', - width : 8, - color : 'auto' + pointer: { + show: true, + length: '80%', + width: 8, + color: 'auto' }, - title : { - show : true, - offsetCenter: [0, '-40%'], // x, y,单位px - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + title: { + show: true, + offsetCenter: [0, '-40%'], // x, y,单位px + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE color: '#333', - fontSize : 15 + fontSize: 15 } }, - detail : { - show : true, + detail: { + show: true, backgroundColor: 'rgba(0,0,0,0)', borderWidth: 0, borderColor: '#ccc', width: 100, height: 40, - offsetCenter: [0, '40%'], // x, y,单位px + offsetCenter: [0, '40%'], // x, y,单位px // formatter: null, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE color: 'auto', - fontSize : 30 + fontSize: 30 } } }, - funnel : { + funnel: { + clickable: true, x: 80, y: 60, x2: 80, @@ -1432,8 +1464,8 @@ define('echarts/config',[],function() { max: 100, minSize: '0%', maxSize: '100%', - sort : 'descending', // 'ascending', 'descending' - gap : 0, + sort: 'descending', // 'ascending', 'descending' + gap: 0, itemStyle: { normal: { // color: 各异, @@ -1474,30 +1506,31 @@ define('echarts/config',[],function() { calculateStep: 0.1 // 滚轮可计算步长 0.1 = 10% }, - markPoint : { + markPoint: { + clickable: true, symbol: 'pin', // 标注类型 symbolSize: 10, // 标注大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 - //symbolRotate : null, // 标注旋转控制 - large : false, - effect : { + // symbolRotate: null, // 标注旋转控制 + large: false, + effect: { show: false, loop: true, period: 15, // 运动周期,无单位,值越大越慢 - scaleSize : 2 // 放大倍数,以markPoint点size为基准 - // color : 'gold', - // shadowColor : 'rgba(255,215,0,0.8)', - // shadowBlur : 0 // 炫光模糊 + scaleSize: 2 // 放大倍数,以markPoint点size为基准 + // color: 'gold', + // shadowColor: 'rgba(255,215,0,0.8)', + // shadowBlur: 0 // 炫光模糊 }, itemStyle: { normal: { // color: 各异, - // borderColor: 各异, // 标注边线颜色,优先于color - borderWidth: 2, // 标注边线线宽,单位px,默认为1 + // borderColor: 各异, // 标注边线颜色,优先于color + borderWidth: 2, // 标注边线线宽,单位px,默认为1 label: { show: true, // 标签文本格式器,同Tooltip.formatter,不支持回调 - // formatter : null, - position: 'inside' // 可选为'left'|'right'|'top'|'bottom' + // formatter: null, + position: 'inside' // 可选为'left'|'right'|'top'|'bottom' // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE } }, @@ -1506,7 +1539,7 @@ define('echarts/config',[],function() { label: { show: true // 标签文本格式器,同Tooltip.formatter,不支持回调 - // formatter : null, + // formatter: null, // position: 'inside' // 'left'|'right'|'top'|'bottom' // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE } @@ -1514,33 +1547,34 @@ define('echarts/config',[],function() { } }, - markLine : { + markLine: { + clickable: true, // 标线起始和结束的symbol介绍类型,如果都一样,可以直接传string symbol: ['circle', 'arrow'], // 标线起始和结束的symbol大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 symbolSize: [2, 4], // 标线起始和结束的symbol旋转控制 - //symbolRotate : null, - //smooth : false, - large : false, - effect : { + //symbolRotate: null, + //smooth: false, + large: false, + effect: { show: false, loop: true, - period: 15, // 运动周期,无单位,值越大越慢 - scaleSize : 2 // 放大倍数,以markLine线lineWidth为基准 - // color : 'gold', - // shadowColor : 'rgba(255,215,0,0.8)', - // shadowBlur : lineWidth * 2 // 炫光模糊,默认等于scaleSize计算所得 + period: 15, // 运动周期,无单位,值越大越慢 + scaleSize: 2 // 放大倍数,以markLine线lineWidth为基准 + // color: 'gold', + // shadowColor: 'rgba(255,215,0,0.8)', + // shadowBlur: lineWidth * 2 // 炫光模糊,默认等于scaleSize计算所得 }, itemStyle: { normal: { - // color: 各异, // 标线主色,线色,symbol主色 + // color: 各异, // 标线主色,线色,symbol主色 // borderColor: 随color, // 标线symbol边框颜色,优先于color - borderWidth: 1.5, // 标线symbol边框线宽,单位px,默认为2 + borderWidth: 1.5, // 标线symbol边框线宽,单位px,默认为2 label: { show: true, // 标签文本格式器,同Tooltip.formatter,不支持回调 - // formatter : null, + // formatter: null, // 可选为 'start'|'end'|'left'|'right'|'top'|'bottom' position: 'end' // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE @@ -1549,7 +1583,7 @@ define('echarts/config',[],function() { // color: 随borderColor, // 主色,线色,优先级高于borderColor和color // width: 随borderWidth, // 优先于borderWidth type: 'dashed' - // shadowColor : 'rgba(0,0,0,0)', //默认透明 + // shadowColor: 'rgba(0,0,0,0)', //默认透明 // shadowBlur: 0, // shadowOffsetX: 0, // shadowOffsetY: 0 @@ -1560,11 +1594,11 @@ define('echarts/config',[],function() { label: { show: false // 标签文本格式器,同Tooltip.formatter,不支持回调 - // formatter : null, + // formatter: null, // position: 'inside' // 'left'|'right'|'top'|'bottom' // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE }, - lineStyle : {} + lineStyle: {} } } }, @@ -1585,7 +1619,9 @@ define('echarts/config',[],function() { RESTORE: 'restore', RESIZE: 'resize', CLICK: 'click', + DBLCLICK: 'dblclick', HOVER: 'hover', + MOUSEOUT: 'mouseout', //MOUSEWHEEL: 'mousewheel', // -------业务交互逻辑 DATA_CHANGED: 'dataChanged', @@ -1597,27 +1633,28 @@ define('echarts/config',[],function() { MAGIC_TYPE_CHANGED: 'magicTypeChanged', DATA_VIEW_CHANGED: 'dataViewChanged', TIMELINE_CHANGED: 'timelineChanged', - MAP_ROAM : 'mapRoam', + MAP_ROAM: 'mapRoam', // -------内部通信 TOOLTIP_HOVER: 'tooltipHover', TOOLTIP_IN_GRID: 'tooltipInGrid', - TOOLTIP_OUT_GRID: 'tooltipOutGrid' + TOOLTIP_OUT_GRID: 'tooltipOutGrid', + ROAMCONTROLLER: 'roamController' }, - DRAG_ENABLE_TIME : 120, // 降低图表内元素拖拽敏感度,单位ms,不建议外部干预 - EFFECT_ZLEVEL : 7, + DRAG_ENABLE_TIME: 120, // 降低图表内元素拖拽敏感度,单位ms,不建议外部干预 + EFFECT_ZLEVEL: 7, // 主题,默认标志图形类型列表 - symbolList : [ + symbolList: [ 'circle', 'rectangle', 'triangle', 'diamond', 'emptyCircle', 'emptyRectangle', 'emptyTriangle', 'emptyDiamond' ], - loadingText : 'Loading...', + loadingText: 'Loading...', // 可计算特性配置,孤岛,提示颜色 - calculable: false, // 默认关闭可计算特性 - calculableColor: 'rgba(255,165,0,0.6)', // 拖拽提示边框颜色 - calculableHolderColor: '#ccc', // 可计算占位提示颜色 + calculable: false, // 默认关闭可计算特性 + calculableColor: 'rgba(255,165,0,0.6)', // 拖拽提示边框颜色 + calculableHolderColor: '#ccc', // 可计算占位提示颜色 nameConnector: ' & ', - valueConnector: ' : ', - animation: true, + valueConnector: ': ', + animation: true, // 过渡动画是否开启 addDataAnimation: true, // 动态数据接口是否开启动画效果 animationThreshold: 2000, // 动画元素阀值,产生的图形原素超过2000不出动画 animationDuration: 2000, @@ -1660,7 +1697,7 @@ define('echarts/config',[],function() { // * Optimize. There is always room for speed improvements. // AMD by kener.linfeng@gmail.com -define('zrender/lib/excanvas',['require'],function(require) { +define('zrender/dep/excanvas',['require'],function(require) { // Only add this code if we do not already have a canvas implementation if (!document.createElement('canvas').getContext) { @@ -3086,7 +3123,7 @@ return G_vmlCanvasManager; * getContext:获取一个自由使用的canvas 2D context,使用原生方法,如isPointInPath,measureText等 */ define( - 'zrender/tool/util',['require','../lib/excanvas'],function(require) { + 'zrender/tool/util',['require','../dep/excanvas'],function(require) { // 用于处理merge时无法遍历Date等对象的问题 var BUILTIN_OBJECT = { '[object Function]': 1, @@ -3164,7 +3201,8 @@ define( function getContext() { if (!_ctx) { - require('../lib/excanvas'); + require('../dep/excanvas'); + /* jshint ignore:start */ if (G_vmlCanvasManager) { var _div = document.createElement('div'); _div.style.position = 'absolute'; @@ -3177,6 +3215,7 @@ define( else { _ctx = document.createElement('canvas').getContext('2d'); } + /* jshint ignore:end */ } return _ctx; } @@ -3258,11 +3297,11 @@ define( /** * 查询数组中元素的index */ - function indexOf(array, value){ + function indexOf(array, value) { if (array.indexOf) { return array.indexOf(value); } - for(var i = 0, len=array.length; i 3) { + args = Array.prototype.slice.call(args, 1); + } + + var _h = this._handlers[type]; + var len = _h.length; + for (var i = 0; i < len;) { + // Optimize advise from backbone + switch (argLen) { + case 1: + _h[i]['h'].call(_h[i]['ctx']); + break; + case 2: + _h[i]['h'].call(_h[i]['ctx'], args[1]); + break; + case 3: + _h[i]['h'].call(_h[i]['ctx'], args[1], args[2]); + break; + default: + // have more than 2 given arguments + _h[i]['h'].apply(_h[i]['ctx'], args); + break; + } + + if (_h[i]['one']) { + _h.splice(i, 1); + len--; + } + else { + i++; + } + } + } + + return this; + }; + + /** + * 带有context的事件分发, 最后一个参数是事件回调的context + * @param {string} type 事件类型 + */ + Eventful.prototype.dispatchWithContext = function (type) { + if (this._handlers[type]) { + var args = arguments; + var argLen = args.length; + + if (argLen > 4) { + args = Array.prototype.slice.call(args, 1, args.length - 1); + } + var ctx = args[args.length - 1]; + + var _h = this._handlers[type]; + var len = _h.length; + for (var i = 0; i < len;) { + // Optimize advise from backbone + switch (argLen) { + case 1: + _h[i]['h'].call(ctx); + break; + case 2: + _h[i]['h'].call(ctx, args[1]); + break; + case 3: + _h[i]['h'].call(ctx, args[1], args[2]); + break; + default: + // have more than 2 given arguments + _h[i]['h'].apply(ctx, args); + break; + } + + if (_h[i]['one']) { + _h.splice(i, 1); + len--; + } + else { + i++; + } + } + } + + return this; + }; + + // 对象可以通过 onxxxx 绑定事件 + /** + * @event module:zrender/mixin/Eventful#onclick + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#onmouseover + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#onmouseout + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#onmousemove + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#onmousewheel + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#onmousedown + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#onmouseup + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#ondragstart + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#ondragend + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#ondragenter + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#ondragleave + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#ondragover + * @type {Function} + * @default null + */ + /** + * @event module:zrender/mixin/Eventful#ondrop + * @type {Function} + * @default null + */ + + return Eventful; +}); + +/** + * 事件辅助类 + * @module zrender/tool/event * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * getX:获取事件横坐标 - * getY:或者事件纵坐标 - * getDelta:或者鼠标滚轮变化 - * stop:停止事件传播 - * Dispatcher:事件分发器 */ define( - 'zrender/tool/event',[],function() { + 'zrender/tool/event',['require','../mixin/Eventful'],function(require) { + var Eventful = require('../mixin/Eventful'); + /** * 提取鼠标(手指)x坐标 - * + * @memberOf module:zrender/tool/event * @param {Event} e 事件. * @return {number} 鼠标(手指)x坐标. */ @@ -3332,7 +3635,7 @@ define( /** * 提取鼠标y坐标 - * + * @memberOf module:zrender/tool/event * @param {Event} e 事件. * @return {number} 鼠标(手指)y坐标. */ @@ -3345,229 +3648,40 @@ define( /** * 提取鼠标滚轮变化 - * + * @memberOf module:zrender/tool/event * @param {Event} e 事件. * @return {number} 滚轮变化,正值说明滚轮是向上滚动,如果是负值说明滚轮是向下滚动 */ function getDelta(e) { - return typeof e.wheelDelta != 'undefined' && e.wheelDelta + return typeof e.zrenderDelta != 'undefined' && e.zrenderDelta + || typeof e.wheelDelta != 'undefined' && e.wheelDelta || typeof e.detail != 'undefined' && -e.detail; } /** * 停止冒泡和阻止默认行为 - * - * @type {Function} + * @memberOf module:zrender/tool/event + * @method * @param {Event} e : event对象 */ var stop = typeof window.addEventListener === 'function' ? function (e) { e.preventDefault(); e.stopPropagation(); + e.cancelBubble = true; } : function (e) { e.returnValue = false; e.cancelBubble = true; }; - - /** - * 事件分发器 - */ - function Dispatcher() { - this._handlers = {}; - } - /** - * 单次触发绑定,dispatch后销毁 - * - * @param {string} event 事件字符串 - * @param {Function} handler 响应函数 - * @param {Object} [context] - */ - Dispatcher.prototype.one = function(event, handler, context) { - - var _h = this._handlers; - - if(!handler || !event) { - return this; - } - - if(!_h[event]) { - _h[event] = []; - } - - _h[event].push({ - h : handler, - one : true, - ctx: context || this - }); - - return this; - }; - - /** - * 事件绑定 - * - * @param {string} event 事件字符串 - * @param {Function} handler : 响应函数 - * @param {Object} [context] - */ - Dispatcher.prototype.bind = function(event, handler, context) { - - var _h = this._handlers; - - if(!handler || !event) { - return this; - } - - if(!_h[event]) { - _h[event] = []; - } - - _h[event].push({ - h : handler, - one : false, - ctx: context || this - }); - - return this; - }; - - /** - * 事件解绑定 - * - * @param {string} event 事件字符串 - * @param {Function} handler : 响应函数 - */ - Dispatcher.prototype.unbind = function(event, handler) { - - var _h = this._handlers; - - if(!event) { - this._handlers = {}; - return this; - } - - if(handler) { - if(_h[event]) { - var newList = []; - for (var i = 0, l = _h[event].length; i < l; i++) { - if (_h[event][i]['h'] != handler) { - newList.push(_h[event][i]); - } - } - _h[event] = newList; - } - - if(_h[event] && _h[event].length === 0) { - delete _h[event]; - } - } - else { - delete _h[event]; - } - - return this; - }; - - /** - * 事件分发 - * - * @param {string} type : 事件类型 - */ - Dispatcher.prototype.dispatch = function(type) { - var args = arguments; - var argLen = args.length; - - if (argLen > 3) { - args = Array.prototype.slice.call(args, 1); - } - - if(this._handlers[type]) { - var _h = this._handlers[type]; - var len = _h.length; - for (var i = 0; i < len;) { - // Optimize advise from backbone - switch (argLen) { - case 1: - _h[i]['h'].call(_h[i]['ctx']); - break; - case 2: - _h[i]['h'].call(_h[i]['ctx'], args[1]); - break; - case 3: - _h[i]['h'].call(_h[i]['ctx'], args[1], args[2]); - break; - default: - // have more than 2 given arguments - _h[i]['h'].apply(_h[i]['ctx'], args); - break; - } - - if (_h[i]['one']) { - _h.splice(i, 1); - len--; - } else { - i++; - } - } - } - - return this; - }; - - /** - * 带有context的事件分发, 最后一个参数是事件回调的context - * - * @param {string} type : 事件类型 - */ - Dispatcher.prototype.dispatchWithContext = function(type) { - var args = arguments; - var argLen = args.length; - - if (argLen > 4) { - args = Array.prototype.slice.call(args, 1, args.length - 1); - } - var ctx = args[args.length - 1]; - - if(this._handlers[type]) { - var _h = this._handlers[type]; - var len = _h.length; - for (var i = 0; i < len;) { - // Optimize advise from backbone - switch (argLen) { - case 1: - _h[i]['h'].call(ctx); - break; - case 2: - _h[i]['h'].call(ctx, args[1]); - break; - case 3: - _h[i]['h'].call(ctx, args[1], args[2]); - break; - default: - // have more than 2 given arguments - _h[i]['h'].apply(ctx, args); - break; - } - - if (_h[i]['one']) { - _h.splice(i, 1); - len--; - } else { - i++; - } - } - } - - return this; - }; - + return { getX : getX, getY : getY, getDelta : getDelta, stop : stop, - Dispatcher : Dispatcher + // 做向上兼容 + Dispatcher : Eventful }; } ); @@ -3584,7 +3698,7 @@ define('zrender/tool/env',[],function() { // (c) 2010-2013 Thomas Fuchs // Zepto.js may be freely distributed under the MIT license. - function detect( ua ) { + function detect(ua) { var os = this.os = {}; var browser = this.browser = {}; var webkit = ua.match(/Web[kK]it[\/]{0,1}([\d.]+)/); @@ -3647,44 +3761,110 @@ define('zrender/tool/env',[],function() { // 原生canvas支持 canvasSupported : document.createElement('canvas').getContext ? true : false - } + }; } - return detect( navigator.userAgent ); + return detect(navigator.userAgent); }); -/** - * zrender: config默认配置项 - * - * @desc zrender是一个轻量级的Canvas类库,MVC封装,数据驱动,提供类Dom事件模型。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ -define( - 'zrender/config',{ - EVENT : { // 支持事件列表 - RESIZE : 'resize', // 窗口大小变化 - CLICK : 'click', // 鼠标按钮被(手指)按下,事件对象是:目标图形元素或空 - - MOUSEWHEEL : 'mousewheel', // 鼠标滚轮变化,事件对象是:目标图形元素或空 - MOUSEMOVE : 'mousemove', // 鼠标(手指)被移动,事件对象是:目标图形元素或空 - MOUSEOVER : 'mouseover', // 鼠标移到某图形元素之上,事件对象是:目标图形元素 - MOUSEOUT : 'mouseout', // 鼠标从某图形元素移开,事件对象是:目标图形元素 - MOUSEDOWN : 'mousedown', // 鼠标按钮(手指)被按下,事件对象是:目标图形元素或空 - MOUSEUP : 'mouseup', // 鼠标按键(手指)被松开,事件对象是:目标图形元素或空 - - // - GLOBALOUT : 'globalout', // 全局离开,MOUSEOUT触发比较频繁,一次离开优化绑定 +define('zrender/config',[],function () { + /** + * config默认配置项 + * @exports zrender/config + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + */ + var config = { + /** + * @namespace module:zrender/config.EVENT + */ + EVENT : { + /** + * 窗口大小变化 + * @type {string} + */ + RESIZE : 'resize', + /** + * 鼠标按钮被(手指)按下,事件对象是:目标图形元素或空 + * @type {string} + */ + CLICK : 'click', + /** + * 双击事件 + * @type {string} + */ + DBLCLICK : 'dblclick', + /** + * 鼠标滚轮变化,事件对象是:目标图形元素或空 + * @type {string} + */ + MOUSEWHEEL : 'mousewheel', + /** + * 鼠标(手指)被移动,事件对象是:目标图形元素或空 + * @type {string} + */ + MOUSEMOVE : 'mousemove', + /** + * 鼠标移到某图形元素之上,事件对象是:目标图形元素 + * @type {string} + */ + MOUSEOVER : 'mouseover', + /** + * 鼠标从某图形元素移开,事件对象是:目标图形元素 + * @type {string} + */ + MOUSEOUT : 'mouseout', + /** + * 鼠标按钮(手指)被按下,事件对象是:目标图形元素或空 + * @type {string} + */ + MOUSEDOWN : 'mousedown', + /** + * 鼠标按键(手指)被松开,事件对象是:目标图形元素或空 + * @type {string} + */ + MOUSEUP : 'mouseup', + /** + * 全局离开,MOUSEOUT触发比较频繁,一次离开优化绑定 + * @type {string} + */ + GLOBALOUT : 'globalout', // // 一次成功元素拖拽的行为事件过程是: // dragstart > dragenter > dragover [> dragleave] > drop > dragend - DRAGSTART : 'dragstart', // 开始拖拽时触发,事件对象是:被拖拽图形元素 - DRAGEND : 'dragend', // 拖拽完毕时触发(在drop之后触发),事件对象是:被拖拽图形元素 - DRAGENTER : 'dragenter', // 拖拽图形元素进入目标图形元素时触发,事件对象是:目标图形元素 - DRAGOVER : 'dragover', // 拖拽图形元素在目标图形元素上移动时触发,事件对象是:目标图形元素 - DRAGLEAVE : 'dragleave', // 拖拽图形元素离开目标图形元素时触发,事件对象是:目标图形元素 - DROP : 'drop', // 拖拽图形元素放在目标图形元素内时触发,事件对象是:目标图形元素 - - touchClickDelay : 300 // touch end - start < delay is click + /** + * 开始拖拽时触发,事件对象是:被拖拽图形元素 + * @type {string} + */ + DRAGSTART : 'dragstart', + /** + * 拖拽完毕时触发(在drop之后触发),事件对象是:被拖拽图形元素 + * @type {string} + */ + DRAGEND : 'dragend', + /** + * 拖拽图形元素进入目标图形元素时触发,事件对象是:目标图形元素 + * @type {string} + */ + DRAGENTER : 'dragenter', + /** + * 拖拽图形元素在目标图形元素上移动时触发,事件对象是:目标图形元素 + * @type {string} + */ + DRAGOVER : 'dragover', + /** + * 拖拽图形元素离开目标图形元素时触发,事件对象是:目标图形元素 + * @type {string} + */ + DRAGLEAVE : 'dragleave', + /** + * 拖拽图形元素放在目标图形元素内时触发,事件对象是:目标图形元素 + * @type {string} + */ + DROP : 'drop', + /** + * touch end - start < delay is click + * @type {number} + */ + touchClickDelay : 300 }, // 是否异常捕获 @@ -3697,18 +3877,19 @@ define( * 2 : 控制台输出,调试用 */ debugMode: 0 - } -); -/** - * zrender: 日志记录 - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - */ + }; + return config; +}); + define( 'zrender/tool/log',['require','../config'],function (require) { var config = require('../config'); + /** + * @exports zrender/tool/log + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + */ return function() { if (config.debugMode === 0) { return; @@ -3752,15 +3933,450 @@ define( } ); +define( + 'zrender/tool/vector',[],function () { + var ArrayCtor = typeof Float32Array === 'undefined' + ? Array + : Float32Array; + /** + * 二维向量类 + * @exports zrender/tool/vector + */ + var vector = { + /** + * 创建一个向量 + * @param {number} [x=0] + * @param {number} [y=0] + * @return {Float32Array|Array.} + */ + create: function (x, y) { + var out = new ArrayCtor(2); + out[0] = x || 0; + out[1] = y || 0; + return out; + }, + + /** + * 复制一个向量 + * @return {Float32Array|Array.} out + * @return {Float32Array|Array.} v + */ + copy: function (out, v) { + out[0] = v[0]; + out[1] = v[1]; + return out; + }, + + /** + * 设置向量的两个项 + * @param {Float32Array|Array.} out + * @param {number} a + * @param {number} b + * @return {Float32Array|Array.} 结果 + */ + set: function (out, a, b) { + out[0] = a; + out[1] = b; + return out; + }, + + /** + * 向量相加 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + */ + add: function (out, v1, v2) { + out[0] = v1[0] + v2[0]; + out[1] = v1[1] + v2[1]; + return out; + }, + + /** + * 向量缩放后相加 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + * @param {number} a + */ + scaleAndAdd: function (out, v1, v2, a) { + out[0] = v1[0] + v2[0] * a; + out[1] = v1[1] + v2[1] * a; + return out; + }, + + /** + * 向量相减 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + */ + sub: function (out, v1, v2) { + out[0] = v1[0] - v2[0]; + out[1] = v1[1] - v2[1]; + return out; + }, + + /** + * 向量长度 + * @param {Float32Array|Array.} v + * @return {number} + */ + len: function (v) { + return Math.sqrt(this.lenSquare(v)); + }, + + /** + * 向量长度平方 + * @param {Float32Array|Array.} v + * @return {number} + */ + lenSquare: function (v) { + return v[0] * v[0] + v[1] * v[1]; + }, + + /** + * 向量乘法 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + */ + mul: function (out, v1, v2) { + out[0] = v1[0] * v2[0]; + out[1] = v1[1] * v2[1]; + return out; + }, + + /** + * 向量除法 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + */ + div: function (out, v1, v2) { + out[0] = v1[0] / v2[0]; + out[1] = v1[1] / v2[1]; + return out; + }, + + /** + * 向量点乘 + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + * @return {number} + */ + dot: function (v1, v2) { + return v1[0] * v2[0] + v1[1] * v2[1]; + }, + + /** + * 向量缩放 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v + * @param {number} s + */ + scale: function (out, v, s) { + out[0] = v[0] * s; + out[1] = v[1] * s; + return out; + }, + + /** + * 向量归一化 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v + */ + normalize: function (out, v) { + var d = vector.len(v); + if (d === 0) { + out[0] = 0; + out[1] = 0; + } + else { + out[0] = v[0] / d; + out[1] = v[1] / d; + } + return out; + }, + + /** + * 计算向量间距离 + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + * @return {number} + */ + distance: function (v1, v2) { + return Math.sqrt( + (v1[0] - v2[0]) * (v1[0] - v2[0]) + + (v1[1] - v2[1]) * (v1[1] - v2[1]) + ); + }, + + /** + * 向量距离平方 + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + * @return {number} + */ + distanceSquare: function (v1, v2) { + return (v1[0] - v2[0]) * (v1[0] - v2[0]) + + (v1[1] - v2[1]) * (v1[1] - v2[1]); + }, + + /** + * 求负向量 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v + */ + negate: function (out, v) { + out[0] = -v[0]; + out[1] = -v[1]; + return out; + }, + + /** + * 插值两个点 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + * @param {number} t + */ + lerp: function (out, v1, v2, t) { + // var ax = v1[0]; + // var ay = v1[1]; + out[0] = v1[0] + t * (v2[0] - v1[0]); + out[1] = v1[1] + t * (v2[1] - v1[1]); + return out; + }, + + /** + * 矩阵左乘向量 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v + * @param {Float32Array|Array.} m + */ + applyTransform: function (out, v, m) { + var x = v[0]; + var y = v[1]; + out[0] = m[0] * x + m[2] * y + m[4]; + out[1] = m[1] * x + m[3] * y + m[5]; + return out; + }, + /** + * 求两个向量最小值 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + */ + min: function (out, v1, v2) { + out[0] = Math.min(v1[0], v2[0]); + out[1] = Math.min(v1[1], v2[1]); + return out; + }, + /** + * 求两个向量最大值 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} v1 + * @param {Float32Array|Array.} v2 + */ + max: function (out, v1, v2) { + out[0] = Math.max(v1[0], v2[0]); + out[1] = Math.max(v1[1], v2[1]); + return out; + } + }; + + vector.length = vector.len; + vector.lengthSquare = vector.lenSquare; + vector.dist = vector.distance; + vector.distSquare = vector.distanceSquare; + + return vector; + } +); + +define( + 'zrender/tool/matrix',[],function () { + + var ArrayCtor = typeof Float32Array === 'undefined' + ? Array + : Float32Array; + /** + * 3x2矩阵操作类 + * @exports zrender/tool/matrix + */ + var matrix = { + /** + * 创建一个单位矩阵 + * @return {Float32Array|Array.} + */ + create : function() { + var out = new ArrayCtor(6); + matrix.identity(out); + + return out; + }, + /** + * 设置矩阵为单位矩阵 + * @param {Float32Array|Array.} out + */ + identity : function(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = 0; + out[5] = 0; + return out; + }, + /** + * 复制矩阵 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} m + */ + copy: function(out, m) { + out[0] = m[0]; + out[1] = m[1]; + out[2] = m[2]; + out[3] = m[3]; + out[4] = m[4]; + out[5] = m[5]; + return out; + }, + /** + * 矩阵相乘 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} m1 + * @param {Float32Array|Array.} m2 + */ + mul : function (out, m1, m2) { + out[0] = m1[0] * m2[0] + m1[2] * m2[1]; + out[1] = m1[1] * m2[0] + m1[3] * m2[1]; + out[2] = m1[0] * m2[2] + m1[2] * m2[3]; + out[3] = m1[1] * m2[2] + m1[3] * m2[3]; + out[4] = m1[0] * m2[4] + m1[2] * m2[5] + m1[4]; + out[5] = m1[1] * m2[4] + m1[3] * m2[5] + m1[5]; + return out; + }, + /** + * 平移变换 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} a + * @param {Float32Array|Array.} v + */ + translate : function(out, a, v) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4] + v[0]; + out[5] = a[5] + v[1]; + return out; + }, + /** + * 旋转变换 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} a + * @param {number} rad + */ + rotate : function(out, a, rad) { + var aa = a[0]; + var ac = a[2]; + var atx = a[4]; + var ab = a[1]; + var ad = a[3]; + var aty = a[5]; + var st = Math.sin(rad); + var ct = Math.cos(rad); + + out[0] = aa * ct + ab * st; + out[1] = -aa * st + ab * ct; + out[2] = ac * ct + ad * st; + out[3] = -ac * st + ct * ad; + out[4] = ct * atx + st * aty; + out[5] = ct * aty - st * atx; + return out; + }, + /** + * 缩放变换 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} a + * @param {Float32Array|Array.} v + */ + scale : function(out, a, v) { + var vx = v[0]; + var vy = v[1]; + out[0] = a[0] * vx; + out[1] = a[1] * vy; + out[2] = a[2] * vx; + out[3] = a[3] * vy; + out[4] = a[4] * vx; + out[5] = a[5] * vy; + return out; + }, + /** + * 求逆矩阵 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} a + */ + invert : function(out, a) { + + var aa = a[0]; + var ac = a[2]; + var atx = a[4]; + var ab = a[1]; + var ad = a[3]; + var aty = a[5]; + + var det = aa * ad - ab * ac; + if (!det) { + return null; + } + det = 1.0 / det; + + out[0] = ad * det; + out[1] = -ab * det; + out[2] = -ac * det; + out[3] = aa * det; + out[4] = (ac * aty - ad * atx) * det; + out[5] = (ab * atx - aa * aty) * det; + return out; + }, + + /** + * 矩阵左乘向量 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} a + * @param {Float32Array|Array.} v + */ + mulVector : function(out, a, v) { + var aa = a[0]; + var ac = a[2]; + var atx = a[4]; + var ab = a[1]; + var ad = a[3]; + var aty = a[5]; + + out[0] = v[0] * aa + v[1] * ac + atx; + out[1] = v[0] * ab + v[1] * ad + aty; + + return out; + } + }; + + return matrix; + } +); + /** * Handler控制模块 - * + * @module zrender/Handler * @author Kener (@Kener-林峰, linzhifeng@baidu.com) * errorrik (errorrik@gmail.com) */ define( - 'zrender/Handler',['require','./config','./tool/env','./tool/event','./tool/util'],function (require) { + 'zrender/Handler',['require','./config','./tool/env','./tool/event','./tool/util','./tool/vector','./tool/matrix','./mixin/Eventful'],function (require) { @@ -3768,10 +4384,14 @@ define( var env = require('./tool/env'); var eventTool = require('./tool/event'); var util = require('./tool/util'); + var vec2 = require('./tool/vector'); + var mat2d = require('./tool/matrix'); var EVENT = config.EVENT; + var Eventful = require('./mixin/Eventful'); + var domHandlerNames = [ - 'resize', 'click', + 'resize', 'click', 'dblclick', 'mousewheel', 'mousemove', 'mouseout', 'mouseup', 'mousedown', 'touchstart', 'touchend', 'touchmove' ]; @@ -3779,8 +4399,8 @@ define( var domHandlers = { /** * 窗口大小改变响应函数 - * - * @param {event} event dom事件对象 + * @inner + * @param {Event} event */ resize: function (event) { event = event || window.event; @@ -3793,15 +4413,15 @@ define( /** * 点击响应函数 - * - * @param {event} event dom事件对象 + * @inner + * @param {Event} event */ click: function (event) { event = this._zrenderEventFixed(event); - //分发config.EVENT.CLICK事件 + // 分发config.EVENT.CLICK事件 var _lastHover = this._lastHover; - if (( _lastHover && _lastHover.clickable ) + if ((_lastHover && _lastHover.clickable) || !_lastHover ) { this._dispatchAgency(_lastHover, EVENT.CLICK, event); @@ -3809,24 +4429,81 @@ define( this._mousemoveHandler(event); }, + + /** + * 双击响应函数 + * @inner + * @param {Event} event + */ + dblclick: function (event) { + event = this._zrenderEventFixed(event); + + // 分发config.EVENT.DBLCLICK事件 + var _lastHover = this._lastHover; + if ((_lastHover && _lastHover.clickable) + || !_lastHover + ) { + this._dispatchAgency(_lastHover, EVENT.DBLCLICK, event); + } + + this._mousemoveHandler(event); + }, + /** * 鼠标滚轮响应函数 - * - * @param {event} event dom事件对象 + * @inner + * @param {Event} event */ mousewheel: function (event) { event = this._zrenderEventFixed(event); - //分发config.EVENT.MOUSEWHEEL事件 + // http://www.sitepoint.com/html5-javascript-mouse-wheel/ + // https://developer.mozilla.org/en-US/docs/DOM/DOM_event_reference/mousewheel + var delta = event.wheelDelta // Webkit + || -event.detail; // Firefox + var scale = delta > 0 ? 1.1 : 1 / 1.1; + + var layers = this.painter.getLayers(); + + var needsRefresh = false; + for (var z in layers) { + if (z !== 'hover') { + var layer = layers[z]; + var pos = layer.position; + if (layer.zoomable) { + layer.__zoom = layer.__zoom || 1; + var newZoom = layer.__zoom; + newZoom *= scale; + newZoom = Math.max( + Math.min(layer.maxZoom, newZoom), + layer.minZoom + ); + scale = newZoom / layer.__zoom; + layer.__zoom = newZoom; + // Keep the mouse center when scaling + pos[0] -= (this._mouseX - pos[0]) * (scale - 1); + pos[1] -= (this._mouseY - pos[1]) * (scale - 1); + layer.scale[0] *= scale; + layer.scale[1] *= scale; + layer.dirty = true; + needsRefresh = true; + } + } + } + if (needsRefresh) { + this.painter.refresh(); + } + + // 分发config.EVENT.MOUSEWHEEL事件 this._dispatchAgency(this._lastHover, EVENT.MOUSEWHEEL, event); this._mousemoveHandler(event); }, /** * 鼠标(手指)移动响应函数 - * - * @param {event} event dom事件对象 + * @inner + * @param {Event} event */ mousemove: function (event) { if (this.painter.isLoading()) { @@ -3838,15 +4515,18 @@ define( this._lastY = this._mouseY; this._mouseX = eventTool.getX(event); this._mouseY = eventTool.getY(event); + var dx = this._mouseX - this._lastX; + var dy = this._mouseY - this._lastY; // 可能出现config.EVENT.DRAGSTART事件 // 避免手抖点击误认为拖拽 - //if (this._mouseX - this._lastX > 1 || this._mouseY - this._lastY > 1) { - this._processDragStart(event); - //} + // if (this._mouseX - this._lastX > 1 || this._mouseY - this._lastY > 1) { + this._processDragStart(event); + // } this._hasfound = 0; this._event = event; - this.storage.iterShape(this._findHover, { normal: 'down'}); + + this._iterateAndFindHover(); // 找到的在迭代函数里做了处理,没找到得在迭代完后处理 if (!this._hasfound) { @@ -3865,18 +4545,39 @@ define( this.storage.delHover(); this.painter.clearHover(); } - //如果存在拖拽中元素,被拖拽的图形元素最后addHover + + // set cursor for root element + var cursor = 'default'; + + // 如果存在拖拽中元素,被拖拽的图形元素最后addHover if (this._draggingTarget) { - this.storage.drift( - this._draggingTarget.id, - this._mouseX - this._lastX, - this._mouseY - this._lastY - ); + this.storage.drift(this._draggingTarget.id, dx, dy); this.storage.addHover(this._draggingTarget); } + else if (this._isMouseDown) { + // Layer dragging + var layers = this.painter.getLayers(); + + var needsRefresh = false; + for (var z in layers) { + if (z !== 'hover') { + var layer = layers[z]; + if (layer.panable) { + // PENDING + cursor = 'move'; + // Keep the mouse center when scaling + layer.position[0] += dx; + layer.position[1] += dy; + needsRefresh = true; + layer.dirty = true; + } + } + } + if (needsRefresh) { + this.painter.refresh(); + } + } - // set cursor for root element - var cursor = 'default'; if (this._draggingTarget || (this._hasfound && this._lastHover.draggable)) { cursor = 'move'; } @@ -3895,8 +4596,8 @@ define( /** * 鼠标(手指)离开响应函数 - * - * @param {event} event dom事件对象 + * @inner + * @param {Event} event */ mouseout: function (event) { event = this._zrenderEventFixed(event); @@ -3931,8 +4632,8 @@ define( /** * 鼠标(手指)按下响应函数 - * - * @param {event} event dom事件对象 + * @inner + * @param {Event} event */ mousedown: function (event) { if (this._lastDownButton == 2) { @@ -3946,7 +4647,7 @@ define( event = this._zrenderEventFixed(event); this._isMouseDown = 1; - //分发config.EVENT.MOUSEDOWN事件 + // 分发config.EVENT.MOUSEDOWN事件 this._mouseDownTarget = this._lastHover; this._dispatchAgency(this._lastHover, EVENT.MOUSEDOWN, event); this._lastDownButton = event.button; @@ -3954,16 +4655,16 @@ define( /** * 鼠标(手指)抬起响应函数 - * - * @param {event} event dom事件对象 + * @inner + * @param {Event} event */ - mouseup:function (event) { + mouseup: function (event) { event = this._zrenderEventFixed(event); this.root.style.cursor = 'default'; this._isMouseDown = 0; this._mouseDownTarget = null; - //分发config.EVENT.MOUSEUP事件 + // 分发config.EVENT.MOUSEUP事件 this._dispatchAgency(this._lastHover, EVENT.MOUSEUP, event); this._processDrop(event); this._processDragEnd(event); @@ -3971,23 +4672,23 @@ define( /** * Touch开始响应函数 - * - * @param {event} event dom事件对象 + * @inner + * @param {Event} event */ touchstart: function (event) { - //eventTool.stop(event);// 阻止浏览器默认事件,重要 + // eventTool.stop(event);// 阻止浏览器默认事件,重要 event = this._zrenderEventFixed(event, true); this._lastTouchMoment = new Date(); - //平板补充一次findHover + // 平板补充一次findHover this._mobildFindFixed(event); this._mousedownHandler(event); }, /** * Touch移动响应函数 - * - * @param {event} event dom事件对象 + * @inner + * @param {Event} event */ touchmove: function (event) { event = this._zrenderEventFixed(event, true); @@ -3999,17 +4700,25 @@ define( /** * Touch结束响应函数 - * - * @param {event} event dom事件对象 + * @inner + * @param {Event} event */ touchend: function (event) { - //eventTool.stop(event);// 阻止浏览器默认事件,重要 + // eventTool.stop(event);// 阻止浏览器默认事件,重要 event = this._zrenderEventFixed(event, true); this._mouseupHandler(event); - - if (new Date() - this._lastTouchMoment < EVENT.touchClickDelay) { + + var now = new Date(); + if (now - this._lastTouchMoment < EVENT.touchClickDelay) { this._mobildFindFixed(event); this._clickHandler(event); + if (now - this._lastClickMoment < EVENT.touchClickDelay / 2) { + this._dblclickHandler(event); + if (this._lastHover && this._lastHover.clickable) { + eventTool.stop(event);// 阻止浏览器默认事件,重要 + } + } + this._lastClickMoment = now; } this.painter.clearHover(); } @@ -4023,38 +4732,47 @@ define( * @param {Object} context 运行时this环境 * @return {Function} */ - function bind1Arg( handler, context ) { - return function ( e ) { - return handler.call( context, e ); + function bind1Arg(handler, context) { + return function (e) { + return handler.call(context, e); }; } + /**function bind2Arg(handler, context) { + return function (arg1, arg2) { + return handler.call(context, arg1, arg2); + }; + }*/ + function bind3Arg(handler, context) { + return function (arg1, arg2, arg3) { + return handler.call(context, arg1, arg2, arg3); + }; + } /** * 为控制类实例初始化dom 事件处理函数 * * @inner - * @param {Handler} instance 控制类实例 + * @param {module:zrender/Handler} instance 控制类实例 */ - function initDomHandler( instance ) { + function initDomHandler(instance) { var len = domHandlerNames.length; - while ( len-- ) { - var name = domHandlerNames[ len ]; - instance[ '_' + name + 'Handler' ] = bind1Arg( domHandlers[ name ], instance ); + while (len--) { + var name = domHandlerNames[len]; + instance['_' + name + 'Handler'] = bind1Arg(domHandlers[name], instance); } } /** - * 控制类 (C) - * + * @alias module:zrender/Handler + * @constructor + * @extends module:zrender/mixin/Eventful * @param {HTMLElement} root 绘图区域 - * @param {storage} storage Storage实例 - * @param {painter} painter Painter实例 - * - * 分发事件支持详见config.EVENT + * @param {module:zrender/Storage} storage Storage实例 + * @param {module:zrender/Painter} painter Painter实例 */ - function Handler(root, storage, painter) { + var Handler = function(root, storage, painter) { // 添加事件分发器特性 - eventTool.Dispatcher.call(this); + Eventful.call(this); this.root = root; this.storage = storage; @@ -4076,7 +4794,7 @@ define( this._mouseX = this._mouseY = 0; - this._findHover = bind1Arg(findHover, this); + this._findHover = bind3Arg(findHover, this); this._domHover = painter.getDomHover(); initDomHandler(this); @@ -4093,6 +4811,7 @@ define( else { // mobile的click/move/up/down自己模拟 root.addEventListener('click', this._clickHandler); + root.addEventListener('dblclick', this._dblclickHandler); root.addEventListener('mousewheel', this._mousewheelHandler); root.addEventListener('mousemove', this._mousemoveHandler); root.addEventListener('mousedown', this._mousedownHandler); @@ -4105,13 +4824,14 @@ define( window.attachEvent('onresize', this._resizeHandler); root.attachEvent('onclick', this._clickHandler); + root.attachEvent('ondblclick ', this._dblclickHandler); root.attachEvent('onmousewheel', this._mousewheelHandler); root.attachEvent('onmousemove', this._mousemoveHandler); root.attachEvent('onmouseout', this._mouseoutHandler); root.attachEvent('onmousedown', this._mousedownHandler); root.attachEvent('onmouseup', this._mouseupHandler); } - } + }; /** * 自定义事件绑定 @@ -4142,6 +4862,7 @@ define( switch (eventName) { case EVENT.RESIZE: case EVENT.CLICK: + case EVENT.DBLCLICK: case EVENT.MOUSEWHEEL: case EVENT.MOUSEMOVE: case EVENT.MOUSEDOWN: @@ -4153,7 +4874,7 @@ define( }; /** - * 释放 + * 释放,解绑所有事件 */ Handler.prototype.dispose = function () { var root = this.root; @@ -4170,6 +4891,7 @@ define( else { // mobile的click自己模拟 root.removeEventListener('click', this._clickHandler); + root.removeEventListener('dblclick', this._dblclickHandler); root.removeEventListener('mousewheel', this._mousewheelHandler); root.removeEventListener('mousemove', this._mousemoveHandler); root.removeEventListener('mousedown', this._mousedownHandler); @@ -4182,6 +4904,7 @@ define( window.detachEvent('onresize', this._resizeHandler); root.detachEvent('onclick', this._clickHandler); + root.detachEvent('dblclick', this._dblclickHandler); root.detachEvent('onmousewheel', this._mousewheelHandler); root.detachEvent('onmousemove', this._mousemoveHandler); root.detachEvent('onmouseout', this._mouseoutHandler); @@ -4226,7 +4949,7 @@ define( _draggingTarget.invisible = true; this.storage.mod(_draggingTarget.id); - //分发config.EVENT.DRAGSTART事件 + // 分发config.EVENT.DRAGSTART事件 this._dispatchAgency( _draggingTarget, EVENT.DRAGSTART, @@ -4244,7 +4967,7 @@ define( */ Handler.prototype._processDragEnter = function (event) { if (this._draggingTarget) { - //分发config.EVENT.DRAGENTER事件 + // 分发config.EVENT.DRAGENTER事件 this._dispatchAgency( this._lastHover, EVENT.DRAGENTER, @@ -4262,7 +4985,7 @@ define( */ Handler.prototype._processDragOver = function (event) { if (this._draggingTarget) { - //分发config.EVENT.DRAGOVER事件 + // 分发config.EVENT.DRAGOVER事件 this._dispatchAgency( this._lastHover, EVENT.DRAGOVER, @@ -4280,7 +5003,7 @@ define( */ Handler.prototype._processDragLeave = function (event) { if (this._draggingTarget) { - //分发config.EVENT.DRAGLEAVE事件 + // 分发config.EVENT.DRAGLEAVE事件 this._dispatchAgency( this._lastHover, EVENT.DRAGLEAVE, @@ -4302,7 +5025,7 @@ define( this.storage.mod(this._draggingTarget.id); this.painter.refresh(); - //分发config.EVENT.DROP事件 + // 分发config.EVENT.DROP事件 this._dispatchAgency( this._lastHover, EVENT.DROP, @@ -4320,7 +5043,7 @@ define( */ Handler.prototype._processDragEnd = function (event) { if (this._draggingTarget) { - //分发config.EVENT.DRAGEND事件 + // 分发config.EVENT.DRAGEND事件 this._dispatchAgency( this._draggingTarget, EVENT.DRAGEND, @@ -4341,7 +5064,7 @@ define( * @param {Object} event 事件对象 */ Handler.prototype._processOverShape = function (event) { - //分发config.EVENT.MOUSEOVER事件 + // 分发config.EVENT.MOUSEOVER事件 this._dispatchAgency(this._lastHover, EVENT.MOUSEOVER, event); }; @@ -4352,7 +5075,7 @@ define( * @param {Object} event 事件对象 */ Handler.prototype._processOutShape = function (event) { - //分发config.EVENT.MOUSEOUT事件 + // 分发config.EVENT.MOUSEOUT事件 this._dispatchAgency(this._lastHover, EVENT.MOUSEOUT, event); }; @@ -4381,7 +5104,8 @@ define( } while (el) { - el[eventHandler] && el[eventHandler](eventPacket); + el[eventHandler] + && (eventPacket.cancelBubble = el[eventHandler](eventPacket)); el.dispatch(eventName, eventPacket); el = el.parent; @@ -4398,20 +5122,53 @@ define( } } else if (!draggedShape) { - //无hover目标,无拖拽对象,原生事件分发 + // 无hover目标,无拖拽对象,原生事件分发 this.dispatch(eventName, { type: eventName, event: event }); } }; + + /** + * 迭代寻找hover shape + * @private + * @method + */ + Handler.prototype._iterateAndFindHover = (function() { + var invTransform = mat2d.create(); + return function() { + var list = this.storage.getShapeList(); + var currentZLevel; + var currentLayer; + var tmp = [ 0, 0 ]; + for (var i = list.length - 1; i >= 0 ; i--) { + var shape = list[i]; + + if (currentZLevel !== shape.zlevel) { + currentLayer = this.painter.getLayer(shape.zlevel, currentLayer); + tmp[0] = this._mouseX; + tmp[1] = this._mouseY; + + if (currentLayer.needTransform) { + mat2d.invert(invTransform, currentLayer.transform); + vec2.applyTransform(tmp, tmp, invTransform); + } + } + + if (this._findHover(shape, tmp[0], tmp[1])) { + break; + } + } + }; + })(); // touch指尖错觉的尝试偏移量配置 var MOBILE_TOUCH_OFFSETS = [ { x: 10 }, { x: -20 }, - { x: 10, y: 10}, - { y: -20} + { x: 10, y: 10 }, + { y: -20 } ]; // touch有指尖错觉,四向尝试,让touch上的点击更好触发事件 @@ -4421,12 +5178,15 @@ define( this._mouseY = event.zrenderY; this._event = event; - this.storage.iterShape(this._findHover, { normal: 'down'}); - for ( var i = 0; !this._lastHover && i < MOBILE_TOUCH_OFFSETS.length ; i++ ) { + + this._iterateAndFindHover(); + + for (var i = 0; !this._lastHover && i < MOBILE_TOUCH_OFFSETS.length ; i++) { var offset = MOBILE_TOUCH_OFFSETS[ i ]; - offset.x && ( this._mouseX += offset.x ); - offset.y && ( this._mouseX += offset.y ); - this.storage.iterShape(this._findHover, { normal: 'down'}); + offset.x && (this._mouseX += offset.x); + offset.y && (this._mouseX += offset.y); + + this._iterateAndFindHover(); } if (this._lastHover) { @@ -4438,19 +5198,21 @@ define( /** * 迭代函数,查找hover到的图形元素并即时做些事件分发 * - * @private - * @param {Object} e 图形元素 + * @inner + * @param {Object} shape 图形元素 + * @param {number} x + * @param {number} y */ - function findHover(shape) { + function findHover(shape, x, y) { if ( - ( this._draggingTarget && this._draggingTarget.id == shape.id ) //迭代到当前拖拽的图形上 + (this._draggingTarget && this._draggingTarget.id == shape.id) // 迭代到当前拖拽的图形上 || shape.isSilent() // 打酱油的路过,啥都不响应的shape~ ) { return false; } var event = this._event; - if (shape.isCover(this._mouseX, this._mouseY)) { + if (shape.isCover(x, y)) { if (shape.hoverable) { this.storage.addHover(shape); } @@ -4467,23 +5229,23 @@ define( if (this._lastHover != shape) { this._processOutShape(event); - //可能出现config.EVENT.DRAGLEAVE事件 + // 可能出现config.EVENT.DRAGLEAVE事件 this._processDragLeave(event); this._lastHover = shape; - //可能出现config.EVENT.DRAGENTER事件 + // 可能出现config.EVENT.DRAGENTER事件 this._processDragEnter(event); } this._processOverShape(event); - //可能出现config.EVENT.DRAGOVER + // 可能出现config.EVENT.DRAGOVER this._processDragOver(event); this._hasfound = 1; - return true; //找到则中断迭代查找 + return true; // 找到则中断迭代查找 } return false; @@ -4495,7 +5257,7 @@ define( * @private */ Handler.prototype._zrenderEventFixed = function (event, isTouch) { - if ( event.zrenderFixed ) { + if (event.zrenderFixed) { return event; } @@ -4534,3088 +5296,3358 @@ define( return event; }; - util.merge(Handler.prototype, eventTool.Dispatcher.prototype, true); + util.merge(Handler.prototype, Eventful.prototype, true); return Handler; } ); /** - * zrender: 3x2矩阵操作类 - * - * author: https://github.com/pissang + * @module zrender/tool/curve + * @author pissang(https://www.github.com/pissang) */ +define('zrender/tool/curve',['require','./vector'],function(require) { -define( - 'zrender/tool/matrix',[],function() { - - var ArrayCtor = typeof Float32Array === 'undefined' - ? Array - : Float32Array; - - var matrix = { - create : function() { - var out = new ArrayCtor(6); - matrix.identity(out); - - return out; - }, - identity : function(out) { - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 1; - out[4] = 0; - out[5] = 0; - }, - copy: function(out, m) { - out[0] = m[0]; - out[1] = m[1]; - out[2] = m[2]; - out[3] = m[3]; - out[4] = m[4]; - out[5] = m[5]; - }, - mul : function(out, m1, m2) { - out[0] = m1[0] * m2[0] + m1[2] * m2[1]; - out[1] = m1[1] * m2[0] + m1[3] * m2[1]; - out[2] = m1[0] * m2[2] + m1[2] * m2[3]; - out[3] = m1[1] * m2[2] + m1[3] * m2[3]; - out[4] = m1[0] * m2[4] + m1[2] * m2[5] + m1[4]; - out[5] = m1[1] * m2[4] + m1[3] * m2[5] + m1[5]; - return out; - }, - translate : function(out, a, v) { - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4] + v[0]; - out[5] = a[5] + v[1]; - return out; - }, - rotate : function(out, a, rad) { - var aa = a[0], ac = a[2], atx = a[4]; - var ab = a[1], ad = a[3], aty = a[5]; - var st = Math.sin(rad); - var ct = Math.cos(rad); - - out[0] = aa*ct + ab*st; - out[1] = -aa*st + ab*ct; - out[2] = ac*ct + ad*st; - out[3] = -ac*st + ct*ad; - out[4] = ct*atx + st*aty; - out[5] = ct*aty - st*atx; - return out; - }, - scale : function(out, a, v) { - var vx = v[0], vy = v[1]; - out[0] = a[0] * vx; - out[1] = a[1] * vy; - out[2] = a[2] * vx; - out[3] = a[3] * vy; - out[4] = a[4] * vx; - out[5] = a[5] * vy; - return out; - }, - /** - * 求逆矩阵 - */ - invert : function(out, a) { - - var aa = a[0], ac = a[2], atx = a[4]; - var ab = a[1], ad = a[3], aty = a[5]; - - var det = aa * ad - ab * ac; - if(!det){ - return null; - } - det = 1.0 / det; + var vector = require('./vector'); - out[0] = ad * det; - out[1] = -ab * det; - out[2] = -ac * det; - out[3] = aa * det; - out[4] = (ac * aty - ad * atx) * det; - out[5] = (ab * atx - aa * aty) * det; - return out; - }, + - /** - * 矩阵左乘向量 - */ - mulVector : function(out, a, v) { - var aa = a[0], ac = a[2], atx = a[4]; - var ab = a[1], ad = a[3], aty = a[5]; + var EPSILON = 1e-4; - out[0] = v[0] * aa + v[1] * ac + atx; - out[1] = v[0] * ab + v[1] * ad + aty; + var THREE_SQRT = Math.sqrt(3); + var ONE_THIRD = 1 / 3; - return out; - } - }; + // 临时变量 + var _v0 = vector.create(); + var _v1 = vector.create(); + var _v2 = vector.create(); + // var _v3 = vector.create(); - return matrix; + function isAroundZero(val) { + return val > -EPSILON && val < EPSILON; + } + function isNotAroundZero(val) { + return val > EPSILON || val < -EPSILON; + } + /* + function evalCubicCoeff(a, b, c, d, t) { + return ((a * t + b) * t + c) * t + d; + } + */ + + /** + * 计算三次贝塞尔值 + * @memberOf module:zrender/tool/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} p3 + * @param {number} t + * @return {number} + */ + function cubicAt(p0, p1, p2, p3, t) { + var onet = 1 - t; + return onet * onet * (onet * p0 + 3 * t * p1) + + t * t * (t * p3 + 3 * onet * p2); } -); -define('zrender/shape/mixin/Transformable',['require','../../tool/matrix'],function(require) { - - var matrix = require('../../tool/matrix'); - var origin = [0, 0]; - - var Transformable = function() { - - if (!this.position) { - this.position = [0, 0]; - } - if (typeof(this.rotation) == 'undefined') { - this.rotation = [0, 0, 0]; - } - if (!this.scale) { - this.scale = [1, 1, 0, 0]; - } - this.needLocalTransform = false; - this.needTransform = false; - }; + /** + * 计算三次贝塞尔导数值 + * @memberOf module:zrender/tool/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} p3 + * @param {number} t + * @return {number} + */ + function cubicDerivativeAt(p0, p1, p2, p3, t) { + var onet = 1 - t; + return 3 * ( + ((p1 - p0) * onet + 2 * (p2 - p1) * t) * onet + + (p3 - p2) * t * t + ); + } - Transformable.prototype = { - - constructor: Transformable, + /** + * 计算三次贝塞尔方程根,使用盛金公式 + * @memberOf module:zrender/tool/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} p3 + * @param {number} val + * @param {Array.} roots + * @return {number} 有效根数目 + */ + function cubicRootAt(p0, p1, p2, p3, val, roots) { + // Evaluate roots of cubic functions + var a = p3 + 3 * (p1 - p2) - p0; + var b = 3 * (p2 - p1 * 2 + p0); + var c = 3 * (p1 - p0); + var d = p0 - val; - updateNeedTransform: function() { - this.needLocalTransform = Math.abs(this.rotation[0]) > 0.0001 - || Math.abs(this.position[0]) > 0.0001 - || Math.abs(this.position[1]) > 0.0001 - || Math.abs(this.scale[0] - 1) > 0.0001 - || Math.abs(this.scale[1] - 1) > 0.0001; - }, + var A = b * b - 3 * a * c; + var B = b * c - 9 * a * d; + var C = c * c - 3 * b * d; - updateTransform: function() { - - this.updateNeedTransform(); + var n = 0; - if (this.parent) { - this.needTransform = this.needLocalTransform || this.parent.needTransform; - } else { - this.needTransform = this.needLocalTransform; - } - - if (!this.needTransform) { - return; + if (isAroundZero(A) && isAroundZero(B)) { + if (isAroundZero(b)) { + roots[0] = 0; } - - var m = this.transform || matrix.create(); - matrix.identity(m); - - if (this.needLocalTransform) { - if (this.scale && (this.scale[0] !== 1 || this.scale[1] !== 1)) { - origin[0] = -this.scale[2] || 0; - origin[1] = -this.scale[3] || 0; - if (origin[0] || origin[1]) { - matrix.translate( - m, m, origin - ); - } - matrix.scale(m, m, this.scale); - if (origin[0] || origin[1]) { - origin[0] = -origin[0]; - origin[1] = -origin[1]; - matrix.translate( - m, m, origin - ); - } + else { + var t1 = -c / b; //t1, t2, t3, b is not zero + if (t1 >=0 && t1 <= 1) { + roots[n++] = t1; } + } + } + else { + var disc = B * B - 4 * A * C; - if (this.rotation) { - if (this.rotation instanceof Array) { - if (this.rotation[0] !== 0) { - origin[0] = -this.rotation[1] || 0; - origin[1] = -this.rotation[2] || 0; - if (origin[0] || origin[1]) { - matrix.translate( - m, m, origin - ); - } - matrix.rotate(m, m, this.rotation[0]); - if (origin[0] || origin[1]) { - origin[0] = -origin[0]; - origin[1] = -origin[1]; - matrix.translate( - m, m, origin - ); - } - } - } - else { - if (this.rotation !== 0) { - matrix.rotate(m, m, this.rotation); - } - } + if (isAroundZero(disc)) { + var K = B / A; + var t1 = -b / a + K; // t1, a is not zero + var t2 = -K / 2; // t2, t3 + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; } - - if (this.position && (this.position[0] !==0 || this.position[1] !== 0)) { - matrix.translate(m, m, this.position); + if (t2 >= 0 && t2 <= 1) { + roots[n++] = t2; } } - - // 保存这个变换矩阵 - this.transform = m; - - // 应用父节点变换 - if (this.parent && this.parent.needTransform) { - if (this.needLocalTransform) { - matrix.mul(this.transform, this.parent.transform, this.transform); - } else { - matrix.copy(this.transform, this.parent.transform); + else if (disc > 0) { + var discSqrt = Math.sqrt(disc); + var Y1 = A * b + 1.5 * a * (-B + discSqrt); + var Y2 = A * b + 1.5 * a * (-B - discSqrt); + if (Y1 < 0) { + Y1 = -Math.pow(-Y1, ONE_THIRD); + } + else { + Y1 = Math.pow(Y1, ONE_THIRD); + } + if (Y2 < 0) { + Y2 = -Math.pow(-Y2, ONE_THIRD); + } + else { + Y2 = Math.pow(Y2, ONE_THIRD); + } + var t1 = (-b - (Y1 + Y2)) / (3 * a); + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; } } - }, - - setTransform: function(ctx) { - if (this.needTransform) { - var m = this.transform; - ctx.transform( - m[0], m[1], - m[2], m[3], - m[4], m[5] - ); + else { + var T = (2 * A * b - 3 * a * B) / (2 * Math.sqrt(A * A * A)); + var theta = Math.acos(T) / 3; + var ASqrt = Math.sqrt(A); + var tmp = Math.cos(theta); + + var t1 = (-b - 2 * ASqrt * tmp) / (3 * a); + var t2 = (-b + ASqrt * (tmp + THREE_SQRT * Math.sin(theta))) / (3 * a); + var t3 = (-b + ASqrt * (tmp - THREE_SQRT * Math.sin(theta))) / (3 * a); + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + if (t2 >= 0 && t2 <= 1) { + roots[n++] = t2; + } + if (t3 >= 0 && t3 <= 1) { + roots[n++] = t3; + } } } - }; - - return Transformable; -}); -/** - * zrender : 颜色辅助类 - * - * author: CrossDo (chenhuaimu@baidu.com) - * - * getColor:获取色板颜色 - * customPalette : 自定义调色板 - * resetPalette : 重置调色板 - * - * getHighlightColor : 获取默认高亮颜色 - * customHighlight : 自定义默认高亮颜色 - * resetHighlight : 重置默认高亮颜色 - * - * getRadialGradient : 径向渐变 - * getLinearGradient : 线性渐变 - * getGradientColors : 获取颜色之间渐变颜色数组 - * getStepColors : 获取两种颜色之间渐变颜色数组 - * reverse : 颜色翻转 - * mix : 颜色混合 - * lift : 颜色升降 - * trim : 清除空格 - * random : 随机颜色 - * toRGB : 转为RGB格式 - * toRGBA : 转为RGBA格式 - * toHex : 转为#RRGGBB格式 - * toHSL : 转为HSL格式 - * toHSLA : 转为HSLA格式 - * toHSB : 转为HSB格式 - * toHSBA : 转为HSBA格式 - * toHSV : 转为HSV格式 - * toHSVA : 转为HSVA格式 - * toName : 转为颜色名字 - * toColor: 颜色值数组转为指定格式颜色 - * toArray: 返回颜色值数组 - * alpha : 设置颜色的透明度 - **/ -define( 'zrender/tool/color',['require','../tool/util'],function(require) { - var util = require('../tool/util'); - - var _ctx; - - // Color palette is an array containing the default colors for the chart's - // series. - // When all colors are used, new colors are selected from the start again. - // Defaults to: - // 默认色板 - var palette = [ - '#ff9277', ' #dddd00', ' #ffc877', ' #bbe3ff', ' #d5ffbb', - '#bbbbff', ' #ddb000', ' #b0dd00', ' #e2bbff', ' #ffbbe3', - '#ff7777', ' #ff9900', ' #83dd00', ' #77e3ff', ' #778fff', - '#c877ff', ' #ff77ab', ' #ff6600', ' #aa8800', ' #77c7ff', - '#ad77ff', ' #ff77ff', ' #dd0083', ' #777700', ' #00aa00', - '#0088aa', ' #8400dd', ' #aa0088', ' #dd0000', ' #772e00' - ]; - var _palette = palette; - - var highlightColor = 'rgba(255,255,0,0.5)'; - var _highlightColor = highlightColor; - - // 颜色格式 - /*jshint maxlen: 330 */ - var colorRegExp = /^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i; - - var _nameColors = { - aliceblue : '#f0f8ff', - antiquewhite : '#faebd7', - aqua : '#0ff', - aquamarine : '#7fffd4', - azure : '#f0ffff', - beige : '#f5f5dc', - bisque : '#ffe4c4', - black : '#000', - blanchedalmond : '#ffebcd', - blue : '#00f', - blueviolet : '#8a2be2', - brown : '#a52a2a', - burlywood : '#deb887', - cadetblue : '#5f9ea0', - chartreuse : '#7fff00', - chocolate : '#d2691e', - coral : '#ff7f50', - cornflowerblue : '#6495ed', - cornsilk : '#fff8dc', - crimson : '#dc143c', - cyan : '#0ff', - darkblue : '#00008b', - darkcyan : '#008b8b', - darkgoldenrod : '#b8860b', - darkgray : '#a9a9a9', - darkgrey : '#a9a9a9', - darkgreen : '#006400', - darkkhaki : '#bdb76b', - darkmagenta : '#8b008b', - darkolivegreen : '#556b2f', - darkorange : '#ff8c00', - darkorchid : '#9932cc', - darkred : '#8b0000', - darksalmon : '#e9967a', - darkseagreen : '#8fbc8f', - darkslateblue : '#483d8b', - darkslategray : '#2f4f4f', - darkslategrey : '#2f4f4f', - darkturquoise : '#00ced1', - darkviolet : '#9400d3', - deeppink : '#ff1493', - deepskyblue : '#00bfff', - dimgray : '#696969', - dimgrey : '#696969', - dodgerblue : '#1e90ff', - firebrick : '#b22222', - floralwhite : '#fffaf0', - forestgreen : '#228b22', - fuchsia : '#f0f', - gainsboro : '#dcdcdc', - ghostwhite : '#f8f8ff', - gold : '#ffd700', - goldenrod : '#daa520', - gray : '#808080', - grey : '#808080', - green : '#008000', - greenyellow : '#adff2f', - honeydew : '#f0fff0', - hotpink : '#ff69b4', - indianred : '#cd5c5c', - indigo : '#4b0082', - ivory : '#fffff0', - khaki : '#f0e68c', - lavender : '#e6e6fa', - lavenderblush : '#fff0f5', - lawngreen : '#7cfc00', - lemonchiffon : '#fffacd', - lightblue : '#add8e6', - lightcoral : '#f08080', - lightcyan : '#e0ffff', - lightgoldenrodyellow : '#fafad2', - lightgray : '#d3d3d3', - lightgrey : '#d3d3d3', - lightgreen : '#90ee90', - lightpink : '#ffb6c1', - lightsalmon : '#ffa07a', - lightseagreen : '#20b2aa', - lightskyblue : '#87cefa', - lightslategray : '#789', - lightslategrey : '#789', - lightsteelblue : '#b0c4de', - lightyellow : '#ffffe0', - lime : '#0f0', - limegreen : '#32cd32', - linen : '#faf0e6', - magenta : '#f0f', - maroon : '#800000', - mediumaquamarine : '#66cdaa', - mediumblue : '#0000cd', - mediumorchid : '#ba55d3', - mediumpurple : '#9370d8', - mediumseagreen : '#3cb371', - mediumslateblue : '#7b68ee', - mediumspringgreen : '#00fa9a', - mediumturquoise : '#48d1cc', - mediumvioletred : '#c71585', - midnightblue : '#191970', - mintcream : '#f5fffa', - mistyrose : '#ffe4e1', - moccasin : '#ffe4b5', - navajowhite : '#ffdead', - navy : '#000080', - oldlace : '#fdf5e6', - olive : '#808000', - olivedrab : '#6b8e23', - orange : '#ffa500', - orangered : '#ff4500', - orchid : '#da70d6', - palegoldenrod : '#eee8aa', - palegreen : '#98fb98', - paleturquoise : '#afeeee', - palevioletred : '#d87093', - papayawhip : '#ffefd5', - peachpuff : '#ffdab9', - peru : '#cd853f', - pink : '#ffc0cb', - plum : '#dda0dd', - powderblue : '#b0e0e6', - purple : '#800080', - red : '#f00', - rosybrown : '#bc8f8f', - royalblue : '#4169e1', - saddlebrown : '#8b4513', - salmon : '#fa8072', - sandybrown : '#f4a460', - seagreen : '#2e8b57', - seashell : '#fff5ee', - sienna : '#a0522d', - silver : '#c0c0c0', - skyblue : '#87ceeb', - slateblue : '#6a5acd', - slategray : '#708090', - slategrey : '#708090', - snow : '#fffafa', - springgreen : '#00ff7f', - steelblue : '#4682b4', - tan : '#d2b48c', - teal : '#008080', - thistle : '#d8bfd8', - tomato : '#ff6347', - turquoise : '#40e0d0', - violet : '#ee82ee', - wheat : '#f5deb3', - white : '#fff', - whitesmoke : '#f5f5f5', - yellow : '#ff0', - yellowgreen : '#9acd32' - }; - - /** - * 自定义调色板 - */ - function customPalette(userPalete) { - palette = userPalete; + return n; } /** - * 复位默认色板 + * 计算三次贝塞尔方程极限值的位置 + * @memberOf module:zrender/tool/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} p3 + * @param {Array.} extrema + * @return {number} 有效数目 */ - function resetPalette() { - palette = _palette; + function cubicExtrema(p0, p1, p2, p3, extrema) { + var b = 6 * p2 - 12 * p1 + 6 * p0; + var a = 9 * p1 + 3 * p3 - 3 * p0 - 9 * p2; + var c = 3 * p1 - 3 * p0; + + var n = 0; + if (isAroundZero(a)) { + if (isNotAroundZero(b)) { + var t1 = -c / b; + if (t1 >= 0 && t1 <=1) { + extrema[n++] = t1; + } + } + } + else { + var disc = b * b - 4 * a * c; + if (isAroundZero(disc)) { + extrema[0] = -b / (2 * a); + } + else if (disc > 0) { + var discSqrt = Math.sqrt(disc); + var t1 = (-b + discSqrt) / (2 * a); + var t2 = (-b - discSqrt) / (2 * a); + if (t1 >= 0 && t1 <= 1) { + extrema[n++] = t1; + } + if (t2 >= 0 && t2 <= 1) { + extrema[n++] = t2; + } + } + } + return n; } /** - * 获取色板颜色 - * - * @param {number} idx : 色板位置 - * @param {array} [userPalete] : 自定义色板 - * - * @return {color} 颜色#000000~#ffffff + * 细分三次贝塞尔曲线 + * @memberOf module:zrender/tool/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} p3 + * @param {number} t + * @param {Array.} out */ - function getColor(idx, userPalete) { - idx = idx | 0; - userPalete = userPalete || palette; - return userPalete[idx % userPalete.length]; + function cubicSubdivide(p0, p1, p2, p3, t, out) { + var p01 = (p1 - p0) * t + p0; + var p12 = (p2 - p1) * t + p1; + var p23 = (p3 - p2) * t + p2; + + var p012 = (p12 - p01) * t + p01; + var p123 = (p23 - p12) * t + p12; + + var p0123 = (p123 - p012) * t + p012; + // Seg0 + out[0] = p0; + out[1] = p01; + out[2] = p012; + out[3] = p0123; + // Seg1 + out[4] = p0123; + out[5] = p123; + out[6] = p23; + out[7] = p3; } /** - * 自定义默认高亮颜色 + * 投射点到三次贝塞尔曲线上,返回投射距离。 + * 投射点有可能会有一个或者多个,这里只返回其中距离最短的一个。 + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @param {number} x3 + * @param {number} y3 + * @param {number} x + * @param {number} y + * @param {Array.} [out] 投射点 + * @return {number} */ - function customHighlight(userHighlightColor) { - highlightColor = userHighlightColor; + function cubicProjectPoint( + x0, y0, x1, y1, x2, y2, x3, y3, + x, y, out + ) { + // http://pomax.github.io/bezierinfo/#projections + var t; + var interval = 0.005; + var d = Infinity; + + _v0[0] = x; + _v0[1] = y; + + // 先粗略估计一下可能的最小距离的 t 值 + // PENDING + for (var _t = 0; _t < 1; _t += 0.05) { + _v1[0] = cubicAt(x0, x1, x2, x3, _t); + _v1[1] = cubicAt(y0, y1, y2, y3, _t); + var d1 = vector.distSquare(_v0, _v1); + if (d1 < d) { + t = _t; + d = d1; + } + } + d = Infinity; + + // At most 32 iteration + for (var i = 0; i < 32; i++) { + if (interval < EPSILON) { + break; + } + var prev = t - interval; + var next = t + interval; + // t - interval + _v1[0] = cubicAt(x0, x1, x2, x3, prev); + _v1[1] = cubicAt(y0, y1, y2, y3, prev); + + var d1 = vector.distSquare(_v1, _v0); + + if (prev >= 0 && d1 < d) { + t = prev; + d = d1; + } + else { + // t + interval + _v2[0] = cubicAt(x0, x1, x2, x3, next); + _v2[1] = cubicAt(y0, y1, y2, y3, next); + var d2 = vector.distSquare(_v2, _v0); + + if (next <= 1 && d2 < d) { + t = next; + d = d2; + } + else { + interval *= 0.5; + } + } + } + // t + if (out) { + out[0] = cubicAt(x0, x1, x2, x3, t); + out[1] = cubicAt(y0, y1, y2, y3, t); + } + // console.log(interval, i); + return Math.sqrt(d); } /** - * 重置默认高亮颜色 + * 计算二次方贝塞尔值 + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} t + * @return {number} */ - function resetHighlight() { - _highlightColor = highlightColor; + function quadraticAt(p0, p1, p2, t) { + var onet = 1 - t; + return onet * (onet * p0 + 2 * t * p1) + t * t * p2; } /** - * 获取默认高亮颜色 + * 计算二次方贝塞尔导数值 + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} t + * @return {number} */ - function getHighlightColor() { - return highlightColor; + function quadraticDerivativeAt(p0, p1, p2, t) { + return 2 * ((1 - t) * (p1 - p0) + t * (p2 - p1)); } /** - * 径向渐变 - * - * @param {number} x0 渐变起点 - * @param {number} y0 - * @param {number} r0 - * @param {number} x1 渐变终点 - * @param {number} y1 - * @param {number} r1 - * @param {Array} colorList 颜色列表 + * 计算二次方贝塞尔方程根 + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} t + * @param {Array.} roots + * @return {number} 有效根数目 */ - function getRadialGradient(x0, y0, r0, x1, y1, r1, colorList) { - if (!_ctx) { - _ctx = util.getContext(); + function quadraticRootAt(p0, p1, p2, val, roots) { + var a = p0 - 2 * p1 + p2; + var b = 2 * (p1 - p0); + var c = p0 - val; + + var n = 0; + if (isAroundZero(a)) { + if (isNotAroundZero(b)) { + var t1 = -c / b; + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + } } - var gradient = _ctx.createRadialGradient(x0, y0, r0, x1, y1, r1); - for ( var i = 0, l = colorList.length; i < l; i++) { - gradient.addColorStop(colorList[i][0], colorList[i][1]); + else { + var disc = b * b - 4 * a * c; + if (isAroundZero(disc)) { + var t1 = -b / (2 * a); + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + } + else if (disc > 0) { + var discSqrt = Math.sqrt(disc); + var t1 = (-b + discSqrt) / (2 * a); + var t2 = (-b - discSqrt) / (2 * a); + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + if (t2 >= 0 && t2 <= 1) { + roots[n++] = t2; + } + } } - gradient.__nonRecursion = true; - return gradient; + return n; } /** - * 线性渐变 - * @param {Object} x0 渐变起点 - * @param {Object} y0 - * @param {Object} x1 渐变终点 - * @param {Object} y1 - * @param {Array} colorList 颜色列表 + * 计算二次贝塞尔方程极限值 + * @memberOf module:zrender/tool/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @return {number} */ - function getLinearGradient(x0, y0, x1, y1, colorList) { - if (!_ctx) { - _ctx = util.getContext(); + function quadraticExtremum(p0, p1, p2) { + var divider = p0 + p2 - 2 * p1; + if (divider === 0) { + // p1 is center of p0 and p2 + return 0.5; } - var gradient = _ctx.createLinearGradient(x0, y0, x1, y1); - for ( var i = 0, l = colorList.length; i < l; i++) { - gradient.addColorStop(colorList[i][0], colorList[i][1]); + else { + return (p0 - p1) / divider; } - gradient.__nonRecursion = true; - return gradient; } /** - * 获取两种颜色之间渐变颜色数组 - * @param {color} start 起始颜色 - * @param {color} end 结束颜色 - * @param {number} step 渐变级数 - * @return {Array} 颜色数组 + * 投射点到二次贝塞尔曲线上,返回投射距离。 + * 投射点有可能会有一个或者多个,这里只返回其中距离最短的一个。 + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @param {number} x + * @param {number} y + * @param {Array.} out 投射点 + * @return {number} */ - function getStepColors(start, end, step) { - start = toRGBA(start); - end = toRGBA(end); - start = getData(start); - end = getData(end); + function quadraticProjectPoint( + x0, y0, x1, y1, x2, y2, + x, y, out + ) { + // http://pomax.github.io/bezierinfo/#projections + var t; + var interval = 0.005; + var d = Infinity; + + _v0[0] = x; + _v0[1] = y; + + // 先粗略估计一下可能的最小距离的 t 值 + // PENDING + for (var _t = 0; _t < 1; _t += 0.05) { + _v1[0] = quadraticAt(x0, x1, x2, _t); + _v1[1] = quadraticAt(y0, y1, y2, _t); + var d1 = vector.distSquare(_v0, _v1); + if (d1 < d) { + t = _t; + d = d1; + } + } + d = Infinity; + + // At most 32 iteration + for (var i = 0; i < 32; i++) { + if (interval < EPSILON) { + break; + } + var prev = t - interval; + var next = t + interval; + // t - interval + _v1[0] = quadraticAt(x0, x1, x2, prev); + _v1[1] = quadraticAt(y0, y1, y2, prev); - var colors = []; - var stepR = (end[0] - start[0]) / step; - var stepG = (end[1] - start[1]) / step; - var stepB = (end[2] - start[2]) / step; - // 生成颜色集合 - // fix by linfeng 颜色堆积 - for (var i = 0, r = start[0], g = start[1], b = start[2]; i < step; i++ - ) { - colors[i] = toColor([ - adjust(Math.floor(r), [0, 255]), - adjust(Math.floor(g), [0, 255]), - adjust(Math.floor(b), [0, 255]) - ]); - r += stepR; - g += stepG; - b += stepB; - } - r = end[0]; - g = end[1]; - b = end[2]; - colors[i] = toColor([r, g, b]); - return colors; - } + var d1 = vector.distSquare(_v1, _v0); - /** - * 获取指定级数的渐变颜色数组 - * @param {Array} colors 颜色组 - * @param {number=20} step 渐变级数 - * @return {Array} 颜色数组 - */ - function getGradientColors(colors, step) { - var ret = []; - var len = colors.length; - if (step === undefined) { - step = 20; - } - if (len === 1) { - ret = getStepColors(colors[0], colors[0], step); - } else if (len > 1) { - for ( var i = 0, n = len - 1; i < n; i++) { - var steps = getStepColors(colors[i], colors[i + 1], step); - if (i < n - 1) { - steps.pop(); + if (prev >= 0 && d1 < d) { + t = prev; + d = d1; + } + else { + // t + interval + _v2[0] = quadraticAt(x0, x1, x2, next); + _v2[1] = quadraticAt(y0, y1, y2, next); + var d2 = vector.distSquare(_v2, _v0); + if (next <= 1 && d2 < d) { + t = next; + d = d2; + } + else { + interval *= 0.5; } - ret = ret.concat(steps); } } - return ret; + // t + if (out) { + out[0] = quadraticAt(x0, x1, x2, t); + out[1] = quadraticAt(y0, y1, y2, t); + } + // console.log(interval, i); + return Math.sqrt(d); } - /** - * 颜色值数组转为指定格式颜色,例如:
- * data = [60,20,20,0.1] format = 'rgba' - * 返回:rgba(60,20,20,0.1) - * @param {Array} data 颜色值数组 - * @param {string} format 格式,默认rgb - * @return {string} 颜色 - */ - function toColor(data, format) { - format = format || 'rgb'; - if (data && (data.length === 3 || data.length === 4)) { - data = map(data, - function(c) { - return c > 1 ? Math.ceil(c) : c; - }); + return { - if (format.indexOf('hex') > -1) { - return '#' + ((1 << 24) + (data[0] << 16) + (data[1] << 8) + (+data[2])).toString(16).slice(1); - } else if (format.indexOf('hs') > -1) { - var sx = map(data.slice(1, 3), - function(c) { - return c + '%'; - }); - data[1] = sx[0]; - data[2] = sx[1]; - } + cubicAt: cubicAt, - if (format.indexOf('a') > -1) { - if (data.length === 3) { - data.push(1); - } - data[3] = adjust(data[3], [0, 1]); - return format + '(' + data.slice(0, 4).join(',') + ')'; - } + cubicDerivativeAt: cubicDerivativeAt, - return format + '(' + data.slice(0, 3).join(',') + ')'; - } - } + cubicRootAt: cubicRootAt, - /** - * 返回颜色值数组 - * - * @param {color} color 颜色 - * @return {Array} 颜色值数组 - */ - function toArray(color) { - color = trim(color); - if (color.indexOf('rgba') < 0) { - color = toRGBA(color); - } + cubicExtrema: cubicExtrema, - var data = []; - var i = 0; - color.replace(/[\d.]+/g, function (n) { - if (i < 3) { - n = n | 0; - } else { - // Alpha - n = +n; - } - data[i++] = n; - }); - return data; - } + cubicSubdivide: cubicSubdivide, - /** - * 颜色格式转化 - * - * @param {Array} data 颜色值数组 - * @param {string} format 格式,默认rgb - * @return {string} 颜色 - */ - function convert(color, format) { - var data = getData(color); - var alpha = data[3]; - if(typeof alpha === 'undefined') { - alpha = 1; - } + cubicProjectPoint: cubicProjectPoint, - if (color.indexOf('hsb') > -1) { - data = _HSV_2_RGB(data); - } else if (color.indexOf('hsl') > -1) { - data = _HSL_2_RGB(data); - } + quadraticAt: quadraticAt, - if (format.indexOf('hsb') > -1 || format.indexOf('hsv') > -1) { - data = _RGB_2_HSB(data); - } else if (format.indexOf('hsl') > -1) { - data = _RGB_2_HSL(data); - } + quadraticDerivativeAt: quadraticDerivativeAt, - data[3] = alpha; + quadraticRootAt: quadraticRootAt, - return toColor(data, format); - } + quadraticExtremum: quadraticExtremum, - /** - * 转换为rgba格式的颜色 - * - * @param {string} color 颜色 - * @return {string} rgba颜色,rgba(r,g,b,a) - */ - function toRGBA(color) { - return convert(color, 'rgba'); - } + quadraticProjectPoint: quadraticProjectPoint + }; +}); +/** + * zrender: 图形空间辅助类 + * + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * pissang (https://www.github.com/pissang) + * + * isInside:是否在区域内部 + * isOutside:是否在区域外部 + * getTextWidth:测算单行文本宽度 + */ +define( + 'zrender/tool/area',['require','./util','./curve'],function (require) { - /** - * 转换为rgb数字格式的颜色 - * - * @param {string} color 颜色 - * @return {string} rgb颜色,rgb(0,0,0)格式 - */ - function toRGB(color) { - return convert(color, 'rgb'); - } + - /** - * 转换为16进制颜色 - * - * @param {string} color 颜色 - * @return {string} 16进制颜色,#rrggbb格式 - */ - function toHex(color) { - return convert(color, 'hex'); - } + var util = require('./util'); + var curve = require('./curve'); - /** - * 转换为HSV颜色 - * - * @param {string} color 颜色 - * @return {string} HSVA颜色,hsva(h,s,v,a) - */ - function toHSVA(color) { - return convert(color, 'hsva'); - } + var _ctx; + + var _textWidthCache = {}; + var _textHeightCache = {}; + var _textWidthCacheCounter = 0; + var _textHeightCacheCounter = 0; + var TEXT_CACHE_MAX = 5000; + + var PI2 = Math.PI * 2; - /** - * 转换为HSV颜色 - * - * @param {string} color 颜色 - * @return {string} HSV颜色,hsv(h,s,v) - */ - function toHSV(color) { - return convert(color, 'hsv'); - } + function normalizeRadian(angle) { + angle %= PI2; + if (angle < 0) { + angle += PI2; + } + return angle; + } + /** + * 包含判断 + * + * @param {Object} shape : 图形 + * @param {Object} area : 目标区域 + * @param {number} x : 横坐标 + * @param {number} y : 纵坐标 + */ + function isInside(shape, area, x, y) { + if (!area || !shape) { + // 无参数或不支持类型 + return false; + } + var zoneType = shape.type; - /** - * 转换为HSBA颜色 - * - * @param {string} color 颜色 - * @return {string} HSBA颜色,hsba(h,s,b,a) - */ - function toHSBA(color) { - return convert(color, 'hsba'); - } + _ctx = _ctx || util.getContext(); - /** - * 转换为HSB颜色 - * - * @param {string} color 颜色 - * @return {string} HSB颜色,hsb(h,s,b) - */ - function toHSB(color) { - return convert(color, 'hsb'); - } + // 未实现或不可用时(excanvas不支持)则数学运算,主要是line,brokenLine,ring + var _mathReturn = _mathMethod(shape, area, x, y); + if (typeof _mathReturn != 'undefined') { + return _mathReturn; + } - /** - * 转换为HSLA颜色 - * - * @param {string} color 颜色 - * @return {string} HSLA颜色,hsla(h,s,l,a) - */ - function toHSLA(color) { - return convert(color, 'hsla'); - } + if (shape.buildPath && _ctx.isPointInPath) { + return _buildPathMethod(shape, _ctx, area, x, y); + } - /** - * 转换为HSL颜色 - * - * @param {string} color 颜色 - * @return {string} HSL颜色,hsl(h,s,l) - */ - function toHSL(color) { - return convert(color, 'hsl'); - } + // 上面的方法都行不通时 + switch (zoneType) { + case 'heart': // 心形---------10 // Todo,不精确 + case 'droplet':// 水滴----------11 // Todo,不精确 + case 'ellipse': // Todo,不精确 + return true; + // 旋轮曲线 不准确 + case 'trochoid': + var _r = area.location == 'out' + ? area.r1 + area.r2 + area.d + : area.r1 - area.r2 + area.d; + return isInsideCircle(area, x, y, _r); + // 玫瑰线 不准确 + case 'rose' : + return isInsideCircle(area, x, y, area.maxr); + // 路径,椭圆,曲线等-----------------13 + default: + return false; // Todo,暂不支持 + } + } - /** - * 转换颜色名 - * - * @param {string} color 颜色 - * @return {string} 颜色名 - */ - function toName(color) { - for ( var key in _nameColors) { - if (toHex(_nameColors[key]) === toHex(color)) { - return key; + /** + * 用数学方法判断,三个方法中最快,但是支持的shape少 + * + * @param {Object} shape : 图形 + * @param {Object} area :目标区域 + * @param {number} x : 横坐标 + * @param {number} y : 纵坐标 + * @return {boolean=} true表示坐标处在图形中 + */ + function _mathMethod(shape, area, x, y) { + var zoneType = shape.type; + // 在矩形内则部分图形需要进一步判断 + switch (zoneType) { + // 贝塞尔曲线 + case 'bezier-curve': + if (typeof(area.cpX2) === 'undefined') { + return isInsideQuadraticStroke( + area.xStart, area.yStart, + area.cpX1, area.cpY1, + area.xEnd, area.yEnd, + area.lineWidth, x, y + ); + } + return isInsideCubicStroke( + area.xStart, area.yStart, + area.cpX1, area.cpY1, + area.cpX2, area.cpY2, + area.xEnd, area.yEnd, + area.lineWidth, x, y + ); + // 线 + case 'line': + return isInsideLine( + area.xStart, area.yStart, + area.xEnd, area.yEnd, + area.lineWidth, x, y + ); + // 折线 + case 'broken-line': + return isInsideBrokenLine( + area.pointList, area.lineWidth, x, y + ); + // 圆环 + case 'ring': + return isInsideRing( + area.x, area.y, area.r0, area.r, x, y + ); + // 圆形 + case 'circle': + return isInsideCircle( + area.x, area.y, area.r, x, y + ); + // 扇形 + case 'sector': + return isInsideSector(area, x, y); + // 多边形 + case 'path': + return isInsidePath( + area.pathArray, Math.max(area.lineWidth, 5), + area.brushType, x, y + ); + case 'polygon': + case 'star': + case 'isogon': + return isInsidePolygon(area.pointList, x, y); + // 文本 + case 'text': + var rect = area.__rect || shape.getRect(area); + return isInsideRect( + rect.x, rect.y, rect.width, rect.height, x, y + ); + // 矩形 + case 'rectangle': + // 图片 + case 'image': + return isInsideRect( + area.x, area.y, area.width, area.height, x, y + ); } } - return null; - } - /** - * 移除颜色中多余空格 - * - * @param {string} color 颜色 - * @return {string} 无空格颜色 - */ - function trim(color) { - return String(color).replace(/\s+/g, ''); - } + /** + * 通过buildPath方法来判断,三个方法中较快,但是不支持线条类型的shape, + * 而且excanvas不支持isPointInPath方法 + * + * @param {Object} shape : shape + * @param {Object} context : 上下文 + * @param {Object} area :目标区域 + * @param {number} x : 横坐标 + * @param {number} y : 纵坐标 + * @return {boolean} true表示坐标处在图形中 + */ + function _buildPathMethod(shape, context, area, x, y) { + // 图形类实现路径创建了则用类的path + context.beginPath(); + shape.buildPath(context, area); + context.closePath(); + return context.isPointInPath(x, y); + } - /** - * 颜色规范化 - * - * @param {string} color 颜色 - * @return {string} 规范化后的颜色 - */ - function normalize(color) { - // 颜色名 - if (_nameColors[color]) { - color = _nameColors[color]; + /** + * !isInside + */ + function isOutside(shape, area, x, y) { + return !isInside(shape, area, x, y); } - // 去掉空格 - color = trim(color); - // hsv与hsb等价 - color = color.replace(/hsv/i, 'hsb'); - // rgb转为rrggbb - if (/^#[\da-f]{3}$/i.test(color)) { - color = parseInt(color.slice(1), 16); - var r = (color & 0xf00) << 8; - var g = (color & 0xf0) << 4; - var b = color & 0xf; - color = '#'+ ((1 << 24) + (r << 4) + r + (g << 4) + g + (b << 4) + b).toString(16).slice(1); + /** + * 线段包含判断 + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @param {number} lineWidth + * @param {number} x + * @param {number} y + * @return {boolean} + */ + function isInsideLine(x0, y0, x1, y1, lineWidth, x, y) { + if (lineWidth === 0) { + return false; + } + var _l = Math.max(lineWidth, 5); + var _a = 0; + var _b = x0; + // Quick reject + if ( + (y > y0 + _l && y > y1 + _l) + || (y < y0 - _l && y < y1 - _l) + || (x > x0 + _l && x > x1 + _l) + || (x < x0 - _l && x < x1 - _l) + ) { + return false; + } + + if (x0 !== x1) { + _a = (y0 - y1) / (x0 - x1); + _b = (x0 * y1 - x1 * y0) / (x0 - x1) ; + } + else { + return Math.abs(x - x0) <= _l / 2; + } + var tmp = _a * x - y + _b; + var _s = tmp * tmp / (_a * _a + 1); + return _s <= _l / 2 * _l / 2; + } + + /** + * 三次贝塞尔曲线描边包含判断 + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @param {number} x3 + * @param {number} y3 + * @param {number} lineWidth + * @param {number} x + * @param {number} y + * @return {boolean} + */ + function isInsideCubicStroke( + x0, y0, x1, y1, x2, y2, x3, y3, + lineWidth, x, y + ) { + if (lineWidth === 0) { + return false; + } + var _l = Math.max(lineWidth, 5); + // Quick reject + if ( + (y > y0 + _l && y > y1 + _l && y > y2 + _l && y > y3 + _l) + || (y < y0 - _l && y < y1 - _l && y < y2 - _l && y < y3 - _l) + || (x > x0 + _l && x > x1 + _l && x > x2 + _l && x > x3 + _l) + || (x < x0 - _l && x < x1 - _l && x < x2 - _l && x < x3 - _l) + ) { + return false; + } + var d = curve.cubicProjectPoint( + x0, y0, x1, y1, x2, y2, x3, y3, + x, y, null + ); + return d <= _l / 2; } - // 或者使用以下正则替换,不过 chrome 下性能相对差点 - // color = color.replace(/^#([\da-f])([\da-f])([\da-f])$/i, '#$1$1$2$2$3$3'); - return color; - } - /** - * 颜色加深或减淡,当level>0加深,当level<0减淡 - * - * @param {string} color 颜色 - * @param {number} level 升降程度,取值区间[-1,1] - * @return {string} 加深或减淡后颜色值 - */ - function lift(color, level) { - var direct = level > 0 ? 1 : -1; - if (typeof level === 'undefined') { - level = 0; + /** + * 二次贝塞尔曲线描边包含判断 + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @param {number} lineWidth + * @param {number} x + * @param {number} y + * @return {boolean} + */ + function isInsideQuadraticStroke( + x0, y0, x1, y1, x2, y2, + lineWidth, x, y + ) { + if (lineWidth === 0) { + return false; + } + var _l = Math.max(lineWidth, 5); + // Quick reject + if ( + (y > y0 + _l && y > y1 + _l && y > y2 + _l) + || (y < y0 - _l && y < y1 - _l && y < y2 - _l) + || (x > x0 + _l && x > x1 + _l && x > x2 + _l) + || (x < x0 - _l && x < x1 - _l && x < x2 - _l) + ) { + return false; + } + var d = curve.quadraticProjectPoint( + x0, y0, x1, y1, x2, y2, + x, y, null + ); + return d <= _l / 2; } - level = Math.abs(level) > 1 ? 1 : Math.abs(level); - color = toRGB(color); - var data = getData(color); - for ( var i = 0; i < 3; i++) { - if (direct === 1) { - data[i] = data[i] * (1 - level) | 0; + + /** + * 圆弧描边包含判断 + * @param {number} cx + * @param {number} cy + * @param {number} r + * @param {number} startAngle + * @param {number} endAngle + * @param {boolean} anticlockwise + * @param {number} lineWidth + * @param {number} x + * @param {number} y + * @return {Boolean} + */ + function isInsideArcStroke( + cx, cy, r, startAngle, endAngle, anticlockwise, + lineWidth, x, y + ) { + if (lineWidth === 0) { + return false; + } + var _l = Math.max(lineWidth, 5); + + x -= cx; + y -= cy; + var d = Math.sqrt(x * x + y * y); + if ((d - _l > r) || (d + _l < r)) { + return false; + } + if (anticlockwise) { + startAngle = normalizeRadian(endAngle); + endAngle = normalizeRadian(startAngle); } else { - data[i] = ((255 - data[i]) * level + data[i]) | 0; + startAngle = normalizeRadian(startAngle); + endAngle = normalizeRadian(endAngle); } + if (startAngle > endAngle) { + endAngle += PI2; + } + + var angle = Math.atan2(y, x); + if (angle < 0) { + angle += PI2; + } + return (angle >= startAngle && angle <= endAngle) + || (angle + PI2 >= startAngle && angle + PI2 <= endAngle); } - return 'rgb(' + data.join(',') + ')'; - } - /** - * 颜色翻转,[255-r,255-g,255-b,1-a] - * - * @param {string} color 颜色 - * @return {string} 翻转颜色 - */ - function reverse(color) { - var data = getData(toRGBA(color)); - data = map(data, - function(c) { - return 255 - c; - }); - return toColor(data, 'rgb'); - } + function isInsideBrokenLine(points, lineWidth, x, y) { + var lineWidth = Math.max(lineWidth, 10); + for (var i = 0, l = points.length - 1; i < l; i++) { + var x0 = points[i][0]; + var y0 = points[i][1]; + var x1 = points[i + 1][0]; + var y1 = points[i + 1][1]; - /** - * 简单两种颜色混合 - * - * @param {string} color1 第一种颜色 - * @param {string} color2 第二种颜色 - * @param {string} weight 混合权重[0-1] - * @return {string} 结果色,rgb(r,g,b)或rgba(r,g,b,a) - */ - function mix(color1, color2, weight) { - if(typeof weight === 'undefined') { - weight = 0.5; + if (isInsideLine(x0, y0, x1, y1, lineWidth, x, y)) { + return true; + } + } + + return false; } - weight = 1 - adjust(weight, [0, 1]); - var w = weight * 2 - 1; - var data1 = getData(toRGBA(color1)); - var data2 = getData(toRGBA(color2)); + function isInsideRing(cx, cy, r0, r, x, y) { + var d = (x - cx) * (x - cx) + (y - cy) * (y - cy); + return (d < r * r) && (d > r0 * r0); + } - var d = data1[3] - data2[3]; + /** + * 矩形包含判断 + */ + function isInsideRect(x0, y0, width, height, x, y) { + return x >= x0 && x <= (x0 + width) + && y >= y0 && y <= (y0 + height); + } - var weight1 = (((w * d === -1) ? w : (w + d) / (1 + w * d)) + 1) / 2; - var weight2 = 1 - weight1; + /** + * 圆形包含判断 + */ + function isInsideCircle(x0, y0, r, x, y) { + return (x - x0) * (x - x0) + (y - y0) * (y - y0) + < r * r; + } - var data = []; + /** + * 扇形包含判断 + */ + function isInsideSector(area, x, y) { + if (!isInsideRing(area.x, area.y, area.r0 || 0, area.r, x, y)) { + // 大圆外或者小圆内直接false + return false; + } - for ( var i = 0; i < 3; i++) { - data[i] = data1[i] * weight1 + data2[i] * weight2; + // 判断夹角 + if (Math.abs(area.endAngle - area.startAngle) >= 360) { + // 大于360度的扇形,在环内就为true + return true; + } + + var angle = (360 + - Math.atan2(y - area.y, x - area.x) / Math.PI + * 180) + % 360; + var endA = (360 + area.endAngle) % 360; + var startA = (360 + area.startAngle) % 360; + if (endA > startA) { + return (angle >= startA && angle <= endA); + } + + return !(angle >= endA && angle <= startA); } - var alpha = data1[3] * weight + data2[3] * (1 - weight); - alpha = Math.max(0, Math.min(1, alpha)); + /** + * 多边形包含判断 + * 与 canvas 一样采用 non-zero winding rule + */ + function isInsidePolygon(points, x, y) { + var N = points.length; + var w = 0; - if (data1[3] === 1 && data2[3] === 1) {// 不考虑透明度 - return toColor(data, 'rgb'); + for (var i = 0, j = N - 1; i < N; i++) { + var x0 = points[j][0]; + var y0 = points[j][1]; + var x1 = points[i][0]; + var y1 = points[i][1]; + w += windingLine(x0, y0, x1, y1, x, y); + j = i; + } + return w !== 0; } - data[3] = alpha; - return toColor(data, 'rgba'); - } - /** - * 随机颜色 - * - * @return {string} 颜色值,#rrggbb格式 - */ - function random() { - return '#' + Math.random().toString(16).slice(2, 8); - } + function windingLine(x0, y0, x1, y1, x, y) { + if ((y > y0 && y > y1) || (y < y0 && y < y1)) { + return 0; + } + if (y1 == y0) { + return 0; + } + var dir = y1 < y0 ? 1 : -1; + var t = (y - y0) / (y1 - y0); + var x_ = t * (x1 - x0) + x0; - /** - * 获取颜色值数组,返回值范围:
- * RGB 范围[0-255]
- * HSL/HSV/HSB 范围[0-1]
- * A透明度范围[0-1] - * 支持格式: - * #rgb - * #rrggbb - * rgb(r,g,b) - * rgb(r%,g%,b%) - * rgba(r,g,b,a) - * hsb(h,s,b) // hsv与hsb等价 - * hsb(h%,s%,b%) - * hsba(h,s,b,a) - * hsl(h,s,l) - * hsl(h%,s%,l%) - * hsla(h,s,l,a) - * - * @param {string} color 颜色 - * @return {Array} 颜色值数组或null - */ - function getData(color) { - color = normalize(color); - var r = color.match(colorRegExp); - if (r === null) { - throw new Error('The color format error'); // 颜色格式错误 + return x_ > x ? dir : 0; } - var d; - var a; - var data = []; - var rgb; - if (r[2]) { - // #rrggbb - d = r[2].replace('#', '').split(''); - rgb = [d[0] + d[1], d[2] + d[3], d[4] + d[5]]; - data = map(rgb, - function(c) { - return adjust(parseInt(c, 16), [0, 255]); - }); + // 临时数组 + var roots = [-1, -1, -1]; + var extrema = [-1, -1]; + function swapExtrema() { + var tmp = extrema[0]; + extrema[0] = extrema[1]; + extrema[1] = tmp; } - else if (r[4]) { - // rgb rgba - var rgba = (r[4]).split(','); - a = rgba[3]; - rgb = rgba.slice(0, 3); - data = map( - rgb, - function(c) { - c = Math.floor( - c.indexOf('%') > 0 ? parseInt(c, 0) * 2.55 : c - ); - return adjust(c, [0, 255]); + function windingCubic(x0, y0, x1, y1, x2, y2, x3, y3, x, y) { + // Quick reject + if ( + (y > y0 && y > y1 && y > y2 && y > y3) + || (y < y0 && y < y1 && y < y2 && y < y3) + ) { + return 0; + } + var nRoots = curve.cubicRootAt(y0, y1, y2, y3, y, roots); + if (nRoots === 0) { + return 0; + } + else { + var w = 0; + var nExtrema = -1; + var y0_, y1_; + for (var i = 0; i < nRoots; i++) { + var t = roots[i]; + var x_ = curve.cubicAt(x0, x1, x2, x3, t); + if (x_ < x) { // Quick reject + continue; + } + if (nExtrema < 0) { + nExtrema = curve.cubicExtrema(y0, y1, y2, y3, extrema); + if (extrema[1] < extrema[0] && nExtrema > 1) { + swapExtrema(); + } + y0_ = curve.cubicAt(y0, y1, y2, y3, extrema[0]); + if (nExtrema > 1) { + y1_ = curve.cubicAt(y0, y1, y2, y3, extrema[1]); + } + } + if (nExtrema == 2) { + // 分成三段单调函数 + if (t < extrema[0]) { + w += y0_ < y0 ? 1 : -1; + } + else if (t < extrema[1]) { + w += y1_ < y0_ ? 1 : -1; + } + else { + w += y3 < y1_ ? 1 : -1; + } + } + else { + // 分成两段单调函数 + if (t < extrema[0]) { + w += y0_ < y0 ? 1 : -1; + } + else { + w += y3 < y0_ ? 1 : -1; + } + } } - ); - - if(typeof a !== 'undefined') { - data.push(adjust(parseFloat(a), [0, 1])); + return w; } } - else if (r[5] || r[6]) { - // hsb hsba hsl hsla - var hsxa = (r[5] || r[6]).split(','); - var h = parseInt(hsxa[0], 0) / 360; - var s = hsxa[1]; - var x = hsxa[2]; - a = hsxa[3]; - data = map([s, x], - function(c) { - return adjust(parseFloat(c) / 100, [0, 1]); - }); - data.unshift(h); - if( typeof a !== 'undefined') { - data.push(adjust(parseFloat(a), [0, 1])); + + function windingQuadratic(x0, y0, x1, y1, x2, y2, x, y) { + // Quick reject + if ( + (y > y0 && y > y1 && y > y2) + || (y < y0 && y < y1 && y < y2) + ) { + return 0; + } + var nRoots = curve.quadraticRootAt(y0, y1, y2, y, roots); + if (nRoots === 0) { + return 0; + } + else { + var t = curve.quadraticExtremum(y0, y1, y2); + if (t >=0 && t <= 1) { + var w = 0; + var y_ = curve.quadraticAt(y0, y1, y2, t); + for (var i = 0; i < nRoots; i++) { + var x_ = curve.quadraticAt(x0, x1, x2, roots[i]); + if (x_ > x) { + continue; + } + if (roots[i] < t) { + w += y_ < y0 ? 1 : -1; + } + else { + w += y2 < y_ ? 1 : -1; + } + } + return w; + } + else { + var x_ = curve.quadraticAt(x0, x1, x2, roots[0]); + if (x_ > x) { + return 0; + } + return y2 < y0 ? 1 : -1; + } } } - return data; - } + + // TODO + // Arc 旋转 + function windingArc( + cx, cy, r, startAngle, endAngle, anticlockwise, x, y + ) { + y -= cy; + if (y > r || y < -r) { + return 0; + } + var tmp = Math.sqrt(r * r - y * y); + roots[0] = -tmp; + roots[1] = tmp; - /** - * 设置颜色透明度 - * @param {string} color 颜色 - * @param {number} alpha 透明度,区间[0,1] - * @return {string} rgba颜色值 - */ - function alpha(color, a) { - if (a === null) { - a = 1; + if (anticlockwise) { + startAngle = normalizeRadian(endAngle); + endAngle = normalizeRadian(startAngle); + } else { + startAngle = normalizeRadian(startAngle); + endAngle = normalizeRadian(endAngle); + } + if (startAngle > endAngle) { + endAngle += PI2; + } + + var w = 0; + for (var i = 0; i < 2; i++) { + var x_ = roots[i]; + if (x_ + cx > x) { + var angle = Math.atan2(y, x_); + var dir = anticlockwise ? 1 : -1; + if (angle < 0) { + angle = PI2 + angle; + } + if ( + (angle >= startAngle && angle <= endAngle) + || (angle + PI2 >= startAngle && angle + PI2 <= endAngle) + ) { + if (angle > Math.PI / 2 && angle < Math.PI * 1.5) { + dir = -dir; + } + w += dir; + } + } + } + return w; } - var data = getData(toRGBA(color)); - data[3] = adjust(Number(a).toFixed(4), [0, 1]); - return toColor(data, 'rgba'); - } + /** + * 路径包含判断 + * 与 canvas 一样采用 non-zero winding rule + */ + function isInsidePath(pathArray, lineWidth, brushType, x, y) { + var w = 0; + var xi = 0; + var yi = 0; + var x0 = 0; + var y0 = 0; + var beginSubpath = true; - // 数组映射 - function map(array, fun) { - if (typeof fun !== 'function') { - throw new TypeError(); - } - var len = array ? array.length : 0; - for ( var i = 0; i < len; i++) { - array[i] = fun(array[i]); - } - return array; - } + var hasStroke = brushType === 'stroke' || brushType === 'both'; + var hasFill = brushType === 'fill' || brushType === 'both'; - // 调整值区间 - function adjust(value, region) { - // < to <= & > to >= - // modify by linzhifeng 2014-05-25 because -0 == 0 - if (value <= region[0]) { - value = region[0]; - } - else if (value >= region[1]) { - value = region[1]; + // var roots = [-1, -1, -1]; + for (var i = 0; i < pathArray.length; i++) { + var seg = pathArray[i]; + var p = seg.points; + // Begin a new subpath + if (beginSubpath || seg.command === 'M') { + if (i > 0) { + // Close previous subpath + if (hasFill) { + w += windingLine(xi, yi, x0, y0, x, y); + } + if (w !== 0) { + return true; + } + } + x0 = p[p.length - 2]; + y0 = p[p.length - 1]; + beginSubpath = false; + } + switch (seg.command) { + case 'M': + xi = p[0]; + yi = p[1]; + break; + case 'L': + if (hasStroke) { + if (isInsideLine( + xi, yi, p[0], p[1], lineWidth, x, y + )) { + return true; + } + } + if (hasFill) { + w += windingLine(xi, yi, p[0], p[1], x, y); + } + xi = p[0]; + yi = p[1]; + break; + case 'C': + if (hasStroke) { + if (isInsideCubicStroke( + xi, yi, p[0], p[1], p[2], p[3], p[4], p[5], + lineWidth, x, y + )) { + return true; + } + } + if (hasFill) { + w += windingCubic( + xi, yi, p[0], p[1], p[2], p[3], p[4], p[5], x, y + ); + } + xi = p[4]; + yi = p[5]; + break; + case 'Q': + if (hasStroke) { + if (isInsideQuadraticStroke( + xi, yi, p[0], p[1], p[2], p[3], + lineWidth, x, y + )) { + return true; + } + } + if (hasFill) { + w += windingQuadratic( + xi, yi, p[0], p[1], p[2], p[3], x, y + ); + } + xi = p[2]; + yi = p[3]; + break; + case 'A': + // TODO Arc 旋转 + // TODO Arc 判断的开销比较大 + var cx = p[0]; + var cy = p[1]; + var rx = p[2]; + var ry = p[3]; + var theta = p[4]; + var dTheta = p[5]; + var x1 = Math.cos(theta) * rx + cx; + var y1 = Math.sin(theta) * ry + cy; + w += windingLine(xi, yi, x1, y1); + // zr 使用scale来模拟椭圆, 这里也对x做一定的缩放 + var _x = (x - cx) * ry / rx + cx; + if (hasStroke) { + if (isInsideArcStroke( + cx, cy, ry, theta, theta + dTheta, 1 - p[7], + lineWidth, _x, y + )) { + return true; + } + } + if (hasFill) { + w += windingArc( + cx, cy, ry, theta, theta + dTheta, 1 - p[7], + _x, y + ); + } + xi = Math.cos(theta + dTheta) * rx + cx; + yi = Math.sin(theta + dTheta) * ry + cy; + break; + case 'z': + if (hasStroke) { + if (isInsideLine( + xi, yi, x0, y0, lineWidth, x, y + )) { + return true; + } + } + beginSubpath = true; + break; + } + } + if (hasFill) { + w += windingLine(xi, yi, x0, y0, x, y); + } + return w !== 0; } - return value; - } - // 参见 http:// www.easyrgb.com/index.php?X=MATH - function _HSV_2_RGB(data) { - var H = data[0]; - var S = data[1]; - var V = data[2]; - // HSV from 0 to 1 - var R, G, B; - if (S === 0) { - R = V * 255; - G = V * 255; - B = V * 255; - } else { - var h = H * 6; - if (h === 6) { - h = 0; + /** + * 测算多行文本宽度 + * @param {Object} text + * @param {Object} textFont + */ + function getTextWidth(text, textFont) { + var key = text + ':' + textFont; + if (_textWidthCache[key]) { + return _textWidthCache[key]; } - var i = h | 0; - var v1 = V * (1 - S); - var v2 = V * (1 - S * (h - i)); - var v3 = V * (1 - S * (1 - (h - i))); - var r = 0; - var g = 0; - var b = 0; + _ctx = _ctx || util.getContext(); + _ctx.save(); - if (i === 0) { - r = V; - g = v3; - b = v1; - } else if (i === 1) { - r = v2; - g = V; - b = v1; - } else if (i === 2) { - r = v1; - g = V; - b = v3; - } else if (i === 3) { - r = v1; - g = v2; - b = V; - } else if (i === 4) { - r = v3; - g = v1; - b = V; - } else { - r = V; - g = v1; - b = v2; + if (textFont) { + _ctx.font = textFont; + } + + text = (text + '').split('\n'); + var width = 0; + for (var i = 0, l = text.length; i < l; i++) { + width = Math.max( + _ctx.measureText(text[i]).width, + width + ); } + _ctx.restore(); - // RGB results from 0 to 255 - R = r * 255; - G = g * 255; - B = b * 255; + _textWidthCache[key] = width; + if (++_textWidthCacheCounter > TEXT_CACHE_MAX) { + // 内存释放 + _textWidthCacheCounter = 0; + _textWidthCache = {}; + } + + return width; } - return [ R, G, B ]; - } + + /** + * 测算多行文本高度 + * @param {Object} text + * @param {Object} textFont + */ + function getTextHeight(text, textFont) { + var key = text + ':' + textFont; + if (_textHeightCache[key]) { + return _textHeightCache[key]; + } + + _ctx = _ctx || util.getContext(); - function _HSL_2_RGB(data) { - var H = data[0]; - var S = data[1]; - var L = data[2]; - // HSL from 0 to 1 - var R, G, B; - if (S === 0) { - R = L * 255; - G = L * 255; - B = L * 255; - } else { - var v2; - if (L < 0.5) { - v2 = L * (1 + S); - } else { - v2 = (L + S) - (S * L); + _ctx.save(); + if (textFont) { + _ctx.font = textFont; } + + text = (text + '').split('\n'); + // 比较粗暴 + var height = (_ctx.measureText('国').width + 2) * text.length; - var v1 = 2 * L - v2; + _ctx.restore(); - R = 255 * _HUE_2_RGB(v1, v2, H + (1 / 3)); - G = 255 * _HUE_2_RGB(v1, v2, H); - B = 255 * _HUE_2_RGB(v1, v2, H - (1 / 3)); + _textHeightCache[key] = height; + if (++_textHeightCacheCounter > TEXT_CACHE_MAX) { + // 内存释放 + _textHeightCacheCounter = 0; + _textHeightCache = {}; + } + return height; } - return [ R, G, B ]; + + return { + isInside : isInside, + isOutside : isOutside, + getTextWidth : getTextWidth, + getTextHeight : getTextHeight, + + isInsidePath: isInsidePath, + isInsidePolygon: isInsidePolygon, + isInsideSector: isInsideSector, + isInsideCircle: isInsideCircle, + isInsideLine: isInsideLine, + isInsideRect: isInsideRect, + isInsideBrokenLine: isInsideBrokenLine + }; } +); - function _HUE_2_RGB(v1, v2, vH) { - if (vH < 0) { - vH += 1; - } - if (vH > 1) { - vH -= 1; - } - if ((6 * vH) < 1) { - return (v1 + (v2 - v1) * 6 * vH); +/** + * 提供变换扩展 + * @module zrender/mixin/Transformable + * @author pissang (https://www.github.com/pissang) + */ +define('zrender/mixin/Transformable',['require','../tool/matrix','../tool/vector'],function (require) { + + + + var matrix = require('../tool/matrix'); + var vector = require('../tool/vector'); + var origin = [ 0, 0 ]; + + var EPSILON = 5e-5; + + function isAroundZero(val) { + return val > -EPSILON && val < EPSILON; + } + function isNotAroundZero(val) { + return val > EPSILON || val < -EPSILON; + } + + /** + * @alias module:zrender/mixin/Transformable + * @constructor + */ + var Transformable = function () { + + if (!this.position) { + /** + * 平移 + * @type {Array.} + * @default [0, 0] + */ + this.position = [ 0, 0 ]; } - if ((2 * vH) < 1) { - return (v2); + if (typeof(this.rotation) == 'undefined') { + /** + * 旋转,可以通过数组二三项指定旋转的原点 + * @type {Array.} + * @default [0, 0, 0] + */ + this.rotation = [ 0, 0, 0 ]; } - if ((3 * vH) < 2) { - return (v1 + (v2 - v1) * ((2 / 3) - vH) * 6); + if (!this.scale) { + /** + * 缩放,可以通过数组三四项指定缩放的原点 + * @type {Array.} + * @default [1, 1, 0, 0] + */ + this.scale = [ 1, 1, 0, 0 ]; } - return v1; - } - function _RGB_2_HSB(data) { - // RGB from 0 to 255 - var R = (data[0] / 255); - var G = (data[1] / 255); - var B = (data[2] / 255); + this.needLocalTransform = false; - var vMin = Math.min(R, G, B); // Min. value of RGB - var vMax = Math.max(R, G, B); // Max. value of RGB - var delta = vMax - vMin; // Delta RGB value - var V = vMax; - var H; - var S; + /** + * 是否有坐标变换 + * @type {boolean} + * @readOnly + */ + this.needTransform = false; + }; - // HSV results from 0 to 1 - if (delta === 0) { - H = 0; - S = 0; - } else { - S = delta / vMax; + Transformable.prototype = { + + constructor: Transformable, - var deltaR = (((vMax - R) / 6) + (delta / 2)) / delta; - var deltaG = (((vMax - G) / 6) + (delta / 2)) / delta; - var deltaB = (((vMax - B) / 6) + (delta / 2)) / delta; + updateNeedTransform: function () { + this.needLocalTransform = isNotAroundZero(this.rotation[0]) + || isNotAroundZero(this.position[0]) + || isNotAroundZero(this.position[1]) + || isNotAroundZero(this.scale[0] - 1) + || isNotAroundZero(this.scale[1] - 1); + }, - if (R === vMax) { - H = deltaB - deltaG; - } else if (G === vMax) { - H = (1 / 3) + deltaR - deltaB; - } else if (B === vMax) { - H = (2 / 3) + deltaG - deltaR; - } + /** + * 判断是否需要有坐标变换,更新needTransform属性。 + * 如果有坐标变换, 则从position, rotation, scale以及父节点的transform计算出自身的transform矩阵 + */ + updateTransform: function () { + + this.updateNeedTransform(); - if (H < 0) { - H += 1; + if (this.parent) { + this.needTransform = this.needLocalTransform || this.parent.needTransform; } - if (H > 1) { - H -= 1; + else { + this.needTransform = this.needLocalTransform; + } + + if (!this.needTransform) { + return; } - } - H = H * 360; - S = S * 100; - V = V * 100; - return [ H, S, V ]; - } - function _RGB_2_HSL(data) { - // RGB from 0 to 255 - var R = (data[0] / 255); - var G = (data[1] / 255); - var B = (data[2] / 255); + var m = this.transform || matrix.create(); + matrix.identity(m); - var vMin = Math.min(R, G, B); // Min. value of RGB - var vMax = Math.max(R, G, B); // Max. value of RGB - var delta = vMax - vMin; // Delta RGB value + if (this.needLocalTransform) { + if ( + isNotAroundZero(this.scale[0]) + || isNotAroundZero(this.scale[1]) + ) { + origin[0] = -this.scale[2] || 0; + origin[1] = -this.scale[3] || 0; + var haveOrigin = isNotAroundZero(origin[0]) + || isNotAroundZero(origin[1]); + if (haveOrigin) { + matrix.translate( + m, m, origin + ); + } + matrix.scale(m, m, this.scale); + if (haveOrigin) { + origin[0] = -origin[0]; + origin[1] = -origin[1]; + matrix.translate( + m, m, origin + ); + } + } - var L = (vMax + vMin) / 2; - var H; - var S; - // HSL results from 0 to 1 - if (delta === 0) { - H = 0; - S = 0; - } else { - if (L < 0.5) { - S = delta / (vMax + vMin); - } else { - S = delta / (2 - vMax - vMin); + if (this.rotation instanceof Array) { + if (this.rotation[0] !== 0) { + origin[0] = -this.rotation[1] || 0; + origin[1] = -this.rotation[2] || 0; + var haveOrigin = isNotAroundZero(origin[0]) + || isNotAroundZero(origin[1]); + if (haveOrigin) { + matrix.translate( + m, m, origin + ); + } + matrix.rotate(m, m, this.rotation[0]); + if (haveOrigin) { + origin[0] = -origin[0]; + origin[1] = -origin[1]; + matrix.translate( + m, m, origin + ); + } + } + } + else { + if (this.rotation !== 0) { + matrix.rotate(m, m, this.rotation); + } + } + + if ( + isNotAroundZero(this.position[0]) || isNotAroundZero(this.position[1]) + ) { + matrix.translate(m, m, this.position); + } } - var deltaR = (((vMax - R) / 6) + (delta / 2)) / delta; - var deltaG = (((vMax - G) / 6) + (delta / 2)) / delta; - var deltaB = (((vMax - B) / 6) + (delta / 2)) / delta; + // 保存这个变换矩阵 + this.transform = m; - if (R === vMax) { - H = deltaB - deltaG; - } else if (G === vMax) { - H = (1 / 3) + deltaR - deltaB; - } else if (B === vMax) { - H = (2 / 3) + deltaG - deltaR; + // 应用父节点变换 + if (this.parent && this.parent.needTransform) { + if (this.needLocalTransform) { + matrix.mul(this.transform, this.parent.transform, this.transform); + } + else { + matrix.copy(this.transform, this.parent.transform); + } } - - if (H < 0) { - H += 1; + }, + /** + * 将自己的transform应用到context上 + * @param {Context2D} ctx + */ + setTransform: function (ctx) { + if (this.needTransform) { + var m = this.transform; + ctx.transform( + m[0], m[1], + m[2], m[3], + m[4], m[5] + ); } - - if (H > 1) { - H -= 1; + }, + /** + * 设置图形的朝向 + * @param {Array.|Float32Array} target + * @method + */ + lookAt: (function () { + var v = vector.create(); + return function(target) { + if (!this.transform) { + this.transform = matrix.create(); + } + var m = this.transform; + vector.sub(v, target, this.position); + if (isAroundZero(v[0]) && isAroundZero(v[1])) { + return; + } + vector.normalize(v, v); + // Y Axis + // TODO Scale origin ? + m[2] = v[0] * this.scale[1]; + m[3] = v[1] * this.scale[1]; + // X Axis + m[0] = v[1] * this.scale[0]; + m[1] = -v[0] * this.scale[0]; + // Position + m[4] = this.position[0]; + m[5] = this.position[1]; + + this.decomposeTransform(); + }; + })(), + /** + * 分解`transform`矩阵到`position`, `rotation`, `scale` + */ + decomposeTransform: function () { + if (!this.transform) { + return; } + var m = this.transform; + var sx = m[0] * m[0] + m[1] * m[1]; + var position = this.position; + var scale = this.scale; + var rotation = this.rotation; + if (isNotAroundZero(sx - 1)) { + sx = Math.sqrt(sx); + } + var sy = m[2] * m[2] + m[3] * m[3]; + if (isNotAroundZero(sy - 1)) { + sy = Math.sqrt(sy); + } + position[0] = m[4]; + position[1] = m[5]; + scale[0] = sx; + scale[1] = sy; + scale[2] = scale[3] = 0; + rotation[0] = Math.atan2(-m[1] / sy, m[0] / sx); + rotation[1] = rotation[2] = 0; } - - H = H * 360; - S = S * 100; - L = L * 100; - - return [ H, S, L ]; - } - - return { - customPalette : customPalette, - resetPalette : resetPalette, - getColor : getColor, - getHighlightColor : getHighlightColor, - customHighlight : customHighlight, - resetHighlight : resetHighlight, - getRadialGradient : getRadialGradient, - getLinearGradient : getLinearGradient, - getGradientColors : getGradientColors, - getStepColors : getStepColors, - reverse : reverse, - mix : mix, - lift : lift, - trim : trim, - random : random, - toRGB : toRGB, - toRGBA : toRGBA, - toHex : toHex, - toHSL : toHSL, - toHSLA : toHSLA, - toHSB : toHSB, - toHSBA : toHSBA, - toHSV : toHSV, - toHSVA : toHSVA, - toName : toName, - toColor : toColor, - toArray : toArray, - alpha : alpha, - getData : getData }; -}); + return Transformable; +}); /** - * zrender : shape基类 - * - * desc: zrender是一个轻量级的Canvas类库,MVC封装,数据驱动,提供类Dom事件模型。 - * author: Kener (@Kener-林峰, linzhifeng@baidu.com) - * errorrik (errorrik@gmail.com) - * - * 可配图形属性: - { - // 基础属性,详见各shape - shape : {string}, // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 变换 - position : {array}, // 默认为[0, 0], shape的坐标 - rotation : {number|array}, // 默认为[0, 0, 0],shape绕自身旋转的角度,不被translate 影响 - // 后两个值为旋转的origin - scale : {array}, // 默认为[1, 1, 0, 0], shape纵横缩放比例,不被translate影响 - // 后两个值为缩放的origin - - // 样式属性,详见各shape,默认状态样式属性 - style : {Object}, - - // 样式属性,详见各shape,高亮样式属性,当不存在highlightStyle时使用默认样式扩展显示 - highlightStyle : {Object}, - - // 交互属性,zrender支持,非图形类实现 - hoverable : {boolean}, // 默认为true,可悬浮响应,默认悬浮响应为高亮显示 - // 可在onbrush中捕获并阻塞高亮绘画 - clickable : {boolean}, // 默认为false,可点击响应,影响鼠标hover时图标是否为可点击样式 - // 为false则阻断点击事件抛出,为true可在onclick中捕获 - draggable : {boolean}, // 默认为false,可拖拽响应,默认拖拽响应改变图形位置, - // 可在ondrift中捕获并阻塞默认拖拽行为 - - // 事件属性 - onbrush : {Function}, // 默认为null,当前图形被刷画时回调,可用于实现自定义绘画 - // 回传参数为: - // @param {2D Context} context 当前canvas context - // @param {Object} shape 当前shape - // @param {boolean} isHighlight 是否高亮 - // @return {boolean} 回调返回true则不执行默认绘画 - ondrift : {Function}, // 默认为null,当前图形被拖拽改变位置时回调,可用于限制拖拽范围 - // 回传参数为: - // @param {Object} shape 当前shape - // @param {number} dx x方向变化 - // @param {number} dy y方向变化 - onclick : {Function}, // 默认为null,当前图形点击响应,回传参数为: - // @param {Object} eventPacket 对象内容如下: - // @param {string} eventPacket.type 事件类型,EVENT.CLICK - // @param {event} eventPacket.event 原始dom事件对象 - // @param {Object} eventPacket.target 当前图形shape对象 - // @return {boolean} 回调返回true则阻止抛出全局事件 - - onmousewheel : {Function}, // 默认为null,当前图形上鼠标滚轮触发,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.MOUSEWHEEL - // @return {boolean} 回调返回true则阻止抛出全局事件 - - onmousemove : {Function}, // 默认为null,当前图上形鼠标(或手指)移动触发,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.MOUSEMOVE - // @return {boolean} 回调返回true则阻止抛出全局事件 - - onmouseover : {Function}, // 默认为null,鼠标(或手指)移动到当前图形上触发,回传参数格式同onclick: - // 事件类型为confit.EVENT.MOUSEOVER - // @return {boolean} 回调返回true则阻止抛出全局事件 - - onmouseout : {Function}, // 默认为null,鼠标(或手指)从当前图形移开,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.MOUSEOUT - // @return {boolean} 回调返回true则阻止抛出全局事件 - - onmousedown : {Function}, // 默认为null,鼠标按钮(或手指)按下,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.MOUSEDOWN - // @return {boolean} 回调返回true则阻止抛出全局事件 - - onmouseup : {Function}, // 默认为null,鼠标按钮(或手指)松开,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.MOUSEUP - // @return {boolean} 回调返回true则阻止抛出全局事件 - - ondragstart : {Function}, // 默认为null,开始拖拽时触发,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.DRAGSTART - // @return {boolean} 回调返回true则阻止抛出全局事件 - - ondragend : {Function}, // 默认为null,拖拽完毕时触发,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.DRAGEND - // @return {boolean} 回调返回true则阻止抛出全局事件 - - ondragenter : {Function}, // 默认为null,拖拽图形元素进入目标图形元素时触发 - // 回传参数格式同onclick,其中: - // @param {string} eventPacket.type 事件类型,EVENT.DRAGENTER - // @param {Object} eventPacket.target 目标图形元素shape对象 - // @param {Object} eventPacket.dragged 拖拽图形元素shape对象 - // @return {boolean} 回调返回true则阻止抛出全局事件 - - ondragover : {Function}, // 默认为null,拖拽图形元素在目标图形元素上移动时触发, - // 回传参数格式同onclick,其中: - // @param {string} eventPacket.type 事件类型,EVENT.DRAGOVER - // @param {Object} eventPacket.target 目标图形元素shape对象 - // @param {Object} eventPacket.dragged 拖拽图形元素shape对象 - // @return {boolean} 回调返回true则阻止抛出全局事件 - - ondragleave : {Function}, // 默认为null,拖拽图形元素离开目标图形元素时触发, - // 回传参数格式同onclick,其中: - // @param {string} eventPacket.type 事件类型,EVENT.DRAGLEAVE - // @param {Object} eventPacket.target 目标图形元素shape对象 - // @param {Object} eventPacket.dragged 拖拽图形元素shape对象 - // @return {boolean} 回调返回true则阻止抛出全局事件 - - ondrop : {Function}, // 默认为null,拖拽图形元素放在目标图形元素内时触发, - // 回传参数格式同onclick,其中: - // @param {string} eventPacket.type 事件类型,EVENT.DRAG - // @param {Object} eventPacket.target 目标图形元素shape对象 - // @param {Object} eventPacket.dragged 拖拽图形元素shape对象 - // @return {boolean} 回调返回true则阻止抛出全局事件 - } + * 颜色辅助类 + * @module zrender/tool/color + * @author CrossDo (chenhuaimu@baidu.com) */ -define( - 'zrender/shape/Base',['require','../tool/matrix','../tool/guid','../tool/util','./mixin/Transformable','../tool/event','../tool/area','../tool/area','../tool/color','../tool/area'],function(require) { - var matrix = require('../tool/matrix'); - var guid = require('../tool/guid'); - var util = require('../tool/util'); - - var Transformable = require('./mixin/Transformable'); - var Dispatcher = require('../tool/event').Dispatcher; +define('zrender/tool/color',['require','../tool/util'],function(require) { + var util = require('../tool/util'); - function _fillText(ctx, text, x, y, textFont, textAlign, textBaseline) { - if (textFont) { - ctx.font = textFont; - } - ctx.textAlign = textAlign; - ctx.textBaseline = textBaseline; - var rect = _getTextRect( - text, x, y, textFont, textAlign, textBaseline - ); - - text = (text + '').split('\n'); - var lineHeight = require('../tool/area').getTextHeight('国', textFont); - - switch (textBaseline) { - case 'top': - y = rect.y; - break; - case 'bottom': - y = rect.y + lineHeight; - break; - default: - y = rect.y + lineHeight / 2; - } - - for (var i = 0, l = text.length; i < l; i++) { - ctx.fillText(text[i], x, y); - y += lineHeight; - } - } + var _ctx; - /** - * 返回矩形区域,用于局部刷新和文字定位 - * - * @inner - * @param {Object} style - */ - function _getTextRect(text, x, y, textFont, textAlign, textBaseline) { - var area = require('../tool/area'); - var width = area.getTextWidth(text, textFont); - var lineHeight = area.getTextHeight('国', textFont); - - text = (text + '').split('\n'); - - switch (textAlign) { - case 'end': - case 'right': - x -= width; - break; - case 'center': - x -= (width / 2); - break; - } + // Color palette is an array containing the default colors for the chart's + // series. + // When all colors are used, new colors are selected from the start again. + // Defaults to: + // 默认色板 + var palette = [ + '#ff9277', ' #dddd00', ' #ffc877', ' #bbe3ff', ' #d5ffbb', + '#bbbbff', ' #ddb000', ' #b0dd00', ' #e2bbff', ' #ffbbe3', + '#ff7777', ' #ff9900', ' #83dd00', ' #77e3ff', ' #778fff', + '#c877ff', ' #ff77ab', ' #ff6600', ' #aa8800', ' #77c7ff', + '#ad77ff', ' #ff77ff', ' #dd0083', ' #777700', ' #00aa00', + '#0088aa', ' #8400dd', ' #aa0088', ' #dd0000', ' #772e00' + ]; + var _palette = palette; - switch (textBaseline) { - case 'top': - break; - case 'bottom': - y -= lineHeight * text.length; - break; - default: - y -= lineHeight * text.length / 2; - } + var highlightColor = 'rgba(255,255,0,0.5)'; + var _highlightColor = highlightColor; - return { - x : x, - y : y, - width : width, - height : lineHeight * text.length - }; - } + // 颜色格式 + /*jshint maxlen: 330 */ + var colorRegExp = /^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i; - function Base( options ) { - - options = options || {}; - - this.id = options.id || guid(); + var _nameColors = { + aliceblue : '#f0f8ff', + antiquewhite : '#faebd7', + aqua : '#0ff', + aquamarine : '#7fffd4', + azure : '#f0ffff', + beige : '#f5f5dc', + bisque : '#ffe4c4', + black : '#000', + blanchedalmond : '#ffebcd', + blue : '#00f', + blueviolet : '#8a2be2', + brown : '#a52a2a', + burlywood : '#deb887', + cadetblue : '#5f9ea0', + chartreuse : '#7fff00', + chocolate : '#d2691e', + coral : '#ff7f50', + cornflowerblue : '#6495ed', + cornsilk : '#fff8dc', + crimson : '#dc143c', + cyan : '#0ff', + darkblue : '#00008b', + darkcyan : '#008b8b', + darkgoldenrod : '#b8860b', + darkgray : '#a9a9a9', + darkgrey : '#a9a9a9', + darkgreen : '#006400', + darkkhaki : '#bdb76b', + darkmagenta : '#8b008b', + darkolivegreen : '#556b2f', + darkorange : '#ff8c00', + darkorchid : '#9932cc', + darkred : '#8b0000', + darksalmon : '#e9967a', + darkseagreen : '#8fbc8f', + darkslateblue : '#483d8b', + darkslategray : '#2f4f4f', + darkslategrey : '#2f4f4f', + darkturquoise : '#00ced1', + darkviolet : '#9400d3', + deeppink : '#ff1493', + deepskyblue : '#00bfff', + dimgray : '#696969', + dimgrey : '#696969', + dodgerblue : '#1e90ff', + firebrick : '#b22222', + floralwhite : '#fffaf0', + forestgreen : '#228b22', + fuchsia : '#f0f', + gainsboro : '#dcdcdc', + ghostwhite : '#f8f8ff', + gold : '#ffd700', + goldenrod : '#daa520', + gray : '#808080', + grey : '#808080', + green : '#008000', + greenyellow : '#adff2f', + honeydew : '#f0fff0', + hotpink : '#ff69b4', + indianred : '#cd5c5c', + indigo : '#4b0082', + ivory : '#fffff0', + khaki : '#f0e68c', + lavender : '#e6e6fa', + lavenderblush : '#fff0f5', + lawngreen : '#7cfc00', + lemonchiffon : '#fffacd', + lightblue : '#add8e6', + lightcoral : '#f08080', + lightcyan : '#e0ffff', + lightgoldenrodyellow : '#fafad2', + lightgray : '#d3d3d3', + lightgrey : '#d3d3d3', + lightgreen : '#90ee90', + lightpink : '#ffb6c1', + lightsalmon : '#ffa07a', + lightseagreen : '#20b2aa', + lightskyblue : '#87cefa', + lightslategray : '#789', + lightslategrey : '#789', + lightsteelblue : '#b0c4de', + lightyellow : '#ffffe0', + lime : '#0f0', + limegreen : '#32cd32', + linen : '#faf0e6', + magenta : '#f0f', + maroon : '#800000', + mediumaquamarine : '#66cdaa', + mediumblue : '#0000cd', + mediumorchid : '#ba55d3', + mediumpurple : '#9370d8', + mediumseagreen : '#3cb371', + mediumslateblue : '#7b68ee', + mediumspringgreen : '#00fa9a', + mediumturquoise : '#48d1cc', + mediumvioletred : '#c71585', + midnightblue : '#191970', + mintcream : '#f5fffa', + mistyrose : '#ffe4e1', + moccasin : '#ffe4b5', + navajowhite : '#ffdead', + navy : '#000080', + oldlace : '#fdf5e6', + olive : '#808000', + olivedrab : '#6b8e23', + orange : '#ffa500', + orangered : '#ff4500', + orchid : '#da70d6', + palegoldenrod : '#eee8aa', + palegreen : '#98fb98', + paleturquoise : '#afeeee', + palevioletred : '#d87093', + papayawhip : '#ffefd5', + peachpuff : '#ffdab9', + peru : '#cd853f', + pink : '#ffc0cb', + plum : '#dda0dd', + powderblue : '#b0e0e6', + purple : '#800080', + red : '#f00', + rosybrown : '#bc8f8f', + royalblue : '#4169e1', + saddlebrown : '#8b4513', + salmon : '#fa8072', + sandybrown : '#f4a460', + seagreen : '#2e8b57', + seashell : '#fff5ee', + sienna : '#a0522d', + silver : '#c0c0c0', + skyblue : '#87ceeb', + slateblue : '#6a5acd', + slategray : '#708090', + slategrey : '#708090', + snow : '#fffafa', + springgreen : '#00ff7f', + steelblue : '#4682b4', + tan : '#d2b48c', + teal : '#008080', + thistle : '#d8bfd8', + tomato : '#ff6347', + turquoise : '#40e0d0', + violet : '#ee82ee', + wheat : '#f5deb3', + white : '#fff', + whitesmoke : '#f5f5f5', + yellow : '#ff0', + yellowgreen : '#9acd32' + }; - for ( var key in options ) { - this[ key ] = options[ key ]; - } + /** + * 自定义调色板 + */ + function customPalette(userPalete) { + palette = userPalete; + } - this.style = this.style || {}; + /** + * 复位默认色板 + */ + function resetPalette() { + palette = _palette; + } - this.parent = null; + /** + * 获取色板颜色 + * @memberOf module:zrender/tool/color + * @param {number} idx 色板位置 + * @param {Array.} [userPalete] 自定义色板 + * @return {string} 颜色 + */ + function getColor(idx, userPalete) { + idx = idx | 0; + userPalete = userPalete || palette; + return userPalete[idx % userPalete.length]; + } - this.__dirty = true; + /** + * 自定义默认高亮颜色 + */ + function customHighlight(userHighlightColor) { + highlightColor = userHighlightColor; + } - Transformable.call(this); - Dispatcher.call(this); - } + /** + * 重置默认高亮颜色 + */ + function resetHighlight() { + _highlightColor = highlightColor; + } - Base.prototype.invisible = false; + /** + * 获取默认高亮颜色 + */ + function getHighlightColor() { + return highlightColor; + } - Base.prototype.ignore = false; + /** + * 径向渐变 + * @memberOf module:zrender/tool/color + * @param {number} x0 渐变起点 + * @param {number} y0 + * @param {number} r0 + * @param {number} x1 渐变终点 + * @param {number} y1 + * @param {number} r1 + * @param {Array} colorList 颜色列表 + * @return {CanvasGradient} + */ + function getRadialGradient(x0, y0, r0, x1, y1, r1, colorList) { + if (!_ctx) { + _ctx = util.getContext(); + } + var gradient = _ctx.createRadialGradient(x0, y0, r0, x1, y1, r1); + for (var i = 0, l = colorList.length; i < l; i++) { + gradient.addColorStop(colorList[i][0], colorList[i][1]); + } + gradient.__nonRecursion = true; + return gradient; + } - Base.prototype.zlevel = 0; + /** + * 线性渐变 + * @param {Object} x0 渐变起点 + * @param {Object} y0 + * @param {Object} x1 渐变终点 + * @param {Object} y1 + * @param {Array} colorList 颜色列表 + */ + function getLinearGradient(x0, y0, x1, y1, colorList) { + if (!_ctx) { + _ctx = util.getContext(); + } + var gradient = _ctx.createLinearGradient(x0, y0, x1, y1); + for (var i = 0, l = colorList.length; i < l; i++) { + gradient.addColorStop(colorList[i][0], colorList[i][1]); + } + gradient.__nonRecursion = true; + return gradient; + } - Base.prototype.draggable = false; + /** + * 获取两种颜色之间渐变颜色数组 + * @param {color} start 起始颜色 + * @param {color} end 结束颜色 + * @param {number} step 渐变级数 + * @return {Array} 颜色数组 + */ + function getStepColors(start, end, step) { + start = toRGBA(start); + end = toRGBA(end); + start = getData(start); + end = getData(end); - Base.prototype.clickable = false; + var colors = []; + var stepR = (end[0] - start[0]) / step; + var stepG = (end[1] - start[1]) / step; + var stepB = (end[2] - start[2]) / step; + // 生成颜色集合 + // fix by linfeng 颜色堆积 + for (var i = 0, r = start[0], g = start[1], b = start[2]; i < step; i++ + ) { + colors[i] = toColor([ + adjust(Math.floor(r), [ 0, 255 ]), + adjust(Math.floor(g), [ 0, 255 ]), + adjust(Math.floor(b), [ 0, 255 ]) + ]); + r += stepR; + g += stepG; + b += stepB; + } + r = end[0]; + g = end[1]; + b = end[2]; + colors[i] = toColor([ r, g, b ]); + return colors; + } - Base.prototype.hoverable = true; + /** + * 获取指定级数的渐变颜色数组 + * @memberOf module:zrender/tool/color + * @param {Array.} colors 颜色组 + * @param {number} [step=20] 渐变级数 + * @return {Array.} 颜色数组 + */ + function getGradientColors(colors, step) { + var ret = []; + var len = colors.length; + if (step === undefined) { + step = 20; + } + if (len === 1) { + ret = getStepColors(colors[0], colors[0], step); + } + else if (len > 1) { + for (var i = 0, n = len - 1; i < n; i++) { + var steps = getStepColors(colors[i], colors[i + 1], step); + if (i < n - 1) { + steps.pop(); + } + ret = ret.concat(steps); + } + } + return ret; + } - Base.prototype.z = 0; + /** + * 颜色值数组转为指定格式颜色,例如:
+ * data = [60,20,20,0.1] format = 'rgba' + * 返回:rgba(60,20,20,0.1) + * @param {Array} data 颜色值数组 + * @param {string} format 格式,默认rgb + * @return {string} 颜色 + */ + function toColor(data, format) { + format = format || 'rgb'; + if (data && (data.length === 3 || data.length === 4)) { + data = map(data, + function(c) { + return c > 1 ? Math.ceil(c) : c; + } + ); - /** - * 画刷 - * - * @param ctx 画布句柄 - * @param isHighlight 是否为高亮状态 - * @param updateCallback 需要异步加载资源的shape可以通过这个callback(e) - * 让painter更新视图,base.brush没用,需要的话重载brush - */ - Base.prototype.brush = function (ctx, isHighlight) { - var style = this.style; - - if (this.brushTypeOnly) { - style.brushType = this.brushTypeOnly; + if (format.indexOf('hex') > -1) { + return '#' + ((1 << 24) + (data[0] << 16) + (data[1] << 8) + (+data[2])).toString(16).slice(1); } - - if (isHighlight) { - // 根据style扩展默认高亮样式 - style = this.getHighlightStyle( - style, - this.highlightStyle || {}, - this.brushTypeOnly + else if (format.indexOf('hs') > -1) { + var sx = map(data.slice(1, 3), + function(c) { + return c + '%'; + } ); + data[1] = sx[0]; + data[2] = sx[1]; } - if (this.brushTypeOnly == 'stroke') { - style.strokeColor = style.strokeColor || style.color; + if (format.indexOf('a') > -1) { + if (data.length === 3) { + data.push(1); + } + data[3] = adjust(data[3], [ 0, 1 ]); + return format + '(' + data.slice(0, 4).join(',') + ')'; } - ctx.save(); - - this.setContext(ctx, style); + return format + '(' + data.slice(0, 3).join(',') + ')'; + } + } - // 设置transform - this.setTransform(ctx); + /** + * 颜色字符串转换为rgba数组 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {Array.} 颜色值数组 + */ + function toArray(color) { + color = trim(color); + if (color.indexOf('rgba') < 0) { + color = toRGBA(color); + } - ctx.beginPath(); - this.buildPath(ctx, style); - if (this.brushTypeOnly != 'stroke') { - ctx.closePath(); + var data = []; + var i = 0; + color.replace(/[\d.]+/g, function (n) { + if (i < 3) { + n = n | 0; } - - switch (style.brushType) { - case 'both': - ctx.fill(); - case 'stroke': - style.lineWidth > 0 && ctx.stroke(); - break; - default: - ctx.fill(); + else { + // Alpha + n = +n; } + data[i++] = n; + }); + return data; + } - this.drawText(ctx, style, this.style); + /** + * 颜色格式转化 + * + * @param {string} color 颜色值数组 + * @param {string} format 格式,默认rgb + * @return {string} 颜色 + */ + function convert(color, format) { + var data = getData(color); + var alpha = data[3]; + if (typeof alpha === 'undefined') { + alpha = 1; + } - ctx.restore(); - }; + if (color.indexOf('hsb') > -1) { + data = _HSV_2_RGB(data); + } + else if (color.indexOf('hsl') > -1) { + data = _HSL_2_RGB(data); + } - var STYLE_CTX_MAP = [ - ['color', 'fillStyle'], - ['strokeColor', 'strokeStyle'], - ['opacity', 'globalAlpha'], - ['lineCap', 'lineCap'], - ['lineJoin', 'lineJoin'], - ['miterLimit', 'miterLimit'], - ['lineWidth', 'lineWidth'], - ['shadowBlur', 'shadowBlur'], - ['shadowColor', 'shadowColor'], - ['shadowOffsetX', 'shadowOffsetX'], - ['shadowOffsetY', 'shadowOffsetY'] - ]; + if (format.indexOf('hsb') > -1 || format.indexOf('hsv') > -1) { + data = _RGB_2_HSB(data); + } + else if (format.indexOf('hsl') > -1) { + data = _RGB_2_HSL(data); + } - /** - * 画布通用设置 - * - * TODO Performance - * - * @param ctx 画布句柄 - * @param style 通用样式 - */ - Base.prototype.setContext = function (ctx, style) { - for (var i = 0, len = STYLE_CTX_MAP.length; i < len; i++) { - var styleProp = STYLE_CTX_MAP[i][0]; - var styleValue = style[styleProp]; - var ctxProp = STYLE_CTX_MAP[i][1]; + data[3] = alpha; - if (typeof styleValue != 'undefined') { - ctx[ctxProp] = styleValue; - } - } - }; - - /** - * 根据默认样式扩展高亮样式 - * - * @param ctx Canvas 2D上下文 - * @param {Object} style 默认样式 - * @param {Object} highlightStyle 高亮样式 - */ - Base.prototype.getHighlightStyle = function (style, highlightStyle, brushTypeOnly) { - var newStyle = {}; - for (var k in style) { - newStyle[k] = style[k]; - } + return toColor(data, format); + } - var color = require('../tool/color'); - var highlightColor = color.getHighlightColor(); - // 根据highlightStyle扩展 - if (style.brushType != 'stroke') { - // 带填充则用高亮色加粗边线 - newStyle.strokeColor = highlightColor; - newStyle.lineWidth = (style.lineWidth || 1) - + this.getHighlightZoom(); - newStyle.brushType = 'both'; - } - else { - if (brushTypeOnly != 'stroke') { - // 描边型的则用原色加工高亮 - newStyle.strokeColor = highlightColor; - newStyle.lineWidth = (style.lineWidth || 1) - + this.getHighlightZoom(); - } - else { - // 线型的则用原色加工高亮 - newStyle.strokeColor = highlightStyle.strokeColor - || color.mix( - style.strokeColor, - color.toRGB(highlightColor) - ); - } - } + /** + * 转换为rgba格式的颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} rgba颜色,rgba(r,g,b,a) + */ + function toRGBA(color) { + return convert(color, 'rgba'); + } - // 可自定义覆盖默认值 - for (var k in highlightStyle) { - if (typeof highlightStyle[k] != 'undefined') { - newStyle[k] = highlightStyle[k]; - } - } + /** + * 转换为rgb数字格式的颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} rgb颜色,rgb(0,0,0)格式 + */ + function toRGB(color) { + return convert(color, 'rgb'); + } - return newStyle; - }; + /** + * 转换为16进制颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} 16进制颜色,#rrggbb格式 + */ + function toHex(color) { + return convert(color, 'hex'); + } - /** - * 高亮放大效果参数 - * 当前统一设置为6,如有需要差异设置,通过this.type判断实例类型 - */ - Base.prototype.getHighlightZoom = function () { - return this.type != 'text' ? 6 : 2; - }; + /** + * 转换为HSV颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} HSVA颜色,hsva(h,s,v,a) + */ + function toHSVA(color) { + return convert(color, 'hsva'); + } - /** - * 默认漂移 - * - * @param dx 横坐标变化 - * @param dy 纵坐标变化 - */ - Base.prototype.drift = function (dx, dy) { - this.position[0] += dx; - this.position[1] += dy; - }; + /** + * 转换为HSV颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} HSV颜色,hsv(h,s,v) + */ + function toHSV(color) { + return convert(color, 'hsv'); + } - /** - * 获取鼠标坐标变换 - * TODO Performance - */ - Base.prototype.getTansform = (function() { - - var invTransform = []; + /** + * 转换为HSBA颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} HSBA颜色,hsba(h,s,b,a) + */ + function toHSBA(color) { + return convert(color, 'hsba'); + } - return function (x, y) { - var originPos = [x, y]; - // 对鼠标的坐标也做相同的变换 - if (this.needTransform && this.transform) { - matrix.invert(invTransform, this.transform); + /** + * 转换为HSB颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} HSB颜色,hsb(h,s,b) + */ + function toHSB(color) { + return convert(color, 'hsb'); + } - matrix.mulVector(originPos, invTransform, [x, y, 1]); + /** + * 转换为HSLA颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} HSLA颜色,hsla(h,s,l,a) + */ + function toHSLA(color) { + return convert(color, 'hsla'); + } - if (x == originPos[0] && y == originPos[1]) { - // 避免外部修改导致的needTransform不准确 - this.updateNeedTransform(); - } - } - return originPos; - }; - })(); - - /** - * 默认区域包含判断 - * - * @param x 横坐标 - * @param y 纵坐标 - */ - Base.prototype.isCover = function (x, y) { - var originPos = this.getTansform(x, y); - x = originPos[0]; - y = originPos[1]; + /** + * 转换为HSL颜色 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} HSL颜色,hsl(h,s,l) + */ + function toHSL(color) { + return convert(color, 'hsl'); + } - // 快速预判并保留判断矩形 - var rect = this.style.__rect; - if (!rect) { - rect = this.style.__rect = this.getRect(this.style); + /** + * 转换颜色名 + * + * @param {string} color 颜色 + * @return {string} 颜色名 + */ + function toName(color) { + for (var key in _nameColors) { + if (toHex(_nameColors[key]) === toHex(color)) { + return key; } + } + return null; + } - if (x >= rect.x - && x <= (rect.x + rect.width) - && y >= rect.y - && y <= (rect.y + rect.height) - ) { - // 矩形内 - return require('../tool/area').isInside(this, this.style, x, y); - } - - return false; - }; + /** + * 移除颜色中多余空格 + * + * @param {string} color 颜色 + * @return {string} 无空格颜色 + */ + function trim(color) { + return String(color).replace(/\s+/g, ''); + } - /** - * 附加文本 - * - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - * @param {Object} normalStyle 默认样式,用于定位文字显示 - */ - Base.prototype.drawText = function (ctx, style, normalStyle) { - if (typeof(style.text) == 'undefined' || style.text === false ) { - return; + /** + * 颜色规范化 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} 规范化后的颜色 + */ + function normalize(color) { + // 颜色名 + if (_nameColors[color]) { + color = _nameColors[color]; + } + // 去掉空格 + color = trim(color); + // hsv与hsb等价 + color = color.replace(/hsv/i, 'hsb'); + // rgb转为rrggbb + if (/^#[\da-f]{3}$/i.test(color)) { + color = parseInt(color.slice(1), 16); + var r = (color & 0xf00) << 8; + var g = (color & 0xf0) << 4; + var b = color & 0xf; + + color = '#' + ((1 << 24) + (r << 4) + r + (g << 4) + g + (b << 4) + b).toString(16).slice(1); + } + // 或者使用以下正则替换,不过 chrome 下性能相对差点 + // color = color.replace(/^#([\da-f])([\da-f])([\da-f])$/i, '#$1$1$2$2$3$3'); + return color; + } + + /** + * 颜色加深或减淡,当level>0加深,当level<0减淡 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @param {number} level 升降程度,取值区间[-1,1] + * @return {string} 加深或减淡后颜色值 + */ + function lift(color, level) { + var direct = level > 0 ? 1 : -1; + if (typeof level === 'undefined') { + level = 0; + } + level = Math.abs(level) > 1 ? 1 : Math.abs(level); + color = toRGB(color); + var data = getData(color); + for (var i = 0; i < 3; i++) { + if (direct === 1) { + data[i] = data[i] * (1 - level) | 0; } - // 字体颜色策略 - var textColor = style.textColor || style.color || style.strokeColor; - ctx.fillStyle = textColor; + else { + data[i] = ((255 - data[i]) * level + data[i]) | 0; + } + } + return 'rgb(' + data.join(',') + ')'; + } - /* - if (style.textPosition == 'inside') { - ctx.shadowColor = 'rgba(0,0,0,0)'; // 内部文字不带shadowColor + /** + * 颜色翻转,[255-r,255-g,255-b,1-a] + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {string} 翻转颜色 + */ + function reverse(color) { + var data = getData(toRGBA(color)); + data = map(data, + function(c) { + return 255 - c; } - */ + ); + return toColor(data, 'rgb'); + } - // 文本与图形间空白间隙 - var dd = 10; - var al; // 文本水平对齐 - var bl; // 文本垂直对齐 - var tx; // 文本横坐标 - var ty; // 文本纵坐标 + /** + * 简单两种颜色混合 + * @memberOf module:zrender/tool/color + * @param {string} color1 第一种颜色 + * @param {string} color2 第二种颜色 + * @param {number} weight 混合权重[0-1] + * @return {string} 结果色,rgb(r,g,b)或rgba(r,g,b,a) + */ + function mix(color1, color2, weight) { + if (typeof weight === 'undefined') { + weight = 0.5; + } + weight = 1 - adjust(weight, [ 0, 1 ]); - var textPosition = style.textPosition // 用户定义 - || this.textPosition // shape默认 - || 'top'; // 全局默认 + var w = weight * 2 - 1; + var data1 = getData(toRGBA(color1)); + var data2 = getData(toRGBA(color2)); - switch (textPosition) { - case 'inside': - case 'top': - case 'bottom': - case 'left': - case 'right': - if (this.getRect) { - var rect = (normalStyle || style).__rect - || this.getRect(normalStyle || style); + var d = data1[3] - data2[3]; - switch (textPosition) { - case 'inside': - tx = rect.x + rect.width / 2; - ty = rect.y + rect.height / 2; - al = 'center'; - bl = 'middle'; - if (style.brushType != 'stroke' - && textColor == style.color - ) { - ctx.fillStyle = '#fff'; - } - break; - case 'left': - tx = rect.x - dd; - ty = rect.y + rect.height / 2; - al = 'end'; - bl = 'middle'; - break; - case 'right': - tx = rect.x + rect.width + dd; - ty = rect.y + rect.height / 2; - al = 'start'; - bl = 'middle'; - break; - case 'top': - tx = rect.x + rect.width / 2; - ty = rect.y - dd; - al = 'center'; - bl = 'bottom'; - break; - case 'bottom': - tx = rect.x + rect.width / 2; - ty = rect.y + rect.height + dd; - al = 'center'; - bl = 'top'; - break; - } - } - break; - case 'start': - case 'end': - var xStart; - var xEnd; - var yStart; - var yEnd; - if (typeof style.pointList != 'undefined') { - var pointList = style.pointList; - if (pointList.length < 2) { - // 少于2个点就不画了~ - return; - } - var length = pointList.length; - switch (textPosition) { - case 'start': - xStart = pointList[0][0]; - xEnd = pointList[1][0]; - yStart = pointList[0][1]; - yEnd = pointList[1][1]; - break; - case 'end': - xStart = pointList[length - 2][0]; - xEnd = pointList[length - 1][0]; - yStart = pointList[length - 2][1]; - yEnd = pointList[length - 1][1]; - break; - } - } - else { - xStart = style.xStart || 0; - xEnd = style.xEnd || 0; - yStart = style.yStart || 0; - yEnd = style.yEnd || 0; - } + var weight1 = (((w * d === -1) ? w : (w + d) / (1 + w * d)) + 1) / 2; + var weight2 = 1 - weight1; - switch (textPosition) { - case 'start': - al = xStart < xEnd ? 'end' : 'start'; - bl = yStart < yEnd ? 'bottom' : 'top'; - tx = xStart; - ty = yStart; - break; - case 'end': - al = xStart < xEnd ? 'start' : 'end'; - bl = yStart < yEnd ? 'top' : 'bottom'; - tx = xEnd; - ty = yEnd; - break; - } - dd -= 4; - if (xStart != xEnd) { - tx -= (al == 'end' ? dd : -dd); - } - else { - al = 'center'; - } + var data = []; - if (yStart != yEnd) { - ty -= (bl == 'bottom' ? dd : -dd); - } - else { - bl = 'middle'; - } - break; - case 'specific': - tx = style.textX || 0; - ty = style.textY || 0; - al = 'start'; - bl = 'middle'; - break; - } + for (var i = 0; i < 3; i++) { + data[i] = data1[i] * weight1 + data2[i] * weight2; + } - if (tx != null && ty != null) { - _fillText( - ctx, - style.text, - tx, ty, - style.textFont, - style.textAlign || al, - style.textBaseline || bl - ); + var alpha = data1[3] * weight + data2[3] * (1 - weight); + alpha = Math.max(0, Math.min(1, alpha)); + + if (data1[3] === 1 && data2[3] === 1) {// 不考虑透明度 + return toColor(data, 'rgb'); + } + data[3] = alpha; + return toColor(data, 'rgba'); + } + + /** + * 随机颜色 + * + * @return {string} 颜色值,#rrggbb格式 + */ + function random() { + return '#' + Math.random().toString(16).slice(2, 8); + } + + /** + * 获取颜色值数组,返回值范围:
+ * RGB 范围[0-255]
+ * HSL/HSV/HSB 范围[0-1]
+ * A透明度范围[0-1] + * 支持格式: + * #rgb + * #rrggbb + * rgb(r,g,b) + * rgb(r%,g%,b%) + * rgba(r,g,b,a) + * hsb(h,s,b) // hsv与hsb等价 + * hsb(h%,s%,b%) + * hsba(h,s,b,a) + * hsl(h,s,l) + * hsl(h%,s%,l%) + * hsla(h,s,l,a) + * + * @param {string} color 颜色 + * @return {Array.} 颜色值数组或null + */ + function getData(color) { + color = normalize(color); + var r = color.match(colorRegExp); + if (r === null) { + throw new Error('The color format error'); // 颜色格式错误 + } + var d; + var a; + var data = []; + var rgb; + + if (r[2]) { + // #rrggbb + d = r[2].replace('#', '').split(''); + rgb = [ d[0] + d[1], d[2] + d[3], d[4] + d[5] ]; + data = map(rgb, + function(c) { + return adjust(parseInt(c, 16), [ 0, 255 ]); + } + ); + + } + else if (r[4]) { + // rgb rgba + var rgba = (r[4]).split(','); + a = rgba[3]; + rgb = rgba.slice(0, 3); + data = map( + rgb, + function(c) { + c = Math.floor( + c.indexOf('%') > 0 ? parseInt(c, 0) * 2.55 : c + ); + return adjust(c, [ 0, 255 ]); + } + ); + + if (typeof a !== 'undefined') { + data.push(adjust(parseFloat(a), [ 0, 1 ])); } - }; - // TODO - Base.prototype.isSilent = function () { - return !( - this.hoverable || this.draggable - || this.onmousemove || this.onmouseover || this.onmouseout - || this.onmousedown || this.onmouseup || this.onclick - || this.ondragenter || this.ondragover || this.ondragleave - || this.ondrop + } + else if (r[5] || r[6]) { + // hsb hsba hsl hsla + var hsxa = (r[5] || r[6]).split(','); + var h = parseInt(hsxa[0], 0) / 360; + var s = hsxa[1]; + var x = hsxa[2]; + a = hsxa[3]; + data = map([ s, x ], + function(c) { + return adjust(parseFloat(c) / 100, [ 0, 1 ]); + } ); - }; + data.unshift(h); + if (typeof a !== 'undefined') { + data.push(adjust(parseFloat(a), [ 0, 1 ])); + } + } + return data; + } - util.merge(Base.prototype, Transformable.prototype, true); - util.merge(Base.prototype, Dispatcher.prototype, true); + /** + * 设置颜色透明度 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @param {number} a 透明度,区间[0,1] + * @return {string} rgba颜色值 + */ + function alpha(color, a) { + if (a === null) { + a = 1; + } + var data = getData(toRGBA(color)); + data[3] = adjust(Number(a).toFixed(4), [ 0, 1 ]); - return Base; + return toColor(data, 'rgba'); } -); -/** - * zrender - * - * author: CrossDo (chenhuaimu@baidu.com) - * - * shape类:路径 - * 可配图形属性: - { - // 基础属性 - shape : 'path', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 + // 数组映射 + function map(array, fun) { + if (typeof fun !== 'function') { + throw new TypeError(); + } + var len = array ? array.length : 0; + for (var i = 0; i < len; i++) { + array[i] = fun(array[i]); + } + return array; + } - // 样式属性,默认状态样式样式属性 - style : { - path : {string},// 必须,路径。例如:M 0 0 L 0 10 L 10 10 Z (一个三角形) - //M = moveto - //L = lineto - //H = horizontal lineto - //V = vertical lineto - //C = curveto - //S = smooth curveto - //Q = quadratic Belzier curve - //T = smooth quadratic Belzier curveto - //Z = closepath - - - x : {number}, // 必须,x轴坐标 - y : {number}, // 必须,y轴坐标 - - - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为top,附加文本位置。 - // inside | left | right | top | bottom - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, + // 调整值区间 + function adjust(value, region) { + // < to <= & > to >= + // modify by linzhifeng 2014-05-25 because -0 == 0 + if (value <= region[0]) { + value = region[0]; + } + else if (value >= region[1]) { + value = region[1]; + } + return value; + } - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } + // 参见 http:// www.easyrgb.com/index.php?X=MATH + function _HSV_2_RGB(data) { + var H = data[0]; + var S = data[1]; + var V = data[2]; + // HSV from 0 to 1 + var R; + var G; + var B; + if (S === 0) { + R = V * 255; + G = V * 255; + B = V * 255; + } + else { + var h = H * 6; + if (h === 6) { + h = 0; + } + var i = h | 0; + var v1 = V * (1 - S); + var v2 = V * (1 - S * (h - i)); + var v3 = V * (1 - S * (1 - (h - i))); + var r = 0; + var g = 0; + var b = 0; - // 交互属性,详见shape.Base + if (i === 0) { + r = V; + g = v3; + b = v1; + } + else if (i === 1) { + r = v2; + g = V; + b = v1; + } + else if (i === 2) { + r = v1; + g = V; + b = v3; + } + else if (i === 3) { + r = v1; + g = v2; + b = V; + } + else if (i === 4) { + r = v3; + g = v1; + b = V; + } + else { + r = V; + g = v1; + b = v2; + } - // 事件属性,详见shape.Base - } + // RGB results from 0 to 255 + R = r * 255; + G = g * 255; + B = b * 255; + } + return [ R, G, B ]; + } + + function _HSL_2_RGB(data) { + var H = data[0]; + var S = data[1]; + var L = data[2]; + // HSL from 0 to 1 + var R; + var G; + var B; + if (S === 0) { + R = L * 255; + G = L * 255; + B = L * 255; + } + else { + var v2; + if (L < 0.5) { + v2 = L * (1 + S); + } + else { + v2 = (L + S) - (S * L); + } - **/ + var v1 = 2 * L - v2; -define('zrender/shape/Path',['require','./Base','../tool/util'],function (require) { - var Base = require('./Base'); - - function Path(options) { - Base.call(this, options); + R = 255 * _HUE_2_RGB(v1, v2, H + (1 / 3)); + G = 255 * _HUE_2_RGB(v1, v2, H); + B = 255 * _HUE_2_RGB(v1, v2, H - (1 / 3)); + } + return [ R, G, B ]; + } + + function _HUE_2_RGB(v1, v2, vH) { + if (vH < 0) { + vH += 1; + } + if (vH > 1) { + vH -= 1; + } + if ((6 * vH) < 1) { + return (v1 + (v2 - v1) * 6 * vH); + } + if ((2 * vH) < 1) { + return (v2); + } + if ((3 * vH) < 2) { + return (v1 + (v2 - v1) * ((2 / 3) - vH) * 6); + } + return v1; } - Path.prototype = { - type: 'path', + function _RGB_2_HSB(data) { + // RGB from 0 to 255 + var R = (data[0] / 255); + var G = (data[1] / 255); + var B = (data[2] / 255); - _parsePathData : function(data) { - if (!data) { - return []; - } + var vMin = Math.min(R, G, B); // Min. value of RGB + var vMax = Math.max(R, G, B); // Max. value of RGB + var delta = vMax - vMin; // Delta RGB value + var V = vMax; + var H; + var S; - // command string - var cs = data; + // HSV results from 0 to 1 + if (delta === 0) { + H = 0; + S = 0; + } + else { + S = delta / vMax; - // command chars - var cc = [ - 'm', 'M', 'l', 'L', 'v', 'V', 'h', 'H', 'z', 'Z', - 'c', 'C', 'q', 'Q', 't', 'T', 's', 'S', 'a', 'A' - ]; - - cs = cs.replace(/-/g, ' -'); - cs = cs.replace(/ /g, ' '); - cs = cs.replace(/ /g, ','); - cs = cs.replace(/,,/g, ','); - + var deltaR = (((vMax - R) / 6) + (delta / 2)) / delta; + var deltaG = (((vMax - G) / 6) + (delta / 2)) / delta; + var deltaB = (((vMax - B) / 6) + (delta / 2)) / delta; - var n; - // create pipes so that we can split the data - for (n = 0; n < cc.length; n++) { - cs = cs.replace(new RegExp(cc[n], 'g'), '|' + cc[n]); + if (R === vMax) { + H = deltaB - deltaG; + } + else if (G === vMax) { + H = (1 / 3) + deltaR - deltaB; + } + else if (B === vMax) { + H = (2 / 3) + deltaG - deltaR; } - // create array - var arr = cs.split('|'); - var ca = []; - // init context point - var cpx = 0; - var cpy = 0; - for (n = 1; n < arr.length; n++) { - var str = arr[n]; - var c = str.charAt(0); - str = str.slice(1); - str = str.replace(new RegExp('e,-', 'g'), 'e-'); + if (H < 0) { + H += 1; + } + if (H > 1) { + H -= 1; + } + } + H = H * 360; + S = S * 100; + V = V * 100; + return [ H, S, V ]; + } - var p = str.split(','); - if (p.length > 0 && p[0] === '') { - p.shift(); - } + function _RGB_2_HSL(data) { + // RGB from 0 to 255 + var R = (data[0] / 255); + var G = (data[1] / 255); + var B = (data[2] / 255); - for (var i = 0; i < p.length; i++) { - p[i] = parseFloat(p[i]); - } - while (p.length > 0) { - if (isNaN(p[0])) { - break; - } - var cmd = null; - var points = []; - - var ctlPtx; - var ctlPty; - var prevCmd; - - var rx; - var ry; - var psi; - var fa; - var fs; - - var x1 = cpx; - var y1 = cpy; - - // convert l, H, h, V, and v to L - switch (c) { - case 'l': - cpx += p.shift(); - cpy += p.shift(); - cmd = 'L'; - points.push(cpx, cpy); - break; - case 'L': - cpx = p.shift(); - cpy = p.shift(); - points.push(cpx, cpy); - break; - case 'm': - cpx += p.shift(); - cpy += p.shift(); - cmd = 'M'; - points.push(cpx, cpy); - c = 'l'; - break; - case 'M': - cpx = p.shift(); - cpy = p.shift(); - cmd = 'M'; - points.push(cpx, cpy); - c = 'L'; - break; + var vMin = Math.min(R, G, B); // Min. value of RGB + var vMax = Math.max(R, G, B); // Max. value of RGB + var delta = vMax - vMin; // Delta RGB value - case 'h': - cpx += p.shift(); - cmd = 'L'; - points.push(cpx, cpy); - break; - case 'H': - cpx = p.shift(); - cmd = 'L'; - points.push(cpx, cpy); - break; - case 'v': - cpy += p.shift(); - cmd = 'L'; - points.push(cpx, cpy); - break; - case 'V': - cpy = p.shift(); - cmd = 'L'; - points.push(cpx, cpy); - break; - case 'C': - points.push(p.shift(), p.shift(), p.shift(), p.shift()); - cpx = p.shift(); - cpy = p.shift(); - points.push(cpx, cpy); - break; - case 'c': - points.push( - cpx + p.shift(), cpy + p.shift(), - cpx + p.shift(), cpy + p.shift() - ); - cpx += p.shift(); - cpy += p.shift(); - cmd = 'C'; - points.push(cpx, cpy); - break; - case 'S': - ctlPtx = cpx; - ctlPty = cpy; - prevCmd = ca[ca.length - 1]; - if (prevCmd.command === 'C') { - ctlPtx = cpx + (cpx - prevCmd.points[2]); - ctlPty = cpy + (cpy - prevCmd.points[3]); - } - points.push(ctlPtx, ctlPty, p.shift(), p.shift()); - cpx = p.shift(); - cpy = p.shift(); - cmd = 'C'; - points.push(cpx, cpy); - break; - case 's': - ctlPtx = cpx, ctlPty = cpy; - prevCmd = ca[ca.length - 1]; - if (prevCmd.command === 'C') { - ctlPtx = cpx + (cpx - prevCmd.points[2]); - ctlPty = cpy + (cpy - prevCmd.points[3]); - } - points.push( - ctlPtx, ctlPty, - cpx + p.shift(), cpy + p.shift() - ); - cpx += p.shift(); - cpy += p.shift(); - cmd = 'C'; - points.push(cpx, cpy); - break; - case 'Q': - points.push(p.shift(), p.shift()); - cpx = p.shift(); - cpy = p.shift(); - points.push(cpx, cpy); - break; - case 'q': - points.push(cpx + p.shift(), cpy + p.shift()); - cpx += p.shift(); - cpy += p.shift(); - cmd = 'Q'; - points.push(cpx, cpy); - break; - case 'T': - ctlPtx = cpx, ctlPty = cpy; - prevCmd = ca[ca.length - 1]; - if (prevCmd.command === 'Q') { - ctlPtx = cpx + (cpx - prevCmd.points[0]); - ctlPty = cpy + (cpy - prevCmd.points[1]); - } - cpx = p.shift(); - cpy = p.shift(); - cmd = 'Q'; - points.push(ctlPtx, ctlPty, cpx, cpy); - break; - case 't': - ctlPtx = cpx, ctlPty = cpy; - prevCmd = ca[ca.length - 1]; - if (prevCmd.command === 'Q') { - ctlPtx = cpx + (cpx - prevCmd.points[0]); - ctlPty = cpy + (cpy - prevCmd.points[1]); - } - cpx += p.shift(); - cpy += p.shift(); - cmd = 'Q'; - points.push(ctlPtx, ctlPty, cpx, cpy); - break; - case 'A': - rx = p.shift(); - ry = p.shift(); - psi = p.shift(); - fa = p.shift(); - fs = p.shift(); - - x1 = cpx, y1 = cpy; - cpx = p.shift(), cpy = p.shift(); - cmd = 'A'; - points = this._convertPoint( - x1, y1, cpx, cpy, fa, fs, rx, ry, psi - ); - break; - case 'a': - rx = p.shift(); - ry = p.shift(); - psi = p.shift(); - fa = p.shift(); - fs = p.shift(); - - x1 = cpx, y1 = cpy; - cpx += p.shift(); - cpy += p.shift(); - cmd = 'A'; - points = this._convertPoint( - x1, y1, cpx, cpy, fa, fs, rx, ry, psi - ); - break; + var L = (vMax + vMin) / 2; + var H; + var S; + // HSL results from 0 to 1 + if (delta === 0) { + H = 0; + S = 0; + } + else { + if (L < 0.5) { + S = delta / (vMax + vMin); + } + else { + S = delta / (2 - vMax - vMin); + } - } + var deltaR = (((vMax - R) / 6) + (delta / 2)) / delta; + var deltaG = (((vMax - G) / 6) + (delta / 2)) / delta; + var deltaB = (((vMax - B) / 6) + (delta / 2)) / delta; - ca.push({ - command : cmd || c, - points : points - }); - } + if (R === vMax) { + H = deltaB - deltaG; + } + else if (G === vMax) { + H = (1 / 3) + deltaR - deltaB; + } + else if (B === vMax) { + H = (2 / 3) + deltaG - deltaR; + } - if (c === 'z' || c === 'Z') { - ca.push({ - command : 'z', - points : [] - }); - } + if (H < 0) { + H += 1; } - return ca; + if (H > 1) { + H -= 1; + } + } - }, + H = H * 360; + S = S * 100; + L = L * 100; - _convertPoint : function(x1, y1, x2, y2, fa, fs, rx, ry, psiDeg) { - var psi = psiDeg * (Math.PI / 180.0); - var xp = Math.cos(psi) * (x1 - x2) / 2.0 - + Math.sin(psi) * (y1 - y2) / 2.0; - var yp = -1 * Math.sin(psi) * (x1 - x2) / 2.0 - + Math.cos(psi) * (y1 - y2) / 2.0; + return [ H, S, L ]; + } - var lambda = (xp * xp) / (rx * rx) + (yp * yp) / (ry * ry); + return { + customPalette : customPalette, + resetPalette : resetPalette, + getColor : getColor, + getHighlightColor : getHighlightColor, + customHighlight : customHighlight, + resetHighlight : resetHighlight, + getRadialGradient : getRadialGradient, + getLinearGradient : getLinearGradient, + getGradientColors : getGradientColors, + getStepColors : getStepColors, + reverse : reverse, + mix : mix, + lift : lift, + trim : trim, + random : random, + toRGB : toRGB, + toRGBA : toRGBA, + toHex : toHex, + toHSL : toHSL, + toHSLA : toHSLA, + toHSB : toHSB, + toHSBA : toHSBA, + toHSV : toHSV, + toHSVA : toHSVA, + toName : toName, + toColor : toColor, + toArray : toArray, + alpha : alpha, + getData : getData + }; +}); - if (lambda > 1) { - rx *= Math.sqrt(lambda); - ry *= Math.sqrt(lambda); - } - var f = Math.sqrt((((rx * rx) * (ry * ry)) - - ((rx * rx) * (yp * yp)) - - ((ry * ry) * (xp * xp))) / ((rx * rx) * (yp * yp) - + (ry * ry) * (xp * xp)) - ); +/** + * shape基类 + * @module zrender/shape/Base + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * errorrik (errorrik@gmail.com) + */ - if (fa === fs) { - f *= -1; - } - if (isNaN(f)) { - f = 0; - } +/** + * @typedef {Object} IBaseShapeStyle + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ - var cxp = f * rx * yp / ry; - var cyp = f * -ry * xp / rx; +/** + * @typedef {Object} module:zrender/shape/Base~IBoundingRect + * @property {number} x 左上角顶点x轴坐标 + * @property {number} y 左上角顶点y轴坐标 + * @property {number} width 包围盒矩形宽度 + * @property {number} height 包围盒矩形高度 + */ - var cx = (x1 + x2) / 2.0 - + Math.cos(psi) * cxp - - Math.sin(psi) * cyp; - var cy = (y1 + y2) / 2.0 - + Math.sin(psi) * cxp - + Math.cos(psi) * cyp; +define( + 'zrender/shape/Base',['require','../tool/matrix','../tool/guid','../tool/util','../tool/log','../mixin/Transformable','../mixin/Eventful','../tool/area','../tool/area','../tool/color','../tool/area'],function(require) { + var matrix = require('../tool/matrix'); + var guid = require('../tool/guid'); + var util = require('../tool/util'); + var log = require('../tool/log'); - var vMag = function(v) { - return Math.sqrt(v[0] * v[0] + v[1] * v[1]); - }; - var vRatio = function(u, v) { - return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v)); - }; - var vAngle = function(u, v) { - return (u[0] * v[1] < u[1] * v[0] ? -1 : 1) - * Math.acos(vRatio(u, v)); - }; - var theta = vAngle([ 1, 0 ], [ (xp - cxp) / rx, (yp - cyp) / ry ]); - var u = [ (xp - cxp) / rx, (yp - cyp) / ry ]; - var v = [ (-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry ]; - var dTheta = vAngle(u, v); + var Transformable = require('../mixin/Transformable'); + var Eventful = require('../mixin/Eventful'); - if (vRatio(u, v) <= -1) { - dTheta = Math.PI; - } - if (vRatio(u, v) >= 1) { - dTheta = 0; + function _fillText(ctx, text, x, y, textFont, textAlign, textBaseline) { + if (textFont) { + ctx.font = textFont; } - if (fs === 0 && dTheta > 0) { - dTheta = dTheta - 2 * Math.PI; + ctx.textAlign = textAlign; + ctx.textBaseline = textBaseline; + var rect = _getTextRect( + text, x, y, textFont, textAlign, textBaseline + ); + + text = (text + '').split('\n'); + var lineHeight = require('../tool/area').getTextHeight('国', textFont); + + switch (textBaseline) { + case 'top': + y = rect.y; + break; + case 'bottom': + y = rect.y + lineHeight; + break; + default: + y = rect.y + lineHeight / 2; } - if (fs === 1 && dTheta < 0) { - dTheta = dTheta + 2 * Math.PI; + + for (var i = 0, l = text.length; i < l; i++) { + ctx.fillText(text[i], x, y); + y += lineHeight; } - return [ cx, cy, rx, ry, theta, dTheta, psi, fs ]; - }, + } /** - * 创建路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 + * 返回矩形区域,用于局部刷新和文字定位 + * @inner + * @param {string} text + * @param {number} x + * @param {number} y + * @param {string} textFont + * @param {string} textAlign + * @param {string} textBaseline */ - buildPath : function(ctx, style) { - var path = style.path; - - var pathArray = this.pathArray || this._parsePathData(path); - - // 平移坐标 - var x = style.x || 0; - var y = style.y || 0; - - var p; - // 记录边界点,用于判断inside - var pointList = style.pointList = []; - var singlePointList = []; - for (var i = 0, l = pathArray.length; i < l; i++) { - if (pathArray[i].command.toUpperCase() == 'M') { - singlePointList.length > 0 - && pointList.push(singlePointList); - singlePointList = []; - } - p = pathArray[i].points; - for (var j = 0, k = p.length; j < k; j += 2) { - singlePointList.push([p[j] + x, p[j+1] + y]); - } - } - singlePointList.length > 0 && pointList.push(singlePointList); + function _getTextRect(text, x, y, textFont, textAlign, textBaseline) { + var area = require('../tool/area'); + var width = area.getTextWidth(text, textFont); + var lineHeight = area.getTextHeight('国', textFont); - var c; - for (var i = 0, l = pathArray.length; i < l; i++) { - c = pathArray[i].command; - p = pathArray[i].points; - // 平移变换 - for (var j = 0, k = p.length; j < k; j++) { - if (j % 2 === 0) { - p[j] += x; - } else { - p[j] += y; - } - } - switch (c) { - case 'L': - ctx.lineTo(p[0], p[1]); - break; - case 'M': - ctx.moveTo(p[0], p[1]); - break; - case 'C': - ctx.bezierCurveTo(p[0], p[1], p[2], p[3], p[4], p[5]); - break; - case 'Q': - ctx.quadraticCurveTo(p[0], p[1], p[2], p[3]); - break; - case 'A': - var cx = p[0]; - var cy = p[1]; - var rx = p[2]; - var ry = p[3]; - var theta = p[4]; - var dTheta = p[5]; - var psi = p[6]; - var fs = p[7]; - var r = (rx > ry) ? rx : ry; - var scaleX = (rx > ry) ? 1 : rx / ry; - var scaleY = (rx > ry) ? ry / rx : 1; - - ctx.translate(cx, cy); - ctx.rotate(psi); - ctx.scale(scaleX, scaleY); - ctx.arc(0, 0, r, theta, theta + dTheta, 1 - fs); - ctx.scale(1 / scaleX, 1 / scaleY); - ctx.rotate(-psi); - ctx.translate(-cx, -cy); - break; - case 'z': - ctx.closePath(); - break; - } + text = (text + '').split('\n'); + + switch (textAlign) { + case 'end': + case 'right': + x -= width; + break; + case 'center': + x -= (width / 2); + break; } - return; - }, + switch (textBaseline) { + case 'top': + break; + case 'bottom': + y -= lineHeight * text.length; + break; + default: + y -= lineHeight * text.length / 2; + } + + return { + x : x, + y : y, + width : width, + height : lineHeight * text.length + }; + } /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style 样式 + * @alias module:zrender/shape/Base + * @constructor + * @extends module:zrender/mixin/Transformable + * @extends module:zrender/mixin/Eventful + * @param {Object} options 关于shape的配置项,可以是shape的自有属性,也可以是自定义的属性。 */ - getRect : function(style) { - if (style.__rect) { - return style.__rect; - } + var Base = function(options) { - var lineWidth; - if (style.brushType == 'stroke' || style.brushType == 'fill') { - lineWidth = style.lineWidth || 1; - } - else { - lineWidth = 0; + options = options || {}; + + /** + * Shape id, 全局唯一 + * @type {string} + */ + this.id = options.id || guid(); + + for (var key in options) { + this[key] = options[key]; } - var minX = Number.MAX_VALUE; - var maxX = Number.MIN_VALUE; + /** + * 基础绘制样式 + * @type {module:zrender/shape/Base~IBaseShapeStyle} + */ + this.style = this.style || {}; - var minY = Number.MAX_VALUE; - var maxY = Number.MIN_VALUE; + /** + * 高亮样式 + * @type {module:zrender/shape/Base~IBaseShapeStyle} + */ + this.highlightStyle = this.highlightStyle || null; - // 平移坐标 - var x = style.x || 0; - var y = style.y || 0; + /** + * 父节点 + * @readonly + * @type {module:zrender/Group} + * @default null + */ + this.parent = null; - var pathArray = this.pathArray || this._parsePathData(style.path); - for (var i = 0; i < pathArray.length; i++) { - var p = pathArray[i].points; + this.__dirty = true; - for (var j = 0; j < p.length; j++) { - if (j % 2 === 0) { - if (p[j] + x < minX) { - minX = p[j] + x; - } - if (p[j] + x > maxX) { - maxX = p[j] + x; - } - } - else { - if (p[j] + y < minY) { - minY = p[j] + y; - } - if (p[j] + y > maxY) { - maxY = p[j] + y; - } - } - } - } + Transformable.call(this); + Eventful.call(this); + }; + /** + * 图形是否可见,为true时不绘制图形,但是仍能触发鼠标事件 + * @name module:zrender/shape/Base#invisible + * @type {boolean} + * @default false + */ + Base.prototype.invisible = false; - var rect; - if (minX === Number.MAX_VALUE - || maxX === Number.MIN_VALUE - || minY === Number.MAX_VALUE - || maxY === Number.MIN_VALUE - ) { - rect = { - x : 0, - y : 0, - width : 0, - height : 0 - }; - } - else { - rect = { - x : Math.round(minX - lineWidth / 2), - y : Math.round(minY - lineWidth / 2), - width : maxX - minX + lineWidth, - height : maxY - minY + lineWidth - }; - } - style.__rect = rect; - return rect; - } - }; + /** + * 图形是否忽略,为true时忽略图形的绘制以及事件触发 + * @name module:zrender/shape/Base#ignore + * @type {boolean} + * @default false + */ + Base.prototype.ignore = false; - require('../tool/util').inherits(Path, Base); - return Path; -}); -/** - * zrender: 图形空间辅助类 - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * isInside:是否在区域内部 - * isOutside:是否在区域外部 - * getTextWidth:测算单行文本宽度 - */ -define( - 'zrender/tool/area',['require','../tool/util','../shape/Path'],function(require) { - var util = require('../tool/util'); + /** + * z层level,决定绘画在哪层canvas中 + * @name module:zrender/shape/Base#zlevel + * @type {number} + * @default 0 + */ + Base.prototype.zlevel = 0; - var _ctx; - - var _textWidthCache = {}; - var _textHeightCache = {}; - var _textWidthCacheCounter = 0; - var _textHeightCacheCounter = 0; - var TEXT_CACHE_MAX = 20000; - /** - * 包含判断 - * - * @param {Object} shape : 图形 - * @param {Object} area : 目标区域 - * @param {number} x : 横坐标 - * @param {number} y : 纵坐标 + * 是否可拖拽 + * @name module:zrender/shape/Base#draggable + * @type {boolean} + * @default false */ - function isInside(shape, area, x, y) { - if (!area || !shape) { - // 无参数或不支持类型 - return false; - } - var zoneType = shape.type; + Base.prototype.draggable = false; - _ctx = _ctx || util.getContext(); + /** + * 是否可点击 + * @name module:zrender/shape/Base#clickable + * @type {boolean} + * @default false + */ + Base.prototype.clickable = false; - if (!_isInsideRectangle(area.__rect || shape.getRect(area), x, y)) { - // 不在矩形区域内直接返回false - return false; - } + /** + * 是否可以hover + * @name module:zrender/shape/Base#hoverable + * @type {boolean} + * @default true + */ + Base.prototype.hoverable = true; + + /** + * z值,跟zlevel一样影响shape绘制的前后顺序,z值大的shape会覆盖在z值小的上面, + * 但是并不会创建新的canvas,所以优先级低于zlevel,而且频繁改动的开销比zlevel小很多。 + * + * @name module:zrender/shape/Base#z + * @type {number} + * @default 0 + */ + Base.prototype.z = 0; - // 未实现或不可用时(excanvas不支持)则数学运算,主要是line,brokenLine,ring - var _mathReturn = _mathMethod(zoneType, area, x, y); - if (typeof _mathReturn != 'undefined') { - return _mathReturn; + /** + * 绘制图形 + * + * @param {CanvasRenderingContext2D} ctx + * @param {boolean} [isHighlight=false] 是否使用高亮属性 + * @param {Function} [updateCallback] + * 需要异步加载资源的shape可以通过这个callback(e), + * 让painter更新视图,base.brush没用,需要的话重载brush + */ + Base.prototype.brush = function (ctx, isHighlight) { + var style = this.style; + + if (this.brushTypeOnly) { + style.brushType = this.brushTypeOnly; } - if (zoneType != 'bezier-curve' - && shape.buildPath - && _ctx.isPointInPath - ) { - return _buildPathMethod(shape, _ctx, area, x, y); + if (isHighlight) { + // 根据style扩展默认高亮样式 + style = this.getHighlightStyle( + style, + this.highlightStyle || {}, + this.brushTypeOnly + ); } - else if (_ctx.getImageData) { - return _pixelMethod(shape, area, x, y); + + if (this.brushTypeOnly == 'stroke') { + style.strokeColor = style.strokeColor || style.color; } - // 上面的方法都行不通时 - switch (zoneType) { - case 'heart': //心形---------10 // Todo,不精确 - case 'droplet':// 水滴----------11 // Todo,不精确 - case 'ellipse': // Todo,不精确 - return true; - // 旋轮曲线 不准确 - case 'trochoid': - var _r = area.location == 'out' - ? area.r1 + area.r2 + area.d - : area.r1 - area.r2 + area.d; - return _isInsideCircle(area, x, y, _r); - // 玫瑰线 不准确 - case 'rose' : - return _isInsideCircle(area, x, y, area.maxr); - //路径,椭圆,曲线等-----------------13 + ctx.save(); + + this.setContext(ctx, style); + + // 设置transform + this.setTransform(ctx); + + ctx.beginPath(); + this.buildPath(ctx, style); + + switch (style.brushType) { + /* jshint ignore:start */ + case 'both': + ctx.fill(); + case 'stroke': + style.lineWidth > 0 && ctx.stroke(); + break; + /* jshint ignore:end */ default: - return false; // Todo,暂不支持 + ctx.fill(); } - } + + this.drawText(ctx, style, this.style); - /** - * 用数学方法判断,三个方法中最快,但是支持的shape少 - * - * @param {string} zoneType : 图形类型 - * @param {Object} area :目标区域 - * @param {number} x : 横坐标 - * @param {number} y : 纵坐标 - * @return {boolean=} true表示坐标处在图形中 - */ - function _mathMethod(zoneType, area, x, y) { - // 在矩形内则部分图形需要进一步判断 - switch (zoneType) { - //线-----------------------1 - case 'line': - return _isInsideLine(area, x, y); - //折线----------------------2 - case 'broken-line': - return _isInsideBrokenLine(area, x, y); - //文本----------------------3 - case 'text': - return true; - //圆环----------------------4 - case 'ring': - return _isInsideRing(area, x, y); - //矩形----------------------5 - case 'rectangle': - return true; - //圆形----------------------6 - case 'circle': - return _isInsideCircle(area, x, y, area.r); - //扇形----------------------7 - case 'sector': - return _isInsideSector(area, x, y); - //多边形---------------------8 - case 'path': - return _isInsidePath(area, x, y); - case 'polygon': - case 'star': - case 'isogon': - return _isInsidePolygon(area, x, y); - //图片----------------------9 - case 'image': - return true; - } - } + ctx.restore(); + }; - /** - * 通过buildPath方法来判断,三个方法中较快,但是不支持线条类型的shape, - * 而且excanvas不支持isPointInPath方法 - * - * @param {Object} shape : shape - * @param {Object} context : 上下文 - * @param {Object} area :目标区域 - * @param {number} x : 横坐标 - * @param {number} y : 纵坐标 - * @return {boolean} true表示坐标处在图形中 - */ - function _buildPathMethod(shape, context, area, x, y) { - // 图形类实现路径创建了则用类的path - context.beginPath(); - shape.buildPath(context, area); - context.closePath(); - return context.isPointInPath(x, y); - } + var STYLE_CTX_MAP = [ + [ 'color', 'fillStyle' ], + [ 'strokeColor', 'strokeStyle' ], + [ 'opacity', 'globalAlpha' ], + [ 'lineCap', 'lineCap' ], + [ 'lineJoin', 'lineJoin' ], + [ 'miterLimit', 'miterLimit' ], + [ 'lineWidth', 'lineWidth' ], + [ 'shadowBlur', 'shadowBlur' ], + [ 'shadowColor', 'shadowColor' ], + [ 'shadowOffsetX', 'shadowOffsetX' ], + [ 'shadowOffsetY', 'shadowOffsetY' ] + ]; /** - * 通过像素值来判断,三个方法中最慢,但是支持广,不足之处是excanvas不支持像素处理 - * - * @param {Object} shape shape类 - * @param {Object} area 目标区域 - * @param {number} x 横坐标 - * @param {number} y 纵坐标 - * @return {boolean} true表示坐标处在图形中 + * 设置 fillStyle, strokeStyle, shadow 等通用绘制样式 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Base~IBaseShapeStyle} style */ - function _pixelMethod(shape, area, x, y) { - var _rect = area.__rect || shape.getRect(area); - var _context = util.getPixelContext(); - var _offset = util.getPixelOffset(); - - util.adjustCanvasSize(x, y); - _context.clearRect(_rect.x, _rect.y, _rect.width, _rect.height); - _context.beginPath(); - shape.brush(_context, {style : area}); - _context.closePath(); - - return _isPainted(_context, x + _offset.x, y + _offset.y); - } + Base.prototype.setContext = function (ctx, style) { + for (var i = 0, len = STYLE_CTX_MAP.length; i < len; i++) { + var styleProp = STYLE_CTX_MAP[i][0]; + var styleValue = style[styleProp]; + var ctxProp = STYLE_CTX_MAP[i][1]; + if (typeof styleValue != 'undefined') { + ctx[ctxProp] = styleValue; + } + } + }; + /** - * 坐标像素值,判断坐标是否被作色 - * - * @param {Object} context : 上下文 - * @param {number} x : 横坐标 - * @param {number} y : 纵坐标 - * @param {number=} unit : 触发的精度,越大越容易触发,可选,缺省是为1 - * @return {boolean} 已经被画过返回true + * 根据默认样式扩展高亮样式 + * + * @param {module:zrender/shape/Base~IBaseShapeStyle} style 默认样式 + * @param {module:zrender/shape/Base~IBaseShapeStyle} highlightStyle 高亮样式 + * @param {string} brushTypeOnly */ - function _isPainted(context, x, y, unit) { - var pixelsData; + Base.prototype.getHighlightStyle = function (style, highlightStyle, brushTypeOnly) { + var newStyle = {}; + for (var k in style) { + newStyle[k] = style[k]; + } - if (typeof unit != 'undefined') { - unit = (unit || 1 ) >> 1; - pixelsData = context.getImageData( - x - unit, - y - unit, - unit + unit, - unit + unit - ).data; + var color = require('../tool/color'); + var highlightColor = color.getHighlightColor(); + // 根据highlightStyle扩展 + if (style.brushType != 'stroke') { + // 带填充则用高亮色加粗边线 + newStyle.strokeColor = highlightColor; + newStyle.lineWidth = (style.lineWidth || 1) + + this.getHighlightZoom(); + newStyle.brushType = 'both'; } else { - pixelsData = context.getImageData(x, y, 1, 1).data; + if (brushTypeOnly != 'stroke') { + // 描边型的则用原色加工高亮 + newStyle.strokeColor = highlightColor; + newStyle.lineWidth = (style.lineWidth || 1) + + this.getHighlightZoom(); + } + else { + // 线型的则用原色加工高亮 + newStyle.strokeColor = highlightStyle.strokeColor + || color.mix( + style.strokeColor, + color.toRGB(highlightColor) + ); + } } - var len = pixelsData.length; - while (len--) { - if (pixelsData[len] !== 0) { - return true; + // 可自定义覆盖默认值 + for (var k in highlightStyle) { + if (typeof highlightStyle[k] != 'undefined') { + newStyle[k] = highlightStyle[k]; } } - return false; - } + return newStyle; + }; + + // 高亮放大效果参数 + // 当前统一设置为6,如有需要差异设置,通过this.type判断实例类型 + Base.prototype.getHighlightZoom = function () { + return this.type != 'text' ? 6 : 2; + }; /** - * !isInside + * 移动位置 + * @param {number} dx 横坐标变化 + * @param {number} dy 纵坐标变化 */ - function isOutside(shape, area, x, y) { - return !isInside(shape, area, x, y); - } + Base.prototype.drift = function (dx, dy) { + this.position[0] += dx; + this.position[1] += dy; + }; /** - * 线段包含判断 + * 变换鼠标位置到 shape 的局部坐标空间 + * @method + * @param {number} x + * @param {number} y + * @return {Array.} */ - function _isInsideLine(area, x, y) { - var _x1 = area.xStart; - var _y1 = area.yStart; - var _x2 = area.xEnd; - var _y2 = area.yEnd; - var _l = Math.max(area.lineWidth, 5); - var _a = 0; - var _b = _x1; - - var minX, maxX; - if (_x1 < _x2) { - minX = _x1 - _l; maxX = _x2 + _l; - } else { - minX = _x2 - _l; maxX = _x1 + _l; - } - - var minY, maxY; - if (_y1 < _y2) { - minY = _y1 - _l; maxY = _y2 + _l; - } else { - minY = _y2 - _l; maxY = _y1 + _l; - } - - if (x < minX || x > maxX || y < minY || y > maxY) { - return false; - } + Base.prototype.getTansform = (function() { + + var invTransform = []; - if (_x1 !== _x2) { - _a = (_y1 - _y2) / (_x1 - _x2); - _b = (_x1 * _y2 - _x2 * _y1) / (_x1 - _x2) ; - } - else { - return Math.abs(x - _x1) <= _l / 2; - } + return function (x, y) { + var originPos = [ x, y ]; + // 对鼠标的坐标也做相同的变换 + if (this.needTransform && this.transform) { + matrix.invert(invTransform, this.transform); - var _s = (_a * x - y + _b) * (_a * x - y + _b) / (_a * _a + 1); - return _s <= _l / 2 * _l / 2; - } + matrix.mulVector(originPos, invTransform, [ x, y, 1 ]); - function _isInsideBrokenLine(area, x, y) { - var pointList = area.pointList; - var lineArea = { - xStart : 0, - yStart : 0, - xEnd : 0, - yEnd : 0, - lineWidth : 0 - }; - for (var i = 0, l = pointList.length - 1; i < l; i++) { - lineArea.xStart = pointList[i][0]; - lineArea.yStart = pointList[i][1]; - lineArea.xEnd = pointList[i + 1][0]; - lineArea.yEnd = pointList[i + 1][1]; - lineArea.lineWidth = Math.max(area.lineWidth, 10); - - if (_isInsideLine(lineArea, x, y)) { - return true; + if (x == originPos[0] && y == originPos[1]) { + // 避免外部修改导致的needTransform不准确 + this.updateNeedTransform(); + } } - } - - return false; - } - - function _isInsideRing(area, x, y) { - return _isInsideCircle(area, x, y, area.r) - && !_isInsideCircle({x: area.x, y: area.y}, x, y, area.r0 || 0); - } + return originPos; + }; + })(); /** - * 矩形包含判断 + * 构建绘制的Path + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Base~IBaseShapeStyle} style */ - function _isInsideRectangle(area, x, y) { - return x >= area.x - && x <= (area.x + area.width) - && y >= area.y - && y <= (area.y + area.height); - } + Base.prototype.buildPath = function (ctx, style) { + log('buildPath not implemented in ' + this.type); + }; /** - * 圆形包含判断 + * 计算返回包围盒矩形 + * @param {module:zrender/shape/Base~IBaseShapeStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} */ - function _isInsideCircle(area, x, y, r) { - return (x - area.x) * (x - area.x) + (y - area.y) * (y - area.y) - < r * r; - } - + Base.prototype.getRect = function (style) { + log('getRect not implemented in ' + this.type); + }; + /** - * 扇形包含判断 + * 判断鼠标位置是否在图形内 + * @param {number} x + * @param {number} y + * @return {boolean} */ - function _isInsideSector(area, x, y) { - if (!_isInsideCircle(area, x, y, area.r) - || (area.r0 > 0 - && _isInsideCircle( - { - x : area.x, - y : area.y - }, - x, y, - area.r0 - ) - ) - ){ - // 大圆外或者小圆内直接false - return false; + Base.prototype.isCover = function (x, y) { + var originPos = this.getTansform(x, y); + x = originPos[0]; + y = originPos[1]; + + // 快速预判并保留判断矩形 + var rect = this.style.__rect; + if (!rect) { + rect = this.style.__rect = this.getRect(this.style); } - // 判断夹角 - if (Math.abs(area.endAngle - area.startAngle) >= 360) { - // 大于360度的扇形,在环内就为true - return true; + if (x >= rect.x + && x <= (rect.x + rect.width) + && y >= rect.y + && y <= (rect.y + rect.height) + ) { + // 矩形内 + return require('../tool/area').isInside(this, this.style, x, y); } - var angle = (360 - - Math.atan2(y - area.y, x - area.x) / Math.PI - * 180) - % 360; - var endA = (360 + area.endAngle) % 360; - var startA = (360 + area.startAngle) % 360; - if (endA > startA) { - return (angle >= startA && angle <= endA); - } - - return !(angle >= endA && angle <= startA); - } + return false; + }; /** - * 多边形包含判断 - * 警告:下面这段代码会很难看,建议跳过~ + * 绘制附加文本 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Base~IBaseShapeStyle} style 样式 + * @param {module:zrender/shape/Base~IBaseShapeStyle} normalStyle 默认样式,用于定位文字显示 */ - function _isInsidePolygon(area, x, y) { - /** - * 射线判别法 - * 如果一个点在多边形内部,任意角度做射线肯定会与多边形要么有一个交点,要么有与多边形边界线重叠 - * 如果一个点在多边形外部,任意角度做射线要么与多边形有一个交点, - * 要么有两个交点,要么没有交点,要么有与多边形边界线重叠。 - */ - var i; - var j; - var polygon = area.pointList; - var N = polygon.length; - var inside = false; - var redo = true; - var v; - - for (i = 0; i < N; ++i) { - // 是否在顶点上 - if (polygon[i][0] == x && polygon[i][1] == y ) { - redo = false; - inside = true; - break; - } + Base.prototype.drawText = function (ctx, style, normalStyle) { + if (typeof(style.text) == 'undefined' || style.text === false) { + return; } + // 字体颜色策略 + var textColor = style.textColor || style.color || style.strokeColor; + ctx.fillStyle = textColor; - if (redo) { - redo = false; - inside = false; - for (i = 0,j = N - 1; i < N; j = i++) { - if ((polygon[i][1] < y && y < polygon[j][1]) - || (polygon[j][1] < y && y < polygon[i][1]) - ) { - if (x <= polygon[i][0] || x <= polygon[j][0]) { - v = (y - polygon[i][1]) - * (polygon[j][0] - polygon[i][0]) - / (polygon[j][1] - polygon[i][1]) - + polygon[i][0]; - if (x < v) { // 在线的左侧 - inside = !inside; - } - else if (x == v) { // 在线上 - inside = true; + // 文本与图形间空白间隙 + var dd = 10; + var al; // 文本水平对齐 + var bl; // 文本垂直对齐 + var tx; // 文本横坐标 + var ty; // 文本纵坐标 + + var textPosition = style.textPosition // 用户定义 + || this.textPosition // shape默认 + || 'top'; // 全局默认 + + switch (textPosition) { + case 'inside': + case 'top': + case 'bottom': + case 'left': + case 'right': + if (this.getRect) { + var rect = (normalStyle || style).__rect + || this.getRect(normalStyle || style); + + switch (textPosition) { + case 'inside': + tx = rect.x + rect.width / 2; + ty = rect.y + rect.height / 2; + al = 'center'; + bl = 'middle'; + if (style.brushType != 'stroke' + && textColor == style.color + ) { + ctx.fillStyle = '#fff'; + } + break; + case 'left': + tx = rect.x - dd; + ty = rect.y + rect.height / 2; + al = 'end'; + bl = 'middle'; + break; + case 'right': + tx = rect.x + rect.width + dd; + ty = rect.y + rect.height / 2; + al = 'start'; + bl = 'middle'; + break; + case 'top': + tx = rect.x + rect.width / 2; + ty = rect.y - dd; + al = 'center'; + bl = 'bottom'; + break; + case 'bottom': + tx = rect.x + rect.width / 2; + ty = rect.y + rect.height + dd; + al = 'center'; + bl = 'top'; break; - } } } - else if (y == polygon[i][1]) { - if (x < polygon[i][0]) { // 交点在顶点上 - polygon[i][1] > polygon[j][1] ? --y : ++y; - //redo = true; - break; + break; + case 'start': + case 'end': + var xStart; + var xEnd; + var yStart; + var yEnd; + if (typeof style.pointList != 'undefined') { + var pointList = style.pointList; + if (pointList.length < 2) { + // 少于2个点就不画了~ + return; + } + var length = pointList.length; + switch (textPosition) { + case 'start': + xStart = pointList[0][0]; + xEnd = pointList[1][0]; + yStart = pointList[0][1]; + yEnd = pointList[1][1]; + break; + case 'end': + xStart = pointList[length - 2][0]; + xEnd = pointList[length - 1][0]; + yStart = pointList[length - 2][1]; + yEnd = pointList[length - 1][1]; + break; } } - else if (polygon[i][1] == polygon[j][1] // 在水平的边界线上 - && y == polygon[i][1] - && ((polygon[i][0] < x && x < polygon[j][0]) - || (polygon[j][0] < x && x < polygon[i][0])) - ) { - inside = true; - break; + else { + xStart = style.xStart || 0; + xEnd = style.xEnd || 0; + yStart = style.yStart || 0; + yEnd = style.yEnd || 0; } - } - } - return inside; - } - - /** - * 路径包含判断,依赖多边形判断 - */ - function _isInsidePath(area, x, y) { - if (!area.pointList) { - require('../shape/Path').prototype.buildPath(_ctx, area); - } - var pointList = area.pointList; - var insideCatch = false; - for (var i = 0, l = pointList.length; i < l; i++) { - insideCatch = _isInsidePolygon( - { pointList : pointList[i] }, x, y - ); - - if (insideCatch) { - break; - } - } - return insideCatch; - } + switch (textPosition) { + case 'start': + al = xStart < xEnd ? 'end' : 'start'; + bl = yStart < yEnd ? 'bottom' : 'top'; + tx = xStart; + ty = yStart; + break; + case 'end': + al = xStart < xEnd ? 'start' : 'end'; + bl = yStart < yEnd ? 'top' : 'bottom'; + tx = xEnd; + ty = yEnd; + break; + } + dd -= 4; + if (xStart != xEnd) { + tx -= (al == 'end' ? dd : -dd); + } + else { + al = 'center'; + } - /** - * 测算多行文本宽度 - * @param {Object} text - * @param {Object} textFont - */ - function getTextWidth(text, textFont) { - var key = text+':'+textFont; - if (_textWidthCache[key]) { - return _textWidthCache[key]; + if (yStart != yEnd) { + ty -= (bl == 'bottom' ? dd : -dd); + } + else { + bl = 'middle'; + } + break; + case 'specific': + tx = style.textX || 0; + ty = style.textY || 0; + al = 'start'; + bl = 'middle'; + break; } - _ctx = _ctx || util.getContext(); - _ctx.save(); - if (textFont) { - _ctx.font = textFont; - } - - text = (text + '').split('\n'); - var width = 0; - for (var i = 0, l = text.length; i < l; i++) { - width = Math.max( - _ctx.measureText(text[i]).width, - width + if (tx != null && ty != null) { + _fillText( + ctx, + style.text, + tx, ty, + style.textFont, + style.textAlign || al, + style.textBaseline || bl ); } - _ctx.restore(); + }; - _textWidthCache[key] = width; - if (++_textWidthCacheCounter > TEXT_CACHE_MAX) { - // 内存释放 - _textWidthCacheCounter = 0; - _textWidthCache = {}; + Base.prototype.modSelf = function() { + this.__dirty = true; + if (this.style) { + this.style.__rect = null; } - - return width; - } - + }; + /** - * 测算多行文本高度 - * @param {Object} text - * @param {Object} textFont + * 图形是否会触发事件 + * @return {boolean} */ - function getTextHeight(text, textFont) { - var key = text+':'+textFont; - if (_textHeightCache[key]) { - return _textHeightCache[key]; - } - - _ctx = _ctx || util.getContext(); - - _ctx.save(); - if (textFont) { - _ctx.font = textFont; - } - - text = (text + '').split('\n'); - //比较粗暴 - var height = (_ctx.measureText('国').width + 2) * text.length; - - _ctx.restore(); + // TODO, 通过 bind 绑定的事件 + Base.prototype.isSilent = function () { + return !( + this.hoverable || this.draggable || this.clickable + || this.onmousemove || this.onmouseover || this.onmouseout + || this.onmousedown || this.onmouseup || this.onclick + || this.ondragenter || this.ondragover || this.ondragleave + || this.ondrop + ); + }; - _textHeightCache[key] = height; - if (++_textHeightCacheCounter > TEXT_CACHE_MAX) { - // 内存释放 - _textHeightCacheCounter = 0; - _textHeightCache = {}; - } - return height; - } + util.merge(Base.prototype, Transformable.prototype, true); + util.merge(Base.prototype, Eventful.prototype, true); - return { - isInside : isInside, - isOutside : isOutside, - getTextWidth : getTextWidth, - getTextHeight : getTextHeight - }; + return Base; } ); /** - * zrender - * + * @module zrender/shape/Text * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:文字 - * 可配图形属性: - { - // 基础属性 - shape : 'text', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,横坐标 - y : {number}, // 必须,纵坐标 - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',线条颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 必须,文本内容 - textFont : {string}, // 默认为null,文本文字样式,eg:'bold 18px verdana' - textAlign : {string}, // 默认为start,文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认为middle,文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - maxWidth : {number} // 默认为null,最大宽度 - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'text', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - color : 'red', - text : 'Baidu' - }, - myName : 'kener', //可自带任何有效自定义属性 + * @example + * var Text = require('zrender/shape/Text'); + * var shape = new Text({ + * style: { + * text: 'Label', + * x: 100, + * y: 100, + * textFont: '14px Arial' + * } + * }); + * zr.addShape(shape); + */ - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } +/** + * @typedef {Object} ITextStyle + * @property {number} x 横坐标 + * @property {number} y 纵坐标 + * @property {string} text 文本内容 + * @property {number} [maxWidth=null] 最大宽度限制 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 */ + define( 'zrender/shape/Text',['require','../tool/area','./Base','../tool/util'],function (require) { var area = require('../tool/area'); var Base = require('./Base'); - function Text(options) { + /** + * @alias module:zrender/shape/Text + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var Text = function (options) { Base.call(this, options); - } + /** + * 文字绘制样式 + * @name module:zrender/shape/Text#style + * @type {module:zrender/shape/Text~ITextStyle} + */ + /** + * 文字高亮绘制样式 + * @name module:zrender/shape/Text#highlightStyle + * @type {module:zrender/shape/Text~ITextStyle} + */ + }; Text.prototype = { type: 'text', - /** - * 画刷,重载基类方法 - * @param {Context2D} ctx Canvas 2D上下文 - * @param isHighlight 是否为高亮状态 - */ - brush : function(ctx, isHighlight) { + brush : function (ctx, isHighlight) { var style = this.style; if (isHighlight) { // 根据style扩展默认高亮样式 @@ -7687,7 +8719,7 @@ define( ); } } - else{ + else { switch (style.brushType) { case 'fill': ctx.fillText(text[i], x, y); @@ -7711,10 +8743,11 @@ define( }, /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style + * 返回文字包围盒矩形 + * @param {module:zrender/shape/Text~ITextStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} */ - getRect : function(style) { + getRect : function (style) { if (style.__rect) { return style.__rect; } @@ -7722,7 +8755,7 @@ define( var width = area.getTextWidth(style.text, style.textFont); var height = area.getTextHeight(style.text, style.textFont); - var textX = style.x; //默认start == left + var textX = style.x; // 默认start == left if (style.textAlign == 'end' || style.textAlign == 'right') { textX -= width; } @@ -7758,105 +8791,85 @@ define( } ); + /** - * zrender - * + * 矩形 + * @module zrender/shape/Rectangle * @author Kener (@Kener-林峰, linzhifeng@baidu.com) , * strwind (@劲风FEI, yaofeifei@baidu.com) - * - * shape类:矩形 - * 可配图形属性: - { - // 基础属性 - shape : 'rectangle', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,左上角横坐标 - y : {number}, // 必须,左上角纵坐标 - width : {number}, // 必须,宽度 - height : {number}, // 必须,高度 - radius : {array}, // 默认为[0],圆角 - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为top,附加文本位置。 - // inside | left | right | top | bottom - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'rectangle', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - width : 150, - height : 50, - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 + * @example + * var Rectangle = require('zrender/shape/Rectangle'); + * var shape = new Rectangle({ + * style: { + * x: 0, + * y: 0, + * width: 100, + * height: 100, + * radius: 20 + * } + * }); + * zr.addShape(shape); + */ - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } +/** + * @typedef {Object} IRectangleStyle + * @property {number} x 左上角x坐标 + * @property {number} y 左上角y坐标 + * @property {number} width 宽度 + * @property {number} height 高度 + * @property {number|Array.} radius 矩形圆角,可以用数组分别指定四个角的圆角 + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic */ define( 'zrender/shape/Rectangle',['require','./Base','../tool/util'],function (require) { var Base = require('./Base'); - function Rectangle(options) { + /** + * @alias module:zrender/shape/Rectangle + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var Rectangle = function (options) { Base.call(this, options); - } + /** + * 矩形绘制样式 + * @name module:zrender/shape/Rectangle#style + * @type {module:zrender/shape/Rectangle~IRectangleStyle} + */ + /** + * 矩形高亮绘制样式 + * @name module:zrender/shape/Rectangle#highlightStyle + * @type {module:zrender/shape/Rectangle~IRectangleStyle} + */ + }; Rectangle.prototype = { type: 'rectangle', - /** - * 绘制圆角矩形 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - _buildRadiusPath: function(ctx, style) { - //左上、右上、右下、左下角的半径依次为r1、r2、r3、r4 - //r缩写为1 相当于 [1, 1, 1, 1] - //r缩写为[1] 相当于 [1, 1, 1, 1] - //r缩写为[1, 2] 相当于 [1, 2, 1, 2] - //r缩写为[1, 2, 3] 相当于 [1, 2, 3, 2] + _buildRadiusPath: function (ctx, style) { + // 左上、右上、右下、左下角的半径依次为r1、r2、r3、r4 + // r缩写为1 相当于 [1, 1, 1, 1] + // r缩写为[1] 相当于 [1, 1, 1, 1] + // r缩写为[1, 2] 相当于 [1, 2, 1, 2] + // r缩写为[1, 2, 3] 相当于 [1, 2, 3, 2] var x = style.x; var y = style.y; var width = style.width; @@ -7867,30 +8880,54 @@ define( var r3; var r4; - if(typeof r === 'number') { + if (typeof r === 'number') { r1 = r2 = r3 = r4 = r; } - else if(r instanceof Array) { + else if (r instanceof Array) { if (r.length === 1) { r1 = r2 = r3 = r4 = r[0]; } - else if(r.length === 2) { + else if (r.length === 2) { r1 = r3 = r[0]; r2 = r4 = r[1]; } - else if(r.length === 3) { + else if (r.length === 3) { r1 = r[0]; r2 = r4 = r[1]; r3 = r[2]; - } else { + } + else { r1 = r[0]; r2 = r[1]; r3 = r[2]; r4 = r[3]; } - } else { + } + else { r1 = r2 = r3 = r4 = 0; } + + var total; + if (r1 + r2 > width) { + total = r1 + r2; + r1 *= width / total; + r2 *= width / total; + } + if (r3 + r4 > width) { + total = r3 + r4; + r3 *= width / total; + r4 *= width / total; + } + if (r2 + r3 > height) { + total = r2 + r3; + r2 *= height / total; + r3 *= height / total; + } + if (r1 + r4 > height) { + total = r1 + r4; + r1 *= height / total; + r4 *= height / total; + } ctx.moveTo(x + r1, y); ctx.lineTo(x + width - r2, y); r2 !== 0 && ctx.quadraticCurveTo( @@ -7910,26 +8947,29 @@ define( /** * 创建矩形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 + * @param {CanvasRenderingContext2D} ctx + * @param {Object} style */ - buildPath : function(ctx, style) { - if(!style.radius) { + buildPath : function (ctx, style) { + if (!style.radius) { ctx.moveTo(style.x, style.y); ctx.lineTo(style.x + style.width, style.y); ctx.lineTo(style.x + style.width, style.y + style.height); ctx.lineTo(style.x, style.y + style.height); ctx.lineTo(style.x, style.y); - //ctx.rect(style.x, style.y, style.width, style.height); - } else { + // ctx.rect(style.x, style.y, style.width, style.height); + } + else { this._buildRadiusPath(ctx, style); } + ctx.closePath(); return; }, /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style + * 计算返回矩形包围盒矩阵 + * @param {module:zrender/shape/Rectangle~IRectangleStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} */ getRect : function(style) { if (style.__rect) { @@ -7958,6 +8998,7 @@ define( return Rectangle; } ); + /** * zrender: loading特效类 * @@ -8059,7 +9100,8 @@ define( }; Base.prototype._start = function (/*addShapeHandle, refreshHandle*/) { - return setInterval(function(){}, 10000); + return setInterval(function () { + }, 10000); }; Base.prototype.stop = function () { @@ -8079,101 +9121,119 @@ define( } return value; }; + + Base.prototype.getLocation = function(loc, totalWidth, totalHeight) { + var x = loc.x != null ? loc.x : 'center'; + switch (x) { + case 'center' : + x = Math.floor((this.canvasWidth - totalWidth) / 2); + break; + case 'left' : + x = 0; + break; + case 'right' : + x = this.canvasWidth - totalWidth; + break; + } + var y = loc.y != null ? loc.y : 'center'; + switch (y) { + case 'center' : + y = Math.floor((this.canvasHeight - totalHeight) / 2); + break; + case 'top' : + y = 0; + break; + case 'bottom' : + y = this.canvasHeight - totalHeight; + break; + } + return { + x : x, + y : y, + width : totalWidth, + height : totalHeight + }; + }; return Base; } ); /** - * zrender - * - * @author lang( shenyi01@baidu.com ) - * - * shape类:图片 - * 可配图形属性: - { - // 基础属性 - shape : 'image', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,左上角横坐标 - y : {number}, // 必须,左上角纵坐标 - width : {number}, // 可选,宽度 - height : {number}, // 可选,高度 - sx : {number}, // 可选, 从图片中裁剪的x - sy : {number}, // 可选, 从图片中裁剪的y - sWidth : {number}, // 可选, 从图片中裁剪的宽度 - sHeight : {number}, // 可选, 从图片中裁剪的高度 - image : {string|Image} // 必须,图片url或者图片对象 - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为top,附加文本位置。 - // inside | left | right | top | bottom - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'image', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - width : 150, - height : 50, - image : 'tests.jpg', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 + * 图片绘制 + * @module zrender/shape/Image + * @author pissang(https://www.github.com/pissang) + * @example + * var ImageShape = require('zrender/shape/Image'); + * var image = new ImageShape({ + * style: { + * image: 'test.jpg', + * x: 100, + * y: 100 + * } + * }); + * zr.addShape(image); + */ - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } +/** + * @typedef {Object} IImageStyle + * @property {string|HTMLImageElement|HTMLCanvasElement} image 图片url或者图片对象 + * @property {number} x 左上角横坐标 + * @property {number} y 左上角纵坐标 + * @property {number} [width] 绘制到画布上的宽度,默认为图片宽度 + * @property {number} [height] 绘制到画布上的高度,默认为图片高度 + * @property {number} [sx=0] 从图片中裁剪的左上角横坐标 + * @property {number} [sy=0] 从图片中裁剪的左上角纵坐标 + * @property {number} [sWidth] 从图片中裁剪的宽度,默认为图片高度 + * @property {number} [sHeight] 从图片中裁剪的高度,默认为图片高度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic */ define( 'zrender/shape/Image',['require','./Base','../tool/util'],function (require) { - var _cache = {}; + var _needsRefresh = []; var _refreshTimeout; var Base = require('./Base'); - function ZImage(options) { + /** + * @alias zrender/shape/Image + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var ZImage = function(options) { Base.call(this, options); - } + + this._imageCache = {}; + /** + * 图片绘制样式 + * @name module:zrender/shape/Image#style + * @type {module:zrender/shape/Image~IImageStyle} + */ + /** + * 图片高亮绘制样式 + * @name module:zrender/shape/Image#highlightStyle + * @type {module:zrender/shape/Image~IImageStyle} + */ + }; ZImage.prototype = { + type: 'image', + brush : function(ctx, isHighlight, refresh) { var style = this.style || {}; @@ -8189,29 +9249,28 @@ define( if (typeof(image) === 'string') { var src = image; - if (_cache[src]) { - image = _cache[src]; - } - else { - image = new Image();//document.createElement('image'); - image.onload = function(){ + if (this._imageCache[src]) { + image = this._imageCache[src]; + } else { + image = new Image(); + image.onload = function () { image.onload = null; clearTimeout(_refreshTimeout); - _needsRefresh.push( me ); + _needsRefresh.push(me); // 防止因为缓存短时间内触发多次onload事件 - _refreshTimeout = setTimeout(function(){ - refresh && refresh( _needsRefresh ); + _refreshTimeout = setTimeout(function () { + refresh && refresh(_needsRefresh); // 清空needsRefresh _needsRefresh = []; }, 10); }; - _cache[src] = image; image.src = src; + this._imageCache[src] = image; } } if (image) { - //图片已经加载完成 + // 图片已经加载完成 if (image.nodeName.toUpperCase() == 'IMG') { if (window.ActiveXObject) { if (image.readyState != 'complete') { @@ -8225,7 +9284,6 @@ define( } } // Else is canvas - var width = style.width || image.width; var height = style.height || image.height; var x = style.x; @@ -8266,11 +9324,18 @@ define( ctx.drawImage(image, x, y, width, height); } // 如果没设置宽和高的话自动根据图片宽高设置 - style.width = width; - style.height = height; - this.style.width = width; - this.style.height = height; - + if (!style.width) { + style.width = width; + } + if (!style.height) { + style.height = height; + } + if (!this.style.width) { + this.style.width = width; + } + if (!this.style.height) { + this.style.height = height; + } this.drawText(ctx, style, this.style); @@ -8279,26 +9344,21 @@ define( }, /** - * 创建路径,用于判断hover时调用isPointInPath~ - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath : function(ctx, style) { - ctx.rect(style.x, style.y, style.width, style.height); - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style + * 计算返回图片的包围盒矩形 + * @param {module:zrender/shape/Image~IImageStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} */ - getRect : function(style) { + getRect: function(style) { return { x : style.x, y : style.y, width : style.width, height : style.height }; + }, + + clearCache: function() { + this._imageCache = {}; } }; @@ -8306,55 +9366,55 @@ define( return ZImage; } ); + /** * Painter绘图模块 - * + * @module zrender/Painter * @author Kener (@Kener-林峰, linzhifeng@baidu.com) * errorrik (errorrik@gmail.com) + * pissang (https://www.github.com/pissang) */ - - - -define( - 'zrender/Painter',['require','./config','./tool/util','./tool/log','./tool/matrix','./loadingEffect/Base','./shape/Image'],function (require) { - + define( + 'zrender/Painter',['require','./config','./tool/util','./tool/log','./tool/matrix','./loadingEffect/Base','./mixin/Transformable','./shape/Image'],function (require) { var config = require('./config'); var util = require('./tool/util'); + // var vec2 = require('./tool/vector'); var log = require('./tool/log'); var matrix = require('./tool/matrix'); var BaseLoadingEffect = require('./loadingEffect/Base'); + var Transformable = require('./mixin/Transformable'); // retina 屏幕优化 var devicePixelRatio = window.devicePixelRatio || 1; devicePixelRatio = Math.max(devicePixelRatio, 1); - var vmlCanvasManager = window.G_vmlCanvasManager; + var vmlCanvasManager = window['G_vmlCanvasManager']; - /** - * 返回false的方法,用于避免页面被选中 - * - * @inner - */ + + // 返回false的方法,用于避免页面被选中 function returnFalse() { return false; } - /** - * 什么都不干的空方法 - * - * @inner - */ + // 什么都不干的空方法 function doNothing() {} /** - * 绘图类 (V) - * - * @param {HTMLElement} root 绘图区域 - * @param {storage} storage Storage实例 + * @alias module:zrender/Painter + * @constructor + * @param {HTMLElement} root 绘图容器 + * @param {module:zrender/Storage} storage */ - function Painter(root, storage) { + var Painter = function (root, storage) { + /** + * 绘图容器 + * @type {HTMLElement} + */ this.root = root; + /** + * @type {module:zrender/Storage} + */ this.storage = storage; root.innerHTML = ''; @@ -8364,7 +9424,7 @@ define( var domRoot = document.createElement('div'); this._domRoot = domRoot; - //domRoot.onselectstart = returnFalse; // 避免页面选中的尴尬 + // domRoot.onselectstart = returnFalse; // 避免页面选中的尴尬 domRoot.style.position = 'relative'; domRoot.style.overflow = 'hidden'; domRoot.style.width = this._width + 'px'; @@ -8382,6 +9442,10 @@ define( // 背景 this._bgDom = createDom('bg', 'div', this); domRoot.appendChild(this._bgDom); + this._bgDom.onselectstart = returnFalse; + this._bgDom.style['-webkit-user-select'] = 'none'; + this._bgDom.style['user-select'] = 'none'; + // this._bgDom.style[' -webkit-touch-callout'] = 'none'; // 高亮 var hoverLayer = new Layer('_zrender_hover_', this); @@ -8389,18 +9453,21 @@ define( domRoot.appendChild(hoverLayer.dom); hoverLayer.initContext(); - hoverLayer.onselectstart = returnFalse; + hoverLayer.dom.onselectstart = returnFalse; + hoverLayer.dom.style['-webkit-user-select'] = 'none'; + hoverLayer.dom.style['user-select'] = 'none'; + // hoverLayer.dom.style[' -webkit-touch-callout'] = 'none'; var me = this; - this.updatePainter = function(shapeList, callback) { - me.update(shapeList, callback); + this.updatePainter = function (shapeList, callback) { + me.refreshShapes(shapeList, callback); }; - } + }; /** * 首次绘图,创建各种dom和context * - * @param {Function=} callback 绘画结束后的回调函数 + * @param {Function} callback 绘画结束后的回调函数 */ Painter.prototype.render = function (callback) { if (this.isLoading()) { @@ -8414,9 +9481,8 @@ define( /** * 刷新 - * - * @param {Function=} callback 刷新结束后的回调函数 - * @param {Boolean} paintAll 强制绘制所有shape + * @param {Function} callback 刷新结束后的回调函数 + * @param {boolean} paintAll 强制绘制所有shape */ Painter.prototype.refresh = function (callback, paintAll) { var list = this.storage.getShapeList(true); @@ -8429,7 +9495,7 @@ define( return this; }; - Painter.prototype._paintList = function(list, paintAll) { + Painter.prototype._paintList = function (list, paintAll) { if (typeof(paintAll) == 'undefined') { paintAll = false; @@ -8444,6 +9510,7 @@ define( for (var id in this._layers) { if (id !== 'hover') { this._layers[id].unusedCount++; + this._layers[id].updateTransform(); } } @@ -8453,6 +9520,10 @@ define( var shape = list[i]; if (currentZLevel !== shape.zlevel) { + if (currentLayer && currentLayer.needTransform) { + ctx.restore(); + } + currentLayer = this.getLayer(shape.zlevel, currentLayer); ctx = currentLayer.ctx; currentZLevel = shape.zlevel; @@ -8463,6 +9534,11 @@ define( if (currentLayer.dirty || paintAll) { currentLayer.clear(); } + + if (currentLayer.needTransform) { + ctx.save(); + currentLayer.setTransform(ctx); + } } // Start group clipping @@ -8504,14 +9580,15 @@ define( try { shape.brush(ctx, false, this.updatePainter); } - catch(error) { + catch (error) { log( error, 'brush error of ' + shape.type, shape ); } - } else { + } + else { shape.brush(ctx, false, this.updatePainter); } } @@ -8525,23 +9602,33 @@ define( shape.__dirty = false; } + if (currentLayer && currentLayer.needTransform) { + ctx.restore(); + } + for (var id in this._layers) { if (id !== 'hover') { var layer = this._layers[id]; layer.dirty = false; // 删除过期的层 - if (layer.unusedCount >= 500) { - delete this._layers[id]; - layer.dom.parentNode.removeChild(layer.dom); - } - else if (layer.unusedCount == 1) { + // PENDING + // if (layer.unusedCount >= 500) { + // this.delLayer(id); + // } + if (layer.unusedCount == 1) { layer.clear(); } } } }; - Painter.prototype.getLayer = function(zlevel, prevLayer) { + /** + * 获取 zlevel 所在层,如果不存在则会创建一个新的层 + * @param {number} zlevel + * @param {module:zrender/Painter~Layer} [prevLayer] + * 在需要创建新的层时需要使用,新创建层的dom节点会插在该层后面 + */ + Painter.prototype.getLayer = function (zlevel, prevLayer) { // Change draw layer var currentLayer = this._layers[zlevel]; if (!currentLayer) { @@ -8553,7 +9640,8 @@ define( currentLayer.dom, prevDom.nextSibling ); - } else { + } + else { prevDom.parentNode.appendChild( currentLayer.dom ); @@ -8562,13 +9650,25 @@ define( this._layers[zlevel] = currentLayer; - currentLayer.config = this._layerConfig[zlevel]; + if (this._layerConfig[zlevel]) { + util.merge(currentLayer, this._layerConfig[zlevel], true); + } + + currentLayer.updateTransform(); } return currentLayer; }; - Painter.prototype._updateLayerStatus = function(list) { + /** + * 获取所有已创建的层 + * @param {Array.} [prevLayer] + */ + Painter.prototype.getLayers = function () { + return this._layers; + }; + + Painter.prototype._updateLayerStatus = function (list) { var layers = this._layers; @@ -8605,12 +9705,11 @@ define( }; /** - * 视图更新 - * - * @param {Array} shapeList 需要更新的图形元素列表 - * @param {Function} callback 视图更新后回调函数 + * 指定的图形列表 + * @param {Array.} shapeList 需要更新的图形元素列表 + * @param {Function} [callback] 视图更新后回调函数 */ - Painter.prototype.update = function (shapeList, callback) { + Painter.prototype.refreshShapes = function (shapeList, callback) { for (var i = 0, l = shapeList.length; i < l; i++) { var shape = shapeList[i]; this.storage.mod(shape.id); @@ -8647,23 +9746,55 @@ define( /** * 修改指定zlevel的绘制参数 + * + * @param {string} zlevel + * @param {Object} config 配置对象 + * @param {string} [config.clearColor=0] 每次清空画布的颜色 + * @param {string} [config.motionBlur=false] 是否开启动态模糊 + * @param {number} [config.lastFrameAlpha=0.7] + * 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显 + * @param {Array.} [position] 层的平移 + * @param {Array.} [rotation] 层的旋转 + * @param {Array.} [scale] 层的缩放 + * @param {boolean} [zoomable=false] 层是否支持鼠标缩放操作 + * @param {boolean} [panable=false] 层是否支持鼠标平移操作 */ Painter.prototype.modLayer = function (zlevel, config) { if (config) { if (!this._layerConfig[zlevel]) { this._layerConfig[zlevel] = config; - } else { + } + else { util.merge(this._layerConfig[zlevel], config, true); } var layer = this._layers[zlevel]; if (layer) { - layer.config = this._layerConfig[zlevel]; + util.merge(layer, this._layerConfig[zlevel], true); } } }; + /** + * 删除指定层 + * @param {number} zlevel 层所在的zlevel + */ + Painter.prototype.delLayer = function (zlevel) { + var layer = this._layers[zlevel]; + if (!layer) { + return; + } + // Save config + this.modLayer(zlevel, { + position: layer.position, + rotation: layer.rotation, + scale: layer.scale + }); + layer.dom.parentNode.removeChild(layer.dom); + delete this._layers[zlevel]; + }; + /** * 刷新hover层 */ @@ -8733,7 +9864,7 @@ define( domRoot.style.display = ''; // 优化没有实际改变的resize - if (this._width != width || height != this._height){ + if (this._width != width || height != this._height) { this._width = width; this._height = height; @@ -8753,9 +9884,10 @@ define( /** * 清除单独的一个层 + * @param {number} zLevel */ - Painter.prototype.clearLayer = function (k) { - var layer = this._layers[k]; + Painter.prototype.clearLayer = function (zLevel) { + var layer = this._layers[zLevel]; if (layer) { layer.clear(); } @@ -8782,6 +9914,12 @@ define( return this._layers.hover.dom; }; + /** + * 图像导出 + * @param {string} type + * @param {string} [backgroundColor='#fff'] 背景色 + * @return {string} 图片的Base64 url + */ Painter.prototype.toDataURL = function (type, backgroundColor, args) { if (vmlCanvasManager) { return null; @@ -8801,20 +9939,21 @@ define( ); ctx.fill(); - //升序遍历,shape上的zlevel指定绘画图层的z轴层叠 + var self = this; + // 升序遍历,shape上的zlevel指定绘画图层的z轴层叠 this.storage.iterShape( function (shape) { if (!shape.invisible) { - if (!shape.onbrush //没有onbrush - //有onbrush并且调用执行返回false或undefined则继续粉刷 + if (!shape.onbrush // 没有onbrush + // 有onbrush并且调用执行返回false或undefined则继续粉刷 || (shape.onbrush && !shape.onbrush(ctx, false)) ) { if (config.catchBrushException) { try { - shape.brush(ctx, false, this.updatePainter); + shape.brush(ctx, false, self.updatePainter); } - catch(error) { + catch (error) { log( error, 'brush error of ' + shape.type, @@ -8823,7 +9962,7 @@ define( } } else { - shape.brush(ctx, false, this.updatePainter); + shape.brush(ctx, false, self.updatePainter); } } } @@ -8850,7 +9989,7 @@ define( return this._height; }; - Painter.prototype._getWidth = function() { + Painter.prototype._getWidth = function () { var root = this.root; var stl = root.currentStyle || document.defaultView.getComputedStyle(root); @@ -8870,22 +10009,24 @@ define( - parseInt(stl.paddingBottom, 10)).toFixed(0) - 0; }; - /** - * 鼠标悬浮刷画 - */ Painter.prototype._brushHover = function (shape) { var ctx = this._layers.hover.ctx; - if (!shape.onbrush //没有onbrush - //有onbrush并且调用执行返回false或undefined则继续粉刷 + if (!shape.onbrush // 没有onbrush + // 有onbrush并且调用执行返回false或undefined则继续粉刷 || (shape.onbrush && !shape.onbrush(ctx, true)) ) { + var layer = this.getLayer(shape.zlevel); + if (layer.needTransform) { + ctx.save(); + layer.setTransform(ctx); + } // Retina 优化 if (config.catchBrushException) { try { shape.brush(ctx, true, this.updatePainter); } - catch(error) { + catch (error) { log( error, 'hoverBrush error of ' + shape.type, shape ); @@ -8894,6 +10035,9 @@ define( else { shape.brush(ctx, true, this.updatePainter); } + if (layer.needTransform) { + ctx.restore(); + } } }; @@ -8916,14 +10060,14 @@ define( rotation : shape.rotation, scale : shape.scale }; - shape.position = [0, 0, 0]; + shape.position = [ 0, 0, 0 ]; shape.rotation = 0; - shape.scale = [1, 1]; + shape.scale = [ 1, 1 ]; if (shape) { shape.brush(ctx, false); } - var ImageShape = require( './shape/Image' ); + var ImageShape = require('./shape/Image'); var imgShape = new ImageShape({ id : id, style : { @@ -8953,10 +10097,10 @@ define( return doNothing; } - var painter = this; + var me = this; return function (id, e, width, height) { - return painter._shapeToImage( + return me._shapeToImage( id, e, width, height, devicePixelRatio ); }; @@ -8989,11 +10133,19 @@ define( return newDom; } - /***************************************** - * Layer - *****************************************/ - function Layer(id, painter) { + /** + * @alias module:zrender/Painter~Layer + * @constructor + * @extends module:zrender/mixin/Transformable + * @param {string} id + * @param {module:zrender/Painter} painter + */ + var Layer = function(id, painter) { this.dom = createDom(id, 'canvas', painter); + this.dom.onselectstart = returnFalse; // 避免页面选中的尴尬 + this.dom.style['-webkit-user-select'] = 'none'; + this.dom.style['user-select'] = 'none'; + // this.dom.style[' -webkit-touch-callout'] = 'none'; vmlCanvasManager && vmlCanvasManager.initElement(this.dom); this.domBack = null; @@ -9008,16 +10160,53 @@ define( this.dirty = true; this.elCount = 0; - } - Layer.prototype.initContext = function() { + // Configs + /** + * 每次清空画布的颜色 + * @type {string} + * @default 0 + */ + this.clearColor = 0; + /** + * 是否开启动态模糊 + * @type {boolean} + * @default false + */ + this.motionBlur = false; + /** + * 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显 + * @type {number} + * @default 0.7 + */ + this.lastFrameAlpha = 0.7; + /** + * 层是否支持鼠标平移操作 + * @type {boolean} + * @default false + */ + this.zoomable = false; + /** + * 层是否支持鼠标缩放操作 + * @type {boolean} + * @default false + */ + this.panable = false; + + this.maxZoom = Infinity; + this.minZoom = 0; + + Transformable.call(this); + }; + + Layer.prototype.initContext = function () { this.ctx = this.dom.getContext('2d'); if (devicePixelRatio != 1) { this.ctx.scale(devicePixelRatio, devicePixelRatio); } - } + }; - Layer.prototype.createBackBuffer = function() { + Layer.prototype.createBackBuffer = function () { if (vmlCanvasManager) { // IE 8- should not support back buffer return; } @@ -9029,7 +10218,11 @@ define( } }; - Layer.prototype.resize = function(width, height) { + /** + * @param {number} width + * @param {number} height + */ + Layer.prototype.resize = function (width, height) { this.dom.style.width = width + 'px'; this.dom.style.height = height + 'px'; @@ -9050,65 +10243,41 @@ define( } }; - Layer.prototype.clear = function() { - var config = this.config; + /** + * 清空该层画布 + */ + Layer.prototype.clear = function () { var dom = this.dom; var ctx = this.ctx; var width = dom.width; var height = dom.height; - if (config) { - var haveClearColor = - typeof(config.clearColor) !== 'undefined' - && !vmlCanvasManager; - var haveMotionBLur = config.motionBlur && !vmlCanvasManager; - var lastFrameAlpha = config.lastFrameAlpha; - if (typeof(lastFrameAlpha) == 'undefined') { - lastFrameAlpha = 0.7; - } - - if (haveMotionBLur) { - if (!this.domBack) { - this.createBackBuffer(); - } + var haveClearColor = this.clearColor && !vmlCanvasManager; + var haveMotionBLur = this.motionBlur && !vmlCanvasManager; + var lastFrameAlpha = this.lastFrameAlpha; - this.ctxBack.globalCompositeOperation = 'copy'; - this.ctxBack.drawImage( - dom, 0, 0, - width / devicePixelRatio, - height / devicePixelRatio - ); - } + if (haveMotionBLur) { + if (!this.domBack) { + this.createBackBuffer(); + } - if (haveClearColor) { - ctx.save(); - ctx.fillStyle = this.config.clearColor; - ctx.fillRect( - 0, 0, - width / devicePixelRatio, - height / devicePixelRatio - ); - ctx.restore(); - } - else { - ctx.clearRect( - 0, 0, - width / devicePixelRatio, - height / devicePixelRatio - ); - } + this.ctxBack.globalCompositeOperation = 'copy'; + this.ctxBack.drawImage( + dom, 0, 0, + width / devicePixelRatio, + height / devicePixelRatio + ); + } - if (haveMotionBLur) { - var domBack = this.domBack; - ctx.save(); - ctx.globalAlpha = lastFrameAlpha; - ctx.drawImage( - domBack, 0, 0, - width / devicePixelRatio, - height / devicePixelRatio - ); - ctx.restore(); - } + if (haveClearColor) { + ctx.save(); + ctx.fillStyle = this.config.clearColor; + ctx.fillRect( + 0, 0, + width / devicePixelRatio, + height / devicePixelRatio + ); + ctx.restore(); } else { ctx.clearRect( @@ -9117,35 +10286,84 @@ define( height / devicePixelRatio ); } + + if (haveMotionBLur) { + var domBack = this.domBack; + ctx.save(); + ctx.globalAlpha = lastFrameAlpha; + ctx.drawImage( + domBack, 0, 0, + width / devicePixelRatio, + height / devicePixelRatio + ); + ctx.restore(); + } }; + util.merge(Layer.prototype, Transformable.prototype); + return Painter; } ); -define('zrender/shape/Group',['require','../tool/guid','../tool/util','../tool/event','./mixin/Transformable'],function(require) { +/** + * Group是一个容器,可以插入子节点,Group的变换也会被应用到子节点上 + * @module zrender/Group + * @example + * var Group = require('zrender/Group'); + * var Circle = require('zrender/shape/Circle'); + * var g = new Group(); + * g.position[0] = 100; + * g.position[1] = 100; + * g.addChild(new Circle({ + * style: { + * x: 100, + * y: 100, + * r: 20, + * brushType: 'fill' + * } + * })); + * zr.addGroup(g); + */ +define('zrender/Group',['require','./tool/guid','./tool/util','./mixin/Transformable','./mixin/Eventful'],function(require) { - var guid = require('../tool/guid'); - var util = require('../tool/util'); + var guid = require('./tool/guid'); + var util = require('./tool/util'); - var Dispatcher = require('../tool/event').Dispatcher; var Transformable = require('./mixin/Transformable'); + var Eventful = require('./mixin/Eventful'); /** - * @constructor zrender.shape.Group + * @alias module:zrender/Group + * @constructor + * @extends module:zrender/mixin/Transformable + * @extends module:zrender/mixin/Eventful */ - function Group(options) { + var Group = function(options) { options = options || {}; + /** + * Group id + * @type {string} + */ this.id = options.id || guid(); for (var key in options) { this[key] = options[key]; } + /** + * @type {string} + */ this.type = 'group'; + /** + * 用于裁剪的图形(shape),所有 Group 内的图形在绘制时都会被这个图形裁剪 + * 该图形会继承Group的变换 + * @type {module:zrender/shape/Base} + * @see http://www.w3.org/TR/2dcontext/#clipping-region + */ this.clipShape = null; this._children = []; @@ -9156,19 +10374,37 @@ define('zrender/shape/Group',['require','../tool/guid','../tool/util','../tool/e // Mixin Transformable.call(this); - Dispatcher.call(this); - } + Eventful.call(this); + }; + /** + * 是否忽略该 Group 及其所有子节点 + * @type {boolean} + * @default false + */ Group.prototype.ignore = false; + /** + * 复制并返回一份新的包含所有儿子节点的数组 + * @return {Array.} + */ Group.prototype.children = function() { return this._children.slice(); }; + /** + * 获取指定 index 的儿子节点 + * @param {number} idx + * @return {module:zrender/Group|module:zrender/shape/Base} + */ Group.prototype.childAt = function(idx) { return this._children[idx]; }; + /** + * 添加子节点,可以是Shape或者Group + * @param {module:zrender/Group|module:zrender/shape/Base} child + */ Group.prototype.addChild = function(child) { if (child == this) { return; @@ -9194,6 +10430,10 @@ define('zrender/shape/Group',['require','../tool/guid','../tool/util','../tool/e } }; + /** + * 移除子节点 + * @param {module:zrender/Group|module:zrender/shape/Base} child + */ Group.prototype.removeChild = function(child) { var idx = util.indexOf(this._children, child); @@ -9210,7 +10450,12 @@ define('zrender/shape/Group',['require','../tool/guid','../tool/util','../tool/e } }; - Group.prototype.each = function(cb, context) { + /** + * 遍历所有子节点 + * @param {Function} cb + * @param {} context + */ + Group.prototype.eachChild = function(cb, context) { var haveContext = !!context; for (var i = 0; i < this._children.length; i++) { var child = this._children[i]; @@ -9222,9 +10467,13 @@ define('zrender/shape/Group',['require','../tool/guid','../tool/util','../tool/e } }; - Group.prototype.iterate = function(cb, context) { + /** + * 深度优先遍历所有子孙节点 + * @param {Function} cb + * @param {} context + */ + Group.prototype.traverse = function(cb, context) { var haveContext = !!context; - for (var i = 0; i < this._children.length; i++) { var child = this._children[i]; if (haveContext) { @@ -9234,7 +10483,7 @@ define('zrender/shape/Group',['require','../tool/guid','../tool/util','../tool/e } if (child.type === 'group') { - child.iterate(cb, context); + child.traverse(cb, context); } } }; @@ -9252,34 +10501,37 @@ define('zrender/shape/Group',['require','../tool/guid','../tool/util','../tool/e Group.prototype.delChildrenFromStorage = function(storage) { for (var i = 0; i < this._children.length; i++) { var child = this._children[i]; - storage.delFromMap(child); + storage.delFromMap(child.id); if (child.type === 'group') { child.delChildrenFromStorage(storage); } } }; + Group.prototype.modSelf = function() { + this.__dirty = true; + }; + util.merge(Group.prototype, Transformable.prototype, true); - util.merge(Group.prototype, Dispatcher.prototype, true); + util.merge(Group.prototype, Eventful.prototype, true); return Group; }); /** * Storage内容仓库模块 - * + * @module zrender/Storage * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * errorrik (errorrik@gmail.com) + * @author errorrik (errorrik@gmail.com) + * @author pissang (https://github.com/pissang/) */ - - define( - 'zrender/Storage',['require','./tool/util','./shape/Group'],function (require) { + 'zrender/Storage',['require','./tool/util','./Group'],function (require) { var util = require('./tool/util'); - var Group = require('./shape/Group'); + var Group = require('./Group'); var defaultIterateOption = { hover: false, @@ -9298,9 +10550,10 @@ define( } /** * 内容仓库 (M) - * + * @alias module:zrender/Storage + * @constructor */ - function Storage() { + var Storage = function () { // 所有常规形状,id索引的map this._elements = {}; @@ -9312,16 +10565,17 @@ define( this._shapeList = []; this._shapeListOffset = 0; - } + }; /** * 遍历迭代器 * * @param {Function} fun 迭代回调函数,return true终止迭代 - * @param {Object=} option 迭代参数,缺省为仅降序遍历常规形状 - * hover : true 是否迭代高亮层数据 - * normal : 'down' | 'up' 是否迭代常规数据,迭代时是否指定及z轴顺序 - * update : false 是否更新shapeList + * @param {Object} [option] 迭代参数,缺省为仅降序遍历普通层图形 + * @param {boolean} [option.hover=true] 是否是高亮层图形 + * @param {string} [option.normal='up'] 是否是普通层图形,迭代时是否指定及z轴顺序 + * @param {boolean} [option.update=false] 是否在迭代前更新形状列表 + * */ Storage.prototype.iterShape = function (fun, option) { if (!option) { @@ -9329,7 +10583,7 @@ define( } if (option.hover) { - //高亮层数据遍历 + // 高亮层数据遍历 for (var i = 0, l = this._hoverElements.length; i < l; i++) { var el = this._hoverElements[i]; el.updateTransform(); @@ -9343,7 +10597,7 @@ define( this.updateShapeList(); } - //遍历: 'down' | 'up' + // 遍历: 'down' | 'up' switch (option.normal) { case 'down': // 降序遍历,高层优先 @@ -9356,7 +10610,7 @@ define( break; // case 'up': default: - //升序遍历,底层优先 + // 升序遍历,底层优先 for (var i = 0, l = this._shapeList.length; i < l; i++) { if (fun(this._shapeList[i])) { return this; @@ -9368,7 +10622,12 @@ define( return this; }; - Storage.prototype.getHoverShapes = function(update) { + /** + * 返回hover层的形状数组 + * @param {boolean} [update=false] 是否在返回前更新图形的变换 + * @return {Array.} + */ + Storage.prototype.getHoverShapes = function (update) { if (update) { for (var i = 0, l = this._hoverElements.length; i < l; i++) { this._hoverElements[i].updateTransform(); @@ -9377,15 +10636,25 @@ define( return this._hoverElements; }; - Storage.prototype.getShapeList = function(update) { + /** + * 返回所有图形的绘制队列 + * @param {boolean} [update=false] 是否在返回前更新该数组 + * 详见{@link module:zrender/shape/Base.prototype.updateShapeList} + * @return {Array.} + */ + Storage.prototype.getShapeList = function (update) { if (update) { this.updateShapeList(); } return this._shapeList; }; - - Storage.prototype.updateShapeList = function() { + /** + * 更新图形的绘制队列。 + * 每次绘制前都会调用,该方法会先深度优先遍历整个树,更新所有Group和Shape的变换并且把所有可见的Shape保存到数组中, + * 最后根据绘制的优先级(zlevel > z > 插入顺序)排序得到绘制队列 + */ + Storage.prototype.updateShapeList = function () { this._shapeListOffset = 0; for (var i = 0, len = this._roots.length; i < len; i++) { var root = this._roots[i]; @@ -9400,7 +10669,7 @@ define( this._shapeList.sort(shapeCompareFunc); }; - Storage.prototype._updateAndAddShape = function(el) { + Storage.prototype._updateAndAddShape = function (el) { if (el.ignore) { return; @@ -9440,24 +10709,23 @@ define( // Mark group clean here el.__dirty = false; - } else { + } + else { this._shapeList[this._shapeListOffset++] = el; } }; /** - * 修改 + * 修改图形(Shape)或者组(Group) * - * @param {string} idx 唯一标识 + * @param {string} elId 唯一标识 * @param {Object} [params] 参数 */ Storage.prototype.mod = function (elId, params) { var el = this._elements[elId]; if (el) { - if (!(el instanceof Group)) { - el.style.__rect = null; - } - el.__dirty = true; + + el.modSelf(); if (params) { // 如果第二个参数直接使用 shape @@ -9478,7 +10746,8 @@ define( } } util.merge(el, target, true); - } else { + } + else { util.merge(el, params, true); } } @@ -9488,16 +10757,17 @@ define( }; /** - * 常规形状位置漂移,形状自身定义漂移函数 - * - * @param {string} idx 形状唯一标识 + * 移动指定的图形(Shape)或者组(Group)的位置 + * @param {string} shapeId 形状唯一标识 + * @param {number} dx + * @param {number} dy */ Storage.prototype.drift = function (shapeId, dx, dy) { var shape = this._elements[shapeId]; if (shape) { shape.needTransform = true; - if (!shape.ondrift //ondrift - //有onbrush并且调用执行返回false或undefined则继续 + if (!shape.ondrift // ondrift + // 有onbrush并且调用执行返回false或undefined则继续 || (shape.ondrift && !shape.ondrift(dx, dy)) ) { shape.drift(dx, dy); @@ -9510,7 +10780,7 @@ define( /** * 添加高亮层数据 * - * @param {Object} params 参数 + * @param {module:zrender/shape/Base} shape */ Storage.prototype.addHover = function (shape) { shape.updateNeedTransform(); @@ -9519,21 +10789,24 @@ define( }; /** - * 删除高亮层数据 + * 清空高亮层数据 */ Storage.prototype.delHover = function () { this._hoverElements = []; return this; }; + /** + * 是否有图形在高亮层里 + * @return {boolean} + */ Storage.prototype.hasHoverShape = function () { return this._hoverElements.length > 0; }; /** - * 添加到根节点 - * - * @param {Shape|Group} el 参数 + * 添加图形(Shape)或者组(Group)到根节点 + * @param {module:zrender/shape/Shape|module:zrender/Group} el */ Storage.prototype.addRoot = function (el) { if (el instanceof Group) { @@ -9544,6 +10817,10 @@ define( this._roots.push(el); }; + /** + * 删除指定的图形(Shape)或者组(Group) + * @param {string|Array.} [elId] 如果为空清空整个Storage + */ Storage.prototype.delRoot = function (elId) { if (typeof(elId) == 'undefined') { // 不指定elId清空 @@ -9571,7 +10848,8 @@ define( var el; if (typeof(elId) == 'string') { el = this._elements[elId]; - } else { + } + else { el = elId; } @@ -9585,37 +10863,21 @@ define( } }; - /** - * 添加 - * - * @param {Shape|Group} el 参数 - */ Storage.prototype.addToMap = function (el) { if (el instanceof Group) { el._storage = this; - } else { - el.style.__rect = null; } + el.modSelf(); this._elements[el.id] = el; return this; }; - /** - * 根据指定的elId获取相应的shape属性 - * - * @param {string=} idx 唯一标识 - */ Storage.prototype.get = function (elId) { return this._elements[elId]; }; - /** - * 删除,elId不指定则全清空 - * - * @param {string} idx 唯一标识 - */ Storage.prototype.delFromMap = function (elId) { var el = this._elements[elId]; if (el) { @@ -9631,7 +10893,7 @@ define( /** - * 释放 + * 清空并且释放Storage */ Storage.prototype.dispose = function () { this._elements = @@ -9644,40 +10906,69 @@ define( } ); -/** - * 缓动代码来自 https://github.com/sole/tween.js/blob/master/src/Tween.js - * author: lang(shenyi01@baidu.com) - */ define( 'zrender/animation/easing',[],function() { - var Easing = { + /** + * 缓动代码来自 https://github.com/sole/tween.js/blob/master/src/Tween.js + * @see http://sole.github.io/tween.js/examples/03_graphs.html + * @exports zrender/animation/easing + */ + var easing = { // 线性 - Linear: function(k) { + /** + * @param {number} k + * @return {number} + */ + Linear: function (k) { return k; }, // 二次方的缓动(t^2) - QuadraticIn: function(k) { + /** + * @param {number} k + * @return {number} + */ + QuadraticIn: function (k) { return k * k; }, - QuadraticOut: function(k) { + /** + * @param {number} k + * @return {number} + */ + QuadraticOut: function (k) { return k * (2 - k); }, - QuadraticInOut: function(k) { + /** + * @param {number} k + * @return {number} + */ + QuadraticInOut: function (k) { if ((k *= 2) < 1) { return 0.5 * k * k; } - return - 0.5 * (--k * (k - 2) - 1); + return -0.5 * (--k * (k - 2) - 1); }, // 三次方的缓动(t^3) - CubicIn: function(k) { + /** + * @param {number} k + * @return {number} + */ + CubicIn: function (k) { return k * k * k; }, - CubicOut: function(k) { + /** + * @param {number} k + * @return {number} + */ + CubicOut: function (k) { return --k * k * k + 1; }, - CubicInOut: function(k) { + /** + * @param {number} k + * @return {number} + */ + CubicInOut: function (k) { if ((k *= 2) < 1) { return 0.5 * k * k * k; } @@ -9685,28 +10976,51 @@ define( }, // 四次方的缓动(t^4) - QuarticIn: function(k) { + /** + * @param {number} k + * @return {number} + */ + QuarticIn: function (k) { return k * k * k * k; }, - QuarticOut: function(k) { + /** + * @param {number} k + * @return {number} + */ + QuarticOut: function (k) { return 1 - (--k * k * k * k); }, - QuarticInOut: function(k) { + /** + * @param {number} k + * @return {number} + */ + QuarticInOut: function (k) { if ((k *= 2) < 1) { return 0.5 * k * k * k * k; } - return - 0.5 * ((k -= 2) * k * k * k - 2); + return -0.5 * ((k -= 2) * k * k * k - 2); }, // 五次方的缓动(t^5) - QuinticIn: function(k) { + /** + * @param {number} k + * @return {number} + */ + QuinticIn: function (k) { return k * k * k * k * k; }, - - QuinticOut: function(k) { + /** + * @param {number} k + * @return {number} + */ + QuinticOut: function (k) { return --k * k * k * k * k + 1; }, - QuinticInOut: function(k) { + /** + * @param {number} k + * @return {number} + */ + QuinticInOut: function (k) { if ((k *= 2) < 1) { return 0.5 * k * k * k * k * k; } @@ -9714,24 +11028,48 @@ define( }, // 正弦曲线的缓动(sin(t)) - SinusoidalIn: function(k) { + /** + * @param {number} k + * @return {number} + */ + SinusoidalIn: function (k) { return 1 - Math.cos(k * Math.PI / 2); }, - SinusoidalOut: function(k) { + /** + * @param {number} k + * @return {number} + */ + SinusoidalOut: function (k) { return Math.sin(k * Math.PI / 2); }, - SinusoidalInOut: function(k) { + /** + * @param {number} k + * @return {number} + */ + SinusoidalInOut: function (k) { return 0.5 * (1 - Math.cos(Math.PI * k)); }, // 指数曲线的缓动(2^t) - ExponentialIn: function(k) { + /** + * @param {number} k + * @return {number} + */ + ExponentialIn: function (k) { return k === 0 ? 0 : Math.pow(1024, k - 1); }, - ExponentialOut: function(k) { - return k === 1 ? 1 : 1 - Math.pow(2, - 10 * k); + /** + * @param {number} k + * @return {number} + */ + ExponentialOut: function (k) { + return k === 1 ? 1 : 1 - Math.pow(2, -10 * k); }, - ExponentialInOut: function(k) { + /** + * @param {number} k + * @return {number} + */ + ExponentialInOut: function (k) { if (k === 0) { return 0; } @@ -9741,26 +11079,44 @@ define( if ((k *= 2) < 1) { return 0.5 * Math.pow(1024, k - 1); } - return 0.5 * (- Math.pow(2, - 10 * (k - 1)) + 2); + return 0.5 * (-Math.pow(2, -10 * (k - 1)) + 2); }, // 圆形曲线的缓动(sqrt(1-t^2)) - CircularIn: function(k) { + /** + * @param {number} k + * @return {number} + */ + CircularIn: function (k) { return 1 - Math.sqrt(1 - k * k); }, - CircularOut: function(k) { + /** + * @param {number} k + * @return {number} + */ + CircularOut: function (k) { return Math.sqrt(1 - (--k * k)); }, - CircularInOut: function(k) { + /** + * @param {number} k + * @return {number} + */ + CircularInOut: function (k) { if ((k *= 2) < 1) { - return - 0.5 * (Math.sqrt(1 - k * k) - 1); + return -0.5 * (Math.sqrt(1 - k * k) - 1); } return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1); }, // 创建类似于弹簧在停止前来回振荡的动画 - ElasticIn: function(k) { - var s, a = 0.1, p = 0.4; + /** + * @param {number} k + * @return {number} + */ + ElasticIn: function (k) { + var s; + var a = 0.1; + var p = 0.4; if (k === 0) { return 0; } @@ -9769,14 +11125,21 @@ define( } if (!a || a < 1) { a = 1; s = p / 4; - }else{ + } + else { s = p * Math.asin(1 / a) / (2 * Math.PI); } - return - (a * Math.pow(2, 10 * (k -= 1)) * + return -(a * Math.pow(2, 10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p)); }, - ElasticOut: function(k) { - var s, a = 0.1, p = 0.4; + /** + * @param {number} k + * @return {number} + */ + ElasticOut: function (k) { + var s; + var a = 0.1; + var p = 0.4; if (k === 0) { return 0; } @@ -9786,14 +11149,20 @@ define( if (!a || a < 1) { a = 1; s = p / 4; } - else{ + else { s = p * Math.asin(1 / a) / (2 * Math.PI); } - return (a * Math.pow(2, - 10 * k) * + return (a * Math.pow(2, -10 * k) * Math.sin((k - s) * (2 * Math.PI) / p) + 1); }, - ElasticInOut: function(k) { - var s, a = 0.1, p = 0.4; + /** + * @param {number} k + * @return {number} + */ + ElasticInOut: function (k) { + var s; + var a = 0.1; + var p = 0.4; if (k === 0) { return 0; } @@ -9803,11 +11172,11 @@ define( if (!a || a < 1) { a = 1; s = p / 4; } - else{ + else { s = p * Math.asin(1 / a) / (2 * Math.PI); } if ((k *= 2) < 1) { - return - 0.5 * (a * Math.pow(2, 10 * (k -= 1)) + return -0.5 * (a * Math.pow(2, 10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p)); } return a * Math.pow(2, -10 * (k -= 1)) @@ -9816,15 +11185,27 @@ define( }, // 在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动 - BackIn: function(k) { + /** + * @param {number} k + * @return {number} + */ + BackIn: function (k) { var s = 1.70158; return k * k * ((s + 1) * k - s); }, - BackOut: function(k) { + /** + * @param {number} k + * @return {number} + */ + BackOut: function (k) { var s = 1.70158; return --k * k * ((s + 1) * k + s) + 1; }, - BackInOut: function(k) { + /** + * @param {number} k + * @return {number} + */ + BackInOut: function (k) { var s = 1.70158 * 1.525; if ((k *= 2) < 1) { return 0.5 * (k * k * ((s + 1) * k - s)); @@ -9833,30 +11214,44 @@ define( }, // 创建弹跳效果 - BounceIn: function(k) { - return 1 - Easing.BounceOut(1 - k); + /** + * @param {number} k + * @return {number} + */ + BounceIn: function (k) { + return 1 - easing.BounceOut(1 - k); }, - BounceOut: function(k) { + /** + * @param {number} k + * @return {number} + */ + BounceOut: function (k) { if (k < (1 / 2.75)) { return 7.5625 * k * k; } else if (k < (2 / 2.75)) { return 7.5625 * (k -= (1.5 / 2.75)) * k + 0.75; - } else if (k < (2.5 / 2.75)) { + } + else if (k < (2.5 / 2.75)) { return 7.5625 * (k -= (2.25 / 2.75)) * k + 0.9375; - } else { + } + else { return 7.5625 * (k -= (2.625 / 2.75)) * k + 0.984375; } }, - BounceInOut: function(k) { + /** + * @param {number} k + * @return {number} + */ + BounceInOut: function (k) { if (k < 0.5) { - return Easing.BounceIn(k * 2) * 0.5; + return easing.BounceIn(k * 2) * 0.5; } - return Easing.BounceOut(k * 2 - 1) * 0.5 + 0.5; + return easing.BounceOut(k * 2 - 1) * 0.5 + 0.5; } }; - return Easing; + return easing; } ); @@ -9882,20 +11277,20 @@ define( this._targetPool = options.target || {}; if (!(this._targetPool instanceof Array)) { - this._targetPool = [this._targetPool]; + this._targetPool = [ this._targetPool ]; } - //生命周期 + // 生命周期 this._life = options.life || 1000; - //延时 + // 延时 this._delay = options.delay || 0; - //开始时间 - this._startTime = new Date().getTime() + this._delay;//单位毫秒 + // 开始时间 + this._startTime = new Date().getTime() + this._delay;// 单位毫秒 - //结束时间 + // 结束时间 this._endTime = this._startTime + this._life * 1000; - //是否循环 + // 是否循环 this.loop = typeof options.loop == 'undefined' ? false : options.loop; @@ -9912,7 +11307,7 @@ define( step : function (time) { var percent = (time - this._startTime) / this._life; - //还没开始 + // 还没开始 if (percent < 0) { return; } @@ -9967,17 +11362,9 @@ define( /** * 动画主类, 调度和管理所有动画控制器 - * + * + * @module zrender/animation/Animation * @author pissang(https://github.com/pissang) - * - * @class : Animation - * @config : stage(optional) 绘制类, 需要提供update接口 - * @config : onframe(optional) - * @method : add - * @method : remove - * @method : update - * @method : start - * @method : stop */ define( 'zrender/animation/Animation',['require','./Clip','../tool/color','../tool/util','../tool/event'],function(require) { @@ -9993,11 +11380,41 @@ define( || window.msRequestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame - || function(func){setTimeout(func, 16);}; + || function (func) { + setTimeout(func, 16); + }; var arraySlice = Array.prototype.slice; - function Animation(options) { + /** + * @typedef {Object} IZRenderStage + * @property {Function} update + */ + + /** + * @alias module:zrender/animation/Animation + * @constructor + * @param {Object} [options] + * @param {Function} [options.onframe] + * @param {IZRenderStage} [options.stage] + * @example + * var animation = new Animation(); + * var obj = { + * x: 100, + * y: 100 + * }; + * animation.animate(node.position) + * .when(1000, { + * x: 500, + * y: 500 + * }) + * .when(2000, { + * x: 100, + * y: 100 + * }) + * .start('spline'); + */ + var Animation = function (options) { options = options || {}; @@ -10013,19 +11430,27 @@ define( this._time = 0; Dispatcher.call(this); - } + }; Animation.prototype = { - add : function(clip) { + /** + * 添加动画片段 + * @param {module:zrender/animation/Clip} clip + */ + add: function(clip) { this._clips.push(clip); }, - remove : function(clip) { + /** + * 删除动画片段 + * @param {module:zrender/animation/Clip} clip + */ + remove: function(clip) { var idx = util.indexOf(this._clips, clip); if (idx >= 0) { this._clips.splice(idx, 1); } }, - update : function() { + _update: function() { var time = new Date().getTime(); var delta = time - this._time; @@ -10051,10 +11476,11 @@ define( // Remove the finished clip for (var i = 0; i < len;) { if (clips[i]._needsRemove) { - clips[i] = clips[len-1]; + clips[i] = clips[len - 1]; clips.pop(); len--; - } else { + } + else { i++; } } @@ -10070,14 +11496,17 @@ define( this.dispatch('frame', delta); }, - start : function() { + /** + * 开始运行动画 + */ + start: function () { var self = this; this._running = true; function step() { if (self._running) { - self.update(); + self._update(); requestAnimationFrame(step); } } @@ -10085,15 +11514,32 @@ define( this._time = new Date().getTime(); requestAnimationFrame(step); }, - stop : function() { + /** + * 停止运行动画 + */ + stop: function () { this._running = false; }, - clear : function() { + /** + * 清除所有动画片段 + */ + clear : function () { this._clips = []; }, - animate : function(target, options) { + /** + * 对一个目标创建一个animator对象,可以指定目标中的属性使用动画 + * @param {Object} target + * @param {Object} options + * @param {boolean} [options.loop=false] 是否循环播放动画 + * @param {Function} [options.getter=null] + * 如果指定getter函数,会通过getter函数取属性值 + * @param {Function} [options.setter=null] + * 如果指定setter函数,会通过setter函数设置属性值 + * @return {module:zrender/animation/Animation~Animator} + */ + animate : function (target, options) { options = options || {}; - var deferred = new Deferred( + var deferred = new Animator( target, options.loop, options.getter, @@ -10125,7 +11571,8 @@ define( for (var i = 0; i < len; i++) { out[i] = _interpolateNumber(p0[i], p1[i], percent); } - } else { + } + else { var len2 = p0[0].length; for (var i = 0; i < len; i++) { for (var j = 0; j < len2; j++) { @@ -10157,7 +11604,8 @@ define( p0[i], p1[i], p2[i], p3[i], t, t2, t3 ); } - } else { + } + else { var len2 = p0[0].length; for (var i = 0; i < len; i++) { for (var j = 0; j < len2; j++) { @@ -10174,7 +11622,7 @@ define( var v0 = (p2 - p0) * 0.5; var v1 = (p3 - p1) * 0.5; return (2 * (p1 - p2) + v0 + v1) * t3 - + (- 3 * (p1 - p2) - 2 * v0 - v1) * t2 + + (-3 * (p1 - p2) - 2 * v0 - v1) * t2 + v0 * t + p1; } @@ -10187,10 +11635,12 @@ define( ret.push(arraySlice.call(value[i])); } return ret; - } else { + } + else { return arraySlice.call(value); } - } else { + } + else { return value; } } @@ -10203,7 +11653,15 @@ define( return 'rgba(' + rgba.join(',') + ')'; } - function Deferred(target, loop, getter, setter) { + /** + * @alias module:zrender/animation/Animation~Animator + * @constructor + * @param {Object} target + * @param {boolean} loop + * @param {Function} getter + * @param {Function} setter + */ + var Animator = function(target, loop, getter, setter) { this._tracks = {}; this._target = target; @@ -10221,12 +11679,18 @@ define( this._onframeList = []; this._clipList = []; - } + }; - Deferred.prototype = { + Animator.prototype = { + /** + * 设置动画关键帧 + * @param {number} time 关键帧时间,单位是ms + * @param {Object} props 关键帧的属性值,key-value表示 + * @return {module:zrender/animation/Animation~Animator} + */ when : function(time /* ms */, props) { for (var propName in props) { - if (! this._tracks[propName]) { + if (!this._tracks[propName]) { this._tracks[propName] = []; // If time is 0 // Then props is given initialize value @@ -10248,11 +11712,22 @@ define( } return this; }, - during : function(callback) { + /** + * 添加动画每一帧的回调函数 + * @param {Function} callback + * @return {module:zrender/animation/Animation~Animator} + */ + during: function (callback) { this._onframeList.push(callback); return this; }, - start : function(easing) { + /** + * 开始执行动画 + * @param {string|Function} easing + * 动画缓动函数,详见{@link module:zrender/animation/easing} + * @return {module:zrender/animation/Animation~Animator} + */ + start: function (easing) { var self = this; var setter = this._setter; @@ -10273,7 +11748,7 @@ define( } }; - var createTrackClip = function(keyframes, propName) { + var createTrackClip = function (keyframes, propName) { var trackLen = keyframes.length; if (!trackLen) { return; @@ -10295,8 +11770,9 @@ define( }); var trackMaxTime; if (trackLen) { - trackMaxTime = keyframes[trackLen-1].time; - }else{ + trackMaxTime = keyframes[trackLen - 1].time; + } + else { return; } // Percents of each keyframe @@ -10323,15 +11799,19 @@ define( var cacheKey = 0; var cachePercent = 0; var start; - var i, w; - var p0, p1, p2, p3; + var i; + var w; + var p0; + var p1; + var p2; + var p3; if (isValueColor) { - var rgba = [0, 0, 0, 0]; + var rgba = [ 0, 0, 0, 0 ]; } - var onframe = function(target, percent) { + var onframe = function (target, percent) { // Find the range keyframes // kf1-----kf2---------current--------kf3 // find kf2 and kf3 and do interpolation @@ -10343,22 +11823,24 @@ define( break; } } - i = Math.min(i, trackLen-2); - } else { + i = Math.min(i, trackLen - 2); + } + else { for (i = cacheKey; i < trackLen; i++) { if (kfPercents[i] > percent) { break; } } - i = Math.min(i-1, trackLen-2); + i = Math.min(i - 1, trackLen - 2); } cacheKey = i; cachePercent = percent; - var range = (kfPercents[i+1] - kfPercents[i]); + var range = (kfPercents[i + 1] - kfPercents[i]); if (range === 0) { return; - } else { + } + else { w = (percent - kfPercents[i]) / range; } if (useSpline) { @@ -10368,21 +11850,23 @@ define( p3 = kfValues[i > trackLen - 3 ? trackLen - 1 : i + 2]; if (isValueArray) { _catmullRomInterpolateArray( - p0, p1, p2, p3, w, w*w, w*w*w, + p0, p1, p2, p3, w, w * w, w * w * w, getter(target, propName), arrDim ); - } else { + } + else { var value; if (isValueColor) { value = _catmullRomInterpolateArray( - p0, p1, p2, p3, w, w*w, w*w*w, + p0, p1, p2, p3, w, w * w, w * w * w, rgba, 1 ); value = rgba2String(rgba); - } else { + } + else { value = _catmullRomInterpolate( - p0, p1, p2, p3, w, w*w, w*w*w + p0, p1, p2, p3, w, w * w, w * w * w ); } setter( @@ -10391,23 +11875,26 @@ define( value ); } - } else { + } + else { if (isValueArray) { _interpolateArray( - kfValues[i], kfValues[i+1], w, + kfValues[i], kfValues[i + 1], w, getter(target, propName), arrDim ); - } else { + } + else { var value; if (isValueColor) { _interpolateArray( - kfValues[i], kfValues[i+1], w, + kfValues[i], kfValues[i + 1], w, rgba, 1 ); value = rgba2String(rgba); - } else { - value = _interpolateNumber(kfValues[i], kfValues[i+1], w); + } + else { + value = _interpolateNumber(kfValues[i], kfValues[i + 1], w); } setter( target, @@ -10444,6 +11931,9 @@ define( } return this; }, + /** + * 停止动画 + */ stop : function() { for (var i = 0; i < this._clipList.length; i++) { var clip = this._clipList[i]; @@ -10451,12 +11941,22 @@ define( } this._clipList = []; }, - delay : function(time){ + /** + * 设置动画延迟开始的时间 + * @param {number} time 单位ms + * @return {module:zrender/animation/Animation~Animator} + */ + delay : function (time) { this._delay = time; return this; }, - done : function(func) { - this._doneList.push(func); + /** + * 添加动画结束的回调 + * @param {Function} cb + * @return {module:zrender/animation/Animation~Animator} + */ + done : function(cb) { + this._doneList.push(cb); return this; } }; @@ -10466,8 +11966,7 @@ define( ); /*! - * ZRender, a lightweight canvas library with a MVC architecture, data-driven - * and provides an event model like DOM. + * ZRender, a high performance canvas library. * * Copyright (c) 2013, Baidu Inc. * All rights reserved. @@ -10475,16 +11974,8 @@ define( * LICENSE * https://github.com/ecomfe/zrender/blob/master/LICENSE.txt */ - -/** - * zrender: core核心类 - * - * @desc zrender是一个轻量级的Canvas类库,MVC封装,数据驱动,提供类Dom事件模型。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ define( - 'zrender/zrender',['require','./lib/excanvas','./tool/util','./tool/log','./tool/guid','./Handler','./Painter','./Storage','./animation/Animation','./tool/env'],function(require) { + 'zrender/zrender',['require','./dep/excanvas','./tool/util','./tool/log','./tool/guid','./Handler','./Painter','./Storage','./animation/Animation','./tool/env'],function(require) { /* * HTML5 Canvas for Internet Explorer! * Modern browsers like Firefox, Safari, Chrome and Opera support @@ -10497,7 +11988,7 @@ define( * http://explorercanvas.googlecode.com/svn/trunk/excanvas.js */ // 核心代码会生成一个全局变量 G_vmlCanvasManager,模块改造后借用于快速判断canvas支持 - require('./lib/excanvas'); + require('./dep/excanvas'); var util = require('./tool/util'); var log = require('./tool/log'); @@ -10508,37 +11999,43 @@ define( var Storage = require('./Storage'); var Animation = require('./animation/Animation'); - var _instances = {}; //ZRender实例map索引 + var _instances = {}; // ZRender实例map索引 + /** + * @exports zrender + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * pissang (https://www.github.com/pissang) + */ var zrender = {}; - zrender.version = '2.0.2'; + /** + * @type {string} + */ + zrender.version = '2.0.4'; /** - * zrender初始化 - * 不让外部直接new ZRender实例,为啥? - * 不为啥,提供全局可控同时减少全局污染和降低命名冲突的风险! + * 创建zrender实例 * - * @param {HTMLElement} dom dom对象,不帮你做document.getElementById了 - * @param {Object=} params 个性化参数,如自定义shape集合,带进来就好 - * - * @return {ZRender} ZRender实例 - */ - zrender.init = function(dom, params) { - var zi = new ZRender(guid(), dom, params || {}); - _instances[zi.id] = zi; - return zi; + * @param {HTMLElement} dom 绘图容器 + * @return {module:zrender~ZRender} ZRender实例 + */ + // 不让外部直接new ZRender实例,为啥? + // 不为啥,提供全局可控同时减少全局污染和降低命名冲突的风险! + zrender.init = function(dom) { + var zr = new ZRender(guid(), dom); + _instances[zr.id] = zr; + return zr; }; /** - * zrender实例销毁,记在_instances里的索引也会删除了 - * 管生就得管死,可以通过zrender.dispose(zi)销毁指定ZRender实例 - * 当然也可以直接zi.dispose()自己销毁 - * - * @param {ZRender=} zi ZRender对象,不传则销毁全部 + * zrender实例销毁 + * @param {module:zrender~ZRender} zr ZRender对象,不传则销毁全部 */ - zrender.dispose = function (zi) { - if (zi) { - zi.dispose(); + // 在_instances里的索引也会删除了 + // 管生就得管死,可以通过zrender.dispose(zr)销毁指定ZRender实例 + // 当然也可以直接zr.dispose()自己销毁 + zrender.dispose = function (zr) { + if (zr) { + zr.dispose(); } else { for (var key in _instances) { @@ -10552,8 +12049,8 @@ define( /** * 获取zrender实例 - * * @param {string} id ZRender对象索引 + * @return {module:zrender~ZRender} */ zrender.getInstance = function (id) { return _instances[id]; @@ -10574,29 +12071,33 @@ define( }; function getFrameCallback(zrInstance) { - return function(){ - var animatingShapes = zrInstance.animatingShapes; - for (var i = 0, l = animatingShapes.length; i < l; i++) { - zrInstance.storage.mod(animatingShapes[i].id); + return function () { + var animatingElements = zrInstance.animatingElements; + for (var i = 0, l = animatingElements.length; i < l; i++) { + zrInstance.storage.mod(animatingElements[i].id); } - if (animatingShapes.length || zrInstance._needsRefreshNextFrame) { + if (animatingElements.length || zrInstance._needsRefreshNextFrame) { zrInstance.refresh(); } }; } /** - * ZRender接口类,对外可用的所有接口都在这里!! - * storage(M)、painter(V)、handler(C)为内部私有类,外部接口不可见 - * 非get接口统一返回支持链式调用~ + * ZRender接口类,对外可用的所有接口都在这里 + * 非get接口统一返回支持链式调用 * + * @constructor + * @alias module:zrender~ZRender * @param {string} id 唯一标识 * @param {HTMLElement} dom dom对象,不帮你做document.getElementById - * * @return {ZRender} ZRender实例 */ - function ZRender(id, dom) { + var ZRender = function(id, dom) { + /** + * 实例 id + * @type {string} + */ this.id = id; this.env = require('./tool/env'); @@ -10605,19 +12106,23 @@ define( this.handler = new Handler(dom, this.storage, this.painter); // 动画控制 - this.animatingShapes = []; + this.animatingElements = []; + /** + * @type {module:zrender/animation/Animation} + */ this.animation = new Animation({ - stage : { - update : getFrameCallback(this) + stage: { + update: getFrameCallback(this) } }); this.animation.start(); this._needsRefreshNextFrame = false; - } + }; /** * 获取实例唯一标识 + * @return {string} */ ZRender.prototype.getId = function () { return this.id; @@ -10626,7 +12131,7 @@ define( /** * 添加图形形状到根节点 * - * @param {zrender.shape.Base} shape 形状对象,可用属性全集,详见各shape + * @param {module:zrender/shape/Base} shape 形状对象,可用属性全集,详见各shape */ ZRender.prototype.addShape = function (shape) { this.storage.addRoot(shape); @@ -10636,7 +12141,7 @@ define( /** * 添加组到根节点 * - * @param {zrender.shape.Group} group + * @param {module:zrender/Group} group */ ZRender.prototype.addGroup = function(group) { this.storage.addRoot(group); @@ -10677,7 +12182,7 @@ define( /** * 修改组 * - * @param {string} shapeId + * @param {string} groupId * @param {Object} group */ ZRender.prototype.modGroup = function (groupId, group) { @@ -10686,10 +12191,19 @@ define( }; /** - * 修改指定zlevel的绘制配置项,例如clearColor + * 修改指定zlevel的绘制配置项 * * @param {string} zLevel - * @param {Object} config 配置对象, 目前支持clearColor + * @param {Object} config 配置对象 + * @param {string} [config.clearColor=0] 每次清空画布的颜色 + * @param {string} [config.motionBlur=false] 是否开启动态模糊 + * @param {number} [config.lastFrameAlpha=0.7] + * 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显 + * @param {Array.} [config.position] 层的平移 + * @param {Array.} [config.rotation] 层的旋转 + * @param {Array.} [config.scale] 层的缩放 + * @param {boolean} [config.zoomable=false] 层是否支持鼠标缩放操作 + * @param {boolean} [config.panable=false] 层是否支持鼠标平移操作 */ ZRender.prototype.modLayer = function (zLevel, config) { this.painter.modLayer(zLevel, config); @@ -10710,7 +12224,6 @@ define( * 渲染 * * @param {Function} callback 渲染结束后回调函数 - * todo:增加缓动函数 */ ZRender.prototype.render = function (callback) { this.painter.render(callback); @@ -10729,16 +12242,16 @@ define( return this; }; - // TODO - // 好像会有奇怪的问题 + /** + * 标记视图在浏览器下一帧需要绘制 + */ ZRender.prototype.refreshNextFrame = function() { this._needsRefreshNextFrame = true; return this; }; /** - * 高亮层更新 - * + * 绘制高亮层 * @param {Function} callback 视图更新后回调函数 */ ZRender.prototype.refreshHover = function (callback) { @@ -10749,14 +12262,17 @@ define( /** * 视图更新 * - * @param {Array} shapeList 需要更新的图形元素列表 + * @param {Array.} shapeList 需要更新的图形列表 * @param {Function} callback 视图更新后回调函数 */ - ZRender.prototype.update = function (shapeList, callback) { - this.painter.update(shapeList, callback); + ZRender.prototype.refreshShapes = function (shapeList, callback) { + this.painter.refreshShapes(shapeList, callback); return this; }; + /** + * 调整视图大小 + */ ZRender.prototype.resize = function() { this.painter.resize(); return this; @@ -10765,23 +12281,25 @@ define( /** * 动画 * - * @param {string} shapeId 形状对象唯一标识 + * @param {string|module:zrender/Group|module:zrender/shape/Base} el 动画对象 * @param {string} path 需要添加动画的属性获取路径,可以通过a.b.c来获取深层的属性 - * @param {boolean} loop 动画是否循环 - * @return {Object} 动画的Deferred对象 - * Example: - * zr.animate(circleId, 'style', false) - * .when(1000, { x: 10} ) - * .done(function(){ console.log('Animation done')}) - * .start() - */ - ZRender.prototype.animate = function (shapeId, path, loop) { - var shape = this.storage.get(shapeId); - if (shape) { + * @param {boolean} [loop] 动画是否循环 + * @return {module:zrender/animation/Animation~Animator} + * @example: + * zr.animate(circle.id, 'style', false) + * .when(1000, {x: 10} ) + * .done(function(){ // Animation done }) + * .start() + */ + ZRender.prototype.animate = function (el, path, loop) { + if (typeof(el) === 'string') { + el = this.storage.get(el); + } + if (el) { var target; if (path) { var pathSplitted = path.split('.'); - var prop = shape; + var prop = el; for (var i = 0, l = pathSplitted.length; i < l; i++) { if (!prop) { continue; @@ -10793,41 +12311,41 @@ define( } } else { - target = shape; + target = el; } if (!target) { log( 'Property "' + path - + '" is not existed in shape ' - + shapeId + + '" is not existed in element ' + + el.id ); return; } - var animatingShapes = this.animatingShapes; - if (typeof shape.__aniCount === 'undefined') { + var animatingElements = this.animatingElements; + if (typeof el.__aniCount === 'undefined') { // 正在进行的动画记数 - shape.__aniCount = 0; + el.__aniCount = 0; } - if (shape.__aniCount === 0) { - animatingShapes.push(shape); + if (el.__aniCount === 0) { + animatingElements.push(el); } - shape.__aniCount++; + el.__aniCount++; - return this.animation.animate(target, {loop : loop}) - .done(function() { - shape.__aniCount --; - if (shape.__aniCount === 0) { - // 从animatingShapes里移除 - var idx = util.indexOf(animatingShapes, shape); - animatingShapes.splice(idx, 1); + return this.animation.animate(target, { loop: loop }) + .done(function () { + el.__aniCount--; + if (el.__aniCount === 0) { + // 从animatingElements里移除 + var idx = util.indexOf(animatingElements, el); + animatingElements.splice(idx, 1); } }); } else { - log('Shape "'+ shapeId + '" not existed'); + log('Element not existed'); } }; @@ -10871,7 +12389,10 @@ define( }; /** - * 图像导出 + * 图像导出 + * @param {string} type + * @param {string} [backgroundColor='#fff'] 背景色 + * @return {string} 图片的Base64 url */ ZRender.prototype.toDataURL = function(type, backgroundColor, args) { return this.painter.toDataURL(type, backgroundColor, args); @@ -10879,6 +12400,9 @@ define( /** * 将常规shape转成image shape + * @param {module:zrender/shape/Base} e + * @param {number} width + * @param {number} height */ ZRender.prototype.shapeToImage = function(e, width, height) { var id = guid(); @@ -10910,7 +12434,7 @@ define( /** * 事件触发 * - * @param {string} event 事件名称,resize,hover,drag,etc~ + * @param {string} eventName 事件名称,resize,hover,drag,etc * @param {event=} event event dom事件对象 */ ZRender.prototype.trigger = function (eventName, event) { @@ -10940,12 +12464,12 @@ define( this.handler.dispose(); this.animation = - this.animatingShapes = + this.animatingElements = this.storage = this.painter = this.handler = null; - //释放后告诉全局删除对自己的索引,没想到啥好方法 + // 释放后告诉全局删除对自己的索引,没想到啥好方法 zrender.delInstance(this.id); }; @@ -11164,12 +12688,12 @@ define('echarts/component/base',['require','../config','../util/ecQuery','../uti * 基类方法 */ Base.prototype = { - canvasSupported : require('zrender/tool/env').canvasSupported, + canvasSupported: require('zrender/tool/env').canvasSupported, /** * 获取zlevel基数配置 * @param {Object} contentType */ - getZlevelBase : function (contentType) { + getZlevelBase: function (contentType) { contentType = contentType || this.type + ''; switch (contentType) { @@ -11195,6 +12719,7 @@ define('echarts/component/base',['require','../config','../util/ecQuery','../uti case ecConfig.COMPONENT_TYPE_DATARANGE: case ecConfig.COMPONENT_TYPE_DATAZOOM : case ecConfig.COMPONENT_TYPE_TIMELINE : + case ecConfig.COMPONENT_TYPE_ROAMCONTROLLER : return 4; case ecConfig.CHART_TYPE_ISLAND : @@ -11220,7 +12745,7 @@ define('echarts/component/base',['require','../config','../util/ecQuery','../uti * * @return {Object} 修正后的参数 */ - reformOption : function (opt) { + reformOption: function (opt) { return zrUtil.merge( opt || {}, zrUtil.clone(this.ecTheme[this.type] || {}) @@ -11230,7 +12755,7 @@ define('echarts/component/base',['require','../config','../util/ecQuery','../uti /** * css类属性数组补全,如padding,margin等~ */ - reformCssArray : function (p) { + reformCssArray: function (p) { if (p instanceof Array) { switch (p.length + '') { case '4': @@ -11250,9 +12775,9 @@ define('echarts/component/base',['require','../config','../util/ecQuery','../uti } }, - getShapeById : function(id) { + getShapeById: function(id) { for (var i = 0, l = this.shapeList.length; i < l; i++) { - if (this.shapeList[i].id == id) { + if (this.shapeList[i].id === id) { return this.shapeList[i]; } } @@ -11262,7 +12787,7 @@ define('echarts/component/base',['require','../config','../util/ecQuery','../uti /** * 获取自定义和默认配置合并后的字体设置 */ - getFont : function (textStyle) { + getFont: function (textStyle) { var finalTextStyle = zrUtil.merge( zrUtil.clone(textStyle) || {}, this.ecTheme.textStyle @@ -11273,16 +12798,16 @@ define('echarts/component/base',['require','../config','../util/ecQuery','../uti + finalTextStyle.fontFamily; }, - getItemStyleColor : function (itemColor, seriesIndex, dataIndex, data) { - return typeof itemColor == 'function' + getItemStyleColor: function (itemColor, seriesIndex, dataIndex, data) { + return typeof itemColor === 'function' ? itemColor(seriesIndex, dataIndex, data) : itemColor; }, // 亚像素优化 - subPixelOptimize : function (position, lineWidth) { - if (lineWidth % 2 == 1) { - //position += position == Math.ceil(position) ? 0.5 : 0; + subPixelOptimize: function (position, lineWidth) { + if (lineWidth % 2 === 1) { + //position += position === Math.ceil(position) ? 0.5 : 0; position = Math.floor(position) + 0.5; } else { @@ -11292,7 +12817,7 @@ define('echarts/component/base',['require','../config','../util/ecQuery','../uti }, - resize : function () { + resize: function () { this.refresh && this.refresh(); this.clearEffectShape && this.clearEffectShape(true); var self = this; @@ -11313,20 +12838,20 @@ define('echarts/component/base',['require','../config','../util/ecQuery','../uti /** * 释放后实例不可用 */ - dispose : function () { + dispose: function () { this.clear(); this.shapeList = null; this.effectList = null; }, - query : ecQuery.query, - deepQuery : ecQuery.deepQuery, - deepMerge : ecQuery.deepMerge, + query: ecQuery.query, + deepQuery: ecQuery.deepQuery, + deepMerge: ecQuery.deepMerge, - parsePercent : number.parsePercent, - parseCenter : number.parseCenter, - parseRadius : number.parseRadius, - numAddCommas : number.addCommas + parsePercent: number.parsePercent, + parseCenter: number.parseCenter, + parseRadius: number.parseRadius, + numAddCommas: number.addCommas }; return Base; @@ -11337,48 +12862,30 @@ define('echarts/component/base',['require','../config','../util/ecQuery','../uti * * @author Kener (@Kener-林峰, linzhifeng@baidu.com) * - * sin:正弦函数,自动缓存 - * cos:余弦函数,自动缓存 + * sin:正弦函数 + * cos:余弦函数 * degreeToRadian:角度转弧度 * radianToDegree:弧度转角度 */ define( - 'zrender/tool/math',[],function() { - /* - var _cache = { - sin : {}, //sin缓存 - cos : {} //cos缓存 - }; - */ + 'zrender/tool/math',[],function () { + var _radians = Math.PI / 180; /** - * @param angle 弧度(角度)参数 - * @param isDegrees angle参数是否为角度计算,默认为false,angle为以弧度计量的角度 + * @param {number} angle 弧度(角度)参数 + * @param {boolean} isDegrees angle参数是否为角度计算,默认为false,angle为以弧度计量的角度 */ function sin(angle, isDegrees) { return Math.sin(isDegrees ? angle * _radians : angle); - /* - angle = (isDegrees ? angle * _radians : angle).toFixed(4); - if(typeof _cache.sin[angle] == 'undefined') { - _cache.sin[angle] = Math.sin(angle); - } - return _cache.sin[angle]; - */ } /** - * @param radians 弧度参数 + * @param {number} angle 弧度(角度)参数 + * @param {boolean} isDegrees angle参数是否为角度计算,默认为false,angle为以弧度计量的角度 */ function cos(angle, isDegrees) { return Math.cos(isDegrees ? angle * _radians : angle); - /* - angle = (isDegrees ? angle * _radians : angle).toFixed(4); - if(typeof _cache.cos[angle] == 'undefined') { - _cache.cos[angle] = Math.cos(angle); - } - return _cache.cos[angle]; - */ } /** @@ -11405,82 +12912,53 @@ define( }; } ); + /** - * zrender - * + * n角星(n>3) + * @module zrender/shape/Star * @author sushuang (宿爽, sushuang@baidu.com) - * - * shape类:n角星(n>3) - * 可配图形属性: - { - // 基础属性 - shape : 'star', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,n角星外接圆心横坐标 - y : {number}, // 必须,n角星外接圆心纵坐标 - r : {number}, // 必须,n角星外接圆半径 - r0 : {number}, // n角星内部顶点(凹点)的外接圆半径, - // 如果不指定此参数,则自动计算:取相隔外部顶点连线的交点作内部顶点 - n : {number}, // 必须,指明几角星 - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - lineJoin : {string}, // 默认为miter,线段连接样式。miter | round | bevel - - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为outside,附加文本位置。 - // outside | inside - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'star', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - r : 150, - n : 5, - color : '#eee' - }, - myName : 'kener', // 可自带任何有效自定义属性 + * @example + * var Star = require('zrender/shape/Star'); + * var shape = new Star({ + * style: { + * x: 200, + * y: 100, + * r: 150, + * n: 5, + * text: '五角星' + * } + * }); + * zr.addShape(shape); + */ - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } +/** + * @typedef {Object} IStarStyle + * @property {number} x n角星外接圆心x坐标 + * @property {number} y n角星外接圆心y坐标 + * @property {number} r n角星外接圆半径 + * @property {number} [r0] n角星内部顶点(凹点)的外接圆半径。 + * 如果不指定此参数,则自动计算:取相隔外部顶点连线的交点作内部顶点。 + * @property {number} n 指明几角星 + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic */ + define( 'zrender/shape/Star',['require','../tool/math','./Base','../tool/util'],function (require) { @@ -11491,21 +12969,39 @@ define( var Base = require('./Base'); - function Star(options) { + /** + * @alias module:zrender/shape/Star + * @param {Object} options + * @constructor + * @extends module:zrender/shape/Base + */ + var Star = function(options) { Base.call(this, options); - } + /** + * n角星绘制样式 + * @name module:zrender/shape/Star#style + * @type {module:zrender/shape/Star~IStarStyle} + */ + /** + * n角星高亮绘制样式 + * @name module:zrender/shape/Star#highlightStyle + * @type {module:zrender/shape/Star~IStarStyle} + */ + }; Star.prototype = { type: 'star', /** * 创建n角星(n>3)路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Star~IStarStyle} style */ buildPath : function(ctx, style) { var n = style.n; - if (!n || n < 2) { return; } + if (!n || n < 2) { + return; + } var x = style.x; var y = style.y; @@ -11530,26 +13026,29 @@ define( // 记录边界点,用于判断inside var pointList = style.pointList = []; - pointList.push([xStart, yStart]); - for (var i = 0, end = n * 2 - 1, ri; i < end; i ++) { + pointList.push([ xStart, yStart ]); + for (var i = 0, end = n * 2 - 1, ri; i < end; i++) { ri = i % 2 === 0 ? r0 : r; - pointList.push([x + ri * cos(deg), y + ri * sin(deg)]); + pointList.push([ x + ri * cos(deg), y + ri * sin(deg) ]); deg += dStep; } - pointList.push([xStart, yStart]); + pointList.push([ xStart, yStart ]); // 绘制 ctx.moveTo(pointList[0][0], pointList[0][1]); - for (var i = 0; i < pointList.length; i ++) { + for (var i = 0; i < pointList.length; i++) { ctx.lineTo(pointList[i][0], pointList[i][1]); } + + ctx.closePath(); return; }, /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style + * 返回n角星包围盒矩形 + * @param {module:zrender/shape/Star~IStarStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} */ getRect : function(style) { if (style.__rect) { @@ -11578,97 +13077,88 @@ define( return Star; } ); + /** - * zrender - * + * @module zrender/shape/Heart * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:心形 - * 可配图形属性: - { - // 基础属性 - shape : 'heart', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,心形内部尖端横坐标 - y : {number}, // 必须,心形内部尖端纵坐标 - a : {number}, // 必须,心形横宽(中轴线到水平边缘最宽处距离) - b : {number}, // 必须,心形纵高(内尖到外尖距离) - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为outside,附加文本位置。 - // outside | inside - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'heart', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - a : 50, - b : 80, - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 + * @example + * var Heart = require('zrender/shape/Heart'); + * var shape = new Heart({ + * style: { + * x: 100, + * y: 100, + * a: 40, + * b: 40, + * brushType: 'both', + * color: 'blue', + * strokeColor: 'red', + * lineWidth: 3, + * text: 'Heart' + * } + * }); + * zr.addShape(shape); + */ - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } +/** + * @typedef {Object} IHeartStyle + * @property {number} x 心形内部尖端横坐标 + * @property {number} y 心形内部尖端纵坐标 + * @property {number} a 心形横宽(中轴线到水平边缘最宽处距离) + * @property {number} b 心形纵高(内尖到外尖距离) + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic */ define( 'zrender/shape/Heart',['require','./Base','../tool/util'],function (require) { + + var Base = require('./Base'); - function Heart(options) { + /** + * @alias module:zrender/shape/Heart + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var Heart = function (options) { Base.call(this, options); - } + /** + * 心形绘制样式 + * @name module:zrender/shape/Heart#style + * @type {module:zrender/shape/Heart~IHeartStyle} + */ + /** + * 心形高亮绘制样式 + * @name module:zrender/shape/Heart#highlightStyle + * @type {module:zrender/shape/Heart~IHeartStyle} + */ + }; Heart.prototype = { type: 'heart', /** * 创建扇形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Heart~IHeartStyle} style */ - buildPath : function(ctx, style) { + buildPath : function (ctx, style) { ctx.moveTo(style.x, style.y); ctx.bezierCurveTo( style.x + style.a / 2, @@ -11686,14 +13176,16 @@ define( style.x, style.y ); + ctx.closePath(); return; }, /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style + * 计算返回心形的包围盒矩形 + * @param {module:zrender/shape/Heart~IHeartStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} */ - getRect : function(style) { + getRect : function (style) { if (style.__rect) { return style.__rect; } @@ -11720,95 +13212,87 @@ define( return Heart; } ); + /** - * zrender - * + * 水滴形状 + * @module zrender/shape/Droplet * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:水滴 - * 可配图形属性: - { - // 基础属性 - shape : 'heart', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,水滴中心横坐标 - y : {number}, // 必须,水滴中心纵坐标 - a : {number}, // 必须,水滴横宽(中心到水平边缘最宽处距离) - b : {number}, // 必须,水滴纵高(中心到尖端距离) - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为outside,附加文本位置。 - // outside | inside - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'droplet', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - a : 50, - b : 80, - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 + * @example + * var Droplet = require('zrender/shape/Droplet'); + * var shape = new Droplet({ + * style: { + * x: 100, + * y: 100, + * a: 40, + * b: 40, + * brushType: 'both', + * color: 'blue', + * strokeColor: 'red', + * lineWidth: 3, + * text: 'Droplet' + * } + * }); + * zr.addShape(shape); + */ - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } +/** + * @typedef {Object} IDropletStyle + * @property {number} x 水滴中心x坐标 + * @property {number} y 水滴中心y坐标 + * @property {number} a 水滴横宽(中心到水平边缘最宽处距离) + * @property {number} b 水滴纵高(中心到尖端距离) + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic */ define( 'zrender/shape/Droplet',['require','./Base','../tool/util'],function (require) { + + var Base = require('./Base'); - function Droplet(options) { + /** + * @alias module:zrender/shape/Droplet + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var Droplet = function(options) { Base.call(this, options); - } + /** + * 水滴绘制样式 + * @name module:zrender/shape/Droplet#style + * @type {module:zrender/shape/Droplet~IDropletStyle} + */ + /** + * 水滴高亮绘制样式 + * @name module:zrender/shape/Droplet#highlightStyle + * @type {module:zrender/shape/Droplet~IDropletStyle} + */ + }; Droplet.prototype = { type: 'droplet', /** - * 创建扇形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 + * 创建水滴路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Droplet~IDropletStyle} style */ buildPath : function(ctx, style) { ctx.moveTo(style.x, style.y + style.a); @@ -11828,11 +13312,13 @@ define( style.x, style.y + style.a ); + ctx.closePath(); }, /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style + * 计算返回水滴的包围盒矩形 + * @param {module:zrender/shape/Droplet~IDropletStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} */ getRect : function(style) { if (style.__rect) { @@ -11861,6 +13347,7 @@ define( return Droplet; } ); + /** * echarts扩展zrender shape * @@ -11915,9 +13402,6 @@ define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/S ctx.moveTo(style.x + 13 * dx, style.y + 10 * dy); ctx.lineTo(style.x + 13 * dx, style.y + style.height); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); } function _iconMarkUndo(ctx, style) { @@ -11935,9 +13419,6 @@ define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/S ctx.moveTo(style.x + 10 * dx, style.y + 13 * dy); ctx.lineTo(style.x + style.width, style.y + 13 * dy); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); } function _iconMarkClear(ctx, style) { @@ -11962,9 +13443,6 @@ define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/S ctx.lineTo(style.x + 3 * dx, style.y + style.height); ctx.lineTo(style.x + 13 * dx, style.y + style.height); ctx.lineTo(style.x + style.width, style.y + 5 * dy); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); } function _iconDataZoom(ctx, style) { @@ -11982,9 +13460,6 @@ define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/S ctx.lineTo(style.x + style.width, style.y + style.height); ctx.lineTo(style.x + style.width, style.y + 3 * dy); ctx.lineTo(style.x + 8 * dx, style.y + 3 * dy); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); } function _iconDataZoomReset(ctx, style) { @@ -12006,9 +13481,6 @@ define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/S ctx.moveTo(style.x + 10 * dx, style.y + 10 * dy); ctx.lineTo(style.x + 14 * dx, style.y + 13 * dy); ctx.lineTo(style.x + 10 * dx, style.y + style.height); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); } function _iconRestore(ctx, style) { @@ -12028,9 +13500,6 @@ define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/S ctx.moveTo(style.x + 13 * dx, style.y); ctx.lineTo(style.x + style.width, style.y + 4 * dy); ctx.lineTo(style.x + 11 * dx, style.y + 5 * dy); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); } function _iconLineChart(ctx, style) { @@ -12045,9 +13514,6 @@ define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/S ctx.lineTo(style.x + 7 * dx, style.y + 6 * dy); ctx.lineTo(style.x + 11 * dx, style.y + 11 * dy); ctx.lineTo(style.x + 15 * dx, style.y + 2 * dy); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); } function _iconBarChart(ctx, style) { @@ -12070,9 +13536,6 @@ define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/S ctx.lineTo(style.x + 11 * dx, style.y + 9 * dy); ctx.lineTo(style.x + 12 * dx, style.y + 9 * dy); ctx.lineTo(style.x + 12 * dx, style.y + 14 * dy); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); } function _iconStackChart(ctx, style) { @@ -12085,9 +13548,6 @@ define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/S while (len--) { ctx.rect(x, y + dy * len + 2, width, 2); } - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); } function _iconTiledChart(ctx, style) { @@ -12100,9 +13560,6 @@ define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/S while (len--) { ctx.rect(x + dx * len, y, 2, height); } - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); } function _iconDataView(ctx, style) { @@ -12125,9 +13582,6 @@ define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/S ctx.moveTo(style.x + 3 * dx, style.y + 12 * dx); ctx.lineTo(style.x + 9 * dx, style.y + 12 * dx); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); } function _iconSave(ctx, style) { @@ -12150,9 +13604,6 @@ define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/S ctx.lineTo(style.x + 10 * dx, style.y + 13 * dy); ctx.lineTo(style.x + 10 * dx, style.y + 11 * dy); ctx.lineTo(style.x + 6 * dx, style.y + 11 * dy); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); } function _iconCross(ctx, style) { @@ -12182,10 +13633,12 @@ define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/S 0, Math.PI * 2 ); + ctx.closePath(); } function _iconRectangle(ctx, style) { ctx.rect(style.x, style.y, style.width, style.height); + ctx.closePath(); } function _iconTriangle(ctx, style) { @@ -12198,6 +13651,7 @@ define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/S ctx.lineTo(x + symbolSize, y + symbolSize); ctx.lineTo(x - symbolSize, y + symbolSize); ctx.lineTo(x, y - symbolSize); + ctx.closePath(); } function _iconDiamond(ctx, style) { @@ -12211,6 +13665,7 @@ define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/S ctx.lineTo(x, y + symbolSize); ctx.lineTo(x - symbolSize, y); ctx.lineTo(x, y - symbolSize); + ctx.closePath(); } function _iconArrow(ctx, style) { @@ -12222,6 +13677,7 @@ define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/S ctx.lineTo(x + 8 * dx, y + style.height / 4 * 3); ctx.lineTo(x + 15 * dx, y + style.height); ctx.lineTo(x + 8 * dx, y); + ctx.closePath(); } function _iconStar(ctx, style) { @@ -12270,6 +13726,7 @@ define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/S Math.PI / 5 ); ctx.lineTo(x + width, y + height + r * 1.5); + ctx.closePath(); } function _iconImage(ctx, style) { @@ -12331,6 +13788,7 @@ define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/S ctx.lineTo(style.x + style.width, style.y + style.height); ctx.lineTo(style.x, style.y + style.height); ctx.lineTo(style.x, style.y); + ctx.closePath(); } return; @@ -12394,11 +13852,10 @@ define('echarts/util/shape/Icon',['require','zrender/tool/util','zrender/shape/S * author: Kener (@Kener-林峰, linzhifeng@baidu.com) * errorrik (errorrik@gmail.com) */ - define( 'zrender/shape/util/dashedLineTo',[],function (/* require */) { - var dashPattern = [5, 5]; + var dashPattern = [ 5, 5 ]; /** * 虚线lineTo */ @@ -12427,7 +13884,8 @@ define( for (var i = 0; i < numDashes; ++i) { if (flag) { ctx.moveTo(x1, y1); - } else { + } + else { ctx.lineTo(x1, y1); } flag = !flag; @@ -12440,102 +13898,85 @@ define( ); /** - * zrender - * + * 直线 + * @module zrender/shape/Line * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:直线 - * 可配图形属性: - { - // 基础属性 - shape : 'line', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - xStart : {number}, // 必须,起点横坐标 - yStart : {number}, // 必须,起点纵坐标 - xEnd : {number}, // 必须,终点横坐标 - yEnd : {number}, // 必须,终点纵坐标 - strokeColor : {color}, // 默认为'#000',线条颜色(轮廓),支持rgba - lineType : {string}, // 默认为solid,线条类型,solid | dashed | dotted - lineWidth : {number}, // 默认为1,线条宽度 - lineCap : {string}, // 默认为butt,线帽样式。butt | round | square - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为end,附加文本位置。 - // inside | start | end - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#000' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'line', - id : '123456', - zlevel : 1, - style : { - xStart : 100, - yStart : 100, - xEnd : 200, - yEnd : 200, - strokeColor : '#eee', - lineWidth : 20, - text : 'Baidu' - }, - myName : 'kener', //可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } + * @example + * var Line = require('zrender/shape/Line'); + * var shape = new Line({ + * style: { + * xStart: 0, + * yStart: 0, + * xEnd: 100, + * yEnd: 100, + * strokeColor: '#000', + * lineWidth: 10 + * } + * }); + * zr.addShape(line); + */ +/** + * @typedef {Object} ILineStyle + * @property {number} xStart 起点x坐标 + * @property {number} yStart 起点y坐标 + * @property {number} xEnd 终止点x坐标 + * @property {number} yEnd 终止点y坐标 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic */ define( 'zrender/shape/Line',['require','./Base','./util/dashedLineTo','../tool/util'],function (require) { var Base = require('./Base'); var dashedLineTo = require('./util/dashedLineTo'); - function Line(options) { - this.brushTypeOnly = 'stroke'; //线条只能描边,填充后果自负 + /** + * @alias module:zrender/shape/Line + * @param {Object} options + * @constructor + * @extends module:zrender/shape/Base + */ + var Line = function (options) { + this.brushTypeOnly = 'stroke'; // 线条只能描边,填充后果自负 this.textPosition = 'end'; Base.call(this, options); - } + + /** + * 直线绘制样式 + * @name module:zrender/shape/Line#style + * @type {module:zrender/shape/Line~ILineStyle} + */ + /** + * 直线高亮绘制样式 + * @name module:zrender/shape/Line#highlightStyle + * @type {module:zrender/shape/Line~ILineStyle} + */ + }; Line.prototype = { type: 'line', /** * 创建线条路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Line~ILineStyle} style */ - buildPath : function(ctx, style) { + buildPath : function (ctx, style) { if (!style.lineType || style.lineType == 'solid') { - //默认为实线 + // 默认为实线 ctx.moveTo(style.xStart, style.yStart); ctx.lineTo(style.xEnd, style.yEnd); } @@ -12554,10 +13995,11 @@ define( }, /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style + * 计算返回线条的包围盒矩形 + * @param {module:zrender/shape/Line~ILineStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} */ - getRect : function(style) { + getRect : function (style) { if (style.__rect) { return style.__rect; } @@ -12580,117 +14022,16 @@ define( return Line; } ); -/** - * zrender: 向量操作类 - * - * author : https://github.com/pissang - */ -define( - 'zrender/tool/vector',[],function() { - var ArrayCtor = typeof Float32Array === 'undefined' - ? Array - : Float32Array; - - var vector = { - create : function(x, y) { - var out = new ArrayCtor(2); - out[0] = x || 0; - out[1] = y || 0; - return out; - }, - copy : function(out, v) { - out[0] = v[0]; - out[1] = v[1]; - }, - set : function(out, a, b) { - out[0] = a; - out[1] = b; - }, - add : function(out, v1, v2) { - out[0] = v1[0] + v2[0]; - out[1] = v1[1] + v2[1]; - return out; - }, - scaleAndAdd : function(out, v1, v2, a) { - out[0] = v1[0] + v2[0] * a; - out[1] = v1[1] + v2[1] * a; - return out; - }, - sub : function(out, v1, v2) { - out[0] = v1[0] - v2[0]; - out[1] = v1[1] - v2[1]; - return out; - }, - length : function(v) { - return Math.sqrt(this.lengthSquare(v)); - }, - lengthSquare : function(v) { - return v[0] * v[0] + v[1] * v[1]; - }, - mul : function(out, v1, v2) { - out[0] = v1[0] * v2[0]; - out[1] = v1[1] * v2[1]; - return out; - }, - dot : function(v1, v2) { - return v1[0] * v2[0] + v1[1] * v2[1]; - }, - scale : function(out, v, s) { - out[0] = v[0] * s; - out[1] = v[1] * s; - return out; - }, - normalize : function(out, v) { - var d = vector.length(v); - if(d === 0){ - out[0] = 0; - out[1] = 0; - }else{ - out[0] = v[0]/d; - out[1] = v[1]/d; - } - return out; - }, - distance : function(v1, v2) { - return Math.sqrt( - (v1[0] - v2[0]) * (v1[0] - v2[0]) + - (v1[1] - v2[1]) * (v1[1] - v2[1]) - ); - }, - negate : function(out, v) { - out[0] = -v[0]; - out[1] = -v[1]; - }, - middle : function(out, v1, v2) { - out[0] = (v1[0] + v2[0])/2; - out[1] = (v1[1] + v2[1])/2; - return out; - }, - applyTransform: function(out, v, m) { - var x = v[0]; - var y = v[1]; - out[0] = m[0] * x + m[2] * y + m[4]; - out[1] = m[1] * x + m[3] * y + m[5]; - return out; - } - }; - - vector.len = vector.length; - vector.dist = vector.distance; - return vector; - } -); /** - * 多线段平滑曲线 Catmull-Rom spline - * - * author: Kener (@Kener-林峰, linzhifeng@baidu.com) - * errorrik (errorrik@gmail.com) + * Catmull-Rom spline 插值折线 + * @module zrender/shape/util/smoothSpline + * @author pissang (https://www.github.com/pissang) + * Kener (@Kener-林峰, linzhifeng@baidu.com) + * errorrik (errorrik@gmail.com) */ - - define( - 'zrender/shape/util/smoothSpline',['require','../../tool/vector'],function ( require ) { + 'zrender/shape/util/smoothSpline',['require','../../tool/vector'],function (require) { var vector = require('../../tool/vector'); /** @@ -12700,26 +14041,30 @@ define( var v0 = (p2 - p0) * 0.5; var v1 = (p3 - p1) * 0.5; return (2 * (p1 - p2) + v0 + v1) * t3 - + (- 3 * (p1 - p2) - 2 * v0 - v1) * t2 + + (-3 * (p1 - p2) - 2 * v0 - v1) * t2 + v0 * t + p1; } /** - * 多线段平滑曲线 Catmull-Rom spline + * @alias module:zrender/shape/util/smoothSpline + * @param {Array} points 线段顶点数组 + * @param {boolean} isLoop + * @param {Array} constraint + * @return {Array} */ - return function (points, isLoop) { + return function (points, isLoop, constraint) { var len = points.length; var ret = []; var distance = 0; for (var i = 1; i < len; i++) { - distance += vector.distance(points[i-1], points[i]); + distance += vector.distance(points[i - 1], points[i]); } var segs = distance / 5; segs = segs < len ? len : segs; for (var i = 0; i < segs; i++) { - var pos = i / (segs-1) * (isLoop ? len : len - 1); + var pos = i / (segs - 1) * (isLoop ? len : len - 1); var idx = Math.floor(pos); var w = pos - idx; @@ -12732,8 +14077,9 @@ define( p0 = points[idx === 0 ? idx : idx - 1]; p2 = points[idx > len - 2 ? len - 1 : idx + 1]; p3 = points[idx > len - 3 ? len - 1 : idx + 2]; - } else { - p0 = points[(idx -1 + len) % len]; + } + else { + p0 = points[(idx - 1 + len) % len]; p2 = points[(idx + 1) % len]; p3 = points[(idx + 2) % len]; } @@ -12753,19 +14099,27 @@ define( /** * 贝塞尔平滑曲线 - * - * author: Kener (@Kener-林峰, linzhifeng@baidu.com) - * errorrik (errorrik@gmail.com) + * @module zrender/shape/util/smoothBezier + * @author pissang (https://www.github.com/pissang) + * Kener (@Kener-林峰, linzhifeng@baidu.com) + * errorrik (errorrik@gmail.com) */ - define( - 'zrender/shape/util/smoothBezier',['require','../../tool/vector'],function ( require ) { + 'zrender/shape/util/smoothBezier',['require','../../tool/vector'],function (require) { var vector = require('../../tool/vector'); /** - * 贝塞尔平滑曲线 + * 贝塞尔平滑曲线 + * @alias module:zrender/shape/util/smoothBezier + * @param {Array} points 线段顶点数组 + * @param {number} smooth 平滑等级, 0-1 + * @param {boolean} isLoop + * @param {Array} constraint 将计算出来的控制点约束在一个包围盒内 + * 比如 [[0, 0], [100, 100]], 这个包围盒会与 + * 整个折线的包围盒做一个并集用来约束控制点。 + * @param {Array} 计算出来的控制点数组 */ - return function (points, smooth, isLoop) { + return function (points, smooth, isLoop, constraint) { var cps = []; var v = []; @@ -12774,6 +14128,20 @@ define( var prevPoint; var nextPoint; + var hasConstraint = !!constraint; + var min, max; + if (hasConstraint) { + min = [Infinity, Infinity]; + max = [-Infinity, -Infinity]; + for (var i = 0, len = points.length; i < len; i++) { + vector.min(min, min, points[i]); + vector.max(max, max, points[i]); + } + // 与指定的包围盒做并集 + vector.min(min, min, constraint[0]); + vector.max(max, max, constraint[1]); + } + for (var i = 0, len = points.length; i < len; i++) { var point = points[i]; var prevPoint; @@ -12796,20 +14164,29 @@ define( vector.sub(v, nextPoint, prevPoint); - //use degree to scale the handle length + // use degree to scale the handle length vector.scale(v, v, smooth); var d0 = vector.distance(point, prevPoint); var d1 = vector.distance(point, nextPoint); var sum = d0 + d1; - d0 /= sum; - d1 /= sum; + if (sum !== 0) { + d0 /= sum; + d1 /= sum; + } vector.scale(v1, v, -d0); vector.scale(v2, v, d1); - - cps.push(vector.add([], point, v1)); - cps.push(vector.add([], point, v2)); + var cp0 = vector.add([], point, v1); + var cp1 = vector.add([], point, v2); + if (hasConstraint) { + vector.max(cp0, cp0, min); + vector.min(cp0, cp0, max); + vector.max(cp1, cp1, min); + vector.min(cp1, cp1, max); + } + cps.push(cp0); + cps.push(cp1); } if (isLoop) { @@ -12822,73 +14199,44 @@ define( ); /** - * zrender - * + * 多边形 + * @module zrender/shape/Polygon * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:多边形 - * 可配图形属性: - { - // 基础属性 - shape : 'polygon', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - pointList : {Array}, // 必须,多边形各个顶角坐标 - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为top,附加文本位置。 - // inside | left | right | top | bottom - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'polygon', - id : '123456', - zlevel : 1, - style : { - pointList : [[10, 10], [300, 20], [298, 400], [50, 450]] - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 + * @example + * var Polygon = require('zrender/shape/Polygon'); + * var shape = new Polygon({ + * style: { + * // 100x100的正方形 + * pointList: [[0, 0], [100, 0], [100, 100], [0, 100]], + * color: 'blue' + * } + * }); + * zr.addShape(shape); + */ - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } +/** + * @typedef {Object} IPolygonStyle + * @property {string} pointList 多边形顶点数组 + * @property {string} [smooth=''] 是否做平滑插值, 平滑算法可以选择 bezier, spline + * @property {number} [smoothConstraint] 平滑约束 + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic */ define( 'zrender/shape/Polygon',['require','./Base','./util/smoothSpline','./util/smoothBezier','./util/dashedLineTo','../tool/util'],function (require) { @@ -12897,21 +14245,29 @@ define( var smoothBezier = require('./util/smoothBezier'); var dashedLineTo = require('./util/dashedLineTo'); - - function Polygon(options) { + /** + * @alias module:zrender/shape/Polygon + * @param {Object} options + * @constructor + * @extends module:zrender/shape/Base + */ + var Polygon = function (options) { Base.call(this, options); - } + /** + * 多边形绘制样式 + * @name module:zrender/shape/Polygon#style + * @type {module:zrender/shape/Polygon~IPolygonStyle} + */ + /** + * 多边形高亮绘制样式 + * @name module:zrender/shape/Polygon#highlightStyle + * @type {module:zrender/shape/Polygon~IPolygonStyle} + */ + }; Polygon.prototype = { type: 'polygon', - /** - * 画刷 - * @param ctx 画布句柄 - * @param isHighlight 是否为高亮状态 - * @param updateCallback 需要异步加载资源的shape可以通过这个callback(e) - * 让painter更新视图,base.brush没用,需要的话重载brush - */ brush : function (ctx, isHighlight) { var style = this.style; if (isHighlight) { @@ -12963,7 +14319,6 @@ define( if (!hasPath) { ctx.beginPath(); this.buildPath(ctx, style); - ctx.closePath(); } ctx.stroke(); } @@ -12977,10 +14332,10 @@ define( /** * 创建多边形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Polygon~IPolygonStyle} style */ - buildPath : function(ctx, style) { + buildPath : function (ctx, style) { // 虽然能重用brokenLine,但底层图形基于性能考虑,重复代码减少调用吧 var pointList = style.pointList; // 开始点和结束点重复 @@ -13004,7 +14359,7 @@ define( if (style.smooth && style.smooth !== 'spline') { var controlPoints = smoothBezier( - pointList, style.smooth, true + pointList, style.smooth, true, style.smoothConstraint ); ctx.moveTo(pointList[0][0], pointList[0][1]); @@ -13027,10 +14382,10 @@ define( } if (!style.lineType || style.lineType == 'solid') { - //默认为实线 - ctx.moveTo(pointList[0][0],pointList[0][1]); + // 默认为实线 + ctx.moveTo(pointList[0][0], pointList[0][1]); for (var i = 1, l = pointList.length; i < l; i++) { - ctx.lineTo(pointList[i][0],pointList[i][1]); + ctx.lineTo(pointList[i][0], pointList[i][1]); } ctx.lineTo(pointList[0][0], pointList[0][1]); } @@ -13042,7 +14397,7 @@ define( || (style.lineWidth || 1) * (style.lineType == 'dashed' ? 5 : 1); style._dashLength = dashLength; - ctx.moveTo(pointList[0][0],pointList[0][1]); + ctx.moveTo(pointList[0][0], pointList[0][1]); for (var i = 1, l = pointList.length; i < l; i++) { dashedLineTo( ctx, @@ -13065,10 +14420,11 @@ define( }, /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style + * 计算返回多边形包围盒矩阵 + * @param {module:zrender/shape/Polygon~IPolygonStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} */ - getRect : function(style) { + getRect : function (style) { if (style.__rect) { return style.__rect; } @@ -13079,7 +14435,7 @@ define( var maxY = Number.MIN_VALUE; var pointList = style.pointList; - for(var i = 0, l = pointList.length; i < l; i++) { + for (var i = 0, l = pointList.length; i < l; i++) { if (pointList[i][0] < minX) { minX = pointList[i][0]; } @@ -13116,77 +14472,46 @@ define( return Polygon; } ); -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:折线 - * 可配图形属性: - { - // 基础属性 - shape : 'brokenLine', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - // 样式属性,默认状态样式样式属性 - style : { - pointList : {Array}, // 必须,各个顶角坐标 - smooth : {Number}, // 默认为0 - strokeColor : {color}, // 默认为'#000',线条颜色(轮廓),支持rgba - lineType : {string}, // 默认为solid,线条类型,solid | dashed | dotted - lineWidth : {number}, // 默认为1,线条宽度 - lineCap : {string}, // 默认为butt,线帽样式。butt | round | square - lineJoin : {string}, // 默认为miter,线段连接样式。miter | round | bevel - miterLimit : {number}, // 默认为10,最大斜接长度,仅当lineJoin为miter时生效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为end,附加文本位置。 - // start | end - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#000' : color - }, - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'brokenLine', - id : '123456', - zlevel : 1, - style : { - pointList : [[10, 10], [300, 20], [298, 400], [50, 450]], - strokeColor : '#eee', - lineWidth : 20, - text : 'Baidu' - }, - myName : 'kener', //可自带任何有效自定义属性 +/** + * 折线 + * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @module zrender/shape/BrokenLine + * @example + * var BrokenLine = require('zrender/shape/BrokenLine'); + * var shape = new BrokenLine({ + * style: { + * pointList: [[0, 0], [100, 100], [100, 0]], + * smooth: 'bezier', + * strokeColor: 'purple' + * } + * }); + * zr.addShape(shape); + */ - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } +/** + * @typedef {Object} IBrokenLineStyle + * @property {Array.} pointList 顶点坐标数组 + * @property {string} [smooth=''] 是否做平滑插值, 平滑算法可以选择 bezier, spline + * @property {number} [smoothConstraint] 平滑约束 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {string} [lineJoin='miter'] 线段连接样式,可以是 miter, round, bevel + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic */ define( 'zrender/shape/BrokenLine',['require','./Base','./util/smoothSpline','./util/smoothBezier','./util/dashedLineTo','./Polygon','../tool/util'],function (require) { @@ -13195,19 +14520,35 @@ define( var smoothBezier = require('./util/smoothBezier'); var dashedLineTo = require('./util/dashedLineTo'); - function BrokenLine( options ) { - this.brushTypeOnly = 'stroke'; //线条只能描边,填充后果自负 + /** + * @alias module:zrender/shape/BrokenLine + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var BrokenLine = function(options) { + this.brushTypeOnly = 'stroke'; // 线条只能描边,填充后果自负 this.textPosition = 'end'; Base.call(this, options); - } + /** + * 贝赛尔曲线绘制样式 + * @name module:zrender/shape/BrokenLine#style + * @type {module:zrender/shape/BrokenLine~IBrokenLineStyle} + */ + /** + * 贝赛尔曲线高亮绘制样式 + * @name module:zrender/shape/BrokenLine#highlightStyle + * @type {module:zrender/shape/BrokenLine~IBrokenLineStyle} + */ + }; BrokenLine.prototype = { type: 'broken-line', /** * 创建多边形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/BrokenLine~IBrokenLineStyle} style */ buildPath : function(ctx, style) { var pointList = style.pointList; @@ -13223,7 +14564,7 @@ define( if (style.smooth && style.smooth !== 'spline') { var controlPoints = smoothBezier( - pointList, style.smooth + pointList, style.smooth, false, style.smoothConstraint ); ctx.moveTo(pointList[0][0], pointList[0][1]); @@ -13245,10 +14586,10 @@ define( len = pointList.length; } if (!style.lineType || style.lineType == 'solid') { - //默认为实线 - ctx.moveTo(pointList[0][0],pointList[0][1]); + // 默认为实线 + ctx.moveTo(pointList[0][0], pointList[0][1]); for (var i = 1; i < len; i++) { - ctx.lineTo(pointList[i][0],pointList[i][1]); + ctx.lineTo(pointList[i][0], pointList[i][1]); } } else if (style.lineType == 'dashed' @@ -13256,7 +14597,7 @@ define( ) { var dashLength = (style.lineWidth || 1) * (style.lineType == 'dashed' ? 5 : 1); - ctx.moveTo(pointList[0][0],pointList[0][1]); + ctx.moveTo(pointList[0][0], pointList[0][1]); for (var i = 1; i < len; i++) { dashedLineTo( ctx, @@ -13271,8 +14612,9 @@ define( }, /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style + * 计算返回折线包围盒矩形。 + * @param {IZRenderBezierCurveStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} */ getRect : function(style) { return require('./Polygon').prototype.getRect(style); @@ -13337,9 +14679,11 @@ define('echarts/util/shape/MarkLine',['require','zrender/shape/Base','./Icon','z // 设置transform this.setTransform(ctx); + ctx.save(); ctx.beginPath(); this.buildLinePath(ctx, style); ctx.stroke(); + ctx.restore(); this.brushSymbol(ctx, style, 0); this.brushSymbol(ctx, style, 1); @@ -14529,92 +15873,82 @@ define('echarts/util/ecAnimation',['require','zrender/tool/util','zrender/shape/ }); /** - * zrender - * + * 圆形 + * @module zrender/shape/Circle * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:圆 - * 可配图形属性: - { - // 基础属性 - shape : 'circle', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,圆心横坐标 - y : {number}, // 必须,圆心纵坐标 - r : {number}, // 必须,圆半径 - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为top,附加文本位置。 - // inside | left | right | top | bottom - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'circle', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - r : 50, - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 + * @example + * var Circle = require('zrender/shape/Circle'); + * var shape = new Circle({ + * style: { + * x: 100, + * y: 100, + * r: 40, + * brushType: 'both', + * color: 'blue', + * strokeColor: 'red', + * lineWidth: 3, + * text: 'Circle' + * } + * }); + * zr.addShape(shape); + */ - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } +/** + * @typedef {Object} ICircleStyle + * @property {number} x 圆心x坐标 + * @property {number} y 圆心y坐标 + * @property {number} r 半径 + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic */ define( 'zrender/shape/Circle',['require','./Base','../tool/util'],function (require) { + + var Base = require('./Base'); - function Circle(options) { + /** + * @alias module:zrender/shape/Circle + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ + var Circle = function(options) { Base.call(this, options); - } + /** + * 圆形绘制样式 + * @name module:zrender/shape/Circle#style + * @type {module:zrender/shape/Circle~ICircleStyle} + */ + /** + * 圆形高亮绘制样式 + * @name module:zrender/shape/Circle#highlightStyle + * @type {module:zrender/shape/Circle~ICircleStyle} + */ + }; Circle.prototype = { type: 'circle', /** * 创建圆形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Circle~ICircleStyle} style */ buildPath : function (ctx, style) { ctx.arc(style.x, style.y, style.r, 0, Math.PI * 2, true); @@ -14622,8 +15956,9 @@ define( }, /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style + * 计算返回圆形的包围盒矩形 + * @param {module:zrender/shape/Circle~ICircleStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} */ getRect : function (style) { if (style.__rect) { @@ -14652,6 +15987,7 @@ define( return Circle; } ); + /** * echarts图表特效基类 * @@ -14932,8 +16268,20 @@ define('echarts/util/accMath',[],function() { // 说明:javascript的除法结果会有误差,在两个浮点数相除的时候会比较明显。这个函数返回较为精确的除法结果。 // 调用:accDiv(arg1,arg2) // 返回值:arg1除以arg2的精确结果 - function accDiv(arg1, arg2) { - return accMul(arg1, 1 / arg2); + function accDiv(arg1,arg2){ + var s1 = arg1.toString(); + var s2 = arg2.toString(); + var m = 0; + try { + m = s2.split('.')[1].length; + } + catch(e) {} + try { + m -= s1.split('.')[1].length; + } + catch(e) {} + + return (s1.replace('.', '') - 0) / (s2.replace('.', '') - 0) * Math.pow(10, m); } // 乘法函数,用来得到精确的乘法结果 @@ -14941,18 +16289,17 @@ define('echarts/util/accMath',[],function() { // 调用:accMul(arg1,arg2) // 返回值:arg1乘以arg2的精确结果 function accMul(arg1, arg2) { - var m = 0; var s1 = arg1.toString(); - var s2 = arg2.toString(); + var s2 = arg2.toString(); + var m = 0; try { m += s1.split('.')[1].length; } catch(e) {} - try { m += s2.split('.')[1].length; } - catch(e){} + catch(e) {} return (s1.replace('.', '') - 0) * (s2.replace('.', '') - 0) / Math.pow(10, m); } @@ -14964,12 +16311,10 @@ define('echarts/util/accMath',[],function() { function accAdd(arg1, arg2) { var r1 = 0; var r2 = 0; - try { r1 = arg1.toString().split('.')[1].length; } catch(e) {} - try { r2 = arg2.toString().split('.')[1].length; } @@ -15021,11 +16366,11 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon this.selectedMap = {}; this.lastShapeList = []; this.shapeHandler = { - onclick : function () { + onclick: function () { self.isClick = true; }, - ondragover : function (param) { + ondragover: function (param) { // 返回触发可计算特性的图形提示 var calculableShape = param.target; calculableShape.highlightStyle = calculableShape.highlightStyle || {}; @@ -15038,7 +16383,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon highlightStyle.brushType = 'stroke'; highlightStyle.strokeColor = self.ecTheme.calculableColor; - highlightStyle.lineWidth = calculableShape.type == 'icon' ? 30 : 10; + highlightStyle.lineWidth = calculableShape.type === 'icon' ? 30 : 10; self.zr.addHoverShape(calculableShape); @@ -15052,14 +16397,14 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon },20); }, - ondrop : function (param) { + ondrop: function (param) { // 排除一些非数据的拖拽进入 - if (typeof ecData.get(param.dragged, 'data') != 'undefined') { + if (ecData.get(param.dragged, 'data') != null) { self.isDrop = true; } }, - ondragend : function () { + ondragend: function () { self.isDragend = true; } }; @@ -15072,7 +16417,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon /** * 图形拖拽特性 */ - setCalculable : function (shape) { + setCalculable: function (shape) { shape.dragEnableTime = this.ecTheme.DRAG_ENABLE_TIME; shape.ondragover = this.shapeHandler.ondragover; shape.ondragend = this.shapeHandler.ondragend; @@ -15083,7 +16428,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon /** * 数据项被拖拽进来 */ - ondrop : function (param, status) { + ondrop: function (param, status) { if (!this.isDrop || !param.target) { // 没有在当前实例上发生拖拽行为则直接返回 return; @@ -15097,22 +16442,22 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon var series = this.series; var data; var legend = this.component.legend; - if (dataIndex == -1) { + if (dataIndex === -1) { // 落到calculableCase上,数据被拖拽进某个饼图|雷达|漏斗,增加数据 data = { - value : ecData.get(dragged, 'value'), - name : ecData.get(dragged, 'name') + value: ecData.get(dragged, 'value'), + name: ecData.get(dragged, 'name') }; // 修饼图数值不为负值 - if (this.type == ecConfig.CHART_TYPE_PIE && data.value < 0) { + if (this.type === ecConfig.CHART_TYPE_PIE && data.value < 0) { data.value = 0; } var hasFind = false; var sData = series[seriesIndex].data; for (var i = 0, l = sData.length; i < l; i++) { - if (sData[i].name == data.name && sData[i].value == '-') { + if (sData[i].name === data.name && sData[i].value === '-') { series[seriesIndex].data[i].value = data.value; hasFind = true; } @@ -15127,7 +16472,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon else { // 落到数据item上,数据被拖拽到某个数据项上,数据修改 data = this.option.series[seriesIndex].data[dataIndex] || '-'; - if (typeof data.value != 'undefined') { + if (data.value != null) { if (data.value != '-') { this.option.series[seriesIndex].data[dataIndex].value = accMath.accAdd( @@ -15140,10 +16485,10 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon ecData.get(dragged, 'value'); } - if (this.type == ecConfig.CHART_TYPE_FUNNEL - || this.type == ecConfig.CHART_TYPE_PIE + if (this.type === ecConfig.CHART_TYPE_FUNNEL + || this.type === ecConfig.CHART_TYPE_PIE ) { - legend && legend.getRelatedAmount(data.name) == 1 + legend && legend.getRelatedAmount(data.name) === 1 && this.component.legend.del(data.name); data.name += this.option.nameConnector + ecData.get(dragged, 'name'); legend && legend.add( @@ -15184,7 +16529,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon /** * 数据项被拖拽出去 */ - ondragend : function (param, status) { + ondragend: function (param, status) { if (!this.isDragend || !param.target) { // 没有在当前实例上发生拖拽行为则直接返回 return; @@ -15197,7 +16542,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon var series = this.series; // 删除被拖拽走的数据 - if (typeof series[seriesIndex].data[dataIndex].value != 'undefined') { + if (series[seriesIndex].data[dataIndex].value != null) { series[seriesIndex].data[dataIndex].value = '-'; // 清理可能有且唯一的legend data var name = series[seriesIndex].data[dataIndex].name; @@ -15224,7 +16569,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon /** * 图例选择 */ - onlegendSelected : function (param, status) { + onlegendSelected: function (param, status) { var legendSelected = param.selected; for (var itemName in this.selectedMap) { if (this.selectedMap[itemName] != legendSelected[itemName]) { @@ -15239,7 +16584,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon /** * 添加文本 */ - addLabel : function (tarShape, serie, data, name, orient) { + addLabel: function (tarShape, serie, data, name, orient) { // 多级控制 var queryTarget = [data, serie]; var nLabel = this.deepMerge(queryTarget, 'itemStyle.normal.label'); @@ -15252,8 +16597,8 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon tarShape.style.text = this._getLabelText( serie, data, name, 'normal' ); - tarShape.style.textPosition = typeof nLabel.position == 'undefined' - ? (orient == 'horizontal' ? 'right' : 'top') + tarShape.style.textPosition = nLabel.position == null + ? (orient === 'horizontal' ? 'right' : 'top') : nLabel.position; tarShape.style.textColor = nTextStyle.color; tarShape.style.textFont = this.getFont(nTextStyle); @@ -15264,8 +16609,8 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon ); tarShape.highlightStyle.textPosition = nLabel.show ? tarShape.style.textPosition - : (typeof eLabel.position == 'undefined' - ? (orient == 'horizontal' ? 'right' : 'top') + : (eLabel.position == null + ? (orient === 'horizontal' ? 'right' : 'top') : eLabel.position); tarShape.highlightStyle.textColor = eTextStyle.color; tarShape.highlightStyle.textFont = this.getFont(eTextStyle); @@ -15277,12 +16622,12 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon /** * 根据lable.format计算label text */ - _getLabelText : function (serie, data, name, status) { + _getLabelText: function (serie, data, name, status) { var formatter = this.deepQuery( [data, serie], 'itemStyle.' + status + '.label.formatter' ); - if (!formatter && status == 'emphasis') { + if (!formatter && status === 'emphasis') { // emphasis时需要看看normal下是否有formatter formatter = this.deepQuery( [data, serie], @@ -15290,14 +16635,14 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon ); } - var value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' + var value = data != null + ? (data.value != null ? data.value : data) : '-'; if (formatter) { - if (typeof formatter == 'function') { + if (typeof formatter === 'function') { return formatter.call( this.myChart, serie.name, @@ -15305,7 +16650,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon value ); } - else if (typeof formatter == 'string') { + else if (typeof formatter === 'string') { formatter = formatter.replace('{a}','{a0}') .replace('{b}','{b0}') .replace('{c}','{c0}'); @@ -15324,7 +16669,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon /** * 标线标注 */ - buildMark : function (seriesIndex) { + buildMark: function (seriesIndex) { var serie = this.series[seriesIndex]; if (this.selectedMap[serie.name]) { serie.markPoint && this._buildMarkPoint(seriesIndex); @@ -15335,7 +16680,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon /** * 标注逻辑 */ - _buildMarkPoint : function (seriesIndex) { + _buildMarkPoint: function (seriesIndex) { var attachStyle = (this.markAttachStyle || {})[seriesIndex]; var serie = this.series[seriesIndex]; var _zlevelBase = this.getZlevelBase(); @@ -15345,12 +16690,10 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon for (var i = 0, l = markPoint.data.length; i < l; i++) { mpData = markPoint.data[i]; pos = this.getMarkCoord(seriesIndex, mpData); - markPoint.data[i].x = typeof mpData.x != 'undefined' - ? mpData.x : pos[0]; - markPoint.data[i].y = typeof mpData.y != 'undefined' - ? mpData.y : pos[1]; + markPoint.data[i].x = mpData.x != null ? mpData.x : pos[0]; + markPoint.data[i].y = mpData.y != null ? mpData.y : pos[1]; if (mpData.type - && (mpData.type == 'max' || mpData.type == 'min') + && (mpData.type === 'max' || mpData.type === 'min') ) { // 特殊值内置支持 markPoint.data[i].value = pos[3]; @@ -15370,8 +16713,8 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon this.shapeList.push(shapeList[i]); } // 个别特殊图表需要自己addShape - if (this.type == ecConfig.CHART_TYPE_FORCE - || this.type == ecConfig.CHART_TYPE_CHORD + if (this.type === ecConfig.CHART_TYPE_FORCE + || this.type === ecConfig.CHART_TYPE_CHORD ) { for (var i = 0, l = shapeList.length; i < l; i++) { this.zr.addShape(shapeList[i]); @@ -15382,7 +16725,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon /** * 标线逻辑 */ - _buildMarkLine : function (seriesIndex) { + _buildMarkLine: function (seriesIndex) { var attachStyle = (this.markAttachStyle || {})[seriesIndex]; var serie = this.series[seriesIndex]; var _zlevelBase = this.getZlevelBase(); @@ -15392,7 +16735,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon for (var i = 0, l = markLine.data.length; i < l; i++) { mlData = markLine.data[i]; if (mlData.type - && (mlData.type == 'max' || mlData.type == 'min' || mlData.type == 'average') + && (mlData.type === 'max' || mlData.type === 'min' || mlData.type === 'average') ) { // 特殊值内置支持 pos = this.getMarkCoord(seriesIndex, mlData); @@ -15409,14 +16752,10 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon ]; } - markLine.data[i][0].x = typeof mlData[0].x != 'undefined' - ? mlData[0].x : pos[0][0]; - markLine.data[i][0].y = typeof mlData[0].y != 'undefined' - ? mlData[0].y : pos[0][1]; - markLine.data[i][1].x = typeof mlData[1].x != 'undefined' - ? mlData[1].x : pos[1][0]; - markLine.data[i][1].y = typeof mlData[1].y != 'undefined' - ? mlData[1].y : pos[1][1]; + markLine.data[i][0].x = mlData[0].x != null ? mlData[0].x : pos[0][0]; + markLine.data[i][0].y = mlData[0].y != null ? mlData[0].y : pos[0][1]; + markLine.data[i][1].x = mlData[1].x != null ? mlData[1].x : pos[1][0]; + markLine.data[i][1].y = mlData[1].y != null ? mlData[1].y : pos[1][1]; } var shapeList = this._markLine(seriesIndex, markLine); @@ -15429,8 +16768,8 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon this.shapeList.push(shapeList[i]); } // 个别特殊图表需要自己addShape - if (this.type == ecConfig.CHART_TYPE_FORCE - || this.type == ecConfig.CHART_TYPE_CHORD + if (this.type === ecConfig.CHART_TYPE_FORCE + || this.type === ecConfig.CHART_TYPE_CHORD ) { for (var i = 0, l = shapeList.length; i < l; i++) { this.zr.addShape(shapeList[i]); @@ -15441,7 +16780,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon /** * 标注多级控制构造 */ - _markPoint : function (seriesIndex, mpOption) { + _markPoint: function (seriesIndex, mpOption) { var serie = this.series[seriesIndex]; var component = this.component; zrUtil.merge( @@ -15467,7 +16806,10 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon if (!mpOption.large) { for (var i = 0, l = data.length; i < l; i++) { - value = typeof data[i] != 'undefined' && typeof data[i].value != 'undefined' + if (data[i].x == null || data[i].y == null) { + continue; + } + value = data[i] != null && data[i].value != null ? data[i].value : ''; // 图例 @@ -15494,8 +16836,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon // 标准化一些参数 data[i].tooltip = data[i].tooltip || {trigger:'item'}; // tooltip.trigger指定为item - data[i].name = typeof data[i].name != 'undefined' - ? data[i].name : ''; + data[i].name = data[i].name != null ? data[i].name : ''; data[i].value = value; // 复用getSymbolShape @@ -15518,7 +16859,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon itemShape.effect = effect; } - if (serie.type == ecConfig.CHART_TYPE_MAP) { + if (serie.type === ecConfig.CHART_TYPE_MAP) { itemShape._geo = this.getMarkGeo(data[i]); } @@ -15545,7 +16886,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon /** * 标线多级控制构造 */ - _markLine : function (seriesIndex, mlOption) { + _markLine: function (seriesIndex, mlOption) { var serie = this.series[seriesIndex]; var component = this.component; zrUtil.merge( @@ -15587,13 +16928,21 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon var zrHeight = this.zr.getHeight(); var mergeData; for (var i = 0, l = data.length; i < l; i++) { + if (data[i][0].x == null + || data[i][0].y == null + || data[i][1].x == null + || data[i][1].y == null + ) { + continue; + } + // 图例 if (legend) { color = legend.getColor(serie.name); } // 组装一个mergeData mergeData = this.deepMerge(data[i]); - value = typeof mergeData != 'undefined' && typeof mergeData.value != 'undefined' + value = mergeData != null && mergeData.value != null ? mergeData.value : ''; // 值域 @@ -15616,12 +16965,9 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon // 标准化一些参数 data[i][0].tooltip = mergeData.tooltip || {trigger:'item'}; // tooltip.trigger指定为item - data[i][0].name = typeof data[i][0].name != 'undefined' - ? data[i][0].name : ''; - data[i][1].name = typeof data[i][1].name != 'undefined' - ? data[i][1].name : ''; - data[i][0].value = typeof data[i][0].value != 'undefined' - ? data[i][0].value : ''; + data[i][0].name = data[i][0].name != null ? data[i][0].name : ''; + data[i][1].name = data[i][1].name != null ? data[i][1].name : ''; + data[i][0].value = data[i][0].value != null ? data[i][0].value : ''; itemShape = this.getLineMarkShape( mlOption, // markLine @@ -15644,7 +16990,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon itemShape.effect = effect; } - if (serie.type == ecConfig.CHART_TYPE_MAP) { + if (serie.type === ecConfig.CHART_TYPE_MAP) { itemShape._geo = [ this.getMarkGeo(data[i][0]), this.getMarkGeo(data[i][1]) @@ -15656,7 +17002,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon itemShape, serie, seriesIndex, data[i][0], i, - data[i][0].name + (data[i][1].name !== '' + data[i][0].name + (data[i][1].name !== '' // 不要帮我代码规范 ? (' > ' + data[i][1].name) : ''), value @@ -15667,7 +17013,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon return pList; }, - getMarkCoord : function () { + getMarkCoord: function () { // 无转换位置 return [0, 0]; }, @@ -15675,7 +17021,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon /** * symbol构造器 */ - getSymbolShape : function ( + getSymbolShape: function ( serie, seriesIndex, // 系列 data, dataIndex, name, // 数据 x, y, // 坐标 @@ -15684,15 +17030,15 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon orient // 走向,用于默认文字定位 ) { var queryTarget = [data, serie]; - var value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' + var value = data != null + ? (data.value != null ? data.value : data) : '-'; symbol = this.deepQuery(queryTarget, 'symbol') || symbol; var symbolSize = this.deepQuery(queryTarget, 'symbolSize'); - symbolSize = typeof symbolSize == 'function' + symbolSize = typeof symbolSize === 'function' ? symbolSize(value) : symbolSize; var symbolRotate = this.deepQuery(queryTarget, 'symbolRotate'); @@ -15705,60 +17051,60 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon queryTarget, 'itemStyle.emphasis' ); - var nBorderWidth = typeof normal.borderWidth != 'undefined' + var nBorderWidth = normal.borderWidth != null ? normal.borderWidth : (normal.lineStyle && normal.lineStyle.width); - if (typeof nBorderWidth == 'undefined') { + if (nBorderWidth == null) { nBorderWidth = symbol.match('empty') ? 2 : 0; } - var eBorderWidth = typeof emphasis.borderWidth != 'undefined' + var eBorderWidth = emphasis.borderWidth != null ? emphasis.borderWidth : (emphasis.lineStyle && emphasis.lineStyle.width); - if (typeof eBorderWidth == 'undefined') { + if (eBorderWidth == null) { eBorderWidth = nBorderWidth + 2; } var itemShape = new IconShape({ - style : { - iconType : symbol.replace('empty', '').toLowerCase(), - x : x - symbolSize, - y : y - symbolSize, - width : symbolSize * 2, - height : symbolSize * 2, - brushType : 'both', - color : symbol.match('empty') + style: { + iconType: symbol.replace('empty', '').toLowerCase(), + x: x - symbolSize, + y: y - symbolSize, + width: symbolSize * 2, + height: symbolSize * 2, + brushType: 'both', + color: symbol.match('empty') ? emptyColor : (this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) || color), - strokeColor : normal.borderColor + strokeColor: normal.borderColor || this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) || color, lineWidth: nBorderWidth }, - highlightStyle : { - color : symbol.match('empty') + highlightStyle: { + color: symbol.match('empty') ? emptyColor : this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data), - strokeColor : emphasis.borderColor + strokeColor: emphasis.borderColor || normal.borderColor || this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) || color, lineWidth: eBorderWidth }, - clickable : true + clickable: this.deepQuery(queryTarget, 'clickable') }); if (symbol.match('image')) { itemShape.style.image = symbol.replace(new RegExp('^image:\\/\\/'), ''); itemShape = new ImageShape({ - style : itemShape.style, - highlightStyle : itemShape.highlightStyle, - clickable : true + style: itemShape.style, + highlightStyle: itemShape.highlightStyle, + clickable: this.deepQuery(queryTarget, 'clickable') }); } - if (typeof symbolRotate != 'undefined') { + if (symbolRotate != null) { itemShape.rotation = [ symbolRotate * Math.PI / 180, x, y ]; @@ -15770,7 +17116,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon (symbol.replace('empty', '').replace('star','') - 0) || 5; } - if (symbol == 'none') { + if (symbol === 'none') { itemShape.invisible = true; itemShape.hoverable = false; } @@ -15789,10 +17135,10 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon ); if (symbol.match('empty')) { - if (typeof itemShape.style.textColor == 'undefined') { + if (itemShape.style.textColor == null) { itemShape.style.textColor = itemShape.style.strokeColor; } - if (typeof itemShape.highlightStyle.textColor == 'undefined') { + if (itemShape.highlightStyle.textColor == null) { itemShape.highlightStyle.textColor = itemShape.highlightStyle.strokeColor; } @@ -15817,7 +17163,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon /** * 标线构造器 */ - getLineMarkShape : function ( + getLineMarkShape: function ( mlOption, // 系列 seriesIndex, // 系列索引 data, // 数据 @@ -15826,13 +17172,13 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon xEnd, yEnd, // 坐标 color // 默认color,来自legend或dataRange全局分配 ) { - var value0 = typeof data[0] != 'undefined' - ? (typeof data[0].value != 'undefined' + var value0 = data[0] != null + ? (data[0].value != null ? data[0].value : data[0]) : '-'; - var value1 = typeof data[1] != 'undefined' - ? (typeof data[1].value != 'undefined' + var value1 = data[1] != null + ? (data[1].value != null ? data[1].value : data[1]) : '-'; @@ -15844,10 +17190,10 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon this.query(data[0], 'symbolSize') || mlOption.symbolSize[0], this.query(data[1], 'symbolSize') || mlOption.symbolSize[1] ]; - symbolSize[0] = typeof symbolSize[0] == 'function' + symbolSize[0] = typeof symbolSize[0] === 'function' ? symbolSize[0](value0) : symbolSize[0]; - symbolSize[1] = typeof symbolSize[1] == 'function' + symbolSize[1] = typeof symbolSize[1] === 'function' ? symbolSize[1](value1) : symbolSize[1]; var symbolRotate = [ @@ -15872,75 +17218,72 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon var elineStyle = emphasis.lineStyle; var nBorderWidth = nlineStyle.width; - if (typeof nBorderWidth == 'undefined') { + if (nBorderWidth == null) { nBorderWidth = normal.borderWidth; } var eBorderWidth = elineStyle.width; - if (typeof eBorderWidth == 'undefined') { - if (typeof emphasis.borderWidth != 'undefined') { - eBorderWidth = emphasis.borderWidth; - } - else { - eBorderWidth = nBorderWidth + 2; - } + if (eBorderWidth == null) { + eBorderWidth = emphasis.borderWidth != null + ? emphasis.borderWidth + : (nBorderWidth + 2); } var itemShape = new MarkLineShape({ - style : { - smooth : mlOption.smooth ? 'spline' : false, - symbol : symbol, - symbolSize : symbolSize, - symbolRotate : symbolRotate, - //data : [data[0].name,data[1].name], - xStart : xStart, - yStart : yStart, // 坐标 - xEnd : xEnd, - yEnd : yEnd, // 坐标 - brushType : 'both', - lineType : nlineStyle.type, - shadowColor : nlineStyle.shadowColor - || nlineStyle.color - || normal.borderColor - || normal.color - || color, + style: { + smooth: mlOption.smooth ? 'spline' : false, + symbol: symbol, + symbolSize: symbolSize, + symbolRotate: symbolRotate, + // data: [data[0].name,data[1].name], + xStart: xStart, + yStart: yStart, // 坐标 + xEnd: xEnd, + yEnd: yEnd, // 坐标 + brushType: 'both', + lineType: nlineStyle.type, + shadowColor: nlineStyle.shadowColor + || nlineStyle.color + || normal.borderColor + || normal.color + || color, shadowBlur: nlineStyle.shadowBlur, shadowOffsetX: nlineStyle.shadowOffsetX, shadowOffsetY: nlineStyle.shadowOffsetY, - color : normal.color || color, - strokeColor : nlineStyle.color - || normal.borderColor - || normal.color - || color, + color: normal.color || color, + strokeColor: nlineStyle.color + || normal.borderColor + || normal.color + || color, lineWidth: nBorderWidth, symbolBorderColor: normal.borderColor || normal.color || color, symbolBorder: normal.borderWidth }, - highlightStyle : { - shadowColor : elineStyle.shadowColor, + highlightStyle: { + shadowColor: elineStyle.shadowColor, shadowBlur: elineStyle.shadowBlur, shadowOffsetX: elineStyle.shadowOffsetX, shadowOffsetY: elineStyle.shadowOffsetY, - color : emphasis.color|| normal.color || color, - strokeColor : elineStyle.color - || nlineStyle.color - || emphasis.borderColor - || normal.borderColor - || emphasis.color - || normal.color - || color, + color: emphasis.color|| normal.color || color, + strokeColor: elineStyle.color + || nlineStyle.color + || emphasis.borderColor + || normal.borderColor + || emphasis.color + || normal.color + || color, lineWidth: eBorderWidth, symbolBorderColor: emphasis.borderColor || normal.borderColor || emphasis.color || normal.color || color, - symbolBorder: typeof emphasis.borderWidth == 'undefined' + symbolBorder: emphasis.borderWidth == null ? (normal.borderWidth + 2) : (emphasis.borderWidth) }, - clickable : true + clickable: this.deepQuery(queryTarget, 'clickable') }); itemShape = this.addLabel( @@ -15959,7 +17302,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon /** * 大规模标注构造器 */ - getLargeMarkPoingShape : function(seriesIndex, mpOption) { + getLargeMarkPoingShape: function(seriesIndex, mpOption) { var serie = this.series[seriesIndex]; var component = this.component; var data = mpOption.data; @@ -15980,8 +17323,8 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon } // 值域 if (dataRange) { - value = typeof data[0] != 'undefined' - ? (typeof data[0].value != 'undefined' + value = data[0] != null + ? (data[0].value != null ? data[0].value : data[0]) : '-'; @@ -16013,20 +17356,20 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon //console.log(data) itemShape = new SymbolShape({ - style : { - pointList : data, - color : color, + style: { + pointList: data, + color: color, strokeColor: color, - shadowColor : effect.shadowColor || color, - shadowBlur : (typeof effect.shadowBlur != 'undefined' ? effect.shadowBlur : 8) + shadowColor: effect.shadowColor || color, + shadowBlur: (effect.shadowBlur != null ? effect.shadowBlur : 8) * devicePixelRatio, - size : this.deepQuery(queryTarget, 'symbolSize'), - iconType : symbol, + size: this.deepQuery(queryTarget, 'symbolSize'), + iconType: symbol, brushType: 'fill', lineWidth:1 }, - draggable : false, - hoverable : false + draggable: false, + hoverable: false }); if (effect.show) { @@ -16036,7 +17379,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon return itemShape; }, - backupShapeList : function () { + backupShapeList: function () { if (this.shapeList && this.shapeList.length > 0) { this.lastShapeList = this.shapeList; this.shapeList = []; @@ -16046,7 +17389,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon } }, - addShapeList : function () { + addShapeList: function () { var maxLenth = this.option.animationThreshold / (this.canvasSupported ? 2 : 4); var lastShapeList = this.lastShapeList; var shapeList = this.shapeList; @@ -16115,12 +17458,12 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon } }, - _getAnimationKey : function(shape) { + _getAnimationKey: function(shape) { if (this.type != ecConfig.CHART_TYPE_MAP) { return ecData.get(shape, 'seriesIndex') + '_' + ecData.get(shape, 'dataIndex') + (shape._mark ? shape._mark : '') - + (this.type == ecConfig.CHART_TYPE_RADAR + + (this.type === ecConfig.CHART_TYPE_RADAR ? ecData.get(shape, 'special') : ''); } else { @@ -16133,7 +17476,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon /** * 动画过渡 */ - _animateMod : function (oldShape, newShape, duration, easing) { + _animateMod: function (oldShape, newShape, duration, easing) { switch (newShape.type) { case 'broken-line' : case 'half-smooth-polygon' : @@ -16166,7 +17509,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon easing ); } - else if (newShape.type == 'sector') { + else if (newShape.type === 'sector') { ecAnimation.sector(this.zr, oldShape, newShape, duration, easing); } else { @@ -16208,7 +17551,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon * @param {string=} easing 缓动效果 * @param {Array=} addShapeList 指定特效对象,不知道默认使用this.shapeList */ - animationMark : function (duration , easing, addShapeList) { + animationMark: function (duration , easing, addShapeList) { var shapeList = addShapeList || this.shapeList; for (var i = 0, l = shapeList.length; i < l; i++) { if (!shapeList[i]._mark) { @@ -16223,7 +17566,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon * 特效动画 * @param {Array=} addShapeList 指定特效对象,不知道默认使用this.shapeList */ - animationEffect : function (addShapeList) { + animationEffect: function (addShapeList) { !addShapeList && this.clearEffectShape(); var shapeList = addShapeList || this.shapeList; var zlevel = ecConfig.EFFECT_ZLEVEL; @@ -16231,8 +17574,8 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon this.zr.modLayer( zlevel, { - motionBlur : true, - lastFrameAlpha : 0.95 + motionBlur: true, + lastFrameAlpha: 0.95 } ); } @@ -16248,11 +17591,11 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon } }, - clearEffectShape : function (clearMotionBlur) { + clearEffectShape: function (clearMotionBlur) { if (this.zr && this.effectList && this.effectList.length > 0) { clearMotionBlur && this.zr.modLayer( ecConfig.EFFECT_ZLEVEL, - { motionBlur : false} + { motionBlur: false } ); this.zr.delShape(this.effectList); } @@ -16265,7 +17608,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon * @param {Object} markData 标线标注对象,支持多个 * @param {string} markType 标线标注类型 */ - addMark : function (seriesIndex, markData, markType) { + addMark: function (seriesIndex, markData, markType) { var serie = this.series[seriesIndex]; if (this.selectedMap[serie.name]) { var duration = 500; @@ -16276,14 +17619,16 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon serie[markType].data = markData.data; this['_build' + markType.replace('m', 'M')](seriesIndex); - for (var i = lastLength, l = this.shapeList.length; i < l; i++) { - this.zr.addShape(this.shapeList[i]); - } - this.zr.refresh(); - if (this.option.animation && !this.option.renderAsImage) { + // animationMark就会addShape this.animationMark(duration, easing, this.shapeList.slice(lastLength)); } + else { + for (var i = lastLength, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + this.zr.refresh(); + } // 还原,复用_buildMarkX serie[markType].data = oriMarkData; } @@ -16295,7 +17640,7 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon * @param {string} markName 标线标注名称 * @param {string} markType 标线标注类型 */ - delMark : function (seriesIndex, markName, markType) { + delMark: function (seriesIndex, markName, markType) { markType = markType.replace('mark', '').replace('large', '').toLowerCase(); var serie = this.series[seriesIndex]; if (this.selectedMap[serie.name]) { @@ -16304,9 +17649,9 @@ define('echarts/chart/base',['require','zrender/shape/Image','../util/shape/Icon var len = 2; while(len--) { for (var i = 0, l = shapeList[len].length; i < l; i++) { - if (shapeList[len][i]._mark == markType - && ecData.get(shapeList[len][i], 'seriesIndex') == seriesIndex - && ecData.get(shapeList[len][i], 'name') == markName + if (shapeList[len][i]._mark === markType + && ecData.get(shapeList[len][i], 'seriesIndex') === seriesIndex + && ecData.get(shapeList[len][i], 'name') === markName ) { this.zr.delShape(shapeList[len][i].id); shapeList[len].splice(i, 1); @@ -16426,14 +17771,14 @@ define('echarts/chart/island',['require','../component/base','./base','zrender/s } Island.prototype = { - type : ecConfig.CHART_TYPE_ISLAND, + type: ecConfig.CHART_TYPE_ISLAND, /** * 孤岛合并 * * @param {string} tarShapeIndex 目标索引 * @param {Object} srcShape 源目标,合入目标后删除 */ - _combine : function (tarShape, srcShape) { + _combine: function (tarShape, srcShape) { var zrColor = require('zrender/tool/color'); var accMath = require('../util/accMath'); var value = accMath.accAdd( @@ -16458,7 +17803,7 @@ define('echarts/chart/island',['require','../component/base','./base','zrender/s /** * 刷新 */ - refresh : function (newOption) { + refresh: function (newOption) { if (newOption) { newOption.island = this.reformOption(newOption.island); this.option = newOption; @@ -16468,16 +17813,16 @@ define('echarts/chart/island',['require','../component/base','./base','zrender/s } }, - getOption : function () { + getOption: function () { return this.option; }, - resize : function () { + resize: function () { var newWidth = this.zr.getWidth(); var newHieght = this.zr.getHeight(); var xScale = newWidth / (this._zrWidth || newWidth); var yScale = newHieght / (this._zrHeight || newHieght); - if (xScale == 1 && yScale == 1) { + if (xScale === 1 && yScale === 1) { return; } this._zrWidth = newWidth; @@ -16495,29 +17840,29 @@ define('echarts/chart/island',['require','../component/base','./base','zrender/s } }, - add : function (shape) { + add: function (shape) { var name = ecData.get(shape, 'name'); var value = ecData.get(shape, 'value'); - var seriesName = typeof ecData.get(shape, 'series') != 'undefined' + var seriesName = ecData.get(shape, 'series') != null ? ecData.get(shape, 'series').name : ''; var font = this.getFont(this.option.island.textStyle); var islandShape = { - zlevel : this._zlevelBase, - style : { - x : shape.style.x, - y : shape.style.y, - r : this.option.island.r, - color : shape.style.color || shape.style.strokeColor, - text : name + this._valueConnector + value, - textFont : font + zlevel: this._zlevelBase, + style: { + x: shape.style.x, + y: shape.style.y, + r: this.option.island.r, + color: shape.style.color || shape.style.strokeColor, + text: name + this._valueConnector + value, + textFont: font }, - draggable : true, - hoverable : true, - onmousewheel : this.shapeHandler.onmousewheel, - _type : 'island' + draggable: true, + hoverable: true, + onmousewheel: this.shapeHandler.onmousewheel, + _type: 'island' }; - if (islandShape.style.color == '#fff') { + if (islandShape.style.color === '#fff') { islandShape.style.color = shape.style.strokeColor; } this.setCalculable(islandShape); @@ -16533,7 +17878,7 @@ define('echarts/chart/island',['require','../component/base','./base','zrender/s this.zr.addShape(islandShape); }, - del : function (shape) { + del: function (shape) { this.zr.delShape(shape.id); var newShapeList = []; for (var i = 0, l = this.shapeList.length; i < l; i++) { @@ -16547,7 +17892,7 @@ define('echarts/chart/island',['require','../component/base','./base','zrender/s /** * 数据项被拖拽进来, 重载基类方法 */ - ondrop : function (param, status) { + ondrop: function (param, status) { if (!this.isDrop || !param.target) { // 没有在当前实例上发生拖拽行为则直接返回 return; @@ -16570,7 +17915,7 @@ define('echarts/chart/island',['require','../component/base','./base','zrender/s /** * 数据项被拖拽出去, 重载基类方法 */ - ondragend : function (param, status) { + ondragend: function (param, status) { var target = param.target; // 拖拽安放目标 if (!this.isDragend) { // 拖拽的不是孤岛数据,如果没有图表接受孤岛数据,需要新增孤岛数据 @@ -17137,7 +18482,7 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre this.dom = myChart.dom; this._magicType = {}; - //this._magicMap; + this._magicMap = {}; this._isSilence = false; this._iconList; @@ -17206,8 +18551,8 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre } Toolbox.prototype = { - type : ecConfig.COMPONENT_TYPE_TOOLBOX, - _buildShape : function () { + type: ecConfig.COMPONENT_TYPE_TOOLBOX, + _buildShape: function () { this._iconList = []; var toolboxOption = this.option.toolbox; this._enableColor = toolboxOption.effectiveColor; @@ -17218,28 +18563,28 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre if (feature[key].show) { switch (key) { case 'mark' : - iconName.push({key : key, name : 'mark'}); - iconName.push({key : key, name : 'markUndo'}); - iconName.push({key : key, name : 'markClear'}); + iconName.push({ key: key, name: 'mark' }); + iconName.push({ key: key, name: 'markUndo' }); + iconName.push({ key: key, name: 'markClear' }); break; case 'magicType' : for (var i = 0, l = feature[key].type.length; i < l; i++) { feature[key].title[feature[key].type[i] + 'Chart'] = feature[key].title[feature[key].type[i]]; - iconName.push({key : key, name : feature[key].type[i] + 'Chart'}); + iconName.push({ key: key, name: feature[key].type[i] + 'Chart' }); } break; case 'dataZoom' : - iconName.push({key : key, name : 'dataZoom'}); - iconName.push({key : key, name : 'dataZoomReset'}); + iconName.push({ key: key, name: 'dataZoom' }); + iconName.push({ key: key, name: 'dataZoomReset' }); break; case 'saveAsImage' : if (this.canvasSupported) { - iconName.push({key : key, name : 'saveAsImage'}); + iconName.push({ key: key, name: 'saveAsImage' }); } break; default : - iconName.push({key : key, name : key}); + iconName.push({ key: key, name: key }); break; } } @@ -17280,7 +18625,7 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre /** * 构建所有图例元素 */ - _buildItem : function () { + _buildItem: function () { var toolboxOption = this.option.toolbox; var iconLength = this._iconList.length; var lastX = this._itemGroupLocation.x; @@ -17296,7 +18641,7 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre var textPosition; var textAlign; var textBaseline; - if (toolboxOption.orient == 'horizontal') { + if (toolboxOption.orient === 'horizontal') { textPosition = this._itemGroupLocation.y / this.zr.getHeight() < 0.5 ? 'bottom' : 'top'; textAlign = this._itemGroupLocation.x / this.zr.getWidth() < 0.5 @@ -17320,31 +18665,31 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre for (var i = 0; i < iconLength; i++) { // 图形 itemShape = { - type : 'icon', - zlevel : this._zlevelBase, - style : { - x : lastX, - y : lastY, - width : itemSize, - height : itemSize, - iconType : this._iconList[i], - lineWidth : 1, - strokeColor : this._featureColor[this._iconList[i]] - || color[i % color.length], + type: 'icon', + zlevel: this._zlevelBase, + style: { + x: lastX, + y: lastY, + width: itemSize, + height: itemSize, + iconType: this._iconList[i], + lineWidth: 1, + strokeColor: this._featureColor[this._iconList[i]] + || color[i % color.length], brushType: 'stroke' }, - highlightStyle : { - lineWidth : 1, - text : toolboxOption.showTitle - ? this._featureTitle[this._iconList[i]] - : undefined, - textFont : textFont, - textPosition : textPosition, - strokeColor : this._featureColor[this._iconList[i]] - || color[i % color.length] + highlightStyle: { + lineWidth: 1, + text: toolboxOption.showTitle + ? this._featureTitle[this._iconList[i]] + : undefined, + textFont: textFont, + textPosition: textPosition, + strokeColor: this._featureColor[this._iconList[i]] + || color[i % color.length] }, - hoverable : true, - clickable : true + hoverable: true, + clickable: true }; if (this._featureIcon[this._iconList[i]]) { @@ -17356,23 +18701,23 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre itemShape.type = 'image'; } - if (toolboxOption.orient == 'horizontal') { + if (toolboxOption.orient === 'horizontal') { // 修正左对齐第一个或右对齐最后一个 - if (i === 0 && textAlign == 'left') { + if (i === 0 && textAlign === 'left') { itemShape.highlightStyle.textPosition = 'specific'; itemShape.highlightStyle.textAlign = textAlign; itemShape.highlightStyle.textBaseline = textBaseline; itemShape.highlightStyle.textX = lastX; - itemShape.highlightStyle.textY = textBaseline == 'top' + itemShape.highlightStyle.textY = textBaseline === 'top' ? lastY + itemSize + 10 : lastY - 10; } - if (i == iconLength - 1 && textAlign == 'right') { + if (i === iconLength - 1 && textAlign === 'right') { itemShape.highlightStyle.textPosition = 'specific'; itemShape.highlightStyle.textAlign = textAlign; itemShape.highlightStyle.textBaseline = textBaseline; itemShape.highlightStyle.textX = lastX + itemSize; - itemShape.highlightStyle.textY = textBaseline == 'top' + itemShape.highlightStyle.textY = textBaseline === 'top' ? lastY + itemSize + 10 : lastY - 10; } @@ -17425,16 +18770,16 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre break; } - if (itemShape.type == 'icon') { + if (itemShape.type === 'icon') { itemShape = new IconShape(itemShape); } - else if (itemShape.type == 'image') { + else if (itemShape.type === 'image') { itemShape = new ImageShape(itemShape); } this.shapeList.push(itemShape); this._iconShapeMap[this._iconList[i]] = itemShape; - if (toolboxOption.orient == 'horizontal') { + if (toolboxOption.orient === 'horizontal') { lastX += itemSize + itemGap; } else { @@ -17443,7 +18788,7 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre } }, - _buildBackground : function () { + _buildBackground: function () { var toolboxOption = this.option.toolbox; var pTop = toolboxOption.padding[0]; var pRight = toolboxOption.padding[1]; @@ -17451,18 +18796,17 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre var pLeft = toolboxOption.padding[3]; this.shapeList.push(new RectangleShape({ - zlevel : this._zlevelBase, + zlevel: this._zlevelBase, hoverable :false, - style : { - x : this._itemGroupLocation.x - pLeft, - y : this._itemGroupLocation.y - pTop, - width : this._itemGroupLocation.width + pLeft + pRight, - height : this._itemGroupLocation.height + pTop + pBottom, - brushType : toolboxOption.borderWidth === 0 - ? 'fill' : 'both', - color : toolboxOption.backgroundColor, - strokeColor : toolboxOption.borderColor, - lineWidth : toolboxOption.borderWidth + style: { + x: this._itemGroupLocation.x - pLeft, + y: this._itemGroupLocation.y - pTop, + width: this._itemGroupLocation.width + pLeft + pRight, + height: this._itemGroupLocation.height + pTop + pBottom, + brushType: toolboxOption.borderWidth === 0 ? 'fill' : 'both', + color: toolboxOption.backgroundColor, + strokeColor: toolboxOption.borderColor, + lineWidth: toolboxOption.borderWidth } })); }, @@ -17470,7 +18814,7 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre /** * 根据选项计算图例实体的位置坐标 */ - _getItemGroupLocation : function () { + _getItemGroupLocation: function () { var toolboxOption = this.option.toolbox; var iconLength = this._iconList.length; var itemGap = toolboxOption.itemGap; @@ -17478,7 +18822,7 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre var totalWidth = 0; var totalHeight = 0; - if (toolboxOption.orient == 'horizontal') { + if (toolboxOption.orient === 'horizontal') { // 水平布局,计算总宽度,别忘减去最后一个的itemGap totalWidth = (itemSize + itemGap) * iconLength - itemGap; totalHeight = itemSize; @@ -17532,14 +18876,14 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre } return { - x : x, - y : y, - width : totalWidth, - height : totalHeight + x: x, + y: y, + width: totalWidth, + height: totalHeight }; }, - __onmousemove : function (param) { + __onmousemove: function (param) { if (this._marking) { this._markShape.style.xEnd = zrEvent.getX(param.event); this._markShape.style.yEnd = zrEvent.getY(param.event); @@ -17560,7 +18904,7 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre } }, - __onmousedown : function (param) { + __onmousedown: function (param) { if (param.target) { return; } @@ -17569,19 +18913,19 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre var y = zrEvent.getY(param.event); var zoomOption = this.option.dataZoom || {}; this._zoomShape = new RectangleShape({ - zlevel : this._zlevelBase, - style : { - x : x, - y : y, - width : 1, - height : 1, + zlevel: this._zlevelBase, + style: { + x: x, + y: y, + width: 1, + height: 1, brushType: 'both' }, - highlightStyle : { - lineWidth : 2, + highlightStyle: { + lineWidth: 2, color: zoomOption.fillerColor || ecConfig.dataZoom.fillerColor, - strokeColor : zoomOption.handleColor + strokeColor: zoomOption.handleColor || ecConfig.dataZoom.handleColor, brushType: 'both' } @@ -17590,7 +18934,7 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre return true; // 阻塞全局事件 }, - __onmouseup : function (/*param*/) { + __onmouseup: function (/*param*/) { if (!this._zoomShape || Math.abs(this._zoomShape.style.width) < 10 || Math.abs(this._zoomShape.style.height) < 10 @@ -17604,10 +18948,10 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre var zoom = this.component.dataZoom.rectZoom(this._zoomShape.style); if (zoom) { this._zoomQueue.push({ - start : zoom.start, - end : zoom.end, - start2 : zoom.start2, - end2 : zoom.end2 + start: zoom.start, + end: zoom.end, + start2: zoom.start2, + end2: zoom.end2 }); this._iconEnable(this._iconShapeMap['dataZoomReset']); this.zr.refresh(); @@ -17616,7 +18960,7 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre return true; // 阻塞全局事件 }, - __onclick : function (param) { + __onclick: function (param) { if (param.target) { return; } @@ -17633,31 +18977,31 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre var x = zrEvent.getX(param.event); var y = zrEvent.getY(param.event); this._markShape = new LineShape({ - zlevel : this._zlevelBase, - style : { - xStart : x, - yStart : y, - xEnd : x, - yEnd : y, - lineWidth : this.query( - this.option, - 'toolbox.feature.mark.lineStyle.width' - ), - strokeColor : this.query( - this.option, - 'toolbox.feature.mark.lineStyle.color' - ), - lineType : this.query( + zlevel: this._zlevelBase, + style: { + xStart: x, + yStart: y, + xEnd: x, + yEnd: y, + lineWidth: this.query( this.option, - 'toolbox.feature.mark.lineStyle.type' - ) + 'toolbox.feature.mark.lineStyle.width' + ), + strokeColor: this.query( + this.option, + 'toolbox.feature.mark.lineStyle.color' + ), + lineType: this.query( + this.option, + 'toolbox.feature.mark.lineStyle.type' + ) } }); this.zr.addHoverShape(this._markShape); } }, - __onMark : function (param) { + __onMark: function (param) { var target = param.target; if (this._marking || this._markStart) { // 取消 @@ -17681,7 +19025,7 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre return true; // 阻塞全局事件 }, - __onMarkUndo : function () { + __onMarkUndo: function () { if (this._marking) { this._marking = false; } else { @@ -17691,7 +19035,7 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre this.zr.delShape(target.id); this.zr.refresh(); this._markShapeList.pop(); - if (len == 1) { + if (len === 1) { this._iconDisable(this._iconShapeMap['markUndo']); this._iconDisable(this._iconShapeMap['markClear']); } @@ -17700,7 +19044,7 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre return true; }, - __onMarkClear : function () { + __onMarkClear: function () { if (this._marking) { this._marking = false; } @@ -17716,7 +19060,7 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre return true; }, - __onDataZoom : function (param) { + __onDataZoom: function (param) { var target = param.target; if (this._zooming || this._zoomStart) { // 取消 @@ -17744,7 +19088,7 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre return true; // 阻塞全局事件 }, - __onDataZoomReset : function () { + __onDataZoomReset: function () { if (this._zooming) { this._zooming = false; } @@ -17764,7 +19108,7 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre return true; }, - _resetMark : function () { + _resetMark: function () { this._marking = false; if (this._markStart) { this._markStart = false; @@ -17787,7 +19131,7 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre } }, - _resetZoom : function () { + _resetZoom: function () { this._zooming = false; if (this._zoomStart) { this._zoomStart = false; @@ -17811,61 +19155,61 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre } }, - _iconDisable : function (target) { + _iconDisable: function (target) { if (target.type != 'image') { this.zr.modShape(target.id, { - hoverable : false, - clickable : false, - style : { - strokeColor : this._disableColor + hoverable: false, + clickable: false, + style: { + strokeColor: this._disableColor } }); } else { this.zr.modShape(target.id, { - hoverable : false, - clickable : false, - style : { - opacity : 0.3 + hoverable: false, + clickable: false, + style: { + opacity: 0.3 } }); } }, - _iconEnable : function (target) { + _iconEnable: function (target) { if (target.type != 'image') { this.zr.modShape(target.id, { - hoverable : true, - clickable : true, - style : { - strokeColor : target.highlightStyle.strokeColor + hoverable: true, + clickable: true, + style: { + strokeColor: target.highlightStyle.strokeColor } }); } else { this.zr.modShape(target.id, { - hoverable : true, - clickable : true, - style : { - opacity : 0.8 + hoverable: true, + clickable: true, + style: { + opacity: 0.8 } }); } }, - __onDataView : function () { + __onDataView: function () { this._dataView.show(this.option); return true; }, - __onRestore : function (){ + __onRestore: function (){ this._resetMark(); this._resetZoom(); this.messageCenter.dispatch(ecConfig.EVENT.RESTORE, null, null, this.myChart); return true; }, - __onSaveAsImage : function () { + __onSaveAsImage: function () { var saveOption = this.option.toolbox.feature.saveAsImage; var imgType = saveOption.type || 'png'; if (imgType != 'png' && imgType != 'jpeg') { @@ -17877,7 +19221,7 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre image = this.zr.toDataURL( 'image/' + imgType, this.option.backgroundColor - && this.option.backgroundColor.replace(' ','') == 'rgba(0,0,0,0)' + && this.option.backgroundColor.replace(' ','') === 'rgba(0,0,0,0)' ? '#fff' : this.option.backgroundColor ); } @@ -17949,30 +19293,30 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre return; }, - __onMagicType : function (param) { + __onMagicType: function (param) { this._resetMark(); var itemName = param.target._name; if (!this._magicType[itemName]) { // 启用 this._magicType[itemName] = true; // 折柱互斥 - if (itemName == ecConfig.CHART_TYPE_LINE) { + if (itemName === ecConfig.CHART_TYPE_LINE) { this._magicType[ecConfig.CHART_TYPE_BAR] = false; } - else if (itemName == ecConfig.CHART_TYPE_BAR) { + else if (itemName === ecConfig.CHART_TYPE_BAR) { this._magicType[ecConfig.CHART_TYPE_LINE] = false; } // 堆积平铺互斥 - if (itemName == _MAGICTYPE_STACK) { + if (itemName === _MAGICTYPE_STACK) { this._magicType[_MAGICTYPE_TILED] = false; } - else if (itemName == _MAGICTYPE_TILED) { + else if (itemName === _MAGICTYPE_TILED) { this._magicType[_MAGICTYPE_STACK] = false; } this.messageCenter.dispatch( ecConfig.EVENT.MAGIC_TYPE_CHANGED, param.event, - {magicType : this._magicType}, + { magicType: this._magicType }, this.myChart ); } @@ -17980,29 +19324,29 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre return true; }, - setMagicType : function (magicType) { + setMagicType: function (magicType) { this._resetMark(); this._magicType = magicType; !this._isSilence && this.messageCenter.dispatch( ecConfig.EVENT.MAGIC_TYPE_CHANGED, null, - {magicType : this._magicType}, + { magicType: this._magicType }, this.myChart ); }, // 用户自定义扩展toolbox方法 - __onCustomHandler : function (param) { + __onCustomHandler: function (param) { var target = param.target.style.iconType; var featureHandler = this.option.toolbox.feature[target].onclick; if (typeof featureHandler === 'function') { - featureHandler(this.option); + featureHandler.call(this, this.option); } }, // 重置备份还原状态等 - reset : function (newOption, isRestore) { + reset: function (newOption, isRestore) { isRestore && this.clear(); if (this.query(newOption, 'toolbox.show') @@ -18024,15 +19368,15 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre axis = newOption.xAxis instanceof Array ? newOption.xAxis[newOption.series[len].xAxisIndex || 0] : newOption.xAxis; - if (axis && (axis.type || 'category') == 'category') { - axis.__boundaryGap = typeof axis.boundaryGap != 'undefined' + if (axis && (axis.type || 'category') === 'category') { + axis.__boundaryGap = axis.boundaryGap != null ? axis.boundaryGap : true; } axis = newOption.yAxis instanceof Array ? newOption.yAxis[newOption.series[len].yAxisIndex || 0] : newOption.yAxis; - if (axis && axis.type == 'category') { - axis.__boundaryGap = typeof axis.boundaryGap != 'undefined' + if (axis && axis.type === 'category') { + axis.__boundaryGap = axis.boundaryGap != null ? axis.boundaryGap : true; } newOption.series[len].__type = oriType; @@ -18060,11 +19404,11 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre // 框选缩放 var zoomOption = newOption.dataZoom; if (zoomOption && zoomOption.show) { - var start = typeof zoomOption.start != 'undefined' + var start = zoomOption.start != null && zoomOption.start >= 0 && zoomOption.start <= 100 ? zoomOption.start : 0; - var end = typeof zoomOption.end != 'undefined' + var end = zoomOption.end != null && zoomOption.end >= 0 && zoomOption.end <= 100 ? zoomOption.end : 100; @@ -18075,10 +19419,10 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre start = start - end; } this._zoomQueue = [{ - start : start, - end : end, - start2 : 0, - end2 : 100 + start: start, + end: end, + start2: 0, + end2: 100 }]; } else { @@ -18086,7 +19430,7 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre } }, - getMagicOption : function (){ + getMagicOption: function (){ var axis; if (this._magicType[ecConfig.CHART_TYPE_LINE] || this._magicType[ecConfig.CHART_TYPE_BAR] @@ -18106,13 +19450,13 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre axis = this.option.xAxis instanceof Array ? this.option.xAxis[this.option.series[i].xAxisIndex || 0] : this.option.xAxis; - if (axis && (axis.type || 'category') == 'category') { + if (axis && (axis.type || 'category') === 'category') { axis.boundaryGap = boundaryGap ? true : axis.__boundaryGap; } axis = this.option.yAxis instanceof Array ? this.option.yAxis[this.option.series[i].yAxisIndex || 0] : this.option.yAxis; - if (axis && axis.type == 'category') { + if (axis && axis.type === 'category') { axis.boundaryGap = boundaryGap ? true : axis.__boundaryGap; } } @@ -18136,11 +19480,11 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre return this.option; }, - silence : function (s) { + silence: function (s) { this._isSilence = s; }, - resize : function () { + resize: function () { this._resetMark(); this.clear(); if (this.option && this.option.toolbox && this.option.toolbox.show) { @@ -18151,13 +19495,13 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre } }, - hideDataView : function () { + hideDataView: function () { if (this._dataView) { this._dataView.hide(); } }, - clear : function(notMark) { + clear: function(notMark) { if (this.zr) { this.zr.delShape(this.shapeList); this.shapeList = []; @@ -18172,7 +19516,7 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre /** * 释放后实例不可用 */ - dispose : function () { + dispose: function () { if (this._dataView) { this._dataView.dispose(); this._dataView = null; @@ -18185,7 +19529,7 @@ define('echarts/component/toolbox',['require','./base','zrender/shape/Line','zre /** * 刷新 */ - refresh : function (newOption) { + refresh: function (newOption) { if (newOption) { this._resetMark(); this._resetZoom(); @@ -18247,8 +19591,8 @@ define('echarts/component/title',['require','./base','zrender/shape/Text','zrend } Title.prototype = { - type : ecConfig.COMPONENT_TYPE_TITLE, - _buildShape : function () { + type: ecConfig.COMPONENT_TYPE_TITLE, + _buildShape: function () { // 标题元素组的位置参数,通过计算所得x, y, width, height this._itemGroupLocation = this._getItemGroupLocation(); @@ -18263,7 +19607,7 @@ define('echarts/component/title',['require','./base','zrender/shape/Text','zrend /** * 构建所有标题元素 */ - _buildItem : function () { + _buildItem: function () { var text = this.titleOption.text; var link = this.titleOption.link; var target = this.titleOption.target; @@ -18279,16 +19623,16 @@ define('echarts/component/title',['require','./base','zrender/shape/Text','zrend var height = this._itemGroupLocation.height; var textShape = { - zlevel : this._zlevelBase, - style : { - y : y, - color : this.titleOption.textStyle.color, + zlevel: this._zlevelBase, + style: { + y: y, + color: this.titleOption.textStyle.color, text: text, textFont: font, textBaseline: 'top' }, highlightStyle: { - color : zrColor.lift(this.titleOption.textStyle.color, 1), + color: zrColor.lift(this.titleOption.textStyle.color, 1), brushType: 'fill' }, hoverable: false @@ -18307,16 +19651,16 @@ define('echarts/component/title',['require','./base','zrender/shape/Text','zrend } var subtextShape = { - zlevel : this._zlevelBase, - style : { - y : y + height, - color : this.titleOption.subtextStyle.color, + zlevel: this._zlevelBase, + style: { + y: y + height, + color: this.titleOption.subtextStyle.color, text: subtext, textFont: subfont, textBaseline: 'bottom' }, highlightStyle: { - color : zrColor.lift(this.titleOption.subtextStyle.color, 1), + color: zrColor.lift(this.titleOption.subtextStyle.color, 1), brushType: 'fill' }, hoverable: false @@ -18366,25 +19710,24 @@ define('echarts/component/title',['require','./base','zrender/shape/Text','zrend subtext !== '' && this.shapeList.push(new TextShape(subtextShape)); }, - _buildBackground : function () { + _buildBackground: function () { var pTop = this.titleOption.padding[0]; var pRight = this.titleOption.padding[1]; var pBottom = this.titleOption.padding[2]; var pLeft = this.titleOption.padding[3]; this.shapeList.push(new RectangleShape({ - zlevel : this._zlevelBase, + zlevel: this._zlevelBase, hoverable :false, - style : { - x : this._itemGroupLocation.x - pLeft, - y : this._itemGroupLocation.y - pTop, - width : this._itemGroupLocation.width + pLeft + pRight, - height : this._itemGroupLocation.height + pTop + pBottom, - brushType : this.titleOption.borderWidth === 0 - ? 'fill' : 'both', - color : this.titleOption.backgroundColor, - strokeColor : this.titleOption.borderColor, - lineWidth : this.titleOption.borderWidth + style: { + x: this._itemGroupLocation.x - pLeft, + y: this._itemGroupLocation.y - pTop, + width: this._itemGroupLocation.width + pLeft + pRight, + height: this._itemGroupLocation.height + pTop + pBottom, + brushType: this.titleOption.borderWidth === 0 ? 'fill' : 'both', + color: this.titleOption.backgroundColor, + strokeColor: this.titleOption.borderColor, + lineWidth: this.titleOption.borderWidth } })); }, @@ -18392,7 +19735,7 @@ define('echarts/component/title',['require','./base','zrender/shape/Text','zrend /** * 根据选项计算标题实体的位置坐标 */ - _getItemGroupLocation : function () { + _getItemGroupLocation: function () { var text = this.titleOption.text; var subtext = this.titleOption.subtext; var font = this.getFont(this.titleOption.textStyle); @@ -18452,17 +19795,17 @@ define('echarts/component/title',['require','./base','zrender/shape/Text','zrend } return { - x : x, - y : y, - width : totalWidth, - height : totalHeight + x: x, + y: y, + width: totalWidth, + height: totalHeight }; }, /** * 刷新 */ - refresh : function (newOption) { + refresh: function (newOption) { if (newOption) { this.option = newOption; @@ -18647,7 +19990,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr this._axisLineShape && this.zr.delShape(this._axisLineShape.id); this._axisLineShape = new LineShape({ zlevel: this._zlevelBase, - invisible : true, + invisible: true, hoverable: false }); this.shapeList.push(this._axisLineShape); @@ -18656,7 +19999,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr this._axisShadowShape && this.zr.delShape(this._axisShadowShape.id); this._axisShadowShape = new LineShape({ zlevel: 1, // grid上,chart下 - invisible : true, + invisible: true, hoverable: false }); this.shapeList.push(this._axisShadowShape); @@ -18665,7 +20008,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr this._axisCrossShape && this.zr.delShape(this._axisCrossShape.id); this._axisCrossShape = new CrossShape({ zlevel: this._zlevelBase, - invisible : true, + invisible: true, hoverable: false }); this.shapeList.push(this._axisCrossShape); @@ -18676,16 +20019,13 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr } Tooltip.prototype = { - type : ecConfig.COMPONENT_TYPE_TOOLTIP, + type: ecConfig.COMPONENT_TYPE_TOOLTIP, // 通用样式 - _gCssText : 'position:absolute;' - + 'display:block;' - + 'border-style:solid;' - + 'white-space:nowrap;', + _gCssText: 'position:absolute;display:block;border-style:solid;white-space:nowrap;', /** * 根据配置设置dom样式 */ - _style : function (opt) { + _style: function (opt) { if (!opt) { return ''; } @@ -18718,15 +20058,15 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr cssText.push('background-Color:' + opt.backgroundColor); } - if (typeof opt.borderWidth != 'undefined') { + if (opt.borderWidth != null) { cssText.push('border-width:' + opt.borderWidth + 'px'); } - if (typeof opt.borderColor != 'undefined') { + if (opt.borderColor != null) { cssText.push('border-color:' + opt.borderColor); } - if (typeof opt.borderRadius != 'undefined') { + if (opt.borderRadius != null) { cssText.push( 'border-radius:' + opt.borderRadius + 'px' ); @@ -18769,7 +20109,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr var padding = opt.padding; - if (typeof padding != 'undefined') { + if (padding != null) { padding = this.reformCssArray(padding); cssText.push( 'padding:' + padding[0] + 'px ' @@ -18784,7 +20124,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr return cssText; }, - __hide : function () { + __hide: function () { if (this._tDom) { this._tDom.style.display = 'none'; } @@ -18813,11 +20153,11 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr this.showing = false; }, - _show : function (position, x, y, specialCssText) { + _show: function (position, x, y, specialCssText) { var domHeight = this._tDom.offsetHeight; var domWidth = this._tDom.offsetWidth; if (position) { - if (typeof position == 'function') { + if (typeof position === 'function') { position = position([x, y]); } if (position instanceof Array) { @@ -18850,7 +20190,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr this.showing = true; }, - __refixed : function () { + __refixed: function () { if (this._tDom) { var cssText = ''; var domHeight = this._tDom.offsetHeight; @@ -18867,7 +20207,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr } }, - __tryShow : function () { + __tryShow: function () { var needShow; var trigger; if (!this._curTarget) { @@ -18876,7 +20216,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr } else { // 数据项事件 - if (this._curTarget._type == 'island' && this.option.tooltip.show) { + if (this._curTarget._type === 'island' && this.option.tooltip.show) { this._showItemTrigger(); return; } @@ -18886,10 +20226,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr [data, serie, this.option], 'tooltip.show' ); - if (typeof serie == 'undefined' - || typeof data == 'undefined' - || needShow === false - ) { + if (serie == null || data == null || !needShow) { // 不响应tooltip的数据对象延时隐藏 clearTimeout(this._hidingTicket); clearTimeout(this._showingTicket); @@ -18901,7 +20238,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr 'tooltip.trigger' ); - trigger == 'axis' + trigger === 'axis' ? this._showAxisTrigger( serie.xAxisIndex, serie.yAxisIndex, ecData.get(this._curTarget, 'dataIndex') @@ -18914,7 +20251,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr /** * 直角系 */ - _findAxisTrigger : function () { + _findAxisTrigger: function () { if (!this.component.xAxis || !this.component.yAxis) { this._hidingTicket = setTimeout(this._hide, this._hideDelay); return; @@ -18924,15 +20261,12 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr var yAxisIndex; for (var i = 0, l = series.length; i < l; i++) { // 找到第一个axis触发tooltip的系列 - if (this.deepQuery( - [series[i], this.option], 'tooltip.trigger' - ) == 'axis' - ) { + if (this.deepQuery([series[i], this.option], 'tooltip.trigger') === 'axis') { xAxisIndex = series[i].xAxisIndex || 0; yAxisIndex = series[i].yAxisIndex || 0; if (this.component.xAxis.getAxis(xAxisIndex) && this.component.xAxis.getAxis(xAxisIndex).type - == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY ) { // 横轴为类目轴 this._showAxisTrigger(xAxisIndex, yAxisIndex, @@ -18944,7 +20278,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr } else if (this.component.yAxis.getAxis(yAxisIndex) && this.component.yAxis.getAxis(yAxisIndex).type - == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY ) { // 纵轴为类目轴 this._showAxisTrigger(xAxisIndex, yAxisIndex, @@ -18961,7 +20295,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr } } } - if (this.option.tooltip.axisPointer.type == 'cross') { + if (this.option.tooltip.axisPointer.type === 'cross') { this._showAxisTrigger(-1, -1, -1); } }, @@ -18969,7 +20303,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr /** * 极坐标 */ - _findPolarTrigger : function () { + _findPolarTrigger: function () { if (!this.component.polar) { return false; } @@ -18995,34 +20329,35 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr /** * 根据坐标轴事件带的属性获取最近的axisDataIndex */ - _getNearestDataIndex : function (direction, categoryAxis) { + _getNearestDataIndex: function (direction, categoryAxis) { var dataIndex = -1; var x = zrEvent.getX(this._event); var y = zrEvent.getY(this._event); - if (direction == 'x') { + if (direction === 'x') { // 横轴为类目轴 var left; var right; var xEnd = this.component.grid.getXend(); var curCoord = categoryAxis.getCoordByIndex(dataIndex); while (curCoord < xEnd) { + right = curCoord; if (curCoord <= x) { left = curCoord; } - if (curCoord >= x) { + else { break; } curCoord = categoryAxis.getCoordByIndex(++dataIndex); - right = curCoord; } - if (x - left < right - x) { - dataIndex -= dataIndex !== 0 ? 1 : 0; + if (dataIndex <= 0) { + dataIndex = 0; + } + else if (x - left <= right - x) { + dataIndex -= 1; } else { // 离右边近,看是否为最后一个 - if (typeof categoryAxis.getNameByIndex(dataIndex) - == 'undefined' - ) { + if (categoryAxis.getNameByIndex(dataIndex) == null) { dataIndex -= 1; } } @@ -19035,24 +20370,25 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr var yStart = this.component.grid.getY(); var curCoord = categoryAxis.getCoordByIndex(dataIndex); while (curCoord > yStart) { + top = curCoord; if (curCoord >= y) { bottom = curCoord; } - if (curCoord <= y) { + else { break; } curCoord = categoryAxis.getCoordByIndex(++dataIndex); - top = curCoord; } - if (y - top > bottom - y) { - dataIndex -= dataIndex !== 0 ? 1 : 0; + if (dataIndex <= 0) { + dataIndex = 0; + } + else if (y - top >= bottom - y) { + dataIndex -= 1; } else { // 离上方边近,看是否为最后一个 - if (typeof categoryAxis.getNameByIndex(dataIndex) - == 'undefined' - ) { + if (categoryAxis.getNameByIndex(dataIndex) == null) { dataIndex -= 1; } } @@ -19064,17 +20400,17 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr /** * 直角系 */ - _showAxisTrigger : function (xAxisIndex, yAxisIndex, dataIndex) { + _showAxisTrigger: function (xAxisIndex, yAxisIndex, dataIndex) { !this._event.connectTrigger && this.messageCenter.dispatch( ecConfig.EVENT.TOOLTIP_IN_GRID, this._event, null, this.myChart ); - if (typeof this.component.xAxis == 'undefined' - || typeof this.component.yAxis == 'undefined' - || typeof xAxisIndex == 'undefined' - || typeof yAxisIndex == 'undefined' + if (this.component.xAxis == null + || this.component.yAxis == null + || xAxisIndex == null + || yAxisIndex == null // || dataIndex < 0 ) { // 不响应tooltip的数据对象延时隐藏 @@ -19094,8 +20430,8 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr var position; var showContent; var specialCssText = ''; - if (this.option.tooltip.trigger == 'axis') { - if (this.option.tooltip.show === false) { + if (this.option.tooltip.trigger === 'axis') { + if (!this.option.tooltip.show) { return; } formatter = this.option.tooltip.formatter; @@ -19104,7 +20440,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr if (xAxisIndex != -1 && this.component.xAxis.getAxis(xAxisIndex).type - == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY ) { // 横轴为类目轴,找到所有用这条横轴并且axis触发的系列数据 categoryAxis = this.component.xAxis.getAxis(xAxisIndex); @@ -19112,8 +20448,8 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr if (!this._isSelected(series[i].name)) { continue; } - if (series[i].xAxisIndex == xAxisIndex - && this.deepQuery([series[i], this.option], 'tooltip.trigger') == 'axis' + if (series[i].xAxisIndex === xAxisIndex + && this.deepQuery([series[i], this.option], 'tooltip.trigger') === 'axis' ) { showContent = this.query(series[i], 'tooltip.showContent') || showContent; @@ -19123,17 +20459,24 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr || position; specialCssText += this._style(this.query(series[i], 'tooltip')); - seriesArray.push(series[i]); - seriesIndex.push(i); + if (series[i].stack != null) { + seriesArray.unshift(series[i]); + seriesIndex.unshift(i); + } + else { + seriesArray.push(series[i]); + seriesIndex.push(i); + } } } + // 寻找高亮元素 this.messageCenter.dispatch( ecConfig.EVENT.TOOLTIP_HOVER, this._event, { - seriesIndex : seriesIndex, - dataIndex : dataIndex + seriesIndex: seriesIndex, + dataIndex: dataIndex }, this.myChart ); @@ -19151,7 +20494,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr } else if (yAxisIndex != -1 && this.component.yAxis.getAxis(yAxisIndex).type - == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY ) { // 纵轴为类目轴,找到所有用这条纵轴并且axis触发的系列数据 categoryAxis = this.component.yAxis.getAxis(yAxisIndex); @@ -19159,8 +20502,8 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr if (!this._isSelected(series[i].name)) { continue; } - if (series[i].yAxisIndex == yAxisIndex - && this.deepQuery([series[i], this.option], 'tooltip.trigger') == 'axis' + if (series[i].yAxisIndex === yAxisIndex + && this.deepQuery([series[i], this.option], 'tooltip.trigger') === 'axis' ) { showContent = this.query(series[i], 'tooltip.showContent') || showContent; @@ -19178,8 +20521,8 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr ecConfig.EVENT.TOOLTIP_HOVER, this._event, { - seriesIndex : seriesIndex, - dataIndex : dataIndex + seriesIndex: seriesIndex, + dataIndex: dataIndex }, this.myChart ); @@ -19217,12 +20560,12 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr if (seriesArray.length > 0) { var data; - if (typeof formatter == 'function') { + if (typeof formatter === 'function') { var params = []; for (var i = 0, l = seriesArray.length; i < l; i++) { data = seriesArray[i].data[dataIndex]; - data = typeof data != 'undefined' - ? (typeof data.value != 'undefined' + data = data != null + ? (data.value != null ? data.value : data) : '-'; @@ -19238,7 +20581,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr this.myChart, params, this._curTicket, this._setContent ); } - else if (typeof formatter == 'string') { + else if (typeof formatter === 'string') { this._curTicket = NaN; formatter = formatter.replace('{a}','{a0}') .replace('{b}','{b0}') @@ -19253,8 +20596,8 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr this._encodeHTML(categoryAxis.getNameByIndex(dataIndex)) ); data = seriesArray[i].data[dataIndex]; - data = typeof data != 'undefined' - ? (typeof data.value != 'undefined' + data = data != null + ? (data.value != null ? data.value : data) : '-'; @@ -19277,8 +20620,8 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr + this._encodeHTML(seriesArray[i].name || '') + ' : '; data = seriesArray[i].data[dataIndex]; - data = typeof data != 'undefined' - ? (typeof data.value != 'undefined' + data = data != null + ? (data.value != null ? data.value : data) : '-'; @@ -19288,6 +20631,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr this._tDom.innerHTML = formatter; } + // don't modify, just false, showContent == undefined == true if (showContent === false || !this.option.tooltip.showContent) { // 只用tooltip的行为,不显示主体 return; @@ -19306,10 +20650,10 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr /** * 极坐标 */ - _showPolarTrigger : function (polarIndex, dataIndex) { - if (typeof this.component.polar == 'undefined' - || typeof polarIndex == 'undefined' - || typeof dataIndex == 'undefined' + _showPolarTrigger: function (polarIndex, dataIndex) { + if (this.component.polar == null + || polarIndex == null + || dataIndex == null || dataIndex < 0 ) { return false; @@ -19321,8 +20665,8 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr var position; var showContent; var specialCssText = ''; - if (this.option.tooltip.trigger == 'axis') { - if (this.option.tooltip.show === false) { + if (this.option.tooltip.trigger === 'axis') { + if (!this.option.tooltip.show) { return false; } formatter = this.option.tooltip.formatter; @@ -19335,8 +20679,8 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr if (!this._isSelected(series[i].name)) { continue; } - if (series[i].polarIndex == polarIndex - && this.deepQuery([series[i], this.option], 'tooltip.trigger') == 'axis' + if (series[i].polarIndex === polarIndex + && this.deepQuery([series[i], this.option], 'tooltip.trigger') === 'axis' ) { showContent = this.query(series[i], 'tooltip.showContent') || showContent; @@ -19360,14 +20704,14 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr if (!this._isSelected(data.name)) { continue; } - data = typeof data != 'undefined' + data = data != null ? data : {name:'', value: {dataIndex:'-'}}; params.push([ seriesArray[i].name || '', data.name, - typeof data.value[dataIndex].value != 'undefined' + data.value[dataIndex].value != null ? data.value[dataIndex].value : data.value[dataIndex], indicatorName ]); @@ -19376,13 +20720,13 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr if (params.length <= 0) { return; } - if (typeof formatter == 'function') { + if (typeof formatter === 'function') { this._curTicket = 'axis:' + dataIndex; this._tDom.innerHTML = formatter.call( this.myChart, params, this._curTicket, this._setContent ); } - else if (typeof formatter == 'string') { + else if (typeof formatter === 'string') { formatter = formatter.replace('{a}','{a0}') .replace('{b}','{b0}') .replace('{c}','{c0}') @@ -19420,6 +20764,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr this._tDom.innerHTML = formatter; } + // don't modify, just false, showContent == undefined == true if (showContent === false || !this.option.tooltip.showContent) { // 只用tooltip的行为,不显示主体 return; @@ -19441,7 +20786,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr } }, - _showItemTrigger : function () { + _showItemTrigger: function () { if (!this._curTarget) { return; } @@ -19460,12 +20805,12 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr var html = ''; if (this._curTarget._type != 'island') { // 全局 - if (this.option.tooltip.trigger == 'item') { + if (this.option.tooltip.trigger === 'item') { formatter = this.option.tooltip.formatter; position = this.option.tooltip.position; } // 系列 - if (this.query(serie, 'tooltip.trigger') == 'item') { + if (this.query(serie, 'tooltip.trigger') === 'item') { showContent = this.query(serie, 'tooltip.showContent') || showContent; formatter = this.query(serie, 'tooltip.formatter') @@ -19489,7 +20834,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr position = this.deepQuery([data, serie, this.option], 'tooltip.islandPosition'); } - if (typeof formatter == 'function') { + if (typeof formatter === 'function') { this._curTicket = (serie.name || '') + ':' + ecData.get(this._curTarget, 'dataIndex'); @@ -19507,7 +20852,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr this._setContent ); } - else if (typeof formatter == 'string') { + else if (typeof formatter === 'string') { this._curTicket = NaN; formatter = formatter.replace('{a}','{a0}') .replace('{b}','{b0}') @@ -19528,18 +20873,14 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr } else { this._curTicket = NaN; - if (serie.type == ecConfig.CHART_TYPE_SCATTER) { - this._tDom.innerHTML = (typeof serie.name != 'undefined' - ? (this._encodeHTML(serie.name) + '
') - : '' - ) - + (name === '' ? '' : (this._encodeHTML(name) + ' : ')) - + value - + (typeof special == 'undefined' - ? '' : (' (' + special + ')') - ); - } - else if (serie.type == ecConfig.CHART_TYPE_RADAR && special) { + if (serie.type === ecConfig.CHART_TYPE_SCATTER) { + this._tDom.innerHTML = '' + + (serie.name != null ? (this._encodeHTML(serie.name) + '
') : '') + + (name === '' ? '' : (this._encodeHTML(name) + ' : ')) + + value + + (special == null ? '' : (' (' + special + ')')); + } + else if (serie.type === ecConfig.CHART_TYPE_RADAR && special) { indicator = special; html += this._encodeHTML(name === '' ? (serie.name || '') : name); html += html === '' ? '' : '
'; @@ -19549,8 +20890,8 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr } this._tDom.innerHTML = html; } - else if (serie.type == ecConfig.CHART_TYPE_CHORD) { - if (typeof special2 == 'undefined') { + else if (serie.type === ecConfig.CHART_TYPE_CHORD) { + if (special2 == null) { // 外环上 this._tDom.innerHTML = this._encodeHTML(name) + ' (' + this.numAddCommas(value) + ')'; @@ -19559,25 +20900,21 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr var name1 = this._encodeHTML(name); var name2 = this._encodeHTML(special); // 内部弦上 - this._tDom.innerHTML = (typeof serie.name != 'undefined' - ? (this._encodeHTML(serie.name) + '
') : '' - ) - + name1 + ' -> ' + name2 - + ' (' + this.numAddCommas(value) + ')' - + '
' - + name2 + ' -> ' + name1 - + ' (' + this.numAddCommas(special2) + ')'; + this._tDom.innerHTML = '' + + (serie.name != null ? (this._encodeHTML(serie.name) + '
') : '') + + name1 + ' -> ' + name2 + + ' (' + this.numAddCommas(value) + ')' + + '
' + + name2 + ' -> ' + name1 + + ' (' + this.numAddCommas(special2) + ')'; } } else { - this._tDom.innerHTML = (typeof serie.name != 'undefined' - ? (this._encodeHTML(serie.name) + '
') : '' - ) - + this._encodeHTML(name) + ' : ' - + this.numAddCommas(value) + - (typeof special == 'undefined' - ? '' : (' ('+ this.numAddCommas(special) +')') - ); + this._tDom.innerHTML = '' + + (serie.name != null ? (this._encodeHTML(serie.name) + '
') : '') + + this._encodeHTML(name) + ' : ' + + this.numAddCommas(value) + + (special == null ? '' : (' ('+ this.numAddCommas(special) +')')); } } @@ -19591,6 +20928,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr this.zr.refresh(); } + // don't modify, just false, showContent == undefined == true if (showContent === false || !this.option.tooltip.showContent) { // 只用tooltip的行为,不显示主体 return; @@ -19614,16 +20952,16 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr /** * 设置坐标轴指示器样式 */ - _styleAxisPointer : function (seriesArray, xStart, yStart, xEnd, yEnd, gap, x, y) { + _styleAxisPointer: function (seriesArray, xStart, yStart, xEnd, yEnd, gap, x, y) { if (seriesArray.length > 0) { var queryTarget; var curType; var axisPointer = this.option.tooltip.axisPointer; var pointType = axisPointer.type; var style = { - line : {}, - cross : {}, - shadow : {} + line: { }, + cross: { }, + shadow: { } }; for (var pType in style) { style[pType].color = axisPointer[pType + 'Style'].color; @@ -19633,7 +20971,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr for (var i = 0, l = seriesArray.length; i < l; i++) { if (this.deepQuery( [seriesArray[i], this.option], 'tooltip.trigger' - ) == 'axis' + ) === 'axis' ) { queryTarget = seriesArray[i]; curType = this.query(queryTarget, 'tooltip.axisPointer.type'); @@ -19655,35 +20993,35 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr } } - if (pointType == 'line') { + if (pointType === 'line') { this._axisLineShape.style = { - xStart : xStart, - yStart : yStart, - xEnd : xEnd, - yEnd : yEnd, - strokeColor : style.line.color, - lineWidth : style.line.width, - lineType : style.line.type + xStart: xStart, + yStart: yStart, + xEnd: xEnd, + yEnd: yEnd, + strokeColor: style.line.color, + lineWidth: style.line.width, + lineType: style.line.type }; this._axisLineShape.invisible = false; this.zr.modShape(this._axisLineShape.id); } - else if (pointType == 'cross') { + else if (pointType === 'cross') { this._axisCrossShape.style = { brushType: 'stroke', - rect : this.component.grid.getArea(), - x : x, - y : y, - text : ('( ' + rect: this.component.grid.getArea(), + x: x, + y: y, + text: ('( ' + this.component.xAxis.getAxis(0).getValueFromCoord(x) + ' , ' + this.component.yAxis.getAxis(0).getValueFromCoord(y) + ' )' - ).replace(' , ', ' ').replace(' , ', ' '), - textPosition : 'specific', - strokeColor : style.cross.color, - lineWidth : style.cross.width, - lineType : style.cross.type + ).replace(' , ', ' ').replace(' , ', ' '), + textPosition: 'specific', + strokeColor: style.cross.color, + lineWidth: style.cross.width, + lineType: style.cross.type }; if (this.component.grid.getXend() - x > 100) { // 右侧有空间 this._axisCrossShape.style.textAlign = 'left'; @@ -19704,14 +21042,14 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr this._axisCrossShape.invisible = false; this.zr.modShape(this._axisCrossShape.id); } - else if (pointType == 'shadow') { - if (typeof style.shadow.width == 'undefined' - || style.shadow.width == 'auto' + else if (pointType === 'shadow') { + if (style.shadow.width == null + || style.shadow.width === 'auto' || isNaN(style.shadow.width) ) { style.shadow.width = gap; } - if (xStart == xEnd) { + if (xStart === xEnd) { // 纵向 if (Math.abs(this.component.grid.getX() - xStart) < 2) { // 最左边 @@ -19724,7 +21062,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr xStart = xEnd = xEnd - style.shadow.width / 2; } } - else if (yStart == yEnd) { + else if (yStart === yEnd) { // 横向 if (Math.abs(this.component.grid.getY() - yStart) < 2) { // 最上边 @@ -19738,12 +21076,12 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr } } this._axisShadowShape.style = { - xStart : xStart, - yStart : yStart, - xEnd : xEnd, - yEnd : yEnd, - strokeColor : style.shadow.color, - lineWidth : style.shadow.width + xStart: xStart, + yStart: yStart, + xEnd: xEnd, + yEnd: yEnd, + strokeColor: style.shadow.color, + lineWidth: style.shadow.width }; this._axisShadowShape.invisible = false; this.zr.modShape(this._axisShadowShape.id); @@ -19752,7 +21090,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr } }, - __onmousemove : function (param) { + __onmousemove: function (param) { clearTimeout(this._hidingTicket); clearTimeout(this._showingTicket); var target = param.target; @@ -19801,10 +21139,10 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr // 看用这个polar的系列数据是否是axis触发,如果是设置_curTarget为nul var series = this.option.series; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].polarIndex == polarIndex + if (series[i].polarIndex === polarIndex && this.deepQuery( [series[i], this.option], 'tooltip.trigger' - ) == 'axis' + ) === 'axis' ) { this._curTarget = null; break; @@ -19819,7 +21157,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr /** * zrender事件响应:鼠标离开绘图区域 */ - __onglobalout : function () { + __onglobalout: function () { clearTimeout(this._hidingTicket); clearTimeout(this._showingTicket); this._hidingTicket = setTimeout(this._hide, this._hideDelay); @@ -19828,18 +21166,18 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr /** * 异步回调填充内容 */ - __setContent : function (ticket, content) { + __setContent: function (ticket, content) { if (!this._tDom) { return; } - if (ticket == this._curTicket) { + if (ticket === this._curTicket) { this._tDom.innerHTML = content; } setTimeout(this._refixed, 20); }, - ontooltipHover : function (param, tipShape) { + ontooltipHover: function (param, tipShape) { if (!this._lastTipShape // 不存在或者存在但dataIndex发生变化才需要重绘 || (this._lastTipShape && this._lastTipShape.dataIndex != param.dataIndex) ) { @@ -19863,24 +21201,24 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr this.zr.addShape(tipShape[i]); } this._lastTipShape = { - dataIndex : param.dataIndex, - tipShape : tipShape + dataIndex: param.dataIndex, + tipShape: tipShape }; } }, - ondragend : function () { + ondragend: function () { this._hide(); }, /** * 图例选择 */ - onlegendSelected : function (param) { + onlegendSelected: function (param) { this._selectedMap = param.selected; }, - _setSelectedMap : function () { + _setSelectedMap: function () { if (this.component.legend) { this._selectedMap = zrUtil.clone(this.component.legend.getSelectedMap()); } @@ -19889,8 +21227,8 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr } }, - _isSelected : function (itemName) { - if (typeof this._selectedMap[itemName] != 'undefined') { + _isSelected: function (itemName) { + if (this._selectedMap[itemName] != null) { return this._selectedMap[itemName]; } else { @@ -19904,20 +21242,20 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr * {seriesIndex: 0, seriesName:'', dataInex:0} line、bar、scatter、k、radar * {seriesIndex: 0, seriesName:'', name:''} map、pie、chord */ - showTip : function (params) { + showTip: function (params) { if (!params) { return; } var seriesIndex; var series = this.option.series; - if (typeof params.seriesIndex != 'undefined') { + if (params.seriesIndex != null) { seriesIndex = params.seriesIndex; } else { var seriesName = params.seriesName; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].name == seriesName) { + if (series[i].name === seriesName) { seriesIndex = i; break; } @@ -19925,13 +21263,13 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr } var serie = series[seriesIndex]; - if (typeof serie == 'undefined') { + if (serie == null) { return; } var chart = this.myChart.chart[serie.type]; var isAxisTrigger = this.deepQuery( [serie, this.option], 'tooltip.trigger' - ) == 'axis'; + ) === 'axis'; if (!chart) { return; @@ -19944,8 +21282,8 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr case ecConfig.CHART_TYPE_LINE : case ecConfig.CHART_TYPE_BAR : case ecConfig.CHART_TYPE_K : - if (typeof this.component.xAxis == 'undefined' - || typeof this.component.yAxis == 'undefined' + if (this.component.xAxis == null + || this.component.yAxis == null || serie.data.length <= dataIndex ) { return; @@ -19953,26 +21291,26 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr var xAxisIndex = serie.xAxisIndex || 0; var yAxisIndex = serie.yAxisIndex || 0; if (this.component.xAxis.getAxis(xAxisIndex).type - == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY ) { // 横轴是类目 this._event = { - zrenderX : this.component.xAxis.getAxis(xAxisIndex) - .getCoordByIndex(dataIndex), - zrenderY : this.component.grid.getY() - + (this.component.grid.getYend() - - this.component.grid.getY() - ) / 4 + zrenderX: this.component.xAxis.getAxis(xAxisIndex) + .getCoordByIndex(dataIndex), + zrenderY: this.component.grid.getY() + + (this.component.grid.getYend() + - this.component.grid.getY() + ) / 4 }; } else { // 纵轴是类目 this._event = { - zrenderX : this.component.grid.getX() - + (this.component.grid.getXend() + zrenderX: this.component.grid.getX() + + (this.component.grid.getXend() - this.component.grid.getX() - ) / 4, - zrenderY : this.component.yAxis.getAxis(yAxisIndex) + ) / 4, + zrenderY: this.component.yAxis.getAxis(yAxisIndex) .getCoordByIndex(dataIndex) }; } @@ -19983,7 +21321,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr ); break; case ecConfig.CHART_TYPE_RADAR : - if (typeof this.component.polar == 'undefined' + if (this.component.polar == null || serie.data[0].value.length <= dataIndex ) { return; @@ -19993,8 +21331,8 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr polarIndex, dataIndex, 'max' ); this._event = { - zrenderX : vector[0], - zrenderY : vector[1] + zrenderX: vector[0], + zrenderY: vector[1] }; this._showPolarTrigger( polarIndex, @@ -20015,8 +21353,8 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr case ecConfig.CHART_TYPE_SCATTER : var dataIndex = params.dataIndex; for (var i = 0, l = shapeList.length; i < l; i++) { - if (ecData.get(shapeList[i], 'seriesIndex') == seriesIndex - && ecData.get(shapeList[i], 'dataIndex') == dataIndex + if (ecData.get(shapeList[i], 'seriesIndex') === seriesIndex + && ecData.get(shapeList[i], 'dataIndex') === dataIndex ) { this._curTarget = shapeList[i]; x = shapeList[i].style.x; @@ -20029,9 +21367,9 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr case ecConfig.CHART_TYPE_RADAR : var dataIndex = params.dataIndex; for (var i = 0, l = shapeList.length; i < l; i++) { - if (shapeList[i].type == 'polygon' - && ecData.get(shapeList[i], 'seriesIndex') == seriesIndex - && ecData.get(shapeList[i], 'dataIndex') == dataIndex + if (shapeList[i].type === 'polygon' + && ecData.get(shapeList[i], 'seriesIndex') === seriesIndex + && ecData.get(shapeList[i], 'dataIndex') === dataIndex ) { this._curTarget = shapeList[i]; var vector = this.component.polar.getCenter( @@ -20046,9 +21384,9 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr case ecConfig.CHART_TYPE_PIE : var name = params.name; for (var i = 0, l = shapeList.length; i < l; i++) { - if (shapeList[i].type == 'sector' - && ecData.get(shapeList[i], 'seriesIndex') == seriesIndex - && ecData.get(shapeList[i], 'name') == name + if (shapeList[i].type === 'sector' + && ecData.get(shapeList[i], 'seriesIndex') === seriesIndex + && ecData.get(shapeList[i], 'name') === name ) { this._curTarget = shapeList[i]; var style = this._curTarget.style; @@ -20064,9 +21402,9 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr var name = params.name; var mapType = serie.mapType; for (var i = 0, l = shapeList.length; i < l; i++) { - if (shapeList[i].type == 'text' - && shapeList[i]._mapType == mapType - && shapeList[i].style._name == name + if (shapeList[i].type === 'text' + && shapeList[i]._mapType === mapType + && shapeList[i].style._name === name ) { this._curTarget = shapeList[i]; x = this._curTarget.style.x + this._curTarget.position[0]; @@ -20078,8 +21416,8 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr case ecConfig.CHART_TYPE_CHORD: var name = params.name; for (var i = 0, l = shapeList.length; i < l; i++) { - if (shapeList[i].type == 'sector' - && ecData.get(shapeList[i], 'name') == name + if (shapeList[i].type === 'sector' + && ecData.get(shapeList[i], 'name') === name ) { this._curTarget = shapeList[i]; var style = this._curTarget.style; @@ -20090,8 +21428,8 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr this.zr.trigger( zrConfig.EVENT.MOUSEMOVE, { - zrenderX : x, - zrenderY : y + zrenderX: x, + zrenderY: y } ); return; @@ -20101,8 +21439,8 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr case ecConfig.CHART_TYPE_FORCE: var name = params.name; for (var i = 0, l = shapeList.length; i < l; i++) { - if (shapeList[i].type == 'circle' - && ecData.get(shapeList[i], 'name') == name + if (shapeList[i].type === 'circle' + && ecData.get(shapeList[i], 'name') === name ) { this._curTarget = shapeList[i]; x = this._curTarget.position[0]; @@ -20112,10 +21450,10 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr } break; } - if (typeof x != 'undefined' && typeof y != 'undefined') { + if (x != null && y != null) { this._event = { - zrenderX : x, - zrenderY : y + zrenderX: x, + zrenderY: y }; this.zr.addHoverShape(this._curTarget); this.zr.refreshHover(); @@ -20127,14 +21465,14 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr /** * 关闭,公开接口 */ - hideTip : function () { + hideTip: function () { this._hide(); }, /** * 刷新 */ - refresh : function (newOption) { + refresh: function (newOption) { // this._selectedMap; // this._defaultCssText; // css样式缓存 // this._needAxisTrigger; // 坐标轴触发 @@ -20165,13 +21503,13 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr ); this._needAxisTrigger = false; - if (this.option.tooltip.trigger == 'axis') { + if (this.option.tooltip.trigger === 'axis') { this._needAxisTrigger = true; } var series = this.option.series; for (var i = 0, l = series.length; i < l; i++) { - if (this.query(series[i], 'tooltip.trigger') == 'axis') { + if (this.query(series[i], 'tooltip.trigger') === 'axis') { this._needAxisTrigger = true; break; } @@ -20186,14 +21524,17 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr this._axisLineWidth = this.option.tooltip.axisPointer.lineStyle.width; } if (this.showing) { - this._tryShow(); + var self = this; + setTimeout(function(){ + self.zr.trigger(zrConfig.EVENT.MOUSEMOVE, self.zr.handler._event); + },50); } }, /** * 释放后实例不可用,重载基类方法 */ - dispose : function () { + dispose: function () { if (this._lastTipShape && this._lastTipShape.tipShape.length > 0) { this.zr.delShape(this._lastTipShape.tipShape); } @@ -20214,7 +21555,7 @@ define('echarts/component/tooltip',['require','./base','../util/shape/Cross','zr /** * html转码的方法 */ - _encodeHTML : function (source) { + _encodeHTML: function (source) { return String(source) .replace(/&/g, '&') .replace(/= zrWidth - lastX ) { lastX = this._itemGroupLocation.x; @@ -20839,10 +22157,11 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren if (zrHeight - lastY < 200 // 最后200px做分行预判 && (itemHeight // 分行的最后一个不用算itemGap - + (i == dataLength - 1 || data[i+1] === '' ? 0 : itemGap) - ) >= zrHeight - lastY + + (i === dataLength - 1 || data[i + 1] === '' ? 0 : itemGap) + ) + >= zrHeight - lastY ) { - this.legendOption.x == 'right' + this.legendOption.x === 'right' ? lastX -= this._itemGroupLocation.maxWidth + itemGap : lastX += this._itemGroupLocation.maxWidth + itemGap; lastY = this._itemGroupLocation.y; @@ -20862,28 +22181,28 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren // 文字 textShape = { - // shape : 'text', - zlevel : this._zlevelBase, - style : { - x : lastX + itemWidth + 5, - y : lastY + itemHeight / 2, - color : this._selectedMap[itemName] + // shape: 'text', + zlevel: this._zlevelBase, + style: { + x: lastX + itemWidth + 5, + y: lastY + itemHeight / 2, + color: this._selectedMap[itemName] ? (dataTextStyle.color === 'auto' ? color : dataTextStyle.color) : '#ccc', text: formattedName, textFont: dataFont, textBaseline: 'middle' }, - highlightStyle : { - color : color, + highlightStyle: { + color: color, brushType: 'fill' }, - hoverable : !!this.legendOption.selectedMode, - clickable : !!this.legendOption.selectedMode + hoverable: !!this.legendOption.selectedMode, + clickable: !!this.legendOption.selectedMode }; - if (this.legendOption.orient == 'vertical' - && this.legendOption.x == 'right' + if (this.legendOption.orient === 'vertical' + && this.legendOption.x === 'right' ) { textShape.style.x -= (itemWidth + 10); textShape.style.textAlign = 'right'; @@ -20901,7 +22220,7 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren this.shapeList.push(itemShape); this.shapeList.push(textShape); - if (this.legendOption.orient == 'horizontal') { + if (this.legendOption.orient === 'horizontal') { lastX += itemWidth + 5 + zrArea.getTextWidth(formattedName, dataFont) + itemGap; @@ -20911,8 +22230,8 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren } } - if (this.legendOption.orient == 'horizontal' - && this.legendOption.x == 'center' + if (this.legendOption.orient === 'horizontal' + && this.legendOption.x === 'center' && lastY != this._itemGroupLocation.y ) { // 多行橫排居中优化 @@ -20920,17 +22239,17 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren } }, - _getName : function(data) { + _getName: function(data) { return typeof data.name != 'undefined' ? data.name : data; }, _getFormatterName: function(itemName) { var formatter = this.legendOption.formatter; var formattedName; - if (typeof formatter == 'function') { + if (typeof formatter === 'function') { formattedName = formatter.call(this.myChart, itemName); } - else if (typeof formatter == 'string') { + else if (typeof formatter === 'string') { formattedName = formatter.replace('{name}', itemName); } else { @@ -20945,11 +22264,11 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren }, // 多行橫排居中优化 - _mLineOptimize : function () { + _mLineOptimize: function () { var lineOffsetArray = []; // 每行宽度 var lastX = this._itemGroupLocation.x; for (var i = 2, l = this.shapeList.length; i < l; i++) { - if (this.shapeList[i].style.x == lastX) { + if (this.shapeList[i].style.x === lastX) { lineOffsetArray.push( ( this._itemGroupLocation.width @@ -20964,7 +22283,7 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren ) / 2 ); } - else if (i == l - 1) { + else if (i === l - 1) { lineOffsetArray.push( ( this._itemGroupLocation.width @@ -20982,7 +22301,7 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren } var curLineIndex = -1; for (var i = 1, l = this.shapeList.length; i < l; i++) { - if (this.shapeList[i].style.x == lastX) { + if (this.shapeList[i].style.x === lastX) { curLineIndex++; } if (lineOffsetArray[curLineIndex] === 0) { @@ -20994,24 +22313,24 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren } }, - _buildBackground : function () { + _buildBackground: function () { var pTop = this.legendOption.padding[0]; var pRight = this.legendOption.padding[1]; var pBottom = this.legendOption.padding[2]; var pLeft = this.legendOption.padding[3]; this.shapeList.push(new RectangleShape({ - zlevel : this._zlevelBase, + zlevel: this._zlevelBase, hoverable :false, - style : { - x : this._itemGroupLocation.x - pLeft, - y : this._itemGroupLocation.y - pTop, - width : this._itemGroupLocation.width + pLeft + pRight, - height : this._itemGroupLocation.height + pTop + pBottom, - brushType : this.legendOption.borderWidth === 0 ? 'fill' : 'both', - color : this.legendOption.backgroundColor, - strokeColor : this.legendOption.borderColor, - lineWidth : this.legendOption.borderWidth + style: { + x: this._itemGroupLocation.x - pLeft, + y: this._itemGroupLocation.y - pTop, + width: this._itemGroupLocation.width + pLeft + pRight, + height: this._itemGroupLocation.height + pTop + pBottom, + brushType: this.legendOption.borderWidth === 0 ? 'fill' : 'both', + color: this.legendOption.backgroundColor, + strokeColor: this.legendOption.borderColor, + lineWidth: this.legendOption.borderWidth } })); }, @@ -21019,7 +22338,7 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren /** * 根据选项计算图例实体的位置坐标 */ - _getItemGroupLocation : function () { + _getItemGroupLocation: function () { var data = this.legendOption.data; var dataLength = data.length; var itemGap = this.legendOption.itemGap; @@ -21035,7 +22354,7 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren var temp = 0; // 宽高计算,用于多行判断 var maxWidth = 0; // 垂直布局有用 - if (this.legendOption.orient == 'horizontal') { + if (this.legendOption.orient === 'horizontal') { // 水平布局,计算总宽度 totalHeight = itemHeight; for (var i = 0; i < dataLength; i++) { @@ -21160,85 +22479,85 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren } return { - x : x, - y : y, - width : totalWidth, - height : totalHeight, - maxWidth : maxWidth + x: x, + y: y, + width: totalWidth, + height: totalHeight, + maxWidth: maxWidth }; }, /** * 根据名称返回series数据或data */ - _getSomethingByName : function (name) { + _getSomethingByName: function (name) { var series = this.option.series; var data; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].name == name) { + if (series[i].name === name) { // 系列名称优先 return { - type : series[i].type, - series : series[i], - seriesIndex : i, - data : null, - dataIndex : -1 + type: series[i].type, + series: series[i], + seriesIndex: i, + data: null, + dataIndex: -1 }; } if ( - series[i].type == ecConfig.CHART_TYPE_PIE - || series[i].type == ecConfig.CHART_TYPE_RADAR - || series[i].type == ecConfig.CHART_TYPE_CHORD - || series[i].type == ecConfig.CHART_TYPE_FORCE - || series[i].type == ecConfig.CHART_TYPE_FUNNEL + series[i].type === ecConfig.CHART_TYPE_PIE + || series[i].type === ecConfig.CHART_TYPE_RADAR + || series[i].type === ecConfig.CHART_TYPE_CHORD + || series[i].type === ecConfig.CHART_TYPE_FORCE + || series[i].type === ecConfig.CHART_TYPE_FUNNEL ) { data = series[i].type != ecConfig.CHART_TYPE_FORCE ? series[i].data // 饼图、雷达图、和弦图得查找里面的数据名字 : series[i].categories; // 力导布局查找categories配置 for (var j = 0, k = data.length; j < k; j++) { - if (data[j].name == name) { + if (data[j].name === name) { return { - type : series[i].type, - series : series[i], - seriesIndex : i, - data : data[j], - dataIndex : j + type: series[i].type, + series: series[i], + seriesIndex: i, + data: data[j], + dataIndex: j }; } } } } return { - type : 'bar', - series : null, - seriesIndex : -1, - data : null, - dataIndex : -1 + type: 'bar', + series: null, + seriesIndex: -1, + data: null, + dataIndex: -1 }; }, - _getItemShapeByType : function (x, y, width, height, color, itemType, defaultColor) { + _getItemShapeByType: function (x, y, width, height, color, itemType, defaultColor) { var highlightColor = color === '#ccc' ? defaultColor : color; var itemShape = { - zlevel : this._zlevelBase, - style : { - iconType : 'legendicon' + itemType, - x : x, - y : y, - width : width, - height : height, - color : color, - strokeColor : color, - lineWidth : 2 + zlevel: this._zlevelBase, + style: { + iconType: 'legendicon' + itemType, + x: x, + y: y, + width: width, + height: height, + color: color, + strokeColor: color, + lineWidth: 2 }, highlightStyle: { - color : highlightColor, - strokeColor : highlightColor, - lineWidth : 1 + color: highlightColor, + strokeColor: highlightColor, + lineWidth: 1 }, - hoverable : this.legendOption.selectedMode, - clickable : this.legendOption.selectedMode + hoverable: this.legendOption.selectedMode, + clickable: this.legendOption.selectedMode }; var imageLocation; @@ -21250,15 +22569,15 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren } // 特殊设置 switch (itemType) { - case 'line' : + case 'line': itemShape.style.brushType = 'stroke'; itemShape.highlightStyle.lineWidth = 3; break; - case 'radar' : - case 'scatter' : + case 'radar': + case 'scatter': itemShape.highlightStyle.lineWidth = 3; break; - case 'k' : + case 'k': itemShape.style.brushType = 'both'; itemShape.highlightStyle.lineWidth = 3; itemShape.highlightStyle.color = @@ -21269,7 +22588,7 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren || '#ff3200') : color; break; - case 'image' : + case 'image': itemShape.style.iconType = 'image'; itemShape.style.image = imageLocation; if (color === '#ccc') { @@ -21280,7 +22599,7 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren return itemShape; }, - __legendSelected : function (param) { + __legendSelected: function (param) { var itemName = param.target._name; if (this.legendOption.selectedMode === 'single') { for (var k in this._selectedMap) { @@ -21292,8 +22611,8 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren ecConfig.EVENT.LEGEND_SELECTED, param.event, { - selected : this._selectedMap, - target : itemName + selected: this._selectedMap, + target: itemName }, this.myChart ); @@ -21302,7 +22621,7 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren /** * 刷新 */ - refresh : function (newOption) { + refresh: function (newOption) { if (newOption) { this.option = newOption || this.option; this.option.legend = this.reformOption(this.option.legend); @@ -21335,9 +22654,9 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren } else { if (something.data - && (something.type == ecConfig.CHART_TYPE_PIE - || something.type == ecConfig.CHART_TYPE_FORCE - || something.type == ecConfig.CHART_TYPE_FUNNEL) + && (something.type === ecConfig.CHART_TYPE_PIE + || something.type === ecConfig.CHART_TYPE_FORCE + || something.type === ecConfig.CHART_TYPE_FUNNEL) ) { queryTarget = [something.data, something.series]; } @@ -21364,28 +22683,28 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren this._buildShape(); }, - getRelatedAmount : function(name) { + getRelatedAmount: function(name) { var amount = 0; var series = this.option.series; var data; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].name == name) { + if (series[i].name === name) { // 系列名称优先 amount++; } if ( - series[i].type == ecConfig.CHART_TYPE_PIE - || series[i].type == ecConfig.CHART_TYPE_RADAR - || series[i].type == ecConfig.CHART_TYPE_CHORD - || series[i].type == ecConfig.CHART_TYPE_FORCE - || series[i].type == ecConfig.CHART_TYPE_FUNNEL + series[i].type === ecConfig.CHART_TYPE_PIE + || series[i].type === ecConfig.CHART_TYPE_RADAR + || series[i].type === ecConfig.CHART_TYPE_CHORD + || series[i].type === ecConfig.CHART_TYPE_FORCE + || series[i].type === ecConfig.CHART_TYPE_FUNNEL ) { data = series[i].type != ecConfig.CHART_TYPE_FORCE ? series[i].data // 饼图、雷达图、和弦图得查找里面的数据名字 : series[i].categories; // 力导布局查找categories配置 for (var j = 0, k = data.length; j < k; j++) { - if (data[j].name == name && data[j].value != '-') { + if (data[j].name === name && data[j].value != '-') { amount++; } } @@ -21394,25 +22713,25 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren return amount; }, - setColor : function (legendName, color) { + setColor: function (legendName, color) { this._colorMap[legendName] = color; }, - getColor : function (legendName) { + getColor: function (legendName) { if (!this._colorMap[legendName]) { this._colorMap[legendName] = this.zr.getColor(this._colorIndex++); } return this._colorMap[legendName]; }, - hasColor : function (legendName) { + hasColor: function (legendName) { return this._colorMap[legendName] ? this._colorMap[legendName] : false; }, - add : function (name, color){ + add: function (name, color){ var data = this.legendOption.data; for (var i = 0, dataLength = data.length; i < dataLength; i++) { - if (this._getName(data[i]) == name) { + if (this._getName(data[i]) === name) { // 已有就不重复加了 return; } @@ -21422,10 +22741,10 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren this._selectedMap[name] = true; }, - del : function (name){ + del: function (name){ var data = this.legendOption.data; for (var i = 0, dataLength = data.length; i < dataLength; i++) { - if (this._getName(data[i]) == name) { + if (this._getName(data[i]) === name) { return this.legendOption.data.splice(i, 1); } } @@ -21436,14 +22755,14 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren * @param {Object} name * @param {Object} itemShape */ - getItemShape : function (name) { - if (typeof name == 'undefined') { + getItemShape: function (name) { + if (name == null) { return; } var shape; for (var i = 0, l = this.shapeList.length; i < l; i++) { shape = this.shapeList[i]; - if (shape._name == name && shape.type != 'text') { + if (shape._name === name && shape.type != 'text') { return shape; } } @@ -21454,11 +22773,11 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren * @param {Object} name * @param {Object} itemShape */ - setItemShape : function (name, itemShape) { + setItemShape: function (name, itemShape) { var shape; for (var i = 0, l = this.shapeList.length; i < l; i++) { shape = this.shapeList[i]; - if (shape._name == name && shape.type != 'text') { + if (shape._name === name && shape.type != 'text') { if (!this._selectedMap[name]) { itemShape.style.color = '#ccc'; itemShape.style.strokeColor = '#ccc'; @@ -21468,7 +22787,7 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren } }, - isSelected : function (itemName) { + isSelected: function (itemName) { if (typeof this._selectedMap[itemName] != 'undefined') { return this._selectedMap[itemName]; } @@ -21478,11 +22797,11 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren } }, - getSelectedMap : function () { + getSelectedMap: function () { return this._selectedMap; }, - setSelected : function(itemName, selectStatus) { + setSelected: function(itemName, selectStatus) { if (this.legendOption.selectedMode === 'single') { for (var k in this._selectedMap) { this._selectedMap[k] = false; @@ -21493,8 +22812,8 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren ecConfig.EVENT.LEGEND_SELECTED, null, { - selected : this._selectedMap, - target : itemName + selected: this._selectedMap, + target: itemName }, this.myChart ); @@ -21503,7 +22822,7 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren /** * 图例选择 */ - onlegendSelected : function (param, status) { + onlegendSelected: function (param, status) { var legendSelected = param.selected; for (var itemName in legendSelected) { if (this._selectedMap[itemName] != legendSelected[itemName]) { @@ -21517,70 +22836,70 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren }; var legendIcon = { - line : function (ctx, style) { + line: function (ctx, style) { var dy = style.height / 2; ctx.moveTo(style.x, style.y + dy); ctx.lineTo(style.x + style.width,style.y + dy); }, - pie : function (ctx, style) { + pie: function (ctx, style) { var x = style.x; var y = style.y; var width = style.width; var height = style.height; SectorShape.prototype.buildPath(ctx, { - x : x + width / 2, - y : y + height + 2, - r : height + 2, - r0 : 6, - startAngle : 45, - endAngle : 135 + x: x + width / 2, + y: y + height + 2, + r: height + 2, + r0: 6, + startAngle: 45, + endAngle: 135 }); }, /* - chord : function (ctx, style) { + chord: function (ctx, style) { var x = style.x; var y = style.y; var width = style.width; var height = style.height; ctx.moveTo(x, y + height); BeziercurveShape.prototype.buildPath(ctx, { - xStart : x, - yStart : y + height, - cpX1 : x + width, - cpY1 : y + height, - cpX2 : x, - cpY2 : y + 4, - xEnd : x + width, - yEnd : y + 4 + xStart: x, + yStart: y + height, + cpX1: x + width, + cpY1: y + height, + cpX2: x, + cpY2: y + 4, + xEnd: x + width, + yEnd: y + 4 }); ctx.lineTo(x + width, y); BeziercurveShape.prototype.buildPath(ctx, { - xStart : x + width, - yStart : y, - cpX1 : x, - cpY1 : y, - cpX2 : x + width, - cpY2 : y + height - 4, - xEnd : x, - yEnd : y + height - 4 + xStart: x + width, + yStart: y, + cpX1: x, + cpY1: y, + cpX2: x + width, + cpY2: y + height - 4, + xEnd: x, + yEnd: y + height - 4 }); ctx.lineTo(x, y + height); }, */ - k : function (ctx, style) { + k: function (ctx, style) { var x = style.x; var y = style.y; var width = style.width; var height = style.height; CandleShape.prototype.buildPath(ctx, { - x : x + width / 2, - y : [y + 1, y + 1, y + height - 6, y + height], - width : width - 6 + x: x + width / 2, + y: [y + 1, y + 1, y + height - 6, y + height], + width: width - 6 }); }, - bar : function (ctx, style) { + bar: function (ctx, style) { var x = style.x; var y = style.y +1; var width = style.width; @@ -21604,7 +22923,7 @@ define('echarts/component/legend',['require','./base','zrender/shape/Text','zren ctx.quadraticCurveTo(x, y, x + r, y); }, - force : function (ctx, style) { + force: function (ctx, style) { IconShape.prototype.iconLibrary.circle(ctx, style); }, @@ -21691,10 +23010,12 @@ define('echarts/util/shape/Chain',['require','zrender/shape/Base','./Icon','zren // 设置transform this.setTransform(ctx); + ctx.save(); ctx.beginPath(); this.buildLinePath(ctx, style); ctx.stroke(); - + ctx.restore(); + this.brushSymbol(ctx, style); ctx.restore(); @@ -21875,9 +23196,9 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle null, { currentIndex: self.currentIndex, - data : typeof timelineOption.data[self.currentIndex].name != 'undefined' - ? timelineOption.data[self.currentIndex].name - : timelineOption.data[self.currentIndex] + data: timelineOption.data[self.currentIndex].name != null + ? timelineOption.data[self.currentIndex].name + : timelineOption.data[self.currentIndex] }, self.myChart ); @@ -21940,8 +23261,8 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle } Timeline.prototype = { - type : ecConfig.COMPONENT_TYPE_TIMELINE, - _buildShape : function () { + type: ecConfig.COMPONENT_TYPE_TIMELINE, + _buildShape: function () { // 位置参数,通过计算所得x, y, width, height this._location = this._getLocation(); this._buildBackground(); @@ -21965,7 +23286,7 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle /** * 根据选项计算实体的位置坐标 */ - _getLocation : function () { + _getLocation: function () { var timelineOption = this.timelineOption; var padding = timelineOption.padding; @@ -21974,7 +23295,7 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle var x = this.parsePercent(timelineOption.x, zrWidth); var x2 = this.parsePercent(timelineOption.x2, zrWidth); var width; - if (typeof timelineOption.width == 'undefined') { + if (timelineOption.width == null) { width = zrWidth - x - x2; x2 = zrWidth - x2; } @@ -21987,7 +23308,7 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle var height = this.parsePercent(timelineOption.height, zrHeight); var y; var y2; - if (typeof timelineOption.y != 'undefined') { + if (timelineOption.y != null) { y = this.parsePercent(timelineOption.y, zrHeight); y2 = y + height; } @@ -21997,27 +23318,27 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle } return { - x : x + padding[3], - y : y + padding[0], - x2 : x2 - padding[1], - y2 : y2 - padding[2], - width : width - padding[1] - padding[3], - height : height - padding[0] - padding[2] + x: x + padding[3], + y: y + padding[0], + x2: x2 - padding[1], + y2: y2 - padding[2], + width: width - padding[1] - padding[3], + height: height - padding[0] - padding[2] }; }, - _getReformedLabel : function (idx) { + _getReformedLabel: function (idx) { var timelineOption = this.timelineOption; - var data = typeof timelineOption.data[idx].name != 'undefined' + var data = timelineOption.data[idx].name != null ? timelineOption.data[idx].name : timelineOption.data[idx]; var formatter = timelineOption.data[idx].formatter || timelineOption.label.formatter; if (formatter) { - if (typeof formatter == 'function') { + if (typeof formatter === 'function') { data = formatter.call(this.myChart, data); } - else if (typeof formatter == 'string') { + else if (typeof formatter === 'string') { data = formatter.replace('{value}', data); } } @@ -22027,11 +23348,11 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle /** * 计算标签显示挑选间隔 */ - _getInterval : function () { + _getInterval: function () { var chainPoint = this._chainPoint; var timelineOption = this.timelineOption; var interval = timelineOption.label.interval; - if (interval == 'auto') { + if (interval === 'auto') { // 麻烦的自适应计算 var fontSize = timelineOption.label.textStyle.fontSize; var data = timelineOption.data; @@ -22090,7 +23411,7 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle /** * 根据选项计算时间链条上的坐标及symbolList */ - _getChainPoint : function() { + _getChainPoint: function() { var timelineOption = this.timelineOption; var symbol = timelineOption.symbol.toLowerCase(); var symbolSize = timelineOption.symbolSize; @@ -22105,14 +23426,14 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle var len = data.length; function _getName(i) { - return typeof data[i].name != 'undefined' ? data[i].name : data[i]; + return data[i].name != null ? data[i].name : data[i]; } var xList = []; if (len > 1) { var boundaryGap = width / len; boundaryGap = boundaryGap > 50 ? 50 : (boundaryGap < 20 ? 5 : boundaryGap); width -= boundaryGap * 2; - if (timelineOption.type == 'number') { + if (timelineOption.type === 'number') { // 平均分布 for (var i = 0; i < len; i++) { xList.push(x + boundaryGap + width / (len - 1) * i); @@ -22171,30 +23492,30 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle } list.push({ - x : x, - n : n, - isEmpty : isEmpty, - symbol : curSymbol, - symbolSize : data[i].symbolSize || symbolSize, - color : data[i].color, - borderColor : data[i].borderColor, - borderWidth : data[i].borderWidth, - name : this._getReformedLabel(i), - textColor : dataTextStyle.color, - textAlign : textAlign, - textBaseline : dataTextStyle.baseline || 'middle', - textX : x, - textY : y - (rotate ? 5 : 0), - textFont : data[i].textStyle ? this.getFont(dataTextStyle) : textFont, - rotation : rotation, - showLabel : false + x: x, + n: n, + isEmpty: isEmpty, + symbol: curSymbol, + symbolSize: data[i].symbolSize || symbolSize, + color: data[i].color, + borderColor: data[i].borderColor, + borderWidth: data[i].borderWidth, + name: this._getReformedLabel(i), + textColor: dataTextStyle.color, + textAlign: textAlign, + textBaseline: dataTextStyle.baseline || 'middle', + textX: x, + textY: y - (rotate ? 5 : 0), + textFont: data[i].textStyle ? this.getFont(dataTextStyle) : textFont, + rotation: rotation, + showLabel: false }); } return list; }, - _buildBackground : function () { + _buildBackground: function () { var timelineOption = this.timelineOption; var padding = timelineOption.padding; var width = this._location.width; @@ -22205,35 +23526,34 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle ) { // 背景 this.shapeList.push(new RectangleShape({ - zlevel : this._zlevelBase, + zlevel: this._zlevelBase, hoverable :false, - style : { - x : this._location.x - padding[3], - y : this._location.y - padding[0], - width : width + padding[1] + padding[3], - height : height + padding[0] + padding[2], - brushType : timelineOption.borderWidth === 0 - ? 'fill' : 'both', - color : timelineOption.backgroundColor, - strokeColor : timelineOption.borderColor, - lineWidth : timelineOption.borderWidth + style: { + x: this._location.x - padding[3], + y: this._location.y - padding[0], + width: width + padding[1] + padding[3], + height: height + padding[0] + padding[2], + brushType: timelineOption.borderWidth === 0 ? 'fill' : 'both', + color: timelineOption.backgroundColor, + strokeColor: timelineOption.borderColor, + lineWidth: timelineOption.borderWidth } })); } }, - _buildControl : function() { + _buildControl: function() { var self = this; var timelineOption = this.timelineOption; var lineStyle = timelineOption.lineStyle; var controlStyle = timelineOption.controlStyle; - if (timelineOption.controlPosition == 'none') { + if (timelineOption.controlPosition === 'none') { return; } var iconSize = 15; var iconGap = 5; var x; - if (timelineOption.controlPosition == 'left') { + if (timelineOption.controlPosition === 'left') { x = this._location.x; this._location.x += (iconSize + iconGap) * 3; } @@ -22244,25 +23564,25 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle var y = this._location.y; var iconStyle = { - zlevel : this._zlevelBase + 1, - style : { - iconType : 'timelineControl', - symbol : 'last', - x : x, - y : y, - width : iconSize, - height : iconSize, - brushType : 'stroke', + zlevel: this._zlevelBase + 1, + style: { + iconType: 'timelineControl', + symbol: 'last', + x: x, + y: y, + width: iconSize, + height: iconSize, + brushType: 'stroke', color: controlStyle.normal.color, - strokeColor : controlStyle.normal.color, - lineWidth : lineStyle.width + strokeColor: controlStyle.normal.color, + lineWidth: lineStyle.width }, - highlightStyle : { - color : controlStyle.emphasis.color, - strokeColor : controlStyle.emphasis.color, - lineWidth : lineStyle.width + 1 + highlightStyle: { + color: controlStyle.emphasis.color, + strokeColor: controlStyle.emphasis.color, + lineWidth: lineStyle.width + 1 }, - clickable : true + clickable: true }; this._ctrLastShape = new IconShape(iconStyle); @@ -22278,7 +23598,7 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle this._ctrPlayShape.style.status = this.timelineOption.autoPlay ? 'playing' : 'stop'; this._ctrPlayShape.style.x = x; this._ctrPlayShape.onclick = function() { - if (self._ctrPlayShape.style.status == 'stop') { + if (self._ctrPlayShape.style.status === 'stop') { self.play(); } else { @@ -22300,25 +23620,25 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle /** * 构建时间轴 */ - _buildChain : function () { + _buildChain: function () { var timelineOption = this.timelineOption; var lineStyle = timelineOption.lineStyle; this._timelineShae = { - zlevel : this._zlevelBase, - style : { - x : this._location.x, - y : this.subPixelOptimize(this._location.y, lineStyle.width), - width : this._location.x2 - this._location.x, - height : this._location.height, - chainPoint : this._chainPoint, + zlevel: this._zlevelBase, + style: { + x: this._location.x, + y: this.subPixelOptimize(this._location.y, lineStyle.width), + width: this._location.x2 - this._location.x, + height: this._location.height, + chainPoint: this._chainPoint, brushType:'both', - strokeColor : lineStyle.color, - lineWidth : lineStyle.width, - lineType : lineStyle.type + strokeColor: lineStyle.color, + lineWidth: lineStyle.width, + lineType: lineStyle.type }, - hoverable : false, - clickable : true, - onclick : this._onclick + hoverable: false, + clickable: true, + onclick: this._onclick }; this._timelineShae = new ChainShape(this._timelineShae); @@ -22328,32 +23648,32 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle /** * 构建拖拽手柄 */ - _buildHandle : function () { + _buildHandle: function () { var curPoint = this._chainPoint[this.currentIndex]; var symbolSize = curPoint.symbolSize + 1; symbolSize = symbolSize < 5 ? 5 : symbolSize; this._handleShape = { - zlevel : this._zlevelBase + 1, - hoverable : false, - draggable : true, - style : { - iconType : 'diamond', - n : curPoint.n, - x : curPoint.x - symbolSize, - y : this._location.y + this._location.height / 4 - symbolSize, - width : symbolSize * 2, - height : symbolSize * 2, + zlevel: this._zlevelBase + 1, + hoverable: false, + draggable: true, + style: { + iconType: 'diamond', + n: curPoint.n, + x: curPoint.x - symbolSize, + y: this._location.y + this._location.height / 4 - symbolSize, + width: symbolSize * 2, + height: symbolSize * 2, brushType:'both', - textPosition : 'specific', - textX : curPoint.x, - textY : this._location.y - this._location.height / 4, - textAlign : 'center', - textBaseline : 'middle' + textPosition: 'specific', + textX: curPoint.x, + textY: this._location.y - this._location.height / 4, + textAlign: 'center', + textBaseline: 'middle' }, - highlightStyle : {}, - ondrift : this._ondrift, - ondragend : this._ondragend + highlightStyle: {}, + ondrift: this._ondrift, + ondragend: this._ondragend }; this._handleShape = new IconShape(this._handleShape); @@ -22363,7 +23683,7 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle /** * 同步拖拽图形样式 */ - _syncHandleShape : function() { + _syncHandleShape: function() { if (!this.timelineOption.show) { return; } @@ -22376,7 +23696,7 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle this._handleShape.style.textFont = curPoint.textFont; this._handleShape.style.n = curPoint.n; - if (cpStyle.symbol == 'auto') { + if (cpStyle.symbol === 'auto') { this._handleShape.style.iconType = curPoint.symbol != 'none' ? curPoint.symbol : 'diamond'; } @@ -22389,7 +23709,7 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle } var symbolSize; - if (cpStyle.symbolSize == 'auto') { + if (cpStyle.symbolSize === 'auto') { symbolSize = curPoint.symbolSize + 2; symbolSize = symbolSize < 5 ? 5 : symbolSize; } @@ -22397,20 +23717,20 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle symbolSize = cpStyle.symbolSize - 0; } - this._handleShape.style.color = cpStyle.color == 'auto' + this._handleShape.style.color = cpStyle.color === 'auto' ? (curPoint.color ? curPoint.color : timelineOption.controlStyle.emphasis.color ) : cpStyle.color; - this._handleShape.style.textColor = cpStyle.label.textStyle.color == 'auto' + this._handleShape.style.textColor = cpStyle.label.textStyle.color === 'auto' ? this._handleShape.style.color : cpStyle.label.textStyle.color; this._handleShape.highlightStyle.strokeColor = - this._handleShape.style.strokeColor = cpStyle.borderColor == 'auto' + this._handleShape.style.strokeColor = cpStyle.borderColor === 'auto' ? (curPoint.borderColor ? curPoint.borderColor : '#fff') : cpStyle.borderColor; - this._handleShape.style.lineWidth = cpStyle.borderWidth == 'auto' + this._handleShape.style.lineWidth = cpStyle.borderWidth === 'auto' ? (curPoint.borderWidth ? curPoint.borderWidth : 0) : (cpStyle.borderWidth - 0); this._handleShape.highlightStyle.lineWidth = this._handleShape.style.lineWidth + 1; @@ -22419,17 +23739,17 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle .when( 500, { - x : curPoint.x - symbolSize, - textX : curPoint.x, - y : this._location.y + this._location.height / 4 - symbolSize, - width : symbolSize * 2, - height : symbolSize * 2 + x: curPoint.x - symbolSize, + textX: curPoint.x, + y: this._location.y + this._location.height / 4 - symbolSize, + width: symbolSize * 2, + height: symbolSize * 2 } ) .start('ExponentialOut'); }, - _findChainIndex : function(x) { + _findChainIndex: function(x) { var chainPoint = this._chainPoint; var len = chainPoint.length; if (x <= chainPoint[0].x) { @@ -22447,10 +23767,10 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle } }, - __onclick : function(param) { + __onclick: function(param) { var x = zrEvent.getX(param.event); var newIndex = this._findChainIndex(x); - if (newIndex == this.currentIndex) { + if (newIndex === this.currentIndex) { return true; // 啥事都没发生 } @@ -22463,7 +23783,7 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle /** * 拖拽范围控制 */ - __ondrift : function (shape, dx) { + __ondrift: function (shape, dx) { this.timelineOption.autoPlay && this.stop(); // 停止自动播放 var chainPoint = this._chainPoint; @@ -22492,7 +23812,7 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle shape.style.text = curPoint.name; //console.log(newIndex) - if (newIndex == this.currentIndex) { + if (newIndex === this.currentIndex) { return true; // 啥事都没发生 } @@ -22508,14 +23828,14 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle return true; }, - __ondragend : function () { + __ondragend: function () { this.isDragend = true; }, /** * 数据项被拖拽出去 */ - ondragend : function (param, status) { + ondragend: function (param, status) { if (!this.isDragend || !param.target) { // 没有在当前实例上发生拖拽行为则直接返回 return; @@ -22532,7 +23852,7 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle return; }, - last : function () { + last: function () { this.timelineOption.autoPlay && this.stop(); // 停止自动播放 this.currentIndex -= 1; @@ -22544,7 +23864,7 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle return this.currentIndex; }, - next : function () { + next: function () { this.timelineOption.autoPlay && this.stop(); // 停止自动播放 this.currentIndex += 1; @@ -22556,7 +23876,7 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle return this.currentIndex; }, - play : function (targetIndex, autoPlay) { + play: function (targetIndex, autoPlay) { if (this._ctrPlayShape && this._ctrPlayShape.style.status != 'playing') { this._ctrPlayShape.style.status = 'playing'; this.zr.modShape(this._ctrPlayShape.id); @@ -22564,15 +23884,13 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle } - this.timelineOption.autoPlay = typeof autoPlay != 'undefined' - ? autoPlay : true; + this.timelineOption.autoPlay = autoPlay != null ? autoPlay : true; if (!this.timelineOption.autoPlay) { clearTimeout(this.playTicket); } - this.currentIndex = typeof targetIndex != 'undefined' - ? targetIndex : (this.currentIndex + 1); + this.currentIndex = targetIndex != null ? targetIndex : (this.currentIndex + 1); if (this.currentIndex >= this.timelineOption.data.length) { this.currentIndex = 0; } @@ -22581,7 +23899,7 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle return this.currentIndex; }, - stop : function () { + stop: function () { if (this._ctrPlayShape && this._ctrPlayShape.style.status != 'stop') { this._ctrPlayShape.style.status = 'stop'; this.zr.modShape(this._ctrPlayShape.id); @@ -22598,7 +23916,7 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle /** * 避免dataZoom带来两次refresh,不设refresh接口,resize重复一下buildshape逻辑 */ - resize : function () { + resize: function () { if (this.timelineOption.show) { this.clear(); this._buildShape(); @@ -22606,7 +23924,7 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle } }, - setTheme : function(needRefresh) { + setTheme: function(needRefresh) { this.timelineOption = this.reformOption(zrUtil.clone(this.option.timeline)); // 补全padding属性 this.timelineOption.padding = this.reformCssArray( @@ -22632,7 +23950,7 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle /** * 释放后实例不可用,重载基类方法 */ - dispose : function () { + dispose: function () { this.clear(); this.shapeList = null; @@ -22649,7 +23967,7 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle var symbol = style.symbol; - if (symbol == 'last') { + if (symbol === 'last') { ctx.moveTo(x + width - 2, y + height / 3); ctx.lineTo(x + width - 2, y); ctx.lineTo(x + 2, y + height / 2); @@ -22658,7 +23976,7 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle ctx.moveTo(x, y); ctx.lineTo(x, y); } - else if (symbol == 'next') { + else if (symbol === 'next') { ctx.moveTo(x + 2, y + height / 3); ctx.lineTo(x + 2, y); ctx.lineTo(x + width - 2, y + height / 2); @@ -22667,15 +23985,15 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle ctx.moveTo(x, y); ctx.lineTo(x, y); } - else if (symbol == 'play') { - if (style.status == 'stop') { + else if (symbol === 'play') { + if (style.status === 'stop') { ctx.moveTo(x + 2, y); ctx.lineTo(x + width - 2, y + height / 2); ctx.lineTo(x + 2, y + height); ctx.lineTo(x + 2, y); } else { - var delta = style.brushType == 'both' ? 2 : 3; + var delta = style.brushType === 'both' ? 2 : 3; ctx.rect(x + 2, y, delta, height); ctx.rect(x + width - delta - 2, y, delta, height); } @@ -22687,11 +24005,11 @@ define('echarts/component/timeline',['require','./base','zrender/shape/Rectangle ); symbol = IconShape.prototype.iconLibrary.image; symbol(ctx, { - x : x, - y : y, - width : width, - height : height, - image : imageLocation + x: x, + y: y, + width: width, + height: height, + image: imageLocation }); } } @@ -22760,7 +24078,7 @@ define( effectOption.y, effectOption.x + effectOption.width, effectOption.y + effectOption.height, - [[0, '#ff6400'], [0.5, '#ffe100'], [1, '#b1ff00']] + [ [ 0, '#ff6400' ], [ 0.5, '#ffe100' ], [ 1, '#b1ff00' ] ] ); if (options.progress != null) { @@ -22768,7 +24086,7 @@ define( addShapeHandle(background); barShape.highlightStyle.width = - this.adjust(options.progress, [0,1]) + this.adjust(options.progress, [ 0, 1 ]) * options.effectOption.width; addShapeHandle(barShape); @@ -22781,7 +24099,7 @@ define( // 循环显示 barShape.highlightStyle.width = 0; return setInterval( - function() { + function () { addShapeHandle(background); if (barShape.highlightStyle.width < effectOption.width) { @@ -22855,7 +24173,7 @@ define( var canvasHeight = this.canvasHeight; // 初始化动画元素 - for(var i = 0; i < n; i++) { + for (var i = 0; i < n; i++) { var color = effectOption.color == 'random' ? zrColor.alpha(zrColor.random(), 0.3) : effectOption.color; @@ -22878,10 +24196,10 @@ define( function () { addShapeHandle(background); - for(var i = 0; i < n; i++) { + for (var i = 0; i < n; i++) { var style = shapeList[i].highlightStyle; - if (style.y - shapeList[i].animationY + style.r <= 0){ + if (style.y - shapeList[i].animationY + style.r <= 0) { shapeList[i].highlightStyle.y = canvasHeight + style.r; shapeList[i].highlightStyle.x = Math.ceil( Math.random() * canvasWidth @@ -22954,7 +24272,7 @@ define( var canvasHeight = this.canvasHeight; // 初始化动画元素 - for(var i = 0; i < n; i++) { + for (var i = 0; i < n; i++) { var xStart = -Math.ceil(Math.random() * 1000); var len = Math.ceil(Math.random() * 400); var pos = Math.ceil(Math.random() * canvasHeight); @@ -22981,10 +24299,10 @@ define( function() { addShapeHandle(background); - for(var i = 0; i < n; i++) { + for (var i = 0; i < n; i++) { var style = shapeList[i].highlightStyle; - if (style.xStart >= canvasWidth){ + if (style.xStart >= canvasWidth) { shapeList[i].len = Math.ceil(Math.random() * 400); style.xStart = -400; @@ -23083,12 +24401,12 @@ define( // 初始化动画元素 var shapeList = []; var clolrList = zrColor.getGradientColors( - ['#ff6400', '#ffe100', '#97ff00'], 25 + [ '#ff6400', '#ffe100', '#97ff00' ], 25 ); var preAngle = 15; var endAngle = 240; - for(var i = 0; i < 16; i++) { + for (var i = 0; i < 16; i++) { shapeList.push(new SectorShape({ highlightStyle : { x : x, @@ -23106,15 +24424,15 @@ define( x + r0 * Math.cos(endAngle - preAngle, true), y - r0 * Math.sin(endAngle - preAngle, true), [ - [0, clolrList[i * 2]], - [1, clolrList[i * 2 + 1]] + [ 0, clolrList[i * 2] ], + [ 1, clolrList[i * 2 + 1] ] ] ) })); endAngle -= preAngle; } endAngle = 360; - for(var i = 0; i < 4; i++) { + for (var i = 0; i < 4; i++) { shapeList.push(new SectorShape({ highlightStyle : { x : x, @@ -23132,8 +24450,8 @@ define( x + r0 * Math.cos(endAngle - preAngle, true), y - r0 * Math.sin(endAngle - preAngle, true), [ - [0, clolrList[i * 2 + 32]], - [1, clolrList[i * 2 + 33]] + [ 0, clolrList[i * 2 + 32] ], + [ 1, clolrList[i * 2 + 33] ] ] ) })); @@ -23145,11 +24463,11 @@ define( // 指定进度 addShapeHandle(background); - n = this.adjust(options.progress, [0,1]).toFixed(2) * 100 / 5; + n = this.adjust(options.progress, [ 0, 1 ]).toFixed(2) * 100 / 5; shapeRing.highlightStyle.text = n * 5 + '%'; addShapeHandle(shapeRing); - for(var i = 0; i < 20; i++) { + for (var i = 0; i < 20; i++) { shapeList[i].highlightStyle.color = i < n ? shapeList[i]._color : darkColor; addShapeHandle(shapeList[i]); @@ -23167,10 +24485,10 @@ define( n += n >= 20 ? -20 : 1; - //shapeRing.highlightStyle.text = n * 5 + '%'; + // shapeRing.highlightStyle.text = n * 5 + '%'; addShapeHandle(shapeRing); - for(var i = 0; i < 20; i++) { + for (var i = 0; i < 20; i++) { shapeList[i].highlightStyle.color = i < n ? shapeList[i]._color : darkColor; addShapeHandle(shapeList[i]); @@ -23189,10 +24507,11 @@ define( define( - 'zrender/loadingEffect/Spin',['require','./Base','../tool/util','../tool/color','../shape/Sector'],function (require) { + 'zrender/loadingEffect/Spin',['require','./Base','../tool/util','../tool/color','../tool/area','../shape/Sector'],function (require) { var Base = require('./Base'); var util = require('../tool/util'); var zrColor = require('../tool/color'); + var zrArea = require('../tool/area'); var SectorShape = require('../shape/Sector'); function Spin(options) { @@ -23207,12 +24526,30 @@ define( * @param {Object} refreshHandle */ Spin.prototype._start = function (addShapeHandle, refreshHandle) { + var options = util.merge( + this.options, + { + textStyle : { + color : '#fff', + textAlign : 'start' + }, + backgroundColor : 'rgba(0, 0, 0, 0.8)' + } + ); + var textShape = this.createTextShape(options.textStyle); + + var textGap = 10; + var textWidth = zrArea.getTextWidth( + textShape.highlightStyle.text, textShape.highlightStyle.textFont + ); + var textHeight = zrArea.getTextHeight( + textShape.highlightStyle.text, textShape.highlightStyle.textFont + ); + // 特效默认配置 var effectOption = util.merge( this.options.effect || {}, { - x : this.canvasWidth / 2 - 80, - y : this.canvasHeight / 2, r0 : 9, r : 15, n : 18, @@ -23220,23 +24557,17 @@ define( timeInterval : 100 } ); - - var options = util.merge( - this.options, - { - textStyle : { - color : '#fff', - x : effectOption.x + effectOption.r + 10, - y : effectOption.y, - textAlign : 'start' - }, - backgroundColor : 'rgba(0, 0, 0, 0.8)' - } + + var location = this.getLocation( + this.options.textStyle, + textWidth + textGap + effectOption.r * 2, + Math.max(effectOption.r * 2, textHeight) ); - - var textShape = this.createTextShape(options.textStyle); + effectOption.x = location.x + effectOption.r; + effectOption.y = textShape.highlightStyle.y = location.y + location.height / 2; + textShape.highlightStyle.x = effectOption.x + effectOption.r + textGap; + var background = this.createBackgroundShape(options.backgroundColor); - var n = effectOption.n; var x = effectOption.x; var y = effectOption.y; @@ -23247,7 +24578,7 @@ define( // 初始化动画元素 var shapeList = []; var preAngle = Math.round(180 / n); - for(var i = 0; i < n; i++) { + for (var i = 0; i < n; i++) { shapeList[i] = new SectorShape({ highlightStyle : { x : x, @@ -23262,13 +24593,13 @@ define( }); } - var pos = [0, x, y]; + var pos = [ 0, x, y ]; return setInterval( function() { addShapeHandle(background); pos[0] -= 0.3; - for(var i = 0; i < n; i++) { + for (var i = 0; i < n; i++) { shapeList[i].rotation = pos; addShapeHandle(shapeList[i]); } @@ -23286,9 +24617,10 @@ define( define( - 'zrender/loadingEffect/Whirling',['require','./Base','../tool/util','../shape/Ring','../shape/Droplet','../shape/Circle'],function (require) { + 'zrender/loadingEffect/Whirling',['require','./Base','../tool/util','../tool/area','../shape/Ring','../shape/Droplet','../shape/Circle'],function (require) { var Base = require('./Base'); var util = require('../tool/util'); + var zrArea = require('../tool/area'); var RingShape = require('../shape/Ring'); var DropletShape = require('../shape/Droplet'); var CircleShape = require('../shape/Circle'); @@ -23305,12 +24637,30 @@ define( * @param {Object} refreshHandle */ Whirling.prototype._start = function (addShapeHandle, refreshHandle) { + var options = util.merge( + this.options, + { + textStyle : { + color : '#888', + textAlign : 'start' + }, + backgroundColor : 'rgba(250, 250, 250, 0.8)' + } + ); + var textShape = this.createTextShape(options.textStyle); + + var textGap = 10; + var textWidth = zrArea.getTextWidth( + textShape.highlightStyle.text, textShape.highlightStyle.textFont + ); + var textHeight = zrArea.getTextHeight( + textShape.highlightStyle.text, textShape.highlightStyle.textFont + ); + // 特效默认配置 var effectOption = util.merge( this.options.effect || {}, { - x : this.canvasWidth / 2 - 80, - y : this.canvasHeight / 2, r : 18, colorIn : '#fff', colorOut : '#555', @@ -23318,23 +24668,17 @@ define( timeInterval : 50 } ); - - var options = util.merge( - this.options, - { - textStyle : { - color : '#888', - x : effectOption.x + effectOption.r + 10, - y : effectOption.y, - textAlign : 'start' - }, - backgroundColor : 'rgba(250, 250, 250, 0.8)' - } + + var location = this.getLocation( + this.options.textStyle, + textWidth + textGap + effectOption.r * 2, + Math.max(effectOption.r * 2, textHeight) ); - - var textShape = this.createTextShape(options.textStyle); + effectOption.x = location.x + effectOption.r; + effectOption.y = textShape.highlightStyle.y = location.y + location.height / 2; + textShape.highlightStyle.x = effectOption.x + effectOption.r + textGap; + var background = this.createBackgroundShape(options.backgroundColor); - // 初始化动画元素 var droplet = new DropletShape({ highlightStyle : { @@ -23360,7 +24704,7 @@ define( } }); - var pos = [0, effectOption.x, effectOption.y]; + var pos = [ 0, effectOption.x, effectOption.y ]; droplet.highlightStyle.x = circleIn.highlightStyle.x @@ -23425,16 +24769,16 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool var zrUtil = require('zrender/tool/util'); var zrEvent = require('zrender/tool/event'); - var self = {}; + var self = { }; var _canvasSupported = require('zrender/tool/env').canvasSupported; var _idBase = new Date() - 0; - var _instances = {}; // ECharts实例map索引 + var _instances = { }; // ECharts实例map索引 var DOM_ATTRIBUTE_KEY = '_echarts_instance_'; - self.version = '2.0.2'; + self.version = '2.0.4'; self.dependencies = { - zrender : '2.0.2' + zrender: '2.0.4' }; /** * 入口方法 @@ -23505,12 +24849,12 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool this._connected = false; this._status = { // 用于图表间通信 - dragIn : false, - dragOut : false, - needRefresh : false + dragIn: false, + dragOut: false, + needRefresh: false }; this._curEventType = false; // 破循环信号灯 - this._chartList = []; // 图表实例 + this._chartList = [ ]; // 图表实例 this._messageCenter = new MessageCenter(); @@ -23540,7 +24884,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool * @type {Array} */ var ZR_EVENT_LISTENS = [ - 'CLICK', 'MOUSEOVER', + 'CLICK', 'DBLCLICK', 'MOUSEOVER', 'MOUSEOUT', 'DRAGSTART', 'DRAGEND', 'DRAGENTER', 'DRAGOVER', 'DRAGLEAVE', 'DROP' ]; @@ -23572,19 +24916,19 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * 初始化::构造函数 */ - _init : function () { + _init: function () { var self = this; var _zr = require('zrender').init(this.dom); this._zr = _zr; - + // wrap: n,e,d,t for name event data this this._messageCenter.dispatch = function(type, event, eventPackage, that) { - eventPackage = eventPackage || {}; + eventPackage = eventPackage || { }; eventPackage.type = type; eventPackage.event = event; self._messageCenter.dispatchWithContext(type, eventPackage, that); - if (type != 'HOVER') { + if (type != 'HOVER' && type != 'MOUSEOUT') { // 频繁事件直接抛出 setTimeout(function(){ self._messageCenterOutSide.dispatchWithContext( type, eventPackage, that @@ -23602,13 +24946,15 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool return self.__onevent(param); }; for (var e in ecConfig.EVENT) { - if (e != 'CLICK' && e != 'HOVER' && e != 'MAP_ROAM') { + if (e != 'CLICK' && e != 'DBLCLICK' + && e != 'HOVER' && e != 'MOUSEOUT' && e != 'MAP_ROAM' + ) { this._messageCenter.bind(ecConfig.EVENT[e], this._onevent, this); } } - var eventBehaviors = {}; + var eventBehaviors = { }; this._onzrevent = function (param) { return self[eventBehaviors[ param.type ]](param); }; @@ -23621,35 +24967,39 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool _zr.on(eventValue, this._onzrevent); } - this.chart = {}; // 图表索引 - this.component = {}; // 组件索引 + this.chart = { }; // 图表索引 + this.component = { }; // 组件索引 // 内置图表 // 孤岛 var Island = require('./chart/island'); - this._island = new Island(this._themeConfig, this._messageCenter, _zr, {}, this); + this._island = new Island(this._themeConfig, this._messageCenter, _zr, { }, this); this.chart.island = this._island; // 内置通用组件 // 工具箱 var Toolbox = require('./component/toolbox'); - this._toolbox = new Toolbox(this._themeConfig, this._messageCenter, _zr, {}, this); + this._toolbox = new Toolbox(this._themeConfig, this._messageCenter, _zr, { }, this); this.component.toolbox = this._toolbox; var componentLibrary = require('./component'); componentLibrary.define('title', require('./component/title')); componentLibrary.define('tooltip', require('./component/tooltip')); componentLibrary.define('legend', require('./component/legend')); + + if (_zr.getWidth() === 0 || _zr.getHeight() === 0) { + console.error('Dom’s width & height should be ready before init.'); + } }, /** * ECharts事件处理中心 */ - __onevent : function (param){ + __onevent: function (param){ param.__echartsId = param.__echartsId || this.id; // 来自其他联动图表的事件 - var fromMyself = (param.__echartsId == this.id); + var fromMyself = (param.__echartsId === this.id); if (!this._curEventType) { this._curEventType = param.type; @@ -23706,9 +25056,9 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool this._zr.trigger( 'mousemove', { - connectTrigger : true, - zrenderX : grid.getX() + param.x * grid.getWidth(), - zrenderY : grid.getY() + param.y * grid.getHeight() + connectTrigger: true, + zrenderX: grid.getX() + param.x * grid.getWidth(), + zrenderY: grid.getY() + param.y * grid.getHeight() } ); } @@ -23732,7 +25082,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool } // 多图联动,只做自己的一级事件分发,避免级联事件循环 - if (this._connected && fromMyself && this._curEventType == param.type) { + if (this._connected && fromMyself && this._curEventType === param.type) { for (var c in this._connected) { this._connected[c].connectedEventHandler(param); } @@ -23748,7 +25098,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * 点击事件,响应zrender事件,包装后分发到Echarts层 */ - _onclick : function (param) { + _onclick: function (param) { callChartListMethodReverse(this, 'onclick', param); if (param.target) { @@ -23763,11 +25113,30 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool } } }, + + /** + * 双击事件,响应zrender事件,包装后分发到Echarts层 + */ + _ondblclick: function (param) { + callChartListMethodReverse(this, 'ondblclick', param); - /** - * 鼠标移入事件,响应zrender事件,包装后分发到Echarts层 - */ - _onmouseover : function (param) { + if (param.target) { + var ecData = this._eventPackage(param.target); + if (ecData && ecData.seriesIndex != null) { + this._messageCenter.dispatch( + ecConfig.EVENT.DBLCLICK, + param.event, + ecData, + this + ); + } + } + }, + + /** + * 鼠标移入事件,响应zrender事件,包装后分发到Echarts层 + */ + _onmouseover: function (param) { if (param.target) { var ecData = this._eventPackage(param.target); if (ecData && ecData.seriesIndex != null) { @@ -23780,16 +25149,33 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool } } }, + + /** + * 鼠标移出事件,响应zrender事件,包装后分发到Echarts层 + */ + _onmouseout: function (param) { + if (param.target) { + var ecData = this._eventPackage(param.target); + if (ecData && ecData.seriesIndex != null) { + this._messageCenter.dispatch( + ecConfig.EVENT.MOUSEOUT, + param.event, + ecData, + this + ); + } + } + }, /** * dragstart回调,可计算特性实现 */ - _ondragstart : function (param) { + _ondragstart: function (param) { // 复位用于图表间通信拖拽标识 this._status = { - dragIn : false, - dragOut : false, - needRefresh : false + dragIn: false, + dragOut: false, + needRefresh: false }; callChartListMethodReverse(this, 'ondragstart', param); @@ -23798,28 +25184,28 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * dragging回调,可计算特性实现 */ - _ondragenter : function (param) { + _ondragenter: function (param) { callChartListMethodReverse(this, 'ondragenter', param); }, /** * dragstart回调,可计算特性实现 */ - _ondragover : function (param) { + _ondragover: function (param) { callChartListMethodReverse(this, 'ondragover', param); }, /** * dragstart回调,可计算特性实现 */ - _ondragleave : function (param) { + _ondragleave: function (param) { callChartListMethodReverse(this, 'ondragleave', param); }, /** * dragstart回调,可计算特性实现 */ - _ondrop : function (param) { + _ondrop: function (param) { callChartListMethodReverse(this, 'ondrop', param, this._status); this._island.ondrop(param, this._status); }, @@ -23827,7 +25213,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * dragdone回调 ,可计算特性实现 */ - _ondragend : function (param) { + _ondragend: function (param) { callChartListMethodReverse(this, 'ondragend', param, this._status); this._timeline && this._timeline.ondragend(param, this._status); @@ -23851,7 +25237,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * 图例选择响应 */ - _onlegendSelected : function (param) { + _onlegendSelected: function (param) { // 用于图表间通信 this._status.needRefresh = false; callChartListMethodReverse(this, 'onlegendSelected', param, this._status); @@ -23864,7 +25250,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * 数据区域缩放响应 */ - _ondataZoom : function (param) { + _ondataZoom: function (param) { // 用于图表间通信 this._status.needRefresh = false; callChartListMethodReverse(this, 'ondataZoom', param, this._status); @@ -23877,7 +25263,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * 值域漫游响应 */ - _ondataRange : function (param) { + _ondataRange: function (param) { this._clearEffect(); // 用于图表间通信 this._status.needRefresh = false; @@ -23892,7 +25278,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * 动态类型切换响应 */ - _onmagicTypeChanged : function () { + _onmagicTypeChanged: function () { this._clearEffect(); this._render(this._toolbox.getMagicOption()); }, @@ -23900,7 +25286,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * 数据视图修改响应 */ - _ondataViewChanged : function (param) { + _ondataViewChanged: function (param) { this._syncBackupData(param.option); this._messageCenter.dispatch( ecConfig.EVENT.DATA_CHANGED, @@ -23914,22 +25300,22 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * tooltip与图表间通信 */ - _tooltipHover : function (param) { - var tipShape = []; + _tooltipHover: function (param) { + var tipShape = [ ]; callChartListMethodReverse(this, 'ontooltipHover', param, tipShape); }, /** * 还原 */ - _onrestore : function () { + _onrestore: function () { this.restore(); }, /** * 刷新 */ - _onrefresh : function (param) { + _onrefresh: function (param) { this._refreshInside = true; this.refresh(param); this._refreshInside = false; @@ -23938,14 +25324,14 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * 数据修改后的反向同步dataZoom持有的备份数据 */ - _syncBackupData : function (curOption) { + _syncBackupData: function (curOption) { this.component.dataZoom && this.component.dataZoom.syncBackupData(curOption); }, /** * 打包Echarts层的事件附件 */ - _eventPackage : function (target) { + _eventPackage: function (target) { if (target) { var ecData = require('./util/ecData'); @@ -23959,12 +25345,13 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool ) : dataIndex; return { - seriesIndex : seriesIndex, - dataIndex : dataIndex, - data : ecData.get(target, 'data'), - name : ecData.get(target, 'name'), - value : ecData.get(target, 'value'), - special : ecData.get(target, 'special') + seriesIndex: seriesIndex, + seriesName: (ecData.get(target, 'series') || { }).name, + dataIndex: dataIndex, + data: ecData.get(target, 'data'), + name: ecData.get(target, 'name'), + value: ecData.get(target, 'value'), + special: ecData.get(target, 'special') }; } return; @@ -23973,7 +25360,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * 图表渲染 */ - _render : function (magicOption) { + _render: function (magicOption) { this._mergeGlobalConifg(magicOption); var bgColor = magicOption.backgroundColor; @@ -23996,18 +25383,18 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool } this._zr.clearAnimation(); - this._chartList = []; + this._chartList = [ ]; var chartLibrary = require('./chart'); var componentLibrary = require('./component'); if (magicOption.xAxis || magicOption.yAxis) { - magicOption.grid = magicOption.grid || {}; - magicOption.dataZoom = magicOption.dataZoom || {}; + magicOption.grid = magicOption.grid || { }; + magicOption.dataZoom = magicOption.dataZoom || { }; } var componentList = [ - 'title', 'legend', 'tooltip', 'dataRange', + 'title', 'legend', 'tooltip', 'dataRange', 'roamController', 'grid', 'dataZoom', 'xAxis', 'yAxis', 'polar' ]; @@ -24044,7 +25431,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool var ChartClass; var chartType; var chart; - var chartMap = {}; // 记录已经初始化的图表 + var chartMap = { }; // 记录已经初始化的图表 for (var i = 0, l = magicOption.series.length; i < l; i++) { chartType = magicOption.series[i].type; if (!chartType) { @@ -24127,7 +25514,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * 还原 */ - restore : function () { + restore: function () { this._clearEffect(); this._option = zrUtil.clone(this._optionRestore); this._disposeChartList(); @@ -24140,9 +25527,9 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool * 刷新 * @param {Object=} param,可选参数,用于附带option,内部同步用,外部不建议带入数据修改,无法同步 */ - refresh : function (param) { + refresh: function (param) { this._clearEffect(); - param = param || {}; + param = param || { }; var magicOption = param.option; // 外部调用的refresh且有option带入 @@ -24172,7 +25559,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * 释放图表实例 */ - _disposeChartList : function () { + _disposeChartList: function () { this._clearEffect(); // 停止动画 @@ -24190,13 +25577,13 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool } } - this._chartList = []; + this._chartList = [ ]; }, /** * 非图表全局属性merge~~ */ - _mergeGlobalConifg : function (magicOption) { + _mergeGlobalConifg: function (magicOption) { var mergeList = [ // 背景颜色 'backgroundColor', @@ -24244,7 +25631,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool * @param {boolean=} notMerge 多次调用时option选项是默认是合并(merge)的, * 如果不需求,可以通过notMerger参数为true阻止与上次option的合并 */ - setOption : function (option, notMerge) { + setOption: function (option, notMerge) { if (!option.timeline) { return this._setOption(option, notMerge); } @@ -24259,7 +25646,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool * @param {boolean=} notMerge 多次调用时option选项是默认是合并(merge)的, * 如果不需求,可以通过notMerger参数为true阻止与上次option的合并 */ - _setOption : function (option, notMerge) { + _setOption: function (option, notMerge) { if (!notMerge && this._option) { this._option = zrUtil.merge( this.getOption(), @@ -24298,7 +25685,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * 返回内部持有的当前显示option克隆 */ - getOption : function () { + getOption: function () { var magicOption = zrUtil.clone(this._option); var self = this; @@ -24338,7 +25725,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool * @param {boolean=} notMerge 多次调用时option选项是默认是合并(merge)的, * 如果不需求,可以通过notMerger参数为true阻止与上次option的合并。 */ - setSeries : function (series, notMerge) { + setSeries: function (series, notMerge) { if (!notMerge) { this.setOption({series: series}); } @@ -24352,7 +25739,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * 返回内部持有的当前显示series克隆 */ - getSeries : function () { + getSeries: function () { return this.getOption().series; }, @@ -24360,7 +25747,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool * timelineOption接口,配置图表实例任何可配置选项 * @param {Object} option */ - _setTimelineOption : function(option) { + _setTimelineOption: function(option) { this._timeline && this._timeline.dispose(); var Timeline = require('./component/timeline'); var timeline = new Timeline( @@ -24381,7 +25768,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool * @param {boolean=} dataGrow 是否增长数据队列长度,默认,不指定或false时移出目标数组对位数据 * @param {string=} additionData 是否增加类目轴(饼图为图例)数据,附加操作同isHead和dataGrow */ - addData : function (seriesIdx, data, isHead, dataGrow, additionData) { + addData: function (seriesIdx, data, isHead, dataGrow, additionData) { var params = seriesIdx instanceof Array ? seriesIdx : [[seriesIdx, data, isHead, dataGrow, additionData]]; @@ -24416,7 +25803,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool var legend; var legendData; - if (seriesItem.type == ecConfig.CHART_TYPE_PIE + if (seriesItem.type === ecConfig.CHART_TYPE_PIE && (legend = optionRestore.legend) && (legendData = legend.data) ) { @@ -24438,8 +25825,8 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool var mAxisData; var axisIdx = seriesItem.xAxisIndex || 0; - if (typeof optionRestore.xAxis[axisIdx].type == 'undefined' - || optionRestore.xAxis[axisIdx].type == 'category' + if (optionRestore.xAxis[axisIdx].type == null + || optionRestore.xAxis[axisIdx].type === 'category' ) { axisData = optionRestore.xAxis[axisIdx].data; mAxisData = magicOption.xAxis[axisIdx].data; @@ -24454,7 +25841,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool // y轴类目 axisIdx = seriesItem.yAxisIndex || 0; - if (optionRestore.yAxis[axisIdx].type == 'category') { + if (optionRestore.yAxis[axisIdx].type === 'category') { axisData = optionRestore.yAxis[axisIdx].data; mAxisData = magicOption.yAxis[axisIdx].data; @@ -24511,15 +25898,15 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool * @param {number} seriesIdx 系列索引 * @param {Object} markData [标注 | 标线]对象,支持多个 */ - addMarkPoint : function (seriesIdx, markData) { + addMarkPoint: function (seriesIdx, markData) { return this._addMark(seriesIdx, markData, 'markPoint'); }, - addMarkLine : function (seriesIdx, markData) { + addMarkLine: function (seriesIdx, markData) { return this._addMark(seriesIdx, markData, 'markLine'); }, - _addMark : function (seriesIdx, markData, markType) { + _addMark: function (seriesIdx, markData, markType) { var series = this._option.series; var seriesItem; @@ -24529,18 +25916,16 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool var markOpt = seriesItem[markType]; var markOptR = seriesRItem[markType]; - markOpt = seriesItem[markType] = markOpt || {data: []}; - markOptR = seriesRItem[markType] = markOptR || {data: []}; + markOpt = seriesItem[markType] = markOpt || {data: [ ]}; + markOptR = seriesRItem[markType] = markOptR || {data: [ ]}; for (var key in markData) { - if (key == 'data') { + if (key === 'data') { // 数据concat markOpt.data = markOpt.data.concat(markData.data); markOptR.data = markOptR.data.concat(markData.data); } - else if (typeof markData[key] != 'object' - || typeof markOpt[key] == 'undefined' - ) { + else if (typeof markData[key] != 'object' || markOpt[key] == null) { // 简单类型或新值直接赋值 markOpt[key] = markOptR[key] = markData[key]; } @@ -24563,15 +25948,15 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool * @param {number} seriesIdx 系列索引 * @param {string} markName [标注 | 标线]名称 */ - delMarkPoint : function (seriesIdx, markName) { + delMarkPoint: function (seriesIdx, markName) { return this._delMark(seriesIdx, markName, 'markPoint'); }, - delMarkLine : function (seriesIdx, markName) { + delMarkLine: function (seriesIdx, markName) { return this._delMark(seriesIdx, markName, 'markLine'); }, - _delMark : function (seriesIdx, markName, markType) { + _delMark: function (seriesIdx, markName, markType) { var series = this._option.series; var seriesItem; var mark; @@ -24593,14 +25978,14 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool for (var i = 0, l = dataArray.length; i < l; i++) { var dataItem = dataArray[i]; if (dataItem instanceof Array) { - if (dataItem[0].name == markName[0] - && dataItem[1].name == markName[1] + if (dataItem[0].name === markName[0] + && dataItem[1].name === markName[1] ) { targetIndex = i; break; } } - else if (dataItem.name == markName[0]) { + else if (dataItem.name === markName[0]) { targetIndex = i; break; } @@ -24620,14 +26005,14 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * 获取当前dom */ - getDom : function () { + getDom: function () { return this.dom; }, /** * 获取当前zrender实例,可用于添加额为的shape和深度控制 */ - getZrender : function () { + getZrender: function () { return this._zr; }, @@ -24636,7 +26021,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool * @param {string} imgType 图片类型,支持png|jpeg,默认为png * @return imgDataURL */ - getDataURL : function (imgType) { + getDataURL: function (imgType) { if (!_canvasSupported) { return ''; } @@ -24662,7 +26047,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool } var bgColor = this._option.backgroundColor; - if (bgColor && bgColor.replace(' ','') == 'rgba(0,0,0,0)') { + if (bgColor && bgColor.replace(' ','') === 'rgba(0,0,0,0)') { bgColor = '#fff'; } @@ -24674,7 +26059,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool * @param {string} imgType 图片类型,支持png|jpeg,默认为png * @return img dom */ - getImage : function (imgType) { + getImage: function (imgType) { var title = this._optionRestore.title; var imgDom = document.createElement('img'); imgDom.src = this.getDataURL(imgType); @@ -24687,19 +26072,19 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool * @param {string} imgType 图片类型,支持png|jpeg,默认为png * @return imgDataURL */ - getConnectedDataURL : function (imgType) { + getConnectedDataURL: function (imgType) { if (!this.isConnected()) { return this.getDataURL(imgType); } var tempDom = this.dom; var imgList = { - 'self' : { - img : this.getDataURL(imgType), - left : tempDom.offsetLeft, - top : tempDom.offsetTop, - right : tempDom.offsetLeft + tempDom.offsetWidth, - bottom : tempDom.offsetTop + tempDom.offsetHeight + 'self': { + img: this.getDataURL(imgType), + left: tempDom.offsetLeft, + top: tempDom.offsetTop, + right: tempDom.offsetLeft + tempDom.offsetWidth, + bottom: tempDom.offsetTop + tempDom.offsetHeight } }; @@ -24711,11 +26096,11 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool for (var c in this._connected) { tempDom = this._connected[c].getDom(); imgList[c] = { - img : this._connected[c].getDataURL(imgType), - left : tempDom.offsetLeft, - top : tempDom.offsetTop, - right : tempDom.offsetLeft + tempDom.offsetWidth, - bottom : tempDom.offsetTop + tempDom.offsetHeight + img: this._connected[c].getDataURL(imgType), + left: tempDom.offsetLeft, + top: tempDom.offsetTop, + right: tempDom.offsetLeft + tempDom.offsetWidth, + bottom: tempDom.offsetTop + tempDom.offsetHeight }; minLeft = Math.min(minLeft, imgList[c].left); @@ -24736,17 +26121,17 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool var ImageShape = require('zrender/shape/Image'); for (var c in imgList) { zrImg.addShape(new ImageShape({ - style : { - x : imgList[c].left - minLeft, - y : imgList[c].top - minTop, - image : imgList[c].img + style: { + x: imgList[c].left - minLeft, + y: imgList[c].top - minTop, + image: imgList[c].img } })); } zrImg.render(); var bgColor = this._option.backgroundColor; - if (bgColor && bgColor.replace(/ /g, '') == 'rgba(0,0,0,0)') { + if (bgColor && bgColor.replace(/ /g, '') === 'rgba(0,0,0,0)') { bgColor = '#fff'; } @@ -24766,7 +26151,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool * @param {string} imgType 图片类型,支持png|jpeg,默认为png * @return img dom */ - getConnectedImage : function (imgType) { + getConnectedImage: function (imgType) { var title = this._optionRestore.title; var imgDom = document.createElement('img'); imgDom.src = this.getConnectedDataURL(imgType); @@ -24779,7 +26164,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool * @param {Object} eventName 事件名称 * @param {Object} eventListener 事件响应函数 */ - on : function (eventName, eventListener) { + on: function (eventName, eventListener) { this._messageCenterOutSide.bind(eventName, eventListener, this); return this; }, @@ -24789,7 +26174,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool * @param {Object} eventName 事件名称 * @param {Object} eventListener 事件响应函数 */ - un : function (eventName, eventListener) { + un: function (eventName, eventListener) { this._messageCenterOutSide.unbind(eventName, eventListener); return this; }, @@ -24798,13 +26183,13 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool * 多图联动 * @param connectTarget{ECharts | Array } connectTarget 联动目标 */ - connect : function (connectTarget) { + connect: function (connectTarget) { if (!connectTarget) { return this; } if (!this._connected) { - this._connected = {}; + this._connected = { }; } if (connectTarget instanceof Array) { @@ -24823,7 +26208,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool * 解除多图联动 * @param connectTarget{ECharts | Array } connectTarget 解除联动目标 */ - disConnect : function (connectTarget) { + disConnect: function (connectTarget) { if (!connectTarget || !this._connected) { return this; } @@ -24849,7 +26234,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * 联动事件响应 */ - connectedEventHandler : function (param) { + connectedEventHandler: function (param) { if (param.__echartsId != this.id) { // 来自其他联动图表的事件 this._onevent(param); @@ -24859,7 +26244,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * 是否存在多图联动 */ - isConnected : function () { + isConnected: function () { return !!this._connected; }, @@ -24867,20 +26252,20 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool * 显示loading过渡 * @param {Object} loadingOption */ - showLoading : function (loadingOption) { + showLoading: function (loadingOption) { var effectList = { - bar : require('zrender/loadingEffect/Bar'), - bubble : require('zrender/loadingEffect/Bubble'), - dynamicLine : require('zrender/loadingEffect/DynamicLine'), - ring : require('zrender/loadingEffect/Ring'), - spin : require('zrender/loadingEffect/Spin'), - whirling : require('zrender/loadingEffect/Whirling') + bar: require('zrender/loadingEffect/Bar'), + bubble: require('zrender/loadingEffect/Bubble'), + dynamicLine: require('zrender/loadingEffect/DynamicLine'), + ring: require('zrender/loadingEffect/Ring'), + spin: require('zrender/loadingEffect/Spin'), + whirling: require('zrender/loadingEffect/Whirling') }; this._toolbox.hideDataView(); - loadingOption = loadingOption || {}; + loadingOption = loadingOption || { }; - var textStyle = loadingOption.textStyle || {}; + var textStyle = loadingOption.textStyle || { }; loadingOption.textStyle = textStyle; var finalTextStyle = zrUtil.merge( @@ -24901,11 +26286,11 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool textStyle.y = loadingOption.y; } - loadingOption.effectOption = loadingOption.effectOption || {}; + loadingOption.effectOption = loadingOption.effectOption || { }; loadingOption.effectOption.textStyle = textStyle; var Effect = loadingOption.effect; - if (typeof Effect == 'string' || Effect == null) { + if (typeof Effect === 'string' || Effect == null) { Effect = effectList[loadingOption.effect || 'spin']; } this._zr.showLoading(new Effect(loadingOption.effectOption)); @@ -24915,7 +26300,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * 隐藏loading过渡 */ - hideLoading : function () { + hideLoading: function () { this._zr.hideLoading(); return this; }, @@ -24923,7 +26308,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * 主题设置 */ - setTheme : function (theme) { + setTheme: function (theme) { if (theme) { if (typeof theme === 'string') { // 默认主题 @@ -24935,12 +26320,12 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool } } else { - theme = theme || {}; + theme = theme || { }; } // 复位默认配置 // this._themeConfig会被别的对象引用持有 - // 所以不能改成this._themeConfig = {}; + // 所以不能改成this._themeConfig = { }; for (var key in this._themeConfig) { delete this._themeConfig[key]; } @@ -24949,10 +26334,10 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool } // 颜色数组随theme,不merge - theme.color && (this._themeConfig.color = []); + theme.color && (this._themeConfig.color = [ ]); // 默认标志图形类型列表,不merge - theme.symbolList && (this._themeConfig.symbolList = []); + theme.symbolList && (this._themeConfig.symbolList = [ ]); // 应用新主题 zrUtil.merge(this._themeConfig, zrUtil.clone(theme), true); @@ -24969,7 +26354,7 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool /** * 视图区域大小变化更新,不默认绑定,供使用方按需调用 */ - resize : function () { + resize: function () { var self = this; return function(){ self._clearEffect(); @@ -24996,26 +26381,26 @@ define('echarts/echarts',['require','./config','zrender/tool/util','zrender/tool }; }, - _clearEffect : function() { - this._zr.modLayer(ecConfig.EFFECT_ZLEVEL, {motionBlur : false}); + _clearEffect: function() { + this._zr.modLayer(ecConfig.EFFECT_ZLEVEL, { motionBlur: false }); this._zr.painter.clearLayer(ecConfig.EFFECT_ZLEVEL); }, /** * 清除已渲染内容 ,clear后echarts实例可用 */ - clear : function () { + clear: function () { this._disposeChartList(); this._zr.clear(); - this._option = {}; - this._optionRestore = {}; + this._option = { }; + this._optionRestore = { }; return this; }, /** * 释放,dispose后echarts实例不可用 */ - dispose : function () { + dispose: function () { var key = this.dom.getAttribute(DOM_ATTRIBUTE_KEY); key && delete _instances[key]; @@ -25174,16 +26559,16 @@ define('echarts/chart/gauge',['require','../component/base','./base','../util/sh } Gauge.prototype = { - type : ecConfig.CHART_TYPE_GAUGE, + type: ecConfig.CHART_TYPE_GAUGE, /** * 绘制图形 */ - _buildShape : function () { + _buildShape: function () { var series = this.series; // 复用参数索引 this._paramsMap = {}; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type == ecConfig.CHART_TYPE_GAUGE) { + if (series[i].type === ecConfig.CHART_TYPE_GAUGE) { series[i] = this.reformOption(series[i]); this._buildSingleGauge(i); this.buildMark(i); @@ -25198,14 +26583,14 @@ define('echarts/chart/gauge',['require','../component/base','./base','../util/sh * * @param {number} seriesIndex 系列索引 */ - _buildSingleGauge : function (seriesIndex) { + _buildSingleGauge: function (seriesIndex) { var serie = this.series[seriesIndex]; this._paramsMap[seriesIndex] = { - center : this.parseCenter(this.zr, serie.center), - radius : this.parseRadius(this.zr, serie.radius), - startAngle : serie.startAngle.toFixed(2) - 0, - endAngle : serie.endAngle.toFixed(2) - 0 + center: this.parseCenter(this.zr, serie.center), + radius: this.parseRadius(this.zr, serie.radius), + startAngle: serie.startAngle.toFixed(2) - 0, + endAngle: serie.endAngle.toFixed(2) - 0 }; this._paramsMap[seriesIndex].totalAngle = this._paramsMap[seriesIndex].startAngle - this._paramsMap[seriesIndex].endAngle; @@ -25228,7 +26613,7 @@ define('echarts/chart/gauge',['require','../component/base','./base','../util/sh }, // 轴线 - _buildAxisLine : function (seriesIndex) { + _buildAxisLine: function (seriesIndex) { var serie = this.series[seriesIndex]; if (!serie.axisLine.show) { return; @@ -25266,7 +26651,7 @@ define('echarts/chart/gauge',['require','../component/base','./base','../util/sh }, // 坐标轴分割线 - _buildSplitLine : function (seriesIndex) { + _buildSplitLine: function (seriesIndex) { var serie = this.series[seriesIndex]; if (!serie.splitLine.show) { return; @@ -25296,19 +26681,19 @@ define('echarts/chart/gauge',['require','../component/base','./base','../util/sh sinAngle = Math.sin(angle); cosAngle = Math.cos(angle); this.shapeList.push(new LineShape({ - zlevel : this._zlevelBase + 1, - hoverable : false, - style : { - xStart : center[0] + cosAngle * r, - yStart : center[1] - sinAngle * r, - xEnd : center[0] + cosAngle * r0, - yEnd : center[1] - sinAngle * r0, - strokeColor : color == 'auto' - ? this._getColor(seriesIndex, min + total / splitNumber * i) - : color, - lineType : lineStyle.type, - lineWidth : lineStyle.width, - shadowColor : lineStyle.shadowColor, + zlevel: this._zlevelBase + 1, + hoverable: false, + style: { + xStart: center[0] + cosAngle * r, + yStart: center[1] - sinAngle * r, + xEnd: center[0] + cosAngle * r0, + yEnd: center[1] - sinAngle * r0, + strokeColor: color === 'auto' + ? this._getColor(seriesIndex, min + total / splitNumber * i) + : color, + lineType: lineStyle.type, + lineWidth: lineStyle.width, + shadowColor: lineStyle.shadowColor, shadowBlur: lineStyle.shadowBlur, shadowOffsetX: lineStyle.shadowOffsetX, shadowOffsetY: lineStyle.shadowOffsetY @@ -25318,7 +26703,7 @@ define('echarts/chart/gauge',['require','../component/base','./base','../util/sh }, // 小标记 - _buildAxisTick : function (seriesIndex) { + _buildAxisTick: function (seriesIndex) { var serie = this.series[seriesIndex]; if (!serie.axisTick.show) { return; @@ -25353,19 +26738,19 @@ define('echarts/chart/gauge',['require','../component/base','./base','../util/sh sinAngle = Math.sin(angle); cosAngle = Math.cos(angle); this.shapeList.push(new LineShape({ - zlevel : this._zlevelBase + 1, - hoverable : false, - style : { - xStart : center[0] + cosAngle * r, - yStart : center[1] - sinAngle * r, - xEnd : center[0] + cosAngle * r0, - yEnd : center[1] - sinAngle * r0, - strokeColor : color == 'auto' - ? this._getColor(seriesIndex, min + total / l * i) - : color, - lineType : lineStyle.type, - lineWidth : lineStyle.width, - shadowColor : lineStyle.shadowColor, + zlevel: this._zlevelBase + 1, + hoverable: false, + style: { + xStart: center[0] + cosAngle * r, + yStart: center[1] - sinAngle * r, + xEnd: center[0] + cosAngle * r0, + yEnd: center[1] - sinAngle * r0, + strokeColor: color === 'auto' + ? this._getColor(seriesIndex, min + total / l * i) + : color, + lineType: lineStyle.type, + lineWidth: lineStyle.width, + shadowColor: lineStyle.shadowColor, shadowBlur: lineStyle.shadowBlur, shadowOffsetX: lineStyle.shadowOffsetX, shadowOffsetY: lineStyle.shadowOffsetY @@ -25375,7 +26760,7 @@ define('echarts/chart/gauge',['require','../component/base','./base','../util/sh }, // 坐标轴文本 - _buildAxisLabel : function (seriesIndex) { + _buildAxisLabel: function (seriesIndex) { var serie = this.series[seriesIndex]; if (!serie.axisLabel.show) { return; @@ -25402,31 +26787,33 @@ define('echarts/chart/gauge',['require','../component/base','./base','../util/sh var cosAngle; var value; for (var i = 0; i <= splitNumber; i++) { - value = min + accMath.accMul(accMath.accDiv(total , splitNumber) , i); + value = accMath.accAdd( + min , accMath.accMul(accMath.accDiv(total , splitNumber), i) + ); angle = startAngle - totalAngle / splitNumber * i; sinAngle = Math.sin(angle * Math.PI / 180); cosAngle = Math.cos(angle * Math.PI / 180); angle = (angle + 360) % 360; this.shapeList.push(new TextShape({ - zlevel : this._zlevelBase + 1, - hoverable : false, - style : { - x : center[0] + cosAngle * r0, - y : center[1] - sinAngle * r0, - color : color == 'auto' ? this._getColor(seriesIndex, value) : color, - text : this._getLabelText(serie.axisLabel.formatter, value), - textAlign : (angle >= 110 && angle <= 250) - ? 'left' - : (angle <= 70 || angle >= 290) - ? 'right' - : 'center', - textBaseline : (angle >= 10 && angle <= 170) - ? 'top' - : (angle >= 190 && angle <= 350) - ? 'bottom' - : 'middle', - textFont : textFont, - shadowColor : textStyle.shadowColor, + zlevel: this._zlevelBase + 1, + hoverable: false, + style: { + x: center[0] + cosAngle * r0, + y: center[1] - sinAngle * r0, + color: color === 'auto' ? this._getColor(seriesIndex, value) : color, + text: this._getLabelText(serie.axisLabel.formatter, value), + textAlign: (angle >= 110 && angle <= 250) + ? 'left' + : (angle <= 70 || angle >= 290) + ? 'right' + : 'center', + textBaseline: (angle >= 10 && angle <= 170) + ? 'top' + : (angle >= 190 && angle <= 350) + ? 'bottom' + : 'middle', + textFont: textFont, + shadowColor: textStyle.shadowColor, shadowBlur: textStyle.shadowBlur, shadowOffsetX: textStyle.shadowOffsetX, shadowOffsetY: textStyle.shadowOffsetY @@ -25435,13 +26822,13 @@ define('echarts/chart/gauge',['require','../component/base','./base','../util/sh } }, - _buildPointer : function (seriesIndex) { - var serie = this.series[seriesIndex]; + _buildPointer: function (seriesIndex) { + var serie = this.series[seriesIndex]; if (!serie.pointer.show) { return; } - var total = serie.max - serie.min; - var pointer = serie.pointer; + var total = serie.max - serie.min; + var pointer = serie.pointer; var params = this._paramsMap[seriesIndex]; var length = this.parsePercent(pointer.length, params.radius[1]); @@ -25451,28 +26838,28 @@ define('echarts/chart/gauge',['require','../component/base','./base','../util/sh value = value < serie.max ? value : serie.max; var angle = (params.startAngle - params.totalAngle / total * (value - serie.min)) * Math.PI / 180; - var color = pointer.color == 'auto' + var color = pointer.color === 'auto' ? this._getColor(seriesIndex, value) : pointer.color; var pointShape = new GaugePointerShape({ - zlevel : this._zlevelBase + 1, - style : { - x : center[0], - y : center[1], - r : length, - startAngle : params.startAngle * Math.PI / 180, - angle : angle, - color : color, - width : width, - shadowColor : pointer.shadowColor, + zlevel: this._zlevelBase + 1, + style: { + x: center[0], + y: center[1], + r: length, + startAngle: params.startAngle * Math.PI / 180, + angle: angle, + color: color, + width: width, + shadowColor: pointer.shadowColor, shadowBlur: pointer.shadowBlur, shadowOffsetX: pointer.shadowOffsetX, shadowOffsetY: pointer.shadowOffsetY }, - highlightStyle : { - brushType : 'fill', - width : width > 2 ? 2 : (width / 2), - color : '#fff' + highlightStyle: { + brushType: 'fill', + width: width > 2 ? 2 : (width / 2), + color: '#fff' } }); ecData.pack( @@ -25485,26 +26872,26 @@ define('echarts/chart/gauge',['require','../component/base','./base','../util/sh this.shapeList.push(pointShape); this.shapeList.push(new CircleShape({ - zlevel : this._zlevelBase + 2, - hoverable : false, - style : { - x : center[0], - y : center[1], - r : pointer.width / 2.5, - color : '#fff' + zlevel: this._zlevelBase + 2, + hoverable: false, + style: { + x: center[0], + y: center[1], + r: pointer.width / 2.5, + color: '#fff' } })); }, - _buildTitle : function(seriesIndex) { + _buildTitle: function(seriesIndex) { var serie = this.series[seriesIndex]; if (!serie.title.show) { return; } var data = serie.data[0]; - var name = typeof data.name != 'undefined' ? data.name : ''; - if (name !== '') { + var name = data.name != null ? data.name : ''; + if (name !== '') { // 不要帮我代码规范 var title = serie.title; var offsetCenter = title.offsetCenter; var textStyle = title.textStyle; @@ -25513,18 +26900,18 @@ define('echarts/chart/gauge',['require','../component/base','./base','../util/sh var x = params.center[0] + this.parsePercent(offsetCenter[0], params.radius[1]); var y = params.center[1] + this.parsePercent(offsetCenter[1], params.radius[1]); this.shapeList.push(new TextShape({ - zlevel : this._zlevelBase + zlevel: this._zlevelBase + (Math.abs(x - params.center[0]) + Math.abs(y - params.center[1])) < textStyle.fontSize * 2 ? 2 : 1, - hoverable : false, - style : { - x : x, - y : y, - color: textColor == 'auto' ? this._getColor(seriesIndex) : textColor, + hoverable: false, + style: { + x: x, + y: y, + color: textColor === 'auto' ? this._getColor(seriesIndex) : textColor, text: name, textAlign: 'center', - textFont : this.getFont(textStyle), - shadowColor : textStyle.shadowColor, + textFont: this.getFont(textStyle), + shadowColor: textStyle.shadowColor, shadowBlur: textStyle.shadowBlur, shadowOffsetX: textStyle.shadowOffsetX, shadowOffsetY: textStyle.shadowOffsetY @@ -25533,7 +26920,7 @@ define('echarts/chart/gauge',['require','../component/base','./base','../util/sh } }, - _buildDetail : function(seriesIndex) { + _buildDetail: function(seriesIndex) { var serie = this.series[seriesIndex]; if (!serie.detail.show) { return; @@ -25552,22 +26939,22 @@ define('echarts/chart/gauge',['require','../component/base','./base','../util/sh var y = params.center[1] + this.parsePercent(offsetCenter[1], params.radius[1]); this.shapeList.push(new RectangleShape({ - zlevel : this._zlevelBase - + (Math.abs(x+detail.width/2 - params.center[0]) - + Math.abs(y+detail.height/2 - params.center[1])) - < textStyle.fontSize ? 2 : 1, - hoverable : false, - style : { - x : x, - y : y, - width : detail.width, - height : detail.height, + zlevel: this._zlevelBase + + (Math.abs(x+detail.width/2 - params.center[0]) + + Math.abs(y+detail.height/2 - params.center[1])) < textStyle.fontSize + ? 2 : 1, + hoverable: false, + style: { + x: x, + y: y, + width: detail.width, + height: detail.height, brushType: 'both', - color: color == 'auto' ? this._getColor(seriesIndex, value) : color, - lineWidth : detail.borderWidth, - strokeColor : detail.borderColor, + color: color === 'auto' ? this._getColor(seriesIndex, value) : color, + lineWidth: detail.borderWidth, + strokeColor: detail.borderColor, - shadowColor : detail.shadowColor, + shadowColor: detail.shadowColor, shadowBlur: detail.shadowBlur, shadowOffsetX: detail.shadowOffsetX, shadowOffsetY: detail.shadowOffsetY, @@ -25575,20 +26962,20 @@ define('echarts/chart/gauge',['require','../component/base','./base','../util/sh text: this._getLabelText(detail.formatter, value), textFont: this.getFont(textStyle), textPosition: 'inside', - textColor : textColor == 'auto' ? this._getColor(seriesIndex, value) : textColor + textColor: textColor === 'auto' ? this._getColor(seriesIndex, value) : textColor } })); }, - _getValue : function(seriesIndex) { + _getValue: function(seriesIndex) { var data = this.series[seriesIndex].data[0]; - return typeof data.value != 'undefined' ? data.value : data; + return data.value != null ? data.value : data; }, /** * 颜色索引 */ - _colorMap : function (seriesIndex) { + _colorMap: function (seriesIndex) { var serie = this.series[seriesIndex]; var min = serie.min; var total = serie.max - min; @@ -25606,8 +26993,8 @@ define('echarts/chart/gauge',['require','../component/base','./base','../util/sh /** * 自动颜色 */ - _getColor : function (seriesIndex, value) { - if (typeof value == 'undefined') { + _getColor: function (seriesIndex, value) { + if (value == null) { value = this._getValue(seriesIndex); } @@ -25623,20 +27010,20 @@ define('echarts/chart/gauge',['require','../component/base','./base','../util/sh /** * 构建扇形 */ - _getSector : function (center, r0, r, startAngle, endAngle, color, lineStyle) { + _getSector: function (center, r0, r, startAngle, endAngle, color, lineStyle) { return new SectorShape ({ - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : center[0], // 圆心横坐标 - y : center[1], // 圆心纵坐标 - r0 : r0, // 圆环内半径 - r : r, // 圆环外半径 - startAngle : startAngle, - endAngle : endAngle, - brushType : 'fill', - color : color, - shadowColor : lineStyle.shadowColor, + zlevel: this._zlevelBase, + hoverable: false, + style: { + x: center[0], // 圆心横坐标 + y: center[1], // 圆心纵坐标 + r0: r0, // 圆环内半径 + r: r, // 圆环外半径 + startAngle: startAngle, + endAngle: endAngle, + brushType: 'fill', + color: color, + shadowColor: lineStyle.shadowColor, shadowBlur: lineStyle.shadowBlur, shadowOffsetX: lineStyle.shadowOffsetX, shadowOffsetY: lineStyle.shadowOffsetY @@ -25647,12 +27034,12 @@ define('echarts/chart/gauge',['require','../component/base','./base','../util/sh /** * 根据lable.format计算label text */ - _getLabelText : function (formatter, value) { + _getLabelText: function (formatter, value) { if (formatter) { - if (typeof formatter == 'function') { + if (typeof formatter === 'function') { return formatter.call(this.myChart, value); } - else if (typeof formatter == 'string') { + else if (typeof formatter === 'string') { return formatter.replace('{value}', value); } } @@ -25662,7 +27049,7 @@ define('echarts/chart/gauge',['require','../component/base','./base','../util/sh /** * 刷新 */ - refresh : function (newOption) { + refresh: function (newOption) { if (newOption) { this.option = newOption; this.series = newOption.series; @@ -25720,11 +27107,11 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s } Funnel.prototype = { - type : ecConfig.CHART_TYPE_FUNNEL, + type: ecConfig.CHART_TYPE_FUNNEL, /** * 绘制图形 */ - _buildShape : function () { + _buildShape: function () { var series = this.series; var legend = this.component.legend; // 复用参数索引 @@ -25734,12 +27121,11 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s var serieName; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type == ecConfig.CHART_TYPE_FUNNEL) { + if (series[i].type === ecConfig.CHART_TYPE_FUNNEL) { series[i] = this.reformOption(series[i]); serieName = series[i].name || ''; // 系列图例开关 - this.selectedMap[serieName] = - legend ? legend.isSelected(serieName) : true; + this.selectedMap[serieName] = legend ? legend.isSelected(serieName) : true; if (!this.selectedMap[serieName]) { continue; } @@ -25756,14 +27142,14 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s * * @param {number} seriesIndex 系列索引 */ - _buildSingleFunnel : function (seriesIndex) { + _buildSingleFunnel: function (seriesIndex) { var legend = this.component.legend; var serie = this.series[seriesIndex]; var data = this._mapData(seriesIndex); var location = this._getLocation(seriesIndex); this._paramsMap[seriesIndex] = { - location : location, - data : data + location: location, + data: data }; var itemName; @@ -25792,10 +27178,10 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s ? (location.height - (total - 1) * gap) / total : location.height; var width; var lastY = location.y; - var lastWidth = serie.sort == 'descending' + var lastWidth = serie.sort === 'descending' ? this._getItemWidth(seriesIndex, selectedData[0].value) : number.parsePercent(serie.minSize, location.width); - var next = serie.sort == 'descending' ? 1 : 0; + var next = serie.sort === 'descending' ? 1 : 0; var centerX = location.centerX; var pointList = [ [ @@ -25812,7 +27198,7 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s if (this.selectedMap[itemName] && !isNaN(selectedData[i].value)) { width = i <= l - 2 ? this._getItemWidth(seriesIndex, selectedData[i + next].value) - : serie.sort == 'descending' + : serie.sort === 'descending' ? number.parsePercent(serie.minSize, location.width) : number.parsePercent(serie.maxSize, location.width); this._buildItem( @@ -25842,24 +27228,24 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s } }, - _buildFunnelCase : function(seriesIndex) { + _buildFunnelCase: function(seriesIndex) { var serie = this.series[seriesIndex]; if (this.deepQuery([serie, this.option], 'calculable')) { var location = this._paramsMap[seriesIndex].location; var gap = 10; var funnelCase = { - hoverable : false, - style : { - pointListd : [ + hoverable: false, + style: { + pointListd: [ [location.x - gap, location.y - gap], [location.x + location.width + gap, location.y - gap], [location.x + location.width + gap, location.y + location.height + gap], [location.x - gap, location.y + location.height + gap] ], - brushType : 'stroke', - lineWidth : 1, - strokeColor : serie.calculableHolderColor - || this.ecTheme.calculableHolderColor + brushType: 'stroke', + lineWidth: 1, + strokeColor: serie.calculableHolderColor + || this.ecTheme.calculableHolderColor } }; ecData.pack(funnelCase, serie, seriesIndex, undefined, -1); @@ -25878,7 +27264,7 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s var y = this.parsePercent(gridOption.y, zrHeight); var width; - if (typeof gridOption.width == 'undefined') { + if (gridOption.width == null) { width = zrWidth - x - this.parsePercent(gridOption.x2, zrWidth); } else { @@ -25886,7 +27272,7 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s } var height; - if (typeof gridOption.height == 'undefined') { + if (gridOption.height == null) { height = zrHeight - y - this.parsePercent(gridOption.y2, zrHeight); } else { @@ -25894,25 +27280,25 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s } return { - x : x, - y : y, - width : width, - height : height, - centerX : x + width / 2 + x: x, + y: y, + width: width, + height: height, + centerX: x + width / 2 }; }, - _mapData : function(seriesIndex) { + _mapData: function(seriesIndex) { var serie = this.series[seriesIndex]; var funnelData = zrUtil.clone(serie.data); for (var i = 0, l = funnelData.length; i < l; i++) { funnelData[i]._index = i; } function numDescending (a, b) { - if (a.value == '-') { + if (a.value === '-') { return 1; } - else if (b.value == '-') { + else if (b.value === '-') { return -1; } return b.value - a.value; @@ -25921,7 +27307,7 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s return -numDescending(a, b); } if (serie.sort != 'none') { - funnelData.sort(serie.sort == 'descending' ? numDescending : numAscending); + funnelData.sort(serie.sort === 'descending' ? numDescending : numAscending); } return funnelData; @@ -25930,7 +27316,7 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s /** * 构建单个扇形及指标 */ - _buildItem : function ( + _buildItem: function ( seriesIndex, dataIndex, defaultColor, x, y, topWidth, bottomWidth, height ) { @@ -25996,7 +27382,7 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s /** * 根据值计算宽度 */ - _getItemWidth : function (seriesIndex, value) { + _getItemWidth: function (seriesIndex, value) { var serie = this.series[seriesIndex]; var location = this._paramsMap[seriesIndex].location; var min = serie.min; @@ -26009,7 +27395,7 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s /** * 构建扇形 */ - getPolygon : function ( + getPolygon: function ( seriesIndex, dataIndex, defaultColor, x, y, topWidth, bottomWidth, height ) { @@ -26030,30 +27416,30 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s || defaultColor; var emphasisColor = this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data) - || (typeof normalColor == 'string' + || (typeof normalColor === 'string' ? zrColor.lift(normalColor, -0.2) : normalColor ); var polygon = { - zlevel : this._zlevelBase, - clickable : true, - style : { - pointList : [ + zlevel: this._zlevelBase, + clickable: this.deepQuery(queryTarget, 'clickable'), + style: { + pointList: [ [x, y], [x + topWidth, y], [x + topWidth - (topWidth - bottomWidth) / 2, y + height], [x + (topWidth - bottomWidth) / 2, y + height] ], - brushType : 'both', - color : normalColor, - lineWidth : normal.borderWidth, - strokeColor : normal.borderColor + brushType: 'both', + color: normalColor, + lineWidth: normal.borderWidth, + strokeColor: normal.borderColor }, - highlightStyle : { - color : emphasisColor, - lineWidth : emphasis.borderWidth, - strokeColor : emphasis.borderColor + highlightStyle: { + color: emphasisColor, + lineWidth: emphasis.borderWidth, + strokeColor: emphasis.borderColor } }; @@ -26068,7 +27454,7 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s /** * 需要显示则会有返回构建好的shape,否则返回undefined */ - getLabel : function ( + getLabel: function ( seriesIndex, dataIndex, defaultColor, x, y, topWidth, bottomWidth, height ) { @@ -26093,7 +27479,7 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s var textColor = defaultColor; labelControl.position = labelControl.position || itemStyle.normal.label.position; - if (labelControl.position == 'inner' || labelControl.position == 'inside') { + if (labelControl.position === 'inner' || labelControl.position === 'inside') { // 内部 textAlign = 'center'; textX = x + topWidth / 2; @@ -26104,31 +27490,31 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s textColor = zrColor.reverse(defaultColor); } } - else if (labelControl.position == 'left'){ + else if (labelControl.position === 'left'){ // 左侧显示 textAlign = 'right'; - textX = lineLength == 'auto' + textX = lineLength === 'auto' ? (location.x - 10) : (location.centerX - Math.max(topWidth, bottomWidth) / 2 - lineLength); } else { - // 右侧显示,默认 labelControl.position == 'outer' || 'right) + // 右侧显示,默认 labelControl.position === 'outer' || 'right) textAlign = 'left'; - textX = lineLength == 'auto' + textX = lineLength === 'auto' ? (location.x + location.width + 10) : (location.centerX + Math.max(topWidth, bottomWidth) / 2 + lineLength); } var textShape = { - zlevel : this._zlevelBase + 1, - style : { - x : textX, - y : y + height / 2, - color : textStyle.color || textColor, - text : text, - textAlign : textStyle.align || textAlign, - textBaseline : textStyle.baseline || 'middle', - textFont : textFont + zlevel: this._zlevelBase + 1, + style: { + x: textX, + y: y + height / 2, + color: textStyle.color || textColor, + text: text, + textAlign: textStyle.align || textAlign, + textBaseline: textStyle.baseline || 'middle', + textFont: textFont } }; @@ -26142,7 +27528,7 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s text = this.getLabelText(seriesIndex, dataIndex, status); textFont = this.getFont(textStyle); textColor = defaultColor; - if (labelControl.position == 'inner' || labelControl.position == 'inside') { + if (labelControl.position === 'inner' || labelControl.position === 'inside') { // 内部 textAlign = 'center'; textX = x + topWidth / 2; @@ -26153,27 +27539,27 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s textColor = zrColor.reverse(defaultColor); } } - else if (labelControl.position == 'left'){ + else if (labelControl.position === 'left'){ // 左侧显示 textAlign = 'right'; - textX = lineLength == 'auto' + textX = lineLength === 'auto' ? (location.x - 10) : (location.centerX - Math.max(topWidth, bottomWidth) / 2 - lineLength); } else { - // 右侧显示,默认 labelControl.position == 'outer' || 'right) + // 右侧显示,默认 labelControl.position === 'outer' || 'right) textAlign = 'left'; - textX = lineLength == 'auto' + textX = lineLength === 'auto' ? (location.x + location.width + 10) : (location.centerX + Math.max(topWidth, bottomWidth) / 2 + lineLength); } textShape.highlightStyle = { - x : textX, - color : textStyle.color || textColor, - text : text, - textAlign : textStyle.align || textAlign, - textFont : textFont, - brushType : 'fill' + x: textX, + color: textStyle.color || textColor, + text: text, + textAlign: textStyle.align || textAlign, + textFont: textFont, + brushType: 'fill' }; return new TextShape(textShape); @@ -26182,7 +27568,7 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s /** * 根据lable.format计算label text */ - getLabelText : function (seriesIndex, dataIndex, status) { + getLabelText: function (seriesIndex, dataIndex, status) { var series = this.series; var serie = series[seriesIndex]; var data = serie.data[dataIndex]; @@ -26192,7 +27578,7 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s ); if (formatter) { - if (typeof formatter == 'function') { + if (typeof formatter === 'function') { return formatter.call( this.myChart, serie.name, @@ -26200,7 +27586,7 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s data.value ); } - else if (typeof formatter == 'string') { + else if (typeof formatter === 'string') { formatter = formatter.replace('{a}','{a0}') .replace('{b}','{b0}') .replace('{c}','{c0}'); @@ -26219,7 +27605,7 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s /** * 需要显示则会有返回构建好的shape,否则返回undefined */ - getLabelLine : function ( + getLabelLine: function ( seriesIndex, dataIndex, defaultColor, x, y, topWidth, bottomWidth, height ) { @@ -26242,33 +27628,33 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s labelControl.position = labelControl.position || itemStyle.normal.label.position; var xEnd; - if (labelControl.position == 'inner' || labelControl.position == 'inside') { + if (labelControl.position === 'inner' || labelControl.position === 'inside') { // 内部 xEnd = x + topWidth / 2; } - else if (labelControl.position == 'left'){ + else if (labelControl.position === 'left'){ // 左侧显示 - xEnd = lineLength == 'auto' + xEnd = lineLength === 'auto' ? (location.x - 10) : (location.centerX - Math.max(topWidth, bottomWidth) / 2 - lineLength); } else { - // 右侧显示,默认 labelControl.position == 'outer' || 'right) - xEnd = lineLength == 'auto' + // 右侧显示,默认 labelControl.position === 'outer' || 'right) + xEnd = lineLength === 'auto' ? (location.x + location.width + 10) : (location.centerX + Math.max(topWidth, bottomWidth) / 2 + lineLength); } var lineShape = { - zlevel : this._zlevelBase + 1, - hoverable : false, - style : { - xStart : location.centerX, - yStart : y + height / 2, - xEnd : xEnd, - yEnd : y + height / 2, - strokeColor : lineStyle.color || defaultColor, - lineType : lineStyle.type, - lineWidth : lineStyle.width + zlevel: this._zlevelBase + 1, + hoverable: false, + style: { + xStart: location.centerX, + yStart: y + height / 2, + xEnd: xEnd, + yEnd: y + height / 2, + strokeColor: lineStyle.color || defaultColor, + lineType: lineStyle.type, + lineWidth: lineStyle.width } }; @@ -26280,27 +27666,27 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s labelControl = itemStyle[status].label || labelControl; labelControl.position = labelControl.position; - if (labelControl.position == 'inner' || labelControl.position == 'inside') { + if (labelControl.position === 'inner' || labelControl.position === 'inside') { // 内部 xEnd = x + topWidth / 2; } - else if (labelControl.position == 'left'){ + else if (labelControl.position === 'left'){ // 左侧显示 - xEnd = lineLength == 'auto' + xEnd = lineLength === 'auto' ? (location.x - 10) : (location.centerX - Math.max(topWidth, bottomWidth) / 2 - lineLength); } else { - // 右侧显示,默认 labelControl.position == 'outer' || 'right) - xEnd = lineLength == 'auto' + // 右侧显示,默认 labelControl.position === 'outer' || 'right) + xEnd = lineLength === 'auto' ? (location.x + location.width + 10) : (location.centerX + Math.max(topWidth, bottomWidth) / 2 + lineLength); } lineShape.highlightStyle = { - xEnd : xEnd, - strokeColor : lineStyle.color || defaultColor, - lineType : lineStyle.type, - lineWidth : lineStyle.width + xEnd: xEnd, + strokeColor: lineStyle.color || defaultColor, + lineType: lineStyle.type, + lineWidth: lineStyle.width }; return new LineShape(lineShape); @@ -26312,7 +27698,7 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s * @param {Object} data * @param {boolean} isEmphasis true is 'emphasis' and false is 'normal' */ - _needLabel : function (serie, data, isEmphasis) { + _needLabel: function (serie, data, isEmphasis) { return this.deepQuery( [data, serie], 'itemStyle.' @@ -26327,7 +27713,7 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s * @param {Object} data * @param {boolean} isEmphasis true is 'emphasis' and false is 'normal' */ - _needLabelLine : function (serie, data, isEmphasis) { + _needLabelLine: function (serie, data, isEmphasis) { return this.deepQuery( [data, serie], 'itemStyle.' @@ -26339,7 +27725,7 @@ define('echarts/chart/funnel',['require','../component/base','./base','zrender/s /** * 刷新 */ - refresh : function (newOption) { + refresh: function (newOption) { if (newOption) { this.option = newOption; this.series = newOption.series; @@ -27104,8 +28490,8 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z } ValueAxis.prototype = { - type : ecConfig.COMPONENT_TYPE_AXIS_VALUE, - _buildShape : function () { + type: ecConfig.COMPONENT_TYPE_AXIS_VALUE, + _buildShape: function () { this._hasData = false; this._calculateValue(); if (!this._hasData) { @@ -27123,7 +28509,7 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z }, // 小标记 - _buildAxisTick : function () { + _buildAxisTick: function () { var axShape; var data = this._valueList; var dataLength = this._valueList.length; @@ -27134,7 +28520,7 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z if (this.isHorizontal()) { // 横向 - var yPosition = this.option.position == 'bottom' + var yPosition = this.option.position === 'bottom' ? (tickOption.inside ? (this.grid.getYend() - length - 1) : (this.grid.getYend()) + 1) : (tickOption.inside @@ -27144,16 +28530,16 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z // 亚像素优化 x = this.subPixelOptimize(this.getCoord(data[i]), lineWidth); axShape = { - _axisShape : 'axisTick', - zlevel : this._zlevelBase, - hoverable : false, - style : { - xStart : x, - yStart : yPosition, - xEnd : x, - yEnd : yPosition + length, - strokeColor : color, - lineWidth : lineWidth + _axisShape: 'axisTick', + zlevel: this._zlevelBase, + hoverable: false, + style: { + xStart: x, + yStart: yPosition, + xEnd: x, + yEnd: yPosition + length, + strokeColor: color, + lineWidth: lineWidth } }; this.shapeList.push(new LineShape(axShape)); @@ -27161,7 +28547,7 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z } else { // 纵向 - var xPosition = this.option.position == 'left' + var xPosition = this.option.position === 'left' ? (tickOption.inside ? (this.grid.getX() + 1) : (this.grid.getX() - length - 1)) : (tickOption.inside @@ -27172,16 +28558,16 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z // 亚像素优化 y = this.subPixelOptimize(this.getCoord(data[i]), lineWidth); axShape = { - _axisShape : 'axisTick', - zlevel : this._zlevelBase, - hoverable : false, - style : { - xStart : xPosition, - yStart : y, - xEnd : xPosition + length, - yEnd : y, - strokeColor : color, - lineWidth : lineWidth + _axisShape: 'axisTick', + zlevel: this._zlevelBase, + hoverable: false, + style: { + xStart: xPosition, + yStart: y, + xEnd: xPosition + length, + yEnd: y, + strokeColor: color, + lineWidth: lineWidth } }; this.shapeList.push(new LineShape(axShape)); @@ -27190,7 +28576,7 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z }, // 坐标轴文本 - _buildAxisLabel : function () { + _buildAxisLabel: function () { var axShape; var data = this._valueList; var dataLength = this._valueList.length; @@ -27203,7 +28589,7 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z // 横向 var yPosition; var baseLine; - if (this.option.position == 'bottom') { + if (this.option.position === 'bottom') { yPosition = this.grid.getYend() + margin; baseLine = 'top'; } @@ -27214,24 +28600,24 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z for (var i = 0; i < dataLength; i++) { axShape = { - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : this.getCoord(data[i]), - y : yPosition, - color : typeof textStyle.color == 'function' - ? textStyle.color(data[i]) : textStyle.color, - text : this._valueLabel[i], - textFont : this.getFont(textStyle), - textAlign : textStyle.align || 'center', - textBaseline : textStyle.baseline || baseLine + zlevel: this._zlevelBase, + hoverable: false, + style: { + x: this.getCoord(data[i]), + y: yPosition, + color: typeof textStyle.color === 'function' + ? textStyle.color(data[i]) : textStyle.color, + text: this._valueLabel[i], + textFont: this.getFont(textStyle), + textAlign: textStyle.align || 'center', + textBaseline: textStyle.baseline || baseLine } }; if (rotate) { axShape.style.textAlign = rotate > 0 - ? (this.option.position == 'bottom' + ? (this.option.position === 'bottom' ? 'right' : 'left') - : (this.option.position == 'bottom' + : (this.option.position === 'bottom' ? 'left' : 'right'); axShape.rotation = [ rotate * Math.PI / 180, @@ -27248,7 +28634,7 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z // 纵向 var xPosition; var align; - if (this.option.position == 'left') { + if (this.option.position === 'left') { xPosition = this.grid.getX() - margin; align = 'right'; } @@ -27259,23 +28645,23 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z for (var i = 0; i < dataLength; i++) { axShape = { - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : xPosition, - y : this.getCoord(data[i]), - color : typeof textStyle.color == 'function' - ? textStyle.color(data[i]) : textStyle.color, - text : this._valueLabel[i], - textFont : this.getFont(textStyle), - textAlign : textStyle.align || align, - textBaseline : textStyle.baseline - || (i === 0 && this.option.name !== '') - ? 'bottom' - : (i == (dataLength - 1) - && this.option.name !== '') - ? 'top' - : 'middle' + zlevel: this._zlevelBase, + hoverable: false, + style: { + x: xPosition, + y: this.getCoord(data[i]), + color: typeof textStyle.color === 'function' + ? textStyle.color(data[i]) : textStyle.color, + text: this._valueLabel[i], + textFont: this.getFont(textStyle), + textAlign: textStyle.align || align, + textBaseline: textStyle.baseline + || (i === 0 && this.option.name !== '') + ? 'bottom' + : (i === (dataLength - 1) + && this.option.name !== '') + ? 'top' + : 'middle' } }; @@ -27293,7 +28679,7 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z } }, - _buildSplitLine : function () { + _buildSplitLine: function () { var axShape; var data = this._valueList; var dataLength = this._valueList.length; @@ -27314,16 +28700,16 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z // 亚像素优化 x = this.subPixelOptimize(this.getCoord(data[i]), lineWidth); axShape = { - zlevel : this._zlevelBase, - hoverable : false, - style : { - xStart : x, - yStart : sy, - xEnd : x, - yEnd : ey, - strokeColor : color[i % colorLength], - lineType : lineType, - lineWidth : lineWidth + zlevel: this._zlevelBase, + hoverable: false, + style: { + xStart: x, + yStart: sy, + xEnd: x, + yEnd: ey, + strokeColor: color[i % colorLength], + lineType: lineType, + lineWidth: lineWidth } }; this.shapeList.push(new LineShape(axShape)); @@ -27340,16 +28726,16 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z // 亚像素优化 y = this.subPixelOptimize(this.getCoord(data[i]), lineWidth); axShape = { - zlevel : this._zlevelBase, - hoverable : false, - style : { - xStart : sx, - yStart : y, - xEnd : ex, - yEnd : y, - strokeColor : color[i % colorLength], - lineType : lineType, - lineWidth : lineWidth + zlevel: this._zlevelBase, + hoverable: false, + style: { + xStart: sx, + yStart: y, + xEnd: ex, + yEnd: y, + strokeColor: color[i % colorLength], + lineType: lineType, + lineWidth: lineWidth } }; this.shapeList.push(new LineShape(axShape)); @@ -27357,22 +28743,22 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z } }, - _buildSplitArea : function () { + _buildSplitArea: function () { var axShape; var color = this.option.splitArea.areaStyle.color; if (!(color instanceof Array)) { // 非数组一律认为是单一颜色的字符串,单一颜色则用一个背景,颜色错误不负责啊!!! axShape = { - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : this.grid.getX(), - y : this.grid.getY(), - width : this.grid.getWidth(), - height : this.grid.getHeight(), - color : color - // type : this.option.splitArea.areaStyle.type, + zlevel: this._zlevelBase, + hoverable: false, + style: { + x: this.grid.getX(), + y: this.grid.getY(), + width: this.grid.getWidth(), + height: this.grid.getHeight(), + color: color + // type: this.option.splitArea.areaStyle.type, } }; this.shapeList.push(new RectangleShape(axShape)); @@ -27395,15 +28781,15 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z ? this.getCoord(data[i]) : this.grid.getXend(); axShape = { - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : lastX, - y : y, - width : curX - lastX, - height : height, - color : color[i % colorLength] - // type : this.option.splitArea.areaStyle.type, + zlevel: this._zlevelBase, + hoverable: false, + style: { + x: lastX, + y: y, + width: curX - lastX, + height: height, + color: color[i % colorLength] + // type: this.option.splitArea.areaStyle.type, } }; this.shapeList.push(new RectangleShape(axShape)); @@ -27422,15 +28808,15 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z ? this.getCoord(data[i]) : this.grid.getY(); axShape = { - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : x, - y : curY, - width : width, - height : lastYend - curY, - color : color[i % colorLength] - // type : this.option.splitArea.areaStyle.type + zlevel: this._zlevelBase, + hoverable: false, + style: { + x: x, + y: curY, + width: width, + height: lastYend - curY, + color: color[i % colorLength] + // type: this.option.splitArea.areaStyle.type } }; this.shapeList.push(new RectangleShape(axShape)); @@ -27443,7 +28829,7 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z /** * 极值计算 */ - _calculateValue : function () { + _calculateValue: function () { if (isNaN(this.option.min - 0) || isNaN(this.option.max - 0)) { // 有一个没指定都得算 // 数据整形 @@ -27482,10 +28868,10 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z data[key] = data[key] || []; oriData = this.series[i].data; for (var j = 0, k = oriData.length; j < k; j++) { - value = typeof oriData[j].value != 'undefined' + value = oriData[j].value != null ? oriData[j].value : oriData[j]; - if (this.series[i].type == ecConfig.CHART_TYPE_SCATTER) { + if (this.series[i].type === ecConfig.CHART_TYPE_SCATTER) { if (this.option.xAxisIndex != -1) { data[key].push(value[0]); } @@ -27493,7 +28879,7 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z data[key].push(value[1]); } } - else if (this.series[i].type == ecConfig.CHART_TYPE_K) { + else if (this.series[i].type === ecConfig.CHART_TYPE_K) { data[key].push(value[0]); data[key].push(value[1]); data[key].push(value[2]); @@ -27513,15 +28899,15 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z data[key] = data[key] || []; // scale下还需要记录每一个量 oriData = this.series[i].data; for (var j = 0, k = oriData.length; j < k; j++) { - value = typeof oriData[j].value != 'undefined' + value = oriData[j].value != null ? oriData[j].value : oriData[j]; - if (value == '-') { + if (value === '-') { continue; } value = value - 0; if (value >= 0) { - if (typeof data[keyP][j] != 'undefined') { + if (data[keyP][j] != null) { data[keyP][j] += value; } else { @@ -27529,7 +28915,7 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z } } else { - if (typeof data[keyN][j] != 'undefined') { + if (data[keyN][j] != null) { data[keyN][j] += value; } else { @@ -27568,14 +28954,15 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z } //console.log(this._min,this._max,'vvvvv111111') + var gap = Math.abs(this._max - this._min); this._min = isNaN(this.option.min - 0) - ? (this._min - Math.abs(this._min * this.option.boundaryGap[0])) + ? (this._min - Math.abs(gap * this.option.boundaryGap[0])) : (this.option.min - 0); // 指定min忽略boundaryGay[0] this._max = isNaN(this.option.max - 0) - ? (this._max + Math.abs(this._max * this.option.boundaryGap[1])) + ? (this._max + Math.abs(gap * this.option.boundaryGap[1])) : (this.option.max - 0); // 指定max忽略boundaryGay[1] - if (this._min == this._max) { + if (this._min === this._max) { if (this._max === 0) { // 修复全0数据 this._max = this.option.power > 0 ? this.option.power : 1; @@ -27674,7 +29061,7 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z (this._min == -2.4 && this._max == 0.6) ? 'success' : 'failed'); * -------- */ - _reformValue : function (scale) { + _reformValue: function (scale) { var splitNumber = this.option.splitNumber; var precision = this.option.precision; var splitGap; @@ -27752,7 +29139,7 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z // 正数部分的分隔数 var partSplitNumber = Math.round(this._max / total * splitNumber); // 修正数据范围极度偏正向,留给负数一个 - partSplitNumber -= (partSplitNumber == splitNumber ? 1 : 0); + partSplitNumber -= (partSplitNumber === splitNumber ? 1 : 0); // 修正数据范围极度偏负向,留给正数一个 partSplitNumber += partSplitNumber === 0 ? 1 : 0; splitGap = (Math.ceil(Math.max( @@ -27784,7 +29171,7 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z this._reformLabelData(); }, - _customerValue : function () { + _customerValue: function () { var splitNumber = this.option.splitNumber; var precision = this.option.precision; var splitGap = (this._max - this._min) / splitNumber; @@ -27796,15 +29183,15 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z this._reformLabelData(); }, - _reformLabelData : function () { + _reformLabelData: function () { this._valueLabel = []; var formatter = this.option.axisLabel.formatter; if (formatter) { for (var i = 0, l = this._valueList.length; i < l; i++) { - if (typeof formatter == 'function') { + if (typeof formatter === 'function') { this._valueLabel.push(formatter.call(this.myChart, this._valueList[i])); } - else if (typeof formatter == 'string') { + else if (typeof formatter === 'string') { this._valueLabel.push( formatter.replace('{value}',this._valueList[i]) ); @@ -27820,7 +29207,7 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z }, - getExtremum : function () { + getExtremum: function () { this._calculateValue(); return { min: this._min, @@ -27831,7 +29218,7 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z /** * 刷新 */ - refresh : function (newOption, newSeries) { + refresh: function (newOption, newSeries) { if (newOption) { this.option = this.reformOption(newOption); // 通用字体设置 @@ -27848,7 +29235,7 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z }, // 根据值换算位置 - getCoord : function (value) { + getCoord: function (value) { value = value < this._min ? this._min : value; value = value > this._max ? this._max : value; @@ -27871,14 +29258,14 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z return result; // Math.floor可能引起一些偏差,但性能会更好 /* 准确更重要 - return (value == this._min || value == this._max) + return (value === this._min || value === this._max) ? result : Math.floor(result); */ }, // 根据值换算绝对大小 - getCoordSize : function (value) { + getCoordSize: function (value) { if (!this.isHorizontal()) { // 纵向 return Math.abs(value / (this._max - this._min) * this.grid.getHeight()); @@ -27890,7 +29277,7 @@ define('echarts/component/valueAxis',['require','./base','zrender/shape/Text','z }, // 根据位置换算值 - getValueFromCoord : function(coord) { + getValueFromCoord: function(coord) { var result; if (!this.isHorizontal()) { // 纵向 @@ -27968,56 +29355,56 @@ define('echarts/component/axis',['require','./base','zrender/shape/Line','../con } Axis.prototype = { - type : ecConfig.COMPONENT_TYPE_AXIS, - axisBase : { + type: ecConfig.COMPONENT_TYPE_AXIS, + axisBase: { // 轴线 - _buildAxisLine : function () { + _buildAxisLine: function () { var lineWidth = this.option.axisLine.lineStyle.width; var halfLineWidth = lineWidth / 2; var axShape = { - _axisShape : 'axisLine', - zlevel : this._zlevelBase + 1, - hoverable : false + _axisShape: 'axisLine', + zlevel: this._zlevelBase + 1, + hoverable: false }; switch (this.option.position) { case 'left' : axShape.style = { - xStart : this.grid.getX() - halfLineWidth, - yStart : this.grid.getYend(), - xEnd : this.grid.getX() - halfLineWidth, - yEnd : this.grid.getY(), - lineCap : 'round' + xStart: this.grid.getX() - halfLineWidth, + yStart: this.grid.getYend(), + xEnd: this.grid.getX() - halfLineWidth, + yEnd: this.grid.getY(), + lineCap: 'round' }; break; case 'right' : axShape.style = { - xStart : this.grid.getXend() + halfLineWidth, - yStart : this.grid.getYend(), - xEnd : this.grid.getXend() + halfLineWidth, - yEnd : this.grid.getY(), - lineCap : 'round' + xStart: this.grid.getXend() + halfLineWidth, + yStart: this.grid.getYend(), + xEnd: this.grid.getXend() + halfLineWidth, + yEnd: this.grid.getY(), + lineCap: 'round' }; break; case 'bottom' : axShape.style = { - xStart : this.grid.getX(), - yStart : this.grid.getYend() + halfLineWidth, - xEnd : this.grid.getXend(), - yEnd : this.grid.getYend() + halfLineWidth, - lineCap : 'round' + xStart: this.grid.getX(), + yStart: this.grid.getYend() + halfLineWidth, + xEnd: this.grid.getXend(), + yEnd: this.grid.getYend() + halfLineWidth, + lineCap: 'round' }; break; case 'top' : axShape.style = { - xStart : this.grid.getX(), - yStart : this.grid.getY() - halfLineWidth, - xEnd : this.grid.getXend(), - yEnd : this.grid.getY() - halfLineWidth, - lineCap : 'round' + xStart: this.grid.getX(), + yStart: this.grid.getY() - halfLineWidth, + xEnd: this.grid.getXend(), + yEnd: this.grid.getY() - halfLineWidth, + lineCap: 'round' }; break; } - if (this.option.name !== '') { + if (this.option.name !== '') { // 别帮我代码规范 axShape.style.text = this.option.name; axShape.style.textPosition = this.option.nameLocation; axShape.style.textFont = this.getFont(this.option.nameTextStyle); @@ -28054,7 +29441,7 @@ define('echarts/component/axis',['require','./base','zrender/shape/Line','../con this.shapeList.push(axShape); }, - _axisLabelClickable : function(clickable, axShape) { + _axisLabelClickable: function(clickable, axShape) { if (clickable) { ecData.pack( axShape, undefined, -1, undefined, -1, axShape.style.text @@ -28062,7 +29449,7 @@ define('echarts/component/axis',['require','./base','zrender/shape/Line','../con axShape.hoverable = true; axShape.clickable = true; axShape.highlightStyle = { - color : zrColor.lift(axShape.style.color, 1), + color: zrColor.lift(axShape.style.color, 1), brushType: 'fill' }; return axShape; @@ -28072,15 +29459,15 @@ define('echarts/component/axis',['require','./base','zrender/shape/Line','../con } }, - refixAxisShape : function(zeroX, zeroY) { + refixAxisShape: function(zeroX, zeroY) { if (!this.option.axisLine.onZero) { return; } var tickLength; - if (this.isHorizontal() && typeof zeroY != 'undefined') { + if (this.isHorizontal() && zeroY != null) { // 横向布局调整纵向y for (var i = 0, l = this.shapeList.length; i < l; i++) { - if (this.shapeList[i]._axisShape == 'axisLine') { + if (this.shapeList[i]._axisShape === 'axisLine') { this.shapeList[i].style.yStart = this.shapeList[i].style.yEnd = this.subPixelOptimize( @@ -28088,7 +29475,7 @@ define('echarts/component/axis',['require','./base','zrender/shape/Line','../con ); this.zr.modShape(this.shapeList[i].id); } - else if (this.shapeList[i]._axisShape == 'axisTick') { + else if (this.shapeList[i]._axisShape === 'axisTick') { tickLength = this.shapeList[i].style.yEnd - this.shapeList[i].style.yStart; this.shapeList[i].style.yStart = zeroY - tickLength; @@ -28097,10 +29484,10 @@ define('echarts/component/axis',['require','./base','zrender/shape/Line','../con } } } - if (!this.isHorizontal() && typeof zeroX != 'undefined') { + if (!this.isHorizontal() && zeroX != null) { // 纵向布局调整横向x for (var i = 0, l = this.shapeList.length; i < l; i++) { - if (this.shapeList[i]._axisShape == 'axisLine') { + if (this.shapeList[i]._axisShape === 'axisLine') { this.shapeList[i].style.xStart = this.shapeList[i].style.xEnd = this.subPixelOptimize( @@ -28108,7 +29495,7 @@ define('echarts/component/axis',['require','./base','zrender/shape/Line','../con ); this.zr.modShape(this.shapeList[i].id); } - else if (this.shapeList[i]._axisShape == 'axisTick') { + else if (this.shapeList[i]._axisShape === 'axisTick') { tickLength = this.shapeList[i].style.xEnd - this.shapeList[i].style.xStart; this.shapeList[i].style.xStart = zeroX; @@ -28119,22 +29506,22 @@ define('echarts/component/axis',['require','./base','zrender/shape/Line','../con } }, - getPosition : function () { + getPosition: function () { return this.option.position; }, - isHorizontal : function() { - return this.option.position == 'bottom' || this.option.position == 'top'; + isHorizontal: function() { + return this.option.position === 'bottom' || this.option.position === 'top'; } }, /** * 参数修正&默认值赋值,重载基类方法 * @param {Object} opt 参数 */ - reformOption : function (opt) { + reformOption: function (opt) { // 不写或传了个空数值默认为数值轴 if (!opt || (opt instanceof Array && opt.length === 0)) { - opt = [{type : ecConfig.COMPONENT_TYPE_AXIS_VALUE}]; + opt = [ { type: ecConfig.COMPONENT_TYPE_AXIS_VALUE } ]; } else if (!(opt instanceof Array)){ opt = [opt]; @@ -28145,7 +29532,7 @@ define('echarts/component/axis',['require','./base','zrender/shape/Line','../con opt = [opt[0],opt[1]]; } - if (this.axisType == 'xAxis') { + if (this.axisType === 'xAxis') { // 横轴位置默认配置 if (!opt[0].position // 没配置或配置错 || (opt[0].position != 'bottom' @@ -28154,8 +29541,7 @@ define('echarts/component/axis',['require','./base','zrender/shape/Line','../con opt[0].position = 'bottom'; } if (opt.length > 1) { - opt[1].position = opt[0].position == 'bottom' - ? 'top' : 'bottom'; + opt[1].position = opt[0].position === 'bottom' ? 'top' : 'bottom'; } for (var i = 0, l = opt.length; i < l; i++) { @@ -28176,8 +29562,7 @@ define('echarts/component/axis',['require','./base','zrender/shape/Line','../con } if (opt.length > 1) { - opt[1].position = opt[0].position == 'left' - ? 'right' : 'left'; + opt[1].position = opt[0].position === 'left' ? 'right' : 'left'; } for (var i = 0, l = opt.length; i < l; i++) { @@ -28195,11 +29580,11 @@ define('echarts/component/axis',['require','./base','zrender/shape/Line','../con /** * 刷新 */ - refresh : function (newOption) { + refresh: function (newOption) { var axisOption; if (newOption) { this.option = newOption; - if (this.axisType == 'xAxis') { + if (this.axisType === 'xAxis') { this.option.xAxis = this.reformOption(newOption.xAxis); axisOption = this.option.xAxis; } @@ -28229,7 +29614,7 @@ define('echarts/component/axis',['require','./base','zrender/shape/Line','../con ); } else if (axisOption && axisOption[i]) { - this._axisList[i] = axisOption[i].type == 'category' + this._axisList[i] = axisOption[i].type === 'category' ? new CategoryAxis( this.ecTheme, this.messageCenter, this.zr, axisOption[i], this.myChart, this.axisBase @@ -28248,11 +29633,11 @@ define('echarts/component/axis',['require','./base','zrender/shape/Line','../con * 根据值换算位置 * @param {number} idx 坐标轴索引0~1 */ - getAxis : function (idx) { + getAxis: function (idx) { return this._axisList[idx]; }, - clear : function () { + clear: function () { for (var i = 0, l = this._axisList.length; i < l; i++) { this._axisList[i].dispose && this._axisList[i].dispose(); } @@ -28299,45 +29684,52 @@ define('echarts/component/grid',['require','./base','zrender/shape/Rectangle','. } Grid.prototype = { - type : ecConfig.COMPONENT_TYPE_GRID, + type: ecConfig.COMPONENT_TYPE_GRID, - getX : function () { + getX: function () { return this._x; }, - getY : function () { + getY: function () { return this._y; }, - getWidth : function () { + getWidth: function () { return this._width; }, - getHeight : function () { + getHeight: function () { return this._height; }, - getXend : function () { + getXend: function () { return this._x + this._width; }, - getYend : function () { + getYend: function () { return this._y + this._height; }, - getArea : function () { + getArea: function () { return { - x : this._x, - y : this._y, - width : this._width, - height : this._height + x: this._x, + y: this._y, + width: this._width, + height: this._height }; }, + getBbox: function() { + return [ + [ this._x, this._y ], + [ this.getXend(), this.getYend() ] + ]; + }, + /** * 实在找不到合适的地方做了,各种粗暴的写法~ -_- */ - refixAxisShape : function(component) { + refixAxisShape: function(component) { var zeroX; var zeroY; var axisList = component.xAxis._axisList.concat(component.yAxis._axisList); @@ -28362,7 +29754,7 @@ define('echarts/component/grid',['require','./base','zrender/shape/Rectangle','. } }, - refresh : function (newOption) { + refresh: function (newOption) { if (newOption || this._zrWidth != this.zr.getWidth() || this._zrHeight != this.zr.getHeight() @@ -28386,6 +29778,7 @@ define('echarts/component/grid',['require','./base','zrender/shape/Rectangle','. else { this._width = this.parsePercent(gridOption.width, this._zrWidth); } + this._width = this._width <= 0 ? 10 : this._width; if (typeof gridOption.height == 'undefined') { this._height = this._zrHeight - this._y - y2; @@ -28393,23 +29786,24 @@ define('echarts/component/grid',['require','./base','zrender/shape/Rectangle','. else { this._height = this.parsePercent(gridOption.height, this._zrHeight); } + this._height = this._height <= 0 ? 10 : this._height; this._x = this.subPixelOptimize(this._x, gridOption.borderWidth); this._y = this.subPixelOptimize(this._y, gridOption.borderWidth); this.shapeList.push(new RectangleShape({ - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : this._x, - y : this._y, - width : this._width, - height : this._height, - brushType : gridOption.borderWidth > 0 ? 'both' : 'fill', - color : gridOption.backgroundColor, + zlevel: this._zlevelBase, + hoverable: false, + style: { + x: this._x, + y: this._y, + width: this._width, + height: this._height, + brushType: gridOption.borderWidth > 0 ? 'both' : 'fill', + color: gridOption.backgroundColor, strokeColor: gridOption.borderColor, - lineWidth : gridOption.borderWidth - // type : this.option.splitArea.areaStyle.type, + lineWidth: gridOption.borderWidth + // type: this.option.splitArea.areaStyle.type, } })); this.zr.addShape(this.shapeList[0]); @@ -28713,11 +30107,13 @@ define('echarts/component/dataZoom',['require','./base','zrender/shape/Rectangle var axisOption = zrUtil.clone(this.option.xAxis); if (axisOption instanceof Array) { axisOption[0].type = 'value'; + axisOption[0].scale = true; axisOption[0].boundary = [0, 0]; axisOption[1] && (axisOption[1].type = 'value', axisOption[1].boundary = [0, 0]); } else { axisOption.type = 'value'; + axisOption.scale = true; axisOption.boundary = [0, 0]; } var vAxis = new Axis( @@ -28739,10 +30135,12 @@ define('echarts/component/dataZoom',['require','./base','zrender/shape/Rectangle axisOption = zrUtil.clone(this.option.yAxis); if (axisOption instanceof Array) { axisOption[0].type = 'value'; + axisOption[0].scale = true; axisOption[1] && (axisOption[1].type = 'value', axisOption[1].boundary = [0, 0]); } else { axisOption.type = 'value'; + axisOption.scale = true; axisOption.boundary = [0, 0]; } vAxis = new Axis( @@ -30879,11 +32277,11 @@ define('echarts/chart/scatter',['require','../component/base','./base','../util/ } Scatter.prototype = { - type : ecConfig.CHART_TYPE_SCATTER, + type: ecConfig.CHART_TYPE_SCATTER, /** * 绘制图形 */ - _buildShape : function () { + _buildShape: function () { var series = this.series; this._sIndex2ColorMap = {}; // series默认颜色索引,seriesIndex索引到color this._symbol = this.option.symbolList; @@ -30901,7 +32299,7 @@ define('echarts/chart/scatter',['require','../component/base','./base','../util/ for (var i = 0, l = series.length; i < l; i++) { serie = series[i]; serieName = serie.name; - if (serie.type == ecConfig.CHART_TYPE_SCATTER) { + if (serie.type === ecConfig.CHART_TYPE_SCATTER) { series[i] = this.reformOption(series[i]); this._sIndex2ShapeMap[i] = this.query(serie, 'symbol') || this._symbol[i % this._symbol.length]; @@ -30963,7 +32361,7 @@ define('echarts/chart/scatter',['require','../component/base','./base','../util/ /** * 构建类目轴为水平方向的散点图系列 */ - _buildSeries : function (seriesArray) { + _buildSeries: function (seriesArray) { if (seriesArray.length === 0) { return; } @@ -30991,12 +32389,12 @@ define('echarts/chart/scatter',['require','../component/base','./base','../util/ pointList[seriesIndex] = []; for (var i = 0, l = serie.data.length; i < l; i++) { data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' + value = data != null + ? (data.value != null ? data.value : data) : '-'; - if (value == '-' || value.length < 2) { + if (value === '-' || value.length < 2) { // 数据格式不符 continue; } @@ -31020,18 +32418,18 @@ define('echarts/chart/scatter',['require','../component/base','./base','../util/ this._buildPointList(pointList); }, - _markMap : function (xAxis, yAxis, data, pointList) { + _markMap: function (xAxis, yAxis, data, pointList) { var xMarkMap = { - min0 : Number.POSITIVE_INFINITY, - max0 : Number.NEGATIVE_INFINITY, - sum0 : 0, - counter0 : 0, - average0 : 0, - min1 : Number.POSITIVE_INFINITY, - max1 : Number.NEGATIVE_INFINITY, - sum1 : 0, - counter1 : 0, - average1 : 0 + min0: Number.POSITIVE_INFINITY, + max0: Number.NEGATIVE_INFINITY, + sum0: 0, + counter0: 0, + average0: 0, + min1: Number.POSITIVE_INFINITY, + max1: Number.NEGATIVE_INFINITY, + sum1: 0, + counter1: 0, + average1: 0 }; var value; for (var i = 0, l = pointList.length; i < l; i++) { @@ -31114,7 +32512,7 @@ define('echarts/chart/scatter',['require','../component/base','./base','../util/ /** * 生成折线和折线上的拐点 */ - _buildPointList : function (pointList) { + _buildPointList: function (pointList) { var series = this.series; var serie; var seriesPL; @@ -31164,7 +32562,7 @@ define('echarts/chart/scatter',['require','../component/base','./base','../util/ /** * 生成折线图上的拐点图形 */ - _getSymbol : function (seriesIndex, dataIndex, name, x, y) { + _getSymbol: function (seriesIndex, dataIndex, name, x, y) { var series = this.series; var serie = series[seriesIndex]; var data = serie.data[dataIndex]; @@ -31196,24 +32594,24 @@ define('echarts/chart/scatter',['require','../component/base','./base','../util/ return itemShape; }, - _getLargeSymbol : function (pointList, nColor) { + _getLargeSymbol: function (pointList, nColor) { return new SymbolShape({ - zlevel : this._zlevelBase, - _main : true, + zlevel: this._zlevelBase, + _main: true, hoverable: false, - style : { - pointList : pointList, - color : nColor, - strokeColor : nColor + style: { + pointList: pointList, + color: nColor, + strokeColor: nColor }, - highlightStyle : { - pointList : [] + highlightStyle: { + pointList: [ ] } }); }, // 位置转换 - getMarkCoord : function (seriesIndex, mpData) { + getMarkCoord: function (seriesIndex, mpData) { var serie = this.series[seriesIndex]; var xMarkMap = this.xMarkMap[seriesIndex]; var xAxis = this.component.xAxis.getAxis(serie.xAxisIndex); @@ -31221,12 +32619,11 @@ define('echarts/chart/scatter',['require','../component/base','./base','../util/ var pos; if (mpData.type - && (mpData.type == 'max' || mpData.type == 'min' || mpData.type == 'average') + && (mpData.type === 'max' || mpData.type === 'min' || mpData.type === 'average') ) { // 特殊值内置支持 // 默认取纵值 - var valueIndex = typeof mpData.valueIndex != 'undefined' - ? mpData.valueIndex : 1; + var valueIndex = mpData.valueIndex != null ? mpData.valueIndex : 1; pos = [ xMarkMap[mpData.type + 'X' + valueIndex], xMarkMap[mpData.type + 'Y' + valueIndex], @@ -31252,7 +32649,7 @@ define('echarts/chart/scatter',['require','../component/base','./base','../util/ /** * 刷新 */ - refresh : function (newOption) { + refresh: function (newOption) { if (newOption) { this.option = newOption; this.series = newOption.series; @@ -31267,7 +32664,7 @@ define('echarts/chart/scatter',['require','../component/base','./base','../util/ * @param {Object} param * @param {Object} status */ - ondataRange : function (param, status) { + ondataRange: function (param, status) { if (this.component.dataRange) { this.refresh(); status.needRefresh = true; @@ -31323,25 +32720,25 @@ define('echarts/chart/k',['require','../component/base','./base','../util/shape/ } K.prototype = { - type : ecConfig.CHART_TYPE_K, + type: ecConfig.CHART_TYPE_K, /** * 绘制图形 */ - _buildShape : function () { + _buildShape: function () { var series = this.series; this.selectedMap = {}; // 水平垂直双向series索引 ,position索引到seriesIndex var _position2sIndexMap = { - top : [], - bottom : [] + top: [ ], + bottom: [ ] }; var xAxis; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type == ecConfig.CHART_TYPE_K) { + if (series[i].type === ecConfig.CHART_TYPE_K) { series[i] = this.reformOption(series[i]); xAxis = this.component.xAxis.getAxis(series[i].xAxisIndex); - if (xAxis.type == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + if (xAxis.type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY ) { _position2sIndexMap[xAxis.getPosition()].push(i); } @@ -31364,7 +32761,7 @@ define('echarts/chart/k',['require','../component/base','./base','../util/shape/ * * @param {number} seriesIndex 系列索引 */ - _buildSinglePosition : function (position, seriesArray) { + _buildSinglePosition: function (position, seriesArray) { var mapData = this._mapData(seriesArray); var locationMap = mapData.locationMap; var maxDataLength = mapData.maxDataLength; @@ -31383,7 +32780,7 @@ define('echarts/chart/k',['require','../component/base','./base','../util/shape/ * 数据整形 * 数组位置映射到系列索引 */ - _mapData : function (seriesArray) { + _mapData: function (seriesArray) { var series = this.series; var serie; // 临时映射变量 var serieName; // 临时映射变量 @@ -31407,15 +32804,15 @@ define('echarts/chart/k',['require','../component/base','./base','../util/shape/ maxDataLength = Math.max(maxDataLength, serie.data.length); } return { - locationMap : locationMap, - maxDataLength : maxDataLength + locationMap: locationMap, + maxDataLength: maxDataLength }; }, /** * 构建类目轴为水平方向的K线图系列 */ - _buildHorizontal : function (seriesArray, maxDataLength, locationMap) { + _buildHorizontal: function (seriesArray, maxDataLength, locationMap) { var series = this.series; // 确定类目轴和数值轴,同一方向随便找一个即可 var seriesIndex; @@ -31447,18 +32844,18 @@ define('echarts/chart/k',['require','../component/base','./base','../util/shape/ pointList[seriesIndex] = []; for (var i = 0, l = maxDataLength; i < l; i++) { - if (typeof categoryAxis.getNameByIndex(i) == 'undefined') { + if (categoryAxis.getNameByIndex(i) == null) { // 系列数据超出类目轴长度 break; } data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' + value = data != null + ? (data.value != null ? data.value : data) : '-'; - if (value == '-' || value.length != 4) { + if (value === '-' || value.length != 4) { // 数据格式不符 continue; } @@ -31481,7 +32878,7 @@ define('echarts/chart/k',['require','../component/base','./base','../util/shape/ /** * 生成K线 */ - _buildKLine : function (seriesArray, pointList) { + _buildKLine: function (seriesArray, pointList) { var series = this.series; // normal: var nLineWidth; @@ -31514,9 +32911,7 @@ define('echarts/chart/k',['require','../component/base','./base','../util/shape/ seriesPL = this._getLargePointList(seriesPL); } - if (serie.type == ecConfig.CHART_TYPE_K - && typeof seriesPL != 'undefined' - ) { + if (serie.type === ecConfig.CHART_TYPE_K && seriesPL != null) { // 多级控制 queryTarget = serie; nLineWidth = this.query( @@ -31638,14 +33033,14 @@ define('echarts/chart/k',['require','../component/base','./base','../util/shape/ // console.log(this.shapeList) }, - _isLarge : function(singlePL) { + _isLarge: function(singlePL) { return singlePL[0][1] < 0.5; }, /** * 大规模pointList优化 */ - _getLargePointList : function(singlePL) { + _getLargePointList: function(singlePL) { var total = this.component.grid.getWidth(); var len = singlePL.length; var newList = []; @@ -31658,7 +33053,7 @@ define('echarts/chart/k',['require','../component/base','./base','../util/shape/ /** * 生成K线图上的图形 */ - _getCandle : function ( + _getCandle: function ( seriesIndex, dataIndex, name, x, width, y0, y1, y2, y3, nColor, nLinewidth, nLineColor, @@ -31666,21 +33061,23 @@ define('echarts/chart/k',['require','../component/base','./base','../util/shape/ ) { var series = this.series; var itemShape = { - zlevel : this._zlevelBase, - clickable: true, - style : { - x : x, - y : [y0, y1, y2, y3], - width : width, - color : nColor, - strokeColor : nLineColor, - lineWidth : nLinewidth, - brushType : 'both' + zlevel: this._zlevelBase, + clickable: this.deepQuery( + [series[seriesIndex].data[dataIndex], series[seriesIndex]], 'clickable' + ), + style: { + x: x, + y: [y0, y1, y2, y3], + width: width, + color: nColor, + strokeColor: nLineColor, + lineWidth: nLinewidth, + brushType: 'both' }, - highlightStyle : { - color : eColor, - strokeColor : eLineColor, - lineWidth : eLinewidth + highlightStyle: { + color: eColor, + strokeColor: eLineColor, + lineWidth: eLinewidth }, _seriesIndex: seriesIndex }; @@ -31696,7 +33093,7 @@ define('echarts/chart/k',['require','../component/base','./base','../util/shape/ }, // 位置转换 - getMarkCoord : function (seriesIndex, mpData) { + getMarkCoord: function (seriesIndex, mpData) { var serie = this.series[seriesIndex]; var xAxis = this.component.xAxis.getAxis(serie.xAxisIndex); var yAxis = this.component.yAxis.getAxis(serie.yAxisIndex); @@ -31715,7 +33112,7 @@ define('echarts/chart/k',['require','../component/base','./base','../util/shape/ /** * 刷新 */ - refresh : function (newOption) { + refresh: function (newOption) { if (newOption) { this.option = newOption; this.series = newOption.series; @@ -31728,7 +33125,7 @@ define('echarts/chart/k',['require','../component/base','./base','../util/shape/ /** * 动画设定 */ - addDataAnimation : function (params) { + addDataAnimation: function (params) { var series = this.series; var aniMap = {}; // seriesIndex索引参数 for (var i = 0, l = params.length; i < l; i++) { @@ -31744,11 +33141,11 @@ define('echarts/chart/k',['require','../component/base','./base','../util/shape/ seriesIndex = this.shapeList[i]._seriesIndex; if (aniMap[seriesIndex] && !aniMap[seriesIndex][3]) { // 有数据删除才有移动的动画 - if (this.shapeList[i].type == 'candle') { + if (this.shapeList[i].type === 'candle') { dataIndex = ecData.get(this.shapeList[i], 'dataIndex'); serie = series[seriesIndex]; if (aniMap[seriesIndex][2] - && dataIndex == serie.data.length - 1 + && dataIndex === serie.data.length - 1 ) { // 队头加入删除末尾 this.zr.delShape(this.shapeList[i].id); @@ -31767,7 +33164,7 @@ define('echarts/chart/k',['require','../component/base','./base','../util/shape/ this.zr.animate(this.shapeList[i].id, '') .when( 500, - {position : [x, y]} + { position: [ x, y ] } ) .start(); } @@ -31974,7 +33371,7 @@ define('echarts/component/polar',['require','./base','zrender/shape/Text','zrend if (axisLabel.show) { style = {}; style.textFont = this.getFont(); - //Todo: bug fix + style = zrUtil.merge(style, axisLabel); style.lineWidth = style.width; @@ -31984,6 +33381,10 @@ define('echarts/component/polar',['require','./base','zrender/shape/Text','zrend offset = axisLabel.offset || 10; interval = axisLabel.interval || 0; + if (!value) { + return; + } + for (var j = 1 ; j <= splitNumber; j += interval + 1) { newStyle = zrUtil.merge({}, style); text = @@ -32843,7 +34244,6 @@ define('echarts/component/polar',['require','./base','zrender/shape/Text','zrend * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 * @author Neil (杨骥, yangji01@baidu.com) - * */ define('echarts/chart/radar',['require','../component/base','./base','zrender/shape/Polygon','../component/polar','../config','../util/ecData','zrender/tool/util','zrender/tool/color','../util/accMath','../chart'],function (require) { @@ -32866,6 +34266,8 @@ define('echarts/component/polar',['require','./base','zrender/shape/Text','zrend * @param {ZRender} zr zrender实例 * @param {Object} series 数据 * @param {Object} component 组件 + * @constructor + * @exports Radar */ function Radar(ecTheme, messageCenter, zr, option, myChart) { // 基类 @@ -32891,8 +34293,8 @@ define('echarts/component/polar',['require','./base','zrender/shape/Text','zrend var series = this.series; var legend = this.component.legend; var serieName; - for (var i = 0, l = series.length; i < l ; i ++) { - if (series[i].type == ecConfig.CHART_TYPE_RADAR) { + for (var i = 0, l = series.length; i < l ; i++) { + if (series[i].type === ecConfig.CHART_TYPE_RADAR) { this.serie = this.reformOption(series[i]); serieName = this.serie.name || ''; // 系列图例开关 @@ -32928,13 +34330,12 @@ define('echarts/component/polar',['require','./base','zrender/shape/Text','zrend var pointList; var calculable = this.deepQuery(this._queryTarget, 'calculable'); - for (var i = 0; i < data.length; i ++) { + for (var i = 0; i < data.length; i++) { name = data[i].name || ''; // 图例开关 this.selectedMap[name] = legend - ? legend.isSelected(name) - : true; + ? legend.isSelected(name) : true; if (!this.selectedMap[name]) { continue; } @@ -32959,7 +34360,8 @@ define('echarts/component/polar',['require','./base','zrender/shape/Text','zrend pointList = this._getPointList(this.serie.polarIndex, data[i]); // 添加拐点形状 - this._addSymbol(pointList, defaultColor, i, index, this.serie.polarIndex); + this._addSymbol( + pointList, defaultColor, i, index, this.serie.polarIndex); // 添加数据形状 this._addDataShape( pointList, defaultColor, data[i], @@ -33001,7 +34403,7 @@ define('echarts/component/polar',['require','./base','zrender/shape/Text','zrend * @param {object} data 数据 * @param {number} serieIndex */ - _addSymbol : function (pointList, defaultColor, dataIndex, seriesIndex, polarIndex) { + _addSymbol :function (pointList, defaultColor, dataIndex, seriesIndex, polarIndex) { var series = this.series; var itemShape; var polar = this.component.polar; @@ -33073,7 +34475,8 @@ define('echarts/component/polar',['require','./base','zrender/shape/Text','zrend brushType : nIsAreaFill ? 'both' : 'stroke', color : nAreaColor || nColor - || zrColor.alpha(defaultColor,0.5), + || (typeof defaultColor === 'string' + ? zrColor.alpha(defaultColor,0.5) : defaultColor), strokeColor : nColor || defaultColor, lineWidth : nLineWidth, lineType : nLineType @@ -33090,7 +34493,8 @@ define('echarts/component/polar',['require','./base','zrender/shape/Text','zrend ) || nAreaColor || nColor - || zrColor.alpha(defaultColor,0.5), + || (typeof defaultColor === 'string' + ? zrColor.alpha(defaultColor,0.5) : defaultColor), strokeColor : this.getItemStyleColor( this.deepQuery( queryTarget, 'itemStyle.emphasis.color' @@ -33158,7 +34562,8 @@ define('echarts/component/polar',['require','./base','zrender/shape/Text','zrend return; } - var target = param.target; // 被拖拽图形元素 + // 被拖拽图形元素 + var target = param.target; var seriesIndex = ecData.get(target, 'seriesIndex'); var dataIndex = ecData.get(target, 'dataIndex'); @@ -33200,7 +34605,7 @@ define('echarts/component/polar',['require','./base','zrender/shape/Text','zrend var legend = this.component.legend; var value; - if (dataIndex == -1) { + if (dataIndex === -1) { data = { value : ecData.get(dragged, 'value'), name : ecData.get(dragged, 'name') @@ -33221,7 +34626,7 @@ define('echarts/component/polar',['require','./base','zrender/shape/Text','zrend data.name += this.option.nameConnector + ecData.get(dragged, 'name'); value = ecData.get(dragged, 'value'); - for (var i = 0 ; i < value.length; i ++) { + for (var i = 0 ; i < value.length; i++) { data.value[i] = accMath.accAdd(data.value[i], value[i]); } @@ -33263,56 +34668,316 @@ define('echarts/component/polar',['require','./base','zrender/shape/Text','zrend return Radar; }); /** - * zrender - * - * @author pissang (https://github.com/pissang) - * - * shape类:chord - * 可配图形属性: - { - // 基础属性 - shape : 'chord', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 + * Path 代理,可以在`buildPath`中用于替代`ctx`, 会保存每个path操作的命令到pathCommands属性中 + * 可以用于 isInsidePath 判断以及获取boundingRect + * + * @module zrender/shape/util/PathProxy + * @author pissang (http://www.github.com/pissang) + * + * @example + * var SomeShape = function() { + * this._pathProxy = new PathProxy(); + * ... + * } + * SomeShape.prototype.buildPath = function(ctx, style) { + * this._pathProxy.begin(ctx); + * .moveTo(style.x, style.y); + * .lineTo(style.x1, style.y1); + * ... + * .closePath(); + * }, + * SomeShape.prototype.getRect = function(style) { + * if (!style._rect) { + * // 这里必须要在 buildPath 之后才能调用 + * style._rect = this._pathProxy.fastBoundingRect(); + * } + * return this.style._rect; + * }, + * SomeShape.prototype.isCover = function(x, y) { + * var rect = this.getRect(this.style); + * if (x >= rect.x + * && x <= (rect.x + rect.width) + * && y >= rect.y + * && y <= (rect.y + rect.height) + * ) { + * return area.isInsidePath( + * this._pathProxy.pathCommands, 0, 'fill', x, y + * ); + * } + * } + */ +define('zrender/shape/util/PathProxy',['require','../../tool/vector'],function (require) { + + var vector = require('../../tool/vector'); + // var computeBoundingBox = require('../../tool/computeBoundingBox'); - // 样式属性,默认状态样式样式属性 - style : { - center : {array}, - source0 : {number}, - source1 : {number}, - target0 : {number}, - target1 : {number}, - r : {number}, - }, + var PathSegment = function(command, points) { + this.command = command; + this.points = points || null; + }; - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } + /** + * @alias module:zrender/shape/tool/PathProxy + * @constructor + */ + var PathProxy = function () { - // 交互属性,详见shape.Base + /** + * Path描述的数组,用于`isInsidePath`的判断 + * @type {Array.} + */ + this.pathCommands = []; - // 事件属性,详见shape.Base - } + this._ctx = null; + + this._min = []; + this._max = []; + }; + + /** + * 快速计算Path包围盒(并不是最小包围盒) + * @return {Object} + */ + PathProxy.prototype.fastBoundingRect = function () { + var min = this._min; + var max = this._max; + min[0] = min[1] = Infinity; + max[0] = max[1] = -Infinity; + for (var i = 0; i < this.pathCommands.length; i++) { + var seg = this.pathCommands[i]; + var p = seg.points; + switch (seg.command) { + case 'M': + vector.min(min, min, p); + vector.max(max, max, p); + break; + case 'L': + vector.min(min, min, p); + vector.max(max, max, p); + break; + case 'C': + for (var j = 0; j < 6; j += 2) { + min[0] = Math.min(min[0], min[0], p[j]); + min[1] = Math.min(min[1], min[1], p[j + 1]); + max[0] = Math.max(max[0], max[0], p[j]); + max[1] = Math.max(max[1], max[1], p[j + 1]); + } + break; + case 'Q': + for (var j = 0; j < 4; j += 2) { + min[0] = Math.min(min[0], min[0], p[j]); + min[1] = Math.min(min[1], min[1], p[j + 1]); + max[0] = Math.max(max[0], max[0], p[j]); + max[1] = Math.max(max[1], max[1], p[j + 1]); + } + break; + case 'A': + var cx = p[0]; + var cy = p[1]; + var rx = p[2]; + var ry = p[3]; + min[0] = Math.min(min[0], min[0], cx - rx); + min[1] = Math.min(min[1], min[1], cy - ry); + max[0] = Math.max(max[0], max[0], cx + rx); + max[1] = Math.max(max[1], max[1], cy + ry); + break; + } + } + + return { + x: min[0], + y: min[1], + width: max[0] - min[0], + height: max[1] - min[1] + }; + }; + + /** + * @param {CanvasRenderingContext2D} ctx + * @return {PathProxy} + */ + PathProxy.prototype.begin = function (ctx) { + this._ctx = ctx || null; + // 清空pathCommands + this.pathCommands.length = 0; + + return this; + }; + + /** + * @param {number} x + * @param {number} y + * @return {PathProxy} + */ + PathProxy.prototype.moveTo = function (x, y) { + this.pathCommands.push(new PathSegment('M', [x, y])); + if (this._ctx) { + this._ctx.moveTo(x, y); + } + return this; + }; + + /** + * @param {number} x + * @param {number} y + * @return {PathProxy} + */ + PathProxy.prototype.lineTo = function (x, y) { + this.pathCommands.push(new PathSegment('L', [x, y])); + if (this._ctx) { + this._ctx.lineTo(x, y); + } + return this; + }; + + /** + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @param {number} x3 + * @param {number} y3 + * @return {PathProxy} + */ + PathProxy.prototype.bezierCurveTo = function (x1, y1, x2, y2, x3, y3) { + this.pathCommands.push(new PathSegment('C', [x1, y1, x2, y2, x3, y3])); + if (this._ctx) { + this._ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3); + } + return this; + }; + + /** + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @return {PathProxy} + */ + PathProxy.prototype.quadraticCurveTo = function (x1, y1, x2, y2) { + this.pathCommands.push(new PathSegment('A', [x1, y1, x2, y2])); + if (this._ctx) { + this._ctx.quadraticCurveTo(x1, y1, x2, y2); + } + return this; + }; + + /** + * @param {number} cx + * @param {number} cy + * @param {number} r + * @param {number} startAngle + * @param {number} endAngle + * @param {boolean} anticlockwise + * @return {PathProxy} + */ + PathProxy.prototype.arc = function (cx, cy, r, startAngle, endAngle, anticlockwise) { + this.pathCommands.push(new PathSegment( + 'A', [cx, cy, r, r, startAngle, endAngle - startAngle, 0, anticlockwise ? 0 : 1] + )); + if (this._ctx) { + this._ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise); + } + return this; + }; + + // TODO + PathProxy.prototype.arcTo = function (x1, y1, x2, y2, radius) { + if (this._ctx) { + this._ctx.arcTo(x1, y1, x2, y2, radius); + } + return this; + }; + + // TODO + PathProxy.prototype.rect = function (x, y, w, h) { + if (this._ctx) { + this._ctx.rect(x, y, w, h); + } + return this; + }; + + /** + * @return {PathProxy} + */ + PathProxy.prototype.closePath = function () { + this.pathCommands.push(new PathSegment('z')); + if (this._ctx) { + this._ctx.closePath(); + } + return this; + }; + + /** + * 是否没有Path命令 + * @return {boolean} + */ + PathProxy.prototype.isEmpty = function() { + return this.pathCommands.length === 0; + }; + + PathProxy.PathSegment = PathSegment; + + return PathProxy; +}); +/** + * @module echarts/util/shape/Ribbon + * @author pissang (https://github.com/pissang) + */ +/** + * @typedef {Object} IRibbonStyle + * @property {number} x + * @property {number} y + * @property {number} source0 + * @property {number} source1 + * @property {number} target0 + * @property {number} target1 + * @property {number} r + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic */ -define('echarts/util/shape/Chord',['require','zrender/shape/Base','zrender/tool/util'],function (require) { +define('echarts/util/shape/Ribbon',['require','zrender/shape/Base','zrender/shape/util/PathProxy','zrender/tool/util','zrender/tool/area'],function (require) { var Base = require('zrender/shape/Base'); + var PathProxy = require('zrender/shape/util/PathProxy'); var zrUtil = require('zrender/tool/util'); - var _ctx = zrUtil.getContext(); + var area = require('zrender/tool/area'); + + // var _ctx = zrUtil.getContext(); - function ChordShape(options) { + function RibbonShape(options) { Base.call(this, options); + + this._pathProxy = new PathProxy(); } - ChordShape.prototype = { + RibbonShape.prototype = { type : 'chord', // center, source0, source1, target0, target1, r buildPath : function (ctx, style) { + + var path = this._pathProxy; + path.begin(ctx); + var PI2 = Math.PI * 2; - var cx = style.center[0]; - var cy = style.center[1]; + var cx = style.x; + var cy = style.y; var r = style.r; var s0 = style.source0 / 180 * Math.PI; var s1 = style.source1 / 180 * Math.PI; @@ -33327,9 +34992,9 @@ define('echarts/util/shape/Chord',['require','zrender/shape/Base','zrender/tool/ var tx1 = cx + Math.cos(PI2 - t1) * r; var ty1 = cy - Math.sin(PI2 - t1) * r; - ctx.moveTo(sx0, sy0); - ctx.arc(cx, cy, style.r, s0, s1, false); - ctx.bezierCurveTo( + path.moveTo(sx0, sy0); + path.arc(cx, cy, style.r, s0, s1, false); + path.bezierCurveTo( (cx - sx1) * 0.70 + sx1, (cy - sy1) * 0.70 + sy1, (cx - tx0) * 0.70 + tx0, @@ -33337,12 +35002,13 @@ define('echarts/util/shape/Chord',['require','zrender/shape/Base','zrender/tool/ tx0, ty0 ); // Chord to self - if (style.source0 === style.target0 && - style.source1 === style.target1) { + if (style.source0 === style.target0 + && style.source1 === style.target1 + ) { return; } - ctx.arc(cx, cy, style.r, t0, t1, false); - ctx.bezierCurveTo( + path.arc(cx, cy, style.r, t0, t1, false); + path.bezierCurveTo( (cx - tx1) * 0.70 + tx1, (cy - ty1) * 0.70 + ty1, (cx - sx0) * 0.70 + sx0, @@ -33351,34 +35017,33 @@ define('echarts/util/shape/Chord',['require','zrender/shape/Base','zrender/tool/ ); }, - getRect : function (){ - return { - x : 0, - y : 0, - width : 0, - height : 0 - }; + getRect : function (style) { + if (style.__rect) { + return style.__rect; + } + if (!this._pathProxy.isEmpty()) { + this.buildPath(null, style); + } + return this._pathProxy.fastBoundingRect(); }, isCover : function (x, y) { - if (!_ctx.isPointInPath) { // In ie - return false; + var rect = this.getRect(this.style); + if (x >= rect.x + && x <= (rect.x + rect.width) + && y >= rect.y + && y <= (rect.y + rect.height) + ) { + return area.isInsidePath( + this._pathProxy.pathCommands, 0, 'fill', x, y + ); } - var originPos = this.getTansform(x, y); - x = originPos[0]; - y = originPos[1]; - - _ctx.beginPath(); - ChordShape.prototype.buildPath.call(null, _ctx, this.style); - _ctx.closePath(); - - return _ctx.isPointInPath(x, y); } }; - zrUtil.inherits(ChordShape, Base); + zrUtil.inherits(RibbonShape, Base); - return ChordShape; + return RibbonShape; }); define('echarts/util/kwargs',[],function (){ function kwargs(func, defaults) { @@ -35742,7 +37407,7 @@ return NDArray; * */ -define('echarts/chart/chord',['require','../component/base','./base','zrender/shape/Text','zrender/shape/Line','zrender/shape/Sector','../util/shape/Chord','../config','../util/ecData','zrender/tool/util','zrender/tool/vector','../util/ndarray','../chart'],function (require) { +define('echarts/chart/chord',['require','../component/base','./base','zrender/shape/Text','zrender/shape/Line','zrender/shape/Sector','../util/shape/Ribbon','../config','../util/ecData','zrender/tool/util','zrender/tool/vector','../util/ndarray','../chart'],function (require) { var ComponentBase = require('../component/base'); @@ -35752,7 +37417,7 @@ define('echarts/chart/chord',['require','../component/base','./base','zrender/sh var TextShape = require('zrender/shape/Text'); var LineShape = require('zrender/shape/Line'); var SectorShape = require('zrender/shape/Sector'); - var ChordShape = require('../util/shape/Chord'); + var RibbonShape = require('../util/shape/Ribbon'); var ecConfig = require('../config'); var ecData = require('../util/ecData'); @@ -35772,11 +37437,11 @@ define('echarts/chart/chord',['require','../component/base','./base','zrender/sh } Chord.prototype = { - type : ecConfig.CHART_TYPE_CHORD, + type: ecConfig.CHART_TYPE_CHORD, /** * 绘制图形 */ - _buildShape : function () { + _buildShape: function () { var series = this.series; this.selectedMap = {}; this.chordSeries = []; @@ -35970,7 +37635,7 @@ define('echarts/chart/chord',['require','../component/base','./base','zrender/sh this.addShapeList(); }, - _filterData : function (dataMat, groups) { + _filterData: function (dataMat, groups) { var indices = []; var groupsFilted = []; // Filter by selected group @@ -36012,7 +37677,7 @@ define('echarts/chart/chord',['require','../component/base','./base','zrender/sh return [dataMat, groupsFilted2]; }, - _buildSectors : function (angles, data) { + _buildSectors: function (angles, data) { var len = this.groups.length; var len2 = this.chordSeries.length; @@ -36092,21 +37757,21 @@ define('echarts/chart/chord',['require','../component/base','./base','zrender/sh var _end = (this.clockWise ? (360 - angle[0]) : angle[1]) + this.startAngle; var sector = { - zlevel : this._zlevelBase, - style : { - x : this.center[0], - y : this.center[1], - r0 : this.innerRadius, - r : this.outerRadius, - startAngle : _start, - endAngle : _end, - brushType : 'fill', + zlevel: this._zlevelBase, + style: { + x: this.center[0], + y: this.center[1], + r0: this.innerRadius, + r: this.outerRadius, + startAngle: _start, + endAngle: _end, + brushType: 'fill', opacity: 1, - color : this.getColor(group.name) + color: this.getColor(group.name) }, - clickable: true, - highlightStyle : { - brushType : 'fill' + clickable: this.chordSerieSample.clickable, + highlightStyle: { + brushType: 'fill' } }; sector.style.lineWidth = this.deepQuery( @@ -36151,12 +37816,12 @@ define('echarts/chart/chord',['require','../component/base','./base','zrender/sh vec2.add(start, start, this.center); var labelShape = { - zlevel : this._zlevelBase - 1, - hoverable : false, - style : { - text : group.name, - textAlign : isRightSide ? 'left' : 'right', - color : labelColor + zlevel: this._zlevelBase - 1, + hoverable: false, + style: { + text: group.name, + textAlign: isRightSide ? 'left' : 'right', + color: labelColor } }; if (rotateLabel) { @@ -36200,9 +37865,9 @@ define('echarts/chart/chord',['require','../component/base','./base','zrender/sh } var len2 = angles[0][0].length; - var chordLineStyle + var ribbonLineStyle = this.chordSerieSample.itemStyle.normal.chordStyle.lineStyle; - var chordLineStyleEmphsis + var ribbonLineStyleEmphsis = this.chordSerieSample.itemStyle.emphasis.chordStyle.lineStyle; for (var i = 0; i < len; i++) { @@ -36218,8 +37883,10 @@ define('echarts/chart/chord',['require','../component/base','./base','zrender/sh var angleIJ1 = angles[i][j][k][1]; var angleJI1 = angles[j][i][k][1]; - if (angleIJ0 - angleJI1 === 0 || - angleJI0 - angleJI1 === 0) { + if ( + angleIJ0 - angleJI1 === 0 + || angleJI0 - angleJI1 === 0 + ) { this.chordShapes[i][j][k] = null; continue; } @@ -36239,25 +37906,26 @@ define('echarts/chart/chord',['require','../component/base','./base','zrender/sh var t0 = !this.clockWise ? (360 - angleJI1) : angleJI0; var t1 = !this.clockWise ? (360 - angleJI0) : angleJI1; var chord = { - zlevel : this._zlevelBase, - style : { - center : this.center, - r : this.innerRadius, - source0 : s0 - this.startAngle, - source1 : s1 - this.startAngle, - target0 : t0 - this.startAngle, - target1 : t1 - this.startAngle, - brushType : 'both', - opacity : 0.5, - color : color, - lineWidth : chordLineStyle.width, - strokeColor : chordLineStyle.color + zlevel: this._zlevelBase, + style: { + x: this.center[0], + y: this.center[1], + r: this.innerRadius, + source0: s0 - this.startAngle, + source1: s1 - this.startAngle, + target0: t0 - this.startAngle, + target1: t1 - this.startAngle, + brushType: 'both', + opacity: 0.5, + color: color, + lineWidth: ribbonLineStyle.width, + strokeColor: ribbonLineStyle.color }, - clickable: true, - highlightStyle : { - brushType : 'both', - lineWidth : chordLineStyleEmphsis.width, - strokeColor : chordLineStyleEmphsis.color + clickable: this.chordSerieSample.clickable, + highlightStyle: { + brushType: 'both', + lineWidth: ribbonLineStyleEmphsis.width, + strokeColor: ribbonLineStyleEmphsis.color } }; @@ -36271,7 +37939,7 @@ define('echarts/chart/chord',['require','../component/base','./base','zrender/sh dataArr[j][i][k] ); - chord = new ChordShape(chord); + chord = new RibbonShape(chord); this.chordShapes[i][j][k] = chord; this.shapeList.push(chord); } @@ -36302,16 +37970,16 @@ define('echarts/chart/chord',['require','../component/base','./base','zrender/sh var end = vec2.scale([], v, this.outerRadius + this.scaleLineLength); vec2.add(end, end, this.center); var scaleShape = { - zlevel : this._zlevelBase - 1, - hoverable : false, - style : { - xStart : start[0], - yStart : start[1], - xEnd : end[0], - yEnd : end[1], - lineCap : 'round', - brushType : 'stroke', - strokeColor : '#666', + zlevel: this._zlevelBase - 1, + hoverable: false, + style: { + xStart: start[0], + yStart: start[1], + xEnd: end[0], + yEnd: end[1], + lineCap: 'round', + brushType: 'stroke', + strokeColor: '#666', lineWidth: 1 } }; @@ -36335,19 +38003,19 @@ define('echarts/chart/chord',['require','../component/base','./base','zrender/sh var isRightSide = thelta <= 90 || thelta >= 270; var textShape = { - zlevel : this._zlevelBase - 1, - hoverable : false, - style : { - x : isRightSide + zlevel: this._zlevelBase - 1, + hoverable: false, + style: { + x: isRightSide ? this.outerRadius + this.scaleLineLength + 4 : -this.outerRadius - this.scaleLineLength - 4, - y : 0, - text : Math.round(scaleValues.shift()*10)/10 + y: 0, + text: Math.round(scaleValues.shift()*10)/10 + unitPostfix, - textAlign : isRightSide ? 'left' : 'right' + textAlign: isRightSide ? 'left' : 'right' }, - position : this.center.slice(), - rotation : isRightSide + position: this.center.slice(), + rotation: isRightSide ? [thelta / 180 * Math.PI, 0, 0] : [ (thelta + 180) / 180 * Math.PI, @@ -36392,28 +38060,9 @@ define('echarts/chart/chord',['require','../component/base','./base','zrender/sh this.series = newOption.series; } - /* - this.legend; - this.getColor; - this.isSelected; - this.chordSerieSample; - */ // Config this.chordSeries = []; - /* - this.groups; - this.startAngle; - this.clockWise; - this.innerRadius; - this.outerRadius; - this.padding; - this.sortGroups; - this.sortSubGroups; - this.center; - this.showScale; - this.showScaleText; - this.dataMat; - */ + this.strokeFix = 0; // Adjacency matrix this.sectorShapes = []; @@ -36500,9 +38149,356 @@ define('echarts/chart/chord',['require','../component/base','./base','zrender/sh return Chord; }); +/** + * 图数据结构 + * @module echarts/data/Graph + * @author pissang(http://www.github.com/pissang) + */ +define('echarts/data/Graph',['require','zrender/tool/util'],function(require) { + + var util = require('zrender/tool/util'); + + + + /** + * @alias module:echarts/data/Graph + * @constructor + * @param {boolean} directed + */ + var Graph = function(directed) { + /** + * 是否是有向图 + * @type {boolean} + * @private + */ + this._directed = directed || false; + + /** + * [nodes description] + * @type {Array} + */ + this.nodes = []; + this.edges = []; + + this._nodesMap = {}; + this._edgesMap = {}; + }; + + /** + * 添加一个新的节点 + * @param {string} name 节点名称 + * @param {*} [data] 存储的数据 + */ + Graph.prototype.addNode = function(name, data) { + if (this._nodesMap[name]) { + return this._nodesMap[name]; + } + + var node = new Graph.Node(name, data); + + this.nodes.push(node); + + this._nodesMap[name] = node; + return node; + }; + + /** + * 获取节点 + * @param {string} name + * @return {module:echarts/data/Graph~Node} + */ + Graph.prototype.getNodeByName = function(name) { + return this._nodesMap[name]; + }; + + /** + * 添加边 + * @param {string|module:echarts/data/Graph~Node} n1 + * @param {string|module:echarts/data/Graph~Node} n2 + * @param {*} data + * @return {module:echarts/data/Graph~Edge} + */ + Graph.prototype.addEdge = function(n1, n2, data) { + if (typeof(n1) == 'string') { + n1 = this._nodesMap[n1]; + } + if (typeof(n2) == 'string') { + n2 = this._nodesMap[n2]; + } + if (!n1 || !n2) { + return; + } + + var key = n1.name + '-' + n2.name; + if (this._edgesMap[key]) { + return this._edgesMap[key]; + } + + var edge = new Graph.Edge(n1, n2, data); + + if (this._directed) { + n1.outEdges.push(edge); + n2.inEdges.push(edge); + } + n1.edges.push(edge); + n2.edges.push(edge); + + this.edges.push(edge); + this._edgesMap[key] = edge; + + return edge; + }; + + /** + * 移除边 + * @param {module:echarts/data/Graph~Edge} edge + */ + Graph.prototype.removeEdge = function(edge) { + var n1 = edge.node1; + var n2 = edge.node2; + var key = n1.name + '-' + n2.name; + if (this._directed) { + n1.outEdges.splice(util.indexOf(n1.outEdges, edge), 1); + n2.inEdges.splice(util.indexOf(n2.inEdges, edge), 1); + } + n1.edges.splice(util.indexOf(n1.edges, edge), 1); + n2.edges.splice(util.indexOf(n2.edges, edge), 1); + + delete this._edgesMap[key]; + this.edges.splice(util.indexOf(this.edges, edge), 1); + }; + + /** + * 移除节点(及其邻接边) + * @param {module:echarts/data/Graph~Node|string} node + */ + Graph.prototype.removeNode = function(node) { + if (typeof(node) === 'string') { + node = this._nodesMap[node]; + if (!node) { + return; + } + } + + delete this._nodesMap[node.name]; + this.nodes.splice(util.indexOf(this.nodes, node), 1); + + for (var i = 0; i < this.edges.length;) { + var edge = this.edges[i]; + if (edge.node1 == node || edge.node2 == node) { + this.removeEdge(edge); + } else { + i++; + } + } + }; + + /** + * 线性遍历所有节点 + * @param {Function} cb + * @param {*} context + */ + Graph.prototype.eachNode = function(cb, context) { + for (var i = 0; i < this.nodes.length; i++) { + cb.call(context, this.nodes[i]); + } + }; + + /** + * 线性遍历所有边 + * @param {Function} cb + * @param {*} context + */ + Graph.prototype.eachEdge = function(cb, context) { + for (var i = 0; i < this.edges.length; i++) { + cb.call(context, this.edges[i]); + } + }; + + /** + * 清空图 + */ + Graph.prototype.clear = function() { + this.nodes.length = 0; + this.edges.length = 0; + + this._nodesMap = {}; + this._edgesMap = {}; + }; + + /** + * 图节点 + * @alias module:echarts/data/Graph~Node + * @param {string} name + * @param {*} [data] + */ + var Node = function(name, data) { + /** + * 节点名称 + * @type {string} + */ + this.name = name; + /** + * 节点存储的数据 + * @type {*} + */ + this.data = data || null; + /** + * 入边,只在有向图上有效 + * @type {Array.} + */ + this.inEdges = []; + /** + * 出边,只在有向图上有效 + * @type {Array.} + */ + this.outEdges = []; + /** + * 邻接边 + * @type {Array.} + */ + this.edges = []; + }; + + /** + * 度 + * @return {number} + */ + Node.prototype.degree = function() { + return this.edges.length; + }; + + /** + * 入度,只在有向图上有效 + * @return {number} + */ + Node.prototype.inDegree = function() { + return this.inEdges.length; + }; + + /** + * 出度,只在有向图上有效 + * @return {number} + */ + Node.prototype.outDegree = function() { + return this.outEdges.length; + }; + + /** + * 图边 + * @alias module:echarts/data/Graph~Edge + * @param {module:echarts/data/Graph~Node} node1 + * @param {module:echarts/data/Graph~Node} node2 + * @param {extra} data + */ + var Edge = function(node1, node2, data) { + /** + * 节点1,如果是有向图则为源节点 + * @type {module:echarts/data/Graph~Node} + */ + this.node1 = node1; + /** + * 节点2,如果是有向图则为目标节点 + * @type {module:echarts/data/Graph~Node} + */ + this.node2 = node2; + + /** + * 边存储的数据 + * @type {*} + */ + this.data = data || null; + }; + + Graph.Node = Node; + Graph.Edge = Edge; + + /** + * 从邻接矩阵生成 + * ``` + * TARGET + * -1--2--3--4--5- + * 1| x x x x x + * 2| x x x x x + * 3| x x x x x SOURCE + * 4| x x x x x + * 5| x x x x x + * ``` + * 节点的行列总和会被写到`node.data.value` + * 对于有向图会计算每一行的和写到`node.data.outValue`, + * 计算每一列的和写到`node.data.inValue`。 + * 边的权重会被然后写到`edge.data.weight`。 + * 如果是有向图被写到`edge.data.sourceWeight`和`edge.data.targetWeight` + * + * @method module:echarts/data/Graph.fromMatrix + * @param {Array.} nodesData 节点信息,必须有`name`属性 + * @param {Array} matrix 邻接矩阵 + * @param {boolean} directed 是否是有向图 + * @return {module:echarts/data/Graph} + */ + Graph.fromMatrix = function(nodesData, matrix, directed) { + if ( + !matrix || !matrix.length + || (matrix[0].length !== matrix.length) + || (nodesData.length !== matrix.length) + ) { + // Not a valid data + return; + } + + var size = matrix.length; + var graph = new Graph(directed); + + for (var i = 0; i < size; i++) { + var node = graph.addNode(nodesData[i].name, {}); + node.data.value = 0; + if (directed) { + node.data.outValue = node.data.inValue = 0; + } + } + for (var i = 0; i < size; i++) { + for (var j = 0; j < size; j++) { + var item = matrix[i][j]; + if (directed) { + graph.nodes[i].outValue += item; + graph.nodes[j].inValue += item; + } + graph.nodes[i].value += item; + graph.nodes[j].value += item; + } + } + + for (var i = 0; i < size; i++) { + for (var j = i; j < size; j++) { + var item = matrix[i][j]; + if (item === 0) { + continue; + } + var n1 = graph.nodes[i]; + var n2 = graph.nodes[j]; + var edge = graph.addEdge(n1, n2, {}); + if (directed) { + edge.data.sourceWeight = item; + edge.data.targetWeight = matrix[j][i]; + } + edge.data.weight = item; + if (i !== j) { + if (directed) { + var inEdge = graph.addEdge(n2, n1, {}); + inEdge.sourceWeight = matrix[j][i]; + inEdge.targetWeight = item; + } + edge.data.weight += matrix[j][i]; + } + } + } + }; + + return Graph; +}); // 1. Graph Drawing by Force-directed Placement // 2. http://webatlas.fr/tempshare/ForceAtlas2_Paper.pdf -define('echarts/chart/forceLayoutWorker',['require','zrender/tool/vector'],function __echartsForceLayoutWorker(require) { +define('echarts/layout/forceLayoutWorker',['require','zrender/tool/vector'],function __echartsForceLayoutWorker(require) { @@ -36575,7 +38571,8 @@ define('echarts/chart/forceLayoutWorker',['require','zrender/tool/vector'],funct return out; } }; - } else { + } + else { vec2 = require('zrender/tool/vector'); } var ArrayCtor = typeof(Float32Array) == 'undefined' ? Array : Float32Array; @@ -36627,7 +38624,8 @@ define('echarts/chart/forceLayoutWorker',['require','zrender/tool/vector'],funct if (this.node == null) { this.node = node; return; - } else { + } + else { this._addNodeToSubRegion(this.node); this.node = null; } @@ -36740,9 +38738,9 @@ define('echarts/chart/forceLayoutWorker',['require','zrender/tool/vector'],funct /**************************** * Class: Graph Edge ***************************/ - function GraphEdge(source, target) { - this.source = source; - this.target = target; + function GraphEdge(node1, node2) { + this.node1 = node1; + this.node2 = node2; this.weight = 1; } @@ -36853,7 +38851,8 @@ define('echarts/chart/forceLayoutWorker',['require','zrender/tool/vector'],funct this._rootRegion.addNode(this.nodes[i]); } this._rootRegion.afterUpdate(); - } else { + } + else { // Update center of mass of whole graph var mass = 0; var centerOfMass = this._rootRegion.centerOfMass; @@ -36880,7 +38879,8 @@ define('echarts/chart/forceLayoutWorker',['require','zrender/tool/vector'],funct var na = this.nodes[i]; if (this.barnesHutOptimize) { this.applyRegionToNodeRepulsion(this._rootRegion, na); - } else { + } + else { for (var j = i + 1; j < nNodes; j++) { var nb = this.nodes[j]; this.applyNodeToNodeRepulsion(na, nb, false); @@ -36947,13 +38947,15 @@ define('echarts/chart/forceLayoutWorker',['require','zrender/tool/vector'],funct return function applyRegionToNodeRepulsion(region, node) { if (region.node) { // Region is a leaf this.applyNodeToNodeRepulsion(region.node, node, true); - } else { + } + else { vec2.sub(v, node.position, region.centerOfMass); var d2 = v[0] * v[0] + v[1] * v[1]; if (d2 > this.barnesHutTheta * region.size * region.size) { var factor = this._k * this._k * (node.mass + region.mass) / (d2 + 1); vec2.scaleAndAdd(node.force, node.force, v, factor * 2); - } else { + } + else { for (var i = 0; i < region.nSubRegions; i++) { this.applyRegionToNodeRepulsion(region.subRegions[i], node); } @@ -36985,11 +38987,13 @@ define('echarts/chart/forceLayoutWorker',['require','zrender/tool/vector'],funct d = d - na.size - nb.size; if (d > 0) { factor = k2 * mass / (d * d); - } else if (d <= 0) { + } + else if (d <= 0) { // A stronger repulsion if overlap factor = k2 * 10 * mass; } - } else { + } + else { // Divide factor by an extra `d` to normalize the `v` factor = k2 * mass / d2; } @@ -37004,8 +39008,8 @@ define('echarts/chart/forceLayoutWorker',['require','zrender/tool/vector'],funct ForceLayout.prototype.applyEdgeAttraction = (function() { var v = vec2.create(); return function applyEdgeAttraction(edge) { - var na = edge.source; - var nb = edge.target; + var na = edge.node1; + var nb = edge.node2; vec2.sub(v, na.position, nb.position); var d = vec2.len(v); @@ -37013,9 +39017,11 @@ define('echarts/chart/forceLayoutWorker',['require','zrender/tool/vector'],funct var w; if (this.edgeWeightInfluence === 0) { w = 1; - } else if (this.edgeWeightInfluence == 1) { + } + else if (this.edgeWeightInfluence == 1) { w = edge.weight; - } else { + } + else { w = Math.pow(edge.weight, this.edgeWeightInfluence); } @@ -37046,7 +39052,8 @@ define('echarts/chart/forceLayoutWorker',['require','zrender/tool/vector'],funct if (this.width > this.height) { // Stronger gravity on y axis v[1] *= this.width / this.height; - } else { + } + else { // Stronger gravity on x axis v[0] *= this.height / this.width; } @@ -37054,7 +39061,8 @@ define('echarts/chart/forceLayoutWorker',['require','zrender/tool/vector'],funct if (this.strongGravity) { vec2.scaleAndAdd(node.force, node.force, v, d * this.gravity * node.mass); - } else { + } + else { vec2.scaleAndAdd(node.force, node.force, v, this.gravity * node.mass / (d + 1)); } }; @@ -37083,13 +39091,22 @@ define('echarts/chart/forceLayoutWorker',['require','zrender/tool/vector'],funct return str.slice(str.indexOf('{') + 1, str.lastIndexOf('return')); }; + ForceLayout.prototype.setToken = function(token) { + this._token = token; + }; + + ForceLayout.prototype.tokenMatch = function(token) { + return token === this._token; + }; + /**************************** * Main process ***************************/ + /* jshint ignore:start */ if (inWorker) { var forceLayout = null; - + self.onmessage = function(e) { // Position read back if (e.data instanceof ArrayBuffer) { @@ -37131,23 +39148,22 @@ define('echarts/chart/forceLayoutWorker',['require','zrender/tool/vector'],funct forceLayout.temperature = e.data.temperature; - if (e.data.temperature > 0.01) { - for (var i = 0; i < steps; i++) { - forceLayout.update(); - forceLayout.temperature *= e.data.coolDown; - } - // Callback - for (var i = 0; i < nNodes; i++) { - var node = forceLayout.nodes[i]; - positionArr[i * 2 + 1] = node.position[0]; - positionArr[i * 2 + 2] = node.position[1]; - } - - positionArr[0] = forceLayout._token; + for (var i = 0; i < steps; i++) { + forceLayout.update(); + forceLayout.temperature *= e.data.coolDown; } + // Callback + for (var i = 0; i < nNodes; i++) { + var node = forceLayout.nodes[i]; + positionArr[i * 2 + 1] = node.position[0]; + positionArr[i * 2 + 2] = node.position[1]; + } + + positionArr[0] = forceLayout._token; self.postMessage(positionArr.buffer, [positionArr.buffer]); - } else { + } + else { // Not initialzied yet var emptyArr = new Float32Array(); // Post transfer object @@ -37157,6 +39173,259 @@ define('echarts/chart/forceLayoutWorker',['require','zrender/tool/vector'],funct } }; } + /* jshint ignore:end */ + + return ForceLayout; +}); +/** + * 力导向布局 + * @module echarts/layout/Force + * @author pissang(http://github.com/pissang) + */ +define('echarts/layout/Force',['require','./forceLayoutWorker','zrender/tool/vector'],function(require) { + + var ForceLayoutWorker = require('./forceLayoutWorker'); + var vec2 = require('zrender/tool/vector'); + + var requestAnimationFrame = window.requestAnimationFrame + || window.msRequestAnimationFrame + || window.mozRequestAnimationFrame + || window.webkitRequestAnimationFrame + || function (func) {setTimeout(func, 16);}; + var ArrayCtor = typeof(Float32Array) == 'undefined' ? Array : Float32Array; + + var workerUrl; + + function getToken() { + return Math.round(Date.now() / 100) % 10000000; + } + + function createWorkerUrl() { + if ( + typeof(Worker) !== 'undefined' && + typeof(Blob) !== 'undefined' + ) { + try { + var blob = new Blob([ForceLayoutWorker.getWorkerCode()]); + workerUrl = window.URL.createObjectURL(blob); + } + catch (e) { + workerUrl = ''; + } + } + + return workerUrl; + } + + var ForceLayout = function(opts) { + + if (typeof(workerUrl) === 'undefined') { + createWorkerUrl(); + } + opts = opts || {}; + // 配置项 + this.width = opts.width || 500; + this.height = opts.height || 500; + this.center = opts.center || [this.width / 2, this.height / 2]; + this.ratioScaling = opts.ratioScaling || false; + this.scaling = opts.scaling || 1; + this.gravity = typeof(opts.gravity) !== 'undefined' + ? opts.gravity : 1; + this.large = opts.large || false; + + this.onupdate = opts.onupdate || function () {}; + this.temperature = opts.temperature || 1; + this.coolDown = opts.coolDown || 0.99; + + this._layout = null; + this._layoutWorker = null; + + this._token = 0; + + var self = this; + var _$onupdate = this._$onupdate; + this._$onupdate = function(e) { + _$onupdate.call(self, e); + }; + }; + + ForceLayout.prototype.updateConfig = function () { + var width = this.width; + var height = this.height; + var size = Math.min(width, height); + + var config = { + center: this.center, + width: this.ratioScaling ? width : size, + height: this.ratioScaling ? height : size, + scaling: this.scaling || 1.0, + gravity: this.gravity || 1.0, + barnesHutOptimize: this.large + }; + + if (this._layoutWorker) { + this._layoutWorker.postMessage({ + cmd: 'updateConfig', + config: config + }); + } + else { + for (var name in config) { + this._layout[name] = config[name]; + } + } + }; + + ForceLayout.prototype.init = function(graph, useWorker) { + if (workerUrl && useWorker) { + try { + if (!this._layoutWorker) { + this._layoutWorker = new Worker(workerUrl); + this._layoutWorker.onmessage = this._$onupdate; + } + this._layout = null; + } + catch (e) { // IE10-11 will throw security error when using blog url + this._layoutWorker = null; + if (!this._layout) { + this._layout = new ForceLayoutWorker(); + } + } + } + else { + if (!this._layout) { + this._layout = new ForceLayoutWorker(); + } + if (this._layoutWorker) { + this._layoutWorker.terminate(); + this._layoutWorker = null; + } + } + + this.temperature = 1; + + this.graph = graph; + + // 节点数据 + var len = graph.nodes.length; + var positionArr = new ArrayCtor(len * 2); + var massArr = new ArrayCtor(len); + var radiusArr = new ArrayCtor(len); + + for (var i = 0; i < len; i++) { + var n = graph.nodes[i]; + positionArr[i * 2] = n.layout.position[0]; + positionArr[i * 2 + 1] = n.layout.position[1]; + massArr[i] = n.layout.mass; + radiusArr[i] = n.layout.radius; + + n.layout.__index = i; + } + // 边数据 + len = graph.edges.length; + var edgeArr = new ArrayCtor(len * 2); + var edgeWeightArr = new ArrayCtor(len); + for (var i = 0; i < len; i++) { + var edge = graph.edges[i]; + edgeArr[i * 2] = edge.node1.layout.__index; + edgeArr[i * 2 + 1] = edge.node2.layout.__index; + edgeWeightArr[i] = edge.layout.weight || 1; + } + + this._token = getToken(); + + if (this._layoutWorker) { + + this._layoutWorker.postMessage({ + cmd: 'init', + nodesPosition: positionArr, + nodesMass: massArr, + nodesSize: radiusArr, + edges: edgeArr, + edgesWeight: edgeWeightArr, + token: this._token + }); + } + else { + this._layout.setToken(this._token); + this._layout.initNodes(positionArr, massArr, radiusArr); + this._layout.initEdges(edgeArr, edgeWeightArr); + } + + this.updateConfig(); + }; + + ForceLayout.prototype.step = function (steps) { + var nodes = this.graph.nodes; + if (this._layoutWorker) { + // Sync back + var positionArr = new ArrayCtor(nodes.length * 2 + 1); + for (var i = 0; i < nodes.length; i++) { + var n = nodes[i]; + positionArr[i * 2 + 1] = n.layout.position[0]; + positionArr[i * 2 + 2] = n.layout.position[1]; + } + this._layoutWorker.postMessage(positionArr.buffer, [positionArr.buffer]); + + this._layoutWorker.postMessage({ + cmd: 'update', + steps: steps, + temperature: this.temperature, + coolDown: this.coolDown + }); + for (var i = 0; i < steps; i++) { + this.temperature *= this.coolDown; + } + } + else { + + requestAnimationFrame(this._$onupdate); + + for (var i = 0; i < nodes.length; i++) { + var n = nodes[i]; + vec2.copy(this._layout.nodes[i].position, n.layout.position); + } + for (var i = 0; i < steps; i++) { + this._layout.temperature = this.temperature; + this._layout.update(); + this.temperature *= this.coolDown; + } + } + }; + + ForceLayout.prototype._$onupdate = function (e) { + if (this._layoutWorker) { + var positionArr = new Float32Array(e.data); + var token = positionArr[0]; + // If token is from current layout instance + if (token === this._token) { + for (var i = 0; i < this.graph.nodes.length; i++) { + var n = this.graph.nodes[i]; + n.layout.position[0] = positionArr[i * 2 + 1]; + n.layout.position[1] = positionArr[i * 2 + 2]; + } + this.onupdate && this.onupdate(); + } + } + else if (this._layout) { + if (this._layout.tokenMatch(this._token)) { + for (var i = 0; i < this.graph.nodes.length; i++) { + var n = this.graph.nodes[i]; + vec2.copy(n.layout.position, this._layout.nodes[i].position); + } + this.onupdate && this.onupdate(); + } + } + }; + + ForceLayout.prototype.dispose = function() { + if (this._layoutWorker) { + this._layoutWorker.terminate(); + } + this._layoutWorker = null; + this._layout = null; + this._token = 0; + }; return ForceLayout; }); @@ -37167,16 +39436,18 @@ define('echarts/chart/forceLayoutWorker',['require','zrender/tool/vector'],funct * */ -define('echarts/chart/force',['require','../component/base','./base','./forceLayoutWorker','zrender/shape/Line','../util/shape/Icon','../config','../util/ecData','zrender/tool/util','zrender/config','zrender/tool/vector','../util/ndarray','../chart'],function (require) { +define('echarts/chart/force',['require','../component/base','./base','../data/Graph','../layout/Force','zrender/shape/Line','zrender/shape/Image','../util/shape/Icon','../config','../util/ecData','zrender/tool/util','zrender/config','zrender/tool/vector','../chart'],function (require) { var ComponentBase = require('../component/base'); var ChartBase = require('./base'); - var ForceLayout = require('./forceLayoutWorker'); + var Graph = require('../data/Graph'); + var ForceLayout = require('../layout/Force'); // 图形依赖 var LineShape = require('zrender/shape/Line'); + var ImageShape = require('zrender/shape/Image'); var IconShape = require('../util/shape/Icon'); var ecConfig = require('../config'); @@ -37185,33 +39456,6 @@ define('echarts/chart/force',['require','../component/base','./base','./forceLay var zrConfig = require('zrender/config'); var vec2 = require('zrender/tool/vector'); - var NDArray = require('../util/ndarray'); - var ArrayCtor = typeof(Float32Array) == 'undefined' ? Array : Float32Array; - - var requestAnimationFrame = window.requestAnimationFrame - || window.msRequestAnimationFrame - || window.mozRequestAnimationFrame - || window.webkitRequestAnimationFrame - || function (func){setTimeout(func, 16);}; - - // Use inline web worker - var workerUrl; - if ( - typeof(Worker) !== 'undefined' && - typeof(Blob) !== 'undefined' - ) { - try { - var blob = new Blob([ForceLayout.getWorkerCode()]); - workerUrl = window.URL.createObjectURL(blob); - } catch(e) { - workerUrl = ''; - } - } - - function getToken() { - return Math.round(new Date().getTime() / 100) % 10000000; - } - /** * 构造函数 * @param {Object} messageCenter echart消息中心 @@ -37227,21 +39471,16 @@ define('echarts/chart/force',['require','../component/base','./base','./forceLay ChartBase.call(this); // 保存节点的位置,改变数据时能够有更好的动画效果 - // TODO this.__nodePositionMap = {}; - this._nodeShapes = []; - this._linkShapes = []; - - this._updating = true; + this._graph = new Graph(true); + this._layout = new ForceLayout(); - this._filteredNodes = null; - this._filteredLinks = null; - this._rawNodes = null; - this._rawLinks = null; + this._layout.onupdate = function() { + self._step(); + }; this._steps = 1; - this._coolDown = 0.99; // 关闭可拖拽属性 this.ondragstart = function() { @@ -37270,52 +39509,12 @@ define('echarts/chart/force',['require','../component/base','./base','./forceLay type : ecConfig.CHART_TYPE_FORCE, _init: function() { - var self = this; - - this.clear(); - - this._updating = true; - - this._buildShape(); - - if (this._layoutWorker) { - this._layoutWorker.onmessage = function(e) { - if (self._temperature < 0.01) { - requestAnimationFrame(function() { - self._step.call(self, e); - }); - } else { - self._step.call(self, e); - } - }; - - this._layoutWorker.postMessage({ - cmd: 'update', - steps: this._steps, - temperature: this._temperature, - coolDown: this._coolDown - }); - } - else { - var cb = function() { - if (self._updating) { - self._step(); - requestAnimationFrame(cb); - } - }; - - requestAnimationFrame(cb); - } - }, - - _buildShape: function() { + // var self = this; var legend = this.component.legend; var series = this.series; var serieName; - this._temperature = 1; - - this.shapeList.length = 0; + this.clear(); for (var i = 0, l = series.length; i < l; i++) { var serie = series[i]; @@ -37323,28 +39522,6 @@ define('echarts/chart/force',['require','../component/base','./base','./forceLay series[i] = this.reformOption(series[i]); serieName = series[i].name || ''; - if (workerUrl && serie.useWorker) { - try { - if (!this._layoutWorker) { - this._layoutWorker = new Worker(workerUrl); - } - this._layout = null; - } catch(e) { // IE10-11 will throw security error when using blog url - this._layoutWorker = null; - if (!this._layout) { - this._layout = new ForceLayout(); - } - } - } else { - if (!this._layout) { - this._layout = new ForceLayout(); - } - if (this._layoutWorker) { - this._layoutWorker.terminate(); - this._layoutWorker = null; - } - } - // 系列图例开关 this.selectedMap[serieName] = legend ? legend.isSelected(serieName) : true; @@ -37367,217 +39544,173 @@ define('echarts/chart/force',['require','../component/base','./base','./forceLay } } - this._preProcessData(serie); - - this._nodeShapes.length = 0; - this._linkShapes.length = 0; - - this._buildLinkShapes(serie); - this._buildNodeShapes(serie); - - this._initLayout(serie); - - this._updateLinkShapes(); - // TODO 多个 force this._forceSerie = serie; + + this._initSerie(serie); break; } } }, - _preProcessData: function(serie) { - this._rawNodes = this.query(serie, 'nodes'); - this._rawLinks = zrUtil.clone(this.query(serie, 'links')); + _initSerie: function(serie) { + this._temperature = 1; - var filteredNodeList = []; - var filteredNodeMap = {}; - var cursor = 0; - var self = this; - this._filteredNodes = _filter(this._rawNodes, function (node, i) { - if (!node) { - return; - } - if (node.ignore) { - return; - } - var idx = -1; + var graph = this._graph; + graph.clear(); + + for (var i = 0, len = serie.nodes.length; i < len; i++) { + var n = serie.nodes[i]; if ( - typeof(node.category) == 'undefined' - || self.selectedMap[node.category] + !n || n.ignore + || (n.category && !this.selectedMap[n.category]) ) { - idx = cursor++; + continue; } - if (node.name) { - filteredNodeMap[node.name] = idx; + var node = graph.addNode(n.name, n); + node.rawIndex = i; + } + for (var i = 0, len = serie.links.length; i < len; i++) { + var e = serie.links[i]; + var n1 = e.source; + var n2 = e.target; + if (typeof(n1) === 'number') { + n1 = serie.nodes[n1]; + if (n1) { + n1 = n1.name; + } } - filteredNodeList[i] = idx; - - return idx >= 0; - }); - var source; - var target; - this._filteredLinks = _filter(this._rawLinks, function (link, i){ - source = link.source; - target = link.target; - var ret = true; - var idx = typeof(source) === 'string' - ? filteredNodeMap[source] // source 用 node id 表示 - : filteredNodeList[source]; // source 用 node index 表示 - if (typeof(idx) == 'undefined') { - idx = -1; + if (typeof(n2) === 'number') { + n2 = serie.nodes[n2]; + if (n2) { + n2 = n2.name; + } } - - if (idx >= 0) { - link.source = idx; - } else { - ret = false; + var edge = graph.addEdge(n1, n2, e); + if (edge) { + edge.rawIndex = i; } + } - var idx = typeof(target) === 'string' - ? filteredNodeMap[target] // target 用 node id 表示 - : filteredNodeList[target]; // target 用 node index 表示 - if (typeof(idx) == 'undefined') { - idx = -1; - } + this._buildLinkShapes(serie); + this._buildNodeShapes(serie); - if (idx >= 0) { - link.target = idx; - } else { - ret = false; - } - // 保存原始链接中的index - link.rawIndex = i; + this._initLayout(serie); - return ret; - }); + this._step(); }, _initLayout: function(serie) { - - var nodes = this._filteredNodes; - var links = this._filteredLinks; - var shapes = this._nodeShapes; - var len = nodes.length; + var graph = this._graph; + var len = graph.nodes.length; var minRadius = this.query(serie, 'minRadius'); var maxRadius = this.query(serie, 'maxRadius'); + this._steps = serie.steps || 1; - this._coolDown = serie.coolDown || 0.99; - var center = this.parseCenter(this.zr, serie.center); - var width = this.parsePercent(serie.size, this.zr.getWidth()); - var height = this.parsePercent(serie.size, this.zr.getHeight()); - var size = Math.min(width, height); + this._layout.center = this.parseCenter(this.zr, serie.center); + this._layout.width = this.parsePercent(serie.size, this.zr.getWidth()); + this._layout.height = this.parsePercent(serie.size, this.zr.getHeight()); + + this._layout.large = serie.large; + this._layout.scaling = serie.scaling; + this._layout.ratioScaling = serie.ratioScaling; + this._layout.gravity = serie.gravity; + this._layout.temperature = 1; + this._layout.coolDown = serie.coolDown; // 将值映射到minRadius-maxRadius的范围上 - var radius = []; + var min = Infinity; var max = -Infinity; for (var i = 0; i < len; i++) { - var node = nodes[i]; - radius.push(node.value || 1); + var gNode = graph.nodes[i]; + gNode.layout = { + radius: gNode.data.value || 1, + mass: 0 + }; + max = Math.max(gNode.data.value, max); + min = Math.min(gNode.data.value, min); } - - var arr = new NDArray(radius); - radius = arr.map(minRadius, maxRadius).toArray(); - var max = arr.max(); - if (max === 0) { - return; + var divider = max - min; + for (var i = 0; i < len; i++) { + var gNode = graph.nodes[i]; + if (divider > 0) { + gNode.layout.radius = + (gNode.layout.radius - min) * (maxRadius - minRadius) / divider + + minRadius; + // 节点质量是归一的 + gNode.layout.mass = gNode.layout.radius / maxRadius; + } else { + gNode.layout.radius = (maxRadius - minRadius) / 2; + gNode.layout.mass = 0.5; + } } - var massArr = arr.mul(1/max, arr).toArray(); - var positionArr = new ArrayCtor(len * 2); for (var i = 0; i < len; i++) { - var initPos; - var node = nodes[i]; - if (typeof(this.__nodePositionMap[node.name]) !== 'undefined') { - initPos = vec2.create(); - vec2.copy(initPos, this.__nodePositionMap[node.name]); - } else if (typeof(node.initial) !== 'undefined') { - initPos = Array.prototype.slice.call(node.initial); - } else { - initPos = _randomInSquare( + // var initPos; + var gNode = graph.nodes[i]; + if (typeof(this.__nodePositionMap[gNode.name]) !== 'undefined') { + gNode.layout.position = vec2.create(); + vec2.copy(gNode.layout.position, this.__nodePositionMap[gNode.name]); + } + else if (typeof(gNode.data.initial) !== 'undefined') { + gNode.layout.position = vec2.create(); + vec2.copy(gNode.layout.position, gNode.data.initial); + } + else { + var center = this._layout.center; + var size = Math.min(this._layout.width, this._layout.height); + gNode.layout.position = _randomInSquare( center[0], center[1], size * 0.8 ); } - var style = shapes[i].style; - style.width = style.width || (radius[i] * 2); - style.height = style.height || (radius[i] * 2); + var style = gNode.shape.style; + var radius = gNode.layout.radius; + style.width = style.width || (radius * 2); + style.height = style.height || (radius * 2); style.x = -style.width / 2; style.y = -style.height / 2; - shapes[i].position = initPos; - - positionArr[i * 2] = initPos[0]; - positionArr[i * 2 + 1] = initPos[1]; + vec2.copy(gNode.shape.position, gNode.layout.position); } - len = links.length; - var edgeArr = new ArrayCtor(len * 2); - var edgeWeightArr = new ArrayCtor(len); + // 边 + len = graph.edges.length; + max = -Infinity; for (var i = 0; i < len; i++) { - var link = links[i]; - edgeArr[i * 2] = link.source; - edgeArr[i * 2 + 1] = link.target; - edgeWeightArr[i] = link.weight || 1; + var e = graph.edges[i]; + e.layout = { + weight: e.data.weight || 1 + }; + if (e.layout.weight > max) { + max = e.layout.weight; + } } - - arr = new NDArray(edgeWeightArr); - var max = arr.max(); - if (max === 0) { - return; + // 权重归一 + for (var i = 0; i < len; i++) { + var e = graph.edges[i]; + e.layout.weight /= max; } - var edgeWeightArr = arr.mul(1 / max, arr)._array; - var config = { - center: center, - width: serie.ratioScaling ? width : size, - height: serie.ratioScaling ? height : size, - scaling: serie.scaling || 1.0, - gravity: serie.gravity || 1.0, - barnesHutOptimize: serie.large - }; - - if (this._layoutWorker) { - - this._token = getToken(); - - this._layoutWorker.postMessage({ - cmd: 'init', - nodesPosition: positionArr, - nodesMass: massArr, - nodesSize: radius, - edges: edgeArr, - edgesWeight: edgeWeightArr, - token: this._token - }); - - this._layoutWorker.postMessage({ - cmd: 'updateConfig', - config: config - }); - - } else { - - zrUtil.merge(this._layout, config, true); - this._layout.initNodes(positionArr, massArr, radius); - this._layout.initEdges(edgeArr, edgeWeightArr); - } + this._layout.init(graph, serie.useWorker); }, _buildNodeShapes: function(serie) { + var graph = this._graph; + var categories = this.query(serie, 'categories'); - var nodes = this._filteredNodes; - var len = nodes.length; + var len = graph.nodes.length; var legend = this.component.legend; for (var i = 0; i < len; i++) { - var node = nodes[i]; + var gNode = graph.nodes[i]; + var node = gNode.data; var shape = new IconShape({ style : { x : 0, y : 0 }, - clickable : true, + clickable: this.query(serie, 'clickable'), highlightStyle : {} }); @@ -37613,6 +39746,17 @@ define('echarts/chart/force',['require','../component/base','./base','./forceLay shape.style.width = shape.style.height = (this.deepQuery(queryTarget, 'symbolSize') || 0) * 2; + if (shape.style.iconType.match('image')) { + shape.style.image = shape.style.iconType.replace( + new RegExp('^image:\\/\\/'), '' + ); + shape = new ImageShape({ + style: shape.style, + highlightStyle: shape.highlightStyle, + clickable: shape.clickable + }); + } + // 节点样式 for (var k = 0; k < shapeNormalStyle.length; k++) { if (shapeNormalStyle[k]) { @@ -37624,7 +39768,7 @@ define('echarts/chart/force',['require','../component/base','./base','./forceLay if (shapeEmphasisStyle[k]) { zrUtil.merge(shape.highlightStyle, shapeEmphasisStyle[k], true); } - } + } // 节点标签样式 if (this.deepQuery(queryTarget, 'itemStyle.normal.label.show')) { @@ -37677,29 +39821,29 @@ define('echarts/chart/force',['require','../component/base','./base','./forceLay // data node, // data index - zrUtil.indexOf(this._rawNodes, node), + gNode.rawIndex, // name node.name || '', // value node.value ); - this._nodeShapes.push(shape); this.shapeList.push(shape); this.zr.addShape(shape); + + gNode.shape = shape; } }, _buildLinkShapes: function(serie) { - - var nodes = this._filteredNodes; - var links = this._filteredLinks; - var len = links.length; + var graph = this._graph; + var len = graph.edges.length; for (var i = 0; i < len; i++) { - var link = links[i]; - var source = nodes[link.source]; - var target = nodes[link.target]; + var gEdge = graph.edges[i]; + var link = gEdge.data; + var source = gEdge.node1; + var target = gEdge.node2; var linkShape = new LineShape({ style : { @@ -37709,7 +39853,7 @@ define('echarts/chart/force',['require','../component/base','./base','./forceLay yEnd : 0, lineWidth : 1 }, - clickable : true, + clickable: this.query(serie, 'clickable'), highlightStyle : {} }); @@ -37736,7 +39880,6 @@ define('echarts/chart/force',['require','../component/base','./base','./forceLay } } - var link = this._rawLinks[link.rawIndex]; ecData.pack( linkShape, // serie @@ -37745,24 +39888,24 @@ define('echarts/chart/force',['require','../component/base','./base','./forceLay 0, // link data { - source : link.source, - target : link.target, - weight : link.weight || 0 + source : source.data, + target : target.data, + weight : gEdge.data.weight || 0 }, // link data index - link.rawIndex, + gEdge.rawIndex, // source name - target name source.name + ' - ' + target.name, // link weight - link.weight || 0, + gEdge.data.weight || 0, // special // 这一项只是为了表明这是条边 true ); - this._linkShapes.push(linkShape); this.shapeList.push(linkShape); this.zr.addShape(linkShape); + gEdge.shape = linkShape; // Arrow shape if (serie.linkSymbol && serie.linkSymbol !== 'none') { @@ -37797,22 +39940,21 @@ define('echarts/chart/force',['require','../component/base','./base','./forceLay _updateLinkShapes: function() { var v = vec2.create(); - var links = this._filteredLinks; - for (var i = 0, len = links.length; i < len; i++) { - var link = links[i]; - var linkShape = this._linkShapes[i]; - var sourceShape = this._nodeShapes[link.source]; - var targetShape = this._nodeShapes[link.target]; - - linkShape.style.xStart = sourceShape.position[0]; - linkShape.style.yStart = sourceShape.position[1]; - linkShape.style.xEnd = targetShape.position[0]; - linkShape.style.yEnd = targetShape.position[1]; - - this.zr.modShape(linkShape.id); - - if (linkShape._symbolShape) { - var symbolShape = linkShape._symbolShape; + var edges = this._graph.edges; + for (var i = 0, len = edges.length; i < len; i++) { + var edge = edges[i]; + var sourceShape = edge.node1.shape; + var targetShape = edge.node2.shape; + + edge.shape.style.xStart = sourceShape.position[0]; + edge.shape.style.yStart = sourceShape.position[1]; + edge.shape.style.xEnd = targetShape.position[0]; + edge.shape.style.yEnd = targetShape.position[1]; + + this.zr.modShape(edge.shape.id); + + if (edge.shape._symbolShape) { + var symbolShape = edge.shape._symbolShape; vec2.copy(symbolShape.position, targetShape.position); vec2.sub(v, sourceShape.position, targetShape.position); @@ -37826,34 +39968,36 @@ define('echarts/chart/force',['require','../component/base','./base','./forceLay var angle; if (v[1] < 0) { angle = 2 * Math.PI - Math.acos(-v[0]); - } else { + } + else { angle = Math.acos(-v[0]); } - symbolShape.rotation = angle - Math.PI / 2; + symbolShape.rotation = angle - Math.PI / 2; this.zr.modShape(symbolShape.id); } } }, - _update: function(e) { - - this._layout.temperature = this._temperature; - this._layout.update(); - - for (var i = 0; i < this._layout.nodes.length; i++) { - var position = this._layout.nodes[i].position; - var shape = this._nodeShapes[i]; - var node = this._filteredNodes[i]; + _syncNodePositions: function() { + var graph = this._graph; + for (var i = 0; i < graph.nodes.length; i++) { + var gNode = graph.nodes[i]; + var position = gNode.layout.position; + var node = gNode.data; + var shape = gNode.shape; if (shape.fixed || (node.fixX && node.fixY)) { vec2.copy(position, shape.position); - } else if (node.fixX) { + } + else if (node.fixX) { position[0] = shape.position[0]; shape.position[1] = position[1]; - } else if (node.fixY) { + } + else if (node.fixY) { position[1] = shape.position[1]; shape.position[0] = position[0]; - } else { + } + else { vec2.copy(shape.position, position); } @@ -37865,92 +40009,21 @@ define('echarts/chart/force',['require','../component/base','./base','./forceLay } vec2.copy(gPos, position); } - } - this._temperature *= this._coolDown; - }, - - _updateWorker: function(e) { - if (!this._updating) { - return; + this.zr.modShape(shape.id); } - - var positionArr = new Float32Array(e.data); - var token = positionArr[0]; - var ret = token === this._token; - // If token is from current layout instance - if (ret) { - var nNodes = (positionArr.length - 1) / 2; - - for (var i = 0; i < nNodes; i++) { - var shape = this._nodeShapes[i]; - var node = this._filteredNodes[i]; - - var x = positionArr[i * 2 + 1]; - var y = positionArr[i * 2 + 2]; - - if (shape.fixed || (node.fixX && node.fixY)) { - positionArr[i * 2 + 1] = shape.position[0]; - positionArr[i * 2 + 2] = shape.position[1]; - } else if (node.fixX) { - positionArr[i * 2 + 1] = shape.position[0]; - shape.position[1] = y; - } else if (node.fixY) { - positionArr[i * 2 + 2] = shape.position[1]; - shape.position[0] = x; - } else { - shape.position[0] = x; - shape.position[1] = y; - } - - var nodeName = node.name; - if (nodeName) { - var gPos = this.__nodePositionMap[nodeName]; - if (!gPos) { - gPos = this.__nodePositionMap[nodeName] = vec2.create(); - } - vec2.copy(gPos, shape.position); - } - } - - this._layoutWorker.postMessage(positionArr.buffer, [positionArr.buffer]); - } - - var self = this; - self._layoutWorker.postMessage({ - cmd: 'update', - steps: this._steps, - temperature: this._temperature, - coolDown: this._coolDown - }); - - for (var i = 0; i < this._steps; i++) { - this._temperature *= this._coolDown; - } - - return ret; }, - _step: function(e){ - if (this._layoutWorker) { - var res = this._updateWorker(e); - if (!res) { - return; - } - } else { - if (this._temperature < 0.01) { - return; - } - this._update(); - } + _step: function(e) { + this._syncNodePositions(); this._updateLinkShapes(); - for (var i = 0; i < this._nodeShapes.length; i++) { - this.zr.modShape(this._nodeShapes[i].id); - } + this.zr.refreshNextFrame(); - this.zr.refresh(); + if (this._layout.temperature > 0.01) { + this._layout.step(this._steps); + } }, refresh: function(newOption) { @@ -37958,20 +40031,16 @@ define('echarts/chart/force',['require','../component/base','./base','./forceLay this.option = newOption; this.series = this.option.series; } - this.clear(); - this._buildShape(); + this._init(); }, dispose: function(){ - this._updating = false; this.clear(); this.shapeList = null; this.effectList = null; - if (this._layoutWorker) { - this._layoutWorker.terminate(); - } - this._layoutWorker = null; + this._layout.dispose(); + this._layout = null; this.__nodePositionMap = {}; } @@ -37996,7 +40065,8 @@ define('echarts/chart/force',['require','../component/base','./base','./forceLay } function onmousemove() { - this._temperature = 0.8; + this._layout.temperature = 0.8; + this._step(); } /** @@ -38022,12 +40092,13 @@ define('echarts/chart/force',['require','../component/base','./base','./forceLay } function _randomInSquare(x, y, size) { - return [ - (Math.random() - 0.5) * size + x, - (Math.random() - 0.5) * size + y - ]; + var v = vec2.create(); + v[0] = (Math.random() - 0.5) * size + x; + v[1] = (Math.random() - 0.5) * size + y; + return v; } + /* function _filter(array, callback){ var len = array.length; var result = []; @@ -38038,6 +40109,7 @@ define('echarts/chart/force',['require','../component/base','./base','./forceLay } return result; } + */ zrUtil.inherits(Force, ChartBase); zrUtil.inherits(Force, ComponentBase); @@ -38118,7 +40190,7 @@ define('echarts/util/shape/HalfSmoothPolygon',['require','zrender/shape/Base','z } if (style.smooth) { var controlPoints = smoothBezier( - pointList.slice(0, -2), style.smooth + pointList.slice(0, -2), style.smooth, false, style.smoothConstraint ); ctx.moveTo(pointList[0][0], pointList[0][1]); @@ -38193,11 +40265,11 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha } Line.prototype = { - type : ecConfig.CHART_TYPE_LINE, + type: ecConfig.CHART_TYPE_LINE, /** * 绘制图形 */ - _buildShape : function () { + _buildShape: function () { var series = this.series; this.finalPLMap = {}; // 完成的point list(PL) this._sIndex2ColorMap = {}; // series默认颜色索引,seriesIndex索引到color @@ -38209,27 +40281,27 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha // 水平垂直双向series索引 ,position索引到seriesIndex var _position2sIndexMap = { - top : [], - bottom : [], - left : [], - right : [] + top: [ ], + bottom: [ ], + left: [ ], + right: [ ] }; var xAxisIndex; var yAxisIndex; var xAxis; var yAxis; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type == this.type) { + if (series[i].type === this.type) { series[i] = this.reformOption(series[i]); xAxisIndex = series[i].xAxisIndex; yAxisIndex = series[i].yAxisIndex; xAxis = this.component.xAxis.getAxis(xAxisIndex); yAxis = this.component.yAxis.getAxis(yAxisIndex); - if (xAxis.type == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + if (xAxis.type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY ) { _position2sIndexMap[xAxis.getPosition()].push(i); } - else if (yAxis.type == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + else if (yAxis.type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY ) { _position2sIndexMap[yAxis.getPosition()].push(i); } @@ -38251,7 +40323,7 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha * * @param {number} seriesIndex 系列索引 */ - _buildSinglePosition : function (position, seriesArray) { + _buildSinglePosition: function (position, seriesArray) { var mapData = this._mapData(seriesArray); var locationMap = mapData.locationMap; var maxDataLength = mapData.maxDataLength; @@ -38279,7 +40351,7 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha * 数据整形 * 数组位置映射到系列索引 */ - _mapData : function (seriesArray) { + _mapData: function (seriesArray) { var series = this.series; var serie; // 临时映射变量 var dataIndex = 0; // 堆积数据所在位置映射 @@ -38324,7 +40396,7 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha if (this.selectedMap[serieName]) { stackKey = serie.stack || (magicStackKey + seriesArray[i]); - if (typeof stackMap[stackKey] == 'undefined') { + if (stackMap[stackKey] == null) { stackMap[stackKey] = dataIndex; locationMap[dataIndex] = [seriesArray[i]]; dataIndex++; @@ -38357,15 +40429,15 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha */ return { - locationMap : locationMap, - maxDataLength : maxDataLength + locationMap: locationMap, + maxDataLength: maxDataLength }; }, /** * 构建类目轴为水平方向的折线图系列 */ - _buildHorizontal : function (seriesArray, maxDataLength, locationMap, xMarkMap) { + _buildHorizontal: function (seriesArray, maxDataLength, locationMap, xMarkMap) { var series = this.series; // 确定类目轴和数值轴,同一方向随便找一个即可 var seriesIndex = locationMap[0][0]; @@ -38386,7 +40458,7 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha var data; var value; for (var i = 0, l = maxDataLength; i < l; i++) { - if (typeof categoryAxis.getNameByIndex(i) == 'undefined') { + if (categoryAxis.getNameByIndex(i) == null) { // 系列数据超出类目轴长度 break; } @@ -38400,21 +40472,21 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha seriesIndex = locationMap[j][m]; serie = series[seriesIndex]; data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' + value = data != null + ? (data.value != null ? data.value : data) : '-'; curPLMap[seriesIndex] = curPLMap[seriesIndex] || []; xMarkMap[seriesIndex] = xMarkMap[seriesIndex] || { - min : Number.POSITIVE_INFINITY, - max : Number.NEGATIVE_INFINITY, - sum : 0, - counter : 0, - average : 0 + min: Number.POSITIVE_INFINITY, + max: Number.NEGATIVE_INFINITY, + sum: 0, + counter: 0, + average: 0 }; - if (value == '-') { + if (value === '-') { // 空数据则把正在记录的curPLMap添加到finalPLMap中 if (curPLMap[seriesIndex].length > 0) { this.finalPLMap[seriesIndex] = @@ -38469,8 +40541,8 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha seriesIndex = locationMap[j][m]; serie = series[seriesIndex]; data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' + value = data != null + ? (data.value != null ? data.value : data) : '-'; @@ -38538,7 +40610,7 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha /** * 构建类目轴为垂直方向的折线图系列 */ - _buildVertical : function (seriesArray, maxDataLength, locationMap, xMarkMap) { + _buildVertical: function (seriesArray, maxDataLength, locationMap, xMarkMap) { var series = this.series; // 确定类目轴和数值轴,同一方向随便找一个即可 var seriesIndex = locationMap[0][0]; @@ -38559,7 +40631,7 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha var data; var value; for (var i = 0, l = maxDataLength; i < l; i++) { - if (typeof categoryAxis.getNameByIndex(i) == 'undefined') { + if (categoryAxis.getNameByIndex(i) == null) { // 系列数据超出类目轴长度 break; } @@ -38573,21 +40645,21 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha seriesIndex = locationMap[j][m]; serie = series[seriesIndex]; data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' + value = data != null + ? (data.value != null ? data.value : data) : '-'; curPLMap[seriesIndex] = curPLMap[seriesIndex] || []; xMarkMap[seriesIndex] = xMarkMap[seriesIndex] || { - min : Number.POSITIVE_INFINITY, - max : Number.NEGATIVE_INFINITY, - sum : 0, - counter : 0, - average : 0 + min: Number.POSITIVE_INFINITY, + max: Number.NEGATIVE_INFINITY, + sum: 0, + counter: 0, + average: 0 }; - if (value == '-') { + if (value === '-') { // 空数据则把正在记录的curPLMap添加到finalPLMap中 if (curPLMap[seriesIndex].length > 0) { this.finalPLMap[seriesIndex] = @@ -38642,8 +40714,8 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha seriesIndex = locationMap[j][m]; serie = series[seriesIndex]; data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' + value = data != null + ? (data.value != null ? data.value : data) : '-'; @@ -38712,62 +40784,42 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha /** * 生成折线和折线上的拐点 */ - _buildBorkenLine : function (seriesArray, pointList, categoryAxis, orient) { + _buildBorkenLine: function (seriesArray, pointList, categoryAxis, orient) { var series = this.series; - var defaultColor; - - // 折线相关 - var lineWidth; - var lineType; - var lineColor; - var normalColor; - - // 填充相关 - var isFill; - var fillNormalColor; - var serie; var data; - var seriesPL; - var singlePL; - var brokenLineShape; - var halfSmoothPolygonShape; - - var isLarge; // 堆积层叠需求,反顺序构建 - var seriesIndex; for (var sIdx = seriesArray.length - 1; sIdx >= 0; sIdx--) { - seriesIndex = seriesArray[sIdx]; - serie = series[seriesIndex]; - seriesPL = pointList[seriesIndex]; - if (serie.type == this.type && typeof seriesPL != 'undefined') { - defaultColor = this._sIndex2ColorMap[seriesIndex]; - // 多级控制 - lineWidth = this.query( + var seriesIndex = seriesArray[sIdx]; + var serie = series[seriesIndex]; + var seriesPL = pointList[seriesIndex]; + if (serie.type === this.type && seriesPL != null) { + var bbox = this._getBbox(seriesIndex, orient); + var defaultColor = this._sIndex2ColorMap[seriesIndex]; + // 折线相关,多级控制 + var lineWidth = this.query( serie, 'itemStyle.normal.lineStyle.width' ); - lineType = this.query( + var lineType = this.query( serie, 'itemStyle.normal.lineStyle.type' ); - lineColor = this.query( + var lineColor = this.query( serie, 'itemStyle.normal.lineStyle.color' ); - normalColor = this.getItemStyleColor( + var normalColor = this.getItemStyleColor( this.query(serie, 'itemStyle.normal.color'), seriesIndex, -1 ); - isFill = typeof this.query( - serie, 'itemStyle.normal.areaStyle' - ) != 'undefined'; - - fillNormalColor = this.query( + // 填充相关 + var isFill = this.query(serie, 'itemStyle.normal.areaStyle') != null; + var fillNormalColor = this.query( serie, 'itemStyle.normal.areaStyle.color' ); for (var i = 0, l = seriesPL.length; i < l; i++) { - singlePL = seriesPL[i]; - isLarge = this._isLarge(orient, singlePL); + var singlePL = seriesPL[i]; + var isLarge = this._isLarge(orient, singlePL); if (!isLarge) { // 非大数据模式才显示拐点symbol for (var j = 0, k = singlePL.length; j < k; j++) { data = serie.data[singlePL[j][2]]; @@ -38801,18 +40853,19 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha } // 折线图 - brokenLineShape = new BrokenLineShape({ - zlevel : this._zlevelBase, - style : { + var brokenLineShape = new BrokenLineShape({ + zlevel: this._zlevelBase, + style: { miterLimit: lineWidth, - pointList : singlePL, - strokeColor : lineColor - || normalColor - || defaultColor, - lineWidth : lineWidth, - lineType : lineType, - smooth : this._getSmooth(serie.smooth), - shadowColor : this.query( + pointList: singlePL, + strokeColor: lineColor + || normalColor + || defaultColor, + lineWidth: lineWidth, + lineType: lineType, + smooth: this._getSmooth(serie.smooth), + smoothConstraint: bbox, + shadowColor: this.query( serie, 'itemStyle.normal.lineStyle.shadowColor' ), @@ -38829,10 +40882,10 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha 'itemStyle.normal.lineStyle.shadowOffsetY' ) }, - hoverable : false, - _main : true, - _seriesIndex : seriesIndex, - _orient : orient + hoverable: false, + _main: true, + _seriesIndex: seriesIndex, + _orient: orient }); ecData.pack( @@ -38844,11 +40897,11 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha this.shapeList.push(brokenLineShape); if (isFill) { - halfSmoothPolygonShape = new HalfSmoothPolygonShape({ - zlevel : this._zlevelBase, - style : { + var halfSmoothPolygonShape = new HalfSmoothPolygonShape({ + zlevel: this._zlevelBase, + style: { miterLimit: lineWidth, - pointList : zrUtil.clone(singlePL).concat([ + pointList: zrUtil.clone(singlePL).concat([ [ singlePL[singlePL.length - 1][4], singlePL[singlePL.length - 1][5] @@ -38858,16 +40911,17 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha singlePL[0][5] ] ]), - brushType : 'fill', - smooth : this._getSmooth(serie.smooth), - color : fillNormalColor - ? fillNormalColor - : zrColor.alpha(defaultColor,0.5) + brushType: 'fill', + smooth: this._getSmooth(serie.smooth), + smoothConstraint: bbox, + color: fillNormalColor + ? fillNormalColor + : zrColor.alpha(defaultColor,0.5) }, - hoverable : false, - _main : true, - _seriesIndex : seriesIndex, - _orient : orient + hoverable: false, + _main: true, + _seriesIndex: seriesIndex, + _orient: orient }); ecData.pack( halfSmoothPolygonShape, @@ -38881,12 +40935,26 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha } }, - _isLarge : function(orient, singlePL) { + _getBbox: function(seriesIndex, orient) { + var bbox = this.component.grid.getBbox(); + var xMarkMap = this.xMarkMap[seriesIndex]; + if (orient === 'horizontal') { + bbox[0][1] = Math.min(xMarkMap.minY, xMarkMap.maxY); + bbox[1][1] = Math.max(xMarkMap.minY, xMarkMap.maxY); + } + else { + bbox[0][0] = Math.min(xMarkMap.minX, xMarkMap.maxX); + bbox[1][0] = Math.max(xMarkMap.minX, xMarkMap.maxX); + } + return bbox; + }, + + _isLarge: function(orient, singlePL) { if (singlePL.length < 2) { return false; } else { - return orient == 'horizontal' + return orient === 'horizontal' ? (Math.abs(singlePL[0][0] - singlePL[1][0]) < 0.5) : (Math.abs(singlePL[0][1] - singlePL[1][1]) < 0.5); } @@ -38895,9 +40963,9 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha /** * 大规模pointList优化 */ - _getLargePointList : function(orient, singlePL) { + _getLargePointList: function(orient, singlePL) { var total; - if (orient == 'horizontal') { + if (orient === 'horizontal') { total = this.component.grid.getWidth(); } else { @@ -38912,11 +40980,11 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha return newList; }, - _getSmooth : function (isSmooth/*, pointList, orient*/) { + _getSmooth: function (isSmooth/*, pointList, orient*/) { if (isSmooth) { /* 不科学啊,发现0.3通用了 var delta; - if (orient == 'horizontal') { + if (orient === 'horizontal') { delta = Math.abs(pointList[0][0] - pointList[1][0]); } else { @@ -38933,7 +41001,7 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha /** * 生成空数据所需的可计算提示图形 */ - _getCalculableItem : function (seriesIndex, dataIndex, name, x, y, orient) { + _getCalculableItem: function (seriesIndex, dataIndex, name, x, y, orient) { var series = this.series; var color = series[seriesIndex].calculableHolderColor || this.ecTheme.calculableHolderColor; @@ -38955,7 +41023,7 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha /** * 生成折线图上的拐点图形 */ - _getSymbol : function (seriesIndex, dataIndex, name, x, y, orient) { + _getSymbol: function (seriesIndex, dataIndex, name, x, y, orient) { var series = this.series; var serie = series[seriesIndex]; var data = serie.data[dataIndex]; @@ -38966,7 +41034,7 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha this._sIndex2ShapeMap[seriesIndex], this._sIndex2ColorMap[seriesIndex], '#fff', - orient == 'vertical' ? 'horizontal' : 'vertical' // 翻转 + orient === 'vertical' ? 'horizontal' : 'vertical' // 翻转 ); itemShape.zlevel = this._zlevelBase + 1; @@ -38979,14 +41047,14 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha }, // 位置转换 - getMarkCoord : function (seriesIndex, mpData) { + getMarkCoord: function (seriesIndex, mpData) { var serie = this.series[seriesIndex]; var xMarkMap = this.xMarkMap[seriesIndex]; var xAxis = this.component.xAxis.getAxis(serie.xAxisIndex); var yAxis = this.component.yAxis.getAxis(serie.yAxisIndex); if (mpData.type - && (mpData.type == 'max' || mpData.type == 'min' || mpData.type == 'average') + && (mpData.type === 'max' || mpData.type === 'min' || mpData.type === 'average') ) { // 特殊值内置支持 return [ @@ -39011,7 +41079,7 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha /** * 刷新 */ - refresh : function (newOption) { + refresh: function (newOption) { if (newOption) { this.option = newOption; this.series = newOption.series; @@ -39021,7 +41089,7 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha this._buildShape(); }, - ontooltipHover : function (param, tipShape) { + ontooltipHover: function (param, tipShape) { var seriesIndex = param.seriesIndex; var dataIndex = param.dataIndex; var seriesPL; @@ -39033,7 +41101,7 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha for (var i = 0, l = seriesPL.length; i < l; i++) { singlePL = seriesPL[i]; for (var j = 0, k = singlePL.length; j < k; j++) { - if (dataIndex == singlePL[j][2]) { + if (dataIndex === singlePL[j][2]) { tipShape.push(this._getSymbol( seriesIndex[len], // seriesIndex singlePL[j][2], // dataIndex @@ -39052,7 +41120,7 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha /** * 动态数据增加动画 */ - addDataAnimation : function (params) { + addDataAnimation: function (params) { var series = this.series; var aniMap = {}; // seriesIndex索引参数 for (var i = 0, l = params.length; i < l; i++) { @@ -39075,11 +41143,11 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha dx = Math.abs(pointList[0][0] - pointList[1][0]); dy = Math.abs(pointList[0][1] - pointList[1][1]); isHorizontal = - this.shapeList[i]._orient == 'horizontal'; + this.shapeList[i]._orient === 'horizontal'; if (aniMap[seriesIndex][2]) { // 队头加入删除末尾 - if (this.shapeList[i].type == 'polygon') { + if (this.shapeList[i].type === 'polygon') { //区域图 var len = pointList.length; this.shapeList[i].style.pointList[len - 3] @@ -39101,7 +41169,7 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha else { // 队尾加入删除头部 this.shapeList[i].style.pointList.shift(); - if (this.shapeList[i].type == 'polygon') { + if (this.shapeList[i].type === 'polygon') { //区域图 var targetPoint = this.shapeList[i].style.pointList.pop(); @@ -39118,7 +41186,7 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha this.zr.modShape( this.shapeList[i].id, { - style : { + style: { pointList: this.shapeList[i].style.pointList } }, @@ -39129,7 +41197,7 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha // 拐点动画 if (aniMap[seriesIndex][2] && this.shapeList[i]._dataIndex - == series[seriesIndex].data.length - 1 + === series[seriesIndex].data.length - 1 ) { // 队头加入删除末尾 this.zr.delShape(this.shapeList[i].id); @@ -39147,7 +41215,7 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha this.zr.animate(this.shapeList[i].id, '') .when( 500, - {position : [x, y]} + { position: [ x, y ] } ) .start(); } @@ -39174,7 +41242,7 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha y -= 1; symbol = 'star'; } - else if (symbol == 'rectangle' || symbol == 'arrow') { + else if (symbol === 'rectangle' || symbol === 'arrow') { x += (width - height) / 2; width = height; } @@ -39199,12 +41267,12 @@ define('echarts/chart/line',['require','../component/base','./base','zrender/sha ctx.lineTo(x2 + style.width, y2 + dy); symbol(ctx, { - x : x + 4, - y : y + 4, - width : width - 8, - height : height - 8, - n : dy, - image : imageLocation + x: x + 4, + y: y + 4, + width: width - 8, + height: height - 8, + n: dy, + image: imageLocation }); } @@ -39263,11 +41331,11 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap } Bar.prototype = { - type : ecConfig.CHART_TYPE_BAR, + type: ecConfig.CHART_TYPE_BAR, /** * 绘制图形 */ - _buildShape : function () { + _buildShape: function () { var series = this.series; this.selectedMap = {}; this.xMarkMap = {}; @@ -39277,27 +41345,27 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap // 水平垂直双向series索引 ,position索引到seriesIndex var _position2sIndexMap = { - top : [], - bottom : [], - left : [], - right : [] + top: [ ], + bottom: [ ], + left: [ ], + right: [ ] }; var xAxisIndex; var yAxisIndex; var xAxis; var yAxis; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type == ecConfig.CHART_TYPE_BAR) { + if (series[i].type === ecConfig.CHART_TYPE_BAR) { series[i] = this.reformOption(series[i]); xAxisIndex = series[i].xAxisIndex; yAxisIndex = series[i].yAxisIndex; xAxis = this.component.xAxis.getAxis(xAxisIndex); yAxis = this.component.yAxis.getAxis(yAxisIndex); - if (xAxis.type == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + if (xAxis.type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY ) { _position2sIndexMap[xAxis.getPosition()].push(i); } - else if (yAxis.type == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY + else if (yAxis.type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY ) { _position2sIndexMap[yAxis.getPosition()].push(i); } @@ -39320,7 +41388,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap * * @param {number} seriesIndex 系列索引 */ - _buildSinglePosition : function (position, seriesArray, xMarkMap) { + _buildSinglePosition: function (position, seriesArray, xMarkMap) { var mapData = this._mapData(seriesArray); var locationMap = mapData.locationMap; var maxDataLength = mapData.maxDataLength; @@ -39345,7 +41413,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap * 数据整形 * 数组位置映射到系列索引 */ - _mapData : function (seriesArray) { + _mapData: function (seriesArray) { var series = this.series; var serie; // 临时映射变量 var dataIndex = 0; // 堆积数据所在位置映射 @@ -39354,7 +41422,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap var stackKey; // 临时映射变量 var serieName; // 临时映射变量 var legend = this.component.legend; - var locationMap = []; // 需要返回的东西:数组位置映射到系列索引 + var locationMap = [ ]; // 需要返回的东西:数组位置映射到系列索引 var maxDataLength = 0; // 需要返回的东西:最大数据长度 var iconShape; // 计算需要显示的个数和分配位置并记在下面这个结构里 @@ -39369,14 +41437,14 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap iconShape = legend.getItemShape(serieName); if (iconShape) { // 回调legend,换一个更形象的icon - if (serie.itemStyle.normal.borderWidth > 0) { + if (serie.itemStyle.normal.barBorderWidth > 0) { iconShape.style.x += 1; iconShape.style.y += 1; iconShape.style.width -= 2; iconShape.style.height -= 2; iconShape.style.strokeColor = iconShape.highlightStyle.strokeColor = - serie.itemStyle.normal.borderColor; + serie.itemStyle.normal.barBorderColor; iconShape.highlightStyle.lineWidth = 3; iconShape.style.brushType = 'both'; } @@ -39390,7 +41458,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap if (this.selectedMap[serieName]) { stackKey = serie.stack || (magicStackKey + seriesArray[i]); - if (typeof stackMap[stackKey] == 'undefined') { + if (stackMap[stackKey] == null) { stackMap[stackKey] = dataIndex; locationMap[dataIndex] = [seriesArray[i]]; dataIndex++; @@ -39424,15 +41492,15 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap */ return { - locationMap : locationMap, - maxDataLength : maxDataLength + locationMap: locationMap, + maxDataLength: maxDataLength }; }, /** * 构建类目轴为水平方向的柱形图系列 */ - _buildHorizontal : function (maxDataLength, locationMap, seriesArray, xMarkMap) { + _buildHorizontal: function (maxDataLength, locationMap, seriesArray, xMarkMap) { var series = this.series; // 确定类目轴和数值轴,同一方向随便找一个即可 var seriesIndex = locationMap[0][0]; @@ -39461,7 +41529,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap var data; var value; for (var i = 0, l = maxDataLength; i < l; i++) { - if (typeof categoryAxis.getNameByIndex(i) == 'undefined') { + if (categoryAxis.getNameByIndex(i) == null) { // 系列数据超出类目轴长度 break; } @@ -39475,20 +41543,20 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap seriesIndex = locationMap[j][m]; serie = series[seriesIndex]; data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' + value = data != null + ? (data.value != null ? data.value : data) : '-'; xMarkMap[seriesIndex] = xMarkMap[seriesIndex] || { - min : Number.POSITIVE_INFINITY, - max : Number.NEGATIVE_INFINITY, - sum : 0, - counter : 0, - average : 0 + min: Number.POSITIVE_INFINITY, + max: Number.NEGATIVE_INFINITY, + sum: 0, + counter: 0, + average: 0 }; - if (value == '-') { + if (value === '-') { // 空数据在做完后补充拖拽提示框 continue; } @@ -39500,7 +41568,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap ? valueAxis.getCoordSize(value) : (baseYP - valueAxis.getCoord(value)); // 非堆积数据最小高度有效 - if (n == 1 + if (n === 1 && barMinHeightMap[seriesIndex] > barHeight ) { barHeight = barMinHeightMap[seriesIndex]; @@ -39515,7 +41583,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap ? valueAxis.getCoordSize(value) : (valueAxis.getCoord(value) - baseYN); // 非堆积数据最小高度有效 - if (n == 1 + if (n === 1 && barMinHeightMap[seriesIndex] > barHeight ) { barHeight = barMinHeightMap[seriesIndex]; @@ -39563,8 +41631,8 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap seriesIndex = locationMap[j][m]; serie = series[seriesIndex]; data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' + value = data != null + ? (data.value != null ? data.value : data) : '-'; @@ -39638,7 +41706,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap /** * 构建类目轴为垂直方向的柱形图系列 */ - _buildVertical : function (maxDataLength, locationMap, seriesArray, xMarkMap) { + _buildVertical: function (maxDataLength, locationMap, seriesArray, xMarkMap) { var series = this.series; // 确定类目轴和数值轴,同一方向随便找一个即可 var seriesIndex = locationMap[0][0]; @@ -39667,7 +41735,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap var data; var value; for (var i = 0, l = maxDataLength; i < l; i++) { - if (typeof categoryAxis.getNameByIndex(i) == 'undefined') { + if (categoryAxis.getNameByIndex(i) == null) { // 系列数据超出类目轴长度 break; } @@ -39681,20 +41749,20 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap seriesIndex = locationMap[j][m]; serie = series[seriesIndex]; data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' + value = data != null + ? (data.value != null ? data.value : data) : '-'; xMarkMap[seriesIndex] = xMarkMap[seriesIndex] || { - min : Number.POSITIVE_INFINITY, - max : Number.NEGATIVE_INFINITY, - sum : 0, - counter : 0, - average : 0 + min: Number.POSITIVE_INFINITY, + max: Number.NEGATIVE_INFINITY, + sum: 0, + counter: 0, + average: 0 }; - if (value == '-') { + if (value === '-') { // 空数据在做完后补充拖拽提示框 continue; } @@ -39706,7 +41774,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap ? valueAxis.getCoordSize(value) : (valueAxis.getCoord(value) - baseXP); // 非堆积数据最小高度有效 - if (n == 1 + if (n === 1 && barMinHeightMap[seriesIndex] > barHeight ) { barHeight = barMinHeightMap[seriesIndex]; @@ -39721,7 +41789,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap ? valueAxis.getCoordSize(value) : (baseXN - valueAxis.getCoord(value)); // 非堆积数据最小高度有效 - if (n == 1 + if (n === 1 && barMinHeightMap[seriesIndex] > barHeight ) { barHeight = barMinHeightMap[seriesIndex]; @@ -39770,8 +41838,8 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap seriesIndex = locationMap[j][m]; serie = series[seriesIndex]; data = serie.data[i]; - value = typeof data != 'undefined' - ? (typeof data.value != 'undefined' + value = data != null + ? (data.value != null ? data.value : data) : '-'; @@ -39848,7 +41916,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap * @param {CategoryAxis} categoryAxis 类目坐标轴,需要知道类目间隔大小 * @param {Array} locationMap 整形数据的系列索引 */ - _mapSize : function (categoryAxis, locationMap, ignoreUserDefined) { + _mapSize: function (categoryAxis, locationMap, ignoreUserDefined) { var series = this.series; var seriesIndex; var barWidthMap = {}; @@ -39873,7 +41941,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap queryTarget, 'barWidth' ); - if (typeof sBarWidth != 'undefined') { + if (sBarWidth != null) { // 同一堆积第一个生效barWidth barWidthMap[seriesIndex] = sBarWidth; sBarWidthTotal += sBarWidth; @@ -39890,22 +41958,10 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap } } - barMinHeightMap[seriesIndex] = this.query( - queryTarget, - 'barMinHeight' - ); - barGap = typeof barGap != 'undefined' - ? barGap - : this.query( - queryTarget, - 'barGap' - ); - barCategoryGap = typeof barCategoryGap != 'undefined' - ? barCategoryGap - : this.query( - queryTarget, - 'barCategoryGap' - ); + barMinHeightMap[seriesIndex] = this.query(queryTarget, 'barMinHeight'); + barGap = barGap != null ? barGap : this.query(queryTarget, 'barGap'); + barCategoryGap = barCategoryGap != null + ? barCategoryGap : this.query(queryTarget, 'barCategoryGap'); } } @@ -39914,7 +41970,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap if (locationMap.length != sBarWidthCounter) { // 至少存在一个自适应宽度的柱形图 if (!ignoreUserDefined) { - gap = typeof barCategoryGap == 'string' + gap = typeof barCategoryGap === 'string' && barCategoryGap.match(/%$/) // 百分比 ? Math.floor( @@ -39924,7 +41980,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap ) // 数值 : (categoryAxis.getGap() - barCategoryGap); - if (typeof barGap == 'string' && barGap.match(/%$/)) { + if (typeof barGap === 'string' && barGap.match(/%$/)) { barGap = parseFloat(barGap) / 100; barWidth = Math.floor( (gap - sBarWidthTotal) @@ -39962,7 +42018,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap else { // 全是自定义宽度,barGap无效,系列间隔决定barGap gap = sBarWidthCounter > 1 - ? (typeof barCategoryGap == 'string' + ? (typeof barCategoryGap === 'string' && barCategoryGap.match(/%$/) ) // 百分比 @@ -39988,19 +42044,19 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap } return { - barWidthMap : barWidthMap, - barMinHeightMap : barMinHeightMap , - gap : gap, - barWidth : barWidth, - barGap : barGap, - interval : interval + barWidthMap: barWidthMap, + barMinHeightMap: barMinHeightMap , + gap: gap, + barWidth: barWidth, + barGap: barGap, + interval: interval }; }, /** * 生成最终图形数据 */ - _getBarItem : function (seriesIndex, dataIndex, name, x, y, width, height, orient) { + _getBarItem: function (seriesIndex, dataIndex, name, x, y, width, height, orient) { var series = this.series; var barShape; var serie = series[seriesIndex]; @@ -40020,35 +42076,35 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap queryTarget, 'itemStyle.normal' ); - var normalBorderWidth = normal.borderWidth; + var normalBorderWidth = normal.barBorderWidth; var emphasis = this.deepMerge( queryTarget, 'itemStyle.emphasis' ); barShape = { - zlevel : this._zlevelBase, - clickable: true, - style : { - x : x, - y : y, - width : width, - height : height, - brushType : 'both', - color : this.getItemStyleColor(normalColor, seriesIndex, dataIndex, data), - radius : normal.borderRadius, - lineWidth : normalBorderWidth, - strokeColor : normal.borderColor + zlevel: this._zlevelBase, + clickable: this.deepQuery(queryTarget, 'clickable'), + style: { + x: x, + y: y, + width: width, + height: height, + brushType: 'both', + color: this.getItemStyleColor(normalColor, seriesIndex, dataIndex, data), + radius: normal.barBorderRadius, + lineWidth: normalBorderWidth, + strokeColor: normal.barBorderColor }, - highlightStyle : { - color : this.getItemStyleColor(emphasisColor, seriesIndex, dataIndex, data), - radius : emphasis.borderRadius, - lineWidth : emphasis.borderWidth, - strokeColor : emphasis.borderColor + highlightStyle: { + color: this.getItemStyleColor(emphasisColor, seriesIndex, dataIndex, data), + radius: emphasis.barBorderRadius, + lineWidth: emphasis.barBorderWidth, + strokeColor: emphasis.barBorderColor }, - _orient : orient + _orient: orient }; barShape.highlightStyle.color = barShape.highlightStyle.color - || (typeof barShape.style.color == 'string' + || (typeof barShape.style.color === 'string' ? zrColor.lift(barShape.style.color, -0.3) : barShape.style.color ); @@ -40070,32 +42126,32 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap barShape.highlightStyle.textColor = barShape.highlightStyle.color; barShape = this.addLabel(barShape, serie, data, name, orient); - if (barShape.style.textPosition == 'insideLeft' - || barShape.style.textPosition == 'insideRight' - || barShape.style.textPosition == 'insideTop' - || barShape.style.textPosition == 'insideBottom' + if (barShape.style.textPosition === 'insideLeft' + || barShape.style.textPosition === 'insideRight' + || barShape.style.textPosition === 'insideTop' + || barShape.style.textPosition === 'insideBottom' ) { var gap = 5; switch (barShape.style.textPosition) { - case 'insideLeft' : + case 'insideLeft': barShape.style.textX = barShape.style.x + gap; barShape.style.textY = barShape.style.y + barShape.style.height / 2; barShape.style.textAlign = 'left'; barShape.style.textBaseline = 'middle'; break; - case 'insideRight' : + case 'insideRight': barShape.style.textX = barShape.style.x + barShape.style.width - gap; barShape.style.textY = barShape.style.y + barShape.style.height / 2; barShape.style.textAlign = 'right'; barShape.style.textBaseline = 'middle'; break; - case 'insideTop' : + case 'insideTop': barShape.style.textX = barShape.style.x + barShape.style.width / 2; barShape.style.textY = barShape.style.y + gap / 2; barShape.style.textAlign = 'center'; barShape.style.textBaseline = 'top'; break; - case 'insideBottom' : + case 'insideBottom': barShape.style.textX = barShape.style.x + barShape.style.width / 2; barShape.style.textY = barShape.style.y + barShape.style.height - gap / 2; barShape.style.textAlign = 'center'; @@ -40124,7 +42180,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap }, // 位置转换 - getMarkCoord : function (seriesIndex, mpData) { + getMarkCoord: function (seriesIndex, mpData) { var serie = this.series[seriesIndex]; var xMarkMap = this.xMarkMap[seriesIndex]; var xAxis = this.component.xAxis.getAxis(serie.xAxisIndex); @@ -40132,7 +42188,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap var dataIndex; var pos; if (mpData.type - && (mpData.type == 'max' || mpData.type == 'min' || mpData.type == 'average') + && (mpData.type === 'max' || mpData.type === 'min' || mpData.type === 'average') ) { // 特殊值内置支持 pos = [ @@ -40144,12 +42200,12 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap } else if (xMarkMap.isHorizontal) { // 横向 - dataIndex = typeof mpData.xAxis == 'string' && xAxis.getIndexByName + dataIndex = typeof mpData.xAxis === 'string' && xAxis.getIndexByName ? xAxis.getIndexByName(mpData.xAxis) : (mpData.xAxis || 0); var x = xMarkMap[dataIndex]; - x = typeof x != 'undefined' + x = x != null ? x : typeof mpData.xAxis != 'string' && xAxis.getCoordByIndex ? xAxis.getCoordByIndex(mpData.xAxis || 0) @@ -40159,12 +42215,12 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap } else { // 纵向 - dataIndex = typeof mpData.yAxis == 'string' && yAxis.getIndexByName + dataIndex = typeof mpData.yAxis === 'string' && yAxis.getIndexByName ? yAxis.getIndexByName(mpData.yAxis) : (mpData.yAxis || 0); var y = xMarkMap[dataIndex]; - y = typeof y != 'undefined' + y = y != null ? y : typeof mpData.yAxis != 'string' && yAxis.getCoordByIndex ? yAxis.getCoordByIndex(mpData.yAxis || 0) @@ -40179,7 +42235,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap /** * 刷新 */ - refresh : function (newOption) { + refresh: function (newOption) { if (newOption) { this.option = newOption; this.series = newOption.series; @@ -40192,7 +42248,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap /** * 动态数据增加动画 */ - addDataAnimation : function (params) { + addDataAnimation: function (params) { var series = this.series; var aniMap = {}; // seriesIndex索引参数 for (var i = 0, l = params.length; i < l; i++) { @@ -40209,12 +42265,12 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap seriesIndex = ecData.get(this.shapeList[i], 'seriesIndex'); if (aniMap[seriesIndex] && !aniMap[seriesIndex][3]) { // 有数据删除才有移动的动画 - if (this.shapeList[i].type == 'rectangle') { + if (this.shapeList[i].type === 'rectangle') { // 主动画 dataIndex = ecData.get(this.shapeList[i], 'dataIndex'); serie = series[seriesIndex]; if (aniMap[seriesIndex][2] - && dataIndex == serie.data.length - 1 + && dataIndex === serie.data.length - 1 ) { // 队头加入删除末尾 this.zr.delShape(this.shapeList[i].id); @@ -40225,7 +42281,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap this.zr.delShape(this.shapeList[i].id); continue; } - if (this.shapeList[i]._orient == 'horizontal') { + if (this.shapeList[i]._orient === 'horizontal') { // 条形图 dy = this.component.yAxis.getAxis( serie.yAxisIndex || 0 @@ -40245,7 +42301,7 @@ define('echarts/chart/bar',['require','../component/base','./base','zrender/shap this.zr.animate(this.shapeList[i].id, '') .when( 500, - {position : [x, y]} + { position: [x, y] } ) .start(); } @@ -40340,11 +42396,11 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap } Pie.prototype = { - type : ecConfig.CHART_TYPE_PIE, + type: ecConfig.CHART_TYPE_PIE, /** * 绘制图形 */ - _buildShape : function () { + _buildShape: function () { var series = this.series; var legend = this.component.legend; this.selectedMap = {}; @@ -40356,7 +42412,7 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap this._selectedMode = false; var serieName; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type == ecConfig.CHART_TYPE_PIE) { + if (series[i].type === ecConfig.CHART_TYPE_PIE) { series[i] = this.reformOption(series[i]); serieName = series[i].name || ''; // 系列图例开关 @@ -40372,18 +42428,18 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap this._selected[i] = []; if (this.deepQuery([series[i], this.option], 'calculable')) { pieCase = { - zlevel : this._zlevelBase, - hoverable : false, - style : { - x : center[0], // 圆心横坐标 - y : center[1], // 圆心纵坐标 + zlevel: this._zlevelBase, + hoverable: false, + style: { + x: center[0], // 圆心横坐标 + y: center[1], // 圆心纵坐标 // 圆环内外半径 - r0 : radius[0] <= 10 ? 0 : radius[0] - 10, - r : radius[1] + 10, - brushType : 'stroke', + r0: radius[0] <= 10 ? 0 : radius[0] - 10, + r: radius[1] + 10, + brushType: 'stroke', lineWidth: 1, - strokeColor : series[i].calculableHolderColor - || this.ecTheme.calculableHolderColor + strokeColor: series[i].calculableHolderColor + || this.ecTheme.calculableHolderColor } }; ecData.pack(pieCase, series[i], i, undefined, -1); @@ -40407,7 +42463,7 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap * * @param {number} seriesIndex 系列索引 */ - _buildSinglePie : function (seriesIndex) { + _buildSinglePie: function (seriesIndex) { var series = this.series; var serie = series[seriesIndex]; var data = serie.data; @@ -40437,6 +42493,10 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap maxValue = Math.max(maxValue, +data[i].value); } } + + if (totalValue === 0) { + return; + } var percent = 100; var lastPercent; // 相邻细角度优化 @@ -40487,12 +42547,12 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap r0 = +radius[0]; r1 = +radius[1]; - if (roseType == 'radius') { + if (roseType === 'radius') { r1 = data[i].value / maxValue * (r1 - r0) * 0.8 + (r1 - r0) * 0.2 + r0; } - else if (roseType == 'area') { + else if (roseType === 'area') { r1 = Math.sqrt(data[i].value / maxValue) * (r1 - r0) + r0; } @@ -40534,7 +42594,7 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap /** * 构建单个扇形及指标 */ - _buildItem : function ( + _buildItem: function ( seriesIndex, dataIndex, percent, lastAddRadius, isSelected, r0, r1, @@ -40599,7 +42659,7 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap /** * 构建扇形 */ - getSector : function ( + getSector: function ( seriesIndex, dataIndex, percent, isSelected, r0, r1, startAngle, endAngle, defaultColor @@ -40623,35 +42683,35 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap || defaultColor; var emphasisColor = this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data) - || (typeof normalColor == 'string' + || (typeof normalColor === 'string' ? zrColor.lift(normalColor, -0.2) : normalColor ); var sector = { - zlevel : this._zlevelBase, - clickable : true, - style : { - x : center[0], // 圆心横坐标 - y : center[1], // 圆心纵坐标 - r0 : r0, // 圆环内半径 - r : r1, // 圆环外半径 - startAngle : startAngle, - endAngle : endAngle, - brushType : 'both', - color : normalColor, - lineWidth : normal.borderWidth, - strokeColor : normal.borderColor, + zlevel: this._zlevelBase, + clickable: this.deepQuery(queryTarget, 'clickable'), + style: { + x: center[0], // 圆心横坐标 + y: center[1], // 圆心纵坐标 + r0: r0, // 圆环内半径 + r: r1, // 圆环外半径 + startAngle: startAngle, + endAngle: endAngle, + brushType: 'both', + color: normalColor, + lineWidth: normal.borderWidth, + strokeColor: normal.borderColor, lineJoin: 'round' }, - highlightStyle : { - color : emphasisColor, - lineWidth : emphasis.borderWidth, - strokeColor : emphasis.borderColor, + highlightStyle: { + color: emphasisColor, + lineWidth: emphasis.borderWidth, + strokeColor: emphasis.borderColor, lineJoin: 'round' }, - _seriesIndex : seriesIndex, - _dataIndex : dataIndex + _seriesIndex: seriesIndex, + _dataIndex: dataIndex }; if (isSelected) { @@ -40695,7 +42755,7 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap /** * 需要显示则会有返回构建好的shape,否则返回undefined */ - getLabel : function ( + getLabel: function ( seriesIndex, dataIndex, percent, lastAddRadius, startAngle, endAngle, defaultColor, isEmphasis @@ -40731,14 +42791,14 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap var textBaseline = 'middle'; labelControl.position = labelControl.position || itemStyle.normal.label.position; - if (labelControl.position == 'center') { + if (labelControl.position === 'center') { // center显示 radius = radius[1]; x = centerX; y = centerY; textAlign = 'center'; } - else if (labelControl.position == 'inner'){ + else if (labelControl.position === 'inner'){ // 内部显示 radius = (radius[0] + radius[1]) / 2 + lastAddRadius; x = Math.round( @@ -40752,51 +42812,48 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap } else { - // 外部显示,默认 labelControl.position == 'outer') + // 外部显示,默认 labelControl.position === 'outer') radius = radius[1] - (-itemStyle[status].labelLine.length) //- (-textStyle.fontSize) + lastAddRadius; x = centerX + radius * zrMath.cos(midAngle, true); y = centerY - radius * zrMath.sin(midAngle, true); - textAlign = (midAngle >= 90 && midAngle <= 270) - ? 'right' : 'left'; + textAlign = (midAngle >= 90 && midAngle <= 270) ? 'right' : 'left'; } if (labelControl.position != 'center' && labelControl.position != 'inner' ) { - x += textAlign == 'left' ? 20 : -20; + x += textAlign === 'left' ? 20 : -20; } - data.__labelX = x - (textAlign == 'left' ? 5 : -5); + data.__labelX = x - (textAlign === 'left' ? 5 : -5); data.__labelY = y; return new TextShape({ - zlevel : this._zlevelBase + 1, - hoverable : false, - style : { - x : x, - y : y, - color : textStyle.color || defaultColor, - text : this.getLabelText( - seriesIndex, dataIndex, percent, status - ), - textAlign : textStyle.align || textAlign, - textBaseline : textStyle.baseline || textBaseline, - textFont : this.getFont(textStyle) + zlevel: this._zlevelBase + 1, + hoverable: false, + style: { + x: x, + y: y, + color: textStyle.color || defaultColor, + text: this.getLabelText(seriesIndex, dataIndex, percent, status), + textAlign: textStyle.align || textAlign, + textBaseline: textStyle.baseline || textBaseline, + textFont: this.getFont(textStyle) }, - highlightStyle : { - brushType : 'fill' + highlightStyle: { + brushType: 'fill' }, - _seriesIndex : seriesIndex, - _dataIndex : dataIndex + _seriesIndex: seriesIndex, + _dataIndex: dataIndex }); }, /** * 根据lable.format计算label text */ - getLabelText : function (seriesIndex, dataIndex, percent, status) { + getLabelText: function (seriesIndex, dataIndex, percent, status) { var series = this.series; var serie = series[seriesIndex]; var data = serie.data[dataIndex]; @@ -40806,7 +42863,7 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap ); if (formatter) { - if (typeof formatter == 'function') { + if (typeof formatter === 'function') { return formatter.call( this.myChart, serie.name, @@ -40815,7 +42872,7 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap percent ); } - else if (typeof formatter == 'string') { + else if (typeof formatter === 'string') { formatter = formatter.replace('{a}','{a0}') .replace('{b}','{b0}') .replace('{c}','{c0}') @@ -40836,7 +42893,7 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap /** * 需要显示则会有返回构建好的shape,否则返回undefined */ - getLabelLine : function ( + getLabelLine: function ( seriesIndex, dataIndex, lastAddRadius, r0, r1, startAngle, endAngle, defaultColor, @@ -40873,11 +42930,11 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap var sinValue = zrMath.sin(midAngle, true); // 三角函数缓存已在zrender/tool/math中做了 return new BrokenLineShape({ - // shape : 'brokenLine', - zlevel : this._zlevelBase + 1, - hoverable : false, - style : { - pointList : [ + // shape: 'brokenLine', + zlevel: this._zlevelBase + 1, + hoverable: false, + style: { + pointList: [ [ centerX + midRadius * cosValue, centerY - midRadius * sinValue @@ -40891,16 +42948,16 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap data.__labelY ] ], - //xStart : centerX + midRadius * cosValue, - //yStart : centerY - midRadius * sinValue, - //xEnd : centerX + maxRadius * cosValue, - //yEnd : centerY - maxRadius * sinValue, - strokeColor : lineStyle.color || defaultColor, - lineType : lineStyle.type, - lineWidth : lineStyle.width + //xStart: centerX + midRadius * cosValue, + //yStart: centerY - midRadius * sinValue, + //xEnd: centerX + maxRadius * cosValue, + //yEnd: centerY - maxRadius * sinValue, + strokeColor: lineStyle.color || defaultColor, + lineType: lineStyle.type, + lineWidth: lineStyle.width }, - _seriesIndex : seriesIndex, - _dataIndex : dataIndex + _seriesIndex: seriesIndex, + _dataIndex: dataIndex }); } else { @@ -40914,7 +42971,7 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap * @param {Object} data * @param {boolean} isEmphasis true is 'emphasis' and false is 'normal' */ - _needLabel : function (serie, data, isEmphasis) { + _needLabel: function (serie, data, isEmphasis) { return this.deepQuery( [data, serie], 'itemStyle.' @@ -40929,7 +42986,7 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap * @param {Object} data * @param {boolean} isEmphasis true is 'emphasis' and false is 'normal' */ - _needLabelLine : function (serie, data, isEmphasis) { + _needLabelLine: function (serie, data, isEmphasis) { return this.deepQuery( [data, serie], 'itemStyle.' @@ -40942,7 +42999,7 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap * 参数修正&默认值赋值,重载基类方法 * @param {Object} opt 参数 */ - reformOption : function (opt) { + reformOption: function (opt) { // 常用方法快捷方式 var _merge = zrUtil.merge; opt = _merge( @@ -40966,7 +43023,7 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap /** * 刷新 */ - refresh : function (newOption) { + refresh: function (newOption) { if (newOption) { this.option = newOption; this.series = newOption.series; @@ -40979,7 +43036,7 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap /** * 动态数据增加动画 */ - addDataAnimation : function (params) { + addDataAnimation: function (params) { var series = this.series; var aniMap = {}; // seriesIndex索引参数 for (var i = 0, l = params.length; i < l; i++) { @@ -41002,7 +43059,7 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap isHead = params[i][2]; dataGrow = params[i][3]; if (series[seriesIndex] - && series[seriesIndex].type == ecConfig.CHART_TYPE_PIE + && series[seriesIndex].type === ecConfig.CHART_TYPE_PIE ) { if (isHead) { if (!dataGrow) { @@ -41057,17 +43114,15 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap if (!targeSector) { continue; } - if (backupShapeList[i].type == 'sector') { + if (backupShapeList[i].type === 'sector') { if (targeSector != 'delete') { // 原有扇形 this.zr.animate(backupShapeList[i].id, 'style') .when( 400, { - startAngle : - targeSector.style.startAngle, - endAngle : - targeSector.style.endAngle + startAngle: targeSector.style.startAngle, + endAngle: targeSector.style.endAngle } ) .start(); @@ -41078,22 +43133,16 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap .when( 400, deltaIdxMap[seriesIndex] < 0 - ? { - startAngle : - backupShapeList[i].style.startAngle - } - : { - endAngle : - backupShapeList[i].style.endAngle - } + ? { startAngle: backupShapeList[i].style.startAngle } + : { endAngle: backupShapeList[i].style.endAngle } ) .start(); } } - else if (backupShapeList[i].type == 'text' - || backupShapeList[i].type == 'broken-line' + else if (backupShapeList[i].type === 'text' + || backupShapeList[i].type === 'broken-line' ) { - if (targeSector == 'delete') { + if (targeSector === 'delete') { // 删除逻辑一样 this.zr.delShape(backupShapeList[i].id); } @@ -41132,7 +43181,7 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap this.shapeList = backupShapeList; }, - onclick : function (param) { + onclick: function (param) { var series = this.series; if (!this.isClick || !param.target) { // 没有在当前实例上发生点击直接返回 @@ -41146,7 +43195,7 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap var dataIndex = ecData.get(target, 'dataIndex'); for (var i = 0, len = this.shapeList.length; i < len; i++) { - if (this.shapeList[i].id == target.id) { + if (this.shapeList[i].id === target.id) { seriesIndex = ecData.get(target, 'seriesIndex'); dataIndex = ecData.get(target, 'dataIndex'); // 当前点击的 @@ -41178,7 +43227,7 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap this.zr.modShape(target.id, target); } else if (this.shapeList[i].style._hasSelected - && this._selectedMode == 'single' + && this._selectedMode === 'single' ) { seriesIndex = ecData.get(this.shapeList[i], 'seriesIndex'); dataIndex = ecData.get(this.shapeList[i], 'dataIndex'); @@ -41197,8 +43246,8 @@ define('echarts/chart/pie',['require','../component/base','./base','zrender/shap ecConfig.EVENT.PIE_SELECTED, param.event, { - selected : this._selected, - target : ecData.get(target, 'name') + selected: this._selected, + target: ecData.get(target, 'name') }, this.myChart ); diff --git a/build/echarts-plain.js b/build/echarts-plain.js index 287220b..0e75681 100644 --- a/build/echarts-plain.js +++ b/build/echarts-plain.js @@ -13,8 +13,7 @@ // Zepto.js may be freely distributed under the MIT license. /*! - * ZRender, a lightweight canvas library with a MVC architecture, data-driven - * and provides an event model like DOM. + * ZRender, a high performance canvas library. * * Copyright (c) 2013, Baidu Inc. * All rights reserved. @@ -33,4 +32,4 @@ * https://github.com/ecomfe/echarts/blob/master/LICENSE.txt */ -(function(e){var t,n,r;(function(e){function d(e,t){return h.call(e,t)}function v(e,t){var n,r,i,s,o,u,a,f,c,h,p=t&&t.split("/"),d=l.map,v=d&&d["*"]||{};if(e&&e.charAt(0)===".")if(t){p=p.slice(0,p.length-1),e=p.concat(e.split("/"));for(f=0;f0&&(e.splice(f-1,2),f-=2)}}e=e.join("/")}else e.indexOf("./")===0&&(e=e.substring(2));if((p||v)&&d){n=e.split("/");for(f=n.length;f>0;f-=1){r=n.slice(0,f).join("/");if(p)for(c=p.length;c>0;c-=1){i=d[p.slice(0,c).join("/")];if(i){i=i[r];if(i){s=i,o=f;break}}}if(s)break;!u&&v&&v[r]&&(u=v[r],a=f)}!s&&u&&(s=u,o=a),s&&(n.splice(0,o,s),e=n.join("/"))}return e}function m(t,n){return function(){return s.apply(e,p.call(arguments,0).concat([t,n]))}}function g(e){return function(t){return v(t,e)}}function y(e){return function(t){a[e]=t}}function b(t){if(d(f,t)){var n=f[t];delete f[t],c[t]=!0,i.apply(e,n)}if(!d(a,t)&&!d(c,t))throw new Error("No "+t);return a[t]}function w(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function E(e){return function(){return l&&l.config&&l.config[e]||{}}}var i,s,o,u,a={},f={},l={},c={},h=Object.prototype.hasOwnProperty,p=[].slice;o=function(e,t){var n,r=w(e),i=r[0];return e=r[1],i&&(i=v(i,t),n=b(i)),i?n&&n.normalize?e=n.normalize(e,g(t)):e=v(e,t):(e=v(e,t),r=w(e),i=r[0],e=r[1],i&&(n=b(i))),{f:i?i+"!"+e:e,n:e,pr:i,p:n}},u={require:function(e){return m(e)},exports:function(e){var t=a[e];return typeof t!="undefined"?t:a[e]={}},module:function(e){return{id:e,uri:"",exports:a[e],config:E(e)}}},i=function(t,n,r,i){var s,l,h,p,v,g=[],w;i=i||t;if(typeof r=="function"){n=!n.length&&r.length?["require","exports","module"]:n;for(v=0;v{b} : {c}",showDelay:20,hideDelay:100,transitionDuration:.4,backgroundColor:"rgba(0,0,0,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,axisPointer:{type:"line",lineStyle:{color:"#48b",width:2,type:"solid"},crossStyle:{color:"#1e90ff",width:1,type:"dashed"},shadowStyle:{color:"rgba(150,150,150,0.3)",width:"auto",type:"default"}},textStyle:{color:"#fff"}},dataZoom:{show:!1,orient:"horizontal",backgroundColor:"rgba(0,0,0,0)",dataBackgroundColor:"#eee",fillerColor:"rgba(144,197,237,0.2)",handleColor:"rgba(70,130,180,0.8)",realtime:!0},grid:{x:80,y:60,x2:80,y2:60,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},categoryAxis:{position:"bottom",name:"",nameLocation:"end",nameTextStyle:{},boundaryGap:!0,axisLine:{show:!0,onZero:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!0,interval:"auto",inside:!1,length:5,lineStyle:{color:"#333",width:1}},axisLabel:{show:!0,interval:"auto",rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}}},valueAxis:{position:"left",name:"",nameLocation:"end",nameTextStyle:{},boundaryGap:[0,0],precision:0,power:100,splitNumber:5,axisLine:{show:!0,onZero:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,inside:!1,length:5,lineStyle:{color:"#333",width:1}},axisLabel:{show:!0,rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}}},polar:{center:["50%","50%"],radius:"75%",startAngle:90,splitNumber:5,name:{show:!0,textStyle:{color:"#333"}},axisLine:{show:!0,lineStyle:{color:"#ccc",width:1,type:"solid"}},axisLabel:{show:!1,textStyle:{color:"#333"}},splitArea:{show:!0,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}},splitLine:{show:!0,lineStyle:{width:1,color:"#ccc"}},type:"polygon"},timeline:{show:!0,type:"time",notMerge:!1,realtime:!0,x:80,x2:80,y2:0,height:50,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,controlPosition:"left",autoPlay:!1,loop:!0,playInterval:2e3,lineStyle:{width:1,color:"#666",type:"dashed"},label:{show:!0,interval:"auto",rotate:0,textStyle:{color:"#333"}},checkpointStyle:{symbol:"auto",symbolSize:"auto",color:"auto",borderColor:"auto",borderWidth:"auto",label:{show:!1,textStyle:{color:"auto"}}},controlStyle:{normal:{color:"#333"},emphasis:{color:"#1e90ff"}},symbol:"emptyDiamond",symbolSize:4,currentIndex:0},bar:{xAxisIndex:0,yAxisIndex:0,barMinHeight:0,barGap:"30%",barCategoryGap:"20%",itemStyle:{normal:{borderColor:"#fff",borderRadius:0,borderWidth:0,label:{show:!1}},emphasis:{borderColor:"#fff",borderRadius:0,borderWidth:0,label:{show:!1}}}},line:{xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid",shadowColor:"rgba(0,0,0,0)",shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0}},emphasis:{label:{show:!1}}},symbolSize:2,showAllSymbol:!1},k:{xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{color:"#fff",color0:"#00aa11",lineStyle:{width:1,color:"#ff3200",color0:"#00aa11"}},emphasis:{}}},scatter:{xAxisIndex:0,yAxisIndex:0,symbolSize:4,large:!1,largeThreshold:2e3,itemStyle:{normal:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}},emphasis:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}}}},radar:{polarIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid"}},emphasis:{label:{show:!1}}},symbolSize:2},pie:{center:["50%","50%"],radius:[0,"75%"],clockWise:!0,startAngle:90,minAngle:0,selectedOffset:10,itemStyle:{normal:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1,type:"solid"}}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!1},labelLine:{show:!1,length:20,lineStyle:{width:1,type:"solid"}}}}},map:{mapType:"china",mapValuePrecision:0,showLegendSymbol:!0,hoverable:!0,itemStyle:{normal:{borderColor:"rgba(0,0,0,0)",borderWidth:1,areaStyle:{color:"#ccc"},label:{show:!1,textStyle:{color:"rgb(139,69,19)"}}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,areaStyle:{color:"rgba(255,215,0,0.8)"},label:{show:!1,textStyle:{color:"rgb(100,0,0)"}}}}},force:{center:["50%","50%"],size:"100%",coolDown:.99,minRadius:10,maxRadius:20,ratioScaling:!1,large:!1,useWorker:!1,steps:1,scaling:1,gravity:1,symbol:"circle",symbolSize:0,linkSymbol:null,linkSymbolSize:[10,15],draggable:!0,categories:[{}],itemStyle:{normal:{label:{show:!1},nodeStyle:{brushType:"both",color:"#f08c2e",strokeColor:"#5182ab",lineWidth:1},linkStyle:{strokeColor:"#5182ab"}},emphasis:{label:{show:!1},nodeStyle:{},linkStyle:{opacity:0}}}},chord:{radius:["65%","75%"],center:["50%","50%"],padding:2,sort:"none",sortSub:"none",startAngle:90,clockWise:!0,showScale:!1,showScaleText:!1,itemStyle:{normal:{label:{show:!0,rotate:!1,distance:10},lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:1,color:"#999"}}},emphasis:{lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:1,color:"#666"}}}},matrix:[]},gauge:{center:["50%","50%"],radius:"75%",startAngle:225,endAngle:-45,min:0,max:100,precision:0,splitNumber:10,axisLine:{show:!0,lineStyle:{color:[[.2,"#228b22"],[.8,"#48b"],[1,"#ff4500"]],width:30}},axisTick:{show:!0,splitNumber:5,length:8,lineStyle:{color:"#eee",width:1,type:"solid"}},axisLabel:{show:!0,textStyle:{color:"auto"}},splitLine:{show:!0,length:30,lineStyle:{color:"#eee",width:2,type:"solid"}},pointer:{show:!0,length:"80%",width:8,color:"auto"},title:{show:!0,offsetCenter:[0,"-40%"],textStyle:{color:"#333",fontSize:15}},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:40,offsetCenter:[0,"40%"],textStyle:{color:"auto",fontSize:30}}},funnel:{x:80,y:60,x2:80,y2:60,min:0,max:100,minSize:"0%",maxSize:"100%",sort:"descending",gap:0,itemStyle:{normal:{borderColor:"#fff",borderWidth:1,label:{show:!0,position:"outer"},labelLine:{show:!0,length:10,lineStyle:{width:1,type:"solid"}}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!0},labelLine:{show:!0}}}},island:{r:15,calculateStep:.1},markPoint:{symbol:"pin",symbolSize:10,large:!1,effect:{show:!1,loop:!0,period:15,scaleSize:2},itemStyle:{normal:{borderWidth:2,label:{show:!0,position:"inside"}},emphasis:{label:{show:!0}}}},markLine:{symbol:["circle","arrow"],symbolSize:[2,4],large:!1,effect:{show:!1,loop:!0,period:15,scaleSize:2},itemStyle:{normal:{borderWidth:1.5,label:{show:!0,position:"end"},lineStyle:{type:"dashed"}},emphasis:{label:{show:!1},lineStyle:{}}}},textStyle:{decoration:"none",fontFamily:"Arial, Verdana, sans-serif",fontFamily2:"微软雅黑",fontSize:12,fontStyle:"normal",fontWeight:"normal"},EVENT:{REFRESH:"refresh",RESTORE:"restore",RESIZE:"resize",CLICK:"click",HOVER:"hover",DATA_CHANGED:"dataChanged",DATA_ZOOM:"dataZoom",DATA_RANGE:"dataRange",LEGEND_SELECTED:"legendSelected",MAP_SELECTED:"mapSelected",PIE_SELECTED:"pieSelected",MAGIC_TYPE_CHANGED:"magicTypeChanged",DATA_VIEW_CHANGED:"dataViewChanged",TIMELINE_CHANGED:"timelineChanged",MAP_ROAM:"mapRoam",TOOLTIP_HOVER:"tooltipHover",TOOLTIP_IN_GRID:"tooltipInGrid",TOOLTIP_OUT_GRID:"tooltipOutGrid"},DRAG_ENABLE_TIME:120,EFFECT_ZLEVEL:7,symbolList:["circle","rectangle","triangle","diamond","emptyCircle","emptyRectangle","emptyTriangle","emptyDiamond"],loadingText:"Loading...",calculable:!1,calculableColor:"rgba(255,165,0,0.6)",calculableHolderColor:"#ccc",nameConnector:" & ",valueConnector:" : ",animation:!0,addDataAnimation:!0,animationThreshold:2e3,animationDuration:2e3,animationEasing:"ExponentialOut"};return e}),r("zrender/lib/excanvas",["require"],function(e){return document.createElement("canvas").getContext?G_vmlCanvasManager=!1:function(){function f(){return this.context_||(this.context_=new I(this))}function c(e,t,n){var r=l.call(arguments,2);return function(){return e.apply(t,r.concat(l.call(arguments)))}}function h(e){return String(e).replace(/&/g,"&").replace(/"/g,""")}function p(e,t,n){e.namespaces[t]||e.namespaces.add(t,n,"#default#VML")}function d(e){p(e,"g_vml_","urn:schemas-microsoft-com:vml"),p(e,"g_o_","urn:schemas-microsoft-com:office:office");if(!e.styleSheets.ex_canvas_){var t=e.createStyleSheet();t.owningElement.id="ex_canvas_",t.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}function m(e){var t=e.srcElement;switch(e.propertyName){case"width":t.getContext().clearRect(),t.style.width=t.attributes.width.nodeValue+"px",t.firstChild.style.width=t.clientWidth+"px";break;case"height":t.getContext().clearRect(),t.style.height=t.attributes.height.nodeValue+"px",t.firstChild.style.height=t.clientHeight+"px"}}function g(e){var t=e.srcElement;t.firstChild&&(t.firstChild.style.width=t.clientWidth+"px",t.firstChild.style.height=t.clientHeight+"px")}function E(){return[[1,0,0],[0,1,0],[0,0,1]]}function S(e,t){var n=E();for(var r=0;r<3;r++)for(var i=0;i<3;i++){var s=0;for(var o=0;o<3;o++)s+=e[r][o]*t[o][i];n[r][i]=s}return n}function x(e,t){t.fillStyle=e.fillStyle,t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY,t.strokeStyle=e.strokeStyle,t.globalAlpha=e.globalAlpha,t.font=e.font,t.textAlign=e.textAlign,t.textBaseline=e.textBaseline,t.arcScaleX_=e.arcScaleX_,t.arcScaleY_=e.arcScaleY_,t.lineScale_=e.lineScale_}function N(e){var t=e.indexOf("(",3),n=e.indexOf(")",t+1),r=e.substring(t+1,n).split(",");if(r.length!=4||e.charAt(3)!="a")r[3]=1;return r}function C(e){return parseFloat(e)/100}function k(e,t,n){return Math.min(n,Math.max(t,e))}function L(e){var t,n,r,i,s,o;i=parseFloat(e[0])/360%360,i<0&&i++,s=k(C(e[1]),0,1),o=k(C(e[2]),0,1);if(s==0)t=n=r=o;else{var u=o<.5?o*(1+s):o+s-o*s,a=2*o-u;t=A(a,u,i+1/3),n=A(a,u,i),r=A(a,u,i-1/3)}return"#"+y[Math.floor(t*255)]+y[Math.floor(n*255)]+y[Math.floor(r*255)]}function A(e,t,n){return n<0&&n++,n>1&&n--,6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function M(e){if(e in O)return O[e];var t,n=1;e=String(e);if(e.charAt(0)=="#")t=e;else if(/^rgb/.test(e)){var r=N(e),t="#",i;for(var s=0;s<3;s++)r[s].indexOf("%")!=-1?i=Math.floor(C(r[s])*255):i=+r[s],t+=y[k(i,0,255)];n=+r[3]}else if(/^hsl/.test(e)){var r=N(e);t=L(r),n=r[3]}else t=T[e]||e;return O[e]={color:t,alpha:n}}function P(e){if(D[e])return D[e];var t=document.createElement("div"),n=t.style,r;try{n.font=e,r=n.fontFamily.split(",")[0]}catch(i){}return D[e]={style:n.fontStyle||_.style,variant:n.fontVariant||_.variant,weight:n.fontWeight||_.weight,size:n.fontSize||_.size,family:r||_.family}}function H(e,t){var n={};for(var r in e)n[r]=e[r];var i=parseFloat(t.currentStyle.fontSize),s=parseFloat(e.size);return typeof e.size=="number"?n.size=e.size:e.size.indexOf("px")!=-1?n.size=s:e.size.indexOf("em")!=-1?n.size=i*s:e.size.indexOf("%")!=-1?n.size=i/100*s:e.size.indexOf("pt")!=-1?n.size=s/.75:n.size=i,n}function B(e){return e.style+" "+e.variant+" "+e.weight+" "+e.size+"px '"+e.family+"'"}function F(e){return j[e]||"square"}function I(e){this.m_=E(),this.mStack_=[],this.aStack_=[],this.currentPath_=[],this.strokeStyle="#000",this.fillStyle="#000",this.lineWidth=1,this.lineJoin="miter",this.lineCap="butt",this.miterLimit=o*1,this.globalAlpha=1,this.font="12px 微软雅黑",this.textAlign="left",this.textBaseline="alphabetic",this.canvas=e;var t="width:"+e.clientWidth+"px;height:"+e.clientHeight+"px;overflow:hidden;position:absolute",n=e.ownerDocument.createElement("div");n.style.cssText=t,e.appendChild(n);var r=n.cloneNode(!1);r.style.backgroundColor="#fff",r.style.filter="alpha(opacity=0)",e.appendChild(r),this.element_=n,this.arcScaleX_=1,this.arcScaleY_=1,this.lineScale_=1}function R(e,t,n,r){e.currentPath_.push({type:"bezierCurveTo",cp1x:t.x,cp1y:t.y,cp2x:n.x,cp2y:n.y,x:r.x,y:r.y}),e.currentX_=r.x,e.currentY_=r.y}function U(e,t){var n=M(e.strokeStyle),r=n.color,i=n.alpha*e.globalAlpha,s=e.lineScale_*e.lineWidth;s<1&&(i*=s),t.push("')}function z(t,n,r,i){var s=t.fillStyle,u=t.arcScaleX_,a=t.arcScaleY_,f=i.x-r.x,l=i.y-r.y;if(s instanceof $){var c=0,h={x:0,y:0},p=0,d=1;if(s.type_=="gradient"){var v=s.x0_/u,m=s.y0_/a,g=s.x1_/u,y=s.y1_/a,b=W(t,v,m),w=W(t,g,y),E=w.x-b.x,S=w.y-b.y;c=Math.atan2(E,S)*180/Math.PI,c<0&&(c+=360),c<1e-6&&(c=0)}else{var b=W(t,s.x0_,s.y0_);h={x:(b.x-r.x)/f,y:(b.y-r.y)/l},f/=u*o,l/=a*o;var x=e.max(f,l);p=2*s.r0_/x,d=2*s.r1_/x-p}var T=s.colors_;T.sort(function(e,t){return e.offset-t.offset});var N=T.length,C=T[0].color,k=T[N-1].color,L=T[0].alpha*t.globalAlpha,A=T[N-1].alpha*t.globalAlpha,O=[];for(var _=0;_')}else if(s instanceof J){if(f&&l){var P=-r.x,H=-r.y;n.push("')}}else{var B=M(t.fillStyle),j=B.color,F=B.alpha*t.globalAlpha;n.push('')}}function W(e,t,n){var r=e.m_;return{x:o*(t*r[0][0]+n*r[1][0]+r[2][0])-u,y:o*(t*r[0][1]+n*r[1][1]+r[2][1])-u}}function X(e){return isFinite(e[0][0])&&isFinite(e[0][1])&&isFinite(e[1][0])&&isFinite(e[1][1])&&isFinite(e[2][0])&&isFinite(e[2][1])}function V(e,t,n){if(!X(t))return;e.m_=t;if(n){var r=t[0][0]*t[1][1]-t[0][1]*t[1][0];e.lineScale_=s(i(r))}}function $(e){this.type_=e,this.x0_=0,this.y0_=0,this.r0_=0,this.x1_=0,this.y1_=0,this.r1_=0,this.colors_=[]}function J(e,t){Q(e);switch(t){case"repeat":case null:case"":this.repetition_="repeat";break;case"repeat-x":case"repeat-y":case"no-repeat":this.repetition_=t;break;default:K("SYNTAX_ERR")}this.src_=e.src,this.width_=e.width,this.height_=e.height}function K(e){throw new G(e)}function Q(e){(!e||e.nodeType!=1||e.tagName!="IMG")&&K("TYPE_MISMATCH_ERR"),e.readyState!="complete"&&K("INVALID_STATE_ERR")}function G(e){this.code=this[e],this.message=e+": DOM Exception "+this.code}var e=Math,t=e.round,n=e.sin,r=e.cos,i=e.abs,s=e.sqrt,o=10,u=o/2,a=+navigator.userAgent.match(/MSIE ([\d.]+)?/)[1],l=Array.prototype.slice;d(document);var v={init:function(e){var t=e||document;t.createElement("canvas"),t.attachEvent("onreadystatechange",c(this.init_,this,t))},init_:function(e){var t=e.getElementsByTagName("canvas");for(var n=0;n'),(f||l)&&w.push('
'),w.push('
'),(f||l)&&w.push("
"),w.push("
"),this.element_.insertAdjacentHTML("BeforeEnd",w.join(""))},q.stroke=function(e){var n=[],r=!1,i=10,s=10;n.push("f.x)f.x=c.x;if(a.y==null||c.yf.y)f.y=c.y}}n.push(' ">'),e?z(this,n,a,f):U(this,n),n.push(""),this.element_.insertAdjacentHTML("beforeEnd",n.join(""))},q.fill=function(){this.stroke(!0)},q.closePath=function(){this.currentPath_.push({type:"close"})},q.save=function(){var e={};x(this,e),this.aStack_.push(e),this.mStack_.push(this.m_),this.m_=S(E(),this.m_)},q.restore=function(){this.aStack_.length&&(x(this.aStack_.pop(),this),this.m_=this.mStack_.pop())},q.translate=function(e,t){var n=[[1,0,0],[0,1,0],[e,t,1]];V(this,S(n,this.m_),!1)},q.rotate=function(e){var t=r(e),i=n(e),s=[[t,i,0],[-i,t,0],[0,0,1]];V(this,S(s,this.m_),!1)},q.scale=function(e,t){this.arcScaleX_*=e,this.arcScaleY_*=t;var n=[[e,0,0],[0,t,0],[0,0,1]];V(this,S(n,this.m_),!0)},q.transform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,S(o,this.m_),!0)},q.setTransform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,o,!0)},q.drawText_=function(e,n,r,i,s){var u=this.m_,a=1e3,f=0,l=a,c={x:0,y:0},p=[],d=H(P(this.font),this.element_),v=B(d),m=this.element_.currentStyle,g=this.textAlign.toLowerCase();switch(g){case"left":case"center":case"right":break;case"end":g=m.direction=="ltr"?"right":"left";break;case"start":g=m.direction=="rtl"?"right":"left";break;default:g="left"}switch(this.textBaseline){case"hanging":case"top":c.y=d.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":c.y=-d.size/2.25}switch(g){case"right":f=a,l=.05;break;case"center":f=l=a/2}var y=W(this,n+c.x,r+c.y);p.push(''),s?U(this,p):z(this,p,{x:-f,y:0},{x:l,y:d.size});var b=u[0][0].toFixed(3)+","+u[1][0].toFixed(3)+","+u[0][1].toFixed(3)+","+u[1][1].toFixed(3)+",0,0",w=t(y.x/o)+","+t(y.y/o);p.push('','',''),this.element_.insertAdjacentHTML("beforeEnd",p.join(""))},q.fillText=function(e,t,n,r){this.drawText_(e,t,n,r,!1)},q.strokeText=function(e,t,n,r){this.drawText_(e,t,n,r,!0)},q.measureText=function(e){if(!this.textMeasureEl_){var t='';this.element_.insertAdjacentHTML("beforeEnd",t),this.textMeasureEl_=this.element_.lastChild}var n=this.element_.ownerDocument;return this.textMeasureEl_.innerHTML="",this.textMeasureEl_.style.font=this.font,this.textMeasureEl_.appendChild(n.createTextNode(e)),{width:this.textMeasureEl_.offsetWidth}},q.clip=function(){},q.arcTo=function(){},q.createPattern=function(e,t){return new J(e,t)},$.prototype.addColorStop=function(e,t){t=M(t),this.colors_.push({offset:e,color:t.color,alpha:t.alpha})};var Y=G.prototype=new Error;Y.INDEX_SIZE_ERR=1,Y.DOMSTRING_SIZE_ERR=2,Y.HIERARCHY_REQUEST_ERR=3,Y.WRONG_DOCUMENT_ERR=4,Y.INVALID_CHARACTER_ERR=5,Y.NO_DATA_ALLOWED_ERR=6,Y.NO_MODIFICATION_ALLOWED_ERR=7,Y.NOT_FOUND_ERR=8,Y.NOT_SUPPORTED_ERR=9,Y.INUSE_ATTRIBUTE_ERR=10,Y.INVALID_STATE_ERR=11,Y.SYNTAX_ERR=12,Y.INVALID_MODIFICATION_ERR=13,Y.NAMESPACE_ERR=14,Y.INVALID_ACCESS_ERR=15,Y.VALIDATION_ERR=16,Y.TYPE_MISMATCH_ERR=17,G_vmlCanvasManager=v,CanvasRenderingContext2D=I,CanvasGradient=$,CanvasPattern=J,DOMException=G}(),G_vmlCanvasManager}),r("zrender/tool/util",["require","../lib/excanvas"],function(e){function n(e){if(typeof e=="object"&&e!==null){var r=e;if(e instanceof Array){r=[];for(var i=0,s=e.length;if&&(f=e+c+n,u.width=f,r=!0),t+h>l&&(l=t+h+n,u.height=l,r=!0),e<-c&&(c=Math.ceil(-e/n)*n,f+=c,u.width=f,r=!0),t<-h&&(h=Math.ceil(-t/n)*n,l+=h,u.height=l,r=!0),r&&a.translate(c,h)}function v(){return{x:c,y:h}}function m(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n3&&(t=Array.prototype.slice.call(t,1));if(this._handlers[e]){var r=this._handlers[e],i=r.length;for(var s=0;s4&&(t=Array.prototype.slice.call(t,1,t.length-1));var r=t[t.length-1];if(this._handlers[e]){var i=this._handlers[e],s=i.length;for(var o=0;o1)for(var e in arguments)console.log(arguments[e])}}),r("zrender/tool/guid",[],function(){var e=2311;return function(){return"zrender__"+e++}}),r("zrender/Handler",["require","./config","./tool/env","./tool/event","./tool/util"],function(e){function a(e,t){return function(n){return e.call(t,n)}}function f(e){var t=o.length;while(t--){var n=o[t];e["_"+n+"Handler"]=a(u[n],e)}}function l(e,t,i){r.Dispatcher.call(this),this.root=e,this.storage=t,this.painter=i,this._lastX=this._lastY=this._mouseX=this._mouseY=0,this._findHover=a(h,this),this._domHover=i.getDomHover(),f(this),window.addEventListener?(window.addEventListener("resize",this._resizeHandler),n.os.tablet||n.os.phone?(e.addEventListener("touchstart",this._touchstartHandler),e.addEventListener("touchmove",this._touchmoveHandler),e.addEventListener("touchend",this._touchendHandler)):(e.addEventListener("click",this._clickHandler),e.addEventListener("mousewheel",this._mousewheelHandler),e.addEventListener("mousemove",this._mousemoveHandler),e.addEventListener("mousedown",this._mousedownHandler),e.addEventListener("mouseup",this._mouseupHandler)),e.addEventListener("DOMMouseScroll",this._mousewheelHandler),e.addEventListener("mouseout",this._mouseoutHandler)):(window.attachEvent("onresize",this._resizeHandler),e.attachEvent("onclick",this._clickHandler),e.attachEvent("onmousewheel",this._mousewheelHandler),e.attachEvent("onmousemove",this._mousemoveHandler),e.attachEvent("onmouseout",this._mouseoutHandler),e.attachEvent("onmousedown",this._mousedownHandler),e.attachEvent("onmouseup",this._mouseupHandler))}function h(e){if(this._draggingTarget&&this._draggingTarget.id==e.id||e.isSilent())return!1;var t=this._event;if(e.isCover(this._mouseX,this._mouseY)){e.hoverable&&this.storage.addHover(e);var n=e.parent;while(n){if(n.clipShape&&!n.clipShape.isCover(this._mouseX,this._mouseY))return!1;n=n.parent}return this._lastHover!=e&&(this._processOutShape(t),this._processDragLeave(t),this._lastHover=e,this._processDragEnter(t)),this._processOverShape(t),this._processDragOver(t),this._hasfound=1,!0}return!1}var t=e("./config"),n=e("./tool/env"),r=e("./tool/event"),i=e("./tool/util"),s=t.EVENT,o=["resize","click","mousewheel","mousemove","mouseout","mouseup","mousedown","touchstart","touchend","touchmove"],u={resize:function(e){e=e||window.event,this._lastHover=null,this._isMouseDown=0,this.dispatch(s.RESIZE,e)},click:function(e){e=this._zrenderEventFixed(e);var t=this._lastHover;(t&&t.clickable||!t)&&this._dispatchAgency(t,s.CLICK,e),this._mousemoveHandler(e)},mousewheel:function(e){e=this._zrenderEventFixed(e),this._dispatchAgency(this._lastHover,s.MOUSEWHEEL,e),this._mousemoveHandler(e)},mousemove:function(e){if(this.painter.isLoading())return;e=this._zrenderEventFixed(e),this._lastX=this._mouseX,this._lastY=this._mouseY,this._mouseX=r.getX(e),this._mouseY=r.getY(e),this._processDragStart(e),this._hasfound=0,this._event=e,this.storage.iterShape(this._findHover,{normal:"down"});if(!this._hasfound){if(!this._draggingTarget||this._lastHover&&this._lastHover!=this._draggingTarget)this._processOutShape(e),this._processDragLeave(e);this._lastHover=null,this.storage.delHover(),this.painter.clearHover()}this._draggingTarget&&(this.storage.drift(this._draggingTarget.id,this._mouseX-this._lastX,this._mouseY-this._lastY),this.storage.addHover(this._draggingTarget));var t="default";this._draggingTarget||this._hasfound&&this._lastHover.draggable?t="move":this._hasfound&&this._lastHover.clickable&&(t="pointer"),this.root.style.cursor=t,this._dispatchAgency(this._lastHover,s.MOUSEMOVE,e),(this._draggingTarget||this._hasfound||this.storage.hasHoverShape())&&this.painter.refreshHover()},mouseout:function(e){e=this._zrenderEventFixed(e);var t=e.toElement||e.relatedTarget;if(t!=this.root)while(t&&t.nodeType!=9){if(t==this.root){this._mousemoveHandler(e);return}t=t.parentNode}e.zrenderX=this._lastX,e.zrenderY=this._lastY,this.root.style.cursor="default",this._isMouseDown=0,this._processOutShape(e),this._processDrop(e),this._processDragEnd(e),this.painter.isLoading()||this.painter.refreshHover(),this.dispatch(s.GLOBALOUT,e)},mousedown:function(e){if(this._lastDownButton==2){this._lastDownButton=e.button,this._mouseDownTarget=null;return}this._lastMouseDownMoment=new Date,e=this._zrenderEventFixed(e),this._isMouseDown=1,this._mouseDownTarget=this._lastHover,this._dispatchAgency(this._lastHover,s.MOUSEDOWN,e),this._lastDownButton=e.button},mouseup:function(e){e=this._zrenderEventFixed(e),this.root.style.cursor="default",this._isMouseDown=0,this._mouseDownTarget=null,this._dispatchAgency(this._lastHover,s.MOUSEUP,e),this._processDrop(e),this._processDragEnd(e)},touchstart:function(e){e=this._zrenderEventFixed(e,!0),this._lastTouchMoment=new Date,this._mobildFindFixed(e),this._mousedownHandler(e)},touchmove:function(e){e=this._zrenderEventFixed(e,!0),this._mousemoveHandler(e),this._isDragging&&r.stop(e)},touchend:function(e){e=this._zrenderEventFixed(e,!0),this._mouseupHandler(e),new Date-this._lastTouchMoment1e-4||Math.abs(this.position[0])>1e-4||Math.abs(this.position[1])>1e-4||Math.abs(this.scale[0]-1)>1e-4||Math.abs(this.scale[1]-1)>1e-4},updateTransform:function(){this.updateNeedTransform(),this.parent?this.needTransform=this.needLocalTransform||this.parent.needTransform:this.needTransform=this.needLocalTransform;if(!this.needTransform)return;var e=this.transform||t.create();t.identity(e);if(this.needLocalTransform){if(this.scale&&(this.scale[0]!==1||this.scale[1]!==1)){n[0]=-this.scale[2]||0,n[1]=-this.scale[3]||0,(n[0]||n[1])&&t.translate(e,e,n),t.scale(e,e,this.scale);if(n[0]||n[1])n[0]=-n[0],n[1]=-n[1],t.translate(e,e,n)}if(this.rotation)if(this.rotation instanceof Array){if(this.rotation[0]!==0){n[0]=-this.rotation[1]||0,n[1]=-this.rotation[2]||0,(n[0]||n[1])&&t.translate(e,e,n),t.rotate(e,e,this.rotation[0]);if(n[0]||n[1])n[0]=-n[0],n[1]=-n[1],t.translate(e,e,n)}}else this.rotation!==0&&t.rotate(e,e,this.rotation);this.position&&(this.position[0]!==0||this.position[1]!==0)&&t.translate(e,e,this.position)}this.transform=e,this.parent&&this.parent.needTransform&&(this.needLocalTransform?t.mul(this.transform,this.parent.transform,this.transform):t.copy(this.transform,this.parent.transform))},setTransform:function(e){if(this.needTransform){var t=this.transform;e.transform(t[0],t[1],t[2],t[3],t[4],t[5])}}},r}),r("zrender/tool/color",["require","../tool/util"],function(e){function f(e){r=e}function l(){r=i}function c(e,t){return e|=0,t=t||r,t[e%t.length]}function h(e){s=e}function p(){o=s}function d(){return s}function v(e,r,i,s,o,u,a){n||(n=t.getContext());var f=n.createRadialGradient(e,r,i,s,o,u);for(var l=0,c=a.length;l1)for(var i=0,s=r-1;i1?Math.ceil(e):e});if(t.indexOf("hex")>-1)return"#"+((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1);if(t.indexOf("hs")>-1){var n=q(e.slice(1,3),function(e){return e+"%"});e[1]=n[0],e[2]=n[1]}return t.indexOf("a")>-1?(e.length===3&&e.push(1),e[3]=R(e[3],[0,1]),t+"("+e.slice(0,4).join(",")+")"):t+"("+e.slice(0,3).join(",")+")"}}function w(e){e=_(e),e.indexOf("rgba")<0&&(e=S(e));var t=[],n=0;return e.replace(/[\d.]+/g,function(e){n<3?e|=0:e=+e,t[n++]=e}),t}function E(e,t){var n=F(e),r=n[3];return typeof r=="undefined"&&(r=1),e.indexOf("hsb")>-1?n=U(n):e.indexOf("hsl")>-1&&(n=z(n)),t.indexOf("hsb")>-1||t.indexOf("hsv")>-1?n=X(n):t.indexOf("hsl")>-1&&(n=V(n)),n[3]=r,b(n,t)}function S(e){return E(e,"rgba")}function x(e){return E(e,"rgb")}function T(e){return E(e,"hex")}function N(e){return E(e,"hsva")}function C(e){return E(e,"hsv")}function k(e){return E(e,"hsba")}function L(e){return E(e,"hsb")}function A(e){return E(e,"hsla")}function O(e){return E(e,"hsl")}function M(e){for(var t in a)if(T(a[t])===T(e))return t;return null}function _(e){return String(e).replace(/\s+/g,"")}function D(e){a[e]&&(e=a[e]),e=_(e),e=e.replace(/hsv/i,"hsb");if(/^#[\da-f]{3}$/i.test(e)){e=parseInt(e.slice(1),16);var t=(e&3840)<<8,n=(e&240)<<4,r=e&15;e="#"+((1<<24)+(t<<4)+t+(n<<4)+n+(r<<4)+r).toString(16).slice(1)}return e}function P(e,t){var n=t>0?1:-1;typeof t=="undefined"&&(t=0),t=Math.abs(t)>1?1:Math.abs(t),e=x(e);var r=F(e);for(var i=0;i<3;i++)n===1?r[i]=r[i]*(1-t)|0:r[i]=(255-r[i])*t+r[i]|0;return"rgb("+r.join(",")+")"}function H(e){var t=F(S(e));return t=q(t,function(e){return 255-e}),b(t,"rgb")}function B(e,t,n){typeof n=="undefined"&&(n=.5),n=1-R(n,[0,1]);var r=n*2-1,i=F(S(e)),s=F(S(t)),o=i[3]-s[3],u=((r*o===-1?r:(r+o)/(1+r*o))+1)/2,a=1-u,f=[];for(var l=0;l<3;l++)f[l]=i[l]*u+s[l]*a;var c=i[3]*n+s[3]*(1-n);return c=Math.max(0,Math.min(1,c)),i[3]===1&&s[3]===1?b(f,"rgb"):(f[3]=c,b(f,"rgba"))}function j(){return"#"+Math.random().toString(16).slice(2,8)}function F(e){e=D(e);var t=e.match(u);if(t===null)throw new Error("The color format error");var n,r,i=[],s;if(t[2])n=t[2].replace("#","").split(""),s=[n[0]+n[1],n[2]+n[3],n[4]+n[5]],i=q(s,function(e){return R(parseInt(e,16),[0,255])});else if(t[4]){var o=t[4].split(",");r=o[3],s=o.slice(0,3),i=q(s,function(e){return e=Math.floor(e.indexOf("%")>0?parseInt(e,0)*2.55:e),R(e,[0,255])}),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}else if(t[5]||t[6]){var a=(t[5]||t[6]).split(","),f=parseInt(a[0],0)/360,l=a[1],c=a[2];r=a[3],i=q([l,c],function(e){return R(parseFloat(e)/100,[0,1])}),i.unshift(f),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}return i}function I(e,t){t===null&&(t=1);var n=F(S(e));return n[3]=R(Number(t).toFixed(4),[0,1]),b(n,"rgba")}function q(e,t){if(typeof t!="function")throw new TypeError;var n=e?e.length:0;for(var r=0;r=t[1]&&(e=t[1]),e}function U(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u=t*6;u===6&&(u=0);var a=u|0,f=r*(1-n),l=r*(1-n*(u-a)),c=r*(1-n*(1-(u-a))),h=0,p=0,d=0;a===0?(h=r,p=c,d=f):a===1?(h=l,p=r,d=f):a===2?(h=f,p=r,d=c):a===3?(h=f,p=l,d=r):a===4?(h=c,p=f,d=r):(h=r,p=f,d=l),i=h*255,s=p*255,o=d*255}return[i,s,o]}function z(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u;r<.5?u=r*(1+n):u=r+n-n*r;var a=2*r-u;i=255*W(a,u,t+1/3),s=255*W(a,u,t),o=255*W(a,u,t-1/3)}return[i,s,o]}function W(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function X(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=s,a,f;if(o===0)a=0,f=0;else{f=o/s;var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}function V(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=(s+i)/2,a,f;if(o===0)a=0,f=0;else{u<.5?f=o/(s+i):f=o/(2-s-i);var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}var t=e("../tool/util"),n,r=["#ff9277"," #dddd00"," #ffc877"," #bbe3ff"," #d5ffbb","#bbbbff"," #ddb000"," #b0dd00"," #e2bbff"," #ffbbe3","#ff7777"," #ff9900"," #83dd00"," #77e3ff"," #778fff","#c877ff"," #ff77ab"," #ff6600"," #aa8800"," #77c7ff","#ad77ff"," #ff77ff"," #dd0083"," #777700"," #00aa00","#0088aa"," #8400dd"," #aa0088"," #dd0000"," #772e00"],i=r,s="rgba(255,255,0,0.5)",o=s,u=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,a={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#789",lightslategrey:"#789",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#f0f",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"};return{customPalette:f,resetPalette:l,getColor:c,getHighlightColor:d,customHighlight:h,resetHighlight:p,getRadialGradient:v,getLinearGradient:m,getGradientColors:y,getStepColors:g,reverse:H,mix:B,lift:P,trim:_,random:j,toRGB:x,toRGBA:S,toHex:T,toHSL:O,toHSLA:A,toHSB:L,toHSBA:k,toHSV:C,toHSVA:N,toName:M,toColor:b,toArray:w,alpha:I,getData:F}}),r("zrender/shape/Base",["require","../tool/matrix","../tool/guid","../tool/util","./mixin/Transformable","../tool/event","../tool/area","../tool/area","../tool/color","../tool/area"],function(e){function o(t,n,r,i,s,o,a){s&&(t.font=s),t.textAlign=o,t.textBaseline=a;var f=u(n,r,i,s,o,a);n=(n+"").split("\n");var l=e("../tool/area").getTextHeight("国",s);switch(a){case"top":i=f.y;break;case"bottom":i=f.y+l;break;default:i=f.y+l/2}for(var c=0,h=n.length;c0&&e.stroke();break;default:e.fill()}this.drawText(e,n,this.style),e.restore()};var f=[["color","fillStyle"],["strokeColor","strokeStyle"],["opacity","globalAlpha"],["lineCap","lineCap"],["lineJoin","lineJoin"],["miterLimit","miterLimit"],["lineWidth","lineWidth"],["shadowBlur","shadowBlur"],["shadowColor","shadowColor"],["shadowOffsetX","shadowOffsetX"],["shadowOffsetY","shadowOffsetY"]];return a.prototype.setContext=function(e,t){for(var n=0,r=f.length;n=i.x&&t<=i.x+i.width&&n>=i.y&&n<=i.y+i.height?e("../tool/area").isInside(this,this.style,t,n):!1},a.prototype.drawText=function(e,t,n){if(typeof t.text=="undefined"||t.text===!1)return;var r=t.textColor||t.color||t.strokeColor;e.fillStyle=r;var i=10,s,u,a,f,l=t.textPosition||this.textPosition||"top";switch(l){case"inside":case"top":case"bottom":case"left":case"right":if(this.getRect){var c=(n||t).__rect||this.getRect(n||t);switch(l){case"inside":a=c.x+c.width/2,f=c.y+c.height/2,s="center",u="middle",t.brushType!="stroke"&&r==t.color&&(e.fillStyle="#fff");break;case"left":a=c.x-i,f=c.y+c.height/2,s="end",u="middle";break;case"right":a=c.x+c.width+i,f=c.y+c.height/2,s="start",u="middle";break;case"top":a=c.x+c.width/2,f=c.y-i,s="center",u="bottom";break;case"bottom":a=c.x+c.width/2,f=c.y+c.height+i,s="center",u="top"}}break;case"start":case"end":var h,p,d,v;if(typeof t.pointList!="undefined"){var m=t.pointList;if(m.length<2)return;var g=m.length;switch(l){case"start":h=m[0][0],p=m[1][0],d=m[0][1],v=m[1][1];break;case"end":h=m[g-2][0],p=m[g-1][0],d=m[g-2][1],v=m[g-1][1]}}else h=t.xStart||0,p=t.xEnd||0,d=t.yStart||0,v=t.yEnd||0;switch(l){case"start":s=h0&&l[0]===""&&l.shift();for(var c=0;c0){if(isNaN(l[0]))break;var h=null,p=[],d,v,m,g,y,b,w,E,S=o,x=u;switch(f){case"l":o+=l.shift(),u+=l.shift(),h="L",p.push(o,u);break;case"L":o=l.shift(),u=l.shift(),p.push(o,u);break;case"m":o+=l.shift(),u+=l.shift(),h="M",p.push(o,u),f="l";break;case"M":o=l.shift(),u=l.shift(),h="M",p.push(o,u),f="L";break;case"h":o+=l.shift(),h="L",p.push(o,u);break;case"H":o=l.shift(),h="L",p.push(o,u);break;case"v":u+=l.shift(),h="L",p.push(o,u);break;case"V":u=l.shift(),h="L",p.push(o,u);break;case"C":p.push(l.shift(),l.shift(),l.shift(),l.shift()),o=l.shift(),u=l.shift(),p.push(o,u);break;case"c":p.push(o+l.shift(),u+l.shift(),o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="C",p.push(o,u);break;case"S":d=o,v=u,m=s[s.length-1],m.command==="C"&&(d=o+(o-m.points[2]),v=u+(u-m.points[3])),p.push(d,v,l.shift(),l.shift()),o=l.shift(),u=l.shift(),h="C",p.push(o,u);break;case"s":d=o,v=u,m=s[s.length-1],m.command==="C"&&(d=o+(o-m.points[2]),v=u+(u-m.points[3])),p.push(d,v,o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="C",p.push(o,u);break;case"Q":p.push(l.shift(),l.shift()),o=l.shift(),u=l.shift(),p.push(o,u);break;case"q":p.push(o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="Q",p.push(o,u);break;case"T":d=o,v=u,m=s[s.length-1],m.command==="Q"&&(d=o+(o-m.points[0]),v=u+(u-m.points[1])),o=l.shift(),u=l.shift(),h="Q",p.push(d,v,o,u);break;case"t":d=o,v=u,m=s[s.length-1],m.command==="Q"&&(d=o+(o-m.points[0]),v=u+(u-m.points[1])),o+=l.shift(),u+=l.shift(),h="Q",p.push(d,v,o,u);break;case"A":g=l.shift(),y=l.shift(),b=l.shift(),w=l.shift(),E=l.shift(),S=o,x=u,o=l.shift(),u=l.shift(),h="A",p=this._convertPoint(S,x,o,u,w,E,g,y,b);break;case"a":g=l.shift(),y=l.shift(),b=l.shift(),w=l.shift(),E=l.shift(),S=o,x=u,o+=l.shift(),u+=l.shift(),h="A",p=this._convertPoint(S,x,o,u,w,E,g,y,b)}s.push({command:h||f,points:p})}(f==="z"||f==="Z")&&s.push({command:"z",points:[]})}return s},_convertPoint:function(e,t,n,r,i,s,o,u,a){var f=a*(Math.PI/180),l=Math.cos(f)*(e-n)/2+Math.sin(f)*(t-r)/2,c=-1*Math.sin(f)*(e-n)/2+Math.cos(f)*(t-r)/2,h=l*l/(o*o)+c*c/(u*u);h>1&&(o*=Math.sqrt(h),u*=Math.sqrt(h));var p=Math.sqrt((o*o*u*u-o*o*c*c-u*u*l*l)/(o*o*c*c+u*u*l*l));i===s&&(p*=-1),isNaN(p)&&(p=0);var d=p*o*c/u,v=p*-u*l/o,m=(e+n)/2+Math.cos(f)*d-Math.sin(f)*v,g=(t+r)/2+Math.sin(f)*d+Math.cos(f)*v,y=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},b=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(y(e)*y(t))},w=function(e,t){return(e[0]*t[1]=1&&(T=0),s===0&&T>0&&(T-=2*Math.PI),s===1&&T<0&&(T+=2*Math.PI),[m,g,o,u,E,T,f,s]},buildPath:function(e,t){var n=t.path,r=this.pathArray||this._parsePathData(n),i=t.x||0,s=t.y||0,o,u=t.pointList=[],a=[];for(var f=0,l=r.length;f0&&u.push(a),a=[]),o=r[f].points;for(var c=0,h=o.length;c0&&u.push(a);var p;for(var f=0,l=r.length;fg?m:g,x=m>g?1:m/g,T=m>g?g/m:1;e.translate(d,v),e.rotate(w),e.scale(x,T),e.arc(0,0,S,y,y+b,1-E),e.scale(1/x,1/T),e.rotate(-w),e.translate(-d,-v);break;case"z":e.closePath()}}return},getRect:function(e){if(e.__rect)return e.__rect;var t;e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0;var n=Number.MAX_VALUE,r=Number.MIN_VALUE,i=Number.MAX_VALUE,s=Number.MIN_VALUE,o=e.x||0,u=e.y||0,a=this.pathArray||this._parsePathData(e.path);for(var f=0;fr&&(r=l[c]+o)):(l[c]+us&&(s=l[c]+u))}var h;return n===Number.MAX_VALUE||r===Number.MIN_VALUE||i===Number.MAX_VALUE||s===Number.MIN_VALUE?h={x:0,y:0,width:0,height:0}:h={x:Math.round(n-t/2),y:Math.round(i-t/2),width:r-n+t,height:s-i+t},e.__rect=h,h}},e("../tool/util").inherits(n,t),n}),r("zrender/tool/area",["require","../tool/util","../shape/Path"],function(e){function a(e,r,i,s){if(!r||!e)return!1;var o=e.type;n=n||t.getContext();if(!g(r.__rect||e.getRect(r),i,s))return!1;var u=f(o,r,i,s);if(typeof u!="undefined")return u;if(o!="bezier-curve"&&e.buildPath&&n.isPointInPath)return l(e,n,r,i,s);if(n.getImageData)return c(e,r,i,s);switch(o){case"heart":case"droplet":case"ellipse":return!0;case"trochoid":var a=r.location=="out"?r.r1+r.r2+r.d:r.r1-r.r2+r.d;return y(r,i,s,a);case"rose":return y(r,i,s,r.maxr);default:return!1}}function f(e,t,n,r){switch(e){case"line":return d(t,n,r);case"broken-line":return v(t,n,r);case"text":return!0;case"ring":return m(t,n,r);case"rectangle":return!0;case"circle":return y(t,n,r,t.r);case"sector":return b(t,n,r);case"path":return E(t,n,r);case"polygon":case"star":case"isogon":return w(t,n,r);case"image":return!0}}function l(e,t,n,r,i){return t.beginPath(),e.buildPath(t,n),t.closePath(),t.isPointInPath(r,i)}function c(e,n,r,i){var s=n.__rect||e.getRect(n),o=t.getPixelContext(),u=t.getPixelOffset();return t.adjustCanvasSize(r,i),o.clearRect(s.x,s.y,s.width,s.height),o.beginPath(),e.brush(o,{style:n}),o.closePath(),h(o,r+u.x,i+u.y)}function h(e,t,n,r){var i;typeof r!="undefined"?(r=(r||1)>>1,i=e.getImageData(t-r,n-r,r+r,r+r).data):i=e.getImageData(t,n,1,1).data;var s=i.length;while(s--)if(i[s]!==0)return!0;return!1}function p(e,t,n,r){return!a(e,t,n,r)}function d(e,t,n){var r=e.xStart,i=e.yStart,s=e.xEnd,o=e.yEnd,u=Math.max(e.lineWidth,5),a=0,f=r,l,c;rc||np)return!1;if(r===s)return Math.abs(t-r)<=u/2;a=(i-o)/(r-s),f=(r*o-s*i)/(r-s);var d=(a*t-n+f)*(a*t-n+f)/(a*a+1);return d<=u/2*u/2}function v(e,t,n){var r=e.pointList,i={xStart:0,yStart:0,xEnd:0,yEnd:0,lineWidth:0};for(var s=0,o=r.length-1;s=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function y(e,t,n,r){return(t-e.x)*(t-e.x)+(n-e.y)*(n-e.y)0&&y({x:e.x,y:e.y},t,n,e.r0))return!1;if(Math.abs(e.endAngle-e.startAngle)>=360)return!0;var r=(360-Math.atan2(n-e.y,t-e.x)/Math.PI*180)%360,i=(360+e.endAngle)%360,s=(360+e.startAngle)%360;return i>s?r>=s&&r<=i:!(r>=i&&r<=s)}function w(e,t,n){var r,i,s=e.pointList,o=s.length,u=!1,a=!0,f;for(r=0;rs[i][1]?--n:++n;break}}else if(s[r][1]==s[i][1]&&n==s[r][1]&&(s[r][0]u&&(s=0,r={}),a}function x(e,r){var s=e+":"+r;if(i[s])return i[s];n=n||t.getContext(),n.save(),r&&(n.font=r),e=(e+"").split("\n");var a=(n.measureText("国").width+2)*e.length;return n.restore(),i[s]=a,++o>u&&(o=0,i={}),a}var t=e("../tool/util"),n,r={},i={},s=0,o=0,u=2e4;return{isInside:a,isOutside:p,getTextWidth:S,getTextHeight:x}}),r("zrender/shape/Text",["require","../tool/area","./Base","../tool/util"],function(e){function r(e){n.call(this,e)}var t=e("../tool/area"),n=e("./Base");return r.prototype={type:"text",brush:function(e,n){var r=this.style;n&&(r=this.getHighlightStyle(r,this.highlightStyle||{}));if(typeof r.text=="undefined"||r.text===!1)return;e.save(),this.setContext(e,r),this.setTransform(e),r.textFont&&(e.font=r.textFont),e.textAlign=r.textAlign||"start",e.textBaseline=r.textBaseline||"middle";var i=(r.text+"").split("\n"),s=t.getTextHeight("国",r.textFont),o=this.getRect(r),u=r.x,a;r.textBaseline=="top"?a=o.y:r.textBaseline=="bottom"?a=o.y+s:a=o.y+s/2;for(var f=0,l=i.length;f=t[1]&&(e=t[1]),e},o}),r("zrender/shape/Image",["require","./Base","../tool/util"],function(e){function s(e){i.call(this,e)}var t={},n=[],r,i=e("./Base");return s.prototype={type:"image",brush:function(e,i,s){var o=this.style||{};i&&(o=this.getHighlightStyle(o,this.highlightStyle||{}));var u=o.image,a=this;if(typeof u=="string"){var f=u;t[f]?u=t[f]:(u=new Image,u.onload=function(){u.onload=null,clearTimeout(r),n.push(a),r=setTimeout(function(){s&&s(n),n=[]},10)},t[f]=u,u.src=f)}if(u){if(u.nodeName.toUpperCase()=="IMG")if(window.ActiveXObject){if(u.readyState!="complete")return}else if(!u.complete)return;var l=o.width||u.width,c=o.height||u.height,h=o.x,p=o.y;if(!u.width||!u.height)return;e.save(),this.setContext(e,o),this.setTransform(e);if(o.sWidth&&o.sHeight){var d=o.sx||0,v=o.sy||0;e.drawImage(u,d,v,o.sWidth,o.sHeight,h,p,l,c)}else if(o.sx&&o.sy){var d=o.sx,v=o.sy,m=l-d,g=c-v;e.drawImage(u,d,v,m,g,h,p,l,c)}else e.drawImage(u,h,p,l,c);o.width=l,o.height=c,this.style.width=l,this.style.height=c,this.drawText(e,o,this.style),e.restore()}},buildPath:function(e,t){e.rect(t.x,t.y,t.width,t.height);return},getRect:function(e){return{x:e.x,y:e.y,width:e.width,height:e.height}}},e("../tool/util").inherits(s,i),s}),r("zrender/Painter",["require","./config","./tool/util","./tool/log","./tool/matrix","./loadingEffect/Base","./shape/Image"],function(e){function a(){return!1}function f(){}function l(e,t){this.root=e,this.storage=t,e.innerHTML="",this._width=this._getWidth(),this._height=this._getHeight();var n=document.createElement("div");this._domRoot=n,n.style.position="relative",n.style.overflow="hidden",n.style.width=this._width+"px",n.style.height=this._height+"px",e.appendChild(n),this._layers={},this._layerConfig={},this._loadingEffect=new s({}),this.shapeToImage=this._createShapeToImageProcessor(),this._bgDom=c("bg","div",this),n.appendChild(this._bgDom);var r=new h("_zrender_hover_",this);this._layers.hover=r,n.appendChild(r.dom),r.initContext(),r.onselectstart=a;var i=this;this.updatePainter=function(e,t){i.update(e,t)}}function c(e,t,n){var r=document.createElement(t),i=n._width,s=n._height;return r.style.position="absolute",r.style.left=0,r.style.top=0,r.style.width=i+"px",r.style.height=s+"px",r.setAttribute("width",i*o),r.setAttribute("height",s*o),r.setAttribute("data-zr-dom-id",e),r}function h(e,t){this.dom=c(e,"canvas",t),u&&u.initElement(this.dom),this.domBack=null,this.ctxBack=null,this.painter=t,this.unusedCount=0,this.config=null,this.dirty=!0,this.elCount=0}var t=e("./config"),n=e("./tool/util"),r=e("./tool/log"),i=e("./tool/matrix"),s=e("./loadingEffect/Base"),o=window.devicePixelRatio||1;o=Math.max(o,1);var u=window.G_vmlCanvasManager;return l.prototype.render=function(e){return this.isLoading()&&this.hideLoading(),this.refresh(e,!0),this},l.prototype.refresh=function(e,t){var n=this.storage.getShapeList(!0);return this._paintList(n,t),typeof e=="function"&&e(),this},l.prototype._paintList=function(e,n){typeof n=="undefined"&&(n=!1),this._updateLayerStatus(e);var s,o,a;for(var f in this._layers)f!=="hover"&&this._layers[f].unusedCount++;var l=[];for(var c=0,h=e.length;c=500?(delete this._layers[f],g.dom.parentNode.removeChild(g.dom)):g.unusedCount==1&&g.clear()}},l.prototype.getLayer=function(e,t){var n=this._layers[e];if(!n){n=new h(e,this);var r=t?t.dom:this._bgDom;r.nextSibling?r.parentNode.insertBefore(n.dom,r.nextSibling):r.parentNode.appendChild(n.dom),n.initContext(),this._layers[e]=n,n.config=this._layerConfig[e]}return n},l.prototype._updateLayerStatus=function(e){var t=this._layers,n={};for(var r in t)r!=="hover"&&(n[r]=t[r].elCount,t[r].elCount=0);for(var i=0,s=e.length;i0},s.prototype.addRoot=function(e){e instanceof n&&e.addChildrenToStorage(this),this.addToMap(e),this._roots.push(e)},s.prototype.delRoot=function(e){if(typeof e=="undefined"){for(var r=0;r=0&&(this.delFromMap(o.id),this._roots.splice(u,1),o instanceof n&&o.delChildrenFromStorage(this))},s.prototype.addToMap=function(e){return e instanceof n?e._storage=this:e.style.__rect=null,this._elements[e.id]=e,this},s.prototype.get=function(e){return this._elements[e]},s.prototype.delFromMap=function(e){var t=this._elements[e];return t&&(delete this._elements[e],t instanceof n&&(t._storage=null)),this},s.prototype.dispose=function(){this._elements=this._renderList=this._roots=this._hoverElements=null},s}),r("zrender/animation/easing",[],function(){var e={Linear:function(e){return e},QuadraticIn:function(e){return e*e},QuadraticOut:function(e){return e*(2-e)},QuadraticInOut:function(e){return(e*=2)<1?.5*e*e:-0.5*(--e*(e-2)-1)},CubicIn:function(e){return e*e*e},CubicOut:function(e){return--e*e*e+1},CubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},QuarticIn:function(e){return e*e*e*e},QuarticOut:function(e){return 1- --e*e*e*e},QuarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-0.5*((e-=2)*e*e*e-2)},QuinticIn:function(e){return e*e*e*e*e},QuinticOut:function(e){return--e*e*e*e*e+1},QuinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},SinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},SinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},SinusoidalInOut:function(e){return.5*(1-Math.cos(Math.PI*e))},ExponentialIn:function(e){return e===0?0:Math.pow(1024,e-1)},ExponentialOut:function(e){return e===1?1:1-Math.pow(2,-10*e)},ExponentialInOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)},CircularIn:function(e){return 1-Math.sqrt(1-e*e)},CircularOut:function(e){return Math.sqrt(1- --e*e)},CircularInOut:function(e){return(e*=2)<1?-0.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},ElasticIn:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),-(n*Math.pow(2,10*(e-=1))*Math.sin((e-t)*2*Math.PI/r)))},ElasticOut:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*e)*Math.sin((e-t)*2*Math.PI/r)+1)},ElasticInOut:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),(e*=2)<1?-0.5*n*Math.pow(2,10*(e-=1))*Math.sin((e-t)*2*Math.PI/r):n*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*2*Math.PI/r)*.5+1)},BackIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},BackOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},BackInOut:function(e){var t=2.5949095;return(e*=2)<1?.5*e*e*((t+1)*e-t):.5*((e-=2)*e*((t+1)*e+t)+2)},BounceIn:function(t){return 1-e.BounceOut(1-t)},BounceOut:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},BounceInOut:function(t){return t<.5?e.BounceIn(t*2)*.5:e.BounceOut(t*2-1)*.5+.5}};return e}),r("zrender/animation/Clip",["require","./easing"],function(e){function n(e){this._targetPool=e.target||{},this._targetPool instanceof Array||(this._targetPool=[this._targetPool]),this._life=e.life||1e3,this._delay=e.delay||0,this._startTime=(new Date).getTime()+this._delay,this._endTime=this._startTime+this._life*1e3,this.loop=typeof e.loop=="undefined"?!1:e.loop,this.gap=e.gap||0,this.easing=e.easing||"Linear",this.onframe=e.onframe,this.ondestroy=e.ondestroy,this.onrestart=e.onrestart}var t=e("./easing");return n.prototype={step:function(e){var n=(e-this._startTime)/this._life;if(n<0)return;n=Math.min(n,1);var r=typeof this.easing=="string"?t[this.easing]:this.easing,i=typeof r=="function"?r(n):n;return this.fire("frame",i),n==1?this.loop?(this.restart(),"restart"):(this._needsRemove=!0,"destroy"):null},restart:function(){var e=(new Date).getTime(),t=(e-this._startTime)%this._life;this._startTime=(new Date).getTime()-t+this.gap},fire:function(e,t){for(var n=0,r=this._targetPool.length;n=0&&this._clips.splice(t,1)},update:function(){var e=(new Date).getTime(),t=e-this._time,n=this._clips,r=n.length,i=[],s=[];for(var o=0;o=0;N--)if(x[N]<=t)break;N=Math.min(N,g-2)}else{for(N=k;Nt)break;N=Math.min(N-1,g-2)}k=N,L=t;var n=x[N+1]-x[N];if(n===0)return;O=(t-x[N])/n;if(u){_=T[N],M=T[N===0?N:N-1],D=T[N>g-2?g-1:N+1],P=T[N>g-3?g-1:N+2];if(b)p(M,_,D,P,O,O*O,O*O*O,s(e,v),E);else{var a;w?(a=p(M,_,D,P,O,O*O,O*O*O,H,1),a=m(H)):a=d(M,_,D,P,O,O*O,O*O*O),i(e,v,a)}}else if(b)c(T[N],T[N+1],O,s(e,v),E);else{var a;w?(c(T[N],T[N+1],O,H,1),a=m(H)):a=l(T[N],T[N+1],O),i(e,v,a)}for(N=0;N1?"."+e[1]:""))}return{parsePercent:t,parseCenter:n,parseRadius:r,addCommas:i}}),r("echarts/component/base",["require","../config","../util/ecQuery","../util/number","zrender/tool/util","zrender/tool/env"],function(e){function s(e,t,n,r,i){this.ecTheme=e,this.messageCenter=t,this.zr=n,this.option=r,this.series=r.series,this.myChart=i,this.component=i.component,this._zlevelBase=this.getZlevelBase(),this.shapeList=[],this.effectList=[];var s=this;s.hoverConnect=function(e){var t=(e.target||{}).hoverConnect;if(t){var n=10,r;if(t instanceof Array)for(var i=0,o=t.length;i4?a*r(2*i/s)/r(i/s):a/3);var l=i/s,c=-i/2,h=o+a*r(c),p=u+a*n(c);c+=l;var d=t.pointList=[];d.push([h,p]);for(var v=0,m=s*2-1,g;v=r.x-i&&e<=r.x+r.width+i&&t>=r.y-i&&t<=r.y+r.height+i?!0:!1}},t.inherits(C,N),C}),r("zrender/shape/util/dashedLineTo",[],function(){var e=[5,5];return function(t,n,r,i,s,o){if(t.setLineDash){e[0]=e[1]=o,t.setLineDash(e),t.moveTo(n,r),t.lineTo(i,s);return}o=typeof o!="number"?5:o;var u=i-n,a=s-r,f=Math.floor(Math.sqrt(u*u+a*a)/o);u/=f,a/=f;var l=!0;for(var c=0;ci-2?i-1:l+1],v=e[l>i-3?i-1:l+2]);var m=c*c,g=c*m;s.push([n(h[0],p[0],d[0],v[0],c,m,g),n(h[1],p[1],d[1],v[1],c,m,g)])}return s}}),r("zrender/shape/util/smoothBezier",["require","../../tool/vector"],function(e){var t=e("../../tool/vector");return function(e,n,r){var i=[],s=[],o=[],u=[],a,f;for(var l=0,c=e.length;l0&&(n.brushType=="stroke"||n.brushType=="both")&&(r||(e.beginPath(),this.buildPath(e,n),e.closePath()),e.stroke()),this.drawText(e,n,this.style),e.restore();return},buildPath:function(e,t){var s=t.pointList;if(s.length<2)return;if(t.smooth&&t.smooth!=="spline"){var o=r(s,t.smooth,!0);e.moveTo(s[0][0],s[0][1]);var u,a,f,l=s.length;for(var c=0;cn&&(n=s[o][0]),s[o][1]i&&(i=s[o][1]);var a;return e.brushType=="stroke"||e.brushType=="fill"?a=e.lineWidth||1:a=0,e.__rect={x:Math.round(t-a/2),y:Math.round(r-a/2),width:n-t+a,height:i-r+a},e.__rect}},e("../tool/util").inherits(s,t),s}),r("zrender/shape/BrokenLine",["require","./Base","./util/smoothSpline","./util/smoothBezier","./util/dashedLineTo","./Polygon","../tool/util"],function(e){function s(e){this.brushTypeOnly="stroke",this.textPosition="end",t.call(this,e)}var t=e("./Base"),n=e("./util/smoothSpline"),r=e("./util/smoothBezier"),i=e("./util/dashedLineTo");return s.prototype={type:"broken-line",buildPath:function(e,t){var s=t.pointList;if(s.length<2)return;var o=Math.min(t.pointList.length,Math.round(t.pointListLength||t.pointList.length));if(t.smooth&&t.smooth!=="spline"){var u=r(s,t.smooth);e.moveTo(s[0][0],s[0][1]);var a,f,l;for(var c=0;cs?a>u?l=Math.PI*2-l+f:l+=f:a>u?l+=Math.PI-f:l=Math.PI-l-f:s>o?u>a?l=Math.PI*2-l+f:l+=f:u>a?l+=Math.PI-f:l=Math.PI-l-f;var c=Math.PI/8,h=n===0?s:o,p=n===0?u:a,d=[[h+i*Math.cos(l-c),p-i*Math.sin(l-c)],[h+i*.6*Math.cos(l),p-i*.6*Math.sin(l)],[h+i*Math.cos(l+c),p-i*Math.sin(l+c)]];e.moveTo(h,p);for(var v=0,m=d.length;v=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height?this.style.smooth!=="spline"?a.isInside(i,this.style,e,t):a.isInside(o,this.style,e,t):!1}},c.inherits(h,t),h}),r("echarts/util/shape/normalIsCover",[],function(){return function(e,t){var n=this.getTansform(e,t);e=n[0],t=n[1];var r=this.style.__rect;return r||(r=this.style.__rect=this.getRect(this.style)),e>=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height}}),r("echarts/util/shape/Symbol",["require","zrender/shape/Base","zrender/shape/Polygon","zrender/tool/util","./normalIsCover"],function(e){function s(e){t.call(this,e)}var t=e("zrender/shape/Base"),n=e("zrender/shape/Polygon"),r=new n({}),i=e("zrender/tool/util");return s.prototype={type:"symbol",buildPath:function(e,t){var n=t.pointList,r=n.length;if(r===0)return;var i=1e4,s=Math.ceil(r/i),o,u,a=n[0]instanceof Array,f=t.size?t.size:2,l=f,c=f/2,h=Math.PI*2,p,d,v;for(var m=0;mr?r:u;for(var g=o;g0&&e.stroke();break;case"stroke":t.lineWidth>0&&e.stroke();break;default:e.fill()}}},getRect:function(e){return e.__rect||r.getRect(e)},isCover:e("./normalIsCover")},i.inherits(s,t),s}),r("echarts/util/ecData",[],function(){function e(e,t,n,r,i,s,o,u){var a;return typeof r!="undefined"&&(a=r.value==null?r:r.value),e._echartsData={_series:t,_seriesIndex:n,_data:r,_dataIndex:i,_name:s,_value:a,_special:o,_special2:u},e._echartsData}function t(e,t){var n=e._echartsData;if(!t)return n;switch(t){case"series":case"seriesIndex":case"data":case"dataIndex":case"name":case"value":case"special":case"special2":return n&&n["_"+t]}return null}function n(e,t,n){e._echartsData=e._echartsData||{};switch(t){case"series":case"seriesIndex":case"data":case"dataIndex":case"name":case"value":case"special":case"special2":e._echartsData["_"+t]=n}}function r(e,t){t._echartsData={_series:e._echartsData._series,_seriesIndex:e._echartsData._seriesIndex,_data:e._echartsData._data,_dataIndex:e._echartsData._dataIndex,_name:e._echartsData._name,_value:e._echartsData._value,_special:e._echartsData._special,_special2:e._echartsData._special2}}return{pack:e,set:n,get:t,clone:r}}),r("echarts/util/ecAnimation",["require","zrender/tool/util","zrender/shape/Polygon"],function(e){function n(e,n,r,i,s){var o=r.style.pointList,u=o.length,a;if(!n){a=[];if(r._orient!="vertical"){var f=o[0][1];for(var l=0;l1?t.symbol:[t.symbol[0],t.symbol[0]]:[t.symbol,t.symbol],t.symbolSize=t.symbolSize instanceof Array?t.symbolSize.length>1?t.symbolSize:[t.symbolSize[0],t.symbolSize[0]]:[t.symbolSize,t.symbolSize],t.symbolRotate=t.symbolRotate instanceof Array?t.symbolRotate.length>1?t.symbolRotate:[t.symbolRotate[0],t.symbolRotate[0]]:[t.symbolRotate,t.symbolRotate],t.name=n.name;var i=[],u=t.data,a,f=r.dataRange,c=r.legend,h,p,d,v,m,g,y=this.zr.getWidth(),b=this.zr.getHeight(),w;for(var E=0,S=u.length;E "+u[E][1].name:""),p),i.push(a)}return i},getMarkCoord:function(){return[0,0]},getSymbolShape:function(e,r,i,s,u,a,f,l,c,h,p){var d=[i,e],v=typeof i!="undefined"?typeof i.value!="undefined"?i.value:i:"-";l=this.deepQuery(d,"symbol")||l;var m=this.deepQuery(d,"symbolSize");m=typeof m=="function"?m(v):m;var g=this.deepQuery(d,"symbolRotate"),y=this.deepMerge(d,"itemStyle.normal"),b=this.deepMerge(d,"itemStyle.emphasis"),w=typeof y.borderWidth!="undefined"?y.borderWidth:y.lineStyle&&y.lineStyle.width;typeof w=="undefined"&&(w=l.match("empty")?2:0);var E=typeof b.borderWidth!="undefined"?b.borderWidth:b.lineStyle&&b.lineStyle.width;typeof E=="undefined"&&(E=w+2);var S=new n({style:{iconType:l.replace("empty","").toLowerCase(),x:a-m,y:f-m,width:m*2,height:m*2,brushType:"both",color:l.match("empty")?h:this.getItemStyleColor(y.color,r,s,i)||c,strokeColor:y.borderColor||this.getItemStyleColor(y.color,r,s,i)||c,lineWidth:w},highlightStyle:{color:l.match("empty")?h:this.getItemStyleColor(b.color,r,s,i),strokeColor:b.borderColor||y.borderColor||this.getItemStyleColor(y.color,r,s,i)||c,lineWidth:E},clickable:!0});return l.match("image")&&(S.style.image=l.replace(new RegExp("^image:\\/\\/"),""),S=new t({style:S.style,highlightStyle:S.highlightStyle,clickable:!0})),typeof g!="undefined"&&(S.rotation=[g*Math.PI/180,a,f]),l.match("star")&&(S.style.iconType="star",S.style.n=l.replace("empty","").replace("star","")-0||5),l=="none"&&(S.invisible=!0,S.hoverable=!1),S=this.addLabel(S,e,i,u,p),l.match("empty")&&(typeof S.style.textColor=="undefined"&&(S.style.textColor=S.style.strokeColor),typeof S.highlightStyle.textColor=="undefined"&&(S.highlightStyle.textColor=S.highlightStyle.strokeColor)),o.pack(S,e,r,i,s,u),S._x=a,S._y=f,S._dataIndex=s,S._seriesIndex=r,S},getLineMarkShape:function(e,t,n,i,s,o,u,a,f){var l=typeof n[0]!="undefined"?typeof n[0].value!="undefined"?n[0].value:n[0]:"-",c=typeof n[1]!="undefined"?typeof n[1].value!="undefined"?n[1].value:n[1]:"-",h=[this.query(n[0],"symbol")||e.symbol[0],this.query(n[1],"symbol")||e.symbol[1]],p=[this.query(n[0],"symbolSize")||e.symbolSize[0],this.query(n[1],"symbolSize")||e.symbolSize[1]];p[0]=typeof p[0]=="function"?p[0](l):p[0],p[1]=typeof p[1]=="function"?p[1](c):p[1];var d=[this.query(n[0],"symbolRotate")||e.symbolRotate[0],this.query(n[1],"symbolRotate")||e.symbolRotate[1]],v=[n[0],e],m=this.deepMerge(v,"itemStyle.normal");m.color=this.getItemStyleColor(m.color,t,i,n);var g=this.deepMerge(v,"itemStyle.emphasis");g.color=this.getItemStyleColor(g.color,t,i,n);var y=m.lineStyle,b=g.lineStyle,w=y.width;typeof w=="undefined"&&(w=m.borderWidth);var E=b.width;typeof E=="undefined"&&(typeof g.borderWidth!="undefined"?E=g.borderWidth:E=w+2);var S=new r({style:{smooth:e.smooth?"spline":!1,symbol:h,symbolSize:p,symbolRotate:d,xStart:s,yStart:o,xEnd:u,yEnd:a,brushType:"both",lineType:y.type,shadowColor:y.shadowColor||y.color||m.borderColor||m.color||f,shadowBlur:y.shadowBlur,shadowOffsetX:y.shadowOffsetX,shadowOffsetY:y.shadowOffsetY,color:m.color||f,strokeColor:y.color||m.borderColor||m.color||f,lineWidth:w,symbolBorderColor:m.borderColor||m.color||f,symbolBorder:m.borderWidth},highlightStyle:{shadowColor:b.shadowColor,shadowBlur:b.shadowBlur,shadowOffsetX:b.shadowOffsetX,shadowOffsetY:b.shadowOffsetY,color:g.color||m.color||f,strokeColor:b.color||y.color||g.borderColor||m.borderColor||g.color||m.color||f,lineWidth:E,symbolBorderColor:g.borderColor||m.borderColor||g.color||m.color||f,symbolBorder:typeof g.borderWidth=="undefined"?m.borderWidth+2:g.borderWidth},clickable:!0});return S=this.addLabel(S,e,n[0],n[0].name+" : "+n[1].name),S._x=u,S._y=a,S},getLargeMarkPoingShape:function(e,t){var n=this.series[e],r=this.component,s=t.data,o,u=r.dataRange,a=r.legend,f,l,c=[s[0],t],h,p,d;a&&(f=a.getColor(n.name));if(u){l=typeof s[0]!="undefined"?typeof s[0].value!="undefined"?s[0].value:s[0]:"-",f=isNaN(l)?f:u.getColor(l),h=this.deepQuery(c,"itemStyle.normal.color")||f,p=this.deepQuery(c,"itemStyle.emphasis.color")||h;if(h==null&&p==null)return}f=this.deepMerge(c,"itemStyle.normal").color||f;var v=this.deepQuery(c,"symbol")||"circle";v=v.replace("empty","").replace(/\d/g,""),d=this.deepMerge([s[0],t],"effect");var m=window.devicePixelRatio||1;return o=new i({style:{pointList:s,color:f,strokeColor:f,shadowColor:d.shadowColor||f,shadowBlur:(typeof d.shadowBlur!="undefined"?d.shadowBlur:8)*m,size:this.deepQuery(c,"symbolSize"),iconType:v,brushType:"fill",lineWidth:1},draggable:!1,hoverable:!1}),d.show&&(o.effect=d),o},backupShapeList:function(){this.shapeList&&this.shapeList.length>0?(this.lastShapeList=this.shapeList,this.shapeList=[]):this.lastShapeList=[]},addShapeList:function(){var e=this.option.animationThreshold/(this.canvasSupported?2:4),t=this.lastShapeList,n=this.shapeList,r=t.length>0?500:this.query(this.option,"animationDuration"),i=this.query(this.option,"animationEasing"),s,o={},u={};if(this.option.animation&&!this.option.renderAsImage&&n.length500?u.candle(this.zr,e,t,n,r):this.zr.addShape(t);break;case"ring":case"sector":case"circle":n>500?u.ring(this.zr,e,t,n+(o.get(t,"dataIndex")||0)%20*100,r):t.type=="sector"?u.sector(this.zr,e,t,n,r):this.zr.addShape(t);break;case"text":u.text(this.zr,e,t,n,r);break;case"polygon":n>500?u.polygon(this.zr,e,t,n,r):u.pointList(this.zr,e,t,n,r);break;case"chord":u.chord(this.zr,e,t,n,r);break;case"gauge-pointer":u.gaugePointer(this.zr,e,t,n,r);break;case"mark-line":u.markline(this.zr,e,t,n,r);break;case"line":u.line(this.zr,e,t,n,r);break;default:this.zr.addShape(t)}},animationMark:function(e,t,n){var r=n||this.shapeList;for(var i=0,s=r.length;i0&&(e&&this.zr.modLayer(s.EFFECT_ZLEVEL,{motionBlur:!1}),this.zr.delShape(this.effectList)),this.effectList=[]},addMark:function(e,t,n){var r=this.series[e];if(this.selectedMap[r.name]){var i=500,s=this.query(this.option,"animationEasing"),o=r[n].data,u=this.shapeList.length;r[n].data=t.data,this["_build"+n.replace("m","M")](e);for(var a=u,f=this.shapeList.length;a0?-1:1,t.style.r-=r,t.style.r=t.style.r<5?5:t.style.r;var i=s.get(t,"value"),o=i*f.option.island.calculateStep;o>1?i=Math.round(i-o*r):i=(i-o*r).toFixed(2)-0;var a=s.get(t,"name");t.style.text=a+":"+i,s.set(t,"value",i),s.set(t,"name",a),f.zr.modShape(t.id),f.zr.refresh(),u.stop(n)}}var t=e("../component/base"),n=e("./base"),r=e("zrender/shape/Circle"),i=e("../config"),s=e("../util/ecData"),o=e("zrender/tool/util"),u=e("zrender/tool/event");return a.prototype={type:i.CHART_TYPE_ISLAND,_combine:function(t,n){var r=e("zrender/tool/color"),i=e("../util/accMath"),o=i.accAdd(s.get(t,"value"),s.get(n,"value")),u=s.get(t,"name")+this._nameConnector+s.get(n,"name");t.style.text=u+this._valueConnector+o,s.set(t,"value",o),s.set(t,"name",u),t.style.r=this.option.island.r,t.style.color=r.mix(t.style.color,n.style.color)},refresh:function(e){e&&(e.island=this.reformOption(e.island),this.option=e,this._nameConnector=this.option.nameConnector,this._valueConnector=this.option.valueConnector)},getOption:function(){return this.option},resize:function(){var e=this.zr.getWidth(),t=this.zr.getHeight(),n=e/(this._zrWidth||e),r=t/(this._zrHeight||t);if(n==1&&r==1)return;this._zrWidth=e,this._zrHeight=t;for(var i=0,s=this.shapeList.length;i'+(t[0]||this._lang[0])+"

",this._textArea.style.cssText="display:block;margin:0 0 8px 0;padding:4px 6px;overflow:auto;width:"+(this._zrWidth-15)+"px;"+"height:"+(this._zrHeight-100)+"px;";var n=this.query(this.option,"toolbox.feature.dataView.optionToContent");typeof n!="function"?this._textArea.value=this._optionToContent():this._textArea.value=n(this.option),this._tDom.appendChild(this._textArea),this._buttonClose.style.cssText="float:right;padding:1px 6px;",this._buttonClose.innerHTML=t[1]||this._lang[1];var r=this;this._buttonClose.onclick=function(){r.hide()},this._tDom.appendChild(this._buttonClose),this.query(this.option,"toolbox.feature.dataView.readOnly")===!1?(this._buttonRefresh.style.cssText="float:right;margin-right:10px;padding:1px 6px;",this._buttonRefresh.innerHTML=t[2]||this._lang[2],this._buttonRefresh.onclick=function(){r._save()},this._tDom.appendChild(this._buttonRefresh),this._textArea.readOnly=!1,this._textArea.style.cursor="default"):(this._textArea.readOnly=!0,this._textArea.style.cursor="text"),this._sizeCssText="width:"+this._zrWidth+"px;"+"height:"+this._zrHeight+"px;"+"background-color:#fff;",this._tDom.style.cssText=this._gCssText+this._sizeCssText},_optionToContent:function(){var e,t,r,i,s,o,u=[],a="";if(this.option.xAxis){this.option.xAxis instanceof Array?u=this.option.xAxis:u=[this.option.xAxis];for(e=0,i=u.length;e10&&(this._sizeCssText="width:"+this._zrWidth+"px;"+"height:"+this._zrHeight+"px;"+"background-color:#fff;",this._tDom.style.cssText=this._gCssText+this._sizeCssText,this._textArea.style.cssText="display:block;margin:0 0 8px 0;padding:4px 6px;overflow:auto;width:"+(this._zrWidth-15)+"px;"+"height:"+(this._zrHeight-100)+"px;")},dispose:function(){window.removeEventListener?(this._tDom.removeEventListener("click",this._stop),this._tDom.removeEventListener("mousewheel",this._stop),this._tDom.removeEventListener("mousemove",this._stop),this._tDom.removeEventListener("mousedown",this._stop),this._tDom.removeEventListener("mouseup",this._stop),this._tDom.removeEventListener("touchstart",this._stop),this._tDom.removeEventListener("touchmove",this._stop),this._tDom.removeEventListener("touchend",this._stop)):(this._tDom.detachEvent("onclick",this._stop),this._tDom.detachEvent("onmousewheel",this._stop),this._tDom.detachEvent("onmousemove",this._stop),this._tDom.detachEvent("onmousedown",this._stop),this._tDom.detachEvent("onmouseup",this._stop)),this._buttonRefresh.onclick=null,this._buttonClose.onclick=null,this._hasShow&&(this._tDom.removeChild(this._textArea),this._tDom.removeChild(this._buttonRefresh),this._tDom.removeChild(this._buttonClose)),this._textArea=null,this._buttonRefresh=null,this._buttonClose=null,this.dom.firstChild.removeChild(this._tDom),this._tDom=null}},r.inherits(i,t),e("../component").define("dataView",i),i}),r("echarts/component/toolbox",["require","./base","zrender/shape/Line","zrender/shape/Image","zrender/shape/Rectangle","../util/shape/Icon","../config","zrender/tool/util","zrender/config","zrender/tool/event","./dataView","../component"],function(e){function h(e,n,r,i,s){t.call(this,e,n,r,i,s),this.dom=s.dom,this._magicType={},this._isSilence=!1,this._iconList,this._iconShapeMap={},this._featureTitle={},this._featureIcon={},this._featureColor={},this._enableColor="red",this._disableColor="#ccc",this._markShapeList=[];var o=this;o._onMark=function(e){o.__onMark(e)},o._onMarkUndo=function(e){o.__onMarkUndo(e)},o._onMarkClear=function(e){o.__onMarkClear(e)},o._onDataZoom=function(e){o.__onDataZoom(e)},o._onDataZoomReset=function(e){o.__onDataZoomReset(e)},o._onDataView=function(e){o.__onDataView(e)},o._onRestore=function(e){o.__onRestore(e)},o._onSaveAsImage=function(e){o.__onSaveAsImage(e)},o._onMagicType=function(e){o.__onMagicType(e)},o._onCustomHandler=function(e){o.__onCustomHandler(e)},o._onmousemove=function(e){return o.__onmousemove(e)},o._onmousedown=function(e){return o.__onmousedown(e)},o._onmouseup=function(e){return o.__onmouseup(e)},o._onclick=function(e){return o.__onclick(e)}}var t=e("./base"),n=e("zrender/shape/Line"),r=e("zrender/shape/Image"),i=e("zrender/shape/Rectangle"),s=e("../util/shape/Icon"),o=e("../config"),u=e("zrender/tool/util"),a=e("zrender/config"),f=e("zrender/tool/event"),l="stack",c="tiled";return h.prototype={type:o.COMPONENT_TYPE_TOOLBOX,_buildShape:function(){this._iconList=[];var e=this.option.toolbox;this._enableColor=e.effectiveColor,this._disableColor=e.disableColor;var t=e.feature,n=[];for(var r in t)if(t[r].show)switch(r){case"mark":n.push({key:r,name:"mark"}),n.push({key:r,name:"markUndo"}),n.push({key:r,name:"markClear"});break;case"magicType":for(var i=0,s=t[r].type.length;i0){var o,r;for(var i=0,s=n.length;i=1){var t=this._markShapeList[e-1];this.zr.delShape(t.id),this.zr.refresh(),this._markShapeList.pop(),e==1&&(this._iconDisable(this._iconShapeMap.markUndo),this._iconDisable(this._iconShapeMap.markClear))}}return!0},__onMarkClear:function(){this._marking&&(this._marking=!1);var e=this._markShapeList.length;if(e>0){while(e--)this.zr.delShape(this._markShapeList.pop().id);this._iconDisable(this._iconShapeMap.markUndo),this._iconDisable(this._iconShapeMap.markClear),this.zr.refresh()}return!0},__onDataZoom:function(e){var t=e.target;if(this._zooming||this._zoomStart)this._resetZoom(),this.zr.refresh(),this.dom.style.cursor="default";else{this._resetMark(),this.zr.modShape(t.id,{style:{strokeColor:this._enableColor}}),this.zr.refresh(),this._zoomStart=!0;var n=this;setTimeout(function(){n.zr&&n.zr.on(a.EVENT.MOUSEDOWN,n._onmousedown)&&n.zr.on(a.EVENT.MOUSEUP,n._onmouseup)&&n.zr.on(a.EVENT.MOUSEMOVE,n._onmousemove)},10),this.dom.style.cursor="crosshair"}return!0},__onDataZoomReset:function(){return this._zooming&&(this._zooming=!1),this._zoomQueue.pop(),this._zoomQueue.length>0?this.component.dataZoom.absoluteZoom(this._zoomQueue[this._zoomQueue.length-1]):(this.component.dataZoom.rectZoom(),this._iconDisable(this._iconShapeMap.dataZoomReset),this.zr.refresh()),!0},_resetMark:function(){this._marking=!1,this._markStart&&(this._markStart=!1,this._iconShapeMap.mark&&this.zr.modShape(this._iconShapeMap.mark.id,{style:{strokeColor:this._iconShapeMap.mark.highlightStyle.strokeColor}}),this.zr.un(a.EVENT.CLICK,this._onclick),this.zr.un(a.EVENT.MOUSEMOVE,this._onmousemove))},_resetZoom:function(){this._zooming=!1,this._zoomStart&&(this._zoomStart=!1,this._iconShapeMap.dataZoom&&this.zr.modShape(this._iconShapeMap.dataZoom.id,{style:{strokeColor:this._iconShapeMap.dataZoom.highlightStyle.strokeColor}}),this.zr.un(a.EVENT.MOUSEDOWN,this._onmousedown),this.zr.un(a.EVENT.MOUSEUP,this._onmouseup),this.zr.un(a.EVENT.MOUSEMOVE,this._onmousemove))},_iconDisable:function(e){e.type!="image"?this.zr.modShape(e.id,{hoverable:!1,clickable:!1,style:{strokeColor:this._disableColor}}):this.zr.modShape(e.id,{hoverable:!1,clickable:!1,style:{opacity:.3}})},_iconEnable:function(e){e.type!="image"?this.zr.modShape(e.id,{hoverable:!0,clickable:!0,style:{strokeColor:e.highlightStyle.strokeColor}}):this.zr.modShape(e.id,{hoverable:!0,clickable:!0,style:{opacity:.8}})},__onDataView:function(){return this._dataView.show(this.option),!0},__onRestore:function(){return this._resetMark(),this._resetZoom(),this.messageCenter.dispatch(o.EVENT.RESTORE,null,null,this.myChart),!0},__onSaveAsImage:function(){var e=this.option.toolbox.feature.saveAsImage,t=e.type||"png";t!="png"&&t!="jpeg"&&(t="png");var n;this.myChart.isConnected()?n=this.myChart.getConnectedDataURL(t):n=this.zr.toDataURL("image/"+t,this.option.backgroundColor&&this.option.backgroundColor.replace(" ","")=="rgba(0,0,0,0)"?"#fff":this.option.backgroundColor);var r=document.createElement("div");r.id="__echarts_download_wrap__",r.style.cssText="position:fixed;z-index:99999;display:block;top:0;left:0;background-color:rgba(33,33,33,0.5);text-align:center;width:100%;height:100%;line-height:"+document.documentElement.clientHeight+"px;";var i=document.createElement("a");i.href=n,i.setAttribute("download",(e.name?e.name:this.option.title&&(this.option.title.text||this.option.title.subtext)?this.option.title.text||this.option.title.subtext:"ECharts")+"."+t),i.innerHTML='图片另存为")+'"/>',r.appendChild(i),document.body.appendChild(r),i=null,r=null,setTimeout(function(){var e=document.getElementById("__echarts_download_wrap__");e&&(e.onclick=function(){var e=document.getElementById("__echarts_download_wrap__");e.onclick=null,e.innerHTML="",document.body.removeChild(e),e=null},e=null)},500);return},__onMagicType:function(e){this._resetMark();var t=e.target._name;return this._magicType[t]||(this._magicType[t]=!0,t==o.CHART_TYPE_LINE?this._magicType[o.CHART_TYPE_BAR]=!1:t==o.CHART_TYPE_BAR&&(this._magicType[o.CHART_TYPE_LINE]=!1),t==l?this._magicType[c]=!1:t==c&&(this._magicType[l]=!1),this.messageCenter.dispatch(o.EVENT.MAGIC_TYPE_CHANGED,e.event,{magicType:this._magicType},this.myChart)),!0},setMagicType:function(e){this._resetMark(),this._magicType=e,!this._isSilence&&this.messageCenter.dispatch(o.EVENT.MAGIC_TYPE_CHANGED,null,{magicType:this._magicType},this.myChart)},__onCustomHandler:function(e){var t=e.target.style.iconType,n=this.option.toolbox.feature[t].onclick;typeof n=="function"&&n(this.option)},reset:function(e,t){t&&this.clear();if(this.query(e,"toolbox.show")&&this.query(e,"toolbox.feature.magicType.show")){var n=e.toolbox.feature.magicType.type,r=n.length;this._magicMap={};while(r--)this._magicMap[n[r]]=!0;r=e.series.length;var i,s;while(r--){i=e.series[r].type,this._magicMap[i]&&(s=e.xAxis instanceof Array?e.xAxis[e.series[r].xAxisIndex||0]:e.xAxis,s&&(s.type||"category")=="category"&&(s.__boundaryGap=typeof s.boundaryGap!="undefined"?s.boundaryGap:!0),s=e.yAxis instanceof Array?e.yAxis[e.series[r].yAxisIndex||0]:e.yAxis,s&&s.type=="category"&&(s.__boundaryGap=typeof s.boundaryGap!="undefined"?s.boundaryGap:!0),e.series[r].__type=i,e.series[r].__itemStyle=u.clone(e.series[r].itemStyle||{}));if(this._magicMap[l]||this._magicMap[c])e.series[r].__stack=e.series[r].stack}}this._magicType=t?{}:this._magicType||{};for(var o in this._magicType)if(this._magicType[o]){this.option=e,this.getMagicOption();break}var a=e.dataZoom;if(a&&a.show){var f=typeof a.start!="undefined"&&a.start>=0&&a.start<=100?a.start:0,h=typeof a.end!="undefined"&&a.end>=0&&a.end<=100?a.end:100;f>h&&(f+=h,h=f-h,f-=h),this._zoomQueue=[{start:f,end:h,start2:0,end2:100}]}else this._zoomQueue=[]},getMagicOption:function(){var e;if(this._magicType[o.CHART_TYPE_LINE]||this._magicType[o.CHART_TYPE_BAR]){var t=this._magicType[o.CHART_TYPE_LINE]?!1:!0;for(var n=0,r=this.option.series.length;n0&&(this.zr.delShape(this._lastTipShape.tipShape),this._lastTipShape=!1,this.shapeList.length=2),e&&this.zr.refresh(),this.showing=!1},_show:function(e,t,n,r){var i=this._tDom.offsetHeight,s=this._tDom.offsetWidth;e&&(typeof e=="function"&&(e=e([t,n])),e instanceof Array&&(t=e[0],n=e[1])),t+s>this._zrWidth&&(t-=s+40),n+i>this._zrHeight&&(n-=i-20),n<20&&(n=0),this._tDom.style.cssText=this._gCssText+this._defaultCssText+(r?r:"")+"left:"+t+"px;top:"+n+"px;",(i<10||s<10)&&setTimeout(this._refixed,20),this.showing=!0},__refixed:function(){if(this._tDom){var e="",t=this._tDom.offsetHeight,n=this._tDom.offsetWidth;this._tDom.offsetLeft+n>this._zrWidth&&(e+="left:"+(this._zrWidth-n-20)+"px;"),this._tDom.offsetTop+t>this._zrHeight&&(e+="top:"+(this._zrHeight-t-10)+"px;"),e!==""&&(this._tDom.style.cssText+=e)}},__tryShow:function(){var e,t;if(!this._curTarget)this._findPolarTrigger()||this._findAxisTrigger();else{if(this._curTarget._type=="island"&&this.option.tooltip.show){this._showItemTrigger();return}var n=u.get(this._curTarget,"series"),r=u.get(this._curTarget,"data");e=this.deepQuery([r,n,this.option],"tooltip.show"),typeof n=="undefined"||typeof r=="undefined"||e===!1?(clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this._hidingTicket=setTimeout(this._hide,this._hideDelay)):(t=this.deepQuery([r,n,this.option],"tooltip.trigger"),t=="axis"?this._showAxisTrigger(n.xAxisIndex,n.yAxisIndex,u.get(this._curTarget,"dataIndex")):this._showItemTrigger())}},_findAxisTrigger:function(){if(!this.component.xAxis||!this.component.yAxis){this._hidingTicket=setTimeout(this._hide,this._hideDelay);return}var e=this.option.series,t,n;for(var r=0,i=e.length;r=r)break;a=t.getCoordByIndex(++n),o=a}return r-sh){a>=i&&(c=a);if(a<=i)break;a=t.getCoordByIndex(++n),l=a}return i-l>c-i?n-=n!==0?1:0:typeof t.getNameByIndex(n)=="undefined"&&(n-=1),n},_showAxisTrigger:function(e,t,n){!this._event.connectTrigger&&this.messageCenter.dispatch(o.EVENT.TOOLTIP_IN_GRID,this._event,null,this.myChart);if(typeof this.component.xAxis=="undefined"||typeof this.component.yAxis=="undefined"||typeof e=="undefined"||typeof t=="undefined"){clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this._hidingTicket=setTimeout(this._hide,this._hideDelay);return}var r=this.option.series,i=[],s=[],u,a,l,c,h,p,d="";if(this.option.tooltip.trigger=="axis"){if(this.option.tooltip.show===!1)return;c=this.option.tooltip.formatter,h=this.option.tooltip.position}if(e!=-1&&this.component.xAxis.getAxis(e).type==o.COMPONENT_TYPE_AXIS_CATEGORY){u=this.component.xAxis.getAxis(e);for(var v=0,m=r.length;v=0?this._showItemTrigger():(clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this._tDom.style.display="none");if(i.length>0){var g;if(typeof c=="function"){var y=[];for(var v=0,m=i.length;v"+this._encodeHTML(i[v].name||"")+" : ",g=i[v].data[n],g=typeof g!="undefined"?typeof g.value!="undefined"?g.value:g:"-",c+=g instanceof Array?g:this.numAddCommas(g);this._tDom.innerHTML=c}if(p===!1||!this.option.tooltip.showContent)return;this.hasAppend||(this._tDom.style.left=this._zrWidth/2+"px",this._tDom.style.top=this._zrHeight/2+"px",this.dom.firstChild.appendChild(this._tDom),this.hasAppend=!0),this._show(h,a+10,l+10,d)}},_showPolarTrigger:function(e,t){if(typeof this.component.polar=="undefined"||typeof e=="undefined"||typeof t=="undefined"||t<0)return!1;var n=this.option.series,r=[],i,s,o,u="";if(this.option.tooltip.trigger=="axis"){if(this.option.tooltip.show===!1)return!1;i=this.option.tooltip.formatter,s=this.option.tooltip.position}var a=this.option.polar[e].indicator[t].text;for(var l=0,c=n.length;l0){var h,p,d=[];for(var l=0,c=r.length;l"+this._encodeHTML(d[0][3])+" : "+this.numAddCommas(d[0][2]);for(var l=1,c=d.length;l"+this._encodeHTML(d[l][1])+"
",i+=this._encodeHTML(d[l][3])+" : "+this.numAddCommas(d[l][2]);this._tDom.innerHTML=i}if(o===!1||!this.option.tooltip.showContent)return;return this.hasAppend||(this._tDom.style.left=this._zrWidth/2+"px",this._tDom.style.top=this._zrHeight/2+"px",this.dom.firstChild.appendChild(this._tDom),this.hasAppend=!0),this._show(s,f.getX(this._event),f.getY(this._event),u),!0}},_showItemTrigger:function(){if(!this._curTarget)return;var e=u.get(this._curTarget,"series"),t=u.get(this._curTarget,"data"),n=u.get(this._curTarget,"name"),r=u.get(this._curTarget,"value"),i=u.get(this._curTarget,"special"),s=u.get(this._curTarget,"special2"),a,l,c,h="",p,d="";this._curTarget._type!="island"?(this.option.tooltip.trigger=="item"&&(a=this.option.tooltip.formatter,l=this.option.tooltip.position),this.query(e,"tooltip.trigger")=="item"&&(c=this.query(e,"tooltip.showContent")||c,a=this.query(e,"tooltip.formatter")||a,l=this.query(e,"tooltip.position")||l,h+=this._style(this.query(e,"tooltip"))),c=this.query(t,"tooltip.showContent")||c,a=this.query(t,"tooltip.formatter")||a,l=this.query(t,"tooltip.position")||l,h+=this._style(this.query(t,"tooltip"))):(c=this.deepQuery([t,e,this.option],"tooltip.showContent"),a=this.deepQuery([t,e,this.option],"tooltip.islandFormatter"),l=this.deepQuery([t,e,this.option],"tooltip.islandPosition"));if(typeof a=="function")this._curTicket=(e.name||"")+":"+u.get(this._curTarget,"dataIndex"),this._tDom.innerHTML=a.call(this.myChart,[e.name||"",n,r,i,s,t],this._curTicket,this._setContent);else if(typeof a=="string")this._curTicket=NaN,a=a.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}"),a=a.replace("{a0}",this._encodeHTML(e.name||"")).replace("{b0}",this._encodeHTML(n)).replace("{c0}",r instanceof Array?r:this.numAddCommas(r)),a=a.replace("{d}","{d0}").replace("{d0}",i||""),a=a.replace("{e}","{e0}").replace("{e0}",u.get(this._curTarget,"special2")||""),this._tDom.innerHTML=a;else{this._curTicket=NaN;if(e.type==o.CHART_TYPE_SCATTER)this._tDom.innerHTML=(typeof e.name!="undefined"?this._encodeHTML(e.name)+"
":"")+(n===""?"":this._encodeHTML(n)+" : ")+r+(typeof i=="undefined"?"":" ("+i+")");else if(e.type==o.CHART_TYPE_RADAR&&i){p=i,d+=this._encodeHTML(n===""?e.name||"":n),d+=d===""?"":"
";for(var v=0;v";this._tDom.innerHTML=d}else if(e.type==o.CHART_TYPE_CHORD)if(typeof s=="undefined")this._tDom.innerHTML=this._encodeHTML(n)+" ("+this.numAddCommas(r)+")";else{var m=this._encodeHTML(n),g=this._encodeHTML(i);this._tDom.innerHTML=(typeof e.name!="undefined"?this._encodeHTML(e.name)+"
":"")+m+" -> "+g+" ("+this.numAddCommas(r)+")"+"
"+g+" -> "+m+" ("+this.numAddCommas(s)+")"}else this._tDom.innerHTML=(typeof e.name!="undefined"?this._encodeHTML(e.name)+"
":"")+this._encodeHTML(n)+" : "+this.numAddCommas(r)+(typeof i=="undefined"?"":" ("+this.numAddCommas(i)+")")}if(!this._axisLineShape.invisible||!this._axisShadowShape.invisible)this._axisLineShape.invisible=!0,this.zr.modShape(this._axisLineShape.id),this._axisShadowShape.invisible=!0,this.zr.modShape(this._axisShadowShape.id),this.zr.refresh();if(c===!1||!this.option.tooltip.showContent)return;this.hasAppend||(this._tDom.style.left=this._zrWidth/2+"px",this._tDom.style.top=this._zrHeight/2+"px",this.dom.firstChild.appendChild(this._tDom),this.hasAppend=!0),this._show(l,f.getX(this._event)+20,f.getY(this._event)-20,h)},_styleAxisPointer:function(e,t,n,r,i,s,o,u){if(e.length>0){var a,f,l=this.option.tooltip.axisPointer,c=l.type,h={line:{},cross:{},shadow:{}};for(var p in h)h[p].color=l[p+"Style"].color,h[p].width=l[p+"Style"].width,h[p].type=l[p+"Style"].type;for(var d=0,v=e.length;d100?(this._axisCrossShape.style.textAlign="left",this._axisCrossShape.style.textX=o+10):(this._axisCrossShape.style.textAlign="right",this._axisCrossShape.style.textX=o-10),u-this.component.grid.getY()>50?(this._axisCrossShape.style.textBaseline="bottom",this._axisCrossShape.style.textY=u-10):(this._axisCrossShape.style.textBaseline="top",this._axisCrossShape.style.textY=u+10),this._axisCrossShape.invisible=!1,this.zr.modShape(this._axisCrossShape.id);else if(c=="shadow"){if(typeof h.shadow.width=="undefined"||h.shadow.width=="auto"||isNaN(h.shadow.width))h.shadow.width=s;t==r?Math.abs(this.component.grid.getX()-t)<2?(h.shadow.width/=2,t=r+=h.shadow.width/2):Math.abs(this.component.grid.getXend()-t)<2&&(h.shadow.width/=2,t=r-=h.shadow.width/2):n==i&&(Math.abs(this.component.grid.getY()-n)<2?(h.shadow.width/=2,n=i+=h.shadow.width/2):Math.abs(this.component.grid.getYend()-n)<2&&(h.shadow.width/=2,n=i-=h.shadow.width/2)),this._axisShadowShape.style={xStart:t,yStart:n,xEnd:r,yEnd:i,strokeColor:h.shadow.color,lineWidth:h.shadow.width},this._axisShadowShape.invisible=!1,this.zr.modShape(this._axisShadowShape.id)}this.zr.refresh()}},__onmousemove:function(e){clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket);var t=e.target,n=f.getX(e.event),r=f.getY(e.event);if(!t)this._curTarget=!1,this._event=e.event,this._event.zrenderX=n,this._event.zrenderY=r,this._needAxisTrigger&&this.component.grid&&l.isInside(s,this.component.grid.getArea(),n,r)?this._showingTicket=setTimeout(this._tryShow,this._showDelay):this._needAxisTrigger&&this.component.polar&&this.component.polar.isInside([n,r])!=-1?this._showingTicket=setTimeout(this._tryShow,this._showDelay):(!this._event.connectTrigger&&this.messageCenter.dispatch(o.EVENT.TOOLTIP_OUT_GRID,this._event,null,this.myChart),this._hidingTicket=setTimeout(this._hide,this._hideDelay));else{this._curTarget=t,this._event=e.event,this._event.zrenderX=n,this._event.zrenderY=r;var i;if(this._needAxisTrigger&&this.component.polar&&(i=this.component.polar.isInside([n,r]))!=-1){var u=this.option.series;for(var a=0,c=u.length;a0&&(this.zr.delShape(this._lastTipShape.tipShape),this.shapeList.length=2);for(var n=0,r=t.length;n0&&this.zr.delShape(this._lastTipShape.tipShape),this._lastTipShape=!1,this.shapeList.length=2;if(e){this.option=e,this.option.tooltip=this.reformOption(this.option.tooltip),this.option.tooltip.textStyle=h.merge(this.option.tooltip.textStyle,this.ecTheme.textStyle),this.option.tooltip.padding=this.reformCssArray(this.option.tooltip.padding),this._needAxisTrigger=!1,this.option.tooltip.trigger=="axis"&&(this._needAxisTrigger=!0);var t=this.option.series;for(var n=0,r=t.length;n0&&this.zr.delShape(this._lastTipShape.tipShape),this.clear(),this.shapeList=null,clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this.zr.un(a.EVENT.MOUSEMOVE,this._onmousemove),this.zr.un(a.EVENT.GLOBALOUT,this._onglobalout),this.hasAppend&&this.dom.firstChild.removeChild(this._tDom),this._tDom=null},_encodeHTML:function(e){return String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}},h.inherits(d,t),e("../component").define("tooltip",d),d}),r("zrender/shape/Ring",["require","./Base","../tool/util"],function(e){function n(e){t.call(this,e)}var t=e("./Base");return n.prototype={type:"ring",buildPath:function(e,t){e.arc(t.x,t.y,t.r,0,Math.PI*2,!1),e.moveTo(t.x+t.r0,t.y),e.arc(t.x,t.y,t.r0,0,Math.PI*2,!0);return},getRect:function(e){if(e.__rect)return e.__rect;var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,e.__rect={x:Math.round(e.x-e.r-t/2),y:Math.round(e.y-e.r-t/2),width:e.r*2+t,height:e.r*2+t},e.__rect}},e("../tool/util").inherits(n,t),n}),r("zrender/shape/Sector",["require","../tool/math","./Base","./Ring","./Polygon","../tool/util"],function(e){function r(e){n.call(this,e)}var t=e("../tool/math"),n=e("./Base");return r.prototype={type:"sector",buildPath:function(e,n){var r=n.x,i=n.y,s=typeof n.r0=="undefined"?0:n.r0,o=n.r,u=n.startAngle,a=n.endAngle;if(Math.abs(a-u)>=360){e.arc(r,i,o,0,Math.PI*2,!1),s!==0&&(e.moveTo(r+s,i),e.arc(r,i,s,0,Math.PI*2,!0));return}u=t.degreeToRadian(u),a=t.degreeToRadian(a);var f=Math.PI*2,l=t.cos(u),c=t.sin(u);e.moveTo(l*s+r,i-c*s),e.lineTo(l*o+r,i-c*o),e.arc(r,i,o,f-u,f-a,!0),e.lineTo(t.cos(a)*s+r,i-t.sin(a)*s),s!==0&&e.arc(r,i,s,f-a,f-u,!1);return},getRect:function(n){if(n.__rect)return n.__rect;var r=n.x,i=n.y,s=typeof n.r0=="undefined"?0:n.r0,o=n.r,u=n.startAngle,a=n.endAngle;if(Math.abs(a-u)>=360)return n.__rect=e("./Ring").prototype.getRect(n),n.__rect;u=(720+u)%360,a=(720+a)%360,a<=u&&(a+=360);var f=[];return u<=90&&a>=90&&f.push([r,i-o]),u<=180&&a>=180&&f.push([r-o,i]),u<=270&&a>=270&&f.push([r,i+o]),u<=360&&a>=360&&f.push([r+o,i]),u=t.degreeToRadian(u),a=t.degreeToRadian(a),f.push([t.cos(u)*s+r,i-t.sin(u)*s]),f.push([t.cos(u)*o+r,i-t.sin(u)*o]),f.push([t.cos(a)*o+r,i-t.sin(a)*o]),f.push([t.cos(a)*s+r,i-t.sin(a)*s]),n.__rect=e("./Polygon").prototype.getRect({brushType:n.brushType,lineWidth:n.lineWidth,pointList:f}),n.__rect}},e("../tool/util").inherits(r,n),r}),r("echarts/util/shape/Candle",["require","zrender/shape/Base","zrender/tool/util","./normalIsCover"],function(e){function r(e){t.call(this,e)}var t=e("zrender/shape/Base"),n=e("zrender/tool/util");return r.prototype={type:"candle",_numberOrder:function(e,t){return t-e},buildPath:function(e,t){var r=n.clone(t.y).sort(this._numberOrder);e.moveTo(t.x,r[3]),e.lineTo(t.x,r[2]),e.moveTo(t.x-t.width/2,r[2]),e.rect(t.x-t.width/2,r[2],t.width,r[1]-r[2]),e.moveTo(t.x,r[1]),e.lineTo(t.x,r[0])},getRect:function(e){if(!e.__rect){var t=0;if(e.brushType=="stroke"||e.brushType=="fill")t=e.lineWidth||1;var r=n.clone(e.y).sort(this._numberOrder);e.__rect={x:Math.round(e.x-e.width/2-t/2),y:Math.round(r[3]-t/2),width:e.width+t,height:r[0]-r[3]+t}}return e.__rect},isCover:e("./normalIsCover")},n.inherits(r,t),r}),r("echarts/component/legend",["require","./base","zrender/shape/Text","zrender/shape/Rectangle","zrender/shape/Sector","../util/shape/Icon","../util/shape/Candle","../config","zrender/tool/util","zrender/tool/area","../component"],function(e){function l(e,n,r,i,s){if(!this.query(i,"legend.data")){console.error("option.legend.data has not been defined.");return}t.call(this,e,n,r,i,s);var o=this;o._legendSelected=function(e){o.__legendSelected(e)},this._colorIndex=0,this._colorMap={},this._selectedMap={},this.refresh(i)}var t=e("./base"),n=e("zrender/shape/Text"),r=e("zrender/shape/Rectangle"),i=e("zrender/shape/Sector"),s=e("../util/shape/Icon"),o=e("../util/shape/Candle"),u=e("../config"),a=e("zrender/tool/util"),f=e("zrender/tool/area");l.prototype={type:u.COMPONENT_TYPE_LEGEND,_buildShape:function(){this._itemGroupLocation=this._getItemGroupLocation(),this._buildBackground(),this._buildItem();for(var e=0,t=this.shapeList.length;e=d-m&&(m=this._itemGroupLocation.x,g+=b+w):v-g<200&&b+(S==t-1||e[S+1]===""?0:w)>=v-g&&(this.legendOption.x=="right"?m-=this._itemGroupLocation.maxWidth+w:m+=this._itemGroupLocation.maxWidth+w,g=this._itemGroupLocation.y),o=this._getItemShapeByType(m,g,y,b,this._selectedMap[r]?E:"#ccc",i,E),o._name=r,o=new s(o),u={zlevel:this._zlevelBase,style:{x:m+y+5,y:g+b/2,color:this._selectedMap[r]?c.color==="auto"?E:c.color:"#ccc",text:p,textFont:h,textBaseline:"middle"},highlightStyle:{color:E,brushType:"fill"},hoverable:!!this.legendOption.selectedMode,clickable:!!this.legendOption.selectedMode},this.legendOption.orient=="vertical"&&this.legendOption.x=="right"&&(u.style.x-=y+10,u.style.textAlign="right"),u._name=r,u=new n(u),this.legendOption.selectedMode&&(o.onclick=u.onclick=this._legendSelected,o.onmouseover=u.onmouseover=this.hoverConnect,o.hoverConnect=u.id,u.hoverConnect=o.id),this.shapeList.push(o),this.shapeList.push(u),this.legendOption.orient=="horizontal"?m+=y+5+f.getTextWidth(p,h)+w:g+=b+w}this.legendOption.orient=="horizontal"&&this.legendOption.x=="center"&&g!=this._itemGroupLocation.y&&this._mLineOptimize()},_getName:function(e){return typeof e.name!="undefined"?e.name:e},_getFormatterName:function(e){var t=this.legendOption.formatter,n;return typeof t=="function"?n=t.call(this.myChart,e):typeof t=="string"?n=t.replace("{name}",e):n=e,n},_getFormatterNameFromData:function(e){var t=this._getName(e);return this._getFormatterName(t)},_mLineOptimize:function(){var e=[],t=this._itemGroupLocation.x;for(var n=2,r=this.shapeList.length;nh?(u=h,l+=i+n):u=Math.max(u,d),l+=i+n,d=0;continue}d+=r+f.getTextWidth(this._getFormatterNameFromData(e[m]),e[m].textStyle?this.getFont(a.merge(e[m].textStyle||{},s)):o)+n}l=Math.max(l,i),d-=n,d>h?(u=h,l+=i+n):u=Math.max(u,d)}else{for(var m=0;mp?(l=p,u+=v+n):l=Math.max(l,d),u+=v+n,d=0;continue}d+=i+n}u=Math.max(u,v),d-=n,d>p?(l=p,u+=v+n):l=Math.max(l,d)}h=this.zr.getWidth(),p=this.zr.getHeight();var g;switch(this.legendOption.x){case"center":g=Math.floor((h-u)/2);break;case"left":g=this.legendOption.padding[3]+this.legendOption.borderWidth;break;case"right":g=h-u-this.legendOption.padding[1]-this.legendOption.padding[3]-this.legendOption.borderWidth*2;break;default:g=this.parsePercent(this.legendOption.x,h)}var y;switch(this.legendOption.y){case"top":y=this.legendOption.padding[0]+this.legendOption.borderWidth;break;case"bottom":y=p-l-this.legendOption.padding[0]-this.legendOption.padding[2]-this.legendOption.borderWidth*2;break;case"center":y=Math.floor((p-l)/2);break;default:y=this.parsePercent(this.legendOption.y,p)}return{x:g,y:y,width:u,height:l,maxWidth:v}},_getSomethingByName:function(e){var t=this.option.series,n;for(var r=0,i=t.length;r=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height?!0:!1}},i.inherits(o,t),o}),r("echarts/component/timeline",["require","./base","zrender/shape/Rectangle","../util/shape/Icon","../util/shape/Chain","../config","zrender/tool/util","zrender/tool/area","zrender/tool/event","../component"],function(e){function f(e,n,r,i,u){t.call(this,e,n,r,i,u);var a=this;a._onclick=function(e){return a.__onclick(e)},a._ondrift=function(e,t){return a.__ondrift(this,e,t)},a._ondragend=function(){return a.__ondragend()},a._setCurrentOption=function(){var e=a.timelineOption;a.currentIndex%=e.data.length;var t=a.options[a.currentIndex]||{};a.myChart.setOption(t,e.notMerge),a.messageCenter.dispatch(s.EVENT.TIMELINE_CHANGED,null,{currentIndex:a.currentIndex,data:typeof e.data[a.currentIndex].name!="undefined"?e.data[a.currentIndex].name:e.data[a.currentIndex]},a.myChart)},a._onFrame=function(){a._setCurrentOption(),a._syncHandleShape(),a.timelineOption.autoPlay&&(a.playTicket=setTimeout(function(){a.currentIndex+=1;if(!a.timelineOption.loop&&a.currentIndex>=a.timelineOption.data.length){a.currentIndex=a.timelineOption.data.length-1,a.stop();return}a._onFrame()},a.timelineOption.playInterval))},this.setTheme(!1),this.options=this.option.options,this.currentIndex=this.timelineOption.currentIndex%this.timelineOption.data.length,!this.timelineOption.notMerge&&this.currentIndex!==0&&(this.options[this.currentIndex]=o.merge(this.options[this.currentIndex],this.options[0])),this.timelineOption.show&&(this._buildShape(),this._syncHandleShape()),this._setCurrentOption();if(this.timelineOption.autoPlay){var a=this;this.playTicket=setTimeout(function(){a.play()},this.ecTheme.animationDuration)}}function l(e,t){var n=2,i=t.x+n,s=t.y+n+2,o=t.width-n,u=t.height-n,a=t.symbol;if(a=="last")e.moveTo(i+o-2,s+u/3),e.lineTo(i+o-2,s),e.lineTo(i+2,s+u/2),e.lineTo(i+o-2,s+u),e.lineTo(i+o-2,s+u/3*2),e.moveTo(i,s),e.lineTo(i,s);else if(a=="next")e.moveTo(i+2,s+u/3),e.lineTo(i+2,s),e.lineTo(i+o-2,s+u/2),e.lineTo(i+2,s+u),e.lineTo(i+2,s+u/3*2),e.moveTo(i,s),e.lineTo(i,s);else if(a=="play")if(t.status=="stop")e.moveTo(i+2,s),e.lineTo(i+o-2,s+u/2),e.lineTo(i+2,s+u),e.lineTo(i+2,s);else{var f=t.brushType=="both"?2:3;e.rect(i+2,s,f,u),e.rect(i+o-f-2,s,f,u)}else if(a.match("image")){var l="";l=a.replace(new RegExp("^image:\\/\\/"),""),a=r.prototype.iconLibrary.image,a(e,{x:i,y:s,width:o,height:u,image:l})}}var t=e("./base"),n=e("zrender/shape/Rectangle"),r=e("../util/shape/Icon"),i=e("../util/shape/Chain"),s=e("../config"),o=e("zrender/tool/util"),u=e("zrender/tool/area"),a=e("zrender/tool/event");return f.prototype={type:s.COMPONENT_TYPE_TIMELINE,_buildShape:function(){this._location=this._getLocation(),this._buildBackground(),this._buildControl(),this._chainPoint=this._getChainPoint();if(this.timelineOption.label.show){var e=this._getInterval();for(var t=0,n=this._chainPoint.length;t3){var o=!1,a,f;n=0;while(!o&&n1){var v=c/h;v=v>50?50:v<20?5:v,c-=v*2;if(e.type=="number")for(var m=0;m0?"right":"left",S=[r*Math.PI/180,f,l-5]):S=!1,g.push({x:f,n:b,isEmpty:w,symbol:y,symbolSize:a[m].symbolSize||n,color:a[m].color,borderColor:a[m].borderColor,borderWidth:a[m].borderWidth,name:this._getReformedLabel(m),textColor:u.color,textAlign:E,textBaseline:u.baseline||"middle",textX:f,textY:l-(r?5:0),textFont:a[m].textStyle?this.getFont(u):s,rotation:S,showLabel:!1});return g},_buildBackground:function(){var e=this.timelineOption,t=e.padding,r=this._location.width,i=this._location.height;(e.borderWidth!==0||e.backgroundColor.replace(/\s/g,"")!="rgba(0,0,0,0)")&&this.shapeList.push(new n({zlevel:this._zlevelBase,hoverable:!1,style:{x:this._location.x-t[3],y:this._location.y-t[0],width:r+t[1]+t[3],height:i+t[0]+t[2],brushType:e.borderWidth===0?"fill":"both",color:e.backgroundColor,strokeColor:e.borderColor,lineWidth:e.borderWidth}}))},_buildControl:function(){var e=this,t=this.timelineOption,n=t.lineStyle,i=t.controlStyle;if(t.controlPosition=="none")return;var s=15,u=5,a;t.controlPosition=="left"?(a=this._location.x,this._location.x+=(s+u)*3):(a=this._location.x2-((s+u)*3-u),this._location.x2-=(s+u)*3);var f=this._location.y,l={zlevel:this._zlevelBase+1,style:{iconType:"timelineControl",symbol:"last",x:a,y:f,width:s,height:s,brushType:"stroke",color:i.normal.color,strokeColor:i.normal.color,lineWidth:n.width},highlightStyle:{color:i.emphasis.color,strokeColor:i.emphasis.color,lineWidth:n.width+1},clickable:!0};this._ctrLastShape=new r(l),this._ctrLastShape.onclick=function(){e.last()},this.shapeList.push(this._ctrLastShape),a+=s+u,this._ctrPlayShape=new r(o.clone(l)),this._ctrPlayShape.style.brushType="fill",this._ctrPlayShape.style.symbol="play",this._ctrPlayShape.style.status=this.timelineOption.autoPlay?"playing":"stop",this._ctrPlayShape.style.x=a,this._ctrPlayShape.onclick=function(){e._ctrPlayShape.style.status=="stop"?e.play():e.stop()},this.shapeList.push(this._ctrPlayShape),a+=s+u,this._ctrNextShape=new r(o.clone(l)),this._ctrNextShape.style.symbol="next",this._ctrNextShape.style.x=a,this._ctrNextShape.onclick=function(){e.next()},this.shapeList.push(this._ctrNextShape)},_buildChain:function(){var e=this.timelineOption,t=e.lineStyle;this._timelineShae={zlevel:this._zlevelBase,style:{x:this._location.x,y:this.subPixelOptimize(this._location.y,t.width),width:this._location.x2-this._location.x,height:this._location.height,chainPoint:this._chainPoint,brushType:"both",strokeColor:t.color,lineWidth:t.width,lineType:t.type},hoverable:!1,clickable:!0,onclick:this._onclick},this._timelineShae=new i(this._timelineShae),this.shapeList.push(this._timelineShae)},_buildHandle:function(){var e=this._chainPoint[this.currentIndex],t=e.symbolSize+1;t=t<5?5:t,this._handleShape={zlevel:this._zlevelBase+1,hoverable:!1,draggable:!0,style:{iconType:"diamond",n:e.n,x:e.x-t,y:this._location.y+this._location.height/4-t,width:t*2,height:t*2,brushType:"both",textPosition:"specific",textX:e.x,textY:this._location.y-this._location.height/4,textAlign:"center",textBaseline:"middle"},highlightStyle:{},ondrift:this._ondrift,ondragend:this._ondragend},this._handleShape=new r(this._handleShape),this.shapeList.push(this._handleShape)},_syncHandleShape:function(){if(!this.timelineOption.show)return;var e=this.timelineOption,t=e.checkpointStyle,n=this._chainPoint[this.currentIndex];this._handleShape.style.text=t.label.show?n.name:"",this._handleShape.style.textFont=n.textFont,this._handleShape.style.n=n.n,t.symbol=="auto"?this._handleShape.style.iconType=n.symbol!="none"?n.symbol:"diamond":(this._handleShape.style.iconType=t.symbol,t.symbol.match("star")&&(this._handleShape.style.n=t.symbol.replace("star","")-0||5,this._handleShape.style.iconType="star"));var r;t.symbolSize=="auto"?(r=n.symbolSize+2,r=r<5?5:r):r=t.symbolSize-0,this._handleShape.style.color=t.color=="auto"?n.color?n.color:e.controlStyle.emphasis.color:t.color,this._handleShape.style.textColor=t.label.textStyle.color=="auto"?this._handleShape.style.color:t.label.textStyle.color,this._handleShape.highlightStyle.strokeColor=this._handleShape.style.strokeColor=t.borderColor=="auto"?n.borderColor?n.borderColor:"#fff":t.borderColor,this._handleShape.style.lineWidth=t.borderWidth=="auto"?n.borderWidth?n.borderWidth:0:t.borderWidth-0,this._handleShape.highlightStyle.lineWidth=this._handleShape.style.lineWidth+1,this.zr.animate(this._handleShape.id,"style").when(500,{x:n.x-r,textX:n.x,y:this._location.y+this._location.height/4-r,width:r*2,height:r*2}).start("ExponentialOut")},_findChainIndex:function(e){var t=this._chainPoint,n=t.length;if(e<=t[0].x)return 0;if(e>=t[n-1].x)return n-1;for(var r=0;r=t[r].x&&e<=t[r+1].x)return Math.abs(e-t[r].x)=n[r-1].x-n[r-1].symbolSize?(e.style.x=n[r-1].x-n[r-1].symbolSize,i=r-1):(e.style.x+=t,i=this._findChainIndex(e.style.x));var s=n[i],o=s.symbolSize+2;e.style.iconType=s.symbol,e.style.n=s.n,e.style.textX=e.style.x+o/2,e.style.y=this._location.y+this._location.height/4-o,e.style.width=o*2,e.style.height=o*2,e.style.text=s.name;if(i==this.currentIndex)return!0;this.currentIndex=i;if(this.timelineOption.realtime){clearTimeout(this.playTicket);var u=this;this.playTicket=setTimeout(function(){u._setCurrentOption()},200)}return!0},__ondragend:function(){this.isDragend=!0},ondragend:function(e,t){if(!this.isDragend||!e.target)return;!this.timelineOption.realtime&&this._setCurrentOption(),t.dragOut=!0,t.dragIn=!0,t.needRefresh=!1,this.isDragend=!1,this._syncHandleShape();return},last:function(){return this.timelineOption.autoPlay&&this.stop(),this.currentIndex-=1,this.currentIndex<0&&(this.currentIndex=this.timelineOption.data.length-1),this._onFrame(),this.currentIndex},next:function(){return this.timelineOption.autoPlay&&this.stop(),this.currentIndex+=1,this.currentIndex>=this.timelineOption.data.length&&(this.currentIndex=0),this._onFrame(),this.currentIndex},play:function(e,t){return this._ctrPlayShape&&this._ctrPlayShape.style.status!="playing"&&(this._ctrPlayShape.style.status="playing",this.zr.modShape(this._ctrPlayShape.id),this.zr.refresh()),this.timelineOption.autoPlay=typeof t!="undefined"?t:!0,this.timelineOption.autoPlay||clearTimeout(this.playTicket),this.currentIndex=typeof e!="undefined"?e:this.currentIndex+1,this.currentIndex>=this.timelineOption.data.length&&(this.currentIndex=0),this._onFrame(),this.currentIndex},stop:function(){return this._ctrPlayShape&&this._ctrPlayShape.style.status!="stop"&&(this._ctrPlayShape.style.status="stop",this.zr.modShape(this._ctrPlayShape.id),this.zr.refresh()),this.timelineOption.autoPlay=!1,clearTimeout(this.playTicket),this.currentIndex},resize:function(){this.timelineOption.show&&(this.clear(),this._buildShape(),this._syncHandleShape())},setTheme:function(e){this.timelineOption=this.reformOption(o.clone(this.option.timeline)),this.timelineOption.padding=this.reformCssArray(this.timelineOption.padding),this.timelineOption.label.textStyle=o.merge(this.timelineOption.label.textStyle||{},this.ecTheme.textStyle),this.timelineOption.checkpointStyle.label.textStyle=o.merge(this.timelineOption.checkpointStyle.label.textStyle||{},this.ecTheme.textStyle),this.timelineOption.show&&e&&(this.clear(),this._buildShape(),this._syncHandleShape())},dispose:function(){this.clear(),this.shapeList=null,clearTimeout(this.playTicket)}},r.prototype.iconLibrary.timelineControl=l,o.inherits(f,t),e("../component").define("timeline",f),f}),r("zrender/loadingEffect/Bar",["require","./Base","../tool/util","../tool/color","../shape/Rectangle"],function(e){function s(e){t.call(this,e)}var t=e("./Base"),n=e("../tool/util"),r=e("../tool/color"),i=e("../shape/Rectangle");return n.inherits(s,t),s.prototype._start=function(e,t){var s=n.merge(this.options,{textStyle:{color:"#888"},backgroundColor:"rgba(250, 250, 250, 0.8)",effectOption:{x:0,y:this.canvasHeight/2-30,width:this.canvasWidth,height:5,brushType:"fill",timeInterval:100}}),o=this.createTextShape(s.textStyle),u=this.createBackgroundShape(s.backgroundColor),a=s.effectOption,f=new i({highlightStyle:n.clone(a)});f.highlightStyle.color=a.color||r.getLinearGradient(a.x,a.y,a.x+a.width,a.y+a.height,[[0,"#ff6400"],[.5,"#ffe100"],[1,"#b1ff00"]]);if(s.progress!=null){e(u),f.highlightStyle.width=this.adjust(s.progress,[0,1])*s.effectOption.width,e(f),e(o),t();return}return f.highlightStyle.width=0,setInterval(function(){e(u),f.highlightStyle.width=h&&(c[n].len=Math.ceil(Math.random()*400),r.xStart=-400,r.xEnd=-400+c[n].len,r.yStart=Math.ceil(Math.random()*p),r.yEnd=r.yStart),r.xStart+=c[n].animationX,r.xEnd+=c[n].animationX,e(c[n])}e(o),t()},a.timeInterval)},s}),r("zrender/loadingEffect/Ring",["require","./Base","../tool/util","../tool/color","../shape/Ring","../shape/Sector"],function(e){function o(e){t.call(this,e)}var t=e("./Base"),n=e("../tool/util"),r=e("../tool/color"),i=e("../shape/Ring"),s=e("../shape/Sector");return n.inherits(o,t),o.prototype._start=function(e,t){var o=n.merge(this.options,{textStyle:{color:"#07a"},backgroundColor:"rgba(250, 250, 250, 0.8)",effect:{x:this.canvasWidth/2,y:this.canvasHeight/2,r0:60,r:100,color:"#bbdcff",brushType:"fill",textPosition:"inside",textFont:"normal 30px verdana",textColor:"rgba(30, 144, 255, 0.6)",timeInterval:100}}),u=o.effect,a=o.textStyle;a.x==null&&(a.x=u.x),a.y==null&&(a.y=u.y+(u.r0+u.r)/2-5);var f=this.createTextShape(o.textStyle),l=this.createBackgroundShape(o.backgroundColor),c=u.x,h=u.y,p=u.r0+6,d=u.r-6,v=u.color,m=r.lift(v,.1),g=new i({highlightStyle:n.clone(u)}),y=[],b=r.getGradientColors(["#ff6400","#ffe100","#97ff00"],25),w=15,E=240;for(var S=0;S<16;S++)y.push(new s({highlightStyle:{x:c,y:h,r0:p,r:d,startAngle:E-w,endAngle:E,brushType:"fill",color:m},_color:r.getLinearGradient(c+p*Math.cos(E,!0),h-p*Math.sin(E,!0),c+p*Math.cos(E-w,!0),h-p*Math.sin(E-w,!0),[[0,b[S*2]],[1,b[S*2+1]]])})),E-=w;E=360;for(var S=0;S<4;S++)y.push(new s({highlightStyle:{x:c,y:h,r0:p,r:d,startAngle:E-w,endAngle:E,brushType:"fill",color:m},_color:r.getLinearGradient(c+p*Math.cos(E,!0),h-p*Math.sin(E,!0),c+p*Math.cos(E-w,!0),h-p*Math.sin(E-w,!0),[[0,b[S*2+32]],[1,b[S*2+33]]])})),E-=w;var x=0;if(o.progress!=null){e(l),x=this.adjust(o.progress,[0,1]).toFixed(2)*100/5,g.highlightStyle.text=x*5+"%",e(g);for(var S=0;S<20;S++)y[S].highlightStyle.color=S=20?-20:1,e(g);for(var n=0;n<20;n++)y[n].highlightStyle.color=n ");var u=-1;for(var a=0,f=o.length;a-1){o.splice(u,1),this._optionRestore.series[e][n].data.splice(u,1);var c=this.chart[i.type];c&&c.delMark(e,t.join(" > "),n)}return this},getDom:function(){return this.dom},getZrender:function(){return this._zr},getDataURL:function(e){if(!s)return"";if(this._chartList.length===0){var t="IMG"+this.id,n=document.getElementById(t);if(n)return n.src}var r=this.component.tooltip;r&&r.hideTip();switch(e){case"jpeg":break;default:e="png"}var i=this._option.backgroundColor;return i&&i.replace(" ","")=="rgba(0,0,0,0)"&&(i="#fff"),this._zr.toDataURL("image/"+e,i)},getImage:function(e){var t=this._optionRestore.title,n=document.createElement("img");return n.src=this.getDataURL(e),n.title=t&&t.text||"ECharts",n},getConnectedDataURL:function(t){if(!this.isConnected())return this.getDataURL(t);var n=this.dom,r={self:{img:this.getDataURL(t),left:n.offsetLeft,top:n.offsetTop,right:n.offsetLeft+n.offsetWidth,bottom:n.offsetTop+n.offsetHeight}},i=r.self.left,s=r.self.top,o=r.self.right,u=r.self.bottom;for(var a in this._connected)n=this._connected[a].getDom(),r[a]={img:this._connected[a].getDataURL(t),left:n.offsetLeft,top:n.offsetTop,right:n.offsetLeft+n.offsetWidth,bottom:n.offsetTop+n.offsetHeight},i=Math.min(i,r[a].left),s=Math.min(s,r[a].top),o=Math.max(o,r[a].right),u=Math.max(u,r[a].bottom);var f=document.createElement("div");f.style.position="absolute",f.style.left="-4000px",f.style.width=o-i+"px",f.style.height=u-s+"px",document.body.appendChild(f);var l=e("zrender").init(f),c=e("zrender/shape/Image");for(var a in r)l.addShape(new c({style:{x:r[a].left-i,y:r[a].top-s,image:r[a].img}}));l.render();var h=this._option.backgroundColor;h&&h.replace(/ /g,"")=="rgba(0,0,0,0)"&&(h="#fff");var p=l.toDataURL("image/png",h);return setTimeout(function(){l.dispose(),f.parentNode.removeChild(f),f=null},100),p},getConnectedImage:function(e){var t=this._optionRestore.title,n=document.createElement("img");return n.src=this.getConnectedDataURL(e),n.title=t&&t.text||"ECharts",n},on:function(e,t){return this._messageCenterOutSide.bind(e,t,this),this},un:function(e,t){return this._messageCenterOutSide.unbind(e,t),this},connect:function(e){if(!e)return this;this._connected||(this._connected={});if(e instanceof Array)for(var t=0,n=e.length;t=n/3?1:2),o=t.y+Math.sin(i)*r*(r>=n/3?1:2);i=t.angle-Math.PI/2,e.moveTo(s,o),e.lineTo(t.x+Math.cos(i)*r,t.y-Math.sin(i)*r),e.lineTo(t.x+Math.cos(t.angle)*n,t.y-Math.sin(t.angle)*n),e.lineTo(t.x-Math.cos(i)*r,t.y+Math.sin(i)*r),e.lineTo(s,o);return},getRect:function(e){if(e.__rect)return e.__rect;var t=e.width*2,n=e.x,r=e.y,i=n+Math.cos(e.angle)*e.r,s=r-Math.sin(e.angle)*e.r;return e.__rect={x:Math.min(n,i)-t,y:Math.min(r,s)-t,width:Math.abs(n-i)+t,height:Math.abs(r-s)+t},e.__rect},isCover:e("./normalIsCover")},n.inherits(r,t),r}),r("echarts/chart/gauge",["require","../component/base","./base","../util/shape/GaugePointer","zrender/shape/Text","zrender/shape/Line","zrender/shape/Rectangle","zrender/shape/Circle","zrender/shape/Sector","../config","../util/ecData","../util/accMath","zrender/tool/util","../chart"],function(e){function p(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this),this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("../util/shape/GaugePointer"),i=e("zrender/shape/Text"),s=e("zrender/shape/Line"),o=e("zrender/shape/Rectangle"),u=e("zrender/shape/Circle"),a=e("zrender/shape/Sector"),f=e("../config"),l=e("../util/ecData"),c=e("../util/accMath"),h=e("zrender/tool/util");return p.prototype={type:f.CHART_TYPE_GAUGE,_buildShape:function(){var e=this.series;this._paramsMap={};for(var t=0,n=e.length;t=110&&v<=250?"left":v<=70||v>=290?"right":"center",textBaseline:v>=10&&v<=170?"top":v>=190&&v<=350?"bottom":"middle",textFont:u,shadowColor:o.shadowColor,shadowBlur:o.shadowBlur,shadowOffsetX:o.shadowOffsetX,shadowOffsetY:o.shadowOffsetY}}))},_buildPointer:function(e){var t=this.series[e];if(!t.pointer.show)return;var n=t.max-t.min,i=t.pointer,s=this._paramsMap[e],o=this.parsePercent(i.length,s.radius[1]),a=this.parsePercent(i.width,s.radius[1]),f=s.center,c=this._getValue(e);c=c2?2:a/2,color:"#fff"}});l.pack(d,this.series[e],e,this.series[e].data[0],0,this.series[e].data[0].name,c),this.shapeList.push(d),this.shapeList.push(new u({zlevel:this._zlevelBase+2,hoverable:!1,style:{x:f[0],y:f[1],r:i.width/2.5,color:"#fff"}}))},_buildTitle:function(e){var t=this.series[e];if(!t.title.show)return;var n=t.data[0],r=typeof n.name!="undefined"?n.name:"";if(r!==""){var s=t.title,o=s.offsetCenter,u=s.textStyle,a=u.color,f=this._paramsMap[e],l=f.center[0]+this.parsePercent(o[0],f.radius[1]),c=f.center[1]+this.parsePercent(o[1],f.radius[1]);this.shapeList.push(new i({zlevel:this._zlevelBase+(Math.abs(l-f.center[0])+Math.abs(c-f.center[1]))=t)return n[r][1];return n[n.length-1][1]},_getSector:function(e,t,n,r,i,s,o){return new a({zlevel:this._zlevelBase,hoverable:!1,style:{x:e[0],y:e[1],r0:t,r:n,startAngle:r,endAngle:i,brushType:"fill",color:s,shadowColor:o.shadowColor,shadowBlur:o.shadowBlur,shadowOffsetX:o.shadowOffsetX,shadowOffsetY:o.shadowOffsetY}})},_getLabelText:function(e,t){if(e){if(typeof e=="function")return e.call(this.myChart,t);if(typeof e=="string")return e.replace("{value}",t)}return t},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()}},h.inherits(p,n),h.inherits(p,t),e("../chart").define("gauge",p),p}),r("echarts/chart/funnel",["require","../component/base","./base","zrender/shape/Text","zrender/shape/Line","zrender/shape/Polygon","../config","../util/ecData","../util/number","zrender/tool/util","zrender/tool/color","zrender/tool/area","../chart"],function(e){function h(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this),this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("zrender/shape/Text"),i=e("zrender/shape/Line"),s=e("zrender/shape/Polygon"),o=e("../config"),u=e("../util/ecData"),a=e("../util/number"),f=e("zrender/tool/util"),l=e("zrender/tool/color"),c=e("zrender/tool/area");return h.prototype={type:o.CHART_TYPE_FUNNEL,_buildShape:function(){var e=this.series,t=this.component.legend;this._paramsMap={},this._selected={},this.selectedMap={};var n;for(var r=0,i=e.length;r1?(i.height-(o-1)*h)/o:i.height,d,v=i.y,m=n.sort=="descending"?this._getItemWidth(e,u[0].value):a.parsePercent(n.minSize,i.width),g=n.sort=="descending"?1:0,y=i.centerX,b=[[y-m/2-(m===0?0:10),v-(m===0?10:5)],[y+m/2+(m===0?0:10),v-(m===0?10:5)]];for(var f=0,l=u.length;fc.getTextWidth(w,E)?T="#fff":T=l.reverse(n)):g.position=="left"?(S="right",x=b=="auto"?d.x-10:d.centerX-Math.max(o,u)/2-b):(S="left",x=b=="auto"?d.x+d.width+10:d.centerX+Math.max(o,u)/2+b);var N={zlevel:this._zlevelBase+1,style:{x:x,y:s+a/2,color:y.color||T,text:w,textAlign:y.align||S,textBaseline:y.baseline||"middle",textFont:E}};return m="emphasis",g=v[m].label||g,y=g.textStyle||y,b=v[m].labelLine.length||b,g.position=g.position||v.normal.label.position,w=this.getLabelText(e,t,m),E=this.getFont(y),T=n,g.position=="inner"||g.position=="inside"?(S="center",x=i+o/2,Math.max(o,u)/2>c.getTextWidth(w,E)?T="#fff":T=l.reverse(n)):g.position=="left"?(S="right",x=b=="auto"?d.x-10:d.centerX-Math.max(o,u)/2-b):(S="left",x=b=="auto"?d.x+d.width+10:d.centerX+Math.max(o,u)/2+b),N.highlightStyle={x:x,color:y.color||T,text:w,textAlign:y.align||S,textFont:E,brushType:"fill"},new r(N)},getLabelText:function(e,t,n){var r=this.series,i=r[e],s=i.data[t],o=this.deepQuery([s,i],"itemStyle."+n+".label.formatter");if(!o)return s.name;if(typeof o=="function")return o.call(this.myChart,i.name,s.name,s.value);if(typeof o=="string")return o=o.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}"),o=o.replace("{a0}",i.name).replace("{b0}",s.name).replace("{c0}",s.value),o},getLabelLine:function(e,t,n,r,s,o,u,a){var l=this.series[e],c=l.data[t],h=this._paramsMap[e].location,p=f.merge(f.clone(c.itemStyle)||{},l.itemStyle),d="normal",v=p[d].labelLine,m=p[d].labelLine.length,g=v.lineStyle||{},y=p[d].label;y.position=y.position||p.normal.label.position;var b;y.position=="inner"||y.position=="inside"?b=r+o/2:y.position=="left"?b=m=="auto"?h.x-10:h.centerX-Math.max(o,u)/2-m:b=m=="auto"?h.x+h.width+10:h.centerX+Math.max(o,u)/2+m;var w={zlevel:this._zlevelBase+1,hoverable:!1,style:{xStart:h.centerX,yStart:s+a/2,xEnd:b,yEnd:s+a/2,strokeColor:g.color||n,lineType:g.type,lineWidth:g.width}};return d="emphasis",v=p[d].labelLine||v,m=p[d].labelLine.length||m,g=v.lineStyle||g,y=p[d].label||y,y.position=y.position,y.position=="inner"||y.position=="inside"?b=r+o/2:y.position=="left"?b=m=="auto"?h.x-10:h.centerX-Math.max(o,u)/2-m:b=m=="auto"?h.x+h.width+10:h.centerX+Math.max(o,u)/2+m,w.highlightStyle={xEnd:b,strokeColor:g.color||n,lineType:g.type,lineWidth:g.width},new i(w)},_needLabel:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".label.show")},_needLabelLine:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".labelLine.show")},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()}},f.inherits(h,n),f.inherits(h,t),e("../chart").define("funnel",h),h}),r("echarts/component/categoryAxis",["require","./base","zrender/shape/Text","zrender/shape/Line","zrender/shape/Rectangle","../config","zrender/tool/util","zrender/tool/area","../component"],function(e){function a(e,n,r,i,s,o){if(i.data.length<1){console.error("option.data.length < 1.");return}t.call(this,e,n,r,i,s),this.grid=this.component.grid;for(var u in o)this[u]=o[u];this.refresh(i)}var t=e("./base"),n=e("zrender/shape/Text"),r=e("zrender/shape/Line"),i=e("zrender/shape/Rectangle"),s=e("../config"),o=e("zrender/tool/util"),u=e("zrender/tool/area");return a.prototype={type:s.COMPONENT_TYPE_AXIS_CATEGORY,_getReformedLabel:function(e){var t=typeof this.option.data[e].value!="undefined"?this.option.data[e].value:this.option.data[e],n=this.option.data[e].formatter||this.option.axisLabel.formatter;return n&&(typeof n=="function"?t=n.call(this.myChart,t):typeof n=="string"&&(t=n.replace("{value}",t))),t},_getInterval:function(){var e=this.option.axisLabel.interval;if(e=="auto"){var t=this.option.axisLabel.textStyle.fontSize,n=this.option.data,r=this.option.data.length;if(this.isHorizontal())if(r>3){var i=this.getGap(),s=!1,a,f,l=Math.floor(.5/i);l=l<1?1:l,e=Math.floor(15/i);while(!s&&e=0;c-=e){if(this.option.axisLabel.rotate!==0)f=t;else if(n[c].textStyle)f=u.getTextWidth(this._getReformedLabel(c),this.getFont(o.merge(n[c].textStyle,this.option.axisLabel.textStyle)));else{var h=this._getReformedLabel(c)+"",p=(h.match(/\w/g)||"").length,d=h.length-p;f=p*t*2/3+d*t}if(a3){var i=this.getGap();e=Math.floor(11/i);while(i*e-60?-u:0;if(this.isHorizontal()){var c=this.option.position=="bottom"?n.inside?this.grid.getYend()-i-1:this.grid.getYend()+1:n.inside?this.grid.getY()+1:this.grid.getY()-i-1,h;for(var p=l;p=0?f:0),o),e={_axisShape:"axisTick",zlevel:this._zlevelBase,hoverable:!1,style:{xStart:h,yStart:c,xEnd:h,yEnd:c+i,strokeColor:s,lineWidth:o}},this.shapeList.push(new r(e))}else{var d=this.option.position=="left"?n.inside?this.grid.getX()+1:this.grid.getX()-i-1:n.inside?this.grid.getXend()-i-1:this.grid.getXend()+1,v;for(var p=l;p=0?f:0),o),e={_axisShape:"axisTick",zlevel:this._zlevelBase,hoverable:!1,style:{xStart:d,yStart:v,xEnd:d+i,yEnd:v,strokeColor:s,lineWidth:o}},this.shapeList.push(new r(e))}},_buildAxisLabel:function(){var e,t=this.option.data,r=this.option.data.length,i=this.option.axisLabel.rotate,s=this.option.axisLabel.margin,u=this.option.axisLabel.clickable,a=this.option.axisLabel.textStyle,f;if(this.isHorizontal()){var l,c;this.option.position=="bottom"?(l=this.grid.getYend()+s,c="top"):(l=this.grid.getY()-s,c="bottom");for(var h=0;h0?this.option.position=="bottom"?"right":"left":this.option.position=="bottom"?"left":"right",e.rotation=[i*Math.PI/180,e.style.x,e.style.y]),this.shapeList.push(new n(this._axisLabelClickable(u,e)))}}else{var p,d;this.option.position=="left"?(p=this.grid.getX()-s,d="right"):(p=this.grid.getXend()+s,d="left");for(var h=0;h1?e-1:1)},getCoord:function(e){var t=this.option.data,n=t.length,r=this.getGap(),i=this.option.boundaryGap?r/2:0;for(var s=0;sthis.option.data.length-1)return this.isHorizontal()?this.grid.getXend():this.grid.getY();var t=this.getGap(),n=this.option.boundaryGap?t/2:0;return n+=e*t,this.isHorizontal()?n=this.grid.getX()+n:n=this.grid.getYend()-n,n},getNameByIndex:function(e){var t=this.option.data[e];return typeof t!="undefined"&&typeof t.value!="undefined"?t.value:t},getIndexByName:function(e){var t=this.option.data,n=t.length;for(var r=0;r0?this.option.position=="bottom"?"right":"left":this.option.position=="bottom"?"left":"right",e.rotation=[i*Math.PI/180,e.style.x,e.style.y]),this.shapeList.push(new n(this._axisLabelClickable(o,e)))}else{var c,h;this.option.position=="left"?(c=this.grid.getX()-s,h="right"):(c=this.grid.getXend()+s,h="left");for(var l=0;l=0?typeof t[h][l]!="undefined"?t[h][l]+=n:t[h][l]=n:typeof t[p][l]!="undefined"?t[p][l]+=n:t[p][l]=n,this.option.scale&&t[f].push(n)}}}for(var u in t){e=t[u];for(var l=0,c=e.length;l0?this.option.power:1:this._max>0?this._min=this._max/this.option.splitNumber:this._max=this._max/this.option.splitNumber),this._reformValue(this.option.scale)}else this._hasData=!0,this._min=this.option.min-0,this._max=this.option.max-0,this._customerValue()},_reformValue:function(e){var t=this.option.splitNumber,n=this.option.precision,r,i;n===0?i=this.option.power>1?this.option.power:1:(i=Math.pow(10,n),this._min*=i,this._max*=i,i=this.option.power);var s;if(this._min>=0&&this._max>=0){if(!e){while(this._max/i1?i/10:1,s=this._max-this._min,r=Math.ceil(s/t/i)*i,this._max=this._min+r*t}else if(this._min<=0&&this._max<=0){i=-i;if(!e){while(this._min/ii&&i!=-1)i/=10;n===0&&(this._min=Math.ceil(this._min/i)*i,this._max=Math.floor(this._max/i)*i)}i=i<-1?i/10:-1,s=this._min-this._max,r=-Math.ceil(s/t/i)*i,this._min=-r*t+this._max}else{s=this._max-this._min;while(s/ithis._max?this._max:e;var t;return this.isHorizontal()?t=this.grid.getX()+(e-this._min)/(this._max-this._min)*this.grid.getWidth():t=this.grid.getYend()-(e-this._min)/(this._max-this._min)*this.grid.getHeight(),t},getCoordSize:function(e){return this.isHorizontal()?Math.abs(e/(this._max-this._min)*this.grid.getWidth()):Math.abs(e/(this._max-this._min)*this.grid.getHeight())},getValueFromCoord:function(e){var t;return this.isHorizontal()?(e=ethis.grid.getXend()?this.grid.getXend():e,t=this._min+(e-this.grid.getX())/this.grid.getWidth()*(this._max-this._min)):(e=ethis.grid.getYend()?this.grid.getYend():e,t=this._max-(e-this.grid.getY())/this.grid.getHeight()*(this._max-this._min)),t.toFixed(2)-0}},o.inherits(u,t),e("../component").define("valueAxis",u),u}),r("echarts/component/axis",["require","./base","zrender/shape/Line","../config","../util/ecData","zrender/tool/util","zrender/tool/color","./categoryAxis","./valueAxis","../component"],function(e){function u(e,n,r,i,s,o){t.call(this,e,n,r,i,s),this.axisType=o,this._axisList=[],this.refresh(i)}var t=e("./base"),n=e("zrender/shape/Line"),r=e("../config"),i=e("../util/ecData"),s=e("zrender/tool/util"),o=e("zrender/tool/color");return u.prototype={type:r.COMPONENT_TYPE_AXIS,axisBase:{_buildAxisLine:function(){var e=this.option.axisLine.lineStyle.width,t=e/2,r={_axisShape:"axisLine",zlevel:this._zlevelBase+1,hoverable:!1};switch(this.option.position){case"left":r.style={xStart:this.grid.getX()-t,yStart:this.grid.getYend(),xEnd:this.grid.getX()-t,yEnd:this.grid.getY(),lineCap:"round"};break;case"right":r.style={xStart:this.grid.getXend()+t,yStart:this.grid.getYend(),xEnd:this.grid.getXend()+t,yEnd:this.grid.getY(),lineCap:"round"};break;case"bottom":r.style={xStart:this.grid.getX(),yStart:this.grid.getYend()+t,xEnd:this.grid.getXend(),yEnd:this.grid.getYend()+t,lineCap:"round"};break;case"top":r.style={xStart:this.grid.getX(),yStart:this.grid.getY()-t,xEnd:this.grid.getXend(),yEnd:this.grid.getY()-t,lineCap:"round"}}this.option.name!==""&&(r.style.text=this.option.name,r.style.textPosition=this.option.nameLocation,r.style.textFont=this.getFont(this.option.nameTextStyle),this.option.nameTextStyle.align&&(r.style.textAlign=this.option.nameTextStyle.align),this.option.nameTextStyle.baseline&&(r.style.textBaseline=this.option.nameTextStyle.baseline),this.option.nameTextStyle.color&&(r.style.textColor=this.option.nameTextStyle.color)),r.style.strokeColor=this.option.axisLine.lineStyle.color,r.style.lineWidth=e,this.isHorizontal()?r.style.yStart=r.style.yEnd=this.subPixelOptimize(r.style.yEnd,e):r.style.xStart=r.style.xEnd=this.subPixelOptimize(r.style.xEnd,e),r.style.lineType=this.option.axisLine.lineStyle.type,r=new n(r),this.shapeList.push(r)},_axisLabelClickable:function(e,t){return e?(i.pack(t,undefined,-1,undefined,-1,t.style.text),t.hoverable=!0,t.clickable=!0,t.highlightStyle={color:o.lift(t.style.color,1),brushType:"fill"},t):t},refixAxisShape:function(e,t){if(!this.option.axisLine.onZero)return;var n;if(this.isHorizontal()&&typeof t!="undefined")for(var r=0,i=this.shapeList.length;r2&&(e=[e[0],e[1]]);if(this.axisType=="xAxis"){if(!e[0].position||e[0].position!="bottom"&&e[0].position!="top")e[0].position="bottom";e.length>1&&(e[1].position=e[0].position=="bottom"?"top":"bottom");for(var t=0,n=e.length;t1&&(e[1].position=e[0].position=="left"?"right":"left");for(var t=0,n=e.length;t=0&&(o.isHorizontal()?t=o.getCoord(0):n=o.getCoord(0));if(typeof t!="undefined"||typeof n!="undefined"){s=i.length;while(s--)i[s].refixAxisShape(t,n)}},refresh:function(e){if(e||this._zrWidth!=this.zr.getWidth()||this._zrHeight!=this.zr.getHeight()){this.clear(),this.option=e||this.option,this.option.grid=this.reformOption(this.option.grid);var t=this.option.grid;this._zrWidth=this.zr.getWidth(),this._zrHeight=this.zr.getHeight(),this._x=this.parsePercent(t.x,this._zrWidth),this._y=this.parsePercent(t.y,this._zrHeight);var r=this.parsePercent(t.x2,this._zrWidth),i=this.parsePercent(t.y2,this._zrHeight);typeof t.width=="undefined"?this._width=this._zrWidth-this._x-r:this._width=this.parsePercent(t.width,this._zrWidth),typeof t.height=="undefined"?this._height=this._zrHeight-this._y-i:this._height=this.parsePercent(t.height,this._zrHeight),this._x=this.subPixelOptimize(this._x,t.borderWidth),this._y=this.subPixelOptimize(this._y,t.borderWidth),this.shapeList.push(new n({zlevel:this._zlevelBase,hoverable:!1,style:{x:this._x,y:this._y,width:this._width,height:this._height,brushType:t.borderWidth>0?"both":"fill",color:t.backgroundColor,strokeColor:t.borderColor,lineWidth:t.borderWidth}})),this.zr.addShape(this.shapeList[0])}}},i.inherits(s,t),e("../component").define("grid",s),s}),r("echarts/component/dataZoom",["require","./base","zrender/shape/Rectangle","zrender/shape/Polygon","../util/shape/Icon","../config","zrender/tool/util","../component","../component"],function(e){function u(e,n,r,i,s){t.call(this,e,n,r,i,s);var o=this;o._ondrift=function(e,t){return o.__ondrift(this,e,t)},o._ondragend=function(){return o.__ondragend()},this._fillerSize=28,this._handleSize=8,this._isSilence=!1,this._zoom={},this.option.dataZoom=this.reformOption(this.option.dataZoom),this.zoomOption=this.option.dataZoom,this._location=this._getLocation(),this._zoom=this._getZoom(),this._backupData(),this.option.dataZoom.show&&this._buildShape(),this._syncData()}var t=e("./base"),n=e("zrender/shape/Rectangle"),r=e("zrender/shape/Polygon"),i=e("../util/shape/Icon"),s=e("../config"),o=e("zrender/tool/util");return u.prototype={type:s.COMPONENT_TYPE_DATAZOOM,_buildShape:function(){this._buildBackground(),this._buildFiller(),this._buildHandle(),this._buildFrame();for(var e=0,t=this.shapeList.length;ep&&(h+=p,p=h-p,h-=p);var d=Math.round((p-h)/100*(this.zoomOption.orient=="horizontal"?this._location.width:this._location.height));return{start:h,end:p,start2:0,end2:100,size:d,xAxisIndex:i,yAxisIndex:o,seriesIndex:r,scatterMap:this._zoom.scatterMap||{}}},_backupData:function(){this._originalData={xAxis:{},yAxis:{},series:{}};var e=this.option.xAxis,t=this._zoom.xAxisIndex;for(var n=0,r=t.length;n1?1:0)),w=t/(i-(i>1?1:0)),E=1;this.zoomOption.orient=="horizontal"&&b<1?E=Math.floor(i*3/e):this.zoomOption.orient=="vertical"&&w<1&&(E=Math.floor(i*3/t));for(var a=0,f=i;athis._location.x?1:0),height:this._location.height-(t>this._location.y?1:0),lineWidth:1,brushType:"stroke",strokeColor:this.zoomOption.handleColor}},this._endFrameShape=o.clone(this._startFrameShape),this._startFrameShape=new n(this._startFrameShape),this._endFrameShape=new n(this._endFrameShape),this.shapeList.push(this._startFrameShape),this.shapeList.push(this._endFrameShape);return},_syncHandleShape:function(){this.zoomOption.orient=="horizontal"?(this._startShape.style.x=this._fillerShae.style.x-this._handleSize,this._endShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._zoom.start=Math.floor((this._startShape.style.x-this._location.x)/this._location.width*100),this._zoom.end=Math.ceil((this._endShape.style.x+this._handleSize-this._location.x)/this._location.width*100)):(this._startShape.style.y=this._fillerShae.style.y-this._handleSize,this._endShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._zoom.start=Math.floor((this._startShape.style.y-this._location.y)/this._location.height*100),this._zoom.end=Math.ceil((this._endShape.style.y+this._handleSize-this._location.y)/this._location.height*100)),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this._syncFrameShape(),this.zr.refresh()},_syncFillerShape:function(){var e,t;this.zoomOption.orient=="horizontal"?(e=this._startShape.style.x,t=this._endShape.style.x,this._fillerShae.style.x=Math.min(e,t)+this._handleSize,this._fillerShae.style.width=Math.abs(e-t)-this._handleSize,this._zoom.start=Math.floor((Math.min(e,t)-this._location.x)/this._location.width*100),this._zoom.end=Math.ceil((Math.max(e,t)+this._handleSize-this._location.x)/this._location.width*100)):(e=this._startShape.style.y,t=this._endShape.style.y,this._fillerShae.style.y=Math.min(e,t)+this._handleSize,this._fillerShae.style.height=Math.abs(e-t)-this._handleSize,this._zoom.start=Math.floor((Math.min(e,t)-this._location.y)/this._location.height*100),this._zoom.end=Math.ceil((Math.max(e,t)+this._handleSize-this._location.y)/this._location.height*100)),this.zr.modShape(this._fillerShae.id),this._syncFrameShape(),this.zr.refresh()},_syncFrameShape:function(){this.zoomOption.orient=="horizontal"?(this._startFrameShape.style.width=this._fillerShae.style.x-this._location.x,this._endFrameShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._endFrameShape.style.width=this._location.x+this._location.width-this._endFrameShape.style.x):(this._startFrameShape.style.height=this._fillerShae.style.y-this._location.y,this._endFrameShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._endFrameShape.style.height=this._location.y+this._location.height-this._endFrameShape.style.y),this.zr.modShape(this._startFrameShape.id),this.zr.modShape(this._endFrameShape.id)},_syncShape:function(){if(!this.zoomOption.show)return;this.zoomOption.orient=="horizontal"?(this._startShape.style.x=this._location.x+this._zoom.start/100*this._location.width,this._endShape.style.x=this._location.x+this._zoom.end/100*this._location.width-this._handleSize,this._fillerShae.style.x=this._startShape.style.x+this._handleSize,this._fillerShae.style.width=this._endShape.style.x-this._startShape.style.x-this._handleSize):(this._startShape.style.y=this._location.y+this._zoom.start/100*this._location.height,this._endShape.style.y=this._location.y+this._zoom.end/100*this._location.height-this._handleSize,this._fillerShae.style.y=this._startShape.style.y+this._handleSize,this._fillerShae.style.height=this._endShape.style.y-this._startShape.style.y-this._handleSize),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this.zr.modShape(this._fillerShae.id),this._syncFrameShape(),this.zr.refresh()},_syncData:function(e){var t,n,r,i,o;for(var u in this._originalData){t=this._originalData[u];for(var a in t){o=t[a];if(typeof o=="undefined")continue;i=o.length,n=Math.floor(this._zoom.start/100*i),r=Math.ceil(this._zoom.end/100*i),this.option[u][a].type!=s.CHART_TYPE_SCATTER?this.option[u][a].data=o.slice(n,r):this.option[u][a].data=this._synScatterData(a,o)}}!this._isSilence&&(this.zoomOption.realtime||e)&&this.messageCenter.dispatch(s.EVENT.DATA_ZOOM,null,{zoom:this._zoom},this.myChart)},_synScatterData:function(e,t){if(this._zoom.start===0&&this._zoom.end==100&&this._zoom.start2===0&&this._zoom.end2==100)return t;var n=[],r=this._zoom.scatterMap[e],i,s,o,u,a;this.zoomOption.orient=="horizontal"?(i=r.x.max-r.x.min,s=this._zoom.start/100*i+r.x.min,o=this._zoom.end/100*i+r.x.min,i=r.y.max-r.y.min,u=this._zoom.start2/100*i+r.y.min,a=this._zoom.end2/100*i+r.y.min):(i=r.x.max-r.x.min,s=this._zoom.start2/100*i+r.x.min,o=this._zoom.end2/100*i+r.x.min,i=r.y.max-r.y.min,u=this._zoom.start/100*i+r.y.min,a=this._zoom.end/100*i+r.y.min);var f;for(var l=0,c=t.length;l=s&&f[0]<=o&&f[1]>=u&&f[1]<=a&&n.push(t[l]);return n},__ondrift:function(e,t,n){this.zoomOption.zoomLock&&(e=this._fillerShae);var r=e._type=="filler"?this._handleSize:0;return this.zoomOption.orient=="horizontal"?e.style.x+t-r<=this._location.x?e.style.x=this._location.x+r:e.style.x+t+e.style.width+r>=this._location.x+this._location.width?e.style.x=this._location.x+this._location.width-e.style.width-r:e.style.x+=t:e.style.y+n-r<=this._location.y?e.style.y=this._location.y+r:e.style.y+n+e.style.height+r>=this._location.y+this._location.height?e.style.y=this._location.y+this._location.height-e.style.height-r:e.style.y+=n,e._type=="filler"?this._syncHandleShape():this._syncFillerShape(),this.zoomOption.realtime&&this._syncData(),!0},__ondragend:function(){this.isDragend=!0},ondragend:function(e,t){if(!this.isDragend||!e.target)return;!this.zoomOption.realtime&&this._syncData(),t.dragOut=!0,t.dragIn=!0,!this._isSilence&&!this.zoomOption.realtime&&this.messageCenter.dispatch(s.EVENT.DATA_ZOOM,null,{zoom:this._zoom},this.myChart),t.needRefresh=!1,this.isDragend=!1;return},ondataZoom:function(e,t){t.needRefresh=!0;return},absoluteZoom:function(e){this._zoom.start=e.start,this._zoom.end=e.end,this._zoom.start2=e.start2,this._zoom.end2=e.end2,this._syncShape(),this._syncData(!0);return},rectZoom:function(e){if(!e)return this._zoom.start=this._zoom.start2=0,this._zoom.end=this._zoom.end2=100,this._syncShape(),this._syncData(!0),this._zoom;var t=this.component.grid.getArea(),n={x:e.x,y:e.y,width:e.width,height:e.height};n.width<0&&(n.x+=n.width,n.width=-n.width),n.height<0&&(n.y+=n.height,n.height=-n.height);if(n.x>t.x+t.width||n.y>t.y+t.height)return!1;n.xt.x+t.width&&(n.width=t.x+t.width-n.x),n.y+n.height>t.y+t.height&&(n.height=t.y+t.height-n.y);var r,i=(n.x-t.x)/t.width,s=1-(n.x+n.width-t.x)/t.width,o=1-(n.y+n.height-t.y)/t.height,u=(n.y-t.y)/t.height;return this.zoomOption.orient=="horizontal"?(r=this._zoom.end-this._zoom.start,this._zoom.start+=r*i,this._zoom.end-=r*s,r=this._zoom.end2-this._zoom.start2,this._zoom.start2+=r*o,this._zoom.end2-=r*u):(r=this._zoom.end-this._zoom.start,this._zoom.start+=r*o,this._zoom.end-=r*u,r=this._zoom.end2-this._zoom.start2,this._zoom.start2+=r*i,this._zoom.end2-=r*s),this._syncShape(),this._syncData(!0),this._zoom},syncBackupData:function(e){var t,n=this._originalData.series,r=e.series,i;for(var s=0,o=r.length;s=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height?!0:!1}},r.inherits(i,t),i}),r("echarts/component/dataRange",["require","./base","zrender/shape/Text","zrender/shape/Rectangle","../util/shape/HandlePolygon","../config","zrender/tool/util","zrender/tool/area","zrender/tool/color","zrender/tool/color","../component"],function(e){function f(e,n,r,i,s){if(typeof this.query(i,"dataRange.min")=="undefined"||typeof this.query(i,"dataRange.max")=="undefined"){console.error("option.dataRange.min or option.dataRange.max has not been defined.");return}t.call(this,e,n,r,i,s);var o=this;o._ondrift=function(e,t){return o.__ondrift(this,e,t)},o._ondragend=function(){return o.__ondragend()},o._dataRangeSelected=function(e){return o.__dataRangeSelected(e)},this._selectedMap={},this._range={},this.refresh(i)}var t=e("./base"),n=e("zrender/shape/Text"),r=e("zrender/shape/Rectangle"),i=e("../util/shape/HandlePolygon"),s=e("../config"),o=e("zrender/tool/util"),u=e("zrender/tool/area"),a=e("zrender/tool/color");return f.prototype={type:s.COMPONENT_TYPE_DATARANGE,_textGap:10,_buildShape:function(){this._itemGroupLocation=this._getItemGroupLocation(),this._buildBackground(),this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable?this._buildGradient():this._buildItem();for(var e=0,t=this.shapeList.length;ep&&(h-=m)):(dv&&(d-=f))}return{x:h,y:d,width:s,height:o}},_getTextShape:function(e,t,n){return{zlevel:this._zlevelBase,style:{x:this.dataRangeOption.orient=="horizontal"?e:this._itemGroupLocation.x+this._itemGroupLocation.width/2,y:this.dataRangeOption.orient=="horizontal"?this._itemGroupLocation.y+this._itemGroupLocation.height/2:t,color:this.dataRangeOption.textStyle.color,text:n,textFont:this.getFont(this.dataRangeOption.textStyle),textBaseline:this.dataRangeOption.orient=="horizontal"?"middle":"top",textAlign:this.dataRangeOption.orient=="horizontal"?"left":"center"},hoverable:!1}},_getItemShape:function(e,t,n,r,i){return{zlevel:this._zlevelBase,style:{x:e,y:t+1,width:n,height:r-2,color:i},highlightStyle:{strokeColor:i,lineWidth:1},clickable:!0}},__ondrift:function(e,t,n){var r=this._calculableLocation.x,i=this._calculableLocation.y,s=this._calculableLocation.width,o=this._calculableLocation.height;return this.dataRangeOption.orient=="horizontal"?e.style.x+t<=r?e.style.x=r:e.style.x+t+e.style.width>=r+s?e.style.x=r+s-e.style.width:e.style.x+=t:e.style.y+n<=i?e.style.y=i:e.style.y+n+e.style.height>=i+o?e.style.y=i+o-e.style.height:e.style.y+=n,e._type=="filler"?this._syncHandleShape():this._syncFillerShape(e),this.dataRangeOption.realtime&&this._syncData(),!0},__ondragend:function(){this.isDragend=!0},ondragend:function(e,t){if(!this.isDragend||!e.target)return;!this.dataRangeOption.realtime&&this._syncData(),t.dragOut=!0,t.dragIn=!0,!this.dataRangeOption.realtime&&!1&&this.messageCenter.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:this._range.end,end:this._range.start}},this.myChart),t.needRefresh=!1,this.isDragend=!1;return},_syncShapeFromRange:function(){var e=this.dataRangeOption.range||{};this._range.end=typeof this._range.end!="undefined"?this._range.end:typeof e.start!="undefined"?e.start:0,this._range.start=typeof this._range.start!="undefined"?this._range.start:typeof e.end!="undefined"?e.end:100;if(this._range.start!=100||this._range.end!==0){if(this.dataRangeOption.orient=="horizontal"){var t=this._fillerShae.style.width;this._fillerShae.style.x+=t*(100-this._range.start)/100,this._fillerShae.style.width=t*(this._range.start-this._range.end)/100}else{var n=this._fillerShae.style.height;this._fillerShae.style.y+=n*(100-this._range.start)/100,this._fillerShae.style.height=n*(this._range.start-this._range.end)/100}this.zr.modShape(this._fillerShae.id),this._syncHandleShape()}},_syncHandleShape:function(){var e=this._calculableLocation.x,t=this._calculableLocation.y,n=this._calculableLocation.width,r=this._calculableLocation.height;this.dataRangeOption.orient=="horizontal"?(this._startShape.style.x=this._fillerShae.style.x,this._startMask.style.width=this._startShape.style.x-e,this._endShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._endMask.style.x=this._endShape.style.x,this._endMask.style.width=e+n-this._endShape.style.x,this._range.start=Math.ceil(100-(this._startShape.style.x-e)/n*100),this._range.end=Math.floor(100-(this._endShape.style.x-e)/n*100)):(this._startShape.style.y=this._fillerShae.style.y,this._startMask.style.height=this._startShape.style.y-t,this._endShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._endMask.style.y=this._endShape.style.y,this._endMask.style.height=t+r-this._endShape.style.y,this._range.start=Math.ceil(100-(this._startShape.style.y-t)/r*100),this._range.end=Math.floor(100-(this._endShape.style.y-t)/r*100)),this._syncShape()},_syncFillerShape:function(e){var t=this._calculableLocation.x,n=this._calculableLocation.y,r=this._calculableLocation.width,i=this._calculableLocation.height,s,o;this.dataRangeOption.orient=="horizontal"?(s=this._startShape.style.x,o=this._endShape.style.x,e.id==this._startShape.id&&s>=o?(o=s,this._endShape.style.x=s):e.id==this._endShape.id&&s>=o&&(s=o,this._startShape.style.x=s),this._fillerShae.style.x=s,this._fillerShae.style.width=o-s,this._startMask.style.width=s-t,this._endMask.style.x=o,this._endMask.style.width=t+r-o,this._range.start=Math.ceil(100-(s-t)/r*100),this._range.end=Math.floor(100-(o-t)/r*100)):(s=this._startShape.style.y,o=this._endShape.style.y,e.id==this._startShape.id&&s>=o?(o=s,this._endShape.style.y=s):e.id==this._endShape.id&&s>=o&&(s=o,this._startShape.style.y=s),this._fillerShae.style.y=s,this._fillerShae.style.height=o-s,this._startMask.style.height=s-n,this._endMask.style.y=o,this._endMask.style.height=n+i-o,this._range.start=Math.ceil(100-(s-n)/i*100),this._range.end=Math.floor(100-(o-n)/i*100)),this._syncShape()},_syncShape:function(){this._startShape.position=[this._startShape.style.x-this._startShape.style._x,this._startShape.style.y-this._startShape.style._y],this._startShape.style.text=this._textFormat(this._gap*this._range.start+this.dataRangeOption.min),this._startShape.style.color=this._startShape.highlightStyle.strokeColor=this.getColor(this._gap*this._range.start+this.dataRangeOption.min),this._endShape.position=[this._endShape.style.x-this._endShape.style._x,this._endShape.style.y-this._endShape.style._y],this._endShape.style.text=this._textFormat(this._gap*this._range.end+this.dataRangeOption.min),this._endShape.style.color=this._endShape.highlightStyle.strokeColor=this.getColor(this._gap*this._range.end+this.dataRangeOption.min),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this.zr.modShape(this._startMask.id),this.zr.modShape(this._endMask.id),this.zr.modShape(this._fillerShae.id),this.zr.refresh()},_syncData:function(){this.dataRangeOption.realtime&&this.messageCenter.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:this._range.end,end:this._range.start}},this.myChart)},__dataRangeSelected:function(e){var t=e.target._idx;this._selectedMap[t]=!this._selectedMap[t],this.messageCenter.dispatch(s.EVENT.REFRESH,null,null,this.myChart)},_textFormat:function(e,t){e=e.toFixed(this.dataRangeOption.precision),t=typeof t!="undefined"?t.toFixed(this.dataRangeOption.precision):"";if(this.dataRangeOption.formatter){if(typeof this.dataRangeOption.formatter=="string")return this.dataRangeOption.formatter.replace("{value}",e).replace("{value2}",t);if(typeof this.dataRangeOption.formatter=="function")return this.dataRangeOption.formatter.call(this.myChart,e,t)}return t!==""?e+" - "+t:e},refresh:function(e){if(e){this.option=e,this.option.dataRange=this.reformOption(this.option.dataRange),this.option.dataRange.padding=this.reformCssArray(this.option.dataRange.padding),this.dataRangeOption=this.option.dataRange;var t=this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable?100:this.dataRangeOption.splitNumber;this._colorList=a.getGradientColors(this.dataRangeOption.color,Math.max((t-this.dataRangeOption.color.length)/(this.dataRangeOption.color.length-1),0)+1);if(this._colorList.length>t){var n=this._colorList.length,r=[this._colorList[0]],i=n/(t-1);for(var s=1;sthis.dataRangeOption.max&&(e=this.dataRangeOption.max);if(this.dataRangeOption.calculable)if(e-(this._gap*this._range.start+this.dataRangeOption.min)>5e-5||e-(this._gap*this._range.end+this.dataRangeOption.min)<-0.00005)return null;var t=this._colorList.length-Math.ceil((e-this.dataRangeOption.min)/(this.dataRangeOption.max-this.dataRangeOption.min)*this._colorList.length);return t==this._colorList.length&&t--,this._selectedMap[t]?this._colorList[t]:null}},o.inherits(f,t),e("../component").define("dataRange",f),f}),r("echarts/chart/scatter",["require","../component/base","./base","../util/shape/Symbol","../component/axis","../component/grid","../component/dataZoom","../component/dataRange","../config","zrender/tool/util","zrender/tool/color","../chart"],function(e){function u(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this),this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("../util/shape/Symbol");e("../component/axis"),e("../component/grid"),e("../component/dataZoom"),e("../component/dataRange");var i=e("../config"),s=e("zrender/tool/util"),o=e("zrender/tool/color");return u.prototype={type:i.CHART_TYPE_SCATTER,_buildShape:function(){var e=this.series;this._sIndex2ColorMap={},this._symbol=this.option.symbolList,this._sIndex2ShapeMap={},this.selectedMap={},this.xMarkMap={};var t=this.component.legend,n=[],r,s,u,a;for(var f=0,l=e.length;fs[0]&&(i.min0=s[0],i.minY0=r[o][1],i.minX0=r[o][0]),i.max0s[1]&&(i.min1=s[1],i.minY1=r[o][1],i.minX1=r[o][0]),i.max1n.largeThreshold){this.shapeList.push(this._getLargeSymbol(r,this.getItemStyleColor(this.query(n,"itemStyle.normal.color"),o,-1)||this._sIndex2ColorMap[o]));continue}for(var u=0,a=r.length;u0&&this._buildSinglePosition(o,t[o]);this.addShapeList()},_buildSinglePosition:function(e,t){var n=this._mapData(t),r=n.locationMap,i=n.maxDataLength;if(i===0||r.length===0)return;this._buildHorizontal(t,i,r);for(var s=0,o=t.length;s0?a="left":Math.round(i[0])<0?a="right":a="center",f.margin?(p=f.margin,c=i[0]>0?p:-p,h=i[1]>0?p:-p,c=i[0]===0?0:c,h=i[1]===0?0:h,i=this._mapVector(i,o,1)):i=this._mapVector(i,o,1.2),u.textAlign=a,u.x=i[0]+c,u.y=i[1]+h,f.rotate?l=[f.rotate/180*Math.PI,i[0],i[1]]:l=[0,0,0],this.shapeList.push(new n({zlevel:this._zlevelBase,style:u,draggable:!1,hoverable:!1,rotation:l}))}},getIndicatorText:function(e,t){return this.polar[e]&&this.polar[e].__ecIndicator[t]&&this.polar[e].__ecIndicator[t].text},getDropBox:function(e){var e=e||0,t=this.polar[e],n=this.getCenter(e),r=t.__ecIndicator,i=r.length,s=[],o,u,a=t.type;if(a=="polygon"){for(var f=0;fu||u===undefined)&&(u=e),(e=1)a=Math.floor(a/l)*l-l;else{if(l===0)return u>0?(d=0,p=2*u):u===0?(d=0,p=100):(p=0,d=2*a),{max:p,min:d};c=(l+"").split(".")[1],h=c.length,a=Math.floor(a*Math.pow(10,h))/Math.pow(10,h)-l}Math.abs(a)<=l&&(a=0),u=a+Math.floor(l*Math.pow(10,h)*(n+1))/Math.pow(10,h)}else a=a>0?0:a;return r&&(u=u>0?u*1.2:u*.8,a=a>0?a*.8:a*1.2),{max:u,min:a}},_getDelta:function(e,t,n,r,i){var s=(e-t)/n,o,u;if(s>1)return i?(s=Math.ceil(s),s%i>0?(Math.ceil(s/i)+1)*i:s):(o=(s+"").split(".")[0],u=o.length,o.charAt(0)>=5?Math.pow(10,u):(o.charAt(0)-0+1)*Math.pow(10,u-1));if(s==1)return 1;if(s===0)return 0;if(!r){o=(s+"").split(".")[1],u=0;while(o[u]=="0")u++;return o[u]>=5?"0."+o.substring(0,u+1)-0+1/Math.pow(10,u):"0."+o.substring(0,u+1)-0+1/Math.pow(10,u+1)}return Math.ceil(s*Math.pow(10,r))/Math.pow(10,r)},getVector:function(e,t,n){e=e||0,t=t||0;var r=this.polar[e].__ecIndicator;if(t>=r.length)return;var i=this.polar[e].__ecIndicator[t],s=this.getCenter(e),o=i.vector,u=i.value.max,a=i.value.min,f;if(typeof n=="undefined")return s;switch(n){case"min":n=a;break;case"max":n=u;break;case"center":n=(u+a)/2}return u!=a?f=(n-a)/(u-a):f=.5,this._mapVector(o,s,f)},isInside:function(e){var t=this.getNearestIndex(e);return t?t.polarIndex:-1},getNearestIndex:function(e){var t,n,r,i,s,o,u,a,l;for(var c=0;ci[0])return{polarIndex:c,valueIndex:Math.floor((l+a/2)/a)%u}}},getIndicator:function(e){var e=e||0;return this.polar[e].indicator},refresh:function(e){e&&(this.option=e,this.polar=this.option.polar,this.series=this.option.series),this.clear(),this._buildShape()}},a.inherits(l,t),e("../component").define("polar",l),l}),r("echarts/chart/radar",["require","../component/base","./base","zrender/shape/Polygon","../component/polar","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../util/accMath","../chart"],function(e){function a(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this),this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("zrender/shape/Polygon");e("../component/polar");var i=e("../config"),s=e("../util/ecData"),o=e("zrender/tool/util"),u=e("zrender/tool/color");return a.prototype={type:i.CHART_TYPE_RADAR,_buildShape:function(){this.selectedMap={},this._symbol=this.option.symbolList,this._queryTarget,this._dropBoxList=[],this._radarDataCounter=0;var e=this.series,t=this.component.legend,n;for(var r=0,s=e.length;r\\/]*>)","gim"),r=new RegExp("\\s+","gim"),i=new RegExp("function.*?\\((.*?)\\)","i"),s=e.toString().replace(n,"").replace(r,"").match(i)[1].split(",");return t!==Object(t)&&(t={}),function(){var n=Array.prototype.slice.call(arguments),r=n[n.length-1];r&&r.constructor===Object?n.pop():r={};for(var i=0;i=0){var n=e.split(/\s*:\s*/),r=parseInt(n[2]||1,10),i,s;if(r===0)throw new Error("Slice step cannot be zero");return r>0?(i=parseInt(n[0]||0,10),s=parseInt(n[1]||t,10)):(i=parseInt(n[0]||t-1,10),s=parseInt(n[1]||-1,10)),i<0&&(i=t+i),s<0&&n[1]&&(s=t+s),r>0?(i=Math.max(Math.min(t,i),0),s=Math.max(Math.min(t,s),0)):(i=Math.max(Math.min(t-1,i),-1),s=Math.max(Math.min(t-1,s),-1)),[i,s,r]}var i=parseInt(e,10);i<0&&(i=t+i);if(i<0||i>t)throw new Error(N(e));return i=Math.max(Math.min(t-1,i),0),[i,i+1,1]}function g(e){var t=e[0];for(var n=1;n=this._shape.length)throw new Error(T(e[r]));if(e.length<=1)return this;var i=n.slice();for(var r=0;r=Math.ceil(e.length/2);s--)i[e[r]]=e[s],i[e[s]]=e[r];return this._transposelike(i,t)}),swapaxes:t(function(e,t,n){return this.transpose([e,t],n)}),rollaxis:t(function(e,t,n){if(e>=this._shape.length)throw new Error(T(e));var r=[];for(var i=0;i=this._shape.length||e<0)throw new Error(T(e));var s=this._shape.slice();s.splice(e,1);if(t&&!S(s,t._shape))throw new Error(x(s,t._shape));t||(t=new v(this._dtype),t.initFromShape(s));var o=t._array,u=w(this._shape,e),a=this._shape[e],f=u*a;return n.call(this,o,i,f,a,u),t}return r.call(this,i)},_withPreprocess2:function(e,t,n,r){var i=this._array;if(!this._size)return;if(t&&!S(this._shape,t._shape))throw new Error(x(this._shape,t._shape));t||(t=new v(this._dtype),t.initFromShape(this._shape));var s=t._array;if(typeof e!="undefined"){e<0&&(e=this._shape.length+e);if(e>=this._shape.length||e<0)throw new Error(T(e));if(e>=this._shape.length)throw new Error(T(e));var o=w(this._shape,e),u=this._shape[e],a=o*u;n.call(this,s,i,a,u,o)}else t.reshape([this._size]),r.call(this,s,i);return t},max:t(function(){function e(e,t,n,r,i){var s=0;for(var o=0;of&&(f=c),a+=i}e[s++]=f}}function t(e){var t=e[0];for(var n=1;nt&&(t=e[n]);return t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}()),min:t(function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h,a=c),f+=i}e[s++]=a}}function t(e){var t=e[0],n=0;for(var r=1;rt&&(n=r,t=e[r]);return n}return function(n,r){return this._withPreprocess1(n,r,e,t)}}()),argmin:t(function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h),a+=i}e[s++]=l-f}}function t(e){var t=e[0],n=e[0];for(var r=1;rn&&(n=e[r]);return n-t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}()),sort:t(function(e,t){e<0&&(e=this._shape.length+e);var n;t==="ascending"?n=function(e,t){return e-t}:t==="descending"&&(n=function(e,t){return t-e});var r=this._array,i=w(this._shape,e),s=this._shape[e],o=i*s,u=new Array(s);for(var a=0;as&&(s=a)}var f=s-i,l=t-e;for(var u=0;u=0&&y>=0){if(e._shape[g]==1)i.unshift(t._shape[y]),b=e.repeat(t._shape[y],g);else if(t._shape[y]==1)i.unshift(e._shape[g]),E=t.repeat(e._shape[g],y);else{if(t._shape[y]!=e._shape[g])throw new Error(x(e._shape,t._shape));i.unshift(e._shape[g])}g--,y--}for(var T=g;T>=0;T--)i.unshift(e._shape[T]);for(var T=y;T>=0;T--)i.unshift(t._shape[T]);e=b,t=E}if(!r)r=new v(this._dtype),r.initFromShape(i);else if(!S(i,r._shape))throw new Error(x(i,r._shape));var N=r._array,C,k,L,A;d?(C=t._shape.length-1,k=!1,L=e,A=t._array):m?(C=e._shape.length-1,k=!0,A=t,L=e._array):(C=Math.abs(e._shape.length-t._shape.length),k=e._shape.length>=t._shape.length,L=e._array,A=t._array);var O=w(i,C),M=i[C],_=O*M,D=r._size/_,P,H,B,j=0;if(k)if(m)for(var F=0;F0)for(var c=r[0];cr[1];c+=r[2])l(e+1,t+s*c);else if(r[2]>0)for(var c=r[0];cr[1];c+=r[2])for(var h=0;hthis._shape.length)throw new Error("Too many indices");var o=i.length,u;s.length?(t=new v(this._dtype),t.initFromShape(s),u=t._array):u=[];var a=this._array,f=0;return l(0,0),s.length?t:u[0]},set:function(e,t){typeof e=="number"&&(e=e.toString());var n=E(this._shape),r=this._parseRanges(e),i=r[0],s=r[1];if(i.length>this._shape.length)throw new Error("Too many indices");var o=typeof t=="number",u=i.length,a=this._array;if(o)var f=t;else{if(!S(s,t.shape()))throw new Error(x(s,t.shape()));var f=t._array}var l=0,c=function(e,t){var r=i[e],s=n[e];if(e0)for(var h=r[0];hr[1];h+=r[2])c(e+1,t+s*h);else if(r[2]>0)for(var h=r[0];hr[1];h+=r[2])for(var p=0;pu)throw new Error(N(e[a]));if(e[a]=0&&h>=0){if(l[c]===1)p=t.repeat(f[h],c);else if(l[c]!==f[h])throw new Error(x(l,f));c--,h--}t=p;var d=w(this._shape,n),u=this._shape[n],m=u*d,y=this._size/m,b=e.length,E=new Uint32Array(y*b),S=0;for(var T=0;T=0){for(var a=_-1;a>=D;a--)i[P--]=A[a];_=D,D=E[--M];for(var a=0;a=0;a--)i[P--]=A[a];return this._array=i,this._shape=k,this._size=L,this}),append:function(){console.warn("TODO")},"delete":t(function(e,t){var n=this._array;typeof e=="number"&&(e=[e]);var r=this._size;typeof t=="undefined"&&(this._shape=[r],t=0);var i=w(this._shape,t),s=this._shape[t],o=i*s,u=0;for(var a=0;as)throw new Error(N(l));if(l=0){var a=Math.floor((u[1]-u[0])/u[2]);a=a<0?0:a,r.push(a)}i++}for(;i0&&(E.style.brushType="both"),E.highlightStyle.lineWidth>0&&(E.highlightStyle.brushType="both"),a.pack(E,this.chordSeries[0],0,t[m],m,g.name);if(u){var S=[b+w]/2;S%=360;var x=S<=90||S>=270;S=S*Math.PI/180;var T=[Math.cos(S),-Math.sin(S)],N=this.showScaleText?35+h:h,C=l.scale([],T,this.outerRadius+N);l.add(C,C,this.center);var k={zlevel:this._zlevelBase-1,hoverable:!1,style:{text:g.name,textAlign:x?"left":"right",color:f}};c?(k.rotation=x?S:Math.PI+S,x?k.style.x=this.outerRadius+N:k.style.x=-this.outerRadius-N,k.style.y=0,k.position=this.center):(k.style.x=C[0],k.style.y=C[1]),k.style.textColor=this.deepQuery([g,this.chordSerieSample],"itemStyle.normal.label.textStyle.color")||"#fff",k.style.textFont=this.getFont(this.deepQuery([g,this.chordSerieSample],"itemStyle.normal.label.textStyle")),k=new r(k),this.shapeList.push(k)}E.onmouseover=d(m),E.onmouseout=v(),E=new s(E),this.shapeList.push(E),this.sectorShapes.push(E)}},_buildChords:function(e,t){var n=e.length;if(!n)return;var r=e[0][0].length,i=this.chordSerieSample.itemStyle.normal.chordStyle.lineStyle,s=this.chordSerieSample.itemStyle.emphasis.chordStyle.lineStyle;for(var u=0;u=270,E={zlevel:this._zlevelBase-1,hoverable:!1,style:{x:w?this.outerRadius+this.scaleLineLength+4:-this.outerRadius-this.scaleLineLength-4,y:0,text:Math.round(b.shift()*10)/10+t,textAlign:w?"left":"right"},position:this.center.slice(),rotation:w?[h/180*Math.PI,0,0]:[(h+180)/180*Math.PI,0,0]};E=new r(E),this.shapeList.push(E),g+=this.scaleUnitAngle*5}}},normalizeValue:function(e){var t=[],n=(new c(e)).max(),r,i;n>1e4?(r="k",i=.001):n>1e7?(r="m",i=1e-6):n>1e10?(r="b",i=1e-9):(r="",i=1);for(var s=0;s0&&(i=1/Math.sqrt(i),e[0]=t[0]*i,e[1]=t[1]*i),e},negate:function(e,t){return e[0]=-t[0],e[1]=-t[1],e},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e},set:function(e,t,n){return e[0]=t,e[1]=n,e}}:t=e("zrender/tool/vector");var r=typeof Float32Array=="undefined"?Array:Float32Array;i.prototype.beforeUpdate=function(){for(var e=0;e=e&&this.bbox[1]<=t&&this.bbox[3]>=t},i.prototype.setBBox=function(e,t,n,r){this.bbox[0]=e,this.bbox[1]=t,this.bbox[2]=n,this.bbox[3]=r,this.size=(n-e+r-t)/2},i.prototype._newSubRegion=function(){var e=this.subRegions[this.nSubRegions];return e||(e=new i,this.subRegions[this.nSubRegions]=e),this.nSubRegions++,e},i.prototype._addNodeToSubRegion=function(e){var t=this.findSubRegion(e.position[0],e.position[1]),n=this.bbox;if(!t){var r=(n[0]+n[2])/2,i=(n[1]+n[3])/2,s=(n[2]-n[0])/2,o=(n[3]-n[1])/2,u=e.position[0]>=r?1:0,a=e.position[1]>=i?1:0,t=this._newSubRegion();t.setBBox(u*s+n[0],a*o+n[1],(u+1)*s+n[0],(a+1)*o+n[1])}t.addNode(e)},i.prototype._updateCenterOfMass=function(e){this.centerOfMass==null&&(this.centerOfMass=t.create());var n=this.centerOfMass[0]*this.mass,r=this.centerOfMass[1]*this.mass;n+=e.position[0]*e.mass,r+=e.position[1]*e.mass,this.mass+=e.mass,this.centerOfMass[0]=n/this.mass,this.centerOfMass[1]=r/this.mass},a.prototype.initNodes=function(e,t,n){this.temperature=1;var r=e.length/2;this.nodes.length=0;var i=typeof n!="undefined";for(var o=0;o0&&this.applyNodeGravity(o)}for(var n=0;n0){t.scale(f,f,1/p);var d=t.len(s.speedPrev);d>0&&(p=Math.min(p/d,this.maxSpeedIncrease)*d,t.scaleAndAdd(l,s.speedPrev,f,p))}var v=t.len(l),h=Math.min(v,100)/(v+.1);t.scale(l,l,h),t.add(s.position,s.position,l)}},a.prototype.applyRegionToNodeRepulsion=function(){var e=t.create();return function(r,i){if(r.node)this.applyNodeToNodeRepulsion(r.node,i,!0);else{t.sub(e,i.position,r.centerOfMass);var s=e[0]*e[0]+e[1]*e[1];if(s>this.barnesHutTheta*r.size*r.size){var o=this._k*this._k*(i.mass+r.mass)/(s+1);t.scaleAndAdd(i.force,i.force,e,o*2)}else for(var u=0;u0?u=a*f/(l*l):l<=0&&(u=a*10*f)}else u=a*f/o;s||t.scaleAndAdd(r.force,r.force,e,u*2),t.scaleAndAdd(i.force,i.force,e,-u*2)}}(),a.prototype.applyEdgeAttraction=function(){var e=t.create();return function(r){var i=r.source,s=r.target;t.sub(e,i.position,s.position);var o=t.len(e),u;this.edgeWeightInfluence===0?u=1:this.edgeWeightInfluence==1?u=r.weight:u=Math.pow(r.weight,this.edgeWeightInfluence);var a;if(this.preventOverlap){o=o-i.size-s.size;if(o<=0)return}var a=-u*o/this._k;t.scaleAndAdd(i.force,i.force,e,a),t.scaleAndAdd(s.force,s.force,e,-a)}}(),a.prototype.applyNodeGravity=function(){var e=t.create();return function(n){t.sub(e,this.center,n.position),this.width>this.height?e[1]*=this.width/this.height:e[0]*=this.height/this.width;var r=t.len(e)/100;this.strongGravity?t.scaleAndAdd(n.force,n.force,e,r*this.gravity*n.mass):t.scaleAndAdd(n.force,n.force,e,this.gravity*n.mass/(r+1))}}(),a.prototype.updateBBox=function(){var e=Infinity,t=Infinity,n=-Infinity,r=-Infinity;for(var i=0;i.01){for(var r=0;r=0});var s,o;this._filteredLinks=x(this._rawLinks,function(e,r){s=e.source,o=e.target;var i=!0,u=typeof s=="string"?n[s]:t[s];typeof u=="undefined"&&(u=-1),u>=0?e.source=u:i=!1;var u=typeof o=="string"?n[o]:t[o];return typeof u=="undefined"&&(u=-1),u>=0?e.target=u:i=!1,e.rawIndex=r,i})},_initLayout:function(e){var t=this._filteredNodes,n=this._filteredLinks,r=this._nodeShapes,i=t.length,s=this.query(e,"minRadius"),o=this.query(e,"maxRadius");this._steps=e.steps||1,this._coolDown=e.coolDown||.99;var u=this.parseCenter(this.zr,e.center),f=this.parsePercent(e.size,this.zr.getWidth()),p=this.parsePercent(e.size,this.zr.getHeight()),d=Math.min(f,p),v=[];for(var m=0;m0&&this._buildSinglePosition(f,t[f]);this.addShapeList()},_buildSinglePosition:function(e,t){var n=this._mapData(t),r=n.locationMap,i=n.maxDataLength;if(i===0||r.length===0)return;switch(e){case"bottom":case"top":this._buildHorizontal(t,i,r,this.xMarkMap);break;case"left":case"right":this._buildVertical(t,i,r,this.xMarkMap)}for(var s=0,o=t.length;s0&&(this.finalPLMap[s]=this.finalPLMap[s]||[],this.finalPLMap[s].push(g[s]),g[s]=[]);continue}b>=0?(p-=T>0?l.getCoordSize(b):d-l.getCoord(b),h=p):b<0&&(v+=T>0?l.getCoordSize(b):l.getCoord(b)-m,h=v),g[s].push([c,h,w,a.getNameByIndex(w),c,d]),r[s].min>b&&(r[s].min=b,r[s].minY=h,r[s].minX=c),r[s].max0&&(this.finalPLMap[k]=this.finalPLMap[k]||[],this.finalPLMap[k].push(g[k]),g[k]=[]);for(var S=0,x=n.length;S0&&(r[s].average=(r[s].sum/r[s].counter).toFixed(2)-0),h=this.component.yAxis.getAxis(i[s].yAxisIndex||0).getCoord(r[s].average),r[s].averageLine=[[this.component.grid.getX(),h],[this.component.grid.getXend(),h]],r[s].minLine=[[this.component.grid.getX(),r[s].minY],[this.component.grid.getXend(),r[s].minY]],r[s].maxLine=[[this.component.grid.getX(),r[s].maxY],[this.component.grid.getXend(),r[s].maxY]];this._buildBorkenLine(e,this.finalPLMap,a,"horizontal")},_buildVertical:function(e,t,n,r){var i=this.series,s=n[0][0],o=i[s],u=o.yAxisIndex,a=this.component.yAxis.getAxis(u),f,l,c,h,p,d,v,m,g={},y,b;for(var w=0,E=t;w0&&(this.finalPLMap[s]=this.finalPLMap[s]||[],this.finalPLMap[s].push(g[s]),g[s]=[]);continue}b>=0?(p+=T>0?l.getCoordSize(b):l.getCoord(b)-d,c=p):b<0&&(v-=T>0?l.getCoordSize(b):m-l.getCoord(b),c=v),g[s].push([c,h,w,a.getNameByIndex(w),d,h]),r[s].min>b&&(r[s].min=b,r[s].minX=c,r[s].minY=h),r[s].max0&&(this.finalPLMap[k]=this.finalPLMap[k]||[],this.finalPLMap[k].push(g[k]),g[k]=[]);for(var S=0,x=n.length;S0&&(r[s].average=(r[s].sum/r[s].counter).toFixed(2)-0),c=this.component.xAxis.getAxis(i[s].xAxisIndex||0).getCoord(r[s].average),r[s].averageLine=[[c,this.component.grid.getYend()],[c,this.component.grid.getY()]],r[s].minLine=[[r[s].minX,this.component.grid.getYend()],[r[s].minX,this.component.grid.getY()]],r[s].maxLine=[[r[s].maxX,this.component.grid.getYend()],[r[s].maxX,this.component.grid.getY()]];this._buildBorkenLine(e,this.finalPLMap,a,"vertical")},_buildBorkenLine:function(e,t,n,i){var o=this.series,l,c,h,p,d,v,m,g,y,b,w,E,S,x,T;for(var N=e.length-1;N>=0;N--){T=e[N],g=o[T],b=t[T];if(g.type==this.type&&typeof b!="undefined"){l=this._sIndex2ColorMap[T],c=this.query(g,"itemStyle.normal.lineStyle.width"),h=this.query(g,"itemStyle.normal.lineStyle.type"),p=this.query(g,"itemStyle.normal.lineStyle.color"),d=this.getItemStyleColor(this.query(g,"itemStyle.normal.color"),T,-1),v=typeof this.query(g,"itemStyle.normal.areaStyle")!="undefined",m=this.query(g,"itemStyle.normal.areaStyle.color");for(var C=0,k=b.length;C=0;r--){f=this.shapeList[r]._seriesIndex;if(n[f]&&!n[f][3]){if(this.shapeList[r]._main&&this.shapeList[r].style.pointList.length>1){l=this.shapeList[r].style.pointList,o=Math.abs(l[0][0]-l[1][0]),a=Math.abs(l[0][1]-l[1][1]),c=this.shapeList[r]._orient=="horizontal";if(n[f][2]){if(this.shapeList[r].type=="polygon"){var h=l.length;this.shapeList[r].style.pointList[h-3]=l[h-2],c?this.shapeList[r].style.pointList[h-3][0]=l[h-4][0]:this.shapeList[r].style.pointList[h-3][1]=l[h-4][1],this.shapeList[r].style.pointList[h-2]=l[h-1]}this.shapeList[r].style.pointList.pop(),c?(s=o,u=0):(s=0,u=-a)}else{this.shapeList[r].style.pointList.shift();if(this.shapeList[r].type=="polygon"){var p=this.shapeList[r].style.pointList.pop();c?p[0]=l[0][0]:p[1]=l[0][1],this.shapeList[r].style.pointList.push(p)}c?(s=-o,u=0):(s=0,u=a)}this.zr.modShape(this.shapeList[r].id,{style:{pointList:this.shapeList[r].style.pointList}},!0)}else{if(n[f][2]&&this.shapeList[r]._dataIndex==t[f].data.length-1){this.zr.delShape(this.shapeList[r].id);continue}if(!n[f][2]&&this.shapeList[r]._dataIndex===0){this.zr.delShape(this.shapeList[r].id);continue}}this.shapeList[r].position=[0,0],this.zr.animate(this.shapeList[r].id,"").when(500,{position:[s,u]}).start()}}}},i.prototype.iconLibrary.legendLineIcon=c,a.inherits(l,n),a.inherits(l,t),e("../chart").define("line",l),l}),r("echarts/chart/bar",["require","../component/base","./base","zrender/shape/Rectangle","../component/axis","../component/grid","../component/dataZoom","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../chart"],function(e){function a(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this),this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("zrender/shape/Rectangle");e("../component/axis"),e("../component/grid"),e("../component/dataZoom");var i=e("../config"),s=e("../util/ecData"),o=e("zrender/tool/util"),u=e("zrender/tool/color");return a.prototype={type:i.CHART_TYPE_BAR,_buildShape:function(){var e=this.series;this.selectedMap={},this.xMarkMap={},this._sIndex2colorMap={};var t={top:[],bottom:[],left:[],right:[]},n,r,s,o;for(var u=0,a=e.length;u0&&this._buildSinglePosition(f,t[f],this.xMarkMap);this.addShapeList()},_buildSinglePosition:function(e,t,n){var r=this._mapData(t),i=r.locationMap,s=r.maxDataLength;if(s===0||i.length===0)return;switch(e){case"bottom":case"top":this._buildHorizontal(s,i,t,n);break;case"left":case"right":this._buildVertical(s,i,t,n)}},_mapData:function(e){var t=this.series,n,r=0,i={},s="__kener__stack__",o,u,a=this.component.legend,f=[],l=0,c;for(var h=0,p=e.length;h0&&(c.style.x+=1,c.style.y+=1,c.style.width-=2,c.style.height-=2,c.style.strokeColor=c.highlightStyle.strokeColor=n.itemStyle.normal.borderColor,c.highlightStyle.lineWidth=3,c.style.brushType="both"),a.setItemShape(u,c))):(this.selectedMap[u]=!0,this._sIndex2colorMap[e[h]]=this.zr.getColor(e[h])),this.selectedMap[u]&&(o=n.stack||s+e[h],typeof i[o]=="undefined"?(i[o]=r,f[r]=[e[h]],r++):f[i[o]].push(e[h])),l=Math.max(l,n.data.length);return{locationMap:f,maxDataLength:l}},_buildHorizontal:function(e,t,n,i){var s=this.series,o=t[0][0],u=s[o],a=u.xAxisIndex,f=this.component.xAxis.getAxis(a),l,c,h=this._mapSize(f,t),p=h.gap,d=h.barGap,v=h.barWidthMap,m=h.barWidth,g=h.barMinHeightMap,y,b=h.interval,w,E,S,x,T,N,C,k,L;for(var A=0,O=e;A0?(y=D>0?c.getCoordSize(L):x-c.getCoord(L),P==1&&g[o]>y&&(y=g[o]),S-=y,E=S):L<0?(y=D>0?c.getCoordSize(L):c.getCoord(L)-N,P==1&&g[o]>y&&(y=g[o]),E=T,T+=y):(y=0,S-=y,E=S),i[o][A]=w+(v[o]||m)/2,i[o].min>L&&(i[o].min=L,i[o].minY=E,i[o].minX=i[o][A]),i[o].max0&&(i[o].average=(i[o].sum/i[o].counter).toFixed(2)-0),E=this.component.yAxis.getAxis(s[o].yAxisIndex||0).getCoord(i[o].average),i[o].averageLine=[[this.component.grid.getX(),E],[this.component.grid.getXend(),E]],i[o].minLine=[[this.component.grid.getX(),i[o].minY],[this.component.grid.getXend(),i[o].minY]],i[o].maxLine=[[this.component.grid.getX(),i[o].maxY],[this.component.grid.getXend(),i[o].maxY]],i[o].isHorizontal=!0,this.buildMark(o)},_buildVertical:function(e,t,n,i){var s=this.series,o=t[0][0],u=s[o],a=u.yAxisIndex,f=this.component.yAxis.getAxis(a),l,c,h=this._mapSize(f,t),p=h.gap,d=h.barGap,v=h.barWidthMap,m=h.barWidth,g=h.barMinHeightMap,y,b=h.interval,w,E,S,x,T,N,C,k,L;for(var A=0,O=e;A0?(y=D>0?c.getCoordSize(L):c.getCoord(L)-x,P==1&&g[o]>y&&(y=g[o]),w=S,S+=y):L<0?(y=D>0?c.getCoordSize(L):N-c.getCoord(L),P==1&&g[o]>y&&(y=g[o]),T-=y,w=T):(y=0,w=S,S+=y),i[o][A]=E-(v[o]||m)/2,i[o].min>L&&(i[o].min=L,i[o].minX=w+y,i[o].minY=i[o][A]),i[o].max0&&(i[o].average=(i[o].sum/i[o].counter).toFixed(2)-0),w=this.component.xAxis.getAxis(s[o].xAxisIndex||0).getCoord(i[o].average),i[o].averageLine=[[w,this.component.grid.getYend()],[w,this.component.grid.getY()]],i[o].minLine=[[i[o].minX,this.component.grid.getYend()],[i[o].minX,this.component.grid.getY()]],i[o].maxLine=[[i[o].maxX,this.component.grid.getYend()],[i[o].maxX,this.component.grid.getY()]],i[o].isHorizontal=!1,this.buildMark(o)},_mapSize:function(e,t,n){var r=this.series,i,s={},o={},u,a=0,f=0,l,c,h,p,d=1;for(var v=0,m=t.length;v1?typeof c=="string"&&c.match(/%$/)?Math.floor(e.getGap()*(100-parseFloat(c))/100):e.getGap()-c:f,x=0,l=a>1?Math.floor((S-f)/(a-1)):0;if(l<0)return this._mapSize(e,t,!0)}return{barWidthMap:s,barMinHeightMap:o,gap:S,barWidth:x,barGap:l,interval:d}},_getBarItem:function(e,t,n,r,i,o,a,f){var l=this.series,c,h=l[e],p=h.data[t],d=this._sIndex2colorMap[e],v=[p,h],m=this.deepQuery(v,"itemStyle.normal.color")||d,g=this.deepQuery(v,"itemStyle.emphasis.color"),y=this.deepMerge(v,"itemStyle.normal"),b=y.borderWidth,w=this.deepMerge(v,"itemStyle.emphasis");c={zlevel:this._zlevelBase,clickable:!0,style:{x:r,y:i,width:o,height:a,brushType:"both",color:this.getItemStyleColor(m,e,t,p),radius:y.borderRadius,lineWidth:b,strokeColor:y.borderColor},highlightStyle:{color:this.getItemStyleColor(g,e,t,p),radius:w.borderRadius,lineWidth:w.borderWidth,strokeColor:w.borderColor},_orient:f},c.highlightStyle.color=c.highlightStyle.color||(typeof c.style.color=="string"?u.lift(c.style.color,-0.3):c.style.color),b>0&&c.style.height>b&&c.style.width>b?(c.style.y+=b/2,c.style.height-=b,c.style.x+=b/2,c.style.width-=b):c.style.brushType="fill",c.highlightStyle.textColor=c.highlightStyle.color,c=this.addLabel(c,h,p,n,f);if(c.style.textPosition=="insideLeft"||c.style.textPosition=="insideRight"||c.style.textPosition=="insideTop"||c.style.textPosition=="insideBottom"){var E=5;switch(c.style.textPosition){case"insideLeft":c.style.textX=c.style.x+E,c.style.textY=c.style.y+c.style.height/2,c.style.textAlign="left",c.style.textBaseline="middle";break;case"insideRight":c.style.textX=c.style.x+c.style.width-E,c.style.textY=c.style.y+c.style.height/2,c.style.textAlign="right",c.style.textBaseline="middle";break;case"insideTop":c.style.textX=c.style.x+c.style.width/2,c.style.textY=c.style.y+E/2,c.style.textAlign="center",c.style.textBaseline="top";break;case"insideBottom":c.style.textX=c.style.x+c.style.width/2,c.style.textY=c.style.y+c.style.height-E/2,c.style.textAlign="center",c.style.textBaseline="bottom"}c.style.textPosition="specific",c.style.textColor=c.style.textColor||"#fff"}return this.deepQuery([p,h,this.option],"calculable")&&(this.setCalculable(c),c.draggable=!0),s.pack(c,l[e],e,l[e].data[t],t,n),c},getMarkCoord:function(e,t){var n=this.series[e],r=this.xMarkMap[e],i=this.component.xAxis.getAxis(n.xAxisIndex),s=this.component.yAxis.getAxis(n.yAxisIndex),o,u;if(!t.type||t.type!="max"&&t.type!="min"&&t.type!="average")if(r.isHorizontal){o=typeof t.xAxis=="string"&&i.getIndexByName?i.getIndexByName(t.xAxis):t.xAxis||0;var a=r[o];a=typeof a!="undefined"?a:typeof t.xAxis!="string"&&i.getCoordByIndex?i.getCoordByIndex(t.xAxis||0):i.getCoord(t.xAxis||0),u=[a,s.getCoord(t.yAxis||0)]}else{o=typeof t.yAxis=="string"&&s.getIndexByName?s.getIndexByName(t.yAxis):t.yAxis||0;var f=r[o];f=typeof f!="undefined"?f:typeof t.yAxis!="string"&&s.getCoordByIndex?s.getCoordByIndex(t.yAxis||0):s.getCoord(t.yAxis||0),u=[i.getCoord(t.xAxis||0),f]}else u=[r[t.type+"X"],r[t.type+"Y"],r[t.type+"Line"],r[t.type]];return u},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},addDataAnimation:function(e){var t=this.series,n={};for(var r=0,i=e.length;r=0;r--){c=s.get(this.shapeList[r],"seriesIndex");if(n[c]&&!n[c][3]&&this.shapeList[r].type=="rectangle"){h=s.get(this.shapeList[r],"dataIndex"),l=t[c];if(n[c][2]&&h==l.data.length-1){this.zr.delShape(this.shapeList[r].id);continue}if(!n[c][2]&&h===0){this.zr.delShape(this.shapeList[r].id);continue}this.shapeList[r]._orient=="horizontal"?(f=this.component.yAxis.getAxis(l.yAxisIndex||0).getGap(),a=n[c][2]?-f:f,o=0):(u=this.component.xAxis.getAxis(l.xAxisIndex||0).getGap(),o=n[c][2]?u:-u,a=0),this.shapeList[r].position=[0,0],this.zr.animate(this.shapeList[r].id,"").when(500,{position:[o,a]}).start()}}}},o.inherits(a,n),o.inherits(a,t),e("../chart").define("bar",a),a}),r("echarts/chart/pie",["require","../component/base","./base","zrender/shape/Text","zrender/shape/Ring","zrender/shape/Circle","zrender/shape/Sector","zrender/shape/BrokenLine","../config","../util/ecData","zrender/tool/util","zrender/tool/math","zrender/tool/color","../chart"],function(e){function p(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this);var u=this;u.shapeHandler.onmouseover=function(e){var t=e.target,n=f.get(t,"seriesIndex"),r=f.get(t,"dataIndex"),i=f.get(t,"special"),s=t._lastAddRadius,o=t.style.startAngle,a=t.style.endAngle,l=t.highlightStyle.color,c=u.getLabel(n,r,i,s,o,a,l,!0);c&&u.zr.addHoverShape(c);var h=u.getLabelLine(n,r,s,t.style.r0,t.style.r,o,a,l,!0);h&&u.zr.addHoverShape(h)},this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("zrender/shape/Text"),i=e("zrender/shape/Ring"),s=e("zrender/shape/Circle"),o=e("zrender/shape/Sector"),u=e("zrender/shape/BrokenLine"),a=e("../config"),f=e("../util/ecData"),l=e("zrender/tool/util"),c=e("zrender/tool/math"),h=e("zrender/tool/color");return p.prototype={type:a.CHART_TYPE_PIE,_buildShape:function(){var e=this.series,t=this.component.legend;this.selectedMap={},this._selected={};var n,r,o;this._selectedMode=!1;var u;for(var l=0,c=e.length;l0&&Math.abs(m-g)<15&&p<4&&this._needLabel(n,r[l],!1)&&this.deepQuery([r[l],n],"itemStyle.normal.label.position")!="center"?d+=h<4?20:-20:d=0,this._buildItem(e,l,h,d,r[l].selected,x,T,m,g,w),v||(m=g)}},_buildItem:function(e,t,n,r,i,s,o,u,a,l){var c=this.series,h=this.getSector(e,t,n,i,s,o,u,a,l);f.pack(h,c[e],e,c[e].data[t],t,c[e].data[t].name,n),h._lastAddRadius=r,this.shapeList.push(h);var p=this.getLabel(e,t,n,r,u,a,l,!1);p&&(f.pack(p,c[e],e,c[e].data[t],t,c[e].data[t].name,n),p._dataIndex=t,this.shapeList.push(p));var d=this.getLabelLine(e,t,r,s,o,u,a,l,!1);d&&(f.pack(d,c[e],e,c[e].data[t],t,c[e].data[t].name,n),d._dataIndex=t,this.shapeList.push(d))},getSector:function(e,t,n,r,i,s,u,a,f){var l=this.series,p=l[e],d=p.data[t],v=[d,p],m=this.parseCenter(this.zr,p.center),g=this.deepMerge(v,"itemStyle.normal")||{},y=this.deepMerge(v,"itemStyle.emphasis")||{},b=this.getItemStyleColor(g.color,e,t,d)||f,w=this.getItemStyleColor(y.color,e,t,d)||(typeof b=="string"?h.lift(b,-0.2):b),E={zlevel:this._zlevelBase,clickable:!0,style:{x:m[0],y:m[1],r0:i,r:s,startAngle:u,endAngle:a,brushType:"both",color:b,lineWidth:g.borderWidth,strokeColor:g.borderColor,lineJoin:"round"},highlightStyle:{color:w,lineWidth:y.borderWidth,strokeColor:y.borderColor,lineJoin:"round"},_seriesIndex:e,_dataIndex:t};if(r){var S=((E.style.startAngle+E.style.endAngle)/2).toFixed(2)-0;E.style._hasSelected=!0,E.style._x=E.style.x,E.style._y=E.style.y;var x=this.query(p,"selectedOffset");E.style.x+=c.cos(S,!0)*x,E.style.y-=c.sin(S,!0)*x,this._selected[e][t]=!0}else this._selected[e][t]=!1;this._selectedMode&&(E.onclick=this.shapeHandler.onclick),this.deepQuery([d,p,this.option],"calculable")&&(this.setCalculable(E),E.draggable=!0);if(this._needLabel(p,d,!0)||this._needLabelLine(p,d,!0))E.onmouseover=this.shapeHandler.onmouseover;return E=new o(E),E},getLabel:function(e,t,n,i,s,o,u,a){var f=this.series,h=f[e],p=h.data[t];if(!this._needLabel(h,p,a))return;var d=a?"emphasis":"normal",v=l.merge(l.clone(p.itemStyle)||{},h.itemStyle),m=v[d].label,g=m.textStyle||{},y=this.parseCenter(this.zr,h.center),b=y[0],w=y[1],E,S,x=((o+s)/2+360)%360,T=this.parseRadius(this.zr,h.radius),N,C="middle";return m.position=m.position||v.normal.label.position,m.position=="center"?(T=T[1],E=b,S=w,N="center"):m.position=="inner"?(T=(T[0]+T[1])/2+i,E=Math.round(b+T*c.cos(x,!0)),S=Math.round(w-T*c.sin(x,!0)),u="#fff",N="center"):(T=T[1]- -v[d].labelLine.length+i,E=b+T*c.cos(x,!0),S=w-T*c.sin(x,!0),N=x>=90&&x<=270?"right":"left"),m.position!="center"&&m.position!="inner"&&(E+=N=="left"?20:-20),p.__labelX=E-(N=="left"?5:-5),p.__labelY=S,new r({zlevel:this._zlevelBase+1,hoverable:!1,style:{x:E,y:S,color:g.color||u,text:this.getLabelText(e,t,n,d),textAlign:g.align||N,textBaseline:g.baseline||C,textFont:this.getFont(g)},highlightStyle:{brushType:"fill"},_seriesIndex:e,_dataIndex:t})},getLabelText:function(e,t,n,r){var i=this.series,s=i[e],o=s.data[t],u=this.deepQuery([o,s],"itemStyle."+r+".label.formatter");if(!u)return o.name;if(typeof u=="function")return u.call(this.myChart,s.name,o.name,o.value,n);if(typeof u=="string")return u=u.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}").replace("{d}","{d0}"),u=u.replace("{a0}",s.name).replace("{b0}",o.name).replace("{c0}",o.value).replace("{d0}",n),u},getLabelLine:function(e,t,n,r,i,s,o,a,f){var h=this.series,p=h[e],d=p.data[t];if(this._needLabelLine(p,d,f)){var v=f?"emphasis":"normal",m=l.merge(l.clone(d.itemStyle)||{},p.itemStyle),g=m[v].labelLine,y=g.lineStyle||{},b=this.parseCenter(this.zr,p.center),w=b[0],E=b[1],S=i,x=this.parseRadius(this.zr,p.radius)[1]- -g.length+n,T=(o+s)/2%360,N=c.cos(T,!0),C=c.sin(T,!0);return new u({zlevel:this._zlevelBase+1,hoverable:!1,style:{pointList:[[w+S*N,E-S*C],[w+x*N,E-x*C],[d.__labelX,d.__labelY]],strokeColor:y.color||a,lineType:y.type,lineWidth:y.width},_seriesIndex:e,_dataIndex:t})}return},_needLabel:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".label.show")},_needLabelLine:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".labelLine.show")},reformOption:function(e){var t=l.merge;return e=t(e||{},this.ecTheme.pie),e.itemStyle.normal.label.textStyle=t(e.itemStyle.normal.label.textStyle||{},this.ecTheme.textStyle),e.itemStyle.emphasis.label.textStyle=t(e.itemStyle.emphasis.label.textStyle||{},this.ecTheme.textStyle),e},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},addDataAnimation:function(e){var t=this.series,n={};for(var r=0,i=e.length;r0&&(e.splice(f-1,2),f-=2)}}e=e.join("/")}else e.indexOf("./")===0&&(e=e.substring(2));if((p||v)&&d){n=e.split("/");for(f=n.length;f>0;f-=1){r=n.slice(0,f).join("/");if(p)for(c=p.length;c>0;c-=1){i=d[p.slice(0,c).join("/")];if(i){i=i[r];if(i){s=i,o=f;break}}}if(s)break;!u&&v&&v[r]&&(u=v[r],a=f)}!s&&u&&(s=u,o=a),s&&(n.splice(0,o,s),e=n.join("/"))}return e}function m(t,n){return function(){return s.apply(e,p.call(arguments,0).concat([t,n]))}}function g(e){return function(t){return v(t,e)}}function y(e){return function(t){a[e]=t}}function b(t){if(d(f,t)){var n=f[t];delete f[t],c[t]=!0,i.apply(e,n)}if(!d(a,t)&&!d(c,t))throw new Error("No "+t);return a[t]}function w(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function E(e){return function(){return l&&l.config&&l.config[e]||{}}}var i,s,o,u,a={},f={},l={},c={},h=Object.prototype.hasOwnProperty,p=[].slice;o=function(e,t){var n,r=w(e),i=r[0];return e=r[1],i&&(i=v(i,t),n=b(i)),i?n&&n.normalize?e=n.normalize(e,g(t)):e=v(e,t):(e=v(e,t),r=w(e),i=r[0],e=r[1],i&&(n=b(i))),{f:i?i+"!"+e:e,n:e,pr:i,p:n}},u={require:function(e){return m(e)},exports:function(e){var t=a[e];return typeof t!="undefined"?t:a[e]={}},module:function(e){return{id:e,uri:"",exports:a[e],config:E(e)}}},i=function(t,n,r,i){var s,l,h,p,v,g=[],w;i=i||t;if(typeof r=="function"){n=!n.length&&r.length?["require","exports","module"]:n;for(v=0;v{b} : {c}",showDelay:20,hideDelay:100,transitionDuration:.4,backgroundColor:"rgba(0,0,0,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,axisPointer:{type:"line",lineStyle:{color:"#48b",width:2,type:"solid"},crossStyle:{color:"#1e90ff",width:1,type:"dashed"},shadowStyle:{color:"rgba(150,150,150,0.3)",width:"auto",type:"default"}},textStyle:{color:"#fff"}},dataZoom:{show:!1,orient:"horizontal",backgroundColor:"rgba(0,0,0,0)",dataBackgroundColor:"#eee",fillerColor:"rgba(144,197,237,0.2)",handleColor:"rgba(70,130,180,0.8)",realtime:!0},grid:{x:80,y:60,x2:80,y2:60,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},categoryAxis:{position:"bottom",name:"",nameLocation:"end",nameTextStyle:{},boundaryGap:!0,axisLine:{show:!0,onZero:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!0,interval:"auto",inside:!1,length:5,lineStyle:{color:"#333",width:1}},axisLabel:{show:!0,interval:"auto",rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}}},valueAxis:{position:"left",name:"",nameLocation:"end",nameTextStyle:{},boundaryGap:[0,0],precision:0,power:100,splitNumber:5,axisLine:{show:!0,onZero:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,inside:!1,length:5,lineStyle:{color:"#333",width:1}},axisLabel:{show:!0,rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}}},polar:{center:["50%","50%"],radius:"75%",startAngle:90,splitNumber:5,name:{show:!0,textStyle:{color:"#333"}},axisLine:{show:!0,lineStyle:{color:"#ccc",width:1,type:"solid"}},axisLabel:{show:!1,textStyle:{color:"#333"}},splitArea:{show:!0,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}},splitLine:{show:!0,lineStyle:{width:1,color:"#ccc"}},type:"polygon"},timeline:{show:!0,type:"time",notMerge:!1,realtime:!0,x:80,x2:80,y2:0,height:50,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,controlPosition:"left",autoPlay:!1,loop:!0,playInterval:2e3,lineStyle:{width:1,color:"#666",type:"dashed"},label:{show:!0,interval:"auto",rotate:0,textStyle:{color:"#333"}},checkpointStyle:{symbol:"auto",symbolSize:"auto",color:"auto",borderColor:"auto",borderWidth:"auto",label:{show:!1,textStyle:{color:"auto"}}},controlStyle:{normal:{color:"#333"},emphasis:{color:"#1e90ff"}},symbol:"emptyDiamond",symbolSize:4,currentIndex:0},roamController:{show:!1,x:"left",y:"top",width:80,height:120,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,handlerColor:"#6495ed",fillerColor:"#fff",step:15,mapTypeControl:null},bar:{clickable:!0,xAxisIndex:0,yAxisIndex:0,barMinHeight:0,barGap:"30%",barCategoryGap:"20%",itemStyle:{normal:{barBorderColor:"#fff",barBorderRadius:0,barBorderWidth:0,label:{show:!1}},emphasis:{barBorderColor:"#fff",barBorderRadius:0,barBorderWidth:0,label:{show:!1}}}},line:{clickable:!0,xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid",shadowColor:"rgba(0,0,0,0)",shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0}},emphasis:{label:{show:!1}}},symbolSize:2,showAllSymbol:!1},k:{clickable:!0,xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{color:"#fff",color0:"#00aa11",lineStyle:{width:1,color:"#ff3200",color0:"#00aa11"}},emphasis:{}}},scatter:{clickable:!0,xAxisIndex:0,yAxisIndex:0,symbolSize:4,large:!1,largeThreshold:2e3,itemStyle:{normal:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}},emphasis:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}}}},radar:{clickable:!0,polarIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid"}},emphasis:{label:{show:!1}}},symbolSize:2},pie:{clickable:!0,center:["50%","50%"],radius:[0,"75%"],clockWise:!0,startAngle:90,minAngle:0,selectedOffset:10,itemStyle:{normal:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1,type:"solid"}}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!1},labelLine:{show:!1,length:20,lineStyle:{width:1,type:"solid"}}}}},map:{mapType:"china",mapValuePrecision:0,showLegendSymbol:!0,hoverable:!0,clickable:!0,itemStyle:{normal:{borderColor:"rgba(0,0,0,0)",borderWidth:1,areaStyle:{color:"#ccc"},label:{show:!1,textStyle:{color:"rgb(139,69,19)"}}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,areaStyle:{color:"rgba(255,215,0,0.8)"},label:{show:!1,textStyle:{color:"rgb(100,0,0)"}}}}},force:{center:["50%","50%"],size:"100%",coolDown:.99,minRadius:10,maxRadius:20,ratioScaling:!1,large:!1,useWorker:!1,steps:1,scaling:1,gravity:1,symbol:"circle",symbolSize:0,linkSymbol:null,linkSymbolSize:[10,15],draggable:!0,clickable:!0,categories:[{}],itemStyle:{normal:{label:{show:!1},nodeStyle:{brushType:"both",color:"#f08c2e",strokeColor:"#5182ab",lineWidth:1},linkStyle:{strokeColor:"#5182ab"}},emphasis:{label:{show:!1},nodeStyle:{},linkStyle:{opacity:0}}}},chord:{clickable:!0,radius:["65%","75%"],center:["50%","50%"],padding:2,sort:"none",sortSub:"none",startAngle:90,clockWise:!0,showScale:!1,showScaleText:!1,itemStyle:{normal:{label:{show:!0,rotate:!1,distance:10},lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:1,color:"#999"}}},emphasis:{lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:1,color:"#666"}}}},matrix:[]},gauge:{center:["50%","50%"],radius:"75%",startAngle:225,endAngle:-45,min:0,max:100,precision:0,splitNumber:10,axisLine:{show:!0,lineStyle:{color:[[.2,"#228b22"],[.8,"#48b"],[1,"#ff4500"]],width:30}},axisTick:{show:!0,splitNumber:5,length:8,lineStyle:{color:"#eee",width:1,type:"solid"}},axisLabel:{show:!0,textStyle:{color:"auto"}},splitLine:{show:!0,length:30,lineStyle:{color:"#eee",width:2,type:"solid"}},pointer:{show:!0,length:"80%",width:8,color:"auto"},title:{show:!0,offsetCenter:[0,"-40%"],textStyle:{color:"#333",fontSize:15}},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:40,offsetCenter:[0,"40%"],textStyle:{color:"auto",fontSize:30}}},funnel:{clickable:!0,x:80,y:60,x2:80,y2:60,min:0,max:100,minSize:"0%",maxSize:"100%",sort:"descending",gap:0,itemStyle:{normal:{borderColor:"#fff",borderWidth:1,label:{show:!0,position:"outer"},labelLine:{show:!0,length:10,lineStyle:{width:1,type:"solid"}}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!0},labelLine:{show:!0}}}},island:{r:15,calculateStep:.1},markPoint:{clickable:!0,symbol:"pin",symbolSize:10,large:!1,effect:{show:!1,loop:!0,period:15,scaleSize:2},itemStyle:{normal:{borderWidth:2,label:{show:!0,position:"inside"}},emphasis:{label:{show:!0}}}},markLine:{clickable:!0,symbol:["circle","arrow"],symbolSize:[2,4],large:!1,effect:{show:!1,loop:!0,period:15,scaleSize:2},itemStyle:{normal:{borderWidth:1.5,label:{show:!0,position:"end"},lineStyle:{type:"dashed"}},emphasis:{label:{show:!1},lineStyle:{}}}},textStyle:{decoration:"none",fontFamily:"Arial, Verdana, sans-serif",fontFamily2:"微软雅黑",fontSize:12,fontStyle:"normal",fontWeight:"normal"},EVENT:{REFRESH:"refresh",RESTORE:"restore",RESIZE:"resize",CLICK:"click",DBLCLICK:"dblclick",HOVER:"hover",MOUSEOUT:"mouseout",DATA_CHANGED:"dataChanged",DATA_ZOOM:"dataZoom",DATA_RANGE:"dataRange",LEGEND_SELECTED:"legendSelected",MAP_SELECTED:"mapSelected",PIE_SELECTED:"pieSelected",MAGIC_TYPE_CHANGED:"magicTypeChanged",DATA_VIEW_CHANGED:"dataViewChanged",TIMELINE_CHANGED:"timelineChanged",MAP_ROAM:"mapRoam",TOOLTIP_HOVER:"tooltipHover",TOOLTIP_IN_GRID:"tooltipInGrid",TOOLTIP_OUT_GRID:"tooltipOutGrid",ROAMCONTROLLER:"roamController"},DRAG_ENABLE_TIME:120,EFFECT_ZLEVEL:7,symbolList:["circle","rectangle","triangle","diamond","emptyCircle","emptyRectangle","emptyTriangle","emptyDiamond"],loadingText:"Loading...",calculable:!1,calculableColor:"rgba(255,165,0,0.6)",calculableHolderColor:"#ccc",nameConnector:" & ",valueConnector:": ",animation:!0,addDataAnimation:!0,animationThreshold:2e3,animationDuration:2e3,animationEasing:"ExponentialOut"};return e}),r("zrender/dep/excanvas",["require"],function(e){return document.createElement("canvas").getContext?G_vmlCanvasManager=!1:function(){function f(){return this.context_||(this.context_=new I(this))}function c(e,t,n){var r=l.call(arguments,2);return function(){return e.apply(t,r.concat(l.call(arguments)))}}function h(e){return String(e).replace(/&/g,"&").replace(/"/g,""")}function p(e,t,n){e.namespaces[t]||e.namespaces.add(t,n,"#default#VML")}function d(e){p(e,"g_vml_","urn:schemas-microsoft-com:vml"),p(e,"g_o_","urn:schemas-microsoft-com:office:office");if(!e.styleSheets.ex_canvas_){var t=e.createStyleSheet();t.owningElement.id="ex_canvas_",t.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}function m(e){var t=e.srcElement;switch(e.propertyName){case"width":t.getContext().clearRect(),t.style.width=t.attributes.width.nodeValue+"px",t.firstChild.style.width=t.clientWidth+"px";break;case"height":t.getContext().clearRect(),t.style.height=t.attributes.height.nodeValue+"px",t.firstChild.style.height=t.clientHeight+"px"}}function g(e){var t=e.srcElement;t.firstChild&&(t.firstChild.style.width=t.clientWidth+"px",t.firstChild.style.height=t.clientHeight+"px")}function E(){return[[1,0,0],[0,1,0],[0,0,1]]}function S(e,t){var n=E();for(var r=0;r<3;r++)for(var i=0;i<3;i++){var s=0;for(var o=0;o<3;o++)s+=e[r][o]*t[o][i];n[r][i]=s}return n}function x(e,t){t.fillStyle=e.fillStyle,t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY,t.strokeStyle=e.strokeStyle,t.globalAlpha=e.globalAlpha,t.font=e.font,t.textAlign=e.textAlign,t.textBaseline=e.textBaseline,t.arcScaleX_=e.arcScaleX_,t.arcScaleY_=e.arcScaleY_,t.lineScale_=e.lineScale_}function N(e){var t=e.indexOf("(",3),n=e.indexOf(")",t+1),r=e.substring(t+1,n).split(",");if(r.length!=4||e.charAt(3)!="a")r[3]=1;return r}function C(e){return parseFloat(e)/100}function k(e,t,n){return Math.min(n,Math.max(t,e))}function L(e){var t,n,r,i,s,o;i=parseFloat(e[0])/360%360,i<0&&i++,s=k(C(e[1]),0,1),o=k(C(e[2]),0,1);if(s==0)t=n=r=o;else{var u=o<.5?o*(1+s):o+s-o*s,a=2*o-u;t=A(a,u,i+1/3),n=A(a,u,i),r=A(a,u,i-1/3)}return"#"+y[Math.floor(t*255)]+y[Math.floor(n*255)]+y[Math.floor(r*255)]}function A(e,t,n){return n<0&&n++,n>1&&n--,6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function M(e){if(e in O)return O[e];var t,n=1;e=String(e);if(e.charAt(0)=="#")t=e;else if(/^rgb/.test(e)){var r=N(e),t="#",i;for(var s=0;s<3;s++)r[s].indexOf("%")!=-1?i=Math.floor(C(r[s])*255):i=+r[s],t+=y[k(i,0,255)];n=+r[3]}else if(/^hsl/.test(e)){var r=N(e);t=L(r),n=r[3]}else t=T[e]||e;return O[e]={color:t,alpha:n}}function P(e){if(D[e])return D[e];var t=document.createElement("div"),n=t.style,r;try{n.font=e,r=n.fontFamily.split(",")[0]}catch(i){}return D[e]={style:n.fontStyle||_.style,variant:n.fontVariant||_.variant,weight:n.fontWeight||_.weight,size:n.fontSize||_.size,family:r||_.family}}function H(e,t){var n={};for(var r in e)n[r]=e[r];var i=parseFloat(t.currentStyle.fontSize),s=parseFloat(e.size);return typeof e.size=="number"?n.size=e.size:e.size.indexOf("px")!=-1?n.size=s:e.size.indexOf("em")!=-1?n.size=i*s:e.size.indexOf("%")!=-1?n.size=i/100*s:e.size.indexOf("pt")!=-1?n.size=s/.75:n.size=i,n}function B(e){return e.style+" "+e.variant+" "+e.weight+" "+e.size+"px '"+e.family+"'"}function F(e){return j[e]||"square"}function I(e){this.m_=E(),this.mStack_=[],this.aStack_=[],this.currentPath_=[],this.strokeStyle="#000",this.fillStyle="#000",this.lineWidth=1,this.lineJoin="miter",this.lineCap="butt",this.miterLimit=o*1,this.globalAlpha=1,this.font="12px 微软雅黑",this.textAlign="left",this.textBaseline="alphabetic",this.canvas=e;var t="width:"+e.clientWidth+"px;height:"+e.clientHeight+"px;overflow:hidden;position:absolute",n=e.ownerDocument.createElement("div");n.style.cssText=t,e.appendChild(n);var r=n.cloneNode(!1);r.style.backgroundColor="#fff",r.style.filter="alpha(opacity=0)",e.appendChild(r),this.element_=n,this.arcScaleX_=1,this.arcScaleY_=1,this.lineScale_=1}function R(e,t,n,r){e.currentPath_.push({type:"bezierCurveTo",cp1x:t.x,cp1y:t.y,cp2x:n.x,cp2y:n.y,x:r.x,y:r.y}),e.currentX_=r.x,e.currentY_=r.y}function U(e,t){var n=M(e.strokeStyle),r=n.color,i=n.alpha*e.globalAlpha,s=e.lineScale_*e.lineWidth;s<1&&(i*=s),t.push("')}function z(t,n,r,i){var s=t.fillStyle,u=t.arcScaleX_,a=t.arcScaleY_,f=i.x-r.x,l=i.y-r.y;if(s instanceof $){var c=0,h={x:0,y:0},p=0,d=1;if(s.type_=="gradient"){var v=s.x0_/u,m=s.y0_/a,g=s.x1_/u,y=s.y1_/a,b=W(t,v,m),w=W(t,g,y),E=w.x-b.x,S=w.y-b.y;c=Math.atan2(E,S)*180/Math.PI,c<0&&(c+=360),c<1e-6&&(c=0)}else{var b=W(t,s.x0_,s.y0_);h={x:(b.x-r.x)/f,y:(b.y-r.y)/l},f/=u*o,l/=a*o;var x=e.max(f,l);p=2*s.r0_/x,d=2*s.r1_/x-p}var T=s.colors_;T.sort(function(e,t){return e.offset-t.offset});var N=T.length,C=T[0].color,k=T[N-1].color,L=T[0].alpha*t.globalAlpha,A=T[N-1].alpha*t.globalAlpha,O=[];for(var _=0;_')}else if(s instanceof J){if(f&&l){var P=-r.x,H=-r.y;n.push("')}}else{var B=M(t.fillStyle),j=B.color,F=B.alpha*t.globalAlpha;n.push('')}}function W(e,t,n){var r=e.m_;return{x:o*(t*r[0][0]+n*r[1][0]+r[2][0])-u,y:o*(t*r[0][1]+n*r[1][1]+r[2][1])-u}}function X(e){return isFinite(e[0][0])&&isFinite(e[0][1])&&isFinite(e[1][0])&&isFinite(e[1][1])&&isFinite(e[2][0])&&isFinite(e[2][1])}function V(e,t,n){if(!X(t))return;e.m_=t;if(n){var r=t[0][0]*t[1][1]-t[0][1]*t[1][0];e.lineScale_=s(i(r))}}function $(e){this.type_=e,this.x0_=0,this.y0_=0,this.r0_=0,this.x1_=0,this.y1_=0,this.r1_=0,this.colors_=[]}function J(e,t){Q(e);switch(t){case"repeat":case null:case"":this.repetition_="repeat";break;case"repeat-x":case"repeat-y":case"no-repeat":this.repetition_=t;break;default:K("SYNTAX_ERR")}this.src_=e.src,this.width_=e.width,this.height_=e.height}function K(e){throw new G(e)}function Q(e){(!e||e.nodeType!=1||e.tagName!="IMG")&&K("TYPE_MISMATCH_ERR"),e.readyState!="complete"&&K("INVALID_STATE_ERR")}function G(e){this.code=this[e],this.message=e+": DOM Exception "+this.code}var e=Math,t=e.round,n=e.sin,r=e.cos,i=e.abs,s=e.sqrt,o=10,u=o/2,a=+navigator.userAgent.match(/MSIE ([\d.]+)?/)[1],l=Array.prototype.slice;d(document);var v={init:function(e){var t=e||document;t.createElement("canvas"),t.attachEvent("onreadystatechange",c(this.init_,this,t))},init_:function(e){var t=e.getElementsByTagName("canvas");for(var n=0;n'),(f||l)&&w.push('
'),w.push('
'),(f||l)&&w.push("
"),w.push("
"),this.element_.insertAdjacentHTML("BeforeEnd",w.join(""))},q.stroke=function(e){var n=[],r=!1,i=10,s=10;n.push("f.x)f.x=c.x;if(a.y==null||c.yf.y)f.y=c.y}}n.push(' ">'),e?z(this,n,a,f):U(this,n),n.push(""),this.element_.insertAdjacentHTML("beforeEnd",n.join(""))},q.fill=function(){this.stroke(!0)},q.closePath=function(){this.currentPath_.push({type:"close"})},q.save=function(){var e={};x(this,e),this.aStack_.push(e),this.mStack_.push(this.m_),this.m_=S(E(),this.m_)},q.restore=function(){this.aStack_.length&&(x(this.aStack_.pop(),this),this.m_=this.mStack_.pop())},q.translate=function(e,t){var n=[[1,0,0],[0,1,0],[e,t,1]];V(this,S(n,this.m_),!1)},q.rotate=function(e){var t=r(e),i=n(e),s=[[t,i,0],[-i,t,0],[0,0,1]];V(this,S(s,this.m_),!1)},q.scale=function(e,t){this.arcScaleX_*=e,this.arcScaleY_*=t;var n=[[e,0,0],[0,t,0],[0,0,1]];V(this,S(n,this.m_),!0)},q.transform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,S(o,this.m_),!0)},q.setTransform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,o,!0)},q.drawText_=function(e,n,r,i,s){var u=this.m_,a=1e3,f=0,l=a,c={x:0,y:0},p=[],d=H(P(this.font),this.element_),v=B(d),m=this.element_.currentStyle,g=this.textAlign.toLowerCase();switch(g){case"left":case"center":case"right":break;case"end":g=m.direction=="ltr"?"right":"left";break;case"start":g=m.direction=="rtl"?"right":"left";break;default:g="left"}switch(this.textBaseline){case"hanging":case"top":c.y=d.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":c.y=-d.size/2.25}switch(g){case"right":f=a,l=.05;break;case"center":f=l=a/2}var y=W(this,n+c.x,r+c.y);p.push(''),s?U(this,p):z(this,p,{x:-f,y:0},{x:l,y:d.size});var b=u[0][0].toFixed(3)+","+u[1][0].toFixed(3)+","+u[0][1].toFixed(3)+","+u[1][1].toFixed(3)+",0,0",w=t(y.x/o)+","+t(y.y/o);p.push('','',''),this.element_.insertAdjacentHTML("beforeEnd",p.join(""))},q.fillText=function(e,t,n,r){this.drawText_(e,t,n,r,!1)},q.strokeText=function(e,t,n,r){this.drawText_(e,t,n,r,!0)},q.measureText=function(e){if(!this.textMeasureEl_){var t='';this.element_.insertAdjacentHTML("beforeEnd",t),this.textMeasureEl_=this.element_.lastChild}var n=this.element_.ownerDocument;return this.textMeasureEl_.innerHTML="",this.textMeasureEl_.style.font=this.font,this.textMeasureEl_.appendChild(n.createTextNode(e)),{width:this.textMeasureEl_.offsetWidth}},q.clip=function(){},q.arcTo=function(){},q.createPattern=function(e,t){return new J(e,t)},$.prototype.addColorStop=function(e,t){t=M(t),this.colors_.push({offset:e,color:t.color,alpha:t.alpha})};var Y=G.prototype=new Error;Y.INDEX_SIZE_ERR=1,Y.DOMSTRING_SIZE_ERR=2,Y.HIERARCHY_REQUEST_ERR=3,Y.WRONG_DOCUMENT_ERR=4,Y.INVALID_CHARACTER_ERR=5,Y.NO_DATA_ALLOWED_ERR=6,Y.NO_MODIFICATION_ALLOWED_ERR=7,Y.NOT_FOUND_ERR=8,Y.NOT_SUPPORTED_ERR=9,Y.INUSE_ATTRIBUTE_ERR=10,Y.INVALID_STATE_ERR=11,Y.SYNTAX_ERR=12,Y.INVALID_MODIFICATION_ERR=13,Y.NAMESPACE_ERR=14,Y.INVALID_ACCESS_ERR=15,Y.VALIDATION_ERR=16,Y.TYPE_MISMATCH_ERR=17,G_vmlCanvasManager=v,CanvasRenderingContext2D=I,CanvasGradient=$,CanvasPattern=J,DOMException=G}(),G_vmlCanvasManager}),r("zrender/tool/util",["require","../dep/excanvas"],function(e){function n(e){if(typeof e=="object"&&e!==null){var r=e;if(e instanceof Array){r=[];for(var i=0,s=e.length;if&&(f=e+c+n,u.width=f,r=!0),t+h>l&&(l=t+h+n,u.height=l,r=!0),e<-c&&(c=Math.ceil(-e/n)*n,f+=c,u.width=f,r=!0),t<-h&&(h=Math.ceil(-t/n)*n,l+=h,u.height=l,r=!0),r&&a.translate(c,h)}function v(){return{x:c,y:h}}function m(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n3&&(t=Array.prototype.slice.call(t,1));var r=this._handlers[e],i=r.length;for(var s=0;s4&&(t=Array.prototype.slice.call(t,1,t.length-1));var r=t[t.length-1],i=this._handlers[e],s=i.length;for(var o=0;o1)for(var e in arguments)console.log(arguments[e])}}),r("zrender/tool/guid",[],function(){var e=2311;return function(){return"zrender__"+e++}}),r("zrender/tool/vector",[],function(){var e=typeof Float32Array=="undefined"?Array:Float32Array,t={create:function(t,n){var r=new e(2);return r[0]=t||0,r[1]=n||0,r},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e},set:function(e,t,n){return e[0]=t,e[1]=n,e},add:function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e},scaleAndAdd:function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e},sub:function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e},len:function(e){return Math.sqrt(this.lenSquare(e))},lenSquare:function(e){return e[0]*e[0]+e[1]*e[1]},mul:function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e},div:function(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e},dot:function(e,t){return e[0]*t[0]+e[1]*t[1]},scale:function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e},normalize:function(e,n){var r=t.len(n);return r===0?(e[0]=0,e[1]=0):(e[0]=n[0]/r,e[1]=n[1]/r),e},distance:function(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))},distanceSquare:function(e,t){return(e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])},negate:function(e,t){return e[0]=-t[0],e[1]=-t[1],e},lerp:function(e,t,n,r){return e[0]=t[0]+r*(n[0]-t[0]),e[1]=t[1]+r*(n[1]-t[1]),e},applyTransform:function(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[2]*i+n[4],e[1]=n[1]*r+n[3]*i+n[5],e},min:function(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e},max:function(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}};return t.length=t.len,t.lengthSquare=t.lenSquare,t.dist=t.distance,t.distSquare=t.distanceSquare,t}),r("zrender/tool/matrix",[],function(){var e=typeof Float32Array=="undefined"?Array:Float32Array,t={create:function(){var n=new e(6);return t.identity(n),n},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},mul:function(e,t,n){return e[0]=t[0]*n[0]+t[2]*n[1],e[1]=t[1]*n[0]+t[3]*n[1],e[2]=t[0]*n[2]+t[2]*n[3],e[3]=t[1]*n[2]+t[3]*n[3],e[4]=t[0]*n[4]+t[2]*n[5]+t[4],e[5]=t[1]*n[4]+t[3]*n[5]+t[5],e},translate:function(e,t,n){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+n[0],e[5]=t[5]+n[1],e},rotate:function(e,t,n){var r=t[0],i=t[2],s=t[4],o=t[1],u=t[3],a=t[5],f=Math.sin(n),l=Math.cos(n);return e[0]=r*l+o*f,e[1]=-r*f+o*l,e[2]=i*l+u*f,e[3]=-i*f+l*u,e[4]=l*s+f*a,e[5]=l*a-f*s,e},scale:function(e,t,n){var r=n[0],i=n[1];return e[0]=t[0]*r,e[1]=t[1]*i,e[2]=t[2]*r,e[3]=t[3]*i,e[4]=t[4]*r,e[5]=t[5]*i,e},invert:function(e,t){var n=t[0],r=t[2],i=t[4],s=t[1],o=t[3],u=t[5],a=n*o-s*r;return a?(a=1/a,e[0]=o*a,e[1]=-s*a,e[2]=-r*a,e[3]=n*a,e[4]=(r*u-o*i)*a,e[5]=(s*i-n*u)*a,e):null},mulVector:function(e,t,n){var r=t[0],i=t[2],s=t[4],o=t[1],u=t[3],a=t[5];return e[0]=n[0]*r+n[1]*i+s,e[1]=n[0]*o+n[1]*u+a,e}};return t}),r("zrender/Handler",["require","./config","./tool/env","./tool/event","./tool/util","./tool/vector","./tool/matrix","./mixin/Eventful"],function(e){function c(e,t){return function(n){return e.call(t,n)}}function h(e,t){return function(n,r,i){return e.call(t,n,r,i)}}function p(e){var t=f.length;while(t--){var n=f[t];e["_"+n+"Handler"]=c(l[n],e)}}function m(e,t,n){if(this._draggingTarget&&this._draggingTarget.id==e.id||e.isSilent())return!1;var r=this._event;if(e.isCover(t,n)){e.hoverable&&this.storage.addHover(e);var i=e.parent;while(i){if(i.clipShape&&!i.clipShape.isCover(this._mouseX,this._mouseY))return!1;i=i.parent}return this._lastHover!=e&&(this._processOutShape(r),this._processDragLeave(r),this._lastHover=e,this._processDragEnter(r)),this._processOverShape(r),this._processDragOver(r),this._hasfound=1,!0}return!1}var t=e("./config"),n=e("./tool/env"),r=e("./tool/event"),i=e("./tool/util"),s=e("./tool/vector"),o=e("./tool/matrix"),u=t.EVENT,a=e("./mixin/Eventful"),f=["resize","click","dblclick","mousewheel","mousemove","mouseout","mouseup","mousedown","touchstart","touchend","touchmove"],l={resize:function(e){e=e||window.event,this._lastHover=null,this._isMouseDown=0,this.dispatch(u.RESIZE,e)},click:function(e){e=this._zrenderEventFixed(e);var t=this._lastHover;(t&&t.clickable||!t)&&this._dispatchAgency(t,u.CLICK,e),this._mousemoveHandler(e)},dblclick:function(e){e=this._zrenderEventFixed(e);var t=this._lastHover;(t&&t.clickable||!t)&&this._dispatchAgency(t,u.DBLCLICK,e),this._mousemoveHandler(e)},mousewheel:function(e){e=this._zrenderEventFixed(e);var t=e.wheelDelta||-e.detail,n=t>0?1.1:1/1.1,r=this.painter.getLayers(),i=!1;for(var s in r)if(s!=="hover"){var o=r[s],a=o.position;if(o.zoomable){o.__zoom=o.__zoom||1;var f=o.__zoom;f*=n,f=Math.max(Math.min(o.maxZoom,f),o.minZoom),n=f/o.__zoom,o.__zoom=f,a[0]-=(this._mouseX-a[0])*(n-1),a[1]-=(this._mouseY-a[1])*(n-1),o.scale[0]*=n,o.scale[1]*=n,o.dirty=!0,i=!0}}i&&this.painter.refresh(),this._dispatchAgency(this._lastHover,u.MOUSEWHEEL,e),this._mousemoveHandler(e)},mousemove:function(e){if(this.painter.isLoading())return;e=this._zrenderEventFixed(e),this._lastX=this._mouseX,this._lastY=this._mouseY,this._mouseX=r.getX(e),this._mouseY=r.getY(e);var t=this._mouseX-this._lastX,n=this._mouseY-this._lastY;this._processDragStart(e),this._hasfound=0,this._event=e,this._iterateAndFindHover();if(!this._hasfound){if(!this._draggingTarget||this._lastHover&&this._lastHover!=this._draggingTarget)this._processOutShape(e),this._processDragLeave(e);this._lastHover=null,this.storage.delHover(),this.painter.clearHover()}var i="default";if(this._draggingTarget)this.storage.drift(this._draggingTarget.id,t,n),this.storage.addHover(this._draggingTarget);else if(this._isMouseDown){var s=this.painter.getLayers(),o=!1;for(var a in s)if(a!=="hover"){var f=s[a];f.panable&&(i="move",f.position[0]+=t,f.position[1]+=n,o=!0,f.dirty=!0)}o&&this.painter.refresh()}this._draggingTarget||this._hasfound&&this._lastHover.draggable?i="move":this._hasfound&&this._lastHover.clickable&&(i="pointer"),this.root.style.cursor=i,this._dispatchAgency(this._lastHover,u.MOUSEMOVE,e),(this._draggingTarget||this._hasfound||this.storage.hasHoverShape())&&this.painter.refreshHover()},mouseout:function(e){e=this._zrenderEventFixed(e);var t=e.toElement||e.relatedTarget;if(t!=this.root)while(t&&t.nodeType!=9){if(t==this.root){this._mousemoveHandler(e);return}t=t.parentNode}e.zrenderX=this._lastX,e.zrenderY=this._lastY,this.root.style.cursor="default",this._isMouseDown=0,this._processOutShape(e),this._processDrop(e),this._processDragEnd(e),this.painter.isLoading()||this.painter.refreshHover(),this.dispatch(u.GLOBALOUT,e)},mousedown:function(e){if(this._lastDownButton==2){this._lastDownButton=e.button,this._mouseDownTarget=null;return}this._lastMouseDownMoment=new Date,e=this._zrenderEventFixed(e),this._isMouseDown=1,this._mouseDownTarget=this._lastHover,this._dispatchAgency(this._lastHover,u.MOUSEDOWN,e),this._lastDownButton=e.button},mouseup:function(e){e=this._zrenderEventFixed(e),this.root.style.cursor="default",this._isMouseDown=0,this._mouseDownTarget=null,this._dispatchAgency(this._lastHover,u.MOUSEUP,e),this._processDrop(e),this._processDragEnd(e)},touchstart:function(e){e=this._zrenderEventFixed(e,!0),this._lastTouchMoment=new Date,this._mobildFindFixed(e),this._mousedownHandler(e)},touchmove:function(e){e=this._zrenderEventFixed(e,!0),this._mousemoveHandler(e),this._isDragging&&r.stop(e)},touchend:function(e){e=this._zrenderEventFixed(e,!0),this._mouseupHandler(e);var t=new Date;t-this._lastTouchMoment=0;u--){var a=t[u];n!==a.zlevel&&(r=this.painter.getLayer(a.zlevel,r),i[0]=this._mouseX,i[1]=this._mouseY,r.needTransform&&(o.invert(e,r.transform),s.applyTransform(i,i,e)));if(this._findHover(a,i[0],i[1]))break}}}();var v=[{x:10},{x:-20},{x:10,y:10},{y:-20}];return d.prototype._mobildFindFixed=function(e){this._lastHover=null,this._mouseX=e.zrenderX,this._mouseY=e.zrenderY,this._event=e,this._iterateAndFindHover();for(var t=0;!this._lastHover&&t-n&&en||e<-n}function l(e,t,n,r,i){var s=1-i;return s*s*(s*e+3*i*t)+i*i*(i*r+3*s*n)}function c(e,t,n,r,i){var s=1-i;return 3*(((t-e)*s+2*(n-t)*i)*s+(r-n)*i*i)}function h(e,t,n,s,o,u){var f=s+3*(t-n)-e,l=3*(n-t*2+e),c=3*(t-e),h=e-o,p=l*l-3*f*c,d=l*c-9*f*h,v=c*c-3*l*h,m=0;if(a(p)&&a(d))if(a(l))u[0]=0;else{var g=-c/l;g>=0&&g<=1&&(u[m++]=g)}else{var y=d*d-4*p*v;if(a(y)){var b=d/p,g=-l/f+b,w=-b/2;g>=0&&g<=1&&(u[m++]=g),w>=0&&w<=1&&(u[m++]=w)}else if(y>0){var E=Math.sqrt(y),S=p*l+1.5*f*(-d+E),x=p*l+1.5*f*(-d-E);S<0?S=-Math.pow(-S,i):S=Math.pow(S,i),x<0?x=-Math.pow(-x,i):x=Math.pow(x,i);var g=(-l-(S+x))/(3*f);g>=0&&g<=1&&(u[m++]=g)}else{var T=(2*p*l-3*f*d)/(2*Math.sqrt(p*p*p)),N=Math.acos(T)/3,C=Math.sqrt(p),k=Math.cos(N),g=(-l-2*C*k)/(3*f),w=(-l+C*(k+r*Math.sin(N)))/(3*f),L=(-l+C*(k-r*Math.sin(N)))/(3*f);g>=0&&g<=1&&(u[m++]=g),w>=0&&w<=1&&(u[m++]=w),L>=0&&L<=1&&(u[m++]=L)}}return m}function p(e,t,n,r,i){var s=6*n-12*t+6*e,o=9*t+3*r-3*e-9*n,u=3*t-3*e,l=0;if(a(o)){if(f(s)){var c=-u/s;c>=0&&c<=1&&(i[l++]=c)}}else{var h=s*s-4*o*u;if(a(h))i[0]=-s/(2*o);else if(h>0){var p=Math.sqrt(h),c=(-s+p)/(2*o),d=(-s-p)/(2*o);c>=0&&c<=1&&(i[l++]=c),d>=0&&d<=1&&(i[l++]=d)}}return l}function d(e,t,n,r,i,s){var o=(t-e)*i+e,u=(n-t)*i+t,a=(r-n)*i+n,f=(u-o)*i+o,l=(a-u)*i+u,c=(l-f)*i+f;s[0]=e,s[1]=o,s[2]=f,s[3]=c,s[4]=c,s[5]=l,s[6]=a,s[7]=r}function v(e,r,i,a,f,c,h,p,d,v,m){var g,y=.005,b=Infinity;s[0]=d,s[1]=v;for(var w=0;w<1;w+=.05){o[0]=l(e,i,f,h,w),o[1]=l(r,a,c,p,w);var E=t.distSquare(s,o);E=0&&E=0&&c<=1&&(i[l++]=c)}}else{var h=o*o-4*s*u;if(a(h)){var c=-o/(2*s);c>=0&&c<=1&&(i[l++]=c)}else if(h>0){var p=Math.sqrt(h),c=(-o+p)/(2*s),d=(-o-p)/(2*s);c>=0&&c<=1&&(i[l++]=c),d>=0&&d<=1&&(i[l++]=d)}}return l}function b(e,t,n){var r=e+n-2*t;return r===0?.5:(e-t)/r}function w(e,r,i,a,f,l,c,h,p){var d,v=.005,g=Infinity;s[0]=c,s[1]=h;for(var y=0;y<1;y+=.05){o[0]=m(e,i,f,y),o[1]=m(r,a,l,y);var b=t.distSquare(s,o);b=0&&bt+u&&o>r+u||oe+u&&s>n+u||st+h&&c>i+h&&c>o+h&&c>a+h||ce+h&&l>r+h&&l>s+h&&l>u+h||lt+l&&f>i+l&&f>o+l||fe+l&&a>r+l&&a>s+l||an||h+ci&&(i+=f);var p=Math.atan2(a,u);return p<0&&(p+=f),p>=r&&p<=i||p+f>=r&&p+f<=i}function b(e,t,n,r){var t=Math.max(t,10);for(var i=0,s=e.length-1;in*n}function E(e,t,n,r,i,s){return i>=e&&i<=e+n&&s>=t&&s<=t+r}function S(e,t,n,r,i){return(r-e)*(r-e)+(i-t)*(i-t)=360)return!0;var r=(360-Math.atan2(n-e.y,t-e.x)/Math.PI*180)%360,i=(360+e.endAngle)%360,s=(360+e.startAngle)%360;return i>s?r>=s&&r<=i:!(r>=i&&r<=s)}function T(e,t,n){var r=e.length,i=0;for(var s=0,o=r-1;st&&s>r||si?o:0}function L(){var e=k[0];k[0]=k[1],k[1]=e}function A(e,t,r,i,s,o,u,a,f,l){if(l>t&&l>i&&l>o&&l>a||l1&&L(),d=n.cubicAt(t,i,o,a,k[0]),p>1&&(v=n.cubicAt(t,i,o,a,k[1]))),p==2?gt&&a>i&&a>o||a=0&&l<=1){var c=0,h=n.quadraticAt(t,i,o,l);for(var p=0;pu)continue;C[p]u?0:on||u<-n)return 0;var a=Math.sqrt(n*n-u*u);C[0]=-a,C[1]=a,s?(r=l(i),i=l(r)):(r=l(r),i=l(i)),r>i&&(i+=f);var c=0;for(var h=0;h<2;h++){var p=C[h];if(p+e>o){var d=Math.atan2(u,p),v=s?1:-1;d<0&&(d=f+d);if(d>=r&&d<=i||d+f>=r&&d+f<=i)d>Math.PI/2&&d0){h&&(s+=N(o,u,a,f,r,i));if(s!==0)return!0}a=b[b.length-2],f=b[b.length-1],l=!1}switch(d.command){case"M":o=b[0],u=b[1];break;case"L":if(c&&v(o,u,b[0],b[1],t,r,i))return!0;h&&(s+=N(o,u,b[0],b[1],r,i)),o=b[0],u=b[1];break;case"C":if(c&&m(o,u,b[0],b[1],b[2],b[3],b[4],b[5],t,r,i))return!0;h&&(s+=A(o,u,b[0],b[1],b[2],b[3],b[4],b[5],r,i)),o=b[4],u=b[5];break;case"Q":if(c&&g(o,u,b[0],b[1],b[2],b[3],t,r,i))return!0;h&&(s+=O(o,u,b[0],b[1],b[2],b[3],r,i)),o=b[2],u=b[3];break;case"A":var w=b[0],E=b[1],S=b[2],x=b[3],T=b[4],C=b[5],k=Math.cos(T)*S+w,L=Math.sin(T)*x+E;s+=N(o,u,k,L);var _=(r-w)*x/S+w;if(c&&y(w,E,x,T,T+C,1-b[7],t,_,i))return!0;h&&(s+=M(w,E,x,T,T+C,1-b[7],_,i)),o=Math.cos(T+C)*S+w,u=Math.sin(T+C)*x+E;break;case"z":if(c&&v(o,u,a,f,t,r,i))return!0;l=!0}}return h&&(s+=N(o,u,a,f,r,i)),s!==0}function D(e,n){var s=e+":"+n;if(i[s])return i[s];r=r||t.getContext(),r.save(),n&&(r.font=n),e=(e+"").split("\n");var u=0;for(var f=0,l=e.length;fa&&(o=0,i={}),u}function P(e,n){var i=e+":"+n;if(s[i])return s[i];r=r||t.getContext(),r.save(),n&&(r.font=n),e=(e+"").split("\n");var o=(r.measureText("国").width+2)*e.length;return r.restore(),s[i]=o,++u>a&&(u=0,s={}),o}var t=e("./util"),n=e("./curve"),r,i={},s={},o=0,u=0,a=5e3,f=Math.PI*2,C=[-1,-1,-1],k=[-1,-1];return{isInside:c,isOutside:d,getTextWidth:D,getTextHeight:P,isInsidePath:_,isInsidePolygon:T,isInsideSector:x,isInsideCircle:S,isInsideLine:v,isInsideRect:E,isInsideBrokenLine:b}}),r("zrender/mixin/Transformable",["require","../tool/matrix","../tool/vector"],function(e){function s(e){return e>-i&&ei||e<-i}var t=e("../tool/matrix"),n=e("../tool/vector"),r=[0,0],i=5e-5,u=function(){this.position||(this.position=[0,0]),typeof this.rotation=="undefined"&&(this.rotation=[0,0,0]),this.scale||(this.scale=[1,1,0,0]),this.needLocalTransform=!1,this.needTransform=!1};return u.prototype={constructor:u,updateNeedTransform:function(){this.needLocalTransform=o(this.rotation[0])||o(this.position[0])||o(this.position[1])||o(this.scale[0]-1)||o(this.scale[1]-1)},updateTransform:function(){this.updateNeedTransform(),this.parent?this.needTransform=this.needLocalTransform||this.parent.needTransform:this.needTransform=this.needLocalTransform;if(!this.needTransform)return;var e=this.transform||t.create();t.identity(e);if(this.needLocalTransform){if(o(this.scale[0])||o(this.scale[1])){r[0]=-this.scale[2]||0,r[1]=-this.scale[3]||0;var n=o(r[0])||o(r[1]);n&&t.translate(e,e,r),t.scale(e,e,this.scale),n&&(r[0]=-r[0],r[1]=-r[1],t.translate(e,e,r))}if(this.rotation instanceof Array){if(this.rotation[0]!==0){r[0]=-this.rotation[1]||0,r[1]=-this.rotation[2]||0;var n=o(r[0])||o(r[1]);n&&t.translate(e,e,r),t.rotate(e,e,this.rotation[0]),n&&(r[0]=-r[0],r[1]=-r[1],t.translate(e,e,r))}}else this.rotation!==0&&t.rotate(e,e,this.rotation);(o(this.position[0])||o(this.position[1]))&&t.translate(e,e,this.position)}this.transform=e,this.parent&&this.parent.needTransform&&(this.needLocalTransform?t.mul(this.transform,this.parent.transform,this.transform):t.copy(this.transform,this.parent.transform))},setTransform:function(e){if(this.needTransform){var t=this.transform;e.transform(t[0],t[1],t[2],t[3],t[4],t[5])}},lookAt:function(){var e=n.create();return function(r){this.transform||(this.transform=t.create());var i=this.transform;n.sub(e,r,this.position);if(s(e[0])&&s(e[1]))return;n.normalize(e,e),i[2]=e[0]*this.scale[1],i[3]=e[1]*this.scale[1],i[0]=e[1]*this.scale[0],i[1]=-e[0]*this.scale[0],i[4]=this.position[0],i[5]=this.position[1],this.decomposeTransform()}}(),decomposeTransform:function(){if(!this.transform)return;var e=this.transform,t=e[0]*e[0]+e[1]*e[1],n=this.position,r=this.scale,i=this.rotation;o(t-1)&&(t=Math.sqrt(t));var s=e[2]*e[2]+e[3]*e[3];o(s-1)&&(s=Math.sqrt(s)),n[0]=e[4],n[1]=e[5],r[0]=t,r[1]=s,r[2]=r[3]=0,i[0]=Math.atan2(-e[1]/s,e[0]/t),i[1]=i[2]=0}},u}),r("zrender/tool/color",["require","../tool/util"],function(e){function f(e){r=e}function l(){r=i}function c(e,t){return e|=0,t=t||r,t[e%t.length]}function h(e){s=e}function p(){o=s}function d(){return s}function v(e,r,i,s,o,u,a){n||(n=t.getContext());var f=n.createRadialGradient(e,r,i,s,o,u);for(var l=0,c=a.length;l1)for(var i=0,s=r-1;i1?Math.ceil(e):e});if(t.indexOf("hex")>-1)return"#"+((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1);if(t.indexOf("hs")>-1){var n=q(e.slice(1,3),function(e){return e+"%"});e[1]=n[0],e[2]=n[1]}return t.indexOf("a")>-1?(e.length===3&&e.push(1),e[3]=R(e[3],[0,1]),t+"("+e.slice(0,4).join(",")+")"):t+"("+e.slice(0,3).join(",")+")"}}function w(e){e=_(e),e.indexOf("rgba")<0&&(e=S(e));var t=[],n=0;return e.replace(/[\d.]+/g,function(e){n<3?e|=0:e=+e,t[n++]=e}),t}function E(e,t){var n=F(e),r=n[3];return typeof r=="undefined"&&(r=1),e.indexOf("hsb")>-1?n=U(n):e.indexOf("hsl")>-1&&(n=z(n)),t.indexOf("hsb")>-1||t.indexOf("hsv")>-1?n=X(n):t.indexOf("hsl")>-1&&(n=V(n)),n[3]=r,b(n,t)}function S(e){return E(e,"rgba")}function x(e){return E(e,"rgb")}function T(e){return E(e,"hex")}function N(e){return E(e,"hsva")}function C(e){return E(e,"hsv")}function k(e){return E(e,"hsba")}function L(e){return E(e,"hsb")}function A(e){return E(e,"hsla")}function O(e){return E(e,"hsl")}function M(e){for(var t in a)if(T(a[t])===T(e))return t;return null}function _(e){return String(e).replace(/\s+/g,"")}function D(e){a[e]&&(e=a[e]),e=_(e),e=e.replace(/hsv/i,"hsb");if(/^#[\da-f]{3}$/i.test(e)){e=parseInt(e.slice(1),16);var t=(e&3840)<<8,n=(e&240)<<4,r=e&15;e="#"+((1<<24)+(t<<4)+t+(n<<4)+n+(r<<4)+r).toString(16).slice(1)}return e}function P(e,t){var n=t>0?1:-1;typeof t=="undefined"&&(t=0),t=Math.abs(t)>1?1:Math.abs(t),e=x(e);var r=F(e);for(var i=0;i<3;i++)n===1?r[i]=r[i]*(1-t)|0:r[i]=(255-r[i])*t+r[i]|0;return"rgb("+r.join(",")+")"}function H(e){var t=F(S(e));return t=q(t,function(e){return 255-e}),b(t,"rgb")}function B(e,t,n){typeof n=="undefined"&&(n=.5),n=1-R(n,[0,1]);var r=n*2-1,i=F(S(e)),s=F(S(t)),o=i[3]-s[3],u=((r*o===-1?r:(r+o)/(1+r*o))+1)/2,a=1-u,f=[];for(var l=0;l<3;l++)f[l]=i[l]*u+s[l]*a;var c=i[3]*n+s[3]*(1-n);return c=Math.max(0,Math.min(1,c)),i[3]===1&&s[3]===1?b(f,"rgb"):(f[3]=c,b(f,"rgba"))}function j(){return"#"+Math.random().toString(16).slice(2,8)}function F(e){e=D(e);var t=e.match(u);if(t===null)throw new Error("The color format error");var n,r,i=[],s;if(t[2])n=t[2].replace("#","").split(""),s=[n[0]+n[1],n[2]+n[3],n[4]+n[5]],i=q(s,function(e){return R(parseInt(e,16),[0,255])});else if(t[4]){var o=t[4].split(",");r=o[3],s=o.slice(0,3),i=q(s,function(e){return e=Math.floor(e.indexOf("%")>0?parseInt(e,0)*2.55:e),R(e,[0,255])}),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}else if(t[5]||t[6]){var a=(t[5]||t[6]).split(","),f=parseInt(a[0],0)/360,l=a[1],c=a[2];r=a[3],i=q([l,c],function(e){return R(parseFloat(e)/100,[0,1])}),i.unshift(f),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}return i}function I(e,t){t===null&&(t=1);var n=F(S(e));return n[3]=R(Number(t).toFixed(4),[0,1]),b(n,"rgba")}function q(e,t){if(typeof t!="function")throw new TypeError;var n=e?e.length:0;for(var r=0;r=t[1]&&(e=t[1]),e}function U(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u=t*6;u===6&&(u=0);var a=u|0,f=r*(1-n),l=r*(1-n*(u-a)),c=r*(1-n*(1-(u-a))),h=0,p=0,d=0;a===0?(h=r,p=c,d=f):a===1?(h=l,p=r,d=f):a===2?(h=f,p=r,d=c):a===3?(h=f,p=l,d=r):a===4?(h=c,p=f,d=r):(h=r,p=f,d=l),i=h*255,s=p*255,o=d*255}return[i,s,o]}function z(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u;r<.5?u=r*(1+n):u=r+n-n*r;var a=2*r-u;i=255*W(a,u,t+1/3),s=255*W(a,u,t),o=255*W(a,u,t-1/3)}return[i,s,o]}function W(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function X(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=s,a,f;if(o===0)a=0,f=0;else{f=o/s;var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}function V(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=(s+i)/2,a,f;if(o===0)a=0,f=0;else{u<.5?f=o/(s+i):f=o/(2-s-i);var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}var t=e("../tool/util"),n,r=["#ff9277"," #dddd00"," #ffc877"," #bbe3ff"," #d5ffbb","#bbbbff"," #ddb000"," #b0dd00"," #e2bbff"," #ffbbe3","#ff7777"," #ff9900"," #83dd00"," #77e3ff"," #778fff","#c877ff"," #ff77ab"," #ff6600"," #aa8800"," #77c7ff","#ad77ff"," #ff77ff"," #dd0083"," #777700"," #00aa00","#0088aa"," #8400dd"," #aa0088"," #dd0000"," #772e00"],i=r,s="rgba(255,255,0,0.5)",o=s,u=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,a={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#789",lightslategrey:"#789",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#f0f",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"};return{customPalette:f,resetPalette:l,getColor:c,getHighlightColor:d,customHighlight:h,resetHighlight:p,getRadialGradient:v,getLinearGradient:m,getGradientColors:y,getStepColors:g,reverse:H,mix:B,lift:P,trim:_,random:j,toRGB:x,toRGBA:S,toHex:T,toHSL:O,toHSLA:A,toHSB:L,toHSBA:k,toHSV:C,toHSVA:N,toName:M,toColor:b,toArray:w,alpha:I,getData:F}}),r("zrender/shape/Base",["require","../tool/matrix","../tool/guid","../tool/util","../tool/log","../mixin/Transformable","../mixin/Eventful","../tool/area","../tool/area","../tool/color","../tool/area"],function(e){function u(t,n,r,i,s,o,u){s&&(t.font=s),t.textAlign=o,t.textBaseline=u;var f=a(n,r,i,s,o,u);n=(n+"").split("\n");var l=e("../tool/area").getTextHeight("国",s);switch(u){case"top":i=f.y;break;case"bottom":i=f.y+l;break;default:i=f.y+l/2}for(var c=0,h=n.length;c0&&e.stroke();break;default:e.fill()}this.drawText(e,n,this.style),e.restore()};var l=[["color","fillStyle"],["strokeColor","strokeStyle"],["opacity","globalAlpha"],["lineCap","lineCap"],["lineJoin","lineJoin"],["miterLimit","miterLimit"],["lineWidth","lineWidth"],["shadowBlur","shadowBlur"],["shadowColor","shadowColor"],["shadowOffsetX","shadowOffsetX"],["shadowOffsetY","shadowOffsetY"]];return f.prototype.setContext=function(e,t){for(var n=0,r=l.length;n=i.x&&t<=i.x+i.width&&n>=i.y&&n<=i.y+i.height?e("../tool/area").isInside(this,this.style,t,n):!1},f.prototype.drawText=function(e,t,n){if(typeof t.text=="undefined"||t.text===!1)return;var r=t.textColor||t.color||t.strokeColor;e.fillStyle=r;var i=10,s,o,a,f,l=t.textPosition||this.textPosition||"top";switch(l){case"inside":case"top":case"bottom":case"left":case"right":if(this.getRect){var c=(n||t).__rect||this.getRect(n||t);switch(l){case"inside":a=c.x+c.width/2,f=c.y+c.height/2,s="center",o="middle",t.brushType!="stroke"&&r==t.color&&(e.fillStyle="#fff");break;case"left":a=c.x-i,f=c.y+c.height/2,s="end",o="middle";break;case"right":a=c.x+c.width+i,f=c.y+c.height/2,s="start",o="middle";break;case"top":a=c.x+c.width/2,f=c.y-i,s="center",o="bottom";break;case"bottom":a=c.x+c.width/2,f=c.y+c.height+i,s="center",o="top"}}break;case"start":case"end":var h,p,d,v;if(typeof t.pointList!="undefined"){var m=t.pointList;if(m.length<2)return;var g=m.length;switch(l){case"start":h=m[0][0],p=m[1][0],d=m[0][1],v=m[1][1];break;case"end":h=m[g-2][0],p=m[g-1][0],d=m[g-2][1],v=m[g-1][1]}}else h=t.xStart||0,p=t.xEnd||0,d=t.yStart||0,v=t.yEnd||0;switch(l){case"start":s=hi&&(c=u+a,u*=i/c,a*=i/c),f+l>i&&(c=f+l,f*=i/c,l*=i/c),a+f>s&&(c=a+f,a*=s/c,f*=s/c),u+l>s&&(c=u+l,u*=s/c,l*=s/c),e.moveTo(n+u,r),e.lineTo(n+i-a,r),a!==0&&e.quadraticCurveTo(n+i,r,n+i,r+a),e.lineTo(n+i,r+s-f),f!==0&&e.quadraticCurveTo(n+i,r+s,n+i-f,r+s),e.lineTo(n+l,r+s),l!==0&&e.quadraticCurveTo(n,r+s,n,r+s-l),e.lineTo(n,r+u),u!==0&&e.quadraticCurveTo(n,r,n+u,r)},buildPath:function(e,t){t.radius?this._buildRadiusPath(e,t):(e.moveTo(t.x,t.y),e.lineTo(t.x+t.width,t.y),e.lineTo(t.x+t.width,t.y+t.height),e.lineTo(t.x,t.y+t.height),e.lineTo(t.x,t.y)),e.closePath();return},getRect:function(e){if(e.__rect)return e.__rect;var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,e.__rect={x:Math.round(e.x-t/2),y:Math.round(e.y-t/2),width:e.width+t,height:e.height+t},e.__rect}},e("../tool/util").inherits(n,t),n}),r("zrender/loadingEffect/Base",["require","../tool/util","../shape/Text","../shape/Rectangle"],function(e){function o(e){this.setOptions(e)}var t=e("../tool/util"),n=e("../shape/Text"),r=e("../shape/Rectangle"),i="Loading...",s="normal 16px Arial";return o.prototype.createTextShape=function(e){return new n({highlightStyle:t.merge({x:this.canvasWidth/2,y:this.canvasHeight/2,text:i,textAlign:"center",textBaseline:"middle",textFont:s,color:"#333",brushType:"fill"},e,!0)})},o.prototype.createBackgroundShape=function(e){return new r({highlightStyle:{x:0,y:0,width:this.canvasWidth,height:this.canvasHeight,brushType:"fill",color:e}})},o.prototype.start=function(e){function t(t){e.storage.addHover(t)}function n(){e.refreshHover()}this.canvasWidth=e._width,this.canvasHeight=e._height,this.loadingTimer=this._start(t,n)},o.prototype._start=function(){return setInterval(function(){},1e4)},o.prototype.stop=function(){clearInterval(this.loadingTimer)},o.prototype.setOptions=function(e){this.options=e||{}},o.prototype.adjust=function(e,t){return e<=t[0]?e=t[0]:e>=t[1]&&(e=t[1]),e},o.prototype.getLocation=function(e,t,n){var r=e.x!=null?e.x:"center";switch(r){case"center":r=Math.floor((this.canvasWidth-t)/2);break;case"left":r=0;break;case"right":r=this.canvasWidth-t}var i=e.y!=null?e.y:"center";switch(i){case"center":i=Math.floor((this.canvasHeight-n)/2);break;case"top":i=0;break;case"bottom":i=this.canvasHeight-n}return{x:r,y:i,width:t,height:n}},o}),r("zrender/shape/Image",["require","./Base","../tool/util"],function(e){var t=[],n,r=e("./Base"),i=function(e){r.call(this,e),this._imageCache={}};return i.prototype={type:"image",brush:function(e,r,i){var s=this.style||{};r&&(s=this.getHighlightStyle(s,this.highlightStyle||{}));var o=s.image,u=this;if(typeof o=="string"){var a=o;this._imageCache[a]?o=this._imageCache[a]:(o=new Image,o.onload=function(){o.onload=null,clearTimeout(n),t.push(u),n=setTimeout(function(){i&&i(t),t=[]},10)},o.src=a,this._imageCache[a]=o)}if(o){if(o.nodeName.toUpperCase()=="IMG")if(window.ActiveXObject){if(o.readyState!="complete")return}else if(!o.complete)return;var f=s.width||o.width,l=s.height||o.height,c=s.x,h=s.y;if(!o.width||!o.height)return;e.save(),this.setContext(e,s),this.setTransform(e);if(s.sWidth&&s.sHeight){var p=s.sx||0,d=s.sy||0;e.drawImage(o,p,d,s.sWidth,s.sHeight,c,h,f,l)}else if(s.sx&&s.sy){var p=s.sx,d=s.sy,v=f-p,m=l-d;e.drawImage(o,p,d,v,m,c,h,f,l)}else e.drawImage(o,c,h,f,l);s.width||(s.width=f),s.height||(s.height=l),this.style.width||(this.style.width=f),this.style.height||(this.style.height=l),this.drawText(e,s,this.style),e.restore()}},getRect:function(e){return{x:e.x,y:e.y,width:e.width,height:e.height}},clearCache:function(){this._imageCache={}}},e("../tool/util").inherits(i,r),i}),r("zrender/Painter",["require","./config","./tool/util","./tool/log","./tool/matrix","./loadingEffect/Base","./mixin/Transformable","./shape/Image"],function(e){function f(){return!1}function l(){}function h(e,t,n){var r=document.createElement(t),i=n._width,s=n._height;return r.style.position="absolute",r.style.left=0,r.style.top=0,r.style.width=i+"px",r.style.height=s+"px",r.setAttribute("width",i*u),r.setAttribute("height",s*u),r.setAttribute("data-zr-dom-id",e),r}var t=e("./config"),n=e("./tool/util"),r=e("./tool/log"),i=e("./tool/matrix"),s=e("./loadingEffect/Base"),o=e("./mixin/Transformable"),u=window.devicePixelRatio||1;u=Math.max(u,1);var a=window.G_vmlCanvasManager,c=function(e,t){this.root=e,this.storage=t,e.innerHTML="",this._width=this._getWidth(),this._height=this._getHeight();var n=document.createElement("div");this._domRoot=n,n.style.position="relative",n.style.overflow="hidden",n.style.width=this._width+"px",n.style.height=this._height+"px",e.appendChild(n),this._layers={},this._layerConfig={},this._loadingEffect=new s({}),this.shapeToImage=this._createShapeToImageProcessor(),this._bgDom=h("bg","div",this),n.appendChild(this._bgDom),this._bgDom.onselectstart=f,this._bgDom.style["-webkit-user-select"]="none",this._bgDom.style["user-select"]="none";var r=new p("_zrender_hover_",this);this._layers.hover=r,n.appendChild(r.dom),r.initContext(),r.dom.onselectstart=f,r.dom.style["-webkit-user-select"]="none",r.dom.style["user-select"]="none";var i=this;this.updatePainter=function(e,t){i.refreshShapes(e,t)}};c.prototype.render=function(e){return this.isLoading()&&this.hideLoading(),this.refresh(e,!0),this},c.prototype.refresh=function(e,t){var n=this.storage.getShapeList(!0);return this._paintList(n,t),typeof e=="function"&&e(),this},c.prototype._paintList=function(e,n){typeof n=="undefined"&&(n=!1),this._updateLayerStatus(e);var s,o,u;for(var f in this._layers)f!=="hover"&&(this._layers[f].unusedCount++,this._layers[f].updateTransform());var l=[];for(var c=0,h=e.length;c0},s.prototype.addRoot=function(e){e instanceof n&&e.addChildrenToStorage(this),this.addToMap(e),this._roots.push(e)},s.prototype.delRoot=function(e){if(typeof e=="undefined"){for(var r=0;r=0&&(this.delFromMap(o.id),this._roots.splice(u,1),o instanceof n&&o.delChildrenFromStorage(this))},s.prototype.addToMap=function(e){return e instanceof n&&(e._storage=this),e.modSelf(),this._elements[e.id]=e,this},s.prototype.get=function(e){return this._elements[e]},s.prototype.delFromMap=function(e){var t=this._elements[e];return t&&(delete this._elements[e],t instanceof n&&(t._storage=null)),this},s.prototype.dispose=function(){this._elements=this._renderList=this._roots=this._hoverElements=null},s}),r("zrender/animation/easing",[],function(){var e={Linear:function(e){return e},QuadraticIn:function(e){return e*e},QuadraticOut:function(e){return e*(2-e)},QuadraticInOut:function(e){return(e*=2)<1?.5*e*e:-0.5*(--e*(e-2)-1)},CubicIn:function(e){return e*e*e},CubicOut:function(e){return--e*e*e+1},CubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},QuarticIn:function(e){return e*e*e*e},QuarticOut:function(e){return 1- --e*e*e*e},QuarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-0.5*((e-=2)*e*e*e-2)},QuinticIn:function(e){return e*e*e*e*e},QuinticOut:function(e){return--e*e*e*e*e+1},QuinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},SinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},SinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},SinusoidalInOut:function(e){return.5*(1-Math.cos(Math.PI*e))},ExponentialIn:function(e){return e===0?0:Math.pow(1024,e-1)},ExponentialOut:function(e){return e===1?1:1-Math.pow(2,-10*e)},ExponentialInOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)},CircularIn:function(e){return 1-Math.sqrt(1-e*e)},CircularOut:function(e){return Math.sqrt(1- --e*e)},CircularInOut:function(e){return(e*=2)<1?-0.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},ElasticIn:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),-(n*Math.pow(2,10*(e-=1))*Math.sin((e-t)*2*Math.PI/r)))},ElasticOut:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*e)*Math.sin((e-t)*2*Math.PI/r)+1)},ElasticInOut:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),(e*=2)<1?-0.5*n*Math.pow(2,10*(e-=1))*Math.sin((e-t)*2*Math.PI/r):n*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*2*Math.PI/r)*.5+1)},BackIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},BackOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},BackInOut:function(e){var t=2.5949095;return(e*=2)<1?.5*e*e*((t+1)*e-t):.5*((e-=2)*e*((t+1)*e+t)+2)},BounceIn:function(t){return 1-e.BounceOut(1-t)},BounceOut:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},BounceInOut:function(t){return t<.5?e.BounceIn(t*2)*.5:e.BounceOut(t*2-1)*.5+.5}};return e}),r("zrender/animation/Clip",["require","./easing"],function(e){function n(e){this._targetPool=e.target||{},this._targetPool instanceof Array||(this._targetPool=[this._targetPool]),this._life=e.life||1e3,this._delay=e.delay||0,this._startTime=(new Date).getTime()+this._delay,this._endTime=this._startTime+this._life*1e3,this.loop=typeof e.loop=="undefined"?!1:e.loop,this.gap=e.gap||0,this.easing=e.easing||"Linear",this.onframe=e.onframe,this.ondestroy=e.ondestroy,this.onrestart=e.onrestart}var t=e("./easing");return n.prototype={step:function(e){var n=(e-this._startTime)/this._life;if(n<0)return;n=Math.min(n,1);var r=typeof this.easing=="string"?t[this.easing]:this.easing,i=typeof r=="function"?r(n):n;return this.fire("frame",i),n==1?this.loop?(this.restart(),"restart"):(this._needsRemove=!0,"destroy"):null},restart:function(){var e=(new Date).getTime(),t=(e-this._startTime)%this._life;this._startTime=(new Date).getTime()-t+this.gap},fire:function(e,t){for(var n=0,r=this._targetPool.length;n=0&&this._clips.splice(t,1)},_update:function(){var e=(new Date).getTime(),t=e-this._time,n=this._clips,r=n.length,i=[],s=[];for(var o=0;o=0;N--)if(x[N]<=t)break;N=Math.min(N,g-2)}else{for(N=k;Nt)break;N=Math.min(N-1,g-2)}k=N,L=t;var n=x[N+1]-x[N];if(n===0)return;O=(t-x[N])/n;if(u){_=T[N],M=T[N===0?N:N-1],D=T[N>g-2?g-1:N+1],P=T[N>g-3?g-1:N+2];if(b)p(M,_,D,P,O,O*O,O*O*O,s(e,v),E);else{var a;w?(a=p(M,_,D,P,O,O*O,O*O*O,H,1),a=m(H)):a=d(M,_,D,P,O,O*O,O*O*O),i(e,v,a)}}else if(b)c(T[N],T[N+1],O,s(e,v),E);else{var a;w?(c(T[N],T[N+1],O,H,1),a=m(H)):a=l(T[N],T[N+1],O),i(e,v,a)}for(N=0;N1?"."+e[1]:""))}return{parsePercent:t,parseCenter:n,parseRadius:r,addCommas:i}}),r("echarts/component/base",["require","../config","../util/ecQuery","../util/number","zrender/tool/util","zrender/tool/env"],function(e){function s(e,t,n,r,i){this.ecTheme=e,this.messageCenter=t,this.zr=n,this.option=r,this.series=r.series,this.myChart=i,this.component=i.component,this._zlevelBase=this.getZlevelBase(),this.shapeList=[],this.effectList=[];var s=this;s.hoverConnect=function(e){var t=(e.target||{}).hoverConnect;if(t){var n=10,r;if(t instanceof Array)for(var i=0,o=t.length;i4?a*r(2*i/s)/r(i/s):a/3);var l=i/s,c=-i/2,h=o+a*r(c),p=u+a*n(c);c+=l;var d=t.pointList=[];d.push([h,p]);for(var v=0,m=s*2-1,g;v=r.x-i&&e<=r.x+r.width+i&&t>=r.y-i&&t<=r.y+r.height+i?!0:!1}},t.inherits(C,N),C}),r("zrender/shape/util/dashedLineTo",[],function(){var e=[5,5];return function(t,n,r,i,s,o){if(t.setLineDash){e[0]=e[1]=o,t.setLineDash(e),t.moveTo(n,r),t.lineTo(i,s);return}o=typeof o!="number"?5:o;var u=i-n,a=s-r,f=Math.floor(Math.sqrt(u*u+a*a)/o);u/=f,a/=f;var l=!0;for(var c=0;cs-2?s-1:c+1],m=e[c>s-3?s-1:c+2]);var g=h*h,y=h*g;o.push([n(p[0],d[0],v[0],m[0],h,g,y),n(p[1],d[1],v[1],m[1],h,g,y)])}return o}}),r("zrender/shape/util/smoothBezier",["require","../../tool/vector"],function(e){var t=e("../../tool/vector");return function(e,n,r,i){var s=[],o=[],u=[],a=[],f,l,c=!!i,h,p;if(c){h=[Infinity,Infinity],p=[-Infinity,-Infinity];for(var d=0,v=e.length;d0&&(n.brushType=="stroke"||n.brushType=="both")&&(r||(e.beginPath(),this.buildPath(e,n)),e.stroke()),this.drawText(e,n,this.style),e.restore();return},buildPath:function(e,t){var s=t.pointList;if(s.length<2)return;if(t.smooth&&t.smooth!=="spline"){var o=r(s,t.smooth,!0,t.smoothConstraint);e.moveTo(s[0][0],s[0][1]);var u,a,f,l=s.length;for(var c=0;cn&&(n=s[o][0]),s[o][1]i&&(i=s[o][1]);var a;return e.brushType=="stroke"||e.brushType=="fill"?a=e.lineWidth||1:a=0,e.__rect={x:Math.round(t-a/2),y:Math.round(r-a/2),width:n-t+a,height:i-r+a},e.__rect}},e("../tool/util").inherits(s,t),s}),r("zrender/shape/BrokenLine",["require","./Base","./util/smoothSpline","./util/smoothBezier","./util/dashedLineTo","./Polygon","../tool/util"],function(e){var t=e("./Base"),n=e("./util/smoothSpline"),r=e("./util/smoothBezier"),i=e("./util/dashedLineTo"),s=function(e){this.brushTypeOnly="stroke",this.textPosition="end",t.call(this,e)};return s.prototype={type:"broken-line",buildPath:function(e,t){var s=t.pointList;if(s.length<2)return;var o=Math.min(t.pointList.length,Math.round(t.pointListLength||t.pointList.length));if(t.smooth&&t.smooth!=="spline"){var u=r(s,t.smooth,!1,t.smoothConstraint);e.moveTo(s[0][0],s[0][1]);var a,f,l;for(var c=0;cs?a>u?l=Math.PI*2-l+f:l+=f:a>u?l+=Math.PI-f:l=Math.PI-l-f:s>o?u>a?l=Math.PI*2-l+f:l+=f:u>a?l+=Math.PI-f:l=Math.PI-l-f;var c=Math.PI/8,h=n===0?s:o,p=n===0?u:a,d=[[h+i*Math.cos(l-c),p-i*Math.sin(l-c)],[h+i*.6*Math.cos(l),p-i*.6*Math.sin(l)],[h+i*Math.cos(l+c),p-i*Math.sin(l+c)]];e.moveTo(h,p);for(var v=0,m=d.length;v=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height?this.style.smooth!=="spline"?a.isInside(i,this.style,e,t):a.isInside(o,this.style,e,t):!1}},c.inherits(h,t),h}),r("echarts/util/shape/normalIsCover",[],function(){return function(e,t){var n=this.getTansform(e,t);e=n[0],t=n[1];var r=this.style.__rect;return r||(r=this.style.__rect=this.getRect(this.style)),e>=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height}}),r("echarts/util/shape/Symbol",["require","zrender/shape/Base","zrender/shape/Polygon","zrender/tool/util","./normalIsCover"],function(e){function s(e){t.call(this,e)}var t=e("zrender/shape/Base"),n=e("zrender/shape/Polygon"),r=new n({}),i=e("zrender/tool/util");return s.prototype={type:"symbol",buildPath:function(e,t){var n=t.pointList,r=n.length;if(r===0)return;var i=1e4,s=Math.ceil(r/i),o,u,a=n[0]instanceof Array,f=t.size?t.size:2,l=f,c=f/2,h=Math.PI*2,p,d,v;for(var m=0;mr?r:u;for(var g=o;g0&&e.stroke();break;case"stroke":t.lineWidth>0&&e.stroke();break;default:e.fill()}}},getRect:function(e){return e.__rect||r.getRect(e)},isCover:e("./normalIsCover")},i.inherits(s,t),s}),r("echarts/util/ecData",[],function(){function e(e,t,n,r,i,s,o,u){var a;return typeof r!="undefined"&&(a=r.value==null?r:r.value),e._echartsData={_series:t,_seriesIndex:n,_data:r,_dataIndex:i,_name:s,_value:a,_special:o,_special2:u},e._echartsData}function t(e,t){var n=e._echartsData;if(!t)return n;switch(t){case"series":case"seriesIndex":case"data":case"dataIndex":case"name":case"value":case"special":case"special2":return n&&n["_"+t]}return null}function n(e,t,n){e._echartsData=e._echartsData||{};switch(t){case"series":case"seriesIndex":case"data":case"dataIndex":case"name":case"value":case"special":case"special2":e._echartsData["_"+t]=n}}function r(e,t){t._echartsData={_series:e._echartsData._series,_seriesIndex:e._echartsData._seriesIndex,_data:e._echartsData._data,_dataIndex:e._echartsData._dataIndex,_name:e._echartsData._name,_value:e._echartsData._value,_special:e._echartsData._special,_special2:e._echartsData._special2}}return{pack:e,set:n,get:t,clone:r}}),r("echarts/util/ecAnimation",["require","zrender/tool/util","zrender/shape/Polygon"],function(e){function n(e,n,r,i,s){var o=r.style.pointList,u=o.length,a;if(!n){a=[];if(r._orient!="vertical"){var f=o[0][1];for(var l=0;l1?t.symbol:[t.symbol[0],t.symbol[0]]:[t.symbol,t.symbol],t.symbolSize=t.symbolSize instanceof Array?t.symbolSize.length>1?t.symbolSize:[t.symbolSize[0],t.symbolSize[0]]:[t.symbolSize,t.symbolSize],t.symbolRotate=t.symbolRotate instanceof Array?t.symbolRotate.length>1?t.symbolRotate:[t.symbolRotate[0],t.symbolRotate[0]]:[t.symbolRotate,t.symbolRotate],t.name=n.name;var i=[],u=t.data,a,f=r.dataRange,c=r.legend,h,p,d,v,m,g,y=this.zr.getWidth(),b=this.zr.getHeight(),w;for(var E=0,S=u.length;E "+u[E][1].name:""),p),i.push(a)}return i},getMarkCoord:function(){return[0,0]},getSymbolShape:function(e,r,i,s,u,a,f,l,c,h,p){var d=[i,e],v=i!=null?i.value!=null?i.value:i:"-";l=this.deepQuery(d,"symbol")||l;var m=this.deepQuery(d,"symbolSize");m=typeof m=="function"?m(v):m;var g=this.deepQuery(d,"symbolRotate"),y=this.deepMerge(d,"itemStyle.normal"),b=this.deepMerge(d,"itemStyle.emphasis"),w=y.borderWidth!=null?y.borderWidth:y.lineStyle&&y.lineStyle.width;w==null&&(w=l.match("empty")?2:0);var E=b.borderWidth!=null?b.borderWidth:b.lineStyle&&b.lineStyle.width;E==null&&(E=w+2);var S=new n({style:{iconType:l.replace("empty","").toLowerCase(),x:a-m,y:f-m,width:m*2,height:m*2,brushType:"both",color:l.match("empty")?h:this.getItemStyleColor(y.color,r,s,i)||c,strokeColor:y.borderColor||this.getItemStyleColor(y.color,r,s,i)||c,lineWidth:w},highlightStyle:{color:l.match("empty")?h:this.getItemStyleColor(b.color,r,s,i),strokeColor:b.borderColor||y.borderColor||this.getItemStyleColor(y.color,r,s,i)||c,lineWidth:E},clickable:this.deepQuery(d,"clickable")});return l.match("image")&&(S.style.image=l.replace(new RegExp("^image:\\/\\/"),""),S=new t({style:S.style,highlightStyle:S.highlightStyle,clickable:this.deepQuery(d,"clickable")})),g!=null&&(S.rotation=[g*Math.PI/180,a,f]),l.match("star")&&(S.style.iconType="star",S.style.n=l.replace("empty","").replace("star","")-0||5),l==="none"&&(S.invisible=!0,S.hoverable=!1),S=this.addLabel(S,e,i,u,p),l.match("empty")&&(S.style.textColor==null&&(S.style.textColor=S.style.strokeColor),S.highlightStyle.textColor==null&&(S.highlightStyle.textColor=S.highlightStyle.strokeColor)),o.pack(S,e,r,i,s,u),S._x=a,S._y=f,S._dataIndex=s,S._seriesIndex=r,S},getLineMarkShape:function(e,t,n,i,s,o,u,a,f){var l=n[0]!=null?n[0].value!=null?n[0].value:n[0]:"-",c=n[1]!=null?n[1].value!=null?n[1].value:n[1]:"-",h=[this.query(n[0],"symbol")||e.symbol[0],this.query(n[1],"symbol")||e.symbol[1]],p=[this.query(n[0],"symbolSize")||e.symbolSize[0],this.query(n[1],"symbolSize")||e.symbolSize[1]];p[0]=typeof p[0]=="function"?p[0](l):p[0],p[1]=typeof p[1]=="function"?p[1](c):p[1];var d=[this.query(n[0],"symbolRotate")||e.symbolRotate[0],this.query(n[1],"symbolRotate")||e.symbolRotate[1]],v=[n[0],e],m=this.deepMerge(v,"itemStyle.normal");m.color=this.getItemStyleColor(m.color,t,i,n);var g=this.deepMerge(v,"itemStyle.emphasis");g.color=this.getItemStyleColor(g.color,t,i,n);var y=m.lineStyle,b=g.lineStyle,w=y.width;w==null&&(w=m.borderWidth);var E=b.width;E==null&&(E=g.borderWidth!=null?g.borderWidth:w+2);var S=new r({style:{smooth:e.smooth?"spline":!1,symbol:h,symbolSize:p,symbolRotate:d,xStart:s,yStart:o,xEnd:u,yEnd:a,brushType:"both",lineType:y.type,shadowColor:y.shadowColor||y.color||m.borderColor||m.color||f,shadowBlur:y.shadowBlur,shadowOffsetX:y.shadowOffsetX,shadowOffsetY:y.shadowOffsetY,color:m.color||f,strokeColor:y.color||m.borderColor||m.color||f,lineWidth:w,symbolBorderColor:m.borderColor||m.color||f,symbolBorder:m.borderWidth},highlightStyle:{shadowColor:b.shadowColor,shadowBlur:b.shadowBlur,shadowOffsetX:b.shadowOffsetX,shadowOffsetY:b.shadowOffsetY,color:g.color||m.color||f,strokeColor:b.color||y.color||g.borderColor||m.borderColor||g.color||m.color||f,lineWidth:E,symbolBorderColor:g.borderColor||m.borderColor||g.color||m.color||f,symbolBorder:g.borderWidth==null?m.borderWidth+2:g.borderWidth},clickable:this.deepQuery(v,"clickable")});return S=this.addLabel(S,e,n[0],n[0].name+" : "+n[1].name),S._x=u,S._y=a,S},getLargeMarkPoingShape:function(e,t){var n=this.series[e],r=this.component,s=t.data,o,u=r.dataRange,a=r.legend,f,l,c=[s[0],t],h,p,d;a&&(f=a.getColor(n.name));if(u){l=s[0]!=null?s[0].value!=null?s[0].value:s[0]:"-",f=isNaN(l)?f:u.getColor(l),h=this.deepQuery(c,"itemStyle.normal.color")||f,p=this.deepQuery(c,"itemStyle.emphasis.color")||h;if(h==null&&p==null)return}f=this.deepMerge(c,"itemStyle.normal").color||f;var v=this.deepQuery(c,"symbol")||"circle";v=v.replace("empty","").replace(/\d/g,""),d=this.deepMerge([s[0],t],"effect");var m=window.devicePixelRatio||1;return o=new i({style:{pointList:s,color:f,strokeColor:f,shadowColor:d.shadowColor||f,shadowBlur:(d.shadowBlur!=null?d.shadowBlur:8)*m,size:this.deepQuery(c,"symbolSize"),iconType:v,brushType:"fill",lineWidth:1},draggable:!1,hoverable:!1}),d.show&&(o.effect=d),o},backupShapeList:function(){this.shapeList&&this.shapeList.length>0?(this.lastShapeList=this.shapeList,this.shapeList=[]):this.lastShapeList=[]},addShapeList:function(){var e=this.option.animationThreshold/(this.canvasSupported?2:4),t=this.lastShapeList,n=this.shapeList,r=t.length>0?500:this.query(this.option,"animationDuration"),i=this.query(this.option,"animationEasing"),s,o={},u={};if(this.option.animation&&!this.option.renderAsImage&&n.length500?u.candle(this.zr,e,t,n,r):this.zr.addShape(t);break;case"ring":case"sector":case"circle":n>500?u.ring(this.zr,e,t,n+(o.get(t,"dataIndex")||0)%20*100,r):t.type==="sector"?u.sector(this.zr,e,t,n,r):this.zr.addShape(t);break;case"text":u.text(this.zr,e,t,n,r);break;case"polygon":n>500?u.polygon(this.zr,e,t,n,r):u.pointList(this.zr,e,t,n,r);break;case"chord":u.chord(this.zr,e,t,n,r);break;case"gauge-pointer":u.gaugePointer(this.zr,e,t,n,r);break;case"mark-line":u.markline(this.zr,e,t,n,r);break;case"line":u.line(this.zr,e,t,n,r);break;default:this.zr.addShape(t)}},animationMark:function(e,t,n){var r=n||this.shapeList;for(var i=0,s=r.length;i0&&(e&&this.zr.modLayer(s.EFFECT_ZLEVEL,{motionBlur:!1}),this.zr.delShape(this.effectList)),this.effectList=[]},addMark:function(e,t,n){var r=this.series[e];if(this.selectedMap[r.name]){var i=500,s=this.query(this.option,"animationEasing"),o=r[n].data,u=this.shapeList.length;r[n].data=t.data,this["_build"+n.replace("m","M")](e);if(this.option.animation&&!this.option.renderAsImage)this.animationMark(i,s,this.shapeList.slice(u));else{for(var a=u,f=this.shapeList.length;a0?-1:1,t.style.r-=r,t.style.r=t.style.r<5?5:t.style.r;var i=s.get(t,"value"),o=i*f.option.island.calculateStep;o>1?i=Math.round(i-o*r):i=(i-o*r).toFixed(2)-0;var a=s.get(t,"name");t.style.text=a+":"+i,s.set(t,"value",i),s.set(t,"name",a),f.zr.modShape(t.id),f.zr.refresh(),u.stop(n)}}var t=e("../component/base"),n=e("./base"),r=e("zrender/shape/Circle"),i=e("../config"),s=e("../util/ecData"),o=e("zrender/tool/util"),u=e("zrender/tool/event");return a.prototype={type:i.CHART_TYPE_ISLAND,_combine:function(t,n){var r=e("zrender/tool/color"),i=e("../util/accMath"),o=i.accAdd(s.get(t,"value"),s.get(n,"value")),u=s.get(t,"name")+this._nameConnector+s.get(n,"name");t.style.text=u+this._valueConnector+o,s.set(t,"value",o),s.set(t,"name",u),t.style.r=this.option.island.r,t.style.color=r.mix(t.style.color,n.style.color)},refresh:function(e){e&&(e.island=this.reformOption(e.island),this.option=e,this._nameConnector=this.option.nameConnector,this._valueConnector=this.option.valueConnector)},getOption:function(){return this.option},resize:function(){var e=this.zr.getWidth(),t=this.zr.getHeight(),n=e/(this._zrWidth||e),r=t/(this._zrHeight||t);if(n===1&&r===1)return;this._zrWidth=e,this._zrHeight=t;for(var i=0,s=this.shapeList.length;i'+(t[0]||this._lang[0])+"

",this._textArea.style.cssText="display:block;margin:0 0 8px 0;padding:4px 6px;overflow:auto;width:"+(this._zrWidth-15)+"px;"+"height:"+(this._zrHeight-100)+"px;";var n=this.query(this.option,"toolbox.feature.dataView.optionToContent");typeof n!="function"?this._textArea.value=this._optionToContent():this._textArea.value=n(this.option),this._tDom.appendChild(this._textArea),this._buttonClose.style.cssText="float:right;padding:1px 6px;",this._buttonClose.innerHTML=t[1]||this._lang[1];var r=this;this._buttonClose.onclick=function(){r.hide()},this._tDom.appendChild(this._buttonClose),this.query(this.option,"toolbox.feature.dataView.readOnly")===!1?(this._buttonRefresh.style.cssText="float:right;margin-right:10px;padding:1px 6px;",this._buttonRefresh.innerHTML=t[2]||this._lang[2],this._buttonRefresh.onclick=function(){r._save()},this._tDom.appendChild(this._buttonRefresh),this._textArea.readOnly=!1,this._textArea.style.cursor="default"):(this._textArea.readOnly=!0,this._textArea.style.cursor="text"),this._sizeCssText="width:"+this._zrWidth+"px;"+"height:"+this._zrHeight+"px;"+"background-color:#fff;",this._tDom.style.cssText=this._gCssText+this._sizeCssText},_optionToContent:function(){var e,t,r,i,s,o,u=[],a="";if(this.option.xAxis){this.option.xAxis instanceof Array?u=this.option.xAxis:u=[this.option.xAxis];for(e=0,i=u.length;e10&&(this._sizeCssText="width:"+this._zrWidth+"px;"+"height:"+this._zrHeight+"px;"+"background-color:#fff;",this._tDom.style.cssText=this._gCssText+this._sizeCssText,this._textArea.style.cssText="display:block;margin:0 0 8px 0;padding:4px 6px;overflow:auto;width:"+(this._zrWidth-15)+"px;"+"height:"+(this._zrHeight-100)+"px;")},dispose:function(){window.removeEventListener?(this._tDom.removeEventListener("click",this._stop),this._tDom.removeEventListener("mousewheel",this._stop),this._tDom.removeEventListener("mousemove",this._stop),this._tDom.removeEventListener("mousedown",this._stop),this._tDom.removeEventListener("mouseup",this._stop),this._tDom.removeEventListener("touchstart",this._stop),this._tDom.removeEventListener("touchmove",this._stop),this._tDom.removeEventListener("touchend",this._stop)):(this._tDom.detachEvent("onclick",this._stop),this._tDom.detachEvent("onmousewheel",this._stop),this._tDom.detachEvent("onmousemove",this._stop),this._tDom.detachEvent("onmousedown",this._stop),this._tDom.detachEvent("onmouseup",this._stop)),this._buttonRefresh.onclick=null,this._buttonClose.onclick=null,this._hasShow&&(this._tDom.removeChild(this._textArea),this._tDom.removeChild(this._buttonRefresh),this._tDom.removeChild(this._buttonClose)),this._textArea=null,this._buttonRefresh=null,this._buttonClose=null,this.dom.firstChild.removeChild(this._tDom),this._tDom=null}},r.inherits(i,t),e("../component").define("dataView",i),i}),r("echarts/component/toolbox",["require","./base","zrender/shape/Line","zrender/shape/Image","zrender/shape/Rectangle","../util/shape/Icon","../config","zrender/tool/util","zrender/config","zrender/tool/event","./dataView","../component"],function(e){function h(e,n,r,i,s){t.call(this,e,n,r,i,s),this.dom=s.dom,this._magicType={},this._magicMap={},this._isSilence=!1,this._iconList,this._iconShapeMap={},this._featureTitle={},this._featureIcon={},this._featureColor={},this._enableColor="red",this._disableColor="#ccc",this._markShapeList=[];var o=this;o._onMark=function(e){o.__onMark(e)},o._onMarkUndo=function(e){o.__onMarkUndo(e)},o._onMarkClear=function(e){o.__onMarkClear(e)},o._onDataZoom=function(e){o.__onDataZoom(e)},o._onDataZoomReset=function(e){o.__onDataZoomReset(e)},o._onDataView=function(e){o.__onDataView(e)},o._onRestore=function(e){o.__onRestore(e)},o._onSaveAsImage=function(e){o.__onSaveAsImage(e)},o._onMagicType=function(e){o.__onMagicType(e)},o._onCustomHandler=function(e){o.__onCustomHandler(e)},o._onmousemove=function(e){return o.__onmousemove(e)},o._onmousedown=function(e){return o.__onmousedown(e)},o._onmouseup=function(e){return o.__onmouseup(e)},o._onclick=function(e){return o.__onclick(e)}}var t=e("./base"),n=e("zrender/shape/Line"),r=e("zrender/shape/Image"),i=e("zrender/shape/Rectangle"),s=e("../util/shape/Icon"),o=e("../config"),u=e("zrender/tool/util"),a=e("zrender/config"),f=e("zrender/tool/event"),l="stack",c="tiled";return h.prototype={type:o.COMPONENT_TYPE_TOOLBOX,_buildShape:function(){this._iconList=[];var e=this.option.toolbox;this._enableColor=e.effectiveColor,this._disableColor=e.disableColor;var t=e.feature,n=[];for(var r in t)if(t[r].show)switch(r){case"mark":n.push({key:r,name:"mark"}),n.push({key:r,name:"markUndo"}),n.push({key:r,name:"markClear"});break;case"magicType":for(var i=0,s=t[r].type.length;i0){var o,r;for(var i=0,s=n.length;i=1){var t=this._markShapeList[e-1];this.zr.delShape(t.id),this.zr.refresh(),this._markShapeList.pop(),e===1&&(this._iconDisable(this._iconShapeMap.markUndo),this._iconDisable(this._iconShapeMap.markClear))}}return!0},__onMarkClear:function(){this._marking&&(this._marking=!1);var e=this._markShapeList.length;if(e>0){while(e--)this.zr.delShape(this._markShapeList.pop().id);this._iconDisable(this._iconShapeMap.markUndo),this._iconDisable(this._iconShapeMap.markClear),this.zr.refresh()}return!0},__onDataZoom:function(e){var t=e.target;if(this._zooming||this._zoomStart)this._resetZoom(),this.zr.refresh(),this.dom.style.cursor="default";else{this._resetMark(),this.zr.modShape(t.id,{style:{strokeColor:this._enableColor}}),this.zr.refresh(),this._zoomStart=!0;var n=this;setTimeout(function(){n.zr&&n.zr.on(a.EVENT.MOUSEDOWN,n._onmousedown)&&n.zr.on(a.EVENT.MOUSEUP,n._onmouseup)&&n.zr.on(a.EVENT.MOUSEMOVE,n._onmousemove)},10),this.dom.style.cursor="crosshair"}return!0},__onDataZoomReset:function(){return this._zooming&&(this._zooming=!1),this._zoomQueue.pop(),this._zoomQueue.length>0?this.component.dataZoom.absoluteZoom(this._zoomQueue[this._zoomQueue.length-1]):(this.component.dataZoom.rectZoom(),this._iconDisable(this._iconShapeMap.dataZoomReset),this.zr.refresh()),!0},_resetMark:function(){this._marking=!1,this._markStart&&(this._markStart=!1,this._iconShapeMap.mark&&this.zr.modShape(this._iconShapeMap.mark.id,{style:{strokeColor:this._iconShapeMap.mark.highlightStyle.strokeColor}}),this.zr.un(a.EVENT.CLICK,this._onclick),this.zr.un(a.EVENT.MOUSEMOVE,this._onmousemove))},_resetZoom:function(){this._zooming=!1,this._zoomStart&&(this._zoomStart=!1,this._iconShapeMap.dataZoom&&this.zr.modShape(this._iconShapeMap.dataZoom.id,{style:{strokeColor:this._iconShapeMap.dataZoom.highlightStyle.strokeColor}}),this.zr.un(a.EVENT.MOUSEDOWN,this._onmousedown),this.zr.un(a.EVENT.MOUSEUP,this._onmouseup),this.zr.un(a.EVENT.MOUSEMOVE,this._onmousemove))},_iconDisable:function(e){e.type!="image"?this.zr.modShape(e.id,{hoverable:!1,clickable:!1,style:{strokeColor:this._disableColor}}):this.zr.modShape(e.id,{hoverable:!1,clickable:!1,style:{opacity:.3}})},_iconEnable:function(e){e.type!="image"?this.zr.modShape(e.id,{hoverable:!0,clickable:!0,style:{strokeColor:e.highlightStyle.strokeColor}}):this.zr.modShape(e.id,{hoverable:!0,clickable:!0,style:{opacity:.8}})},__onDataView:function(){return this._dataView.show(this.option),!0},__onRestore:function(){return this._resetMark(),this._resetZoom(),this.messageCenter.dispatch(o.EVENT.RESTORE,null,null,this.myChart),!0},__onSaveAsImage:function(){var e=this.option.toolbox.feature.saveAsImage,t=e.type||"png";t!="png"&&t!="jpeg"&&(t="png");var n;this.myChart.isConnected()?n=this.myChart.getConnectedDataURL(t):n=this.zr.toDataURL("image/"+t,this.option.backgroundColor&&this.option.backgroundColor.replace(" ","")==="rgba(0,0,0,0)"?"#fff":this.option.backgroundColor);var r=document.createElement("div");r.id="__echarts_download_wrap__",r.style.cssText="position:fixed;z-index:99999;display:block;top:0;left:0;background-color:rgba(33,33,33,0.5);text-align:center;width:100%;height:100%;line-height:"+document.documentElement.clientHeight+"px;";var i=document.createElement("a");i.href=n,i.setAttribute("download",(e.name?e.name:this.option.title&&(this.option.title.text||this.option.title.subtext)?this.option.title.text||this.option.title.subtext:"ECharts")+"."+t),i.innerHTML='图片另存为")+'"/>',r.appendChild(i),document.body.appendChild(r),i=null,r=null,setTimeout(function(){var e=document.getElementById("__echarts_download_wrap__");e&&(e.onclick=function(){var e=document.getElementById("__echarts_download_wrap__");e.onclick=null,e.innerHTML="",document.body.removeChild(e),e=null},e=null)},500);return},__onMagicType:function(e){this._resetMark();var t=e.target._name;return this._magicType[t]||(this._magicType[t]=!0,t===o.CHART_TYPE_LINE?this._magicType[o.CHART_TYPE_BAR]=!1:t===o.CHART_TYPE_BAR&&(this._magicType[o.CHART_TYPE_LINE]=!1),t===l?this._magicType[c]=!1:t===c&&(this._magicType[l]=!1),this.messageCenter.dispatch(o.EVENT.MAGIC_TYPE_CHANGED,e.event,{magicType:this._magicType},this.myChart)),!0},setMagicType:function(e){this._resetMark(),this._magicType=e,!this._isSilence&&this.messageCenter.dispatch(o.EVENT.MAGIC_TYPE_CHANGED,null,{magicType:this._magicType},this.myChart)},__onCustomHandler:function(e){var t=e.target.style.iconType,n=this.option.toolbox.feature[t].onclick;typeof n=="function"&&n.call(this,this.option)},reset:function(e,t){t&&this.clear();if(this.query(e,"toolbox.show")&&this.query(e,"toolbox.feature.magicType.show")){var n=e.toolbox.feature.magicType.type,r=n.length;this._magicMap={};while(r--)this._magicMap[n[r]]=!0;r=e.series.length;var i,s;while(r--){i=e.series[r].type,this._magicMap[i]&&(s=e.xAxis instanceof Array?e.xAxis[e.series[r].xAxisIndex||0]:e.xAxis,s&&(s.type||"category")==="category"&&(s.__boundaryGap=s.boundaryGap!=null?s.boundaryGap:!0),s=e.yAxis instanceof Array?e.yAxis[e.series[r].yAxisIndex||0]:e.yAxis,s&&s.type==="category"&&(s.__boundaryGap=s.boundaryGap!=null?s.boundaryGap:!0),e.series[r].__type=i,e.series[r].__itemStyle=u.clone(e.series[r].itemStyle||{}));if(this._magicMap[l]||this._magicMap[c])e.series[r].__stack=e.series[r].stack}}this._magicType=t?{}:this._magicType||{};for(var o in this._magicType)if(this._magicType[o]){this.option=e,this.getMagicOption();break}var a=e.dataZoom;if(a&&a.show){var f=a.start!=null&&a.start>=0&&a.start<=100?a.start:0,h=a.end!=null&&a.end>=0&&a.end<=100?a.end:100;f>h&&(f+=h,h=f-h,f-=h),this._zoomQueue=[{start:f,end:h,start2:0,end2:100}]}else this._zoomQueue=[]},getMagicOption:function(){var e;if(this._magicType[o.CHART_TYPE_LINE]||this._magicType[o.CHART_TYPE_BAR]){var t=this._magicType[o.CHART_TYPE_LINE]?!1:!0;for(var n=0,r=this.option.series.length;n0&&(this.zr.delShape(this._lastTipShape.tipShape),this._lastTipShape=!1,this.shapeList.length=2),e&&this.zr.refresh(),this.showing=!1},_show:function(e,t,n,r){var i=this._tDom.offsetHeight,s=this._tDom.offsetWidth;e&&(typeof e=="function"&&(e=e([t,n])),e instanceof Array&&(t=e[0],n=e[1])),t+s>this._zrWidth&&(t-=s+40),n+i>this._zrHeight&&(n-=i-20),n<20&&(n=0),this._tDom.style.cssText=this._gCssText+this._defaultCssText+(r?r:"")+"left:"+t+"px;top:"+n+"px;",(i<10||s<10)&&setTimeout(this._refixed,20),this.showing=!0},__refixed:function(){if(this._tDom){var e="",t=this._tDom.offsetHeight,n=this._tDom.offsetWidth;this._tDom.offsetLeft+n>this._zrWidth&&(e+="left:"+(this._zrWidth-n-20)+"px;"),this._tDom.offsetTop+t>this._zrHeight&&(e+="top:"+(this._zrHeight-t-10)+"px;"),e!==""&&(this._tDom.style.cssText+=e)}},__tryShow:function(){var e,t;if(!this._curTarget)this._findPolarTrigger()||this._findAxisTrigger();else{if(this._curTarget._type==="island"&&this.option.tooltip.show){this._showItemTrigger();return}var n=u.get(this._curTarget,"series"),r=u.get(this._curTarget,"data");e=this.deepQuery([r,n,this.option],"tooltip.show"),n==null||r==null||!e?(clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this._hidingTicket=setTimeout(this._hide,this._hideDelay)):(t=this.deepQuery([r,n,this.option],"tooltip.trigger"),t==="axis"?this._showAxisTrigger(n.xAxisIndex,n.yAxisIndex,u.get(this._curTarget,"dataIndex")):this._showItemTrigger())}},_findAxisTrigger:function(){if(!this.component.xAxis||!this.component.yAxis){this._hidingTicket=setTimeout(this._hide,this._hideDelay);return}var e=this.option.series,t,n;for(var r=0,i=e.length;rh){l=a;if(!(a>=i))break;c=a,a=t.getCoordByIndex(++n)}return n<=0?n=0:i-l>=c-i?n-=1:t.getNameByIndex(n)==null&&(n-=1),n},_showAxisTrigger:function(e,t,n){!this._event.connectTrigger&&this.messageCenter.dispatch(o.EVENT.TOOLTIP_IN_GRID,this._event,null,this.myChart);if(this.component.xAxis==null||this.component.yAxis==null||e==null||t==null){clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this._hidingTicket=setTimeout(this._hide,this._hideDelay);return}var r=this.option.series,i=[],s=[],u,a,l,c,h,p,d="";if(this.option.tooltip.trigger==="axis"){if(!this.option.tooltip.show)return;c=this.option.tooltip.formatter,h=this.option.tooltip.position}if(e!=-1&&this.component.xAxis.getAxis(e).type===o.COMPONENT_TYPE_AXIS_CATEGORY){u=this.component.xAxis.getAxis(e);for(var v=0,m=r.length;v=0?this._showItemTrigger():(clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this._tDom.style.display="none");if(i.length>0){var g;if(typeof c=="function"){var y=[];for(var v=0,m=i.length;v"+this._encodeHTML(i[v].name||"")+" : ",g=i[v].data[n],g=g!=null?g.value!=null?g.value:g:"-",c+=g instanceof Array?g:this.numAddCommas(g);this._tDom.innerHTML=c}if(p===!1||!this.option.tooltip.showContent)return;this.hasAppend||(this._tDom.style.left=this._zrWidth/2+"px",this._tDom.style.top=this._zrHeight/2+"px",this.dom.firstChild.appendChild(this._tDom),this.hasAppend=!0),this._show(h,a+10,l+10,d)}},_showPolarTrigger:function(e,t){if(this.component.polar==null||e==null||t==null||t<0)return!1;var n=this.option.series,r=[],i,s,o,u="";if(this.option.tooltip.trigger==="axis"){if(!this.option.tooltip.show)return!1;i=this.option.tooltip.formatter,s=this.option.tooltip.position}var a=this.option.polar[e].indicator[t].text;for(var l=0,c=n.length;l0){var h,p,d=[];for(var l=0,c=r.length;l"+this._encodeHTML(d[0][3])+" : "+this.numAddCommas(d[0][2]);for(var l=1,c=d.length;l"+this._encodeHTML(d[l][1])+"
",i+=this._encodeHTML(d[l][3])+" : "+this.numAddCommas(d[l][2]);this._tDom.innerHTML=i}if(o===!1||!this.option.tooltip.showContent)return;return this.hasAppend||(this._tDom.style.left=this._zrWidth/2+"px",this._tDom.style.top=this._zrHeight/2+"px",this.dom.firstChild.appendChild(this._tDom),this.hasAppend=!0),this._show(s,f.getX(this._event),f.getY(this._event),u),!0}},_showItemTrigger:function(){if(!this._curTarget)return;var e=u.get(this._curTarget,"series"),t=u.get(this._curTarget,"data"),n=u.get(this._curTarget,"name"),r=u.get(this._curTarget,"value"),i=u.get(this._curTarget,"special"),s=u.get(this._curTarget,"special2"),a,l,c,h="",p,d="";this._curTarget._type!="island"?(this.option.tooltip.trigger==="item"&&(a=this.option.tooltip.formatter,l=this.option.tooltip.position),this.query(e,"tooltip.trigger")==="item"&&(c=this.query(e,"tooltip.showContent")||c,a=this.query(e,"tooltip.formatter")||a,l=this.query(e,"tooltip.position")||l,h+=this._style(this.query(e,"tooltip"))),c=this.query(t,"tooltip.showContent")||c,a=this.query(t,"tooltip.formatter")||a,l=this.query(t,"tooltip.position")||l,h+=this._style(this.query(t,"tooltip"))):(c=this.deepQuery([t,e,this.option],"tooltip.showContent"),a=this.deepQuery([t,e,this.option],"tooltip.islandFormatter"),l=this.deepQuery([t,e,this.option],"tooltip.islandPosition"));if(typeof a=="function")this._curTicket=(e.name||"")+":"+u.get(this._curTarget,"dataIndex"),this._tDom.innerHTML=a.call(this.myChart,[e.name||"",n,r,i,s,t],this._curTicket,this._setContent);else if(typeof a=="string")this._curTicket=NaN,a=a.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}"),a=a.replace("{a0}",this._encodeHTML(e.name||"")).replace("{b0}",this._encodeHTML(n)).replace("{c0}",r instanceof Array?r:this.numAddCommas(r)),a=a.replace("{d}","{d0}").replace("{d0}",i||""),a=a.replace("{e}","{e0}").replace("{e0}",u.get(this._curTarget,"special2")||""),this._tDom.innerHTML=a;else{this._curTicket=NaN;if(e.type===o.CHART_TYPE_SCATTER)this._tDom.innerHTML=""+(e.name!=null?this._encodeHTML(e.name)+"
":"")+(n===""?"":this._encodeHTML(n)+" : ")+r+(i==null?"":" ("+i+")");else if(e.type===o.CHART_TYPE_RADAR&&i){p=i,d+=this._encodeHTML(n===""?e.name||"":n),d+=d===""?"":"
";for(var v=0;v";this._tDom.innerHTML=d}else if(e.type===o.CHART_TYPE_CHORD)if(s==null)this._tDom.innerHTML=this._encodeHTML(n)+" ("+this.numAddCommas(r)+")";else{var m=this._encodeHTML(n),g=this._encodeHTML(i);this._tDom.innerHTML=""+(e.name!=null?this._encodeHTML(e.name)+"
":"")+m+" -> "+g+" ("+this.numAddCommas(r)+")"+"
"+g+" -> "+m+" ("+this.numAddCommas(s)+")"}else this._tDom.innerHTML=""+(e.name!=null?this._encodeHTML(e.name)+"
":"")+this._encodeHTML(n)+" : "+this.numAddCommas(r)+(i==null?"":" ("+this.numAddCommas(i)+")")}if(!this._axisLineShape.invisible||!this._axisShadowShape.invisible)this._axisLineShape.invisible=!0,this.zr.modShape(this._axisLineShape.id),this._axisShadowShape.invisible=!0,this.zr.modShape(this._axisShadowShape.id),this.zr.refresh();if(c===!1||!this.option.tooltip.showContent)return;this.hasAppend||(this._tDom.style.left=this._zrWidth/2+"px",this._tDom.style.top=this._zrHeight/2+"px",this.dom.firstChild.appendChild(this._tDom),this.hasAppend=!0),this._show(l,f.getX(this._event)+20,f.getY(this._event)-20,h)},_styleAxisPointer:function(e,t,n,r,i,s,o,u){if(e.length>0){var a,f,l=this.option.tooltip.axisPointer,c=l.type,h={line:{},cross:{},shadow:{}};for(var p in h)h[p].color=l[p+"Style"].color,h[p].width=l[p+"Style"].width,h[p].type=l[p+"Style"].type;for(var d=0,v=e.length;d100?(this._axisCrossShape.style.textAlign="left",this._axisCrossShape.style.textX=o+10):(this._axisCrossShape.style.textAlign="right",this._axisCrossShape.style.textX=o-10),u-this.component.grid.getY()>50?(this._axisCrossShape.style.textBaseline="bottom",this._axisCrossShape.style.textY=u-10):(this._axisCrossShape.style.textBaseline="top",this._axisCrossShape.style.textY=u+10),this._axisCrossShape.invisible=!1,this.zr.modShape(this._axisCrossShape.id);else if(c==="shadow"){if(h.shadow.width==null||h.shadow.width==="auto"||isNaN(h.shadow.width))h.shadow.width=s;t===r?Math.abs(this.component.grid.getX()-t)<2?(h.shadow.width/=2,t=r+=h.shadow.width/2):Math.abs(this.component.grid.getXend()-t)<2&&(h.shadow.width/=2,t=r-=h.shadow.width/2):n===i&&(Math.abs(this.component.grid.getY()-n)<2?(h.shadow.width/=2,n=i+=h.shadow.width/2):Math.abs(this.component.grid.getYend()-n)<2&&(h.shadow.width/=2,n=i-=h.shadow.width/2)),this._axisShadowShape.style={xStart:t,yStart:n,xEnd:r,yEnd:i,strokeColor:h.shadow.color,lineWidth:h.shadow.width},this._axisShadowShape.invisible=!1,this.zr.modShape(this._axisShadowShape.id)}this.zr.refresh()}},__onmousemove:function(e){clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket);var t=e.target,n=f.getX(e.event),r=f.getY(e.event);if(!t)this._curTarget=!1,this._event=e.event,this._event.zrenderX=n,this._event.zrenderY=r,this._needAxisTrigger&&this.component.grid&&l.isInside(s,this.component.grid.getArea(),n,r)?this._showingTicket=setTimeout(this._tryShow,this._showDelay):this._needAxisTrigger&&this.component.polar&&this.component.polar.isInside([n,r])!=-1?this._showingTicket=setTimeout(this._tryShow,this._showDelay):(!this._event.connectTrigger&&this.messageCenter.dispatch(o.EVENT.TOOLTIP_OUT_GRID,this._event,null,this.myChart),this._hidingTicket=setTimeout(this._hide,this._hideDelay));else{this._curTarget=t,this._event=e.event,this._event.zrenderX=n,this._event.zrenderY=r;var i;if(this._needAxisTrigger&&this.component.polar&&(i=this.component.polar.isInside([n,r]))!=-1){var u=this.option.series;for(var a=0,c=u.length;a0&&(this.zr.delShape(this._lastTipShape.tipShape),this.shapeList.length=2);for(var n=0,r=t.length;n0&&this.zr.delShape(this._lastTipShape.tipShape),this._lastTipShape=!1,this.shapeList.length=2;if(e){this.option=e,this.option.tooltip=this.reformOption(this.option.tooltip),this.option.tooltip.textStyle=h.merge(this.option.tooltip.textStyle,this.ecTheme.textStyle),this.option.tooltip.padding=this.reformCssArray(this.option.tooltip.padding),this._needAxisTrigger=!1,this.option.tooltip.trigger==="axis"&&(this._needAxisTrigger=!0);var t=this.option.series;for(var n=0,r=t.length;n0&&this.zr.delShape(this._lastTipShape.tipShape),this.clear(),this.shapeList=null,clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this.zr.un(a.EVENT.MOUSEMOVE,this._onmousemove),this.zr.un(a.EVENT.GLOBALOUT,this._onglobalout),this.hasAppend&&this.dom.firstChild.removeChild(this._tDom),this._tDom=null},_encodeHTML:function(e){return String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}},h.inherits(d,t),e("../component").define("tooltip",d),d}),r("zrender/shape/Ring",["require","./Base","../tool/util"],function(e){var t=e("./Base"),n=function(e){t.call(this,e)};return n.prototype={type:"ring",buildPath:function(e,t){e.arc(t.x,t.y,t.r,0,Math.PI*2,!1),e.moveTo(t.x+t.r0,t.y),e.arc(t.x,t.y,t.r0,0,Math.PI*2,!0);return},getRect:function(e){if(e.__rect)return e.__rect;var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,e.__rect={x:Math.round(e.x-e.r-t/2),y:Math.round(e.y-e.r-t/2),width:e.r*2+t,height:e.r*2+t},e.__rect}},e("../tool/util").inherits(n,t),n}),r("zrender/shape/Sector",["require","../tool/math","./Base","./Ring","./Polygon","../tool/util"],function(e){var t=e("../tool/math"),n=e("./Base"),r=function(e){n.call(this,e)};return r.prototype={type:"sector",buildPath:function(e,n){var r=n.x,i=n.y,s=typeof n.r0=="undefined"?0:n.r0,o=n.r,u=n.startAngle,a=n.endAngle;if(Math.abs(a-u)>=360){e.arc(r,i,o,0,Math.PI*2,!1),s!==0&&(e.moveTo(r+s,i),e.arc(r,i,s,0,Math.PI*2,!0));return}u=t.degreeToRadian(u),a=t.degreeToRadian(a);var f=Math.PI*2,l=t.cos(u),c=t.sin(u);e.moveTo(l*s+r,i-c*s),e.lineTo(l*o+r,i-c*o),e.arc(r,i,o,f-u,f-a,!0),e.lineTo(t.cos(a)*s+r,i-t.sin(a)*s),s!==0&&e.arc(r,i,s,f-a,f-u,!1),e.closePath();return},getRect:function(n){if(n.__rect)return n.__rect;var r=n.x,i=n.y,s=typeof n.r0=="undefined"?0:n.r0,o=n.r,u=n.startAngle,a=n.endAngle;if(Math.abs(a-u)>=360)return n.__rect=e("./Ring").prototype.getRect(n),n.__rect;u=(720+u)%360,a=(720+a)%360,a<=u&&(a+=360);var f=[];return u<=90&&a>=90&&f.push([r,i-o]),u<=180&&a>=180&&f.push([r-o,i]),u<=270&&a>=270&&f.push([r,i+o]),u<=360&&a>=360&&f.push([r+o,i]),u=t.degreeToRadian(u),a=t.degreeToRadian(a),f.push([t.cos(u)*s+r,i-t.sin(u)*s]),f.push([t.cos(u)*o+r,i-t.sin(u)*o]),f.push([t.cos(a)*o+r,i-t.sin(a)*o]),f.push([t.cos(a)*s+r,i-t.sin(a)*s]),n.__rect=e("./Polygon").prototype.getRect({brushType:n.brushType,lineWidth:n.lineWidth,pointList:f}),n.__rect}},e("../tool/util").inherits(r,n),r}),r("echarts/util/shape/Candle",["require","zrender/shape/Base","zrender/tool/util","./normalIsCover"],function(e){function r(e){t.call(this,e)}var t=e("zrender/shape/Base"),n=e("zrender/tool/util");return r.prototype={type:"candle",_numberOrder:function(e,t){return t-e},buildPath:function(e,t){var r=n.clone(t.y).sort(this._numberOrder);e.moveTo(t.x,r[3]),e.lineTo(t.x,r[2]),e.moveTo(t.x-t.width/2,r[2]),e.rect(t.x-t.width/2,r[2],t.width,r[1]-r[2]),e.moveTo(t.x,r[1]),e.lineTo(t.x,r[0])},getRect:function(e){if(!e.__rect){var t=0;if(e.brushType=="stroke"||e.brushType=="fill")t=e.lineWidth||1;var r=n.clone(e.y).sort(this._numberOrder);e.__rect={x:Math.round(e.x-e.width/2-t/2),y:Math.round(r[3]-t/2),width:e.width+t,height:r[0]-r[3]+t}}return e.__rect},isCover:e("./normalIsCover")},n.inherits(r,t),r}),r("echarts/component/legend",["require","./base","zrender/shape/Text","zrender/shape/Rectangle","zrender/shape/Sector","../util/shape/Icon","../util/shape/Candle","../config","zrender/tool/util","zrender/tool/area","../component"],function(e){function l(e,n,r,i,s){if(!this.query(i,"legend.data")){console.error("option.legend.data has not been defined.");return}t.call(this,e,n,r,i,s);var o=this;o._legendSelected=function(e){o.__legendSelected(e)},this._colorIndex=0,this._colorMap={},this._selectedMap={},this.refresh(i)}var t=e("./base"),n=e("zrender/shape/Text"),r=e("zrender/shape/Rectangle"),i=e("zrender/shape/Sector"),s=e("../util/shape/Icon"),o=e("../util/shape/Candle"),u=e("../config"),a=e("zrender/tool/util"),f=e("zrender/tool/area");l.prototype={type:u.COMPONENT_TYPE_LEGEND,_buildShape:function(){this._itemGroupLocation=this._getItemGroupLocation(),this._buildBackground(),this._buildItem();for(var e=0,t=this.shapeList.length;e=d-m&&(m=this._itemGroupLocation.x,g+=b+w):v-g<200&&b+(S===t-1||e[S+1]===""?0:w)>=v-g&&(this.legendOption.x==="right"?m-=this._itemGroupLocation.maxWidth+w:m+=this._itemGroupLocation.maxWidth+w,g=this._itemGroupLocation.y),o=this._getItemShapeByType(m,g,y,b,this._selectedMap[r]?E:"#ccc",i,E),o._name=r,o=new s(o),u={zlevel:this._zlevelBase,style:{x:m+y+5,y:g+b/2,color:this._selectedMap[r]?c.color==="auto"?E:c.color:"#ccc",text:p,textFont:h,textBaseline:"middle"},highlightStyle:{color:E,brushType:"fill"},hoverable:!!this.legendOption.selectedMode,clickable:!!this.legendOption.selectedMode},this.legendOption.orient==="vertical"&&this.legendOption.x==="right"&&(u.style.x-=y+10,u.style.textAlign="right"),u._name=r,u=new n(u),this.legendOption.selectedMode&&(o.onclick=u.onclick=this._legendSelected,o.onmouseover=u.onmouseover=this.hoverConnect,o.hoverConnect=u.id,u.hoverConnect=o.id),this.shapeList.push(o),this.shapeList.push(u),this.legendOption.orient==="horizontal"?m+=y+5+f.getTextWidth(p,h)+w:g+=b+w}this.legendOption.orient==="horizontal"&&this.legendOption.x==="center"&&g!=this._itemGroupLocation.y&&this._mLineOptimize()},_getName:function(e){return typeof e.name!="undefined"?e.name:e},_getFormatterName:function(e){var t=this.legendOption.formatter,n;return typeof t=="function"?n=t.call(this.myChart,e):typeof t=="string"?n=t.replace("{name}",e):n=e,n},_getFormatterNameFromData:function(e){var t=this._getName(e);return this._getFormatterName(t)},_mLineOptimize:function(){var e=[],t=this._itemGroupLocation.x;for(var n=2,r=this.shapeList.length;nh?(u=h,l+=i+n):u=Math.max(u,d),l+=i+n,d=0;continue}d+=r+f.getTextWidth(this._getFormatterNameFromData(e[m]),e[m].textStyle?this.getFont(a.merge(e[m].textStyle||{},s)):o)+n}l=Math.max(l,i),d-=n,d>h?(u=h,l+=i+n):u=Math.max(u,d)}else{for(var m=0;mp?(l=p,u+=v+n):l=Math.max(l,d),u+=v+n,d=0;continue}d+=i+n}u=Math.max(u,v),d-=n,d>p?(l=p,u+=v+n):l=Math.max(l,d)}h=this.zr.getWidth(),p=this.zr.getHeight();var g;switch(this.legendOption.x){case"center":g=Math.floor((h-u)/2);break;case"left":g=this.legendOption.padding[3]+this.legendOption.borderWidth;break;case"right":g=h-u-this.legendOption.padding[1]-this.legendOption.padding[3]-this.legendOption.borderWidth*2;break;default:g=this.parsePercent(this.legendOption.x,h)}var y;switch(this.legendOption.y){case"top":y=this.legendOption.padding[0]+this.legendOption.borderWidth;break;case"bottom":y=p-l-this.legendOption.padding[0]-this.legendOption.padding[2]-this.legendOption.borderWidth*2;break;case"center":y=Math.floor((p-l)/2);break;default:y=this.parsePercent(this.legendOption.y,p)}return{x:g,y:y,width:u,height:l,maxWidth:v}},_getSomethingByName:function(e){var t=this.option.series,n;for(var r=0,i=t.length;r=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height?!0:!1}},i.inherits(o,t),o}),r("echarts/component/timeline",["require","./base","zrender/shape/Rectangle","../util/shape/Icon","../util/shape/Chain","../config","zrender/tool/util","zrender/tool/area","zrender/tool/event","../component"],function(e){function f(e,n,r,i,u){t.call(this,e,n,r,i,u);var a=this;a._onclick=function(e){return a.__onclick(e)},a._ondrift=function(e,t){return a.__ondrift(this,e,t)},a._ondragend=function(){return a.__ondragend()},a._setCurrentOption=function(){var e=a.timelineOption;a.currentIndex%=e.data.length;var t=a.options[a.currentIndex]||{};a.myChart.setOption(t,e.notMerge),a.messageCenter.dispatch(s.EVENT.TIMELINE_CHANGED,null,{currentIndex:a.currentIndex,data:e.data[a.currentIndex].name!=null?e.data[a.currentIndex].name:e.data[a.currentIndex]},a.myChart)},a._onFrame=function(){a._setCurrentOption(),a._syncHandleShape(),a.timelineOption.autoPlay&&(a.playTicket=setTimeout(function(){a.currentIndex+=1;if(!a.timelineOption.loop&&a.currentIndex>=a.timelineOption.data.length){a.currentIndex=a.timelineOption.data.length-1,a.stop();return}a._onFrame()},a.timelineOption.playInterval))},this.setTheme(!1),this.options=this.option.options,this.currentIndex=this.timelineOption.currentIndex%this.timelineOption.data.length,!this.timelineOption.notMerge&&this.currentIndex!==0&&(this.options[this.currentIndex]=o.merge(this.options[this.currentIndex],this.options[0])),this.timelineOption.show&&(this._buildShape(),this._syncHandleShape()),this._setCurrentOption();if(this.timelineOption.autoPlay){var a=this;this.playTicket=setTimeout(function(){a.play()},this.ecTheme.animationDuration)}}function l(e,t){var n=2,i=t.x+n,s=t.y+n+2,o=t.width-n,u=t.height-n,a=t.symbol;if(a==="last")e.moveTo(i+o-2,s+u/3),e.lineTo(i+o-2,s),e.lineTo(i+2,s+u/2),e.lineTo(i+o-2,s+u),e.lineTo(i+o-2,s+u/3*2),e.moveTo(i,s),e.lineTo(i,s);else if(a==="next")e.moveTo(i+2,s+u/3),e.lineTo(i+2,s),e.lineTo(i+o-2,s+u/2),e.lineTo(i+2,s+u),e.lineTo(i+2,s+u/3*2),e.moveTo(i,s),e.lineTo(i,s);else if(a==="play")if(t.status==="stop")e.moveTo(i+2,s),e.lineTo(i+o-2,s+u/2),e.lineTo(i+2,s+u),e.lineTo(i+2,s);else{var f=t.brushType==="both"?2:3;e.rect(i+2,s,f,u),e.rect(i+o-f-2,s,f,u)}else if(a.match("image")){var l="";l=a.replace(new RegExp("^image:\\/\\/"),""),a=r.prototype.iconLibrary.image,a(e,{x:i,y:s,width:o,height:u,image:l})}}var t=e("./base"),n=e("zrender/shape/Rectangle"),r=e("../util/shape/Icon"),i=e("../util/shape/Chain"),s=e("../config"),o=e("zrender/tool/util"),u=e("zrender/tool/area"),a=e("zrender/tool/event");return f.prototype={type:s.COMPONENT_TYPE_TIMELINE,_buildShape:function(){this._location=this._getLocation(),this._buildBackground(),this._buildControl(),this._chainPoint=this._getChainPoint();if(this.timelineOption.label.show){var e=this._getInterval();for(var t=0,n=this._chainPoint.length;t3){var o=!1,a,f;n=0;while(!o&&n1){var v=c/h;v=v>50?50:v<20?5:v,c-=v*2;if(e.type==="number")for(var m=0;m0?"right":"left",S=[r*Math.PI/180,f,l-5]):S=!1,g.push({x:f,n:b,isEmpty:w,symbol:y,symbolSize:a[m].symbolSize||n,color:a[m].color,borderColor:a[m].borderColor,borderWidth:a[m].borderWidth,name:this._getReformedLabel(m),textColor:u.color,textAlign:E,textBaseline:u.baseline||"middle",textX:f,textY:l-(r?5:0),textFont:a[m].textStyle?this.getFont(u):s,rotation:S,showLabel:!1});return g},_buildBackground:function(){var e=this.timelineOption,t=e.padding,r=this._location.width,i=this._location.height;(e.borderWidth!==0||e.backgroundColor.replace(/\s/g,"")!="rgba(0,0,0,0)")&&this.shapeList.push(new n({zlevel:this._zlevelBase,hoverable:!1,style:{x:this._location.x-t[3],y:this._location.y-t[0],width:r+t[1]+t[3],height:i+t[0]+t[2],brushType:e.borderWidth===0?"fill":"both",color:e.backgroundColor,strokeColor:e.borderColor,lineWidth:e.borderWidth}}))},_buildControl:function(){var e=this,t=this.timelineOption,n=t.lineStyle,i=t.controlStyle;if(t.controlPosition==="none")return;var s=15,u=5,a;t.controlPosition==="left"?(a=this._location.x,this._location.x+=(s+u)*3):(a=this._location.x2-((s+u)*3-u),this._location.x2-=(s+u)*3);var f=this._location.y,l={zlevel:this._zlevelBase+1,style:{iconType:"timelineControl",symbol:"last",x:a,y:f,width:s,height:s,brushType:"stroke",color:i.normal.color,strokeColor:i.normal.color,lineWidth:n.width},highlightStyle:{color:i.emphasis.color,strokeColor:i.emphasis.color,lineWidth:n.width+1},clickable:!0};this._ctrLastShape=new r(l),this._ctrLastShape.onclick=function(){e.last()},this.shapeList.push(this._ctrLastShape),a+=s+u,this._ctrPlayShape=new r(o.clone(l)),this._ctrPlayShape.style.brushType="fill",this._ctrPlayShape.style.symbol="play",this._ctrPlayShape.style.status=this.timelineOption.autoPlay?"playing":"stop",this._ctrPlayShape.style.x=a,this._ctrPlayShape.onclick=function(){e._ctrPlayShape.style.status==="stop"?e.play():e.stop()},this.shapeList.push(this._ctrPlayShape),a+=s+u,this._ctrNextShape=new r(o.clone(l)),this._ctrNextShape.style.symbol="next",this._ctrNextShape.style.x=a,this._ctrNextShape.onclick=function(){e.next()},this.shapeList.push(this._ctrNextShape)},_buildChain:function(){var e=this.timelineOption,t=e.lineStyle;this._timelineShae={zlevel:this._zlevelBase,style:{x:this._location.x,y:this.subPixelOptimize(this._location.y,t.width),width:this._location.x2-this._location.x,height:this._location.height,chainPoint:this._chainPoint,brushType:"both",strokeColor:t.color,lineWidth:t.width,lineType:t.type},hoverable:!1,clickable:!0,onclick:this._onclick},this._timelineShae=new i(this._timelineShae),this.shapeList.push(this._timelineShae)},_buildHandle:function(){var e=this._chainPoint[this.currentIndex],t=e.symbolSize+1;t=t<5?5:t,this._handleShape={zlevel:this._zlevelBase+1,hoverable:!1,draggable:!0,style:{iconType:"diamond",n:e.n,x:e.x-t,y:this._location.y+this._location.height/4-t,width:t*2,height:t*2,brushType:"both",textPosition:"specific",textX:e.x,textY:this._location.y-this._location.height/4,textAlign:"center",textBaseline:"middle"},highlightStyle:{},ondrift:this._ondrift,ondragend:this._ondragend},this._handleShape=new r(this._handleShape),this.shapeList.push(this._handleShape)},_syncHandleShape:function(){if(!this.timelineOption.show)return;var e=this.timelineOption,t=e.checkpointStyle,n=this._chainPoint[this.currentIndex];this._handleShape.style.text=t.label.show?n.name:"",this._handleShape.style.textFont=n.textFont,this._handleShape.style.n=n.n,t.symbol==="auto"?this._handleShape.style.iconType=n.symbol!="none"?n.symbol:"diamond":(this._handleShape.style.iconType=t.symbol,t.symbol.match("star")&&(this._handleShape.style.n=t.symbol.replace("star","")-0||5,this._handleShape.style.iconType="star"));var r;t.symbolSize==="auto"?(r=n.symbolSize+2,r=r<5?5:r):r=t.symbolSize-0,this._handleShape.style.color=t.color==="auto"?n.color?n.color:e.controlStyle.emphasis.color:t.color,this._handleShape.style.textColor=t.label.textStyle.color==="auto"?this._handleShape.style.color:t.label.textStyle.color,this._handleShape.highlightStyle.strokeColor=this._handleShape.style.strokeColor=t.borderColor==="auto"?n.borderColor?n.borderColor:"#fff":t.borderColor,this._handleShape.style.lineWidth=t.borderWidth==="auto"?n.borderWidth?n.borderWidth:0:t.borderWidth-0,this._handleShape.highlightStyle.lineWidth=this._handleShape.style.lineWidth+1,this.zr.animate(this._handleShape.id,"style").when(500,{x:n.x-r,textX:n.x,y:this._location.y+this._location.height/4-r,width:r*2,height:r*2}).start("ExponentialOut")},_findChainIndex:function(e){var t=this._chainPoint,n=t.length;if(e<=t[0].x)return 0;if(e>=t[n-1].x)return n-1;for(var r=0;r=t[r].x&&e<=t[r+1].x)return Math.abs(e-t[r].x)=n[r-1].x-n[r-1].symbolSize?(e.style.x=n[r-1].x-n[r-1].symbolSize,i=r-1):(e.style.x+=t,i=this._findChainIndex(e.style.x));var s=n[i],o=s.symbolSize+2;e.style.iconType=s.symbol,e.style.n=s.n,e.style.textX=e.style.x+o/2,e.style.y=this._location.y+this._location.height/4-o,e.style.width=o*2,e.style.height=o*2,e.style.text=s.name;if(i===this.currentIndex)return!0;this.currentIndex=i;if(this.timelineOption.realtime){clearTimeout(this.playTicket);var u=this;this.playTicket=setTimeout(function(){u._setCurrentOption()},200)}return!0},__ondragend:function(){this.isDragend=!0},ondragend:function(e,t){if(!this.isDragend||!e.target)return;!this.timelineOption.realtime&&this._setCurrentOption(),t.dragOut=!0,t.dragIn=!0,t.needRefresh=!1,this.isDragend=!1,this._syncHandleShape();return},last:function(){return this.timelineOption.autoPlay&&this.stop(),this.currentIndex-=1,this.currentIndex<0&&(this.currentIndex=this.timelineOption.data.length-1),this._onFrame(),this.currentIndex},next:function(){return this.timelineOption.autoPlay&&this.stop(),this.currentIndex+=1,this.currentIndex>=this.timelineOption.data.length&&(this.currentIndex=0),this._onFrame(),this.currentIndex},play:function(e,t){return this._ctrPlayShape&&this._ctrPlayShape.style.status!="playing"&&(this._ctrPlayShape.style.status="playing",this.zr.modShape(this._ctrPlayShape.id),this.zr.refresh()),this.timelineOption.autoPlay=t!=null?t:!0,this.timelineOption.autoPlay||clearTimeout(this.playTicket),this.currentIndex=e!=null?e:this.currentIndex+1,this.currentIndex>=this.timelineOption.data.length&&(this.currentIndex=0),this._onFrame(),this.currentIndex},stop:function(){return this._ctrPlayShape&&this._ctrPlayShape.style.status!="stop"&&(this._ctrPlayShape.style.status="stop",this.zr.modShape(this._ctrPlayShape.id),this.zr.refresh()),this.timelineOption.autoPlay=!1,clearTimeout(this.playTicket),this.currentIndex},resize:function(){this.timelineOption.show&&(this.clear(),this._buildShape(),this._syncHandleShape())},setTheme:function(e){this.timelineOption=this.reformOption(o.clone(this.option.timeline)),this.timelineOption.padding=this.reformCssArray(this.timelineOption.padding),this.timelineOption.label.textStyle=o.merge(this.timelineOption.label.textStyle||{},this.ecTheme.textStyle),this.timelineOption.checkpointStyle.label.textStyle=o.merge(this.timelineOption.checkpointStyle.label.textStyle||{},this.ecTheme.textStyle),this.timelineOption.show&&e&&(this.clear(),this._buildShape(),this._syncHandleShape())},dispose:function(){this.clear(),this.shapeList=null,clearTimeout(this.playTicket)}},r.prototype.iconLibrary.timelineControl=l,o.inherits(f,t),e("../component").define("timeline",f),f}),r("zrender/loadingEffect/Bar",["require","./Base","../tool/util","../tool/color","../shape/Rectangle"],function(e){function s(e){t.call(this,e)}var t=e("./Base"),n=e("../tool/util"),r=e("../tool/color"),i=e("../shape/Rectangle");return n.inherits(s,t),s.prototype._start=function(e,t){var s=n.merge(this.options,{textStyle:{color:"#888"},backgroundColor:"rgba(250, 250, 250, 0.8)",effectOption:{x:0,y:this.canvasHeight/2-30,width:this.canvasWidth,height:5,brushType:"fill",timeInterval:100}}),o=this.createTextShape(s.textStyle),u=this.createBackgroundShape(s.backgroundColor),a=s.effectOption,f=new i({highlightStyle:n.clone(a)});f.highlightStyle.color=a.color||r.getLinearGradient(a.x,a.y,a.x+a.width,a.y+a.height,[[0,"#ff6400"],[.5,"#ffe100"],[1,"#b1ff00"]]);if(s.progress!=null){e(u),f.highlightStyle.width=this.adjust(s.progress,[0,1])*s.effectOption.width,e(f),e(o),t();return}return f.highlightStyle.width=0,setInterval(function(){e(u),f.highlightStyle.width=h&&(c[n].len=Math.ceil(Math.random()*400),r.xStart=-400,r.xEnd=-400+c[n].len,r.yStart=Math.ceil(Math.random()*p),r.yEnd=r.yStart),r.xStart+=c[n].animationX,r.xEnd+=c[n].animationX,e(c[n])}e(o),t()},a.timeInterval)},s}),r("zrender/loadingEffect/Ring",["require","./Base","../tool/util","../tool/color","../shape/Ring","../shape/Sector"],function(e){function o(e){t.call(this,e)}var t=e("./Base"),n=e("../tool/util"),r=e("../tool/color"),i=e("../shape/Ring"),s=e("../shape/Sector");return n.inherits(o,t),o.prototype._start=function(e,t){var o=n.merge(this.options,{textStyle:{color:"#07a"},backgroundColor:"rgba(250, 250, 250, 0.8)",effect:{x:this.canvasWidth/2,y:this.canvasHeight/2,r0:60,r:100,color:"#bbdcff",brushType:"fill",textPosition:"inside",textFont:"normal 30px verdana",textColor:"rgba(30, 144, 255, 0.6)",timeInterval:100}}),u=o.effect,a=o.textStyle;a.x==null&&(a.x=u.x),a.y==null&&(a.y=u.y+(u.r0+u.r)/2-5);var f=this.createTextShape(o.textStyle),l=this.createBackgroundShape(o.backgroundColor),c=u.x,h=u.y,p=u.r0+6,d=u.r-6,v=u.color,m=r.lift(v,.1),g=new i({highlightStyle:n.clone(u)}),y=[],b=r.getGradientColors(["#ff6400","#ffe100","#97ff00"],25),w=15,E=240;for(var S=0;S<16;S++)y.push(new s({highlightStyle:{x:c,y:h,r0:p,r:d,startAngle:E-w,endAngle:E,brushType:"fill",color:m},_color:r.getLinearGradient(c+p*Math.cos(E,!0),h-p*Math.sin(E,!0),c+p*Math.cos(E-w,!0),h-p*Math.sin(E-w,!0),[[0,b[S*2]],[1,b[S*2+1]]])})),E-=w;E=360;for(var S=0;S<4;S++)y.push(new s({highlightStyle:{x:c,y:h,r0:p,r:d,startAngle:E-w,endAngle:E,brushType:"fill",color:m},_color:r.getLinearGradient(c+p*Math.cos(E,!0),h-p*Math.sin(E,!0),c+p*Math.cos(E-w,!0),h-p*Math.sin(E-w,!0),[[0,b[S*2+32]],[1,b[S*2+33]]])})),E-=w;var x=0;if(o.progress!=null){e(l),x=this.adjust(o.progress,[0,1]).toFixed(2)*100/5,g.highlightStyle.text=x*5+"%",e(g);for(var S=0;S<20;S++)y[S].highlightStyle.color=S=20?-20:1,e(g);for(var n=0;n<20;n++)y[n].highlightStyle.color=n ");var u=-1;for(var a=0,f=o.length;a-1){o.splice(u,1),this._optionRestore.series[e][n].data.splice(u,1);var c=this.chart[i.type];c&&c.delMark(e,t.join(" > "),n)}return this},getDom:function(){return this.dom},getZrender:function(){return this._zr},getDataURL:function(e){if(!s)return"";if(this._chartList.length===0){var t="IMG"+this.id,n=document.getElementById(t);if(n)return n.src}var r=this.component.tooltip;r&&r.hideTip();switch(e){case"jpeg":break;default:e="png"}var i=this._option.backgroundColor;return i&&i.replace(" ","")==="rgba(0,0,0,0)"&&(i="#fff"),this._zr.toDataURL("image/"+e,i)},getImage:function(e){var t=this._optionRestore.title,n=document.createElement("img");return n.src=this.getDataURL(e),n.title=t&&t.text||"ECharts",n},getConnectedDataURL:function(t){if(!this.isConnected())return this.getDataURL(t);var n=this.dom,r={self:{img:this.getDataURL(t),left:n.offsetLeft,top:n.offsetTop,right:n.offsetLeft+n.offsetWidth,bottom:n.offsetTop+n.offsetHeight}},i=r.self.left,s=r.self.top,o=r.self.right,u=r.self.bottom;for(var a in this._connected)n=this._connected[a].getDom(),r[a]={img:this._connected[a].getDataURL(t),left:n.offsetLeft,top:n.offsetTop,right:n.offsetLeft+n.offsetWidth,bottom:n.offsetTop+n.offsetHeight},i=Math.min(i,r[a].left),s=Math.min(s,r[a].top),o=Math.max(o,r[a].right),u=Math.max(u,r[a].bottom);var f=document.createElement("div");f.style.position="absolute",f.style.left="-4000px",f.style.width=o-i+"px",f.style.height=u-s+"px",document.body.appendChild(f);var l=e("zrender").init(f),c=e("zrender/shape/Image");for(var a in r)l.addShape(new c({style:{x:r[a].left-i,y:r[a].top-s,image:r[a].img}}));l.render();var h=this._option.backgroundColor;h&&h.replace(/ /g,"")==="rgba(0,0,0,0)"&&(h="#fff");var p=l.toDataURL("image/png",h);return setTimeout(function(){l.dispose(),f.parentNode.removeChild(f),f=null},100),p},getConnectedImage:function(e){var t=this._optionRestore.title,n=document.createElement("img");return n.src=this.getConnectedDataURL(e),n.title=t&&t.text||"ECharts",n},on:function(e,t){return this._messageCenterOutSide.bind(e,t,this),this},un:function(e,t){return this._messageCenterOutSide.unbind(e,t),this},connect:function(e){if(!e)return this;this._connected||(this._connected={});if(e instanceof Array)for(var t=0,n=e.length;t=n/3?1:2),o=t.y+Math.sin(i)*r*(r>=n/3?1:2);i=t.angle-Math.PI/2,e.moveTo(s,o),e.lineTo(t.x+Math.cos(i)*r,t.y-Math.sin(i)*r),e.lineTo(t.x+Math.cos(t.angle)*n,t.y-Math.sin(t.angle)*n),e.lineTo(t.x-Math.cos(i)*r,t.y+Math.sin(i)*r),e.lineTo(s,o);return},getRect:function(e){if(e.__rect)return e.__rect;var t=e.width*2,n=e.x,r=e.y,i=n+Math.cos(e.angle)*e.r,s=r-Math.sin(e.angle)*e.r;return e.__rect={x:Math.min(n,i)-t,y:Math.min(r,s)-t,width:Math.abs(n-i)+t,height:Math.abs(r-s)+t},e.__rect},isCover:e("./normalIsCover")},n.inherits(r,t),r}),r("echarts/chart/gauge",["require","../component/base","./base","../util/shape/GaugePointer","zrender/shape/Text","zrender/shape/Line","zrender/shape/Rectangle","zrender/shape/Circle","zrender/shape/Sector","../config","../util/ecData","../util/accMath","zrender/tool/util","../chart"],function(e){function p(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this),this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("../util/shape/GaugePointer"),i=e("zrender/shape/Text"),s=e("zrender/shape/Line"),o=e("zrender/shape/Rectangle"),u=e("zrender/shape/Circle"),a=e("zrender/shape/Sector"),f=e("../config"),l=e("../util/ecData"),c=e("../util/accMath"),h=e("zrender/tool/util");return p.prototype={type:f.CHART_TYPE_GAUGE,_buildShape:function(){var e=this.series;this._paramsMap={};for(var t=0,n=e.length;t=110&&v<=250?"left":v<=70||v>=290?"right":"center",textBaseline:v>=10&&v<=170?"top":v>=190&&v<=350?"bottom":"middle",textFont:u,shadowColor:o.shadowColor,shadowBlur:o.shadowBlur,shadowOffsetX:o.shadowOffsetX,shadowOffsetY:o.shadowOffsetY}}))},_buildPointer:function(e){var t=this.series[e];if(!t.pointer.show)return;var n=t.max-t.min,i=t.pointer,s=this._paramsMap[e],o=this.parsePercent(i.length,s.radius[1]),a=this.parsePercent(i.width,s.radius[1]),f=s.center,c=this._getValue(e);c=c2?2:a/2,color:"#fff"}});l.pack(d,this.series[e],e,this.series[e].data[0],0,this.series[e].data[0].name,c),this.shapeList.push(d),this.shapeList.push(new u({zlevel:this._zlevelBase+2,hoverable:!1,style:{x:f[0],y:f[1],r:i.width/2.5,color:"#fff"}}))},_buildTitle:function(e){var t=this.series[e];if(!t.title.show)return;var n=t.data[0],r=n.name!=null?n.name:"";if(r!==""){var s=t.title,o=s.offsetCenter,u=s.textStyle,a=u.color,f=this._paramsMap[e],l=f.center[0]+this.parsePercent(o[0],f.radius[1]),c=f.center[1]+this.parsePercent(o[1],f.radius[1]);this.shapeList.push(new i({zlevel:this._zlevelBase+(Math.abs(l-f.center[0])+Math.abs(c-f.center[1]))=t)return n[r][1];return n[n.length-1][1]},_getSector:function(e,t,n,r,i,s,o){return new a({zlevel:this._zlevelBase,hoverable:!1,style:{x:e[0],y:e[1],r0:t,r:n,startAngle:r,endAngle:i,brushType:"fill",color:s,shadowColor:o.shadowColor,shadowBlur:o.shadowBlur,shadowOffsetX:o.shadowOffsetX,shadowOffsetY:o.shadowOffsetY}})},_getLabelText:function(e,t){if(e){if(typeof e=="function")return e.call(this.myChart,t);if(typeof e=="string")return e.replace("{value}",t)}return t},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()}},h.inherits(p,n),h.inherits(p,t),e("../chart").define("gauge",p),p}),r("echarts/chart/funnel",["require","../component/base","./base","zrender/shape/Text","zrender/shape/Line","zrender/shape/Polygon","../config","../util/ecData","../util/number","zrender/tool/util","zrender/tool/color","zrender/tool/area","../chart"],function(e){function h(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this),this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("zrender/shape/Text"),i=e("zrender/shape/Line"),s=e("zrender/shape/Polygon"),o=e("../config"),u=e("../util/ecData"),a=e("../util/number"),f=e("zrender/tool/util"),l=e("zrender/tool/color"),c=e("zrender/tool/area");return h.prototype={type:o.CHART_TYPE_FUNNEL,_buildShape:function(){var e=this.series,t=this.component.legend;this._paramsMap={},this._selected={},this.selectedMap={};var n;for(var r=0,i=e.length;r1?(i.height-(o-1)*h)/o:i.height,d,v=i.y,m=n.sort==="descending"?this._getItemWidth(e,u[0].value):a.parsePercent(n.minSize,i.width),g=n.sort==="descending"?1:0,y=i.centerX,b=[[y-m/2-(m===0?0:10),v-(m===0?10:5)],[y+m/2+(m===0?0:10),v-(m===0?10:5)]];for(var f=0,l=u.length;fc.getTextWidth(w,E)?T="#fff":T=l.reverse(n)):g.position==="left"?(S="right",x=b==="auto"?d.x-10:d.centerX-Math.max(o,u)/2-b):(S="left",x=b==="auto"?d.x+d.width+10:d.centerX+Math.max(o,u)/2+b);var N={zlevel:this._zlevelBase+1,style:{x:x,y:s+a/2,color:y.color||T,text:w,textAlign:y.align||S,textBaseline:y.baseline||"middle",textFont:E}};return m="emphasis",g=v[m].label||g,y=g.textStyle||y,b=v[m].labelLine.length||b,g.position=g.position||v.normal.label.position,w=this.getLabelText(e,t,m),E=this.getFont(y),T=n,g.position==="inner"||g.position==="inside"?(S="center",x=i+o/2,Math.max(o,u)/2>c.getTextWidth(w,E)?T="#fff":T=l.reverse(n)):g.position==="left"?(S="right",x=b==="auto"?d.x-10:d.centerX-Math.max(o,u)/2-b):(S="left",x=b==="auto"?d.x+d.width+10:d.centerX+Math.max(o,u)/2+b),N.highlightStyle={x:x,color:y.color||T,text:w,textAlign:y.align||S,textFont:E,brushType:"fill"},new r(N)},getLabelText:function(e,t,n){var r=this.series,i=r[e],s=i.data[t],o=this.deepQuery([s,i],"itemStyle."+n+".label.formatter");if(!o)return s.name;if(typeof o=="function")return o.call(this.myChart,i.name,s.name,s.value);if(typeof o=="string")return o=o.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}"),o=o.replace("{a0}",i.name).replace("{b0}",s.name).replace("{c0}",s.value),o},getLabelLine:function(e,t,n,r,s,o,u,a){var l=this.series[e],c=l.data[t],h=this._paramsMap[e].location,p=f.merge(f.clone(c.itemStyle)||{},l.itemStyle),d="normal",v=p[d].labelLine,m=p[d].labelLine.length,g=v.lineStyle||{},y=p[d].label;y.position=y.position||p.normal.label.position;var b;y.position==="inner"||y.position==="inside"?b=r+o/2:y.position==="left"?b=m==="auto"?h.x-10:h.centerX-Math.max(o,u)/2-m:b=m==="auto"?h.x+h.width+10:h.centerX+Math.max(o,u)/2+m;var w={zlevel:this._zlevelBase+1,hoverable:!1,style:{xStart:h.centerX,yStart:s+a/2,xEnd:b,yEnd:s+a/2,strokeColor:g.color||n,lineType:g.type,lineWidth:g.width}};return d="emphasis",v=p[d].labelLine||v,m=p[d].labelLine.length||m,g=v.lineStyle||g,y=p[d].label||y,y.position=y.position,y.position==="inner"||y.position==="inside"?b=r+o/2:y.position==="left"?b=m==="auto"?h.x-10:h.centerX-Math.max(o,u)/2-m:b=m==="auto"?h.x+h.width+10:h.centerX+Math.max(o,u)/2+m,w.highlightStyle={xEnd:b,strokeColor:g.color||n,lineType:g.type,lineWidth:g.width},new i(w)},_needLabel:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".label.show")},_needLabelLine:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".labelLine.show")},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()}},f.inherits(h,n),f.inherits(h,t),e("../chart").define("funnel",h),h}),r("echarts/component/categoryAxis",["require","./base","zrender/shape/Text","zrender/shape/Line","zrender/shape/Rectangle","../config","zrender/tool/util","zrender/tool/area","../component"],function(e){function a(e,n,r,i,s,o){if(i.data.length<1){console.error("option.data.length < 1.");return}t.call(this,e,n,r,i,s),this.grid=this.component.grid;for(var u in o)this[u]=o[u];this.refresh(i)}var t=e("./base"),n=e("zrender/shape/Text"),r=e("zrender/shape/Line"),i=e("zrender/shape/Rectangle"),s=e("../config"),o=e("zrender/tool/util"),u=e("zrender/tool/area");return a.prototype={type:s.COMPONENT_TYPE_AXIS_CATEGORY,_getReformedLabel:function(e){var t=typeof this.option.data[e].value!="undefined"?this.option.data[e].value:this.option.data[e],n=this.option.data[e].formatter||this.option.axisLabel.formatter;return n&&(typeof n=="function"?t=n.call(this.myChart,t):typeof n=="string"&&(t=n.replace("{value}",t))),t},_getInterval:function(){var e=this.option.axisLabel.interval;if(e=="auto"){var t=this.option.axisLabel.textStyle.fontSize,n=this.option.data,r=this.option.data.length;if(this.isHorizontal())if(r>3){var i=this.getGap(),s=!1,a,f,l=Math.floor(.5/i);l=l<1?1:l,e=Math.floor(15/i);while(!s&&e=0;c-=e){if(this.option.axisLabel.rotate!==0)f=t;else if(n[c].textStyle)f=u.getTextWidth(this._getReformedLabel(c),this.getFont(o.merge(n[c].textStyle,this.option.axisLabel.textStyle)));else{var h=this._getReformedLabel(c)+"",p=(h.match(/\w/g)||"").length,d=h.length-p;f=p*t*2/3+d*t}if(a3){var i=this.getGap();e=Math.floor(11/i);while(i*e-60?-u:0;if(this.isHorizontal()){var c=this.option.position=="bottom"?n.inside?this.grid.getYend()-i-1:this.grid.getYend()+1:n.inside?this.grid.getY()+1:this.grid.getY()-i-1,h;for(var p=l;p=0?f:0),o),e={_axisShape:"axisTick",zlevel:this._zlevelBase,hoverable:!1,style:{xStart:h,yStart:c,xEnd:h,yEnd:c+i,strokeColor:s,lineWidth:o}},this.shapeList.push(new r(e))}else{var d=this.option.position=="left"?n.inside?this.grid.getX()+1:this.grid.getX()-i-1:n.inside?this.grid.getXend()-i-1:this.grid.getXend()+1,v;for(var p=l;p=0?f:0),o),e={_axisShape:"axisTick",zlevel:this._zlevelBase,hoverable:!1,style:{xStart:d,yStart:v,xEnd:d+i,yEnd:v,strokeColor:s,lineWidth:o}},this.shapeList.push(new r(e))}},_buildAxisLabel:function(){var e,t=this.option.data,r=this.option.data.length,i=this.option.axisLabel.rotate,s=this.option.axisLabel.margin,u=this.option.axisLabel.clickable,a=this.option.axisLabel.textStyle,f;if(this.isHorizontal()){var l,c;this.option.position=="bottom"?(l=this.grid.getYend()+s,c="top"):(l=this.grid.getY()-s,c="bottom");for(var h=0;h0?this.option.position=="bottom"?"right":"left":this.option.position=="bottom"?"left":"right",e.rotation=[i*Math.PI/180,e.style.x,e.style.y]),this.shapeList.push(new n(this._axisLabelClickable(u,e)))}}else{var p,d;this.option.position=="left"?(p=this.grid.getX()-s,d="right"):(p=this.grid.getXend()+s,d="left");for(var h=0;h1?e-1:1)},getCoord:function(e){var t=this.option.data,n=t.length,r=this.getGap(),i=this.option.boundaryGap?r/2:0;for(var s=0;sthis.option.data.length-1)return this.isHorizontal()?this.grid.getXend():this.grid.getY();var t=this.getGap(),n=this.option.boundaryGap?t/2:0;return n+=e*t,this.isHorizontal()?n=this.grid.getX()+n:n=this.grid.getYend()-n,n},getNameByIndex:function(e){var t=this.option.data[e];return typeof t!="undefined"&&typeof t.value!="undefined"?t.value:t},getIndexByName:function(e){var t=this.option.data,n=t.length;for(var r=0;r0?this.option.position==="bottom"?"right":"left":this.option.position==="bottom"?"left":"right",e.rotation=[i*Math.PI/180,e.style.x,e.style.y]),this.shapeList.push(new n(this._axisLabelClickable(o,e)))}else{var c,h;this.option.position==="left"?(c=this.grid.getX()-s,h="right"):(c=this.grid.getXend()+s,h="left");for(var l=0;l=0?t[h][l]!=null?t[h][l]+=n:t[h][l]=n:t[p][l]!=null?t[p][l]+=n:t[p][l]=n,this.option.scale&&t[f].push(n)}}}for(var u in t){e=t[u];for(var l=0,c=e.length;l0?this.option.power:1:this._max>0?this._min=this._max/this.option.splitNumber:this._max=this._max/this.option.splitNumber),this._reformValue(this.option.scale)}else this._hasData=!0,this._min=this.option.min-0,this._max=this.option.max-0,this._customerValue()},_reformValue:function(e){var t=this.option.splitNumber,n=this.option.precision,r,i;n===0?i=this.option.power>1?this.option.power:1:(i=Math.pow(10,n),this._min*=i,this._max*=i,i=this.option.power);var s;if(this._min>=0&&this._max>=0){if(!e){while(this._max/i1?i/10:1,s=this._max-this._min,r=Math.ceil(s/t/i)*i,this._max=this._min+r*t}else if(this._min<=0&&this._max<=0){i=-i;if(!e){while(this._min/ii&&i!=-1)i/=10;n===0&&(this._min=Math.ceil(this._min/i)*i,this._max=Math.floor(this._max/i)*i)}i=i<-1?i/10:-1,s=this._min-this._max,r=-Math.ceil(s/t/i)*i,this._min=-r*t+this._max}else{s=this._max-this._min;while(s/ithis._max?this._max:e;var t;return this.isHorizontal()?t=this.grid.getX()+(e-this._min)/(this._max-this._min)*this.grid.getWidth():t=this.grid.getYend()-(e-this._min)/(this._max-this._min)*this.grid.getHeight(),t},getCoordSize:function(e){return this.isHorizontal()?Math.abs(e/(this._max-this._min)*this.grid.getWidth()):Math.abs(e/(this._max-this._min)*this.grid.getHeight())},getValueFromCoord:function(e){var t;return this.isHorizontal()?(e=ethis.grid.getXend()?this.grid.getXend():e,t=this._min+(e-this.grid.getX())/this.grid.getWidth()*(this._max-this._min)):(e=ethis.grid.getYend()?this.grid.getYend():e,t=this._max-(e-this.grid.getY())/this.grid.getHeight()*(this._max-this._min)),t.toFixed(2)-0}},o.inherits(u,t),e("../component").define("valueAxis",u),u}),r("echarts/component/axis",["require","./base","zrender/shape/Line","../config","../util/ecData","zrender/tool/util","zrender/tool/color","./categoryAxis","./valueAxis","../component"],function(e){function u(e,n,r,i,s,o){t.call(this,e,n,r,i,s),this.axisType=o,this._axisList=[],this.refresh(i)}var t=e("./base"),n=e("zrender/shape/Line"),r=e("../config"),i=e("../util/ecData"),s=e("zrender/tool/util"),o=e("zrender/tool/color");return u.prototype={type:r.COMPONENT_TYPE_AXIS,axisBase:{_buildAxisLine:function(){var e=this.option.axisLine.lineStyle.width,t=e/2,r={_axisShape:"axisLine",zlevel:this._zlevelBase+1,hoverable:!1};switch(this.option.position){case"left":r.style={xStart:this.grid.getX()-t,yStart:this.grid.getYend(),xEnd:this.grid.getX()-t,yEnd:this.grid.getY(),lineCap:"round"};break;case"right":r.style={xStart:this.grid.getXend()+t,yStart:this.grid.getYend(),xEnd:this.grid.getXend()+t,yEnd:this.grid.getY(),lineCap:"round"};break;case"bottom":r.style={xStart:this.grid.getX(),yStart:this.grid.getYend()+t,xEnd:this.grid.getXend(),yEnd:this.grid.getYend()+t,lineCap:"round"};break;case"top":r.style={xStart:this.grid.getX(),yStart:this.grid.getY()-t,xEnd:this.grid.getXend(),yEnd:this.grid.getY()-t,lineCap:"round"}}this.option.name!==""&&(r.style.text=this.option.name,r.style.textPosition=this.option.nameLocation,r.style.textFont=this.getFont(this.option.nameTextStyle),this.option.nameTextStyle.align&&(r.style.textAlign=this.option.nameTextStyle.align),this.option.nameTextStyle.baseline&&(r.style.textBaseline=this.option.nameTextStyle.baseline),this.option.nameTextStyle.color&&(r.style.textColor=this.option.nameTextStyle.color)),r.style.strokeColor=this.option.axisLine.lineStyle.color,r.style.lineWidth=e,this.isHorizontal()?r.style.yStart=r.style.yEnd=this.subPixelOptimize(r.style.yEnd,e):r.style.xStart=r.style.xEnd=this.subPixelOptimize(r.style.xEnd,e),r.style.lineType=this.option.axisLine.lineStyle.type,r=new n(r),this.shapeList.push(r)},_axisLabelClickable:function(e,t){return e?(i.pack(t,undefined,-1,undefined,-1,t.style.text),t.hoverable=!0,t.clickable=!0,t.highlightStyle={color:o.lift(t.style.color,1),brushType:"fill"},t):t},refixAxisShape:function(e,t){if(!this.option.axisLine.onZero)return;var n;if(this.isHorizontal()&&t!=null)for(var r=0,i=this.shapeList.length;r2&&(e=[e[0],e[1]]);if(this.axisType==="xAxis"){if(!e[0].position||e[0].position!="bottom"&&e[0].position!="top")e[0].position="bottom";e.length>1&&(e[1].position=e[0].position==="bottom"?"top":"bottom");for(var t=0,n=e.length;t1&&(e[1].position=e[0].position==="left"?"right":"left");for(var t=0,n=e.length;t=0&&(o.isHorizontal()?t=o.getCoord(0):n=o.getCoord(0));if(typeof t!="undefined"||typeof n!="undefined"){s=i.length;while(s--)i[s].refixAxisShape(t,n)}},refresh:function(e){if(e||this._zrWidth!=this.zr.getWidth()||this._zrHeight!=this.zr.getHeight()){this.clear(),this.option=e||this.option,this.option.grid=this.reformOption(this.option.grid);var t=this.option.grid;this._zrWidth=this.zr.getWidth(),this._zrHeight=this.zr.getHeight(),this._x=this.parsePercent(t.x,this._zrWidth),this._y=this.parsePercent(t.y,this._zrHeight);var r=this.parsePercent(t.x2,this._zrWidth),i=this.parsePercent(t.y2,this._zrHeight);typeof t.width=="undefined"?this._width=this._zrWidth-this._x-r:this._width=this.parsePercent(t.width,this._zrWidth),this._width=this._width<=0?10:this._width,typeof t.height=="undefined"?this._height=this._zrHeight-this._y-i:this._height=this.parsePercent(t.height,this._zrHeight),this._height=this._height<=0?10:this._height,this._x=this.subPixelOptimize(this._x,t.borderWidth),this._y=this.subPixelOptimize(this._y,t.borderWidth),this.shapeList.push(new n({zlevel:this._zlevelBase,hoverable:!1,style:{x:this._x,y:this._y,width:this._width,height:this._height,brushType:t.borderWidth>0?"both":"fill",color:t.backgroundColor,strokeColor:t.borderColor,lineWidth:t.borderWidth}})),this.zr.addShape(this.shapeList[0])}}},i.inherits(s,t),e("../component").define("grid",s),s}),r("echarts/component/dataZoom",["require","./base","zrender/shape/Rectangle","zrender/shape/Polygon","../util/shape/Icon","../config","zrender/tool/util","../component","../component"],function(e){function u(e,n,r,i,s){t.call(this,e,n,r,i,s);var o=this;o._ondrift=function(e,t){return o.__ondrift(this,e,t)},o._ondragend=function(){return o.__ondragend()},this._fillerSize=28,this._handleSize=8,this._isSilence=!1,this._zoom={},this.option.dataZoom=this.reformOption(this.option.dataZoom),this.zoomOption=this.option.dataZoom,this._location=this._getLocation(),this._zoom=this._getZoom(),this._backupData(),this.option.dataZoom.show&&this._buildShape(),this._syncData()}var t=e("./base"),n=e("zrender/shape/Rectangle"),r=e("zrender/shape/Polygon"),i=e("../util/shape/Icon"),s=e("../config"),o=e("zrender/tool/util");return u.prototype={type:s.COMPONENT_TYPE_DATAZOOM,_buildShape:function(){this._buildBackground(),this._buildFiller(),this._buildHandle(),this._buildFrame();for(var e=0,t=this.shapeList.length;ep&&(h+=p,p=h-p,h-=p);var d=Math.round((p-h)/100*(this.zoomOption.orient=="horizontal"?this._location.width:this._location.height));return{start:h,end:p,start2:0,end2:100,size:d,xAxisIndex:i,yAxisIndex:o,seriesIndex:r,scatterMap:this._zoom.scatterMap||{}}},_backupData:function(){this._originalData={xAxis:{},yAxis:{},series:{}};var e=this.option.xAxis,t=this._zoom.xAxisIndex;for(var n=0,r=t.length;n1?1:0)),w=t/(i-(i>1?1:0)),E=1;this.zoomOption.orient=="horizontal"&&b<1?E=Math.floor(i*3/e):this.zoomOption.orient=="vertical"&&w<1&&(E=Math.floor(i*3/t));for(var a=0,f=i;athis._location.x?1:0),height:this._location.height-(t>this._location.y?1:0),lineWidth:1,brushType:"stroke",strokeColor:this.zoomOption.handleColor}},this._endFrameShape=o.clone(this._startFrameShape),this._startFrameShape=new n(this._startFrameShape),this._endFrameShape=new n(this._endFrameShape),this.shapeList.push(this._startFrameShape),this.shapeList.push(this._endFrameShape);return},_syncHandleShape:function(){this.zoomOption.orient=="horizontal"?(this._startShape.style.x=this._fillerShae.style.x-this._handleSize,this._endShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._zoom.start=Math.floor((this._startShape.style.x-this._location.x)/this._location.width*100),this._zoom.end=Math.ceil((this._endShape.style.x+this._handleSize-this._location.x)/this._location.width*100)):(this._startShape.style.y=this._fillerShae.style.y-this._handleSize,this._endShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._zoom.start=Math.floor((this._startShape.style.y-this._location.y)/this._location.height*100),this._zoom.end=Math.ceil((this._endShape.style.y+this._handleSize-this._location.y)/this._location.height*100)),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this._syncFrameShape(),this.zr.refresh()},_syncFillerShape:function(){var e,t;this.zoomOption.orient=="horizontal"?(e=this._startShape.style.x,t=this._endShape.style.x,this._fillerShae.style.x=Math.min(e,t)+this._handleSize,this._fillerShae.style.width=Math.abs(e-t)-this._handleSize,this._zoom.start=Math.floor((Math.min(e,t)-this._location.x)/this._location.width*100),this._zoom.end=Math.ceil((Math.max(e,t)+this._handleSize-this._location.x)/this._location.width*100)):(e=this._startShape.style.y,t=this._endShape.style.y,this._fillerShae.style.y=Math.min(e,t)+this._handleSize,this._fillerShae.style.height=Math.abs(e-t)-this._handleSize,this._zoom.start=Math.floor((Math.min(e,t)-this._location.y)/this._location.height*100),this._zoom.end=Math.ceil((Math.max(e,t)+this._handleSize-this._location.y)/this._location.height*100)),this.zr.modShape(this._fillerShae.id),this._syncFrameShape(),this.zr.refresh()},_syncFrameShape:function(){this.zoomOption.orient=="horizontal"?(this._startFrameShape.style.width=this._fillerShae.style.x-this._location.x,this._endFrameShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._endFrameShape.style.width=this._location.x+this._location.width-this._endFrameShape.style.x):(this._startFrameShape.style.height=this._fillerShae.style.y-this._location.y,this._endFrameShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._endFrameShape.style.height=this._location.y+this._location.height-this._endFrameShape.style.y),this.zr.modShape(this._startFrameShape.id),this.zr.modShape(this._endFrameShape.id)},_syncShape:function(){if(!this.zoomOption.show)return;this.zoomOption.orient=="horizontal"?(this._startShape.style.x=this._location.x+this._zoom.start/100*this._location.width,this._endShape.style.x=this._location.x+this._zoom.end/100*this._location.width-this._handleSize,this._fillerShae.style.x=this._startShape.style.x+this._handleSize,this._fillerShae.style.width=this._endShape.style.x-this._startShape.style.x-this._handleSize):(this._startShape.style.y=this._location.y+this._zoom.start/100*this._location.height,this._endShape.style.y=this._location.y+this._zoom.end/100*this._location.height-this._handleSize,this._fillerShae.style.y=this._startShape.style.y+this._handleSize,this._fillerShae.style.height=this._endShape.style.y-this._startShape.style.y-this._handleSize),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this.zr.modShape(this._fillerShae.id),this._syncFrameShape(),this.zr.refresh()},_syncData:function(e){var t,n,r,i,o;for(var u in this._originalData){t=this._originalData[u];for(var a in t){o=t[a];if(typeof o=="undefined")continue;i=o.length,n=Math.floor(this._zoom.start/100*i),r=Math.ceil(this._zoom.end/100*i),this.option[u][a].type!=s.CHART_TYPE_SCATTER?this.option[u][a].data=o.slice(n,r):this.option[u][a].data=this._synScatterData(a,o)}}!this._isSilence&&(this.zoomOption.realtime||e)&&this.messageCenter.dispatch(s.EVENT.DATA_ZOOM,null,{zoom:this._zoom},this.myChart)},_synScatterData:function(e,t){if(this._zoom.start===0&&this._zoom.end==100&&this._zoom.start2===0&&this._zoom.end2==100)return t;var n=[],r=this._zoom.scatterMap[e],i,s,o,u,a;this.zoomOption.orient=="horizontal"?(i=r.x.max-r.x.min,s=this._zoom.start/100*i+r.x.min,o=this._zoom.end/100*i+r.x.min,i=r.y.max-r.y.min,u=this._zoom.start2/100*i+r.y.min,a=this._zoom.end2/100*i+r.y.min):(i=r.x.max-r.x.min,s=this._zoom.start2/100*i+r.x.min,o=this._zoom.end2/100*i+r.x.min,i=r.y.max-r.y.min,u=this._zoom.start/100*i+r.y.min,a=this._zoom.end/100*i+r.y.min);var f;for(var l=0,c=t.length;l=s&&f[0]<=o&&f[1]>=u&&f[1]<=a&&n.push(t[l]);return n},__ondrift:function(e,t,n){this.zoomOption.zoomLock&&(e=this._fillerShae);var r=e._type=="filler"?this._handleSize:0;return this.zoomOption.orient=="horizontal"?e.style.x+t-r<=this._location.x?e.style.x=this._location.x+r:e.style.x+t+e.style.width+r>=this._location.x+this._location.width?e.style.x=this._location.x+this._location.width-e.style.width-r:e.style.x+=t:e.style.y+n-r<=this._location.y?e.style.y=this._location.y+r:e.style.y+n+e.style.height+r>=this._location.y+this._location.height?e.style.y=this._location.y+this._location.height-e.style.height-r:e.style.y+=n,e._type=="filler"?this._syncHandleShape():this._syncFillerShape(),this.zoomOption.realtime&&this._syncData(),!0},__ondragend:function(){this.isDragend=!0},ondragend:function(e,t){if(!this.isDragend||!e.target)return;!this.zoomOption.realtime&&this._syncData(),t.dragOut=!0,t.dragIn=!0,!this._isSilence&&!this.zoomOption.realtime&&this.messageCenter.dispatch(s.EVENT.DATA_ZOOM,null,{zoom:this._zoom},this.myChart),t.needRefresh=!1,this.isDragend=!1;return},ondataZoom:function(e,t){t.needRefresh=!0;return},absoluteZoom:function(e){this._zoom.start=e.start,this._zoom.end=e.end,this._zoom.start2=e.start2,this._zoom.end2=e.end2,this._syncShape(),this._syncData(!0);return},rectZoom:function(e){if(!e)return this._zoom.start=this._zoom.start2=0,this._zoom.end=this._zoom.end2=100,this._syncShape(),this._syncData(!0),this._zoom;var t=this.component.grid.getArea(),n={x:e.x,y:e.y,width:e.width,height:e.height};n.width<0&&(n.x+=n.width,n.width=-n.width),n.height<0&&(n.y+=n.height,n.height=-n.height);if(n.x>t.x+t.width||n.y>t.y+t.height)return!1;n.xt.x+t.width&&(n.width=t.x+t.width-n.x),n.y+n.height>t.y+t.height&&(n.height=t.y+t.height-n.y);var r,i=(n.x-t.x)/t.width,s=1-(n.x+n.width-t.x)/t.width,o=1-(n.y+n.height-t.y)/t.height,u=(n.y-t.y)/t.height;return this.zoomOption.orient=="horizontal"?(r=this._zoom.end-this._zoom.start,this._zoom.start+=r*i,this._zoom.end-=r*s,r=this._zoom.end2-this._zoom.start2,this._zoom.start2+=r*o,this._zoom.end2-=r*u):(r=this._zoom.end-this._zoom.start,this._zoom.start+=r*o,this._zoom.end-=r*u,r=this._zoom.end2-this._zoom.start2,this._zoom.start2+=r*i,this._zoom.end2-=r*s),this._syncShape(),this._syncData(!0),this._zoom},syncBackupData:function(e){var t,n=this._originalData.series,r=e.series,i;for(var s=0,o=r.length;s=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height?!0:!1}},r.inherits(i,t),i}),r("echarts/component/dataRange",["require","./base","zrender/shape/Text","zrender/shape/Rectangle","../util/shape/HandlePolygon","../config","zrender/tool/util","zrender/tool/area","zrender/tool/color","zrender/tool/color","../component"],function(e){function f(e,n,r,i,s){if(typeof this.query(i,"dataRange.min")=="undefined"||typeof this.query(i,"dataRange.max")=="undefined"){console.error("option.dataRange.min or option.dataRange.max has not been defined.");return}t.call(this,e,n,r,i,s);var o=this;o._ondrift=function(e,t){return o.__ondrift(this,e,t)},o._ondragend=function(){return o.__ondragend()},o._dataRangeSelected=function(e){return o.__dataRangeSelected(e)},this._selectedMap={},this._range={},this.refresh(i)}var t=e("./base"),n=e("zrender/shape/Text"),r=e("zrender/shape/Rectangle"),i=e("../util/shape/HandlePolygon"),s=e("../config"),o=e("zrender/tool/util"),u=e("zrender/tool/area"),a=e("zrender/tool/color");return f.prototype={type:s.COMPONENT_TYPE_DATARANGE,_textGap:10,_buildShape:function(){this._itemGroupLocation=this._getItemGroupLocation(),this._buildBackground(),this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable?this._buildGradient():this._buildItem();for(var e=0,t=this.shapeList.length;ep&&(h-=m)):(dv&&(d-=f))}return{x:h,y:d,width:s,height:o}},_getTextShape:function(e,t,n){return{zlevel:this._zlevelBase,style:{x:this.dataRangeOption.orient=="horizontal"?e:this._itemGroupLocation.x+this._itemGroupLocation.width/2,y:this.dataRangeOption.orient=="horizontal"?this._itemGroupLocation.y+this._itemGroupLocation.height/2:t,color:this.dataRangeOption.textStyle.color,text:n,textFont:this.getFont(this.dataRangeOption.textStyle),textBaseline:this.dataRangeOption.orient=="horizontal"?"middle":"top",textAlign:this.dataRangeOption.orient=="horizontal"?"left":"center"},hoverable:!1}},_getItemShape:function(e,t,n,r,i){return{zlevel:this._zlevelBase,style:{x:e,y:t+1,width:n,height:r-2,color:i},highlightStyle:{strokeColor:i,lineWidth:1},clickable:!0}},__ondrift:function(e,t,n){var r=this._calculableLocation.x,i=this._calculableLocation.y,s=this._calculableLocation.width,o=this._calculableLocation.height;return this.dataRangeOption.orient=="horizontal"?e.style.x+t<=r?e.style.x=r:e.style.x+t+e.style.width>=r+s?e.style.x=r+s-e.style.width:e.style.x+=t:e.style.y+n<=i?e.style.y=i:e.style.y+n+e.style.height>=i+o?e.style.y=i+o-e.style.height:e.style.y+=n,e._type=="filler"?this._syncHandleShape():this._syncFillerShape(e),this.dataRangeOption.realtime&&this._syncData(),!0},__ondragend:function(){this.isDragend=!0},ondragend:function(e,t){if(!this.isDragend||!e.target)return;!this.dataRangeOption.realtime&&this._syncData(),t.dragOut=!0,t.dragIn=!0,!this.dataRangeOption.realtime&&!1&&this.messageCenter.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:this._range.end,end:this._range.start}},this.myChart),t.needRefresh=!1,this.isDragend=!1;return},_syncShapeFromRange:function(){var e=this.dataRangeOption.range||{};this._range.end=typeof this._range.end!="undefined"?this._range.end:typeof e.start!="undefined"?e.start:0,this._range.start=typeof this._range.start!="undefined"?this._range.start:typeof e.end!="undefined"?e.end:100;if(this._range.start!=100||this._range.end!==0){if(this.dataRangeOption.orient=="horizontal"){var t=this._fillerShae.style.width;this._fillerShae.style.x+=t*(100-this._range.start)/100,this._fillerShae.style.width=t*(this._range.start-this._range.end)/100}else{var n=this._fillerShae.style.height;this._fillerShae.style.y+=n*(100-this._range.start)/100,this._fillerShae.style.height=n*(this._range.start-this._range.end)/100}this.zr.modShape(this._fillerShae.id),this._syncHandleShape()}},_syncHandleShape:function(){var e=this._calculableLocation.x,t=this._calculableLocation.y,n=this._calculableLocation.width,r=this._calculableLocation.height;this.dataRangeOption.orient=="horizontal"?(this._startShape.style.x=this._fillerShae.style.x,this._startMask.style.width=this._startShape.style.x-e,this._endShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._endMask.style.x=this._endShape.style.x,this._endMask.style.width=e+n-this._endShape.style.x,this._range.start=Math.ceil(100-(this._startShape.style.x-e)/n*100),this._range.end=Math.floor(100-(this._endShape.style.x-e)/n*100)):(this._startShape.style.y=this._fillerShae.style.y,this._startMask.style.height=this._startShape.style.y-t,this._endShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._endMask.style.y=this._endShape.style.y,this._endMask.style.height=t+r-this._endShape.style.y,this._range.start=Math.ceil(100-(this._startShape.style.y-t)/r*100),this._range.end=Math.floor(100-(this._endShape.style.y-t)/r*100)),this._syncShape()},_syncFillerShape:function(e){var t=this._calculableLocation.x,n=this._calculableLocation.y,r=this._calculableLocation.width,i=this._calculableLocation.height,s,o;this.dataRangeOption.orient=="horizontal"?(s=this._startShape.style.x,o=this._endShape.style.x,e.id==this._startShape.id&&s>=o?(o=s,this._endShape.style.x=s):e.id==this._endShape.id&&s>=o&&(s=o,this._startShape.style.x=s),this._fillerShae.style.x=s,this._fillerShae.style.width=o-s,this._startMask.style.width=s-t,this._endMask.style.x=o,this._endMask.style.width=t+r-o,this._range.start=Math.ceil(100-(s-t)/r*100),this._range.end=Math.floor(100-(o-t)/r*100)):(s=this._startShape.style.y,o=this._endShape.style.y,e.id==this._startShape.id&&s>=o?(o=s,this._endShape.style.y=s):e.id==this._endShape.id&&s>=o&&(s=o,this._startShape.style.y=s),this._fillerShae.style.y=s,this._fillerShae.style.height=o-s,this._startMask.style.height=s-n,this._endMask.style.y=o,this._endMask.style.height=n+i-o,this._range.start=Math.ceil(100-(s-n)/i*100),this._range.end=Math.floor(100-(o-n)/i*100)),this._syncShape()},_syncShape:function(){this._startShape.position=[this._startShape.style.x-this._startShape.style._x,this._startShape.style.y-this._startShape.style._y],this._startShape.style.text=this._textFormat(this._gap*this._range.start+this.dataRangeOption.min),this._startShape.style.color=this._startShape.highlightStyle.strokeColor=this.getColor(this._gap*this._range.start+this.dataRangeOption.min),this._endShape.position=[this._endShape.style.x-this._endShape.style._x,this._endShape.style.y-this._endShape.style._y],this._endShape.style.text=this._textFormat(this._gap*this._range.end+this.dataRangeOption.min),this._endShape.style.color=this._endShape.highlightStyle.strokeColor=this.getColor(this._gap*this._range.end+this.dataRangeOption.min),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this.zr.modShape(this._startMask.id),this.zr.modShape(this._endMask.id),this.zr.modShape(this._fillerShae.id),this.zr.refresh()},_syncData:function(){this.dataRangeOption.realtime&&this.messageCenter.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:this._range.end,end:this._range.start}},this.myChart)},__dataRangeSelected:function(e){var t=e.target._idx;this._selectedMap[t]=!this._selectedMap[t],this.messageCenter.dispatch(s.EVENT.REFRESH,null,null,this.myChart)},_textFormat:function(e,t){e=e.toFixed(this.dataRangeOption.precision),t=typeof t!="undefined"?t.toFixed(this.dataRangeOption.precision):"";if(this.dataRangeOption.formatter){if(typeof this.dataRangeOption.formatter=="string")return this.dataRangeOption.formatter.replace("{value}",e).replace("{value2}",t);if(typeof this.dataRangeOption.formatter=="function")return this.dataRangeOption.formatter.call(this.myChart,e,t)}return t!==""?e+" - "+t:e},refresh:function(e){if(e){this.option=e,this.option.dataRange=this.reformOption(this.option.dataRange),this.option.dataRange.padding=this.reformCssArray(this.option.dataRange.padding),this.dataRangeOption=this.option.dataRange;var t=this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable?100:this.dataRangeOption.splitNumber;this._colorList=a.getGradientColors(this.dataRangeOption.color,Math.max((t-this.dataRangeOption.color.length)/(this.dataRangeOption.color.length-1),0)+1);if(this._colorList.length>t){var n=this._colorList.length,r=[this._colorList[0]],i=n/(t-1);for(var s=1;sthis.dataRangeOption.max&&(e=this.dataRangeOption.max);if(this.dataRangeOption.calculable)if(e-(this._gap*this._range.start+this.dataRangeOption.min)>5e-5||e-(this._gap*this._range.end+this.dataRangeOption.min)<-0.00005)return null;var t=this._colorList.length-Math.ceil((e-this.dataRangeOption.min)/(this.dataRangeOption.max-this.dataRangeOption.min)*this._colorList.length);return t==this._colorList.length&&t--,this._selectedMap[t]?this._colorList[t]:null}},o.inherits(f,t),e("../component").define("dataRange",f),f}),r("echarts/chart/scatter",["require","../component/base","./base","../util/shape/Symbol","../component/axis","../component/grid","../component/dataZoom","../component/dataRange","../config","zrender/tool/util","zrender/tool/color","../chart"],function(e){function u(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this),this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("../util/shape/Symbol");e("../component/axis"),e("../component/grid"),e("../component/dataZoom"),e("../component/dataRange");var i=e("../config"),s=e("zrender/tool/util"),o=e("zrender/tool/color");return u.prototype={type:i.CHART_TYPE_SCATTER,_buildShape:function(){var e=this.series;this._sIndex2ColorMap={},this._symbol=this.option.symbolList,this._sIndex2ShapeMap={},this.selectedMap={},this.xMarkMap={};var t=this.component.legend,n=[],r,s,u,a;for(var f=0,l=e.length;fs[0]&&(i.min0=s[0],i.minY0=r[o][1],i.minX0=r[o][0]),i.max0s[1]&&(i.min1=s[1],i.minY1=r[o][1],i.minX1=r[o][0]),i.max1n.largeThreshold){this.shapeList.push(this._getLargeSymbol(r,this.getItemStyleColor(this.query(n,"itemStyle.normal.color"),o,-1)||this._sIndex2ColorMap[o]));continue}for(var u=0,a=r.length;u0&&this._buildSinglePosition(o,t[o]);this.addShapeList()},_buildSinglePosition:function(e,t){var n=this._mapData(t),r=n.locationMap,i=n.maxDataLength;if(i===0||r.length===0)return;this._buildHorizontal(t,i,r);for(var s=0,o=t.length;s0?a="left":Math.round(i[0])<0?a="right":a="center",f.margin?(p=f.margin,c=i[0]>0?p:-p,h=i[1]>0?p:-p,c=i[0]===0?0:c,h=i[1]===0?0:h,i=this._mapVector(i,o,1)):i=this._mapVector(i,o,1.2),u.textAlign=a,u.x=i[0]+c,u.y=i[1]+h,f.rotate?l=[f.rotate/180*Math.PI,i[0],i[1]]:l=[0,0,0],this.shapeList.push(new n({zlevel:this._zlevelBase,style:u,draggable:!1,hoverable:!1,rotation:l}))}},getIndicatorText:function(e,t){return this.polar[e]&&this.polar[e].__ecIndicator[t]&&this.polar[e].__ecIndicator[t].text},getDropBox:function(e){var e=e||0,t=this.polar[e],n=this.getCenter(e),r=t.__ecIndicator,i=r.length,s=[],o,u,a=t.type;if(a=="polygon"){for(var f=0;fu||u===undefined)&&(u=e),(e=1)a=Math.floor(a/l)*l-l;else{if(l===0)return u>0?(d=0,p=2*u):u===0?(d=0,p=100):(p=0,d=2*a),{max:p,min:d};c=(l+"").split(".")[1],h=c.length,a=Math.floor(a*Math.pow(10,h))/Math.pow(10,h)-l}Math.abs(a)<=l&&(a=0),u=a+Math.floor(l*Math.pow(10,h)*(n+1))/Math.pow(10,h)}else a=a>0?0:a;return r&&(u=u>0?u*1.2:u*.8,a=a>0?a*.8:a*1.2),{max:u,min:a}},_getDelta:function(e,t,n,r,i){var s=(e-t)/n,o,u;if(s>1)return i?(s=Math.ceil(s),s%i>0?(Math.ceil(s/i)+1)*i:s):(o=(s+"").split(".")[0],u=o.length,o.charAt(0)>=5?Math.pow(10,u):(o.charAt(0)-0+1)*Math.pow(10,u-1));if(s==1)return 1;if(s===0)return 0;if(!r){o=(s+"").split(".")[1],u=0;while(o[u]=="0")u++;return o[u]>=5?"0."+o.substring(0,u+1)-0+1/Math.pow(10,u):"0."+o.substring(0,u+1)-0+1/Math.pow(10,u+1)}return Math.ceil(s*Math.pow(10,r))/Math.pow(10,r)},getVector:function(e,t,n){e=e||0,t=t||0;var r=this.polar[e].__ecIndicator;if(t>=r.length)return;var i=this.polar[e].__ecIndicator[t],s=this.getCenter(e),o=i.vector,u=i.value.max,a=i.value.min,f;if(typeof n=="undefined")return s;switch(n){case"min":n=a;break;case"max":n=u;break;case"center":n=(u+a)/2}return u!=a?f=(n-a)/(u-a):f=.5,this._mapVector(o,s,f)},isInside:function(e){var t=this.getNearestIndex(e);return t?t.polarIndex:-1},getNearestIndex:function(e){var t,n,r,i,s,o,u,a,l;for(var c=0;ci[0])return{polarIndex:c,valueIndex:Math.floor((l+a/2)/a)%u}}},getIndicator:function(e){var e=e||0;return this.polar[e].indicator},refresh:function(e){e&&(this.option=e,this.polar=this.option.polar,this.series=this.option.series),this.clear(),this._buildShape()}},a.inherits(l,t),e("../component").define("polar",l),l}),r("echarts/chart/radar",["require","../component/base","./base","zrender/shape/Polygon","../component/polar","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../util/accMath","../chart"],function(e){function a(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this),this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("zrender/shape/Polygon");e("../component/polar");var i=e("../config"),s=e("../util/ecData"),o=e("zrender/tool/util"),u=e("zrender/tool/color");return a.prototype={type:i.CHART_TYPE_RADAR,_buildShape:function(){this.selectedMap={},this._symbol=this.option.symbolList,this._queryTarget,this._dropBoxList=[],this._radarDataCounter=0;var e=this.series,t=this.component.legend,n;for(var r=0,s=e.length;r=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height)return i.isInsidePath(this._pathProxy.pathCommands,0,"fill",e,t)}},r.inherits(s,t),s}),r("echarts/util/kwargs",[],function(){function e(e,t){var n=new RegExp("(\\/\\*[\\w\\'\\,\\(\\)\\s\\r\\n\\*]*\\*\\/)|(\\/\\/[\\w\\s\\'][^\\n\\r]*$)|(\\/]*>)","gim"),r=new RegExp("\\s+","gim"),i=new RegExp("function.*?\\((.*?)\\)","i"),s=e.toString().replace(n,"").replace(r,"").match(i)[1].split(",");return t!==Object(t)&&(t={}),function(){var n=Array.prototype.slice.call(arguments),r=n[n.length-1];r&&r.constructor===Object?n.pop():r={};for(var i=0;i=0){var n=e.split(/\s*:\s*/),r=parseInt(n[2]||1,10),i,s;if(r===0)throw new Error("Slice step cannot be zero");return r>0?(i=parseInt(n[0]||0,10),s=parseInt(n[1]||t,10)):(i=parseInt(n[0]||t-1,10),s=parseInt(n[1]||-1,10)),i<0&&(i=t+i),s<0&&n[1]&&(s=t+s),r>0?(i=Math.max(Math.min(t,i),0),s=Math.max(Math.min(t,s),0)):(i=Math.max(Math.min(t-1,i),-1),s=Math.max(Math.min(t-1,s),-1)),[i,s,r]}var i=parseInt(e,10);i<0&&(i=t+i);if(i<0||i>t)throw new Error(N(e));return i=Math.max(Math.min(t-1,i),0),[i,i+1,1]}function g(e){var t=e[0];for(var n=1;n=this._shape.length)throw new Error(T(e[r]));if(e.length<=1)return this;var i=n.slice();for(var r=0;r=Math.ceil(e.length/2);s--)i[e[r]]=e[s],i[e[s]]=e[r];return this._transposelike(i,t)}),swapaxes:t(function(e,t,n){return this.transpose([e,t],n)}),rollaxis:t(function(e,t,n){if(e>=this._shape.length)throw new Error(T(e));var r=[];for(var i=0;i=this._shape.length||e<0)throw new Error(T(e));var s=this._shape.slice();s.splice(e,1);if(t&&!S(s,t._shape))throw new Error(x(s,t._shape));t||(t=new v(this._dtype),t.initFromShape(s));var o=t._array,u=w(this._shape,e),a=this._shape[e],f=u*a;return n.call(this,o,i,f,a,u),t}return r.call(this,i)},_withPreprocess2:function(e,t,n,r){var i=this._array;if(!this._size)return;if(t&&!S(this._shape,t._shape))throw new Error(x(this._shape,t._shape));t||(t=new v(this._dtype),t.initFromShape(this._shape));var s=t._array;if(typeof e!="undefined"){e<0&&(e=this._shape.length+e);if(e>=this._shape.length||e<0)throw new Error(T(e));if(e>=this._shape.length)throw new Error(T(e));var o=w(this._shape,e),u=this._shape[e],a=o*u;n.call(this,s,i,a,u,o)}else t.reshape([this._size]),r.call(this,s,i);return t},max:t(function(){function e(e,t,n,r,i){var s=0;for(var o=0;of&&(f=c),a+=i}e[s++]=f}}function t(e){var t=e[0];for(var n=1;nt&&(t=e[n]);return t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}()),min:t(function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h,a=c),f+=i}e[s++]=a}}function t(e){var t=e[0],n=0;for(var r=1;rt&&(n=r,t=e[r]);return n}return function(n,r){return this._withPreprocess1(n,r,e,t)}}()),argmin:t(function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h),a+=i}e[s++]=l-f}}function t(e){var t=e[0],n=e[0];for(var r=1;rn&&(n=e[r]);return n-t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}()),sort:t(function(e,t){e<0&&(e=this._shape.length+e);var n;t==="ascending"?n=function(e,t){return e-t}:t==="descending"&&(n=function(e,t){return t-e});var r=this._array,i=w(this._shape,e),s=this._shape[e],o=i*s,u=new Array(s);for(var a=0;as&&(s=a)}var f=s-i,l=t-e;for(var u=0;u=0&&y>=0){if(e._shape[g]==1)i.unshift(t._shape[y]),b=e.repeat(t._shape[y],g);else if(t._shape[y]==1)i.unshift(e._shape[g]),E=t.repeat(e._shape[g],y);else{if(t._shape[y]!=e._shape[g])throw new Error(x(e._shape,t._shape));i.unshift(e._shape[g])}g--,y--}for(var T=g;T>=0;T--)i.unshift(e._shape[T]);for(var T=y;T>=0;T--)i.unshift(t._shape[T]);e=b,t=E}if(!r)r=new v(this._dtype),r.initFromShape(i);else if(!S(i,r._shape))throw new Error(x(i,r._shape));var N=r._array,C,k,L,A;d?(C=t._shape.length-1,k=!1,L=e,A=t._array):m?(C=e._shape.length-1,k=!0,A=t,L=e._array):(C=Math.abs(e._shape.length-t._shape.length),k=e._shape.length>=t._shape.length,L=e._array,A=t._array);var O=w(i,C),M=i[C],_=O*M,D=r._size/_,P,H,B,j=0;if(k)if(m)for(var F=0;F0)for(var c=r[0];cr[1];c+=r[2])l(e+1,t+s*c);else if(r[2]>0)for(var c=r[0];cr[1];c+=r[2])for(var h=0;hthis._shape.length)throw new Error("Too many indices");var o=i.length,u;s.length?(t=new v(this._dtype),t.initFromShape(s),u=t._array):u=[];var a=this._array,f=0;return l(0,0),s.length?t:u[0]},set:function(e,t){typeof e=="number"&&(e=e.toString());var n=E(this._shape),r=this._parseRanges(e),i=r[0],s=r[1];if(i.length>this._shape.length)throw new Error("Too many indices");var o=typeof t=="number",u=i.length,a=this._array;if(o)var f=t;else{if(!S(s,t.shape()))throw new Error(x(s,t.shape()));var f=t._array}var l=0,c=function(e,t){var r=i[e],s=n[e];if(e0)for(var h=r[0];hr[1];h+=r[2])c(e+1,t+s*h);else if(r[2]>0)for(var h=r[0];hr[1];h+=r[2])for(var p=0;pu)throw new Error(N(e[a]));if(e[a]=0&&h>=0){if(l[c]===1)p=t.repeat(f[h],c);else if(l[c]!==f[h])throw new Error(x(l,f));c--,h--}t=p;var d=w(this._shape,n),u=this._shape[n],m=u*d,y=this._size/m,b=e.length,E=new Uint32Array(y*b),S=0;for(var T=0;T=0){for(var a=_-1;a>=D;a--)i[P--]=A[a];_=D,D=E[--M];for(var a=0;a=0;a--)i[P--]=A[a];return this._array=i,this._shape=k,this._size=L,this}),append:function(){console.warn("TODO")},"delete":t(function(e,t){var n=this._array;typeof e=="number"&&(e=[e]);var r=this._size;typeof t=="undefined"&&(this._shape=[r],t=0);var i=w(this._shape,t),s=this._shape[t],o=i*s,u=0;for(var a=0;as)throw new Error(N(l));if(l=0){var a=Math.floor((u[1]-u[0])/u[2]);a=a<0?0:a,r.push(a)}i++}for(;i0&&(E.style.brushType="both"),E.highlightStyle.lineWidth>0&&(E.highlightStyle.brushType="both"),a.pack(E,this.chordSeries[0],0,t[m],m,g.name);if(u){var S=[b+w]/2;S%=360;var x=S<=90||S>=270;S=S*Math.PI/180;var T=[Math.cos(S),-Math.sin(S)],N=this.showScaleText?35+h:h,C=l.scale([],T,this.outerRadius+N);l.add(C,C,this.center);var k={zlevel:this._zlevelBase-1,hoverable:!1,style:{text:g.name,textAlign:x?"left":"right",color:f}};c?(k.rotation=x?S:Math.PI+S,x?k.style.x=this.outerRadius+N:k.style.x=-this.outerRadius-N,k.style.y=0,k.position=this.center):(k.style.x=C[0],k.style.y=C[1]),k.style.textColor=this.deepQuery([g,this.chordSerieSample],"itemStyle.normal.label.textStyle.color")||"#fff",k.style.textFont=this.getFont(this.deepQuery([g,this.chordSerieSample],"itemStyle.normal.label.textStyle")),k=new r(k),this.shapeList.push(k)}E.onmouseover=d(m),E.onmouseout=v(),E=new s(E),this.shapeList.push(E),this.sectorShapes.push(E)}},_buildChords:function(e,t){var n=e.length;if(!n)return;var r=e[0][0].length,i=this.chordSerieSample.itemStyle.normal.chordStyle.lineStyle,s=this.chordSerieSample.itemStyle.emphasis.chordStyle.lineStyle;for(var u=0;u=270,E={zlevel:this._zlevelBase-1,hoverable:!1,style:{x:w?this.outerRadius+this.scaleLineLength+4:-this.outerRadius-this.scaleLineLength-4,y:0,text:Math.round(b.shift()*10)/10+t,textAlign:w?"left":"right"},position:this.center.slice(),rotation:w?[h/180*Math.PI,0,0]:[(h+180)/180*Math.PI,0,0]};E=new r(E),this.shapeList.push(E),g+=this.scaleUnitAngle*5}}},normalizeValue:function(e){var t=[],n=(new c(e)).max(),r,i;n>1e4?(r="k",i=.001):n>1e7?(r="m",i=1e-6):n>1e10?(r="b",i=1e-9):(r="",i=1);for(var s=0;s0&&(i=1/Math.sqrt(i),e[0]=t[0]*i,e[1]=t[1]*i),e},negate:function(e,t){return e[0]=-t[0],e[1]=-t[1],e},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e},set:function(e,t,n){return e[0]=t,e[1]=n,e}}:t=e("zrender/tool/vector");var r=typeof Float32Array=="undefined"?Array:Float32Array;i.prototype.beforeUpdate=function(){for(var e=0;e=e&&this.bbox[1]<=t&&this.bbox[3]>=t},i.prototype.setBBox=function(e,t,n,r){this.bbox[0]=e,this.bbox[1]=t,this.bbox[2]=n,this.bbox[3]=r,this.size=(n-e+r-t)/2},i.prototype._newSubRegion=function(){var e=this.subRegions[this.nSubRegions];return e||(e=new i,this.subRegions[this.nSubRegions]=e),this.nSubRegions++,e},i.prototype._addNodeToSubRegion=function(e){var t=this.findSubRegion(e.position[0],e.position[1]),n=this.bbox;if(!t){var r=(n[0]+n[2])/2,i=(n[1]+n[3])/2,s=(n[2]-n[0])/2,o=(n[3]-n[1])/2,u=e.position[0]>=r?1:0,a=e.position[1]>=i?1:0,t=this._newSubRegion();t.setBBox(u*s+n[0],a*o+n[1],(u+1)*s+n[0],(a+1)*o+n[1])}t.addNode(e)},i.prototype._updateCenterOfMass=function(e){this.centerOfMass==null&&(this.centerOfMass=t.create());var n=this.centerOfMass[0]*this.mass,r=this.centerOfMass[1]*this.mass;n+=e.position[0]*e.mass,r+=e.position[1]*e.mass,this.mass+=e.mass,this.centerOfMass[0]=n/this.mass,this.centerOfMass[1]=r/this.mass},a.prototype.initNodes=function(e,t,n){this.temperature=1;var r=e.length/2;this.nodes.length=0;var i=typeof n!="undefined";for(var o=0;o0&&this.applyNodeGravity(o)}for(var n=0;n0){t.scale(f,f,1/p);var d=t.len(s.speedPrev);d>0&&(p=Math.min(p/d,this.maxSpeedIncrease)*d,t.scaleAndAdd(l,s.speedPrev,f,p))}var v=t.len(l),h=Math.min(v,100)/(v+.1);t.scale(l,l,h),t.add(s.position,s.position,l)}},a.prototype.applyRegionToNodeRepulsion=function(){var e=t.create();return function(r,i){if(r.node)this.applyNodeToNodeRepulsion(r.node,i,!0);else{t.sub(e,i.position,r.centerOfMass);var s=e[0]*e[0]+e[1]*e[1];if(s>this.barnesHutTheta*r.size*r.size){var o=this._k*this._k*(i.mass+r.mass)/(s+1);t.scaleAndAdd(i.force,i.force,e,o*2)}else for(var u=0;u0?u=a*f/(l*l):l<=0&&(u=a*10*f)}else u=a*f/o;s||t.scaleAndAdd(r.force,r.force,e,u*2),t.scaleAndAdd(i.force,i.force,e,-u*2)}}(),a.prototype.applyEdgeAttraction=function(){var e=t.create();return function(r){var i=r.node1,s=r.node2;t.sub(e,i.position,s.position);var o=t.len(e),u;this.edgeWeightInfluence===0?u=1:this.edgeWeightInfluence==1?u=r.weight:u=Math.pow(r.weight,this.edgeWeightInfluence);var a;if(this.preventOverlap){o=o-i.size-s.size;if(o<=0)return}var a=-u*o/this._k;t.scaleAndAdd(i.force,i.force,e,a),t.scaleAndAdd(s.force,s.force,e,-a)}}(),a.prototype.applyNodeGravity=function(){var e=t.create();return function(n){t.sub(e,this.center,n.position),this.width>this.height?e[1]*=this.width/this.height:e[0]*=this.height/this.width;var r=t.len(e)/100;this.strongGravity?t.scaleAndAdd(n.force,n.force,e,r*this.gravity*n.mass):t.scaleAndAdd(n.force,n.force,e,this.gravity*n.mass/(r+1))}}(),a.prototype.updateBBox=function(){var e=Infinity,t=Infinity,n=-Infinity,r=-Infinity;for(var i=0;i0?(a.layout.radius=(a.layout.radius-s)*(i-r)/f+r,a.layout.mass=a.layout.radius/i):(a.layout.radius=(i-r)/2,a.layout.mass=.5)}for(var u=0;uo&&(o=v.layout.weight)}for(var u=0;u.01&&this._layout.step(this._steps)},refresh:function(e){e&&(this.option=e,this.series=this.option.series),this._init()},dispose:function(){this.clear(),this.shapeList=null,this.effectList=null,this._layout.dispose(),this._layout=null,this.__nodePositionMap={}}},l.inherits(p,n),l.inherits(p,t),e("../chart").define("force",p),p}),r("echarts/util/shape/HalfSmoothPolygon",["require","zrender/shape/Base","zrender/shape/util/smoothBezier","zrender/tool/util","zrender/shape/Polygon"],function(e){function i(e){t.call(this,e)}var t=e("zrender/shape/Base"),n=e("zrender/shape/util/smoothBezier"),r=e("zrender/tool/util");return i.prototype={type:"half-smooth-polygon",buildPath:function(t,r){var i=r.pointList;if(i.length<2)return;if(r.smooth){var s=n(i.slice(0,-2),r.smooth,!1,r.smoothConstraint);t.moveTo(i[0][0],i[0][1]);var o,u,a,f=i.length;for(var l=0;l0&&this._buildSinglePosition(f,t[f]);this.addShapeList()},_buildSinglePosition:function(e,t){var n=this._mapData(t),r=n.locationMap,i=n.maxDataLength;if(i===0||r.length===0)return;switch(e){case"bottom":case"top":this._buildHorizontal(t,i,r,this.xMarkMap);break;case"left":case"right":this._buildVertical(t,i,r,this.xMarkMap)}for(var s=0,o=t.length;s0&&(this.finalPLMap[s]=this.finalPLMap[s]||[],this.finalPLMap[s].push(g[s]),g[s]=[]);continue}b>=0?(p-=T>0?l.getCoordSize(b):d-l.getCoord(b),h=p):b<0&&(v+=T>0?l.getCoordSize(b):l.getCoord(b)-m,h=v),g[s].push([c,h,w,a.getNameByIndex(w),c,d]),r[s].min>b&&(r[s].min=b,r[s].minY=h,r[s].minX=c),r[s].max0&&(this.finalPLMap[k]=this.finalPLMap[k]||[],this.finalPLMap[k].push(g[k]),g[k]=[]);for(var S=0,x=n.length;S0&&(r[s].average=(r[s].sum/r[s].counter).toFixed(2)-0),h=this.component.yAxis.getAxis(i[s].yAxisIndex||0).getCoord(r[s].average),r[s].averageLine=[[this.component.grid.getX(),h],[this.component.grid.getXend(),h]],r[s].minLine=[[this.component.grid.getX(),r[s].minY],[this.component.grid.getXend(),r[s].minY]],r[s].maxLine=[[this.component.grid.getX(),r[s].maxY],[this.component.grid.getXend(),r[s].maxY]];this._buildBorkenLine(e,this.finalPLMap,a,"horizontal")},_buildVertical:function(e,t,n,r){var i=this.series,s=n[0][0],o=i[s],u=o.yAxisIndex,a=this.component.yAxis.getAxis(u),f,l,c,h,p,d,v,m,g={},y,b;for(var w=0,E=t;w0&&(this.finalPLMap[s]=this.finalPLMap[s]||[],this.finalPLMap[s].push(g[s]),g[s]=[]);continue}b>=0?(p+=T>0?l.getCoordSize(b):l.getCoord(b)-d,c=p):b<0&&(v-=T>0?l.getCoordSize(b):m-l.getCoord(b),c=v),g[s].push([c,h,w,a.getNameByIndex(w),d,h]),r[s].min>b&&(r[s].min=b,r[s].minX=c,r[s].minY=h),r[s].max0&&(this.finalPLMap[k]=this.finalPLMap[k]||[],this.finalPLMap[k].push(g[k]),g[k]=[]);for(var S=0,x=n.length;S0&&(r[s].average=(r[s].sum/r[s].counter).toFixed(2)-0),c=this.component.xAxis.getAxis(i[s].xAxisIndex||0).getCoord(r[s].average),r[s].averageLine=[[c,this.component.grid.getYend()],[c,this.component.grid.getY()]],r[s].minLine=[[r[s].minX,this.component.grid.getYend()],[r[s].minX,this.component.grid.getY()]],r[s].maxLine=[[r[s].maxX,this.component.grid.getYend()],[r[s].maxX,this.component.grid.getY()]];this._buildBorkenLine(e,this.finalPLMap,a,"vertical")},_buildBorkenLine:function(e,t,n,i){var o=this.series,l;for(var c=e.length-1;c>=0;c--){var h=e[c],p=o[h],d=t[h];if(p.type===this.type&&d!=null){var v=this._getBbox(h,i),m=this._sIndex2ColorMap[h],g=this.query(p,"itemStyle.normal.lineStyle.width"),y=this.query(p,"itemStyle.normal.lineStyle.type"),b=this.query(p,"itemStyle.normal.lineStyle.color"),w=this.getItemStyleColor(this.query(p,"itemStyle.normal.color"),h,-1),E=this.query(p,"itemStyle.normal.areaStyle")!=null,S=this.query(p,"itemStyle.normal.areaStyle.color");for(var x=0,T=d.length;x=0;r--){f=this.shapeList[r]._seriesIndex;if(n[f]&&!n[f][3]){if(this.shapeList[r]._main&&this.shapeList[r].style.pointList.length>1){l=this.shapeList[r].style.pointList,o=Math.abs(l[0][0]-l[1][0]),a=Math.abs(l[0][1]-l[1][1]),c=this.shapeList[r]._orient==="horizontal";if(n[f][2]){if(this.shapeList[r].type==="polygon"){var h=l.length;this.shapeList[r].style.pointList[h-3]=l[h-2],c?this.shapeList[r].style.pointList[h-3][0]=l[h-4][0]:this.shapeList[r].style.pointList[h-3][1]=l[h-4][1],this.shapeList[r].style.pointList[h-2]=l[h-1]}this.shapeList[r].style.pointList.pop(),c?(s=o,u=0):(s=0,u=-a)}else{this.shapeList[r].style.pointList.shift();if(this.shapeList[r].type==="polygon"){var p=this.shapeList[r].style.pointList.pop();c?p[0]=l[0][0]:p[1]=l[0][1],this.shapeList[r].style.pointList.push(p)}c?(s=-o,u=0):(s=0,u=a)}this.zr.modShape(this.shapeList[r].id,{style:{pointList:this.shapeList[r].style.pointList}},!0)}else{if(n[f][2]&&this.shapeList[r]._dataIndex===t[f].data.length-1){this.zr.delShape(this.shapeList[r].id);continue}if(!n[f][2]&&this.shapeList[r]._dataIndex===0){this.zr.delShape(this.shapeList[r].id);continue}}this.shapeList[r].position=[0,0],this.zr.animate(this.shapeList[r].id,"").when(500,{position:[s,u]}).start()}}}},i.prototype.iconLibrary.legendLineIcon=c,a.inherits(l,n),a.inherits(l,t),e("../chart").define("line",l),l}),r("echarts/chart/bar",["require","../component/base","./base","zrender/shape/Rectangle","../component/axis","../component/grid","../component/dataZoom","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../chart"],function(e){function a(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this),this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("zrender/shape/Rectangle");e("../component/axis"),e("../component/grid"),e("../component/dataZoom");var i=e("../config"),s=e("../util/ecData"),o=e("zrender/tool/util"),u=e("zrender/tool/color");return a.prototype={type:i.CHART_TYPE_BAR,_buildShape:function(){var e=this.series;this.selectedMap={},this.xMarkMap={},this._sIndex2colorMap={};var t={top:[],bottom:[],left:[],right:[]},n,r,s,o;for(var u=0,a=e.length;u0&&this._buildSinglePosition(f,t[f],this.xMarkMap);this.addShapeList()},_buildSinglePosition:function(e,t,n){var r=this._mapData(t),i=r.locationMap,s=r.maxDataLength;if(s===0||i.length===0)return;switch(e){case"bottom":case"top":this._buildHorizontal(s,i,t,n);break;case"left":case"right":this._buildVertical(s,i,t,n)}},_mapData:function(e){var t=this.series,n,r=0,i={},s="__kener__stack__",o,u,a=this.component.legend,f=[],l=0,c;for(var h=0,p=e.length;h0&&(c.style.x+=1,c.style.y+=1,c.style.width-=2,c.style.height-=2,c.style.strokeColor=c.highlightStyle.strokeColor=n.itemStyle.normal.barBorderColor,c.highlightStyle.lineWidth=3,c.style.brushType="both"),a.setItemShape(u,c))):(this.selectedMap[u]=!0,this._sIndex2colorMap[e[h]]=this.zr.getColor(e[h])),this.selectedMap[u]&&(o=n.stack||s+e[h],i[o]==null?(i[o]=r,f[r]=[e[h]],r++):f[i[o]].push(e[h])),l=Math.max(l,n.data.length);return{locationMap:f,maxDataLength:l}},_buildHorizontal:function(e,t,n,i){var s=this.series,o=t[0][0],u=s[o],a=u.xAxisIndex,f=this.component.xAxis.getAxis(a),l,c,h=this._mapSize(f,t),p=h.gap,d=h.barGap,v=h.barWidthMap,m=h.barWidth,g=h.barMinHeightMap,y,b=h.interval,w,E,S,x,T,N,C,k,L;for(var A=0,O=e;A0?(y=D>0?c.getCoordSize(L):x-c.getCoord(L),P===1&&g[o]>y&&(y=g[o]),S-=y,E=S):L<0?(y=D>0?c.getCoordSize(L):c.getCoord(L)-N,P===1&&g[o]>y&&(y=g[o]),E=T,T+=y):(y=0,S-=y,E=S),i[o][A]=w+(v[o]||m)/2,i[o].min>L&&(i[o].min=L,i[o].minY=E,i[o].minX=i[o][A]),i[o].max0&&(i[o].average=(i[o].sum/i[o].counter).toFixed(2)-0),E=this.component.yAxis.getAxis(s[o].yAxisIndex||0).getCoord(i[o].average),i[o].averageLine=[[this.component.grid.getX(),E],[this.component.grid.getXend(),E]],i[o].minLine=[[this.component.grid.getX(),i[o].minY],[this.component.grid.getXend(),i[o].minY]],i[o].maxLine=[[this.component.grid.getX(),i[o].maxY],[this.component.grid.getXend(),i[o].maxY]],i[o].isHorizontal=!0,this.buildMark(o)},_buildVertical:function(e,t,n,i){var s=this.series,o=t[0][0],u=s[o],a=u.yAxisIndex,f=this.component.yAxis.getAxis(a),l,c,h=this._mapSize(f,t),p=h.gap,d=h.barGap,v=h.barWidthMap,m=h.barWidth,g=h.barMinHeightMap,y,b=h.interval,w,E,S,x,T,N,C,k,L;for(var A=0,O=e;A0?(y=D>0?c.getCoordSize(L):c.getCoord(L)-x,P===1&&g[o]>y&&(y=g[o]),w=S,S+=y):L<0?(y=D>0?c.getCoordSize(L):N-c.getCoord(L),P===1&&g[o]>y&&(y=g[o]),T-=y,w=T):(y=0,w=S,S+=y),i[o][A]=E-(v[o]||m)/2,i[o].min>L&&(i[o].min=L,i[o].minX=w+y,i[o].minY=i[o][A]),i[o].max0&&(i[o].average=(i[o].sum/i[o].counter).toFixed(2)-0),w=this.component.xAxis.getAxis(s[o].xAxisIndex||0).getCoord(i[o].average),i[o].averageLine=[[w,this.component.grid.getYend()],[w,this.component.grid.getY()]],i[o].minLine=[[i[o].minX,this.component.grid.getYend()],[i[o].minX,this.component.grid.getY()]],i[o].maxLine=[[i[o].maxX,this.component.grid.getYend()],[i[o].maxX,this.component.grid.getY()]],i[o].isHorizontal=!1,this.buildMark(o)},_mapSize:function(e,t,n){var r=this.series,i,s={},o={},u,a=0,f=0,l,c,h,p,d=1;for(var v=0,m=t.length;v1?typeof c=="string"&&c.match(/%$/)?Math.floor(e.getGap()*(100-parseFloat(c))/100):e.getGap()-c:f,x=0,l=a>1?Math.floor((S-f)/(a-1)):0;if(l<0)return this._mapSize(e,t,!0)}return{barWidthMap:s,barMinHeightMap:o,gap:S,barWidth:x,barGap:l,interval:d}},_getBarItem:function(e,t,n,r,i,o,a,f){var l=this.series,c,h=l[e],p=h.data[t],d=this._sIndex2colorMap[e],v=[p,h],m=this.deepQuery(v,"itemStyle.normal.color")||d,g=this.deepQuery(v,"itemStyle.emphasis.color"),y=this.deepMerge(v,"itemStyle.normal"),b=y.barBorderWidth,w=this.deepMerge(v,"itemStyle.emphasis");c={zlevel:this._zlevelBase,clickable:this.deepQuery(v,"clickable"),style:{x:r,y:i,width:o,height:a,brushType:"both",color:this.getItemStyleColor(m,e,t,p),radius:y.barBorderRadius,lineWidth:b,strokeColor:y.barBorderColor},highlightStyle:{color:this.getItemStyleColor(g,e,t,p),radius:w.barBorderRadius,lineWidth:w.barBorderWidth,strokeColor:w.barBorderColor},_orient:f},c.highlightStyle.color=c.highlightStyle.color||(typeof c.style.color=="string"?u.lift(c.style.color,-0.3):c.style.color),b>0&&c.style.height>b&&c.style.width>b?(c.style.y+=b/2,c.style.height-=b,c.style.x+=b/2,c.style.width-=b):c.style.brushType="fill",c.highlightStyle.textColor=c.highlightStyle.color,c=this.addLabel(c,h,p,n,f);if(c.style.textPosition==="insideLeft"||c.style.textPosition==="insideRight"||c.style.textPosition==="insideTop"||c.style.textPosition==="insideBottom"){var E=5;switch(c.style.textPosition){case"insideLeft":c.style.textX=c.style.x+E,c.style.textY=c.style.y+c.style.height/2,c.style.textAlign="left",c.style.textBaseline="middle";break;case"insideRight":c.style.textX=c.style.x+c.style.width-E,c.style.textY=c.style.y+c.style.height/2,c.style.textAlign="right",c.style.textBaseline="middle";break;case"insideTop":c.style.textX=c.style.x+c.style.width/2,c.style.textY=c.style.y+E/2,c.style.textAlign="center",c.style.textBaseline="top";break;case"insideBottom":c.style.textX=c.style.x+c.style.width/2,c.style.textY=c.style.y+c.style.height-E/2,c.style.textAlign="center",c.style.textBaseline="bottom"}c.style.textPosition="specific",c.style.textColor=c.style.textColor||"#fff"}return this.deepQuery([p,h,this.option],"calculable")&&(this.setCalculable(c),c.draggable=!0),s.pack(c,l[e],e,l[e].data[t],t,n),c},getMarkCoord:function(e,t){var n=this.series[e],r=this.xMarkMap[e],i=this.component.xAxis.getAxis(n.xAxisIndex),s=this.component.yAxis.getAxis(n.yAxisIndex),o,u;if(!t.type||t.type!=="max"&&t.type!=="min"&&t.type!=="average")if(r.isHorizontal){o=typeof t.xAxis=="string"&&i.getIndexByName?i.getIndexByName(t.xAxis):t.xAxis||0;var a=r[o];a=a!=null?a:typeof t.xAxis!="string"&&i.getCoordByIndex?i.getCoordByIndex(t.xAxis||0):i.getCoord(t.xAxis||0),u=[a,s.getCoord(t.yAxis||0)]}else{o=typeof t.yAxis=="string"&&s.getIndexByName?s.getIndexByName(t.yAxis):t.yAxis||0;var f=r[o];f=f!=null?f:typeof t.yAxis!="string"&&s.getCoordByIndex?s.getCoordByIndex(t.yAxis||0):s.getCoord(t.yAxis||0),u=[i.getCoord(t.xAxis||0),f]}else u=[r[t.type+"X"],r[t.type+"Y"],r[t.type+"Line"],r[t.type]];return u},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},addDataAnimation:function(e){var t=this.series,n={};for(var r=0,i=e.length;r=0;r--){c=s.get(this.shapeList[r],"seriesIndex");if(n[c]&&!n[c][3]&&this.shapeList[r].type==="rectangle"){h=s.get(this.shapeList[r],"dataIndex"),l=t[c];if(n[c][2]&&h===l.data.length-1){this.zr.delShape(this.shapeList[r].id);continue}if(!n[c][2]&&h===0){this.zr.delShape(this.shapeList[r].id);continue}this.shapeList[r]._orient==="horizontal"?(f=this.component.yAxis.getAxis(l.yAxisIndex||0).getGap(),a=n[c][2]?-f:f,o=0):(u=this.component.xAxis.getAxis(l.xAxisIndex||0).getGap(),o=n[c][2]?u:-u,a=0),this.shapeList[r].position=[0,0],this.zr.animate(this.shapeList[r].id,"").when(500,{position:[o,a]}).start()}}}},o.inherits(a,n),o.inherits(a,t),e("../chart").define("bar",a),a}),r("echarts/chart/pie",["require","../component/base","./base","zrender/shape/Text","zrender/shape/Ring","zrender/shape/Circle","zrender/shape/Sector","zrender/shape/BrokenLine","../config","../util/ecData","zrender/tool/util","zrender/tool/math","zrender/tool/color","../chart"],function(e){function p(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this);var u=this;u.shapeHandler.onmouseover=function(e){var t=e.target,n=f.get(t,"seriesIndex"),r=f.get(t,"dataIndex"),i=f.get(t,"special"),s=t._lastAddRadius,o=t.style.startAngle,a=t.style.endAngle,l=t.highlightStyle.color,c=u.getLabel(n,r,i,s,o,a,l,!0);c&&u.zr.addHoverShape(c);var h=u.getLabelLine(n,r,s,t.style.r0,t.style.r,o,a,l,!0);h&&u.zr.addHoverShape(h)},this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("zrender/shape/Text"),i=e("zrender/shape/Ring"),s=e("zrender/shape/Circle"),o=e("zrender/shape/Sector"),u=e("zrender/shape/BrokenLine"),a=e("../config"),f=e("../util/ecData"),l=e("zrender/tool/util"),c=e("zrender/tool/math"),h=e("zrender/tool/color");return p.prototype={type:a.CHART_TYPE_PIE,_buildShape:function(){var e=this.series,t=this.component.legend;this.selectedMap={},this._selected={};var n,r,o;this._selectedMode=!1;var u;for(var l=0,c=e.length;l0&&Math.abs(m-g)<15&&p<4&&this._needLabel(n,r[l],!1)&&this.deepQuery([r[l],n],"itemStyle.normal.label.position")!="center"?d+=h<4?20:-20:d=0,this._buildItem(e,l,h,d,r[l].selected,x,T,m,g,w),v||(m=g)}},_buildItem:function(e,t,n,r,i,s,o,u,a,l){var c=this.series,h=this.getSector(e,t,n,i,s,o,u,a,l);f.pack(h,c[e],e,c[e].data[t],t,c[e].data[t].name,n),h._lastAddRadius=r,this.shapeList.push(h);var p=this.getLabel(e,t,n,r,u,a,l,!1);p&&(f.pack(p,c[e],e,c[e].data[t],t,c[e].data[t].name,n),p._dataIndex=t,this.shapeList.push(p));var d=this.getLabelLine(e,t,r,s,o,u,a,l,!1);d&&(f.pack(d,c[e],e,c[e].data[t],t,c[e].data[t].name,n),d._dataIndex=t,this.shapeList.push(d))},getSector:function(e,t,n,r,i,s,u,a,f){var l=this.series,p=l[e],d=p.data[t],v=[d,p],m=this.parseCenter(this.zr,p.center),g=this.deepMerge(v,"itemStyle.normal")||{},y=this.deepMerge(v,"itemStyle.emphasis")||{},b=this.getItemStyleColor(g.color,e,t,d)||f,w=this.getItemStyleColor(y.color,e,t,d)||(typeof b=="string"?h.lift(b,-0.2):b),E={zlevel:this._zlevelBase,clickable:this.deepQuery(v,"clickable"),style:{x:m[0],y:m[1],r0:i,r:s,startAngle:u,endAngle:a,brushType:"both",color:b,lineWidth:g.borderWidth,strokeColor:g.borderColor,lineJoin:"round"},highlightStyle:{color:w,lineWidth:y.borderWidth,strokeColor:y.borderColor,lineJoin:"round"},_seriesIndex:e,_dataIndex:t};if(r){var S=((E.style.startAngle+E.style.endAngle)/2).toFixed(2)-0;E.style._hasSelected=!0,E.style._x=E.style.x,E.style._y=E.style.y;var x=this.query(p,"selectedOffset");E.style.x+=c.cos(S,!0)*x,E.style.y-=c.sin(S,!0)*x,this._selected[e][t]=!0}else this._selected[e][t]=!1;this._selectedMode&&(E.onclick=this.shapeHandler.onclick),this.deepQuery([d,p,this.option],"calculable")&&(this.setCalculable(E),E.draggable=!0);if(this._needLabel(p,d,!0)||this._needLabelLine(p,d,!0))E.onmouseover=this.shapeHandler.onmouseover;return E=new o(E),E},getLabel:function(e,t,n,i,s,o,u,a){var f=this.series,h=f[e],p=h.data[t];if(!this._needLabel(h,p,a))return;var d=a?"emphasis":"normal",v=l.merge(l.clone(p.itemStyle)||{},h.itemStyle),m=v[d].label,g=m.textStyle||{},y=this.parseCenter(this.zr,h.center),b=y[0],w=y[1],E,S,x=((o+s)/2+360)%360,T=this.parseRadius(this.zr,h.radius),N,C="middle";return m.position=m.position||v.normal.label.position,m.position==="center"?(T=T[1],E=b,S=w,N="center"):m.position==="inner"?(T=(T[0]+T[1])/2+i,E=Math.round(b+T*c.cos(x,!0)),S=Math.round(w-T*c.sin(x,!0)),u="#fff",N="center"):(T=T[1]- -v[d].labelLine.length+i,E=b+T*c.cos(x,!0),S=w-T*c.sin(x,!0),N=x>=90&&x<=270?"right":"left"),m.position!="center"&&m.position!="inner"&&(E+=N==="left"?20:-20),p.__labelX=E-(N==="left"?5:-5),p.__labelY=S,new r({zlevel:this._zlevelBase+1,hoverable:!1,style:{x:E,y:S,color:g.color||u,text:this.getLabelText(e,t,n,d),textAlign:g.align||N,textBaseline:g.baseline||C,textFont:this.getFont(g)},highlightStyle:{brushType:"fill"},_seriesIndex:e,_dataIndex:t})},getLabelText:function(e,t,n,r){var i=this.series,s=i[e],o=s.data[t],u=this.deepQuery([o,s],"itemStyle."+r+".label.formatter");if(!u)return o.name;if(typeof u=="function")return u.call(this.myChart,s.name,o.name,o.value,n);if(typeof u=="string")return u=u.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}").replace("{d}","{d0}"),u=u.replace("{a0}",s.name).replace("{b0}",o.name).replace("{c0}",o.value).replace("{d0}",n),u},getLabelLine:function(e,t,n,r,i,s,o,a,f){var h=this.series,p=h[e],d=p.data[t];if(this._needLabelLine(p,d,f)){var v=f?"emphasis":"normal",m=l.merge(l.clone(d.itemStyle)||{},p.itemStyle),g=m[v].labelLine,y=g.lineStyle||{},b=this.parseCenter(this.zr,p.center),w=b[0],E=b[1],S=i,x=this.parseRadius(this.zr,p.radius)[1]- -g.length+n,T=(o+s)/2%360,N=c.cos(T,!0),C=c.sin(T,!0);return new u({zlevel:this._zlevelBase+1,hoverable:!1,style:{pointList:[[w+S*N,E-S*C],[w+x*N,E-x*C],[d.__labelX,d.__labelY]],strokeColor:y.color||a,lineType:y.type,lineWidth:y.width},_seriesIndex:e,_dataIndex:t})}return},_needLabel:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".label.show")},_needLabelLine:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".labelLine.show")},reformOption:function(e){var t=l.merge;return e=t(e||{},this.ecTheme.pie),e.itemStyle.normal.label.textStyle=t(e.itemStyle.normal.label.textStyle||{},this.ecTheme.textStyle),e.itemStyle.emphasis.label.textStyle=t(e.itemStyle.emphasis.label.textStyle||{},this.ecTheme.textStyle),e},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},addDataAnimation:function(e){var t=this.series,n={};for(var r=0,i=e.length;r{b} : {c}",showDelay:20,hideDelay:100,transitionDuration:.4,backgroundColor:"rgba(0,0,0,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,axisPointer:{type:"line",lineStyle:{color:"#48b",width:2,type:"solid"},crossStyle:{color:"#1e90ff",width:1,type:"dashed"},shadowStyle:{color:"rgba(150,150,150,0.3)",width:"auto",type:"default"}},textStyle:{color:"#fff"}},dataZoom:{show:!1,orient:"horizontal",backgroundColor:"rgba(0,0,0,0)",dataBackgroundColor:"#eee",fillerColor:"rgba(144,197,237,0.2)",handleColor:"rgba(70,130,180,0.8)",realtime:!0},grid:{x:80,y:60,x2:80,y2:60,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},categoryAxis:{position:"bottom",name:"",nameLocation:"end",nameTextStyle:{},boundaryGap:!0,axisLine:{show:!0,onZero:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!0,interval:"auto",inside:!1,length:5,lineStyle:{color:"#333",width:1}},axisLabel:{show:!0,interval:"auto",rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}}},valueAxis:{position:"left",name:"",nameLocation:"end",nameTextStyle:{},boundaryGap:[0,0],precision:0,power:100,splitNumber:5,axisLine:{show:!0,onZero:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,inside:!1,length:5,lineStyle:{color:"#333",width:1}},axisLabel:{show:!0,rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}}},polar:{center:["50%","50%"],radius:"75%",startAngle:90,splitNumber:5,name:{show:!0,textStyle:{color:"#333"}},axisLine:{show:!0,lineStyle:{color:"#ccc",width:1,type:"solid"}},axisLabel:{show:!1,textStyle:{color:"#333"}},splitArea:{show:!0,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}},splitLine:{show:!0,lineStyle:{width:1,color:"#ccc"}},type:"polygon"},timeline:{show:!0,type:"time",notMerge:!1,realtime:!0,x:80,x2:80,y2:0,height:50,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,controlPosition:"left",autoPlay:!1,loop:!0,playInterval:2e3,lineStyle:{width:1,color:"#666",type:"dashed"},label:{show:!0,interval:"auto",rotate:0,textStyle:{color:"#333"}},checkpointStyle:{symbol:"auto",symbolSize:"auto",color:"auto",borderColor:"auto",borderWidth:"auto",label:{show:!1,textStyle:{color:"auto"}}},controlStyle:{normal:{color:"#333"},emphasis:{color:"#1e90ff"}},symbol:"emptyDiamond",symbolSize:4,currentIndex:0},bar:{xAxisIndex:0,yAxisIndex:0,barMinHeight:0,barGap:"30%",barCategoryGap:"20%",itemStyle:{normal:{borderColor:"#fff",borderRadius:0,borderWidth:0,label:{show:!1}},emphasis:{borderColor:"#fff",borderRadius:0,borderWidth:0,label:{show:!1}}}},line:{xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid",shadowColor:"rgba(0,0,0,0)",shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0}},emphasis:{label:{show:!1}}},symbolSize:2,showAllSymbol:!1},k:{xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{color:"#fff",color0:"#00aa11",lineStyle:{width:1,color:"#ff3200",color0:"#00aa11"}},emphasis:{}}},scatter:{xAxisIndex:0,yAxisIndex:0,symbolSize:4,large:!1,largeThreshold:2e3,itemStyle:{normal:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}},emphasis:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}}}},radar:{polarIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid"}},emphasis:{label:{show:!1}}},symbolSize:2},pie:{center:["50%","50%"],radius:[0,"75%"],clockWise:!0,startAngle:90,minAngle:0,selectedOffset:10,itemStyle:{normal:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1,type:"solid"}}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!1},labelLine:{show:!1,length:20,lineStyle:{width:1,type:"solid"}}}}},map:{mapType:"china",mapValuePrecision:0,showLegendSymbol:!0,hoverable:!0,itemStyle:{normal:{borderColor:"rgba(0,0,0,0)",borderWidth:1,areaStyle:{color:"#ccc"},label:{show:!1,textStyle:{color:"rgb(139,69,19)"}}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,areaStyle:{color:"rgba(255,215,0,0.8)"},label:{show:!1,textStyle:{color:"rgb(100,0,0)"}}}}},force:{center:["50%","50%"],size:"100%",coolDown:.99,minRadius:10,maxRadius:20,ratioScaling:!1,large:!1,useWorker:!1,steps:1,scaling:1,gravity:1,symbol:"circle",symbolSize:0,linkSymbol:null,linkSymbolSize:[10,15],draggable:!0,categories:[{}],itemStyle:{normal:{label:{show:!1},nodeStyle:{brushType:"both",color:"#f08c2e",strokeColor:"#5182ab",lineWidth:1},linkStyle:{strokeColor:"#5182ab"}},emphasis:{label:{show:!1},nodeStyle:{},linkStyle:{opacity:0}}}},chord:{radius:["65%","75%"],center:["50%","50%"],padding:2,sort:"none",sortSub:"none",startAngle:90,clockWise:!0,showScale:!1,showScaleText:!1,itemStyle:{normal:{label:{show:!0,rotate:!1,distance:10},lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:1,color:"#999"}}},emphasis:{lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:1,color:"#666"}}}},matrix:[]},gauge:{center:["50%","50%"],radius:"75%",startAngle:225,endAngle:-45,min:0,max:100,precision:0,splitNumber:10,axisLine:{show:!0,lineStyle:{color:[[.2,"#228b22"],[.8,"#48b"],[1,"#ff4500"]],width:30}},axisTick:{show:!0,splitNumber:5,length:8,lineStyle:{color:"#eee",width:1,type:"solid"}},axisLabel:{show:!0,textStyle:{color:"auto"}},splitLine:{show:!0,length:30,lineStyle:{color:"#eee",width:2,type:"solid"}},pointer:{show:!0,length:"80%",width:8,color:"auto"},title:{show:!0,offsetCenter:[0,"-40%"],textStyle:{color:"#333",fontSize:15}},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:40,offsetCenter:[0,"40%"],textStyle:{color:"auto",fontSize:30}}},funnel:{x:80,y:60,x2:80,y2:60,min:0,max:100,minSize:"0%",maxSize:"100%",sort:"descending",gap:0,itemStyle:{normal:{borderColor:"#fff",borderWidth:1,label:{show:!0,position:"outer"},labelLine:{show:!0,length:10,lineStyle:{width:1,type:"solid"}}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!0},labelLine:{show:!0}}}},island:{r:15,calculateStep:.1},markPoint:{symbol:"pin",symbolSize:10,large:!1,effect:{show:!1,loop:!0,period:15,scaleSize:2},itemStyle:{normal:{borderWidth:2,label:{show:!0,position:"inside"}},emphasis:{label:{show:!0}}}},markLine:{symbol:["circle","arrow"],symbolSize:[2,4],large:!1,effect:{show:!1,loop:!0,period:15,scaleSize:2},itemStyle:{normal:{borderWidth:1.5,label:{show:!0,position:"end"},lineStyle:{type:"dashed"}},emphasis:{label:{show:!1},lineStyle:{}}}},textStyle:{decoration:"none",fontFamily:"Arial, Verdana, sans-serif",fontFamily2:"微软雅黑",fontSize:12,fontStyle:"normal",fontWeight:"normal"},EVENT:{REFRESH:"refresh",RESTORE:"restore",RESIZE:"resize",CLICK:"click",HOVER:"hover",DATA_CHANGED:"dataChanged",DATA_ZOOM:"dataZoom",DATA_RANGE:"dataRange",LEGEND_SELECTED:"legendSelected",MAP_SELECTED:"mapSelected",PIE_SELECTED:"pieSelected",MAGIC_TYPE_CHANGED:"magicTypeChanged",DATA_VIEW_CHANGED:"dataViewChanged",TIMELINE_CHANGED:"timelineChanged",MAP_ROAM:"mapRoam",TOOLTIP_HOVER:"tooltipHover",TOOLTIP_IN_GRID:"tooltipInGrid",TOOLTIP_OUT_GRID:"tooltipOutGrid"},DRAG_ENABLE_TIME:120,EFFECT_ZLEVEL:7,symbolList:["circle","rectangle","triangle","diamond","emptyCircle","emptyRectangle","emptyTriangle","emptyDiamond"],loadingText:"Loading...",calculable:!1,calculableColor:"rgba(255,165,0,0.6)",calculableHolderColor:"#ccc",nameConnector:" & ",valueConnector:" : ",animation:!0,addDataAnimation:!0,animationThreshold:2e3,animationDuration:2e3,animationEasing:"ExponentialOut"};return e}),define("zrender/lib/excanvas",["require"],function(e){return document.createElement("canvas").getContext?G_vmlCanvasManager=!1:function(){function f(){return this.context_||(this.context_=new I(this))}function c(e,t,n){var r=l.call(arguments,2);return function(){return e.apply(t,r.concat(l.call(arguments)))}}function h(e){return String(e).replace(/&/g,"&").replace(/"/g,""")}function p(e,t,n){e.namespaces[t]||e.namespaces.add(t,n,"#default#VML")}function d(e){p(e,"g_vml_","urn:schemas-microsoft-com:vml"),p(e,"g_o_","urn:schemas-microsoft-com:office:office");if(!e.styleSheets.ex_canvas_){var t=e.createStyleSheet();t.owningElement.id="ex_canvas_",t.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}function m(e){var t=e.srcElement;switch(e.propertyName){case"width":t.getContext().clearRect(),t.style.width=t.attributes.width.nodeValue+"px",t.firstChild.style.width=t.clientWidth+"px";break;case"height":t.getContext().clearRect(),t.style.height=t.attributes.height.nodeValue+"px",t.firstChild.style.height=t.clientHeight+"px"}}function g(e){var t=e.srcElement;t.firstChild&&(t.firstChild.style.width=t.clientWidth+"px",t.firstChild.style.height=t.clientHeight+"px")}function E(){return[[1,0,0],[0,1,0],[0,0,1]]}function S(e,t){var n=E();for(var r=0;r<3;r++)for(var i=0;i<3;i++){var s=0;for(var o=0;o<3;o++)s+=e[r][o]*t[o][i];n[r][i]=s}return n}function x(e,t){t.fillStyle=e.fillStyle,t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY,t.strokeStyle=e.strokeStyle,t.globalAlpha=e.globalAlpha,t.font=e.font,t.textAlign=e.textAlign,t.textBaseline=e.textBaseline,t.arcScaleX_=e.arcScaleX_,t.arcScaleY_=e.arcScaleY_,t.lineScale_=e.lineScale_}function N(e){var t=e.indexOf("(",3),n=e.indexOf(")",t+1),r=e.substring(t+1,n).split(",");if(r.length!=4||e.charAt(3)!="a")r[3]=1;return r}function C(e){return parseFloat(e)/100}function k(e,t,n){return Math.min(n,Math.max(t,e))}function L(e){var t,n,r,i,s,o;i=parseFloat(e[0])/360%360,i<0&&i++,s=k(C(e[1]),0,1),o=k(C(e[2]),0,1);if(s==0)t=n=r=o;else{var u=o<.5?o*(1+s):o+s-o*s,a=2*o-u;t=A(a,u,i+1/3),n=A(a,u,i),r=A(a,u,i-1/3)}return"#"+y[Math.floor(t*255)]+y[Math.floor(n*255)]+y[Math.floor(r*255)]}function A(e,t,n){return n<0&&n++,n>1&&n--,6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function M(e){if(e in O)return O[e];var t,n=1;e=String(e);if(e.charAt(0)=="#")t=e;else if(/^rgb/.test(e)){var r=N(e),t="#",i;for(var s=0;s<3;s++)r[s].indexOf("%")!=-1?i=Math.floor(C(r[s])*255):i=+r[s],t+=y[k(i,0,255)];n=+r[3]}else if(/^hsl/.test(e)){var r=N(e);t=L(r),n=r[3]}else t=T[e]||e;return O[e]={color:t,alpha:n}}function P(e){if(D[e])return D[e];var t=document.createElement("div"),n=t.style,r;try{n.font=e,r=n.fontFamily.split(",")[0]}catch(i){}return D[e]={style:n.fontStyle||_.style,variant:n.fontVariant||_.variant,weight:n.fontWeight||_.weight,size:n.fontSize||_.size,family:r||_.family}}function H(e,t){var n={};for(var r in e)n[r]=e[r];var i=parseFloat(t.currentStyle.fontSize),s=parseFloat(e.size);return typeof e.size=="number"?n.size=e.size:e.size.indexOf("px")!=-1?n.size=s:e.size.indexOf("em")!=-1?n.size=i*s:e.size.indexOf("%")!=-1?n.size=i/100*s:e.size.indexOf("pt")!=-1?n.size=s/.75:n.size=i,n}function B(e){return e.style+" "+e.variant+" "+e.weight+" "+e.size+"px '"+e.family+"'"}function F(e){return j[e]||"square"}function I(e){this.m_=E(),this.mStack_=[],this.aStack_=[],this.currentPath_=[],this.strokeStyle="#000",this.fillStyle="#000",this.lineWidth=1,this.lineJoin="miter",this.lineCap="butt",this.miterLimit=o*1,this.globalAlpha=1,this.font="12px 微软雅黑",this.textAlign="left",this.textBaseline="alphabetic",this.canvas=e;var t="width:"+e.clientWidth+"px;height:"+e.clientHeight+"px;overflow:hidden;position:absolute",n=e.ownerDocument.createElement("div");n.style.cssText=t,e.appendChild(n);var r=n.cloneNode(!1);r.style.backgroundColor="#fff",r.style.filter="alpha(opacity=0)",e.appendChild(r),this.element_=n,this.arcScaleX_=1,this.arcScaleY_=1,this.lineScale_=1}function R(e,t,n,r){e.currentPath_.push({type:"bezierCurveTo",cp1x:t.x,cp1y:t.y,cp2x:n.x,cp2y:n.y,x:r.x,y:r.y}),e.currentX_=r.x,e.currentY_=r.y}function U(e,t){var n=M(e.strokeStyle),r=n.color,i=n.alpha*e.globalAlpha,s=e.lineScale_*e.lineWidth;s<1&&(i*=s),t.push("')}function z(t,n,r,i){var s=t.fillStyle,u=t.arcScaleX_,a=t.arcScaleY_,f=i.x-r.x,l=i.y-r.y;if(s instanceof $){var c=0,h={x:0,y:0},p=0,d=1;if(s.type_=="gradient"){var v=s.x0_/u,m=s.y0_/a,g=s.x1_/u,y=s.y1_/a,b=W(t,v,m),w=W(t,g,y),E=w.x-b.x,S=w.y-b.y;c=Math.atan2(E,S)*180/Math.PI,c<0&&(c+=360),c<1e-6&&(c=0)}else{var b=W(t,s.x0_,s.y0_);h={x:(b.x-r.x)/f,y:(b.y-r.y)/l},f/=u*o,l/=a*o;var x=e.max(f,l);p=2*s.r0_/x,d=2*s.r1_/x-p}var T=s.colors_;T.sort(function(e,t){return e.offset-t.offset});var N=T.length,C=T[0].color,k=T[N-1].color,L=T[0].alpha*t.globalAlpha,A=T[N-1].alpha*t.globalAlpha,O=[];for(var _=0;_')}else if(s instanceof J){if(f&&l){var P=-r.x,H=-r.y;n.push("')}}else{var B=M(t.fillStyle),j=B.color,F=B.alpha*t.globalAlpha;n.push('')}}function W(e,t,n){var r=e.m_;return{x:o*(t*r[0][0]+n*r[1][0]+r[2][0])-u,y:o*(t*r[0][1]+n*r[1][1]+r[2][1])-u}}function X(e){return isFinite(e[0][0])&&isFinite(e[0][1])&&isFinite(e[1][0])&&isFinite(e[1][1])&&isFinite(e[2][0])&&isFinite(e[2][1])}function V(e,t,n){if(!X(t))return;e.m_=t;if(n){var r=t[0][0]*t[1][1]-t[0][1]*t[1][0];e.lineScale_=s(i(r))}}function $(e){this.type_=e,this.x0_=0,this.y0_=0,this.r0_=0,this.x1_=0,this.y1_=0,this.r1_=0,this.colors_=[]}function J(e,t){Q(e);switch(t){case"repeat":case null:case"":this.repetition_="repeat";break;case"repeat-x":case"repeat-y":case"no-repeat":this.repetition_=t;break;default:K("SYNTAX_ERR")}this.src_=e.src,this.width_=e.width,this.height_=e.height}function K(e){throw new G(e)}function Q(e){(!e||e.nodeType!=1||e.tagName!="IMG")&&K("TYPE_MISMATCH_ERR"),e.readyState!="complete"&&K("INVALID_STATE_ERR")}function G(e){this.code=this[e],this.message=e+": DOM Exception "+this.code}var e=Math,t=e.round,n=e.sin,r=e.cos,i=e.abs,s=e.sqrt,o=10,u=o/2,a=+navigator.userAgent.match(/MSIE ([\d.]+)?/)[1],l=Array.prototype.slice;d(document);var v={init:function(e){var t=e||document;t.createElement("canvas"),t.attachEvent("onreadystatechange",c(this.init_,this,t))},init_:function(e){var t=e.getElementsByTagName("canvas");for(var n=0;n'),(f||l)&&w.push('
'),w.push('
'),(f||l)&&w.push("
"),w.push("
"),this.element_.insertAdjacentHTML("BeforeEnd",w.join(""))},q.stroke=function(e){var n=[],r=!1,i=10,s=10;n.push("f.x)f.x=c.x;if(a.y==null||c.yf.y)f.y=c.y}}n.push(' ">'),e?z(this,n,a,f):U(this,n),n.push(""),this.element_.insertAdjacentHTML("beforeEnd",n.join(""))},q.fill=function(){this.stroke(!0)},q.closePath=function(){this.currentPath_.push({type:"close"})},q.save=function(){var e={};x(this,e),this.aStack_.push(e),this.mStack_.push(this.m_),this.m_=S(E(),this.m_)},q.restore=function(){this.aStack_.length&&(x(this.aStack_.pop(),this),this.m_=this.mStack_.pop())},q.translate=function(e,t){var n=[[1,0,0],[0,1,0],[e,t,1]];V(this,S(n,this.m_),!1)},q.rotate=function(e){var t=r(e),i=n(e),s=[[t,i,0],[-i,t,0],[0,0,1]];V(this,S(s,this.m_),!1)},q.scale=function(e,t){this.arcScaleX_*=e,this.arcScaleY_*=t;var n=[[e,0,0],[0,t,0],[0,0,1]];V(this,S(n,this.m_),!0)},q.transform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,S(o,this.m_),!0)},q.setTransform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,o,!0)},q.drawText_=function(e,n,r,i,s){var u=this.m_,a=1e3,f=0,l=a,c={x:0,y:0},p=[],d=H(P(this.font),this.element_),v=B(d),m=this.element_.currentStyle,g=this.textAlign.toLowerCase();switch(g){case"left":case"center":case"right":break;case"end":g=m.direction=="ltr"?"right":"left";break;case"start":g=m.direction=="rtl"?"right":"left";break;default:g="left"}switch(this.textBaseline){case"hanging":case"top":c.y=d.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":c.y=-d.size/2.25}switch(g){case"right":f=a,l=.05;break;case"center":f=l=a/2}var y=W(this,n+c.x,r+c.y);p.push(''),s?U(this,p):z(this,p,{x:-f,y:0},{x:l,y:d.size});var b=u[0][0].toFixed(3)+","+u[1][0].toFixed(3)+","+u[0][1].toFixed(3)+","+u[1][1].toFixed(3)+",0,0",w=t(y.x/o)+","+t(y.y/o);p.push('','',''),this.element_.insertAdjacentHTML("beforeEnd",p.join(""))},q.fillText=function(e,t,n,r){this.drawText_(e,t,n,r,!1)},q.strokeText=function(e,t,n,r){this.drawText_(e,t,n,r,!0)},q.measureText=function(e){if(!this.textMeasureEl_){var t='';this.element_.insertAdjacentHTML("beforeEnd",t),this.textMeasureEl_=this.element_.lastChild}var n=this.element_.ownerDocument;return this.textMeasureEl_.innerHTML="",this.textMeasureEl_.style.font=this.font,this.textMeasureEl_.appendChild(n.createTextNode(e)),{width:this.textMeasureEl_.offsetWidth}},q.clip=function(){},q.arcTo=function(){},q.createPattern=function(e,t){return new J(e,t)},$.prototype.addColorStop=function(e,t){t=M(t),this.colors_.push({offset:e,color:t.color,alpha:t.alpha})};var Y=G.prototype=new Error;Y.INDEX_SIZE_ERR=1,Y.DOMSTRING_SIZE_ERR=2,Y.HIERARCHY_REQUEST_ERR=3,Y.WRONG_DOCUMENT_ERR=4,Y.INVALID_CHARACTER_ERR=5,Y.NO_DATA_ALLOWED_ERR=6,Y.NO_MODIFICATION_ALLOWED_ERR=7,Y.NOT_FOUND_ERR=8,Y.NOT_SUPPORTED_ERR=9,Y.INUSE_ATTRIBUTE_ERR=10,Y.INVALID_STATE_ERR=11,Y.SYNTAX_ERR=12,Y.INVALID_MODIFICATION_ERR=13,Y.NAMESPACE_ERR=14,Y.INVALID_ACCESS_ERR=15,Y.VALIDATION_ERR=16,Y.TYPE_MISMATCH_ERR=17,G_vmlCanvasManager=v,CanvasRenderingContext2D=I,CanvasGradient=$,CanvasPattern=J,DOMException=G}(),G_vmlCanvasManager}),define("zrender/tool/util",["require","../lib/excanvas"],function(e){function n(e){if(typeof e=="object"&&e!==null){var r=e;if(e instanceof Array){r=[];for(var i=0,s=e.length;if&&(f=e+c+n,u.width=f,r=!0),t+h>l&&(l=t+h+n,u.height=l,r=!0),e<-c&&(c=Math.ceil(-e/n)*n,f+=c,u.width=f,r=!0),t<-h&&(h=Math.ceil(-t/n)*n,l+=h,u.height=l,r=!0),r&&a.translate(c,h)}function v(){return{x:c,y:h}}function m(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n3&&(t=Array.prototype.slice.call(t,1));if(this._handlers[e]){var r=this._handlers[e],i=r.length;for(var s=0;s4&&(t=Array.prototype.slice.call(t,1,t.length-1));var r=t[t.length-1];if(this._handlers[e]){var i=this._handlers[e],s=i.length;for(var o=0;o1)for(var e in arguments)console.log(arguments[e])}}),define("zrender/tool/guid",[],function(){var e=2311;return function(){return"zrender__"+e++}}),define("zrender/Handler",["require","./config","./tool/env","./tool/event","./tool/util"],function(e){function a(e,t){return function(n){return e.call(t,n)}}function f(e){var t=o.length;while(t--){var n=o[t];e["_"+n+"Handler"]=a(u[n],e)}}function l(e,t,i){r.Dispatcher.call(this),this.root=e,this.storage=t,this.painter=i,this._lastX=this._lastY=this._mouseX=this._mouseY=0,this._findHover=a(h,this),this._domHover=i.getDomHover(),f(this),window.addEventListener?(window.addEventListener("resize",this._resizeHandler),n.os.tablet||n.os.phone?(e.addEventListener("touchstart",this._touchstartHandler),e.addEventListener("touchmove",this._touchmoveHandler),e.addEventListener("touchend",this._touchendHandler)):(e.addEventListener("click",this._clickHandler),e.addEventListener("mousewheel",this._mousewheelHandler),e.addEventListener("mousemove",this._mousemoveHandler),e.addEventListener("mousedown",this._mousedownHandler),e.addEventListener("mouseup",this._mouseupHandler)),e.addEventListener("DOMMouseScroll",this._mousewheelHandler),e.addEventListener("mouseout",this._mouseoutHandler)):(window.attachEvent("onresize",this._resizeHandler),e.attachEvent("onclick",this._clickHandler),e.attachEvent("onmousewheel",this._mousewheelHandler),e.attachEvent("onmousemove",this._mousemoveHandler),e.attachEvent("onmouseout",this._mouseoutHandler),e.attachEvent("onmousedown",this._mousedownHandler),e.attachEvent("onmouseup",this._mouseupHandler))}function h(e){if(this._draggingTarget&&this._draggingTarget.id==e.id||e.isSilent())return!1;var t=this._event;if(e.isCover(this._mouseX,this._mouseY)){e.hoverable&&this.storage.addHover(e);var n=e.parent;while(n){if(n.clipShape&&!n.clipShape.isCover(this._mouseX,this._mouseY))return!1;n=n.parent}return this._lastHover!=e&&(this._processOutShape(t),this._processDragLeave(t),this._lastHover=e,this._processDragEnter(t)),this._processOverShape(t),this._processDragOver(t),this._hasfound=1,!0}return!1}var t=e("./config"),n=e("./tool/env"),r=e("./tool/event"),i=e("./tool/util"),s=t.EVENT,o=["resize","click","mousewheel","mousemove","mouseout","mouseup","mousedown","touchstart","touchend","touchmove"],u={resize:function(e){e=e||window.event,this._lastHover=null,this._isMouseDown=0,this.dispatch(s.RESIZE,e)},click:function(e){e=this._zrenderEventFixed(e);var t=this._lastHover;(t&&t.clickable||!t)&&this._dispatchAgency(t,s.CLICK,e),this._mousemoveHandler(e)},mousewheel:function(e){e=this._zrenderEventFixed(e),this._dispatchAgency(this._lastHover,s.MOUSEWHEEL,e),this._mousemoveHandler(e)},mousemove:function(e){if(this.painter.isLoading())return;e=this._zrenderEventFixed(e),this._lastX=this._mouseX,this._lastY=this._mouseY,this._mouseX=r.getX(e),this._mouseY=r.getY(e),this._processDragStart(e),this._hasfound=0,this._event=e,this.storage.iterShape(this._findHover,{normal:"down"});if(!this._hasfound){if(!this._draggingTarget||this._lastHover&&this._lastHover!=this._draggingTarget)this._processOutShape(e),this._processDragLeave(e);this._lastHover=null,this.storage.delHover(),this.painter.clearHover()}this._draggingTarget&&(this.storage.drift(this._draggingTarget.id,this._mouseX-this._lastX,this._mouseY-this._lastY),this.storage.addHover(this._draggingTarget));var t="default";this._draggingTarget||this._hasfound&&this._lastHover.draggable?t="move":this._hasfound&&this._lastHover.clickable&&(t="pointer"),this.root.style.cursor=t,this._dispatchAgency(this._lastHover,s.MOUSEMOVE,e),(this._draggingTarget||this._hasfound||this.storage.hasHoverShape())&&this.painter.refreshHover()},mouseout:function(e){e=this._zrenderEventFixed(e);var t=e.toElement||e.relatedTarget;if(t!=this.root)while(t&&t.nodeType!=9){if(t==this.root){this._mousemoveHandler(e);return}t=t.parentNode}e.zrenderX=this._lastX,e.zrenderY=this._lastY,this.root.style.cursor="default",this._isMouseDown=0,this._processOutShape(e),this._processDrop(e),this._processDragEnd(e),this.painter.isLoading()||this.painter.refreshHover(),this.dispatch(s.GLOBALOUT,e)},mousedown:function(e){if(this._lastDownButton==2){this._lastDownButton=e.button,this._mouseDownTarget=null;return}this._lastMouseDownMoment=new Date,e=this._zrenderEventFixed(e),this._isMouseDown=1,this._mouseDownTarget=this._lastHover,this._dispatchAgency(this._lastHover,s.MOUSEDOWN,e),this._lastDownButton=e.button},mouseup:function(e){e=this._zrenderEventFixed(e),this.root.style.cursor="default",this._isMouseDown=0,this._mouseDownTarget=null,this._dispatchAgency(this._lastHover,s.MOUSEUP,e),this._processDrop(e),this._processDragEnd(e)},touchstart:function(e){e=this._zrenderEventFixed(e,!0),this._lastTouchMoment=new Date,this._mobildFindFixed(e),this._mousedownHandler(e)},touchmove:function(e){e=this._zrenderEventFixed(e,!0),this._mousemoveHandler(e),this._isDragging&&r.stop(e)},touchend:function(e){e=this._zrenderEventFixed(e,!0),this._mouseupHandler(e),new Date-this._lastTouchMoment1e-4||Math.abs(this.position[0])>1e-4||Math.abs(this.position[1])>1e-4||Math.abs(this.scale[0]-1)>1e-4||Math.abs(this.scale[1]-1)>1e-4},updateTransform:function(){this.updateNeedTransform(),this.parent?this.needTransform=this.needLocalTransform||this.parent.needTransform:this.needTransform=this.needLocalTransform;if(!this.needTransform)return;var e=this.transform||t.create();t.identity(e);if(this.needLocalTransform){if(this.scale&&(this.scale[0]!==1||this.scale[1]!==1)){n[0]=-this.scale[2]||0,n[1]=-this.scale[3]||0,(n[0]||n[1])&&t.translate(e,e,n),t.scale(e,e,this.scale);if(n[0]||n[1])n[0]=-n[0],n[1]=-n[1],t.translate(e,e,n)}if(this.rotation)if(this.rotation instanceof Array){if(this.rotation[0]!==0){n[0]=-this.rotation[1]||0,n[1]=-this.rotation[2]||0,(n[0]||n[1])&&t.translate(e,e,n),t.rotate(e,e,this.rotation[0]);if(n[0]||n[1])n[0]=-n[0],n[1]=-n[1],t.translate(e,e,n)}}else this.rotation!==0&&t.rotate(e,e,this.rotation);this.position&&(this.position[0]!==0||this.position[1]!==0)&&t.translate(e,e,this.position)}this.transform=e,this.parent&&this.parent.needTransform&&(this.needLocalTransform?t.mul(this.transform,this.parent.transform,this.transform):t.copy(this.transform,this.parent.transform))},setTransform:function(e){if(this.needTransform){var t=this.transform;e.transform(t[0],t[1],t[2],t[3],t[4],t[5])}}},r}),define("zrender/tool/color",["require","../tool/util"],function(e){function f(e){r=e}function l(){r=i}function c(e,t){return e|=0,t=t||r,t[e%t.length]}function h(e){s=e}function p(){o=s}function d(){return s}function v(e,r,i,s,o,u,a){n||(n=t.getContext());var f=n.createRadialGradient(e,r,i,s,o,u);for(var l=0,c=a.length;l1)for(var i=0,s=r-1;i1?Math.ceil(e):e});if(t.indexOf("hex")>-1)return"#"+((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1);if(t.indexOf("hs")>-1){var n=q(e.slice(1,3),function(e){return e+"%"});e[1]=n[0],e[2]=n[1]}return t.indexOf("a")>-1?(e.length===3&&e.push(1),e[3]=R(e[3],[0,1]),t+"("+e.slice(0,4).join(",")+")"):t+"("+e.slice(0,3).join(",")+")"}}function w(e){e=_(e),e.indexOf("rgba")<0&&(e=S(e));var t=[],n=0;return e.replace(/[\d.]+/g,function(e){n<3?e|=0:e=+e,t[n++]=e}),t}function E(e,t){var n=F(e),r=n[3];return typeof r=="undefined"&&(r=1),e.indexOf("hsb")>-1?n=U(n):e.indexOf("hsl")>-1&&(n=z(n)),t.indexOf("hsb")>-1||t.indexOf("hsv")>-1?n=X(n):t.indexOf("hsl")>-1&&(n=V(n)),n[3]=r,b(n,t)}function S(e){return E(e,"rgba")}function x(e){return E(e,"rgb")}function T(e){return E(e,"hex")}function N(e){return E(e,"hsva")}function C(e){return E(e,"hsv")}function k(e){return E(e,"hsba")}function L(e){return E(e,"hsb")}function A(e){return E(e,"hsla")}function O(e){return E(e,"hsl")}function M(e){for(var t in a)if(T(a[t])===T(e))return t;return null}function _(e){return String(e).replace(/\s+/g,"")}function D(e){a[e]&&(e=a[e]),e=_(e),e=e.replace(/hsv/i,"hsb");if(/^#[\da-f]{3}$/i.test(e)){e=parseInt(e.slice(1),16);var t=(e&3840)<<8,n=(e&240)<<4,r=e&15;e="#"+((1<<24)+(t<<4)+t+(n<<4)+n+(r<<4)+r).toString(16).slice(1)}return e}function P(e,t){var n=t>0?1:-1;typeof t=="undefined"&&(t=0),t=Math.abs(t)>1?1:Math.abs(t),e=x(e);var r=F(e);for(var i=0;i<3;i++)n===1?r[i]=r[i]*(1-t)|0:r[i]=(255-r[i])*t+r[i]|0;return"rgb("+r.join(",")+")"}function H(e){var t=F(S(e));return t=q(t,function(e){return 255-e}),b(t,"rgb")}function B(e,t,n){typeof n=="undefined"&&(n=.5),n=1-R(n,[0,1]);var r=n*2-1,i=F(S(e)),s=F(S(t)),o=i[3]-s[3],u=((r*o===-1?r:(r+o)/(1+r*o))+1)/2,a=1-u,f=[];for(var l=0;l<3;l++)f[l]=i[l]*u+s[l]*a;var c=i[3]*n+s[3]*(1-n);return c=Math.max(0,Math.min(1,c)),i[3]===1&&s[3]===1?b(f,"rgb"):(f[3]=c,b(f,"rgba"))}function j(){return"#"+Math.random().toString(16).slice(2,8)}function F(e){e=D(e);var t=e.match(u);if(t===null)throw new Error("The color format error");var n,r,i=[],s;if(t[2])n=t[2].replace("#","").split(""),s=[n[0]+n[1],n[2]+n[3],n[4]+n[5]],i=q(s,function(e){return R(parseInt(e,16),[0,255])});else if(t[4]){var o=t[4].split(",");r=o[3],s=o.slice(0,3),i=q(s,function(e){return e=Math.floor(e.indexOf("%")>0?parseInt(e,0)*2.55:e),R(e,[0,255])}),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}else if(t[5]||t[6]){var a=(t[5]||t[6]).split(","),f=parseInt(a[0],0)/360,l=a[1],c=a[2];r=a[3],i=q([l,c],function(e){return R(parseFloat(e)/100,[0,1])}),i.unshift(f),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}return i}function I(e,t){t===null&&(t=1);var n=F(S(e));return n[3]=R(Number(t).toFixed(4),[0,1]),b(n,"rgba")}function q(e,t){if(typeof t!="function")throw new TypeError;var n=e?e.length:0;for(var r=0;r=t[1]&&(e=t[1]),e}function U(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u=t*6;u===6&&(u=0);var a=u|0,f=r*(1-n),l=r*(1-n*(u-a)),c=r*(1-n*(1-(u-a))),h=0,p=0,d=0;a===0?(h=r,p=c,d=f):a===1?(h=l,p=r,d=f):a===2?(h=f,p=r,d=c):a===3?(h=f,p=l,d=r):a===4?(h=c,p=f,d=r):(h=r,p=f,d=l),i=h*255,s=p*255,o=d*255}return[i,s,o]}function z(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u;r<.5?u=r*(1+n):u=r+n-n*r;var a=2*r-u;i=255*W(a,u,t+1/3),s=255*W(a,u,t),o=255*W(a,u,t-1/3)}return[i,s,o]}function W(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function X(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=s,a,f;if(o===0)a=0,f=0;else{f=o/s;var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}function V(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=(s+i)/2,a,f;if(o===0)a=0,f=0;else{u<.5?f=o/(s+i):f=o/(2-s-i);var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}var t=e("../tool/util"),n,r=["#ff9277"," #dddd00"," #ffc877"," #bbe3ff"," #d5ffbb","#bbbbff"," #ddb000"," #b0dd00"," #e2bbff"," #ffbbe3","#ff7777"," #ff9900"," #83dd00"," #77e3ff"," #778fff","#c877ff"," #ff77ab"," #ff6600"," #aa8800"," #77c7ff","#ad77ff"," #ff77ff"," #dd0083"," #777700"," #00aa00","#0088aa"," #8400dd"," #aa0088"," #dd0000"," #772e00"],i=r,s="rgba(255,255,0,0.5)",o=s,u=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,a={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#789",lightslategrey:"#789",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#f0f",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"};return{customPalette:f,resetPalette:l,getColor:c,getHighlightColor:d,customHighlight:h,resetHighlight:p,getRadialGradient:v,getLinearGradient:m,getGradientColors:y,getStepColors:g,reverse:H,mix:B,lift:P,trim:_,random:j,toRGB:x,toRGBA:S,toHex:T,toHSL:O,toHSLA:A,toHSB:L,toHSBA:k,toHSV:C,toHSVA:N,toName:M,toColor:b,toArray:w,alpha:I,getData:F}}),define("zrender/shape/Base",["require","../tool/matrix","../tool/guid","../tool/util","./mixin/Transformable","../tool/event","../tool/area","../tool/area","../tool/color","../tool/area"],function(e){function o(t,n,r,i,s,o,a){s&&(t.font=s),t.textAlign=o,t.textBaseline=a;var f=u(n,r,i,s,o,a);n=(n+"").split("\n");var l=e("../tool/area").getTextHeight("国",s);switch(a){case"top":i=f.y;break;case"bottom":i=f.y+l;break;default:i=f.y+l/2}for(var c=0,h=n.length;c0&&e.stroke();break;default:e.fill()}this.drawText(e,n,this.style),e.restore()};var f=[["color","fillStyle"],["strokeColor","strokeStyle"],["opacity","globalAlpha"],["lineCap","lineCap"],["lineJoin","lineJoin"],["miterLimit","miterLimit"],["lineWidth","lineWidth"],["shadowBlur","shadowBlur"],["shadowColor","shadowColor"],["shadowOffsetX","shadowOffsetX"],["shadowOffsetY","shadowOffsetY"]];return a.prototype.setContext=function(e,t){for(var n=0,r=f.length;n=i.x&&t<=i.x+i.width&&n>=i.y&&n<=i.y+i.height?e("../tool/area").isInside(this,this.style,t,n):!1},a.prototype.drawText=function(e,t,n){if(typeof t.text=="undefined"||t.text===!1)return;var r=t.textColor||t.color||t.strokeColor;e.fillStyle=r;var i=10,s,u,a,f,l=t.textPosition||this.textPosition||"top";switch(l){case"inside":case"top":case"bottom":case"left":case"right":if(this.getRect){var c=(n||t).__rect||this.getRect(n||t);switch(l){case"inside":a=c.x+c.width/2,f=c.y+c.height/2,s="center",u="middle",t.brushType!="stroke"&&r==t.color&&(e.fillStyle="#fff");break;case"left":a=c.x-i,f=c.y+c.height/2,s="end",u="middle";break;case"right":a=c.x+c.width+i,f=c.y+c.height/2,s="start",u="middle";break;case"top":a=c.x+c.width/2,f=c.y-i,s="center",u="bottom";break;case"bottom":a=c.x+c.width/2,f=c.y+c.height+i,s="center",u="top"}}break;case"start":case"end":var h,p,d,v;if(typeof t.pointList!="undefined"){var m=t.pointList;if(m.length<2)return;var g=m.length;switch(l){case"start":h=m[0][0],p=m[1][0],d=m[0][1],v=m[1][1];break;case"end":h=m[g-2][0],p=m[g-1][0],d=m[g-2][1],v=m[g-1][1]}}else h=t.xStart||0,p=t.xEnd||0,d=t.yStart||0,v=t.yEnd||0;switch(l){case"start":s=h0&&l[0]===""&&l.shift();for(var c=0;c0){if(isNaN(l[0]))break;var h=null,p=[],d,v,m,g,y,b,w,E,S=o,x=u;switch(f){case"l":o+=l.shift(),u+=l.shift(),h="L",p.push(o,u);break;case"L":o=l.shift(),u=l.shift(),p.push(o,u);break;case"m":o+=l.shift(),u+=l.shift(),h="M",p.push(o,u),f="l";break;case"M":o=l.shift(),u=l.shift(),h="M",p.push(o,u),f="L";break;case"h":o+=l.shift(),h="L",p.push(o,u);break;case"H":o=l.shift(),h="L",p.push(o,u);break;case"v":u+=l.shift(),h="L",p.push(o,u);break;case"V":u=l.shift(),h="L",p.push(o,u);break;case"C":p.push(l.shift(),l.shift(),l.shift(),l.shift()),o=l.shift(),u=l.shift(),p.push(o,u);break;case"c":p.push(o+l.shift(),u+l.shift(),o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="C",p.push(o,u);break;case"S":d=o,v=u,m=s[s.length-1],m.command==="C"&&(d=o+(o-m.points[2]),v=u+(u-m.points[3])),p.push(d,v,l.shift(),l.shift()),o=l.shift(),u=l.shift(),h="C",p.push(o,u);break;case"s":d=o,v=u,m=s[s.length-1],m.command==="C"&&(d=o+(o-m.points[2]),v=u+(u-m.points[3])),p.push(d,v,o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="C",p.push(o,u);break;case"Q":p.push(l.shift(),l.shift()),o=l.shift(),u=l.shift(),p.push(o,u);break;case"q":p.push(o+l.shift(),u+l.shift()),o+=l.shift(),u+=l.shift(),h="Q",p.push(o,u);break;case"T":d=o,v=u,m=s[s.length-1],m.command==="Q"&&(d=o+(o-m.points[0]),v=u+(u-m.points[1])),o=l.shift(),u=l.shift(),h="Q",p.push(d,v,o,u);break;case"t":d=o,v=u,m=s[s.length-1],m.command==="Q"&&(d=o+(o-m.points[0]),v=u+(u-m.points[1])),o+=l.shift(),u+=l.shift(),h="Q",p.push(d,v,o,u);break;case"A":g=l.shift(),y=l.shift(),b=l.shift(),w=l.shift(),E=l.shift(),S=o,x=u,o=l.shift(),u=l.shift(),h="A",p=this._convertPoint(S,x,o,u,w,E,g,y,b);break;case"a":g=l.shift(),y=l.shift(),b=l.shift(),w=l.shift(),E=l.shift(),S=o,x=u,o+=l.shift(),u+=l.shift(),h="A",p=this._convertPoint(S,x,o,u,w,E,g,y,b)}s.push({command:h||f,points:p})}(f==="z"||f==="Z")&&s.push({command:"z",points:[]})}return s},_convertPoint:function(e,t,n,r,i,s,o,u,a){var f=a*(Math.PI/180),l=Math.cos(f)*(e-n)/2+Math.sin(f)*(t-r)/2,c=-1*Math.sin(f)*(e-n)/2+Math.cos(f)*(t-r)/2,h=l*l/(o*o)+c*c/(u*u);h>1&&(o*=Math.sqrt(h),u*=Math.sqrt(h));var p=Math.sqrt((o*o*u*u-o*o*c*c-u*u*l*l)/(o*o*c*c+u*u*l*l));i===s&&(p*=-1),isNaN(p)&&(p=0);var d=p*o*c/u,v=p*-u*l/o,m=(e+n)/2+Math.cos(f)*d-Math.sin(f)*v,g=(t+r)/2+Math.sin(f)*d+Math.cos(f)*v,y=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},b=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(y(e)*y(t))},w=function(e,t){return(e[0]*t[1]=1&&(T=0),s===0&&T>0&&(T-=2*Math.PI),s===1&&T<0&&(T+=2*Math.PI),[m,g,o,u,E,T,f,s]},buildPath:function(e,t){var n=t.path,r=this.pathArray||this._parsePathData(n),i=t.x||0,s=t.y||0,o,u=t.pointList=[],a=[];for(var f=0,l=r.length;f0&&u.push(a),a=[]),o=r[f].points;for(var c=0,h=o.length;c0&&u.push(a);var p;for(var f=0,l=r.length;fg?m:g,x=m>g?1:m/g,T=m>g?g/m:1;e.translate(d,v),e.rotate(w),e.scale(x,T),e.arc(0,0,S,y,y+b,1-E),e.scale(1/x,1/T),e.rotate(-w),e.translate(-d,-v);break;case"z":e.closePath()}}return},getRect:function(e){if(e.__rect)return e.__rect;var t;e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0;var n=Number.MAX_VALUE,r=Number.MIN_VALUE,i=Number.MAX_VALUE,s=Number.MIN_VALUE,o=e.x||0,u=e.y||0,a=this.pathArray||this._parsePathData(e.path);for(var f=0;fr&&(r=l[c]+o)):(l[c]+us&&(s=l[c]+u))}var h;return n===Number.MAX_VALUE||r===Number.MIN_VALUE||i===Number.MAX_VALUE||s===Number.MIN_VALUE?h={x:0,y:0,width:0,height:0}:h={x:Math.round(n-t/2),y:Math.round(i-t/2),width:r-n+t,height:s-i+t},e.__rect=h,h}},e("../tool/util").inherits(n,t),n}),define("zrender/tool/area",["require","../tool/util","../shape/Path"],function(e){function a(e,r,i,s){if(!r||!e)return!1;var o=e.type;n=n||t.getContext();if(!g(r.__rect||e.getRect(r),i,s))return!1;var u=f(o,r,i,s);if(typeof u!="undefined")return u;if(o!="bezier-curve"&&e.buildPath&&n.isPointInPath)return l(e,n,r,i,s);if(n.getImageData)return c(e,r,i,s);switch(o){case"heart":case"droplet":case"ellipse":return!0;case"trochoid":var a=r.location=="out"?r.r1+r.r2+r.d:r.r1-r.r2+r.d;return y(r,i,s,a);case"rose":return y(r,i,s,r.maxr);default:return!1}}function f(e,t,n,r){switch(e){case"line":return d(t,n,r);case"broken-line":return v(t,n,r);case"text":return!0;case"ring":return m(t,n,r);case"rectangle":return!0;case"circle":return y(t,n,r,t.r);case"sector":return b(t,n,r);case"path":return E(t,n,r);case"polygon":case"star":case"isogon":return w(t,n,r);case"image":return!0}}function l(e,t,n,r,i){return t.beginPath(),e.buildPath(t,n),t.closePath(),t.isPointInPath(r,i)}function c(e,n,r,i){var s=n.__rect||e.getRect(n),o=t.getPixelContext(),u=t.getPixelOffset();return t.adjustCanvasSize(r,i),o.clearRect(s.x,s.y,s.width,s.height),o.beginPath(),e.brush(o,{style:n}),o.closePath(),h(o,r+u.x,i+u.y)}function h(e,t,n,r){var i;typeof r!="undefined"?(r=(r||1)>>1,i=e.getImageData(t-r,n-r,r+r,r+r).data):i=e.getImageData(t,n,1,1).data;var s=i.length;while(s--)if(i[s]!==0)return!0;return!1}function p(e,t,n,r){return!a(e,t,n,r)}function d(e,t,n){var r=e.xStart,i=e.yStart,s=e.xEnd,o=e.yEnd,u=Math.max(e.lineWidth,5),a=0,f=r,l,c;rc||np)return!1;if(r===s)return Math.abs(t-r)<=u/2;a=(i-o)/(r-s),f=(r*o-s*i)/(r-s);var d=(a*t-n+f)*(a*t-n+f)/(a*a+1);return d<=u/2*u/2}function v(e,t,n){var r=e.pointList,i={xStart:0,yStart:0,xEnd:0,yEnd:0,lineWidth:0};for(var s=0,o=r.length-1;s=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function y(e,t,n,r){return(t-e.x)*(t-e.x)+(n-e.y)*(n-e.y)0&&y({x:e.x,y:e.y},t,n,e.r0))return!1;if(Math.abs(e.endAngle-e.startAngle)>=360)return!0;var r=(360-Math.atan2(n-e.y,t-e.x)/Math.PI*180)%360,i=(360+e.endAngle)%360,s=(360+e.startAngle)%360;return i>s?r>=s&&r<=i:!(r>=i&&r<=s)}function w(e,t,n){var r,i,s=e.pointList,o=s.length,u=!1,a=!0,f;for(r=0;rs[i][1]?--n:++n;break}}else if(s[r][1]==s[i][1]&&n==s[r][1]&&(s[r][0]u&&(s=0,r={}),a}function x(e,r){var s=e+":"+r;if(i[s])return i[s];n=n||t.getContext(),n.save(),r&&(n.font=r),e=(e+"").split("\n");var a=(n.measureText("国").width+2)*e.length;return n.restore(),i[s]=a,++o>u&&(o=0,i={}),a}var t=e("../tool/util"),n,r={},i={},s=0,o=0,u=2e4;return{isInside:a,isOutside:p,getTextWidth:S,getTextHeight:x}}),define("zrender/shape/Text",["require","../tool/area","./Base","../tool/util"],function(e){function r(e){n.call(this,e)}var t=e("../tool/area"),n=e("./Base");return r.prototype={type:"text",brush:function(e,n){var r=this.style;n&&(r=this.getHighlightStyle(r,this.highlightStyle||{}));if(typeof r.text=="undefined"||r.text===!1)return;e.save(),this.setContext(e,r),this.setTransform(e),r.textFont&&(e.font=r.textFont),e.textAlign=r.textAlign||"start",e.textBaseline=r.textBaseline||"middle";var i=(r.text+"").split("\n"),s=t.getTextHeight("国",r.textFont),o=this.getRect(r),u=r.x,a;r.textBaseline=="top"?a=o.y:r.textBaseline=="bottom"?a=o.y+s:a=o.y+s/2;for(var f=0,l=i.length;f=t[1]&&(e=t[1]),e},o}),define("zrender/shape/Image",["require","./Base","../tool/util"],function(e){function s(e){i.call(this,e)}var t={},n=[],r,i=e("./Base");return s.prototype={type:"image",brush:function(e,i,s){var o=this.style||{};i&&(o=this.getHighlightStyle(o,this.highlightStyle||{}));var u=o.image,a=this;if(typeof u=="string"){var f=u;t[f]?u=t[f]:(u=new Image,u.onload=function(){u.onload=null,clearTimeout(r),n.push(a),r=setTimeout(function(){s&&s(n),n=[]},10)},t[f]=u,u.src=f)}if(u){if(u.nodeName.toUpperCase()=="IMG")if(window.ActiveXObject){if(u.readyState!="complete")return}else if(!u.complete)return;var l=o.width||u.width,c=o.height||u.height,h=o.x,p=o.y;if(!u.width||!u.height)return;e.save(),this.setContext(e,o),this.setTransform(e);if(o.sWidth&&o.sHeight){var d=o.sx||0,v=o.sy||0;e.drawImage(u,d,v,o.sWidth,o.sHeight,h,p,l,c)}else if(o.sx&&o.sy){var d=o.sx,v=o.sy,m=l-d,g=c-v;e.drawImage(u,d,v,m,g,h,p,l,c)}else e.drawImage(u,h,p,l,c);o.width=l,o.height=c,this.style.width=l,this.style.height=c,this.drawText(e,o,this.style),e.restore()}},buildPath:function(e,t){e.rect(t.x,t.y,t.width,t.height);return},getRect:function(e){return{x:e.x,y:e.y,width:e.width,height:e.height}}},e("../tool/util").inherits(s,i),s}),define("zrender/Painter",["require","./config","./tool/util","./tool/log","./tool/matrix","./loadingEffect/Base","./shape/Image"],function(e){function a(){return!1}function f(){}function l(e,t){this.root=e,this.storage=t,e.innerHTML="",this._width=this._getWidth(),this._height=this._getHeight();var n=document.createElement("div");this._domRoot=n,n.style.position="relative",n.style.overflow="hidden",n.style.width=this._width+"px",n.style.height=this._height+"px",e.appendChild(n),this._layers={},this._layerConfig={},this._loadingEffect=new s({}),this.shapeToImage=this._createShapeToImageProcessor(),this._bgDom=c("bg","div",this),n.appendChild(this._bgDom);var r=new h("_zrender_hover_",this);this._layers.hover=r,n.appendChild(r.dom),r.initContext(),r.onselectstart=a;var i=this;this.updatePainter=function(e,t){i.update(e,t)}}function c(e,t,n){var r=document.createElement(t),i=n._width,s=n._height;return r.style.position="absolute",r.style.left=0,r.style.top=0,r.style.width=i+"px",r.style.height=s+"px",r.setAttribute("width",i*o),r.setAttribute("height",s*o),r.setAttribute("data-zr-dom-id",e),r}function h(e,t){this.dom=c(e,"canvas",t),u&&u.initElement(this.dom),this.domBack=null,this.ctxBack=null,this.painter=t,this.unusedCount=0,this.config=null,this.dirty=!0,this.elCount=0}var t=e("./config"),n=e("./tool/util"),r=e("./tool/log"),i=e("./tool/matrix"),s=e("./loadingEffect/Base"),o=window.devicePixelRatio||1;o=Math.max(o,1);var u=window.G_vmlCanvasManager;return l.prototype.render=function(e){return this.isLoading()&&this.hideLoading(),this.refresh(e,!0),this},l.prototype.refresh=function(e,t){var n=this.storage.getShapeList(!0);return this._paintList(n,t),typeof e=="function"&&e(),this},l.prototype._paintList=function(e,n){typeof n=="undefined"&&(n=!1),this._updateLayerStatus(e);var s,o,a;for(var f in this._layers)f!=="hover"&&this._layers[f].unusedCount++;var l=[];for(var c=0,h=e.length;c=500?(delete this._layers[f],g.dom.parentNode.removeChild(g.dom)):g.unusedCount==1&&g.clear()}},l.prototype.getLayer=function(e,t){var n=this._layers[e];if(!n){n=new h(e,this);var r=t?t.dom:this._bgDom;r.nextSibling?r.parentNode.insertBefore(n.dom,r.nextSibling):r.parentNode.appendChild(n.dom),n.initContext(),this._layers[e]=n,n.config=this._layerConfig[e]}return n},l.prototype._updateLayerStatus=function(e){var t=this._layers,n={};for(var r in t)r!=="hover"&&(n[r]=t[r].elCount,t[r].elCount=0);for(var i=0,s=e.length;i0},s.prototype.addRoot=function(e){e instanceof n&&e.addChildrenToStorage(this),this.addToMap(e),this._roots.push(e)},s.prototype.delRoot=function(e){if(typeof e=="undefined"){for(var r=0;r=0&&(this.delFromMap(o.id),this._roots.splice(u,1),o instanceof n&&o.delChildrenFromStorage(this))},s.prototype.addToMap=function(e){return e instanceof n?e._storage=this:e.style.__rect=null,this._elements[e.id]=e,this},s.prototype.get=function(e){return this._elements[e]},s.prototype.delFromMap=function(e){var t=this._elements[e];return t&&(delete this._elements[e],t instanceof n&&(t._storage=null)),this},s.prototype.dispose=function(){this._elements=this._renderList=this._roots=this._hoverElements=null},s}),define("zrender/animation/easing",[],function(){var e={Linear:function(e){return e},QuadraticIn:function(e){return e*e},QuadraticOut:function(e){return e*(2-e)},QuadraticInOut:function(e){return(e*=2)<1?.5*e*e:-0.5*(--e*(e-2)-1)},CubicIn:function(e){return e*e*e},CubicOut:function(e){return--e*e*e+1},CubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},QuarticIn:function(e){return e*e*e*e},QuarticOut:function(e){return 1- --e*e*e*e},QuarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-0.5*((e-=2)*e*e*e-2)},QuinticIn:function(e){return e*e*e*e*e},QuinticOut:function(e){return--e*e*e*e*e+1},QuinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},SinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},SinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},SinusoidalInOut:function(e){return.5*(1-Math.cos(Math.PI*e))},ExponentialIn:function(e){return e===0?0:Math.pow(1024,e-1)},ExponentialOut:function(e){return e===1?1:1-Math.pow(2,-10*e)},ExponentialInOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)},CircularIn:function(e){return 1-Math.sqrt(1-e*e)},CircularOut:function(e){return Math.sqrt(1- --e*e)},CircularInOut:function(e){return(e*=2)<1?-0.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},ElasticIn:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),-(n*Math.pow(2,10*(e-=1))*Math.sin((e-t)*2*Math.PI/r)))},ElasticOut:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*e)*Math.sin((e-t)*2*Math.PI/r)+1)},ElasticInOut:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),(e*=2)<1?-0.5*n*Math.pow(2,10*(e-=1))*Math.sin((e-t)*2*Math.PI/r):n*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*2*Math.PI/r)*.5+1)},BackIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},BackOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},BackInOut:function(e){var t=2.5949095;return(e*=2)<1?.5*e*e*((t+1)*e-t):.5*((e-=2)*e*((t+1)*e+t)+2)},BounceIn:function(t){return 1-e.BounceOut(1-t)},BounceOut:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},BounceInOut:function(t){return t<.5?e.BounceIn(t*2)*.5:e.BounceOut(t*2-1)*.5+.5}};return e}),define("zrender/animation/Clip",["require","./easing"],function(e){function n(e){this._targetPool=e.target||{},this._targetPool instanceof Array||(this._targetPool=[this._targetPool]),this._life=e.life||1e3,this._delay=e.delay||0,this._startTime=(new Date).getTime()+this._delay,this._endTime=this._startTime+this._life*1e3,this.loop=typeof e.loop=="undefined"?!1:e.loop,this.gap=e.gap||0,this.easing=e.easing||"Linear",this.onframe=e.onframe,this.ondestroy=e.ondestroy,this.onrestart=e.onrestart}var t=e("./easing");return n.prototype={step:function(e){var n=(e-this._startTime)/this._life;if(n<0)return;n=Math.min(n,1);var r=typeof this.easing=="string"?t[this.easing]:this.easing,i=typeof r=="function"?r(n):n;return this.fire("frame",i),n==1?this.loop?(this.restart(),"restart"):(this._needsRemove=!0,"destroy"):null},restart:function(){var e=(new Date).getTime(),t=(e-this._startTime)%this._life;this._startTime=(new Date).getTime()-t+this.gap},fire:function(e,t){for(var n=0,r=this._targetPool.length;n=0&&this._clips.splice(t,1)},update:function(){var e=(new Date).getTime(),t=e-this._time,n=this._clips,r=n.length,i=[],s=[];for(var o=0;o=0;N--)if(x[N]<=t)break;N=Math.min(N,g-2)}else{for(N=k;Nt)break;N=Math.min(N-1,g-2)}k=N,L=t;var n=x[N+1]-x[N];if(n===0)return;O=(t-x[N])/n;if(u){_=T[N],M=T[N===0?N:N-1],D=T[N>g-2?g-1:N+1],P=T[N>g-3?g-1:N+2];if(b)p(M,_,D,P,O,O*O,O*O*O,s(e,v),E);else{var a;w?(a=p(M,_,D,P,O,O*O,O*O*O,H,1),a=m(H)):a=d(M,_,D,P,O,O*O,O*O*O),i(e,v,a)}}else if(b)c(T[N],T[N+1],O,s(e,v),E);else{var a;w?(c(T[N],T[N+1],O,H,1),a=m(H)):a=l(T[N],T[N+1],O),i(e,v,a)}for(N=0;N1?"."+e[1]:""))}return{parsePercent:t,parseCenter:n,parseRadius:r,addCommas:i}}),define("echarts/component/base",["require","../config","../util/ecQuery","../util/number","zrender/tool/util","zrender/tool/env"],function(e){function s(e,t,n,r,i){this.ecTheme=e,this.messageCenter=t,this.zr=n,this.option=r,this.series=r.series,this.myChart=i,this.component=i.component,this._zlevelBase=this.getZlevelBase(),this.shapeList=[],this.effectList=[];var s=this;s.hoverConnect=function(e){var t=(e.target||{}).hoverConnect;if(t){var n=10,r;if(t instanceof Array)for(var i=0,o=t.length;i4?a*r(2*i/s)/r(i/s):a/3);var l=i/s,c=-i/2,h=o+a*r(c),p=u+a*n(c);c+=l;var d=t.pointList=[];d.push([h,p]);for(var v=0,m=s*2-1,g;v=r.x-i&&e<=r.x+r.width+i&&t>=r.y-i&&t<=r.y+r.height+i?!0:!1}},t.inherits(C,N),C}),define("zrender/shape/util/dashedLineTo",[],function(){var e=[5,5];return function(t,n,r,i,s,o){if(t.setLineDash){e[0]=e[1]=o,t.setLineDash(e),t.moveTo(n,r),t.lineTo(i,s);return}o=typeof o!="number"?5:o;var u=i-n,a=s-r,f=Math.floor(Math.sqrt(u*u+a*a)/o);u/=f,a/=f;var l=!0;for(var c=0;ci-2?i-1:l+1],v=e[l>i-3?i-1:l+2]);var m=c*c,g=c*m;s.push([n(h[0],p[0],d[0],v[0],c,m,g),n(h[1],p[1],d[1],v[1],c,m,g)])}return s}}),define("zrender/shape/util/smoothBezier",["require","../../tool/vector"],function(e){var t=e("../../tool/vector");return function(e,n,r){var i=[],s=[],o=[],u=[],a,f;for(var l=0,c=e.length;l0&&(n.brushType=="stroke"||n.brushType=="both")&&(r||(e.beginPath(),this.buildPath(e,n),e.closePath()),e.stroke()),this.drawText(e,n,this.style),e.restore();return},buildPath:function(e,t){var s=t.pointList;if(s.length<2)return;if(t.smooth&&t.smooth!=="spline"){var o=r(s,t.smooth,!0);e.moveTo(s[0][0],s[0][1]);var u,a,f,l=s.length;for(var c=0;cn&&(n=s[o][0]),s[o][1]i&&(i=s[o][1]);var a;return e.brushType=="stroke"||e.brushType=="fill"?a=e.lineWidth||1:a=0,e.__rect={x:Math.round(t-a/2),y:Math.round(r-a/2),width:n-t+a,height:i-r+a},e.__rect}},e("../tool/util").inherits(s,t),s}),define("zrender/shape/BrokenLine",["require","./Base","./util/smoothSpline","./util/smoothBezier","./util/dashedLineTo","./Polygon","../tool/util"],function(e){function s(e){this.brushTypeOnly="stroke",this.textPosition="end",t.call(this,e)}var t=e("./Base"),n=e("./util/smoothSpline"),r=e("./util/smoothBezier"),i=e("./util/dashedLineTo");return s.prototype={type:"broken-line",buildPath:function(e,t){var s=t.pointList;if(s.length<2)return;var o=Math.min(t.pointList.length,Math.round(t.pointListLength||t.pointList.length));if(t.smooth&&t.smooth!=="spline"){var u=r(s,t.smooth);e.moveTo(s[0][0],s[0][1]);var a,f,l;for(var c=0;cs?a>u?l=Math.PI*2-l+f:l+=f:a>u?l+=Math.PI-f:l=Math.PI-l-f:s>o?u>a?l=Math.PI*2-l+f:l+=f:u>a?l+=Math.PI-f:l=Math.PI-l-f;var c=Math.PI/8,h=n===0?s:o,p=n===0?u:a,d=[[h+i*Math.cos(l-c),p-i*Math.sin(l-c)],[h+i*.6*Math.cos(l),p-i*.6*Math.sin(l)],[h+i*Math.cos(l+c),p-i*Math.sin(l+c)]];e.moveTo(h,p);for(var v=0,m=d.length;v=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height?this.style.smooth!=="spline"?a.isInside(i,this.style,e,t):a.isInside(o,this.style,e,t):!1}},c.inherits(h,t),h}),define("echarts/util/shape/normalIsCover",[],function(){return function(e,t){var n=this.getTansform(e,t);e=n[0],t=n[1];var r=this.style.__rect;return r||(r=this.style.__rect=this.getRect(this.style)),e>=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height}}),define("echarts/util/shape/Symbol",["require","zrender/shape/Base","zrender/shape/Polygon","zrender/tool/util","./normalIsCover"],function(e){function s(e){t.call(this,e)}var t=e("zrender/shape/Base"),n=e("zrender/shape/Polygon"),r=new n({}),i=e("zrender/tool/util");return s.prototype={type:"symbol",buildPath:function(e,t){var n=t.pointList,r=n.length;if(r===0)return;var i=1e4,s=Math.ceil(r/i),o,u,a=n[0]instanceof Array,f=t.size?t.size:2,l=f,c=f/2,h=Math.PI*2,p,d,v;for(var m=0;mr?r:u;for(var g=o;g0&&e.stroke();break;case"stroke":t.lineWidth>0&&e.stroke();break;default:e.fill()}}},getRect:function(e){return e.__rect||r.getRect(e)},isCover:e("./normalIsCover")},i.inherits(s,t),s}),define("echarts/util/ecData",[],function(){function e(e,t,n,r,i,s,o,u){var a;return typeof r!="undefined"&&(a=r.value==null?r:r.value),e._echartsData={_series:t,_seriesIndex:n,_data:r,_dataIndex:i,_name:s,_value:a,_special:o,_special2:u},e._echartsData}function t(e,t){var n=e._echartsData;if(!t)return n;switch(t){case"series":case"seriesIndex":case"data":case"dataIndex":case"name":case"value":case"special":case"special2":return n&&n["_"+t]}return null}function n(e,t,n){e._echartsData=e._echartsData||{};switch(t){case"series":case"seriesIndex":case"data":case"dataIndex":case"name":case"value":case"special":case"special2":e._echartsData["_"+t]=n}}function r(e,t){t._echartsData={_series:e._echartsData._series,_seriesIndex:e._echartsData._seriesIndex,_data:e._echartsData._data,_dataIndex:e._echartsData._dataIndex,_name:e._echartsData._name,_value:e._echartsData._value,_special:e._echartsData._special,_special2:e._echartsData._special2}}return{pack:e,set:n,get:t,clone:r}}),define("echarts/util/ecAnimation",["require","zrender/tool/util","zrender/shape/Polygon"],function(e){function n(e,n,r,i,s){var o=r.style.pointList,u=o.length,a;if(!n){a=[];if(r._orient!="vertical"){var f=o[0][1];for(var l=0;l1?t.symbol:[t.symbol[0],t.symbol[0]]:[t.symbol,t.symbol],t.symbolSize=t.symbolSize instanceof Array?t.symbolSize.length>1?t.symbolSize:[t.symbolSize[0],t.symbolSize[0]]:[t.symbolSize,t.symbolSize],t.symbolRotate=t.symbolRotate instanceof Array?t.symbolRotate.length>1?t.symbolRotate:[t.symbolRotate[0],t.symbolRotate[0]]:[t.symbolRotate,t.symbolRotate],t.name=n.name;var i=[],u=t.data,a,f=r.dataRange,c=r.legend,h,p,d,v,m,g,y=this.zr.getWidth(),b=this.zr.getHeight(),w;for(var E=0,S=u.length;E "+u[E][1].name:""),p),i.push(a)}return i},getMarkCoord:function(){return[0,0]},getSymbolShape:function(e,r,i,s,u,a,f,l,c,h,p){var d=[i,e],v=typeof i!="undefined"?typeof i.value!="undefined"?i.value:i:"-";l=this.deepQuery(d,"symbol")||l;var m=this.deepQuery(d,"symbolSize");m=typeof m=="function"?m(v):m;var g=this.deepQuery(d,"symbolRotate"),y=this.deepMerge(d,"itemStyle.normal"),b=this.deepMerge(d,"itemStyle.emphasis"),w=typeof y.borderWidth!="undefined"?y.borderWidth:y.lineStyle&&y.lineStyle.width;typeof w=="undefined"&&(w=l.match("empty")?2:0);var E=typeof b.borderWidth!="undefined"?b.borderWidth:b.lineStyle&&b.lineStyle.width;typeof E=="undefined"&&(E=w+2);var S=new n({style:{iconType:l.replace("empty","").toLowerCase(),x:a-m,y:f-m,width:m*2,height:m*2,brushType:"both",color:l.match("empty")?h:this.getItemStyleColor(y.color,r,s,i)||c,strokeColor:y.borderColor||this.getItemStyleColor(y.color,r,s,i)||c,lineWidth:w},highlightStyle:{color:l.match("empty")?h:this.getItemStyleColor(b.color,r,s,i),strokeColor:b.borderColor||y.borderColor||this.getItemStyleColor(y.color,r,s,i)||c,lineWidth:E},clickable:!0});return l.match("image")&&(S.style.image=l.replace(new RegExp("^image:\\/\\/"),""),S=new t({style:S.style,highlightStyle:S.highlightStyle,clickable:!0})),typeof g!="undefined"&&(S.rotation=[g*Math.PI/180,a,f]),l.match("star")&&(S.style.iconType="star",S.style.n=l.replace("empty","").replace("star","")-0||5),l=="none"&&(S.invisible=!0,S.hoverable=!1),S=this.addLabel(S,e,i,u,p),l.match("empty")&&(typeof S.style.textColor=="undefined"&&(S.style.textColor=S.style.strokeColor),typeof S.highlightStyle.textColor=="undefined"&&(S.highlightStyle.textColor=S.highlightStyle.strokeColor)),o.pack(S,e,r,i,s,u),S._x=a,S._y=f,S._dataIndex=s,S._seriesIndex=r,S},getLineMarkShape:function(e,t,n,i,s,o,u,a,f){var l=typeof n[0]!="undefined"?typeof n[0].value!="undefined"?n[0].value:n[0]:"-",c=typeof n[1]!="undefined"?typeof n[1].value!="undefined"?n[1].value:n[1]:"-",h=[this.query(n[0],"symbol")||e.symbol[0],this.query(n[1],"symbol")||e.symbol[1]],p=[this.query(n[0],"symbolSize")||e.symbolSize[0],this.query(n[1],"symbolSize")||e.symbolSize[1]];p[0]=typeof p[0]=="function"?p[0](l):p[0],p[1]=typeof p[1]=="function"?p[1](c):p[1];var d=[this.query(n[0],"symbolRotate")||e.symbolRotate[0],this.query(n[1],"symbolRotate")||e.symbolRotate[1]],v=[n[0],e],m=this.deepMerge(v,"itemStyle.normal");m.color=this.getItemStyleColor(m.color,t,i,n);var g=this.deepMerge(v,"itemStyle.emphasis");g.color=this.getItemStyleColor(g.color,t,i,n);var y=m.lineStyle,b=g.lineStyle,w=y.width;typeof w=="undefined"&&(w=m.borderWidth);var E=b.width;typeof E=="undefined"&&(typeof g.borderWidth!="undefined"?E=g.borderWidth:E=w+2);var S=new r({style:{smooth:e.smooth?"spline":!1,symbol:h,symbolSize:p,symbolRotate:d,xStart:s,yStart:o,xEnd:u,yEnd:a,brushType:"both",lineType:y.type,shadowColor:y.shadowColor||y.color||m.borderColor||m.color||f,shadowBlur:y.shadowBlur,shadowOffsetX:y.shadowOffsetX,shadowOffsetY:y.shadowOffsetY,color:m.color||f,strokeColor:y.color||m.borderColor||m.color||f,lineWidth:w,symbolBorderColor:m.borderColor||m.color||f,symbolBorder:m.borderWidth},highlightStyle:{shadowColor:b.shadowColor,shadowBlur:b.shadowBlur,shadowOffsetX:b.shadowOffsetX,shadowOffsetY:b.shadowOffsetY,color:g.color||m.color||f,strokeColor:b.color||y.color||g.borderColor||m.borderColor||g.color||m.color||f,lineWidth:E,symbolBorderColor:g.borderColor||m.borderColor||g.color||m.color||f,symbolBorder:typeof g.borderWidth=="undefined"?m.borderWidth+2:g.borderWidth},clickable:!0});return S=this.addLabel(S,e,n[0],n[0].name+" : "+n[1].name),S._x=u,S._y=a,S},getLargeMarkPoingShape:function(e,t){var n=this.series[e],r=this.component,s=t.data,o,u=r.dataRange,a=r.legend,f,l,c=[s[0],t],h,p,d;a&&(f=a.getColor(n.name));if(u){l=typeof s[0]!="undefined"?typeof s[0].value!="undefined"?s[0].value:s[0]:"-",f=isNaN(l)?f:u.getColor(l),h=this.deepQuery(c,"itemStyle.normal.color")||f,p=this.deepQuery(c,"itemStyle.emphasis.color")||h;if(h==null&&p==null)return}f=this.deepMerge(c,"itemStyle.normal").color||f;var v=this.deepQuery(c,"symbol")||"circle";v=v.replace("empty","").replace(/\d/g,""),d=this.deepMerge([s[0],t],"effect");var m=window.devicePixelRatio||1;return o=new i({style:{pointList:s,color:f,strokeColor:f,shadowColor:d.shadowColor||f,shadowBlur:(typeof d.shadowBlur!="undefined"?d.shadowBlur:8)*m,size:this.deepQuery(c,"symbolSize"),iconType:v,brushType:"fill",lineWidth:1},draggable:!1,hoverable:!1}),d.show&&(o.effect=d),o},backupShapeList:function(){this.shapeList&&this.shapeList.length>0?(this.lastShapeList=this.shapeList,this.shapeList=[]):this.lastShapeList=[]},addShapeList:function(){var e=this.option.animationThreshold/(this.canvasSupported?2:4),t=this.lastShapeList,n=this.shapeList,r=t.length>0?500:this.query(this.option,"animationDuration"),i=this.query(this.option,"animationEasing"),s,o={},u={};if(this.option.animation&&!this.option.renderAsImage&&n.length500?u.candle(this.zr,e,t,n,r):this.zr.addShape(t);break;case"ring":case"sector":case"circle":n>500?u.ring(this.zr,e,t,n+(o.get(t,"dataIndex")||0)%20*100,r):t.type=="sector"?u.sector(this.zr,e,t,n,r):this.zr.addShape(t);break;case"text":u.text(this.zr,e,t,n,r);break;case"polygon":n>500?u.polygon(this.zr,e,t,n,r):u.pointList(this.zr,e,t,n,r);break;case"chord":u.chord(this.zr,e,t,n,r);break;case"gauge-pointer":u.gaugePointer(this.zr,e,t,n,r);break;case"mark-line":u.markline(this.zr,e,t,n,r);break;case"line":u.line(this.zr,e,t,n,r);break;default:this.zr.addShape(t)}},animationMark:function(e,t,n){var r=n||this.shapeList;for(var i=0,s=r.length;i0&&(e&&this.zr.modLayer(s.EFFECT_ZLEVEL,{motionBlur:!1}),this.zr.delShape(this.effectList)),this.effectList=[]},addMark:function(e,t,n){var r=this.series[e];if(this.selectedMap[r.name]){var i=500,s=this.query(this.option,"animationEasing"),o=r[n].data,u=this.shapeList.length;r[n].data=t.data,this["_build"+n.replace("m","M")](e);for(var a=u,f=this.shapeList.length;a0?-1:1,t.style.r-=r,t.style.r=t.style.r<5?5:t.style.r;var i=s.get(t,"value"),o=i*f.option.island.calculateStep;o>1?i=Math.round(i-o*r):i=(i-o*r).toFixed(2)-0;var a=s.get(t,"name");t.style.text=a+":"+i,s.set(t,"value",i),s.set(t,"name",a),f.zr.modShape(t.id),f.zr.refresh(),u.stop(n)}}var t=e("../component/base"),n=e("./base"),r=e("zrender/shape/Circle"),i=e("../config"),s=e("../util/ecData"),o=e("zrender/tool/util"),u=e("zrender/tool/event");return a.prototype={type:i.CHART_TYPE_ISLAND,_combine:function(t,n){var r=e("zrender/tool/color"),i=e("../util/accMath"),o=i.accAdd(s.get(t,"value"),s.get(n,"value")),u=s.get(t,"name")+this._nameConnector+s.get(n,"name");t.style.text=u+this._valueConnector+o,s.set(t,"value",o),s.set(t,"name",u),t.style.r=this.option.island.r,t.style.color=r.mix(t.style.color,n.style.color)},refresh:function(e){e&&(e.island=this.reformOption(e.island),this.option=e,this._nameConnector=this.option.nameConnector,this._valueConnector=this.option.valueConnector)},getOption:function(){return this.option},resize:function(){var e=this.zr.getWidth(),t=this.zr.getHeight(),n=e/(this._zrWidth||e),r=t/(this._zrHeight||t);if(n==1&&r==1)return;this._zrWidth=e,this._zrHeight=t;for(var i=0,s=this.shapeList.length;i'+(t[0]||this._lang[0])+"

",this._textArea.style.cssText="display:block;margin:0 0 8px 0;padding:4px 6px;overflow:auto;width:"+(this._zrWidth-15)+"px;"+"height:"+(this._zrHeight-100)+"px;";var n=this.query(this.option,"toolbox.feature.dataView.optionToContent");typeof n!="function"?this._textArea.value=this._optionToContent():this._textArea.value=n(this.option),this._tDom.appendChild(this._textArea),this._buttonClose.style.cssText="float:right;padding:1px 6px;",this._buttonClose.innerHTML=t[1]||this._lang[1];var r=this;this._buttonClose.onclick=function(){r.hide()},this._tDom.appendChild(this._buttonClose),this.query(this.option,"toolbox.feature.dataView.readOnly")===!1?(this._buttonRefresh.style.cssText="float:right;margin-right:10px;padding:1px 6px;",this._buttonRefresh.innerHTML=t[2]||this._lang[2],this._buttonRefresh.onclick=function(){r._save()},this._tDom.appendChild(this._buttonRefresh),this._textArea.readOnly=!1,this._textArea.style.cursor="default"):(this._textArea.readOnly=!0,this._textArea.style.cursor="text"),this._sizeCssText="width:"+this._zrWidth+"px;"+"height:"+this._zrHeight+"px;"+"background-color:#fff;",this._tDom.style.cssText=this._gCssText+this._sizeCssText},_optionToContent:function(){var e,t,r,i,s,o,u=[],a="";if(this.option.xAxis){this.option.xAxis instanceof Array?u=this.option.xAxis:u=[this.option.xAxis];for(e=0,i=u.length;e10&&(this._sizeCssText="width:"+this._zrWidth+"px;"+"height:"+this._zrHeight+"px;"+"background-color:#fff;",this._tDom.style.cssText=this._gCssText+this._sizeCssText,this._textArea.style.cssText="display:block;margin:0 0 8px 0;padding:4px 6px;overflow:auto;width:"+(this._zrWidth-15)+"px;"+"height:"+(this._zrHeight-100)+"px;")},dispose:function(){window.removeEventListener?(this._tDom.removeEventListener("click",this._stop),this._tDom.removeEventListener("mousewheel",this._stop),this._tDom.removeEventListener("mousemove",this._stop),this._tDom.removeEventListener("mousedown",this._stop),this._tDom.removeEventListener("mouseup",this._stop),this._tDom.removeEventListener("touchstart",this._stop),this._tDom.removeEventListener("touchmove",this._stop),this._tDom.removeEventListener("touchend",this._stop)):(this._tDom.detachEvent("onclick",this._stop),this._tDom.detachEvent("onmousewheel",this._stop),this._tDom.detachEvent("onmousemove",this._stop),this._tDom.detachEvent("onmousedown",this._stop),this._tDom.detachEvent("onmouseup",this._stop)),this._buttonRefresh.onclick=null,this._buttonClose.onclick=null,this._hasShow&&(this._tDom.removeChild(this._textArea),this._tDom.removeChild(this._buttonRefresh),this._tDom.removeChild(this._buttonClose)),this._textArea=null,this._buttonRefresh=null,this._buttonClose=null,this.dom.firstChild.removeChild(this._tDom),this._tDom=null}},r.inherits(i,t),e("../component").define("dataView",i),i}),define("echarts/component/toolbox",["require","./base","zrender/shape/Line","zrender/shape/Image","zrender/shape/Rectangle","../util/shape/Icon","../config","zrender/tool/util","zrender/config","zrender/tool/event","./dataView","../component"],function(e){function h(e,n,r,i,s){t.call(this,e,n,r,i,s),this.dom=s.dom,this._magicType={},this._isSilence=!1,this._iconList,this._iconShapeMap={},this._featureTitle={},this._featureIcon={},this._featureColor={},this._enableColor="red",this._disableColor="#ccc",this._markShapeList=[];var o=this;o._onMark=function(e){o.__onMark(e)},o._onMarkUndo=function(e){o.__onMarkUndo(e)},o._onMarkClear=function(e){o.__onMarkClear(e)},o._onDataZoom=function(e){o.__onDataZoom(e)},o._onDataZoomReset=function(e){o.__onDataZoomReset(e)},o._onDataView=function(e){o.__onDataView(e)},o._onRestore=function(e){o.__onRestore(e)},o._onSaveAsImage=function(e){o.__onSaveAsImage(e)},o._onMagicType=function(e){o.__onMagicType(e)},o._onCustomHandler=function(e){o.__onCustomHandler(e)},o._onmousemove=function(e){return o.__onmousemove(e)},o._onmousedown=function(e){return o.__onmousedown(e)},o._onmouseup=function(e){return o.__onmouseup(e)},o._onclick=function(e){return o.__onclick(e)}}var t=e("./base"),n=e("zrender/shape/Line"),r=e("zrender/shape/Image"),i=e("zrender/shape/Rectangle"),s=e("../util/shape/Icon"),o=e("../config"),u=e("zrender/tool/util"),a=e("zrender/config"),f=e("zrender/tool/event"),l="stack",c="tiled";return h.prototype={type:o.COMPONENT_TYPE_TOOLBOX,_buildShape:function(){this._iconList=[];var e=this.option.toolbox;this._enableColor=e.effectiveColor,this._disableColor=e.disableColor;var t=e.feature,n=[];for(var r in t)if(t[r].show)switch(r){case"mark":n.push({key:r,name:"mark"}),n.push({key:r,name:"markUndo"}),n.push({key:r,name:"markClear"});break;case"magicType":for(var i=0,s=t[r].type.length;i0){var o,r;for(var i=0,s=n.length;i=1){var t=this._markShapeList[e-1];this.zr.delShape(t.id),this.zr.refresh(),this._markShapeList.pop(),e==1&&(this._iconDisable(this._iconShapeMap.markUndo),this._iconDisable(this._iconShapeMap.markClear))}}return!0},__onMarkClear:function(){this._marking&&(this._marking=!1);var e=this._markShapeList.length;if(e>0){while(e--)this.zr.delShape(this._markShapeList.pop().id);this._iconDisable(this._iconShapeMap.markUndo),this._iconDisable(this._iconShapeMap.markClear),this.zr.refresh()}return!0},__onDataZoom:function(e){var t=e.target;if(this._zooming||this._zoomStart)this._resetZoom(),this.zr.refresh(),this.dom.style.cursor="default";else{this._resetMark(),this.zr.modShape(t.id,{style:{strokeColor:this._enableColor}}),this.zr.refresh(),this._zoomStart=!0;var n=this;setTimeout(function(){n.zr&&n.zr.on(a.EVENT.MOUSEDOWN,n._onmousedown)&&n.zr.on(a.EVENT.MOUSEUP,n._onmouseup)&&n.zr.on(a.EVENT.MOUSEMOVE,n._onmousemove)},10),this.dom.style.cursor="crosshair"}return!0},__onDataZoomReset:function(){return this._zooming&&(this._zooming=!1),this._zoomQueue.pop(),this._zoomQueue.length>0?this.component.dataZoom.absoluteZoom(this._zoomQueue[this._zoomQueue.length-1]):(this.component.dataZoom.rectZoom(),this._iconDisable(this._iconShapeMap.dataZoomReset),this.zr.refresh()),!0},_resetMark:function(){this._marking=!1,this._markStart&&(this._markStart=!1,this._iconShapeMap.mark&&this.zr.modShape(this._iconShapeMap.mark.id,{style:{strokeColor:this._iconShapeMap.mark.highlightStyle.strokeColor}}),this.zr.un(a.EVENT.CLICK,this._onclick),this.zr.un(a.EVENT.MOUSEMOVE,this._onmousemove))},_resetZoom:function(){this._zooming=!1,this._zoomStart&&(this._zoomStart=!1,this._iconShapeMap.dataZoom&&this.zr.modShape(this._iconShapeMap.dataZoom.id,{style:{strokeColor:this._iconShapeMap.dataZoom.highlightStyle.strokeColor}}),this.zr.un(a.EVENT.MOUSEDOWN,this._onmousedown),this.zr.un(a.EVENT.MOUSEUP,this._onmouseup),this.zr.un(a.EVENT.MOUSEMOVE,this._onmousemove))},_iconDisable:function(e){e.type!="image"?this.zr.modShape(e.id,{hoverable:!1,clickable:!1,style:{strokeColor:this._disableColor}}):this.zr.modShape(e.id,{hoverable:!1,clickable:!1,style:{opacity:.3}})},_iconEnable:function(e){e.type!="image"?this.zr.modShape(e.id,{hoverable:!0,clickable:!0,style:{strokeColor:e.highlightStyle.strokeColor}}):this.zr.modShape(e.id,{hoverable:!0,clickable:!0,style:{opacity:.8}})},__onDataView:function(){return this._dataView.show(this.option),!0},__onRestore:function(){return this._resetMark(),this._resetZoom(),this.messageCenter.dispatch(o.EVENT.RESTORE,null,null,this.myChart),!0},__onSaveAsImage:function(){var e=this.option.toolbox.feature.saveAsImage,t=e.type||"png";t!="png"&&t!="jpeg"&&(t="png");var n;this.myChart.isConnected()?n=this.myChart.getConnectedDataURL(t):n=this.zr.toDataURL("image/"+t,this.option.backgroundColor&&this.option.backgroundColor.replace(" ","")=="rgba(0,0,0,0)"?"#fff":this.option.backgroundColor);var r=document.createElement("div");r.id="__echarts_download_wrap__",r.style.cssText="position:fixed;z-index:99999;display:block;top:0;left:0;background-color:rgba(33,33,33,0.5);text-align:center;width:100%;height:100%;line-height:"+document.documentElement.clientHeight+"px;";var i=document.createElement("a");i.href=n,i.setAttribute("download",(e.name?e.name:this.option.title&&(this.option.title.text||this.option.title.subtext)?this.option.title.text||this.option.title.subtext:"ECharts")+"."+t),i.innerHTML='图片另存为")+'"/>',r.appendChild(i),document.body.appendChild(r),i=null,r=null,setTimeout(function(){var e=document.getElementById("__echarts_download_wrap__");e&&(e.onclick=function(){var e=document.getElementById("__echarts_download_wrap__");e.onclick=null,e.innerHTML="",document.body.removeChild(e),e=null},e=null)},500);return},__onMagicType:function(e){this._resetMark();var t=e.target._name;return this._magicType[t]||(this._magicType[t]=!0,t==o.CHART_TYPE_LINE?this._magicType[o.CHART_TYPE_BAR]=!1:t==o.CHART_TYPE_BAR&&(this._magicType[o.CHART_TYPE_LINE]=!1),t==l?this._magicType[c]=!1:t==c&&(this._magicType[l]=!1),this.messageCenter.dispatch(o.EVENT.MAGIC_TYPE_CHANGED,e.event,{magicType:this._magicType},this.myChart)),!0},setMagicType:function(e){this._resetMark(),this._magicType=e,!this._isSilence&&this.messageCenter.dispatch(o.EVENT.MAGIC_TYPE_CHANGED,null,{magicType:this._magicType},this.myChart)},__onCustomHandler:function(e){var t=e.target.style.iconType,n=this.option.toolbox.feature[t].onclick;typeof n=="function"&&n(this.option)},reset:function(e,t){t&&this.clear();if(this.query(e,"toolbox.show")&&this.query(e,"toolbox.feature.magicType.show")){var n=e.toolbox.feature.magicType.type,r=n.length;this._magicMap={};while(r--)this._magicMap[n[r]]=!0;r=e.series.length;var i,s;while(r--){i=e.series[r].type,this._magicMap[i]&&(s=e.xAxis instanceof Array?e.xAxis[e.series[r].xAxisIndex||0]:e.xAxis,s&&(s.type||"category")=="category"&&(s.__boundaryGap=typeof s.boundaryGap!="undefined"?s.boundaryGap:!0),s=e.yAxis instanceof Array?e.yAxis[e.series[r].yAxisIndex||0]:e.yAxis,s&&s.type=="category"&&(s.__boundaryGap=typeof s.boundaryGap!="undefined"?s.boundaryGap:!0),e.series[r].__type=i,e.series[r].__itemStyle=u.clone(e.series[r].itemStyle||{}));if(this._magicMap[l]||this._magicMap[c])e.series[r].__stack=e.series[r].stack}}this._magicType=t?{}:this._magicType||{};for(var o in this._magicType)if(this._magicType[o]){this.option=e,this.getMagicOption();break}var a=e.dataZoom;if(a&&a.show){var f=typeof a.start!="undefined"&&a.start>=0&&a.start<=100?a.start:0,h=typeof a.end!="undefined"&&a.end>=0&&a.end<=100?a.end:100;f>h&&(f+=h,h=f-h,f-=h),this._zoomQueue=[{start:f,end:h,start2:0,end2:100}]}else this._zoomQueue=[]},getMagicOption:function(){var e;if(this._magicType[o.CHART_TYPE_LINE]||this._magicType[o.CHART_TYPE_BAR]){var t=this._magicType[o.CHART_TYPE_LINE]?!1:!0;for(var n=0,r=this.option.series.length;n0&&(this.zr.delShape(this._lastTipShape.tipShape),this._lastTipShape=!1,this.shapeList.length=2),e&&this.zr.refresh(),this.showing=!1},_show:function(e,t,n,r){var i=this._tDom.offsetHeight,s=this._tDom.offsetWidth;e&&(typeof e=="function"&&(e=e([t,n])),e instanceof Array&&(t=e[0],n=e[1])),t+s>this._zrWidth&&(t-=s+40),n+i>this._zrHeight&&(n-=i-20),n<20&&(n=0),this._tDom.style.cssText=this._gCssText+this._defaultCssText+(r?r:"")+"left:"+t+"px;top:"+n+"px;",(i<10||s<10)&&setTimeout(this._refixed,20),this.showing=!0},__refixed:function(){if(this._tDom){var e="",t=this._tDom.offsetHeight,n=this._tDom.offsetWidth;this._tDom.offsetLeft+n>this._zrWidth&&(e+="left:"+(this._zrWidth-n-20)+"px;"),this._tDom.offsetTop+t>this._zrHeight&&(e+="top:"+(this._zrHeight-t-10)+"px;"),e!==""&&(this._tDom.style.cssText+=e)}},__tryShow:function(){var e,t;if(!this._curTarget)this._findPolarTrigger()||this._findAxisTrigger();else{if(this._curTarget._type=="island"&&this.option.tooltip.show){this._showItemTrigger();return}var n=u.get(this._curTarget,"series"),r=u.get(this._curTarget,"data");e=this.deepQuery([r,n,this.option],"tooltip.show"),typeof n=="undefined"||typeof r=="undefined"||e===!1?(clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this._hidingTicket=setTimeout(this._hide,this._hideDelay)):(t=this.deepQuery([r,n,this.option],"tooltip.trigger"),t=="axis"?this._showAxisTrigger(n.xAxisIndex,n.yAxisIndex,u.get(this._curTarget,"dataIndex")):this._showItemTrigger())}},_findAxisTrigger:function(){if(!this.component.xAxis||!this.component.yAxis){this._hidingTicket=setTimeout(this._hide,this._hideDelay);return}var e=this.option.series,t,n;for(var r=0,i=e.length;r=r)break;a=t.getCoordByIndex(++n),o=a}return r-sh){a>=i&&(c=a);if(a<=i)break;a=t.getCoordByIndex(++n),l=a}return i-l>c-i?n-=n!==0?1:0:typeof t.getNameByIndex(n)=="undefined"&&(n-=1),n},_showAxisTrigger:function(e,t,n){!this._event.connectTrigger&&this.messageCenter.dispatch(o.EVENT.TOOLTIP_IN_GRID,this._event,null,this.myChart);if(typeof this.component.xAxis=="undefined"||typeof this.component.yAxis=="undefined"||typeof e=="undefined"||typeof t=="undefined"){clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this._hidingTicket=setTimeout(this._hide,this._hideDelay);return}var r=this.option.series,i=[],s=[],u,a,l,c,h,p,d="";if(this.option.tooltip.trigger=="axis"){if(this.option.tooltip.show===!1)return;c=this.option.tooltip.formatter,h=this.option.tooltip.position}if(e!=-1&&this.component.xAxis.getAxis(e).type==o.COMPONENT_TYPE_AXIS_CATEGORY){u=this.component.xAxis.getAxis(e);for(var v=0,m=r.length;v=0?this._showItemTrigger():(clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this._tDom.style.display="none");if(i.length>0){var g;if(typeof c=="function"){var y=[];for(var v=0,m=i.length;v"+this._encodeHTML(i[v].name||"")+" : ",g=i[v].data[n],g=typeof g!="undefined"?typeof g.value!="undefined"?g.value:g:"-",c+=g instanceof Array?g:this.numAddCommas(g);this._tDom.innerHTML=c}if(p===!1||!this.option.tooltip.showContent)return;this.hasAppend||(this._tDom.style.left=this._zrWidth/2+"px",this._tDom.style.top=this._zrHeight/2+"px",this.dom.firstChild.appendChild(this._tDom),this.hasAppend=!0),this._show(h,a+10,l+10,d)}},_showPolarTrigger:function(e,t){if(typeof this.component.polar=="undefined"||typeof e=="undefined"||typeof t=="undefined"||t<0)return!1;var n=this.option.series,r=[],i,s,o,u="";if(this.option.tooltip.trigger=="axis"){if(this.option.tooltip.show===!1)return!1;i=this.option.tooltip.formatter,s=this.option.tooltip.position}var a=this.option.polar[e].indicator[t].text;for(var l=0,c=n.length;l0){var h,p,d=[];for(var l=0,c=r.length;l"+this._encodeHTML(d[0][3])+" : "+this.numAddCommas(d[0][2]);for(var l=1,c=d.length;l"+this._encodeHTML(d[l][1])+"
",i+=this._encodeHTML(d[l][3])+" : "+this.numAddCommas(d[l][2]);this._tDom.innerHTML=i}if(o===!1||!this.option.tooltip.showContent)return;return this.hasAppend||(this._tDom.style.left=this._zrWidth/2+"px",this._tDom.style.top=this._zrHeight/2+"px",this.dom.firstChild.appendChild(this._tDom),this.hasAppend=!0),this._show(s,f.getX(this._event),f.getY(this._event),u),!0}},_showItemTrigger:function(){if(!this._curTarget)return;var e=u.get(this._curTarget,"series"),t=u.get(this._curTarget,"data"),n=u.get(this._curTarget,"name"),r=u.get(this._curTarget,"value"),i=u.get(this._curTarget,"special"),s=u.get(this._curTarget,"special2"),a,l,c,h="",p,d="";this._curTarget._type!="island"?(this.option.tooltip.trigger=="item"&&(a=this.option.tooltip.formatter,l=this.option.tooltip.position),this.query(e,"tooltip.trigger")=="item"&&(c=this.query(e,"tooltip.showContent")||c,a=this.query(e,"tooltip.formatter")||a,l=this.query(e,"tooltip.position")||l,h+=this._style(this.query(e,"tooltip"))),c=this.query(t,"tooltip.showContent")||c,a=this.query(t,"tooltip.formatter")||a,l=this.query(t,"tooltip.position")||l,h+=this._style(this.query(t,"tooltip"))):(c=this.deepQuery([t,e,this.option],"tooltip.showContent"),a=this.deepQuery([t,e,this.option],"tooltip.islandFormatter"),l=this.deepQuery([t,e,this.option],"tooltip.islandPosition"));if(typeof a=="function")this._curTicket=(e.name||"")+":"+u.get(this._curTarget,"dataIndex"),this._tDom.innerHTML=a.call(this.myChart,[e.name||"",n,r,i,s,t],this._curTicket,this._setContent);else if(typeof a=="string")this._curTicket=NaN,a=a.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}"),a=a.replace("{a0}",this._encodeHTML(e.name||"")).replace("{b0}",this._encodeHTML(n)).replace("{c0}",r instanceof Array?r:this.numAddCommas(r)),a=a.replace("{d}","{d0}").replace("{d0}",i||""),a=a.replace("{e}","{e0}").replace("{e0}",u.get(this._curTarget,"special2")||""),this._tDom.innerHTML=a;else{this._curTicket=NaN;if(e.type==o.CHART_TYPE_SCATTER)this._tDom.innerHTML=(typeof e.name!="undefined"?this._encodeHTML(e.name)+"
":"")+(n===""?"":this._encodeHTML(n)+" : ")+r+(typeof i=="undefined"?"":" ("+i+")");else if(e.type==o.CHART_TYPE_RADAR&&i){p=i,d+=this._encodeHTML(n===""?e.name||"":n),d+=d===""?"":"
";for(var v=0;v";this._tDom.innerHTML=d}else if(e.type==o.CHART_TYPE_CHORD)if(typeof s=="undefined")this._tDom.innerHTML=this._encodeHTML(n)+" ("+this.numAddCommas(r)+")";else{var m=this._encodeHTML(n),g=this._encodeHTML(i);this._tDom.innerHTML=(typeof e.name!="undefined"?this._encodeHTML(e.name)+"
":"")+m+" -> "+g+" ("+this.numAddCommas(r)+")"+"
"+g+" -> "+m+" ("+this.numAddCommas(s)+")"}else this._tDom.innerHTML=(typeof e.name!="undefined"?this._encodeHTML(e.name)+"
":"")+this._encodeHTML(n)+" : "+this.numAddCommas(r)+(typeof i=="undefined"?"":" ("+this.numAddCommas(i)+")")}if(!this._axisLineShape.invisible||!this._axisShadowShape.invisible)this._axisLineShape.invisible=!0,this.zr.modShape(this._axisLineShape.id),this._axisShadowShape.invisible=!0,this.zr.modShape(this._axisShadowShape.id),this.zr.refresh();if(c===!1||!this.option.tooltip.showContent)return;this.hasAppend||(this._tDom.style.left=this._zrWidth/2+"px",this._tDom.style.top=this._zrHeight/2+"px",this.dom.firstChild.appendChild(this._tDom),this.hasAppend=!0),this._show(l,f.getX(this._event)+20,f.getY(this._event)-20,h)},_styleAxisPointer:function(e,t,n,r,i,s,o,u){if(e.length>0){var a,f,l=this.option.tooltip.axisPointer,c=l.type,h={line:{},cross:{},shadow:{}};for(var p in h)h[p].color=l[p+"Style"].color,h[p].width=l[p+"Style"].width,h[p].type=l[p+"Style"].type;for(var d=0,v=e.length;d100?(this._axisCrossShape.style.textAlign="left",this._axisCrossShape.style.textX=o+10):(this._axisCrossShape.style.textAlign="right",this._axisCrossShape.style.textX=o-10),u-this.component.grid.getY()>50?(this._axisCrossShape.style.textBaseline="bottom",this._axisCrossShape.style.textY=u-10):(this._axisCrossShape.style.textBaseline="top",this._axisCrossShape.style.textY=u+10),this._axisCrossShape.invisible=!1,this.zr.modShape(this._axisCrossShape.id);else if(c=="shadow"){if(typeof h.shadow.width=="undefined"||h.shadow.width=="auto"||isNaN(h.shadow.width))h.shadow.width=s;t==r?Math.abs(this.component.grid.getX()-t)<2?(h.shadow.width/=2,t=r+=h.shadow.width/2):Math.abs(this.component.grid.getXend()-t)<2&&(h.shadow.width/=2,t=r-=h.shadow.width/2):n==i&&(Math.abs(this.component.grid.getY()-n)<2?(h.shadow.width/=2,n=i+=h.shadow.width/2):Math.abs(this.component.grid.getYend()-n)<2&&(h.shadow.width/=2,n=i-=h.shadow.width/2)),this._axisShadowShape.style={xStart:t,yStart:n,xEnd:r,yEnd:i,strokeColor:h.shadow.color,lineWidth:h.shadow.width},this._axisShadowShape.invisible=!1,this.zr.modShape(this._axisShadowShape.id)}this.zr.refresh()}},__onmousemove:function(e){clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket);var t=e.target,n=f.getX(e.event),r=f.getY(e.event);if(!t)this._curTarget=!1,this._event=e.event,this._event.zrenderX=n,this._event.zrenderY=r,this._needAxisTrigger&&this.component.grid&&l.isInside(s,this.component.grid.getArea(),n,r)?this._showingTicket=setTimeout(this._tryShow,this._showDelay):this._needAxisTrigger&&this.component.polar&&this.component.polar.isInside([n,r])!=-1?this._showingTicket=setTimeout(this._tryShow,this._showDelay):(!this._event.connectTrigger&&this.messageCenter.dispatch(o.EVENT.TOOLTIP_OUT_GRID,this._event,null,this.myChart),this._hidingTicket=setTimeout(this._hide,this._hideDelay));else{this._curTarget=t,this._event=e.event,this._event.zrenderX=n,this._event.zrenderY=r;var i;if(this._needAxisTrigger&&this.component.polar&&(i=this.component.polar.isInside([n,r]))!=-1){var u=this.option.series;for(var a=0,c=u.length;a0&&(this.zr.delShape(this._lastTipShape.tipShape),this.shapeList.length=2);for(var n=0,r=t.length;n0&&this.zr.delShape(this._lastTipShape.tipShape),this._lastTipShape=!1,this.shapeList.length=2;if(e){this.option=e,this.option.tooltip=this.reformOption(this.option.tooltip),this.option.tooltip.textStyle=h.merge(this.option.tooltip.textStyle,this.ecTheme.textStyle),this.option.tooltip.padding=this.reformCssArray(this.option.tooltip.padding),this._needAxisTrigger=!1,this.option.tooltip.trigger=="axis"&&(this._needAxisTrigger=!0);var t=this.option.series;for(var n=0,r=t.length;n0&&this.zr.delShape(this._lastTipShape.tipShape),this.clear(),this.shapeList=null,clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this.zr.un(a.EVENT.MOUSEMOVE,this._onmousemove),this.zr.un(a.EVENT.GLOBALOUT,this._onglobalout),this.hasAppend&&this.dom.firstChild.removeChild(this._tDom),this._tDom=null},_encodeHTML:function(e){return String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}},h.inherits(d,t),e("../component").define("tooltip",d),d}),define("zrender/shape/Ring",["require","./Base","../tool/util"],function(e){function n(e){t.call(this,e)}var t=e("./Base");return n.prototype={type:"ring",buildPath:function(e,t){e.arc(t.x,t.y,t.r,0,Math.PI*2,!1),e.moveTo(t.x+t.r0,t.y),e.arc(t.x,t.y,t.r0,0,Math.PI*2,!0);return},getRect:function(e){if(e.__rect)return e.__rect;var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,e.__rect={x:Math.round(e.x-e.r-t/2),y:Math.round(e.y-e.r-t/2),width:e.r*2+t,height:e.r*2+t},e.__rect}},e("../tool/util").inherits(n,t),n}),define("zrender/shape/Sector",["require","../tool/math","./Base","./Ring","./Polygon","../tool/util"],function(e){function r(e){n.call(this,e)}var t=e("../tool/math"),n=e("./Base");return r.prototype={type:"sector",buildPath:function(e,n){var r=n.x,i=n.y,s=typeof n.r0=="undefined"?0:n.r0,o=n.r,u=n.startAngle,a=n.endAngle;if(Math.abs(a-u)>=360){e.arc(r,i,o,0,Math.PI*2,!1),s!==0&&(e.moveTo(r+s,i),e.arc(r,i,s,0,Math.PI*2,!0));return}u=t.degreeToRadian(u),a=t.degreeToRadian(a);var f=Math.PI*2,l=t.cos(u),c=t.sin(u);e.moveTo(l*s+r,i-c*s),e.lineTo(l*o+r,i-c*o),e.arc(r,i,o,f-u,f-a,!0),e.lineTo(t.cos(a)*s+r,i-t.sin(a)*s),s!==0&&e.arc(r,i,s,f-a,f-u,!1);return},getRect:function(n){if(n.__rect)return n.__rect;var r=n.x,i=n.y,s=typeof n.r0=="undefined"?0:n.r0,o=n.r,u=n.startAngle,a=n.endAngle;if(Math.abs(a-u)>=360)return n.__rect=e("./Ring").prototype.getRect(n),n.__rect;u=(720+u)%360,a=(720+a)%360,a<=u&&(a+=360);var f=[];return u<=90&&a>=90&&f.push([r,i-o]),u<=180&&a>=180&&f.push([r-o,i]),u<=270&&a>=270&&f.push([r,i+o]),u<=360&&a>=360&&f.push([r+o,i]),u=t.degreeToRadian(u),a=t.degreeToRadian(a),f.push([t.cos(u)*s+r,i-t.sin(u)*s]),f.push([t.cos(u)*o+r,i-t.sin(u)*o]),f.push([t.cos(a)*o+r,i-t.sin(a)*o]),f.push([t.cos(a)*s+r,i-t.sin(a)*s]),n.__rect=e("./Polygon").prototype.getRect({brushType:n.brushType,lineWidth:n.lineWidth,pointList:f}),n.__rect}},e("../tool/util").inherits(r,n),r}),define("echarts/util/shape/Candle",["require","zrender/shape/Base","zrender/tool/util","./normalIsCover"],function(e){function r(e){t.call(this,e)}var t=e("zrender/shape/Base"),n=e("zrender/tool/util");return r.prototype={type:"candle",_numberOrder:function(e,t){return t-e},buildPath:function(e,t){var r=n.clone(t.y).sort(this._numberOrder);e.moveTo(t.x,r[3]),e.lineTo(t.x,r[2]),e.moveTo(t.x-t.width/2,r[2]),e.rect(t.x-t.width/2,r[2],t.width,r[1]-r[2]),e.moveTo(t.x,r[1]),e.lineTo(t.x,r[0])},getRect:function(e){if(!e.__rect){var t=0;if(e.brushType=="stroke"||e.brushType=="fill")t=e.lineWidth||1;var r=n.clone(e.y).sort(this._numberOrder);e.__rect={x:Math.round(e.x-e.width/2-t/2),y:Math.round(r[3]-t/2),width:e.width+t,height:r[0]-r[3]+t}}return e.__rect},isCover:e("./normalIsCover")},n.inherits(r,t),r}),define("echarts/component/legend",["require","./base","zrender/shape/Text","zrender/shape/Rectangle","zrender/shape/Sector","../util/shape/Icon","../util/shape/Candle","../config","zrender/tool/util","zrender/tool/area","../component"],function(e){function l(e,n,r,i,s){if(!this.query(i,"legend.data")){console.error("option.legend.data has not been defined.");return}t.call(this,e,n,r,i,s);var o=this;o._legendSelected=function(e){o.__legendSelected(e)},this._colorIndex=0,this._colorMap={},this._selectedMap={},this.refresh(i)}var t=e("./base"),n=e("zrender/shape/Text"),r=e("zrender/shape/Rectangle"),i=e("zrender/shape/Sector"),s=e("../util/shape/Icon"),o=e("../util/shape/Candle"),u=e("../config"),a=e("zrender/tool/util"),f=e("zrender/tool/area");l.prototype={type:u.COMPONENT_TYPE_LEGEND,_buildShape:function(){this._itemGroupLocation=this._getItemGroupLocation(),this._buildBackground(),this._buildItem();for(var e=0,t=this.shapeList.length;e=d-m&&(m=this._itemGroupLocation.x,g+=b+w):v-g<200&&b+(S==t-1||e[S+1]===""?0:w)>=v-g&&(this.legendOption.x=="right"?m-=this._itemGroupLocation.maxWidth+w:m+=this._itemGroupLocation.maxWidth+w,g=this._itemGroupLocation.y),o=this._getItemShapeByType(m,g,y,b,this._selectedMap[r]?E:"#ccc",i,E),o._name=r,o=new s(o),u={zlevel:this._zlevelBase,style:{x:m+y+5,y:g+b/2,color:this._selectedMap[r]?c.color==="auto"?E:c.color:"#ccc",text:p,textFont:h,textBaseline:"middle"},highlightStyle:{color:E,brushType:"fill"},hoverable:!!this.legendOption.selectedMode,clickable:!!this.legendOption.selectedMode},this.legendOption.orient=="vertical"&&this.legendOption.x=="right"&&(u.style.x-=y+10,u.style.textAlign="right"),u._name=r,u=new n(u),this.legendOption.selectedMode&&(o.onclick=u.onclick=this._legendSelected,o.onmouseover=u.onmouseover=this.hoverConnect,o.hoverConnect=u.id,u.hoverConnect=o.id),this.shapeList.push(o),this.shapeList.push(u),this.legendOption.orient=="horizontal"?m+=y+5+f.getTextWidth(p,h)+w:g+=b+w}this.legendOption.orient=="horizontal"&&this.legendOption.x=="center"&&g!=this._itemGroupLocation.y&&this._mLineOptimize()},_getName:function(e){return typeof e.name!="undefined"?e.name:e},_getFormatterName:function(e){var t=this.legendOption.formatter,n;return typeof t=="function"?n=t.call(this.myChart,e):typeof t=="string"?n=t.replace("{name}",e):n=e,n},_getFormatterNameFromData:function(e){var t=this._getName(e);return this._getFormatterName(t)},_mLineOptimize:function(){var e=[],t=this._itemGroupLocation.x;for(var n=2,r=this.shapeList.length;nh?(u=h,l+=i+n):u=Math.max(u,d),l+=i+n,d=0;continue}d+=r+f.getTextWidth(this._getFormatterNameFromData(e[m]),e[m].textStyle?this.getFont(a.merge(e[m].textStyle||{},s)):o)+n}l=Math.max(l,i),d-=n,d>h?(u=h,l+=i+n):u=Math.max(u,d)}else{for(var m=0;mp?(l=p,u+=v+n):l=Math.max(l,d),u+=v+n,d=0;continue}d+=i+n}u=Math.max(u,v),d-=n,d>p?(l=p,u+=v+n):l=Math.max(l,d)}h=this.zr.getWidth(),p=this.zr.getHeight();var g;switch(this.legendOption.x){case"center":g=Math.floor((h-u)/2);break;case"left":g=this.legendOption.padding[3]+this.legendOption.borderWidth;break;case"right":g=h-u-this.legendOption.padding[1]-this.legendOption.padding[3]-this.legendOption.borderWidth*2;break;default:g=this.parsePercent(this.legendOption.x,h)}var y;switch(this.legendOption.y){case"top":y=this.legendOption.padding[0]+this.legendOption.borderWidth;break;case"bottom":y=p-l-this.legendOption.padding[0]-this.legendOption.padding[2]-this.legendOption.borderWidth*2;break;case"center":y=Math.floor((p-l)/2);break;default:y=this.parsePercent(this.legendOption.y,p)}return{x:g,y:y,width:u,height:l,maxWidth:v}},_getSomethingByName:function(e){var t=this.option.series,n;for(var r=0,i=t.length;r=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height?!0:!1}},i.inherits(o,t),o}),define("echarts/component/timeline",["require","./base","zrender/shape/Rectangle","../util/shape/Icon","../util/shape/Chain","../config","zrender/tool/util","zrender/tool/area","zrender/tool/event","../component"],function(e){function f(e,n,r,i,u){t.call(this,e,n,r,i,u);var a=this;a._onclick=function(e){return a.__onclick(e)},a._ondrift=function(e,t){return a.__ondrift(this,e,t)},a._ondragend=function(){return a.__ondragend()},a._setCurrentOption=function(){var e=a.timelineOption;a.currentIndex%=e.data.length;var t=a.options[a.currentIndex]||{};a.myChart.setOption(t,e.notMerge),a.messageCenter.dispatch(s.EVENT.TIMELINE_CHANGED,null,{currentIndex:a.currentIndex,data:typeof e.data[a.currentIndex].name!="undefined"?e.data[a.currentIndex].name:e.data[a.currentIndex]},a.myChart)},a._onFrame=function(){a._setCurrentOption(),a._syncHandleShape(),a.timelineOption.autoPlay&&(a.playTicket=setTimeout(function(){a.currentIndex+=1;if(!a.timelineOption.loop&&a.currentIndex>=a.timelineOption.data.length){a.currentIndex=a.timelineOption.data.length-1,a.stop();return}a._onFrame()},a.timelineOption.playInterval))},this.setTheme(!1),this.options=this.option.options,this.currentIndex=this.timelineOption.currentIndex%this.timelineOption.data.length,!this.timelineOption.notMerge&&this.currentIndex!==0&&(this.options[this.currentIndex]=o.merge(this.options[this.currentIndex],this.options[0])),this.timelineOption.show&&(this._buildShape(),this._syncHandleShape()),this._setCurrentOption();if(this.timelineOption.autoPlay){var a=this;this.playTicket=setTimeout(function(){a.play()},this.ecTheme.animationDuration)}}function l(e,t){var n=2,i=t.x+n,s=t.y+n+2,o=t.width-n,u=t.height-n,a=t.symbol;if(a=="last")e.moveTo(i+o-2,s+u/3),e.lineTo(i+o-2,s),e.lineTo(i+2,s+u/2),e.lineTo(i+o-2,s+u),e.lineTo(i+o-2,s+u/3*2),e.moveTo(i,s),e.lineTo(i,s);else if(a=="next")e.moveTo(i+2,s+u/3),e.lineTo(i+2,s),e.lineTo(i+o-2,s+u/2),e.lineTo(i+2,s+u),e.lineTo(i+2,s+u/3*2),e.moveTo(i,s),e.lineTo(i,s);else if(a=="play")if(t.status=="stop")e.moveTo(i+2,s),e.lineTo(i+o-2,s+u/2),e.lineTo(i+2,s+u),e.lineTo(i+2,s);else{var f=t.brushType=="both"?2:3;e.rect(i+2,s,f,u),e.rect(i+o-f-2,s,f,u)}else if(a.match("image")){var l="";l=a.replace(new RegExp("^image:\\/\\/"),""),a=r.prototype.iconLibrary.image,a(e,{x:i,y:s,width:o,height:u,image:l})}}var t=e("./base"),n=e("zrender/shape/Rectangle"),r=e("../util/shape/Icon"),i=e("../util/shape/Chain"),s=e("../config"),o=e("zrender/tool/util"),u=e("zrender/tool/area"),a=e("zrender/tool/event");return f.prototype={type:s.COMPONENT_TYPE_TIMELINE,_buildShape:function(){this._location=this._getLocation(),this._buildBackground(),this._buildControl(),this._chainPoint=this._getChainPoint();if(this.timelineOption.label.show){var e=this._getInterval();for(var t=0,n=this._chainPoint.length;t3){var o=!1,a,f;n=0;while(!o&&n1){var v=c/h;v=v>50?50:v<20?5:v,c-=v*2;if(e.type=="number")for(var m=0;m0?"right":"left",S=[r*Math.PI/180,f,l-5]):S=!1,g.push({x:f,n:b,isEmpty:w,symbol:y,symbolSize:a[m].symbolSize||n,color:a[m].color,borderColor:a[m].borderColor,borderWidth:a[m].borderWidth,name:this._getReformedLabel(m),textColor:u.color,textAlign:E,textBaseline:u.baseline||"middle",textX:f,textY:l-(r?5:0),textFont:a[m].textStyle?this.getFont(u):s,rotation:S,showLabel:!1});return g},_buildBackground:function(){var e=this.timelineOption,t=e.padding,r=this._location.width,i=this._location.height;(e.borderWidth!==0||e.backgroundColor.replace(/\s/g,"")!="rgba(0,0,0,0)")&&this.shapeList.push(new n({zlevel:this._zlevelBase,hoverable:!1,style:{x:this._location.x-t[3],y:this._location.y-t[0],width:r+t[1]+t[3],height:i+t[0]+t[2],brushType:e.borderWidth===0?"fill":"both",color:e.backgroundColor,strokeColor:e.borderColor,lineWidth:e.borderWidth}}))},_buildControl:function(){var e=this,t=this.timelineOption,n=t.lineStyle,i=t.controlStyle;if(t.controlPosition=="none")return;var s=15,u=5,a;t.controlPosition=="left"?(a=this._location.x,this._location.x+=(s+u)*3):(a=this._location.x2-((s+u)*3-u),this._location.x2-=(s+u)*3);var f=this._location.y,l={zlevel:this._zlevelBase+1,style:{iconType:"timelineControl",symbol:"last",x:a,y:f,width:s,height:s,brushType:"stroke",color:i.normal.color,strokeColor:i.normal.color,lineWidth:n.width},highlightStyle:{color:i.emphasis.color,strokeColor:i.emphasis.color,lineWidth:n.width+1},clickable:!0};this._ctrLastShape=new r(l),this._ctrLastShape.onclick=function(){e.last()},this.shapeList.push(this._ctrLastShape),a+=s+u,this._ctrPlayShape=new r(o.clone(l)),this._ctrPlayShape.style.brushType="fill",this._ctrPlayShape.style.symbol="play",this._ctrPlayShape.style.status=this.timelineOption.autoPlay?"playing":"stop",this._ctrPlayShape.style.x=a,this._ctrPlayShape.onclick=function(){e._ctrPlayShape.style.status=="stop"?e.play():e.stop()},this.shapeList.push(this._ctrPlayShape),a+=s+u,this._ctrNextShape=new r(o.clone(l)),this._ctrNextShape.style.symbol="next",this._ctrNextShape.style.x=a,this._ctrNextShape.onclick=function(){e.next()},this.shapeList.push(this._ctrNextShape)},_buildChain:function(){var e=this.timelineOption,t=e.lineStyle;this._timelineShae={zlevel:this._zlevelBase,style:{x:this._location.x,y:this.subPixelOptimize(this._location.y,t.width),width:this._location.x2-this._location.x,height:this._location.height,chainPoint:this._chainPoint,brushType:"both",strokeColor:t.color,lineWidth:t.width,lineType:t.type},hoverable:!1,clickable:!0,onclick:this._onclick},this._timelineShae=new i(this._timelineShae),this.shapeList.push(this._timelineShae)},_buildHandle:function(){var e=this._chainPoint[this.currentIndex],t=e.symbolSize+1;t=t<5?5:t,this._handleShape={zlevel:this._zlevelBase+1,hoverable:!1,draggable:!0,style:{iconType:"diamond",n:e.n,x:e.x-t,y:this._location.y+this._location.height/4-t,width:t*2,height:t*2,brushType:"both",textPosition:"specific",textX:e.x,textY:this._location.y-this._location.height/4,textAlign:"center",textBaseline:"middle"},highlightStyle:{},ondrift:this._ondrift,ondragend:this._ondragend},this._handleShape=new r(this._handleShape),this.shapeList.push(this._handleShape)},_syncHandleShape:function(){if(!this.timelineOption.show)return;var e=this.timelineOption,t=e.checkpointStyle,n=this._chainPoint[this.currentIndex];this._handleShape.style.text=t.label.show?n.name:"",this._handleShape.style.textFont=n.textFont,this._handleShape.style.n=n.n,t.symbol=="auto"?this._handleShape.style.iconType=n.symbol!="none"?n.symbol:"diamond":(this._handleShape.style.iconType=t.symbol,t.symbol.match("star")&&(this._handleShape.style.n=t.symbol.replace("star","")-0||5,this._handleShape.style.iconType="star"));var r;t.symbolSize=="auto"?(r=n.symbolSize+2,r=r<5?5:r):r=t.symbolSize-0,this._handleShape.style.color=t.color=="auto"?n.color?n.color:e.controlStyle.emphasis.color:t.color,this._handleShape.style.textColor=t.label.textStyle.color=="auto"?this._handleShape.style.color:t.label.textStyle.color,this._handleShape.highlightStyle.strokeColor=this._handleShape.style.strokeColor=t.borderColor=="auto"?n.borderColor?n.borderColor:"#fff":t.borderColor,this._handleShape.style.lineWidth=t.borderWidth=="auto"?n.borderWidth?n.borderWidth:0:t.borderWidth-0,this._handleShape.highlightStyle.lineWidth=this._handleShape.style.lineWidth+1,this.zr.animate(this._handleShape.id,"style").when(500,{x:n.x-r,textX:n.x,y:this._location.y+this._location.height/4-r,width:r*2,height:r*2}).start("ExponentialOut")},_findChainIndex:function(e){var t=this._chainPoint,n=t.length;if(e<=t[0].x)return 0;if(e>=t[n-1].x)return n-1;for(var r=0;r=t[r].x&&e<=t[r+1].x)return Math.abs(e-t[r].x)=n[r-1].x-n[r-1].symbolSize?(e.style.x=n[r-1].x-n[r-1].symbolSize,i=r-1):(e.style.x+=t,i=this._findChainIndex(e.style.x));var s=n[i],o=s.symbolSize+2;e.style.iconType=s.symbol,e.style.n=s.n,e.style.textX=e.style.x+o/2,e.style.y=this._location.y+this._location.height/4-o,e.style.width=o*2,e.style.height=o*2,e.style.text=s.name;if(i==this.currentIndex)return!0;this.currentIndex=i;if(this.timelineOption.realtime){clearTimeout(this.playTicket);var u=this;this.playTicket=setTimeout(function(){u._setCurrentOption()},200)}return!0},__ondragend:function(){this.isDragend=!0},ondragend:function(e,t){if(!this.isDragend||!e.target)return;!this.timelineOption.realtime&&this._setCurrentOption(),t.dragOut=!0,t.dragIn=!0,t.needRefresh=!1,this.isDragend=!1,this._syncHandleShape();return},last:function(){return this.timelineOption.autoPlay&&this.stop(),this.currentIndex-=1,this.currentIndex<0&&(this.currentIndex=this.timelineOption.data.length-1),this._onFrame(),this.currentIndex},next:function(){return this.timelineOption.autoPlay&&this.stop(),this.currentIndex+=1,this.currentIndex>=this.timelineOption.data.length&&(this.currentIndex=0),this._onFrame(),this.currentIndex},play:function(e,t){return this._ctrPlayShape&&this._ctrPlayShape.style.status!="playing"&&(this._ctrPlayShape.style.status="playing",this.zr.modShape(this._ctrPlayShape.id),this.zr.refresh()),this.timelineOption.autoPlay=typeof t!="undefined"?t:!0,this.timelineOption.autoPlay||clearTimeout(this.playTicket),this.currentIndex=typeof e!="undefined"?e:this.currentIndex+1,this.currentIndex>=this.timelineOption.data.length&&(this.currentIndex=0),this._onFrame(),this.currentIndex},stop:function(){return this._ctrPlayShape&&this._ctrPlayShape.style.status!="stop"&&(this._ctrPlayShape.style.status="stop",this.zr.modShape(this._ctrPlayShape.id),this.zr.refresh()),this.timelineOption.autoPlay=!1,clearTimeout(this.playTicket),this.currentIndex},resize:function(){this.timelineOption.show&&(this.clear(),this._buildShape(),this._syncHandleShape())},setTheme:function(e){this.timelineOption=this.reformOption(o.clone(this.option.timeline)),this.timelineOption.padding=this.reformCssArray(this.timelineOption.padding),this.timelineOption.label.textStyle=o.merge(this.timelineOption.label.textStyle||{},this.ecTheme.textStyle),this.timelineOption.checkpointStyle.label.textStyle=o.merge(this.timelineOption.checkpointStyle.label.textStyle||{},this.ecTheme.textStyle),this.timelineOption.show&&e&&(this.clear(),this._buildShape(),this._syncHandleShape())},dispose:function(){this.clear(),this.shapeList=null,clearTimeout(this.playTicket)}},r.prototype.iconLibrary.timelineControl=l,o.inherits(f,t),e("../component").define("timeline",f),f}),define("zrender/loadingEffect/Bar",["require","./Base","../tool/util","../tool/color","../shape/Rectangle"],function(e){function s(e){t.call(this,e)}var t=e("./Base"),n=e("../tool/util"),r=e("../tool/color"),i=e("../shape/Rectangle");return n.inherits(s,t),s.prototype._start=function(e,t){var s=n.merge(this.options,{textStyle:{color:"#888"},backgroundColor:"rgba(250, 250, 250, 0.8)",effectOption:{x:0,y:this.canvasHeight/2-30,width:this.canvasWidth,height:5,brushType:"fill",timeInterval:100}}),o=this.createTextShape(s.textStyle),u=this.createBackgroundShape(s.backgroundColor),a=s.effectOption,f=new i({highlightStyle:n.clone(a)});f.highlightStyle.color=a.color||r.getLinearGradient(a.x,a.y,a.x+a.width,a.y+a.height,[[0,"#ff6400"],[.5,"#ffe100"],[1,"#b1ff00"]]);if(s.progress!=null){e(u),f.highlightStyle.width=this.adjust(s.progress,[0,1])*s.effectOption.width,e(f),e(o),t();return}return f.highlightStyle.width=0,setInterval(function(){e(u),f.highlightStyle.width=h&&(c[n].len=Math.ceil(Math.random()*400),r.xStart=-400,r.xEnd=-400+c[n].len,r.yStart=Math.ceil(Math.random()*p),r.yEnd=r.yStart),r.xStart+=c[n].animationX,r.xEnd+=c[n].animationX,e(c[n])}e(o),t()},a.timeInterval)},s}),define("zrender/loadingEffect/Ring",["require","./Base","../tool/util","../tool/color","../shape/Ring","../shape/Sector"],function(e){function o(e){t.call(this,e)}var t=e("./Base"),n=e("../tool/util"),r=e("../tool/color"),i=e("../shape/Ring"),s=e("../shape/Sector");return n.inherits(o,t),o.prototype._start=function(e,t){var o=n.merge(this.options,{textStyle:{color:"#07a"},backgroundColor:"rgba(250, 250, 250, 0.8)",effect:{x:this.canvasWidth/2,y:this.canvasHeight/2,r0:60,r:100,color:"#bbdcff",brushType:"fill",textPosition:"inside",textFont:"normal 30px verdana",textColor:"rgba(30, 144, 255, 0.6)",timeInterval:100}}),u=o.effect,a=o.textStyle;a.x==null&&(a.x=u.x),a.y==null&&(a.y=u.y+(u.r0+u.r)/2-5);var f=this.createTextShape(o.textStyle),l=this.createBackgroundShape(o.backgroundColor),c=u.x,h=u.y,p=u.r0+6,d=u.r-6,v=u.color,m=r.lift(v,.1),g=new i({highlightStyle:n.clone(u)}),y=[],b=r.getGradientColors(["#ff6400","#ffe100","#97ff00"],25),w=15,E=240;for(var S=0;S<16;S++)y.push(new s({highlightStyle:{x:c,y:h,r0:p,r:d,startAngle:E-w,endAngle:E,brushType:"fill",color:m},_color:r.getLinearGradient(c+p*Math.cos(E,!0),h-p*Math.sin(E,!0),c+p*Math.cos(E-w,!0),h-p*Math.sin(E-w,!0),[[0,b[S*2]],[1,b[S*2+1]]])})),E-=w;E=360;for(var S=0;S<4;S++)y.push(new s({highlightStyle:{x:c,y:h,r0:p,r:d,startAngle:E-w,endAngle:E,brushType:"fill",color:m},_color:r.getLinearGradient(c+p*Math.cos(E,!0),h-p*Math.sin(E,!0),c+p*Math.cos(E-w,!0),h-p*Math.sin(E-w,!0),[[0,b[S*2+32]],[1,b[S*2+33]]])})),E-=w;var x=0;if(o.progress!=null){e(l),x=this.adjust(o.progress,[0,1]).toFixed(2)*100/5,g.highlightStyle.text=x*5+"%",e(g);for(var S=0;S<20;S++)y[S].highlightStyle.color=S=20?-20:1,e(g);for(var n=0;n<20;n++)y[n].highlightStyle.color=n ");var u=-1;for(var a=0,f=o.length;a-1){o.splice(u,1),this._optionRestore.series[e][n].data.splice(u,1);var c=this.chart[i.type];c&&c.delMark(e,t.join(" > "),n)}return this},getDom:function(){return this.dom},getZrender:function(){return this._zr},getDataURL:function(e){if(!s)return"";if(this._chartList.length===0){var t="IMG"+this.id,n=document.getElementById(t);if(n)return n.src}var r=this.component.tooltip;r&&r.hideTip();switch(e){case"jpeg":break;default:e="png"}var i=this._option.backgroundColor;return i&&i.replace(" ","")=="rgba(0,0,0,0)"&&(i="#fff"),this._zr.toDataURL("image/"+e,i)},getImage:function(e){var t=this._optionRestore.title,n=document.createElement("img");return n.src=this.getDataURL(e),n.title=t&&t.text||"ECharts",n},getConnectedDataURL:function(t){if(!this.isConnected())return this.getDataURL(t);var n=this.dom,r={self:{img:this.getDataURL(t),left:n.offsetLeft,top:n.offsetTop,right:n.offsetLeft+n.offsetWidth,bottom:n.offsetTop+n.offsetHeight}},i=r.self.left,s=r.self.top,o=r.self.right,u=r.self.bottom;for(var a in this._connected)n=this._connected[a].getDom(),r[a]={img:this._connected[a].getDataURL(t),left:n.offsetLeft,top:n.offsetTop,right:n.offsetLeft+n.offsetWidth,bottom:n.offsetTop+n.offsetHeight},i=Math.min(i,r[a].left),s=Math.min(s,r[a].top),o=Math.max(o,r[a].right),u=Math.max(u,r[a].bottom);var f=document.createElement("div");f.style.position="absolute",f.style.left="-4000px",f.style.width=o-i+"px",f.style.height=u-s+"px",document.body.appendChild(f);var l=e("zrender").init(f),c=e("zrender/shape/Image");for(var a in r)l.addShape(new c({style:{x:r[a].left-i,y:r[a].top-s,image:r[a].img}}));l.render();var h=this._option.backgroundColor;h&&h.replace(/ /g,"")=="rgba(0,0,0,0)"&&(h="#fff");var p=l.toDataURL("image/png",h);return setTimeout(function(){l.dispose(),f.parentNode.removeChild(f),f=null},100),p},getConnectedImage:function(e){var t=this._optionRestore.title,n=document.createElement("img");return n.src=this.getConnectedDataURL(e),n.title=t&&t.text||"ECharts",n},on:function(e,t){return this._messageCenterOutSide.bind(e,t,this),this},un:function(e,t){return this._messageCenterOutSide.unbind(e,t),this},connect:function(e){if(!e)return this;this._connected||(this._connected={});if(e instanceof Array)for(var t=0,n=e.length;t=n/3?1:2),o=t.y+Math.sin(i)*r*(r>=n/3?1:2);i=t.angle-Math.PI/2,e.moveTo(s,o),e.lineTo(t.x+Math.cos(i)*r,t.y-Math.sin(i)*r),e.lineTo(t.x+Math.cos(t.angle)*n,t.y-Math.sin(t.angle)*n),e.lineTo(t.x-Math.cos(i)*r,t.y+Math.sin(i)*r),e.lineTo(s,o);return},getRect:function(e){if(e.__rect)return e.__rect;var t=e.width*2,n=e.x,r=e.y,i=n+Math.cos(e.angle)*e.r,s=r-Math.sin(e.angle)*e.r;return e.__rect={x:Math.min(n,i)-t,y:Math.min(r,s)-t,width:Math.abs(n-i)+t,height:Math.abs(r-s)+t},e.__rect},isCover:e("./normalIsCover")},n.inherits(r,t),r}),define("echarts/chart/gauge",["require","../component/base","./base","../util/shape/GaugePointer","zrender/shape/Text","zrender/shape/Line","zrender/shape/Rectangle","zrender/shape/Circle","zrender/shape/Sector","../config","../util/ecData","../util/accMath","zrender/tool/util","../chart"],function(e){function p(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this),this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("../util/shape/GaugePointer"),i=e("zrender/shape/Text"),s=e("zrender/shape/Line"),o=e("zrender/shape/Rectangle"),u=e("zrender/shape/Circle"),a=e("zrender/shape/Sector"),f=e("../config"),l=e("../util/ecData"),c=e("../util/accMath"),h=e("zrender/tool/util");return p.prototype={type:f.CHART_TYPE_GAUGE,_buildShape:function(){var e=this.series;this._paramsMap={};for(var t=0,n=e.length;t=110&&v<=250?"left":v<=70||v>=290?"right":"center",textBaseline:v>=10&&v<=170?"top":v>=190&&v<=350?"bottom":"middle",textFont:u,shadowColor:o.shadowColor,shadowBlur:o.shadowBlur,shadowOffsetX:o.shadowOffsetX,shadowOffsetY:o.shadowOffsetY}}))},_buildPointer:function(e){var t=this.series[e];if(!t.pointer.show)return;var n=t.max-t.min,i=t.pointer,s=this._paramsMap[e],o=this.parsePercent(i.length,s.radius[1]),a=this.parsePercent(i.width,s.radius[1]),f=s.center,c=this._getValue(e);c=c2?2:a/2,color:"#fff"}});l.pack(d,this.series[e],e,this.series[e].data[0],0,this.series[e].data[0].name,c),this.shapeList.push(d),this.shapeList.push(new u({zlevel:this._zlevelBase+2,hoverable:!1,style:{x:f[0],y:f[1],r:i.width/2.5,color:"#fff"}}))},_buildTitle:function(e){var t=this.series[e];if(!t.title.show)return;var n=t.data[0],r=typeof n.name!="undefined"?n.name:"";if(r!==""){var s=t.title,o=s.offsetCenter,u=s.textStyle,a=u.color,f=this._paramsMap[e],l=f.center[0]+this.parsePercent(o[0],f.radius[1]),c=f.center[1]+this.parsePercent(o[1],f.radius[1]);this.shapeList.push(new i({zlevel:this._zlevelBase+(Math.abs(l-f.center[0])+Math.abs(c-f.center[1]))=t)return n[r][1];return n[n.length-1][1]},_getSector:function(e,t,n,r,i,s,o){return new a({zlevel:this._zlevelBase,hoverable:!1,style:{x:e[0],y:e[1],r0:t,r:n,startAngle:r,endAngle:i,brushType:"fill",color:s,shadowColor:o.shadowColor,shadowBlur:o.shadowBlur,shadowOffsetX:o.shadowOffsetX,shadowOffsetY:o.shadowOffsetY}})},_getLabelText:function(e,t){if(e){if(typeof e=="function")return e.call(this.myChart,t);if(typeof e=="string")return e.replace("{value}",t)}return t},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()}},h.inherits(p,n),h.inherits(p,t),e("../chart").define("gauge",p),p}),define("echarts/chart/funnel",["require","../component/base","./base","zrender/shape/Text","zrender/shape/Line","zrender/shape/Polygon","../config","../util/ecData","../util/number","zrender/tool/util","zrender/tool/color","zrender/tool/area","../chart"],function(e){function h(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this),this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("zrender/shape/Text"),i=e("zrender/shape/Line"),s=e("zrender/shape/Polygon"),o=e("../config"),u=e("../util/ecData"),a=e("../util/number"),f=e("zrender/tool/util"),l=e("zrender/tool/color"),c=e("zrender/tool/area");return h.prototype={type:o.CHART_TYPE_FUNNEL,_buildShape:function(){var e=this.series,t=this.component.legend;this._paramsMap={},this._selected={},this.selectedMap={};var n;for(var r=0,i=e.length;r1?(i.height-(o-1)*h)/o:i.height,d,v=i.y,m=n.sort=="descending"?this._getItemWidth(e,u[0].value):a.parsePercent(n.minSize,i.width),g=n.sort=="descending"?1:0,y=i.centerX,b=[[y-m/2-(m===0?0:10),v-(m===0?10:5)],[y+m/2+(m===0?0:10),v-(m===0?10:5)]];for(var f=0,l=u.length;fc.getTextWidth(w,E)?T="#fff":T=l.reverse(n)):g.position=="left"?(S="right",x=b=="auto"?d.x-10:d.centerX-Math.max(o,u)/2-b):(S="left",x=b=="auto"?d.x+d.width+10:d.centerX+Math.max(o,u)/2+b);var N={zlevel:this._zlevelBase+1,style:{x:x,y:s+a/2,color:y.color||T,text:w,textAlign:y.align||S,textBaseline:y.baseline||"middle",textFont:E}};return m="emphasis",g=v[m].label||g,y=g.textStyle||y,b=v[m].labelLine.length||b,g.position=g.position||v.normal.label.position,w=this.getLabelText(e,t,m),E=this.getFont(y),T=n,g.position=="inner"||g.position=="inside"?(S="center",x=i+o/2,Math.max(o,u)/2>c.getTextWidth(w,E)?T="#fff":T=l.reverse(n)):g.position=="left"?(S="right",x=b=="auto"?d.x-10:d.centerX-Math.max(o,u)/2-b):(S="left",x=b=="auto"?d.x+d.width+10:d.centerX+Math.max(o,u)/2+b),N.highlightStyle={x:x,color:y.color||T,text:w,textAlign:y.align||S,textFont:E,brushType:"fill"},new r(N)},getLabelText:function(e,t,n){var r=this.series,i=r[e],s=i.data[t],o=this.deepQuery([s,i],"itemStyle."+n+".label.formatter");if(!o)return s.name;if(typeof o=="function")return o.call(this.myChart,i.name,s.name,s.value);if(typeof o=="string")return o=o.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}"),o=o.replace("{a0}",i.name).replace("{b0}",s.name).replace("{c0}",s.value),o},getLabelLine:function(e,t,n,r,s,o,u,a){var l=this.series[e],c=l.data[t],h=this._paramsMap[e].location,p=f.merge(f.clone(c.itemStyle)||{},l.itemStyle),d="normal",v=p[d].labelLine,m=p[d].labelLine.length,g=v.lineStyle||{},y=p[d].label;y.position=y.position||p.normal.label.position;var b;y.position=="inner"||y.position=="inside"?b=r+o/2:y.position=="left"?b=m=="auto"?h.x-10:h.centerX-Math.max(o,u)/2-m:b=m=="auto"?h.x+h.width+10:h.centerX+Math.max(o,u)/2+m;var w={zlevel:this._zlevelBase+1,hoverable:!1,style:{xStart:h.centerX,yStart:s+a/2,xEnd:b,yEnd:s+a/2,strokeColor:g.color||n,lineType:g.type,lineWidth:g.width}};return d="emphasis",v=p[d].labelLine||v,m=p[d].labelLine.length||m,g=v.lineStyle||g,y=p[d].label||y,y.position=y.position,y.position=="inner"||y.position=="inside"?b=r+o/2:y.position=="left"?b=m=="auto"?h.x-10:h.centerX-Math.max(o,u)/2-m:b=m=="auto"?h.x+h.width+10:h.centerX+Math.max(o,u)/2+m,w.highlightStyle={xEnd:b,strokeColor:g.color||n,lineType:g.type,lineWidth:g.width},new i(w)},_needLabel:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".label.show")},_needLabelLine:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".labelLine.show")},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()}},f.inherits(h,n),f.inherits(h,t),e("../chart").define("funnel",h),h}),define("echarts/component/categoryAxis",["require","./base","zrender/shape/Text","zrender/shape/Line","zrender/shape/Rectangle","../config","zrender/tool/util","zrender/tool/area","../component"],function(e){function a(e,n,r,i,s,o){if(i.data.length<1){console.error("option.data.length < 1.");return}t.call(this,e,n,r,i,s),this.grid=this.component.grid;for(var u in o)this[u]=o[u];this.refresh(i)}var t=e("./base"),n=e("zrender/shape/Text"),r=e("zrender/shape/Line"),i=e("zrender/shape/Rectangle"),s=e("../config"),o=e("zrender/tool/util"),u=e("zrender/tool/area");return a.prototype={type:s.COMPONENT_TYPE_AXIS_CATEGORY,_getReformedLabel:function(e){var t=typeof this.option.data[e].value!="undefined"?this.option.data[e].value:this.option.data[e],n=this.option.data[e].formatter||this.option.axisLabel.formatter;return n&&(typeof n=="function"?t=n.call(this.myChart,t):typeof n=="string"&&(t=n.replace("{value}",t))),t},_getInterval:function(){var e=this.option.axisLabel.interval;if(e=="auto"){var t=this.option.axisLabel.textStyle.fontSize,n=this.option.data,r=this.option.data.length;if(this.isHorizontal())if(r>3){var i=this.getGap(),s=!1,a,f,l=Math.floor(.5/i);l=l<1?1:l,e=Math.floor(15/i);while(!s&&e=0;c-=e){if(this.option.axisLabel.rotate!==0)f=t;else if(n[c].textStyle)f=u.getTextWidth(this._getReformedLabel(c),this.getFont(o.merge(n[c].textStyle,this.option.axisLabel.textStyle)));else{var h=this._getReformedLabel(c)+"",p=(h.match(/\w/g)||"").length,d=h.length-p;f=p*t*2/3+d*t}if(a3){var i=this.getGap();e=Math.floor(11/i);while(i*e-60?-u:0;if(this.isHorizontal()){var c=this.option.position=="bottom"?n.inside?this.grid.getYend()-i-1:this.grid.getYend()+1:n.inside?this.grid.getY()+1:this.grid.getY()-i-1,h;for(var p=l;p=0?f:0),o),e={_axisShape:"axisTick",zlevel:this._zlevelBase,hoverable:!1,style:{xStart:h,yStart:c,xEnd:h,yEnd:c+i,strokeColor:s,lineWidth:o}},this.shapeList.push(new r(e))}else{var d=this.option.position=="left"?n.inside?this.grid.getX()+1:this.grid.getX()-i-1:n.inside?this.grid.getXend()-i-1:this.grid.getXend()+1,v;for(var p=l;p=0?f:0),o),e={_axisShape:"axisTick",zlevel:this._zlevelBase,hoverable:!1,style:{xStart:d,yStart:v,xEnd:d+i,yEnd:v,strokeColor:s,lineWidth:o}},this.shapeList.push(new r(e))}},_buildAxisLabel:function(){var e,t=this.option.data,r=this.option.data.length,i=this.option.axisLabel.rotate,s=this.option.axisLabel.margin,u=this.option.axisLabel.clickable,a=this.option.axisLabel.textStyle,f;if(this.isHorizontal()){var l,c;this.option.position=="bottom"?(l=this.grid.getYend()+s,c="top"):(l=this.grid.getY()-s,c="bottom");for(var h=0;h0?this.option.position=="bottom"?"right":"left":this.option.position=="bottom"?"left":"right",e.rotation=[i*Math.PI/180,e.style.x,e.style.y]),this.shapeList.push(new n(this._axisLabelClickable(u,e)))}}else{var p,d;this.option.position=="left"?(p=this.grid.getX()-s,d="right"):(p=this.grid.getXend()+s,d="left");for(var h=0;h1?e-1:1)},getCoord:function(e){var t=this.option.data,n=t.length,r=this.getGap(),i=this.option.boundaryGap?r/2:0;for(var s=0;sthis.option.data.length-1)return this.isHorizontal()?this.grid.getXend():this.grid.getY();var t=this.getGap(),n=this.option.boundaryGap?t/2:0;return n+=e*t,this.isHorizontal()?n=this.grid.getX()+n:n=this.grid.getYend()-n,n},getNameByIndex:function(e){var t=this.option.data[e];return typeof t!="undefined"&&typeof t.value!="undefined"?t.value:t},getIndexByName:function(e){var t=this.option.data,n=t.length;for(var r=0;r0?this.option.position=="bottom"?"right":"left":this.option.position=="bottom"?"left":"right",e.rotation=[i*Math.PI/180,e.style.x,e.style.y]),this.shapeList.push(new n(this._axisLabelClickable(o,e)))}else{var c,h;this.option.position=="left"?(c=this.grid.getX()-s,h="right"):(c=this.grid.getXend()+s,h="left");for(var l=0;l=0?typeof t[h][l]!="undefined"?t[h][l]+=n:t[h][l]=n:typeof t[p][l]!="undefined"?t[p][l]+=n:t[p][l]=n,this.option.scale&&t[f].push(n)}}}for(var u in t){e=t[u];for(var l=0,c=e.length;l0?this.option.power:1:this._max>0?this._min=this._max/this.option.splitNumber:this._max=this._max/this.option.splitNumber),this._reformValue(this.option.scale)}else this._hasData=!0,this._min=this.option.min-0,this._max=this.option.max-0,this._customerValue()},_reformValue:function(e){var t=this.option.splitNumber,n=this.option.precision,r,i;n===0?i=this.option.power>1?this.option.power:1:(i=Math.pow(10,n),this._min*=i,this._max*=i,i=this.option.power);var s;if(this._min>=0&&this._max>=0){if(!e){while(this._max/i1?i/10:1,s=this._max-this._min,r=Math.ceil(s/t/i)*i,this._max=this._min+r*t}else if(this._min<=0&&this._max<=0){i=-i;if(!e){while(this._min/ii&&i!=-1)i/=10;n===0&&(this._min=Math.ceil(this._min/i)*i,this._max=Math.floor(this._max/i)*i)}i=i<-1?i/10:-1,s=this._min-this._max,r=-Math.ceil(s/t/i)*i,this._min=-r*t+this._max}else{s=this._max-this._min;while(s/ithis._max?this._max:e;var t;return this.isHorizontal()?t=this.grid.getX()+(e-this._min)/(this._max-this._min)*this.grid.getWidth():t=this.grid.getYend()-(e-this._min)/(this._max-this._min)*this.grid.getHeight(),t},getCoordSize:function(e){return this.isHorizontal()?Math.abs(e/(this._max-this._min)*this.grid.getWidth()):Math.abs(e/(this._max-this._min)*this.grid.getHeight())},getValueFromCoord:function(e){var t;return this.isHorizontal()?(e=ethis.grid.getXend()?this.grid.getXend():e,t=this._min+(e-this.grid.getX())/this.grid.getWidth()*(this._max-this._min)):(e=ethis.grid.getYend()?this.grid.getYend():e,t=this._max-(e-this.grid.getY())/this.grid.getHeight()*(this._max-this._min)),t.toFixed(2)-0}},o.inherits(u,t),e("../component").define("valueAxis",u),u}),define("echarts/component/axis",["require","./base","zrender/shape/Line","../config","../util/ecData","zrender/tool/util","zrender/tool/color","./categoryAxis","./valueAxis","../component"],function(e){function u(e,n,r,i,s,o){t.call(this,e,n,r,i,s),this.axisType=o,this._axisList=[],this.refresh(i)}var t=e("./base"),n=e("zrender/shape/Line"),r=e("../config"),i=e("../util/ecData"),s=e("zrender/tool/util"),o=e("zrender/tool/color");return u.prototype={type:r.COMPONENT_TYPE_AXIS,axisBase:{_buildAxisLine:function(){var e=this.option.axisLine.lineStyle.width,t=e/2,r={_axisShape:"axisLine",zlevel:this._zlevelBase+1,hoverable:!1};switch(this.option.position){case"left":r.style={xStart:this.grid.getX()-t,yStart:this.grid.getYend(),xEnd:this.grid.getX()-t,yEnd:this.grid.getY(),lineCap:"round"};break;case"right":r.style={xStart:this.grid.getXend()+t,yStart:this.grid.getYend(),xEnd:this.grid.getXend()+t,yEnd:this.grid.getY(),lineCap:"round"};break;case"bottom":r.style={xStart:this.grid.getX(),yStart:this.grid.getYend()+t,xEnd:this.grid.getXend(),yEnd:this.grid.getYend()+t,lineCap:"round"};break;case"top":r.style={xStart:this.grid.getX(),yStart:this.grid.getY()-t,xEnd:this.grid.getXend(),yEnd:this.grid.getY()-t,lineCap:"round"}}this.option.name!==""&&(r.style.text=this.option.name,r.style.textPosition=this.option.nameLocation,r.style.textFont=this.getFont(this.option.nameTextStyle),this.option.nameTextStyle.align&&(r.style.textAlign=this.option.nameTextStyle.align),this.option.nameTextStyle.baseline&&(r.style.textBaseline=this.option.nameTextStyle.baseline),this.option.nameTextStyle.color&&(r.style.textColor=this.option.nameTextStyle.color)),r.style.strokeColor=this.option.axisLine.lineStyle.color,r.style.lineWidth=e,this.isHorizontal()?r.style.yStart=r.style.yEnd=this.subPixelOptimize(r.style.yEnd,e):r.style.xStart=r.style.xEnd=this.subPixelOptimize(r.style.xEnd,e),r.style.lineType=this.option.axisLine.lineStyle.type,r=new n(r),this.shapeList.push(r)},_axisLabelClickable:function(e,t){return e?(i.pack(t,undefined,-1,undefined,-1,t.style.text),t.hoverable=!0,t.clickable=!0,t.highlightStyle={color:o.lift(t.style.color,1),brushType:"fill"},t):t},refixAxisShape:function(e,t){if(!this.option.axisLine.onZero)return;var n;if(this.isHorizontal()&&typeof t!="undefined")for(var r=0,i=this.shapeList.length;r2&&(e=[e[0],e[1]]);if(this.axisType=="xAxis"){if(!e[0].position||e[0].position!="bottom"&&e[0].position!="top")e[0].position="bottom";e.length>1&&(e[1].position=e[0].position=="bottom"?"top":"bottom");for(var t=0,n=e.length;t1&&(e[1].position=e[0].position=="left"?"right":"left");for(var t=0,n=e.length;t=0&&(o.isHorizontal()?t=o.getCoord(0):n=o.getCoord(0));if(typeof t!="undefined"||typeof n!="undefined"){s=i.length;while(s--)i[s].refixAxisShape(t,n)}},refresh:function(e){if(e||this._zrWidth!=this.zr.getWidth()||this._zrHeight!=this.zr.getHeight()){this.clear(),this.option=e||this.option,this.option.grid=this.reformOption(this.option.grid);var t=this.option.grid;this._zrWidth=this.zr.getWidth(),this._zrHeight=this.zr.getHeight(),this._x=this.parsePercent(t.x,this._zrWidth),this._y=this.parsePercent(t.y,this._zrHeight);var r=this.parsePercent(t.x2,this._zrWidth),i=this.parsePercent(t.y2,this._zrHeight);typeof t.width=="undefined"?this._width=this._zrWidth-this._x-r:this._width=this.parsePercent(t.width,this._zrWidth),typeof t.height=="undefined"?this._height=this._zrHeight-this._y-i:this._height=this.parsePercent(t.height,this._zrHeight),this._x=this.subPixelOptimize(this._x,t.borderWidth),this._y=this.subPixelOptimize(this._y,t.borderWidth),this.shapeList.push(new n({zlevel:this._zlevelBase,hoverable:!1,style:{x:this._x,y:this._y,width:this._width,height:this._height,brushType:t.borderWidth>0?"both":"fill",color:t.backgroundColor,strokeColor:t.borderColor,lineWidth:t.borderWidth}})),this.zr.addShape(this.shapeList[0])}}},i.inherits(s,t),e("../component").define("grid",s),s}),define("echarts/component/dataZoom",["require","./base","zrender/shape/Rectangle","zrender/shape/Polygon","../util/shape/Icon","../config","zrender/tool/util","../component","../component"],function(e){function u(e,n,r,i,s){t.call(this,e,n,r,i,s);var o=this;o._ondrift=function(e,t){return o.__ondrift(this,e,t)},o._ondragend=function(){return o.__ondragend()},this._fillerSize=28,this._handleSize=8,this._isSilence=!1,this._zoom={},this.option.dataZoom=this.reformOption(this.option.dataZoom),this.zoomOption=this.option.dataZoom,this._location=this._getLocation(),this._zoom=this._getZoom(),this._backupData(),this.option.dataZoom.show&&this._buildShape(),this._syncData()}var t=e("./base"),n=e("zrender/shape/Rectangle"),r=e("zrender/shape/Polygon"),i=e("../util/shape/Icon"),s=e("../config"),o=e("zrender/tool/util");return u.prototype={type:s.COMPONENT_TYPE_DATAZOOM,_buildShape:function(){this._buildBackground(),this._buildFiller(),this._buildHandle(),this._buildFrame();for(var e=0,t=this.shapeList.length;ep&&(h+=p,p=h-p,h-=p);var d=Math.round((p-h)/100*(this.zoomOption.orient=="horizontal"?this._location.width:this._location.height));return{start:h,end:p,start2:0,end2:100,size:d,xAxisIndex:i,yAxisIndex:o,seriesIndex:r,scatterMap:this._zoom.scatterMap||{}}},_backupData:function(){this._originalData={xAxis:{},yAxis:{},series:{}};var e=this.option.xAxis,t=this._zoom.xAxisIndex;for(var n=0,r=t.length;n1?1:0)),w=t/(i-(i>1?1:0)),E=1;this.zoomOption.orient=="horizontal"&&b<1?E=Math.floor(i*3/e):this.zoomOption.orient=="vertical"&&w<1&&(E=Math.floor(i*3/t));for(var a=0,f=i;athis._location.x?1:0),height:this._location.height-(t>this._location.y?1:0),lineWidth:1,brushType:"stroke",strokeColor:this.zoomOption.handleColor}},this._endFrameShape=o.clone(this._startFrameShape),this._startFrameShape=new n(this._startFrameShape),this._endFrameShape=new n(this._endFrameShape),this.shapeList.push(this._startFrameShape),this.shapeList.push(this._endFrameShape);return},_syncHandleShape:function(){this.zoomOption.orient=="horizontal"?(this._startShape.style.x=this._fillerShae.style.x-this._handleSize,this._endShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._zoom.start=Math.floor((this._startShape.style.x-this._location.x)/this._location.width*100),this._zoom.end=Math.ceil((this._endShape.style.x+this._handleSize-this._location.x)/this._location.width*100)):(this._startShape.style.y=this._fillerShae.style.y-this._handleSize,this._endShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._zoom.start=Math.floor((this._startShape.style.y-this._location.y)/this._location.height*100),this._zoom.end=Math.ceil((this._endShape.style.y+this._handleSize-this._location.y)/this._location.height*100)),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this._syncFrameShape(),this.zr.refresh()},_syncFillerShape:function(){var e,t;this.zoomOption.orient=="horizontal"?(e=this._startShape.style.x,t=this._endShape.style.x,this._fillerShae.style.x=Math.min(e,t)+this._handleSize,this._fillerShae.style.width=Math.abs(e-t)-this._handleSize,this._zoom.start=Math.floor((Math.min(e,t)-this._location.x)/this._location.width*100),this._zoom.end=Math.ceil((Math.max(e,t)+this._handleSize-this._location.x)/this._location.width*100)):(e=this._startShape.style.y,t=this._endShape.style.y,this._fillerShae.style.y=Math.min(e,t)+this._handleSize,this._fillerShae.style.height=Math.abs(e-t)-this._handleSize,this._zoom.start=Math.floor((Math.min(e,t)-this._location.y)/this._location.height*100),this._zoom.end=Math.ceil((Math.max(e,t)+this._handleSize-this._location.y)/this._location.height*100)),this.zr.modShape(this._fillerShae.id),this._syncFrameShape(),this.zr.refresh()},_syncFrameShape:function(){this.zoomOption.orient=="horizontal"?(this._startFrameShape.style.width=this._fillerShae.style.x-this._location.x,this._endFrameShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._endFrameShape.style.width=this._location.x+this._location.width-this._endFrameShape.style.x):(this._startFrameShape.style.height=this._fillerShae.style.y-this._location.y,this._endFrameShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._endFrameShape.style.height=this._location.y+this._location.height-this._endFrameShape.style.y),this.zr.modShape(this._startFrameShape.id),this.zr.modShape(this._endFrameShape.id)},_syncShape:function(){if(!this.zoomOption.show)return;this.zoomOption.orient=="horizontal"?(this._startShape.style.x=this._location.x+this._zoom.start/100*this._location.width,this._endShape.style.x=this._location.x+this._zoom.end/100*this._location.width-this._handleSize,this._fillerShae.style.x=this._startShape.style.x+this._handleSize,this._fillerShae.style.width=this._endShape.style.x-this._startShape.style.x-this._handleSize):(this._startShape.style.y=this._location.y+this._zoom.start/100*this._location.height,this._endShape.style.y=this._location.y+this._zoom.end/100*this._location.height-this._handleSize,this._fillerShae.style.y=this._startShape.style.y+this._handleSize,this._fillerShae.style.height=this._endShape.style.y-this._startShape.style.y-this._handleSize),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this.zr.modShape(this._fillerShae.id),this._syncFrameShape(),this.zr.refresh()},_syncData:function(e){var t,n,r,i,o;for(var u in this._originalData){t=this._originalData[u];for(var a in t){o=t[a];if(typeof o=="undefined")continue;i=o.length,n=Math.floor(this._zoom.start/100*i),r=Math.ceil(this._zoom.end/100*i),this.option[u][a].type!=s.CHART_TYPE_SCATTER?this.option[u][a].data=o.slice(n,r):this.option[u][a].data=this._synScatterData(a,o)}}!this._isSilence&&(this.zoomOption.realtime||e)&&this.messageCenter.dispatch(s.EVENT.DATA_ZOOM,null,{zoom:this._zoom},this.myChart)},_synScatterData:function(e,t){if(this._zoom.start===0&&this._zoom.end==100&&this._zoom.start2===0&&this._zoom.end2==100)return t;var n=[],r=this._zoom.scatterMap[e],i,s,o,u,a;this.zoomOption.orient=="horizontal"?(i=r.x.max-r.x.min,s=this._zoom.start/100*i+r.x.min,o=this._zoom.end/100*i+r.x.min,i=r.y.max-r.y.min,u=this._zoom.start2/100*i+r.y.min,a=this._zoom.end2/100*i+r.y.min):(i=r.x.max-r.x.min,s=this._zoom.start2/100*i+r.x.min,o=this._zoom.end2/100*i+r.x.min,i=r.y.max-r.y.min,u=this._zoom.start/100*i+r.y.min,a=this._zoom.end/100*i+r.y.min);var f;for(var l=0,c=t.length;l=s&&f[0]<=o&&f[1]>=u&&f[1]<=a&&n.push(t[l]);return n},__ondrift:function(e,t,n){this.zoomOption.zoomLock&&(e=this._fillerShae);var r=e._type=="filler"?this._handleSize:0;return this.zoomOption.orient=="horizontal"?e.style.x+t-r<=this._location.x?e.style.x=this._location.x+r:e.style.x+t+e.style.width+r>=this._location.x+this._location.width?e.style.x=this._location.x+this._location.width-e.style.width-r:e.style.x+=t:e.style.y+n-r<=this._location.y?e.style.y=this._location.y+r:e.style.y+n+e.style.height+r>=this._location.y+this._location.height?e.style.y=this._location.y+this._location.height-e.style.height-r:e.style.y+=n,e._type=="filler"?this._syncHandleShape():this._syncFillerShape(),this.zoomOption.realtime&&this._syncData(),!0},__ondragend:function(){this.isDragend=!0},ondragend:function(e,t){if(!this.isDragend||!e.target)return;!this.zoomOption.realtime&&this._syncData(),t.dragOut=!0,t.dragIn=!0,!this._isSilence&&!this.zoomOption.realtime&&this.messageCenter.dispatch(s.EVENT.DATA_ZOOM,null,{zoom:this._zoom},this.myChart),t.needRefresh=!1,this.isDragend=!1;return},ondataZoom:function(e,t){t.needRefresh=!0;return},absoluteZoom:function(e){this._zoom.start=e.start,this._zoom.end=e.end,this._zoom.start2=e.start2,this._zoom.end2=e.end2,this._syncShape(),this._syncData(!0);return},rectZoom:function(e){if(!e)return this._zoom.start=this._zoom.start2=0,this._zoom.end=this._zoom.end2=100,this._syncShape(),this._syncData(!0),this._zoom;var t=this.component.grid.getArea(),n={x:e.x,y:e.y,width:e.width,height:e.height};n.width<0&&(n.x+=n.width,n.width=-n.width),n.height<0&&(n.y+=n.height,n.height=-n.height);if(n.x>t.x+t.width||n.y>t.y+t.height)return!1;n.xt.x+t.width&&(n.width=t.x+t.width-n.x),n.y+n.height>t.y+t.height&&(n.height=t.y+t.height-n.y);var r,i=(n.x-t.x)/t.width,s=1-(n.x+n.width-t.x)/t.width,o=1-(n.y+n.height-t.y)/t.height,u=(n.y-t.y)/t.height;return this.zoomOption.orient=="horizontal"?(r=this._zoom.end-this._zoom.start,this._zoom.start+=r*i,this._zoom.end-=r*s,r=this._zoom.end2-this._zoom.start2,this._zoom.start2+=r*o,this._zoom.end2-=r*u):(r=this._zoom.end-this._zoom.start,this._zoom.start+=r*o,this._zoom.end-=r*u,r=this._zoom.end2-this._zoom.start2,this._zoom.start2+=r*i,this._zoom.end2-=r*s),this._syncShape(),this._syncData(!0),this._zoom},syncBackupData:function(e){var t,n=this._originalData.series,r=e.series,i;for(var s=0,o=r.length;s=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height?!0:!1}},r.inherits(i,t),i}),define("echarts/component/dataRange",["require","./base","zrender/shape/Text","zrender/shape/Rectangle","../util/shape/HandlePolygon","../config","zrender/tool/util","zrender/tool/area","zrender/tool/color","zrender/tool/color","../component"],function(e){function f(e,n,r,i,s){if(typeof this.query(i,"dataRange.min")=="undefined"||typeof this.query(i,"dataRange.max")=="undefined"){console.error("option.dataRange.min or option.dataRange.max has not been defined.");return}t.call(this,e,n,r,i,s);var o=this;o._ondrift=function(e,t){return o.__ondrift(this,e,t)},o._ondragend=function(){return o.__ondragend()},o._dataRangeSelected=function(e){return o.__dataRangeSelected(e)},this._selectedMap={},this._range={},this.refresh(i)}var t=e("./base"),n=e("zrender/shape/Text"),r=e("zrender/shape/Rectangle"),i=e("../util/shape/HandlePolygon"),s=e("../config"),o=e("zrender/tool/util"),u=e("zrender/tool/area"),a=e("zrender/tool/color");return f.prototype={type:s.COMPONENT_TYPE_DATARANGE,_textGap:10,_buildShape:function(){this._itemGroupLocation=this._getItemGroupLocation(),this._buildBackground(),this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable?this._buildGradient():this._buildItem();for(var e=0,t=this.shapeList.length;ep&&(h-=m)):(dv&&(d-=f))}return{x:h,y:d,width:s,height:o}},_getTextShape:function(e,t,n){return{zlevel:this._zlevelBase,style:{x:this.dataRangeOption.orient=="horizontal"?e:this._itemGroupLocation.x+this._itemGroupLocation.width/2,y:this.dataRangeOption.orient=="horizontal"?this._itemGroupLocation.y+this._itemGroupLocation.height/2:t,color:this.dataRangeOption.textStyle.color,text:n,textFont:this.getFont(this.dataRangeOption.textStyle),textBaseline:this.dataRangeOption.orient=="horizontal"?"middle":"top",textAlign:this.dataRangeOption.orient=="horizontal"?"left":"center"},hoverable:!1}},_getItemShape:function(e,t,n,r,i){return{zlevel:this._zlevelBase,style:{x:e,y:t+1,width:n,height:r-2,color:i},highlightStyle:{strokeColor:i,lineWidth:1},clickable:!0}},__ondrift:function(e,t,n){var r=this._calculableLocation.x,i=this._calculableLocation.y,s=this._calculableLocation.width,o=this._calculableLocation.height;return this.dataRangeOption.orient=="horizontal"?e.style.x+t<=r?e.style.x=r:e.style.x+t+e.style.width>=r+s?e.style.x=r+s-e.style.width:e.style.x+=t:e.style.y+n<=i?e.style.y=i:e.style.y+n+e.style.height>=i+o?e.style.y=i+o-e.style.height:e.style.y+=n,e._type=="filler"?this._syncHandleShape():this._syncFillerShape(e),this.dataRangeOption.realtime&&this._syncData(),!0},__ondragend:function(){this.isDragend=!0},ondragend:function(e,t){if(!this.isDragend||!e.target)return;!this.dataRangeOption.realtime&&this._syncData(),t.dragOut=!0,t.dragIn=!0,!this.dataRangeOption.realtime&&!1&&this.messageCenter.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:this._range.end,end:this._range.start}},this.myChart),t.needRefresh=!1,this.isDragend=!1;return},_syncShapeFromRange:function(){var e=this.dataRangeOption.range||{};this._range.end=typeof this._range.end!="undefined"?this._range.end:typeof e.start!="undefined"?e.start:0,this._range.start=typeof this._range.start!="undefined"?this._range.start:typeof e.end!="undefined"?e.end:100;if(this._range.start!=100||this._range.end!==0){if(this.dataRangeOption.orient=="horizontal"){var t=this._fillerShae.style.width;this._fillerShae.style.x+=t*(100-this._range.start)/100,this._fillerShae.style.width=t*(this._range.start-this._range.end)/100}else{var n=this._fillerShae.style.height;this._fillerShae.style.y+=n*(100-this._range.start)/100,this._fillerShae.style.height=n*(this._range.start-this._range.end)/100}this.zr.modShape(this._fillerShae.id),this._syncHandleShape()}},_syncHandleShape:function(){var e=this._calculableLocation.x,t=this._calculableLocation.y,n=this._calculableLocation.width,r=this._calculableLocation.height;this.dataRangeOption.orient=="horizontal"?(this._startShape.style.x=this._fillerShae.style.x,this._startMask.style.width=this._startShape.style.x-e,this._endShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._endMask.style.x=this._endShape.style.x,this._endMask.style.width=e+n-this._endShape.style.x,this._range.start=Math.ceil(100-(this._startShape.style.x-e)/n*100),this._range.end=Math.floor(100-(this._endShape.style.x-e)/n*100)):(this._startShape.style.y=this._fillerShae.style.y,this._startMask.style.height=this._startShape.style.y-t,this._endShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._endMask.style.y=this._endShape.style.y,this._endMask.style.height=t+r-this._endShape.style.y,this._range.start=Math.ceil(100-(this._startShape.style.y-t)/r*100),this._range.end=Math.floor(100-(this._endShape.style.y-t)/r*100)),this._syncShape()},_syncFillerShape:function(e){var t=this._calculableLocation.x,n=this._calculableLocation.y,r=this._calculableLocation.width,i=this._calculableLocation.height,s,o;this.dataRangeOption.orient=="horizontal"?(s=this._startShape.style.x,o=this._endShape.style.x,e.id==this._startShape.id&&s>=o?(o=s,this._endShape.style.x=s):e.id==this._endShape.id&&s>=o&&(s=o,this._startShape.style.x=s),this._fillerShae.style.x=s,this._fillerShae.style.width=o-s,this._startMask.style.width=s-t,this._endMask.style.x=o,this._endMask.style.width=t+r-o,this._range.start=Math.ceil(100-(s-t)/r*100),this._range.end=Math.floor(100-(o-t)/r*100)):(s=this._startShape.style.y,o=this._endShape.style.y,e.id==this._startShape.id&&s>=o?(o=s,this._endShape.style.y=s):e.id==this._endShape.id&&s>=o&&(s=o,this._startShape.style.y=s),this._fillerShae.style.y=s,this._fillerShae.style.height=o-s,this._startMask.style.height=s-n,this._endMask.style.y=o,this._endMask.style.height=n+i-o,this._range.start=Math.ceil(100-(s-n)/i*100),this._range.end=Math.floor(100-(o-n)/i*100)),this._syncShape()},_syncShape:function(){this._startShape.position=[this._startShape.style.x-this._startShape.style._x,this._startShape.style.y-this._startShape.style._y],this._startShape.style.text=this._textFormat(this._gap*this._range.start+this.dataRangeOption.min),this._startShape.style.color=this._startShape.highlightStyle.strokeColor=this.getColor(this._gap*this._range.start+this.dataRangeOption.min),this._endShape.position=[this._endShape.style.x-this._endShape.style._x,this._endShape.style.y-this._endShape.style._y],this._endShape.style.text=this._textFormat(this._gap*this._range.end+this.dataRangeOption.min),this._endShape.style.color=this._endShape.highlightStyle.strokeColor=this.getColor(this._gap*this._range.end+this.dataRangeOption.min),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this.zr.modShape(this._startMask.id),this.zr.modShape(this._endMask.id),this.zr.modShape(this._fillerShae.id),this.zr.refresh()},_syncData:function(){this.dataRangeOption.realtime&&this.messageCenter.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:this._range.end,end:this._range.start}},this.myChart)},__dataRangeSelected:function(e){var t=e.target._idx;this._selectedMap[t]=!this._selectedMap[t],this.messageCenter.dispatch(s.EVENT.REFRESH,null,null,this.myChart)},_textFormat:function(e,t){e=e.toFixed(this.dataRangeOption.precision),t=typeof t!="undefined"?t.toFixed(this.dataRangeOption.precision):"";if(this.dataRangeOption.formatter){if(typeof this.dataRangeOption.formatter=="string")return this.dataRangeOption.formatter.replace("{value}",e).replace("{value2}",t);if(typeof this.dataRangeOption.formatter=="function")return this.dataRangeOption.formatter.call(this.myChart,e,t)}return t!==""?e+" - "+t:e},refresh:function(e){if(e){this.option=e,this.option.dataRange=this.reformOption(this.option.dataRange),this.option.dataRange.padding=this.reformCssArray(this.option.dataRange.padding),this.dataRangeOption=this.option.dataRange;var t=this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable?100:this.dataRangeOption.splitNumber;this._colorList=a.getGradientColors(this.dataRangeOption.color,Math.max((t-this.dataRangeOption.color.length)/(this.dataRangeOption.color.length-1),0)+1);if(this._colorList.length>t){var n=this._colorList.length,r=[this._colorList[0]],i=n/(t-1);for(var s=1;sthis.dataRangeOption.max&&(e=this.dataRangeOption.max);if(this.dataRangeOption.calculable)if(e-(this._gap*this._range.start+this.dataRangeOption.min)>5e-5||e-(this._gap*this._range.end+this.dataRangeOption.min)<-0.00005)return null;var t=this._colorList.length-Math.ceil((e-this.dataRangeOption.min)/(this.dataRangeOption.max-this.dataRangeOption.min)*this._colorList.length);return t==this._colorList.length&&t--,this._selectedMap[t]?this._colorList[t]:null}},o.inherits(f,t),e("../component").define("dataRange",f),f}),define("echarts/chart/scatter",["require","../component/base","./base","../util/shape/Symbol","../component/axis","../component/grid","../component/dataZoom","../component/dataRange","../config","zrender/tool/util","zrender/tool/color","../chart"],function(e){function u(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this),this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("../util/shape/Symbol");e("../component/axis"),e("../component/grid"),e("../component/dataZoom"),e("../component/dataRange");var i=e("../config"),s=e("zrender/tool/util"),o=e("zrender/tool/color");return u.prototype={type:i.CHART_TYPE_SCATTER,_buildShape:function(){var e=this.series;this._sIndex2ColorMap={},this._symbol=this.option.symbolList,this._sIndex2ShapeMap={},this.selectedMap={},this.xMarkMap={};var t=this.component.legend,n=[],r,s,u,a;for(var f=0,l=e.length;fs[0]&&(i.min0=s[0],i.minY0=r[o][1],i.minX0=r[o][0]),i.max0s[1]&&(i.min1=s[1],i.minY1=r[o][1],i.minX1=r[o][0]),i.max1n.largeThreshold){this.shapeList.push(this._getLargeSymbol(r,this.getItemStyleColor(this.query(n,"itemStyle.normal.color"),o,-1)||this._sIndex2ColorMap[o]));continue}for(var u=0,a=r.length;u0&&this._buildSinglePosition(o,t[o]);this.addShapeList()},_buildSinglePosition:function(e,t){var n=this._mapData(t),r=n.locationMap,i=n.maxDataLength;if(i===0||r.length===0)return;this._buildHorizontal(t,i,r);for(var s=0,o=t.length;s0?a="left":Math.round(i[0])<0?a="right":a="center",f.margin?(p=f.margin,c=i[0]>0?p:-p,h=i[1]>0?p:-p,c=i[0]===0?0:c,h=i[1]===0?0:h,i=this._mapVector(i,o,1)):i=this._mapVector(i,o,1.2),u.textAlign=a,u.x=i[0]+c,u.y=i[1]+h,f.rotate?l=[f.rotate/180*Math.PI,i[0],i[1]]:l=[0,0,0],this.shapeList.push(new n({zlevel:this._zlevelBase,style:u,draggable:!1,hoverable:!1,rotation:l}))}},getIndicatorText:function(e,t){return this.polar[e]&&this.polar[e].__ecIndicator[t]&&this.polar[e].__ecIndicator[t].text},getDropBox:function(e){var e=e||0,t=this.polar[e],n=this.getCenter(e),r=t.__ecIndicator,i=r.length,s=[],o,u,a=t.type;if(a=="polygon"){for(var f=0;fu||u===undefined)&&(u=e),(e=1)a=Math.floor(a/l)*l-l;else{if(l===0)return u>0?(d=0,p=2*u):u===0?(d=0,p=100):(p=0,d=2*a),{max:p,min:d};c=(l+"").split(".")[1],h=c.length,a=Math.floor(a*Math.pow(10,h))/Math.pow(10,h)-l}Math.abs(a)<=l&&(a=0),u=a+Math.floor(l*Math.pow(10,h)*(n+1))/Math.pow(10,h)}else a=a>0?0:a;return r&&(u=u>0?u*1.2:u*.8,a=a>0?a*.8:a*1.2),{max:u,min:a}},_getDelta:function(e,t,n,r,i){var s=(e-t)/n,o,u;if(s>1)return i?(s=Math.ceil(s),s%i>0?(Math.ceil(s/i)+1)*i:s):(o=(s+"").split(".")[0],u=o.length,o.charAt(0)>=5?Math.pow(10,u):(o.charAt(0)-0+1)*Math.pow(10,u-1));if(s==1)return 1;if(s===0)return 0;if(!r){o=(s+"").split(".")[1],u=0;while(o[u]=="0")u++;return o[u]>=5?"0."+o.substring(0,u+1)-0+1/Math.pow(10,u):"0."+o.substring(0,u+1)-0+1/Math.pow(10,u+1)}return Math.ceil(s*Math.pow(10,r))/Math.pow(10,r)},getVector:function(e,t,n){e=e||0,t=t||0;var r=this.polar[e].__ecIndicator;if(t>=r.length)return;var i=this.polar[e].__ecIndicator[t],s=this.getCenter(e),o=i.vector,u=i.value.max,a=i.value.min,f;if(typeof n=="undefined")return s;switch(n){case"min":n=a;break;case"max":n=u;break;case"center":n=(u+a)/2}return u!=a?f=(n-a)/(u-a):f=.5,this._mapVector(o,s,f)},isInside:function(e){var t=this.getNearestIndex(e);return t?t.polarIndex:-1},getNearestIndex:function(e){var t,n,r,i,s,o,u,a,l;for(var c=0;ci[0])return{polarIndex:c,valueIndex:Math.floor((l+a/2)/a)%u}}},getIndicator:function(e){var e=e||0;return this.polar[e].indicator},refresh:function(e){e&&(this.option=e,this.polar=this.option.polar,this.series=this.option.series),this.clear(),this._buildShape()}},a.inherits(l,t),e("../component").define("polar",l),l}),define("echarts/chart/radar",["require","../component/base","./base","zrender/shape/Polygon","../component/polar","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../util/accMath","../chart"],function(e){function a(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this),this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("zrender/shape/Polygon");e("../component/polar");var i=e("../config"),s=e("../util/ecData"),o=e("zrender/tool/util"),u=e("zrender/tool/color");return a.prototype={type:i.CHART_TYPE_RADAR,_buildShape:function(){this.selectedMap={},this._symbol=this.option.symbolList,this._queryTarget,this._dropBoxList=[],this._radarDataCounter=0;var e=this.series,t=this.component.legend,n;for(var r=0,s=e.length;r\\/]*>)","gim"),r=new RegExp("\\s+","gim"),i=new RegExp("function.*?\\((.*?)\\)","i"),s=e.toString().replace(n,"").replace(r,"").match(i)[1].split(",");return t!==Object(t)&&(t={}),function(){var n=Array.prototype.slice.call(arguments),r=n[n.length-1];r&&r.constructor===Object?n.pop():r={};for(var i=0;i=0){var n=e.split(/\s*:\s*/),r=parseInt(n[2]||1,10),i,s;if(r===0)throw new Error("Slice step cannot be zero");return r>0?(i=parseInt(n[0]||0,10),s=parseInt(n[1]||t,10)):(i=parseInt(n[0]||t-1,10),s=parseInt(n[1]||-1,10)),i<0&&(i=t+i),s<0&&n[1]&&(s=t+s),r>0?(i=Math.max(Math.min(t,i),0),s=Math.max(Math.min(t,s),0)):(i=Math.max(Math.min(t-1,i),-1),s=Math.max(Math.min(t-1,s),-1)),[i,s,r]}var i=parseInt(e,10);i<0&&(i=t+i);if(i<0||i>t)throw new Error(N(e));return i=Math.max(Math.min(t-1,i),0),[i,i+1,1]}function g(e){var t=e[0];for(var n=1;n=this._shape.length)throw new Error(T(e[r]));if(e.length<=1)return this;var i=n.slice();for(var r=0;r=Math.ceil(e.length/2);s--)i[e[r]]=e[s],i[e[s]]=e[r];return this._transposelike(i,t)}),swapaxes:t(function(e,t,n){return this.transpose([e,t],n)}),rollaxis:t(function(e,t,n){if(e>=this._shape.length)throw new Error(T(e));var r=[];for(var i=0;i=this._shape.length||e<0)throw new Error(T(e));var s=this._shape.slice();s.splice(e,1);if(t&&!S(s,t._shape))throw new Error(x(s,t._shape));t||(t=new v(this._dtype),t.initFromShape(s));var o=t._array,u=w(this._shape,e),a=this._shape[e],f=u*a;return n.call(this,o,i,f,a,u),t}return r.call(this,i)},_withPreprocess2:function(e,t,n,r){var i=this._array;if(!this._size)return;if(t&&!S(this._shape,t._shape))throw new Error(x(this._shape,t._shape));t||(t=new v(this._dtype),t.initFromShape(this._shape));var s=t._array;if(typeof e!="undefined"){e<0&&(e=this._shape.length+e);if(e>=this._shape.length||e<0)throw new Error(T(e));if(e>=this._shape.length)throw new Error(T(e));var o=w(this._shape,e),u=this._shape[e],a=o*u;n.call(this,s,i,a,u,o)}else t.reshape([this._size]),r.call(this,s,i);return t},max:t(function(){function e(e,t,n,r,i){var s=0;for(var o=0;of&&(f=c),a+=i}e[s++]=f}}function t(e){var t=e[0];for(var n=1;nt&&(t=e[n]);return t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}()),min:t(function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h,a=c),f+=i}e[s++]=a}}function t(e){var t=e[0],n=0;for(var r=1;rt&&(n=r,t=e[r]);return n}return function(n,r){return this._withPreprocess1(n,r,e,t)}}()),argmin:t(function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h),a+=i}e[s++]=l-f}}function t(e){var t=e[0],n=e[0];for(var r=1;rn&&(n=e[r]);return n-t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}()),sort:t(function(e,t){e<0&&(e=this._shape.length+e);var n;t==="ascending"?n=function(e,t){return e-t}:t==="descending"&&(n=function(e,t){return t-e});var r=this._array,i=w(this._shape,e),s=this._shape[e],o=i*s,u=new Array(s);for(var a=0;as&&(s=a)}var f=s-i,l=t-e;for(var u=0;u=0&&y>=0){if(e._shape[g]==1)i.unshift(t._shape[y]),b=e.repeat(t._shape[y],g);else if(t._shape[y]==1)i.unshift(e._shape[g]),E=t.repeat(e._shape[g],y);else{if(t._shape[y]!=e._shape[g])throw new Error(x(e._shape,t._shape));i.unshift(e._shape[g])}g--,y--}for(var T=g;T>=0;T--)i.unshift(e._shape[T]);for(var T=y;T>=0;T--)i.unshift(t._shape[T]);e=b,t=E}if(!r)r=new v(this._dtype),r.initFromShape(i);else if(!S(i,r._shape))throw new Error(x(i,r._shape));var N=r._array,C,k,L,A;d?(C=t._shape.length-1,k=!1,L=e,A=t._array):m?(C=e._shape.length-1,k=!0,A=t,L=e._array):(C=Math.abs(e._shape.length-t._shape.length),k=e._shape.length>=t._shape.length,L=e._array,A=t._array);var O=w(i,C),M=i[C],_=O*M,D=r._size/_,P,H,B,j=0;if(k)if(m)for(var F=0;F0)for(var c=r[0];cr[1];c+=r[2])l(e+1,t+s*c);else if(r[2]>0)for(var c=r[0];cr[1];c+=r[2])for(var h=0;hthis._shape.length)throw new Error("Too many indices");var o=i.length,u;s.length?(t=new v(this._dtype),t.initFromShape(s),u=t._array):u=[];var a=this._array,f=0;return l(0,0),s.length?t:u[0]},set:function(e,t){typeof e=="number"&&(e=e.toString());var n=E(this._shape),r=this._parseRanges(e),i=r[0],s=r[1];if(i.length>this._shape.length)throw new Error("Too many indices");var o=typeof t=="number",u=i.length,a=this._array;if(o)var f=t;else{if(!S(s,t.shape()))throw new Error(x(s,t.shape()));var f=t._array}var l=0,c=function(e,t){var r=i[e],s=n[e];if(e0)for(var h=r[0];hr[1];h+=r[2])c(e+1,t+s*h);else if(r[2]>0)for(var h=r[0];hr[1];h+=r[2])for(var p=0;pu)throw new Error(N(e[a]));if(e[a]=0&&h>=0){if(l[c]===1)p=t.repeat(f[h],c);else if(l[c]!==f[h])throw new Error(x(l,f));c--,h--}t=p;var d=w(this._shape,n),u=this._shape[n],m=u*d,y=this._size/m,b=e.length,E=new Uint32Array(y*b),S=0;for(var T=0;T=0){for(var a=_-1;a>=D;a--)i[P--]=A[a];_=D,D=E[--M];for(var a=0;a=0;a--)i[P--]=A[a];return this._array=i,this._shape=k,this._size=L,this}),append:function(){console.warn("TODO")},"delete":t(function(e,t){var n=this._array;typeof e=="number"&&(e=[e]);var r=this._size;typeof t=="undefined"&&(this._shape=[r],t=0);var i=w(this._shape,t),s=this._shape[t],o=i*s,u=0;for(var a=0;as)throw new Error(N(l));if(l=0){var a=Math.floor((u[1]-u[0])/u[2]);a=a<0?0:a,r.push(a)}i++}for(;i0&&(E.style.brushType="both"),E.highlightStyle.lineWidth>0&&(E.highlightStyle.brushType="both"),a.pack(E,this.chordSeries[0],0,t[m],m,g.name);if(u){var S=[b+w]/2;S%=360;var x=S<=90||S>=270;S=S*Math.PI/180;var T=[Math.cos(S),-Math.sin(S)],N=this.showScaleText?35+h:h,C=l.scale([],T,this.outerRadius+N);l.add(C,C,this.center);var k={zlevel:this._zlevelBase-1,hoverable:!1,style:{text:g.name,textAlign:x?"left":"right",color:f}};c?(k.rotation=x?S:Math.PI+S,x?k.style.x=this.outerRadius+N:k.style.x=-this.outerRadius-N,k.style.y=0,k.position=this.center):(k.style.x=C[0],k.style.y=C[1]),k.style.textColor=this.deepQuery([g,this.chordSerieSample],"itemStyle.normal.label.textStyle.color")||"#fff",k.style.textFont=this.getFont(this.deepQuery([g,this.chordSerieSample],"itemStyle.normal.label.textStyle")),k=new r(k),this.shapeList.push(k)}E.onmouseover=d(m),E.onmouseout=v(),E=new s(E),this.shapeList.push(E),this.sectorShapes.push(E)}},_buildChords:function(e,t){var n=e.length;if(!n)return;var r=e[0][0].length,i=this.chordSerieSample.itemStyle.normal.chordStyle.lineStyle,s=this.chordSerieSample.itemStyle.emphasis.chordStyle.lineStyle;for(var u=0;u=270,E={zlevel:this._zlevelBase-1,hoverable:!1,style:{x:w?this.outerRadius+this.scaleLineLength+4:-this.outerRadius-this.scaleLineLength-4,y:0,text:Math.round(b.shift()*10)/10+t,textAlign:w?"left":"right"},position:this.center.slice(),rotation:w?[h/180*Math.PI,0,0]:[(h+180)/180*Math.PI,0,0]};E=new r(E),this.shapeList.push(E),g+=this.scaleUnitAngle*5}}},normalizeValue:function(e){var t=[],n=(new c(e)).max(),r,i;n>1e4?(r="k",i=.001):n>1e7?(r="m",i=1e-6):n>1e10?(r="b",i=1e-9):(r="",i=1);for(var s=0;s0&&(i=1/Math.sqrt(i),e[0]=t[0]*i,e[1]=t[1]*i),e},negate:function(e,t){return e[0]=-t[0],e[1]=-t[1],e},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e},set:function(e,t,n){return e[0]=t,e[1]=n,e}}:n=t("zrender/tool/vector");var i=typeof Float32Array=="undefined"?Array:Float32Array;s.prototype.beforeUpdate=function(){for(var e=0;e=e&&this.bbox[1]<=t&&this.bbox[3]>=t},s.prototype.setBBox=function(e,t,n,r){this.bbox[0]=e,this.bbox[1]=t,this.bbox[2]=n,this.bbox[3]=r,this.size=(n-e+r-t)/2},s.prototype._newSubRegion=function(){var e=this.subRegions[this.nSubRegions];return e||(e=new s,this.subRegions[this.nSubRegions]=e),this.nSubRegions++,e},s.prototype._addNodeToSubRegion=function(e){var t=this.findSubRegion(e.position[0],e.position[1]),n=this.bbox;if(!t){var r=(n[0]+n[2])/2,i=(n[1]+n[3])/2,s=(n[2]-n[0])/2,o=(n[3]-n[1])/2,u=e.position[0]>=r?1:0,a=e.position[1]>=i?1:0,t=this._newSubRegion();t.setBBox(u*s+n[0],a*o+n[1],(u+1)*s+n[0],(a+1)*o+n[1])}t.addNode(e)},s.prototype._updateCenterOfMass=function(e){this.centerOfMass==null&&(this.centerOfMass=n.create());var t=this.centerOfMass[0]*this.mass,r=this.centerOfMass[1]*this.mass;t+=e.position[0]*e.mass,r+=e.position[1]*e.mass,this.mass+=e.mass,this.centerOfMass[0]=t/this.mass,this.centerOfMass[1]=r/this.mass},a.prototype.initNodes=function(e,t,n){this.temperature=1;var r=e.length/2;this.nodes.length=0;var i=typeof n!="undefined";for(var s=0;s0&&this.applyNodeGravity(o)}for(var t=0;t0){n.scale(f,f,1/p);var d=n.len(s.speedPrev);d>0&&(p=Math.min(p/d,this.maxSpeedIncrease)*d,n.scaleAndAdd(l,s.speedPrev,f,p))}var v=n.len(l),h=Math.min(v,100)/(v+.1);n.scale(l,l,h),n.add(s.position,s.position,l)}},a.prototype.applyRegionToNodeRepulsion=function(){var e=n.create();return function(r,i){if(r.node)this.applyNodeToNodeRepulsion(r.node,i,!0);else{n.sub(e,i.position,r.centerOfMass);var s=e[0]*e[0]+e[1]*e[1];if(s>this.barnesHutTheta*r.size*r.size){var o=this._k*this._k*(i.mass+r.mass)/(s+1);n.scaleAndAdd(i.force,i.force,e,o*2)}else for(var u=0;u0?u=a*f/(l*l):l<=0&&(u=a*10*f)}else u=a*f/o;s||n.scaleAndAdd(r.force,r.force,e,u*2),n.scaleAndAdd(i.force,i.force,e,-u*2)}}(),a.prototype.applyEdgeAttraction=function(){var e=n.create();return function(r){var i=r.source,s=r.target;n.sub(e,i.position,s.position);var o=n.len(e),u;this.edgeWeightInfluence===0?u=1:this.edgeWeightInfluence==1?u=r.weight:u=Math.pow(r.weight,this.edgeWeightInfluence);var a;if(this.preventOverlap){o=o-i.size-s.size;if(o<=0)return}var a=-u*o/this._k;n.scaleAndAdd(i.force,i.force,e,a),n.scaleAndAdd(s.force,s.force,e,-a)}}(),a.prototype.applyNodeGravity=function(){var e=n.create();return function(t){n.sub(e,this.center,t.position),this.width>this.height?e[1]*=this.width/this.height:e[0]*=this.height/this.width;var r=n.len(e)/100;this.strongGravity?n.scaleAndAdd(t.force,t.force,e,r*this.gravity*t.mass):n.scaleAndAdd(t.force,t.force,e,this.gravity*t.mass/(r+1))}}(),a.prototype.updateBBox=function(){var e=Infinity,t=Infinity,n=-Infinity,r=-Infinity;for(var i=0;i.01){for(var r=0;r=0});var s,o;this._filteredLinks=x(this._rawLinks,function(e,r){s=e.source,o=e.target;var i=!0,u=typeof s=="string"?n[s]:t[s];typeof u=="undefined"&&(u=-1),u>=0?e.source=u:i=!1;var u=typeof o=="string"?n[o]:t[o];return typeof u=="undefined"&&(u=-1),u>=0?e.target=u:i=!1,e.rawIndex=r,i})},_initLayout:function(e){var t=this._filteredNodes,n=this._filteredLinks,r=this._nodeShapes,i=t.length,s=this.query(e,"minRadius"),o=this.query(e,"maxRadius");this._steps=e.steps||1,this._coolDown=e.coolDown||.99;var u=this.parseCenter(this.zr,e.center),f=this.parsePercent(e.size,this.zr.getWidth()),p=this.parsePercent(e.size,this.zr.getHeight()),d=Math.min(f,p),v=[];for(var m=0;m0&&this._buildSinglePosition(f,t[f]);this.addShapeList()},_buildSinglePosition:function(e,t){var n=this._mapData(t),r=n.locationMap,i=n.maxDataLength;if(i===0||r.length===0)return;switch(e){case"bottom":case"top":this._buildHorizontal(t,i,r,this.xMarkMap);break;case"left":case"right":this._buildVertical(t,i,r,this.xMarkMap)}for(var s=0,o=t.length;s0&&(this.finalPLMap[s]=this.finalPLMap[s]||[],this.finalPLMap[s].push(g[s]),g[s]=[]);continue}b>=0?(p-=T>0?l.getCoordSize(b):d-l.getCoord(b),h=p):b<0&&(v+=T>0?l.getCoordSize(b):l.getCoord(b)-m,h=v),g[s].push([c,h,w,a.getNameByIndex(w),c,d]),r[s].min>b&&(r[s].min=b,r[s].minY=h,r[s].minX=c),r[s].max0&&(this.finalPLMap[k]=this.finalPLMap[k]||[],this.finalPLMap[k].push(g[k]),g[k]=[]);for(var S=0,x=n.length;S0&&(r[s].average=(r[s].sum/r[s].counter).toFixed(2)-0),h=this.component.yAxis.getAxis(i[s].yAxisIndex||0).getCoord(r[s].average),r[s].averageLine=[[this.component.grid.getX(),h],[this.component.grid.getXend(),h]],r[s].minLine=[[this.component.grid.getX(),r[s].minY],[this.component.grid.getXend(),r[s].minY]],r[s].maxLine=[[this.component.grid.getX(),r[s].maxY],[this.component.grid.getXend(),r[s].maxY]];this._buildBorkenLine(e,this.finalPLMap,a,"horizontal")},_buildVertical:function(e,t,n,r){var i=this.series,s=n[0][0],o=i[s],u=o.yAxisIndex,a=this.component.yAxis.getAxis(u),f,l,c,h,p,d,v,m,g={},y,b;for(var w=0,E=t;w0&&(this.finalPLMap[s]=this.finalPLMap[s]||[],this.finalPLMap[s].push(g[s]),g[s]=[]);continue}b>=0?(p+=T>0?l.getCoordSize(b):l.getCoord(b)-d,c=p):b<0&&(v-=T>0?l.getCoordSize(b):m-l.getCoord(b),c=v),g[s].push([c,h,w,a.getNameByIndex(w),d,h]),r[s].min>b&&(r[s].min=b,r[s].minX=c,r[s].minY=h),r[s].max0&&(this.finalPLMap[k]=this.finalPLMap[k]||[],this.finalPLMap[k].push(g[k]),g[k]=[]);for(var S=0,x=n.length;S0&&(r[s].average=(r[s].sum/r[s].counter).toFixed(2)-0),c=this.component.xAxis.getAxis(i[s].xAxisIndex||0).getCoord(r[s].average),r[s].averageLine=[[c,this.component.grid.getYend()],[c,this.component.grid.getY()]],r[s].minLine=[[r[s].minX,this.component.grid.getYend()],[r[s].minX,this.component.grid.getY()]],r[s].maxLine=[[r[s].maxX,this.component.grid.getYend()],[r[s].maxX,this.component.grid.getY()]];this._buildBorkenLine(e,this.finalPLMap,a,"vertical")},_buildBorkenLine:function(e,t,n,i){var o=this.series,l,c,h,p,d,v,m,g,y,b,w,E,S,x,T;for(var N=e.length-1;N>=0;N--){T=e[N],g=o[T],b=t[T];if(g.type==this.type&&typeof b!="undefined"){l=this._sIndex2ColorMap[T],c=this.query(g,"itemStyle.normal.lineStyle.width"),h=this.query(g,"itemStyle.normal.lineStyle.type"),p=this.query(g,"itemStyle.normal.lineStyle.color"),d=this.getItemStyleColor(this.query(g,"itemStyle.normal.color"),T,-1),v=typeof this.query(g,"itemStyle.normal.areaStyle")!="undefined",m=this.query(g,"itemStyle.normal.areaStyle.color");for(var C=0,k=b.length;C=0;r--){f=this.shapeList[r]._seriesIndex;if(n[f]&&!n[f][3]){if(this.shapeList[r]._main&&this.shapeList[r].style.pointList.length>1){l=this.shapeList[r].style.pointList,o=Math.abs(l[0][0]-l[1][0]),a=Math.abs(l[0][1]-l[1][1]),c=this.shapeList[r]._orient=="horizontal";if(n[f][2]){if(this.shapeList[r].type=="polygon"){var h=l.length;this.shapeList[r].style.pointList[h-3]=l[h-2],c?this.shapeList[r].style.pointList[h-3][0]=l[h-4][0]:this.shapeList[r].style.pointList[h-3][1]=l[h-4][1],this.shapeList[r].style.pointList[h-2]=l[h-1]}this.shapeList[r].style.pointList.pop(),c?(s=o,u=0):(s=0,u=-a)}else{this.shapeList[r].style.pointList.shift();if(this.shapeList[r].type=="polygon"){var p=this.shapeList[r].style.pointList.pop();c?p[0]=l[0][0]:p[1]=l[0][1],this.shapeList[r].style.pointList.push(p)}c?(s=-o,u=0):(s=0,u=a)}this.zr.modShape(this.shapeList[r].id,{style:{pointList:this.shapeList[r].style.pointList}},!0)}else{if(n[f][2]&&this.shapeList[r]._dataIndex==t[f].data.length-1){this.zr.delShape(this.shapeList[r].id);continue}if(!n[f][2]&&this.shapeList[r]._dataIndex===0){this.zr.delShape(this.shapeList[r].id);continue}}this.shapeList[r].position=[0,0],this.zr.animate(this.shapeList[r].id,"").when(500,{position:[s,u]}).start()}}}},i.prototype.iconLibrary.legendLineIcon=c,a.inherits(l,n),a.inherits(l,t),e("../chart").define("line",l),l}),define("echarts/chart/bar",["require","../component/base","./base","zrender/shape/Rectangle","../component/axis","../component/grid","../component/dataZoom","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../chart"],function(e){function a(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this),this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("zrender/shape/Rectangle");e("../component/axis"),e("../component/grid"),e("../component/dataZoom");var i=e("../config"),s=e("../util/ecData"),o=e("zrender/tool/util"),u=e("zrender/tool/color");return a.prototype={type:i.CHART_TYPE_BAR,_buildShape:function(){var e=this.series;this.selectedMap={},this.xMarkMap={},this._sIndex2colorMap={};var t={top:[],bottom:[],left:[],right:[]},n,r,s,o;for(var u=0,a=e.length;u0&&this._buildSinglePosition(f,t[f],this.xMarkMap);this.addShapeList()},_buildSinglePosition:function(e,t,n){var r=this._mapData(t),i=r.locationMap,s=r.maxDataLength;if(s===0||i.length===0)return;switch(e){case"bottom":case"top":this._buildHorizontal(s,i,t,n);break;case"left":case"right":this._buildVertical(s,i,t,n)}},_mapData:function(e){var t=this.series,n,r=0,i={},s="__kener__stack__",o,u,a=this.component.legend,f=[],l=0,c;for(var h=0,p=e.length;h0&&(c.style.x+=1,c.style.y+=1,c.style.width-=2,c.style.height-=2,c.style.strokeColor=c.highlightStyle.strokeColor=n.itemStyle.normal.borderColor,c.highlightStyle.lineWidth=3,c.style.brushType="both"),a.setItemShape(u,c))):(this.selectedMap[u]=!0,this._sIndex2colorMap[e[h]]=this.zr.getColor(e[h])),this.selectedMap[u]&&(o=n.stack||s+e[h],typeof i[o]=="undefined"?(i[o]=r,f[r]=[e[h]],r++):f[i[o]].push(e[h])),l=Math.max(l,n.data.length);return{locationMap:f,maxDataLength:l}},_buildHorizontal:function(e,t,n,i){var s=this.series,o=t[0][0],u=s[o],a=u.xAxisIndex,f=this.component.xAxis.getAxis(a),l,c,h=this._mapSize(f,t),p=h.gap,d=h.barGap,v=h.barWidthMap,m=h.barWidth,g=h.barMinHeightMap,y,b=h.interval,w,E,S,x,T,N,C,k,L;for(var A=0,O=e;A0?(y=D>0?c.getCoordSize(L):x-c.getCoord(L),P==1&&g[o]>y&&(y=g[o]),S-=y,E=S):L<0?(y=D>0?c.getCoordSize(L):c.getCoord(L)-N,P==1&&g[o]>y&&(y=g[o]),E=T,T+=y):(y=0,S-=y,E=S),i[o][A]=w+(v[o]||m)/2,i[o].min>L&&(i[o].min=L,i[o].minY=E,i[o].minX=i[o][A]),i[o].max0&&(i[o].average=(i[o].sum/i[o].counter).toFixed(2)-0),E=this.component.yAxis.getAxis(s[o].yAxisIndex||0).getCoord(i[o].average),i[o].averageLine=[[this.component.grid.getX(),E],[this.component.grid.getXend(),E]],i[o].minLine=[[this.component.grid.getX(),i[o].minY],[this.component.grid.getXend(),i[o].minY]],i[o].maxLine=[[this.component.grid.getX(),i[o].maxY],[this.component.grid.getXend(),i[o].maxY]],i[o].isHorizontal=!0,this.buildMark(o)},_buildVertical:function(e,t,n,i){var s=this.series,o=t[0][0],u=s[o],a=u.yAxisIndex,f=this.component.yAxis.getAxis(a),l,c,h=this._mapSize(f,t),p=h.gap,d=h.barGap,v=h.barWidthMap,m=h.barWidth,g=h.barMinHeightMap,y,b=h.interval,w,E,S,x,T,N,C,k,L;for(var A=0,O=e;A0?(y=D>0?c.getCoordSize(L):c.getCoord(L)-x,P==1&&g[o]>y&&(y=g[o]),w=S,S+=y):L<0?(y=D>0?c.getCoordSize(L):N-c.getCoord(L),P==1&&g[o]>y&&(y=g[o]),T-=y,w=T):(y=0,w=S,S+=y),i[o][A]=E-(v[o]||m)/2,i[o].min>L&&(i[o].min=L,i[o].minX=w+y,i[o].minY=i[o][A]),i[o].max0&&(i[o].average=(i[o].sum/i[o].counter).toFixed(2)-0),w=this.component.xAxis.getAxis(s[o].xAxisIndex||0).getCoord(i[o].average),i[o].averageLine=[[w,this.component.grid.getYend()],[w,this.component.grid.getY()]],i[o].minLine=[[i[o].minX,this.component.grid.getYend()],[i[o].minX,this.component.grid.getY()]],i[o].maxLine=[[i[o].maxX,this.component.grid.getYend()],[i[o].maxX,this.component.grid.getY()]],i[o].isHorizontal=!1,this.buildMark(o)},_mapSize:function(e,t,n){var r=this.series,i,s={},o={},u,a=0,f=0,l,c,h,p,d=1;for(var v=0,m=t.length;v1?typeof c=="string"&&c.match(/%$/)?Math.floor(e.getGap()*(100-parseFloat(c))/100):e.getGap()-c:f,x=0,l=a>1?Math.floor((S-f)/(a-1)):0;if(l<0)return this._mapSize(e,t,!0)}return{barWidthMap:s,barMinHeightMap:o,gap:S,barWidth:x,barGap:l,interval:d}},_getBarItem:function(e,t,n,r,i,o,a,f){var l=this.series,c,h=l[e],p=h.data[t],d=this._sIndex2colorMap[e],v=[p,h],m=this.deepQuery(v,"itemStyle.normal.color")||d,g=this.deepQuery(v,"itemStyle.emphasis.color"),y=this.deepMerge(v,"itemStyle.normal"),b=y.borderWidth,w=this.deepMerge(v,"itemStyle.emphasis");c={zlevel:this._zlevelBase,clickable:!0,style:{x:r,y:i,width:o,height:a,brushType:"both",color:this.getItemStyleColor(m,e,t,p),radius:y.borderRadius,lineWidth:b,strokeColor:y.borderColor},highlightStyle:{color:this.getItemStyleColor(g,e,t,p),radius:w.borderRadius,lineWidth:w.borderWidth,strokeColor:w.borderColor},_orient:f},c.highlightStyle.color=c.highlightStyle.color||(typeof c.style.color=="string"?u.lift(c.style.color,-0.3):c.style.color),b>0&&c.style.height>b&&c.style.width>b?(c.style.y+=b/2,c.style.height-=b,c.style.x+=b/2,c.style.width-=b):c.style.brushType="fill",c.highlightStyle.textColor=c.highlightStyle.color,c=this.addLabel(c,h,p,n,f);if(c.style.textPosition=="insideLeft"||c.style.textPosition=="insideRight"||c.style.textPosition=="insideTop"||c.style.textPosition=="insideBottom"){var E=5;switch(c.style.textPosition){case"insideLeft":c.style.textX=c.style.x+E,c.style.textY=c.style.y+c.style.height/2,c.style.textAlign="left",c.style.textBaseline="middle";break;case"insideRight":c.style.textX=c.style.x+c.style.width-E,c.style.textY=c.style.y+c.style.height/2,c.style.textAlign="right",c.style.textBaseline="middle";break;case"insideTop":c.style.textX=c.style.x+c.style.width/2,c.style.textY=c.style.y+E/2,c.style.textAlign="center",c.style.textBaseline="top";break;case"insideBottom":c.style.textX=c.style.x+c.style.width/2,c.style.textY=c.style.y+c.style.height-E/2,c.style.textAlign="center",c.style.textBaseline="bottom"}c.style.textPosition="specific",c.style.textColor=c.style.textColor||"#fff"}return this.deepQuery([p,h,this.option],"calculable")&&(this.setCalculable(c),c.draggable=!0),s.pack(c,l[e],e,l[e].data[t],t,n),c},getMarkCoord:function(e,t){var n=this.series[e],r=this.xMarkMap[e],i=this.component.xAxis.getAxis(n.xAxisIndex),s=this.component.yAxis.getAxis(n.yAxisIndex),o,u;if(!t.type||t.type!="max"&&t.type!="min"&&t.type!="average")if(r.isHorizontal){o=typeof t.xAxis=="string"&&i.getIndexByName?i.getIndexByName(t.xAxis):t.xAxis||0;var a=r[o];a=typeof a!="undefined"?a:typeof t.xAxis!="string"&&i.getCoordByIndex?i.getCoordByIndex(t.xAxis||0):i.getCoord(t.xAxis||0),u=[a,s.getCoord(t.yAxis||0)]}else{o=typeof t.yAxis=="string"&&s.getIndexByName?s.getIndexByName(t.yAxis):t.yAxis||0;var f=r[o];f=typeof f!="undefined"?f:typeof t.yAxis!="string"&&s.getCoordByIndex?s.getCoordByIndex(t.yAxis||0):s.getCoord(t.yAxis||0),u=[i.getCoord(t.xAxis||0),f]}else u=[r[t.type+"X"],r[t.type+"Y"],r[t.type+"Line"],r[t.type]];return u},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},addDataAnimation:function(e){var t=this.series,n={};for(var r=0,i=e.length;r=0;r--){c=s.get(this.shapeList[r],"seriesIndex");if(n[c]&&!n[c][3]&&this.shapeList[r].type=="rectangle"){h=s.get(this.shapeList[r],"dataIndex"),l=t[c];if(n[c][2]&&h==l.data.length-1){this.zr.delShape(this.shapeList[r].id);continue}if(!n[c][2]&&h===0){this.zr.delShape(this.shapeList[r].id);continue}this.shapeList[r]._orient=="horizontal"?(f=this.component.yAxis.getAxis(l.yAxisIndex||0).getGap(),a=n[c][2]?-f:f,o=0):(u=this.component.xAxis.getAxis(l.xAxisIndex||0).getGap(),o=n[c][2]?u:-u,a=0),this.shapeList[r].position=[0,0],this.zr.animate(this.shapeList[r].id,"").when(500,{position:[o,a]}).start()}}}},o.inherits(a,n),o.inherits(a,t),e("../chart").define("bar",a),a}),define("echarts/chart/pie",["require","../component/base","./base","zrender/shape/Text","zrender/shape/Ring","zrender/shape/Circle","zrender/shape/Sector","zrender/shape/BrokenLine","../config","../util/ecData","zrender/tool/util","zrender/tool/math","zrender/tool/color","../chart"],function(e){function p(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this);var u=this;u.shapeHandler.onmouseover=function(e){var t=e.target,n=f.get(t,"seriesIndex"),r=f.get(t,"dataIndex"),i=f.get(t,"special"),s=t._lastAddRadius,o=t.style.startAngle,a=t.style.endAngle,l=t.highlightStyle.color,c=u.getLabel(n,r,i,s,o,a,l,!0);c&&u.zr.addHoverShape(c);var h=u.getLabelLine(n,r,s,t.style.r0,t.style.r,o,a,l,!0);h&&u.zr.addHoverShape(h)},this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("zrender/shape/Text"),i=e("zrender/shape/Ring"),s=e("zrender/shape/Circle"),o=e("zrender/shape/Sector"),u=e("zrender/shape/BrokenLine"),a=e("../config"),f=e("../util/ecData"),l=e("zrender/tool/util"),c=e("zrender/tool/math"),h=e("zrender/tool/color");return p.prototype={type:a.CHART_TYPE_PIE,_buildShape:function(){var e=this.series,t=this.component.legend;this.selectedMap={},this._selected={};var n,r,o;this._selectedMode=!1;var u;for(var l=0,c=e.length;l0&&Math.abs(m-g)<15&&p<4&&this._needLabel(n,r[l],!1)&&this.deepQuery([r[l],n],"itemStyle.normal.label.position")!="center"?d+=h<4?20:-20:d=0,this._buildItem(e,l,h,d,r[l].selected,x,T,m,g,w),v||(m=g)}},_buildItem:function(e,t,n,r,i,s,o,u,a,l){var c=this.series,h=this.getSector(e,t,n,i,s,o,u,a,l);f.pack(h,c[e],e,c[e].data[t],t,c[e].data[t].name,n),h._lastAddRadius=r,this.shapeList.push(h);var p=this.getLabel(e,t,n,r,u,a,l,!1);p&&(f.pack(p,c[e],e,c[e].data[t],t,c[e].data[t].name,n),p._dataIndex=t,this.shapeList.push(p));var d=this.getLabelLine(e,t,r,s,o,u,a,l,!1);d&&(f.pack(d,c[e],e,c[e].data[t],t,c[e].data[t].name,n),d._dataIndex=t,this.shapeList.push(d))},getSector:function(e,t,n,r,i,s,u,a,f){var l=this.series,p=l[e],d=p.data[t],v=[d,p],m=this.parseCenter(this.zr,p.center),g=this.deepMerge(v,"itemStyle.normal")||{},y=this.deepMerge(v,"itemStyle.emphasis")||{},b=this.getItemStyleColor(g.color,e,t,d)||f,w=this.getItemStyleColor(y.color,e,t,d)||(typeof b=="string"?h.lift(b,-0.2):b),E={zlevel:this._zlevelBase,clickable:!0,style:{x:m[0],y:m[1],r0:i,r:s,startAngle:u,endAngle:a,brushType:"both",color:b,lineWidth:g.borderWidth,strokeColor:g.borderColor,lineJoin:"round"},highlightStyle:{color:w,lineWidth:y.borderWidth,strokeColor:y.borderColor,lineJoin:"round"},_seriesIndex:e,_dataIndex:t};if(r){var S=((E.style.startAngle+E.style.endAngle)/2).toFixed(2)-0;E.style._hasSelected=!0,E.style._x=E.style.x,E.style._y=E.style.y;var x=this.query(p,"selectedOffset");E.style.x+=c.cos(S,!0)*x,E.style.y-=c.sin(S,!0)*x,this._selected[e][t]=!0}else this._selected[e][t]=!1;this._selectedMode&&(E.onclick=this.shapeHandler.onclick),this.deepQuery([d,p,this.option],"calculable")&&(this.setCalculable(E),E.draggable=!0);if(this._needLabel(p,d,!0)||this._needLabelLine(p,d,!0))E.onmouseover=this.shapeHandler.onmouseover;return E=new o(E),E},getLabel:function(e,t,n,i,s,o,u,a){var f=this.series,h=f[e],p=h.data[t];if(!this._needLabel(h,p,a))return;var d=a?"emphasis":"normal",v=l.merge(l.clone(p.itemStyle)||{},h.itemStyle),m=v[d].label,g=m.textStyle||{},y=this.parseCenter(this.zr,h.center),b=y[0],w=y[1],E,S,x=((o+s)/2+360)%360,T=this.parseRadius(this.zr,h.radius),N,C="middle";return m.position=m.position||v.normal.label.position,m.position=="center"?(T=T[1],E=b,S=w,N="center"):m.position=="inner"?(T=(T[0]+T[1])/2+i,E=Math.round(b+T*c.cos(x,!0)),S=Math.round(w-T*c.sin(x,!0)),u="#fff",N="center"):(T=T[1]- -v[d].labelLine.length+i,E=b+T*c.cos(x,!0),S=w-T*c.sin(x,!0),N=x>=90&&x<=270?"right":"left"),m.position!="center"&&m.position!="inner"&&(E+=N=="left"?20:-20),p.__labelX=E-(N=="left"?5:-5),p.__labelY=S,new r({zlevel:this._zlevelBase+1,hoverable:!1,style:{x:E,y:S,color:g.color||u,text:this.getLabelText(e,t,n,d),textAlign:g.align||N,textBaseline:g.baseline||C,textFont:this.getFont(g)},highlightStyle:{brushType:"fill"},_seriesIndex:e,_dataIndex:t})},getLabelText:function(e,t,n,r){var i=this.series,s=i[e],o=s.data[t],u=this.deepQuery([o,s],"itemStyle."+r+".label.formatter");if(!u)return o.name;if(typeof u=="function")return u.call(this.myChart,s.name,o.name,o.value,n);if(typeof u=="string")return u=u.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}").replace("{d}","{d0}"),u=u.replace("{a0}",s.name).replace("{b0}",o.name).replace("{c0}",o.value).replace("{d0}",n),u},getLabelLine:function(e,t,n,r,i,s,o,a,f){var h=this.series,p=h[e],d=p.data[t];if(this._needLabelLine(p,d,f)){var v=f?"emphasis":"normal",m=l.merge(l.clone(d.itemStyle)||{},p.itemStyle),g=m[v].labelLine,y=g.lineStyle||{},b=this.parseCenter(this.zr,p.center),w=b[0],E=b[1],S=i,x=this.parseRadius(this.zr,p.radius)[1]- -g.length+n,T=(o+s)/2%360,N=c.cos(T,!0),C=c.sin(T,!0);return new u({zlevel:this._zlevelBase+1,hoverable:!1,style:{pointList:[[w+S*N,E-S*C],[w+x*N,E-x*C],[d.__labelX,d.__labelY]],strokeColor:y.color||a,lineType:y.type,lineWidth:y.width},_seriesIndex:e,_dataIndex:t})}return},_needLabel:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".label.show")},_needLabelLine:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".labelLine.show")},reformOption:function(e){var t=l.merge;return e=t(e||{},this.ecTheme.pie),e.itemStyle.normal.label.textStyle=t(e.itemStyle.normal.label.textStyle||{},this.ecTheme.textStyle),e.itemStyle.emphasis.label.textStyle=t(e.itemStyle.emphasis.label.textStyle||{},this.ecTheme.textStyle),e},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},addDataAnimation:function(e){var t=this.series,n={};for(var r=0,i=e.length;r{b} : {c}",showDelay:20,hideDelay:100,transitionDuration:.4,backgroundColor:"rgba(0,0,0,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,axisPointer:{type:"line",lineStyle:{color:"#48b",width:2,type:"solid"},crossStyle:{color:"#1e90ff",width:1,type:"dashed"},shadowStyle:{color:"rgba(150,150,150,0.3)",width:"auto",type:"default"}},textStyle:{color:"#fff"}},dataZoom:{show:!1,orient:"horizontal",backgroundColor:"rgba(0,0,0,0)",dataBackgroundColor:"#eee",fillerColor:"rgba(144,197,237,0.2)",handleColor:"rgba(70,130,180,0.8)",realtime:!0},grid:{x:80,y:60,x2:80,y2:60,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},categoryAxis:{position:"bottom",name:"",nameLocation:"end",nameTextStyle:{},boundaryGap:!0,axisLine:{show:!0,onZero:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!0,interval:"auto",inside:!1,length:5,lineStyle:{color:"#333",width:1}},axisLabel:{show:!0,interval:"auto",rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}}},valueAxis:{position:"left",name:"",nameLocation:"end",nameTextStyle:{},boundaryGap:[0,0],precision:0,power:100,splitNumber:5,axisLine:{show:!0,onZero:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,inside:!1,length:5,lineStyle:{color:"#333",width:1}},axisLabel:{show:!0,rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}}},polar:{center:["50%","50%"],radius:"75%",startAngle:90,splitNumber:5,name:{show:!0,textStyle:{color:"#333"}},axisLine:{show:!0,lineStyle:{color:"#ccc",width:1,type:"solid"}},axisLabel:{show:!1,textStyle:{color:"#333"}},splitArea:{show:!0,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}},splitLine:{show:!0,lineStyle:{width:1,color:"#ccc"}},type:"polygon"},timeline:{show:!0,type:"time",notMerge:!1,realtime:!0,x:80,x2:80,y2:0,height:50,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,controlPosition:"left",autoPlay:!1,loop:!0,playInterval:2e3,lineStyle:{width:1,color:"#666",type:"dashed"},label:{show:!0,interval:"auto",rotate:0,textStyle:{color:"#333"}},checkpointStyle:{symbol:"auto",symbolSize:"auto",color:"auto",borderColor:"auto",borderWidth:"auto",label:{show:!1,textStyle:{color:"auto"}}},controlStyle:{normal:{color:"#333"},emphasis:{color:"#1e90ff"}},symbol:"emptyDiamond",symbolSize:4,currentIndex:0},roamController:{show:!1,x:"left",y:"top",width:80,height:120,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,handlerColor:"#6495ed",fillerColor:"#fff",step:15,mapTypeControl:null},bar:{clickable:!0,xAxisIndex:0,yAxisIndex:0,barMinHeight:0,barGap:"30%",barCategoryGap:"20%",itemStyle:{normal:{barBorderColor:"#fff",barBorderRadius:0,barBorderWidth:0,label:{show:!1}},emphasis:{barBorderColor:"#fff",barBorderRadius:0,barBorderWidth:0,label:{show:!1}}}},line:{clickable:!0,xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid",shadowColor:"rgba(0,0,0,0)",shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0}},emphasis:{label:{show:!1}}},symbolSize:2,showAllSymbol:!1},k:{clickable:!0,xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{color:"#fff",color0:"#00aa11",lineStyle:{width:1,color:"#ff3200",color0:"#00aa11"}},emphasis:{}}},scatter:{clickable:!0,xAxisIndex:0,yAxisIndex:0,symbolSize:4,large:!1,largeThreshold:2e3,itemStyle:{normal:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}},emphasis:{label:{show:!1,formatter:function(e,t,n){return typeof n[2]!="undefined"?n[2]:n[0]+" , "+n[1]}}}}},radar:{clickable:!0,polarIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid"}},emphasis:{label:{show:!1}}},symbolSize:2},pie:{clickable:!0,center:["50%","50%"],radius:[0,"75%"],clockWise:!0,startAngle:90,minAngle:0,selectedOffset:10,itemStyle:{normal:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1,type:"solid"}}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!1},labelLine:{show:!1,length:20,lineStyle:{width:1,type:"solid"}}}}},map:{mapType:"china",mapValuePrecision:0,showLegendSymbol:!0,hoverable:!0,clickable:!0,itemStyle:{normal:{borderColor:"rgba(0,0,0,0)",borderWidth:1,areaStyle:{color:"#ccc"},label:{show:!1,textStyle:{color:"rgb(139,69,19)"}}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,areaStyle:{color:"rgba(255,215,0,0.8)"},label:{show:!1,textStyle:{color:"rgb(100,0,0)"}}}}},force:{center:["50%","50%"],size:"100%",coolDown:.99,minRadius:10,maxRadius:20,ratioScaling:!1,large:!1,useWorker:!1,steps:1,scaling:1,gravity:1,symbol:"circle",symbolSize:0,linkSymbol:null,linkSymbolSize:[10,15],draggable:!0,clickable:!0,categories:[{}],itemStyle:{normal:{label:{show:!1},nodeStyle:{brushType:"both",color:"#f08c2e",strokeColor:"#5182ab",lineWidth:1},linkStyle:{strokeColor:"#5182ab"}},emphasis:{label:{show:!1},nodeStyle:{},linkStyle:{opacity:0}}}},chord:{clickable:!0,radius:["65%","75%"],center:["50%","50%"],padding:2,sort:"none",sortSub:"none",startAngle:90,clockWise:!0,showScale:!1,showScaleText:!1,itemStyle:{normal:{label:{show:!0,rotate:!1,distance:10},lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:1,color:"#999"}}},emphasis:{lineStyle:{width:0,color:"#000"},chordStyle:{lineStyle:{width:1,color:"#666"}}}},matrix:[]},gauge:{center:["50%","50%"],radius:"75%",startAngle:225,endAngle:-45,min:0,max:100,precision:0,splitNumber:10,axisLine:{show:!0,lineStyle:{color:[[.2,"#228b22"],[.8,"#48b"],[1,"#ff4500"]],width:30}},axisTick:{show:!0,splitNumber:5,length:8,lineStyle:{color:"#eee",width:1,type:"solid"}},axisLabel:{show:!0,textStyle:{color:"auto"}},splitLine:{show:!0,length:30,lineStyle:{color:"#eee",width:2,type:"solid"}},pointer:{show:!0,length:"80%",width:8,color:"auto"},title:{show:!0,offsetCenter:[0,"-40%"],textStyle:{color:"#333",fontSize:15}},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:40,offsetCenter:[0,"40%"],textStyle:{color:"auto",fontSize:30}}},funnel:{clickable:!0,x:80,y:60,x2:80,y2:60,min:0,max:100,minSize:"0%",maxSize:"100%",sort:"descending",gap:0,itemStyle:{normal:{borderColor:"#fff",borderWidth:1,label:{show:!0,position:"outer"},labelLine:{show:!0,length:10,lineStyle:{width:1,type:"solid"}}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!0},labelLine:{show:!0}}}},island:{r:15,calculateStep:.1},markPoint:{clickable:!0,symbol:"pin",symbolSize:10,large:!1,effect:{show:!1,loop:!0,period:15,scaleSize:2},itemStyle:{normal:{borderWidth:2,label:{show:!0,position:"inside"}},emphasis:{label:{show:!0}}}},markLine:{clickable:!0,symbol:["circle","arrow"],symbolSize:[2,4],large:!1,effect:{show:!1,loop:!0,period:15,scaleSize:2},itemStyle:{normal:{borderWidth:1.5,label:{show:!0,position:"end"},lineStyle:{type:"dashed"}},emphasis:{label:{show:!1},lineStyle:{}}}},textStyle:{decoration:"none",fontFamily:"Arial, Verdana, sans-serif",fontFamily2:"微软雅黑",fontSize:12,fontStyle:"normal",fontWeight:"normal"},EVENT:{REFRESH:"refresh",RESTORE:"restore",RESIZE:"resize",CLICK:"click",DBLCLICK:"dblclick",HOVER:"hover",MOUSEOUT:"mouseout",DATA_CHANGED:"dataChanged",DATA_ZOOM:"dataZoom",DATA_RANGE:"dataRange",LEGEND_SELECTED:"legendSelected",MAP_SELECTED:"mapSelected",PIE_SELECTED:"pieSelected",MAGIC_TYPE_CHANGED:"magicTypeChanged",DATA_VIEW_CHANGED:"dataViewChanged",TIMELINE_CHANGED:"timelineChanged",MAP_ROAM:"mapRoam",TOOLTIP_HOVER:"tooltipHover",TOOLTIP_IN_GRID:"tooltipInGrid",TOOLTIP_OUT_GRID:"tooltipOutGrid",ROAMCONTROLLER:"roamController"},DRAG_ENABLE_TIME:120,EFFECT_ZLEVEL:7,symbolList:["circle","rectangle","triangle","diamond","emptyCircle","emptyRectangle","emptyTriangle","emptyDiamond"],loadingText:"Loading...",calculable:!1,calculableColor:"rgba(255,165,0,0.6)",calculableHolderColor:"#ccc",nameConnector:" & ",valueConnector:": ",animation:!0,addDataAnimation:!0,animationThreshold:2e3,animationDuration:2e3,animationEasing:"ExponentialOut"};return e}),define("zrender/dep/excanvas",["require"],function(e){return document.createElement("canvas").getContext?G_vmlCanvasManager=!1:function(){function f(){return this.context_||(this.context_=new I(this))}function c(e,t,n){var r=l.call(arguments,2);return function(){return e.apply(t,r.concat(l.call(arguments)))}}function h(e){return String(e).replace(/&/g,"&").replace(/"/g,""")}function p(e,t,n){e.namespaces[t]||e.namespaces.add(t,n,"#default#VML")}function d(e){p(e,"g_vml_","urn:schemas-microsoft-com:vml"),p(e,"g_o_","urn:schemas-microsoft-com:office:office");if(!e.styleSheets.ex_canvas_){var t=e.createStyleSheet();t.owningElement.id="ex_canvas_",t.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}function m(e){var t=e.srcElement;switch(e.propertyName){case"width":t.getContext().clearRect(),t.style.width=t.attributes.width.nodeValue+"px",t.firstChild.style.width=t.clientWidth+"px";break;case"height":t.getContext().clearRect(),t.style.height=t.attributes.height.nodeValue+"px",t.firstChild.style.height=t.clientHeight+"px"}}function g(e){var t=e.srcElement;t.firstChild&&(t.firstChild.style.width=t.clientWidth+"px",t.firstChild.style.height=t.clientHeight+"px")}function E(){return[[1,0,0],[0,1,0],[0,0,1]]}function S(e,t){var n=E();for(var r=0;r<3;r++)for(var i=0;i<3;i++){var s=0;for(var o=0;o<3;o++)s+=e[r][o]*t[o][i];n[r][i]=s}return n}function x(e,t){t.fillStyle=e.fillStyle,t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY,t.strokeStyle=e.strokeStyle,t.globalAlpha=e.globalAlpha,t.font=e.font,t.textAlign=e.textAlign,t.textBaseline=e.textBaseline,t.arcScaleX_=e.arcScaleX_,t.arcScaleY_=e.arcScaleY_,t.lineScale_=e.lineScale_}function N(e){var t=e.indexOf("(",3),n=e.indexOf(")",t+1),r=e.substring(t+1,n).split(",");if(r.length!=4||e.charAt(3)!="a")r[3]=1;return r}function C(e){return parseFloat(e)/100}function k(e,t,n){return Math.min(n,Math.max(t,e))}function L(e){var t,n,r,i,s,o;i=parseFloat(e[0])/360%360,i<0&&i++,s=k(C(e[1]),0,1),o=k(C(e[2]),0,1);if(s==0)t=n=r=o;else{var u=o<.5?o*(1+s):o+s-o*s,a=2*o-u;t=A(a,u,i+1/3),n=A(a,u,i),r=A(a,u,i-1/3)}return"#"+y[Math.floor(t*255)]+y[Math.floor(n*255)]+y[Math.floor(r*255)]}function A(e,t,n){return n<0&&n++,n>1&&n--,6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function M(e){if(e in O)return O[e];var t,n=1;e=String(e);if(e.charAt(0)=="#")t=e;else if(/^rgb/.test(e)){var r=N(e),t="#",i;for(var s=0;s<3;s++)r[s].indexOf("%")!=-1?i=Math.floor(C(r[s])*255):i=+r[s],t+=y[k(i,0,255)];n=+r[3]}else if(/^hsl/.test(e)){var r=N(e);t=L(r),n=r[3]}else t=T[e]||e;return O[e]={color:t,alpha:n}}function P(e){if(D[e])return D[e];var t=document.createElement("div"),n=t.style,r;try{n.font=e,r=n.fontFamily.split(",")[0]}catch(i){}return D[e]={style:n.fontStyle||_.style,variant:n.fontVariant||_.variant,weight:n.fontWeight||_.weight,size:n.fontSize||_.size,family:r||_.family}}function H(e,t){var n={};for(var r in e)n[r]=e[r];var i=parseFloat(t.currentStyle.fontSize),s=parseFloat(e.size);return typeof e.size=="number"?n.size=e.size:e.size.indexOf("px")!=-1?n.size=s:e.size.indexOf("em")!=-1?n.size=i*s:e.size.indexOf("%")!=-1?n.size=i/100*s:e.size.indexOf("pt")!=-1?n.size=s/.75:n.size=i,n}function B(e){return e.style+" "+e.variant+" "+e.weight+" "+e.size+"px '"+e.family+"'"}function F(e){return j[e]||"square"}function I(e){this.m_=E(),this.mStack_=[],this.aStack_=[],this.currentPath_=[],this.strokeStyle="#000",this.fillStyle="#000",this.lineWidth=1,this.lineJoin="miter",this.lineCap="butt",this.miterLimit=o*1,this.globalAlpha=1,this.font="12px 微软雅黑",this.textAlign="left",this.textBaseline="alphabetic",this.canvas=e;var t="width:"+e.clientWidth+"px;height:"+e.clientHeight+"px;overflow:hidden;position:absolute",n=e.ownerDocument.createElement("div");n.style.cssText=t,e.appendChild(n);var r=n.cloneNode(!1);r.style.backgroundColor="#fff",r.style.filter="alpha(opacity=0)",e.appendChild(r),this.element_=n,this.arcScaleX_=1,this.arcScaleY_=1,this.lineScale_=1}function R(e,t,n,r){e.currentPath_.push({type:"bezierCurveTo",cp1x:t.x,cp1y:t.y,cp2x:n.x,cp2y:n.y,x:r.x,y:r.y}),e.currentX_=r.x,e.currentY_=r.y}function U(e,t){var n=M(e.strokeStyle),r=n.color,i=n.alpha*e.globalAlpha,s=e.lineScale_*e.lineWidth;s<1&&(i*=s),t.push("')}function z(t,n,r,i){var s=t.fillStyle,u=t.arcScaleX_,a=t.arcScaleY_,f=i.x-r.x,l=i.y-r.y;if(s instanceof $){var c=0,h={x:0,y:0},p=0,d=1;if(s.type_=="gradient"){var v=s.x0_/u,m=s.y0_/a,g=s.x1_/u,y=s.y1_/a,b=W(t,v,m),w=W(t,g,y),E=w.x-b.x,S=w.y-b.y;c=Math.atan2(E,S)*180/Math.PI,c<0&&(c+=360),c<1e-6&&(c=0)}else{var b=W(t,s.x0_,s.y0_);h={x:(b.x-r.x)/f,y:(b.y-r.y)/l},f/=u*o,l/=a*o;var x=e.max(f,l);p=2*s.r0_/x,d=2*s.r1_/x-p}var T=s.colors_;T.sort(function(e,t){return e.offset-t.offset});var N=T.length,C=T[0].color,k=T[N-1].color,L=T[0].alpha*t.globalAlpha,A=T[N-1].alpha*t.globalAlpha,O=[];for(var _=0;_')}else if(s instanceof J){if(f&&l){var P=-r.x,H=-r.y;n.push("')}}else{var B=M(t.fillStyle),j=B.color,F=B.alpha*t.globalAlpha;n.push('')}}function W(e,t,n){var r=e.m_;return{x:o*(t*r[0][0]+n*r[1][0]+r[2][0])-u,y:o*(t*r[0][1]+n*r[1][1]+r[2][1])-u}}function X(e){return isFinite(e[0][0])&&isFinite(e[0][1])&&isFinite(e[1][0])&&isFinite(e[1][1])&&isFinite(e[2][0])&&isFinite(e[2][1])}function V(e,t,n){if(!X(t))return;e.m_=t;if(n){var r=t[0][0]*t[1][1]-t[0][1]*t[1][0];e.lineScale_=s(i(r))}}function $(e){this.type_=e,this.x0_=0,this.y0_=0,this.r0_=0,this.x1_=0,this.y1_=0,this.r1_=0,this.colors_=[]}function J(e,t){Q(e);switch(t){case"repeat":case null:case"":this.repetition_="repeat";break;case"repeat-x":case"repeat-y":case"no-repeat":this.repetition_=t;break;default:K("SYNTAX_ERR")}this.src_=e.src,this.width_=e.width,this.height_=e.height}function K(e){throw new G(e)}function Q(e){(!e||e.nodeType!=1||e.tagName!="IMG")&&K("TYPE_MISMATCH_ERR"),e.readyState!="complete"&&K("INVALID_STATE_ERR")}function G(e){this.code=this[e],this.message=e+": DOM Exception "+this.code}var e=Math,t=e.round,n=e.sin,r=e.cos,i=e.abs,s=e.sqrt,o=10,u=o/2,a=+navigator.userAgent.match(/MSIE ([\d.]+)?/)[1],l=Array.prototype.slice;d(document);var v={init:function(e){var t=e||document;t.createElement("canvas"),t.attachEvent("onreadystatechange",c(this.init_,this,t))},init_:function(e){var t=e.getElementsByTagName("canvas");for(var n=0;n'),(f||l)&&w.push('
'),w.push('
'),(f||l)&&w.push("
"),w.push("
"),this.element_.insertAdjacentHTML("BeforeEnd",w.join(""))},q.stroke=function(e){var n=[],r=!1,i=10,s=10;n.push("f.x)f.x=c.x;if(a.y==null||c.yf.y)f.y=c.y}}n.push(' ">'),e?z(this,n,a,f):U(this,n),n.push(""),this.element_.insertAdjacentHTML("beforeEnd",n.join(""))},q.fill=function(){this.stroke(!0)},q.closePath=function(){this.currentPath_.push({type:"close"})},q.save=function(){var e={};x(this,e),this.aStack_.push(e),this.mStack_.push(this.m_),this.m_=S(E(),this.m_)},q.restore=function(){this.aStack_.length&&(x(this.aStack_.pop(),this),this.m_=this.mStack_.pop())},q.translate=function(e,t){var n=[[1,0,0],[0,1,0],[e,t,1]];V(this,S(n,this.m_),!1)},q.rotate=function(e){var t=r(e),i=n(e),s=[[t,i,0],[-i,t,0],[0,0,1]];V(this,S(s,this.m_),!1)},q.scale=function(e,t){this.arcScaleX_*=e,this.arcScaleY_*=t;var n=[[e,0,0],[0,t,0],[0,0,1]];V(this,S(n,this.m_),!0)},q.transform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,S(o,this.m_),!0)},q.setTransform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,o,!0)},q.drawText_=function(e,n,r,i,s){var u=this.m_,a=1e3,f=0,l=a,c={x:0,y:0},p=[],d=H(P(this.font),this.element_),v=B(d),m=this.element_.currentStyle,g=this.textAlign.toLowerCase();switch(g){case"left":case"center":case"right":break;case"end":g=m.direction=="ltr"?"right":"left";break;case"start":g=m.direction=="rtl"?"right":"left";break;default:g="left"}switch(this.textBaseline){case"hanging":case"top":c.y=d.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":c.y=-d.size/2.25}switch(g){case"right":f=a,l=.05;break;case"center":f=l=a/2}var y=W(this,n+c.x,r+c.y);p.push(''),s?U(this,p):z(this,p,{x:-f,y:0},{x:l,y:d.size});var b=u[0][0].toFixed(3)+","+u[1][0].toFixed(3)+","+u[0][1].toFixed(3)+","+u[1][1].toFixed(3)+",0,0",w=t(y.x/o)+","+t(y.y/o);p.push('','',''),this.element_.insertAdjacentHTML("beforeEnd",p.join(""))},q.fillText=function(e,t,n,r){this.drawText_(e,t,n,r,!1)},q.strokeText=function(e,t,n,r){this.drawText_(e,t,n,r,!0)},q.measureText=function(e){if(!this.textMeasureEl_){var t='';this.element_.insertAdjacentHTML("beforeEnd",t),this.textMeasureEl_=this.element_.lastChild}var n=this.element_.ownerDocument;return this.textMeasureEl_.innerHTML="",this.textMeasureEl_.style.font=this.font,this.textMeasureEl_.appendChild(n.createTextNode(e)),{width:this.textMeasureEl_.offsetWidth}},q.clip=function(){},q.arcTo=function(){},q.createPattern=function(e,t){return new J(e,t)},$.prototype.addColorStop=function(e,t){t=M(t),this.colors_.push({offset:e,color:t.color,alpha:t.alpha})};var Y=G.prototype=new Error;Y.INDEX_SIZE_ERR=1,Y.DOMSTRING_SIZE_ERR=2,Y.HIERARCHY_REQUEST_ERR=3,Y.WRONG_DOCUMENT_ERR=4,Y.INVALID_CHARACTER_ERR=5,Y.NO_DATA_ALLOWED_ERR=6,Y.NO_MODIFICATION_ALLOWED_ERR=7,Y.NOT_FOUND_ERR=8,Y.NOT_SUPPORTED_ERR=9,Y.INUSE_ATTRIBUTE_ERR=10,Y.INVALID_STATE_ERR=11,Y.SYNTAX_ERR=12,Y.INVALID_MODIFICATION_ERR=13,Y.NAMESPACE_ERR=14,Y.INVALID_ACCESS_ERR=15,Y.VALIDATION_ERR=16,Y.TYPE_MISMATCH_ERR=17,G_vmlCanvasManager=v,CanvasRenderingContext2D=I,CanvasGradient=$,CanvasPattern=J,DOMException=G}(),G_vmlCanvasManager}),define("zrender/tool/util",["require","../dep/excanvas"],function(e){function n(e){if(typeof e=="object"&&e!==null){var r=e;if(e instanceof Array){r=[];for(var i=0,s=e.length;if&&(f=e+c+n,u.width=f,r=!0),t+h>l&&(l=t+h+n,u.height=l,r=!0),e<-c&&(c=Math.ceil(-e/n)*n,f+=c,u.width=f,r=!0),t<-h&&(h=Math.ceil(-t/n)*n,l+=h,u.height=l,r=!0),r&&a.translate(c,h)}function v(){return{x:c,y:h}}function m(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n3&&(t=Array.prototype.slice.call(t,1));var r=this._handlers[e],i=r.length;for(var s=0;s4&&(t=Array.prototype.slice.call(t,1,t.length-1));var r=t[t.length-1],i=this._handlers[e],s=i.length;for(var o=0;o1)for(var e in arguments)console.log(arguments[e])}}),define("zrender/tool/guid",[],function(){var e=2311;return function(){return"zrender__"+e++}}),define("zrender/tool/vector",[],function(){var e=typeof Float32Array=="undefined"?Array:Float32Array,t={create:function(t,n){var r=new e(2);return r[0]=t||0,r[1]=n||0,r},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e},set:function(e,t,n){return e[0]=t,e[1]=n,e},add:function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e},scaleAndAdd:function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e},sub:function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e},len:function(e){return Math.sqrt(this.lenSquare(e))},lenSquare:function(e){return e[0]*e[0]+e[1]*e[1]},mul:function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e},div:function(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e},dot:function(e,t){return e[0]*t[0]+e[1]*t[1]},scale:function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e},normalize:function(e,n){var r=t.len(n);return r===0?(e[0]=0,e[1]=0):(e[0]=n[0]/r,e[1]=n[1]/r),e},distance:function(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))},distanceSquare:function(e,t){return(e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])},negate:function(e,t){return e[0]=-t[0],e[1]=-t[1],e},lerp:function(e,t,n,r){return e[0]=t[0]+r*(n[0]-t[0]),e[1]=t[1]+r*(n[1]-t[1]),e},applyTransform:function(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[2]*i+n[4],e[1]=n[1]*r+n[3]*i+n[5],e},min:function(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e},max:function(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}};return t.length=t.len,t.lengthSquare=t.lenSquare,t.dist=t.distance,t.distSquare=t.distanceSquare,t}),define("zrender/tool/matrix",[],function(){var e=typeof Float32Array=="undefined"?Array:Float32Array,t={create:function(){var n=new e(6);return t.identity(n),n},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},mul:function(e,t,n){return e[0]=t[0]*n[0]+t[2]*n[1],e[1]=t[1]*n[0]+t[3]*n[1],e[2]=t[0]*n[2]+t[2]*n[3],e[3]=t[1]*n[2]+t[3]*n[3],e[4]=t[0]*n[4]+t[2]*n[5]+t[4],e[5]=t[1]*n[4]+t[3]*n[5]+t[5],e},translate:function(e,t,n){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+n[0],e[5]=t[5]+n[1],e},rotate:function(e,t,n){var r=t[0],i=t[2],s=t[4],o=t[1],u=t[3],a=t[5],f=Math.sin(n),l=Math.cos(n);return e[0]=r*l+o*f,e[1]=-r*f+o*l,e[2]=i*l+u*f,e[3]=-i*f+l*u,e[4]=l*s+f*a,e[5]=l*a-f*s,e},scale:function(e,t,n){var r=n[0],i=n[1];return e[0]=t[0]*r,e[1]=t[1]*i,e[2]=t[2]*r,e[3]=t[3]*i,e[4]=t[4]*r,e[5]=t[5]*i,e},invert:function(e,t){var n=t[0],r=t[2],i=t[4],s=t[1],o=t[3],u=t[5],a=n*o-s*r;return a?(a=1/a,e[0]=o*a,e[1]=-s*a,e[2]=-r*a,e[3]=n*a,e[4]=(r*u-o*i)*a,e[5]=(s*i-n*u)*a,e):null},mulVector:function(e,t,n){var r=t[0],i=t[2],s=t[4],o=t[1],u=t[3],a=t[5];return e[0]=n[0]*r+n[1]*i+s,e[1]=n[0]*o+n[1]*u+a,e}};return t}),define("zrender/Handler",["require","./config","./tool/env","./tool/event","./tool/util","./tool/vector","./tool/matrix","./mixin/Eventful"],function(e){function c(e,t){return function(n){return e.call(t,n)}}function h(e,t){return function(n,r,i){return e.call(t,n,r,i)}}function p(e){var t=f.length;while(t--){var n=f[t];e["_"+n+"Handler"]=c(l[n],e)}}function m(e,t,n){if(this._draggingTarget&&this._draggingTarget.id==e.id||e.isSilent())return!1;var r=this._event;if(e.isCover(t,n)){e.hoverable&&this.storage.addHover(e);var i=e.parent;while(i){if(i.clipShape&&!i.clipShape.isCover(this._mouseX,this._mouseY))return!1;i=i.parent}return this._lastHover!=e&&(this._processOutShape(r),this._processDragLeave(r),this._lastHover=e,this._processDragEnter(r)),this._processOverShape(r),this._processDragOver(r),this._hasfound=1,!0}return!1}var t=e("./config"),n=e("./tool/env"),r=e("./tool/event"),i=e("./tool/util"),s=e("./tool/vector"),o=e("./tool/matrix"),u=t.EVENT,a=e("./mixin/Eventful"),f=["resize","click","dblclick","mousewheel","mousemove","mouseout","mouseup","mousedown","touchstart","touchend","touchmove"],l={resize:function(e){e=e||window.event,this._lastHover=null,this._isMouseDown=0,this.dispatch(u.RESIZE,e)},click:function(e){e=this._zrenderEventFixed(e);var t=this._lastHover;(t&&t.clickable||!t)&&this._dispatchAgency(t,u.CLICK,e),this._mousemoveHandler(e)},dblclick:function(e){e=this._zrenderEventFixed(e);var t=this._lastHover;(t&&t.clickable||!t)&&this._dispatchAgency(t,u.DBLCLICK,e),this._mousemoveHandler(e)},mousewheel:function(e){e=this._zrenderEventFixed(e);var t=e.wheelDelta||-e.detail,n=t>0?1.1:1/1.1,r=this.painter.getLayers(),i=!1;for(var s in r)if(s!=="hover"){var o=r[s],a=o.position;if(o.zoomable){o.__zoom=o.__zoom||1;var f=o.__zoom;f*=n,f=Math.max(Math.min(o.maxZoom,f),o.minZoom),n=f/o.__zoom,o.__zoom=f,a[0]-=(this._mouseX-a[0])*(n-1),a[1]-=(this._mouseY-a[1])*(n-1),o.scale[0]*=n,o.scale[1]*=n,o.dirty=!0,i=!0}}i&&this.painter.refresh(),this._dispatchAgency(this._lastHover,u.MOUSEWHEEL,e),this._mousemoveHandler(e)},mousemove:function(e){if(this.painter.isLoading())return;e=this._zrenderEventFixed(e),this._lastX=this._mouseX,this._lastY=this._mouseY,this._mouseX=r.getX(e),this._mouseY=r.getY(e);var t=this._mouseX-this._lastX,n=this._mouseY-this._lastY;this._processDragStart(e),this._hasfound=0,this._event=e,this._iterateAndFindHover();if(!this._hasfound){if(!this._draggingTarget||this._lastHover&&this._lastHover!=this._draggingTarget)this._processOutShape(e),this._processDragLeave(e);this._lastHover=null,this.storage.delHover(),this.painter.clearHover()}var i="default";if(this._draggingTarget)this.storage.drift(this._draggingTarget.id,t,n),this.storage.addHover(this._draggingTarget);else if(this._isMouseDown){var s=this.painter.getLayers(),o=!1;for(var a in s)if(a!=="hover"){var f=s[a];f.panable&&(i="move",f.position[0]+=t,f.position[1]+=n,o=!0,f.dirty=!0)}o&&this.painter.refresh()}this._draggingTarget||this._hasfound&&this._lastHover.draggable?i="move":this._hasfound&&this._lastHover.clickable&&(i="pointer"),this.root.style.cursor=i,this._dispatchAgency(this._lastHover,u.MOUSEMOVE,e),(this._draggingTarget||this._hasfound||this.storage.hasHoverShape())&&this.painter.refreshHover()},mouseout:function(e){e=this._zrenderEventFixed(e);var t=e.toElement||e.relatedTarget;if(t!=this.root)while(t&&t.nodeType!=9){if(t==this.root){this._mousemoveHandler(e);return}t=t.parentNode}e.zrenderX=this._lastX,e.zrenderY=this._lastY,this.root.style.cursor="default",this._isMouseDown=0,this._processOutShape(e),this._processDrop(e),this._processDragEnd(e),this.painter.isLoading()||this.painter.refreshHover(),this.dispatch(u.GLOBALOUT,e)},mousedown:function(e){if(this._lastDownButton==2){this._lastDownButton=e.button,this._mouseDownTarget=null;return}this._lastMouseDownMoment=new Date,e=this._zrenderEventFixed(e),this._isMouseDown=1,this._mouseDownTarget=this._lastHover,this._dispatchAgency(this._lastHover,u.MOUSEDOWN,e),this._lastDownButton=e.button},mouseup:function(e){e=this._zrenderEventFixed(e),this.root.style.cursor="default",this._isMouseDown=0,this._mouseDownTarget=null,this._dispatchAgency(this._lastHover,u.MOUSEUP,e),this._processDrop(e),this._processDragEnd(e)},touchstart:function(e){e=this._zrenderEventFixed(e,!0),this._lastTouchMoment=new Date,this._mobildFindFixed(e),this._mousedownHandler(e)},touchmove:function(e){e=this._zrenderEventFixed(e,!0),this._mousemoveHandler(e),this._isDragging&&r.stop(e)},touchend:function(e){e=this._zrenderEventFixed(e,!0),this._mouseupHandler(e);var t=new Date;t-this._lastTouchMoment=0;u--){var a=t[u];n!==a.zlevel&&(r=this.painter.getLayer(a.zlevel,r),i[0]=this._mouseX,i[1]=this._mouseY,r.needTransform&&(o.invert(e,r.transform),s.applyTransform(i,i,e)));if(this._findHover(a,i[0],i[1]))break}}}();var v=[{x:10},{x:-20},{x:10,y:10},{y:-20}];return d.prototype._mobildFindFixed=function(e){this._lastHover=null,this._mouseX=e.zrenderX,this._mouseY=e.zrenderY,this._event=e,this._iterateAndFindHover();for(var t=0;!this._lastHover&&t-n&&en||e<-n}function l(e,t,n,r,i){var s=1-i;return s*s*(s*e+3*i*t)+i*i*(i*r+3*s*n)}function c(e,t,n,r,i){var s=1-i;return 3*(((t-e)*s+2*(n-t)*i)*s+(r-n)*i*i)}function h(e,t,n,s,o,u){var f=s+3*(t-n)-e,l=3*(n-t*2+e),c=3*(t-e),h=e-o,p=l*l-3*f*c,d=l*c-9*f*h,v=c*c-3*l*h,m=0;if(a(p)&&a(d))if(a(l))u[0]=0;else{var g=-c/l;g>=0&&g<=1&&(u[m++]=g)}else{var y=d*d-4*p*v;if(a(y)){var b=d/p,g=-l/f+b,w=-b/2;g>=0&&g<=1&&(u[m++]=g),w>=0&&w<=1&&(u[m++]=w)}else if(y>0){var E=Math.sqrt(y),S=p*l+1.5*f*(-d+E),x=p*l+1.5*f*(-d-E);S<0?S=-Math.pow(-S,i):S=Math.pow(S,i),x<0?x=-Math.pow(-x,i):x=Math.pow(x,i);var g=(-l-(S+x))/(3*f);g>=0&&g<=1&&(u[m++]=g)}else{var T=(2*p*l-3*f*d)/(2*Math.sqrt(p*p*p)),N=Math.acos(T)/3,C=Math.sqrt(p),k=Math.cos(N),g=(-l-2*C*k)/(3*f),w=(-l+C*(k+r*Math.sin(N)))/(3*f),L=(-l+C*(k-r*Math.sin(N)))/(3*f);g>=0&&g<=1&&(u[m++]=g),w>=0&&w<=1&&(u[m++]=w),L>=0&&L<=1&&(u[m++]=L)}}return m}function p(e,t,n,r,i){var s=6*n-12*t+6*e,o=9*t+3*r-3*e-9*n,u=3*t-3*e,l=0;if(a(o)){if(f(s)){var c=-u/s;c>=0&&c<=1&&(i[l++]=c)}}else{var h=s*s-4*o*u;if(a(h))i[0]=-s/(2*o);else if(h>0){var p=Math.sqrt(h),c=(-s+p)/(2*o),d=(-s-p)/(2*o);c>=0&&c<=1&&(i[l++]=c),d>=0&&d<=1&&(i[l++]=d)}}return l}function d(e,t,n,r,i,s){var o=(t-e)*i+e,u=(n-t)*i+t,a=(r-n)*i+n,f=(u-o)*i+o,l=(a-u)*i+u,c=(l-f)*i+f;s[0]=e,s[1]=o,s[2]=f,s[3]=c,s[4]=c,s[5]=l,s[6]=a,s[7]=r}function v(e,r,i,a,f,c,h,p,d,v,m){var g,y=.005,b=Infinity;s[0]=d,s[1]=v;for(var w=0;w<1;w+=.05){o[0]=l(e,i,f,h,w),o[1]=l(r,a,c,p,w);var E=t.distSquare(s,o);E=0&&E=0&&c<=1&&(i[l++]=c)}}else{var h=o*o-4*s*u;if(a(h)){var c=-o/(2*s);c>=0&&c<=1&&(i[l++]=c)}else if(h>0){var p=Math.sqrt(h),c=(-o+p)/(2*s),d=(-o-p)/(2*s);c>=0&&c<=1&&(i[l++]=c),d>=0&&d<=1&&(i[l++]=d)}}return l}function b(e,t,n){var r=e+n-2*t;return r===0?.5:(e-t)/r}function w(e,r,i,a,f,l,c,h,p){var d,v=.005,g=Infinity;s[0]=c,s[1]=h;for(var y=0;y<1;y+=.05){o[0]=m(e,i,f,y),o[1]=m(r,a,l,y);var b=t.distSquare(s,o);b=0&&bt+u&&o>r+u||oe+u&&s>n+u||st+h&&c>i+h&&c>o+h&&c>a+h||ce+h&&l>r+h&&l>s+h&&l>u+h||lt+l&&f>i+l&&f>o+l||fe+l&&a>r+l&&a>s+l||an||h+ci&&(i+=f);var p=Math.atan2(a,u);return p<0&&(p+=f),p>=r&&p<=i||p+f>=r&&p+f<=i}function b(e,t,n,r){var t=Math.max(t,10);for(var i=0,s=e.length-1;in*n}function E(e,t,n,r,i,s){return i>=e&&i<=e+n&&s>=t&&s<=t+r}function S(e,t,n,r,i){return(r-e)*(r-e)+(i-t)*(i-t)=360)return!0;var r=(360-Math.atan2(n-e.y,t-e.x)/Math.PI*180)%360,i=(360+e.endAngle)%360,s=(360+e.startAngle)%360;return i>s?r>=s&&r<=i:!(r>=i&&r<=s)}function T(e,t,n){var r=e.length,i=0;for(var s=0,o=r-1;st&&s>r||si?o:0}function L(){var e=k[0];k[0]=k[1],k[1]=e}function A(e,t,r,i,s,o,u,a,f,l){if(l>t&&l>i&&l>o&&l>a||l1&&L(),d=n.cubicAt(t,i,o,a,k[0]),p>1&&(v=n.cubicAt(t,i,o,a,k[1]))),p==2?gt&&a>i&&a>o||a=0&&l<=1){var c=0,h=n.quadraticAt(t,i,o,l);for(var p=0;pu)continue;C[p]u?0:on||u<-n)return 0;var a=Math.sqrt(n*n-u*u);C[0]=-a,C[1]=a,s?(r=l(i),i=l(r)):(r=l(r),i=l(i)),r>i&&(i+=f);var c=0;for(var h=0;h<2;h++){var p=C[h];if(p+e>o){var d=Math.atan2(u,p),v=s?1:-1;d<0&&(d=f+d);if(d>=r&&d<=i||d+f>=r&&d+f<=i)d>Math.PI/2&&d0){h&&(s+=N(o,u,a,f,r,i));if(s!==0)return!0}a=b[b.length-2],f=b[b.length-1],l=!1}switch(d.command){case"M":o=b[0],u=b[1];break;case"L":if(c&&v(o,u,b[0],b[1],t,r,i))return!0;h&&(s+=N(o,u,b[0],b[1],r,i)),o=b[0],u=b[1];break;case"C":if(c&&m(o,u,b[0],b[1],b[2],b[3],b[4],b[5],t,r,i))return!0;h&&(s+=A(o,u,b[0],b[1],b[2],b[3],b[4],b[5],r,i)),o=b[4],u=b[5];break;case"Q":if(c&&g(o,u,b[0],b[1],b[2],b[3],t,r,i))return!0;h&&(s+=O(o,u,b[0],b[1],b[2],b[3],r,i)),o=b[2],u=b[3];break;case"A":var w=b[0],E=b[1],S=b[2],x=b[3],T=b[4],C=b[5],k=Math.cos(T)*S+w,L=Math.sin(T)*x+E;s+=N(o,u,k,L);var _=(r-w)*x/S+w;if(c&&y(w,E,x,T,T+C,1-b[7],t,_,i))return!0;h&&(s+=M(w,E,x,T,T+C,1-b[7],_,i)),o=Math.cos(T+C)*S+w,u=Math.sin(T+C)*x+E;break;case"z":if(c&&v(o,u,a,f,t,r,i))return!0;l=!0}}return h&&(s+=N(o,u,a,f,r,i)),s!==0}function D(e,n){var s=e+":"+n;if(i[s])return i[s];r=r||t.getContext(),r.save(),n&&(r.font=n),e=(e+"").split("\n");var u=0;for(var f=0,l=e.length;fa&&(o=0,i={}),u}function P(e,n){var i=e+":"+n;if(s[i])return s[i];r=r||t.getContext(),r.save(),n&&(r.font=n),e=(e+"").split("\n");var o=(r.measureText("国").width+2)*e.length;return r.restore(),s[i]=o,++u>a&&(u=0,s={}),o}var t=e("./util"),n=e("./curve"),r,i={},s={},o=0,u=0,a=5e3,f=Math.PI*2,C=[-1,-1,-1],k=[-1,-1];return{isInside:c,isOutside:d,getTextWidth:D,getTextHeight:P,isInsidePath:_,isInsidePolygon:T,isInsideSector:x,isInsideCircle:S,isInsideLine:v,isInsideRect:E,isInsideBrokenLine:b}}),define("zrender/mixin/Transformable",["require","../tool/matrix","../tool/vector"],function(e){function s(e){return e>-i&&ei||e<-i}var t=e("../tool/matrix"),n=e("../tool/vector"),r=[0,0],i=5e-5,u=function(){this.position||(this.position=[0,0]),typeof this.rotation=="undefined"&&(this.rotation=[0,0,0]),this.scale||(this.scale=[1,1,0,0]),this.needLocalTransform=!1,this.needTransform=!1};return u.prototype={constructor:u,updateNeedTransform:function(){this.needLocalTransform=o(this.rotation[0])||o(this.position[0])||o(this.position[1])||o(this.scale[0]-1)||o(this.scale[1]-1)},updateTransform:function(){this.updateNeedTransform(),this.parent?this.needTransform=this.needLocalTransform||this.parent.needTransform:this.needTransform=this.needLocalTransform;if(!this.needTransform)return;var e=this.transform||t.create();t.identity(e);if(this.needLocalTransform){if(o(this.scale[0])||o(this.scale[1])){r[0]=-this.scale[2]||0,r[1]=-this.scale[3]||0;var n=o(r[0])||o(r[1]);n&&t.translate(e,e,r),t.scale(e,e,this.scale),n&&(r[0]=-r[0],r[1]=-r[1],t.translate(e,e,r))}if(this.rotation instanceof Array){if(this.rotation[0]!==0){r[0]=-this.rotation[1]||0,r[1]=-this.rotation[2]||0;var n=o(r[0])||o(r[1]);n&&t.translate(e,e,r),t.rotate(e,e,this.rotation[0]),n&&(r[0]=-r[0],r[1]=-r[1],t.translate(e,e,r))}}else this.rotation!==0&&t.rotate(e,e,this.rotation);(o(this.position[0])||o(this.position[1]))&&t.translate(e,e,this.position)}this.transform=e,this.parent&&this.parent.needTransform&&(this.needLocalTransform?t.mul(this.transform,this.parent.transform,this.transform):t.copy(this.transform,this.parent.transform))},setTransform:function(e){if(this.needTransform){var t=this.transform;e.transform(t[0],t[1],t[2],t[3],t[4],t[5])}},lookAt:function(){var e=n.create();return function(r){this.transform||(this.transform=t.create());var i=this.transform;n.sub(e,r,this.position);if(s(e[0])&&s(e[1]))return;n.normalize(e,e),i[2]=e[0]*this.scale[1],i[3]=e[1]*this.scale[1],i[0]=e[1]*this.scale[0],i[1]=-e[0]*this.scale[0],i[4]=this.position[0],i[5]=this.position[1],this.decomposeTransform()}}(),decomposeTransform:function(){if(!this.transform)return;var e=this.transform,t=e[0]*e[0]+e[1]*e[1],n=this.position,r=this.scale,i=this.rotation;o(t-1)&&(t=Math.sqrt(t));var s=e[2]*e[2]+e[3]*e[3];o(s-1)&&(s=Math.sqrt(s)),n[0]=e[4],n[1]=e[5],r[0]=t,r[1]=s,r[2]=r[3]=0,i[0]=Math.atan2(-e[1]/s,e[0]/t),i[1]=i[2]=0}},u}),define("zrender/tool/color",["require","../tool/util"],function(e){function f(e){r=e}function l(){r=i}function c(e,t){return e|=0,t=t||r,t[e%t.length]}function h(e){s=e}function p(){o=s}function d(){return s}function v(e,r,i,s,o,u,a){n||(n=t.getContext());var f=n.createRadialGradient(e,r,i,s,o,u);for(var l=0,c=a.length;l1)for(var i=0,s=r-1;i1?Math.ceil(e):e});if(t.indexOf("hex")>-1)return"#"+((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1);if(t.indexOf("hs")>-1){var n=q(e.slice(1,3),function(e){return e+"%"});e[1]=n[0],e[2]=n[1]}return t.indexOf("a")>-1?(e.length===3&&e.push(1),e[3]=R(e[3],[0,1]),t+"("+e.slice(0,4).join(",")+")"):t+"("+e.slice(0,3).join(",")+")"}}function w(e){e=_(e),e.indexOf("rgba")<0&&(e=S(e));var t=[],n=0;return e.replace(/[\d.]+/g,function(e){n<3?e|=0:e=+e,t[n++]=e}),t}function E(e,t){var n=F(e),r=n[3];return typeof r=="undefined"&&(r=1),e.indexOf("hsb")>-1?n=U(n):e.indexOf("hsl")>-1&&(n=z(n)),t.indexOf("hsb")>-1||t.indexOf("hsv")>-1?n=X(n):t.indexOf("hsl")>-1&&(n=V(n)),n[3]=r,b(n,t)}function S(e){return E(e,"rgba")}function x(e){return E(e,"rgb")}function T(e){return E(e,"hex")}function N(e){return E(e,"hsva")}function C(e){return E(e,"hsv")}function k(e){return E(e,"hsba")}function L(e){return E(e,"hsb")}function A(e){return E(e,"hsla")}function O(e){return E(e,"hsl")}function M(e){for(var t in a)if(T(a[t])===T(e))return t;return null}function _(e){return String(e).replace(/\s+/g,"")}function D(e){a[e]&&(e=a[e]),e=_(e),e=e.replace(/hsv/i,"hsb");if(/^#[\da-f]{3}$/i.test(e)){e=parseInt(e.slice(1),16);var t=(e&3840)<<8,n=(e&240)<<4,r=e&15;e="#"+((1<<24)+(t<<4)+t+(n<<4)+n+(r<<4)+r).toString(16).slice(1)}return e}function P(e,t){var n=t>0?1:-1;typeof t=="undefined"&&(t=0),t=Math.abs(t)>1?1:Math.abs(t),e=x(e);var r=F(e);for(var i=0;i<3;i++)n===1?r[i]=r[i]*(1-t)|0:r[i]=(255-r[i])*t+r[i]|0;return"rgb("+r.join(",")+")"}function H(e){var t=F(S(e));return t=q(t,function(e){return 255-e}),b(t,"rgb")}function B(e,t,n){typeof n=="undefined"&&(n=.5),n=1-R(n,[0,1]);var r=n*2-1,i=F(S(e)),s=F(S(t)),o=i[3]-s[3],u=((r*o===-1?r:(r+o)/(1+r*o))+1)/2,a=1-u,f=[];for(var l=0;l<3;l++)f[l]=i[l]*u+s[l]*a;var c=i[3]*n+s[3]*(1-n);return c=Math.max(0,Math.min(1,c)),i[3]===1&&s[3]===1?b(f,"rgb"):(f[3]=c,b(f,"rgba"))}function j(){return"#"+Math.random().toString(16).slice(2,8)}function F(e){e=D(e);var t=e.match(u);if(t===null)throw new Error("The color format error");var n,r,i=[],s;if(t[2])n=t[2].replace("#","").split(""),s=[n[0]+n[1],n[2]+n[3],n[4]+n[5]],i=q(s,function(e){return R(parseInt(e,16),[0,255])});else if(t[4]){var o=t[4].split(",");r=o[3],s=o.slice(0,3),i=q(s,function(e){return e=Math.floor(e.indexOf("%")>0?parseInt(e,0)*2.55:e),R(e,[0,255])}),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}else if(t[5]||t[6]){var a=(t[5]||t[6]).split(","),f=parseInt(a[0],0)/360,l=a[1],c=a[2];r=a[3],i=q([l,c],function(e){return R(parseFloat(e)/100,[0,1])}),i.unshift(f),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}return i}function I(e,t){t===null&&(t=1);var n=F(S(e));return n[3]=R(Number(t).toFixed(4),[0,1]),b(n,"rgba")}function q(e,t){if(typeof t!="function")throw new TypeError;var n=e?e.length:0;for(var r=0;r=t[1]&&(e=t[1]),e}function U(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u=t*6;u===6&&(u=0);var a=u|0,f=r*(1-n),l=r*(1-n*(u-a)),c=r*(1-n*(1-(u-a))),h=0,p=0,d=0;a===0?(h=r,p=c,d=f):a===1?(h=l,p=r,d=f):a===2?(h=f,p=r,d=c):a===3?(h=f,p=l,d=r):a===4?(h=c,p=f,d=r):(h=r,p=f,d=l),i=h*255,s=p*255,o=d*255}return[i,s,o]}function z(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u;r<.5?u=r*(1+n):u=r+n-n*r;var a=2*r-u;i=255*W(a,u,t+1/3),s=255*W(a,u,t),o=255*W(a,u,t-1/3)}return[i,s,o]}function W(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function X(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=s,a,f;if(o===0)a=0,f=0;else{f=o/s;var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}function V(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=(s+i)/2,a,f;if(o===0)a=0,f=0;else{u<.5?f=o/(s+i):f=o/(2-s-i);var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}var t=e("../tool/util"),n,r=["#ff9277"," #dddd00"," #ffc877"," #bbe3ff"," #d5ffbb","#bbbbff"," #ddb000"," #b0dd00"," #e2bbff"," #ffbbe3","#ff7777"," #ff9900"," #83dd00"," #77e3ff"," #778fff","#c877ff"," #ff77ab"," #ff6600"," #aa8800"," #77c7ff","#ad77ff"," #ff77ff"," #dd0083"," #777700"," #00aa00","#0088aa"," #8400dd"," #aa0088"," #dd0000"," #772e00"],i=r,s="rgba(255,255,0,0.5)",o=s,u=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,a={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#789",lightslategrey:"#789",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#f0f",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"};return{customPalette:f,resetPalette:l,getColor:c,getHighlightColor:d,customHighlight:h,resetHighlight:p,getRadialGradient:v,getLinearGradient:m,getGradientColors:y,getStepColors:g,reverse:H,mix:B,lift:P,trim:_,random:j,toRGB:x,toRGBA:S,toHex:T,toHSL:O,toHSLA:A,toHSB:L,toHSBA:k,toHSV:C,toHSVA:N,toName:M,toColor:b,toArray:w,alpha:I,getData:F}}),define("zrender/shape/Base",["require","../tool/matrix","../tool/guid","../tool/util","../tool/log","../mixin/Transformable","../mixin/Eventful","../tool/area","../tool/area","../tool/color","../tool/area"],function(e){function u(t,n,r,i,s,o,u){s&&(t.font=s),t.textAlign=o,t.textBaseline=u;var f=a(n,r,i,s,o,u);n=(n+"").split("\n");var l=e("../tool/area").getTextHeight("国",s);switch(u){case"top":i=f.y;break;case"bottom":i=f.y+l;break;default:i=f.y+l/2}for(var c=0,h=n.length;c0&&e.stroke();break;default:e.fill()}this.drawText(e,n,this.style),e.restore()};var l=[["color","fillStyle"],["strokeColor","strokeStyle"],["opacity","globalAlpha"],["lineCap","lineCap"],["lineJoin","lineJoin"],["miterLimit","miterLimit"],["lineWidth","lineWidth"],["shadowBlur","shadowBlur"],["shadowColor","shadowColor"],["shadowOffsetX","shadowOffsetX"],["shadowOffsetY","shadowOffsetY"]];return f.prototype.setContext=function(e,t){for(var n=0,r=l.length;n=i.x&&t<=i.x+i.width&&n>=i.y&&n<=i.y+i.height?e("../tool/area").isInside(this,this.style,t,n):!1},f.prototype.drawText=function(e,t,n){if(typeof t.text=="undefined"||t.text===!1)return;var r=t.textColor||t.color||t.strokeColor;e.fillStyle=r;var i=10,s,o,a,f,l=t.textPosition||this.textPosition||"top";switch(l){case"inside":case"top":case"bottom":case"left":case"right":if(this.getRect){var c=(n||t).__rect||this.getRect(n||t);switch(l){case"inside":a=c.x+c.width/2,f=c.y+c.height/2,s="center",o="middle",t.brushType!="stroke"&&r==t.color&&(e.fillStyle="#fff");break;case"left":a=c.x-i,f=c.y+c.height/2,s="end",o="middle";break;case"right":a=c.x+c.width+i,f=c.y+c.height/2,s="start",o="middle";break;case"top":a=c.x+c.width/2,f=c.y-i,s="center",o="bottom";break;case"bottom":a=c.x+c.width/2,f=c.y+c.height+i,s="center",o="top"}}break;case"start":case"end":var h,p,d,v;if(typeof t.pointList!="undefined"){var m=t.pointList;if(m.length<2)return;var g=m.length;switch(l){case"start":h=m[0][0],p=m[1][0],d=m[0][1],v=m[1][1];break;case"end":h=m[g-2][0],p=m[g-1][0],d=m[g-2][1],v=m[g-1][1]}}else h=t.xStart||0,p=t.xEnd||0,d=t.yStart||0,v=t.yEnd||0;switch(l){case"start":s=hi&&(c=u+a,u*=i/c,a*=i/c),f+l>i&&(c=f+l,f*=i/c,l*=i/c),a+f>s&&(c=a+f,a*=s/c,f*=s/c),u+l>s&&(c=u+l,u*=s/c,l*=s/c),e.moveTo(n+u,r),e.lineTo(n+i-a,r),a!==0&&e.quadraticCurveTo(n+i,r,n+i,r+a),e.lineTo(n+i,r+s-f),f!==0&&e.quadraticCurveTo(n+i,r+s,n+i-f,r+s),e.lineTo(n+l,r+s),l!==0&&e.quadraticCurveTo(n,r+s,n,r+s-l),e.lineTo(n,r+u),u!==0&&e.quadraticCurveTo(n,r,n+u,r)},buildPath:function(e,t){t.radius?this._buildRadiusPath(e,t):(e.moveTo(t.x,t.y),e.lineTo(t.x+t.width,t.y),e.lineTo(t.x+t.width,t.y+t.height),e.lineTo(t.x,t.y+t.height),e.lineTo(t.x,t.y)),e.closePath();return},getRect:function(e){if(e.__rect)return e.__rect;var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,e.__rect={x:Math.round(e.x-t/2),y:Math.round(e.y-t/2),width:e.width+t,height:e.height+t},e.__rect}},e("../tool/util").inherits(n,t),n}),define("zrender/loadingEffect/Base",["require","../tool/util","../shape/Text","../shape/Rectangle"],function(e){function o(e){this.setOptions(e)}var t=e("../tool/util"),n=e("../shape/Text"),r=e("../shape/Rectangle"),i="Loading...",s="normal 16px Arial";return o.prototype.createTextShape=function(e){return new n({highlightStyle:t.merge({x:this.canvasWidth/2,y:this.canvasHeight/2,text:i,textAlign:"center",textBaseline:"middle",textFont:s,color:"#333",brushType:"fill"},e,!0)})},o.prototype.createBackgroundShape=function(e){return new r({highlightStyle:{x:0,y:0,width:this.canvasWidth,height:this.canvasHeight,brushType:"fill",color:e}})},o.prototype.start=function(e){function t(t){e.storage.addHover(t)}function n(){e.refreshHover()}this.canvasWidth=e._width,this.canvasHeight=e._height,this.loadingTimer=this._start(t,n)},o.prototype._start=function(){return setInterval(function(){},1e4)},o.prototype.stop=function(){clearInterval(this.loadingTimer)},o.prototype.setOptions=function(e){this.options=e||{}},o.prototype.adjust=function(e,t){return e<=t[0]?e=t[0]:e>=t[1]&&(e=t[1]),e},o.prototype.getLocation=function(e,t,n){var r=e.x!=null?e.x:"center";switch(r){case"center":r=Math.floor((this.canvasWidth-t)/2);break;case"left":r=0;break;case"right":r=this.canvasWidth-t}var i=e.y!=null?e.y:"center";switch(i){case"center":i=Math.floor((this.canvasHeight-n)/2);break;case"top":i=0;break;case"bottom":i=this.canvasHeight-n}return{x:r,y:i,width:t,height:n}},o}),define("zrender/shape/Image",["require","./Base","../tool/util"],function(e){var t=[],n,r=e("./Base"),i=function(e){r.call(this,e),this._imageCache={}};return i.prototype={type:"image",brush:function(e,r,i){var s=this.style||{};r&&(s=this.getHighlightStyle(s,this.highlightStyle||{}));var o=s.image,u=this;if(typeof o=="string"){var a=o;this._imageCache[a]?o=this._imageCache[a]:(o=new Image,o.onload=function(){o.onload=null,clearTimeout(n),t.push(u),n=setTimeout(function(){i&&i(t),t=[]},10)},o.src=a,this._imageCache[a]=o)}if(o){if(o.nodeName.toUpperCase()=="IMG")if(window.ActiveXObject){if(o.readyState!="complete")return}else if(!o.complete)return;var f=s.width||o.width,l=s.height||o.height,c=s.x,h=s.y;if(!o.width||!o.height)return;e.save(),this.setContext(e,s),this.setTransform(e);if(s.sWidth&&s.sHeight){var p=s.sx||0,d=s.sy||0;e.drawImage(o,p,d,s.sWidth,s.sHeight,c,h,f,l)}else if(s.sx&&s.sy){var p=s.sx,d=s.sy,v=f-p,m=l-d;e.drawImage(o,p,d,v,m,c,h,f,l)}else e.drawImage(o,c,h,f,l);s.width||(s.width=f),s.height||(s.height=l),this.style.width||(this.style.width=f),this.style.height||(this.style.height=l),this.drawText(e,s,this.style),e.restore()}},getRect:function(e){return{x:e.x,y:e.y,width:e.width,height:e.height}},clearCache:function(){this._imageCache={}}},e("../tool/util").inherits(i,r),i}),define("zrender/Painter",["require","./config","./tool/util","./tool/log","./tool/matrix","./loadingEffect/Base","./mixin/Transformable","./shape/Image"],function(e){function f(){return!1}function l(){}function h(e,t,n){var r=document.createElement(t),i=n._width,s=n._height;return r.style.position="absolute",r.style.left=0,r.style.top=0,r.style.width=i+"px",r.style.height=s+"px",r.setAttribute("width",i*u),r.setAttribute("height",s*u),r.setAttribute("data-zr-dom-id",e),r}var t=e("./config"),n=e("./tool/util"),r=e("./tool/log"),i=e("./tool/matrix"),s=e("./loadingEffect/Base"),o=e("./mixin/Transformable"),u=window.devicePixelRatio||1;u=Math.max(u,1);var a=window.G_vmlCanvasManager,c=function(e,t){this.root=e,this.storage=t,e.innerHTML="",this._width=this._getWidth(),this._height=this._getHeight();var n=document.createElement("div");this._domRoot=n,n.style.position="relative",n.style.overflow="hidden",n.style.width=this._width+"px",n.style.height=this._height+"px",e.appendChild(n),this._layers={},this._layerConfig={},this._loadingEffect=new s({}),this.shapeToImage=this._createShapeToImageProcessor(),this._bgDom=h("bg","div",this),n.appendChild(this._bgDom),this._bgDom.onselectstart=f,this._bgDom.style["-webkit-user-select"]="none",this._bgDom.style["user-select"]="none";var r=new p("_zrender_hover_",this);this._layers.hover=r,n.appendChild(r.dom),r.initContext(),r.dom.onselectstart=f,r.dom.style["-webkit-user-select"]="none",r.dom.style["user-select"]="none";var i=this;this.updatePainter=function(e,t){i.refreshShapes(e,t)}};c.prototype.render=function(e){return this.isLoading()&&this.hideLoading(),this.refresh(e,!0),this},c.prototype.refresh=function(e,t){var n=this.storage.getShapeList(!0);return this._paintList(n,t),typeof e=="function"&&e(),this},c.prototype._paintList=function(e,n){typeof n=="undefined"&&(n=!1),this._updateLayerStatus(e);var s,o,u;for(var f in this._layers)f!=="hover"&&(this._layers[f].unusedCount++,this._layers[f].updateTransform());var l=[];for(var c=0,h=e.length;c0},s.prototype.addRoot=function(e){e instanceof n&&e.addChildrenToStorage(this),this.addToMap(e),this._roots.push(e)},s.prototype.delRoot=function(e){if(typeof e=="undefined"){for(var r=0;r=0&&(this.delFromMap(o.id),this._roots.splice(u,1),o instanceof n&&o.delChildrenFromStorage(this))},s.prototype.addToMap=function(e){return e instanceof n&&(e._storage=this),e.modSelf(),this._elements[e.id]=e,this},s.prototype.get=function(e){return this._elements[e]},s.prototype.delFromMap=function(e){var t=this._elements[e];return t&&(delete this._elements[e],t instanceof n&&(t._storage=null)),this},s.prototype.dispose=function(){this._elements=this._renderList=this._roots=this._hoverElements=null},s}),define("zrender/animation/easing",[],function(){var e={Linear:function(e){return e},QuadraticIn:function(e){return e*e},QuadraticOut:function(e){return e*(2-e)},QuadraticInOut:function(e){return(e*=2)<1?.5*e*e:-0.5*(--e*(e-2)-1)},CubicIn:function(e){return e*e*e},CubicOut:function(e){return--e*e*e+1},CubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},QuarticIn:function(e){return e*e*e*e},QuarticOut:function(e){return 1- --e*e*e*e},QuarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-0.5*((e-=2)*e*e*e-2)},QuinticIn:function(e){return e*e*e*e*e},QuinticOut:function(e){return--e*e*e*e*e+1},QuinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},SinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},SinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},SinusoidalInOut:function(e){return.5*(1-Math.cos(Math.PI*e))},ExponentialIn:function(e){return e===0?0:Math.pow(1024,e-1)},ExponentialOut:function(e){return e===1?1:1-Math.pow(2,-10*e)},ExponentialInOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)},CircularIn:function(e){return 1-Math.sqrt(1-e*e)},CircularOut:function(e){return Math.sqrt(1- --e*e)},CircularInOut:function(e){return(e*=2)<1?-0.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},ElasticIn:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),-(n*Math.pow(2,10*(e-=1))*Math.sin((e-t)*2*Math.PI/r)))},ElasticOut:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*e)*Math.sin((e-t)*2*Math.PI/r)+1)},ElasticInOut:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),(e*=2)<1?-0.5*n*Math.pow(2,10*(e-=1))*Math.sin((e-t)*2*Math.PI/r):n*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*2*Math.PI/r)*.5+1)},BackIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},BackOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},BackInOut:function(e){var t=2.5949095;return(e*=2)<1?.5*e*e*((t+1)*e-t):.5*((e-=2)*e*((t+1)*e+t)+2)},BounceIn:function(t){return 1-e.BounceOut(1-t)},BounceOut:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},BounceInOut:function(t){return t<.5?e.BounceIn(t*2)*.5:e.BounceOut(t*2-1)*.5+.5}};return e}),define("zrender/animation/Clip",["require","./easing"],function(e){function n(e){this._targetPool=e.target||{},this._targetPool instanceof Array||(this._targetPool=[this._targetPool]),this._life=e.life||1e3,this._delay=e.delay||0,this._startTime=(new Date).getTime()+this._delay,this._endTime=this._startTime+this._life*1e3,this.loop=typeof e.loop=="undefined"?!1:e.loop,this.gap=e.gap||0,this.easing=e.easing||"Linear",this.onframe=e.onframe,this.ondestroy=e.ondestroy,this.onrestart=e.onrestart}var t=e("./easing");return n.prototype={step:function(e){var n=(e-this._startTime)/this._life;if(n<0)return;n=Math.min(n,1);var r=typeof this.easing=="string"?t[this.easing]:this.easing,i=typeof r=="function"?r(n):n;return this.fire("frame",i),n==1?this.loop?(this.restart(),"restart"):(this._needsRemove=!0,"destroy"):null},restart:function(){var e=(new Date).getTime(),t=(e-this._startTime)%this._life;this._startTime=(new Date).getTime()-t+this.gap},fire:function(e,t){for(var n=0,r=this._targetPool.length;n=0&&this._clips.splice(t,1)},_update:function(){var e=(new Date).getTime(),t=e-this._time,n=this._clips,r=n.length,i=[],s=[];for(var o=0;o=0;N--)if(x[N]<=t)break;N=Math.min(N,g-2)}else{for(N=k;Nt)break;N=Math.min(N-1,g-2)}k=N,L=t;var n=x[N+1]-x[N];if(n===0)return;O=(t-x[N])/n;if(u){_=T[N],M=T[N===0?N:N-1],D=T[N>g-2?g-1:N+1],P=T[N>g-3?g-1:N+2];if(b)p(M,_,D,P,O,O*O,O*O*O,s(e,v),E);else{var a;w?(a=p(M,_,D,P,O,O*O,O*O*O,H,1),a=m(H)):a=d(M,_,D,P,O,O*O,O*O*O),i(e,v,a)}}else if(b)c(T[N],T[N+1],O,s(e,v),E);else{var a;w?(c(T[N],T[N+1],O,H,1),a=m(H)):a=l(T[N],T[N+1],O),i(e,v,a)}for(N=0;N1?"."+e[1]:""))}return{parsePercent:t,parseCenter:n,parseRadius:r,addCommas:i}}),define("echarts/component/base",["require","../config","../util/ecQuery","../util/number","zrender/tool/util","zrender/tool/env"],function(e){function s(e,t,n,r,i){this.ecTheme=e,this.messageCenter=t,this.zr=n,this.option=r,this.series=r.series,this.myChart=i,this.component=i.component,this._zlevelBase=this.getZlevelBase(),this.shapeList=[],this.effectList=[];var s=this;s.hoverConnect=function(e){var t=(e.target||{}).hoverConnect;if(t){var n=10,r;if(t instanceof Array)for(var i=0,o=t.length;i4?a*r(2*i/s)/r(i/s):a/3);var l=i/s,c=-i/2,h=o+a*r(c),p=u+a*n(c);c+=l;var d=t.pointList=[];d.push([h,p]);for(var v=0,m=s*2-1,g;v=r.x-i&&e<=r.x+r.width+i&&t>=r.y-i&&t<=r.y+r.height+i?!0:!1}},t.inherits(C,N),C}),define("zrender/shape/util/dashedLineTo",[],function(){var e=[5,5];return function(t,n,r,i,s,o){if(t.setLineDash){e[0]=e[1]=o,t.setLineDash(e),t.moveTo(n,r),t.lineTo(i,s);return}o=typeof o!="number"?5:o;var u=i-n,a=s-r,f=Math.floor(Math.sqrt(u*u+a*a)/o);u/=f,a/=f;var l=!0;for(var c=0;cs-2?s-1:c+1],m=e[c>s-3?s-1:c+2]);var g=h*h,y=h*g;o.push([n(p[0],d[0],v[0],m[0],h,g,y),n(p[1],d[1],v[1],m[1],h,g,y)])}return o}}),define("zrender/shape/util/smoothBezier",["require","../../tool/vector"],function(e){var t=e("../../tool/vector");return function(e,n,r,i){var s=[],o=[],u=[],a=[],f,l,c=!!i,h,p;if(c){h=[Infinity,Infinity],p=[-Infinity,-Infinity];for(var d=0,v=e.length;d0&&(n.brushType=="stroke"||n.brushType=="both")&&(r||(e.beginPath(),this.buildPath(e,n)),e.stroke()),this.drawText(e,n,this.style),e.restore();return},buildPath:function(e,t){var s=t.pointList;if(s.length<2)return;if(t.smooth&&t.smooth!=="spline"){var o=r(s,t.smooth,!0,t.smoothConstraint);e.moveTo(s[0][0],s[0][1]);var u,a,f,l=s.length;for(var c=0;cn&&(n=s[o][0]),s[o][1]i&&(i=s[o][1]);var a;return e.brushType=="stroke"||e.brushType=="fill"?a=e.lineWidth||1:a=0,e.__rect={x:Math.round(t-a/2),y:Math.round(r-a/2),width:n-t+a,height:i-r+a},e.__rect}},e("../tool/util").inherits(s,t),s}),define("zrender/shape/BrokenLine",["require","./Base","./util/smoothSpline","./util/smoothBezier","./util/dashedLineTo","./Polygon","../tool/util"],function(e){var t=e("./Base"),n=e("./util/smoothSpline"),r=e("./util/smoothBezier"),i=e("./util/dashedLineTo"),s=function(e){this.brushTypeOnly="stroke",this.textPosition="end",t.call(this,e)};return s.prototype={type:"broken-line",buildPath:function(e,t){var s=t.pointList;if(s.length<2)return;var o=Math.min(t.pointList.length,Math.round(t.pointListLength||t.pointList.length));if(t.smooth&&t.smooth!=="spline"){var u=r(s,t.smooth,!1,t.smoothConstraint);e.moveTo(s[0][0],s[0][1]);var a,f,l;for(var c=0;cs?a>u?l=Math.PI*2-l+f:l+=f:a>u?l+=Math.PI-f:l=Math.PI-l-f:s>o?u>a?l=Math.PI*2-l+f:l+=f:u>a?l+=Math.PI-f:l=Math.PI-l-f;var c=Math.PI/8,h=n===0?s:o,p=n===0?u:a,d=[[h+i*Math.cos(l-c),p-i*Math.sin(l-c)],[h+i*.6*Math.cos(l),p-i*.6*Math.sin(l)],[h+i*Math.cos(l+c),p-i*Math.sin(l+c)]];e.moveTo(h,p);for(var v=0,m=d.length;v=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height?this.style.smooth!=="spline"?a.isInside(i,this.style,e,t):a.isInside(o,this.style,e,t):!1}},c.inherits(h,t),h}),define("echarts/util/shape/normalIsCover",[],function(){return function(e,t){var n=this.getTansform(e,t);e=n[0],t=n[1];var r=this.style.__rect;return r||(r=this.style.__rect=this.getRect(this.style)),e>=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height}}),define("echarts/util/shape/Symbol",["require","zrender/shape/Base","zrender/shape/Polygon","zrender/tool/util","./normalIsCover"],function(e){function s(e){t.call(this,e)}var t=e("zrender/shape/Base"),n=e("zrender/shape/Polygon"),r=new n({}),i=e("zrender/tool/util");return s.prototype={type:"symbol",buildPath:function(e,t){var n=t.pointList,r=n.length;if(r===0)return;var i=1e4,s=Math.ceil(r/i),o,u,a=n[0]instanceof Array,f=t.size?t.size:2,l=f,c=f/2,h=Math.PI*2,p,d,v;for(var m=0;mr?r:u;for(var g=o;g0&&e.stroke();break;case"stroke":t.lineWidth>0&&e.stroke();break;default:e.fill()}}},getRect:function(e){return e.__rect||r.getRect(e)},isCover:e("./normalIsCover")},i.inherits(s,t),s}),define("echarts/util/ecData",[],function(){function e(e,t,n,r,i,s,o,u){var a;return typeof r!="undefined"&&(a=r.value==null?r:r.value),e._echartsData={_series:t,_seriesIndex:n,_data:r,_dataIndex:i,_name:s,_value:a,_special:o,_special2:u},e._echartsData}function t(e,t){var n=e._echartsData;if(!t)return n;switch(t){case"series":case"seriesIndex":case"data":case"dataIndex":case"name":case"value":case"special":case"special2":return n&&n["_"+t]}return null}function n(e,t,n){e._echartsData=e._echartsData||{};switch(t){case"series":case"seriesIndex":case"data":case"dataIndex":case"name":case"value":case"special":case"special2":e._echartsData["_"+t]=n}}function r(e,t){t._echartsData={_series:e._echartsData._series,_seriesIndex:e._echartsData._seriesIndex,_data:e._echartsData._data,_dataIndex:e._echartsData._dataIndex,_name:e._echartsData._name,_value:e._echartsData._value,_special:e._echartsData._special,_special2:e._echartsData._special2}}return{pack:e,set:n,get:t,clone:r}}),define("echarts/util/ecAnimation",["require","zrender/tool/util","zrender/shape/Polygon"],function(e){function n(e,n,r,i,s){var o=r.style.pointList,u=o.length,a;if(!n){a=[];if(r._orient!="vertical"){var f=o[0][1];for(var l=0;l1?t.symbol:[t.symbol[0],t.symbol[0]]:[t.symbol,t.symbol],t.symbolSize=t.symbolSize instanceof Array?t.symbolSize.length>1?t.symbolSize:[t.symbolSize[0],t.symbolSize[0]]:[t.symbolSize,t.symbolSize],t.symbolRotate=t.symbolRotate instanceof Array?t.symbolRotate.length>1?t.symbolRotate:[t.symbolRotate[0],t.symbolRotate[0]]:[t.symbolRotate,t.symbolRotate],t.name=n.name;var i=[],u=t.data,a,f=r.dataRange,c=r.legend,h,p,d,v,m,g,y=this.zr.getWidth(),b=this.zr.getHeight(),w;for(var E=0,S=u.length;E "+u[E][1].name:""),p),i.push(a)}return i},getMarkCoord:function(){return[0,0]},getSymbolShape:function(e,r,i,s,u,a,f,l,c,h,p){var d=[i,e],v=i!=null?i.value!=null?i.value:i:"-";l=this.deepQuery(d,"symbol")||l;var m=this.deepQuery(d,"symbolSize");m=typeof m=="function"?m(v):m;var g=this.deepQuery(d,"symbolRotate"),y=this.deepMerge(d,"itemStyle.normal"),b=this.deepMerge(d,"itemStyle.emphasis"),w=y.borderWidth!=null?y.borderWidth:y.lineStyle&&y.lineStyle.width;w==null&&(w=l.match("empty")?2:0);var E=b.borderWidth!=null?b.borderWidth:b.lineStyle&&b.lineStyle.width;E==null&&(E=w+2);var S=new n({style:{iconType:l.replace("empty","").toLowerCase(),x:a-m,y:f-m,width:m*2,height:m*2,brushType:"both",color:l.match("empty")?h:this.getItemStyleColor(y.color,r,s,i)||c,strokeColor:y.borderColor||this.getItemStyleColor(y.color,r,s,i)||c,lineWidth:w},highlightStyle:{color:l.match("empty")?h:this.getItemStyleColor(b.color,r,s,i),strokeColor:b.borderColor||y.borderColor||this.getItemStyleColor(y.color,r,s,i)||c,lineWidth:E},clickable:this.deepQuery(d,"clickable")});return l.match("image")&&(S.style.image=l.replace(new RegExp("^image:\\/\\/"),""),S=new t({style:S.style,highlightStyle:S.highlightStyle,clickable:this.deepQuery(d,"clickable")})),g!=null&&(S.rotation=[g*Math.PI/180,a,f]),l.match("star")&&(S.style.iconType="star",S.style.n=l.replace("empty","").replace("star","")-0||5),l==="none"&&(S.invisible=!0,S.hoverable=!1),S=this.addLabel(S,e,i,u,p),l.match("empty")&&(S.style.textColor==null&&(S.style.textColor=S.style.strokeColor),S.highlightStyle.textColor==null&&(S.highlightStyle.textColor=S.highlightStyle.strokeColor)),o.pack(S,e,r,i,s,u),S._x=a,S._y=f,S._dataIndex=s,S._seriesIndex=r,S},getLineMarkShape:function(e,t,n,i,s,o,u,a,f){var l=n[0]!=null?n[0].value!=null?n[0].value:n[0]:"-",c=n[1]!=null?n[1].value!=null?n[1].value:n[1]:"-",h=[this.query(n[0],"symbol")||e.symbol[0],this.query(n[1],"symbol")||e.symbol[1]],p=[this.query(n[0],"symbolSize")||e.symbolSize[0],this.query(n[1],"symbolSize")||e.symbolSize[1]];p[0]=typeof p[0]=="function"?p[0](l):p[0],p[1]=typeof p[1]=="function"?p[1](c):p[1];var d=[this.query(n[0],"symbolRotate")||e.symbolRotate[0],this.query(n[1],"symbolRotate")||e.symbolRotate[1]],v=[n[0],e],m=this.deepMerge(v,"itemStyle.normal");m.color=this.getItemStyleColor(m.color,t,i,n);var g=this.deepMerge(v,"itemStyle.emphasis");g.color=this.getItemStyleColor(g.color,t,i,n);var y=m.lineStyle,b=g.lineStyle,w=y.width;w==null&&(w=m.borderWidth);var E=b.width;E==null&&(E=g.borderWidth!=null?g.borderWidth:w+2);var S=new r({style:{smooth:e.smooth?"spline":!1,symbol:h,symbolSize:p,symbolRotate:d,xStart:s,yStart:o,xEnd:u,yEnd:a,brushType:"both",lineType:y.type,shadowColor:y.shadowColor||y.color||m.borderColor||m.color||f,shadowBlur:y.shadowBlur,shadowOffsetX:y.shadowOffsetX,shadowOffsetY:y.shadowOffsetY,color:m.color||f,strokeColor:y.color||m.borderColor||m.color||f,lineWidth:w,symbolBorderColor:m.borderColor||m.color||f,symbolBorder:m.borderWidth},highlightStyle:{shadowColor:b.shadowColor,shadowBlur:b.shadowBlur,shadowOffsetX:b.shadowOffsetX,shadowOffsetY:b.shadowOffsetY,color:g.color||m.color||f,strokeColor:b.color||y.color||g.borderColor||m.borderColor||g.color||m.color||f,lineWidth:E,symbolBorderColor:g.borderColor||m.borderColor||g.color||m.color||f,symbolBorder:g.borderWidth==null?m.borderWidth+2:g.borderWidth},clickable:this.deepQuery(v,"clickable")});return S=this.addLabel(S,e,n[0],n[0].name+" : "+n[1].name),S._x=u,S._y=a,S},getLargeMarkPoingShape:function(e,t){var n=this.series[e],r=this.component,s=t.data,o,u=r.dataRange,a=r.legend,f,l,c=[s[0],t],h,p,d;a&&(f=a.getColor(n.name));if(u){l=s[0]!=null?s[0].value!=null?s[0].value:s[0]:"-",f=isNaN(l)?f:u.getColor(l),h=this.deepQuery(c,"itemStyle.normal.color")||f,p=this.deepQuery(c,"itemStyle.emphasis.color")||h;if(h==null&&p==null)return}f=this.deepMerge(c,"itemStyle.normal").color||f;var v=this.deepQuery(c,"symbol")||"circle";v=v.replace("empty","").replace(/\d/g,""),d=this.deepMerge([s[0],t],"effect");var m=window.devicePixelRatio||1;return o=new i({style:{pointList:s,color:f,strokeColor:f,shadowColor:d.shadowColor||f,shadowBlur:(d.shadowBlur!=null?d.shadowBlur:8)*m,size:this.deepQuery(c,"symbolSize"),iconType:v,brushType:"fill",lineWidth:1},draggable:!1,hoverable:!1}),d.show&&(o.effect=d),o},backupShapeList:function(){this.shapeList&&this.shapeList.length>0?(this.lastShapeList=this.shapeList,this.shapeList=[]):this.lastShapeList=[]},addShapeList:function(){var e=this.option.animationThreshold/(this.canvasSupported?2:4),t=this.lastShapeList,n=this.shapeList,r=t.length>0?500:this.query(this.option,"animationDuration"),i=this.query(this.option,"animationEasing"),s,o={},u={};if(this.option.animation&&!this.option.renderAsImage&&n.length500?u.candle(this.zr,e,t,n,r):this.zr.addShape(t);break;case"ring":case"sector":case"circle":n>500?u.ring(this.zr,e,t,n+(o.get(t,"dataIndex")||0)%20*100,r):t.type==="sector"?u.sector(this.zr,e,t,n,r):this.zr.addShape(t);break;case"text":u.text(this.zr,e,t,n,r);break;case"polygon":n>500?u.polygon(this.zr,e,t,n,r):u.pointList(this.zr,e,t,n,r);break;case"chord":u.chord(this.zr,e,t,n,r);break;case"gauge-pointer":u.gaugePointer(this.zr,e,t,n,r);break;case"mark-line":u.markline(this.zr,e,t,n,r);break;case"line":u.line(this.zr,e,t,n,r);break;default:this.zr.addShape(t)}},animationMark:function(e,t,n){var r=n||this.shapeList;for(var i=0,s=r.length;i0&&(e&&this.zr.modLayer(s.EFFECT_ZLEVEL,{motionBlur:!1}),this.zr.delShape(this.effectList)),this.effectList=[]},addMark:function(e,t,n){var r=this.series[e];if(this.selectedMap[r.name]){var i=500,s=this.query(this.option,"animationEasing"),o=r[n].data,u=this.shapeList.length;r[n].data=t.data,this["_build"+n.replace("m","M")](e);if(this.option.animation&&!this.option.renderAsImage)this.animationMark(i,s,this.shapeList.slice(u));else{for(var a=u,f=this.shapeList.length;a0?-1:1,t.style.r-=r,t.style.r=t.style.r<5?5:t.style.r;var i=s.get(t,"value"),o=i*f.option.island.calculateStep;o>1?i=Math.round(i-o*r):i=(i-o*r).toFixed(2)-0;var a=s.get(t,"name");t.style.text=a+":"+i,s.set(t,"value",i),s.set(t,"name",a),f.zr.modShape(t.id),f.zr.refresh(),u.stop(n)}}var t=e("../component/base"),n=e("./base"),r=e("zrender/shape/Circle"),i=e("../config"),s=e("../util/ecData"),o=e("zrender/tool/util"),u=e("zrender/tool/event");return a.prototype={type:i.CHART_TYPE_ISLAND,_combine:function(t,n){var r=e("zrender/tool/color"),i=e("../util/accMath"),o=i.accAdd(s.get(t,"value"),s.get(n,"value")),u=s.get(t,"name")+this._nameConnector+s.get(n,"name");t.style.text=u+this._valueConnector+o,s.set(t,"value",o),s.set(t,"name",u),t.style.r=this.option.island.r,t.style.color=r.mix(t.style.color,n.style.color)},refresh:function(e){e&&(e.island=this.reformOption(e.island),this.option=e,this._nameConnector=this.option.nameConnector,this._valueConnector=this.option.valueConnector)},getOption:function(){return this.option},resize:function(){var e=this.zr.getWidth(),t=this.zr.getHeight(),n=e/(this._zrWidth||e),r=t/(this._zrHeight||t);if(n===1&&r===1)return;this._zrWidth=e,this._zrHeight=t;for(var i=0,s=this.shapeList.length;i'+(t[0]||this._lang[0])+"

",this._textArea.style.cssText="display:block;margin:0 0 8px 0;padding:4px 6px;overflow:auto;width:"+(this._zrWidth-15)+"px;"+"height:"+(this._zrHeight-100)+"px;";var n=this.query(this.option,"toolbox.feature.dataView.optionToContent");typeof n!="function"?this._textArea.value=this._optionToContent():this._textArea.value=n(this.option),this._tDom.appendChild(this._textArea),this._buttonClose.style.cssText="float:right;padding:1px 6px;",this._buttonClose.innerHTML=t[1]||this._lang[1];var r=this;this._buttonClose.onclick=function(){r.hide()},this._tDom.appendChild(this._buttonClose),this.query(this.option,"toolbox.feature.dataView.readOnly")===!1?(this._buttonRefresh.style.cssText="float:right;margin-right:10px;padding:1px 6px;",this._buttonRefresh.innerHTML=t[2]||this._lang[2],this._buttonRefresh.onclick=function(){r._save()},this._tDom.appendChild(this._buttonRefresh),this._textArea.readOnly=!1,this._textArea.style.cursor="default"):(this._textArea.readOnly=!0,this._textArea.style.cursor="text"),this._sizeCssText="width:"+this._zrWidth+"px;"+"height:"+this._zrHeight+"px;"+"background-color:#fff;",this._tDom.style.cssText=this._gCssText+this._sizeCssText},_optionToContent:function(){var e,t,r,i,s,o,u=[],a="";if(this.option.xAxis){this.option.xAxis instanceof Array?u=this.option.xAxis:u=[this.option.xAxis];for(e=0,i=u.length;e10&&(this._sizeCssText="width:"+this._zrWidth+"px;"+"height:"+this._zrHeight+"px;"+"background-color:#fff;",this._tDom.style.cssText=this._gCssText+this._sizeCssText,this._textArea.style.cssText="display:block;margin:0 0 8px 0;padding:4px 6px;overflow:auto;width:"+(this._zrWidth-15)+"px;"+"height:"+(this._zrHeight-100)+"px;")},dispose:function(){window.removeEventListener?(this._tDom.removeEventListener("click",this._stop),this._tDom.removeEventListener("mousewheel",this._stop),this._tDom.removeEventListener("mousemove",this._stop),this._tDom.removeEventListener("mousedown",this._stop),this._tDom.removeEventListener("mouseup",this._stop),this._tDom.removeEventListener("touchstart",this._stop),this._tDom.removeEventListener("touchmove",this._stop),this._tDom.removeEventListener("touchend",this._stop)):(this._tDom.detachEvent("onclick",this._stop),this._tDom.detachEvent("onmousewheel",this._stop),this._tDom.detachEvent("onmousemove",this._stop),this._tDom.detachEvent("onmousedown",this._stop),this._tDom.detachEvent("onmouseup",this._stop)),this._buttonRefresh.onclick=null,this._buttonClose.onclick=null,this._hasShow&&(this._tDom.removeChild(this._textArea),this._tDom.removeChild(this._buttonRefresh),this._tDom.removeChild(this._buttonClose)),this._textArea=null,this._buttonRefresh=null,this._buttonClose=null,this.dom.firstChild.removeChild(this._tDom),this._tDom=null}},r.inherits(i,t),e("../component").define("dataView",i),i}),define("echarts/component/toolbox",["require","./base","zrender/shape/Line","zrender/shape/Image","zrender/shape/Rectangle","../util/shape/Icon","../config","zrender/tool/util","zrender/config","zrender/tool/event","./dataView","../component"],function(e){function h(e,n,r,i,s){t.call(this,e,n,r,i,s),this.dom=s.dom,this._magicType={},this._magicMap={},this._isSilence=!1,this._iconList,this._iconShapeMap={},this._featureTitle={},this._featureIcon={},this._featureColor={},this._enableColor="red",this._disableColor="#ccc",this._markShapeList=[];var o=this;o._onMark=function(e){o.__onMark(e)},o._onMarkUndo=function(e){o.__onMarkUndo(e)},o._onMarkClear=function(e){o.__onMarkClear(e)},o._onDataZoom=function(e){o.__onDataZoom(e)},o._onDataZoomReset=function(e){o.__onDataZoomReset(e)},o._onDataView=function(e){o.__onDataView(e)},o._onRestore=function(e){o.__onRestore(e)},o._onSaveAsImage=function(e){o.__onSaveAsImage(e)},o._onMagicType=function(e){o.__onMagicType(e)},o._onCustomHandler=function(e){o.__onCustomHandler(e)},o._onmousemove=function(e){return o.__onmousemove(e)},o._onmousedown=function(e){return o.__onmousedown(e)},o._onmouseup=function(e){return o.__onmouseup(e)},o._onclick=function(e){return o.__onclick(e)}}var t=e("./base"),n=e("zrender/shape/Line"),r=e("zrender/shape/Image"),i=e("zrender/shape/Rectangle"),s=e("../util/shape/Icon"),o=e("../config"),u=e("zrender/tool/util"),a=e("zrender/config"),f=e("zrender/tool/event"),l="stack",c="tiled";return h.prototype={type:o.COMPONENT_TYPE_TOOLBOX,_buildShape:function(){this._iconList=[];var e=this.option.toolbox;this._enableColor=e.effectiveColor,this._disableColor=e.disableColor;var t=e.feature,n=[];for(var r in t)if(t[r].show)switch(r){case"mark":n.push({key:r,name:"mark"}),n.push({key:r,name:"markUndo"}),n.push({key:r,name:"markClear"});break;case"magicType":for(var i=0,s=t[r].type.length;i0){var o,r;for(var i=0,s=n.length;i=1){var t=this._markShapeList[e-1];this.zr.delShape(t.id),this.zr.refresh(),this._markShapeList.pop(),e===1&&(this._iconDisable(this._iconShapeMap.markUndo),this._iconDisable(this._iconShapeMap.markClear))}}return!0},__onMarkClear:function(){this._marking&&(this._marking=!1);var e=this._markShapeList.length;if(e>0){while(e--)this.zr.delShape(this._markShapeList.pop().id);this._iconDisable(this._iconShapeMap.markUndo),this._iconDisable(this._iconShapeMap.markClear),this.zr.refresh()}return!0},__onDataZoom:function(e){var t=e.target;if(this._zooming||this._zoomStart)this._resetZoom(),this.zr.refresh(),this.dom.style.cursor="default";else{this._resetMark(),this.zr.modShape(t.id,{style:{strokeColor:this._enableColor}}),this.zr.refresh(),this._zoomStart=!0;var n=this;setTimeout(function(){n.zr&&n.zr.on(a.EVENT.MOUSEDOWN,n._onmousedown)&&n.zr.on(a.EVENT.MOUSEUP,n._onmouseup)&&n.zr.on(a.EVENT.MOUSEMOVE,n._onmousemove)},10),this.dom.style.cursor="crosshair"}return!0},__onDataZoomReset:function(){return this._zooming&&(this._zooming=!1),this._zoomQueue.pop(),this._zoomQueue.length>0?this.component.dataZoom.absoluteZoom(this._zoomQueue[this._zoomQueue.length-1]):(this.component.dataZoom.rectZoom(),this._iconDisable(this._iconShapeMap.dataZoomReset),this.zr.refresh()),!0},_resetMark:function(){this._marking=!1,this._markStart&&(this._markStart=!1,this._iconShapeMap.mark&&this.zr.modShape(this._iconShapeMap.mark.id,{style:{strokeColor:this._iconShapeMap.mark.highlightStyle.strokeColor}}),this.zr.un(a.EVENT.CLICK,this._onclick),this.zr.un(a.EVENT.MOUSEMOVE,this._onmousemove))},_resetZoom:function(){this._zooming=!1,this._zoomStart&&(this._zoomStart=!1,this._iconShapeMap.dataZoom&&this.zr.modShape(this._iconShapeMap.dataZoom.id,{style:{strokeColor:this._iconShapeMap.dataZoom.highlightStyle.strokeColor}}),this.zr.un(a.EVENT.MOUSEDOWN,this._onmousedown),this.zr.un(a.EVENT.MOUSEUP,this._onmouseup),this.zr.un(a.EVENT.MOUSEMOVE,this._onmousemove))},_iconDisable:function(e){e.type!="image"?this.zr.modShape(e.id,{hoverable:!1,clickable:!1,style:{strokeColor:this._disableColor}}):this.zr.modShape(e.id,{hoverable:!1,clickable:!1,style:{opacity:.3}})},_iconEnable:function(e){e.type!="image"?this.zr.modShape(e.id,{hoverable:!0,clickable:!0,style:{strokeColor:e.highlightStyle.strokeColor}}):this.zr.modShape(e.id,{hoverable:!0,clickable:!0,style:{opacity:.8}})},__onDataView:function(){return this._dataView.show(this.option),!0},__onRestore:function(){return this._resetMark(),this._resetZoom(),this.messageCenter.dispatch(o.EVENT.RESTORE,null,null,this.myChart),!0},__onSaveAsImage:function(){var e=this.option.toolbox.feature.saveAsImage,t=e.type||"png";t!="png"&&t!="jpeg"&&(t="png");var n;this.myChart.isConnected()?n=this.myChart.getConnectedDataURL(t):n=this.zr.toDataURL("image/"+t,this.option.backgroundColor&&this.option.backgroundColor.replace(" ","")==="rgba(0,0,0,0)"?"#fff":this.option.backgroundColor);var r=document.createElement("div");r.id="__echarts_download_wrap__",r.style.cssText="position:fixed;z-index:99999;display:block;top:0;left:0;background-color:rgba(33,33,33,0.5);text-align:center;width:100%;height:100%;line-height:"+document.documentElement.clientHeight+"px;";var i=document.createElement("a");i.href=n,i.setAttribute("download",(e.name?e.name:this.option.title&&(this.option.title.text||this.option.title.subtext)?this.option.title.text||this.option.title.subtext:"ECharts")+"."+t),i.innerHTML='图片另存为")+'"/>',r.appendChild(i),document.body.appendChild(r),i=null,r=null,setTimeout(function(){var e=document.getElementById("__echarts_download_wrap__");e&&(e.onclick=function(){var e=document.getElementById("__echarts_download_wrap__");e.onclick=null,e.innerHTML="",document.body.removeChild(e),e=null},e=null)},500);return},__onMagicType:function(e){this._resetMark();var t=e.target._name;return this._magicType[t]||(this._magicType[t]=!0,t===o.CHART_TYPE_LINE?this._magicType[o.CHART_TYPE_BAR]=!1:t===o.CHART_TYPE_BAR&&(this._magicType[o.CHART_TYPE_LINE]=!1),t===l?this._magicType[c]=!1:t===c&&(this._magicType[l]=!1),this.messageCenter.dispatch(o.EVENT.MAGIC_TYPE_CHANGED,e.event,{magicType:this._magicType},this.myChart)),!0},setMagicType:function(e){this._resetMark(),this._magicType=e,!this._isSilence&&this.messageCenter.dispatch(o.EVENT.MAGIC_TYPE_CHANGED,null,{magicType:this._magicType},this.myChart)},__onCustomHandler:function(e){var t=e.target.style.iconType,n=this.option.toolbox.feature[t].onclick;typeof n=="function"&&n.call(this,this.option)},reset:function(e,t){t&&this.clear();if(this.query(e,"toolbox.show")&&this.query(e,"toolbox.feature.magicType.show")){var n=e.toolbox.feature.magicType.type,r=n.length;this._magicMap={};while(r--)this._magicMap[n[r]]=!0;r=e.series.length;var i,s;while(r--){i=e.series[r].type,this._magicMap[i]&&(s=e.xAxis instanceof Array?e.xAxis[e.series[r].xAxisIndex||0]:e.xAxis,s&&(s.type||"category")==="category"&&(s.__boundaryGap=s.boundaryGap!=null?s.boundaryGap:!0),s=e.yAxis instanceof Array?e.yAxis[e.series[r].yAxisIndex||0]:e.yAxis,s&&s.type==="category"&&(s.__boundaryGap=s.boundaryGap!=null?s.boundaryGap:!0),e.series[r].__type=i,e.series[r].__itemStyle=u.clone(e.series[r].itemStyle||{}));if(this._magicMap[l]||this._magicMap[c])e.series[r].__stack=e.series[r].stack}}this._magicType=t?{}:this._magicType||{};for(var o in this._magicType)if(this._magicType[o]){this.option=e,this.getMagicOption();break}var a=e.dataZoom;if(a&&a.show){var f=a.start!=null&&a.start>=0&&a.start<=100?a.start:0,h=a.end!=null&&a.end>=0&&a.end<=100?a.end:100;f>h&&(f+=h,h=f-h,f-=h),this._zoomQueue=[{start:f,end:h,start2:0,end2:100}]}else this._zoomQueue=[]},getMagicOption:function(){var e;if(this._magicType[o.CHART_TYPE_LINE]||this._magicType[o.CHART_TYPE_BAR]){var t=this._magicType[o.CHART_TYPE_LINE]?!1:!0;for(var n=0,r=this.option.series.length;n0&&(this.zr.delShape(this._lastTipShape.tipShape),this._lastTipShape=!1,this.shapeList.length=2),e&&this.zr.refresh(),this.showing=!1},_show:function(e,t,n,r){var i=this._tDom.offsetHeight,s=this._tDom.offsetWidth;e&&(typeof e=="function"&&(e=e([t,n])),e instanceof Array&&(t=e[0],n=e[1])),t+s>this._zrWidth&&(t-=s+40),n+i>this._zrHeight&&(n-=i-20),n<20&&(n=0),this._tDom.style.cssText=this._gCssText+this._defaultCssText+(r?r:"")+"left:"+t+"px;top:"+n+"px;",(i<10||s<10)&&setTimeout(this._refixed,20),this.showing=!0},__refixed:function(){if(this._tDom){var e="",t=this._tDom.offsetHeight,n=this._tDom.offsetWidth;this._tDom.offsetLeft+n>this._zrWidth&&(e+="left:"+(this._zrWidth-n-20)+"px;"),this._tDom.offsetTop+t>this._zrHeight&&(e+="top:"+(this._zrHeight-t-10)+"px;"),e!==""&&(this._tDom.style.cssText+=e)}},__tryShow:function(){var e,t;if(!this._curTarget)this._findPolarTrigger()||this._findAxisTrigger();else{if(this._curTarget._type==="island"&&this.option.tooltip.show){this._showItemTrigger();return}var n=u.get(this._curTarget,"series"),r=u.get(this._curTarget,"data");e=this.deepQuery([r,n,this.option],"tooltip.show"),n==null||r==null||!e?(clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this._hidingTicket=setTimeout(this._hide,this._hideDelay)):(t=this.deepQuery([r,n,this.option],"tooltip.trigger"),t==="axis"?this._showAxisTrigger(n.xAxisIndex,n.yAxisIndex,u.get(this._curTarget,"dataIndex")):this._showItemTrigger())}},_findAxisTrigger:function(){if(!this.component.xAxis||!this.component.yAxis){this._hidingTicket=setTimeout(this._hide,this._hideDelay);return}var e=this.option.series,t,n;for(var r=0,i=e.length;rh){l=a;if(!(a>=i))break;c=a,a=t.getCoordByIndex(++n)}return n<=0?n=0:i-l>=c-i?n-=1:t.getNameByIndex(n)==null&&(n-=1),n},_showAxisTrigger:function(e,t,n){!this._event.connectTrigger&&this.messageCenter.dispatch(o.EVENT.TOOLTIP_IN_GRID,this._event,null,this.myChart);if(this.component.xAxis==null||this.component.yAxis==null||e==null||t==null){clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this._hidingTicket=setTimeout(this._hide,this._hideDelay);return}var r=this.option.series,i=[],s=[],u,a,l,c,h,p,d="";if(this.option.tooltip.trigger==="axis"){if(!this.option.tooltip.show)return;c=this.option.tooltip.formatter,h=this.option.tooltip.position}if(e!=-1&&this.component.xAxis.getAxis(e).type===o.COMPONENT_TYPE_AXIS_CATEGORY){u=this.component.xAxis.getAxis(e);for(var v=0,m=r.length;v=0?this._showItemTrigger():(clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this._tDom.style.display="none");if(i.length>0){var g;if(typeof c=="function"){var y=[];for(var v=0,m=i.length;v"+this._encodeHTML(i[v].name||"")+" : ",g=i[v].data[n],g=g!=null?g.value!=null?g.value:g:"-",c+=g instanceof Array?g:this.numAddCommas(g);this._tDom.innerHTML=c}if(p===!1||!this.option.tooltip.showContent)return;this.hasAppend||(this._tDom.style.left=this._zrWidth/2+"px",this._tDom.style.top=this._zrHeight/2+"px",this.dom.firstChild.appendChild(this._tDom),this.hasAppend=!0),this._show(h,a+10,l+10,d)}},_showPolarTrigger:function(e,t){if(this.component.polar==null||e==null||t==null||t<0)return!1;var n=this.option.series,r=[],i,s,o,u="";if(this.option.tooltip.trigger==="axis"){if(!this.option.tooltip.show)return!1;i=this.option.tooltip.formatter,s=this.option.tooltip.position}var a=this.option.polar[e].indicator[t].text;for(var l=0,c=n.length;l0){var h,p,d=[];for(var l=0,c=r.length;l"+this._encodeHTML(d[0][3])+" : "+this.numAddCommas(d[0][2]);for(var l=1,c=d.length;l"+this._encodeHTML(d[l][1])+"
",i+=this._encodeHTML(d[l][3])+" : "+this.numAddCommas(d[l][2]);this._tDom.innerHTML=i}if(o===!1||!this.option.tooltip.showContent)return;return this.hasAppend||(this._tDom.style.left=this._zrWidth/2+"px",this._tDom.style.top=this._zrHeight/2+"px",this.dom.firstChild.appendChild(this._tDom),this.hasAppend=!0),this._show(s,f.getX(this._event),f.getY(this._event),u),!0}},_showItemTrigger:function(){if(!this._curTarget)return;var e=u.get(this._curTarget,"series"),t=u.get(this._curTarget,"data"),n=u.get(this._curTarget,"name"),r=u.get(this._curTarget,"value"),i=u.get(this._curTarget,"special"),s=u.get(this._curTarget,"special2"),a,l,c,h="",p,d="";this._curTarget._type!="island"?(this.option.tooltip.trigger==="item"&&(a=this.option.tooltip.formatter,l=this.option.tooltip.position),this.query(e,"tooltip.trigger")==="item"&&(c=this.query(e,"tooltip.showContent")||c,a=this.query(e,"tooltip.formatter")||a,l=this.query(e,"tooltip.position")||l,h+=this._style(this.query(e,"tooltip"))),c=this.query(t,"tooltip.showContent")||c,a=this.query(t,"tooltip.formatter")||a,l=this.query(t,"tooltip.position")||l,h+=this._style(this.query(t,"tooltip"))):(c=this.deepQuery([t,e,this.option],"tooltip.showContent"),a=this.deepQuery([t,e,this.option],"tooltip.islandFormatter"),l=this.deepQuery([t,e,this.option],"tooltip.islandPosition"));if(typeof a=="function")this._curTicket=(e.name||"")+":"+u.get(this._curTarget,"dataIndex"),this._tDom.innerHTML=a.call(this.myChart,[e.name||"",n,r,i,s,t],this._curTicket,this._setContent);else if(typeof a=="string")this._curTicket=NaN,a=a.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}"),a=a.replace("{a0}",this._encodeHTML(e.name||"")).replace("{b0}",this._encodeHTML(n)).replace("{c0}",r instanceof Array?r:this.numAddCommas(r)),a=a.replace("{d}","{d0}").replace("{d0}",i||""),a=a.replace("{e}","{e0}").replace("{e0}",u.get(this._curTarget,"special2")||""),this._tDom.innerHTML=a;else{this._curTicket=NaN;if(e.type===o.CHART_TYPE_SCATTER)this._tDom.innerHTML=""+(e.name!=null?this._encodeHTML(e.name)+"
":"")+(n===""?"":this._encodeHTML(n)+" : ")+r+(i==null?"":" ("+i+")");else if(e.type===o.CHART_TYPE_RADAR&&i){p=i,d+=this._encodeHTML(n===""?e.name||"":n),d+=d===""?"":"
";for(var v=0;v";this._tDom.innerHTML=d}else if(e.type===o.CHART_TYPE_CHORD)if(s==null)this._tDom.innerHTML=this._encodeHTML(n)+" ("+this.numAddCommas(r)+")";else{var m=this._encodeHTML(n),g=this._encodeHTML(i);this._tDom.innerHTML=""+(e.name!=null?this._encodeHTML(e.name)+"
":"")+m+" -> "+g+" ("+this.numAddCommas(r)+")"+"
"+g+" -> "+m+" ("+this.numAddCommas(s)+")"}else this._tDom.innerHTML=""+(e.name!=null?this._encodeHTML(e.name)+"
":"")+this._encodeHTML(n)+" : "+this.numAddCommas(r)+(i==null?"":" ("+this.numAddCommas(i)+")")}if(!this._axisLineShape.invisible||!this._axisShadowShape.invisible)this._axisLineShape.invisible=!0,this.zr.modShape(this._axisLineShape.id),this._axisShadowShape.invisible=!0,this.zr.modShape(this._axisShadowShape.id),this.zr.refresh();if(c===!1||!this.option.tooltip.showContent)return;this.hasAppend||(this._tDom.style.left=this._zrWidth/2+"px",this._tDom.style.top=this._zrHeight/2+"px",this.dom.firstChild.appendChild(this._tDom),this.hasAppend=!0),this._show(l,f.getX(this._event)+20,f.getY(this._event)-20,h)},_styleAxisPointer:function(e,t,n,r,i,s,o,u){if(e.length>0){var a,f,l=this.option.tooltip.axisPointer,c=l.type,h={line:{},cross:{},shadow:{}};for(var p in h)h[p].color=l[p+"Style"].color,h[p].width=l[p+"Style"].width,h[p].type=l[p+"Style"].type;for(var d=0,v=e.length;d100?(this._axisCrossShape.style.textAlign="left",this._axisCrossShape.style.textX=o+10):(this._axisCrossShape.style.textAlign="right",this._axisCrossShape.style.textX=o-10),u-this.component.grid.getY()>50?(this._axisCrossShape.style.textBaseline="bottom",this._axisCrossShape.style.textY=u-10):(this._axisCrossShape.style.textBaseline="top",this._axisCrossShape.style.textY=u+10),this._axisCrossShape.invisible=!1,this.zr.modShape(this._axisCrossShape.id);else if(c==="shadow"){if(h.shadow.width==null||h.shadow.width==="auto"||isNaN(h.shadow.width))h.shadow.width=s;t===r?Math.abs(this.component.grid.getX()-t)<2?(h.shadow.width/=2,t=r+=h.shadow.width/2):Math.abs(this.component.grid.getXend()-t)<2&&(h.shadow.width/=2,t=r-=h.shadow.width/2):n===i&&(Math.abs(this.component.grid.getY()-n)<2?(h.shadow.width/=2,n=i+=h.shadow.width/2):Math.abs(this.component.grid.getYend()-n)<2&&(h.shadow.width/=2,n=i-=h.shadow.width/2)),this._axisShadowShape.style={xStart:t,yStart:n,xEnd:r,yEnd:i,strokeColor:h.shadow.color,lineWidth:h.shadow.width},this._axisShadowShape.invisible=!1,this.zr.modShape(this._axisShadowShape.id)}this.zr.refresh()}},__onmousemove:function(e){clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket);var t=e.target,n=f.getX(e.event),r=f.getY(e.event);if(!t)this._curTarget=!1,this._event=e.event,this._event.zrenderX=n,this._event.zrenderY=r,this._needAxisTrigger&&this.component.grid&&l.isInside(s,this.component.grid.getArea(),n,r)?this._showingTicket=setTimeout(this._tryShow,this._showDelay):this._needAxisTrigger&&this.component.polar&&this.component.polar.isInside([n,r])!=-1?this._showingTicket=setTimeout(this._tryShow,this._showDelay):(!this._event.connectTrigger&&this.messageCenter.dispatch(o.EVENT.TOOLTIP_OUT_GRID,this._event,null,this.myChart),this._hidingTicket=setTimeout(this._hide,this._hideDelay));else{this._curTarget=t,this._event=e.event,this._event.zrenderX=n,this._event.zrenderY=r;var i;if(this._needAxisTrigger&&this.component.polar&&(i=this.component.polar.isInside([n,r]))!=-1){var u=this.option.series;for(var a=0,c=u.length;a0&&(this.zr.delShape(this._lastTipShape.tipShape),this.shapeList.length=2);for(var n=0,r=t.length;n0&&this.zr.delShape(this._lastTipShape.tipShape),this._lastTipShape=!1,this.shapeList.length=2;if(e){this.option=e,this.option.tooltip=this.reformOption(this.option.tooltip),this.option.tooltip.textStyle=h.merge(this.option.tooltip.textStyle,this.ecTheme.textStyle),this.option.tooltip.padding=this.reformCssArray(this.option.tooltip.padding),this._needAxisTrigger=!1,this.option.tooltip.trigger==="axis"&&(this._needAxisTrigger=!0);var t=this.option.series;for(var n=0,r=t.length;n0&&this.zr.delShape(this._lastTipShape.tipShape),this.clear(),this.shapeList=null,clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this.zr.un(a.EVENT.MOUSEMOVE,this._onmousemove),this.zr.un(a.EVENT.GLOBALOUT,this._onglobalout),this.hasAppend&&this.dom.firstChild.removeChild(this._tDom),this._tDom=null},_encodeHTML:function(e){return String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}},h.inherits(d,t),e("../component").define("tooltip",d),d}),define("zrender/shape/Ring",["require","./Base","../tool/util"],function(e){var t=e("./Base"),n=function(e){t.call(this,e)};return n.prototype={type:"ring",buildPath:function(e,t){e.arc(t.x,t.y,t.r,0,Math.PI*2,!1),e.moveTo(t.x+t.r0,t.y),e.arc(t.x,t.y,t.r0,0,Math.PI*2,!0);return},getRect:function(e){if(e.__rect)return e.__rect;var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,e.__rect={x:Math.round(e.x-e.r-t/2),y:Math.round(e.y-e.r-t/2),width:e.r*2+t,height:e.r*2+t},e.__rect}},e("../tool/util").inherits(n,t),n}),define("zrender/shape/Sector",["require","../tool/math","./Base","./Ring","./Polygon","../tool/util"],function(e){var t=e("../tool/math"),n=e("./Base"),r=function(e){n.call(this,e)};return r.prototype={type:"sector",buildPath:function(e,n){var r=n.x,i=n.y,s=typeof n.r0=="undefined"?0:n.r0,o=n.r,u=n.startAngle,a=n.endAngle;if(Math.abs(a-u)>=360){e.arc(r,i,o,0,Math.PI*2,!1),s!==0&&(e.moveTo(r+s,i),e.arc(r,i,s,0,Math.PI*2,!0));return}u=t.degreeToRadian(u),a=t.degreeToRadian(a);var f=Math.PI*2,l=t.cos(u),c=t.sin(u);e.moveTo(l*s+r,i-c*s),e.lineTo(l*o+r,i-c*o),e.arc(r,i,o,f-u,f-a,!0),e.lineTo(t.cos(a)*s+r,i-t.sin(a)*s),s!==0&&e.arc(r,i,s,f-a,f-u,!1),e.closePath();return},getRect:function(n){if(n.__rect)return n.__rect;var r=n.x,i=n.y,s=typeof n.r0=="undefined"?0:n.r0,o=n.r,u=n.startAngle,a=n.endAngle;if(Math.abs(a-u)>=360)return n.__rect=e("./Ring").prototype.getRect(n),n.__rect;u=(720+u)%360,a=(720+a)%360,a<=u&&(a+=360);var f=[];return u<=90&&a>=90&&f.push([r,i-o]),u<=180&&a>=180&&f.push([r-o,i]),u<=270&&a>=270&&f.push([r,i+o]),u<=360&&a>=360&&f.push([r+o,i]),u=t.degreeToRadian(u),a=t.degreeToRadian(a),f.push([t.cos(u)*s+r,i-t.sin(u)*s]),f.push([t.cos(u)*o+r,i-t.sin(u)*o]),f.push([t.cos(a)*o+r,i-t.sin(a)*o]),f.push([t.cos(a)*s+r,i-t.sin(a)*s]),n.__rect=e("./Polygon").prototype.getRect({brushType:n.brushType,lineWidth:n.lineWidth,pointList:f}),n.__rect}},e("../tool/util").inherits(r,n),r}),define("echarts/util/shape/Candle",["require","zrender/shape/Base","zrender/tool/util","./normalIsCover"],function(e){function r(e){t.call(this,e)}var t=e("zrender/shape/Base"),n=e("zrender/tool/util");return r.prototype={type:"candle",_numberOrder:function(e,t){return t-e},buildPath:function(e,t){var r=n.clone(t.y).sort(this._numberOrder);e.moveTo(t.x,r[3]),e.lineTo(t.x,r[2]),e.moveTo(t.x-t.width/2,r[2]),e.rect(t.x-t.width/2,r[2],t.width,r[1]-r[2]),e.moveTo(t.x,r[1]),e.lineTo(t.x,r[0])},getRect:function(e){if(!e.__rect){var t=0;if(e.brushType=="stroke"||e.brushType=="fill")t=e.lineWidth||1;var r=n.clone(e.y).sort(this._numberOrder);e.__rect={x:Math.round(e.x-e.width/2-t/2),y:Math.round(r[3]-t/2),width:e.width+t,height:r[0]-r[3]+t}}return e.__rect},isCover:e("./normalIsCover")},n.inherits(r,t),r}),define("echarts/component/legend",["require","./base","zrender/shape/Text","zrender/shape/Rectangle","zrender/shape/Sector","../util/shape/Icon","../util/shape/Candle","../config","zrender/tool/util","zrender/tool/area","../component"],function(e){function l(e,n,r,i,s){if(!this.query(i,"legend.data")){console.error("option.legend.data has not been defined.");return}t.call(this,e,n,r,i,s);var o=this;o._legendSelected=function(e){o.__legendSelected(e)},this._colorIndex=0,this._colorMap={},this._selectedMap={},this.refresh(i)}var t=e("./base"),n=e("zrender/shape/Text"),r=e("zrender/shape/Rectangle"),i=e("zrender/shape/Sector"),s=e("../util/shape/Icon"),o=e("../util/shape/Candle"),u=e("../config"),a=e("zrender/tool/util"),f=e("zrender/tool/area");l.prototype={type:u.COMPONENT_TYPE_LEGEND,_buildShape:function(){this._itemGroupLocation=this._getItemGroupLocation(),this._buildBackground(),this._buildItem();for(var e=0,t=this.shapeList.length;e=d-m&&(m=this._itemGroupLocation.x,g+=b+w):v-g<200&&b+(S===t-1||e[S+1]===""?0:w)>=v-g&&(this.legendOption.x==="right"?m-=this._itemGroupLocation.maxWidth+w:m+=this._itemGroupLocation.maxWidth+w,g=this._itemGroupLocation.y),o=this._getItemShapeByType(m,g,y,b,this._selectedMap[r]?E:"#ccc",i,E),o._name=r,o=new s(o),u={zlevel:this._zlevelBase,style:{x:m+y+5,y:g+b/2,color:this._selectedMap[r]?c.color==="auto"?E:c.color:"#ccc",text:p,textFont:h,textBaseline:"middle"},highlightStyle:{color:E,brushType:"fill"},hoverable:!!this.legendOption.selectedMode,clickable:!!this.legendOption.selectedMode},this.legendOption.orient==="vertical"&&this.legendOption.x==="right"&&(u.style.x-=y+10,u.style.textAlign="right"),u._name=r,u=new n(u),this.legendOption.selectedMode&&(o.onclick=u.onclick=this._legendSelected,o.onmouseover=u.onmouseover=this.hoverConnect,o.hoverConnect=u.id,u.hoverConnect=o.id),this.shapeList.push(o),this.shapeList.push(u),this.legendOption.orient==="horizontal"?m+=y+5+f.getTextWidth(p,h)+w:g+=b+w}this.legendOption.orient==="horizontal"&&this.legendOption.x==="center"&&g!=this._itemGroupLocation.y&&this._mLineOptimize()},_getName:function(e){return typeof e.name!="undefined"?e.name:e},_getFormatterName:function(e){var t=this.legendOption.formatter,n;return typeof t=="function"?n=t.call(this.myChart,e):typeof t=="string"?n=t.replace("{name}",e):n=e,n},_getFormatterNameFromData:function(e){var t=this._getName(e);return this._getFormatterName(t)},_mLineOptimize:function(){var e=[],t=this._itemGroupLocation.x;for(var n=2,r=this.shapeList.length;nh?(u=h,l+=i+n):u=Math.max(u,d),l+=i+n,d=0;continue}d+=r+f.getTextWidth(this._getFormatterNameFromData(e[m]),e[m].textStyle?this.getFont(a.merge(e[m].textStyle||{},s)):o)+n}l=Math.max(l,i),d-=n,d>h?(u=h,l+=i+n):u=Math.max(u,d)}else{for(var m=0;mp?(l=p,u+=v+n):l=Math.max(l,d),u+=v+n,d=0;continue}d+=i+n}u=Math.max(u,v),d-=n,d>p?(l=p,u+=v+n):l=Math.max(l,d)}h=this.zr.getWidth(),p=this.zr.getHeight();var g;switch(this.legendOption.x){case"center":g=Math.floor((h-u)/2);break;case"left":g=this.legendOption.padding[3]+this.legendOption.borderWidth;break;case"right":g=h-u-this.legendOption.padding[1]-this.legendOption.padding[3]-this.legendOption.borderWidth*2;break;default:g=this.parsePercent(this.legendOption.x,h)}var y;switch(this.legendOption.y){case"top":y=this.legendOption.padding[0]+this.legendOption.borderWidth;break;case"bottom":y=p-l-this.legendOption.padding[0]-this.legendOption.padding[2]-this.legendOption.borderWidth*2;break;case"center":y=Math.floor((p-l)/2);break;default:y=this.parsePercent(this.legendOption.y,p)}return{x:g,y:y,width:u,height:l,maxWidth:v}},_getSomethingByName:function(e){var t=this.option.series,n;for(var r=0,i=t.length;r=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height?!0:!1}},i.inherits(o,t),o}),define("echarts/component/timeline",["require","./base","zrender/shape/Rectangle","../util/shape/Icon","../util/shape/Chain","../config","zrender/tool/util","zrender/tool/area","zrender/tool/event","../component"],function(e){function f(e,n,r,i,u){t.call(this,e,n,r,i,u);var a=this;a._onclick=function(e){return a.__onclick(e)},a._ondrift=function(e,t){return a.__ondrift(this,e,t)},a._ondragend=function(){return a.__ondragend()},a._setCurrentOption=function(){var e=a.timelineOption;a.currentIndex%=e.data.length;var t=a.options[a.currentIndex]||{};a.myChart.setOption(t,e.notMerge),a.messageCenter.dispatch(s.EVENT.TIMELINE_CHANGED,null,{currentIndex:a.currentIndex,data:e.data[a.currentIndex].name!=null?e.data[a.currentIndex].name:e.data[a.currentIndex]},a.myChart)},a._onFrame=function(){a._setCurrentOption(),a._syncHandleShape(),a.timelineOption.autoPlay&&(a.playTicket=setTimeout(function(){a.currentIndex+=1;if(!a.timelineOption.loop&&a.currentIndex>=a.timelineOption.data.length){a.currentIndex=a.timelineOption.data.length-1,a.stop();return}a._onFrame()},a.timelineOption.playInterval))},this.setTheme(!1),this.options=this.option.options,this.currentIndex=this.timelineOption.currentIndex%this.timelineOption.data.length,!this.timelineOption.notMerge&&this.currentIndex!==0&&(this.options[this.currentIndex]=o.merge(this.options[this.currentIndex],this.options[0])),this.timelineOption.show&&(this._buildShape(),this._syncHandleShape()),this._setCurrentOption();if(this.timelineOption.autoPlay){var a=this;this.playTicket=setTimeout(function(){a.play()},this.ecTheme.animationDuration)}}function l(e,t){var n=2,i=t.x+n,s=t.y+n+2,o=t.width-n,u=t.height-n,a=t.symbol;if(a==="last")e.moveTo(i+o-2,s+u/3),e.lineTo(i+o-2,s),e.lineTo(i+2,s+u/2),e.lineTo(i+o-2,s+u),e.lineTo(i+o-2,s+u/3*2),e.moveTo(i,s),e.lineTo(i,s);else if(a==="next")e.moveTo(i+2,s+u/3),e.lineTo(i+2,s),e.lineTo(i+o-2,s+u/2),e.lineTo(i+2,s+u),e.lineTo(i+2,s+u/3*2),e.moveTo(i,s),e.lineTo(i,s);else if(a==="play")if(t.status==="stop")e.moveTo(i+2,s),e.lineTo(i+o-2,s+u/2),e.lineTo(i+2,s+u),e.lineTo(i+2,s);else{var f=t.brushType==="both"?2:3;e.rect(i+2,s,f,u),e.rect(i+o-f-2,s,f,u)}else if(a.match("image")){var l="";l=a.replace(new RegExp("^image:\\/\\/"),""),a=r.prototype.iconLibrary.image,a(e,{x:i,y:s,width:o,height:u,image:l})}}var t=e("./base"),n=e("zrender/shape/Rectangle"),r=e("../util/shape/Icon"),i=e("../util/shape/Chain"),s=e("../config"),o=e("zrender/tool/util"),u=e("zrender/tool/area"),a=e("zrender/tool/event");return f.prototype={type:s.COMPONENT_TYPE_TIMELINE,_buildShape:function(){this._location=this._getLocation(),this._buildBackground(),this._buildControl(),this._chainPoint=this._getChainPoint();if(this.timelineOption.label.show){var e=this._getInterval();for(var t=0,n=this._chainPoint.length;t3){var o=!1,a,f;n=0;while(!o&&n1){var v=c/h;v=v>50?50:v<20?5:v,c-=v*2;if(e.type==="number")for(var m=0;m0?"right":"left",S=[r*Math.PI/180,f,l-5]):S=!1,g.push({x:f,n:b,isEmpty:w,symbol:y,symbolSize:a[m].symbolSize||n,color:a[m].color,borderColor:a[m].borderColor,borderWidth:a[m].borderWidth,name:this._getReformedLabel(m),textColor:u.color,textAlign:E,textBaseline:u.baseline||"middle",textX:f,textY:l-(r?5:0),textFont:a[m].textStyle?this.getFont(u):s,rotation:S,showLabel:!1});return g},_buildBackground:function(){var e=this.timelineOption,t=e.padding,r=this._location.width,i=this._location.height;(e.borderWidth!==0||e.backgroundColor.replace(/\s/g,"")!="rgba(0,0,0,0)")&&this.shapeList.push(new n({zlevel:this._zlevelBase,hoverable:!1,style:{x:this._location.x-t[3],y:this._location.y-t[0],width:r+t[1]+t[3],height:i+t[0]+t[2],brushType:e.borderWidth===0?"fill":"both",color:e.backgroundColor,strokeColor:e.borderColor,lineWidth:e.borderWidth}}))},_buildControl:function(){var e=this,t=this.timelineOption,n=t.lineStyle,i=t.controlStyle;if(t.controlPosition==="none")return;var s=15,u=5,a;t.controlPosition==="left"?(a=this._location.x,this._location.x+=(s+u)*3):(a=this._location.x2-((s+u)*3-u),this._location.x2-=(s+u)*3);var f=this._location.y,l={zlevel:this._zlevelBase+1,style:{iconType:"timelineControl",symbol:"last",x:a,y:f,width:s,height:s,brushType:"stroke",color:i.normal.color,strokeColor:i.normal.color,lineWidth:n.width},highlightStyle:{color:i.emphasis.color,strokeColor:i.emphasis.color,lineWidth:n.width+1},clickable:!0};this._ctrLastShape=new r(l),this._ctrLastShape.onclick=function(){e.last()},this.shapeList.push(this._ctrLastShape),a+=s+u,this._ctrPlayShape=new r(o.clone(l)),this._ctrPlayShape.style.brushType="fill",this._ctrPlayShape.style.symbol="play",this._ctrPlayShape.style.status=this.timelineOption.autoPlay?"playing":"stop",this._ctrPlayShape.style.x=a,this._ctrPlayShape.onclick=function(){e._ctrPlayShape.style.status==="stop"?e.play():e.stop()},this.shapeList.push(this._ctrPlayShape),a+=s+u,this._ctrNextShape=new r(o.clone(l)),this._ctrNextShape.style.symbol="next",this._ctrNextShape.style.x=a,this._ctrNextShape.onclick=function(){e.next()},this.shapeList.push(this._ctrNextShape)},_buildChain:function(){var e=this.timelineOption,t=e.lineStyle;this._timelineShae={zlevel:this._zlevelBase,style:{x:this._location.x,y:this.subPixelOptimize(this._location.y,t.width),width:this._location.x2-this._location.x,height:this._location.height,chainPoint:this._chainPoint,brushType:"both",strokeColor:t.color,lineWidth:t.width,lineType:t.type},hoverable:!1,clickable:!0,onclick:this._onclick},this._timelineShae=new i(this._timelineShae),this.shapeList.push(this._timelineShae)},_buildHandle:function(){var e=this._chainPoint[this.currentIndex],t=e.symbolSize+1;t=t<5?5:t,this._handleShape={zlevel:this._zlevelBase+1,hoverable:!1,draggable:!0,style:{iconType:"diamond",n:e.n,x:e.x-t,y:this._location.y+this._location.height/4-t,width:t*2,height:t*2,brushType:"both",textPosition:"specific",textX:e.x,textY:this._location.y-this._location.height/4,textAlign:"center",textBaseline:"middle"},highlightStyle:{},ondrift:this._ondrift,ondragend:this._ondragend},this._handleShape=new r(this._handleShape),this.shapeList.push(this._handleShape)},_syncHandleShape:function(){if(!this.timelineOption.show)return;var e=this.timelineOption,t=e.checkpointStyle,n=this._chainPoint[this.currentIndex];this._handleShape.style.text=t.label.show?n.name:"",this._handleShape.style.textFont=n.textFont,this._handleShape.style.n=n.n,t.symbol==="auto"?this._handleShape.style.iconType=n.symbol!="none"?n.symbol:"diamond":(this._handleShape.style.iconType=t.symbol,t.symbol.match("star")&&(this._handleShape.style.n=t.symbol.replace("star","")-0||5,this._handleShape.style.iconType="star"));var r;t.symbolSize==="auto"?(r=n.symbolSize+2,r=r<5?5:r):r=t.symbolSize-0,this._handleShape.style.color=t.color==="auto"?n.color?n.color:e.controlStyle.emphasis.color:t.color,this._handleShape.style.textColor=t.label.textStyle.color==="auto"?this._handleShape.style.color:t.label.textStyle.color,this._handleShape.highlightStyle.strokeColor=this._handleShape.style.strokeColor=t.borderColor==="auto"?n.borderColor?n.borderColor:"#fff":t.borderColor,this._handleShape.style.lineWidth=t.borderWidth==="auto"?n.borderWidth?n.borderWidth:0:t.borderWidth-0,this._handleShape.highlightStyle.lineWidth=this._handleShape.style.lineWidth+1,this.zr.animate(this._handleShape.id,"style").when(500,{x:n.x-r,textX:n.x,y:this._location.y+this._location.height/4-r,width:r*2,height:r*2}).start("ExponentialOut")},_findChainIndex:function(e){var t=this._chainPoint,n=t.length;if(e<=t[0].x)return 0;if(e>=t[n-1].x)return n-1;for(var r=0;r=t[r].x&&e<=t[r+1].x)return Math.abs(e-t[r].x)=n[r-1].x-n[r-1].symbolSize?(e.style.x=n[r-1].x-n[r-1].symbolSize,i=r-1):(e.style.x+=t,i=this._findChainIndex(e.style.x));var s=n[i],o=s.symbolSize+2;e.style.iconType=s.symbol,e.style.n=s.n,e.style.textX=e.style.x+o/2,e.style.y=this._location.y+this._location.height/4-o,e.style.width=o*2,e.style.height=o*2,e.style.text=s.name;if(i===this.currentIndex)return!0;this.currentIndex=i;if(this.timelineOption.realtime){clearTimeout(this.playTicket);var u=this;this.playTicket=setTimeout(function(){u._setCurrentOption()},200)}return!0},__ondragend:function(){this.isDragend=!0},ondragend:function(e,t){if(!this.isDragend||!e.target)return;!this.timelineOption.realtime&&this._setCurrentOption(),t.dragOut=!0,t.dragIn=!0,t.needRefresh=!1,this.isDragend=!1,this._syncHandleShape();return},last:function(){return this.timelineOption.autoPlay&&this.stop(),this.currentIndex-=1,this.currentIndex<0&&(this.currentIndex=this.timelineOption.data.length-1),this._onFrame(),this.currentIndex},next:function(){return this.timelineOption.autoPlay&&this.stop(),this.currentIndex+=1,this.currentIndex>=this.timelineOption.data.length&&(this.currentIndex=0),this._onFrame(),this.currentIndex},play:function(e,t){return this._ctrPlayShape&&this._ctrPlayShape.style.status!="playing"&&(this._ctrPlayShape.style.status="playing",this.zr.modShape(this._ctrPlayShape.id),this.zr.refresh()),this.timelineOption.autoPlay=t!=null?t:!0,this.timelineOption.autoPlay||clearTimeout(this.playTicket),this.currentIndex=e!=null?e:this.currentIndex+1,this.currentIndex>=this.timelineOption.data.length&&(this.currentIndex=0),this._onFrame(),this.currentIndex},stop:function(){return this._ctrPlayShape&&this._ctrPlayShape.style.status!="stop"&&(this._ctrPlayShape.style.status="stop",this.zr.modShape(this._ctrPlayShape.id),this.zr.refresh()),this.timelineOption.autoPlay=!1,clearTimeout(this.playTicket),this.currentIndex},resize:function(){this.timelineOption.show&&(this.clear(),this._buildShape(),this._syncHandleShape())},setTheme:function(e){this.timelineOption=this.reformOption(o.clone(this.option.timeline)),this.timelineOption.padding=this.reformCssArray(this.timelineOption.padding),this.timelineOption.label.textStyle=o.merge(this.timelineOption.label.textStyle||{},this.ecTheme.textStyle),this.timelineOption.checkpointStyle.label.textStyle=o.merge(this.timelineOption.checkpointStyle.label.textStyle||{},this.ecTheme.textStyle),this.timelineOption.show&&e&&(this.clear(),this._buildShape(),this._syncHandleShape())},dispose:function(){this.clear(),this.shapeList=null,clearTimeout(this.playTicket)}},r.prototype.iconLibrary.timelineControl=l,o.inherits(f,t),e("../component").define("timeline",f),f}),define("zrender/loadingEffect/Bar",["require","./Base","../tool/util","../tool/color","../shape/Rectangle"],function(e){function s(e){t.call(this,e)}var t=e("./Base"),n=e("../tool/util"),r=e("../tool/color"),i=e("../shape/Rectangle");return n.inherits(s,t),s.prototype._start=function(e,t){var s=n.merge(this.options,{textStyle:{color:"#888"},backgroundColor:"rgba(250, 250, 250, 0.8)",effectOption:{x:0,y:this.canvasHeight/2-30,width:this.canvasWidth,height:5,brushType:"fill",timeInterval:100}}),o=this.createTextShape(s.textStyle),u=this.createBackgroundShape(s.backgroundColor),a=s.effectOption,f=new i({highlightStyle:n.clone(a)});f.highlightStyle.color=a.color||r.getLinearGradient(a.x,a.y,a.x+a.width,a.y+a.height,[[0,"#ff6400"],[.5,"#ffe100"],[1,"#b1ff00"]]);if(s.progress!=null){e(u),f.highlightStyle.width=this.adjust(s.progress,[0,1])*s.effectOption.width,e(f),e(o),t();return}return f.highlightStyle.width=0,setInterval(function(){e(u),f.highlightStyle.width=h&&(c[n].len=Math.ceil(Math.random()*400),r.xStart=-400,r.xEnd=-400+c[n].len,r.yStart=Math.ceil(Math.random()*p),r.yEnd=r.yStart),r.xStart+=c[n].animationX,r.xEnd+=c[n].animationX,e(c[n])}e(o),t()},a.timeInterval)},s}),define("zrender/loadingEffect/Ring",["require","./Base","../tool/util","../tool/color","../shape/Ring","../shape/Sector"],function(e){function o(e){t.call(this,e)}var t=e("./Base"),n=e("../tool/util"),r=e("../tool/color"),i=e("../shape/Ring"),s=e("../shape/Sector");return n.inherits(o,t),o.prototype._start=function(e,t){var o=n.merge(this.options,{textStyle:{color:"#07a"},backgroundColor:"rgba(250, 250, 250, 0.8)",effect:{x:this.canvasWidth/2,y:this.canvasHeight/2,r0:60,r:100,color:"#bbdcff",brushType:"fill",textPosition:"inside",textFont:"normal 30px verdana",textColor:"rgba(30, 144, 255, 0.6)",timeInterval:100}}),u=o.effect,a=o.textStyle;a.x==null&&(a.x=u.x),a.y==null&&(a.y=u.y+(u.r0+u.r)/2-5);var f=this.createTextShape(o.textStyle),l=this.createBackgroundShape(o.backgroundColor),c=u.x,h=u.y,p=u.r0+6,d=u.r-6,v=u.color,m=r.lift(v,.1),g=new i({highlightStyle:n.clone(u)}),y=[],b=r.getGradientColors(["#ff6400","#ffe100","#97ff00"],25),w=15,E=240;for(var S=0;S<16;S++)y.push(new s({highlightStyle:{x:c,y:h,r0:p,r:d,startAngle:E-w,endAngle:E,brushType:"fill",color:m},_color:r.getLinearGradient(c+p*Math.cos(E,!0),h-p*Math.sin(E,!0),c+p*Math.cos(E-w,!0),h-p*Math.sin(E-w,!0),[[0,b[S*2]],[1,b[S*2+1]]])})),E-=w;E=360;for(var S=0;S<4;S++)y.push(new s({highlightStyle:{x:c,y:h,r0:p,r:d,startAngle:E-w,endAngle:E,brushType:"fill",color:m},_color:r.getLinearGradient(c+p*Math.cos(E,!0),h-p*Math.sin(E,!0),c+p*Math.cos(E-w,!0),h-p*Math.sin(E-w,!0),[[0,b[S*2+32]],[1,b[S*2+33]]])})),E-=w;var x=0;if(o.progress!=null){e(l),x=this.adjust(o.progress,[0,1]).toFixed(2)*100/5,g.highlightStyle.text=x*5+"%",e(g);for(var S=0;S<20;S++)y[S].highlightStyle.color=S=20?-20:1,e(g);for(var n=0;n<20;n++)y[n].highlightStyle.color=n ");var u=-1;for(var a=0,f=o.length;a-1){o.splice(u,1),this._optionRestore.series[e][n].data.splice(u,1);var c=this.chart[i.type];c&&c.delMark(e,t.join(" > "),n)}return this},getDom:function(){return this.dom},getZrender:function(){return this._zr},getDataURL:function(e){if(!s)return"";if(this._chartList.length===0){var t="IMG"+this.id,n=document.getElementById(t);if(n)return n.src}var r=this.component.tooltip;r&&r.hideTip();switch(e){case"jpeg":break;default:e="png"}var i=this._option.backgroundColor;return i&&i.replace(" ","")==="rgba(0,0,0,0)"&&(i="#fff"),this._zr.toDataURL("image/"+e,i)},getImage:function(e){var t=this._optionRestore.title,n=document.createElement("img");return n.src=this.getDataURL(e),n.title=t&&t.text||"ECharts",n},getConnectedDataURL:function(t){if(!this.isConnected())return this.getDataURL(t);var n=this.dom,r={self:{img:this.getDataURL(t),left:n.offsetLeft,top:n.offsetTop,right:n.offsetLeft+n.offsetWidth,bottom:n.offsetTop+n.offsetHeight}},i=r.self.left,s=r.self.top,o=r.self.right,u=r.self.bottom;for(var a in this._connected)n=this._connected[a].getDom(),r[a]={img:this._connected[a].getDataURL(t),left:n.offsetLeft,top:n.offsetTop,right:n.offsetLeft+n.offsetWidth,bottom:n.offsetTop+n.offsetHeight},i=Math.min(i,r[a].left),s=Math.min(s,r[a].top),o=Math.max(o,r[a].right),u=Math.max(u,r[a].bottom);var f=document.createElement("div");f.style.position="absolute",f.style.left="-4000px",f.style.width=o-i+"px",f.style.height=u-s+"px",document.body.appendChild(f);var l=e("zrender").init(f),c=e("zrender/shape/Image");for(var a in r)l.addShape(new c({style:{x:r[a].left-i,y:r[a].top-s,image:r[a].img}}));l.render();var h=this._option.backgroundColor;h&&h.replace(/ /g,"")==="rgba(0,0,0,0)"&&(h="#fff");var p=l.toDataURL("image/png",h);return setTimeout(function(){l.dispose(),f.parentNode.removeChild(f),f=null},100),p},getConnectedImage:function(e){var t=this._optionRestore.title,n=document.createElement("img");return n.src=this.getConnectedDataURL(e),n.title=t&&t.text||"ECharts",n},on:function(e,t){return this._messageCenterOutSide.bind(e,t,this),this},un:function(e,t){return this._messageCenterOutSide.unbind(e,t),this},connect:function(e){if(!e)return this;this._connected||(this._connected={});if(e instanceof Array)for(var t=0,n=e.length;t=n/3?1:2),o=t.y+Math.sin(i)*r*(r>=n/3?1:2);i=t.angle-Math.PI/2,e.moveTo(s,o),e.lineTo(t.x+Math.cos(i)*r,t.y-Math.sin(i)*r),e.lineTo(t.x+Math.cos(t.angle)*n,t.y-Math.sin(t.angle)*n),e.lineTo(t.x-Math.cos(i)*r,t.y+Math.sin(i)*r),e.lineTo(s,o);return},getRect:function(e){if(e.__rect)return e.__rect;var t=e.width*2,n=e.x,r=e.y,i=n+Math.cos(e.angle)*e.r,s=r-Math.sin(e.angle)*e.r;return e.__rect={x:Math.min(n,i)-t,y:Math.min(r,s)-t,width:Math.abs(n-i)+t,height:Math.abs(r-s)+t},e.__rect},isCover:e("./normalIsCover")},n.inherits(r,t),r}),define("echarts/chart/gauge",["require","../component/base","./base","../util/shape/GaugePointer","zrender/shape/Text","zrender/shape/Line","zrender/shape/Rectangle","zrender/shape/Circle","zrender/shape/Sector","../config","../util/ecData","../util/accMath","zrender/tool/util","../chart"],function(e){function p(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this),this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("../util/shape/GaugePointer"),i=e("zrender/shape/Text"),s=e("zrender/shape/Line"),o=e("zrender/shape/Rectangle"),u=e("zrender/shape/Circle"),a=e("zrender/shape/Sector"),f=e("../config"),l=e("../util/ecData"),c=e("../util/accMath"),h=e("zrender/tool/util");return p.prototype={type:f.CHART_TYPE_GAUGE,_buildShape:function(){var e=this.series;this._paramsMap={};for(var t=0,n=e.length;t=110&&v<=250?"left":v<=70||v>=290?"right":"center",textBaseline:v>=10&&v<=170?"top":v>=190&&v<=350?"bottom":"middle",textFont:u,shadowColor:o.shadowColor,shadowBlur:o.shadowBlur,shadowOffsetX:o.shadowOffsetX,shadowOffsetY:o.shadowOffsetY}}))},_buildPointer:function(e){var t=this.series[e];if(!t.pointer.show)return;var n=t.max-t.min,i=t.pointer,s=this._paramsMap[e],o=this.parsePercent(i.length,s.radius[1]),a=this.parsePercent(i.width,s.radius[1]),f=s.center,c=this._getValue(e);c=c2?2:a/2,color:"#fff"}});l.pack(d,this.series[e],e,this.series[e].data[0],0,this.series[e].data[0].name,c),this.shapeList.push(d),this.shapeList.push(new u({zlevel:this._zlevelBase+2,hoverable:!1,style:{x:f[0],y:f[1],r:i.width/2.5,color:"#fff"}}))},_buildTitle:function(e){var t=this.series[e];if(!t.title.show)return;var n=t.data[0],r=n.name!=null?n.name:"";if(r!==""){var s=t.title,o=s.offsetCenter,u=s.textStyle,a=u.color,f=this._paramsMap[e],l=f.center[0]+this.parsePercent(o[0],f.radius[1]),c=f.center[1]+this.parsePercent(o[1],f.radius[1]);this.shapeList.push(new i({zlevel:this._zlevelBase+(Math.abs(l-f.center[0])+Math.abs(c-f.center[1]))=t)return n[r][1];return n[n.length-1][1]},_getSector:function(e,t,n,r,i,s,o){return new a({zlevel:this._zlevelBase,hoverable:!1,style:{x:e[0],y:e[1],r0:t,r:n,startAngle:r,endAngle:i,brushType:"fill",color:s,shadowColor:o.shadowColor,shadowBlur:o.shadowBlur,shadowOffsetX:o.shadowOffsetX,shadowOffsetY:o.shadowOffsetY}})},_getLabelText:function(e,t){if(e){if(typeof e=="function")return e.call(this.myChart,t);if(typeof e=="string")return e.replace("{value}",t)}return t},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()}},h.inherits(p,n),h.inherits(p,t),e("../chart").define("gauge",p),p}),define("echarts/chart/funnel",["require","../component/base","./base","zrender/shape/Text","zrender/shape/Line","zrender/shape/Polygon","../config","../util/ecData","../util/number","zrender/tool/util","zrender/tool/color","zrender/tool/area","../chart"],function(e){function h(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this),this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("zrender/shape/Text"),i=e("zrender/shape/Line"),s=e("zrender/shape/Polygon"),o=e("../config"),u=e("../util/ecData"),a=e("../util/number"),f=e("zrender/tool/util"),l=e("zrender/tool/color"),c=e("zrender/tool/area");return h.prototype={type:o.CHART_TYPE_FUNNEL,_buildShape:function(){var e=this.series,t=this.component.legend;this._paramsMap={},this._selected={},this.selectedMap={};var n;for(var r=0,i=e.length;r1?(i.height-(o-1)*h)/o:i.height,d,v=i.y,m=n.sort==="descending"?this._getItemWidth(e,u[0].value):a.parsePercent(n.minSize,i.width),g=n.sort==="descending"?1:0,y=i.centerX,b=[[y-m/2-(m===0?0:10),v-(m===0?10:5)],[y+m/2+(m===0?0:10),v-(m===0?10:5)]];for(var f=0,l=u.length;fc.getTextWidth(w,E)?T="#fff":T=l.reverse(n)):g.position==="left"?(S="right",x=b==="auto"?d.x-10:d.centerX-Math.max(o,u)/2-b):(S="left",x=b==="auto"?d.x+d.width+10:d.centerX+Math.max(o,u)/2+b);var N={zlevel:this._zlevelBase+1,style:{x:x,y:s+a/2,color:y.color||T,text:w,textAlign:y.align||S,textBaseline:y.baseline||"middle",textFont:E}};return m="emphasis",g=v[m].label||g,y=g.textStyle||y,b=v[m].labelLine.length||b,g.position=g.position||v.normal.label.position,w=this.getLabelText(e,t,m),E=this.getFont(y),T=n,g.position==="inner"||g.position==="inside"?(S="center",x=i+o/2,Math.max(o,u)/2>c.getTextWidth(w,E)?T="#fff":T=l.reverse(n)):g.position==="left"?(S="right",x=b==="auto"?d.x-10:d.centerX-Math.max(o,u)/2-b):(S="left",x=b==="auto"?d.x+d.width+10:d.centerX+Math.max(o,u)/2+b),N.highlightStyle={x:x,color:y.color||T,text:w,textAlign:y.align||S,textFont:E,brushType:"fill"},new r(N)},getLabelText:function(e,t,n){var r=this.series,i=r[e],s=i.data[t],o=this.deepQuery([s,i],"itemStyle."+n+".label.formatter");if(!o)return s.name;if(typeof o=="function")return o.call(this.myChart,i.name,s.name,s.value);if(typeof o=="string")return o=o.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}"),o=o.replace("{a0}",i.name).replace("{b0}",s.name).replace("{c0}",s.value),o},getLabelLine:function(e,t,n,r,s,o,u,a){var l=this.series[e],c=l.data[t],h=this._paramsMap[e].location,p=f.merge(f.clone(c.itemStyle)||{},l.itemStyle),d="normal",v=p[d].labelLine,m=p[d].labelLine.length,g=v.lineStyle||{},y=p[d].label;y.position=y.position||p.normal.label.position;var b;y.position==="inner"||y.position==="inside"?b=r+o/2:y.position==="left"?b=m==="auto"?h.x-10:h.centerX-Math.max(o,u)/2-m:b=m==="auto"?h.x+h.width+10:h.centerX+Math.max(o,u)/2+m;var w={zlevel:this._zlevelBase+1,hoverable:!1,style:{xStart:h.centerX,yStart:s+a/2,xEnd:b,yEnd:s+a/2,strokeColor:g.color||n,lineType:g.type,lineWidth:g.width}};return d="emphasis",v=p[d].labelLine||v,m=p[d].labelLine.length||m,g=v.lineStyle||g,y=p[d].label||y,y.position=y.position,y.position==="inner"||y.position==="inside"?b=r+o/2:y.position==="left"?b=m==="auto"?h.x-10:h.centerX-Math.max(o,u)/2-m:b=m==="auto"?h.x+h.width+10:h.centerX+Math.max(o,u)/2+m,w.highlightStyle={xEnd:b,strokeColor:g.color||n,lineType:g.type,lineWidth:g.width},new i(w)},_needLabel:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".label.show")},_needLabelLine:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".labelLine.show")},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()}},f.inherits(h,n),f.inherits(h,t),e("../chart").define("funnel",h),h}),define("echarts/component/categoryAxis",["require","./base","zrender/shape/Text","zrender/shape/Line","zrender/shape/Rectangle","../config","zrender/tool/util","zrender/tool/area","../component"],function(e){function a(e,n,r,i,s,o){if(i.data.length<1){console.error("option.data.length < 1.");return}t.call(this,e,n,r,i,s),this.grid=this.component.grid;for(var u in o)this[u]=o[u];this.refresh(i)}var t=e("./base"),n=e("zrender/shape/Text"),r=e("zrender/shape/Line"),i=e("zrender/shape/Rectangle"),s=e("../config"),o=e("zrender/tool/util"),u=e("zrender/tool/area");return a.prototype={type:s.COMPONENT_TYPE_AXIS_CATEGORY,_getReformedLabel:function(e){var t=typeof this.option.data[e].value!="undefined"?this.option.data[e].value:this.option.data[e],n=this.option.data[e].formatter||this.option.axisLabel.formatter;return n&&(typeof n=="function"?t=n.call(this.myChart,t):typeof n=="string"&&(t=n.replace("{value}",t))),t},_getInterval:function(){var e=this.option.axisLabel.interval;if(e=="auto"){var t=this.option.axisLabel.textStyle.fontSize,n=this.option.data,r=this.option.data.length;if(this.isHorizontal())if(r>3){var i=this.getGap(),s=!1,a,f,l=Math.floor(.5/i);l=l<1?1:l,e=Math.floor(15/i);while(!s&&e=0;c-=e){if(this.option.axisLabel.rotate!==0)f=t;else if(n[c].textStyle)f=u.getTextWidth(this._getReformedLabel(c),this.getFont(o.merge(n[c].textStyle,this.option.axisLabel.textStyle)));else{var h=this._getReformedLabel(c)+"",p=(h.match(/\w/g)||"").length,d=h.length-p;f=p*t*2/3+d*t}if(a3){var i=this.getGap();e=Math.floor(11/i);while(i*e-60?-u:0;if(this.isHorizontal()){var c=this.option.position=="bottom"?n.inside?this.grid.getYend()-i-1:this.grid.getYend()+1:n.inside?this.grid.getY()+1:this.grid.getY()-i-1,h;for(var p=l;p=0?f:0),o),e={_axisShape:"axisTick",zlevel:this._zlevelBase,hoverable:!1,style:{xStart:h,yStart:c,xEnd:h,yEnd:c+i,strokeColor:s,lineWidth:o}},this.shapeList.push(new r(e))}else{var d=this.option.position=="left"?n.inside?this.grid.getX()+1:this.grid.getX()-i-1:n.inside?this.grid.getXend()-i-1:this.grid.getXend()+1,v;for(var p=l;p=0?f:0),o),e={_axisShape:"axisTick",zlevel:this._zlevelBase,hoverable:!1,style:{xStart:d,yStart:v,xEnd:d+i,yEnd:v,strokeColor:s,lineWidth:o}},this.shapeList.push(new r(e))}},_buildAxisLabel:function(){var e,t=this.option.data,r=this.option.data.length,i=this.option.axisLabel.rotate,s=this.option.axisLabel.margin,u=this.option.axisLabel.clickable,a=this.option.axisLabel.textStyle,f;if(this.isHorizontal()){var l,c;this.option.position=="bottom"?(l=this.grid.getYend()+s,c="top"):(l=this.grid.getY()-s,c="bottom");for(var h=0;h0?this.option.position=="bottom"?"right":"left":this.option.position=="bottom"?"left":"right",e.rotation=[i*Math.PI/180,e.style.x,e.style.y]),this.shapeList.push(new n(this._axisLabelClickable(u,e)))}}else{var p,d;this.option.position=="left"?(p=this.grid.getX()-s,d="right"):(p=this.grid.getXend()+s,d="left");for(var h=0;h1?e-1:1)},getCoord:function(e){var t=this.option.data,n=t.length,r=this.getGap(),i=this.option.boundaryGap?r/2:0;for(var s=0;sthis.option.data.length-1)return this.isHorizontal()?this.grid.getXend():this.grid.getY();var t=this.getGap(),n=this.option.boundaryGap?t/2:0;return n+=e*t,this.isHorizontal()?n=this.grid.getX()+n:n=this.grid.getYend()-n,n},getNameByIndex:function(e){var t=this.option.data[e];return typeof t!="undefined"&&typeof t.value!="undefined"?t.value:t},getIndexByName:function(e){var t=this.option.data,n=t.length;for(var r=0;r0?this.option.position==="bottom"?"right":"left":this.option.position==="bottom"?"left":"right",e.rotation=[i*Math.PI/180,e.style.x,e.style.y]),this.shapeList.push(new n(this._axisLabelClickable(o,e)))}else{var c,h;this.option.position==="left"?(c=this.grid.getX()-s,h="right"):(c=this.grid.getXend()+s,h="left");for(var l=0;l=0?t[h][l]!=null?t[h][l]+=n:t[h][l]=n:t[p][l]!=null?t[p][l]+=n:t[p][l]=n,this.option.scale&&t[f].push(n)}}}for(var u in t){e=t[u];for(var l=0,c=e.length;l0?this.option.power:1:this._max>0?this._min=this._max/this.option.splitNumber:this._max=this._max/this.option.splitNumber),this._reformValue(this.option.scale)}else this._hasData=!0,this._min=this.option.min-0,this._max=this.option.max-0,this._customerValue()},_reformValue:function(e){var t=this.option.splitNumber,n=this.option.precision,r,i;n===0?i=this.option.power>1?this.option.power:1:(i=Math.pow(10,n),this._min*=i,this._max*=i,i=this.option.power);var s;if(this._min>=0&&this._max>=0){if(!e){while(this._max/i1?i/10:1,s=this._max-this._min,r=Math.ceil(s/t/i)*i,this._max=this._min+r*t}else if(this._min<=0&&this._max<=0){i=-i;if(!e){while(this._min/ii&&i!=-1)i/=10;n===0&&(this._min=Math.ceil(this._min/i)*i,this._max=Math.floor(this._max/i)*i)}i=i<-1?i/10:-1,s=this._min-this._max,r=-Math.ceil(s/t/i)*i,this._min=-r*t+this._max}else{s=this._max-this._min;while(s/ithis._max?this._max:e;var t;return this.isHorizontal()?t=this.grid.getX()+(e-this._min)/(this._max-this._min)*this.grid.getWidth():t=this.grid.getYend()-(e-this._min)/(this._max-this._min)*this.grid.getHeight(),t},getCoordSize:function(e){return this.isHorizontal()?Math.abs(e/(this._max-this._min)*this.grid.getWidth()):Math.abs(e/(this._max-this._min)*this.grid.getHeight())},getValueFromCoord:function(e){var t;return this.isHorizontal()?(e=ethis.grid.getXend()?this.grid.getXend():e,t=this._min+(e-this.grid.getX())/this.grid.getWidth()*(this._max-this._min)):(e=ethis.grid.getYend()?this.grid.getYend():e,t=this._max-(e-this.grid.getY())/this.grid.getHeight()*(this._max-this._min)),t.toFixed(2)-0}},o.inherits(u,t),e("../component").define("valueAxis",u),u}),define("echarts/component/axis",["require","./base","zrender/shape/Line","../config","../util/ecData","zrender/tool/util","zrender/tool/color","./categoryAxis","./valueAxis","../component"],function(e){function u(e,n,r,i,s,o){t.call(this,e,n,r,i,s),this.axisType=o,this._axisList=[],this.refresh(i)}var t=e("./base"),n=e("zrender/shape/Line"),r=e("../config"),i=e("../util/ecData"),s=e("zrender/tool/util"),o=e("zrender/tool/color");return u.prototype={type:r.COMPONENT_TYPE_AXIS,axisBase:{_buildAxisLine:function(){var e=this.option.axisLine.lineStyle.width,t=e/2,r={_axisShape:"axisLine",zlevel:this._zlevelBase+1,hoverable:!1};switch(this.option.position){case"left":r.style={xStart:this.grid.getX()-t,yStart:this.grid.getYend(),xEnd:this.grid.getX()-t,yEnd:this.grid.getY(),lineCap:"round"};break;case"right":r.style={xStart:this.grid.getXend()+t,yStart:this.grid.getYend(),xEnd:this.grid.getXend()+t,yEnd:this.grid.getY(),lineCap:"round"};break;case"bottom":r.style={xStart:this.grid.getX(),yStart:this.grid.getYend()+t,xEnd:this.grid.getXend(),yEnd:this.grid.getYend()+t,lineCap:"round"};break;case"top":r.style={xStart:this.grid.getX(),yStart:this.grid.getY()-t,xEnd:this.grid.getXend(),yEnd:this.grid.getY()-t,lineCap:"round"}}this.option.name!==""&&(r.style.text=this.option.name,r.style.textPosition=this.option.nameLocation,r.style.textFont=this.getFont(this.option.nameTextStyle),this.option.nameTextStyle.align&&(r.style.textAlign=this.option.nameTextStyle.align),this.option.nameTextStyle.baseline&&(r.style.textBaseline=this.option.nameTextStyle.baseline),this.option.nameTextStyle.color&&(r.style.textColor=this.option.nameTextStyle.color)),r.style.strokeColor=this.option.axisLine.lineStyle.color,r.style.lineWidth=e,this.isHorizontal()?r.style.yStart=r.style.yEnd=this.subPixelOptimize(r.style.yEnd,e):r.style.xStart=r.style.xEnd=this.subPixelOptimize(r.style.xEnd,e),r.style.lineType=this.option.axisLine.lineStyle.type,r=new n(r),this.shapeList.push(r)},_axisLabelClickable:function(e,t){return e?(i.pack(t,undefined,-1,undefined,-1,t.style.text),t.hoverable=!0,t.clickable=!0,t.highlightStyle={color:o.lift(t.style.color,1),brushType:"fill"},t):t},refixAxisShape:function(e,t){if(!this.option.axisLine.onZero)return;var n;if(this.isHorizontal()&&t!=null)for(var r=0,i=this.shapeList.length;r2&&(e=[e[0],e[1]]);if(this.axisType==="xAxis"){if(!e[0].position||e[0].position!="bottom"&&e[0].position!="top")e[0].position="bottom";e.length>1&&(e[1].position=e[0].position==="bottom"?"top":"bottom");for(var t=0,n=e.length;t1&&(e[1].position=e[0].position==="left"?"right":"left");for(var t=0,n=e.length;t=0&&(o.isHorizontal()?t=o.getCoord(0):n=o.getCoord(0));if(typeof t!="undefined"||typeof n!="undefined"){s=i.length;while(s--)i[s].refixAxisShape(t,n)}},refresh:function(e){if(e||this._zrWidth!=this.zr.getWidth()||this._zrHeight!=this.zr.getHeight()){this.clear(),this.option=e||this.option,this.option.grid=this.reformOption(this.option.grid);var t=this.option.grid;this._zrWidth=this.zr.getWidth(),this._zrHeight=this.zr.getHeight(),this._x=this.parsePercent(t.x,this._zrWidth),this._y=this.parsePercent(t.y,this._zrHeight);var r=this.parsePercent(t.x2,this._zrWidth),i=this.parsePercent(t.y2,this._zrHeight);typeof t.width=="undefined"?this._width=this._zrWidth-this._x-r:this._width=this.parsePercent(t.width,this._zrWidth),this._width=this._width<=0?10:this._width,typeof t.height=="undefined"?this._height=this._zrHeight-this._y-i:this._height=this.parsePercent(t.height,this._zrHeight),this._height=this._height<=0?10:this._height,this._x=this.subPixelOptimize(this._x,t.borderWidth),this._y=this.subPixelOptimize(this._y,t.borderWidth),this.shapeList.push(new n({zlevel:this._zlevelBase,hoverable:!1,style:{x:this._x,y:this._y,width:this._width,height:this._height,brushType:t.borderWidth>0?"both":"fill",color:t.backgroundColor,strokeColor:t.borderColor,lineWidth:t.borderWidth}})),this.zr.addShape(this.shapeList[0])}}},i.inherits(s,t),e("../component").define("grid",s),s}),define("echarts/component/dataZoom",["require","./base","zrender/shape/Rectangle","zrender/shape/Polygon","../util/shape/Icon","../config","zrender/tool/util","../component","../component"],function(e){function u(e,n,r,i,s){t.call(this,e,n,r,i,s);var o=this;o._ondrift=function(e,t){return o.__ondrift(this,e,t)},o._ondragend=function(){return o.__ondragend()},this._fillerSize=28,this._handleSize=8,this._isSilence=!1,this._zoom={},this.option.dataZoom=this.reformOption(this.option.dataZoom),this.zoomOption=this.option.dataZoom,this._location=this._getLocation(),this._zoom=this._getZoom(),this._backupData(),this.option.dataZoom.show&&this._buildShape(),this._syncData()}var t=e("./base"),n=e("zrender/shape/Rectangle"),r=e("zrender/shape/Polygon"),i=e("../util/shape/Icon"),s=e("../config"),o=e("zrender/tool/util");return u.prototype={type:s.COMPONENT_TYPE_DATAZOOM,_buildShape:function(){this._buildBackground(),this._buildFiller(),this._buildHandle(),this._buildFrame();for(var e=0,t=this.shapeList.length;ep&&(h+=p,p=h-p,h-=p);var d=Math.round((p-h)/100*(this.zoomOption.orient=="horizontal"?this._location.width:this._location.height));return{start:h,end:p,start2:0,end2:100,size:d,xAxisIndex:i,yAxisIndex:o,seriesIndex:r,scatterMap:this._zoom.scatterMap||{}}},_backupData:function(){this._originalData={xAxis:{},yAxis:{},series:{}};var e=this.option.xAxis,t=this._zoom.xAxisIndex;for(var n=0,r=t.length;n1?1:0)),w=t/(i-(i>1?1:0)),E=1;this.zoomOption.orient=="horizontal"&&b<1?E=Math.floor(i*3/e):this.zoomOption.orient=="vertical"&&w<1&&(E=Math.floor(i*3/t));for(var a=0,f=i;athis._location.x?1:0),height:this._location.height-(t>this._location.y?1:0),lineWidth:1,brushType:"stroke",strokeColor:this.zoomOption.handleColor}},this._endFrameShape=o.clone(this._startFrameShape),this._startFrameShape=new n(this._startFrameShape),this._endFrameShape=new n(this._endFrameShape),this.shapeList.push(this._startFrameShape),this.shapeList.push(this._endFrameShape);return},_syncHandleShape:function(){this.zoomOption.orient=="horizontal"?(this._startShape.style.x=this._fillerShae.style.x-this._handleSize,this._endShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._zoom.start=Math.floor((this._startShape.style.x-this._location.x)/this._location.width*100),this._zoom.end=Math.ceil((this._endShape.style.x+this._handleSize-this._location.x)/this._location.width*100)):(this._startShape.style.y=this._fillerShae.style.y-this._handleSize,this._endShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._zoom.start=Math.floor((this._startShape.style.y-this._location.y)/this._location.height*100),this._zoom.end=Math.ceil((this._endShape.style.y+this._handleSize-this._location.y)/this._location.height*100)),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this._syncFrameShape(),this.zr.refresh()},_syncFillerShape:function(){var e,t;this.zoomOption.orient=="horizontal"?(e=this._startShape.style.x,t=this._endShape.style.x,this._fillerShae.style.x=Math.min(e,t)+this._handleSize,this._fillerShae.style.width=Math.abs(e-t)-this._handleSize,this._zoom.start=Math.floor((Math.min(e,t)-this._location.x)/this._location.width*100),this._zoom.end=Math.ceil((Math.max(e,t)+this._handleSize-this._location.x)/this._location.width*100)):(e=this._startShape.style.y,t=this._endShape.style.y,this._fillerShae.style.y=Math.min(e,t)+this._handleSize,this._fillerShae.style.height=Math.abs(e-t)-this._handleSize,this._zoom.start=Math.floor((Math.min(e,t)-this._location.y)/this._location.height*100),this._zoom.end=Math.ceil((Math.max(e,t)+this._handleSize-this._location.y)/this._location.height*100)),this.zr.modShape(this._fillerShae.id),this._syncFrameShape(),this.zr.refresh()},_syncFrameShape:function(){this.zoomOption.orient=="horizontal"?(this._startFrameShape.style.width=this._fillerShae.style.x-this._location.x,this._endFrameShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._endFrameShape.style.width=this._location.x+this._location.width-this._endFrameShape.style.x):(this._startFrameShape.style.height=this._fillerShae.style.y-this._location.y,this._endFrameShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._endFrameShape.style.height=this._location.y+this._location.height-this._endFrameShape.style.y),this.zr.modShape(this._startFrameShape.id),this.zr.modShape(this._endFrameShape.id)},_syncShape:function(){if(!this.zoomOption.show)return;this.zoomOption.orient=="horizontal"?(this._startShape.style.x=this._location.x+this._zoom.start/100*this._location.width,this._endShape.style.x=this._location.x+this._zoom.end/100*this._location.width-this._handleSize,this._fillerShae.style.x=this._startShape.style.x+this._handleSize,this._fillerShae.style.width=this._endShape.style.x-this._startShape.style.x-this._handleSize):(this._startShape.style.y=this._location.y+this._zoom.start/100*this._location.height,this._endShape.style.y=this._location.y+this._zoom.end/100*this._location.height-this._handleSize,this._fillerShae.style.y=this._startShape.style.y+this._handleSize,this._fillerShae.style.height=this._endShape.style.y-this._startShape.style.y-this._handleSize),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this.zr.modShape(this._fillerShae.id),this._syncFrameShape(),this.zr.refresh()},_syncData:function(e){var t,n,r,i,o;for(var u in this._originalData){t=this._originalData[u];for(var a in t){o=t[a];if(typeof o=="undefined")continue;i=o.length,n=Math.floor(this._zoom.start/100*i),r=Math.ceil(this._zoom.end/100*i),this.option[u][a].type!=s.CHART_TYPE_SCATTER?this.option[u][a].data=o.slice(n,r):this.option[u][a].data=this._synScatterData(a,o)}}!this._isSilence&&(this.zoomOption.realtime||e)&&this.messageCenter.dispatch(s.EVENT.DATA_ZOOM,null,{zoom:this._zoom},this.myChart)},_synScatterData:function(e,t){if(this._zoom.start===0&&this._zoom.end==100&&this._zoom.start2===0&&this._zoom.end2==100)return t;var n=[],r=this._zoom.scatterMap[e],i,s,o,u,a;this.zoomOption.orient=="horizontal"?(i=r.x.max-r.x.min,s=this._zoom.start/100*i+r.x.min,o=this._zoom.end/100*i+r.x.min,i=r.y.max-r.y.min,u=this._zoom.start2/100*i+r.y.min,a=this._zoom.end2/100*i+r.y.min):(i=r.x.max-r.x.min,s=this._zoom.start2/100*i+r.x.min,o=this._zoom.end2/100*i+r.x.min,i=r.y.max-r.y.min,u=this._zoom.start/100*i+r.y.min,a=this._zoom.end/100*i+r.y.min);var f;for(var l=0,c=t.length;l=s&&f[0]<=o&&f[1]>=u&&f[1]<=a&&n.push(t[l]);return n},__ondrift:function(e,t,n){this.zoomOption.zoomLock&&(e=this._fillerShae);var r=e._type=="filler"?this._handleSize:0;return this.zoomOption.orient=="horizontal"?e.style.x+t-r<=this._location.x?e.style.x=this._location.x+r:e.style.x+t+e.style.width+r>=this._location.x+this._location.width?e.style.x=this._location.x+this._location.width-e.style.width-r:e.style.x+=t:e.style.y+n-r<=this._location.y?e.style.y=this._location.y+r:e.style.y+n+e.style.height+r>=this._location.y+this._location.height?e.style.y=this._location.y+this._location.height-e.style.height-r:e.style.y+=n,e._type=="filler"?this._syncHandleShape():this._syncFillerShape(),this.zoomOption.realtime&&this._syncData(),!0},__ondragend:function(){this.isDragend=!0},ondragend:function(e,t){if(!this.isDragend||!e.target)return;!this.zoomOption.realtime&&this._syncData(),t.dragOut=!0,t.dragIn=!0,!this._isSilence&&!this.zoomOption.realtime&&this.messageCenter.dispatch(s.EVENT.DATA_ZOOM,null,{zoom:this._zoom},this.myChart),t.needRefresh=!1,this.isDragend=!1;return},ondataZoom:function(e,t){t.needRefresh=!0;return},absoluteZoom:function(e){this._zoom.start=e.start,this._zoom.end=e.end,this._zoom.start2=e.start2,this._zoom.end2=e.end2,this._syncShape(),this._syncData(!0);return},rectZoom:function(e){if(!e)return this._zoom.start=this._zoom.start2=0,this._zoom.end=this._zoom.end2=100,this._syncShape(),this._syncData(!0),this._zoom;var t=this.component.grid.getArea(),n={x:e.x,y:e.y,width:e.width,height:e.height};n.width<0&&(n.x+=n.width,n.width=-n.width),n.height<0&&(n.y+=n.height,n.height=-n.height);if(n.x>t.x+t.width||n.y>t.y+t.height)return!1;n.xt.x+t.width&&(n.width=t.x+t.width-n.x),n.y+n.height>t.y+t.height&&(n.height=t.y+t.height-n.y);var r,i=(n.x-t.x)/t.width,s=1-(n.x+n.width-t.x)/t.width,o=1-(n.y+n.height-t.y)/t.height,u=(n.y-t.y)/t.height;return this.zoomOption.orient=="horizontal"?(r=this._zoom.end-this._zoom.start,this._zoom.start+=r*i,this._zoom.end-=r*s,r=this._zoom.end2-this._zoom.start2,this._zoom.start2+=r*o,this._zoom.end2-=r*u):(r=this._zoom.end-this._zoom.start,this._zoom.start+=r*o,this._zoom.end-=r*u,r=this._zoom.end2-this._zoom.start2,this._zoom.start2+=r*i,this._zoom.end2-=r*s),this._syncShape(),this._syncData(!0),this._zoom},syncBackupData:function(e){var t,n=this._originalData.series,r=e.series,i;for(var s=0,o=r.length;s=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height?!0:!1}},r.inherits(i,t),i}),define("echarts/component/dataRange",["require","./base","zrender/shape/Text","zrender/shape/Rectangle","../util/shape/HandlePolygon","../config","zrender/tool/util","zrender/tool/area","zrender/tool/color","zrender/tool/color","../component"],function(e){function f(e,n,r,i,s){if(typeof this.query(i,"dataRange.min")=="undefined"||typeof this.query(i,"dataRange.max")=="undefined"){console.error("option.dataRange.min or option.dataRange.max has not been defined.");return}t.call(this,e,n,r,i,s);var o=this;o._ondrift=function(e,t){return o.__ondrift(this,e,t)},o._ondragend=function(){return o.__ondragend()},o._dataRangeSelected=function(e){return o.__dataRangeSelected(e)},this._selectedMap={},this._range={},this.refresh(i)}var t=e("./base"),n=e("zrender/shape/Text"),r=e("zrender/shape/Rectangle"),i=e("../util/shape/HandlePolygon"),s=e("../config"),o=e("zrender/tool/util"),u=e("zrender/tool/area"),a=e("zrender/tool/color");return f.prototype={type:s.COMPONENT_TYPE_DATARANGE,_textGap:10,_buildShape:function(){this._itemGroupLocation=this._getItemGroupLocation(),this._buildBackground(),this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable?this._buildGradient():this._buildItem();for(var e=0,t=this.shapeList.length;ep&&(h-=m)):(dv&&(d-=f))}return{x:h,y:d,width:s,height:o}},_getTextShape:function(e,t,n){return{zlevel:this._zlevelBase,style:{x:this.dataRangeOption.orient=="horizontal"?e:this._itemGroupLocation.x+this._itemGroupLocation.width/2,y:this.dataRangeOption.orient=="horizontal"?this._itemGroupLocation.y+this._itemGroupLocation.height/2:t,color:this.dataRangeOption.textStyle.color,text:n,textFont:this.getFont(this.dataRangeOption.textStyle),textBaseline:this.dataRangeOption.orient=="horizontal"?"middle":"top",textAlign:this.dataRangeOption.orient=="horizontal"?"left":"center"},hoverable:!1}},_getItemShape:function(e,t,n,r,i){return{zlevel:this._zlevelBase,style:{x:e,y:t+1,width:n,height:r-2,color:i},highlightStyle:{strokeColor:i,lineWidth:1},clickable:!0}},__ondrift:function(e,t,n){var r=this._calculableLocation.x,i=this._calculableLocation.y,s=this._calculableLocation.width,o=this._calculableLocation.height;return this.dataRangeOption.orient=="horizontal"?e.style.x+t<=r?e.style.x=r:e.style.x+t+e.style.width>=r+s?e.style.x=r+s-e.style.width:e.style.x+=t:e.style.y+n<=i?e.style.y=i:e.style.y+n+e.style.height>=i+o?e.style.y=i+o-e.style.height:e.style.y+=n,e._type=="filler"?this._syncHandleShape():this._syncFillerShape(e),this.dataRangeOption.realtime&&this._syncData(),!0},__ondragend:function(){this.isDragend=!0},ondragend:function(e,t){if(!this.isDragend||!e.target)return;!this.dataRangeOption.realtime&&this._syncData(),t.dragOut=!0,t.dragIn=!0,!this.dataRangeOption.realtime&&!1&&this.messageCenter.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:this._range.end,end:this._range.start}},this.myChart),t.needRefresh=!1,this.isDragend=!1;return},_syncShapeFromRange:function(){var e=this.dataRangeOption.range||{};this._range.end=typeof this._range.end!="undefined"?this._range.end:typeof e.start!="undefined"?e.start:0,this._range.start=typeof this._range.start!="undefined"?this._range.start:typeof e.end!="undefined"?e.end:100;if(this._range.start!=100||this._range.end!==0){if(this.dataRangeOption.orient=="horizontal"){var t=this._fillerShae.style.width;this._fillerShae.style.x+=t*(100-this._range.start)/100,this._fillerShae.style.width=t*(this._range.start-this._range.end)/100}else{var n=this._fillerShae.style.height;this._fillerShae.style.y+=n*(100-this._range.start)/100,this._fillerShae.style.height=n*(this._range.start-this._range.end)/100}this.zr.modShape(this._fillerShae.id),this._syncHandleShape()}},_syncHandleShape:function(){var e=this._calculableLocation.x,t=this._calculableLocation.y,n=this._calculableLocation.width,r=this._calculableLocation.height;this.dataRangeOption.orient=="horizontal"?(this._startShape.style.x=this._fillerShae.style.x,this._startMask.style.width=this._startShape.style.x-e,this._endShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._endMask.style.x=this._endShape.style.x,this._endMask.style.width=e+n-this._endShape.style.x,this._range.start=Math.ceil(100-(this._startShape.style.x-e)/n*100),this._range.end=Math.floor(100-(this._endShape.style.x-e)/n*100)):(this._startShape.style.y=this._fillerShae.style.y,this._startMask.style.height=this._startShape.style.y-t,this._endShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._endMask.style.y=this._endShape.style.y,this._endMask.style.height=t+r-this._endShape.style.y,this._range.start=Math.ceil(100-(this._startShape.style.y-t)/r*100),this._range.end=Math.floor(100-(this._endShape.style.y-t)/r*100)),this._syncShape()},_syncFillerShape:function(e){var t=this._calculableLocation.x,n=this._calculableLocation.y,r=this._calculableLocation.width,i=this._calculableLocation.height,s,o;this.dataRangeOption.orient=="horizontal"?(s=this._startShape.style.x,o=this._endShape.style.x,e.id==this._startShape.id&&s>=o?(o=s,this._endShape.style.x=s):e.id==this._endShape.id&&s>=o&&(s=o,this._startShape.style.x=s),this._fillerShae.style.x=s,this._fillerShae.style.width=o-s,this._startMask.style.width=s-t,this._endMask.style.x=o,this._endMask.style.width=t+r-o,this._range.start=Math.ceil(100-(s-t)/r*100),this._range.end=Math.floor(100-(o-t)/r*100)):(s=this._startShape.style.y,o=this._endShape.style.y,e.id==this._startShape.id&&s>=o?(o=s,this._endShape.style.y=s):e.id==this._endShape.id&&s>=o&&(s=o,this._startShape.style.y=s),this._fillerShae.style.y=s,this._fillerShae.style.height=o-s,this._startMask.style.height=s-n,this._endMask.style.y=o,this._endMask.style.height=n+i-o,this._range.start=Math.ceil(100-(s-n)/i*100),this._range.end=Math.floor(100-(o-n)/i*100)),this._syncShape()},_syncShape:function(){this._startShape.position=[this._startShape.style.x-this._startShape.style._x,this._startShape.style.y-this._startShape.style._y],this._startShape.style.text=this._textFormat(this._gap*this._range.start+this.dataRangeOption.min),this._startShape.style.color=this._startShape.highlightStyle.strokeColor=this.getColor(this._gap*this._range.start+this.dataRangeOption.min),this._endShape.position=[this._endShape.style.x-this._endShape.style._x,this._endShape.style.y-this._endShape.style._y],this._endShape.style.text=this._textFormat(this._gap*this._range.end+this.dataRangeOption.min),this._endShape.style.color=this._endShape.highlightStyle.strokeColor=this.getColor(this._gap*this._range.end+this.dataRangeOption.min),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this.zr.modShape(this._startMask.id),this.zr.modShape(this._endMask.id),this.zr.modShape(this._fillerShae.id),this.zr.refresh()},_syncData:function(){this.dataRangeOption.realtime&&this.messageCenter.dispatch(s.EVENT.DATA_RANGE,null,{range:{start:this._range.end,end:this._range.start}},this.myChart)},__dataRangeSelected:function(e){var t=e.target._idx;this._selectedMap[t]=!this._selectedMap[t],this.messageCenter.dispatch(s.EVENT.REFRESH,null,null,this.myChart)},_textFormat:function(e,t){e=e.toFixed(this.dataRangeOption.precision),t=typeof t!="undefined"?t.toFixed(this.dataRangeOption.precision):"";if(this.dataRangeOption.formatter){if(typeof this.dataRangeOption.formatter=="string")return this.dataRangeOption.formatter.replace("{value}",e).replace("{value2}",t);if(typeof this.dataRangeOption.formatter=="function")return this.dataRangeOption.formatter.call(this.myChart,e,t)}return t!==""?e+" - "+t:e},refresh:function(e){if(e){this.option=e,this.option.dataRange=this.reformOption(this.option.dataRange),this.option.dataRange.padding=this.reformCssArray(this.option.dataRange.padding),this.dataRangeOption=this.option.dataRange;var t=this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable?100:this.dataRangeOption.splitNumber;this._colorList=a.getGradientColors(this.dataRangeOption.color,Math.max((t-this.dataRangeOption.color.length)/(this.dataRangeOption.color.length-1),0)+1);if(this._colorList.length>t){var n=this._colorList.length,r=[this._colorList[0]],i=n/(t-1);for(var s=1;sthis.dataRangeOption.max&&(e=this.dataRangeOption.max);if(this.dataRangeOption.calculable)if(e-(this._gap*this._range.start+this.dataRangeOption.min)>5e-5||e-(this._gap*this._range.end+this.dataRangeOption.min)<-0.00005)return null;var t=this._colorList.length-Math.ceil((e-this.dataRangeOption.min)/(this.dataRangeOption.max-this.dataRangeOption.min)*this._colorList.length);return t==this._colorList.length&&t--,this._selectedMap[t]?this._colorList[t]:null}},o.inherits(f,t),e("../component").define("dataRange",f),f}),define("echarts/chart/scatter",["require","../component/base","./base","../util/shape/Symbol","../component/axis","../component/grid","../component/dataZoom","../component/dataRange","../config","zrender/tool/util","zrender/tool/color","../chart"],function(e){function u(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this),this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("../util/shape/Symbol");e("../component/axis"),e("../component/grid"),e("../component/dataZoom"),e("../component/dataRange");var i=e("../config"),s=e("zrender/tool/util"),o=e("zrender/tool/color");return u.prototype={type:i.CHART_TYPE_SCATTER,_buildShape:function(){var e=this.series;this._sIndex2ColorMap={},this._symbol=this.option.symbolList,this._sIndex2ShapeMap={},this.selectedMap={},this.xMarkMap={};var t=this.component.legend,n=[],r,s,u,a;for(var f=0,l=e.length;fs[0]&&(i.min0=s[0],i.minY0=r[o][1],i.minX0=r[o][0]),i.max0s[1]&&(i.min1=s[1],i.minY1=r[o][1],i.minX1=r[o][0]),i.max1n.largeThreshold){this.shapeList.push(this._getLargeSymbol(r,this.getItemStyleColor(this.query(n,"itemStyle.normal.color"),o,-1)||this._sIndex2ColorMap[o]));continue}for(var u=0,a=r.length;u0&&this._buildSinglePosition(o,t[o]);this.addShapeList()},_buildSinglePosition:function(e,t){var n=this._mapData(t),r=n.locationMap,i=n.maxDataLength;if(i===0||r.length===0)return;this._buildHorizontal(t,i,r);for(var s=0,o=t.length;s0?a="left":Math.round(i[0])<0?a="right":a="center",f.margin?(p=f.margin,c=i[0]>0?p:-p,h=i[1]>0?p:-p,c=i[0]===0?0:c,h=i[1]===0?0:h,i=this._mapVector(i,o,1)):i=this._mapVector(i,o,1.2),u.textAlign=a,u.x=i[0]+c,u.y=i[1]+h,f.rotate?l=[f.rotate/180*Math.PI,i[0],i[1]]:l=[0,0,0],this.shapeList.push(new n({zlevel:this._zlevelBase,style:u,draggable:!1,hoverable:!1,rotation:l}))}},getIndicatorText:function(e,t){return this.polar[e]&&this.polar[e].__ecIndicator[t]&&this.polar[e].__ecIndicator[t].text},getDropBox:function(e){var e=e||0,t=this.polar[e],n=this.getCenter(e),r=t.__ecIndicator,i=r.length,s=[],o,u,a=t.type;if(a=="polygon"){for(var f=0;fu||u===undefined)&&(u=e),(e=1)a=Math.floor(a/l)*l-l;else{if(l===0)return u>0?(d=0,p=2*u):u===0?(d=0,p=100):(p=0,d=2*a),{max:p,min:d};c=(l+"").split(".")[1],h=c.length,a=Math.floor(a*Math.pow(10,h))/Math.pow(10,h)-l}Math.abs(a)<=l&&(a=0),u=a+Math.floor(l*Math.pow(10,h)*(n+1))/Math.pow(10,h)}else a=a>0?0:a;return r&&(u=u>0?u*1.2:u*.8,a=a>0?a*.8:a*1.2),{max:u,min:a}},_getDelta:function(e,t,n,r,i){var s=(e-t)/n,o,u;if(s>1)return i?(s=Math.ceil(s),s%i>0?(Math.ceil(s/i)+1)*i:s):(o=(s+"").split(".")[0],u=o.length,o.charAt(0)>=5?Math.pow(10,u):(o.charAt(0)-0+1)*Math.pow(10,u-1));if(s==1)return 1;if(s===0)return 0;if(!r){o=(s+"").split(".")[1],u=0;while(o[u]=="0")u++;return o[u]>=5?"0."+o.substring(0,u+1)-0+1/Math.pow(10,u):"0."+o.substring(0,u+1)-0+1/Math.pow(10,u+1)}return Math.ceil(s*Math.pow(10,r))/Math.pow(10,r)},getVector:function(e,t,n){e=e||0,t=t||0;var r=this.polar[e].__ecIndicator;if(t>=r.length)return;var i=this.polar[e].__ecIndicator[t],s=this.getCenter(e),o=i.vector,u=i.value.max,a=i.value.min,f;if(typeof n=="undefined")return s;switch(n){case"min":n=a;break;case"max":n=u;break;case"center":n=(u+a)/2}return u!=a?f=(n-a)/(u-a):f=.5,this._mapVector(o,s,f)},isInside:function(e){var t=this.getNearestIndex(e);return t?t.polarIndex:-1},getNearestIndex:function(e){var t,n,r,i,s,o,u,a,l;for(var c=0;ci[0])return{polarIndex:c,valueIndex:Math.floor((l+a/2)/a)%u}}},getIndicator:function(e){var e=e||0;return this.polar[e].indicator},refresh:function(e){e&&(this.option=e,this.polar=this.option.polar,this.series=this.option.series),this.clear(),this._buildShape()}},a.inherits(l,t),e("../component").define("polar",l),l}),define("echarts/chart/radar",["require","../component/base","./base","zrender/shape/Polygon","../component/polar","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../util/accMath","../chart"],function(e){function a(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this),this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("zrender/shape/Polygon");e("../component/polar");var i=e("../config"),s=e("../util/ecData"),o=e("zrender/tool/util"),u=e("zrender/tool/color");return a.prototype={type:i.CHART_TYPE_RADAR,_buildShape:function(){this.selectedMap={},this._symbol=this.option.symbolList,this._queryTarget,this._dropBoxList=[],this._radarDataCounter=0;var e=this.series,t=this.component.legend,n;for(var r=0,s=e.length;r=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height)return i.isInsidePath(this._pathProxy.pathCommands,0,"fill",e,t)}},r.inherits(s,t),s}),define("echarts/util/kwargs",[],function(){function e(e,t){var n=new RegExp("(\\/\\*[\\w\\'\\,\\(\\)\\s\\r\\n\\*]*\\*\\/)|(\\/\\/[\\w\\s\\'][^\\n\\r]*$)|(\\/]*>)","gim"),r=new RegExp("\\s+","gim"),i=new RegExp("function.*?\\((.*?)\\)","i"),s=e.toString().replace(n,"").replace(r,"").match(i)[1].split(",");return t!==Object(t)&&(t={}),function(){var n=Array.prototype.slice.call(arguments),r=n[n.length-1];r&&r.constructor===Object?n.pop():r={};for(var i=0;i=0){var n=e.split(/\s*:\s*/),r=parseInt(n[2]||1,10),i,s;if(r===0)throw new Error("Slice step cannot be zero");return r>0?(i=parseInt(n[0]||0,10),s=parseInt(n[1]||t,10)):(i=parseInt(n[0]||t-1,10),s=parseInt(n[1]||-1,10)),i<0&&(i=t+i),s<0&&n[1]&&(s=t+s),r>0?(i=Math.max(Math.min(t,i),0),s=Math.max(Math.min(t,s),0)):(i=Math.max(Math.min(t-1,i),-1),s=Math.max(Math.min(t-1,s),-1)),[i,s,r]}var i=parseInt(e,10);i<0&&(i=t+i);if(i<0||i>t)throw new Error(N(e));return i=Math.max(Math.min(t-1,i),0),[i,i+1,1]}function g(e){var t=e[0];for(var n=1;n=this._shape.length)throw new Error(T(e[r]));if(e.length<=1)return this;var i=n.slice();for(var r=0;r=Math.ceil(e.length/2);s--)i[e[r]]=e[s],i[e[s]]=e[r];return this._transposelike(i,t)}),swapaxes:t(function(e,t,n){return this.transpose([e,t],n)}),rollaxis:t(function(e,t,n){if(e>=this._shape.length)throw new Error(T(e));var r=[];for(var i=0;i=this._shape.length||e<0)throw new Error(T(e));var s=this._shape.slice();s.splice(e,1);if(t&&!S(s,t._shape))throw new Error(x(s,t._shape));t||(t=new v(this._dtype),t.initFromShape(s));var o=t._array,u=w(this._shape,e),a=this._shape[e],f=u*a;return n.call(this,o,i,f,a,u),t}return r.call(this,i)},_withPreprocess2:function(e,t,n,r){var i=this._array;if(!this._size)return;if(t&&!S(this._shape,t._shape))throw new Error(x(this._shape,t._shape));t||(t=new v(this._dtype),t.initFromShape(this._shape));var s=t._array;if(typeof e!="undefined"){e<0&&(e=this._shape.length+e);if(e>=this._shape.length||e<0)throw new Error(T(e));if(e>=this._shape.length)throw new Error(T(e));var o=w(this._shape,e),u=this._shape[e],a=o*u;n.call(this,s,i,a,u,o)}else t.reshape([this._size]),r.call(this,s,i);return t},max:t(function(){function e(e,t,n,r,i){var s=0;for(var o=0;of&&(f=c),a+=i}e[s++]=f}}function t(e){var t=e[0];for(var n=1;nt&&(t=e[n]);return t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}()),min:t(function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h,a=c),f+=i}e[s++]=a}}function t(e){var t=e[0],n=0;for(var r=1;rt&&(n=r,t=e[r]);return n}return function(n,r){return this._withPreprocess1(n,r,e,t)}}()),argmin:t(function(){function e(e,t,n,r,i){var s=0;for(var o=0;ol&&(l=h),a+=i}e[s++]=l-f}}function t(e){var t=e[0],n=e[0];for(var r=1;rn&&(n=e[r]);return n-t}return function(n,r){return this._withPreprocess1(n,r,e,t)}}()),sort:t(function(e,t){e<0&&(e=this._shape.length+e);var n;t==="ascending"?n=function(e,t){return e-t}:t==="descending"&&(n=function(e,t){return t-e});var r=this._array,i=w(this._shape,e),s=this._shape[e],o=i*s,u=new Array(s);for(var a=0;as&&(s=a)}var f=s-i,l=t-e;for(var u=0;u=0&&y>=0){if(e._shape[g]==1)i.unshift(t._shape[y]),b=e.repeat(t._shape[y],g);else if(t._shape[y]==1)i.unshift(e._shape[g]),E=t.repeat(e._shape[g],y);else{if(t._shape[y]!=e._shape[g])throw new Error(x(e._shape,t._shape));i.unshift(e._shape[g])}g--,y--}for(var T=g;T>=0;T--)i.unshift(e._shape[T]);for(var T=y;T>=0;T--)i.unshift(t._shape[T]);e=b,t=E}if(!r)r=new v(this._dtype),r.initFromShape(i);else if(!S(i,r._shape))throw new Error(x(i,r._shape));var N=r._array,C,k,L,A;d?(C=t._shape.length-1,k=!1,L=e,A=t._array):m?(C=e._shape.length-1,k=!0,A=t,L=e._array):(C=Math.abs(e._shape.length-t._shape.length),k=e._shape.length>=t._shape.length,L=e._array,A=t._array);var O=w(i,C),M=i[C],_=O*M,D=r._size/_,P,H,B,j=0;if(k)if(m)for(var F=0;F0)for(var c=r[0];cr[1];c+=r[2])l(e+1,t+s*c);else if(r[2]>0)for(var c=r[0];cr[1];c+=r[2])for(var h=0;hthis._shape.length)throw new Error("Too many indices");var o=i.length,u;s.length?(t=new v(this._dtype),t.initFromShape(s),u=t._array):u=[];var a=this._array,f=0;return l(0,0),s.length?t:u[0]},set:function(e,t){typeof e=="number"&&(e=e.toString());var n=E(this._shape),r=this._parseRanges(e),i=r[0],s=r[1];if(i.length>this._shape.length)throw new Error("Too many indices");var o=typeof t=="number",u=i.length,a=this._array;if(o)var f=t;else{if(!S(s,t.shape()))throw new Error(x(s,t.shape()));var f=t._array}var l=0,c=function(e,t){var r=i[e],s=n[e];if(e0)for(var h=r[0];hr[1];h+=r[2])c(e+1,t+s*h);else if(r[2]>0)for(var h=r[0];hr[1];h+=r[2])for(var p=0;pu)throw new Error(N(e[a]));if(e[a]=0&&h>=0){if(l[c]===1)p=t.repeat(f[h],c);else if(l[c]!==f[h])throw new Error(x(l,f));c--,h--}t=p;var d=w(this._shape,n),u=this._shape[n],m=u*d,y=this._size/m,b=e.length,E=new Uint32Array(y*b),S=0;for(var T=0;T=0){for(var a=_-1;a>=D;a--)i[P--]=A[a];_=D,D=E[--M];for(var a=0;a=0;a--)i[P--]=A[a];return this._array=i,this._shape=k,this._size=L,this}),append:function(){console.warn("TODO")},"delete":t(function(e,t){var n=this._array;typeof e=="number"&&(e=[e]);var r=this._size;typeof t=="undefined"&&(this._shape=[r],t=0);var i=w(this._shape,t),s=this._shape[t],o=i*s,u=0;for(var a=0;as)throw new Error(N(l));if(l=0){var a=Math.floor((u[1]-u[0])/u[2]);a=a<0?0:a,r.push(a)}i++}for(;i0&&(E.style.brushType="both"),E.highlightStyle.lineWidth>0&&(E.highlightStyle.brushType="both"),a.pack(E,this.chordSeries[0],0,t[m],m,g.name);if(u){var S=[b+w]/2;S%=360;var x=S<=90||S>=270;S=S*Math.PI/180;var T=[Math.cos(S),-Math.sin(S)],N=this.showScaleText?35+h:h,C=l.scale([],T,this.outerRadius+N);l.add(C,C,this.center);var k={zlevel:this._zlevelBase-1,hoverable:!1,style:{text:g.name,textAlign:x?"left":"right",color:f}};c?(k.rotation=x?S:Math.PI+S,x?k.style.x=this.outerRadius+N:k.style.x=-this.outerRadius-N,k.style.y=0,k.position=this.center):(k.style.x=C[0],k.style.y=C[1]),k.style.textColor=this.deepQuery([g,this.chordSerieSample],"itemStyle.normal.label.textStyle.color")||"#fff",k.style.textFont=this.getFont(this.deepQuery([g,this.chordSerieSample],"itemStyle.normal.label.textStyle")),k=new r(k),this.shapeList.push(k)}E.onmouseover=d(m),E.onmouseout=v(),E=new s(E),this.shapeList.push(E),this.sectorShapes.push(E)}},_buildChords:function(e,t){var n=e.length;if(!n)return;var r=e[0][0].length,i=this.chordSerieSample.itemStyle.normal.chordStyle.lineStyle,s=this.chordSerieSample.itemStyle.emphasis.chordStyle.lineStyle;for(var u=0;u=270,E={zlevel:this._zlevelBase-1,hoverable:!1,style:{x:w?this.outerRadius+this.scaleLineLength+4:-this.outerRadius-this.scaleLineLength-4,y:0,text:Math.round(b.shift()*10)/10+t,textAlign:w?"left":"right"},position:this.center.slice(),rotation:w?[h/180*Math.PI,0,0]:[(h+180)/180*Math.PI,0,0]};E=new r(E),this.shapeList.push(E),g+=this.scaleUnitAngle*5}}},normalizeValue:function(e){var t=[],n=(new c(e)).max(),r,i;n>1e4?(r="k",i=.001):n>1e7?(r="m",i=1e-6):n>1e10?(r="b",i=1e-9):(r="",i=1);for(var s=0;s0&&(i=1/Math.sqrt(i),e[0]=t[0]*i,e[1]=t[1]*i),e},negate:function(e,t){return e[0]=-t[0],e[1]=-t[1],e},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e},set:function(e,t,n){return e[0]=t,e[1]=n,e}}:n=t("zrender/tool/vector");var i=typeof Float32Array=="undefined"?Array:Float32Array;s.prototype.beforeUpdate=function(){for(var e=0;e=e&&this.bbox[1]<=t&&this.bbox[3]>=t},s.prototype.setBBox=function(e,t,n,r){this.bbox[0]=e,this.bbox[1]=t,this.bbox[2]=n,this.bbox[3]=r,this.size=(n-e+r-t)/2},s.prototype._newSubRegion=function(){var e=this.subRegions[this.nSubRegions];return e||(e=new s,this.subRegions[this.nSubRegions]=e),this.nSubRegions++,e},s.prototype._addNodeToSubRegion=function(e){var t=this.findSubRegion(e.position[0],e.position[1]),n=this.bbox;if(!t){var r=(n[0]+n[2])/2,i=(n[1]+n[3])/2,s=(n[2]-n[0])/2,o=(n[3]-n[1])/2,u=e.position[0]>=r?1:0,a=e.position[1]>=i?1:0,t=this._newSubRegion();t.setBBox(u*s+n[0],a*o+n[1],(u+1)*s+n[0],(a+1)*o+n[1])}t.addNode(e)},s.prototype._updateCenterOfMass=function(e){this.centerOfMass==null&&(this.centerOfMass=n.create());var t=this.centerOfMass[0]*this.mass,r=this.centerOfMass[1]*this.mass;t+=e.position[0]*e.mass,r+=e.position[1]*e.mass,this.mass+=e.mass,this.centerOfMass[0]=t/this.mass,this.centerOfMass[1]=r/this.mass},a.prototype.initNodes=function(e,t,n){this.temperature=1;var r=e.length/2;this.nodes.length=0;var i=typeof n!="undefined";for(var s=0;s0&&this.applyNodeGravity(o)}for(var t=0;t0){n.scale(f,f,1/p);var d=n.len(s.speedPrev);d>0&&(p=Math.min(p/d,this.maxSpeedIncrease)*d,n.scaleAndAdd(l,s.speedPrev,f,p))}var v=n.len(l),h=Math.min(v,100)/(v+.1);n.scale(l,l,h),n.add(s.position,s.position,l)}},a.prototype.applyRegionToNodeRepulsion=function(){var e=n.create();return function(r,i){if(r.node)this.applyNodeToNodeRepulsion(r.node,i,!0);else{n.sub(e,i.position,r.centerOfMass);var s=e[0]*e[0]+e[1]*e[1];if(s>this.barnesHutTheta*r.size*r.size){var o=this._k*this._k*(i.mass+r.mass)/(s+1);n.scaleAndAdd(i.force,i.force,e,o*2)}else for(var u=0;u0?u=a*f/(l*l):l<=0&&(u=a*10*f)}else u=a*f/o;s||n.scaleAndAdd(r.force,r.force,e,u*2),n.scaleAndAdd(i.force,i.force,e,-u*2)}}(),a.prototype.applyEdgeAttraction=function(){var e=n.create();return function(r){var i=r.node1,s=r.node2;n.sub(e,i.position,s.position);var o=n.len(e),u;this.edgeWeightInfluence===0?u=1:this.edgeWeightInfluence==1?u=r.weight:u=Math.pow(r.weight,this.edgeWeightInfluence);var a;if(this.preventOverlap){o=o-i.size-s.size;if(o<=0)return}var a=-u*o/this._k;n.scaleAndAdd(i.force,i.force,e,a),n.scaleAndAdd(s.force,s.force,e,-a)}}(),a.prototype.applyNodeGravity=function(){var e=n.create();return function(t){n.sub(e,this.center,t.position),this.width>this.height?e[1]*=this.width/this.height:e[0]*=this.height/this.width;var r=n.len(e)/100;this.strongGravity?n.scaleAndAdd(t.force,t.force,e,r*this.gravity*t.mass):n.scaleAndAdd(t.force,t.force,e,this.gravity*t.mass/(r+1))}}(),a.prototype.updateBBox=function(){var e=Infinity,t=Infinity,n=-Infinity,r=-Infinity;for(var i=0;i0?(a.layout.radius=(a.layout.radius-s)*(i-r)/f+r,a.layout.mass=a.layout.radius/i):(a.layout.radius=(i-r)/2,a.layout.mass=.5)}for(var u=0;uo&&(o=v.layout.weight)}for(var u=0;u.01&&this._layout.step(this._steps)},refresh:function(e){e&&(this.option=e,this.series=this.option.series),this._init()},dispose:function(){this.clear(),this.shapeList=null,this.effectList=null,this._layout.dispose(),this._layout=null,this.__nodePositionMap={}}},l.inherits(p,n),l.inherits(p,t),e("../chart").define("force",p),p}),define("echarts/util/shape/HalfSmoothPolygon",["require","zrender/shape/Base","zrender/shape/util/smoothBezier","zrender/tool/util","zrender/shape/Polygon"],function(e){function i(e){t.call(this,e)}var t=e("zrender/shape/Base"),n=e("zrender/shape/util/smoothBezier"),r=e("zrender/tool/util");return i.prototype={type:"half-smooth-polygon",buildPath:function(t,r){var i=r.pointList;if(i.length<2)return;if(r.smooth){var s=n(i.slice(0,-2),r.smooth,!1,r.smoothConstraint);t.moveTo(i[0][0],i[0][1]);var o,u,a,f=i.length;for(var l=0;l0&&this._buildSinglePosition(f,t[f]);this.addShapeList()},_buildSinglePosition:function(e,t){var n=this._mapData(t),r=n.locationMap,i=n.maxDataLength;if(i===0||r.length===0)return;switch(e){case"bottom":case"top":this._buildHorizontal(t,i,r,this.xMarkMap);break;case"left":case"right":this._buildVertical(t,i,r,this.xMarkMap)}for(var s=0,o=t.length;s0&&(this.finalPLMap[s]=this.finalPLMap[s]||[],this.finalPLMap[s].push(g[s]),g[s]=[]);continue}b>=0?(p-=T>0?l.getCoordSize(b):d-l.getCoord(b),h=p):b<0&&(v+=T>0?l.getCoordSize(b):l.getCoord(b)-m,h=v),g[s].push([c,h,w,a.getNameByIndex(w),c,d]),r[s].min>b&&(r[s].min=b,r[s].minY=h,r[s].minX=c),r[s].max0&&(this.finalPLMap[k]=this.finalPLMap[k]||[],this.finalPLMap[k].push(g[k]),g[k]=[]);for(var S=0,x=n.length;S0&&(r[s].average=(r[s].sum/r[s].counter).toFixed(2)-0),h=this.component.yAxis.getAxis(i[s].yAxisIndex||0).getCoord(r[s].average),r[s].averageLine=[[this.component.grid.getX(),h],[this.component.grid.getXend(),h]],r[s].minLine=[[this.component.grid.getX(),r[s].minY],[this.component.grid.getXend(),r[s].minY]],r[s].maxLine=[[this.component.grid.getX(),r[s].maxY],[this.component.grid.getXend(),r[s].maxY]];this._buildBorkenLine(e,this.finalPLMap,a,"horizontal")},_buildVertical:function(e,t,n,r){var i=this.series,s=n[0][0],o=i[s],u=o.yAxisIndex,a=this.component.yAxis.getAxis(u),f,l,c,h,p,d,v,m,g={},y,b;for(var w=0,E=t;w0&&(this.finalPLMap[s]=this.finalPLMap[s]||[],this.finalPLMap[s].push(g[s]),g[s]=[]);continue}b>=0?(p+=T>0?l.getCoordSize(b):l.getCoord(b)-d,c=p):b<0&&(v-=T>0?l.getCoordSize(b):m-l.getCoord(b),c=v),g[s].push([c,h,w,a.getNameByIndex(w),d,h]),r[s].min>b&&(r[s].min=b,r[s].minX=c,r[s].minY=h),r[s].max0&&(this.finalPLMap[k]=this.finalPLMap[k]||[],this.finalPLMap[k].push(g[k]),g[k]=[]);for(var S=0,x=n.length;S0&&(r[s].average=(r[s].sum/r[s].counter).toFixed(2)-0),c=this.component.xAxis.getAxis(i[s].xAxisIndex||0).getCoord(r[s].average),r[s].averageLine=[[c,this.component.grid.getYend()],[c,this.component.grid.getY()]],r[s].minLine=[[r[s].minX,this.component.grid.getYend()],[r[s].minX,this.component.grid.getY()]],r[s].maxLine=[[r[s].maxX,this.component.grid.getYend()],[r[s].maxX,this.component.grid.getY()]];this._buildBorkenLine(e,this.finalPLMap,a,"vertical")},_buildBorkenLine:function(e,t,n,i){var o=this.series,l;for(var c=e.length-1;c>=0;c--){var h=e[c],p=o[h],d=t[h];if(p.type===this.type&&d!=null){var v=this._getBbox(h,i),m=this._sIndex2ColorMap[h],g=this.query(p,"itemStyle.normal.lineStyle.width"),y=this.query(p,"itemStyle.normal.lineStyle.type"),b=this.query(p,"itemStyle.normal.lineStyle.color"),w=this.getItemStyleColor(this.query(p,"itemStyle.normal.color"),h,-1),E=this.query(p,"itemStyle.normal.areaStyle")!=null,S=this.query(p,"itemStyle.normal.areaStyle.color");for(var x=0,T=d.length;x=0;r--){f=this.shapeList[r]._seriesIndex;if(n[f]&&!n[f][3]){if(this.shapeList[r]._main&&this.shapeList[r].style.pointList.length>1){l=this.shapeList[r].style.pointList,o=Math.abs(l[0][0]-l[1][0]),a=Math.abs(l[0][1]-l[1][1]),c=this.shapeList[r]._orient==="horizontal";if(n[f][2]){if(this.shapeList[r].type==="polygon"){var h=l.length;this.shapeList[r].style.pointList[h-3]=l[h-2],c?this.shapeList[r].style.pointList[h-3][0]=l[h-4][0]:this.shapeList[r].style.pointList[h-3][1]=l[h-4][1],this.shapeList[r].style.pointList[h-2]=l[h-1]}this.shapeList[r].style.pointList.pop(),c?(s=o,u=0):(s=0,u=-a)}else{this.shapeList[r].style.pointList.shift();if(this.shapeList[r].type==="polygon"){var p=this.shapeList[r].style.pointList.pop();c?p[0]=l[0][0]:p[1]=l[0][1],this.shapeList[r].style.pointList.push(p)}c?(s=-o,u=0):(s=0,u=a)}this.zr.modShape(this.shapeList[r].id,{style:{pointList:this.shapeList[r].style.pointList}},!0)}else{if(n[f][2]&&this.shapeList[r]._dataIndex===t[f].data.length-1){this.zr.delShape(this.shapeList[r].id);continue}if(!n[f][2]&&this.shapeList[r]._dataIndex===0){this.zr.delShape(this.shapeList[r].id);continue}}this.shapeList[r].position=[0,0],this.zr.animate(this.shapeList[r].id,"").when(500,{position:[s,u]}).start()}}}},i.prototype.iconLibrary.legendLineIcon=c,a.inherits(l,n),a.inherits(l,t),e("../chart").define("line",l),l}),define("echarts/chart/bar",["require","../component/base","./base","zrender/shape/Rectangle","../component/axis","../component/grid","../component/dataZoom","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../chart"],function(e){function a(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this),this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("zrender/shape/Rectangle");e("../component/axis"),e("../component/grid"),e("../component/dataZoom");var i=e("../config"),s=e("../util/ecData"),o=e("zrender/tool/util"),u=e("zrender/tool/color");return a.prototype={type:i.CHART_TYPE_BAR,_buildShape:function(){var e=this.series;this.selectedMap={},this.xMarkMap={},this._sIndex2colorMap={};var t={top:[],bottom:[],left:[],right:[]},n,r,s,o;for(var u=0,a=e.length;u0&&this._buildSinglePosition(f,t[f],this.xMarkMap);this.addShapeList()},_buildSinglePosition:function(e,t,n){var r=this._mapData(t),i=r.locationMap,s=r.maxDataLength;if(s===0||i.length===0)return;switch(e){case"bottom":case"top":this._buildHorizontal(s,i,t,n);break;case"left":case"right":this._buildVertical(s,i,t,n)}},_mapData:function(e){var t=this.series,n,r=0,i={},s="__kener__stack__",o,u,a=this.component.legend,f=[],l=0,c;for(var h=0,p=e.length;h0&&(c.style.x+=1,c.style.y+=1,c.style.width-=2,c.style.height-=2,c.style.strokeColor=c.highlightStyle.strokeColor=n.itemStyle.normal.barBorderColor,c.highlightStyle.lineWidth=3,c.style.brushType="both"),a.setItemShape(u,c))):(this.selectedMap[u]=!0,this._sIndex2colorMap[e[h]]=this.zr.getColor(e[h])),this.selectedMap[u]&&(o=n.stack||s+e[h],i[o]==null?(i[o]=r,f[r]=[e[h]],r++):f[i[o]].push(e[h])),l=Math.max(l,n.data.length);return{locationMap:f,maxDataLength:l}},_buildHorizontal:function(e,t,n,i){var s=this.series,o=t[0][0],u=s[o],a=u.xAxisIndex,f=this.component.xAxis.getAxis(a),l,c,h=this._mapSize(f,t),p=h.gap,d=h.barGap,v=h.barWidthMap,m=h.barWidth,g=h.barMinHeightMap,y,b=h.interval,w,E,S,x,T,N,C,k,L;for(var A=0,O=e;A0?(y=D>0?c.getCoordSize(L):x-c.getCoord(L),P===1&&g[o]>y&&(y=g[o]),S-=y,E=S):L<0?(y=D>0?c.getCoordSize(L):c.getCoord(L)-N,P===1&&g[o]>y&&(y=g[o]),E=T,T+=y):(y=0,S-=y,E=S),i[o][A]=w+(v[o]||m)/2,i[o].min>L&&(i[o].min=L,i[o].minY=E,i[o].minX=i[o][A]),i[o].max0&&(i[o].average=(i[o].sum/i[o].counter).toFixed(2)-0),E=this.component.yAxis.getAxis(s[o].yAxisIndex||0).getCoord(i[o].average),i[o].averageLine=[[this.component.grid.getX(),E],[this.component.grid.getXend(),E]],i[o].minLine=[[this.component.grid.getX(),i[o].minY],[this.component.grid.getXend(),i[o].minY]],i[o].maxLine=[[this.component.grid.getX(),i[o].maxY],[this.component.grid.getXend(),i[o].maxY]],i[o].isHorizontal=!0,this.buildMark(o)},_buildVertical:function(e,t,n,i){var s=this.series,o=t[0][0],u=s[o],a=u.yAxisIndex,f=this.component.yAxis.getAxis(a),l,c,h=this._mapSize(f,t),p=h.gap,d=h.barGap,v=h.barWidthMap,m=h.barWidth,g=h.barMinHeightMap,y,b=h.interval,w,E,S,x,T,N,C,k,L;for(var A=0,O=e;A0?(y=D>0?c.getCoordSize(L):c.getCoord(L)-x,P===1&&g[o]>y&&(y=g[o]),w=S,S+=y):L<0?(y=D>0?c.getCoordSize(L):N-c.getCoord(L),P===1&&g[o]>y&&(y=g[o]),T-=y,w=T):(y=0,w=S,S+=y),i[o][A]=E-(v[o]||m)/2,i[o].min>L&&(i[o].min=L,i[o].minX=w+y,i[o].minY=i[o][A]),i[o].max0&&(i[o].average=(i[o].sum/i[o].counter).toFixed(2)-0),w=this.component.xAxis.getAxis(s[o].xAxisIndex||0).getCoord(i[o].average),i[o].averageLine=[[w,this.component.grid.getYend()],[w,this.component.grid.getY()]],i[o].minLine=[[i[o].minX,this.component.grid.getYend()],[i[o].minX,this.component.grid.getY()]],i[o].maxLine=[[i[o].maxX,this.component.grid.getYend()],[i[o].maxX,this.component.grid.getY()]],i[o].isHorizontal=!1,this.buildMark(o)},_mapSize:function(e,t,n){var r=this.series,i,s={},o={},u,a=0,f=0,l,c,h,p,d=1;for(var v=0,m=t.length;v1?typeof c=="string"&&c.match(/%$/)?Math.floor(e.getGap()*(100-parseFloat(c))/100):e.getGap()-c:f,x=0,l=a>1?Math.floor((S-f)/(a-1)):0;if(l<0)return this._mapSize(e,t,!0)}return{barWidthMap:s,barMinHeightMap:o,gap:S,barWidth:x,barGap:l,interval:d}},_getBarItem:function(e,t,n,r,i,o,a,f){var l=this.series,c,h=l[e],p=h.data[t],d=this._sIndex2colorMap[e],v=[p,h],m=this.deepQuery(v,"itemStyle.normal.color")||d,g=this.deepQuery(v,"itemStyle.emphasis.color"),y=this.deepMerge(v,"itemStyle.normal"),b=y.barBorderWidth,w=this.deepMerge(v,"itemStyle.emphasis");c={zlevel:this._zlevelBase,clickable:this.deepQuery(v,"clickable"),style:{x:r,y:i,width:o,height:a,brushType:"both",color:this.getItemStyleColor(m,e,t,p),radius:y.barBorderRadius,lineWidth:b,strokeColor:y.barBorderColor},highlightStyle:{color:this.getItemStyleColor(g,e,t,p),radius:w.barBorderRadius,lineWidth:w.barBorderWidth,strokeColor:w.barBorderColor},_orient:f},c.highlightStyle.color=c.highlightStyle.color||(typeof c.style.color=="string"?u.lift(c.style.color,-0.3):c.style.color),b>0&&c.style.height>b&&c.style.width>b?(c.style.y+=b/2,c.style.height-=b,c.style.x+=b/2,c.style.width-=b):c.style.brushType="fill",c.highlightStyle.textColor=c.highlightStyle.color,c=this.addLabel(c,h,p,n,f);if(c.style.textPosition==="insideLeft"||c.style.textPosition==="insideRight"||c.style.textPosition==="insideTop"||c.style.textPosition==="insideBottom"){var E=5;switch(c.style.textPosition){case"insideLeft":c.style.textX=c.style.x+E,c.style.textY=c.style.y+c.style.height/2,c.style.textAlign="left",c.style.textBaseline="middle";break;case"insideRight":c.style.textX=c.style.x+c.style.width-E,c.style.textY=c.style.y+c.style.height/2,c.style.textAlign="right",c.style.textBaseline="middle";break;case"insideTop":c.style.textX=c.style.x+c.style.width/2,c.style.textY=c.style.y+E/2,c.style.textAlign="center",c.style.textBaseline="top";break;case"insideBottom":c.style.textX=c.style.x+c.style.width/2,c.style.textY=c.style.y+c.style.height-E/2,c.style.textAlign="center",c.style.textBaseline="bottom"}c.style.textPosition="specific",c.style.textColor=c.style.textColor||"#fff"}return this.deepQuery([p,h,this.option],"calculable")&&(this.setCalculable(c),c.draggable=!0),s.pack(c,l[e],e,l[e].data[t],t,n),c},getMarkCoord:function(e,t){var n=this.series[e],r=this.xMarkMap[e],i=this.component.xAxis.getAxis(n.xAxisIndex),s=this.component.yAxis.getAxis(n.yAxisIndex),o,u;if(!t.type||t.type!=="max"&&t.type!=="min"&&t.type!=="average")if(r.isHorizontal){o=typeof t.xAxis=="string"&&i.getIndexByName?i.getIndexByName(t.xAxis):t.xAxis||0;var a=r[o];a=a!=null?a:typeof t.xAxis!="string"&&i.getCoordByIndex?i.getCoordByIndex(t.xAxis||0):i.getCoord(t.xAxis||0),u=[a,s.getCoord(t.yAxis||0)]}else{o=typeof t.yAxis=="string"&&s.getIndexByName?s.getIndexByName(t.yAxis):t.yAxis||0;var f=r[o];f=f!=null?f:typeof t.yAxis!="string"&&s.getCoordByIndex?s.getCoordByIndex(t.yAxis||0):s.getCoord(t.yAxis||0),u=[i.getCoord(t.xAxis||0),f]}else u=[r[t.type+"X"],r[t.type+"Y"],r[t.type+"Line"],r[t.type]];return u},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},addDataAnimation:function(e){var t=this.series,n={};for(var r=0,i=e.length;r=0;r--){c=s.get(this.shapeList[r],"seriesIndex");if(n[c]&&!n[c][3]&&this.shapeList[r].type==="rectangle"){h=s.get(this.shapeList[r],"dataIndex"),l=t[c];if(n[c][2]&&h===l.data.length-1){this.zr.delShape(this.shapeList[r].id);continue}if(!n[c][2]&&h===0){this.zr.delShape(this.shapeList[r].id);continue}this.shapeList[r]._orient==="horizontal"?(f=this.component.yAxis.getAxis(l.yAxisIndex||0).getGap(),a=n[c][2]?-f:f,o=0):(u=this.component.xAxis.getAxis(l.xAxisIndex||0).getGap(),o=n[c][2]?u:-u,a=0),this.shapeList[r].position=[0,0],this.zr.animate(this.shapeList[r].id,"").when(500,{position:[o,a]}).start()}}}},o.inherits(a,n),o.inherits(a,t),e("../chart").define("bar",a),a}),define("echarts/chart/pie",["require","../component/base","./base","zrender/shape/Text","zrender/shape/Ring","zrender/shape/Circle","zrender/shape/Sector","zrender/shape/BrokenLine","../config","../util/ecData","zrender/tool/util","zrender/tool/math","zrender/tool/color","../chart"],function(e){function p(e,r,i,s,o){t.call(this,e,r,i,s,o),n.call(this);var u=this;u.shapeHandler.onmouseover=function(e){var t=e.target,n=f.get(t,"seriesIndex"),r=f.get(t,"dataIndex"),i=f.get(t,"special"),s=t._lastAddRadius,o=t.style.startAngle,a=t.style.endAngle,l=t.highlightStyle.color,c=u.getLabel(n,r,i,s,o,a,l,!0);c&&u.zr.addHoverShape(c);var h=u.getLabelLine(n,r,s,t.style.r0,t.style.r,o,a,l,!0);h&&u.zr.addHoverShape(h)},this.refresh(s)}var t=e("../component/base"),n=e("./base"),r=e("zrender/shape/Text"),i=e("zrender/shape/Ring"),s=e("zrender/shape/Circle"),o=e("zrender/shape/Sector"),u=e("zrender/shape/BrokenLine"),a=e("../config"),f=e("../util/ecData"),l=e("zrender/tool/util"),c=e("zrender/tool/math"),h=e("zrender/tool/color");return p.prototype={type:a.CHART_TYPE_PIE,_buildShape:function(){var e=this.series,t=this.component.legend;this.selectedMap={},this._selected={};var n,r,o;this._selectedMode=!1;var u;for(var l=0,c=e.length;l0&&Math.abs(m-g)<15&&p<4&&this._needLabel(n,r[l],!1)&&this.deepQuery([r[l],n],"itemStyle.normal.label.position")!="center"?d+=h<4?20:-20:d=0,this._buildItem(e,l,h,d,r[l].selected,x,T,m,g,w),v||(m=g)}},_buildItem:function(e,t,n,r,i,s,o,u,a,l){var c=this.series,h=this.getSector(e,t,n,i,s,o,u,a,l);f.pack(h,c[e],e,c[e].data[t],t,c[e].data[t].name,n),h._lastAddRadius=r,this.shapeList.push(h);var p=this.getLabel(e,t,n,r,u,a,l,!1);p&&(f.pack(p,c[e],e,c[e].data[t],t,c[e].data[t].name,n),p._dataIndex=t,this.shapeList.push(p));var d=this.getLabelLine(e,t,r,s,o,u,a,l,!1);d&&(f.pack(d,c[e],e,c[e].data[t],t,c[e].data[t].name,n),d._dataIndex=t,this.shapeList.push(d))},getSector:function(e,t,n,r,i,s,u,a,f){var l=this.series,p=l[e],d=p.data[t],v=[d,p],m=this.parseCenter(this.zr,p.center),g=this.deepMerge(v,"itemStyle.normal")||{},y=this.deepMerge(v,"itemStyle.emphasis")||{},b=this.getItemStyleColor(g.color,e,t,d)||f,w=this.getItemStyleColor(y.color,e,t,d)||(typeof b=="string"?h.lift(b,-0.2):b),E={zlevel:this._zlevelBase,clickable:this.deepQuery(v,"clickable"),style:{x:m[0],y:m[1],r0:i,r:s,startAngle:u,endAngle:a,brushType:"both",color:b,lineWidth:g.borderWidth,strokeColor:g.borderColor,lineJoin:"round"},highlightStyle:{color:w,lineWidth:y.borderWidth,strokeColor:y.borderColor,lineJoin:"round"},_seriesIndex:e,_dataIndex:t};if(r){var S=((E.style.startAngle+E.style.endAngle)/2).toFixed(2)-0;E.style._hasSelected=!0,E.style._x=E.style.x,E.style._y=E.style.y;var x=this.query(p,"selectedOffset");E.style.x+=c.cos(S,!0)*x,E.style.y-=c.sin(S,!0)*x,this._selected[e][t]=!0}else this._selected[e][t]=!1;this._selectedMode&&(E.onclick=this.shapeHandler.onclick),this.deepQuery([d,p,this.option],"calculable")&&(this.setCalculable(E),E.draggable=!0);if(this._needLabel(p,d,!0)||this._needLabelLine(p,d,!0))E.onmouseover=this.shapeHandler.onmouseover;return E=new o(E),E},getLabel:function(e,t,n,i,s,o,u,a){var f=this.series,h=f[e],p=h.data[t];if(!this._needLabel(h,p,a))return;var d=a?"emphasis":"normal",v=l.merge(l.clone(p.itemStyle)||{},h.itemStyle),m=v[d].label,g=m.textStyle||{},y=this.parseCenter(this.zr,h.center),b=y[0],w=y[1],E,S,x=((o+s)/2+360)%360,T=this.parseRadius(this.zr,h.radius),N,C="middle";return m.position=m.position||v.normal.label.position,m.position==="center"?(T=T[1],E=b,S=w,N="center"):m.position==="inner"?(T=(T[0]+T[1])/2+i,E=Math.round(b+T*c.cos(x,!0)),S=Math.round(w-T*c.sin(x,!0)),u="#fff",N="center"):(T=T[1]- -v[d].labelLine.length+i,E=b+T*c.cos(x,!0),S=w-T*c.sin(x,!0),N=x>=90&&x<=270?"right":"left"),m.position!="center"&&m.position!="inner"&&(E+=N==="left"?20:-20),p.__labelX=E-(N==="left"?5:-5),p.__labelY=S,new r({zlevel:this._zlevelBase+1,hoverable:!1,style:{x:E,y:S,color:g.color||u,text:this.getLabelText(e,t,n,d),textAlign:g.align||N,textBaseline:g.baseline||C,textFont:this.getFont(g)},highlightStyle:{brushType:"fill"},_seriesIndex:e,_dataIndex:t})},getLabelText:function(e,t,n,r){var i=this.series,s=i[e],o=s.data[t],u=this.deepQuery([o,s],"itemStyle."+r+".label.formatter");if(!u)return o.name;if(typeof u=="function")return u.call(this.myChart,s.name,o.name,o.value,n);if(typeof u=="string")return u=u.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}").replace("{d}","{d0}"),u=u.replace("{a0}",s.name).replace("{b0}",o.name).replace("{c0}",o.value).replace("{d0}",n),u},getLabelLine:function(e,t,n,r,i,s,o,a,f){var h=this.series,p=h[e],d=p.data[t];if(this._needLabelLine(p,d,f)){var v=f?"emphasis":"normal",m=l.merge(l.clone(d.itemStyle)||{},p.itemStyle),g=m[v].labelLine,y=g.lineStyle||{},b=this.parseCenter(this.zr,p.center),w=b[0],E=b[1],S=i,x=this.parseRadius(this.zr,p.radius)[1]- -g.length+n,T=(o+s)/2%360,N=c.cos(T,!0),C=c.sin(T,!0);return new u({zlevel:this._zlevelBase+1,hoverable:!1,style:{pointList:[[w+S*N,E-S*C],[w+x*N,E-x*C],[d.__labelX,d.__labelY]],strokeColor:y.color||a,lineType:y.type,lineWidth:y.width},_seriesIndex:e,_dataIndex:t})}return},_needLabel:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".label.show")},_needLabelLine:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".labelLine.show")},reformOption:function(e){var t=l.merge;return e=t(e||{},this.ecTheme.pie),e.itemStyle.normal.label.textStyle=t(e.itemStyle.normal.label.textStyle||{},this.ecTheme.textStyle),e.itemStyle.emphasis.label.textStyle=t(e.itemStyle.emphasis.label.textStyle||{},this.ecTheme.textStyle),e},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},addDataAnimation:function(e){var t=this.series,n={};for(var r=0,i=e.length;r -1; i -= 1) { - if (ary[i] && func(ary[i], i, ary)) { - break; - } - } - } - } - - function hasProp(obj, prop) { - return hasOwn.call(obj, prop); - } - - function getOwn(obj, prop) { - return hasProp(obj, prop) && obj[prop]; - } - - /** - * Cycles over properties in an object and calls a function for each - * property value. If the function returns a truthy value, then the - * iteration is stopped. - */ - function eachProp(obj, func) { - var prop; - for (prop in obj) { - if (hasProp(obj, prop)) { - if (func(obj[prop], prop)) { - break; - } - } - } - } - - /** - * Simple function to mix in properties from source into target, - * but only if target does not already have a property of the same name. - */ - function mixin(target, source, force, deepStringMixin) { - if (source) { - eachProp(source, function (value, prop) { - if (force || !hasProp(target, prop)) { - if (deepStringMixin && typeof value !== 'string') { - if (!target[prop]) { - target[prop] = {}; - } - mixin(target[prop], value, force, deepStringMixin); - } else { - target[prop] = value; - } - } - }); - } - return target; - } - - //Similar to Function.prototype.bind, but the 'this' object is specified - //first, since it is easier to read/figure out what 'this' will be. - function bind(obj, fn) { - return function () { - return fn.apply(obj, arguments); - }; - } - - function scripts() { - return document.getElementsByTagName('script'); - } - - function defaultOnError(err) { - throw err; - } - - //Allow getting a global that expressed in - //dot notation, like 'a.b.c'. - function getGlobal(value) { - if (!value) { - return value; - } - var g = global; - each(value.split('.'), function (part) { - g = g[part]; - }); - return g; - } - - /** - * Constructs an error with a pointer to an URL with more information. - * @param {String} id the error ID that maps to an ID on a web page. - * @param {String} message human readable error. - * @param {Error} [err] the original error, if there is one. - * - * @returns {Error} - */ - function makeError(id, msg, err, requireModules) { - var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id); - e.requireType = id; - e.requireModules = requireModules; - if (err) { - e.originalError = err; - } - return e; - } - - if (typeof define !== 'undefined') { - //If a define is already in play via another AMD loader, - //do not overwrite. - return; - } - - if (typeof requirejs !== 'undefined') { - if (isFunction(requirejs)) { - //Do not overwrite and existing requirejs instance. - return; - } - cfg = requirejs; - requirejs = undefined; - } - - //Allow for a require config object - if (typeof require !== 'undefined' && !isFunction(require)) { - //assume it is a config object. - cfg = require; - require = undefined; - } - - function newContext(contextName) { - var inCheckLoaded, Module, context, handlers, - checkLoadedTimeoutId, - config = { - //Defaults. Do not set a default for map - //config to speed up normalize(), which - //will run faster if there is no default. - waitSeconds: 7, - baseUrl: './', - paths: {}, - pkgs: {}, - shim: {}, - config: {} - }, - registry = {}, - //registry of just enabled modules, to speed - //cycle breaking code when lots of modules - //are registered, but not activated. - enabledRegistry = {}, - undefEvents = {}, - defQueue = [], - defined = {}, - urlFetched = {}, - requireCounter = 1, - unnormalizedCounter = 1; - - /** - * Trims the . and .. from an array of path segments. - * It will keep a leading path segment if a .. will become - * the first path segment, to help with module name lookups, - * which act like paths, but can be remapped. But the end result, - * all paths that use this function should look normalized. - * NOTE: this method MODIFIES the input array. - * @param {Array} ary the array of path segments. - */ - function trimDots(ary) { - var i, part; - for (i = 0; ary[i]; i += 1) { - part = ary[i]; - if (part === '.') { - ary.splice(i, 1); - i -= 1; - } else if (part === '..') { - if (i === 1 && (ary[2] === '..' || ary[0] === '..')) { - //End of the line. Keep at least one non-dot - //path segment at the front so it can be mapped - //correctly to disk. Otherwise, there is likely - //no path mapping for a path starting with '..'. - //This can still fail, but catches the most reasonable - //uses of .. - break; - } else if (i > 0) { - ary.splice(i - 1, 2); - i -= 2; - } - } - } - } - - /** - * Given a relative module name, like ./something, normalize it to - * a real name that can be mapped to a path. - * @param {String} name the relative name - * @param {String} baseName a real name that the name arg is relative - * to. - * @param {Boolean} applyMap apply the map config to the value. Should - * only be done if this normalization is for a dependency ID. - * @returns {String} normalized name - */ - function normalize(name, baseName, applyMap) { - var pkgName, pkgConfig, mapValue, nameParts, i, j, nameSegment, - foundMap, foundI, foundStarMap, starI, - baseParts = baseName && baseName.split('/'), - normalizedBaseParts = baseParts, - map = config.map, - starMap = map && map['*']; - - //Adjust any relative paths. - if (name && name.charAt(0) === '.') { - //If have a base name, try to normalize against it, - //otherwise, assume it is a top-level require that will - //be relative to baseUrl in the end. - if (baseName) { - if (getOwn(config.pkgs, baseName)) { - //If the baseName is a package name, then just treat it as one - //name to concat the name with. - normalizedBaseParts = baseParts = [baseName]; - } else { - //Convert baseName to array, and lop off the last part, - //so that . matches that 'directory' and not name of the baseName's - //module. For instance, baseName of 'one/two/three', maps to - //'one/two/three.js', but we want the directory, 'one/two' for - //this normalization. - normalizedBaseParts = baseParts.slice(0, baseParts.length - 1); - } - - name = normalizedBaseParts.concat(name.split('/')); - trimDots(name); - - //Some use of packages may use a . path to reference the - //'main' module name, so normalize for that. - pkgConfig = getOwn(config.pkgs, (pkgName = name[0])); - name = name.join('/'); - if (pkgConfig && name === pkgName + '/' + pkgConfig.main) { - name = pkgName; - } - } else if (name.indexOf('./') === 0) { - // No baseName, so this is ID is resolved relative - // to baseUrl, pull off the leading dot. - name = name.substring(2); - } - } - - //Apply map config if available. - if (applyMap && map && (baseParts || starMap)) { - nameParts = name.split('/'); - - for (i = nameParts.length; i > 0; i -= 1) { - nameSegment = nameParts.slice(0, i).join('/'); - - if (baseParts) { - //Find the longest baseName segment match in the config. - //So, do joins on the biggest to smallest lengths of baseParts. - for (j = baseParts.length; j > 0; j -= 1) { - mapValue = getOwn(map, baseParts.slice(0, j).join('/')); - - //baseName segment has config, find if it has one for - //this name. - if (mapValue) { - mapValue = getOwn(mapValue, nameSegment); - if (mapValue) { - //Match, update name to the new value. - foundMap = mapValue; - foundI = i; - break; - } - } - } - } - - if (foundMap) { - break; - } - - //Check for a star map match, but just hold on to it, - //if there is a shorter segment match later in a matching - //config, then favor over this star map. - if (!foundStarMap && starMap && getOwn(starMap, nameSegment)) { - foundStarMap = getOwn(starMap, nameSegment); - starI = i; - } - } - - if (!foundMap && foundStarMap) { - foundMap = foundStarMap; - foundI = starI; - } - - if (foundMap) { - nameParts.splice(0, foundI, foundMap); - name = nameParts.join('/'); - } - } - - return name; - } - - function removeScript(name) { - if (isBrowser) { - each(scripts(), function (scriptNode) { - if (scriptNode.getAttribute('data-requiremodule') === name && - scriptNode.getAttribute('data-requirecontext') === context.contextName) { - scriptNode.parentNode.removeChild(scriptNode); - return true; - } - }); - } - } - - function hasPathFallback(id) { - var pathConfig = getOwn(config.paths, id); - if (pathConfig && isArray(pathConfig) && pathConfig.length > 1) { - removeScript(id); - //Pop off the first array value, since it failed, and - //retry - pathConfig.shift(); - context.require.undef(id); - context.require([id]); - return true; - } - } - - //Turns a plugin!resource to [plugin, resource] - //with the plugin being undefined if the name - //did not have a plugin prefix. - function splitPrefix(name) { - var prefix, - index = name ? name.indexOf('!') : -1; - if (index > -1) { - prefix = name.substring(0, index); - name = name.substring(index + 1, name.length); - } - return [prefix, name]; - } - - /** - * Creates a module mapping that includes plugin prefix, module - * name, and path. If parentModuleMap is provided it will - * also normalize the name via require.normalize() - * - * @param {String} name the module name - * @param {String} [parentModuleMap] parent module map - * for the module name, used to resolve relative names. - * @param {Boolean} isNormalized: is the ID already normalized. - * This is true if this call is done for a define() module ID. - * @param {Boolean} applyMap: apply the map config to the ID. - * Should only be true if this map is for a dependency. - * - * @returns {Object} - */ - function makeModuleMap(name, parentModuleMap, isNormalized, applyMap) { - var url, pluginModule, suffix, nameParts, - prefix = null, - parentName = parentModuleMap ? parentModuleMap.name : null, - originalName = name, - isDefine = true, - normalizedName = ''; - - //If no name, then it means it is a require call, generate an - //internal name. - if (!name) { - isDefine = false; - name = '_@r' + (requireCounter += 1); - } - - nameParts = splitPrefix(name); - prefix = nameParts[0]; - name = nameParts[1]; - - if (prefix) { - prefix = normalize(prefix, parentName, applyMap); - pluginModule = getOwn(defined, prefix); - } - - //Account for relative paths if there is a base name. - if (name) { - if (prefix) { - if (pluginModule && pluginModule.normalize) { - //Plugin is loaded, use its normalize method. - normalizedName = pluginModule.normalize(name, function (name) { - return normalize(name, parentName, applyMap); - }); - } else { - normalizedName = normalize(name, parentName, applyMap); - } - } else { - //A regular module. - normalizedName = normalize(name, parentName, applyMap); - - //Normalized name may be a plugin ID due to map config - //application in normalize. The map config values must - //already be normalized, so do not need to redo that part. - nameParts = splitPrefix(normalizedName); - prefix = nameParts[0]; - normalizedName = nameParts[1]; - isNormalized = true; - - url = context.nameToUrl(normalizedName); - } - } - - //If the id is a plugin id that cannot be determined if it needs - //normalization, stamp it with a unique ID so two matching relative - //ids that may conflict can be separate. - suffix = prefix && !pluginModule && !isNormalized ? - '_unnormalized' + (unnormalizedCounter += 1) : - ''; - - return { - prefix: prefix, - name: normalizedName, - parentMap: parentModuleMap, - unnormalized: !!suffix, - url: url, - originalName: originalName, - isDefine: isDefine, - id: (prefix ? - prefix + '!' + normalizedName : - normalizedName) + suffix - }; - } - - function getModule(depMap) { - var id = depMap.id, - mod = getOwn(registry, id); - - if (!mod) { - mod = registry[id] = new context.Module(depMap); - } - - return mod; - } - - function on(depMap, name, fn) { - var id = depMap.id, - mod = getOwn(registry, id); - - if (hasProp(defined, id) && - (!mod || mod.defineEmitComplete)) { - if (name === 'defined') { - fn(defined[id]); - } - } else { - mod = getModule(depMap); - if (mod.error && name === 'error') { - fn(mod.error); - } else { - mod.on(name, fn); - } - } - } - - function onError(err, errback) { - var ids = err.requireModules, - notified = false; - - if (errback) { - errback(err); - } else { - each(ids, function (id) { - var mod = getOwn(registry, id); - if (mod) { - //Set error on module, so it skips timeout checks. - mod.error = err; - if (mod.events.error) { - notified = true; - mod.emit('error', err); - } - } - }); - - if (!notified) { - req.onError(err); - } - } - } - - /** - * Internal method to transfer globalQueue items to this context's - * defQueue. - */ - function takeGlobalQueue() { - //Push all the globalDefQueue items into the context's defQueue - if (globalDefQueue.length) { - //Array splice in the values since the context code has a - //local var ref to defQueue, so cannot just reassign the one - //on context. - apsp.apply(defQueue, - [defQueue.length - 1, 0].concat(globalDefQueue)); - globalDefQueue = []; - } - } - - handlers = { - 'require': function (mod) { - if (mod.require) { - return mod.require; - } else { - return (mod.require = context.makeRequire(mod.map)); - } - }, - 'exports': function (mod) { - mod.usingExports = true; - if (mod.map.isDefine) { - if (mod.exports) { - return mod.exports; - } else { - return (mod.exports = defined[mod.map.id] = {}); - } - } - }, - 'module': function (mod) { - if (mod.module) { - return mod.module; - } else { - return (mod.module = { - id: mod.map.id, - uri: mod.map.url, - config: function () { - var c, - pkg = getOwn(config.pkgs, mod.map.id); - // For packages, only support config targeted - // at the main module. - c = pkg ? getOwn(config.config, mod.map.id + '/' + pkg.main) : - getOwn(config.config, mod.map.id); - return c || {}; - }, - exports: defined[mod.map.id] - }); - } - } - }; - - function cleanRegistry(id) { - //Clean up machinery used for waiting modules. - delete registry[id]; - delete enabledRegistry[id]; - } - - function breakCycle(mod, traced, processed) { - var id = mod.map.id; - - if (mod.error) { - mod.emit('error', mod.error); - } else { - traced[id] = true; - each(mod.depMaps, function (depMap, i) { - var depId = depMap.id, - dep = getOwn(registry, depId); - - //Only force things that have not completed - //being defined, so still in the registry, - //and only if it has not been matched up - //in the module already. - if (dep && !mod.depMatched[i] && !processed[depId]) { - if (getOwn(traced, depId)) { - mod.defineDep(i, defined[depId]); - mod.check(); //pass false? - } else { - breakCycle(dep, traced, processed); - } - } - }); - processed[id] = true; - } - } - - function checkLoaded() { - var map, modId, err, usingPathFallback, - waitInterval = config.waitSeconds * 1000, - //It is possible to disable the wait interval by using waitSeconds of 0. - expired = waitInterval && (context.startTime + waitInterval) < new Date().getTime(), - noLoads = [], - reqCalls = [], - stillLoading = false, - needCycleCheck = true; - - //Do not bother if this call was a result of a cycle break. - if (inCheckLoaded) { - return; - } - - inCheckLoaded = true; - - //Figure out the state of all the modules. - eachProp(enabledRegistry, function (mod) { - map = mod.map; - modId = map.id; - - //Skip things that are not enabled or in error state. - if (!mod.enabled) { - return; - } - - if (!map.isDefine) { - reqCalls.push(mod); - } - - if (!mod.error) { - //If the module should be executed, and it has not - //been inited and time is up, remember it. - if (!mod.inited && expired) { - if (hasPathFallback(modId)) { - usingPathFallback = true; - stillLoading = true; - } else { - noLoads.push(modId); - removeScript(modId); - } - } else if (!mod.inited && mod.fetched && map.isDefine) { - stillLoading = true; - if (!map.prefix) { - //No reason to keep looking for unfinished - //loading. If the only stillLoading is a - //plugin resource though, keep going, - //because it may be that a plugin resource - //is waiting on a non-plugin cycle. - return (needCycleCheck = false); - } - } - } - }); - - if (expired && noLoads.length) { - //If wait time expired, throw error of unloaded modules. - err = makeError('timeout', 'Load timeout for modules: ' + noLoads, null, noLoads); - err.contextName = context.contextName; - return onError(err); - } - - //Not expired, check for a cycle. - if (needCycleCheck) { - each(reqCalls, function (mod) { - breakCycle(mod, {}, {}); - }); - } - - //If still waiting on loads, and the waiting load is something - //other than a plugin resource, or there are still outstanding - //scripts, then just try back later. - if ((!expired || usingPathFallback) && stillLoading) { - //Something is still waiting to load. Wait for it, but only - //if a timeout is not already in effect. - if ((isBrowser || isWebWorker) && !checkLoadedTimeoutId) { - checkLoadedTimeoutId = setTimeout(function () { - checkLoadedTimeoutId = 0; - checkLoaded(); - }, 50); - } - } - - inCheckLoaded = false; - } - - Module = function (map) { - this.events = getOwn(undefEvents, map.id) || {}; - this.map = map; - this.shim = getOwn(config.shim, map.id); - this.depExports = []; - this.depMaps = []; - this.depMatched = []; - this.pluginMaps = {}; - this.depCount = 0; - - /* this.exports this.factory - this.depMaps = [], - this.enabled, this.fetched - */ - }; - - Module.prototype = { - init: function (depMaps, factory, errback, options) { - options = options || {}; - - //Do not do more inits if already done. Can happen if there - //are multiple define calls for the same module. That is not - //a normal, common case, but it is also not unexpected. - if (this.inited) { - return; - } - - this.factory = factory; - - if (errback) { - //Register for errors on this module. - this.on('error', errback); - } else if (this.events.error) { - //If no errback already, but there are error listeners - //on this module, set up an errback to pass to the deps. - errback = bind(this, function (err) { - this.emit('error', err); - }); - } - - //Do a copy of the dependency array, so that - //source inputs are not modified. For example - //"shim" deps are passed in here directly, and - //doing a direct modification of the depMaps array - //would affect that config. - this.depMaps = depMaps && depMaps.slice(0); - - this.errback = errback; - - //Indicate this module has be initialized - this.inited = true; - - this.ignore = options.ignore; - - //Could have option to init this module in enabled mode, - //or could have been previously marked as enabled. However, - //the dependencies are not known until init is called. So - //if enabled previously, now trigger dependencies as enabled. - if (options.enabled || this.enabled) { - //Enable this module and dependencies. - //Will call this.check() - this.enable(); - } else { - this.check(); - } - }, - - defineDep: function (i, depExports) { - //Because of cycles, defined callback for a given - //export can be called more than once. - if (!this.depMatched[i]) { - this.depMatched[i] = true; - this.depCount -= 1; - this.depExports[i] = depExports; - } - }, - - fetch: function () { - if (this.fetched) { - return; - } - this.fetched = true; - - context.startTime = (new Date()).getTime(); - - var map = this.map; - - //If the manager is for a plugin managed resource, - //ask the plugin to load it now. - if (this.shim) { - context.makeRequire(this.map, { - enableBuildCallback: true - })(this.shim.deps || [], bind(this, function () { - return map.prefix ? this.callPlugin() : this.load(); - })); - } else { - //Regular dependency. - return map.prefix ? this.callPlugin() : this.load(); - } - }, - - load: function () { - var url = this.map.url; - - //Regular dependency. - if (!urlFetched[url]) { - urlFetched[url] = true; - context.load(this.map.id, url); - } - }, - - /** - * Checks if the module is ready to define itself, and if so, - * define it. - */ - check: function () { - if (!this.enabled || this.enabling) { - return; - } - - var err, cjsModule, - id = this.map.id, - depExports = this.depExports, - exports = this.exports, - factory = this.factory; - - if (!this.inited) { - this.fetch(); - } else if (this.error) { - this.emit('error', this.error); - } else if (!this.defining) { - //The factory could trigger another require call - //that would result in checking this module to - //define itself again. If already in the process - //of doing that, skip this work. - this.defining = true; - - if (this.depCount < 1 && !this.defined) { - if (isFunction(factory)) { - //If there is an error listener, favor passing - //to that instead of throwing an error. However, - //only do it for define()'d modules. require - //errbacks should not be called for failures in - //their callbacks (#699). However if a global - //onError is set, use that. - if ((this.events.error && this.map.isDefine) || - req.onError !== defaultOnError) { - try { - exports = context.execCb(id, factory, depExports, exports); - } catch (e) { - err = e; - } - } else { - exports = context.execCb(id, factory, depExports, exports); - } - - if (this.map.isDefine) { - //If setting exports via 'module' is in play, - //favor that over return value and exports. After that, - //favor a non-undefined return value over exports use. - cjsModule = this.module; - if (cjsModule && - cjsModule.exports !== undefined && - //Make sure it is not already the exports value - cjsModule.exports !== this.exports) { - exports = cjsModule.exports; - } else if (exports === undefined && this.usingExports) { - //exports already set the defined value. - exports = this.exports; - } - } - - if (err) { - err.requireMap = this.map; - err.requireModules = this.map.isDefine ? [this.map.id] : null; - err.requireType = this.map.isDefine ? 'define' : 'require'; - return onError((this.error = err)); - } - - } else { - //Just a literal value - exports = factory; - } - - this.exports = exports; - - if (this.map.isDefine && !this.ignore) { - defined[id] = exports; - - if (req.onResourceLoad) { - req.onResourceLoad(context, this.map, this.depMaps); - } - } - - //Clean up - cleanRegistry(id); - - this.defined = true; - } - - //Finished the define stage. Allow calling check again - //to allow define notifications below in the case of a - //cycle. - this.defining = false; - - if (this.defined && !this.defineEmitted) { - this.defineEmitted = true; - this.emit('defined', this.exports); - this.defineEmitComplete = true; - } - - } - }, - - callPlugin: function () { - var map = this.map, - id = map.id, - //Map already normalized the prefix. - pluginMap = makeModuleMap(map.prefix); - - //Mark this as a dependency for this plugin, so it - //can be traced for cycles. - this.depMaps.push(pluginMap); - - on(pluginMap, 'defined', bind(this, function (plugin) { - var load, normalizedMap, normalizedMod, - name = this.map.name, - parentName = this.map.parentMap ? this.map.parentMap.name : null, - localRequire = context.makeRequire(map.parentMap, { - enableBuildCallback: true - }); - - //If current map is not normalized, wait for that - //normalized name to load instead of continuing. - if (this.map.unnormalized) { - //Normalize the ID if the plugin allows it. - if (plugin.normalize) { - name = plugin.normalize(name, function (name) { - return normalize(name, parentName, true); - }) || ''; - } - - //prefix and name should already be normalized, no need - //for applying map config again either. - normalizedMap = makeModuleMap(map.prefix + '!' + name, - this.map.parentMap); - on(normalizedMap, - 'defined', bind(this, function (value) { - this.init([], function () { return value; }, null, { - enabled: true, - ignore: true - }); - })); - - normalizedMod = getOwn(registry, normalizedMap.id); - if (normalizedMod) { - //Mark this as a dependency for this plugin, so it - //can be traced for cycles. - this.depMaps.push(normalizedMap); - - if (this.events.error) { - normalizedMod.on('error', bind(this, function (err) { - this.emit('error', err); - })); - } - normalizedMod.enable(); - } - - return; - } - - load = bind(this, function (value) { - this.init([], function () { return value; }, null, { - enabled: true - }); - }); - - load.error = bind(this, function (err) { - this.inited = true; - this.error = err; - err.requireModules = [id]; - - //Remove temp unnormalized modules for this module, - //since they will never be resolved otherwise now. - eachProp(registry, function (mod) { - if (mod.map.id.indexOf(id + '_unnormalized') === 0) { - cleanRegistry(mod.map.id); - } - }); - - onError(err); - }); - - //Allow plugins to load other code without having to know the - //context or how to 'complete' the load. - load.fromText = bind(this, function (text, textAlt) { - /*jslint evil: true */ - var moduleName = map.name, - moduleMap = makeModuleMap(moduleName), - hasInteractive = useInteractive; - - //As of 2.1.0, support just passing the text, to reinforce - //fromText only being called once per resource. Still - //support old style of passing moduleName but discard - //that moduleName in favor of the internal ref. - if (textAlt) { - text = textAlt; - } - - //Turn off interactive script matching for IE for any define - //calls in the text, then turn it back on at the end. - if (hasInteractive) { - useInteractive = false; - } - - //Prime the system by creating a module instance for - //it. - getModule(moduleMap); - - //Transfer any config to this other module. - if (hasProp(config.config, id)) { - config.config[moduleName] = config.config[id]; - } - - try { - req.exec(text); - } catch (e) { - return onError(makeError('fromtexteval', - 'fromText eval for ' + id + - ' failed: ' + e, - e, - [id])); - } - - if (hasInteractive) { - useInteractive = true; - } - - //Mark this as a dependency for the plugin - //resource - this.depMaps.push(moduleMap); - - //Support anonymous modules. - context.completeLoad(moduleName); - - //Bind the value of that module to the value for this - //resource ID. - localRequire([moduleName], load); - }); - - //Use parentName here since the plugin's name is not reliable, - //could be some weird string with no path that actually wants to - //reference the parentName's path. - plugin.load(map.name, localRequire, load, config); - })); - - context.enable(pluginMap, this); - this.pluginMaps[pluginMap.id] = pluginMap; - }, - - enable: function () { - enabledRegistry[this.map.id] = this; - this.enabled = true; - - //Set flag mentioning that the module is enabling, - //so that immediate calls to the defined callbacks - //for dependencies do not trigger inadvertent load - //with the depCount still being zero. - this.enabling = true; - - //Enable each dependency - each(this.depMaps, bind(this, function (depMap, i) { - var id, mod, handler; - - if (typeof depMap === 'string') { - //Dependency needs to be converted to a depMap - //and wired up to this module. - depMap = makeModuleMap(depMap, - (this.map.isDefine ? this.map : this.map.parentMap), - false, - !this.skipMap); - this.depMaps[i] = depMap; - - handler = getOwn(handlers, depMap.id); - - if (handler) { - this.depExports[i] = handler(this); - return; - } - - this.depCount += 1; - - on(depMap, 'defined', bind(this, function (depExports) { - this.defineDep(i, depExports); - this.check(); - })); - - if (this.errback) { - on(depMap, 'error', bind(this, this.errback)); - } - } - - id = depMap.id; - mod = registry[id]; - - //Skip special modules like 'require', 'exports', 'module' - //Also, don't call enable if it is already enabled, - //important in circular dependency cases. - if (!hasProp(handlers, id) && mod && !mod.enabled) { - context.enable(depMap, this); - } - })); - - //Enable each plugin that is used in - //a dependency - eachProp(this.pluginMaps, bind(this, function (pluginMap) { - var mod = getOwn(registry, pluginMap.id); - if (mod && !mod.enabled) { - context.enable(pluginMap, this); - } - })); - - this.enabling = false; - - this.check(); - }, - - on: function (name, cb) { - var cbs = this.events[name]; - if (!cbs) { - cbs = this.events[name] = []; - } - cbs.push(cb); - }, - - emit: function (name, evt) { - each(this.events[name], function (cb) { - cb(evt); - }); - if (name === 'error') { - //Now that the error handler was triggered, remove - //the listeners, since this broken Module instance - //can stay around for a while in the registry. - delete this.events[name]; - } - } - }; - - function callGetModule(args) { - //Skip modules already defined. - if (!hasProp(defined, args[0])) { - getModule(makeModuleMap(args[0], null, true)).init(args[1], args[2]); - } - } - - function removeListener(node, func, name, ieName) { - //Favor detachEvent because of IE9 - //issue, see attachEvent/addEventListener comment elsewhere - //in this file. - if (node.detachEvent && !isOpera) { - //Probably IE. If not it will throw an error, which will be - //useful to know. - if (ieName) { - node.detachEvent(ieName, func); - } - } else { - node.removeEventListener(name, func, false); - } - } - - /** - * Given an event from a script node, get the requirejs info from it, - * and then removes the event listeners on the node. - * @param {Event} evt - * @returns {Object} - */ - function getScriptData(evt) { - //Using currentTarget instead of target for Firefox 2.0's sake. Not - //all old browsers will be supported, but this one was easy enough - //to support and still makes sense. - var node = evt.currentTarget || evt.srcElement; - - //Remove the listeners once here. - removeListener(node, context.onScriptLoad, 'load', 'onreadystatechange'); - removeListener(node, context.onScriptError, 'error'); - - return { - node: node, - id: node && node.getAttribute('data-requiremodule') - }; - } - - function intakeDefines() { - var args; - - //Any defined modules in the global queue, intake them now. - takeGlobalQueue(); - - //Make sure any remaining defQueue items get properly processed. - while (defQueue.length) { - args = defQueue.shift(); - if (args[0] === null) { - return onError(makeError('mismatch', 'Mismatched anonymous define() module: ' + args[args.length - 1])); - } else { - //args are id, deps, factory. Should be normalized by the - //define() function. - callGetModule(args); - } - } - } - - context = { - config: config, - contextName: contextName, - registry: registry, - defined: defined, - urlFetched: urlFetched, - defQueue: defQueue, - Module: Module, - makeModuleMap: makeModuleMap, - nextTick: req.nextTick, - onError: onError, - - /** - * Set a configuration for the context. - * @param {Object} cfg config object to integrate. - */ - configure: function (cfg) { - //Make sure the baseUrl ends in a slash. - if (cfg.baseUrl) { - if (cfg.baseUrl.charAt(cfg.baseUrl.length - 1) !== '/') { - cfg.baseUrl += '/'; - } - } - - //Save off the paths and packages since they require special processing, - //they are additive. - var pkgs = config.pkgs, - shim = config.shim, - objs = { - paths: true, - config: true, - map: true - }; - - eachProp(cfg, function (value, prop) { - if (objs[prop]) { - if (prop === 'map') { - if (!config.map) { - config.map = {}; - } - mixin(config[prop], value, true, true); - } else { - mixin(config[prop], value, true); - } - } else { - config[prop] = value; - } - }); - - //Merge shim - if (cfg.shim) { - eachProp(cfg.shim, function (value, id) { - //Normalize the structure - if (isArray(value)) { - value = { - deps: value - }; - } - if ((value.exports || value.init) && !value.exportsFn) { - value.exportsFn = context.makeShimExports(value); - } - shim[id] = value; - }); - config.shim = shim; - } - - //Adjust packages if necessary. - if (cfg.packages) { - each(cfg.packages, function (pkgObj) { - var location; - - pkgObj = typeof pkgObj === 'string' ? { name: pkgObj } : pkgObj; - location = pkgObj.location; - - //Create a brand new object on pkgs, since currentPackages can - //be passed in again, and config.pkgs is the internal transformed - //state for all package configs. - pkgs[pkgObj.name] = { - name: pkgObj.name, - location: location || pkgObj.name, - //Remove leading dot in main, so main paths are normalized, - //and remove any trailing .js, since different package - //envs have different conventions: some use a module name, - //some use a file name. - main: (pkgObj.main || 'main') - .replace(currDirRegExp, '') - .replace(jsSuffixRegExp, '') - }; - }); - - //Done with modifications, assing packages back to context config - config.pkgs = pkgs; - } - - //If there are any "waiting to execute" modules in the registry, - //update the maps for them, since their info, like URLs to load, - //may have changed. - eachProp(registry, function (mod, id) { - //If module already has init called, since it is too - //late to modify them, and ignore unnormalized ones - //since they are transient. - if (!mod.inited && !mod.map.unnormalized) { - mod.map = makeModuleMap(id); - } - }); - - //If a deps array or a config callback is specified, then call - //require with those args. This is useful when require is defined as a - //config object before require.js is loaded. - if (cfg.deps || cfg.callback) { - context.require(cfg.deps || [], cfg.callback); - } - }, - - makeShimExports: function (value) { - function fn() { - var ret; - if (value.init) { - ret = value.init.apply(global, arguments); - } - return ret || (value.exports && getGlobal(value.exports)); - } - return fn; - }, - - makeRequire: function (relMap, options) { - options = options || {}; - - function localRequire(deps, callback, errback) { - var id, map, requireMod; - - if (options.enableBuildCallback && callback && isFunction(callback)) { - callback.__requireJsBuild = true; - } - - if (typeof deps === 'string') { - if (isFunction(callback)) { - //Invalid call - return onError(makeError('requireargs', 'Invalid require call'), errback); - } - - //If require|exports|module are requested, get the - //value for them from the special handlers. Caveat: - //this only works while module is being defined. - if (relMap && hasProp(handlers, deps)) { - return handlers[deps](registry[relMap.id]); - } - - //Synchronous access to one module. If require.get is - //available (as in the Node adapter), prefer that. - if (req.get) { - return req.get(context, deps, relMap, localRequire); - } - - //Normalize module name, if it contains . or .. - map = makeModuleMap(deps, relMap, false, true); - id = map.id; - - if (!hasProp(defined, id)) { - return onError(makeError('notloaded', 'Module name "' + - id + - '" has not been loaded yet for context: ' + - contextName + - (relMap ? '' : '. Use require([])'))); - } - return defined[id]; - } - - //Grab defines waiting in the global queue. - intakeDefines(); - - //Mark all the dependencies as needing to be loaded. - context.nextTick(function () { - //Some defines could have been added since the - //require call, collect them. - intakeDefines(); - - requireMod = getModule(makeModuleMap(null, relMap)); - - //Store if map config should be applied to this require - //call for dependencies. - requireMod.skipMap = options.skipMap; - - requireMod.init(deps, callback, errback, { - enabled: true - }); - - checkLoaded(); - }); - - return localRequire; - } - - mixin(localRequire, { - isBrowser: isBrowser, - - /** - * Converts a module name + .extension into an URL path. - * *Requires* the use of a module name. It does not support using - * plain URLs like nameToUrl. - */ - toUrl: function (moduleNamePlusExt) { - var ext, - index = moduleNamePlusExt.lastIndexOf('.'), - segment = moduleNamePlusExt.split('/')[0], - isRelative = segment === '.' || segment === '..'; - - //Have a file extension alias, and it is not the - //dots from a relative path. - if (index !== -1 && (!isRelative || index > 1)) { - ext = moduleNamePlusExt.substring(index, moduleNamePlusExt.length); - moduleNamePlusExt = moduleNamePlusExt.substring(0, index); - } - - return context.nameToUrl(normalize(moduleNamePlusExt, - relMap && relMap.id, true), ext, true); - }, - - defined: function (id) { - return hasProp(defined, makeModuleMap(id, relMap, false, true).id); - }, - - specified: function (id) { - id = makeModuleMap(id, relMap, false, true).id; - return hasProp(defined, id) || hasProp(registry, id); - } - }); - - //Only allow undef on top level require calls - if (!relMap) { - localRequire.undef = function (id) { - //Bind any waiting define() calls to this context, - //fix for #408 - takeGlobalQueue(); - - var map = makeModuleMap(id, relMap, true), - mod = getOwn(registry, id); - - delete defined[id]; - delete urlFetched[map.url]; - delete undefEvents[id]; - - if (mod) { - //Hold on to listeners in case the - //module will be attempted to be reloaded - //using a different config. - if (mod.events.defined) { - undefEvents[id] = mod.events; - } - - cleanRegistry(id); - } - }; - } - - return localRequire; - }, - - /** - * Called to enable a module if it is still in the registry - * awaiting enablement. A second arg, parent, the parent module, - * is passed in for context, when this method is overriden by - * the optimizer. Not shown here to keep code compact. - */ - enable: function (depMap) { - var mod = getOwn(registry, depMap.id); - if (mod) { - getModule(depMap).enable(); - } - }, - - /** - * Internal method used by environment adapters to complete a load event. - * A load event could be a script load or just a load pass from a synchronous - * load call. - * @param {String} moduleName the name of the module to potentially complete. - */ - completeLoad: function (moduleName) { - var found, args, mod, - shim = getOwn(config.shim, moduleName) || {}, - shExports = shim.exports; - - takeGlobalQueue(); - - while (defQueue.length) { - args = defQueue.shift(); - if (args[0] === null) { - args[0] = moduleName; - //If already found an anonymous module and bound it - //to this name, then this is some other anon module - //waiting for its completeLoad to fire. - if (found) { - break; - } - found = true; - } else if (args[0] === moduleName) { - //Found matching define call for this script! - found = true; - } - - callGetModule(args); - } - - //Do this after the cycle of callGetModule in case the result - //of those calls/init calls changes the registry. - mod = getOwn(registry, moduleName); - - if (!found && !hasProp(defined, moduleName) && mod && !mod.inited) { - if (config.enforceDefine && (!shExports || !getGlobal(shExports))) { - if (hasPathFallback(moduleName)) { - return; - } else { - return onError(makeError('nodefine', - 'No define call for ' + moduleName, - null, - [moduleName])); - } - } else { - //A script that does not call define(), so just simulate - //the call for it. - callGetModule([moduleName, (shim.deps || []), shim.exportsFn]); - } - } - - checkLoaded(); - }, - - /** - * Converts a module name to a file path. Supports cases where - * moduleName may actually be just an URL. - * Note that it **does not** call normalize on the moduleName, - * it is assumed to have already been normalized. This is an - * internal API, not a public one. Use toUrl for the public API. - */ - nameToUrl: function (moduleName, ext, skipExt) { - var paths, pkgs, pkg, pkgPath, syms, i, parentModule, url, - parentPath; - - //If a colon is in the URL, it indicates a protocol is used and it is just - //an URL to a file, or if it starts with a slash, contains a query arg (i.e. ?) - //or ends with .js, then assume the user meant to use an url and not a module id. - //The slash is important for protocol-less URLs as well as full paths. - if (req.jsExtRegExp.test(moduleName)) { - //Just a plain path, not module name lookup, so just return it. - //Add extension if it is included. This is a bit wonky, only non-.js things pass - //an extension, this method probably needs to be reworked. - url = moduleName + (ext || ''); - } else { - //A module that needs to be converted to a path. - paths = config.paths; - pkgs = config.pkgs; - - syms = moduleName.split('/'); - //For each module name segment, see if there is a path - //registered for it. Start with most specific name - //and work up from it. - for (i = syms.length; i > 0; i -= 1) { - parentModule = syms.slice(0, i).join('/'); - pkg = getOwn(pkgs, parentModule); - parentPath = getOwn(paths, parentModule); - if (parentPath) { - //If an array, it means there are a few choices, - //Choose the one that is desired - if (isArray(parentPath)) { - parentPath = parentPath[0]; - } - syms.splice(0, i, parentPath); - break; - } else if (pkg) { - //If module name is just the package name, then looking - //for the main module. - if (moduleName === pkg.name) { - pkgPath = pkg.location + '/' + pkg.main; - } else { - pkgPath = pkg.location; - } - syms.splice(0, i, pkgPath); - break; - } - } - - //Join the path parts together, then figure out if baseUrl is needed. - url = syms.join('/'); - url += (ext || (/\?/.test(url) || skipExt ? '' : '.js')); - url = (url.charAt(0) === '/' || url.match(/^[\w\+\.\-]+:/) ? '' : config.baseUrl) + url; - } - - return config.urlArgs ? url + - ((url.indexOf('?') === -1 ? '?' : '&') + - config.urlArgs) : url; - }, - - //Delegates to req.load. Broken out as a separate function to - //allow overriding in the optimizer. - load: function (id, url) { - req.load(context, id, url); - }, - - /** - * Executes a module callback function. Broken out as a separate function - * solely to allow the build system to sequence the files in the built - * layer in the right sequence. - * - * @private - */ - execCb: function (name, callback, args, exports) { - return callback.apply(exports, args); - }, - - /** - * callback for script loads, used to check status of loading. - * - * @param {Event} evt the event from the browser for the script - * that was loaded. - */ - onScriptLoad: function (evt) { - //Using currentTarget instead of target for Firefox 2.0's sake. Not - //all old browsers will be supported, but this one was easy enough - //to support and still makes sense. - if (evt.type === 'load' || - (readyRegExp.test((evt.currentTarget || evt.srcElement).readyState))) { - //Reset interactive script so a script node is not held onto for - //to long. - interactiveScript = null; - - //Pull out the name of the module and the context. - var data = getScriptData(evt); - context.completeLoad(data.id); - } - }, - - /** - * Callback for script errors. - */ - onScriptError: function (evt) { - var data = getScriptData(evt); - if (!hasPathFallback(data.id)) { - return onError(makeError('scripterror', 'Script error for: ' + data.id, evt, [data.id])); - } - } - }; - - context.require = context.makeRequire(); - return context; - } - - /** - * Main entry point. - * - * If the only argument to require is a string, then the module that - * is represented by that string is fetched for the appropriate context. - * - * If the first argument is an array, then it will be treated as an array - * of dependency string names to fetch. An optional function callback can - * be specified to execute when all of those dependencies are available. - * - * Make a local req variable to help Caja compliance (it assumes things - * on a require that are not standardized), and to give a short - * name for minification/local scope use. - */ - req = requirejs = function (deps, callback, errback, optional) { - - //Find the right context, use default - var context, config, - contextName = defContextName; - - // Determine if have config object in the call. - if (!isArray(deps) && typeof deps !== 'string') { - // deps is a config object - config = deps; - if (isArray(callback)) { - // Adjust args if there are dependencies - deps = callback; - callback = errback; - errback = optional; - } else { - deps = []; - } - } - - if (config && config.context) { - contextName = config.context; - } - - context = getOwn(contexts, contextName); - if (!context) { - context = contexts[contextName] = req.s.newContext(contextName); - } - - if (config) { - context.configure(config); - } - - return context.require(deps, callback, errback); - }; - - /** - * Support require.config() to make it easier to cooperate with other - * AMD loaders on globally agreed names. - */ - req.config = function (config) { - return req(config); - }; - - /** - * Execute something after the current tick - * of the event loop. Override for other envs - * that have a better solution than setTimeout. - * @param {Function} fn function to execute later. - */ - req.nextTick = typeof setTimeout !== 'undefined' ? function (fn) { - setTimeout(fn, 4); - } : function (fn) { fn(); }; - - /** - * Export require as a global, but only if it does not already exist. - */ - if (!require) { - require = req; - } - - req.version = version; - - //Used to filter out dependencies that are already paths. - req.jsExtRegExp = /^\/|:|\?|\.js$/; - req.isBrowser = isBrowser; - s = req.s = { - contexts: contexts, - newContext: newContext - }; - - //Create default context. - req({}); - - //Exports some context-sensitive methods on global require. - each([ - 'toUrl', - 'undef', - 'defined', - 'specified' - ], function (prop) { - //Reference from contexts instead of early binding to default context, - //so that during builds, the latest instance of the default context - //with its config gets used. - req[prop] = function () { - var ctx = contexts[defContextName]; - return ctx.require[prop].apply(ctx, arguments); - }; - }); - - if (isBrowser) { - head = s.head = document.getElementsByTagName('head')[0]; - //If BASE tag is in play, using appendChild is a problem for IE6. - //When that browser dies, this can be removed. Details in this jQuery bug: - //http://dev.jquery.com/ticket/2709 - baseElement = document.getElementsByTagName('base')[0]; - if (baseElement) { - head = s.head = baseElement.parentNode; - } - } - - /** - * Any errors that require explicitly generates will be passed to this - * function. Intercept/override it if you want custom error handling. - * @param {Error} err the error object. - */ - req.onError = defaultOnError; - - /** - * Creates the node for the load command. Only used in browser envs. - */ - req.createNode = function (config, moduleName, url) { - var node = config.xhtml ? - document.createElementNS('http://www.w3.org/1999/xhtml', 'html:script') : - document.createElement('script'); - node.type = config.scriptType || 'text/javascript'; - node.charset = 'utf-8'; - node.async = true; - return node; - }; - - /** - * Does the request to load a module for the browser case. - * Make this a separate function to allow other environments - * to override it. - * - * @param {Object} context the require context to find state. - * @param {String} moduleName the name of the module. - * @param {Object} url the URL to the module. - */ - req.load = function (context, moduleName, url) { - var config = (context && context.config) || {}, - node; - if (isBrowser) { - //In the browser so use a script tag - node = req.createNode(config, moduleName, url); - - node.setAttribute('data-requirecontext', context.contextName); - node.setAttribute('data-requiremodule', moduleName); - - //Set up load listener. Test attachEvent first because IE9 has - //a subtle issue in its addEventListener and script onload firings - //that do not match the behavior of all other browsers with - //addEventListener support, which fire the onload event for a - //script right after the script execution. See: - //https://connect.microsoft.com/IE/feedback/details/648057/script-onload-event-is-not-fired-immediately-after-script-execution - //UNFORTUNATELY Opera implements attachEvent but does not follow the script - //script execution mode. - if (node.attachEvent && - //Check if node.attachEvent is artificially added by custom script or - //natively supported by browser - //read https://github.com/jrburke/requirejs/issues/187 - //if we can NOT find [native code] then it must NOT natively supported. - //in IE8, node.attachEvent does not have toString() - //Note the test for "[native code" with no closing brace, see: - //https://github.com/jrburke/requirejs/issues/273 - !(node.attachEvent.toString && node.attachEvent.toString().indexOf('[native code') < 0) && - !isOpera) { - //Probably IE. IE (at least 6-8) do not fire - //script onload right after executing the script, so - //we cannot tie the anonymous define call to a name. - //However, IE reports the script as being in 'interactive' - //readyState at the time of the define call. - useInteractive = true; - - node.attachEvent('onreadystatechange', context.onScriptLoad); - //It would be great to add an error handler here to catch - //404s in IE9+. However, onreadystatechange will fire before - //the error handler, so that does not help. If addEventListener - //is used, then IE will fire error before load, but we cannot - //use that pathway given the connect.microsoft.com issue - //mentioned above about not doing the 'script execute, - //then fire the script load event listener before execute - //next script' that other browsers do. - //Best hope: IE10 fixes the issues, - //and then destroys all installs of IE 6-9. - //node.attachEvent('onerror', context.onScriptError); - } else { - node.addEventListener('load', context.onScriptLoad, false); - node.addEventListener('error', context.onScriptError, false); - } - node.src = url; - - //For some cache cases in IE 6-8, the script executes before the end - //of the appendChild execution, so to tie an anonymous define - //call to the module name (which is stored on the node), hold on - //to a reference to this node, but clear after the DOM insertion. - currentlyAddingScript = node; - if (baseElement) { - head.insertBefore(node, baseElement); - } else { - head.appendChild(node); - } - currentlyAddingScript = null; - - return node; - } else if (isWebWorker) { - try { - //In a web worker, use importScripts. This is not a very - //efficient use of importScripts, importScripts will block until - //its script is downloaded and evaluated. However, if web workers - //are in play, the expectation that a build has been done so that - //only one script needs to be loaded anyway. This may need to be - //reevaluated if other use cases become common. - importScripts(url); - - //Account for anonymous modules - context.completeLoad(moduleName); - } catch (e) { - context.onError(makeError('importscripts', - 'importScripts failed for ' + - moduleName + ' at ' + url, - e, - [moduleName])); - } - } - }; - - function getInteractiveScript() { - if (interactiveScript && interactiveScript.readyState === 'interactive') { - return interactiveScript; - } - - eachReverse(scripts(), function (script) { - if (script.readyState === 'interactive') { - return (interactiveScript = script); - } - }); - return interactiveScript; - } - - //Look for a data-main script attribute, which could also adjust the baseUrl. - if (isBrowser) { - //Figure out baseUrl. Get it from the script tag with require.js in it. - eachReverse(scripts(), function (script) { - //Set the 'head' where we can append children by - //using the script's parent. - if (!head) { - head = script.parentNode; - } - - //Look for a data-main attribute to set main script for the page - //to load. If it is there, the path to data main becomes the - //baseUrl, if it is not already set. - dataMain = script.getAttribute('data-main'); - if (dataMain) { - //Preserve dataMain in case it is a path (i.e. contains '?') - mainScript = dataMain; - - //Set final baseUrl if there is not already an explicit one. - if (!cfg.baseUrl) { - //Pull off the directory of data-main for use as the - //baseUrl. - src = mainScript.split('/'); - mainScript = src.pop(); - subPath = src.length ? src.join('/') + '/' : './'; - - cfg.baseUrl = subPath; - } - - //Strip off any trailing .js since mainScript is now - //like a module name. - mainScript = mainScript.replace(jsSuffixRegExp, ''); - - //If mainScript is still a path, fall back to dataMain - if (req.jsExtRegExp.test(mainScript)) { - mainScript = dataMain; - } - - //Put the data-main script in the files to load. - cfg.deps = cfg.deps ? cfg.deps.concat(mainScript) : [mainScript]; - - return true; - } - }); - } - - /** - * The function that handles definitions of modules. Differs from - * require() in that a string for the module should be the first argument, - * and the function to execute after dependencies are loaded should - * return a value to define the module corresponding to the first argument's - * name. - */ - define = function (name, deps, callback) { - var node, context; - - //Allow for anonymous modules - if (typeof name !== 'string') { - //Adjust args appropriately - callback = deps; - deps = name; - name = null; - } - - //This module may not have dependencies - if (!isArray(deps)) { - callback = deps; - deps = null; - } - - //If no name, and callback is a function, then figure out if it a - //CommonJS thing with dependencies. - if (!deps && isFunction(callback)) { - deps = []; - //Remove comments from the callback string, - //look for require calls, and pull them into the dependencies, - //but only if there are function args. - if (callback.length) { - callback - .toString() - .replace(commentRegExp, '') - .replace(cjsRequireRegExp, function (match, dep) { - deps.push(dep); - }); - - //May be a CommonJS thing even without require calls, but still - //could use exports, and module. Avoid doing exports and module - //work though if it just needs require. - //REQUIRES the function to expect the CommonJS variables in the - //order listed below. - deps = (callback.length === 1 ? ['require'] : ['require', 'exports', 'module']).concat(deps); - } - } - - //If in IE 6-8 and hit an anonymous define() call, do the interactive - //work. - if (useInteractive) { - node = currentlyAddingScript || getInteractiveScript(); - if (node) { - if (!name) { - name = node.getAttribute('data-requiremodule'); - } - context = contexts[node.getAttribute('data-requirecontext')]; - } - } - - //Always save off evaluating the def call until the script onload handler. - //This allows multiple modules to be in a file without prematurely - //tracing dependencies, and allows for anonymous module support, - //where the module name is not known until the script onload event - //occurs. If no context, use the global queue, and get it processed - //in the onscript load callback. - (context ? context.defQueue : globalDefQueue).push([name, deps, callback]); - }; - - define.amd = { - jQuery: true - }; - - - /** - * Executes the text. Normally just uses eval, but can be modified - * to use a better, environment-specific call. Only used for transpiling - * loader plugins, not for plain JS modules. - * @param {String} text the text to execute/evaluate. - */ - req.exec = function (text) { - /*jslint evil: true */ - return eval(text); - }; - - //Set up with config info. - req(cfg); -}(this)); - - - - this.requirejsVars = { - require: require, - requirejs: require, - define: define - }; - - if (env === 'browser') { - /** - * @license RequireJS rhino Copyright (c) 2012, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ - -//sloppy since eval enclosed with use strict causes problems if the source -//text is not strict-compliant. -/*jslint sloppy: true, evil: true */ -/*global require, XMLHttpRequest */ - -(function () { - require.load = function (context, moduleName, url) { - var xhr = new XMLHttpRequest(); - - xhr.open('GET', url, true); - xhr.send(); - - xhr.onreadystatechange = function () { - if (xhr.readyState === 4) { - eval(xhr.responseText); - - //Support anonymous modules. - context.completeLoad(moduleName); - } - }; - }; -}()); - } else if (env === 'rhino') { - /** - * @license RequireJS rhino Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ - -/*jslint */ -/*global require: false, java: false, load: false */ - -(function () { - 'use strict'; - require.load = function (context, moduleName, url) { - - load(url); - - //Support anonymous modules. - context.completeLoad(moduleName); - }; - -}()); - } else if (env === 'node') { - this.requirejsVars.nodeRequire = nodeRequire; - require.nodeRequire = nodeRequire; - - /** - * @license RequireJS node Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ - -/*jslint regexp: false */ -/*global require: false, define: false, requirejsVars: false, process: false */ - -/** - * This adapter assumes that x.js has loaded it and set up - * some variables. This adapter just allows limited RequireJS - * usage from within the requirejs directory. The general - * node adapater is r.js. - */ - -(function () { - 'use strict'; - - var nodeReq = requirejsVars.nodeRequire, - req = requirejsVars.require, - def = requirejsVars.define, - fs = nodeReq('fs'), - path = nodeReq('path'), - vm = nodeReq('vm'), - //In Node 0.7+ existsSync is on fs. - exists = fs.existsSync || path.existsSync, - hasOwn = Object.prototype.hasOwnProperty; - - function hasProp(obj, prop) { - return hasOwn.call(obj, prop); - } - - function syncTick(fn) { - fn(); - } - - //Supply an implementation that allows synchronous get of a module. - req.get = function (context, moduleName, relModuleMap, localRequire) { - if (moduleName === "require" || moduleName === "exports" || moduleName === "module") { - req.onError(new Error("Explicit require of " + moduleName + " is not allowed.")); - } - - var ret, oldTick, - moduleMap = context.makeModuleMap(moduleName, relModuleMap, false, true); - - //Normalize module name, if it contains . or .. - moduleName = moduleMap.id; - - if (hasProp(context.defined, moduleName)) { - ret = context.defined[moduleName]; - } else { - if (ret === undefined) { - //Make sure nextTick for this type of call is sync-based. - oldTick = context.nextTick; - context.nextTick = syncTick; - try { - if (moduleMap.prefix) { - //A plugin, call requirejs to handle it. Now that - //nextTick is syncTick, the require will complete - //synchronously. - localRequire([moduleMap.originalName]); - - //Now that plugin is loaded, can regenerate the moduleMap - //to get the final, normalized ID. - moduleMap = context.makeModuleMap(moduleMap.originalName, relModuleMap, false, true); - moduleName = moduleMap.id; - } else { - //Try to dynamically fetch it. - req.load(context, moduleName, moduleMap.url); - - //Enable the module - context.enable(moduleMap, relModuleMap); - } - - //Break any cycles by requiring it normally, but this will - //finish synchronously - require([moduleName]); - - //The above calls are sync, so can do the next thing safely. - ret = context.defined[moduleName]; - } finally { - context.nextTick = oldTick; - } - } - } - - return ret; - }; - - req.nextTick = function (fn) { - process.nextTick(fn); - }; - - //Add wrapper around the code so that it gets the requirejs - //API instead of the Node API, and it is done lexically so - //that it survives later execution. - req.makeNodeWrapper = function (contents) { - return '(function (require, requirejs, define) { ' + - contents + - '\n}(requirejsVars.require, requirejsVars.requirejs, requirejsVars.define));'; - }; - - req.load = function (context, moduleName, url) { - var contents, err, - config = context.config; - - if (config.shim[moduleName] && (!config.suppress || !config.suppress.nodeShim)) { - console.warn('Shim config not supported in Node, may or may not work. Detected ' + - 'for module: ' + moduleName); - } - - if (exists(url)) { - contents = fs.readFileSync(url, 'utf8'); - - contents = req.makeNodeWrapper(contents); - try { - vm.runInThisContext(contents, fs.realpathSync(url)); - } catch (e) { - err = new Error('Evaluating ' + url + ' as module "' + - moduleName + '" failed with error: ' + e); - err.originalError = e; - err.moduleName = moduleName; - err.fileName = url; - return req.onError(err); - } - } else { - def(moduleName, function () { - //Get the original name, since relative requires may be - //resolved differently in node (issue #202). Also, if relative, - //make it relative to the URL of the item requesting it - //(issue #393) - var dirName, - map = hasProp(context.registry, moduleName) && - context.registry[moduleName].map, - parentMap = map && map.parentMap, - originalName = map && map.originalName; - - if (originalName.charAt(0) === '.' && parentMap) { - dirName = parentMap.url.split('/'); - dirName.pop(); - originalName = dirName.join('/') + '/' + originalName; - } - - try { - return (context.config.nodeRequire || req.nodeRequire)(originalName); - } catch (e) { - err = new Error('Tried loading "' + moduleName + '" at ' + - url + ' then tried node\'s require("' + - originalName + '") and it failed ' + - 'with error: ' + e); - err.originalError = e; - err.moduleName = originalName; - return req.onError(err); - } - }); - } - - //Support anonymous modules. - context.completeLoad(moduleName); - }; - - //Override to provide the function wrapper for define/require. - req.exec = function (text) { - /*jslint evil: true */ - text = req.makeNodeWrapper(text); - return eval(text); - }; -}()); - - } else if (env === 'xpconnect') { - /** - * @license RequireJS xpconnect Copyright (c) 2013, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ - -/*jslint */ -/*global require, load */ - -(function () { - 'use strict'; - require.load = function (context, moduleName, url) { - - load(url); - - //Support anonymous modules. - context.completeLoad(moduleName); - }; - -}()); - - } - - //Support a default file name to execute. Useful for hosted envs - //like Joyent where it defaults to a server.js as the only executed - //script. But only do it if this is not an optimization run. - if (commandOption !== 'o' && (!fileName || !jsSuffixRegExp.test(fileName))) { - fileName = 'main.js'; - } - - /** - * Loads the library files that can be used for the optimizer, or for other - * tasks. - */ - function loadLib() { - /** - * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ - -/*jslint strict: false */ -/*global Packages: false, process: false, window: false, navigator: false, - document: false, define: false */ - -/** - * A plugin that modifies any /env/ path to be the right path based on - * the host environment. Right now only works for Node, Rhino and browser. - */ -(function () { - var pathRegExp = /(\/|^)env\/|\{env\}/, - env = 'unknown'; - - if (typeof Packages !== 'undefined') { - env = 'rhino'; - } else if (typeof process !== 'undefined' && process.versions && !!process.versions.node) { - env = 'node'; - } else if ((typeof navigator !== 'undefined' && typeof document !== 'undefined') || - (typeof importScripts !== 'undefined' && typeof self !== 'undefined')) { - env = 'browser'; - } else if (typeof Components !== 'undefined' && Components.classes && Components.interfaces) { - env = 'xpconnect'; - } - - define('env', { - get: function () { - return env; - }, - - load: function (name, req, load, config) { - //Allow override in the config. - if (config.env) { - env = config.env; - } - - name = name.replace(pathRegExp, function (match, prefix) { - if (match.indexOf('{') === -1) { - return prefix + env + '/'; - } else { - return env; - } - }); - - req([name], function (mod) { - load(mod); - }); - } - }); -}());/** - * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ - -/*jslint plusplus: true */ -/*global define */ - -define('lang', function () { - 'use strict'; - - var lang, - hasOwn = Object.prototype.hasOwnProperty; - - function hasProp(obj, prop) { - return hasOwn.call(obj, prop); - } - - lang = { - backSlashRegExp: /\\/g, - ostring: Object.prototype.toString, - - isArray: Array.isArray || function (it) { - return lang.ostring.call(it) === "[object Array]"; - }, - - isFunction: function(it) { - return lang.ostring.call(it) === "[object Function]"; - }, - - isRegExp: function(it) { - return it && it instanceof RegExp; - }, - - hasProp: hasProp, - - //returns true if the object does not have an own property prop, - //or if it does, it is a falsy value. - falseProp: function (obj, prop) { - return !hasProp(obj, prop) || !obj[prop]; - }, - - //gets own property value for given prop on object - getOwn: function (obj, prop) { - return hasProp(obj, prop) && obj[prop]; - }, - - _mixin: function(dest, source, override){ - var name; - for (name in source) { - if(source.hasOwnProperty(name) - && (override || !dest.hasOwnProperty(name))) { - dest[name] = source[name]; - } - } - - return dest; // Object - }, - - /** - * mixin({}, obj1, obj2) is allowed. If the last argument is a boolean, - * then the source objects properties are force copied over to dest. - */ - mixin: function(dest){ - var parameters = Array.prototype.slice.call(arguments), - override, i, l; - - if (!dest) { dest = {}; } - - if (parameters.length > 2 && typeof arguments[parameters.length-1] === 'boolean') { - override = parameters.pop(); - } - - for (i = 1, l = parameters.length; i < l; i++) { - lang._mixin(dest, parameters[i], override); - } - return dest; // Object - }, - - delegate: (function () { - // boodman/crockford delegation w/ cornford optimization - function TMP() {} - return function (obj, props) { - TMP.prototype = obj; - var tmp = new TMP(); - TMP.prototype = null; - if (props) { - lang.mixin(tmp, props); - } - return tmp; // Object - }; - }()), - - /** - * Helper function for iterating over an array. If the func returns - * a true value, it will break out of the loop. - */ - each: function each(ary, func) { - if (ary) { - var i; - for (i = 0; i < ary.length; i += 1) { - if (func(ary[i], i, ary)) { - break; - } - } - } - }, - - /** - * Cycles over properties in an object and calls a function for each - * property value. If the function returns a truthy value, then the - * iteration is stopped. - */ - eachProp: function eachProp(obj, func) { - var prop; - for (prop in obj) { - if (hasProp(obj, prop)) { - if (func(obj[prop], prop)) { - break; - } - } - } - }, - - //Similar to Function.prototype.bind, but the "this" object is specified - //first, since it is easier to read/figure out what "this" will be. - bind: function bind(obj, fn) { - return function () { - return fn.apply(obj, arguments); - }; - }, - - //Escapes a content string to be be a string that has characters escaped - //for inclusion as part of a JS string. - jsEscape: function (content) { - return content.replace(/(["'\\])/g, '\\$1') - .replace(/[\f]/g, "\\f") - .replace(/[\b]/g, "\\b") - .replace(/[\n]/g, "\\n") - .replace(/[\t]/g, "\\t") - .replace(/[\r]/g, "\\r"); - } - }; - return lang; -}); -/** - * prim 0.0.1 Copyright (c) 2012-2013, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/requirejs/prim for details - */ - -/*global setImmediate, process, setTimeout, define, module */ - -//Set prime.hideResolutionConflict = true to allow "resolution-races" -//in promise-tests to pass. -//Since the goal of prim is to be a small impl for trusted code, it is -//more important to normally throw in this case so that we can find -//logic errors quicker. - -var prim; -(function () { - 'use strict'; - var op = Object.prototype, - hasOwn = op.hasOwnProperty; - - function hasProp(obj, prop) { - return hasOwn.call(obj, prop); - } - - /** - * Helper function for iterating over an array. If the func returns - * a true value, it will break out of the loop. - */ - function each(ary, func) { - if (ary) { - var i; - for (i = 0; i < ary.length; i += 1) { - if (ary[i]) { - func(ary[i], i, ary); - } - } - } - } - - function check(p) { - if (hasProp(p, 'e') || hasProp(p, 'v')) { - if (!prim.hideResolutionConflict) { - throw new Error('nope'); - } - return false; - } - return true; - } - - function notify(ary, value) { - prim.nextTick(function () { - each(ary, function (item) { - item(value); - }); - }); - } - - prim = function prim() { - var p, - ok = [], - fail = []; - - return (p = { - callback: function (yes, no) { - if (no) { - p.errback(no); - } - - if (hasProp(p, 'v')) { - prim.nextTick(function () { - yes(p.v); - }); - } else { - ok.push(yes); - } - }, - - errback: function (no) { - if (hasProp(p, 'e')) { - prim.nextTick(function () { - no(p.e); - }); - } else { - fail.push(no); - } - }, - - finished: function () { - return hasProp(p, 'e') || hasProp(p, 'v'); - }, - - rejected: function () { - return hasProp(p, 'e'); - }, - - resolve: function (v) { - if (check(p)) { - p.v = v; - notify(ok, v); - } - return p; - }, - reject: function (e) { - if (check(p)) { - p.e = e; - notify(fail, e); - } - return p; - }, - - start: function (fn) { - p.resolve(); - return p.promise.then(fn); - }, - - promise: { - then: function (yes, no) { - var next = prim(); - - p.callback(function (v) { - try { - if (yes && typeof yes === 'function') { - v = yes(v); - } - - if (v && v.then) { - v.then(next.resolve, next.reject); - } else { - next.resolve(v); - } - } catch (e) { - next.reject(e); - } - }, function (e) { - var err; - - try { - if (!no || typeof no !== 'function') { - next.reject(e); - } else { - err = no(e); - - if (err && err.then) { - err.then(next.resolve, next.reject); - } else { - next.resolve(err); - } - } - } catch (e2) { - next.reject(e2); - } - }); - - return next.promise; - }, - - fail: function (no) { - return p.promise.then(null, no); - }, - - end: function () { - p.errback(function (e) { - throw e; - }); - } - } - }); - }; - - prim.serial = function (ary) { - var result = prim().resolve().promise; - each(ary, function (item) { - result = result.then(function () { - return item(); - }); - }); - return result; - }; - - prim.nextTick = typeof setImmediate === 'function' ? setImmediate : - (typeof process !== 'undefined' && process.nextTick ? - process.nextTick : (typeof setTimeout !== 'undefined' ? - function (fn) { - setTimeout(fn, 0); - } : function (fn) { - fn(); - })); - - if (typeof define === 'function' && define.amd) { - define('prim', function () { return prim; }); - } else if (typeof module !== 'undefined' && module.exports) { - module.exports = prim; - } -}()); -if(env === 'browser') { -/** - * @license RequireJS Copyright (c) 2012, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ - -/*jslint strict: false */ -/*global define: false, load: false */ - -//Just a stub for use with uglify's consolidator.js -define('browser/assert', function () { - return {}; -}); - -} - -if(env === 'node') { -/** - * @license RequireJS Copyright (c) 2012, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ - -/*jslint strict: false */ -/*global define: false, load: false */ - -//Needed so that rhino/assert can return a stub for uglify's consolidator.js -define('node/assert', ['assert'], function (assert) { - return assert; -}); - -} - -if(env === 'rhino') { -/** - * @license RequireJS Copyright (c) 2012, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ - -/*jslint strict: false */ -/*global define: false, load: false */ - -//Just a stub for use with uglify's consolidator.js -define('rhino/assert', function () { - return {}; -}); - -} - -if(env === 'xpconnect') { -/** - * @license RequireJS Copyright (c) 2013, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ - -/*jslint strict: false */ -/*global define: false, load: false */ - -//Just a stub for use with uglify's consolidator.js -define('xpconnect/assert', function () { - return {}; -}); - -} - -if(env === 'browser') { -/** - * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ - -/*jslint strict: false */ -/*global define: false, process: false */ - -define('browser/args', function () { - //Always expect config via an API call - return []; -}); - -} - -if(env === 'node') { -/** - * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ - -/*jslint strict: false */ -/*global define: false, process: false */ - -define('node/args', function () { - //Do not return the "node" or "r.js" arguments - var args = process.argv.slice(2); - - //Ignore any command option used for main x.js branching - if (args[0] && args[0].indexOf('-') === 0) { - args = args.slice(1); - } - - return args; -}); - -} - -if(env === 'rhino') { -/** - * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ - -/*jslint strict: false */ -/*global define: false, process: false */ - -var jsLibRhinoArgs = (typeof rhinoArgs !== 'undefined' && rhinoArgs) || [].concat(Array.prototype.slice.call(arguments, 0)); - -define('rhino/args', function () { - var args = jsLibRhinoArgs; - - //Ignore any command option used for main x.js branching - if (args[0] && args[0].indexOf('-') === 0) { - args = args.slice(1); - } - - return args; -}); - -} - -if(env === 'xpconnect') { -/** - * @license Copyright (c) 2013, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ - -/*jslint strict: false */ -/*global define, xpconnectArgs */ - -var jsLibXpConnectArgs = (typeof xpconnectArgs !== 'undefined' && xpconnectArgs) || [].concat(Array.prototype.slice.call(arguments, 0)); - -define('xpconnect/args', function () { - var args = jsLibXpConnectArgs; - - //Ignore any command option used for main x.js branching - if (args[0] && args[0].indexOf('-') === 0) { - args = args.slice(1); - } - - return args; -}); - -} - -if(env === 'browser') { -/** - * @license RequireJS Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ - -/*jslint strict: false */ -/*global define: false, console: false */ - -define('browser/load', ['./file'], function (file) { - function load(fileName) { - eval(file.readFile(fileName)); - } - - return load; -}); - -} - -if(env === 'node') { -/** - * @license RequireJS Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ - -/*jslint strict: false */ -/*global define: false, console: false */ - -define('node/load', ['fs'], function (fs) { - function load(fileName) { - var contents = fs.readFileSync(fileName, 'utf8'); - process.compile(contents, fileName); - } - - return load; -}); - -} - -if(env === 'rhino') { -/** - * @license RequireJS Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ - -/*jslint strict: false */ -/*global define: false, load: false */ - -define('rhino/load', function () { - return load; -}); - -} - -if(env === 'xpconnect') { -/** - * @license RequireJS Copyright (c) 2013, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ - -/*jslint strict: false */ -/*global define: false, load: false */ - -define('xpconnect/load', function () { - return load; -}); - -} - -if(env === 'browser') { -/** - * @license Copyright (c) 2012, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ - -/*jslint sloppy: true, nomen: true */ -/*global require, define, console, XMLHttpRequest, requirejs, location */ - -define('browser/file', ['prim'], function (prim) { - - var file, - currDirRegExp = /^\.(\/|$)/; - - function frontSlash(path) { - return path.replace(/\\/g, '/'); - } - - function exists(path) { - var status, xhr = new XMLHttpRequest(); - - //Oh yeah, that is right SYNC IO. Behold its glory - //and horrible blocking behavior. - xhr.open('HEAD', path, false); - xhr.send(); - status = xhr.status; - - return status === 200 || status === 304; - } - - function mkDir(dir) { - console.log('mkDir is no-op in browser'); - } - - function mkFullDir(dir) { - console.log('mkFullDir is no-op in browser'); - } - - file = { - backSlashRegExp: /\\/g, - exclusionRegExp: /^\./, - getLineSeparator: function () { - return '/'; - }, - - exists: function (fileName) { - return exists(fileName); - }, - - parent: function (fileName) { - var parts = fileName.split('/'); - parts.pop(); - return parts.join('/'); - }, - - /** - * Gets the absolute file path as a string, normalized - * to using front slashes for path separators. - * @param {String} fileName - */ - absPath: function (fileName) { - var dir; - if (currDirRegExp.test(fileName)) { - dir = frontSlash(location.href); - if (dir.indexOf('/') !== -1) { - dir = dir.split('/'); - - //Pull off protocol and host, just want - //to allow paths (other build parts, like - //require._isSupportedBuildUrl do not support - //full URLs), but a full path from - //the root. - dir.splice(0, 3); - - dir.pop(); - dir = '/' + dir.join('/'); - } - - fileName = dir + fileName.substring(1); - } - - return fileName; - }, - - normalize: function (fileName) { - return fileName; - }, - - isFile: function (path) { - return true; - }, - - isDirectory: function (path) { - return false; - }, - - getFilteredFileList: function (startDir, regExpFilters, makeUnixPaths) { - console.log('file.getFilteredFileList is no-op in browser'); - }, - - copyDir: function (srcDir, destDir, regExpFilter, onlyCopyNew) { - console.log('file.copyDir is no-op in browser'); - - }, - - copyFile: function (srcFileName, destFileName, onlyCopyNew) { - console.log('file.copyFile is no-op in browser'); - }, - - /** - * Renames a file. May fail if "to" already exists or is on another drive. - */ - renameFile: function (from, to) { - console.log('file.renameFile is no-op in browser'); - }, - - /** - * Reads a *text* file. - */ - readFile: function (path, encoding) { - var xhr = new XMLHttpRequest(); - - //Oh yeah, that is right SYNC IO. Behold its glory - //and horrible blocking behavior. - xhr.open('GET', path, false); - xhr.send(); - - return xhr.responseText; - }, - - readFileAsync: function (path, encoding) { - var xhr = new XMLHttpRequest(), - d = prim(); - - xhr.open('GET', path, true); - xhr.send(); - - xhr.onreadystatechange = function () { - if (xhr.readyState === 4) { - if (xhr.status > 400) { - d.reject(new Error('Status: ' + xhr.status + ': ' + xhr.statusText)); - } else { - d.resolve(xhr.responseText); - } - } - }; - - return d.promise; - }, - - saveUtf8File: function (fileName, fileContents) { - //summary: saves a *text* file using UTF-8 encoding. - file.saveFile(fileName, fileContents, "utf8"); - }, - - saveFile: function (fileName, fileContents, encoding) { - requirejs.browser.saveFile(fileName, fileContents, encoding); - }, - - deleteFile: function (fileName) { - console.log('file.deleteFile is no-op in browser'); - }, - - /** - * Deletes any empty directories under the given directory. - */ - deleteEmptyDirs: function (startDir) { - console.log('file.deleteEmptyDirs is no-op in browser'); - } - }; - - return file; - -}); - -} - -if(env === 'node') { -/** - * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ - -/*jslint plusplus: false, octal:false, strict: false */ -/*global define: false, process: false */ - -define('node/file', ['fs', 'path', 'prim'], function (fs, path, prim) { - - var isWindows = process.platform === 'win32', - windowsDriveRegExp = /^[a-zA-Z]\:\/$/, - file; - - function frontSlash(path) { - return path.replace(/\\/g, '/'); - } - - function exists(path) { - if (isWindows && path.charAt(path.length - 1) === '/' && - path.charAt(path.length - 2) !== ':') { - path = path.substring(0, path.length - 1); - } - - try { - fs.statSync(path); - return true; - } catch (e) { - return false; - } - } - - function mkDir(dir) { - if (!exists(dir) && (!isWindows || !windowsDriveRegExp.test(dir))) { - fs.mkdirSync(dir, 511); - } - } - - function mkFullDir(dir) { - var parts = dir.split('/'), - currDir = '', - first = true; - - parts.forEach(function (part) { - //First part may be empty string if path starts with a slash. - currDir += part + '/'; - first = false; - - if (part) { - mkDir(currDir); - } - }); - } - - file = { - backSlashRegExp: /\\/g, - exclusionRegExp: /^\./, - getLineSeparator: function () { - return '/'; - }, - - exists: function (fileName) { - return exists(fileName); - }, - - parent: function (fileName) { - var parts = fileName.split('/'); - parts.pop(); - return parts.join('/'); - }, - - /** - * Gets the absolute file path as a string, normalized - * to using front slashes for path separators. - * @param {String} fileName - */ - absPath: function (fileName) { - return frontSlash(path.normalize(frontSlash(fs.realpathSync(fileName)))); - }, - - normalize: function (fileName) { - return frontSlash(path.normalize(fileName)); - }, - - isFile: function (path) { - return fs.statSync(path).isFile(); - }, - - isDirectory: function (path) { - return fs.statSync(path).isDirectory(); - }, - - getFilteredFileList: function (/*String*/startDir, /*RegExp*/regExpFilters, /*boolean?*/makeUnixPaths) { - //summary: Recurses startDir and finds matches to the files that match regExpFilters.include - //and do not match regExpFilters.exclude. Or just one regexp can be passed in for regExpFilters, - //and it will be treated as the "include" case. - //Ignores files/directories that start with a period (.) unless exclusionRegExp - //is set to another value. - var files = [], topDir, regExpInclude, regExpExclude, dirFileArray, - i, stat, filePath, ok, dirFiles, fileName; - - topDir = startDir; - - regExpInclude = regExpFilters.include || regExpFilters; - regExpExclude = regExpFilters.exclude || null; - - if (file.exists(topDir)) { - dirFileArray = fs.readdirSync(topDir); - for (i = 0; i < dirFileArray.length; i++) { - fileName = dirFileArray[i]; - filePath = path.join(topDir, fileName); - stat = fs.statSync(filePath); - if (stat.isFile()) { - if (makeUnixPaths) { - //Make sure we have a JS string. - if (filePath.indexOf("/") === -1) { - filePath = frontSlash(filePath); - } - } - - ok = true; - if (regExpInclude) { - ok = filePath.match(regExpInclude); - } - if (ok && regExpExclude) { - ok = !filePath.match(regExpExclude); - } - - if (ok && (!file.exclusionRegExp || - !file.exclusionRegExp.test(fileName))) { - files.push(filePath); - } - } else if (stat.isDirectory() && - (!file.exclusionRegExp || !file.exclusionRegExp.test(fileName))) { - dirFiles = this.getFilteredFileList(filePath, regExpFilters, makeUnixPaths); - files.push.apply(files, dirFiles); - } - } - } - - return files; //Array - }, - - copyDir: function (/*String*/srcDir, /*String*/destDir, /*RegExp?*/regExpFilter, /*boolean?*/onlyCopyNew) { - //summary: copies files from srcDir to destDir using the regExpFilter to determine if the - //file should be copied. Returns a list file name strings of the destinations that were copied. - regExpFilter = regExpFilter || /\w/; - - //Normalize th directory names, but keep front slashes. - //path module on windows now returns backslashed paths. - srcDir = frontSlash(path.normalize(srcDir)); - destDir = frontSlash(path.normalize(destDir)); - - var fileNames = file.getFilteredFileList(srcDir, regExpFilter, true), - copiedFiles = [], i, srcFileName, destFileName; - - for (i = 0; i < fileNames.length; i++) { - srcFileName = fileNames[i]; - destFileName = srcFileName.replace(srcDir, destDir); - - if (file.copyFile(srcFileName, destFileName, onlyCopyNew)) { - copiedFiles.push(destFileName); - } - } - - return copiedFiles.length ? copiedFiles : null; //Array or null - }, - - copyFile: function (/*String*/srcFileName, /*String*/destFileName, /*boolean?*/onlyCopyNew) { - //summary: copies srcFileName to destFileName. If onlyCopyNew is set, it only copies the file if - //srcFileName is newer than destFileName. Returns a boolean indicating if the copy occurred. - var parentDir; - - //logger.trace("Src filename: " + srcFileName); - //logger.trace("Dest filename: " + destFileName); - - //If onlyCopyNew is true, then compare dates and only copy if the src is newer - //than dest. - if (onlyCopyNew) { - if (file.exists(destFileName) && fs.statSync(destFileName).mtime.getTime() >= fs.statSync(srcFileName).mtime.getTime()) { - return false; //Boolean - } - } - - //Make sure destination dir exists. - parentDir = path.dirname(destFileName); - if (!file.exists(parentDir)) { - mkFullDir(parentDir); - } - - fs.writeFileSync(destFileName, fs.readFileSync(srcFileName, 'binary'), 'binary'); - - return true; //Boolean - }, - - /** - * Renames a file. May fail if "to" already exists or is on another drive. - */ - renameFile: function (from, to) { - return fs.renameSync(from, to); - }, - - /** - * Reads a *text* file. - */ - readFile: function (/*String*/path, /*String?*/encoding) { - if (encoding === 'utf-8') { - encoding = 'utf8'; - } - if (!encoding) { - encoding = 'utf8'; - } - - var text = fs.readFileSync(path, encoding); - - //Hmm, would not expect to get A BOM, but it seems to happen, - //remove it just in case. - if (text.indexOf('\uFEFF') === 0) { - text = text.substring(1, text.length); - } - - return text; - }, - - readFileAsync: function (path, encoding) { - var d = prim(); - try { - d.resolve(file.readFile(path, encoding)); - } catch (e) { - d.reject(e); - } - return d.promise; - }, - - saveUtf8File: function (/*String*/fileName, /*String*/fileContents) { - //summary: saves a *text* file using UTF-8 encoding. - file.saveFile(fileName, fileContents, "utf8"); - }, - - saveFile: function (/*String*/fileName, /*String*/fileContents, /*String?*/encoding) { - //summary: saves a *text* file. - var parentDir; - - if (encoding === 'utf-8') { - encoding = 'utf8'; - } - if (!encoding) { - encoding = 'utf8'; - } - - //Make sure destination directories exist. - parentDir = path.dirname(fileName); - if (!file.exists(parentDir)) { - mkFullDir(parentDir); - } - - fs.writeFileSync(fileName, fileContents, encoding); - }, - - deleteFile: function (/*String*/fileName) { - //summary: deletes a file or directory if it exists. - var files, i, stat; - if (file.exists(fileName)) { - stat = fs.statSync(fileName); - if (stat.isDirectory()) { - files = fs.readdirSync(fileName); - for (i = 0; i < files.length; i++) { - this.deleteFile(path.join(fileName, files[i])); - } - fs.rmdirSync(fileName); - } else { - fs.unlinkSync(fileName); - } - } - }, - - - /** - * Deletes any empty directories under the given directory. - */ - deleteEmptyDirs: function (startDir) { - var dirFileArray, i, fileName, filePath, stat; - - if (file.exists(startDir)) { - dirFileArray = fs.readdirSync(startDir); - for (i = 0; i < dirFileArray.length; i++) { - fileName = dirFileArray[i]; - filePath = path.join(startDir, fileName); - stat = fs.statSync(filePath); - if (stat.isDirectory()) { - file.deleteEmptyDirs(filePath); - } - } - - //If directory is now empty, remove it. - if (fs.readdirSync(startDir).length === 0) { - file.deleteFile(startDir); - } - } - } - }; - - return file; - -}); - -} - -if(env === 'rhino') { -/** - * @license RequireJS Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ -//Helper functions to deal with file I/O. - -/*jslint plusplus: false */ -/*global java: false, define: false */ - -define('rhino/file', ['prim'], function (prim) { - var file = { - backSlashRegExp: /\\/g, - - exclusionRegExp: /^\./, - - getLineSeparator: function () { - return file.lineSeparator; - }, - - lineSeparator: java.lang.System.getProperty("line.separator"), //Java String - - exists: function (fileName) { - return (new java.io.File(fileName)).exists(); - }, - - parent: function (fileName) { - return file.absPath((new java.io.File(fileName)).getParentFile()); - }, - - normalize: function (fileName) { - return file.absPath(fileName); - }, - - isFile: function (path) { - return (new java.io.File(path)).isFile(); - }, - - isDirectory: function (path) { - return (new java.io.File(path)).isDirectory(); - }, - - /** - * Gets the absolute file path as a string, normalized - * to using front slashes for path separators. - * @param {java.io.File||String} file - */ - absPath: function (fileObj) { - if (typeof fileObj === "string") { - fileObj = new java.io.File(fileObj); - } - return (fileObj.getCanonicalPath() + "").replace(file.backSlashRegExp, "/"); - }, - - getFilteredFileList: function (/*String*/startDir, /*RegExp*/regExpFilters, /*boolean?*/makeUnixPaths, /*boolean?*/startDirIsJavaObject) { - //summary: Recurses startDir and finds matches to the files that match regExpFilters.include - //and do not match regExpFilters.exclude. Or just one regexp can be passed in for regExpFilters, - //and it will be treated as the "include" case. - //Ignores files/directories that start with a period (.) unless exclusionRegExp - //is set to another value. - var files = [], topDir, regExpInclude, regExpExclude, dirFileArray, - i, fileObj, filePath, ok, dirFiles; - - topDir = startDir; - if (!startDirIsJavaObject) { - topDir = new java.io.File(startDir); - } - - regExpInclude = regExpFilters.include || regExpFilters; - regExpExclude = regExpFilters.exclude || null; - - if (topDir.exists()) { - dirFileArray = topDir.listFiles(); - for (i = 0; i < dirFileArray.length; i++) { - fileObj = dirFileArray[i]; - if (fileObj.isFile()) { - filePath = fileObj.getPath(); - if (makeUnixPaths) { - //Make sure we have a JS string. - filePath = String(filePath); - if (filePath.indexOf("/") === -1) { - filePath = filePath.replace(/\\/g, "/"); - } - } - - ok = true; - if (regExpInclude) { - ok = filePath.match(regExpInclude); - } - if (ok && regExpExclude) { - ok = !filePath.match(regExpExclude); - } - - if (ok && (!file.exclusionRegExp || - !file.exclusionRegExp.test(fileObj.getName()))) { - files.push(filePath); - } - } else if (fileObj.isDirectory() && - (!file.exclusionRegExp || !file.exclusionRegExp.test(fileObj.getName()))) { - dirFiles = this.getFilteredFileList(fileObj, regExpFilters, makeUnixPaths, true); - files.push.apply(files, dirFiles); - } - } - } - - return files; //Array - }, - - copyDir: function (/*String*/srcDir, /*String*/destDir, /*RegExp?*/regExpFilter, /*boolean?*/onlyCopyNew) { - //summary: copies files from srcDir to destDir using the regExpFilter to determine if the - //file should be copied. Returns a list file name strings of the destinations that were copied. - regExpFilter = regExpFilter || /\w/; - - var fileNames = file.getFilteredFileList(srcDir, regExpFilter, true), - copiedFiles = [], i, srcFileName, destFileName; - - for (i = 0; i < fileNames.length; i++) { - srcFileName = fileNames[i]; - destFileName = srcFileName.replace(srcDir, destDir); - - if (file.copyFile(srcFileName, destFileName, onlyCopyNew)) { - copiedFiles.push(destFileName); - } - } - - return copiedFiles.length ? copiedFiles : null; //Array or null - }, - - copyFile: function (/*String*/srcFileName, /*String*/destFileName, /*boolean?*/onlyCopyNew) { - //summary: copies srcFileName to destFileName. If onlyCopyNew is set, it only copies the file if - //srcFileName is newer than destFileName. Returns a boolean indicating if the copy occurred. - var destFile = new java.io.File(destFileName), srcFile, parentDir, - srcChannel, destChannel; - - //logger.trace("Src filename: " + srcFileName); - //logger.trace("Dest filename: " + destFileName); - - //If onlyCopyNew is true, then compare dates and only copy if the src is newer - //than dest. - if (onlyCopyNew) { - srcFile = new java.io.File(srcFileName); - if (destFile.exists() && destFile.lastModified() >= srcFile.lastModified()) { - return false; //Boolean - } - } - - //Make sure destination dir exists. - parentDir = destFile.getParentFile(); - if (!parentDir.exists()) { - if (!parentDir.mkdirs()) { - throw "Could not create directory: " + parentDir.getCanonicalPath(); - } - } - - //Java's version of copy file. - srcChannel = new java.io.FileInputStream(srcFileName).getChannel(); - destChannel = new java.io.FileOutputStream(destFileName).getChannel(); - destChannel.transferFrom(srcChannel, 0, srcChannel.size()); - srcChannel.close(); - destChannel.close(); - - return true; //Boolean - }, - - /** - * Renames a file. May fail if "to" already exists or is on another drive. - */ - renameFile: function (from, to) { - return (new java.io.File(from)).renameTo((new java.io.File(to))); - }, - - readFile: function (/*String*/path, /*String?*/encoding) { - //A file read function that can deal with BOMs - encoding = encoding || "utf-8"; - var fileObj = new java.io.File(path), - input = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(fileObj), encoding)), - stringBuffer, line; - try { - stringBuffer = new java.lang.StringBuffer(); - line = input.readLine(); - - // Byte Order Mark (BOM) - The Unicode Standard, version 3.0, page 324 - // http://www.unicode.org/faq/utf_bom.html - - // Note that when we use utf-8, the BOM should appear as "EF BB BF", but it doesn't due to this bug in the JDK: - // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4508058 - if (line && line.length() && line.charAt(0) === 0xfeff) { - // Eat the BOM, since we've already found the encoding on this file, - // and we plan to concatenating this buffer with others; the BOM should - // only appear at the top of a file. - line = line.substring(1); - } - while (line !== null) { - stringBuffer.append(line); - stringBuffer.append(file.lineSeparator); - line = input.readLine(); - } - //Make sure we return a JavaScript string and not a Java string. - return String(stringBuffer.toString()); //String - } finally { - input.close(); - } - }, - - readFileAsync: function (path, encoding) { - var d = prim(); - try { - d.resolve(file.readFile(path, encoding)); - } catch (e) { - d.reject(e); - } - return d.promise; - }, - - saveUtf8File: function (/*String*/fileName, /*String*/fileContents) { - //summary: saves a file using UTF-8 encoding. - file.saveFile(fileName, fileContents, "utf-8"); - }, - - saveFile: function (/*String*/fileName, /*String*/fileContents, /*String?*/encoding) { - //summary: saves a file. - var outFile = new java.io.File(fileName), outWriter, parentDir, os; - - parentDir = outFile.getAbsoluteFile().getParentFile(); - if (!parentDir.exists()) { - if (!parentDir.mkdirs()) { - throw "Could not create directory: " + parentDir.getAbsolutePath(); - } - } - - if (encoding) { - outWriter = new java.io.OutputStreamWriter(new java.io.FileOutputStream(outFile), encoding); - } else { - outWriter = new java.io.OutputStreamWriter(new java.io.FileOutputStream(outFile)); - } - - os = new java.io.BufferedWriter(outWriter); - try { - os.write(fileContents); - } finally { - os.close(); - } - }, - - deleteFile: function (/*String*/fileName) { - //summary: deletes a file or directory if it exists. - var fileObj = new java.io.File(fileName), files, i; - if (fileObj.exists()) { - if (fileObj.isDirectory()) { - files = fileObj.listFiles(); - for (i = 0; i < files.length; i++) { - this.deleteFile(files[i]); - } - } - fileObj["delete"](); - } - }, - - /** - * Deletes any empty directories under the given directory. - * The startDirIsJavaObject is private to this implementation's - * recursion needs. - */ - deleteEmptyDirs: function (startDir, startDirIsJavaObject) { - var topDir = startDir, - dirFileArray, i, fileObj; - - if (!startDirIsJavaObject) { - topDir = new java.io.File(startDir); - } - - if (topDir.exists()) { - dirFileArray = topDir.listFiles(); - for (i = 0; i < dirFileArray.length; i++) { - fileObj = dirFileArray[i]; - if (fileObj.isDirectory()) { - file.deleteEmptyDirs(fileObj, true); - } - } - - //If the directory is empty now, delete it. - if (topDir.listFiles().length === 0) { - file.deleteFile(String(topDir.getPath())); - } - } - } - }; - - return file; -}); - -} - -if(env === 'xpconnect') { -/** - * @license RequireJS Copyright (c) 2013, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ -//Helper functions to deal with file I/O. - -/*jslint plusplus: false */ -/*global define, Components, xpcUtil */ - -define('xpconnect/file', ['prim'], function (prim) { - var file, - Cc = Components.classes, - Ci = Components.interfaces, - //Depends on xpcUtil which is set up in x.js - xpfile = xpcUtil.xpfile; - - function mkFullDir(dirObj) { - //1 is DIRECTORY_TYPE, 511 is 0777 permissions - if (!dirObj.exists()) { - dirObj.create(1, 511); - } - } - - file = { - backSlashRegExp: /\\/g, - - exclusionRegExp: /^\./, - - getLineSeparator: function () { - return file.lineSeparator; - }, - - lineSeparator: ('@mozilla.org/windows-registry-key;1' in Cc) ? - '\r\n' : '\n', - - exists: function (fileName) { - return xpfile(fileName).exists(); - }, - - parent: function (fileName) { - return xpfile(fileName).parent; - }, - - normalize: function (fileName) { - return file.absPath(fileName); - }, - - isFile: function (path) { - return xpfile(path).isFile(); - }, - - isDirectory: function (path) { - return xpfile(path).isDirectory(); - }, - - /** - * Gets the absolute file path as a string, normalized - * to using front slashes for path separators. - * @param {java.io.File||String} file - */ - absPath: function (fileObj) { - if (typeof fileObj === "string") { - fileObj = xpfile(fileObj); - } - return fileObj.path; - }, - - getFilteredFileList: function (/*String*/startDir, /*RegExp*/regExpFilters, /*boolean?*/makeUnixPaths, /*boolean?*/startDirIsObject) { - //summary: Recurses startDir and finds matches to the files that match regExpFilters.include - //and do not match regExpFilters.exclude. Or just one regexp can be passed in for regExpFilters, - //and it will be treated as the "include" case. - //Ignores files/directories that start with a period (.) unless exclusionRegExp - //is set to another value. - var files = [], topDir, regExpInclude, regExpExclude, dirFileArray, - fileObj, filePath, ok, dirFiles; - - topDir = startDir; - if (!startDirIsObject) { - topDir = xpfile(startDir); - } - - regExpInclude = regExpFilters.include || regExpFilters; - regExpExclude = regExpFilters.exclude || null; - - if (topDir.exists()) { - dirFileArray = topDir.directoryEntries; - while (dirFileArray.hasMoreElements()) { - fileObj = dirFileArray.getNext().QueryInterface(Ci.nsILocalFile); - if (fileObj.isFile()) { - filePath = fileObj.path; - if (makeUnixPaths) { - if (filePath.indexOf("/") === -1) { - filePath = filePath.replace(/\\/g, "/"); - } - } - - ok = true; - if (regExpInclude) { - ok = filePath.match(regExpInclude); - } - if (ok && regExpExclude) { - ok = !filePath.match(regExpExclude); - } - - if (ok && (!file.exclusionRegExp || - !file.exclusionRegExp.test(fileObj.leafName))) { - files.push(filePath); - } - } else if (fileObj.isDirectory() && - (!file.exclusionRegExp || !file.exclusionRegExp.test(fileObj.leafName))) { - dirFiles = this.getFilteredFileList(fileObj, regExpFilters, makeUnixPaths, true); - files.push.apply(files, dirFiles); - } - } - } - - return files; //Array - }, - - copyDir: function (/*String*/srcDir, /*String*/destDir, /*RegExp?*/regExpFilter, /*boolean?*/onlyCopyNew) { - //summary: copies files from srcDir to destDir using the regExpFilter to determine if the - //file should be copied. Returns a list file name strings of the destinations that were copied. - regExpFilter = regExpFilter || /\w/; - - var fileNames = file.getFilteredFileList(srcDir, regExpFilter, true), - copiedFiles = [], i, srcFileName, destFileName; - - for (i = 0; i < fileNames.length; i += 1) { - srcFileName = fileNames[i]; - destFileName = srcFileName.replace(srcDir, destDir); - - if (file.copyFile(srcFileName, destFileName, onlyCopyNew)) { - copiedFiles.push(destFileName); - } - } - - return copiedFiles.length ? copiedFiles : null; //Array or null - }, - - copyFile: function (/*String*/srcFileName, /*String*/destFileName, /*boolean?*/onlyCopyNew) { - //summary: copies srcFileName to destFileName. If onlyCopyNew is set, it only copies the file if - //srcFileName is newer than destFileName. Returns a boolean indicating if the copy occurred. - var destFile = xpfile(destFileName), - srcFile = xpfile(srcFileName); - - //logger.trace("Src filename: " + srcFileName); - //logger.trace("Dest filename: " + destFileName); - - //If onlyCopyNew is true, then compare dates and only copy if the src is newer - //than dest. - if (onlyCopyNew) { - if (destFile.exists() && destFile.lastModifiedTime >= srcFile.lastModifiedTime) { - return false; //Boolean - } - } - - srcFile.copyTo(destFile.parent, destFile.leafName); - - return true; //Boolean - }, - - /** - * Renames a file. May fail if "to" already exists or is on another drive. - */ - renameFile: function (from, to) { - var toFile = xpfile(to); - return xpfile(from).moveTo(toFile.parent, toFile.leafName); - }, - - readFile: xpcUtil.readFile, - - readFileAsync: function (path, encoding) { - var d = prim(); - try { - d.resolve(file.readFile(path, encoding)); - } catch (e) { - d.reject(e); - } - return d.promise; - }, - - saveUtf8File: function (/*String*/fileName, /*String*/fileContents) { - //summary: saves a file using UTF-8 encoding. - file.saveFile(fileName, fileContents, "utf-8"); - }, - - saveFile: function (/*String*/fileName, /*String*/fileContents, /*String?*/encoding) { - var outStream, convertStream, - fileObj = xpfile(fileName); - - mkFullDir(fileObj.parent); - - try { - outStream = Cc['@mozilla.org/network/file-output-stream;1'] - .createInstance(Ci.nsIFileOutputStream); - //438 is decimal for 0777 - outStream.init(fileObj, 0x02 | 0x08 | 0x20, 511, 0); - - convertStream = Cc['@mozilla.org/intl/converter-output-stream;1'] - .createInstance(Ci.nsIConverterOutputStream); - - convertStream.init(outStream, encoding, 0, 0); - convertStream.writeString(fileContents); - } catch (e) { - throw new Error((fileObj && fileObj.path || '') + ': ' + e); - } finally { - if (convertStream) { - convertStream.close(); - } - if (outStream) { - outStream.close(); - } - } - }, - - deleteFile: function (/*String*/fileName) { - //summary: deletes a file or directory if it exists. - var fileObj = xpfile(fileName); - if (fileObj.exists()) { - fileObj.remove(true); - } - }, - - /** - * Deletes any empty directories under the given directory. - * The startDirIsJavaObject is private to this implementation's - * recursion needs. - */ - deleteEmptyDirs: function (startDir, startDirIsObject) { - var topDir = startDir, - dirFileArray, fileObj; - - if (!startDirIsObject) { - topDir = xpfile(startDir); - } - - if (topDir.exists()) { - dirFileArray = topDir.directoryEntries; - while (dirFileArray.hasMoreElements()) { - fileObj = dirFileArray.getNext().QueryInterface(Ci.nsILocalFile); - - if (fileObj.isDirectory()) { - file.deleteEmptyDirs(fileObj, true); - } - } - - //If the directory is empty now, delete it. - dirFileArray = topDir.directoryEntries; - if (!dirFileArray.hasMoreElements()) { - file.deleteFile(topDir.path); - } - } - } - }; - - return file; -}); - -} - -if(env === 'browser') { -/*global process */ -define('browser/quit', function () { - 'use strict'; - return function (code) { - }; -}); -} - -if(env === 'node') { -/*global process */ -define('node/quit', function () { - 'use strict'; - return function (code) { - var draining = 0; - var exit = function () { - if (draining === 0) { - process.exit(code); - } else { - draining -= 1; - } - }; - if (process.stdout.bufferSize) { - draining += 1; - process.stdout.once('drain', exit); - } - if (process.stderr.bufferSize) { - draining += 1; - process.stderr.once('drain', exit); - } - exit(); - }; -}); - -} - -if(env === 'rhino') { -/*global quit */ -define('rhino/quit', function () { - 'use strict'; - return function (code) { - return quit(code); - }; -}); - -} - -if(env === 'xpconnect') { -/*global quit */ -define('xpconnect/quit', function () { - 'use strict'; - return function (code) { - return quit(code); - }; -}); - -} - -if(env === 'browser') { -/** - * @license RequireJS Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ - -/*jslint strict: false */ -/*global define: false, console: false */ - -define('browser/print', function () { - function print(msg) { - console.log(msg); - } - - return print; -}); - -} - -if(env === 'node') { -/** - * @license RequireJS Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ - -/*jslint strict: false */ -/*global define: false, console: false */ - -define('node/print', function () { - function print(msg) { - console.log(msg); - } - - return print; -}); - -} - -if(env === 'rhino') { -/** - * @license RequireJS Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ - -/*jslint strict: false */ -/*global define: false, print: false */ - -define('rhino/print', function () { - return print; -}); - -} - -if(env === 'xpconnect') { -/** - * @license RequireJS Copyright (c) 2013, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ - -/*jslint strict: false */ -/*global define: false, print: false */ - -define('xpconnect/print', function () { - return print; -}); - -} -/** - * @license RequireJS Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ - -/*jslint nomen: false, strict: false */ -/*global define: false */ - -define('logger', ['env!env/print'], function (print) { - var logger = { - TRACE: 0, - INFO: 1, - WARN: 2, - ERROR: 3, - SILENT: 4, - level: 0, - logPrefix: "", - - logLevel: function( level ) { - this.level = level; - }, - - trace: function (message) { - if (this.level <= this.TRACE) { - this._print(message); - } - }, - - info: function (message) { - if (this.level <= this.INFO) { - this._print(message); - } - }, - - warn: function (message) { - if (this.level <= this.WARN) { - this._print(message); - } - }, - - error: function (message) { - if (this.level <= this.ERROR) { - this._print(message); - } - }, - - _print: function (message) { - this._sysPrint((this.logPrefix ? (this.logPrefix + " ") : "") + message); - }, - - _sysPrint: function (message) { - print(message); - } - }; - - return logger; -}); -//Just a blank file to use when building the optimizer with the optimizer, -//so that the build does not attempt to inline some env modules, -//like Node's fs and path. - -/* - Copyright (C) 2012 Ariya Hidayat - Copyright (C) 2012 Mathias Bynens - Copyright (C) 2012 Joost-Wim Boekesteijn - Copyright (C) 2012 Kris Kowal - Copyright (C) 2012 Yusuke Suzuki - Copyright (C) 2012 Arpad Borsos - Copyright (C) 2011 Ariya Hidayat - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/*jslint bitwise:true plusplus:true */ -/*global esprima:true, define:true, exports:true, window: true, -throwError: true, createLiteral: true, generateStatement: true, -parseAssignmentExpression: true, parseBlock: true, parseExpression: true, -parseFunctionDeclaration: true, parseFunctionExpression: true, -parseFunctionSourceElements: true, parseVariableIdentifier: true, -parseLeftHandSideExpression: true, -parseStatement: true, parseSourceElement: true */ - -(function (root, factory) { - 'use strict'; - - // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, - // Rhino, and plain browser loading. - if (typeof define === 'function' && define.amd) { - define('esprima', ['exports'], factory); - } else if (typeof exports !== 'undefined') { - factory(exports); - } else { - factory((root.esprima = {})); - } -}(this, function (exports) { - 'use strict'; - - var Token, - TokenName, - Syntax, - PropertyKind, - Messages, - Regex, - source, - strict, - index, - lineNumber, - lineStart, - length, - buffer, - state, - extra; - - Token = { - BooleanLiteral: 1, - EOF: 2, - Identifier: 3, - Keyword: 4, - NullLiteral: 5, - NumericLiteral: 6, - Punctuator: 7, - StringLiteral: 8 - }; - - TokenName = {}; - TokenName[Token.BooleanLiteral] = 'Boolean'; - TokenName[Token.EOF] = ''; - TokenName[Token.Identifier] = 'Identifier'; - TokenName[Token.Keyword] = 'Keyword'; - TokenName[Token.NullLiteral] = 'Null'; - TokenName[Token.NumericLiteral] = 'Numeric'; - TokenName[Token.Punctuator] = 'Punctuator'; - TokenName[Token.StringLiteral] = 'String'; - - Syntax = { - AssignmentExpression: 'AssignmentExpression', - ArrayExpression: 'ArrayExpression', - BlockStatement: 'BlockStatement', - BinaryExpression: 'BinaryExpression', - BreakStatement: 'BreakStatement', - CallExpression: 'CallExpression', - CatchClause: 'CatchClause', - ConditionalExpression: 'ConditionalExpression', - ContinueStatement: 'ContinueStatement', - DoWhileStatement: 'DoWhileStatement', - DebuggerStatement: 'DebuggerStatement', - EmptyStatement: 'EmptyStatement', - ExpressionStatement: 'ExpressionStatement', - ForStatement: 'ForStatement', - ForInStatement: 'ForInStatement', - FunctionDeclaration: 'FunctionDeclaration', - FunctionExpression: 'FunctionExpression', - Identifier: 'Identifier', - IfStatement: 'IfStatement', - Literal: 'Literal', - LabeledStatement: 'LabeledStatement', - LogicalExpression: 'LogicalExpression', - MemberExpression: 'MemberExpression', - NewExpression: 'NewExpression', - ObjectExpression: 'ObjectExpression', - Program: 'Program', - Property: 'Property', - ReturnStatement: 'ReturnStatement', - SequenceExpression: 'SequenceExpression', - SwitchStatement: 'SwitchStatement', - SwitchCase: 'SwitchCase', - ThisExpression: 'ThisExpression', - ThrowStatement: 'ThrowStatement', - TryStatement: 'TryStatement', - UnaryExpression: 'UnaryExpression', - UpdateExpression: 'UpdateExpression', - VariableDeclaration: 'VariableDeclaration', - VariableDeclarator: 'VariableDeclarator', - WhileStatement: 'WhileStatement', - WithStatement: 'WithStatement' - }; - - PropertyKind = { - Data: 1, - Get: 2, - Set: 4 - }; - - // Error messages should be identical to V8. - Messages = { - UnexpectedToken: 'Unexpected token %0', - UnexpectedNumber: 'Unexpected number', - UnexpectedString: 'Unexpected string', - UnexpectedIdentifier: 'Unexpected identifier', - UnexpectedReserved: 'Unexpected reserved word', - UnexpectedEOS: 'Unexpected end of input', - NewlineAfterThrow: 'Illegal newline after throw', - InvalidRegExp: 'Invalid regular expression', - UnterminatedRegExp: 'Invalid regular expression: missing /', - InvalidLHSInAssignment: 'Invalid left-hand side in assignment', - InvalidLHSInForIn: 'Invalid left-hand side in for-in', - MultipleDefaultsInSwitch: 'More than one default clause in switch statement', - NoCatchOrFinally: 'Missing catch or finally after try', - UnknownLabel: 'Undefined label \'%0\'', - Redeclaration: '%0 \'%1\' has already been declared', - IllegalContinue: 'Illegal continue statement', - IllegalBreak: 'Illegal break statement', - IllegalReturn: 'Illegal return statement', - StrictModeWith: 'Strict mode code may not include a with statement', - StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode', - StrictVarName: 'Variable name may not be eval or arguments in strict mode', - StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode', - StrictParamDupe: 'Strict mode function may not have duplicate parameter names', - StrictFunctionName: 'Function name may not be eval or arguments in strict mode', - StrictOctalLiteral: 'Octal literals are not allowed in strict mode.', - StrictDelete: 'Delete of an unqualified identifier in strict mode.', - StrictDuplicateProperty: 'Duplicate data property in object literal not allowed in strict mode', - AccessorDataProperty: 'Object literal may not have data and accessor property with the same name', - AccessorGetSet: 'Object literal may not have multiple get/set accessors with the same name', - StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode', - StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode', - StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode', - StrictReservedWord: 'Use of future reserved word in strict mode' - }; - - // See also tools/generate-unicode-regex.py. - Regex = { - NonAsciiIdentifierStart: new RegExp('[\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]'), - NonAsciiIdentifierPart: new RegExp('[\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0300-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u0483-\u0487\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u05d0-\u05ea\u05f0-\u05f2\u0610-\u061a\u0620-\u0669\u066e-\u06d3\u06d5-\u06dc\u06df-\u06e8\u06ea-\u06fc\u06ff\u0710-\u074a\u074d-\u07b1\u07c0-\u07f5\u07fa\u0800-\u082d\u0840-\u085b\u08a0\u08a2-\u08ac\u08e4-\u08fe\u0900-\u0963\u0966-\u096f\u0971-\u0977\u0979-\u097f\u0981-\u0983\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bc-\u09c4\u09c7\u09c8\u09cb-\u09ce\u09d7\u09dc\u09dd\u09df-\u09e3\u09e6-\u09f1\u0a01-\u0a03\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a59-\u0a5c\u0a5e\u0a66-\u0a75\u0a81-\u0a83\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abc-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ad0\u0ae0-\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3c-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b5c\u0b5d\u0b5f-\u0b63\u0b66-\u0b6f\u0b71\u0b82\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd0\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c58\u0c59\u0c60-\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbc-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0cde\u0ce0-\u0ce3\u0ce6-\u0cef\u0cf1\u0cf2\u0d02\u0d03\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d-\u0d44\u0d46-\u0d48\u0d4a-\u0d4e\u0d57\u0d60-\u0d63\u0d66-\u0d6f\u0d7a-\u0d7f\u0d82\u0d83\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e01-\u0e3a\u0e40-\u0e4e\u0e50-\u0e59\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb9\u0ebb-\u0ebd\u0ec0-\u0ec4\u0ec6\u0ec8-\u0ecd\u0ed0-\u0ed9\u0edc-\u0edf\u0f00\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e-\u0f47\u0f49-\u0f6c\u0f71-\u0f84\u0f86-\u0f97\u0f99-\u0fbc\u0fc6\u1000-\u1049\u1050-\u109d\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u135d-\u135f\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176c\u176e-\u1770\u1772\u1773\u1780-\u17d3\u17d7\u17dc\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u1820-\u1877\u1880-\u18aa\u18b0-\u18f5\u1900-\u191c\u1920-\u192b\u1930-\u193b\u1946-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u19d0-\u19d9\u1a00-\u1a1b\u1a20-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1aa7\u1b00-\u1b4b\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1bf3\u1c00-\u1c37\u1c40-\u1c49\u1c4d-\u1c7d\u1cd0-\u1cd2\u1cd4-\u1cf6\u1d00-\u1de6\u1dfc-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u200c\u200d\u203f\u2040\u2054\u2071\u207f\u2090-\u209c\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d7f-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2de0-\u2dff\u2e2f\u3005-\u3007\u3021-\u302f\u3031-\u3035\u3038-\u303c\u3041-\u3096\u3099\u309a\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua62b\ua640-\ua66f\ua674-\ua67d\ua67f-\ua697\ua69f-\ua6f1\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua827\ua840-\ua873\ua880-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f7\ua8fb\ua900-\ua92d\ua930-\ua953\ua960-\ua97c\ua980-\ua9c0\ua9cf-\ua9d9\uaa00-\uaa36\uaa40-\uaa4d\uaa50-\uaa59\uaa60-\uaa76\uaa7a\uaa7b\uaa80-\uaac2\uaadb-\uaadd\uaae0-\uaaef\uaaf2-\uaaf6\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabea\uabec\uabed\uabf0-\uabf9\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\ufe70-\ufe74\ufe76-\ufefc\uff10-\uff19\uff21-\uff3a\uff3f\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]') - }; - - // Ensure the condition is true, otherwise throw an error. - // This is only to have a better contract semantic, i.e. another safety net - // to catch a logic error. The condition shall be fulfilled in normal case. - // Do NOT use this to enforce a certain condition on any user input. - - function assert(condition, message) { - if (!condition) { - throw new Error('ASSERT: ' + message); - } - } - - function sliceSource(from, to) { - return source.slice(from, to); - } - - if (typeof 'esprima'[0] === 'undefined') { - sliceSource = function sliceArraySource(from, to) { - return source.slice(from, to).join(''); - }; - } - - function isDecimalDigit(ch) { - return '0123456789'.indexOf(ch) >= 0; - } - - function isHexDigit(ch) { - return '0123456789abcdefABCDEF'.indexOf(ch) >= 0; - } - - function isOctalDigit(ch) { - return '01234567'.indexOf(ch) >= 0; - } - - - // 7.2 White Space - - function isWhiteSpace(ch) { - return (ch === ' ') || (ch === '\u0009') || (ch === '\u000B') || - (ch === '\u000C') || (ch === '\u00A0') || - (ch.charCodeAt(0) >= 0x1680 && - '\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\uFEFF'.indexOf(ch) >= 0); - } - - // 7.3 Line Terminators - - function isLineTerminator(ch) { - return (ch === '\n' || ch === '\r' || ch === '\u2028' || ch === '\u2029'); - } - - // 7.6 Identifier Names and Identifiers - - function isIdentifierStart(ch) { - return (ch === '$') || (ch === '_') || (ch === '\\') || - (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || - ((ch.charCodeAt(0) >= 0x80) && Regex.NonAsciiIdentifierStart.test(ch)); - } - - function isIdentifierPart(ch) { - return (ch === '$') || (ch === '_') || (ch === '\\') || - (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || - ((ch >= '0') && (ch <= '9')) || - ((ch.charCodeAt(0) >= 0x80) && Regex.NonAsciiIdentifierPart.test(ch)); - } - - // 7.6.1.2 Future Reserved Words - - function isFutureReservedWord(id) { - switch (id) { - - // Future reserved words. - case 'class': - case 'enum': - case 'export': - case 'extends': - case 'import': - case 'super': - return true; - } - - return false; - } - - function isStrictModeReservedWord(id) { - switch (id) { - - // Strict Mode reserved words. - case 'implements': - case 'interface': - case 'package': - case 'private': - case 'protected': - case 'public': - case 'static': - case 'yield': - case 'let': - return true; - } - - return false; - } - - function isRestrictedWord(id) { - return id === 'eval' || id === 'arguments'; - } - - // 7.6.1.1 Keywords - - function isKeyword(id) { - var keyword = false; - switch (id.length) { - case 2: - keyword = (id === 'if') || (id === 'in') || (id === 'do'); - break; - case 3: - keyword = (id === 'var') || (id === 'for') || (id === 'new') || (id === 'try'); - break; - case 4: - keyword = (id === 'this') || (id === 'else') || (id === 'case') || (id === 'void') || (id === 'with'); - break; - case 5: - keyword = (id === 'while') || (id === 'break') || (id === 'catch') || (id === 'throw'); - break; - case 6: - keyword = (id === 'return') || (id === 'typeof') || (id === 'delete') || (id === 'switch'); - break; - case 7: - keyword = (id === 'default') || (id === 'finally'); - break; - case 8: - keyword = (id === 'function') || (id === 'continue') || (id === 'debugger'); - break; - case 10: - keyword = (id === 'instanceof'); - break; - } - - if (keyword) { - return true; - } - - switch (id) { - // Future reserved words. - // 'const' is specialized as Keyword in V8. - case 'const': - return true; - - // For compatiblity to SpiderMonkey and ES.next - case 'yield': - case 'let': - return true; - } - - if (strict && isStrictModeReservedWord(id)) { - return true; - } - - return isFutureReservedWord(id); - } - - // 7.4 Comments - - function skipComment() { - var ch, blockComment, lineComment; - - blockComment = false; - lineComment = false; - - while (index < length) { - ch = source[index]; - - if (lineComment) { - ch = source[index++]; - if (isLineTerminator(ch)) { - lineComment = false; - if (ch === '\r' && source[index] === '\n') { - ++index; - } - ++lineNumber; - lineStart = index; - } - } else if (blockComment) { - if (isLineTerminator(ch)) { - if (ch === '\r' && source[index + 1] === '\n') { - ++index; - } - ++lineNumber; - ++index; - lineStart = index; - if (index >= length) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - } else { - ch = source[index++]; - if (index >= length) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - if (ch === '*') { - ch = source[index]; - if (ch === '/') { - ++index; - blockComment = false; - } - } - } - } else if (ch === '/') { - ch = source[index + 1]; - if (ch === '/') { - index += 2; - lineComment = true; - } else if (ch === '*') { - index += 2; - blockComment = true; - if (index >= length) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - } else { - break; - } - } else if (isWhiteSpace(ch)) { - ++index; - } else if (isLineTerminator(ch)) { - ++index; - if (ch === '\r' && source[index] === '\n') { - ++index; - } - ++lineNumber; - lineStart = index; - } else { - break; - } - } - } - - function scanHexEscape(prefix) { - var i, len, ch, code = 0; - - len = (prefix === 'u') ? 4 : 2; - for (i = 0; i < len; ++i) { - if (index < length && isHexDigit(source[index])) { - ch = source[index++]; - code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase()); - } else { - return ''; - } - } - return String.fromCharCode(code); - } - - function scanIdentifier() { - var ch, start, id, restore; - - ch = source[index]; - if (!isIdentifierStart(ch)) { - return; - } - - start = index; - if (ch === '\\') { - ++index; - if (source[index] !== 'u') { - return; - } - ++index; - restore = index; - ch = scanHexEscape('u'); - if (ch) { - if (ch === '\\' || !isIdentifierStart(ch)) { - return; - } - id = ch; - } else { - index = restore; - id = 'u'; - } - } else { - id = source[index++]; - } - - while (index < length) { - ch = source[index]; - if (!isIdentifierPart(ch)) { - break; - } - if (ch === '\\') { - ++index; - if (source[index] !== 'u') { - return; - } - ++index; - restore = index; - ch = scanHexEscape('u'); - if (ch) { - if (ch === '\\' || !isIdentifierPart(ch)) { - return; - } - id += ch; - } else { - index = restore; - id += 'u'; - } - } else { - id += source[index++]; - } - } - - // There is no keyword or literal with only one character. - // Thus, it must be an identifier. - if (id.length === 1) { - return { - type: Token.Identifier, - value: id, - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - - if (isKeyword(id)) { - return { - type: Token.Keyword, - value: id, - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - - // 7.8.1 Null Literals - - if (id === 'null') { - return { - type: Token.NullLiteral, - value: id, - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - - // 7.8.2 Boolean Literals - - if (id === 'true' || id === 'false') { - return { - type: Token.BooleanLiteral, - value: id, - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - - return { - type: Token.Identifier, - value: id, - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - - // 7.7 Punctuators - - function scanPunctuator() { - var start = index, - ch1 = source[index], - ch2, - ch3, - ch4; - - // Check for most common single-character punctuators. - - if (ch1 === ';' || ch1 === '{' || ch1 === '}') { - ++index; - return { - type: Token.Punctuator, - value: ch1, - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - - if (ch1 === ',' || ch1 === '(' || ch1 === ')') { - ++index; - return { - type: Token.Punctuator, - value: ch1, - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - - // Dot (.) can also start a floating-point number, hence the need - // to check the next character. - - ch2 = source[index + 1]; - if (ch1 === '.' && !isDecimalDigit(ch2)) { - return { - type: Token.Punctuator, - value: source[index++], - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - - // Peek more characters. - - ch3 = source[index + 2]; - ch4 = source[index + 3]; - - // 4-character punctuator: >>>= - - if (ch1 === '>' && ch2 === '>' && ch3 === '>') { - if (ch4 === '=') { - index += 4; - return { - type: Token.Punctuator, - value: '>>>=', - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - } - - // 3-character punctuators: === !== >>> <<= >>= - - if (ch1 === '=' && ch2 === '=' && ch3 === '=') { - index += 3; - return { - type: Token.Punctuator, - value: '===', - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - - if (ch1 === '!' && ch2 === '=' && ch3 === '=') { - index += 3; - return { - type: Token.Punctuator, - value: '!==', - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - - if (ch1 === '>' && ch2 === '>' && ch3 === '>') { - index += 3; - return { - type: Token.Punctuator, - value: '>>>', - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - - if (ch1 === '<' && ch2 === '<' && ch3 === '=') { - index += 3; - return { - type: Token.Punctuator, - value: '<<=', - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - - if (ch1 === '>' && ch2 === '>' && ch3 === '=') { - index += 3; - return { - type: Token.Punctuator, - value: '>>=', - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - - // 2-character punctuators: <= >= == != ++ -- << >> && || - // += -= *= %= &= |= ^= /= - - if (ch2 === '=') { - if ('<>=!+-*%&|^/'.indexOf(ch1) >= 0) { - index += 2; - return { - type: Token.Punctuator, - value: ch1 + ch2, - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - } - - if (ch1 === ch2 && ('+-<>&|'.indexOf(ch1) >= 0)) { - if ('+-<>&|'.indexOf(ch2) >= 0) { - index += 2; - return { - type: Token.Punctuator, - value: ch1 + ch2, - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - } - - // The remaining 1-character punctuators. - - if ('[]<>+-*%&|^!~?:=/'.indexOf(ch1) >= 0) { - return { - type: Token.Punctuator, - value: source[index++], - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - } - - // 7.8.3 Numeric Literals - - function scanNumericLiteral() { - var number, start, ch; - - ch = source[index]; - assert(isDecimalDigit(ch) || (ch === '.'), - 'Numeric literal must start with a decimal digit or a decimal point'); - - start = index; - number = ''; - if (ch !== '.') { - number = source[index++]; - ch = source[index]; - - // Hex number starts with '0x'. - // Octal number starts with '0'. - if (number === '0') { - if (ch === 'x' || ch === 'X') { - number += source[index++]; - while (index < length) { - ch = source[index]; - if (!isHexDigit(ch)) { - break; - } - number += source[index++]; - } - - if (number.length <= 2) { - // only 0x - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - - if (index < length) { - ch = source[index]; - if (isIdentifierStart(ch)) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - } - return { - type: Token.NumericLiteral, - value: parseInt(number, 16), - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } else if (isOctalDigit(ch)) { - number += source[index++]; - while (index < length) { - ch = source[index]; - if (!isOctalDigit(ch)) { - break; - } - number += source[index++]; - } - - if (index < length) { - ch = source[index]; - if (isIdentifierStart(ch) || isDecimalDigit(ch)) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - } - return { - type: Token.NumericLiteral, - value: parseInt(number, 8), - octal: true, - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - - // decimal number starts with '0' such as '09' is illegal. - if (isDecimalDigit(ch)) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - } - - while (index < length) { - ch = source[index]; - if (!isDecimalDigit(ch)) { - break; - } - number += source[index++]; - } - } - - if (ch === '.') { - number += source[index++]; - while (index < length) { - ch = source[index]; - if (!isDecimalDigit(ch)) { - break; - } - number += source[index++]; - } - } - - if (ch === 'e' || ch === 'E') { - number += source[index++]; - - ch = source[index]; - if (ch === '+' || ch === '-') { - number += source[index++]; - } - - ch = source[index]; - if (isDecimalDigit(ch)) { - number += source[index++]; - while (index < length) { - ch = source[index]; - if (!isDecimalDigit(ch)) { - break; - } - number += source[index++]; - } - } else { - ch = 'character ' + ch; - if (index >= length) { - ch = ''; - } - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - } - - if (index < length) { - ch = source[index]; - if (isIdentifierStart(ch)) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - } - - return { - type: Token.NumericLiteral, - value: parseFloat(number), - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - - // 7.8.4 String Literals - - function scanStringLiteral() { - var str = '', quote, start, ch, code, unescaped, restore, octal = false; - - quote = source[index]; - assert((quote === '\'' || quote === '"'), - 'String literal must starts with a quote'); - - start = index; - ++index; - - while (index < length) { - ch = source[index++]; - - if (ch === quote) { - quote = ''; - break; - } else if (ch === '\\') { - ch = source[index++]; - if (!isLineTerminator(ch)) { - switch (ch) { - case 'n': - str += '\n'; - break; - case 'r': - str += '\r'; - break; - case 't': - str += '\t'; - break; - case 'u': - case 'x': - restore = index; - unescaped = scanHexEscape(ch); - if (unescaped) { - str += unescaped; - } else { - index = restore; - str += ch; - } - break; - case 'b': - str += '\b'; - break; - case 'f': - str += '\f'; - break; - case 'v': - str += '\x0B'; - break; - - default: - if (isOctalDigit(ch)) { - code = '01234567'.indexOf(ch); - - // \0 is not octal escape sequence - if (code !== 0) { - octal = true; - } - - if (index < length && isOctalDigit(source[index])) { - octal = true; - code = code * 8 + '01234567'.indexOf(source[index++]); - - // 3 digits are only allowed when string starts - // with 0, 1, 2, 3 - if ('0123'.indexOf(ch) >= 0 && - index < length && - isOctalDigit(source[index])) { - code = code * 8 + '01234567'.indexOf(source[index++]); - } - } - str += String.fromCharCode(code); - } else { - str += ch; - } - break; - } - } else { - ++lineNumber; - if (ch === '\r' && source[index] === '\n') { - ++index; - } - } - } else if (isLineTerminator(ch)) { - break; - } else { - str += ch; - } - } - - if (quote !== '') { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - - return { - type: Token.StringLiteral, - value: str, - octal: octal, - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - - function scanRegExp() { - var str, ch, start, pattern, flags, value, classMarker = false, restore, terminated = false; - - buffer = null; - skipComment(); - - start = index; - ch = source[index]; - assert(ch === '/', 'Regular expression literal must start with a slash'); - str = source[index++]; - - while (index < length) { - ch = source[index++]; - str += ch; - if (classMarker) { - if (ch === ']') { - classMarker = false; - } - } else { - if (ch === '\\') { - ch = source[index++]; - // ECMA-262 7.8.5 - if (isLineTerminator(ch)) { - throwError({}, Messages.UnterminatedRegExp); - } - str += ch; - } else if (ch === '/') { - terminated = true; - break; - } else if (ch === '[') { - classMarker = true; - } else if (isLineTerminator(ch)) { - throwError({}, Messages.UnterminatedRegExp); - } - } - } - - if (!terminated) { - throwError({}, Messages.UnterminatedRegExp); - } - - // Exclude leading and trailing slash. - pattern = str.substr(1, str.length - 2); - - flags = ''; - while (index < length) { - ch = source[index]; - if (!isIdentifierPart(ch)) { - break; - } - - ++index; - if (ch === '\\' && index < length) { - ch = source[index]; - if (ch === 'u') { - ++index; - restore = index; - ch = scanHexEscape('u'); - if (ch) { - flags += ch; - str += '\\u'; - for (; restore < index; ++restore) { - str += source[restore]; - } - } else { - index = restore; - flags += 'u'; - str += '\\u'; - } - } else { - str += '\\'; - } - } else { - flags += ch; - str += ch; - } - } - - try { - value = new RegExp(pattern, flags); - } catch (e) { - throwError({}, Messages.InvalidRegExp); - } - - return { - literal: str, - value: value, - range: [start, index] - }; - } - - function isIdentifierName(token) { - return token.type === Token.Identifier || - token.type === Token.Keyword || - token.type === Token.BooleanLiteral || - token.type === Token.NullLiteral; - } - - function advance() { - var ch, token; - - skipComment(); - - if (index >= length) { - return { - type: Token.EOF, - lineNumber: lineNumber, - lineStart: lineStart, - range: [index, index] - }; - } - - token = scanPunctuator(); - if (typeof token !== 'undefined') { - return token; - } - - ch = source[index]; - - if (ch === '\'' || ch === '"') { - return scanStringLiteral(); - } - - if (ch === '.' || isDecimalDigit(ch)) { - return scanNumericLiteral(); - } - - token = scanIdentifier(); - if (typeof token !== 'undefined') { - return token; - } - - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - - function lex() { - var token; - - if (buffer) { - index = buffer.range[1]; - lineNumber = buffer.lineNumber; - lineStart = buffer.lineStart; - token = buffer; - buffer = null; - return token; - } - - buffer = null; - return advance(); - } - - function lookahead() { - var pos, line, start; - - if (buffer !== null) { - return buffer; - } - - pos = index; - line = lineNumber; - start = lineStart; - buffer = advance(); - index = pos; - lineNumber = line; - lineStart = start; - - return buffer; - } - - // Return true if there is a line terminator before the next token. - - function peekLineTerminator() { - var pos, line, start, found; - - pos = index; - line = lineNumber; - start = lineStart; - skipComment(); - found = lineNumber !== line; - index = pos; - lineNumber = line; - lineStart = start; - - return found; - } - - // Throw an exception - - function throwError(token, messageFormat) { - var error, - args = Array.prototype.slice.call(arguments, 2), - msg = messageFormat.replace( - /%(\d)/g, - function (whole, index) { - return args[index] || ''; - } - ); - - if (typeof token.lineNumber === 'number') { - error = new Error('Line ' + token.lineNumber + ': ' + msg); - error.index = token.range[0]; - error.lineNumber = token.lineNumber; - error.column = token.range[0] - lineStart + 1; - } else { - error = new Error('Line ' + lineNumber + ': ' + msg); - error.index = index; - error.lineNumber = lineNumber; - error.column = index - lineStart + 1; - } - - throw error; - } - - function throwErrorTolerant() { - try { - throwError.apply(null, arguments); - } catch (e) { - if (extra.errors) { - extra.errors.push(e); - } else { - throw e; - } - } - } - - - // Throw an exception because of the token. - - function throwUnexpected(token) { - if (token.type === Token.EOF) { - throwError(token, Messages.UnexpectedEOS); - } - - if (token.type === Token.NumericLiteral) { - throwError(token, Messages.UnexpectedNumber); - } - - if (token.type === Token.StringLiteral) { - throwError(token, Messages.UnexpectedString); - } - - if (token.type === Token.Identifier) { - throwError(token, Messages.UnexpectedIdentifier); - } - - if (token.type === Token.Keyword) { - if (isFutureReservedWord(token.value)) { - throwError(token, Messages.UnexpectedReserved); - } else if (strict && isStrictModeReservedWord(token.value)) { - throwErrorTolerant(token, Messages.StrictReservedWord); - return; - } - throwError(token, Messages.UnexpectedToken, token.value); - } - - // BooleanLiteral, NullLiteral, or Punctuator. - throwError(token, Messages.UnexpectedToken, token.value); - } - - // Expect the next token to match the specified punctuator. - // If not, an exception will be thrown. - - function expect(value) { - var token = lex(); - if (token.type !== Token.Punctuator || token.value !== value) { - throwUnexpected(token); - } - } - - // Expect the next token to match the specified keyword. - // If not, an exception will be thrown. - - function expectKeyword(keyword) { - var token = lex(); - if (token.type !== Token.Keyword || token.value !== keyword) { - throwUnexpected(token); - } - } - - // Return true if the next token matches the specified punctuator. - - function match(value) { - var token = lookahead(); - return token.type === Token.Punctuator && token.value === value; - } - - // Return true if the next token matches the specified keyword - - function matchKeyword(keyword) { - var token = lookahead(); - return token.type === Token.Keyword && token.value === keyword; - } - - // Return true if the next token is an assignment operator - - function matchAssign() { - var token = lookahead(), - op = token.value; - - if (token.type !== Token.Punctuator) { - return false; - } - return op === '=' || - op === '*=' || - op === '/=' || - op === '%=' || - op === '+=' || - op === '-=' || - op === '<<=' || - op === '>>=' || - op === '>>>=' || - op === '&=' || - op === '^=' || - op === '|='; - } - - function consumeSemicolon() { - var token, line; - - // Catch the very common case first. - if (source[index] === ';') { - lex(); - return; - } - - line = lineNumber; - skipComment(); - if (lineNumber !== line) { - return; - } - - if (match(';')) { - lex(); - return; - } - - token = lookahead(); - if (token.type !== Token.EOF && !match('}')) { - throwUnexpected(token); - } - } - - // Return true if provided expression is LeftHandSideExpression - - function isLeftHandSide(expr) { - return expr.type === Syntax.Identifier || expr.type === Syntax.MemberExpression; - } - - // 11.1.4 Array Initialiser - - function parseArrayInitialiser() { - var elements = []; - - expect('['); - - while (!match(']')) { - if (match(',')) { - lex(); - elements.push(null); - } else { - elements.push(parseAssignmentExpression()); - - if (!match(']')) { - expect(','); - } - } - } - - expect(']'); - - return { - type: Syntax.ArrayExpression, - elements: elements - }; - } - - // 11.1.5 Object Initialiser - - function parsePropertyFunction(param, first) { - var previousStrict, body; - - previousStrict = strict; - body = parseFunctionSourceElements(); - if (first && strict && isRestrictedWord(param[0].name)) { - throwErrorTolerant(first, Messages.StrictParamName); - } - strict = previousStrict; - - return { - type: Syntax.FunctionExpression, - id: null, - params: param, - defaults: [], - body: body, - rest: null, - generator: false, - expression: false - }; - } - - function parseObjectPropertyKey() { - var token = lex(); - - // Note: This function is called only from parseObjectProperty(), where - // EOF and Punctuator tokens are already filtered out. - - if (token.type === Token.StringLiteral || token.type === Token.NumericLiteral) { - if (strict && token.octal) { - throwErrorTolerant(token, Messages.StrictOctalLiteral); - } - return createLiteral(token); - } - - return { - type: Syntax.Identifier, - name: token.value - }; - } - - function parseObjectProperty() { - var token, key, id, param; - - token = lookahead(); - - if (token.type === Token.Identifier) { - - id = parseObjectPropertyKey(); - - // Property Assignment: Getter and Setter. - - if (token.value === 'get' && !match(':')) { - key = parseObjectPropertyKey(); - expect('('); - expect(')'); - return { - type: Syntax.Property, - key: key, - value: parsePropertyFunction([]), - kind: 'get' - }; - } else if (token.value === 'set' && !match(':')) { - key = parseObjectPropertyKey(); - expect('('); - token = lookahead(); - if (token.type !== Token.Identifier) { - expect(')'); - throwErrorTolerant(token, Messages.UnexpectedToken, token.value); - return { - type: Syntax.Property, - key: key, - value: parsePropertyFunction([]), - kind: 'set' - }; - } else { - param = [ parseVariableIdentifier() ]; - expect(')'); - return { - type: Syntax.Property, - key: key, - value: parsePropertyFunction(param, token), - kind: 'set' - }; - } - } else { - expect(':'); - return { - type: Syntax.Property, - key: id, - value: parseAssignmentExpression(), - kind: 'init' - }; - } - } else if (token.type === Token.EOF || token.type === Token.Punctuator) { - throwUnexpected(token); - } else { - key = parseObjectPropertyKey(); - expect(':'); - return { - type: Syntax.Property, - key: key, - value: parseAssignmentExpression(), - kind: 'init' - }; - } - } - - function parseObjectInitialiser() { - var properties = [], property, name, kind, map = {}, toString = String; - - expect('{'); - - while (!match('}')) { - property = parseObjectProperty(); - - if (property.key.type === Syntax.Identifier) { - name = property.key.name; - } else { - name = toString(property.key.value); - } - kind = (property.kind === 'init') ? PropertyKind.Data : (property.kind === 'get') ? PropertyKind.Get : PropertyKind.Set; - if (Object.prototype.hasOwnProperty.call(map, name)) { - if (map[name] === PropertyKind.Data) { - if (strict && kind === PropertyKind.Data) { - throwErrorTolerant({}, Messages.StrictDuplicateProperty); - } else if (kind !== PropertyKind.Data) { - throwErrorTolerant({}, Messages.AccessorDataProperty); - } - } else { - if (kind === PropertyKind.Data) { - throwErrorTolerant({}, Messages.AccessorDataProperty); - } else if (map[name] & kind) { - throwErrorTolerant({}, Messages.AccessorGetSet); - } - } - map[name] |= kind; - } else { - map[name] = kind; - } - - properties.push(property); - - if (!match('}')) { - expect(','); - } - } - - expect('}'); - - return { - type: Syntax.ObjectExpression, - properties: properties - }; - } - - // 11.1.6 The Grouping Operator - - function parseGroupExpression() { - var expr; - - expect('('); - - expr = parseExpression(); - - expect(')'); - - return expr; - } - - - // 11.1 Primary Expressions - - function parsePrimaryExpression() { - var token = lookahead(), - type = token.type; - - if (type === Token.Identifier) { - return { - type: Syntax.Identifier, - name: lex().value - }; - } - - if (type === Token.StringLiteral || type === Token.NumericLiteral) { - if (strict && token.octal) { - throwErrorTolerant(token, Messages.StrictOctalLiteral); - } - return createLiteral(lex()); - } - - if (type === Token.Keyword) { - if (matchKeyword('this')) { - lex(); - return { - type: Syntax.ThisExpression - }; - } - - if (matchKeyword('function')) { - return parseFunctionExpression(); - } - } - - if (type === Token.BooleanLiteral) { - lex(); - token.value = (token.value === 'true'); - return createLiteral(token); - } - - if (type === Token.NullLiteral) { - lex(); - token.value = null; - return createLiteral(token); - } - - if (match('[')) { - return parseArrayInitialiser(); - } - - if (match('{')) { - return parseObjectInitialiser(); - } - - if (match('(')) { - return parseGroupExpression(); - } - - if (match('/') || match('/=')) { - return createLiteral(scanRegExp()); - } - - return throwUnexpected(lex()); - } - - // 11.2 Left-Hand-Side Expressions - - function parseArguments() { - var args = []; - - expect('('); - - if (!match(')')) { - while (index < length) { - args.push(parseAssignmentExpression()); - if (match(')')) { - break; - } - expect(','); - } - } - - expect(')'); - - return args; - } - - function parseNonComputedProperty() { - var token = lex(); - - if (!isIdentifierName(token)) { - throwUnexpected(token); - } - - return { - type: Syntax.Identifier, - name: token.value - }; - } - - function parseNonComputedMember() { - expect('.'); - - return parseNonComputedProperty(); - } - - function parseComputedMember() { - var expr; - - expect('['); - - expr = parseExpression(); - - expect(']'); - - return expr; - } - - function parseNewExpression() { - var expr; - - expectKeyword('new'); - - expr = { - type: Syntax.NewExpression, - callee: parseLeftHandSideExpression(), - 'arguments': [] - }; - - if (match('(')) { - expr['arguments'] = parseArguments(); - } - - return expr; - } - - function parseLeftHandSideExpressionAllowCall() { - var expr; - - expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression(); - - while (match('.') || match('[') || match('(')) { - if (match('(')) { - expr = { - type: Syntax.CallExpression, - callee: expr, - 'arguments': parseArguments() - }; - } else if (match('[')) { - expr = { - type: Syntax.MemberExpression, - computed: true, - object: expr, - property: parseComputedMember() - }; - } else { - expr = { - type: Syntax.MemberExpression, - computed: false, - object: expr, - property: parseNonComputedMember() - }; - } - } - - return expr; - } - - - function parseLeftHandSideExpression() { - var expr; - - expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression(); - - while (match('.') || match('[')) { - if (match('[')) { - expr = { - type: Syntax.MemberExpression, - computed: true, - object: expr, - property: parseComputedMember() - }; - } else { - expr = { - type: Syntax.MemberExpression, - computed: false, - object: expr, - property: parseNonComputedMember() - }; - } - } - - return expr; - } - - // 11.3 Postfix Expressions - - function parsePostfixExpression() { - var expr = parseLeftHandSideExpressionAllowCall(), token; - - token = lookahead(); - if (token.type !== Token.Punctuator) { - return expr; - } - - if ((match('++') || match('--')) && !peekLineTerminator()) { - // 11.3.1, 11.3.2 - if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) { - throwErrorTolerant({}, Messages.StrictLHSPostfix); - } - - if (!isLeftHandSide(expr)) { - throwError({}, Messages.InvalidLHSInAssignment); - } - - expr = { - type: Syntax.UpdateExpression, - operator: lex().value, - argument: expr, - prefix: false - }; - } - - return expr; - } - - // 11.4 Unary Operators - - function parseUnaryExpression() { - var token, expr; - - token = lookahead(); - if (token.type !== Token.Punctuator && token.type !== Token.Keyword) { - return parsePostfixExpression(); - } - - if (match('++') || match('--')) { - token = lex(); - expr = parseUnaryExpression(); - // 11.4.4, 11.4.5 - if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) { - throwErrorTolerant({}, Messages.StrictLHSPrefix); - } - - if (!isLeftHandSide(expr)) { - throwError({}, Messages.InvalidLHSInAssignment); - } - - expr = { - type: Syntax.UpdateExpression, - operator: token.value, - argument: expr, - prefix: true - }; - return expr; - } - - if (match('+') || match('-') || match('~') || match('!')) { - expr = { - type: Syntax.UnaryExpression, - operator: lex().value, - argument: parseUnaryExpression(), - prefix: true - }; - return expr; - } - - if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) { - expr = { - type: Syntax.UnaryExpression, - operator: lex().value, - argument: parseUnaryExpression(), - prefix: true - }; - if (strict && expr.operator === 'delete' && expr.argument.type === Syntax.Identifier) { - throwErrorTolerant({}, Messages.StrictDelete); - } - return expr; - } - - return parsePostfixExpression(); - } - - // 11.5 Multiplicative Operators - - function parseMultiplicativeExpression() { - var expr = parseUnaryExpression(); - - while (match('*') || match('/') || match('%')) { - expr = { - type: Syntax.BinaryExpression, - operator: lex().value, - left: expr, - right: parseUnaryExpression() - }; - } - - return expr; - } - - // 11.6 Additive Operators - - function parseAdditiveExpression() { - var expr = parseMultiplicativeExpression(); - - while (match('+') || match('-')) { - expr = { - type: Syntax.BinaryExpression, - operator: lex().value, - left: expr, - right: parseMultiplicativeExpression() - }; - } - - return expr; - } - - // 11.7 Bitwise Shift Operators - - function parseShiftExpression() { - var expr = parseAdditiveExpression(); - - while (match('<<') || match('>>') || match('>>>')) { - expr = { - type: Syntax.BinaryExpression, - operator: lex().value, - left: expr, - right: parseAdditiveExpression() - }; - } - - return expr; - } - // 11.8 Relational Operators - - function parseRelationalExpression() { - var expr, previousAllowIn; - - previousAllowIn = state.allowIn; - state.allowIn = true; - - expr = parseShiftExpression(); - - while (match('<') || match('>') || match('<=') || match('>=') || (previousAllowIn && matchKeyword('in')) || matchKeyword('instanceof')) { - expr = { - type: Syntax.BinaryExpression, - operator: lex().value, - left: expr, - right: parseShiftExpression() - }; - } - - state.allowIn = previousAllowIn; - return expr; - } - - // 11.9 Equality Operators - - function parseEqualityExpression() { - var expr = parseRelationalExpression(); - - while (match('==') || match('!=') || match('===') || match('!==')) { - expr = { - type: Syntax.BinaryExpression, - operator: lex().value, - left: expr, - right: parseRelationalExpression() - }; - } - - return expr; - } - - // 11.10 Binary Bitwise Operators - - function parseBitwiseANDExpression() { - var expr = parseEqualityExpression(); - - while (match('&')) { - lex(); - expr = { - type: Syntax.BinaryExpression, - operator: '&', - left: expr, - right: parseEqualityExpression() - }; - } - - return expr; - } - - function parseBitwiseXORExpression() { - var expr = parseBitwiseANDExpression(); - - while (match('^')) { - lex(); - expr = { - type: Syntax.BinaryExpression, - operator: '^', - left: expr, - right: parseBitwiseANDExpression() - }; - } - - return expr; - } - - function parseBitwiseORExpression() { - var expr = parseBitwiseXORExpression(); - - while (match('|')) { - lex(); - expr = { - type: Syntax.BinaryExpression, - operator: '|', - left: expr, - right: parseBitwiseXORExpression() - }; - } - - return expr; - } - - // 11.11 Binary Logical Operators - - function parseLogicalANDExpression() { - var expr = parseBitwiseORExpression(); - - while (match('&&')) { - lex(); - expr = { - type: Syntax.LogicalExpression, - operator: '&&', - left: expr, - right: parseBitwiseORExpression() - }; - } - - return expr; - } - - function parseLogicalORExpression() { - var expr = parseLogicalANDExpression(); - - while (match('||')) { - lex(); - expr = { - type: Syntax.LogicalExpression, - operator: '||', - left: expr, - right: parseLogicalANDExpression() - }; - } - - return expr; - } - - // 11.12 Conditional Operator - - function parseConditionalExpression() { - var expr, previousAllowIn, consequent; - - expr = parseLogicalORExpression(); - - if (match('?')) { - lex(); - previousAllowIn = state.allowIn; - state.allowIn = true; - consequent = parseAssignmentExpression(); - state.allowIn = previousAllowIn; - expect(':'); - - expr = { - type: Syntax.ConditionalExpression, - test: expr, - consequent: consequent, - alternate: parseAssignmentExpression() - }; - } - - return expr; - } - - // 11.13 Assignment Operators - - function parseAssignmentExpression() { - var token, expr; - - token = lookahead(); - expr = parseConditionalExpression(); - - if (matchAssign()) { - // LeftHandSideExpression - if (!isLeftHandSide(expr)) { - throwError({}, Messages.InvalidLHSInAssignment); - } - - // 11.13.1 - if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) { - throwErrorTolerant(token, Messages.StrictLHSAssignment); - } - - expr = { - type: Syntax.AssignmentExpression, - operator: lex().value, - left: expr, - right: parseAssignmentExpression() - }; - } - - return expr; - } - - // 11.14 Comma Operator - - function parseExpression() { - var expr = parseAssignmentExpression(); - - if (match(',')) { - expr = { - type: Syntax.SequenceExpression, - expressions: [ expr ] - }; - - while (index < length) { - if (!match(',')) { - break; - } - lex(); - expr.expressions.push(parseAssignmentExpression()); - } - - } - return expr; - } - - // 12.1 Block - - function parseStatementList() { - var list = [], - statement; - - while (index < length) { - if (match('}')) { - break; - } - statement = parseSourceElement(); - if (typeof statement === 'undefined') { - break; - } - list.push(statement); - } - - return list; - } - - function parseBlock() { - var block; - - expect('{'); - - block = parseStatementList(); - - expect('}'); - - return { - type: Syntax.BlockStatement, - body: block - }; - } - - // 12.2 Variable Statement - - function parseVariableIdentifier() { - var token = lex(); - - if (token.type !== Token.Identifier) { - throwUnexpected(token); - } - - return { - type: Syntax.Identifier, - name: token.value - }; - } - - function parseVariableDeclaration(kind) { - var id = parseVariableIdentifier(), - init = null; - - // 12.2.1 - if (strict && isRestrictedWord(id.name)) { - throwErrorTolerant({}, Messages.StrictVarName); - } - - if (kind === 'const') { - expect('='); - init = parseAssignmentExpression(); - } else if (match('=')) { - lex(); - init = parseAssignmentExpression(); - } - - return { - type: Syntax.VariableDeclarator, - id: id, - init: init - }; - } - - function parseVariableDeclarationList(kind) { - var list = []; - - do { - list.push(parseVariableDeclaration(kind)); - if (!match(',')) { - break; - } - lex(); - } while (index < length); - - return list; - } - - function parseVariableStatement() { - var declarations; - - expectKeyword('var'); - - declarations = parseVariableDeclarationList(); - - consumeSemicolon(); - - return { - type: Syntax.VariableDeclaration, - declarations: declarations, - kind: 'var' - }; - } - - // kind may be `const` or `let` - // Both are experimental and not in the specification yet. - // see http://wiki.ecmascript.org/doku.php?id=harmony:const - // and http://wiki.ecmascript.org/doku.php?id=harmony:let - function parseConstLetDeclaration(kind) { - var declarations; - - expectKeyword(kind); - - declarations = parseVariableDeclarationList(kind); - - consumeSemicolon(); - - return { - type: Syntax.VariableDeclaration, - declarations: declarations, - kind: kind - }; - } - - // 12.3 Empty Statement - - function parseEmptyStatement() { - expect(';'); - - return { - type: Syntax.EmptyStatement - }; - } - - // 12.4 Expression Statement - - function parseExpressionStatement() { - var expr = parseExpression(); - - consumeSemicolon(); - - return { - type: Syntax.ExpressionStatement, - expression: expr - }; - } - - // 12.5 If statement - - function parseIfStatement() { - var test, consequent, alternate; - - expectKeyword('if'); - - expect('('); - - test = parseExpression(); - - expect(')'); - - consequent = parseStatement(); - - if (matchKeyword('else')) { - lex(); - alternate = parseStatement(); - } else { - alternate = null; - } - - return { - type: Syntax.IfStatement, - test: test, - consequent: consequent, - alternate: alternate - }; - } - - // 12.6 Iteration Statements - - function parseDoWhileStatement() { - var body, test, oldInIteration; - - expectKeyword('do'); - - oldInIteration = state.inIteration; - state.inIteration = true; - - body = parseStatement(); - - state.inIteration = oldInIteration; - - expectKeyword('while'); - - expect('('); - - test = parseExpression(); - - expect(')'); - - if (match(';')) { - lex(); - } - - return { - type: Syntax.DoWhileStatement, - body: body, - test: test - }; - } - - function parseWhileStatement() { - var test, body, oldInIteration; - - expectKeyword('while'); - - expect('('); - - test = parseExpression(); - - expect(')'); - - oldInIteration = state.inIteration; - state.inIteration = true; - - body = parseStatement(); - - state.inIteration = oldInIteration; - - return { - type: Syntax.WhileStatement, - test: test, - body: body - }; - } - - function parseForVariableDeclaration() { - var token = lex(); - - return { - type: Syntax.VariableDeclaration, - declarations: parseVariableDeclarationList(), - kind: token.value - }; - } - - function parseForStatement() { - var init, test, update, left, right, body, oldInIteration; - - init = test = update = null; - - expectKeyword('for'); - - expect('('); - - if (match(';')) { - lex(); - } else { - if (matchKeyword('var') || matchKeyword('let')) { - state.allowIn = false; - init = parseForVariableDeclaration(); - state.allowIn = true; - - if (init.declarations.length === 1 && matchKeyword('in')) { - lex(); - left = init; - right = parseExpression(); - init = null; - } - } else { - state.allowIn = false; - init = parseExpression(); - state.allowIn = true; - - if (matchKeyword('in')) { - // LeftHandSideExpression - if (!isLeftHandSide(init)) { - throwError({}, Messages.InvalidLHSInForIn); - } - - lex(); - left = init; - right = parseExpression(); - init = null; - } - } - - if (typeof left === 'undefined') { - expect(';'); - } - } - - if (typeof left === 'undefined') { - - if (!match(';')) { - test = parseExpression(); - } - expect(';'); - - if (!match(')')) { - update = parseExpression(); - } - } - - expect(')'); - - oldInIteration = state.inIteration; - state.inIteration = true; - - body = parseStatement(); - - state.inIteration = oldInIteration; - - if (typeof left === 'undefined') { - return { - type: Syntax.ForStatement, - init: init, - test: test, - update: update, - body: body - }; - } - - return { - type: Syntax.ForInStatement, - left: left, - right: right, - body: body, - each: false - }; - } - - // 12.7 The continue statement - - function parseContinueStatement() { - var token, label = null; - - expectKeyword('continue'); - - // Optimize the most common form: 'continue;'. - if (source[index] === ';') { - lex(); - - if (!state.inIteration) { - throwError({}, Messages.IllegalContinue); - } - - return { - type: Syntax.ContinueStatement, - label: null - }; - } - - if (peekLineTerminator()) { - if (!state.inIteration) { - throwError({}, Messages.IllegalContinue); - } - - return { - type: Syntax.ContinueStatement, - label: null - }; - } - - token = lookahead(); - if (token.type === Token.Identifier) { - label = parseVariableIdentifier(); - - if (!Object.prototype.hasOwnProperty.call(state.labelSet, label.name)) { - throwError({}, Messages.UnknownLabel, label.name); - } - } - - consumeSemicolon(); - - if (label === null && !state.inIteration) { - throwError({}, Messages.IllegalContinue); - } - - return { - type: Syntax.ContinueStatement, - label: label - }; - } - - // 12.8 The break statement - - function parseBreakStatement() { - var token, label = null; - - expectKeyword('break'); - - // Optimize the most common form: 'break;'. - if (source[index] === ';') { - lex(); - - if (!(state.inIteration || state.inSwitch)) { - throwError({}, Messages.IllegalBreak); - } - - return { - type: Syntax.BreakStatement, - label: null - }; - } - - if (peekLineTerminator()) { - if (!(state.inIteration || state.inSwitch)) { - throwError({}, Messages.IllegalBreak); - } - - return { - type: Syntax.BreakStatement, - label: null - }; - } - - token = lookahead(); - if (token.type === Token.Identifier) { - label = parseVariableIdentifier(); - - if (!Object.prototype.hasOwnProperty.call(state.labelSet, label.name)) { - throwError({}, Messages.UnknownLabel, label.name); - } - } - - consumeSemicolon(); - - if (label === null && !(state.inIteration || state.inSwitch)) { - throwError({}, Messages.IllegalBreak); - } - - return { - type: Syntax.BreakStatement, - label: label - }; - } - - // 12.9 The return statement - - function parseReturnStatement() { - var token, argument = null; - - expectKeyword('return'); - - if (!state.inFunctionBody) { - throwErrorTolerant({}, Messages.IllegalReturn); - } - - // 'return' followed by a space and an identifier is very common. - if (source[index] === ' ') { - if (isIdentifierStart(source[index + 1])) { - argument = parseExpression(); - consumeSemicolon(); - return { - type: Syntax.ReturnStatement, - argument: argument - }; - } - } - - if (peekLineTerminator()) { - return { - type: Syntax.ReturnStatement, - argument: null - }; - } - - if (!match(';')) { - token = lookahead(); - if (!match('}') && token.type !== Token.EOF) { - argument = parseExpression(); - } - } - - consumeSemicolon(); - - return { - type: Syntax.ReturnStatement, - argument: argument - }; - } - - // 12.10 The with statement - - function parseWithStatement() { - var object, body; - - if (strict) { - throwErrorTolerant({}, Messages.StrictModeWith); - } - - expectKeyword('with'); - - expect('('); - - object = parseExpression(); - - expect(')'); - - body = parseStatement(); - - return { - type: Syntax.WithStatement, - object: object, - body: body - }; - } - - // 12.10 The swith statement - - function parseSwitchCase() { - var test, - consequent = [], - statement; - - if (matchKeyword('default')) { - lex(); - test = null; - } else { - expectKeyword('case'); - test = parseExpression(); - } - expect(':'); - - while (index < length) { - if (match('}') || matchKeyword('default') || matchKeyword('case')) { - break; - } - statement = parseStatement(); - if (typeof statement === 'undefined') { - break; - } - consequent.push(statement); - } - - return { - type: Syntax.SwitchCase, - test: test, - consequent: consequent - }; - } - - function parseSwitchStatement() { - var discriminant, cases, clause, oldInSwitch, defaultFound; - - expectKeyword('switch'); - - expect('('); - - discriminant = parseExpression(); - - expect(')'); - - expect('{'); - - if (match('}')) { - lex(); - return { - type: Syntax.SwitchStatement, - discriminant: discriminant - }; - } - - cases = []; - - oldInSwitch = state.inSwitch; - state.inSwitch = true; - defaultFound = false; - - while (index < length) { - if (match('}')) { - break; - } - clause = parseSwitchCase(); - if (clause.test === null) { - if (defaultFound) { - throwError({}, Messages.MultipleDefaultsInSwitch); - } - defaultFound = true; - } - cases.push(clause); - } - - state.inSwitch = oldInSwitch; - - expect('}'); - - return { - type: Syntax.SwitchStatement, - discriminant: discriminant, - cases: cases - }; - } - - // 12.13 The throw statement - - function parseThrowStatement() { - var argument; - - expectKeyword('throw'); - - if (peekLineTerminator()) { - throwError({}, Messages.NewlineAfterThrow); - } - - argument = parseExpression(); - - consumeSemicolon(); - - return { - type: Syntax.ThrowStatement, - argument: argument - }; - } - - // 12.14 The try statement - - function parseCatchClause() { - var param; - - expectKeyword('catch'); - - expect('('); - if (match(')')) { - throwUnexpected(lookahead()); - } - - param = parseVariableIdentifier(); - // 12.14.1 - if (strict && isRestrictedWord(param.name)) { - throwErrorTolerant({}, Messages.StrictCatchVariable); - } - - expect(')'); - - return { - type: Syntax.CatchClause, - param: param, - body: parseBlock() - }; - } - - function parseTryStatement() { - var block, handlers = [], finalizer = null; - - expectKeyword('try'); - - block = parseBlock(); - - if (matchKeyword('catch')) { - handlers.push(parseCatchClause()); - } - - if (matchKeyword('finally')) { - lex(); - finalizer = parseBlock(); - } - - if (handlers.length === 0 && !finalizer) { - throwError({}, Messages.NoCatchOrFinally); - } - - return { - type: Syntax.TryStatement, - block: block, - guardedHandlers: [], - handlers: handlers, - finalizer: finalizer - }; - } - - // 12.15 The debugger statement - - function parseDebuggerStatement() { - expectKeyword('debugger'); - - consumeSemicolon(); - - return { - type: Syntax.DebuggerStatement - }; - } - - // 12 Statements - - function parseStatement() { - var token = lookahead(), - expr, - labeledBody; - - if (token.type === Token.EOF) { - throwUnexpected(token); - } - - if (token.type === Token.Punctuator) { - switch (token.value) { - case ';': - return parseEmptyStatement(); - case '{': - return parseBlock(); - case '(': - return parseExpressionStatement(); - default: - break; - } - } - - if (token.type === Token.Keyword) { - switch (token.value) { - case 'break': - return parseBreakStatement(); - case 'continue': - return parseContinueStatement(); - case 'debugger': - return parseDebuggerStatement(); - case 'do': - return parseDoWhileStatement(); - case 'for': - return parseForStatement(); - case 'function': - return parseFunctionDeclaration(); - case 'if': - return parseIfStatement(); - case 'return': - return parseReturnStatement(); - case 'switch': - return parseSwitchStatement(); - case 'throw': - return parseThrowStatement(); - case 'try': - return parseTryStatement(); - case 'var': - return parseVariableStatement(); - case 'while': - return parseWhileStatement(); - case 'with': - return parseWithStatement(); - default: - break; - } - } - - expr = parseExpression(); - - // 12.12 Labelled Statements - if ((expr.type === Syntax.Identifier) && match(':')) { - lex(); - - if (Object.prototype.hasOwnProperty.call(state.labelSet, expr.name)) { - throwError({}, Messages.Redeclaration, 'Label', expr.name); - } - - state.labelSet[expr.name] = true; - labeledBody = parseStatement(); - delete state.labelSet[expr.name]; - - return { - type: Syntax.LabeledStatement, - label: expr, - body: labeledBody - }; - } - - consumeSemicolon(); - - return { - type: Syntax.ExpressionStatement, - expression: expr - }; - } - - // 13 Function Definition - - function parseFunctionSourceElements() { - var sourceElement, sourceElements = [], token, directive, firstRestricted, - oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody; - - expect('{'); - - while (index < length) { - token = lookahead(); - if (token.type !== Token.StringLiteral) { - break; - } - - sourceElement = parseSourceElement(); - sourceElements.push(sourceElement); - if (sourceElement.expression.type !== Syntax.Literal) { - // this is not directive - break; - } - directive = sliceSource(token.range[0] + 1, token.range[1] - 1); - if (directive === 'use strict') { - strict = true; - if (firstRestricted) { - throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral); - } - } else { - if (!firstRestricted && token.octal) { - firstRestricted = token; - } - } - } - - oldLabelSet = state.labelSet; - oldInIteration = state.inIteration; - oldInSwitch = state.inSwitch; - oldInFunctionBody = state.inFunctionBody; - - state.labelSet = {}; - state.inIteration = false; - state.inSwitch = false; - state.inFunctionBody = true; - - while (index < length) { - if (match('}')) { - break; - } - sourceElement = parseSourceElement(); - if (typeof sourceElement === 'undefined') { - break; - } - sourceElements.push(sourceElement); - } - - expect('}'); - - state.labelSet = oldLabelSet; - state.inIteration = oldInIteration; - state.inSwitch = oldInSwitch; - state.inFunctionBody = oldInFunctionBody; - - return { - type: Syntax.BlockStatement, - body: sourceElements - }; - } - - function parseFunctionDeclaration() { - var id, param, params = [], body, token, stricted, firstRestricted, message, previousStrict, paramSet; - - expectKeyword('function'); - token = lookahead(); - id = parseVariableIdentifier(); - if (strict) { - if (isRestrictedWord(token.value)) { - throwErrorTolerant(token, Messages.StrictFunctionName); - } - } else { - if (isRestrictedWord(token.value)) { - firstRestricted = token; - message = Messages.StrictFunctionName; - } else if (isStrictModeReservedWord(token.value)) { - firstRestricted = token; - message = Messages.StrictReservedWord; - } - } - - expect('('); - - if (!match(')')) { - paramSet = {}; - while (index < length) { - token = lookahead(); - param = parseVariableIdentifier(); - if (strict) { - if (isRestrictedWord(token.value)) { - stricted = token; - message = Messages.StrictParamName; - } - if (Object.prototype.hasOwnProperty.call(paramSet, token.value)) { - stricted = token; - message = Messages.StrictParamDupe; - } - } else if (!firstRestricted) { - if (isRestrictedWord(token.value)) { - firstRestricted = token; - message = Messages.StrictParamName; - } else if (isStrictModeReservedWord(token.value)) { - firstRestricted = token; - message = Messages.StrictReservedWord; - } else if (Object.prototype.hasOwnProperty.call(paramSet, token.value)) { - firstRestricted = token; - message = Messages.StrictParamDupe; - } - } - params.push(param); - paramSet[param.name] = true; - if (match(')')) { - break; - } - expect(','); - } - } - - expect(')'); - - previousStrict = strict; - body = parseFunctionSourceElements(); - if (strict && firstRestricted) { - throwError(firstRestricted, message); - } - if (strict && stricted) { - throwErrorTolerant(stricted, message); - } - strict = previousStrict; - - return { - type: Syntax.FunctionDeclaration, - id: id, - params: params, - defaults: [], - body: body, - rest: null, - generator: false, - expression: false - }; - } - - function parseFunctionExpression() { - var token, id = null, stricted, firstRestricted, message, param, params = [], body, previousStrict, paramSet; - - expectKeyword('function'); - - if (!match('(')) { - token = lookahead(); - id = parseVariableIdentifier(); - if (strict) { - if (isRestrictedWord(token.value)) { - throwErrorTolerant(token, Messages.StrictFunctionName); - } - } else { - if (isRestrictedWord(token.value)) { - firstRestricted = token; - message = Messages.StrictFunctionName; - } else if (isStrictModeReservedWord(token.value)) { - firstRestricted = token; - message = Messages.StrictReservedWord; - } - } - } - - expect('('); - - if (!match(')')) { - paramSet = {}; - while (index < length) { - token = lookahead(); - param = parseVariableIdentifier(); - if (strict) { - if (isRestrictedWord(token.value)) { - stricted = token; - message = Messages.StrictParamName; - } - if (Object.prototype.hasOwnProperty.call(paramSet, token.value)) { - stricted = token; - message = Messages.StrictParamDupe; - } - } else if (!firstRestricted) { - if (isRestrictedWord(token.value)) { - firstRestricted = token; - message = Messages.StrictParamName; - } else if (isStrictModeReservedWord(token.value)) { - firstRestricted = token; - message = Messages.StrictReservedWord; - } else if (Object.prototype.hasOwnProperty.call(paramSet, token.value)) { - firstRestricted = token; - message = Messages.StrictParamDupe; - } - } - params.push(param); - paramSet[param.name] = true; - if (match(')')) { - break; - } - expect(','); - } - } - - expect(')'); - - previousStrict = strict; - body = parseFunctionSourceElements(); - if (strict && firstRestricted) { - throwError(firstRestricted, message); - } - if (strict && stricted) { - throwErrorTolerant(stricted, message); - } - strict = previousStrict; - - return { - type: Syntax.FunctionExpression, - id: id, - params: params, - defaults: [], - body: body, - rest: null, - generator: false, - expression: false - }; - } - - // 14 Program - - function parseSourceElement() { - var token = lookahead(); - - if (token.type === Token.Keyword) { - switch (token.value) { - case 'const': - case 'let': - return parseConstLetDeclaration(token.value); - case 'function': - return parseFunctionDeclaration(); - default: - return parseStatement(); - } - } - - if (token.type !== Token.EOF) { - return parseStatement(); - } - } - - function parseSourceElements() { - var sourceElement, sourceElements = [], token, directive, firstRestricted; - - while (index < length) { - token = lookahead(); - if (token.type !== Token.StringLiteral) { - break; - } - - sourceElement = parseSourceElement(); - sourceElements.push(sourceElement); - if (sourceElement.expression.type !== Syntax.Literal) { - // this is not directive - break; - } - directive = sliceSource(token.range[0] + 1, token.range[1] - 1); - if (directive === 'use strict') { - strict = true; - if (firstRestricted) { - throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral); - } - } else { - if (!firstRestricted && token.octal) { - firstRestricted = token; - } - } - } - - while (index < length) { - sourceElement = parseSourceElement(); - if (typeof sourceElement === 'undefined') { - break; - } - sourceElements.push(sourceElement); - } - return sourceElements; - } - - function parseProgram() { - var program; - strict = false; - program = { - type: Syntax.Program, - body: parseSourceElements() - }; - return program; - } - - // The following functions are needed only when the option to preserve - // the comments is active. - - function addComment(type, value, start, end, loc) { - assert(typeof start === 'number', 'Comment must have valid position'); - - // Because the way the actual token is scanned, often the comments - // (if any) are skipped twice during the lexical analysis. - // Thus, we need to skip adding a comment if the comment array already - // handled it. - if (extra.comments.length > 0) { - if (extra.comments[extra.comments.length - 1].range[1] > start) { - return; - } - } - - extra.comments.push({ - type: type, - value: value, - range: [start, end], - loc: loc - }); - } - - function scanComment() { - var comment, ch, loc, start, blockComment, lineComment; - - comment = ''; - blockComment = false; - lineComment = false; - - while (index < length) { - ch = source[index]; - - if (lineComment) { - ch = source[index++]; - if (isLineTerminator(ch)) { - loc.end = { - line: lineNumber, - column: index - lineStart - 1 - }; - lineComment = false; - addComment('Line', comment, start, index - 1, loc); - if (ch === '\r' && source[index] === '\n') { - ++index; - } - ++lineNumber; - lineStart = index; - comment = ''; - } else if (index >= length) { - lineComment = false; - comment += ch; - loc.end = { - line: lineNumber, - column: length - lineStart - }; - addComment('Line', comment, start, length, loc); - } else { - comment += ch; - } - } else if (blockComment) { - if (isLineTerminator(ch)) { - if (ch === '\r' && source[index + 1] === '\n') { - ++index; - comment += '\r\n'; - } else { - comment += ch; - } - ++lineNumber; - ++index; - lineStart = index; - if (index >= length) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - } else { - ch = source[index++]; - if (index >= length) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - comment += ch; - if (ch === '*') { - ch = source[index]; - if (ch === '/') { - comment = comment.substr(0, comment.length - 1); - blockComment = false; - ++index; - loc.end = { - line: lineNumber, - column: index - lineStart - }; - addComment('Block', comment, start, index, loc); - comment = ''; - } - } - } - } else if (ch === '/') { - ch = source[index + 1]; - if (ch === '/') { - loc = { - start: { - line: lineNumber, - column: index - lineStart - } - }; - start = index; - index += 2; - lineComment = true; - if (index >= length) { - loc.end = { - line: lineNumber, - column: index - lineStart - }; - lineComment = false; - addComment('Line', comment, start, index, loc); - } - } else if (ch === '*') { - start = index; - index += 2; - blockComment = true; - loc = { - start: { - line: lineNumber, - column: index - lineStart - 2 - } - }; - if (index >= length) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - } else { - break; - } - } else if (isWhiteSpace(ch)) { - ++index; - } else if (isLineTerminator(ch)) { - ++index; - if (ch === '\r' && source[index] === '\n') { - ++index; - } - ++lineNumber; - lineStart = index; - } else { - break; - } - } - } - - function filterCommentLocation() { - var i, entry, comment, comments = []; - - for (i = 0; i < extra.comments.length; ++i) { - entry = extra.comments[i]; - comment = { - type: entry.type, - value: entry.value - }; - if (extra.range) { - comment.range = entry.range; - } - if (extra.loc) { - comment.loc = entry.loc; - } - comments.push(comment); - } - - extra.comments = comments; - } - - function collectToken() { - var start, loc, token, range, value; - - skipComment(); - start = index; - loc = { - start: { - line: lineNumber, - column: index - lineStart - } - }; - - token = extra.advance(); - loc.end = { - line: lineNumber, - column: index - lineStart - }; - - if (token.type !== Token.EOF) { - range = [token.range[0], token.range[1]]; - value = sliceSource(token.range[0], token.range[1]); - extra.tokens.push({ - type: TokenName[token.type], - value: value, - range: range, - loc: loc - }); - } - - return token; - } - - function collectRegex() { - var pos, loc, regex, token; - - skipComment(); - - pos = index; - loc = { - start: { - line: lineNumber, - column: index - lineStart - } - }; - - regex = extra.scanRegExp(); - loc.end = { - line: lineNumber, - column: index - lineStart - }; - - // Pop the previous token, which is likely '/' or '/=' - if (extra.tokens.length > 0) { - token = extra.tokens[extra.tokens.length - 1]; - if (token.range[0] === pos && token.type === 'Punctuator') { - if (token.value === '/' || token.value === '/=') { - extra.tokens.pop(); - } - } - } - - extra.tokens.push({ - type: 'RegularExpression', - value: regex.literal, - range: [pos, index], - loc: loc - }); - - return regex; - } - - function filterTokenLocation() { - var i, entry, token, tokens = []; - - for (i = 0; i < extra.tokens.length; ++i) { - entry = extra.tokens[i]; - token = { - type: entry.type, - value: entry.value - }; - if (extra.range) { - token.range = entry.range; - } - if (extra.loc) { - token.loc = entry.loc; - } - tokens.push(token); - } - - extra.tokens = tokens; - } - - function createLiteral(token) { - return { - type: Syntax.Literal, - value: token.value - }; - } - - function createRawLiteral(token) { - return { - type: Syntax.Literal, - value: token.value, - raw: sliceSource(token.range[0], token.range[1]) - }; - } - - function createLocationMarker() { - var marker = {}; - - marker.range = [index, index]; - marker.loc = { - start: { - line: lineNumber, - column: index - lineStart - }, - end: { - line: lineNumber, - column: index - lineStart - } - }; - - marker.end = function () { - this.range[1] = index; - this.loc.end.line = lineNumber; - this.loc.end.column = index - lineStart; - }; - - marker.applyGroup = function (node) { - if (extra.range) { - node.groupRange = [this.range[0], this.range[1]]; - } - if (extra.loc) { - node.groupLoc = { - start: { - line: this.loc.start.line, - column: this.loc.start.column - }, - end: { - line: this.loc.end.line, - column: this.loc.end.column - } - }; - } - }; - - marker.apply = function (node) { - if (extra.range) { - node.range = [this.range[0], this.range[1]]; - } - if (extra.loc) { - node.loc = { - start: { - line: this.loc.start.line, - column: this.loc.start.column - }, - end: { - line: this.loc.end.line, - column: this.loc.end.column - } - }; - } - }; - - return marker; - } - - function trackGroupExpression() { - var marker, expr; - - skipComment(); - marker = createLocationMarker(); - expect('('); - - expr = parseExpression(); - - expect(')'); - - marker.end(); - marker.applyGroup(expr); - - return expr; - } - - function trackLeftHandSideExpression() { - var marker, expr; - - skipComment(); - marker = createLocationMarker(); - - expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression(); - - while (match('.') || match('[')) { - if (match('[')) { - expr = { - type: Syntax.MemberExpression, - computed: true, - object: expr, - property: parseComputedMember() - }; - marker.end(); - marker.apply(expr); - } else { - expr = { - type: Syntax.MemberExpression, - computed: false, - object: expr, - property: parseNonComputedMember() - }; - marker.end(); - marker.apply(expr); - } - } - - return expr; - } - - function trackLeftHandSideExpressionAllowCall() { - var marker, expr; - - skipComment(); - marker = createLocationMarker(); - - expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression(); - - while (match('.') || match('[') || match('(')) { - if (match('(')) { - expr = { - type: Syntax.CallExpression, - callee: expr, - 'arguments': parseArguments() - }; - marker.end(); - marker.apply(expr); - } else if (match('[')) { - expr = { - type: Syntax.MemberExpression, - computed: true, - object: expr, - property: parseComputedMember() - }; - marker.end(); - marker.apply(expr); - } else { - expr = { - type: Syntax.MemberExpression, - computed: false, - object: expr, - property: parseNonComputedMember() - }; - marker.end(); - marker.apply(expr); - } - } - - return expr; - } - - function filterGroup(node) { - var n, i, entry; - - n = (Object.prototype.toString.apply(node) === '[object Array]') ? [] : {}; - for (i in node) { - if (node.hasOwnProperty(i) && i !== 'groupRange' && i !== 'groupLoc') { - entry = node[i]; - if (entry === null || typeof entry !== 'object' || entry instanceof RegExp) { - n[i] = entry; - } else { - n[i] = filterGroup(entry); - } - } - } - return n; - } - - function wrapTrackingFunction(range, loc) { - - return function (parseFunction) { - - function isBinary(node) { - return node.type === Syntax.LogicalExpression || - node.type === Syntax.BinaryExpression; - } - - function visit(node) { - var start, end; - - if (isBinary(node.left)) { - visit(node.left); - } - if (isBinary(node.right)) { - visit(node.right); - } - - if (range) { - if (node.left.groupRange || node.right.groupRange) { - start = node.left.groupRange ? node.left.groupRange[0] : node.left.range[0]; - end = node.right.groupRange ? node.right.groupRange[1] : node.right.range[1]; - node.range = [start, end]; - } else if (typeof node.range === 'undefined') { - start = node.left.range[0]; - end = node.right.range[1]; - node.range = [start, end]; - } - } - if (loc) { - if (node.left.groupLoc || node.right.groupLoc) { - start = node.left.groupLoc ? node.left.groupLoc.start : node.left.loc.start; - end = node.right.groupLoc ? node.right.groupLoc.end : node.right.loc.end; - node.loc = { - start: start, - end: end - }; - } else if (typeof node.loc === 'undefined') { - node.loc = { - start: node.left.loc.start, - end: node.right.loc.end - }; - } - } - } - - return function () { - var marker, node; - - skipComment(); - - marker = createLocationMarker(); - node = parseFunction.apply(null, arguments); - marker.end(); - - if (range && typeof node.range === 'undefined') { - marker.apply(node); - } - - if (loc && typeof node.loc === 'undefined') { - marker.apply(node); - } - - if (isBinary(node)) { - visit(node); - } - - return node; - }; - }; - } - - function patch() { - - var wrapTracking; - - if (extra.comments) { - extra.skipComment = skipComment; - skipComment = scanComment; - } - - if (extra.raw) { - extra.createLiteral = createLiteral; - createLiteral = createRawLiteral; - } - - if (extra.range || extra.loc) { - - extra.parseGroupExpression = parseGroupExpression; - extra.parseLeftHandSideExpression = parseLeftHandSideExpression; - extra.parseLeftHandSideExpressionAllowCall = parseLeftHandSideExpressionAllowCall; - parseGroupExpression = trackGroupExpression; - parseLeftHandSideExpression = trackLeftHandSideExpression; - parseLeftHandSideExpressionAllowCall = trackLeftHandSideExpressionAllowCall; - - wrapTracking = wrapTrackingFunction(extra.range, extra.loc); - - extra.parseAdditiveExpression = parseAdditiveExpression; - extra.parseAssignmentExpression = parseAssignmentExpression; - extra.parseBitwiseANDExpression = parseBitwiseANDExpression; - extra.parseBitwiseORExpression = parseBitwiseORExpression; - extra.parseBitwiseXORExpression = parseBitwiseXORExpression; - extra.parseBlock = parseBlock; - extra.parseFunctionSourceElements = parseFunctionSourceElements; - extra.parseCatchClause = parseCatchClause; - extra.parseComputedMember = parseComputedMember; - extra.parseConditionalExpression = parseConditionalExpression; - extra.parseConstLetDeclaration = parseConstLetDeclaration; - extra.parseEqualityExpression = parseEqualityExpression; - extra.parseExpression = parseExpression; - extra.parseForVariableDeclaration = parseForVariableDeclaration; - extra.parseFunctionDeclaration = parseFunctionDeclaration; - extra.parseFunctionExpression = parseFunctionExpression; - extra.parseLogicalANDExpression = parseLogicalANDExpression; - extra.parseLogicalORExpression = parseLogicalORExpression; - extra.parseMultiplicativeExpression = parseMultiplicativeExpression; - extra.parseNewExpression = parseNewExpression; - extra.parseNonComputedProperty = parseNonComputedProperty; - extra.parseObjectProperty = parseObjectProperty; - extra.parseObjectPropertyKey = parseObjectPropertyKey; - extra.parsePostfixExpression = parsePostfixExpression; - extra.parsePrimaryExpression = parsePrimaryExpression; - extra.parseProgram = parseProgram; - extra.parsePropertyFunction = parsePropertyFunction; - extra.parseRelationalExpression = parseRelationalExpression; - extra.parseStatement = parseStatement; - extra.parseShiftExpression = parseShiftExpression; - extra.parseSwitchCase = parseSwitchCase; - extra.parseUnaryExpression = parseUnaryExpression; - extra.parseVariableDeclaration = parseVariableDeclaration; - extra.parseVariableIdentifier = parseVariableIdentifier; - - parseAdditiveExpression = wrapTracking(extra.parseAdditiveExpression); - parseAssignmentExpression = wrapTracking(extra.parseAssignmentExpression); - parseBitwiseANDExpression = wrapTracking(extra.parseBitwiseANDExpression); - parseBitwiseORExpression = wrapTracking(extra.parseBitwiseORExpression); - parseBitwiseXORExpression = wrapTracking(extra.parseBitwiseXORExpression); - parseBlock = wrapTracking(extra.parseBlock); - parseFunctionSourceElements = wrapTracking(extra.parseFunctionSourceElements); - parseCatchClause = wrapTracking(extra.parseCatchClause); - parseComputedMember = wrapTracking(extra.parseComputedMember); - parseConditionalExpression = wrapTracking(extra.parseConditionalExpression); - parseConstLetDeclaration = wrapTracking(extra.parseConstLetDeclaration); - parseEqualityExpression = wrapTracking(extra.parseEqualityExpression); - parseExpression = wrapTracking(extra.parseExpression); - parseForVariableDeclaration = wrapTracking(extra.parseForVariableDeclaration); - parseFunctionDeclaration = wrapTracking(extra.parseFunctionDeclaration); - parseFunctionExpression = wrapTracking(extra.parseFunctionExpression); - parseLeftHandSideExpression = wrapTracking(parseLeftHandSideExpression); - parseLogicalANDExpression = wrapTracking(extra.parseLogicalANDExpression); - parseLogicalORExpression = wrapTracking(extra.parseLogicalORExpression); - parseMultiplicativeExpression = wrapTracking(extra.parseMultiplicativeExpression); - parseNewExpression = wrapTracking(extra.parseNewExpression); - parseNonComputedProperty = wrapTracking(extra.parseNonComputedProperty); - parseObjectProperty = wrapTracking(extra.parseObjectProperty); - parseObjectPropertyKey = wrapTracking(extra.parseObjectPropertyKey); - parsePostfixExpression = wrapTracking(extra.parsePostfixExpression); - parsePrimaryExpression = wrapTracking(extra.parsePrimaryExpression); - parseProgram = wrapTracking(extra.parseProgram); - parsePropertyFunction = wrapTracking(extra.parsePropertyFunction); - parseRelationalExpression = wrapTracking(extra.parseRelationalExpression); - parseStatement = wrapTracking(extra.parseStatement); - parseShiftExpression = wrapTracking(extra.parseShiftExpression); - parseSwitchCase = wrapTracking(extra.parseSwitchCase); - parseUnaryExpression = wrapTracking(extra.parseUnaryExpression); - parseVariableDeclaration = wrapTracking(extra.parseVariableDeclaration); - parseVariableIdentifier = wrapTracking(extra.parseVariableIdentifier); - } - - if (typeof extra.tokens !== 'undefined') { - extra.advance = advance; - extra.scanRegExp = scanRegExp; - - advance = collectToken; - scanRegExp = collectRegex; - } - } - - function unpatch() { - if (typeof extra.skipComment === 'function') { - skipComment = extra.skipComment; - } - - if (extra.raw) { - createLiteral = extra.createLiteral; - } - - if (extra.range || extra.loc) { - parseAdditiveExpression = extra.parseAdditiveExpression; - parseAssignmentExpression = extra.parseAssignmentExpression; - parseBitwiseANDExpression = extra.parseBitwiseANDExpression; - parseBitwiseORExpression = extra.parseBitwiseORExpression; - parseBitwiseXORExpression = extra.parseBitwiseXORExpression; - parseBlock = extra.parseBlock; - parseFunctionSourceElements = extra.parseFunctionSourceElements; - parseCatchClause = extra.parseCatchClause; - parseComputedMember = extra.parseComputedMember; - parseConditionalExpression = extra.parseConditionalExpression; - parseConstLetDeclaration = extra.parseConstLetDeclaration; - parseEqualityExpression = extra.parseEqualityExpression; - parseExpression = extra.parseExpression; - parseForVariableDeclaration = extra.parseForVariableDeclaration; - parseFunctionDeclaration = extra.parseFunctionDeclaration; - parseFunctionExpression = extra.parseFunctionExpression; - parseGroupExpression = extra.parseGroupExpression; - parseLeftHandSideExpression = extra.parseLeftHandSideExpression; - parseLeftHandSideExpressionAllowCall = extra.parseLeftHandSideExpressionAllowCall; - parseLogicalANDExpression = extra.parseLogicalANDExpression; - parseLogicalORExpression = extra.parseLogicalORExpression; - parseMultiplicativeExpression = extra.parseMultiplicativeExpression; - parseNewExpression = extra.parseNewExpression; - parseNonComputedProperty = extra.parseNonComputedProperty; - parseObjectProperty = extra.parseObjectProperty; - parseObjectPropertyKey = extra.parseObjectPropertyKey; - parsePrimaryExpression = extra.parsePrimaryExpression; - parsePostfixExpression = extra.parsePostfixExpression; - parseProgram = extra.parseProgram; - parsePropertyFunction = extra.parsePropertyFunction; - parseRelationalExpression = extra.parseRelationalExpression; - parseStatement = extra.parseStatement; - parseShiftExpression = extra.parseShiftExpression; - parseSwitchCase = extra.parseSwitchCase; - parseUnaryExpression = extra.parseUnaryExpression; - parseVariableDeclaration = extra.parseVariableDeclaration; - parseVariableIdentifier = extra.parseVariableIdentifier; - } - - if (typeof extra.scanRegExp === 'function') { - advance = extra.advance; - scanRegExp = extra.scanRegExp; - } - } - - function stringToArray(str) { - var length = str.length, - result = [], - i; - for (i = 0; i < length; ++i) { - result[i] = str.charAt(i); - } - return result; - } - - function parse(code, options) { - var program, toString; - - toString = String; - if (typeof code !== 'string' && !(code instanceof String)) { - code = toString(code); - } - - source = code; - index = 0; - lineNumber = (source.length > 0) ? 1 : 0; - lineStart = 0; - length = source.length; - buffer = null; - state = { - allowIn: true, - labelSet: {}, - inFunctionBody: false, - inIteration: false, - inSwitch: false - }; - - extra = {}; - if (typeof options !== 'undefined') { - extra.range = (typeof options.range === 'boolean') && options.range; - extra.loc = (typeof options.loc === 'boolean') && options.loc; - extra.raw = (typeof options.raw === 'boolean') && options.raw; - if (typeof options.tokens === 'boolean' && options.tokens) { - extra.tokens = []; - } - if (typeof options.comment === 'boolean' && options.comment) { - extra.comments = []; - } - if (typeof options.tolerant === 'boolean' && options.tolerant) { - extra.errors = []; - } - } - - if (length > 0) { - if (typeof source[0] === 'undefined') { - // Try first to convert to a string. This is good as fast path - // for old IE which understands string indexing for string - // literals only and not for string object. - if (code instanceof String) { - source = code.valueOf(); - } - - // Force accessing the characters via an array. - if (typeof source[0] === 'undefined') { - source = stringToArray(code); - } - } - } - - patch(); - try { - program = parseProgram(); - if (typeof extra.comments !== 'undefined') { - filterCommentLocation(); - program.comments = extra.comments; - } - if (typeof extra.tokens !== 'undefined') { - filterTokenLocation(); - program.tokens = extra.tokens; - } - if (typeof extra.errors !== 'undefined') { - program.errors = extra.errors; - } - if (extra.range || extra.loc) { - program.body = filterGroup(program.body); - } - } catch (e) { - throw e; - } finally { - unpatch(); - extra = {}; - } - - return program; - } - - // Sync with package.json. - exports.version = '1.0.3'; - - exports.parse = parse; - - // Deep copy. - exports.Syntax = (function () { - var name, types = {}; - - if (typeof Object.create === 'function') { - types = Object.create(null); - } - - for (name in Syntax) { - if (Syntax.hasOwnProperty(name)) { - types[name] = Syntax[name]; - } - } - - if (typeof Object.freeze === 'function') { - Object.freeze(types); - } - - return types; - }()); - -})); -/* vim: set sw=4 ts=4 et tw=80 : */ -/** - * @license Copyright (c) 2012, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ - -/*global define, Reflect */ - -/* - * xpcshell has a smaller stack on linux and windows (1MB vs 9MB on mac), - * and the recursive nature of esprima can cause it to overflow pretty - * quickly. So favor it built in Reflect parser: - * https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API - */ -define('esprimaAdapter', ['./esprima', 'env'], function (esprima, env) { - if (env.get() === 'xpconnect' && typeof Reflect !== 'undefined') { - return Reflect; - } else { - return esprima; - } -}); -define('uglifyjs/consolidator', ["require", "exports", "module", "./parse-js", "./process"], function(require, exports, module) { -/** - * @preserve Copyright 2012 Robert Gust-Bardon . - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above - * copyright notice, this list of conditions and the following - * disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -/** - * @fileoverview Enhances UglifyJS with consolidation of null, Boolean, and String values. - *

Also known as aliasing, this feature has been deprecated in the Closure Compiler since its - * initial release, where it is unavailable from the CLI. The Closure Compiler allows one to log and - * influence this process. In contrast, this implementation does not introduce - * any variable declarations in global code and derives String values from - * identifier names used as property accessors.

- *

Consolidating literals may worsen the data compression ratio when an encoding - * transformation is applied. For instance, jQuery 1.7.1 takes 248235 bytes. - * Building it with - * UglifyJS v1.2.5 results in 93647 bytes (37.73% of the original) which are - * then compressed to 33154 bytes (13.36% of the original) using gzip(1). Building it with the same - * version of UglifyJS 1.2.5 patched with the implementation of consolidation - * results in 80784 bytes (a decrease of 12863 bytes, i.e. 13.74%, in comparison - * to the aforementioned 93647 bytes) which are then compressed to 34013 bytes - * (an increase of 859 bytes, i.e. 2.59%, in comparison to the aforementioned - * 33154 bytes).

- *

Written in the strict variant - * of ECMA-262 5.1 Edition. Encoded in UTF-8. Follows Revision 2.28 of the Google JavaScript Style Guide (except for the - * discouraged use of the {@code function} tag and the {@code namespace} tag). - * 100% typed for the Closure Compiler Version 1741.

- *

Should you find this software useful, please consider a donation.

- * @author follow.me@RGustBardon (Robert Gust-Bardon) - * @supported Tested with: - * - */ - -/*global console:false, exports:true, module:false, require:false */ -/*jshint sub:true */ -/** - * Consolidates null, Boolean, and String values found inside an AST. - * @param {!TSyntacticCodeUnit} oAbstractSyntaxTree An array-like object - * representing an AST. - * @return {!TSyntacticCodeUnit} An array-like object representing an AST with its null, Boolean, and - * String values consolidated. - */ -// TODO(user) Consolidation of mathematical values found in numeric literals. -// TODO(user) Unconsolidation. -// TODO(user) Consolidation of ECMA-262 6th Edition programs. -// TODO(user) Rewrite in ECMA-262 6th Edition. -exports['ast_consolidate'] = function(oAbstractSyntaxTree) { - 'use strict'; - /*jshint bitwise:true, curly:true, eqeqeq:true, forin:true, immed:true, - latedef:true, newcap:true, noarge:true, noempty:true, nonew:true, - onevar:true, plusplus:true, regexp:true, undef:true, strict:true, - sub:false, trailing:true */ - - var _, - /** - * A record consisting of data about one or more source elements. - * @constructor - * @nosideeffects - */ - TSourceElementsData = function() { - /** - * The category of the elements. - * @type {number} - * @see ESourceElementCategories - */ - this.nCategory = ESourceElementCategories.N_OTHER; - /** - * The number of occurrences (within the elements) of each primitive - * value that could be consolidated. - * @type {!Array.>} - */ - this.aCount = []; - this.aCount[EPrimaryExpressionCategories.N_IDENTIFIER_NAMES] = {}; - this.aCount[EPrimaryExpressionCategories.N_STRING_LITERALS] = {}; - this.aCount[EPrimaryExpressionCategories.N_NULL_AND_BOOLEAN_LITERALS] = - {}; - /** - * Identifier names found within the elements. - * @type {!Array.} - */ - this.aIdentifiers = []; - /** - * Prefixed representation Strings of each primitive value that could be - * consolidated within the elements. - * @type {!Array.} - */ - this.aPrimitiveValues = []; - }, - /** - * A record consisting of data about a primitive value that could be - * consolidated. - * @constructor - * @nosideeffects - */ - TPrimitiveValue = function() { - /** - * The difference in the number of terminal symbols between the original - * source text and the one with the primitive value consolidated. If the - * difference is positive, the primitive value is considered worthwhile. - * @type {number} - */ - this.nSaving = 0; - /** - * An identifier name of the variable that will be declared and assigned - * the primitive value if the primitive value is consolidated. - * @type {string} - */ - this.sName = ''; - }, - /** - * A record consisting of data on what to consolidate within the range of - * source elements that is currently being considered. - * @constructor - * @nosideeffects - */ - TSolution = function() { - /** - * An object whose keys are prefixed representation Strings of each - * primitive value that could be consolidated within the elements and - * whose values are corresponding data about those primitive values. - * @type {!Object.} - * @see TPrimitiveValue - */ - this.oPrimitiveValues = {}; - /** - * The difference in the number of terminal symbols between the original - * source text and the one with all the worthwhile primitive values - * consolidated. - * @type {number} - * @see TPrimitiveValue#nSaving - */ - this.nSavings = 0; - }, - /** - * The processor of ASTs found - * in UglifyJS. - * @namespace - * @type {!TProcessor} - */ - oProcessor = (/** @type {!TProcessor} */ require('./process')), - /** - * A record consisting of a number of constants that represent the - * difference in the number of terminal symbols between a source text with - * a modified syntactic code unit and the original one. - * @namespace - * @type {!Object.} - */ - oWeights = { - /** - * The difference in the number of punctuators required by the bracket - * notation and the dot notation. - *

'[]'.length - '.'.length

- * @const - * @type {number} - */ - N_PROPERTY_ACCESSOR: 1, - /** - * The number of punctuators required by a variable declaration with an - * initialiser. - *

':'.length + ';'.length

- * @const - * @type {number} - */ - N_VARIABLE_DECLARATION: 2, - /** - * The number of terminal symbols required to introduce a variable - * statement (excluding its variable declaration list). - *

'var '.length

- * @const - * @type {number} - */ - N_VARIABLE_STATEMENT_AFFIXATION: 4, - /** - * The number of terminal symbols needed to enclose source elements - * within a function call with no argument values to a function with an - * empty parameter list. - *

'(function(){}());'.length

- * @const - * @type {number} - */ - N_CLOSURE: 17 - }, - /** - * Categories of primary expressions from which primitive values that - * could be consolidated are derivable. - * @namespace - * @enum {number} - */ - EPrimaryExpressionCategories = { - /** - * Identifier names used as property accessors. - * @type {number} - */ - N_IDENTIFIER_NAMES: 0, - /** - * String literals. - * @type {number} - */ - N_STRING_LITERALS: 1, - /** - * Null and Boolean literals. - * @type {number} - */ - N_NULL_AND_BOOLEAN_LITERALS: 2 - }, - /** - * Prefixes of primitive values that could be consolidated. - * The String values of the prefixes must have same number of characters. - * The prefixes must not be used in any properties defined in any version - * of ECMA-262. - * @namespace - * @enum {string} - */ - EValuePrefixes = { - /** - * Identifies String values. - * @type {string} - */ - S_STRING: '#S', - /** - * Identifies null and Boolean values. - * @type {string} - */ - S_SYMBOLIC: '#O' - }, - /** - * Categories of source elements in terms of their appropriateness of - * having their primitive values consolidated. - * @namespace - * @enum {number} - */ - ESourceElementCategories = { - /** - * Identifies a source element that includes the {@code with} statement. - * @type {number} - */ - N_WITH: 0, - /** - * Identifies a source element that includes the {@code eval} identifier name. - * @type {number} - */ - N_EVAL: 1, - /** - * Identifies a source element that must be excluded from the process - * unless its whole scope is examined. - * @type {number} - */ - N_EXCLUDABLE: 2, - /** - * Identifies source elements not posing any problems. - * @type {number} - */ - N_OTHER: 3 - }, - /** - * The list of literals (other than the String ones) whose primitive - * values can be consolidated. - * @const - * @type {!Array.} - */ - A_OTHER_SUBSTITUTABLE_LITERALS = [ - 'null', // The null literal. - 'false', // The Boolean literal {@code false}. - 'true' // The Boolean literal {@code true}. - ]; - - (/** - * Consolidates all worthwhile primitive values in a syntactic code unit. - * @param {!TSyntacticCodeUnit} oSyntacticCodeUnit An array-like object - * representing the branch of the abstract syntax tree representing the - * syntactic code unit along with its scope. - * @see TPrimitiveValue#nSaving - */ - function fExamineSyntacticCodeUnit(oSyntacticCodeUnit) { - var _, - /** - * Indicates whether the syntactic code unit represents global code. - * @type {boolean} - */ - bIsGlobal = 'toplevel' === oSyntacticCodeUnit[0], - /** - * Indicates whether the whole scope is being examined. - * @type {boolean} - */ - bIsWhollyExaminable = !bIsGlobal, - /** - * An array-like object representing source elements that constitute a - * syntactic code unit. - * @type {!TSyntacticCodeUnit} - */ - oSourceElements, - /** - * A record consisting of data about the source element that is - * currently being examined. - * @type {!TSourceElementsData} - */ - oSourceElementData, - /** - * The scope of the syntactic code unit. - * @type {!TScope} - */ - oScope, - /** - * An instance of an object that allows the traversal of an AST. - * @type {!TWalker} - */ - oWalker, - /** - * An object encompassing collections of functions used during the - * traversal of an AST. - * @namespace - * @type {!Object.>} - */ - oWalkers = { - /** - * A collection of functions used during the surveyance of source - * elements. - * @namespace - * @type {!Object.} - */ - oSurveySourceElement: { - /**#nocode+*/ // JsDoc Toolkit 2.4.0 hides some of the keys. - /** - * Classifies the source element as excludable if it does not - * contain a {@code with} statement or the {@code eval} identifier - * name. Adds the identifier of the function and its formal - * parameters to the list of identifier names found. - * @param {string} sIdentifier The identifier of the function. - * @param {!Array.} aFormalParameterList Formal parameters. - * @param {!TSyntacticCodeUnit} oFunctionBody Function code. - */ - 'defun': function( - sIdentifier, - aFormalParameterList, - oFunctionBody) { - fClassifyAsExcludable(); - fAddIdentifier(sIdentifier); - aFormalParameterList.forEach(fAddIdentifier); - }, - /** - * Increments the count of the number of occurrences of the String - * value that is equivalent to the sequence of terminal symbols - * that constitute the encountered identifier name. - * @param {!TSyntacticCodeUnit} oExpression The nonterminal - * MemberExpression. - * @param {string} sIdentifierName The identifier name used as the - * property accessor. - * @return {!Array} The encountered branch of an AST with its nonterminal - * MemberExpression traversed. - */ - 'dot': function(oExpression, sIdentifierName) { - fCountPrimaryExpression( - EPrimaryExpressionCategories.N_IDENTIFIER_NAMES, - EValuePrefixes.S_STRING + sIdentifierName); - return ['dot', oWalker.walk(oExpression), sIdentifierName]; - }, - /** - * Adds the optional identifier of the function and its formal - * parameters to the list of identifier names found. - * @param {?string} sIdentifier The optional identifier of the - * function. - * @param {!Array.} aFormalParameterList Formal parameters. - * @param {!TSyntacticCodeUnit} oFunctionBody Function code. - */ - 'function': function( - sIdentifier, - aFormalParameterList, - oFunctionBody) { - if ('string' === typeof sIdentifier) { - fAddIdentifier(sIdentifier); - } - aFormalParameterList.forEach(fAddIdentifier); - }, - /** - * Either increments the count of the number of occurrences of the - * encountered null or Boolean value or classifies a source element - * as containing the {@code eval} identifier name. - * @param {string} sIdentifier The identifier encountered. - */ - 'name': function(sIdentifier) { - if (-1 !== A_OTHER_SUBSTITUTABLE_LITERALS.indexOf(sIdentifier)) { - fCountPrimaryExpression( - EPrimaryExpressionCategories.N_NULL_AND_BOOLEAN_LITERALS, - EValuePrefixes.S_SYMBOLIC + sIdentifier); - } else { - if ('eval' === sIdentifier) { - oSourceElementData.nCategory = - ESourceElementCategories.N_EVAL; - } - fAddIdentifier(sIdentifier); - } - }, - /** - * Classifies the source element as excludable if it does not - * contain a {@code with} statement or the {@code eval} identifier - * name. - * @param {TSyntacticCodeUnit} oExpression The expression whose - * value is to be returned. - */ - 'return': function(oExpression) { - fClassifyAsExcludable(); - }, - /** - * Increments the count of the number of occurrences of the - * encountered String value. - * @param {string} sStringValue The String value of the string - * literal encountered. - */ - 'string': function(sStringValue) { - if (sStringValue.length > 0) { - fCountPrimaryExpression( - EPrimaryExpressionCategories.N_STRING_LITERALS, - EValuePrefixes.S_STRING + sStringValue); - } - }, - /** - * Adds the identifier reserved for an exception to the list of - * identifier names found. - * @param {!TSyntacticCodeUnit} oTry A block of code in which an - * exception can occur. - * @param {Array} aCatch The identifier reserved for an exception - * and a block of code to handle the exception. - * @param {TSyntacticCodeUnit} oFinally An optional block of code - * to be evaluated regardless of whether an exception occurs. - */ - 'try': function(oTry, aCatch, oFinally) { - if (Array.isArray(aCatch)) { - fAddIdentifier(aCatch[0]); - } - }, - /** - * Classifies the source element as excludable if it does not - * contain a {@code with} statement or the {@code eval} identifier - * name. Adds the identifier of each declared variable to the list - * of identifier names found. - * @param {!Array.} aVariableDeclarationList Variable - * declarations. - */ - 'var': function(aVariableDeclarationList) { - fClassifyAsExcludable(); - aVariableDeclarationList.forEach(fAddVariable); - }, - /** - * Classifies a source element as containing the {@code with} - * statement. - * @param {!TSyntacticCodeUnit} oExpression An expression whose - * value is to be converted to a value of type Object and - * become the binding object of a new object environment - * record of a new lexical environment in which the statement - * is to be executed. - * @param {!TSyntacticCodeUnit} oStatement The statement to be - * executed in the augmented lexical environment. - * @return {!Array} An empty array to stop the traversal. - */ - 'with': function(oExpression, oStatement) { - oSourceElementData.nCategory = ESourceElementCategories.N_WITH; - return []; - } - /**#nocode-*/ // JsDoc Toolkit 2.4.0 hides some of the keys. - }, - /** - * A collection of functions used while looking for nested functions. - * @namespace - * @type {!Object.} - */ - oExamineFunctions: { - /**#nocode+*/ // JsDoc Toolkit 2.4.0 hides some of the keys. - /** - * Orders an examination of a nested function declaration. - * @this {!TSyntacticCodeUnit} An array-like object representing - * the branch of an AST representing the syntactic code unit along with - * its scope. - * @return {!Array} An empty array to stop the traversal. - */ - 'defun': function() { - fExamineSyntacticCodeUnit(this); - return []; - }, - /** - * Orders an examination of a nested function expression. - * @this {!TSyntacticCodeUnit} An array-like object representing - * the branch of an AST representing the syntactic code unit along with - * its scope. - * @return {!Array} An empty array to stop the traversal. - */ - 'function': function() { - fExamineSyntacticCodeUnit(this); - return []; - } - /**#nocode-*/ // JsDoc Toolkit 2.4.0 hides some of the keys. - } - }, - /** - * Records containing data about source elements. - * @type {Array.} - */ - aSourceElementsData = [], - /** - * The index (in the source text order) of the source element - * immediately following a Directive Prologue. - * @type {number} - */ - nAfterDirectivePrologue = 0, - /** - * The index (in the source text order) of the source element that is - * currently being considered. - * @type {number} - */ - nPosition, - /** - * The index (in the source text order) of the source element that is - * the last element of the range of source elements that is currently - * being considered. - * @type {(undefined|number)} - */ - nTo, - /** - * Initiates the traversal of a source element. - * @param {!TWalker} oWalker An instance of an object that allows the - * traversal of an abstract syntax tree. - * @param {!TSyntacticCodeUnit} oSourceElement A source element from - * which the traversal should commence. - * @return {function(): !TSyntacticCodeUnit} A function that is able to - * initiate the traversal from a given source element. - */ - cContext = function(oWalker, oSourceElement) { - /** - * @return {!TSyntacticCodeUnit} A function that is able to - * initiate the traversal from a given source element. - */ - var fLambda = function() { - return oWalker.walk(oSourceElement); - }; - - return fLambda; - }, - /** - * Classifies the source element as excludable if it does not - * contain a {@code with} statement or the {@code eval} identifier - * name. - */ - fClassifyAsExcludable = function() { - if (oSourceElementData.nCategory === - ESourceElementCategories.N_OTHER) { - oSourceElementData.nCategory = - ESourceElementCategories.N_EXCLUDABLE; - } - }, - /** - * Adds an identifier to the list of identifier names found. - * @param {string} sIdentifier The identifier to be added. - */ - fAddIdentifier = function(sIdentifier) { - if (-1 === oSourceElementData.aIdentifiers.indexOf(sIdentifier)) { - oSourceElementData.aIdentifiers.push(sIdentifier); - } - }, - /** - * Adds the identifier of a variable to the list of identifier names - * found. - * @param {!Array} aVariableDeclaration A variable declaration. - */ - fAddVariable = function(aVariableDeclaration) { - fAddIdentifier(/** @type {string} */ aVariableDeclaration[0]); - }, - /** - * Increments the count of the number of occurrences of the prefixed - * String representation attributed to the primary expression. - * @param {number} nCategory The category of the primary expression. - * @param {string} sName The prefixed String representation attributed - * to the primary expression. - */ - fCountPrimaryExpression = function(nCategory, sName) { - if (!oSourceElementData.aCount[nCategory].hasOwnProperty(sName)) { - oSourceElementData.aCount[nCategory][sName] = 0; - if (-1 === oSourceElementData.aPrimitiveValues.indexOf(sName)) { - oSourceElementData.aPrimitiveValues.push(sName); - } - } - oSourceElementData.aCount[nCategory][sName] += 1; - }, - /** - * Consolidates all worthwhile primitive values in a range of source - * elements. - * @param {number} nFrom The index (in the source text order) of the - * source element that is the first element of the range. - * @param {number} nTo The index (in the source text order) of the - * source element that is the last element of the range. - * @param {boolean} bEnclose Indicates whether the range should be - * enclosed within a function call with no argument values to a - * function with an empty parameter list if any primitive values - * are consolidated. - * @see TPrimitiveValue#nSaving - */ - fExamineSourceElements = function(nFrom, nTo, bEnclose) { - var _, - /** - * The index of the last mangled name. - * @type {number} - */ - nIndex = oScope.cname, - /** - * The index of the source element that is currently being - * considered. - * @type {number} - */ - nPosition, - /** - * A collection of functions used during the consolidation of - * primitive values and identifier names used as property - * accessors. - * @namespace - * @type {!Object.} - */ - oWalkersTransformers = { - /** - * If the String value that is equivalent to the sequence of - * terminal symbols that constitute the encountered identifier - * name is worthwhile, a syntactic conversion from the dot - * notation to the bracket notation ensues with that sequence - * being substituted by an identifier name to which the value - * is assigned. - * Applies to property accessors that use the dot notation. - * @param {!TSyntacticCodeUnit} oExpression The nonterminal - * MemberExpression. - * @param {string} sIdentifierName The identifier name used as - * the property accessor. - * @return {!Array} A syntactic code unit that is equivalent to - * the one encountered. - * @see TPrimitiveValue#nSaving - */ - 'dot': function(oExpression, sIdentifierName) { - /** - * The prefixed String value that is equivalent to the - * sequence of terminal symbols that constitute the - * encountered identifier name. - * @type {string} - */ - var sPrefixed = EValuePrefixes.S_STRING + sIdentifierName; - - return oSolutionBest.oPrimitiveValues.hasOwnProperty( - sPrefixed) && - oSolutionBest.oPrimitiveValues[sPrefixed].nSaving > 0 ? - ['sub', - oWalker.walk(oExpression), - ['name', - oSolutionBest.oPrimitiveValues[sPrefixed].sName]] : - ['dot', oWalker.walk(oExpression), sIdentifierName]; - }, - /** - * If the encountered identifier is a null or Boolean literal - * and its value is worthwhile, the identifier is substituted - * by an identifier name to which that value is assigned. - * Applies to identifier names. - * @param {string} sIdentifier The identifier encountered. - * @return {!Array} A syntactic code unit that is equivalent to - * the one encountered. - * @see TPrimitiveValue#nSaving - */ - 'name': function(sIdentifier) { - /** - * The prefixed representation String of the identifier. - * @type {string} - */ - var sPrefixed = EValuePrefixes.S_SYMBOLIC + sIdentifier; - - return [ - 'name', - oSolutionBest.oPrimitiveValues.hasOwnProperty(sPrefixed) && - oSolutionBest.oPrimitiveValues[sPrefixed].nSaving > 0 ? - oSolutionBest.oPrimitiveValues[sPrefixed].sName : - sIdentifier - ]; - }, - /** - * If the encountered String value is worthwhile, it is - * substituted by an identifier name to which that value is - * assigned. - * Applies to String values. - * @param {string} sStringValue The String value of the string - * literal encountered. - * @return {!Array} A syntactic code unit that is equivalent to - * the one encountered. - * @see TPrimitiveValue#nSaving - */ - 'string': function(sStringValue) { - /** - * The prefixed representation String of the primitive value - * of the literal. - * @type {string} - */ - var sPrefixed = - EValuePrefixes.S_STRING + sStringValue; - - return oSolutionBest.oPrimitiveValues.hasOwnProperty( - sPrefixed) && - oSolutionBest.oPrimitiveValues[sPrefixed].nSaving > 0 ? - ['name', - oSolutionBest.oPrimitiveValues[sPrefixed].sName] : - ['string', sStringValue]; - } - }, - /** - * Such data on what to consolidate within the range of source - * elements that is currently being considered that lead to the - * greatest known reduction of the number of the terminal symbols - * in comparison to the original source text. - * @type {!TSolution} - */ - oSolutionBest = new TSolution(), - /** - * Data representing an ongoing attempt to find a better - * reduction of the number of the terminal symbols in comparison - * to the original source text than the best one that is - * currently known. - * @type {!TSolution} - * @see oSolutionBest - */ - oSolutionCandidate = new TSolution(), - /** - * A record consisting of data about the range of source elements - * that is currently being examined. - * @type {!TSourceElementsData} - */ - oSourceElementsData = new TSourceElementsData(), - /** - * Variable declarations for each primitive value that is to be - * consolidated within the elements. - * @type {!Array.} - */ - aVariableDeclarations = [], - /** - * Augments a list with a prefixed representation String. - * @param {!Array.} aList A list that is to be augmented. - * @return {function(string)} A function that augments a list - * with a prefixed representation String. - */ - cAugmentList = function(aList) { - /** - * @param {string} sPrefixed Prefixed representation String of - * a primitive value that could be consolidated within the - * elements. - */ - var fLambda = function(sPrefixed) { - if (-1 === aList.indexOf(sPrefixed)) { - aList.push(sPrefixed); - } - }; - - return fLambda; - }, - /** - * Adds the number of occurrences of a primitive value of a given - * category that could be consolidated in the source element with - * a given index to the count of occurrences of that primitive - * value within the range of source elements that is currently - * being considered. - * @param {number} nPosition The index (in the source text order) - * of a source element. - * @param {number} nCategory The category of the primary - * expression from which the primitive value is derived. - * @return {function(string)} A function that performs the - * addition. - * @see cAddOccurrencesInCategory - */ - cAddOccurrences = function(nPosition, nCategory) { - /** - * @param {string} sPrefixed The prefixed representation String - * of a primitive value. - */ - var fLambda = function(sPrefixed) { - if (!oSourceElementsData.aCount[nCategory].hasOwnProperty( - sPrefixed)) { - oSourceElementsData.aCount[nCategory][sPrefixed] = 0; - } - oSourceElementsData.aCount[nCategory][sPrefixed] += - aSourceElementsData[nPosition].aCount[nCategory][ - sPrefixed]; - }; - - return fLambda; - }, - /** - * Adds the number of occurrences of each primitive value of a - * given category that could be consolidated in the source - * element with a given index to the count of occurrences of that - * primitive values within the range of source elements that is - * currently being considered. - * @param {number} nPosition The index (in the source text order) - * of a source element. - * @return {function(number)} A function that performs the - * addition. - * @see fAddOccurrences - */ - cAddOccurrencesInCategory = function(nPosition) { - /** - * @param {number} nCategory The category of the primary - * expression from which the primitive value is derived. - */ - var fLambda = function(nCategory) { - Object.keys( - aSourceElementsData[nPosition].aCount[nCategory] - ).forEach(cAddOccurrences(nPosition, nCategory)); - }; - - return fLambda; - }, - /** - * Adds the number of occurrences of each primitive value that - * could be consolidated in the source element with a given index - * to the count of occurrences of that primitive values within - * the range of source elements that is currently being - * considered. - * @param {number} nPosition The index (in the source text order) - * of a source element. - */ - fAddOccurrences = function(nPosition) { - Object.keys(aSourceElementsData[nPosition].aCount).forEach( - cAddOccurrencesInCategory(nPosition)); - }, - /** - * Creates a variable declaration for a primitive value if that - * primitive value is to be consolidated within the elements. - * @param {string} sPrefixed Prefixed representation String of a - * primitive value that could be consolidated within the - * elements. - * @see aVariableDeclarations - */ - cAugmentVariableDeclarations = function(sPrefixed) { - if (oSolutionBest.oPrimitiveValues[sPrefixed].nSaving > 0) { - aVariableDeclarations.push([ - oSolutionBest.oPrimitiveValues[sPrefixed].sName, - [0 === sPrefixed.indexOf(EValuePrefixes.S_SYMBOLIC) ? - 'name' : 'string', - sPrefixed.substring(EValuePrefixes.S_SYMBOLIC.length)] - ]); - } - }, - /** - * Sorts primitive values with regard to the difference in the - * number of terminal symbols between the original source text - * and the one with those primitive values consolidated. - * @param {string} sPrefixed0 The prefixed representation String - * of the first of the two primitive values that are being - * compared. - * @param {string} sPrefixed1 The prefixed representation String - * of the second of the two primitive values that are being - * compared. - * @return {number} - *
- *
-1
- *
if the first primitive value must be placed before - * the other one,
- *
0
- *
if the first primitive value may be placed before - * the other one,
- *
1
- *
if the first primitive value must not be placed - * before the other one.
- *
- * @see TSolution.oPrimitiveValues - */ - cSortPrimitiveValues = function(sPrefixed0, sPrefixed1) { - /** - * The difference between: - *
    - *
  1. the difference in the number of terminal symbols - * between the original source text and the one with the - * first primitive value consolidated, and
  2. - *
  3. the difference in the number of terminal symbols - * between the original source text and the one with the - * second primitive value consolidated.
  4. - *
- * @type {number} - */ - var nDifference = - oSolutionCandidate.oPrimitiveValues[sPrefixed0].nSaving - - oSolutionCandidate.oPrimitiveValues[sPrefixed1].nSaving; - - return nDifference > 0 ? -1 : nDifference < 0 ? 1 : 0; - }, - /** - * Assigns an identifier name to a primitive value and calculates - * whether instances of that primitive value are worth - * consolidating. - * @param {string} sPrefixed The prefixed representation String - * of a primitive value that is being evaluated. - */ - fEvaluatePrimitiveValue = function(sPrefixed) { - var _, - /** - * The index of the last mangled name. - * @type {number} - */ - nIndex, - /** - * The representation String of the primitive value that is - * being evaluated. - * @type {string} - */ - sName = - sPrefixed.substring(EValuePrefixes.S_SYMBOLIC.length), - /** - * The number of source characters taken up by the - * representation String of the primitive value that is - * being evaluated. - * @type {number} - */ - nLengthOriginal = sName.length, - /** - * The number of source characters taken up by the - * identifier name that could substitute the primitive - * value that is being evaluated. - * substituted. - * @type {number} - */ - nLengthSubstitution, - /** - * The number of source characters taken up by by the - * representation String of the primitive value that is - * being evaluated when it is represented by a string - * literal. - * @type {number} - */ - nLengthString = oProcessor.make_string(sName).length; - - oSolutionCandidate.oPrimitiveValues[sPrefixed] = - new TPrimitiveValue(); - do { // Find an identifier unused in this or any nested scope. - nIndex = oScope.cname; - oSolutionCandidate.oPrimitiveValues[sPrefixed].sName = - oScope.next_mangled(); - } while (-1 !== oSourceElementsData.aIdentifiers.indexOf( - oSolutionCandidate.oPrimitiveValues[sPrefixed].sName)); - nLengthSubstitution = oSolutionCandidate.oPrimitiveValues[ - sPrefixed].sName.length; - if (0 === sPrefixed.indexOf(EValuePrefixes.S_SYMBOLIC)) { - // foo:null, or foo:null; - oSolutionCandidate.oPrimitiveValues[sPrefixed].nSaving -= - nLengthSubstitution + nLengthOriginal + - oWeights.N_VARIABLE_DECLARATION; - // null vs foo - oSolutionCandidate.oPrimitiveValues[sPrefixed].nSaving += - oSourceElementsData.aCount[ - EPrimaryExpressionCategories. - N_NULL_AND_BOOLEAN_LITERALS][sPrefixed] * - (nLengthOriginal - nLengthSubstitution); - } else { - // foo:'fromCharCode'; - oSolutionCandidate.oPrimitiveValues[sPrefixed].nSaving -= - nLengthSubstitution + nLengthString + - oWeights.N_VARIABLE_DECLARATION; - // .fromCharCode vs [foo] - if (oSourceElementsData.aCount[ - EPrimaryExpressionCategories.N_IDENTIFIER_NAMES - ].hasOwnProperty(sPrefixed)) { - oSolutionCandidate.oPrimitiveValues[sPrefixed].nSaving += - oSourceElementsData.aCount[ - EPrimaryExpressionCategories.N_IDENTIFIER_NAMES - ][sPrefixed] * - (nLengthOriginal - nLengthSubstitution - - oWeights.N_PROPERTY_ACCESSOR); - } - // 'fromCharCode' vs foo - if (oSourceElementsData.aCount[ - EPrimaryExpressionCategories.N_STRING_LITERALS - ].hasOwnProperty(sPrefixed)) { - oSolutionCandidate.oPrimitiveValues[sPrefixed].nSaving += - oSourceElementsData.aCount[ - EPrimaryExpressionCategories.N_STRING_LITERALS - ][sPrefixed] * - (nLengthString - nLengthSubstitution); - } - } - if (oSolutionCandidate.oPrimitiveValues[sPrefixed].nSaving > - 0) { - oSolutionCandidate.nSavings += - oSolutionCandidate.oPrimitiveValues[sPrefixed].nSaving; - } else { - oScope.cname = nIndex; // Free the identifier name. - } - }, - /** - * Adds a variable declaration to an existing variable statement. - * @param {!Array} aVariableDeclaration A variable declaration - * with an initialiser. - */ - cAddVariableDeclaration = function(aVariableDeclaration) { - (/** @type {!Array} */ oSourceElements[nFrom][1]).unshift( - aVariableDeclaration); - }; - - if (nFrom > nTo) { - return; - } - // If the range is a closure, reuse the closure. - if (nFrom === nTo && - 'stat' === oSourceElements[nFrom][0] && - 'call' === oSourceElements[nFrom][1][0] && - 'function' === oSourceElements[nFrom][1][1][0]) { - fExamineSyntacticCodeUnit(oSourceElements[nFrom][1][1]); - return; - } - // Create a list of all derived primitive values within the range. - for (nPosition = nFrom; nPosition <= nTo; nPosition += 1) { - aSourceElementsData[nPosition].aPrimitiveValues.forEach( - cAugmentList(oSourceElementsData.aPrimitiveValues)); - } - if (0 === oSourceElementsData.aPrimitiveValues.length) { - return; - } - for (nPosition = nFrom; nPosition <= nTo; nPosition += 1) { - // Add the number of occurrences to the total count. - fAddOccurrences(nPosition); - // Add identifiers of this or any nested scope to the list. - aSourceElementsData[nPosition].aIdentifiers.forEach( - cAugmentList(oSourceElementsData.aIdentifiers)); - } - // Distribute identifier names among derived primitive values. - do { // If there was any progress, find a better distribution. - oSolutionBest = oSolutionCandidate; - if (Object.keys(oSolutionCandidate.oPrimitiveValues).length > 0) { - // Sort primitive values descending by their worthwhileness. - oSourceElementsData.aPrimitiveValues.sort(cSortPrimitiveValues); - } - oSolutionCandidate = new TSolution(); - oSourceElementsData.aPrimitiveValues.forEach( - fEvaluatePrimitiveValue); - oScope.cname = nIndex; - } while (oSolutionCandidate.nSavings > oSolutionBest.nSavings); - // Take the necessity of adding a variable statement into account. - if ('var' !== oSourceElements[nFrom][0]) { - oSolutionBest.nSavings -= oWeights.N_VARIABLE_STATEMENT_AFFIXATION; - } - if (bEnclose) { - // Take the necessity of forming a closure into account. - oSolutionBest.nSavings -= oWeights.N_CLOSURE; - } - if (oSolutionBest.nSavings > 0) { - // Create variable declarations suitable for UglifyJS. - Object.keys(oSolutionBest.oPrimitiveValues).forEach( - cAugmentVariableDeclarations); - // Rewrite expressions that contain worthwhile primitive values. - for (nPosition = nFrom; nPosition <= nTo; nPosition += 1) { - oWalker = oProcessor.ast_walker(); - oSourceElements[nPosition] = - oWalker.with_walkers( - oWalkersTransformers, - cContext(oWalker, oSourceElements[nPosition])); - } - if ('var' === oSourceElements[nFrom][0]) { // Reuse the statement. - (/** @type {!Array.} */ aVariableDeclarations.reverse( - )).forEach(cAddVariableDeclaration); - } else { // Add a variable statement. - Array.prototype.splice.call( - oSourceElements, - nFrom, - 0, - ['var', aVariableDeclarations]); - nTo += 1; - } - if (bEnclose) { - // Add a closure. - Array.prototype.splice.call( - oSourceElements, - nFrom, - 0, - ['stat', ['call', ['function', null, [], []], []]]); - // Copy source elements into the closure. - for (nPosition = nTo + 1; nPosition > nFrom; nPosition -= 1) { - Array.prototype.unshift.call( - oSourceElements[nFrom][1][1][3], - oSourceElements[nPosition]); - } - // Remove source elements outside the closure. - Array.prototype.splice.call( - oSourceElements, - nFrom + 1, - nTo - nFrom + 1); - } - } - if (bEnclose) { - // Restore the availability of identifier names. - oScope.cname = nIndex; - } - }; - - oSourceElements = (/** @type {!TSyntacticCodeUnit} */ - oSyntacticCodeUnit[bIsGlobal ? 1 : 3]); - if (0 === oSourceElements.length) { - return; - } - oScope = bIsGlobal ? oSyntacticCodeUnit.scope : oSourceElements.scope; - // Skip a Directive Prologue. - while (nAfterDirectivePrologue < oSourceElements.length && - 'directive' === oSourceElements[nAfterDirectivePrologue][0]) { - nAfterDirectivePrologue += 1; - aSourceElementsData.push(null); - } - if (oSourceElements.length === nAfterDirectivePrologue) { - return; - } - for (nPosition = nAfterDirectivePrologue; - nPosition < oSourceElements.length; - nPosition += 1) { - oSourceElementData = new TSourceElementsData(); - oWalker = oProcessor.ast_walker(); - // Classify a source element. - // Find its derived primitive values and count their occurrences. - // Find all identifiers used (including nested scopes). - oWalker.with_walkers( - oWalkers.oSurveySourceElement, - cContext(oWalker, oSourceElements[nPosition])); - // Establish whether the scope is still wholly examinable. - bIsWhollyExaminable = bIsWhollyExaminable && - ESourceElementCategories.N_WITH !== oSourceElementData.nCategory && - ESourceElementCategories.N_EVAL !== oSourceElementData.nCategory; - aSourceElementsData.push(oSourceElementData); - } - if (bIsWhollyExaminable) { // Examine the whole scope. - fExamineSourceElements( - nAfterDirectivePrologue, - oSourceElements.length - 1, - false); - } else { // Examine unexcluded ranges of source elements. - for (nPosition = oSourceElements.length - 1; - nPosition >= nAfterDirectivePrologue; - nPosition -= 1) { - oSourceElementData = (/** @type {!TSourceElementsData} */ - aSourceElementsData[nPosition]); - if (ESourceElementCategories.N_OTHER === - oSourceElementData.nCategory) { - if ('undefined' === typeof nTo) { - nTo = nPosition; // Indicate the end of a range. - } - // Examine the range if it immediately follows a Directive Prologue. - if (nPosition === nAfterDirectivePrologue) { - fExamineSourceElements(nPosition, nTo, true); - } - } else { - if ('undefined' !== typeof nTo) { - // Examine the range that immediately follows this source element. - fExamineSourceElements(nPosition + 1, nTo, true); - nTo = void 0; // Obliterate the range. - } - // Examine nested functions. - oWalker = oProcessor.ast_walker(); - oWalker.with_walkers( - oWalkers.oExamineFunctions, - cContext(oWalker, oSourceElements[nPosition])); - } - } - } - }(oAbstractSyntaxTree = oProcessor.ast_add_scope(oAbstractSyntaxTree))); - return oAbstractSyntaxTree; -}; -/*jshint sub:false */ - -/* Local Variables: */ -/* mode: js */ -/* coding: utf-8 */ -/* indent-tabs-mode: nil */ -/* tab-width: 2 */ -/* End: */ -/* vim: set ft=javascript fenc=utf-8 et ts=2 sts=2 sw=2: */ -/* :mode=javascript:noTabs=true:tabSize=2:indentSize=2:deepIndent=true: */ -}); -define('uglifyjs/parse-js', ["exports"], function(exports) { -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - - This version is suitable for Node.js. With minimal changes (the - exports stuff) it should work on any JS platform. - - This file contains the tokenizer/parser. It is a port to JavaScript - of parse-js [1], a JavaScript parser library written in Common Lisp - by Marijn Haverbeke. Thank you Marijn! - - [1] http://marijn.haverbeke.nl/parse-js/ - - Exported functions: - - - tokenizer(code) -- returns a function. Call the returned - function to fetch the next token. - - - parse(code) -- returns an AST of the given JavaScript code. - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2010 (c) Mihai Bazon - Based on parse-js (http://marijn.haverbeke.nl/parse-js/). - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -/* -----[ Tokenizer (constants) ]----- */ - -var KEYWORDS = array_to_hash([ - "break", - "case", - "catch", - "const", - "continue", - "debugger", - "default", - "delete", - "do", - "else", - "finally", - "for", - "function", - "if", - "in", - "instanceof", - "new", - "return", - "switch", - "throw", - "try", - "typeof", - "var", - "void", - "while", - "with" -]); - -var RESERVED_WORDS = array_to_hash([ - "abstract", - "boolean", - "byte", - "char", - "class", - "double", - "enum", - "export", - "extends", - "final", - "float", - "goto", - "implements", - "import", - "int", - "interface", - "long", - "native", - "package", - "private", - "protected", - "public", - "short", - "static", - "super", - "synchronized", - "throws", - "transient", - "volatile" -]); - -var KEYWORDS_BEFORE_EXPRESSION = array_to_hash([ - "return", - "new", - "delete", - "throw", - "else", - "case" -]); - -var KEYWORDS_ATOM = array_to_hash([ - "false", - "null", - "true", - "undefined" -]); - -var OPERATOR_CHARS = array_to_hash(characters("+-*&%=<>!?|~^")); - -var RE_HEX_NUMBER = /^0x[0-9a-f]+$/i; -var RE_OCT_NUMBER = /^0[0-7]+$/; -var RE_DEC_NUMBER = /^\d*\.?\d*(?:e[+-]?\d*(?:\d\.?|\.?\d)\d*)?$/i; - -var OPERATORS = array_to_hash([ - "in", - "instanceof", - "typeof", - "new", - "void", - "delete", - "++", - "--", - "+", - "-", - "!", - "~", - "&", - "|", - "^", - "*", - "/", - "%", - ">>", - "<<", - ">>>", - "<", - ">", - "<=", - ">=", - "==", - "===", - "!=", - "!==", - "?", - "=", - "+=", - "-=", - "/=", - "*=", - "%=", - ">>=", - "<<=", - ">>>=", - "|=", - "^=", - "&=", - "&&", - "||" -]); - -var WHITESPACE_CHARS = array_to_hash(characters(" \u00a0\n\r\t\f\u000b\u200b\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\uFEFF")); - -var PUNC_BEFORE_EXPRESSION = array_to_hash(characters("[{(,.;:")); - -var PUNC_CHARS = array_to_hash(characters("[]{}(),;:")); - -var REGEXP_MODIFIERS = array_to_hash(characters("gmsiy")); - -/* -----[ Tokenizer ]----- */ - -var UNICODE = { // Unicode 6.1 - letter: new RegExp("[\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0\\u08A2-\\u08AC\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F0\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA697\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA80-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"), - combining_mark: new RegExp("[\\u0300-\\u036F\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065F\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u08E4-\\u08FE\\u0900-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B62\\u0B63\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0C01-\\u0C03\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C82\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0D02\\u0D03\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0D62\\u0D63\\u0D82\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102B-\\u103E\\u1056-\\u1059\\u105E-\\u1060\\u1062-\\u1064\\u1067-\\u106D\\u1071-\\u1074\\u1082-\\u108D\\u108F\\u109A-\\u109D\\u135D-\\u135F\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u180B-\\u180D\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u19B0-\\u19C0\\u19C8\\u19C9\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60-\\u1A7C\\u1A7F\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF2-\\u1CF4\\u1DC0-\\u1DE6\\u1DFC-\\u1DFF\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F\\uA674-\\uA67D\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA880\\uA881\\uA8B4-\\uA8C4\\uA8E0-\\uA8F1\\uA926-\\uA92D\\uA947-\\uA953\\uA980-\\uA983\\uA9B3-\\uA9C0\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA7B\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE26]"), - connector_punctuation: new RegExp("[\\u005F\\u203F\\u2040\\u2054\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF3F]"), - digit: new RegExp("[\\u0030-\\u0039\\u0660-\\u0669\\u06F0-\\u06F9\\u07C0-\\u07C9\\u0966-\\u096F\\u09E6-\\u09EF\\u0A66-\\u0A6F\\u0AE6-\\u0AEF\\u0B66-\\u0B6F\\u0BE6-\\u0BEF\\u0C66-\\u0C6F\\u0CE6-\\u0CEF\\u0D66-\\u0D6F\\u0E50-\\u0E59\\u0ED0-\\u0ED9\\u0F20-\\u0F29\\u1040-\\u1049\\u1090-\\u1099\\u17E0-\\u17E9\\u1810-\\u1819\\u1946-\\u194F\\u19D0-\\u19D9\\u1A80-\\u1A89\\u1A90-\\u1A99\\u1B50-\\u1B59\\u1BB0-\\u1BB9\\u1C40-\\u1C49\\u1C50-\\u1C59\\uA620-\\uA629\\uA8D0-\\uA8D9\\uA900-\\uA909\\uA9D0-\\uA9D9\\uAA50-\\uAA59\\uABF0-\\uABF9\\uFF10-\\uFF19]") -}; - -function is_letter(ch) { - return UNICODE.letter.test(ch); -}; - -function is_digit(ch) { - ch = ch.charCodeAt(0); - return ch >= 48 && ch <= 57; -}; - -function is_unicode_digit(ch) { - return UNICODE.digit.test(ch); -} - -function is_alphanumeric_char(ch) { - return is_digit(ch) || is_letter(ch); -}; - -function is_unicode_combining_mark(ch) { - return UNICODE.combining_mark.test(ch); -}; - -function is_unicode_connector_punctuation(ch) { - return UNICODE.connector_punctuation.test(ch); -}; - -function is_identifier_start(ch) { - return ch == "$" || ch == "_" || is_letter(ch); -}; - -function is_identifier_char(ch) { - return is_identifier_start(ch) - || is_unicode_combining_mark(ch) - || is_unicode_digit(ch) - || is_unicode_connector_punctuation(ch) - || ch == "\u200c" // zero-width non-joiner - || ch == "\u200d" // zero-width joiner (in my ECMA-262 PDF, this is also 200c) - ; -}; - -function parse_js_number(num) { - if (RE_HEX_NUMBER.test(num)) { - return parseInt(num.substr(2), 16); - } else if (RE_OCT_NUMBER.test(num)) { - return parseInt(num.substr(1), 8); - } else if (RE_DEC_NUMBER.test(num)) { - return parseFloat(num); - } -}; - -function JS_Parse_Error(message, line, col, pos) { - this.message = message; - this.line = line + 1; - this.col = col + 1; - this.pos = pos + 1; - this.stack = new Error().stack; -}; - -JS_Parse_Error.prototype.toString = function() { - return this.message + " (line: " + this.line + ", col: " + this.col + ", pos: " + this.pos + ")" + "\n\n" + this.stack; -}; - -function js_error(message, line, col, pos) { - throw new JS_Parse_Error(message, line, col, pos); -}; - -function is_token(token, type, val) { - return token.type == type && (val == null || token.value == val); -}; - -var EX_EOF = {}; - -function tokenizer($TEXT) { - - var S = { - text : $TEXT.replace(/\r\n?|[\n\u2028\u2029]/g, "\n").replace(/^\uFEFF/, ''), - pos : 0, - tokpos : 0, - line : 0, - tokline : 0, - col : 0, - tokcol : 0, - newline_before : false, - regex_allowed : false, - comments_before : [] - }; - - function peek() { return S.text.charAt(S.pos); }; - - function next(signal_eof, in_string) { - var ch = S.text.charAt(S.pos++); - if (signal_eof && !ch) - throw EX_EOF; - if (ch == "\n") { - S.newline_before = S.newline_before || !in_string; - ++S.line; - S.col = 0; - } else { - ++S.col; - } - return ch; - }; - - function eof() { - return !S.peek(); - }; - - function find(what, signal_eof) { - var pos = S.text.indexOf(what, S.pos); - if (signal_eof && pos == -1) throw EX_EOF; - return pos; - }; - - function start_token() { - S.tokline = S.line; - S.tokcol = S.col; - S.tokpos = S.pos; - }; - - function token(type, value, is_comment) { - S.regex_allowed = ((type == "operator" && !HOP(UNARY_POSTFIX, value)) || - (type == "keyword" && HOP(KEYWORDS_BEFORE_EXPRESSION, value)) || - (type == "punc" && HOP(PUNC_BEFORE_EXPRESSION, value))); - var ret = { - type : type, - value : value, - line : S.tokline, - col : S.tokcol, - pos : S.tokpos, - endpos : S.pos, - nlb : S.newline_before - }; - if (!is_comment) { - ret.comments_before = S.comments_before; - S.comments_before = []; - // make note of any newlines in the comments that came before - for (var i = 0, len = ret.comments_before.length; i < len; i++) { - ret.nlb = ret.nlb || ret.comments_before[i].nlb; - } - } - S.newline_before = false; - return ret; - }; - - function skip_whitespace() { - while (HOP(WHITESPACE_CHARS, peek())) - next(); - }; - - function read_while(pred) { - var ret = "", ch = peek(), i = 0; - while (ch && pred(ch, i++)) { - ret += next(); - ch = peek(); - } - return ret; - }; - - function parse_error(err) { - js_error(err, S.tokline, S.tokcol, S.tokpos); - }; - - function read_num(prefix) { - var has_e = false, after_e = false, has_x = false, has_dot = prefix == "."; - var num = read_while(function(ch, i){ - if (ch == "x" || ch == "X") { - if (has_x) return false; - return has_x = true; - } - if (!has_x && (ch == "E" || ch == "e")) { - if (has_e) return false; - return has_e = after_e = true; - } - if (ch == "-") { - if (after_e || (i == 0 && !prefix)) return true; - return false; - } - if (ch == "+") return after_e; - after_e = false; - if (ch == ".") { - if (!has_dot && !has_x && !has_e) - return has_dot = true; - return false; - } - return is_alphanumeric_char(ch); - }); - if (prefix) - num = prefix + num; - var valid = parse_js_number(num); - if (!isNaN(valid)) { - return token("num", valid); - } else { - parse_error("Invalid syntax: " + num); - } - }; - - function read_escaped_char(in_string) { - var ch = next(true, in_string); - switch (ch) { - case "n" : return "\n"; - case "r" : return "\r"; - case "t" : return "\t"; - case "b" : return "\b"; - case "v" : return "\u000b"; - case "f" : return "\f"; - case "0" : return "\0"; - case "x" : return String.fromCharCode(hex_bytes(2)); - case "u" : return String.fromCharCode(hex_bytes(4)); - case "\n": return ""; - default : return ch; - } - }; - - function hex_bytes(n) { - var num = 0; - for (; n > 0; --n) { - var digit = parseInt(next(true), 16); - if (isNaN(digit)) - parse_error("Invalid hex-character pattern in string"); - num = (num << 4) | digit; - } - return num; - }; - - function read_string() { - return with_eof_error("Unterminated string constant", function(){ - var quote = next(), ret = ""; - for (;;) { - var ch = next(true); - if (ch == "\\") { - // read OctalEscapeSequence (XXX: deprecated if "strict mode") - // https://github.com/mishoo/UglifyJS/issues/178 - var octal_len = 0, first = null; - ch = read_while(function(ch){ - if (ch >= "0" && ch <= "7") { - if (!first) { - first = ch; - return ++octal_len; - } - else if (first <= "3" && octal_len <= 2) return ++octal_len; - else if (first >= "4" && octal_len <= 1) return ++octal_len; - } - return false; - }); - if (octal_len > 0) ch = String.fromCharCode(parseInt(ch, 8)); - else ch = read_escaped_char(true); - } - else if (ch == quote) break; - else if (ch == "\n") throw EX_EOF; - ret += ch; - } - return token("string", ret); - }); - }; - - function read_line_comment() { - next(); - var i = find("\n"), ret; - if (i == -1) { - ret = S.text.substr(S.pos); - S.pos = S.text.length; - } else { - ret = S.text.substring(S.pos, i); - S.pos = i; - } - return token("comment1", ret, true); - }; - - function read_multiline_comment() { - next(); - return with_eof_error("Unterminated multiline comment", function(){ - var i = find("*/", true), - text = S.text.substring(S.pos, i); - S.pos = i + 2; - S.line += text.split("\n").length - 1; - S.newline_before = S.newline_before || text.indexOf("\n") >= 0; - - // https://github.com/mishoo/UglifyJS/issues/#issue/100 - if (/^@cc_on/i.test(text)) { - warn("WARNING: at line " + S.line); - warn("*** Found \"conditional comment\": " + text); - warn("*** UglifyJS DISCARDS ALL COMMENTS. This means your code might no longer work properly in Internet Explorer."); - } - - return token("comment2", text, true); - }); - }; - - function read_name() { - var backslash = false, name = "", ch, escaped = false, hex; - while ((ch = peek()) != null) { - if (!backslash) { - if (ch == "\\") escaped = backslash = true, next(); - else if (is_identifier_char(ch)) name += next(); - else break; - } - else { - if (ch != "u") parse_error("Expecting UnicodeEscapeSequence -- uXXXX"); - ch = read_escaped_char(); - if (!is_identifier_char(ch)) parse_error("Unicode char: " + ch.charCodeAt(0) + " is not valid in identifier"); - name += ch; - backslash = false; - } - } - if (HOP(KEYWORDS, name) && escaped) { - hex = name.charCodeAt(0).toString(16).toUpperCase(); - name = "\\u" + "0000".substr(hex.length) + hex + name.slice(1); - } - return name; - }; - - function read_regexp(regexp) { - return with_eof_error("Unterminated regular expression", function(){ - var prev_backslash = false, ch, in_class = false; - while ((ch = next(true))) if (prev_backslash) { - regexp += "\\" + ch; - prev_backslash = false; - } else if (ch == "[") { - in_class = true; - regexp += ch; - } else if (ch == "]" && in_class) { - in_class = false; - regexp += ch; - } else if (ch == "/" && !in_class) { - break; - } else if (ch == "\\") { - prev_backslash = true; - } else { - regexp += ch; - } - var mods = read_name(); - return token("regexp", [ regexp, mods ]); - }); - }; - - function read_operator(prefix) { - function grow(op) { - if (!peek()) return op; - var bigger = op + peek(); - if (HOP(OPERATORS, bigger)) { - next(); - return grow(bigger); - } else { - return op; - } - }; - return token("operator", grow(prefix || next())); - }; - - function handle_slash() { - next(); - var regex_allowed = S.regex_allowed; - switch (peek()) { - case "/": - S.comments_before.push(read_line_comment()); - S.regex_allowed = regex_allowed; - return next_token(); - case "*": - S.comments_before.push(read_multiline_comment()); - S.regex_allowed = regex_allowed; - return next_token(); - } - return S.regex_allowed ? read_regexp("") : read_operator("/"); - }; - - function handle_dot() { - next(); - return is_digit(peek()) - ? read_num(".") - : token("punc", "."); - }; - - function read_word() { - var word = read_name(); - return !HOP(KEYWORDS, word) - ? token("name", word) - : HOP(OPERATORS, word) - ? token("operator", word) - : HOP(KEYWORDS_ATOM, word) - ? token("atom", word) - : token("keyword", word); - }; - - function with_eof_error(eof_error, cont) { - try { - return cont(); - } catch(ex) { - if (ex === EX_EOF) parse_error(eof_error); - else throw ex; - } - }; - - function next_token(force_regexp) { - if (force_regexp != null) - return read_regexp(force_regexp); - skip_whitespace(); - start_token(); - var ch = peek(); - if (!ch) return token("eof"); - if (is_digit(ch)) return read_num(); - if (ch == '"' || ch == "'") return read_string(); - if (HOP(PUNC_CHARS, ch)) return token("punc", next()); - if (ch == ".") return handle_dot(); - if (ch == "/") return handle_slash(); - if (HOP(OPERATOR_CHARS, ch)) return read_operator(); - if (ch == "\\" || is_identifier_start(ch)) return read_word(); - parse_error("Unexpected character '" + ch + "'"); - }; - - next_token.context = function(nc) { - if (nc) S = nc; - return S; - }; - - return next_token; - -}; - -/* -----[ Parser (constants) ]----- */ - -var UNARY_PREFIX = array_to_hash([ - "typeof", - "void", - "delete", - "--", - "++", - "!", - "~", - "-", - "+" -]); - -var UNARY_POSTFIX = array_to_hash([ "--", "++" ]); - -var ASSIGNMENT = (function(a, ret, i){ - while (i < a.length) { - ret[a[i]] = a[i].substr(0, a[i].length - 1); - i++; - } - return ret; -})( - ["+=", "-=", "/=", "*=", "%=", ">>=", "<<=", ">>>=", "|=", "^=", "&="], - { "=": true }, - 0 -); - -var PRECEDENCE = (function(a, ret){ - for (var i = 0, n = 1; i < a.length; ++i, ++n) { - var b = a[i]; - for (var j = 0; j < b.length; ++j) { - ret[b[j]] = n; - } - } - return ret; -})( - [ - ["||"], - ["&&"], - ["|"], - ["^"], - ["&"], - ["==", "===", "!=", "!=="], - ["<", ">", "<=", ">=", "in", "instanceof"], - [">>", "<<", ">>>"], - ["+", "-"], - ["*", "/", "%"] - ], - {} -); - -var STATEMENTS_WITH_LABELS = array_to_hash([ "for", "do", "while", "switch" ]); - -var ATOMIC_START_TOKEN = array_to_hash([ "atom", "num", "string", "regexp", "name" ]); - -/* -----[ Parser ]----- */ - -function NodeWithToken(str, start, end) { - this.name = str; - this.start = start; - this.end = end; -}; - -NodeWithToken.prototype.toString = function() { return this.name; }; - -function parse($TEXT, exigent_mode, embed_tokens) { - - var S = { - input : typeof $TEXT == "string" ? tokenizer($TEXT, true) : $TEXT, - token : null, - prev : null, - peeked : null, - in_function : 0, - in_directives : true, - in_loop : 0, - labels : [] - }; - - S.token = next(); - - function is(type, value) { - return is_token(S.token, type, value); - }; - - function peek() { return S.peeked || (S.peeked = S.input()); }; - - function next() { - S.prev = S.token; - if (S.peeked) { - S.token = S.peeked; - S.peeked = null; - } else { - S.token = S.input(); - } - S.in_directives = S.in_directives && ( - S.token.type == "string" || is("punc", ";") - ); - return S.token; - }; - - function prev() { - return S.prev; - }; - - function croak(msg, line, col, pos) { - var ctx = S.input.context(); - js_error(msg, - line != null ? line : ctx.tokline, - col != null ? col : ctx.tokcol, - pos != null ? pos : ctx.tokpos); - }; - - function token_error(token, msg) { - croak(msg, token.line, token.col); - }; - - function unexpected(token) { - if (token == null) - token = S.token; - token_error(token, "Unexpected token: " + token.type + " (" + token.value + ")"); - }; - - function expect_token(type, val) { - if (is(type, val)) { - return next(); - } - token_error(S.token, "Unexpected token " + S.token.type + ", expected " + type); - }; - - function expect(punc) { return expect_token("punc", punc); }; - - function can_insert_semicolon() { - return !exigent_mode && ( - S.token.nlb || is("eof") || is("punc", "}") - ); - }; - - function semicolon() { - if (is("punc", ";")) next(); - else if (!can_insert_semicolon()) unexpected(); - }; - - function as() { - return slice(arguments); - }; - - function parenthesised() { - expect("("); - var ex = expression(); - expect(")"); - return ex; - }; - - function add_tokens(str, start, end) { - return str instanceof NodeWithToken ? str : new NodeWithToken(str, start, end); - }; - - function maybe_embed_tokens(parser) { - if (embed_tokens) return function() { - var start = S.token; - var ast = parser.apply(this, arguments); - ast[0] = add_tokens(ast[0], start, prev()); - return ast; - }; - else return parser; - }; - - var statement = maybe_embed_tokens(function() { - if (is("operator", "/") || is("operator", "/=")) { - S.peeked = null; - S.token = S.input(S.token.value.substr(1)); // force regexp - } - switch (S.token.type) { - case "string": - var dir = S.in_directives, stat = simple_statement(); - if (dir && stat[1][0] == "string" && !is("punc", ",")) - return as("directive", stat[1][1]); - return stat; - case "num": - case "regexp": - case "operator": - case "atom": - return simple_statement(); - - case "name": - return is_token(peek(), "punc", ":") - ? labeled_statement(prog1(S.token.value, next, next)) - : simple_statement(); - - case "punc": - switch (S.token.value) { - case "{": - return as("block", block_()); - case "[": - case "(": - return simple_statement(); - case ";": - next(); - return as("block"); - default: - unexpected(); - } - - case "keyword": - switch (prog1(S.token.value, next)) { - case "break": - return break_cont("break"); - - case "continue": - return break_cont("continue"); - - case "debugger": - semicolon(); - return as("debugger"); - - case "do": - return (function(body){ - expect_token("keyword", "while"); - return as("do", prog1(parenthesised, semicolon), body); - })(in_loop(statement)); - - case "for": - return for_(); - - case "function": - return function_(true); - - case "if": - return if_(); - - case "return": - if (S.in_function == 0) - croak("'return' outside of function"); - return as("return", - is("punc", ";") - ? (next(), null) - : can_insert_semicolon() - ? null - : prog1(expression, semicolon)); - - case "switch": - return as("switch", parenthesised(), switch_block_()); - - case "throw": - if (S.token.nlb) - croak("Illegal newline after 'throw'"); - return as("throw", prog1(expression, semicolon)); - - case "try": - return try_(); - - case "var": - return prog1(var_, semicolon); - - case "const": - return prog1(const_, semicolon); - - case "while": - return as("while", parenthesised(), in_loop(statement)); - - case "with": - return as("with", parenthesised(), statement()); - - default: - unexpected(); - } - } - }); - - function labeled_statement(label) { - S.labels.push(label); - var start = S.token, stat = statement(); - if (exigent_mode && !HOP(STATEMENTS_WITH_LABELS, stat[0])) - unexpected(start); - S.labels.pop(); - return as("label", label, stat); - }; - - function simple_statement() { - return as("stat", prog1(expression, semicolon)); - }; - - function break_cont(type) { - var name; - if (!can_insert_semicolon()) { - name = is("name") ? S.token.value : null; - } - if (name != null) { - next(); - if (!member(name, S.labels)) - croak("Label " + name + " without matching loop or statement"); - } - else if (S.in_loop == 0) - croak(type + " not inside a loop or switch"); - semicolon(); - return as(type, name); - }; - - function for_() { - expect("("); - var init = null; - if (!is("punc", ";")) { - init = is("keyword", "var") - ? (next(), var_(true)) - : expression(true, true); - if (is("operator", "in")) { - if (init[0] == "var" && init[1].length > 1) - croak("Only one variable declaration allowed in for..in loop"); - return for_in(init); - } - } - return regular_for(init); - }; - - function regular_for(init) { - expect(";"); - var test = is("punc", ";") ? null : expression(); - expect(";"); - var step = is("punc", ")") ? null : expression(); - expect(")"); - return as("for", init, test, step, in_loop(statement)); - }; - - function for_in(init) { - var lhs = init[0] == "var" ? as("name", init[1][0]) : init; - next(); - var obj = expression(); - expect(")"); - return as("for-in", init, lhs, obj, in_loop(statement)); - }; - - var function_ = function(in_statement) { - var name = is("name") ? prog1(S.token.value, next) : null; - if (in_statement && !name) - unexpected(); - expect("("); - return as(in_statement ? "defun" : "function", - name, - // arguments - (function(first, a){ - while (!is("punc", ")")) { - if (first) first = false; else expect(","); - if (!is("name")) unexpected(); - a.push(S.token.value); - next(); - } - next(); - return a; - })(true, []), - // body - (function(){ - ++S.in_function; - var loop = S.in_loop; - S.in_directives = true; - S.in_loop = 0; - var a = block_(); - --S.in_function; - S.in_loop = loop; - return a; - })()); - }; - - function if_() { - var cond = parenthesised(), body = statement(), belse; - if (is("keyword", "else")) { - next(); - belse = statement(); - } - return as("if", cond, body, belse); - }; - - function block_() { - expect("{"); - var a = []; - while (!is("punc", "}")) { - if (is("eof")) unexpected(); - a.push(statement()); - } - next(); - return a; - }; - - var switch_block_ = curry(in_loop, function(){ - expect("{"); - var a = [], cur = null; - while (!is("punc", "}")) { - if (is("eof")) unexpected(); - if (is("keyword", "case")) { - next(); - cur = []; - a.push([ expression(), cur ]); - expect(":"); - } - else if (is("keyword", "default")) { - next(); - expect(":"); - cur = []; - a.push([ null, cur ]); - } - else { - if (!cur) unexpected(); - cur.push(statement()); - } - } - next(); - return a; - }); - - function try_() { - var body = block_(), bcatch, bfinally; - if (is("keyword", "catch")) { - next(); - expect("("); - if (!is("name")) - croak("Name expected"); - var name = S.token.value; - next(); - expect(")"); - bcatch = [ name, block_() ]; - } - if (is("keyword", "finally")) { - next(); - bfinally = block_(); - } - if (!bcatch && !bfinally) - croak("Missing catch/finally blocks"); - return as("try", body, bcatch, bfinally); - }; - - function vardefs(no_in) { - var a = []; - for (;;) { - if (!is("name")) - unexpected(); - var name = S.token.value; - next(); - if (is("operator", "=")) { - next(); - a.push([ name, expression(false, no_in) ]); - } else { - a.push([ name ]); - } - if (!is("punc", ",")) - break; - next(); - } - return a; - }; - - function var_(no_in) { - return as("var", vardefs(no_in)); - }; - - function const_() { - return as("const", vardefs()); - }; - - function new_() { - var newexp = expr_atom(false), args; - if (is("punc", "(")) { - next(); - args = expr_list(")"); - } else { - args = []; - } - return subscripts(as("new", newexp, args), true); - }; - - var expr_atom = maybe_embed_tokens(function(allow_calls) { - if (is("operator", "new")) { - next(); - return new_(); - } - if (is("punc")) { - switch (S.token.value) { - case "(": - next(); - return subscripts(prog1(expression, curry(expect, ")")), allow_calls); - case "[": - next(); - return subscripts(array_(), allow_calls); - case "{": - next(); - return subscripts(object_(), allow_calls); - } - unexpected(); - } - if (is("keyword", "function")) { - next(); - return subscripts(function_(false), allow_calls); - } - if (HOP(ATOMIC_START_TOKEN, S.token.type)) { - var atom = S.token.type == "regexp" - ? as("regexp", S.token.value[0], S.token.value[1]) - : as(S.token.type, S.token.value); - return subscripts(prog1(atom, next), allow_calls); - } - unexpected(); - }); - - function expr_list(closing, allow_trailing_comma, allow_empty) { - var first = true, a = []; - while (!is("punc", closing)) { - if (first) first = false; else expect(","); - if (allow_trailing_comma && is("punc", closing)) break; - if (is("punc", ",") && allow_empty) { - a.push([ "atom", "undefined" ]); - } else { - a.push(expression(false)); - } - } - next(); - return a; - }; - - function array_() { - return as("array", expr_list("]", !exigent_mode, true)); - }; - - function object_() { - var first = true, a = []; - while (!is("punc", "}")) { - if (first) first = false; else expect(","); - if (!exigent_mode && is("punc", "}")) - // allow trailing comma - break; - var type = S.token.type; - var name = as_property_name(); - if (type == "name" && (name == "get" || name == "set") && !is("punc", ":")) { - a.push([ as_name(), function_(false), name ]); - } else { - expect(":"); - a.push([ name, expression(false) ]); - } - } - next(); - return as("object", a); - }; - - function as_property_name() { - switch (S.token.type) { - case "num": - case "string": - return prog1(S.token.value, next); - } - return as_name(); - }; - - function as_name() { - switch (S.token.type) { - case "name": - case "operator": - case "keyword": - case "atom": - return prog1(S.token.value, next); - default: - unexpected(); - } - }; - - function subscripts(expr, allow_calls) { - if (is("punc", ".")) { - next(); - return subscripts(as("dot", expr, as_name()), allow_calls); - } - if (is("punc", "[")) { - next(); - return subscripts(as("sub", expr, prog1(expression, curry(expect, "]"))), allow_calls); - } - if (allow_calls && is("punc", "(")) { - next(); - return subscripts(as("call", expr, expr_list(")")), true); - } - return expr; - }; - - function maybe_unary(allow_calls) { - if (is("operator") && HOP(UNARY_PREFIX, S.token.value)) { - return make_unary("unary-prefix", - prog1(S.token.value, next), - maybe_unary(allow_calls)); - } - var val = expr_atom(allow_calls); - while (is("operator") && HOP(UNARY_POSTFIX, S.token.value) && !S.token.nlb) { - val = make_unary("unary-postfix", S.token.value, val); - next(); - } - return val; - }; - - function make_unary(tag, op, expr) { - if ((op == "++" || op == "--") && !is_assignable(expr)) - croak("Invalid use of " + op + " operator"); - return as(tag, op, expr); - }; - - function expr_op(left, min_prec, no_in) { - var op = is("operator") ? S.token.value : null; - if (op && op == "in" && no_in) op = null; - var prec = op != null ? PRECEDENCE[op] : null; - if (prec != null && prec > min_prec) { - next(); - var right = expr_op(maybe_unary(true), prec, no_in); - return expr_op(as("binary", op, left, right), min_prec, no_in); - } - return left; - }; - - function expr_ops(no_in) { - return expr_op(maybe_unary(true), 0, no_in); - }; - - function maybe_conditional(no_in) { - var expr = expr_ops(no_in); - if (is("operator", "?")) { - next(); - var yes = expression(false); - expect(":"); - return as("conditional", expr, yes, expression(false, no_in)); - } - return expr; - }; - - function is_assignable(expr) { - if (!exigent_mode) return true; - switch (expr[0]+"") { - case "dot": - case "sub": - case "new": - case "call": - return true; - case "name": - return expr[1] != "this"; - } - }; - - function maybe_assign(no_in) { - var left = maybe_conditional(no_in), val = S.token.value; - if (is("operator") && HOP(ASSIGNMENT, val)) { - if (is_assignable(left)) { - next(); - return as("assign", ASSIGNMENT[val], left, maybe_assign(no_in)); - } - croak("Invalid assignment"); - } - return left; - }; - - var expression = maybe_embed_tokens(function(commas, no_in) { - if (arguments.length == 0) - commas = true; - var expr = maybe_assign(no_in); - if (commas && is("punc", ",")) { - next(); - return as("seq", expr, expression(true, no_in)); - } - return expr; - }); - - function in_loop(cont) { - try { - ++S.in_loop; - return cont(); - } finally { - --S.in_loop; - } - }; - - return as("toplevel", (function(a){ - while (!is("eof")) - a.push(statement()); - return a; - })([])); - -}; - -/* -----[ Utilities ]----- */ - -function curry(f) { - var args = slice(arguments, 1); - return function() { return f.apply(this, args.concat(slice(arguments))); }; -}; - -function prog1(ret) { - if (ret instanceof Function) - ret = ret(); - for (var i = 1, n = arguments.length; --n > 0; ++i) - arguments[i](); - return ret; -}; - -function array_to_hash(a) { - var ret = {}; - for (var i = 0; i < a.length; ++i) - ret[a[i]] = true; - return ret; -}; - -function slice(a, start) { - return Array.prototype.slice.call(a, start || 0); -}; - -function characters(str) { - return str.split(""); -}; - -function member(name, array) { - for (var i = array.length; --i >= 0;) - if (array[i] == name) - return true; - return false; -}; - -function HOP(obj, prop) { - return Object.prototype.hasOwnProperty.call(obj, prop); -}; - -var warn = function() {}; - -/* -----[ Exports ]----- */ - -exports.tokenizer = tokenizer; -exports.parse = parse; -exports.slice = slice; -exports.curry = curry; -exports.member = member; -exports.array_to_hash = array_to_hash; -exports.PRECEDENCE = PRECEDENCE; -exports.KEYWORDS_ATOM = KEYWORDS_ATOM; -exports.RESERVED_WORDS = RESERVED_WORDS; -exports.KEYWORDS = KEYWORDS; -exports.ATOMIC_START_TOKEN = ATOMIC_START_TOKEN; -exports.OPERATORS = OPERATORS; -exports.is_alphanumeric_char = is_alphanumeric_char; -exports.is_identifier_start = is_identifier_start; -exports.is_identifier_char = is_identifier_char; -exports.set_logger = function(logger) { - warn = logger; -}; - -// Local variables: -// js-indent-level: 4 -// End: -});define('uglifyjs/squeeze-more', ["require", "exports", "module", "./parse-js", "./squeeze-more"], function(require, exports, module) { -var jsp = require("./parse-js"), - pro = require("./process"), - slice = jsp.slice, - member = jsp.member, - curry = jsp.curry, - MAP = pro.MAP, - PRECEDENCE = jsp.PRECEDENCE, - OPERATORS = jsp.OPERATORS; - -function ast_squeeze_more(ast) { - var w = pro.ast_walker(), walk = w.walk, scope; - function with_scope(s, cont) { - var save = scope, ret; - scope = s; - ret = cont(); - scope = save; - return ret; - }; - function _lambda(name, args, body) { - return [ this[0], name, args, with_scope(body.scope, curry(MAP, body, walk)) ]; - }; - return w.with_walkers({ - "toplevel": function(body) { - return [ this[0], with_scope(this.scope, curry(MAP, body, walk)) ]; - }, - "function": _lambda, - "defun": _lambda, - "new": function(ctor, args) { - if (ctor[0] == "name") { - if (ctor[1] == "Array" && !scope.has("Array")) { - if (args.length != 1) { - return [ "array", args ]; - } else { - return walk([ "call", [ "name", "Array" ], args ]); - } - } else if (ctor[1] == "Object" && !scope.has("Object")) { - if (!args.length) { - return [ "object", [] ]; - } else { - return walk([ "call", [ "name", "Object" ], args ]); - } - } else if ((ctor[1] == "RegExp" || ctor[1] == "Function" || ctor[1] == "Error") && !scope.has(ctor[1])) { - return walk([ "call", [ "name", ctor[1] ], args]); - } - } - }, - "call": function(expr, args) { - if (expr[0] == "dot" && expr[1][0] == "string" && args.length == 1 - && (args[0][1] > 0 && expr[2] == "substring" || expr[2] == "substr")) { - return [ "call", [ "dot", expr[1], "slice"], args]; - } - if (expr[0] == "dot" && expr[2] == "toString" && args.length == 0) { - // foo.toString() ==> foo+"" - if (expr[1][0] == "string") return expr[1]; - return [ "binary", "+", expr[1], [ "string", "" ]]; - } - if (expr[0] == "name") { - if (expr[1] == "Array" && args.length != 1 && !scope.has("Array")) { - return [ "array", args ]; - } - if (expr[1] == "Object" && !args.length && !scope.has("Object")) { - return [ "object", [] ]; - } - if (expr[1] == "String" && !scope.has("String")) { - return [ "binary", "+", args[0], [ "string", "" ]]; - } - } - } - }, function() { - return walk(pro.ast_add_scope(ast)); - }); -}; - -exports.ast_squeeze_more = ast_squeeze_more; - -// Local variables: -// js-indent-level: 4 -// End: -}); -define('uglifyjs/process', ["require", "exports", "module", "./parse-js", "./squeeze-more"], function(require, exports, module) { -/*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - - This version is suitable for Node.js. With minimal changes (the - exports stuff) it should work on any JS platform. - - This file implements some AST processors. They work on data built - by parse-js. - - Exported functions: - - - ast_mangle(ast, options) -- mangles the variable/function names - in the AST. Returns an AST. - - - ast_squeeze(ast) -- employs various optimizations to make the - final generated code even smaller. Returns an AST. - - - gen_code(ast, options) -- generates JS code from the AST. Pass - true (or an object, see the code for some options) as second - argument to get "pretty" (indented) code. - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2010 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -var jsp = require("./parse-js"), - curry = jsp.curry, - slice = jsp.slice, - member = jsp.member, - is_identifier_char = jsp.is_identifier_char, - PRECEDENCE = jsp.PRECEDENCE, - OPERATORS = jsp.OPERATORS; - -/* -----[ helper for AST traversal ]----- */ - -function ast_walker() { - function _vardefs(defs) { - return [ this[0], MAP(defs, function(def){ - var a = [ def[0] ]; - if (def.length > 1) - a[1] = walk(def[1]); - return a; - }) ]; - }; - function _block(statements) { - var out = [ this[0] ]; - if (statements != null) - out.push(MAP(statements, walk)); - return out; - }; - var walkers = { - "string": function(str) { - return [ this[0], str ]; - }, - "num": function(num) { - return [ this[0], num ]; - }, - "name": function(name) { - return [ this[0], name ]; - }, - "toplevel": function(statements) { - return [ this[0], MAP(statements, walk) ]; - }, - "block": _block, - "splice": _block, - "var": _vardefs, - "const": _vardefs, - "try": function(t, c, f) { - return [ - this[0], - MAP(t, walk), - c != null ? [ c[0], MAP(c[1], walk) ] : null, - f != null ? MAP(f, walk) : null - ]; - }, - "throw": function(expr) { - return [ this[0], walk(expr) ]; - }, - "new": function(ctor, args) { - return [ this[0], walk(ctor), MAP(args, walk) ]; - }, - "switch": function(expr, body) { - return [ this[0], walk(expr), MAP(body, function(branch){ - return [ branch[0] ? walk(branch[0]) : null, - MAP(branch[1], walk) ]; - }) ]; - }, - "break": function(label) { - return [ this[0], label ]; - }, - "continue": function(label) { - return [ this[0], label ]; - }, - "conditional": function(cond, t, e) { - return [ this[0], walk(cond), walk(t), walk(e) ]; - }, - "assign": function(op, lvalue, rvalue) { - return [ this[0], op, walk(lvalue), walk(rvalue) ]; - }, - "dot": function(expr) { - return [ this[0], walk(expr) ].concat(slice(arguments, 1)); - }, - "call": function(expr, args) { - return [ this[0], walk(expr), MAP(args, walk) ]; - }, - "function": function(name, args, body) { - return [ this[0], name, args.slice(), MAP(body, walk) ]; - }, - "debugger": function() { - return [ this[0] ]; - }, - "defun": function(name, args, body) { - return [ this[0], name, args.slice(), MAP(body, walk) ]; - }, - "if": function(conditional, t, e) { - return [ this[0], walk(conditional), walk(t), walk(e) ]; - }, - "for": function(init, cond, step, block) { - return [ this[0], walk(init), walk(cond), walk(step), walk(block) ]; - }, - "for-in": function(vvar, key, hash, block) { - return [ this[0], walk(vvar), walk(key), walk(hash), walk(block) ]; - }, - "while": function(cond, block) { - return [ this[0], walk(cond), walk(block) ]; - }, - "do": function(cond, block) { - return [ this[0], walk(cond), walk(block) ]; - }, - "return": function(expr) { - return [ this[0], walk(expr) ]; - }, - "binary": function(op, left, right) { - return [ this[0], op, walk(left), walk(right) ]; - }, - "unary-prefix": function(op, expr) { - return [ this[0], op, walk(expr) ]; - }, - "unary-postfix": function(op, expr) { - return [ this[0], op, walk(expr) ]; - }, - "sub": function(expr, subscript) { - return [ this[0], walk(expr), walk(subscript) ]; - }, - "object": function(props) { - return [ this[0], MAP(props, function(p){ - return p.length == 2 - ? [ p[0], walk(p[1]) ] - : [ p[0], walk(p[1]), p[2] ]; // get/set-ter - }) ]; - }, - "regexp": function(rx, mods) { - return [ this[0], rx, mods ]; - }, - "array": function(elements) { - return [ this[0], MAP(elements, walk) ]; - }, - "stat": function(stat) { - return [ this[0], walk(stat) ]; - }, - "seq": function() { - return [ this[0] ].concat(MAP(slice(arguments), walk)); - }, - "label": function(name, block) { - return [ this[0], name, walk(block) ]; - }, - "with": function(expr, block) { - return [ this[0], walk(expr), walk(block) ]; - }, - "atom": function(name) { - return [ this[0], name ]; - }, - "directive": function(dir) { - return [ this[0], dir ]; - } - }; - - var user = {}; - var stack = []; - function walk(ast) { - if (ast == null) - return null; - try { - stack.push(ast); - var type = ast[0]; - var gen = user[type]; - if (gen) { - var ret = gen.apply(ast, ast.slice(1)); - if (ret != null) - return ret; - } - gen = walkers[type]; - return gen.apply(ast, ast.slice(1)); - } finally { - stack.pop(); - } - }; - - function dive(ast) { - if (ast == null) - return null; - try { - stack.push(ast); - return walkers[ast[0]].apply(ast, ast.slice(1)); - } finally { - stack.pop(); - } - }; - - function with_walkers(walkers, cont){ - var save = {}, i; - for (i in walkers) if (HOP(walkers, i)) { - save[i] = user[i]; - user[i] = walkers[i]; - } - var ret = cont(); - for (i in save) if (HOP(save, i)) { - if (!save[i]) delete user[i]; - else user[i] = save[i]; - } - return ret; - }; - - return { - walk: walk, - dive: dive, - with_walkers: with_walkers, - parent: function() { - return stack[stack.length - 2]; // last one is current node - }, - stack: function() { - return stack; - } - }; -}; - -/* -----[ Scope and mangling ]----- */ - -function Scope(parent) { - this.names = {}; // names defined in this scope - this.mangled = {}; // mangled names (orig.name => mangled) - this.rev_mangled = {}; // reverse lookup (mangled => orig.name) - this.cname = -1; // current mangled name - this.refs = {}; // names referenced from this scope - this.uses_with = false; // will become TRUE if with() is detected in this or any subscopes - this.uses_eval = false; // will become TRUE if eval() is detected in this or any subscopes - this.directives = []; // directives activated from this scope - this.parent = parent; // parent scope - this.children = []; // sub-scopes - if (parent) { - this.level = parent.level + 1; - parent.children.push(this); - } else { - this.level = 0; - } -}; - -function base54_digits() { - if (typeof DIGITS_OVERRIDE_FOR_TESTING != "undefined") - return DIGITS_OVERRIDE_FOR_TESTING; - else - return "etnrisouaflchpdvmgybwESxTNCkLAOM_DPHBjFIqRUzWXV$JKQGYZ0516372984"; -} - -var base54 = (function(){ - var DIGITS = base54_digits(); - return function(num) { - var ret = "", base = 54; - do { - ret += DIGITS.charAt(num % base); - num = Math.floor(num / base); - base = 64; - } while (num > 0); - return ret; - }; -})(); - -Scope.prototype = { - has: function(name) { - for (var s = this; s; s = s.parent) - if (HOP(s.names, name)) - return s; - }, - has_mangled: function(mname) { - for (var s = this; s; s = s.parent) - if (HOP(s.rev_mangled, mname)) - return s; - }, - toJSON: function() { - return { - names: this.names, - uses_eval: this.uses_eval, - uses_with: this.uses_with - }; - }, - - next_mangled: function() { - // we must be careful that the new mangled name: - // - // 1. doesn't shadow a mangled name from a parent - // scope, unless we don't reference the original - // name from this scope OR from any sub-scopes! - // This will get slow. - // - // 2. doesn't shadow an original name from a parent - // scope, in the event that the name is not mangled - // in the parent scope and we reference that name - // here OR IN ANY SUBSCOPES! - // - // 3. doesn't shadow a name that is referenced but not - // defined (possibly global defined elsewhere). - for (;;) { - var m = base54(++this.cname), prior; - - // case 1. - prior = this.has_mangled(m); - if (prior && this.refs[prior.rev_mangled[m]] === prior) - continue; - - // case 2. - prior = this.has(m); - if (prior && prior !== this && this.refs[m] === prior && !prior.has_mangled(m)) - continue; - - // case 3. - if (HOP(this.refs, m) && this.refs[m] == null) - continue; - - // I got "do" once. :-/ - if (!is_identifier(m)) - continue; - - return m; - } - }, - set_mangle: function(name, m) { - this.rev_mangled[m] = name; - return this.mangled[name] = m; - }, - get_mangled: function(name, newMangle) { - if (this.uses_eval || this.uses_with) return name; // no mangle if eval or with is in use - var s = this.has(name); - if (!s) return name; // not in visible scope, no mangle - if (HOP(s.mangled, name)) return s.mangled[name]; // already mangled in this scope - if (!newMangle) return name; // not found and no mangling requested - return s.set_mangle(name, s.next_mangled()); - }, - references: function(name) { - return name && !this.parent || this.uses_with || this.uses_eval || this.refs[name]; - }, - define: function(name, type) { - if (name != null) { - if (type == "var" || !HOP(this.names, name)) - this.names[name] = type || "var"; - return name; - } - }, - active_directive: function(dir) { - return member(dir, this.directives) || this.parent && this.parent.active_directive(dir); - } -}; - -function ast_add_scope(ast) { - - var current_scope = null; - var w = ast_walker(), walk = w.walk; - var having_eval = []; - - function with_new_scope(cont) { - current_scope = new Scope(current_scope); - current_scope.labels = new Scope(); - var ret = current_scope.body = cont(); - ret.scope = current_scope; - current_scope = current_scope.parent; - return ret; - }; - - function define(name, type) { - return current_scope.define(name, type); - }; - - function reference(name) { - current_scope.refs[name] = true; - }; - - function _lambda(name, args, body) { - var is_defun = this[0] == "defun"; - return [ this[0], is_defun ? define(name, "defun") : name, args, with_new_scope(function(){ - if (!is_defun) define(name, "lambda"); - MAP(args, function(name){ define(name, "arg") }); - return MAP(body, walk); - })]; - }; - - function _vardefs(type) { - return function(defs) { - MAP(defs, function(d){ - define(d[0], type); - if (d[1]) reference(d[0]); - }); - }; - }; - - function _breacont(label) { - if (label) - current_scope.labels.refs[label] = true; - }; - - return with_new_scope(function(){ - // process AST - var ret = w.with_walkers({ - "function": _lambda, - "defun": _lambda, - "label": function(name, stat) { current_scope.labels.define(name) }, - "break": _breacont, - "continue": _breacont, - "with": function(expr, block) { - for (var s = current_scope; s; s = s.parent) - s.uses_with = true; - }, - "var": _vardefs("var"), - "const": _vardefs("const"), - "try": function(t, c, f) { - if (c != null) return [ - this[0], - MAP(t, walk), - [ define(c[0], "catch"), MAP(c[1], walk) ], - f != null ? MAP(f, walk) : null - ]; - }, - "name": function(name) { - if (name == "eval") - having_eval.push(current_scope); - reference(name); - } - }, function(){ - return walk(ast); - }); - - // the reason why we need an additional pass here is - // that names can be used prior to their definition. - - // scopes where eval was detected and their parents - // are marked with uses_eval, unless they define the - // "eval" name. - MAP(having_eval, function(scope){ - if (!scope.has("eval")) while (scope) { - scope.uses_eval = true; - scope = scope.parent; - } - }); - - // for referenced names it might be useful to know - // their origin scope. current_scope here is the - // toplevel one. - function fixrefs(scope, i) { - // do children first; order shouldn't matter - for (i = scope.children.length; --i >= 0;) - fixrefs(scope.children[i]); - for (i in scope.refs) if (HOP(scope.refs, i)) { - // find origin scope and propagate the reference to origin - for (var origin = scope.has(i), s = scope; s; s = s.parent) { - s.refs[i] = origin; - if (s === origin) break; - } - } - }; - fixrefs(current_scope); - - return ret; - }); - -}; - -/* -----[ mangle names ]----- */ - -function ast_mangle(ast, options) { - var w = ast_walker(), walk = w.walk, scope; - options = defaults(options, { - mangle : true, - toplevel : false, - defines : null, - except : null, - no_functions : false - }); - - function get_mangled(name, newMangle) { - if (!options.mangle) return name; - if (!options.toplevel && !scope.parent) return name; // don't mangle toplevel - if (options.except && member(name, options.except)) - return name; - if (options.no_functions && HOP(scope.names, name) && - (scope.names[name] == 'defun' || scope.names[name] == 'lambda')) - return name; - return scope.get_mangled(name, newMangle); - }; - - function get_define(name) { - if (options.defines) { - // we always lookup a defined symbol for the current scope FIRST, so declared - // vars trump a DEFINE symbol, but if no such var is found, then match a DEFINE value - if (!scope.has(name)) { - if (HOP(options.defines, name)) { - return options.defines[name]; - } - } - return null; - } - }; - - function _lambda(name, args, body) { - if (!options.no_functions && options.mangle) { - var is_defun = this[0] == "defun", extra; - if (name) { - if (is_defun) name = get_mangled(name); - else if (body.scope.references(name)) { - extra = {}; - if (!(scope.uses_eval || scope.uses_with)) - name = extra[name] = scope.next_mangled(); - else - extra[name] = name; - } - else name = null; - } - } - body = with_scope(body.scope, function(){ - args = MAP(args, function(name){ return get_mangled(name) }); - return MAP(body, walk); - }, extra); - return [ this[0], name, args, body ]; - }; - - function with_scope(s, cont, extra) { - var _scope = scope; - scope = s; - if (extra) for (var i in extra) if (HOP(extra, i)) { - s.set_mangle(i, extra[i]); - } - for (var i in s.names) if (HOP(s.names, i)) { - get_mangled(i, true); - } - var ret = cont(); - ret.scope = s; - scope = _scope; - return ret; - }; - - function _vardefs(defs) { - return [ this[0], MAP(defs, function(d){ - return [ get_mangled(d[0]), walk(d[1]) ]; - }) ]; - }; - - function _breacont(label) { - if (label) return [ this[0], scope.labels.get_mangled(label) ]; - }; - - return w.with_walkers({ - "function": _lambda, - "defun": function() { - // move function declarations to the top when - // they are not in some block. - var ast = _lambda.apply(this, arguments); - switch (w.parent()[0]) { - case "toplevel": - case "function": - case "defun": - return MAP.at_top(ast); - } - return ast; - }, - "label": function(label, stat) { - if (scope.labels.refs[label]) return [ - this[0], - scope.labels.get_mangled(label, true), - walk(stat) - ]; - return walk(stat); - }, - "break": _breacont, - "continue": _breacont, - "var": _vardefs, - "const": _vardefs, - "name": function(name) { - return get_define(name) || [ this[0], get_mangled(name) ]; - }, - "try": function(t, c, f) { - return [ this[0], - MAP(t, walk), - c != null ? [ get_mangled(c[0]), MAP(c[1], walk) ] : null, - f != null ? MAP(f, walk) : null ]; - }, - "toplevel": function(body) { - var self = this; - return with_scope(self.scope, function(){ - return [ self[0], MAP(body, walk) ]; - }); - }, - "directive": function() { - return MAP.at_top(this); - } - }, function() { - return walk(ast_add_scope(ast)); - }); -}; - -/* -----[ - - compress foo["bar"] into foo.bar, - - remove block brackets {} where possible - - join consecutive var declarations - - various optimizations for IFs: - - if (cond) foo(); else bar(); ==> cond?foo():bar(); - - if (cond) foo(); ==> cond&&foo(); - - if (foo) return bar(); else return baz(); ==> return foo?bar():baz(); // also for throw - - if (foo) return bar(); else something(); ==> {if(foo)return bar();something()} - ]----- */ - -var warn = function(){}; - -function best_of(ast1, ast2) { - return gen_code(ast1).length > gen_code(ast2[0] == "stat" ? ast2[1] : ast2).length ? ast2 : ast1; -}; - -function last_stat(b) { - if (b[0] == "block" && b[1] && b[1].length > 0) - return b[1][b[1].length - 1]; - return b; -} - -function aborts(t) { - if (t) switch (last_stat(t)[0]) { - case "return": - case "break": - case "continue": - case "throw": - return true; - } -}; - -function boolean_expr(expr) { - return ( (expr[0] == "unary-prefix" - && member(expr[1], [ "!", "delete" ])) || - - (expr[0] == "binary" - && member(expr[1], [ "in", "instanceof", "==", "!=", "===", "!==", "<", "<=", ">=", ">" ])) || - - (expr[0] == "binary" - && member(expr[1], [ "&&", "||" ]) - && boolean_expr(expr[2]) - && boolean_expr(expr[3])) || - - (expr[0] == "conditional" - && boolean_expr(expr[2]) - && boolean_expr(expr[3])) || - - (expr[0] == "assign" - && expr[1] === true - && boolean_expr(expr[3])) || - - (expr[0] == "seq" - && boolean_expr(expr[expr.length - 1])) - ); -}; - -function empty(b) { - return !b || (b[0] == "block" && (!b[1] || b[1].length == 0)); -}; - -function is_string(node) { - return (node[0] == "string" || - node[0] == "unary-prefix" && node[1] == "typeof" || - node[0] == "binary" && node[1] == "+" && - (is_string(node[2]) || is_string(node[3]))); -}; - -var when_constant = (function(){ - - var $NOT_CONSTANT = {}; - - // this can only evaluate constant expressions. If it finds anything - // not constant, it throws $NOT_CONSTANT. - function evaluate(expr) { - switch (expr[0]) { - case "string": - case "num": - return expr[1]; - case "name": - case "atom": - switch (expr[1]) { - case "true": return true; - case "false": return false; - case "null": return null; - } - break; - case "unary-prefix": - switch (expr[1]) { - case "!": return !evaluate(expr[2]); - case "typeof": return typeof evaluate(expr[2]); - case "~": return ~evaluate(expr[2]); - case "-": return -evaluate(expr[2]); - case "+": return +evaluate(expr[2]); - } - break; - case "binary": - var left = expr[2], right = expr[3]; - switch (expr[1]) { - case "&&" : return evaluate(left) && evaluate(right); - case "||" : return evaluate(left) || evaluate(right); - case "|" : return evaluate(left) | evaluate(right); - case "&" : return evaluate(left) & evaluate(right); - case "^" : return evaluate(left) ^ evaluate(right); - case "+" : return evaluate(left) + evaluate(right); - case "*" : return evaluate(left) * evaluate(right); - case "/" : return evaluate(left) / evaluate(right); - case "%" : return evaluate(left) % evaluate(right); - case "-" : return evaluate(left) - evaluate(right); - case "<<" : return evaluate(left) << evaluate(right); - case ">>" : return evaluate(left) >> evaluate(right); - case ">>>" : return evaluate(left) >>> evaluate(right); - case "==" : return evaluate(left) == evaluate(right); - case "===" : return evaluate(left) === evaluate(right); - case "!=" : return evaluate(left) != evaluate(right); - case "!==" : return evaluate(left) !== evaluate(right); - case "<" : return evaluate(left) < evaluate(right); - case "<=" : return evaluate(left) <= evaluate(right); - case ">" : return evaluate(left) > evaluate(right); - case ">=" : return evaluate(left) >= evaluate(right); - case "in" : return evaluate(left) in evaluate(right); - case "instanceof" : return evaluate(left) instanceof evaluate(right); - } - } - throw $NOT_CONSTANT; - }; - - return function(expr, yes, no) { - try { - var val = evaluate(expr), ast; - switch (typeof val) { - case "string": ast = [ "string", val ]; break; - case "number": ast = [ "num", val ]; break; - case "boolean": ast = [ "name", String(val) ]; break; - default: - if (val === null) { ast = [ "atom", "null" ]; break; } - throw new Error("Can't handle constant of type: " + (typeof val)); - } - return yes.call(expr, ast, val); - } catch(ex) { - if (ex === $NOT_CONSTANT) { - if (expr[0] == "binary" - && (expr[1] == "===" || expr[1] == "!==") - && ((is_string(expr[2]) && is_string(expr[3])) - || (boolean_expr(expr[2]) && boolean_expr(expr[3])))) { - expr[1] = expr[1].substr(0, 2); - } - else if (no && expr[0] == "binary" - && (expr[1] == "||" || expr[1] == "&&")) { - // the whole expression is not constant but the lval may be... - try { - var lval = evaluate(expr[2]); - expr = ((expr[1] == "&&" && (lval ? expr[3] : lval)) || - (expr[1] == "||" && (lval ? lval : expr[3])) || - expr); - } catch(ex2) { - // IGNORE... lval is not constant - } - } - return no ? no.call(expr, expr) : null; - } - else throw ex; - } - }; - -})(); - -function warn_unreachable(ast) { - if (!empty(ast)) - warn("Dropping unreachable code: " + gen_code(ast, true)); -}; - -function prepare_ifs(ast) { - var w = ast_walker(), walk = w.walk; - // In this first pass, we rewrite ifs which abort with no else with an - // if-else. For example: - // - // if (x) { - // blah(); - // return y; - // } - // foobar(); - // - // is rewritten into: - // - // if (x) { - // blah(); - // return y; - // } else { - // foobar(); - // } - function redo_if(statements) { - statements = MAP(statements, walk); - - for (var i = 0; i < statements.length; ++i) { - var fi = statements[i]; - if (fi[0] != "if") continue; - - if (fi[3]) continue; - - var t = fi[2]; - if (!aborts(t)) continue; - - var conditional = walk(fi[1]); - - var e_body = redo_if(statements.slice(i + 1)); - var e = e_body.length == 1 ? e_body[0] : [ "block", e_body ]; - - return statements.slice(0, i).concat([ [ - fi[0], // "if" - conditional, // conditional - t, // then - e // else - ] ]); - } - - return statements; - }; - - function redo_if_lambda(name, args, body) { - body = redo_if(body); - return [ this[0], name, args, body ]; - }; - - function redo_if_block(statements) { - return [ this[0], statements != null ? redo_if(statements) : null ]; - }; - - return w.with_walkers({ - "defun": redo_if_lambda, - "function": redo_if_lambda, - "block": redo_if_block, - "splice": redo_if_block, - "toplevel": function(statements) { - return [ this[0], redo_if(statements) ]; - }, - "try": function(t, c, f) { - return [ - this[0], - redo_if(t), - c != null ? [ c[0], redo_if(c[1]) ] : null, - f != null ? redo_if(f) : null - ]; - } - }, function() { - return walk(ast); - }); -}; - -function for_side_effects(ast, handler) { - var w = ast_walker(), walk = w.walk; - var $stop = {}, $restart = {}; - function stop() { throw $stop }; - function restart() { throw $restart }; - function found(){ return handler.call(this, this, w, stop, restart) }; - function unary(op) { - if (op == "++" || op == "--") - return found.apply(this, arguments); - }; - function binary(op) { - if (op == "&&" || op == "||") - return found.apply(this, arguments); - }; - return w.with_walkers({ - "try": found, - "throw": found, - "return": found, - "new": found, - "switch": found, - "break": found, - "continue": found, - "assign": found, - "call": found, - "if": found, - "for": found, - "for-in": found, - "while": found, - "do": found, - "return": found, - "unary-prefix": unary, - "unary-postfix": unary, - "conditional": found, - "binary": binary, - "defun": found - }, function(){ - while (true) try { - walk(ast); - break; - } catch(ex) { - if (ex === $stop) break; - if (ex === $restart) continue; - throw ex; - } - }); -}; - -function ast_lift_variables(ast) { - var w = ast_walker(), walk = w.walk, scope; - function do_body(body, env) { - var _scope = scope; - scope = env; - body = MAP(body, walk); - var hash = {}, names = MAP(env.names, function(type, name){ - if (type != "var") return MAP.skip; - if (!env.references(name)) return MAP.skip; - hash[name] = true; - return [ name ]; - }); - if (names.length > 0) { - // looking for assignments to any of these variables. - // we can save considerable space by moving the definitions - // in the var declaration. - for_side_effects([ "block", body ], function(ast, walker, stop, restart) { - if (ast[0] == "assign" - && ast[1] === true - && ast[2][0] == "name" - && HOP(hash, ast[2][1])) { - // insert the definition into the var declaration - for (var i = names.length; --i >= 0;) { - if (names[i][0] == ast[2][1]) { - if (names[i][1]) // this name already defined, we must stop - stop(); - names[i][1] = ast[3]; // definition - names.push(names.splice(i, 1)[0]); - break; - } - } - // remove this assignment from the AST. - var p = walker.parent(); - if (p[0] == "seq") { - var a = p[2]; - a.unshift(0, p.length); - p.splice.apply(p, a); - } - else if (p[0] == "stat") { - p.splice(0, p.length, "block"); // empty statement - } - else { - stop(); - } - restart(); - } - stop(); - }); - body.unshift([ "var", names ]); - } - scope = _scope; - return body; - }; - function _vardefs(defs) { - var ret = null; - for (var i = defs.length; --i >= 0;) { - var d = defs[i]; - if (!d[1]) continue; - d = [ "assign", true, [ "name", d[0] ], d[1] ]; - if (ret == null) ret = d; - else ret = [ "seq", d, ret ]; - } - if (ret == null && w.parent()[0] != "for") { - if (w.parent()[0] == "for-in") - return [ "name", defs[0][0] ]; - return MAP.skip; - } - return [ "stat", ret ]; - }; - function _toplevel(body) { - return [ this[0], do_body(body, this.scope) ]; - }; - return w.with_walkers({ - "function": function(name, args, body){ - for (var i = args.length; --i >= 0 && !body.scope.references(args[i]);) - args.pop(); - if (!body.scope.references(name)) name = null; - return [ this[0], name, args, do_body(body, body.scope) ]; - }, - "defun": function(name, args, body){ - if (!scope.references(name)) return MAP.skip; - for (var i = args.length; --i >= 0 && !body.scope.references(args[i]);) - args.pop(); - return [ this[0], name, args, do_body(body, body.scope) ]; - }, - "var": _vardefs, - "toplevel": _toplevel - }, function(){ - return walk(ast_add_scope(ast)); - }); -}; - -function ast_squeeze(ast, options) { - ast = squeeze_1(ast, options); - ast = squeeze_2(ast, options); - return ast; -}; - -function squeeze_1(ast, options) { - options = defaults(options, { - make_seqs : true, - dead_code : true, - no_warnings : false, - keep_comps : true, - unsafe : false - }); - - var w = ast_walker(), walk = w.walk, scope; - - function negate(c) { - var not_c = [ "unary-prefix", "!", c ]; - switch (c[0]) { - case "unary-prefix": - return c[1] == "!" && boolean_expr(c[2]) ? c[2] : not_c; - case "seq": - c = slice(c); - c[c.length - 1] = negate(c[c.length - 1]); - return c; - case "conditional": - return best_of(not_c, [ "conditional", c[1], negate(c[2]), negate(c[3]) ]); - case "binary": - var op = c[1], left = c[2], right = c[3]; - if (!options.keep_comps) switch (op) { - case "<=" : return [ "binary", ">", left, right ]; - case "<" : return [ "binary", ">=", left, right ]; - case ">=" : return [ "binary", "<", left, right ]; - case ">" : return [ "binary", "<=", left, right ]; - } - switch (op) { - case "==" : return [ "binary", "!=", left, right ]; - case "!=" : return [ "binary", "==", left, right ]; - case "===" : return [ "binary", "!==", left, right ]; - case "!==" : return [ "binary", "===", left, right ]; - case "&&" : return best_of(not_c, [ "binary", "||", negate(left), negate(right) ]); - case "||" : return best_of(not_c, [ "binary", "&&", negate(left), negate(right) ]); - } - break; - } - return not_c; - }; - - function make_conditional(c, t, e) { - var make_real_conditional = function() { - if (c[0] == "unary-prefix" && c[1] == "!") { - return e ? [ "conditional", c[2], e, t ] : [ "binary", "||", c[2], t ]; - } else { - return e ? best_of( - [ "conditional", c, t, e ], - [ "conditional", negate(c), e, t ] - ) : [ "binary", "&&", c, t ]; - } - }; - // shortcut the conditional if the expression has a constant value - return when_constant(c, function(ast, val){ - warn_unreachable(val ? e : t); - return (val ? t : e); - }, make_real_conditional); - }; - - function rmblock(block) { - if (block != null && block[0] == "block" && block[1]) { - if (block[1].length == 1) - block = block[1][0]; - else if (block[1].length == 0) - block = [ "block" ]; - } - return block; - }; - - function _lambda(name, args, body) { - return [ this[0], name, args, tighten(body, "lambda") ]; - }; - - // this function does a few things: - // 1. discard useless blocks - // 2. join consecutive var declarations - // 3. remove obviously dead code - // 4. transform consecutive statements using the comma operator - // 5. if block_type == "lambda" and it detects constructs like if(foo) return ... - rewrite like if (!foo) { ... } - function tighten(statements, block_type) { - statements = MAP(statements, walk); - - statements = statements.reduce(function(a, stat){ - if (stat[0] == "block") { - if (stat[1]) { - a.push.apply(a, stat[1]); - } - } else { - a.push(stat); - } - return a; - }, []); - - statements = (function(a, prev){ - statements.forEach(function(cur){ - if (prev && ((cur[0] == "var" && prev[0] == "var") || - (cur[0] == "const" && prev[0] == "const"))) { - prev[1] = prev[1].concat(cur[1]); - } else { - a.push(cur); - prev = cur; - } - }); - return a; - })([]); - - if (options.dead_code) statements = (function(a, has_quit){ - statements.forEach(function(st){ - if (has_quit) { - if (st[0] == "function" || st[0] == "defun") { - a.push(st); - } - else if (st[0] == "var" || st[0] == "const") { - if (!options.no_warnings) - warn("Variables declared in unreachable code"); - st[1] = MAP(st[1], function(def){ - if (def[1] && !options.no_warnings) - warn_unreachable([ "assign", true, [ "name", def[0] ], def[1] ]); - return [ def[0] ]; - }); - a.push(st); - } - else if (!options.no_warnings) - warn_unreachable(st); - } - else { - a.push(st); - if (member(st[0], [ "return", "throw", "break", "continue" ])) - has_quit = true; - } - }); - return a; - })([]); - - if (options.make_seqs) statements = (function(a, prev) { - statements.forEach(function(cur){ - if (prev && prev[0] == "stat" && cur[0] == "stat") { - prev[1] = [ "seq", prev[1], cur[1] ]; - } else { - a.push(cur); - prev = cur; - } - }); - if (a.length >= 2 - && a[a.length-2][0] == "stat" - && (a[a.length-1][0] == "return" || a[a.length-1][0] == "throw") - && a[a.length-1][1]) - { - a.splice(a.length - 2, 2, - [ a[a.length-1][0], - [ "seq", a[a.length-2][1], a[a.length-1][1] ]]); - } - return a; - })([]); - - // this increases jQuery by 1K. Probably not such a good idea after all.. - // part of this is done in prepare_ifs anyway. - // if (block_type == "lambda") statements = (function(i, a, stat){ - // while (i < statements.length) { - // stat = statements[i++]; - // if (stat[0] == "if" && !stat[3]) { - // if (stat[2][0] == "return" && stat[2][1] == null) { - // a.push(make_if(negate(stat[1]), [ "block", statements.slice(i) ])); - // break; - // } - // var last = last_stat(stat[2]); - // if (last[0] == "return" && last[1] == null) { - // a.push(make_if(stat[1], [ "block", stat[2][1].slice(0, -1) ], [ "block", statements.slice(i) ])); - // break; - // } - // } - // a.push(stat); - // } - // return a; - // })(0, []); - - return statements; - }; - - function make_if(c, t, e) { - return when_constant(c, function(ast, val){ - if (val) { - t = walk(t); - warn_unreachable(e); - return t || [ "block" ]; - } else { - e = walk(e); - warn_unreachable(t); - return e || [ "block" ]; - } - }, function() { - return make_real_if(c, t, e); - }); - }; - - function abort_else(c, t, e) { - var ret = [ [ "if", negate(c), e ] ]; - if (t[0] == "block") { - if (t[1]) ret = ret.concat(t[1]); - } else { - ret.push(t); - } - return walk([ "block", ret ]); - }; - - function make_real_if(c, t, e) { - c = walk(c); - t = walk(t); - e = walk(e); - - if (empty(e) && empty(t)) - return [ "stat", c ]; - - if (empty(t)) { - c = negate(c); - t = e; - e = null; - } else if (empty(e)) { - e = null; - } else { - // if we have both else and then, maybe it makes sense to switch them? - (function(){ - var a = gen_code(c); - var n = negate(c); - var b = gen_code(n); - if (b.length < a.length) { - var tmp = t; - t = e; - e = tmp; - c = n; - } - })(); - } - var ret = [ "if", c, t, e ]; - if (t[0] == "if" && empty(t[3]) && empty(e)) { - ret = best_of(ret, walk([ "if", [ "binary", "&&", c, t[1] ], t[2] ])); - } - else if (t[0] == "stat") { - if (e) { - if (e[0] == "stat") - ret = best_of(ret, [ "stat", make_conditional(c, t[1], e[1]) ]); - else if (aborts(e)) - ret = abort_else(c, t, e); - } - else { - ret = best_of(ret, [ "stat", make_conditional(c, t[1]) ]); - } - } - else if (e && t[0] == e[0] && (t[0] == "return" || t[0] == "throw") && t[1] && e[1]) { - ret = best_of(ret, [ t[0], make_conditional(c, t[1], e[1] ) ]); - } - else if (e && aborts(t)) { - ret = [ [ "if", c, t ] ]; - if (e[0] == "block") { - if (e[1]) ret = ret.concat(e[1]); - } - else { - ret.push(e); - } - ret = walk([ "block", ret ]); - } - else if (t && aborts(e)) { - ret = abort_else(c, t, e); - } - return ret; - }; - - function _do_while(cond, body) { - return when_constant(cond, function(cond, val){ - if (!val) { - warn_unreachable(body); - return [ "block" ]; - } else { - return [ "for", null, null, null, walk(body) ]; - } - }); - }; - - return w.with_walkers({ - "sub": function(expr, subscript) { - if (subscript[0] == "string") { - var name = subscript[1]; - if (is_identifier(name)) - return [ "dot", walk(expr), name ]; - else if (/^[1-9][0-9]*$/.test(name) || name === "0") - return [ "sub", walk(expr), [ "num", parseInt(name, 10) ] ]; - } - }, - "if": make_if, - "toplevel": function(body) { - return [ "toplevel", tighten(body) ]; - }, - "switch": function(expr, body) { - var last = body.length - 1; - return [ "switch", walk(expr), MAP(body, function(branch, i){ - var block = tighten(branch[1]); - if (i == last && block.length > 0) { - var node = block[block.length - 1]; - if (node[0] == "break" && !node[1]) - block.pop(); - } - return [ branch[0] ? walk(branch[0]) : null, block ]; - }) ]; - }, - "function": _lambda, - "defun": _lambda, - "block": function(body) { - if (body) return rmblock([ "block", tighten(body) ]); - }, - "binary": function(op, left, right) { - return when_constant([ "binary", op, walk(left), walk(right) ], function yes(c){ - return best_of(walk(c), this); - }, function no() { - return function(){ - if(op != "==" && op != "!=") return; - var l = walk(left), r = walk(right); - if(l && l[0] == "unary-prefix" && l[1] == "!" && l[2][0] == "num") - left = ['num', +!l[2][1]]; - else if (r && r[0] == "unary-prefix" && r[1] == "!" && r[2][0] == "num") - right = ['num', +!r[2][1]]; - return ["binary", op, left, right]; - }() || this; - }); - }, - "conditional": function(c, t, e) { - return make_conditional(walk(c), walk(t), walk(e)); - }, - "try": function(t, c, f) { - return [ - "try", - tighten(t), - c != null ? [ c[0], tighten(c[1]) ] : null, - f != null ? tighten(f) : null - ]; - }, - "unary-prefix": function(op, expr) { - expr = walk(expr); - var ret = [ "unary-prefix", op, expr ]; - if (op == "!") - ret = best_of(ret, negate(expr)); - return when_constant(ret, function(ast, val){ - return walk(ast); // it's either true or false, so minifies to !0 or !1 - }, function() { return ret }); - }, - "name": function(name) { - switch (name) { - case "true": return [ "unary-prefix", "!", [ "num", 0 ]]; - case "false": return [ "unary-prefix", "!", [ "num", 1 ]]; - } - }, - "while": _do_while, - "assign": function(op, lvalue, rvalue) { - lvalue = walk(lvalue); - rvalue = walk(rvalue); - var okOps = [ '+', '-', '/', '*', '%', '>>', '<<', '>>>', '|', '^', '&' ]; - if (op === true && lvalue[0] === "name" && rvalue[0] === "binary" && - ~okOps.indexOf(rvalue[1]) && rvalue[2][0] === "name" && - rvalue[2][1] === lvalue[1]) { - return [ this[0], rvalue[1], lvalue, rvalue[3] ] - } - return [ this[0], op, lvalue, rvalue ]; - }, - "call": function(expr, args) { - expr = walk(expr); - if (options.unsafe && expr[0] == "dot" && expr[1][0] == "string" && expr[2] == "toString") { - return expr[1]; - } - return [ this[0], expr, MAP(args, walk) ]; - }, - "num": function (num) { - if (!isFinite(num)) - return [ "binary", "/", num === 1 / 0 - ? [ "num", 1 ] : num === -1 / 0 - ? [ "unary-prefix", "-", [ "num", 1 ] ] - : [ "num", 0 ], [ "num", 0 ] ]; - - return [ this[0], num ]; - } - }, function() { - return walk(prepare_ifs(walk(prepare_ifs(ast)))); - }); -}; - -function squeeze_2(ast, options) { - var w = ast_walker(), walk = w.walk, scope; - function with_scope(s, cont) { - var save = scope, ret; - scope = s; - ret = cont(); - scope = save; - return ret; - }; - function lambda(name, args, body) { - return [ this[0], name, args, with_scope(body.scope, curry(MAP, body, walk)) ]; - }; - return w.with_walkers({ - "directive": function(dir) { - if (scope.active_directive(dir)) - return [ "block" ]; - scope.directives.push(dir); - }, - "toplevel": function(body) { - return [ this[0], with_scope(this.scope, curry(MAP, body, walk)) ]; - }, - "function": lambda, - "defun": lambda - }, function(){ - return walk(ast_add_scope(ast)); - }); -}; - -/* -----[ re-generate code from the AST ]----- */ - -var DOT_CALL_NO_PARENS = jsp.array_to_hash([ - "name", - "array", - "object", - "string", - "dot", - "sub", - "call", - "regexp", - "defun" -]); - -function make_string(str, ascii_only) { - var dq = 0, sq = 0; - str = str.replace(/[\\\b\f\n\r\t\x22\x27\u2028\u2029\0]/g, function(s){ - switch (s) { - case "\\": return "\\\\"; - case "\b": return "\\b"; - case "\f": return "\\f"; - case "\n": return "\\n"; - case "\r": return "\\r"; - case "\u2028": return "\\u2028"; - case "\u2029": return "\\u2029"; - case '"': ++dq; return '"'; - case "'": ++sq; return "'"; - case "\0": return "\\0"; - } - return s; - }); - if (ascii_only) str = to_ascii(str); - if (dq > sq) return "'" + str.replace(/\x27/g, "\\'") + "'"; - else return '"' + str.replace(/\x22/g, '\\"') + '"'; -}; - -function to_ascii(str) { - return str.replace(/[\u0080-\uffff]/g, function(ch) { - var code = ch.charCodeAt(0).toString(16); - while (code.length < 4) code = "0" + code; - return "\\u" + code; - }); -}; - -var SPLICE_NEEDS_BRACKETS = jsp.array_to_hash([ "if", "while", "do", "for", "for-in", "with" ]); - -function gen_code(ast, options) { - options = defaults(options, { - indent_start : 0, - indent_level : 4, - quote_keys : false, - space_colon : false, - beautify : false, - ascii_only : false, - inline_script: false - }); - var beautify = !!options.beautify; - var indentation = 0, - newline = beautify ? "\n" : "", - space = beautify ? " " : ""; - - function encode_string(str) { - var ret = make_string(str, options.ascii_only); - if (options.inline_script) - ret = ret.replace(/<\x2fscript([>\/\t\n\f\r ])/gi, "<\\/script$1"); - return ret; - }; - - function make_name(name) { - name = name.toString(); - if (options.ascii_only) - name = to_ascii(name); - return name; - }; - - function indent(line) { - if (line == null) - line = ""; - if (beautify) - line = repeat_string(" ", options.indent_start + indentation * options.indent_level) + line; - return line; - }; - - function with_indent(cont, incr) { - if (incr == null) incr = 1; - indentation += incr; - try { return cont.apply(null, slice(arguments, 1)); } - finally { indentation -= incr; } - }; - - function last_char(str) { - str = str.toString(); - return str.charAt(str.length - 1); - }; - - function first_char(str) { - return str.toString().charAt(0); - }; - - function add_spaces(a) { - if (beautify) - return a.join(" "); - var b = []; - for (var i = 0; i < a.length; ++i) { - var next = a[i + 1]; - b.push(a[i]); - if (next && - ((is_identifier_char(last_char(a[i])) && (is_identifier_char(first_char(next)) - || first_char(next) == "\\")) || - (/[\+\-]$/.test(a[i].toString()) && /^[\+\-]/.test(next.toString()) || - last_char(a[i]) == "/" && first_char(next) == "/"))) { - b.push(" "); - } - } - return b.join(""); - }; - - function add_commas(a) { - return a.join("," + space); - }; - - function parenthesize(expr) { - var gen = make(expr); - for (var i = 1; i < arguments.length; ++i) { - var el = arguments[i]; - if ((el instanceof Function && el(expr)) || expr[0] == el) - return "(" + gen + ")"; - } - return gen; - }; - - function best_of(a) { - if (a.length == 1) { - return a[0]; - } - if (a.length == 2) { - var b = a[1]; - a = a[0]; - return a.length <= b.length ? a : b; - } - return best_of([ a[0], best_of(a.slice(1)) ]); - }; - - function needs_parens(expr) { - if (expr[0] == "function" || expr[0] == "object") { - // dot/call on a literal function requires the - // function literal itself to be parenthesized - // only if it's the first "thing" in a - // statement. This means that the parent is - // "stat", but it could also be a "seq" and - // we're the first in this "seq" and the - // parent is "stat", and so on. Messy stuff, - // but it worths the trouble. - var a = slice(w.stack()), self = a.pop(), p = a.pop(); - while (p) { - if (p[0] == "stat") return true; - if (((p[0] == "seq" || p[0] == "call" || p[0] == "dot" || p[0] == "sub" || p[0] == "conditional") && p[1] === self) || - ((p[0] == "binary" || p[0] == "assign" || p[0] == "unary-postfix") && p[2] === self)) { - self = p; - p = a.pop(); - } else { - return false; - } - } - } - return !HOP(DOT_CALL_NO_PARENS, expr[0]); - }; - - function make_num(num) { - var str = num.toString(10), a = [ str.replace(/^0\./, ".").replace('e+', 'e') ], m; - if (Math.floor(num) === num) { - if (num >= 0) { - a.push("0x" + num.toString(16).toLowerCase(), // probably pointless - "0" + num.toString(8)); // same. - } else { - a.push("-0x" + (-num).toString(16).toLowerCase(), // probably pointless - "-0" + (-num).toString(8)); // same. - } - if ((m = /^(.*?)(0+)$/.exec(num))) { - a.push(m[1] + "e" + m[2].length); - } - } else if ((m = /^0?\.(0+)(.*)$/.exec(num))) { - a.push(m[2] + "e-" + (m[1].length + m[2].length), - str.substr(str.indexOf("."))); - } - return best_of(a); - }; - - var w = ast_walker(); - var make = w.walk; - return w.with_walkers({ - "string": encode_string, - "num": make_num, - "name": make_name, - "debugger": function(){ return "debugger;" }, - "toplevel": function(statements) { - return make_block_statements(statements) - .join(newline + newline); - }, - "splice": function(statements) { - var parent = w.parent(); - if (HOP(SPLICE_NEEDS_BRACKETS, parent)) { - // we need block brackets in this case - return make_block.apply(this, arguments); - } else { - return MAP(make_block_statements(statements, true), - function(line, i) { - // the first line is already indented - return i > 0 ? indent(line) : line; - }).join(newline); - } - }, - "block": make_block, - "var": function(defs) { - return "var " + add_commas(MAP(defs, make_1vardef)) + ";"; - }, - "const": function(defs) { - return "const " + add_commas(MAP(defs, make_1vardef)) + ";"; - }, - "try": function(tr, ca, fi) { - var out = [ "try", make_block(tr) ]; - if (ca) out.push("catch", "(" + ca[0] + ")", make_block(ca[1])); - if (fi) out.push("finally", make_block(fi)); - return add_spaces(out); - }, - "throw": function(expr) { - return add_spaces([ "throw", make(expr) ]) + ";"; - }, - "new": function(ctor, args) { - args = args.length > 0 ? "(" + add_commas(MAP(args, function(expr){ - return parenthesize(expr, "seq"); - })) + ")" : ""; - return add_spaces([ "new", parenthesize(ctor, "seq", "binary", "conditional", "assign", function(expr){ - var w = ast_walker(), has_call = {}; - try { - w.with_walkers({ - "call": function() { throw has_call }, - "function": function() { return this } - }, function(){ - w.walk(expr); - }); - } catch(ex) { - if (ex === has_call) - return true; - throw ex; - } - }) + args ]); - }, - "switch": function(expr, body) { - return add_spaces([ "switch", "(" + make(expr) + ")", make_switch_block(body) ]); - }, - "break": function(label) { - var out = "break"; - if (label != null) - out += " " + make_name(label); - return out + ";"; - }, - "continue": function(label) { - var out = "continue"; - if (label != null) - out += " " + make_name(label); - return out + ";"; - }, - "conditional": function(co, th, el) { - return add_spaces([ parenthesize(co, "assign", "seq", "conditional"), "?", - parenthesize(th, "seq"), ":", - parenthesize(el, "seq") ]); - }, - "assign": function(op, lvalue, rvalue) { - if (op && op !== true) op += "="; - else op = "="; - return add_spaces([ make(lvalue), op, parenthesize(rvalue, "seq") ]); - }, - "dot": function(expr) { - var out = make(expr), i = 1; - if (expr[0] == "num") { - if (!/[a-f.]/i.test(out)) - out += "."; - } else if (expr[0] != "function" && needs_parens(expr)) - out = "(" + out + ")"; - while (i < arguments.length) - out += "." + make_name(arguments[i++]); - return out; - }, - "call": function(func, args) { - var f = make(func); - if (f.charAt(0) != "(" && needs_parens(func)) - f = "(" + f + ")"; - return f + "(" + add_commas(MAP(args, function(expr){ - return parenthesize(expr, "seq"); - })) + ")"; - }, - "function": make_function, - "defun": make_function, - "if": function(co, th, el) { - var out = [ "if", "(" + make(co) + ")", el ? make_then(th) : make(th) ]; - if (el) { - out.push("else", make(el)); - } - return add_spaces(out); - }, - "for": function(init, cond, step, block) { - var out = [ "for" ]; - init = (init != null ? make(init) : "").replace(/;*\s*$/, ";" + space); - cond = (cond != null ? make(cond) : "").replace(/;*\s*$/, ";" + space); - step = (step != null ? make(step) : "").replace(/;*\s*$/, ""); - var args = init + cond + step; - if (args == "; ; ") args = ";;"; - out.push("(" + args + ")", make(block)); - return add_spaces(out); - }, - "for-in": function(vvar, key, hash, block) { - return add_spaces([ "for", "(" + - (vvar ? make(vvar).replace(/;+$/, "") : make(key)), - "in", - make(hash) + ")", make(block) ]); - }, - "while": function(condition, block) { - return add_spaces([ "while", "(" + make(condition) + ")", make(block) ]); - }, - "do": function(condition, block) { - return add_spaces([ "do", make(block), "while", "(" + make(condition) + ")" ]) + ";"; - }, - "return": function(expr) { - var out = [ "return" ]; - if (expr != null) out.push(make(expr)); - return add_spaces(out) + ";"; - }, - "binary": function(operator, lvalue, rvalue) { - var left = make(lvalue), right = make(rvalue); - // XXX: I'm pretty sure other cases will bite here. - // we need to be smarter. - // adding parens all the time is the safest bet. - if (member(lvalue[0], [ "assign", "conditional", "seq" ]) || - lvalue[0] == "binary" && PRECEDENCE[operator] > PRECEDENCE[lvalue[1]] || - lvalue[0] == "function" && needs_parens(this)) { - left = "(" + left + ")"; - } - if (member(rvalue[0], [ "assign", "conditional", "seq" ]) || - rvalue[0] == "binary" && PRECEDENCE[operator] >= PRECEDENCE[rvalue[1]] && - !(rvalue[1] == operator && member(operator, [ "&&", "||", "*" ]))) { - right = "(" + right + ")"; - } - else if (!beautify && options.inline_script && (operator == "<" || operator == "<<") - && rvalue[0] == "regexp" && /^script/i.test(rvalue[1])) { - right = " " + right; - } - return add_spaces([ left, operator, right ]); - }, - "unary-prefix": function(operator, expr) { - var val = make(expr); - if (!(expr[0] == "num" || (expr[0] == "unary-prefix" && !HOP(OPERATORS, operator + expr[1])) || !needs_parens(expr))) - val = "(" + val + ")"; - return operator + (jsp.is_alphanumeric_char(operator.charAt(0)) ? " " : "") + val; - }, - "unary-postfix": function(operator, expr) { - var val = make(expr); - if (!(expr[0] == "num" || (expr[0] == "unary-postfix" && !HOP(OPERATORS, operator + expr[1])) || !needs_parens(expr))) - val = "(" + val + ")"; - return val + operator; - }, - "sub": function(expr, subscript) { - var hash = make(expr); - if (needs_parens(expr)) - hash = "(" + hash + ")"; - return hash + "[" + make(subscript) + "]"; - }, - "object": function(props) { - var obj_needs_parens = needs_parens(this); - if (props.length == 0) - return obj_needs_parens ? "({})" : "{}"; - var out = "{" + newline + with_indent(function(){ - return MAP(props, function(p){ - if (p.length == 3) { - // getter/setter. The name is in p[0], the arg.list in p[1][2], the - // body in p[1][3] and type ("get" / "set") in p[2]. - return indent(make_function(p[0], p[1][2], p[1][3], p[2], true)); - } - var key = p[0], val = parenthesize(p[1], "seq"); - if (options.quote_keys) { - key = encode_string(key); - } else if ((typeof key == "number" || !beautify && +key + "" == key) - && parseFloat(key) >= 0) { - key = make_num(+key); - } else if (!is_identifier(key)) { - key = encode_string(key); - } - return indent(add_spaces(beautify && options.space_colon - ? [ key, ":", val ] - : [ key + ":", val ])); - }).join("," + newline); - }) + newline + indent("}"); - return obj_needs_parens ? "(" + out + ")" : out; - }, - "regexp": function(rx, mods) { - if (options.ascii_only) rx = to_ascii(rx); - return "/" + rx + "/" + mods; - }, - "array": function(elements) { - if (elements.length == 0) return "[]"; - return add_spaces([ "[", add_commas(MAP(elements, function(el, i){ - if (!beautify && el[0] == "atom" && el[1] == "undefined") return i === elements.length - 1 ? "," : ""; - return parenthesize(el, "seq"); - })), "]" ]); - }, - "stat": function(stmt) { - return stmt != null - ? make(stmt).replace(/;*\s*$/, ";") - : ";"; - }, - "seq": function() { - return add_commas(MAP(slice(arguments), make)); - }, - "label": function(name, block) { - return add_spaces([ make_name(name), ":", make(block) ]); - }, - "with": function(expr, block) { - return add_spaces([ "with", "(" + make(expr) + ")", make(block) ]); - }, - "atom": function(name) { - return make_name(name); - }, - "directive": function(dir) { - return make_string(dir) + ";"; - } - }, function(){ return make(ast) }); - - // The squeezer replaces "block"-s that contain only a single - // statement with the statement itself; technically, the AST - // is correct, but this can create problems when we output an - // IF having an ELSE clause where the THEN clause ends in an - // IF *without* an ELSE block (then the outer ELSE would refer - // to the inner IF). This function checks for this case and - // adds the block brackets if needed. - function make_then(th) { - if (th == null) return ";"; - if (th[0] == "do") { - // https://github.com/mishoo/UglifyJS/issues/#issue/57 - // IE croaks with "syntax error" on code like this: - // if (foo) do ... while(cond); else ... - // we need block brackets around do/while - return make_block([ th ]); - } - var b = th; - while (true) { - var type = b[0]; - if (type == "if") { - if (!b[3]) - // no else, we must add the block - return make([ "block", [ th ]]); - b = b[3]; - } - else if (type == "while" || type == "do") b = b[2]; - else if (type == "for" || type == "for-in") b = b[4]; - else break; - } - return make(th); - }; - - function make_function(name, args, body, keyword, no_parens) { - var out = keyword || "function"; - if (name) { - out += " " + make_name(name); - } - out += "(" + add_commas(MAP(args, make_name)) + ")"; - out = add_spaces([ out, make_block(body) ]); - return (!no_parens && needs_parens(this)) ? "(" + out + ")" : out; - }; - - function must_has_semicolon(node) { - switch (node[0]) { - case "with": - case "while": - return empty(node[2]) || must_has_semicolon(node[2]); - case "for": - case "for-in": - return empty(node[4]) || must_has_semicolon(node[4]); - case "if": - if (empty(node[2]) && !node[3]) return true; // `if' with empty `then' and no `else' - if (node[3]) { - if (empty(node[3])) return true; // `else' present but empty - return must_has_semicolon(node[3]); // dive into the `else' branch - } - return must_has_semicolon(node[2]); // dive into the `then' branch - case "directive": - return true; - } - }; - - function make_block_statements(statements, noindent) { - for (var a = [], last = statements.length - 1, i = 0; i <= last; ++i) { - var stat = statements[i]; - var code = make(stat); - if (code != ";") { - if (!beautify && i == last && !must_has_semicolon(stat)) { - code = code.replace(/;+\s*$/, ""); - } - a.push(code); - } - } - return noindent ? a : MAP(a, indent); - }; - - function make_switch_block(body) { - var n = body.length; - if (n == 0) return "{}"; - return "{" + newline + MAP(body, function(branch, i){ - var has_body = branch[1].length > 0, code = with_indent(function(){ - return indent(branch[0] - ? add_spaces([ "case", make(branch[0]) + ":" ]) - : "default:"); - }, 0.5) + (has_body ? newline + with_indent(function(){ - return make_block_statements(branch[1]).join(newline); - }) : ""); - if (!beautify && has_body && i < n - 1) - code += ";"; - return code; - }).join(newline) + newline + indent("}"); - }; - - function make_block(statements) { - if (!statements) return ";"; - if (statements.length == 0) return "{}"; - return "{" + newline + with_indent(function(){ - return make_block_statements(statements).join(newline); - }) + newline + indent("}"); - }; - - function make_1vardef(def) { - var name = def[0], val = def[1]; - if (val != null) - name = add_spaces([ make_name(name), "=", parenthesize(val, "seq") ]); - return name; - }; - -}; - -function split_lines(code, max_line_length) { - var splits = [ 0 ]; - jsp.parse(function(){ - var next_token = jsp.tokenizer(code); - var last_split = 0; - var prev_token; - function current_length(tok) { - return tok.pos - last_split; - }; - function split_here(tok) { - last_split = tok.pos; - splits.push(last_split); - }; - function custom(){ - var tok = next_token.apply(this, arguments); - out: { - if (prev_token) { - if (prev_token.type == "keyword") break out; - } - if (current_length(tok) > max_line_length) { - switch (tok.type) { - case "keyword": - case "atom": - case "name": - case "punc": - split_here(tok); - break out; - } - } - } - prev_token = tok; - return tok; - }; - custom.context = function() { - return next_token.context.apply(this, arguments); - }; - return custom; - }()); - return splits.map(function(pos, i){ - return code.substring(pos, splits[i + 1] || code.length); - }).join("\n"); -}; - -/* -----[ Utilities ]----- */ - -function repeat_string(str, i) { - if (i <= 0) return ""; - if (i == 1) return str; - var d = repeat_string(str, i >> 1); - d += d; - if (i & 1) d += str; - return d; -}; - -function defaults(args, defs) { - var ret = {}; - if (args === true) - args = {}; - for (var i in defs) if (HOP(defs, i)) { - ret[i] = (args && HOP(args, i)) ? args[i] : defs[i]; - } - return ret; -}; - -function is_identifier(name) { - return /^[a-z_$][a-z0-9_$]*$/i.test(name) - && name != "this" - && !HOP(jsp.KEYWORDS_ATOM, name) - && !HOP(jsp.RESERVED_WORDS, name) - && !HOP(jsp.KEYWORDS, name); -}; - -function HOP(obj, prop) { - return Object.prototype.hasOwnProperty.call(obj, prop); -}; - -// some utilities - -var MAP; - -(function(){ - MAP = function(a, f, o) { - var ret = [], top = [], i; - function doit() { - var val = f.call(o, a[i], i); - if (val instanceof AtTop) { - val = val.v; - if (val instanceof Splice) { - top.push.apply(top, val.v); - } else { - top.push(val); - } - } - else if (val != skip) { - if (val instanceof Splice) { - ret.push.apply(ret, val.v); - } else { - ret.push(val); - } - } - }; - if (a instanceof Array) for (i = 0; i < a.length; ++i) doit(); - else for (i in a) if (HOP(a, i)) doit(); - return top.concat(ret); - }; - MAP.at_top = function(val) { return new AtTop(val) }; - MAP.splice = function(val) { return new Splice(val) }; - var skip = MAP.skip = {}; - function AtTop(val) { this.v = val }; - function Splice(val) { this.v = val }; -})(); - -/* -----[ Exports ]----- */ - -exports.ast_walker = ast_walker; -exports.ast_mangle = ast_mangle; -exports.ast_squeeze = ast_squeeze; -exports.ast_lift_variables = ast_lift_variables; -exports.gen_code = gen_code; -exports.ast_add_scope = ast_add_scope; -exports.set_logger = function(logger) { warn = logger }; -exports.make_string = make_string; -exports.split_lines = split_lines; -exports.MAP = MAP; - -// keep this last! -exports.ast_squeeze_more = require("./squeeze-more").ast_squeeze_more; - -// Local variables: -// js-indent-level: 4 -// End: -}); -define('uglifyjs/index', ["require", "exports", "module", "./parse-js", "./process", "./consolidator"], function(require, exports, module) { -//convienence function(src, [options]); -function uglify(orig_code, options){ - options || (options = {}); - var jsp = uglify.parser; - var pro = uglify.uglify; - - var ast = jsp.parse(orig_code, options.strict_semicolons); // parse code and get the initial AST - ast = pro.ast_mangle(ast, options.mangle_options); // get a new AST with mangled names - ast = pro.ast_squeeze(ast, options.squeeze_options); // get an AST with compression optimizations - var final_code = pro.gen_code(ast, options.gen_options); // compressed code here - return final_code; -}; - -uglify.parser = require("./parse-js"); -uglify.uglify = require("./process"); -uglify.consolidator = require("./consolidator"); - -module.exports = uglify -});/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -define('source-map/array-set', function (require, exports, module) { - - var util = require('./util'); - - /** - * A data structure which is a combination of an array and a set. Adding a new - * member is O(1), testing for membership is O(1), and finding the index of an - * element is O(1). Removing elements from the set is not supported. Only - * strings are supported for membership. - */ - function ArraySet() { - this._array = []; - this._set = {}; - } - - /** - * Static method for creating ArraySet instances from an existing array. - */ - ArraySet.fromArray = function ArraySet_fromArray(aArray) { - var set = new ArraySet(); - for (var i = 0, len = aArray.length; i < len; i++) { - set.add(aArray[i]); - } - return set; - }; - - /** - * Add the given string to this set. - * - * @param String aStr - */ - ArraySet.prototype.add = function ArraySet_add(aStr) { - if (this.has(aStr)) { - // Already a member; nothing to do. - return; - } - var idx = this._array.length; - this._array.push(aStr); - this._set[util.toSetString(aStr)] = idx; - }; - - /** - * Is the given string a member of this set? - * - * @param String aStr - */ - ArraySet.prototype.has = function ArraySet_has(aStr) { - return Object.prototype.hasOwnProperty.call(this._set, - util.toSetString(aStr)); - }; - - /** - * What is the index of the given string in the array? - * - * @param String aStr - */ - ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { - if (this.has(aStr)) { - return this._set[util.toSetString(aStr)]; - } - throw new Error('"' + aStr + '" is not in the set.'); - }; - - /** - * What is the element at the given index? - * - * @param Number aIdx - */ - ArraySet.prototype.at = function ArraySet_at(aIdx) { - if (aIdx >= 0 && aIdx < this._array.length) { - return this._array[aIdx]; - } - throw new Error('No element indexed by ' + aIdx); - }; - - /** - * Returns the array representation of this set (which has the proper indices - * indicated by indexOf). Note that this is a copy of the internal array used - * for storing the members so that no one can mess with internal state. - */ - ArraySet.prototype.toArray = function ArraySet_toArray() { - return this._array.slice(); - }; - - exports.ArraySet = ArraySet; - -}); -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - * - * Based on the Base 64 VLQ implementation in Closure Compiler: - * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java - * - * Copyright 2011 The Closure Compiler Authors. All rights reserved. - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -define('source-map/base64-vlq', function (require, exports, module) { - - var base64 = require('./base64'); - - // A single base 64 digit can contain 6 bits of data. For the base 64 variable - // length quantities we use in the source map spec, the first bit is the sign, - // the next four bits are the actual value, and the 6th bit is the - // continuation bit. The continuation bit tells us whether there are more - // digits in this value following this digit. - // - // Continuation - // | Sign - // | | - // V V - // 101011 - - var VLQ_BASE_SHIFT = 5; - - // binary: 100000 - var VLQ_BASE = 1 << VLQ_BASE_SHIFT; - - // binary: 011111 - var VLQ_BASE_MASK = VLQ_BASE - 1; - - // binary: 100000 - var VLQ_CONTINUATION_BIT = VLQ_BASE; - - /** - * Converts from a two-complement value to a value where the sign bit is - * is placed in the least significant bit. For example, as decimals: - * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) - * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) - */ - function toVLQSigned(aValue) { - return aValue < 0 - ? ((-aValue) << 1) + 1 - : (aValue << 1) + 0; - } - - /** - * Converts to a two-complement value from a value where the sign bit is - * is placed in the least significant bit. For example, as decimals: - * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 - * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 - */ - function fromVLQSigned(aValue) { - var isNegative = (aValue & 1) === 1; - var shifted = aValue >> 1; - return isNegative - ? -shifted - : shifted; - } - - /** - * Returns the base 64 VLQ encoded value. - */ - exports.encode = function base64VLQ_encode(aValue) { - var encoded = ""; - var digit; - - var vlq = toVLQSigned(aValue); - - do { - digit = vlq & VLQ_BASE_MASK; - vlq >>>= VLQ_BASE_SHIFT; - if (vlq > 0) { - // There are still more digits in this value, so we must make sure the - // continuation bit is marked. - digit |= VLQ_CONTINUATION_BIT; - } - encoded += base64.encode(digit); - } while (vlq > 0); - - return encoded; - }; - - /** - * Decodes the next base 64 VLQ value from the given string and returns the - * value and the rest of the string. - */ - exports.decode = function base64VLQ_decode(aStr) { - var i = 0; - var strLen = aStr.length; - var result = 0; - var shift = 0; - var continuation, digit; - - do { - if (i >= strLen) { - throw new Error("Expected more digits in base 64 VLQ value."); - } - digit = base64.decode(aStr.charAt(i++)); - continuation = !!(digit & VLQ_CONTINUATION_BIT); - digit &= VLQ_BASE_MASK; - result = result + (digit << shift); - shift += VLQ_BASE_SHIFT; - } while (continuation); - - return { - value: fromVLQSigned(result), - rest: aStr.slice(i) - }; - }; - -}); -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -define('source-map/base64', function (require, exports, module) { - - var charToIntMap = {}; - var intToCharMap = {}; - - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' - .split('') - .forEach(function (ch, index) { - charToIntMap[ch] = index; - intToCharMap[index] = ch; - }); - - /** - * Encode an integer in the range of 0 to 63 to a single base 64 digit. - */ - exports.encode = function base64_encode(aNumber) { - if (aNumber in intToCharMap) { - return intToCharMap[aNumber]; - } - throw new TypeError("Must be between 0 and 63: " + aNumber); - }; - - /** - * Decode a single base 64 digit to an integer. - */ - exports.decode = function base64_decode(aChar) { - if (aChar in charToIntMap) { - return charToIntMap[aChar]; - } - throw new TypeError("Not a valid base 64 digit: " + aChar); - }; - -}); -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -define('source-map/binary-search', function (require, exports, module) { - - /** - * Recursive implementation of binary search. - * - * @param aLow Indices here and lower do not contain the needle. - * @param aHigh Indices here and higher do not contain the needle. - * @param aNeedle The element being searched for. - * @param aHaystack The non-empty array being searched. - * @param aCompare Function which takes two elements and returns -1, 0, or 1. - */ - function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare) { - // This function terminates when one of the following is true: - // - // 1. We find the exact element we are looking for. - // - // 2. We did not find the exact element, but we can return the next - // closest element that is less than that element. - // - // 3. We did not find the exact element, and there is no next-closest - // element which is less than the one we are searching for, so we - // return null. - var mid = Math.floor((aHigh - aLow) / 2) + aLow; - var cmp = aCompare(aNeedle, aHaystack[mid]); - if (cmp === 0) { - // Found the element we are looking for. - return aHaystack[mid]; - } - else if (cmp > 0) { - // aHaystack[mid] is greater than our needle. - if (aHigh - mid > 1) { - // The element is in the upper half. - return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare); - } - // We did not find an exact match, return the next closest one - // (termination case 2). - return aHaystack[mid]; - } - else { - // aHaystack[mid] is less than our needle. - if (mid - aLow > 1) { - // The element is in the lower half. - return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare); - } - // The exact needle element was not found in this haystack. Determine if - // we are in termination case (2) or (3) and return the appropriate thing. - return aLow < 0 - ? null - : aHaystack[aLow]; - } - } - - /** - * This is an implementation of binary search which will always try and return - * the next lowest value checked if there is no exact hit. This is because - * mappings between original and generated line/col pairs are single points, - * and there is an implicit region between each of them, so a miss just means - * that you aren't on the very start of a region. - * - * @param aNeedle The element you are looking for. - * @param aHaystack The array that is being searched. - * @param aCompare A function which takes the needle and an element in the - * array and returns -1, 0, or 1 depending on whether the needle is less - * than, equal to, or greater than the element, respectively. - */ - exports.search = function search(aNeedle, aHaystack, aCompare) { - return aHaystack.length > 0 - ? recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare) - : null; - }; - -}); -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -define('source-map/source-map-consumer', function (require, exports, module) { - - var util = require('./util'); - var binarySearch = require('./binary-search'); - var ArraySet = require('./array-set').ArraySet; - var base64VLQ = require('./base64-vlq'); - - /** - * A SourceMapConsumer instance represents a parsed source map which we can - * query for information about the original file positions by giving it a file - * position in the generated source. - * - * The only parameter is the raw source map (either as a JSON string, or - * already parsed to an object). According to the spec, source maps have the - * following attributes: - * - * - version: Which version of the source map spec this map is following. - * - sources: An array of URLs to the original source files. - * - names: An array of identifiers which can be referrenced by individual mappings. - * - sourceRoot: Optional. The URL root from which all sources are relative. - * - sourcesContent: Optional. An array of contents of the original source files. - * - mappings: A string of base64 VLQs which contain the actual mappings. - * - file: The generated file this source map is associated with. - * - * Here is an example source map, taken from the source map spec[0]: - * - * { - * version : 3, - * file: "out.js", - * sourceRoot : "", - * sources: ["foo.js", "bar.js"], - * names: ["src", "maps", "are", "fun"], - * mappings: "AA,AB;;ABCDE;" - * } - * - * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# - */ - function SourceMapConsumer(aSourceMap) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, '')); - } - - var version = util.getArg(sourceMap, 'version'); - var sources = util.getArg(sourceMap, 'sources'); - var names = util.getArg(sourceMap, 'names'); - var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); - var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); - var mappings = util.getArg(sourceMap, 'mappings'); - var file = util.getArg(sourceMap, 'file'); - - if (version !== this._version) { - throw new Error('Unsupported version: ' + version); - } - - this._names = ArraySet.fromArray(names); - this._sources = ArraySet.fromArray(sources); - this.sourceRoot = sourceRoot; - this.sourcesContent = sourcesContent; - this.file = file; - - // `this._generatedMappings` and `this._originalMappings` hold the parsed - // mapping coordinates from the source map's "mappings" attribute. Each - // object in the array is of the form - // - // { - // generatedLine: The line number in the generated code, - // generatedColumn: The column number in the generated code, - // source: The path to the original source file that generated this - // chunk of code, - // originalLine: The line number in the original source that - // corresponds to this chunk of generated code, - // originalColumn: The column number in the original source that - // corresponds to this chunk of generated code, - // name: The name of the original symbol which generated this chunk of - // code. - // } - // - // All properties except for `generatedLine` and `generatedColumn` can be - // `null`. - // - // `this._generatedMappings` is ordered by the generated positions. - // - // `this._originalMappings` is ordered by the original positions. - this._generatedMappings = []; - this._originalMappings = []; - this._parseMappings(mappings, sourceRoot); - } - - /** - * The version of the source mapping spec that we are consuming. - */ - SourceMapConsumer.prototype._version = 3; - - /** - * The list of original sources. - */ - Object.defineProperty(SourceMapConsumer.prototype, 'sources', { - get: function () { - return this._sources.toArray().map(function (s) { - return this.sourceRoot ? util.join(this.sourceRoot, s) : s; - }, this); - } - }); - - /** - * Parse the mappings in a string in to a data structure which we can easily - * query (an ordered list in this._generatedMappings). - */ - SourceMapConsumer.prototype._parseMappings = - function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { - var generatedLine = 1; - var previousGeneratedColumn = 0; - var previousOriginalLine = 0; - var previousOriginalColumn = 0; - var previousSource = 0; - var previousName = 0; - var mappingSeparator = /^[,;]/; - var str = aStr; - var mapping; - var temp; - - while (str.length > 0) { - if (str.charAt(0) === ';') { - generatedLine++; - str = str.slice(1); - previousGeneratedColumn = 0; - } - else if (str.charAt(0) === ',') { - str = str.slice(1); - } - else { - mapping = {}; - mapping.generatedLine = generatedLine; - - // Generated column. - temp = base64VLQ.decode(str); - mapping.generatedColumn = previousGeneratedColumn + temp.value; - previousGeneratedColumn = mapping.generatedColumn; - str = temp.rest; - - if (str.length > 0 && !mappingSeparator.test(str.charAt(0))) { - // Original source. - temp = base64VLQ.decode(str); - mapping.source = this._sources.at(previousSource + temp.value); - previousSource += temp.value; - str = temp.rest; - if (str.length === 0 || mappingSeparator.test(str.charAt(0))) { - throw new Error('Found a source, but no line and column'); - } - - // Original line. - temp = base64VLQ.decode(str); - mapping.originalLine = previousOriginalLine + temp.value; - previousOriginalLine = mapping.originalLine; - // Lines are stored 0-based - mapping.originalLine += 1; - str = temp.rest; - if (str.length === 0 || mappingSeparator.test(str.charAt(0))) { - throw new Error('Found a source and line, but no column'); - } - - // Original column. - temp = base64VLQ.decode(str); - mapping.originalColumn = previousOriginalColumn + temp.value; - previousOriginalColumn = mapping.originalColumn; - str = temp.rest; - - if (str.length > 0 && !mappingSeparator.test(str.charAt(0))) { - // Original name. - temp = base64VLQ.decode(str); - mapping.name = this._names.at(previousName + temp.value); - previousName += temp.value; - str = temp.rest; - } - } - - this._generatedMappings.push(mapping); - if (typeof mapping.originalLine === 'number') { - this._originalMappings.push(mapping); - } - } - } - - this._originalMappings.sort(this._compareOriginalPositions); - }; - - /** - * Comparator between two mappings where the original positions are compared. - */ - SourceMapConsumer.prototype._compareOriginalPositions = - function SourceMapConsumer_compareOriginalPositions(mappingA, mappingB) { - if (mappingA.source > mappingB.source) { - return 1; - } - else if (mappingA.source < mappingB.source) { - return -1; - } - else { - var cmp = mappingA.originalLine - mappingB.originalLine; - return cmp === 0 - ? mappingA.originalColumn - mappingB.originalColumn - : cmp; - } - }; - - /** - * Comparator between two mappings where the generated positions are compared. - */ - SourceMapConsumer.prototype._compareGeneratedPositions = - function SourceMapConsumer_compareGeneratedPositions(mappingA, mappingB) { - var cmp = mappingA.generatedLine - mappingB.generatedLine; - return cmp === 0 - ? mappingA.generatedColumn - mappingB.generatedColumn - : cmp; - }; - - /** - * Find the mapping that best matches the hypothetical "needle" mapping that - * we are searching for in the given "haystack" of mappings. - */ - SourceMapConsumer.prototype._findMapping = - function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, - aColumnName, aComparator) { - // To return the position we are searching for, we must first find the - // mapping for the given position and then return the opposite position it - // points to. Because the mappings are sorted, we can use binary search to - // find the best mapping. - - if (aNeedle[aLineName] <= 0) { - throw new TypeError('Line must be greater than or equal to 1, got ' - + aNeedle[aLineName]); - } - if (aNeedle[aColumnName] < 0) { - throw new TypeError('Column must be greater than or equal to 0, got ' - + aNeedle[aColumnName]); - } - - return binarySearch.search(aNeedle, aMappings, aComparator); - }; - - /** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. - * - column: The column number in the generated source. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. - * - column: The column number in the original source, or null. - * - name: The original identifier, or null. - */ - SourceMapConsumer.prototype.originalPositionFor = - function SourceMapConsumer_originalPositionFor(aArgs) { - var needle = { - generatedLine: util.getArg(aArgs, 'line'), - generatedColumn: util.getArg(aArgs, 'column') - }; - - var mapping = this._findMapping(needle, - this._generatedMappings, - "generatedLine", - "generatedColumn", - this._compareGeneratedPositions); - - if (mapping) { - var source = util.getArg(mapping, 'source', null); - if (source && this.sourceRoot) { - source = util.join(this.sourceRoot, source); - } - return { - source: source, - line: util.getArg(mapping, 'originalLine', null), - column: util.getArg(mapping, 'originalColumn', null), - name: util.getArg(mapping, 'name', null) - }; - } - - return { - source: null, - line: null, - column: null, - name: null - }; - }; - - /** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * availible. - */ - SourceMapConsumer.prototype.sourceContentFor = - function SourceMapConsumer_sourceContentFor(aSource) { - if (!this.sourcesContent) { - return null; - } - - if (this.sourceRoot) { - aSource = util.relative(this.sourceRoot, aSource); - } - - if (this._sources.has(aSource)) { - return this.sourcesContent[this._sources.indexOf(aSource)]; - } - - var url; - if (this.sourceRoot - && (url = util.urlParse(this.sourceRoot))) { - // XXX: file:// URIs and absolute paths lead to unexpected behavior for - // many users. We can help them out when they expect file:// URIs to - // behave like it would if they were running a local HTTP server. See - // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. - var fileUriAbsPath = aSource.replace(/^file:\/\//, ""); - if (url.scheme == "file" - && this._sources.has(fileUriAbsPath)) { - return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] - } - - if ((!url.path || url.path == "/") - && this._sources.has("/" + aSource)) { - return this.sourcesContent[this._sources.indexOf("/" + aSource)]; - } - } - - throw new Error('"' + aSource + '" is not in the SourceMap.'); - }; - - /** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. - * - column: The column number in the original source. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. - * - column: The column number in the generated source, or null. - */ - SourceMapConsumer.prototype.generatedPositionFor = - function SourceMapConsumer_generatedPositionFor(aArgs) { - var needle = { - source: util.getArg(aArgs, 'source'), - originalLine: util.getArg(aArgs, 'line'), - originalColumn: util.getArg(aArgs, 'column') - }; - - if (this.sourceRoot) { - needle.source = util.relative(this.sourceRoot, needle.source); - } - - var mapping = this._findMapping(needle, - this._originalMappings, - "originalLine", - "originalColumn", - this._compareOriginalPositions); - - if (mapping) { - return { - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null) - }; - } - - return { - line: null, - column: null - }; - }; - - SourceMapConsumer.GENERATED_ORDER = 1; - SourceMapConsumer.ORIGINAL_ORDER = 2; - - /** - * Iterate over each mapping between an original source/line/column and a - * generated line/column in this source map. - * - * @param Function aCallback - * The function that is called with each mapping. - * @param Object aContext - * Optional. If specified, this object will be the value of `this` every - * time that `aCallback` is called. - * @param aOrder - * Either `SourceMapConsumer.GENERATED_ORDER` or - * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to - * iterate over the mappings sorted by the generated file's line/column - * order or the original's source/line/column order, respectively. Defaults to - * `SourceMapConsumer.GENERATED_ORDER`. - */ - SourceMapConsumer.prototype.eachMapping = - function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { - var context = aContext || null; - var order = aOrder || SourceMapConsumer.GENERATED_ORDER; - - var mappings; - switch (order) { - case SourceMapConsumer.GENERATED_ORDER: - mappings = this._generatedMappings; - break; - case SourceMapConsumer.ORIGINAL_ORDER: - mappings = this._originalMappings; - break; - default: - throw new Error("Unknown order of iteration."); - } - - var sourceRoot = this.sourceRoot; - mappings.map(function (mapping) { - var source = mapping.source; - if (source && sourceRoot) { - source = util.join(sourceRoot, source); - } - return { - source: source, - generatedLine: mapping.generatedLine, - generatedColumn: mapping.generatedColumn, - originalLine: mapping.originalLine, - originalColumn: mapping.originalColumn, - name: mapping.name - }; - }).forEach(aCallback, context); - }; - - exports.SourceMapConsumer = SourceMapConsumer; - -}); -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -define('source-map/source-map-generator', function (require, exports, module) { - - var base64VLQ = require('./base64-vlq'); - var util = require('./util'); - var ArraySet = require('./array-set').ArraySet; - - /** - * An instance of the SourceMapGenerator represents a source map which is - * being built incrementally. To create a new one, you must pass an object - * with the following properties: - * - * - file: The filename of the generated source. - * - sourceRoot: An optional root for all URLs in this source map. - */ - function SourceMapGenerator(aArgs) { - this._file = util.getArg(aArgs, 'file'); - this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); - this._sources = new ArraySet(); - this._names = new ArraySet(); - this._mappings = []; - this._sourcesContents = null; - } - - SourceMapGenerator.prototype._version = 3; - - /** - * Creates a new SourceMapGenerator based on a SourceMapConsumer - * - * @param aSourceMapConsumer The SourceMap. - */ - SourceMapGenerator.fromSourceMap = - function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { - var sourceRoot = aSourceMapConsumer.sourceRoot; - var generator = new SourceMapGenerator({ - file: aSourceMapConsumer.file, - sourceRoot: sourceRoot - }); - aSourceMapConsumer.eachMapping(function (mapping) { - var newMapping = { - generated: { - line: mapping.generatedLine, - column: mapping.generatedColumn - } - }; - - if (mapping.source) { - newMapping.source = mapping.source; - if (sourceRoot) { - newMapping.source = util.relative(sourceRoot, newMapping.source); - } - - newMapping.original = { - line: mapping.originalLine, - column: mapping.originalColumn - }; - - if (mapping.name) { - newMapping.name = mapping.name; - } - } - - generator.addMapping(newMapping); - }); - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content) { - generator.setSourceContent(sourceFile, content); - } - }); - return generator; - }; - - /** - * Add a single mapping from original source line and column to the generated - * source's line and column for this source map being created. The mapping - * object should have the following properties: - * - * - generated: An object with the generated line and column positions. - * - original: An object with the original line and column positions. - * - source: The original source file (relative to the sourceRoot). - * - name: An optional original token name for this mapping. - */ - SourceMapGenerator.prototype.addMapping = - function SourceMapGenerator_addMapping(aArgs) { - var generated = util.getArg(aArgs, 'generated'); - var original = util.getArg(aArgs, 'original', null); - var source = util.getArg(aArgs, 'source', null); - var name = util.getArg(aArgs, 'name', null); - - this._validateMapping(generated, original, source, name); - - if (source && !this._sources.has(source)) { - this._sources.add(source); - } - - if (name && !this._names.has(name)) { - this._names.add(name); - } - - this._mappings.push({ - generated: generated, - original: original, - source: source, - name: name - }); - }; - - /** - * Set the source content for a source file. - */ - SourceMapGenerator.prototype.setSourceContent = - function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { - var source = aSourceFile; - if (this._sourceRoot) { - source = util.relative(this._sourceRoot, source); - } - - if (aSourceContent !== null) { - // Add the source content to the _sourcesContents map. - // Create a new _sourcesContents map if the property is null. - if (!this._sourcesContents) { - this._sourcesContents = {}; - } - this._sourcesContents[util.toSetString(source)] = aSourceContent; - } else { - // Remove the source file from the _sourcesContents map. - // If the _sourcesContents map is empty, set the property to null. - delete this._sourcesContents[util.toSetString(source)]; - if (Object.keys(this._sourcesContents).length === 0) { - this._sourcesContents = null; - } - } - }; - - /** - * Applies the mappings of a sub-source-map for a specific source file to the - * source map being generated. Each mapping to the supplied source file is - * rewritten using the supplied source map. Note: The resolution for the - * resulting mappings is the minimium of this map and the supplied map. - * - * @param aSourceMapConsumer The source map to be applied. - * @param aSourceFile Optional. The filename of the source file. - * If omitted, SourceMapConsumer's file property will be used. - */ - SourceMapGenerator.prototype.applySourceMap = - function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile) { - // If aSourceFile is omitted, we will use the file property of the SourceMap - if (!aSourceFile) { - aSourceFile = aSourceMapConsumer.file; - } - var sourceRoot = this._sourceRoot; - // Make "aSourceFile" relative if an absolute Url is passed. - if (sourceRoot) { - aSourceFile = util.relative(sourceRoot, aSourceFile); - } - // Applying the SourceMap can add and remove items from the sources and - // the names array. - var newSources = new ArraySet(); - var newNames = new ArraySet(); - - // Find mappings for the "aSourceFile" - this._mappings.forEach(function (mapping) { - if (mapping.source === aSourceFile && mapping.original) { - // Check if it can be mapped by the source map, then update the mapping. - var original = aSourceMapConsumer.originalPositionFor({ - line: mapping.original.line, - column: mapping.original.column - }); - if (original.source !== null) { - // Copy mapping - if (sourceRoot) { - mapping.source = util.relative(sourceRoot, original.source); - } else { - mapping.source = original.source; - } - mapping.original.line = original.line; - mapping.original.column = original.column; - if (original.name !== null && mapping.name !== null) { - // Only use the identifier name if it's an identifier - // in both SourceMaps - mapping.name = original.name; - } - } - } - - var source = mapping.source; - if (source && !newSources.has(source)) { - newSources.add(source); - } - - var name = mapping.name; - if (name && !newNames.has(name)) { - newNames.add(name); - } - - }, this); - this._sources = newSources; - this._names = newNames; - - // Copy sourcesContents of applied map. - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content) { - if (sourceRoot) { - sourceFile = util.relative(sourceRoot, sourceFile); - } - this.setSourceContent(sourceFile, content); - } - }, this); - }; - - /** - * A mapping can have one of the three levels of data: - * - * 1. Just the generated position. - * 2. The Generated position, original position, and original source. - * 3. Generated and original position, original source, as well as a name - * token. - * - * To maintain consistency, we validate that any new mapping being added falls - * in to one of these categories. - */ - SourceMapGenerator.prototype._validateMapping = - function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, - aName) { - if (aGenerated && 'line' in aGenerated && 'column' in aGenerated - && aGenerated.line > 0 && aGenerated.column >= 0 - && !aOriginal && !aSource && !aName) { - // Case 1. - return; - } - else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated - && aOriginal && 'line' in aOriginal && 'column' in aOriginal - && aGenerated.line > 0 && aGenerated.column >= 0 - && aOriginal.line > 0 && aOriginal.column >= 0 - && aSource) { - // Cases 2 and 3. - return; - } - else { - throw new Error('Invalid mapping.'); - } - }; - - function cmpLocation(loc1, loc2) { - var cmp = (loc1 && loc1.line) - (loc2 && loc2.line); - return cmp ? cmp : (loc1 && loc1.column) - (loc2 && loc2.column); - } - - function strcmp(str1, str2) { - str1 = str1 || ''; - str2 = str2 || ''; - return (str1 > str2) - (str1 < str2); - } - - function cmpMapping(mappingA, mappingB) { - return cmpLocation(mappingA.generated, mappingB.generated) || - cmpLocation(mappingA.original, mappingB.original) || - strcmp(mappingA.source, mappingB.source) || - strcmp(mappingA.name, mappingB.name); - } - - /** - * Serialize the accumulated mappings in to the stream of base 64 VLQs - * specified by the source map format. - */ - SourceMapGenerator.prototype._serializeMappings = - function SourceMapGenerator_serializeMappings() { - var previousGeneratedColumn = 0; - var previousGeneratedLine = 1; - var previousOriginalColumn = 0; - var previousOriginalLine = 0; - var previousName = 0; - var previousSource = 0; - var result = ''; - var mapping; - - // The mappings must be guaranteed to be in sorted order before we start - // serializing them or else the generated line numbers (which are defined - // via the ';' separators) will be all messed up. Note: it might be more - // performant to maintain the sorting as we insert them, rather than as we - // serialize them, but the big O is the same either way. - this._mappings.sort(cmpMapping); - - for (var i = 0, len = this._mappings.length; i < len; i++) { - mapping = this._mappings[i]; - - if (mapping.generated.line !== previousGeneratedLine) { - previousGeneratedColumn = 0; - while (mapping.generated.line !== previousGeneratedLine) { - result += ';'; - previousGeneratedLine++; - } - } - else { - if (i > 0) { - if (!cmpMapping(mapping, this._mappings[i - 1])) { - continue; - } - result += ','; - } - } - - result += base64VLQ.encode(mapping.generated.column - - previousGeneratedColumn); - previousGeneratedColumn = mapping.generated.column; - - if (mapping.source && mapping.original) { - result += base64VLQ.encode(this._sources.indexOf(mapping.source) - - previousSource); - previousSource = this._sources.indexOf(mapping.source); - - // lines are stored 0-based in SourceMap spec version 3 - result += base64VLQ.encode(mapping.original.line - 1 - - previousOriginalLine); - previousOriginalLine = mapping.original.line - 1; - - result += base64VLQ.encode(mapping.original.column - - previousOriginalColumn); - previousOriginalColumn = mapping.original.column; - - if (mapping.name) { - result += base64VLQ.encode(this._names.indexOf(mapping.name) - - previousName); - previousName = this._names.indexOf(mapping.name); - } - } - } - - return result; - }; - - /** - * Externalize the source map. - */ - SourceMapGenerator.prototype.toJSON = - function SourceMapGenerator_toJSON() { - var map = { - version: this._version, - file: this._file, - sources: this._sources.toArray(), - names: this._names.toArray(), - mappings: this._serializeMappings() - }; - if (this._sourceRoot) { - map.sourceRoot = this._sourceRoot; - } - if (this._sourcesContents) { - map.sourcesContent = map.sources.map(function (source) { - if (map.sourceRoot) { - source = util.relative(map.sourceRoot, source); - } - return Object.prototype.hasOwnProperty.call( - this._sourcesContents, util.toSetString(source)) - ? this._sourcesContents[util.toSetString(source)] - : null; - }, this); - } - return map; - }; - - /** - * Render the source map being generated to a string. - */ - SourceMapGenerator.prototype.toString = - function SourceMapGenerator_toString() { - return JSON.stringify(this); - }; - - exports.SourceMapGenerator = SourceMapGenerator; - -}); -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -define('source-map/source-node', function (require, exports, module) { - - var SourceMapGenerator = require('./source-map-generator').SourceMapGenerator; - var util = require('./util'); - - /** - * SourceNodes provide a way to abstract over interpolating/concatenating - * snippets of generated JavaScript source code while maintaining the line and - * column information associated with the original source code. - * - * @param aLine The original line number. - * @param aColumn The original column number. - * @param aSource The original source's filename. - * @param aChunks Optional. An array of strings which are snippets of - * generated JS, or other SourceNodes. - * @param aName The original identifier. - */ - function SourceNode(aLine, aColumn, aSource, aChunks, aName) { - this.children = []; - this.sourceContents = {}; - this.line = aLine === undefined ? null : aLine; - this.column = aColumn === undefined ? null : aColumn; - this.source = aSource === undefined ? null : aSource; - this.name = aName === undefined ? null : aName; - if (aChunks != null) this.add(aChunks); - } - - /** - * Creates a SourceNode from generated code and a SourceMapConsumer. - * - * @param aGeneratedCode The generated code - * @param aSourceMapConsumer The SourceMap for the generated code - */ - SourceNode.fromStringWithSourceMap = - function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer) { - // The SourceNode we want to fill with the generated code - // and the SourceMap - var node = new SourceNode(); - - // The generated code - // Processed fragments are removed from this array. - var remainingLines = aGeneratedCode.split('\n'); - - // We need to remember the position of "remainingLines" - var lastGeneratedLine = 1, lastGeneratedColumn = 0; - - // The generate SourceNodes we need a code range. - // To extract it current and last mapping is used. - // Here we store the last mapping. - var lastMapping = null; - - aSourceMapConsumer.eachMapping(function (mapping) { - if (lastMapping === null) { - // We add the generated code until the first mapping - // to the SourceNode without any mapping. - // Each line is added as separate string. - while (lastGeneratedLine < mapping.generatedLine) { - node.add(remainingLines.shift() + "\n"); - lastGeneratedLine++; - } - if (lastGeneratedColumn < mapping.generatedColumn) { - var nextLine = remainingLines[0]; - node.add(nextLine.substr(0, mapping.generatedColumn)); - remainingLines[0] = nextLine.substr(mapping.generatedColumn); - lastGeneratedColumn = mapping.generatedColumn; - } - } else { - // We add the code from "lastMapping" to "mapping": - // First check if there is a new line in between. - if (lastGeneratedLine < mapping.generatedLine) { - var code = ""; - // Associate full lines with "lastMapping" - do { - code += remainingLines.shift() + "\n"; - lastGeneratedLine++; - lastGeneratedColumn = 0; - } while (lastGeneratedLine < mapping.generatedLine); - // When we reached the correct line, we add code until we - // reach the correct column too. - if (lastGeneratedColumn < mapping.generatedColumn) { - var nextLine = remainingLines[0]; - code += nextLine.substr(0, mapping.generatedColumn); - remainingLines[0] = nextLine.substr(mapping.generatedColumn); - lastGeneratedColumn = mapping.generatedColumn; - } - // Create the SourceNode. - addMappingWithCode(lastMapping, code); - } else { - // There is no new line in between. - // Associate the code between "lastGeneratedColumn" and - // "mapping.generatedColumn" with "lastMapping" - var nextLine = remainingLines[0]; - var code = nextLine.substr(0, mapping.generatedColumn - - lastGeneratedColumn); - remainingLines[0] = nextLine.substr(mapping.generatedColumn - - lastGeneratedColumn); - lastGeneratedColumn = mapping.generatedColumn; - addMappingWithCode(lastMapping, code); - } - } - lastMapping = mapping; - }, this); - // We have processed all mappings. - // Associate the remaining code in the current line with "lastMapping" - // and add the remaining lines without any mapping - addMappingWithCode(lastMapping, remainingLines.join("\n")); - - // Copy sourcesContent into SourceNode - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content) { - node.setSourceContent(sourceFile, content); - } - }); - - return node; - - function addMappingWithCode(mapping, code) { - if (mapping.source === undefined) { - node.add(code); - } else { - node.add(new SourceNode(mapping.originalLine, - mapping.originalColumn, - mapping.source, - code, - mapping.name)); - } - } - }; - - /** - * Add a chunk of generated JS to this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ - SourceNode.prototype.add = function SourceNode_add(aChunk) { - if (Array.isArray(aChunk)) { - aChunk.forEach(function (chunk) { - this.add(chunk); - }, this); - } - else if (aChunk instanceof SourceNode || typeof aChunk === "string") { - if (aChunk) { - this.children.push(aChunk); - } - } - else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; - }; - - /** - * Add a chunk of generated JS to the beginning of this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ - SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { - if (Array.isArray(aChunk)) { - for (var i = aChunk.length-1; i >= 0; i--) { - this.prepend(aChunk[i]); - } - } - else if (aChunk instanceof SourceNode || typeof aChunk === "string") { - this.children.unshift(aChunk); - } - else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; - }; - - /** - * Walk over the tree of JS snippets in this node and its children. The - * walking function is called once for each snippet of JS and is passed that - * snippet and the its original associated source's line/column location. - * - * @param aFn The traversal function. - */ - SourceNode.prototype.walk = function SourceNode_walk(aFn) { - this.children.forEach(function (chunk) { - if (chunk instanceof SourceNode) { - chunk.walk(aFn); - } - else { - if (chunk !== '') { - aFn(chunk, { source: this.source, - line: this.line, - column: this.column, - name: this.name }); - } - } - }, this); - }; - - /** - * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between - * each of `this.children`. - * - * @param aSep The separator. - */ - SourceNode.prototype.join = function SourceNode_join(aSep) { - var newChildren; - var i; - var len = this.children.length; - if (len > 0) { - newChildren = []; - for (i = 0; i < len-1; i++) { - newChildren.push(this.children[i]); - newChildren.push(aSep); - } - newChildren.push(this.children[i]); - this.children = newChildren; - } - return this; - }; - - /** - * Call String.prototype.replace on the very right-most source snippet. Useful - * for trimming whitespace from the end of a source node, etc. - * - * @param aPattern The pattern to replace. - * @param aReplacement The thing to replace the pattern with. - */ - SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { - var lastChild = this.children[this.children.length - 1]; - if (lastChild instanceof SourceNode) { - lastChild.replaceRight(aPattern, aReplacement); - } - else if (typeof lastChild === 'string') { - this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); - } - else { - this.children.push(''.replace(aPattern, aReplacement)); - } - return this; - }; - - /** - * Set the source content for a source file. This will be added to the SourceMapGenerator - * in the sourcesContent field. - * - * @param aSourceFile The filename of the source file - * @param aSourceContent The content of the source file - */ - SourceNode.prototype.setSourceContent = - function SourceNode_setSourceContent(aSourceFile, aSourceContent) { - this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; - }; - - /** - * Walk over the tree of SourceNodes. The walking function is called for each - * source file content and is passed the filename and source content. - * - * @param aFn The traversal function. - */ - SourceNode.prototype.walkSourceContents = - function SourceNode_walkSourceContents(aFn) { - this.children.forEach(function (chunk) { - if (chunk instanceof SourceNode) { - chunk.walkSourceContents(aFn); - } - }, this); - Object.keys(this.sourceContents).forEach(function (sourceFileKey) { - aFn(util.fromSetString(sourceFileKey), this.sourceContents[sourceFileKey]); - }, this); - }; - - /** - * Return the string representation of this source node. Walks over the tree - * and concatenates all the various snippets together to one string. - */ - SourceNode.prototype.toString = function SourceNode_toString() { - var str = ""; - this.walk(function (chunk) { - str += chunk; - }); - return str; - }; - - /** - * Returns the string representation of this source node along with a source - * map. - */ - SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { - var generated = { - code: "", - line: 1, - column: 0 - }; - var map = new SourceMapGenerator(aArgs); - var sourceMappingActive = false; - this.walk(function (chunk, original) { - generated.code += chunk; - if (original.source !== null - && original.line !== null - && original.column !== null) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column - }, - generated: { - line: generated.line, - column: generated.column - }, - name: original.name - }); - sourceMappingActive = true; - } else if (sourceMappingActive) { - map.addMapping({ - generated: { - line: generated.line, - column: generated.column - } - }); - sourceMappingActive = false; - } - chunk.split('').forEach(function (ch) { - if (ch === '\n') { - generated.line++; - generated.column = 0; - } else { - generated.column++; - } - }); - }); - this.walkSourceContents(function (sourceFile, sourceContent) { - map.setSourceContent(sourceFile, sourceContent); - }); - - return { code: generated.code, map: map }; - }; - - exports.SourceNode = SourceNode; - -}); -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ - -define('source-map/util', function (require, exports, module) { - - /** - * This is a helper function for getting values from parameter/options - * objects. - * - * @param args The object we are extracting values from - * @param name The name of the property we are getting. - * @param defaultValue An optional value to return if the property is missing - * from the object. If this is not specified and the property is missing, an - * error will be thrown. - */ - function getArg(aArgs, aName, aDefaultValue) { - if (aName in aArgs) { - return aArgs[aName]; - } else if (arguments.length === 3) { - return aDefaultValue; - } else { - throw new Error('"' + aName + '" is a required argument.'); - } - } - exports.getArg = getArg; - - var urlRegexp = /([\w+\-.]+):\/\/((\w+:\w+)@)?([\w.]+)?(:(\d+))?(\S+)?/; - - function urlParse(aUrl) { - var match = aUrl.match(urlRegexp); - if (!match) { - return null; - } - return { - scheme: match[1], - auth: match[3], - host: match[4], - port: match[6], - path: match[7] - }; - } - exports.urlParse = urlParse; - - function urlGenerate(aParsedUrl) { - var url = aParsedUrl.scheme + "://"; - if (aParsedUrl.auth) { - url += aParsedUrl.auth + "@" - } - if (aParsedUrl.host) { - url += aParsedUrl.host; - } - if (aParsedUrl.port) { - url += ":" + aParsedUrl.port - } - if (aParsedUrl.path) { - url += aParsedUrl.path; - } - return url; - } - exports.urlGenerate = urlGenerate; - - function join(aRoot, aPath) { - var url; - - if (aPath.match(urlRegexp)) { - return aPath; - } - - if (aPath.charAt(0) === '/' && (url = urlParse(aRoot))) { - url.path = aPath; - return urlGenerate(url); - } - - return aRoot.replace(/\/$/, '') + '/' + aPath; - } - exports.join = join; - - /** - * Because behavior goes wacky when you set `__proto__` on objects, we - * have to prefix all the strings in our set with an arbitrary character. - * - * See https://github.com/mozilla/source-map/pull/31 and - * https://github.com/mozilla/source-map/issues/30 - * - * @param String aStr - */ - function toSetString(aStr) { - return '$' + aStr; - } - exports.toSetString = toSetString; - - function fromSetString(aStr) { - return aStr.substr(1); - } - exports.fromSetString = fromSetString; - - function relative(aRoot, aPath) { - aRoot = aRoot.replace(/\/$/, ''); - - var url = urlParse(aRoot); - if (aPath.charAt(0) == "/" && url && url.path == "/") { - return aPath.slice(1); - } - - return aPath.indexOf(aRoot + '/') === 0 - ? aPath.substr(aRoot.length + 1) - : aPath; - } - exports.relative = relative; - -}); -define('source-map', function (require, exports, module) { - -/* - * Copyright 2009-2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE.txt or: - * http://opensource.org/licenses/BSD-3-Clause - */ -exports.SourceMapGenerator = require('./source-map/source-map-generator').SourceMapGenerator; -exports.SourceMapConsumer = require('./source-map/source-map-consumer').SourceMapConsumer; -exports.SourceNode = require('./source-map/source-node').SourceNode; - -}); - -//Distributed under the BSD license: -//Copyright 2012 (c) Mihai Bazon -define('uglifyjs2', ['exports', 'source-map', 'logger', 'env!env/file'], function (exports, MOZ_SourceMap, logger, rjsFile) { -(function(exports, global) { - global["UglifyJS"] = exports; - "use strict"; - function array_to_hash(a) { - var ret = Object.create(null); - for (var i = 0; i < a.length; ++i) ret[a[i]] = true; - return ret; - } - function slice(a, start) { - return Array.prototype.slice.call(a, start || 0); - } - function characters(str) { - return str.split(""); - } - function member(name, array) { - for (var i = array.length; --i >= 0; ) if (array[i] == name) return true; - return false; - } - function find_if(func, array) { - for (var i = 0, n = array.length; i < n; ++i) { - if (func(array[i])) return array[i]; - } - } - function repeat_string(str, i) { - if (i <= 0) return ""; - if (i == 1) return str; - var d = repeat_string(str, i >> 1); - d += d; - if (i & 1) d += str; - return d; - } - function DefaultsError(msg, defs) { - this.msg = msg; - this.defs = defs; - } - function defaults(args, defs, croak) { - if (args === true) args = {}; - var ret = args || {}; - if (croak) for (var i in ret) if (ret.hasOwnProperty(i) && !defs.hasOwnProperty(i)) throw new DefaultsError("`" + i + "` is not a supported option", defs); - for (var i in defs) if (defs.hasOwnProperty(i)) { - ret[i] = args && args.hasOwnProperty(i) ? args[i] : defs[i]; - } - return ret; - } - function merge(obj, ext) { - for (var i in ext) if (ext.hasOwnProperty(i)) { - obj[i] = ext[i]; - } - return obj; - } - function noop() {} - var MAP = function() { - function MAP(a, f, backwards) { - var ret = [], top = [], i; - function doit() { - var val = f(a[i], i); - var is_last = val instanceof Last; - if (is_last) val = val.v; - if (val instanceof AtTop) { - val = val.v; - if (val instanceof Splice) { - top.push.apply(top, backwards ? val.v.slice().reverse() : val.v); - } else { - top.push(val); - } - } else if (val !== skip) { - if (val instanceof Splice) { - ret.push.apply(ret, backwards ? val.v.slice().reverse() : val.v); - } else { - ret.push(val); - } - } - return is_last; - } - if (a instanceof Array) { - if (backwards) { - for (i = a.length; --i >= 0; ) if (doit()) break; - ret.reverse(); - top.reverse(); - } else { - for (i = 0; i < a.length; ++i) if (doit()) break; - } - } else { - for (i in a) if (a.hasOwnProperty(i)) if (doit()) break; - } - return top.concat(ret); - } - MAP.at_top = function(val) { - return new AtTop(val); - }; - MAP.splice = function(val) { - return new Splice(val); - }; - MAP.last = function(val) { - return new Last(val); - }; - var skip = MAP.skip = {}; - function AtTop(val) { - this.v = val; - } - function Splice(val) { - this.v = val; - } - function Last(val) { - this.v = val; - } - return MAP; - }(); - function push_uniq(array, el) { - if (array.indexOf(el) < 0) array.push(el); - } - function string_template(text, props) { - return text.replace(/\{(.+?)\}/g, function(str, p) { - return props[p]; - }); - } - function remove(array, el) { - for (var i = array.length; --i >= 0; ) { - if (array[i] === el) array.splice(i, 1); - } - } - function mergeSort(array, cmp) { - if (array.length < 2) return array.slice(); - function merge(a, b) { - var r = [], ai = 0, bi = 0, i = 0; - while (ai < a.length && bi < b.length) { - cmp(a[ai], b[bi]) <= 0 ? r[i++] = a[ai++] : r[i++] = b[bi++]; - } - if (ai < a.length) r.push.apply(r, a.slice(ai)); - if (bi < b.length) r.push.apply(r, b.slice(bi)); - return r; - } - function _ms(a) { - if (a.length <= 1) return a; - var m = Math.floor(a.length / 2), left = a.slice(0, m), right = a.slice(m); - left = _ms(left); - right = _ms(right); - return merge(left, right); - } - return _ms(array); - } - function set_difference(a, b) { - return a.filter(function(el) { - return b.indexOf(el) < 0; - }); - } - function set_intersection(a, b) { - return a.filter(function(el) { - return b.indexOf(el) >= 0; - }); - } - function makePredicate(words) { - if (!(words instanceof Array)) words = words.split(" "); - var f = "", cats = []; - out: for (var i = 0; i < words.length; ++i) { - for (var j = 0; j < cats.length; ++j) if (cats[j][0].length == words[i].length) { - cats[j].push(words[i]); - continue out; - } - cats.push([ words[i] ]); - } - function compareTo(arr) { - if (arr.length == 1) return f += "return str === " + JSON.stringify(arr[0]) + ";"; - f += "switch(str){"; - for (var i = 0; i < arr.length; ++i) f += "case " + JSON.stringify(arr[i]) + ":"; - f += "return true}return false;"; - } - if (cats.length > 3) { - cats.sort(function(a, b) { - return b.length - a.length; - }); - f += "switch(str.length){"; - for (var i = 0; i < cats.length; ++i) { - var cat = cats[i]; - f += "case " + cat[0].length + ":"; - compareTo(cat); - } - f += "}"; - } else { - compareTo(words); - } - return new Function("str", f); - } - function all(array, predicate) { - for (var i = array.length; --i >= 0; ) if (!predicate(array[i])) return false; - return true; - } - function Dictionary() { - this._values = Object.create(null); - this._size = 0; - } - Dictionary.prototype = { - set: function(key, val) { - if (!this.has(key)) ++this._size; - this._values["$" + key] = val; - return this; - }, - add: function(key, val) { - if (this.has(key)) { - this.get(key).push(val); - } else { - this.set(key, [ val ]); - } - return this; - }, - get: function(key) { - return this._values["$" + key]; - }, - del: function(key) { - if (this.has(key)) { - --this._size; - delete this._values["$" + key]; - } - return this; - }, - has: function(key) { - return "$" + key in this._values; - }, - each: function(f) { - for (var i in this._values) f(this._values[i], i.substr(1)); - }, - size: function() { - return this._size; - }, - map: function(f) { - var ret = []; - for (var i in this._values) ret.push(f(this._values[i], i.substr(1))); - return ret; - } - }; - "use strict"; - function DEFNODE(type, props, methods, base) { - if (arguments.length < 4) base = AST_Node; - if (!props) props = []; else props = props.split(/\s+/); - var self_props = props; - if (base && base.PROPS) props = props.concat(base.PROPS); - var code = "return function AST_" + type + "(props){ if (props) { "; - for (var i = props.length; --i >= 0; ) { - code += "this." + props[i] + " = props." + props[i] + ";"; - } - var proto = base && new base(); - if (proto && proto.initialize || methods && methods.initialize) code += "this.initialize();"; - code += "}}"; - var ctor = new Function(code)(); - if (proto) { - ctor.prototype = proto; - ctor.BASE = base; - } - if (base) base.SUBCLASSES.push(ctor); - ctor.prototype.CTOR = ctor; - ctor.PROPS = props || null; - ctor.SELF_PROPS = self_props; - ctor.SUBCLASSES = []; - if (type) { - ctor.prototype.TYPE = ctor.TYPE = type; - } - if (methods) for (i in methods) if (methods.hasOwnProperty(i)) { - if (/^\$/.test(i)) { - ctor[i.substr(1)] = methods[i]; - } else { - ctor.prototype[i] = methods[i]; - } - } - ctor.DEFMETHOD = function(name, method) { - this.prototype[name] = method; - }; - return ctor; - } - var AST_Token = DEFNODE("Token", "type value line col pos endpos nlb comments_before file", {}, null); - var AST_Node = DEFNODE("Node", "start end", { - clone: function() { - return new this.CTOR(this); - }, - $documentation: "Base class of all AST nodes", - $propdoc: { - start: "[AST_Token] The first token of this node", - end: "[AST_Token] The last token of this node" - }, - _walk: function(visitor) { - return visitor._visit(this); - }, - walk: function(visitor) { - return this._walk(visitor); - } - }, null); - AST_Node.warn_function = null; - AST_Node.warn = function(txt, props) { - if (AST_Node.warn_function) AST_Node.warn_function(string_template(txt, props)); - }; - var AST_Statement = DEFNODE("Statement", null, { - $documentation: "Base class of all statements" - }); - var AST_Debugger = DEFNODE("Debugger", null, { - $documentation: "Represents a debugger statement" - }, AST_Statement); - var AST_Directive = DEFNODE("Directive", "value scope", { - $documentation: 'Represents a directive, like "use strict";', - $propdoc: { - value: "[string] The value of this directive as a plain string (it's not an AST_String!)", - scope: "[AST_Scope/S] The scope that this directive affects" - } - }, AST_Statement); - var AST_SimpleStatement = DEFNODE("SimpleStatement", "body", { - $documentation: "A statement consisting of an expression, i.e. a = 1 + 2", - $propdoc: { - body: "[AST_Node] an expression node (should not be instanceof AST_Statement)" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.body._walk(visitor); - }); - } - }, AST_Statement); - function walk_body(node, visitor) { - if (node.body instanceof AST_Statement) { - node.body._walk(visitor); - } else node.body.forEach(function(stat) { - stat._walk(visitor); - }); - } - var AST_Block = DEFNODE("Block", "body", { - $documentation: "A body of statements (usually bracketed)", - $propdoc: { - body: "[AST_Statement*] an array of statements" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - walk_body(this, visitor); - }); - } - }, AST_Statement); - var AST_BlockStatement = DEFNODE("BlockStatement", null, { - $documentation: "A block statement" - }, AST_Block); - var AST_EmptyStatement = DEFNODE("EmptyStatement", null, { - $documentation: "The empty statement (empty block or simply a semicolon)", - _walk: function(visitor) { - return visitor._visit(this); - } - }, AST_Statement); - var AST_StatementWithBody = DEFNODE("StatementWithBody", "body", { - $documentation: "Base class for all statements that contain one nested body: `For`, `ForIn`, `Do`, `While`, `With`", - $propdoc: { - body: "[AST_Statement] the body; this should always be present, even if it's an AST_EmptyStatement" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.body._walk(visitor); - }); - } - }, AST_Statement); - var AST_LabeledStatement = DEFNODE("LabeledStatement", "label", { - $documentation: "Statement with a label", - $propdoc: { - label: "[AST_Label] a label definition" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.label._walk(visitor); - this.body._walk(visitor); - }); - } - }, AST_StatementWithBody); - var AST_DWLoop = DEFNODE("DWLoop", "condition", { - $documentation: "Base class for do/while statements", - $propdoc: { - condition: "[AST_Node] the loop condition. Should not be instanceof AST_Statement" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.condition._walk(visitor); - this.body._walk(visitor); - }); - } - }, AST_StatementWithBody); - var AST_Do = DEFNODE("Do", null, { - $documentation: "A `do` statement" - }, AST_DWLoop); - var AST_While = DEFNODE("While", null, { - $documentation: "A `while` statement" - }, AST_DWLoop); - var AST_For = DEFNODE("For", "init condition step", { - $documentation: "A `for` statement", - $propdoc: { - init: "[AST_Node?] the `for` initialization code, or null if empty", - condition: "[AST_Node?] the `for` termination clause, or null if empty", - step: "[AST_Node?] the `for` update clause, or null if empty" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - if (this.init) this.init._walk(visitor); - if (this.condition) this.condition._walk(visitor); - if (this.step) this.step._walk(visitor); - this.body._walk(visitor); - }); - } - }, AST_StatementWithBody); - var AST_ForIn = DEFNODE("ForIn", "init name object", { - $documentation: "A `for ... in` statement", - $propdoc: { - init: "[AST_Node] the `for/in` initialization code", - name: "[AST_SymbolRef?] the loop variable, only if `init` is AST_Var", - object: "[AST_Node] the object that we're looping through" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.init._walk(visitor); - this.object._walk(visitor); - this.body._walk(visitor); - }); - } - }, AST_StatementWithBody); - var AST_With = DEFNODE("With", "expression", { - $documentation: "A `with` statement", - $propdoc: { - expression: "[AST_Node] the `with` expression" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.expression._walk(visitor); - this.body._walk(visitor); - }); - } - }, AST_StatementWithBody); - var AST_Scope = DEFNODE("Scope", "directives variables functions uses_with uses_eval parent_scope enclosed cname", { - $documentation: "Base class for all statements introducing a lexical scope", - $propdoc: { - directives: "[string*/S] an array of directives declared in this scope", - variables: "[Object/S] a map of name -> SymbolDef for all variables/functions defined in this scope", - functions: "[Object/S] like `variables`, but only lists function declarations", - uses_with: "[boolean/S] tells whether this scope uses the `with` statement", - uses_eval: "[boolean/S] tells whether this scope contains a direct call to the global `eval`", - parent_scope: "[AST_Scope?/S] link to the parent scope", - enclosed: "[SymbolDef*/S] a list of all symbol definitions that are accessed from this scope or any subscopes", - cname: "[integer/S] current index for mangling variables (used internally by the mangler)" - } - }, AST_Block); - var AST_Toplevel = DEFNODE("Toplevel", "globals", { - $documentation: "The toplevel scope", - $propdoc: { - globals: "[Object/S] a map of name -> SymbolDef for all undeclared names" - }, - wrap_enclose: function(arg_parameter_pairs) { - var self = this; - var args = []; - var parameters = []; - arg_parameter_pairs.forEach(function(pair) { - var split = pair.split(":"); - args.push(split[0]); - parameters.push(split[1]); - }); - var wrapped_tl = "(function(" + parameters.join(",") + "){ '$ORIG'; })(" + args.join(",") + ")"; - wrapped_tl = parse(wrapped_tl); - wrapped_tl = wrapped_tl.transform(new TreeTransformer(function before(node) { - if (node instanceof AST_Directive && node.value == "$ORIG") { - return MAP.splice(self.body); - } - })); - return wrapped_tl; - }, - wrap_commonjs: function(name, export_all) { - var self = this; - var to_export = []; - if (export_all) { - self.figure_out_scope(); - self.walk(new TreeWalker(function(node) { - if (node instanceof AST_SymbolDeclaration && node.definition().global) { - if (!find_if(function(n) { - return n.name == node.name; - }, to_export)) to_export.push(node); - } - })); - } - var wrapped_tl = "(function(exports, global){ global['" + name + "'] = exports; '$ORIG'; '$EXPORTS'; }({}, (function(){return this}())))"; - wrapped_tl = parse(wrapped_tl); - wrapped_tl = wrapped_tl.transform(new TreeTransformer(function before(node) { - if (node instanceof AST_SimpleStatement) { - node = node.body; - if (node instanceof AST_String) switch (node.getValue()) { - case "$ORIG": - return MAP.splice(self.body); - - case "$EXPORTS": - var body = []; - to_export.forEach(function(sym) { - body.push(new AST_SimpleStatement({ - body: new AST_Assign({ - left: new AST_Sub({ - expression: new AST_SymbolRef({ - name: "exports" - }), - property: new AST_String({ - value: sym.name - }) - }), - operator: "=", - right: new AST_SymbolRef(sym) - }) - })); - }); - return MAP.splice(body); - } - } - })); - return wrapped_tl; - } - }, AST_Scope); - var AST_Lambda = DEFNODE("Lambda", "name argnames uses_arguments", { - $documentation: "Base class for functions", - $propdoc: { - name: "[AST_SymbolDeclaration?] the name of this function", - argnames: "[AST_SymbolFunarg*] array of function arguments", - uses_arguments: "[boolean/S] tells whether this function accesses the arguments array" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - if (this.name) this.name._walk(visitor); - this.argnames.forEach(function(arg) { - arg._walk(visitor); - }); - walk_body(this, visitor); - }); - } - }, AST_Scope); - var AST_Accessor = DEFNODE("Accessor", null, { - $documentation: "A setter/getter function" - }, AST_Lambda); - var AST_Function = DEFNODE("Function", null, { - $documentation: "A function expression" - }, AST_Lambda); - var AST_Defun = DEFNODE("Defun", null, { - $documentation: "A function definition" - }, AST_Lambda); - var AST_Jump = DEFNODE("Jump", null, { - $documentation: "Base class for “jumps” (for now that's `return`, `throw`, `break` and `continue`)" - }, AST_Statement); - var AST_Exit = DEFNODE("Exit", "value", { - $documentation: "Base class for “exits” (`return` and `throw`)", - $propdoc: { - value: "[AST_Node?] the value returned or thrown by this statement; could be null for AST_Return" - }, - _walk: function(visitor) { - return visitor._visit(this, this.value && function() { - this.value._walk(visitor); - }); - } - }, AST_Jump); - var AST_Return = DEFNODE("Return", null, { - $documentation: "A `return` statement" - }, AST_Exit); - var AST_Throw = DEFNODE("Throw", null, { - $documentation: "A `throw` statement" - }, AST_Exit); - var AST_LoopControl = DEFNODE("LoopControl", "label", { - $documentation: "Base class for loop control statements (`break` and `continue`)", - $propdoc: { - label: "[AST_LabelRef?] the label, or null if none" - }, - _walk: function(visitor) { - return visitor._visit(this, this.label && function() { - this.label._walk(visitor); - }); - } - }, AST_Jump); - var AST_Break = DEFNODE("Break", null, { - $documentation: "A `break` statement" - }, AST_LoopControl); - var AST_Continue = DEFNODE("Continue", null, { - $documentation: "A `continue` statement" - }, AST_LoopControl); - var AST_If = DEFNODE("If", "condition alternative", { - $documentation: "A `if` statement", - $propdoc: { - condition: "[AST_Node] the `if` condition", - alternative: "[AST_Statement?] the `else` part, or null if not present" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.condition._walk(visitor); - this.body._walk(visitor); - if (this.alternative) this.alternative._walk(visitor); - }); - } - }, AST_StatementWithBody); - var AST_Switch = DEFNODE("Switch", "expression", { - $documentation: "A `switch` statement", - $propdoc: { - expression: "[AST_Node] the `switch` “discriminant”" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.expression._walk(visitor); - walk_body(this, visitor); - }); - } - }, AST_Block); - var AST_SwitchBranch = DEFNODE("SwitchBranch", null, { - $documentation: "Base class for `switch` branches" - }, AST_Block); - var AST_Default = DEFNODE("Default", null, { - $documentation: "A `default` switch branch" - }, AST_SwitchBranch); - var AST_Case = DEFNODE("Case", "expression", { - $documentation: "A `case` switch branch", - $propdoc: { - expression: "[AST_Node] the `case` expression" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.expression._walk(visitor); - walk_body(this, visitor); - }); - } - }, AST_SwitchBranch); - var AST_Try = DEFNODE("Try", "bcatch bfinally", { - $documentation: "A `try` statement", - $propdoc: { - bcatch: "[AST_Catch?] the catch block, or null if not present", - bfinally: "[AST_Finally?] the finally block, or null if not present" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - walk_body(this, visitor); - if (this.bcatch) this.bcatch._walk(visitor); - if (this.bfinally) this.bfinally._walk(visitor); - }); - } - }, AST_Block); - var AST_Catch = DEFNODE("Catch", "argname", { - $documentation: "A `catch` node; only makes sense as part of a `try` statement", - $propdoc: { - argname: "[AST_SymbolCatch] symbol for the exception" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.argname._walk(visitor); - walk_body(this, visitor); - }); - } - }, AST_Block); - var AST_Finally = DEFNODE("Finally", null, { - $documentation: "A `finally` node; only makes sense as part of a `try` statement" - }, AST_Block); - var AST_Definitions = DEFNODE("Definitions", "definitions", { - $documentation: "Base class for `var` or `const` nodes (variable declarations/initializations)", - $propdoc: { - definitions: "[AST_VarDef*] array of variable definitions" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.definitions.forEach(function(def) { - def._walk(visitor); - }); - }); - } - }, AST_Statement); - var AST_Var = DEFNODE("Var", null, { - $documentation: "A `var` statement" - }, AST_Definitions); - var AST_Const = DEFNODE("Const", null, { - $documentation: "A `const` statement" - }, AST_Definitions); - var AST_VarDef = DEFNODE("VarDef", "name value", { - $documentation: "A variable declaration; only appears in a AST_Definitions node", - $propdoc: { - name: "[AST_SymbolVar|AST_SymbolConst] name of the variable", - value: "[AST_Node?] initializer, or null of there's no initializer" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.name._walk(visitor); - if (this.value) this.value._walk(visitor); - }); - } - }); - var AST_Call = DEFNODE("Call", "expression args", { - $documentation: "A function call expression", - $propdoc: { - expression: "[AST_Node] expression to invoke as function", - args: "[AST_Node*] array of arguments" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.expression._walk(visitor); - this.args.forEach(function(arg) { - arg._walk(visitor); - }); - }); - } - }); - var AST_New = DEFNODE("New", null, { - $documentation: "An object instantiation. Derives from a function call since it has exactly the same properties" - }, AST_Call); - var AST_Seq = DEFNODE("Seq", "car cdr", { - $documentation: "A sequence expression (two comma-separated expressions)", - $propdoc: { - car: "[AST_Node] first element in sequence", - cdr: "[AST_Node] second element in sequence" - }, - $cons: function(x, y) { - var seq = new AST_Seq(x); - seq.car = x; - seq.cdr = y; - return seq; - }, - $from_array: function(array) { - if (array.length == 0) return null; - if (array.length == 1) return array[0].clone(); - var list = null; - for (var i = array.length; --i >= 0; ) { - list = AST_Seq.cons(array[i], list); - } - var p = list; - while (p) { - if (p.cdr && !p.cdr.cdr) { - p.cdr = p.cdr.car; - break; - } - p = p.cdr; - } - return list; - }, - to_array: function() { - var p = this, a = []; - while (p) { - a.push(p.car); - if (p.cdr && !(p.cdr instanceof AST_Seq)) { - a.push(p.cdr); - break; - } - p = p.cdr; - } - return a; - }, - add: function(node) { - var p = this; - while (p) { - if (!(p.cdr instanceof AST_Seq)) { - var cell = AST_Seq.cons(p.cdr, node); - return p.cdr = cell; - } - p = p.cdr; - } - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.car._walk(visitor); - if (this.cdr) this.cdr._walk(visitor); - }); - } - }); - var AST_PropAccess = DEFNODE("PropAccess", "expression property", { - $documentation: 'Base class for property access expressions, i.e. `a.foo` or `a["foo"]`', - $propdoc: { - expression: "[AST_Node] the “container” expression", - property: "[AST_Node|string] the property to access. For AST_Dot this is always a plain string, while for AST_Sub it's an arbitrary AST_Node" - } - }); - var AST_Dot = DEFNODE("Dot", null, { - $documentation: "A dotted property access expression", - _walk: function(visitor) { - return visitor._visit(this, function() { - this.expression._walk(visitor); - }); - } - }, AST_PropAccess); - var AST_Sub = DEFNODE("Sub", null, { - $documentation: 'Index-style property access, i.e. `a["foo"]`', - _walk: function(visitor) { - return visitor._visit(this, function() { - this.expression._walk(visitor); - this.property._walk(visitor); - }); - } - }, AST_PropAccess); - var AST_Unary = DEFNODE("Unary", "operator expression", { - $documentation: "Base class for unary expressions", - $propdoc: { - operator: "[string] the operator", - expression: "[AST_Node] expression that this unary operator applies to" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.expression._walk(visitor); - }); - } - }); - var AST_UnaryPrefix = DEFNODE("UnaryPrefix", null, { - $documentation: "Unary prefix expression, i.e. `typeof i` or `++i`" - }, AST_Unary); - var AST_UnaryPostfix = DEFNODE("UnaryPostfix", null, { - $documentation: "Unary postfix expression, i.e. `i++`" - }, AST_Unary); - var AST_Binary = DEFNODE("Binary", "left operator right", { - $documentation: "Binary expression, i.e. `a + b`", - $propdoc: { - left: "[AST_Node] left-hand side expression", - operator: "[string] the operator", - right: "[AST_Node] right-hand side expression" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.left._walk(visitor); - this.right._walk(visitor); - }); - } - }); - var AST_Conditional = DEFNODE("Conditional", "condition consequent alternative", { - $documentation: "Conditional expression using the ternary operator, i.e. `a ? b : c`", - $propdoc: { - condition: "[AST_Node]", - consequent: "[AST_Node]", - alternative: "[AST_Node]" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.condition._walk(visitor); - this.consequent._walk(visitor); - this.alternative._walk(visitor); - }); - } - }); - var AST_Assign = DEFNODE("Assign", null, { - $documentation: "An assignment expression — `a = b + 5`" - }, AST_Binary); - var AST_Array = DEFNODE("Array", "elements", { - $documentation: "An array literal", - $propdoc: { - elements: "[AST_Node*] array of elements" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.elements.forEach(function(el) { - el._walk(visitor); - }); - }); - } - }); - var AST_Object = DEFNODE("Object", "properties", { - $documentation: "An object literal", - $propdoc: { - properties: "[AST_ObjectProperty*] array of properties" - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.properties.forEach(function(prop) { - prop._walk(visitor); - }); - }); - } - }); - var AST_ObjectProperty = DEFNODE("ObjectProperty", "key value", { - $documentation: "Base class for literal object properties", - $propdoc: { - key: "[string] the property name; it's always a plain string in our AST, no matter if it was a string, number or identifier in original code", - value: "[AST_Node] property value. For setters and getters this is an AST_Function." - }, - _walk: function(visitor) { - return visitor._visit(this, function() { - this.value._walk(visitor); - }); - } - }); - var AST_ObjectKeyVal = DEFNODE("ObjectKeyVal", null, { - $documentation: "A key: value object property" - }, AST_ObjectProperty); - var AST_ObjectSetter = DEFNODE("ObjectSetter", null, { - $documentation: "An object setter property" - }, AST_ObjectProperty); - var AST_ObjectGetter = DEFNODE("ObjectGetter", null, { - $documentation: "An object getter property" - }, AST_ObjectProperty); - var AST_Symbol = DEFNODE("Symbol", "scope name thedef", { - $propdoc: { - name: "[string] name of this symbol", - scope: "[AST_Scope/S] the current scope (not necessarily the definition scope)", - thedef: "[SymbolDef/S] the definition of this symbol" - }, - $documentation: "Base class for all symbols" - }); - var AST_SymbolAccessor = DEFNODE("SymbolAccessor", null, { - $documentation: "The name of a property accessor (setter/getter function)" - }, AST_Symbol); - var AST_SymbolDeclaration = DEFNODE("SymbolDeclaration", "init", { - $documentation: "A declaration symbol (symbol in var/const, function name or argument, symbol in catch)", - $propdoc: { - init: "[AST_Node*/S] array of initializers for this declaration." - } - }, AST_Symbol); - var AST_SymbolVar = DEFNODE("SymbolVar", null, { - $documentation: "Symbol defining a variable" - }, AST_SymbolDeclaration); - var AST_SymbolConst = DEFNODE("SymbolConst", null, { - $documentation: "A constant declaration" - }, AST_SymbolDeclaration); - var AST_SymbolFunarg = DEFNODE("SymbolFunarg", null, { - $documentation: "Symbol naming a function argument" - }, AST_SymbolVar); - var AST_SymbolDefun = DEFNODE("SymbolDefun", null, { - $documentation: "Symbol defining a function" - }, AST_SymbolDeclaration); - var AST_SymbolLambda = DEFNODE("SymbolLambda", null, { - $documentation: "Symbol naming a function expression" - }, AST_SymbolDeclaration); - var AST_SymbolCatch = DEFNODE("SymbolCatch", null, { - $documentation: "Symbol naming the exception in catch" - }, AST_SymbolDeclaration); - var AST_Label = DEFNODE("Label", "references", { - $documentation: "Symbol naming a label (declaration)", - $propdoc: { - references: "[AST_LabelRef*] a list of nodes referring to this label" - } - }, AST_Symbol); - var AST_SymbolRef = DEFNODE("SymbolRef", null, { - $documentation: "Reference to some symbol (not definition/declaration)" - }, AST_Symbol); - var AST_LabelRef = DEFNODE("LabelRef", null, { - $documentation: "Reference to a label symbol" - }, AST_Symbol); - var AST_This = DEFNODE("This", null, { - $documentation: "The `this` symbol" - }, AST_Symbol); - var AST_Constant = DEFNODE("Constant", null, { - $documentation: "Base class for all constants", - getValue: function() { - return this.value; - } - }); - var AST_String = DEFNODE("String", "value", { - $documentation: "A string literal", - $propdoc: { - value: "[string] the contents of this string" - } - }, AST_Constant); - var AST_Number = DEFNODE("Number", "value", { - $documentation: "A number literal", - $propdoc: { - value: "[number] the numeric value" - } - }, AST_Constant); - var AST_RegExp = DEFNODE("RegExp", "value", { - $documentation: "A regexp literal", - $propdoc: { - value: "[RegExp] the actual regexp" - } - }, AST_Constant); - var AST_Atom = DEFNODE("Atom", null, { - $documentation: "Base class for atoms" - }, AST_Constant); - var AST_Null = DEFNODE("Null", null, { - $documentation: "The `null` atom", - value: null - }, AST_Atom); - var AST_NaN = DEFNODE("NaN", null, { - $documentation: "The impossible value", - value: 0 / 0 - }, AST_Atom); - var AST_Undefined = DEFNODE("Undefined", null, { - $documentation: "The `undefined` value", - value: function() {}() - }, AST_Atom); - var AST_Hole = DEFNODE("Hole", null, { - $documentation: "A hole in an array", - value: function() {}() - }, AST_Atom); - var AST_Infinity = DEFNODE("Infinity", null, { - $documentation: "The `Infinity` value", - value: 1 / 0 - }, AST_Atom); - var AST_Boolean = DEFNODE("Boolean", null, { - $documentation: "Base class for booleans" - }, AST_Atom); - var AST_False = DEFNODE("False", null, { - $documentation: "The `false` atom", - value: false - }, AST_Boolean); - var AST_True = DEFNODE("True", null, { - $documentation: "The `true` atom", - value: true - }, AST_Boolean); - function TreeWalker(callback) { - this.visit = callback; - this.stack = []; - } - TreeWalker.prototype = { - _visit: function(node, descend) { - this.stack.push(node); - var ret = this.visit(node, descend ? function() { - descend.call(node); - } : noop); - if (!ret && descend) { - descend.call(node); - } - this.stack.pop(); - return ret; - }, - parent: function(n) { - return this.stack[this.stack.length - 2 - (n || 0)]; - }, - push: function(node) { - this.stack.push(node); - }, - pop: function() { - return this.stack.pop(); - }, - self: function() { - return this.stack[this.stack.length - 1]; - }, - find_parent: function(type) { - var stack = this.stack; - for (var i = stack.length; --i >= 0; ) { - var x = stack[i]; - if (x instanceof type) return x; - } - }, - in_boolean_context: function() { - var stack = this.stack; - var i = stack.length, self = stack[--i]; - while (i > 0) { - var p = stack[--i]; - if (p instanceof AST_If && p.condition === self || p instanceof AST_Conditional && p.condition === self || p instanceof AST_DWLoop && p.condition === self || p instanceof AST_For && p.condition === self || p instanceof AST_UnaryPrefix && p.operator == "!" && p.expression === self) { - return true; - } - if (!(p instanceof AST_Binary && (p.operator == "&&" || p.operator == "||"))) return false; - self = p; - } - }, - loopcontrol_target: function(label) { - var stack = this.stack; - if (label) { - for (var i = stack.length; --i >= 0; ) { - var x = stack[i]; - if (x instanceof AST_LabeledStatement && x.label.name == label.name) { - return x.body; - } - } - } else { - for (var i = stack.length; --i >= 0; ) { - var x = stack[i]; - if (x instanceof AST_Switch || x instanceof AST_For || x instanceof AST_ForIn || x instanceof AST_DWLoop) return x; - } - } - } - }; - "use strict"; - var KEYWORDS = "break case catch const continue debugger default delete do else finally for function if in instanceof new return switch throw try typeof var void while with"; - var KEYWORDS_ATOM = "false null true"; - var RESERVED_WORDS = "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized this throws transient volatile" + " " + KEYWORDS_ATOM + " " + KEYWORDS; - var KEYWORDS_BEFORE_EXPRESSION = "return new delete throw else case"; - KEYWORDS = makePredicate(KEYWORDS); - RESERVED_WORDS = makePredicate(RESERVED_WORDS); - KEYWORDS_BEFORE_EXPRESSION = makePredicate(KEYWORDS_BEFORE_EXPRESSION); - KEYWORDS_ATOM = makePredicate(KEYWORDS_ATOM); - var OPERATOR_CHARS = makePredicate(characters("+-*&%=<>!?|~^")); - var RE_HEX_NUMBER = /^0x[0-9a-f]+$/i; - var RE_OCT_NUMBER = /^0[0-7]+$/; - var RE_DEC_NUMBER = /^\d*\.?\d*(?:e[+-]?\d*(?:\d\.?|\.?\d)\d*)?$/i; - var OPERATORS = makePredicate([ "in", "instanceof", "typeof", "new", "void", "delete", "++", "--", "+", "-", "!", "~", "&", "|", "^", "*", "/", "%", ">>", "<<", ">>>", "<", ">", "<=", ">=", "==", "===", "!=", "!==", "?", "=", "+=", "-=", "/=", "*=", "%=", ">>=", "<<=", ">>>=", "|=", "^=", "&=", "&&", "||" ]); - var WHITESPACE_CHARS = makePredicate(characters(" \u00a0\n\r\t\f\u000b\u200b\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000")); - var PUNC_BEFORE_EXPRESSION = makePredicate(characters("[{(,.;:")); - var PUNC_CHARS = makePredicate(characters("[]{}(),;:")); - var REGEXP_MODIFIERS = makePredicate(characters("gmsiy")); - var UNICODE = { - letter: new RegExp("[\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0523\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0621-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971\\u0972\\u097B-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D28\\u0D2A-\\u0D39\\u0D3D\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC\\u0EDD\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8B\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10D0-\\u10FA\\u10FC\\u1100-\\u1159\\u115F-\\u11A2\\u11A8-\\u11F9\\u1200-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u1676\\u1681-\\u169A\\u16A0-\\u16EA\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19A9\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u2094\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2C6F\\u2C71-\\u2C7D\\u2C80-\\u2CE4\\u2D00-\\u2D25\\u2D30-\\u2D65\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31B7\\u31F0-\\u31FF\\u3400\\u4DB5\\u4E00\\u9FC3\\uA000-\\uA48C\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA65F\\uA662-\\uA66E\\uA67F-\\uA697\\uA717-\\uA71F\\uA722-\\uA788\\uA78B\\uA78C\\uA7FB-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA90A-\\uA925\\uA930-\\uA946\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAC00\\uD7A3\\uF900-\\uFA2D\\uFA30-\\uFA6A\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"), - non_spacing_mark: new RegExp("[\\u0300-\\u036F\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065E\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0900-\\u0902\\u093C\\u0941-\\u0948\\u094D\\u0951-\\u0955\\u0962\\u0963\\u0981\\u09BC\\u09C1-\\u09C4\\u09CD\\u09E2\\u09E3\\u0A01\\u0A02\\u0A3C\\u0A41\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81\\u0A82\\u0ABC\\u0AC1-\\u0AC5\\u0AC7\\u0AC8\\u0ACD\\u0AE2\\u0AE3\\u0B01\\u0B3C\\u0B3F\\u0B41-\\u0B44\\u0B4D\\u0B56\\u0B62\\u0B63\\u0B82\\u0BC0\\u0BCD\\u0C3E-\\u0C40\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0CBC\\u0CBF\\u0CC6\\u0CCC\\u0CCD\\u0CE2\\u0CE3\\u0D41-\\u0D44\\u0D4D\\u0D62\\u0D63\\u0DCA\\u0DD2-\\u0DD4\\u0DD6\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F71-\\u0F7E\\u0F80-\\u0F84\\u0F86\\u0F87\\u0F90-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102D-\\u1030\\u1032-\\u1037\\u1039\\u103A\\u103D\\u103E\\u1058\\u1059\\u105E-\\u1060\\u1071-\\u1074\\u1082\\u1085\\u1086\\u108D\\u109D\\u135F\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B7-\\u17BD\\u17C6\\u17C9-\\u17D3\\u17DD\\u180B-\\u180D\\u18A9\\u1920-\\u1922\\u1927\\u1928\\u1932\\u1939-\\u193B\\u1A17\\u1A18\\u1A56\\u1A58-\\u1A5E\\u1A60\\u1A62\\u1A65-\\u1A6C\\u1A73-\\u1A7C\\u1A7F\\u1B00-\\u1B03\\u1B34\\u1B36-\\u1B3A\\u1B3C\\u1B42\\u1B6B-\\u1B73\\u1B80\\u1B81\\u1BA2-\\u1BA5\\u1BA8\\u1BA9\\u1C2C-\\u1C33\\u1C36\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE0\\u1CE2-\\u1CE8\\u1CED\\u1DC0-\\u1DE6\\u1DFD-\\u1DFF\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F\\uA67C\\uA67D\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA825\\uA826\\uA8C4\\uA8E0-\\uA8F1\\uA926-\\uA92D\\uA947-\\uA951\\uA980-\\uA982\\uA9B3\\uA9B6-\\uA9B9\\uA9BC\\uAA29-\\uAA2E\\uAA31\\uAA32\\uAA35\\uAA36\\uAA43\\uAA4C\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uABE5\\uABE8\\uABED\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE26]"), - space_combining_mark: new RegExp("[\\u0903\\u093E-\\u0940\\u0949-\\u094C\\u094E\\u0982\\u0983\\u09BE-\\u09C0\\u09C7\\u09C8\\u09CB\\u09CC\\u09D7\\u0A03\\u0A3E-\\u0A40\\u0A83\\u0ABE-\\u0AC0\\u0AC9\\u0ACB\\u0ACC\\u0B02\\u0B03\\u0B3E\\u0B40\\u0B47\\u0B48\\u0B4B\\u0B4C\\u0B57\\u0BBE\\u0BBF\\u0BC1\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCC\\u0BD7\\u0C01-\\u0C03\\u0C41-\\u0C44\\u0C82\\u0C83\\u0CBE\\u0CC0-\\u0CC4\\u0CC7\\u0CC8\\u0CCA\\u0CCB\\u0CD5\\u0CD6\\u0D02\\u0D03\\u0D3E-\\u0D40\\u0D46-\\u0D48\\u0D4A-\\u0D4C\\u0D57\\u0D82\\u0D83\\u0DCF-\\u0DD1\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0F3E\\u0F3F\\u0F7F\\u102B\\u102C\\u1031\\u1038\\u103B\\u103C\\u1056\\u1057\\u1062-\\u1064\\u1067-\\u106D\\u1083\\u1084\\u1087-\\u108C\\u108F\\u109A-\\u109C\\u17B6\\u17BE-\\u17C5\\u17C7\\u17C8\\u1923-\\u1926\\u1929-\\u192B\\u1930\\u1931\\u1933-\\u1938\\u19B0-\\u19C0\\u19C8\\u19C9\\u1A19-\\u1A1B\\u1A55\\u1A57\\u1A61\\u1A63\\u1A64\\u1A6D-\\u1A72\\u1B04\\u1B35\\u1B3B\\u1B3D-\\u1B41\\u1B43\\u1B44\\u1B82\\u1BA1\\u1BA6\\u1BA7\\u1BAA\\u1C24-\\u1C2B\\u1C34\\u1C35\\u1CE1\\u1CF2\\uA823\\uA824\\uA827\\uA880\\uA881\\uA8B4-\\uA8C3\\uA952\\uA953\\uA983\\uA9B4\\uA9B5\\uA9BA\\uA9BB\\uA9BD-\\uA9C0\\uAA2F\\uAA30\\uAA33\\uAA34\\uAA4D\\uAA7B\\uABE3\\uABE4\\uABE6\\uABE7\\uABE9\\uABEA\\uABEC]"), - connector_punctuation: new RegExp("[\\u005F\\u203F\\u2040\\u2054\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF3F]") - }; - function is_letter(code) { - return code >= 97 && code <= 122 || code >= 65 && code <= 90 || code >= 170 && UNICODE.letter.test(String.fromCharCode(code)); - } - function is_digit(code) { - return code >= 48 && code <= 57; - } - function is_alphanumeric_char(code) { - return is_digit(code) || is_letter(code); - } - function is_unicode_combining_mark(ch) { - return UNICODE.non_spacing_mark.test(ch) || UNICODE.space_combining_mark.test(ch); - } - function is_unicode_connector_punctuation(ch) { - return UNICODE.connector_punctuation.test(ch); - } - function is_identifier(name) { - return !RESERVED_WORDS(name) && /^[a-z_$][a-z0-9_$]*$/i.test(name); - } - function is_identifier_start(code) { - return code == 36 || code == 95 || is_letter(code); - } - function is_identifier_char(ch) { - var code = ch.charCodeAt(0); - return is_identifier_start(code) || is_digit(code) || code == 8204 || code == 8205 || is_unicode_combining_mark(ch) || is_unicode_connector_punctuation(ch); - } - function is_identifier_string(str) { - var i = str.length; - if (i == 0) return false; - if (is_digit(str.charCodeAt(0))) return false; - while (--i >= 0) { - if (!is_identifier_char(str.charAt(i))) return false; - } - return true; - } - function parse_js_number(num) { - if (RE_HEX_NUMBER.test(num)) { - return parseInt(num.substr(2), 16); - } else if (RE_OCT_NUMBER.test(num)) { - return parseInt(num.substr(1), 8); - } else if (RE_DEC_NUMBER.test(num)) { - return parseFloat(num); - } - } - function JS_Parse_Error(message, line, col, pos) { - this.message = message; - this.line = line; - this.col = col; - this.pos = pos; - this.stack = new Error().stack; - } - JS_Parse_Error.prototype.toString = function() { - return this.message + " (line: " + this.line + ", col: " + this.col + ", pos: " + this.pos + ")" + "\n\n" + this.stack; - }; - function js_error(message, filename, line, col, pos) { - throw new JS_Parse_Error(message, line, col, pos); - } - function is_token(token, type, val) { - return token.type == type && (val == null || token.value == val); - } - var EX_EOF = {}; - function tokenizer($TEXT, filename) { - var S = { - text: $TEXT.replace(/\r\n?|[\n\u2028\u2029]/g, "\n").replace(/\uFEFF/g, ""), - filename: filename, - pos: 0, - tokpos: 0, - line: 1, - tokline: 0, - col: 0, - tokcol: 0, - newline_before: false, - regex_allowed: false, - comments_before: [] - }; - function peek() { - return S.text.charAt(S.pos); - } - function next(signal_eof, in_string) { - var ch = S.text.charAt(S.pos++); - if (signal_eof && !ch) throw EX_EOF; - if (ch == "\n") { - S.newline_before = S.newline_before || !in_string; - ++S.line; - S.col = 0; - } else { - ++S.col; - } - return ch; - } - function find(what, signal_eof) { - var pos = S.text.indexOf(what, S.pos); - if (signal_eof && pos == -1) throw EX_EOF; - return pos; - } - function start_token() { - S.tokline = S.line; - S.tokcol = S.col; - S.tokpos = S.pos; - } - function token(type, value, is_comment) { - S.regex_allowed = type == "operator" && !UNARY_POSTFIX[value] || type == "keyword" && KEYWORDS_BEFORE_EXPRESSION(value) || type == "punc" && PUNC_BEFORE_EXPRESSION(value); - var ret = { - type: type, - value: value, - line: S.tokline, - col: S.tokcol, - pos: S.tokpos, - endpos: S.pos, - nlb: S.newline_before, - file: filename - }; - if (!is_comment) { - ret.comments_before = S.comments_before; - S.comments_before = []; - for (var i = 0, len = ret.comments_before.length; i < len; i++) { - ret.nlb = ret.nlb || ret.comments_before[i].nlb; - } - } - S.newline_before = false; - return new AST_Token(ret); - } - function skip_whitespace() { - while (WHITESPACE_CHARS(peek())) next(); - } - function read_while(pred) { - var ret = "", ch, i = 0; - while ((ch = peek()) && pred(ch, i++)) ret += next(); - return ret; - } - function parse_error(err) { - js_error(err, filename, S.tokline, S.tokcol, S.tokpos); - } - function read_num(prefix) { - var has_e = false, after_e = false, has_x = false, has_dot = prefix == "."; - var num = read_while(function(ch, i) { - var code = ch.charCodeAt(0); - switch (code) { - case 120: - case 88: - return has_x ? false : has_x = true; - - case 101: - case 69: - return has_x ? true : has_e ? false : has_e = after_e = true; - - case 45: - return after_e || i == 0 && !prefix; - - case 43: - return after_e; - - case after_e = false, 46: - return !has_dot && !has_x && !has_e ? has_dot = true : false; - } - return is_alphanumeric_char(code); - }); - if (prefix) num = prefix + num; - var valid = parse_js_number(num); - if (!isNaN(valid)) { - return token("num", valid); - } else { - parse_error("Invalid syntax: " + num); - } - } - function read_escaped_char(in_string) { - var ch = next(true, in_string); - switch (ch.charCodeAt(0)) { - case 110: - return "\n"; - - case 114: - return "\r"; - - case 116: - return " "; - - case 98: - return "\b"; - - case 118: - return " "; - - case 102: - return "\f"; - - case 48: - return "\0"; - - case 120: - return String.fromCharCode(hex_bytes(2)); - - case 117: - return String.fromCharCode(hex_bytes(4)); - - case 10: - return ""; - - default: - return ch; - } - } - function hex_bytes(n) { - var num = 0; - for (;n > 0; --n) { - var digit = parseInt(next(true), 16); - if (isNaN(digit)) parse_error("Invalid hex-character pattern in string"); - num = num << 4 | digit; - } - return num; - } - var read_string = with_eof_error("Unterminated string constant", function() { - var quote = next(), ret = ""; - for (;;) { - var ch = next(true); - if (ch == "\\") { - var octal_len = 0, first = null; - ch = read_while(function(ch) { - if (ch >= "0" && ch <= "7") { - if (!first) { - first = ch; - return ++octal_len; - } else if (first <= "3" && octal_len <= 2) return ++octal_len; else if (first >= "4" && octal_len <= 1) return ++octal_len; - } - return false; - }); - if (octal_len > 0) ch = String.fromCharCode(parseInt(ch, 8)); else ch = read_escaped_char(true); - } else if (ch == quote) break; - ret += ch; - } - return token("string", ret); - }); - function read_line_comment() { - next(); - var i = find("\n"), ret; - if (i == -1) { - ret = S.text.substr(S.pos); - S.pos = S.text.length; - } else { - ret = S.text.substring(S.pos, i); - S.pos = i; - } - return token("comment1", ret, true); - } - var read_multiline_comment = with_eof_error("Unterminated multiline comment", function() { - next(); - var i = find("*/", true); - var text = S.text.substring(S.pos, i); - var a = text.split("\n"), n = a.length; - S.pos = i + 2; - S.line += n - 1; - if (n > 1) S.col = a[n - 1].length; else S.col += a[n - 1].length; - S.col += 2; - S.newline_before = S.newline_before || text.indexOf("\n") >= 0; - return token("comment2", text, true); - }); - function read_name() { - var backslash = false, name = "", ch, escaped = false, hex; - while ((ch = peek()) != null) { - if (!backslash) { - if (ch == "\\") escaped = backslash = true, next(); else if (is_identifier_char(ch)) name += next(); else break; - } else { - if (ch != "u") parse_error("Expecting UnicodeEscapeSequence -- uXXXX"); - ch = read_escaped_char(); - if (!is_identifier_char(ch)) parse_error("Unicode char: " + ch.charCodeAt(0) + " is not valid in identifier"); - name += ch; - backslash = false; - } - } - if (KEYWORDS(name) && escaped) { - hex = name.charCodeAt(0).toString(16).toUpperCase(); - name = "\\u" + "0000".substr(hex.length) + hex + name.slice(1); - } - return name; - } - var read_regexp = with_eof_error("Unterminated regular expression", function(regexp) { - var prev_backslash = false, ch, in_class = false; - while (ch = next(true)) if (prev_backslash) { - regexp += "\\" + ch; - prev_backslash = false; - } else if (ch == "[") { - in_class = true; - regexp += ch; - } else if (ch == "]" && in_class) { - in_class = false; - regexp += ch; - } else if (ch == "/" && !in_class) { - break; - } else if (ch == "\\") { - prev_backslash = true; - } else { - regexp += ch; - } - var mods = read_name(); - return token("regexp", new RegExp(regexp, mods)); - }); - function read_operator(prefix) { - function grow(op) { - if (!peek()) return op; - var bigger = op + peek(); - if (OPERATORS(bigger)) { - next(); - return grow(bigger); - } else { - return op; - } - } - return token("operator", grow(prefix || next())); - } - function handle_slash() { - next(); - var regex_allowed = S.regex_allowed; - switch (peek()) { - case "/": - S.comments_before.push(read_line_comment()); - S.regex_allowed = regex_allowed; - return next_token(); - - case "*": - S.comments_before.push(read_multiline_comment()); - S.regex_allowed = regex_allowed; - return next_token(); - } - return S.regex_allowed ? read_regexp("") : read_operator("/"); - } - function handle_dot() { - next(); - return is_digit(peek().charCodeAt(0)) ? read_num(".") : token("punc", "."); - } - function read_word() { - var word = read_name(); - return KEYWORDS_ATOM(word) ? token("atom", word) : !KEYWORDS(word) ? token("name", word) : OPERATORS(word) ? token("operator", word) : token("keyword", word); - } - function with_eof_error(eof_error, cont) { - return function(x) { - try { - return cont(x); - } catch (ex) { - if (ex === EX_EOF) parse_error(eof_error); else throw ex; - } - }; - } - function next_token(force_regexp) { - if (force_regexp != null) return read_regexp(force_regexp); - skip_whitespace(); - start_token(); - var ch = peek(); - if (!ch) return token("eof"); - var code = ch.charCodeAt(0); - switch (code) { - case 34: - case 39: - return read_string(); - - case 46: - return handle_dot(); - - case 47: - return handle_slash(); - } - if (is_digit(code)) return read_num(); - if (PUNC_CHARS(ch)) return token("punc", next()); - if (OPERATOR_CHARS(ch)) return read_operator(); - if (code == 92 || is_identifier_start(code)) return read_word(); - parse_error("Unexpected character '" + ch + "'"); - } - next_token.context = function(nc) { - if (nc) S = nc; - return S; - }; - return next_token; - } - var UNARY_PREFIX = makePredicate([ "typeof", "void", "delete", "--", "++", "!", "~", "-", "+" ]); - var UNARY_POSTFIX = makePredicate([ "--", "++" ]); - var ASSIGNMENT = makePredicate([ "=", "+=", "-=", "/=", "*=", "%=", ">>=", "<<=", ">>>=", "|=", "^=", "&=" ]); - var PRECEDENCE = function(a, ret) { - for (var i = 0, n = 1; i < a.length; ++i, ++n) { - var b = a[i]; - for (var j = 0; j < b.length; ++j) { - ret[b[j]] = n; - } - } - return ret; - }([ [ "||" ], [ "&&" ], [ "|" ], [ "^" ], [ "&" ], [ "==", "===", "!=", "!==" ], [ "<", ">", "<=", ">=", "in", "instanceof" ], [ ">>", "<<", ">>>" ], [ "+", "-" ], [ "*", "/", "%" ] ], {}); - var STATEMENTS_WITH_LABELS = array_to_hash([ "for", "do", "while", "switch" ]); - var ATOMIC_START_TOKEN = array_to_hash([ "atom", "num", "string", "regexp", "name" ]); - function parse($TEXT, options) { - options = defaults(options, { - strict: false, - filename: null, - toplevel: null, - expression: false - }); - var S = { - input: typeof $TEXT == "string" ? tokenizer($TEXT, options.filename) : $TEXT, - token: null, - prev: null, - peeked: null, - in_function: 0, - in_directives: true, - in_loop: 0, - labels: [] - }; - S.token = next(); - function is(type, value) { - return is_token(S.token, type, value); - } - function peek() { - return S.peeked || (S.peeked = S.input()); - } - function next() { - S.prev = S.token; - if (S.peeked) { - S.token = S.peeked; - S.peeked = null; - } else { - S.token = S.input(); - } - S.in_directives = S.in_directives && (S.token.type == "string" || is("punc", ";")); - return S.token; - } - function prev() { - return S.prev; - } - function croak(msg, line, col, pos) { - var ctx = S.input.context(); - js_error(msg, ctx.filename, line != null ? line : ctx.tokline, col != null ? col : ctx.tokcol, pos != null ? pos : ctx.tokpos); - } - function token_error(token, msg) { - croak(msg, token.line, token.col); - } - function unexpected(token) { - if (token == null) token = S.token; - token_error(token, "Unexpected token: " + token.type + " (" + token.value + ")"); - } - function expect_token(type, val) { - if (is(type, val)) { - return next(); - } - token_error(S.token, "Unexpected token " + S.token.type + " «" + S.token.value + "»" + ", expected " + type + " «" + val + "»"); - } - function expect(punc) { - return expect_token("punc", punc); - } - function can_insert_semicolon() { - return !options.strict && (S.token.nlb || is("eof") || is("punc", "}")); - } - function semicolon() { - if (is("punc", ";")) next(); else if (!can_insert_semicolon()) unexpected(); - } - function parenthesised() { - expect("("); - var exp = expression(true); - expect(")"); - return exp; - } - function embed_tokens(parser) { - return function() { - var start = S.token; - var expr = parser(); - var end = prev(); - expr.start = start; - expr.end = end; - return expr; - }; - } - var statement = embed_tokens(function() { - var tmp; - if (is("operator", "/") || is("operator", "/=")) { - S.peeked = null; - S.token = S.input(S.token.value.substr(1)); - } - switch (S.token.type) { - case "string": - var dir = S.in_directives, stat = simple_statement(); - if (dir && stat.body instanceof AST_String && !is("punc", ",")) return new AST_Directive({ - value: stat.body.value - }); - return stat; - - case "num": - case "regexp": - case "operator": - case "atom": - return simple_statement(); - - case "name": - return is_token(peek(), "punc", ":") ? labeled_statement() : simple_statement(); - - case "punc": - switch (S.token.value) { - case "{": - return new AST_BlockStatement({ - start: S.token, - body: block_(), - end: prev() - }); - - case "[": - case "(": - return simple_statement(); - - case ";": - next(); - return new AST_EmptyStatement(); - - default: - unexpected(); - } - - case "keyword": - switch (tmp = S.token.value, next(), tmp) { - case "break": - return break_cont(AST_Break); - - case "continue": - return break_cont(AST_Continue); - - case "debugger": - semicolon(); - return new AST_Debugger(); - - case "do": - return new AST_Do({ - body: in_loop(statement), - condition: (expect_token("keyword", "while"), tmp = parenthesised(), semicolon(), - tmp) - }); - - case "while": - return new AST_While({ - condition: parenthesised(), - body: in_loop(statement) - }); - - case "for": - return for_(); - - case "function": - return function_(true); - - case "if": - return if_(); - - case "return": - if (S.in_function == 0) croak("'return' outside of function"); - return new AST_Return({ - value: is("punc", ";") ? (next(), null) : can_insert_semicolon() ? null : (tmp = expression(true), - semicolon(), tmp) - }); - - case "switch": - return new AST_Switch({ - expression: parenthesised(), - body: in_loop(switch_body_) - }); - - case "throw": - if (S.token.nlb) croak("Illegal newline after 'throw'"); - return new AST_Throw({ - value: (tmp = expression(true), semicolon(), tmp) - }); - - case "try": - return try_(); - - case "var": - return tmp = var_(), semicolon(), tmp; - - case "const": - return tmp = const_(), semicolon(), tmp; - - case "with": - return new AST_With({ - expression: parenthesised(), - body: statement() - }); - - default: - unexpected(); - } - } - }); - function labeled_statement() { - var label = as_symbol(AST_Label); - if (find_if(function(l) { - return l.name == label.name; - }, S.labels)) { - croak("Label " + label.name + " defined twice"); - } - expect(":"); - S.labels.push(label); - var stat = statement(); - S.labels.pop(); - return new AST_LabeledStatement({ - body: stat, - label: label - }); - } - function simple_statement(tmp) { - return new AST_SimpleStatement({ - body: (tmp = expression(true), semicolon(), tmp) - }); - } - function break_cont(type) { - var label = null; - if (!can_insert_semicolon()) { - label = as_symbol(AST_LabelRef, true); - } - if (label != null) { - if (!find_if(function(l) { - return l.name == label.name; - }, S.labels)) croak("Undefined label " + label.name); - } else if (S.in_loop == 0) croak(type.TYPE + " not inside a loop or switch"); - semicolon(); - return new type({ - label: label - }); - } - function for_() { - expect("("); - var init = null; - if (!is("punc", ";")) { - init = is("keyword", "var") ? (next(), var_(true)) : expression(true, true); - if (is("operator", "in")) { - if (init instanceof AST_Var && init.definitions.length > 1) croak("Only one variable declaration allowed in for..in loop"); - next(); - return for_in(init); - } - } - return regular_for(init); - } - function regular_for(init) { - expect(";"); - var test = is("punc", ";") ? null : expression(true); - expect(";"); - var step = is("punc", ")") ? null : expression(true); - expect(")"); - return new AST_For({ - init: init, - condition: test, - step: step, - body: in_loop(statement) - }); - } - function for_in(init) { - var lhs = init instanceof AST_Var ? init.definitions[0].name : null; - var obj = expression(true); - expect(")"); - return new AST_ForIn({ - init: init, - name: lhs, - object: obj, - body: in_loop(statement) - }); - } - var function_ = function(in_statement, ctor) { - var is_accessor = ctor === AST_Accessor; - var name = is("name") ? as_symbol(in_statement ? AST_SymbolDefun : is_accessor ? AST_SymbolAccessor : AST_SymbolLambda) : is_accessor && (is("string") || is("num")) ? as_atom_node() : null; - if (in_statement && !name) unexpected(); - expect("("); - if (!ctor) ctor = in_statement ? AST_Defun : AST_Function; - return new ctor({ - name: name, - argnames: function(first, a) { - while (!is("punc", ")")) { - if (first) first = false; else expect(","); - a.push(as_symbol(AST_SymbolFunarg)); - } - next(); - return a; - }(true, []), - body: function(loop, labels) { - ++S.in_function; - S.in_directives = true; - S.in_loop = 0; - S.labels = []; - var a = block_(); - --S.in_function; - S.in_loop = loop; - S.labels = labels; - return a; - }(S.in_loop, S.labels) - }); - }; - function if_() { - var cond = parenthesised(), body = statement(), belse = null; - if (is("keyword", "else")) { - next(); - belse = statement(); - } - return new AST_If({ - condition: cond, - body: body, - alternative: belse - }); - } - function block_() { - expect("{"); - var a = []; - while (!is("punc", "}")) { - if (is("eof")) unexpected(); - a.push(statement()); - } - next(); - return a; - } - function switch_body_() { - expect("{"); - var a = [], cur = null, branch = null, tmp; - while (!is("punc", "}")) { - if (is("eof")) unexpected(); - if (is("keyword", "case")) { - if (branch) branch.end = prev(); - cur = []; - branch = new AST_Case({ - start: (tmp = S.token, next(), tmp), - expression: expression(true), - body: cur - }); - a.push(branch); - expect(":"); - } else if (is("keyword", "default")) { - if (branch) branch.end = prev(); - cur = []; - branch = new AST_Default({ - start: (tmp = S.token, next(), expect(":"), tmp), - body: cur - }); - a.push(branch); - } else { - if (!cur) unexpected(); - cur.push(statement()); - } - } - if (branch) branch.end = prev(); - next(); - return a; - } - function try_() { - var body = block_(), bcatch = null, bfinally = null; - if (is("keyword", "catch")) { - var start = S.token; - next(); - expect("("); - var name = as_symbol(AST_SymbolCatch); - expect(")"); - bcatch = new AST_Catch({ - start: start, - argname: name, - body: block_(), - end: prev() - }); - } - if (is("keyword", "finally")) { - var start = S.token; - next(); - bfinally = new AST_Finally({ - start: start, - body: block_(), - end: prev() - }); - } - if (!bcatch && !bfinally) croak("Missing catch/finally blocks"); - return new AST_Try({ - body: body, - bcatch: bcatch, - bfinally: bfinally - }); - } - function vardefs(no_in, in_const) { - var a = []; - for (;;) { - a.push(new AST_VarDef({ - start: S.token, - name: as_symbol(in_const ? AST_SymbolConst : AST_SymbolVar), - value: is("operator", "=") ? (next(), expression(false, no_in)) : null, - end: prev() - })); - if (!is("punc", ",")) break; - next(); - } - return a; - } - var var_ = function(no_in) { - return new AST_Var({ - start: prev(), - definitions: vardefs(no_in, false), - end: prev() - }); - }; - var const_ = function() { - return new AST_Const({ - start: prev(), - definitions: vardefs(false, true), - end: prev() - }); - }; - var new_ = function() { - var start = S.token; - expect_token("operator", "new"); - var newexp = expr_atom(false), args; - if (is("punc", "(")) { - next(); - args = expr_list(")"); - } else { - args = []; - } - return subscripts(new AST_New({ - start: start, - expression: newexp, - args: args, - end: prev() - }), true); - }; - function as_atom_node() { - var tok = S.token, ret; - switch (tok.type) { - case "name": - return as_symbol(AST_SymbolRef); - - case "num": - ret = new AST_Number({ - start: tok, - end: tok, - value: tok.value - }); - break; - - case "string": - ret = new AST_String({ - start: tok, - end: tok, - value: tok.value - }); - break; - - case "regexp": - ret = new AST_RegExp({ - start: tok, - end: tok, - value: tok.value - }); - break; - - case "atom": - switch (tok.value) { - case "false": - ret = new AST_False({ - start: tok, - end: tok - }); - break; - - case "true": - ret = new AST_True({ - start: tok, - end: tok - }); - break; - - case "null": - ret = new AST_Null({ - start: tok, - end: tok - }); - break; - } - break; - } - next(); - return ret; - } - var expr_atom = function(allow_calls) { - if (is("operator", "new")) { - return new_(); - } - var start = S.token; - if (is("punc")) { - switch (start.value) { - case "(": - next(); - var ex = expression(true); - ex.start = start; - ex.end = S.token; - expect(")"); - return subscripts(ex, allow_calls); - - case "[": - return subscripts(array_(), allow_calls); - - case "{": - return subscripts(object_(), allow_calls); - } - unexpected(); - } - if (is("keyword", "function")) { - next(); - var func = function_(false); - func.start = start; - func.end = prev(); - return subscripts(func, allow_calls); - } - if (ATOMIC_START_TOKEN[S.token.type]) { - return subscripts(as_atom_node(), allow_calls); - } - unexpected(); - }; - function expr_list(closing, allow_trailing_comma, allow_empty) { - var first = true, a = []; - while (!is("punc", closing)) { - if (first) first = false; else expect(","); - if (allow_trailing_comma && is("punc", closing)) break; - if (is("punc", ",") && allow_empty) { - a.push(new AST_Hole({ - start: S.token, - end: S.token - })); - } else { - a.push(expression(false)); - } - } - next(); - return a; - } - var array_ = embed_tokens(function() { - expect("["); - return new AST_Array({ - elements: expr_list("]", !options.strict, true) - }); - }); - var object_ = embed_tokens(function() { - expect("{"); - var first = true, a = []; - while (!is("punc", "}")) { - if (first) first = false; else expect(","); - if (!options.strict && is("punc", "}")) break; - var start = S.token; - var type = start.type; - var name = as_property_name(); - if (type == "name" && !is("punc", ":")) { - if (name == "get") { - a.push(new AST_ObjectGetter({ - start: start, - key: name, - value: function_(false, AST_Accessor), - end: prev() - })); - continue; - } - if (name == "set") { - a.push(new AST_ObjectSetter({ - start: start, - key: name, - value: function_(false, AST_Accessor), - end: prev() - })); - continue; - } - } - expect(":"); - a.push(new AST_ObjectKeyVal({ - start: start, - key: name, - value: expression(false), - end: prev() - })); - } - next(); - return new AST_Object({ - properties: a - }); - }); - function as_property_name() { - var tmp = S.token; - next(); - switch (tmp.type) { - case "num": - case "string": - case "name": - case "operator": - case "keyword": - case "atom": - return tmp.value; - - default: - unexpected(); - } - } - function as_name() { - var tmp = S.token; - next(); - switch (tmp.type) { - case "name": - case "operator": - case "keyword": - case "atom": - return tmp.value; - - default: - unexpected(); - } - } - function as_symbol(type, noerror) { - if (!is("name")) { - if (!noerror) croak("Name expected"); - return null; - } - var name = S.token.value; - var sym = new (name == "this" ? AST_This : type)({ - name: String(S.token.value), - start: S.token, - end: S.token - }); - next(); - return sym; - } - var subscripts = function(expr, allow_calls) { - var start = expr.start; - if (is("punc", ".")) { - next(); - return subscripts(new AST_Dot({ - start: start, - expression: expr, - property: as_name(), - end: prev() - }), allow_calls); - } - if (is("punc", "[")) { - next(); - var prop = expression(true); - expect("]"); - return subscripts(new AST_Sub({ - start: start, - expression: expr, - property: prop, - end: prev() - }), allow_calls); - } - if (allow_calls && is("punc", "(")) { - next(); - return subscripts(new AST_Call({ - start: start, - expression: expr, - args: expr_list(")"), - end: prev() - }), true); - } - return expr; - }; - var maybe_unary = function(allow_calls) { - var start = S.token; - if (is("operator") && UNARY_PREFIX(start.value)) { - next(); - var ex = make_unary(AST_UnaryPrefix, start.value, maybe_unary(allow_calls)); - ex.start = start; - ex.end = prev(); - return ex; - } - var val = expr_atom(allow_calls); - while (is("operator") && UNARY_POSTFIX(S.token.value) && !S.token.nlb) { - val = make_unary(AST_UnaryPostfix, S.token.value, val); - val.start = start; - val.end = S.token; - next(); - } - return val; - }; - function make_unary(ctor, op, expr) { - if ((op == "++" || op == "--") && !is_assignable(expr)) croak("Invalid use of " + op + " operator"); - return new ctor({ - operator: op, - expression: expr - }); - } - var expr_op = function(left, min_prec, no_in) { - var op = is("operator") ? S.token.value : null; - if (op == "in" && no_in) op = null; - var prec = op != null ? PRECEDENCE[op] : null; - if (prec != null && prec > min_prec) { - next(); - var right = expr_op(maybe_unary(true), prec, no_in); - return expr_op(new AST_Binary({ - start: left.start, - left: left, - operator: op, - right: right, - end: right.end - }), min_prec, no_in); - } - return left; - }; - function expr_ops(no_in) { - return expr_op(maybe_unary(true), 0, no_in); - } - var maybe_conditional = function(no_in) { - var start = S.token; - var expr = expr_ops(no_in); - if (is("operator", "?")) { - next(); - var yes = expression(false); - expect(":"); - return new AST_Conditional({ - start: start, - condition: expr, - consequent: yes, - alternative: expression(false, no_in), - end: peek() - }); - } - return expr; - }; - function is_assignable(expr) { - if (!options.strict) return true; - if (expr instanceof AST_This) return false; - return expr instanceof AST_PropAccess || expr instanceof AST_Symbol; - } - var maybe_assign = function(no_in) { - var start = S.token; - var left = maybe_conditional(no_in), val = S.token.value; - if (is("operator") && ASSIGNMENT(val)) { - if (is_assignable(left)) { - next(); - return new AST_Assign({ - start: start, - left: left, - operator: val, - right: maybe_assign(no_in), - end: prev() - }); - } - croak("Invalid assignment"); - } - return left; - }; - var expression = function(commas, no_in) { - var start = S.token; - var expr = maybe_assign(no_in); - if (commas && is("punc", ",")) { - next(); - return new AST_Seq({ - start: start, - car: expr, - cdr: expression(true, no_in), - end: peek() - }); - } - return expr; - }; - function in_loop(cont) { - ++S.in_loop; - var ret = cont(); - --S.in_loop; - return ret; - } - if (options.expression) { - return expression(true); - } - return function() { - var start = S.token; - var body = []; - while (!is("eof")) body.push(statement()); - var end = prev(); - var toplevel = options.toplevel; - if (toplevel) { - toplevel.body = toplevel.body.concat(body); - toplevel.end = end; - } else { - toplevel = new AST_Toplevel({ - start: start, - body: body, - end: end - }); - } - return toplevel; - }(); - } - "use strict"; - function TreeTransformer(before, after) { - TreeWalker.call(this); - this.before = before; - this.after = after; - } - TreeTransformer.prototype = new TreeWalker(); - (function(undefined) { - function _(node, descend) { - node.DEFMETHOD("transform", function(tw, in_list) { - var x, y; - tw.push(this); - if (tw.before) x = tw.before(this, descend, in_list); - if (x === undefined) { - if (!tw.after) { - x = this; - descend(x, tw); - } else { - tw.stack[tw.stack.length - 1] = x = this.clone(); - descend(x, tw); - y = tw.after(x, in_list); - if (y !== undefined) x = y; - } - } - tw.pop(); - return x; - }); - } - function do_list(list, tw) { - return MAP(list, function(node) { - return node.transform(tw, true); - }); - } - _(AST_Node, noop); - _(AST_LabeledStatement, function(self, tw) { - self.label = self.label.transform(tw); - self.body = self.body.transform(tw); - }); - _(AST_SimpleStatement, function(self, tw) { - self.body = self.body.transform(tw); - }); - _(AST_Block, function(self, tw) { - self.body = do_list(self.body, tw); - }); - _(AST_DWLoop, function(self, tw) { - self.condition = self.condition.transform(tw); - self.body = self.body.transform(tw); - }); - _(AST_For, function(self, tw) { - if (self.init) self.init = self.init.transform(tw); - if (self.condition) self.condition = self.condition.transform(tw); - if (self.step) self.step = self.step.transform(tw); - self.body = self.body.transform(tw); - }); - _(AST_ForIn, function(self, tw) { - self.init = self.init.transform(tw); - self.object = self.object.transform(tw); - self.body = self.body.transform(tw); - }); - _(AST_With, function(self, tw) { - self.expression = self.expression.transform(tw); - self.body = self.body.transform(tw); - }); - _(AST_Exit, function(self, tw) { - if (self.value) self.value = self.value.transform(tw); - }); - _(AST_LoopControl, function(self, tw) { - if (self.label) self.label = self.label.transform(tw); - }); - _(AST_If, function(self, tw) { - self.condition = self.condition.transform(tw); - self.body = self.body.transform(tw); - if (self.alternative) self.alternative = self.alternative.transform(tw); - }); - _(AST_Switch, function(self, tw) { - self.expression = self.expression.transform(tw); - self.body = do_list(self.body, tw); - }); - _(AST_Case, function(self, tw) { - self.expression = self.expression.transform(tw); - self.body = do_list(self.body, tw); - }); - _(AST_Try, function(self, tw) { - self.body = do_list(self.body, tw); - if (self.bcatch) self.bcatch = self.bcatch.transform(tw); - if (self.bfinally) self.bfinally = self.bfinally.transform(tw); - }); - _(AST_Catch, function(self, tw) { - self.argname = self.argname.transform(tw); - self.body = do_list(self.body, tw); - }); - _(AST_Definitions, function(self, tw) { - self.definitions = do_list(self.definitions, tw); - }); - _(AST_VarDef, function(self, tw) { - if (self.value) self.value = self.value.transform(tw); - }); - _(AST_Lambda, function(self, tw) { - if (self.name) self.name = self.name.transform(tw); - self.argnames = do_list(self.argnames, tw); - self.body = do_list(self.body, tw); - }); - _(AST_Call, function(self, tw) { - self.expression = self.expression.transform(tw); - self.args = do_list(self.args, tw); - }); - _(AST_Seq, function(self, tw) { - self.car = self.car.transform(tw); - self.cdr = self.cdr.transform(tw); - }); - _(AST_Dot, function(self, tw) { - self.expression = self.expression.transform(tw); - }); - _(AST_Sub, function(self, tw) { - self.expression = self.expression.transform(tw); - self.property = self.property.transform(tw); - }); - _(AST_Unary, function(self, tw) { - self.expression = self.expression.transform(tw); - }); - _(AST_Binary, function(self, tw) { - self.left = self.left.transform(tw); - self.right = self.right.transform(tw); - }); - _(AST_Conditional, function(self, tw) { - self.condition = self.condition.transform(tw); - self.consequent = self.consequent.transform(tw); - self.alternative = self.alternative.transform(tw); - }); - _(AST_Array, function(self, tw) { - self.elements = do_list(self.elements, tw); - }); - _(AST_Object, function(self, tw) { - self.properties = do_list(self.properties, tw); - }); - _(AST_ObjectProperty, function(self, tw) { - self.value = self.value.transform(tw); - }); - })(); - "use strict"; - function SymbolDef(scope, index, orig) { - this.name = orig.name; - this.orig = [ orig ]; - this.scope = scope; - this.references = []; - this.global = false; - this.mangled_name = null; - this.undeclared = false; - this.constant = false; - this.index = index; - } - SymbolDef.prototype = { - unmangleable: function(options) { - return this.global && !(options && options.toplevel) || this.undeclared || !(options && options.eval) && (this.scope.uses_eval || this.scope.uses_with); - }, - mangle: function(options) { - if (!this.mangled_name && !this.unmangleable(options)) { - var s = this.scope; - if (this.orig[0] instanceof AST_SymbolLambda && !options.screw_ie8) s = s.parent_scope; - this.mangled_name = s.next_mangled(options); - } - } - }; - AST_Toplevel.DEFMETHOD("figure_out_scope", function() { - var self = this; - var scope = self.parent_scope = null; - var labels = new Dictionary(); - var nesting = 0; - var tw = new TreeWalker(function(node, descend) { - if (node instanceof AST_Scope) { - node.init_scope_vars(nesting); - var save_scope = node.parent_scope = scope; - var save_labels = labels; - ++nesting; - scope = node; - labels = new Dictionary(); - descend(); - labels = save_labels; - scope = save_scope; - --nesting; - return true; - } - if (node instanceof AST_Directive) { - node.scope = scope; - push_uniq(scope.directives, node.value); - return true; - } - if (node instanceof AST_With) { - for (var s = scope; s; s = s.parent_scope) s.uses_with = true; - return; - } - if (node instanceof AST_LabeledStatement) { - var l = node.label; - if (labels.has(l.name)) throw new Error(string_template("Label {name} defined twice", l)); - labels.set(l.name, l); - descend(); - labels.del(l.name); - return true; - } - if (node instanceof AST_Symbol) { - node.scope = scope; - } - if (node instanceof AST_Label) { - node.thedef = node; - node.init_scope_vars(); - } - if (node instanceof AST_SymbolLambda) { - scope.def_function(node); - } else if (node instanceof AST_SymbolDefun) { - (node.scope = scope.parent_scope).def_function(node); - } else if (node instanceof AST_SymbolVar || node instanceof AST_SymbolConst) { - var def = scope.def_variable(node); - def.constant = node instanceof AST_SymbolConst; - def.init = tw.parent().value; - } else if (node instanceof AST_SymbolCatch) { - scope.def_variable(node); - } - if (node instanceof AST_LabelRef) { - var sym = labels.get(node.name); - if (!sym) throw new Error(string_template("Undefined label {name} [{line},{col}]", { - name: node.name, - line: node.start.line, - col: node.start.col - })); - node.thedef = sym; - } - }); - self.walk(tw); - var func = null; - var globals = self.globals = new Dictionary(); - var tw = new TreeWalker(function(node, descend) { - if (node instanceof AST_Lambda) { - var prev_func = func; - func = node; - descend(); - func = prev_func; - return true; - } - if (node instanceof AST_LabelRef) { - node.reference(); - return true; - } - if (node instanceof AST_SymbolRef) { - var name = node.name; - var sym = node.scope.find_variable(name); - if (!sym) { - var g; - if (globals.has(name)) { - g = globals.get(name); - } else { - g = new SymbolDef(self, globals.size(), node); - g.undeclared = true; - g.global = true; - globals.set(name, g); - } - node.thedef = g; - if (name == "eval" && tw.parent() instanceof AST_Call) { - for (var s = node.scope; s && !s.uses_eval; s = s.parent_scope) s.uses_eval = true; - } - if (name == "arguments") { - func.uses_arguments = true; - } - } else { - node.thedef = sym; - } - node.reference(); - return true; - } - }); - self.walk(tw); - }); - AST_Scope.DEFMETHOD("init_scope_vars", function(nesting) { - this.directives = []; - this.variables = new Dictionary(); - this.functions = new Dictionary(); - this.uses_with = false; - this.uses_eval = false; - this.parent_scope = null; - this.enclosed = []; - this.cname = -1; - this.nesting = nesting; - }); - AST_Scope.DEFMETHOD("strict", function() { - return this.has_directive("use strict"); - }); - AST_Lambda.DEFMETHOD("init_scope_vars", function() { - AST_Scope.prototype.init_scope_vars.apply(this, arguments); - this.uses_arguments = false; - }); - AST_SymbolRef.DEFMETHOD("reference", function() { - var def = this.definition(); - def.references.push(this); - var s = this.scope; - while (s) { - push_uniq(s.enclosed, def); - if (s === def.scope) break; - s = s.parent_scope; - } - this.frame = this.scope.nesting - def.scope.nesting; - }); - AST_Label.DEFMETHOD("init_scope_vars", function() { - this.references = []; - }); - AST_LabelRef.DEFMETHOD("reference", function() { - this.thedef.references.push(this); - }); - AST_Scope.DEFMETHOD("find_variable", function(name) { - if (name instanceof AST_Symbol) name = name.name; - return this.variables.get(name) || this.parent_scope && this.parent_scope.find_variable(name); - }); - AST_Scope.DEFMETHOD("has_directive", function(value) { - return this.parent_scope && this.parent_scope.has_directive(value) || (this.directives.indexOf(value) >= 0 ? this : null); - }); - AST_Scope.DEFMETHOD("def_function", function(symbol) { - this.functions.set(symbol.name, this.def_variable(symbol)); - }); - AST_Scope.DEFMETHOD("def_variable", function(symbol) { - var def; - if (!this.variables.has(symbol.name)) { - def = new SymbolDef(this, this.variables.size(), symbol); - this.variables.set(symbol.name, def); - def.global = !this.parent_scope; - } else { - def = this.variables.get(symbol.name); - def.orig.push(symbol); - } - return symbol.thedef = def; - }); - AST_Scope.DEFMETHOD("next_mangled", function(options) { - var ext = this.enclosed; - out: while (true) { - var m = base54(++this.cname); - if (!is_identifier(m)) continue; - for (var i = ext.length; --i >= 0; ) { - var sym = ext[i]; - var name = sym.mangled_name || sym.unmangleable(options) && sym.name; - if (m == name) continue out; - } - return m; - } - }); - AST_Scope.DEFMETHOD("references", function(sym) { - if (sym instanceof AST_Symbol) sym = sym.definition(); - return this.enclosed.indexOf(sym) < 0 ? null : sym; - }); - AST_Symbol.DEFMETHOD("unmangleable", function(options) { - return this.definition().unmangleable(options); - }); - AST_SymbolAccessor.DEFMETHOD("unmangleable", function() { - return true; - }); - AST_Label.DEFMETHOD("unmangleable", function() { - return false; - }); - AST_Symbol.DEFMETHOD("unreferenced", function() { - return this.definition().references.length == 0 && !(this.scope.uses_eval || this.scope.uses_with); - }); - AST_Symbol.DEFMETHOD("undeclared", function() { - return this.definition().undeclared; - }); - AST_LabelRef.DEFMETHOD("undeclared", function() { - return false; - }); - AST_Label.DEFMETHOD("undeclared", function() { - return false; - }); - AST_Symbol.DEFMETHOD("definition", function() { - return this.thedef; - }); - AST_Symbol.DEFMETHOD("global", function() { - return this.definition().global; - }); - AST_Toplevel.DEFMETHOD("_default_mangler_options", function(options) { - return defaults(options, { - except: [], - eval: false, - sort: false, - toplevel: false, - screw_ie8: false - }); - }); - AST_Toplevel.DEFMETHOD("mangle_names", function(options) { - options = this._default_mangler_options(options); - var lname = -1; - var to_mangle = []; - var tw = new TreeWalker(function(node, descend) { - if (node instanceof AST_LabeledStatement) { - var save_nesting = lname; - descend(); - lname = save_nesting; - return true; - } - if (node instanceof AST_Scope) { - var p = tw.parent(), a = []; - node.variables.each(function(symbol) { - if (options.except.indexOf(symbol.name) < 0) { - a.push(symbol); - } - }); - if (options.sort) a.sort(function(a, b) { - return b.references.length - a.references.length; - }); - to_mangle.push.apply(to_mangle, a); - return; - } - if (node instanceof AST_Label) { - var name; - do name = base54(++lname); while (!is_identifier(name)); - node.mangled_name = name; - return true; - } - }); - this.walk(tw); - to_mangle.forEach(function(def) { - def.mangle(options); - }); - }); - AST_Toplevel.DEFMETHOD("compute_char_frequency", function(options) { - options = this._default_mangler_options(options); - var tw = new TreeWalker(function(node) { - if (node instanceof AST_Constant) base54.consider(node.print_to_string()); else if (node instanceof AST_Return) base54.consider("return"); else if (node instanceof AST_Throw) base54.consider("throw"); else if (node instanceof AST_Continue) base54.consider("continue"); else if (node instanceof AST_Break) base54.consider("break"); else if (node instanceof AST_Debugger) base54.consider("debugger"); else if (node instanceof AST_Directive) base54.consider(node.value); else if (node instanceof AST_While) base54.consider("while"); else if (node instanceof AST_Do) base54.consider("do while"); else if (node instanceof AST_If) { - base54.consider("if"); - if (node.alternative) base54.consider("else"); - } else if (node instanceof AST_Var) base54.consider("var"); else if (node instanceof AST_Const) base54.consider("const"); else if (node instanceof AST_Lambda) base54.consider("function"); else if (node instanceof AST_For) base54.consider("for"); else if (node instanceof AST_ForIn) base54.consider("for in"); else if (node instanceof AST_Switch) base54.consider("switch"); else if (node instanceof AST_Case) base54.consider("case"); else if (node instanceof AST_Default) base54.consider("default"); else if (node instanceof AST_With) base54.consider("with"); else if (node instanceof AST_ObjectSetter) base54.consider("set" + node.key); else if (node instanceof AST_ObjectGetter) base54.consider("get" + node.key); else if (node instanceof AST_ObjectKeyVal) base54.consider(node.key); else if (node instanceof AST_New) base54.consider("new"); else if (node instanceof AST_This) base54.consider("this"); else if (node instanceof AST_Try) base54.consider("try"); else if (node instanceof AST_Catch) base54.consider("catch"); else if (node instanceof AST_Finally) base54.consider("finally"); else if (node instanceof AST_Symbol && node.unmangleable(options)) base54.consider(node.name); else if (node instanceof AST_Unary || node instanceof AST_Binary) base54.consider(node.operator); else if (node instanceof AST_Dot) base54.consider(node.property); - }); - this.walk(tw); - base54.sort(); - }); - var base54 = function() { - var string = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_0123456789"; - var chars, frequency; - function reset() { - frequency = Object.create(null); - chars = string.split("").map(function(ch) { - return ch.charCodeAt(0); - }); - chars.forEach(function(ch) { - frequency[ch] = 0; - }); - } - base54.consider = function(str) { - for (var i = str.length; --i >= 0; ) { - var code = str.charCodeAt(i); - if (code in frequency) ++frequency[code]; - } - }; - base54.sort = function() { - chars = mergeSort(chars, function(a, b) { - if (is_digit(a) && !is_digit(b)) return 1; - if (is_digit(b) && !is_digit(a)) return -1; - return frequency[b] - frequency[a]; - }); - }; - base54.reset = reset; - reset(); - base54.get = function() { - return chars; - }; - base54.freq = function() { - return frequency; - }; - function base54(num) { - var ret = "", base = 54; - do { - ret += String.fromCharCode(chars[num % base]); - num = Math.floor(num / base); - base = 64; - } while (num > 0); - return ret; - } - return base54; - }(); - AST_Toplevel.DEFMETHOD("scope_warnings", function(options) { - options = defaults(options, { - undeclared: false, - unreferenced: true, - assign_to_global: true, - func_arguments: true, - nested_defuns: true, - eval: true - }); - var tw = new TreeWalker(function(node) { - if (options.undeclared && node instanceof AST_SymbolRef && node.undeclared()) { - AST_Node.warn("Undeclared symbol: {name} [{file}:{line},{col}]", { - name: node.name, - file: node.start.file, - line: node.start.line, - col: node.start.col - }); - } - if (options.assign_to_global) { - var sym = null; - if (node instanceof AST_Assign && node.left instanceof AST_SymbolRef) sym = node.left; else if (node instanceof AST_ForIn && node.init instanceof AST_SymbolRef) sym = node.init; - if (sym && (sym.undeclared() || sym.global() && sym.scope !== sym.definition().scope)) { - AST_Node.warn("{msg}: {name} [{file}:{line},{col}]", { - msg: sym.undeclared() ? "Accidental global?" : "Assignment to global", - name: sym.name, - file: sym.start.file, - line: sym.start.line, - col: sym.start.col - }); - } - } - if (options.eval && node instanceof AST_SymbolRef && node.undeclared() && node.name == "eval") { - AST_Node.warn("Eval is used [{file}:{line},{col}]", node.start); - } - if (options.unreferenced && (node instanceof AST_SymbolDeclaration || node instanceof AST_Label) && node.unreferenced()) { - AST_Node.warn("{type} {name} is declared but not referenced [{file}:{line},{col}]", { - type: node instanceof AST_Label ? "Label" : "Symbol", - name: node.name, - file: node.start.file, - line: node.start.line, - col: node.start.col - }); - } - if (options.func_arguments && node instanceof AST_Lambda && node.uses_arguments) { - AST_Node.warn("arguments used in function {name} [{file}:{line},{col}]", { - name: node.name ? node.name.name : "anonymous", - file: node.start.file, - line: node.start.line, - col: node.start.col - }); - } - if (options.nested_defuns && node instanceof AST_Defun && !(tw.parent() instanceof AST_Scope)) { - AST_Node.warn('Function {name} declared in nested statement "{type}" [{file}:{line},{col}]', { - name: node.name.name, - type: tw.parent().TYPE, - file: node.start.file, - line: node.start.line, - col: node.start.col - }); - } - }); - this.walk(tw); - }); - "use strict"; - function OutputStream(options) { - options = defaults(options, { - indent_start: 0, - indent_level: 4, - quote_keys: false, - space_colon: true, - ascii_only: false, - inline_script: false, - width: 80, - max_line_len: 32e3, - ie_proof: true, - beautify: false, - source_map: null, - bracketize: false, - semicolons: true, - comments: false, - preserve_line: false, - negate_iife: !(options && options.beautify) - }, true); - var indentation = 0; - var current_col = 0; - var current_line = 1; - var current_pos = 0; - var OUTPUT = ""; - function to_ascii(str, identifier) { - return str.replace(/[\u0080-\uffff]/g, function(ch) { - var code = ch.charCodeAt(0).toString(16); - if (code.length <= 2 && !identifier) { - while (code.length < 2) code = "0" + code; - return "\\x" + code; - } else { - while (code.length < 4) code = "0" + code; - return "\\u" + code; - } - }); - } - function make_string(str) { - var dq = 0, sq = 0; - str = str.replace(/[\\\b\f\n\r\t\x22\x27\u2028\u2029\0]/g, function(s) { - switch (s) { - case "\\": - return "\\\\"; - - case "\b": - return "\\b"; - - case "\f": - return "\\f"; - - case "\n": - return "\\n"; - - case "\r": - return "\\r"; - - case "\u2028": - return "\\u2028"; - - case "\u2029": - return "\\u2029"; - - case '"': - ++dq; - return '"'; - - case "'": - ++sq; - return "'"; - - case "\0": - return "\\0"; - } - return s; - }); - if (options.ascii_only) str = to_ascii(str); - if (dq > sq) return "'" + str.replace(/\x27/g, "\\'") + "'"; else return '"' + str.replace(/\x22/g, '\\"') + '"'; - } - function encode_string(str) { - var ret = make_string(str); - if (options.inline_script) ret = ret.replace(/<\x2fscript([>\/\t\n\f\r ])/gi, "<\\/script$1"); - return ret; - } - function make_name(name) { - name = name.toString(); - if (options.ascii_only) name = to_ascii(name, true); - return name; - } - function make_indent(back) { - return repeat_string(" ", options.indent_start + indentation - back * options.indent_level); - } - var might_need_space = false; - var might_need_semicolon = false; - var last = null; - function last_char() { - return last.charAt(last.length - 1); - } - function maybe_newline() { - if (options.max_line_len && current_col > options.max_line_len) print("\n"); - } - var requireSemicolonChars = makePredicate("( [ + * / - , ."); - function print(str) { - str = String(str); - var ch = str.charAt(0); - if (might_need_semicolon) { - if ((!ch || ";}".indexOf(ch) < 0) && !/[;]$/.test(last)) { - if (options.semicolons || requireSemicolonChars(ch)) { - OUTPUT += ";"; - current_col++; - current_pos++; - } else { - OUTPUT += "\n"; - current_pos++; - current_line++; - current_col = 0; - } - if (!options.beautify) might_need_space = false; - } - might_need_semicolon = false; - maybe_newline(); - } - if (!options.beautify && options.preserve_line && stack[stack.length - 1]) { - var target_line = stack[stack.length - 1].start.line; - while (current_line < target_line) { - OUTPUT += "\n"; - current_pos++; - current_line++; - current_col = 0; - might_need_space = false; - } - } - if (might_need_space) { - var prev = last_char(); - if (is_identifier_char(prev) && (is_identifier_char(ch) || ch == "\\") || /^[\+\-\/]$/.test(ch) && ch == prev) { - OUTPUT += " "; - current_col++; - current_pos++; - } - might_need_space = false; - } - var a = str.split(/\r?\n/), n = a.length - 1; - current_line += n; - if (n == 0) { - current_col += a[n].length; - } else { - current_col = a[n].length; - } - current_pos += str.length; - last = str; - OUTPUT += str; - } - var space = options.beautify ? function() { - print(" "); - } : function() { - might_need_space = true; - }; - var indent = options.beautify ? function(half) { - if (options.beautify) { - print(make_indent(half ? .5 : 0)); - } - } : noop; - var with_indent = options.beautify ? function(col, cont) { - if (col === true) col = next_indent(); - var save_indentation = indentation; - indentation = col; - var ret = cont(); - indentation = save_indentation; - return ret; - } : function(col, cont) { - return cont(); - }; - var newline = options.beautify ? function() { - print("\n"); - } : noop; - var semicolon = options.beautify ? function() { - print(";"); - } : function() { - might_need_semicolon = true; - }; - function force_semicolon() { - might_need_semicolon = false; - print(";"); - } - function next_indent() { - return indentation + options.indent_level; - } - function with_block(cont) { - var ret; - print("{"); - newline(); - with_indent(next_indent(), function() { - ret = cont(); - }); - indent(); - print("}"); - return ret; - } - function with_parens(cont) { - print("("); - var ret = cont(); - print(")"); - return ret; - } - function with_square(cont) { - print("["); - var ret = cont(); - print("]"); - return ret; - } - function comma() { - print(","); - space(); - } - function colon() { - print(":"); - if (options.space_colon) space(); - } - var add_mapping = options.source_map ? function(token, name) { - try { - if (token) options.source_map.add(token.file || "?", current_line, current_col, token.line, token.col, !name && token.type == "name" ? token.value : name); - } catch (ex) { - AST_Node.warn("Couldn't figure out mapping for {file}:{line},{col} → {cline},{ccol} [{name}]", { - file: token.file, - line: token.line, - col: token.col, - cline: current_line, - ccol: current_col, - name: name || "" - }); - } - } : noop; - function get() { - return OUTPUT; - } - var stack = []; - return { - get: get, - toString: get, - indent: indent, - indentation: function() { - return indentation; - }, - current_width: function() { - return current_col - indentation; - }, - should_break: function() { - return options.width && this.current_width() >= options.width; - }, - newline: newline, - print: print, - space: space, - comma: comma, - colon: colon, - last: function() { - return last; - }, - semicolon: semicolon, - force_semicolon: force_semicolon, - to_ascii: to_ascii, - print_name: function(name) { - print(make_name(name)); - }, - print_string: function(str) { - print(encode_string(str)); - }, - next_indent: next_indent, - with_indent: with_indent, - with_block: with_block, - with_parens: with_parens, - with_square: with_square, - add_mapping: add_mapping, - option: function(opt) { - return options[opt]; - }, - line: function() { - return current_line; - }, - col: function() { - return current_col; - }, - pos: function() { - return current_pos; - }, - push_node: function(node) { - stack.push(node); - }, - pop_node: function() { - return stack.pop(); - }, - stack: function() { - return stack; - }, - parent: function(n) { - return stack[stack.length - 2 - (n || 0)]; - } - }; - } - (function() { - function DEFPRINT(nodetype, generator) { - nodetype.DEFMETHOD("_codegen", generator); - } - AST_Node.DEFMETHOD("print", function(stream, force_parens) { - var self = this, generator = self._codegen; - stream.push_node(self); - var needs_parens = self.needs_parens(stream); - var fc = self instanceof AST_Function && stream.option("negate_iife"); - if (force_parens || needs_parens && !fc) { - stream.with_parens(function() { - self.add_comments(stream); - self.add_source_map(stream); - generator(self, stream); - }); - } else { - self.add_comments(stream); - if (needs_parens && fc) stream.print("!"); - self.add_source_map(stream); - generator(self, stream); - } - stream.pop_node(); - }); - AST_Node.DEFMETHOD("print_to_string", function(options) { - var s = OutputStream(options); - this.print(s); - return s.get(); - }); - AST_Node.DEFMETHOD("add_comments", function(output) { - var c = output.option("comments"), self = this; - if (c) { - var start = self.start; - if (start && !start._comments_dumped) { - start._comments_dumped = true; - var comments = start.comments_before; - if (self instanceof AST_Exit && self.value && self.value.start.comments_before.length > 0) { - comments = (comments || []).concat(self.value.start.comments_before); - self.value.start.comments_before = []; - } - if (c.test) { - comments = comments.filter(function(comment) { - return c.test(comment.value); - }); - } else if (typeof c == "function") { - comments = comments.filter(function(comment) { - return c(self, comment); - }); - } - comments.forEach(function(c) { - if (c.type == "comment1") { - output.print("//" + c.value + "\n"); - output.indent(); - } else if (c.type == "comment2") { - output.print("/*" + c.value + "*/"); - if (start.nlb) { - output.print("\n"); - output.indent(); - } else { - output.space(); - } - } - }); - } - } - }); - function PARENS(nodetype, func) { - nodetype.DEFMETHOD("needs_parens", func); - } - PARENS(AST_Node, function() { - return false; - }); - PARENS(AST_Function, function(output) { - return first_in_statement(output); - }); - PARENS(AST_Object, function(output) { - return first_in_statement(output); - }); - PARENS(AST_Unary, function(output) { - var p = output.parent(); - return p instanceof AST_PropAccess && p.expression === this; - }); - PARENS(AST_Seq, function(output) { - var p = output.parent(); - return p instanceof AST_Call || p instanceof AST_Unary || p instanceof AST_Binary || p instanceof AST_VarDef || p instanceof AST_Dot || p instanceof AST_Array || p instanceof AST_ObjectProperty || p instanceof AST_Conditional; - }); - PARENS(AST_Binary, function(output) { - var p = output.parent(); - if (p instanceof AST_Call && p.expression === this) return true; - if (p instanceof AST_Unary) return true; - if (p instanceof AST_PropAccess && p.expression === this) return true; - if (p instanceof AST_Binary) { - var po = p.operator, pp = PRECEDENCE[po]; - var so = this.operator, sp = PRECEDENCE[so]; - if (pp > sp || pp == sp && this === p.right && !(so == po && (so == "*" || so == "&&" || so == "||"))) { - return true; - } - } - }); - PARENS(AST_PropAccess, function(output) { - var p = output.parent(); - if (p instanceof AST_New && p.expression === this) { - try { - this.walk(new TreeWalker(function(node) { - if (node instanceof AST_Call) throw p; - })); - } catch (ex) { - if (ex !== p) throw ex; - return true; - } - } - }); - PARENS(AST_Call, function(output) { - var p = output.parent(); - return p instanceof AST_New && p.expression === this; - }); - PARENS(AST_New, function(output) { - var p = output.parent(); - if (no_constructor_parens(this, output) && (p instanceof AST_PropAccess || p instanceof AST_Call && p.expression === this)) return true; - }); - PARENS(AST_Number, function(output) { - var p = output.parent(); - if (this.getValue() < 0 && p instanceof AST_PropAccess && p.expression === this) return true; - }); - PARENS(AST_NaN, function(output) { - var p = output.parent(); - if (p instanceof AST_PropAccess && p.expression === this) return true; - }); - function assign_and_conditional_paren_rules(output) { - var p = output.parent(); - if (p instanceof AST_Unary) return true; - if (p instanceof AST_Binary && !(p instanceof AST_Assign)) return true; - if (p instanceof AST_Call && p.expression === this) return true; - if (p instanceof AST_Conditional && p.condition === this) return true; - if (p instanceof AST_PropAccess && p.expression === this) return true; - } - PARENS(AST_Assign, assign_and_conditional_paren_rules); - PARENS(AST_Conditional, assign_and_conditional_paren_rules); - DEFPRINT(AST_Directive, function(self, output) { - output.print_string(self.value); - output.semicolon(); - }); - DEFPRINT(AST_Debugger, function(self, output) { - output.print("debugger"); - output.semicolon(); - }); - function display_body(body, is_toplevel, output) { - var last = body.length - 1; - body.forEach(function(stmt, i) { - if (!(stmt instanceof AST_EmptyStatement)) { - output.indent(); - stmt.print(output); - if (!(i == last && is_toplevel)) { - output.newline(); - if (is_toplevel) output.newline(); - } - } - }); - } - AST_StatementWithBody.DEFMETHOD("_do_print_body", function(output) { - force_statement(this.body, output); - }); - DEFPRINT(AST_Statement, function(self, output) { - self.body.print(output); - output.semicolon(); - }); - DEFPRINT(AST_Toplevel, function(self, output) { - display_body(self.body, true, output); - output.print(""); - }); - DEFPRINT(AST_LabeledStatement, function(self, output) { - self.label.print(output); - output.colon(); - self.body.print(output); - }); - DEFPRINT(AST_SimpleStatement, function(self, output) { - self.body.print(output); - output.semicolon(); - }); - function print_bracketed(body, output) { - if (body.length > 0) output.with_block(function() { - display_body(body, false, output); - }); else output.print("{}"); - } - DEFPRINT(AST_BlockStatement, function(self, output) { - print_bracketed(self.body, output); - }); - DEFPRINT(AST_EmptyStatement, function(self, output) { - output.semicolon(); - }); - DEFPRINT(AST_Do, function(self, output) { - output.print("do"); - output.space(); - self._do_print_body(output); - output.space(); - output.print("while"); - output.space(); - output.with_parens(function() { - self.condition.print(output); - }); - output.semicolon(); - }); - DEFPRINT(AST_While, function(self, output) { - output.print("while"); - output.space(); - output.with_parens(function() { - self.condition.print(output); - }); - output.space(); - self._do_print_body(output); - }); - DEFPRINT(AST_For, function(self, output) { - output.print("for"); - output.space(); - output.with_parens(function() { - if (self.init) { - if (self.init instanceof AST_Definitions) { - self.init.print(output); - } else { - parenthesize_for_noin(self.init, output, true); - } - output.print(";"); - output.space(); - } else { - output.print(";"); - } - if (self.condition) { - self.condition.print(output); - output.print(";"); - output.space(); - } else { - output.print(";"); - } - if (self.step) { - self.step.print(output); - } - }); - output.space(); - self._do_print_body(output); - }); - DEFPRINT(AST_ForIn, function(self, output) { - output.print("for"); - output.space(); - output.with_parens(function() { - self.init.print(output); - output.space(); - output.print("in"); - output.space(); - self.object.print(output); - }); - output.space(); - self._do_print_body(output); - }); - DEFPRINT(AST_With, function(self, output) { - output.print("with"); - output.space(); - output.with_parens(function() { - self.expression.print(output); - }); - output.space(); - self._do_print_body(output); - }); - AST_Lambda.DEFMETHOD("_do_print", function(output, nokeyword) { - var self = this; - if (!nokeyword) { - output.print("function"); - } - if (self.name) { - output.space(); - self.name.print(output); - } - output.with_parens(function() { - self.argnames.forEach(function(arg, i) { - if (i) output.comma(); - arg.print(output); - }); - }); - output.space(); - print_bracketed(self.body, output); - }); - DEFPRINT(AST_Lambda, function(self, output) { - self._do_print(output); - }); - AST_Exit.DEFMETHOD("_do_print", function(output, kind) { - output.print(kind); - if (this.value) { - output.space(); - this.value.print(output); - } - output.semicolon(); - }); - DEFPRINT(AST_Return, function(self, output) { - self._do_print(output, "return"); - }); - DEFPRINT(AST_Throw, function(self, output) { - self._do_print(output, "throw"); - }); - AST_LoopControl.DEFMETHOD("_do_print", function(output, kind) { - output.print(kind); - if (this.label) { - output.space(); - this.label.print(output); - } - output.semicolon(); - }); - DEFPRINT(AST_Break, function(self, output) { - self._do_print(output, "break"); - }); - DEFPRINT(AST_Continue, function(self, output) { - self._do_print(output, "continue"); - }); - function make_then(self, output) { - if (output.option("bracketize")) { - make_block(self.body, output); - return; - } - if (!self.body) return output.force_semicolon(); - if (self.body instanceof AST_Do && output.option("ie_proof")) { - make_block(self.body, output); - return; - } - var b = self.body; - while (true) { - if (b instanceof AST_If) { - if (!b.alternative) { - make_block(self.body, output); - return; - } - b = b.alternative; - } else if (b instanceof AST_StatementWithBody) { - b = b.body; - } else break; - } - force_statement(self.body, output); - } - DEFPRINT(AST_If, function(self, output) { - output.print("if"); - output.space(); - output.with_parens(function() { - self.condition.print(output); - }); - output.space(); - if (self.alternative) { - make_then(self, output); - output.space(); - output.print("else"); - output.space(); - force_statement(self.alternative, output); - } else { - self._do_print_body(output); - } - }); - DEFPRINT(AST_Switch, function(self, output) { - output.print("switch"); - output.space(); - output.with_parens(function() { - self.expression.print(output); - }); - output.space(); - if (self.body.length > 0) output.with_block(function() { - self.body.forEach(function(stmt, i) { - if (i) output.newline(); - output.indent(true); - stmt.print(output); - }); - }); else output.print("{}"); - }); - AST_SwitchBranch.DEFMETHOD("_do_print_body", function(output) { - if (this.body.length > 0) { - output.newline(); - this.body.forEach(function(stmt) { - output.indent(); - stmt.print(output); - output.newline(); - }); - } - }); - DEFPRINT(AST_Default, function(self, output) { - output.print("default:"); - self._do_print_body(output); - }); - DEFPRINT(AST_Case, function(self, output) { - output.print("case"); - output.space(); - self.expression.print(output); - output.print(":"); - self._do_print_body(output); - }); - DEFPRINT(AST_Try, function(self, output) { - output.print("try"); - output.space(); - print_bracketed(self.body, output); - if (self.bcatch) { - output.space(); - self.bcatch.print(output); - } - if (self.bfinally) { - output.space(); - self.bfinally.print(output); - } - }); - DEFPRINT(AST_Catch, function(self, output) { - output.print("catch"); - output.space(); - output.with_parens(function() { - self.argname.print(output); - }); - output.space(); - print_bracketed(self.body, output); - }); - DEFPRINT(AST_Finally, function(self, output) { - output.print("finally"); - output.space(); - print_bracketed(self.body, output); - }); - AST_Definitions.DEFMETHOD("_do_print", function(output, kind) { - output.print(kind); - output.space(); - this.definitions.forEach(function(def, i) { - if (i) output.comma(); - def.print(output); - }); - var p = output.parent(); - var in_for = p instanceof AST_For || p instanceof AST_ForIn; - var avoid_semicolon = in_for && p.init === this; - if (!avoid_semicolon) output.semicolon(); - }); - DEFPRINT(AST_Var, function(self, output) { - self._do_print(output, "var"); - }); - DEFPRINT(AST_Const, function(self, output) { - self._do_print(output, "const"); - }); - function parenthesize_for_noin(node, output, noin) { - if (!noin) node.print(output); else try { - node.walk(new TreeWalker(function(node) { - if (node instanceof AST_Binary && node.operator == "in") throw output; - })); - node.print(output); - } catch (ex) { - if (ex !== output) throw ex; - node.print(output, true); - } - } - DEFPRINT(AST_VarDef, function(self, output) { - self.name.print(output); - if (self.value) { - output.space(); - output.print("="); - output.space(); - var p = output.parent(1); - var noin = p instanceof AST_For || p instanceof AST_ForIn; - parenthesize_for_noin(self.value, output, noin); - } - }); - DEFPRINT(AST_Call, function(self, output) { - self.expression.print(output); - if (self instanceof AST_New && no_constructor_parens(self, output)) return; - output.with_parens(function() { - self.args.forEach(function(expr, i) { - if (i) output.comma(); - expr.print(output); - }); - }); - }); - DEFPRINT(AST_New, function(self, output) { - output.print("new"); - output.space(); - AST_Call.prototype._codegen(self, output); - }); - AST_Seq.DEFMETHOD("_do_print", function(output) { - this.car.print(output); - if (this.cdr) { - output.comma(); - if (output.should_break()) { - output.newline(); - output.indent(); - } - this.cdr.print(output); - } - }); - DEFPRINT(AST_Seq, function(self, output) { - self._do_print(output); - }); - DEFPRINT(AST_Dot, function(self, output) { - var expr = self.expression; - expr.print(output); - if (expr instanceof AST_Number && expr.getValue() >= 0) { - if (!/[xa-f.]/i.test(output.last())) { - output.print("."); - } - } - output.print("."); - output.add_mapping(self.end); - output.print_name(self.property); - }); - DEFPRINT(AST_Sub, function(self, output) { - self.expression.print(output); - output.print("["); - self.property.print(output); - output.print("]"); - }); - DEFPRINT(AST_UnaryPrefix, function(self, output) { - var op = self.operator; - output.print(op); - if (/^[a-z]/i.test(op)) output.space(); - self.expression.print(output); - }); - DEFPRINT(AST_UnaryPostfix, function(self, output) { - self.expression.print(output); - output.print(self.operator); - }); - DEFPRINT(AST_Binary, function(self, output) { - self.left.print(output); - output.space(); - output.print(self.operator); - output.space(); - self.right.print(output); - }); - DEFPRINT(AST_Conditional, function(self, output) { - self.condition.print(output); - output.space(); - output.print("?"); - output.space(); - self.consequent.print(output); - output.space(); - output.colon(); - self.alternative.print(output); - }); - DEFPRINT(AST_Array, function(self, output) { - output.with_square(function() { - var a = self.elements, len = a.length; - if (len > 0) output.space(); - a.forEach(function(exp, i) { - if (i) output.comma(); - exp.print(output); - }); - if (len > 0) output.space(); - }); - }); - DEFPRINT(AST_Object, function(self, output) { - if (self.properties.length > 0) output.with_block(function() { - self.properties.forEach(function(prop, i) { - if (i) { - output.print(","); - output.newline(); - } - output.indent(); - prop.print(output); - }); - output.newline(); - }); else output.print("{}"); - }); - DEFPRINT(AST_ObjectKeyVal, function(self, output) { - var key = self.key; - if (output.option("quote_keys")) { - output.print_string(key + ""); - } else if ((typeof key == "number" || !output.option("beautify") && +key + "" == key) && parseFloat(key) >= 0) { - output.print(make_num(key)); - } else if (!is_identifier(key)) { - output.print_string(key); - } else { - output.print_name(key); - } - output.colon(); - self.value.print(output); - }); - DEFPRINT(AST_ObjectSetter, function(self, output) { - output.print("set"); - self.value._do_print(output, true); - }); - DEFPRINT(AST_ObjectGetter, function(self, output) { - output.print("get"); - self.value._do_print(output, true); - }); - DEFPRINT(AST_Symbol, function(self, output) { - var def = self.definition(); - output.print_name(def ? def.mangled_name || def.name : self.name); - }); - DEFPRINT(AST_Undefined, function(self, output) { - output.print("void 0"); - }); - DEFPRINT(AST_Hole, noop); - DEFPRINT(AST_Infinity, function(self, output) { - output.print("1/0"); - }); - DEFPRINT(AST_NaN, function(self, output) { - output.print("0/0"); - }); - DEFPRINT(AST_This, function(self, output) { - output.print("this"); - }); - DEFPRINT(AST_Constant, function(self, output) { - output.print(self.getValue()); - }); - DEFPRINT(AST_String, function(self, output) { - output.print_string(self.getValue()); - }); - DEFPRINT(AST_Number, function(self, output) { - output.print(make_num(self.getValue())); - }); - DEFPRINT(AST_RegExp, function(self, output) { - var str = self.getValue().toString(); - if (output.option("ascii_only")) str = output.to_ascii(str); - output.print(str); - var p = output.parent(); - if (p instanceof AST_Binary && /^in/.test(p.operator) && p.left === self) output.print(" "); - }); - function force_statement(stat, output) { - if (output.option("bracketize")) { - if (!stat || stat instanceof AST_EmptyStatement) output.print("{}"); else if (stat instanceof AST_BlockStatement) stat.print(output); else output.with_block(function() { - output.indent(); - stat.print(output); - output.newline(); - }); - } else { - if (!stat || stat instanceof AST_EmptyStatement) output.force_semicolon(); else stat.print(output); - } - } - function first_in_statement(output) { - var a = output.stack(), i = a.length, node = a[--i], p = a[--i]; - while (i > 0) { - if (p instanceof AST_Statement && p.body === node) return true; - if (p instanceof AST_Seq && p.car === node || p instanceof AST_Call && p.expression === node && !(p instanceof AST_New) || p instanceof AST_Dot && p.expression === node || p instanceof AST_Sub && p.expression === node || p instanceof AST_Conditional && p.condition === node || p instanceof AST_Binary && p.left === node || p instanceof AST_UnaryPostfix && p.expression === node) { - node = p; - p = a[--i]; - } else { - return false; - } - } - } - function no_constructor_parens(self, output) { - return self.args.length == 0 && !output.option("beautify"); - } - function best_of(a) { - var best = a[0], len = best.length; - for (var i = 1; i < a.length; ++i) { - if (a[i].length < len) { - best = a[i]; - len = best.length; - } - } - return best; - } - function make_num(num) { - var str = num.toString(10), a = [ str.replace(/^0\./, ".").replace("e+", "e") ], m; - if (Math.floor(num) === num) { - if (num >= 0) { - a.push("0x" + num.toString(16).toLowerCase(), "0" + num.toString(8)); - } else { - a.push("-0x" + (-num).toString(16).toLowerCase(), "-0" + (-num).toString(8)); - } - if (m = /^(.*?)(0+)$/.exec(num)) { - a.push(m[1] + "e" + m[2].length); - } - } else if (m = /^0?\.(0+)(.*)$/.exec(num)) { - a.push(m[2] + "e-" + (m[1].length + m[2].length), str.substr(str.indexOf("."))); - } - return best_of(a); - } - function make_block(stmt, output) { - if (stmt instanceof AST_BlockStatement) { - stmt.print(output); - return; - } - output.with_block(function() { - output.indent(); - stmt.print(output); - output.newline(); - }); - } - function DEFMAP(nodetype, generator) { - nodetype.DEFMETHOD("add_source_map", function(stream) { - generator(this, stream); - }); - } - DEFMAP(AST_Node, noop); - function basic_sourcemap_gen(self, output) { - output.add_mapping(self.start); - } - DEFMAP(AST_Directive, basic_sourcemap_gen); - DEFMAP(AST_Debugger, basic_sourcemap_gen); - DEFMAP(AST_Symbol, basic_sourcemap_gen); - DEFMAP(AST_Jump, basic_sourcemap_gen); - DEFMAP(AST_StatementWithBody, basic_sourcemap_gen); - DEFMAP(AST_LabeledStatement, noop); - DEFMAP(AST_Lambda, basic_sourcemap_gen); - DEFMAP(AST_Switch, basic_sourcemap_gen); - DEFMAP(AST_SwitchBranch, basic_sourcemap_gen); - DEFMAP(AST_BlockStatement, basic_sourcemap_gen); - DEFMAP(AST_Toplevel, noop); - DEFMAP(AST_New, basic_sourcemap_gen); - DEFMAP(AST_Try, basic_sourcemap_gen); - DEFMAP(AST_Catch, basic_sourcemap_gen); - DEFMAP(AST_Finally, basic_sourcemap_gen); - DEFMAP(AST_Definitions, basic_sourcemap_gen); - DEFMAP(AST_Constant, basic_sourcemap_gen); - DEFMAP(AST_ObjectProperty, function(self, output) { - output.add_mapping(self.start, self.key); - }); - })(); - "use strict"; - function Compressor(options, false_by_default) { - if (!(this instanceof Compressor)) return new Compressor(options, false_by_default); - TreeTransformer.call(this, this.before, this.after); - this.options = defaults(options, { - sequences: !false_by_default, - properties: !false_by_default, - dead_code: !false_by_default, - drop_debugger: !false_by_default, - unsafe: false, - unsafe_comps: false, - conditionals: !false_by_default, - comparisons: !false_by_default, - evaluate: !false_by_default, - booleans: !false_by_default, - loops: !false_by_default, - unused: !false_by_default, - hoist_funs: !false_by_default, - hoist_vars: false, - if_return: !false_by_default, - join_vars: !false_by_default, - cascade: !false_by_default, - side_effects: !false_by_default, - screw_ie8: false, - warnings: true, - global_defs: {} - }, true); - } - Compressor.prototype = new TreeTransformer(); - merge(Compressor.prototype, { - option: function(key) { - return this.options[key]; - }, - warn: function() { - if (this.options.warnings) AST_Node.warn.apply(AST_Node, arguments); - }, - before: function(node, descend, in_list) { - if (node._squeezed) return node; - if (node instanceof AST_Scope) { - node.drop_unused(this); - node = node.hoist_declarations(this); - } - descend(node, this); - node = node.optimize(this); - if (node instanceof AST_Scope) { - var save_warnings = this.options.warnings; - this.options.warnings = false; - node.drop_unused(this); - this.options.warnings = save_warnings; - } - node._squeezed = true; - return node; - } - }); - (function() { - function OPT(node, optimizer) { - node.DEFMETHOD("optimize", function(compressor) { - var self = this; - if (self._optimized) return self; - var opt = optimizer(self, compressor); - opt._optimized = true; - if (opt === self) return opt; - return opt.transform(compressor); - }); - } - OPT(AST_Node, function(self, compressor) { - return self; - }); - AST_Node.DEFMETHOD("equivalent_to", function(node) { - return this.print_to_string() == node.print_to_string(); - }); - function make_node(ctor, orig, props) { - if (!props) props = {}; - if (orig) { - if (!props.start) props.start = orig.start; - if (!props.end) props.end = orig.end; - } - return new ctor(props); - } - function make_node_from_constant(compressor, val, orig) { - if (val instanceof AST_Node) return val.transform(compressor); - switch (typeof val) { - case "string": - return make_node(AST_String, orig, { - value: val - }).optimize(compressor); - - case "number": - return make_node(isNaN(val) ? AST_NaN : AST_Number, orig, { - value: val - }).optimize(compressor); - - case "boolean": - return make_node(val ? AST_True : AST_False, orig).optimize(compressor); - - case "undefined": - return make_node(AST_Undefined, orig).optimize(compressor); - - default: - if (val === null) { - return make_node(AST_Null, orig).optimize(compressor); - } - if (val instanceof RegExp) { - return make_node(AST_RegExp, orig).optimize(compressor); - } - throw new Error(string_template("Can't handle constant of type: {type}", { - type: typeof val - })); - } - } - function as_statement_array(thing) { - if (thing === null) return []; - if (thing instanceof AST_BlockStatement) return thing.body; - if (thing instanceof AST_EmptyStatement) return []; - if (thing instanceof AST_Statement) return [ thing ]; - throw new Error("Can't convert thing to statement array"); - } - function is_empty(thing) { - if (thing === null) return true; - if (thing instanceof AST_EmptyStatement) return true; - if (thing instanceof AST_BlockStatement) return thing.body.length == 0; - return false; - } - function loop_body(x) { - if (x instanceof AST_Switch) return x; - if (x instanceof AST_For || x instanceof AST_ForIn || x instanceof AST_DWLoop) { - return x.body instanceof AST_BlockStatement ? x.body : x; - } - return x; - } - function tighten_body(statements, compressor) { - var CHANGED; - do { - CHANGED = false; - statements = eliminate_spurious_blocks(statements); - if (compressor.option("dead_code")) { - statements = eliminate_dead_code(statements, compressor); - } - if (compressor.option("if_return")) { - statements = handle_if_return(statements, compressor); - } - if (compressor.option("sequences")) { - statements = sequencesize(statements, compressor); - } - if (compressor.option("join_vars")) { - statements = join_consecutive_vars(statements, compressor); - } - } while (CHANGED); - return statements; - function eliminate_spurious_blocks(statements) { - var seen_dirs = []; - return statements.reduce(function(a, stat) { - if (stat instanceof AST_BlockStatement) { - CHANGED = true; - a.push.apply(a, eliminate_spurious_blocks(stat.body)); - } else if (stat instanceof AST_EmptyStatement) { - CHANGED = true; - } else if (stat instanceof AST_Directive) { - if (seen_dirs.indexOf(stat.value) < 0) { - a.push(stat); - seen_dirs.push(stat.value); - } else { - CHANGED = true; - } - } else { - a.push(stat); - } - return a; - }, []); - } - function handle_if_return(statements, compressor) { - var self = compressor.self(); - var in_lambda = self instanceof AST_Lambda; - var ret = []; - loop: for (var i = statements.length; --i >= 0; ) { - var stat = statements[i]; - switch (true) { - case in_lambda && stat instanceof AST_Return && !stat.value && ret.length == 0: - CHANGED = true; - continue loop; - - case stat instanceof AST_If: - if (stat.body instanceof AST_Return) { - if ((in_lambda && ret.length == 0 || ret[0] instanceof AST_Return && !ret[0].value) && !stat.body.value && !stat.alternative) { - CHANGED = true; - var cond = make_node(AST_SimpleStatement, stat.condition, { - body: stat.condition - }); - ret.unshift(cond); - continue loop; - } - if (ret[0] instanceof AST_Return && stat.body.value && ret[0].value && !stat.alternative) { - CHANGED = true; - stat = stat.clone(); - stat.alternative = ret[0]; - ret[0] = stat.transform(compressor); - continue loop; - } - if ((ret.length == 0 || ret[0] instanceof AST_Return) && stat.body.value && !stat.alternative && in_lambda) { - CHANGED = true; - stat = stat.clone(); - stat.alternative = ret[0] || make_node(AST_Return, stat, { - value: make_node(AST_Undefined, stat) - }); - ret[0] = stat.transform(compressor); - continue loop; - } - if (!stat.body.value && in_lambda) { - CHANGED = true; - stat = stat.clone(); - stat.condition = stat.condition.negate(compressor); - stat.body = make_node(AST_BlockStatement, stat, { - body: as_statement_array(stat.alternative).concat(ret) - }); - stat.alternative = null; - ret = [ stat.transform(compressor) ]; - continue loop; - } - if (ret.length == 1 && in_lambda && ret[0] instanceof AST_SimpleStatement && (!stat.alternative || stat.alternative instanceof AST_SimpleStatement)) { - CHANGED = true; - ret.push(make_node(AST_Return, ret[0], { - value: make_node(AST_Undefined, ret[0]) - }).transform(compressor)); - ret = as_statement_array(stat.alternative).concat(ret); - ret.unshift(stat); - continue loop; - } - } - var ab = aborts(stat.body); - var lct = ab instanceof AST_LoopControl ? compressor.loopcontrol_target(ab.label) : null; - if (ab && (ab instanceof AST_Return && !ab.value && in_lambda || ab instanceof AST_Continue && self === loop_body(lct) || ab instanceof AST_Break && lct instanceof AST_BlockStatement && self === lct)) { - if (ab.label) { - remove(ab.label.thedef.references, ab.label); - } - CHANGED = true; - var body = as_statement_array(stat.body).slice(0, -1); - stat = stat.clone(); - stat.condition = stat.condition.negate(compressor); - stat.body = make_node(AST_BlockStatement, stat, { - body: ret - }); - stat.alternative = make_node(AST_BlockStatement, stat, { - body: body - }); - ret = [ stat.transform(compressor) ]; - continue loop; - } - var ab = aborts(stat.alternative); - var lct = ab instanceof AST_LoopControl ? compressor.loopcontrol_target(ab.label) : null; - if (ab && (ab instanceof AST_Return && !ab.value && in_lambda || ab instanceof AST_Continue && self === loop_body(lct) || ab instanceof AST_Break && lct instanceof AST_BlockStatement && self === lct)) { - if (ab.label) { - remove(ab.label.thedef.references, ab.label); - } - CHANGED = true; - stat = stat.clone(); - stat.body = make_node(AST_BlockStatement, stat.body, { - body: as_statement_array(stat.body).concat(ret) - }); - stat.alternative = make_node(AST_BlockStatement, stat.alternative, { - body: as_statement_array(stat.alternative).slice(0, -1) - }); - ret = [ stat.transform(compressor) ]; - continue loop; - } - ret.unshift(stat); - break; - - default: - ret.unshift(stat); - break; - } - } - return ret; - } - function eliminate_dead_code(statements, compressor) { - var has_quit = false; - var orig = statements.length; - var self = compressor.self(); - statements = statements.reduce(function(a, stat) { - if (has_quit) { - extract_declarations_from_unreachable_code(compressor, stat, a); - } else { - if (stat instanceof AST_LoopControl) { - var lct = compressor.loopcontrol_target(stat.label); - if (stat instanceof AST_Break && lct instanceof AST_BlockStatement && loop_body(lct) === self || stat instanceof AST_Continue && loop_body(lct) === self) { - if (stat.label) { - remove(stat.label.thedef.references, stat.label); - } - } else { - a.push(stat); - } - } else { - a.push(stat); - } - if (aborts(stat)) has_quit = true; - } - return a; - }, []); - CHANGED = statements.length != orig; - return statements; - } - function sequencesize(statements, compressor) { - if (statements.length < 2) return statements; - var seq = [], ret = []; - function push_seq() { - seq = AST_Seq.from_array(seq); - if (seq) ret.push(make_node(AST_SimpleStatement, seq, { - body: seq - })); - seq = []; - } - statements.forEach(function(stat) { - if (stat instanceof AST_SimpleStatement) seq.push(stat.body); else push_seq(), ret.push(stat); - }); - push_seq(); - ret = sequencesize_2(ret, compressor); - CHANGED = ret.length != statements.length; - return ret; - } - function sequencesize_2(statements, compressor) { - function cons_seq(right) { - ret.pop(); - var left = prev.body; - if (left instanceof AST_Seq) { - left.add(right); - } else { - left = AST_Seq.cons(left, right); - } - return left.transform(compressor); - } - var ret = [], prev = null; - statements.forEach(function(stat) { - if (prev) { - if (stat instanceof AST_For) { - var opera = {}; - try { - prev.body.walk(new TreeWalker(function(node) { - if (node instanceof AST_Binary && node.operator == "in") throw opera; - })); - if (stat.init && !(stat.init instanceof AST_Definitions)) { - stat.init = cons_seq(stat.init); - } else if (!stat.init) { - stat.init = prev.body; - ret.pop(); - } - } catch (ex) { - if (ex !== opera) throw ex; - } - } else if (stat instanceof AST_If) { - stat.condition = cons_seq(stat.condition); - } else if (stat instanceof AST_With) { - stat.expression = cons_seq(stat.expression); - } else if (stat instanceof AST_Exit && stat.value) { - stat.value = cons_seq(stat.value); - } else if (stat instanceof AST_Exit) { - stat.value = cons_seq(make_node(AST_Undefined, stat)); - } else if (stat instanceof AST_Switch) { - stat.expression = cons_seq(stat.expression); - } - } - ret.push(stat); - prev = stat instanceof AST_SimpleStatement ? stat : null; - }); - return ret; - } - function join_consecutive_vars(statements, compressor) { - var prev = null; - return statements.reduce(function(a, stat) { - if (stat instanceof AST_Definitions && prev && prev.TYPE == stat.TYPE) { - prev.definitions = prev.definitions.concat(stat.definitions); - CHANGED = true; - } else if (stat instanceof AST_For && prev instanceof AST_Definitions && (!stat.init || stat.init.TYPE == prev.TYPE)) { - CHANGED = true; - a.pop(); - if (stat.init) { - stat.init.definitions = prev.definitions.concat(stat.init.definitions); - } else { - stat.init = prev; - } - a.push(stat); - prev = stat; - } else { - prev = stat; - a.push(stat); - } - return a; - }, []); - } - } - function extract_declarations_from_unreachable_code(compressor, stat, target) { - compressor.warn("Dropping unreachable code [{file}:{line},{col}]", stat.start); - stat.walk(new TreeWalker(function(node) { - if (node instanceof AST_Definitions) { - compressor.warn("Declarations in unreachable code! [{file}:{line},{col}]", node.start); - node.remove_initializers(); - target.push(node); - return true; - } - if (node instanceof AST_Defun) { - target.push(node); - return true; - } - if (node instanceof AST_Scope) { - return true; - } - })); - } - (function(def) { - var unary_bool = [ "!", "delete" ]; - var binary_bool = [ "in", "instanceof", "==", "!=", "===", "!==", "<", "<=", ">=", ">" ]; - def(AST_Node, function() { - return false; - }); - def(AST_UnaryPrefix, function() { - return member(this.operator, unary_bool); - }); - def(AST_Binary, function() { - return member(this.operator, binary_bool) || (this.operator == "&&" || this.operator == "||") && this.left.is_boolean() && this.right.is_boolean(); - }); - def(AST_Conditional, function() { - return this.consequent.is_boolean() && this.alternative.is_boolean(); - }); - def(AST_Assign, function() { - return this.operator == "=" && this.right.is_boolean(); - }); - def(AST_Seq, function() { - return this.cdr.is_boolean(); - }); - def(AST_True, function() { - return true; - }); - def(AST_False, function() { - return true; - }); - })(function(node, func) { - node.DEFMETHOD("is_boolean", func); - }); - (function(def) { - def(AST_Node, function() { - return false; - }); - def(AST_String, function() { - return true; - }); - def(AST_UnaryPrefix, function() { - return this.operator == "typeof"; - }); - def(AST_Binary, function(compressor) { - return this.operator == "+" && (this.left.is_string(compressor) || this.right.is_string(compressor)); - }); - def(AST_Assign, function(compressor) { - return (this.operator == "=" || this.operator == "+=") && this.right.is_string(compressor); - }); - def(AST_Seq, function(compressor) { - return this.cdr.is_string(compressor); - }); - def(AST_Conditional, function(compressor) { - return this.consequent.is_string(compressor) && this.alternative.is_string(compressor); - }); - def(AST_Call, function(compressor) { - return compressor.option("unsafe") && this.expression instanceof AST_SymbolRef && this.expression.name == "String" && this.expression.undeclared(); - }); - })(function(node, func) { - node.DEFMETHOD("is_string", func); - }); - function best_of(ast1, ast2) { - return ast1.print_to_string().length > ast2.print_to_string().length ? ast2 : ast1; - } - (function(def) { - AST_Node.DEFMETHOD("evaluate", function(compressor) { - if (!compressor.option("evaluate")) return [ this ]; - try { - var val = this._eval(), ast = make_node_from_constant(compressor, val, this); - return [ best_of(ast, this), val ]; - } catch (ex) { - if (ex !== def) throw ex; - return [ this ]; - } - }); - def(AST_Statement, function() { - throw new Error(string_template("Cannot evaluate a statement [{file}:{line},{col}]", this.start)); - }); - def(AST_Function, function() { - return [ this ]; - }); - function ev(node) { - return node._eval(); - } - def(AST_Node, function() { - throw def; - }); - def(AST_Constant, function() { - return this.getValue(); - }); - def(AST_UnaryPrefix, function() { - var e = this.expression; - switch (this.operator) { - case "!": - return !ev(e); - - case "typeof": - if (e instanceof AST_Function) return typeof function() {}; - e = ev(e); - if (e instanceof RegExp) throw def; - return typeof e; - - case "void": - return void ev(e); - - case "~": - return ~ev(e); - - case "-": - e = ev(e); - if (e === 0) throw def; - return -e; - - case "+": - return +ev(e); - } - throw def; - }); - def(AST_Binary, function() { - var left = this.left, right = this.right; - switch (this.operator) { - case "&&": - return ev(left) && ev(right); - - case "||": - return ev(left) || ev(right); - - case "|": - return ev(left) | ev(right); - - case "&": - return ev(left) & ev(right); - - case "^": - return ev(left) ^ ev(right); - - case "+": - return ev(left) + ev(right); - - case "*": - return ev(left) * ev(right); - - case "/": - return ev(left) / ev(right); - - case "%": - return ev(left) % ev(right); - - case "-": - return ev(left) - ev(right); - - case "<<": - return ev(left) << ev(right); - - case ">>": - return ev(left) >> ev(right); - - case ">>>": - return ev(left) >>> ev(right); - - case "==": - return ev(left) == ev(right); - - case "===": - return ev(left) === ev(right); - - case "!=": - return ev(left) != ev(right); - - case "!==": - return ev(left) !== ev(right); - - case "<": - return ev(left) < ev(right); - - case "<=": - return ev(left) <= ev(right); - - case ">": - return ev(left) > ev(right); - - case ">=": - return ev(left) >= ev(right); - - case "in": - return ev(left) in ev(right); - - case "instanceof": - return ev(left) instanceof ev(right); - } - throw def; - }); - def(AST_Conditional, function() { - return ev(this.condition) ? ev(this.consequent) : ev(this.alternative); - }); - def(AST_SymbolRef, function() { - var d = this.definition(); - if (d && d.constant && d.init) return ev(d.init); - throw def; - }); - })(function(node, func) { - node.DEFMETHOD("_eval", func); - }); - (function(def) { - function basic_negation(exp) { - return make_node(AST_UnaryPrefix, exp, { - operator: "!", - expression: exp - }); - } - def(AST_Node, function() { - return basic_negation(this); - }); - def(AST_Statement, function() { - throw new Error("Cannot negate a statement"); - }); - def(AST_Function, function() { - return basic_negation(this); - }); - def(AST_UnaryPrefix, function() { - if (this.operator == "!") return this.expression; - return basic_negation(this); - }); - def(AST_Seq, function(compressor) { - var self = this.clone(); - self.cdr = self.cdr.negate(compressor); - return self; - }); - def(AST_Conditional, function(compressor) { - var self = this.clone(); - self.consequent = self.consequent.negate(compressor); - self.alternative = self.alternative.negate(compressor); - return best_of(basic_negation(this), self); - }); - def(AST_Binary, function(compressor) { - var self = this.clone(), op = this.operator; - if (compressor.option("unsafe_comps")) { - switch (op) { - case "<=": - self.operator = ">"; - return self; - - case "<": - self.operator = ">="; - return self; - - case ">=": - self.operator = "<"; - return self; - - case ">": - self.operator = "<="; - return self; - } - } - switch (op) { - case "==": - self.operator = "!="; - return self; - - case "!=": - self.operator = "=="; - return self; - - case "===": - self.operator = "!=="; - return self; - - case "!==": - self.operator = "==="; - return self; - - case "&&": - self.operator = "||"; - self.left = self.left.negate(compressor); - self.right = self.right.negate(compressor); - return best_of(basic_negation(this), self); - - case "||": - self.operator = "&&"; - self.left = self.left.negate(compressor); - self.right = self.right.negate(compressor); - return best_of(basic_negation(this), self); - } - return basic_negation(this); - }); - })(function(node, func) { - node.DEFMETHOD("negate", function(compressor) { - return func.call(this, compressor); - }); - }); - (function(def) { - def(AST_Node, function() { - return true; - }); - def(AST_EmptyStatement, function() { - return false; - }); - def(AST_Constant, function() { - return false; - }); - def(AST_This, function() { - return false; - }); - def(AST_Block, function() { - for (var i = this.body.length; --i >= 0; ) { - if (this.body[i].has_side_effects()) return true; - } - return false; - }); - def(AST_SimpleStatement, function() { - return this.body.has_side_effects(); - }); - def(AST_Defun, function() { - return true; - }); - def(AST_Function, function() { - return false; - }); - def(AST_Binary, function() { - return this.left.has_side_effects() || this.right.has_side_effects(); - }); - def(AST_Assign, function() { - return true; - }); - def(AST_Conditional, function() { - return this.condition.has_side_effects() || this.consequent.has_side_effects() || this.alternative.has_side_effects(); - }); - def(AST_Unary, function() { - return this.operator == "delete" || this.operator == "++" || this.operator == "--" || this.expression.has_side_effects(); - }); - def(AST_SymbolRef, function() { - return false; - }); - def(AST_Object, function() { - for (var i = this.properties.length; --i >= 0; ) if (this.properties[i].has_side_effects()) return true; - return false; - }); - def(AST_ObjectProperty, function() { - return this.value.has_side_effects(); - }); - def(AST_Array, function() { - for (var i = this.elements.length; --i >= 0; ) if (this.elements[i].has_side_effects()) return true; - return false; - }); - def(AST_PropAccess, function() { - return true; - }); - def(AST_Seq, function() { - return this.car.has_side_effects() || this.cdr.has_side_effects(); - }); - })(function(node, func) { - node.DEFMETHOD("has_side_effects", func); - }); - function aborts(thing) { - return thing && thing.aborts(); - } - (function(def) { - def(AST_Statement, function() { - return null; - }); - def(AST_Jump, function() { - return this; - }); - function block_aborts() { - var n = this.body.length; - return n > 0 && aborts(this.body[n - 1]); - } - def(AST_BlockStatement, block_aborts); - def(AST_SwitchBranch, block_aborts); - def(AST_If, function() { - return this.alternative && aborts(this.body) && aborts(this.alternative); - }); - })(function(node, func) { - node.DEFMETHOD("aborts", func); - }); - OPT(AST_Directive, function(self, compressor) { - if (self.scope.has_directive(self.value) !== self.scope) { - return make_node(AST_EmptyStatement, self); - } - return self; - }); - OPT(AST_Debugger, function(self, compressor) { - if (compressor.option("drop_debugger")) return make_node(AST_EmptyStatement, self); - return self; - }); - OPT(AST_LabeledStatement, function(self, compressor) { - if (self.body instanceof AST_Break && compressor.loopcontrol_target(self.body.label) === self.body) { - return make_node(AST_EmptyStatement, self); - } - return self.label.references.length == 0 ? self.body : self; - }); - OPT(AST_Block, function(self, compressor) { - self.body = tighten_body(self.body, compressor); - return self; - }); - OPT(AST_BlockStatement, function(self, compressor) { - self.body = tighten_body(self.body, compressor); - switch (self.body.length) { - case 1: - return self.body[0]; - - case 0: - return make_node(AST_EmptyStatement, self); - } - return self; - }); - AST_Scope.DEFMETHOD("drop_unused", function(compressor) { - var self = this; - if (compressor.option("unused") && !(self instanceof AST_Toplevel) && !self.uses_eval) { - var in_use = []; - var initializations = new Dictionary(); - var scope = this; - var tw = new TreeWalker(function(node, descend) { - if (node !== self) { - if (node instanceof AST_Defun) { - initializations.add(node.name.name, node); - return true; - } - if (node instanceof AST_Definitions && scope === self) { - node.definitions.forEach(function(def) { - if (def.value) { - initializations.add(def.name.name, def.value); - if (def.value.has_side_effects()) { - def.value.walk(tw); - } - } - }); - return true; - } - if (node instanceof AST_SymbolRef) { - push_uniq(in_use, node.definition()); - return true; - } - if (node instanceof AST_Scope) { - var save_scope = scope; - scope = node; - descend(); - scope = save_scope; - return true; - } - } - }); - self.walk(tw); - for (var i = 0; i < in_use.length; ++i) { - in_use[i].orig.forEach(function(decl) { - var init = initializations.get(decl.name); - if (init) init.forEach(function(init) { - var tw = new TreeWalker(function(node) { - if (node instanceof AST_SymbolRef) { - push_uniq(in_use, node.definition()); - } - }); - init.walk(tw); - }); - }); - } - var tt = new TreeTransformer(function before(node, descend, in_list) { - if (node instanceof AST_Lambda) { - for (var a = node.argnames, i = a.length; --i >= 0; ) { - var sym = a[i]; - if (sym.unreferenced()) { - a.pop(); - compressor.warn("Dropping unused function argument {name} [{file}:{line},{col}]", { - name: sym.name, - file: sym.start.file, - line: sym.start.line, - col: sym.start.col - }); - } else break; - } - } - if (node instanceof AST_Defun && node !== self) { - if (!member(node.name.definition(), in_use)) { - compressor.warn("Dropping unused function {name} [{file}:{line},{col}]", { - name: node.name.name, - file: node.name.start.file, - line: node.name.start.line, - col: node.name.start.col - }); - return make_node(AST_EmptyStatement, node); - } - return node; - } - if (node instanceof AST_Definitions && !(tt.parent() instanceof AST_ForIn)) { - var def = node.definitions.filter(function(def) { - if (member(def.name.definition(), in_use)) return true; - var w = { - name: def.name.name, - file: def.name.start.file, - line: def.name.start.line, - col: def.name.start.col - }; - if (def.value && def.value.has_side_effects()) { - def._unused_side_effects = true; - compressor.warn("Side effects in initialization of unused variable {name} [{file}:{line},{col}]", w); - return true; - } - compressor.warn("Dropping unused variable {name} [{file}:{line},{col}]", w); - return false; - }); - def = mergeSort(def, function(a, b) { - if (!a.value && b.value) return -1; - if (!b.value && a.value) return 1; - return 0; - }); - var side_effects = []; - for (var i = 0; i < def.length; ) { - var x = def[i]; - if (x._unused_side_effects) { - side_effects.push(x.value); - def.splice(i, 1); - } else { - if (side_effects.length > 0) { - side_effects.push(x.value); - x.value = AST_Seq.from_array(side_effects); - side_effects = []; - } - ++i; - } - } - if (side_effects.length > 0) { - side_effects = make_node(AST_BlockStatement, node, { - body: [ make_node(AST_SimpleStatement, node, { - body: AST_Seq.from_array(side_effects) - }) ] - }); - } else { - side_effects = null; - } - if (def.length == 0 && !side_effects) { - return make_node(AST_EmptyStatement, node); - } - if (def.length == 0) { - return side_effects; - } - node.definitions = def; - if (side_effects) { - side_effects.body.unshift(node); - node = side_effects; - } - return node; - } - if (node instanceof AST_For && node.init instanceof AST_BlockStatement) { - descend(node, this); - var body = node.init.body.slice(0, -1); - node.init = node.init.body.slice(-1)[0].body; - body.push(node); - return in_list ? MAP.splice(body) : make_node(AST_BlockStatement, node, { - body: body - }); - } - if (node instanceof AST_Scope && node !== self) return node; - }); - self.transform(tt); - } - }); - AST_Scope.DEFMETHOD("hoist_declarations", function(compressor) { - var hoist_funs = compressor.option("hoist_funs"); - var hoist_vars = compressor.option("hoist_vars"); - var self = this; - if (hoist_funs || hoist_vars) { - var dirs = []; - var hoisted = []; - var vars = new Dictionary(), vars_found = 0, var_decl = 0; - self.walk(new TreeWalker(function(node) { - if (node instanceof AST_Scope && node !== self) return true; - if (node instanceof AST_Var) { - ++var_decl; - return true; - } - })); - hoist_vars = hoist_vars && var_decl > 1; - var tt = new TreeTransformer(function before(node) { - if (node !== self) { - if (node instanceof AST_Directive) { - dirs.push(node); - return make_node(AST_EmptyStatement, node); - } - if (node instanceof AST_Defun && hoist_funs) { - hoisted.push(node); - return make_node(AST_EmptyStatement, node); - } - if (node instanceof AST_Var && hoist_vars) { - node.definitions.forEach(function(def) { - vars.set(def.name.name, def); - ++vars_found; - }); - var seq = node.to_assignments(); - var p = tt.parent(); - if (p instanceof AST_ForIn && p.init === node) { - if (seq == null) return node.definitions[0].name; - return seq; - } - if (p instanceof AST_For && p.init === node) { - return seq; - } - if (!seq) return make_node(AST_EmptyStatement, node); - return make_node(AST_SimpleStatement, node, { - body: seq - }); - } - if (node instanceof AST_Scope) return node; - } - }); - self = self.transform(tt); - if (vars_found > 0) { - var defs = []; - vars.each(function(def, name) { - if (self instanceof AST_Lambda && find_if(function(x) { - return x.name == def.name.name; - }, self.argnames)) { - vars.del(name); - } else { - def = def.clone(); - def.value = null; - defs.push(def); - vars.set(name, def); - } - }); - if (defs.length > 0) { - for (var i = 0; i < self.body.length; ) { - if (self.body[i] instanceof AST_SimpleStatement) { - var expr = self.body[i].body, sym, assign; - if (expr instanceof AST_Assign && expr.operator == "=" && (sym = expr.left) instanceof AST_Symbol && vars.has(sym.name)) { - var def = vars.get(sym.name); - if (def.value) break; - def.value = expr.right; - remove(defs, def); - defs.push(def); - self.body.splice(i, 1); - continue; - } - if (expr instanceof AST_Seq && (assign = expr.car) instanceof AST_Assign && assign.operator == "=" && (sym = assign.left) instanceof AST_Symbol && vars.has(sym.name)) { - var def = vars.get(sym.name); - if (def.value) break; - def.value = assign.right; - remove(defs, def); - defs.push(def); - self.body[i].body = expr.cdr; - continue; - } - } - if (self.body[i] instanceof AST_EmptyStatement) { - self.body.splice(i, 1); - continue; - } - if (self.body[i] instanceof AST_BlockStatement) { - var tmp = [ i, 1 ].concat(self.body[i].body); - self.body.splice.apply(self.body, tmp); - continue; - } - break; - } - defs = make_node(AST_Var, self, { - definitions: defs - }); - hoisted.push(defs); - } - } - self.body = dirs.concat(hoisted, self.body); - } - return self; - }); - OPT(AST_SimpleStatement, function(self, compressor) { - if (compressor.option("side_effects")) { - if (!self.body.has_side_effects()) { - compressor.warn("Dropping side-effect-free statement [{file}:{line},{col}]", self.start); - return make_node(AST_EmptyStatement, self); - } - } - return self; - }); - OPT(AST_DWLoop, function(self, compressor) { - var cond = self.condition.evaluate(compressor); - self.condition = cond[0]; - if (!compressor.option("loops")) return self; - if (cond.length > 1) { - if (cond[1]) { - return make_node(AST_For, self, { - body: self.body - }); - } else if (self instanceof AST_While) { - if (compressor.option("dead_code")) { - var a = []; - extract_declarations_from_unreachable_code(compressor, self.body, a); - return make_node(AST_BlockStatement, self, { - body: a - }); - } - } - } - return self; - }); - function if_break_in_loop(self, compressor) { - function drop_it(rest) { - rest = as_statement_array(rest); - if (self.body instanceof AST_BlockStatement) { - self.body = self.body.clone(); - self.body.body = rest.concat(self.body.body.slice(1)); - self.body = self.body.transform(compressor); - } else { - self.body = make_node(AST_BlockStatement, self.body, { - body: rest - }).transform(compressor); - } - if_break_in_loop(self, compressor); - } - var first = self.body instanceof AST_BlockStatement ? self.body.body[0] : self.body; - if (first instanceof AST_If) { - if (first.body instanceof AST_Break && compressor.loopcontrol_target(first.body.label) === self) { - if (self.condition) { - self.condition = make_node(AST_Binary, self.condition, { - left: self.condition, - operator: "&&", - right: first.condition.negate(compressor) - }); - } else { - self.condition = first.condition.negate(compressor); - } - drop_it(first.alternative); - } else if (first.alternative instanceof AST_Break && compressor.loopcontrol_target(first.alternative.label) === self) { - if (self.condition) { - self.condition = make_node(AST_Binary, self.condition, { - left: self.condition, - operator: "&&", - right: first.condition - }); - } else { - self.condition = first.condition; - } - drop_it(first.body); - } - } - } - OPT(AST_While, function(self, compressor) { - if (!compressor.option("loops")) return self; - self = AST_DWLoop.prototype.optimize.call(self, compressor); - if (self instanceof AST_While) { - if_break_in_loop(self, compressor); - self = make_node(AST_For, self, self).transform(compressor); - } - return self; - }); - OPT(AST_For, function(self, compressor) { - var cond = self.condition; - if (cond) { - cond = cond.evaluate(compressor); - self.condition = cond[0]; - } - if (!compressor.option("loops")) return self; - if (cond) { - if (cond.length > 1 && !cond[1]) { - if (compressor.option("dead_code")) { - var a = []; - if (self.init instanceof AST_Statement) { - a.push(self.init); - } else if (self.init) { - a.push(make_node(AST_SimpleStatement, self.init, { - body: self.init - })); - } - extract_declarations_from_unreachable_code(compressor, self.body, a); - return make_node(AST_BlockStatement, self, { - body: a - }); - } - } - } - if_break_in_loop(self, compressor); - return self; - }); - OPT(AST_If, function(self, compressor) { - if (!compressor.option("conditionals")) return self; - var cond = self.condition.evaluate(compressor); - self.condition = cond[0]; - if (cond.length > 1) { - if (cond[1]) { - compressor.warn("Condition always true [{file}:{line},{col}]", self.condition.start); - if (compressor.option("dead_code")) { - var a = []; - if (self.alternative) { - extract_declarations_from_unreachable_code(compressor, self.alternative, a); - } - a.push(self.body); - return make_node(AST_BlockStatement, self, { - body: a - }).transform(compressor); - } - } else { - compressor.warn("Condition always false [{file}:{line},{col}]", self.condition.start); - if (compressor.option("dead_code")) { - var a = []; - extract_declarations_from_unreachable_code(compressor, self.body, a); - if (self.alternative) a.push(self.alternative); - return make_node(AST_BlockStatement, self, { - body: a - }).transform(compressor); - } - } - } - if (is_empty(self.alternative)) self.alternative = null; - var negated = self.condition.negate(compressor); - var negated_is_best = best_of(self.condition, negated) === negated; - if (self.alternative && negated_is_best) { - negated_is_best = false; - self.condition = negated; - var tmp = self.body; - self.body = self.alternative || make_node(AST_EmptyStatement); - self.alternative = tmp; - } - if (is_empty(self.body) && is_empty(self.alternative)) { - return make_node(AST_SimpleStatement, self.condition, { - body: self.condition - }).transform(compressor); - } - if (self.body instanceof AST_SimpleStatement && self.alternative instanceof AST_SimpleStatement) { - return make_node(AST_SimpleStatement, self, { - body: make_node(AST_Conditional, self, { - condition: self.condition, - consequent: self.body.body, - alternative: self.alternative.body - }) - }).transform(compressor); - } - if (is_empty(self.alternative) && self.body instanceof AST_SimpleStatement) { - if (negated_is_best) return make_node(AST_SimpleStatement, self, { - body: make_node(AST_Binary, self, { - operator: "||", - left: negated, - right: self.body.body - }) - }).transform(compressor); - return make_node(AST_SimpleStatement, self, { - body: make_node(AST_Binary, self, { - operator: "&&", - left: self.condition, - right: self.body.body - }) - }).transform(compressor); - } - if (self.body instanceof AST_EmptyStatement && self.alternative && self.alternative instanceof AST_SimpleStatement) { - return make_node(AST_SimpleStatement, self, { - body: make_node(AST_Binary, self, { - operator: "||", - left: self.condition, - right: self.alternative.body - }) - }).transform(compressor); - } - if (self.body instanceof AST_Exit && self.alternative instanceof AST_Exit && self.body.TYPE == self.alternative.TYPE) { - return make_node(self.body.CTOR, self, { - value: make_node(AST_Conditional, self, { - condition: self.condition, - consequent: self.body.value || make_node(AST_Undefined, self.body).optimize(compressor), - alternative: self.alternative.value || make_node(AST_Undefined, self.alternative).optimize(compressor) - }) - }).transform(compressor); - } - if (self.body instanceof AST_If && !self.body.alternative && !self.alternative) { - self.condition = make_node(AST_Binary, self.condition, { - operator: "&&", - left: self.condition, - right: self.body.condition - }).transform(compressor); - self.body = self.body.body; - } - if (aborts(self.body)) { - if (self.alternative) { - var alt = self.alternative; - self.alternative = null; - return make_node(AST_BlockStatement, self, { - body: [ self, alt ] - }).transform(compressor); - } - } - if (aborts(self.alternative)) { - var body = self.body; - self.body = self.alternative; - self.condition = negated_is_best ? negated : self.condition.negate(compressor); - self.alternative = null; - return make_node(AST_BlockStatement, self, { - body: [ self, body ] - }).transform(compressor); - } - return self; - }); - OPT(AST_Switch, function(self, compressor) { - if (self.body.length == 0 && compressor.option("conditionals")) { - return make_node(AST_SimpleStatement, self, { - body: self.expression - }).transform(compressor); - } - for (;;) { - var last_branch = self.body[self.body.length - 1]; - if (last_branch) { - var stat = last_branch.body[last_branch.body.length - 1]; - if (stat instanceof AST_Break && loop_body(compressor.loopcontrol_target(stat.label)) === self) last_branch.body.pop(); - if (last_branch instanceof AST_Default && last_branch.body.length == 0) { - self.body.pop(); - continue; - } - } - break; - } - var exp = self.expression.evaluate(compressor); - out: if (exp.length == 2) try { - self.expression = exp[0]; - if (!compressor.option("dead_code")) break out; - var value = exp[1]; - var in_if = false; - var in_block = false; - var started = false; - var stopped = false; - var ruined = false; - var tt = new TreeTransformer(function(node, descend, in_list) { - if (node instanceof AST_Lambda || node instanceof AST_SimpleStatement) { - return node; - } else if (node instanceof AST_Switch && node === self) { - node = node.clone(); - descend(node, this); - return ruined ? node : make_node(AST_BlockStatement, node, { - body: node.body.reduce(function(a, branch) { - return a.concat(branch.body); - }, []) - }).transform(compressor); - } else if (node instanceof AST_If || node instanceof AST_Try) { - var save = in_if; - in_if = !in_block; - descend(node, this); - in_if = save; - return node; - } else if (node instanceof AST_StatementWithBody || node instanceof AST_Switch) { - var save = in_block; - in_block = true; - descend(node, this); - in_block = save; - return node; - } else if (node instanceof AST_Break && this.loopcontrol_target(node.label) === self) { - if (in_if) { - ruined = true; - return node; - } - if (in_block) return node; - stopped = true; - return in_list ? MAP.skip : make_node(AST_EmptyStatement, node); - } else if (node instanceof AST_SwitchBranch && this.parent() === self) { - if (stopped) return MAP.skip; - if (node instanceof AST_Case) { - var exp = node.expression.evaluate(compressor); - if (exp.length < 2) { - throw self; - } - if (exp[1] === value || started) { - started = true; - if (aborts(node)) stopped = true; - descend(node, this); - return node; - } - return MAP.skip; - } - descend(node, this); - return node; - } - }); - tt.stack = compressor.stack.slice(); - self = self.transform(tt); - } catch (ex) { - if (ex !== self) throw ex; - } - return self; - }); - OPT(AST_Case, function(self, compressor) { - self.body = tighten_body(self.body, compressor); - return self; - }); - OPT(AST_Try, function(self, compressor) { - self.body = tighten_body(self.body, compressor); - return self; - }); - AST_Definitions.DEFMETHOD("remove_initializers", function() { - this.definitions.forEach(function(def) { - def.value = null; - }); - }); - AST_Definitions.DEFMETHOD("to_assignments", function() { - var assignments = this.definitions.reduce(function(a, def) { - if (def.value) { - var name = make_node(AST_SymbolRef, def.name, def.name); - a.push(make_node(AST_Assign, def, { - operator: "=", - left: name, - right: def.value - })); - } - return a; - }, []); - if (assignments.length == 0) return null; - return AST_Seq.from_array(assignments); - }); - OPT(AST_Definitions, function(self, compressor) { - if (self.definitions.length == 0) return make_node(AST_EmptyStatement, self); - return self; - }); - OPT(AST_Function, function(self, compressor) { - self = AST_Lambda.prototype.optimize.call(self, compressor); - if (compressor.option("unused")) { - if (self.name && self.name.unreferenced()) { - self.name = null; - } - } - return self; - }); - OPT(AST_Call, function(self, compressor) { - if (compressor.option("unsafe")) { - var exp = self.expression; - if (exp instanceof AST_SymbolRef && exp.undeclared()) { - switch (exp.name) { - case "Array": - if (self.args.length != 1) { - return make_node(AST_Array, self, { - elements: self.args - }); - } - break; - - case "Object": - if (self.args.length == 0) { - return make_node(AST_Object, self, { - properties: [] - }); - } - break; - - case "String": - if (self.args.length == 0) return make_node(AST_String, self, { - value: "" - }); - return make_node(AST_Binary, self, { - left: self.args[0], - operator: "+", - right: make_node(AST_String, self, { - value: "" - }) - }); - - case "Function": - if (all(self.args, function(x) { - return x instanceof AST_String; - })) { - try { - var code = "(function(" + self.args.slice(0, -1).map(function(arg) { - return arg.value; - }).join(",") + "){" + self.args[self.args.length - 1].value + "})()"; - var ast = parse(code); - ast.figure_out_scope(); - var comp = new Compressor(compressor.options); - ast = ast.transform(comp); - ast.figure_out_scope(); - ast.mangle_names(); - var fun = ast.body[0].body.expression; - var args = fun.argnames.map(function(arg, i) { - return make_node(AST_String, self.args[i], { - value: arg.print_to_string() - }); - }); - var code = OutputStream(); - AST_BlockStatement.prototype._codegen.call(fun, fun, code); - code = code.toString().replace(/^\{|\}$/g, ""); - args.push(make_node(AST_String, self.args[self.args.length - 1], { - value: code - })); - self.args = args; - return self; - } catch (ex) { - if (ex instanceof JS_Parse_Error) { - compressor.warn("Error parsing code passed to new Function [{file}:{line},{col}]", self.args[self.args.length - 1].start); - compressor.warn(ex.toString()); - } else { - console.log(ex); - } - } - } - break; - } - } else if (exp instanceof AST_Dot && exp.property == "toString" && self.args.length == 0) { - return make_node(AST_Binary, self, { - left: make_node(AST_String, self, { - value: "" - }), - operator: "+", - right: exp.expression - }).transform(compressor); - } - } - if (compressor.option("side_effects")) { - if (self.expression instanceof AST_Function && self.args.length == 0 && !AST_Block.prototype.has_side_effects.call(self.expression)) { - return make_node(AST_Undefined, self).transform(compressor); - } - } - return self; - }); - OPT(AST_New, function(self, compressor) { - if (compressor.option("unsafe")) { - var exp = self.expression; - if (exp instanceof AST_SymbolRef && exp.undeclared()) { - switch (exp.name) { - case "Object": - case "RegExp": - case "Function": - case "Error": - case "Array": - return make_node(AST_Call, self, self).transform(compressor); - } - } - } - return self; - }); - OPT(AST_Seq, function(self, compressor) { - if (!compressor.option("side_effects")) return self; - if (!self.car.has_side_effects()) { - var p; - if (!(self.cdr instanceof AST_SymbolRef && self.cdr.name == "eval" && self.cdr.undeclared() && (p = compressor.parent()) instanceof AST_Call && p.expression === self)) { - return self.cdr; - } - } - if (compressor.option("cascade")) { - if (self.car instanceof AST_Assign && !self.car.left.has_side_effects() && self.car.left.equivalent_to(self.cdr)) { - return self.car; - } - if (!self.car.has_side_effects() && !self.cdr.has_side_effects() && self.car.equivalent_to(self.cdr)) { - return self.car; - } - } - return self; - }); - AST_Unary.DEFMETHOD("lift_sequences", function(compressor) { - if (compressor.option("sequences")) { - if (this.expression instanceof AST_Seq) { - var seq = this.expression; - var x = seq.to_array(); - this.expression = x.pop(); - x.push(this); - seq = AST_Seq.from_array(x).transform(compressor); - return seq; - } - } - return this; - }); - OPT(AST_UnaryPostfix, function(self, compressor) { - return self.lift_sequences(compressor); - }); - OPT(AST_UnaryPrefix, function(self, compressor) { - self = self.lift_sequences(compressor); - var e = self.expression; - if (compressor.option("booleans") && compressor.in_boolean_context()) { - switch (self.operator) { - case "!": - if (e instanceof AST_UnaryPrefix && e.operator == "!") { - return e.expression; - } - break; - - case "typeof": - compressor.warn("Boolean expression always true [{file}:{line},{col}]", self.start); - return make_node(AST_True, self); - } - if (e instanceof AST_Binary && self.operator == "!") { - self = best_of(self, e.negate(compressor)); - } - } - return self.evaluate(compressor)[0]; - }); - AST_Binary.DEFMETHOD("lift_sequences", function(compressor) { - if (compressor.option("sequences")) { - if (this.left instanceof AST_Seq) { - var seq = this.left; - var x = seq.to_array(); - this.left = x.pop(); - x.push(this); - seq = AST_Seq.from_array(x).transform(compressor); - return seq; - } - if (this.right instanceof AST_Seq && !(this.operator == "||" || this.operator == "&&") && !this.left.has_side_effects()) { - var seq = this.right; - var x = seq.to_array(); - this.right = x.pop(); - x.push(this); - seq = AST_Seq.from_array(x).transform(compressor); - return seq; - } - } - return this; - }); - var commutativeOperators = makePredicate("== === != !== * & | ^"); - OPT(AST_Binary, function(self, compressor) { - function reverse(op, force) { - if (force || !(self.left.has_side_effects() || self.right.has_side_effects())) { - if (op) self.operator = op; - var tmp = self.left; - self.left = self.right; - self.right = tmp; - } - } - if (commutativeOperators(self.operator)) { - if (self.right instanceof AST_Constant && !(self.left instanceof AST_Constant)) { - reverse(null, true); - } - } - self = self.lift_sequences(compressor); - if (compressor.option("comparisons")) switch (self.operator) { - case "===": - case "!==": - if (self.left.is_string(compressor) && self.right.is_string(compressor) || self.left.is_boolean() && self.right.is_boolean()) { - self.operator = self.operator.substr(0, 2); - } - - case "==": - case "!=": - if (self.left instanceof AST_String && self.left.value == "undefined" && self.right instanceof AST_UnaryPrefix && self.right.operator == "typeof" && compressor.option("unsafe")) { - if (!(self.right.expression instanceof AST_SymbolRef) || !self.right.expression.undeclared()) { - self.right = self.right.expression; - self.left = make_node(AST_Undefined, self.left).optimize(compressor); - if (self.operator.length == 2) self.operator += "="; - } - } - break; - } - if (compressor.option("booleans") && compressor.in_boolean_context()) switch (self.operator) { - case "&&": - var ll = self.left.evaluate(compressor); - var rr = self.right.evaluate(compressor); - if (ll.length > 1 && !ll[1] || rr.length > 1 && !rr[1]) { - compressor.warn("Boolean && always false [{file}:{line},{col}]", self.start); - return make_node(AST_False, self); - } - if (ll.length > 1 && ll[1]) { - return rr[0]; - } - if (rr.length > 1 && rr[1]) { - return ll[0]; - } - break; - - case "||": - var ll = self.left.evaluate(compressor); - var rr = self.right.evaluate(compressor); - if (ll.length > 1 && ll[1] || rr.length > 1 && rr[1]) { - compressor.warn("Boolean || always true [{file}:{line},{col}]", self.start); - return make_node(AST_True, self); - } - if (ll.length > 1 && !ll[1]) { - return rr[0]; - } - if (rr.length > 1 && !rr[1]) { - return ll[0]; - } - break; - - case "+": - var ll = self.left.evaluate(compressor); - var rr = self.right.evaluate(compressor); - if (ll.length > 1 && ll[0] instanceof AST_String && ll[1] || rr.length > 1 && rr[0] instanceof AST_String && rr[1]) { - compressor.warn("+ in boolean context always true [{file}:{line},{col}]", self.start); - return make_node(AST_True, self); - } - break; - } - var exp = self.evaluate(compressor); - if (exp.length > 1) { - if (best_of(exp[0], self) !== self) return exp[0]; - } - if (compressor.option("comparisons")) { - if (!(compressor.parent() instanceof AST_Binary) || compressor.parent() instanceof AST_Assign) { - var negated = make_node(AST_UnaryPrefix, self, { - operator: "!", - expression: self.negate(compressor) - }); - self = best_of(self, negated); - } - switch (self.operator) { - case "<": - reverse(">"); - break; - - case "<=": - reverse(">="); - break; - } - } - if (self.operator == "+" && self.right instanceof AST_String && self.right.getValue() === "" && self.left instanceof AST_Binary && self.left.operator == "+" && self.left.is_string(compressor)) { - return self.left; - } - return self; - }); - OPT(AST_SymbolRef, function(self, compressor) { - if (self.undeclared()) { - var defines = compressor.option("global_defs"); - if (defines && defines.hasOwnProperty(self.name)) { - return make_node_from_constant(compressor, defines[self.name], self); - } - switch (self.name) { - case "undefined": - return make_node(AST_Undefined, self); - - case "NaN": - return make_node(AST_NaN, self); - - case "Infinity": - return make_node(AST_Infinity, self); - } - } - return self; - }); - OPT(AST_Undefined, function(self, compressor) { - if (compressor.option("unsafe")) { - var scope = compressor.find_parent(AST_Scope); - var undef = scope.find_variable("undefined"); - if (undef) { - var ref = make_node(AST_SymbolRef, self, { - name: "undefined", - scope: scope, - thedef: undef - }); - ref.reference(); - return ref; - } - } - return self; - }); - var ASSIGN_OPS = [ "+", "-", "/", "*", "%", ">>", "<<", ">>>", "|", "^", "&" ]; - OPT(AST_Assign, function(self, compressor) { - self = self.lift_sequences(compressor); - if (self.operator == "=" && self.left instanceof AST_SymbolRef && self.right instanceof AST_Binary && self.right.left instanceof AST_SymbolRef && self.right.left.name == self.left.name && member(self.right.operator, ASSIGN_OPS)) { - self.operator = self.right.operator + "="; - self.right = self.right.right; - } - return self; - }); - OPT(AST_Conditional, function(self, compressor) { - if (!compressor.option("conditionals")) return self; - if (self.condition instanceof AST_Seq) { - var car = self.condition.car; - self.condition = self.condition.cdr; - return AST_Seq.cons(car, self); - } - var cond = self.condition.evaluate(compressor); - if (cond.length > 1) { - if (cond[1]) { - compressor.warn("Condition always true [{file}:{line},{col}]", self.start); - return self.consequent; - } else { - compressor.warn("Condition always false [{file}:{line},{col}]", self.start); - return self.alternative; - } - } - var negated = cond[0].negate(compressor); - if (best_of(cond[0], negated) === negated) { - self = make_node(AST_Conditional, self, { - condition: negated, - consequent: self.alternative, - alternative: self.consequent - }); - } - var consequent = self.consequent; - var alternative = self.alternative; - if (consequent instanceof AST_Assign && alternative instanceof AST_Assign && consequent.operator == alternative.operator && consequent.left.equivalent_to(alternative.left)) { - self = make_node(AST_Assign, self, { - operator: consequent.operator, - left: consequent.left, - right: make_node(AST_Conditional, self, { - condition: self.condition, - consequent: consequent.right, - alternative: alternative.right - }) - }); - } - return self; - }); - OPT(AST_Boolean, function(self, compressor) { - if (compressor.option("booleans")) { - var p = compressor.parent(); - if (p instanceof AST_Binary && (p.operator == "==" || p.operator == "!=")) { - compressor.warn("Non-strict equality against boolean: {operator} {value} [{file}:{line},{col}]", { - operator: p.operator, - value: self.value, - file: p.start.file, - line: p.start.line, - col: p.start.col - }); - return make_node(AST_Number, self, { - value: +self.value - }); - } - return make_node(AST_UnaryPrefix, self, { - operator: "!", - expression: make_node(AST_Number, self, { - value: 1 - self.value - }) - }); - } - return self; - }); - OPT(AST_Sub, function(self, compressor) { - var prop = self.property; - if (prop instanceof AST_String && compressor.option("properties")) { - prop = prop.getValue(); - if (compressor.option("screw_ie8") && RESERVED_WORDS(prop) || !RESERVED_WORDS(prop) && is_identifier_string(prop)) { - return make_node(AST_Dot, self, { - expression: self.expression, - property: prop - }); - } - } - return self; - }); - function literals_in_boolean_context(self, compressor) { - if (compressor.option("booleans") && compressor.in_boolean_context()) { - return make_node(AST_True, self); - } - return self; - } - OPT(AST_Array, literals_in_boolean_context); - OPT(AST_Object, literals_in_boolean_context); - OPT(AST_RegExp, literals_in_boolean_context); - })(); - "use strict"; - function SourceMap(options) { - options = defaults(options, { - file: null, - root: null, - orig: null - }); - var generator = new MOZ_SourceMap.SourceMapGenerator({ - file: options.file, - sourceRoot: options.root - }); - var orig_map = options.orig && new MOZ_SourceMap.SourceMapConsumer(options.orig); - function add(source, gen_line, gen_col, orig_line, orig_col, name) { - if (orig_map) { - var info = orig_map.originalPositionFor({ - line: orig_line, - column: orig_col - }); - source = info.source; - orig_line = info.line; - orig_col = info.column; - name = info.name; - } - generator.addMapping({ - generated: { - line: gen_line, - column: gen_col - }, - original: { - line: orig_line, - column: orig_col - }, - source: source, - name: name - }); - } - return { - add: add, - get: function() { - return generator; - }, - toString: function() { - return generator.toString(); - } - }; - } - "use strict"; - (function() { - var MOZ_TO_ME = { - TryStatement: function(M) { - return new AST_Try({ - start: my_start_token(M), - end: my_end_token(M), - body: from_moz(M.block).body, - bcatch: from_moz(M.handlers[0]), - bfinally: M.finalizer ? new AST_Finally(from_moz(M.finalizer)) : null - }); - }, - CatchClause: function(M) { - return new AST_Catch({ - start: my_start_token(M), - end: my_end_token(M), - argname: from_moz(M.param), - body: from_moz(M.body).body - }); - }, - ObjectExpression: function(M) { - return new AST_Object({ - start: my_start_token(M), - end: my_end_token(M), - properties: M.properties.map(function(prop) { - var key = prop.key; - var name = key.type == "Identifier" ? key.name : key.value; - var args = { - start: my_start_token(key), - end: my_end_token(prop.value), - key: name, - value: from_moz(prop.value) - }; - switch (prop.kind) { - case "init": - return new AST_ObjectKeyVal(args); - - case "set": - args.value.name = from_moz(key); - return new AST_ObjectSetter(args); - - case "get": - args.value.name = from_moz(key); - return new AST_ObjectGetter(args); - } - }) - }); - }, - SequenceExpression: function(M) { - return AST_Seq.from_array(M.expressions.map(from_moz)); - }, - MemberExpression: function(M) { - return new (M.computed ? AST_Sub : AST_Dot)({ - start: my_start_token(M), - end: my_end_token(M), - property: M.computed ? from_moz(M.property) : M.property.name, - expression: from_moz(M.object) - }); - }, - SwitchCase: function(M) { - return new (M.test ? AST_Case : AST_Default)({ - start: my_start_token(M), - end: my_end_token(M), - expression: from_moz(M.test), - body: M.consequent.map(from_moz) - }); - }, - Literal: function(M) { - var val = M.value, args = { - start: my_start_token(M), - end: my_end_token(M) - }; - if (val === null) return new AST_Null(args); - switch (typeof val) { - case "string": - args.value = val; - return new AST_String(args); - - case "number": - args.value = val; - return new AST_Number(args); - - case "boolean": - return new (val ? AST_True : AST_False)(args); - - default: - args.value = val; - return new AST_RegExp(args); - } - }, - UnaryExpression: From_Moz_Unary, - UpdateExpression: From_Moz_Unary, - Identifier: function(M) { - var p = FROM_MOZ_STACK[FROM_MOZ_STACK.length - 2]; - return new (M.name == "this" ? AST_This : p.type == "LabeledStatement" ? AST_Label : p.type == "VariableDeclarator" && p.id === M ? p.kind == "const" ? AST_SymbolConst : AST_SymbolVar : p.type == "FunctionExpression" ? p.id === M ? AST_SymbolLambda : AST_SymbolFunarg : p.type == "FunctionDeclaration" ? p.id === M ? AST_SymbolDefun : AST_SymbolFunarg : p.type == "CatchClause" ? AST_SymbolCatch : p.type == "BreakStatement" || p.type == "ContinueStatement" ? AST_LabelRef : AST_SymbolRef)({ - start: my_start_token(M), - end: my_end_token(M), - name: M.name - }); - } - }; - function From_Moz_Unary(M) { - var prefix = "prefix" in M ? M.prefix : M.type == "UnaryExpression" ? true : false; - return new (prefix ? AST_UnaryPrefix : AST_UnaryPostfix)({ - start: my_start_token(M), - end: my_end_token(M), - operator: M.operator, - expression: from_moz(M.argument) - }); - } - var ME_TO_MOZ = {}; - map("Node", AST_Node); - map("Program", AST_Toplevel, "body@body"); - map("Function", AST_Function, "id>name, params@argnames, body%body"); - map("EmptyStatement", AST_EmptyStatement); - map("BlockStatement", AST_BlockStatement, "body@body"); - map("ExpressionStatement", AST_SimpleStatement, "expression>body"); - map("IfStatement", AST_If, "test>condition, consequent>body, alternate>alternative"); - map("LabeledStatement", AST_LabeledStatement, "label>label, body>body"); - map("BreakStatement", AST_Break, "label>label"); - map("ContinueStatement", AST_Continue, "label>label"); - map("WithStatement", AST_With, "object>expression, body>body"); - map("SwitchStatement", AST_Switch, "discriminant>expression, cases@body"); - map("ReturnStatement", AST_Return, "argument>value"); - map("ThrowStatement", AST_Throw, "argument>value"); - map("WhileStatement", AST_While, "test>condition, body>body"); - map("DoWhileStatement", AST_Do, "test>condition, body>body"); - map("ForStatement", AST_For, "init>init, test>condition, update>step, body>body"); - map("ForInStatement", AST_ForIn, "left>init, right>object, body>body"); - map("DebuggerStatement", AST_Debugger); - map("FunctionDeclaration", AST_Defun, "id>name, params@argnames, body%body"); - map("VariableDeclaration", AST_Var, "declarations@definitions"); - map("VariableDeclarator", AST_VarDef, "id>name, init>value"); - map("ThisExpression", AST_This); - map("ArrayExpression", AST_Array, "elements@elements"); - map("FunctionExpression", AST_Function, "id>name, params@argnames, body%body"); - map("BinaryExpression", AST_Binary, "operator=operator, left>left, right>right"); - map("AssignmentExpression", AST_Assign, "operator=operator, left>left, right>right"); - map("LogicalExpression", AST_Binary, "operator=operator, left>left, right>right"); - map("ConditionalExpression", AST_Conditional, "test>condition, consequent>consequent, alternate>alternative"); - map("NewExpression", AST_New, "callee>expression, arguments@args"); - map("CallExpression", AST_Call, "callee>expression, arguments@args"); - function my_start_token(moznode) { - return new AST_Token({ - file: moznode.loc && moznode.loc.source, - line: moznode.loc && moznode.loc.start.line, - col: moznode.loc && moznode.loc.start.column, - pos: moznode.start, - endpos: moznode.start - }); - } - function my_end_token(moznode) { - return new AST_Token({ - file: moznode.loc && moznode.loc.source, - line: moznode.loc && moznode.loc.end.line, - col: moznode.loc && moznode.loc.end.column, - pos: moznode.end, - endpos: moznode.end - }); - } - function map(moztype, mytype, propmap) { - var moz_to_me = "function From_Moz_" + moztype + "(M){\n"; - moz_to_me += "return new mytype({\n" + "start: my_start_token(M),\n" + "end: my_end_token(M)"; - if (propmap) propmap.split(/\s*,\s*/).forEach(function(prop) { - var m = /([a-z0-9$_]+)(=|@|>|%)([a-z0-9$_]+)/i.exec(prop); - if (!m) throw new Error("Can't understand property map: " + prop); - var moz = "M." + m[1], how = m[2], my = m[3]; - moz_to_me += ",\n" + my + ": "; - if (how == "@") { - moz_to_me += moz + ".map(from_moz)"; - } else if (how == ">") { - moz_to_me += "from_moz(" + moz + ")"; - } else if (how == "=") { - moz_to_me += moz; - } else if (how == "%") { - moz_to_me += "from_moz(" + moz + ").body"; - } else throw new Error("Can't understand operator in propmap: " + prop); - }); - moz_to_me += "\n})}"; - moz_to_me = new Function("mytype", "my_start_token", "my_end_token", "from_moz", "return(" + moz_to_me + ")")(mytype, my_start_token, my_end_token, from_moz); - return MOZ_TO_ME[moztype] = moz_to_me; - } - var FROM_MOZ_STACK = null; - function from_moz(node) { - FROM_MOZ_STACK.push(node); - var ret = node != null ? MOZ_TO_ME[node.type](node) : null; - FROM_MOZ_STACK.pop(); - return ret; - } - AST_Node.from_mozilla_ast = function(node) { - var save_stack = FROM_MOZ_STACK; - FROM_MOZ_STACK = []; - var ast = from_moz(node); - FROM_MOZ_STACK = save_stack; - return ast; - }; - })(); - exports["array_to_hash"] = array_to_hash; - exports["slice"] = slice; - exports["characters"] = characters; - exports["member"] = member; - exports["find_if"] = find_if; - exports["repeat_string"] = repeat_string; - exports["DefaultsError"] = DefaultsError; - exports["defaults"] = defaults; - exports["merge"] = merge; - exports["noop"] = noop; - exports["MAP"] = MAP; - exports["push_uniq"] = push_uniq; - exports["string_template"] = string_template; - exports["remove"] = remove; - exports["mergeSort"] = mergeSort; - exports["set_difference"] = set_difference; - exports["set_intersection"] = set_intersection; - exports["makePredicate"] = makePredicate; - exports["all"] = all; - exports["Dictionary"] = Dictionary; - exports["DEFNODE"] = DEFNODE; - exports["AST_Token"] = AST_Token; - exports["AST_Node"] = AST_Node; - exports["AST_Statement"] = AST_Statement; - exports["AST_Debugger"] = AST_Debugger; - exports["AST_Directive"] = AST_Directive; - exports["AST_SimpleStatement"] = AST_SimpleStatement; - exports["walk_body"] = walk_body; - exports["AST_Block"] = AST_Block; - exports["AST_BlockStatement"] = AST_BlockStatement; - exports["AST_EmptyStatement"] = AST_EmptyStatement; - exports["AST_StatementWithBody"] = AST_StatementWithBody; - exports["AST_LabeledStatement"] = AST_LabeledStatement; - exports["AST_DWLoop"] = AST_DWLoop; - exports["AST_Do"] = AST_Do; - exports["AST_While"] = AST_While; - exports["AST_For"] = AST_For; - exports["AST_ForIn"] = AST_ForIn; - exports["AST_With"] = AST_With; - exports["AST_Scope"] = AST_Scope; - exports["AST_Toplevel"] = AST_Toplevel; - exports["AST_Lambda"] = AST_Lambda; - exports["AST_Accessor"] = AST_Accessor; - exports["AST_Function"] = AST_Function; - exports["AST_Defun"] = AST_Defun; - exports["AST_Jump"] = AST_Jump; - exports["AST_Exit"] = AST_Exit; - exports["AST_Return"] = AST_Return; - exports["AST_Throw"] = AST_Throw; - exports["AST_LoopControl"] = AST_LoopControl; - exports["AST_Break"] = AST_Break; - exports["AST_Continue"] = AST_Continue; - exports["AST_If"] = AST_If; - exports["AST_Switch"] = AST_Switch; - exports["AST_SwitchBranch"] = AST_SwitchBranch; - exports["AST_Default"] = AST_Default; - exports["AST_Case"] = AST_Case; - exports["AST_Try"] = AST_Try; - exports["AST_Catch"] = AST_Catch; - exports["AST_Finally"] = AST_Finally; - exports["AST_Definitions"] = AST_Definitions; - exports["AST_Var"] = AST_Var; - exports["AST_Const"] = AST_Const; - exports["AST_VarDef"] = AST_VarDef; - exports["AST_Call"] = AST_Call; - exports["AST_New"] = AST_New; - exports["AST_Seq"] = AST_Seq; - exports["AST_PropAccess"] = AST_PropAccess; - exports["AST_Dot"] = AST_Dot; - exports["AST_Sub"] = AST_Sub; - exports["AST_Unary"] = AST_Unary; - exports["AST_UnaryPrefix"] = AST_UnaryPrefix; - exports["AST_UnaryPostfix"] = AST_UnaryPostfix; - exports["AST_Binary"] = AST_Binary; - exports["AST_Conditional"] = AST_Conditional; - exports["AST_Assign"] = AST_Assign; - exports["AST_Array"] = AST_Array; - exports["AST_Object"] = AST_Object; - exports["AST_ObjectProperty"] = AST_ObjectProperty; - exports["AST_ObjectKeyVal"] = AST_ObjectKeyVal; - exports["AST_ObjectSetter"] = AST_ObjectSetter; - exports["AST_ObjectGetter"] = AST_ObjectGetter; - exports["AST_Symbol"] = AST_Symbol; - exports["AST_SymbolAccessor"] = AST_SymbolAccessor; - exports["AST_SymbolDeclaration"] = AST_SymbolDeclaration; - exports["AST_SymbolVar"] = AST_SymbolVar; - exports["AST_SymbolConst"] = AST_SymbolConst; - exports["AST_SymbolFunarg"] = AST_SymbolFunarg; - exports["AST_SymbolDefun"] = AST_SymbolDefun; - exports["AST_SymbolLambda"] = AST_SymbolLambda; - exports["AST_SymbolCatch"] = AST_SymbolCatch; - exports["AST_Label"] = AST_Label; - exports["AST_SymbolRef"] = AST_SymbolRef; - exports["AST_LabelRef"] = AST_LabelRef; - exports["AST_This"] = AST_This; - exports["AST_Constant"] = AST_Constant; - exports["AST_String"] = AST_String; - exports["AST_Number"] = AST_Number; - exports["AST_RegExp"] = AST_RegExp; - exports["AST_Atom"] = AST_Atom; - exports["AST_Null"] = AST_Null; - exports["AST_NaN"] = AST_NaN; - exports["AST_Undefined"] = AST_Undefined; - exports["AST_Hole"] = AST_Hole; - exports["AST_Infinity"] = AST_Infinity; - exports["AST_Boolean"] = AST_Boolean; - exports["AST_False"] = AST_False; - exports["AST_True"] = AST_True; - exports["TreeWalker"] = TreeWalker; - exports["KEYWORDS"] = KEYWORDS; - exports["KEYWORDS_ATOM"] = KEYWORDS_ATOM; - exports["RESERVED_WORDS"] = RESERVED_WORDS; - exports["KEYWORDS_BEFORE_EXPRESSION"] = KEYWORDS_BEFORE_EXPRESSION; - exports["OPERATOR_CHARS"] = OPERATOR_CHARS; - exports["RE_HEX_NUMBER"] = RE_HEX_NUMBER; - exports["RE_OCT_NUMBER"] = RE_OCT_NUMBER; - exports["RE_DEC_NUMBER"] = RE_DEC_NUMBER; - exports["OPERATORS"] = OPERATORS; - exports["WHITESPACE_CHARS"] = WHITESPACE_CHARS; - exports["PUNC_BEFORE_EXPRESSION"] = PUNC_BEFORE_EXPRESSION; - exports["PUNC_CHARS"] = PUNC_CHARS; - exports["REGEXP_MODIFIERS"] = REGEXP_MODIFIERS; - exports["UNICODE"] = UNICODE; - exports["is_letter"] = is_letter; - exports["is_digit"] = is_digit; - exports["is_alphanumeric_char"] = is_alphanumeric_char; - exports["is_unicode_combining_mark"] = is_unicode_combining_mark; - exports["is_unicode_connector_punctuation"] = is_unicode_connector_punctuation; - exports["is_identifier"] = is_identifier; - exports["is_identifier_start"] = is_identifier_start; - exports["is_identifier_char"] = is_identifier_char; - exports["is_identifier_string"] = is_identifier_string; - exports["parse_js_number"] = parse_js_number; - exports["JS_Parse_Error"] = JS_Parse_Error; - exports["js_error"] = js_error; - exports["is_token"] = is_token; - exports["EX_EOF"] = EX_EOF; - exports["tokenizer"] = tokenizer; - exports["UNARY_PREFIX"] = UNARY_PREFIX; - exports["UNARY_POSTFIX"] = UNARY_POSTFIX; - exports["ASSIGNMENT"] = ASSIGNMENT; - exports["PRECEDENCE"] = PRECEDENCE; - exports["STATEMENTS_WITH_LABELS"] = STATEMENTS_WITH_LABELS; - exports["ATOMIC_START_TOKEN"] = ATOMIC_START_TOKEN; - exports["parse"] = parse; - exports["TreeTransformer"] = TreeTransformer; - exports["SymbolDef"] = SymbolDef; - exports["base54"] = base54; - exports["OutputStream"] = OutputStream; - exports["Compressor"] = Compressor; - exports["SourceMap"] = SourceMap; -})({}, function() { - return exports; -}()); - -var UglifyJS = exports.UglifyJS; - -UglifyJS.AST_Node.warn_function = function(txt) { - logger.error("uglifyjs2 WARN: " + txt); -}; - -//JRB: MODIFIED FROM UGLIFY SOURCE -//to take a name for the file, and then set toplevel.filename to be that name. -exports.minify = function(files, options, name) { - options = UglifyJS.defaults(options, { - outSourceMap : null, - sourceRoot : null, - inSourceMap : null, - fromString : false, - warnings : false, - mangle : {}, - output : null, - compress : {} - }); - if (typeof files == "string") - files = [ files ]; - - // 1. parse - var toplevel = null; - files.forEach(function(file){ - var code = options.fromString - ? file - : rjsFile.readFile(file, "utf8"); - toplevel = UglifyJS.parse(code, { - filename: options.fromString ? name : file, - toplevel: toplevel - }); - }); - - // 2. compress - if (options.compress) { - var compress = { warnings: options.warnings }; - UglifyJS.merge(compress, options.compress); - toplevel.figure_out_scope(); - var sq = UglifyJS.Compressor(compress); - toplevel = toplevel.transform(sq); - } - - // 3. mangle - if (options.mangle) { - toplevel.figure_out_scope(); - toplevel.compute_char_frequency(); - toplevel.mangle_names(options.mangle); - } - - // 4. output - var map = null; - var inMap = null; - if (options.inSourceMap) { - inMap = rjsFile.readFile(options.inSourceMap, "utf8"); - } - if (options.outSourceMap) map = UglifyJS.SourceMap({ - file: options.outSourceMap, - orig: inMap, - root: options.sourceRoot - }); - var output = { source_map: map }; - if (options.output) { - UglifyJS.merge(output, options.output); - } - var stream = UglifyJS.OutputStream(output); - toplevel.print(stream); - return { - code : stream + "", - map : map + "" - }; -}; - -// exports.describe_ast = function() { -// function doitem(ctor) { -// var sub = {}; -// ctor.SUBCLASSES.forEach(function(ctor){ -// sub[ctor.TYPE] = doitem(ctor); -// }); -// var ret = {}; -// if (ctor.SELF_PROPS.length > 0) ret.props = ctor.SELF_PROPS; -// if (ctor.SUBCLASSES.length > 0) ret.sub = sub; -// return ret; -// } -// return doitem(UglifyJS.AST_Node).sub; -// } - -exports.describe_ast = function() { - var out = UglifyJS.OutputStream({ beautify: true }); - function doitem(ctor) { - out.print("AST_" + ctor.TYPE); - var props = ctor.SELF_PROPS.filter(function(prop){ - return !/^\$/.test(prop); - }); - if (props.length > 0) { - out.space(); - out.with_parens(function(){ - props.forEach(function(prop, i){ - if (i) out.space(); - out.print(prop); - }); - }); - } - if (ctor.documentation) { - out.space(); - out.print_string(ctor.documentation); - } - if (ctor.SUBCLASSES.length > 0) { - out.space(); - out.with_block(function(){ - ctor.SUBCLASSES.forEach(function(ctor, i){ - out.indent(); - doitem(ctor); - out.newline(); - }); - }); - } - }; - doitem(UglifyJS.AST_Node); - return out + ""; -}; - -}); -/** - * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ - -/*jslint plusplus: true */ -/*global define: false */ - -define('parse', ['./esprimaAdapter', 'lang'], function (esprima, lang) { - 'use strict'; - - function arrayToString(ary) { - var output = '['; - if (ary) { - ary.forEach(function (item, i) { - output += (i > 0 ? ',' : '') + '"' + lang.jsEscape(item) + '"'; - }); - } - output += ']'; - - return output; - } - - //This string is saved off because JSLint complains - //about obj.arguments use, as 'reserved word' - var argPropName = 'arguments'; - - //From an esprima example for traversing its ast. - function traverse(object, visitor) { - var key, child; - - if (!object) { - return; - } - - if (visitor.call(null, object) === false) { - return false; - } - for (key in object) { - if (object.hasOwnProperty(key)) { - child = object[key]; - if (typeof child === 'object' && child !== null) { - if (traverse(child, visitor) === false) { - return false; - } - } - } - } - } - - //Like traverse, but visitor returning false just - //stops that subtree analysis, not the rest of tree - //visiting. - function traverseBroad(object, visitor) { - var key, child; - - if (!object) { - return; - } - - if (visitor.call(null, object) === false) { - return false; - } - for (key in object) { - if (object.hasOwnProperty(key)) { - child = object[key]; - if (typeof child === 'object' && child !== null) { - traverse(child, visitor); - } - } - } - } - - /** - * Pulls out dependencies from an array literal with just string members. - * If string literals, will just return those string values in an array, - * skipping other items in the array. - * - * @param {Node} node an AST node. - * - * @returns {Array} an array of strings. - * If null is returned, then it means the input node was not a valid - * dependency. - */ - function getValidDeps(node) { - if (!node || node.type !== 'ArrayExpression' || !node.elements) { - return; - } - - var deps = []; - - node.elements.some(function (elem) { - if (elem.type === 'Literal') { - deps.push(elem.value); - } - }); - - return deps.length ? deps : undefined; - } - - /** - * Main parse function. Returns a string of any valid require or - * define/require.def calls as part of one JavaScript source string. - * @param {String} moduleName the module name that represents this file. - * It is used to create a default define if there is not one already for the - * file. This allows properly tracing dependencies for builds. Otherwise, if - * the file just has a require() call, the file dependencies will not be - * properly reflected: the file will come before its dependencies. - * @param {String} moduleName - * @param {String} fileName - * @param {String} fileContents - * @param {Object} options optional options. insertNeedsDefine: true will - * add calls to require.needsDefine() if appropriate. - * @returns {String} JS source string or null, if no require or - * define/require.def calls are found. - */ - function parse(moduleName, fileName, fileContents, options) { - options = options || {}; - - //Set up source input - var i, moduleCall, depString, - moduleDeps = [], - result = '', - moduleList = [], - needsDefine = true, - astRoot = esprima.parse(fileContents); - - parse.recurse(astRoot, function (callName, config, name, deps) { - if (!deps) { - deps = []; - } - - if (callName === 'define' && (!name || name === moduleName)) { - needsDefine = false; - } - - if (!name) { - //If there is no module name, the dependencies are for - //this file/default module name. - moduleDeps = moduleDeps.concat(deps); - } else { - moduleList.push({ - name: name, - deps: deps - }); - } - - //If define was found, no need to dive deeper, unless - //the config explicitly wants to dig deeper. - return !!options.findNestedDependencies; - }, options); - - if (options.insertNeedsDefine && needsDefine) { - result += 'require.needsDefine("' + moduleName + '");'; - } - - if (moduleDeps.length || moduleList.length) { - for (i = 0; i < moduleList.length; i++) { - moduleCall = moduleList[i]; - if (result) { - result += '\n'; - } - - //If this is the main module for this file, combine any - //"anonymous" dependencies (could come from a nested require - //call) with this module. - if (moduleCall.name === moduleName) { - moduleCall.deps = moduleCall.deps.concat(moduleDeps); - moduleDeps = []; - } - - depString = arrayToString(moduleCall.deps); - result += 'define("' + moduleCall.name + '",' + - depString + ');'; - } - if (moduleDeps.length) { - if (result) { - result += '\n'; - } - depString = arrayToString(moduleDeps); - result += 'define("' + moduleName + '",' + depString + ');'; - } - } - - return result || null; - } - - parse.traverse = traverse; - parse.traverseBroad = traverseBroad; - - /** - * Handles parsing a file recursively for require calls. - * @param {Array} parentNode the AST node to start with. - * @param {Function} onMatch function to call on a parse match. - * @param {Object} [options] This is normally the build config options if - * it is passed. - */ - parse.recurse = function (object, onMatch, options) { - //Like traverse, but skips if branches that would not be processed - //after has application that results in tests of true or false boolean - //literal values. - var key, child, - hasHas = options && options.has; - - if (!object) { - return; - } - - //If has replacement has resulted in if(true){} or if(false){}, take - //the appropriate branch and skip the other one. - if (hasHas && object.type === 'IfStatement' && object.test.type && - object.test.type === 'Literal') { - if (object.test.value) { - //Take the if branch - this.recurse(object.consequent, onMatch, options); - } else { - //Take the else branch - this.recurse(object.alternate, onMatch, options); - } - } else { - if (this.parseNode(object, onMatch) === false) { - return; - } - for (key in object) { - if (object.hasOwnProperty(key)) { - child = object[key]; - if (typeof child === 'object' && child !== null) { - this.recurse(child, onMatch, options); - } - } - } - } - }; - - /** - * Determines if the file defines the require/define module API. - * Specifically, it looks for the `define.amd = ` expression. - * @param {String} fileName - * @param {String} fileContents - * @returns {Boolean} - */ - parse.definesRequire = function (fileName, fileContents) { - var found = false; - - traverse(esprima.parse(fileContents), function (node) { - if (parse.hasDefineAmd(node)) { - found = true; - - //Stop traversal - return false; - } - }); - - return found; - }; - - /** - * Finds require("") calls inside a CommonJS anonymous module wrapped in a - * define(function(require, exports, module){}) wrapper. These dependencies - * will be added to a modified define() call that lists the dependencies - * on the outside of the function. - * @param {String} fileName - * @param {String|Object} fileContents: a string of contents, or an already - * parsed AST tree. - * @returns {Array} an array of module names that are dependencies. Always - * returns an array, but could be of length zero. - */ - parse.getAnonDeps = function (fileName, fileContents) { - var astRoot = typeof fileContents === 'string' ? - esprima.parse(fileContents) : fileContents, - defFunc = this.findAnonDefineFactory(astRoot); - - return parse.getAnonDepsFromNode(defFunc); - }; - - /** - * Finds require("") calls inside a CommonJS anonymous module wrapped - * in a define function, given an AST node for the definition function. - * @param {Node} node the AST node for the definition function. - * @returns {Array} and array of dependency names. Can be of zero length. - */ - parse.getAnonDepsFromNode = function (node) { - var deps = [], - funcArgLength; - - if (node) { - this.findRequireDepNames(node, deps); - - //If no deps, still add the standard CommonJS require, exports, - //module, in that order, to the deps, but only if specified as - //function args. In particular, if exports is used, it is favored - //over the return value of the function, so only add it if asked. - funcArgLength = node.params && node.params.length; - if (funcArgLength) { - deps = (funcArgLength > 1 ? ["require", "exports", "module"] : - ["require"]).concat(deps); - } - } - return deps; - }; - - parse.isDefineNodeWithArgs = function (node) { - return node && node.type === 'CallExpression' && - node.callee && node.callee.type === 'Identifier' && - node.callee.name === 'define' && node[argPropName]; - }; - - /** - * Finds the function in define(function (require, exports, module){}); - * @param {Array} node - * @returns {Boolean} - */ - parse.findAnonDefineFactory = function (node) { - var match; - - traverse(node, function (node) { - var arg0, arg1; - - if (parse.isDefineNodeWithArgs(node)) { - - //Just the factory function passed to define - arg0 = node[argPropName][0]; - if (arg0 && arg0.type === 'FunctionExpression') { - match = arg0; - return false; - } - - //A string literal module ID followed by the factory function. - arg1 = node[argPropName][1]; - if (arg0.type === 'Literal' && - arg1 && arg1.type === 'FunctionExpression') { - match = arg1; - return false; - } - } - }); - - return match; - }; - - /** - * Finds any config that is passed to requirejs. That includes calls to - * require/requirejs.config(), as well as require({}, ...) and - * requirejs({}, ...) - * @param {String} fileContents - * - * @returns {Object} a config details object with the following properties: - * - config: {Object} the config object found. Can be undefined if no - * config found. - * - range: {Array} the start index and end index in the contents where - * the config was found. Can be undefined if no config found. - * Can throw an error if the config in the file cannot be evaluated in - * a build context to valid JavaScript. - */ - parse.findConfig = function (fileContents) { - /*jslint evil: true */ - var jsConfig, foundConfig, stringData, foundRange, quote, quoteMatch, - quoteRegExp = /(:\s|\[\s*)(['"])/, - astRoot = esprima.parse(fileContents, { - loc: true - }); - - traverse(astRoot, function (node) { - var arg, - requireType = parse.hasRequire(node); - - if (requireType && (requireType === 'require' || - requireType === 'requirejs' || - requireType === 'requireConfig' || - requireType === 'requirejsConfig')) { - - arg = node[argPropName] && node[argPropName][0]; - - if (arg && arg.type === 'ObjectExpression') { - stringData = parse.nodeToString(fileContents, arg); - jsConfig = stringData.value; - foundRange = stringData.range; - return false; - } - } else { - arg = parse.getRequireObjectLiteral(node); - if (arg) { - stringData = parse.nodeToString(fileContents, arg); - jsConfig = stringData.value; - foundRange = stringData.range; - return false; - } - } - }); - - if (jsConfig) { - // Eval the config - quoteMatch = quoteRegExp.exec(jsConfig); - quote = (quoteMatch && quoteMatch[2]) || '"'; - foundConfig = eval('(' + jsConfig + ')'); - } - - return { - config: foundConfig, - range: foundRange, - quote: quote - }; - }; - - /** Returns the node for the object literal assigned to require/requirejs, - * for holding a declarative config. - */ - parse.getRequireObjectLiteral = function (node) { - if (node.id && node.id.type === 'Identifier' && - (node.id.name === 'require' || node.id.name === 'requirejs') && - node.init && node.init.type === 'ObjectExpression') { - return node.init; - } - }; - - /** - * Renames require/requirejs/define calls to be ns + '.' + require/requirejs/define - * Does *not* do .config calls though. See pragma.namespace for the complete - * set of namespace transforms. This function is used because require calls - * inside a define() call should not be renamed, so a simple regexp is not - * good enough. - * @param {String} fileContents the contents to transform. - * @param {String} ns the namespace, *not* including trailing dot. - * @return {String} the fileContents with the namespace applied - */ - parse.renameNamespace = function (fileContents, ns) { - var lines, - locs = [], - astRoot = esprima.parse(fileContents, { - loc: true - }); - - parse.recurse(astRoot, function (callName, config, name, deps, node) { - locs.push(node.loc); - //Do not recurse into define functions, they should be using - //local defines. - return callName !== 'define'; - }, {}); - - if (locs.length) { - lines = fileContents.split('\n'); - - //Go backwards through the found locs, adding in the namespace name - //in front. - locs.reverse(); - locs.forEach(function (loc) { - var startIndex = loc.start.column, - //start.line is 1-based, not 0 based. - lineIndex = loc.start.line - 1, - line = lines[lineIndex]; - - lines[lineIndex] = line.substring(0, startIndex) + - ns + '.' + - line.substring(startIndex, - line.length); - }); - - fileContents = lines.join('\n'); - } - - return fileContents; - }; - - /** - * Finds all dependencies specified in dependency arrays and inside - * simplified commonjs wrappers. - * @param {String} fileName - * @param {String} fileContents - * - * @returns {Array} an array of dependency strings. The dependencies - * have not been normalized, they may be relative IDs. - */ - parse.findDependencies = function (fileName, fileContents, options) { - var dependencies = [], - astRoot = esprima.parse(fileContents); - - parse.recurse(astRoot, function (callName, config, name, deps) { - if (deps) { - dependencies = dependencies.concat(deps); - } - }, options); - - return dependencies; - }; - - /** - * Finds only CJS dependencies, ones that are the form - * require('stringLiteral') - */ - parse.findCjsDependencies = function (fileName, fileContents) { - var dependencies = []; - - traverse(esprima.parse(fileContents), function (node) { - var arg; - - if (node && node.type === 'CallExpression' && node.callee && - node.callee.type === 'Identifier' && - node.callee.name === 'require' && node[argPropName] && - node[argPropName].length === 1) { - arg = node[argPropName][0]; - if (arg.type === 'Literal') { - dependencies.push(arg.value); - } - } - }); - - return dependencies; - }; - - //function define() {} - parse.hasDefDefine = function (node) { - return node.type === 'FunctionDeclaration' && node.id && - node.id.type === 'Identifier' && node.id.name === 'define'; - }; - - //define.amd = ... - parse.hasDefineAmd = function (node) { - return node && node.type === 'AssignmentExpression' && - node.left && node.left.type === 'MemberExpression' && - node.left.object && node.left.object.name === 'define' && - node.left.property && node.left.property.name === 'amd'; - }; - - //define.amd reference, as in: if (define.amd) - parse.refsDefineAmd = function (node) { - return node && node.type === 'MemberExpression' && - node.object && node.object.name === 'define' && - node.object.type === 'Identifier' && - node.property && node.property.name === 'amd' && - node.property.type === 'Identifier'; - }; - - //require(), requirejs(), require.config() and requirejs.config() - parse.hasRequire = function (node) { - var callName, - c = node && node.callee; - - if (node && node.type === 'CallExpression' && c) { - if (c.type === 'Identifier' && - (c.name === 'require' || - c.name === 'requirejs')) { - //A require/requirejs({}, ...) call - callName = c.name; - } else if (c.type === 'MemberExpression' && - c.object && - c.object.type === 'Identifier' && - (c.object.name === 'require' || - c.object.name === 'requirejs') && - c.property && c.property.name === 'config') { - // require/requirejs.config({}) call - callName = c.object.name + 'Config'; - } - } - - return callName; - }; - - //define() - parse.hasDefine = function (node) { - return node && node.type === 'CallExpression' && node.callee && - node.callee.type === 'Identifier' && - node.callee.name === 'define'; - }; - - /** - * If there is a named define in the file, returns the name. Does not - * scan for mulitple names, just the first one. - */ - parse.getNamedDefine = function (fileContents) { - var name; - traverse(esprima.parse(fileContents), function (node) { - if (node && node.type === 'CallExpression' && node.callee && - node.callee.type === 'Identifier' && - node.callee.name === 'define' && - node[argPropName] && node[argPropName][0] && - node[argPropName][0].type === 'Literal') { - name = node[argPropName][0].value; - return false; - } - }); - - return name; - }; - - /** - * Determines if define(), require({}|[]) or requirejs was called in the - * file. Also finds out if define() is declared and if define.amd is called. - */ - parse.usesAmdOrRequireJs = function (fileName, fileContents) { - var uses; - - traverse(esprima.parse(fileContents), function (node) { - var type, callName, arg; - - if (parse.hasDefDefine(node)) { - //function define() {} - type = 'declaresDefine'; - } else if (parse.hasDefineAmd(node)) { - type = 'defineAmd'; - } else { - callName = parse.hasRequire(node); - if (callName) { - arg = node[argPropName] && node[argPropName][0]; - if (arg && (arg.type === 'ObjectExpression' || - arg.type === 'ArrayExpression')) { - type = callName; - } - } else if (parse.hasDefine(node)) { - type = 'define'; - } - } - - if (type) { - if (!uses) { - uses = {}; - } - uses[type] = true; - } - }); - - return uses; - }; - - /** - * Determines if require(''), exports.x =, module.exports =, - * __dirname, __filename are used. So, not strictly traditional CommonJS, - * also checks for Node variants. - */ - parse.usesCommonJs = function (fileName, fileContents) { - var uses = null, - assignsExports = false; - - - traverse(esprima.parse(fileContents), function (node) { - var type, - exp = node.expression || node.init; - - if (node.type === 'Identifier' && - (node.name === '__dirname' || node.name === '__filename')) { - type = node.name.substring(2); - } else if (node.type === 'VariableDeclarator' && node.id && - node.id.type === 'Identifier' && - node.id.name === 'exports') { - //Hmm, a variable assignment for exports, so does not use cjs - //exports. - type = 'varExports'; - } else if (exp && exp.type === 'AssignmentExpression' && exp.left && - exp.left.type === 'MemberExpression' && exp.left.object) { - if (exp.left.object.name === 'module' && exp.left.property && - exp.left.property.name === 'exports') { - type = 'moduleExports'; - } else if (exp.left.object.name === 'exports' && - exp.left.property) { - type = 'exports'; - } - - } else if (node && node.type === 'CallExpression' && node.callee && - node.callee.type === 'Identifier' && - node.callee.name === 'require' && node[argPropName] && - node[argPropName].length === 1 && - node[argPropName][0].type === 'Literal') { - type = 'require'; - } - - if (type) { - if (type === 'varExports') { - assignsExports = true; - } else if (type !== 'exports' || !assignsExports) { - if (!uses) { - uses = {}; - } - uses[type] = true; - } - } - }); - - return uses; - }; - - - parse.findRequireDepNames = function (node, deps) { - traverse(node, function (node) { - var arg; - - if (node && node.type === 'CallExpression' && node.callee && - node.callee.type === 'Identifier' && - node.callee.name === 'require' && - node[argPropName] && node[argPropName].length === 1) { - - arg = node[argPropName][0]; - if (arg.type === 'Literal') { - deps.push(arg.value); - } - } - }); - }; - - /** - * Determines if a specific node is a valid require or define/require.def - * call. - * @param {Array} node - * @param {Function} onMatch a function to call when a match is found. - * It is passed the match name, and the config, name, deps possible args. - * The config, name and deps args are not normalized. - * - * @returns {String} a JS source string with the valid require/define call. - * Otherwise null. - */ - parse.parseNode = function (node, onMatch) { - var name, deps, cjsDeps, arg, factory, exp, refsDefine, bodyNode, - args = node && node[argPropName], - callName = parse.hasRequire(node); - - if (callName === 'require' || callName === 'requirejs') { - //A plain require/requirejs call - arg = node[argPropName] && node[argPropName][0]; - if (arg.type !== 'ArrayExpression') { - if (arg.type === 'ObjectExpression') { - //A config call, try the second arg. - arg = node[argPropName][1]; - } - } - - deps = getValidDeps(arg); - if (!deps) { - return; - } - - return onMatch("require", null, null, deps, node); - } else if (parse.hasDefine(node) && args && args.length) { - name = args[0]; - deps = args[1]; - factory = args[2]; - - if (name.type === 'ArrayExpression') { - //No name, adjust args - factory = deps; - deps = name; - name = null; - } else if (name.type === 'FunctionExpression') { - //Just the factory, no name or deps - factory = name; - name = deps = null; - } else if (name.type !== 'Literal') { - //An object literal, just null out - name = deps = factory = null; - } - - if (name && name.type === 'Literal' && deps) { - if (deps.type === 'FunctionExpression') { - //deps is the factory - factory = deps; - deps = null; - } else if (deps.type === 'ObjectExpression') { - //deps is object literal, null out - deps = factory = null; - } else if (deps.type === 'Identifier' && args.length === 2) { - // define('id', factory) - deps = factory = null; - } - } - - if (deps && deps.type === 'ArrayExpression') { - deps = getValidDeps(deps); - } else if (factory && factory.type === 'FunctionExpression') { - //If no deps and a factory function, could be a commonjs sugar - //wrapper, scan the function for dependencies. - cjsDeps = parse.getAnonDepsFromNode(factory); - if (cjsDeps.length) { - deps = cjsDeps; - } - } else if (deps || factory) { - //Does not match the shape of an AMD call. - return; - } - - //Just save off the name as a string instead of an AST object. - if (name && name.type === 'Literal') { - name = name.value; - } - - return onMatch("define", null, name, deps, node); - } else if (node.type === 'CallExpression' && node.callee && - node.callee.type === 'FunctionExpression' && - node.callee.body && node.callee.body.body && - node.callee.body.body.length === 1 && - node.callee.body.body[0].type === 'IfStatement') { - bodyNode = node.callee.body.body[0]; - //Look for a define(Identifier) case, but only if inside an - //if that has a define.amd test - if (bodyNode.consequent && bodyNode.consequent.body) { - exp = bodyNode.consequent.body[0]; - if (exp.type === 'ExpressionStatement' && exp.expression && - parse.hasDefine(exp.expression) && - exp.expression.arguments && - exp.expression.arguments.length === 1 && - exp.expression.arguments[0].type === 'Identifier') { - - //Calls define(Identifier) as first statement in body. - //Confirm the if test references define.amd - traverse(bodyNode.test, function (node) { - if (parse.refsDefineAmd(node)) { - refsDefine = true; - return false; - } - }); - - if (refsDefine) { - return onMatch("define", null, null, null, exp.expression); - } - } - } - } - }; - - /** - * Converts an AST node into a JS source string by extracting - * the node's location from the given contents string. Assumes - * esprima.parse() with loc was done. - * @param {String} contents - * @param {Object} node - * @returns {String} a JS source string. - */ - parse.nodeToString = function (contents, node) { - var loc = node.loc, - lines = contents.split('\n'), - firstLine = loc.start.line > 1 ? - lines.slice(0, loc.start.line - 1).join('\n') + '\n' : - '', - preamble = firstLine + - lines[loc.start.line - 1].substring(0, loc.start.column), - extracted = lines[loc.start.line - 1].substring(loc.start.column) + - '\n' + - lines.slice(loc.start.line, loc.end.line - 1).join('\n') + - '\n' + - lines[loc.end.line - 1].substring(0, loc.end.column); - - return { - value: extracted, - range: [ - preamble.length, - preamble.length + extracted.length - ] - }; - }; - - /** - * Extracts license comments from JS text. - * @param {String} fileName - * @param {String} contents - * @returns {String} a string of license comments. - */ - parse.getLicenseComments = function (fileName, contents) { - var commentNode, refNode, subNode, value, i, j, - //xpconnect's Reflect does not support comment or range, but - //prefer continued operation vs strict parity of operation, - //as license comments can be expressed in other ways, like - //via wrap args, or linked via sourcemaps. - ast = esprima.parse(contents, { - comment: true, - range: true - }), - result = '', - existsMap = {}, - lineEnd = contents.indexOf('\r') === -1 ? '\n' : '\r\n'; - - if (ast.comments) { - for (i = 0; i < ast.comments.length; i++) { - commentNode = ast.comments[i]; - - if (commentNode.type === 'Line') { - value = '//' + commentNode.value + lineEnd; - refNode = commentNode; - - if (i + 1 >= ast.comments.length) { - value += lineEnd; - } else { - //Look for immediately adjacent single line comments - //since it could from a multiple line comment made out - //of single line comments. Like this comment. - for (j = i + 1; j < ast.comments.length; j++) { - subNode = ast.comments[j]; - if (subNode.type === 'Line' && - subNode.range[0] === refNode.range[1] + 1) { - //Adjacent single line comment. Collect it. - value += '//' + subNode.value + lineEnd; - refNode = subNode; - } else { - //No more single line comment blocks. Break out - //and continue outer looping. - break; - } - } - value += lineEnd; - i = j - 1; - } - } else { - value = '/*' + commentNode.value + '*/' + lineEnd + lineEnd; - } - - if (!existsMap[value] && (value.indexOf('license') !== -1 || - (commentNode.type === 'Block' && - value.indexOf('/*!') === 0) || - value.indexOf('opyright') !== -1 || - value.indexOf('(c)') !== -1)) { - - result += value; - existsMap[value] = true; - } - - } - } - - return result; - }; - - return parse; -}); -/** - * @license Copyright (c) 2012, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ - -/*global define */ - -define('transform', [ './esprimaAdapter', './parse', 'logger', 'lang'], -function (esprima, parse, logger, lang) { - 'use strict'; - var transform, - baseIndentRegExp = /^([ \t]+)/, - indentRegExp = /\{[\r\n]+([ \t]+)/, - keyRegExp = /^[_A-Za-z]([A-Za-z\d_]*)$/, - bulkIndentRegExps = { - '\n': /\n/g, - '\r\n': /\r\n/g - }; - - function applyIndent(str, indent, lineReturn) { - var regExp = bulkIndentRegExps[lineReturn]; - return str.replace(regExp, '$&' + indent); - } - - transform = { - toTransport: function (namespace, moduleName, path, contents, onFound, options) { - options = options || {}; - - var astRoot, contentLines, modLine, - foundAnon, - scanCount = 0, - scanReset = false, - defineInfos = []; - - try { - astRoot = esprima.parse(contents, { - loc: true - }); - } catch (e) { - logger.trace('toTransport skipping ' + path + ': ' + - e.toString()); - return contents; - } - - //Find the define calls and their position in the files. - parse.traverseBroad(astRoot, function (node) { - var args, firstArg, firstArgLoc, factoryNode, - needsId, depAction, foundId, - sourceUrlData, range, - namespaceExists = false; - - namespaceExists = namespace && - node.type === 'CallExpression' && - node.callee && node.callee.object && - node.callee.object.type === 'Identifier' && - node.callee.object.name === namespace && - node.callee.property.type === 'Identifier' && - node.callee.property.name === 'define'; - - if (namespaceExists || parse.isDefineNodeWithArgs(node)) { - //The arguments are where its at. - args = node.arguments; - if (!args || !args.length) { - return; - } - - firstArg = args[0]; - firstArgLoc = firstArg.loc; - - if (args.length === 1) { - if (firstArg.type === 'Identifier') { - //The define(factory) case, but - //only allow it if one Identifier arg, - //to limit impact of false positives. - needsId = true; - depAction = 'empty'; - } else if (firstArg.type === 'FunctionExpression') { - //define(function(){}) - factoryNode = firstArg; - needsId = true; - depAction = 'scan'; - } else if (firstArg.type === 'ObjectExpression') { - //define({}); - needsId = true; - depAction = 'skip'; - } else if (firstArg.type === 'Literal' && - typeof firstArg.value === 'number') { - //define('12345'); - needsId = true; - depAction = 'skip'; - } else if (firstArg.type === 'UnaryExpression' && - firstArg.operator === '-' && - firstArg.argument && - firstArg.argument.type === 'Literal' && - typeof firstArg.argument.value === 'number') { - //define('-12345'); - needsId = true; - depAction = 'skip'; - } else if (firstArg.type === 'MemberExpression' && - firstArg.object && - firstArg.property && - firstArg.property.type === 'Identifier') { - //define(this.key); - needsId = true; - depAction = 'empty'; - } - } else if (firstArg.type === 'ArrayExpression') { - //define([], ...); - needsId = true; - depAction = 'skip'; - } else if (firstArg.type === 'Literal' && - typeof firstArg.value === 'string') { - //define('string', ....) - //Already has an ID. - needsId = false; - if (args.length === 2 && - args[1].type === 'FunctionExpression') { - //Needs dependency scanning. - factoryNode = args[1]; - depAction = 'scan'; - } else { - depAction = 'skip'; - } - } else { - //Unknown define entity, keep looking, even - //in the subtree for this node. - return; - } - - range = { - foundId: foundId, - needsId: needsId, - depAction: depAction, - namespaceExists: namespaceExists, - node: node, - defineLoc: node.loc, - firstArgLoc: firstArgLoc, - factoryNode: factoryNode, - sourceUrlData: sourceUrlData - }; - - //Only transform ones that do not have IDs. If it has an - //ID but no dependency array, assume it is something like - //a phonegap implementation, that has its own internal - //define that cannot handle dependency array constructs, - //and if it is a named module, then it means it has been - //set for transport form. - if (range.needsId) { - if (foundAnon) { - logger.trace(path + ' has more than one anonymous ' + - 'define. May be a built file from another ' + - 'build system like, Ender. Skipping normalization.'); - defineInfos = []; - return false; - } else { - foundAnon = range; - defineInfos.push(range); - } - } else if (depAction === 'scan') { - scanCount += 1; - if (scanCount > 1) { - //Just go back to an array that just has the - //anon one, since this is an already optimized - //file like the phonegap one. - if (!scanReset) { - defineInfos = foundAnon ? [foundAnon] : []; - scanReset = true; - } - } else { - defineInfos.push(range); - } - } - } - }); - - if (!defineInfos.length) { - return contents; - } - - //Reverse the matches, need to start from the bottom of - //the file to modify it, so that the ranges are still true - //further up. - defineInfos.reverse(); - - contentLines = contents.split('\n'); - - modLine = function (loc, contentInsertion) { - var startIndex = loc.start.column, - //start.line is 1-based, not 0 based. - lineIndex = loc.start.line - 1, - line = contentLines[lineIndex]; - contentLines[lineIndex] = line.substring(0, startIndex) + - contentInsertion + - line.substring(startIndex, - line.length); - }; - - defineInfos.forEach(function (info) { - var deps, - contentInsertion = '', - depString = ''; - - //Do the modifications "backwards", in other words, start with the - //one that is farthest down and work up, so that the ranges in the - //defineInfos still apply. So that means deps, id, then namespace. - if (info.needsId && moduleName) { - contentInsertion += "'" + moduleName + "',"; - } - - if (info.depAction === 'scan') { - deps = parse.getAnonDepsFromNode(info.factoryNode); - - if (deps.length) { - depString = '[' + deps.map(function (dep) { - return "'" + dep + "'"; - }) + ']'; - } else { - depString = '[]'; - } - depString += ','; - - if (info.factoryNode) { - //Already have a named module, need to insert the - //dependencies after the name. - modLine(info.factoryNode.loc, depString); - } else { - contentInsertion += depString; - } - } - - if (contentInsertion) { - modLine(info.firstArgLoc, contentInsertion); - } - - //Do namespace last so that ui does not mess upthe parenRange - //used above. - if (namespace && !info.namespaceExists) { - modLine(info.defineLoc, namespace + '.'); - } - - //Notify any listener for the found info - if (onFound) { - onFound(info); - } - }); - - contents = contentLines.join('\n'); - - if (options.useSourceUrl) { - contents = 'eval("' + lang.jsEscape(contents) + - '\\n//# sourceURL=' + (path.indexOf('/') === 0 ? '' : '/') + - path + - '");\n'; - } - - return contents; - }, - - /** - * Modify the contents of a require.config/requirejs.config call. This - * call will LOSE any existing comments that are in the config string. - * - * @param {String} fileContents String that may contain a config call - * @param {Function} onConfig Function called when the first config - * call is found. It will be passed an Object which is the current - * config, and the onConfig function should return an Object to use - * as the config. - * @return {String} the fileContents with the config changes applied. - */ - modifyConfig: function (fileContents, onConfig) { - var details = parse.findConfig(fileContents), - config = details.config; - - if (config) { - config = onConfig(config); - if (config) { - return transform.serializeConfig(config, - fileContents, - details.range[0], - details.range[1], - { - quote: details.quote - }); - } - } - - return fileContents; - }, - - serializeConfig: function (config, fileContents, start, end, options) { - //Calculate base level of indent - var indent, match, configString, outDentRegExp, - baseIndent = '', - startString = fileContents.substring(0, start), - existingConfigString = fileContents.substring(start, end), - lineReturn = existingConfigString.indexOf('\r') === -1 ? '\n' : '\r\n', - lastReturnIndex = startString.lastIndexOf('\n'); - - //Get the basic amount of indent for the require config call. - if (lastReturnIndex === -1) { - lastReturnIndex = 0; - } - - match = baseIndentRegExp.exec(startString.substring(lastReturnIndex + 1, start)); - if (match && match[1]) { - baseIndent = match[1]; - } - - //Calculate internal indentation for config - match = indentRegExp.exec(existingConfigString); - if (match && match[1]) { - indent = match[1]; - } - - if (!indent || indent.length < baseIndent) { - indent = ' '; - } else { - indent = indent.substring(baseIndent.length); - } - - outDentRegExp = new RegExp('(' + lineReturn + ')' + indent, 'g'); - - configString = transform.objectToString(config, { - indent: indent, - lineReturn: lineReturn, - outDentRegExp: outDentRegExp, - quote: options && options.quote - }); - - //Add in the base indenting level. - configString = applyIndent(configString, baseIndent, lineReturn); - - return startString + configString + fileContents.substring(end); - }, - - /** - * Tries converting a JS object to a string. This will likely suck, and - * is tailored to the type of config expected in a loader config call. - * So, hasOwnProperty fields, strings, numbers, arrays and functions, - * no weird recursively referenced stuff. - * @param {Object} obj the object to convert - * @param {Object} options options object with the following values: - * {String} indent the indentation to use for each level - * {String} lineReturn the type of line return to use - * {outDentRegExp} outDentRegExp the regexp to use to outdent functions - * {String} quote the quote type to use, ' or ". Optional. Default is " - * @param {String} totalIndent the total indent to print for this level - * @return {String} a string representation of the object. - */ - objectToString: function (obj, options, totalIndent) { - var startBrace, endBrace, nextIndent, - first = true, - value = '', - lineReturn = options.lineReturn, - indent = options.indent, - outDentRegExp = options.outDentRegExp, - quote = options.quote || '"'; - - totalIndent = totalIndent || ''; - nextIndent = totalIndent + indent; - - if (obj === null) { - value = 'null'; - } else if (obj === undefined) { - value = 'undefined'; - } else if (typeof obj === 'number' || typeof obj === 'boolean') { - value = obj; - } else if (typeof obj === 'string') { - //Use double quotes in case the config may also work as JSON. - value = quote + lang.jsEscape(obj) + quote; - } else if (lang.isArray(obj)) { - lang.each(obj, function (item, i) { - value += (i !== 0 ? ',' + lineReturn : '' ) + - nextIndent + - transform.objectToString(item, - options, - nextIndent); - }); - - startBrace = '['; - endBrace = ']'; - } else if (lang.isFunction(obj) || lang.isRegExp(obj)) { - //The outdent regexp just helps pretty up the conversion - //just in node. Rhino strips comments and does a different - //indent scheme for Function toString, so not really helpful - //there. - value = obj.toString().replace(outDentRegExp, '$1'); - } else { - //An object - lang.eachProp(obj, function (v, prop) { - value += (first ? '': ',' + lineReturn) + - nextIndent + - (keyRegExp.test(prop) ? prop : quote + lang.jsEscape(prop) + quote )+ - ': ' + - transform.objectToString(v, - options, - nextIndent); - first = false; - }); - startBrace = '{'; - endBrace = '}'; - } - - if (startBrace) { - value = startBrace + - lineReturn + - value + - lineReturn + totalIndent + - endBrace; - } - - return value; - } - }; - - return transform; -}); -/** - * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ - -/*jslint regexp: true, plusplus: true */ -/*global define: false */ - -define('pragma', ['parse', 'logger'], function (parse, logger) { - 'use strict'; - function Temp() {} - - function create(obj, mixin) { - Temp.prototype = obj; - var temp = new Temp(), prop; - - //Avoid any extra memory hanging around - Temp.prototype = null; - - if (mixin) { - for (prop in mixin) { - if (mixin.hasOwnProperty(prop) && !temp.hasOwnProperty(prop)) { - temp[prop] = mixin[prop]; - } - } - } - - return temp; // Object - } - - var pragma = { - conditionalRegExp: /(exclude|include)Start\s*\(\s*["'](\w+)["']\s*,(.*)\)/, - useStrictRegExp: /['"]use strict['"];/g, - hasRegExp: /has\s*\(\s*['"]([^'"]+)['"]\s*\)/g, - configRegExp: /(^|[^\.])(requirejs|require)(\.config)\s*\(/g, - nsWrapRegExp: /\/\*requirejs namespace: true \*\//, - apiDefRegExp: /var requirejs, require, define;/, - defineCheckRegExp: /typeof\s+define\s*===\s*["']function["']\s*&&\s*define\s*\.\s*amd/g, - defineStringCheckRegExp: /typeof\s+define\s*===\s*["']function["']\s*&&\s*define\s*\[\s*["']amd["']\s*\]/g, - defineTypeFirstCheckRegExp: /\s*["']function["']\s*===\s*typeof\s+define\s*&&\s*define\s*\.\s*amd/g, - defineJQueryRegExp: /typeof\s+define\s*===\s*["']function["']\s*&&\s*define\s*\.\s*amd\s*&&\s*define\s*\.\s*amd\s*\.\s*jQuery/g, - defineHasRegExp: /typeof\s+define\s*==(=)?\s*['"]function['"]\s*&&\s*typeof\s+define\.amd\s*==(=)?\s*['"]object['"]\s*&&\s*define\.amd/g, - defineTernaryRegExp: /typeof\s+define\s*===\s*['"]function["']\s*&&\s*define\s*\.\s*amd\s*\?\s*define/, - amdefineRegExp: /if\s*\(\s*typeof define\s*\!==\s*'function'\s*\)\s*\{\s*[^\{\}]+amdefine[^\{\}]+\}/g, - - removeStrict: function (contents, config) { - return config.useStrict ? contents : contents.replace(pragma.useStrictRegExp, ''); - }, - - namespace: function (fileContents, ns, onLifecycleName) { - if (ns) { - //Namespace require/define calls - fileContents = fileContents.replace(pragma.configRegExp, '$1' + ns + '.$2$3('); - - - fileContents = parse.renameNamespace(fileContents, ns); - - //Namespace define ternary use: - fileContents = fileContents.replace(pragma.defineTernaryRegExp, - "typeof " + ns + ".define === 'function' && " + ns + ".define.amd ? " + ns + ".define"); - - //Namespace define jquery use: - fileContents = fileContents.replace(pragma.defineJQueryRegExp, - "typeof " + ns + ".define === 'function' && " + ns + ".define.amd && " + ns + ".define.amd.jQuery"); - - //Namespace has.js define use: - fileContents = fileContents.replace(pragma.defineHasRegExp, - "typeof " + ns + ".define === 'function' && typeof " + ns + ".define.amd === 'object' && " + ns + ".define.amd"); - - //Namespace define checks. - //Do these ones last, since they are a subset of the more specific - //checks above. - fileContents = fileContents.replace(pragma.defineCheckRegExp, - "typeof " + ns + ".define === 'function' && " + ns + ".define.amd"); - fileContents = fileContents.replace(pragma.defineStringCheckRegExp, - "typeof " + ns + ".define === 'function' && " + ns + ".define['amd']"); - fileContents = fileContents.replace(pragma.defineTypeFirstCheckRegExp, - "'function' === typeof " + ns + ".define && " + ns + ".define.amd"); - - //Check for require.js with the require/define definitions - if (pragma.apiDefRegExp.test(fileContents) && - fileContents.indexOf("if (!" + ns + " || !" + ns + ".requirejs)") === -1) { - //Wrap the file contents in a typeof check, and a function - //to contain the API globals. - fileContents = "var " + ns + ";(function () { if (!" + ns + " || !" + ns + ".requirejs) {\n" + - "if (!" + ns + ") { " + ns + ' = {}; } else { require = ' + ns + '; }\n' + - fileContents + - "\n" + - ns + ".requirejs = requirejs;" + - ns + ".require = require;" + - ns + ".define = define;\n" + - "}\n}());"; - } - - //Finally, if the file wants a special wrapper because it ties - //in to the requirejs internals in a way that would not fit - //the above matches, do that. Look for /*requirejs namespace: true*/ - if (pragma.nsWrapRegExp.test(fileContents)) { - //Remove the pragma. - fileContents = fileContents.replace(pragma.nsWrapRegExp, ''); - - //Alter the contents. - fileContents = '(function () {\n' + - 'var require = ' + ns + '.require,' + - 'requirejs = ' + ns + '.requirejs,' + - 'define = ' + ns + '.define;\n' + - fileContents + - '\n}());'; - } - } - - return fileContents; - }, - - /** - * processes the fileContents for some //>> conditional statements - */ - process: function (fileName, fileContents, config, onLifecycleName, pluginCollector) { - /*jslint evil: true */ - var foundIndex = -1, startIndex = 0, lineEndIndex, conditionLine, - matches, type, marker, condition, isTrue, endRegExp, endMatches, - endMarkerIndex, shouldInclude, startLength, lifecycleHas, deps, - i, dep, moduleName, collectorMod, - lifecyclePragmas, pragmas = config.pragmas, hasConfig = config.has, - //Legacy arg defined to help in dojo conversion script. Remove later - //when dojo no longer needs conversion: - kwArgs = pragmas; - - //Mix in a specific lifecycle scoped object, to allow targeting - //some pragmas/has tests to only when files are saved, or at different - //lifecycle events. Do not bother with kwArgs in this section, since - //the old dojo kwArgs were for all points in the build lifecycle. - if (onLifecycleName) { - lifecyclePragmas = config['pragmas' + onLifecycleName]; - lifecycleHas = config['has' + onLifecycleName]; - - if (lifecyclePragmas) { - pragmas = create(pragmas || {}, lifecyclePragmas); - } - - if (lifecycleHas) { - hasConfig = create(hasConfig || {}, lifecycleHas); - } - } - - //Replace has references if desired - if (hasConfig) { - fileContents = fileContents.replace(pragma.hasRegExp, function (match, test) { - if (hasConfig.hasOwnProperty(test)) { - return !!hasConfig[test]; - } - return match; - }); - } - - if (!config.skipPragmas) { - - while ((foundIndex = fileContents.indexOf("//>>", startIndex)) !== -1) { - //Found a conditional. Get the conditional line. - lineEndIndex = fileContents.indexOf("\n", foundIndex); - if (lineEndIndex === -1) { - lineEndIndex = fileContents.length - 1; - } - - //Increment startIndex past the line so the next conditional search can be done. - startIndex = lineEndIndex + 1; - - //Break apart the conditional. - conditionLine = fileContents.substring(foundIndex, lineEndIndex + 1); - matches = conditionLine.match(pragma.conditionalRegExp); - if (matches) { - type = matches[1]; - marker = matches[2]; - condition = matches[3]; - isTrue = false; - //See if the condition is true. - try { - isTrue = !!eval("(" + condition + ")"); - } catch (e) { - throw "Error in file: " + - fileName + - ". Conditional comment: " + - conditionLine + - " failed with this error: " + e; - } - - //Find the endpoint marker. - endRegExp = new RegExp('\\/\\/\\>\\>\\s*' + type + 'End\\(\\s*[\'"]' + marker + '[\'"]\\s*\\)', "g"); - endMatches = endRegExp.exec(fileContents.substring(startIndex, fileContents.length)); - if (endMatches) { - endMarkerIndex = startIndex + endRegExp.lastIndex - endMatches[0].length; - - //Find the next line return based on the match position. - lineEndIndex = fileContents.indexOf("\n", endMarkerIndex); - if (lineEndIndex === -1) { - lineEndIndex = fileContents.length - 1; - } - - //Should we include the segment? - shouldInclude = ((type === "exclude" && !isTrue) || (type === "include" && isTrue)); - - //Remove the conditional comments, and optionally remove the content inside - //the conditional comments. - startLength = startIndex - foundIndex; - fileContents = fileContents.substring(0, foundIndex) + - (shouldInclude ? fileContents.substring(startIndex, endMarkerIndex) : "") + - fileContents.substring(lineEndIndex + 1, fileContents.length); - - //Move startIndex to foundIndex, since that is the new position in the file - //where we need to look for more conditionals in the next while loop pass. - startIndex = foundIndex; - } else { - throw "Error in file: " + - fileName + - ". Cannot find end marker for conditional comment: " + - conditionLine; - - } - } - } - } - - //If need to find all plugin resources to optimize, do that now, - //before namespacing, since the namespacing will change the API - //names. - //If there is a plugin collector, scan the file for plugin resources. - if (config.optimizeAllPluginResources && pluginCollector) { - try { - deps = parse.findDependencies(fileName, fileContents); - if (deps.length) { - for (i = 0; i < deps.length; i++) { - dep = deps[i]; - if (dep.indexOf('!') !== -1) { - moduleName = dep.split('!')[0]; - collectorMod = pluginCollector[moduleName]; - if (!collectorMod) { - collectorMod = pluginCollector[moduleName] = []; - } - collectorMod.push(dep); - } - } - } - } catch (eDep) { - logger.error('Parse error looking for plugin resources in ' + - fileName + ', skipping.'); - } - } - - //Strip amdefine use for node-shared modules. - fileContents = fileContents.replace(pragma.amdefineRegExp, ''); - - //Do namespacing - if (onLifecycleName === 'OnSave' && config.namespace) { - fileContents = pragma.namespace(fileContents, config.namespace, onLifecycleName); - } - - - return pragma.removeStrict(fileContents, config); - } - }; - - return pragma; -}); -if(env === 'browser') { -/** - * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ - -/*jslint strict: false */ -/*global define: false */ - -define('browser/optimize', {}); - -} - -if(env === 'node') { -/** - * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ - -/*jslint strict: false */ -/*global define: false */ - -define('node/optimize', {}); - -} - -if(env === 'rhino') { -/** - * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ - -/*jslint sloppy: true, plusplus: true */ -/*global define, java, Packages, com */ - -define('rhino/optimize', ['logger', 'env!env/file'], function (logger, file) { - - //Add .reduce to Rhino so UglifyJS can run in Rhino, - //inspired by https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/reduce - //but rewritten for brevity, and to be good enough for use by UglifyJS. - if (!Array.prototype.reduce) { - Array.prototype.reduce = function (fn /*, initialValue */) { - var i = 0, - length = this.length, - accumulator; - - if (arguments.length >= 2) { - accumulator = arguments[1]; - } else { - if (length) { - while (!(i in this)) { - i++; - } - accumulator = this[i++]; - } - } - - for (; i < length; i++) { - if (i in this) { - accumulator = fn.call(undefined, accumulator, this[i], i, this); - } - } - - return accumulator; - }; - } - - var JSSourceFilefromCode, optimize, - mapRegExp = /"file":"[^"]+"/; - - //Bind to Closure compiler, but if it is not available, do not sweat it. - try { - JSSourceFilefromCode = java.lang.Class.forName('com.google.javascript.jscomp.JSSourceFile').getMethod('fromCode', [java.lang.String, java.lang.String]); - } catch (e) {} - - //Helper for closure compiler, because of weird Java-JavaScript interactions. - function closurefromCode(filename, content) { - return JSSourceFilefromCode.invoke(null, [filename, content]); - } - - - function getFileWriter(fileName, encoding) { - var outFile = new java.io.File(fileName), outWriter, parentDir; - - parentDir = outFile.getAbsoluteFile().getParentFile(); - if (!parentDir.exists()) { - if (!parentDir.mkdirs()) { - throw "Could not create directory: " + parentDir.getAbsolutePath(); - } - } - - if (encoding) { - outWriter = new java.io.OutputStreamWriter(new java.io.FileOutputStream(outFile), encoding); - } else { - outWriter = new java.io.OutputStreamWriter(new java.io.FileOutputStream(outFile)); - } - - return new java.io.BufferedWriter(outWriter); - } - - optimize = { - closure: function (fileName, fileContents, outFileName, keepLines, config) { - config = config || {}; - var result, mappings, optimized, compressed, baseName, writer, - outBaseName, outFileNameMap, outFileNameMapContent, - jscomp = Packages.com.google.javascript.jscomp, - flags = Packages.com.google.common.flags, - //Fake extern - externSourceFile = closurefromCode("fakeextern.js", " "), - //Set up source input - jsSourceFile = closurefromCode(String(fileName), String(fileContents)), - options, option, FLAG_compilation_level, compiler, - Compiler = Packages.com.google.javascript.jscomp.Compiler; - - logger.trace("Minifying file: " + fileName); - - baseName = (new java.io.File(fileName)).getName(); - - //Set up options - options = new jscomp.CompilerOptions(); - for (option in config.CompilerOptions) { - // options are false by default and jslint wanted an if statement in this for loop - if (config.CompilerOptions[option]) { - options[option] = config.CompilerOptions[option]; - } - - } - options.prettyPrint = keepLines || options.prettyPrint; - - FLAG_compilation_level = jscomp.CompilationLevel[config.CompilationLevel || 'SIMPLE_OPTIMIZATIONS']; - FLAG_compilation_level.setOptionsForCompilationLevel(options); - - if (config.generateSourceMaps) { - mappings = new java.util.ArrayList(); - - mappings.add(new com.google.javascript.jscomp.SourceMap.LocationMapping(fileName, baseName + ".src")); - options.setSourceMapLocationMappings(mappings); - options.setSourceMapOutputPath(fileName + ".map"); - } - - //Trigger the compiler - Compiler.setLoggingLevel(Packages.java.util.logging.Level[config.loggingLevel || 'WARNING']); - compiler = new Compiler(); - - result = compiler.compile(externSourceFile, jsSourceFile, options); - if (result.success) { - optimized = String(compiler.toSource()); - - if (config.generateSourceMaps && result.sourceMap && outFileName) { - outBaseName = (new java.io.File(outFileName)).getName(); - - file.saveUtf8File(outFileName + ".src", fileContents); - - outFileNameMap = outFileName + ".map"; - writer = getFileWriter(outFileNameMap, "utf-8"); - result.sourceMap.appendTo(writer, outFileName); - writer.close(); - - //Not sure how better to do this, but right now the .map file - //leaks the full OS path in the "file" property. Manually - //modify it to not do that. - file.saveFile(outFileNameMap, - file.readFile(outFileNameMap).replace(mapRegExp, '"file":"' + baseName + '"')); - - fileContents = optimized + "\n//# sourceMappingURL=" + outBaseName + ".map"; - } else { - fileContents = optimized; - } - return fileContents; - } else { - throw new Error('Cannot closure compile file: ' + fileName + '. Skipping it.'); - } - - return fileContents; - } - }; - - return optimize; -}); -} - -if(env === 'xpconnect') { -define('xpconnect/optimize', {}); -} -/** - * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ - -/*jslint plusplus: true, nomen: true, regexp: true */ -/*global define: false */ - -define('optimize', [ 'lang', 'logger', 'env!env/optimize', 'env!env/file', 'parse', - 'pragma', 'uglifyjs/index', 'uglifyjs2', - 'source-map'], -function (lang, logger, envOptimize, file, parse, - pragma, uglify, uglify2, - sourceMap) { - 'use strict'; - - var optimize, - cssImportRegExp = /\@import\s+(url\()?\s*([^);]+)\s*(\))?([\w, ]*)(;)?/ig, - cssCommentImportRegExp = /\/\*[^\*]*@import[^\*]*\*\//g, - cssUrlRegExp = /\url\(\s*([^\)]+)\s*\)?/g, - SourceMapGenerator = sourceMap.SourceMapGenerator, - SourceMapConsumer =sourceMap.SourceMapConsumer; - - /** - * If an URL from a CSS url value contains start/end quotes, remove them. - * This is not done in the regexp, since my regexp fu is not that strong, - * and the CSS spec allows for ' and " in the URL if they are backslash escaped. - * @param {String} url - */ - function cleanCssUrlQuotes(url) { - //Make sure we are not ending in whitespace. - //Not very confident of the css regexps above that there will not be ending - //whitespace. - url = url.replace(/\s+$/, ""); - - if (url.charAt(0) === "'" || url.charAt(0) === "\"") { - url = url.substring(1, url.length - 1); - } - - return url; - } - - /** - * Inlines nested stylesheets that have @import calls in them. - * @param {String} fileName the file name - * @param {String} fileContents the file contents - * @param {String} cssImportIgnore comma delimited string of files to ignore - * @param {String} cssPrefix string to be prefixed before relative URLs - * @param {Object} included an object used to track the files already imported - */ - function flattenCss(fileName, fileContents, cssImportIgnore, cssPrefix, included) { - //Find the last slash in the name. - fileName = fileName.replace(lang.backSlashRegExp, "/"); - var endIndex = fileName.lastIndexOf("/"), - //Make a file path based on the last slash. - //If no slash, so must be just a file name. Use empty string then. - filePath = (endIndex !== -1) ? fileName.substring(0, endIndex + 1) : "", - //store a list of merged files - importList = [], - skippedList = []; - - //First make a pass by removing an commented out @import calls. - fileContents = fileContents.replace(cssCommentImportRegExp, ''); - - //Make sure we have a delimited ignore list to make matching faster - if (cssImportIgnore && cssImportIgnore.charAt(cssImportIgnore.length - 1) !== ",") { - cssImportIgnore += ","; - } - - fileContents = fileContents.replace(cssImportRegExp, function (fullMatch, urlStart, importFileName, urlEnd, mediaTypes) { - //Only process media type "all" or empty media type rules. - if (mediaTypes && ((mediaTypes.replace(/^\s\s*/, '').replace(/\s\s*$/, '')) !== "all")) { - skippedList.push(fileName); - return fullMatch; - } - - importFileName = cleanCssUrlQuotes(importFileName); - - //Ignore the file import if it is part of an ignore list. - if (cssImportIgnore && cssImportIgnore.indexOf(importFileName + ",") !== -1) { - return fullMatch; - } - - //Make sure we have a unix path for the rest of the operation. - importFileName = importFileName.replace(lang.backSlashRegExp, "/"); - - try { - //if a relative path, then tack on the filePath. - //If it is not a relative path, then the readFile below will fail, - //and we will just skip that import. - var fullImportFileName = importFileName.charAt(0) === "/" ? importFileName : filePath + importFileName, - importContents = file.readFile(fullImportFileName), i, - importEndIndex, importPath, fixedUrlMatch, colonIndex, parts, flat; - - //Skip the file if it has already been included. - if (included[fullImportFileName]) { - return ''; - } - included[fullImportFileName] = true; - - //Make sure to flatten any nested imports. - flat = flattenCss(fullImportFileName, importContents, cssImportIgnore, cssPrefix, included); - importContents = flat.fileContents; - - if (flat.importList.length) { - importList.push.apply(importList, flat.importList); - } - if (flat.skippedList.length) { - skippedList.push.apply(skippedList, flat.skippedList); - } - - //Make the full import path - importEndIndex = importFileName.lastIndexOf("/"); - - //Make a file path based on the last slash. - //If no slash, so must be just a file name. Use empty string then. - importPath = (importEndIndex !== -1) ? importFileName.substring(0, importEndIndex + 1) : ""; - - //fix url() on relative import (#5) - importPath = importPath.replace(/^\.\//, ''); - - //Modify URL paths to match the path represented by this file. - importContents = importContents.replace(cssUrlRegExp, function (fullMatch, urlMatch) { - fixedUrlMatch = cleanCssUrlQuotes(urlMatch); - fixedUrlMatch = fixedUrlMatch.replace(lang.backSlashRegExp, "/"); - - //Only do the work for relative URLs. Skip things that start with / or have - //a protocol. - colonIndex = fixedUrlMatch.indexOf(":"); - if (fixedUrlMatch.charAt(0) !== "/" && (colonIndex === -1 || colonIndex > fixedUrlMatch.indexOf("/"))) { - //It is a relative URL, tack on the cssPrefix and path prefix - urlMatch = cssPrefix + importPath + fixedUrlMatch; - - } else { - logger.trace(importFileName + "\n URL not a relative URL, skipping: " + urlMatch); - } - - //Collapse .. and . - parts = urlMatch.split("/"); - for (i = parts.length - 1; i > 0; i--) { - if (parts[i] === ".") { - parts.splice(i, 1); - } else if (parts[i] === "..") { - if (i !== 0 && parts[i - 1] !== "..") { - parts.splice(i - 1, 2); - i -= 1; - } - } - } - - return "url(" + parts.join("/") + ")"; - }); - - importList.push(fullImportFileName); - return importContents; - } catch (e) { - logger.warn(fileName + "\n Cannot inline css import, skipping: " + importFileName); - return fullMatch; - } - }); - - return { - importList : importList, - skippedList: skippedList, - fileContents : fileContents - }; - } - - optimize = { - /** - * Optimizes a file that contains JavaScript content. Optionally collects - * plugin resources mentioned in a file, and then passes the content - * through an minifier if one is specified via config.optimize. - * - * @param {String} fileName the name of the file to optimize - * @param {String} fileContents the contents to optimize. If this is - * a null value, then fileName will be used to read the fileContents. - * @param {String} outFileName the name of the file to use for the - * saved optimized content. - * @param {Object} config the build config object. - * @param {Array} [pluginCollector] storage for any plugin resources - * found. - */ - jsFile: function (fileName, fileContents, outFileName, config, pluginCollector) { - if (!fileContents) { - fileContents = file.readFile(fileName); - } - - fileContents = optimize.js(fileName, fileContents, outFileName, config, pluginCollector); - - file.saveUtf8File(outFileName, fileContents); - }, - - /** - * Optimizes a file that contains JavaScript content. Optionally collects - * plugin resources mentioned in a file, and then passes the content - * through an minifier if one is specified via config.optimize. - * - * @param {String} fileName the name of the file that matches the - * fileContents. - * @param {String} fileContents the string of JS to optimize. - * @param {Object} [config] the build config object. - * @param {Array} [pluginCollector] storage for any plugin resources - * found. - */ - js: function (fileName, fileContents, outFileName, config, pluginCollector) { - var optFunc, optConfig, - parts = (String(config.optimize)).split('.'), - optimizerName = parts[0], - keepLines = parts[1] === 'keepLines', - licenseContents = ''; - - config = config || {}; - - //Apply pragmas/namespace renaming - fileContents = pragma.process(fileName, fileContents, config, 'OnSave', pluginCollector); - - //Optimize the JS files if asked. - if (optimizerName && optimizerName !== 'none') { - optFunc = envOptimize[optimizerName] || optimize.optimizers[optimizerName]; - if (!optFunc) { - throw new Error('optimizer with name of "' + - optimizerName + - '" not found for this environment'); - } - - optConfig = config[optimizerName] || {}; - if (config.generateSourceMaps) { - optConfig.generateSourceMaps = !!config.generateSourceMaps; - } - - try { - if (config.preserveLicenseComments) { - //Pull out any license comments for prepending after optimization. - try { - licenseContents = parse.getLicenseComments(fileName, fileContents); - } catch (e) { - throw new Error('Cannot parse file: ' + fileName + ' for comments. Skipping it. Error is:\n' + e.toString()); - } - } - - fileContents = licenseContents + optFunc(fileName, - fileContents, - outFileName, - keepLines, - optConfig); - } catch (e) { - if (config.throwWhen && config.throwWhen.optimize) { - throw e; - } else { - logger.error(e); - } - } - } - - return fileContents; - }, - - /** - * Optimizes one CSS file, inlining @import calls, stripping comments, and - * optionally removes line returns. - * @param {String} fileName the path to the CSS file to optimize - * @param {String} outFileName the path to save the optimized file. - * @param {Object} config the config object with the optimizeCss and - * cssImportIgnore options. - */ - cssFile: function (fileName, outFileName, config) { - - //Read in the file. Make sure we have a JS string. - var originalFileContents = file.readFile(fileName), - flat = flattenCss(fileName, originalFileContents, config.cssImportIgnore, config.cssPrefix, {}), - //Do not use the flattened CSS if there was one that was skipped. - fileContents = flat.skippedList.length ? originalFileContents : flat.fileContents, - startIndex, endIndex, buildText, comment; - - if (flat.skippedList.length) { - logger.warn('Cannot inline @imports for ' + fileName + - ',\nthe following files had media queries in them:\n' + - flat.skippedList.join('\n')); - } - - //Do comment removal. - try { - if (config.optimizeCss.indexOf(".keepComments") === -1) { - startIndex = 0; - //Get rid of comments. - while ((startIndex = fileContents.indexOf("/*", startIndex)) !== -1) { - endIndex = fileContents.indexOf("*/", startIndex + 2); - if (endIndex === -1) { - throw "Improper comment in CSS file: " + fileName; - } - comment = fileContents.substring(startIndex, endIndex); - - if (config.preserveLicenseComments && - (comment.indexOf('license') !== -1 || - comment.indexOf('opyright') !== -1 || - comment.indexOf('(c)') !== -1)) { - //Keep the comment, just increment the startIndex - startIndex = endIndex; - } else { - fileContents = fileContents.substring(0, startIndex) + fileContents.substring(endIndex + 2, fileContents.length); - startIndex = 0; - } - } - } - //Get rid of newlines. - if (config.optimizeCss.indexOf(".keepLines") === -1) { - fileContents = fileContents.replace(/[\r\n]/g, ""); - fileContents = fileContents.replace(/\s+/g, " "); - fileContents = fileContents.replace(/\{\s/g, "{"); - fileContents = fileContents.replace(/\s\}/g, "}"); - } else { - //Remove multiple empty lines. - fileContents = fileContents.replace(/(\r\n)+/g, "\r\n"); - fileContents = fileContents.replace(/(\n)+/g, "\n"); - } - } catch (e) { - fileContents = originalFileContents; - logger.error("Could not optimized CSS file: " + fileName + ", error: " + e); - } - - file.saveUtf8File(outFileName, fileContents); - - //text output to stdout and/or written to build.txt file - buildText = "\n"+ outFileName.replace(config.dir, "") +"\n----------------\n"; - flat.importList.push(fileName); - buildText += flat.importList.map(function(path){ - return path.replace(config.dir, ""); - }).join("\n"); - - return { - importList: flat.importList, - buildText: buildText +"\n" - }; - }, - - /** - * Optimizes CSS files, inlining @import calls, stripping comments, and - * optionally removes line returns. - * @param {String} startDir the path to the top level directory - * @param {Object} config the config object with the optimizeCss and - * cssImportIgnore options. - */ - css: function (startDir, config) { - var buildText = "", - importList = [], - shouldRemove = config.dir && config.removeCombined, - i, fileName, result, fileList; - if (config.optimizeCss.indexOf("standard") !== -1) { - fileList = file.getFilteredFileList(startDir, /\.css$/, true); - if (fileList) { - for (i = 0; i < fileList.length; i++) { - fileName = fileList[i]; - logger.trace("Optimizing (" + config.optimizeCss + ") CSS file: " + fileName); - result = optimize.cssFile(fileName, fileName, config); - buildText += result.buildText; - if (shouldRemove) { - result.importList.pop(); - importList = importList.concat(result.importList); - } - } - } - - if (shouldRemove) { - importList.forEach(function (path) { - if (file.exists(path)) { - file.deleteFile(path); - } - }); - } - } - return buildText; - }, - - optimizers: { - uglify: function (fileName, fileContents, outFileName, keepLines, config) { - var parser = uglify.parser, - processor = uglify.uglify, - ast, errMessage, errMatch; - - config = config || {}; - - logger.trace("Uglifying file: " + fileName); - - try { - ast = parser.parse(fileContents, config.strict_semicolons); - if (config.no_mangle !== true) { - ast = processor.ast_mangle(ast, config); - } - ast = processor.ast_squeeze(ast, config); - - fileContents = processor.gen_code(ast, config); - - if (config.max_line_length) { - fileContents = processor.split_lines(fileContents, config.max_line_length); - } - - //Add trailing semicolon to match uglifyjs command line version - fileContents += ';'; - } catch (e) { - errMessage = e.toString(); - errMatch = /\nError(\r)?\n/.exec(errMessage); - if (errMatch) { - errMessage = errMessage.substring(0, errMatch.index); - } - throw new Error('Cannot uglify file: ' + fileName + '. Skipping it. Error is:\n' + errMessage); - } - return fileContents; - }, - uglify2: function (fileName, fileContents, outFileName, keepLines, config) { - var result, existingMap, resultMap, finalMap, sourceIndex, - uconfig = {}, - existingMapPath = outFileName + '.map', - baseName = fileName && fileName.split('/').pop(); - - config = config || {}; - - lang.mixin(uconfig, config, true); - - uconfig.fromString = true; - - if (config.generateSourceMaps && outFileName) { - uconfig.outSourceMap = baseName; - - if (file.exists(existingMapPath)) { - uconfig.inSourceMap = existingMapPath; - existingMap = JSON.parse(file.readFile(existingMapPath)); - } - } - - logger.trace("Uglify2 file: " + fileName); - - try { - //var tempContents = fileContents.replace(/\/\/\# sourceMappingURL=.*$/, ''); - result = uglify2.minify(fileContents, uconfig, baseName + '.src.js'); - if (uconfig.outSourceMap && result.map) { - resultMap = result.map; - if (existingMap) { - resultMap = JSON.parse(resultMap); - finalMap = SourceMapGenerator.fromSourceMap(new SourceMapConsumer(resultMap)); - finalMap.applySourceMap(new SourceMapConsumer(existingMap)); - resultMap = finalMap.toString(); - } else { - file.saveFile(outFileName + '.src.js', fileContents); - } - file.saveFile(outFileName + '.map', resultMap); - fileContents = result.code + "\n//# sourceMappingURL=" + baseName + ".map"; - } else { - fileContents = result.code; - } - } catch (e) { - throw new Error('Cannot uglify2 file: ' + fileName + '. Skipping it. Error is:\n' + e.toString()); - } - return fileContents; - } - } - }; - - return optimize; -}); -/** - * @license RequireJS Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ -/* - * This file patches require.js to communicate with the build system. - */ - -//Using sloppy since this uses eval for some code like plugins, -//which may not be strict mode compliant. So if use strict is used -//below they will have strict rules applied and may cause an error. -/*jslint sloppy: true, nomen: true, plusplus: true, regexp: true */ -/*global require, define: true */ - -//NOT asking for require as a dependency since the goal is to modify the -//global require below -define('requirePatch', [ 'env!env/file', 'pragma', 'parse', 'lang', 'logger', 'commonJs', 'prim'], function ( - file, - pragma, - parse, - lang, - logger, - commonJs, - prim -) { - - var allowRun = true, - hasProp = lang.hasProp, - falseProp = lang.falseProp, - getOwn = lang.getOwn; - - //This method should be called when the patches to require should take hold. - return function () { - if (!allowRun) { - return; - } - allowRun = false; - - var layer, - pluginBuilderRegExp = /(["']?)pluginBuilder(["']?)\s*[=\:]\s*["']([^'"\s]+)["']/, - oldNewContext = require.s.newContext, - oldDef, - - //create local undefined values for module and exports, - //so that when files are evaled in this function they do not - //see the node values used for r.js - exports, - module; - - /** - * Reset "global" build caches that are kept around between - * build layer builds. Useful to do when there are multiple - * top level requirejs.optimize() calls. - */ - require._cacheReset = function () { - //Stored raw text caches, used by browser use. - require._cachedRawText = {}; - //Stored cached file contents for reuse in other layers. - require._cachedFileContents = {}; - //Store which cached files contain a require definition. - require._cachedDefinesRequireUrls = {}; - }; - require._cacheReset(); - - /** - * Makes sure the URL is something that can be supported by the - * optimization tool. - * @param {String} url - * @returns {Boolean} - */ - require._isSupportedBuildUrl = function (url) { - //Ignore URLs with protocols, hosts or question marks, means either network - //access is needed to fetch it or it is too dynamic. Note that - //on Windows, full paths are used for some urls, which include - //the drive, like c:/something, so need to test for something other - //than just a colon. - if (url.indexOf("://") === -1 && url.indexOf("?") === -1 && - url.indexOf('empty:') !== 0 && url.indexOf('//') !== 0) { - return true; - } else { - if (!layer.ignoredUrls[url]) { - if (url.indexOf('empty:') === -1) { - logger.info('Cannot optimize network URL, skipping: ' + url); - } - layer.ignoredUrls[url] = true; - } - return false; - } - }; - - function normalizeUrlWithBase(context, moduleName, url) { - //Adjust the URL if it was not transformed to use baseUrl. - if (require.jsExtRegExp.test(moduleName)) { - url = (context.config.dir || context.config.dirBaseUrl) + url; - } - return url; - } - - //Overrides the new context call to add existing tracking features. - require.s.newContext = function (name) { - var context = oldNewContext(name), - oldEnable = context.enable, - moduleProto = context.Module.prototype, - oldInit = moduleProto.init, - oldCallPlugin = moduleProto.callPlugin; - - //Only do this for the context used for building. - if (name === '_') { - //For build contexts, do everything sync - context.nextTick = function (fn) { - fn(); - }; - - context.needFullExec = {}; - context.fullExec = {}; - context.plugins = {}; - context.buildShimExports = {}; - - //Override the shim exports function generator to just - //spit out strings that can be used in the stringified - //build output. - context.makeShimExports = function (value) { - function fn() { - return '(function (global) {\n' + - ' return function () {\n' + - ' var ret, fn;\n' + - (value.init ? - (' fn = ' + value.init.toString() + ';\n' + - ' ret = fn.apply(global, arguments);\n') : '') + - (value.exports ? - ' return ret || global.' + value.exports + ';\n' : - ' return ret;\n') + - ' };\n' + - '}(this))'; - } - - return fn; - }; - - context.enable = function (depMap, parent) { - var id = depMap.id, - parentId = parent && parent.map.id, - needFullExec = context.needFullExec, - fullExec = context.fullExec, - mod = getOwn(context.registry, id); - - if (mod && !mod.defined) { - if (parentId && getOwn(needFullExec, parentId)) { - needFullExec[id] = true; - } - - } else if ((getOwn(needFullExec, id) && falseProp(fullExec, id)) || - (parentId && getOwn(needFullExec, parentId) && - falseProp(fullExec, id))) { - context.require.undef(id); - } - - return oldEnable.apply(context, arguments); - }; - - //Override load so that the file paths can be collected. - context.load = function (moduleName, url) { - /*jslint evil: true */ - var contents, pluginBuilderMatch, builderName, - shim, shimExports; - - //Do not mark the url as fetched if it is - //not an empty: URL, used by the optimizer. - //In that case we need to be sure to call - //load() for each module that is mapped to - //empty: so that dependencies are satisfied - //correctly. - if (url.indexOf('empty:') === 0) { - delete context.urlFetched[url]; - } - - //Only handle urls that can be inlined, so that means avoiding some - //URLs like ones that require network access or may be too dynamic, - //like JSONP - if (require._isSupportedBuildUrl(url)) { - //Adjust the URL if it was not transformed to use baseUrl. - url = normalizeUrlWithBase(context, moduleName, url); - - //Save the module name to path and path to module name mappings. - layer.buildPathMap[moduleName] = url; - layer.buildFileToModule[url] = moduleName; - - if (hasProp(context.plugins, moduleName)) { - //plugins need to have their source evaled as-is. - context.needFullExec[moduleName] = true; - } - - prim().start(function () { - if (hasProp(require._cachedFileContents, url) && - (falseProp(context.needFullExec, moduleName) || - getOwn(context.fullExec, moduleName))) { - contents = require._cachedFileContents[url]; - - //If it defines require, mark it so it can be hoisted. - //Done here and in the else below, before the - //else block removes code from the contents. - //Related to #263 - if (!layer.existingRequireUrl && require._cachedDefinesRequireUrls[url]) { - layer.existingRequireUrl = url; - } - } else { - //Load the file contents, process for conditionals, then - //evaluate it. - return require._cacheReadAsync(url).then(function (text) { - contents = text; - - if (context.config.cjsTranslate && - (!context.config.shim || !lang.hasProp(context.config.shim, moduleName))) { - contents = commonJs.convert(url, contents); - } - - //If there is a read filter, run it now. - if (context.config.onBuildRead) { - contents = context.config.onBuildRead(moduleName, url, contents); - } - - contents = pragma.process(url, contents, context.config, 'OnExecute'); - - //Find out if the file contains a require() definition. Need to know - //this so we can inject plugins right after it, but before they are needed, - //and to make sure this file is first, so that define calls work. - try { - if (!layer.existingRequireUrl && parse.definesRequire(url, contents)) { - layer.existingRequireUrl = url; - require._cachedDefinesRequireUrls[url] = true; - } - } catch (e1) { - throw new Error('Parse error using esprima ' + - 'for file: ' + url + '\n' + e1); - } - }).then(function () { - if (hasProp(context.plugins, moduleName)) { - //This is a loader plugin, check to see if it has a build extension, - //otherwise the plugin will act as the plugin builder too. - pluginBuilderMatch = pluginBuilderRegExp.exec(contents); - if (pluginBuilderMatch) { - //Load the plugin builder for the plugin contents. - builderName = context.makeModuleMap(pluginBuilderMatch[3], - context.makeModuleMap(moduleName), - null, - true).id; - return require._cacheReadAsync(context.nameToUrl(builderName)); - } - } - return contents; - }).then(function (text) { - contents = text; - - //Parse out the require and define calls. - //Do this even for plugins in case they have their own - //dependencies that may be separate to how the pluginBuilder works. - try { - if (falseProp(context.needFullExec, moduleName)) { - contents = parse(moduleName, url, contents, { - insertNeedsDefine: true, - has: context.config.has, - findNestedDependencies: context.config.findNestedDependencies - }); - } - } catch (e2) { - throw new Error('Parse error using esprima ' + - 'for file: ' + url + '\n' + e2); - } - - require._cachedFileContents[url] = contents; - }); - } - }).then(function () { - if (contents) { - eval(contents); - } - - try { - //If have a string shim config, and this is - //a fully executed module, try to see if - //it created a variable in this eval scope - if (getOwn(context.needFullExec, moduleName)) { - shim = getOwn(context.config.shim, moduleName); - if (shim && shim.exports) { - shimExports = eval(shim.exports); - if (typeof shimExports !== 'undefined') { - context.buildShimExports[moduleName] = shimExports; - } - } - } - - //Need to close out completion of this module - //so that listeners will get notified that it is available. - context.completeLoad(moduleName); - } catch (e) { - //Track which module could not complete loading. - if (!e.moduleTree) { - e.moduleTree = []; - } - e.moduleTree.push(moduleName); - throw e; - } - }).then(null, function (eOuter) { - - if (!eOuter.fileName) { - eOuter.fileName = url; - } - throw eOuter; - }).end(); - } else { - //With unsupported URLs still need to call completeLoad to - //finish loading. - context.completeLoad(moduleName); - } - }; - - //Marks module has having a name, and optionally executes the - //callback, but only if it meets certain criteria. - context.execCb = function (name, cb, args, exports) { - var buildShimExports = getOwn(layer.context.buildShimExports, name); - - if (buildShimExports) { - return buildShimExports; - } else if (cb.__requireJsBuild || getOwn(layer.context.needFullExec, name)) { - return cb.apply(exports, args); - } - return undefined; - }; - - moduleProto.init = function (depMaps) { - if (context.needFullExec[this.map.id]) { - lang.each(depMaps, lang.bind(this, function (depMap) { - if (typeof depMap === 'string') { - depMap = context.makeModuleMap(depMap, - (this.map.isDefine ? this.map : this.map.parentMap)); - } - - if (!context.fullExec[depMap.id]) { - context.require.undef(depMap.id); - } - })); - } - - return oldInit.apply(this, arguments); - }; - - moduleProto.callPlugin = function () { - var map = this.map, - pluginMap = context.makeModuleMap(map.prefix), - pluginId = pluginMap.id, - pluginMod = getOwn(context.registry, pluginId); - - context.plugins[pluginId] = true; - context.needFullExec[pluginId] = true; - - //If the module is not waiting to finish being defined, - //undef it and start over, to get full execution. - if (falseProp(context.fullExec, pluginId) && (!pluginMod || pluginMod.defined)) { - context.require.undef(pluginMap.id); - } - - return oldCallPlugin.apply(this, arguments); - }; - } - - return context; - }; - - //Clear up the existing context so that the newContext modifications - //above will be active. - delete require.s.contexts._; - - /** Reset state for each build layer pass. */ - require._buildReset = function () { - var oldContext = require.s.contexts._; - - //Clear up the existing context. - delete require.s.contexts._; - - //Set up new context, so the layer object can hold onto it. - require({}); - - layer = require._layer = { - buildPathMap: {}, - buildFileToModule: {}, - buildFilePaths: [], - pathAdded: {}, - modulesWithNames: {}, - needsDefine: {}, - existingRequireUrl: "", - ignoredUrls: {}, - context: require.s.contexts._ - }; - - //Return the previous context in case it is needed, like for - //the basic config object. - return oldContext; - }; - - require._buildReset(); - - //Override define() to catch modules that just define an object, so that - //a dummy define call is not put in the build file for them. They do - //not end up getting defined via context.execCb, so we need to catch them - //at the define call. - oldDef = define; - - //This function signature does not have to be exact, just match what we - //are looking for. - define = function (name) { - if (typeof name === "string" && falseProp(layer.needsDefine, name)) { - layer.modulesWithNames[name] = true; - } - return oldDef.apply(require, arguments); - }; - - define.amd = oldDef.amd; - - //Add some utilities for plugins - require._readFile = file.readFile; - require._fileExists = function (path) { - return file.exists(path); - }; - - //Called when execManager runs for a dependency. Used to figure out - //what order of execution. - require.onResourceLoad = function (context, map) { - var id = map.id, - url; - - //If build needed a full execution, indicate it - //has been done now. But only do it if the context is tracking - //that. Only valid for the context used in a build, not for - //other contexts being run, like for useLib, plain requirejs - //use in node/rhino. - if (context.needFullExec && getOwn(context.needFullExec, id)) { - context.fullExec[id] = true; - } - - //A plugin. - if (map.prefix) { - if (falseProp(layer.pathAdded, id)) { - layer.buildFilePaths.push(id); - //For plugins the real path is not knowable, use the name - //for both module to file and file to module mappings. - layer.buildPathMap[id] = id; - layer.buildFileToModule[id] = id; - layer.modulesWithNames[id] = true; - layer.pathAdded[id] = true; - } - } else if (map.url && require._isSupportedBuildUrl(map.url)) { - //If the url has not been added to the layer yet, and it - //is from an actual file that was loaded, add it now. - url = normalizeUrlWithBase(context, id, map.url); - if (!layer.pathAdded[url] && getOwn(layer.buildPathMap, id)) { - //Remember the list of dependencies for this layer. - layer.buildFilePaths.push(url); - layer.pathAdded[url] = true; - } - } - }; - - //Called by output of the parse() function, when a file does not - //explicitly call define, probably just require, but the parse() - //function normalizes on define() for dependency mapping and file - //ordering works correctly. - require.needsDefine = function (moduleName) { - layer.needsDefine[moduleName] = true; - }; - }; -}); -/** - * @license RequireJS Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ - -/*jslint */ -/*global define: false, console: false */ - -define('commonJs', ['env!env/file', 'parse'], function (file, parse) { - 'use strict'; - var commonJs = { - //Set to false if you do not want this file to log. Useful in environments - //like node where you want the work to happen without noise. - useLog: true, - - convertDir: function (commonJsPath, savePath) { - var fileList, i, - jsFileRegExp = /\.js$/, - fileName, convertedFileName, fileContents; - - //Get list of files to convert. - fileList = file.getFilteredFileList(commonJsPath, /\w/, true); - - //Normalize on front slashes and make sure the paths do not end in a slash. - commonJsPath = commonJsPath.replace(/\\/g, "/"); - savePath = savePath.replace(/\\/g, "/"); - if (commonJsPath.charAt(commonJsPath.length - 1) === "/") { - commonJsPath = commonJsPath.substring(0, commonJsPath.length - 1); - } - if (savePath.charAt(savePath.length - 1) === "/") { - savePath = savePath.substring(0, savePath.length - 1); - } - - //Cycle through all the JS files and convert them. - if (!fileList || !fileList.length) { - if (commonJs.useLog) { - if (commonJsPath === "convert") { - //A request just to convert one file. - console.log('\n\n' + commonJs.convert(savePath, file.readFile(savePath))); - } else { - console.log("No files to convert in directory: " + commonJsPath); - } - } - } else { - for (i = 0; i < fileList.length; i++) { - fileName = fileList[i]; - convertedFileName = fileName.replace(commonJsPath, savePath); - - //Handle JS files. - if (jsFileRegExp.test(fileName)) { - fileContents = file.readFile(fileName); - fileContents = commonJs.convert(fileName, fileContents); - file.saveUtf8File(convertedFileName, fileContents); - } else { - //Just copy the file over. - file.copyFile(fileName, convertedFileName, true); - } - } - } - }, - - /** - * Does the actual file conversion. - * - * @param {String} fileName the name of the file. - * - * @param {String} fileContents the contents of a file :) - * - * @returns {String} the converted contents - */ - convert: function (fileName, fileContents) { - //Strip out comments. - try { - var preamble = '', - commonJsProps = parse.usesCommonJs(fileName, fileContents); - - //First see if the module is not already RequireJS-formatted. - if (parse.usesAmdOrRequireJs(fileName, fileContents) || !commonJsProps) { - return fileContents; - } - - if (commonJsProps.dirname || commonJsProps.filename) { - preamble = 'var __filename = module.uri || "", ' + - '__dirname = __filename.substring(0, __filename.lastIndexOf("/") + 1); '; - } - - //Construct the wrapper boilerplate. - fileContents = 'define(function (require, exports, module) {' + - preamble + - fileContents + - '\n});\n'; - - } catch (e) { - console.log("commonJs.convert: COULD NOT CONVERT: " + fileName + ", so skipping it. Error was: " + e); - return fileContents; - } - - return fileContents; - } - }; - - return commonJs; -}); -/** - * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ - -/*jslint plusplus: true, nomen: true, regexp: true */ -/*global define, requirejs */ - - -define('build', function (require) { - 'use strict'; - - var build, buildBaseConfig, - lang = require('lang'), - prim = require('prim'), - logger = require('logger'), - file = require('env!env/file'), - parse = require('parse'), - optimize = require('optimize'), - pragma = require('pragma'), - transform = require('transform'), - requirePatch = require('requirePatch'), - env = require('env'), - commonJs = require('commonJs'), - SourceMapGenerator = require('source-map/source-map-generator'), - hasProp = lang.hasProp, - getOwn = lang.getOwn, - falseProp = lang.falseProp, - endsWithSemiColonRegExp = /;\s*$/; - - prim.nextTick = function (fn) { - fn(); - }; - - //Now map require to the outermost requirejs, now that we have - //local dependencies for this module. The rest of the require use is - //manipulating the requirejs loader. - require = requirejs; - - //Caching function for performance. Attached to - //require so it can be reused in requirePatch.js. _cachedRawText - //set up by requirePatch.js - require._cacheReadAsync = function (path, encoding) { - var d; - - if (lang.hasProp(require._cachedRawText, path)) { - d = prim(); - d.resolve(require._cachedRawText[path]); - return d.promise; - } else { - return file.readFileAsync(path, encoding).then(function (text) { - require._cachedRawText[path] = text; - return text; - }); - } - }; - - buildBaseConfig = { - appDir: "", - pragmas: {}, - paths: {}, - optimize: "uglify", - optimizeCss: "standard.keepLines", - inlineText: true, - isBuild: true, - optimizeAllPluginResources: false, - findNestedDependencies: false, - preserveLicenseComments: true, - //By default, all files/directories are copied, unless - //they match this regexp, by default just excludes .folders - dirExclusionRegExp: file.dirExclusionRegExp, - _buildPathToModuleIndex: {} - }; - - /** - * Some JS may not be valid if concatenated with other JS, in particular - * the style of omitting semicolons and rely on ASI. Add a semicolon in - * those cases. - */ - function addSemiColon(text) { - if (endsWithSemiColonRegExp.test(text)) { - return text; - } else { - return text + ";"; - } - } - - function endsWithSlash(dirName) { - if (dirName.charAt(dirName.length - 1) !== "/") { - dirName += "/"; - } - return dirName; - } - - //Method used by plugin writeFile calls, defined up here to avoid - //jslint warning about "making a function in a loop". - function makeWriteFile(namespace, layer) { - function writeFile(name, contents) { - logger.trace('Saving plugin-optimized file: ' + name); - file.saveUtf8File(name, contents); - } - - writeFile.asModule = function (moduleName, fileName, contents) { - writeFile(fileName, - build.toTransport(namespace, moduleName, fileName, contents, layer)); - }; - - return writeFile; - } - - /** - * Main API entry point into the build. The args argument can either be - * an array of arguments (like the onese passed on a command-line), - * or it can be a JavaScript object that has the format of a build profile - * file. - * - * If it is an object, then in addition to the normal properties allowed in - * a build profile file, the object should contain one other property: - * - * The object could also contain a "buildFile" property, which is a string - * that is the file path to a build profile that contains the rest - * of the build profile directives. - * - * This function does not return a status, it should throw an error if - * there is a problem completing the build. - */ - build = function (args) { - var buildFile, cmdConfig, errorMsg, errorStack, stackMatch, errorTree, - i, j, errorMod, - stackRegExp = /( {4}at[^\n]+)\n/, - standardIndent = ' '; - - return prim().start(function () { - if (!args || lang.isArray(args)) { - if (!args || args.length < 1) { - logger.error("build.js buildProfile.js\n" + - "where buildProfile.js is the name of the build file (see example.build.js for hints on how to make a build file)."); - return undefined; - } - - //Next args can include a build file path as well as other build args. - //build file path comes first. If it does not contain an = then it is - //a build file path. Otherwise, just all build args. - if (args[0].indexOf("=") === -1) { - buildFile = args[0]; - args.splice(0, 1); - } - - //Remaining args are options to the build - cmdConfig = build.convertArrayToObject(args); - cmdConfig.buildFile = buildFile; - } else { - cmdConfig = args; - } - - return build._run(cmdConfig); - }).then(null, function (e) { - errorMsg = e.toString(); - errorTree = e.moduleTree; - stackMatch = stackRegExp.exec(errorMsg); - - if (stackMatch) { - errorMsg += errorMsg.substring(0, stackMatch.index + stackMatch[0].length + 1); - } - - //If a module tree that shows what module triggered the error, - //print it out. - if (errorTree && errorTree.length > 0) { - errorMsg += '\nIn module tree:\n'; - - for (i = errorTree.length - 1; i > -1; i--) { - errorMod = errorTree[i]; - if (errorMod) { - for (j = errorTree.length - i; j > -1; j--) { - errorMsg += standardIndent; - } - errorMsg += errorMod + '\n'; - } - } - - logger.error(errorMsg); - } - - errorStack = e.stack; - - if (typeof args === 'string' && args.indexOf('stacktrace=true') !== -1) { - errorMsg += '\n' + errorStack; - } else { - if (!stackMatch && errorStack) { - //Just trim out the first "at" in the stack. - stackMatch = stackRegExp.exec(errorStack); - if (stackMatch) { - errorMsg += '\n' + stackMatch[0] || ''; - } - } - } - - throw new Error(errorMsg); - }); - }; - - build._run = function (cmdConfig) { - var buildPaths, fileName, fileNames, - paths, i, - baseConfig, config, - modules, srcPath, buildContext, - destPath, moduleMap, parentModuleMap, context, - resources, resource, plugin, fileContents, - pluginProcessed = {}, - buildFileContents = "", - pluginCollector = {}; - - return prim().start(function () { - var prop; - - //Can now run the patches to require.js to allow it to be used for - //build generation. Do it here instead of at the top of the module - //because we want normal require behavior to load the build tool - //then want to switch to build mode. - requirePatch(); - - config = build.createConfig(cmdConfig); - paths = config.paths; - - //Remove the previous build dir, in case it contains source transforms, - //like the ones done with onBuildRead and onBuildWrite. - if (config.dir && !config.keepBuildDir && file.exists(config.dir)) { - file.deleteFile(config.dir); - } - - if (!config.out && !config.cssIn) { - //This is not just a one-off file build but a full build profile, with - //lots of files to process. - - //First copy all the baseUrl content - file.copyDir((config.appDir || config.baseUrl), config.dir, /\w/, true); - - //Adjust baseUrl if config.appDir is in play, and set up build output paths. - buildPaths = {}; - if (config.appDir) { - //All the paths should be inside the appDir, so just adjust - //the paths to use the dirBaseUrl - for (prop in paths) { - if (hasProp(paths, prop)) { - buildPaths[prop] = paths[prop].replace(config.appDir, config.dir); - } - } - } else { - //If no appDir, then make sure to copy the other paths to this directory. - for (prop in paths) { - if (hasProp(paths, prop)) { - //Set up build path for each path prefix, but only do so - //if the path falls out of the current baseUrl - if (paths[prop].indexOf(config.baseUrl) === 0) { - buildPaths[prop] = paths[prop].replace(config.baseUrl, config.dirBaseUrl); - } else { - buildPaths[prop] = paths[prop] === 'empty:' ? 'empty:' : prop.replace(/\./g, "/"); - - //Make sure source path is fully formed with baseUrl, - //if it is a relative URL. - srcPath = paths[prop]; - if (srcPath.indexOf('/') !== 0 && srcPath.indexOf(':') === -1) { - srcPath = config.baseUrl + srcPath; - } - - destPath = config.dirBaseUrl + buildPaths[prop]; - - //Skip empty: paths - if (srcPath !== 'empty:') { - //If the srcPath is a directory, copy the whole directory. - if (file.exists(srcPath) && file.isDirectory(srcPath)) { - //Copy files to build area. Copy all files (the /\w/ regexp) - file.copyDir(srcPath, destPath, /\w/, true); - } else { - //Try a .js extension - srcPath += '.js'; - destPath += '.js'; - file.copyFile(srcPath, destPath); - } - } - } - } - } - } - } - - //Figure out source file location for each module layer. Do this by seeding require - //with source area configuration. This is needed so that later the module layers - //can be manually copied over to the source area, since the build may be - //require multiple times and the above copyDir call only copies newer files. - require({ - baseUrl: config.baseUrl, - paths: paths, - packagePaths: config.packagePaths, - packages: config.packages - }); - buildContext = require.s.contexts._; - modules = config.modules; - - if (modules) { - modules.forEach(function (module) { - if (module.name) { - module._sourcePath = buildContext.nameToUrl(module.name); - //If the module does not exist, and this is not a "new" module layer, - //as indicated by a true "create" property on the module, and - //it is not a plugin-loaded resource, and there is no - //'rawText' containing the module's source then throw an error. - if (!file.exists(module._sourcePath) && !module.create && - module.name.indexOf('!') === -1 && - (!config.rawText || !lang.hasProp(config.rawText, module.name))) { - throw new Error("ERROR: module path does not exist: " + - module._sourcePath + " for module named: " + module.name + - ". Path is relative to: " + file.absPath('.')); - } - } - }); - } - - if (config.out) { - //Just set up the _buildPath for the module layer. - require(config); - if (!config.cssIn) { - config.modules[0]._buildPath = typeof config.out === 'function' ? - 'FUNCTION' : config.out; - } - } else if (!config.cssIn) { - //Now set up the config for require to use the build area, and calculate the - //build file locations. Pass along any config info too. - baseConfig = { - baseUrl: config.dirBaseUrl, - paths: buildPaths - }; - - lang.mixin(baseConfig, config); - require(baseConfig); - - if (modules) { - modules.forEach(function (module) { - if (module.name) { - module._buildPath = buildContext.nameToUrl(module.name, null); - if (!module.create) { - file.copyFile(module._sourcePath, module._buildPath); - } - } - }); - } - } - - //Run CSS optimizations before doing JS module tracing, to allow - //things like text loader plugins loading CSS to get the optimized - //CSS. - if (config.optimizeCss && config.optimizeCss !== "none" && config.dir) { - buildFileContents += optimize.css(config.dir, config); - } - }).then(function () { - var actions = []; - - if (modules) { - actions = modules.map(function (module, i) { - return function () { - //Save off buildPath to module index in a hash for quicker - //lookup later. - config._buildPathToModuleIndex[module._buildPath] = i; - - //Call require to calculate dependencies. - return build.traceDependencies(module, config) - .then(function (layer) { - module.layer = layer; - }); - }; - }); - - return prim.serial(actions); - } - }).then(function () { - var actions; - - if (modules) { - //Now build up shadow layers for anything that should be excluded. - //Do this after tracing dependencies for each module, in case one - //of those modules end up being one of the excluded values. - actions = modules.map(function (module) { - return function () { - if (module.exclude) { - module.excludeLayers = []; - return prim.serial(module.exclude.map(function (exclude, i) { - return function () { - //See if it is already in the list of modules. - //If not trace dependencies for it. - var found = build.findBuildModule(exclude, modules); - if (found) { - module.excludeLayers[i] = found; - } else { - return build.traceDependencies({name: exclude}, config) - .then(function (layer) { - module.excludeLayers[i] = { layer: layer }; - }); - } - }; - })); - } - }; - }); - - return prim.serial(actions); - } - }).then(function () { - if (modules) { - return prim.serial(modules.map(function (module) { - return function () { - if (module.exclude) { - //module.exclude is an array of module names. For each one, - //get the nested dependencies for it via a matching entry - //in the module.excludeLayers array. - module.exclude.forEach(function (excludeModule, i) { - var excludeLayer = module.excludeLayers[i].layer, - map = excludeLayer.buildFileToModule; - excludeLayer.buildFilePaths.forEach(function(filePath){ - build.removeModulePath(map[filePath], filePath, module.layer); - }); - }); - } - if (module.excludeShallow) { - //module.excludeShallow is an array of module names. - //shallow exclusions are just that module itself, and not - //its nested dependencies. - module.excludeShallow.forEach(function (excludeShallowModule) { - var path = getOwn(module.layer.buildPathMap, excludeShallowModule); - if (path) { - build.removeModulePath(excludeShallowModule, path, module.layer); - } - }); - } - - //Flatten them and collect the build output for each module. - return build.flattenModule(module, module.layer, config).then(function (builtModule) { - var finalText, baseName; - //Save it to a temp file for now, in case there are other layers that - //contain optimized content that should not be included in later - //layer optimizations. See issue #56. - if (module._buildPath === 'FUNCTION') { - module._buildText = builtModule.text; - module._buildSourceMap = builtModule.sourceMap; - } else { - finalText = builtModule.text; - if (builtModule.sourceMap) { - baseName = module._buildPath.split('/'); - baseName = baseName.pop(); - finalText += '\n//# sourceMappingURL=' + baseName + '.map'; - file.saveUtf8File(module._buildPath + '.map', builtModule.sourceMap); - } - file.saveUtf8File(module._buildPath + '-temp', finalText); - - } - buildFileContents += builtModule.buildText; - }); - }; - })); - } - }).then(function () { - var moduleName; - if (modules) { - //Now move the build layers to their final position. - modules.forEach(function (module) { - var finalPath = module._buildPath; - if (finalPath !== 'FUNCTION') { - if (file.exists(finalPath)) { - file.deleteFile(finalPath); - } - file.renameFile(finalPath + '-temp', finalPath); - - //And finally, if removeCombined is specified, remove - //any of the files that were used in this layer. - //Be sure not to remove other build layers. - if (config.removeCombined) { - module.layer.buildFilePaths.forEach(function (path) { - if (file.exists(path) && !modules.some(function (mod) { - return mod._buildPath === path; - })) { - file.deleteFile(path); - } - }); - } - } - - //Signal layer is done - if (config.onModuleBundleComplete) { - config.onModuleBundleComplete(module.onCompleteData); - } - }); - } - - //If removeCombined in play, remove any empty directories that - //may now exist because of its use - if (config.removeCombined && !config.out && config.dir) { - file.deleteEmptyDirs(config.dir); - } - - //Do other optimizations. - if (config.out && !config.cssIn) { - //Just need to worry about one JS file. - fileName = config.modules[0]._buildPath; - if (fileName === 'FUNCTION') { - config.modules[0]._buildText = optimize.js(fileName, - config.modules[0]._buildText, - null, - config); - } else { - optimize.jsFile(fileName, null, fileName, config); - } - } else if (!config.cssIn) { - //Normal optimizations across modules. - - //JS optimizations. - fileNames = file.getFilteredFileList(config.dir, /\.js$/, true); - fileNames.forEach(function (fileName) { - var cfg, override, moduleIndex; - - //Generate the module name from the config.dir root. - moduleName = fileName.replace(config.dir, ''); - //Get rid of the extension - moduleName = moduleName.substring(0, moduleName.length - 3); - - //If there is an override for a specific layer build module, - //and this file is that module, mix in the override for use - //by optimize.jsFile. - moduleIndex = getOwn(config._buildPathToModuleIndex, fileName); - //Normalize, since getOwn could have returned undefined - moduleIndex = moduleIndex === 0 || moduleIndex > 0 ? moduleIndex : -1; - - //Try to avoid extra work if the other files do not need to - //be read. Build layers should be processed at the very - //least for optimization. - if (moduleIndex > -1 || !config.skipDirOptimize || - config.normalizeDirDefines === "all" || - config.cjsTranslate) { - //Convert the file to transport format, but without a name - //inserted (by passing null for moduleName) since the files are - //standalone, one module per file. - fileContents = file.readFile(fileName); - - - //For builds, if wanting cjs translation, do it now, so that - //the individual modules can be loaded cross domain via - //plain script tags. - if (config.cjsTranslate && - (!config.shim || !lang.hasProp(config.shim, moduleName))) { - fileContents = commonJs.convert(fileName, fileContents); - } - - if (moduleIndex === -1) { - if (config.onBuildRead) { - fileContents = config.onBuildRead(moduleName, - fileName, - fileContents); - } - - //Only do transport normalization if this is not a build - //layer (since it was already normalized) and if - //normalizeDirDefines indicated all should be done. - if (config.normalizeDirDefines === "all") { - fileContents = build.toTransport(config.namespace, - null, - fileName, - fileContents); - } - - if (config.onBuildWrite) { - fileContents = config.onBuildWrite(moduleName, - fileName, - fileContents); - } - } - - override = moduleIndex > -1 ? - config.modules[moduleIndex].override : null; - if (override) { - cfg = build.createOverrideConfig(config, override); - } else { - cfg = config; - } - - if (moduleIndex > -1 || !config.skipDirOptimize) { - optimize.jsFile(fileName, fileContents, fileName, cfg, pluginCollector); - } - } - }); - - //Normalize all the plugin resources. - context = require.s.contexts._; - - for (moduleName in pluginCollector) { - if (hasProp(pluginCollector, moduleName)) { - parentModuleMap = context.makeModuleMap(moduleName); - resources = pluginCollector[moduleName]; - for (i = 0; i < resources.length; i++) { - resource = resources[i]; - moduleMap = context.makeModuleMap(resource, parentModuleMap); - if (falseProp(context.plugins, moduleMap.prefix)) { - //Set the value in context.plugins so it - //will be evaluated as a full plugin. - context.plugins[moduleMap.prefix] = true; - - //Do not bother if the plugin is not available. - if (!file.exists(require.toUrl(moduleMap.prefix + '.js'))) { - continue; - } - - //Rely on the require in the build environment - //to be synchronous - context.require([moduleMap.prefix]); - - //Now that the plugin is loaded, redo the moduleMap - //since the plugin will need to normalize part of the path. - moduleMap = context.makeModuleMap(resource, parentModuleMap); - } - - //Only bother with plugin resources that can be handled - //processed by the plugin, via support of the writeFile - //method. - if (falseProp(pluginProcessed, moduleMap.id)) { - //Only do the work if the plugin was really loaded. - //Using an internal access because the file may - //not really be loaded. - plugin = getOwn(context.defined, moduleMap.prefix); - if (plugin && plugin.writeFile) { - plugin.writeFile( - moduleMap.prefix, - moduleMap.name, - require, - makeWriteFile( - config.namespace - ), - context.config - ); - } - - pluginProcessed[moduleMap.id] = true; - } - } - - } - } - - //console.log('PLUGIN COLLECTOR: ' + JSON.stringify(pluginCollector, null, " ")); - - - //All module layers are done, write out the build.txt file. - file.saveUtf8File(config.dir + "build.txt", buildFileContents); - } - - //If just have one CSS file to optimize, do that here. - if (config.cssIn) { - buildFileContents += optimize.cssFile(config.cssIn, config.out, config).buildText; - } - - if (typeof config.out === 'function') { - config.out(config.modules[0]._buildText); - } - - //Print out what was built into which layers. - if (buildFileContents) { - logger.info(buildFileContents); - return buildFileContents; - } - - return ''; - }); - }; - - /** - * Converts command line args like "paths.foo=../some/path" - * result.paths = { foo: '../some/path' } where prop = paths, - * name = paths.foo and value = ../some/path, so it assumes the - * name=value splitting has already happened. - */ - function stringDotToObj(result, name, value) { - var parts = name.split('.'); - - parts.forEach(function (prop, i) { - if (i === parts.length - 1) { - result[prop] = value; - } else { - if (falseProp(result, prop)) { - result[prop] = {}; - } - result = result[prop]; - } - - }); - } - - build.objProps = { - paths: true, - wrap: true, - pragmas: true, - pragmasOnSave: true, - has: true, - hasOnSave: true, - uglify: true, - uglify2: true, - closure: true, - map: true, - throwWhen: true - }; - - build.hasDotPropMatch = function (prop) { - var dotProp, - index = prop.indexOf('.'); - - if (index !== -1) { - dotProp = prop.substring(0, index); - return hasProp(build.objProps, dotProp); - } - return false; - }; - - /** - * Converts an array that has String members of "name=value" - * into an object, where the properties on the object are the names in the array. - * Also converts the strings "true" and "false" to booleans for the values. - * member name/value pairs, and converts some comma-separated lists into - * arrays. - * @param {Array} ary - */ - build.convertArrayToObject = function (ary) { - var result = {}, i, separatorIndex, prop, value, - needArray = { - "include": true, - "exclude": true, - "excludeShallow": true, - "insertRequire": true, - "stubModules": true, - "deps": true - }; - - for (i = 0; i < ary.length; i++) { - separatorIndex = ary[i].indexOf("="); - if (separatorIndex === -1) { - throw "Malformed name/value pair: [" + ary[i] + "]. Format should be name=value"; - } - - value = ary[i].substring(separatorIndex + 1, ary[i].length); - if (value === "true") { - value = true; - } else if (value === "false") { - value = false; - } - - prop = ary[i].substring(0, separatorIndex); - - //Convert to array if necessary - if (getOwn(needArray, prop)) { - value = value.split(","); - } - - if (build.hasDotPropMatch(prop)) { - stringDotToObj(result, prop, value); - } else { - result[prop] = value; - } - } - return result; //Object - }; - - build.makeAbsPath = function (path, absFilePath) { - if (!absFilePath) { - return path; - } - - //Add abspath if necessary. If path starts with a slash or has a colon, - //then already is an abolute path. - if (path.indexOf('/') !== 0 && path.indexOf(':') === -1) { - path = absFilePath + - (absFilePath.charAt(absFilePath.length - 1) === '/' ? '' : '/') + - path; - path = file.normalize(path); - } - return path.replace(lang.backSlashRegExp, '/'); - }; - - build.makeAbsObject = function (props, obj, absFilePath) { - var i, prop; - if (obj) { - for (i = 0; i < props.length; i++) { - prop = props[i]; - if (hasProp(obj, prop) && typeof obj[prop] === 'string') { - obj[prop] = build.makeAbsPath(obj[prop], absFilePath); - } - } - } - }; - - /** - * For any path in a possible config, make it absolute relative - * to the absFilePath passed in. - */ - build.makeAbsConfig = function (config, absFilePath) { - var props, prop, i; - - props = ["appDir", "dir", "baseUrl"]; - for (i = 0; i < props.length; i++) { - prop = props[i]; - - if (getOwn(config, prop)) { - //Add abspath if necessary, make sure these paths end in - //slashes - if (prop === "baseUrl") { - config.originalBaseUrl = config.baseUrl; - if (config.appDir) { - //If baseUrl with an appDir, the baseUrl is relative to - //the appDir, *not* the absFilePath. appDir and dir are - //made absolute before baseUrl, so this will work. - config.baseUrl = build.makeAbsPath(config.originalBaseUrl, config.appDir); - } else { - //The dir output baseUrl is same as regular baseUrl, both - //relative to the absFilePath. - config.baseUrl = build.makeAbsPath(config[prop], absFilePath); - } - } else { - config[prop] = build.makeAbsPath(config[prop], absFilePath); - } - - config[prop] = endsWithSlash(config[prop]); - } - } - - build.makeAbsObject(["out", "cssIn"], config, absFilePath); - build.makeAbsObject(["startFile", "endFile"], config.wrap, absFilePath); - }; - - /** - * Creates a relative path to targetPath from refPath. - * Only deals with file paths, not folders. If folders, - * make sure paths end in a trailing '/'. - */ - build.makeRelativeFilePath = function (refPath, targetPath) { - var i, dotLength, finalParts, length, - refParts = refPath.split('/'), - targetParts = targetPath.split('/'), - //Pull off file name - targetName = targetParts.pop(), - dotParts = []; - - //Also pop off the ref file name to make the matches against - //targetParts equivalent. - refParts.pop(); - - length = refParts.length; - - for (i = 0; i < length; i += 1) { - if (refParts[i] !== targetParts[i]) { - break; - } - } - - //Now i is the index in which they diverge. - finalParts = targetParts.slice(i); - - dotLength = length - i; - for (i = 0; i > -1 && i < dotLength; i += 1) { - dotParts.push('..'); - } - - return dotParts.join('/') + (dotParts.length ? '/' : '') + - finalParts.join('/') + (finalParts.length ? '/' : '') + - targetName; - }; - - build.nestedMix = { - paths: true, - has: true, - hasOnSave: true, - pragmas: true, - pragmasOnSave: true - }; - - /** - * Mixes additional source config into target config, and merges some - * nested config, like paths, correctly. - */ - function mixConfig(target, source) { - var prop, value; - - for (prop in source) { - if (hasProp(source, prop)) { - //If the value of the property is a plain object, then - //allow a one-level-deep mixing of it. - value = source[prop]; - if (typeof value === 'object' && value && - !lang.isArray(value) && !lang.isFunction(value) && - !lang.isRegExp(value)) { - target[prop] = lang.mixin({}, target[prop], value, true); - } else { - target[prop] = value; - } - } - } - - //Set up log level since it can affect if errors are thrown - //or caught and passed to errbacks while doing config setup. - if (lang.hasProp(target, 'logLevel')) { - logger.logLevel(target.logLevel); - } - } - - /** - * Converts a wrap.startFile or endFile to be start/end as a string. - * the startFile/endFile values can be arrays. - */ - function flattenWrapFile(wrap, keyName, absFilePath) { - var keyFileName = keyName + 'File'; - - if (typeof wrap[keyName] !== 'string' && wrap[keyFileName]) { - wrap[keyName] = ''; - if (typeof wrap[keyFileName] === 'string') { - wrap[keyFileName] = [wrap[keyFileName]]; - } - wrap[keyFileName].forEach(function (fileName) { - wrap[keyName] += (wrap[keyName] ? '\n' : '') + - file.readFile(build.makeAbsPath(fileName, absFilePath)); - }); - } else if (wrap[keyName] === null || wrap[keyName] === undefined) { - //Allow missing one, just set to empty string. - wrap[keyName] = ''; - } else if (typeof wrap[keyName] !== 'string') { - throw new Error('wrap.' + keyName + ' or wrap.' + keyFileName + ' malformed'); - } - } - - /** - * Creates a config object for an optimization build. - * It will also read the build profile if it is available, to create - * the configuration. - * - * @param {Object} cfg config options that take priority - * over defaults and ones in the build file. These options could - * be from a command line, for instance. - * - * @param {Object} the created config object. - */ - build.createConfig = function (cfg) { - /*jslint evil: true */ - var config = {}, buildFileContents, buildFileConfig, mainConfig, - mainConfigFile, mainConfigPath, buildFile, absFilePath; - - //Make sure all paths are relative to current directory. - absFilePath = file.absPath('.'); - build.makeAbsConfig(cfg, absFilePath); - build.makeAbsConfig(buildBaseConfig, absFilePath); - - lang.mixin(config, buildBaseConfig); - lang.mixin(config, cfg, true); - - //Set up log level early since it can affect if errors are thrown - //or caught and passed to errbacks, even while constructing config. - if (lang.hasProp(config, 'logLevel')) { - logger.logLevel(config.logLevel); - } - - if (config.buildFile) { - //A build file exists, load it to get more config. - buildFile = file.absPath(config.buildFile); - - //Find the build file, and make sure it exists, if this is a build - //that has a build profile, and not just command line args with an in=path - if (!file.exists(buildFile)) { - throw new Error("ERROR: build file does not exist: " + buildFile); - } - - absFilePath = config.baseUrl = file.absPath(file.parent(buildFile)); - - //Load build file options. - buildFileContents = file.readFile(buildFile); - try { - buildFileConfig = eval("(" + buildFileContents + ")"); - build.makeAbsConfig(buildFileConfig, absFilePath); - - //Mix in the config now so that items in mainConfigFile can - //be resolved relative to them if necessary, like if appDir - //is set here, but the baseUrl is in mainConfigFile. Will - //re-mix in the same build config later after mainConfigFile - //is processed, since build config should take priority. - mixConfig(config, buildFileConfig); - } catch (e) { - throw new Error("Build file " + buildFile + " is malformed: " + e); - } - } - - mainConfigFile = config.mainConfigFile || (buildFileConfig && buildFileConfig.mainConfigFile); - if (mainConfigFile) { - mainConfigFile = build.makeAbsPath(mainConfigFile, absFilePath); - if (!file.exists(mainConfigFile)) { - throw new Error(mainConfigFile + ' does not exist.'); - } - try { - mainConfig = parse.findConfig(file.readFile(mainConfigFile)).config; - } catch (configError) { - throw new Error('The config in mainConfigFile ' + - mainConfigFile + - ' cannot be used because it cannot be evaluated' + - ' correctly while running in the optimizer. Try only' + - ' using a config that is also valid JSON, or do not use' + - ' mainConfigFile and instead copy the config values needed' + - ' into a build file or command line arguments given to the optimizer.\n' + - 'Source error from parsing: ' + mainConfigFile + ': ' + configError); - } - if (mainConfig) { - mainConfigPath = mainConfigFile.substring(0, mainConfigFile.lastIndexOf('/')); - - //Add in some existing config, like appDir, since they can be - //used inside the mainConfigFile -- paths and baseUrl are - //relative to them. - if (config.appDir && !mainConfig.appDir) { - mainConfig.appDir = config.appDir; - } - - //If no baseUrl, then use the directory holding the main config. - if (!mainConfig.baseUrl) { - mainConfig.baseUrl = mainConfigPath; - } - - build.makeAbsConfig(mainConfig, mainConfigPath); - mixConfig(config, mainConfig); - } - } - - //Mix in build file config, but only after mainConfig has been mixed in. - if (buildFileConfig) { - mixConfig(config, buildFileConfig); - } - - //Re-apply the override config values. Command line - //args should take precedence over build file values. - mixConfig(config, cfg); - - //Fix paths to full paths so that they can be adjusted consistently - //lately to be in the output area. - lang.eachProp(config.paths, function (value, prop) { - if (lang.isArray(value)) { - throw new Error('paths fallback not supported in optimizer. ' + - 'Please provide a build config path override ' + - 'for ' + prop); - } - config.paths[prop] = build.makeAbsPath(value, config.baseUrl); - }); - - //Set final output dir - if (hasProp(config, "baseUrl")) { - if (config.appDir) { - config.dirBaseUrl = build.makeAbsPath(config.originalBaseUrl, config.dir); - } else { - config.dirBaseUrl = config.dir || config.baseUrl; - } - //Make sure dirBaseUrl ends in a slash, since it is - //concatenated with other strings. - config.dirBaseUrl = endsWithSlash(config.dirBaseUrl); - } - - //Check for errors in config - if (config.main) { - throw new Error('"main" passed as an option, but the ' + - 'supported option is called "name".'); - } - if (config.out && !config.name && !config.modules && !config.include && - !config.cssIn) { - throw new Error('Missing either a "name", "include" or "modules" ' + - 'option'); - } - if (config.cssIn) { - if (config.dir || config.appDir) { - throw new Error('cssIn is only for the output of single file ' + - 'CSS optimizations and is not compatible with "dir" or "appDir" configuration.'); - } - if (!config.out) { - throw new Error('"out" option missing.'); - } - } - if (!config.cssIn && !config.baseUrl) { - //Just use the current directory as the baseUrl - config.baseUrl = './'; - } - if (!config.out && !config.dir) { - throw new Error('Missing either an "out" or "dir" config value. ' + - 'If using "appDir" for a full project optimization, ' + - 'use "dir". If you want to optimize to one file, ' + - 'use "out".'); - } - if (config.appDir && config.out) { - throw new Error('"appDir" is not compatible with "out". Use "dir" ' + - 'instead. appDir is used to copy whole projects, ' + - 'where "out" with "baseUrl" is used to just ' + - 'optimize to one file.'); - } - if (config.out && config.dir) { - throw new Error('The "out" and "dir" options are incompatible.' + - ' Use "out" if you are targeting a single file for' + - ' for optimization, and "dir" if you want the appDir' + - ' or baseUrl directories optimized.'); - } - - if (config.dir) { - // Make sure the output dir is not set to a parent of the - // source dir or the same dir, as it will result in source - // code deletion. - if (config.dir === config.baseUrl || - config.dir === config.appDir || - (config.baseUrl && build.makeRelativeFilePath(config.dir, - config.baseUrl).indexOf('..') !== 0) || - (config.appDir && - build.makeRelativeFilePath(config.dir, config.appDir).indexOf('..') !== 0)) { - throw new Error('"dir" is set to a parent or same directory as' + - ' "appDir" or "baseUrl". This can result in' + - ' the deletion of source code. Stopping.'); - } - } - - if (config.insertRequire && !lang.isArray(config.insertRequire)) { - throw new Error('insertRequire should be a list of module IDs' + - ' to insert in to a require([]) call.'); - } - - if (config.generateSourceMaps) { - if (config.preserveLicenseComments && config.optimize !== 'none') { - throw new Error('Cannot use preserveLicenseComments and ' + - 'generateSourceMaps together. Either explcitly set ' + - 'preserveLicenseComments to false (default is true) or ' + - 'turn off generateSourceMaps. If you want source maps with ' + - 'license comments, see: ' + - 'http://requirejs.org/docs/errors.html#sourcemapcomments'); - } else if (config.optimize !== 'none' && - config.optimize !== 'closure' && - config.optimize !== 'uglify2') { - //Allow optimize: none to pass, since it is useful when toggling - //minification on and off to debug something, and it implicitly - //works, since it does not need a source map. - throw new Error('optimize: "' + config.optimize + - '" does not support generateSourceMaps.'); - } - } - - if ((config.name || config.include) && !config.modules) { - //Just need to build one file, but may be part of a whole appDir/ - //baseUrl copy, but specified on the command line, so cannot do - //the modules array setup. So create a modules section in that - //case. - config.modules = [ - { - name: config.name, - out: config.out, - create: config.create, - include: config.include, - exclude: config.exclude, - excludeShallow: config.excludeShallow, - insertRequire: config.insertRequire, - stubModules: config.stubModules - } - ]; - delete config.stubModules; - } else if (config.modules && config.out) { - throw new Error('If the "modules" option is used, then there ' + - 'should be a "dir" option set and "out" should ' + - 'not be used since "out" is only for single file ' + - 'optimization output.'); - } else if (config.modules && config.name) { - throw new Error('"name" and "modules" options are incompatible. ' + - 'Either use "name" if doing a single file ' + - 'optimization, or "modules" if you want to target ' + - 'more than one file for optimization.'); - } - - if (config.out && !config.cssIn) { - //Just one file to optimize. - - //Does not have a build file, so set up some defaults. - //Optimizing CSS should not be allowed, unless explicitly - //asked for on command line. In that case the only task is - //to optimize a CSS file. - if (!cfg.optimizeCss) { - config.optimizeCss = "none"; - } - } - - //Normalize cssPrefix - if (config.cssPrefix) { - //Make sure cssPrefix ends in a slash - config.cssPrefix = endsWithSlash(config.cssPrefix); - } else { - config.cssPrefix = ''; - } - - //Cycle through modules and combine any local stubModules with - //global values. - if (config.modules && config.modules.length) { - config.modules.forEach(function (mod) { - if (config.stubModules) { - mod.stubModules = config.stubModules.concat(mod.stubModules || []); - } - - //Create a hash lookup for the stubModules config to make lookup - //cheaper later. - if (mod.stubModules) { - mod.stubModules._byName = {}; - mod.stubModules.forEach(function (id) { - mod.stubModules._byName[id] = true; - }); - } - }); - } - - //Get any wrap text. - try { - if (config.wrap) { - if (config.wrap === true) { - //Use default values. - config.wrap = { - start: '(function () {', - end: '}());' - }; - } else { - flattenWrapFile(config.wrap, 'start', absFilePath); - flattenWrapFile(config.wrap, 'end', absFilePath); - } - } - } catch (wrapError) { - throw new Error('Malformed wrap config: ' + wrapError.toString()); - } - - //Do final input verification - if (config.context) { - throw new Error('The build argument "context" is not supported' + - ' in a build. It should only be used in web' + - ' pages.'); - } - - //Set up normalizeDirDefines. If not explicitly set, if optimize "none", - //set to "skip" otherwise set to "all". - if (!hasProp(config, 'normalizeDirDefines')) { - if (config.optimize === 'none' || config.skipDirOptimize) { - config.normalizeDirDefines = 'skip'; - } else { - config.normalizeDirDefines = 'all'; - } - } - - //Set file.fileExclusionRegExp if desired - if (hasProp(config, 'fileExclusionRegExp')) { - if (typeof config.fileExclusionRegExp === "string") { - file.exclusionRegExp = new RegExp(config.fileExclusionRegExp); - } else { - file.exclusionRegExp = config.fileExclusionRegExp; - } - } else if (hasProp(config, 'dirExclusionRegExp')) { - //Set file.dirExclusionRegExp if desired, this is the old - //name for fileExclusionRegExp before 1.0.2. Support for backwards - //compatibility - file.exclusionRegExp = config.dirExclusionRegExp; - } - - //Remove things that may cause problems in the build. - delete config.jQuery; - delete config.enforceDefine; - delete config.urlArgs; - - return config; - }; - - /** - * finds the module being built/optimized with the given moduleName, - * or returns null. - * @param {String} moduleName - * @param {Array} modules - * @returns {Object} the module object from the build profile, or null. - */ - build.findBuildModule = function (moduleName, modules) { - var i, module; - for (i = 0; i < modules.length; i++) { - module = modules[i]; - if (module.name === moduleName) { - return module; - } - } - return null; - }; - - /** - * Removes a module name and path from a layer, if it is supposed to be - * excluded from the layer. - * @param {String} moduleName the name of the module - * @param {String} path the file path for the module - * @param {Object} layer the layer to remove the module/path from - */ - build.removeModulePath = function (module, path, layer) { - var index = layer.buildFilePaths.indexOf(path); - if (index !== -1) { - layer.buildFilePaths.splice(index, 1); - } - }; - - /** - * Uses the module build config object to trace the dependencies for the - * given module. - * - * @param {Object} module the module object from the build config info. - * @param {Object} the build config object. - * - * @returns {Object} layer information about what paths and modules should - * be in the flattened module. - */ - build.traceDependencies = function (module, config) { - var include, override, layer, context, baseConfig, oldContext, - rawTextByIds, - syncChecks = { - rhino: true, - node: true, - xpconnect: true - }, - deferred = prim(); - - //Reset some state set up in requirePatch.js, and clean up require's - //current context. - oldContext = require._buildReset(); - - //Grab the reset layer and context after the reset, but keep the - //old config to reuse in the new context. - baseConfig = oldContext.config; - layer = require._layer; - context = layer.context; - - //Put back basic config, use a fresh object for it. - //WARNING: probably not robust for paths and packages/packagePaths, - //since those property's objects can be modified. But for basic - //config clone it works out. - require(lang.mixin({}, baseConfig, true)); - - logger.trace("\nTracing dependencies for: " + (module.name || module.out)); - include = module.name && !module.create ? [module.name] : []; - if (module.include) { - include = include.concat(module.include); - } - - //If there are overrides to basic config, set that up now.; - if (module.override) { - override = lang.mixin({}, baseConfig, true); - lang.mixin(override, module.override, true); - require(override); - } - - //Now, populate the rawText cache with any values explicitly passed in - //via config. - rawTextByIds = require.s.contexts._.config.rawText; - if (rawTextByIds) { - lang.eachProp(rawTextByIds, function (contents, id) { - var url = require.toUrl(id) + '.js'; - require._cachedRawText[url] = contents; - }); - } - - - //Configure the callbacks to be called. - deferred.reject.__requireJsBuild = true; - - //Use a wrapping function so can check for errors. - function includeFinished(value) { - //If a sync build environment, check for errors here, instead of - //in the then callback below, since some errors, like two IDs pointed - //to same URL but only one anon ID will leave the loader in an - //unresolved state since a setTimeout cannot be used to check for - //timeout. - var hasError = false; - if (syncChecks[env.get()]) { - try { - build.checkForErrors(context); - } catch (e) { - hasError = true; - deferred.reject(e); - } - } - - if (!hasError) { - deferred.resolve(value); - } - } - includeFinished.__requireJsBuild = true; - - //Figure out module layer dependencies by calling require to do the work. - require(include, includeFinished, deferred.reject); - - return deferred.promise.then(function () { - //Reset config - if (module.override) { - require(baseConfig); - } - - build.checkForErrors(context); - - return layer; - }); - }; - - build.checkForErrors = function (context) { - //Check to see if it all loaded. If not, then throw, and give - //a message on what is left. - var id, prop, mod, errUrl, idParts, pluginId, - errMessage = '', - failedPluginMap = {}, - failedPluginIds = [], - errIds = [], - errUrlMap = {}, - errUrlConflicts = {}, - hasErrUrl = false, - registry = context.registry; - - for (id in registry) { - if (hasProp(registry, id) && id.indexOf('_@r') !== 0) { - mod = getOwn(registry, id); - if (id.indexOf('_unnormalized') === -1 && mod && mod.enabled) { - errIds.push(id); - errUrl = mod.map.url; - - if (errUrlMap[errUrl]) { - hasErrUrl = true; - //This error module has the same URL as another - //error module, could be misconfiguration. - if (!errUrlConflicts[errUrl]) { - errUrlConflicts[errUrl] = []; - //Store the original module that had the same URL. - errUrlConflicts[errUrl].push(errUrlMap[errUrl]); - } - errUrlConflicts[errUrl].push(id); - } else { - errUrlMap[errUrl] = id; - } - } - - //Look for plugins that did not call load() - idParts = id.split('!'); - pluginId = idParts[0]; - if (idParts.length > 1 && falseProp(failedPluginMap, pluginId)) { - failedPluginIds.push(pluginId); - failedPluginMap[pluginId] = true; - } - } - } - - if (errIds.length || failedPluginIds.length) { - if (failedPluginIds.length) { - errMessage += 'Loader plugin' + - (failedPluginIds.length === 1 ? '' : 's') + - ' did not call ' + - 'the load callback in the build: ' + - failedPluginIds.join(', ') + '\n'; - } - errMessage += 'Module loading did not complete for: ' + errIds.join(', '); - - if (hasErrUrl) { - errMessage += '\nThe following modules share the same URL. This ' + - 'could be a misconfiguration if that URL only has ' + - 'one anonymous module in it:'; - for (prop in errUrlConflicts) { - if (hasProp(errUrlConflicts, prop)) { - errMessage += '\n' + prop + ': ' + - errUrlConflicts[prop].join(', '); - } - } - } - throw new Error(errMessage); - } - - }; - - build.createOverrideConfig = function (config, override) { - var cfg = {}; - - lang.mixin(cfg, config, true); - lang.eachProp(override, function (value, prop) { - if (hasProp(build.objProps, prop)) { - //An object property, merge keys. Start a new object - //so that source object in config does not get modified. - cfg[prop] = {}; - lang.mixin(cfg[prop], config[prop], true); - lang.mixin(cfg[prop], override[prop], true); - } else { - cfg[prop] = override[prop]; - } - }); - return cfg; - }; - - /** - * Uses the module build config object to create an flattened version - * of the module, with deep dependencies included. - * - * @param {Object} module the module object from the build config info. - * - * @param {Object} layer the layer object returned from build.traceDependencies. - * - * @param {Object} the build config object. - * - * @returns {Object} with two properties: "text", the text of the flattened - * module, and "buildText", a string of text representing which files were - * included in the flattened module text. - */ - build.flattenModule = function (module, layer, config) { - var fileContents, sourceMapGenerator, - sourceMapBase, - buildFileContents = ''; - - return prim().start(function () { - var reqIndex, currContents, - moduleName, shim, packageConfig, nonPackageName, - parts, builder, writeApi, - namespace, namespaceWithDot, stubModulesByName, - context = layer.context, - onLayerEnds = [], - onLayerEndAdded = {}; - - //Use override settings, particularly for pragmas - //Do this before the var readings since it reads config values. - if (module.override) { - config = build.createOverrideConfig(config, module.override); - } - - namespace = config.namespace || ''; - namespaceWithDot = namespace ? namespace + '.' : ''; - stubModulesByName = (module.stubModules && module.stubModules._byName) || {}; - - //Start build output for the module. - module.onCompleteData = { - name: module.name, - path: (config.dir ? module._buildPath.replace(config.dir, "") : module._buildPath), - included: [] - }; - - buildFileContents += "\n" + - module.onCompleteData.path + - "\n----------------\n"; - - //If there was an existing file with require in it, hoist to the top. - if (layer.existingRequireUrl) { - reqIndex = layer.buildFilePaths.indexOf(layer.existingRequireUrl); - if (reqIndex !== -1) { - layer.buildFilePaths.splice(reqIndex, 1); - layer.buildFilePaths.unshift(layer.existingRequireUrl); - } - } - - if (config.generateSourceMaps) { - sourceMapBase = config.dir || config.baseUrl; - sourceMapGenerator = new SourceMapGenerator.SourceMapGenerator({ - file: module._buildPath.replace(sourceMapBase, '') - }); - } - - //Write the built module to disk, and build up the build output. - fileContents = ""; - return prim.serial(layer.buildFilePaths.map(function (path) { - return function () { - var lineCount, - singleContents = ''; - - moduleName = layer.buildFileToModule[path]; - //If the moduleName is for a package main, then update it to the - //real main value. - packageConfig = layer.context.config.pkgs && - getOwn(layer.context.config.pkgs, moduleName); - if (packageConfig) { - nonPackageName = moduleName; - moduleName += '/' + packageConfig.main; - } - - return prim().start(function () { - //Figure out if the module is a result of a build plugin, and if so, - //then delegate to that plugin. - parts = context.makeModuleMap(moduleName); - builder = parts.prefix && getOwn(context.defined, parts.prefix); - if (builder) { - if (builder.onLayerEnd && falseProp(onLayerEndAdded, parts.prefix)) { - onLayerEnds.push(builder); - onLayerEndAdded[parts.prefix] = true; - } - - if (builder.write) { - writeApi = function (input) { - singleContents += "\n" + addSemiColon(input); - if (config.onBuildWrite) { - singleContents = config.onBuildWrite(moduleName, path, singleContents); - } - }; - writeApi.asModule = function (moduleName, input) { - singleContents += "\n" + - addSemiColon(build.toTransport(namespace, moduleName, path, input, layer, { - useSourceUrl: layer.context.config.useSourceUrl - })); - if (config.onBuildWrite) { - singleContents = config.onBuildWrite(moduleName, path, singleContents); - } - }; - builder.write(parts.prefix, parts.name, writeApi); - } - return; - } else { - return prim().start(function () { - if (hasProp(stubModulesByName, moduleName)) { - //Just want to insert a simple module definition instead - //of the source module. Useful for plugins that inline - //all their resources. - if (hasProp(layer.context.plugins, moduleName)) { - //Slightly different content for plugins, to indicate - //that dynamic loading will not work. - return 'define({load: function(id){throw new Error("Dynamic load not allowed: " + id);}});'; - } else { - return 'define({});'; - } - } else { - return require._cacheReadAsync(path); - } - }).then(function (text) { - var hasPackageName; - - currContents = text; - - if (config.cjsTranslate && - (!config.shim || !lang.hasProp(config.shim, moduleName))) { - currContents = commonJs.convert(path, currContents); - } - - if (config.onBuildRead) { - currContents = config.onBuildRead(moduleName, path, currContents); - } - - if (packageConfig) { - hasPackageName = (nonPackageName === parse.getNamedDefine(currContents)); - } - - if (namespace) { - currContents = pragma.namespace(currContents, namespace); - } - - currContents = build.toTransport(namespace, moduleName, path, currContents, layer, { - useSourceUrl: config.useSourceUrl - }); - - if (packageConfig && !hasPackageName) { - currContents = addSemiColon(currContents) + '\n'; - currContents += namespaceWithDot + "define('" + - packageConfig.name + "', ['" + moduleName + - "'], function (main) { return main; });\n"; - } - - if (config.onBuildWrite) { - currContents = config.onBuildWrite(moduleName, path, currContents); - } - - //Semicolon is for files that are not well formed when - //concatenated with other content. - singleContents += "\n" + addSemiColon(currContents); - }); - } - }).then(function () { - var sourceMapPath, sourceMapLineNumber, - shortPath = path.replace(config.dir, ""); - - module.onCompleteData.included.push(shortPath); - buildFileContents += shortPath + "\n"; - - //Some files may not have declared a require module, and if so, - //put in a placeholder call so the require does not try to load them - //after the module is processed. - //If we have a name, but no defined module, then add in the placeholder. - if (moduleName && falseProp(layer.modulesWithNames, moduleName) && !config.skipModuleInsertion) { - shim = config.shim && (getOwn(config.shim, moduleName) || (packageConfig && getOwn(config.shim, nonPackageName))); - if (shim) { - singleContents += '\n' + namespaceWithDot + 'define("' + moduleName + '", ' + - (shim.deps && shim.deps.length ? - build.makeJsArrayString(shim.deps) + ', ' : '') + - (shim.exportsFn ? shim.exportsFn() : 'function(){}') + - ');\n'; - } else { - singleContents += '\n' + namespaceWithDot + 'define("' + moduleName + '", function(){});\n'; - } - } - - //Add to the source map - if (sourceMapGenerator) { - sourceMapPath = build.makeRelativeFilePath(module._buildPath, path); - sourceMapLineNumber = fileContents.split('\n').length - 1; - lineCount = singleContents.split('\n').length; - for (var i = 1; i <= lineCount; i += 1) { - sourceMapGenerator.addMapping({ - generated: { - line: sourceMapLineNumber + i, - column: 0 - }, - original: { - line: i, - column: 0 - }, - source: sourceMapPath - }); - } - - //Store the content of the original in the source - //map since other transforms later like minification - //can mess up translating back to the original - //source - sourceMapGenerator.setSourceContent(sourceMapPath, singleContents); - } - - //Add the file to the final contents - fileContents += singleContents; - }); - }; - })).then(function () { - if (onLayerEnds.length) { - onLayerEnds.forEach(function (builder) { - var path; - if (typeof module.out === 'string') { - path = module.out; - } else if (typeof module._buildPath === 'string') { - path = module._buildPath; - } - builder.onLayerEnd(function (input) { - fileContents += "\n" + addSemiColon(input); - }, { - name: module.name, - path: path - }); - }); - } - - if (module.create) { - //The ID is for a created layer. Write out - //a module definition for it in case the - //built file is used with enforceDefine - //(#432) - fileContents += '\n' + namespaceWithDot + 'define("' + module.name + '", function(){});\n'; - } - - //Add a require at the end to kick start module execution, if that - //was desired. Usually this is only specified when using small shim - //loaders like almond. - if (module.insertRequire) { - fileContents += '\n' + namespaceWithDot + 'require(["' + module.insertRequire.join('", "') + '"]);\n'; - } - }); - }).then(function () { - return { - text: config.wrap ? - config.wrap.start + fileContents + config.wrap.end : - fileContents, - buildText: buildFileContents, - sourceMap: sourceMapGenerator ? - JSON.stringify(sourceMapGenerator.toJSON(), null, ' ') : - undefined - }; - }); - }; - - //Converts an JS array of strings to a string representation. - //Not using JSON.stringify() for Rhino's sake. - build.makeJsArrayString = function (ary) { - return '["' + ary.map(function (item) { - //Escape any double quotes, backslashes - return lang.jsEscape(item); - }).join('","') + '"]'; - }; - - build.toTransport = function (namespace, moduleName, path, contents, layer, options) { - var baseUrl = layer && layer.context.config.baseUrl; - - function onFound(info) { - //Only mark this module as having a name if not a named module, - //or if a named module and the name matches expectations. - if (layer && (info.needsId || info.foundId === moduleName)) { - layer.modulesWithNames[moduleName] = true; - } - } - - //Convert path to be a local one to the baseUrl, useful for - //useSourceUrl. - if (baseUrl) { - path = path.replace(baseUrl, ''); - } - - return transform.toTransport(namespace, moduleName, path, contents, onFound, options); - }; - - return build; -}); - - } - - - /** - * Sets the default baseUrl for requirejs to be directory of top level - * script. - */ - function setBaseUrl(fileName) { - //Use the file name's directory as the baseUrl if available. - dir = fileName.replace(/\\/g, '/'); - if (dir.indexOf('/') !== -1) { - dir = dir.split('/'); - dir.pop(); - dir = dir.join('/'); - exec("require({baseUrl: '" + dir + "'});"); - } - } - - function createRjsApi() { - //Create a method that will run the optimzer given an object - //config. - requirejs.optimize = function (config, callback, errback) { - if (!loadedOptimizedLib) { - loadLib(); - loadedOptimizedLib = true; - } - - //Create the function that will be called once build modules - //have been loaded. - var runBuild = function (build, logger, quit) { - //Make sure config has a log level, and if not, - //make it "silent" by default. - config.logLevel = config.hasOwnProperty('logLevel') ? - config.logLevel : logger.SILENT; - - //Reset build internals first in case this is part - //of a long-running server process that could have - //exceptioned out in a bad state. It is only defined - //after the first call though. - if (requirejs._buildReset) { - requirejs._buildReset(); - requirejs._cacheReset(); - } - - function done(result) { - //And clean up, in case something else triggers - //a build in another pathway. - if (requirejs._buildReset) { - requirejs._buildReset(); - requirejs._cacheReset(); - } - - // Ensure errors get propagated to the errback - if (result instanceof Error) { - throw result; - } - - return result; - } - - errback = errback || function (err) { - // Using console here since logger may have - // turned off error logging. Since quit is - // called want to be sure a message is printed. - console.log(err); - quit(1); - }; - - build(config).then(done, done).then(callback, errback); - }; - - requirejs({ - context: 'build' - }, ['build', 'logger', 'env!env/quit'], runBuild); - }; - - requirejs.tools = { - useLib: function (contextName, callback) { - if (!callback) { - callback = contextName; - contextName = 'uselib'; - } - - if (!useLibLoaded[contextName]) { - loadLib(); - useLibLoaded[contextName] = true; - } - - var req = requirejs({ - context: contextName - }); - - req(['build'], function () { - callback(req); - }); - } - }; - - requirejs.define = define; - } - - //If in Node, and included via a require('requirejs'), just export and - //THROW IT ON THE GROUND! - if (env === 'node' && reqMain !== module) { - setBaseUrl(path.resolve(reqMain ? reqMain.filename : '.')); - - createRjsApi(); - - module.exports = requirejs; - return; - } else if (env === 'browser') { - //Only option is to use the API. - setBaseUrl(location.href); - createRjsApi(); - return; - } else if ((env === 'rhino' || env === 'xpconnect') && - //User sets up requirejsAsLib variable to indicate it is loaded - //via load() to be used as a library. - typeof requirejsAsLib !== 'undefined' && requirejsAsLib) { - //This script is loaded via rhino's load() method, expose the - //API and get out. - setBaseUrl(fileName); - createRjsApi(); - return; - } - - if (commandOption === 'o') { - //Do the optimizer work. - loadLib(); - - /** - * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/requirejs for details - */ - -/* - * Create a build.js file that has the build options you want and pass that - * build file to this file to do the build. See example.build.js for more information. - */ - -/*jslint strict: false, nomen: false */ -/*global require: false */ - -require({ - baseUrl: require.s.contexts._.config.baseUrl, - //Use a separate context than the default context so that the - //build can use the default context. - context: 'build', - catchError: { - define: true - } -}, ['env!env/args', 'env!env/quit', 'logger', 'build'], -function (args, quit, logger, build) { - build(args).then(function () {}, function (err) { - logger.error(err); - quit(1); - }); -}); - - - } else if (commandOption === 'v') { - console.log('r.js: ' + version + - ', RequireJS: ' + this.requirejsVars.require.version + - ', UglifyJS2: 2.3.6, UglifyJS: 1.3.4'); - } else if (commandOption === 'convert') { - loadLib(); - - this.requirejsVars.require(['env!env/args', 'commonJs', 'env!env/print'], - function (args, commonJs, print) { - - var srcDir, outDir; - srcDir = args[0]; - outDir = args[1]; - - if (!srcDir || !outDir) { - print('Usage: path/to/commonjs/modules output/dir'); - return; - } - - commonJs.convertDir(args[0], args[1]); - }); - } else { - //Just run an app - - //Load the bundled libraries for use in the app. - if (commandOption === 'lib') { - loadLib(); - } - - setBaseUrl(fileName); - - if (exists(fileName)) { - exec(readFile(fileName), fileName); - } else { - showHelp(); - } - } - -}((typeof console !== 'undefined' ? console : undefined), - (typeof Packages !== 'undefined' || (typeof window === 'undefined' && - typeof Components !== 'undefined' && Components.interfaces) ? - Array.prototype.slice.call(arguments, 0) : []), - (typeof readFile !== 'undefined' ? readFile : undefined))); diff --git a/build/source/chart/bar.js b/build/source/chart/bar.js new file mode 100644 index 0000000..83861ce --- /dev/null +++ b/build/source/chart/bar.js @@ -0,0 +1,631 @@ +define('echarts/chart/bar', [ + 'require', + './base', + 'zrender/shape/Rectangle', + '../component/axis', + '../component/grid', + '../component/dataZoom', + '../config', + '../util/ecData', + 'zrender/tool/util', + 'zrender/tool/color', + '../chart' +], function (require) { + var ChartBase = require('./base'); + var RectangleShape = require('zrender/shape/Rectangle'); + require('../component/axis'); + require('../component/grid'); + require('../component/dataZoom'); + var ecConfig = require('../config'); + ecConfig.bar = { + zlevel: 0, + z: 2, + clickable: true, + legendHoverLink: true, + xAxisIndex: 0, + yAxisIndex: 0, + barMinHeight: 0, + barGap: '30%', + barCategoryGap: '20%', + itemStyle: { + normal: { + barBorderColor: '#fff', + barBorderRadius: 0, + barBorderWidth: 0, + label: { show: false } + }, + emphasis: { + barBorderColor: '#fff', + barBorderRadius: 0, + barBorderWidth: 0, + label: { show: false } + } + } + }; + var ecData = require('../util/ecData'); + var zrUtil = require('zrender/tool/util'); + var zrColor = require('zrender/tool/color'); + function Bar(ecTheme, messageCenter, zr, option, myChart) { + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); + this.refresh(option); + } + Bar.prototype = { + type: ecConfig.CHART_TYPE_BAR, + _buildShape: function () { + this._buildPosition(); + }, + _buildNormal: function (seriesArray, maxDataLength, locationMap, xMarkMap, orient) { + var series = this.series; + var seriesIndex = locationMap[0][0]; + var serie = series[seriesIndex]; + var isHorizontal = orient == 'horizontal'; + var xAxis = this.component.xAxis; + var yAxis = this.component.yAxis; + var categoryAxis = isHorizontal ? xAxis.getAxis(serie.xAxisIndex) : yAxis.getAxis(serie.yAxisIndex); + var valueAxis; + var size = this._mapSize(categoryAxis, locationMap); + var gap = size.gap; + var barGap = size.barGap; + var barWidthMap = size.barWidthMap; + var barMaxWidthMap = size.barMaxWidthMap; + var barWidth = size.barWidth; + var barMinHeightMap = size.barMinHeightMap; + var barHeight; + var curBarWidth; + var interval = size.interval; + var x; + var y; + var lastP; + var baseP; + var lastN; + var baseN; + var barShape; + var data; + var value; + var islandR = this.deepQuery([ + this.ecTheme, + ecConfig + ], 'island.r'); + for (var i = 0, l = maxDataLength; i < l; i++) { + if (categoryAxis.getNameByIndex(i) == null) { + break; + } + isHorizontal ? x = categoryAxis.getCoordByIndex(i) - gap / 2 : y = categoryAxis.getCoordByIndex(i) + gap / 2; + for (var j = 0, k = locationMap.length; j < k; j++) { + var yAxisIndex = series[locationMap[j][0]].yAxisIndex || 0; + var xAxisIndex = series[locationMap[j][0]].xAxisIndex || 0; + valueAxis = isHorizontal ? yAxis.getAxis(yAxisIndex) : xAxis.getAxis(xAxisIndex); + baseP = lastP = baseN = lastN = valueAxis.getCoord(0); + for (var m = 0, n = locationMap[j].length; m < n; m++) { + seriesIndex = locationMap[j][m]; + serie = series[seriesIndex]; + data = serie.data[i]; + value = this.getDataFromOption(data, '-'); + xMarkMap[seriesIndex] = xMarkMap[seriesIndex] || { + min: Number.POSITIVE_INFINITY, + max: Number.NEGATIVE_INFINITY, + sum: 0, + counter: 0, + average: 0 + }; + curBarWidth = Math.min(barMaxWidthMap[seriesIndex] || Number.MAX_VALUE, barWidthMap[seriesIndex] || barWidth); + if (value === '-') { + continue; + } + if (value > 0) { + barHeight = m > 0 ? valueAxis.getCoordSize(value) : isHorizontal ? baseP - valueAxis.getCoord(value) : valueAxis.getCoord(value) - baseP; + if (n === 1 && barMinHeightMap[seriesIndex] > barHeight) { + barHeight = barMinHeightMap[seriesIndex]; + } + if (isHorizontal) { + lastP -= barHeight; + y = lastP; + } else { + x = lastP; + lastP += barHeight; + } + } else if (value < 0) { + barHeight = m > 0 ? valueAxis.getCoordSize(value) : isHorizontal ? valueAxis.getCoord(value) - baseN : baseN - valueAxis.getCoord(value); + if (n === 1 && barMinHeightMap[seriesIndex] > barHeight) { + barHeight = barMinHeightMap[seriesIndex]; + } + if (isHorizontal) { + y = lastN; + lastN += barHeight; + } else { + lastN -= barHeight; + x = lastN; + } + } else { + barHeight = 0; + if (isHorizontal) { + lastP -= barHeight; + y = lastP; + } else { + x = lastP; + lastP += barHeight; + } + } + xMarkMap[seriesIndex][i] = isHorizontal ? x + curBarWidth / 2 : y - curBarWidth / 2; + if (xMarkMap[seriesIndex].min > value) { + xMarkMap[seriesIndex].min = value; + if (isHorizontal) { + xMarkMap[seriesIndex].minY = y; + xMarkMap[seriesIndex].minX = xMarkMap[seriesIndex][i]; + } else { + xMarkMap[seriesIndex].minX = x + barHeight; + xMarkMap[seriesIndex].minY = xMarkMap[seriesIndex][i]; + } + } + if (xMarkMap[seriesIndex].max < value) { + xMarkMap[seriesIndex].max = value; + if (isHorizontal) { + xMarkMap[seriesIndex].maxY = y; + xMarkMap[seriesIndex].maxX = xMarkMap[seriesIndex][i]; + } else { + xMarkMap[seriesIndex].maxX = x + barHeight; + xMarkMap[seriesIndex].maxY = xMarkMap[seriesIndex][i]; + } + } + xMarkMap[seriesIndex].sum += value; + xMarkMap[seriesIndex].counter++; + if (i % interval === 0) { + barShape = this._getBarItem(seriesIndex, i, categoryAxis.getNameByIndex(i), x, y - (isHorizontal ? 0 : curBarWidth), isHorizontal ? curBarWidth : barHeight, isHorizontal ? barHeight : curBarWidth, isHorizontal ? 'vertical' : 'horizontal'); + this.shapeList.push(new RectangleShape(barShape)); + } + } + for (var m = 0, n = locationMap[j].length; m < n; m++) { + seriesIndex = locationMap[j][m]; + serie = series[seriesIndex]; + data = serie.data[i]; + value = this.getDataFromOption(data, '-'); + curBarWidth = Math.min(barMaxWidthMap[seriesIndex] || Number.MAX_VALUE, barWidthMap[seriesIndex] || barWidth); + if (value != '-') { + continue; + } + if (this.deepQuery([ + data, + serie, + this.option + ], 'calculable')) { + if (isHorizontal) { + lastP -= islandR; + y = lastP; + } else { + x = lastP; + lastP += islandR; + } + barShape = this._getBarItem(seriesIndex, i, categoryAxis.getNameByIndex(i), x, y - (isHorizontal ? 0 : curBarWidth), isHorizontal ? curBarWidth : islandR, isHorizontal ? islandR : curBarWidth, isHorizontal ? 'vertical' : 'horizontal'); + barShape.hoverable = false; + barShape.draggable = false; + barShape.style.lineWidth = 1; + barShape.style.brushType = 'stroke'; + barShape.style.strokeColor = serie.calculableHolderColor || this.ecTheme.calculableHolderColor || ecConfig.calculableHolderColor; + this.shapeList.push(new RectangleShape(barShape)); + } + } + isHorizontal ? x += curBarWidth + barGap : y -= curBarWidth + barGap; + } + } + this._calculMarkMapXY(xMarkMap, locationMap, isHorizontal ? 'y' : 'x'); + }, + _buildHorizontal: function (seriesArray, maxDataLength, locationMap, xMarkMap) { + return this._buildNormal(seriesArray, maxDataLength, locationMap, xMarkMap, 'horizontal'); + }, + _buildVertical: function (seriesArray, maxDataLength, locationMap, xMarkMap) { + return this._buildNormal(seriesArray, maxDataLength, locationMap, xMarkMap, 'vertical'); + }, + _buildOther: function (seriesArray, maxDataLength, locationMap, xMarkMap) { + var series = this.series; + for (var j = 0, k = locationMap.length; j < k; j++) { + for (var m = 0, n = locationMap[j].length; m < n; m++) { + var seriesIndex = locationMap[j][m]; + var serie = series[seriesIndex]; + var xAxisIndex = serie.xAxisIndex || 0; + var xAxis = this.component.xAxis.getAxis(xAxisIndex); + var baseX = xAxis.getCoord(0); + var yAxisIndex = serie.yAxisIndex || 0; + var yAxis = this.component.yAxis.getAxis(yAxisIndex); + var baseY = yAxis.getCoord(0); + xMarkMap[seriesIndex] = xMarkMap[seriesIndex] || { + min0: Number.POSITIVE_INFINITY, + min1: Number.POSITIVE_INFINITY, + max0: Number.NEGATIVE_INFINITY, + max1: Number.NEGATIVE_INFINITY, + sum0: 0, + sum1: 0, + counter0: 0, + counter1: 0, + average0: 0, + average1: 0 + }; + for (var i = 0, l = serie.data.length; i < l; i++) { + var data = serie.data[i]; + var value = this.getDataFromOption(data, '-'); + if (!(value instanceof Array)) { + continue; + } + var x = xAxis.getCoord(value[0]); + var y = yAxis.getCoord(value[1]); + var queryTarget = [ + data, + serie + ]; + var barWidth = this.deepQuery(queryTarget, 'barWidth') || 10; + var barHeight = this.deepQuery(queryTarget, 'barHeight'); + var orient; + var barShape; + if (barHeight != null) { + orient = 'horizontal'; + if (value[0] > 0) { + barWidth = x - baseX; + x -= barWidth; + } else if (value[0] < 0) { + barWidth = baseX - x; + } else { + barWidth = 0; + } + barShape = this._getBarItem(seriesIndex, i, value[0], x, y - barHeight / 2, barWidth, barHeight, orient); + } else { + orient = 'vertical'; + if (value[1] > 0) { + barHeight = baseY - y; + } else if (value[1] < 0) { + barHeight = y - baseY; + y -= barHeight; + } else { + barHeight = 0; + } + barShape = this._getBarItem(seriesIndex, i, value[0], x - barWidth / 2, y, barWidth, barHeight, orient); + } + this.shapeList.push(new RectangleShape(barShape)); + x = xAxis.getCoord(value[0]); + y = yAxis.getCoord(value[1]); + if (xMarkMap[seriesIndex].min0 > value[0]) { + xMarkMap[seriesIndex].min0 = value[0]; + xMarkMap[seriesIndex].minY0 = y; + xMarkMap[seriesIndex].minX0 = x; + } + if (xMarkMap[seriesIndex].max0 < value[0]) { + xMarkMap[seriesIndex].max0 = value[0]; + xMarkMap[seriesIndex].maxY0 = y; + xMarkMap[seriesIndex].maxX0 = x; + } + xMarkMap[seriesIndex].sum0 += value[0]; + xMarkMap[seriesIndex].counter0++; + if (xMarkMap[seriesIndex].min1 > value[1]) { + xMarkMap[seriesIndex].min1 = value[1]; + xMarkMap[seriesIndex].minY1 = y; + xMarkMap[seriesIndex].minX1 = x; + } + if (xMarkMap[seriesIndex].max1 < value[1]) { + xMarkMap[seriesIndex].max1 = value[1]; + xMarkMap[seriesIndex].maxY1 = y; + xMarkMap[seriesIndex].maxX1 = x; + } + xMarkMap[seriesIndex].sum1 += value[1]; + xMarkMap[seriesIndex].counter1++; + } + } + } + this._calculMarkMapXY(xMarkMap, locationMap, 'xy'); + }, + _mapSize: function (categoryAxis, locationMap, ignoreUserDefined) { + var res = this._findSpecialBarSzie(locationMap, ignoreUserDefined); + var barWidthMap = res.barWidthMap; + var barMaxWidthMap = res.barMaxWidthMap; + var barMinHeightMap = res.barMinHeightMap; + var sBarWidthCounter = res.sBarWidthCounter; + var sBarWidthTotal = res.sBarWidthTotal; + var barGap = res.barGap; + var barCategoryGap = res.barCategoryGap; + var gap; + var barWidth; + var interval = 1; + if (locationMap.length != sBarWidthCounter) { + if (!ignoreUserDefined) { + gap = typeof barCategoryGap === 'string' && barCategoryGap.match(/%$/) ? (categoryAxis.getGap() * (100 - parseFloat(barCategoryGap)) / 100).toFixed(2) - 0 : categoryAxis.getGap() - barCategoryGap; + if (typeof barGap === 'string' && barGap.match(/%$/)) { + barGap = parseFloat(barGap) / 100; + barWidth = +((gap - sBarWidthTotal) / ((locationMap.length - 1) * barGap + locationMap.length - sBarWidthCounter)).toFixed(2); + barGap = barWidth * barGap; + } else { + barGap = parseFloat(barGap); + barWidth = +((gap - sBarWidthTotal - barGap * (locationMap.length - 1)) / (locationMap.length - sBarWidthCounter)).toFixed(2); + } + if (barWidth <= 0) { + return this._mapSize(categoryAxis, locationMap, true); + } + } else { + gap = categoryAxis.getGap(); + barGap = 0; + barWidth = +(gap / locationMap.length).toFixed(2); + if (barWidth <= 0) { + interval = Math.floor(locationMap.length / gap); + barWidth = 1; + } + } + } else { + gap = sBarWidthCounter > 1 ? typeof barCategoryGap === 'string' && barCategoryGap.match(/%$/) ? +(categoryAxis.getGap() * (100 - parseFloat(barCategoryGap)) / 100).toFixed(2) : categoryAxis.getGap() - barCategoryGap : sBarWidthTotal; + barWidth = 0; + barGap = sBarWidthCounter > 1 ? +((gap - sBarWidthTotal) / (sBarWidthCounter - 1)).toFixed(2) : 0; + if (barGap < 0) { + return this._mapSize(categoryAxis, locationMap, true); + } + } + return this._recheckBarMaxWidth(locationMap, barWidthMap, barMaxWidthMap, barMinHeightMap, gap, barWidth, barGap, interval); + }, + _findSpecialBarSzie: function (locationMap, ignoreUserDefined) { + var series = this.series; + var barWidthMap = {}; + var barMaxWidthMap = {}; + var barMinHeightMap = {}; + var sBarWidth; + var sBarMaxWidth; + var sBarWidthCounter = 0; + var sBarWidthTotal = 0; + var barGap; + var barCategoryGap; + for (var j = 0, k = locationMap.length; j < k; j++) { + var hasFound = { + barWidth: false, + barMaxWidth: false + }; + for (var m = 0, n = locationMap[j].length; m < n; m++) { + var seriesIndex = locationMap[j][m]; + var queryTarget = series[seriesIndex]; + if (!ignoreUserDefined) { + if (!hasFound.barWidth) { + sBarWidth = this.query(queryTarget, 'barWidth'); + if (sBarWidth != null) { + barWidthMap[seriesIndex] = sBarWidth; + sBarWidthTotal += sBarWidth; + sBarWidthCounter++; + hasFound.barWidth = true; + for (var ii = 0, ll = m; ii < ll; ii++) { + var pSeriesIndex = locationMap[j][ii]; + barWidthMap[pSeriesIndex] = sBarWidth; + } + } + } else { + barWidthMap[seriesIndex] = sBarWidth; + } + if (!hasFound.barMaxWidth) { + sBarMaxWidth = this.query(queryTarget, 'barMaxWidth'); + if (sBarMaxWidth != null) { + barMaxWidthMap[seriesIndex] = sBarMaxWidth; + hasFound.barMaxWidth = true; + for (var ii = 0, ll = m; ii < ll; ii++) { + var pSeriesIndex = locationMap[j][ii]; + barMaxWidthMap[pSeriesIndex] = sBarMaxWidth; + } + } + } else { + barMaxWidthMap[seriesIndex] = sBarMaxWidth; + } + } + barMinHeightMap[seriesIndex] = this.query(queryTarget, 'barMinHeight'); + barGap = barGap != null ? barGap : this.query(queryTarget, 'barGap'); + barCategoryGap = barCategoryGap != null ? barCategoryGap : this.query(queryTarget, 'barCategoryGap'); + } + } + return { + barWidthMap: barWidthMap, + barMaxWidthMap: barMaxWidthMap, + barMinHeightMap: barMinHeightMap, + sBarWidth: sBarWidth, + sBarMaxWidth: sBarMaxWidth, + sBarWidthCounter: sBarWidthCounter, + sBarWidthTotal: sBarWidthTotal, + barGap: barGap, + barCategoryGap: barCategoryGap + }; + }, + _recheckBarMaxWidth: function (locationMap, barWidthMap, barMaxWidthMap, barMinHeightMap, gap, barWidth, barGap, interval) { + for (var j = 0, k = locationMap.length; j < k; j++) { + var seriesIndex = locationMap[j][0]; + if (barMaxWidthMap[seriesIndex] && barMaxWidthMap[seriesIndex] < barWidth) { + gap -= barWidth - barMaxWidthMap[seriesIndex]; + } + } + return { + barWidthMap: barWidthMap, + barMaxWidthMap: barMaxWidthMap, + barMinHeightMap: barMinHeightMap, + gap: gap, + barWidth: barWidth, + barGap: barGap, + interval: interval + }; + }, + _getBarItem: function (seriesIndex, dataIndex, name, x, y, width, height, orient) { + var series = this.series; + var barShape; + var serie = series[seriesIndex]; + var data = serie.data[dataIndex]; + var defaultColor = this._sIndex2ColorMap[seriesIndex]; + var queryTarget = [ + data, + serie + ]; + var normal = this.deepMerge(queryTarget, 'itemStyle.normal'); + var emphasis = this.deepMerge(queryTarget, 'itemStyle.emphasis'); + var normalBorderWidth = normal.barBorderWidth; + barShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + clickable: this.deepQuery(queryTarget, 'clickable'), + style: { + x: x, + y: y, + width: width, + height: height, + brushType: 'both', + color: this.getItemStyleColor(this.deepQuery(queryTarget, 'itemStyle.normal.color') || defaultColor, seriesIndex, dataIndex, data), + radius: normal.barBorderRadius, + lineWidth: normalBorderWidth, + strokeColor: normal.barBorderColor + }, + highlightStyle: { + color: this.getItemStyleColor(this.deepQuery(queryTarget, 'itemStyle.emphasis.color'), seriesIndex, dataIndex, data), + radius: emphasis.barBorderRadius, + lineWidth: emphasis.barBorderWidth, + strokeColor: emphasis.barBorderColor + }, + _orient: orient + }; + var barShapeStyle = barShape.style; + barShape.highlightStyle.color = barShape.highlightStyle.color || (typeof barShapeStyle.color === 'string' ? zrColor.lift(barShapeStyle.color, -0.3) : barShapeStyle.color); + barShapeStyle.x = Math.floor(barShapeStyle.x); + barShapeStyle.y = Math.floor(barShapeStyle.y); + barShapeStyle.height = Math.ceil(barShapeStyle.height); + barShapeStyle.width = Math.ceil(barShapeStyle.width); + if (normalBorderWidth > 0 && barShapeStyle.height > normalBorderWidth && barShapeStyle.width > normalBorderWidth) { + barShapeStyle.y += normalBorderWidth / 2; + barShapeStyle.height -= normalBorderWidth; + barShapeStyle.x += normalBorderWidth / 2; + barShapeStyle.width -= normalBorderWidth; + } else { + barShapeStyle.brushType = 'fill'; + } + barShape.highlightStyle.textColor = barShape.highlightStyle.color; + barShape = this.addLabel(barShape, serie, data, name, orient); + var textPosition = barShapeStyle.textPosition; + if (textPosition === 'insideLeft' || textPosition === 'insideRight' || textPosition === 'insideTop' || textPosition === 'insideBottom') { + var gap = 5; + switch (textPosition) { + case 'insideLeft': + barShapeStyle.textX = barShapeStyle.x + gap; + barShapeStyle.textY = barShapeStyle.y + barShapeStyle.height / 2; + barShapeStyle.textAlign = 'left'; + barShapeStyle.textBaseline = 'middle'; + break; + case 'insideRight': + barShapeStyle.textX = barShapeStyle.x + barShapeStyle.width - gap; + barShapeStyle.textY = barShapeStyle.y + barShapeStyle.height / 2; + barShapeStyle.textAlign = 'right'; + barShapeStyle.textBaseline = 'middle'; + break; + case 'insideTop': + barShapeStyle.textX = barShapeStyle.x + barShapeStyle.width / 2; + barShapeStyle.textY = barShapeStyle.y + gap / 2; + barShapeStyle.textAlign = 'center'; + barShapeStyle.textBaseline = 'top'; + break; + case 'insideBottom': + barShapeStyle.textX = barShapeStyle.x + barShapeStyle.width / 2; + barShapeStyle.textY = barShapeStyle.y + barShapeStyle.height - gap / 2; + barShapeStyle.textAlign = 'center'; + barShapeStyle.textBaseline = 'bottom'; + break; + } + barShapeStyle.textPosition = 'specific'; + barShapeStyle.textColor = barShapeStyle.textColor || '#fff'; + } + if (this.deepQuery([ + data, + serie, + this.option + ], 'calculable')) { + this.setCalculable(barShape); + barShape.draggable = true; + } + ecData.pack(barShape, series[seriesIndex], seriesIndex, series[seriesIndex].data[dataIndex], dataIndex, name); + return barShape; + }, + getMarkCoord: function (seriesIndex, mpData) { + var serie = this.series[seriesIndex]; + var xMarkMap = this.xMarkMap[seriesIndex]; + var xAxis = this.component.xAxis.getAxis(serie.xAxisIndex); + var yAxis = this.component.yAxis.getAxis(serie.yAxisIndex); + var dataIndex; + var pos; + if (mpData.type && (mpData.type === 'max' || mpData.type === 'min' || mpData.type === 'average')) { + var valueIndex = mpData.valueIndex != null ? mpData.valueIndex : xMarkMap.maxX0 != null ? '1' : ''; + pos = [ + xMarkMap[mpData.type + 'X' + valueIndex], + xMarkMap[mpData.type + 'Y' + valueIndex], + xMarkMap[mpData.type + 'Line' + valueIndex], + xMarkMap[mpData.type + valueIndex] + ]; + } else if (xMarkMap.isHorizontal) { + dataIndex = typeof mpData.xAxis === 'string' && xAxis.getIndexByName ? xAxis.getIndexByName(mpData.xAxis) : mpData.xAxis || 0; + var x = xMarkMap[dataIndex]; + x = x != null ? x : typeof mpData.xAxis != 'string' && xAxis.getCoordByIndex ? xAxis.getCoordByIndex(mpData.xAxis || 0) : xAxis.getCoord(mpData.xAxis || 0); + pos = [ + x, + yAxis.getCoord(mpData.yAxis || 0) + ]; + } else { + dataIndex = typeof mpData.yAxis === 'string' && yAxis.getIndexByName ? yAxis.getIndexByName(mpData.yAxis) : mpData.yAxis || 0; + var y = xMarkMap[dataIndex]; + y = y != null ? y : typeof mpData.yAxis != 'string' && yAxis.getCoordByIndex ? yAxis.getCoordByIndex(mpData.yAxis || 0) : yAxis.getCoord(mpData.yAxis || 0); + pos = [ + xAxis.getCoord(mpData.xAxis || 0), + y + ]; + } + return pos; + }, + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + this.backupShapeList(); + this._buildShape(); + }, + addDataAnimation: function (params) { + var series = this.series; + var aniMap = {}; + for (var i = 0, l = params.length; i < l; i++) { + aniMap[params[i][0]] = params[i]; + } + var x; + var dx; + var y; + var dy; + var serie; + var seriesIndex; + var dataIndex; + for (var i = this.shapeList.length - 1; i >= 0; i--) { + seriesIndex = ecData.get(this.shapeList[i], 'seriesIndex'); + if (aniMap[seriesIndex] && !aniMap[seriesIndex][3]) { + if (this.shapeList[i].type === 'rectangle') { + dataIndex = ecData.get(this.shapeList[i], 'dataIndex'); + serie = series[seriesIndex]; + if (aniMap[seriesIndex][2] && dataIndex === serie.data.length - 1) { + this.zr.delShape(this.shapeList[i].id); + continue; + } else if (!aniMap[seriesIndex][2] && dataIndex === 0) { + this.zr.delShape(this.shapeList[i].id); + continue; + } + if (this.shapeList[i]._orient === 'horizontal') { + dy = this.component.yAxis.getAxis(serie.yAxisIndex || 0).getGap(); + y = aniMap[seriesIndex][2] ? -dy : dy; + x = 0; + } else { + dx = this.component.xAxis.getAxis(serie.xAxisIndex || 0).getGap(); + x = aniMap[seriesIndex][2] ? dx : -dx; + y = 0; + } + this.shapeList[i].position = [ + 0, + 0 + ]; + this.zr.animate(this.shapeList[i].id, '').when(this.query(this.option, 'animationDurationUpdate'), { + position: [ + x, + y + ] + }).start(); + } + } + } + } + }; + zrUtil.inherits(Bar, ChartBase); + require('../chart').define('bar', Bar); + return Bar; +}); \ No newline at end of file diff --git a/build/source/chart/chord.js b/build/source/chart/chord.js new file mode 100644 index 0000000..e23f3a2 --- /dev/null +++ b/build/source/chart/chord.js @@ -0,0 +1,1304 @@ +define('echarts/chart/chord', [ + 'require', + './base', + 'zrender/shape/Text', + 'zrender/shape/Line', + 'zrender/shape/Sector', + '../util/shape/Ribbon', + '../util/shape/Icon', + 'zrender/shape/BezierCurve', + '../config', + '../util/ecData', + 'zrender/tool/util', + 'zrender/tool/vector', + '../data/Graph', + '../layout/Chord', + '../chart' +], function (require) { + 'use strict'; + var ChartBase = require('./base'); + var TextShape = require('zrender/shape/Text'); + var LineShape = require('zrender/shape/Line'); + var SectorShape = require('zrender/shape/Sector'); + var RibbonShape = require('../util/shape/Ribbon'); + var IconShape = require('../util/shape/Icon'); + var BezierCurveShape = require('zrender/shape/BezierCurve'); + var ecConfig = require('../config'); + ecConfig.chord = { + zlevel: 0, + z: 2, + clickable: true, + radius: [ + '65%', + '75%' + ], + center: [ + '50%', + '50%' + ], + padding: 2, + sort: 'none', + sortSub: 'none', + startAngle: 90, + clockWise: true, + ribbonType: true, + minRadius: 10, + maxRadius: 20, + symbol: 'circle', + showScale: false, + showScaleText: false, + itemStyle: { + normal: { + borderWidth: 0, + borderColor: '#000', + label: { + show: true, + rotate: false, + distance: 5 + }, + chordStyle: { + width: 1, + color: 'black', + borderWidth: 1, + borderColor: '#999', + opacity: 0.5 + } + }, + emphasis: { + borderWidth: 0, + borderColor: '#000', + chordStyle: { + width: 1, + color: 'black', + borderWidth: 1, + borderColor: '#999' + } + } + } + }; + var ecData = require('../util/ecData'); + var zrUtil = require('zrender/tool/util'); + var vec2 = require('zrender/tool/vector'); + var Graph = require('../data/Graph'); + var ChordLayout = require('../layout/Chord'); + function Chord(ecTheme, messageCenter, zr, option, myChart) { + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); + this.scaleLineLength = 4; + this.scaleUnitAngle = 4; + this.refresh(option); + } + Chord.prototype = { + type: ecConfig.CHART_TYPE_CHORD, + _init: function () { + var series = this.series; + this.selectedMap = {}; + var chordSeriesMap = {}; + var chordSeriesGroups = {}; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type === this.type) { + var _isSelected = this.isSelected(series[i].name); + this.selectedMap[series[i].name] = _isSelected; + if (_isSelected) { + this.buildMark(i); + } + this.reformOption(series[i]); + chordSeriesMap[series[i].name] = series[i]; + } + } + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type === this.type) { + if (series[i].insertToSerie) { + var referenceSerie = chordSeriesMap[series[i].insertToSerie]; + series[i]._referenceSerie = referenceSerie; + } else { + chordSeriesGroups[series[i].name] = [series[i]]; + } + } + } + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type === this.type) { + if (series[i].insertToSerie) { + var mainSerie = series[i]._referenceSerie; + while (mainSerie && mainSerie._referenceSerie) { + mainSerie = mainSerie._referenceSerie; + } + if (chordSeriesGroups[mainSerie.name] && this.selectedMap[series[i].name]) { + chordSeriesGroups[mainSerie.name].push(series[i]); + } + } + } + } + for (var name in chordSeriesGroups) { + this._buildChords(chordSeriesGroups[name]); + } + this.addShapeList(); + }, + _getNodeCategory: function (serie, group) { + return serie.categories && serie.categories[group.category || 0]; + }, + _getNodeQueryTarget: function (serie, group) { + var category = this._getNodeCategory(serie, group); + return [ + group, + category, + serie + ]; + }, + _getEdgeQueryTarget: function (serie, edge, type) { + type = type || 'normal'; + return [ + edge.itemStyle && edge.itemStyle[type], + serie.itemStyle[type].chordStyle + ]; + }, + _buildChords: function (series) { + var graphs = []; + var mainSerie = series[0]; + var nodeFilter = function (n) { + return n.layout.size > 0; + }; + var createEdgeFilter = function (graph) { + return function (e) { + return graph.getEdge(e.node2, e.node1); + }; + }; + for (var i = 0; i < series.length; i++) { + var serie = series[i]; + if (this.selectedMap[serie.name]) { + var graph; + if (serie.data && serie.matrix) { + graph = this._getSerieGraphFromDataMatrix(serie, mainSerie); + } else if (serie.nodes && serie.links) { + graph = this._getSerieGraphFromNodeLinks(serie, mainSerie); + } + graph.filterNode(nodeFilter, this); + if (serie.ribbonType) { + graph.filterEdge(createEdgeFilter(graph)); + } + graphs.push(graph); + graph.__serie = serie; + } + } + if (!graphs.length) { + return; + } + var mainGraph = graphs[0]; + if (!mainSerie.ribbonType) { + var minRadius = mainSerie.minRadius; + var maxRadius = mainSerie.maxRadius; + var min = Infinity, max = -Infinity; + mainGraph.eachNode(function (node) { + max = Math.max(node.layout.size, max); + min = Math.min(node.layout.size, min); + }); + var multiplier = (maxRadius - minRadius) / (max - min); + mainGraph.eachNode(function (node) { + var queryTarget = this._getNodeQueryTarget(mainSerie, node); + var symbolSize = this.query(queryTarget, 'symbolSize'); + if (max === min) { + node.layout.size = symbolSize || min; + } else { + node.layout.size = symbolSize || (node.layout.size - min) * multiplier + minRadius; + } + }, this); + } + var layout = new ChordLayout(); + layout.clockWise = mainSerie.clockWise; + layout.startAngle = mainSerie.startAngle * Math.PI / 180; + if (!layout.clockWise) { + layout.startAngle = -layout.startAngle; + } + layout.padding = mainSerie.padding * Math.PI / 180; + layout.sort = mainSerie.sort; + layout.sortSub = mainSerie.sortSub; + layout.directed = mainSerie.ribbonType; + layout.run(graphs); + var showLabel = this.query(mainSerie, 'itemStyle.normal.label.show'); + if (mainSerie.ribbonType) { + this._buildSectors(mainSerie, 0, mainGraph, mainSerie, graphs); + if (showLabel) { + this._buildLabels(mainSerie, 0, mainGraph, mainSerie, graphs); + } + for (var i = 0, j = 0; i < series.length; i++) { + if (this.selectedMap[series[i].name]) { + this._buildRibbons(series, i, graphs[j++], mainSerie); + } + } + if (mainSerie.showScale) { + this._buildScales(mainSerie, 0, mainGraph); + } + } else { + this._buildNodeIcons(mainSerie, 0, mainGraph, mainSerie, graphs); + if (showLabel) { + this._buildLabels(mainSerie, 0, mainGraph, mainSerie, graphs); + } + for (var i = 0, j = 0; i < series.length; i++) { + if (this.selectedMap[series[i].name]) { + this._buildEdgeCurves(series, i, graphs[j++], mainSerie, mainGraph); + } + } + } + this._initHoverHandler(series, graphs); + }, + _getSerieGraphFromDataMatrix: function (serie, mainSerie) { + var nodesData = []; + var count = 0; + var matrix = []; + for (var i = 0; i < serie.matrix.length; i++) { + matrix[i] = serie.matrix[i].slice(); + } + var data = serie.data || serie.nodes; + for (var i = 0; i < data.length; i++) { + var node = {}; + var group = data[i]; + group.rawIndex = i; + for (var key in group) { + if (key === 'name') { + node['id'] = group['name']; + } else { + node[key] = group[key]; + } + } + var category = this._getNodeCategory(mainSerie, group); + var name = category ? category.name : group.name; + this.selectedMap[name] = this.isSelected(name); + if (this.selectedMap[name]) { + nodesData.push(node); + count++; + } else { + matrix.splice(count, 1); + for (var j = 0; j < matrix.length; j++) { + matrix[j].splice(count, 1); + } + } + } + var graph = Graph.fromMatrix(nodesData, matrix, true); + graph.eachNode(function (n, idx) { + n.layout = { size: n.data.outValue }; + n.rawIndex = n.data.rawIndex; + }); + graph.eachEdge(function (e) { + e.layout = { weight: e.data.weight }; + }); + return graph; + }, + _getSerieGraphFromNodeLinks: function (serie, mainSerie) { + var graph = new Graph(true); + var nodes = serie.data || serie.nodes; + for (var i = 0, len = nodes.length; i < len; i++) { + var n = nodes[i]; + if (!n || n.ignore) { + continue; + } + var category = this._getNodeCategory(mainSerie, n); + var name = category ? category.name : n.name; + this.selectedMap[name] = this.isSelected(name); + if (this.selectedMap[name]) { + var node = graph.addNode(n.name, n); + node.rawIndex = i; + } + } + for (var i = 0, len = serie.links.length; i < len; i++) { + var e = serie.links[i]; + var n1 = e.source; + var n2 = e.target; + if (typeof n1 === 'number') { + n1 = nodes[n1]; + if (n1) { + n1 = n1.name; + } + } + if (typeof n2 === 'number') { + n2 = nodes[n2]; + if (n2) { + n2 = n2.name; + } + } + var edge = graph.addEdge(n1, n2, e); + if (edge) { + edge.rawIndex = i; + } + } + graph.eachNode(function (n) { + var value = n.data.value; + if (value == null) { + value = 0; + if (mainSerie.ribbonType) { + for (var i = 0; i < n.outEdges.length; i++) { + value += n.outEdges[i].data.weight || 0; + } + } else { + for (var i = 0; i < n.edges.length; i++) { + value += n.edges[i].data.weight || 0; + } + } + } + n.layout = { size: value }; + }); + graph.eachEdge(function (e) { + e.layout = { weight: e.data.weight == null ? 1 : e.data.weight }; + }); + return graph; + }, + _initHoverHandler: function (series, graphs) { + var mainSerie = series[0]; + var mainGraph = graphs[0]; + var self = this; + mainGraph.eachNode(function (node) { + node.shape.onmouseover = function () { + mainGraph.eachNode(function (n) { + n.shape.style.opacity = 0.1; + if (n.labelShape) { + n.labelShape.style.opacity = 0.1; + n.labelShape.modSelf(); + } + n.shape.modSelf(); + }); + for (var i = 0; i < graphs.length; i++) { + for (var j = 0; j < graphs[i].edges.length; j++) { + var e = graphs[i].edges[j]; + var queryTarget = self._getEdgeQueryTarget(graphs[i].__serie, e.data); + e.shape.style.opacity = self.deepQuery(queryTarget, 'opacity') * 0.1; + e.shape.modSelf(); + } + } + node.shape.style.opacity = 1; + if (node.labelShape) { + node.labelShape.style.opacity = 1; + } + for (var i = 0; i < graphs.length; i++) { + var n = graphs[i].getNodeById(node.id); + if (n) { + for (var j = 0; j < n.outEdges.length; j++) { + var e = n.outEdges[j]; + var queryTarget = self._getEdgeQueryTarget(graphs[i].__serie, e.data); + e.shape.style.opacity = self.deepQuery(queryTarget, 'opacity'); + var other = graphs[0].getNodeById(e.node2.id); + if (other) { + if (other.shape) { + other.shape.style.opacity = 1; + } + if (other.labelShape) { + other.labelShape.style.opacity = 1; + } + } + } + } + } + self.zr.refreshNextFrame(); + }; + node.shape.onmouseout = function () { + mainGraph.eachNode(function (n) { + n.shape.style.opacity = 1; + if (n.labelShape) { + n.labelShape.style.opacity = 1; + n.labelShape.modSelf(); + } + n.shape.modSelf(); + }); + for (var i = 0; i < graphs.length; i++) { + for (var j = 0; j < graphs[i].edges.length; j++) { + var e = graphs[i].edges[j]; + var queryTarget = [ + e.data, + mainSerie + ]; + e.shape.style.opacity = self.deepQuery(queryTarget, 'itemStyle.normal.chordStyle.opacity'); + e.shape.modSelf(); + } + } + self.zr.refreshNextFrame(); + }; + }); + }, + _buildSectors: function (serie, serieIdx, graph, mainSerie) { + var center = this.parseCenter(this.zr, mainSerie.center); + var radius = this.parseRadius(this.zr, mainSerie.radius); + var clockWise = mainSerie.clockWise; + var sign = clockWise ? 1 : -1; + graph.eachNode(function (node) { + var category = this._getNodeCategory(mainSerie, node.data); + var color = category ? this.getColor(category.name) : this.getColor(node.id); + var startAngle = node.layout.startAngle / Math.PI * 180 * sign; + var endAngle = node.layout.endAngle / Math.PI * 180 * sign; + var sector = new SectorShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: center[0], + y: center[1], + r0: radius[0], + r: radius[1], + startAngle: startAngle, + endAngle: endAngle, + brushType: 'fill', + opacity: 1, + color: color, + clockWise: clockWise + }, + clickable: mainSerie.clickable, + highlightStyle: { brushType: 'fill' } + }); + sector.style.lineWidth = this.deepQuery([ + node.data, + mainSerie + ], 'itemStyle.normal.borderWidth'); + sector.highlightStyle.lineWidth = this.deepQuery([ + node.data, + mainSerie + ], 'itemStyle.emphasis.borderWidth'); + sector.style.strokeColor = this.deepQuery([ + node.data, + mainSerie + ], 'itemStyle.normal.borderColor'); + sector.highlightStyle.strokeColor = this.deepQuery([ + node.data, + mainSerie + ], 'itemStyle.emphasis.borderColor'); + if (sector.style.lineWidth > 0) { + sector.style.brushType = 'both'; + } + if (sector.highlightStyle.lineWidth > 0) { + sector.highlightStyle.brushType = 'both'; + } + ecData.pack(sector, serie, serieIdx, node.data, node.rawIndex, node.id, node.category); + this.shapeList.push(sector); + node.shape = sector; + }, this); + }, + _buildNodeIcons: function (serie, serieIdx, graph, mainSerie) { + var center = this.parseCenter(this.zr, mainSerie.center); + var radius = this.parseRadius(this.zr, mainSerie.radius); + var r = radius[1]; + graph.eachNode(function (node) { + var startAngle = node.layout.startAngle; + var endAngle = node.layout.endAngle; + var angle = (startAngle + endAngle) / 2; + var x = r * Math.cos(angle); + var y = r * Math.sin(angle); + var queryTarget = this._getNodeQueryTarget(mainSerie, node.data); + var category = this._getNodeCategory(mainSerie, node.data); + var color = this.deepQuery(queryTarget, 'itemStyle.normal.color'); + if (!color) { + color = category ? this.getColor(category.name) : this.getColor(node.id); + } + var iconShape = new IconShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + style: { + x: -node.layout.size, + y: -node.layout.size, + width: node.layout.size * 2, + height: node.layout.size * 2, + iconType: this.deepQuery(queryTarget, 'symbol'), + color: color, + brushType: 'both', + lineWidth: this.deepQuery(queryTarget, 'itemStyle.normal.borderWidth'), + strokeColor: this.deepQuery(queryTarget, 'itemStyle.normal.borderColor') + }, + highlightStyle: { + color: this.deepQuery(queryTarget, 'itemStyle.emphasis.color'), + lineWidth: this.deepQuery(queryTarget, 'itemStyle.emphasis.borderWidth'), + strokeColor: this.deepQuery(queryTarget, 'itemStyle.emphasis.borderColor') + }, + clickable: mainSerie.clickable, + position: [ + x + center[0], + y + center[1] + ] + }); + ecData.pack(iconShape, serie, serieIdx, node.data, node.rawIndex, node.id, node.category); + this.shapeList.push(iconShape); + node.shape = iconShape; + }, this); + }, + _buildLabels: function (serie, serieIdx, graph, mainSerie) { + var labelColor = this.query(mainSerie, 'itemStyle.normal.label.color'); + var rotateLabel = this.query(mainSerie, 'itemStyle.normal.label.rotate'); + var labelDistance = this.query(mainSerie, 'itemStyle.normal.label.distance'); + var center = this.parseCenter(this.zr, mainSerie.center); + var radius = this.parseRadius(this.zr, mainSerie.radius); + var clockWise = mainSerie.clockWise; + var sign = clockWise ? 1 : -1; + graph.eachNode(function (node) { + var startAngle = node.layout.startAngle / Math.PI * 180 * sign; + var endAngle = node.layout.endAngle / Math.PI * 180 * sign; + var angle = (startAngle * -sign + endAngle * -sign) / 2; + angle %= 360; + if (angle < 0) { + angle += 360; + } + var isRightSide = angle <= 90 || angle >= 270; + angle = angle * Math.PI / 180; + var v = [ + Math.cos(angle), + -Math.sin(angle) + ]; + var distance = 0; + if (mainSerie.ribbonType) { + distance = mainSerie.showScaleText ? 35 + labelDistance : labelDistance; + } else { + distance = labelDistance + node.layout.size; + } + var start = vec2.scale([], v, radius[1] + distance); + vec2.add(start, start, center); + var labelShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + hoverable: false, + style: { + text: node.data.label == null ? node.id : node.data.label, + textAlign: isRightSide ? 'left' : 'right', + color: labelColor || '#000000' + } + }; + if (rotateLabel) { + labelShape.rotation = isRightSide ? angle : Math.PI + angle; + if (isRightSide) { + labelShape.style.x = radius[1] + distance; + } else { + labelShape.style.x = -radius[1] - distance; + } + labelShape.style.y = 0; + labelShape.position = center.slice(); + } else { + labelShape.style.x = start[0]; + labelShape.style.y = start[1]; + } + labelShape.style.textColor = this.deepQuery([ + node.data, + mainSerie + ], 'itemStyle.normal.label.textStyle.color') || '#fff'; + labelShape.style.textFont = this.getFont(this.deepQuery([ + node.data, + mainSerie + ], 'itemStyle.normal.label.textStyle')); + labelShape = new TextShape(labelShape); + this.shapeList.push(labelShape); + node.labelShape = labelShape; + }, this); + }, + _buildRibbons: function (series, serieIdx, graph, mainSerie) { + var serie = series[serieIdx]; + var center = this.parseCenter(this.zr, mainSerie.center); + var radius = this.parseRadius(this.zr, mainSerie.radius); + graph.eachEdge(function (edge, idx) { + var color; + var other = graph.getEdge(edge.node2, edge.node1); + if (!other || edge.shape) { + return; + } + if (other.shape) { + edge.shape = other.shape; + return; + } + var s0 = edge.layout.startAngle / Math.PI * 180; + var s1 = edge.layout.endAngle / Math.PI * 180; + var t0 = other.layout.startAngle / Math.PI * 180; + var t1 = other.layout.endAngle / Math.PI * 180; + if (series.length === 1) { + if (edge.layout.weight <= other.layout.weight) { + color = this.getColor(edge.node1.id); + } else { + color = this.getColor(edge.node2.id); + } + } else { + color = this.getColor(serie.name); + } + var queryTarget = this._getEdgeQueryTarget(serie, edge.data); + var queryTargetEmphasis = this._getEdgeQueryTarget(serie, edge.data, 'emphasis'); + var ribbon = new RibbonShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: center[0], + y: center[1], + r: radius[0], + source0: s0, + source1: s1, + target0: t0, + target1: t1, + brushType: 'both', + opacity: this.deepQuery(queryTarget, 'opacity'), + color: color, + lineWidth: this.deepQuery(queryTarget, 'borderWidth'), + strokeColor: this.deepQuery(queryTarget, 'borderColor'), + clockWise: mainSerie.clockWise + }, + clickable: mainSerie.clickable, + highlightStyle: { + brushType: 'both', + opacity: this.deepQuery(queryTargetEmphasis, 'opacity'), + lineWidth: this.deepQuery(queryTargetEmphasis, 'borderWidth'), + strokeColor: this.deepQuery(queryTargetEmphasis, 'borderColor') + } + }); + var node1, node2; + if (edge.layout.weight <= other.layout.weight) { + node1 = other.node1; + node2 = other.node2; + } else { + node1 = edge.node1; + node2 = edge.node2; + } + ecData.pack(ribbon, serie, serieIdx, edge.data, edge.rawIndex == null ? idx : edge.rawIndex, edge.data.name || node1.id + '-' + node2.id, node1.id, node2.id); + this.shapeList.push(ribbon); + edge.shape = ribbon; + }, this); + }, + _buildEdgeCurves: function (series, serieIdx, graph, mainSerie, mainGraph) { + var serie = series[serieIdx]; + var center = this.parseCenter(this.zr, mainSerie.center); + graph.eachEdge(function (e, idx) { + var node1 = mainGraph.getNodeById(e.node1.id); + var node2 = mainGraph.getNodeById(e.node2.id); + var shape1 = node1.shape; + var shape2 = node2.shape; + var queryTarget = this._getEdgeQueryTarget(serie, e.data); + var queryTargetEmphasis = this._getEdgeQueryTarget(serie, e.data, 'emphasis'); + var curveShape = new BezierCurveShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + xStart: shape1.position[0], + yStart: shape1.position[1], + xEnd: shape2.position[0], + yEnd: shape2.position[1], + cpX1: center[0], + cpY1: center[1], + lineWidth: this.deepQuery(queryTarget, 'width'), + strokeColor: this.deepQuery(queryTarget, 'color'), + opacity: this.deepQuery(queryTarget, 'opacity') + }, + highlightStyle: { + lineWidth: this.deepQuery(queryTargetEmphasis, 'width'), + strokeColor: this.deepQuery(queryTargetEmphasis, 'color'), + opacity: this.deepQuery(queryTargetEmphasis, 'opacity') + } + }); + ecData.pack(curveShape, serie, serieIdx, e.data, e.rawIndex == null ? idx : e.rawIndex, e.data.name || e.node1.id + '-' + e.node2.id, e.node1.id, e.node2.id); + this.shapeList.push(curveShape); + e.shape = curveShape; + }, this); + }, + _buildScales: function (serie, serieIdx, graph) { + var clockWise = serie.clockWise; + var center = this.parseCenter(this.zr, serie.center); + var radius = this.parseRadius(this.zr, serie.radius); + var sign = clockWise ? 1 : -1; + var sumValue = 0; + var maxValue = -Infinity; + var unitPostfix; + var unitScale; + if (serie.showScaleText) { + graph.eachNode(function (node) { + var val = node.data.value; + if (val > maxValue) { + maxValue = val; + } + sumValue += val; + }); + if (maxValue > 10000000000) { + unitPostfix = 'b'; + unitScale = 1e-9; + } else if (maxValue > 10000000) { + unitPostfix = 'm'; + unitScale = 0.000001; + } else if (maxValue > 10000) { + unitPostfix = 'k'; + unitScale = 0.001; + } else { + unitPostfix = ''; + unitScale = 1; + } + } + var unitValue = sumValue / (360 - serie.padding); + graph.eachNode(function (node) { + var startAngle = node.layout.startAngle / Math.PI * 180; + var endAngle = node.layout.endAngle / Math.PI * 180; + var scaleAngle = startAngle; + while (true) { + if (clockWise && scaleAngle > endAngle || !clockWise && scaleAngle < endAngle) { + break; + } + var theta = scaleAngle / 180 * Math.PI; + var v = [ + Math.cos(theta), + Math.sin(theta) + ]; + var start = vec2.scale([], v, radius[1] + 1); + vec2.add(start, start, center); + var end = vec2.scale([], v, radius[1] + this.scaleLineLength); + vec2.add(end, end, center); + var scaleShape = new LineShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase() - 1, + hoverable: false, + style: { + xStart: start[0], + yStart: start[1], + xEnd: end[0], + yEnd: end[1], + lineCap: 'round', + brushType: 'stroke', + strokeColor: '#666', + lineWidth: 1 + } + }); + this.shapeList.push(scaleShape); + scaleAngle += sign * this.scaleUnitAngle; + } + if (!serie.showScaleText) { + return; + } + var scaleTextAngle = startAngle; + var step = unitValue * 5 * this.scaleUnitAngle; + var scaleValue = 0; + while (true) { + if (clockWise && scaleTextAngle > endAngle || !clockWise && scaleTextAngle < endAngle) { + break; + } + var theta = scaleTextAngle; + theta = theta % 360; + if (theta < 0) { + theta += 360; + } + var isRightSide = theta <= 90 || theta >= 270; + var textShape = new TextShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase() - 1, + hoverable: false, + style: { + x: isRightSide ? radius[1] + this.scaleLineLength + 4 : -radius[1] - this.scaleLineLength - 4, + y: 0, + text: Math.round(scaleValue * 10) / 10 + unitPostfix, + textAlign: isRightSide ? 'left' : 'right' + }, + position: center.slice(), + rotation: isRightSide ? [ + -theta / 180 * Math.PI, + 0, + 0 + ] : [ + -(theta + 180) / 180 * Math.PI, + 0, + 0 + ] + }); + this.shapeList.push(textShape); + scaleValue += step * unitScale; + scaleTextAngle += sign * this.scaleUnitAngle * 5; + } + }, this); + }, + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + this.legend = this.component.legend; + if (this.legend) { + this.getColor = function (param) { + return this.legend.getColor(param); + }; + this.isSelected = function (param) { + return this.legend.isSelected(param); + }; + } else { + var colorMap = {}; + var count = 0; + this.getColor = function (key) { + if (colorMap[key]) { + return colorMap[key]; + } + if (!colorMap[key]) { + colorMap[key] = this.zr.getColor(count++); + } + return colorMap[key]; + }; + this.isSelected = function () { + return true; + }; + } + this.backupShapeList(); + this._init(); + }, + reformOption: function (opt) { + var _merge = zrUtil.merge; + opt = _merge(_merge(opt || {}, this.ecTheme.chord), ecConfig.chord); + opt.itemStyle.normal.label.textStyle = this.getTextStyle(opt.itemStyle.normal.label.textStyle); + } + }; + zrUtil.inherits(Chord, ChartBase); + require('../chart').define('chord', Chord); + return Chord; +});define('echarts/util/shape/Ribbon', [ + 'require', + 'zrender/shape/Base', + 'zrender/shape/util/PathProxy', + 'zrender/tool/util', + 'zrender/tool/area' +], function (require) { + var Base = require('zrender/shape/Base'); + var PathProxy = require('zrender/shape/util/PathProxy'); + var zrUtil = require('zrender/tool/util'); + var area = require('zrender/tool/area'); + function RibbonShape(options) { + Base.call(this, options); + this._pathProxy = new PathProxy(); + } + RibbonShape.prototype = { + type: 'ribbon', + buildPath: function (ctx, style) { + var clockWise = style.clockWise || false; + var path = this._pathProxy; + path.begin(ctx); + var cx = style.x; + var cy = style.y; + var r = style.r; + var s0 = style.source0 / 180 * Math.PI; + var s1 = style.source1 / 180 * Math.PI; + var t0 = style.target0 / 180 * Math.PI; + var t1 = style.target1 / 180 * Math.PI; + var sx0 = cx + Math.cos(s0) * r; + var sy0 = cy + Math.sin(s0) * r; + var sx1 = cx + Math.cos(s1) * r; + var sy1 = cy + Math.sin(s1) * r; + var tx0 = cx + Math.cos(t0) * r; + var ty0 = cy + Math.sin(t0) * r; + var tx1 = cx + Math.cos(t1) * r; + var ty1 = cy + Math.sin(t1) * r; + path.moveTo(sx0, sy0); + path.arc(cx, cy, style.r, s0, s1, !clockWise); + path.bezierCurveTo((cx - sx1) * 0.7 + sx1, (cy - sy1) * 0.7 + sy1, (cx - tx0) * 0.7 + tx0, (cy - ty0) * 0.7 + ty0, tx0, ty0); + if (style.source0 === style.target0 && style.source1 === style.target1) { + return; + } + path.arc(cx, cy, style.r, t0, t1, !clockWise); + path.bezierCurveTo((cx - tx1) * 0.7 + tx1, (cy - ty1) * 0.7 + ty1, (cx - sx0) * 0.7 + sx0, (cy - sy0) * 0.7 + sy0, sx0, sy0); + }, + getRect: function (style) { + if (style.__rect) { + return style.__rect; + } + if (!this._pathProxy.isEmpty()) { + this.buildPath(null, style); + } + return this._pathProxy.fastBoundingRect(); + }, + isCover: function (x, y) { + var rect = this.getRect(this.style); + if (x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height) { + return area.isInsidePath(this._pathProxy.pathCommands, 0, 'fill', x, y); + } + } + }; + zrUtil.inherits(RibbonShape, Base); + return RibbonShape; +});define('zrender/shape/BezierCurve', [ + 'require', + './Base', + '../tool/util' +], function (require) { + 'use strict'; + var Base = require('./Base'); + var BezierCurve = function (options) { + this.brushTypeOnly = 'stroke'; + this.textPosition = 'end'; + Base.call(this, options); + }; + BezierCurve.prototype = { + type: 'bezier-curve', + buildPath: function (ctx, style) { + ctx.moveTo(style.xStart, style.yStart); + if (typeof style.cpX2 != 'undefined' && typeof style.cpY2 != 'undefined') { + ctx.bezierCurveTo(style.cpX1, style.cpY1, style.cpX2, style.cpY2, style.xEnd, style.yEnd); + } else { + ctx.quadraticCurveTo(style.cpX1, style.cpY1, style.xEnd, style.yEnd); + } + }, + getRect: function (style) { + if (style.__rect) { + return style.__rect; + } + var _minX = Math.min(style.xStart, style.xEnd, style.cpX1); + var _minY = Math.min(style.yStart, style.yEnd, style.cpY1); + var _maxX = Math.max(style.xStart, style.xEnd, style.cpX1); + var _maxY = Math.max(style.yStart, style.yEnd, style.cpY1); + var _x2 = style.cpX2; + var _y2 = style.cpY2; + if (typeof _x2 != 'undefined' && typeof _y2 != 'undefined') { + _minX = Math.min(_minX, _x2); + _minY = Math.min(_minY, _y2); + _maxX = Math.max(_maxX, _x2); + _maxY = Math.max(_maxY, _y2); + } + var lineWidth = style.lineWidth || 1; + style.__rect = { + x: _minX - lineWidth, + y: _minY - lineWidth, + width: _maxX - _minX + lineWidth, + height: _maxY - _minY + lineWidth + }; + return style.__rect; + } + }; + require('../tool/util').inherits(BezierCurve, Base); + return BezierCurve; +});define('echarts/data/Graph', [ + 'require', + 'zrender/tool/util' +], function (require) { + var util = require('zrender/tool/util'); + 'use strict'; + var Graph = function (directed) { + this._directed = directed || false; + this.nodes = []; + this.edges = []; + this._nodesMap = {}; + this._edgesMap = {}; + }; + Graph.prototype.isDirected = function () { + return this._directed; + }; + Graph.prototype.addNode = function (id, data) { + if (this._nodesMap[id]) { + return this._nodesMap[id]; + } + var node = new Graph.Node(id, data); + this.nodes.push(node); + this._nodesMap[id] = node; + return node; + }; + Graph.prototype.getNodeById = function (id) { + return this._nodesMap[id]; + }; + Graph.prototype.addEdge = function (n1, n2, data) { + if (typeof n1 == 'string') { + n1 = this._nodesMap[n1]; + } + if (typeof n2 == 'string') { + n2 = this._nodesMap[n2]; + } + if (!n1 || !n2) { + return; + } + var key = n1.id + '-' + n2.id; + if (this._edgesMap[key]) { + return this._edgesMap[key]; + } + var edge = new Graph.Edge(n1, n2, data); + if (this._directed) { + n1.outEdges.push(edge); + n2.inEdges.push(edge); + } + n1.edges.push(edge); + if (n1 !== n2) { + n2.edges.push(edge); + } + this.edges.push(edge); + this._edgesMap[key] = edge; + return edge; + }; + Graph.prototype.removeEdge = function (edge) { + var n1 = edge.node1; + var n2 = edge.node2; + var key = n1.id + '-' + n2.id; + if (this._directed) { + n1.outEdges.splice(util.indexOf(n1.outEdges, edge), 1); + n2.inEdges.splice(util.indexOf(n2.inEdges, edge), 1); + } + n1.edges.splice(util.indexOf(n1.edges, edge), 1); + if (n1 !== n2) { + n2.edges.splice(util.indexOf(n2.edges, edge), 1); + } + delete this._edgesMap[key]; + this.edges.splice(util.indexOf(this.edges, edge), 1); + }; + Graph.prototype.getEdge = function (n1, n2) { + if (typeof n1 !== 'string') { + n1 = n1.id; + } + if (typeof n2 !== 'string') { + n2 = n2.id; + } + if (this._directed) { + return this._edgesMap[n1 + '-' + n2]; + } else { + return this._edgesMap[n1 + '-' + n2] || this._edgesMap[n2 + '-' + n1]; + } + }; + Graph.prototype.removeNode = function (node) { + if (typeof node === 'string') { + node = this._nodesMap[node]; + if (!node) { + return; + } + } + delete this._nodesMap[node.id]; + this.nodes.splice(util.indexOf(this.nodes, node), 1); + for (var i = 0; i < this.edges.length;) { + var edge = this.edges[i]; + if (edge.node1 === node || edge.node2 === node) { + this.removeEdge(edge); + } else { + i++; + } + } + }; + Graph.prototype.filterNode = function (cb, context) { + var len = this.nodes.length; + for (var i = 0; i < len;) { + if (cb.call(context, this.nodes[i], i)) { + i++; + } else { + this.removeNode(this.nodes[i]); + len--; + } + } + }; + Graph.prototype.filterEdge = function (cb, context) { + var len = this.edges.length; + for (var i = 0; i < len;) { + if (cb.call(context, this.edges[i], i)) { + i++; + } else { + this.removeEdge(this.edges[i]); + len--; + } + } + }; + Graph.prototype.eachNode = function (cb, context) { + var len = this.nodes.length; + for (var i = 0; i < len; i++) { + if (this.nodes[i]) { + cb.call(context, this.nodes[i], i); + } + } + }; + Graph.prototype.eachEdge = function (cb, context) { + var len = this.edges.length; + for (var i = 0; i < len; i++) { + if (this.edges[i]) { + cb.call(context, this.edges[i], i); + } + } + }; + Graph.prototype.clear = function () { + this.nodes.length = 0; + this.edges.length = 0; + this._nodesMap = {}; + this._edgesMap = {}; + }; + Graph.prototype.breadthFirstTraverse = function (cb, startNode, direction, context) { + if (typeof startNode === 'string') { + startNode = this._nodesMap[startNode]; + } + if (!startNode) { + return; + } + var edgeType = 'edges'; + if (direction === 'out') { + edgeType = 'outEdges'; + } else if (direction === 'in') { + edgeType = 'inEdges'; + } + for (var i = 0; i < this.nodes.length; i++) { + this.nodes[i].__visited = false; + } + if (cb.call(context, startNode, null)) { + return; + } + var queue = [startNode]; + while (queue.length) { + var currentNode = queue.shift(); + var edges = currentNode[edgeType]; + for (var i = 0; i < edges.length; i++) { + var e = edges[i]; + var otherNode = e.node1 === currentNode ? e.node2 : e.node1; + if (!otherNode.__visited) { + if (cb.call(otherNode, otherNode, currentNode)) { + return; + } + queue.push(otherNode); + otherNode.__visited = true; + } + } + } + }; + Graph.prototype.clone = function () { + var graph = new Graph(this._directed); + for (var i = 0; i < this.nodes.length; i++) { + graph.addNode(this.nodes[i].id, this.nodes[i].data); + } + for (var i = 0; i < this.edges.length; i++) { + var e = this.edges[i]; + graph.addEdge(e.node1.id, e.node2.id, e.data); + } + return graph; + }; + var Node = function (id, data) { + this.id = id; + this.data = data || null; + this.inEdges = []; + this.outEdges = []; + this.edges = []; + }; + Node.prototype.degree = function () { + return this.edges.length; + }; + Node.prototype.inDegree = function () { + return this.inEdges.length; + }; + Node.prototype.outDegree = function () { + return this.outEdges.length; + }; + var Edge = function (node1, node2, data) { + this.node1 = node1; + this.node2 = node2; + this.data = data || null; + }; + Graph.Node = Node; + Graph.Edge = Edge; + Graph.fromMatrix = function (nodesData, matrix, directed) { + if (!matrix || !matrix.length || matrix[0].length !== matrix.length || nodesData.length !== matrix.length) { + return; + } + var size = matrix.length; + var graph = new Graph(directed); + for (var i = 0; i < size; i++) { + var node = graph.addNode(nodesData[i].id, nodesData[i]); + node.data.value = 0; + if (directed) { + node.data.outValue = node.data.inValue = 0; + } + } + for (var i = 0; i < size; i++) { + for (var j = 0; j < size; j++) { + var item = matrix[i][j]; + if (directed) { + graph.nodes[i].data.outValue += item; + graph.nodes[j].data.inValue += item; + } + graph.nodes[i].data.value += item; + graph.nodes[j].data.value += item; + } + } + for (var i = 0; i < size; i++) { + for (var j = i; j < size; j++) { + var item = matrix[i][j]; + if (item === 0) { + continue; + } + var n1 = graph.nodes[i]; + var n2 = graph.nodes[j]; + var edge = graph.addEdge(n1, n2, {}); + edge.data.weight = item; + if (i !== j) { + if (directed && matrix[j][i]) { + var inEdge = graph.addEdge(n2, n1, {}); + inEdge.data.weight = matrix[j][i]; + } + } + } + } + return graph; + }; + return Graph; +});define('echarts/layout/Chord', ['require'], function (require) { + var ChordLayout = function (opts) { + opts = opts || {}; + this.sort = opts.sort || null; + this.sortSub = opts.sortSub || null; + this.padding = 0.05; + this.startAngle = opts.startAngle || 0; + this.clockWise = opts.clockWise == null ? false : opts.clockWise; + this.center = opts.center || [ + 0, + 0 + ]; + this.directed = true; + }; + ChordLayout.prototype.run = function (graphs) { + if (!(graphs instanceof Array)) { + graphs = [graphs]; + } + var gl = graphs.length; + if (!gl) { + return; + } + var graph0 = graphs[0]; + var nl = graph0.nodes.length; + var groups = []; + var sumSize = 0; + for (var i = 0; i < nl; i++) { + var g0node = graph0.nodes[i]; + var group = { + size: 0, + subGroups: [], + node: g0node + }; + groups.push(group); + var sumWeight = 0; + for (var k = 0; k < graphs.length; k++) { + var graph = graphs[k]; + var node = graph.getNodeById(g0node.id); + if (!node) { + continue; + } + group.size += node.layout.size; + var edges = this.directed ? node.outEdges : node.edges; + for (var j = 0; j < edges.length; j++) { + var e = edges[j]; + var w = e.layout.weight; + group.subGroups.push({ + weight: w, + edge: e, + graph: graph + }); + sumWeight += w; + } + } + sumSize += group.size; + var multiplier = group.size / sumWeight; + for (var j = 0; j < group.subGroups.length; j++) { + group.subGroups[j].weight *= multiplier; + } + if (this.sortSub === 'ascending') { + group.subGroups.sort(compareSubGroups); + } else if (this.sort === 'descending') { + group.subGroups.sort(compareSubGroups); + group.subGroups.reverse(); + } + } + if (this.sort === 'ascending') { + groups.sort(compareGroups); + } else if (this.sort === 'descending') { + groups.sort(compareGroups); + groups.reverse(); + } + var multiplier = (Math.PI * 2 - this.padding * nl) / sumSize; + var angle = this.startAngle; + var sign = this.clockWise ? 1 : -1; + for (var i = 0; i < nl; i++) { + var group = groups[i]; + group.node.layout.startAngle = angle; + group.node.layout.endAngle = angle + sign * group.size * multiplier; + group.node.layout.subGroups = []; + for (var j = 0; j < group.subGroups.length; j++) { + var subGroup = group.subGroups[j]; + subGroup.edge.layout.startAngle = angle; + angle += sign * subGroup.weight * multiplier; + subGroup.edge.layout.endAngle = angle; + } + angle = group.node.layout.endAngle + sign * this.padding; + } + }; + var compareSubGroups = function (a, b) { + return a.weight - b.weight; + }; + var compareGroups = function (a, b) { + return a.size - b.size; + }; + return ChordLayout; +}); \ No newline at end of file diff --git a/build/source/chart/eventRiver.js b/build/source/chart/eventRiver.js new file mode 100644 index 0000000..e743d24 --- /dev/null +++ b/build/source/chart/eventRiver.js @@ -0,0 +1,383 @@ +define('echarts/chart/eventRiver', [ + 'require', + './base', + '../layout/eventRiver', + 'zrender/shape/Polygon', + '../component/axis', + '../component/grid', + '../component/dataZoom', + '../config', + '../util/ecData', + '../util/date', + 'zrender/tool/util', + 'zrender/tool/color', + '../chart' +], function (require) { + var ChartBase = require('./base'); + var eventRiverLayout = require('../layout/eventRiver'); + var PolygonShape = require('zrender/shape/Polygon'); + require('../component/axis'); + require('../component/grid'); + require('../component/dataZoom'); + var ecConfig = require('../config'); + ecConfig.eventRiver = { + zlevel: 0, + z: 2, + clickable: true, + legendHoverLink: true, + itemStyle: { + normal: { + borderColor: 'rgba(0,0,0,0)', + borderWidth: 1, + label: { + show: true, + position: 'inside', + formatter: '{b}' + } + }, + emphasis: { + borderColor: 'rgba(0,0,0,0)', + borderWidth: 1, + label: { show: true } + } + } + }; + var ecData = require('../util/ecData'); + var ecDate = require('../util/date'); + var zrUtil = require('zrender/tool/util'); + var zrColor = require('zrender/tool/color'); + function EventRiver(ecTheme, messageCenter, zr, option, myChart) { + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); + var self = this; + self._ondragend = function () { + self.isDragend = true; + }; + this.refresh(option); + } + EventRiver.prototype = { + type: ecConfig.CHART_TYPE_EVENTRIVER, + _buildShape: function () { + var series = this.series; + this.selectedMap = {}; + this._dataPreprocessing(); + var legend = this.component.legend; + var eventRiverSeries = []; + for (var i = 0; i < series.length; i++) { + if (series[i].type === this.type) { + series[i] = this.reformOption(series[i]); + this.legendHoverLink = series[i].legendHoverLink || this.legendHoverLink; + var serieName = series[i].name || ''; + this.selectedMap[serieName] = legend ? legend.isSelected(serieName) : true; + if (!this.selectedMap[serieName]) { + continue; + } + this.buildMark(i); + eventRiverSeries.push(this.series[i]); + } + } + eventRiverLayout(eventRiverSeries, this._intervalX, this.component.grid.getArea()); + this._drawEventRiver(); + this.addShapeList(); + }, + _dataPreprocessing: function () { + var series = this.series; + var xAxis; + var evolutionList; + for (var i = 0, iLen = series.length; i < iLen; i++) { + if (series[i].type === this.type) { + xAxis = this.component.xAxis.getAxis(series[i].xAxisIndex || 0); + for (var j = 0, jLen = series[i].eventList.length; j < jLen; j++) { + evolutionList = series[i].eventList[j].evolution; + for (var k = 0, kLen = evolutionList.length; k < kLen; k++) { + evolutionList[k].timeScale = xAxis.getCoord(ecDate.getNewDate(evolutionList[k].time) - 0); + evolutionList[k].valueScale = Math.pow(evolutionList[k].value, 0.8); + } + } + } + } + this._intervalX = Math.round(this.component.grid.getWidth() / 40); + }, + _drawEventRiver: function () { + var series = this.series; + for (var i = 0; i < series.length; i++) { + var serieName = series[i].name || ''; + if (series[i].type === this.type && this.selectedMap[serieName]) { + for (var j = 0; j < series[i].eventList.length; j++) { + this._drawEventBubble(series[i].eventList[j], i, j); + } + } + } + }, + _drawEventBubble: function (oneEvent, seriesIndex, dataIndex) { + var series = this.series; + var serie = series[seriesIndex]; + var serieName = serie.name || ''; + var data = serie.eventList[dataIndex]; + var queryTarget = [ + data, + serie + ]; + var legend = this.component.legend; + var defaultColor = legend ? legend.getColor(serieName) : this.zr.getColor(seriesIndex); + var normal = this.deepMerge(queryTarget, 'itemStyle.normal') || {}; + var emphasis = this.deepMerge(queryTarget, 'itemStyle.emphasis') || {}; + var normalColor = this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) || defaultColor; + var emphasisColor = this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data) || (typeof normalColor === 'string' ? zrColor.lift(normalColor, -0.2) : normalColor); + var pts = this._calculateControlPoints(oneEvent); + var eventBubbleShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + clickable: this.deepQuery(queryTarget, 'clickable'), + style: { + pointList: pts, + smooth: 'spline', + brushType: 'both', + lineJoin: 'round', + color: normalColor, + lineWidth: normal.borderWidth, + strokeColor: normal.borderColor + }, + highlightStyle: { + color: emphasisColor, + lineWidth: emphasis.borderWidth, + strokeColor: emphasis.borderColor + }, + draggable: 'vertical', + ondragend: this._ondragend + }; + eventBubbleShape = new PolygonShape(eventBubbleShape); + this.addLabel(eventBubbleShape, serie, data, oneEvent.name); + ecData.pack(eventBubbleShape, series[seriesIndex], seriesIndex, series[seriesIndex].eventList[dataIndex], dataIndex, series[seriesIndex].eventList[dataIndex].name); + this.shapeList.push(eventBubbleShape); + }, + _calculateControlPoints: function (oneEvent) { + var intervalX = this._intervalX; + var posY = oneEvent.y; + var evolution = oneEvent.evolution; + var n = evolution.length; + if (n < 1) { + return; + } + var time = []; + var value = []; + for (var i = 0; i < n; i++) { + time.push(evolution[i].timeScale); + value.push(evolution[i].valueScale); + } + var pts = []; + pts.push([ + time[0], + posY + ]); + var i = 0; + for (i = 0; i < n - 1; i++) { + pts.push([ + (time[i] + time[i + 1]) / 2, + value[i] / -2 + posY + ]); + } + pts.push([ + (time[i] + (time[i] + intervalX)) / 2, + value[i] / -2 + posY + ]); + pts.push([ + time[i] + intervalX, + posY + ]); + pts.push([ + (time[i] + (time[i] + intervalX)) / 2, + value[i] / 2 + posY + ]); + for (i = n - 1; i > 0; i--) { + pts.push([ + (time[i] + time[i - 1]) / 2, + value[i - 1] / 2 + posY + ]); + } + return pts; + }, + ondragend: function (param, status) { + if (!this.isDragend || !param.target) { + return; + } + status.dragOut = true; + status.dragIn = true; + status.needRefresh = false; + this.isDragend = false; + }, + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + this.backupShapeList(); + this._buildShape(); + } + }; + zrUtil.inherits(EventRiver, ChartBase); + require('../chart').define('eventRiver', EventRiver); + return EventRiver; +});define('echarts/layout/eventRiver', ['require'], function (require) { + function eventRiverLayout(series, intervalX, area) { + var space = 5; + var scale = intervalX; + function importanceSort(a, b) { + var x = a.importance; + var y = b.importance; + return x > y ? -1 : x < y ? 1 : 0; + } + function indexOf(array, value) { + if (array.indexOf) { + return array.indexOf(value); + } + for (var i = 0, len = array.length; i < len; i++) { + if (array[i] === value) { + return i; + } + } + return -1; + } + for (var i = 0; i < series.length; i++) { + for (var j = 0; j < series[i].eventList.length; j++) { + if (series[i].eventList[j].weight == null) { + series[i].eventList[j].weight = 1; + } + var importance = 0; + for (var k = 0; k < series[i].eventList[j].evolution.length; k++) { + importance += series[i].eventList[j].evolution[k].valueScale; + } + series[i].eventList[j].importance = importance * series[i].eventList[j].weight; + } + series[i].eventList.sort(importanceSort); + } + for (var i = 0; i < series.length; i++) { + if (series[i].weight == null) { + series[i].weight = 1; + } + var importance = 0; + for (var j = 0; j < series[i].eventList.length; j++) { + importance += series[i].eventList[j].weight; + } + series[i].importance = importance * series[i].weight; + } + series.sort(importanceSort); + var minTime = Number.MAX_VALUE; + var maxTime = 0; + for (var i = 0; i < series.length; i++) { + for (var j = 0; j < series[i].eventList.length; j++) { + for (var k = 0; k < series[i].eventList[j].evolution.length; k++) { + var time = series[i].eventList[j].evolution[k].timeScale; + minTime = Math.min(minTime, time); + maxTime = Math.max(maxTime, time); + } + } + } + var root = segmentTreeBuild(Math.floor(minTime), Math.ceil(maxTime)); + var totalMaxY = 0; + for (var i = 0; i < series.length; i++) { + for (var j = 0; j < series[i].eventList.length; j++) { + var e = series[i].eventList[j]; + e.time = []; + e.value = []; + for (var k = 0; k < series[i].eventList[j].evolution.length; k++) { + e.time.push(series[i].eventList[j].evolution[k].timeScale); + e.value.push(series[i].eventList[j].evolution[k].valueScale); + } + var mxIndex = indexOf(e.value, Math.max.apply(Math, e.value)); + var maxY = segmentTreeQuery(root, e.time[mxIndex], e.time[mxIndex + 1]); + var k = 0; + e.y = maxY + e.value[mxIndex] / 2 + space; + for (k = 0; k < e.time.length - 1; k++) { + var curMaxY = segmentTreeQuery(root, e.time[k], e.time[k + 1]); + if (e.y - e.value[k] / 2 - space < curMaxY) { + e.y = curMaxY + e.value[k] / 2 + space; + } + } + var curMaxY = segmentTreeQuery(root, e.time[k], e.time[k] + scale); + if (e.y - e.value[k] / 2 - space < curMaxY) { + e.y = curMaxY + e.value[k] / 2 + space; + } + series[i].y = e.y; + totalMaxY = Math.max(totalMaxY, e.y + e.value[mxIndex] / 2); + for (k = 0; k < e.time.length - 1; k++) { + segmentTreeInsert(root, e.time[k], e.time[k + 1], e.y + e.value[k] / 2); + } + segmentTreeInsert(root, e.time[k], e.time[k] + scale, e.y + e.value[k] / 2); + } + } + scaleY(series, area, totalMaxY, space); + } + function scaleY(series, area, maxY, space) { + var yBase = area.y; + var yScale = (area.height - space) / maxY; + for (var i = 0; i < series.length; i++) { + series[i].y = series[i].y * yScale + yBase; + var eventList = series[i].eventList; + for (var j = 0; j < eventList.length; j++) { + eventList[j].y = eventList[j].y * yScale + yBase; + var evolutionList = eventList[j].evolution; + for (var k = 0; k < evolutionList.length; k++) { + evolutionList[k].valueScale *= yScale * 1; + } + } + } + } + function segmentTreeBuild(left, right) { + var root = { + 'left': left, + 'right': right, + 'leftChild': null, + 'rightChild': null, + 'maxValue': 0 + }; + if (left + 1 < right) { + var mid = Math.round((left + right) / 2); + root.leftChild = segmentTreeBuild(left, mid); + root.rightChild = segmentTreeBuild(mid, right); + } + return root; + } + function segmentTreeQuery(root, left, right) { + if (right - left < 1) { + return 0; + } + var mid = Math.round((root.left + root.right) / 2); + var result = 0; + if (left == root.left && right == root.right) { + result = root.maxValue; + } else if (right <= mid && root.leftChild != null) { + result = segmentTreeQuery(root.leftChild, left, right); + } else if (left >= mid && root.rightChild != null) { + result = segmentTreeQuery(root.rightChild, left, right); + } else { + var leftValue = 0; + var rightValue = 0; + if (root.leftChild != null) { + leftValue = segmentTreeQuery(root.leftChild, left, mid); + } + if (root.rightChild != null) { + rightValue = segmentTreeQuery(root.rightChild, mid, right); + } + result = leftValue > rightValue ? leftValue : rightValue; + } + return result; + } + function segmentTreeInsert(root, left, right, value) { + if (root == null) { + return; + } + var mid = Math.round((root.left + root.right) / 2); + root.maxValue = root.maxValue > value ? root.maxValue : value; + if (Math.floor(left * 10) == Math.floor(root.left * 10) && Math.floor(right * 10) == Math.floor(root.right * 10)) { + return; + } else if (right <= mid) { + segmentTreeInsert(root.leftChild, left, right, value); + } else if (left >= mid) { + segmentTreeInsert(root.rightChild, left, right, value); + } else { + segmentTreeInsert(root.leftChild, left, mid, value); + segmentTreeInsert(root.rightChild, mid, right, value); + } + } + return eventRiverLayout; +}); \ No newline at end of file diff --git a/build/source/chart/force.js b/build/source/chart/force.js new file mode 100644 index 0000000..463e1f7 --- /dev/null +++ b/build/source/chart/force.js @@ -0,0 +1,1721 @@ +define('echarts/chart/force', [ + 'require', + './base', + '../data/Graph', + '../layout/Force', + 'zrender/shape/Line', + 'zrender/shape/BezierCurve', + 'zrender/shape/Image', + '../util/shape/Icon', + '../config', + '../util/ecData', + 'zrender/tool/util', + 'zrender/config', + 'zrender/tool/vector', + '../chart' +], function (require) { + 'use strict'; + var ChartBase = require('./base'); + var Graph = require('../data/Graph'); + var ForceLayout = require('../layout/Force'); + var LineShape = require('zrender/shape/Line'); + var BezierCurveShape = require('zrender/shape/BezierCurve'); + var ImageShape = require('zrender/shape/Image'); + var IconShape = require('../util/shape/Icon'); + var ecConfig = require('../config'); + ecConfig.force = { + zlevel: 1, + z: 2, + center: [ + '50%', + '50%' + ], + size: '100%', + preventOverlap: false, + coolDown: 0.99, + minRadius: 10, + maxRadius: 20, + ratioScaling: false, + large: false, + useWorker: false, + steps: 1, + scaling: 1, + gravity: 1, + symbol: 'circle', + symbolSize: 0, + linkSymbol: null, + linkSymbolSize: [ + 10, + 15 + ], + draggable: true, + clickable: true, + roam: false, + itemStyle: { + normal: { + label: { + show: false, + position: 'inside' + }, + nodeStyle: { + brushType: 'both', + borderColor: '#5182ab', + borderWidth: 1 + }, + linkStyle: { + color: '#5182ab', + width: 1, + type: 'line' + } + }, + emphasis: { + label: { show: false }, + nodeStyle: {}, + linkStyle: { opacity: 0 } + } + } + }; + var ecData = require('../util/ecData'); + var zrUtil = require('zrender/tool/util'); + var zrConfig = require('zrender/config'); + var vec2 = require('zrender/tool/vector'); + function Force(ecTheme, messageCenter, zr, option, myChart) { + var self = this; + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); + this.__nodePositionMap = {}; + this._graph = new Graph(true); + this._layout = new ForceLayout(); + this._layout.onupdate = function () { + self._step(); + }; + this._steps = 1; + this.ondragstart = function () { + ondragstart.apply(self, arguments); + }; + this.ondragend = function () { + ondragend.apply(self, arguments); + }; + this.ondrop = function () { + }; + this.shapeHandler.ondragstart = function () { + self.isDragstart = true; + }; + this.onmousemove = function () { + onmousemove.apply(self, arguments); + }; + this.refresh(option); + } + Force.prototype = { + constructor: Force, + type: ecConfig.CHART_TYPE_FORCE, + _init: function () { + var legend = this.component.legend; + var series = this.series; + var serieName; + this.clear(); + for (var i = 0, l = series.length; i < l; i++) { + var serie = series[i]; + if (serie.type === ecConfig.CHART_TYPE_FORCE) { + series[i] = this.reformOption(series[i]); + serieName = series[i].name || ''; + this.selectedMap[serieName] = legend ? legend.isSelected(serieName) : true; + if (!this.selectedMap[serieName]) { + continue; + } + this.buildMark(i); + this._initSerie(serie, i); + break; + } + } + this.animationEffect(); + }, + _getNodeCategory: function (serie, node) { + return serie.categories && serie.categories[node.category || 0]; + }, + _getNodeQueryTarget: function (serie, node, type) { + type = type || 'normal'; + var category = this._getNodeCategory(serie, node) || {}; + return [ + node.itemStyle && node.itemStyle[type], + category && category.itemStyle && category.itemStyle[type], + serie.itemStyle[type].nodeStyle + ]; + }, + _getEdgeQueryTarget: function (serie, edge, type) { + type = type || 'normal'; + return [ + edge.itemStyle && edge.itemStyle[type], + serie.itemStyle[type].linkStyle + ]; + }, + _initSerie: function (serie, serieIdx) { + this._temperature = 1; + if (serie.data) { + this._graph = this._getSerieGraphFromDataMatrix(serie); + } else { + this._graph = this._getSerieGraphFromNodeLinks(serie); + } + this._buildLinkShapes(serie, serieIdx); + this._buildNodeShapes(serie, serieIdx); + var panable = serie.roam === true || serie.roam === 'move'; + var zoomable = serie.roam === true || serie.roam === 'scale'; + this.zr.modLayer(this.getZlevelBase(), { + panable: panable, + zoomable: zoomable + }); + if (this.query('markPoint.effect.show') || this.query('markLine.effect.show')) { + this.zr.modLayer(ecConfig.EFFECT_ZLEVEL, { + panable: panable, + zoomable: zoomable + }); + } + this._initLayout(serie); + this._step(); + }, + _getSerieGraphFromDataMatrix: function (serie) { + var nodesData = []; + var count = 0; + var matrix = []; + for (var i = 0; i < serie.matrix.length; i++) { + matrix[i] = serie.matrix[i].slice(); + } + var data = serie.data || serie.nodes; + for (var i = 0; i < data.length; i++) { + var node = {}; + var group = data[i]; + for (var key in group) { + if (key === 'name') { + node['id'] = group['name']; + } else { + node[key] = group[key]; + } + } + var category = this._getNodeCategory(serie, group); + var name = category ? category.name : group.name; + this.selectedMap[name] = this.isSelected(name); + if (this.selectedMap[name]) { + nodesData.push(node); + count++; + } else { + matrix.splice(count, 1); + for (var j = 0; j < matrix.length; j++) { + matrix[j].splice(count, 1); + } + } + } + var graph = Graph.fromMatrix(nodesData, matrix, true); + graph.eachNode(function (n, idx) { + n.layout = { + size: n.data.value, + mass: 0 + }; + n.rawIndex = idx; + }); + graph.eachEdge(function (e) { + e.layout = { weight: e.data.weight }; + }); + return graph; + }, + _getSerieGraphFromNodeLinks: function (serie) { + var graph = new Graph(true); + var nodes = serie.data || serie.nodes; + for (var i = 0, len = nodes.length; i < len; i++) { + var n = nodes[i]; + if (!n || n.ignore) { + continue; + } + var category = this._getNodeCategory(serie, n); + var name = category ? category.name : n.name; + this.selectedMap[name] = this.isSelected(name); + if (this.selectedMap[name]) { + var node = graph.addNode(n.name, n); + node.rawIndex = i; + } + } + for (var i = 0, len = serie.links.length; i < len; i++) { + var e = serie.links[i]; + var n1 = e.source; + var n2 = e.target; + if (typeof n1 === 'number') { + n1 = nodes[n1]; + if (n1) { + n1 = n1.name; + } + } + if (typeof n2 === 'number') { + n2 = nodes[n2]; + if (n2) { + n2 = n2.name; + } + } + var edge = graph.addEdge(n1, n2, e); + if (edge) { + edge.rawIndex = i; + } + } + graph.eachNode(function (n) { + var value = n.data.value; + if (value == null) { + value = 0; + for (var i = 0; i < n.edges.length; i++) { + value += n.edges[i].data.weight || 0; + } + } + n.layout = { + size: value, + mass: 0 + }; + }); + graph.eachEdge(function (e) { + e.layout = { weight: e.data.weight == null ? 1 : e.data.weight }; + }); + return graph; + }, + _initLayout: function (serie) { + var graph = this._graph; + var len = graph.nodes.length; + var minRadius = this.query(serie, 'minRadius'); + var maxRadius = this.query(serie, 'maxRadius'); + this._steps = serie.steps || 1; + this._layout.center = this.parseCenter(this.zr, serie.center); + this._layout.width = this.parsePercent(serie.size, this.zr.getWidth()); + this._layout.height = this.parsePercent(serie.size, this.zr.getHeight()); + this._layout.large = serie.large; + this._layout.scaling = serie.scaling; + this._layout.ratioScaling = serie.ratioScaling; + this._layout.gravity = serie.gravity; + this._layout.temperature = 1; + this._layout.coolDown = serie.coolDown; + this._layout.preventNodeEdgeOverlap = serie.preventOverlap; + this._layout.preventNodeOverlap = serie.preventOverlap; + var min = Infinity; + var max = -Infinity; + for (var i = 0; i < len; i++) { + var gNode = graph.nodes[i]; + max = Math.max(gNode.layout.size, max); + min = Math.min(gNode.layout.size, min); + } + var divider = max - min; + for (var i = 0; i < len; i++) { + var gNode = graph.nodes[i]; + if (divider > 0) { + gNode.layout.size = (gNode.layout.size - min) * (maxRadius - minRadius) / divider + minRadius; + gNode.layout.mass = gNode.layout.size / maxRadius; + } else { + gNode.layout.size = (maxRadius - minRadius) / 2; + gNode.layout.mass = 0.5; + } + } + for (var i = 0; i < len; i++) { + var gNode = graph.nodes[i]; + if (typeof this.__nodePositionMap[gNode.id] !== 'undefined') { + gNode.layout.position = vec2.create(); + vec2.copy(gNode.layout.position, this.__nodePositionMap[gNode.id]); + } else if (typeof gNode.data.initial !== 'undefined') { + gNode.layout.position = vec2.create(); + vec2.copy(gNode.layout.position, gNode.data.initial); + } else { + var center = this._layout.center; + var size = Math.min(this._layout.width, this._layout.height); + gNode.layout.position = _randomInSquare(center[0], center[1], size * 0.8); + } + var style = gNode.shape.style; + var radius = gNode.layout.size; + style.width = style.width || radius * 2; + style.height = style.height || radius * 2; + style.x = -style.width / 2; + style.y = -style.height / 2; + vec2.copy(gNode.shape.position, gNode.layout.position); + } + len = graph.edges.length; + max = -Infinity; + for (var i = 0; i < len; i++) { + var e = graph.edges[i]; + if (e.layout.weight > max) { + max = e.layout.weight; + } + } + for (var i = 0; i < len; i++) { + var e = graph.edges[i]; + e.layout.weight /= max; + } + this._layout.init(graph, serie.useWorker); + }, + _buildNodeShapes: function (serie, serieIdx) { + var graph = this._graph; + var categories = this.query(serie, 'categories'); + graph.eachNode(function (node) { + var category = this._getNodeCategory(serie, node.data); + var queryTarget = [ + node.data, + category, + serie + ]; + var styleQueryTarget = this._getNodeQueryTarget(serie, node.data); + var emphasisStyleQueryTarget = this._getNodeQueryTarget(serie, node.data, 'emphasis'); + var shape = new IconShape({ + style: { + x: 0, + y: 0, + color: this.deepQuery(styleQueryTarget, 'color'), + brushType: 'both', + strokeColor: this.deepQuery(styleQueryTarget, 'strokeColor') || this.deepQuery(styleQueryTarget, 'borderColor'), + lineWidth: this.deepQuery(styleQueryTarget, 'lineWidth') || this.deepQuery(styleQueryTarget, 'borderWidth') + }, + highlightStyle: { + color: this.deepQuery(emphasisStyleQueryTarget, 'color'), + strokeColor: this.deepQuery(emphasisStyleQueryTarget, 'strokeColor') || this.deepQuery(emphasisStyleQueryTarget, 'borderColor'), + lineWidth: this.deepQuery(emphasisStyleQueryTarget, 'lineWidth') || this.deepQuery(emphasisStyleQueryTarget, 'borderWidth') + }, + clickable: serie.clickable, + zlevel: this.getZlevelBase(), + z: this.getZBase() + }); + if (!shape.style.color) { + shape.style.color = category ? this.getColor(category.name) : this.getColor(node.id); + } + shape.style.iconType = this.deepQuery(queryTarget, 'symbol'); + shape.style.width = shape.style.height = (this.deepQuery(queryTarget, 'symbolSize') || 0) * 2; + if (shape.style.iconType.match('image')) { + shape.style.image = shape.style.iconType.replace(new RegExp('^image:\\/\\/'), ''); + shape = new ImageShape({ + style: shape.style, + highlightStyle: shape.highlightStyle, + clickable: shape.clickable, + zlevel: this.getZlevelBase(), + z: this.getZBase() + }); + } + if (this.deepQuery(queryTarget, 'itemStyle.normal.label.show')) { + shape.style.text = node.data.label == null ? node.id : node.data.label; + shape.style.textPosition = this.deepQuery(queryTarget, 'itemStyle.normal.label.position'); + shape.style.textColor = this.deepQuery(queryTarget, 'itemStyle.normal.label.textStyle.color'); + shape.style.textFont = this.getFont(this.deepQuery(queryTarget, 'itemStyle.normal.label.textStyle') || {}); + } + if (this.deepQuery(queryTarget, 'itemStyle.emphasis.label.show')) { + shape.highlightStyle.textPosition = this.deepQuery(queryTarget, 'itemStyle.emphasis.label.position'); + shape.highlightStyle.textColor = this.deepQuery(queryTarget, 'itemStyle.emphasis.label.textStyle.color'); + shape.highlightStyle.textFont = this.getFont(this.deepQuery(queryTarget, 'itemStyle.emphasis.label.textStyle') || {}); + } + if (this.deepQuery(queryTarget, 'draggable')) { + this.setCalculable(shape); + shape.dragEnableTime = 0; + shape.draggable = true; + shape.ondragstart = this.shapeHandler.ondragstart; + shape.ondragover = null; + } + var categoryName = ''; + if (typeof node.category !== 'undefined') { + var category = categories[node.category]; + categoryName = category && category.name || ''; + } + ecData.pack(shape, serie, serieIdx, node.data, node.rawIndex, node.data.name || '', node.category); + this.shapeList.push(shape); + this.zr.addShape(shape); + node.shape = shape; + }, this); + }, + _buildLinkShapes: function (serie, serieIdx) { + var graph = this._graph; + var len = graph.edges.length; + for (var i = 0; i < len; i++) { + var gEdge = graph.edges[i]; + var link = gEdge.data; + var source = gEdge.node1; + var target = gEdge.node2; + var queryTarget = this._getEdgeQueryTarget(serie, link); + var linkType = this.deepQuery(queryTarget, 'type'); + if (serie.linkSymbol && serie.linkSymbol !== 'none') { + linkType = 'line'; + } + var LinkShapeCtor = linkType === 'line' ? LineShape : BezierCurveShape; + var linkShape = new LinkShapeCtor({ + style: { + xStart: 0, + yStart: 0, + xEnd: 0, + yEnd: 0 + }, + clickable: this.query(serie, 'clickable'), + highlightStyle: {}, + zlevel: this.getZlevelBase(), + z: this.getZBase() + }); + zrUtil.merge(linkShape.style, this.query(serie, 'itemStyle.normal.linkStyle'), true); + zrUtil.merge(linkShape.highlightStyle, this.query(serie, 'itemStyle.emphasis.linkStyle'), true); + if (typeof link.itemStyle !== 'undefined') { + if (link.itemStyle.normal) { + zrUtil.merge(linkShape.style, link.itemStyle.normal, true); + } + if (link.itemStyle.emphasis) { + zrUtil.merge(linkShape.highlightStyle, link.itemStyle.emphasis, true); + } + } + linkShape.style.lineWidth = linkShape.style.lineWidth || linkShape.style.width; + linkShape.style.strokeColor = linkShape.style.strokeColor || linkShape.style.color; + linkShape.highlightStyle.lineWidth = linkShape.highlightStyle.lineWidth || linkShape.highlightStyle.width; + linkShape.highlightStyle.strokeColor = linkShape.highlightStyle.strokeColor || linkShape.highlightStyle.color; + ecData.pack(linkShape, serie, serieIdx, gEdge.data, gEdge.rawIndex == null ? i : gEdge.rawIndex, gEdge.data.name || source.id + ' - ' + target.id, source.id, target.id); + this.shapeList.push(linkShape); + this.zr.addShape(linkShape); + gEdge.shape = linkShape; + if (serie.linkSymbol && serie.linkSymbol !== 'none') { + var symbolShape = new IconShape({ + style: { + x: -5, + y: 0, + width: serie.linkSymbolSize[0], + height: serie.linkSymbolSize[1], + iconType: serie.linkSymbol, + brushType: 'fill', + color: linkShape.style.strokeColor + }, + highlightStyle: { brushType: 'fill' }, + position: [ + 0, + 0 + ], + rotation: 0 + }); + linkShape._symbolShape = symbolShape; + this.shapeList.push(symbolShape); + this.zr.addShape(symbolShape); + } + } + }, + _updateLinkShapes: function () { + var v = vec2.create(); + var edges = this._graph.edges; + for (var i = 0, len = edges.length; i < len; i++) { + var edge = edges[i]; + var sourceShape = edge.node1.shape; + var targetShape = edge.node2.shape; + var p1 = sourceShape.position; + var p2 = targetShape.position; + edge.shape.style.xStart = p1[0]; + edge.shape.style.yStart = p1[1]; + edge.shape.style.xEnd = p2[0]; + edge.shape.style.yEnd = p2[1]; + if (edge.shape.type === 'bezier-curve') { + edge.shape.style.cpX1 = (p1[0] + p2[0]) / 2 - (p2[1] - p1[1]) / 4; + edge.shape.style.cpY1 = (p1[1] + p2[1]) / 2 - (p1[0] - p2[0]) / 4; + } + edge.shape.modSelf(); + if (edge.shape._symbolShape) { + var symbolShape = edge.shape._symbolShape; + vec2.copy(symbolShape.position, targetShape.position); + vec2.sub(v, sourceShape.position, targetShape.position); + vec2.normalize(v, v); + vec2.scaleAndAdd(symbolShape.position, symbolShape.position, v, targetShape.style.width / 2 + 2); + var angle = Math.atan2(v[1], v[0]); + symbolShape.rotation = Math.PI / 2 - angle; + symbolShape.modSelf(); + } + } + }, + _syncNodePositions: function () { + var graph = this._graph; + for (var i = 0; i < graph.nodes.length; i++) { + var gNode = graph.nodes[i]; + var position = gNode.layout.position; + var node = gNode.data; + var shape = gNode.shape; + var fixX = shape.fixed || node.fixX; + var fixY = shape.fixed || node.fixY; + if (fixX === true) { + fixX = 1; + } else if (isNaN(fixX)) { + fixX = 0; + } + if (fixY === true) { + fixY = 1; + } else if (isNaN(fixY)) { + fixY = 0; + } + shape.position[0] += (position[0] - shape.position[0]) * (1 - fixX); + shape.position[1] += (position[1] - shape.position[1]) * (1 - fixY); + vec2.copy(position, shape.position); + var nodeName = node.name; + if (nodeName) { + var gPos = this.__nodePositionMap[nodeName]; + if (!gPos) { + gPos = this.__nodePositionMap[nodeName] = vec2.create(); + } + vec2.copy(gPos, position); + } + shape.modSelf(); + } + }, + _step: function (e) { + this._syncNodePositions(); + this._updateLinkShapes(); + this.zr.refreshNextFrame(); + if (this._layout.temperature > 0.01) { + this._layout.step(this._steps); + } else { + this.messageCenter.dispatch(ecConfig.EVENT.FORCE_LAYOUT_END, {}, {}, this.myChart); + } + }, + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.series = this.option.series; + } + this.legend = this.component.legend; + if (this.legend) { + this.getColor = function (param) { + return this.legend.getColor(param); + }; + this.isSelected = function (param) { + return this.legend.isSelected(param); + }; + } else { + var colorMap = {}; + var count = 0; + this.getColor = function (key) { + if (colorMap[key]) { + return colorMap[key]; + } + if (!colorMap[key]) { + colorMap[key] = this.zr.getColor(count++); + } + return colorMap[key]; + }; + this.isSelected = function () { + return true; + }; + } + this._init(); + }, + dispose: function () { + this.clear(); + this.shapeList = null; + this.effectList = null; + this._layout.dispose(); + this._layout = null; + this.__nodePositionMap = {}; + }, + getPosition: function () { + var position = []; + this._graph.eachNode(function (n) { + if (n.layout) { + position.push({ + name: n.data.name, + position: Array.prototype.slice.call(n.layout.position) + }); + } + }); + return position; + } + }; + function ondragstart(param) { + if (!this.isDragstart || !param.target) { + return; + } + var shape = param.target; + shape.fixed = true; + this.isDragstart = false; + this.zr.on(zrConfig.EVENT.MOUSEMOVE, this.onmousemove); + } + function onmousemove() { + this._layout.temperature = 0.8; + this._step(); + } + function ondragend(param, status) { + if (!this.isDragend || !param.target) { + return; + } + var shape = param.target; + shape.fixed = false; + status.dragIn = true; + status.needRefresh = false; + this.isDragend = false; + this.zr.un(zrConfig.EVENT.MOUSEMOVE, this.onmousemove); + } + function _randomInSquare(x, y, size) { + var v = vec2.create(); + v[0] = (Math.random() - 0.5) * size + x; + v[1] = (Math.random() - 0.5) * size + y; + return v; + } + zrUtil.inherits(Force, ChartBase); + require('../chart').define('force', Force); + return Force; +});define('echarts/data/Graph', [ + 'require', + 'zrender/tool/util' +], function (require) { + var util = require('zrender/tool/util'); + 'use strict'; + var Graph = function (directed) { + this._directed = directed || false; + this.nodes = []; + this.edges = []; + this._nodesMap = {}; + this._edgesMap = {}; + }; + Graph.prototype.isDirected = function () { + return this._directed; + }; + Graph.prototype.addNode = function (id, data) { + if (this._nodesMap[id]) { + return this._nodesMap[id]; + } + var node = new Graph.Node(id, data); + this.nodes.push(node); + this._nodesMap[id] = node; + return node; + }; + Graph.prototype.getNodeById = function (id) { + return this._nodesMap[id]; + }; + Graph.prototype.addEdge = function (n1, n2, data) { + if (typeof n1 == 'string') { + n1 = this._nodesMap[n1]; + } + if (typeof n2 == 'string') { + n2 = this._nodesMap[n2]; + } + if (!n1 || !n2) { + return; + } + var key = n1.id + '-' + n2.id; + if (this._edgesMap[key]) { + return this._edgesMap[key]; + } + var edge = new Graph.Edge(n1, n2, data); + if (this._directed) { + n1.outEdges.push(edge); + n2.inEdges.push(edge); + } + n1.edges.push(edge); + if (n1 !== n2) { + n2.edges.push(edge); + } + this.edges.push(edge); + this._edgesMap[key] = edge; + return edge; + }; + Graph.prototype.removeEdge = function (edge) { + var n1 = edge.node1; + var n2 = edge.node2; + var key = n1.id + '-' + n2.id; + if (this._directed) { + n1.outEdges.splice(util.indexOf(n1.outEdges, edge), 1); + n2.inEdges.splice(util.indexOf(n2.inEdges, edge), 1); + } + n1.edges.splice(util.indexOf(n1.edges, edge), 1); + if (n1 !== n2) { + n2.edges.splice(util.indexOf(n2.edges, edge), 1); + } + delete this._edgesMap[key]; + this.edges.splice(util.indexOf(this.edges, edge), 1); + }; + Graph.prototype.getEdge = function (n1, n2) { + if (typeof n1 !== 'string') { + n1 = n1.id; + } + if (typeof n2 !== 'string') { + n2 = n2.id; + } + if (this._directed) { + return this._edgesMap[n1 + '-' + n2]; + } else { + return this._edgesMap[n1 + '-' + n2] || this._edgesMap[n2 + '-' + n1]; + } + }; + Graph.prototype.removeNode = function (node) { + if (typeof node === 'string') { + node = this._nodesMap[node]; + if (!node) { + return; + } + } + delete this._nodesMap[node.id]; + this.nodes.splice(util.indexOf(this.nodes, node), 1); + for (var i = 0; i < this.edges.length;) { + var edge = this.edges[i]; + if (edge.node1 === node || edge.node2 === node) { + this.removeEdge(edge); + } else { + i++; + } + } + }; + Graph.prototype.filterNode = function (cb, context) { + var len = this.nodes.length; + for (var i = 0; i < len;) { + if (cb.call(context, this.nodes[i], i)) { + i++; + } else { + this.removeNode(this.nodes[i]); + len--; + } + } + }; + Graph.prototype.filterEdge = function (cb, context) { + var len = this.edges.length; + for (var i = 0; i < len;) { + if (cb.call(context, this.edges[i], i)) { + i++; + } else { + this.removeEdge(this.edges[i]); + len--; + } + } + }; + Graph.prototype.eachNode = function (cb, context) { + var len = this.nodes.length; + for (var i = 0; i < len; i++) { + if (this.nodes[i]) { + cb.call(context, this.nodes[i], i); + } + } + }; + Graph.prototype.eachEdge = function (cb, context) { + var len = this.edges.length; + for (var i = 0; i < len; i++) { + if (this.edges[i]) { + cb.call(context, this.edges[i], i); + } + } + }; + Graph.prototype.clear = function () { + this.nodes.length = 0; + this.edges.length = 0; + this._nodesMap = {}; + this._edgesMap = {}; + }; + Graph.prototype.breadthFirstTraverse = function (cb, startNode, direction, context) { + if (typeof startNode === 'string') { + startNode = this._nodesMap[startNode]; + } + if (!startNode) { + return; + } + var edgeType = 'edges'; + if (direction === 'out') { + edgeType = 'outEdges'; + } else if (direction === 'in') { + edgeType = 'inEdges'; + } + for (var i = 0; i < this.nodes.length; i++) { + this.nodes[i].__visited = false; + } + if (cb.call(context, startNode, null)) { + return; + } + var queue = [startNode]; + while (queue.length) { + var currentNode = queue.shift(); + var edges = currentNode[edgeType]; + for (var i = 0; i < edges.length; i++) { + var e = edges[i]; + var otherNode = e.node1 === currentNode ? e.node2 : e.node1; + if (!otherNode.__visited) { + if (cb.call(otherNode, otherNode, currentNode)) { + return; + } + queue.push(otherNode); + otherNode.__visited = true; + } + } + } + }; + Graph.prototype.clone = function () { + var graph = new Graph(this._directed); + for (var i = 0; i < this.nodes.length; i++) { + graph.addNode(this.nodes[i].id, this.nodes[i].data); + } + for (var i = 0; i < this.edges.length; i++) { + var e = this.edges[i]; + graph.addEdge(e.node1.id, e.node2.id, e.data); + } + return graph; + }; + var Node = function (id, data) { + this.id = id; + this.data = data || null; + this.inEdges = []; + this.outEdges = []; + this.edges = []; + }; + Node.prototype.degree = function () { + return this.edges.length; + }; + Node.prototype.inDegree = function () { + return this.inEdges.length; + }; + Node.prototype.outDegree = function () { + return this.outEdges.length; + }; + var Edge = function (node1, node2, data) { + this.node1 = node1; + this.node2 = node2; + this.data = data || null; + }; + Graph.Node = Node; + Graph.Edge = Edge; + Graph.fromMatrix = function (nodesData, matrix, directed) { + if (!matrix || !matrix.length || matrix[0].length !== matrix.length || nodesData.length !== matrix.length) { + return; + } + var size = matrix.length; + var graph = new Graph(directed); + for (var i = 0; i < size; i++) { + var node = graph.addNode(nodesData[i].id, nodesData[i]); + node.data.value = 0; + if (directed) { + node.data.outValue = node.data.inValue = 0; + } + } + for (var i = 0; i < size; i++) { + for (var j = 0; j < size; j++) { + var item = matrix[i][j]; + if (directed) { + graph.nodes[i].data.outValue += item; + graph.nodes[j].data.inValue += item; + } + graph.nodes[i].data.value += item; + graph.nodes[j].data.value += item; + } + } + for (var i = 0; i < size; i++) { + for (var j = i; j < size; j++) { + var item = matrix[i][j]; + if (item === 0) { + continue; + } + var n1 = graph.nodes[i]; + var n2 = graph.nodes[j]; + var edge = graph.addEdge(n1, n2, {}); + edge.data.weight = item; + if (i !== j) { + if (directed && matrix[j][i]) { + var inEdge = graph.addEdge(n2, n1, {}); + inEdge.data.weight = matrix[j][i]; + } + } + } + } + return graph; + }; + return Graph; +});define('echarts/layout/Force', [ + 'require', + './forceLayoutWorker', + 'zrender/tool/vector' +], function (require) { + var ForceLayoutWorker = require('./forceLayoutWorker'); + var vec2 = require('zrender/tool/vector'); + var requestAnimationFrame = window.requestAnimationFrame || window.msRequestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || function (func) { + setTimeout(func, 16); + }; + var ArrayCtor = typeof Float32Array == 'undefined' ? Array : Float32Array; + var workerUrl; + function createWorkerUrl() { + if (typeof Worker !== 'undefined' && typeof Blob !== 'undefined') { + try { + var blob = new Blob([ForceLayoutWorker.getWorkerCode()]); + workerUrl = window.URL.createObjectURL(blob); + } catch (e) { + workerUrl = ''; + } + } + return workerUrl; + } + var ForceLayout = function (opts) { + if (typeof workerUrl === 'undefined') { + createWorkerUrl(); + } + opts = opts || {}; + this.width = opts.width || 500; + this.height = opts.height || 500; + this.center = opts.center || [ + this.width / 2, + this.height / 2 + ]; + this.ratioScaling = opts.ratioScaling || false; + this.scaling = opts.scaling || 1; + this.gravity = typeof opts.gravity !== 'undefined' ? opts.gravity : 1; + this.large = opts.large || false; + this.preventNodeOverlap = opts.preventNodeOverlap || false; + this.preventNodeEdgeOverlap = opts.preventNodeEdgeOverlap || false; + this.maxSpeedIncrease = opts.maxSpeedIncrease || 1; + this.onupdate = opts.onupdate || function () { + }; + this.temperature = opts.temperature || 1; + this.coolDown = opts.coolDown || 0.99; + this._layout = null; + this._layoutWorker = null; + var self = this; + var _$onupdate = this._$onupdate; + this._$onupdate = function (e) { + _$onupdate.call(self, e); + }; + }; + ForceLayout.prototype.updateConfig = function () { + var width = this.width; + var height = this.height; + var size = Math.min(width, height); + var config = { + center: this.center, + width: this.ratioScaling ? width : size, + height: this.ratioScaling ? height : size, + scaling: this.scaling || 1, + gravity: this.gravity || 1, + barnesHutOptimize: this.large, + preventNodeOverlap: this.preventNodeOverlap, + preventNodeEdgeOverlap: this.preventNodeEdgeOverlap, + maxSpeedIncrease: this.maxSpeedIncrease + }; + if (this._layoutWorker) { + this._layoutWorker.postMessage({ + cmd: 'updateConfig', + config: config + }); + } else { + for (var name in config) { + this._layout[name] = config[name]; + } + } + }; + ForceLayout.prototype.init = function (graph, useWorker) { + if (workerUrl && useWorker) { + try { + if (!this._layoutWorker) { + this._layoutWorker = new Worker(workerUrl); + this._layoutWorker.onmessage = this._$onupdate; + } + this._layout = null; + } catch (e) { + this._layoutWorker = null; + if (!this._layout) { + this._layout = new ForceLayoutWorker(); + } + } + } else { + if (!this._layout) { + this._layout = new ForceLayoutWorker(); + } + if (this._layoutWorker) { + this._layoutWorker.terminate(); + this._layoutWorker = null; + } + } + this.temperature = 1; + this.graph = graph; + var len = graph.nodes.length; + var positionArr = new ArrayCtor(len * 2); + var massArr = new ArrayCtor(len); + var sizeArr = new ArrayCtor(len); + for (var i = 0; i < len; i++) { + var n = graph.nodes[i]; + positionArr[i * 2] = n.layout.position[0]; + positionArr[i * 2 + 1] = n.layout.position[1]; + massArr[i] = typeof n.layout.mass === 'undefined' ? 1 : n.layout.mass; + sizeArr[i] = typeof n.layout.size === 'undefined' ? 1 : n.layout.size; + n.layout.__index = i; + } + len = graph.edges.length; + var edgeArr = new ArrayCtor(len * 2); + var edgeWeightArr = new ArrayCtor(len); + for (var i = 0; i < len; i++) { + var edge = graph.edges[i]; + edgeArr[i * 2] = edge.node1.layout.__index; + edgeArr[i * 2 + 1] = edge.node2.layout.__index; + edgeWeightArr[i] = edge.layout.weight || 1; + } + if (this._layoutWorker) { + this._layoutWorker.postMessage({ + cmd: 'init', + nodesPosition: positionArr, + nodesMass: massArr, + nodesSize: sizeArr, + edges: edgeArr, + edgesWeight: edgeWeightArr + }); + } else { + this._layout.initNodes(positionArr, massArr, sizeArr); + this._layout.initEdges(edgeArr, edgeWeightArr); + } + this.updateConfig(); + }; + ForceLayout.prototype.step = function (steps) { + var nodes = this.graph.nodes; + if (this._layoutWorker) { + var positionArr = new ArrayCtor(nodes.length * 2); + for (var i = 0; i < nodes.length; i++) { + var n = nodes[i]; + positionArr[i * 2] = n.layout.position[0]; + positionArr[i * 2 + 1] = n.layout.position[1]; + } + this._layoutWorker.postMessage(positionArr.buffer, [positionArr.buffer]); + this._layoutWorker.postMessage({ + cmd: 'update', + steps: steps, + temperature: this.temperature, + coolDown: this.coolDown + }); + for (var i = 0; i < steps; i++) { + this.temperature *= this.coolDown; + } + } else { + requestAnimationFrame(this._$onupdate); + for (var i = 0; i < nodes.length; i++) { + var n = nodes[i]; + vec2.copy(this._layout.nodes[i].position, n.layout.position); + } + for (var i = 0; i < steps; i++) { + this._layout.temperature = this.temperature; + this._layout.update(); + this.temperature *= this.coolDown; + } + } + }; + ForceLayout.prototype._$onupdate = function (e) { + if (this._layoutWorker) { + var positionArr = new Float32Array(e.data); + for (var i = 0; i < this.graph.nodes.length; i++) { + var n = this.graph.nodes[i]; + n.layout.position[0] = positionArr[i * 2]; + n.layout.position[1] = positionArr[i * 2 + 1]; + } + this.onupdate && this.onupdate(); + } else if (this._layout) { + for (var i = 0; i < this.graph.nodes.length; i++) { + var n = this.graph.nodes[i]; + vec2.copy(n.layout.position, this._layout.nodes[i].position); + } + this.onupdate && this.onupdate(); + } + }; + ForceLayout.prototype.dispose = function () { + if (this._layoutWorker) { + this._layoutWorker.terminate(); + } + this._layoutWorker = null; + this._layout = null; + }; + return ForceLayout; +});define('zrender/shape/BezierCurve', [ + 'require', + './Base', + '../tool/util' +], function (require) { + 'use strict'; + var Base = require('./Base'); + var BezierCurve = function (options) { + this.brushTypeOnly = 'stroke'; + this.textPosition = 'end'; + Base.call(this, options); + }; + BezierCurve.prototype = { + type: 'bezier-curve', + buildPath: function (ctx, style) { + ctx.moveTo(style.xStart, style.yStart); + if (typeof style.cpX2 != 'undefined' && typeof style.cpY2 != 'undefined') { + ctx.bezierCurveTo(style.cpX1, style.cpY1, style.cpX2, style.cpY2, style.xEnd, style.yEnd); + } else { + ctx.quadraticCurveTo(style.cpX1, style.cpY1, style.xEnd, style.yEnd); + } + }, + getRect: function (style) { + if (style.__rect) { + return style.__rect; + } + var _minX = Math.min(style.xStart, style.xEnd, style.cpX1); + var _minY = Math.min(style.yStart, style.yEnd, style.cpY1); + var _maxX = Math.max(style.xStart, style.xEnd, style.cpX1); + var _maxY = Math.max(style.yStart, style.yEnd, style.cpY1); + var _x2 = style.cpX2; + var _y2 = style.cpY2; + if (typeof _x2 != 'undefined' && typeof _y2 != 'undefined') { + _minX = Math.min(_minX, _x2); + _minY = Math.min(_minY, _y2); + _maxX = Math.max(_maxX, _x2); + _maxY = Math.max(_maxY, _y2); + } + var lineWidth = style.lineWidth || 1; + style.__rect = { + x: _minX - lineWidth, + y: _minY - lineWidth, + width: _maxX - _minX + lineWidth, + height: _maxY - _minY + lineWidth + }; + return style.__rect; + } + }; + require('../tool/util').inherits(BezierCurve, Base); + return BezierCurve; +});define('echarts/layout/forceLayoutWorker', [ + 'require', + 'zrender/tool/vector' +], function __echartsForceLayoutWorker(require) { + 'use strict'; + var vec2; + var inWorker = typeof window === 'undefined' && typeof require === 'undefined'; + if (inWorker) { + vec2 = { + create: function (x, y) { + var out = new Float32Array(2); + out[0] = x || 0; + out[1] = y || 0; + return out; + }, + dist: function (a, b) { + var x = b[0] - a[0]; + var y = b[1] - a[1]; + return Math.sqrt(x * x + y * y); + }, + len: function (a) { + var x = a[0]; + var y = a[1]; + return Math.sqrt(x * x + y * y); + }, + scaleAndAdd: function (out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + return out; + }, + scale: function (out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + return out; + }, + add: function (out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + return out; + }, + sub: function (out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + return out; + }, + dot: function (v1, v2) { + return v1[0] * v2[0] + v1[1] * v2[1]; + }, + normalize: function (out, a) { + var x = a[0]; + var y = a[1]; + var len = x * x + y * y; + if (len > 0) { + len = 1 / Math.sqrt(len); + out[0] = a[0] * len; + out[1] = a[1] * len; + } + return out; + }, + negate: function (out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + return out; + }, + copy: function (out, a) { + out[0] = a[0]; + out[1] = a[1]; + return out; + }, + set: function (out, x, y) { + out[0] = x; + out[1] = y; + return out; + } + }; + } else { + vec2 = require('zrender/tool/vector'); + } + var ArrayCtor = typeof Float32Array == 'undefined' ? Array : Float32Array; + function Region() { + this.subRegions = []; + this.nSubRegions = 0; + this.node = null; + this.mass = 0; + this.centerOfMass = null; + this.bbox = new ArrayCtor(4); + this.size = 0; + } + Region.prototype.beforeUpdate = function () { + for (var i = 0; i < this.nSubRegions; i++) { + this.subRegions[i].beforeUpdate(); + } + this.mass = 0; + if (this.centerOfMass) { + this.centerOfMass[0] = 0; + this.centerOfMass[1] = 0; + } + this.nSubRegions = 0; + this.node = null; + }; + Region.prototype.afterUpdate = function () { + this.subRegions.length = this.nSubRegions; + for (var i = 0; i < this.nSubRegions; i++) { + this.subRegions[i].afterUpdate(); + } + }; + Region.prototype.addNode = function (node) { + if (this.nSubRegions === 0) { + if (this.node == null) { + this.node = node; + return; + } else { + this._addNodeToSubRegion(this.node); + this.node = null; + } + } + this._addNodeToSubRegion(node); + this._updateCenterOfMass(node); + }; + Region.prototype.findSubRegion = function (x, y) { + for (var i = 0; i < this.nSubRegions; i++) { + var region = this.subRegions[i]; + if (region.contain(x, y)) { + return region; + } + } + }; + Region.prototype.contain = function (x, y) { + return this.bbox[0] <= x && this.bbox[2] >= x && this.bbox[1] <= y && this.bbox[3] >= y; + }; + Region.prototype.setBBox = function (minX, minY, maxX, maxY) { + this.bbox[0] = minX; + this.bbox[1] = minY; + this.bbox[2] = maxX; + this.bbox[3] = maxY; + this.size = (maxX - minX + maxY - minY) / 2; + }; + Region.prototype._newSubRegion = function () { + var subRegion = this.subRegions[this.nSubRegions]; + if (!subRegion) { + subRegion = new Region(); + this.subRegions[this.nSubRegions] = subRegion; + } + this.nSubRegions++; + return subRegion; + }; + Region.prototype._addNodeToSubRegion = function (node) { + var subRegion = this.findSubRegion(node.position[0], node.position[1]); + var bbox = this.bbox; + if (!subRegion) { + var cx = (bbox[0] + bbox[2]) / 2; + var cy = (bbox[1] + bbox[3]) / 2; + var w = (bbox[2] - bbox[0]) / 2; + var h = (bbox[3] - bbox[1]) / 2; + var xi = node.position[0] >= cx ? 1 : 0; + var yi = node.position[1] >= cy ? 1 : 0; + var subRegion = this._newSubRegion(); + subRegion.setBBox(xi * w + bbox[0], yi * h + bbox[1], (xi + 1) * w + bbox[0], (yi + 1) * h + bbox[1]); + } + subRegion.addNode(node); + }; + Region.prototype._updateCenterOfMass = function (node) { + if (this.centerOfMass == null) { + this.centerOfMass = vec2.create(); + } + var x = this.centerOfMass[0] * this.mass; + var y = this.centerOfMass[1] * this.mass; + x += node.position[0] * node.mass; + y += node.position[1] * node.mass; + this.mass += node.mass; + this.centerOfMass[0] = x / this.mass; + this.centerOfMass[1] = y / this.mass; + }; + function GraphNode() { + this.position = vec2.create(); + this.force = vec2.create(); + this.forcePrev = vec2.create(); + this.speed = vec2.create(); + this.speedPrev = vec2.create(); + this.mass = 1; + this.inDegree = 0; + this.outDegree = 0; + } + function GraphEdge(node1, node2) { + this.node1 = node1; + this.node2 = node2; + this.weight = 1; + } + function ForceLayout() { + this.barnesHutOptimize = false; + this.barnesHutTheta = 1.5; + this.repulsionByDegree = false; + this.preventNodeOverlap = false; + this.preventNodeEdgeOverlap = false; + this.strongGravity = true; + this.gravity = 1; + this.scaling = 1; + this.edgeWeightInfluence = 1; + this.center = [ + 0, + 0 + ]; + this.width = 500; + this.height = 500; + this.maxSpeedIncrease = 1; + this.nodes = []; + this.edges = []; + this.bbox = new ArrayCtor(4); + this._rootRegion = new Region(); + this._rootRegion.centerOfMass = vec2.create(); + this._massArr = null; + this._k = 0; + } + ForceLayout.prototype.nodeToNodeRepulsionFactor = function (mass, d, k) { + return k * k * mass / d; + }; + ForceLayout.prototype.edgeToNodeRepulsionFactor = function (mass, d, k) { + return k * mass / d; + }; + ForceLayout.prototype.attractionFactor = function (w, d, k) { + return w * d / k; + }; + ForceLayout.prototype.initNodes = function (positionArr, massArr, sizeArr) { + this.temperature = 1; + var nNodes = positionArr.length / 2; + this.nodes.length = 0; + var haveSize = typeof sizeArr !== 'undefined'; + for (var i = 0; i < nNodes; i++) { + var node = new GraphNode(); + node.position[0] = positionArr[i * 2]; + node.position[1] = positionArr[i * 2 + 1]; + node.mass = massArr[i]; + if (haveSize) { + node.size = sizeArr[i]; + } + this.nodes.push(node); + } + this._massArr = massArr; + if (haveSize) { + this._sizeArr = sizeArr; + } + }; + ForceLayout.prototype.initEdges = function (edgeArr, edgeWeightArr) { + var nEdges = edgeArr.length / 2; + this.edges.length = 0; + var edgeHaveWeight = typeof edgeWeightArr !== 'undefined'; + for (var i = 0; i < nEdges; i++) { + var sIdx = edgeArr[i * 2]; + var tIdx = edgeArr[i * 2 + 1]; + var sNode = this.nodes[sIdx]; + var tNode = this.nodes[tIdx]; + if (!sNode || !tNode) { + continue; + } + sNode.outDegree++; + tNode.inDegree++; + var edge = new GraphEdge(sNode, tNode); + if (edgeHaveWeight) { + edge.weight = edgeWeightArr[i]; + } + this.edges.push(edge); + } + }; + ForceLayout.prototype.update = function () { + var nNodes = this.nodes.length; + this.updateBBox(); + this._k = 0.4 * this.scaling * Math.sqrt(this.width * this.height / nNodes); + if (this.barnesHutOptimize) { + this._rootRegion.setBBox(this.bbox[0], this.bbox[1], this.bbox[2], this.bbox[3]); + this._rootRegion.beforeUpdate(); + for (var i = 0; i < nNodes; i++) { + this._rootRegion.addNode(this.nodes[i]); + } + this._rootRegion.afterUpdate(); + } else { + var mass = 0; + var centerOfMass = this._rootRegion.centerOfMass; + vec2.set(centerOfMass, 0, 0); + for (var i = 0; i < nNodes; i++) { + var node = this.nodes[i]; + mass += node.mass; + vec2.scaleAndAdd(centerOfMass, centerOfMass, node.position, node.mass); + } + if (mass > 0) { + vec2.scale(centerOfMass, centerOfMass, 1 / mass); + } + } + this.updateForce(); + this.updatePosition(); + }; + ForceLayout.prototype.updateForce = function () { + var nNodes = this.nodes.length; + for (var i = 0; i < nNodes; i++) { + var node = this.nodes[i]; + vec2.copy(node.forcePrev, node.force); + vec2.copy(node.speedPrev, node.speed); + vec2.set(node.force, 0, 0); + } + this.updateNodeNodeForce(); + if (this.gravity > 0) { + this.updateGravityForce(); + } + this.updateEdgeForce(); + if (this.preventNodeEdgeOverlap) { + this.updateNodeEdgeForce(); + } + }; + ForceLayout.prototype.updatePosition = function () { + var nNodes = this.nodes.length; + var v = vec2.create(); + for (var i = 0; i < nNodes; i++) { + var node = this.nodes[i]; + var speed = node.speed; + vec2.scale(node.force, node.force, 1 / 30); + var df = vec2.len(node.force) + 0.1; + var scale = Math.min(df, 500) / df; + vec2.scale(node.force, node.force, scale); + vec2.add(speed, speed, node.force); + vec2.scale(speed, speed, this.temperature); + vec2.sub(v, speed, node.speedPrev); + var swing = vec2.len(v); + if (swing > 0) { + vec2.scale(v, v, 1 / swing); + var base = vec2.len(node.speedPrev); + if (base > 0) { + swing = Math.min(swing / base, this.maxSpeedIncrease) * base; + vec2.scaleAndAdd(speed, node.speedPrev, v, swing); + } + } + var ds = vec2.len(speed); + var scale = Math.min(ds, 100) / (ds + 0.1); + vec2.scale(speed, speed, scale); + vec2.add(node.position, node.position, speed); + } + }; + ForceLayout.prototype.updateNodeNodeForce = function () { + var nNodes = this.nodes.length; + for (var i = 0; i < nNodes; i++) { + var na = this.nodes[i]; + if (this.barnesHutOptimize) { + this.applyRegionToNodeRepulsion(this._rootRegion, na); + } else { + for (var j = i + 1; j < nNodes; j++) { + var nb = this.nodes[j]; + this.applyNodeToNodeRepulsion(na, nb, false); + } + } + } + }; + ForceLayout.prototype.updateGravityForce = function () { + for (var i = 0; i < this.nodes.length; i++) { + this.applyNodeGravity(this.nodes[i]); + } + }; + ForceLayout.prototype.updateEdgeForce = function () { + for (var i = 0; i < this.edges.length; i++) { + this.applyEdgeAttraction(this.edges[i]); + } + }; + ForceLayout.prototype.updateNodeEdgeForce = function () { + for (var i = 0; i < this.nodes.length; i++) { + for (var j = 0; j < this.edges.length; j++) { + this.applyEdgeToNodeRepulsion(this.edges[j], this.nodes[i]); + } + } + }; + ForceLayout.prototype.applyRegionToNodeRepulsion = function () { + var v = vec2.create(); + return function applyRegionToNodeRepulsion(region, node) { + if (region.node) { + this.applyNodeToNodeRepulsion(region.node, node, true); + } else { + if (region.mass === 0 && node.mass === 0) { + return; + } + vec2.sub(v, node.position, region.centerOfMass); + var d2 = v[0] * v[0] + v[1] * v[1]; + if (d2 > this.barnesHutTheta * region.size * region.size) { + var factor = this._k * this._k * (node.mass + region.mass) / (d2 + 1); + vec2.scaleAndAdd(node.force, node.force, v, factor * 2); + } else { + for (var i = 0; i < region.nSubRegions; i++) { + this.applyRegionToNodeRepulsion(region.subRegions[i], node); + } + } + } + }; + }(); + ForceLayout.prototype.applyNodeToNodeRepulsion = function () { + var v = vec2.create(); + return function applyNodeToNodeRepulsion(na, nb, oneWay) { + if (na === nb) { + return; + } + if (na.mass === 0 && nb.mass === 0) { + return; + } + vec2.sub(v, na.position, nb.position); + var d2 = v[0] * v[0] + v[1] * v[1]; + if (d2 === 0) { + return; + } + var factor; + var mass = na.mass + nb.mass; + var d = Math.sqrt(d2); + vec2.scale(v, v, 1 / d); + if (this.preventNodeOverlap) { + d = d - na.size - nb.size; + if (d > 0) { + factor = this.nodeToNodeRepulsionFactor(mass, d, this._k); + } else if (d <= 0) { + factor = this._k * this._k * 10 * mass; + } + } else { + factor = this.nodeToNodeRepulsionFactor(mass, d, this._k); + } + if (!oneWay) { + vec2.scaleAndAdd(na.force, na.force, v, factor * 2); + } + vec2.scaleAndAdd(nb.force, nb.force, v, -factor * 2); + }; + }(); + ForceLayout.prototype.applyEdgeAttraction = function () { + var v = vec2.create(); + return function applyEdgeAttraction(edge) { + var na = edge.node1; + var nb = edge.node2; + vec2.sub(v, na.position, nb.position); + var d = vec2.len(v); + var w; + if (this.edgeWeightInfluence === 0) { + w = 1; + } else if (this.edgeWeightInfluence == 1) { + w = edge.weight; + } else { + w = Math.pow(edge.weight, this.edgeWeightInfluence); + } + var factor; + if (this.preventOverlap) { + d = d - na.size - nb.size; + if (d <= 0) { + return; + } + } + var factor = this.attractionFactor(w, d, this._k); + vec2.scaleAndAdd(na.force, na.force, v, -factor); + vec2.scaleAndAdd(nb.force, nb.force, v, factor); + }; + }(); + ForceLayout.prototype.applyNodeGravity = function () { + var v = vec2.create(); + return function (node) { + vec2.sub(v, this.center, node.position); + if (this.width > this.height) { + v[1] *= this.width / this.height; + } else { + v[0] *= this.height / this.width; + } + var d = vec2.len(v) / 100; + if (this.strongGravity) { + vec2.scaleAndAdd(node.force, node.force, v, d * this.gravity * node.mass); + } else { + vec2.scaleAndAdd(node.force, node.force, v, this.gravity * node.mass / (d + 1)); + } + }; + }(); + ForceLayout.prototype.applyEdgeToNodeRepulsion = function () { + var v12 = vec2.create(); + var v13 = vec2.create(); + var p = vec2.create(); + return function (e, n3) { + var n1 = e.node1; + var n2 = e.node2; + if (n1 === n3 || n2 === n3) { + return; + } + vec2.sub(v12, n2.position, n1.position); + vec2.sub(v13, n3.position, n1.position); + var len12 = vec2.len(v12); + vec2.scale(v12, v12, 1 / len12); + var len = vec2.dot(v12, v13); + if (len < 0 || len > len12) { + return; + } + vec2.scaleAndAdd(p, n1.position, v12, len); + var dist = vec2.dist(p, n3.position) - n3.size; + var factor = this.edgeToNodeRepulsionFactor(n3.mass, Math.max(dist, 0.1), 100); + vec2.sub(v12, n3.position, p); + vec2.normalize(v12, v12); + vec2.scaleAndAdd(n3.force, n3.force, v12, factor); + vec2.scaleAndAdd(n1.force, n1.force, v12, -factor); + vec2.scaleAndAdd(n2.force, n2.force, v12, -factor); + }; + }(); + ForceLayout.prototype.updateBBox = function () { + var minX = Infinity; + var minY = Infinity; + var maxX = -Infinity; + var maxY = -Infinity; + for (var i = 0; i < this.nodes.length; i++) { + var pos = this.nodes[i].position; + minX = Math.min(minX, pos[0]); + minY = Math.min(minY, pos[1]); + maxX = Math.max(maxX, pos[0]); + maxY = Math.max(maxY, pos[1]); + } + this.bbox[0] = minX; + this.bbox[1] = minY; + this.bbox[2] = maxX; + this.bbox[3] = maxY; + }; + ForceLayout.getWorkerCode = function () { + var str = __echartsForceLayoutWorker.toString(); + return str.slice(str.indexOf('{') + 1, str.lastIndexOf('return')); + }; + if (inWorker) { + var forceLayout = null; + self.onmessage = function (e) { + if (e.data instanceof ArrayBuffer) { + if (!forceLayout) + return; + var positionArr = new Float32Array(e.data); + var nNodes = positionArr.length / 2; + for (var i = 0; i < nNodes; i++) { + var node = forceLayout.nodes[i]; + node.position[0] = positionArr[i * 2]; + node.position[1] = positionArr[i * 2 + 1]; + } + return; + } + switch (e.data.cmd) { + case 'init': + if (!forceLayout) { + forceLayout = new ForceLayout(); + } + forceLayout.initNodes(e.data.nodesPosition, e.data.nodesMass, e.data.nodesSize); + forceLayout.initEdges(e.data.edges, e.data.edgesWeight); + break; + case 'updateConfig': + if (forceLayout) { + for (var name in e.data.config) { + forceLayout[name] = e.data.config[name]; + } + } + break; + case 'update': + var steps = e.data.steps; + if (forceLayout) { + var nNodes = forceLayout.nodes.length; + var positionArr = new Float32Array(nNodes * 2); + forceLayout.temperature = e.data.temperature; + for (var i = 0; i < steps; i++) { + forceLayout.update(); + forceLayout.temperature *= e.data.coolDown; + } + for (var i = 0; i < nNodes; i++) { + var node = forceLayout.nodes[i]; + positionArr[i * 2] = node.position[0]; + positionArr[i * 2 + 1] = node.position[1]; + } + self.postMessage(positionArr.buffer, [positionArr.buffer]); + } else { + var emptyArr = new Float32Array(); + self.postMessage(emptyArr.buffer, [emptyArr.buffer]); + } + break; + } + }; + } + return ForceLayout; +}); \ No newline at end of file diff --git a/build/source/chart/funnel.js b/build/source/chart/funnel.js new file mode 100644 index 0000000..013be3c --- /dev/null +++ b/build/source/chart/funnel.js @@ -0,0 +1,553 @@ +define('echarts/chart/funnel', [ + 'require', + './base', + 'zrender/shape/Text', + 'zrender/shape/Line', + 'zrender/shape/Polygon', + '../config', + '../util/ecData', + '../util/number', + 'zrender/tool/util', + 'zrender/tool/color', + 'zrender/tool/area', + '../chart' +], function (require) { + var ChartBase = require('./base'); + var TextShape = require('zrender/shape/Text'); + var LineShape = require('zrender/shape/Line'); + var PolygonShape = require('zrender/shape/Polygon'); + var ecConfig = require('../config'); + ecConfig.funnel = { + zlevel: 0, + z: 2, + clickable: true, + legendHoverLink: true, + x: 80, + y: 60, + x2: 80, + y2: 60, + min: 0, + max: 100, + minSize: '0%', + maxSize: '100%', + sort: 'descending', + gap: 0, + funnelAlign: 'center', + itemStyle: { + normal: { + borderColor: '#fff', + borderWidth: 1, + label: { + show: true, + position: 'outer' + }, + labelLine: { + show: true, + length: 10, + lineStyle: { + width: 1, + type: 'solid' + } + } + }, + emphasis: { + borderColor: 'rgba(0,0,0,0)', + borderWidth: 1, + label: { show: true }, + labelLine: { show: true } + } + } + }; + var ecData = require('../util/ecData'); + var number = require('../util/number'); + var zrUtil = require('zrender/tool/util'); + var zrColor = require('zrender/tool/color'); + var zrArea = require('zrender/tool/area'); + function Funnel(ecTheme, messageCenter, zr, option, myChart) { + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); + this.refresh(option); + } + Funnel.prototype = { + type: ecConfig.CHART_TYPE_FUNNEL, + _buildShape: function () { + var series = this.series; + var legend = this.component.legend; + this._paramsMap = {}; + this._selected = {}; + this.selectedMap = {}; + var serieName; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type === ecConfig.CHART_TYPE_FUNNEL) { + series[i] = this.reformOption(series[i]); + this.legendHoverLink = series[i].legendHoverLink || this.legendHoverLink; + serieName = series[i].name || ''; + this.selectedMap[serieName] = legend ? legend.isSelected(serieName) : true; + if (!this.selectedMap[serieName]) { + continue; + } + this._buildSingleFunnel(i); + this.buildMark(i); + } + } + this.addShapeList(); + }, + _buildSingleFunnel: function (seriesIndex) { + var legend = this.component.legend; + var serie = this.series[seriesIndex]; + var data = this._mapData(seriesIndex); + var location = this._getLocation(seriesIndex); + this._paramsMap[seriesIndex] = { + location: location, + data: data + }; + var itemName; + var total = 0; + var selectedData = []; + for (var i = 0, l = data.length; i < l; i++) { + itemName = data[i].name; + this.selectedMap[itemName] = legend ? legend.isSelected(itemName) : true; + if (this.selectedMap[itemName] && !isNaN(data[i].value)) { + selectedData.push(data[i]); + total++; + } + } + if (total === 0) { + return; + } + var funnelCase = this._buildFunnelCase(seriesIndex); + var align = serie.funnelAlign; + var gap = serie.gap; + var height = total > 1 ? (location.height - (total - 1) * gap) / total : location.height; + var width; + var lastY = location.y; + var lastWidth = serie.sort === 'descending' ? this._getItemWidth(seriesIndex, selectedData[0].value) : number.parsePercent(serie.minSize, location.width); + var next = serie.sort === 'descending' ? 1 : 0; + var centerX = location.centerX; + var pointList = []; + var x; + var polygon; + var lastPolygon; + for (var i = 0, l = selectedData.length; i < l; i++) { + itemName = selectedData[i].name; + if (this.selectedMap[itemName] && !isNaN(selectedData[i].value)) { + width = i <= l - 2 ? this._getItemWidth(seriesIndex, selectedData[i + next].value) : serie.sort === 'descending' ? number.parsePercent(serie.minSize, location.width) : number.parsePercent(serie.maxSize, location.width); + switch (align) { + case 'left': + x = location.x; + break; + case 'right': + x = location.x + location.width - lastWidth; + break; + default: + x = centerX - lastWidth / 2; + } + polygon = this._buildItem(seriesIndex, selectedData[i]._index, legend ? legend.getColor(itemName) : this.zr.getColor(selectedData[i]._index), x, lastY, lastWidth, width, height, align); + lastY += height + gap; + lastPolygon = polygon.style.pointList; + pointList.unshift([ + lastPolygon[0][0] - 10, + lastPolygon[0][1] + ]); + pointList.push([ + lastPolygon[1][0] + 10, + lastPolygon[1][1] + ]); + if (i === 0) { + if (lastWidth === 0) { + lastPolygon = pointList.pop(); + align == 'center' && (pointList[0][0] += 10); + align == 'right' && (pointList[0][0] = lastPolygon[0]); + pointList[0][1] -= align == 'center' ? 10 : 15; + if (l == 1) { + lastPolygon = polygon.style.pointList; + } + } else { + pointList[pointList.length - 1][1] -= 5; + pointList[0][1] -= 5; + } + } + lastWidth = width; + } + } + if (funnelCase) { + pointList.unshift([ + lastPolygon[3][0] - 10, + lastPolygon[3][1] + ]); + pointList.push([ + lastPolygon[2][0] + 10, + lastPolygon[2][1] + ]); + if (lastWidth === 0) { + lastPolygon = pointList.pop(); + align == 'center' && (pointList[0][0] += 10); + align == 'right' && (pointList[0][0] = lastPolygon[0]); + pointList[0][1] += align == 'center' ? 10 : 15; + } else { + pointList[pointList.length - 1][1] += 5; + pointList[0][1] += 5; + } + funnelCase.style.pointList = pointList; + } + }, + _buildFunnelCase: function (seriesIndex) { + var serie = this.series[seriesIndex]; + if (this.deepQuery([ + serie, + this.option + ], 'calculable')) { + var location = this._paramsMap[seriesIndex].location; + var gap = 10; + var funnelCase = { + hoverable: false, + style: { + pointListd: [ + [ + location.x - gap, + location.y - gap + ], + [ + location.x + location.width + gap, + location.y - gap + ], + [ + location.x + location.width + gap, + location.y + location.height + gap + ], + [ + location.x - gap, + location.y + location.height + gap + ] + ], + brushType: 'stroke', + lineWidth: 1, + strokeColor: serie.calculableHolderColor || this.ecTheme.calculableHolderColor || ecConfig.calculableHolderColor + } + }; + ecData.pack(funnelCase, serie, seriesIndex, undefined, -1); + this.setCalculable(funnelCase); + funnelCase = new PolygonShape(funnelCase); + this.shapeList.push(funnelCase); + return funnelCase; + } + }, + _getLocation: function (seriesIndex) { + var gridOption = this.series[seriesIndex]; + var zrWidth = this.zr.getWidth(); + var zrHeight = this.zr.getHeight(); + var x = this.parsePercent(gridOption.x, zrWidth); + var y = this.parsePercent(gridOption.y, zrHeight); + var width = gridOption.width == null ? zrWidth - x - this.parsePercent(gridOption.x2, zrWidth) : this.parsePercent(gridOption.width, zrWidth); + return { + x: x, + y: y, + width: width, + height: gridOption.height == null ? zrHeight - y - this.parsePercent(gridOption.y2, zrHeight) : this.parsePercent(gridOption.height, zrHeight), + centerX: x + width / 2 + }; + }, + _mapData: function (seriesIndex) { + var serie = this.series[seriesIndex]; + var funnelData = zrUtil.clone(serie.data); + for (var i = 0, l = funnelData.length; i < l; i++) { + funnelData[i]._index = i; + } + function numDescending(a, b) { + if (a.value === '-') { + return 1; + } else if (b.value === '-') { + return -1; + } + return b.value - a.value; + } + function numAscending(a, b) { + return -numDescending(a, b); + } + if (serie.sort != 'none') { + funnelData.sort(serie.sort === 'descending' ? numDescending : numAscending); + } + return funnelData; + }, + _buildItem: function (seriesIndex, dataIndex, defaultColor, x, y, topWidth, bottomWidth, height, align) { + var series = this.series; + var serie = series[seriesIndex]; + var data = serie.data[dataIndex]; + var polygon = this.getPolygon(seriesIndex, dataIndex, defaultColor, x, y, topWidth, bottomWidth, height, align); + ecData.pack(polygon, series[seriesIndex], seriesIndex, series[seriesIndex].data[dataIndex], dataIndex, series[seriesIndex].data[dataIndex].name); + this.shapeList.push(polygon); + var label = this.getLabel(seriesIndex, dataIndex, defaultColor, x, y, topWidth, bottomWidth, height, align); + ecData.pack(label, series[seriesIndex], seriesIndex, series[seriesIndex].data[dataIndex], dataIndex, series[seriesIndex].data[dataIndex].name); + this.shapeList.push(label); + if (!this._needLabel(serie, data, false)) { + label.invisible = true; + } + var labelLine = this.getLabelLine(seriesIndex, dataIndex, defaultColor, x, y, topWidth, bottomWidth, height, align); + this.shapeList.push(labelLine); + if (!this._needLabelLine(serie, data, false)) { + labelLine.invisible = true; + } + var polygonHoverConnect = []; + var labelHoverConnect = []; + if (this._needLabelLine(serie, data, true)) { + polygonHoverConnect.push(labelLine.id); + labelHoverConnect.push(labelLine.id); + } + if (this._needLabel(serie, data, true)) { + polygonHoverConnect.push(label.id); + labelHoverConnect.push(polygon.id); + } + polygon.hoverConnect = polygonHoverConnect; + label.hoverConnect = labelHoverConnect; + return polygon; + }, + _getItemWidth: function (seriesIndex, value) { + var serie = this.series[seriesIndex]; + var location = this._paramsMap[seriesIndex].location; + var min = serie.min; + var max = serie.max; + var minSize = number.parsePercent(serie.minSize, location.width); + var maxSize = number.parsePercent(serie.maxSize, location.width); + return value * (maxSize - minSize) / (max - min); + }, + getPolygon: function (seriesIndex, dataIndex, defaultColor, xLT, y, topWidth, bottomWidth, height, align) { + var serie = this.series[seriesIndex]; + var data = serie.data[dataIndex]; + var queryTarget = [ + data, + serie + ]; + var normal = this.deepMerge(queryTarget, 'itemStyle.normal') || {}; + var emphasis = this.deepMerge(queryTarget, 'itemStyle.emphasis') || {}; + var normalColor = this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) || defaultColor; + var emphasisColor = this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data) || (typeof normalColor === 'string' ? zrColor.lift(normalColor, -0.2) : normalColor); + var xLB; + switch (align) { + case 'left': + xLB = xLT; + break; + case 'right': + xLB = xLT + (topWidth - bottomWidth); + break; + default: + xLB = xLT + (topWidth - bottomWidth) / 2; + break; + } + var polygon = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + clickable: this.deepQuery(queryTarget, 'clickable'), + style: { + pointList: [ + [ + xLT, + y + ], + [ + xLT + topWidth, + y + ], + [ + xLB + bottomWidth, + y + height + ], + [ + xLB, + y + height + ] + ], + brushType: 'both', + color: normalColor, + lineWidth: normal.borderWidth, + strokeColor: normal.borderColor + }, + highlightStyle: { + color: emphasisColor, + lineWidth: emphasis.borderWidth, + strokeColor: emphasis.borderColor + } + }; + if (this.deepQuery([ + data, + serie, + this.option + ], 'calculable')) { + this.setCalculable(polygon); + polygon.draggable = true; + } + return new PolygonShape(polygon); + }, + getLabel: function (seriesIndex, dataIndex, defaultColor, x, y, topWidth, bottomWidth, height, align) { + var serie = this.series[seriesIndex]; + var data = serie.data[dataIndex]; + var location = this._paramsMap[seriesIndex].location; + var itemStyle = zrUtil.merge(zrUtil.clone(data.itemStyle) || {}, serie.itemStyle); + var status = 'normal'; + var labelControl = itemStyle[status].label; + var textStyle = labelControl.textStyle || {}; + var lineLength = itemStyle[status].labelLine.length; + var text = this.getLabelText(seriesIndex, dataIndex, status); + var textFont = this.getFont(textStyle); + var textAlign; + var textColor = defaultColor; + labelControl.position = labelControl.position || itemStyle.normal.label.position; + if (labelControl.position === 'inner' || labelControl.position === 'inside' || labelControl.position === 'center') { + textAlign = align; + textColor = Math.max(topWidth, bottomWidth) / 2 > zrArea.getTextWidth(text, textFont) ? '#fff' : zrColor.reverse(defaultColor); + } else if (labelControl.position === 'left') { + textAlign = 'right'; + } else { + textAlign = 'left'; + } + var textShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + style: { + x: this._getLabelPoint(labelControl.position, x, location, topWidth, bottomWidth, lineLength, align), + y: y + height / 2, + color: textStyle.color || textColor, + text: text, + textAlign: textStyle.align || textAlign, + textBaseline: textStyle.baseline || 'middle', + textFont: textFont + } + }; + status = 'emphasis'; + labelControl = itemStyle[status].label || labelControl; + textStyle = labelControl.textStyle || textStyle; + lineLength = itemStyle[status].labelLine.length || lineLength; + labelControl.position = labelControl.position || itemStyle.normal.label.position; + text = this.getLabelText(seriesIndex, dataIndex, status); + textFont = this.getFont(textStyle); + textColor = defaultColor; + if (labelControl.position === 'inner' || labelControl.position === 'inside' || labelControl.position === 'center') { + textAlign = align; + textColor = Math.max(topWidth, bottomWidth) / 2 > zrArea.getTextWidth(text, textFont) ? '#fff' : zrColor.reverse(defaultColor); + } else if (labelControl.position === 'left') { + textAlign = 'right'; + } else { + textAlign = 'left'; + } + textShape.highlightStyle = { + x: this._getLabelPoint(labelControl.position, x, location, topWidth, bottomWidth, lineLength, align), + color: textStyle.color || textColor, + text: text, + textAlign: textStyle.align || textAlign, + textFont: textFont, + brushType: 'fill' + }; + return new TextShape(textShape); + }, + getLabelText: function (seriesIndex, dataIndex, status) { + var series = this.series; + var serie = series[seriesIndex]; + var data = serie.data[dataIndex]; + var formatter = this.deepQuery([ + data, + serie + ], 'itemStyle.' + status + '.label.formatter'); + if (formatter) { + if (typeof formatter === 'function') { + return formatter.call(this.myChart, { + seriesIndex: seriesIndex, + seriesName: serie.name || '', + series: serie, + dataIndex: dataIndex, + data: data, + name: data.name, + value: data.value + }); + } else if (typeof formatter === 'string') { + formatter = formatter.replace('{a}', '{a0}').replace('{b}', '{b0}').replace('{c}', '{c0}').replace('{a0}', serie.name).replace('{b0}', data.name).replace('{c0}', data.value); + return formatter; + } + } else { + return data.name; + } + }, + getLabelLine: function (seriesIndex, dataIndex, defaultColor, x, y, topWidth, bottomWidth, height, align) { + var serie = this.series[seriesIndex]; + var data = serie.data[dataIndex]; + var location = this._paramsMap[seriesIndex].location; + var itemStyle = zrUtil.merge(zrUtil.clone(data.itemStyle) || {}, serie.itemStyle); + var status = 'normal'; + var labelLineControl = itemStyle[status].labelLine; + var lineLength = itemStyle[status].labelLine.length; + var lineStyle = labelLineControl.lineStyle || {}; + var labelControl = itemStyle[status].label; + labelControl.position = labelControl.position || itemStyle.normal.label.position; + var lineShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + hoverable: false, + style: { + xStart: this._getLabelLineStartPoint(x, location, topWidth, bottomWidth, align), + yStart: y + height / 2, + xEnd: this._getLabelPoint(labelControl.position, x, location, topWidth, bottomWidth, lineLength, align), + yEnd: y + height / 2, + strokeColor: lineStyle.color || defaultColor, + lineType: lineStyle.type, + lineWidth: lineStyle.width + } + }; + status = 'emphasis'; + labelLineControl = itemStyle[status].labelLine || labelLineControl; + lineLength = itemStyle[status].labelLine.length || lineLength; + lineStyle = labelLineControl.lineStyle || lineStyle; + labelControl = itemStyle[status].label || labelControl; + labelControl.position = labelControl.position; + lineShape.highlightStyle = { + xEnd: this._getLabelPoint(labelControl.position, x, location, topWidth, bottomWidth, lineLength, align), + strokeColor: lineStyle.color || defaultColor, + lineType: lineStyle.type, + lineWidth: lineStyle.width + }; + return new LineShape(lineShape); + }, + _getLabelPoint: function (position, x, location, topWidth, bottomWidth, lineLength, align) { + position = position === 'inner' || position === 'inside' ? 'center' : position; + switch (position) { + case 'center': + return align == 'center' ? x + topWidth / 2 : align == 'left' ? x + 10 : x + topWidth - 10; + case 'left': + if (lineLength === 'auto') { + return location.x - 10; + } else { + return align == 'center' ? location.centerX - Math.max(topWidth, bottomWidth) / 2 - lineLength : align == 'right' ? x - (topWidth < bottomWidth ? bottomWidth - topWidth : 0) - lineLength : location.x - lineLength; + } + break; + default: + if (lineLength === 'auto') { + return location.x + location.width + 10; + } else { + return align == 'center' ? location.centerX + Math.max(topWidth, bottomWidth) / 2 + lineLength : align == 'right' ? location.x + location.width + lineLength : x + Math.max(topWidth, bottomWidth) + lineLength; + } + } + }, + _getLabelLineStartPoint: function (x, location, topWidth, bottomWidth, align) { + return align == 'center' ? location.centerX : topWidth < bottomWidth ? x + Math.min(topWidth, bottomWidth) / 2 : x + Math.max(topWidth, bottomWidth) / 2; + }, + _needLabel: function (serie, data, isEmphasis) { + return this.deepQuery([ + data, + serie + ], 'itemStyle.' + (isEmphasis ? 'emphasis' : 'normal') + '.label.show'); + }, + _needLabelLine: function (serie, data, isEmphasis) { + return this.deepQuery([ + data, + serie + ], 'itemStyle.' + (isEmphasis ? 'emphasis' : 'normal') + '.labelLine.show'); + }, + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + this.backupShapeList(); + this._buildShape(); + } + }; + zrUtil.inherits(Funnel, ChartBase); + require('../chart').define('funnel', Funnel); + return Funnel; +}); \ No newline at end of file diff --git a/build/source/chart/gauge.js b/build/source/chart/gauge.js new file mode 100644 index 0000000..60cacf9 --- /dev/null +++ b/build/source/chart/gauge.js @@ -0,0 +1,576 @@ +define('echarts/chart/gauge', [ + 'require', + './base', + '../util/shape/GaugePointer', + 'zrender/shape/Text', + 'zrender/shape/Line', + 'zrender/shape/Rectangle', + 'zrender/shape/Circle', + 'zrender/shape/Sector', + '../config', + '../util/ecData', + '../util/accMath', + 'zrender/tool/util', + '../chart' +], function (require) { + var ChartBase = require('./base'); + var GaugePointerShape = require('../util/shape/GaugePointer'); + var TextShape = require('zrender/shape/Text'); + var LineShape = require('zrender/shape/Line'); + var RectangleShape = require('zrender/shape/Rectangle'); + var CircleShape = require('zrender/shape/Circle'); + var SectorShape = require('zrender/shape/Sector'); + var ecConfig = require('../config'); + ecConfig.gauge = { + zlevel: 0, + z: 2, + center: [ + '50%', + '50%' + ], + clickable: true, + legendHoverLink: true, + radius: '75%', + startAngle: 225, + endAngle: -45, + min: 0, + max: 100, + precision: 0, + splitNumber: 10, + axisLine: { + show: true, + lineStyle: { + color: [ + [ + 0.2, + '#228b22' + ], + [ + 0.8, + '#48b' + ], + [ + 1, + '#ff4500' + ] + ], + width: 30 + } + }, + axisTick: { + show: true, + splitNumber: 5, + length: 8, + lineStyle: { + color: '#eee', + width: 1, + type: 'solid' + } + }, + axisLabel: { + show: true, + textStyle: { color: 'auto' } + }, + splitLine: { + show: true, + length: 30, + lineStyle: { + color: '#eee', + width: 2, + type: 'solid' + } + }, + pointer: { + show: true, + length: '80%', + width: 8, + color: 'auto' + }, + title: { + show: true, + offsetCenter: [ + 0, + '-40%' + ], + textStyle: { + color: '#333', + fontSize: 15 + } + }, + detail: { + show: true, + backgroundColor: 'rgba(0,0,0,0)', + borderWidth: 0, + borderColor: '#ccc', + width: 100, + height: 40, + offsetCenter: [ + 0, + '40%' + ], + textStyle: { + color: 'auto', + fontSize: 30 + } + } + }; + var ecData = require('../util/ecData'); + var accMath = require('../util/accMath'); + var zrUtil = require('zrender/tool/util'); + function Gauge(ecTheme, messageCenter, zr, option, myChart) { + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); + this.refresh(option); + } + Gauge.prototype = { + type: ecConfig.CHART_TYPE_GAUGE, + _buildShape: function () { + var series = this.series; + this._paramsMap = {}; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type === ecConfig.CHART_TYPE_GAUGE) { + series[i] = this.reformOption(series[i]); + this.legendHoverLink = series[i].legendHoverLink || this.legendHoverLink; + this._buildSingleGauge(i); + this.buildMark(i); + } + } + this.addShapeList(); + }, + _buildSingleGauge: function (seriesIndex) { + var serie = this.series[seriesIndex]; + this._paramsMap[seriesIndex] = { + center: this.parseCenter(this.zr, serie.center), + radius: this.parseRadius(this.zr, serie.radius), + startAngle: serie.startAngle.toFixed(2) - 0, + endAngle: serie.endAngle.toFixed(2) - 0 + }; + this._paramsMap[seriesIndex].totalAngle = this._paramsMap[seriesIndex].startAngle - this._paramsMap[seriesIndex].endAngle; + this._colorMap(seriesIndex); + this._buildAxisLine(seriesIndex); + this._buildSplitLine(seriesIndex); + this._buildAxisTick(seriesIndex); + this._buildAxisLabel(seriesIndex); + this._buildPointer(seriesIndex); + this._buildTitle(seriesIndex); + this._buildDetail(seriesIndex); + }, + _buildAxisLine: function (seriesIndex) { + var serie = this.series[seriesIndex]; + if (!serie.axisLine.show) { + return; + } + var min = serie.min; + var total = serie.max - min; + var params = this._paramsMap[seriesIndex]; + var center = params.center; + var startAngle = params.startAngle; + var totalAngle = params.totalAngle; + var colorArray = params.colorArray; + var lineStyle = serie.axisLine.lineStyle; + var lineWidth = this.parsePercent(lineStyle.width, params.radius[1]); + var r = params.radius[1]; + var r0 = r - lineWidth; + var sectorShape; + var lastAngle = startAngle; + var newAngle; + for (var i = 0, l = colorArray.length; i < l; i++) { + newAngle = startAngle - totalAngle * (colorArray[i][0] - min) / total; + sectorShape = this._getSector(center, r0, r, newAngle, lastAngle, colorArray[i][1], lineStyle); + lastAngle = newAngle; + sectorShape._animationAdd = 'r'; + ecData.set(sectorShape, 'seriesIndex', seriesIndex); + ecData.set(sectorShape, 'dataIndex', i); + this.shapeList.push(sectorShape); + } + }, + _buildSplitLine: function (seriesIndex) { + var serie = this.series[seriesIndex]; + if (!serie.splitLine.show) { + return; + } + var params = this._paramsMap[seriesIndex]; + var splitNumber = serie.splitNumber; + var min = serie.min; + var total = serie.max - min; + var splitLine = serie.splitLine; + var length = this.parsePercent(splitLine.length, params.radius[1]); + var lineStyle = splitLine.lineStyle; + var color = lineStyle.color; + var center = params.center; + var startAngle = params.startAngle * Math.PI / 180; + var totalAngle = params.totalAngle * Math.PI / 180; + var r = params.radius[1]; + var r0 = r - length; + var angle; + var sinAngle; + var cosAngle; + for (var i = 0; i <= splitNumber; i++) { + angle = startAngle - totalAngle / splitNumber * i; + sinAngle = Math.sin(angle); + cosAngle = Math.cos(angle); + this.shapeList.push(new LineShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + hoverable: false, + style: { + xStart: center[0] + cosAngle * r, + yStart: center[1] - sinAngle * r, + xEnd: center[0] + cosAngle * r0, + yEnd: center[1] - sinAngle * r0, + strokeColor: color === 'auto' ? this._getColor(seriesIndex, min + total / splitNumber * i) : color, + lineType: lineStyle.type, + lineWidth: lineStyle.width, + shadowColor: lineStyle.shadowColor, + shadowBlur: lineStyle.shadowBlur, + shadowOffsetX: lineStyle.shadowOffsetX, + shadowOffsetY: lineStyle.shadowOffsetY + } + })); + } + }, + _buildAxisTick: function (seriesIndex) { + var serie = this.series[seriesIndex]; + if (!serie.axisTick.show) { + return; + } + var params = this._paramsMap[seriesIndex]; + var splitNumber = serie.splitNumber; + var min = serie.min; + var total = serie.max - min; + var axisTick = serie.axisTick; + var tickSplit = axisTick.splitNumber; + var length = this.parsePercent(axisTick.length, params.radius[1]); + var lineStyle = axisTick.lineStyle; + var color = lineStyle.color; + var center = params.center; + var startAngle = params.startAngle * Math.PI / 180; + var totalAngle = params.totalAngle * Math.PI / 180; + var r = params.radius[1]; + var r0 = r - length; + var angle; + var sinAngle; + var cosAngle; + for (var i = 0, l = splitNumber * tickSplit; i <= l; i++) { + if (i % tickSplit === 0) { + continue; + } + angle = startAngle - totalAngle / l * i; + sinAngle = Math.sin(angle); + cosAngle = Math.cos(angle); + this.shapeList.push(new LineShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + hoverable: false, + style: { + xStart: center[0] + cosAngle * r, + yStart: center[1] - sinAngle * r, + xEnd: center[0] + cosAngle * r0, + yEnd: center[1] - sinAngle * r0, + strokeColor: color === 'auto' ? this._getColor(seriesIndex, min + total / l * i) : color, + lineType: lineStyle.type, + lineWidth: lineStyle.width, + shadowColor: lineStyle.shadowColor, + shadowBlur: lineStyle.shadowBlur, + shadowOffsetX: lineStyle.shadowOffsetX, + shadowOffsetY: lineStyle.shadowOffsetY + } + })); + } + }, + _buildAxisLabel: function (seriesIndex) { + var serie = this.series[seriesIndex]; + if (!serie.axisLabel.show) { + return; + } + var splitNumber = serie.splitNumber; + var min = serie.min; + var total = serie.max - min; + var textStyle = serie.axisLabel.textStyle; + var textFont = this.getFont(textStyle); + var color = textStyle.color; + var params = this._paramsMap[seriesIndex]; + var center = params.center; + var startAngle = params.startAngle; + var totalAngle = params.totalAngle; + var r0 = params.radius[1] - this.parsePercent(serie.splitLine.length, params.radius[1]) - 5; + var angle; + var sinAngle; + var cosAngle; + var value; + for (var i = 0; i <= splitNumber; i++) { + value = accMath.accAdd(min, accMath.accMul(accMath.accDiv(total, splitNumber), i)); + angle = startAngle - totalAngle / splitNumber * i; + sinAngle = Math.sin(angle * Math.PI / 180); + cosAngle = Math.cos(angle * Math.PI / 180); + angle = (angle + 360) % 360; + this.shapeList.push(new TextShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + hoverable: false, + style: { + x: center[0] + cosAngle * r0, + y: center[1] - sinAngle * r0, + color: color === 'auto' ? this._getColor(seriesIndex, value) : color, + text: this._getLabelText(serie.axisLabel.formatter, value), + textAlign: angle >= 110 && angle <= 250 ? 'left' : angle <= 70 || angle >= 290 ? 'right' : 'center', + textBaseline: angle >= 10 && angle <= 170 ? 'top' : angle >= 190 && angle <= 350 ? 'bottom' : 'middle', + textFont: textFont, + shadowColor: textStyle.shadowColor, + shadowBlur: textStyle.shadowBlur, + shadowOffsetX: textStyle.shadowOffsetX, + shadowOffsetY: textStyle.shadowOffsetY + } + })); + } + }, + _buildPointer: function (seriesIndex) { + var serie = this.series[seriesIndex]; + if (!serie.pointer.show) { + return; + } + var total = serie.max - serie.min; + var pointer = serie.pointer; + var params = this._paramsMap[seriesIndex]; + var length = this.parsePercent(pointer.length, params.radius[1]); + var width = this.parsePercent(pointer.width, params.radius[1]); + var center = params.center; + var value = this._getValue(seriesIndex); + value = value < serie.max ? value : serie.max; + var angle = (params.startAngle - params.totalAngle / total * (value - serie.min)) * Math.PI / 180; + var color = pointer.color === 'auto' ? this._getColor(seriesIndex, value) : pointer.color; + var pointShape = new GaugePointerShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + clickable: this.query(serie, 'clickable'), + style: { + x: center[0], + y: center[1], + r: length, + startAngle: params.startAngle * Math.PI / 180, + angle: angle, + color: color, + width: width, + shadowColor: pointer.shadowColor, + shadowBlur: pointer.shadowBlur, + shadowOffsetX: pointer.shadowOffsetX, + shadowOffsetY: pointer.shadowOffsetY + }, + highlightStyle: { + brushType: 'fill', + width: width > 2 ? 2 : width / 2, + color: '#fff' + } + }); + ecData.pack(pointShape, this.series[seriesIndex], seriesIndex, this.series[seriesIndex].data[0], 0, this.series[seriesIndex].data[0].name, value); + this.shapeList.push(pointShape); + this.shapeList.push(new CircleShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase() + 2, + hoverable: false, + style: { + x: center[0], + y: center[1], + r: pointer.width / 2.5, + color: '#fff' + } + })); + }, + _buildTitle: function (seriesIndex) { + var serie = this.series[seriesIndex]; + if (!serie.title.show) { + return; + } + var data = serie.data[0]; + var name = data.name != null ? data.name : ''; + if (name !== '') { + var title = serie.title; + var offsetCenter = title.offsetCenter; + var textStyle = title.textStyle; + var textColor = textStyle.color; + var params = this._paramsMap[seriesIndex]; + var x = params.center[0] + this.parsePercent(offsetCenter[0], params.radius[1]); + var y = params.center[1] + this.parsePercent(offsetCenter[1], params.radius[1]); + this.shapeList.push(new TextShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase() + (Math.abs(x - params.center[0]) + Math.abs(y - params.center[1]) < textStyle.fontSize * 2 ? 2 : 1), + hoverable: false, + style: { + x: x, + y: y, + color: textColor === 'auto' ? this._getColor(seriesIndex) : textColor, + text: name, + textAlign: 'center', + textFont: this.getFont(textStyle), + shadowColor: textStyle.shadowColor, + shadowBlur: textStyle.shadowBlur, + shadowOffsetX: textStyle.shadowOffsetX, + shadowOffsetY: textStyle.shadowOffsetY + } + })); + } + }, + _buildDetail: function (seriesIndex) { + var serie = this.series[seriesIndex]; + if (!serie.detail.show) { + return; + } + var detail = serie.detail; + var offsetCenter = detail.offsetCenter; + var color = detail.backgroundColor; + var textStyle = detail.textStyle; + var textColor = textStyle.color; + var params = this._paramsMap[seriesIndex]; + var value = this._getValue(seriesIndex); + var x = params.center[0] - detail.width / 2 + this.parsePercent(offsetCenter[0], params.radius[1]); + var y = params.center[1] + this.parsePercent(offsetCenter[1], params.radius[1]); + this.shapeList.push(new RectangleShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase() + (Math.abs(x + detail.width / 2 - params.center[0]) + Math.abs(y + detail.height / 2 - params.center[1]) < textStyle.fontSize ? 2 : 1), + hoverable: false, + style: { + x: x, + y: y, + width: detail.width, + height: detail.height, + brushType: 'both', + color: color === 'auto' ? this._getColor(seriesIndex, value) : color, + lineWidth: detail.borderWidth, + strokeColor: detail.borderColor, + shadowColor: detail.shadowColor, + shadowBlur: detail.shadowBlur, + shadowOffsetX: detail.shadowOffsetX, + shadowOffsetY: detail.shadowOffsetY, + text: this._getLabelText(detail.formatter, value), + textFont: this.getFont(textStyle), + textPosition: 'inside', + textColor: textColor === 'auto' ? this._getColor(seriesIndex, value) : textColor + } + })); + }, + _getValue: function (seriesIndex) { + return this.getDataFromOption(this.series[seriesIndex].data[0]); + }, + _colorMap: function (seriesIndex) { + var serie = this.series[seriesIndex]; + var min = serie.min; + var total = serie.max - min; + var color = serie.axisLine.lineStyle.color; + if (!(color instanceof Array)) { + color = [[ + 1, + color + ]]; + } + var colorArray = []; + for (var i = 0, l = color.length; i < l; i++) { + colorArray.push([ + color[i][0] * total + min, + color[i][1] + ]); + } + this._paramsMap[seriesIndex].colorArray = colorArray; + }, + _getColor: function (seriesIndex, value) { + if (value == null) { + value = this._getValue(seriesIndex); + } + var colorArray = this._paramsMap[seriesIndex].colorArray; + for (var i = 0, l = colorArray.length; i < l; i++) { + if (colorArray[i][0] >= value) { + return colorArray[i][1]; + } + } + return colorArray[colorArray.length - 1][1]; + }, + _getSector: function (center, r0, r, startAngle, endAngle, color, lineStyle) { + return new SectorShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: center[0], + y: center[1], + r0: r0, + r: r, + startAngle: startAngle, + endAngle: endAngle, + brushType: 'fill', + color: color, + shadowColor: lineStyle.shadowColor, + shadowBlur: lineStyle.shadowBlur, + shadowOffsetX: lineStyle.shadowOffsetX, + shadowOffsetY: lineStyle.shadowOffsetY + } + }); + }, + _getLabelText: function (formatter, value) { + if (formatter) { + if (typeof formatter === 'function') { + return formatter.call(this.myChart, value); + } else if (typeof formatter === 'string') { + return formatter.replace('{value}', value); + } + } + return value; + }, + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + this.backupShapeList(); + this._buildShape(); + } + }; + zrUtil.inherits(Gauge, ChartBase); + require('../chart').define('gauge', Gauge); + return Gauge; +});define('echarts/util/shape/GaugePointer', [ + 'require', + 'zrender/shape/Base', + 'zrender/tool/util', + './normalIsCover' +], function (require) { + var Base = require('zrender/shape/Base'); + var zrUtil = require('zrender/tool/util'); + function GaugePointer(options) { + Base.call(this, options); + } + GaugePointer.prototype = { + type: 'gauge-pointer', + buildPath: function (ctx, style) { + var r = style.r; + var width = style.width; + var angle = style.angle; + var x = style.x - Math.cos(angle) * width * (width >= r / 3 ? 1 : 2); + var y = style.y + Math.sin(angle) * width * (width >= r / 3 ? 1 : 2); + angle = style.angle - Math.PI / 2; + ctx.moveTo(x, y); + ctx.lineTo(style.x + Math.cos(angle) * width, style.y - Math.sin(angle) * width); + ctx.lineTo(style.x + Math.cos(style.angle) * r, style.y - Math.sin(style.angle) * r); + ctx.lineTo(style.x - Math.cos(angle) * width, style.y + Math.sin(angle) * width); + ctx.lineTo(x, y); + return; + }, + getRect: function (style) { + if (style.__rect) { + return style.__rect; + } + var width = style.width * 2; + var xStart = style.x; + var yStart = style.y; + var xEnd = xStart + Math.cos(style.angle) * style.r; + var yEnd = yStart - Math.sin(style.angle) * style.r; + style.__rect = { + x: Math.min(xStart, xEnd) - width, + y: Math.min(yStart, yEnd) - width, + width: Math.abs(xStart - xEnd) + width, + height: Math.abs(yStart - yEnd) + width + }; + return style.__rect; + }, + isCover: require('./normalIsCover') + }; + zrUtil.inherits(GaugePointer, Base); + return GaugePointer; +}); \ No newline at end of file diff --git a/build/source/chart/k.js b/build/source/chart/k.js new file mode 100644 index 0000000..f8217d6 --- /dev/null +++ b/build/source/chart/k.js @@ -0,0 +1,312 @@ +define('echarts/chart/k', [ + 'require', + './base', + '../util/shape/Candle', + '../component/axis', + '../component/grid', + '../component/dataZoom', + '../config', + '../util/ecData', + 'zrender/tool/util', + '../chart' +], function (require) { + var ChartBase = require('./base'); + var CandleShape = require('../util/shape/Candle'); + require('../component/axis'); + require('../component/grid'); + require('../component/dataZoom'); + var ecConfig = require('../config'); + ecConfig.k = { + zlevel: 0, + z: 2, + clickable: true, + hoverable: true, + legendHoverLink: false, + xAxisIndex: 0, + yAxisIndex: 0, + itemStyle: { + normal: { + color: '#fff', + color0: '#00aa11', + lineStyle: { + width: 1, + color: '#ff3200', + color0: '#00aa11' + } + }, + emphasis: {} + } + }; + var ecData = require('../util/ecData'); + var zrUtil = require('zrender/tool/util'); + function K(ecTheme, messageCenter, zr, option, myChart) { + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); + this.refresh(option); + } + K.prototype = { + type: ecConfig.CHART_TYPE_K, + _buildShape: function () { + var series = this.series; + this.selectedMap = {}; + var _position2sIndexMap = { + top: [], + bottom: [] + }; + var xAxis; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type === ecConfig.CHART_TYPE_K) { + series[i] = this.reformOption(series[i]); + this.legendHoverLink = series[i].legendHoverLink || this.legendHoverLink; + xAxis = this.component.xAxis.getAxis(series[i].xAxisIndex); + if (xAxis.type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY) { + _position2sIndexMap[xAxis.getPosition()].push(i); + } + } + } + for (var position in _position2sIndexMap) { + if (_position2sIndexMap[position].length > 0) { + this._buildSinglePosition(position, _position2sIndexMap[position]); + } + } + this.addShapeList(); + }, + _buildSinglePosition: function (position, seriesArray) { + var mapData = this._mapData(seriesArray); + var locationMap = mapData.locationMap; + var maxDataLength = mapData.maxDataLength; + if (maxDataLength === 0 || locationMap.length === 0) { + return; + } + this._buildHorizontal(seriesArray, maxDataLength, locationMap); + for (var i = 0, l = seriesArray.length; i < l; i++) { + this.buildMark(seriesArray[i]); + } + }, + _mapData: function (seriesArray) { + var series = this.series; + var serie; + var serieName; + var legend = this.component.legend; + var locationMap = []; + var maxDataLength = 0; + for (var i = 0, l = seriesArray.length; i < l; i++) { + serie = series[seriesArray[i]]; + serieName = serie.name; + this.selectedMap[serieName] = legend ? legend.isSelected(serieName) : true; + if (this.selectedMap[serieName]) { + locationMap.push(seriesArray[i]); + } + maxDataLength = Math.max(maxDataLength, serie.data.length); + } + return { + locationMap: locationMap, + maxDataLength: maxDataLength + }; + }, + _buildHorizontal: function (seriesArray, maxDataLength, locationMap) { + var series = this.series; + var seriesIndex; + var serie; + var xAxisIndex; + var categoryAxis; + var yAxisIndex; + var valueAxis; + var pointList = {}; + var candleWidth; + var data; + var value; + var barMaxWidth; + for (var j = 0, k = locationMap.length; j < k; j++) { + seriesIndex = locationMap[j]; + serie = series[seriesIndex]; + xAxisIndex = serie.xAxisIndex || 0; + categoryAxis = this.component.xAxis.getAxis(xAxisIndex); + candleWidth = serie.barWidth || Math.floor(categoryAxis.getGap() / 2); + barMaxWidth = serie.barMaxWidth; + if (barMaxWidth && barMaxWidth < candleWidth) { + candleWidth = barMaxWidth; + } + yAxisIndex = serie.yAxisIndex || 0; + valueAxis = this.component.yAxis.getAxis(yAxisIndex); + pointList[seriesIndex] = []; + for (var i = 0, l = maxDataLength; i < l; i++) { + if (categoryAxis.getNameByIndex(i) == null) { + break; + } + data = serie.data[i]; + value = this.getDataFromOption(data, '-'); + if (value === '-' || value.length != 4) { + continue; + } + pointList[seriesIndex].push([ + categoryAxis.getCoordByIndex(i), + candleWidth, + valueAxis.getCoord(value[0]), + valueAxis.getCoord(value[1]), + valueAxis.getCoord(value[2]), + valueAxis.getCoord(value[3]), + i, + categoryAxis.getNameByIndex(i) + ]); + } + } + this._buildKLine(seriesArray, pointList); + }, + _buildKLine: function (seriesArray, pointList) { + var series = this.series; + var nLineWidth; + var nLineColor; + var nLineColor0; + var nColor; + var nColor0; + var eLineWidth; + var eLineColor; + var eLineColor0; + var eColor; + var eColor0; + var serie; + var queryTarget; + var data; + var seriesPL; + var singlePoint; + var candleType; + var seriesIndex; + for (var sIdx = 0, len = seriesArray.length; sIdx < len; sIdx++) { + seriesIndex = seriesArray[sIdx]; + serie = series[seriesIndex]; + seriesPL = pointList[seriesIndex]; + if (this._isLarge(seriesPL)) { + seriesPL = this._getLargePointList(seriesPL); + } + if (serie.type === ecConfig.CHART_TYPE_K && seriesPL != null) { + queryTarget = serie; + nLineWidth = this.query(queryTarget, 'itemStyle.normal.lineStyle.width'); + nLineColor = this.query(queryTarget, 'itemStyle.normal.lineStyle.color'); + nLineColor0 = this.query(queryTarget, 'itemStyle.normal.lineStyle.color0'); + nColor = this.query(queryTarget, 'itemStyle.normal.color'); + nColor0 = this.query(queryTarget, 'itemStyle.normal.color0'); + eLineWidth = this.query(queryTarget, 'itemStyle.emphasis.lineStyle.width'); + eLineColor = this.query(queryTarget, 'itemStyle.emphasis.lineStyle.color'); + eLineColor0 = this.query(queryTarget, 'itemStyle.emphasis.lineStyle.color0'); + eColor = this.query(queryTarget, 'itemStyle.emphasis.color'); + eColor0 = this.query(queryTarget, 'itemStyle.emphasis.color0'); + for (var i = 0, l = seriesPL.length; i < l; i++) { + singlePoint = seriesPL[i]; + data = serie.data[singlePoint[6]]; + queryTarget = data; + candleType = singlePoint[3] < singlePoint[2]; + this.shapeList.push(this._getCandle(seriesIndex, singlePoint[6], singlePoint[7], singlePoint[0], singlePoint[1], singlePoint[2], singlePoint[3], singlePoint[4], singlePoint[5], candleType ? this.query(queryTarget, 'itemStyle.normal.color') || nColor : this.query(queryTarget, 'itemStyle.normal.color0') || nColor0, this.query(queryTarget, 'itemStyle.normal.lineStyle.width') || nLineWidth, candleType ? this.query(queryTarget, 'itemStyle.normal.lineStyle.color') || nLineColor : this.query(queryTarget, 'itemStyle.normal.lineStyle.color0') || nLineColor0, candleType ? this.query(queryTarget, 'itemStyle.emphasis.color') || eColor || nColor : this.query(queryTarget, 'itemStyle.emphasis.color0') || eColor0 || nColor0, this.query(queryTarget, 'itemStyle.emphasis.lineStyle.width') || eLineWidth || nLineWidth, candleType ? this.query(queryTarget, 'itemStyle.emphasis.lineStyle.color') || eLineColor || nLineColor : this.query(queryTarget, 'itemStyle.emphasis.lineStyle.color0') || eLineColor0 || nLineColor0)); + } + } + } + }, + _isLarge: function (singlePL) { + return singlePL[0][1] < 0.5; + }, + _getLargePointList: function (singlePL) { + var total = this.component.grid.getWidth(); + var len = singlePL.length; + var newList = []; + for (var i = 0; i < total; i++) { + newList[i] = singlePL[Math.floor(len / total * i)]; + } + return newList; + }, + _getCandle: function (seriesIndex, dataIndex, name, x, width, y0, y1, y2, y3, nColor, nLinewidth, nLineColor, eColor, eLinewidth, eLineColor) { + var series = this.series; + var itemShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + clickable: this.deepQuery([ + series[seriesIndex].data[dataIndex], + series[seriesIndex] + ], 'clickable'), + hoverable: this.deepQuery([ + series[seriesIndex].data[dataIndex], + series[seriesIndex] + ], 'hoverable'), + style: { + x: x, + y: [ + y0, + y1, + y2, + y3 + ], + width: width, + color: nColor, + strokeColor: nLineColor, + lineWidth: nLinewidth, + brushType: 'both' + }, + highlightStyle: { + color: eColor, + strokeColor: eLineColor, + lineWidth: eLinewidth + }, + _seriesIndex: seriesIndex + }; + ecData.pack(itemShape, series[seriesIndex], seriesIndex, series[seriesIndex].data[dataIndex], dataIndex, name); + itemShape = new CandleShape(itemShape); + return itemShape; + }, + getMarkCoord: function (seriesIndex, mpData) { + var serie = this.series[seriesIndex]; + var xAxis = this.component.xAxis.getAxis(serie.xAxisIndex); + var yAxis = this.component.yAxis.getAxis(serie.yAxisIndex); + return [ + typeof mpData.xAxis != 'string' && xAxis.getCoordByIndex ? xAxis.getCoordByIndex(mpData.xAxis || 0) : xAxis.getCoord(mpData.xAxis || 0), + typeof mpData.yAxis != 'string' && yAxis.getCoordByIndex ? yAxis.getCoordByIndex(mpData.yAxis || 0) : yAxis.getCoord(mpData.yAxis || 0) + ]; + }, + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + this.backupShapeList(); + this._buildShape(); + }, + addDataAnimation: function (params) { + var series = this.series; + var aniMap = {}; + for (var i = 0, l = params.length; i < l; i++) { + aniMap[params[i][0]] = params[i]; + } + var x; + var dx; + var y; + var serie; + var seriesIndex; + var dataIndex; + for (var i = 0, l = this.shapeList.length; i < l; i++) { + seriesIndex = this.shapeList[i]._seriesIndex; + if (aniMap[seriesIndex] && !aniMap[seriesIndex][3]) { + if (this.shapeList[i].type === 'candle') { + dataIndex = ecData.get(this.shapeList[i], 'dataIndex'); + serie = series[seriesIndex]; + if (aniMap[seriesIndex][2] && dataIndex === serie.data.length - 1) { + this.zr.delShape(this.shapeList[i].id); + continue; + } else if (!aniMap[seriesIndex][2] && dataIndex === 0) { + this.zr.delShape(this.shapeList[i].id); + continue; + } + dx = this.component.xAxis.getAxis(serie.xAxisIndex || 0).getGap(); + x = aniMap[seriesIndex][2] ? dx : -dx; + y = 0; + this.zr.animate(this.shapeList[i].id, '').when(this.query(this.option, 'animationDurationUpdate'), { + position: [ + x, + y + ] + }).start(); + } + } + } + } + }; + zrUtil.inherits(K, ChartBase); + require('../chart').define('k', K); + return K; +}); \ No newline at end of file diff --git a/build/source/chart/line.js b/build/source/chart/line.js new file mode 100644 index 0000000..742fe2f --- /dev/null +++ b/build/source/chart/line.js @@ -0,0 +1,747 @@ +define('echarts/chart/line', [ + 'require', + './base', + 'zrender/shape/Polyline', + '../util/shape/Icon', + '../util/shape/HalfSmoothPolygon', + '../component/axis', + '../component/grid', + '../component/dataZoom', + '../config', + '../util/ecData', + 'zrender/tool/util', + 'zrender/tool/color', + '../chart' +], function (require) { + var ChartBase = require('./base'); + var PolylineShape = require('zrender/shape/Polyline'); + var IconShape = require('../util/shape/Icon'); + var HalfSmoothPolygonShape = require('../util/shape/HalfSmoothPolygon'); + require('../component/axis'); + require('../component/grid'); + require('../component/dataZoom'); + var ecConfig = require('../config'); + ecConfig.line = { + zlevel: 0, + z: 2, + clickable: true, + legendHoverLink: true, + xAxisIndex: 0, + yAxisIndex: 0, + itemStyle: { + normal: { + label: { show: false }, + lineStyle: { + width: 2, + type: 'solid', + shadowColor: 'rgba(0,0,0,0)', + shadowBlur: 0, + shadowOffsetX: 0, + shadowOffsetY: 0 + } + }, + emphasis: { label: { show: false } } + }, + symbolSize: 2, + showAllSymbol: false + }; + var ecData = require('../util/ecData'); + var zrUtil = require('zrender/tool/util'); + var zrColor = require('zrender/tool/color'); + function Line(ecTheme, messageCenter, zr, option, myChart) { + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); + this.refresh(option); + } + Line.prototype = { + type: ecConfig.CHART_TYPE_LINE, + _buildShape: function () { + this.finalPLMap = {}; + this._buildPosition(); + }, + _buildHorizontal: function (seriesArray, maxDataLength, locationMap, xMarkMap) { + var series = this.series; + var seriesIndex = locationMap[0][0]; + var serie = series[seriesIndex]; + var categoryAxis = this.component.xAxis.getAxis(serie.xAxisIndex || 0); + var valueAxis; + var x; + var y; + var lastYP; + var baseYP; + var lastYN; + var baseYN; + var curPLMap = {}; + var data; + var value; + for (var i = 0, l = maxDataLength; i < l; i++) { + if (categoryAxis.getNameByIndex(i) == null) { + break; + } + x = categoryAxis.getCoordByIndex(i); + for (var j = 0, k = locationMap.length; j < k; j++) { + valueAxis = this.component.yAxis.getAxis(series[locationMap[j][0]].yAxisIndex || 0); + baseYP = lastYP = baseYN = lastYN = valueAxis.getCoord(0); + for (var m = 0, n = locationMap[j].length; m < n; m++) { + seriesIndex = locationMap[j][m]; + serie = series[seriesIndex]; + data = serie.data[i]; + value = this.getDataFromOption(data, '-'); + curPLMap[seriesIndex] = curPLMap[seriesIndex] || []; + xMarkMap[seriesIndex] = xMarkMap[seriesIndex] || { + min: Number.POSITIVE_INFINITY, + max: Number.NEGATIVE_INFINITY, + sum: 0, + counter: 0, + average: 0 + }; + if (value === '-') { + if (curPLMap[seriesIndex].length > 0) { + this.finalPLMap[seriesIndex] = this.finalPLMap[seriesIndex] || []; + this.finalPLMap[seriesIndex].push(curPLMap[seriesIndex]); + curPLMap[seriesIndex] = []; + } + continue; + } + if (value >= 0) { + lastYP -= m > 0 ? valueAxis.getCoordSize(value) : baseYP - valueAxis.getCoord(value); + y = lastYP; + } else if (value < 0) { + lastYN += m > 0 ? valueAxis.getCoordSize(value) : valueAxis.getCoord(value) - baseYN; + y = lastYN; + } + curPLMap[seriesIndex].push([ + x, + y, + i, + categoryAxis.getNameByIndex(i), + x, + baseYP + ]); + if (xMarkMap[seriesIndex].min > value) { + xMarkMap[seriesIndex].min = value; + xMarkMap[seriesIndex].minY = y; + xMarkMap[seriesIndex].minX = x; + } + if (xMarkMap[seriesIndex].max < value) { + xMarkMap[seriesIndex].max = value; + xMarkMap[seriesIndex].maxY = y; + xMarkMap[seriesIndex].maxX = x; + } + xMarkMap[seriesIndex].sum += value; + xMarkMap[seriesIndex].counter++; + } + } + lastYP = this.component.grid.getY(); + var symbolSize; + for (var j = 0, k = locationMap.length; j < k; j++) { + for (var m = 0, n = locationMap[j].length; m < n; m++) { + seriesIndex = locationMap[j][m]; + serie = series[seriesIndex]; + data = serie.data[i]; + value = this.getDataFromOption(data, '-'); + if (value != '-') { + continue; + } + if (this.deepQuery([ + data, + serie, + this.option + ], 'calculable')) { + symbolSize = this.deepQuery([ + data, + serie + ], 'symbolSize'); + lastYP += symbolSize * 2 + 5; + y = lastYP; + this.shapeList.push(this._getCalculableItem(seriesIndex, i, categoryAxis.getNameByIndex(i), x, y, 'horizontal')); + } + } + } + } + for (var sId in curPLMap) { + if (curPLMap[sId].length > 0) { + this.finalPLMap[sId] = this.finalPLMap[sId] || []; + this.finalPLMap[sId].push(curPLMap[sId]); + curPLMap[sId] = []; + } + } + this._calculMarkMapXY(xMarkMap, locationMap, 'y'); + this._buildBorkenLine(seriesArray, this.finalPLMap, categoryAxis, 'horizontal'); + }, + _buildVertical: function (seriesArray, maxDataLength, locationMap, xMarkMap) { + var series = this.series; + var seriesIndex = locationMap[0][0]; + var serie = series[seriesIndex]; + var categoryAxis = this.component.yAxis.getAxis(serie.yAxisIndex || 0); + var valueAxis; + var x; + var y; + var lastXP; + var baseXP; + var lastXN; + var baseXN; + var curPLMap = {}; + var data; + var value; + for (var i = 0, l = maxDataLength; i < l; i++) { + if (categoryAxis.getNameByIndex(i) == null) { + break; + } + y = categoryAxis.getCoordByIndex(i); + for (var j = 0, k = locationMap.length; j < k; j++) { + valueAxis = this.component.xAxis.getAxis(series[locationMap[j][0]].xAxisIndex || 0); + baseXP = lastXP = baseXN = lastXN = valueAxis.getCoord(0); + for (var m = 0, n = locationMap[j].length; m < n; m++) { + seriesIndex = locationMap[j][m]; + serie = series[seriesIndex]; + data = serie.data[i]; + value = this.getDataFromOption(data, '-'); + curPLMap[seriesIndex] = curPLMap[seriesIndex] || []; + xMarkMap[seriesIndex] = xMarkMap[seriesIndex] || { + min: Number.POSITIVE_INFINITY, + max: Number.NEGATIVE_INFINITY, + sum: 0, + counter: 0, + average: 0 + }; + if (value === '-') { + if (curPLMap[seriesIndex].length > 0) { + this.finalPLMap[seriesIndex] = this.finalPLMap[seriesIndex] || []; + this.finalPLMap[seriesIndex].push(curPLMap[seriesIndex]); + curPLMap[seriesIndex] = []; + } + continue; + } + if (value >= 0) { + lastXP += m > 0 ? valueAxis.getCoordSize(value) : valueAxis.getCoord(value) - baseXP; + x = lastXP; + } else if (value < 0) { + lastXN -= m > 0 ? valueAxis.getCoordSize(value) : baseXN - valueAxis.getCoord(value); + x = lastXN; + } + curPLMap[seriesIndex].push([ + x, + y, + i, + categoryAxis.getNameByIndex(i), + baseXP, + y + ]); + if (xMarkMap[seriesIndex].min > value) { + xMarkMap[seriesIndex].min = value; + xMarkMap[seriesIndex].minX = x; + xMarkMap[seriesIndex].minY = y; + } + if (xMarkMap[seriesIndex].max < value) { + xMarkMap[seriesIndex].max = value; + xMarkMap[seriesIndex].maxX = x; + xMarkMap[seriesIndex].maxY = y; + } + xMarkMap[seriesIndex].sum += value; + xMarkMap[seriesIndex].counter++; + } + } + lastXP = this.component.grid.getXend(); + var symbolSize; + for (var j = 0, k = locationMap.length; j < k; j++) { + for (var m = 0, n = locationMap[j].length; m < n; m++) { + seriesIndex = locationMap[j][m]; + serie = series[seriesIndex]; + data = serie.data[i]; + value = this.getDataFromOption(data, '-'); + if (value != '-') { + continue; + } + if (this.deepQuery([ + data, + serie, + this.option + ], 'calculable')) { + symbolSize = this.deepQuery([ + data, + serie + ], 'symbolSize'); + lastXP -= symbolSize * 2 + 5; + x = lastXP; + this.shapeList.push(this._getCalculableItem(seriesIndex, i, categoryAxis.getNameByIndex(i), x, y, 'vertical')); + } + } + } + } + for (var sId in curPLMap) { + if (curPLMap[sId].length > 0) { + this.finalPLMap[sId] = this.finalPLMap[sId] || []; + this.finalPLMap[sId].push(curPLMap[sId]); + curPLMap[sId] = []; + } + } + this._calculMarkMapXY(xMarkMap, locationMap, 'x'); + this._buildBorkenLine(seriesArray, this.finalPLMap, categoryAxis, 'vertical'); + }, + _buildOther: function (seriesArray, maxDataLength, locationMap, xMarkMap) { + var series = this.series; + var curPLMap = {}; + var xAxis; + for (var j = 0, k = locationMap.length; j < k; j++) { + for (var m = 0, n = locationMap[j].length; m < n; m++) { + var seriesIndex = locationMap[j][m]; + var serie = series[seriesIndex]; + xAxis = this.component.xAxis.getAxis(serie.xAxisIndex || 0); + var yAxis = this.component.yAxis.getAxis(serie.yAxisIndex || 0); + var baseY = yAxis.getCoord(0); + curPLMap[seriesIndex] = curPLMap[seriesIndex] || []; + xMarkMap[seriesIndex] = xMarkMap[seriesIndex] || { + min0: Number.POSITIVE_INFINITY, + min1: Number.POSITIVE_INFINITY, + max0: Number.NEGATIVE_INFINITY, + max1: Number.NEGATIVE_INFINITY, + sum0: 0, + sum1: 0, + counter0: 0, + counter1: 0, + average0: 0, + average1: 0 + }; + for (var i = 0, l = serie.data.length; i < l; i++) { + var data = serie.data[i]; + var value = this.getDataFromOption(data, '-'); + if (!(value instanceof Array)) { + continue; + } + var x = xAxis.getCoord(value[0]); + var y = yAxis.getCoord(value[1]); + curPLMap[seriesIndex].push([ + x, + y, + i, + value[0], + x, + baseY + ]); + if (xMarkMap[seriesIndex].min0 > value[0]) { + xMarkMap[seriesIndex].min0 = value[0]; + xMarkMap[seriesIndex].minY0 = y; + xMarkMap[seriesIndex].minX0 = x; + } + if (xMarkMap[seriesIndex].max0 < value[0]) { + xMarkMap[seriesIndex].max0 = value[0]; + xMarkMap[seriesIndex].maxY0 = y; + xMarkMap[seriesIndex].maxX0 = x; + } + xMarkMap[seriesIndex].sum0 += value[0]; + xMarkMap[seriesIndex].counter0++; + if (xMarkMap[seriesIndex].min1 > value[1]) { + xMarkMap[seriesIndex].min1 = value[1]; + xMarkMap[seriesIndex].minY1 = y; + xMarkMap[seriesIndex].minX1 = x; + } + if (xMarkMap[seriesIndex].max1 < value[1]) { + xMarkMap[seriesIndex].max1 = value[1]; + xMarkMap[seriesIndex].maxY1 = y; + xMarkMap[seriesIndex].maxX1 = x; + } + xMarkMap[seriesIndex].sum1 += value[1]; + xMarkMap[seriesIndex].counter1++; + } + } + } + for (var sId in curPLMap) { + if (curPLMap[sId].length > 0) { + this.finalPLMap[sId] = this.finalPLMap[sId] || []; + this.finalPLMap[sId].push(curPLMap[sId]); + curPLMap[sId] = []; + } + } + this._calculMarkMapXY(xMarkMap, locationMap, 'xy'); + this._buildBorkenLine(seriesArray, this.finalPLMap, xAxis, 'other'); + }, + _buildBorkenLine: function (seriesArray, pointList, categoryAxis, curOrient) { + var orient = curOrient == 'other' ? 'horizontal' : curOrient; + var series = this.series; + var data; + for (var sIdx = seriesArray.length - 1; sIdx >= 0; sIdx--) { + var seriesIndex = seriesArray[sIdx]; + var serie = series[seriesIndex]; + var seriesPL = pointList[seriesIndex]; + if (serie.type === this.type && seriesPL != null) { + var bbox = this._getBbox(seriesIndex, orient); + var defaultColor = this._sIndex2ColorMap[seriesIndex]; + var lineWidth = this.query(serie, 'itemStyle.normal.lineStyle.width'); + var lineType = this.query(serie, 'itemStyle.normal.lineStyle.type'); + var lineColor = this.query(serie, 'itemStyle.normal.lineStyle.color'); + var normalColor = this.getItemStyleColor(this.query(serie, 'itemStyle.normal.color'), seriesIndex, -1); + var isFill = this.query(serie, 'itemStyle.normal.areaStyle') != null; + var fillNormalColor = this.query(serie, 'itemStyle.normal.areaStyle.color'); + for (var i = 0, l = seriesPL.length; i < l; i++) { + var singlePL = seriesPL[i]; + var isLarge = curOrient != 'other' && this._isLarge(orient, singlePL); + if (!isLarge) { + for (var j = 0, k = singlePL.length; j < k; j++) { + data = serie.data[singlePL[j][2]]; + if (this.deepQuery([ + data, + serie, + this.option + ], 'calculable') || this.deepQuery([ + data, + serie + ], 'showAllSymbol') || categoryAxis.type === 'categoryAxis' && categoryAxis.isMainAxis(singlePL[j][2]) && this.deepQuery([ + data, + serie + ], 'symbol') != 'none') { + this.shapeList.push(this._getSymbol(seriesIndex, singlePL[j][2], singlePL[j][3], singlePL[j][0], singlePL[j][1], orient)); + } + } + } else { + singlePL = this._getLargePointList(orient, singlePL); + } + var polylineShape = new PolylineShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + miterLimit: lineWidth, + pointList: singlePL, + strokeColor: lineColor || normalColor || defaultColor, + lineWidth: lineWidth, + lineType: lineType, + smooth: this._getSmooth(serie.smooth), + smoothConstraint: bbox, + shadowColor: this.query(serie, 'itemStyle.normal.lineStyle.shadowColor'), + shadowBlur: this.query(serie, 'itemStyle.normal.lineStyle.shadowBlur'), + shadowOffsetX: this.query(serie, 'itemStyle.normal.lineStyle.shadowOffsetX'), + shadowOffsetY: this.query(serie, 'itemStyle.normal.lineStyle.shadowOffsetY') + }, + hoverable: false, + _main: true, + _seriesIndex: seriesIndex, + _orient: orient + }); + ecData.pack(polylineShape, series[seriesIndex], seriesIndex, 0, i, series[seriesIndex].name); + this.shapeList.push(polylineShape); + if (isFill) { + var halfSmoothPolygonShape = new HalfSmoothPolygonShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + miterLimit: lineWidth, + pointList: zrUtil.clone(singlePL).concat([ + [ + singlePL[singlePL.length - 1][4], + singlePL[singlePL.length - 1][5] + ], + [ + singlePL[0][4], + singlePL[0][5] + ] + ]), + brushType: 'fill', + smooth: this._getSmooth(serie.smooth), + smoothConstraint: bbox, + color: fillNormalColor ? fillNormalColor : zrColor.alpha(defaultColor, 0.5) + }, + highlightStyle: { brushType: 'fill' }, + hoverable: false, + _main: true, + _seriesIndex: seriesIndex, + _orient: orient + }); + ecData.pack(halfSmoothPolygonShape, series[seriesIndex], seriesIndex, 0, i, series[seriesIndex].name); + this.shapeList.push(halfSmoothPolygonShape); + } + } + } + } + }, + _getBbox: function (seriesIndex, orient) { + var bbox = this.component.grid.getBbox(); + var xMarkMap = this.xMarkMap[seriesIndex]; + if (xMarkMap.minX0 != null) { + return [ + [ + Math.min(xMarkMap.minX0, xMarkMap.maxX0, xMarkMap.minX1, xMarkMap.maxX1), + Math.min(xMarkMap.minY0, xMarkMap.maxY0, xMarkMap.minY1, xMarkMap.maxY1) + ], + [ + Math.max(xMarkMap.minX0, xMarkMap.maxX0, xMarkMap.minX1, xMarkMap.maxX1), + Math.max(xMarkMap.minY0, xMarkMap.maxY0, xMarkMap.minY1, xMarkMap.maxY1) + ] + ]; + } else if (orient === 'horizontal') { + bbox[0][1] = Math.min(xMarkMap.minY, xMarkMap.maxY); + bbox[1][1] = Math.max(xMarkMap.minY, xMarkMap.maxY); + } else { + bbox[0][0] = Math.min(xMarkMap.minX, xMarkMap.maxX); + bbox[1][0] = Math.max(xMarkMap.minX, xMarkMap.maxX); + } + return bbox; + }, + _isLarge: function (orient, singlePL) { + if (singlePL.length < 2) { + return false; + } else { + return orient === 'horizontal' ? Math.abs(singlePL[0][0] - singlePL[1][0]) < 0.5 : Math.abs(singlePL[0][1] - singlePL[1][1]) < 0.5; + } + }, + _getLargePointList: function (orient, singlePL) { + var total; + if (orient === 'horizontal') { + total = this.component.grid.getWidth(); + } else { + total = this.component.grid.getHeight(); + } + var len = singlePL.length; + var newList = []; + for (var i = 0; i < total; i++) { + newList[i] = singlePL[Math.floor(len / total * i)]; + } + return newList; + }, + _getSmooth: function (isSmooth) { + if (isSmooth) { + return 0.3; + } else { + return 0; + } + }, + _getCalculableItem: function (seriesIndex, dataIndex, name, x, y, orient) { + var series = this.series; + var color = series[seriesIndex].calculableHolderColor || this.ecTheme.calculableHolderColor || ecConfig.calculableHolderColor; + var itemShape = this._getSymbol(seriesIndex, dataIndex, name, x, y, orient); + itemShape.style.color = color; + itemShape.style.strokeColor = color; + itemShape.rotation = [ + 0, + 0 + ]; + itemShape.hoverable = false; + itemShape.draggable = false; + itemShape.style.text = undefined; + return itemShape; + }, + _getSymbol: function (seriesIndex, dataIndex, name, x, y, orient) { + var series = this.series; + var serie = series[seriesIndex]; + var data = serie.data[dataIndex]; + var itemShape = this.getSymbolShape(serie, seriesIndex, data, dataIndex, name, x, y, this._sIndex2ShapeMap[seriesIndex], this._sIndex2ColorMap[seriesIndex], '#fff', orient === 'vertical' ? 'horizontal' : 'vertical'); + itemShape.zlevel = this.getZlevelBase(); + itemShape.z = this.getZBase() + 1; + if (this.deepQuery([ + data, + serie, + this.option + ], 'calculable')) { + this.setCalculable(itemShape); + itemShape.draggable = true; + } + return itemShape; + }, + getMarkCoord: function (seriesIndex, mpData) { + var serie = this.series[seriesIndex]; + var xMarkMap = this.xMarkMap[seriesIndex]; + var xAxis = this.component.xAxis.getAxis(serie.xAxisIndex); + var yAxis = this.component.yAxis.getAxis(serie.yAxisIndex); + if (mpData.type && (mpData.type === 'max' || mpData.type === 'min' || mpData.type === 'average')) { + var valueIndex = mpData.valueIndex != null ? mpData.valueIndex : xMarkMap.maxX0 != null ? '1' : ''; + return [ + xMarkMap[mpData.type + 'X' + valueIndex], + xMarkMap[mpData.type + 'Y' + valueIndex], + xMarkMap[mpData.type + 'Line' + valueIndex], + xMarkMap[mpData.type + valueIndex] + ]; + } + return [ + typeof mpData.xAxis != 'string' && xAxis.getCoordByIndex ? xAxis.getCoordByIndex(mpData.xAxis || 0) : xAxis.getCoord(mpData.xAxis || 0), + typeof mpData.yAxis != 'string' && yAxis.getCoordByIndex ? yAxis.getCoordByIndex(mpData.yAxis || 0) : yAxis.getCoord(mpData.yAxis || 0) + ]; + }, + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + this.backupShapeList(); + this._buildShape(); + }, + ontooltipHover: function (param, tipShape) { + var seriesIndex = param.seriesIndex; + var dataIndex = param.dataIndex; + var seriesPL; + var singlePL; + var len = seriesIndex.length; + while (len--) { + seriesPL = this.finalPLMap[seriesIndex[len]]; + if (seriesPL) { + for (var i = 0, l = seriesPL.length; i < l; i++) { + singlePL = seriesPL[i]; + for (var j = 0, k = singlePL.length; j < k; j++) { + if (dataIndex === singlePL[j][2]) { + tipShape.push(this._getSymbol(seriesIndex[len], singlePL[j][2], singlePL[j][3], singlePL[j][0], singlePL[j][1], 'horizontal')); + } + } + } + } + } + }, + addDataAnimation: function (params) { + var series = this.series; + var aniMap = {}; + for (var i = 0, l = params.length; i < l; i++) { + aniMap[params[i][0]] = params[i]; + } + var x; + var dx; + var y; + var dy; + var seriesIndex; + var pointList; + var isHorizontal; + for (var i = this.shapeList.length - 1; i >= 0; i--) { + seriesIndex = this.shapeList[i]._seriesIndex; + if (aniMap[seriesIndex] && !aniMap[seriesIndex][3]) { + if (this.shapeList[i]._main && this.shapeList[i].style.pointList.length > 1) { + pointList = this.shapeList[i].style.pointList; + dx = Math.abs(pointList[0][0] - pointList[1][0]); + dy = Math.abs(pointList[0][1] - pointList[1][1]); + isHorizontal = this.shapeList[i]._orient === 'horizontal'; + if (aniMap[seriesIndex][2]) { + if (this.shapeList[i].type === 'half-smooth-polygon') { + var len = pointList.length; + this.shapeList[i].style.pointList[len - 3] = pointList[len - 2]; + this.shapeList[i].style.pointList[len - 3][isHorizontal ? 0 : 1] = pointList[len - 4][isHorizontal ? 0 : 1]; + this.shapeList[i].style.pointList[len - 2] = pointList[len - 1]; + } + this.shapeList[i].style.pointList.pop(); + isHorizontal ? (x = dx, y = 0) : (x = 0, y = -dy); + } else { + this.shapeList[i].style.pointList.shift(); + if (this.shapeList[i].type === 'half-smooth-polygon') { + var targetPoint = this.shapeList[i].style.pointList.pop(); + isHorizontal ? targetPoint[0] = pointList[0][0] : targetPoint[1] = pointList[0][1]; + this.shapeList[i].style.pointList.push(targetPoint); + } + isHorizontal ? (x = -dx, y = 0) : (x = 0, y = dy); + } + this.zr.modShape(this.shapeList[i].id, { style: { pointList: this.shapeList[i].style.pointList } }, true); + } else { + if (aniMap[seriesIndex][2] && this.shapeList[i]._dataIndex === series[seriesIndex].data.length - 1) { + this.zr.delShape(this.shapeList[i].id); + continue; + } else if (!aniMap[seriesIndex][2] && this.shapeList[i]._dataIndex === 0) { + this.zr.delShape(this.shapeList[i].id); + continue; + } + } + this.shapeList[i].position = [ + 0, + 0 + ]; + this.zr.animate(this.shapeList[i].id, '').when(this.query(this.option, 'animationDurationUpdate'), { + position: [ + x, + y + ] + }).start(); + } + } + } + }; + function legendLineIcon(ctx, style, refreshNextFrame) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + var dy = height / 2; + if (style.symbol.match('empty')) { + ctx.fillStyle = '#fff'; + } + style.brushType = 'both'; + var symbol = style.symbol.replace('empty', '').toLowerCase(); + if (symbol.match('star')) { + dy = symbol.replace('star', '') - 0 || 5; + y -= 1; + symbol = 'star'; + } else if (symbol === 'rectangle' || symbol === 'arrow') { + x += (width - height) / 2; + width = height; + } + var imageLocation = ''; + if (symbol.match('image')) { + imageLocation = symbol.replace(new RegExp('^image:\\/\\/'), ''); + symbol = 'image'; + x += Math.round((width - height) / 2) - 1; + width = height = height + 2; + } + symbol = IconShape.prototype.iconLibrary[symbol]; + if (symbol) { + var x2 = style.x; + var y2 = style.y; + ctx.moveTo(x2, y2 + dy); + ctx.lineTo(x2 + 5, y2 + dy); + ctx.moveTo(x2 + style.width - 5, y2 + dy); + ctx.lineTo(x2 + style.width, y2 + dy); + var self = this; + symbol(ctx, { + x: x + 4, + y: y + 4, + width: width - 8, + height: height - 8, + n: dy, + image: imageLocation + }, function () { + self.modSelf(); + refreshNextFrame(); + }); + } else { + ctx.moveTo(x, y + dy); + ctx.lineTo(x + width, y + dy); + } + } + IconShape.prototype.iconLibrary['legendLineIcon'] = legendLineIcon; + zrUtil.inherits(Line, ChartBase); + require('../chart').define('line', Line); + return Line; +});define('echarts/util/shape/HalfSmoothPolygon', [ + 'require', + 'zrender/shape/Base', + 'zrender/shape/util/smoothBezier', + 'zrender/tool/util', + 'zrender/shape/Polygon' +], function (require) { + var Base = require('zrender/shape/Base'); + var smoothBezier = require('zrender/shape/util/smoothBezier'); + var zrUtil = require('zrender/tool/util'); + function HalfSmoothPolygon(options) { + Base.call(this, options); + } + HalfSmoothPolygon.prototype = { + type: 'half-smooth-polygon', + buildPath: function (ctx, style) { + var pointList = style.pointList; + if (pointList.length < 2) { + return; + } + if (style.smooth) { + var controlPoints = smoothBezier(pointList.slice(0, -2), style.smooth, false, style.smoothConstraint); + ctx.moveTo(pointList[0][0], pointList[0][1]); + var cp1; + var cp2; + var p; + var l = pointList.length; + for (var i = 0; i < l - 3; i++) { + cp1 = controlPoints[i * 2]; + cp2 = controlPoints[i * 2 + 1]; + p = pointList[i + 1]; + ctx.bezierCurveTo(cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]); + } + ctx.lineTo(pointList[l - 2][0], pointList[l - 2][1]); + ctx.lineTo(pointList[l - 1][0], pointList[l - 1][1]); + ctx.lineTo(pointList[0][0], pointList[0][1]); + } else { + require('zrender/shape/Polygon').prototype.buildPath(ctx, style); + } + return; + } + }; + zrUtil.inherits(HalfSmoothPolygon, Base); + return HalfSmoothPolygon; +}); \ No newline at end of file diff --git a/build/source/chart/map.js b/build/source/chart/map.js new file mode 100644 index 0000000..d91fb2e --- /dev/null +++ b/build/source/chart/map.js @@ -0,0 +1,17502 @@ +define('echarts/chart/map', [ + 'require', + './base', + 'zrender/shape/Text', + 'zrender/shape/Path', + 'zrender/shape/Circle', + 'zrender/shape/Rectangle', + 'zrender/shape/Line', + 'zrender/shape/Polygon', + 'zrender/shape/Ellipse', + '../component/dataRange', + '../component/roamController', + '../config', + '../util/ecData', + 'zrender/tool/util', + 'zrender/config', + 'zrender/tool/event', + '../util/mapData/params', + '../util/mapData/textFixed', + '../util/mapData/geoCoord', + '../util/projection/svg', + '../util/projection/normal', + '../chart' +], function (require) { + var ChartBase = require('./base'); + var TextShape = require('zrender/shape/Text'); + var PathShape = require('zrender/shape/Path'); + var CircleShape = require('zrender/shape/Circle'); + var RectangleShape = require('zrender/shape/Rectangle'); + var LineShape = require('zrender/shape/Line'); + var PolygonShape = require('zrender/shape/Polygon'); + var EllipseShape = require('zrender/shape/Ellipse'); + require('../component/dataRange'); + require('../component/roamController'); + var ecConfig = require('../config'); + ecConfig.map = { + zlevel: 0, + z: 2, + mapType: 'china', + mapValuePrecision: 0, + showLegendSymbol: true, + dataRangeHoverLink: true, + hoverable: true, + clickable: true, + itemStyle: { + normal: { + borderColor: 'rgba(0,0,0,0)', + borderWidth: 1, + areaStyle: { color: '#ccc' }, + label: { + show: false, + textStyle: { color: 'rgb(139,69,19)' } + } + }, + emphasis: { + borderColor: 'rgba(0,0,0,0)', + borderWidth: 1, + areaStyle: { color: 'rgba(255,215,0,0.8)' }, + label: { + show: false, + textStyle: { color: 'rgb(100,0,0)' } + } + } + } + }; + var ecData = require('../util/ecData'); + var zrUtil = require('zrender/tool/util'); + var zrConfig = require('zrender/config'); + var zrEvent = require('zrender/tool/event'); + var _mapParams = require('../util/mapData/params').params; + var _textFixed = require('../util/mapData/textFixed'); + var _geoCoord = require('../util/mapData/geoCoord'); + function Map(ecTheme, messageCenter, zr, option, myChart) { + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); + var self = this; + self._onmousewheel = function (params) { + return self.__onmousewheel(params); + }; + self._onmousedown = function (params) { + return self.__onmousedown(params); + }; + self._onmousemove = function (params) { + return self.__onmousemove(params); + }; + self._onmouseup = function (params) { + return self.__onmouseup(params); + }; + self._onroamcontroller = function (params) { + return self.__onroamcontroller(params); + }; + self._ondrhoverlink = function (params) { + return self.__ondrhoverlink(params); + }; + this._isAlive = true; + this._selectedMode = {}; + this._activeMapType = {}; + this._clickable = {}; + this._hoverable = {}; + this._showLegendSymbol = {}; + this._selected = {}; + this._mapTypeMap = {}; + this._mapDataMap = {}; + this._nameMap = {}; + this._specialArea = {}; + this._refreshDelayTicket; + this._mapDataRequireCounter; + this._markAnimation = false; + this._hoverLinkMap = {}; + this._roamMap = {}; + this._scaleLimitMap = {}; + this._mx; + this._my; + this._mousedown; + this._justMove; + this._curMapType; + this.refresh(option); + this.zr.on(zrConfig.EVENT.MOUSEWHEEL, this._onmousewheel); + this.zr.on(zrConfig.EVENT.MOUSEDOWN, this._onmousedown); + messageCenter.bind(ecConfig.EVENT.ROAMCONTROLLER, this._onroamcontroller); + messageCenter.bind(ecConfig.EVENT.DATA_RANGE_HOVERLINK, this._ondrhoverlink); + } + Map.prototype = { + type: ecConfig.CHART_TYPE_MAP, + _buildShape: function () { + var series = this.series; + this.selectedMap = {}; + this._activeMapType = {}; + var legend = this.component.legend; + var seriesName; + var valueData = {}; + var mapType; + var data; + var name; + var mapSeries = {}; + var mapValuePrecision = {}; + var valueCalculation = {}; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type == ecConfig.CHART_TYPE_MAP) { + series[i] = this.reformOption(series[i]); + mapType = series[i].mapType; + mapSeries[mapType] = mapSeries[mapType] || {}; + mapSeries[mapType][i] = true; + mapValuePrecision[mapType] = mapValuePrecision[mapType] || series[i].mapValuePrecision; + this._scaleLimitMap[mapType] = this._scaleLimitMap[mapType] || {}; + series[i].scaleLimit && zrUtil.merge(this._scaleLimitMap[mapType], series[i].scaleLimit, true); + this._roamMap[mapType] = series[i].roam || this._roamMap[mapType]; + this._hoverLinkMap[mapType] = series[i].dataRangeHoverLink || this._hoverLinkMap[mapType]; + this._nameMap[mapType] = this._nameMap[mapType] || {}; + series[i].nameMap && zrUtil.merge(this._nameMap[mapType], series[i].nameMap, true); + this._activeMapType[mapType] = true; + if (series[i].textFixed) { + zrUtil.merge(_textFixed, series[i].textFixed, true); + } + if (series[i].geoCoord) { + zrUtil.merge(_geoCoord, series[i].geoCoord, true); + } + this._selectedMode[mapType] = this._selectedMode[mapType] || series[i].selectedMode; + if (this._hoverable[mapType] == null || this._hoverable[mapType]) { + this._hoverable[mapType] = series[i].hoverable; + } + if (this._clickable[mapType] == null || this._clickable[mapType]) { + this._clickable[mapType] = series[i].clickable; + } + if (this._showLegendSymbol[mapType] == null || this._showLegendSymbol[mapType]) { + this._showLegendSymbol[mapType] = series[i].showLegendSymbol; + } + valueCalculation[mapType] = valueCalculation[mapType] || series[i].mapValueCalculation; + seriesName = series[i].name; + this.selectedMap[seriesName] = legend ? legend.isSelected(seriesName) : true; + if (this.selectedMap[seriesName]) { + valueData[mapType] = valueData[mapType] || {}; + data = series[i].data; + for (var j = 0, k = data.length; j < k; j++) { + name = this._nameChange(mapType, data[j].name); + valueData[mapType][name] = valueData[mapType][name] || { seriesIndex: [] }; + for (var key in data[j]) { + if (key != 'value') { + valueData[mapType][name][key] = data[j][key]; + } else if (!isNaN(data[j].value)) { + valueData[mapType][name].value == null && (valueData[mapType][name].value = 0); + valueData[mapType][name].value += data[j].value; + } + } + valueData[mapType][name].seriesIndex.push(i); + } + } + } + } + this._mapDataRequireCounter = 0; + for (var mt in valueData) { + this._mapDataRequireCounter++; + } + this._clearSelected(); + if (this._mapDataRequireCounter === 0) { + this.clear(); + this.zr && this.zr.delShape(this.lastShapeList); + this.lastShapeList = []; + } + for (var mt in valueData) { + if (valueCalculation[mt] && valueCalculation[mt] == 'average') { + for (var k in valueData[mt]) { + valueData[mt][k].value = (valueData[mt][k].value / valueData[mt][k].seriesIndex.length).toFixed(mapValuePrecision[mt]) - 0; + } + } + this._mapDataMap[mt] = this._mapDataMap[mt] || {}; + if (this._mapDataMap[mt].mapData) { + this._mapDataCallback(mt, valueData[mt], mapSeries[mt])(this._mapDataMap[mt].mapData); + } else if (_mapParams[mt.replace(/\|.*/, '')].getGeoJson) { + this._specialArea[mt] = _mapParams[mt.replace(/\|.*/, '')].specialArea || this._specialArea[mt]; + _mapParams[mt.replace(/\|.*/, '')].getGeoJson(this._mapDataCallback(mt, valueData[mt], mapSeries[mt])); + } + } + }, + _mapDataCallback: function (mt, vd, ms) { + var self = this; + return function (md) { + if (!self._isAlive || self._activeMapType[mt] == null) { + return; + } + if (mt.indexOf('|') != -1) { + md = self._getSubMapData(mt, md); + } + self._mapDataMap[mt].mapData = md; + if (md.firstChild) { + self._mapDataMap[mt].rate = 1; + self._mapDataMap[mt].projection = require('../util/projection/svg'); + } else { + self._mapDataMap[mt].rate = 0.75; + self._mapDataMap[mt].projection = require('../util/projection/normal'); + } + self._buildMap(mt, self._getProjectionData(mt, md, ms), vd, ms); + self._buildMark(mt, ms); + if (--self._mapDataRequireCounter <= 0) { + self.addShapeList(); + self.zr.refreshNextFrame(); + } + }; + }, + _clearSelected: function () { + for (var k in this._selected) { + if (!this._activeMapType[this._mapTypeMap[k]]) { + delete this._selected[k]; + delete this._mapTypeMap[k]; + } + } + }, + _getSubMapData: function (mapType, mapData) { + var subType = mapType.replace(/^.*\|/, ''); + var features = mapData.features; + for (var i = 0, l = features.length; i < l; i++) { + if (features[i].properties && features[i].properties.name == subType) { + features = features[i]; + if (subType == 'United States of America' && features.geometry.coordinates.length > 1) { + features = { + geometry: { + coordinates: features.geometry.coordinates.slice(5, 6), + type: features.geometry.type + }, + id: features.id, + properties: features.properties, + type: features.type + }; + } + break; + } + } + return { + 'type': 'FeatureCollection', + 'features': [features] + }; + }, + _getProjectionData: function (mapType, mapData, mapSeries) { + var normalProjection = this._mapDataMap[mapType].projection; + var province = []; + var bbox = this._mapDataMap[mapType].bbox || normalProjection.getBbox(mapData, this._specialArea[mapType]); + var transform; + if (!this._mapDataMap[mapType].hasRoam) { + transform = this._getTransform(bbox, mapSeries, this._mapDataMap[mapType].rate); + } else { + transform = this._mapDataMap[mapType].transform; + } + var lastTransform = this._mapDataMap[mapType].lastTransform || { scale: {} }; + var pathArray; + if (transform.left != lastTransform.left || transform.top != lastTransform.top || transform.scale.x != lastTransform.scale.x || transform.scale.y != lastTransform.scale.y) { + pathArray = normalProjection.geoJson2Path(mapData, transform, this._specialArea[mapType]); + lastTransform = zrUtil.clone(transform); + } else { + transform = this._mapDataMap[mapType].transform; + pathArray = this._mapDataMap[mapType].pathArray; + } + this._mapDataMap[mapType].bbox = bbox; + this._mapDataMap[mapType].transform = transform; + this._mapDataMap[mapType].lastTransform = lastTransform; + this._mapDataMap[mapType].pathArray = pathArray; + var position = [ + transform.left, + transform.top + ]; + for (var i = 0, l = pathArray.length; i < l; i++) { + province.push(this._getSingleProvince(mapType, pathArray[i], position)); + } + if (this._specialArea[mapType]) { + for (var area in this._specialArea[mapType]) { + province.push(this._getSpecialProjectionData(mapType, mapData, area, this._specialArea[mapType][area], position)); + } + } + if (mapType == 'china') { + var leftTop = this.geo2pos(mapType, _geoCoord['南海诸岛'] || _mapParams['南海诸岛'].textCoord); + var scale = transform.scale.x / 10.5; + var textPosition = [ + 32 * scale + leftTop[0], + 83 * scale + leftTop[1] + ]; + if (_textFixed['南海诸岛']) { + textPosition[0] += _textFixed['南海诸岛'][0]; + textPosition[1] += _textFixed['南海诸岛'][1]; + } + province.push({ + name: this._nameChange(mapType, '南海诸岛'), + path: _mapParams['南海诸岛'].getPath(leftTop, scale), + position: position, + textX: textPosition[0], + textY: textPosition[1] + }); + } + return province; + }, + _getSpecialProjectionData: function (mapType, mapData, areaName, mapSize, position) { + mapData = this._getSubMapData('x|' + areaName, mapData); + var normalProjection = require('../util/projection/normal'); + var bbox = normalProjection.getBbox(mapData); + var leftTop = this.geo2pos(mapType, [ + mapSize.left, + mapSize.top + ]); + var rightBottom = this.geo2pos(mapType, [ + mapSize.left + mapSize.width, + mapSize.top + mapSize.height + ]); + var width = Math.abs(rightBottom[0] - leftTop[0]); + var height = Math.abs(rightBottom[1] - leftTop[1]); + var mapWidth = bbox.width; + var mapHeight = bbox.height; + var xScale = width / 0.75 / mapWidth; + var yScale = height / mapHeight; + if (xScale > yScale) { + xScale = yScale * 0.75; + width = mapWidth * xScale; + } else { + yScale = xScale; + xScale = yScale * 0.75; + height = mapHeight * yScale; + } + var transform = { + OffsetLeft: leftTop[0], + OffsetTop: leftTop[1], + scale: { + x: xScale, + y: yScale + } + }; + var pathArray = normalProjection.geoJson2Path(mapData, transform); + return this._getSingleProvince(mapType, pathArray[0], position); + }, + _getSingleProvince: function (mapType, path, position) { + var textPosition; + var name = path.properties.name; + var textFixed = _textFixed[name] || [ + 0, + 0 + ]; + if (_geoCoord[name]) { + textPosition = this.geo2pos(mapType, _geoCoord[name]); + } else if (path.cp) { + textPosition = [ + path.cp[0] + textFixed[0], + path.cp[1] + textFixed[1] + ]; + } else { + var bbox = this._mapDataMap[mapType].bbox; + textPosition = this.geo2pos(mapType, [ + bbox.left + bbox.width / 2, + bbox.top + bbox.height / 2 + ]); + textPosition[0] += textFixed[0]; + textPosition[1] += textFixed[1]; + } + path.name = this._nameChange(mapType, name); + path.position = position; + path.textX = textPosition[0]; + path.textY = textPosition[1]; + return path; + }, + _getTransform: function (bbox, mapSeries, rate) { + var series = this.series; + var mapLocation; + var x; + var cusX; + var y; + var cusY; + var width; + var height; + var zrWidth = this.zr.getWidth(); + var zrHeight = this.zr.getHeight(); + var padding = Math.round(Math.min(zrWidth, zrHeight) * 0.02); + for (var key in mapSeries) { + mapLocation = series[key].mapLocation || {}; + cusX = mapLocation.x || cusX; + cusY = mapLocation.y || cusY; + width = mapLocation.width || width; + height = mapLocation.height || height; + } + x = this.parsePercent(cusX, zrWidth); + x = isNaN(x) ? padding : x; + y = this.parsePercent(cusY, zrHeight); + y = isNaN(y) ? padding : y; + width = width == null ? zrWidth - x - 2 * padding : this.parsePercent(width, zrWidth); + height = height == null ? zrHeight - y - 2 * padding : this.parsePercent(height, zrHeight); + var mapWidth = bbox.width; + var mapHeight = bbox.height; + var xScale = width / rate / mapWidth; + var yScale = height / mapHeight; + if (xScale > yScale) { + xScale = yScale * rate; + width = mapWidth * xScale; + } else { + yScale = xScale; + xScale = yScale * rate; + height = mapHeight * yScale; + } + if (isNaN(cusX)) { + cusX = cusX || 'center'; + switch (cusX + '') { + case 'center': + x = Math.floor((zrWidth - width) / 2); + break; + case 'right': + x = zrWidth - width; + break; + } + } + if (isNaN(cusY)) { + cusY = cusY || 'center'; + switch (cusY + '') { + case 'center': + y = Math.floor((zrHeight - height) / 2); + break; + case 'bottom': + y = zrHeight - height; + break; + } + } + return { + left: x, + top: y, + width: width, + height: height, + baseScale: 1, + scale: { + x: xScale, + y: yScale + } + }; + }, + _buildMap: function (mapType, mapData, valueData, mapSeries) { + var series = this.series; + var legend = this.component.legend; + var dataRange = this.component.dataRange; + var seriesName; + var name; + var data; + var value; + var queryTarget; + var color; + var font; + var style; + var highlightStyle; + var shape; + var textShape; + for (var i = 0, l = mapData.length; i < l; i++) { + style = zrUtil.clone(mapData[i]); + highlightStyle = { + name: style.name, + path: style.path, + position: zrUtil.clone(style.position) + }; + name = style.name; + data = valueData[name]; + if (data) { + queryTarget = [data]; + seriesName = ''; + for (var j = 0, k = data.seriesIndex.length; j < k; j++) { + queryTarget.push(series[data.seriesIndex[j]]); + seriesName += series[data.seriesIndex[j]].name + ' '; + if (legend && this._showLegendSymbol[mapType] && legend.hasColor(series[data.seriesIndex[j]].name)) { + this.shapeList.push(new CircleShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + position: zrUtil.clone(style.position), + _mapType: mapType, + style: { + x: style.textX + 3 + j * 7, + y: style.textY - 10, + r: 3, + color: legend.getColor(series[data.seriesIndex[j]].name) + }, + hoverable: false + })); + } + } + value = data.value; + } else { + data = '-'; + seriesName = ''; + queryTarget = []; + for (var key in mapSeries) { + queryTarget.push(series[key]); + } + value = '-'; + } + this.ecTheme.map && queryTarget.push(this.ecTheme.map); + queryTarget.push(ecConfig); + color = dataRange && !isNaN(value) ? dataRange.getColor(value) : null; + style.color = style.color || color || this.getItemStyleColor(this.deepQuery(queryTarget, 'itemStyle.normal.color'), data.seriesIndex, -1, data) || this.deepQuery(queryTarget, 'itemStyle.normal.areaStyle.color'); + style.strokeColor = style.strokeColor || this.deepQuery(queryTarget, 'itemStyle.normal.borderColor'); + style.lineWidth = style.lineWidth || this.deepQuery(queryTarget, 'itemStyle.normal.borderWidth'); + highlightStyle.color = this.getItemStyleColor(this.deepQuery(queryTarget, 'itemStyle.emphasis.color'), data.seriesIndex, -1, data) || this.deepQuery(queryTarget, 'itemStyle.emphasis.areaStyle.color') || style.color; + highlightStyle.strokeColor = this.deepQuery(queryTarget, 'itemStyle.emphasis.borderColor') || style.strokeColor; + highlightStyle.lineWidth = this.deepQuery(queryTarget, 'itemStyle.emphasis.borderWidth') || style.lineWidth; + style.brushType = highlightStyle.brushType = style.brushType || 'both'; + style.lineJoin = highlightStyle.lineJoin = 'round'; + style._name = highlightStyle._name = name; + font = this.deepQuery(queryTarget, 'itemStyle.normal.label.textStyle'); + textShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + position: zrUtil.clone(style.position), + _mapType: mapType, + _geo: this.pos2geo(mapType, [ + style.textX, + style.textY + ]), + style: { + brushType: 'fill', + x: style.textX, + y: style.textY, + text: this.getLabelText(name, value, queryTarget, 'normal'), + _name: name, + textAlign: 'center', + color: this.deepQuery(queryTarget, 'itemStyle.normal.label.show') ? this.deepQuery(queryTarget, 'itemStyle.normal.label.textStyle.color') : 'rgba(0,0,0,0)', + textFont: this.getFont(font) + } + }; + textShape._style = zrUtil.clone(textShape.style); + textShape.highlightStyle = zrUtil.clone(textShape.style); + if (this.deepQuery(queryTarget, 'itemStyle.emphasis.label.show')) { + textShape.highlightStyle.text = this.getLabelText(name, value, queryTarget, 'emphasis'); + textShape.highlightStyle.color = this.deepQuery(queryTarget, 'itemStyle.emphasis.label.textStyle.color') || textShape.style.color; + font = this.deepQuery(queryTarget, 'itemStyle.emphasis.label.textStyle') || font; + textShape.highlightStyle.textFont = this.getFont(font); + } else { + textShape.highlightStyle.color = 'rgba(0,0,0,0)'; + } + shape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + position: zrUtil.clone(style.position), + style: style, + highlightStyle: highlightStyle, + _style: zrUtil.clone(style), + _mapType: mapType + }; + if (style.scale != null) { + shape.scale = zrUtil.clone(style.scale); + } + textShape = new TextShape(textShape); + switch (shape.style.shapeType) { + case 'rectangle': + shape = new RectangleShape(shape); + break; + case 'line': + shape = new LineShape(shape); + break; + case 'circle': + shape = new CircleShape(shape); + break; + case 'polygon': + shape = new PolygonShape(shape); + break; + case 'ellipse': + shape = new EllipseShape(shape); + break; + default: + shape = new PathShape(shape); + if (shape.buildPathArray) { + shape.style.pathArray = shape.buildPathArray(shape.style.path); + } + break; + } + if (this._selectedMode[mapType] && this._selected[name] || data.selected && this._selected[name] !== false) { + textShape.style = textShape.highlightStyle; + shape.style = shape.highlightStyle; + } + textShape.clickable = shape.clickable = this._clickable[mapType] && (data.clickable == null || data.clickable); + if (this._selectedMode[mapType]) { + this._selected[name] = this._selected[name] != null ? this._selected[name] : data.selected; + this._mapTypeMap[name] = mapType; + if (data.selectable == null || data.selectable) { + shape.clickable = textShape.clickable = true; + shape.onclick = textShape.onclick = this.shapeHandler.onclick; + } + } + if (this._hoverable[mapType] && (data.hoverable == null || data.hoverable)) { + textShape.hoverable = shape.hoverable = true; + shape.hoverConnect = textShape.id; + textShape.hoverConnect = shape.id; + } else { + textShape.hoverable = shape.hoverable = false; + } + ecData.pack(textShape, { + name: seriesName, + tooltip: this.deepQuery(queryTarget, 'tooltip') + }, 0, data, 0, name); + this.shapeList.push(textShape); + ecData.pack(shape, { + name: seriesName, + tooltip: this.deepQuery(queryTarget, 'tooltip') + }, 0, data, 0, name); + this.shapeList.push(shape); + } + }, + _buildMark: function (mapType, mapSeries) { + this._seriesIndexToMapType = this._seriesIndexToMapType || {}; + this.markAttachStyle = this.markAttachStyle || {}; + var position = [ + this._mapDataMap[mapType].transform.left, + this._mapDataMap[mapType].transform.top + ]; + if (mapType == 'none') { + position = [ + 0, + 0 + ]; + } + for (var sIdx in mapSeries) { + this._seriesIndexToMapType[sIdx] = mapType; + this.markAttachStyle[sIdx] = { + position: position, + _mapType: mapType + }; + this.buildMark(sIdx); + } + }, + getMarkCoord: function (seriesIndex, mpData) { + return mpData.geoCoord || _geoCoord[mpData.name] ? this.geo2pos(this._seriesIndexToMapType[seriesIndex], mpData.geoCoord || _geoCoord[mpData.name]) : [ + 0, + 0 + ]; + }, + getMarkGeo: function (mpData) { + return mpData.geoCoord || _geoCoord[mpData.name]; + }, + _nameChange: function (mapType, name) { + return this._nameMap[mapType][name] || name; + }, + getLabelText: function (name, value, queryTarget, status) { + var formatter = this.deepQuery(queryTarget, 'itemStyle.' + status + '.label.formatter'); + if (formatter) { + if (typeof formatter == 'function') { + return formatter.call(this.myChart, name, value); + } else if (typeof formatter == 'string') { + formatter = formatter.replace('{a}', '{a0}').replace('{b}', '{b0}'); + formatter = formatter.replace('{a0}', name).replace('{b0}', value); + return formatter; + } + } else { + return name; + } + }, + _findMapTypeByPos: function (mx, my) { + var transform; + var left; + var top; + var width; + var height; + for (var mapType in this._mapDataMap) { + transform = this._mapDataMap[mapType].transform; + if (!transform || !this._roamMap[mapType] || !this._activeMapType[mapType]) { + continue; + } + left = transform.left; + top = transform.top; + width = transform.width; + height = transform.height; + if (mx >= left && mx <= left + width && my >= top && my <= top + height) { + return mapType; + } + } + return; + }, + __onmousewheel: function (params) { + if (this.shapeList.length <= 0) { + return; + } + var event = params.event; + var mx = zrEvent.getX(event); + var my = zrEvent.getY(event); + var delta; + var eventDelta = zrEvent.getDelta(event); + var mapType; + var mapTypeControl = params.mapTypeControl; + if (!mapTypeControl) { + mapTypeControl = {}; + mapType = this._findMapTypeByPos(mx, my); + if (mapType && this._roamMap[mapType] && this._roamMap[mapType] != 'move') { + mapTypeControl[mapType] = true; + } + } + var haveScale = false; + for (mapType in mapTypeControl) { + if (mapTypeControl[mapType]) { + haveScale = true; + var transform = this._mapDataMap[mapType].transform; + var left = transform.left; + var top = transform.top; + var width = transform.width; + var height = transform.height; + var geoAndPos = this.pos2geo(mapType, [ + mx - left, + my - top + ]); + if (eventDelta > 0) { + delta = 1.2; + if (this._scaleLimitMap[mapType].max != null && transform.baseScale >= this._scaleLimitMap[mapType].max) { + continue; + } + } else { + delta = 1 / 1.2; + if (this._scaleLimitMap[mapType].min != null && transform.baseScale <= this._scaleLimitMap[mapType].min) { + continue; + } + } + transform.baseScale *= delta; + transform.scale.x *= delta; + transform.scale.y *= delta; + transform.width = width * delta; + transform.height = height * delta; + this._mapDataMap[mapType].hasRoam = true; + this._mapDataMap[mapType].transform = transform; + geoAndPos = this.geo2pos(mapType, geoAndPos); + transform.left -= geoAndPos[0] - (mx - left); + transform.top -= geoAndPos[1] - (my - top); + this._mapDataMap[mapType].transform = transform; + this.clearEffectShape(true); + for (var i = 0, l = this.shapeList.length; i < l; i++) { + if (this.shapeList[i]._mapType == mapType) { + this.shapeList[i].position[0] = transform.left; + this.shapeList[i].position[1] = transform.top; + if (this.shapeList[i].type == 'path' || this.shapeList[i].type == 'symbol' || this.shapeList[i].type == 'circle' || this.shapeList[i].type == 'rectangle' || this.shapeList[i].type == 'polygon' || this.shapeList[i].type == 'line' || this.shapeList[i].type == 'ellipse') { + this.shapeList[i].scale[0] *= delta; + this.shapeList[i].scale[1] *= delta; + } else if (this.shapeList[i].type == 'mark-line') { + this.shapeList[i].style.pointListLength = undefined; + this.shapeList[i].style.pointList = false; + geoAndPos = this.geo2pos(mapType, this.shapeList[i]._geo[0]); + this.shapeList[i].style.xStart = geoAndPos[0]; + this.shapeList[i].style.yStart = geoAndPos[1]; + geoAndPos = this.geo2pos(mapType, this.shapeList[i]._geo[1]); + this.shapeList[i]._x = this.shapeList[i].style.xEnd = geoAndPos[0]; + this.shapeList[i]._y = this.shapeList[i].style.yEnd = geoAndPos[1]; + } else if (this.shapeList[i].type == 'icon' || this.shapeList[i].type == 'image') { + geoAndPos = this.geo2pos(mapType, this.shapeList[i]._geo); + this.shapeList[i].style.x = this.shapeList[i].style._x = geoAndPos[0] - this.shapeList[i].style.width / 2; + this.shapeList[i].style.y = this.shapeList[i].style._y = geoAndPos[1] - this.shapeList[i].style.height / 2; + } else { + geoAndPos = this.geo2pos(mapType, this.shapeList[i]._geo); + this.shapeList[i].style.x = geoAndPos[0]; + this.shapeList[i].style.y = geoAndPos[1]; + if (this.shapeList[i].type == 'text') { + this.shapeList[i]._style.x = this.shapeList[i].highlightStyle.x = geoAndPos[0]; + this.shapeList[i]._style.y = this.shapeList[i].highlightStyle.y = geoAndPos[1]; + } + } + this.zr.modShape(this.shapeList[i].id); + } + } + } + } + if (haveScale) { + zrEvent.stop(event); + this.zr.refreshNextFrame(); + var self = this; + clearTimeout(this._refreshDelayTicket); + this._refreshDelayTicket = setTimeout(function () { + self && self.shapeList && self.animationEffect(); + }, 100); + this.messageCenter.dispatch(ecConfig.EVENT.MAP_ROAM, params.event, { type: 'scale' }, this.myChart); + } + }, + __onmousedown: function (params) { + if (this.shapeList.length <= 0) { + return; + } + var target = params.target; + if (target && target.draggable) { + return; + } + var event = params.event; + var mx = zrEvent.getX(event); + var my = zrEvent.getY(event); + var mapType = this._findMapTypeByPos(mx, my); + if (mapType && this._roamMap[mapType] && this._roamMap[mapType] != 'scale') { + this._mousedown = true; + this._mx = mx; + this._my = my; + this._curMapType = mapType; + this.zr.on(zrConfig.EVENT.MOUSEUP, this._onmouseup); + var self = this; + setTimeout(function () { + self.zr.on(zrConfig.EVENT.MOUSEMOVE, self._onmousemove); + }, 100); + } + }, + __onmousemove: function (params) { + if (!this._mousedown || !this._isAlive) { + return; + } + var event = params.event; + var mx = zrEvent.getX(event); + var my = zrEvent.getY(event); + var transform = this._mapDataMap[this._curMapType].transform; + transform.hasRoam = true; + transform.left -= this._mx - mx; + transform.top -= this._my - my; + this._mx = mx; + this._my = my; + this._mapDataMap[this._curMapType].transform = transform; + for (var i = 0, l = this.shapeList.length; i < l; i++) { + if (this.shapeList[i]._mapType == this._curMapType) { + this.shapeList[i].position[0] = transform.left; + this.shapeList[i].position[1] = transform.top; + this.zr.modShape(this.shapeList[i].id); + } + } + this.messageCenter.dispatch(ecConfig.EVENT.MAP_ROAM, params.event, { type: 'move' }, this.myChart); + this.clearEffectShape(true); + this.zr.refreshNextFrame(); + this._justMove = true; + zrEvent.stop(event); + }, + __onmouseup: function (params) { + var event = params.event; + this._mx = zrEvent.getX(event); + this._my = zrEvent.getY(event); + this._mousedown = false; + var self = this; + setTimeout(function () { + self._justMove && self.animationEffect(); + self._justMove = false; + self.zr.un(zrConfig.EVENT.MOUSEMOVE, self._onmousemove); + self.zr.un(zrConfig.EVENT.MOUSEUP, self._onmouseup); + }, 120); + }, + __onroamcontroller: function (params) { + var event = params.event; + event.zrenderX = this.zr.getWidth() / 2; + event.zrenderY = this.zr.getHeight() / 2; + var mapTypeControl = params.mapTypeControl; + var top = 0; + var left = 0; + var step = params.step; + switch (params.roamType) { + case 'scaleUp': + event.zrenderDelta = 1; + this.__onmousewheel({ + event: event, + mapTypeControl: mapTypeControl + }); + return; + case 'scaleDown': + event.zrenderDelta = -1; + this.__onmousewheel({ + event: event, + mapTypeControl: mapTypeControl + }); + return; + case 'up': + top = -step; + break; + case 'down': + top = step; + break; + case 'left': + left = -step; + break; + case 'right': + left = step; + break; + } + var transform; + var curMapType; + for (curMapType in mapTypeControl) { + if (!this._mapDataMap[curMapType] || !this._activeMapType[curMapType]) { + continue; + } + transform = this._mapDataMap[curMapType].transform; + transform.hasRoam = true; + transform.left -= left; + transform.top -= top; + this._mapDataMap[curMapType].transform = transform; + } + for (var i = 0, l = this.shapeList.length; i < l; i++) { + curMapType = this.shapeList[i]._mapType; + if (!mapTypeControl[curMapType] || !this._activeMapType[curMapType]) { + continue; + } + transform = this._mapDataMap[curMapType].transform; + this.shapeList[i].position[0] = transform.left; + this.shapeList[i].position[1] = transform.top; + this.zr.modShape(this.shapeList[i].id); + } + this.messageCenter.dispatch(ecConfig.EVENT.MAP_ROAM, params.event, { type: 'move' }, this.myChart); + this.clearEffectShape(true); + this.zr.refreshNextFrame(); + clearTimeout(this.dircetionTimer); + var self = this; + this.dircetionTimer = setTimeout(function () { + self.animationEffect(); + }, 150); + }, + __ondrhoverlink: function (param) { + var curMapType; + var value; + for (var i = 0, l = this.shapeList.length; i < l; i++) { + curMapType = this.shapeList[i]._mapType; + if (!this._hoverLinkMap[curMapType] || !this._activeMapType[curMapType]) { + continue; + } + value = ecData.get(this.shapeList[i], 'value'); + if (value != null && value >= param.valueMin && value <= param.valueMax) { + this.zr.addHoverShape(this.shapeList[i]); + } + } + }, + onclick: function (params) { + if (!this.isClick || !params.target || this._justMove || params.target.type == 'icon') { + return; + } + this.isClick = false; + var target = params.target; + var name = target.style._name; + var len = this.shapeList.length; + var mapType = target._mapType || ''; + if (this._selectedMode[mapType] == 'single') { + for (var p in this._selected) { + if (this._selected[p] && this._mapTypeMap[p] == mapType) { + for (var i = 0; i < len; i++) { + if (this.shapeList[i].style._name == p && this.shapeList[i]._mapType == mapType) { + this.shapeList[i].style = this.shapeList[i]._style; + this.zr.modShape(this.shapeList[i].id); + } + } + p != name && (this._selected[p] = false); + } + } + } + this._selected[name] = !this._selected[name]; + for (var i = 0; i < len; i++) { + if (this.shapeList[i].style._name == name && this.shapeList[i]._mapType == mapType) { + if (this._selected[name]) { + this.shapeList[i].style = this.shapeList[i].highlightStyle; + } else { + this.shapeList[i].style = this.shapeList[i]._style; + } + this.zr.modShape(this.shapeList[i].id); + } + } + this.messageCenter.dispatch(ecConfig.EVENT.MAP_SELECTED, params.event, { + selected: this._selected, + target: name + }, this.myChart); + this.zr.refreshNextFrame(); + var self = this; + setTimeout(function () { + self.zr.trigger(zrConfig.EVENT.MOUSEMOVE, params.event); + }, 100); + }, + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + if (this._mapDataRequireCounter > 0) { + this.clear(); + } else { + this.backupShapeList(); + } + this._buildShape(); + this.zr.refreshHover(); + }, + ondataRange: function (param, status) { + if (this.component.dataRange) { + this.refresh(); + status.needRefresh = true; + } + return; + }, + pos2geo: function (mapType, p) { + if (!this._mapDataMap[mapType].transform) { + return null; + } + return this._mapDataMap[mapType].projection.pos2geo(this._mapDataMap[mapType].transform, p); + }, + getGeoByPos: function (mapType, p) { + if (!this._mapDataMap[mapType].transform) { + return null; + } + var position = [ + this._mapDataMap[mapType].transform.left, + this._mapDataMap[mapType].transform.top + ]; + if (p instanceof Array) { + p[0] -= position[0]; + p[1] -= position[1]; + } else { + p.x -= position[0]; + p.y -= position[1]; + } + return this.pos2geo(mapType, p); + }, + geo2pos: function (mapType, p) { + if (!this._mapDataMap[mapType].transform) { + return null; + } + return this._mapDataMap[mapType].projection.geo2pos(this._mapDataMap[mapType].transform, p); + }, + getPosByGeo: function (mapType, p) { + if (!this._mapDataMap[mapType].transform) { + return null; + } + var pos = this.geo2pos(mapType, p); + pos[0] += this._mapDataMap[mapType].transform.left; + pos[1] += this._mapDataMap[mapType].transform.top; + return pos; + }, + getMapPosition: function (mapType) { + if (!this._mapDataMap[mapType].transform) { + return null; + } + return [ + this._mapDataMap[mapType].transform.left, + this._mapDataMap[mapType].transform.top + ]; + }, + onbeforDispose: function () { + this._isAlive = false; + this.zr.un(zrConfig.EVENT.MOUSEWHEEL, this._onmousewheel); + this.zr.un(zrConfig.EVENT.MOUSEDOWN, this._onmousedown); + this.messageCenter.unbind(ecConfig.EVENT.ROAMCONTROLLER, this._onroamcontroller); + this.messageCenter.unbind(ecConfig.EVENT.DATA_RANGE_HOVERLINK, this._ondrhoverlink); + } + }; + zrUtil.inherits(Map, ChartBase); + require('../chart').define('map', Map); + return Map; +});define('zrender/shape/Path', [ + 'require', + './Base', + './util/PathProxy', + '../tool/util' +], function (require) { + var Base = require('./Base'); + var PathProxy = require('./util/PathProxy'); + var PathSegment = PathProxy.PathSegment; + var vMag = function (v) { + return Math.sqrt(v[0] * v[0] + v[1] * v[1]); + }; + var vRatio = function (u, v) { + return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v)); + }; + var vAngle = function (u, v) { + return (u[0] * v[1] < u[1] * v[0] ? -1 : 1) * Math.acos(vRatio(u, v)); + }; + var Path = function (options) { + Base.call(this, options); + }; + Path.prototype = { + type: 'path', + buildPathArray: function (data, x, y) { + if (!data) { + return []; + } + x = x || 0; + y = y || 0; + var cs = data; + var cc = [ + 'm', + 'M', + 'l', + 'L', + 'v', + 'V', + 'h', + 'H', + 'z', + 'Z', + 'c', + 'C', + 'q', + 'Q', + 't', + 'T', + 's', + 'S', + 'a', + 'A' + ]; + cs = cs.replace(/-/g, ' -'); + cs = cs.replace(/ /g, ' '); + cs = cs.replace(/ /g, ','); + cs = cs.replace(/,,/g, ','); + var n; + for (n = 0; n < cc.length; n++) { + cs = cs.replace(new RegExp(cc[n], 'g'), '|' + cc[n]); + } + var arr = cs.split('|'); + var ca = []; + var cpx = 0; + var cpy = 0; + for (n = 1; n < arr.length; n++) { + var str = arr[n]; + var c = str.charAt(0); + str = str.slice(1); + str = str.replace(new RegExp('e,-', 'g'), 'e-'); + var p = str.split(','); + if (p.length > 0 && p[0] === '') { + p.shift(); + } + for (var i = 0; i < p.length; i++) { + p[i] = parseFloat(p[i]); + } + while (p.length > 0) { + if (isNaN(p[0])) { + break; + } + var cmd = null; + var points = []; + var ctlPtx; + var ctlPty; + var prevCmd; + var rx; + var ry; + var psi; + var fa; + var fs; + var x1 = cpx; + var y1 = cpy; + switch (c) { + case 'l': + cpx += p.shift(); + cpy += p.shift(); + cmd = 'L'; + points.push(cpx, cpy); + break; + case 'L': + cpx = p.shift(); + cpy = p.shift(); + points.push(cpx, cpy); + break; + case 'm': + cpx += p.shift(); + cpy += p.shift(); + cmd = 'M'; + points.push(cpx, cpy); + c = 'l'; + break; + case 'M': + cpx = p.shift(); + cpy = p.shift(); + cmd = 'M'; + points.push(cpx, cpy); + c = 'L'; + break; + case 'h': + cpx += p.shift(); + cmd = 'L'; + points.push(cpx, cpy); + break; + case 'H': + cpx = p.shift(); + cmd = 'L'; + points.push(cpx, cpy); + break; + case 'v': + cpy += p.shift(); + cmd = 'L'; + points.push(cpx, cpy); + break; + case 'V': + cpy = p.shift(); + cmd = 'L'; + points.push(cpx, cpy); + break; + case 'C': + points.push(p.shift(), p.shift(), p.shift(), p.shift()); + cpx = p.shift(); + cpy = p.shift(); + points.push(cpx, cpy); + break; + case 'c': + points.push(cpx + p.shift(), cpy + p.shift(), cpx + p.shift(), cpy + p.shift()); + cpx += p.shift(); + cpy += p.shift(); + cmd = 'C'; + points.push(cpx, cpy); + break; + case 'S': + ctlPtx = cpx; + ctlPty = cpy; + prevCmd = ca[ca.length - 1]; + if (prevCmd.command === 'C') { + ctlPtx = cpx + (cpx - prevCmd.points[2]); + ctlPty = cpy + (cpy - prevCmd.points[3]); + } + points.push(ctlPtx, ctlPty, p.shift(), p.shift()); + cpx = p.shift(); + cpy = p.shift(); + cmd = 'C'; + points.push(cpx, cpy); + break; + case 's': + ctlPtx = cpx, ctlPty = cpy; + prevCmd = ca[ca.length - 1]; + if (prevCmd.command === 'C') { + ctlPtx = cpx + (cpx - prevCmd.points[2]); + ctlPty = cpy + (cpy - prevCmd.points[3]); + } + points.push(ctlPtx, ctlPty, cpx + p.shift(), cpy + p.shift()); + cpx += p.shift(); + cpy += p.shift(); + cmd = 'C'; + points.push(cpx, cpy); + break; + case 'Q': + points.push(p.shift(), p.shift()); + cpx = p.shift(); + cpy = p.shift(); + points.push(cpx, cpy); + break; + case 'q': + points.push(cpx + p.shift(), cpy + p.shift()); + cpx += p.shift(); + cpy += p.shift(); + cmd = 'Q'; + points.push(cpx, cpy); + break; + case 'T': + ctlPtx = cpx, ctlPty = cpy; + prevCmd = ca[ca.length - 1]; + if (prevCmd.command === 'Q') { + ctlPtx = cpx + (cpx - prevCmd.points[0]); + ctlPty = cpy + (cpy - prevCmd.points[1]); + } + cpx = p.shift(); + cpy = p.shift(); + cmd = 'Q'; + points.push(ctlPtx, ctlPty, cpx, cpy); + break; + case 't': + ctlPtx = cpx, ctlPty = cpy; + prevCmd = ca[ca.length - 1]; + if (prevCmd.command === 'Q') { + ctlPtx = cpx + (cpx - prevCmd.points[0]); + ctlPty = cpy + (cpy - prevCmd.points[1]); + } + cpx += p.shift(); + cpy += p.shift(); + cmd = 'Q'; + points.push(ctlPtx, ctlPty, cpx, cpy); + break; + case 'A': + rx = p.shift(); + ry = p.shift(); + psi = p.shift(); + fa = p.shift(); + fs = p.shift(); + x1 = cpx, y1 = cpy; + cpx = p.shift(), cpy = p.shift(); + cmd = 'A'; + points = this._convertPoint(x1, y1, cpx, cpy, fa, fs, rx, ry, psi); + break; + case 'a': + rx = p.shift(); + ry = p.shift(); + psi = p.shift(); + fa = p.shift(); + fs = p.shift(); + x1 = cpx, y1 = cpy; + cpx += p.shift(); + cpy += p.shift(); + cmd = 'A'; + points = this._convertPoint(x1, y1, cpx, cpy, fa, fs, rx, ry, psi); + break; + } + for (var j = 0, l = points.length; j < l; j += 2) { + points[j] += x; + points[j + 1] += y; + } + ca.push(new PathSegment(cmd || c, points)); + } + if (c === 'z' || c === 'Z') { + ca.push(new PathSegment('z', [])); + } + } + return ca; + }, + _convertPoint: function (x1, y1, x2, y2, fa, fs, rx, ry, psiDeg) { + var psi = psiDeg * (Math.PI / 180); + var xp = Math.cos(psi) * (x1 - x2) / 2 + Math.sin(psi) * (y1 - y2) / 2; + var yp = -1 * Math.sin(psi) * (x1 - x2) / 2 + Math.cos(psi) * (y1 - y2) / 2; + var lambda = xp * xp / (rx * rx) + yp * yp / (ry * ry); + if (lambda > 1) { + rx *= Math.sqrt(lambda); + ry *= Math.sqrt(lambda); + } + var f = Math.sqrt((rx * rx * (ry * ry) - rx * rx * (yp * yp) - ry * ry * (xp * xp)) / (rx * rx * (yp * yp) + ry * ry * (xp * xp))); + if (fa === fs) { + f *= -1; + } + if (isNaN(f)) { + f = 0; + } + var cxp = f * rx * yp / ry; + var cyp = f * -ry * xp / rx; + var cx = (x1 + x2) / 2 + Math.cos(psi) * cxp - Math.sin(psi) * cyp; + var cy = (y1 + y2) / 2 + Math.sin(psi) * cxp + Math.cos(psi) * cyp; + var theta = vAngle([ + 1, + 0 + ], [ + (xp - cxp) / rx, + (yp - cyp) / ry + ]); + var u = [ + (xp - cxp) / rx, + (yp - cyp) / ry + ]; + var v = [ + (-1 * xp - cxp) / rx, + (-1 * yp - cyp) / ry + ]; + var dTheta = vAngle(u, v); + if (vRatio(u, v) <= -1) { + dTheta = Math.PI; + } + if (vRatio(u, v) >= 1) { + dTheta = 0; + } + if (fs === 0 && dTheta > 0) { + dTheta = dTheta - 2 * Math.PI; + } + if (fs === 1 && dTheta < 0) { + dTheta = dTheta + 2 * Math.PI; + } + return [ + cx, + cy, + rx, + ry, + theta, + dTheta, + psi, + fs + ]; + }, + buildPath: function (ctx, style) { + var path = style.path; + var x = style.x || 0; + var y = style.y || 0; + style.pathArray = style.pathArray || this.buildPathArray(path, x, y); + var pathArray = style.pathArray; + var pointList = style.pointList = []; + var singlePointList = []; + for (var i = 0, l = pathArray.length; i < l; i++) { + if (pathArray[i].command.toUpperCase() == 'M') { + singlePointList.length > 0 && pointList.push(singlePointList); + singlePointList = []; + } + var p = pathArray[i].points; + for (var j = 0, k = p.length; j < k; j += 2) { + singlePointList.push([ + p[j], + p[j + 1] + ]); + } + } + singlePointList.length > 0 && pointList.push(singlePointList); + for (var i = 0, l = pathArray.length; i < l; i++) { + var c = pathArray[i].command; + var p = pathArray[i].points; + switch (c) { + case 'L': + ctx.lineTo(p[0], p[1]); + break; + case 'M': + ctx.moveTo(p[0], p[1]); + break; + case 'C': + ctx.bezierCurveTo(p[0], p[1], p[2], p[3], p[4], p[5]); + break; + case 'Q': + ctx.quadraticCurveTo(p[0], p[1], p[2], p[3]); + break; + case 'A': + var cx = p[0]; + var cy = p[1]; + var rx = p[2]; + var ry = p[3]; + var theta = p[4]; + var dTheta = p[5]; + var psi = p[6]; + var fs = p[7]; + var r = rx > ry ? rx : ry; + var scaleX = rx > ry ? 1 : rx / ry; + var scaleY = rx > ry ? ry / rx : 1; + ctx.translate(cx, cy); + ctx.rotate(psi); + ctx.scale(scaleX, scaleY); + ctx.arc(0, 0, r, theta, theta + dTheta, 1 - fs); + ctx.scale(1 / scaleX, 1 / scaleY); + ctx.rotate(-psi); + ctx.translate(-cx, -cy); + break; + case 'z': + ctx.closePath(); + break; + } + } + return; + }, + getRect: function (style) { + if (style.__rect) { + return style.__rect; + } + var lineWidth; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } else { + lineWidth = 0; + } + var minX = Number.MAX_VALUE; + var maxX = Number.MIN_VALUE; + var minY = Number.MAX_VALUE; + var maxY = Number.MIN_VALUE; + var x = style.x || 0; + var y = style.y || 0; + var pathArray = style.pathArray || this.buildPathArray(style.path); + for (var i = 0; i < pathArray.length; i++) { + var p = pathArray[i].points; + for (var j = 0; j < p.length; j++) { + if (j % 2 === 0) { + if (p[j] + x < minX) { + minX = p[j]; + } + if (p[j] + x > maxX) { + maxX = p[j]; + } + } else { + if (p[j] + y < minY) { + minY = p[j]; + } + if (p[j] + y > maxY) { + maxY = p[j]; + } + } + } + } + var rect; + if (minX === Number.MAX_VALUE || maxX === Number.MIN_VALUE || minY === Number.MAX_VALUE || maxY === Number.MIN_VALUE) { + rect = { + x: 0, + y: 0, + width: 0, + height: 0 + }; + } else { + rect = { + x: Math.round(minX - lineWidth / 2), + y: Math.round(minY - lineWidth / 2), + width: maxX - minX + lineWidth, + height: maxY - minY + lineWidth + }; + } + style.__rect = rect; + return rect; + } + }; + require('../tool/util').inherits(Path, Base); + return Path; +});define('zrender/shape/Ellipse', [ + 'require', + './Base', + '../tool/util' +], function (require) { + var Base = require('./Base'); + var Ellipse = function (options) { + Base.call(this, options); + }; + Ellipse.prototype = { + type: 'ellipse', + buildPath: function (ctx, style) { + var k = 0.5522848; + var x = style.x; + var y = style.y; + var a = style.a; + var b = style.b; + var ox = a * k; + var oy = b * k; + ctx.moveTo(x - a, y); + ctx.bezierCurveTo(x - a, y - oy, x - ox, y - b, x, y - b); + ctx.bezierCurveTo(x + ox, y - b, x + a, y - oy, x + a, y); + ctx.bezierCurveTo(x + a, y + oy, x + ox, y + b, x, y + b); + ctx.bezierCurveTo(x - ox, y + b, x - a, y + oy, x - a, y); + ctx.closePath(); + }, + getRect: function (style) { + if (style.__rect) { + return style.__rect; + } + var lineWidth; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } else { + lineWidth = 0; + } + style.__rect = { + x: Math.round(style.x - style.a - lineWidth / 2), + y: Math.round(style.y - style.b - lineWidth / 2), + width: style.a * 2 + lineWidth, + height: style.b * 2 + lineWidth + }; + return style.__rect; + } + }; + require('../tool/util').inherits(Ellipse, Base); + return Ellipse; +});define('echarts/component/dataRange', [ + 'require', + './base', + 'zrender/shape/Text', + 'zrender/shape/Rectangle', + '../util/shape/HandlePolygon', + '../config', + 'zrender/tool/util', + 'zrender/tool/event', + 'zrender/tool/area', + 'zrender/tool/color', + '../component' +], function (require) { + var Base = require('./base'); + var TextShape = require('zrender/shape/Text'); + var RectangleShape = require('zrender/shape/Rectangle'); + var HandlePolygonShape = require('../util/shape/HandlePolygon'); + var ecConfig = require('../config'); + ecConfig.dataRange = { + zlevel: 0, + z: 4, + show: true, + orient: 'vertical', + x: 'left', + y: 'bottom', + backgroundColor: 'rgba(0,0,0,0)', + borderColor: '#ccc', + borderWidth: 0, + padding: 5, + itemGap: 10, + itemWidth: 20, + itemHeight: 14, + precision: 0, + splitNumber: 5, + calculable: false, + selectedMode: true, + hoverLink: true, + realtime: true, + color: [ + '#006edd', + '#e0ffff' + ], + textStyle: { color: '#333' } + }; + var zrUtil = require('zrender/tool/util'); + var zrEvent = require('zrender/tool/event'); + var zrArea = require('zrender/tool/area'); + var zrColor = require('zrender/tool/color'); + function DataRange(ecTheme, messageCenter, zr, option, myChart) { + if (typeof this.query(option, 'dataRange.min') == 'undefined' || typeof this.query(option, 'dataRange.max') == 'undefined') { + console.error('option.dataRange.min or option.dataRange.max has not been defined.'); + return; + } + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + var self = this; + self._ondrift = function (dx, dy) { + return self.__ondrift(this, dx, dy); + }; + self._ondragend = function () { + return self.__ondragend(); + }; + self._dataRangeSelected = function (param) { + return self.__dataRangeSelected(param); + }; + self._dispatchHoverLink = function (param) { + return self.__dispatchHoverLink(param); + }; + self._onhoverlink = function (params) { + return self.__onhoverlink(params); + }; + this._selectedMap = {}; + this._range = {}; + this.refresh(option); + messageCenter.bind(ecConfig.EVENT.HOVER, this._onhoverlink); + } + DataRange.prototype = { + type: ecConfig.COMPONENT_TYPE_DATARANGE, + _textGap: 10, + _buildShape: function () { + this._itemGroupLocation = this._getItemGroupLocation(); + this._buildBackground(); + if (this.dataRangeOption.splitNumber <= 0 || this.dataRangeOption.calculable) { + this._buildGradient(); + } else { + this._buildItem(); + } + if (this.dataRangeOption.show) { + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + } + this._syncShapeFromRange(); + }, + _buildItem: function () { + var data = this._valueTextList; + var dataLength = data.length; + var itemName; + var itemShape; + var textShape; + var font = this.getFont(this.dataRangeOption.textStyle); + var lastX = this._itemGroupLocation.x; + var lastY = this._itemGroupLocation.y; + var itemWidth = this.dataRangeOption.itemWidth; + var itemHeight = this.dataRangeOption.itemHeight; + var itemGap = this.dataRangeOption.itemGap; + var textHeight = zrArea.getTextHeight('国', font); + var color; + if (this.dataRangeOption.orient == 'vertical' && this.dataRangeOption.x == 'right') { + lastX = this._itemGroupLocation.x + this._itemGroupLocation.width - itemWidth; + } + var needValueText = true; + if (this.dataRangeOption.text) { + needValueText = false; + if (this.dataRangeOption.text[0]) { + textShape = this._getTextShape(lastX, lastY, this.dataRangeOption.text[0]); + if (this.dataRangeOption.orient == 'horizontal') { + lastX += zrArea.getTextWidth(this.dataRangeOption.text[0], font) + this._textGap; + } else { + lastY += textHeight + this._textGap; + textShape.style.y += textHeight / 2 + this._textGap; + textShape.style.textBaseline = 'bottom'; + } + this.shapeList.push(new TextShape(textShape)); + } + } + for (var i = 0; i < dataLength; i++) { + itemName = data[i]; + color = this.getColorByIndex(i); + itemShape = this._getItemShape(lastX, lastY, itemWidth, itemHeight, this._selectedMap[i] ? color : '#ccc'); + itemShape._idx = i; + itemShape.onmousemove = this._dispatchHoverLink; + if (this.dataRangeOption.selectedMode) { + itemShape.clickable = true; + itemShape.onclick = this._dataRangeSelected; + } + this.shapeList.push(new RectangleShape(itemShape)); + if (needValueText) { + textShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: lastX + itemWidth + 5, + y: lastY, + color: this._selectedMap[i] ? this.dataRangeOption.textStyle.color : '#ccc', + text: data[i], + textFont: font, + textBaseline: 'top' + }, + highlightStyle: { brushType: 'fill' } + }; + if (this.dataRangeOption.orient == 'vertical' && this.dataRangeOption.x == 'right') { + textShape.style.x -= itemWidth + 10; + textShape.style.textAlign = 'right'; + } + textShape._idx = i; + textShape.onmousemove = this._dispatchHoverLink; + if (this.dataRangeOption.selectedMode) { + textShape.clickable = true; + textShape.onclick = this._dataRangeSelected; + } + this.shapeList.push(new TextShape(textShape)); + } + if (this.dataRangeOption.orient == 'horizontal') { + lastX += itemWidth + (needValueText ? 5 : 0) + (needValueText ? zrArea.getTextWidth(itemName, font) : 0) + itemGap; + } else { + lastY += itemHeight + itemGap; + } + } + if (!needValueText && this.dataRangeOption.text[1]) { + if (this.dataRangeOption.orient == 'horizontal') { + lastX = lastX - itemGap + this._textGap; + } else { + lastY = lastY - itemGap + this._textGap; + } + textShape = this._getTextShape(lastX, lastY, this.dataRangeOption.text[1]); + if (this.dataRangeOption.orient != 'horizontal') { + textShape.style.y -= 5; + textShape.style.textBaseline = 'top'; + } + this.shapeList.push(new TextShape(textShape)); + } + }, + _buildGradient: function () { + var itemShape; + var textShape; + var font = this.getFont(this.dataRangeOption.textStyle); + var lastX = this._itemGroupLocation.x; + var lastY = this._itemGroupLocation.y; + var itemWidth = this.dataRangeOption.itemWidth; + var itemHeight = this.dataRangeOption.itemHeight; + var textHeight = zrArea.getTextHeight('国', font); + var mSize = 10; + var needValueText = true; + if (this.dataRangeOption.text) { + needValueText = false; + if (this.dataRangeOption.text[0]) { + textShape = this._getTextShape(lastX, lastY, this.dataRangeOption.text[0]); + if (this.dataRangeOption.orient == 'horizontal') { + lastX += zrArea.getTextWidth(this.dataRangeOption.text[0], font) + this._textGap; + } else { + lastY += textHeight + this._textGap; + textShape.style.y += textHeight / 2 + this._textGap; + textShape.style.textBaseline = 'bottom'; + } + this.shapeList.push(new TextShape(textShape)); + } + } + var zrColor = require('zrender/tool/color'); + var per = 1 / (this.dataRangeOption.color.length - 1); + var colorList = []; + for (var i = 0, l = this.dataRangeOption.color.length; i < l; i++) { + colorList.push([ + i * per, + this.dataRangeOption.color[i] + ]); + } + if (this.dataRangeOption.orient == 'horizontal') { + itemShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: lastX, + y: lastY, + width: itemWidth * mSize, + height: itemHeight, + color: zrColor.getLinearGradient(lastX, lastY, lastX + itemWidth * mSize, lastY, colorList) + }, + hoverable: false + }; + lastX += itemWidth * mSize + this._textGap; + } else { + itemShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: lastX, + y: lastY, + width: itemWidth, + height: itemHeight * mSize, + color: zrColor.getLinearGradient(lastX, lastY, lastX, lastY + itemHeight * mSize, colorList) + }, + hoverable: false + }; + lastY += itemHeight * mSize + this._textGap; + } + this.shapeList.push(new RectangleShape(itemShape)); + this._calculableLocation = itemShape.style; + if (this.dataRangeOption.calculable) { + this._buildFiller(); + this._bulidMask(); + this._bulidHandle(); + } + this._buildIndicator(); + if (!needValueText && this.dataRangeOption.text[1]) { + textShape = this._getTextShape(lastX, lastY, this.dataRangeOption.text[1]); + this.shapeList.push(new TextShape(textShape)); + } + }, + _buildIndicator: function () { + var x = this._calculableLocation.x; + var y = this._calculableLocation.y; + var width = this._calculableLocation.width; + var height = this._calculableLocation.height; + var size = 5; + var pointList; + var textPosition; + if (this.dataRangeOption.orient == 'horizontal') { + if (this.dataRangeOption.y != 'bottom') { + pointList = [ + [ + x, + y + height + ], + [ + x - size, + y + height + size + ], + [ + x + size, + y + height + size + ] + ]; + textPosition = 'bottom'; + } else { + pointList = [ + [ + x, + y + ], + [ + x - size, + y - size + ], + [ + x + size, + y - size + ] + ]; + textPosition = 'top'; + } + } else { + if (this.dataRangeOption.x != 'right') { + pointList = [ + [ + x + width, + y + ], + [ + x + width + size, + y - size + ], + [ + x + width + size, + y + size + ] + ]; + textPosition = 'right'; + } else { + pointList = [ + [ + x, + y + ], + [ + x - size, + y - size + ], + [ + x - size, + y + size + ] + ]; + textPosition = 'left'; + } + } + this._indicatorShape = { + style: { + pointList: pointList, + color: '#fff', + __rect: { + x: Math.min(pointList[0][0], pointList[1][0]), + y: Math.min(pointList[0][1], pointList[1][1]), + width: size * (this.dataRangeOption.orient == 'horizontal' ? 2 : 1), + height: size * (this.dataRangeOption.orient == 'horizontal' ? 1 : 2) + } + }, + highlightStyle: { + brushType: 'fill', + textPosition: textPosition, + textColor: this.dataRangeOption.textStyle.color + }, + hoverable: false + }; + this._indicatorShape = new HandlePolygonShape(this._indicatorShape); + }, + _buildFiller: function () { + this._fillerShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + style: { + x: this._calculableLocation.x, + y: this._calculableLocation.y, + width: this._calculableLocation.width, + height: this._calculableLocation.height, + color: 'rgba(255,255,255,0)' + }, + highlightStyle: { + strokeColor: 'rgba(255,255,255,0.5)', + lineWidth: 1 + }, + draggable: true, + ondrift: this._ondrift, + ondragend: this._ondragend, + onmousemove: this._dispatchHoverLink, + _type: 'filler' + }; + this._fillerShape = new RectangleShape(this._fillerShape); + this.shapeList.push(this._fillerShape); + }, + _bulidHandle: function () { + var x = this._calculableLocation.x; + var y = this._calculableLocation.y; + var width = this._calculableLocation.width; + var height = this._calculableLocation.height; + var font = this.getFont(this.dataRangeOption.textStyle); + var textHeight = zrArea.getTextHeight('国', font); + var textWidth = Math.max(zrArea.getTextWidth(this._textFormat(this.dataRangeOption.max), font), zrArea.getTextWidth(this._textFormat(this.dataRangeOption.min), font)) + 2; + var pointListStart; + var textXStart; + var textYStart; + var coverRectStart; + var pointListEnd; + var textXEnd; + var textYEnd; + var coverRectEnd; + if (this.dataRangeOption.orient == 'horizontal') { + if (this.dataRangeOption.y != 'bottom') { + pointListStart = [ + [ + x, + y + ], + [ + x, + y + height + textHeight + ], + [ + x - textHeight, + y + height + textHeight + ], + [ + x - 1, + y + height + ], + [ + x - 1, + y + ] + ]; + textXStart = x - textWidth / 2 - textHeight; + textYStart = y + height + textHeight / 2 + 2; + coverRectStart = { + x: x - textWidth - textHeight, + y: y + height, + width: textWidth + textHeight, + height: textHeight + }; + pointListEnd = [ + [ + x + width, + y + ], + [ + x + width, + y + height + textHeight + ], + [ + x + width + textHeight, + y + height + textHeight + ], + [ + x + width + 1, + y + height + ], + [ + x + width + 1, + y + ] + ]; + textXEnd = x + width + textWidth / 2 + textHeight; + textYEnd = textYStart; + coverRectEnd = { + x: x + width, + y: y + height, + width: textWidth + textHeight, + height: textHeight + }; + } else { + pointListStart = [ + [ + x, + y + height + ], + [ + x, + y - textHeight + ], + [ + x - textHeight, + y - textHeight + ], + [ + x - 1, + y + ], + [ + x - 1, + y + height + ] + ]; + textXStart = x - textWidth / 2 - textHeight; + textYStart = y - textHeight / 2 - 2; + coverRectStart = { + x: x - textWidth - textHeight, + y: y - textHeight, + width: textWidth + textHeight, + height: textHeight + }; + pointListEnd = [ + [ + x + width, + y + height + ], + [ + x + width, + y - textHeight + ], + [ + x + width + textHeight, + y - textHeight + ], + [ + x + width + 1, + y + ], + [ + x + width + 1, + y + height + ] + ]; + textXEnd = x + width + textWidth / 2 + textHeight; + textYEnd = textYStart; + coverRectEnd = { + x: x + width, + y: y - textHeight, + width: textWidth + textHeight, + height: textHeight + }; + } + } else { + textWidth += textHeight; + if (this.dataRangeOption.x != 'right') { + pointListStart = [ + [ + x, + y + ], + [ + x + width + textHeight, + y + ], + [ + x + width + textHeight, + y - textHeight + ], + [ + x + width, + y - 1 + ], + [ + x, + y - 1 + ] + ]; + textXStart = x + width + textWidth / 2 + textHeight / 2; + textYStart = y - textHeight / 2; + coverRectStart = { + x: x + width, + y: y - textHeight, + width: textWidth + textHeight, + height: textHeight + }; + pointListEnd = [ + [ + x, + y + height + ], + [ + x + width + textHeight, + y + height + ], + [ + x + width + textHeight, + y + textHeight + height + ], + [ + x + width, + y + 1 + height + ], + [ + x, + y + height + 1 + ] + ]; + textXEnd = textXStart; + textYEnd = y + height + textHeight / 2; + coverRectEnd = { + x: x + width, + y: y + height, + width: textWidth + textHeight, + height: textHeight + }; + } else { + pointListStart = [ + [ + x + width, + y + ], + [ + x - textHeight, + y + ], + [ + x - textHeight, + y - textHeight + ], + [ + x, + y - 1 + ], + [ + x + width, + y - 1 + ] + ]; + textXStart = x - textWidth / 2 - textHeight / 2; + textYStart = y - textHeight / 2; + coverRectStart = { + x: x - textWidth - textHeight, + y: y - textHeight, + width: textWidth + textHeight, + height: textHeight + }; + pointListEnd = [ + [ + x + width, + y + height + ], + [ + x - textHeight, + y + height + ], + [ + x - textHeight, + y + textHeight + height + ], + [ + x, + y + 1 + height + ], + [ + x + width, + y + height + 1 + ] + ]; + textXEnd = textXStart; + textYEnd = y + height + textHeight / 2; + coverRectEnd = { + x: x - textWidth - textHeight, + y: y + height, + width: textWidth + textHeight, + height: textHeight + }; + } + } + this._startShape = { + style: { + pointList: pointListStart, + text: this._textFormat(this.dataRangeOption.max), + textX: textXStart, + textY: textYStart, + textFont: font, + color: this.getColor(this.dataRangeOption.max), + rect: coverRectStart, + x: pointListStart[0][0], + y: pointListStart[0][1], + _x: pointListStart[0][0], + _y: pointListStart[0][1] + } + }; + this._startShape.highlightStyle = { + strokeColor: this._startShape.style.color, + lineWidth: 1 + }; + this._endShape = { + style: { + pointList: pointListEnd, + text: this._textFormat(this.dataRangeOption.min), + textX: textXEnd, + textY: textYEnd, + textFont: font, + color: this.getColor(this.dataRangeOption.min), + rect: coverRectEnd, + x: pointListEnd[0][0], + y: pointListEnd[0][1], + _x: pointListEnd[0][0], + _y: pointListEnd[0][1] + } + }; + this._endShape.highlightStyle = { + strokeColor: this._endShape.style.color, + lineWidth: 1 + }; + this._startShape.zlevel = this._endShape.zlevel = this.getZlevelBase(); + this._startShape.z = this._endShape.z = this.getZBase() + 1; + this._startShape.draggable = this._endShape.draggable = true; + this._startShape.ondrift = this._endShape.ondrift = this._ondrift; + this._startShape.ondragend = this._endShape.ondragend = this._ondragend; + this._startShape.style.textColor = this._endShape.style.textColor = this.dataRangeOption.textStyle.color; + this._startShape.style.textAlign = this._endShape.style.textAlign = 'center'; + this._startShape.style.textPosition = this._endShape.style.textPosition = 'specific'; + this._startShape.style.textBaseline = this._endShape.style.textBaseline = 'middle'; + this._startShape.style.width = this._endShape.style.width = 0; + this._startShape.style.height = this._endShape.style.height = 0; + this._startShape.style.textPosition = this._endShape.style.textPosition = 'specific'; + this._startShape = new HandlePolygonShape(this._startShape); + this._endShape = new HandlePolygonShape(this._endShape); + this.shapeList.push(this._startShape); + this.shapeList.push(this._endShape); + }, + _bulidMask: function () { + var x = this._calculableLocation.x; + var y = this._calculableLocation.y; + var width = this._calculableLocation.width; + var height = this._calculableLocation.height; + this._startMask = { + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + style: { + x: x, + y: y, + width: this.dataRangeOption.orient == 'horizontal' ? 0 : width, + height: this.dataRangeOption.orient == 'horizontal' ? height : 0, + color: '#ccc' + }, + hoverable: false + }; + this._endMask = { + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + style: { + x: this.dataRangeOption.orient == 'horizontal' ? x + width : x, + y: this.dataRangeOption.orient == 'horizontal' ? y : y + height, + width: this.dataRangeOption.orient == 'horizontal' ? 0 : width, + height: this.dataRangeOption.orient == 'horizontal' ? height : 0, + color: '#ccc' + }, + hoverable: false + }; + this._startMask = new RectangleShape(this._startMask); + this._endMask = new RectangleShape(this._endMask); + this.shapeList.push(this._startMask); + this.shapeList.push(this._endMask); + }, + _buildBackground: function () { + var padding = this.reformCssArray(this.dataRangeOption.padding); + this.shapeList.push(new RectangleShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: this._itemGroupLocation.x - padding[3], + y: this._itemGroupLocation.y - padding[0], + width: this._itemGroupLocation.width + padding[3] + padding[1], + height: this._itemGroupLocation.height + padding[0] + padding[2], + brushType: this.dataRangeOption.borderWidth === 0 ? 'fill' : 'both', + color: this.dataRangeOption.backgroundColor, + strokeColor: this.dataRangeOption.borderColor, + lineWidth: this.dataRangeOption.borderWidth + } + })); + }, + _getItemGroupLocation: function () { + var data = this._valueTextList; + var dataLength = data.length; + var itemGap = this.dataRangeOption.itemGap; + var itemWidth = this.dataRangeOption.itemWidth; + var itemHeight = this.dataRangeOption.itemHeight; + var totalWidth = 0; + var totalHeight = 0; + var font = this.getFont(this.dataRangeOption.textStyle); + var textHeight = zrArea.getTextHeight('国', font); + var mSize = 10; + if (this.dataRangeOption.orient == 'horizontal') { + if (this.dataRangeOption.text || this.dataRangeOption.splitNumber <= 0 || this.dataRangeOption.calculable) { + totalWidth = (this.dataRangeOption.splitNumber <= 0 || this.dataRangeOption.calculable ? itemWidth * mSize + itemGap : dataLength * (itemWidth + itemGap)) + (this.dataRangeOption.text && typeof this.dataRangeOption.text[0] != 'undefined' ? zrArea.getTextWidth(this.dataRangeOption.text[0], font) + this._textGap : 0) + (this.dataRangeOption.text && typeof this.dataRangeOption.text[1] != 'undefined' ? zrArea.getTextWidth(this.dataRangeOption.text[1], font) + this._textGap : 0); + } else { + itemWidth += 5; + for (var i = 0; i < dataLength; i++) { + totalWidth += itemWidth + zrArea.getTextWidth(data[i], font) + itemGap; + } + } + totalWidth -= itemGap; + totalHeight = Math.max(textHeight, itemHeight); + } else { + var maxWidth; + if (this.dataRangeOption.text || this.dataRangeOption.splitNumber <= 0 || this.dataRangeOption.calculable) { + totalHeight = (this.dataRangeOption.splitNumber <= 0 || this.dataRangeOption.calculable ? itemHeight * mSize + itemGap : dataLength * (itemHeight + itemGap)) + (this.dataRangeOption.text && typeof this.dataRangeOption.text[0] != 'undefined' ? this._textGap + textHeight : 0) + (this.dataRangeOption.text && typeof this.dataRangeOption.text[1] != 'undefined' ? this._textGap + textHeight : 0); + maxWidth = Math.max(zrArea.getTextWidth(this.dataRangeOption.text && this.dataRangeOption.text[0] || '', font), zrArea.getTextWidth(this.dataRangeOption.text && this.dataRangeOption.text[1] || '', font)); + totalWidth = Math.max(itemWidth, maxWidth); + } else { + totalHeight = (itemHeight + itemGap) * dataLength; + itemWidth += 5; + maxWidth = 0; + for (var i = 0; i < dataLength; i++) { + maxWidth = Math.max(maxWidth, zrArea.getTextWidth(data[i], font)); + } + totalWidth = itemWidth + maxWidth; + } + totalHeight -= itemGap; + } + var padding = this.reformCssArray(this.dataRangeOption.padding); + var x; + var zrWidth = this.zr.getWidth(); + switch (this.dataRangeOption.x) { + case 'center': + x = Math.floor((zrWidth - totalWidth) / 2); + break; + case 'left': + x = padding[3] + this.dataRangeOption.borderWidth; + break; + case 'right': + x = zrWidth - totalWidth - padding[1] - this.dataRangeOption.borderWidth; + break; + default: + x = this.parsePercent(this.dataRangeOption.x, zrWidth); + x = isNaN(x) ? 0 : x; + break; + } + var y; + var zrHeight = this.zr.getHeight(); + switch (this.dataRangeOption.y) { + case 'top': + y = padding[0] + this.dataRangeOption.borderWidth; + break; + case 'bottom': + y = zrHeight - totalHeight - padding[2] - this.dataRangeOption.borderWidth; + break; + case 'center': + y = Math.floor((zrHeight - totalHeight) / 2); + break; + default: + y = this.parsePercent(this.dataRangeOption.y, zrHeight); + y = isNaN(y) ? 0 : y; + break; + } + if (this.dataRangeOption.calculable) { + var handlerWidth = Math.max(zrArea.getTextWidth(this.dataRangeOption.max, font), zrArea.getTextWidth(this.dataRangeOption.min, font)) + textHeight; + if (this.dataRangeOption.orient == 'horizontal') { + if (x < handlerWidth) { + x = handlerWidth; + } + if (x + totalWidth + handlerWidth > zrWidth) { + x -= handlerWidth; + } + } else { + if (y < textHeight) { + y = textHeight; + } + if (y + totalHeight + textHeight > zrHeight) { + y -= textHeight; + } + } + } + return { + x: x, + y: y, + width: totalWidth, + height: totalHeight + }; + }, + _getTextShape: function (x, y, text) { + return { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: this.dataRangeOption.orient == 'horizontal' ? x : this._itemGroupLocation.x + this._itemGroupLocation.width / 2, + y: this.dataRangeOption.orient == 'horizontal' ? this._itemGroupLocation.y + this._itemGroupLocation.height / 2 : y, + color: this.dataRangeOption.textStyle.color, + text: text, + textFont: this.getFont(this.dataRangeOption.textStyle), + textBaseline: this.dataRangeOption.orient == 'horizontal' ? 'middle' : 'top', + textAlign: this.dataRangeOption.orient == 'horizontal' ? 'left' : 'center' + }, + hoverable: false + }; + }, + _getItemShape: function (x, y, width, height, color) { + return { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: x, + y: y + 1, + width: width, + height: height - 2, + color: color + }, + highlightStyle: { + strokeColor: color, + lineWidth: 1 + } + }; + }, + __ondrift: function (shape, dx, dy) { + var x = this._calculableLocation.x; + var y = this._calculableLocation.y; + var width = this._calculableLocation.width; + var height = this._calculableLocation.height; + if (this.dataRangeOption.orient == 'horizontal') { + if (shape.style.x + dx <= x) { + shape.style.x = x; + } else if (shape.style.x + dx + shape.style.width >= x + width) { + shape.style.x = x + width - shape.style.width; + } else { + shape.style.x += dx; + } + } else { + if (shape.style.y + dy <= y) { + shape.style.y = y; + } else if (shape.style.y + dy + shape.style.height >= y + height) { + shape.style.y = y + height - shape.style.height; + } else { + shape.style.y += dy; + } + } + if (shape._type == 'filler') { + this._syncHandleShape(); + } else { + this._syncFillerShape(shape); + } + if (this.dataRangeOption.realtime) { + this._dispatchDataRange(); + } + return true; + }, + __ondragend: function () { + this.isDragend = true; + }, + ondragend: function (param, status) { + if (!this.isDragend || !param.target) { + return; + } + status.dragOut = true; + status.dragIn = true; + if (!this.dataRangeOption.realtime) { + this._dispatchDataRange(); + } + status.needRefresh = false; + this.isDragend = false; + return; + }, + _syncShapeFromRange: function () { + var range = this.dataRangeOption.range || {}; + this._range.end = typeof this._range.end != 'undefined' ? this._range.end : typeof range.start != 'undefined' ? range.start : 0; + this._range.start = typeof this._range.start != 'undefined' ? this._range.start : typeof range.end != 'undefined' ? range.end : 100; + if (this._range.start != 100 || this._range.end !== 0) { + if (this.dataRangeOption.orient == 'horizontal') { + var width = this._fillerShape.style.width; + this._fillerShape.style.x += width * (100 - this._range.start) / 100; + this._fillerShape.style.width = width * (this._range.start - this._range.end) / 100; + } else { + var height = this._fillerShape.style.height; + this._fillerShape.style.y += height * (100 - this._range.start) / 100; + this._fillerShape.style.height = height * (this._range.start - this._range.end) / 100; + } + this.zr.modShape(this._fillerShape.id); + this._syncHandleShape(); + } + }, + _syncHandleShape: function () { + var x = this._calculableLocation.x; + var y = this._calculableLocation.y; + var width = this._calculableLocation.width; + var height = this._calculableLocation.height; + if (this.dataRangeOption.orient == 'horizontal') { + this._startShape.style.x = this._fillerShape.style.x; + this._startMask.style.width = this._startShape.style.x - x; + this._endShape.style.x = this._fillerShape.style.x + this._fillerShape.style.width; + this._endMask.style.x = this._endShape.style.x; + this._endMask.style.width = x + width - this._endShape.style.x; + this._range.start = Math.ceil(100 - (this._startShape.style.x - x) / width * 100); + this._range.end = Math.floor(100 - (this._endShape.style.x - x) / width * 100); + } else { + this._startShape.style.y = this._fillerShape.style.y; + this._startMask.style.height = this._startShape.style.y - y; + this._endShape.style.y = this._fillerShape.style.y + this._fillerShape.style.height; + this._endMask.style.y = this._endShape.style.y; + this._endMask.style.height = y + height - this._endShape.style.y; + this._range.start = Math.ceil(100 - (this._startShape.style.y - y) / height * 100); + this._range.end = Math.floor(100 - (this._endShape.style.y - y) / height * 100); + } + this._syncShape(); + }, + _syncFillerShape: function (e) { + var x = this._calculableLocation.x; + var y = this._calculableLocation.y; + var width = this._calculableLocation.width; + var height = this._calculableLocation.height; + var a; + var b; + if (this.dataRangeOption.orient == 'horizontal') { + a = this._startShape.style.x; + b = this._endShape.style.x; + if (e.id == this._startShape.id && a >= b) { + b = a; + this._endShape.style.x = a; + } else if (e.id == this._endShape.id && a >= b) { + a = b; + this._startShape.style.x = a; + } + this._fillerShape.style.x = a; + this._fillerShape.style.width = b - a; + this._startMask.style.width = a - x; + this._endMask.style.x = b; + this._endMask.style.width = x + width - b; + this._range.start = Math.ceil(100 - (a - x) / width * 100); + this._range.end = Math.floor(100 - (b - x) / width * 100); + } else { + a = this._startShape.style.y; + b = this._endShape.style.y; + if (e.id == this._startShape.id && a >= b) { + b = a; + this._endShape.style.y = a; + } else if (e.id == this._endShape.id && a >= b) { + a = b; + this._startShape.style.y = a; + } + this._fillerShape.style.y = a; + this._fillerShape.style.height = b - a; + this._startMask.style.height = a - y; + this._endMask.style.y = b; + this._endMask.style.height = y + height - b; + this._range.start = Math.ceil(100 - (a - y) / height * 100); + this._range.end = Math.floor(100 - (b - y) / height * 100); + } + this._syncShape(); + }, + _syncShape: function () { + this._startShape.position = [ + this._startShape.style.x - this._startShape.style._x, + this._startShape.style.y - this._startShape.style._y + ]; + this._startShape.style.text = this._textFormat(this._gap * this._range.start + this.dataRangeOption.min); + this._startShape.style.color = this._startShape.highlightStyle.strokeColor = this.getColor(this._gap * this._range.start + this.dataRangeOption.min); + this._endShape.position = [ + this._endShape.style.x - this._endShape.style._x, + this._endShape.style.y - this._endShape.style._y + ]; + this._endShape.style.text = this._textFormat(this._gap * this._range.end + this.dataRangeOption.min); + this._endShape.style.color = this._endShape.highlightStyle.strokeColor = this.getColor(this._gap * this._range.end + this.dataRangeOption.min); + this.zr.modShape(this._startShape.id); + this.zr.modShape(this._endShape.id); + this.zr.modShape(this._startMask.id); + this.zr.modShape(this._endMask.id); + this.zr.modShape(this._fillerShape.id); + this.zr.refreshNextFrame(); + }, + _dispatchDataRange: function () { + this.messageCenter.dispatch(ecConfig.EVENT.DATA_RANGE, null, { + range: { + start: this._range.end, + end: this._range.start + } + }, this.myChart); + }, + __dataRangeSelected: function (param) { + if (this.dataRangeOption.selectedMode === 'single') { + for (var k in this._selectedMap) { + this._selectedMap[k] = false; + } + } + var idx = param.target._idx; + this._selectedMap[idx] = !this._selectedMap[idx]; + var valueMax = (this._colorList.length - idx) * this._gap + this.dataRangeOption.min; + this.messageCenter.dispatch(ecConfig.EVENT.DATA_RANGE_SELECTED, param.event, { + selected: this._selectedMap, + target: idx, + valueMax: valueMax, + valueMin: valueMax - this._gap + }, this.myChart); + this.messageCenter.dispatch(ecConfig.EVENT.REFRESH, null, null, this.myChart); + }, + __dispatchHoverLink: function (param) { + var valueMin; + var valueMax; + if (this.dataRangeOption.calculable) { + var totalValue = this.dataRangeOption.max - this.dataRangeOption.min; + var curValue; + if (this.dataRangeOption.orient == 'horizontal') { + curValue = (1 - (zrEvent.getX(param.event) - this._calculableLocation.x) / this._calculableLocation.width) * totalValue; + } else { + curValue = (1 - (zrEvent.getY(param.event) - this._calculableLocation.y) / this._calculableLocation.height) * totalValue; + } + valueMin = curValue - totalValue * 0.05; + valueMax = curValue + totalValue * 0.05; + } else { + var idx = param.target._idx; + valueMax = (this._colorList.length - idx) * this._gap + this.dataRangeOption.min; + valueMin = valueMax - this._gap; + } + this.messageCenter.dispatch(ecConfig.EVENT.DATA_RANGE_HOVERLINK, param.event, { + valueMin: valueMin, + valueMax: valueMax + }, this.myChart); + return; + }, + __onhoverlink: function (param) { + if (this.dataRangeOption.show && this.dataRangeOption.hoverLink && this._indicatorShape && param && param.seriesIndex != null && param.dataIndex != null) { + var curValue = param.value; + if (curValue === '' || isNaN(curValue)) { + return; + } + if (curValue < this.dataRangeOption.min) { + curValue = this.dataRangeOption.min; + } else if (curValue > this.dataRangeOption.max) { + curValue = this.dataRangeOption.max; + } + if (this.dataRangeOption.orient == 'horizontal') { + this._indicatorShape.position = [ + (this.dataRangeOption.max - curValue) / (this.dataRangeOption.max - this.dataRangeOption.min) * this._calculableLocation.width, + 0 + ]; + } else { + this._indicatorShape.position = [ + 0, + (this.dataRangeOption.max - curValue) / (this.dataRangeOption.max - this.dataRangeOption.min) * this._calculableLocation.height + ]; + } + this._indicatorShape.style.text = this._textFormat(param.value); + this._indicatorShape.style.color = this.getColor(curValue); + this.zr.addHoverShape(this._indicatorShape); + } + }, + _textFormat: function (valueStart, valueEnd) { + valueStart = valueStart.toFixed(this.dataRangeOption.precision); + valueEnd = valueEnd != null ? valueEnd.toFixed(this.dataRangeOption.precision) : ''; + if (this.dataRangeOption.formatter) { + if (typeof this.dataRangeOption.formatter == 'string') { + return this.dataRangeOption.formatter.replace('{value}', valueStart).replace('{value2}', valueEnd); + } else if (typeof this.dataRangeOption.formatter == 'function') { + return this.dataRangeOption.formatter.call(this.myChart, valueStart, valueEnd); + } + } + if (valueEnd !== '') { + return valueStart + ' - ' + valueEnd; + } + return valueStart; + }, + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.option.dataRange = this.reformOption(this.option.dataRange); + this.dataRangeOption = this.option.dataRange; + if (!this.myChart.canvasSupported) { + this.dataRangeOption.realtime = false; + } + var splitNumber = this.dataRangeOption.splitNumber <= 0 || this.dataRangeOption.calculable ? 100 : this.dataRangeOption.splitNumber; + this._colorList = zrColor.getGradientColors(this.dataRangeOption.color, Math.max((splitNumber - this.dataRangeOption.color.length) / (this.dataRangeOption.color.length - 1), 0) + 1); + if (this._colorList.length > splitNumber) { + var len = this._colorList.length; + var newColorList = [this._colorList[0]]; + var step = len / (splitNumber - 1); + for (var i = 1; i < splitNumber - 1; i++) { + newColorList.push(this._colorList[Math.floor(i * step)]); + } + newColorList.push(this._colorList[len - 1]); + this._colorList = newColorList; + } + var precision = this.dataRangeOption.precision; + this._gap = (this.dataRangeOption.max - this.dataRangeOption.min) / splitNumber; + while (this._gap.toFixed(precision) - 0 != this._gap && precision < 5) { + precision++; + } + this.dataRangeOption.precision = precision; + this._gap = ((this.dataRangeOption.max - this.dataRangeOption.min) / splitNumber).toFixed(precision) - 0; + this._valueTextList = []; + for (var i = 0; i < splitNumber; i++) { + this._selectedMap[i] = true; + this._valueTextList.unshift(this._textFormat(i * this._gap + this.dataRangeOption.min, (i + 1) * this._gap + this.dataRangeOption.min)); + } + } + this.clear(); + this._buildShape(); + }, + getColor: function (value) { + if (isNaN(value)) { + return null; + } + if (this.dataRangeOption.min == this.dataRangeOption.max) { + return this._colorList[0]; + } + if (value < this.dataRangeOption.min) { + value = this.dataRangeOption.min; + } else if (value > this.dataRangeOption.max) { + value = this.dataRangeOption.max; + } + if (this.dataRangeOption.calculable) { + if (value - (this._gap * this._range.start + this.dataRangeOption.min) > 0.00005 || value - (this._gap * this._range.end + this.dataRangeOption.min) < -0.00005) { + return null; + } + } + var idx = this._colorList.length - Math.ceil((value - this.dataRangeOption.min) / (this.dataRangeOption.max - this.dataRangeOption.min) * this._colorList.length); + if (idx == this._colorList.length) { + idx--; + } + if (this._selectedMap[idx]) { + return this._colorList[idx]; + } else { + return null; + } + }, + getColorByIndex: function (idx) { + if (idx >= this._colorList.length) { + idx = this._colorList.length - 1; + } else if (idx < 0) { + idx = 0; + } + return this._colorList[idx]; + }, + onbeforDispose: function () { + this.messageCenter.unbind(ecConfig.EVENT.HOVER, this._onhoverlink); + } + }; + zrUtil.inherits(DataRange, Base); + require('../component').define('dataRange', DataRange); + return DataRange; +});define('echarts/component/roamController', [ + 'require', + './base', + 'zrender/shape/Rectangle', + 'zrender/shape/Sector', + 'zrender/shape/Circle', + '../config', + 'zrender/tool/util', + 'zrender/tool/color', + 'zrender/tool/event', + '../component' +], function (require) { + var Base = require('./base'); + var RectangleShape = require('zrender/shape/Rectangle'); + var SectorShape = require('zrender/shape/Sector'); + var CircleShape = require('zrender/shape/Circle'); + var ecConfig = require('../config'); + ecConfig.roamController = { + zlevel: 0, + z: 4, + show: true, + x: 'left', + y: 'top', + width: 80, + height: 120, + backgroundColor: 'rgba(0,0,0,0)', + borderColor: '#ccc', + borderWidth: 0, + padding: 5, + handleColor: '#6495ed', + fillerColor: '#fff', + step: 15, + mapTypeControl: null + }; + var zrUtil = require('zrender/tool/util'); + var zrColor = require('zrender/tool/color'); + var zrEvent = require('zrender/tool/event'); + function RoamController(ecTheme, messageCenter, zr, option, myChart) { + if (!option.roamController || !option.roamController.show) { + return; + } + if (!option.roamController.mapTypeControl) { + console.error('option.roamController.mapTypeControl has not been defined.'); + return; + } + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + this.rcOption = option.roamController; + var self = this; + this._drictionMouseDown = function (params) { + return self.__drictionMouseDown(params); + }; + this._drictionMouseUp = function (params) { + return self.__drictionMouseUp(params); + }; + this._drictionMouseMove = function (params) { + return self.__drictionMouseMove(params); + }; + this._drictionMouseOut = function (params) { + return self.__drictionMouseOut(params); + }; + this._scaleHandler = function (params) { + return self.__scaleHandler(params); + }; + this.refresh(option); + } + RoamController.prototype = { + type: ecConfig.COMPONENT_TYPE_ROAMCONTROLLER, + _buildShape: function () { + if (!this.rcOption.show) { + return; + } + this._itemGroupLocation = this._getItemGroupLocation(); + this._buildBackground(); + this._buildItem(); + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + }, + _buildItem: function () { + this.shapeList.push(this._getDirectionShape('up')); + this.shapeList.push(this._getDirectionShape('down')); + this.shapeList.push(this._getDirectionShape('left')); + this.shapeList.push(this._getDirectionShape('right')); + this.shapeList.push(this._getScaleShape('scaleUp')); + this.shapeList.push(this._getScaleShape('scaleDown')); + }, + _getDirectionShape: function (direction) { + var r = this._itemGroupLocation.r; + var x = this._itemGroupLocation.x + r; + var y = this._itemGroupLocation.y + r; + var sectorShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: x, + y: y, + r: r, + startAngle: -45, + endAngle: 45, + color: this.rcOption.handleColor, + text: '>', + textX: x + r / 2 + 4, + textY: y - 0.5, + textAlign: 'center', + textBaseline: 'middle', + textPosition: 'specific', + textColor: this.rcOption.fillerColor, + textFont: Math.floor(r / 2) + 'px arial' + }, + highlightStyle: { + color: zrColor.lift(this.rcOption.handleColor, -0.2), + brushType: 'fill' + }, + clickable: true + }; + switch (direction) { + case 'up': + sectorShape.rotation = [ + Math.PI / 2, + x, + y + ]; + break; + case 'left': + sectorShape.rotation = [ + Math.PI, + x, + y + ]; + break; + case 'down': + sectorShape.rotation = [ + -Math.PI / 2, + x, + y + ]; + break; + } + sectorShape = new SectorShape(sectorShape); + sectorShape._roamType = direction; + sectorShape.onmousedown = this._drictionMouseDown; + sectorShape.onmouseup = this._drictionMouseUp; + sectorShape.onmousemove = this._drictionMouseMove; + sectorShape.onmouseout = this._drictionMouseOut; + return sectorShape; + }, + _getScaleShape: function (text) { + var width = this._itemGroupLocation.width; + var height = this._itemGroupLocation.height - width; + height = height < 0 ? 20 : height; + var r = Math.min(width / 2 - 5, height) / 2; + var x = this._itemGroupLocation.x + (text === 'scaleDown' ? width - r : r); + var y = this._itemGroupLocation.y + this._itemGroupLocation.height - r; + var scaleShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: x, + y: y, + r: r, + color: this.rcOption.handleColor, + text: text === 'scaleDown' ? '-' : '+', + textX: x, + textY: y - 2, + textAlign: 'center', + textBaseline: 'middle', + textPosition: 'specific', + textColor: this.rcOption.fillerColor, + textFont: Math.floor(r) + 'px verdana' + }, + highlightStyle: { + color: zrColor.lift(this.rcOption.handleColor, -0.2), + brushType: 'fill' + }, + clickable: true + }; + scaleShape = new CircleShape(scaleShape); + scaleShape._roamType = text; + scaleShape.onmousedown = this._scaleHandler; + return scaleShape; + }, + _buildBackground: function () { + var padding = this.reformCssArray(this.rcOption.padding); + this.shapeList.push(new RectangleShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: this._itemGroupLocation.x - padding[3], + y: this._itemGroupLocation.y - padding[0], + width: this._itemGroupLocation.width + padding[3] + padding[1], + height: this._itemGroupLocation.height + padding[0] + padding[2], + brushType: this.rcOption.borderWidth === 0 ? 'fill' : 'both', + color: this.rcOption.backgroundColor, + strokeColor: this.rcOption.borderColor, + lineWidth: this.rcOption.borderWidth + } + })); + }, + _getItemGroupLocation: function () { + var padding = this.reformCssArray(this.rcOption.padding); + var width = this.rcOption.width; + var height = this.rcOption.height; + var zrWidth = this.zr.getWidth(); + var zrHeight = this.zr.getHeight(); + var x; + switch (this.rcOption.x) { + case 'center': + x = Math.floor((zrWidth - width) / 2); + break; + case 'left': + x = padding[3] + this.rcOption.borderWidth; + break; + case 'right': + x = zrWidth - width - padding[1] - padding[3] - this.rcOption.borderWidth * 2; + break; + default: + x = this.parsePercent(this.rcOption.x, zrWidth); + break; + } + var y; + switch (this.rcOption.y) { + case 'top': + y = padding[0] + this.rcOption.borderWidth; + break; + case 'bottom': + y = zrHeight - height - padding[0] - padding[2] - this.rcOption.borderWidth * 2; + break; + case 'center': + y = Math.floor((zrHeight - height) / 2); + break; + default: + y = this.parsePercent(this.rcOption.y, zrHeight); + break; + } + return { + x: x, + y: y, + r: width / 2, + width: width, + height: height + }; + }, + __drictionMouseDown: function (params) { + this.mousedown = true; + this._drictionHandlerOn(params); + }, + __drictionMouseUp: function (params) { + this.mousedown = false; + this._drictionHandlerOff(params); + }, + __drictionMouseMove: function (params) { + if (this.mousedown) { + this._drictionHandlerOn(params); + } + }, + __drictionMouseOut: function (params) { + this._drictionHandlerOff(params); + }, + _drictionHandlerOn: function (params) { + this._dispatchEvent(params.event, params.target._roamType); + clearInterval(this.dircetionTimer); + var self = this; + this.dircetionTimer = setInterval(function () { + self._dispatchEvent(params.event, params.target._roamType); + }, 100); + zrEvent.stop(params.event); + }, + _drictionHandlerOff: function (params) { + clearInterval(this.dircetionTimer); + }, + __scaleHandler: function (params) { + this._dispatchEvent(params.event, params.target._roamType); + zrEvent.stop(params.event); + }, + _dispatchEvent: function (event, roamType) { + this.messageCenter.dispatch(ecConfig.EVENT.ROAMCONTROLLER, event, { + roamType: roamType, + mapTypeControl: this.rcOption.mapTypeControl, + step: this.rcOption.step + }, this.myChart); + }, + refresh: function (newOption) { + if (newOption) { + this.option = newOption || this.option; + this.option.roamController = this.reformOption(this.option.roamController); + this.rcOption = this.option.roamController; + } + this.clear(); + this._buildShape(); + } + }; + zrUtil.inherits(RoamController, Base); + require('../component').define('roamController', RoamController); + return RoamController; +});define('echarts/util/mapData/params', ['require'], function (require) { + function decode(json) { + if (!json.UTF8Encoding) { + return json; + } + var features = json.features; + for (var f = 0; f < features.length; f++) { + var feature = features[f]; + var coordinates = feature.geometry.coordinates; + var encodeOffsets = feature.geometry.encodeOffsets; + for (var c = 0; c < coordinates.length; c++) { + var coordinate = coordinates[c]; + if (feature.geometry.type === 'Polygon') { + coordinates[c] = decodePolygon(coordinate, encodeOffsets[c]); + } else if (feature.geometry.type === 'MultiPolygon') { + for (var c2 = 0; c2 < coordinate.length; c2++) { + var polygon = coordinate[c2]; + coordinate[c2] = decodePolygon(polygon, encodeOffsets[c][c2]); + } + } + } + } + json.UTF8Encoding = false; + return json; + } + function decodePolygon(coordinate, encodeOffsets) { + var result = []; + var prevX = encodeOffsets[0]; + var prevY = encodeOffsets[1]; + for (var i = 0; i < coordinate.length; i += 2) { + var x = coordinate.charCodeAt(i) - 64; + var y = coordinate.charCodeAt(i + 1) - 64; + x = x >> 1 ^ -(x & 1); + y = y >> 1 ^ -(y & 1); + x += prevX; + y += prevY; + prevX = x; + prevY = y; + result.push([ + x / 1024, + y / 1024 + ]); + } + return result; + } + var mapParams = { + 'none': { + getGeoJson: function (callback) { + callback({ + type: 'FeatureCollection', + features: [{ + type: 'Feature', + geometry: { + coordinates: [], + encodeOffsets: [], + type: 'Polygon' + }, + properties: {} + }] + }); + } + }, + 'world': { + getGeoJson: function (callback) { + require(['./geoJson/world_geo'], function (md) { + callback(decode(md)); + }); + } + }, + 'china': { + getGeoJson: function (callback) { + require(['./geoJson/china_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '南海诸岛': { + textCoord: [ + 126, + 25 + ], + getPath: function (leftTop, scale) { + var pList = [ + [ + [ + 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 + ] + ] + ]; + var str = ''; + var left = leftTop[0]; + var top = leftTop[1]; + for (var i = 0, l = pList.length; i < l; i++) { + str += 'M ' + ((pList[i][0][0] * scale + left).toFixed(2) - 0) + ' ' + ((pList[i][0][1] * scale + top).toFixed(2) - 0) + ' '; + for (var j = 1, k = pList[i].length; j < k; j++) { + str += 'L ' + ((pList[i][j][0] * scale + left).toFixed(2) - 0) + ' ' + ((pList[i][j][1] * scale + top).toFixed(2) - 0) + ' '; + } + } + return str + ' Z'; + } + }, + '新疆': { + getGeoJson: function (callback) { + require(['./geoJson/xin_jiang_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '西藏': { + getGeoJson: function (callback) { + require(['./geoJson/xi_zang_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '内蒙古': { + getGeoJson: function (callback) { + require(['./geoJson/nei_meng_gu_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '青海': { + getGeoJson: function (callback) { + require(['./geoJson/qing_hai_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '四川': { + getGeoJson: function (callback) { + require(['./geoJson/si_chuan_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '黑龙江': { + getGeoJson: function (callback) { + require(['./geoJson/hei_long_jiang_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '甘肃': { + getGeoJson: function (callback) { + require(['./geoJson/gan_su_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '云南': { + getGeoJson: function (callback) { + require(['./geoJson/yun_nan_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '广西': { + getGeoJson: function (callback) { + require(['./geoJson/guang_xi_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '湖南': { + getGeoJson: function (callback) { + require(['./geoJson/hu_nan_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '陕西': { + getGeoJson: function (callback) { + require(['./geoJson/shan_xi_1_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '广东': { + getGeoJson: function (callback) { + require(['./geoJson/guang_dong_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '吉林': { + getGeoJson: function (callback) { + require(['./geoJson/ji_lin_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '河北': { + getGeoJson: function (callback) { + require(['./geoJson/he_bei_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '湖北': { + getGeoJson: function (callback) { + require(['./geoJson/hu_bei_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '贵州': { + getGeoJson: function (callback) { + require(['./geoJson/gui_zhou_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '山东': { + getGeoJson: function (callback) { + require(['./geoJson/shan_dong_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '江西': { + getGeoJson: function (callback) { + require(['./geoJson/jiang_xi_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '河南': { + getGeoJson: function (callback) { + require(['./geoJson/he_nan_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '辽宁': { + getGeoJson: function (callback) { + require(['./geoJson/liao_ning_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '山西': { + getGeoJson: function (callback) { + require(['./geoJson/shan_xi_2_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '安徽': { + getGeoJson: function (callback) { + require(['./geoJson/an_hui_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '福建': { + getGeoJson: function (callback) { + require(['./geoJson/fu_jian_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '浙江': { + getGeoJson: function (callback) { + require(['./geoJson/zhe_jiang_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '江苏': { + getGeoJson: function (callback) { + require(['./geoJson/jiang_su_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '重庆': { + getGeoJson: function (callback) { + require(['./geoJson/chong_qing_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '宁夏': { + getGeoJson: function (callback) { + require(['./geoJson/ning_xia_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '海南': { + getGeoJson: function (callback) { + require(['./geoJson/hai_nan_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '台湾': { + getGeoJson: function (callback) { + require(['./geoJson/tai_wan_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '北京': { + getGeoJson: function (callback) { + require(['./geoJson/bei_jing_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '天津': { + getGeoJson: function (callback) { + require(['./geoJson/tian_jin_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '上海': { + getGeoJson: function (callback) { + require(['./geoJson/shang_hai_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '香港': { + getGeoJson: function (callback) { + require(['./geoJson/xiang_gang_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '澳门': { + getGeoJson: function (callback) { + require(['./geoJson/ao_men_geo'], function (md) { + callback(decode(md)); + }); + } + } + }; + return { + decode: decode, + params: mapParams + }; +});define('echarts/util/mapData/textFixed', [], function () { + return { + '广东': [ + 0, + -10 + ], + '香港': [ + 10, + 10 + ], + '澳门': [ + -10, + 18 + ], + '黑龙江': [ + 0, + 20 + ], + '天津': [ + 5, + 5 + ], + '深圳市': [ + -35, + 0 + ], + '红河哈尼族彝族自治州': [ + 0, + 20 + ], + '楚雄彝族自治州': [ + -5, + 15 + ], + '石河子市': [ + -5, + 5 + ], + '五家渠市': [ + 0, + -10 + ], + '昌吉回族自治州': [ + 10, + 10 + ], + '昌江黎族自治县': [ + 0, + 20 + ], + '陵水黎族自治县': [ + 0, + 20 + ], + '东方市': [ + 0, + 20 + ], + '渭南市': [ + 0, + 20 + ] + }; +});define('echarts/util/mapData/geoCoord', [], function () { + return { + 'Russia': [ + 100, + 60 + ], + 'United States of America': [ + -99, + 38 + ] + }; +});define('echarts/util/projection/svg', [ + 'require', + 'zrender/shape/Path' +], function (require) { + var PathShape = require('zrender/shape/Path'); + function toFloat(str) { + return parseFloat(str || 0); + } + function getBbox(root) { + var svgNode = root.firstChild; + while (!(svgNode.nodeName.toLowerCase() == 'svg' && svgNode.nodeType == 1)) { + svgNode = svgNode.nextSibling; + } + var x = toFloat(svgNode.getAttribute('x')); + var y = toFloat(svgNode.getAttribute('y')); + var width = toFloat(svgNode.getAttribute('width')); + var height = toFloat(svgNode.getAttribute('height')); + return { + left: x, + top: y, + width: width, + height: height + }; + } + function geoJson2Path(root, transform) { + var scale = [ + transform.scale.x, + transform.scale.y + ]; + var elList = []; + function _getShape(root) { + var tagName = root.tagName; + if (shapeBuilders[tagName]) { + var obj = shapeBuilders[tagName](root, scale); + if (obj) { + obj.scale = scale; + obj.properties = { name: root.getAttribute('name') || '' }; + obj.id = root.id; + extendCommonAttributes(obj, root); + elList.push(obj); + } + } + var shapes = root.childNodes; + for (var i = 0, len = shapes.length; i < len; i++) { + _getShape(shapes[i]); + } + } + _getShape(root); + return elList; + } + function pos2geo(obj, p) { + var point = p instanceof Array ? [ + p[0] * 1, + p[1] * 1 + ] : [ + p.x * 1, + p.y * 1 + ]; + return [ + point[0] / obj.scale.x, + point[1] / obj.scale.y + ]; + } + function geo2pos(obj, p) { + var point = p instanceof Array ? [ + p[0] * 1, + p[1] * 1 + ] : [ + p.x * 1, + p.y * 1 + ]; + return [ + point[0] * obj.scale.x, + point[1] * obj.scale.y + ]; + } + function trim(str) { + return str.replace(/^\s\s*/, '').replace(/\s\s*$/, ''); + } + function extendCommonAttributes(obj, xmlNode) { + var color = xmlNode.getAttribute('fill'); + var strokeColor = xmlNode.getAttribute('stroke'); + var lineWidth = xmlNode.getAttribute('stroke-width'); + var opacity = xmlNode.getAttribute('opacity'); + if (color && color != 'none') { + obj.color = color; + if (strokeColor) { + obj.brushType = 'both'; + obj.strokeColor = strokeColor; + } else { + obj.brushType = 'fill'; + } + } else if (strokeColor && strokeColor != 'none') { + obj.strokeColor = strokeColor; + obj.brushType = 'stroke'; + } + if (lineWidth && lineWidth != 'none') { + obj.lineWidth = parseFloat(lineWidth); + } + if (opacity && opacity != 'none') { + obj.opacity = parseFloat(opacity); + } + } + function parsePoints(str) { + var list = trim(str).replace(/,/g, ' ').split(/\s+/); + var points = []; + for (var i = 0; i < list.length;) { + var x = parseFloat(list[i++]); + var y = parseFloat(list[i++]); + points.push([ + x, + y + ]); + } + return points; + } + var shapeBuilders = { + path: function (xmlNode, scale) { + var path = xmlNode.getAttribute('d'); + var rect = PathShape.prototype.getRect({ path: path }); + return { + shapeType: 'path', + path: path, + cp: [ + (rect.x + rect.width / 2) * scale[0], + (rect.y + rect.height / 2) * scale[1] + ] + }; + }, + rect: function (xmlNode, scale) { + var x = toFloat(xmlNode.getAttribute('x')); + var y = toFloat(xmlNode.getAttribute('y')); + var width = toFloat(xmlNode.getAttribute('width')); + var height = toFloat(xmlNode.getAttribute('height')); + return { + shapeType: 'rectangle', + x: x, + y: y, + width: width, + height: height, + cp: [ + (x + width / 2) * scale[0], + (y + height / 2) * scale[1] + ] + }; + }, + line: function (xmlNode, scale) { + var x1 = toFloat(xmlNode.getAttribute('x1')); + var y1 = toFloat(xmlNode.getAttribute('y1')); + var x2 = toFloat(xmlNode.getAttribute('x2')); + var y2 = toFloat(xmlNode.getAttribute('y2')); + return { + shapeType: 'line', + xStart: x1, + yStart: y1, + xEnd: x2, + yEnd: y2, + cp: [ + (x1 + x2) * 0.5 * scale[0], + (y1 + y2) * 0.5 * scale[1] + ] + }; + }, + circle: function (xmlNode, scale) { + var cx = toFloat(xmlNode.getAttribute('cx')); + var cy = toFloat(xmlNode.getAttribute('cy')); + var r = toFloat(xmlNode.getAttribute('r')); + return { + shapeType: 'circle', + x: cx, + y: cy, + r: r, + cp: [ + cx * scale[0], + cy * scale[1] + ] + }; + }, + ellipse: function (xmlNode, scale) { + var cx = parseFloat(xmlNode.getAttribute('cx') || 0); + var cy = parseFloat(xmlNode.getAttribute('cy') || 0); + var rx = parseFloat(xmlNode.getAttribute('rx') || 0); + var ry = parseFloat(xmlNode.getAttribute('ry') || 0); + return { + shapeType: 'ellipse', + x: cx, + y: cy, + a: rx, + b: ry, + cp: [ + cx * scale[0], + cy * scale[1] + ] + }; + }, + polygon: function (xmlNode, scale) { + var points = xmlNode.getAttribute('points'); + var min = [ + Infinity, + Infinity + ]; + var max = [ + -Infinity, + -Infinity + ]; + if (points) { + points = parsePoints(points); + for (var i = 0; i < points.length; i++) { + var p = points[i]; + min[0] = Math.min(p[0], min[0]); + min[1] = Math.min(p[1], min[1]); + max[0] = Math.max(p[0], max[0]); + max[1] = Math.max(p[1], max[1]); + } + return { + shapeType: 'polygon', + pointList: points, + cp: [ + (min[0] + max[0]) / 2 * scale[0], + (min[1] + max[1]) / 2 * scale[0] + ] + }; + } + }, + polyline: function (xmlNode, scale) { + var obj = shapeBuilders.polygon(xmlNode, scale); + return obj; + } + }; + return { + getBbox: getBbox, + geoJson2Path: geoJson2Path, + pos2geo: pos2geo, + geo2pos: geo2pos + }; +});define('echarts/util/projection/normal', [], function () { + function getBbox(json, specialArea) { + specialArea = specialArea || {}; + if (!json.srcSize) { + parseSrcSize(json, specialArea); + } + return json.srcSize; + } + function parseSrcSize(json, specialArea) { + specialArea = specialArea || {}; + convertorParse.xmin = 360; + convertorParse.xmax = -360; + convertorParse.ymin = 180; + convertorParse.ymax = -180; + var shapes = json.features; + var geometries; + var shape; + for (var i = 0, len = shapes.length; i < len; i++) { + shape = shapes[i]; + if (shape.properties.name && specialArea[shape.properties.name]) { + continue; + } + switch (shape.type) { + case 'Feature': + convertorParse[shape.geometry.type](shape.geometry.coordinates); + break; + case 'GeometryCollection': + geometries = shape.geometries; + for (var j = 0, len2 = geometries.length; j < len2; j++) { + convertorParse[geometries[j].type](geometries[j].coordinates); + } + break; + } + } + json.srcSize = { + left: convertorParse.xmin.toFixed(4) * 1, + top: convertorParse.ymin.toFixed(4) * 1, + width: (convertorParse.xmax - convertorParse.xmin).toFixed(4) * 1, + height: (convertorParse.ymax - convertorParse.ymin).toFixed(4) * 1 + }; + return json; + } + var convertor = { + formatPoint: function (p) { + return [ + (p[0] < -168.5 && p[1] > 63.8 ? p[0] + 360 : p[0]) + 168.5, + 90 - p[1] + ]; + }, + makePoint: function (p) { + var self = this; + var point = self.formatPoint(p); + if (self._bbox.xmin > p[0]) { + self._bbox.xmin = p[0]; + } + if (self._bbox.xmax < p[0]) { + self._bbox.xmax = p[0]; + } + if (self._bbox.ymin > p[1]) { + self._bbox.ymin = p[1]; + } + if (self._bbox.ymax < p[1]) { + self._bbox.ymax = p[1]; + } + var x = (point[0] - convertor.offset.x) * convertor.scale.x + convertor.offset.left; + var y = (point[1] - convertor.offset.y) * convertor.scale.y + convertor.offset.top; + return [ + x, + y + ]; + }, + Point: function (coordinates) { + coordinates = this.makePoint(coordinates); + return coordinates.join(','); + }, + LineString: function (coordinates) { + var str = ''; + var point; + for (var i = 0, len = coordinates.length; i < len; i++) { + point = convertor.makePoint(coordinates[i]); + if (i === 0) { + str = 'M' + point.join(','); + } else { + str = str + 'L' + point.join(','); + } + } + return str; + }, + Polygon: function (coordinates) { + var str = ''; + for (var i = 0, len = coordinates.length; i < len; i++) { + str = str + convertor.LineString(coordinates[i]) + 'z'; + } + return str; + }, + MultiPoint: function (coordinates) { + var arr = []; + for (var i = 0, len = coordinates.length; i < len; i++) { + arr.push(convertor.Point(coordinates[i])); + } + return arr; + }, + MultiLineString: function (coordinates) { + var str = ''; + for (var i = 0, len = coordinates.length; i < len; i++) { + str += convertor.LineString(coordinates[i]); + } + return str; + }, + MultiPolygon: function (coordinates) { + var str = ''; + for (var i = 0, len = coordinates.length; i < len; i++) { + str += convertor.Polygon(coordinates[i]); + } + return str; + } + }; + var convertorParse = { + formatPoint: convertor.formatPoint, + makePoint: function (p) { + var self = this; + var point = self.formatPoint(p); + var x = point[0]; + var y = point[1]; + if (self.xmin > x) { + self.xmin = x; + } + if (self.xmax < x) { + self.xmax = x; + } + if (self.ymin > y) { + self.ymin = y; + } + if (self.ymax < y) { + self.ymax = y; + } + }, + Point: function (coordinates) { + this.makePoint(coordinates); + }, + LineString: function (coordinates) { + for (var i = 0, len = coordinates.length; i < len; i++) { + this.makePoint(coordinates[i]); + } + }, + Polygon: function (coordinates) { + for (var i = 0, len = coordinates.length; i < len; i++) { + this.LineString(coordinates[i]); + } + }, + MultiPoint: function (coordinates) { + for (var i = 0, len = coordinates.length; i < len; i++) { + this.Point(coordinates[i]); + } + }, + MultiLineString: function (coordinates) { + for (var i = 0, len = coordinates.length; i < len; i++) { + this.LineString(coordinates[i]); + } + }, + MultiPolygon: function (coordinates) { + for (var i = 0, len = coordinates.length; i < len; i++) { + this.Polygon(coordinates[i]); + } + } + }; + function geoJson2Path(json, transform, specialArea) { + specialArea = specialArea || {}; + convertor.scale = null; + convertor.offset = null; + if (!json.srcSize) { + parseSrcSize(json, specialArea); + } + transform.offset = { + x: json.srcSize.left, + y: json.srcSize.top, + left: transform.OffsetLeft || 0, + top: transform.OffsetTop || 0 + }; + convertor.scale = transform.scale; + convertor.offset = transform.offset; + var shapes = json.features; + var geometries; + var pathArray = []; + var val; + var shape; + for (var i = 0, len = shapes.length; i < len; i++) { + shape = shapes[i]; + if (shape.properties.name && specialArea[shape.properties.name]) { + continue; + } + if (shape.type == 'Feature') { + pushApath(shape.geometry, shape); + } else if (shape.type == 'GeometryCollection') { + geometries = shape.geometries; + for (var j = 0, len2 = geometries.length; j < len2; j++) { + val = geometries[j]; + pushApath(val, val); + } + } + } + var shapeType; + var shapeCoordinates; + var str; + function pushApath(gm, shape) { + shapeType = gm.type; + shapeCoordinates = gm.coordinates; + convertor._bbox = { + xmin: 360, + xmax: -360, + ymin: 180, + ymax: -180 + }; + str = convertor[shapeType](shapeCoordinates); + pathArray.push({ + path: str, + cp: shape.properties.cp ? convertor.makePoint(shape.properties.cp) : convertor.makePoint([ + (convertor._bbox.xmin + convertor._bbox.xmax) / 2, + (convertor._bbox.ymin + convertor._bbox.ymax) / 2 + ]), + properties: shape.properties, + id: shape.id + }); + } + return pathArray; + } + function pos2geo(obj, p) { + var x; + var y; + if (p instanceof Array) { + x = p[0] * 1; + y = p[1] * 1; + } else { + x = p.x * 1; + y = p.y * 1; + } + x = x / obj.scale.x + obj.offset.x - 168.5; + x = x > 180 ? x - 360 : x; + y = 90 - (y / obj.scale.y + obj.offset.y); + return [ + x, + y + ]; + } + function geo2pos(obj, p) { + convertor.offset = obj.offset; + convertor.scale = obj.scale; + return p instanceof Array ? convertor.makePoint([ + p[0] * 1, + p[1] * 1 + ]) : convertor.makePoint([ + p.x * 1, + p.y * 1 + ]); + } + return { + getBbox: getBbox, + geoJson2Path: geoJson2Path, + pos2geo: pos2geo, + geo2pos: geo2pos + }; +});define('echarts/util/shape/HandlePolygon', [ + 'require', + 'zrender/shape/Base', + 'zrender/shape/Polygon', + 'zrender/tool/util' +], function (require) { + var Base = require('zrender/shape/Base'); + var PolygonShape = require('zrender/shape/Polygon'); + var zrUtil = require('zrender/tool/util'); + function HandlePolygon(options) { + Base.call(this, options); + } + HandlePolygon.prototype = { + type: 'handle-polygon', + buildPath: function (ctx, style) { + PolygonShape.prototype.buildPath(ctx, style); + }, + isCover: function (x, y) { + var originPos = this.getTansform(x, y); + x = originPos[0]; + y = originPos[1]; + var rect = this.style.rect; + if (x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height) { + return true; + } else { + return false; + } + } + }; + zrUtil.inherits(HandlePolygon, Base); + return HandlePolygon; +});define('echarts/util/mapData/geoJson/an_hui_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '3415', + 'properties': { + 'name': '六安市', + 'cp': [ + 116.3123, + 31.8329 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„„nJ‚UXUVƒ°U„ÑnU@mlLVaVln@@bn@VU@xlb@lšLnKlšƒVI„JšUVxnI@lVL@b„Ž°VX@˜b„x„nVVUnVVnU‚›@kX@VwV@„al¥UUnUWa@ƒ@wĸU„LU¥lKUa@aUI@alLVaUƒ¯anƒWkUKm@XV@VaXlW@aU_UWVUƒI¯@ma¯W¯™™I@UU@WWU@U@@UU@VkV@@WUUm@UaU@„lK@IUK„L@KWmXUWaXI@ƒ@a@a@U@U@KV¥lw„k°b²JVIVKlV@UX„la„Ul`œUVLVVVUšJ„U@Lnm@_VK@KUIW@™J@Xk@WW@U—ƒmm™XmWk@kK@aUUƒVmmkUwUmWL™@WmU@™UJmUULkKWakLWVkIƒlƒwULƒW@X°lUJ@°ULƒWV—wmJ@bmb¯Vkm@@WkWm¯wƒL@lkXƒWmXym¯UImJUbkV™@Vn¯„@V@lUbƒ@mk@maUxmlUbULWn@J—LmKUkWKkwUKƒbm„X„WxkVUKmLkVV@JUUWL@xkJUUƒV@X@VVlUbVX@xk¤šx‚¼œxWxn„‚nn@Þ¼„JVb°aVn„@šmlnXU„JlbVlkz@‚lUŽlXJmxVxXnWxXÈWlUŽ@šUxU@VX@xUL@šUÆmLnV@lWXk@@JlbXblnlJ'], + 'encodeOffsets': [[ + 118710, + 33351 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3408', + 'properties': { + 'name': '安庆市', + 'cp': [ + 116.7517, + 30.5255 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@n°‚znW„XlW@k„K°xXn‚l@Xn@l‚°Una@anI˜xXU„ŽVK@¯VIkW¯X@‚„VK„x„klJXUlKXblLVKnVVIšŽV@Xn‚@šŽXKVnVxlŽnn„UlmV@²óUkV™lW„b„lƒšƒn@VVVIn@lw@WVIXblV„@Èx‚aUaVIVVnKVLšK„ƒln@b²K@»U£ƒÑķƒġÝÅb™K™a@Im@ۍ„@kWÓkkmKÅnóJƒUÅ£›W@w„ĕ@wĉţ¯¯ƒUkK±l¯Uƒ¥UÑkÝUķ»Ý¥¯™JƒIUŽVbUl¯ÈV¼VJU¼Vb@bkLUl@„VJ@bUXǚ@lkVmXmKkLVxš‚Ž„VƒL@VkVVVlzW˜kbmLUUUbVbUV™šlÒnJlUnLllUL@bU„Vx„l‚LXVƦÈVU¦WJ'], + 'encodeOffsets': [[ + 118834, + 31759 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3411', + 'properties': { + 'name': '滁州市', + 'cp': [ + 118.1909, + 32.536 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@š„@`nnl@„xšK@X°KXV˜IXVlbXVWnX‚lL@šÈ»‚LVan@VJ„êVVn@‚X@laÞbVaƒyn@„_‚xnWVXnWl@VnUVkI@l‚nXKVLVV@V@kW@LlVô„@J@bVnnKnkVa@»lç@ƒnwšKma™UUUVњ@n™mWXalI@alVn@VwUaVU„@„nlaôJnU„VVXlJšaXXVK@UšV@VWx@nXVWšXVšUlLUbV‚ULVVnUVbUbVbš@@a„KÆnnKVK@U@UU@@a„@Vƒ°¯ÈJVIlķ@aa˜UaVKU_@mkxUI@aƒUlyU@@™wkKWmUbUnUVWbkJW_J@bƒn@Vm@@KULk@V@@bVbÅm@LW@UVVbkK@UkKWL@VULUKWIUJUbkK@_WVXU›Jka@XƒVa@kšy@aVIUUW@@m„UlLœKWÑUKVan@UkVmmIXKƒaVaUwVU@UmykU¯@±UUL@WUIVUU@KkIWaƒaU@kUUaǃUó»mKƒk¯@y@kWK@bkI¯`mn™l¯XWlkVUzUJlbUbVJl@nnm„@VULV`XnWƗbmUUn™JmUknƒJ¯km@ƒyk@kU›xL@VUbmnn¤lX@`™z@JmaULUVl@Xn@xllkXWa—aW@UVmUbƒ@mVXšWxXbWbUŽƒÒnVVnVVUL'], + 'encodeOffsets': [[ + 120004, + 33520 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3418', + 'properties': { + 'name': '宣城市', + 'cp': [ + 118.8062, + 30.6244 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Vb@„XL˜JXxlIXxlVlV@I²¤šnlUnVšU@VULWVUJ@Lnb@lV@UnV@@VVVlLnbnJ‚UVkUUVWn@@anUVnVJVIV‚@@nUJVbUb‚„@VUbVK@bn@VbnIlxkllXVlXKWUXUlL°¤UVVb@bš„UlkXW‚ƒxXz@‚„Ila„UlƒnUlJVInVÆJ„U„LVUnV„K°@VnlVnxV@XLlK@wVL@KnUlJXU˜bnKVLX„lUw@VWlLXKm@@a„@VLnmlIVVnKn@škVašVlwk@@a@k@ƒVIUa™@maUa@wna@kmWƒ™UUmVUIVǗ@aƒKm™aƒ™kU™J@InmUUaVa„k‚lX@Vk@m@VU@wnK@alKVUkUkKƒbmUkmƒ@U£WVk@@UÝbbƒaÇx@b@WVUa¯ƒ@wVwUUV@VwnK@KWaŁ@KšIUyUI@WmXó™UbWaKm™@km@IUyƒIUaWKƒx@zUKUL@llVUnkLVVkJWX@VUKUVƒIkVWakb@VWb@n@JkXUlmL@xkL@`VxšLUÈUJ@Vm@@bmIUlUL@VUVVbknm@mKUw™KVÈ@J@LV±kkJUIƒl'], + 'encodeOffsets': [[ + 120803, + 31247 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3412', + 'properties': { + 'name': '阜阳市', + 'cp': [ + 115.7629, + 32.9919 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@V™nƒš@ša„k°aš±@‚¥@UUI@aUmlwUUx›b@¥XU@mmI@a@Kn@@_W@@W„I@mšUVVXUl@XaV@‚K@I@a„LX@aVI°K@KVL„UUw‚yXkšK@kšKÆbXnlK@k@a„JlU@w@U@»@aXKWƒn_‚JXkVKnƒ@°LlKXƒW@¯Uƒ@aUK@kmJUw™VƒIUJ™„kŽmL™K@kka@wUVm@@am@UkUbkK@nmVƒÒ¯VU„WVVmIƒƒULk@ƒƒma@kkKƒƒ@nUbUamU™`UUVUkKVkkƒW@@bkmƒnƒmUXVKXVƒL@VƒbU„m‚™bVXJ@nmKÅI@KWKUXVJUL@VUKUX@KUKWL@LUJmaXXm@kVVV@L@VUL@VlK@L@V@LUK@VUb@UUU@°@nVxU`‚Lkn@`@XVJ@X™Vm„k@UKmV¯LVVn±Wm@Ub@JlLUl„@VLk„@lmVVn@bnV@V°IV™šaVJXI°K°V@XXVlVVU„nšKVlUš„bWXnV@bV`U„„@@m@@‚ƒ@nxmn@bXVlL@¤nb„Ul¦šVVUnJVU„Vl@@bÞL'], + 'encodeOffsets': [[ + 118418, + 34392 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3413', + 'properties': { + 'name': '宿州市', + 'cp': [ + 117.5208, + 33.6841 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@UWU@bkW@aWU@aUIkWV™lLXb„lVIUVV@‚mn@V_n@VaUK@I‚@UašanJVU„@lV„UVnnKVVlaUa„I@wnK‚Lnll@nVlk@wVKXkl@@b„bUJ@V‚U@U„UUyVk@aVUXwlWXX‚WU¹@aU™@WUI@mlUšn„J@Il@šaXbV@VKl@XxVL@W„IšJlb„@„al@„IUUm@@aVK@¥¯—@mUķ¯bWƒk£Vm@akm@VaÅ@UVWaƒ@UJWkƒJ—UƒbWbU@UlƒXk@ƒamV@K¯nk@ƒlU@Uxmz@bU`ÇbUbÅVm£U@Ww™x@akLUK@UlakwUJWVkLmaUal@n_ƒmVUnKVUUmÅXWa™@kJmx@XUJ@bVLXxl@VVUVV„UbkLWbU@@lUVV„VVX„›K@XkJ@nU@@bV@VxUVlb„U@xXLWŽn@UxVbVĊ„V@b@XV`mnkJ@kUKmbƒaU@VbnbÆx@XU@@`k@@bl„™@@bkL@WƒakXWaU@Vmkx@XWW@@wUUUbƒJ™U¯V™@¯ÞU@WxXŽlL@bkb@ŽlVlnb™JW@kkU@mbkaWJ—IVlmz¯`UnU@mb™@@„ƒ`@bkVlœnV@b@šV@„aVxn@Vx‚KXnl@nbVK„bVK@a„_V@Vƒ„w@W„LlwnK@UmIU@VWš@šUÈ@lKnal„wš@@V°@šaUmlUUw@„ƒV@@UXK'], + 'encodeOffsets': [[ + 119836, + 35061 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3410', + 'properties': { + 'name': '黄山市', + 'cp': [ + 118.0481, + 29.9542 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lXnlWX@VUJVnUJVzXJVx„kVJlI²l‚U@K@IUǚLVxnLn@lmUaVU@UVKVknJ@an@@UVIVǙKUw@_lK@wnKVklW@I@mXa@UlaXblU„JVUVL@UXWlIUUlKVmkU@kVKVL@y„wXLVb„JVz@Jlnš@nŽ‚LXbVaôšnW@la@UVWUa@@a@mk@WIk@VwUa¯¥m@UUVK@ImK@aX£ƒkK›ÅV™a™™ƒ_@±ƒakXWW—LƒƒƒnU@@a@¯mK@L™JUWwUV™VmbXX@lWLn`mzUJUb™Lƒ„k@makVWmkX™ambkKknƒaƒ@ƒaƒb@‚U@Unm@—ƒWVƒ@VbUbUJWIk@@lmL@°UVUVm„nš™@@kmWkb@xƒ_m@@aU@b@JlŽUz™lWxXn„@‚b²@l`„IVl„UlL@VšK„nVbUl@VlIn@@b„bVWUk‚@@bX@Valb@bnb°Vn@„xVKlbVnV@V‚x„L@ln@UXVV‚L˜'], + 'encodeOffsets': [[ + 120747, + 31095 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3414', + 'properties': { + 'name': '巢湖市', + 'cp': [ + 117.7734, + 31.4978 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VV@blL@ŽXlWnnšnŽ˜„@VXXl@@WšIX@VJ@LšxŎxlnšŽ@bXJVblX@VVbUVn@VbUVlb@LnJVbVLV‚XLšÒVL„ÒšV„bVIVylUXk°Wšknm°_lJ@aXL@l‚z°@„lnLô¼V‚È„VUUaVKU@WW@@UUa@knmVLlaV@„a@kšak±@UmwkKmk™lj™ÝUUkL@mlIVmnÝWkkUÝ@KƑĉ™a@»ƒmma@mX™¤¯Uƒw@ƒ@UU@bU±±L@akmƒ„™LUKmLUUUJVbbÇwƒ@kUWaUJ@Xkxm@UJUUm@™„k„ƒ‚ƒakXUšVl±ôU@kn'], + 'encodeOffsets': [[ + 119847, + 32007 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3416', + 'properties': { + 'name': '亳州市', + 'cp': [ + 116.1914, + 33.4698 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lU@Un@@anUlw@KVmUwlaX_lKna@KU@@kWKUU@ankW™XK˜@@V²VVIÈU@al@VaÈamK@wU™@klaUƒV@XƒVUU»WUUbkmUkVmk@aÈw@mWU@VkIkVWKUÑķXȭºU¯lƒ@kkLWmÅa™L@l™LWlzVxƒVUK@L¯LUJ@bWƒK@b@JLU@Wbk@WVUU™V@nƒJ@XX@@`m@@L@bnJ@nWV@¦œa‚wVVkxVn@bVJ@V¦@Ž™²¯bƒl™b™@m„UšUŽƒŽ@¼ƒ¦Xb‚UV`@nnxUxWLkUkVWKkV@XV@@VVL@VX„@lVV@L@blL@`šL@xXKVL‚@„VnUš@lwnU@ml@XnV@@UVW°LnalƒUI@aUK@a‚a@U„kXW@I@mWL@UXK@UVW@U‚@@k„Wn‚@@V„@XblaVxšL@bVKXb„IlJ'], + 'encodeOffsets': [[ + 119183, + 34594 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3417', + 'properties': { + 'name': '池州市', + 'cp': [ + 117.3889, + 30.2014 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': [ + '@@„V°°ĊŤ@xƒĖ@xœXƤ„VôIÆmnLllXÔ@lƒÜŽn@@JšbšLÆaĢÞĸ„°VVUUKVanK@UV@VL„VVn„ln@‚xnklxXamk@WV@Xa˜@naVk„Klk™@mkUWwkJWw—IWK@ƒUaUwWIUyVIUmVI@UXWmkkW‚—KUUVWm@@kƒKw@U‚UUmkaULƒwm@¯Uma@akaUbW@@a@VlUXƒa@am@kJ@UVkUaƒm™L@UkKƒVUkƒJk_±@aƒ@WmXwÇkkaVaUa±ƒœwV@VkƒwnyUaW@UU¯amLk@m™@kmmU™™¯K@L@lUX¯ƒWlkXƒŽVb„bƒVUL@J@LVKnlJXnlb@`nXlalV@bnL@Vnb˜¼@lXbWlkL™K@zUJmIUxUVUVmX', + '@@llUL@VlxšL@a@UƒwXa¯@' + ], + 'encodeOffsets': [ + [ + 119543, + 30781 + ], + [ + 120061, + 31152 + ] + ] + } + }, + { + 'type': 'Feature', + 'id': '3401', + 'properties': { + 'name': '合肥市', + 'cp': [ + 117.29, + 32.0581 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„L„xV‚ĊLÞkšVlVVXaWaXwW™nU„@‚anVVUX@˜bXblWkk@wWmk@VUVKnb@Išy@_kWm£nmVa@U‚KœwlVl@„zn@°l„IlmnVšIVmnV˜aXÅWmU_VK@Unƒmmk@UIVakaƒa™UƒÑUK™ÑWKUUKUamI@KkaVUUam@VUUa@UkWUaWI@a™kmōw™wUL@`mn@KƒV™IUVUUUK›Vk_ƒVkbWƒ@VkUULUJ±I¯aƒlkxU¦@L@V@V@b@b@„WJXbWVXn@LƒKVL@JkLƒŽV@Vbn@VV@XU@UlV@@VV@V@XXV@@VšJ°š°Xnb°@„JUVVXV`@bkXWŽUbU@WŽn@VLXlm„°bV„UbkK@bVJ@bVbkLV¦ƒKķV@x@„XbmVVVk¦'], + 'encodeOffsets': [[ + 119678, + 33323 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3403', + 'properties': { + 'name': '蚌埠市', + 'cp': [ + 117.4109, + 33.1073 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VÒXLlUlJ@UXV@nÇx@bnlUVllnVaXVV¼UVW„U@V„²wVV@Vl@„VnwlIš@XbÆWVnUVmLUV„nm`k@VbnblKXUVIlxkb@VVLlK@bšwXxV@n¤ÆUVaÈaV_@anyVwV@„kl@°m@LnU„bl@„WVkV@Xa„a˜V„IXl‚IV‚„@XbVUÆ@XKWwUkmW@_UmnIlJXkWKXmV@‚w@_XV@Kl@kU@KlX@@UUUUKWLm@klJVUUmk@mXUWmXwƒ`m@„zUbÝakbW@m@UUƒéUIm@UbKǼ@™kKWXmWUkaWU—JWU¯L@W™Lƒwk@mm@_™ƒÅl™UVkmWUnV@VWLUb™bƑĬ¯l'], + 'encodeOffsets': [[ + 119543, + 33722 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3402', + 'properties': { + 'name': '芜湖市', + 'cp': [ + 118.3557, + 31.0858 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„bVaV@XllLXU°ŽlL@V@VUnVl¯Ikš›VUVU@@b@lUXUWmb„n@¼šbƒĊ‚LÞ@lVXlmÞUnkJ@nlKVVšÞXklWVaVI@aUKn»lL@Kn@‚XXwlm@mn°@„V@Wy„wXlWVk™ƒ@aUaVU¯£kKWVXVWLUkkWlkkwmJUam@@aULVa@UƒVaUaVI@m‚@UUJUIUmmV@bm@UXVVUlVmImakKUU@UU@VmU@@kma@KVIXUVK@U™VmUkV™m±£@JkU@nlšk‚ƒLUlmb—@WbU@@XnlWb'], + 'encodeOffsets': [[ + 120814, + 31585 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3406', + 'properties': { + 'name': '淮北市', + 'cp': [ + 116.6968, + 33.6896 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@lnnK@¦n@@V‚V„@@VV@nIV„V@VW²a@b@bVnUVVV@V™z@lš@°UšV„IVaVV@x@ŽXX@WlwUnV@XblW„b@XlK@aš@kƒ@al@@_V@@WÅwmaUaV@„bnaVL@llInmU_@W@aƒUUĉUaVwm@XWK@wƒVkaVUUwU@@aV@@mlI@WœLWƒUUUƒVU@kV@XalKVaUƒVUUUk@WwUK@aVI@WƒUk@@UUU±xkb@lVš@xnLÇbUbk@@bÇVUJ±U@U—@WLXšml@bVVXL@lV@@LmbkLW`kbVxUn@LkxmV@bm@@VkV'], + ['@@VVVkV@¥@UV@U@VUUJƒkWakKUšlXVJ@bXV@blX@aXV@V'] + ], + 'encodeOffsets': [ + [[ + 119183, + 34594 + ]], + [[ + 119836, + 35061 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': '3404', + 'properties': { + 'name': '淮南市', + 'cp': [ + 116.7847, + 32.7722 + ], + 'childNum': 2 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@°kƒīšaVaXK@U‚UVmnXUlšVÆkVKUUUmmU„ÑkU™UÝlĉKUƒwƒKƒbU@UxW@@lœmVUUVmUUƒmƒw—aW„kL¯K@Žm„ULWlIm`X„WL@b@¼@V@xkVƒI@b@l@lk„V°Ȯ¹ĸW'], + 'encodeOffsets': [[ + 119543, + 33722 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3405', + 'properties': { + 'name': '马鞍山市', + 'cp': [ + 118.6304, + 31.5363 + ], + 'childNum': 2 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@šNJnllLnxV@laXLVKma„aXbVI„bVKVVVIVyn@n_ƒƒW@@ƒ„UnJlUVVXlLnaUWlV@VV„IXW@_W@XK@K@UVUUwVamÑXmmwƒw™KUnUK™çU@ƒJƒU¯@mŽ@nknWxWm@@LkKm¼VL@bUJUbkXWl'], + 'encodeOffsets': [[ + 121219, + 32288 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3407', + 'properties': { + 'name': '铜陵市', + 'cp': [ + 117.9382, + 30.9375 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@„ÒV¤@¼V²@aVV@Ž@„„x°Vš£nW‚@nbnaVXVW@k@aV@VUœUl™°JUkVm@U@UkK¯WVkKWkU@Ubƒakwmlwm@ƒkUmƒUUKU@@VmLUbVLUV¯U'], + ['@@LllUL@VlxšL@a@UƒwXamK'] + ], + 'encodeOffsets': [ + [[ + 120522, + 31529 + ]], + [[ + 120094, + 31146 + ]] + ] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/ao_men_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [{ + 'type': 'Feature', + 'id': '8200', + 'properties': { + 'name': '澳门', + 'cp': [ + 113.5715, + 22.1583 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@HQFMDIDGBI@E@EEKEGCEIGGEKEMGSEU@CBEDAJAP@F@LBT@JCHMPOdADCFADAB@LFLDFFP@DAB@@AF@D@B@@FBD@FADHBBHAD@FAJ@JEDCJI`gFIJW'], + 'encodeOffsets': [[ + 116325, + 22699 + ]] + } + }], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/bei_jing_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '110228', + 'properties': { + 'name': '密云县', + 'cp': [ + 117.0923, + 40.5121 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@vIHZDZQtDLNMXIbHRCXXITbJ@H`LGPRDDJNCLHTOCWFGvGBUJMKGFO^IHWXITQCI’Y^AXGfRˆDXF`DJOLB~G\\DZIHHpErUVMhHb]\\M†BVF@FTP`@zTbD\\@~M\\K`H^EVODWICAakAQXoIcCOCIgGYNWFWNGGKKGaJEGMEIKYJUT_J_Go@_SyQaSFMEGTcYOQLIIi@EKAUPCV[EEXQCW|aMUMAaYCYNIDGGACIMGGSKDQGaF_C[GaB@GOIiOKAYL“mI@CN]F[SWWAcKKI@HMUimEKbeYQYISNUOcBKPIFBNgvDPGZYFSf]CMSIWGEUFgDIQ[MeDMJS@RR@LphFPCHaBAJKF@J]IBJO@HlO@@RKAMPJHCNDJTHFP@ZGNANBRFH@J_fM^ONJNF\\VTDJHDON@XRND\\XRCPVETCLBVKDFJINHRGPRV@\\CLJN@VbXbLVT'], + 'encodeOffsets': [[ + 119561, + 41684 + ]] + } + }, + { + 'type': 'Feature', + 'id': '110116', + 'properties': { + 'name': '怀柔区', + 'cp': [ + 116.6377, + 40.6219 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@JHTVHXCHPfnDJGHNDJSB[JSBGVSAOH@PMPuDEHHXZN@PHF@ZLJ@LHVYJA\\OFWP]BMtMBSRGV[JeVAPQVIFENMD¡–@^NV\\JH@NNL@NM\\kTQ\\I^FNIpBHGTBFFAZQfKDIXQTLXFXNNVMVHRGpCFLlRLEVBBH`IVO\\G`RDPAXLXBXORHZEHTDLLN@VGTMrQNFPeASKG@GMOAKBYMK@GTUHUXSHMVDNMOUEOZMJML@^KRACMZEZMRQLUHE@OFENPR@DI\\ChMHIDG\\GJMDWHCKGMDCIQCHO_K@GaIJSWWQDaGWJMNCKRsCYGYuJUSaKaW@UIMDK@[QUHOGQJMEILCAUDKFSOUQD[WMC‚Q@WPMGCCIUSE[IMPMN]`e@IEGAQBMHM@YEOSGCIDMIGNOLB@QP@GkP@AI^J@ILEBIbADGEOog@KQQWSekWQQUOFKZLF@PUNmIaHIUeBCTSHENcJa@_IWSaGu`GLSBKJQFOXGDXVQVOBIHcDSJWBEFGTMH[^mLaXcHiKElTRKtFXZ`MHMPCNRDxZˆB\\ICIHK@KŽHbIVFZ@BPnGTGbDXRDJaZKRiGEFSFEJhjFNZFjn'], + 'encodeOffsets': [[ + 119314, + 41552 + ]] + } + }, + { + 'type': 'Feature', + 'id': '110111', + 'properties': { + 'name': '房山区', + 'cp': [ + 115.8453, + 39.7163 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@h@bl@HRJDZ``TA\\VVD^H`\\pF\\JŒ`JGv@ZO\\GPSTEjPTR`FnEbDTDHEhLFMTK@ETSPULKEI@OVISKSJACEQNQbV˜IXGDIN@dMB[IIBcN]ZHNLP@XOWCFWŠCNRHTpATD@^NVNLED@Rh@jCEF}E[OOHUEW]W@QGGDIQSH_MmFmCUT_K]i@MHCMW—FCF‹E{BMHMPOHKS]CFNGBELDH_@BcAKOACESAOBELaXAROB@FODMEDWJAG[aE@UM@DImEWJMC@OeCA{aE[@{L@MINUCQXKfUJORCHqJBF@TCXWNQX]M[EAJO@@KMBQJIC]EWMCCUBEBFHKDOTMBGNGF]MWDBRDdMDQVyE@LPVHDCP@JVVMTG~HNSH[CmRUvHPHBbA\\PTNRC\\YNJ€PRARPJDDR'], + 'encodeOffsets': [[ + 118343, + 40770 + ]] + } + }, + { + 'type': 'Feature', + 'id': '110229', + 'properties': { + 'name': '延庆县', + 'cp': [ + 116.1543, + 40.5286 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@^AXOPEB[ZIGU@KKI@YGE@OYMGWFGvCNO@OPGTBHUTA\\ITACIGMIHmCOeDGGWSUIGimYEEMgiFITEFEjHLQbYCIWQaCSHmHAOY@UEaJG@LGLDJ[J‡AwYQCDMNONGY_EWLsSQFkMO[NWAIGaIYL@HMBOKiOQDWEUDMQSF_QIUBWdg@[NaAKQ@M]OQ@WhgLUMMFYQDIRCEUZOOCIOJ[KIUMKL@HIDKVEBM`HJAJSJUdBLGNEdMBMO[BYEWJSNKNaD]PE\\SjOT_RQVEZPpƒNQXfŠNA~lNG`@PNLp¼RFLfbdKbATUh@FSNWjGFZVLFHVA~X¨PPROfFJbNJPLFbENJPrEFNPFRHDDJdENJLVEPBJTVTHGHFRFH@PXP\\ORQHW\\BjWFDERLPPBbB\\E`B\\D\\L`@F]FCnJ^AZL'], + 'encodeOffsets': [[ + 119262, + 41751 + ]] + } + }, + { + 'type': 'Feature', + 'id': '110109', + 'properties': { + 'name': '门头沟区', + 'cp': [ + 115.8, + 39.9957 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@V@XMnGPY²‰JQNEhH\\AZMPDVTTDZCPiJkHSHCjIdFtEHITCNITQEKUAMCEIKCECABYESKFWAKBEIIHABGDCKCAIHMHALKEI\\CFIBILIJQZS]BBEECS@E@@C]COKI@CABAAEEDMGƒCH]A[M@CJWH—JaUMRFRBDTITLUJ@PFJKLOVST@FSLENgKGFSCaCmF_ESQiOSFOT[HYPu@IH‹_[IoE_[]GUC[USB__CYQI@Gakg@qZeHQNMNV\\FVLPgJAFJPRLCH[XcPELUT[JiV_EELFTADBXRTRLJC@fHXHHbPd`fR@NfT`@TLplHMpCEJHJBVLFŽ@JT‚VnG^KXDXHNVGRLRXFJVdDHSNWLGfEzA'], + 'encodeOffsets': [[ + 118635, + 41113 + ]] + } + }, + { + 'type': 'Feature', + 'id': '110114', + 'properties': { + 'name': '昌平区', + 'cp': [ + 116.1777, + 40.2134 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VNLJI\\JPPDYPFVQDCJZRNEVNhKXgR@^P@NLRbB\\Mh@XcVARJE`RTCNFV€XRCjPPLNA@GZKbJJHXB\\MNPjLdGbWnK\\]NGHSFEXATIdCJGPARUWUHCPWRELITAHKv_E@iYCaW_BQ\\Y@QIO@QDCIGZCEMWGFMFAFgHEDOCSqKCCFGAMKEAC@ODGCGs@WH@KQA@EE@CE@GEA@EH@GGUEEJEAYD@JM@@DAA@FHD@FTJEHUC@JUBKCKG@G[CIIQReAYhO@OXGDO@@FF@IHJFCPEBACBIAAKDOABXARHPNEHGbQAAKQFGIAM[C@WHKaGiCEGOA‹HUKCIokSCUSOCYN[BgGMFIR±ŠOZmHWNU@ShbbXDHVXXGJ^lZ@PZ\\Nb@\\FHJAD'], + 'encodeOffsets': [[ + 118750, + 41232 + ]] + } + }, + { + 'type': 'Feature', + 'id': '110115', + 'properties': { + 'name': '大兴区', + 'cp': [ + 116.4716, + 39.6352 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@F\\E~DFN@BDFEpHFCHBBEGCDCJBHUDSBB@ELCPbF@B\\J@BJVAFJ\\ADKTCBGECFMT@BMN@@FH@DaNBEnvB@FPBATK@FHEFIAKFBFL@@PKBFJHC@FXBRAFCDMPDTOL@JIVFDHH@DDH@BGRFCDLD@N^@@CNA@KNOAEBCECFEGCFGMGFIPMOEJOLBADBBHGG@GCHIECY@INC@DMGS\\AIOZAAEYA@GT@KKMBEETCGMVINFxA@MJADB@FlA@HJA@NND@DFA@DVAZBBOFKH_JA@K^GBC@EFE„G@gAENMXKJigC@IbSJMqGOP£RGSMGE@kbQFDPEFiBSGGSBK]I{CDWCIDOic[C_G@SuSO@EWKCO@MNY@\\uZOPENQD[LKESSKGBKEG@EJGAGHoH¥CqhifeJkX_XFFGHFNEDFPENKHM^IFIVL^S`DVEnNnG`RTCJHH@R^XFXGVPP'], + 'encodeOffsets': [[ + 119042, + 40704 + ]] + } + }, + { + 'type': 'Feature', + 'id': '110113', + 'properties': { + 'name': '顺义区', + 'cp': [ + 116.7242, + 40.1619 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': [ + '@@EhEBENXHFNYDJHCD@RJP@R[ZARX`DbjZF@bHXT`Jb@dIFMTGDSfAJVbGnJVM@OKELYPERVXRflXTT@NIfC\\NJRhCVEHFJXNT^DTeZEHYCOhuAMJELOdAVPTMOWBWNMNEJgl]@WGUFIC[T{EEDEHGCIGMI@SECUQI[D{A{GQESPUH]CsiMCmHUeoHENcAaDGCMDGMQCACCBaCGLMAHB@DIEQLOAAEEJ@CW@CDINGAAGKQOCgV@LG@BEGDKNeREFBNCFIDOPKD[@YRW@GFWDAFE@EHDDrLDTCPGF', + '@@KrJEH[\\B@FF@CHFBHUN‹AJKADGECBCMAG^E@EbI@BEGP' + ], + 'encodeOffsets': [ + [ + 119283, + 41084 + ], + [ + 119377, + 41046 + ] + ] + } + }, + { + 'type': 'Feature', + 'id': '110117', + 'properties': { + 'name': '平谷区', + 'cp': [ + 117.1706, + 40.2052 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ZJZRafFLjn€VGNJ@LLBdXX\\T^EDMJ@”nZKLBjPPJ@HbA\\H`DbERHLCFK^BZaFWXQLAGMHa\\OLO@SBIpBdCLƒVQfElO@GSAKEDQTC@GEBKG@ORIJBDAPDFA@CaOq@GGQAAEJK@KMUGAAGEAa@MGMBGCGSIIW@WSUCMDOJeWOM@IUF{WMWaDIMgIoRoCOKeEOEAG_I[cg@wLIFENQFDVTFJ@HNDJGHCFFFS|D\\EJHV@Xk^IhMFMNAXPX'], + 'encodeOffsets': [[ + 119748, + 41190 + ]] + } + }, + { + 'type': 'Feature', + 'id': '110112', + 'properties': { + 'name': '通州区', + 'cp': [ + 116.7297, + 39.8131 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@FDAJTGDNDCTDDEDBBE@DT@@EHCDGJ@EIZ@@FDBR@ATFBBVFFE@@HNA\\VE@CLIFNJFNJBCP]A@LJFA@HJEDD\\C@DBCHLAEPF@@DH@APHAERDF\\GIxDTM@CFLBBFJ@CNUPMHECGDBF]BMFPDLRBHHBJMDCX@@DFIBFPBRKJF@CGANBHKbDDABDRDHNNCHDbCdBFMpGHiOYMefKJMC}HWAUNW\\NNBNA„kNU|]HMTMN@MZBLFFF@RIRUT‘BMFIEGaAGGAOIIUGTSFcYKS@MSLYPKRUBU]EWDOI]CKGASgW@MTWKIMCS@uMAKKADMECGAKVUTSDy@IjWLMNBF@hƒHEF@FAD]H@LIBG`ELAPYAUB@CEB@CMC@MIB@GkB@ECAIB@NwBMEUJHNSDFFNALLS@@HZBBFYBJP[BHTCND@JMZ@FDGJHDH@GHAABCKAIPPFONEJNHEHHDEFFDADBFMP@L'], + 'encodeOffsets': [[ + 119329, + 40782 + ]] + } + }, + { + 'type': 'Feature', + 'id': '110105', + 'properties': { + 'name': '朝阳区', + 'cp': [ + 116.4977, + 39.949 + ], + 'childNum': 2 + }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@bFGHBHFBFIVFHHG@@FFB@HDFF@@FRB@LXGt@DHCH@PBDLFBNF@BEXCHEX@ZQ\\@LCPOJCDEAMFEfQLMHCAFH@@KhUNE^AAEHCFDNGVODMI@AEKADEN@CSJw[HCEFQGBBOG@@CE@FOKBDGCAD@C[FCGIB@IE@K^BDOIAEMMIJEDKF@[UMB@GF@EEAUEABSQ@CA@EY@FJI@CHGD@FS@@CAFCACFSCCDCMSHBIECMB@D]@@MKCDCQEAHG@CCG@CGUEIJK@SPOCCNEDQBDNDB@DJCDLFCBBALJB@BVGPBKVO@KHCCCD@FE@BNA@FNCTDDJA@FGB@NBDW@CL@hT@@ZHHQDDDAFSAANBC@HG@EFS@@DE@@PCB@Ue@CADNJB@FCBWA@LI^ix@FIHrH'], + ['@@HUN‹AJKADGECBCMAG^E@EbI@BEGPKrJEH[\\B@FF@CHFB'] + ], + 'encodeOffsets': [ + [[ + 119169, + 40992 + ]], + [[ + 119398, + 41063 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': '110108', + 'properties': { + 'name': '海淀区', + 'cp': [ + 116.2202, + 40.0239 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@plDJVLŒGPBFHjDbHGL@X\\DBNHJREBLRBHaFGŽMGOBQAWPBLCBBAJBDFADOIEJGE@@EP@HCPWP@ZgfBRQJJ\\D@HLHLDVA@IVDFGSI@EGC@EBB@CN@@IZCAGHGaEqGJG@EjwJ]@K@GSA@e_I@NE@CA@Kg@KC@ENCFƒAKQAW@WIMK@V‹@I@@F@^EDFB@HcIaDYCBRRDCHD@EFLN@FE@CJUPEJOJMTBPEDIFCMIAKNOGMRFJNDVBFLSRMJSDGJsFcEiJGDGTIlOjYD'], + 'encodeOffsets': [[ + 118834, + 41050 + ]] + } + }, + { + 'type': 'Feature', + 'id': '110106', + 'properties': { + 'name': '丰台区', + 'cp': [ + 116.2683, + 39.8309 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@hMN@NFTQCFRCBJFA@HJ@@HJ@HJ\\FTACDŒ@@UNLXJX@@MA@@IECAQlDFEHBDI~D@GXCFMVDFCH@@NF@ANJC@FnAB@AMF@@EDCDDLGP@LUOAUH@AIABKAAEDCKID@CCACMWA@EGDEILA@OK@AELEJBFEEGL@BSOA@EuAFmMACbG@@EM@ANS@ENFDAHSDCL[BEIUBAII@A[E@OaKD@FAACTGVIACDHDAFGAEDoGEFACM@i€g@@QFCMKMU@]SCoBGSMQ‰DEXXDWPO@MKYGM^AdJJA\\cNB\\G^„DNHFCBFABDBJ@PL^D@DF@T@FDAF^A'], + 'encodeOffsets': [[ + 118958, + 40846 + ]] + } + }, + { + 'type': 'Feature', + 'id': '110107', + 'properties': { + 'name': '石景山区', + 'cp': [ + 116.1887, + 39.9346 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@NQPHLMJBDNJEFCAONSPIFIVODIF@@EKMFEC@DGQCAQZDbCdJ@GEAFC@]@EJ@DCSB[EGII@@GI@@GEBAIQDDESRMEM@gNYTIRKJAJEJ[DFJKLGBGNBJLDCDAHGBJJAFBLEXTLZFBAFDLD'], + 'encodeOffsets': [[ + 118940, + 40953 + ]] + } + }, + { + 'type': 'Feature', + 'id': '110102', + 'properties': { + 'name': '西城区', + 'cp': [ + 116.3631, + 39.9353 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@XBDA@EIACM@IJAD]BC@SFABISAD]H@@OAEDQEW@BLE„MD@FLDh@@LDBF@@M`J@fTB@H'], + 'encodeOffsets': [[ + 119175, + 40932 + ]] + } + }, + { + 'type': 'Feature', + 'id': '110101', + 'properties': { + 'name': '东城区', + 'cp': [ + 116.418, + 39.9367 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@DBf@@VDA@OF@@CT@FEH@@GADBMTBBECCRCGG@YS@@gDK@A‘C@PG@C^TBAJEB@TADC^IB@J'], + 'encodeOffsets': [[ + 119182, + 40921 + ]] + } + }, + { + 'type': 'Feature', + 'id': '110104', + 'properties': { + 'name': '宣武区', + 'cp': [ + 116.3603, + 39.8852 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@RBX@RFFCŽBFU@aK@WA}CCJGAEFkCBRFD@JB@@N'], + 'encodeOffsets': [[ + 119118, + 40855 + ]] + } + }, + { + 'type': 'Feature', + 'id': '110103', + 'properties': { + 'name': '崇文区', + 'cp': [ + 116.4166, + 39.8811 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@XBL@@bEV’D@BX@AC@MHA@EIBCCDSEMmB@EIDBME@@MG@EDUCENWD@H'], + 'encodeOffsets': [[ + 119175, + 40829 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/china_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': 'xin_jiang', + 'properties': { + 'name': '新疆', + 'cp': [ + 84.9023, + 41.748 + ], + 'childNum': 18 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@›ρȁôƧƦóəʵסʵóƪԫʵѵͩƧͩړ›υࡓɛʵ@ȃ@óᇑѵƨɝɚôóНѺͩɜ̏ԭʵôƧɞñ@υƩ—݇ȂóƩƧ@ѵȂυœƥŌਗ—॥ɛóʵѵƧѹ˜݇̍ࢯ˜əɞυ˜ρͩ̏óਙƨƧŋôōóš̍ͩóʵן›óŋړͪƧѶ@ɜԭ—ԫƦɛȄ̍›ɝȄöςƩȂ̏œñȀ̏œƩóóŎə˜@Ő̎@ɞȀɝŎôƨóנѵȄƧ@óŏɝœóɜôŎ̍ͨςŎ@ƨóôƨɞ݈ʶóƨφó̎Ȁƨ̍ԮòѸԮמ@ѺȀ@ƪၬֆòȂñ̐òȂɜ˜óƨ̒Ŏ̑߼@φρȀ@Ő๐ς̎Ƨφ@ɝφڔ೦Ԯǿࢰ@ƦŏԮƨƨȄƧ۬ɜʶڔŐɚɚóŐôƨ߼˜ôƧƧó̐ƥóŏѺǿƦȁφƧς˜ƨƧ̒@ɜƥƦυ̐ɛƪͩƩəƪʷ̑ə@ȃƨʵנŋྸōਚԭԪ—@ɝƨŋ̒օςʵôƧ'], + 'encodeOffsets': [[ + 98730, + 43786 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'xi_zang', + 'properties': { + 'name': '西藏', + 'cp': [ + 88.7695, + 31.6846 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ôŌנœôʶ̎ͪô™óŎƨŌਚƧ̐ôςͪφ—ɚɝࢰ—݈̎Ѻ—Ѷƨôʶ०ɜਘ˜Ʀŋφ›Ѷȁ̍—ôŏɚŋ@̑ə—@ŏò̍ɜ›óƥôʷƧ̍φѹԪ̍ע@Ѹʷɜ@ôñנ@Ѷɛɞô̐ŏѶƨѸƧƥōƦœôŏô—@ƧôƩ̒ŋƨŌƦǿô̎ɜȁ̒—óʶѶôôО̒›ςƥɜНφσɛȁ̎υƨఱƧŏ@ʵƥœ@ŌóóóͩƨƧóŋ̑õóɞóɝԩͪɝρôƧ̍ƧѹͨڑŎ̑ōóƧࢭͩ̏ѵɝóఱóóԪυô@̒ƥŌ̏Ƨ̑Ȅ݇ŎƧ›ѵӏ@ɛõŏɛȄôӒƧŌѵǿɝ˜Ƨŋԫ@̏ʴƥ@óǿ̑Ȁóǿ̍ςóóυô@ʶɛñρƦƩŐó̎óœѵó̑ͪࢯОóɜן˜Ƨ̏ƥȄ߻̎̏̐ןŎɝɜöɞƩȀôöɛȀóͪ̐ƨƪ̍̎ȂƥԪυО@φɞ˜ôƪ'], + 'encodeOffsets': [[ + 80911, + 35146 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'nei_meng_gu', + 'properties': { + 'name': '内蒙古', + 'cp': [ + 117.5977, + 44.3408 + ], + 'childNum': 12 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ኊȁ૊ö߼ƩɜɛנñԮɛѶóԮô@ȁѸóמ̎ගѺၬ@߼ʶԮӒ߼̎@ŐѹӒ̒Ԫƨöග̑ѶȄ̒ς।œѶɚöɞɜʴڔôôȂ̎—ѺȀς—ƨ˜ƪóԪ—ɜôɛОਕڔԭ˜ѵ̍ѹȂԫ›ɛƥ̍Ȃóɜ̎ô@ʶ݊ੲࢮʵږͪנƨôȂƧ˜̐ͪ@ŐƦƨφԬѶɜôƦ@ŐƧôôƦəŐ̏›@ŐڒѶԬô̐ʳԩНςōôŏɞ@ƨȂѶəóƧ̒ػ̎ó̐Őנóƨô̒@ƨɚɚ@עԫɛɛ@ȁυͩƥʳòևρ—̑ࡗƧͪ༃ॣԮփ̎Ʀ@ôô@ôō@š@ȁѵóƨ̍υȃóʵɛƨƥóυȂóəƪ›̐ρƧͩɜԭڔȄ̎عƧȁ̐ŏó̍ɛ›ƥƧ̑óρŐ@Ƨ̏˜ɝəɛ˜߻ͩ̍ͩɝО̍ƪƧóóӓƨóƧʳ݇@ɝςƪœ@ʴƩ—ƧƦôƨɛȄə›Ƨŋυ›óͩѵ@ɝǿóŌן̍ɛ˜óО̍œ̑̏ôȁ̍ŏòȁñóƦͩ@ǿə@ɛƧ̑˜ρȁυô̍օѹœóȃə™@ȂσʵѷƪòƩ̍—ôó߻ۯôʳƧ™óšõʵѵóѹɜ̍ȂѹôɛŌφֈƩͨρóυӑóޟఱ̑݇ͪóƪƨŌóȄڔԬƩςםñ̑ȃѵŐԭŏƨȁɛǿρôõɚɛóƧОə@ѹ̐ѵöԪͨôͪɛ̒ןŏƧƥóôƥƧɛŌôóɝó@̒݇Ӓ̒Ō@Ŏԭࢰ'], + 'encodeOffsets': [[ + 99540, + 43830 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'qing_hai', + 'properties': { + 'name': '青海', + 'cp': [ + 96.2402, + 35.4199 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ƨ@ôƪ݈ȁƪ˜@φɝòóƨԮʶɛ̐ѹͪôОəóƧɞᇒѶ@ôږô@ǿѶ›ƪȁςœɜͩφ˜ςŋɞôѶɛƨŌɞ—@ɚςŐñԪॢͩƨȂɞóƨŐ̎ŏעӏ̎óƧƦôœ̒ȁɜ›ςͩ̒œɚɛƨôƨɝφɛóȁƨŋóóɚͩƨóóƩ@ƧəŋƦƩ̍@ƧƧôǿυ̑@ȁɞǿõŏρƥסɚƧóτԫɞœôƧƦ@ñȃòñƥóυôôѹѵ—@ŏ̏Ȅɝó@ȂəŌóəѹƦ@Ő̍Ōυ݈ԩŐƧóôƧ̑›ôʵɞƧ̑ѵôƩɞƧ̑œóНѵóôʵ̑˜ɛȂó̍ƥȀƧŋ̑Ōóƪ@ƨó˜óŐƥ›ƦŎѷƨѵƧ̏Őɝóѵɜן@óòɛ@ѷʸס@ԩ̎υѺƨ̎óʸôƦɛœñ̎@Őɚ˜@̒əŌóŐ̎˜'], + 'encodeOffsets': [[ + 91890, + 36945 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'si_chuan', + 'properties': { + 'name': '四川', + 'cp': [ + 102.9199, + 30.1904 + ], + 'childNum': 21 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ô˜ôŋó̑Ԯ̒ɛОמͪƨōöͫ߼ƥôȃƨóóñôƧóƧôōڔŏƨŐ@Ŏô˜òƥѺŎ@ōɜóנ˜ôǿô›ƦôԮ̍ɜôɚ›Ƨ—ñɛɚȁ̍Ƨɛևυ@óóôŋρԭɝ@Ƨʸ̍ŏυɜƧƧóƧƨȁρ̍ƨȃɚ—ôʵφóô̑̏Ȃ̑ʵɜʵɞ@ƨʳסƩóŎə—óɜƧôƩƧρ˜óôôô@ŎƧƨƨƪѹ˜ó̍̍Ʃ@̏ѹНôޟ̍Ʃóƪυɝɛ—əƨôŎɛȀ@Ȃ@ñɝʶ@Ōρנ̏—õóɛͨƨȂѵОɛʵ@̏ƩŐó߼Ƨల̍φɜȂυτɛОρƦɝƨóƪ̒Ѷɝƨóʶ̒œóƨƨôԪŏφ݇̎ŋ@ŏѺƥôɚɚŋ@ȁɞô̐ȃ@ŐѶ˜óѺφóƦôñòòȄ'], + 'encodeOffsets': [[ + 104220, + 34336 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'hei_long_jiang', + 'properties': { + 'name': '黑龙江', + 'cp': [ + 128.1445, + 48.5156 + ], + 'childNum': 13 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ᇔȂਚНƨŐѶŏöƥςŏñƧƦóƨȁ@óƨ—óȁφӑóóƨ˜óǿ̎̑ôНɞ—ó̑ɜə߼›̎ǿ̒ôڒӑφ@Ƨȁ̎̏ƥƩ̎ρశ˜ôȂςƨφ@נɞ݈˜̑ƥƧɛƨʵƧȃƥ@Ƨƥ@ŏ̑ԩôɝρρóɛƧ›ƩͩƧó߻ʸ̍ʷѹƥɞڕõ̍öɝυ—̍ȂƧ̐̑ŏóƨñŋѹóóȁ̍›̏Ԭõʸ̏ŏ@ǿ̍@ƧОυ@ñƨòȀƥŎ̑ŐѵóɛŌóȂԫōƧŎѹñ̍ʶóОן@Ƨ̎Ѷô@Ȃ@™óŎó@@ó̍ƥԭք༄।ƨͩ̒ࡘς˜ñֈƦʴφͪ@ȂɜɜסԬə@Ƨə̑@Ƨóןô̏ŏ̍ô̑ؼôƨѵɚƧȁɝ@óŐρŎԪО̏ʴ'], + 'encodeOffsets': [[ + 124380, + 54630 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'gan_su', + 'properties': { + 'name': '甘肃', + 'cp': [ + 95.7129, + 40.166 + ], + 'childNum': 14 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ڔôԮࢯ@ō̑ŋ݈ӑ@̑ɞôóôɜŋƦƨôóƨƦנŐɜ̑óͩԩͧѶõѺ̏ɚ@ƨНɜôöəςóɜȀƧȂԮŐѶŏ̒ȄמòƪρړԫôȃƧŋôƩ݈ͩɚ@@ǿɜ@φͩóŏɜӑƧōôǿ̎›ôƥƪóõ›ö@ô—ƨ˜ôƧƦôó̒ɜ@ɞŌõʶ̏Ő@ȀóôƨȂ@ʶע@@ƥ୾ӑó̑óŋôʵóɛړ@@ƩöóƩóρ—ɛƨ̑@óʷƥƥ̎ɛƧ›ôōƧǿôͩѵôɝȃɞȁõƧρóó—@ōƧŏړŐóŎôƨóƨôòƧôóȄ߻ƦõͬƧŎםͩɜНԭ̑ô̒óŌó—ƥ@óƨɝ›σԬƨôעəςƦöŐɝȀ@Ȃφ̒óȀƨƨ̎@ƥƪɚŌ@ƨôƪƧôəͪôôƧŌôȂυɜƧɞƧóəɜ̑›ρͪɛœ̑Ȃó›ƨƥ̍ôסӐ̍ŐƧŏɝôƧȁॡͪòԩρŏ@əɝ˜ƧŋѵɜɝóρŌυ—ɛͪρ›ƩȂѵœ@Ȁڕó@ȄɜʶφࡔڔœƨͪѶͪԬʶôƩעʶɚʶƥôóƨςȂ'], + 'encodeOffsets': [[ + 98730, + 43740 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'yun_nan', + 'properties': { + 'name': '云南', + 'cp': [ + 101.8652, + 25.1807 + ], + 'childNum': 16 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ôɞôɝ̒öôŌƧƨôͪôô@ŋƦ›@ʶƨŐô߻ƪŏ@̐ɜʶѶНƧȁɜͧöô̐˜ςן@ŋɞʵ@ò@ȁɜǿóōɚƧɜ˜φɞôƩ̎ƪóޠѺО@̐̎ƪô̎Ѻ—ƧƩƨƧ@ōóóôóς—ƪƨƨóôɛó̑ԭ—ƥŌɛǿɝƨɛͩô›@ǿƨȁѺŌɚɛ̍ןѶНɛƧôóƥȁƦͩôŎɞ—ƨ̑ɜ—òôφ@ƨʵ@ɛѹōóȃəƨυǿóʵρƧƧŌƩɛ̏ȄñƧƧȀɝ̍ԩʶƧ̑υ—óŌƥʳɚӑóНƥô̑›óӒѵʵѹœƧӐןôƪφõŌƪ̒ԫŌƧؼƨƨס›ρȁƧœƨȂóʶó@@ʴƨôôφ̎Ŏ@Ȁƨ—ƪɚƨœóƨôôôςóޤƧŌƩŋƧԪ'], + 'encodeOffsets': [[ + 100530, + 28800 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'guang_xi', + 'properties': { + 'name': '广西', + 'cp': [ + 108.2813, + 23.6426 + ], + 'childNum': 14 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ƦŋѺ̎ڔʵƨŐ@ƦמȄƪôóȂɜŌɚͩɜ@öóɜôôȂƦôɜȁ@ɞφ›óȄ̎›ƨʶɞŋƨʴɚǿ̐̎Ԭ@ôñ@̏ƨ›ρ۫ô›ɚƨƨНƪŐ̎›ƥóƦʵƥŋ@ȃóƥƧ@@ŏɝǿôυƧȁѵɛ@əóŏ̑@@ə̍›óƧó—@ȁƩ˜ρóòНƥô@Ӓ̑@óŎ̍ƥσŎυ@̍ƨ@Ō̑ôóͪƨ̒óŌړœ̏Ŏ@ŌôȄѺŎ@ɜƧʶυ@ñóɛ˜Ƨ̒ɝ˜óōƥͪ'], + 'encodeOffsets': [[ + 107011, + 25335 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'hu_nan', + 'properties': { + 'name': '湖南', + 'cp': [ + 111.5332, + 27.3779 + ], + 'childNum': 14 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@քɜОƨ@öŐמóƪôƩɚ̒Ő߼ȁςͩɜòƪ—ɜȀò—ñɝò—Ѻͪ@ŏƨŋóɝôǿƨ™ɚȃóəƨȃѵͩó̍@ȃƨóóƥƨƧ@ʵƦ›óͩɜ—ɛóñԭɛōυȂ̍ƧƦō@ɛƥ—ɛȀ̑œóʷóō̍œƩŏƧОəƧóœς۬Ƨœ@̐óòԫ@̏̍əȀƧʳɝŌóɞƧ˜ƨɜóŐƨò@ȄƧŌρŋóôԪОóʶ@̎óȄ'], + 'encodeOffsets': [[ + 111870, + 29161 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'shan_xi_1', + 'properties': { + 'name': '陕西', + 'cp': [ + 109.5996, + 35.6396 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ςôöƨɝȂɞȄѶóóͪƨȀóŎƨœ̍ɜƦƦôʸ̒@ɜƧς˜ƪôõô@ƪڔ@ôɜóʶôŌô̒୽Ӓ@Ʀ@Ѻ̎ɜѺɛѶôöʶô™ƨšóʴ߼۰óô̎˜ñƪѸƩτʶ@ȁòŋəѹóǿ̑ʵ@ȁ̒ʷυփô݉ôН̏ط@ȁƨóô̏ƪõ@ʳ̐ʵ@ɝɛŋƩŌɛóןôƧŋ̒ó@ŏ̐ƥ@ŏυ@ƧƧôן̏@ƥȂѹɜəœɛóԭ̎ƥóóœóȀן—ɛô@ŎѹōñƦ'], + 'encodeOffsets': [[ + 108001, + 33705 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'guang_dong', + 'properties': { + 'name': '广东', + 'cp': [ + 113.4668, + 22.8076 + ], + 'childNum': 21 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': [ + '@@@Ȃô˜ôƨ̎œ@ɚ̒@ôŐ@ɚѶɜƨȂóφɞȀ@Őƨ@ôƦ@ȄƦŌƥʶƦôôŎôʸ̒›ɜǿƦ˜@ɜƥŎ̎ƨφȁɜŎòƥԮŎƨōóŏɛƧɝəɞƧ߼ɜςȃñȄƦŎ̒ōôòƨəƨ˜ɚН@əƨ̏ƪʵυŌəɛóəԭŏəœóŏѹœρʵɝƦ̏™ƥʳѶ›öō̑óóŋρȀυƧƥɛѹōƧôן—ɛŏѵ@óŋôʵɝ›ƪԩõ@Ƨō̍@Ƨ@@ƦɝԮƪО@@', + '@@X¯aWĀ„@l' + ], + 'encodeOffsets': [ + [ + 112411, + 21916 + ], + [ + 116325, + 22697 + ] + ] + } + }, + { + 'type': 'Feature', + 'id': 'ji_lin', + 'properties': { + 'name': '吉林', + 'cp': [ + 126.4746, + 43.5938 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@נ@ôН̎ʵѺòƨōԬŎôȁɜŋѶô̒ŏƦōñǿòƧφ@ƨН̎@@Ȁ̐Őöʷ̐ԫ̎œôȂѺôòŌôƧ̒Őƨ̏̎ȁφ˜@ŋƩͩםȃƨ—@ȁ̑ʶ@Ōóôɛœƥѹ̑—συ݇@ɜρƧȃࢯƨôœəȂɛōƩɛ̏υρóõœƪʴυφ@ʶôŌóœρք@ɜƧ@ɝǿƧͪρȀƩó̏ŐƨȂ̍غړȃɛԮƨͪ̏ςƩœôɚφȁƦôɜƧôʶφȄ'], + 'encodeOffsets': [[ + 126181, + 47341 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'he_bei', + 'properties': { + 'name': '河北', + 'cp': [ + 115.4004, + 37.9688 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@Ʃ̒̏ŌѺ̒Ʃ˜óȄƧŌƥͪòôñȂ̎ŐóȂ̒̐̎›ôНɜ—נ̎ôŋɞȀѶ@ôͪφœƨŌɚœɜȃóƧƨƥƪ˜@ʳƩ›ɞρ݈@υНφʵɜ˜ƦρƨƧ̍ɝóɛѹ̍ρŏ̑ôóƨ@œƧƦôƨɛ@ƥƨ@ȂƦ@@ôəŐƧʶƨŌυœ̍̎ɛŋôōɝ@óƧ̍›ƦʵѵʳôʵɜŏςôƪŋƨŌɚ@ôНƥƧ@ōѸɛ̐ô̎ʵѵНԭ@̍̍Ƨò@ȁɝ@əρυͩƪ̏ƩõƧŎƧōóšॡȄɛʶɜȀ@ɞςѶƧœƥςɛŐ@ɚɜɜ@Ŏôôςœƪς'], + ['@@õə@Ƨɛ˜@ŐóƦφô'] + ], + 'encodeOffsets': [ + [[ + 117271, + 40455 + ]], + [[ + 120061, + 41040 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'hu_bei', + 'properties': { + 'name': '湖北', + 'cp': [ + 112.2363, + 31.1572 + ], + 'childNum': 17 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ñȄυƦöŐƩ˜óנƨƨφ@@Ő̏Ʀ@Ő̑ôƨŌנóɜôƪŋɜŌѶօڔə݈òɞōɜŎôӏƦóƨô̒óôȃƨó̎ŐôƧƪ@ƨȁςƧə̑̎Н@̍Ƨŏρôԭͩԫ—̍ʵƧšóȀôɞƧŌ@Őѹͩñ˜òɞñ˜ɛǿƩ˜ɛñρͪ߻Ȃ̑ŏƪəƩóםôõŏƧ@ɛНƥȄó›̑ѺƧ›ôφóƨƨƦƪóɜŐôóòôƨóφ̐ƨóƦ̎'], + 'encodeOffsets': [[ + 112860, + 31905 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'gui_zhou', + 'properties': { + 'name': '贵州', + 'cp': [ + 106.6113, + 26.9385 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ɜȀƦŋԮ˜ô̒ɚ˜ôōעƪƧʴɝ@ɛʶ̒ʶ̐ȁƦœóȂô@ôŏ@ōô—ƨʶѸô@ʶƨ˜ɞó@ōτöòυƨ@@əƨô@ɛ̒@Ʀɜôȃ@̍ôʵԩНôóςŌƨŋ@ȃƧñôŏƧɛƨ—ôɝƧʵ̍œôȃυœ@ɝɛȂƥóóȁɛóõôɛ@əͪɛŋôȁƩóםȃ@ƥƧŏړʶѹ̍ƥŌƦȂóôɜƨѵО̎נəɜѹŋƧȂ@ȀóœɜͪɞƧ'], + 'encodeOffsets': [[ + 106651, + 27901 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'shan_dong', + 'properties': { + 'name': '山东', + 'cp': [ + 118.7402, + 36.4307 + ], + 'childNum': 17 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Ʃ̐φͪɚςɞ@@Ȃƨñ̎̎Ԯ@ѶОƨƧڔ@φН̑ŋ@Ʃ̒ǿ̎@ƨɜԬςôʶ̐ʶöԫƨƧנƥɜŎôō̎@ôŏóρƧŏԫôóƧԩó@ƥɜƧԭóƨʵɛƨ߻ӑɜНԩ˜óô̑óƧʳə™óɛƧ@õȀƧœ̍ȃɛŐóŏυО̍—óɝƩ—ԩ@ƧɚԫȄɚʶƨ˜ɞʶԪ̐ړɛƪ̒'], + 'encodeOffsets': [[ + 118261, + 37036 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'jiang_xi', + 'properties': { + 'name': '江西', + 'cp': [ + 116.0156, + 27.29 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ƧȄôɚəȄ̎ʶԬ˜ԮͪςóƨŐƪ›τɞƦōƥƧ@ŏςôóŐôô̒ʷѶ—ƪƩƩǿ@ō̒ɛôυ@—Ƨȁѹɛəƨѹ̑ƨ̏óƥѵʷô̍ɛȁôŏɝǿƧԫƧ›ôʳƥōòȃρȄ߻ɛɝƨɞɚɜƨôŐƧŎԭōñƦòԮɜôɛ˜ôͪƥœ@ʶƧƨôƦƧô@Ȅô̎Ѷͪ'], + 'encodeOffsets': [[ + 117000, + 29025 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'he_nan', + 'properties': { + 'name': '河南', + 'cp': [ + 113.4668, + 33.8818 + ], + 'childNum': 17 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@φ˜̎ƪ̐˜ɞȄɚ@@Ȃעó̎ŌѺ̒ôֆॢȃô™ƨŎƨōƪöƩ̑ڔɜԩ̏ɝʵƧ—əʵԬȃƨəԪ@@Ƨ̒ŏô̍υȁƧɚ̍ôóŋ@ɝƧŋõ̑σ—@ŏɜŋôɝ̒ƧɚôôطρóóɛƩ@óƨ̍ŏƧôóȄ̑ôƧóƥôóӐɛōɝŎ݇ñړɚѵֆ@ɞ̏ʶ@ʴƩöó̐'], + 'encodeOffsets': [[ + 113040, + 35416 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'liao_ning', + 'properties': { + 'name': '辽宁', + 'cp': [ + 122.3438, + 41.0889 + ], + 'childNum': 14 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ƨʴƧôôӔƨô̎ƩɞН̎ͪ߼ͪɜ—ɞɚ̐—@ƨςŏ̒ôƦƨɜœô̎ƪôςǿƨͩɞȀƨ@@ɛςփô›óŋ@ʵφυƩʳö›॥փρѹס@əɛ@ͩࢯ@ѹʵρ—ƩʶφȀƧ݈̒۬óʸɝŎѵ@ԭԫןɛƧƨƥςɛ—υʶφО'], + 'encodeOffsets': [[ + 122131, + 42301 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'shan_xi_2', + 'properties': { + 'name': '山西', + 'cp': [ + 112.4121, + 37.6611 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ɚѺñŌɚšôȄѺ›̎ֆφóςȂ̒—ɜƨɚ@@Ȁƨŋôȃƪ—ѹ̑̐ŋƪ̑Ʃρρ›óó@ōɛɛ@əɜŏƦρƨ›ρѵ@ɝɛǿɜʵóօѹ̑̍ŋסô@ȁə@ɝȃ̏—̍Ʃυ—Ƨô@Ȃ̐ظóОó݊φք̑ʸ@Ȃ̒ʶôȀ'], + 'encodeOffsets': [[ + 113581, + 39645 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'an_hui', + 'properties': { + 'name': '安徽', + 'cp': [ + 117.2461, + 32.0361 + ], + 'childNum': 17 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ó̎̑Ő@ƨƪ˜Ѷǿɜ̑φ—Ʀʵ̐˜Ƨѵôóƪôôυς—ƨȂɞŏ@̍ԫôò̑ƥ—óȃѶͩƧƥôŏѺœôŏƦ—@›ƥͩƧ—ôȁυó@̑ƧɛѵʵƩƪѵ˜̑ʸóóôŏρó@ŐƦƨƥŎσɝƩœ@̎̍Оɚ̒ρƨƧȂôɜςôóظəó̑ƨóɞɛŌ@Őτ˜ö̒ƨŌ@ɞôŌ̎óƨəφȂ'], + 'encodeOffsets': [[ + 119431, + 34741 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'fu_jian', + 'properties': { + 'name': '福建', + 'cp': [ + 118.3008, + 25.9277 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@̎›óȁƨӑ̒—̎ɚƨͩφŐƨɝ̎ŋóŏρ—@ōƨ›òʳəóƨō̏˜õɛƧ@ƨѵƧōəŏóŋƧô̑ɝɛʳƥ@@óɛõ@Ƨ̑ƧóȁəƧ̑—Ƨ̐@ɚəОƧ—Ƨɚóñ̑ŎóʴƨœƨԬɞȀóŐɜȂó̎ѶʸôƦƧ̐Ѻ̒ɚƧѺɜƨȂ'], + 'encodeOffsets': [[ + 121321, + 28981 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'zhe_jiang', + 'properties': { + 'name': '浙江', + 'cp': [ + 120.498, + 29.0918 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Ѷʶƨɜ@̒φôóȂƨ˜Ʀͪ@œ̐˜Ѹ̍τȂ̒̑נŐמôƪƧôӑ̑›@ƥρͩƨօ̏@@υɝó@ŋɛ@ôƩəóƧѵυó@ƩɜŋƧ@̍ŌƧɞυŏƧͪ̍ə̑˜ƧӒôȂ̍œ@˜óφ̑ɜ@ŎƪȀ'], + 'encodeOffsets': [[ + 121051, + 30105 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'jiang_su', + 'properties': { + 'name': '江苏', + 'cp': [ + 120.0586, + 32.915 + ], + 'childNum': 13 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ôɞ̎˜φНôŐɜŏ̎Ȅƨ›öǿƨ@ôɜɚšƨʴ̒ôôó@Ƨ̎əԮȃԪૉöͩ̐ƧòʵφƧôʵ@óړɜóŏɜǿƧ›ɝρσȁѷ̎̏—ƥ˜óŐѹ›óŐƨƦѵͪôȄƦ˜ñ̒Ԭó@̎ɝŐƧȁρ˜óφƩóóôƨѶ̏—ƥʶυ˜ɛ̒ѵȀ'], + 'encodeOffsets': [[ + 119161, + 35460 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'chong_qing', + 'properties': { + 'name': '重庆', + 'cp': [ + 107.7539, + 30.1904 + ], + 'childNum': 40 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@əȂòɜƨ˜ѺɛƦȁ̐@ƪ—õŏφƥòȃƥ̍Ƨôυ̏ƧôñóóôɛŏƩôƧƥôƧóυƨœ̒ѹôœƦȃ@փƥɛ̑@@ɜƧó@ɚƧ@ñφσõ@ŎɝôƧ—@ʵѷóƧʵó˜@ŎóŐó@ôȁƥ›ó̒υôóʶə˜ƧȄς̎ƧȂôƨƨƨφɛ̎Őƨʷɞ@ςԮóŌôôφ@ɜֈ̎ƨ'], + 'encodeOffsets': [[ + 111150, + 32446 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'ning_xia', + 'properties': { + 'name': '宁夏', + 'cp': [ + 105.9961, + 37.3096 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ల̒ôޠφӒςôƪͧυևɜŋѺó̎ȁ̍ɛ@ѹס@@ʵƧȁôó@ǿ̐ŏöʵɝŋɛ@ô̑ƥóóƨƧ—ó˜ôœó@ƩôóƦ̍œóȀƨŎɛӒôŐυͪɛ@@Ȁə@'], + 'encodeOffsets': [[ + 106831, + 38340 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'hai_nan', + 'properties': { + 'name': '海南', + 'cp': [ + 109.9512, + 19.2041 + ], + 'childNum': 18 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@φɜƦʶ̐ôφô̎@ƨŎö@τʵƦ˜ԩ۫õН̏óƥȃƧ@Ʃəםƨ̑Ʀ@ޤ'], + 'encodeOffsets': [[ + 111240, + 19846 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'tai_wan', + 'properties': { + 'name': '台湾', + 'cp': [ + 121.0254, + 23.5986 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ô—ƩɝöƧɝѵəޣ̏ρƩԭóōóͪρɞƧОôԪ݈ଦѶɜ̒ɛ'], + 'encodeOffsets': [[ + 124831, + 25650 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'bei_jing', + 'properties': { + 'name': '北京', + 'cp': [ + 116.4551, + 40.2539 + ], + 'childNum': 19 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@óóó›υóôƥ@ŏóóə@ƧŋƩŌρóɛŐóʶѶʴƥʶ̎œôƨɞ@óŎɜŌ̎̍φ›Ƨŋƨʵ'], + 'encodeOffsets': [[ + 120241, + 41176 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'tian_jin', + 'properties': { + 'name': '天津', + 'cp': [ + 117.4219, + 39.4189 + ], + 'childNum': 18 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ôôɜ—@ƨöɚôœôôɚŏ@óƥ@@ȁƦƧɜ@óƧƨƥ@›ƧóəН̏óѷɜ@ŎƦƨóО'], + 'encodeOffsets': [[ + 119610, + 40545 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'shang_hai', + 'properties': { + 'name': '上海', + 'cp': [ + 121.4648, + 31.2891 + ], + 'childNum': 19 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ɞςƨœɛȀôŐڔɛóυô̍ןŏ̑̒'], + 'encodeOffsets': [[ + 123840, + 31771 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'xiang_gang', + 'properties': { + 'name': '香港', + 'cp': [ + 114.2578, + 22.3242 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@óɛƩ@ρ@óœôȀɚŎƨ@ö@@ōƨ@'], + 'encodeOffsets': [[ + 117361, + 22950 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'ao_men', + 'properties': { + 'name': '澳门', + 'cp': [ + 113.5547, + 22.1484 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@X¯aWĀ„@l'], + 'encodeOffsets': [[ + 116325, + 22697 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/chong_qing_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '500242', + 'properties': { + 'name': '酉阳土家族苗族自治县', + 'cp': [ + 108.8196, + 28.8666 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@XJ°œlJX@lbl@XbV@VLnJlxnbšƒUU@IVK@lVIVwnJlU@n@J@L@Jn@l_nWVLVln@@blLšmV@@xœÔ‚`nœ™xV‚ÈLlx„LVxVVšƒV_U»VWn_m¥XwVmnX°ƒlmUUVwÞaVƒk@a@mmIUa@™mwk@™ƒm@@U¯a@UV@@K™@ykkmwkV@kU@ƒÑƒVkKWLÅamaUm@kyU@WkU@Ua™IUašVaUUmUUa@aVLXKWa¯UUbmJXnWnX`l@@xkzWÆ@V„LU¦‚x@b@JkIkJ@LmbUamJwm@óxƒnk@V„@x„ŽVnUVmVUVŽUbVlUbkXWŽ'], + 'encodeOffsets': [[ + 110914, + 29695 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500236', + 'properties': { + 'name': '奉节县', + 'cp': [ + 109.3909, + 30.9265 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@WVXb‚UnK@x@b‚²kxmKkl¯_ƒVV°™VU@bnKVVV@@nkŽ@n›bn‚@š°@VLČUš@°WV@V™nU@InKVl@nU„b˜KnX„WlknLlKUwnalLša„VlUXmWk@UU@UWWIUyķ¹XaWW@X™ƒKUIVm„U@W@UVU@KV@n»VkUkÇmUmVIUmULUbm@ƒwUaƒKkkm¯ÑUL@bWVnx@VmxUI@„klmkkK@aƒK@IlJ@I¯ƒk@mak@mnkJVL@bV@Ub„„W`UUUV™I@VƒU@VVbUJVLUVVbUX„VVxk¦VJUnVxnVVUšJV@Ubl@@bXV@L'], + 'encodeOffsets': [[ + 111781, + 31658 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500238', + 'properties': { + 'name': '巫溪县', + 'cp': [ + 109.3359, + 31.4813 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nLWbX‚VLVU„V@KšIVl@b„@lbšU„VnU@JÆU@V@n°KĢUl@VbÞKšVš@„_„V‚KXU‚U@KXƒ@wlkkU@mWKUU@UôJ@XV@œaVmÞIVaVLƒƒ@»kmƒ@ƒUkL™U@aU@WWƒLUUU™™KkbƒwWa@KU@kaƒXmW—LƒamVk@UmL@JmVUšU@¯X™@ċVUK¯@ÅnWK™LkKULWK@UXK@wW@™LkV@bVLƒlXn›`¯xU„°LnŽlV@n°Lnl'], + 'encodeOffsets': [[ + 111488, + 32361 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500234', + 'properties': { + 'name': '开县', + 'cp': [ + 108.4131, + 31.2561 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@n@na‚I„wš@@VVK„LVbVxnVÆUnanKWXamKmk¯K@mkUm¯KVƒ°w@Wm@UIUUlKUU@a¯KWanwmUXamKkUWUnU@KƒkUwWKXaWLUWkImaUUUƒƒKka±k@lƒ¯w™wmbUƒ™ƒkXm@UJkIW‚XXƒbƒmƒ„UJ™XUV@°šKlšlVXV@xmbnV@blV@VšœU`UL@V™a@bULlb°VXbܚ@V@bƒL@J„xnLVb@lVb@V@@z˜bXWšX„KVLV‚š@@bUVVL@b„„lVna@ll@„zl@@J'], + 'encodeOffsets': [[ + 111150, + 32434 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500243', + 'properties': { + 'name': '彭水苗族土家族自治县', + 'cp': [ + 108.2043, + 29.3994 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„Jlb@nVV@bXb@ÆlL„Ul`nVKU¼VxkbW„nlUxlXX‚@°°WnnJ@VUn@J„k°L@VlV@nUJ„x@bVVVz@VnLla„KnalVlIUŽ„¼@nV@@anKUwVal@UlJœƒlI@akU@UWXKVI‚¯Uak@@KmkXWÜkXWykIWwXw@laXamkVUUym_XmlkkmmakwmIUKU@Wak@kaW@kI¯›WIk¦VŽƒUUƒmaUV@XkVUV±aUb¯b¯¥m@@ImJ—@mƒmL@kUKUkkJƒbV¦'], + 'encodeOffsets': [[ + 110408, + 29729 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500235', + 'properties': { + 'name': '云阳县', + 'cp': [ + 108.8306, + 31.0089 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lb„LV„VVnblJVXXKWbXLVx„l@LmVXVVl‚nLWbnVmxXb°L@bVVkLVVVJn@@X‚‚œ_Wm„kUK@alUšKX@@xWL@VXLVKlLšKXLÆm@™mœa@ml@mU@UUmL@aVšUU¯„U°`lknLlw±@a@wmLVWaXU@KWU@ak@VaU@™IUVmUUwVmUIl¥UwƒUVWUaVUUKVIUa@UUUUJƒUUm™kƒ„nl@„@VWV@L¯aUb™Ulxƒ@@b@VULUx@VUxVV™U@bU@mxU„U@mUVŽklkkƒ@WxknlxK@amLƒKU„K'], + 'encodeOffsets': [[ + 111016, + 31742 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500101', + 'properties': { + 'name': '万州区', + 'cp': [ + 108.3911, + 30.6958 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ĸĊVI„ƒ„n„aWWXlJVIn@lWš„V„našx°xk„l@²Ž‚LVƒ„LnK@b‚LkwlmXw„@lllkUnVV@VƒnwV@@ašVUUVw@UVwVK@U@a„@kwšVVa°b@KXU@U@ƒmk„ƒÇсaml™kUVmn@VULU˜m@kUVkUaƒwUWm@Uw¯„mKUUmVUUULUKU„W@XbWVkaWwkUU™ƒ™k@maUbmbVlk¦ƒxUVUIWVU„kJVVkL@UmJ™UUVU@lLUVU„lx„@@VbƒJ™U™L¯¤@Vƒ„'], + 'encodeOffsets': [[ + 110464, + 31551 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500229', + 'properties': { + 'name': '城口县', + 'cp': [ + 108.7756, + 31.9098 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VK@w¯L@m@UÅV@ImVƒU™Vkaƒ@@aUk™J@LƒUUVUKmLmbÅVmUUwUaƒKUL@U™@ƒxJmbm@nVJ@X@VkV‚n™lƒLXx™@ƒb@bUVƒLU`UnƒbU@@ŽmVVX@JX@VLVVšklV—„‚`@bUL@V„LVKn@‚U@„UJkn@lmLmK@X@Jn@mb„nÞWVXnJ‚k„KČÑÆ@VK@knaÜmXlUČW°kôÇƁ@a@yÞ_VmƒUnU@K'], + 'encodeOffsets': [[ + 111893, + 32513 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500116', + 'properties': { + 'name': '江津区', + 'cp': [ + 106.2158, + 28.9874 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„InWUUlU@LVašlX@°²lÒXxlK@Ul@@Un@UaVJ@I@W@UƒUUVUwVIUKUa‚UUVwn@Üx@XUlnn‚bœJ@¥VklKUUlk@ynU@kVƒUUVWnI@¥V£VWVIUKU@UVƒa@n@Vm@@nlUaVkUwƒJ@blLkLW@XWmXkmmLn™@m@U@UVm@™„UVUUlakUVa„ƒVkV@@wnaWUk@VwkƒlmVIkUUxmJ@U„™@KƒIkx±V@IUm@K@IUKkbWKUbn„m„@bmVnbmb@xkxUJ@ULW`@bX@WVXL@Vƒš¯„mk¯@UJ@VmLUaWnX@WJ@nkKkxW@UIV@@KkImmkK@UW@XaWIU@U‚ƒIkbWb„xXŽlLVbnV@bWlX@VxVLnl@nÆÞVÜ'], + 'encodeOffsets': [[ + 108585, + 30032 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500240', + 'properties': { + 'name': '石柱土家族自治县', + 'cp': [ + 108.2813, + 30.1025 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„š@kl@š¼UbmVXJ@bV@nxVIVJULVVk@@LWbnJVU@bVbUJ@blLXnWV—@mbnV‚@V„„bn@VJVLnaVanbl@„šVšlVXxlbXUWaX@VƒUUVwUUVm@I@WmI@a„mlLœ™lK@alwnUV@kóVaƒÝk@UlbVK@™VU»VUUVWUƒ@U`ULkwm@@KmU@knKƒ»VkJkUmbƒLkbmK@UUyUU@aƒwm@@XXJ@VVLVVUbVnUJVX@K„„k`WXXJWXUbmW@bkL™Um`Xnƒb@JVL@LU@™°VVXKVnUxVLUbmJ'], + 'encodeOffsets': [[ + 110588, + 30769 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500237', + 'properties': { + 'name': '巫山县', + 'cp': [ + 109.8853, + 31.1188 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@kVƒU™bkKmbVxkLmKkllbV@@LXb„xlašLVšVV„KXXV@@bšVlK„V„@ln@¼°KXa„U@Ulw°JXalIUa„ÝWXW@kVU@ƒVUVWUUUamUw@aVamwn@VUUƒlLXWm£@wÇĉkKklmLUÒ¯ƒWn™@ğ±kwmaWm¼U@@LUV@V@XƒVUnVJ„LWš@‚XXWbĸºVzXJVXV@@VXlWn'], + 'encodeOffsets': [[ + 112399, + 31917 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500102', + 'properties': { + 'name': '涪陵区', + 'cp': [ + 107.3364, + 29.6796 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nèVblĖVVnLšŽ„@šx‚V„n@nšJ@L„UVVX@lbUJV@@nn@VVVK@z„˜V@nzVJVUlmX@@_VVVbnaVal@@knW@wnaƒVK@aVI„J@£kUVW@‚wXUVJ„amƒ@Ikƒƒƒƒ_X¥ƒ@WwkKkwmŽ™šƒkUxƒnÅmm¥™WV@Um@UlVL@JU@@Xƒ@UVkKVk™KVk™Kkb@bmJVXU„VVUbU@@`W_UV¯b'], + 'encodeOffsets': [[ + 109508, + 30207 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500230', + 'properties': { + 'name': '丰都县', + 'cp': [ + 107.8418, + 29.9048 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Þè@XUK@LlV@blbUJ@„„V@bnV‚@VVVXU@ƒlbXal@VXnKV@maXUރ@amk@aVKXV‚anbš£°mnIVaUKVwUmWLUUš¯V@@KUK@I„aWmn_šVlK@anXVaXWWIXWl_ƒƒ@LUWVIUmVaUUUK@UWI@Wn@VI@mkU@U¯Kƒl@ImVÅLƒwU¤óbUU@wWXkmm@LU@@VUIWVUL@JUnƒaƒx@Jn„ƒbUIWVx@ŽUXlV@¤ƒIUJ@bUL„Žmb@xmX@lk@UbmbUaUU@`W@kn'], + 'encodeOffsets': [[ + 110048, + 30713 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500232', + 'properties': { + 'name': '武隆县', + 'cp': [ + 107.655, + 29.35 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@l„„w„bVm@IVKXUVJ@UV@@KnnWlX@xVVôaV£„xÆKnUVm@UmIXm¯¯@WkWVwmkXƒlaUwV»ULmk_ƒVkK@ÅWa@aUU@mkaƒIƒb@‚n¼ƒnm‚_@mmK@UƒLUVVmI@aUJ@XWJ@U`UIkm±kk@@lULmUmKUnVšnlUVmI@VkVlx™bkIƒVmLUxkKUŽ‚Xš‚n¦Æn„mVw„lš™nlxlLXx„@W¦„`„„'], + 'encodeOffsets': [[ + 110262, + 30291 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500119', + 'properties': { + 'name': '南川区', + 'cp': [ + 107.1716, + 29.1302 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VšUbVJVUn@VLX@WVXVVI@VUVWxU@mš@ĊX@@¼V°aVUX`@_V@VaUUVƒUWnI@alašLUlšLUllLVU„@@WV@@IUKVkn@@VlLVwnK„UlJšakwlU@UnJVUmkU™VmXa@wVK@UUw™@VƒVI@akƒ@alInwlKXUmaUW@wWLk™™KVak_ÇaUƒƒV@šXbƒLVxUlWIk@UK@V™@ƒkU@VbUVUlVnƒLUV@lVXmxkV@L@V@Vk@WbUwmL@JUI@xVxkx'], + 'encodeOffsets': [[ + 109463, + 29830 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500241', + 'properties': { + 'name': '秀山土家族苗族自治县', + 'cp': [ + 109.0173, + 28.5205 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@XlV@lzn@VŽnbÆbXKlL„U„ÒV@@llUnxll@zšŽ@LU@@V°b@Vn@š„l@VÑUƒnK@UšU@aUaƒkVm@K¯wƒklmnn„Ul`nI@almkIUwmWVkUaƒkkJmUUa@K@aU@@_m@@wUyVUUa@Umƒ@awl@Wka±„UkUykIWV™b@bUVk@›aU@UXU‚UIWakUWmUxUV@nUVWbšŽ@XXVVŽmXXŽ@VƒbVLkVWx'], + 'encodeOffsets': [[ + 111330, + 29183 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500114', + 'properties': { + 'name': '黔江区', + 'cp': [ + 108.7207, + 29.4708 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VX@V@LV@VJUL@lVnnxlb@VXV‚XV@@W„@UIVK@kUKna@£VWUaVUUalIVJVIUW„_lm@bXKV@mn@J„UUw@KnIVll@VanLVmUkVKXLVKUIVamw@UaU_lw„KlwUWV_Ua@aUa@KUšwm›_›Ó@wU@™nkK@am@UkUKmXk`m@@I@K@I@mkVmIUxUJ@kUL@JVV™„lnklWnn`VzUVnlWbkb@WxXxlJXzWŽÛlWXnl@Ll@Vb°UJWLX@VlV@bkJ'], + 'encodeOffsets': [[ + 111106, + 30420 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500117', + 'properties': { + 'name': '合川区', + 'cp': [ + 106.3257, + 30.108 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@XKVXlK„ƒVL@UnV@aValXXK„U@WVwUaVU@IV@@aVW„L@U@anVV@@bVK@UVL@bnJWL@VnUnb˜@@JnIlVl‚@@bXIWbn@UKVLVKXLlaV@VVnK@bVL„m„IVƒ@KmknUUWVI@aVJ@_„WU_VmUwƒU@K™ƒVak@am¯mJU_UJUkU@WkIV`UI@JV@LmmU@@mƒbUzś™@„VK@nUKƒ„ƒb™akb@UWK@bkVVbV„Û@@`ƒXk@WŽ@n@lXL@bmb@VVJUn@JnUlnUlmX@`XLlbkJW@kzlb@`@b@b'], + 'encodeOffsets': [[ + 108529, + 31101 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500222', + 'properties': { + 'name': '綦江县', + 'cp': [ + 106.6553, + 28.8171 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@¦‚@X„lVX@@UVKl„VUX@lanVlUVbXWVXVƒ„VVUnKVUlwUwU@UJ@nmVkUV™lwXam@VaUUUw@W@kk»mV@UmKkwVKVUU@@LUKVI@mV@XVWxnXVKUUUK@wWU@UUWnUlLXa‚mUI„am@wI@K@amIm‚UUkI@m‚akUkKWUUanƒ@wƒamLVxk@UVmUUL@Vm@kV@I@ak@@bWVXJlLVbVL@š@bn@@`Un„@WbUKULWVXbƒ@UVmbX„WVƒb@bVmxUKUƒV@šUn@V@V@nmšnKlnnWWXX@lKkK@a„IVxUlVb‚k@mn@@U@m„bVUV@VLUJUXU¤'], + 'encodeOffsets': [[ + 109137, + 29779 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500233', + 'properties': { + 'name': '忠县', + 'cp': [ + 107.8967, + 30.3223 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VLÞĊ„U@Wš@¼V‚„@lk@w²mlšVUœ„llšVnI@VlKUUlIVƒXUVJVU„wl¥UkUKUIm@ƒaUƒ@mUna˜@XUWmkK@aVIUa@aUVmIXa@Kl@UUVKUIUJmwU@@aWInUVa™»k@@lƒ™¯n™¤mabWUUL@bnl@b݄WVnbU@mLUWk@Wbka@„WVUU@UmUmVkUULV„lVUx„l@L@VƒbÈÒlb'], + 'encodeOffsets': [[ + 110239, + 31146 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500228', + 'properties': { + 'name': '梁平县', + 'cp': [ + 107.7429, + 30.6519 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@XLV@VV@b°°nšƒnkb@bƒšnJWVXblIUVšxWnUJnVVLVU„JlUnLVK@UnUVJš²nKVbVKla@aXlJ„k„Klb„ƒ@U°£šKšV„IUa@ƒ@kwVƒVUkKV@VUkk›ƒUVk™±n@xklƒ@U@»™‚@XƒVÝĉUJnxWb@UX›KkVUbUKWUkVmkkLU`›b'], + 'encodeOffsets': [[ + 109980, + 31247 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500113', + 'properties': { + 'name': '巴南区', + 'cp': [ + 106.7322, + 29.4214 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nxnVlJlUXLƒ¦@x@Vl@nKVVX@V_V@@KlVXU„@lKlxXIl@ÈĊ@Vl@n_VJlŽnVlnb„²VVVJVVmUUkĕUamçU@»W@@ĉn™V@XwVU@UUJWUXUW@UKm@UVUIVaU™UVmLUVƒUU„UWWXUakVmUkbW@UVkƒUL@VW@kUWƒ@mJUXVVU„@lmV@zklVVkLUl@¦›I'], + 'encodeOffsets': [[ + 108990, + 30061 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500223', + 'properties': { + 'name': '潼南县', + 'cp': [ + 105.7764, + 30.1135 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@a@a@_kalyX@lIkaWK@_nWVkkmmV@IVmUI@Una@aWK@k@mkbWaknmJUk@mk@@kUal@Uaš@Wa@aXLlwUKlkkƒ@KmI@VUJ@Lk@@VUUmL@amJU£kKUaWakLmU@bVVUbnbWV@xkL@bUb‚xUxVbXJVbUVWIUVU@kLWxkKWV@n¯VUbU@@VVX@VmaUL@VUK@VVbn@lVnI‚@@lnLULm@Ub@Žl@na„@lK@XVVkJ@b@zl@@VnV@bVb@J@bnXV`lXXmVI@W@InbV@@aVKUblKVLUanLlmnLlK'], + 'encodeOffsets': [[ + 108529, + 31101 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500118', + 'properties': { + 'name': '永川区', + 'cp': [ + 105.8643, + 29.2566 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@b܄nWVLX„lxV„VxXxlVn@@bVblK@a@UnLVJV@@UnLVU@VXaVKVXš@n`WUÿ@IUKlaUUUkWyUÛÅÝ@mmkUKUwW@Xk@amUUakKWƒwXaƒK@VVLklƒXVlkxV„UL@bm@Vxn`ƒIVxUVkLVšUšl@@lkXmmƒVUn@VV@Xb'], + 'encodeOffsets': [[ + 108192, + 30038 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500231', + 'properties': { + 'name': '垫江县', + 'cp': [ + 107.4573, + 30.2454 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@šĊ°¤nҘ¼œaV_lKnllUXVVLValUœLVW‚@XamwVIUKkaÇфa@U@KƒkVwkUUƒVKlVnU@aƒU@ƒVIka@akU@KVL@WÝçUV@Vmbů@L™KƒnnJW„ƒVkxlL@VX@VxmnXVWxUb@bkn'], + 'encodeOffsets': [[ + 109812, + 30961 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500112', + 'properties': { + 'name': '渝北区', + 'cp': [ + 106.7212, + 29.8499 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@bVVXL‚a@lnbWn@L„@XVlK@VVLUVlbkLUKVVVL@VšnX‚VL@VV@UbVb@x@¦UxVb@bUJƒL@L„VVxlK@™nk@U@W„UVLlKXV„@VblU@UUKVU@wn@VJVanLlkX@VaVK™¯@a@U@U@ƒVaUK„kUUƒ±maUkm@UUkbm@@Vk@@JƒwU@Ub@I@JmwUL@aƒ@@KkVÇLkƒWkƒ@kUU@@xUVmKUnllUb'], + 'encodeOffsets': [[ + 109013, + 30381 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500115', + 'properties': { + 'name': '长寿区', + 'cp': [ + 107.1606, + 29.9762 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VVšU„bX‚lX„¥l@XnVmlxUx„@@blVnnôĀlm@aVaXwWUnmUwW@@UkKlw„UXƒmI„mšL@KÆ°na@UUImyU@ƒ—@yULUUm@@mU@VIkaW@UUƒV@K™I@mƒmU™wƒ@™mKUnU‚UIƒlVLUb@„@V@V@bš°ULUbW@klmKUbUIm@@xUVVL'], + 'encodeOffsets': [[ + 109429, + 30747 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500225', + 'properties': { + 'name': '大足县', + 'cp': [ + 105.7544, + 29.6136 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@XUmaVaUU@anVlKXbValU@aV@@IXKš@@bV@VxVK@UXLlUšJXa@_‚@@aVK—ÅWVkwWaƒƒwUa@am@kUWLU@kWmX@ykI@W@UV@na@LlLV@UƒkwWƒUKmXX`mIVl@bXLWVkbkkƒx@`VXm@@J@U@UUKUxk@WbUIVl@VXLW„ƒJUkUlUImxXlmb@X@VUJUnVbšW@UV@@VVX@bnW@LVxUnlJUV@n„@VxVIn@l`„UVVVL'], + 'encodeOffsets': [[ + 108270, + 30578 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500224', + 'properties': { + 'name': '铜梁县', + 'cp': [ + 106.0291, + 29.8059 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VblLV¤nI@bnKVV@Ul@@KVI@UnJ@Ll„klVLkxWK@bXb™@Vbk@Vb@ll@@nVlnIlmXblaXl@„W@_Ü@UƒUalU@aXL@Vlašb„a„ƒVL@mUL@ƒUUƒƒÇXUW›X_WaƒƒUƒ»m_™@UWULWb@UUVmK@VU@UImK@V@bkL„x‚„XblxXU˜ÆUL@b@@`Wb™IkVWK@VULUwU@@a™@WL@JU@@bkVUb'], + 'encodeOffsets': [[ + 108316, + 30527 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500226', + 'properties': { + 'name': '荣昌县', + 'cp': [ + 105.5127, + 29.4708 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VI@U@WnaWknwVJVkVl„IXƒWK@UUkVJXal@VwVL@V@V@In@UW@_„wlllaXUWK@aUknJW_ۃ@aWaU@@UVm„UUaUImJVnÅUmVUm`kUUVWLnVU@VVmXƒK@„nxmŽULkx™ImJ@nU`@X@Vkn@`@nlV@nVJVaX„VLnK@bVV@nV@lbXWš@'], + 'encodeOffsets': [[ + 108012, + 30392 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500227', + 'properties': { + 'name': '璧山县', + 'cp': [ + 106.2048, + 29.5807 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@XzVlVVkbVL@JVĀXŽ‚¼V„„„XbW`XœWVȎ„„VVšŽVkV@@UXa@alK@IƒƒU@UKWUyUI@wVUUWVak@VUkƒW¹@WXI@yVIUK@kWwkѯ±W@™kUb@KkVVVmXƒJ'], + 'encodeOffsets': [[ + 108585, + 30032 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500109', + 'properties': { + 'name': '北碚区', + 'cp': [ + 106.5674, + 29.8883 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@X‚VLV@„„@JkL@bWb@VU@UlƜVy„a@nV@nn@KU@IVJU_lJXV@VlVIV`nIn°@b‚lUbš„„KVI@aUaVw@¥@wUaVaU@@UUKW™m@UUKUUVLlKkaVUUK@UkLWUƒ@@KXmma@kbWKUU@aUamLnÞ@VWLk@@Wm@ULU@@U™KUVWI'], + 'encodeOffsets': [[ + 108855, + 30449 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500110', + 'properties': { + 'name': '万盛区', + 'cp': [ + 106.908, + 28.9325 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VIV@@wVJ@InKVxXal@@U@U@KlUnwUW@kVU„KUmVkUa@I@KW@@bk@@mƒU@m@k@a@aƒIUxmJk@ƒwULƒwkKmVVX@VXV@xVLVVULmWXwWUU@@nUJVL@KV@UVULlxnL@VnUl¼@l@XVxVVUbn@WbkxUšlVnU@m'], + 'encodeOffsets': [[ + 109452, + 29779 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500107', + 'properties': { + 'name': '九龙坡区', + 'cp': [ + 106.3586, + 29.4049 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@XK‚L@Vš@XbV@lW@UV@@VXIV@U™VKlL@KnnJ@VV@VU@I„@@mVUVWUUmL@V¯LUK@UV@UU@a@U@yU@WLUK@X@KUVmL@ƒ@aXI@w@ammVk@WÛwm@UxVVVbVLUJVxVU„V@V@X@JUIVbm@@Vk@@VkL@lVLUJ@zWJ@X'], + 'encodeOffsets': [[ + 108799, + 30241 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500106', + 'properties': { + 'name': '沙坪坝区', + 'cp': [ + 106.3696, + 29.6191 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Xºl„UVl@UbVXUV@xVJVzXJVUšL@VV@VKn@@Xl@XK@UmÝnKVbVakkVm@k„ƒUK@UmIm@LkKULVšU@WJ@UU@@VkXU@Wa™@@UKWL'], + 'encodeOffsets': [[ + 108799, + 30241 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500108', + 'properties': { + 'name': '南岸区', + 'cp': [ + 106.6663, + 29.5367 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VV„JVL@bUVVnl`XIlwXJlw°nnl‚IXW@UÇĉk@WJkwkLƒ@WVkU@LU@U`W@UXUV@n'], + 'encodeOffsets': [[ + 109092, + 30241 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500105', + 'properties': { + 'name': '江北区', + 'cp': [ + 106.8311, + 29.6191 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nLVU@wV@lV„@Xll„ÈKlU@L„@@bVKnx@I@JVaV@„x@Il@@Un@laVVn@mkUIm`k@WXJmk¯mkxWIkxWJk_UmVUUKƒ@UU™@ƒ„@l'], + 'encodeOffsets': [[ + 109013, + 30319 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500104', + 'properties': { + 'name': '大渡口区', + 'cp': [ + 106.4905, + 29.4214 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@k@@U@w„¥WKkVkImUmwa@b@xWJ@b@„nKVU@L@WVLXKV@@z@V@bVVU@@VVL°K@U'], + 'encodeOffsets': [[ + 109080, + 30190 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500111', + 'properties': { + 'name': '双桥区', + 'cp': [ + 105.7874, + 29.4928 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@WwUwU@kK@KmbU@@V@XlJ@znWlXV@XK'], + 'encodeOffsets': [[ + 108372, + 30235 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500103', + 'properties': { + 'name': '渝中区', + 'cp': [ + 106.5344, + 29.5477 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VLš@VV„@VL@aUKƒIUUƒ@@JUVU@'], + 'encodeOffsets': [[ + 109036, + 30257 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/fu_jian_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '3507', + 'properties': { + 'name': '南平市', + 'cp': [ + 118.136, + 27.2845 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@knyƒk@ƒKU¥šwV@nkƒWƒzUmk@@lKUa@aVI@UƒKUamKUUVaUI‚@Xƒ@UV@K±IUVVlUbUbUL@KWUXmWk@KkXmmkŃKUƒ™a@amUƒbkUkKWUnwUƒÇwV™UUƒÝUKV£U™@ƒnKWwXLVKm¥@wUXkmWk@ƒ@wX@lU„@šyVImaXwVƒƒ@kŽƒnU@mbk@mlUXƒmU@mV@n@bnW@bUIWJ—ImVUKWbUK@nkKƒaU@W_VUUmWmL@UU@™bUWUL@V@bmVUz@`mUUVVbXL@V™L@lmLUxmVamXkW@xWbU„VbUxkU±@ÅUmmkLUbW@@`kLknVlV@lbXxlVUXVV™ŽU„U@UbWŽkIWVUUUJkI@llbUxVL@V™VƒUU°ULUmWXUV@VULWb@™xm@UaVLVKUa@ƒw@V›bkmVambUUm@@VkK@„@b„xlxX@‚„n¤@Xƒ@@lkLWV@Žn„V„kb@bWJXLWx@nkxmm™bXn@VWVUn@VnJ@bVXl@„™VJXnWbX`lL„UlJVI@Žœ@VXV@Vl@bn@@Æmn@VšxXU@mVIlxšVššnI„l@nVJ‚aXI@mlU@aXkVm°klmnVV_naš°@V@xܦXK„V‚nnUlVXbVK‚LXKV@naV@@VVl@@lXblXšWnLlbVK²nš@@‚VLUnlV@lƒXxô°‚V@UnaUUlKXLVUVVUbVVlUnJVX„@VW@an@lb„@nl@VU@anƒšUVW@kƒaUm@InVVKVU@kUW@Uam@km@kVa@a@™nwšU@WlI@mVI@WXaW_nƒ@™nƒlkkW@U‚¥@kV@Uw@wUƒ@@IXK‚¥VIn@nU@`@Xl@VV„LnašW‚bVaUwnU„@VIšKlV'], + 'encodeOffsets': [[ + 122119, + 28086 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3504', + 'properties': { + 'name': '三明市', + 'cp': [ + 117.5317, + 26.3013 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lL@Un@VVna‚bnUlœa@U‚x@„VbULUKVbn@šw‚@XaVK@UVUXWVnVKV¯„VšU@UUKVwka@klJVIVVXUlJXVaV@VƒšUUVWkUWwkaU@UklmlK@_X@ValKnnÆV²@lVVwUaVƒXa@wlXnW‚bnUVwnK@kšK@UWKUaVUnV@_VynU@a@UVKVXšaV@@VnKnXVV‚UX`V@„blL@mVLXaVLnU˜JXIVJ@amX@a@mnUV@„nVWnkl@naV@„ml„@@KmKUam@UU@ƒ@UlKU™Vk™U™K@aVaUwV™U¥UIkJ@wmI@‚mbkwkVW@UXƒKULU`™IVKUa@LƒkkVmUU@WlULUWÅU@I@ƒWW™nU@@w@a@ƒUam_XyVIVWkkƒ@mwVKXUV@nw˜VXkWƒÅ™U@ƒaƒU¯KUnƒK@ƒ¯šmUƒLXŽVLnWVbVbUVm@Ub¯¼W@amƒ`kb™amLUUUƒ™aUXV`@x@XmJ@n@L@xkJUU@kU@mWm@kUUwUUVWl@VUkIƒy@kkaVUUm™IWVXbWxU@k„mVkK@nWVX¦WxU@@bkx@VU@WŽk@™kUbmJUUmkUW@_kKWKƒ@knV¤kIUKWLUbV‚@Wbk@@VWL@VkI@lUXVxUVU@@mWIƒV@a¯nUaƒaUV@„ƒJ™b@bÞ°VbUš@X™aUVmL@‚VXblŽnV„°˜n@Vnx„@VUUUlK@InJVb@„Vlnn@V™L@VWJU„x@XlJUVVVl@LUUUJ@Lƒ„@lUL°¦k˜V„VnV@„xV„„l@blLnlšLVaXll@šnVUn@‚xn@nml°‚X@lb'], + 'encodeOffsets': [[ + 119858, + 27754 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3508', + 'properties': { + 'name': '龙岩市', + 'cp': [ + 116.8066, + 25.2026 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ša„I@ƒVU„bVb°m@b„UXJ@nV@VUUwVW@klJ@UXK@Ul@Xa‚@UVaXKVLlJU£lm„@XLlL@`VXnlVVnIVašll@XV@@Ulw@aV@XwW¥XU@mlLnUlƒV@XwWaXUšJVnUVlb@l„zlJUVk@UXVVVxlVn@nXV@@lVVlI@w@K@mnI@W@wU_VWšbV„VVnKšbla„_n‚bX@°»Van@VUUaUamXUKW„K@a@Ukƒ@wWkXƒWW@wUU™Kw@_lyƒwUkU@@Uƒ@kamVmƒXašUVUka@Wk@»UUUVƒKkbWU™VUbk@mkƒxkƒƒKnIVUmW@kUKmXUmVaU@kU@m@KUWVkIWJ@ŽU@UI@wUUUa@KW»nU@mVkUmm@XwWU@ƒUUmL@ƒw@mnƒVUU@aWak@@amxU@UxULWVXbVLU`mbUImVU„ƒbn‚V@@bVn@bnVWxLmyUbƒIUKƒ@aƒVm™akbV‚UXW„UlKWbkV@„WLUlk@@nšbƒb@lkKmU@ƒUIWJkw¯UUVVxm@@XkbWx—›XKƒlUzWJkUUL@bmKkVƒ@@VUIUlWV@X„K@VkbWx°xUb@LUbk@@VWb@LXJ@VWXU@@bUVV„VVn@VVlLn„@l„@‚xk¦Vx@bVJXbƒn@JlnXxV@@„nJ@X@V@lmx„bUn@xVL@VVKlL@l„„nLVaVL@xkl@LƒxVl°š„X„WVX„Vl„œJWnxlJ'], + 'encodeOffsets': [[ + 119194, + 26657 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3509', + 'properties': { + 'name': '宁德市', + 'cp': [ + 119.6521, + 26.9824 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@LVKVaVaUkVU²J@LVU„@@W‚VJUbVVnLVb„L@VUJ@bVbkL@Žl@Vn„y„XmlU@™xV¦„L@Ž„lmz@lnL@bVVšbVb@l„nšKVk„Vl¤@zXV@šl@XJVLVKnXVK‚VnU@wUm@šKUƒ@UlVlw@U@U@ƒUaUKlU@kXKlmXIWKXaVIVUVK@KU@@k„JVUnLVJUL@V‚IVa@VnLšKUnl`Vb„V„V@š‚Vbn@Vzn@lKnVlI„VVKUalkXJl@XXVWVLVUUmVU@Unm„£lK@Uk@WUXK@U@WVwVkšƒĠkĢÇ°aUÅUwmaţƒɱUÇa™w„±V¹XalKôx„@„UVaÜʓͿVóbÅLƒJm„¯Vk¦ƒŽk@mamXkKUƒUL›akbk@mV@LkJWb@Vk„mXk@UVmaUV@amLUKUamI@KUaU@WbU@UUUƒUIWJUkm@šƒw™Kk„VJm@kxǁVƒUK@mUVUkmlkkVm@amwƒLVWU@UbVLkšUbƒ@VƒmK@XaVWU_VJnwV@@kUmWakxƒ@kwWakIWxnbUJ™zƒ@kVW@@x@„XllnVW@xn¦ULWKXxmL@„VšU¤VL„ÞVVUšÈxV„mxXVlLlV„anV@bšbV„„LlÆnnlW@LXlWnXV'], + 'encodeOffsets': [[ + 121816, + 27816 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3501', + 'properties': { + 'name': '福州市', + 'cp': [ + 119.4543, + 25.9222 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lxna@nJ@xlIVJV¦UšVxUb@bšLšVUlVškL@V@„VVn@Vb‚Ln‚@LU„lJXblx„@lwXbVn@lU@mxUIV`UXWb@‚nLU„„@Val™UKVaV@UX„Knx‚bn@lUkllnUVnV‚@VLU„È‚lwn@UIlƒšL„x‚™n@VlXIVJV„VVV@XaV@Vb@LnJVbVLnK@bVUnbVUl@nWlƒ@UXalI@KnUl@laœbVKV„lLnWnbl@„l¥°Unƒ„IÆKôa΀U„a@UUwÇWǓIUWUÅVkƨm@ƒ@£@KmLU¤ULˣJ™kUƒVǟUUķ@ĉVƒKUk@Ñ°wôǚç@īšé@Åţ¥mīÛkm¼Å@ƒVķVó°ō¦U°ƒn@bVJXVVL@bUŽƒakLmx@xmxXzW`XbWnXV@bWLÛ@™aƒ@ƒaXbWVkaÝwU@mlWKkLWWkLUKULW@kVmVUU݁UamV—¤›n@xUVUzkJV¦lJU„'], + 'encodeOffsets': [[ + 121253, + 26511 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3506', + 'properties': { + 'name': '漳州市', + 'cp': [ + 117.5757, + 24.3732 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@bl@Xb@bVVUŽm„@n„x‚@nKVV@„XVWxn@VnUl@nmVX¼@LVbVV@xVJV@@XIlJXU‚V@Ln‚@lVV@UbVnnWVL@lnXUVmJ„Ll„„wnll@VašUXVla„LVUVV@¼Xl@lbUV™VWbn„nUlb„@@VV@„aVUšmlUašUny@kU@Wkk@WaUVk@@ammk@@U@UlU@aUa@wl@šmXLllnL‚U@anVnU@L@VVV@KlXnWVnVanUšw@w@wm›nÅ@wƒaUam@Uk„mUl@@a„a@U@¥škôK‚wȯ°w@ŻkwǕaK›ÑÛk@ĕōřċ£ĵƒUKW»kÅŻLU@Ulġw@¤Vz™VUbkKUbmLmlULU¼UxmbXl@bWVƒb@bUnV‚UšVbULU@@VkbVL@`U@WX@ŽXV@b°„@b¯š@¤@Xm@@b@`U„VVUL'], + 'encodeOffsets': [[ + 119712, + 24953 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3505', + 'properties': { + 'name': '泉州市', + 'cp': [ + 118.3228, + 25.1147 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Vl„xkz@`‚xšLVV@xXXW„Xl@xl„@V@bnV°™@„„LVm°L„V„bV@ƚX„Wl—UmxU@WVULnx„@llUXUJWzn`Vb@„@b@xV@šmXX@„@JÆVVXVKXkV@nVlU„l@KVbULšJV_VK„LVWX@lUVƒkIU¥lIVyVU@wœm˜£nUVWU@aƒm@UmWw@UX@@am™VUn@@aUUlUVanaWUXWmUnkšK@VšUlVVUUwš@XLWWX™ma@knm‚bVb„VXbVL‚@XJlInlšL„w˜mXóšw@çV»ÇçŋaķƧóƅóKġ°nÅUķƑUÇW@—¯xÇ°öÆlV„n@llšaš@„Lšbƒ`™@™„VšXVƒVx@V@bULVJUk‚Ç@ƒ¼ƒXUKk@mmULkaWbk@ƒx@UkL@a@K@U@UmKmbU@kV@UmVUbUmmXkW@LUU@U@KmVmU@bVmKkkWK™nk@@xVb@bkV@V@Vl@nn@bl@VUXbl@XlV@@lmz™VVbkŽ™nUVƒb'], + 'encodeOffsets': [[ + 120398, + 25797 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3503', + 'properties': { + 'name': '莆田市', + 'cp': [ + 119.0918, + 25.3455 + ], + 'childNum': 2 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VbނVVnUlUX@VKVLlKXXlKXL‚‚nkV@ÞxlbXUWa„b„@šbÜ@XK@aWUXmWaX_Wynw@wnwlK„bV@aUKWUUI@a„mV¯Ŏ¥ô¯ĸU„UÆ@n»¯aƿé@ţ¯nĉĬÝK™óó@™ÑU¼@è™xWô—nƒx™KmkkJWI@UKWaƒUUaamn@lnbWšXXWK™@VxUVkU™V@U™LmlnVWXXVmbUbkVVV@bm@UVnš@bW@@VXx‚n@V„n@bV‚UX'], + 'encodeOffsets': [[ + 121388, + 26264 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3502', + 'properties': { + 'name': '厦门市', + 'cp': [ + 118.1689, + 24.6478 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@VlUV@nanL@V@V@L@blK@V„wl@XalbVKnnl@VL„W„»È@lVUIVK@a@UUw„WUU™šƒš@„_™aƒK™@™bkkm@UƒkõŁxóL™l@¦@Vƒb@bk@VŽƒnVln@Vb„b@xmÆnœ@x@x™x'], + 'encodeOffsets': [[ + 120747, + 25465 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/gan_su_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '6209', + 'properties': { + 'name': '酒泉市', + 'cp': [ + 96.2622, + 40.4517 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ÇnÅaĉ@ƒU¯¥›UŹ‚ƒ£™WUýUU±JkkUw‚yÞIČxĊĕĊ¯š¥ÆUkţ™UÅÓ±¼™IUx¯UƒÒƑ‚ݐŰƒKÝnğ°ÅU@Žƒ@Vn@þš¼¯šWnŎ°XLWlnVnbWnƒVXxmbƒa—bóUƒlǕUUa™IUmlU™ƒš¥™kƒ¥ĉwkkƒÝɛa@¯™™U¯°mVƒkVnKlƒōÑÇÑU@kl™UġŽkUŻnUW™@š¯ƒk»šmWV£UKnUƒmUw‚w@ƒUIVaX™šwm»Èmmwn¯ċ™¯LĉŽUƒJUalka±Va@U‚k@ƒÛф¯WmnUaɝ¤Ûmƒn¯m±x@wóxÛLġÒUx¯VƒÈ™JUbóz݃ÇKĉ¯ōlÝUŎWl¯nťbÝ@¯ǩLġmV@ƯĢkÆm™ĊkVťLɃmÝXó°@„ĢbVŽóVݦɱ@Ƨaġ„UV„ĠÇÈV¼UVţwmbJÇwˋa™XmǯKkkmŽƒbXšm¼V¼ǬŚ²¤ôŰÆƴô̐ŤǪnɆӨ¼ɆLÆłUĊšxŎƞȘǔˎǬǪnƨŮǬö°»šġ„„ÞÜÆĸÒĊ„ǀbƾèôÈ@¼¯þŤĸƧ°VĀ¯b@lÈĊ‚šʠń̐„ȘKǀŽֲॗţÿǕý@ʊǓƨóÆÑǖŃôw@΋ʈƆÅÈVVĊV„óĊÅ@ÞƒĬV@Þīš@°Ž„V@ĸĢƒ°XτƜĠ@ÈaÜ¥Őƅ‚™nğóĕVġUůƿŋ—ĕƒa±V—UťÇğÑ'], + 'encodeOffsets': [[ + 101892, + 40821 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6207', + 'properties': { + 'name': '张掖市', + 'cp': [ + 99.7998, + 38.7433 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ÈÒŎÒk„mLUŽlŽU„¯nV°šš@°ɜb„ÞĠaÈ»ĸl‚š„LVUÈ@Ċ@ýUm„@@ÆVĠ¯Þm„LƯޏƒ„Ñ°VVwšJ²»ÆԚVlŤÅV™¦ĉ°ĉĖċwÝJzVxll²IVVVþšX„¤źœV°¦„VĊ@ÆbÈmǔLĸĠ¯Ģaô¯ĸmÆÛUƒlÇĸk°XyĊUǔV„ǩnmV»ƒa@ýnK°n@l¥@»ż„Ċ¤m皃@£ČU@mƒmVkÞUƐ±²¹°‚ĠwÅƑŃU¯™›V¯aÈŁšƒÇ»™ġn_°xŎKlxœklx„@Þw‚„„@Æm²b‚DzLlkšWXať¯ĊaœÑšK±w@wƒUÅçV±Uk™@@„¯š¯xƒU™±±UU°ōxVxÅÔō°ó¯UÝ¦óbÝþƒ@ĉÈóUV‚Ux„„@VŽUVÝwÅÈǎóVkk¯JǐkmmL@„™KÇx@bkš™@U°ķ²ó`ƒš™šmn¯°ƒUwlÅkUƒ`™¦ɛô™Žķz@ŽÅnÇ°U¼¯KmVk²ƒJƒ¼ƏÞķôš¤ULƒ@mnğ`™šÇnUxÇ@Ûÿ™U@ƒƒkŻŽ@x@móJkŃ¥VŹĉóÒĉlċ°ķ„Uƽ܃@›x'], + 'encodeOffsets': [[ + 99720, + 40090 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6230', + 'properties': { + 'name': '甘南藏族自治州', + 'cp': [ + 102.9199, + 34.6893 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ލš™nKlnšwX¥WÝXk˜xÞUnƒ°aĊVnUUKlÞĶWXnĠ¥ô»„™@nmVL@¤°™Vz„JšanU@aÆwna@k›ƒU¯šyX_›aĉb™ƒ„wƒéXkWwÅaš¯V¥mƒ¯UƒƒI@ƒš@„mšb°aÈçšUš¥@»‚knwɜƇ°I°ÑÈmVU™¯Xa@w‚W@wšV¯Č¥l¯Uwnm@k˜aUaóKkk@™Ça™b@ŽÒWa¯IÇxÛam¼™VUƒxÒl‚@zÝÒ¯bÝaĉVĉwDŽW›zJ™mJn²mܯUƒ¯ĉ@ġ¤Åb@²nšmlƒ@@Ž„„U„ƒLVxšV™„U¼Ålma™b@ƒ°™l@WIUƒ¯@mƒ™@™™ó„™„@U›zţyƒXÇU™ÇVUUVLkbWakVWmUbkkƒKUÆ»nƒ°Knk@aƒUVmšnk»l¯Ģ›lw@_kKVU@ƒnaƒ@lUk@¯¥mV@kmbW™b¯Åõa@mkU@kƒÇŽkU@›`@™óó—bl¼Uxƒn„¼šlVȄx@blVkVVnƒ`XÈġÈ@ǃK£ÝJmUUnUĖmlU„mKUn™VÅaUw›Uĉ`¯n¯wW¼nxVŽ™š@bĉnƒ‚kIċŘkXUŽ±Ò™xšÈ@ŽX°`l„œV˜IȯĊV„ƒšVVan@VašUVażVmšblkÈW„ƒWIXa„alL@wVb„„V„¦lL@lĠ™n҄U‚nk‚šL@ÆÞkšÞšK‚bñþW¦Û„ċVƒ„ULUºkÈlŎUxÆxÞUUxšÒ‚x„@XbšL@lÆ@„ÒlXVln@„bm¼ƒJ@„Ån„šƒx@bnšĠm„xVXmbÈè@ŽĊ£ČW˜w'], + 'encodeOffsets': [[ + 105210, + 36349 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6206', + 'properties': { + 'name': '武威市', + 'cp': [ + 103.0188, + 38.1061 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@±¯¥@klwU»ƒƒÞÝmwKm¯™™ç@™kVÇUL¯lVUKġ„ġm@a@U„@X£°l°LŎÇ@aōVÝw™ÔƒKUŽÅš„WJ¯lm@ÛVWa™@klĉUmaƒLUanaƒ™ƒk¯J„™™±KkXóÜÅxƒ²Ç‚@„„nUÒĊb°@™ÆkL™Ž™XÇÆ@xÝn—xWxţ„¯¤ƒI@Æn„ƒVV„VlU²Æè„V@x²x™L›ÒĉbŦ°Wb™Xklބš@l¤šXĊ`„wl@ĢÈŎm@bšnV‚Ubƒ„@șÆÛLƒèǚUÒŦlĸ™`°ĮʟÆǓbĉôϚĊƚĢnŤé΀ÑĸĀĊ¦„@@l°lœ¦Ȯ¦ɆÞĊKŤ™ĵĸů„»mŁyġ™ķŭ@Çɱȭ¯mƧUĊķnŁŻ»UaU™˜ƛɞÝƨů'], + 'encodeOffsets': [[ + 106336, + 38543 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6212', + 'properties': { + 'name': '陇南市', + 'cp': [ + 105.304, + 33.5632 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@šÈÞ@l`UmVƒ¼œŽ‚@nnÆwVlnVVa„LVƒÈ_‚ÿރ@n„a„xÆ@„lš_š@VxnK@llLnxmÈŎJnbUxšI°Žl@n¦‚lÈIlmX¥„k°@šk‚J„k²é˜@klaUaVaU@@ÝnIWnmnx‚k„ºÞ„„aV™°„V@nw‚KšxôbÞ£šVšU„bšþšLn»mƒVw„IšJ°Ž@„nb@°°I„ġUkÇKVƒ™™@ů»lƒ„Lnmƒ£@anK@Ñ܍n@»mL@£™yk„UUmbUÞÝ@kyÇbó»™XUxƒWVzb±mÝbXaƒwUamL¯»@wUKVwm¯ĵJ°ÅUWVk„KVk°wÈVšVуlUšƒ¥škmVamknƒUw¯¯ƒbċ¥ÅKƒk™Kk„™VċVk£kKVw‚Ñ„a@kóyÛ¯ÇVk™ów›š—Xō¥Ç¼ów™Ž¯U±‚k„ƒ@x›IĉÒÅVmÈnšÜ@n°„bUbÝV‚ŽUnnJ¯Į@‚m¦nV܃@„„L°JXb‚Ñ@šaÈb@šllôLVb—b@lmnVxk°ċ¦U°™Ž@xX@xWbš°UVÇn¯Ò¯Jɛƈmxl@¼'], + 'encodeOffsets': [[ + 106527, + 34943 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6210', + 'properties': { + 'name': '庆阳市', + 'cp': [ + 107.5342, + 36.2 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@kw‚ĉ—»VamƒƒV¯wƒIóVkl¯™Km™Vō¯ÝWkL@bÝKō¦@Ž™„@š™Lx›@b@l™a@km@@l¯nm@UaÅ@ƒ„óWUXm¥™nƒw`@UUxķôÇ°ğ¦@„VJš_n‚‚IVŽnalxkX„JWn¯šnVƒLšxl¤nnVbklVX@xnxmV@bUK@nm@@xƒV—°±aÅnƒŽkUWnUaƒx@m™n@ƒ¯LƒššmUĀlU@lV@blLUblxklkIÇx¯°‚UXbšaVŽUnšV@°‚LUlnbšX@`°nVmbnÆmV‚kLmK™¦UŽ@X„y@kl@U„°K@¼XbW„ƒš@b„WnLVa„VšƒVz@xlVČ¥lbUxލlV„U@nÆWôn²™VJlU„Ƨ„LnmÜLXa˜n@mœw@wlUlV²mšblwšVȃlLލ„±@lVnUlxnkma@mškšJ@kXV‚U@mn@š¼VXUƒVƒlLnmVbôaVnWV»ÈUl°È¯ÆIn›ÆU@kk»mKkÆġk¯@»mƒk—¯@óÇlÇ@—Vykkl™Uml¯Þ™@w'], + 'encodeOffsets': [[ + 111229, + 36383 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6204', + 'properties': { + 'name': '白银市', + 'cp': [ + 104.8645, + 36.5076 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VKUȚl@šè°šnŽ‚LnxÝބ„V¼kx@l‚¦²°ĊóĠ„™Ċ»š@ÈxšaĊxlwÈVŤa@¯²aÇ£ƒJk£lƒnUÞ@°šô™@y„wl»lIX¥Ǫnw@ÑÞWla„ÅlL@ƒUwĉakƒl@ƒš¯mwna°J„V¯nUVÓÞÑm£²óWaUƒÇ@óÝUçV»ÈkkW@¯‚xV@XlK@wX@Vmm_@wÈݙKU¯ÇwVwÅK¯VƒkƒJ™™™XkWVaƒImŽ¯Uk„ÇlVšœĀV°mxóšk„@¼ó„WxĉÜU@Ub‚zÛJÇk@‚ÆnVlԙ@kŽ„x™ô@ĬWL¯ƒƒK@aÛImm™@ƒIUaƒ@™™UŽÇêU¤VÒÇx¯ÒV„šš™lk@Wbĉ¦UbkWV_‚y¯Lƒaó„kŽ@b@nmbkx„°'], + 'encodeOffsets': [[ + 106077, + 37885 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6211', + 'properties': { + 'name': '定西市', + 'cp': [ + 104.5569, + 35.0848 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„a‚V²wVJV_@„LlanÅllŦçÜӚ_šlnƒWaôk„xUš„bmV@È°lèšnk°l¦„`@nnL‚@ÈlÜIyVaV@ĊÛXwôƒ@»lƒô™nwU¯›ÿU™Èklƒ°Vn„JUblXšWšš„I„l°U„ƒVƒš—@aVVVmnL@„lƒ„UUw‚mkƒš£„bV¥VUVwۂƒlaÇÝރmk£ƒLUy¯L@WlkKW_XaWƒ—mƒ„ġU@a™k™‚ƒakXkmVwmŹVƒU™b™WƒónmwnWW£„KÈnV¥ƒ¥„ƒÆ_k™lW„bU¯„V°aôbnaVwmaōInÇmwkK@kmLUw™@™`ƒkÅ@ƒwƒb@m݄ĀÇ`U„ƒKUbmUUkÅxmm@›„»nUVk_Ý@™Ç™¦™VÇè¯b™aƒn™@@„„JV„°Žn„U¦™°ÆbXxWl„êƒxš„ĊaœbW`™zV°œ„@lmbÅx@bmV™bƒI™`™¦@ÒUVUI@ƃL@bš¼@ššŽ@„šlmxnL„°ULƒŽƒÞğޛ°kLUŽƒL™°™xVŽ„n„KVƒl@šzX@'], + 'encodeOffsets': [[ + 106122, + 36794 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6205', + 'properties': { + 'name': '天水市', + 'cp': [ + 105.6445, + 34.6289 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@UyȍVƒVUnn@ƒVU„`UblzšJnk‚@Vb„KU„°l„wš„„W°„nkVŽ‚UÈlš£°V@n¥šV„kl™kU˜±U„ƒn™ƒlw¯UkwmKUlmkUmnkym@ō@U„mWÈU°l°anlJškUKlU„¯Èm@kmWV»kkÝLUWUx±b™@¯ma@ƒ¯™IƒJUxn„m¼™K™ýƒa™V™Uݤóa™wLmxU@¯ƒUšƒb݃ƒ¹lmwmnXŽmJ@ÞV@UbVbkblŽ—@±êƒlI™l¯@ƒlW¦knÇJkm¥k@¯™Jmbóa¯bƒUV°ƒakXlšÅ`ƒ„„¦U¦ÇmƒLX¤mXnxm‚„ôšXša„VźUnŽUxlnlW„bššl@bĢV„ƒ˜nX„WbX`lLXk@Ž°KVz„Kl¤„nÞ݂Èkb„‚܁'], + 'encodeOffsets': [[ + 108180, + 35984 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6201', + 'properties': { + 'name': '兰州市', + 'cp': [ + 103.5901, + 36.3043 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@lW²LššƒŽ°I„l„šmbVb„KnbĊVlkš@XbÜU@Žkn°‚XIƒÆ™V„LšÓÞxŎUlôƒ„b°KzU`lXVaĊ¥Xal@šk™™Uƒ°ÑÈwUтV£ÈéVšš„@Vb„Jš@nnÜJ@b„L°„XK@īšóƒwlš@kÓmUÅmK@mƒ_k¥l¯™mkçǯ@nUƒaV™ƒwólXbm„™k™`ÛÔťèkkmÆkbƒK@U`UI±xUƒbWlX„mbVbÅÒólkƒƒIWJkšƒ@ƒz—KŻ¼™@™xUx󎃄¯LWb@ŽÅ҄„±¦U`nbťĀUšVb„LšŽ„U'], + ['@@ƒ¯lwna@mōȯK¯kW¤ƒ@@V@bĢnĢƒVLU‚°k'] + ], + 'encodeOffsets': [ + [[ + 105188, + 37649 + ]], + [[ + 106077, + 37885 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': '6208', + 'properties': { + 'name': '平凉市', + 'cp': [ + 107.0728, + 35.321 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': [ + '@@ÆLUxÈxV°šLÇÞ@xn`Ü@X@nĊŽÆwnJmwUx‚aUkšw@V@w„aVmlLXÝl@X‚VĢmV°@nl@UUUWK@w„ÿVI²Òlmš@nÝĊýVV@nšJ°„„šUłm@kV¼nK›ĢȤôK„blnKllVk²aĠ¥È¯ĸóVw@V‚_„xšmn¦VWôX„ƒÆ@Vbn@°m@kn@@lšb@k‚aœ@‚wšK@™šƒ@UlKVaƒWX™W²¹lӄw@_°›n@@_lKōķW™@ŽmLUWƒn™»Û@›l_Ç`ƒÛmm°ÅbWb@š—VWbƒUUKDŽÅaġlmkUġlƒ»—Lƒl™Um¦@Ž¯U™¤ÇkVUml¯ƒƒX™ƒƒx¯kVƒƒLUa@ml™IkyVaƒ_UV@„mmUVU„ÇŽVzUxUVU¦ƒa™¤l„nVxƒVk„@ƒmKUnUU@b™˜U„ƒ„', + '@@@Žż@™mlkƒġk' + ], + 'encodeOffsets': [ + [ + 107877, + 36338 + ], + [ + 108439, + 36265 + ] + ] + } + }, + { + 'type': 'Feature', + 'id': '6229', + 'properties': { + 'name': '临夏回族自治州', + 'cp': [ + 103.2715, + 35.5737 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@š@ż»˜L„y„@l™XI„Jl„ôkÆÑUanaWƒXkW@™yk@U„ƒLƒmUšwš¯„KVlKœ¯Ġ݄݄VKƒ¯mKnw™k@ƒ™@™™»@a„K@ÅVJVU@њ¥š_Uy¯š@£UKmn@‚ƒšó¼ğ¦WmĵXݎkŽVLmVĉU¯bm„ÝV—wWlXÞW¦™xkmmL™šÝŽœ„±U@Vގ™š@„ÅÈW°X„ܼƨyUĮnŽWŽnXÝxUx°lVXJlôV'], + 'encodeOffsets': [[ + 105548, + 37075 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6203', + 'properties': { + 'name': '金昌市', + 'cp': [ + 102.074, + 38.5126 + ], + 'childNum': 2 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@šĢȼ™„Çł°bœU°šV‚ƒń‚ÆǖŰnšÆ„ōĬǔaʠůĭš_kķÆ¥VÑș„çÜKšÅ@DŽƒVaU™m@aōnġÇk@ƒxĉ_™Wk£™@݃±KÈ±aÅnƒ@ƒÝxƒ@kw›lkwōL¯wm`'], + 'encodeOffsets': [[ + 103849, + 38970 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6202', + 'properties': { + 'name': '嘉峪关市', + 'cp': [ + 98.1738, + 39.8035 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@llĊx„¦šl™¦š„kVVnšJVbǖV„kôV˜a„bnaWw„UXmmamUXkWKō¯Xm°™™»ĉÇ@UVƒK™ķkǼğb'], + 'encodeOffsets': [[ + 100182, + 40664 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/guang_dong_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '4418', + 'properties': { + 'name': '清远市', + 'cp': [ + 112.9175, + 24.3292 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lǯkÿƒaV¯™VaÈU„¥ÆDŽIlxšmnb‚Uœxl™„Uôl°kš„„Wl„š@ô™VwUanUl@„xVkšaX¥‚kU»„aš¯±@kka@ƒUwmUkwƒJk™˜„±k@ƒ™™L@ÝWUwV݃—xÇU¯ŽÇX@m™Åƒ@@yĉ£VmUwȗ»ÇšUn„lUnWU¯`Ukƒ@@„™x„Ž@bÇxX¼ƒVVš¯LšĀk‚ÝLƒ„¯@VŽƒĀ¯lnĊW¦kVÇôkUDŽUK@ţ™U@a™™ó܃UU»ƒ@™¦k@Vx„KVb„n‚š@„Æ™„l„@xšƒbWšnlU„lxÈlV„È°Æ„@¼™„@x„šWxœŎ‚V„šK°„š¥ššnƒÆkŎ@ÈÑm™„K@¥šk@™ô@„nôV'], + 'encodeOffsets': [[ + 115707, + 25527 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4402', + 'properties': { + 'name': '韶关市', + 'cp': [ + 113.7964, + 24.7028 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@W™Xk±Ñ@ƒUw™mUwĉwlmn@Æwn£mkIš¥ÇÅ@¥šaƒón£nWWwš£V`Þ@šnVml@xô¼„IV¥ƒkUmkamUkVWwÛ»móƒ£UVÅKmn@x™@kbmm¯a™Xka›VĉaUb݃ƒ²—‚lš„IlxnVVx@„lb@l²™°ƒbV¼lW¦™bUlƒwk@mVVbUxóš™@kƒƒX™ƒ¯lókƒVkš›wVma™nkwƒJÅȃ¦ÇVUbšŽU°„blĀ°ŽkÈ@x™¦Æܙ°@„°„¦óa™VUôlUlbXl@nÜV„„nKlŽnIVÞ°Wš„°U@bnm@¥šIVƒ²Ulƒ°VnalzXyl_Vyƒ¦lƒœLlxš„@ŽÞbšKm„knVWanwƒÑVwČº˜@n_ÞV„aVŽÜIœl@„˜KȚ„VJ@aš£È@˜™@km™„aV¯W@_ƒa¯KmbkÇkLmwƒ@Å¥'], + 'encodeOffsets': [[ + 117147, + 25549 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4408', + 'properties': { + 'name': '湛江市', + 'cp': [ + 110.3577, + 20.9894 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@ƒkXƒ™@a„UUċlk„Jƒk„™@wVJXUWk°W@nKnwlUlš²ƒ„blU@‚lI„l@„XbW„šxnm@lW@w„wU‚JX¯VU°`ŎóˋkÝÝkÅ@ÇmğÈřmw™aĵV›xUہ»°™ĠǷnýmóX¥ɅĵҏÇ@°²ĊUĖ±ĮU¤Ç°™Ā¯ɐnżUĊĊĬV@脎@ԃÒU¼l¤nƒĠb„êVĠ°Èy„zVaV‚nUÆL„ašbVl„wÆ@'], + 'encodeOffsets': [[ + 113040, + 22416 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4414', + 'properties': { + 'name': '梅州市', + 'cp': [ + 116.1255, + 24.1534 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„‚nԚlW¼x‚¦@lœVl™lLkè„a@zš¤ƒĖ„¼UxlnUKUbÝlU¼lb@„Vx„V„klJÈwV¯š@ĠlÛĖšnƒbkšÆźÞƒUÈôklmšL„¥‚LœW˜„„™nKUkVa°V„x@IVV@x°bUk„a™a@mV@„@y„w‚L„ÑUwVUšV„‚„U‚bÞVVann‚@XwÇÿš¯²aVamkXaÆ»@»nw@¥›UXaƒkbWa¯KUw@¥m@kwmLU»UU™J@kmU@UUWUƒ@ƒyƒanwmçÛl¯ƒŽ¯UƒmKUmƒwVkmÝXbW@XWÝbƒk¯@±‚w@»U@W¯Å@ƒÇ¥UƒU@ƒƒ™IU™ƒakJƒĀ„ꃰšþƒXkamŽ@Žƒ_J°m‚@X'], + 'encodeOffsets': [[ + 118125, + 24419 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4416', + 'properties': { + 'name': '河源市', + 'cp': [ + 114.917, + 23.9722 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@°VlmX¹laĢÒlm„@„„šVš£‚‚@¦Ģklynn¼lW°z„W„„°VbÈV@lÆbnn‚JškX„šVÆašÅ„W@™ƒUUw@ƒkaV»ÞkVaVLkmVwƒ»„ĕ™£@yƒblçkKkš›U@k¥‚wX»™kmӃ@Wn¯‚I„`@nlb„W™ý„¯ƒé„ÿlI@™XUmWUwƒ@@UJU„Ç„mKUV@x™„ţk¯¯LWƒƒnUxK@ű»Vwa¯š@¤WX@ŽÛ¦@¤ÇIȼWxXŽƒ@Wx—w›ŽUnVbÅèmVa±²UWl@Žk„lȄ¤nôܼXxlUnVlbVn„lU¦ƒJó»@wnkmU™‚Ý@U_™¤XxmXm¤„ô™b@¦Èƙ¦lJn'], + 'encodeOffsets': [[ + 117057, + 25167 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4412', + 'properties': { + 'name': '肇庆市', + 'cp': [ + 112.1265, + 23.5822 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@l@š¥„@V¼„Vôۚš@bšV@ŤVLȃlVÈólUX¥mĉ°k„ÿU°@„ƒÞKl™ÿ°KU™„UW»Èw@aƒšw@ƒ„@nm@w›£kÓVUVn„Kš™k¥™£Vamƒ@nkKkbÆǫma—kmLU¥™UmƒÛwmVU™mUƒJ—ÇaUxÇIn`mb@Þ¯b@„nJ@nl„U‚V„lVU„L›W¯—Û`Ç_¯`mš¯I™bĉWċzx±J™xš¯ÆUƒƒ_k@™šƒJ@Umb„šXôlLš˜n¦@¼ĊxlUXŽ˜xUbL‚Ġ„UnVĊwlšUš„b@lW„X„‚m²˜@ÞWxXš‚Unb'], + 'encodeOffsets': [[ + 114627, + 24818 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4413', + 'properties': { + 'name': '惠州市', + 'cp': [ + 114.6204, + 23.1647 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lbšW°bnnlaš@@wnmÆLVUkÇlƒ@Xk‚V²±‚bnUÆçUaVmœ˜xXw„@WXwÇ»ÈJ@£Ü¥@XW@£°™‚bUx²¼@ƂLVw„mX„°K°Ťlšƒ@wVUnLȃVƒVIky±wkƒKU¯ƒÅkƒ™XġÑۃlwUwlm@m„nKWašÅm›¯óÇmğb¯alĉUwķbmb@lÞÒVn—šmĀŹ@VŽƒbVŽUnmakLm`@xĉkklVÔVJVn—lV„UnmJmaLUbl‚™zmŽkL™a™‚ō@@zš‚V¦UŽV²kJ„nÜU@˜VXUŽL@„lJƒL@bݤUnVŽ—b@xVnlK²„Vx°V„xlI„lkVl²k¤@n'], + 'encodeOffsets': [[ + 116776, + 24492 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4409', + 'properties': { + 'name': '茂名市', + 'cp': [ + 111.0059, + 22.0221 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@‚LnÇlk„KnkÆL„ƒUm™ÈxlUœJló°n@ššanŽš„„a@ƒ˜@X_@mÝóóU@a™aU¯mL¯ƒƒkV¯™ÇVwkw@V±Ŏ£@™™@šalw±Vk@m„Åm¯™ÿŃƧIÇ`ōô¯_UVW°IV‚ƒx@xkX@Žmn™wXƒWa@ƒƒkkJ@kVƒa±„k™kVmxmL@‚¯XXlWVUI@xƒš„lƒIklVȃV@b„šlW@„@nUxVblVxkôlx™n„‚y„šnIƻư„aXwlK„bVnƒŽXb‚L„¤„k‚L—èƒVV¼ƒŽ²IlĠVX„ynz°KVx°@VlœLlblKœš'], + 'encodeOffsets': [[ + 113761, + 23237 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4407', + 'properties': { + 'name': '江门市', + 'cp': [ + 112.6318, + 22.1484 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lUXx°JWnnƚXVš„W„X@„šºVLV¯nU‚Vnb™ô„x‚aXmW™XIšŽUb°xlK„l¯œK˜xXÞ°ŽšXÈ¥Ü@„ĉޏU™‚çš»nóƒVma—x‚¯UÅU¥Ý¯@ƒƒç@ș@çĉÅUmU籃ĉKÝxÝ_ÅJƒk¯»ó¯nmèkǀšŽWxœ¼mnUÜġ°@¦@ƒxƒLkŽÇaVnUxV„™šVlnIlbnÆÆKX¦'], + 'encodeOffsets': [[ + 114852, + 22928 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4417', + 'properties': { + 'name': '阳江市', + 'cp': [ + 111.8298, + 22.0715 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@°„nKV°šb@bôVÞô@n„VlÒôÆUnlnn@lmkmVkƒaÈkÆƄ™k¥‚ÅÞ»ÆKXkW¥ÅLmÅkamJUkš™UƒVwUmÈbl„K„w‚@@¥Ģ¯VÛnm›»Xw™lƿ™@kbW™—aʵ@óL›l¯ƽ@™ƒƒLn°ƒÆ@nUl‚²kx™b@‚š@šō¤U²@ŽlxUxšÈU°lŽ„'], + 'encodeOffsets': [[ + 114053, + 22782 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4453', + 'properties': { + 'name': '云浮市', + 'cp': [ + 111.7859, + 22.8516 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@V„Iš™l@„`V„°Å™šw²I‚wČyĊXša°Jn™°_È`Ü_°˜œX‚KVƒkUUƒVkƒ@mmI@ƒ°a@Ýnam_ÈJVwlĉX@„šlUšómaUmVU°UK™¹@ƒƒWƒXU™™WmÅXm¯IWwkVWlÅLݼÆl¦ƒšÅÅÇl„bUllnknm@kmVmóÅkуUW`—@@„ƒb™ƒm™b@™¯mkô›IkVÇwnš„VƒÅKmlƒLklmȁKƒšVĊK°²„`n˜¤n„U„bWl„xVx™LUx@°nXm`VklVxmnnx'], + 'encodeOffsets': [[ + 114053, + 23873 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4401', + 'properties': { + 'name': '广州市', + 'cp': [ + 113.5107, + 23.2196 + ], + 'childNum': 13 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Ș¼VxUnĊ¤@z„@šÆ@nÈW°ÈV˜w„ŽUÞVxÞX@ŽšK„šl@ބVaĊbœU@ml£k±lUƒkkJƒw¯UUw±ƒkLUm@w˜aUVmÞ£@a„KkI@ƒ‚KVUW@—ÛVƒmlIU±VU¥™@yğzƧǃƒšƽĠřšÅnī±m@ƒ²¯lƒ°@nÝÆóUll@XnÝVU¦mVV°—„V¼™Jƒn„b@°mbn„ƒ‚@²¯‚¯wVwƒ@@nmxX¤¯L@ŽVLU„m@@l'], + 'encodeOffsets': [[ + 115673, + 24019 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4415', + 'properties': { + 'name': '汕尾市', + 'cp': [ + 115.5762, + 23.0438 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@‚„@VxnXWV@š„bVššJ„„V@ÞÅU¥Ċxš£UWU‚wÅUU¥WVUkĊÇnkV`°LV™„wƒƒnU@™„ƒlbĊ¯„Vnalšš@@çkUÝ¥ġaó¯ÅaÅLŻÆUýmy¯ó@ĉÆó„ȯw™ÆXbmLƒ‚@nknVxkx܄ĢҚW„Æl„V°„Ll‚²xlz'], + 'encodeOffsets': [[ + 118193, + 23806 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4452', + 'properties': { + 'name': '揭阳市', + 'cp': [ + 116.1255, + 23.313 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@V„Ȧ„Æ@X°V@@¼‚x²°@„lÞaWXX@‚aÞWlnUŽ„xVnnL„‚°V„@k‚mĢl@„ak™@mlk°aXƒ±„nwm±™²¯JV²@ƒwW˜—_mƒa„V»ƒU@m¯ĉUф™šJl™„ašbVn„lĸLlƅÛDZwÝ@ĉxó@è™@k™mbƒUĉ°kaƒ„@šmV„„ƒxUš¯KU_mlĉÈVlXUV¦ÆVxVŽVX™¤ĉwV¦ÝÆ'], + 'encodeOffsets': [[ + 118384, + 24036 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4404', + 'properties': { + 'name': '珠海市', + 'cp': [ + 113.7305, + 22.1155 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': [ + '@@„è@„Þ°V¦VƁ°˜wnb„UÆ»nçƏ@nxܤ²llU°VnÈJސ°UôéšķUklƒô£VVˌKÞV°£n¥ƒ£ȗ™Ýy¯¯mÅkw¯bÇĔğ@Ýn¯ĊƒVğōŁŻƒķJ@Ț', + '@@X¯kmèVbnJ‚™' + ], + 'encodeOffsets': [ + [ + 115774, + 22602 + ], + [ + 116325, + 22697 + ] + ] + } + }, + { + 'type': 'Feature', + 'id': '4406', + 'properties': { + 'name': '佛山市', + 'cp': [ + 112.8955, + 23.1097 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Èb˜Ž„InVVšnUÜxn„šVV¦nK˜lnbÅǬlalL@mn„Ubš¤l¦™šƒLUmUVlԜ¤@xmnVl°_XVVmƒkVmș@kn@VƒUK@°KW£nw@m„@Ux°x°@±„mƒna@¯ƒa„mšIU»˜ƒU¯nUV¥ÞUWmk@Vk¯™Ukn›ÑWݐƒĊÛ@Ǧ™W¯Wݗw›Lk°ƒkL¯wVa™WJXšWnbƒwkVƒ™W@kĊ'], + 'encodeOffsets': [[ + 115088, + 23316 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4451', + 'properties': { + 'name': '潮州市', + 'cp': [ + 116.7847, + 23.8293 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@°ŽÜknèmx„b„z„@V‚VX@VnV@lšIVVV¼nKlxn@@¦Vx°LXbla„ŽWbœV°£¯™W@nW@™‚aUñVœwWš»@¥ŤÅUÝǓÝóV@ńǎkUVmƒIUwÅVWÇX¹›—@W„¯bkl@nlšƒb@‚kġŽn@l'], + 'encodeOffsets': [[ + 119161, + 24306 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4405', + 'properties': { + 'name': '汕头市', + 'cp': [ + 117.1692, + 23.3405 + ], + 'childNum': 2 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@‚@U±°Iš±n²mx²ƒ˜@œWºXÈÆUVx„JUnlVȍ@ŃôUǔÞVçn»VyĢÛVm@»kaÝUǼóšÛÈķKċ¥X„¥Wwğk™ƒ¯@ƒwķKƒkUm™aƒbkš™IƒšVÒ°Ċ@n„VU¼ƒ‚„bn˜`X—„x'], + 'encodeOffsets': [[ + 119251, + 24059 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4403', + 'properties': { + 'name': '深圳市', + 'cp': [ + 114.5435, + 22.5439 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ÞLš„@xšbV„šVšK°™X°Kô¥Vw@anU„胐š‚lkĊl@wn_lKnbVmU„aUź@nÿ˜™UmÝѯUƒbk„@ÆkxŻ@™aÇX—wƒJƒƒ¯LķÝUĕ™ó™ĸóêWº@b²nmĬ™Æ'], + 'encodeOffsets': [[ + 116404, + 23265 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4419', + 'properties': { + 'name': '东莞市', + 'cp': [ + 113.8953, + 22.901 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Ŏ@ššblKnšykVa‚KnbnIVmUƒ˜kUmUIUә„ƒçmV@bUxó¦¯LW‚¯š™L™UUƒ™a@w™ƒÝKğŚ™ƾ„„ƨÈĠy'], + 'encodeOffsets': [[ + 116573, + 23670 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4420', + 'properties': { + 'name': '中山市', + 'cp': [ + 113.4229, + 22.478 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@‚XœÒlmšV°ôÞÅ@m„¯°k„±‚@@aX¹¯VݏÇIUmV¯kk‚±Û£mw@‚Őmèżmô™¼èVš'], + 'encodeOffsets': [[ + 115887, + 23209 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/guang_xi_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '4510', + 'properties': { + 'name': '百色市', + 'cp': [ + 106.6003, + 23.9227 + ], + 'childNum': 12 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lklWXL@VšI‚l@XnJn@VUUalk@mK@kny@UlU@a°™„ƒUU@VmaU@Ua@UWw@ƒn@KmLm@alkšmnI‚m@an@VIUamWÅImwU@@a@K„X@JVL„UVmUaVkUa@m„@@Ulmkk°ƒUaVUlKXbVwVIkaVmUk@KVk@a„aW¯m@w„¥laœX@KmaškVmnUl@nxVKšInU@yVaVIV@na°KlxX@@_lmXšUV`VIV™V@„n@lšbn@@WUkValK@²yl@„„VUV@@K°L@KU@@UVaXIVVV@naVkVa@K@UUK@UUa™LWa—w@m@K@UVVƒ@mVUUVKnL„mVL„K‚bVK@UUIk›mI@mUIVK@IUK@VkLƒ@WU@mU@WmUk@ƒI@VƒJk@WwX_@amK@UUWkIƒ„ƒK@LVb@mVmakL@J@bU@Ux@xƒbmI@`ƒIwm@UbmKUaUWa¯UkJWV@XƒJUU¯LUmV@ma@kkamKwƒLUUmWVkkm@aVUUkVKnVVUmXK@UW@km@Ukkm@@W@U™kUy@I@aUUmbƒ¤U@kUmL@bmJU@Ua@wkLWWkL@Uƒ@VaU@ƒLUakKWbkUWVkKkLVLUV@JVbƒz@Vƒ„@ƒVmUU@kVmK¯@VƒU_™VWakVmIUKUaU@@bml@XU@@V@LmKUV„mVUKƒƒKƒbkaUXƒKUL@x@V@l@„mxU¦„V@ŽlL@V@Ln@@VV@„nlKUaV@nLUbmJnL@VWLkbmV„@@L„W‚„XLlx„VVIVV@x@V²blUVm„LVUœK@kWWXUlV@Xl`„LX„l@@VšŽƒn@VnbVš@lVUVUÈVbš@@`UXU`l@@XUVm@kš@xmVknUJVXUbmKULmbx@VlJ@LVbkKUbVLÇUUVƒUVmU@VaUkUKƒVUwmLkUUVVlƒbka™XmwƒKUšVVU@@V±Uk@VWUUm»XamU™bƒKk™`ƒ„™U@UnWW_kKmbUVUVmnUV@„nJVUlšUbU@UV@n@JmI@VmbnVUXlx¯ŽkKmnVV@L@V™bkV™Umm™@Ub¯LmlUƒL@VWLkmkLmmn£WmnKU_mW™š™bnbmxƒ@U¦UJU„@Xmlk¦@‚mnUUm@@Jn@lV„ÔVJnIVW„I@a„ƒÆK@I@aVK„IlŽÞnnl@nl`nbÆX²l@xV„@llbVn²ŽVVl@nn„V@IlW@Un@@kVa°KšnÈmVaVXUlaVƒÈU„VlwôUlynIVašan@lVXb‚Iš@n¥la@Kš_n‚@bÆx@XnJV„nKVz@`VXVšU`@bƒ¦UV@VšIlx„UnV‚K„XÈbšVllšbVbnVn@'], + 'encodeOffsets': [[ + 109126, + 25684 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4512', + 'properties': { + 'name': '河池市', + 'cp': [ + 107.8638, + 24.5819 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lLVl„bVV@nXVlI@JVX„mšn„W°b„IVV@‚ln„@nalVUb„nW‚@kVkÒlbVKn²°bUŽlV²@˜X@`nb„aUI@ƒ°wlU@aXJVI@aVK@wUamIXm‚@XUV@@bV@Vm„ImnUUwVaVKXU‚nVK@akƒVwV@nL@UV`n@@X‚lnIUJl@X¦˜V@aUIVm@anƒV@UwnL@VlbVL@KVVXUWƒ„wUUVUka@UVJnUlbnalbVVn@°„„LV`Þ@šXVxV@@bVlUVVbXnWlXnmlš@XXWVXJmbUI@V„llUVkn@@VWV@Vnb„@VXUJVnn`lLVk„a„»lVšLnw@WV@lInw@WnU@U@m‚knUVó„K‚wUmUXUƒU@@wVJVIl@XKVVVbVI„J@Un@lŽVLnm„b@U@Ul@nUš°VUVJnnVJV@„@mVU@ƒ@wkUVwkKWk™yUUkU@alkÈ@lJ@x„Ilƒ@UUWVkUw@Kn@@kmaƒVUl™UUL™ÇƒUUKl@UUmL@aXU@mlUUwmKkUUVKVUƒaƒKUnK@U@Vl@XUWU„KlwX@šb@K‚@XkV@UwWJka@aUwmV@U™@@U@wUm@»kLWVkIWŽXnmV@VkbmKƒLUbk™Va@aƒa@@aVU@aVak£@ƒ±UkVU¯V™UUƒJVƒUIƒ@kxmUmWUbL›w@K@aU@@aVU@Kma@aka@_VWkk@UWVUKULWKULUš@KUnƒwVaUKƒxU@UmaƒL—m@kVmVa@UkƒmI@ƒ@KmIkxU@@K™U@mmakI@VƒLkmWkkJ™_U‚@V@L@n˜xXbšKVb@VVL@V@LUbUlmbU@UUWJUb@VV@@L¯K@LU@UVƒƒk@±z@‚kLUbVl@Xm@™akm@ƒU@UšUJU_™VWŽkn@`W@kw¯LmbU@UJUb@zmV™JULmwk@mVUn™lnb@L›Wkbƒ¦@x°nXŽƒb@bUl@LVlUnlbUJUxWakLUVVb¯„llkn@Vƒ@@nVbUlVbUnƒVUK@IƒW@L@bV@nxÆJnXVbUJm@@bnmJ™nkl@b‚nnK@L„m‚@Xx@VVbV@nb@UVVƒ„¯š@bkV@Vmz@lnLl@kŽVbUVm@mI@Wk™J@UWKkXkl'], + 'encodeOffsets': [[ + 109126, + 25684 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4503', + 'properties': { + 'name': '桂林市', + 'cp': [ + 110.5554, + 25.318 + ], + 'childNum': 13 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nU@J‚X@`XLm¦Vb`lšVXXWš@VblČnVšŽlanLnmVLšK@_Vaƒ¥@kUa„@VmVb„aV@XVVzlVVK@knKVmX£VKšLlbnš@b@llL@xĊôXaV@°È@¤„bn„V@@Wl_„V„U@W„nVamw„wVbn@„K‚VšLX@VmVUxlV@šnVV_nK@m‚I@Wn@@IšUĊ@@wVWX@@I°VVm@wmU@m@IUƒV™kƒlkUmmkÅV@@aV@@Wn_UKla@kšaV„šlVanb@k„@@KlVn@@aV@nIWW™UUaVU@™kKmwU@UImKk@UU@w@W@‚™k@™UkWƒ@mk_W@Ua@a™ƒƒ@—¯ƒmV£@mƒUUam@—kWakƒVama@UUm@nw@alaUmnUlVlIœV‚™šLVyk£Vm@k@UUJkƒK@kmKUw™KkWK@UXImyVwnI@m‚ƒkUlkUKkUVmƒw@kkJWUÈm@_k@@aƒaW@U„UJUwU@@IWKkƒmUUV@nVl@bVb@bU‚UXƒakw@ƒWUkbkKƒbm@™xUlkLm@@wmKUX@‚™UaVW™XVmU@@UUUƒxkmWXkKkUWaUaUb™L@`UL@LV`UXmK@VmakLVbkL‚xUJUIVbUVVb¯KƒV@Xnl@lVXbmÒnV@L@VWKkVUIWJkIƒŽUamUUbm@U„kU@JUbW@X„WxUam@kbVVUnUJmUUV@bƒU@UUV™@ƒVk@ƒbƒmULV¦U@V„U`VLUL@xVbn@UJ@nWJXXVŽVV@bkxVbUx‚Lšš@x„¦@šU‚lXUVVlULV@@šnŽU„ƒb@xl„nJVnlVknUlVUbmŽU@ƒbVš„x'], + 'encodeOffsets': [[ + 112399, + 26500 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4501', + 'properties': { + 'name': '南宁市', + 'cp': [ + 108.479, + 23.1152 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lKnbnU‚@Ua@K„L„ƒlJVX@VnL@bW`Xxl@„I@U„Jl@nV@X‚V@nXV„@lK@UVL@JULVJ@nnJlœVJ@VULaƒLUKƒnmKULVVUŽ@nU„š`lIXlln„K@UlJnb@nšV@LV@lwnJ@L@„nJl„@VUbUn@l˜n„KnbVŽV@„wVLUb„xVm@LV™VKXLVKVLXU@VllUX@`lb@bnb‚L@ŽUV@bV@@b@Lœx‚KVanXVƒUUmVUUUaVUky‚UUa„ImK@mUUVUkKU_@W@UVVVIUW„UVaVU@UUKnƒ@k@al@ll@bnL@b„VUV˜X@Vœ@@b‚Knblmn@V_@aUalL@a@akK@kVKUKlwUUnV¥VmU_VWVIVaX@Va„alńK@LVJnalL@LnK„wlVUw‚mX@VXšƒlLUVnblaUmVUVwXU@Wm¯Va@ÞKnw@w™mšk„»‚UVW²a@_mW@U@I„y„LVUUKW@@™„LX@VUV@@yVU@UV@nwUUmJka@IU@ƒmƒVkaW@UwUX@`ƒ@kLWUk@mƒkUUm@k‚UUWkUƒkWxk@@VƒK@nV@UVaƒUUJmIkVƒ@UamLUbkVmamLka™@ƒ‚kmL¯WI@wJmwƒx@akU@aUKmbkaW_nW@_U@Wm@a@wkwUKmƒk@ƒbkb›w@mKUkkU@J@bW@kVWz@bVUa›VUx@„ULkJWbXVVXƒ`@œmJUVU@@Lk@WbU@UJlnXlm„Vx@Ln@‚b@K„LX„WJUUW@kƒaUVUbmV@nnV@n@lVLƒVmLX‚mXkV±@kxÅL›šUbJWIÅJ@I‚mXalkUamKkškL±aVwKƒUU@mÞnbWJX„m„@lbmKULWUUVkaƒbnn@Vl@VVV@VƒbVbnLWLXJWxXLV@@VV'], + 'encodeOffsets': [[ + 109958, + 23806 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4502', + 'properties': { + 'name': '柳州市', + 'cp': [ + 109.3799, + 24.9774 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ƒwU™„aV@nVaUVklmkUUmmIkƒ@w„aVƒm@™U@VKUkVUkWV@™ƒ¥@w™™KVwUalw@aUUUWWXI@mVIm@Ua@wVKUKV_UƒV@U¥VK„n„al@„Uš@VU@V„V@aVUnVVIVmUUlan@VbXwWƒX@Va@IlVVƒn@VanVVb„lJXIVJlUXL@U@KmUnÑWakU@mkƒJUI@mk™@wUmmUV@JXaWIXWmaUIƒJƒkk@W„nJ@„ƒaUak@›kkJ@kUKU_ƒ@myUóWUkm¥kUmL@KUKm@k_UmVa@ƒk@@UmU@mm_—JWIUVUŽWLUlbVUJÇVUIVwƒKUVk@mU@n@lUL@Km@@l@L™VƒzJmUU¤m@UbV²U`U@@¼Vn@x@Vš@@VnUVx@blbXIVxU@Wl@@L™aW@kxƒLXVWVk@@U@VmLVŽ„L„bUVULVV‚lnLVxkV@nWV@bnKVVk@VL„VšÈVKšVVk„Unb@lm@@LVxUlVX@Vk„ƒJ@wkIÇ@kl@blVVVšzXllLUxlV@x@„UV@nƒ‚U@UImmUIUV™¯mVk@@V@VƒamnUKkm@@VƒIUJUaUUWLk@UJUI@xV@V„VWVnxƒLUômVV„@VkVVVUnV@UVkL@VVV@bVxla@bkXVJVn„`nU@bƒb@bVL@VnJ@„l@šV„aU@@_lW@UUU@Unƒlll@XLl@@UX@°bVWVanLlknVV@VVX@VVƒnUŽVLmbXJ@nllXX@`VXƒlmaXVWk@Wkƒw—J@„VL@J‚bnU@bn@@bVKUnVJVIVVVL²a@bV@@Vl@nUVakalmš„UL@VUL@V‚a@mXl@nK@UlK„L@Vl@@nkllb@š„Vnn@‚šnV„™V°l„šVInwlKXxlU°Žn@@ƒ‚I@UnVlakUJWkUK@anUWK@_ÞJ@U'], + 'encodeOffsets': [[ + 112399, + 26500 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4514', + 'properties': { + 'name': '崇左市', + 'cp': [ + 107.3364, + 22.4725 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@JVzšl@V@Xn@ll@VlnX@@VWLnŽUVmUULVlUV@blnUlnXVV„K‚xnLlb@lnbU@Vn°KVV„I@WXUlI°VXb‚VVbnLVan@‚x„J@_nJ„a@wVwV@@a@IU@UU@WKXwWIXKmKUa„a@U‚UUUk@@Umm„albVUXVVKnL‚a@knƒWƒXImanÝV@„V‚LUx²blKl™nLVbklWbn@JÆIXJ‚IVaœ™ÆKlw²@lUnWWnK„UUK@k@mmU@mnUVaVU„b@lVXVXIWƒƒK@Lam@@KUwnƒWkkmVIV@Xal@@KV@VUnI@›„_UWWUkam@kkm@ka@mƒk@wkJWIUU@WXkW™XkWWLUUƒ@UakLƒW™XV±VIVWUU@anUWaUK@IU@Vak@@UUKWaƒ@m@ak@@wUkla@mUaUklakwVƒ¯¯@WWUkLkKmaƒ™kLUnV`UxWX@Jkn@bmlƒakkk@ƒb@l¯bm„ƒbJ›b@VXn„bVV@„ƒbƒJUkkKWVU@mœÛVUUW@UVUJWXkVkKmUL@WW@U„Vl@XXKW„XJ@XVlmbUxnnm@UlVnV@XVm¦VJb@šmLkKÇbXblVkn@l@bWnX`V@@IVV@ŽV„V°n@@_naÆVVbUVVbUJnzlVUl‚XkV@Vlx@X„VnxƒbƒKUK@b¯VVUV™L'], + 'encodeOffsets': [[ + 109227, + 23440 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4513', + 'properties': { + 'name': '来宾市', + 'cp': [ + 109.7095, + 23.8403 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nVlw„@VJU„„IVVUšV°lU²V@„l¤Ub@bUV@b‚@„b@bUblšVa„KnLla@UnUWmXlJXUlKV@V_U±Van@V£nV‚I„yšU@K@kn@@LVK@k@mnVl@VU„LUxVJÈUVIU‚aVkXKVVUXJ˜In`@nnV@Vl@@„UbVnl`n@VL@LnKlVn¦VlôXV‚nz„@V`VL@llIœll@Vb„b@ƒmIXƒl@„l„IVJnbWXXJWb@IU‚nVVn@xlš@nVJ„I@W„U°LUaVUUaVJVIwlKUalKnb@UnLVWU_@KVK@_šKVa„@VKU¯VLVKn@la„aUkU@maVU„J@k™@Um@XmbkyVaUIUU@KV@laVn@KXKWUkUk@ƒaW™UUVw@aXKmƒVaUUkšmIƒlUU@wUa™xUmmU™¯™U@WƒLUmVIUym@UVmUa@wmw@çm@aWLU„™JUIUamKmL@™aƒx¯¥ƒkU¥U@±„k„UVmKU_mJUbkKm„ƒLÅǙ_@WWUXUmaVUkK™„UWW@nVxkUƒxmL@KkKmbUI@KƒLkƃbUbW@UbUJUXV`UnU¦mŽVVkxVLUL@llL@b@bkKVb@bU`m@knmaL@a›@@U—WVUƒU@amK@akkk@@b@lm„VL@VUVUbƒVVXUJUU@V@XV`lLUVVV@nnLƒJVbVlzUVVbVVnUVVU„'], + 'encodeOffsets': [[ + 111083, + 24599 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4509', + 'properties': { + 'name': '玉林市', + 'cp': [ + 110.2148, + 22.3792 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VJUXVVXlWX@V™xVnX@@`ššULWŽUXÅbWK@mULUUmJ@n¯b@l@VULVx„x‚XU`VXXJVI„V@nm`@nUŽVXn@lWVn@b@Jn@nU@Lm`@Xn@WJƒ¦U@@VnL„lV@@Xl`nIlJnkVL„w@KVK@UšaVL@bVKX™lUUKVK@I„VšL„a@U@WšLUlVL@bU@@blb@VlbUxVbXUVJ@xVL„U„lV@VU„bVLnKl„XJ@L‚b@an@VanL@`VLšKV_UWl@U_„a@WVInlVUUUVm@I@W@wVakIWm@U@ƒXwlaVbnI@ƒm»Va@aXaVLšU„»@aVa@k™KkL@KmU@WƒzUK@wU@VWUUVUUKUa@mKmbUK@_nWVaUkVaUaVUVLXKVƒVUVmVI@UkKkLm`UkW@UwWW_„UaU@WakXmK@xUXƒJkƒUUWUk@Wl—mJ@km@@aUKzmyVk„a@kkWVUU¯lmU@@w‚kkmV@Vk@mÅIƒ‚Ukƒaƒ@Ub@m@UUU`mUbWaWmb™X™XKWIXUWm@љ@y@UkIUJUUWLUWƒL@UkVUxW@kaWbKWnXxW¦n„m`XLVlUbVbUx™I@JmLUKUb@VW@@bkL@b@VlU@xkš@L@lƒxXxWXX°V@VVVbUVV@UVVbULVnVJUb²b‚aUb@VVVVInlV@VnXaVUšlI„VUb'], + 'encodeOffsets': [[ + 112478, + 22872 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4504', + 'properties': { + 'name': '梧州市', + 'cp': [ + 110.9949, + 23.5052 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VbXblVlLXWln„wVV@VV@UnšWUXVbš‚@VWXa@kVK„UaVaVkšUlyX@Vaƒ—VmUwUaVU@UÈymI@aU°@š™nWV@VaVaw@IV@VmnLVK@kmmna@™„™VbVI@aV@XbW`U„„LUVVx„@VbUV@bl@VLXblJn¦lL„°°@n™@K@UlLnK„a°LWbnJ„¦UÒV„UllLlVnKnbWnn„V`„w‚@@Xa±™n™l@XKV_„WVkVa@kVyUa@wU£UW@UIVW‚@@a—wWaX_WKkVmUULmak@UJUI@±m»™—k@m»VyUIm™nmmwnkUmVaVIUn_mW@»Vk„@VwkmmUXa@IƒaVm—mƒ@Wm_U@mIUWóLmUk@laXmmkUK@UmKULUUmWULƒ@VakU™@Ub@bƒ¼™VUKWb@bUbn¼@„mJUakbWx@„@VXnlJUb@x@X@JUnVVUVmkUJ@XƒbV`k@VXU`™LUK@_mKUbm@@b@„U`@nlV@b„UnbVbn@@`VbUbVV¯bm@@mJXb@bVnUllVXUlbUl@LU¦VVmŽkLVb@b™l@V@XlK@V@nUJUz„°mŽwmLmlXbWVU@UUUlƒIU@VVmV@@¦‚bXbWxX„WlXVWL@LUmkbU@@LVVVJUblzna@WVnš@@lƒIUVnbV@Vlƒbkbm@ULUKV°ULƒ@'], + 'encodeOffsets': [[ + 112973, + 24863 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4511', + 'properties': { + 'name': '贺州市', + 'cp': [ + 111.3135, + 24.4006 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nL@xn@lKVkšwn@„alLlaXV@„lx„bVWV@aUa@aUk@mVUnVl„XL@JV@VxVIVƒX@„b@bl@@`ÇnXVlI@l„xUnlVVLkllV„@nmJUxnzWJ@VXLlŽšLVxnL@l„LlŽVI@V@lUnl¤Uz™Kš@„Vl@š„L‚l„Lnš‚b@VnVVU@k„a‚Knxn@VkVJ@ńUlakmWIUaVanm@_UK@UVWUa@klXam™U@Vmƒ™VIXW„@lUVknVlKVLXŽVXšW@b@VlšnnVL@KXL‚Kn@lb@UnW°@Va„X„WVb°aVa@I¯aUkUaVKVwƒaXk@a„a‚™@wkm@alanUVw@alK@Umkw@UƒaUmU@WXUaUK@UW@UaVWI@¥Xa@w@WWšVƒXwƒU@mKUXUWVU@a¯kl@akU@UULmK¯VUVW@U_m`U@@xVbUz@lUbUlƒXU`WLk@mš²šWb@Ž@ƒxU_mƒXmmamLkUkKVkUƒVу¥mIXa¯KƒbmLkK@V@Lmš¯@ƒ¯kKm¥kIWaUKk@@aVUUaƒ@UwVUƒKVƒX_WaU@@bUJUaƒš@šmbnn@lULmKUnU@@J‚xUbUbU@mX™š¯@VŽ@bnJÇz@VUVVbVxUn„˜UbW@kz™VUlUbVbƒŽUL@lWb'], + 'encodeOffsets': [[ + 113220, + 24947 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4507', + 'properties': { + 'name': '钦州市', + 'cp': [ + 109.0283, + 22.0935 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@IlVVlnL‚@œxla„al@n„VLlx@x@bXnV@@`mXX`lbnaVL@blV@b„wnx‚I@xXJ°nK‚l„š@lbnKnblUVanKVb„@lUnJVI„VUb@V‚U@m„L@Ul@Xw„llVVXV@lVnlVn„l@XVlK„@@_VWVxX@lb„U„nV@@JlbnIlmnVV@UwVK@U@k°a@mnIVVVK@nXLÆaVWXVK™™@_W@Umšw@UXWWkUUVWUIVaƒUkJ™UVWbUmU@mkUJUU@UVab±aVaUIUmVKUaVUU@VUUaUUU@W¯XWWw„w@k@Kl™@wkV@U@alK@aX@@UmIUWUIƒ@mmkXU`U_WJUnUJmUk@@amLU@UVW@UkU@@VƒbUWVUk@@wmKkUWLUWX@JmIƒlUkkKWKkLWU@UKWa@bU@@a@_UKWƒUUUmJmw@nV_@ġğKóLmbU¼VÆ@xUXƒ@Um@wklVnUn›lkaUV@„lV²WVklWXXbWlkVkIm`UUƒLƒUU@UWƒx@XU@@lWLU@kbUbV`UXllUV@bmb@LnKVbULm‚šnVVIV`X@'], + 'encodeOffsets': [[ + 110881, + 22742 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4508', + 'properties': { + 'name': '贵港市', + 'cp': [ + 109.9402, + 23.3459 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@n@VzUJ‚nVŽ„K@XšVš°nVVnšwVb@xVV„knJl™VVUbn„WL@bUxVVXš„bl@lVXkWƒXwWaa@¥‚@nUUUV@„JVkVVV@XUWanknK‚xnƒ¯VyVI@m@UkL@W@Ušk@aUalKnUUV¥@KVkkaWVkUVkUm@aWanI@n@°aUUVaUa@_m@UamaƒV@akU@mV_@ƒa@KWIkƒmLUKƒaUVU@ƒkƒVUK@wUIWVUaVwka@Uka@aV@@aUKVk™K@X@Vƒb™KƒU@JULVLkVWšUL@aUK™b@VUL@LƒxUKmlkImJk_@WU@ƒkmK@UV@„¥XIm@@Wn_@KmVm@@I@aUmkXm@UWV@mn_@mƒUUJWIUWV_WƒwU@mUknVVmxU@@VUV@zU@UVW@ƒK@šX@VLUVƒKƒz@J@VnX@`±bUXVƒ¼™lšn@xmxÝL@‚Ubn°@XWVUxUVVnkbWVXV@Xš`ÆȄKnƒlLVanIV`nLVUlƒ²ƒV@V¦„l°¦„w‚b@šnKnLVbVJšIVƒXK@b‚n@ènx@xVbUnV‚'], + 'encodeOffsets': [[ + 112568, + 24255 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4506', + 'properties': { + 'name': '防城港市', + 'cp': [ + 108.0505, + 21.9287 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@XV@X°°U„lxkbVlVb@nkbVl@xl@@b@n„‚XbVL@Vl@UbV@@JVLXbmV@bVVUXUJU²šW„XlKVb„@VVXKlXšWlXXWV@VXJlI@x„l@nlbn@lln@lbXalIVK@ƒVwœUVb‚U@aXylUX@@aW@U_UJmU™nVKUamL@Kna@aVUkkVWU_ValaV@XK@kV@@W„wVXV@„V„KVVn_lJlUXkWaXWlkXU‚±kU@ƒVUlbœkVmUmlk™¯Ý™™W@mb@¦VxULm™kJUU@ma¯wƒmkX@VóJ±bUVUXÝWk™lWXXlƒxUaƒbƒIğ™Ç@U@mVUKkkm@UJm@XnWV@x'], + 'encodeOffsets': [[ + 110070, + 22174 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4505', + 'properties': { + 'name': '北海市', + 'cp': [ + 109.314, + 21.6211 + ], + 'childNum': 2 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VaVLnK@IšJVwUaVaUkWKn_mƒX¥WwXm‚LXalbU£UyV„Å@ݙwm@™°l›LÅUƒmk™mwÛaƑLÝUUm@ȣƃV_„Ó@£UƒƒUVƒ„™¼U°W̄™ÞVbXbôx@b@bmV@ǃ™UÝ@@ĢU`m@ŽnxnIVV‚VX„VL@`@bV@@aXbVL‚@XVlKXLlLVl„knJ@I‚WVXXKlVnL@xl@UVVX„a@UV@VlX@VUV@nK@bl@nVVIVmXIV`V_lWnn„@VJVXnJ'], + 'encodeOffsets': [[ + 112242, + 22444 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/gui_zhou_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '5203', + 'properties': { + 'name': '遵义市', + 'cp': [ + 106.908, + 28.1744 + ], + 'childNum': 14 + }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@@UnUlJn„w‚JU°VL@bnVšU„wlJ@XƒŽXVlU@klVUJknl„UllL@bUJ@xULUlƒ„UblVkblbnw‚UXmla@„wV@VK@L@UXaVKVLXWƒUVa@U@Im@@W@£UKUakKWIXU@al@@llUnL@W@Un@@VlUV@VIUanKl@Xb@lmxVb@b°bb@nlJVVnnJ@b@L‚V@ln„@LmV@Vx@blnVK„nlJXIlw„J@҄b@nlK@Un@UL@VVVVUUUVK„l„@VUVL„J@UVUUw„@Wm@™„UV„ÈVlbUb@JšLlŽX@@x„„ƒLmŽk@@nlx@bUJUzVJ„@@LVxUV@bWxnLnVVK@_‚K²xVbV@n¥@aVI@b„@l@Va„Knb@n‚`n„mmý„W@ƒU_šwV@VlVV@Vn@n„˜@nI@Jn@°¦VaUU@™„mVVWVaUńU@aVKnƒVbVUmmU@a@kUw™m@aUUmUUJ¯lakU‚aXaWUUaVƒkk„amkmUnVlULƒVlJ@XU@UJWUUw„k@aU@WbkWƒL@U@WU@@XUKmV@aUVwUĕUJUamUUVUÑm™nIVJ@kl@XalJVn@KVLœ¥@UWIXWmU@mVUKnUWLUKUaWUUKVU@U@anUny@UlUkK@w@a@aVUƒ»UkVw@Wmk—JƒÅmUUVmwXalLXWWUnam@XkƒJ@UVU@U@W„@@U@I@Wl@Ènlw@KXLWb„lVUkalKUU„VVaV@@wnIlaUmkUƒKWU@KkUkLWaƒKUUWUn@VƒK@LnnWJUIƒVkUWVnV@V™@@XƒK@VUIUJ@IWJkX@VVJ™IƒVkK@I@UVaUWk@m„@wnUWKk@mxk@@„lV@b„xmb@x@VUmLkUƒJ@nVV@b@VkLVbU`¯I›l@™U_UW@UU@™™ƒK¯wm@™xƒL¯¥kIƒ™ƒ‚@bkbƒ@Ua@ƒm@kkW@XVbmV@ŽkV@bWbUbV@„¦ƒxXlmVk@ƒ¦™bkaWL@KUImK@wUK@VUI™b@bmK@LÅy@akXW@kbWlXblL@ŽULUbƒ`@U™kUymX¯@mšUJUUJƒL@Lm@@WX@lU„VlšXll„@l@Èk°V°Ž„X@VU@UVll@XUJVXUVm@@VXLWlnV@Xƒšk@mVULnxV@@bm‚kL@VWLUbU@UVm@ƒb@ķ¥UnmJ@UUVƒkkJUšlÔU`UIW@ƒ°kLUlUI@WVI™U@mWKkXk@ƒ‚WU@bXšW„@J@xX@l@LVl@xšLVxXX@x‚KnxVknb‚KVV@U„L„WlXU`@nUlšX@llVXšVU„KlkUKlI@anKVLXKVaUIVWV_VK@VnLlU„»VKVL„m'], + ['@@@KlKkUUVVX'] + ], + 'encodeOffsets': [ + [[ + 108799, + 29239 + ]], + [[ + 110532, + 27822 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': '5226', + 'properties': { + 'name': '黔东南苗族侗族自治州', + 'cp': [ + 108.4241, + 26.4166 + ], + 'childNum': 17 + }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + [ + '@@VV@XkV@bUbWJU¼Vb@Vnb@bš„@J@bƒL@LV@UVƒlUI@a™KULVb@bkJmx„šlLVxknVJk„‚xnKmnnL@bn`WIXlWLU@UxVbUVmKV„XI@JVIVJ@U„L@Wš@@UmUXUlV„UVJXImm@K„L@UVmVXV‚„LXblKlV@LXV„LlVVnkbmJ@xnXl@šbXa‚@Vana„ÒšL„m‚VnIl‚Þ¦°k@b„@@lV„nJlUnš‚VX_„@lVlK„šV„UUxVLVWVIXJšUlnnWlI@KUaUUVKn@VaVXV@na@ƒmw¯@mUkJUamI@lk@@am@@I„ƒUmVImUUw˜™@anUVaUU@LU@WaWUXWW„wV@VwnU@L@ynbl@@X@a„J@nW@@Vn@„lVLlxnI„lš@@UWKUƒnIlJXIVllIVVš¼XK@aVI„V‚@@bn@VKXLVKVVVInw„J@UWI@mX@WKnI@KmU„UVJUL@V„KW@@k„@aU@@W@InJWUXwWI@Wƒ@¯wkaVaUIl@nŽValIXWWI@UUm@anwWkXWWIUbk@UJmIUamKVUUUVVama¯VkIVVUlKnXVwX@@WVaUUVa@IlƒaVmƒkna›wk™UU@ƒU@mUVƒšUVwœl°LVbnJVU™¯la@mX@@UWKXU@aV_V@@JlkUƒ¯@V™nK@km¯k„U@ƒWUW@mmƒU@™kmlU@wkL@WƒUkL@VmLƒJ@b@V@bknUUVK@UVKUK@Uk@Wa@LUVVnUbmVk@@UU@@aƒV¯K@U@UU@WmUL@aU@WV—w@ƒ˜I„xXll@UX‚K@KXXVJna@wWaƒ£naUKV„m@UU@mUmalm@@XkVm@U@VƒLmWU@kkWxU@@bVV@VkXVlƒVƒ@UUk@@ƒmI@KUw„m@UmVƒUUwU@lwkV@IUa@mUaVIVKVa@w@U@™UJkb@n@bmJ@XmlVUxWXkJmUkUUVW™xUlU@ƒaULUšmbU@@‚WXkmƒL@xUV@nUxÇm@„XLWbnlƒnV‚nnUV˜U‚nVVz„@lbUVVlULVb@V@nUJkwm@Ux@bWbUK@UULka›JbƒU™U@U@lUK@XUJmn™J@bU@UwWa™x@zkJWnUJUUVšVV@bXn@xVb@J™L™m@X™w@`@bkb@VmXUV¯L@mW@@n@V@‚ƒL@K—IW@@aƒaUx¯@U„m@XbW@@L„V@bnVWVkKUzlV@bÆa@lnI@VV@@LnVVKUaV_VJVbnU@bn@‚‚nX@yVIVxXKVLlUVaXU°J', + '@@@KlKkUUVVX' + ], + ['@@UUVUkUmV@ln@VXVK@K'] + ], + 'encodeOffsets': [ + [ + [ + 110318, + 27214 + ], + [ + 110532, + 27822 + ] + ], + [[ + 112219, + 27394 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': '5224', + 'properties': { + 'name': '毕节地区', + 'cp': [ + 105.1611, + 27.0648 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': [ + '@@UkVƒ@k‚W@Xn@@K„KVIVVIn™°@nWVzšl@V„_VaVK@kKWaXklaX@lW@bÆz@KnL@ašaVJ@UVL@xnLVJ@LXKlbša„¥l@nUWk„wƒ¥U@VaXa@amLkUƒKmƒ¯kƒmkIUaƒKUIWƒkKm@anw@mlwXIƒmƒUk¯@a@amUƒ`kkKWVkxmUUak_mJmw@w„mXUW¯X›_@WnI@aVwkWWýŃU@WLkU™aUbVV@lUVVnm@kUmV¯™kK™LƒwmVUUaWV™aaWw¯wƒÈ@VULUVUUƒK@nWJkI™l@Umxnbm@kbUJƒa¯bUbVxmLUV™aU@VUUWxkVVV@bUV@XWbnlUbƒbUJlbUV¯b@z„`WbXnmbƒaƒwUwVWUƒbUxmbU@Uam™@Vƒk™VaƒwVaUƒWI@mUKóz@lUlÅ@WIƒb@xXxml@XklULWKUmwUa¯KUXWJkaULmKkLWbkKUVƒImƒƒWa@kUaULƒW¯LƒK¯@kbƒL@b™x@J@bmnnlUšlzU`U@@Uƒb@„m‚n¦°bU„Vx@bkVm¼mx@mk™mVV@bkxVn„aVV@bU@mL@b²`lIVV@lXLlš„bVxn@@bl@XllIVšnbVšn°°wlbXw@mVa°lVnU@mš™VLVbn@@b„@@WVnUV@Xlxn`VznJVb@L@bV`V@šUnwšU„@WUXKV@UUlmUUlaXalLšm„bšIVbnJVIlVVaUUnWVXn‚VL‚k@ƒnWnblnlb²x„xVKVXlVXLVW„LlUVJna@wVL„¼@JVX@`@nnx@nWJU@Vx@XXKšŽUblxUš°„LVKVVlL@KnbVUnJ„IlUšƒnKl£VW„x„IlJ@nšVÞUVVnb‚VX@V_°lnK', + '@@@UmWUwkU@Um@@VkL@V@„„‚V„VkV@nbVa@ƒ' + ], + 'encodeOffsets': [ + [ + 108552, + 28412 + ], + [ + 107213, + 27445 + ] + ] + } + }, + { + 'type': 'Feature', + 'id': '5227', + 'properties': { + 'name': '黔南布依族苗族自治州', + 'cp': [ + 107.2485, + 25.8398 + ], + 'childNum': 12 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@‚V@IöalK@UV@@KUaVIVVœLlaVbVWnX@‚@LnUlxl@naVLXVVaVU„J@lUUanWWI„@VlV@Xbƒb@V„n@VmVVbk@kU@V›V@X„J@zn`ULW@kK@_WVUK@LUb@Jlxn@nnWlU@@b„x@XVVU@UbVb‚@n`VI@VVLUlUIUV@KmL@VV@XIV@@lVLVmXV„@WLXLW@U`šnkb@Vl@UL@VVV„L„llX@`lIXb„J˜IXW„L‚aVL@ŽXXW‚Ģ™b@bmK@L@°@Vnxmxšn„K@xVn@VkL@V™Lƒakbl`VnnxVnUlššV@@VVXV`@šœk°JV_UalK@U@aUU@m„IlVnK‚V@U@wnaƒw@akU@ƒl@nwl@XLmV@xnƒl@VXUb@V@JlL„UšJUI@UlWUƒnLVUUaVwV@XKWkXJm_@amKnmmLwlƒUIlmUwkKƒ™nwlI@aUaVKšL@bVJ„kVUU@@K„K@a@I™ƒ@ama@UUaV»XIVa@alU@WUU¯IWVUbkVUKWLUwUJ@zmWm@@amVUaUIU`VbULmU@KU@@UmJ@kÅb@akUVylLXUmU@aƒU@KX@Wan@Vƒ°@Vw„b@bX@˜J@L„K@@U@mX@@n°KVUnW@Ula@a@_šx@WšnšK@IUa@wWm@aUUU™VVVIXmlI@yšwXbVxV@@ašInmVI@WVL@k@VšV„V‚aœIlbVK@VVLXa@aVwn@lxVI@m@UUaVKUkVUkaƒ@UymUV—VUmmU„mmkXaWK@ƒÈnVw@mVU@w„KlnXW@V@naV™VKUk@KVIUWƒ@mk@KXU@Um@@lVƒk@UVJna@UWaƒL@a@ƒXa@kmmVUUk@mkkƒamJ—ImJUUmIm±aUUkambkamVUU@VlbUbVVƒxX„WVUU@VUakU@UmUV‚U@mnUVVnUbVJ@b—UW¥kLVamVkUaWJU_UVWKk@@nl„UVVJUXm@Vm@UnVlmbnmJUbULU@@UUKWVIWxnJVb@xUL@bUJWIkxƒbkb@xVJƒbmU@kW±LkKUkVa@a¯am¥ULkalÑlKXUWƒXƒaVakImVƒ@ka@UUƒJ¯aƒX™mmb—KWU@wUUƒaUa™KmU@UXlWb—¼WLUKUb°„UlVbkbVL@VƒšƒJ@nVlUbUXmJ@VX@lbUbU@@bWb@VnLVJ@bVVUz„ŽVL@lnL@b™VVVULmKUk™Jkbm@ƒxVb@V—kƒKVnnV@b@ŽWXU‚„nV„l‚VVXVJUXlVXbWV@VU@Ubk@@KWbUUmL@JnXV°XJ@_‚`UbkXVVlÆkbƒ@VLXVV@‚V@k„KXX@`V@@n'], + 'encodeOffsets': [[ + 108912, + 26905 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5222', + 'properties': { + 'name': '铜仁地区', + 'cp': [ + 108.6218, + 28.0096 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@°a@aÈbVUlU@aVKnVV„VUlyX¹lWVa@U™VƒnUVU@m™@mUl@„mÞw„@‚xnIVbna@KVI‚J@kwV¥ƒUXÇVkVW@kkKWU@aXUWmnIVa°VXbmL@VVbnVVVUb™VbšJVbVKXkVKVanU@aWnWUWa@U™nk@mVIVK@wXxlLXbVJVlKœbl@VI@mšaXalVV„VbX@@ašalnkx@b@V‚b@Vnx@bVVUXn¤WXn@Vl@Vlzn@š`@I@KUU@ƒV£namVkXa@aVK‚nnU@anVlKƒa@UUU@amk@»kƒU¯@aš„VWnkWmkImU@akaVm@»VUV@UKnkW¯XWlkUKnIWaš@nmlIXmWUnwUwWm@wULmaUJkIUaƒaWa—klwkwmJmU@bkJ@XUJ¯W@XbWbUKUkWJUUVKnn@UmmXUWa@mU@@UI@WmXVykwm@kaULWwU@¯ƒlKUUVU@mU@UkmaUbmV@b—š‚xVnVUJVnƒ„@Jn@@bl@@knJVblInV°@nx@„mbU@UWUbm@ULVVVb@LkJmXkm™VWIUJUXUKVwƒV™UƒŽkLkUƒ@W`Um™kVmIUƒ@kƒ@@a¯lÝ¥kmJUƒn™KƒÑmbUb@Wb™ak@mWU@UbƒUVVkLlbUVƒkXaWK@LkxÇmk@@X@J@Vƒ@@X@VUV@V„IWln@mbXVWXkKWbnxVUnV„ƘInl@XUxVl„¼UV@b@b@xlLkV@VmzmV@b@VUVVLXVVbVLXKmVVLU‚@nnVWXXJ@V›¦UK@LUmkIWbk@@lUImJnšVÒVUnVVbVIVĖUxV‚@bnUVL@WV@@X@V„KlXXaV@@bƒlVxXVVIV@@WkI„UVKUkVmlnnŽƒbllU„VbXVWbblVkb°ŽVInVVV@bšnVx@l@bnVVnUŽUam„UL@bƒVVÆUbUXU‚ƒn@šVVUb'], + 'encodeOffsets': [[ + 110667, + 29785 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5223', + 'properties': { + 'name': '黔西南布依族苗族自治州', + 'cp': [ + 105.5347, + 25.3949 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VL@Vl@@IXW@kVUVbnW@XlKVVnU„VlL@b„aVbƒb@xX‚°ÔUxV@kbm@VxkxWJœ„V¦ƒŽ@ÈnšVKšxWXJmV@n„Ò@xVbn@@blLk`VX@bššla²JVUlnn@U±lw@wnw@mlwVIX@@m@klKnk‚a„KnwmmXkƍVm„Uš¥l@nb°n@„aVwVmVIVnI@a„¯@mšU°ƒl@@VnI@JV@UV@b@IUbVJmXöºƒzllUbVa@aXUl@„U@llLnKVaUa@UmK@UšwV„bnKV@VwVK@UXƒV@Vbn@‚w@U„WnX‚@„a@m„I„™@UUKlaUaVk¯ƒVaVLXK˜»XaWk¯mƒkğwmW@mIƒVkwƒJUIšÇVwU™UkVKkƒm@UkmU@WÅwm£Vƒ„m¤¯IkJWa™_™lUbmJzÝJk„ƒUÇVU„ƒ‚@bU„Ýn™m¯LUb@`mL@VkL@VƒUmmk@UU±Umka@kUƒ@ķymUkk@mmkÝmUaUakImV@V@VÅLƒ¦ƒJUXmJXšWb@n°Æœx‚¼nV@LlbUŽUbmL¯@ÞbV¤nbVx@bUVlblIœ™@KVVUnVJUn@VlLUlmLUUUxmK@I@@VW@@bU@UJmUkLVVUl@b@V'], + 'encodeOffsets': [[ + 107157, + 25965 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5202', + 'properties': { + 'name': '六盘水市', + 'cp': [ + 104.7546, + 26.0925 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@ôyVL@nXJV„Ub„x‚bUŽlšU„@ŽšnŽVbV@naVw„a‚VUXVx„x„bnaWmXaƒ_@y°aVUkaVI„aVamkXa@WVU@aUUlUXwVV@UVšbVUnKUwVa°a„bVIlan@manw@VšklJXI@m„LVVVUVK@U„ǃk@KUa@UkaVU@UVWV_XWVXVWlLXKlLXaÆKšwVL@akKm@Uwƒ@@XUVk@VUI@wWK@aUV™I@UkK@ƒmL™Wƒ@kImJƒUÅVmkXUW@UJkx@nmx@xkxV²m@kmUV±Ikb™™@aUWl_kK@am@Ua@wƒÑ@mnUWIX™wULm™@DŽU¥›ƒXIlwUwn@laU@Vw¯ÓW@w„aUaƒb@akKƒUmVUUkL@WmXUaUV@lWX@Jk@@UUKULmLUJmzkKmVX°VšUnWKUL™ƒƒL@mU@UnVJ@b@„UV@Xƒ`m_@l@@bmbXJmnnš@°˜wnn@ŽVLX@V‚@nVl@nk@@b‚l@nn°WlXzW`XXVKnUlxVbUb@‚V„Xb@Ž‚VxÈbVlnbmn@ŽkVUL@„ƒŽmLUVVL'], + ['@@@ƒ@UmWUwkU@Um@@VkL@V@„„‚@„V@VkV@nbVa'] + ], + 'encodeOffsets': [ + [[ + 107089, + 27181 + ]], + [[ + 107213, + 27479 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': '5204', + 'properties': { + 'name': '安顺市', + 'cp': [ + 105.9082, + 25.9882 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lL@bUK™xÅLWbkKWLkKUXUWWXU`UX@VUVlb@VVb@L„l°xXx‚bšbXUVb‚VnU„xšKlL°šnUlVn@UmVU@kUUVašblVXKV@ƄXþlXUxnU@mVK@_@ml@UU„@šblU@KnLVyUw„@@UmkšWVw@UVK@VXzVK@n„VVUUW@kVJnlaš@nKW™kaWL@U—™õb@JU@mU@@_WWƒL@lUU@WUUK„@lakÅUUlWVa_@`WIU¯mW@InKVVXa@Ll@VaV@@UXUWakUVWUIUW‚UkUƒƒmVXW@@amUUm„L˜l@UUa„wn@lašIVlnLVKUUšU@amK@kUKƒVyUU@aUImK@UXa@aV@VakaW@@UnIVWVaUkƒb@mWƒX@Vxm@UaU@W„@VULUxU@mLƒaUŽ™x@VnL@VVbUbmLkK@kƒVk@WV@bUbVakk„yõ¹nWUIVa@J@aVUU@@ImJ@Uk@¯„™V@nƒ°@bmJUUJUnUxƒbm@¯Žmak@™¦ƒVUnŎWlnnmxƒLbmlkL@l@nWVnlÆU„VnIlJ„@šXnK@„lL@VšJVU@bXL@xVJUl@VU@W„@Vxn@'], + 'encodeOffsets': [[ + 108237, + 26792 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5201', + 'properties': { + 'name': '贵阳市', + 'cp': [ + 106.6992, + 26.7682 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nŽlLX„VJ„LVblJ„n°ln„„LlVnKlU@nUUa@WlX@l„n@‚Vb„@la@a„„šlJ°¦„Kšwn@°x„LVkUmmwUmk_la„bšK@UlK@UUm@wƒL™mnwmw@U@¯@KnL@aša‚ġXWW@UKbƒKWX—JƒIWakJ@_kWƒkƒKUU@UVKk@@Ula™mV_X@WKXKƒ@WUUnUK@kU@WJU@@UnK@LVUVJVkUK@UUJm_@UaVaV@UU@Wƒw@aV@Xkmmm@kw@IVa@KVLXU@`lLX@VKm_@yƒI@WœU@UlVl@UanU@Uƒm@U„aWaU@Ukƒ@XJmXVbkV@ŽƒIUVUbWUUKmbk@kwmV@K@mWUXUakb›KUUUJVb@LU@@VkL˜š@VXKlbXšmL™@kbm‚UI@lVXUVƒU@mULWy@UUL@VUx™Xnl@Vƒ@VxUzmK@LkV™aƒ@VVk@@n@`UL@nmV@bmJ@Xœ`WX°WVƒn@xnxnIl`VbnVlwXUlLl‚„_nV@b@bl°„V„nWJkx@nmx@b'], + 'encodeOffsets': [[ + 108945, + 27760 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/hai_nan_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '469003', + 'properties': { + 'name': '儋州市', + 'cp': [ + 109.3291, + 19.5653 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@஼jpnr’``ŽpRVHʘ̤žZt^JÖA˜[†CâlTébQhRPOhMBcRSQiROE[FYdGNOEIH]MgEAMLLIAG_WMCSL@ED]PCLYC[ZIHgjSxJTMbHNEFCMEE_HSDFHSLECRNSFDRICHNADGPI\\RZGIJTIAHLDQOHG`GTNCOIC@eIGDWHIS[kiE[FMbECZS@KKS[FDWsCeRuU_DUQNOE[LKGUBM¨EDQP@HWHGDImXƒCog_~‹I_fGDG|QDUWKBC\\ore|}[KLsISBHVXHCN`lNdQLOnFJSXcUEJMCKSHOUMDIm_‹DI`kNDIGEYFM\\YPEEIPMSGLIKOVAU_EBGQ@CIk`WGGDUM_XcIOLCJphHT_NCISG_R@V]\\OjSGAQSAKF]@q^mGFKSW^cQUC[]T}SGD@^_ˆaRUTO@OHATŸ”'], + 'encodeOffsets': [[ + 111506, + 20018 + ]] + } + }, + { + 'type': 'Feature', + 'id': '469005', + 'properties': { + 'name': '文昌市', + 'cp': [ + 110.8905, + 19.7823 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@€hIJ¤Ī¯LQDaFßL[VQìw€G‚F~Z^Ab[€¹ZYöpFº lN®D´INQQk]U‘[GSU©S_­c‹}aoSiA£cŁ¡©EiQeU­qWoESKSSOmwŸćõWkàmJMAAMMCWHGoM]gA[FGZLZCTURFNBncVOXCdGB@TSbk\\gDOKMNKWQHIvXDJ\\VDTXPERHJMFNj@OwX@LOTGzL^GHN^@RPHPE^KTDhhtBjZL[Pg@MNGLEdHV[HbRb@JHEV_NKLBRTPZhERHJcH^HDRlZJOPGdDJPOpXTETaV[GOZXTARQTRLBLWDa^QAF`ENUPBP…\\Eji`yºEvåà'], + 'encodeOffsets': [[ + 113115, + 20665 + ]] + } + }, + { + 'type': 'Feature', + 'id': '469033', + 'properties': { + 'name': '乐东黎族自治县', + 'cp': [ + 109.0283, + 18.6301 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ªVLP`@PEdNRAHOPEAKHEVL`GZBJfvdTAXNNTZJFPrHHNpKTD\\ILHbEVd^J‚OHLh@NNBnHP`\\xH@NBRLJTlŽNv_^CTLd@bNDVFbxdFV€UPBTKOGEOUO@OEBXQP[H_EI\\EbeYa@UO_J‹MEJ_IEDKJUGMDcNUd_FMTEJSGoZ]EIYGO[YW‘gEQ]a@WHEDQKUSDUGAbYBUpSCYNiWqOSQEoF[UcQISWWNMSDe_cLQ_UBiKQOOASQAWgS­ā]ZaŽSPÝZ]XMXSŒ[^oVËNgNKlE RôEø'], + 'encodeOffsets': [[ + 111263, + 19164 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4602', + 'properties': { + 'name': '三亚市', + 'cp': [ + 109.3716, + 18.3698 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@®ĂhTBXTRPBRPjLVAR`dKf`TC‚NXMTXRJVdE\\FpTRrPjXZMTDVoZABaVHTCLVCRGF@X^bFR’hZXP\\ZHHMA[^wBWXJlW¤EJ[bCTOF‹WWMm@ILMGWQ@DQ^QNWFSHEbF`OXNbO„VNKTEPDTLTCCVTREfvfEHNbRAENH^RJXCFHNFRpVGHWISDOTMVCZeGamaLoLÛD¹¹ėgsia{OųE—Tt‰lɂwr}jŸR±E{L}j]HąKÃT[P'], + 'encodeOffsets': [[ + 111547, + 18737 + ]] + } + }, + { + 'type': 'Feature', + 'id': '469036', + 'properties': { + 'name': '琼中黎族苗族自治县', + 'cp': [ + 109.8413, + 19.0736 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@bRFnHNbHŒgN@NPEnbXP@bND`NT\\@\\QZb@`@J]V@XhžDpW„nCJGHGXO@CR§FANHVKLF\\MPVR`CvVfQtDPKpGHG@S`WJP~^dSTHWX\\RHTFACQTIAUPOU@MG__IaYSFQK‘NSbORHXCZeTFJg„B`YBMNMFi~IVDV[tGJWXGDQRGF]ˆJrALgESLSAYDGIaFeXQLS\\MKSLSQYJY}eKO[EHiGSaK[Yw[bmdURgEK^_kcSGEOHKIAS]aFSU@Y]IWFUTYlkP_CUOUEkmYbSQK@EMWUuAU\\M@EpK^_ZMDQ^OXwC_ZODBrERURGVVZ\\DTXcFWNIAWJWAYUUFYEWLQQaCIZeDM`cLKRGpanJZQd'], + 'encodeOffsets': [[ + 112153, + 19488 + ]] + } + }, + { + 'type': 'Feature', + 'id': '469007', + 'properties': { + 'name': '东方市', + 'cp': [ + 108.8498, + 19.0414 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ºŸx‹JYZQ”IŠYXLl@dR\\WZEn]bA\\S~F`KXaDeTiNO^EEKWEDQXITBXaWaDQMUJOIaTWf@NJV@dSxGZ‰Fu_@WMKAUˆ}AQ@MwG_[GOAmMMg@GKP]IUcaFKG[JSCoLGMqGEOYIMSWMSBucIeYA_HUKGFBLOFGPQBcMOF_@KO©UAtERadwZQ\\@ÊJÒgòUĪRlR°KĮVŽLJ'], + 'encodeOffsets': [[ + 111208, + 19833 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4601', + 'properties': { + 'name': '海口市', + 'cp': [ + 110.3893, + 19.8516 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ńZƂtĢ¬æßFuz¹j_Fi†[AOVOFME_RBb]XCAKQKRSBQWSPY\\HbUFSWSPoIOcCOHIPkYCQ]GdGGIFQYgSOAQLK`MFUIGa@aQ\\GGUFcHKNMh@\\OYKAigsCgLSF]GOQO]@GM]HyKSHKPW@Pxi@EMINYREXWRQ@MQcFGWIAwXGRH\\yDI`KJIdOCGRNPNtd\\UTMbQYi@]JeYOWaL[EcICMUJqWGDNZEXGJWFEXNbZRELFV]XQbAZFrYVUBCLNFCHmJaMIDDHXHEhQNXZ_TARFHVB@DTQIRR@YHAJVnAbKFUEMLd\\c^ÍÞ'], + 'encodeOffsets': [[ + 112711, + 20572 + ]] + } + }, + { + 'type': 'Feature', + 'id': '469006', + 'properties': { + 'name': '万宁市', + 'cp': [ + 110.3137, + 18.8388 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@^J@ZTVbET^JBGLFPTHld]`FLQhcVanx\\\\ZbLHTGj\\FLP~fIZRZPVTQFSVAFJE^NDLEE[~LjsxVTG\\NZZNGlLRRGLJTV@hPZANN^@T\\NEPPbDZXO`d^HSvcJDIV\\XZAJUFCLNP@PQ¤@[ïKLÑIÏ]ÇE±I{uƒ­YśUćFcYUmsVeBSVgB[RO@aYYPO^]@UVaNeDShMLG\\EfFVE\\F`'], + 'encodeOffsets': [[ + 112657, + 19182 + ]] + } + }, + { + 'type': 'Feature', + 'id': '469027', + 'properties': { + 'name': '澄迈县', + 'cp': [ + 109.9937, + 19.7314 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@T\\GJCXJH@fJDDPNCNJENN^NLHBNSx@DDYbBLLDRbjZTj@`XXTlG^Xr@PJLW\\WLTlWR@HDJTD@X_PO@STMDNTMVV@NLDM`M\\XM\\JNBH[PYZ‡úYzŸ`Ċ\\ÎÝd]c[NKVFLEBaUmBIZGQ@JQSR@CUAEGBQ`SWYRMFgWGCGJCbNnIDGMEDKVAZUEqBYRa^WEUFKYQMaFWXEHIFWMYHCrXVIIiaK@aMCUYNSIISTwXALKH@XWXIEIJQCG[IEQDE_XSBaa[AIPW@]RS[FWS[CD]PEBYNGFSaSyJG]@ugEUDQlGHiBKHUIoNSKqHFaPMICK]UUHIPDJMuCA[SCPIDIOILGAEmU[POPBVSJDREBGS[QXWSGcT}]IO_X@TGHoHOLCX\\ELT@LYTD‚aFENF\\lj'], + 'encodeOffsets': [[ + 112385, + 19987 + ]] + } + }, + { + 'type': 'Feature', + 'id': '469030', + 'properties': { + 'name': '白沙黎族自治县', + 'cp': [ + 109.3703, + 19.211 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@D\\RV]dTXELnHr]^@LETBBRTHPi^[@U`QTHDJ`MGSogDIPKdJ`WVNHCXHl_DJR@AH`FBVPUJLHKNTJOFFZON[ZEHFCJlMJ_ŒCn`CJVNGPLTNDFIdVTWEIPmRKMc_kDMWGGUTAtJLK~\\f{pqD[LAVXRCH{HC`eŒJ`}@W^U@I@_Ya[R[@MSC_aMO@aWFmMOM@‹haGGMEmaQ[@MESHaIQJQ……MckBIw[AOSKKAMPSDSLOAV_@@`KJRbKRDfMdHZERgAWVsDMTUHqOUr@VQXTT@Tƒfg‚L^NH\\@heTCZaESNObHPƒHeZF\\X^ElM^F^'], + 'encodeOffsets': [[ + 111665, + 19890 + ]] + } + }, + { + 'type': 'Feature', + 'id': '469002', + 'properties': { + 'name': '琼海市', + 'cp': [ + 110.4208, + 19.224 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@TP\\pATHTGlZDJGAQjE\\Rb@jVBDCN`JZ[NCNHNXbULPrP\\KNbMTLjJJRFP`“pNLZz^FLRHjVPZ@hxVKbHBHMNNJFRlLzGPnNHhIrHHADcPWdUAmEMVQDSKYHY\\EhBN^HpXGNDBNNBnIß‹Å_g{³So]ã@ORO@KMEDIVYB[WJUICudGTc]P_YWaCOOMFS[]@MMYBgOU@ISHKQQkKMHYY[MSHwUit}KF\\KFMCF]EIUBETSROUKTLT[NKTWREfJbCHBZKTFTKh'], + 'encodeOffsets': [[ + 112763, + 19595 + ]] + } + }, + { + 'type': 'Feature', + 'id': '469031', + 'properties': { + 'name': '昌江黎族自治县', + 'cp': [ + 109.0407, + 19.2137 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@`ZĤd–`òüˆ˜ “BSPGP@VSbQ`‡@]HC~T^SE]N]FkW]E[fY„GGOPaTMbFDYfS@g[MGK]h„e@SSSRW@UVqrPVGNStCXUhBFQGYNcCeLQQaLI@_`@EUwcEaCUaMc@SK]Du`MSkKI‡~BVNL@X`‚EvYŠwHcTU@MIe@SXJbIPNVCRXbWbSAWJCRXFFL]FMPSjCfWb_L}E[TaBm^YF[XcQk@WK‰Z“JYRIZwŒ¹ '], + 'encodeOffsets': [[ + 111208, + 19833 + ]] + } + }, + { + 'type': 'Feature', + 'id': '469028', + 'properties': { + 'name': '临高县', + 'cp': [ + 109.6957, + 19.8063 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@jD`hNd\\^dZädĒH´Op@ˆùZY\\OAGIMN[[W_NCNMKU@NUMSNCTSP@`O@WSCCI@GXQSkXKX[IK@OWqH]SkWW@_SiiYQaKCAKZaCCw@MTGAMKM]FMMIMDSM_HGHRPKCBGSJJIYH[QOJCHMBDGQJECMTDQKFGTCEGTF`NFEDMFaGSNwIiTGhYJD\\KZODC^@FTKND`XBHKJNKFBNhG^FJMPcHEZF\\QPRjQTAdgNOPgQaRSê'], + 'encodeOffsets': [[ + 112122, + 20431 + ]] + } + }, + { + 'type': 'Feature', + 'id': '469034', + 'properties': { + 'name': '陵水黎族自治县', + 'cp': [ + 109.9924, + 18.5415 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@R]NC`YL]FoN@V[vBXVFNL@TRZalnVFVP`DlOZkVSXEE_F[EUFeH[NKTgfCbMVU^@P]ZObZP@\\QhATUfAtUasñiāEoI]eYǯ@aKmaeƒWuCºKÜKpnbHbYfUDSNCPJTRAHJTDJSfDNLHXC``VBNGTYCQDIXMDSP@xLNEFRNXBIpVNLXah@RgF@`qOML@LJNSPLbaHAh@Jdj'], + 'encodeOffsets': [[ + 112409, + 19261 + ]] + } + }, + { + 'type': 'Feature', + 'id': '469026', + 'properties': { + 'name': '屯昌县', + 'cp': [ + 110.0377, + 19.362 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@\\OnVBFKHPJCJOJTDB\\vDINOCGJVVL^JDONEbrGTLpMVJLGjAHGRkVChF@vH^zIbTETMHAZOFC^\\DXT\\EffAP\\PdAV@UIYfS|S@YPICMeM@sC[_A]VQEwyHSMuNcAUlQJMVGMS@mVBZPFO\\CSFQK[LqDMACiUa@[QiFBRIHYCHkGSBS[oSOqB‡IE^QHCRWHIXsHU\\UC}JEjMNAN_ZƒAIhSEYfWDQGaPMTL’ERZTJb``NHV@'], + 'encodeOffsets': [[ + 112513, + 19852 + ]] + } + }, + { + 'type': 'Feature', + 'id': '469025', + 'properties': { + 'name': '定安县', + 'cp': [ + 110.3384, + 19.4698 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@JjDNdJ\\FbKPXfZ^Ij@RZNaVSc[MsMOHQPDJcLIJ_zCG[HQxWJBHXdENRR@XQFWZQQGOFSWUCI[WCJuRGLXNMPLhCl[Ta@SqGgJMGOmyHkKEQMINMAGaGULgwY@UOGiKQ]EYyMK”oO_QEIIKiNSMa[LqOKOaVMWMGMDY\\_IKrL\\ERT[DEPYOUA@nNTUHINkRBVMdNvGTxzRF^U`BD\\@tfNDNOJ@Z{TeTJZ@VU€cB[OBOeeQT@^OXBJb\\AbWTF`RCJFH\\RDJIJFXW@WLGBKxWTSJJMTVZND@bbL'], + 'encodeOffsets': [[ + 112903, + 20139 + ]] + } + }, + { + 'type': 'Feature', + 'id': '469035', + 'properties': { + 'name': '保亭黎族苗族自治县', + 'cp': [ + 109.6284, + 18.6108 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@FJp@fxpQ\\ApN\\GNPNBM`HLMrXLXj\\PEHnI@WUCEM\\GTc\\GZYHTPBHRCPTd€H\\K\\@HXi–BJILJJAVNTOZJNtFPC`YxDPWci@IBgbGKaTOIM@KNKrP@_hE@QbgKWUMJoWAQMFEKM@wTONCJWRCZDHSAM_UD_GWMKeCITSCGIQBGXUHQoMEEGWDQIG]FMQBMaFGueFeSQDUSDSKOCSFMLƒUaPWM_PaEGFETMX]RCRR@HXKN@JNnXXEŒSPaDI\\£FkXWIAX]xB\\GN'], + 'encodeOffsets': [[ + 112031, + 19071 + ]] + } + }, + { + 'type': 'Feature', + 'id': '469001', + 'properties': { + 'name': '五指山市', + 'cp': [ + 109.5282, + 18.8299 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@TCNOLBTLBPx\\AJdl†NR†RIbJTGNF\\@RcIYbmHoLQdKN_fCJYbDRRXKZFVEZVXBXIJBXMdESW[CUYHUVQFQAqsEIMPYMSBUIIJKAIj•GW[@[LGScDOGQOAGSYZ[HSd[HFNVD@XmJFG[OWiWKNqGKN_MAMO[HoM[BoRewo@Y^HpITSFENc`MVCdHNIVCLJFI`NFIŒP`@VZbaf[FFJG`O\\WRFA@PVPFPPH'], + 'encodeOffsets': [[ + 111973, + 19401 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/hei_long_jiang_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '2311', + 'properties': { + 'name': '黑河市', + 'cp': [ + 127.1448, + 49.2957 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VÈÞ@Žkx˜nXŽ°VÈa°V@kôw„b‚š„JVškXlVUx„„@ŽlL@xkVV°ƒ„VbxlVUnVxk@ƒ„ƒKkŽVb„Il„@°kVl„@„™lÆnkll@@V„VXƒŽš@V„²bUlƒVlV„U„VÇn@nkJšŽlkVbœ@›x²V@n°VUnlKU„n`@n°bWLnVUblVUVVbknV`°kkŽl@@V°@nz„J@XšxlWXb°n@bƒĠlbXb™bVbƒJ@Všb„a@„„@lbUbšVmnœ@lšVmnIW‚œ@WbÞ@„n@x°@š„ĢaƐéϚnœ„‚lČ¯ĠŻÈwm@ôçU™mm£Xy°UV™›@wÈ£Ǫ¯kõÝçUњ™Uķ‚ƒĢkVфÆšÞU°nŎ¥ČUĊx°m°¦żVƐœx°ƒÇ£@y„UônރÆ@Èĉ°Kô¦šW„kWU—bÇ»@™ÈĕWÇÈ£ŤU@›n£ÆUUKVamanwŃmÝJ¯k@JƒIkaVaUUÇbkaÆÑkWmÝUۙ™Ý@™ƒwnU±ƒ@kkV¯KUkƒJƒ¼U¦ƒšÅ@ówķaķůV¥Uaó@Åwmƒƒ_kVƒwĉ‚ĉmmn_V»™a@U™ƒVwķóƒ‚U¦LǫéóXÇmōLǓÇķxÝkƒƒĉ™kmakbUĶ°@W¼„@bƒšÈÆ@Ė™L„l@„°J¯„mkl¯L݃±L—amJ@¼ƒ„™VƧUó„™UX˜ċb¯ńVbkÆÝI@llx„k°V²šV@Uxގ˜L@b„@b™`ƒšÇzkókݤ@ğ¯Wƒ™LĉǙLmmnċVkbUaƒL@Ž¯„‚bU°ğL݂Ý@'], + 'encodeOffsets': [[ + 127744, + 50102 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2327', + 'properties': { + 'name': '大兴安岭地区', + 'cp': [ + 124.1016, + 52.2345 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@k›ƒϙmƏêġb™ƒ¯@@wƒmÝ@XV@IlŽl@bUxl¯VlV™bV@ULVlUV™_kx™VVV™ÈÝJ@„¯šU„™lm¯x@xóÒĉ¼m„¯Wƒxţ@Uz¯ƒWwnUwťƒ@knƒWƒ£óVƒUUwğyó¦WI—Vmm™I@±kwÇ@@bƒ@ĉ¼ó@¯wó@¯aó¼›KՃaUwmWUwÅI@aƒKó@Ua™LƒaƒVÅwō¼UUÝl±I—¤VxÇx@zkJmnn‚mbnz™xlŽƒl¯ČkJl™°@„kb„Žmx@x™@kêmVnŽWxôXšxU°„bWLóJnÇWĵ„V¦™ŽƒUUb™b™ÆġK™šk¯™VU±aXmċÑUwĉKġ„k„™ŽVxk„ÇKkbƒIƒ‚ÛXWl¯bƒŽ™X¯K™bĊš„„ÞVƚnŽĸ²lxUŽ°n°òÈb‚¦—xVbƒŽƒ@¯„Vx@¯VķÞČlĊ°KĸŽȘI°¤ČIôŽò»ƨnȰKǬ¦ôWŎÈƨwlƒnKVXmbX`lbšwkVW‚XXŽ„L°a„ƾaĊ£nƒ°@°¥ŎzÞ¥‚»œalwôkƒJ„a@ĶK„£„bU°ĊxźVÈUĠ¥ƨ™VI@XU°x°Ln¥šw°UmwXm݁V¥ĢŽ°@nU@mÆ£š¯lKœšÜw@aÅU‚¥UaÝIkmV²‚nn@Ķ»@Uk¥VKÞ@ÞÛ@ƒkVmĢa@_ƒJómƒǖ¯Æw—óÇa@alƒUwšwĢřšk@wÆWXUWXƒWa™m@_ƒ»ÇéXaĸwVa@ÝKkUWkX‚kšKXxƒn@lĊV@¯m¯nřÆwš¥'], + 'encodeOffsets': [[ + 130084, + 52206 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2301', + 'properties': { + 'name': '哈尔滨市', + 'cp': [ + 127.9688, + 45.368 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@°`„_šJlUšŽ@„„@V¦°JUšŽnLôlnŤ@@šÈaUÒVbkbl¤ƒzk°ÇVÛô°IlVUVôU„xÆU„Ž@bźĀ„º@¦šb@l²‚UVlœ@°ÒĠxšnXxÆVô¼Þ@Üx²KލlƒVÑ°UȰôlwô@²ƒĸ°„lanV@„šVŎUll@bÈnÜm„wĢ@la@ÝÞb°UXb˜lŎ²ÆškšV‚I@ŽnJnĠŽ°knƒÜbĢwna@a˜kÞKƒĀ„a‚™œ‚‚IVbU¥wĠwkô˜xnLƒċVçkaUƒ±IUmnġW„°WôĉšalƒÞÅĵ¯@W¹XÝaƒb¯a±X¯ºLƒaVƒmkLóƒƒbkaƒVUKVkkKV_@aÝykk±L@ƒÅU@yV_™aU¥ówÇx™@UkVƒn@lƒkÅlwšWVwUkĉmkklW@šašbVwnWWƒ—wWL™™@Ušƒ™UƒÇLšÇmƒ„@wƒJĉƒL¥@ƒÝ_@a¯y„UWw¯ƒ¯Uġx¯aÝXVmaU£ó±›¯nwƒa¯óÅVƒXman™„Uƒ›lUXkWa@mkI„›ğaƒm™IklÇU™„kĊƒƒzkKƒš„lU„ōĬlš™„@ŽnX°@llUxŹ²mKĉVWwk@UbUK@bmVmI—ƒVmwaWxXlWȁšmºšÞÆbUxV@ĵńWÆĉLkWUbƒaWzkbĉ`U„±LklōwUVÝ£™UW`Uwk@mk¯VkaõVX@WbL™K@XƧºWzxƒK@lmX@bkVVÆk¼Vbk@Vn'], + 'encodeOffsets': [[ + 128712, + 46604 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2302', + 'properties': { + 'name': '齐齐哈尔市', + 'cp': [ + 124.541, + 47.5818 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Þ@ށĠKV¯a°ƒ@„KVblaČU‚mnnšKĊȚKX„°ŽĠ@Þ£ôllÈy„™š_@a‚ƒ@a—KݍVwU@±™¯Uƒlkw@kÞJlÅUa°ŃČaW—šVôƒƨVšU„ƒ@»nI˜b²Kބ°Klkn°ƒ¯I@ƒƒkšK@ĕÇń™@aƒX»¯@VĵlaÿVamI@aÅÝउýƒĊȗJƒôȁÅkmƑۃ@kxġ@@l™aVk¯»ƒīŹaƒkƒ¥Å¯™JUaWU@@w™aƒ»„KUkÆkUm„UmwÛ±±UUbUŽUXƒwWwÆÝk™lkUanaWwnKl™kal¯ka™ƽa›kÅx™a¯@™amb¯V™lÇwÛĀ™V@x™šmêVƜVV‚aôV„wÈx@šˌx„¦VÞ¯VšlmX@‚ƒL@¯Ua¯LmV@„„°X„ċK™V™ƒ@UƒÈ@‚¥@w—ƒġIU™km¥Źwƒ¦¯lmn@°kxVV@¦óam„n¦l@nx™lĉVóšmx™n™ÒĉĀĊ¼„þ„šǔêÞ°ˌĠÞÒ°ĀɲĀƨźˤȤƨĊ°w@£nymwnkUUV¥ôÑVmkÆmUUVa™mVIkmô„lxkXÞþƒbl„ƒl@kV„ƆƒV„xV@š¼VÒ@šŽUŽšnnނJ'], + 'encodeOffsets': [[ + 127744, + 50102 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2310', + 'properties': { + 'name': '牡丹江市', + 'cp': [ + 129.7815, + 44.7089 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@U`lLUlVL„Ulb„aô„lKnŽU„„b‚K°¹²W°b„aÞb˜knyUlUkamř²L@m°@lšmš²n`ôÅlK„x„ÜKnxV@„l@œƒ›ÅXyW_k@™wm™ŹĕmƒX™»‚ƒÛ™l°ƒôšÈ„»š—ô˜ô_WW@Uœal»šwU@@wšUVƒš@VƒXI@w‚Ģ͑ÞȻ›aU_@mUkly@¯óV»XmWUXUWmnm¥nUUaWLk»Æ²IÇa™wÅaÝ°¯nUa±a™ƒ™@¦õÆğ„@„™@Åb›xU܁nÇłlb¯¦„ôó»mƒ—@±ƒUk@Wwƒa¯xU„V°ƒxXbǎŁUV™™ƒK@¹ƒKUaȯ@ōݙXƒal™ƒlÛkalÇUǫÇńÇakbÝƆ¯nlš¯Ž@¼™VUx@x¯W¼™Æ¯šmĖ„Ĭ¯ČƒVk‚ķÅmxœ°ô²V¤‚bUnÞW°bĢw°V°„XxƒV°z@bÞ`@„‚¦„KĊŽ„I@xƒŽn„™ÈÈK‚„šV™„@VššXK˜xX„mXUx™a™b@‚kXllĊnVlUx™XkxlÆk„m@U„Vlš@ÈwôxV¦šbU`@zÆV@„²KllÞz@b'], + 'encodeOffsets': [[ + 132672, + 46936 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2312', + 'properties': { + 'name': '绥化市', + 'cp': [ + 126.7163, + 46.8018 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ऊþÆÞ@bnJUb‚ĀnblŽĊš„„ÞlĸwǔÈŎKÈnôWǬê‚KV¥„ĸôUxš„@VšbU¼m`nnĊŽĊ„xlUšmkaVÿšLšwš@°»UmbKmݙUšwUmVknKUUl¯ƒKU™ƒUȃ‚™nK@ĠkX±lX„°„L@¯¥@wV_m›ĵ¯Ww™L¯ƒUkōƒÇVU™l›w—V󁱃¯aƒVka°wVk°mÞ¯Ŧřƙl™²™Ŏk™U@ƒmUkb¯ƒķŽ±„ó@kxȯó¯VUÒk„ÝŽ±LÛwÝ@ó»ÅUWw™mğw¯Ñ›@UkV±@k™a@¥ƒ¹Źÿ@aƒÅVƒwóVVUkU¯JÜóÈUl¯„yk£laUaVÑÇb@™ţ@kmómK™V¯IU¥ƒ@@ƒ™kV™Iƒ`@ô™¼„blU„lƒ™bÈb@xÇKkĢɳaÅɆō@ƒŽVƒK@z™@@¥ÆKnÜ@@aۏUw›wnU‚ķ@ƒ_ƒV°Ž@„klVššnULVVÞbVl@°™@nx™n°LŚÆlV„ȃmU²@VmĠLƒx„n¯xkWƒzšJ‚wnLmbXbW°šÆ‚™²™@™Žšx@JVx„L‚Ā²Æ°I¯º‚È@ÒnÈ'], + 'encodeOffsets': [[ + 128352, + 48421 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2307', + 'properties': { + 'name': '伊春市', + 'cp': [ + 129.1992, + 47.9608 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ƒKƒ¯kWW²ğl@ŽmLšÇ„„VVš„Lk°VVmLUlVn™xšVnނLnaVŽ¯¼™@™x™KUĀlb™n„`n„Æxô@VbU¦ĸŰĸbôxÆ@„™V¥„»„IVl°LUŽll@²„mV„x@ššÞܚÞVnŽlXÅÒlbÈaVVUblb„J@I°lÞIn‚Æ„mxnbUbVLÅVm¤@œţVǤXÈÇĖ@šÈ¼˜aXVÜaXbWŽnzŎašř„KôbšUlw@¯naÆKnUU¯Üa@mkkVUĊm„™żÝ‚ǖŽ‚K„™°L²lÆI@ƒ¯¥ĉƛVaÞk@ÝVaĠlnUVwƒœómaƒ@™wĉ@™a™VƒxamX@aƒ@UaÅLƒaVWƒ_nWm£nWm_ÅV¯ƒm@m„󤁚ݦƒ¯ÅalmX£ƒ™VWUŚw™mÇ@@IV™„WUw@ašI@„k@wŎ»Wƒ„ƒ™ÅVaœK›Ika@¥lUkUlwÅwVyÈwWU@a¯U°m—Ç@UçƒaVa¯mV»ÅwÝUlƒUk™V@k„mUk‚X£šw°@@ǃaÝIƒƒam™Ûam„¯lğmmI@J™U™l±ÅōŽ—kWa¯VÝa@Þkbġ@ƒxÛnÇm@akkōVōl±škšÅšťŚÝ°¯nUl¯xlb„U°b²„ô‚˜Uœxšk‚VÈUŎ„Vl°„šKXxĶ°nœU`@x°¦@'], + 'encodeOffsets': [[ + 131637, + 48556 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2308', + 'properties': { + 'name': '佳木斯市', + 'cp': [ + 133.0005, + 47.5763 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nš„b‚„ÞJ„b@ȯ@™xW¤Vlƒn@lšUVlk„ÞVÆxU¼°nUb„bVèÈ@˜ŽnIn‚@šĢmlUw°™żƒ‚VUn@lnL@VôbšwĊ‚lœ„JķĸĢl„wôwƨxVVUƒŦšxšLź™Èš°`nnĠwŎJސĶwôJ„@¤Xn܄ĸlšn°¼È°lŽ„„Uš‚b„xš@„l@ÞÞÈm°„lôwšL°¼ĸ‚°Þ²nĠ@ôwÞ`ŤI„V„ÒĠU„„@„VJĸbƄ²@°ŽĊKšœ„JĶaĢȰ@ô¥°nš¤‚bČUš@Vx„mUw@a݁ţƒÇ™ķƒ@ĕķīU¯²@ÆmVÑô¯X¥ċç@™ĉ»U¥ÝţKWVÅkUVÝŎUmǍÝx¯aķxÛUóL¯a±óōb¯™ƒÑŃVÿƒ_Åķ„a@UƒK@wm@Van@UmmLVa—@VImmXUWƒÝUřƒKUwÝUUƒkVƒk@l¯X›‚Å_ƒJ¯k™Jm„ÅLƒa@¥U@¯Vƒz¯@ƒ`@¼šmxƥšŏKÛk@±laÛ@@Xm@™ƒ@xƽ@WŎnšˣĕÅ@@aÅ@@nÝbǏ¯@ƒ_U›kUWƒkb™wÝU@ç„Wlw@anIƒ¯lyœX°m°VšašÛšm@„mVwÞK°ƒšXlaXmm_ƒ@UƒkwÝK@ƒVI™ƒXmV»ƒI@aƒ¯ğW™bġaU_¯JU¯ġŽƒ„ĉ„k„ō`±nÝÆk„™bóĊ¯Xƒ‚ĢX‚mVn²JV„lbUè„ČmK—wlóğx‚xV¦UaJ›šƒbƑÿÝL—l@bmbġx'], + 'encodeOffsets': [[ + 132615, + 47740 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2303', + 'properties': { + 'name': '鸡西市', + 'cp': [ + 132.7917, + 45.7361 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@‚LšKVVnkšbVšÈb‚²U°VnklVlaÈL@anU°ÜmXV`œnôLƒèšxlŽšLX„˜L²ašVVmÈX@ķ˜lnU„Èl`ȹš@ŤŽ°U@x„KnnV„mlnnUl‚lVnnaŎwlVÞ҄@n¦šLVŽ°lšwVk„Lšaގl„n҄š@xmLÞ¤Wnœ¼‚WÈLVVUxlÈô„„WVaU_VKšKXUÆbn™‚nôK„bÞw°bÆWXamVwœK˜™Uw¯WUk„UlJUwVUa™@@kmyzm›ĉw@kVwškƒW¯ÅKU_Vmƒƒ™xU@aW@@kK@w„a@Kƒ@@kVUƒaky°_Vm™kna¯K@™ƒL™wġk@@IÇóX™ƒwVakmV@mwXUWanƒlĉ@ǙUw™KƒƒóšܛNJۄm°@›w—Å@ƒ±b¯Wƒ¹„WVwŹĕ¯kVmōb¯w@aƒwmV™UUb™V™IkaVwķ™xk¼›b@VXXó`󗙘ƒ¼Çó™¯„kŽÜš„š¼WŽn„źĖnššxl@X`WzœÆ'], + 'encodeOffsets': [[ + 133921, + 46716 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2305', + 'properties': { + 'name': '双鸭山市', + 'cp': [ + 133.5938, + 46.7523 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@™UƒƒUwó™mÑÞÑUÝÝUkmmŃyV¯ī„¥ƒUÿĉ¯mÇkaWbÅX¯aÝxƒaóLmmšÅaWV™LULV`UbƒXóƒkÇVwUUÇKX›»XmÝ£nK@wƒ™mÑkƒÝ™bƒKUl™x¯kU™Km¥ƒ@ÝÑkUōxmbUmkVkmmnkUƒmmƒL@w¯Vţ™@Ǻk_ƒÇmV—k@ĸVx‚VÈ°lLkllšUbōwƒnVW¼nlUx¯XmWUnÝ@™xÝUó¼¯J@LVbkJWnkb™W¯„ÝLUxƒn@‚™n™Ü™b¯U¯n›Wkz„°mJ@bkxƒX@èÞVšxlaX„lVVœ„`°@ȐÞa@mÆ@@bÆ@ˤĖm™Xōƾ@@wš„n@@WÜ@kb@²ÜlŐLƦ™nw™@»„_°@„y°UV@@¦„bÆKnƒšI°l„IÆ`œ°W@k„llUV„ÞVVx„LƚÞVX„WVnnUJ˜@UbnKVnm@Ubn@@x„L@VƒbÆĸ„`UĀƄ„Ò°šŎa²ô°bôKÜVĸw°bÞwȎVnÞōVUÆlXU'], + 'encodeOffsets': [[ + 137577, + 48578 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2306', + 'properties': { + 'name': '大庆市', + 'cp': [ + 124.7717, + 46.4282 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@mÇ@сǰ¹¯J±ÅÿƒKUw‚I@™wšš@š±Å‚™X¯WanamKx™I„ylX°wƒm„wğKUn±@nVDŽUƒÅkƙ¯Kšmmwš@@¯UkÝaUUVK™mU™lk@ƒ¯„U„`ĸ@V‚mœxVxܐ@bÛ@m‚ÅL@¦š@@y„L‚U„Ŏ@ÆɅɴblġÈL@wÇaša„ƒkkVƒaš»@ó¯_ÝJ™wÇaÅXny›U¯¥Å„@w™bÝa™Lmm@@ƒVUŽlbğVmš™¯Xƒm_ƒ`¯_Ux™m™L™a¯b@mƒaó¦Çk™¤V„@bóJknVx™VXx±aƒLUbVxkLVlLWlƒ@nX@VÅbWlÈnƒx„bWšÅbmŽ@xœbml°b™„XbW„XVmnn`ƒLmšnbmb@šk@mwU@@š¯Jlbk°lbkšmLXxmbVbkllšÅނxX„xVWVVa²VܲnxƒVVnÅlVlƒL„¼šb@xV@XŽVbšIÆ°„¦„lźb„Ĭ°¼Ulšb@kĢ@lw„@ƒÜlnȂƄóȘI„ĉ'], + 'encodeOffsets': [[ + 128352, + 48421 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2304', + 'properties': { + 'name': '鹤岗市', + 'cp': [ + 130.4407, + 47.7081 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Þ¥‚™ô£nƒn@°„ÆUn`mXn¤mX„`UX„bÆKVb„@@bnW‚b„wšUšbĊ@šx„@nbšWVmƒ_mm@ó»Um„ŘWXkĠ»²¯‚¯nķšwŎ@ĊšŎK°bĸUnјKȦĠÈbÆknJššÆUĢV°IšŽšVƾƒwaV™ƒƒkÇ¯¯»™mķkۃWm@£ƒóIĵxݏōIğxmm¯_ǙŹš™K™wťŽ„UVUŽƧwóxƒxġkĸķƒIk›ĉ™xóa@UmK@kVmUŻ„¯šVxkŽġn™‚@mmJ¯n°V@bXVÇxUzÆxkxlVkV@¦lbœJ›LUbšÆƒ„X„ō¼@xƒl@™J@bVxƒXUš@JÈ@šn™xVÆUXš‚„W¤knÆb„°'], + 'encodeOffsets': [[ + 132998, + 49478 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2309', + 'properties': { + 'name': '七台河市', + 'cp': [ + 131.2756, + 45.9558 + ], + 'childNum': 2 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@²mŎ_lƒĊƒ„ƒĢV°°IV`ĢbšaĠX„°@b„JU¼Wnš„UJ@„ÞLlxV„„@n`lIUa@K°Iô»ÞVšwÞ@VmnX°WVwmkX»‚U„mŎxVak™lkkKǯUUwÇWUn™U±b—KWƒ™Kk™w„çóK›mU_nW¯ÛmV@bÇKkbkUml¯U±VÇaU™™amlUU™LK›„k@ƒU@mwÛLƒŽƒwkLóÆm_™±™nkŽ¯@@n±KnŚlbkVV‚mz—lWXº@Ķ°'], + 'encodeOffsets': [[ + 133369, + 47228 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/he_bei_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '1308', + 'properties': { + 'name': '承德市', + 'cp': [ + 117.5757, + 41.4075 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lLnlmxn„„IVVlUnb@VVxXJWL@LގVnnV„J˜_@wkmšK„b‚x„wXk˜WXXšKlb²K@nVVVb„L@WlU²„lKVnUJVz@VVb@lżmVUVnbôaVX@°Ub@lWbXš@b@bVb°x„@VxÈLVlšaÆ@Þb²k°@lVUŽ@Xn@VW‚LXb@¤VXšKVVVLnm°_ƨ¤@aUIVa„alkX›°k„™V@„alwUVy„U@k󙰃na°UVUUmUÆw@mkLVUƒWVI„WšLnn@xlVnK„myU@ƒU°UXaV@U¥ƒU@Uƙ@aVUkWU¯ƒaU@WLUV@bkbmKULmKkUVUkmVIUwlWV²™Uml°U@W„LUwVm@UUK@_ƒKUUÜaXw@ƒVKUU@mVIUUlmnIVVVbÈVlKnbVKš@nI˜@nVnwVLVK„K„„˜Vnb@aUIVW@In™°@lVnIš@lWĢ@°UVL@b„@VyUUƒa@w@WUnU@Wǯ™K@UkkJWaÛbmk@mVaÞU@amkWƒ@mXUKkÿƒ£@a„kl@Um°UXwla„al@nmlXnW°znW@aƒwV™@ƒakbĉ¥VmU@ƒIƒVƒUƒJkUmWU™KbmkUaƒKkUVU@KV@@klw—™WaU@kmƒXVènbmlUUƒKƒX¯JkbƒI@JmIUWU@ƒLml@XkJ@U™kƒK@aVKwWa—IWwƒmUƒ@mU@J@UaċU™aUUƒVkI±ƒk@UUƒ@UbVVm@UVKƒLƒlkIWaULUWƒXUJU„ƒ@WbUb@lkXUxm@@JVn@J@b„nƒb@Vkx@bšLU‚Æn„JšaVXnKVVmzX‚°V@_lJXxWXƒK¯bÅamUƒ@lUI›bñJ@LÇKkIÇ`kxWL@„ƒ@@bUVUb¯xWKk„Å„VlULW@ƒŽn¦Ul@I™lmUUUVm@kWƒnkKma¯XUKWmnwVwÝL„mŽ™VUbUVWb@Lnxm„xVŽmbXx›¦@„nb@`™„ƒVƒ@kbƒLU„mVUlkbVXkºmnm@@xk¦šbĢÜlš'], + 'encodeOffsets': [[ + 118868, + 42784 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1307', + 'properties': { + 'name': '张家口市', + 'cp': [ + 115.1477, + 40.8527 + ], + 'childNum': 15 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@k™ġۙal¥@wn@nml¹UWlaVknUVƒ„Kla„@„Ušƒ@_ma@ƒœ¥WwnaU‚wnƒmw@KXaVUVašUnmWUk°™lƒnUVUXWVw™IWVóKUI@WXƒxUU@mma@kUKWLkw@yk@ƒaVkUUċaUU@Wk@Unm@UVmLm±IUƒkJ™kWƒ@a„I@m@U„ƒVƒ„Ula„@VXVƒXmVwnkWKƒKU_k@m¥ƒmX_™JmnU@km@U@KmU™VƒU@U™@Umk@@LƒmW@Û£Wƒka@wk™@aƒI@mmk@mUa@UmUƒIƒwW@aWUƒbU@kbÇ@kwƒ@makVUk™U@aƒm@aU@mxkUƒbƒKUXUƒ±KXVWLUK@wkU@V™@WXUa@WbUxƒJIƒŽ@¦VèVVX@±ê¯KUIƒ`¯UULVx@Vƒ@UKƒIƒVkLmVkKmš@nUJÝbkIUJVXšVVxVbU„VJ„Un™°bV„mlU°„XnK@Ul@lVÈVUXšx@W„@VXšV‚KÞb„n@VnbV„m`ƒUx™kW@UVkL™Km¼@lUnUJVnV„XV@Vm@@LV„klƒIkl@VƒWlŽULWKUL@mJ„@blbUVUlmzUJUxm@UUbċÜk@Ub@VšLVV„¦ôbVŽmšUKUkU@m„„@VlVn¼WbUJ¯@@„°šnIllÈl˜@nXšWlLœk‚J@bkxlxkxlXUlklJƒšXL@bW„n`@nƎXxlL@xl@Xb‚LœKlVlIXblVUbUJW@lX@VL@VVŽšXšJšw„n@WnL°K„bVbl@VI@K„@U@nmVmV@XUWI@aXm@™VUUkWmn@lmUUk@mUmK@UnwVĉ@ƒƒmU_V@XJôVVUšLVUn@šllUnJl_n@šml@XŽlLlw²LVJUL@VmbVblVXmVnlš@Ť¦„nn@܎@bšl„@@XV`„Unb@VlLVb²J‚Xn¥ÆÑ@¥Þ@'], + 'encodeOffsets': [[ + 118868, + 42784 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1306', + 'properties': { + 'name': '保定市', + 'cp': [ + 115.0488, + 39.0948 + ], + 'childNum': 23 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VbXWš@@UlV@xVLXKWU²LV„VW„L„alVnwV@@b„n@bšVVllUnb„@lxÈ@laV@„aXV@b‚X„x„J‚nV@VVb@nnl@n„J@blšl@„ašƒU_VWUwVUškUm™Ukb±mVwœU@VIUW@UWk„@VU@ynL„m@IV@‚bnK„LVaVmnIlaXwV@@WVL°@@xnX„@V`V@VbUVVLVKnwnL@ll@@_V@VVnaÆ@œKVXÆ@nƒ@wƒKmU—™Wm@km@kÜKXU@ÑW±nIUwVƒ„Kla@I°wU±kškmm¯mƒ_ƒJnƒaƒwW@IVaUama@wƒUƒmU@mVw@aXk@mWa@£km@aƒ_kVmUnWW@¯bƒkUmk@ƒVÇm@@kUU™KUU™@UVUamVUaWIkb@xU@@amUkKƒVkam@@kVUkUWmKmUkLUb@xmJƒ™U@UImVÛVmnUwƒJƒU@VƒX@UWm@Ub°¦UšmxklmX@`ULU@@UW@@xkn¯@makV™UmxUb™°ƒlUšƒbUbƒnUJƒUUVƒa™LkbUU›JUU@mUUUƒJkaƒ@™xUIWJƒUnƒJ@V™zƒ@kb@`@bln@l™bƒŽ@X@š@š„@Xl‚bnbVb„@„„VJlInlšbVw@U„K„l@lbnan@Vb‚JôLn‚UzlV@lÈLVbVK@LVx—VWXX`WxXz‚bV`UXV¤nx@„bVlVnVlUL'], + 'encodeOffsets': [[ + 117304, + 40512 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1302', + 'properties': { + 'name': '唐山市', + 'cp': [ + 118.4766, + 39.6826 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„@VVl@²„lJ„UVVšbČVVb‚@@InV„@‚V„nXx˜JXb‚xUL@b„Lšl@VlI@Wnk„KV@VXnJ@I„Jla°I„W„LVVnkmaUç„WVkôaܯ„@nV°wnJlaV@VUnUUaW¯wXWWwna@£UaWKU¯ƒ¯@aVUkKUamUUƒn»‚an™„IVwUWlkš@„LlWVakU@K„_lƒšbÞU°@šy°n„@„KÈkWW™ţ¥ĉōƒkġWUw¯£¯ƒÇwţwƒ@kK@kƒ¥ÝwÅbǤېťV™lW°@ĸ™x@VVVULVLkl@V@Xƒ`Ub@Xm@UWbƒk@ÆVbnLWV@lnXUbl‚@X¯lmU™VkKWLkK@_UK@U@UmmUxmVXLWVULkU@`W@ULUK@XlJXzV@@xml@VU@UX@Kk@WbUK@Xn`ƒXmJnšmškxUVbUVlVVxUbV@nKlL„kVKÞbVKXI°KVšmVUIUKULVxVJVLkV@Vƒ@UbU@WUU@UbUK@b@nƒV@VkLmb@b'], + 'encodeOffsets': [[ + 120398, + 41159 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1309', + 'properties': { + 'name': '沧州市', + 'cp': [ + 116.8286, + 38.2104 + ], + 'childNum': 15 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@ln@UȄŽl@Vn„l°aX@mXnVlU„`@bln@¤Xb@nWl@bUx@nnV‚„„V@xnbVbUb@J‚X„x„b‚mXa@k„UVwlW„k„KôVm@w™kkK@kl»Èƒm™VKXkla°@XVV@VI@ml@@Vn@VX@V@J„@VxUzVVšš²blVk¦@šĠ@@»š@VK@VÈLlK@XnJ@alIUl„a„VVbš@„n@a„U@WUIV@mUn@mKXml@lL@LnWšb@XV@@a„VVb„V„@VV„IVWÈb˜IÈ»ƒǟlWšaVUÅUƒƒ™Um@kVU™WVkaUwmaóUƒJUU¯ÑU¥mk™¯UaƒKÅnÇyóXmWÛX¯aċbÛa›J—W™ÝU¯»ƒaóóUm@IƒšVVl@bƒLUJWLX@@xšXUxl¤V@V„nVUV„XVbVš@Ž„@@VVn„°VŽ@ţU¯VƒUmƒUWV@mUXƒaƒbUKUwUaÇKn„ƒVk¦Wb@VnLmV@bkV@n„xW`Å_UVƒV@bƒUklVX@VmlUƒx@VVL@x—VWVL@VW@UUm@'], + 'encodeOffsets': [[ + 118485, + 39280 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1301', + 'properties': { + 'name': '石家庄市', + 'cp': [ + 114.4995, + 38.1006 + ], + 'childNum': 19 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@la„@šy@U„I‚m„VXIVJšw„@lb„IVVnV‚@VVœIVVlašK„bVU„VVI„mVa„aV™„kš¯VanwšVlUnb°@lm@wX@@VV@VK@_nWlknwV™¯¥Van@VX‚@„W@U„V„IVxnmÜUnUVJV@„šnI@wValKnV@k‚mU£na@mVk°K„LVa@UU@UƒmknWWkXU@aWW@@km@UaU@@klK@UkaWaUnamm@U„a¯wWU@UkƒL@ŽUn@x™V™lUXVJUb™LmU@aUWUkmKkLUUm@mW—XƒaƒmmkkWUm@@U¯JUUm™kU¯@mKĉxÝwÝ¥LƒUóŽmwkUUUWVkKm™kKmLX„lxVLVxXJ@nVJnz@VWL@`nX@šƒxƒ@kVUUmJmIXx„JV„ƒnUVƒ@UVV„@LUšƒ`UXVVƒ„ƒlXL@l@b@VmX@b™xn°™UƒbkKWLXlW@@bƒK„mKULmakLUlmb@šXb@xmXU`V„b@`lLx@nWVXL@‚°WlXnlb„KVK„XVb@˜X@l_lJ@V@XnŽ„I'], + 'encodeOffsets': [[ + 116562, + 39691 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1305', + 'properties': { + 'name': '邢台市', + 'cp': [ + 114.8071, + 37.2821 + ], + 'childNum': 18 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nKlLnšlLXUVVlVnxô„V‚KÞ¦ÞxĊwnL°@lVnšVV°I@Vn@V‚lXnl„n„b˜WnXn@VVlKnLVlVX@bnVšKVaUIVWškšU@wVm@¯@U¥VmU_°lšK„k‚w@LX‚Va„U@wšUƒUUKlUóW@UVUœUlƒ°K„wlKU_na„KVnlKkkšWWa@IœJVa@IlJnU@„KVUUmVlaXUl@lm@kXWÝÑnkƒ™±™k@wğ›@@U@mKĉLmVJ@zmlnŽWLUÝJU_ƒ@@šmJkXUVlbklÝ@Ýa™b¯@¯±JÅwġaUU@ƒkU™@mVI±bUKƒL™WUXƒJkaƒLóKULWbUVkKmnk@@bmLUŽƒl@b@mnmJkUULƒaƒbnŽmn@lVV@¦n@„l@b‚znx@`Vz@b„xnV@xl„lbnKVx'], + 'encodeOffsets': [[ + 116764, + 38346 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1304', + 'properties': { + 'name': '邯郸市', + 'cp': [ + 114.4775, + 36.535 + ], + 'childNum': 18 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„bVKlVnInm‚@@a„kVnK@al@nmlLVUXaVKôL„Klb„IVWšX„KVL²a‚JnUš@lV@„VVĢbÆx²I°Ž°@šaÞbÞ@lkkaVUlWnI@™„@V`ÞI‚VXKmnk@y‚InUĊKƒÇkUUamUUkƒƒ@aU@U™ƒk@WUwVkVJVkkw°a@„mK@UX@VV„LVW@wšwVa@¯Xm@@lUIWaU@UWkXWmU@UwmUkKmn@lkVƒ²™VƒaULUVmJUUUwƒLma@™UmkIUm›L—mVšmx@b™LUamKÅL@VmbkU¯KÝamzkJUb±Vkb™L@lU@WIkJƒzkKmKƒnUalWkkKW@@nkbk@WW¯XUVUJ@XlJ@Xƒ@XlWLkUƒ`VUnaWa„UV@UVIƒaUxUUmVƒK@I@W@DŽU@@U@bƒ‚@nmKXmx™@UxkVWUX„@`VLlL@`™zX‚Ýb@b‚„@VUVkIUJVz°KVlnLlKnL„xlLVVUVlXUJ@nn‚„I@mVUlbn@@Žm„@bV„nV'], + 'encodeOffsets': [[ + 116528, + 37885 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1303', + 'properties': { + 'name': '秦皇岛市', + 'cp': [ + 119.2126, + 40.0232 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lnV@Xb˜škx@lU@@LUVlV„LVbnl‚ašLXVVn‚l„I„V„U„JV@UnĊ¦la„bš@nJ°UmƒV@„wn@VU„JVI°bnWlXnWVLVK²b‚akk„lI@aUaVƒUwVUUalaVwnUVak¥šX@W‚kœLVÓm„mUK@_lWš@n_UK@alÅ@ğÅƑŃݍmƒ@їţÇlƒLƒ@¯m™z¯@ÝV™ak„ƒ`@LlVUbkXƒK™@klVXUxƒJmšbm¼V„nVVblLUV@b„°V°XLVb@¤mbXxWX°xXŽVbmVUVU@kbmI¯xmUƒ@Û°óbUl'], + 'encodeOffsets': [[ + 121411, + 41254 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1311', + 'properties': { + 'name': '衡水市', + 'cp': [ + 115.8838, + 37.7161 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„KVlV@X°xƒb@VnnmbVŽXblb@VkL@lV@Vbn@@l‚@XX@bWVXlmXnlV„V@@VUbƒK¯LUl@nmbV¤n@l‚LXnlVUV@ln@lb„UlLnV@bV@@wlaXJVbnUVbVUš@VVšLVVn@VVX@@U‚KXU˜U@wUK@U„wVnk@UUWlk„V@a„UVUÆ`X_ƒw@mlU@anUmK@UXal¥„UmƒÈLVbVxVL„a„bVW@nXU‚Vn„„V°UŤV@Uƒ¯Um@Uƒ@@U™UaƒWVUmUUƒU@k£Vw™W@wW@XKƒIUa@wU@@al@UK@_mKXKƒbUU@aVKmš@Xmƒƒ±@kbÇakLğVaUw@a@ƒmkUJƒk@ykw@£ƒWX@lknk@WVkbUŽVnUVƒL@‚mVkI@JUb›I@JXb™XllkLUmƒLmbV`kLƒx¯Lk„›VUV@VôXkVVL„V™V@xƒVUbW@Kxƒl™L¯kV`UnV¦°@'], + 'encodeOffsets': [[ + 118024, + 38549 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1310', + 'properties': { + 'name': '廊坊市', + 'cp': [ + 116.521, + 39.0509 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@la„Ušš@šUnL@VWbklWxnIVV„V@X„JlbUlšXVbn@@K„mV@@X°WVInJmn²@lmVbnL@amKV_kwlmX@@LVamaXaƒaVU@UnJVanLlUkaW@UaVakK@IlKUU@an@ln@alKUƒkIVa@a@klaUKUV@UkUV¯šKVƒV@kUmƒU@@a¯ImJUU@VV@UL@Uƒ@@WXUWa@Ukwm™@ƒX@@w@al@@aVIUmVUUUVWUknK@I@™l¥kU±a™™UUVyUwƒ@@I@UUWm@@Uk@@nUJU@WU¯@kbWlULnšÇ„k¼@llLšl@xUnóŽƒLƒlkXUxƒV@lWb„I„`°nnn™llŽV²¯x@JkbƒLU„VxmJX²@ÒWVÛL@lln@‚Xn˜šnV„L'], + ['@@@kX@Valaa@KWI@UXW@WanaUIW@UaUKķŽk_W@UVUKUš@bƒ@UamxVXnJUbWVXLVbn@W°kb@U@Wó¼mIU¼k`V„@bVbl@„lX@lUôVlUœIV`lX„Vn@lUlVn@„l@UVaƒIUWl£Um™VWU@@UUKlUUUnƒVL@KšUnLVWUa›@™U'] + ], + 'encodeOffsets': [ + [[ + 119037, + 40467 + ]], + [[ + 119970, + 40776 + ]] + ] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/he_nan_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '4113', + 'properties': { + 'name': '南阳市', + 'cp': [ + 112.4011, + 33.0359 + ], + 'childNum': 12 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lKl@nVV@„bn„@VVnm‚nL‚LXx@š„‚VLlKVU„IXWÜ@șlbl@XUĊUlwnW„LÞw‚m@ÞUVmnVl@nX‚JXLm@VnnJla„I@VkxVb„@VŽln„J@knKVn„@°aVanal@XK°b„‚@š¯VJXIš„VK@al@nV„k‚@nK„a‚b„@XL@blVVKVLXK„@VaVI°mVaX@V_@a@yUkVw„VšIVašJ°™@anIlaV@nKnXÆm@wUUV±UUWUKnaWwXUWmŁ¯Vƒam@kakImƒUKƒ»lan@VXXa˜W@@UlUUa@a@UlwUƒV@Xal@@anIVaUK@V™XmwVmUmV„LXl‚@nalLnal@„šnKlkV@@UnJ‚UXnl@nVl¦V@@VnJ@nUVVVVIn@Va„JƗn@@K@m„kƒa@kmWVaUI@a@™k@@aUL@mmaVIUKUVƒ@@IU@mƒUmmL@K@UUUU@mW@@nU@ğ»mVmbk@klW@UXnV@LƒJm„™lUnUJ™UUUWƒƒ@UnkKƒxmLa@ƒ@@lUU™bmUVWk@@nkUmam@UakJU_ƒVm@ÅlÇLUVmVUwULƒKU@ƒk@UƒVUlU@@Uƒ@UaUUWaŎƒzJƒaWLkl™b@bmL@„kKƒabWŽUVƒ_@mV@b¯JmXUbUK™¤ÇLUU@b@JkLWmkUWIkJ@VmX@JUbVXU`¯VV¯blK@LXKl„UV@Um@@Uk@kxWŽkbƒL@KkbmL@‚UXmaU@@l@x@blX@xUJ@bULUlULÇ@@VšnU`W@@nÛ¼U@@VmKUkm@VVX@@xǚ@bUbVb@VX@@x‚LUb@lƒ¼XLlbUlVVU„Ub@n'], + 'encodeOffsets': [[ + 113671, + 34364 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4115', + 'properties': { + 'name': '信阳市', + 'cp': [ + 114.8291, + 32.0197 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VllInJlknJVkVU@mXlUÞ`VnV™VU@U@y„@nXlKV„nJVkXKWaXI‚b@yVk„VUkVwn@‚K@nW@k„KlUXVVUlbnUV`n@V_V@llX@@V„b@bV@@nlVUb¯‚WLnbmb@ŽnLnK˜b„U„bVWnLlaX@VVUX@Vln@`kL@ll@VXVJÈIVl@XÞJ°Una„LlylU@UXKlnn@lanLWWnbVI@KXKVL@LVWVL@UVKUIVWX@@XÆJ@In`@lJVI@a„WšÛnK@UlK@UU@VK„nlm„nXal„UllLUbVVšknJ@nV@Vm@a„l@@xnV„„lJVUU@™w@aƒk„@XW@_mWnUlŁUmVKV@VXwW»XƒWaUwnkWUkVUƒU@@@WlaUkkaƒIWVkm¯xmIUmƒLUVƒaUIó»m@mmwXk@a›mk¯¯l™@wƒmkLmmU@UbkUWJ@XUbƒJ@b@l@znÆmK@Xk@Ub@lm@ƒI@akmVKUUVUkU@U±JUbkƒ@IWmkxƒa@UUV™UWVkIUaW@UlLWn@VkJƒI@VkK@L@bmKƒkJmUUaUKWXk¼VxnJ@„V@@VULV¼ƒ@@UkaUlWL@U@W@IkKmL@KULUWULWKUXUJmIƒb—KƒŽƒ²UW™nWKUUkLUƒmUUam@UU™@ƒmUL@xkV@„VV@bmV@Vk@mwkUƒVUx@mbX‚ÇnVb„‚UL¯šWŽnUVLVb@xnlWnU@UVUVVUbVVlVkn@llVUXUWUXVbUJ@bmLUJnb@nVK@bl@@š@bVJUbnX@l„b'], + 'encodeOffsets': [[ + 116551, + 33385 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4103', + 'properties': { + 'name': '洛阳市', + 'cp': [ + 112.0605, + 34.3158 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VVUllLXl@LWn@J„@bƒKUVmnL@`VblLnbV@„b@JmL@LnV@VV@¯„VJVnXL˜@nm@aÞ@‚a„k@m„IšmVbXL‚ynLšk°@°aVJnUV@UVVXk@WJ@VXLlUnJVnnƒ°U@»°U„wl@šb„WmUXƒÆ@VLXU@m@U„a@I›mkb™a@naWW@_@WXUV@@U‚ƒ²@„K@I±U@¥kKWLóLlƒa@£Um@kWKXU@mlLXUVKUU±J¯_@`UL¯Wmk@Wa„kkƒlUnƒVUVaU@KUU@mmK@_ƒa@KX@VaUIm±™k„aVKVUkw™@kaƒƒW@kbkL±UUaƒK@UUKVak£ƒ@UmmL@lƒIkmUƒ@Ualw@UƒJkbmIUmn@WKImWk@mUUnÝV@ŽnÝxƒKmXkxĉVWVk@kaċšÛ@WXƒJUV@zŽm„VWnbUbVbšLlUnŽ‚lUÒnWV—VWnk@@Vm@kxm@Un™l@Ll@@V@šXnƒškJV„šV@nlVXx˜U@l„n@aš@VLnWĊ¦nxš@lbVKXLl@ރVLƒ„XJl@XXl`lIXVl@Xl‚XUVšK„wV@lanx„zUbVJ@VVX@b'], + 'encodeOffsets': [[ + 114683, + 35551 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4117', + 'properties': { + 'name': '驻马店市', + 'cp': [ + 114.1589, + 32.9041 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@n@„b°UƂXnVlnLÜ@VLœm@n˜@na@J„„m@k„@lVšVxXX@„V`lLV„XVV@VVÞLVV°„²@lašbnxV@@b„Lšmlm„_VWnIWUna@lšLšbnV°ƒVL@KšV„LVUVaVLXK@mÆXna@wVm„a‚@Xw@KlL@a„@Va@wUkaWnIVƒla@Kn@Vn@VUl@nKVn„J@LnK@aVkVUUWƒ@VakUVanI‚²X‚W@UUU°KnUVLl@XaVK@ašU@KUI@W@_lm@KkLUKV_Uƒ@»@UVJ@XV@@mVL@K@U@Kk@VwUUm@kmWL@VkVkzƒKmb¯VÝI@WUkÇJUIUWk@@klK@_km@UVWUUW@kbmKUXƒaƒV—amLmK@namaXK°VakU@mU@@aƒa@UW@kkU@U`m@U_mVkaUVWUkVƒL@lmX@ŽLm@UxVlƒUUl@zaWJXbWLUlmIUƒkLmWƒ@@z@VUVUšUmÝ_kVWŽ@nUVUlmIklmIkJUkƒl@n@Lm@؃IUbm@UJUUVU@mmI@UU@k¥mUk@WmVmI@VU@klmLƒ™k@mbkKmb@WkƒKUŽVnUnnxšW@UVLUbmJ@bk@WbU@V„kx@V@bVbkV@V‚@‚—XWbUWm@kb„¼VLn„lJlb'], + 'encodeOffsets': [[ + 115920, + 33863 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4116', + 'properties': { + 'name': '周口市', + 'cp': [ + 114.873, + 33.6951 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lšnb@xlJ@UnLlKXUlJl_„KnV@xVL@bkbVVUè@šWb@„Ubmš„ŽkšVšmbX„VJnUl@„a°@@b„LVbƒlXx˜InmnLVw‚anJÆw²IlmnXVl°VVbÈaVb„@lkn@VWnLlUVmÞUUklƒkƒVkUaVaVaUw™K@kkaVWmw„_„‚l@nU„VVb@b„aV@VV@zXJl@@kl@šlœk°WVnÆbnbUšVJ„Iš@VKVm@k™K@_kK@a@aU@@wW@@k@aUW@IUWVUnLlUlVXKVwmk@W@—VWa„¥@k@lnƒUIÇKUaU@ƒUUVmIUV™Uk¥ƒVma@¯k@Wanwmƒ„@@n@@m@UIVƒkUVamUXWƒaV™U_™@ƒmUVUImW@aUIĉK@VmI™b@lU@@n™JƒkU™@KƒIUmmLk@UVm@UŽm@@LkbU„mJXlbV‚@xUbƒ@@bkK@LWx@ƒbUn@xmbÅW@nWLUKUbUVƒK™U@LUK¯„mU@šVV@xULUŽVL@bU`WšUz¯aUamKUaƒ@@xkX@x'], + 'encodeOffsets': [[ + 116832, + 34527 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4114', + 'properties': { + 'name': '商丘市', + 'cp': [ + 115.741, + 34.2828 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@XVl@lLȃ„@VkV@V»UanƒWX@VaÆÇô@ÈaVX@xVJXUÞU‚aVLĸbXKl„V@šm°Vn_ny˜XX»mUk¥lK@a„_@yšInaVKVa°_@WXI@ƒ@K‚VnIlbnaV@„l„@‚a@_w@ƒlwUKm™Xa@UV@š»Vƒšw@kUKVUUm@w±VUXUKUwmJUUƒ@km@@±mXkmUI™@mm™KUwkbWakLWaUIkJmŽƒX@l@@VUX@JWbX@VbULWbƒlUVULknlV@bVJk„mb¯KknWmk@@nmVkx™@ƒVmU¯KUnUL™@ƒJUIV™maÅaUm¯X›l™kk@@lk@WI@yUUU@ƒb@aUaƒUmVk@ƒƒ`nxUXlb@lšLVxUbUbVbUll„k„VlÝVUnkVmKUXm@klƒ@ƒnUx@xnxƒn@`VX@V²x@V@b@„Wl@zU`VUVVb„L@Vƒb™W@bkXllkLWV@V„@VVÈwlVœ@@X˜K²Llb„WnnÆL@VnJWn'], + 'encodeOffsets': [[ + 118024, + 35680 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4112', + 'properties': { + 'name': '三门峡市', + 'cp': [ + 110.8301, + 34.3158 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@WKUmUI°ƒU@@UmU@KnK@IƒaU@makKUa@_‚KnmVU„L@a‚ƒ@IXm@KWkkKVkUU@aUW@UUIVaƒymwkbU@ƒx™LVUWWkk@WUkJk_WWk@WI„ƒUK݄k@WKULka™@mwĉ¥mXUK™@@bƒm@k—VWwkU@m™UUƒlI„™Wm@™@Uk@@KškVmn@lwn@@Ul@Xm˜UXUmVсkmkV™KUaVamaUXnƒ‚@ykLUKƒ@™WwKmKnUm@UmƒƒaU@mUk@kL@lƒxċxUnkVmnXxWb@`kzWJ@V—LmVUn™lmUL@lW@Ub@VšXUbš`VLUbUJ@nmnUlUUm@@bUJlnU„š‚U@lxkbƒ@@XƒJUnƒ@kb¯VVVmlXXlJlzn@VlkVW@bkK™bmškŽUbVb„lƒXVxšKÈnšwÞlĊKlšVnKlwX@lL@xlUnVn„@šl@lmX@ƄÈb°¼ÈwVJlx„_°xšašlšUÈxlUnbVxnL@lllšbm„n@nb‚@@V„L@V„@@„VLšJnIVVlKnV„_'], + 'encodeOffsets': [[ + 114661, + 35911 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4107', + 'properties': { + 'name': '新乡市', + 'cp': [ + 114.2029, + 35.3595 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@XVlL„K°bUblbUbšl@nX@W„XVVKVkš@@Žmb@„Ubn„W`kL„LƒV@VVLnKlVXIlVš@@a„@l£nWlƒkVa„@°bnUlLVlna‚bnUVUXKlU@ƒ@lk@a„I°y„@ôkUU@wšmôšnkWakml™UkVmkUlmUUm@nkUKWanamU„LXW@U‚VnUln„`l„œblL°KXV@ĠJ@L°„šJšUVw„anK@UUImmƒkK@¯±Um@IVmUmmÅnWaUK¯aUk„w@W±kVƒx™U™VƒwƒnÅJUIWaÝJóI—bm`ÝbÅImJUI¯¥¯@mU¯UƒJmnUVóUkl±V@zXl„bWVXL@bm„mº@@XmJUXU°llk„@nWJk@U„@¦U`m¯ŽWx'], + 'encodeOffsets': [[ + 116100, + 36349 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4104', + 'properties': { + 'name': '平顶山市', + 'cp': [ + 112.9724, + 33.739 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@l¤UbVL@V„LVb²VlKlaX@„„lbš@lxUVULƒbšln²VJUbW@@L„b@`nL@nVV@LVŽUbUVm„kVl„ƒlXbl@Xn°ŽVK@_°`²IVVV@VUVJnInaWK@Uš@„K„LÆ@nmlXXWVUUw@klKVa@knyVkVanI‚JXUl@XbVUl@@aša@mXk‚bnK@UlK@UUUVaXaWmkUm¥n—WmXaWaœkl@VmÞb„KVL@aVI@mUwVm„@KōméUL™KVaUk@kUK@U˜WXI@VlKXU‚@VVnInVV@VLlK@UUƒkKU_@ƒWWUwU™@klƒn@ƒƒ@Imb—@@m›nUKÛ@mKUkWVXxmbVLXŽVVU²VV@xÅnmWmLU@kbmJ@b¯š™IUb™JƒUUxVl@z@bU`W@Ub¯nUJUbƒ@WLUKULkU@aWKƒ@aƒbmL@ƒlmUk@@bUL™ƒWJUI™°@ƒŽ¯aWLk@mbUb¯b'], + 'encodeOffsets': [[ + 114942, + 34527 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4101', + 'properties': { + 'name': '郑州市', + 'cp': [ + 113.4668, + 34.6234 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@nWVUKÅ@W„nVnI‚ŽV@œkƂšwV@šnn@lxÞlnôJ˜zXJl@nalUČVlƒl@²UlkôVVUnm„I°VnV°@°¦VJnIÆJÞan_VmU@ama™@kU˜¥kaUklw@UIV¥kVUI@ƒmmUÅmUlƒwVU@amU—JWbUakVƒ—Vé¯Im`ƒk—@ƒwVWmLkU¯ŽƒXkWmLmx@UUƒbm@@x™J@LbW@UUVWUkVKƒ@ka™IUamKUkkmmLƒUkJUVWXkWmnÅ@ƒKƒL™@@VXLmbmJUIUVU@ULWVkK@nWVXL@lVn@¤„b‚kôKXKlL@¦²V@JƒL±@„@VU@WV@X@`XXmb@Žšblaœn@Jƒb@V'], + 'encodeOffsets': [[ + 115617, + 35584 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4105', + 'properties': { + 'name': '安阳市', + 'cp': [ + 114.5325, + 36.0022 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@°kVaV¥kVmUkWkWVkVKUwkkmKUU@a„wWWXWakKWkXmlašIVmX¥ƒU@a„@WnK@kƒƒ™V™I¯ƒ@KğI@WU¯LkK›akƒƒ_kmmVU@VWXƒKnVmbXbVLmln@VVknlVUnVlkšlnXbmlmlXblnÈlWbn@@nšK@V„L„bVV°VVzšlnš@V™xƒI™b™ŽU@WLUa¯V™UkWõ@¯kkmxk¼l‚„XUlVbVLnlULmU@lƒLkVUlƒX@xW@¯mUƒ@UmIUW™L@aXa˜kU™¯anƒWk°@k™kKmmUIWaambUkkKmV¯aƒ@UblŽk„mXk¤ƒ@@b™@UbULWVnb@lUVVnmšnVVU„J@bWXX@WJkL@blVU°UV@XlWnXUbW@UVkVšVWbnLUJWLUK@Lnn@blVU‚„nUblxVUVJXU„a˜@Ub„LnUVV@mVIVVn@UbV@‚XbmbUV„_lVXUWanJVI@WkI@WVIVU°WXXl@la@mX@lLXl‚kVbœm‚X„ylIXJV@@kšKla²UVa„IVyÞb°LlVna@UÆKnLVbšK@anwU™'], + 'encodeOffsets': [[ + 117676, + 36917 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4102', + 'properties': { + 'name': '开封市', + 'cp': [ + 114.5764, + 34.6124 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lUVbXa˜InV@bUV„x‚knVVÆnn@„VJlUU¦VJ@kxVllb—¦lVš@nb@bVŽUn˜aôJÞIXbVJÆI„m„xšUšV„w‚U²l@XƒxVl°bVLXb‚`XklUnmVblLœ@lmšx°LVK@UXIVašWlL@Ukƒ°KkVaVUXmmI@UÅKmmƒXka±K—L@W›@kUÇxUUƒ@@UXUlKkklW@ašX„a@UƒKUaVUUV_@yXk@ƒ@a@U±w@UUW@_„mmw@wVw„mUaÇbUa¯UUkmWkn±JÅxmIbUxmKmn—JWw„kUaƒK@a¯@ƒbk@mVUIWƒ—Lmwm@Ua@WJUb@LUl™@UUmLUbWJ@VL@VmXWWzUJUꄘ'], + 'encodeOffsets': [[ + 116641, + 35280 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4108', + 'properties': { + 'name': '焦作市', + 'cp': [ + 112.8406, + 35.1508 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@V@VL@x@bXŽWV@XkššlUŽWX@J„@nI@KlL„KšUVaV@œJlL@KUk@KÞL‚l²_‚@nWlL„UVVš@nLWVUJVn@anV@a„wÞUVLVx„b„@lW„@lbXn‚Vn@@¼šL°mšKVn@bnl@nVK@blb„L„W„U@VWLXV@nlKn@lVVbXw°nV_@¥Vƒl@XI@mlƒkkV¯VWnI@W‚@n¹nƒ@aWKXUƒaWk@yk@k„ċUkVmbk@WI—yóImÝkkwm@™mU@™xŁ›lU@mJƒX™ak@ƒx¯V@¼¯Vm„UmmIkVWK@UXIl@UWVUU@mVUI¯b¯@™lmKzWKUa™nƒJ@nƒlbÝ@@b'], + 'encodeOffsets': [[ + 114728, + 35888 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4110', + 'properties': { + 'name': '许昌市', + 'cp': [ + 113.6975, + 34.0466 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lI„VnKlnVlnLVbšJlb„@ULVlUXVVX@‚a@KšI@wn@„aVV‚@nwnKlX„W°lVnKUX„x˜@„ln_°JVIXy‚XnW@U‚K@UXIVanKVVš@Vk@KVaXI‚@Vbn@nx˜KnaU™l™ƒn™Va@ƒXa@™VçUUla@aUK@wmUƒLk`kIWVkLmK@V@XUlƒn@JXV@nm„™bU‚óIƒmUa±@@ÑóVUUk@UlKVU@akWVUUlUUaUK@UUKWbUkÅJ@XWaƒ@XbmJ@nUJ@bUKƒLÝaUnk@›lXbWbXnm˜n¦lVXnWbUbVV@VkL@VmLaWl@n™b@bk@UVWak@WVImJUbUlmz@lUbkL@lVx'], + 'encodeOffsets': [[ + 115797, + 35089 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4109', + 'properties': { + 'name': '濮阳市', + 'cp': [ + 115.1917, + 35.799 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lLXbW‚XXƒx@bVVnLllVxULUl‚XXlVlUnlŽU¦Ub¯l˜nœK@V‚bVb@šXbVL„KVxVVnIlašb„a„¥lU@wnalLnVVlVLXnlWVXn@@lVI@WnU@mƒÅW¥—aW_k@WwXy@kmƒ@wU„mš„š¦šlUxVLV@UwšJ°xš@VX„@Vb„@š`VX@VX@llšIVbnJlI„bšV„l„˜J@ƒmѯLóa@ƒƒKUa„k™ƒ™Xƒ@UK@wU@ƒlWUUݯImW¯aƒLUKU@ƒkƒ»k@mƒwƒa@UnKWI@ƒUU@akVWK—k@a±ƒbóUWKXUmk™KUmLƒbUx„„@lmLXŽƒ@@b„VW¦Un™JkbWnXl'], + 'encodeOffsets': [[ + 117642, + 36501 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4111', + 'properties': { + 'name': '漯河市', + 'cp': [ + 113.8733, + 33.6951 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@Lƒ‚UnVxnIWa„@Xb@WÆIVlXaVL@VVLVbkVVŽUVlX@bUVkLV‚l@VVôU@Ò²@Vb„nôJVšanƒ@mWU@I„mVk@WkI@wmak™@wlW@w„@VbnLVb°bVyX™V_@aUKVVK@wUU@™™a™K@kmbXVmJUXƒ`kn™nƒK@aU@mw™akb±@¯ƒUUÝKUUU@WU@VkLUKU@mUmJUU@WVkL@UWJ—X@VVL@lVlUbšLVKnêƎ'], + 'encodeOffsets': [[ + 116348, + 34431 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4106', + 'properties': { + 'name': '鹤壁市', + 'cp': [ + 114.3787, + 35.744 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ó™™n@xVVólƒ@¯zƒJ@bkl@@„kVWLUVmVXbVJnnlLlš¯@Xlm„°bVš—lWb@bšKVXnJ@VV„°nX@@w„WVklU„K@knVVKmkUKUaVkƒWkl»nwlŽ°lö@lXšV°UVbXKV@šša„Jšw@Um™™kUy¯UUUƒaƒK@U™L@mm@XaÇkkmWank'], + 'encodeOffsets': [[ + 117158, + 36338 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/hu_bei_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '4228', + 'properties': { + 'name': '恩施土家族苗族自治州', + 'cp': [ + 109.5007, + 30.2563 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VK‚bX@lbUVnL°„@VlVnUl@VUX@„aVƒmaXƒlašUUU@wmaVUn@Vƒnmmk@m™U@kna™aU¥Vam™X_@WƒU™mW@_kƒVaVKnL‚lœ@VVal@k¥@kUW@kUKVUlUVсW@kÇaU»ValmkUVUVak™@aƒV¯_@W‚UkmVUlU@aœƒƒalI@akkVWUaWXUWwœWVbÆ@„„l„alIVK@U™m@UU„W@al²a‚¯UağÇm@ƒbkk@wƒ@@W™aULmxƒIU‚™ƒb¯@U`UX™JmL¯aƒKX›WUL@aknmK™@aWUXaWm@I@UÅmVU@™™aUV@b™VƒI@WkU›bXkm@VakwUKULWKXmJ@XUK@ƒmL@KUwVaUI@KU@mmn™mXka@»V@@UUaƒw¯yVk@ƒUUVmmkÛÈU@mWUnmx„šmlUbV¦UlbWVUL@UUƒ™IUmÇKV„VbUVVxkn™LUxV`VX@š„„kJVVUXWaUVVlUnmKUbkI@WULmK@L@LVlƒLnmUIWV@aknƒ`VXUJIVlUVVbUX@¤mbnLm‚m@UXk@mm@Ukaƒ¥@kV@@KkU@aUKWbkLWVkIVŽk@UbVlmX@bU@@mmL@bn`@Ln@llVLVk„@XVVU@`VXUš‚¼k`VULka@VllVIn¤VU@@bl܃bkx@bkL›škKƒn@bn@@b@JUnV`UnVbVKlVXUlbn@°ƒVx„@@b„nVbUllVn@V—VK@UnW@UVUšlnk‚VÈޚxVb„VVI„xVaÆ@@aka@UVaU@@a„k@Wl@nbVIƎ@Jk@„L@VlXnlla@VJnw@UmwXU@aVK°ÒnllnLlb„xnKVaV@l¦²nVl@llL„x@XVVœ‚Ķš@našx@U@al™XUVa‚LÈþV°XxWXkK@šmLnlUb@b‚xnLVlVVkb@UJ@xWXXš'], + 'encodeOffsets': [[ + 112816, + 32052 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4203', + 'properties': { + 'name': '十堰市', + 'cp': [ + 110.5115, + 32.3877 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@@a@w@kV@nbVK@ƒnUla„@la„Ål@nlVakwWX@WkLšaVmšwV@anK@UlIXmWkk@@mmLkWlwk@U_mKXwWK@U¯K@UU@ƒVUa™kmƒkI™yUUVUmanU@mlwkƒ@_mWXaƒUWU@ǃ@U@aUaVwUKUIƒVkK@UWIXƒmaV@k@Vm@UnwlƒUamk@V@„ULUamxUJkU@Iƒ`WkkK¯XWak@@W@IUV™LWJkXkaÇVUKƒ@kUmbmUUƒUKƒbkKWUkI@ƒkKÝ@@aƒUm»nI@mƒU@UnWV_@aUmWbkLUl¯b@a›kkk@WkkJm_k@UV±@J@b›nU@@WÝIUJVbXL@nlJkx@„Wn@VkJmb—LmUƒ`VbUL@xVn„@XVƒŽ@„mVVnnJVbU„ƒx@„V„nVUbVVƒx@šn„™bUK@bƒ„@bƒJ„šm²„VU‚lbXzVJV„„JVbn@@Xmb@V@bVJÈ@‚Vnkn@°aVVV@šX„KnalLVmšUnnVKVlnLWlXX„Klk°š™šXŽWškLUVVV@nU@ml¯nmbk@W`Å@mb—LWm¯UƒxnêVèk@mbƒVƒnUK™@kKmXk@@JUI›lÛLllnbVnlJ@LULnlÆaVLnŽV@nkVJ„@lkô@²bÆm°w„L„WV@VXšKšVXI@W°ÆVšK„b°U„JVIVV„¦XKVL@l‚InaVÝnUl@@bX@‚™nmVL@lVL„lVLVUnbVW@xXn˜bœU°¤V@š™„a@kWKUUn@VlnL@UV@Ü»@mX@V_ƒakaÞ@VK‚¯@kkW'], + ['@@mUkUUm@nllVKXXVK'] + ], + 'encodeOffsets': [ + [[ + 113918, + 33739 + ]], + [[ + 113817, + 32811 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': '4205', + 'properties': { + 'name': '宜昌市', + 'cp': [ + 111.1707, + 30.7617 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@°`„U@blšUbUVlVkn‚ŽUbV¼Èb@l‚XUÒkVUVVL@lVX@ll¦k@UbU‚›@kmKULUbl„@`nXšŽ„V@XW`nšUbV¦šbmb@lšV@nnlmnU„m@UVnb@xVV™VkbW„nb‚VnVa@an@UaVU‚JXnWlXX@l„¦@ŽlKÆX„bX‚V@VV„@°¯°xXx‚XV@nV°UVWU_VWXkmaVnWVkn@lln@lb@UVLXWlnX@˜aXUmaVK@UXU„U@WVI‚W„XXV‚U@¥VKœ@‚Uގ„„‚a²LlV@kV@UanKma@UVUnK@UVLXyVL‚knJ@UV@@UXKWUXaV@Vb@mVLnKW„m@aUUm@@UkK@Ula„LXKWaXI@alKlmUk@wVKXL@m@WWn@UVa@K@wna@aW_XWWkXbVW@k@U¯WWwka@UUaVIVƒkU@m±@U@@wVKkaš_@VV@XUVwU¥‚šyUkm@V±ÈUKk»ÇL„m˜mLk@ó£kmWwƒm@U„IkWKXwWU@ƒkLƒwkbmaƒbkK@VƒLkmWIUKkUUƒÇIǫJ™XÅJULVŽÇLUVƒ@UK™@kI@WVI@UaƒWmXVVUL`±kÅLmKkƒƒkƒÅ@Ua›XXxWVXŽVbUXll@bkJ„b›„@bkVUVlnV@X'], + 'encodeOffsets': [[ + 112906, + 30961 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4206', + 'properties': { + 'name': '襄樊市', + 'cp': [ + 111.9397, + 31.9263 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': [ + '@@@Xl@Xb°WlLXl„_@JlVVInwVbVK@ƒ@UnlVbk„mx@VUnl@U@nbW„XJ@VlL„UVJVLUxVb@b@VȄ‚@XV„VWbnX@`l„kx@nmVnbUVVVšzlJn„šlVb„UV@@V°L@VXLWxnLV`l@kxlXnK@nl@XlWn„`Xnl@@UVa@VÈKš£VLVanW°U@UVU„@„`VIn‚mV@„nV@Xa@aVW@UšalkXKšblI„yƍXnlJXbl@@VV@nklU@`„nVK„LVKVb@V„U@UÈK„UVKšIlUX@V`lIVbn@nblVVmV@@XXJšUVV@knKVn@`@X‚VnK„wlLVmUUU@ƒU@aXL@WlU@UUW@UmU@KkLWaXkWmXUWm@U@ƒnk@UmK@U@UaUVUUKV_@al@namWUI@KUƒK@aV@WUIƒbƒ¥ULUJkIm™ƒK@U@K™V@U@a@UkU@K@wVaUwlU@mUƒULmKUkV@@anIWmUK@I¯„mKkl@LUb±lUakLmk@WwUKÝVUIm`¯n@Uk@makJU_@ƒƒJma¯ImwUVkKƒb™aUÅ@wWaU@VU@mXIVmmUkJkwm@mIlUKWzUK@VmLUV@VnbmLVbU@@lkU±KbƒƒÝV›@UL@¦VWUƒWXUJ@XƒVWV@VULnbWV—bW@kmWXUK@Vkam@kkm@UlmXUŽnbWlUXV`UX¯VmUU@Ul@Lll@nnJ@LƒnWmbmš@b™`ƒš', + '@@kUUm@nllVKXXVKmU' + ], + 'encodeOffsets': [ + [ + 113423, + 32597 + ], + [ + 113794, + 32800 + ] + ] + } + }, + { + 'type': 'Feature', + 'id': '4211', + 'properties': { + 'name': '黄冈市', + 'cp': [ + 115.2686, + 30.6628 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VVUnWVXnVJ@„‚U@V@VXŽV@@IVJUnŽ@V@L@KlIVlVanLVbnVlI„ƒn@@a@Kl@@I„JlI@aXU@KlK„kVblJXU„VlU@V„bVkVKXn@VlxVa²I@VlVUxln@bšJXklaVWnLmÅ@y@k@ašI@W@aXIlVVaV@nnlKnLVW@IUa@a@K„UVVlI@wXKVV@IUƒla„@lUXwWƒnƒnalLlxXLll°@XwVKVaXIl™nb˜@nln@Va@U@k°ƒUmÆUVaXI„JV¯ÇUmmkU@WaKmakVm@U@aVKkkmKkVmIkÇ°£@aUUVaVVnKlkX‚mkƒ@ƒlUVaX@@Um@‚™UmlUXV„UVU@w‚K²¥Ua@I@UV™l@U™V±UIUÇ°»VkUmVI@a@U™m™ĉ™¯V±bŹĖğaÇL¯lmŽkX@‚óĀ@ŽmšÝêb±WkLƒn@xXx@Ž@b@V@LW@UbƒlţXƒ`kxWnXô¯¦ÆV@L@JVLƒxkK@V@bkz°l‚lXz@J„UlVla@XUV„bVKXnW`XXV@laVV@V„X@V¯xƒx@xULVbUJ@n@LU@VmmakbUK@b™IWWUUVkUmkLm@VJkb@nUJƒ@`V@kX™aUaVmmLkUmJ@Uk@U„±lkzmJUb@b„VUxVXU¤ƒL@JƒX@VlL@JkLUVU@mnUl„¦@V'], + 'encodeOffsets': [[ + 117181, + 32063 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4210', + 'properties': { + 'name': '荆州市', + 'cp': [ + 113.291, + 30.0092 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ÈJV„lVVLXJln„K@UlL„anbla„xlK@„XVWxXLlƒJ@V„nXxlnô¤l@nKn—‚ƒÈKl¼VL²Ç‚Un@Vl™zŽV¦UxWVU@@U™`lbUL@xV@²@@nlVU„UJVb@VlbXx°XVWX_VKUwVKVa@UVKUUVk@KnblaUU@wnWl@UX@lÆ@@a„IVmUk„™šxVJ„U„bܙ@Uk@WWnk@Vƒ„™Vm@I@m@Un@m™XUlVlUnJ@knJVU°@@aÆLX@ƒllL@¦nJV@XblLVa²U@UlWš@VX@`@LV@@bXJlIXml_lJœU°b„KÆLnVVl‚@ö—Vƒ‚mXaVIĢllUlVnLVlX@@b‚ašnnxšV„L‚bn@°ÆXmmkĉƒ¯w±™™™Uċ@KÝÅƧŃÝ癙Uw¯ƒm™¯k@W‚kV@¯UIUJW¼kb™Uƒwk@W`@¦Uônb@VƚlÈ@VU@ƒƒ£UWWnUÆUnmJkUÇ£VWUI@aUU@WkI@Uƒa@JW@k£kaWVUKmnkKƒb™kkVWb—VmUUmwU@kk›@UakUUa@V@nlx@lUb±lUbnnWLUyk@UamœUK™@mlk@Wb@VXL@x@xWI@a¯Ž¯V@bVn@LkKmL@`XmKmVU@@bkL@V±bk@Uaƒa™L™KUVƒIƒ„™W™XamVVbUK@b@Lm@UWkxULWVUnm@UlUX'], + 'encodeOffsets': [[ + 113918, + 30764 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4208', + 'properties': { + 'name': '荆门市', + 'cp': [ + 112.6758, + 30.9979 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@n@lxlInVUnWJ@nUVV@Xb@xVƚb„alLVUnx°Jnb„I@„V`lInbl@@V°mn_VJÞUVLXx‚@nllKVb²kVa@KlknL°ƒ@JVLXnmJ@bU@VlnLVKV„@nX@lUšKVaXal@VKn@¥°L@Unw˜bnašV@KV@VUX@lVXI@KW@@IXWV@laVL„„KlaXUVVnkVWV@lwXblIXWVkVmšaU£VaUmVIkU@y@WakKUamU@UUK@kmK@w@@mK@LƒV¯™U@WwkmULƒamVVUU@ƒƒIƒbUKUa™kmƒm@UakLmxU@UÒWlULţÿmwkIUm@a‚kÈblW@UVƒUUk@JW@XkWWUkUKUIlw@aUWknWUUmnIWƒ™aUwVaۚƒaƒVUI™wƒšVlUnƒJ@bÅ@@kVWk@mX@xVVkbma@LUlVVUL@VUbULVxULW`UX@V@lUXWaXlWXX`@bmb@x@LUb@VmŽXX@‚@nWKUL@xVlknkL@bWJXbWLƒKkb@VlL@Vn@VV@bƒnX‚mLUK@nUaU@WbXVWL@VU@@V'], + 'encodeOffsets': [[ + 114548, + 31984 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4212', + 'properties': { + 'name': '咸宁市', + 'cp': [ + 114.2578, + 29.6631 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ÞƂLČ@šV‚š²š°xĊ„nlWnŎ¯m@aƒK@„„°‚n„Jšwn™VIUaÆJšÅ@wšwV™XW@aV_l@²V°lĊwlaXLšwlUkalVVaX@lVXI@a˜UXJ@U°UU¥VIVKVklanLVa@VÈIVV@nk@aVa@mV_@a„K@klKUa@UnKWk@@lU@@UW@@nUWUwmaVIXƒ„lV@mLXblJ@kV@kk@KU@WƒkUWVÅwkLmW@UmL@lUL™KULƒak@maUUÝwUJƒIb›KUUƒ@š™aWK@kUWVkUwVw@™mÝ@™I@wkW@a›ww@LU¥™kƒJ@nVJƒIkVVnkV›UkyUIUl@xWUkaW@@°kz„ŽWxkLUWmzk@@bVVVš„b@‚@XlVœ@Vl@bVbUn™`Wn—@Wb„VVI@`„LVbXLV`mnU@@lƒL@LUŽƒak@ƒLk@WbUJn¦@lVb@xVb@n'], + 'encodeOffsets': [[ + 116303, + 30567 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4213', + 'properties': { + 'name': '随州市', + 'cp': [ + 113.4338, + 31.8768 + ], + 'childNum': 2 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„@nš`lw„k„ƒ„UmUVWX@lk„@VanUĠ¼V@@mX@@nVV‚VXLmJVLnK@b„V@@J„@VUn@VaVUUUVWVLV@@Kk_@almaVkUU@WVƒVUVLXmmk@wUaUKUV@°™@kmaUaÈmW„mUƒVklaX@lVnxl@@UnaUk@ƒVUVwVK„nš@VVn@VbVJUknUmmVmk_Vw„KUUm™Vak¥@UVKVIkW@UmIVWkIVƒkmmLkwmVUƒ@LƒUU@VVXL@JmLUbmK@UUKmkKUUmVUaUnÇlk¯™mJUnmLUaUJUaWL@UkJ™ƒUƒ@ƒaklkU@¯@KWLUmUUWVkbƒLƒŽUKkbU@WX@JX@@LWJkUW@UVU@@L™Umb—amx@V¯K@¦mŽULk@WbUb™LkVW@kVVxUb@x@LlV@V@b@VšU@L@V„LnšlJVIVK„¦„aVJ@XUŽ@b„LV‚@LVJnXmbk@@bU`VLUVV‚b@V@VnL@Vml@„@VXnWVXnWlXblK@LnV@VVX@VkV@XWK@b„VV@VV'], + 'encodeOffsets': [[ + 115830, + 33154 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4209', + 'properties': { + 'name': '孝感市', + 'cp': [ + 113.9502, + 31.1188 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VnXK@L@°lVlk„b„@„VšlI@VXKVbVIVbnKVmnI°šlŽÈkVmVbnUVVlLnVL@VnLVanK@IWKUUV@„V@KV„nUlxnKlnU„lJUXnJ@VlXUJUL@Vl¦UbnšVVƒLUxl`UnnnmVVlnVK„bšmVX@a°Ý°LšaXJV@VUnKVXVK@LnKlLUbVVX@VwVJVn„@@UU¥V@@UUK@ƒmaUVUkkJ@L@K@UmVUI@JU@W@U@UV@ƒUIWmXUVmUUÇ@UVmIlmnmakK@akaW@UwVUkKVnUlKVwk™ƒVU_WKUkVW@UXaWkUa@w@VU@XaW±@IkbƒKƒb¯L@WƒXkWƒ@UakL@UV@UmVUmL@UXWVL@ašUƒVUUUVU@yUUƒIUa@wUKWVU@kƒ™™Wk¯UkwVKƒLUx™K@nVxUlUUWVUmw@wƒUUyXWlX¦WbUV@„U‚@blbUVVbXXƒl@lVL@bk@lxkVVnVx™¦ƒ`UnkL@V@L@Ž‚@@xnL@lVL@VnVVblLXb@‚@zlVUJVnUbV¤™bUnUlWXkJWakxU@UXml'], + 'encodeOffsets': [[ + 116033, + 32091 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4201', + 'properties': { + 'name': '武汉市', + 'cp': [ + 114.3896, + 30.6628 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nbnm‚knJVUÈ@@Uƒ¥VknmV@VUlK@IkK@U„W@I„KV£UWVwƒU@aVanIly²kVƒl@@VnIlVnKUnVbšblWU@@_„‚VI@mlaUIn@lKVnUlVVXXšJ@aVLlanbUnV@@K@mVIUaVK@w„w°w@UƒW@UUUkbU@WWX_WmULƒaVU@WkbkUƒV@IWyk¯kly@a@UlL„wUK@I@KÅUW@ѱUm@wl¥kaƒ@@_Vw@ķƒa@akw@ƒkKW£XVUVwVwUaU@VUU™™xWKkbĉx¯k±Uk@U`@bWXUš™x@x™ÆÅIVbUJmš™xƒImƒ¯@ƒ™Umx™nUVVbnJV„@Lƒ@@ŽkV@bVnƒ@UVULlx°VXlššl„V@XUVL@xVb„JVV@zUVVVUV„™V@bUKWX@VnKUVVnU@@VlKVb„@lX„W@X°K„a„Lla@JX²Wb@ŽUV@@xVbXlWb@VUXVlXLV`Uš„lŽUxkLmVUŽlLUVVxX@lb@blL'], + 'encodeOffsets': [[ + 117000, + 32097 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4202', + 'properties': { + 'name': '黄石市', + 'cp': [ + 115.0159, + 29.9213 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VšUVV@VbUx„aWUœblUVmnKlX@bXJVIlVUxVVVIU‚zlx¯š@‚VbnL@x‚x@UVaXK„b˜@Xk‚WU_Vm²klW„XVK„Žl@nXV@@w„mlK²X‚aÞén™@ôÿ@lWn°kUKmmUљUmm@ƒwkImWU@UakL@bVLUVċ@™bUK@alIXKWK@™nXnKmkUVwƒ@¯b@L„lUL±W™n@KULUaW@kL@lƒL@bU`@nUb@bmlU@UÇJ@UUbmKkblŽUULUJV¦¯V@VWI—V@bWJkUW@UbkUlbkV'], + 'encodeOffsets': [[ + 117282, + 30685 + ]] + } + }, + { + 'type': 'Feature', + 'id': '429021', + 'properties': { + 'name': '神农架林区', + 'cp': [ + 110.4565, + 31.5802 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@n`lIXll@lœl@b°aVklKXaVn@bU`mX@V„V@nmJn¼„V@bÞ@lL@„lJXVlL„aVLV„nVnalV„@VLÈUlblWXIšKVU@J„™š_‚@an™na‚X„m@KmI@mkk@KVkWWw¯w¯°ƒ@UUU@WƒaÅWkL@ƒ¥@kWWXkWmIUVVbm@@bUbmUU„ƒbW@UVk@mVkU@U¯ƒmKVUkaW@aULƒÆVbƒb@VÅ@Un@VƒLWl¯Lš„'], + 'encodeOffsets': [[ + 112624, + 32266 + ]] + } + }, + { + 'type': 'Feature', + 'id': '429006', + 'properties': { + 'name': '天门市', + 'cp': [ + 113.0273, + 30.6409 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@K@UlKVm„_š¥UwUmlUkwl@@aUK@k„kWWUaVUka@aV@ƒVUXaW¥Xk@WWIklm@ÅxmI™VÝUkxkaƒ„@bWJaUL@„W@™l¯UULU‚ƒbƒkV™Ua¯bm¤UnÇUkmUšUx˜b@VkXÇal@bVnlJnxŤĀVKXkVÑV@nwlKVbn@n„šlVbVL„a„J@„VV‚UnU„bVKlnXxV@°š„U@KnL'], + 'encodeOffsets': [[ + 116056, + 31636 + ]] + } + }, + { + 'type': 'Feature', + 'id': '429004', + 'properties': { + 'name': '仙桃市', + 'cp': [ + 113.3789, + 30.3003 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VK°VškX@@ƒVK‚bXI@a„ƒlblwÞVšUnJÆwn@lkXJ@X‚WVz„V@xnx‚VXUVVVkUw@mšLVw„KVU„@Um@alU@„@@KUƒmIUaVUšmnwmw™mb@aW@UkmKkUkVġkUJWbnU„õ˜@UkmUÅKƒL¯a›VkIk`WnkJƒ@xVLUVVbUbk@WlXbm„VxnxUblbUV™@@VUV@nVL'], + 'encodeOffsets': [[ + 115662, + 31259 + ]] + } + }, + { + 'type': 'Feature', + 'id': '429005', + 'properties': { + 'name': '潜江市', + 'cp': [ + 112.7637, + 30.3607 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@UbVxšbX„mJVnXVlmVX@bkxVJVLVlXXWlX@@IVl„V‚U—aVwV™lnÈVVmn£°aVbUš„l„aVUK@mVU@Uš@VUkaVamwUwnƒWaXkl@VaUaVUUK@w„WI@aU@@K@_UW™@kX@V±VUbkKWaU@mI@¥kK„kW@ÅK@b¯@UVmI@lmIkVkUWVnšm@@V@n@JUnƒšU„@ŽmlXXl@@V'], + 'encodeOffsets': [[ + 115234, + 31118 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4207', + 'properties': { + 'name': '鄂州市', + 'cp': [ + 114.7302, + 30.4102 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@°¥WóXmlw„_ŤW„kVaX@@K@U@a@WwU@mWk@ƒULƒWkX±lUnV`XWl—@ƒaWLUb@Vw@wmKUa@°™kw‚yVUJUUVwkUUJWI@akWmLUnkV›aXVƒbUxUVWX¤lL@„lx@b„b@ĸUx@`„@lbk¦@x‚n²VƄX@'], + 'encodeOffsets': [[ + 117541, + 31349 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/hu_nan_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '4312', + 'properties': { + 'name': '怀化市', + 'cp': [ + 109.9512, + 27.4438 + ], + 'childNum': 12 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': [ + '@@@n„‚@b@XnJ@k°x@aVUnl‚UXnV@@VnJWUJV„nIVV°ŽUbVVVL@Ž²LUVa°V@aV@nm‚UXblLXWVXVmVLVK@an_„`@X@l°„VlXXW`nX@Jmn@b„@nV@Lm`„bUb‚n@VUVl@nIVbUlƒV@LkJUnVV@xVblVUbU@ƒzUKU@mx@xUnn@@WV@lbUb@šnVWXX‚V@VIV@VUnJ@VUz@JWbXllI@VXVVL@ŽVn@„„Wlb@„Žl„XVlL„aV@VJ@XX`„kVwVl@bk„‚bUŽlVXIlƒnLVa„mVwV@@nV@XaVJVbX@lwV@n„@nV@VWnIVVUŽÆ@Xx‚a@I„UUKmk@mVƒ„IXmWUš™VJnUVU@anaVwk™›U@UXa@W™@m_@a¯@@K@UVƒ„bnK@blIlbXa@WW_n@VƒU@¯bmyƒUkUJÇÅ@WU@kWKÅwƒnm°KVkmankVWnXVWV@UƒƒwXkV@mƒ„UlLnaƒVaX@VUn@VnVK@xlnXWšU@a™@@klak™Vw™mUaV@™wmIÛ`m—@mVUXmlIXƒV‚I@K@aU@UaV_UK@wkUmmUKWXŽmVkUƒL@mƒƒU_nK‚™@aVU@Ukak»@U™™@ymUƒ„¯™ƒUUƒVKkam@™nka@ƒmwkLWb¯mkaƒ_VaVKUƒ™IUw@kKmU@WK@UnƒmaULkU@wUalWV¹U@@WUI@WU@‚_@W@U@mƒU@WbbUK@Um@@UmbUwWWkk@WU„a@anUUwlWUwUU@wlJVUnnV@@mnI@m‚K@U@w„a@wUm@_mƒVUUaVUkƒƒƒ_kċUk™VWLƒ@mlU@kn¥W@UwUWV@VÝU@lXLWVUbVLXlVIl‚knmU@VUJk@@„ƒ@™kVmwmVkxU@@XmVUb@xnKVLl@VxUxkIU`@bWVXX@JWL@bkb„¤@bmUUU¯Kƒkmb@V™VU„VVn@@„Vb@`lnœxmb„lUn‚bk„@xU„mV@bmWbUV@VJ„Il@nVUb‚K@nn@VbnJVIlJVkXJ@X@lmx@bnnWVXJWXU@UlU@mk@@llb°x„IUbnJ@VWbXVmI@JVX@bk‚@bWL@JUXUK@U@Uƒ`n@@Xm@XVW@@nX@@`ƒImxU@@JUI@KƒLmK@UÅUUV@VW@™¯kUU@UamVUUmJ@n„xmLKƒkmJkwkKm_mKXU@aƒU@b@Wk@ma@zUJVUmbUlU@™xnXlWlXXblK„¤V@@nUVVLkVš„l@Xb@VVK‚nXKVx@znW@X‚@@lVK@X@JXbWbnn@JUamLVVXIVxnK@aWUX@˜x@VnI@WlI@anV„IVxk‚l@lbXXšxVVVJVInbV@@ln¦ml@XXVWbkJWb', + '@@XLVKVXVKUa@UUUmV@l' + ], + 'encodeOffsets': [ + [ + 112050, + 28384 + ], + [ + 112174, + 27394 + ] + ] + } + }, + { + 'type': 'Feature', + 'id': '4311', + 'properties': { + 'name': '永州市', + 'cp': [ + 111.709, + 25.752 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lxUXV‚lXUVnlVĢ„JVbUXVJV@XUW¯„VIUK@klW@Un@„nl@V`XUVL@l@šVx@„XXW`UnUbšxUlVnUšV„lb@VnJšUVVVInJlUšVnwVklKnw„LVJVšV@nIV@nbVa@KVVVUUa„KV_nVVJ@_VW„nV@n¥lI@anƒl¥X_VKlwVlULUVVVš@šU@VXL˜ƒ@IUmn@VU@wmKXUWU@m²šl@VIXWWkWUkWlkIVamUXamUnmWUU@@Un™lK@XJl@kVUk@mWKXkl@@aVU@UVWUUVa„In`VUVLnw@U@K@Uƒƒ@w@UVmUUƒ™°K@UnV@bV@Xk@KVm@amk„aU£VWUUmUUwm`UbULka›KXU@kVmU™@aV_UWVIn@˜y„XXK@klmV„V_kWVUn@WUU@UƒmaU@™wnwWanUmmXkƒam@UakLmK@b™xUUUU@Km¥Vaƒ¯@ƒkUaVUlm„UU@mUUÇmUk™Uyƒb™bUa™XUWWbÅLmL@V™aL@WWXUKmmk@a@UUK™XW¥kU@VƒUkxmVkUWbUJnVJ@nVJXzWxkŽ@lVbUX@VVL@`mbUnšŽUn™VV¼k@Ulm@mwLƒb@lmLUK@UamƒWkƒK@£Ua@ƒ›UkJkUmbVlkX@bWbUŽVŽnnUVl„@bšbVK@VX@lb„V@nU¤šx‚²„Knblb@x„V„ô@šlŽ@b@l@XWxnVl@„VV@XLVl‚LUŽUXV`šbXXmJU@@bm@UUkLW@UlUKWUUb™wUm™L@nklVVmVXXm@@bUKlÆn„‚XkllVUVVL@nUbV‚@V@nnV@xUn¯U@JW@UX@xĉ@™`m@@LV@b'], + 'encodeOffsets': [[ + 113671, + 26989 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4305', + 'properties': { + 'name': '邵阳市', + 'cp': [ + 110.9619, + 26.8121 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@XIlJšI„VVK@n@VVVKnLVwVmnLVK@U„@šw„J@wVIƚ°X@ÜȄUÈxll@kn@VwVaXJWXn@@WVL@UUKVKV_U@@aVK„x@U„aV@lk„@XylbUaV_šVnal@W„U@a„I@aV@@aVUl@Xm‚UXWaXml@@kk@ma@V_UnUV™UUWJUa@kkaWLUmk@@LUVWUkJWkK@¼UnWJƒIkV@b@JUIm@Ul™V™m@Uw@a@kWƒXWKUknW@ƒWUU@k™mx™UkVmIUJUU™VmI@UkaUƒV™UmVk™wVaVmX_WW@ƒUw@™@kUKWVU_k@ƒmm@@VkX@lVLUJƒX°WVU@UIVWUaƒIUġmkVUkWUVWkwWXk`mI@¥kUVƒUƒUn±@m›XkWknV„UVmmU@@XƒVƒUk`@Xƒƒƒk@¥¯»mbĉó@mkU@kU™ƒƒ™KmX@˜UnmL@lULkKUƒWUU@ƒbUaUnƒ@Vb@l„¦Ub@l™@UKmnƒKUnl„UVVbUVn„@`Vn@xƒb@x@VL@nmJ@nU@mmUVkI@xVVVxkXVxmV@bƒbXVl@Xl‚XVxna@Vn@@VVL‚aXaV@n„‚@@V@X`V@@XVJ@XV@UºkXVb@xlVVKnbm„@VXLV@n‚lL@VxšJV„ULUb„`lb°nXalKnx@„lbšmn@lbULV„„V°š„ƒnV@zšš@Vl¼lb@VUV@bšmLV`„„@n„KlVnU‚XWVLnnlV@xVLU`VbV@'], + 'encodeOffsets': [[ + 113535, + 28322 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4310', + 'properties': { + 'name': '郴州市', + 'cp': [ + 113.2361, + 25.8673 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@²zVaVlnVl@nšVk„Jl_XJlIVmnL@mV@VXn@lV@‚XzV@lyV¯²U@UlJ@XVKnVVIXl@UVLV`@n@J„I@mlI„KVLnUlVUVVLXašKVLl@nb@ŽW„XV°KUnVV„L@xVJ„L@b@LUVVVU„˜VXbmbVbn@@lUbm@x@XVVVŽ@@˜@bkImx@Vm@Xbƒb@l°XU¤„a‚L„mnL@bl@@™VUX@VxnV˜anLnƒWƒ¥XKVwnUWXmVIUWÆLVx„L„w@wVmlU@¥XƒWUkwlÇn_Uw„WV@VU°wnU—ƒy@aVškVlnL@lVn„w@VlJ@b„X„x@bVKnb@U@WVUl@@Vnbl@XLlK@aVLVKnxÞn@a„LlmUaVU™ƒm@ÅknUmaUKmVk@m™kk@UlWUkVm@w@kUU@W™U¯™¥@w„Ç@aVIlUV@kUWU@UUm»@k@mKVkUKUwƒaUaUa›@k„kUWJkImaU@UK™@maUzk`@zƒy@XmJkL@UUJmUkV@z›@kŽkVmK@¦UbWL@a@UbmKmwUK™Xk›VUUkmVkw@UUKmL@WUIWa—JW_k@@WmI@mk@WkWULUUVKUUVm@šU„bš@‚nUǃ@U@w„™V@Ua@aƒL@ak„›l@k™UƒJƒwó@@L@V@„™`@œƒJ@xnn™šmV@bkJmUó@ƒn—JW„UUmƒU@UV@Lk„WlnnmVXbmxšxV@nbV„V@XVm@UVlXU`ƒUŽkn@lWLƒW—zm@UJVXU`@bVšUn@lWVœLlbVKVan_VxnVVVUXV¤ƒbnl@bUn@LWlU@@amU@V¯L„šVVUn@V@x„„@V@L@VmxUKUVm_ƒJUbVV'], + 'encodeOffsets': [[ + 114930, + 26747 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4307', + 'properties': { + 'name': '常德市', + 'cp': [ + 111.4014, + 29.2676 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@l™U™mkUwUyV™@VW@¯Va—VmUU@KVUVUVLnaWƒnkUÓV_@mVU@݄w@ƒka@kVmƒUmK@IkaUamKkXWaUW@WUk„™@@KVU@aU@™L@J@XÇVUKVak_mWkLWakVUbmLUUmlUVKUU@kUWW@UImJ@xkLkKm@@Xƒ@ó݃@UUk@UKƒV™ƒULƒKƒXkWWbkaƒIUƒWU@mUk@WLaUJġ™ƒ@@XÈÆVIl‚„Vnz°aV@U„m@X`@XWbkakJ@amLƒaU„@V@L°@@bn`š@@XWb@VœVlšUxmb@bUVmVUI™šXVWnƒJU„@nnlVLƒV@JbWzk`m@UVK²V‚x„k„LVl„@Vn@V„„°xVKVkœVVlUblx@bU„‚Æœ@@nVnUll„kx@VW@@VkLWxUL@bÝ@kKkVõV@bkXVVUVƒ@ƒVkUkV›LkV™a™@@™ƒ¯xUxmX@JVb°WXkK@Vm@k„Vb™bn¤‚xUXkJƒblxnXÆK²l‚_@Wnašn@ŽUL@b‚JnIlV„@lUœ@@¯ô@lWȂIVKVm„U@aXaV@lwVXn@@K@UVKUUnU‚bn@lWšX„ƒlJnUšLšKV@„„l@²a@UlK@aV@naVX„WV_nKlL@KUm@a°U°@VXL@a@wWmXal@„k„@VLn›V@@bl@VnX@mwVa²aVU@mk@'], + 'encodeOffsets': [[ + 114976, + 30201 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4331', + 'properties': { + 'name': '湘西土家族苗族自治州', + 'cp': [ + 109.7864, + 28.6743 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@KšL@wnK±nƒnm‚—@WUk„ƒÜÈn@n»@mVamk„mšU„„l@V™nmmU@wUan¯VKšLn„VWlInyWUœI@WWk@KXU˜n@mnUmU@WœƒmkV@ƒkXašaVaUm‚Ikƒƒ@kaƒX@ƒUm@UKWU@UkJWkXa@IVy@UmIUVU@UJU@WXWmU@™VakaU@@Xm@Vm@wnwV@VL„yV@VakUUa@wUUVmlI@K„UVkUamJk@VU@UmVaƒan_@KmUƒ@@anm@ImWX_WWUk¯ƒ@k@Wƒ_m`@bULUKUnUWWXkKWaVmnU@@b¯UUbVŽ±K@UKUUVa¯UUmJUƒVIXmI@UU@WmVmkUV@b¯w@lmI@W@aƒ@m¯LXbmJVLklWL@V@XXŽmbVVU@@VU²Ul@VlX@bš`Xx›zUmkUVÒlŽ@bXLWxXVlš@V„bkLma@nmVmULVbmVUb@lnzmbUÒVl@°nLV„lJkn@bmJk_ƒVmmkblxÈx@LUb„xVb@V™n@JmLVŽUš@„nV@¦VbnJ@lVVbkx™bm@UxVLV@n`UnVVV„kl°z„xVb@VU@@ÆlXnWm¦nbVK@XVVUVVl@X„KUV@nVL@WnIWŽXLVKVLlxUbVKXVWbn@@UnKVLVb„JšU@aVU°b'], + 'encodeOffsets': [[ + 112354, + 30325 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4304', + 'properties': { + 'name': '衡阳市', + 'cp': [ + 112.4121, + 26.7902 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lšV@XV@„mXVlXL„W‚X@l@bVxn@šŽšUVkn@VJ@I@alU„JXIVm@»‚LXllIXVVU@Kl@VnXKlb@lVbXIVVUšmVVU`@nbl@@lXLVVVKVbnXWJ@VXbWxXb„Ul™VK„¦nLVVUVVbšb„K@U˜LnK@Un@VxlUV`UnnL@VVL@JV@VUnxnKVbV@@VšIVUnJUVUl@nW„XllIUa„KVbÞLV¼²`V@VIUwlaVmXa@IWanK@U@m„kVƒVUVaX@lšnaVLÈ@‚¥@kkJUWJUaƒXkaUm‚wVXJ@_lWUU@¥n_‚KkamUK„™@amKƒnKƒbV£¯W@k„aWan@@UnwlJ@a@—@UUU@W‚wn@Va@km@UanaWa—UVƒUUVU@K@aƒKUI@wƒKUUVm¯LWUXƒ@mak@UK™LWbUKVUkUmVUKƒLkJ@nƒJ@I@mU_UK@VWkUJmUUL@WkI@V±VU°kzU@Wy@kUm@UWU@@nmKUnkJWIk`ƒIUlm™k@mUUkUb±yUX@VUV@bk@WlXL@nVlUl‚k@WI@ŽkLmš@VV@XVmnnVWbnVUblJXkVl‚XXlWXUJk@±™@nXVWVnL@xUVm@Vn@J—„WK@U™V™@UUVUVKUkkxULW`k¦m„@bkJm¦U@ƒmUX@`UImUU`ƒLVbUVUU@LUbmaU@mJU@U™UIƒKmxkLUl'], + 'encodeOffsets': [[ + 114222, + 27484 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4306', + 'properties': { + 'name': '岳阳市', + 'cp': [ + 113.2361, + 29.1357 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@wUklmUUmU@@UVm@wUaV_mmUKmwkIkJmUUnm@™™@UUƒbUKUƒmÛamm¯xVLkbÇƃUƒVUzkVUlƒUUKWLX¦W@ƒVUUUaƒKUbmLKm„@akU@aƒmVaUUVIVWkk@wkƒƒ@@xmLlmÅwmbVlXlÝIWVkK@kkVƒL@VWKU@Ublnaƒƒm@b@bšnW`@XUJk@UUWKƒk@UKƒnn‚@xmLUVm@kbVbV„nV@V„b‚@KnV„LWšXŽÆVĢ¦VblŽš„n„UJWz@ƙVóUVbkV™aÅx@¦lVUbVVknWKƒ„k@ƒwƒK™VU„Å„ƒl@zkb@`m_mJ@xX„mbVbœ@llV@n„@llbXL˜UXalUšl„alVnwnLVKlšVbX@@I„V@blJ@bVL@VVVUXȤ‚VnkVÑXmlbnš‚„VKkÑř@UmaVç@±XUlI„xlV„@VaX¯lUVVUšVJn—V@°°nŽ°„Vxĸł°¦šb²¦lJ@U@aUK@kUm@_m±VIXal@„Kl@„bV@K„K@k„m@UmUUaƒK@_UJƒaXU˜@Xmš_VmUk@WUk›@kU@a@m@UƒaUUU@al@ny‚XXWWwkly@¯n@@bnV@k@mVI‚„œVlUUmlU„JUw„I‚bXƒVaUal@K„b@ƒVKVkXVl@VkUU@ylUœVVaVL'], + 'encodeOffsets': [[ + 116888, + 29526 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4309', + 'properties': { + 'name': '益阳市', + 'cp': [ + 111.731, + 28.3832 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„ŽÆxXL@l‚V„@ĢšVI‚bXKl@nVV@„XVŽ„JlbXalX„W„LVKš„„UVLl@VV„@ôބ@@Wn@lLlK@wnIVJX@VX@lVVUL‚VnkVVnKValUXblKnXl`UbVLÈU@W@IšKV@@bUV@Lš@lƒXV‚@VXXblWnLVblb@JnL„VUn@llb@„ƒx@ÞUV@nU`VÔmlX„mbUKUVUV@LVVUn˜ŽUb@°UXš@U‚VzVxnlVškšVnlVnaWƒ@wnIn`@_la@y„kƃVƒšU„L„xl@„ƒXLlmUUVakU@¥ÆwšblUUaôVšU@ÅXyVImƒ™ƒkUaġ¥ÅUWX™ƒKmU@Lƒa@UmUUƒUalan@VUnK@wm„m‚L@V„lXLVVl@VI@WX_™m@a™¯mKUkwW¥UK@_UWWLUVkUWL@WUIkVƒU@JƒwkLUUmJVI@WkXm@VmkKUIU@mmm_@VUV™@™„kJċwUU@KUWkkW@IWW@km@klwkWVkkU™V¯m@kWLU`mIkmkXm@@`@L@xUKWkU@VL@JUU@mbUKVa¯WVnL@`lXUVkU@xW@UbUWVU@UJ@„lnU@m‚nÈmVƒa@bUL™wUb™@@VkxmUUƒ™UV›K@IƒUƒmk@akm@wmIƒŽkK@b™VWXkm@wULUmm@UVW@Ub„mbkKƒVn„U@Wl„xV„U@UXmWUXmlnbUl¯Lmn'], + 'encodeOffsets': [[ + 113378, + 28981 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4301', + 'properties': { + 'name': '长沙市', + 'cp': [ + 113.0823, + 28.2568 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lVUllXkx@lln@‚XX@JlXXl‚V@LVVČxlIšƒš@VU@Un`nnV@VJlLUnn@lW@XUJnIVVlK„x@I„VlUVJ@XXKlVVUXKVX@`VLX¦lxVŽnLš°‚an@„„‚bkmVaV@XL@U„KlU@llLXUÞJWkUknaÆxnŽ‚knK@w„@l„@xllUXUJVVUb„n@blV@bnƒ‚LnKVa„LVbVV„UX@W¥XKVL„VVklUVy„U„VÈÅlaUK°wnnÜbn‚V„VL„aVVš@šn@VmnVlIlJna„@Valkn@na@amwm@„UXw˜K@aUUVUUaVa—wWK@kU@UaW@kKUUƒƒ@k™W¯XWan@k„™mmÅ@@I@U@KmLkaVUƒKkLWVUƒk@UVmU@am@kkk¥ƒUƒVUK™„maUb@ŽUb™I@aƒKkkWm@W¯K¯b@VmaULVxUXlVk@UxVJVbUb@xULƒ@ULWW—LƒĕmxVVL@šVb™KUwƒaŲWwX@@WƒUWLU@VbkV@aU@@VUnmJ@VUn@VƒLUK@U‚mUIk@UÇmU@@UW@J@LƒbUmVI@aUmW@@bkXUx@lmLUbm@UbkJ@V@XmlUbkKm@ma@kUaVU@aUK@mImJUIkVƒUƒVUakbWwka@UWKkLUamKUXm`Å_U˜ƒULmaU@@lUV@X'], + 'encodeOffsets': [[ + 114582, + 28694 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4302', + 'properties': { + 'name': '株洲市', + 'cp': [ + 113.5327, + 27.0319 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@X‚‚Unw„Ė˜KXXVK„@VK@wVaUaUIVwl@kUVWUwVKnb@U°a°LXŽ‚@Xnll„L@bšJVa@VanbšƒVL„U„V@al@@UV¯ÅÇ@Ummk™w@¯ƒyVwnUVVVUkmWV—nKVUƒa@WXkVKn@lUVU„VVVXIlV°VnI@VlKnV@mwVm@LXKWkU¥wWwƒƒ@k@m„X@KX¯V@VUVa@VnKWkœƒV@VUkm@aWa@wkUWwkmV£VÿXUVL@mVIXaò@nW@ašUš@@am™@aUU„UmXmWUk@ƒƒnUW@_maVm™wUkamaUL@aƒwƒW@akI@UƒxUm@kmKUk™lUŽ@b„zV˜m¯xUVU@ƒXVxm`kÈlxXVW„@¦kVUn@xƒxƒKUwÅKVXUJWnXŽmVUxWL„¦XŽm„mK—bmUUwW@UV@šk@ƒšVLnŽlbLm`@¦VVkX@`WIUŽxVnlb„WVbXIV‚lI@l¦Ç@UKmbk™W@UbUVU„ƒl@n@VmLXb@JWbUnkbVxUJUxWXXlWL@V@V@XXJWx„zUVVVVKnXW`@bkIUl‚„nLVJUbUIWVXlWV@XklVbnn@xlš'], + 'encodeOffsets': [[ + 115774, + 28587 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4308', + 'properties': { + 'name': '张家界市', + 'cp': [ + 110.5115, + 29.328 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@InWVw°wš„@š@šblUœKlUlV„U„@VUUUlW@aöUlUlLÞ@@aVKXwlK@UX@@UlwkƒVkUm@m›@ÅVƒ@akwVaUk›UUlUL¯wƒƒ@UUmƒ@UkƒKƒlw±UULVn@l_XyWwÅ@VUUmJUXU@@mmƒU@kxW@UaUIWbU@@mU@UxƒnUbmKk„WJkUValƒ@aUkUxƒlW_@WUIU@ƒbkKWUJVnUb™bWb„lU@nl›„@XnVmV@n—mWV@LXl@X›JXVmzkJUXmƒ™KULm°Vb@xnVmnUšk@ƒƒ™VƒnnlUb@nm¼m@Ûǃ„Vl@X˜mnm„²ŽmL@x™K@LUl@nULÆx@V@VXVWbXX˜l„@nLlm@bVKœX‚W„L°bnUš@VaVUš@šmšVw„JnwVK°zn@V‚Vb„a„@Ċ¼'], + 'encodeOffsets': [[ + 113288, + 30471 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4313', + 'properties': { + 'name': '娄底市', + 'cp': [ + 111.6431, + 27.7185 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lL„nJ@xln@bnlV„‚„@JœLVUšŽV„nVlw@Uš@VašxVK@a„bnUmÇnV@km@ƒ‚I@VUVVXVaX@@wlVVUkW@_mKXU°‚UbVLnaV@‚V@IUKV@XlVL@w@K@_n@lWlnnJV_XK@l°nšU@WVU@kV@nbVK„V—lƒ@nLlƒ„LXU@ƒlmkw@nW@UKVa¯IVn@@aVUUKl@nXVKVn²a˜ŽXblKnLlmVI@KUU@akLUaVa‚UXm@aƒ@wVUVKnLnWlXl‚n@@U@anUVm@U‚Inm@IUK@UmKVmU_kVUwm@@VmL—K@VƒL™aUaVUUUmKƒ¥ULkšƒVWaXwWa@UXImWUaULUUWKk@WnXbWŽVWnk@UV@bU@@bƒJ@bƒV@XkŽmb™UU`VbkaWzƒ@klU@ƒb@VƒwUL@bV@U`ULVL@VUK@Xm@XWWIUbUxm@@lkkÇwƒVÛÇW@¯Å™UJ@xƒI™xƒ@@VULmKUnUxmKULUUm@@‚ULƒU™JkIWJ@b@LJUW„kJWnUV@nn˜Ü_nJšxU@VbšnUxlškb@lš@'], + 'encodeOffsets': [[ + 113682, + 28699 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4303', + 'properties': { + 'name': '湘潭市', + 'cp': [ + 112.5439, + 27.7075 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Æ`n_VWnLVblKXL@VlbXxlaVb„U„VlUVJnInJ‚@VL@bUVVb@lnbn@lLVank@W@UlIVan@VanK@kVwlW@aX@Vn@bUJVn„a@K‚IX@@VV@nŽVÈl@VJn@VVL„K@UVm@UnIVm@UV@@blUUaV@XK„V@XW@XxƱ„bVxšLUa@™UKWk™@wmmUalk@WXUWkXUVJVaUImKƒVklJ@aX_mWULUUVUƒyXwWI@W@U@UXKWkXWVwU@±_U»ÝKUaƒLVbkJkƒWmXk@UVVŽmIUV™J@UU@UamLmwUVU@mnJ@VUnmV@b@Vm@kkWmXmKULUV@x„Ž@bWnVUbVblK@bVV@LUJknmKkLWa—±bUmULmWk@VLUV@bm@U°JUbVLX@@mlxkn@„WVƒKk„mK@k„'], + 'encodeOffsets': [[ + 114683, + 28576 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/jiang_su_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '3209', + 'properties': { + 'name': '盐城市', + 'cp': [ + 120.2234, + 33.5577 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„n@‚°ĀÞ°@¦ULWKkx@bkLWb@lUlVXXJVbƒnUKmxXV@bm@@Xš‚„LޚܦXlVnš‚mzVJ@n@‚²ÞôkƃÞaȰĉ‚wnljÜó„éVÛnĊīČlj‚ĉ@ō@KÞUlU@ƒkklÇÈњÑlġXɛ@UġƒƒaU@U_ƒW@n™@kaUL@VW@kKmkUV@bkbWW@bkzma@ƒJWI@KUKULƒ@U¦™`@XUJ™U@KmXƒw¯KXkmy@aUIWJXXmV@K¯UU@@bVL@¤VLXbV@@JVXVK@„„JVn@bkKmakVVXUVVVlI@`U@nzVVƒb@¤n@@UlKXLVVšI@V@nV@V‚@ÈUx@šóVōšƒkÅWó@mU@bk@Ýwk@WbXxm@@J@zV@kVƒbV‚nLWVUX™WUXUŽWLUŽ@Wl°z@VkxU@UVWIxWJkbƒĬ„nW@@bUl'], + 'encodeOffsets': [[ + 122344, + 34504 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3203', + 'properties': { + 'name': '徐州市', + 'cp': [ + 117.5208, + 34.3268 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@XKVX@WnIVx@K°Lnll@@I°K„nVašU°x²mlxš@VanU@aƒk@akmV@@w™@Ua@aUwVwUw@w›@UK@£kaĉlóIÇVkŽ±@@kUKmVkIkxW@Ua¯UUm@UVI@WVI„JV@ƒ@Um@Uana„U@m‚I@J@XV@XaVlkXƒVaUUWLUyVIXmWak@ƒXkJókƒJUL@KWkk@ULU@Wa™lUIkJmI™mk„VbVš@lV°kXUKWKULU„mb@VUlVnƒb@VV@IVKUUmU@ak@@bmV@xklƒUƒU@UKmV@nƒJVbkXƒKUamLUJ¯UUVmI™bVV—Ll`@LƒLU`m@kXUVU@V„lxUK@xkIWbUKƒx@V‚kVVn™b¯@@U™@ƒxk‚mbkLÇK™b™@@XnJ@LmVklƒ@@XƒlUƒVkxƒakVVb@bVnUbU@@x˜VUšVb@š„ŽnIĊ`šXVVôJš_„K@xlU²Klk„U„@VaVVÈm@kVUVmnamUUaVƒXIVJ„@‚ç@¥nkVLn›„@@XVK@VUX@JVUV@UnVJVLUJVLUVlšnI„b‚KnU@m°™VanI@anV‚KVL„an„lK„blš„KÞk@¦@¤@„VKnLVK„L„KVzlWšLX@VmV@VbnU°@Ualk™˜WXLVU„KWkUUWšƒ@£Wa'], + 'encodeOffsets': [[ + 121005, + 35213 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3206', + 'properties': { + 'name': '南通市', + 'cp': [ + 121.1023, + 32.1625 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VJ@bnzWl°L„xnW@LšVVI@Wš_V¥„@VKVL@LXJ„I‚@nbly@aXXla@aVUnllLX@@UVKlbš@@m„XV`V@„bĢ„lkČÇƃȘ¯šwnĕVĉVÿšUƒUĠƒŦğlXÑVǵ@±ōLʵĖ¯lÇbÝÞ¯xk@Çkķé™n¯@ğŽġƴǫ@kVVlUbƒL@xULǂóLUl¤@nkVV°VLkxVb@l™aUXUKWĖklVX@¤UšƒUkb'], + 'encodeOffsets': [[ + 123087, + 33385 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3208', + 'properties': { + 'name': '淮安市', + 'cp': [ + 118.927, + 33.4039 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@šnźUôÒɴ胚l¦nĖV‚kbmš„X@xVlVL@xUb@bUJVnUx‚šœ„lKVLÈx‚m„zXV@lW@XV‚b@bȚVxnb‚ƒVIXa°L„aÆVVaXUlK@aXIƄVlXKVUlIXalK@alwXLVK@¥Ý¯¯ÿ@ƒmVk@aX@ƒm„īlaXI‚wXJVUV@lw@U¯yb›UaƒUġUÅaUKVknaġm@kUm@wÆIV±nLÆw„ÇnUUkƒ@ƅÝU¯JÝI¯¦Ul@bƒ@@VVL@l@LƒLÅmƒL@b™@UaVaUWmLUKV¹KƒLWKX¥WI@mXk@UmaUVUU@VmL@W™bkIUWƒUmVóIkbmm™@UbVLUxmJkU@bkJWbnXU`Wz™KUÞÈlVb™Lmx@„kè@Æ'], + 'encodeOffsets': [[ + 121062, + 33975 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3205', + 'properties': { + 'name': '苏州市', + 'cp': [ + 120.6519, + 31.3989 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ôèĊVnX°¤²„lxƒÈÜ@²x@J@b@X‚`nIUƙUUV@bl@VVnL@L@xƒJ@X@blJXnW@@`XbW„kVƒ@UbVxƒXUxkV@LóxVbUVWš²šVJĸklUǬ@ĢƳĠ°@šmƒī°»ÈÇ¥ULUU±a@bU@¯ƒU@KnImUVWUk™mXUVU@lIVaUUVWKUbUkWKU¥n£WakJUkUL›K¯L™KkƒVIn@VaUƒVUUƒ›UkVk@ƒU@amUkJƒ@UUlwX¥W@@UkVmk@JUakL›@kk¯ÝmJUn@nmVXlmbVVkn@„UJ@±WUxV¯a¯KōbżÇxUxƒšUUlWL'], + 'encodeOffsets': [[ + 122794, + 31917 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3213', + 'properties': { + 'name': '宿迁市', + 'cp': [ + 118.5535, + 33.7775 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@XbWnUJVzXKVVUbW„klUWbU@@W@IJ@nƒVmbVbn@@V@„UŽƒIUJ@XUJ@VVn°VVbX@lwlJnUVL@l²@lÈUôJĊklb@¤VLœ@@xVxUxVx@bVbš@@xU@ln„mnX˜mXLVmV@X@lxVnVJôL„LXa‚x@b„@@KVL@bn@@m@™@alLUUVaU¥nIV±‚I@mXI@aWWXU@LlUXWW_XWmaUwǙ@aaWUX@@kWUƒynÇwUKkL›ƒ™VwUmVI@aVa@wUKUk@wƒWn™laUmĕk¥„™ɳçóÑŹV™mmzkVmm@a@Ióƒk@@LWU@`—„WbXLWlkImJVn@`nXVbXŽmL@Vn@‚l@nUVl°Xx°U@LVĠ@z°˜@¦UV@Xn@VJmV'], + 'encodeOffsets': [[ + 121005, + 34560 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3207', + 'properties': { + 'name': '连云港市', + 'cp': [ + 119.1248, + 34.552 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@‚lzXxmÆV„„@@¦„@l`XnlKšXXm‚KnLla„b„@„xmbm@kL@V@Vl@@VUXšJX„mbš@@„°Æ@èÈzlW°XĢJlÈ`lInbšWV_@mš™@UUķnƒôw°ÆmnaVƒVÛVmĸ»Ģw±Ý@@mUIny™UmWkۥݙƒK™@Wn@@aWUnwVL„mUaWIUWVk@kkJUVWLUkŃWJ@bkLWVUbÅUƒb¯KWbUJ„WXX`WXkV@KWVXX@bWJ@nJU²mJV¦UbVVkK@b@š@nm@@aUK@Lƒ@@awWbƒKóKUIUmkwW@U@UnWK—nmWƒn@b„l@bmVUb™@kw±n¯w™VUb'], + 'encodeOffsets': [[ + 121253, + 35264 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3210', + 'properties': { + 'name': '扬州市', + 'cp': [ + 119.4653, + 32.8162 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VUXblVVV„b@xV@kz„V@l‚wVLUbVV@VU@VbUbl‚b@nkĶ°IÞV@Ɔ„VlmVƒÈÅxmKU²ÅJ@xVn@lĢnmbUlVLÆbĢV„V‚bœV‚aXk‚@VXKVVWšXVWXUmKU„aWaU@™¥@£XW‚UUV@@ynam_VWkUVUna@ÆV@mnkWmXkWU„W@k„@@akklƒlWUI@UnKl¥™I@VVma@a@I@U@a@anK@UmK@ÅVUnJl™kI@aVwka@mVIUW@UWL@WÅbmIƒƒULka™UWƒUxkLUKWlXL@VƒImƒÅVƒU™mĉL™Uól¯I±l@ÒUbVbUVVXUJUnVV@lnbl@'], + 'encodeOffsets': [[ + 121928, + 33244 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3201', + 'properties': { + 'name': '南京市', + 'cp': [ + 118.8062, + 31.9208 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@k@ma@kUUVmVIUWVUUaVa@Ѳk°Jôk@Wmk¯KmX¯aUakKƒƒWU„@XU‚LXaV@@mUaVUUl@VmkaUXm@ƒWUUna°IlmV™m™IUW‚@Uk@@aV@VVX@„V‚I°»nm„U@VKVan@m»UaU@U_@WlIUa™aVaUala@¯n@‚ƒkaUkUUWKU@mwkUUmmL@K@ƒLmUUVƒKƒVÅImU—JƒƒVkVVLšèVLVU@W„L„V„š@nVÜULVŽUL@bW@XbWbkJƒUUVUxVXmVk@WUUkVmIƒV@„nbnVWbƒJU„kUULƒa@Jma@XkK@VVL@L@JƒLUVU@V¼ƒnXlƒbm@kbUKmn@lVb@VXXV‚UV@b@LVbÆxXbl@@lV@U„VV@XVK²VlIš`„UbVbUlVVn@WXn@@VUV@„@KmbVLXқLkKƒV@nX@VVUV@b™nVllbšmnb„IWVXU@`lLlknVnmlLlbUmVInK°nUƒU@l@VU@Vn@„ƒ@alI„`VIXaVaVa'], + 'encodeOffsets': [[ + 121928, + 33244 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3212', + 'properties': { + 'name': '泰州市', + 'cp': [ + 120.0586, + 32.5525 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lUU@@y@In@WwXal@Þxl@@anVô@ÆX„lŎ™ôU@™Vw@ÇUU@@m@U™JUUWKkL@Vm@@£„aUUmyV@@_kJUUVUUWlUnblL@aUmƒI@ƒULUW@IU@WaUK@£UK@aV@°V@LnUWWXIla„VV™@£UWlkXĕVLVWšb@kUalwUKU¯lU@mk£VôKȁVK@w„KVaUkķlUI±™ğ¥ÝUŹš™Ž¯ôm¦ƒĸ™‚@XXK@VVXUJ@nlbUx@blJkšmIUV@ÆnL@VmL@b@b@V@J@bnb‚U@UšJk¦mL@VVJkXk„ll@bƒ@@lƒXXVWlXnml@nÅU@ŽmbUVlVUXn`mb@zU@V‚VWX@¤š¦V@Xb'], + 'encodeOffsets': [[ + 122592, + 34015 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3202', + 'properties': { + 'name': '无锡市', + 'cp': [ + 120.3442, + 31.5527 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nLƒÒlxUVkL™am@™ƒkVWUULUxVVVbUV@bVLU‚nnź™ÞVĠ¦X™VUUaôw@KlUVw„WUwVa„@lUXƒWa@_X@WmkI@a@W„I@w@KmKUUk@@aVUšVVÅmJ_@W@a@I±wÛ@ƑÇkw±ƒ¯£mWĉUóçƒK¯VkUWK@XkV¯UWabƒmUa™UUb™lln@b@xƒbXŽWX`@„VxUblL@bn@Vb@`m@XbWnn@l¤„n@xnVlU„™VLÆWœkV@VbÞJ‚_nƒl@nKVU@aU™U@mVk°WVLUV¯bVXŽ˜bXlVn@VmL@x—V@bl„š‚@œnW@X@VVJ@²VJVU'], + 'encodeOffsets': [[ + 123064, + 32513 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3204', + 'properties': { + 'name': '常州市', + 'cp': [ + 119.4543, + 31.5582 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„L˜ŽnxUbVVƒL@xnnW‚nn@VVXn@‚yœImx„„°ƒšL„a‚¥n@VkšKVw„W@nX„VJ@b‚@UVn„ƒ@UnUV@L‚b@`VLklVÞn„Æ@VaXLl™ÈJšmmVUK@aVUUaUUVwVKXVlUš„n@šblKVUkw„ÑmKUVUI@±UI@U@WmX@›™kƒ@a˜U@wnK@UUmWk—aWU°aVUUK¯XUl@nVŽVš@bUVmLk@m„`ÝIUaU@›lÅXUKƒškVmU@wƒmk£m@XmWan@@_Uam@@akKVaUw@ƒW_XW„a@w@akmm@mL@UJmnUKƒ@@XnJWLkKUb@„Vxk„WƒL—aWVUImVULUK@L@lkLVVVllb„m@@°kbVbUbšbVbkJ@XV`V@Vbn¼'], + 'encodeOffsets': [[ + 122097, + 32389 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3211', + 'properties': { + 'name': '镇江市', + 'cp': [ + 119.4763, + 31.9702 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@šVĊKšn„VÆUn„„J@UWKXkVLlKVwX„šVlbVK„„nJÆaš„ķn¥°óÇIkšWKUbÅ@mƒUÝlkUK@_a@KVUVm„@mƒVU@@aUIWƒ@mƒXUx™LUlm@¦ƒb™K¯„ƒƒnw›Jzm@UW@UmmXmm@w„KUUVamw—ƒKm@UbUL@ŽƒVmn¯¼JƒUW@UUU@@bl@@VŽVXšJšnnU‚‚k¯JmbVV„Xn@VWlbUnk@VVUŽVb@nU@WbKWVƒ@XV„„lLVb°bnW°Lnl@X'], + 'encodeOffsets': [[ + 122097, + 32997 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/jiang_xi_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '3607', + 'properties': { + 'name': '赣州市', + 'cp': [ + 115.2795, + 25.8124 + ], + 'childNum': 18 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„`l@Èbln„@„KVLl@„V@bȎlnšKXkVlVL@„lJnb„¦VKVVnX„W@w°@VU„mln„UV`šU„bVUV@„xnKVI°KXKVkVL@al@Xa„LVlULWV™VVL@b„x@VXVmb@x@V™VV@nn¤„šlb°b°KXXWbX`lbXx‚z@x„`VIVUnK„L‚x„WXLVKVbVLVU@wnW°b„@nalX„‚mXVJn@U²mKkVl„U@@xlnœaVmlKnœ@JVLlŽnVššl@XXÆèVlUX@xVLXVšb°W@wnUWmXk@K‚LVwUmUkUKUw@wVaVK@kƒ@WnkUKWkwlmXL@KVUlLVKXmWU„L@ašL@malaVk@aa‚ašƒnXš@VVUblb„Jn˜ƒXa„V‚wn£„K@UWmUk@ƒUaWIV@b™JW@KmmU@aUUUkmKkVKlUU™nKVU„lVaV£Å¥WUUK@UkUUw@m@mIkƒƒUUWƒLƒK¯Uw°¯@wUKUbƒKmƒ@kkKUL@UUKV¥U@manw@k@U@Wm@@U@Wwkm„wWaUU@UUmV¯kwƒ@@kmƒkKkUW@UK@ÅV@XWWkXa@Ul@Va@KVaUUU@ƒaXwla@UkVWaXk@K@lmkUmV@Vmbk@ƒ»XIƒ¥VUkƒVUVU@anKVUƒKUalU@wX@˜™@a@K—@ÝwƒL@ŽUnÇlUIkJmn@ŽƒbVVb@VmnkLƒV¯U@ƒ±l—IWmƒ@kaUI@aÇU@K@KUIkbWbƒJUIUyƒX¯ƒUbU@méUUmUk„WK—xWIkJm@V¥U_UJUwmVkšƒUU@ƒƒƒ@knƒwm@UmkWJkL@n@VW@@‚U@knm@kUml@xÅxƒ@@XUJlb„@VX„JVxn@lbV„@lULnV@VlnV@bWV@bXL@lVLVb„V@blLn@Vl„K@xln@bX@lašLVbnKUVVb„KlXVVkxƒV@nnVUb‚lV@@z—°WWkbƒIk‚WL@LUJ@bUI@b™`@UmI@mkK¯XW™™mUV¯@UUVUUam@@VULWUJƒIm`IUJ›KUkW@Uxn‚WbnnmlXbmIUVmV@Vnb@V™LUKWLnÒVVV@V„UL@„kJUV@bƒÈ@ŽšV°šŽ@XVV@l@xUz'], + 'encodeOffsets': [[ + 116753, + 26596 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3608', + 'properties': { + 'name': '吉安市', + 'cp': [ + 114.884, + 26.9659 + ], + 'childNum': 12 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lxnb@V@bV@ln@‚n„‚lInš@blVXK‚nk¼@VUKWL@b™L@`UXU`ƒ@V¦XLĠ@lJ„¦@„nV@l°nn@‚mVXnaš@nb‚K„n@l„IVƒš@VanJ@_lKVVnš„L@L‚K@Vn@VbšUVanKlLnbnJVbšnWVnVVanI@‚Vb@L„bVKVanXVbVJVU@aXLll„bôlƼXxVLVK@Xn@ƒxnVVVmb@LnVVKVXV@@mnaVXUVnV˜K@_UaUmšwnKV_‚anKVLš»„K@¯ÝU@›™U@kWlUn™lknK‚VnaUkma@ƒUIUwl»Åw@ƒVwV@n™‚n@ÈXlKVmna@kVw@anm‚@n_WWk@™™mUkUK@Im›kLUn›bkm@wV@kƒlUnLV±m@UInWƒkWmbƒ@¯amX@xUVUKUaULWKƒXwƒKmLUVUJƒ_@wyWwkaW_XaWW¯L¯akaƒ™m£@mUUš@U@wnaWU@Uƒw@aUKšUXUVKUkƒKWbk@@bUKUlWL¯LUJmLƒwU@UVƒa™VU_ƒVkmƒnUV¯@@xƒXmWUUULƒ¥makI@ƒUKUkWl™LkmǍ@aƒUk@UKƒLƒ@kmÇak@ƒ_VlkL@`lbnšlLVanLnbmVÆln@škJlbknmKUbÝmmwULUK@bkLWKULUUma@Kk@UV@L@llbVzšxUxnl@bVLmŽšŽ@IVJXœVlƒLV`@bn²@J™@™V@Xmbñ@WbUJ@bm@@LUĬU‚„¦lV@xXb@blnUV'], + 'encodeOffsets': [[ + 116652, + 27608 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3611', + 'properties': { + 'name': '上饶市', + 'cp': [ + 117.8613, + 28.7292 + ], + 'childNum': 12 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„„@„V‚š„„I°`nm¤²@bVJUVVXUl@Vmb@xV@XbmVVœ@lkLmbn`VbnU‚@Va„UnbVllUXV„a@w°VW@_VWšLššnVlbšLVbnl„KšnVK@IUW@_@am@™‚ÑUólK@U@WU@VwU@UI@aUU‚aXƒƒ@kwmJV@yX@k‚anƒƒ@mkwVmmI@aUU@aUUW@kVkV@@anKš»„XVWnIVUl`@_„W@wlUœV@UWKnU‚bnŽ°InJl„UV@VnI‚b„Wn@VklL@l@Vn²m@U`kI@bWJƒnV@°VXnJm„XVmx@VVL@bkLmWULUmU@ƒbWXb@llnX@‚xkxVV„nVV@¤nL‚nVxnJVXX@˜ššbn`VI„b„@„blmlLnaV@„blWXnlUnbl@„ƒšKVanUVmm_XK@kWWnašU@UnaWUXa›ƒXamUkKmXUWƒLX¯WakKm™nUWwXa@KW_„aXWW_@WnIVl@XU‚LnWVknK@ImyUUÆbXK„Û@W@IÆUnƒVÝlkVK@mUIVwkUVaUm@aVIVyXIƒaÈwmmk@UnanVUmÅaó»lwšW@kkUVmUK@WKLƒUmWULkamK™Lk@Wa@wk@UU@U@mbUIWVKUXWmkUmVm›U@LkakKƒw@w@U™¯ƒ‚ƒUUn¯l@bmn@xkJWxkL@VkI@mƒkmJUI@V@b@VVxnbWlkÈkVƒLƒbkKmVƒL@V@²nxW‚kLUL@xlKVx„bXmVnšWJ@ޙ°@n™xUKUw±`UImVmnU@kalm@akwƒU@UUJmxU@@Uƒ@kU@Um@@Kn™ƒVm@k™KmkU@@WUnkLWxkVUwmKmLkU™bmKUbVŽ@xUnkJ@n±ŽšUxVXUšWJ@LUb™lUnm@ƒW@nknUJUVm@kXllknVbÆK„VVbš¼V„@šUl'], + 'encodeOffsets': [[ + 119194, + 29751 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3604', + 'properties': { + 'name': '九江市', + 'cp': [ + 115.4224, + 29.3774 + ], + 'childNum': 12 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@WUkVUkmaƒVUb@mVUam_nalK@kU›nUWaU@@wna@UVkUWVUUI@a‚±n£m¯_ƒJ™ƒU@ƒƒƒĉ¦Ul@UV™Km™mLlm@ğ¹m`Uk¯@@UVK¯™@UUK@amkmKkVVUa@UkUƒKƒŽUa™L@VVXUJ™@ƒnƒ@™š™WUbƒnVb¯V@LÅlÝIƒJÅkݙm@Ua™WUU@UmUXmmwVUUKWUX±mUam@kWƒzUaVmÇw@aÅLmKXƒ‚UWKkL@W¯IƒwVw™lkUƒJ@Um@ÛÈWŽKUxWkƒaUU@KkLVl@„UKUX±KUb@nVVUbUVmaUlUL@„ƒaUL@‚@nUlWzX`@„V@lx²„@Vlb@bšVÞ@°nl@UxVL@lUbVV@n²xVUVmnUÞb‚a„J@IšV°xnbl@nbÆ@VwnK@VnXlK°xnUlVX„V@Vl@L@lk@W_XK@KƒkWxUL@J„nVx@aX@VVUa˜IXlmL@bVVX@VbnK‚a²XVWƒk°a„@UnV¤nbmLmW@XbmJUbVL„aÞK„L@K@U@aVKlbV@nXlJœxV@VnšŽVȚ„ÞKôbźĕČmV@ĊšŽ²xÆIšV@Þ¦ĸ¼ÞVlŽVÞnxln°Jœk‚LXWVUVUVwnJVI@yn@lXlaXmWI@w—»ma@UmK@akKkXmW@_kaWakKWk@@K@IšWƒkUa„ƒ'], + 'encodeOffsets': [[ + 119487, + 30319 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3610', + 'properties': { + 'name': '抚州市', + 'cp': [ + 116.4441, + 27.4933 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@°V°UnÜ@n@lnLlV@bšV°L„lnLllVzVVXlV„V@@L@xX@WlX„m@UVƒL@V@n„°škVmVUnKlaXxVbšnlU@lVVnaVI@aX@V„šJš@V„@b„b@šVbš‚@X@lUL@Ž@VlIVm@wUVanLšalVnKnLVxlUXwlKVm@k@Una@mWIXKWUÛVƒk@a@UVWn@@kl@@W„XlW@_Um@UVK@a„LnalInWV@@xnI@¥‚K„—šm@kKmƒnk@mlI„¤laXbVblknV@U‚KXVlUXa‚@@Unw@±mU@ak_±a@ƒUJUIƒVKW_Xa@aWU™šK@mmUVa@IXa@UWmšannlmX¯WKXwVUVwƒ@XUlK@klJXa@kƒkmm@Uwƒw@¯ƒW¯kw@WmbULƒaUUU@mVUU™WmkUb™KmkkK@aƒkUƒ¯¥Uƒl—ƒm@akU@mš@KVIVV@KUkUVUkaƒUWb—„mƒIkaVaUU™@mW™„b‚b@bUlkb‚b@n™K@bƒKXVWnULkKUV@LWKknlxXŽVLml@X„Ž@lULUb@xVxVLVlVnUxK@LWlXnmV@x¯X™aWUUK@wVWUkÅçm`@mn@bUx@lmbUnkLÇWm@mšU@Ux@„Æxk¼VxVJ@„nbVlmbUmLklmškVlX@‚VœšV@°Þ'], + 'encodeOffsets': [[ + 118508, + 28396 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3609', + 'properties': { + 'name': '宜春市', + 'cp': [ + 115.0159, + 28.3228 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@VlbnK@b@JšLlUnx±ĀXxÆW„X@lš@V„@@blJ@nX@˜xUbVVUbVV@b—VmnmJœ„@bmbm@klUbƒLmbœš@lVb@xUX@bVVVbV¤@LVV„bXlVw‚LXÜÇn@@V„IlVškUx„x°J@XlKXLV„‚WnLÆK@bÈxUnVb„ylXn@Vbn‚W²XV‚LVVUŽnxWnnV@VVVšXVbn@ޚÆl„IÞJÆk@K°UUa„mVa@UUUš»@wV@VƒkkUKUVW£U@UmW@@aXkVUnVlKVV„UUkVmU™@kWaUanU„VVamIX¥W@@aUaUVW@_mW@UnIVVn@VbVm@bVL@anKVUkƒWK„UXV‚Ikx‚@na„bVK„b@nVJ„_V›@Vw„‚VUVVXUlUUaV@X@VblašbnKlkVaXaƒ¯@m@U„KVUn@WƒXkW@@w@KU@UƒWkUUUykkmKƒk¯K™U@akUmK@k@mmÛ¯V¯U@‚ƒL™¼UKmLbU`mL™xVnVb@`—LmUVUUWmb@nU@UWULmU@KnaUUmU„wmJ¯IUJWIkVkaWVUIUlWaUIUVkKmbUIƒÒlVUnnŽ@VlLUJ@bUX¯@ƒaWVUKUXƒKUbm@UwKWa@a@VkUWn™@Uak@mbX„WJXbm@mL—aWVk@™wƒL@WmanU@knwWmkaWL—KWUXaƒU@¥l„UVVVbnwƒ¥nKV™»@aUk@a@UƒJ@kƒmLma™@mbUWnm@ULǺ@LXnmxUŽm@UbkbW@@akLmWk@UXmJmUkV@VUXVlULmKUxkL@lmXnJ@X‚l°Vnb@bU@WbKUX@VmKUX'], + 'encodeOffsets': [[ + 116652, + 28666 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3601', + 'properties': { + 'name': '南昌市', + 'cp': [ + 116.0046, + 28.6633 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@šXš™„@„mš@VIUW@UšKVb„„LlV@VVbUŽlUnLnl@bVL@V°šUL@V°@Vln_Ġºn@‚knKnššLVU@VkĊ¥Vk@™Uƒ™»UaƒUÅLUalmkklWn@VUVIlm@m„Xn@VmškVa@KXIV™UWVw‚™²@m@U@VK@k@W™Ua@™ƒa@aUƒ™@™IUƒW@@bUJmbUU@kkV™mUaWwkbmLUVUn™lWbUbklmL™akbUaW@U@VbkVWVUUUVƒUx@‚Uœƒ`UI@mƒaULƒamb@lwJWUƒVXLl„UVmL@bUK@aUnUam@UUmJ@VnX@`UXVŽVb@bX@W¦nJUbƒUmVVbXb@lVšUnVlƒVUUkLmUUVWl@bX@VnV@X¤VUVLllU„U@@x™¼VV@V'], + 'encodeOffsets': [[ + 118249, + 29700 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3602', + 'properties': { + 'name': '景德镇市', + 'cp': [ + 117.334, + 29.3225 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VVX@Vbmz„xUlU@mbmL@V²xVbUVVblbX@šVškVykValKVI@bn@n`lVWnX@l„L@™WKnƒVIVa@¯nK@alIXJVIVWUw‚ƒn@nU˜„nK@alI@a@anKm_™a—™W@UWmIUwmmK@£UUƒmUUlwwW@km@kWaX„aV@VnVKnXlK@aUK@UnwWUnƒmIUW@¯mU„XI@alJV_n@m±@U@kkKUlm@ƒXamJ@UVUkƒmI¯JmamVXL@V›UkV@xƒX@`k_UVmJUXƒW™¼mL@bU@UllX@VV@bVV@bnJUnlx@n„Žm„b@lWŽ@zU‚nIlx„@W„bVV@bVJV@UxV@@X@VkLVôÒ‚šn@@b@`VX@J'], + 'encodeOffsets': [[ + 119903, + 30409 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3603', + 'properties': { + 'name': '萍乡市', + 'cp': [ + 113.9282, + 27.4823 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VWnL@UVW‚LXaV@@ama¯Uk@WmInW@klKVwnLVKUkVW@UlUnVnIVWl@nXlK@bX@laVan@VnwWm@KȹVK¯m@kmU@ƒƒ¥kIğ@WKU¥„@V_VW@_šK@aXKVL@Ul»mWLkU@am™kJƒm@kmU@@a@UmakwU@›„Xlƒ@VXk`UIW¼kWWX@‚œ@l‚xV¦XlW@Ubn„@ŽmUkL@UmJ¯UkUWVUaƒUlm@UXWl„nUJ@LmLU˜nXll@bUVUUmVUn„Ž@¦šxlŽnn@VÆÈU°kbV„VxllnL@VnVVUl@V„„anL'], + 'encodeOffsets': [[ + 116652, + 28666 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3606', + 'properties': { + 'name': '鹰潭市', + 'cp': [ + 117.0813, + 28.2349 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@XV@nlšL@lUnš„mŽ@Ln@@VlV„@@VV@nwVI@V„Vlx@bknlbV@nmnUVJ‚_²‚VxVLšw@mš¯@ÝXIm™nUWƒaUwkL@wVKlKXmw@±@U„KnUlL„a„KlUlÇXkmaUw@U@a@Uƒ™UkwUJ@zWJ™w@WbkVWUL@VmUklUaWakbƒ£kJ@nmln„lL@Ž™nƒ˜L@¦mJ@wU@mXkJmbƒK@bUL@VVn@`kXƒW@Xk@@lm@UX@V@b„lÜUXVWLXJ@nmb@V@l'], + 'encodeOffsets': [[ + 119599, + 29025 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3605', + 'properties': { + 'name': '新余市', + 'cp': [ + 114.95, + 27.8174 + ], + 'childNum': 2 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@m@@WULUKWwÅ»ókƒakkWK@bUVUIUamWUbULƒa@KUa@mJUbmUXU™mUamImakKmLUb™VUam@@UL@KƒKm™UUkL@`mIUb™@U„@V@bVl@bš¼UŽmL„¦mxUaUUƒVkŽ@¦„VWbXV˜LXKlbXnmx@lmVnb@X„Kšxl@XU˜bnKn@WaXIWƒnal@Vbš@XmlV@U@bXb‚LVxn@Va„LVWVLXU„b°@VW@aVIkK@UmVmkU„ÑVJnalLVUVJXbVkVJXUlblUXJVI°JnI'], + 'encodeOffsets': [[ + 118182, + 28542 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/ji_lin_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '2224', + 'properties': { + 'name': '延边朝鲜族自治州', + 'cp': [ + 129.397, + 43.2587 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Wxĵ„mš@„ó¤VX@@xܼƨš²xWxƒV„V@„XVƒ„„„ƒbWšXllaÞU°Ċ„@ô¼„LôÝWanV¥ƒÑnĉ°¥šÅX¥°¯@w°w@»°k£°mÈŹ‚mÈbƃŎ¦„K°z@Žkxl¦UbU¤šššklV„KŤÞȰ@@bšV@nVVUlÞ¦lUllœVlU°ÑU¯Vƒ°w„bXxl@VŽ²„˜@n„ô¼ƒó°™kmVk²ĕ‚w@wV™ÞÞ@@Ġƒö»˜¯œ@‚„šbnb°mÞ¯°V°„ÈJmX¥mam™UřƒUƒlaU¯™ƒ@w™Kk—l±n@@wƒkÝVUUl±¯I¯b™a™lƒ@™kLmakbƒ@ġƒŹé°™Þb°šékƒƒLm™„wX™‚aÅb@bVlƒbVb—ÒVbUb›UUanwƒakbVŽUV›ak„¯„UŽƒLmxV°UxnôŻX@J„Xkl‚bkbĉaƒbƒWU„ƒ@ƒk„WUU¯@@klmƒ@@™Å@aƒwWXlKkI@WbUaVIUanUƒƒ@ĕƒ¯K™„mUnWUwm@£ċèkUmbUmm@@nkJUalwk@@nmWUan_óaWmnw±KœIƒwl@UmƒI@an@@mlUÅmV_™KUkƒ@U`@_ƒKUmU™@U¯™mmb¯@kb™ImV¯ƒƒLkbƒKƒƒÛ@ÇnɱJóaÝĢkb@„›x—ÒÇllœ@‚Ž²V‚„ÆUVV„UÇ°X„óxlV¯„lV@bƒV@n—x›@—¤@„șŎnxV¼knšJ‚nšKX°˜¦UlnVbUbÆVnÞWVX¦llšb@l°œVJôÒnLVbšbXŽ'], + 'encodeOffsets': [[ + 131086, + 44798 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2202', + 'properties': { + 'name': '吉林市', + 'cp': [ + 126.8372, + 43.6047 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ôl‚zšaÈV°„šK@„mŽ—LWl™nšVxUV‚È@ŽÝĬUÈn‚ôLša‚„²VmĀkV@„ĠĊnU@b„V@b˜@nl°UVnÞaôJ@bš™V„¦mlkššbmVXx¯@Vxm„nbƒ„šbÈK‚V@bÈL„wĠyônšmnbÜ@nn„V˜x@n²K‚„„J@k„al@nxÞU„Lź±Vwkw¯LWWUš™kŎīVwƒw„°y„Vĕ°wÈVlkÛ»@wW@Uô£@ƒn™ĶƒXwW™aUamKóÑUI¯›@k™akkW¥XUmÝÅUVaUa‚mVk—¥W¯™Lm™IlmU»mwȚō@ƒ˜£kJUÇk@am¯y¯UVwƒa@wġx¦ƒKƒƒ¯X°Ċ¯¦U°ċWULÅa±b¯@UkÅWmVƒ™ƒkIUlóŽċ¹™`óIƒlX„WŽXxmbUƒLݏƒbƧ@ƒx¯bƒÈ—l@xƒš¯zƒaݤ@nšm„VWb²bmn¯J¯Ò@n„š'], + 'encodeOffsets': [[ + 128701, + 44303 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2208', + 'properties': { + 'name': '白城市', + 'cp': [ + 123.0029, + 45.2637 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ó™ǩŁ@WlwUaƑwÛÅÇéĉamKƒōÇ@Iƒ™ôġVƒȁÑŹçƒ™ÝUƧċĉwóóÝ@Ƒ»ğL¯ll²@ƆÅV@¦m‚Åb@nmlU²VxšlUn™@VbnW„bÇbk҃š„n@èlnlšU҄Ž°Lšx@¼ĉb@҄šUŽċxՃènLVxƒÒƒbÅJ±a@_ÅJÅnƒŽVb„Kl„nUÜĊ@„Uš™xXVÆn„mšVššJÞ¯V™ĠwšƒXw°xWL„x„KV¦ôU„wVÝǬóÞޙ¼‚‚„ÞkŽVôȘxބU„lVn¦ÞšĊa°w„b°@šbÆw„lŤL²`„z°@V@@™nJVnl@@¥nUmmn„@mwnmmUnk@mlwUaƒLnƒ›wn¯°anƒWakI„ƒÇmXwÆamUXUlJXa‚UUklKUknmÞV@‚K@VWÞ@VkUwVƒ'], + 'encodeOffsets': [[ + 127350, + 46553 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2207', + 'properties': { + 'name': '松原市', + 'cp': [ + 124.0906, + 44.7198 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„šźèȂÒU„óĢ„š@JŎȄ‚‚LnŽĊbÈêÜƃxVbkx@XǪłôš„kÞ`„šW„b@n°ašbšKšnVw°`š_X`W„š¦„ĊIkmVšakw‚K„x°UÞb„U@lšƒl@°¦œVW„šaÞbšxÞI@mVI@ƒVkŚUWK„¥nL‚a@ƒ„@ȍ„@°ƒÆ@nU@KÞalkUwVékUWw„™kU›VkkƒJk¯@»ókƒV¯ÆÇI@bĉô¯@™ķw¯nmmÅL¯wƒVƒUÞy@UówÇLkmm@@UóxkkĉmL¯wVwkWWX™mLõm@kűV_ƒƒô»ÛƒÆ¯@™Va™VšaĠVlmğwķUóÝƽ£ÇJkbǫaƽLW@nxݤkzƒy¯XɅm@VšôÇX¯Ė¯ºÝnUŽnLVlUÔmV'], + 'encodeOffsets': [[ + 126068, + 45580 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2201', + 'properties': { + 'name': '长春市', + 'cp': [ + 125.8154, + 44.2584 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„U°xÆKnn°mĸxš°@Ċó@aÈJ°Å„Uôl@¼l°„IllœUlVƒšXxlVUêVxkllnÈUVll@Vx²IÞ¤VUlVnIôlރlwô_„›„bVaĶLXÅÞÇ@K˜¯@wÛaƒçn¥š¯WXyW¯XwƒUmmÛ@ma™nómğzƒxÇK@aUÇL™a„ƒmanƒUw°@WwnU™al™nkƒ¥šU™@aóIÝbUm¯Vmk—@@aƒU@amVğĉ@ƒlUnÿ±Uƒ™bóKmVÇÞī@ÇVUUw‚™šmXk˜Kn@ƒ™L¯ƒÇU™byókōè@b‚n@lÝX@x¯ô@ƙUV_maXm@aóƒJWxnX@ŽVVnĖVnUJ@nōÆǼV¼kxƒLklÝw@xƒx@zV`ÅbmxU±xU„nnm‚kn‚ŽğU™bUŽ‚šUb@šÅ°Ü„󼄄U`Ʋ@lön‚KšnXWlXUx°xnKĊllôw@Vn@lnÈKôx@VÝz„V'], + 'encodeOffsets': [[ + 128262, + 45940 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2206', + 'properties': { + 'name': '白山市', + 'cp': [ + 127.2217, + 42.0941 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Ušl¦kÒÆ°„IlÒU¤ôz„¼lJš„U„n‚ÆXVl°@²aÆbVKČXV¯°¥¯ĉ°W„„„L‚¥Ģw@x„bUx°V°zn‚‚b@ÈlVŽlIœ@˜w@m„U@akU°ƒkUôwWƒÈ¯VUƒVUƒÅ±U›@kÈk˜Ñœw@ƒlaÞġƒUÞ£@ƅ‚KnÑĢ¯@W‚aUaVUVkkw@a¯@¯™Ý™ƒVXnW@@WkXmK@xkKUb@bW@Uw¯„mmb@WKUbmUbUaWbƒJĉIVW@I—l±LkšmU™bUm™@ƒnkKWa¯n™@„`Ubma™„ĉL@bƚ—@W`ƒL@n¯‚Xb‚@kb@x™Lƒ„™@V‚kL±™™mlUIU¥mL@lÅx@_laƒƒ@U—aƒV@kmmƒK„£ƒƒLƒƒmKUnÅKVbmXVlèĉUUbml„ĢŤƒIlŽ¯bǦœl‚@ô¼Ģ„@x°„l¤„n„a„l@x™b'], + 'encodeOffsets': [[ + 129567, + 43262 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2205', + 'properties': { + 'name': '通化市', + 'cp': [ + 125.9583, + 41.8579 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ÆlXnĠxĢ°lÈ°š„K„°kXm‚@¦Vbk„ŤJšnݤk„VÞVVkȄb°y„™@w˜k„Ç°a„wƨ@„aސ„K‚VnaWwXWƒ„kôJš_ČºôVkƒ»óyV£kуJůlÑk¥V™ša@wƒkƒbƒmk£¯ƒ@wġƒó»@›kÈ¥°ak„JÆ£ƒġnkVaĊVkçWUnUaÆLVmnL„„‚KU™±@—„m@a¯U„bmV¯m@_ƒK™™U™ƒaƒÅ™Wó¹ƒ@UanmWak@@wmI@y™@mk„JVa™@UaƒIkJ@n™@Um±kkxƒm™Ik„ƒbÇm@Ž°bXn„V@Ž°ÈmlÞ¼¯XVº¯Lm„kWWXLmVVlknƒ@@lnWƙ„Vxbmšnšm„¯lÝaVȁè@¼V„„b™„ÆŽ°ÞUVšJ„„kx›I—xƒƒƒIV¤™ÒXxmn'], + 'encodeOffsets': [[ + 128273, + 43330 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2203', + 'properties': { + 'name': '四平市', + 'cp': [ + 124.541, + 43.4894 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Ɇn°W„zlyÞ£mwX@ƾKǬblaÈIƾ¤ôÞĸVĠxnmmVƒ²w‚VnwÆaU_@y„w@wÞxlk„KlwU»È»ŎÅ@mVIUmmĕUU@mWXw„Iô‚@bWnnbU`‚šV@Å°ó@wÞW@km@aŎ烙@m°Ñ°Inm±aXaƒU™n@mƑšU¦@šÇŽ¯aU£šaU™ġ¦ÅҙJōUŻókUÇ@™¥¯ak¯mUVak@@aċçÅaUƒm¦Ý`XbƄ@n`ƒI™xĊÞōÞml@šUb@Wl™_¯JkšÇUÝÆÅb@n™„llUb¯„±a@ƒ—ƒWĉJġĀ¯™Unóšm¤œxôaVnƒxôI@x„V@bmƙ„@lnLmޯޙxVb¯þ'], + 'encodeOffsets': [[ + 126293, + 45124 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2204', + 'properties': { + 'name': '辽源市', + 'cp': [ + 125.343, + 42.7643 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@żôŎVšIÆÑĢ¥Vš™bV¤°bȍ@™V¥ƒ™Þ£lÇUUUÝlƒÞ£™mţIlƒUa@¥nlWƒ¯ƒL¯™kÇġ¯ğwWmÅk¯UƒVU„„bWlXlmnƒbUx¯xVVknlŽUbV„ÇKUb@„™VnbmlnzUº±bmJUbWÈnèm҄š@X`WL'], + 'encodeOffsets': [[ + 127879, + 44168 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/liao_ning_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '2102', + 'properties': { + 'name': '大连市', + 'cp': [ + 122.2229, + 39.4409 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@‚IÞmVk@wXWÜbnwlLnU„@‚nLlbXW@a‚wnbl@XL‚aš@Ċ¥@LULnJ@xVnmV@VXXV@VJkn@VÜKXXôJlb„xl@„IVbnJVLUbn‚lnVw„JVU@ƒXU‚aUUlwn@°ƒn„VKnV°_VJšwl@nwlV„IXWlIVVnK@IWmkIVaVU@WÈUlmU@U„WUalkXġŻ@kIƒ»mm™akUm›ĉUŁV»²ġVĕ@aUU؍IɃ`ȃ@kƒw@ƒUƒmwĉ™@ƒWķсIĉÇbÝLkymbIƒwÇmÛbmbU„¯ÜõÈkÆVbŎxnXVÆnšǪ¦„bš¤Uš™xÝnĉÒmĊVȄ¤Èš„bƼ„Ā„„ÆÆބźb„VVbX„‚°²¤'], + 'encodeOffsets': [[ + 124786, + 41102 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2113', + 'properties': { + 'name': '朝阳市', + 'cp': [ + 120.0696, + 41.4899 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@na@UVI@m„ÑW™kaV¥UI@wl@„aÈbšm@wVašk„@@K@kƒ™@a@UUmƒUUalmU@KÇUű¯@±kUKVkUaƒaU@¥m@@¯k@WLUmkn@mmIkm@amU@wVmkU@Klk@U—m˜aXIWWUL™aULVbƒmk@UUmUk±™_Uym@mbkImaX¯WW™xWKzU@WƒkJWwkV™@Um@UbVVVVXb@VWX—@WŽ@Vkb@V™nUK±aUUlwX™ÇWKknU@mmUkƒLUVƒVUUVƒUaƒw™bkKmwnIƒ™kJ@nmbƒ`kmVkLWwUm@UUU™K@UmaUa@UUaWK@mUƒ¯Wkk¯VmUUŽ„xVXUVmL¯ymXkWUbmXUKƒVknWx¯JVnkLƒl@VVxnxlĀVL²WlX„l@bÝVUn@bnlÜaXblIVl@šš@Ȧ@VmbXV‚@@x„VVnUn@`°@VnXU@K@„VV@VmbnVn@ln@b„xƒ°Ub@bšLV`Ånƒ„W@@lUšnnWVU@Vbkl@Xl`XxV„UblŽkX@Ž°¦V„UVVbUlkV›@UbVbkLUxmJkXšš@b‚bœxVKÆlXX˜bnŽnala@ƒUk@U„VVklKVUXKVU°KVan@VUnLšKVL„WVaU_@mmUXa@m˜wXwVkVWXk‚k@›„k@klm@wXKl@U@KVUUUVaUƒV@„alL„xUx@b°°VnnVšxlIXJmx„LUVlV@bnX@Všb„aVx‚@XJ@b‚n@VŽVXȄl@llX@lU„Vô°°@ބVbn@‚V„k„@VW'], + 'encodeOffsets': [[ + 123919, + 43262 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2106', + 'properties': { + 'name': '丹东市', + 'cp': [ + 124.541, + 40.4242 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lzXJ‚U@š²x‚@@Vš„@bUVmKUn„°n@lnVK„„nV@n@VlV„°WbXn@‚VzƒJ@¦@bkb‚bUl@bkbƒJ¯zƒWULWbklV„nb™¦VJ@„„K°U„kl@@W„bVn°@„Všm²U˜nX`„UÜLXmVXlKVbUVVnUbn˜ƒX@VUL@lUbWxš@²kl`n@Vlb„@nUVWVLVU@aV@²bl@ÈmšxWX„VÈU„JV„l@„„la„WnX‚KÈkÈ@Va°bÆm„@XV°IVV°UnalƒVUn@UwVU„@@VVJ„I@bl@XK@wWmXU‚UVbkJVXnJVI@mƒknwlKXL@`l@VI@UUaVKÞn„aVm@aÇ£XW„U@aÇUU@mbkKm£™@WW™ƒL@@Kk@kl›U—bWKUkUU¯UõÛƒmUUaVU„U@WU_W@kVkJƒ_WKkV@bUL™¯¯ƒ±mk¯ġƒğÑ@UmwƒKUakƒ™ƒa@a„m¥ÝƒIUWmk@w™mţ—L›KʝbȗKWĢklVbƒX@VV‚knÇV@XUVUblJXn@J'], + 'encodeOffsets': [[ + 126372, + 40967 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2112', + 'properties': { + 'name': '铁岭市', + 'cp': [ + 124.2773, + 42.7423 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@XJm@¯šmXUlnVbUJƒU@bV@UJWL@VXLmJVbkXlJXxVL@b@V@n@b@`Vbk@lxknV@VV™V@bUL@bV@@bVK@VXLWLXJ@LV@nbWJ@IUV„x@LVJUXVxVx@VV@@LXJWL@VU@@L@VnL@bVVmVX@@VVInJmbnLWVnVULVVU@VVmX@@JVz‚l@„nVVKVXރ@mk_lm„UUWV_nJlUÞÑÞVVUVƒVL„UVJ@I„Vna‚@@KV@XwWknwnKlalU„w„aĉݚwšJl_@aUaƒKUUU@WU@WXUÆ@@UVK@n@UnVVšblK@bœllb@b„bW@Xbl@UlnLl°°bš¦nKlVnI„V@UWU@WXkƒw@am@nm@aVw@I@KUaVIm±XÑlknJVnVJšaX_VaUaVKmwnkmmn@lU@U@mnašXlKUmUIVmklaUK@UlUVUW@U™kVm™a@UUU@JmUU@@bmb—KWV¯XUKm@ka@UVKVk@aUKmLkKUUÝUmbXbÇJ@k@WU_@m™™@klm@UXKVaUI@KWUXaƒÇWk™aWUkWUL±U@lUU@ƒUJƒI@V¯JmIm@@aU@Uwƒa™@UV@VkI›V¯aUkƒWkb@bVL„@@VVVUXW@Uaƒ@@b—‚ÝbUV݄@ŽƒLmUkVUbVllLUV@LššXŽWbUXm@U`@„kxlnnJlbnIllšLX„lVlUXmVK„n‚V@L'], + 'encodeOffsets': [[ + 126720, + 43572 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2101', + 'properties': { + 'name': '沈阳市', + 'cp': [ + 123.1238, + 42.1216 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ȚĊÜ°„b„L‚lÞxUbUn±‚@ÈnVÆL@xnLšlUVƒbƒxkImJkn@V±LUxkV@bšbšKVKnzVl@L°@Va„xÞUlbôxVVœ@@V±bnŽ@llXL˜ŽöXĶŽnal@nkVJVI@aU@@aVK@ašUUUU@lmkwl@Ua@_@a@m@U@aUKWwkIlWUanIWK@UXKVIU@@a„VVIUa‚mVknW°™n@WI@KUƒmULWnkVkUWƒ™KkkmJkamIkmlw@ƒV_n@VWXaW™™@KVUkKUkValUnV„K@ÞƒVUÞa˜@a„@VbX@VWUU@Uƒ@UK@ala@IkKmUUa@U@ƒVƒkk™WVwU_@KÜUXbl@V¥XUVmƒƒƒXa‚kŃlUUkIm`UIUJW@UIKmkm@UUJƒImmU@ƒVUXU`mIUbUK@LƒJUU™l@Xƒ@UbƒJ™kU@ƒŽn„m@Uam@@ƒ™aUmLKƒwƒ™mWXUK@kUaÇa@JUIUa@aƒKVUƒUXmƒUy™_@lmbkLUKWLX`‚n@bVL@JXL„‚WX@Vnb@Vm@UbnVmL@V@x@LUbVV@V@LƒUVl@mb¯U@xU@UVVV@X@VVblJ@bn„VKUn„x@llnL±¤™b@k`VXÆK@„kV@¼kl@bWIUl@VmLnbm@@JXXmb'], + 'encodeOffsets': [[ + 125359, + 43139 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2104', + 'properties': { + 'name': '抚顺市', + 'cp': [ + 124.585, + 41.8579 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„XVl°bœUlJ@UVUš@„bVxV@@bn@nJ°I@U„J‚I„VV@V@k²VVKlXXVšb‚lÈX„ŽWbXV@LVJUbWL@Vkn@lšš@nV`@X@lÈIWanaÞVVVlLnKVL@bUlUL@Vlbn@VL°WXU˜Lna@aV@nV@IVV@VšbUnšl@V‚XnKVa@U„UnyWkXaƒaVk@ašašbnm@_WKXmWanU@alaU—l@XJVLVxX@˜wnKnVlwƒƒ™@V_@a¯¥@UkKWUaUU‚anK@IƒaU@WUaVw@klUVyUUVUUÇ@Iôbša@mnUma@kXa@UWak@Wa—l@a›@WUƒLmU@U`mIUU™`mUk@@UUK±nkJƒbUam@kwm@@a@UU@Ua@@K@ƒVK@kmKU_UKƒUUaĉWmkkL@`™LƒnmlkLkbmK@k™@Ulmb@b™„@Ž„xUVƒIUlmVXXƒxm@™JUUk@WUk@ƒakx±@¯x¯Umb™KUUVmUU¯UmVVn™WkÆ„lWb„„„ŽUnWVU¦k@WaÛV@LV`UxšXllU„@„@VVbnVlL@J'], + 'encodeOffsets': [[ + 126754, + 42992 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2114', + 'properties': { + 'name': '葫芦岛市', + 'cp': [ + 120.1575, + 40.578 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ll°X„ŽnV‚@XLVb@VVbnb@VšLVV@VVnXxlKnU‚l„_na@mlI„šmJnxlLša„xVbU„VV„UVU„KVlnnV@lmXLšÈWŽkxVV²bVLšm@Ula@UX˜@XW@UWaUUUUVan@V‚š@lUXxlIX„V@‚yXLšw‚ŽXXW°nblJnan@Vzš`l²nVVVl@„nUaVKšbVKnXVaUaVUšyšnXK@kVK‚@X@m@m‚LXa„LWƒU¯„w@™ƒa@UVw„¥°™ó¯¯y¯ƒUǯ»›w¯Iƒm—¯Ç™UUl™¯»ţKċÑţķm¯w@mU_ómk¼VnU`±IkbVlƒnnŽU¼±Lk`@X™Wl¦UbmVUxkXVlkbllU„Vb@bkVmx@XVV@Jb±aULkKWXkWmX¯aUJmIkVm@ƒxU@n„'], + 'encodeOffsets': [[ + 122097, + 41575 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2109', + 'properties': { + 'name': '阜新市', + 'cp': [ + 122.0032, + 42.2699 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@šXnb°lš„VlnXVJ„LlVnl@zÆxnK@b„blKVLn@@V„aVLVK@L@Vl@XVVInVVKVwlUXwlKšL„ššVVb@aV@X„lUXbVW@n„lWnXKV@@V@XUVVLUVV@@bVVV@@ln@VbVUXV‚I„xVanJ@UšIVWšL@UV@@¤V@nInw˜W„k„lnIVx‚lnzUVÇJ¦VVÜLĸUnW@aV_šWĊXXa‚Knkl@nm™L™a@alUVw²K@UlmnIlJ„w„aVU™kmK@wÅKmU@DzVmVaÝwkƒKƒaÛ¯șĉķ¥ğ¥ƒ@kUWkƏī݃ƒ@@akU„K@KWIUm¯nƒU¯JmwUVmIkJÇLm@™UImJUU@aW@U@@nUb™JƒaƒbXVWn@UVmX@V@b„š@l@Lƒ@™lUb@x™nÇaƒbk@@xVJU¦lbXšƒÒ@nUJ@Vmb'], + 'encodeOffsets': [[ + 123919, + 43262 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2107', + 'properties': { + 'name': '锦州市', + 'cp': [ + 121.6626, + 41.4294 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nJ@nlmVnXKl@@°n@@¦‚V„bVbUlVL²l°@ƲÈV@LV‚knVb„VVnnWVU‚@XmWU„a„bšIVa@mV@X@@bVVnIVJ@š‚nÈKlInJVUnx°I„V°mVnXJ@LƒLlV@b„@ބƐĬXllV„@Ġ¦ĸ¦naWW@In@manK@UVkXJ@alk@»lU@ƒÅLUWl_@ša²£‚Kkm@kƒwVmULmƒ@akIUa@U@WUUVU™aÝ@ğ›wkƒƒmĉ£UWƒ@@bÇL@m—a@_mKƒlƒXUwKƒLţÓ@UWw@K@U„I@m™U@UV¥„@°UnJ°@@_™KUwƒW@UnaWUmmI@m™ķwUaÇLóVĵwݙUUW™¯šƒ¦Ux@V„b@šƒxV°X„ƒKWbK@n@nW‚@UL@lWL™m™zUVVbUbmWXXWJ—b˜n@Vkl@LlVUn@xnV@bln'], + 'encodeOffsets': [[ + 123694, + 42391 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2103', + 'properties': { + 'name': '鞍山市', + 'cp': [ + 123.0798, + 40.6055 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@l„œxĠŽÞ@šbV@@w°Vna‚@Uk„V@K@UUUVa@K@w@UnKmUVan@@Uma@UXWƒWK@IUK@amW_XKVLlKna@kmKVak@VU„@VmšU@anIÆan@‚a„šUVnb@blLV`ÞLlU„bna‚Kn@naVU@¥°IVK@anUUKVaƒUVak™@mJƒkXƒ™UVwkƒVUUa°U@Wƒ@WlkXWlIXUlJlaœx‚IVVXLšll@nLV@lLXl„KĊzš¥maUƒlkXaVK„X°y„Ila@aVkala@a@¥„IUy@WmXaƒ¯kU@U@mmUƒƒULkmm@ƒ¯VmnLVU@a™ƒ@U@±w@™VWIkymLUUkJWXƒJkUmxk@™xUI¯`mUULmƒ¯„m@kxVVbWV@„UVƒIUx@bkšVšVVšxUbVV@V@zšJVXU‚lnk@@lkLƒlƒLUU±Jkšm@UIUVƒLUVU@™K@UƒnnV@l@Ll„ƒaUJ@zn`@nWlƒIUVUUUV±Ln‚@nmL@VUVkLVlUxVLVlÅXma™@@akLmWUX@JUnVJVkXJ@X@`WX„VUVUIlb„W@bVUVL@`Un@¦U`@bUV@z@Jm@@XV`„LUL¯J@IVKmKÅI@J™nWVnLnšVxV¤™z@bmV@VUV@bUL'], + 'encodeOffsets': [[ + 125123, + 42447 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2105', + 'properties': { + 'name': '本溪市', + 'cp': [ + 124.1455, + 41.1987 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lb@Vn„lnVVUb@šVJ@nnJ@bmXUx@xVbkbkŽWLUxnl@Ul@„xWx@nUV@¼Ull„knkK@bmbnl‚LVJX@VIVJn_lJVVšXUmnU°VVVUnVVšLna°V°w²@lw„bl@XVl@VVšIn@„wWWnUVk„JVUƒw@šƒ@anaVkš@@lnLlalKnk„mšK@_lKnlĊXVb„VVLV`nL@lUL@„@L@‚VbV@@V@bn@lxn@Vb„alI²mVL@Vl@nVš_VVnJV_‚@nV„K‚V@Xœ‚@b˜kXbl@XblylUUkš™@Xa@UVIlK@UUWVU„Llm@UUUnKWU@K@UXm„XVa@U°KVUUWUk@ašUVKkaWkƒKUknaWa@U—@m@mk@ƒaUJk@@_WKkLmx„l@nUJmIUWlIUaVWVXn@xWLk@@aƒJUI@Uƒ@UVVxm@UVk„mb¯VUU¯JWUƒ@Ån¯aUbÇ@ÇlLmWƒXkbƒƒk@UƒƒIÇVƒUXW™wÇnk@±aU@@bUVUKUXmVƒ@kaUm@k_±l™@XwVa@kVK@U„Wm—VaUmVUUakLUWWnÛKƒVW_—m±V™nƒU¯@Umƒa@Xk@ƒl¯V'], + 'encodeOffsets': [[ + 126552, + 41839 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2108', + 'properties': { + 'name': '营口市', + 'cp': [ + 122.4316, + 40.4297 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ĊĖƐn¤„„°Ċ¯ŎWšô„@xXb‚wnKl@nX@VUVƒKmL@VU@Ux݄@Vlb„x„U@VUb@b‚kœ`‚IUlVUn„V@@UV@@JnXlK@bš@nbÆWUkUKVwUklKVU@UnK@mm²KVUVVVU„JXk@mm_@yVI„bkƒ@K@kmU„m@VšLV@VU„KVUVJn@l™²IVV„K„klK@kl@kmVUW™I@y@UUUVa™wUUU™l™@akmmVaUKmIUaƒJk@ƒwkaóIWWÛL@UlmUIU@WW@UnUUm@wmIVK@Kĉ¦™@bWKk@max@bWXkamKƒ@mVkKmxÛaWX@xUlÝnJ'], + 'encodeOffsets': [[ + 124786, + 41102 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2110', + 'properties': { + 'name': '辽阳市', + 'cp': [ + 123.4094, + 41.1383 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@š`Vz„‚Wn„VUV„L@bVbVJ@IÈbVb@lVLXW‚n„š„x‚LnKVŽšb@„n@Vbn@mƒ„V@šl„IVa„@@WškVV„I@KVLVanJV_VW„UV@nn„JVI‚Vn@na@alLlmkƒVk@»VU@mXwƒwk@@VmkVwXKllaUa@wVwnW@amI@mUI@™VaUUkmmƒ@UkaƒL@ƒUIĉyƒLWkkKU@mKk@™kWKUUJ›wkbkIWVkJWXkl@X„‚@X¯VVbUVl„UxšVW„„lnIš@l‚Ub„VUbVLmV@bUL¯J@¦UVmbm@LmbƒakVÝKU_kK@amaVUƒ™bm@ÅbmJ@b™VUnƒ@UVl@UbnL'], + 'encodeOffsets': [[ + 125562, + 42194 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2111', + 'properties': { + 'name': '盘锦市', + 'cp': [ + 121.9482, + 41.0449 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Vbĸx‚š@nnJVnXŽmb@V„XVxšL@`¯@mI¯Vƒ@U¦@VšV@nƒJ@V@LXx@VŤÔ„K‚LVx„W„knL@`˜b@nÈK@a„@VXĊ¤„nVK@aVU@UnU@ašyU£Uwm™mKXUšm@IÆJnLUL@J°IVKƒKU_@Wn@@I@yVU@aV_@¥Vm@_UKUV@aƒXkaVJVUƒUXW@_@WWIUlUIVm@IVW@IU@@VU@mƒUVVkJ›_l@aVa@UƒVƒwka@UރVwV@@UnK„LVU@UmWk@mLxWa@wóƒUVUIÇÆĉ¦¯¦¯xʟJ'], + 'encodeOffsets': [[ + 124392, + 41822 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/nei_meng_gu_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '1507', + 'properties': { + 'name': '呼伦贝尔市', + 'cp': [ + 120.8057, + 50.2185 + ], + 'childNum': 13 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„m@Łkƒ™Žƒklƒôƒ@£kJ°ý™ɅķÑó¤ğLĉÅlÇğŁW¯¯›™ƥóÿlwkţÈéÝƛó™°ÞÅxV¤ĉĖWƒ¯lȭţυ̃ɱÿķƅˋğɱřÝţϙȍƧĊţ@¯kWKUKm¹Å@ķJU@ƧÑƧ„ō¥˹Ɔ@L@„Þ‚VLnš@VōČWJX¦@JŻbU@ţÞmVU@ȁýóbkWWLƒƒÅ™¯UWġkmóƒ±UŹôV¼ƽ¼ƒł̥ĖƽǬʉxĉŽŻȗKΕ̛ʵƨʟÞ˹»Ƨţ»Ǖō˷Ȍ±ȚʊĠUɾɜɨmÜ֞߼˸ƅȂ¯ǖKˢğÈÒǔnƾŎՂ@šĊbôô̐¼ƒ@ĊôĊŽÞĀ™xšĖƧL±ŽœŽ‚Uš°U„°ĬƒČ°ÜƒêɴȂVł°@ƒ„nxŎèƒbȄÞȌ΀ǸlŽ²IlxĊl²ÒmšôĖ™Èl„ĵºm„ÈêVþ„xɛČʉÇĵVmš„ÒƒÈɆôƐŰǀĊ°ÆǬĮƾb„yĊ@ĠšƒXǀċm»ôw°Ûk¥Çm¯ç™kkÇǫţǕéX_ĶWǖīŎaÆĵĸĊ@ȚȘ‚™ĊLĢĉ„VÆĉʊÇĕóaU¥šĉ°mkÅ°ġUĠřk°mƒÑČÿ˜ÛƒWĸ£ʠšÆxÈÞŎÞ»ʈ²ĊÇČalÒ°Ť±ĸz„ŽĊKȲm¤Ŏ@Ò°¼nyȂUźīǖƳÈē°@šÝĶƒ@ƒÈkl¥Ççkxk™›JXÇƒUÅ@˜£k»„óƿīÛ@lÅJl¥óý@¯ƽġƍÅan™ċ™°é¯¹'], + 'encodeOffsets': [[ + 128194, + 51014 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1529', + 'properties': { + 'name': '阿拉善盟', + 'cp': [ + 102.019, + 40.1001 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@™ƏnǟƨʫšŹɆÿ°¯ÆV²ˢ™żÿ@ÝÆŁȰ¯ȀƳĉó™™@ğkyš¹@īš›ƒwl£Źƒƒ¯Ŧé@™ÇÇxŋĉƩUUŃōL™Ç™ĵóÝnƒóç@™™ó@ġƒƱ„¥ƒç™WUçÆōƒ@é—çťK™çȭVһƽ̻aW¥ȁ£ʵNJǓƲɳޗǔlżÞmĠóĬȂɲȮ@ÈĢŮźÔnĶŻǠšŎȭœгŃċóȭţΗÆƑÞƧÅΫóȘǫɱȁġlÛkÇ°ȁÈnšõl¯ô„ÞɛÝkĢóWĊ„zÇɼʝ@ÇÈķlUČÅÜķnέƒǓKȮŎŎb°ĢǀŌ@ȼôĬmĠğŰōĖƧbЇƧōx@ķó£Ål±ĀƧīXÝġƃêĉK°Ýʇƅ@ΌʉżÅÒϱʈ@˺ƾ֛।࡬ţશóЈèʞUš¤Ґ_޸Ƒʠɽ̦ÝɜL׈ɛϜóȂJϚÈ@ǟͪaÞ»Ȯź'], + 'encodeOffsets': [[ + 107764, + 42750 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1525', + 'properties': { + 'name': '锡林郭勒盟', + 'cp': [ + 115.6421, + 44.176 + ], + 'childNum': 12 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ʶĬĊIȘƨƨŽ@ĬÛĢșŤĉĬƒĀóšU‚ÈŚÜènŦƐȤȄłϰUƨťƾÑ܆ğɲƜǔÈèʈƲĊƞƒšɆ¯̼V˺Ò˺ȂŤVĢêU܃x„Āˌ˘ƨ„Æ°ѢmÞżU¼ÆlŎ@ĊçŎnÈÒͪŎźƒĸU°lżwUb°°°Vš£ÞlĠĉĊLޏɆnźÞ„n¦ĊaȂīġŃ¯Iĉůl»kƒ„™Çý„¥Ŏ¯ƒén£ġљÝȭxƒÇ™@Åçķ»óƱŎ¥™çWÿmlóa£Çb™yVÅČÇV»ÝU¯™KĉýǕċţnġ¯»ÇōUm»ğƒÑ™wƏbċÇŎċwˋÈÛÿʉÑ°Łkw@óÇ»ĉw™¥VÑŹU™mW»ğğljVÿŤÅźī@ř¯ğnõƐ@ÞÅnŁVljóJƒwĊÑkĕÝw¯nk¥ŏaó¦ĉƒV¦Å`ğуÑÝ@mwn¯m±@óƒÛKˍƏǓ±UšÝ™a¯lƒōšșk„èƒĬގn@ŤġŰk°ċx@œĉ`Ƨĕ°@ţÒĉwmĉ@ƒƒnƒƒa„™¥ķnƒÞĉVóÆókĉŽķ@ÝkƧƧÛaƒ°Ç@ÝÈU˜óbݼ@„ÛÒV°™@V¼ˋL™ÞɅŤŹǠVÞȗŤÇĖŚōbȁƜ'], + 'encodeOffsets': [[ + 113817, + 44421 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1506', + 'properties': { + 'name': '鄂尔多斯市', + 'cp': [ + 108.9734, + 39.2487 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ĶL²ĬVłƑkkl@Ȏ™ŘWńÈĬȗ¯™ºlz@ĠššĊôŦô„ÒĠ°kÞܚ™n@¤„UĸèĸbŌÈXŽĸLlÒĢxɲÆ¤ÈÛƾJÈÝ°UšÅĶ»²VW¯ĸJôšbk‚V@ôlbnĊyÈzVôašb@ĸ‚ÞUl°yǬ²Ǭm°ššk„±lbn°@È»˜JX„VŎÑÆJ@k„LšƒÆl²™Ġ²ʊůĊġ‚řóƛÞÅ@m„ƒmLUÿóĉƧ@™»L@„›`ČĸmšȗÑţů±ĉğl¯Ā™wǎƒçƧŤÛI@±ÜĉǓçō°Uwô™ǫůķƳř±bÅ£™ÓÇwnÑó@ȁƽ@™ƒÇƧĢón»ŏĕóĊ¯b„Å™™VȯÅImƒōKU„™LǓ±Ýxċ—ŋ˜V±Āȗ°™„Źl±šÛ@WÒȁŚŹНŚÅèŌô„¼°ȰɞȂVĊ'], + 'encodeOffsets': [[ + 109542, + 39983 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1504', + 'properties': { + 'name': '赤峰市', + 'cp': [ + 118.6743, + 43.2642 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ɲŁĢljĊwƾōÞĭ°_ŎŃźȹƒUČÿl»¯ôķVÿǬƽ™ɅġÅÑǫ»̐ʟȣU™¯wVWݍÈġW»Þ¹m݃ɛŎÿŎōͩůV¹›ō™éċ™óŹÅVVĢǩʈ@Ėċ@ķšÛšV°¯xÇÅţ¥™»°Ûô™ĉʟ„¥WýČ¥™w‚灻±mnÅķ¥ˋVƒbUÒġ»ÅxğLƧ™ƒbWĖÅxš¦U°ÝVóŰlô²@š¥ÜÞÛô„V@²±`š¦™„™¯Ý@„ŽÅ„VÒō¼ôš™¤V²ŹĬÇĊƑƒţxƒç¯Lk»ʟlƽýmłÝÆƏ@mö°Ġ@ŚŹĬţÆUĀĠNJĠŽX¼šnźVUҚ¦Ċxȼ@ôlx¯łʊÒÜĀˌÇČxƍČÈƐašx„ÒĠŽn¼ŎVȐ‚¼Ģ°ŤmǖČĊþšLV°ÞŽU¼ċÈUƚzÈa‚¤ôbkŽ‚nXĀšè'], + 'encodeOffsets': [[ + 122232, + 46328 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1508', + 'properties': { + 'name': '巴彦淖尔市', + 'cp': [ + 107.5562, + 41.3196 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@²@Ζǀݴʶհĸ„˜ƒ¦Ķ™̒Uˌ¼ӾÇƾ¼̨UÞĉ˜Ƨ—éÝ»ƒĕĉ—ƐȍœōǪakó‚ó¯a@™ôţ™aV¯Þ¯°@²él¥ĵğťwōxó¯k±š—Vó@™aóbUÇyĉzmŽkaóŽU@l™aó‚ķIX°±Uĵ¼™Æ¯VÇÞƽIÇÜÅ£ɱŽġwkÑķKWŋÇķaķçƒV@£šmۙlÝğ¯ƒÑťóǿƴȯ°Åł@ÞŻĀˡš±ŽÅU¯°ɅĀ™źƧʬmǠšƐ'], + 'encodeOffsets': [[ + 107764, + 42750 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1505', + 'properties': { + 'name': '通辽市', + 'cp': [ + 121.4758, + 43.9673 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ôƲĸ¼Æèš@„ÈȮwƾ»ʠĢ¥VÆ@²¥@»Ŏњ¯ĊJŤ£k»ÆÇX¯̼ōšī°aX£ôƒƾȁź¥„ƒ™aôŤ™ĢL°ƒĸ@Ȯ¼ÈÒʈŚôVXůÆaĠƛÈKƒķšĉôÿ@ğÈĉ™»ÇVn™ĉV›wXĠÝ°šČÿĸwVƒ™¯¯ǵ±™ĉ‚ǫ™ÅÅm»²Ż±ƽIm¥ţÈķ@¯šƧJV»ÞUÝç¯UġºU£ţŽóaÅÅlƒƒ™Ƨī¯K¯Þ݃ğL̑ȍƽ@ōŎōĀƑɜnÞݺX¼ÇĢގUX°xVšʠȤ̏Ǭ¼ÆÒɆĢšŽǫƾUĀóĸ°‚k¼ċĀƑVŹȺōń¯`ÝĮƽŎĉxġNJɱłō¦'], + 'encodeOffsets': [[ + 122097, + 46379 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1509', + 'properties': { + 'name': '乌兰察布市', + 'cp': [ + 112.5769, + 41.77 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ʠǠÞĸɲȺƒÒȂƛŎaƙÈĕȘţUÝźǟɆţšÝˌKU»š@U¯ÜÑ@ƒÞ»ôaV—ÞÇÈ@„¯ÜbƨƨÞlĸ@ĊôlôÅĊU„Ýĸmš¦ƒŽ„bm„„„Ċ@n‚ĊxŤÑ@¯‚ƨĖĊ_@›Čwl¯™ƒȭL›Ý„»ƽ¯ķů„Ǔ@ÇǓbċ™ÅÅÆwÿĠÇU£óaƒ¥¯aŎğĠţkw°»¯ůlÝĵkǻݰɱƧǫaóôɱ»Çk¯ŃóƒʇŐŻ›ĉNJŻĢ„Ž¯ÒÈUl°ƒx°n„Ò™Ĭón™Ċğ°ÇŚĉ¦ʵVƒ°°ĬÛżÇJȁńʇʹó˂ƽŎ›Æţ¦'], + 'encodeOffsets': [[ + 112984, + 43763 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1522', + 'properties': { + 'name': '兴安盟', + 'cp': [ + 121.3879, + 46.1426 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ÆXnlŎ°@LVLĠþœxĊUȮĊnU„ĠV@żaW¯XIŎġƒ¥Ý@K@w@K@I˺ŻŎ¦ƨƒƨÒŎIÆ@X@VºnX°lŎ@ƾĉˤƒȘǷȘÑÝݚÞbVţĸÿŤxÈĖƐŽêÇKnĸ¥ô@›ķÞUnÒl@UŚaƒīˋƒ¯ÑƧx@±kXřƐƏÛéV™ˋ»lō¯ĉ„ÅÇÓǫޗĖġV@ğ»›°ĵ„ÇÞǓ¼¯m˜ÛÅŃĉĠÇƾb²çƒ™šéż¯VƒƒğÞml»ōÑV痻V¯™¯šĕÆU¯y°k¯¯V»ôDŽѰa@Źk™ġKţšóŽšbƒ„Ź¦ƽȂó„W¤¯b™Ĭ̻ŎW°ÅÈl¼ţ¤ĉI™°ōÒ@¼±¦Å@UŽġ¦ʟŽƽ¼šÞĢÒm¤„êō°ƒ¦Èþƒšl„k¼ĊŰ°JĢńȁĬ„°ƒżn‚ÇbV„ݼ@¼óĸţ¤@°Ånšl'], + 'encodeOffsets': [[ + 122412, + 48482 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1502', + 'properties': { + 'name': '包头市', + 'cp': [ + 110.3467, + 41.4899 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@źxżĀǔÆǬVȘĀŤ¥œÅƾōôˁʈͳȂŃÈIÜŻ¯ī„¯ōm™¯ɱĖ¯ƒķÒÝIÝ»ÅV™ƒlÅôфġ™ğVmÞnnƒWçkW܁XƝÆwU»Șĕš£ĉÑ𱱚Åk™„ƒK@lÅIō҃UW‚—IǼ¯@m‚kaƒ²™l¯™ǫnǫ±¯zkŽÝVķUô™˜l²ô°ŎwŦxĶĠk¦±ê¯@Ý°U°šbóŤ@š°bôlôǩb›ŎƏȎĊ˜„ĖÞ¼˜ê—ƨÝĊ'], + 'encodeOffsets': [[ + 112017, + 43465 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1501', + 'properties': { + 'name': '呼和浩特市', + 'cp': [ + 111.4124, + 40.4901 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ʶUĊ¥ÈřĠ¯šĉômšīƒÑ¯m„wk¯ÇV°ÑƒżġĊljǓɱţǓ›ƝóX¯ƒɛÒóa@nÝÆôƜŚĉĢʉŰĊҙ¤ȗĖV¼ÅxWƞۂlXXèm„ÝmUnšĠƒĢóÒkƚ„ÆUÞ¼ÞJĸÑ°„ɲĕš°Ŏn'], + 'encodeOffsets': [[ + 114098, + 42312 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1503', + 'properties': { + 'name': '乌海市', + 'cp': [ + 106.886, + 39.4739 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Ș°ÇīXњŗ@ȍlkƒlUŁ±īĵKō¼VŽÇôXĸ¯Ž@šťê„°ź„k¤„x™œ@Ĭ'], + 'encodeOffsets': [[ + 109317, + 40799 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/ning_xia_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '6403', + 'properties': { + 'name': '吴忠市', + 'cp': [ + 106.853, + 37.3755 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nLV‚@šVLšaÞbn@@l˜š@bUVlUV„zVx™¤kÞVèšXnš‚@nm°a@UƒÑ„@VŽXnV@Va„UšŽVKUUU@@U‚@@KVa@U²@‚wXkWnk„±lLnU@UmmVKnIVWnI@UK›@UK@@UVKXkmWLWUXmlkVwUyVa@w„w@aVI„K@aVÈw„KlLVV@LnV„VVnU‚ܲ°WÈIUÆ@nÞ¼‚‚@¦™@UÞUVW@UxUxVn„b„K‚b¯ÞU`VbǬ™V@XXÆVVl°InmnUôƒ°¯‚anam£œWVX‚KXmškôaVU@ƒVak@@wmaƒn@K@UÛUWKXUƒÇƒ@UI™b@alW@akLUKV@@Ukw±Iš›nL@kmwkWmk@JUIƒůVmnnU@m@UƒK„VKlkUwkƒƒnVUKmbkI±š—KƒkmVkKƒb@U@aƒVkUmn™`kIlaUK@UUKmbUIݚUa@mUa@aƒ„m@UUULUK@bmKkbWI@WXwlkXƒWa@k@kKƒLVkkK@L@JUVmzUKlwUUnW˜£XVlKUwVU@aXI@aWaUw@W@_nam@¯‚UkWVkUWaU@nwmJkUVkWVUmUkJ@ImbUaƒ@@WÅ_mJknmak@@mƒXƒaUV@„ƒxUšƒ„@‚ƒ„@VUnkVƒ@Vn@`ULUbWLXVW@kbUJ@XW`@ƒnÅĖWJƒ@—m°@xƒxšbnUa‚w²lƒÞ°xŤIVVULۂWbšbkVVXÆ`UbVL„@kx°LlV@Vœ„WbƒJn@bl¤ULV„°@lmL@ƒƒ£U@@aUwmKULVxUVVx@„™@kU™@mK¯LÇa¯@'], + 'encodeOffsets': [[ + 108124, + 38605 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6405', + 'properties': { + 'name': '中卫市', + 'cp': [ + 105.4028, + 36.9525 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@°@Èb°KnLš@lVš@@ƒUwVUUwVKnLVx@bV@„¤@„nK@k‚¯UƒVKk£@a‚m„IXa›ƒ@UkU¯Klwƒ@UKVaÅ_UWlU™aXa܁VKUUţJ¯w„ݱkxVbmŽ™a„w@wn¯˜„@XIÆĕ„m‚@X_@WVIlaX@WUXKVaVK@_Um„@lUVm@U„ƒ@„ƒV™„w@ƒVUÛwm@@W@ImKUkU@Ua‚aXƒ@wWaUKkw@UVaUamLU™nk@»±`¯@k—W@Ua™ykbƒI„„@VWJkLWUkJƒwU@ƒn¤mL¯wm@Umƒ²XVWbnV@bmxƒVkxUblLUV@kVWKU¼ƒŽkUƒ@mn@JnV@bUnmJUn@„k‚@XlxšLVVnKlLVV@š@LkKULVbk`WL@lkXW@kVƒ@UÞUlÇX™lkaUbmV¯@@L@šƒV@bkb@xƒlW„—bƒbW@—±@UJ@IU@mVk„VxV@@l„Illœn@Vm@ƒVUbl„@JLmKÛXmVkU›KULU`@LĉwƒKUX„lVUl@Vb„JX¦̼bÞxŎxɜĖĠ„Ŏaô@'], + 'encodeOffsets': [[ + 108124, + 38605 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6404', + 'properties': { + 'name': '固原市', + 'cp': [ + 106.1389, + 35.9363 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@Vnn@°xnK‚£„mV@„xlIXVlKXI@Uƒƒ„JlašzVbX@l˜°@²_@¼mlVšnKVbUb@VlxVLXb@xW„bVbV@VlnL@J@Xn@Üx„b„W@nl@nblmnIÆ`@X„@Vbna@aVUUWVkƒ@kbWakbU@VwšW@_l@nmn@@alVlk@UkmVak@@a‚UXaƒL@¯@KVa@axWI@KnkVaVJn_lJ@„X@‚m@nVanUVb@mXLlJ„VWnLla„VVaVX@KXVVkVKlknKVa@aVU@KXb@klJUknUmƒ@K@_UW@alIUamaU¯kJma@IUK@U„@@UW@@aXLVƒVJVaXIƒKlaUkUV@ambUUJkIWJ@wUI™V@JU@UwV@@Um@™nU`@UkUmVUxWUUV@aÅb@aWXkKUUƒUUaWK@wnm@IVU@aXwm@UmVaUalk@anKUwlƒUwlkK@wmaƒUkmmIk@VmkUUbW@UVUnW@kV@xkVmbVnU‚™@UbUV@a›k@kkW@„kLW¤@„nV@VU@W_UV™UU`VLUV@IUVõVULU@UUUJ@wmkUJ@šWI@l@bkKkbVVƒbVbUL@UUJ@Vm@@L@xbVVVLVlVwX@Vb@bmUkbk@@JWIUVÅw@Km@UkWKXxWLÅ@UVUnWK@xkVW„@KULwWVXVWzXVVKVXkV›V@VUbV@U„VV@š@LXxVL@V„b‚Ž„LnKVLVxXVmb@l'], + ['@@@J@aƒU@LWK¯UUxVVn@Ġ„„LUW@UbUUUa@KUX'] + ], + 'encodeOffsets': [ + [[ + 108023, + 37052 + ]], + [[ + 108541, + 36299 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': '6401', + 'properties': { + 'name': '银川市', + 'cp': [ + 106.3586, + 38.1775 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@šUšwVK@UVWÞUšbšw„V@knV˜@@KU_VK@K„ƒn@W_XWlL@Vn@Ċw@Ulaœ@Wanamī@aƒ»ŋó@aÆÅɲÿUaV_°ÝaƒLƒaUmVwVwX@VUVݚ@@¥Ý»@mVÅÇJ¯XÛ±VUmƒUmU@KUUkKƒLÇxUŽ@bƒLUJ@bƒx@xUbVzUxklWnXV‚KnXWlUL@V@ŽVLœ@VL@ŽmJUXmJULnn@VmVkKƒ²mlXWlx±@@VUb@L@@VV@VVUL™ƒVUbU@WmUƒ@„Ò@V¯bmn@VŽƒ„@lVnUšnVWŽXVl@¦VVUn@x‚š@‚XL@¦‚lXxš„Vb'], + 'encodeOffsets': [[ + 108563, + 39803 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6402', + 'properties': { + 'name': '石嘴山市', + 'cp': [ + 106.4795, + 39.0015 + ], + 'childNum': 2 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@U¯ķó±ÇÛ¯™ķmbXb›@kb@Vĉxm@@UkKWXX`m@ƒ„@LULV`@L—@mU@lƒU™x™aÝVUX@VUL™x™VkLWVšš@J„nVLXVlŽUV@zl‚VL@V@b„„n@lU²WVLlLVbUŽVxUx@xǀL˜xôҜk‚K²ŽVa‚U@wXa@W™ÈĉUa@‚bÈk„m@¯'], + 'encodeOffsets': [[ + 109542, + 39938 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/qing_hai_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '6328', + 'properties': { + 'name': '海西蒙古族藏族自治州', + 'cp': [ + 94.9768, + 37.1118 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@„V£°š@laœXô±źwš™ô@„Ulƒża܍n™Kƒw@U„aƒ™ša²L‚mÈLƚÈxlaUa„wÞmÜbÞUšnJ°a„kôƒ‚ÑkwÝVğwÇ@ÝkkV¯¥@ò„»„nŤ¥XImw@mVwša@Åw™mLkaW—wƒ¥l»kçƒó„»@ƒWÑĉŽğ@ĉ„™‚Ń„UwóřVómĵ»™™Ý@VǕ¯kšÝĊÅk™°ÓUklkU±šI„ÇÞkƒ±@šƽJƒ™@UġIk@W¦™VÑșÓÅnťKULnŽ¯X›ƒ@¯mUÛ@WřmóKknōbƒxÝ@ƒŽU@kw@ÿÇLţšÝUkšmwƒŽk™lċVŚU¦™ŽƒLkUWlÅÑ@aƒ@ÅѱUóġŹ¼ƒÈĉmŻ@@wkw™Kl¯U™ġ@—„lÇU™Ó¯_ƒ‚Waĉ²Åló¼VbknƒKǎÅ@ƧĢō°Ý@ğ„W™ÅxUUm@™‚ÝXۂW„ULUè¯@mbUaƒLƒbUWġxIUJWz™a¯b™y™@ōÈóLU`ÇXUl™UĉV¯n›mÛbǕLklƒUĉVƒšóaġ„ƏbġKţnkbÝmmnÝWȭȃŽÝXţWókUÇl¯U¯‚ġUɅĀ@°¯„„š¯„VÆnmJ@ĊķnóJUbÝXUlVškL@lVxnnmb@¤Vzš`ÞÞŤ@„VnÆJV„°b„UôJkzlŽkl@²óš@ÆÇ°kĖƒšÇbÛU@lmb™XV˜kzƒV™ŽɅĀXˢlń„ĬŹ@›éÅ@ĉńÆ°ğbUšlŽɜ_°‚@xŦ˜škbVbƒKĢ„ŤVŎŽ°@żÈźlĊ„ôKôb@nôxŦ„Æ@ôŽŎL@þÆb@šnnšWˌbÈx‚InaŎxlU@Ѳ±ƒğVUĢƒƨbɲ@Þ¥ôUUķWVô¯ĊWʶnôaŤˁ@£nmnIôŽǪK°xUXô@Ŧa°m‚kXÆÞVŎkĊ°ÞLȄôyVašIlwX°UVwĢÑÜKôw@nV@œm°nmŽn„Ü‚ɞ£VbmŽXnƒ°ÜÒ@xx@V‚b²UlbkxVnšJUnVVĊ°KȚm°nxÇnn¤±¦@ŽUXVV@„lV„„bmVVȁŽVxšÒ™°šIšbźaȃšbVwš@šƒVL„™ƾÑ@ƒŦô¯ĊkôÑ'], + ['@@„@šƒ„@n„òVœa‚w²bVxšxÜaČVô_ĊJšIVmšL„a°@Ŏ¥XlK@ƒšk„l„KVbUb˜@nUĢn‚aÈ@lmǬ»Ġ¯œn‚mnƒƨVy™Ñǖ™Ġ»ɲInŽ‚@@ÅĢƳ@¯°™ôV„KÈbVIÇ¥¯@Ýó„™@ÑnīWKšƒk™‚k@¥š™¯™Åa™Xƒ±VÅw@±Ġ¯@»™š™n™Wmw@ƒ™@¯ƒVƒUUWçƒKĉ„a±VkkƒV¯w™x@šUJ‚x@bknÇb™mÅ@Uw±U¯¦UŽ™Kmš¯I¯Žť¼ğĊ™@ǃŹÈ¯@Ý»ÇnˡJƒbÛèÇnƒ„ÅK¯„ġĠŹW¼Ålm„@¤n²ƒŽÝb@b„š¯lƒ¯@ƒšÅ¤W„™¼nV@x„„°@Vx„@lbUblbX¼W‚œšÇ²lšUŽ@¼ŽV¦@bÇlVxUbVxÞbVšœbm¦ƒVV„'] + ], + 'encodeOffsets': [ + [[ + 100452, + 39719 + ]], + [[ + 91980, + 35742 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': '6327', + 'properties': { + 'name': '玉树藏族自治州', + 'cp': [ + 93.5925, + 33.9368 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ɆÿĢV°°VÈklVôŤXÞW„ȮÇÞXnmÞnlaŤmĢLƐaĢƒôb„™ĊU„VlkǖKÜaœn°mĊUšVVkÈWV_ôKŎǚ@šz°ašbXyVI‚JĢwVX„a„KVbna°@VçVKXƒÜÞWšn@VVÆwXšĠƒÞ@Ŏ¯ƨġÆ@ȍ„LlmUaô»ÆkĊ±Xb„°`šÔV‚kȘƒĢ@Všk°šLlx@xż@Ċn„Çź»ôĢ²VÆ҄@@bÆÒXklV„KšV¥Æ™ČUšk‚l„nxl™çƒ¥ċç@±m¥ƒwÅJƒ@™™™Vƒ„mÈIléÈa°U¥™™@kÞV‚K²ÑWƒ°w²Ñ‚K²ñšyƐ„ÝšVmw„»kkWĉ—JWUƒVÅwƒL™mÅ@@ƒmw„kn¥Vу»°™°@@»„¯„Lla„JônV‚UůƒU@W¯Umѯ¯k@WykU@¯„wV¥ƒkVwţƒk»šwWǜĉĶçšK„ƒÞ™ÇaĉbƒI™lUƒ@kwƒWƒXUƒ°w™±@UšKn£Wĉ—KWxƒkĕVƒšamwXw™@™„Wmnk@aƒVkƒ™bĉLƒl™Imm„wUÇ‚Wx™nÝJn@¥Æ™kwƒaXƒÜĉ™¯ÅV¯¤mkƒx¯kķܙ²VWôŹVUƒƒ@V£™¥@ƒ°wn@™m@¯@UbUôķŽmn@ÆÛ@ÇýVaUÇĊVƒ@Çlğ—¯xÝŤ™lVÈÈVƒx„ƒ¤Vx™„kK@™@ƒx@„kVƒĖġ¥kIWbXŽŎx@nƒxÅUW`ƒ_—@±ŽUa™LUxƒK¯„WbkVlb—bmŽƒLÛÆWIUwƒWkwÝV@kI›ŽéUb›UUk™V¯Km¯k@Umݐ¯m¯›m—L›Þĉ‚ÛUm™ġ£UxkKm°™Lw›šk@kšƒVm„ƒKVUk›@¯a¯Ģ™móKUU™x™ImlÅn™™ÇbXèVVU„°„@ŽšŽ@„‚xXnmš™ššŽ@¼ğ°@²ÆxU‚„²šWÆb°š™š@¦llš™„XLmĬ@҃šÞô°@ȦUJÇaƒLóU¯š@°ġƴ@Ɓ@mɱJğ¼ǕššÒUzƧ‚m„n›mğ°ǫ¼knÇ@bġmmV—@VaUaƒLƒk™l@„kLW‚ō¦¯@ƒb™KUn™JĉIó`ċUÛb™wUw±ax›bñUmƒƒ@™„ƒ@—bƒaƒbǏÅXm˜„ƒÝ„ÅôVbގ™bl„UšÞVޚ„U‚°„VUxƒ@U„V„@l`™¼nL@Ċ„LW„„¤kXķWġXUVVVķ„UbVb@°kVVxÈa‚@ȦĊbšaźJ„U@Ț„„˜Vœƒlš@XkôaWƒĢ™Þ@laĸUÆb²mÞLĠ™ÞÑôbšÒĊa„JVbm¦'], + 'encodeOffsets': [[ + 93285, + 37030 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6326', + 'properties': { + 'name': '果洛藏族自治州', + 'cp': [ + 99.3823, + 34.0466 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ÞVŤ™ÈK@ĀlxV@„Þ@„wŎalmôLšnXÆÜ@nV‚°@œ„°WmVKŦLÆmȚԂҚUX¥l@ĢJVš@„ŽƾI@w™W°™™Ån¥›kÅÝVwôƒÈç„@lÑĊĕša„JnaÆLVw°kny°UnkÆVȍĊll¦„Vƾ@@™nUźƒÈǂIn°X„wÞKô¦VWV£„@£°ókċ±I™™am¯Va™»ČĉV¥°™@m„k„¥l@„Ċm@ašU™mwXƒ@wÆxšmĢ_„`VnÆbšKVw„@@ƒnUVğVmVVöIlŽl@@çÛmƒ£UDŽw°@VUƒ¯»m¯ƒJōĖÅLƒa@»ĉĢ±`U_k`ÇçšóƒkX™lK@ƒakÝރš£WċkÝ™kxƒJݯÅw™xķxmIÅx„@k±J@ýŋš›¤UœkŽmV™°ÅÝxkwmġƒnÝVU„š¦ƒŤlmšóXk¤™UKƒç™@mVkK@klīƒ£mš¯VUbƒW¯¼ċb¯ĵam¼mVX„m@k¤ÇX‚ÇbƒUƒ„¯J¯„¯È@˜™bVXVҙ¤V¼kxݚV„@l‚V—„WxÛ¦Wš¯šmKnlŽkŽ‚šU‚@nƑUĉ„Ý@ǺۄċUĉ¥™UƒÞŏ™z±òL±Ò¯xX„±ÒLÝU@lššV¦¯‚ÇbkêÇJƒnU„šš@š„‚ÆI„xn¦‚‚@²Č脦‚è'], + 'encodeOffsets': [[ + 99709, + 36130 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6325', + 'properties': { + 'name': '海南藏族自治州', + 'cp': [ + 100.3711, + 35.9418 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VxƒŽńƒš@ĊĠŽĊXÒ°UƾĕÞm°£nb@‚@LUUW„Ûº@nlÆǬšĠ£ÞV°UXb‚VȂǵ„éƒ@kWanm°@™x„z„K°¯ĠVšƒVƒkw™Lnm°kÞxÆa„¥@‚wnĉƏ@™œ_l›š_VwšmĸèŤÅČU@™˜Wn@ÑmKU™nğƒK@ƒ°¯UÿV£nmšLl™„UƒUÛé±óókkmƒnƒakV@Ç°óÝXƒWəÞťIţxmm™VÛUVȂÓnWyȁĉkƒVš°WnkĊa„¥‚_œK°ÿWna@ƒmU¯wƒlÝIU¤UXó¥ÝLƒx¯WmJÇÈŹ„mV@šƽ@ƒUk¥ĉkċŽÅUml¯Vmz¯lUxÅKmbƒI™bĉĖk҃@Çèó„UxÆޜlm¦šÆ¯ššX@x™Ž@Ž„²ÝlƒÈ™JV²klVl¯ÔlšĉƙްlUǖÞ@ššĶ¼nŽUôôŚ'], + 'encodeOffsets': [[ + 101712, + 37632 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6322', + 'properties': { + 'name': '海北藏族自治州', + 'cp': [ + 100.3711, + 37.9138 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ōmġxƽUm±Lǿþġԙ@kxmWƒb¯I¯‚mIUx@bƒbŹVǎƒkĵbƒlĉI¯¥ƒUšm@ƒÆ¯È@šašóšUlƒČ»@w›œ»›wXaƒƒó°ţç݄kUƒaV¥ÅbÝw¯lmnšKlxU„™„ğU¯°ƒLƒyšw¯@mnXb‚l„@ƒêȁǶUWa¯VÝUğ¤ǫ™kÅ@mܹXƒVV@K@ma¯¤ÝnƽĖ¯V@„ƒ¼„ôlèk¼„¦˜xXŽlbnKšÆx@Ž™bUx@nnxWJţ¦ƒmƒ¼ñ@Ž°¦lUÞlÈ@ĠxÞUlxÒó„ƒl¯bmI™ŽÝVÛaÝnƒxVbkbÇwřÇKn±K™b„šƒb@V„xšLmŽÛŽŻbk„ƒVó@™šŹxó²›Wkb™@¯U¤ƒźĊ@lUX„°lÆôU„ƒlLX‚aœV°wšxUb°xÜôÈKVkÈmlwškÈKšwšK™™VUŤĉŎ»„»„Il¥na°LV»²¯Üy@wĢƒ°ĸwlwĢw°±„_lVkš@°ƒbƒÆ¯zƒ‚„š„@l_„@Ģ±lŚVlUaރ„LVƒnKlnȏ°IllČa˜wÞÑ°x„UU™@wƒVkmĠLô»„KÞýôaÞ¥ôĀÞmƁ„™‚mUƒŎV¥Èl°²°a²¥V„@@w„amm@Ñn@Æ£żƒVƒĠ£@W„¯Þƒšl@š»@Uk@'], + 'encodeOffsets': [[ + 105087, + 37992 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6323', + 'properties': { + 'name': '黄南藏族自治州', + 'cp': [ + 101.5686, + 35.1178 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ôl²ôÜê„VƒVkš™KmnU¤VĀ¯°@„„LmĠVšnLÈL@alb@al@n°Vš_XmWUÈamaVIn@n‚aV£œóVWƒ™U£°ašxÈ¥@™‚aĊwȹ@óša™ƒğbm@k„w@mƒaÆw@ƒ„In¯mmƒ@UkkWƒÑÅ@@kċÅçVkÝJÅkVykŹl¥@¯š™ĢU܃X¥òý—mmX™ÝÅlmU@£™Wly™XW»Åbƒl@aI›»k@klm@UxUUƒVƒ¼¯Xƒl™aUnķ‚ƒI@x™@¯„ƒK™„ĉUU`óšlČ¯ô@¤ƒÞJ„k°xVŽ„n@ŽmbXŽ¯Ā›L`ƒ¦ĉbml¯X™ŽUŽl„ȂĊXzm‚ȁÔU‚ÜVšUnnŤwŦJɚ݄XÞW¯ô@ÈlU„b„mln'], + 'encodeOffsets': [[ + 103984, + 36344 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6321', + 'properties': { + 'name': '海东地区', + 'cp': [ + 102.3706, + 36.2988 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@҄bš¤ÆI°ôU¼š°UŽnnWx™š@b¯L@lUUWbXxWl„ƨnxVUllš„XVŽUŽnL@lȀý²KVnƾ‚ĢwV»ƒ@mÞ£nÆƒÞÑmL™ƒKUaVżĕƒWVk²ƒƒÆÝ@ƒXw°@„ô™@a°wóUUmIk™™aVmÞwmknyƒ¹VÿƧnŏm£X»˜™naV±„Ýw@ašb@aƒm¯„ĉVó¦kÝWKUU@WanU™b@ôǺĉxb@šÇ¦™w¯bV¤„šUX›ôU¤bmm@UJnbÇbXVWn™`¯Umk@@bka@bÇK'], + 'encodeOffsets': [[ + 104108, + 37030 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6301', + 'properties': { + 'name': '西宁市', + 'cp': [ + 101.4038, + 36.8207 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@kmKVUƒWk™VkUmwƒƧXkWwXaVV@k°K@aš™XwmmV™¯V»¯óÅJ™£ƒamŽ—X@šċVţÆķç™nUx™`kœ›`@šÅmĊx@Žƒ¦U¦„blVރŤèô¯„„Wbœx›¼œŽ@xċ¼k„™V™ô™bÇ@Å°@„™n„V°¦ĊJ„kĶa„lȍźU„a@aVwnJ°°J„anXlwš@ĢÓ'], + 'encodeOffsets': [[ + 104356, + 38042 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/shang_hai_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '310230', + 'properties': { + 'name': '崇明县', + 'cp': [ + 121.5637, + 31.5383 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@uŏu»GPIV±ÐɃŜ{\\qJmC[W\\t„¾ÕjÕp‡nα|ěÔe`²„ †nZzZ~V|B^IpUbU†{bs\\a\\OvQ’Kªs†Mň£RAhQĤ‹lA`GĂA@ĥWĝO“'], + 'encodeOffsets': [[ + 124908, + 32105 + ]] + } + }, + { + 'type': 'Feature', + 'id': '310119', + 'properties': { + 'name': '南汇区', + 'cp': [ + 121.8755, + 30.954 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@`y”ĉNǕDwǏ»ƒÖLxCdJ`HB@LBTD@CPFXANC@@PGBKNECCBB@EBFHEDDDSNKAUNBDMNqf[HcDCCcF…@EFGLEBa@ACoCCDDD@LGHD@DJFBBJED@BGAEGGFKIGDBDLBAD@FHBEF@RFDMLE@SGANFFJBANPH@@E@FJjRIACDMDOEKLFD@DbDAJI@AP@BGHFBCBGDCC@DCA@CECGH@FKCEHFJGBFDIHACEDNJDCVFBDCRKRLDLITB@CjNJI^DBCfNVDHDFKHAFGDIICDWBIF@@CFAjFJNJBBHD@CJ@AEFJ@@DH@BFBCPDBMFEQGDIFCNDHIP@HDABFACBJFHEBSZC@DP@@JDBƤ~'], + 'encodeOffsets': [[ + 124854, + 31907 + ]] + } + }, + { + 'type': 'Feature', + 'id': '310120', + 'properties': { + 'name': '奉贤区', + 'cp': [ + 121.5747, + 30.8475 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@~T~JjZdDbLXDLCB_J@@FHFZJJIAGH@HGR@BENBLID@@LFCDF\\FpDBDb@FAHKFE†@dEDDdC\\GreNMACVMLBTMCCFCEGFAA@DAFDLMHA@OD@BMEWDOC@AS@KGAI_DcKw„ÕísƝ‘åĆctKbMBQ@EGEBEJ@@MBKL@BJB@FIBGKE@ABG@@FMFCPL@AjCD@ZOFCJIDICIlKJHNGJALH@@FPDCTJDGDBNCn'], + 'encodeOffsets': [[ + 124274, + 31722 + ]] + } + }, + { + 'type': 'Feature', + 'id': '310115', + 'properties': { + 'name': '浦东新区', + 'cp': [ + 121.6928, + 31.2561 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@EN@JJLNHjLJNR^GRYVBNZJRBV@PDvbLNDN@LGNER@nCNQNuT_TIVFV\\Z\\XnDrI|[Ʉś²ÏJUHOƣ}CA@IO@@CYDATGFIEDAEBBAGCO@GJMCEDCJRHEFANOCADAEG@@CI@FE@BDIC@AGIAIMiEEB@DE@AJCXJDCJEHGBELGCUCeMAD]CIJiM@DSAKJKCLQDQACUECDMIFCBDJGECHAEIWCK@GLMCCGEACNKCEJG@MMBMC@@CIJUINT@JAJSTEPZZCP'], + 'encodeOffsets': [[ + 124383, + 31915 + ]] + } + }, + { + 'type': 'Feature', + 'id': '310116', + 'properties': { + 'name': '金山区', + 'cp': [ + 121.2657, + 30.8112 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@L@BIHFN@@EE@@EFBDGDAADVDD@@EF@CA@IIsRE@GDAF@BF@CV@|FBCHBLCNHAFCADBMDCFZXHILBVEEQA@MWFARJJ@DCX@@TEFBLHAAERE@AJABRPBNK\\BrJ\\VHGND@CNADKDADQjGAGNC@GJ@FCFFHC@JF@@dLBDSFADHVG\\DTEPDDHJALIJkJDJCDIPE@YDCBiK@DONE@EH@BAF@HLJA@EIA@ALKNA@@FIFAFHR@NALadsæąyQY@ƒA±DʼnXUVI^BF@FFF@HBJEDFFGFEBSRkVEXGHFBMFIVW@GAEEFOIAIPKABGWEKFSCQLQBSEIBC\\FdBLRR@JGACFDDEF@AWB@LJJYNABBA@CUEGPaO_AIE@MYMFIGAEFECHSAAKAO\\[JEDB@E@MMA@@AGBKMGDFFCDDFEDFJF@NPBAFLHFH@EDDHBADDC@DDCDHHCDDFDABDAD@FEFOBCJ[D@HEDDNJBDDHABJIBBvGLBJAH'], + 'encodeOffsets': [[ + 123901, + 31695 + ]] + } + }, + { + 'type': 'Feature', + 'id': '310118', + 'properties': { + 'name': '青浦区', + 'cp': [ + 121.1751, + 31.1909 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@RUNKdOFDJCbRFMLAHPLDN@JGL@@APBWYCKN@TU@SHGCEJIDIJKVIZVNM`iNY@CIE@CA@KBOEGEUFCCSADEIEFCDDDIDDHC@CKIeDCG@IG@DHWFEEGCH@@GO@@O]CNpeEQDBFME[JC]DGF@CKOA@QSB@GB@@GW@@ED@AQIJIAAFE@@DO@CFI@KNG@CDACAFEGKGBEGBDCCAIFCCLIECFI@MBCLDHGNAHSF@DMB@EEKBA@@C]DEICFG@ADBHGFKCDAKKHKD@@FHGAANGEEFCHKCECBCKG@ADKCNE\\[A[I@@mGBDQQEO@BCE@AI[AML@JGACLOAFKEMM@EQKC@CUCBCCBCHEA@FF@@FM@GEAJK@GNF@EXPH@FD@M^@HIADJCFDBER@DK@@DE@CAKFOCCBDHIBCNSB@GFC@GQEEOWFICGDUAEJIDBTAHJHEB@DIF@NE@H|HBDBEH@DKBAHEF@HEEUB@FGFGCCCE@AHOB@NH@PRLVNNFBX@RC€PbAvMtBfH@DJF@ELBFA@EH@HNED@FFB@HLC@CJ@@DJ@PIRf@HE@CFF@GPHD@DKE@FFBEFFD@DEFCA@DD@IjCRFBAHFDKD@HF@@PM@H@BlbDJDBFEF@DLXB@HCD@@IFCBIFEJD@FDC@FBALLF@PAACJERACAJCBD@EL@JD'], + 'encodeOffsets': [[ + 124061, + 32028 + ]] + } + }, + { + 'type': 'Feature', + 'id': '310117', + 'properties': { + 'name': '松江区', + 'cp': [ + 121.1984, + 31.0268 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@DLDFRN@FNELPBDKHB@INK\\BBJF@ADP@RFCRHA@nJ@B\\[\\MFLDBCH@DLDADFGLEDFFMHBBGH@EC@GLLLCBLDHEAGBCH@DEFJ^C@DB@LAFFA@CNE@GTMBGHKCAD@NEJFDKJDDJEDBCDHAAFLHFHBEBDDCH@LMJ@DEP@@CF@BEJBJIBRC@@FX@@HA@@HTA@RPBDLE@CHD^\\INFAERCfFMo^D@PP@@HG@HDFFXECGH@@JDHfCLJ@DGDCCCJCCEDJFCFTBDDVEHFPFLAB@NBFCFKFC@CHIACNOHWHCAAFIDD@CDAGEI@ACFMF@R@R_@GQED@EGFEQEDE_IAHKAEXCQUOQCUDEN@ZI\\DDmAMHCICDSOC@EG@BKHIGMIBCGOCSF[CUHCGEBCTKA@cE@@IGDEEEDI@@HMDBHiHCRCBCLMB@DMCGH[UqI[AMLOAAQIB@BQFBFGBAKFE@SW@CDI@QIEBNXB@FRUFKAGJYWDENCCADBBEMGKDGAAD{EU@@DAEE@CB@HQFJt@JDBE@@FC@'], + 'encodeOffsets': [[ + 123933, + 31687 + ]] + } + }, + { + 'type': 'Feature', + 'id': '310114', + 'properties': { + 'name': '嘉定区', + 'cp': [ + 121.2437, + 31.3625 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@F@LI@IDKJADKIEJICADGACFECCJ@HKCAFOHAJI@aCBEE@ICAEB[GFGCKL@FGEIFADMLCAEJM@ELQECEIG@BE^QKKLQCA@EHBIGQ[GEHOMGGDHKH@JOECFCjCBEFDNCACMBCILGTABDLEEOEIG@GFIMM@CGKFBFCDE@@GEAGEEACIcGaHMFITIHDN[AKF@FS@OA@BK@IHM@KCGOKBENaQIDECcPMLQVFHFB@BFBKLGD@FAJOVGIACQ@A`LPCB@JEF@RU@ANS@@RCL\\HIFpRBFRBBDKLLDADJDGBFDABHBEDNF@DGBBBADKDAHC@\\JJFBDEH[DEFDH\\LX@XLBLbT@DNJLDCEL@VJABJNDHB@HBHYFBAA@GNFB@@AFB@AFABFLFBHFCL@HJBAFBLC@DN@HN'], + 'encodeOffsets': [[ + 124213, + 32254 + ]] + } + }, + { + 'type': 'Feature', + 'id': '310113', + 'properties': { + 'name': '宝山区', + 'cp': [ + 121.4346, + 31.4051 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ˆmÖoÖiƒ½[s[YEUJU`SCIEBCCWJY_LIICDWU@@FaBCJIB[ICH[@@CDKEE@MK@@IMCAEBCH@AMFI@SMGEFGB@FK@BHCAIFJNQD@FEBDFMBKGACG@ECWH@@CDDTOEEBGEK@GC@EE@GPHFR\\JHGA@FDBKRLL]RAFH@FJFDKR@FINBFKDCNEBFJEHK@DLEH\\HFADB@JFFDA@bIJGBEPDBGLI@DDEFBDCHDBIJJFCLIBCL@JKJE@ADHDBHJ@HIBBDFHBBAEIJ@BJFAVL¢ˆ'], + 'encodeOffsets': [[ + 124300, + 32302 + ]] + } + }, + { + 'type': 'Feature', + 'id': '310112', + 'properties': { + 'name': '闵行区', + 'cp': [ + 121.4992, + 31.0838 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@T@@ELE\\BCMJGJSNEbGdHDJFBJAFIEIFCEWG@@gMENSFCVJFAxR~B@IH@AIiI@GE@FGEAFQPDRiV[\\DFSGMHAXHDOMCJCDETBBNVJJI@DD@ANNNH@FILDDMFBDHNDHKL@XDFGLD@EHGFD@DDB@CDDHCDAEAHG@ABOJ@BIaC@CECLKPFNCDCJBiQEIF@@@OGBMIAEEBMTHF@NKEC@QFEGA@EBCKAACHCLJHEFHHB@AFCAIEACIC@HG@KCCDC[ECEED@KC@KJMAAFQ@GHG@BHIJYIGE@EI@A`KDWCaKcCiY}I}S[CYJM@CFDVPRRVWDFžLBBG`JCFRFEFFHC@RF@HQ`Q@E@ENBDJ@HFCB@DCCEJBBGDGXMPBDGJ@DEDELEDMA@DJF@DMZ_jMNYUUJILCJIJDFGH@TSVM@DLXZ'], + 'encodeOffsets': [[ + 124165, + 32010 + ]] + } + }, + { + 'type': 'Feature', + 'id': '310110', + 'properties': { + 'name': '杨浦区', + 'cp': [ + 121.528, + 31.2966 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@V@CXJDKJZ`XIDDFADJvSRMDM@mFQHM@KCMKMuaOCU@BDAJSX@HKJGD@PNJCJWAGT@R'], + 'encodeOffsets': [[ + 124402, + 32064 + ]] + } + }, + { + 'type': 'Feature', + 'id': '310107', + 'properties': { + 'name': '普陀区', + 'cp': [ + 121.3879, + 31.2602 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@F@@FHDL@HFFAPFCSDC@@XGFDH@BDLHNACEFA@ERCIMJEDBAGL@@EHAFENHHJ\\ONQBQCIBC[MKACKI@GGGH@I_G@CW@[DMHCDIBMTDHN@JNHEH@FJFPKFACSBKHDJNABDMDECAFiDEDFDIPG@GLHCNH'], + 'encodeOffsets': [[ + 124248, + 32045 + ]] + } + }, + { + 'type': 'Feature', + 'id': '310104', + 'properties': { + 'name': '徐汇区', + 'cp': [ + 121.4333, + 31.1607 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@RADL\\NCPHFfLJaJ@FWLGMGIK@IFMDOYYFOTSBI@IMSAMSACFIDNDCPWGGBHNET[CU\\QjOCERFBEHF@@HjJBJG@@J'], + 'encodeOffsets': [[ + 124327, + 31941 + ]] + } + }, + { + 'type': 'Feature', + 'id': '310105', + 'properties': { + 'name': '长宁区', + 'cp': [ + 121.3852, + 31.2115 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@HFFB@HF@DCAELENSJADCNG\\CX@@D`H@JHGHHJ@BINBFUGEDO[MCKQB}AwQEBUIEDMTNF@hH@FXEDFJEJIB'], + 'encodeOffsets': [[ + 124250, + 31987 + ]] + } + }, + { + 'type': 'Feature', + 'id': '310108', + 'properties': { + 'name': '闸北区', + 'cp': [ + 121.4511, + 31.2794 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@CSG@BQGODUPWTOBQAAFMECKBGEMFKEOHADDJARMR[PGI@TEJBNG@ADBFND@JL@@NFFCL@D\\@DG\\JJADI'], + 'encodeOffsets': [[ + 124385, + 32068 + ]] + } + }, + { + 'type': 'Feature', + 'id': '310109', + 'properties': { + 'name': '虹口区', + 'cp': [ + 121.4882, + 31.2788 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@bA@E@QHSXBDIMI@OHCLI@GTWBIACQAYIOFGCENBBARSPOXCVHPARH@DT'], + 'encodeOffsets': [[ + 124385, + 32068 + ]] + } + }, + { + 'type': 'Feature', + 'id': '310101', + 'properties': { + 'name': '黄浦区', + 'cp': [ + 121.4868, + 31.219 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@NEHFLAFDHDPEAMZUHQQ]IMKJG@EPERABHBGRUCCNGV'], + 'encodeOffsets': [[ + 124379, + 31992 + ]] + } + }, + { + 'type': 'Feature', + 'id': '310103', + 'properties': { + 'name': '卢湾区', + 'cp': [ + 121.4758, + 31.2074 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VDHQGABAFQFOH@LIiKKHEXI@IbAFZB'], + 'encodeOffsets': [[ + 124385, + 31974 + ]] + } + }, + { + 'type': 'Feature', + 'id': '310106', + 'properties': { + 'name': '静安区', + 'cp': [ + 121.4484, + 31.2286 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@DLLB\\NPGLFHUDMYABEeKEVMAAJ'], + 'encodeOffsets': [[ + 124343, + 31979 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/shan_dong_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '3706', + 'properties': { + 'name': '烟台市', + 'cp': [ + 120.7397, + 37.5128 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ŤLšLllVń²è°xżĢĠÆl҄šŤbœ„V¤ĊXnŽlĢVĊ„Òš„È°ĊŰÞè˜L„±@џn»VUźċ²»ÆkôVɆkĊŃ²kŤVVwUUVmUaƒ@KkU@ƒmUmmk@UwUkmW@UVIXa@ƒmw@a™KULƒaƒx@Uk@UbWU@yULmK¯@kXƒVUwm@@JUUknWKUVƒLUbU@™wWykIƒa@w@mUI@ašUVynIWa„k„@@W„bl@@knmƒK@wnIl™°Kna@V¥ğ@ġUķ»™¥@UōJƒX¯¤k@™wmI¯‚k@mwƒak@@šlX@bUJ@VƒbknWxkLkxlŽšLVlkLmŽšb@bU@ƒbU@VbU`Vb@n„L@Žmb—U@˜VnUVmnU@mm™@kIUWVIUK›VkkUJUnmL@VmLUaVWaXamU@™™U@KUUmVƒU—JƒU™VÇwğn™mƒ@mXĉV@l¯xnô'], + 'encodeOffsets': [[ + 122446, + 38042 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3713', + 'properties': { + 'name': '临沂市', + 'cp': [ + 118.3118, + 35.2936 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@˜bXlƒl@zlV@lXXmŽkbVVlš„U@Vn@@Vmb@XšKšVX„WJ@XXl@„‚ŽÈbVLšUl`„@XXV@VVUxVbUxVbš¦„@‚WnXVJ@bnVUzl@„°Æx„U„KlU@mUUnUlUVWVUnVV@XX°V@Všll@Vk„aXVl@Ux@bmbXLlKlb@b@bUJn@@„„b@n°x°K@an@@UlLVKVbXb@bVVnK°LVa@UVa@™Xw‚KVxnLšU°@naV@UWUkWƒULmV—wÝKUUla@aó_@mƒK@aUU@ƒWUkwVm@aVI°W„@@IUw@a±¯@¥kUVUm@a‚wkw™@ƒK@kVKk@maXalI@alL„WXblaVLVU„V@LnKš@„l@w˜aXašLlnUl„LšmV@n°J@_VmnIVym£UKmI@WnIVm@anUVmÇ_kġIÅWUXÇm@U@ݯÅ@ƒ™@naWƒ™IVW@IkK@klKn@naWIƒmk@ƒaƒbkKkLWn™WkLWmk_ƒ@UaVƒUKmLUw@mn£WwUmU™ƒaóV@UkUm@UKULUwmJUX@WW@XҙzVblJXŽWXk@UVWK—X‚¤UL@xU@ƒ@ƒVUaU@@XmVkLmWkXUyÝLmKXnVŽ@n@l™x@bWLnVVn™`knULmxUl„„WLXŽVb@VƒK@z¯x¯¼Wx™KUn@bk@ƒlƒVVVz'], + 'encodeOffsets': [[ + 120241, + 36119 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3707', + 'properties': { + 'name': '潍坊市', + 'cp': [ + 119.0918, + 36.524 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@l@@UšK@Ž@L@bX@@VlL@JƒLUVnX@`ÜXn`V²mJ@bU@@n„b@l°xnnĸVƚ°@„ƒĊ£Þ@lWnÑnkʶJmó°w@kk»V@»ƒ¥k@V@kw@wVm„a˜Å„mšaô£ŎƒXI@mln„Kla@mV_UKƒ@kUkw@alW™IU»™mƒ—@WUIl±UUÅU›bkJƒ@a@wUKUaVIÆmXIWaka@m@Ul£XKVw@ƒUIƒJUkmJ™ƒVkU@a„ƒWK—ImVƒ@UxmL@bX`WXU@U`ÇkUak@@°UblXk‚mLUKmL@VULóƒƒVk@@Vlbn@Ub@ċaUJUbƒIUlVLUVVbVKX„VlVXU@mb¯@™VmKUwLWx@šUb@VUb¯KmLUU@aWaUaULkK@Vm@@b¯L¯w@mƒa@ƒm@UUU@U¦lJUXƒVƒmkb@nm„XVWŽkb™IVxUV@VUbWLXVƒLW`Ux@nk@Vn@x@VkJ@œV`mXkŽ@V„xV@lVššI@VULš˜VU„IV`°bVXXx„V@VWVnL@xV„Ub'], + 'encodeOffsets': [[ + 121332, + 37840 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3702', + 'properties': { + 'name': '青岛市', + 'cp': [ + 120.4651, + 36.3373 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„@nU˜JXLƒ„@blVU‚š„nIVl„IVJ@„UxWLk¤@V@nlbXbWJÅnUJVbVL@x@b„ŽlIœaÆVVVk²VJ@X„˜šnV¼šJkX@blxlV„@VLU`@nkbƒLkm@nWJō„ó¤™bƒn—ƃbUn@xlxU@l@„¦@¼UŽl¼ĊUnW„@šnĠmÈxšU„V˜I„VnUVV@LšV@šnVWbXb‚UVbnK@UnKVmVIllœUVLUJVXlJš@nnV@nmVUUm@—˜Vna@ƒK@mUaV_UaV@„aV@@a™anlKUk™KklwlKXwlm„a@UVI@akW@™l@„bnxl@°nJšxl@°£„WŎIUÑn»lašmô¹Ŏ¥VaUUkƒmkġWɱIUUŹ`›@kk@ĉƨřV¥_Ç@™Ĭƒ¤ÝL¯m¯£ƽóķwUW±ī¯kōaĉĕ™kğmó°ƒbW@UKkLUaƒVmz@V@ŽUxVn'], + 'encodeOffsets': [[ + 122389, + 36580 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3717', + 'properties': { + 'name': '菏泽市', + 'cp': [ + 115.6201, + 35.2057 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@¥šIVUÈmÞ»@UlU@Un@VW@UVmkk@aVUUKVÝ@UVknK@UV@VVnIVƒ@wnƒmwmKXaWaXI@UV@Vy²blkVKkam™U@kb@Um@VmUkmƒKmkXKWwkU@Ulƒ@UnK@UVUUm‚KXwšUVL„w‚K„U„@@Wl@@wUkV¥—@@I@W@_V@VWUw@UUa@aƒaWa—@@_mKUw™l¯amzmV—@WK™nU@kƒWLķaUKbÝVmV@UWÇbÛ@ƒX™°UbW@XŽm„Vlk²UJUbmLÇxÅWUzl‚¯Ll„@VkK™XUbWJ@bU@¯@™ƒkbƒLmKka™„@l™_WšXºVbUz@J‚n²V@¤lX„Ž„nV°šLn`WbXLôVlKVUšxXn˜lXLlU@bVV@„XJWLUVnVV@„„@n‚l„°nn‚V„KÈbVXÆJU°VnXV„kV@@xVL„@šWlb'], + 'encodeOffsets': [[ + 118654, + 36726 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3708', + 'properties': { + 'name': '济宁市', + 'cp': [ + 116.8286, + 35.3375 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nam_nKlVLXa„Il`š_@KVVXI@m@w‚ƒ„@@k@Kšnô@n`VbV@@L„L@KVVn@VX@‚VL„Jl„š@VUUƒU@Uam@Uk„wšKWaXamkJmIUVUÈblašUnV@kVKl@@lXL°kVJ@VÈnVJUX@V‚LXl@xVLnU‚@VK„V@a„IUaV@„bĊU„x„K‚kVJXUlV„ƒ„UVašI@WUI@KlUnw„mWk@WXIWƒ™U™L@Wna@Um@@UƒVk™UUlanWW@kkU@y„kWk—aWVUlÝbUU@kƒJUIU@@ƒ™JmaókƒLKǃUUkKWLk@WbkUUaƒbmKn¯°¥V@XwV@VanaVaU_@Wlk@WÈ@VUÈVVۂm„aklKȯlLVUX@lK@aX@@kV@VmV@VwnJV_UWUwƒX™am@kW@wVUkKVIUUVmU@UV@IVK@aUL@aƒV@Lm„UKmx@ŽômLkUWJ@šnXmlUxUL@Vkn›VUšU„@V™L™`Ub±LkV@kUKÇbÛ@ƒU™Wó_mJƒ@Wk@@Xƒ@ƒVLƒxUK™VWxLVnUV@VmL@Vk„@VlVXxWLnl‚Ln„VlUnn@@VlaV@nšlbULkl±aUzU@@VWJXbWbnLnxm„@xU„mJUUU@@VmLUl@VUÞVLUV@bllUn@VUXm@@VkV@VݼÇnUV™J@¦nnƒlnVlL@„Þb°KVV'], + 'encodeOffsets': [[ + 118834, + 36844 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3714', + 'properties': { + 'name': '德州市', + 'cp': [ + 116.6858, + 37.2107 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„¤@VmbVXnVVbVJššX@Žll@z„lVInl@„@bVxUbĠ‚l@Èbla„IšxXVWb@L™@n‚ULWVXXšWWLnL@`@LUVVL@lVn„JšU@UUk‚a„™nš‚Vôô„b°¼V‚ސXš˜‚œIÜbČa˜bôW„XÞWÈzÆmnLVJ°ÈnlV²lbnW@™@UƒUV™šmnwmkkKWƒkla@mVIUKUa™aUwmn™JU@@amIk@@bVlkX@mmUklUUƒƒa@_UaUUƒV@wƒw™WkXmW@I@WUaÝU@UXaWUU@UUVW@UUUWUn¥nUVa@m@k@alU@wk™LWa@UUm@@wnmU™wla@anKn_@alK@ݙ_ƒ@@WUUUmlkaƒIƒyU@UwU_Wa¯yU_mWUwkImm@InWWUk@@UVWV—kW¯U@VƒL@b¯b@l±¦@šVV@lUbV„@škxVnUšl¼XV@b@lV@nIWxnbƒ‚™@UU™LƒxÅxm¯ƒaUƒ™wU@mUÅVÝKULm@bmKUXó@'], + 'encodeOffsets': [[ + 118542, + 37801 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3716', + 'properties': { + 'name': '滨州市', + 'cp': [ + 117.8174, + 37.4963 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Vb@`„bV„kVlnV@nlWUk@al@nJ@bV@šInmVxšbVbVLUJ@nkb‚lX„lLnlmx™nUš„V@V@šmXn˜lbĸ@nnVx‚b@lnXV@UJ@nVxšxnxVbÆVn¯ƒĕ‚@@wÈçUÇlķVIœb‚@„Çmk@¥k@UkUK@aWakUóJW_UW@wkkWK@U@Kš@XUƒƒUkmUUalKXala@U@kkWlkÈl@kšV„mVIVmU_‚a„ƒƒwnwVW@wƒwUƒ@wU£ƒwkJWIyUI±bk‚VUJ@nmV™Ukl„Xmx@lnbW„kVƒUkLWŽƒxkKUUmUkb™J±—LÇxUKmkUmkkW™™a„mUaVkšJÆ_²KĠ@U„W@w„U‚¥nUWwK@aÝUkÅVaVK@akLWƒƒƒ¯I@bnbVx¯JW„ñšWbUL@šƒŽnV@VmbkUUV@IÇak@@bWak@WJUœJWL@bXV@„‚@„V„Jlb@zUlUŽUImšnbV‚mz@°UV@V™bV@@V@L@xLmKUnmJVX„J@VkLW@UVUL@b'], + 'encodeOffsets': [[ + 120083, + 38442 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3715', + 'properties': { + 'name': '聊城市', + 'cp': [ + 115.9167, + 36.4032 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ô@VWnL‚an@VKÞLÆUnVV@šxV„„bn°Æw„wšKVVš@„maXwmJU@@k@aWUk»V™Umlw@™UƒVa@kUU@™²¥@k°a@a„K@U›ƒU@mmm@ów—ѱ¥¯@@w™Kmw—I›¥kU¯UmakJmIUaƒVkKUkm@VUUa™Uƒ@UaƒKUK¯@™w™UVŽUIUKVw™k™¥™wƒbVŽ@xn„@lWnXxlL@`„XlJX¦l°XxW¦@¦Ul™n@Ž™@@Um@@VXVmx@¯bllUnUJ@VULVn@b„xV‚VL@b„„VlnVVblV„ÈnVlIVJœLô„lJ@xl²„'], + 'encodeOffsets': [[ + 118542, + 37801 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3705', + 'properties': { + 'name': '东营市', + 'cp': [ + 118.7073, + 37.5513 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ͬUǪlô@°Uœw°ōĠ¯š»Ģ炻XÇ@w™wƑa™ÇƒkwVƑ¯@řķUmm¯w@kƒa@mV@@anIU±m_ÛW@_mWVU„K@IkK@UW@@a@K@™L@Vk@±U@UV@lm@mUU@kLm„„xV¤@xV„„x@xUXmx„xƒ„bV`UnUJƒn™U@lÇkkllX@l@VkbWbkLVbnVVl„„WV™@@L@VXLll@xVXX`ôIlVXb@bVLVll@@¦nlƒÈ@›aUJkĸVÈÇè@x'], + 'encodeOffsets': [[ + 121005, + 39066 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3701', + 'properties': { + 'name': '济南市', + 'cp': [ + 117.1582, + 36.8701 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@²¦˜Òôxn@nn‚@V‚œ„°VlXU˜UX@Vl@XVmX@JnnlJVxnXV`°zXbV`VxV@„z„JlbkŽVnVV@X„@š`@ÞkL@bm`mL@bkbšxnVm@xn@VV‚@XbšKl@xkV@b@l@nUbmVm¦XVVV@VUXVVV@XVWb@VÞVVb@X@JnXlWšX„x@x„UVV@aVKVUX@lK@UƒIUWnIVmnL‚K@w@K@UU@ša@UVU@¯nyUman™VJVVk@ykaƒIƒU@@ƒWU@aXK‚IV›XIl@Xb@al@Èb@JVUlVna@UmU„@™VKXaò™Xƒ°IUwma@aU@UU@wVW@фw@a™I±`kbƒUkw™UmJ@UkmÇUUkmKknUVƒ@mJUkaWkƒa@KmKkUƒLmyXa¯_@WmImmbƒLmUkVUbUVƒJ™bƒUkkWJkUƒl™IUm™k™Lƒ›„lK@knaVmkI@mWaƒLUK™UU@@VmLUVLWK@UUUƒWUkkVmx@„Vl™¦'], + 'encodeOffsets': [[ + 119014, + 37041 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3709', + 'properties': { + 'name': '泰安市', + 'cp': [ + 117.0264, + 36.0516 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@n¼šŽW„nxšL@x°@š¥Uk@ƒnwlUVl„XVV@VXL‚KVUnK@UV@šVVL„KXb@nlJUnmb@lkLƒ‚„œšKšlVnšJ„klVXIll„Vša„IVUValUnV„K‚annnJ@X°`Wbnz„KlVnL‚Ž@L„bXl‚bVlnI„@VUU@UmVƒ@U@Uš¥@VmV@@_Ua@m°@@ƒ„kmUUm@UVmn@nX‚@@a„anJVUVL„mlIVJn@nkVLVa@KVmVLXVVLš@@U°bn@VaV@@K@aVkœbWaXUVymU@aUImWXƒ@™¥UaVwUaVwUUU@WWƒ@k_™VUKÇa@ƒƒnmxkV@LVJ@X™JUbƒVƒ„kUWVUIlƒLƒwĉVƒaU@VbƒJ@bƒUUL@mVUK@wWkK@UVWUIÇm@UUI¯lWK@kk@UL@lmU™VkbÇaUVVnJlIn‚WbXb™LƒxVln@VbV@V„UV™@kƒƒIUK@UWm@UU@LƒK@KU@Uam_ó@™m@L@lƒ@„@x@nWJUU@L™`k_ƒJWbUKkmLn`mb'], + 'encodeOffsets': [[ + 118834, + 36844 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3710', + 'properties': { + 'name': '威海市', + 'cp': [ + 121.9482, + 37.1393 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VbUnVVUxĊ¼š¼ô@Þф¯‚WǬLŎUÆW„¹Uǃō¯ÑƒÝkţ™™ţóġ™óL™ł̥U™wm¥kÝmkkKóbÝ@U¦@‚mb¯LkšmJ@x„Lmn@lk@ƒa@Xƒ@ƒlXbmJUz™V@bVJ@n@x„blJXzšxV@Va„KVUXLlmVV@In@Vx„UlW°@nLVK@zXVVal@@V„w„bVKšL@bnx@„WbUJ@VnXVlVxl@nnnV@„lV@L„‚'], + 'encodeOffsets': [[ + 124842, + 38312 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3711', + 'properties': { + 'name': '日照市', + 'cp': [ + 119.2786, + 35.5023 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@UaVUUKVk„JVaVIČb@Vam@ka@Ul@„Uô„VK@UnKVLnKlkWVa@¯l@VbÈlV_V@XWW_@anKVwUmVw@@Uny„UVblKVLX@„aô¯ó¥mÛĊÿÈ¥š™Þ¹lUīƒ¯Kĉ¼ʟbÇV™U™ŽUŽ™XmakJUnmV@bUnmJ@XnJVLn¤UzmJUn@`¯ImŽU@™nƒKVkkm™KWb—b@xƒk™@mL@KƒUUVUKkbWaƒXkK@bkJWbnbl@UL@l„Lš@lxx@b‚nUVlV@¦²°@bVx@Jƒ@¯XUJ@bUnlxVŽ„X@‚VV@b„L@nô`@bkbVVÞL˜xnU'], + 'encodeOffsets': [[ + 121883, + 36895 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3703', + 'properties': { + 'name': '淄博市', + 'cp': [ + 118.0371, + 36.6064 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nƒlKV@nVn@@kVU‚@²VVaUƒ@wmKXU@UƒUWwUW¯aU_ƒJUV™—VK@U™JU™@kUƒw@UlnWU_@›lI@U@wUml@@mVwX_„KWUXKVa@UVUUwšJlaXWUnƒ@mla„n„UVWkIV¥V@VVVI@a@akakLWKna@aVwk@WUƒbUlk@™k@U¯UWWU@mUUVUXkVmVVV@nkVƒLƒVÅwƒ¯k@WVXb›aUl@bV@@b@xkVVXVxkJ@nk@@ŽVLUlVb‚VXUVVUzV‚™LVbUbV„VWVkLmškJ@n±@UxU„VVkV@bƒx@ÒUX@xVVV@°J„„X„lK@bULUblÆÞV@b‚LXxmV¦ƒV@xƒXVŽğ@±LÅ`™IUlVbƒnšbXšllVnnlVLÈw˜K²ŽšIlanVVVlL„wXlK„VlUXƒma@knwƒWlkšVnU@mVIUl²aVJ‚zXJlI'], + 'encodeOffsets': [[ + 121129, + 37891 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3704', + 'properties': { + 'name': '枣庄市', + 'cp': [ + 117.323, + 34.8926 + ], + 'childNum': 2 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@‚yUU„U„kl@@aVmšLXw°»°w@y„L@UUaWXKƒƒVknwVKlmš_UmmUXK@ašw@k@mUWmUL@ƒ@™@£@KƒbÝV@akw™aULmƒƒbUK™LUU@lm@—°mL@nUJVxVXU`mIUxU@UnU@@lW@@bkLW@UVkKÇ°kLlŽƒbnUÜÇUUVÇ@@Xkl@XV`UbmbUbU@WxU@¯¦m°nL„aVblVXal@XKlLVVȄ‚L„KôlnbšI@„V@VJ„I@lVVÞaVkXU'], + 'encodeOffsets': [[ + 120241, + 36119 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3712', + 'properties': { + 'name': '莱芜市', + 'cp': [ + 117.6526, + 36.2714 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lmnLVlÈVln@VnIšVlx„Vla²_šJlUUUVƒVw²@@mlIn™lKXU‚UUƒVaUašKUVyUUWVUUaVkUK@l@@mlIUwUWlU@w@aU@@LU@Ubm@¯a@V™@UKWUUKUn@LUbUKmlm@UIkJƒnUKUVmIƒb@b@mWm@Un@VVnnVƒl@„¯@@nVb@`U@Un@Ž™¦@V@VU„VnV@'], + 'encodeOffsets': [[ + 120173, + 37334 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/shan_xi_1_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '6108', + 'properties': { + 'name': '榆林市', + 'cp': [ + 109.8743, + 38.205 + ], + 'childNum': 12 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@™ýVƒnIW»ƒW@»kUÇL—݃U¯¥ÇIUWWїUWwX¯mƒ@»n@ÜÈķô™@a±kȱƒw„ÑmwçċmU»ÆkkVyIm™ĉÿ@ƒÝ¹ƒWnwÇVš™Åaƒzmmĉ¦ó™kVmx™xU¼VškVm_UlVlk„°IV‚kmJa›¦k™™LmmV@XmKnšlUô›VXbƒbƒ@UaÇLğܙ™Åwƒ£mKnmċwÅ@UkƒbmaVƒƒƒn@m¯aU™Jm_k˜@kWXyl@@kÅamw™LU™Þ™ƒ™mWÅzUKƒš™Uk±@™b@nnK‚bX¤mzVšŽVxÇn„‚¯„@ÒknWƒƒVUbkķÈÑWkk@Va™™U@„mUkbƒÝÅ@Ý¥ÇbkĬ™XV`kLǍVmalUUa™nV±nwmkƒJ@Inƒ°KVw¯UnÅ@¥™ƒ™U±bUU˜±œmWbÛKWnUm`UƒVK@bmnœm‚Èż@V„L@xƒxmš„Ť°nŽ@VmK™²VlšlKk„ô@„êÜV@VXLlmš¦UššV°Ș¯²ÿ@¥š@ƁĊ˜²IšmĶnnb°b„KVƒĸLl„Þ@UȮš™Ü°IVƒÞÝސlŽœx@ŽķĀWŽ„Ux„èƐ@š°ŽXnšlĊĖ°m„nƒšV„²V°ÒƦ„aބ„˜@zll@bÞĀšlš¼nKĊ¼óȂb²±šIǪÒ¯ĖV@„lxnVlk„JlaXwŌĉ„„@VnŽššlÆĕ„UÆLœèŌŤôxȚlUœ@šxlaUċĕXm„IWmnkšVVƒ„VW_@aÈWUUmk@ƒ¯çVm»™±W¯n¥V™mkXw±ÇVwƒ'], + 'encodeOffsets': [[ + 113592, + 39645 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6106', + 'properties': { + 'name': '延安市', + 'cp': [ + 109.1052, + 36.4252 + ], + 'childNum': 13 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@kkÇmIšmUwVkUƒƒU²WmšVkm@m`mIĢĕUƒVa@™mXƒƒÿVVkyUýšĕ@l_UmnƒW„KVkţ™™¥™aƒwğ@™@aôƒ„ƒWa„kUmƒa¯¯™a±£kx™mmxUwÝ@xmU™b¯K™wó„Ý@kmm¹Ub@lklVbmnnVUV@x›UknƧJUX@ŽƒLÇWkw™LķƧÅwWJk„ƒLkþĉxWz™JUnǚkš@Ɛk¼ÜÔÈKšè@°lșÆk¦l„n@l¼@l¯L™°UU™VÇ°ƒ¹—`m¼mXk‚™bUaƒV@U¯x@¦™Ç™„UUmlmUVm„nnmlkw™@@šƒ¦Å‚ÇLmx¯Iklš„@¦mÆ°VUx¯Lm„@J„InlmxU²šmVbkV‚bUnȎlKU_šWlīÈaÞ¦Æ@„ÞlanV@ƒšVšUbl@XlÇÒĸlŽVa„UX„lm@Ñ°ƒƒÈmUw‚U™nyW£amL@mša²@lšV„™VLÆynX„šÝšVššKnxÆb@lk@WzXŽ@ll—n`šIV‚°b@n„m„„‚Unb„aVlÆ@ČxmnnL„¤ÆxššĠÛÈKVb„@„aWaœU‚ókVm™nL@W‚UnnšKlšœ¥‚bnIlU¯JlƒUkVkn`lUU™V»šwnwlUôšĊ¥nn„yÆb'], + 'encodeOffsets': [[ + 113074, + 37862 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6107', + 'properties': { + 'name': '汉中市', + 'cp': [ + 106.886, + 33.0139 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lKnb@n„lWb°bkxĸwVb@ł„nlŽ„ƒĊ¥šL@XŽl™ÈƒVblÈK‚b„akVwôml²`‚nœ@‚nVKœl˜k²xŎƒ°¦VU„JĊw@çnWçރVkUóÛ@¥kwš™šUmƒX¯WšÑkƒ@UymIUwlUn¥‚mUk²a°¯V»@™ÝVș„ÝċÅÅVl»@l@a°±@_kammÅb™a@ƒƒm@ż™KknõĠ—@mšƒ„¯LÅw›‚—LVxmb@¼kV™@mw¯wVakKW»X±¼¯Vkxƒb„¼WŽ@nx@x±bóakbƒ@ÝmU™@ķÓÛL™kƒVUm™k¯¤ÝLUlÝ@Ýz™š„x@x™°™™™bƒmƒX¯aUJW¯—k@bÇWƒwÛwWxƒ@XWlb@Žƒ„VŽÈUlwšLnl°VlUô¦œU°¤VšUxVXUxlbkVVlƒI„°„ÅVlU°m@k„ÇU¯xUlƒLUlVL@b™°ĠInĠ°ÈnK‚„@xÞa²n‚aUyšXUKVkšWô¼Èa‚z°JXUVÇV_„JVƒšz@Žnb'], + 'encodeOffsets': [[ + 109137, + 34392 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6109', + 'properties': { + 'name': '安康市', + 'cp': [ + 109.1162, + 32.7722 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„bĊaƨèšwôô„¼šb°ašXVƒÞVUÞ@‚aXƒm¥kImx¯¯ƒV@anU@UÇéğL@ƒ¯¥V£mƒ@ÝÈb„K‚™„X°wČÿ˜ƒ„b@xÈblxȯĊ„„mÆUVƒ„nÈ@ƨÜLĢ¥ƒŹnƒ°Vnn˜K„aô_ȃšwU‚aXmnW‚¯kl›LXƒÇ™ō¦ÝaÅVmbğUn¥±wÅéVƒan¥ƒ„U„»°am¥„£ƒÝ@ƒ„wVw™¥nU„уUmmVwmķIÅaóVWxkblb@ból@œğÒĉ¤ċXƒ˜¯X™xk„Ç@óÆÅx@š™xķ_kmݎǣkblb@`¯²@bk‚‚@k¼ÆUČƃÞǚÞU@šU¼¯°±bVlnm¦kVVxnJVz@‚l„™ÒXW°n„™V™šlx@¦ôÜVUl݄Xèm@è'], + 'encodeOffsets': [[ + 110644, + 34521 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6110', + 'properties': { + 'name': '商洛市', + 'cp': [ + 109.8083, + 33.761 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@²nl‚ôbš„°aVwnKÞIš`°wšXôw°VĊ°@ŽÅš„ÞÆV„zÞK@xšŽ@a‚LŚ@b@ŽnLlƒ@šln„mnLVw„a„bVƒ‚VnbU¼„Vƒ°„bl„šbÈ@ĶŦb˜@nÇ@amIyUI@ĠVmôƒU™ƒVwkwlanJ„¯lwó¥@an°Jš_„‚@š™nóƒó@£l¥UwmašÑ@ƒUm±V_ƒJ—£›J—UW¥¯@ƒ_k¯¼mUƒVUè¯b@wmL™»ğVmağI¯¤ċIUW™XƒKĵ¦ķaƒJUb™IƒlUóVmk@WÅÅÇ@ƒmU„ÅVƒnĉƒÇ°kwÇa@wƒa—„ċĀ¯xƒWšƒLÇa@Þn„U¤°¦@„ĠKÈê@VmV@b„U°°nwlJn¦W„bÝ@VŽ'], + 'encodeOffsets': [[ + 111454, + 34628 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6103', + 'properties': { + 'name': '宝鸡市', + 'cp': [ + 107.1826, + 34.3433 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@ƒ„£@›°Išb@¯°ynŹƒaUƒlƒU£„Umšĵĉ@@ylUÞ@@£kWU¯WaU£¯ÇV¥ƒ@kb¯wƒn™¥ÇkUÇnUƒ@¯±›kULm›@m±_kŽónUxlŽƒbaÇLkŽUaDŽkšW@™Kĉ¦ƒ„kƒm@ŁUaķxlw¯aXaƒk@mmakL@šmšÛŽ@¼m„@l„XV`ƒn™KUš°°@²š¤UÈ@VxmôƒxKl„VV²aVw„Xla„Vlx@UVnŽÇnk°ƒVVL™lkI™šƒJÇk¯V@šknƘn@lznmlVkzVŽ„VVxš@Ux„z@x±¼VxxU„l‚kb˜@„¼Čk˜VXlĠkôV²w‚LUKlwœJ@a‚IV¥Þƒn¯Ün„‚„@nk˜l²kÆ@š°„aVbnI@™š‚Ťn'], + 'encodeOffsets': [[ + 110408, + 35815 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6105', + 'properties': { + 'name': '渭南市', + 'cp': [ + 109.7864, + 35.0299 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@ÈôL„xUŽ°„Þ@mŽÈnl¤nUôL‚wX`@ÞÝL™ŽUšmLô„„ŽôbVbnºlnÞ@ôƒšx°LšanV‚wÞ@Vxnwšnlw²¤šb°°„bVnƒlXbƒ„ó„@bš‚Ġ@„xšbš¦ŤšV™Xġ„£W¥ƽɽƒó@ýóƝÝ»„£X™mƅšĊkUƒ„@™™šó„kťaĵŽÇ@™akƒƒa„¯ƒUV»maUU„ƒaƒbUxmKƒnkm@™k„mK@ƒxó@¯n¯KǦ@ôÅèlxkx°nƒƾ¯KU¯WķL@VÝIUb™yWbX¼Ç°'], + 'encodeOffsets': [[ + 111589, + 35657 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6104', + 'properties': { + 'name': '咸阳市', + 'cp': [ + 108.4131, + 34.8706 + ], + 'childNum': 14 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@šIXyĊwlý„KlƒXIVaķƒ™»a›£„¯aVU@a™‚wÈō‚ašL²»‚VœUln°WȯW»XašzVaÞJ@Uƒ»@¯Ýbğwly@£kÑţ±Wу@ka™IUƒƒnƒ@¯ƒómţU™b™U¯lÇIÝb@¤Ý@kV@zĊ@™ĶnƒVV¤k„V„„bmź¯z@°™a¯J@œƒ¤@„„bUx™bƒ„@`™xUÔ±ºVXœW‚„UnUJ‚LĢ¯ÈKlblmÈXŎ°šU„°LšŽlkÞKš@Èxl_°ĶUÒkblš'], + 'encodeOffsets': [[ + 111229, + 36394 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6101', + 'properties': { + 'name': '西安市', + 'cp': [ + 109.1162, + 34.2004 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@°²@‚„mVVÈÈlš¦„m°xla„@U¦°ÈV¤XbV°lXÞaÈJ°kšVšaŤVôn°„„@„mV„šJlb„@XÒŤ²lÒ@¤kzĠxÞa@°„¼ĸK°XV‚°L„ƽ¯mlwkwÆç@óÈ¥°L°mô@„w@aƙK@b™@wÝLƒyÅUƒÝƙ@ĉ¯¯Uóx™W¯x™_ÝJmLUx¯b™ƒóak±mÝUU„™W¯b™aƒ»óó™xƧçĉbƒaĉxƒIUV¯¥ō„±w—l'], + 'encodeOffsets': [[ + 110206, + 34532 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6102', + 'properties': { + 'name': '铜川市', + 'cp': [ + 109.0393, + 35.1947 + ], + 'childNum': 2 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ÆxĸƨšKlxÈX„K@VWƨIlmœV@wVUmUnmUalk@kVaUaóaƒóƒnKV™šÞK@ÝW_xóKmVk£ÇmnÝ@¯ƒVƒwóK@ǯXkm›VU±¼™KbÇŎx‚š@bUV°bƒœ¤‚bš¼ĸ„Ub'], + 'encodeOffsets': [[ + 111477, + 36192 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/shan_xi_2_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '1409', + 'properties': { + 'name': '忻州市', + 'cp': [ + 112.4561, + 38.8971 + ], + 'childNum': 14 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Vx@lnbn¦WlnnUšmš°š²VšV‚VVVnUn„ºlz@l„„@Jƒ@kXWVXl@Lƒa@„ƒKUL„ŽlbnKlLnK‚LnKÆXn°šbVV@bUVl°Un@LnaVJUbW@UX²l‚@ČwlVVIšWnkÆa°„„anV‚Kn°™UW¯@™aVUVk@Un@„aV@ValwUanmWU„k@WVUUanaVwnLVl°@nk@mVU@UVK@w„LVKVU@ƒ„K@UUKVUV@@bnL„a‚V„aôšlIXmlKX_°KVV@bVV„@šzV`kblI„V„Ul‚šL@bnV@V„Ċll„„VlIXW@k„a‚U²blKšVnIlJ„albXXlWVn°JnšnL@l@XlJlaX@„X˜W²@l_VmnKšU„blU@mnkVK„¯@U@ƒma@kX¥VƒmakkƒLƒa@aƒ@WIUUVXWWnk@a°a@kkm@kUUmJm@WUUUIk`m@V—kaWWkX™KmƒXk¯ƒ@WKƒLkak@±bƒw@ƒaƒa@akaƒ@ma¯@ƒL—KÇÅkKWbkmġ™±ÅUƒLUK™VVkƒm¯LUVVbƒ„UwUW¯bm„ƒULƒxWJ—@ƒklmkUm@@KnwVkVK@akwƒ@@a¯bƒKkn›VUI™b¯mmbk@UbmKUL@xUUƒ@klmLUŽlVXI‚VVVUVUœU`mLXVWbXnW`Ų°xmŽxU@mĉƒƒwU@mbU@UƒmbkVW¦kJ™@ƒX@`¯Im@UlUVVnb@bWJXnmbƒJUU™UUaƒ@UamIkaƒxƒ@@x@b'], + 'encodeOffsets': [[ + 113614, + 39657 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1411', + 'properties': { + 'name': '吕梁市', + 'cp': [ + 111.3574, + 37.7325 + ], + 'childNum': 13 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@a@w„@„wlbnJVb„@VbšVVV„InaWmXI@a‚aUmVUVkn@°J@_„Wš@lIX¥lUnaV„V@naV@„xĊ„n‚V@‚wn¯wƱX_WmXaWUnKV_V›VUUUUWJkUVnKlk¯™@@kmKUaŁ±KkU@WmI@WUIlUUmVwXƒ‚w@ƒUlUVwœV‚@„Lnb‚W@anU@UšaVkô@l»n@na˜JnUÈLVaƃUUVm„VKVƒ²L@mU_lK@UVWkU‚a@a@U¯aUaƒÑóÑUb™„ƒKk@@aƒk¯mVaUwVƒÑkWUmK@UUKmXUWÝwUa™LUU@aWJUUU@Ua݄U@WL@VKVaVI@WnU@alIVKƒƒ@kIƒmIkJ@™m@ƒ™@@_™K@xƒ@kaW@U„@Vmn@ŽUK@mIƒJUXV¤XXWlkKƒkkK@XmJVakImJU@ó™¯LWKUV@nUVƒLkxmKkLma@kXKmmƒLƒab™LmK@V@mXVÆUxƒX@`nL„aV@@VmLUVnLlLš˜„b@„šŽ°²nx@b‚VUxlb@V¯bUV@zV‚XVĊXVx@lVn@VnnmŽUš@LlJXVƒz¯VWVXbšV@bmn™VUVk„Çþń@XVxmbUlV„Uln„W„@„Xl‚@VLXÒ@bÞJ°¦„L˜ò„@nU‚b@°„X@ŽXbmVU„V„nb@x‚x'], + 'encodeOffsets': [[ + 113614, + 39657 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1410', + 'properties': { + 'name': '临汾市', + 'cp': [ + 111.4783, + 36.1615 + ], + 'childNum': 17 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nW‚@@UnLšK‚a„b„KnnWL@lnblKnLlw„KVU@mVUXL°KôšV@nIlJUbnI@WlL„llLXkWWU£VW„InJ‚@VL@nm@UVƒX@lb„@@wšL@`‚@„šn@V@lw„@n„VmVX„WmwnUlƒœa@_lK„wVlUn°xVKVXXWlUšVVI@K@K„n°KœwlVlU@kna@V_„Wn‚m„UVm@kXml_@m„LlKXw°m@_ôJVUV@X™l@UaV@Va°I„lk»VwUkVmwUmmVn@V¯@KƒU—wmK@U¯wUVÝ@mJƒU—nWK™@@UnKVa„_lykUmKÛnm@™x@ƒUUlwVk™ƒXW@ƒa@Uƒ@@K@ƒkIV™nammVakUlƒ@wX@@kƒ™¯@ƒVVbml@„„°UbULmlVbnbÅK±VƒKVXUJWa@ULWaUU@@U@aWK@UkxUKƒLUUUJ±UkL@V±kk@kam@UV@l@LWl@n@VVUx„LlUUx@VUV™U@aƒIUl™L@°mLU‚ƒbkUUaWUUaUU@aWK—LWJ@bUL@VUVVbU@m@a@kmKmnĉlUK™XƒWUblb—xmIkƒƒU@xWb@lkšVx™LXŽmzVV@bklVVUzm˜@bk„@Vx@xlŽU„@lUbVnl@„Wxnl@n@ŽUbV„mL‚mƒb@`X@lUX@@xlnkLWaUJnnWV™Vn@l„@bULVV@l™V@XnJVX'], + 'encodeOffsets': [[ + 113063, + 37784 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1407', + 'properties': { + 'name': '晋中市', + 'cp': [ + 112.7747, + 37.37 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@šlInJ„lJ„@‚„ULkJ@bmV@XUJUb‚L@UXKV@ރVbV@VVXI@bVVšKVbÞxVXnWVL@VnLV‚lX„ÒUŽVxUb°n„l@bl@„LšƒVaô҄ÒVb°b@VnLnnV@lmn@lb„U„V@„‚JœUVV‚Xkl@lUzmJ@xšXkl‚bUn„JVšUb„nU‚lb„V@nlLX@lakšV`Ub°š@XVJnU‚L²KlxnI@KV@lbUbVV„KnVl@„zlm@Uš@nŽšI@WUaVl@@mVU„@XkW@ƒnkVKVƒ„_Vw„y@knwVa‚@XalU„@šVnml@„X@V„L‚KVaÞbnnlJšI„mVKn„VVVInVlU„@„m@™mXK@UmyUI@mWUUakamw@wUwmLkakwVƒmK™w@wUam£y@am_ƒW@™UU@knmm„amU@WUa@knw@ƒUUUUV@nƒJm@mVUkKVUUUkKmwƒKULƒKUImV@lUn™nŽm@mbUK@°™bUnmbUmkkƒWUb@am@UXkK@a±@™V™@ĉř„V‚UXVxUVkLWl¯@@bULUlm@@nm`—XƒlWakIkm›VUbUL@Vm@kIƒ@@Kšm@—VaX‚I@W@aU@kUƒVU_™KƒbƒJkkǎ™b@nkKmL™wÅW@kVUUƒVU@WUIƒJmIXmma@_kyVaUUlkUm@ƒkU›x¯Lƒm@L@LUJ™UkVWXUWUL¯wVmUkƒxkL@`›bk„mVnxƒXUWUnmƒƒ@kxU@'], + 'encodeOffsets': [[ + 114087, + 37682 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1408', + 'properties': { + 'name': '运城市', + 'cp': [ + 111.1487, + 35.2002 + ], + 'childNum': 13 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„Vl„nJ˜wkaVa„XšWVLĊknmnL‚l@@bn‚V@UaVU@UVK@aXI˜KXL@bVVVbXVVblV„aVnK@¯šKVk„J@bšVVU@UVwkVƒKVwUUm@@Xk@K@kVUn@lbl@²l@UlK²VVIVV„KVLlw@VXL@b@VV@VŽXbVK‚@XbVIUW„L‚U²ÆLmaUankVKVaƒ¯@ƒnkUa„U°@„š‚n@@kWa„UVaXUW@IXKVw@U™ƒ„™WU@W@@UUƒU@mn@ƒ`m@UUULkUmJ™IUƒ@@UƒK@U@›anƒ™ak_@wmKUwmakV™kmK™V™k¯b™wƒ`kwUIÇx¯»ÇaŃmn@@™mƒmUkV@wkKW@kxmL™UkĉLÝk™xÝw¯lóVU„mV@ĀVVX¦W¤kz@`Vx°„²ĸ‚š@„Ul@x„êĸNJ°¤V„VlXLWnXxmV@nUl@„'], + 'encodeOffsets': [[ + 113232, + 36597 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1402', + 'properties': { + 'name': '大同市', + 'cp': [ + 113.7854, + 39.8035 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@²£šyl@Ȑ˜Ė@bĸŽĢbĸ„˜X„a‚KŤnn@ŎôllÈx„nVnÞDŽV@b‚nXllL°KšbVb@J@b—„‚„@ŽU„„xlKXLlKlXk„@Ulk„JlkUƒVKXUƒÇVIVm@_nǚLšašl‚w„VnU@UUwma@aƒaÝaLmUk@@Wƒ@U@@X™wVWÝUUUk@@VmLƒKV»nwUw™aUL@`mzƒJUIVƒUaUw™KUaVIlJôanÑlLVUn@ša„@VV„@@UUwVK°Vn_lJÆLœéW@UUUÅ@»lm@aÞIVwXW˜UUkkm@U@aƒU@mwU£VWU_kWmƒXwW_°yUkkK@UÇK@kkUVymóK—U@KWIƒbUak@mJ@bkbmLkŽ™UmƒkVU„W¦@lnb@„@Vƒ°ULml@nkVƒa™VmLUnk`±@—XƒWW@kbǦXŽ¯„WxI@xmbmxXlWV„„@bŎUz@J‚b@bÞb™ŽU@Wbk@ƒxk@WX¯VۙƒWÝbÝUkVUU@alI@a@akLWa™m@U¯UUmÇL@K@aU@¯VUkƒKmX@`@œkJ@nV‚Ub@lbVÆXVW„ULU`VbkLUV@XWl@bXJ˜@VbV@Vl'], + 'encodeOffsets': [[ + 115335, + 41209 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1404', + 'properties': { + 'name': '长治市', + 'cp': [ + 112.8625, + 36.4746 + ], + 'childNum': 12 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Uk™Lky@I‚JVa@mÞaWšy@_W@_WƒXVlUVwš@nw°K@m„UƒVaƒmVkU@mmmnLVUmKXa™U@IlKVUnK@UmWkX@WV_Vƒ@akU@a„KWIXyƒIUVmUn™Ua@WaXUVKVmkUWVkUƒLU@@VƒbƒKbƒIUmƒ@mbVL—x›WUUkn±V¯wƒbÅJUbmLkbmKÅKƒbVnUbƒV™KUb™KUbmLKmƒb™aƒKkUm@UŽnn‚VnxUVlUxl¼ƒk¯JUbU@Vbk@WšU@UVóI@`¯nWxkLƒK@nk`Wn@lUnƒVnm‚ƒXU`@mb@lkV@„VnklVVUblz@`nbWnnJ„IVJ@XUVV„UV@lÆXšxnKlL@mšaȍll„I„ašLV`„UlVV@@b@XJWUb@˜™n@L„@lJn@@UVKVaœUlnlJXb„k˜Wn_@mn@VkVK@a°@XklKVUUwVWUšƒĊƚ@šU²@@blLVWn@@bVa„XllVnnaVmša@¯VLnan@‚šmVm@knUVJ'], + 'encodeOffsets': [[ + 116269, + 37637 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1406', + 'properties': { + 'name': '朔州市', + 'cp': [ + 113.0713, + 39.6991 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@XXWVXVWnnlnn@èƼ@„„xlš„ŽV„nblšššVŽÈUVl‚š@„blnœL܃ĊmUkU@Ua‚—@WI@aXk@WVUlKUaV_VKXƒWUUÅka@VaU@mlI@›@_nW„LVl°UV@@b@LÈKVn°V@VšnXblK@b@bkJ@bVVlUÞVÞa„Xܚ°UXWl@„wl@XaV@šÝa@aa@IVyƍ@aƒƒXUWknwna@w‚JXw°ƒWÈ¥kI@W@kmKm™¯IUmkXWWkaƒbkImJ™UkL±aVƒb@lWXkJƒUkƒĉkƒ@UmU@a™KkƒVƒUkJlaU_™yƒ@UU@aUU¯LW`kLWnkJó™ƒbUƒbmK@aU@UVVL@VƒL@„UVULƒK@xUL@VUV@nml¯@UkmKUxmbVbUV@XƒlXVmnVbkxUbU@ƒbm@@VUlUVšb°@VX¯šm‚'], + 'encodeOffsets': [[ + 114615, + 40562 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1405', + 'properties': { + 'name': '晋城市', + 'cp': [ + 112.7856, + 35.6342 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lV„Lšb„an‚LnKVašLVašL„UVaUm„aÆLnLlanKVaÆI„a°x²UlmVVœX˜wUKna„@Vn„J‚a„L„a@UV@@alUkKVKnkmmVwUk„w@ƒ™@kxWUXƒW@@mƒk@aUa@a¯aƒLkKmwkUm@kL@K@aWIXmƒVƒXƒWkUVakL@UVKƒw@aUK@UUKmLU@¯n™KUwVƒUIWJUWmka™@UXƒJƒk@UkmW@kLWKVƒx@bmI@VUaVU@a¯@UUmVKmX@±`kÝKVxUL±akL@V™bƒLkKmVƒ@XWVUbƒVXb@lm@@lW@@xk„lVUbnnmbUšlJ@„@L„@@V„b@‚WXš„UlkxVV@„šwn@ÜmnLlVkzƒ`UbmL@Vš@XL˜m„VnIÞ@VU°x@VnL˜x„V@LU°'], + 'encodeOffsets': [[ + 115223, + 36895 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1401', + 'properties': { + 'name': '太原市', + 'cp': [ + 112.3352, + 37.9413 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„@VV@wVKnLVal@na°nšaVJœUlm„L°a@b„@lx@bULUlmx@Ln@lVkn„l˜@XI„w‚K„Vnƒ°aVXVx„ƒUaVU°K„nUlšUVL„KÆVš²Ģ‚lnXalLÈƘL„KUaVkUanmWU™a@WwkUWU¯y¯Ñ@anIl@@aVU„m„I„ymUƒLUUVakaU@@LmJkw±LKmVUI@W¯™VaU_l™kbW@kK@mƒUkaVƒmVaU™ƒIVmalk™W@wnIVy@klkWUU›VI@ƒƒUƒVkam@knU@mmmK@bblVUX@VkLV`@n±KU„ULƒ‚UnVVńUbÇKmV—Imbm@k¼ó@Ul™b@VmV@bXmaƒK@›UUxkV‚V@„xW„UxVnkVVJ@XnJ@XlV²LƂVbnL@lš@°'], + 'encodeOffsets': [[ + 114503, + 39134 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1403', + 'properties': { + 'name': '阳泉市', + 'cp': [ + 113.4778, + 38.0951 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@°@nb„@lb@b„b„b‚@„x²al@lb„KXU@m‚kUWkkmUUƒVwV@XUW@™naVklKXblKnL‚ƒnLVanImaXKlL„ašV@U@KUKW„alƒXK@£WKXUV@VU„ƒUUVW„_V™@W@@K„@šƒUƒƒIWmXUmƒULƒn™JkImmÝaUbLƒK@UƒWk@mn™Uƒ@kVWb@Ubmx@lƒzUxƒ`U„ULml@„XWlƒ@UV@nk@U‚Vb@X™Jm™@@Vknƒyk@ƒzƒJƒnUV@bk@mJ@b°Ò°zXVlVXx‚@šbXVmnVbUlVb'], + 'encodeOffsets': [[ + 115864, + 39336 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/si_chuan_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '5133', + 'properties': { + 'name': '甘孜藏族自治州', + 'cp': [ + 99.9207, + 31.0803 + ], + 'childNum': 18 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ƒaXamƒ¯wm@±°wUwV@UaVw²Kš™„U@UƒU„¥‚a„ƒ@£Þ™ôx‚Knkm™X¥™IUƒÝUwlk°V„@ƒÈ™‚KUwlkUyV¹„mšx²Xll„ÑW»š„l„w°UŎ„nƒ„„˜Jœƒl¯°V@wôIVÇn™nUllšLšVǚLô¼XW£@±„@¥k_ÇJƒkUéƒkšƒƒwXa@ƒšLlw²™Vx„b‚mš¼ÈxlLȃ„VWÞn¯mǙÑUÝlÛkwlĉmƒULmwUJ™ç@wkm@ÑlUX™ƒÑôġƒVa™ƒUф¯@wķÓkbV„mnU@@y¯IķKƒV@¹šaƒé@k„mÞU°¥@a¯@anKlblU„¥@óğç@Çw@wkla„çݱk¯±@ğÝUÛmݯwƒ@kb±¯akXWÜkXUÆÇUš¤X_Ɛw„V@¤ƒXU‚ƒbUƒŽƒIUlÇUkŽġ@™aXČmlUlèUV@„mVk¦Vxš@¦±š¯ƒƒ¯¯anlWš¯nƒƒÅw@w°KVak£m@klƒKknÇU™»óKšīlaUaV£@™™¯@ƙU™VƒÛÝÇXƒÇl—ÓlŹ„»WUğJ¯£mx™Lĵô›ºX„VlUll²bl„„lŽƒxónn°ÝšU¼mJUš¯nƒƒƒV@êĉ°Uĸ™w™@mƒ@¯kmXamѯaUwÝKU¥„mÅn¥Wmn™ƒ¹n±ƑƆÇôXê±NJnšƒ‚UôlĖkȂVÒ¯¼VnƒȮ¯ĀnƆ˜Ģ@Žk°V°¯ĢVlkšVxm¼X²™Ŏ@ŽVxknWÜ°U‚¯n™Æݜ@`„ôݲÒƒ‚Çzn‚mX@x„è°K°Å„UČĬóĖ݄ƒ˜ó¼ÅêƒÒƒbmšk@V„Ž˜„@ҁl@nĉܛê—x@Ėml՛J¯¦óxȭ°ÝmŽ¯Lĵè›Ā@Ɓ„l°żƒ‚šX@xmŽkV@z@‚„°blŽnÞ°J@bn@ƼUVƒUóŽóLƒ°X°ÝLƒxUn„°ƒĬƒn@lnL@ŽÆ@šn„KÆxnUnV˜InĬmÆnxŎ¼ĊIĢóÞ@ĊƒƨbUƒ‚mV¥lkƒ‚wnL„mšÅÆ¥Xƒ˜wU@w‚wUÞ™@alUUŚU™Vkkm°aU—°Ó°w°U„ƒ„b°aš²K˜¯œĕ˜@ÈbޏĊaš»„XVm°In„‚Ĭk¼Vb„ašJšôš£VĊan™‚k„ů™™nƒÜU@anKnĮ‚bÈmƎš»nI‚霣Ġ™'], + 'encodeOffsets': [[ + 103073, + 33295 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5132', + 'properties': { + 'name': '阿坝藏族羌族自治州', + 'cp': [ + 102.4805, + 32.4536 + ], + 'childNum': 13 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@l@@þ²I@lƒ„VL°wnJ°Uĸ™Ŏè„Ilw„V°¤nĮ™¤Ý„lè„L@„ƒ„@x„l™è²ôĊ_ĊġVÈôJżīlbXšÆÈVŽkxÇVƒ„n°„¦Üb@è@nn@@°šUÈ¥WDŽ_Uala¯¯UǙkƒ»„mVwk»˜k²°VxlL@¤œ_@x‚`ȍ‚Ėöb˜š@l²alX„a@bnK°¦VK@nnWmx@nUnl@@lƒlĉk°l°UXkmW@Unš`k„ÇL„ŽW„ÛÈVxšVVlVk@l„IXb@ylXÈW˜Į„WŤzœy@šmIƒŽ²šJ‚š@nŽ°@V„„J°a„Å@ƒŎkVǚk™aUw„KVw™™Vƒ„@nkm™@±ôkô™ĊJš¼šInÑm±nIššÞ‚XȃĊxĊUÈbÜyÈ£Vkw@kVUV™„m@ša„»ÜbÈmƒUXwÝxƒUn¥@°ġ™Å‚aœJVk™aW¯Û@W¥—UŏĶ™@¯kUƒŃ@ašI@mmanwސ‚W@œ™mw°»Uřk¹±W„xVx¯¦U°ƒzţW™w@°ÇVÑk¯@„y°aš£š@šmšnl¼„ašÝÝakwUƒ±aĉImlĵn@ƒm@kkVƒ¯Ñm™ĸ™°x„l™œ@˜ƒXVÞmlÛݙĉUÅ¥mwÅ¥VaUw›™XġċaVůÛŹlwU¯U™ó±™xÛV±¯¯n¯mċƒLmnĊm‚™@™_kJWaXmwUƒĉK™»™@mwX݃UDŽkKÇw™»nƒaUw±škx™K@„Wb„x™„„lVê„lÈIl`@¦ƒŽ@²X¤Wó»™KUșŽ™KkkmVmšUÈóJ@x¯Uk°›„—Iƒƒm„ōƒ¯Vƒxƒk™ŽX¼ƒÒkk±W™wƒnUºVzklVxLǚ@„ƒŽ¯UklVxސV„šJW¦nšmlLówݚ@¤ƒ„bƒ¦„V@VƒV™š±LUxVbU@Vx¯x@²n‚°xn„Wb„b'], + 'encodeOffsets': [[ + 103073, + 33295 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5134', + 'properties': { + 'name': '凉山彝族自治州', + 'cp': [ + 101.9641, + 27.6746 + ], + 'childNum': 17 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ĶóšKnw°¤ĠIXVƒ¼kź˜Ôk‚„ÈWŽÞȄÜUVšÅš°@šš‚@U¤Vbkb™ĬôLš¼ÈVlm„Llkn@l¤Ub¯L@xÆx„„°mX™mk°b„°°„²™@¥‚™Uwl¥nU@ƒVUkçVnkWċšbĢ@lÈVVk„J„‚V„aV„W@£ƒUƏxW`™£ÈVVÅlWXÛlW°b²la„@°xnÞVÜĠÞ²@l°Þ²ƒèkblŽ@xÈx@Ġènal£nU‚Dz@‚ÞK„nn¤@¼˜°U¼„nV‚šXU‚šbn™ĠUVbUlVš°LX„@lV„èÜUnK@_ƒyXVyUwmIU»Vƒ„kÇ¥šÿkkV¯m±n@ƒn¯ÜanVVƄz@Ž‚bœwÜb„m@wša@kƒmk»@™a@VUUó„w˜@nb°mš„XŽmnVbގVôanwšJ‚ak£lw„˜šLšÅnÝ@wl¥IÇӃ@U™™Lƒ¼kVǃÅó¯kVmmw@ƒn_‚Vn»°LÅ»@éÇçŹīVÇÝ@ÝğU™ƒaVݙ™š¯ķlŭġlƒ@óÞۂċ@¯nkUӄ—m±™IVġUwóKUn±¯—K›w»ƒKݐV„nl@„óxUwţ›£ĉƒUmŗÇ݃K™„ÝUlmKƒ£UVŽ@ÞȎW¦„Ò@Ĭšnny‚@nÒmœVŽ—¼@°Vbl@VlnUUwl™°a@„œ„@llnk°lbnKWĀnŽU„VxUŽ‚²Å‚m¦Û›ÇŚƒaU„Vbš@¦m`móX™Umm™xÅ@±Þn虲™U¯»m™ƒV—m@wƒU@wݚÝmLƒa@„™VÇUk„l°¯„VlkVƒ¦UšmxƒaULUèVx@„kIUxmWV¼¯VmȯšU„nl›È—@m»Å™ƒVWxÅbÅğW@kƒm@kVV¦mlnn@‚ō„l¦Åƙxkœ'], + 'encodeOffsets': [[ + 102466, + 28756 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5107', + 'properties': { + 'name': '绵阳市', + 'cp': [ + 104.7327, + 31.8713 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„ńlV°š@Őĵ˜VX»ÆUĊќJ‚w„@È»m»š£°Kšk@ÇnÑƍš@„w°JUwnw@wšbVbš@VlźLUw„aƒ»„aUklyUUVakwWXwWƒUxkLƒmn¥mšwk™˜UX™lJ„w@aƒIk°X„¥Wƒ²l¥šaU™„IlmkklƒÈL@m°nlWU™aW—š@Vƒ„@UaV¥@ašk@Çk¹ƒK@a™K@kƒKkšÇX@VU@kx±V™èkIWwUVUkkKÇ@ƒa@wkml¯@kUWn£Wa„aVwnaV݃w¯@UaWx—n›JńUxUšma@L@„mbUŽU±VVnkxUƙ„VŽm@kkKW°„X@¤ÇUkÆÇnU¦¯ŽkƒmLVwÅK@UóbÇƁVƒ¦™L@‚±êX¦mVޚkÜÝnWU—„›@kšƒŽ¯wķšnš°ÒU„lln@@„ĶmnkĊJ²bV„lxÞb™Þƒbk»™m™n™@™¤¯bƒz@Žl°UÒ¯È@ŽšxŤX„yV¯°¥Uwƒw²XlºVŚ¯¼nx›š@ŽXݏmxnb@n™J@b'], + 'encodeOffsets': [[ + 106448, + 33694 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5117', + 'properties': { + 'name': '达州市', + 'cp': [ + 107.6111, + 31.333 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Uxn°‚bnŽlUnÒƃnn@n‚¤„LnxlU„ššV@„Æl„x°XXxl`XœƒVW‚œL˜è—„±nÈbƒŽ°b@š²x°Kܼ°ĉ„V¦lJnU@¦šÞ‚JÞğ„mšLÞ»šxU„lb„VÆann„alŽ„VƍX@lnŎV„mU™maÅXƒa@aWmœ@‚£@wĉJVƒkk‚kkmƒnk@ƒmna@šal„Kš™‚J@Þwm‚ÅŃ@ambkUƒƒ@™™KUġKU@m‚ak¯±ƒ„a@aĉÑÅaVwšXlwƒ±—V¥l@@a™kƒ›@@£šmƒĉÝónWV@ŽnÝÇÇx—UmbƒaVkkk@m„@m°ƒÝýXm›akÅīƒ@@ƒmb@@xmšnbƒ@mxšŽkWL@ƒ¯b@WUXmWœWKkbm@kx™Xmm@LUl„xlêóK™nUš„all™LƒlLó°m¯JVšU„K„„@x˜K²Āô¦l°'], + 'encodeOffsets': [[ + 109519, + 31917 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5108', + 'properties': { + 'name': '广元市', + 'cp': [ + 105.6885, + 32.2284 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ÆL„Ċx°»Ŧ¦˜W„™šLȄ@xÞKÜ°ÞnVxÅĀlÒnJ°a@w„V¯l@XWknKnw˜VȚ°XXa˜lX°VI°b„W„nšaššš¥@ƒw°™n@šyÆ@nkÞ@°¯lJn„°IÈl‚UšlXÅ@ķlUV¥VUUÝޙUUƒ@UwƒJUkĉm@ýƒƒlk™WUwVwWJk@VUK™lUkaVƒUƒmLk„m@ƒƒ@Uƒ›Ik`@„™UmlUkV¯ÇXKÝ_mm¯@Uƒ`kwmƒl¼±KV¯—¯Vk±Vk±kzma™KUnDZ™bk¦±ŽX„ƒ¦¯Wl„J@bƒxkIWš—Vlš™xnŽm¦„nlKVwX„WxXŽlxUbVVkzVlƒb„¼ƒbVxŹKUk™@Ua™a@xmxVx¯Iƒx™@ŎmÒ@șl¯L™¤n¼'], + 'encodeOffsets': [[ + 107146, + 33452 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5118', + 'properties': { + 'name': '雅安市', + 'cp': [ + 102.6672, + 29.8938 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ln@xšèVInxVKn„‚ĊklxkÜVޚÒnÈm°nxš@š¼ĊLV„nx‚WXblIš`š@nmĉn‚KȄôÅlUÑmU„K²¹@ÇÅVÓůVýÞW„‚UVmX„ÆbnwšKUÿ‚™@UmmIUb¯¥Uwƒ™¯™Çmš™„çmanUm»UUƒl—kƒ¤ƒa¯bV™U_WĕmÇŚ±ĢUlƒUl™ÛVƒçkUƒ@WŽ¯KU™VkUağVmš™aV™WUƒmV»—¯@»m£ƒmÝLŽ±@ÈmVk¤mb@ôƒ¦kVkamL@b°‚@b¯¦ÝVƒn@l„ê™b@º„UĸL°J@zV@nmUƒlaĸÔ@xƒ°VҚ„Ub„‚óĢ„ÒWškV@Ò'], + 'encodeOffsets': [[ + 104727, + 30797 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5115', + 'properties': { + 'name': '宜宾市', + 'cp': [ + 104.6558, + 28.548 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VlÈnl‚XnWLX`m„²nV‚@b°xĢçlnšVm‚nn„@@„°‚UzšlV°nޘÒkxl„w„`UnVb„mšL@albÞKÈۚmܼ°@Xǚ@wmW@ńKĊL„lV„šLVŎçÞL²±‚ğkw@Uƒy@¹lKX™lKVa@w™™Č@‚w@a˜ÇU¯n™@@wġak—™aō‚ƒƒK@Å»VakUWmķwkbğ¥mL™akš™@ġރ°¯xVVÞ@VšxVš—VWx„XlxU‚™@k²WVŃULmèULVĊklĠ„VœJVx±nŃ¯¦mwğ@mƒƒlğkkl±@kšUk@¯±Ç™Kƒ—kxl¤b™Imx'], + 'encodeOffsets': [[ + 106099, + 29279 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5111', + 'properties': { + 'name': '乐山市', + 'cp': [ + 103.5791, + 29.1742 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@kšVŽk„ššÆkšV²UlºÈIlxƒLXèÜlU„„XU‚mkƒbVè„x°@„@¼°Knnn@m˜ÆIUbnJ@bVI°b°±@nK@mVakkƒKl¯nbšmĸ„èl@VnÈl‚UUw„wmwnm°¥„L„™lLnU@Va™ImbkƒmK„ƒƒnk@mƒb™ƒƒLV„JVUUƒ„VnkVmb@a¯JUaÆkk¥„IW¥„Klw—ÑmÝU¯™kVy¯@ƒƒ@mmn™Ukmġè¯w@aU±mnƒW_XKWmkÇmUkóbUÝUanmW™ƒ¯nma—@ƒxVôUV@šb@‚l¼„n@l™b@xƒnÛa›xa@ƒyUÅmUÛbm°@„m‚n²U°ll™ĀȦƒlU„V¼nJVxUz‚W„z@`mL'], + 'encodeOffsets': [[ + 105480, + 29993 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5113', + 'properties': { + 'name': '南充市', + 'cp': [ + 106.2048, + 31.1517 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ȲVmšLnblyl²²UUl˜°U°²L‚»„knlx„_VŽ°@nnÞ`WL°ÈUŽVlnkšV@ƒl_œJV„‚@„„n@lƒnKV£™Çšƒ„UV¯šm„@laX˜U„‚UbVx„@VkôJU°Jn™@™‚wUk°wnUƒV_nJmknmm¯Vwk¯ó¥±ÿ—L@wƒƒƒLVU™kU›bX¯mykI@a±Kk¦ULmaXƒƒVm¯ƒK—z±ƒklUIVbÇJšƒkL¯™l™ƒU™ÿ™UƒlUkJƒUmŽUUkVVklKk@@a™U@„™J„²ƒxƒ¦kĬ@¼±ºXnWb—xƒU@xƒx@lšL@b„Llº@șl@bU¦Vbƒ@U„™@X˜‚bVškX¯m@nÇKk„llknƒJVš'], + 'encodeOffsets': [[ + 107989, + 32282 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5119', + 'properties': { + 'name': '巴中市', + 'cp': [ + 107.0618, + 31.9977 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@V„U„lbkVšŽVLUŽl@XI‚ŽUxVxšXkl„„@þĊnVl„IVx„@VVݚVÞUVU¦kV@ĸWÆô²š@VÞnš@Vaôb²W@‚K@XUmÑUW°¯°Ina@y„_lWn¼lLUbô¼„Kla@™nkUyô—Æx°@šn£™Ý@¥mVkIU¥Ċƒ‚¯Û»¯L±w@™¯a„Ça²m˜ƒ—ç›KX„UW›k_Ww¯WƒwÅk@ƒ™Uƒ™kVmwƒK£@mmmńmÑkVmamnnlmIU`V„m¯xVlx@šmš¯IV‚óIUlƒ@UwVaƒ—VW‚kbƒ@™nU°ƒV™„šÈU¤'], + 'encodeOffsets': [[ + 108957, + 32569 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5105', + 'properties': { + 'name': '泸州市', + 'cp': [ + 105.4578, + 28.493 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VVXwVKn„˜wnVƒn„l@b¯xmKUbVn°°X°@blLšènV„@Vn‚l@U„LnmmUna„VV_ĶV@wnJ„„l@@kkKVólaUwnJm„wUlm@ašUaôKVnJWbޚ@VšwVLX¥VVš_Þ`šw„WƒÞŹmmnIn¥Wƒ@k„WV¯@ƒ°kI™ŽƒLk¼Ç@k¤±Xk˜™nmݯUlÅÛKWV¯kƒlUwkLƒÓ™@U—@ƒ‚w@ġXV„˜WX„š@UbVbšV›š_kÇV™lU°lnwŎ¦ÞaƯnmm¯šU„™m¥nkVmkƒl_ó¥¯UÇl¯@™ƒ™L™kƒ`¯ķLUy¯@mw—¼ķ°ġ_řU°mlšnÇVUޚ„@‚ƒš_ƒJUnV‚UXšbl˜Ģb@x@mšV°—È‚b@‚xċ@šš@xUbkLWškL@º„zV‚@lxĠ±²'], + 'encodeOffsets': [[ + 107674, + 29639 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5101', + 'properties': { + 'name': '成都市', + 'cp': [ + 103.9526, + 30.7617 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@°n°m²°ÜUšw²ŽôVš°ŽVkxÜźUŰČb‚ŽĢlaÈL„»ƒ@k„wVǂ@„ƒnÛƻșUÝ°Kl_„V°Uš`Vbn@VbÈLšaVU@ƨ»V™nIl™šUUa„±lIk±š@VnKmÅ@WaƒK¦™lVōškK™Ý@maXÇmw¯IU‚@kƒVƒwUmVIƒƒƒç—ÿƒU±ŽÅ@¯È@xƒK@wƒLUbÇKō@mÝ£@yóUóóUxkI@WlIUaƒbƒaŽVĀ™LmxÅaWƒUnVƒÝXUþÆ°UÔÈÆ@±ºƒLnVVÒkóÆ'], + 'encodeOffsets': [[ + 105492, + 31534 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5120', + 'properties': { + 'name': '资阳市', + 'cp': [ + 104.9744, + 30.1575 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„è„„UJVn„x„U@lV°JnxWÈnbÞ@šŽlLŎ™Ušk‚¥„LXbÆ@nŽmLU‚@zlbXmlnVynL„çšJVb‚UnómUnamU„an¥lKV_²aValWô„n@nƒ‚bVœK°¯VblW@kkƒlUnlV£°W@w„UXk°KVwƒmVkwVyVI@wkmƒVÅ_Umm@Uÿmbk£™xUaVw±V¼V¤kLWxU@Uk™bƒyƒXšómƒ°V@@zÝÒkKƒn™±U@@_VVkƒÇaVwnLWalm@@kkVVl™¦kIV`±n@w„Kƒƒk²™aƒVUUV¤™nkxmUkVWVnLUbVbƒ`kUU„mLU‚mX@`ÅbǚXbWLXŽ›n'], + 'encodeOffsets': [[ + 106695, + 31062 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5104', + 'properties': { + 'name': '攀枝花市', + 'cp': [ + 101.6895, + 26.7133 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„b‚KÞnޙ@x„V@x˜n„Unš°¼šVš±mç²ÝÆ@šwnnšVWŽnôn_@¥‚™UaVƒ„bƙœÈ܎n¥Æ±VUwVƒmXÿmLkal¯km@k›ƒ@ƒ¯bkšVxmVUkk@Ua@¯˜»Un›mс@mz™m@īƒÑX¥Ç@ݙxU¦ƒšÅŽÇUkx@šlb„UWVX„mV@xĵĖ±@@Ž¯xUšÆLnÆm„šx@nXL±lUUVwKWak@WxkbšÞƒŽĉbUn@‚ƒ@@xó¦„Ŏ'], + 'encodeOffsets': [[ + 103602, + 27816 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5114', + 'properties': { + 'name': '眉山市', + 'cp': [ + 103.8098, + 30.0146 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„šVx°¦VanJVnš@„b„aVbkJ@XlJVwôôôV@zÞ¤@nƎÈLVa„K@x„L@w°ÇÆ@²„V˜ĀœmWXKWașÆa@_nWVnKVƒlV„_UaVamKXUWwnmmwœÑm£@ynUƒkWƒĉUkWVkkV±çkJmkKƒšƒK¯¦mnnxƒxVxVÇkUmk@ƒçķ™nmak°„LllUb@nmL@‚¯²¯aUJ@amIVaÅJn—m@mm¯L@»ƒŽ¯@ƒwUç„anlVƒWVƒÛkWç„KkwÇJk¹±V™UÅl™™ġV™²ÈƂnXĖV`Uš°a„b„£˜l„kVVn¼mVnbƒè™šÈn°š'], + 'encodeOffsets': [[ + 105683, + 30685 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5116', + 'properties': { + 'name': '广安市', + 'cp': [ + 106.6333, + 30.4376 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„VlIV‚„kšVšĀ„Vkš°šlK™„ÈIUaVJlk²„˜y„Ln°„UW„nbVKl¥²L@blJnzW°œalV°Inô¯‚K„kšKkkƒbV™šmôLkéƒwVk@KnnšWlwn@laXL›ŽnXVW@X°a@„XKl™nw„@man™@w‚@na@„„@ƒw™ĕġġ™wUkUWb@mk@™¦ƒ¥mUÛb±yÅn@bml@kV@„ƒlknVbmVnlmš—bÇk¯bWyk@V_UamJ@I—@WaƒVXamIVWkUkbVaƒUUxƒ@VnkVU¼›bkKUxmK™„@WšƒxnV@n'], + 'encodeOffsets': [[ + 108518, + 31208 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5106', + 'properties': { + 'name': '德阳市', + 'cp': [ + 104.48, + 31.1133 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nUW¥²é@šK„¥‚UÈÅôa@VÆLUxnKl„°V¥ÈmlÅÈV@£ƒWX¯lLln@UšƒVÅlwUm²U‚VVna@ƒ@KnbV™VwƃœI˜mXwWƒkIVwÝĕVUa™IƒèmKUzkmWnka@y™@l²kJƒ²Vb™VkšmJUšƧ¼@UV™bÇKUam@Ua™_¯VƒUk`¯LVÞǚżm܃„@Uȃx@l„ƒ¼ÇKkbWŽœšVxUbƦnxƦĊV'], + 'encodeOffsets': [[ + 106594, + 32457 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5110', + 'properties': { + 'name': '内江市', + 'cp': [ + 104.8535, + 29.6136 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@²èlUUllXĊVX„„lmV@zn¤›ÒnxmnXxlUnVlwšmU£VV„Ušbl±„„ƒL@x²mU_lJš¥UklU@ln@‚kXbmKUxÈbl„UU@`V@š²„mlLÞÑ@yU@„¯ôn‚™„W„zšaVlV@XwlKU£‚»—aVaUwm@mwUVUwkƒlVDzLlƒ„KV™m_@ykUmƒ@mU™çkKmxkIU‚Ý„@LUJ@n±„kº‚LXb™¼@mmIXa™@mamnkW™ƒKUƒƒxƒ_U`UklwUw™mUbƒV™²ƒakbƒmkn@`„UmҙšVxUb™I™`UƒaÝÈ'], + 'encodeOffsets': [[ + 106774, + 30342 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5109', + 'properties': { + 'name': '遂宁市', + 'cp': [ + 105.5347, + 30.6683 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ÞĖUxlJX„Vb°@„xUÞmbUxƒbXbm¤VX@lk°ln@x„bÈ@lLVlVUXxlJšç²UlwV@@UÈWl™„L„w@w„V˜wXaWm²¹@»lī„¥„wƒ±šI@ƒšV@bl@kLUllUVVn@mmU„wX™ċbVb@VUkbmamšW@kƒa@™™k@ƒlaUa™@¯b@šmmwó@@lkXUa¯°›LU‚am„m@óƒkXUb±bU`kLm¦ƒbnVmbnVmô'], + 'encodeOffsets': [[ + 107595, + 31270 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5103', + 'properties': { + 'name': '自贡市', + 'cp': [ + 104.6667, + 29.2786 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lIÞDŽbVŽš_šJVaUwš™nуV@_lm„nla„bš±„UVašnVxkxVlV_„`„wV„„LšlXnmnbš@WbnJ@nš»WaKl¹²ƒ@mVI@KރVlJnw@aW¯¯¯UmVanL°w@aƒk„mmU—xmƒULWxUUÝKōèU™KUƒƒkĉKƒL@ÆnX@x™‚Wȯ@Û»™nÇÜÝLka@b™KƒnUaVmƒ_ƒxkƒLX¦ƒJl¦ÅlVb°I@bnaUŽmlƒUV„UVƒIUŽ„Kš„„a@nml„„ƒŽnLl„našJUbV@'], + 'encodeOffsets': [[ + 106752, + 30347 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/tai_wan_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [{ + 'type': 'Feature', + 'id': '7100', + 'properties': { + 'name': '台湾', + 'cp': [ + 121.0295, + 23.6082 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@\\sŽ@pS}aekgKSu™SsMß`¡CqZ·be@Q^o@‹gieMp‹‰]}•}Ľc_Kk…{™ù“A¡r‰[uom@эĥJiq©mʼnq¯Bq]ÙYgSåk_gwU­isTE…“‘ĕiqiUEkue_‰OSsZ‹aWKo¡­q“ycY£w}‹ĩ™ĕS§Z©S™N¥SyLÑ¡±Ks^IY‰PdƒY[Uo†Fp}´\\¬\\j]ˆe܍ò‹¤¡–ā a\\bn™U㺹Ìs¼j®[cíȈEŽĝĆ`ļf¶Š®K|VØDdKGpVnU‚FjpH—F`†B’[pMºxÖjbpÎxp€¬‚|ΟÜÒCŠ²®‚ÜAp„ZG~€Šd˜ÞàV¨|¸€`|Œ²tx~\\~|dFf^zG€ĄŚhœdL\\hĸž¼†ŠOªP®lV`p\\]Xpll˜æ¤œCpQ|oF}fMRi†NSon_²qämœM„NM‹\\•'], + 'encodeOffsets': [[ + 124853, + 25650 + ]] + } + }], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/tian_jin_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '120225', + 'properties': { + 'name': '蓟县', + 'cp': [ + 117.4672, + 40.004 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@EUDAEI@WNMNCBFAHFFNACDJDPBD@@GD@DIFFHEFGDBDEQOFG@EI_KG@OcJQM]RMEKBGPG@[LaCIICBWKCEEG@WBQHCDFD@HSLEJI@IHWECFGAAEKCGDBFCBSBIDCKKHEADMJMFABKOKEQAA@IEEG@GIQAEK@OZEESMOL“lu@SLUTYFQCMG@@SQUAYKAACA@IB@BDB@B@DC@@BGAEFAA@BEGKJCC@AGAIHA@@JC@QEIP@@A@EGIDC@O@C@@@@CJCWKABFLBBEBSQGBAAMIEM@AKBcJEN@BEBCFMAEFEF@J@BG@BFABECKFG@AFQ@@F@BEB@@A@@AAAKAE@GFGDECEFEECBKIKDELDFEDYH@EIACDCHKBEB@BAAC@ADBHABKJIAIJICEDGDCD@@A@A@DHCHJHDFEFGBKRKBGIK@GIMHSBCH_BOJECCJCFKKMD@DNJEDEGC@OJCJHRUL@HRJ@H[DCNKDZHCTFDHCFFKR`TANVDFZRDLFARB@HPAPG`ILAR@TERNDFNHDLCLDDCXDYbHF@FEB@LDDVE@JPNfXPINCVDJJD@NJPAJHLXHDNANHhB@DPNLRMTBFRBHHr@`NBFEBOCCBIAQJDHCHLHFA@HSDCRLFTB@HEFLNF@PELBDJALFLTC@EPFLLP@tUHQJDfIHGTB^JTCPDLKAIBATFPADIEGECEMJ@JIAIHGECFEAGDI\\SPOXAFCL@BQTQBBTMZECYGAHA@GJAE@HCAEME@IECFKJADDBABLTHHG@ILEAMNDJCDHEBF@@JNFJELDFKTOT@JETBFFHBHEHKI@@IJEJ@XKEOUMS@AF@CEB'], + 'encodeOffsets': [[ + 120575, + 41009 + ]] + } + }, + { + 'type': 'Feature', + 'id': '120114', + 'properties': { + 'name': '武清区', + 'cp': [ + 117.0621, + 39.4121 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@FWôµ@IFCLIB@EHNBp]AGEAKAEDMGZKFGBGME@ILGP@HEFB@BXMEAHUGC@IHCLOD@X[NWHWPKAEF[@EKIOL@EKGBNMJ@EIEHKBIC@BAKMIACCFQZCF]DB@ERAKADIHGEIBCGIIECFaGLZO@EFCNGAGDGAKL@BMG@IE@ADSDEH[JGC@CGA@BMDeK@EIACFE@@GG@FIAMM@CCGC@EM@ADE@CFMAAGHBDKIEAJG@DOGCDEKAGIS@KFCHKAEHIE]BeKNO[IFIOELC@A]GMBKVYCDDgGAICARc@MW@AQE@DGI@@AQ@@BKBAIQQYEFW@CEADIGGBCEIiMEMF_LGEKMBBDWEBGRC@E_CHYGCH_IAED@FFBQh@FGJaJ}AHRAREF@bE\\C@CT`FHC@\\BBF@BID@HGDDJ@@FAHKBARECKDAZBJIVNHCTA@EREAMLHDAFFBVFFC@RNRETHD@FOJMACH@CAB@P@DF@@FGDWE@FFSIEMKQDYCCHKb^JADOCIDGNDBdBCFJB@EC\\A@BJEA@JAAAD@HHD@LFBCFF@BERDHNhZQHMBGHOACCEBWEGD@PSJKCGEUD@CINLFGHE@AJK@HDABBHTB@F`DBFLBBHEDARCFG@ABJBAPVFE^FBGLGCFG_BMLEXGAAFE@@JNRVJHFALFBEHQJCTbNDHCF@PlFLJSXCHFHfVBTNJ\\BPJXC^FAVNFCHFB@FFH@JF@\\ABCFD\\BDMCAAJKQBGAILOEGHILECQLWFENJHADC@QxNHFJNLDFA@CBA@D˜UÂmR@FBL@BD'], + 'encodeOffsets': [[ + 119959, + 40574 + ]] + } + }, + { + 'type': 'Feature', + 'id': '120115', + 'properties': { + 'name': '宝坻区', + 'cp': [ + 117.4274, + 39.5913 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@TZbB@JHD@DODCLM@AP@LL@BNH@ETFN@`E@DNG@CHLBCJA@AICFKDDBKA@\\N@AFNAGRBFjFFFL@DHLBLFQPcXAZMJ]GAVHAIZJFNE@JpDRRDCLFDGXA@EFF@CFFPDfEBDB@DCHCFCJDJIJBLI@I@CB@@ADBB@FALADGDC@@H@BB@FZGFCCE@@FMLALJDAFFFEFDFCB@@AHCF@L@@BBB@BB@FC@E@@R@BEL@HEFD@G@AH@AIB@@@FEFEBALDDEFAFO^IF@JCBBFPNJJ@D@PRDCEKBAXL@BIFD@T@JE@BHHJORFDI@@B@JGH@@B@BDDLIFFHCD@D@DEE@BAAAB@DAF@B@H@NGLJLMRDNMfGIEPMI@GDAKK@KIDIJ@GE@CFDN@FE@GFEPGV@TCDFKHBBF@RW@DD@@ID@TJFKIKLI@EP@IGBCLAEKLEN@KSHIGYACSD@SEAMBBMGEBMQBCMIGKFB[D@HDLPHDBC@IFITDLG@IIIFGVBNJDLN@VIRI@YIAIHIC@CLKZCBEE@JECEIHEAKGDGECBGEEM@@DA@CCCBBEGA[GEDBBoNAAH]MKiIAWKQoIIPMFQAEEDMH@FMSUYIeF@EK@BIOEKJEBICFKaKPFAFSE@LWCCFMHDDEKESBOGBKIEIODLG@CCDEQCEDWEMDIEIB@EHGEEDAEAa@@HqDEJGF[AECCFa@WCEIKAAEQB@FCAE^YDERDDJBLNABD@AJGLJF@FNIAMLH@FPKLJ@FE\\BFOLGXMXW\\C@KPGD@JHDGVFBWN@AEAGFO@KH@JNFAHEHYLNHFCLBFBBHo^MAFGA@KJED@Jó¶EX'], + 'encodeOffsets': [[ + 119959, + 40574 + ]] + } + }, + { + 'type': 'Feature', + 'id': '120223', + 'properties': { + 'name': '静海县', + 'cp': [ + 116.9824, + 38.8312 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@NGFMDATCNDR@CCbINEHNJA@C\\EEGVE@IhE–[˜w”epc¢·²›^QEKIEKIgiQDkehY£uSDBMkUDOJDHC@GF@CAFBFEN@C‹Q@BeP@@G@HD@@MHQKi@[IGCOCESE@GMA_OcCGDu`aˆ@VZzKDkJBLNXGDqKEWE@cFEFA@ƒISIi@@KMABJGBcMuFEzGVH\\ATSEUBeALCEMG@CEBUHUCGXaBPtUBBFIBFTDFF@DDKBFNGBJPHXDDMDCLJ^mBIHIL@LR\\@LCR[@@z@NFD@LLBNb@RHDBNTPT\\F@BJF@BXCFBHHBDLFB@HODADE@@JHVXCPDHCFTLBBFNCDCCCU@@GAABEHHZHBCAEdEjFDD@GfD@DXFCHF@ERFDLBH@'], + 'encodeOffsets': [[ + 119688, + 40010 + ]] + } + }, + { + 'type': 'Feature', + 'id': '120221', + 'properties': { + 'name': '宁河县', + 'cp': [ + 117.6801, + 39.3853 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@BFLBFJXDb@DEFD\\BHEFIrC@Gb@FBCBFFGH@FJAJFNCXFFCRDCFDDH@CKJPJFALPHTALFCFGCENDDKXF@ETEBO‚bLELJDFALIPFAJL@@FfEZJTVENG@CNFFRBNEJOpJLRBXjJNLG^BBpMAAFC\\HHBAFDADDB@@CN@FFAHFDCHLHFBJGFCFUNKJJTD\\XUXF\\^F@DDDQXXBRLRCBDFEVCDLVDpUl@LEDJHAPRFGL@CETGPBTCDDVI@CFF@GFDCCVGLKEK[Y@MECISG@BKNSCGCKWEAaEBEKNGFSECO@GGM@GYI@DÅCMLHPTF@DJHAVVNKEGDETJ^[TJNNd@NOAMFYJ@@GFANDPEJB^aOadSTQSI@MHBDIEOKCG@EEFCKCqXO@@DMFENCDDHCCGJ]AKFoDaGGHYFDHKJiCMFGC@EQ@AEHGAC@IEAATKOHGIC@IXIFEoƒGE[JCFCDHNmRADFZMF[EEBMO{GU@AOW@@]ZeHBDEHBKEfQkuIWBs‡@EC@d[@[^EDMTKCEEcI@cDAB@FCBCACmOCG{PYHeBgPwPFDDALFFFCHQGSD@BHFAR[TaFYXMASUiGFL@DQNCJI@@D@PLDN`ETEFIGMCGBCE‘~CAIFDPEHGEQPHJADFJGHCJLB'], + 'encodeOffsets': [[ + 120145, + 40295 + ]] + } + }, + { + 'type': 'Feature', + 'id': '120109', + 'properties': { + 'name': '大港区', + 'cp': [ + 117.3875, + 38.757 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@JFFL°_`ONJKDDFIFZN xlb~yFVNRŒrdJGzDPVFBCTNND\\UR@E`F@@Ip@IWGUoawOEE@ÏDgK{İEEMFëC—b…™@—KwOCDHHKBDJCDEEEAGHOABFABMCgDLSQ@CFEB‰MgYIDQINE@AUSwSAdYEHQMEyK[KI@GRMLE@@OqOoBOnpJ@BmEAFHL^FDB[C@BBDVFAHFJENB@sNEjQAMYsUgCSBGDJH@\\LjGR@NC@@G@HO@AfR@DŒM@EFEADBE@@HGDICCPlVANTC¤vgZlfRChjLJ'], + 'encodeOffsets': [[ + 120065, + 39771 + ]] + } + }, + { + 'type': 'Feature', + 'id': '120107', + 'properties': { + 'name': '塘沽区', + 'cp': [ + 117.6801, + 38.9987 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@|ODHnPBDADEDA@CB@ddJFFLDNSFC\\]\\@@cFDˆ@nACOMW@M@ITURBRZNHNWRQšoO•j½f‡cqŸAqeiDÿÍyÓįFL|Ch@ÐFFxPpbHVJXo@@JCTR^BPABQA]^MB@bE@@FQBFVJRH@FXtPNZSBAja@@NƒDTŽLJrQTHFXZFB`'], + 'encodeOffsets': [[ + 120391, + 40118 + ]] + } + }, + { + 'type': 'Feature', + 'id': '120111', + 'properties': { + 'name': '西青区', + 'cp': [ + 117.1829, + 39.0022 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@LHAHRHATh`LHNHDG`HDGZ`D@FQDAHXFACNAFLVRTBFOfHDCVBFQH@HSXHEPFB@LDBF[bDbLFKJBFLADBDjLvCPEI]FGEIGCBEUSjcFiBIVWfaHCjN^HtwBBFGPBJGjFBEGECGDONMFAP]TDHQOWCMGAMHKIJEIGQ]aDlUG]VGEGDC„{PEbBZmE@@GH@BCA@FMQCFMYMJECELCMI_P¯`]R±œ¡¸od“f—x•\\gF@JUFFH[F@DIBGMMFaJDDQ@MCSDCBENMH'], + 'encodeOffsets': [[ + 119688, + 40010 + ]] + } + }, + { + 'type': 'Feature', + 'id': '120113', + 'properties': { + 'name': '北辰区', + 'cp': [ + 117.1761, + 39.2548 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ROHFFGCOJEDB’}DFHANDJHFEFSM_KC@O@CJ@DIRM@CEKKA…L…FKACHoLSJSIBETDJaEIIE]E]K[MYUYQILC@GF[MGNKEK@A@BCWECAIFEFYAGFOMI[OFuDiKACBCEKIAELaKaCE\\CA@KEAFOWGGTG@ERUACDeGEPSAUQKHE`FNjNFJADHHCJFB@DEXZFRRBJLA@AR@@BJ@CHF@BRX@@NQdDBBJhHCCZDLUNA^H@BKDPFEJ\\JMPfL^AJFFGLBDGLET@HJLBCFHDCPH@BIJFCLGABHNBDEF@BCN@@FHDDDN@BNEJH@@HF@DEJB@FfLNC@AHB@DHD\\IFGTCBCF@@JNH@ALKHBHCHBDMFEP@KYbHDEJF'], + 'encodeOffsets': [[ + 120139, + 40273 + ]] + } + }, + { + 'type': 'Feature', + 'id': '120110', + 'properties': { + 'name': '东丽区', + 'cp': [ + 117.4013, + 39.1223 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ZV\\N^L^FJFFJIbSCAFTJTIpKDGLB†E†KLBjHTVNBZWbE\\SBQGE@ATCRHDGEEKECBECxOhOfAZGA_YEEWSGqRKIS„C@Mb@BiTAMYsOEWG@IQEURA@EF@@acUOXQRYCUDCHDTEF[SUEgAYDcVGJM`iAWDWLQRMHUHgDsDBLHJFCFDFGHBFFVEAGHCJN@RJF‡PIhBD\\FENCPWA@LFBAFHBEJUEARCDIAEDQBRNa^'], + 'encodeOffsets': [[ + 120048, + 40134 + ]] + } + }, + { + 'type': 'Feature', + 'id': '120108', + 'properties': { + 'name': '汉沽区', + 'cp': [ + 117.8888, + 39.2191 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@LMEI\\MTABKN@FCDMH@COAcH[AoēA™M¡Wa[Meq™pQRMXMGQYQASV@J@NNXDPmBAtJXlveRLFGACFGAYf@^X@BPV@|HNPFA\\FNEEYBCnQGMDCDE\\IHFp„EFWJ@JJDGHLPBSFB@JBDGHBFR@@FHDNEjDLICGZEHGbHpCLE^BHIDDCGDCFMNE@CP@rWLDEDFFH@'], + 'encodeOffsets': [[ + 120859, + 40235 + ]] + } + }, + { + 'type': 'Feature', + 'id': '120112', + 'properties': { + 'name': '津南区', + 'cp': [ + 117.3958, + 38.9603 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@TLv@CNHFFBHGZFETNPhCVGNGRQXKXCjBN_HIdUZChBVF\\TFECSDGVCZDRQPWdVNA^]RBBAAOQ]DSE@F_Q@[VMCSMADUECOHycI‹qMQEU}zkaŸwENRDENB@ADG@@HF@YnaAOFƒ|CDFHUHH^kVbCR^JHIFLJNGHBDNPXGRSCO^EBMNCPDHHFAFiEIHOAEH'], + 'encodeOffsets': [[ + 120045, + 39982 + ]] + } + }, + { + 'type': 'Feature', + 'id': '120103', + 'properties': { + 'name': '河西区', + 'cp': [ + 117.2365, + 39.0804 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@d@hZNFdcLYXKRCtCMOFSYEGHEAGEDMu@SKAAsx]GMTGt'], + 'encodeOffsets': [[ + 119992, + 40041 + ]] + } + }, + { + 'type': 'Feature', + 'id': '120102', + 'properties': { + 'name': '河东区', + 'cp': [ + 117.2571, + 39.1209 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ZBVFFIGABEEA@KXBDOFM[EACJgˆOIE@QIMGDBHUFEEGAEHECEDGIAKQDWLKZcdQPEP@FOFBJTJ@HNORJf@DBCN'], + 'encodeOffsets': [[ + 120063, + 40098 + ]] + } + }, + { + 'type': 'Feature', + 'id': '120104', + 'properties': { + 'name': '南开区', + 'cp': [ + 117.1527, + 39.1065 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@NMVDCG\\E^B@HlB@YEDS@C…HsNSiMGDebUXAJEjidVTAFHDFJ'], + 'encodeOffsets': [[ + 119940, + 40093 + ]] + } + }, + { + 'type': 'Feature', + 'id': '120105', + 'properties': { + 'name': '河北区', + 'cp': [ + 117.2145, + 39.1615 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@DBXFADB@L@LFHM\\NHED@JKZRb]QMRAFCJBDCBQYADMCAe@QIMP@GSIAIPE@E[EGH@ZEF]^HJAXK@KF'], + 'encodeOffsets': [[ + 119980, + 40125 + ]] + } + }, + { + 'type': 'Feature', + 'id': '120106', + 'properties': { + 'name': '红桥区', + 'cp': [ + 117.1596, + 39.1663 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@J\\PNHEZBFEJELEL@BWGI^]FEkA@G]A[FDHUCMNEHJ^'], + 'encodeOffsets': [[ + 119942, + 40112 + ]] + } + }, + { + 'type': 'Feature', + 'id': '120101', + 'properties': { + 'name': '和平区', + 'cp': [ + 117.2008, + 39.1189 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@D†T@FCHG\\FFOROMEgYc@'], + 'encodeOffsets': [[ + 119992, + 40041 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/world_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'offset': { + 'x': 170, + 'y': 90 + }, + 'features': [ + { + 'type': 'Feature', + 'id': 'AFG', + 'properties': { 'name': 'Afghanistan' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ࡪ͇وŐǬϠڐŶӂʮǚڦ۾njƀ̚ІɣʪҴMوǯʲĹ،˒˰Nj˖ϪԈiżŬĘͺβ̈Ҕȏĝʱʪ¡ý۷ͪ˟̊ǰώĊԼϖׂ×ࢀAƬʋӧĥяƹ७ĭࣗǭӫλȤΣĪллΛ–͑ɳ̡ߛ€ͦ։՗ɅΥԕ²ԋ͡ɿ̳þٝŋğɻسDҵӇ‡܍થΓבôǝȁԇņ࠿űටіހހåզُƚßՔ˟ڢάҢιŮɲؒ΂ਸ'], + 'encodeOffsets': [[ + 62680, + 36506 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'AGO', + 'properties': { 'name': 'Angola' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@ȸصʌԋȘ˕͐ѯ֊æˤŠҬşŲɀɂӨԶ®ƤіHñ̡৴RfՉǞ͕ūԑÖԫ˪̷­ৃȼüκsԴŴϦ¹ĘʹĩСƨϿů̿î́ყZᦵ֤ۋպԽ໳΁᎝Š׋Ж₭—ŵÏԃϞկ~ԉƝЙDžÿՈŜ݊̂ޒªΰ˚ݶȨΆӘռːϐĘج«ӊʣ̜ɡԚȵԎ®Ǩʶͬʭ߼ǣ֚сՐĄǎΌŔʒg̎ĸៜ['], + ['@@ɉėɣلͼδʪƘ̀˽̩ǯƍɍλ'] + ], + 'encodeOffsets': [ + [[ + 16719, + -6018 + ]], + [[ + 12736, + -5820 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'ALB', + 'properties': { 'name': 'Albania' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Ń˷ŢέΒȳiə˗ŧ»˙ϷСƛÐgȂү˰ñАîֶŖʼƗƂÉˌθаÂƿɨôǴɥȪďȨ̂'], + 'encodeOffsets': [[ + 21085, + 42860 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'ARE', + 'properties': { 'name': 'United Arab Emirates' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Ƭ¤ŒɱڂƂ۞uԖ{ֺ֪ظՠՎԮdž˹ŖڑѕGçճƪŝϝǑE΅ʓΏuͷǝDZᡋъ͏࡚Ț'], + 'encodeOffsets': [[ + 52818, + 24828 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'ARG', + 'properties': { 'name': 'Argentina' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@ߗ§ѓ̔ԑx࣑@Aሞ͒ϵрؿનԋ୲ȿϙп'], + ['@@Ӵ؇͠ڰॠ“ƊǷ໶ോۊŷਆاࡾ͡Ŧχࠡ౧ࡒɭ़ŷڔƈނ٢ƎݐжLjфӝiڣۻҩ֟΁ॅࠃ૭ଧȽڥɣࡹT࠷ǽȇÝիËѫ੨ܙŗ׃Հν§Ч߯ઁఛ҉။ǩउĎǰԅǣػƺщԋ̏ࡱř̪͕߱ɗŜ࠳֨ʧҠˆʢѧޛʻڭԹūࡋȣ҇ߏEڃљʋؿؙࠞߦǝ˿ݭ঳Ӄձটލͧ΅Ͽ˔ࢍ֔ӡΟ¨ީƀ᎓ŒΑӪhؾ֓Ą̃̏óࢺ٤φˈՒĭьѾܔ̬૘ěӲξDŽę̈́ϵǚˢΜϛ͈ȝॺ͸Ǣƙ਀ȠࡲɤݢԊ̨ʭࠐEޚَոo۰ӒࠎDޜɓƶϭฐԬࡺÿࠀ̜ބռ߂צԺʥ͢Ǭ˔ඔࣶд̀ࢎĹɂ۬ݺશȱ'] + ], + 'encodeOffsets': [ + [[ + -67072, + -56524 + ]], + [[ + -66524, + -22605 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'ARM', + 'properties': { 'name': 'Armenia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@୞ƀǨə͌ƣǛɁ҄˽ʁˋΦɫϘƏl׋̣}΃ӢHżχCʝɤǩuͧʖرȼĄФƛ̒'], + 'encodeOffsets': [[ + 44629, + 42079 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'ATF', + 'properties': { 'name': 'French Southern and Antarctic Lands' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ը˃ߐĿˆDžɽϣಇÃq҂ŮΎÊǢ'], + 'encodeOffsets': [[ + 70590, + -49792 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'AUS', + 'properties': { 'name': 'Australia' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@ߺ́ҜŘپNJԎÉÐঽ˽́ēگ̉ɰ׍בǧ®ԫ€ԭܘŗֈӝܸtϬռõ'], + ['@@̢ڇբ̈́˦ΡЖ͟đϋǴܛŸнɄĹɬܕąѥ˖֭࣬ѭצЋ֞λŋȯӔՃࣧ͜ͲȂ;ηȴźƢࢹ׬ԩϸ͋ڀڹʀڭtӏËԳА܋µݓơϵɩݡjӕǕ׻χއثЭ̫ٱ˫гʝܧ͕нɅػʼnׁªˇӕ̇व‰ޡ·ϫ͙ԕέ۟ψԥƪżѬҝǃ݁؉ܩɪӉƄӑÔ߿ʐիԮƻْțьЭ;߱ĸˢРȯزЧ׉ݝƷѮҬŶӞ͘ЬãجہܑԿ˽͏ڛٽΊ~ҀԿ،ѹ̀ǂȘઃԚןz߯Цຓāછ̝ख़˫ߡÈࢻљܯȗljѱ̳Ϳ܉qՅõݑƶ׿ğֽԁ҃ʕœуʁЗˋؕ֛Bࢽ՜ҋDŽlӖкŘƚȒ‡̠ĺאģӼѻࡖƏӒ˜ӎͭնsʚϋͰĽڄӓڔřΪτε˳ެиʑʞ͗aјеڎă˄țʦĠӠǢȸŘрęӮΎ؀Úٕ΢׀ۀˬЦΪٜ̰ϤàɴĻڎ̺ԚĤŶȀɞüҬoࢨʖҚώɊ҆ӲѐœͲvҘט܎ΠܩΦǚ̗Ј˂ТψǻĸٖҠаȮͨцƜ`ɼτĭdɂτŦОŔبϫҲӽՂMՖÿDZҦДڪϜɘſȾκӒԘ̒јıۺǂeі؛ˢ҂Ū֎ȻҀ·ۼɋʈĐԶʵӬʊ͂ñȠNJϬеɡ͉҇ͻ˿ƒĮͱʙп̗ЭÔʁڜҫ٨ˏѠ́؈ӻʂBѰɍŶʷߤ˵ֈ˼ǐҊǠόľҤʰڞŝОÔʔīӔŌنLjǠŽˬȮѾdžҦtʈ̸̾ʂЩÎՃȾķ˜Λ̨ёÚӇ‡̥'] + ], + 'encodeOffsets': [ + [[ + 148888, + -41771 + ]], + [[ + 147008, + -14093 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'AUT', + 'properties': { 'name': 'Austria' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Û΃ӁCǎǻ˧էLJƗܽsщȏۛÞயɐȉ̊ࠧƣĭDžԗŢѕxϝƶźȴƬʪ²ьɹŤɜݎ•׸ƮЖ}ˀǣþƜšո̠ń̒ϰز˓ӀΆ̐ÚٶʱЂªϰǁãŃČ̅'], + 'encodeOffsets': [[ + 17388, + 49279 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'AZE', + 'properties': { 'name': 'Azerbaijan' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@ʞɣψDGŻ΄ӡֽŒщϰƃ͆Ǫv'], + ['@@ϊËƞɈԈͺѴѵђ׭ϺŸʸɧۗãƣٵƟ̭̍ȝvзȽ¥ԻѲ̂дʝʚ̿×যإk׌ϗƐΥɬʂˌ҃˾ǜɂ͋ƤǧɚȶƎضʍҐ¹ŘIJбҔɔŚʀ…׀ԙ'] + ], + 'encodeOffsets': [ + [[ + 46083, + 40694 + ]], + [[ + 48511, + 42210 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'BDI', + 'properties': { 'name': 'Burundi' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Á০ɃϢԜßʲӎҀŸͧǸȏT˗ȹǭ͛ѫ̧̥΍Ÿ'], + 'encodeOffsets': [[ + 30045, + -4607 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'BEL', + 'properties': { 'name': 'Belgium' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@؜áުǪՐοҦȝħ֧ɕĝһܿϦћßדІϷͶϷ`ũ̒ڪǔ'], + 'encodeOffsets': [[ + 3395, + 52579 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'BEN', + 'properties': { 'name': 'Benin' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ۛįȹ׆žኞǛǦЮ̇̌ʱʞņѶ̀ĨǠξЪĀȀʤˮʘ̠F٘ә˩ȎӽǓͷĘɧСԳʵʳǁՉt՗µണ'], + 'encodeOffsets': [[ + 2757, + 6410 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'BFA', + 'properties': { 'name': 'Burkina Faso' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ֹɐϽ‹̍Ƀϗǰƥ˦ϙǾÅӦɮΤo˴ښۢŬּɲȴОœΚǢŘɎٴϖdžˀ޼ΒҦŢɀLJՠJáСŔϣӀչ€НॺȏmֻǿʣЩÿǟν˿ħ݁lϳâ˓ƉωÖร¡qӉŘم'], + 'encodeOffsets': [[ + -2895, + 9874 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'BGD', + 'properties': { 'name': 'Bangladesh' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@i׽̉ŶÆگʉѬµєDžКΕӨޟ’ü΋˃ҳΧǠũƵʃĠ͗øŽۖ̅لƜԒԫɤȆ̪Հ̼؅Ѽ֮̔ږεВ£ô׏ߞřު^Ӟƛϯ܅ϕµʷӍҢѥƎ՞ɶFѶ೯'], + 'encodeOffsets': [[ + 94897, + 22571 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'BGR', + 'properties': { 'name': 'Bulgaria' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ʎΉ͚Ö٦ſ௾«иɌবȜ̩ؒӴĕѥΏ̫׹˔ӏܣŒࡥ˃Uлޅÿס̊ڧɱة|Ñ֊сːƒŢĝĴƘˌ͌ˀСδ÷̬ȸȐ'], + 'encodeOffsets': [[ + 23201, + 45297 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'BHS', + 'properties': { 'name': 'The Bahamas' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@ȵ£ɇӜ̿ʐǾՔʨ‘ۣ̎Jӥ'], + ['@@ࣷƅÏ̴Ђäֈ{~ɕ'], + ['@@ƟׯƷņ`ѮϓͪCĪڐϗ'] + ], + 'encodeOffsets': [ + [[ + -79395, + 24330 + ]], + [[ + -79687, + 27218 + ]], + [[ + -78848, + 27229 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'BIH', + 'properties': { 'name': 'Bosnia and Herzegovina' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@̦FȿσМ͓ūЃȡ™ƽû˙țūҥݓ͈ͅΘ͋Ȅϭ̾ǻʺЩϾǬΒ̞ȕǼǨϾnܠƓ׈\\Ϟȅ'], + 'encodeOffsets': [[ + 19462, + 45937 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'BLR', + 'properties': { 'name': 'Belarus' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@߼Mࣰ̈́ȚӄېːÿϔԜƚ͖ࣘࢮɁŢȻѲĴࠒȧĊЁǷɧՄս΂Ƴ»Ʊ֦Ʃʎɡ͝ǿڳˆljÿȠ˧ȸ՝ܝ¹ʵȁÃхͭĆݷ¡əȞ̿ƥ́ŨڍjफȬࡕàٱmҡɩГeϐʷϴԌǢLͰɷ͌™ϊ'], + 'encodeOffsets': [[ + 24048, + 55207 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'BLZ', + 'properties': { 'name': 'Belize' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@OŮĸžƴı̞ԔDŽZHūDŽGaɭƋεôŻĕ̝ÀăīщǓɟƱǓ̅ʣ@àॆPژ'], + 'encodeOffsets': [[ + -91282, + 18236 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'BMU', + 'properties': { 'name': 'Bermuda' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@OEMA]NOGNG\\Q^McMOI_OK@CQSGa@WNLVWHFLJXVFGJ`ZRTDLeeWKIHGIK@@[MQNi`]VDTBHCJAPBJLVFjT^LV\\RJZRn^RH`TfJjZHHOTTFJP_NOX[EYQQKMEJOLANJH@HQHAARF@ZEPS[U_IcRQXE@EEKKOCGGCQCOGISKYGUC'], + 'encodeOffsets': [[ + -66334, + 33083 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'BOL', + 'properties': { 'name': 'Bolivia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@य़”͟گӳ؈વȲ۫ݹ؅ŗ͡୆ҋऺˆ߾ѳ΢ŏ؆ЫֲՌ࣢αۺȖ˰ƭ̶͠рh܎¤נǸ˶ܩഠزíѠnȈʪ݀;Ѷ͂સƚęؽļ͓ãࣰ֛ݫऴƑ̻ͦ֨ǕΐʑՈTӦʟšӟǐʕZγʓa͒এྖ“ūӟĜͧҞɽȤԹƫڋɯρĄӏʿǥaʶ޳јޭ^ัʓЕ݋sҋͥ৕ƉǸ'], + 'encodeOffsets': [[ + -64354, + -22563 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'BRA', + 'properties': { 'name': 'Brazil' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@૮ନॆࠄ֠΂ۼҪjڤуӞеLJǒӜŖӼBҦ̡ƴ̿Ƌ̻œį͔ýޔƿʤ֥ɪ΃ǏࢱLjÈଜʝҴˀǦăӐɰςƬڌȣԺҝɾěͨŬӠྕ”͑ঐʔbYδǏʖ™ӠӥʠՇSΏʒ֧ǖ̼ͥळƒ࣯ݬä֜Ļ͔Ěؾષƙѵ́ܿͽȇʩџmرîӃƟϡĪÈ౨ۏӷݏv҄ͅ֏¶DzΰұԞΓݴɜƶA΢ԖʎċҔɊ̈Ôϼ०ֲێNJŔŴݴŸϚᘰpθſӔύ̬LؐӀƒǚē†͐ӯĔYՀ࿖k˦̂ɸˉǐӷǂļҨѻٸÆnjʲشȞΊƐĮΤ׸ʆ¯Ǯ܅ðśՊ’֞ϓɒǀþجŅڜȿʐȤ؀žल̮͎̾ŏʂѪšȜȗʼnσ̀ŵȖϷɷ̏ƅ܏ɌыÔϳԬϿЮ¥Ģǒˆ˜ϠƦ˚ɢҬíȲŠҚçøǢƗǘĎʐͺõЈĒӔDZξǥʺɪȊ•ŘɿДÒ͒͊ʴؤӼޒ˺¢ȺҫҼ฽҈Ƒxׅمەʾʩ๤ƁŠࡃٔր੐̟ඊԡШӱƏҫ঎ʶ࿐ѹఴŽఔ۝੸व٪ʏܖ‘̦˅˸੭Ɣԗͯ൹ёշஅୡՙोثܯȿgɻءÒ༽ɹಓęօˇͧƫ૱࡛઱ƛࢁڹηȟԋ࣯Fೕ͓סύवʗ঩ڝ܅࠯ũطƔҫƽࡓȏЧחҥट๕݉ڗ֯Ͻϥߛ։ӑɷӈψЊӟֲڇҬࡹՠ̹{ࡅٰձę'], + 'encodeOffsets': [[ + -59008, + -30941 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'BRN', + 'properties': { 'name': 'Brunei' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ͬ̾܎Ң›Я·՛Б€ǭ˹ϥѦ'], + 'encodeOffsets': [[ + 116945, + 4635 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'BTN', + 'properties': { 'name': 'Bhutan' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@΂ˍÏԩۇ{ۿÈՇſޅ͊kǚ֌زҒɈ׸șѺqπɥ'], + 'encodeOffsets': [[ + 93898, + 28439 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'BWA', + 'properties': { 'name': 'Botswana' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ǜƭ˄ӡॎइήĝD̑ʚՑٰŹ՚ϝ஑أݭع˩֓ʧ́ҙãƧГďʽ՝țہ¤БɾΟĸХșȵГЉʧпϑ׻đȇ̐üԠӽߚɧŲAរࠤˆ|Ჾش„ಖ͎̎΍՜ͤʮDӂȎưÙ͔ڣ'], + 'encodeOffsets': [[ + 26265, + -18980 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'CAF', + 'properties': { 'name': 'Central African Republic' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ۜÚƺɎƔgȾȏ੔͐Τ͠Ѭ̌ĉ̐ʂüߺ½߆ϴ؊ࣺю;ՐƜĪΫӜԿF΃ƋΓÄʻ̆ʍٖοҢͻT˗֠ѫΖεɆԋغͩƊˉˣęաpكĘ̹ïųȱ˕}ͧDzधнϥĎŗÝʥԕطǐؙĊ՗̴ۓ˸҉˓͛яùדգ²֩Ƙԅѻѯޱėʐ›Ϧϧ˔̳Ѡï̠ЇѮæʢċΞÞٴȬƴц࡜'], + 'encodeOffsets': [[ + 15647, + 7601 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'CAN', + 'properties': { 'name': 'Canada' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@؎œުxЯ΅̵Å੥Φȿˬ͆ʸ̎С'], + ['@@Хcઝ˂ޯІ̄î૆Ɂ࡮Η|Ʒ'], + ['@@хŝൡϢʥ̘ݩ̌Ưʈࡻư͕ҜðȚࢨǿԨŵ߄ė˺̃дЋ࠼΍Όҩ'], + ['@@։ܿո˴֠ǵ̏̉ݚɱϰȴ࠼ʵʹ؛טƞņѿʼԷΝ݉ϝ‹փǂǾیɻńইܯԅ†צЂ߫Ȳࣙ¹࿅~ŹʠԼ̐λɬ۸Ԓࢄ೾Զӎܲ̂϶™Njɫ҅Չ'], + ['@@@@@@@@߰äʥ॓ܶگͯDԑϪ̵ϮчʾƻτºˎЂŋ'], + ['@@͡ѳχîəʢ Î͖ʦΆkɈǣ'], + ['@@ঝҧץnǿɪزϲ଼SiǍ'], + ['@@ƼυјżӨɗं˽४ʽöЍؤÞ׶˥ݙ˃ಳȬҽϚ࠭ҁ஡ѣ˿Ӯଗăܴдņڌ˺ޔ؈å'], + ['@@ष¥ȿЪΦҼޖŜپɷXέħřձʛ'], + ['@@Է̍ଉʬۃğଫϘ݊ʼטζࢼʃԎƯʦDžԠ͍'], + ['@@G࡭૰ڄ৐եʡح߾֥࢚؈ؖܨ°ईஞÝఔūૼй¼зس҃פ҇ŃУ࿩חୡŻࢃʨʣуߵ۽ʓοই֩ளÇڏΡÇձ঍Ŀਉڻ࣭ु͙ڏ±উంƕϜ޻ϼّ୲ǔ༞εࡀ͋׺Ѕ੆ɳࢸΟ൶µࣴąƍܫʼࡋ،ळనߗ٨˚ҔࡺѭೢףѶഎЀ॒לҮהç֭֘܌৷لলࢤνݾ˫ಾגȘ෸ɫࡸć۠ɚ޴˵ਚӣʮ͙ຄÛ}۷˪ਜ਼ގſ،ӵ௖Ұߦऔ֌ϸٺݣબੳघ৙͵Յ૤Ӂݰӓംɏբˍͬ܃ټŏͶͅÖऻ؍́׽̏൯̗੏ۑ෇ƋᅛǮుPࢇÍ۱׽ੳω௉૗ॵޡ܌Ɛഘૄᄈ۪సČݔЫߍ֟ˊࣟ˜هતп൸ŨࡆीÎ؍ժ̥ਣսᇷԁ࠯ͽय؁ٓ֍܆ฤ۞഍ƒणĹջӆBନύʐ֛ƛ˧ɚٙىʱٹ̕ϡΥŽˏ¥čȹ໽A౥MϛƷࢵ؃Ŀßˍ͝ޗBࠛGϛƅƊǑøʯeďષлࡽſউ҅Ɂ@˷ƂĥŦnĔȂ̎ЂҦʘӺǙܴǵނ࢕ЂľƬūĺɳ@ǛƆ¥ȤǍēɥ€¾ĊȡĊćɚٵːڹ˪ࠑ͘߁̨ݧʃ˝Sਕɔڻʼnࠁʺ࡫Ɔו¾ʻƜƫҤ˳IE͓჏BᮝA᭯@ᡃ@ᠿ@៙@ᢡ@ࠛ@᠁@ᛷ@őF྽ࠜ׵δຽΐҳݖŤԨ੻ΨƧڴ৭؎iѠҲКwՌෙ՘࡭ॠՁ׾ޑϚ֣ΈѿѢࡇ˕ࠇҹݛւדπࠋɸࠟ|JⷎNᷲ༬ȭ೘Й࢘û݆ΖৰˀఢĹ఼τ൘Ⱦ־ΑظȠȊЄ׈ęෆݫ૦֬ŖّਔƐ͆ʖৰ·౼Λዸ̭ୄƛࠖÄଊэ஁зຶǷᗘIJܒƦࣆԋࣴьࡩΦժ˼৾žڦĎڴȩࡊҗरä๢ϛಬƄ௬oĭԺݞƦದ˵KߑՖڠڰuϞࡊ࣑԰কͺäघশ؎ૌƇࡘχଞॅݗЭ༠ǝ'], + ['@@нϿሎʬୠщॊіސ˟یࠛфΒ׭ࡰ݊Ŭ࠲Ƈश͹ՆࠉʼץථеະЉĝσൡã՚͓˱ູ̯Ƃฃɪঋ»ཅ˷ᒃű๻āҕІଫɮݙģਛږ֔ĚಘƜஈ›રƦྷȞᅗã஗jѷ̴ዎͲಗ[ืɚ۶ـגͮᖬԠ࡬Nj'], + ['@@݉ևಹך˸Ş૸’ٔȁ'], + ['@@öɵࢿ|ࣟjࣿőʑ¼ऍѾ˜̠ИÈነěชң'], + ['@@ڎԽޤڴᒆΈ෺ࢅůջဒʒߒͮሀыୄЏŊν༚Ȑ࢘՗᎐ܸͩ͹ߐ޻໯ϹጘչೲȁீޙೖÇʽכ้ঋਗά೓߲ઙĿŁӕࢪӥଜϯΌɟմࠩ́׿੕ɪᑏڨஎܣ࢔ԕƎ̉ᗱͲᅩӤ৳Ц̌ʂయќ௥Т`ʑᝡƅ܃˾ֆؤ཈dႸņ˫̜̊оચࠊɳϊ͕˾౿Рၳ˺՞ɆࢷԺ݋´ڏ˸҇ʛ຿ŅᵝȈᄫʚഹŴۥ̐࢞Ϧ஝Hˉ࡚٦ݨࡺ΄ᓪɢأի'], + ['@@৊ǯຄńɖʑ޷Е౜αƱݳ൝͗߳ê׉͎ᐡٮjˎ႖ĽएռসР'], + ['@@࣓عय़ŒԽ݆`кѮΨ࠰ɮც‡ྈȱళݟ৉Ǎ'], + ['@@ᕍЙѷςኹѺήΤ׌ؘܰւࠑԦᭊƀ஬ǧᒰ±ࠄʑࣖΝ੍ɃᏝןਫי@ν'], + ['@@ҙ͙௝Øৱɖ҂Ϛீɨܼ̬̍ˇ'], + ['@@ٞϵ€љϣس൱đࣗƈjӬ൝ÝÁٮࣜౌ˺ஂµÜŎ'], + ['@@̙͢ݠƘࢢ™ƪЩԝЋ᭗Žᑯη౩mŅ˜პϊ④ij୯Ʈପࠐ߈ɾᛄ˳๶ӻฺÛறߨޔ̪ࢄĭ˲Џ'], + ['@@ढ˓ကFܨˡȑ́८ȍՔȧଊ™௬ë೸ǼႊðീÏ࣒ͅȊ΍ԽɟభǷ੽ĸᜱŻႫcഫļᖁ˔̃ҦĹжࡇξ჋ĺঅʼ͂ΈႾÁ'], + ['@@ŗ٣٩̇޹£༝Ϋ഍ŹଗǼ@@ුؼႮծಆ[ସŬ'], + ['@@ϣy༽Âɡɼၜ]מƻĵĩ'], + ['@@༩ʋఝ˔ڼˎ௮Đஈſ˩ʥ'], + ['@@৽ǏඉBbŤࡴʦҌદǝ'], + ['@@కǥۃȚέ͂áΎજ‘ӪÅ৐̇ɫ̣'], + ['@@͜Ε൏Ĥ൩˘ሏŒߺʠ৫ȮÕ͐࿶ŕᗢ̫ٞЍ'], + ['@@০˕ଽʟ༇ك๥Óდņࣗ΄^̦ڔɢ໡Oए˨ՑϠ׌ώ׊ʲࡴÎοȖዜ¨੶҅මǵ൞ǃڒև'], + ['@@ᖢßᅮŅ໤ɫ™ɡᏅη᎙ǟݻȉᆬJጡԙേʃ෯ۇႿƓՙǡᡷěୈĿׇƭ۞бߙ˽ಛʃЋ͡୫ʣŞȏ෬lȳᖟԋᔧɴឿŻధĸཟªĿЖ༊Ȑб؆ԢÐᖤγ଩բഹLjڼ͘๰Ȩʄ̊஋͠ΥѠᘞ—ڒĝ಼̪ቃĬ᰽Á๣˸۩ͼগʘȁ˺దLjঘ‚࿲ƌం̺ਬ©ࣤɽٔҒૐƈບĢᢲ–Ҁĝ᝚ƚᆔÁᆒÁ'] + ], + 'encodeOffsets': [ + [[ + -65192, + 47668 + ]], + [[ + -63289, + 50284 + ]], + [[ + -126474, + 49675 + ]], + [[ + -57481, + 51904 + ]], + [[ + -135895, + 55337 + ]], + [[ + -81168, + 63651 + ]], + [[ + -83863, + 64216 + ]], + [[ + -87205, + 67234 + ]], + [[ + -77686, + 68761 + ]], + [[ + -97943, + 70767 + ]], + [[ + -92720, + 71166 + ]], + [[ + -116907, + 74877 + ]], + [[ + -107008, + 75183 + ]], + [[ + -78172, + 74858 + ]], + [[ + -88639, + 74914 + ]], + [[ + -102764, + 75617 + ]], + [[ + -95433, + 74519 + ]], + [[ + -123351, + 73097 + ]], + [[ + -95859, + 76780 + ]], + [[ + -100864, + 78562 + ]], + [[ + -110808, + 78031 + ]], + [[ + -96956, + 78949 + ]], + [[ + -118987, + 79509 + ]], + [[ + -96092, + 79381 + ]], + [[ + -112831, + 79562 + ]], + [[ + -112295, + 80489 + ]], + [[ + -98130, + 79931 + ]], + [[ + -102461, + 80205 + ]], + [[ + -89108, + 81572 + ]], + [[ + -70144, + 85101 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'CHE', + 'properties': { 'name': 'Switzerland' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ƫŹȳϞƵіwá΅χƙةŀǻ͹ЏơƄһ˵Л¡αǶ˽ςБſ^ϠؚҾɈϤûɲƞ܎MǦǼ࣒ʱ'], + 'encodeOffsets': [[ + 9825, + 48666 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'CHL', + 'properties': { 'name': 'Chile' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@Bም࣒@Ԓw˧ͻܛʻЭ‚ӻä؏ʨ࢟ŨੑҸ࡫Ҏୃशۘǭ୼֗૜̟ѢϬ˘ֺޠΎװı'], + ['@@͢୅؆ŘĺɁ˿ࢍࣵг€ඓǫ˓ʦ͡ץԹջ߁̛ރĀ߿ԫࡹϮฏɔƵCޛӑࠍpۯٍշFޙʮࠏԉ̧ɣݡȟࡱƚ৿ͷǡȞॹϜ͇ˡΛ϶ǙĚ̓νǃĜӱ̫૗ѽܓĮыˇՑ٣υôࢹ̧̐֔ÄgؽΒө᎔őުſݝPЙȷݷ̣Ɖ޹Σoॅ˚१ג@@ਲ਼ӔˁՒʄӰх֒Ņ෤Φ߰ࢴٰౣʔߞݒ˸ඊत̏Ѯგ֝ɠʿ਻ՉŠ˂ல˺༒ϮָʍࠎéूΠ„Ԩപ׈എΤబȗ఼ʤۚĵਞӮਆưྺ˒ნˀሤÕ൘ǩ஄ќɌɦњЬֱŐ؅ѴΡ˅߽Ҍह'] + ], + 'encodeOffsets': [ + [[ + -70281, + -53899 + ]], + [[ + -69857, + -22010 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'CHN', + 'properties': { 'name': 'China' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + [ + '@@ԑഓΫۏѷ܂ĩخӶࠜڦَϨʡƣԓ', + '@@ܩЗۏʺyܢаϠࣾɾӚoȊ͍σσșӟ' + ], + ['@@ฬˍ঺ׯͼ߃౨Cܰͨ൸ʜѳݱ͙̭˽ः֡ࠇ৵ƪܝ̑ɜܙť঳ѕwLяթӺͯһಙαƀѹܩŒЍ˂ֽ׭ऑҋۃա୭ʑأϽࣝɭ҂ϴǭ͞ږ֠ѹѲܷ̓ॉ׏ԫթ࠙¡ѓϻѸ֩یƏ„ϕڔʕस׶ݚ͝լuƌѱஓɻϻҏࠇућיࣜҥͦࠝԞޓ֮٥_دՅɯȪ҃ӶʻŻۃɇڗҷ÷ؗࣧڹિޭোିޡୟۻृĩԣύ̃˘Ӈй୭сࢵŹ˻ࢱҭ·ə؎Ȧ͘ૻːЇƍࡍɔЏ΀ƄӜޏƶЙܑ̀҃ࠇīڡJ҉ȳѥūŶ॥҃x÷Ȣ}Ύ؝ʓεƸر͂ʔۤՏǎȧޜࢱƓĴাߔۮ”ۚ{٠νȨ˭ӶӭÙࣟŲ˴ΜϿԺ׳Ν۵ȸॷ՗އسڳĿοɦѹr׷Țґɇ֋رëڌԟǭওĈोȖڿτٵǔ˯ЖҽŦࡓոکʴΑȩଢ଼טࠛՒɽऐ׾ő‚іͭјĐۆࣙঠ൧ͼʝ٦ةϼƫʌųӎˆ͜ԛȔ˟ďɇިʈȔśȠߤЈ׈ǐࢸő͆՜ંIJͮ̚೜ҔŠȐãӐּɔݱฦဘͲјȈ؆ຒဠˡҲϞ¢ࡆۦĀٖ֔͢èɚו۸ѽப̿׆ڱ͕ঙ̢ηূƝଆŝ৪ԻԲġϤޟӲӿऒnჄȉ૤Ŝࠦůఔԛ৮BόʽঐҌബ̈ాŒঘ̒׾҈ך˰Ƌˤˍ͔ѴըӀùࡺǝ࠸Ѿ౲͚؞֊נʆ௠ŐڐĥĠ̘ݿזګː٥̳ࠣžӇŃɏΆר࠾Цو৚̓ஆՎQτݸࢾҲːWҪңȦۜмਰƲ૜vసʡ݈̱԰ࡏ̀α̊ԩ̶ࠕ'] + ], + 'encodeOffsets': [ + [ + [ + 124701, + 24980 + ], + [ + 112988, + 19127 + ] + ], + [[ + 130722, + 50955 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'CIV', + 'properties': { 'name': 'Ivory Coast' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ϣUוǒ՟Wহƥ׍ʍ̯ࠫNjvÞۖĄŀ}ͨΣΚˉÈʕɲǾώčО ʔƄB¸ξÝnjĄŜ̸ĶȹڨȗΎæ˸ǘÞŊúɸųٮOƸʖƢgʎĦžΫȞłΌŰϚǽƦ˥Ϙǯ̎ɄϾŒֺɏɠ஡Ο۷ɕेθܣ›ͧ'], + 'encodeOffsets': [[ + -2924, + 5115 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'CMR', + 'properties': { 'name': 'Cameroon' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Ľ°ӻŇԝŒЋÅ൅nŬڒ͟֊ϧƚǟϖɋŦXɶɎתЎ߸ʒRԄӮ͈bҾΉ־˲ĀΔȌͺžь҆ΊǞךDzȊŢѨɜ՚۾ٲ¬˨ĠƲͫͰ‚ˌʂ¶ͮ՟Ê֏‹֏ҜޅҷTʁÏϥČǻЅӸөμƛŠΏˆ׃ſɩх࡛ȫƳÝٳČΝåʡЈѭð̴̟џϨ˓œϥĘʏÓґڛȤڷɜ੗'], + 'encodeOffsets': [[ + 13390, + 2322 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'COD', + 'properties': { 'name': 'Democratic Republic of the Congo' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@»ঙͶŕˑ̗͓ɟ͍ѫǯϷ±ګț͍Oهʍɹ‹ԃŗÝýҟɄϡÂ৥ưޝċѧǘӣӤҹҒ੕ͥĒ૿ƙɣĵʇՙȊχƫষĻࡇɨƫט͝ɲƴìٟࣟR·Ҧ̳ΨٟŠȋѰԣ˅ڧŞ˫ϢՕüϽqµʾ́rϥºԳųιtȻû®ৄ˩̸ÕԬŬԒǝ͖eՊ৳Qò̢ѕG­ƣԵɁӧűȿҫŠˣş։å͏Ѱȗ˖ʋԌȷض៛\\̍ķʑh΋œşʼɊʀμƎɎ̪ǰɚđ˼͐ҜSÄʃ̼ƩӶՄӨШɆːƒ۔θࠆϬўքМĪˌt̰Ǝ̆«ӊŀݖǐԾʦ҈¸Ԕúה͜ѐҊ˔۔˷՘ؚ̳ĉظǏʦԖŘÞϦčनоͨDZ˖~ŴȲ̺ðلėբoˤĚԘۙϘķɤƖϲÅҶDzȦΫ݊֏'], + 'encodeOffsets': [[ + 31574, + 3594 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'COG', + 'properties': { 'name': 'Republic of the Congo' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@̿˾ʩƗͻγۏࢸٖҪ̓֌˾ɂ֦ĺäό҆Зݐ•ʴЈł֒ĝڀЉӺζ঄ȽǘسçɻѢÔξ੘ڸɛڜȣÔҒѰ޲ԆѼ֪Ɨդ±·ԓʥ҇ǏԽĿݕ¬Ӊƍ̅s̯ĩˋփЛϫѝηࠅ„ۓɅˏӧЧӵՃ̻ƪÃʄқT˻͏əĒ'], + 'encodeOffsets': [[ + 13308, + -4895 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'COL', + 'properties': { 'name': 'Colombia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ΫȤЭ˨ʅƅ܉Ŝȱΰƽ_࠿Ӓŕʺ̼ڛтȢ̦иÊΞՆ͐Ѵ̳ȦDŽӦȏސǸɚƃ܄ͻ҄ņТ˔ÑǂʠțӶĺŬѢـהΌĚT˦ƺ܂ӖϸՊfäǪڂéڌъ͞ȊОК̖»ɚɛǍ˱գƕɇп͗ʋʓ̷Ĺ׵ɷӭѢÇņϭȄȁâ͹ij̵ˆǫȸéȨ̉ઊĄӦŃעܡͼĚ؂­ӐĪ̔ƟƱҍȇ˯ß׻ǜ֑ʆʟ†ȉэл̨ȃɠ̋ʰ࠹ǁĻǏӸɷˊ˥́࿕lZԿӰē…͏ǙĔҿƑK؏ώ̫ƀӓoηϙᘯп҂ʣpժࡤٟϾԍị̈ƤҧɝصŀӵࢤϳɐˍІ֑Њɡā'], + 'encodeOffsets': [[ + -77182, + -155 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'CRI', + 'properties': { 'name': 'Costa Rica' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@җȆǟǮĬƤ‰ȄɷȪͥǔ́ņÅʖəƮÄʑǗȩȓɸˑĊŗǞLʮŎˆʁŠȖnjŴňֆɝȖŊˊéƔǥʜÇȪDzɈҙ͖ͷЂΩ͗õLͷǪűűıƱëǟ©Ǖ'], + 'encodeOffsets': [[ + -84956, + 8423 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'CUB', + 'properties': { 'name': 'Cuba' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ܨÑڊW߄˹̭ͮ޺Ĩ̔ȡ܈ԳԺϛˢ\\ԆǟÕʁئ“ٌ΅ıȟ֑Ń֡¥׃âளą֜Ҷ΁ɔէÈ̃ʐȥӎӃ޵ɦʥǬભž̋ǐ̀ɀࠗ¨׿ѧΏ[ťȳеğΫĂѺʸǼ̤ϞȈіǎَĄȰĢ'], + 'encodeOffsets': [[ + -84242, + 23746 + ]] + } + }, + { + 'type': 'Feature', + 'id': '-99', + 'properties': { 'name': 'Northern Cyprus' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ÐJŨȮ؄Yކʢ֧ΧÔƿęˆLJÙűj¥iĎѾNjVɫïƿ¬'], + 'encodeOffsets': [[ + 33518, + 35984 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'CYP', + 'properties': { 'name': 'Cyprus' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@€ãࡱͿЩŊȟͶЎŒǀ«ɬðnjUÒ½j覎ŲiLjÚ̇'], + 'encodeOffsets': [[ + 34789, + 35900 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'CZE', + 'properties': { 'name': 'Czech Republic' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ϯǂЁ©ٵʲ̏Ùҿ΅ر˔ӃΰѕȬėΠƧʠؒǾ̸Ⱦ׾ǎɂdžɜīϒĖЊ˓ؼñ¿ɳҘǧŲɒּĥĄʿز»ϮЯʡCŽƯȕ—ÅȑLJ¡wý˹ēϋbšȁ'], + 'encodeOffsets': [[ + 17368, + 49764 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'DEU', + 'properties': { 'name': 'Germany' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@d͗ࡔțS̗ࡢǂҾɰॊͧІˋȞёɹɣ̨̙Ⱥ҅ß́Έ՛ϑĕɛĬɁDž׽Ǎ̷ȽؑǽƨʟĘΟіȫӄί̑ϯ̟ŃŢշýƛʿǤЕ~׷ƭݍ–ţɛыɺʩ±࣑ʲǥǻ܍Nń״ьֺ௅ƸЇɘ´ςǗȐĨ֨ƗࢢԎ@Ɉ͂Ⱦޔƿ˴ǐDz۰°Ƽȃ֮вȓ̀ӈٌōՠŸ'], + 'encodeOffsets': [[ + 10161, + 56303 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'DJI', + 'properties': { 'name': 'Djibouti' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ȤʹΑӏȩήɯ̱҇ȅƬȭÏҷb_ʮßɶ˴Ѐ̐ϊήñʪȴ'], + 'encodeOffsets': [[ + 44116, + 13005 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'DNK', + 'properties': { 'name': 'Denmark' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@ԋڹ࢟ӄŝΒ௼˨ˎу'], + ['@@ȵ̓ʡĞ؁؁ɮХ՟ŷًŎͽҲ}࡬Ɣɪʌʦ݌À̐ɴڮʂƒѝʟ˙ĶɽҘŵ'] + ], + 'encodeOffsets': [ + [[ + 12995, + 56945 + ]], + [[ + 11175, + 57814 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'DOM', + 'properties': { 'name': 'Dominican Republic' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ŀƞپIӾɏɜtƴ̕Ҡhʡϐ‰Ю̷̯ͿЍǼϫ•ˡ¢ƱƵ͑½ŷȲˣťͳֻɏƆ§ʎjɬɍʦȲƚÞ͒óҜ'], + 'encodeOffsets': [[ + -73433, + 20188 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'DZA', + 'properties': { 'name': 'Algeria' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ᮩཽᝩ࿷இϑटćU՘ϵƌԹʊȧЀᬻᆴᬻᆴṕᎠfnj@ÊQ঺ബب࠼Ÿێɦ͎тচͪ˜جӢòϞ̶સƚƸ͜ɛDz̃ࢲ¹Ԟ́ՠ߰ҠࣦƢՌΎ߶ʰ෎Ƭർæшůߊͨ࣌P΀ȝֺ¾ǟћƄߟȡۙԭҵôمۊԃRȯԮ͹Ϊຝ˖ݏ°ϵƧۇÔϥŃҟòՇͫΗӺؓŽέ̘ҵϼƸڒϷςՃ'], + 'encodeOffsets': [[ + 12288, + 24035 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'ECU', + 'properties': { 'name': 'Ecuador' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@҂غǻξ͍ϵԉςǞʀƙބ̎ŴƺԼ͆զÍ΄ҢǸ׀Ͱࡀӑƾ`Ȳί܊śʆƆЮ˧άȣŞٓʽճࣷ࢟য়ͧԥܵǃ֣Ӆ΋ΙъͻĞ΍áw̮ʈȨıΔ'], + 'encodeOffsets': [[ + -82229, + -3486 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'EGY', + 'properties': { 'name': 'Egypt' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ɽͷǹىɫѩȝƥ˩˔ϛϒ׵ஸđùΐࢯԪࡋٌವ̴ҙ˒ӃݮछǗƣ‚ճ঒ݭƨǣΏ@Ὁ@⁩@@ᶶ@Ჴʥڲɐ԰Żά̤Ж૦b߲ɝ࠲ʛϴſ٨ˊΌʊݎêװŃɮеȜ˜ڨȣټ³аɄւ෽'], + 'encodeOffsets': [[ + 35761, + 30210 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'ERI', + 'properties': { 'name': 'Eritrea' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@˻˖ΉӰϋ˒ɏܷ̄ͶֻXȭǬӯȡԛϢʽط঑ǬęʹβఀĊ֒ˆʴؤƐьӒӦঃɴޗҢУବߏҲӍҖӝˀ˿аʧʩȳέò'], + 'encodeOffsets': [[ + 43368, + 12844 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'ESP', + 'properties': { 'name': 'Spain' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@¦״΃θஒ؆ਊƱ૾NࣂƝۦªമƒͰ͛໺ϡ̨ǺीϝআŊ®ӥߓ֓ઁǯõ˱ԩү͕ہ͞ӑӟϑǹճىǗש٥੧_ߟhՃ͍̓ͅЩê̵˴ʃӚ޷žé˦̶̀Śɬ̃ʢɶրͳԌδè’ЈƎŬZپϲɪɻфөˆƝŁӹCɁЬ΃ū̥ɇ'], + 'encodeOffsets': [[ + -9251, + 42886 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'EST', + 'properties': { 'name': 'Estonia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ĮӸ̱ŁՓ̘ñӘਫ਼ɼ੔Ũ࣮Ƒࢂ|Ŵƣׯӝʞ޵ΫˉۙDܡ̸ρļ܏Ʃ'], + 'encodeOffsets': [[ + 24897, + 59181 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'ETH', + 'properties': { 'name': 'Ethiopia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ԜϡӰȢȮǫּWܸ͵ɐ̃όˑΊӯ˼˕̏ω˳Ͽàɵ`ʭҸaȮÐȆƫǽ̴̕ҧ̴Й̛͎ᩨঽۺNᛛᡃફ™ݟףաeɯ˅ַB͹˴ލΙʝΓ֕àȃĬȟwˇT੟܌ב@˹ˢ@ҾѧƘӻࣴϥȚƧʹэЦԧÒ˸ӐҀrŲʰ[ݲʞࢠЊɾĎ΄ήٜԔи΀ࠠƆܠ঒ǫʾظ'], + 'encodeOffsets': [[ + 38816, + 15319 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'FIN', + 'properties': { 'name': 'Finland' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ūיಀ֓ޡى঎ख़֡ܛݴس΅յఘֻ́ѓޭӟᅡੵໃá๑̯ൃǯӡҞ߿ˠȈࠢСݶАӪނՆ኎࣮֖Ǭē΢ୟЈ˳͜uಒ಻ֲ૩ЪԊɞतѻલ¦ࣘȭߠϊЬ؞ಬ˶઄ͯΡכ'], + 'encodeOffsets': [[ + 29279, + 70723 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'FJI', + 'properties': { 'name': 'Fiji' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@̂ʍƓѭԳŗҩļąτ͖̀ϤĻȼƐ'], + ['@@՛ǯŅ̼оǤˊ°Ӱˀ@ЧՕȷ'], + ['@@é­@ШǨžĽЗ'] + ], + 'encodeOffsets': [ + [[ + 182655, + -17756 + ]], + [[ + 183669, + -17204 + ]], + [[ + -184235, + -16897 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'FLK', + 'properties': { 'name': 'Falkland Islands' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@৘Ԍ܎ȿԌʹڦϙʥ̋ଋʥϙ̌܋ϙпϚ'], + 'encodeOffsets': [[ + -62668, + -53094 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'FRA', + 'properties': { 'name': 'France' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@ˣ٭ϡǠș֢ǜ̺ը͎Ɯܛ'], + ['@@הЅќà݀ϥȊñʎjЈɗெƷыֹŃ׳ɱƝϣü‚ɇؙҽ]ϟВƀ˾ρ“ʁʚ̿̅ʯɐٱҖŃĩηݿӅစɬ௧˗ĩԑঅʼnिϞ̧ǹ໹Ϣͯ͜ѢԎdžူࢁࢤإю౹͒čؖઠǾථɏˇॎߌέዠپʨێܾǞŪ̑ϸ_ϸ͵'] + ], + 'encodeOffsets': [ + [[ + 9790, + 43165 + ]], + [[ + 3675, + 51589 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'GAB', + 'properties': { 'name': 'Gabon' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ࡹࡔ։ۚԙࢄ‚˨ǾˎȲؔǜخ˴¶௢SOৠЌÆԞőӼňľ¯ÓνɼѡشèȾǗεঃЊӹĞٿŁ֑ʳЇݏ–҅Иãϋ֥Ĺ˽Ɂ̈́֋ٕҩ'], + 'encodeOffsets': [[ + 11361, + -4074 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'GBR', + 'properties': { 'name': 'United Kingdom' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@҉ֽًǦԱ[ǦҊǥ҈۴–ࣔԳ'], + ['@@࣋ࣧࡦŘऄIɕۅݯݩࢄÃäĕݠ঱ֺƇԬढ़ʈͧৰDžķ՝ѓʗͲѣݱѯ૳Rෝɱϻǒ։ϿޥĪם͍ҁǘ௼ࢨݪǺOBಽƔʃͰ࢜ʺҡҐdžռఢ÷D@ŮӤ֛Ԯ_\\৵ƨȧɬ̨ϒˡɴҍЇ·߶щє̨ࢆٶھڤá০ì'] + ], + 'encodeOffsets': [ + [[ + -5797, + 55864 + ]], + [[ + -3077, + 60043 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'GEO', + 'properties': { 'name': 'Georgia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Ųάȿִӟ̲ҭĬ̯ʴĺIJ܄ƝఆƋଦЕƦƻԚƂ޶ǭʴ·Նșɓřвғŗıҏºصʎȵƍଢ଼ſ߳Юࣅ¡'], + 'encodeOffsets': [[ + 42552, + 42533 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'GHA', + 'properties': { 'name': 'Ghana' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@೉ӯҳ˽ݳʑݡʆœͨηܤɖैΠ۸ɟ஢ŗنrӊฤ¢ϊÕ˔ƊϴáÕʿΖџC؍Ąڍɂ̫ȅݳäйɢՓȈ̍'], + 'encodeOffsets': [[ + 1086, + 6072 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'GIN', + 'properties': { 'name': 'Guinea' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ʃtǡͷʁJǏǴÈͶΗԨɕħǵmɳ³V̮Ƈɘ‚ʔǻΜɹ̜ڥDțǁɵoƝǷīɹ҅σρӼ͛͢ɋŊȿǖħϊūȂʓƐώЦʮeɖƘȄDƄŎï˨ĢĖd˶МU؀ȱȄlÚĤҜáŨ´¶̭ƆBɖŒƔƒɸɇάãɲǺ˖ŒȬŠǚuȈȁĴɳΆΙǣɏ˙ǴĊŀį«ʡʲʍǗÝå˷Ș΍Ⱥڧ̷ĵăśÞNj·νƃA'], + 'encodeOffsets': [[ + -8641, + 7871 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'GMB', + 'properties': { 'name': 'Gambia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ņόࣶzȎȦˊ`ͨȷʼIˢƚǞʏεȋιdέǰ̷ȗƭQȫŝއl'], + 'encodeOffsets': [[ + -17245, + 13468 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'GNB', + 'properties': { 'name': 'Guinea Bissau' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@҅ΘΝÈȕʀLŸʯǴÁǶѼƌ˦ɦĨ༈•c˵ġĕð˧ƃōȃCɕƗʭfύХ'], + 'encodeOffsets': [[ + -15493, + 11306 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'GNQ', + 'properties': { 'name': 'Equatorial Guinea' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ƿŴ़̀െmPয়௡T˳µ'], + 'encodeOffsets': [[ + 9721, + 1035 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'GRC', + 'properties': { 'name': 'Greece' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@Ҡ˱ٺ¶شÑqƣҜĶĿʛ௃íTƒਁǎƺΦ'], + ['@@ʹՁȥĥԟ|ѫĀৱɓ׌ҿяƋҳAѻўƿȁȊԅрЁ̓ǿҴϯжʑ^ӅޥɠʜѕՓĕ͈ݏ֏Yۍμ̿ڦƧ֒͝ϮљӐÉʆϸТ¼˚˘Ũjɚռö͌ȀҖgƒƦdž„ت{ڨɲע̉ކĀVмЦɝ'] + ], + 'encodeOffsets': [ + [[ + 24269, + 36562 + ]], + [[ + 27243, + 42560 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'GRL', + 'properties': { 'name': 'Greenland' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ᬜԆ᱒›ੴ̴ᲈĄ䀦Ŀ㉊ڗ༅͕ộ™⭏ćшƫᲐĠᡚ́࿈ʴۦ̝इӧᒞ̺✘͚ᠼNjҾΫ⃝ױӃȕ᧑ơወ¡ছؕگկ€ध৚շಽ“൧ˇ༂ѽȢ܋࣍ýઞܡህÑঈ΁˟̑இŽ୥E੆֩\\Ϗပΐћɣଌȿ઼ԣ͈ڱກlj٫͖ਣӘ˼֭উѵᕖ•୆¯ᖯܵᗿڏឧ́ओIࢅ͓ୟࢱᅵכׅ“૧ȷ஽ȝܛԱ[כыտോڧͺٿϗ۝љࠍஅ½఍ۈဿLࠁҢ֕ࠐฝਲэոŗݮ୓ޢ̢ئ֗̒ࠪচొ̺ͨΘǬڀॡ̕қůݯţਏ˜Éְ͢҂ެ\\႔ɟ෿Քݩ˾࠷ş۫ȼम޴ԝ̺ڗ׈ৡࢼ੯͚XΚᖷӮᄻÖᖟ‘Ꮕ×ইˌวՈᕂ˄ၚ¬≹ɖ቉΄Ś͜ẊИᶎИ̪͘ᗗ̠ܺͰ᯲ז௢ĚΓϘጲɜᣚƂᣖRࣺʽᕺҨፘ̽୺áპ˙ፅҐŘή'], + 'encodeOffsets': [[ + -47886, + 84612 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'GTM', + 'properties': { 'name': 'Guatemala' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ћƦԻfϩǖҍΌrʖĮȠšƾКۆ઄Ft˸Ƌ¾ġǺ̵Ț̹ˬϜDBӂ޸BަUOڗßॅʤ@˚ƱòŰʘŃϥ͍ЉɻÏljâǑǧɇȟ½¬ıƿġ˽Ƀ}ŭ'], + 'encodeOffsets': [[ + -92257, + 14065 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'GUF', + 'properties': { 'name': 'French Guiana' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@͉͑ГÑŗʀȉ–ʹɩνǦɈΪòϤƢή͛ӸáֺѪܠ˸ğؤȥࢸۿƔ·ӻޑʳأ'], + 'encodeOffsets': [[ + -53817, + 2565 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'GUY', + 'properties': { 'name': 'Guyana' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ր̯Դյzџ̈́o҈Чͪ̇Ƈݱԛɕ°ȣƹџϊ؏ːAŎӃԢܳȱ‰ҫî˙ɡϟƥ˅—ġǑЭ¦ԫЀÓϴɋьƆܐɸ̐ȕϸ˿ŶŊτțȘѩ™ْ֩ɬɲiϲԬƊȾƾ˽̸ô̬ږӲ'], + 'encodeOffsets': [[ + -61192, + 8568 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'HND', + 'properties': { 'name': 'Honduras' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ơˀʭòÐʹŗĞǣÒσij‹ŔʩƈǷǚʛìǨɈáǒÐNJЊɼϦ͎ĔȂƨʊ\\þ垦ϸùϲv˒ĢİĦˎ©ȪÉɘnǖòϨśƄkʲƿʐį̏Źɜɳ˽jśŕ̇ŋɃAȅŃǙœƛźĕ{ŇȩăRaǥ̉ɳƹıđĽʛǞǹɣǫPȟqlЭūQĿȓʽ“'], + 'encodeOffsets': [[ + -89412, + 13297 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'HRV', + 'properties': { 'name': 'Croatia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Ȳ͗ˊʇ͓̓ϝȆׇ[ܟƔϽmǻǧ̝ȖǫΑЪϽǼʹϮ̽͌ȃ͆Ηݔ͇ġƛ߃̶ӣ̢ޑʠ۹ؤǞØϥΞe˲եƄʱγʝˮn̆Šbג…Ƹƚ˸ƍͤgGɼ̈ĒĈͺڞɠˊĻؼέۜlj̼Ų'], + 'encodeOffsets': [[ + 19282, + 47011 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'HTI', + 'properties': { 'name': 'Haiti' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Ԣ™ܰƁôқÝ͑ȱƙɎʥiɫ֏ƜЅÍԡÔϽƿ҉ʾö˔ޜśيã̢ȈϧθP͎ՋžȌɶ'], + 'encodeOffsets': [[ + -74946, + 20394 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'HUN', + 'properties': { 'name': 'Hungary' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@˨ըǍǼӂDÜ΄ђɋ̲ğ۸ļäǚͮ~ЦžĜÃЂŀȠȢˠ¼࣒ʭǴĒҲɭÎɣԡǭЉ֫ԕ֭کǁԽš١ə̻űۛNJػήˉļǍ˴ƗV'], + 'encodeOffsets': [[ + 16592, + 47977 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'IDN', + 'properties': { 'name': 'Indonesia' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@Λe૝ך޴ǒѴʭ̎ʭ»ɩ'], + ['@@ܙȁijĶø˸ΰԢࠨͬĐǓfʫշع'], + ['@@̢ɣԲèȼΥॿǛ׉őҍP̀ӚҤPɤ̖'], + ['@@ūұ౅ʅૣľE̬ښǪՂʥ֔Üݬ̮'], + ['@@ྔċȂΌ༘З̪կీƵਐӿय़͋ऍ͸ݻwࢍØ޻ưঅ͎؝ČΓŁ໕ΌƣΰޑØּߤ৶·ڴ͡ΒÛŘ̗'], + ['@@ѝֱćنƬ̠Ǭ˴ȒʗCЏ'], + ['@@̿˥ׅƸǏΰࡘ¢Ⱦˣ'], + ['@@̨ٝۿΌۯìӃÅׇˆȦҦਠ”ऎʕ'], + ['@@ɼയ࢈ԉ۰ࢼ८ԔݜBܘ̉خ̛ࣘLJbᩑbᩑݟې࡟ǜȷʇ੡}ΦۂՈɺɕࣲЕ۸࿃܆ۗêృަʛУ͑óȏ̮GκٛЮ̢ࣞ״gëɠ௵DͩԄݥƺΡдଈȰњ˜ഘ·Ƃ̹'], + ['@@ڭ࠭كlj߱ǐඓ¥ܽŧţٍݪݛҒϠ༪˸çϯλŪιӯ͙݉ߒ੿Ƶ˿ݲॻQտ҅ʙ̐͡Мی࠙͗ȻɶŊ͖؅ӲØࠌ֕ʭîও”றՓũίʚʌޜŽ߸ΛPʻֺΎվŤښф౎ǮΎ܎ذپʛ੖śॴ–ࠨ؎Ʀȉ'], + ['@@©ܽџĈŷԝΌѷɽĵ͹Ւʟ੺ǚڤ˨̨ÔҝӸóĀ΃'], + ['@@सާহį˫ֵšݿַ߱u࠷͕౻ŭ̚ॕϙͫԤ׳´лːৃ̟̩Оս¯ۗĬŹૺнɺЕܘŝ݀ĮުԂ֐Ɩָ֗ӅըǠ՜ÑӪъЖôߒɽۆǶњୠ͔̈̆क़ॲ@ܰƙӍݷآߓơϭ'], + ['@@छkۻ۰અۊέԚٍۄзؾٕ୴۪݅ʙܠ̳ڀݵՊѭܘمҺࢗऒóђզ‘ಢNjݔࠓٮ֫ҪΓߔࣙࡢ_ۺֹӠ۳٘ϥͳۉӖ̞̅sƜו̊ҵؠõФՏɁ਱‘ಟ'] + ], + 'encodeOffsets': [ + [[ + 123613, + -10485 + ]], + [[ + 127423, + -10383 + ]], + [[ + 120730, + -8289 + ]], + [[ + 125854, + -8288 + ]], + [[ + 111231, + -6940 + ]], + [[ + 137959, + -6363 + ]], + [[ + 130304, + -3542 + ]], + [[ + 133603, + -3168 + ]], + [[ + 137363, + -1179 + ]], + [[ + 128247, + 1454 + ]], + [[ + 131777, + 1160 + ]], + [[ + 120705, + 1872 + ]], + [[ + 108358, + -5992 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'IND', + 'properties': { 'name': 'India' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ࣚটďۅͮїѕ׽ŒɾएࠜՑ୞חՑϟ͛޻ࠀͅߊЭરһସʼnӜёٮāৠȝ۪bĪͪŋՖÞβԠǮìڋlǙކ͉Ոƀ܀Çۈ|ÐԪ΁ˎڴŀވشॸ՘۶ȷ״ΞЀԹ˳Λ࣠űÜ͇̍Ʒèԫ׷Ʋછׅ~ӓҩ۵§ХϏۗځȒࢇȏ˹ĚΣгȥѵ೰ɵEƍ՝ҡѦʸӎϖ¶ϰ܆ӝƜީ]ߝŚóאБ¤ڕζ֭̓؆ѻԿ̻ȅ̩Ԭɣƛԑ̆كžەţֱ̫Zਛǩ´ك҃ӻ௃֡ळ঩كՋ࠷ջCϭлȹݳ̝Ͻ«ʥٙǪધ®ۡΣߙI෗ѣ¡ϣٙʰˣދʃ˱֯͵ʍߑ޸ϳ୴͑ࡒ̍Јѿ߰ȻੂơՀޅ଼Α࿀ʣ੾HৰǍ޾௣ԉףĶ઱৲И̤ʝͤড܊֖֔ᇜCǗܞҽюĩ٨ջϘऒࢢঊÙ࢞ࢢՄ࡞ࠄࡈ_״ܒӠڳд֪݂̇̕Ьβ౤ȱपŰߺ۸'], + 'encodeOffsets': [[ + 79706, + 36346 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'IRL', + 'properties': { 'name': 'Ireland' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ƒ׷ًݣ๯ӹ஑Ŷڼ࢚ѭࡢତڄٌϼǦ҇ǥ҉Բ\\ٌǥ'], + 'encodeOffsets': [[ + -6346, + 55161 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'IRN', + 'properties': { 'name': 'Iran' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@݈njװӔ֚{τƾװýघэڤğ।ݓظ‰òۻ΁਷ɱؑκŭΫҡˠڡàՓِƙæեݿݿжѵ͸ԓߦυx݉ДƋêϯ௉ѡ̓উཌྷʪࣷȖेŊΧਐЕƪ٣ƭࡑНਇ˦ࡑ٦߳ʈ֗ߘا૪ҍƋՕ˦̻͝ҭѴS҂ˍ@Ɛ،ѝٔ਍Ң׉ߜȜپц̂ÙӬտʨխ৊ҟڨǐʼʿ६ּʈƄͅъϯ־ő̤~রئ̀Øʞʙ́гԼѱȾ¦ˈإߖǩ׎у஠ƟಾɞĄȞ'], + 'encodeOffsets': [[ + 55216, + 38092 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'IRQ', + 'properties': { 'name': 'Iraq' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@րʧÚӫх́țٽ׊ߛ਎ҡўٓƏ؋ˎ@TҁҮѳӿ¤֟ê؝߭༟äᛍၖఫךৡɪ͹৾ᇶ࢔͆৬āؘҢȺјԾΰž঎Ň̐ɉЖƚծ৉'], + 'encodeOffsets': [[ + 46511, + 36842 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'ISL', + 'properties': { 'name': 'Iceland' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@șիॊֵથٙᝓֹܣƵૉŮᚑˈࠠψᆧЪ๪ǎ—ʘᄋȜ֨նౠŰಸ֭౨Ҝ੒ʃൌ҄ආÑ'], + 'encodeOffsets': [[ + -14856, + 68051 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'ISR', + 'properties': { 'name': 'Israel' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ƥ˅̣Ŝǫ֓ɂĥɋř—ɛЄŖp͛нഉց෾ʔˢ˶ɞϼǠيŤɆzVˬCþƦɤ\\`·ŕŵhM'], + 'encodeOffsets': [[ + 36578, + 33495 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'ITA', + 'properties': { 'name': 'Italy' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@̟ڋŲʹǭѝٝ̈́ёĞ୩ѐŞќজûࡪĠْò'], + ['@@Ԍ׭ş૕ϣÂ΁˫͇ɞ‘২ȓӒҨ¥рʼ'], + ['@@ரɏĝЯȬΧڝŪہ̗²зĻʇˠё߀чцۛदڱچLȲȃɽǗݪ̥ؠʩܜѫĔƿƽ̛үϼܳƐΝի؈̷ıѫΗ¹҅ܛΕÝHʲǢҊǼǶ͝ӤʱшΑŀʛδգƴεͶثÆٿϜޑմ֯ӜʿࠪйĮہˤϯŕӝϵΓÕĪθҕńɏٲ̆ʰʙ̀”ʂβǵМ¢Ҽ˶ƢƃА€ǼͺتĿψƚâΆԘšĮdžࠨƤȊ̉'] + ], + 'encodeOffsets': [ + [[ + 15893, + 39149 + ]], + [[ + 9432, + 42200 + ]], + [[ + 12674, + 47890 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'JAM', + 'properties': { 'name': 'Jamaica' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@֢÷ҀȫƔɯןeʭƗҹƊӑ̪ĶȔΜÎȒƒ'], + 'encodeOffsets': [[ + -79431, + 18935 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'JOR', + 'properties': { 'name': 'Jordan' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Ʀˆपͫ࿪ࣆͺ৽Džų၅у࠸࠿ˣƛƑ˭ٙřȩ̡εʵधƆƒŨоഊo͜Ůʚ@Ԥ'], + 'encodeOffsets': [[ + 36399, + 33172 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'JPN', + 'properties': { 'name': 'Japan' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@ņ˽ҿԕΉːљțɝӭշʈRЊҬԆӌīΊΜؠǹ'], + ['@@́ڡƤсѩף੹Ѓ๏½ணॡ͔֡“غษȃষЃঝe࡞أ֗෗իΝН͜ȶݶՏʒͿ־ߐʶѲՈࡌѢ؞ָာʤ࣎ǣࢠ๺֔Б௾ࡀӌ͜ՈਈƟा΢ՎࣀƸҞୗ}ڻޥࡍbࢁ'], + ['@@נǵרΤȈहఝɯ݁࠱೓ָқँण]ř࠴д٨࣌²ʖ୐ʜټন࢓٤˯'] + ], + 'encodeOffsets': [ + [[ + 137870, + 34969 + ]], + [[ + 144360, + 38034 + ]], + [[ + 147365, + 45235 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'KAZ', + 'properties': { 'name': 'Kazakhstan' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ӕƹ્דο׹̹KɱЊ੫‚ǡێХNÚࡆ৓ؘ෷ßডũߣݶۋ͆ಥ׼ƽðᓗӹᶽљ£יچ֧ɼॕǩχ˧±ȲȶΖDž̊অ˺ϛݮҩɆ…˜ࠊāŽؘ܎ƎܼűƲࠎƭԲ࠿£܍ȴঃσ޵ǭяƌĐўՙ֘دw܉֬ӞِʕǢڢऊࡺӣŀؘჄࣴಾtᇢ׉঺ͻࢼΠ೰j੺ѥʔʠ୼—ɂЊഷ׀߮Цƿɮ߮ɔ؅ֺϬ˼Ḯ̈ШȺᑆ̴ݰΒຢǹ˄ࢉ࢚Ȳઆ˹éҝ߮´ᑌߎ̭ˁ੶٭ሠᒑ҄ѰୄӛீɎҪƯКӟטNjΨΥ઎ŒѾԣٕ֓ۥÿ¡ࡅұϝဟˢ؅ຑїȇဗͱݲลֻɓäӏԭŬу̠ఝĖඃx̧ġ஥ΞӉǧŽӹ൩̂փşȉρ'], + 'encodeOffsets': [[ + 72666, + 43281 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'KEN', + 'properties': { 'name': 'Kenya' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ӾۙיͱȹΕ̿Õšףˑ͹Ǐ֑ͷ˥஻ࡀËӤᵁႌƙĢSࢺʊ;а֌̨ؔσ॰įтЉ׎ԬԈ֬ֆѨƗ@ҽ˺ˡג@੠܋ˈSȠxȄī֖ßʞΔގΚͺ˳ָAܽ॑Xᵣ'], + 'encodeOffsets': [[ + 41977, + -878 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'KGZ', + 'properties': { 'name': 'Kyrgyzstan' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ȊςքŠ൪́žӺӊǨ஦Ν̨Ģ඄wఞĕф̟Ԯūşȏ೛ғ̙ͭઁıͅ՛ࢷŒׇǏߣЇŜȟʇȓཟŵਡ˘࣫ÝĂӜࣴƕ̮ʸٖĉ੾؂঻ѸױȽإ͂۶ծʟĊ'], + 'encodeOffsets': [[ + 72666, + 43281 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'KHM', + 'properties': { 'name': 'Cambodia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@΁Ѭыࢄȣ২ՠۨઘdž߀ťۚ͡Ϟׄݖ̱Ȝ֕Ļ৕ඳ٧τԙࢥÓܫͷ۱Ū'], + 'encodeOffsets': [[ + 105982, + 10888 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'KOR', + 'properties': { 'name': 'South Korea' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ܨযȺխPॷ̓ҥݽljڥΏݳïĥҚƼـχ࢔ذƚֻܘÂúϒ‡͞Ϝצ¢ΨÈŨȮ'], + 'encodeOffsets': [[ + 131431, + 39539 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'CS-KM', + 'properties': { 'name': 'Kosovo' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@›ǣŃPĘ́ȩĐdzɦƾȌȪÒŜ˨ư²Ţşƾ¿ŌƅƒŸǎƻŢLĥȳijij„×ȉӹŻ'], + 'encodeOffsets': [[ + 21261, + 43062 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'KWT', + 'properties': { 'name': 'Kuwait' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Ǭχõȓ˔هשuȽАݟĆ؞߮֠é'], + 'encodeOffsets': [[ + 49126, + 30696 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'LAO', + 'properties': { 'name': 'Laos' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@˚Ϝœ܆ڹܸ¿ٕࠦھٍÎǛ̉ӯyʣƨࢯԅoݬȸࢮ֧ž³ԎηʸǴ̲ܐնøȡ҄wŵ०ѦŬӮڏϖޅਚO͚ܹ՝ɗʉ̟৔ԉۦ঳Ռ݋َ׏ɄץƵ࠿ݕ̲ϝ׃ۙ͢'], + 'encodeOffsets': [[ + 107745, + 14616 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'LBN', + 'properties': { 'name': 'Lebanon' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ɣ[ýƥ˫D̘ۄмעfˆϘ§Ɛͣқ̓ȷҟ'], + 'encodeOffsets': [[ + 36681, + 34077 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'LBR', + 'properties': { 'name': 'Liberia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ɗQࡽАޅٖ܏Ң֣ըȪː¬ʔϜҘϺϺǶnɖĨΘԧÇ͵ǐdzʂIǢ͸ʄsŸʓĎНǽύʖɱˊÇΤΙ~ͧăĿÝە'], + 'encodeOffsets': [[ + -7897, + 4470 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'LBY', + 'properties': { 'name': 'Libya' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ק̷ҿҤ೧βρՄڑϸϻƷ̗ҶήӹؔͬΘñՈńҠÓϦƨۈ¯϶˕ݐШȜðΠėΒ־͔ʶːЦʌ´٦দ́ΜðۮƓ૞ϓЀݛݮǍஆΙࣆйЦɔЖϮț٠˂Ф؄ЀׂŘ଒ǣ˺ϑ̺Iˌƛ࠴ıȲˣ̣ЕżΫɏԯʦڱ@Ჳ@ᶵ@့ॱGYΙ‧ྐ‧ྒࡓҟ'], + 'encodeOffsets': [[ + 15208, + 23412 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'LKA', + 'properties': { 'name': 'Sri Lanka' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ų࢓ΙʇܵȓЍڜƫீϠ഼׆ұϺסО࢓'], + 'encodeOffsets': [[ + 83751, + 7704 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'LSO', + 'properties': { 'name': 'Lesotho' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@̆ʩʳУƛ˛ҳſƹˍ̛ċؿ٨҄ՐҖ͢ϼǠξʵ'], + 'encodeOffsets': [[ + 29674, + -29650 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'LTU', + 'properties': { 'name': 'Lithuania' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ãɊĚɲχƄࢡƨDZ۸२ʴඬÁࠜĊŞǩ҂Ã߲СĀϓۏˏșӃ࣯̓߻NȫʶљĜ'], + 'encodeOffsets': [[ + 23277, + 55632 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'LUX', + 'properties': { 'name': 'Luxembourg' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ǘȏ³ρʍiȉòĞҼɖŽ'], + 'encodeOffsets': [[ + 6189, + 51332 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'LVA', + 'properties': { 'name': 'Latvia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@†نЮՆߊ˼ڜعڪhNJ٤ܐƪςĻܢ̷ۚCКȕîС˒ӷ͕ࣗԛƙ߱ТҁÄŝǪࠛĉණÂ१ʳ'], + 'encodeOffsets': [[ + 21562, + 57376 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'MAR', + 'properties': { 'name': 'Morocco' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ԒΥߜÎࢊȃκU͂՟ºԝ̄ࢱɜDZƷ͛ષƙϝ̵ӡñ—ثঙ͍ͩсۍɥ࠻ŷഫاRহŷ@@@p҉Ա˓ȑϡ@̥Ŋ۹ě˛ٻʿÕЁ੕ୟ࣡ˣୋ΅ϗĵ̡ቅãaD ϶͒ɮ˞ѪÃ˶̀פҴՖ˲ƊɞӬp҂̤Բ̪֔Ւ࡬f\\ц͔ްĢڎָтɠۮۮȿਸ਼͊ܢŔѶդ֨ࡈϦخΐ֘࢈˄ԪؤI'], + 'encodeOffsets': [[ + -5318, + 36614 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'MDA', + 'properties': { 'name': 'Moldova' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ȨŮ֒ĊؤʽΊϞɥÑ˵̪ƏŨΗ̊ɇÏűƾčɝ×ӷ|ĉŜǫãÒƭɱˍƥ˽ɁĝƯϦĘΪςӝԂˉΠʹʠʯĈ'], + 'encodeOffsets': [[ + 27259, + 49379 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'MDG', + 'properties': { 'name': 'Madagascar' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ɠΥȺ։Ɗঢ়ɒϽĉЗƩʙ˷ӰǁʝLjثõΥɵȗ¿܅ͧওб୅ԯཧ͑ୟϛইہȣܻΡӛɊڙ̜ɳѺÇݘ̑ڠù؂Ʈ؄ϰƢD˪Дِø՚șЈǃՌãޠ̊ҺŔՒмŒҶǤ̶Ʋτ\\ӐӎۖԮʦцŗάΦĵҪ׎fԐ˦ϔ̊ί'], + 'encodeOffsets': [[ + 50733, + -12769 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'MEX', + 'properties': { 'name': 'Mexico' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@͙݅ƥ؁Õ૷ąЧƤқʺЧǚٳ֎سȞӏ͢бࢾɝΐΙ݄ɾٚĎؼưՊƠՖ΂ȨӬè۸Ƣʖ֬ɚࢶȚݔ‡ԚîȬDZ…ЙҋԁȥԝƸƥűγɁٽɅɎǭcǃY̝ԓƳIJķPŭޥV޷AAӁϛC̺˫̶șĢǹƌ½s˷ઃEЙۅŢƽĭȟqʕ्ࣞџ˘ۇɖҷÓګ́чĉץɜؿDŽ޹ϬؿŠ्ϸ۱ВɃɤҹº࡯ˈΓϦࣗӊсՌȧЦ˪ĈđʈȖɔJ̄˱Ϙùͮ˭ъ݋࠴ࡋڀУԼܝ΄ƷȴŸԲѓȞӹФȽהҍæӣѸϿФ™ˀҍو̓٠^͔؇ͬ˫™ӑɴƇͿƔЕĆف̀΋خׁƒȡŸÓŎ˽Ƭ\\ǜթʮɇǴ̕Նё˨ޯʠρɸϿ²ѷКƒͶϡ̨ϑqƭΝ̱ƫJɛԞջӎ؃РїɈ„ؚŵҖЏʺֿϒŏŇɃɖԭȰӷӦÖÚΊ³̸̼ŽϜ٩׶ӱɶ̱Հ̷վϳڦͿݲॖÞ੪ĞÿǑ౔СኀףဪPژ@DΌผ@̪̕јˇԀσ˨ѭȾҥѢʩۤʥՊڒۊhפͱфֹ̄ӯӸӏȂחɾЃپʹ׮ȁ͞|'], + 'encodeOffsets': [[ + -99471, + 26491 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'MKD', + 'properties': { 'name': 'Macedonia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ńOœǤӺżȊ˺¶ϴbтˏÒ։DžƒƑƥҕh͋ǿջõΑȴšήń˸'], + 'encodeOffsets': [[ + 21085, + 42860 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'MLI', + 'properties': { 'name': 'Mali' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@˰ƶƘӶˊpזɻӄǖ͖ÇŴȈ⁚^ȈךƣļЛ⋈Л⋆౾dᬼᆳᬼᆳȨϿԺʉ϶ƋV՗ठĈFካҟ֗íԭݛƃ଩ï̳̗ա՟IȿLjҥš޻ΑDžʿٳϕŗɍΙǡНŔɱȳūֻڙۡp˳ɭΣÆӥ΋ůȝŁŽάʍĥơhƷʕ٭PɷŴʼnùʱʎ¬ʢĿİdzĉ˚Ǥɐ΅ΚijɴȇȂǙvȫş˕őɱǹΫäɷɈƓ„ɕőƅAµ̮žʾí̽͘ʀǓӔԺ'], + 'encodeOffsets': [[ + -12462, + 14968 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'MMR', + 'properties': { 'name': 'Myanmar' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ӫηץ›ϥࣥΟƳО݅ՔؗΈօ̭ܵ̃ƹȪу֖ڙĪҷ_ϵ͠ދң޵Сࡷăذʴ٠˯ӼæࣸͽѤ˛৔Ʊਗ਼εۢօуॕ׳ҽöԳȠ̂ਪǫ޾څॺļ̢ӭņ׭ۆÅڰ̊ŵj׾дȦęΤȐ˺Ž࢈ڂȑϐۘ¨ЦҪ۶}Ӕજ׆׸ƱçԬ̎ƸÛ͈ӮÚˮӵξȧ|ٟ“ۙߓۭijঽࢲƔȨޛՐǍʓۣز́ζƷ؞ʔ~΍܏յdẕӓȗ'], + 'encodeOffsets': [[ + 101933, + 20672 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'MNE', + 'properties': { 'name': 'Montenegro' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ÁǀηЯÊˋǫÞɽ˞εǖĢƜŬҦ˚ȜƾüɠƟŬśˠě͌ǧçïƽȋɧó'], + 'encodeOffsets': [[ + 20277, + 43521 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'MNG', + 'properties': { 'name': 'Mongolia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ࢮƢ྄ܤ౬Єܴʳ࢚]֘Ͻ࠼‰ௐɁࠈגͿӶࢊࢊश΍ނįনɍLjؿஜΛߐƺਫ਼ŌࡆōࠖЗԚѕެT੒Ƌޜȼૈƒ௸פԌĝѰ˭ৌêХهק࠽ɐ΅ӈńࠤŽ٦̴ڬˏހוğ̗ڏĦ௟ŏןʅ؝։౱͙࠷ѽࡹǞҿúѳէˎ͓ƌˣי˯׽҇গ̑ఽ‹ഫ̇এҋϋʾ৭AఓԜࠥŰૣśჃȊऑmӱԀϣޠԱĢ৩ԼଅŞুƞ̡θ͖চׅڲன̀۷Ѿəז'], + 'encodeOffsets': [[ + 89858, + 50481 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'MOZ', + 'properties': { 'name': 'Mozambique' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@لæ৞ʁɖńגt̚ʦԌaऀ͜ڞӤƊϕ“࠷ľ݅ಿƨЫʣ׷͙׍՗Եޏ͉ृСॉ͓ࣕƵוׯ΋ȗí׳ЌُǔӱZʣƪ¦{ࠗƋϷȤƝűΓΗ̗ۗ˳য়ҕρ̳ðΟɊÉíѵّRïϊůϖí̠ƬपɓװГஂࢬ॔ɜ؆ŶúĨӶƉʞ˜غǐ׌E੠ѥ˒ЏÔǹȼϳǰ۫gÅ̼āװᢈۘӚЕɴüͨɅ¸͵ǯϷØסոԱʲ׌ζǰíઊΙ؈̣˖̅]ɽદɾٔ'], + 'encodeOffsets': [[ + 35390, + -11796 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'MRT', + 'properties': { 'name': 'Mauritania' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@և־ԗؤ֍ɞГʚҵUЧǽйð˽ˏïҐɺаŀߊģࠨĵкČмɑЎѵδǾˬᾔMǃ௎ȴќ߀øᒸ᪂©F౞Ṗ᎟౽cМ⋅М⋇ƤĻȇי⁙]ųȇ͕ÈӃǕוɼˉoƗӵ˯Ƶ'], + 'encodeOffsets': [[ + -12462, + 14968 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'MWI', + 'properties': { 'name': 'Malawi' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ɽٓɾથ̆^̤˕Κ؇îઉεǯʱ׋շԲ×עǰϸ·ͶͧɆɳûәЖѵɔʮޮ˄̈LJۢǚڼƞɪɉ܌Ѕϐ࠘ƽǜɵ˶Ϲɾଡ'], + 'encodeOffsets': [[ + 35390, + -11796 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'MYS', + 'properties': { 'name': 'Malaysia' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@àћֈĶ˞ΈȘýӸԓΜ֛¶֣ęϡĆ˿Öӻ̒ɵͤݑe˳׫Éߑخ঵ښįђӟ֚ś̡۠ҜĠؔȃΤƤƮۈρ'], + ['@@أ˹ܯƚॱ@̅ॗ͓̇љୟۅǵߑɾЕóөщ՛Òէǟַӆƕ֘؜˽ٮǀǜ܆άǂ৖Ǻ׾ڔЬՐϦѥǮ˺В¸՜œа٪אшڀͼHќыžιֆɻ۬ʧÑ֝͡¥ƮЧ'] + ], + 'encodeOffsets': [ + [[ + 103502, + 6354 + ]], + [[ + 121466, + 4586 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'NAM', + 'properties': { 'name': 'Namibia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@رٌؖ͡ȃࠊȷ،˯ಒm৒ŅҞ͛Όѡۜѳ৘ǽՆۃࠐ»٢КdžԊƞհ}ԄϝŶÐ₮˜׌Е᎞ş໴΂یȒհµͨȍPéӁȍʭC՛͍ͣΎಕ̍سƒ{Ჽࠣ‡BយA᷋ݣѕҋÕՇDŽϗÔƗάͩɰГг'], + 'encodeOffsets': [[ + 16738, + -29262 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'NCL', + 'properties': { 'name': 'New Caledonia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ېԵѨϭ͉ȫҥɪ׹ϚէѼ։פś˶β[Һ˹φ˷ˎɻ'], + 'encodeOffsets': [[ + 169759, + -21585 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'NER', + 'properties': { 'name': 'Niger' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nּॹȐОҿպœϤâТբ̴̘ପðݜƄîԮҠ֘Eኬஈϒᝪ࿸᮪ཾ೨αӀңר̸ȸಯ̾ɓ`ˋΔ˽ǻί͕ၻ«ધੳߋγૉΔ̵CեբmčЃʁµˋƻm֩ंȟ’ځҷٱʔҍ¸ʏşӯ~ӷΧѓq৯ѢЉȵѓb̿͆ࡅ̼ࣗıɕǻşӗʋ͹ÍݣٗӚ̟E˭ʗ'], + 'encodeOffsets': [[ + 2207, + 12227 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'NGA', + 'properties': { 'name': 'Nigeria' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ࢍ̡͉¬͓ȉڥl҇Ղˡ؊שֆكYݍB¶തs՘ǂՊʶʴТԴėɨǔ͸ȍӾ˪ÎݤʌͺŠӘɖǼࣘIJࡆ̻̀ͅєaЊȶৰѡєrӸΨӰ}ʐŠҎ·ٲʓڂҸȠ‘֪ँƼnͬͯğƱ«˧۽ٱɛՙšѧDZȉǝי҅ΉŽыȋ͹ÿΓֽ˱ҽΊ͇aԃӭʑQЍ߷ɍש'], + 'encodeOffsets': [[ + 8705, + 4887 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'NIC', + 'properties': { 'name': 'Nicaragua' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@̃ˆϽͺȁ˲Ο˄сϜĤžƒŵÚÒʾ”ŀȔŬRkЮȠrǬOǺɤʜǝĒľƺIJ̊ɴbǦĄQňȪĖ|ƜŹǚ›ȆńɄB̈ŌŜŖ˾iïă§ȉĐ̫ȗ˹ěͷυ®ɏtϙŹĉýΫÌɛǣɋ ɩźƏȩDZʛÈƓǦˉêȕʼnօɞųŇ'], + 'encodeOffsets': [[ + -87769, + 11355 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'NLD', + 'properties': { 'name': 'Netherlands' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ۦyǀ˳Ƚޓɇ́ԍ@ƘࢡҥȞՏπީǩ؛âѠɲ݀ఆଲΘ'], + 'encodeOffsets': [[ + 6220, + 54795 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'NOR', + 'properties': { 'name': 'Norway' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@᥆ؙઍɣऄՅෛ͵ڵû΢לઃͰಫ˵Ы؝ߟωࣗȮ઱¥णѼԉɝԷ“ūփནƊɝҵ߭Hևױ࠿झಫ஁̨˹̇ͫ࠯bձ޿¾૟՞э˥ধֻۧυӛ֝Ԫဋঁ૫ȟ୏є̛ࣚˇ኶ޞզᕠ۶ဌࢂ໤୦፺ྴඦلᘼ੊ᇎπ൪­౮ۢ໖›ພǘ'], + ['@@ም΅๝Ȝ׆ɐԕˎეǚͮ̿ொȍ'], + ['@@᪖صᑟͥұأ݅ǁЍۡৣᅵԢނ̘ఽʐ࿕܂ٷڄᘎ̜Ң̋஦\\͊˼௾ˆ੖̋'], + ['@@࿮̏ఝҍ᝱ı៙ƖƫɴஹdँϬᣴɼ௞ȫࡘʤᑺȽ'] + ], + 'encodeOffsets': [ + [[ + 28842, + 72894 + ]], + [[ + 25318, + 79723 + ]], + [[ + 18690, + 81615 + ]], + [[ + 26059, + 82338 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'NPL', + 'properties': { 'name': 'Nepal' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ÝαŌՕĩͩ۩aয়Ȟ٭ĂӛђଷŊયҼ߉Ю߿͆͜޼ՒϠΒȪڪʳࡔշҾť˰ЕٶǓۀσौȕঔć'], + 'encodeOffsets': [[ + 90236, + 28546 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'NZL', + 'properties': { 'name': 'New Zealand' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@Ȓ΋װ;ʐΡBΝ̹ϳչإїͷ̴З٭Yܗ̓ɣջӋࡗڇϓнʇޝlխˢࣱÐƗ̰Ҍذ੐ࠦժǀ׾͌ܜѰԎѦώظ͈ɆŰҶלϴȆΧ'], + ['@@،ࢫlָϜɯŲًڰ˛֨ãӒ͎юĭȯݗʯӫٛjɡʭþαūƻͅҏзֹ٭ͯƟɘΕŨӞ۔˟ҨࣛͲz̦؈̌ƚ٨Ÿլͻ֜vƪБΎڋݔΗת̸àҚұٺɑʂݡ'] + ], + 'encodeOffsets': [ + [[ + 177173, + -41901 + ]], + [[ + 178803, + -37024 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'OMN', + 'properties': { 'name': 'Oman' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@ֹ̻ϟªǩȧƉэļ֗ÿĻϯFԽ̻ćХȓǯԹP͡ɃJͻПɷҩĂ֗˳ϱ³˝טٿ൴ᠾ࠾֖၂ϩתv͸ʔΐFΆϞǒƩŞèմіHϖֵҸ̧؞ŋӼƳϜӕɨ˧̞ŃCȉ̩ԃƅɽΟˏ'], + ['@@ʼnƳDž˺ʔ˺ľñā΍'] + ], + 'encodeOffsets': [ + [[ + 60274, + 21621 + ]], + [[ + 57745, + 26518 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'PAK', + 'properties': { 'name': 'Pakistan' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@تϻʞ٥൨ͻ߹۷ऩůౣȲЫα̖݁̈֩ڴгܑӟ`׳ࠃࡇՃ࡝࢝ࢡউÚऑࢡռϗĪ٧ҾэǘܝᇛD֓֕؛Ɇʣ؀٭٘໻ǁിeஃŝ̈́ঊொѢéϰГƌw݊ߥφͷԔеѶඨѕࡀŲԈŅǞȂגóદĈ܎ҶӈشCĠɼٞŌ̴ý͢ʀ±ԌΦԖ՘Ɇͥ֊ߜɴ̢•͒мΜĩмȣΤӬμࣘǮ८ĮѐƺӨĦ'], + 'encodeOffsets': [[ + 76962, + 38025 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'PAN', + 'properties': { 'name': 'Panama' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@˫ʎǵҒȺɢɅÎƿˤлɸοÁǝ̇ͻɁǽ‡ĉǩВҗɯŅŧŭϷ©ơԈŋƛˡ¸ǝ͸·ÈɓİέCǻĩŶªǖìǠƲŲIJǩŲK͸͘ö̠̝iDZͲ›ĀæɴȵЮÔΨɄԜǞ˺ʤҬ·‹ĉҶ…ώơ˜ʧ̈́ɵĹūȜӵǁʟ˓ÒŅС'], + 'encodeOffsets': [[ + -79750, + 7398 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'PER', + 'properties': { 'name': 'Peru' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ɥљћɋࡅӘñΈရࡊທࣾ٫԰ΏۜƐʎ܅ાࠣ༄ߍီ΅Ϥ˃ؤٷպױͼ˖ϒПߢʼךڢՎIJΓʇȧx̭ΎâͼĝΚщӆΌDŽ֤ԦܶৠͨࣸࢠʾմŝٔɢĂ֒ЉˎЅϴɏӶࢣضĿҨɞ̤ƣԎð٠Ͻթࡣʤoрҁݳ œųۍlj॥ֱÓϻɉ̇ČғԕʍBΡɛƵΔݳҲԝDZί֐µ͆҃ݐuېӸÇ౧ϢĩӄƠܪടǷ˵£ןg܍͟пƮ̵ȕ˯β۹Ջ࣡'], + 'encodeOffsets': [[ + -71260, + -18001 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'PHL', + 'properties': { 'name': 'Philippines' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@Đ֏ºҽ˹ޑ̫ࡨϽэˎإʉϿ঩Ӧɿ؊ʰЎՑЈˁΑЃثҵƑʖ͢۾ՌʀҜ̈́̔ϝٔɰƎϒרv·ٰڼЋêхÐ̱'], + ['@@̟ˡˁՍ˃ʝԫ׈ǦɤɂɾĢԸҨ¸Ɖ֣جߺāߡ'], + ['@@ૣߕЬט؈԰Ԏ׊Ѱ࠲Ʈۅևҧѳֿ'], + ['@@Ԏʹ՘BgΗϳΣՕʧ‡ϸÒєŽА'], + ['@@ʀभ٫ɞj˭ȶԯЍȋ•עʧªƁԘӶãY͈ԣٜ߮mɴ̻'], + ['@@ɟܩέоѓ٘ܚ‰̡̈'], + ['@@ԮʉʶɖüɇƍΑ˼׻ɛۥӷ˥ƁڳȊڝѾġϊIJਾүăҙ˜ȫēϯٻЮ̵Ѵɍ̯՗ԊރůлȆ¨ΎˀɊʣȘŇ̡бӚűμߨͺˡĔೄ˜ހԘA'] + ], + 'encodeOffsets': [ + [[ + 129410, + 8617 + ]], + [[ + 126959, + 10526 + ]], + [[ + 121349, + 9540 + ]], + [[ + 124809, + 12178 + ]], + [[ + 128515, + 12455 + ]], + [[ + 124445, + 13384 + ]], + [[ + 124234, + 18949 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'PNG', + 'properties': { 'name': 'Papua New Guinea' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@ɽčε͔ρՔǷ٘ŜĆĜʡʬȏРՑЈ˵ŝɽ'], + ['@@ѯçƃɽҟȱћȟѽBۏʔӑɺêʺݬũҠàŶЖŦrĆѽӐÜʂ˼Ҹ̚ġӸԌfǜƏgү˯ԡ'], + ['@@ݤտղࢻӖ„‘ω٬ƛʥǁࣀΝġʏ֋ÏȷɔܟĦࡕŴٷ՚ӉҦѧ݀ભπ܇ʇԡˣńإڇ˿һƖࢅ–aᩒaᩒภ׃༊ӓׄїҴхŸӵඔԱȲѽޛěȄ֕'], + ['@@ʿɡǁӸȝ͘ϝ˞ӍΪ؇ʚɺȮҒɻ˸ȁΜȫʹΛ͊ˏĶѧ'] + ], + 'encodeOffsets': [ + [[ + 159622, + -6983 + ]], + [[ + 155631, + -5609 + ]], + [[ + 150725, + -7565 + ]], + [[ + 156816, + -4607 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'POL', + 'properties': { 'name': 'Poland' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@·՜à̂ȹ̧҆̚ɺɤȝђָʘ಼ϴ੒˴࠼ƙÚȱ߸Yਚħ໶^њěȬʵšωɸ͋KͯԋǡʸϳfϏцܻěɽзįރۥɒϗǿ¶ߙ͔؁šЇĒӹǵч̖Ήŕ³¼ϭаر¼ăˀֻĦűɑҗǨÀɴػòЉ˔'], + 'encodeOffsets': [[ + 15378, + 52334 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'PRI', + 'properties': { 'name': 'Puerto Rico' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@јõưǕɋɃمLӫ‡·άŢŬیK'], + 'encodeOffsets': [[ + -67873, + 18960 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'PRK', + 'properties': { 'name': 'North Korea' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Şƥ͉ºη˵ʣ˷Ž׽ѣȅƫƧ̓ʝ֓ƏηɥηįġͰƋӈσŧȭΧÇץ¡͝ϛϑˆÁùСdžĵƿʙé‡ǀɑüɥƆɰφȤİõƶɆҒÅƎөĠЇɤۄբऒҌ־׮Ўˁܪ‹ſѺಚβͰҼժӹ'], + 'encodeOffsets': [[ + 133776, + 43413 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'PRT', + 'properties': { 'name': 'Portugal' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@̦Ɉ΄ŬɂЫӺDƞłӪ‡ɼуϱɩYٽƍū‘Їγçʹԋɵտ̄ʡřɫ̵̿ê˥ͷɓѷŠџġŸڂÿԬϓþȩ͈äռͰ̨ÒͼǪԎkΤǙ̠™˲'], + 'encodeOffsets': [[ + -9251, + 42886 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'PRY', + 'properties': { 'name': 'Paraguay' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ͦ৖tҌЖ݌าʔޮ]޴їbʵʞҳÇଛࢲLJ΄ǐ֦ɩǀʣþޓİ͓̼›̀ƌ̢ƳAҥŕӻǑӛƍݏށ١ړƇऻŸࡑɮࠢ౨ťψࡽ͢ਅبۉŸ໵ൌ'], + 'encodeOffsets': [[ + -64189, + -22783 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'QAT', + 'properties': { 'name': 'Qatar' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ÇؔɨѲɰĜʬˁdӯǽӳɵÑʫǖ'], + 'encodeOffsets': [[ + 52030, + 25349 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'ROU', + 'properties': { 'name': 'Romania' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@δǶԴġՠGϸȳ˺źبĄɄȠΠ@ʰćʺʟˊΟӞԁ€ρėΩưϥϒƹЂƊϠƟpɏПǹʯĀɻ৥ӳĖ̪ؑফțзɋ௽¬٥ƀ͙ÕʍΊƵƦȚƘȷŀ˃ȋөʔßΌԟȢĥˌҕͤڪǂԖ֮Њ֬ԢǮ'], + 'encodeOffsets': [[ + 23256, + 49032 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'RUS', + 'properties': { 'name': 'Russia' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@ࡌ๫కˤԫ்ࠌࡳyוُԒսٱƻ۸Ĥࠊħ࣢Țٌš૴ӯࠜôରަϮͭϴϐŠɔ։̆ߵuࠟΎࡑ'], + ['@@໵]ਙĨȒτ୊˚ࢢƧψƃęɱäɉ'], + ['@@֦Ƚțؐᗸű࿨޻࠭λ൛ēsࠑͳǩ޽~ٗ̊ૣʖȉθ࡟Ǝॗʼnҗ̎Ǽ̸৓ȥϚЃӉΣ@„Ꮪٛᔺ࠳ïԷ'], + ['@@ः©ƭˌੲΖ@ַ'], + ['@@ળ»@ָň–܈E௒ʉïŗࡽȩ'], + ['@@ౡMႣĤƧ¬ߘͪੀþஞ͏ĸə'], + ['@@ॿͩഉø༛ͨȪ˖༨ųᑔɗ'], + ['@@ډرᶽzඃȣမղҎ׀૎ǂᕞ™ᴬѽ'], + ['@@ӹóᩣŊɟώູɦūҒ࡮Ƕ…Ҟသܒޙĺ፨݆ɩϢሤѺ᪪բ᫠ǀ෴̸࿐Ŋאͩ֟ʻᲗз᢭Џᤙߝఫࠍ೉߱Ǡۥྎۏ'], + ['@@ɨгސȲឤYቈЧڬ̿ȽѧङʝᕅүفʟਬşఖɃݴDŽєաτɔഊƂ᧪ƑȴϽ↲ů´ٜᄼƥഄLബѷϮ՝ӹΙੌڋ೔Ϳ߸ࢦഖϙ෢ɦྼʵؤʀൖş؅ޮૐζ䢀ձܐӿᔲٛ₎DŽာƑ۪΍Ĺؙਜʇ૴Ǥ๰vཚǑཪĢะݛਪˎڷ՞ϐώᧆɻფºᝂБ୲ν@”MKઇσઝÖݶҁԄەϲɧĮΏɑɝ༧Ǿ᚝مݛĭ౽ן௛ԧ̱ϣய׊ᔗڇϣ̸ߵΫ૱Ř˓ց৙߽Šͻड़ȋő௣ޭ‹Ϋ۱Δα฽ѕ̅ॡభȳʥ࡟ே޳ׂ̳έ௬ҵለИ୘܀ԆªϾರȊຊ੒คࡺຢڢڮஆ৷ëԍۗᒉइۍਖᓧ˷ᑃටۚԧሙɕಝēÔ؊ಯŶ਩ЭᢵƠ᪏ʟᨩ࿛ủጝ೚ŁаՃࠄȅ՞оईÃௌऍ†܍ځ࠽ë্ϛഉ్௓˯ׇଙ঑ଇॻթӹ૩ӱՉYՇФૻؙſ˩ŝƦKѐіxŦ঴ɛܚܞ̒৶Ʃ֢ࠈ˾ऄ͚̮Ѵݲ൷ʛܯͧ౧Dͻ߄হװหˎ̵ࠖ̉Ԫ̿βԯࡐ̲݇షʢ૛uਯƱۛлҤȥXҩұˑݷࢻRσஅՍ৙̈́োéѯˮԋĞ௷ףેƑޛȻੑƌޫSԙіࠕИࡅŎ੝ŋߏƹ஛ΜLJـধɎށİवΎࢉࢉ΀ӵࠇב௏ɂ࠻Š֗Ͼ࢙^ܳʴ౫Ѓྃܣࢭơ͡çѽԤઍőΧΦחnjЙӠҩưிɍୃӜ҃ѯሟᒒੵٮ̮˂ᑋߍ߭³êҞઅ˺࢙ȱ˃ࢊມǺݯΑᑅ̳Чȹḭ̇ϫ˻؆ֹ߭ɓǀɭ߭ХസֿɁЉ୻˜ʓʟ੹Ѧ೯iࢻΟহͼᇡ׊ಽsჃࣳĿؗࡹӤڡउʖǡӝُ܊֫ذx՚֗ďѝѐƋϥӽ߿Ƒ࠳ࢁކߕĉ֣ࣼফԇ͹ƝɇωÌֿԚɿ†ՅȚʳΈ޵ǮԙƁƥƼଥЖఅƌ܃ƞĹıੱ܂य़̈́ܩӴؒƈۤ۰ҹͪఌ΄uȀݯƉ‚ώѠɼ߼ÖƄ˪ȅҪ΀ѰWʚఉ˚ӭUԯЀ١ƃ੩̐lǒ̗θڟ¤éʼɀǞ՝ӈࢋąʭ¦Ƀȑ̽”ȷ՞ȟ˨NJĀڴ‡͞Ȁʍɢ֥ƪ¼Ʋ΁ƴՃվǸɨĉЂࠑȨѱijšȼࢭɂˑӸíТЙȖάˊʝ޶װӞųƤक़ҬࢡЎᅢ੶ޮӠ͂єగּΆնݳش֢ܜ঍ग़ޢي౿֔ŬךڶüොͶࢀ̈൦ԕᘨȧṺो٤ЋÆ֓टѳ൏ɡ⏷ٔ؟Ńൌ؛ÂϵÆ࡫ઌʯڂɓňРԑΰ՘͈᎖Թ۾Ȳ֣؜ዦࠖޢµ޸̋Ӫ׀۫ԄЪԊءԶᚠˑӔҹ੡ĻNҳڌ˽ಜǼȶ՚ჶАᰪܞي£ࠣԙਬĕ׼˼༾xఢΐफ़ԏॖ֌ࢡӢѪˤ២ʫ୒ʿᴾॣ֚ѰࡡѺ{ǴৣĈˢЌ҅ټ}ː༄ݾրކزǒᕮɛǬұߕڽԺˋ˒חȏଵऒԧέ֕࿫஝०ŭ̢ͮऎɎɞжܮЎөӌϼֈࣿêȫҲڢࡈણۆຒ֦șװмnѴүͧ߷࣐Ƶϥ؄ඤͦლ¬༈ӏݛ۪ċࣆศǞ፾™ᆘŌہѮংւॲx࿎иᕠŐ˪ɲᕂþیȋሴҀ໲aɶδߤΨጤΈ෸˗ଥȷበŹ'], + ['@@ⵙ͕ໞીےĦقÃᒈӋʟͿ'], + ['@@૽ōݱÛśƏঙƑ࣫ȦӐʾል~࿞ƶ౨XǢɧӘȬߊƐఞǿ͗ŷ'], + ['@@ᆳĿᚉʎඅ͎٣׾଩ǔᔆָᆎȎ࿌чኬ߻ȹݯ'] + ], + 'encodeOffsets': [ + [[ + 147096, + 51966 + ]], + [[ + 23277, + 55632 + ]], + [[ + -179214, + 68183 + ]], + [[ + 184320, + 72533 + ]], + [[ + -182982, + 72595 + ]], + [[ + 147051, + 74970 + ]], + [[ + 154350, + 76887 + ]], + [[ + 148569, + 77377 + ]], + [[ + 58917, + 72418 + ]], + [[ + 109538, + 78822 + ]], + [[ + 107598, + 80187 + ]], + [[ + 52364, + 82481 + ]], + [[ + 102339, + 80775 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'RWA', + 'properties': { 'name': 'Rwanda' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ͬӃµӵʏŁѿÆʱӍԛàþҠŘތԄʎɺȰďԈʸ'], + 'encodeOffsets': [[ + 31150, + -1161 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'ESH', + 'properties': { 'name': 'Western Sahara' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@oҊŸ@@ÉeNjEౝ᪁ª‚ᒷ޿÷ȳћDŽ்ᾓNǽ˫˜΢bCቆäĶ̢ΆϘˤୌୠ࣢Ђ੖ˀÖ˜ټۺĜ̦ʼnϢ@˔ȒԲ‚'], + 'encodeOffsets': [[ + -9005, + 27772 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'SAU', + 'properties': { 'name': 'Saudi Arabia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ʼnΪʩʨÝͲѡ̞҃۴ʁۆׇ׀ϑƐ֋ߠīא–ӾӕञϿ͠ґǨˡӖ°ȎɹѦʕȊ͝زԟڴѓ־лIžҦœ̌ļͲनƅζʶȪ̢ٚŚƒˮˤƜ࠷ࡀ၆фdžŴৢɩబיᛎၕ༠ãݠąȾЏתv͠ܥаȓƠִ̏Λ¼΍ċ˩ł˯ʎɽŐ˟ŲȵʬǕɶÒdž͍Žș࡙͐ᡌщǞDzϪש֕၁ᠽ࠽ᝑ͑޷ϙ׻ࢥϹƕɁˬ͏§߻ĎƷČॹmɫùΉɔɝЭĒΟρˋ'], + 'encodeOffsets': [[ + 43807, + 16741 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'SDN', + 'properties': { 'name': 'Sudan' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@śhdмĵ̀џͨĵ؄ĶبϳÌÍȇԍ©Ȭʕðԍңңл؅џđ۹Ӫͅǥđʓџǃ…ǥ࠵@řǦ؃†̡ƝɳîѝӬƟɲ؃ŗɱϵɏݣ˿ǁʳğå ̅ʎÃʼƌΔE΄ӛՀĩάZȰ̱ʜUӦǭ͖̍µĎ̰ɒΖħΐˢʴǫȞɞ԰ϨئܦÏ¥ ZΚॲH@း@Ὂ@ῼ@˔ࠗȁƳŪࡻ্̰͌ȷҠ̳ыӑأƏ˅ʳĉ֑α௿ĚͳƅܟͿࠟԓзέٛč΃Љɽʝ࢟Dij'], + 'encodeOffsets': [[ + 34779, + 9692 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'SDS', + 'properties': { 'name': 'South Sudan' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Xٽűʯѿq˷ӏԨÑюХƨͳϦșӼࣳ֫օԫԇԫϭסFگȟՕȊ΋ɭ݉֐ȥάҵDZϱÆɣƕϗĸԗۚƉˊعͪɅԌΕζ֟ѬS˘ҡͼ֯͠ʴĠ̀ǂɐݤɲ϶؄ŘƠɱўӫɴí̢ƞ؄…Śǥ࠶@†ǦѠDŽĒʔ͆ǦۺөѠĒм؆ҤҤïԎȫʖԎªÎȈϴËĵاĶ؃ѠͧĶ˿cлŜg'], + 'encodeOffsets': [[ + 34779, + 9692 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'SEN', + 'properties': { 'name': 'Senegal' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@΍ٺн̚φDŽРמȦќ˾ːкïШǾҶVДʙ֎ɝԘأֈֽžԹǔӓ̾ɿî͗ʽŧ³қâÙģȃk׿ȲЛV༇–ɥħ˥‚ѻƋƏ٢ވkȬŞƮR̸ȘήǯκcζȌǝʐˡƙʻJͧȸˉ_ȍȥࣵy'], + 'encodeOffsets': [[ + -17114, + 13922 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'SLB', + 'properties': { 'name': 'Solomon Islands' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@ɾ˿חN͉ԬԈȯǜ‰'], + ['@@͝mԧĎǫżÀͮֈƁ˜ǭƎə'], + ['@@ųƹحܰǫԈ˺@̠ڥʹЗ'], + ['@@–ǛڅΦҟ̠̿˪ŰĐϮȫېϭȢˉ'], + ['@@Ǘ³οȒ·Ί¨ƖԈΡͰ˛'] + ], + 'encodeOffsets': [ + [[ + 166010, + -10734 + ]], + [[ + 164713, + -10109 + ]], + [[ + 165561, + -9830 + ]], + [[ + 163713, + -8537 + ]], + [[ + 161320, + -7524 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'SLE', + 'properties': { 'name': 'Sierra Leone' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ɧØ؁ͺѩ҈Ƨ̬Ĺت҆τĬɺƞǸɶpȜǂڦCɺ̛ǼˁʓƈɗṶɴ´ϹϹϛҗ«ʓȩˏ'], + 'encodeOffsets': [[ + -11713, + 6949 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'SLV', + 'properties': { 'name': 'El Salvador' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ġȡӡ^̡Ą΍ǘұÀʃǶ~Ů˾ɄǀĢ«IJȠ¾ʜëǸǙʪƇŒœτĴǤÑŘĝÏͳ'], + 'encodeOffsets': [[ + -89900, + 13706 + ]] + } + }, + { + 'type': 'Feature', + 'id': '-99', + 'properties': { 'name': 'Somaliland' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ϛԩד۫۹Mᩧা͍̜̳К̳ҨǾ̖̲҈˚ƹǒΏϜΗкGߊɌࣴĴ݌ʼиÆ̚ƶӎˆKaE΋Aࡑ@ѫ'], + 'encodeOffsets': [[ + 50113, + 9679 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'SOM', + 'properties': { 'name': 'Somalia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ѼĎЊ˾͈FpɵýӧHѳǯ̣ʁࣥЙयԱ੷ܝ௷ܓवধ଩ࡁڹష࠯޳ٕँৱȗѷȍȣӽۚWᵤܾ॒ɰˆբfݠפબšᛜᡄה۬ϜԪ@ѬBࡒFΌLbːhϰŰ'], + 'encodeOffsets': [[ + 50923, + 11857 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'SRB', + 'properties': { 'name': 'Republic of Serbia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Ԡȡà΋Ӫʓ˄ȌȸĿșƗƶƥȷȏø̫Тγ͋ʿƗˋĞijƑšϳa˹µƒØĴĴĦȴšKǍƼƑ ŋƆƽÀšŠƯ±ś˧ȩÑèð͋Ǩ˟ĜūŜɟƠȢšŬЄЛ͔ɀτ̥Ë͔́ˉʈȱ͘٢ɚԾ™ҖͣĦˋ'], + 'encodeOffsets': [[ + 21376, + 46507 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'SUR', + 'properties': { 'name': 'Suriname' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@৔ǙĞưڶÔࣚɥѩܟâֹͤӽƥίóϩɉΛӓDzЇđ͹öčʏƘǗ÷ǡҙèԡܴōӄˏBωؐƺѠ¯ȤԜɖƈݲ'], + 'encodeOffsets': [[ + -58518, + 6117 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'SVK', + 'properties': { 'name': 'Slovakia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@´»ΊŖш̕ӺǶЈđ؂Ţߚ͓ɷɓǏ͹dzđ࣑ʮ˟»ȟȡЁĿěÄХŽͭ}ãǙ۷Ļ̱ĠёɌċ̆äńŢȂόa˺ĔxþLj¢ÆȒȖ˜žưʢD'], + 'encodeOffsets': [[ + 19306, + 50685 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'SVN', + 'properties': { 'name': 'Slovenia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ۜÝъȐܾtLjƘƘUǎ˳ڝɟć͹̇đHɻͣh˷ƎƷƙב†ȈúȫΨĞа'], + 'encodeOffsets': [[ + 14138, + 47626 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'SWE', + 'properties': { 'name': 'Sweden' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ࠁוƀԥ೹ڭྱܡؓஃײףߦүޗॅ࢑ȝ͍තӋ޿৳ĆӅڗঃˉߐ۳॔ٓஐφӜּۨ˦ন՝ю½ૠղ߀࠰ä̧ͬ˺ಬஂࡀञֈײ߮GɞҶཔƉŬքԸ”૪Щ಼ֱv಑˴͛ฃʃ'], + 'encodeOffsets': [[ + 22716, + 67302 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'SWZ', + 'properties': { 'name': 'Swaziland' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ǡύӭěԅҖS̄ɰ̀ĂʔʐÒшƵŰϕðω'], + 'encodeOffsets': [[ + 32842, + -27375 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'SYR', + 'properties': { 'name': 'Syria' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@࿩ࣅऩͬgNŖŶ_ΈȸҠҜ̈́Əͤϗ¨ÿٞȶΌɤȀɤȀ°Ҹ˞Ǐऎɺ҂ƿۖFॴ̀Ґaक़žїԽҡȹĂؗͅ৫ᇵ࢓'], + 'encodeOffsets': [[ + 39724, + 34180 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'TCD', + 'properties': { 'name': 'Chad' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ĎЄաnDզΓ̶δ૊ੴߌ¬ન͖ၼǼΰΓ˾_ˌ̽ɔȷರࡔҠ…ྑ…ྏ¦ ܥÐϧإɝԯǬȝˡʳĨΏɑΕč̯̎¶Ǯ͕Vӥ̲ʛYȯՏƛэͽ؉ࣹ߅ϳ߹¾ʁûĊ̏ѫ̋Σ͟੓͏ȽȐƓhƹɍۛÙƀɪ˅ׄşΐλƜӷӪǼІϦċʂÐҸSқކŒ֐É֐ͭՠ'], + 'encodeOffsets': [[ + 14844, + 13169 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'TGO', + 'properties': { 'name': 'Togo' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ڱdzȇ̎ɡՔãкȆݴɁ̬ăڎD؎ΕѠÖˀ݂kŅѵʲʝ̈̋ŽЭǜǥኝȺׅ'], + 'encodeOffsets': [[ + 1911, + 6290 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'THA', + 'properties': { 'name': 'Thailand' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ݭϬܗeŬڈ݉Káऋґ௯˙ݏÌ؋ն΀ދưܭҶӓԚĭѤѧ˝·ևĵßќۇςƣƭͧ͒ƝжҁӄПЌƏӳǃҲĠԾʚ߬ТࡸҤ޶͟ތ`϶ĩҸ֕ښȩф̄ƺ̮ܶ·ֆՓؘН݆ΠƴϦࣦצœӬθӔȘθʷ´ԍ֨ȷࢭpݫࢰԆʤƧӰzǜَ̊ÍٖڽÀࠥںܷ›܅˙ϛ޿ŦગDž՟ۧȤ১'], + 'encodeOffsets': [[ + 105047, + 12480 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'TJK', + 'properties': { 'name': 'Tajikistan' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@̭ʷࣳƖāӛ࣬Þਢ˗འŶɈާˠĐԜȓ‡͛ŴӍࡿBׁØԻϕύĉ̉ǯͩˠþ۸ʩ¢ĞʲғȐα̇ė͹Żūԇj˕ϩ˯nj؋ˑʱĺӀࡘǹض؟ȨɔφۮŸЌҬˌբ૲ȜǩϵŤɹΎv'], + 'encodeOffsets': [[ + 72719, + 41211 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'TKM', + 'properties': { 'name': 'Turkmenistan' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ñۼطŠॣݔڣĠगюׯþσƽ֙|ׯӓ݇NjƻרŪ࢞ٽ˶Ɏֺ֏¸Ȇ۾ߊȵ݈ˎؓԎʉӔڱɋď؛ʿհψ˨ॖǪ֨ɻךڅњ¤ॆ\\Əцܖ̂۾ӦଆѹĜڡ͐ǣࣦžˮƳаࡽ०ׇոЃ࢞Щ૤Ϋwԥʩ€Ѕɤſ̙۽NjǙڥӁʭڏŵǫϟهŏࡩ͈'], + 'encodeOffsets': [[ + 62680, + 36506 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'TLS', + 'properties': { 'name': 'East Timor' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@IJȤܢȌז†ˀŀ͆Ľ̯ɫ࢕ο۳ʋeʬďǔ'], + 'encodeOffsets': [[ + 127968, + -9106 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'TTO', + 'properties': { 'name': 'Trinidad and Tobago' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ӚŊǮ‡‘صۭġƯúʒɲiͪ'], + 'encodeOffsets': [[ + -63160, + 11019 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'TUN', + 'properties': { 'name': 'Tunisia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ΩພԭͺQȰۉԄóنԮҶȢۚƃߠǠќࣶͺךĵ}ы܊̲ÒljпЫMϱ̆ȽōܫփхDŽқѤaɄЍ͊ſ³٥Хʋʵˏֽ͓ĘΑïΟЧț'], + 'encodeOffsets': [[ + 9710, + 31035 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'TUR', + 'properties': { 'name': 'Turkey' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@஺͗ঐżܤõলѬࣆ¢ߴЭƜ̑ăУزȻͨʕֻʇˀ५ǏʻҠڧЕƙ̏Ɋ঍ňίŽॗŽҏbॳ̿ەEҁǀऍɹ˝ǐ¯ҷɣǿɣǿ̱Ϡ͈͂ԟí۱ȖֿәౣĥڹҊࣟ†ȗΑׇij߻҄ࣻeӽ࠶ؗҰЦٸՓВठߨಒ’Μྀٔŏ৞հ঒ʄർlุף'], + ['@@۫ҏ˃Ϻ\\ǦȦĦʺՂХɞࡦ˄ܤőĴ͓ܼ˓Ƶȵি±Ωʷ'] + ], + 'encodeOffsets': [ + [[ + 37800, + 42328 + ]], + [[ + 27845, + 41668 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'TZA', + 'properties': { 'name': 'United Republic of Tanzania' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ƚġᵂႋÌӣ஼࠿ϱਙ¸Ӊՠ̩~ɓɳԓ¶ʭÇГ̌Ճΐ̰ࠡǿڝӣࣿ͛ԋb̙ʥבsɕŃঢ়ʂكåɽଢ˵ϺǛɶࠗƾӉʨՕƘͯƘΗɈґ੖ӣҺǗӤČѨƯޞΎ ̨̦͜ѬȺǮS˘ǷȐ·ͨʐł¶Ӷͫӄ̎Ķऄ[ႎà'], + 'encodeOffsets': [[ + 34718, + -972 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'UGA', + 'properties': { 'name': 'Uganda' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ः\\̍ĵԇʷȯĐPوȜ͎²ڬǰϸ͎Ѭ͔ɠ˒̘͵Ŗ¼চΌɮՖȉڰȠעEԬϮЊ׍İсτ९̧ؓЯ֋ʉͽTࢹႍß'], + 'encodeOffsets': [[ + 32631, + -1052 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'UKR', + 'properties': { 'name': 'Ukraine' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@̾“ɄȒʮ¥ࢌĆ՞Ӈȿǝêʻڠ£̘ηkǑ੪̏٢Ƅ԰ϿӮVఊ˙XʙͿѯȆҩƃ˩߻Õџɻύڡã֑˕޽«ܣ̻¸ԹЪȭࡨ¼Ǐ̛ँơଛӟұǠȄЂࣽʘƨLjߪ˪ʑȔಯɆË̼ީĻ̷ҧٱةϟƠЁƉϑƺɂĞƦ˾ɲˎÑƮǬäĊśӸ{ɞØƽĎÐŲ̉ɈŧΘ̩ƐÒ˶ϝɦΉŽأʾ֑ĉȧŭΟ@Ƀȟاă˹ŹϷȴ՟HԳĢγǵÍɤұɮǐͺɸɔȀµɑϘބۦиİĜɾхܼДҢɪٲnࡖßबȫڎi͂ŧ̀Ʀɚȝݸ¢ͮąÄцʶȂܞº'], + 'encodeOffsets': [[ + 32549, + 53353 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'URY', + 'properties': { 'name': 'Uruguay' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ղĚࡆٯ̺|ࡺ՟ڈҫӠֱχЉɸӇεՇॉұاǚғěޥΰ֫ԟҬÞլǾȈS࠸ɤࡺȾڦ'], + 'encodeOffsets': [[ + -59008, + -30941 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'USA', + 'properties': { 'name': 'United States of America' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@ũƕȽŤ|ɾƓ̨¦ĤƤƎÍǔ¸þÜe͐ƙƬñƌőɊ̍q¯͟ǵˏſ'], + ['@@˭ÑƟǮīèQÀĈî̘āɘŹëĵ'], + ['@@ĝ҉|Úĸа•'], + ['@@­µÓŻˆŃȒ’ɤŚêÃʐ˥'], + ['@@ıĉ˱ƴªÖŸĈȘijȝ'], + ['@@Ƭңʼƛז½࡬ƅࠂʹڼŊਖɓ˞Tݨʄ߂̧ࠒ͗ں˩ٶˏĈəȢĉ½ĉɦǎĔ¦ȣǜƅɴ@ŬĹĽƫ࢖ЁǶށǚܳʗӹЁҥȁ̍mēĦť˸Ɓɂ@ঊ҆ࡾƀસмfĐ÷ʰƉǒϜƆࠜHޘAˎ͞ŀàࢶ؄ϜƸ౦N໾BĎȺː¦Φž̖Ϣʲٺٚي˨ə֜ƜώʏAଧռӅƢ˝࣋Пࡷ̃ࢱʝѻӿƛȋSѽˤѽΒsė̬ʦȇãʇ֥ƋЗhةƥλ¥ӥ¥۫ʏఀǂʠǃ୳ʥ՗C|ĺʭɷʚǹ׽ؑ٧×Ɏȁª˟ɀǪҍȼƭ^ͅˏ͛ҿڡûʺֲѕ͎įۦljεǴՑևƀׂ˓˜ߛʊÍĖ̃ŠࡁՕدࢇʝցӱнÁэ̱ţ˭इձӁЍЅӽŻׯƪ׍ˬܗώשLεЊঅ֥—͛ȿԡʣŃЯĺƁς͋ȖѻܢϹٞű͢Ǥ֐ɽҦٻ۲͟źࡑϡƭ¦СϼՃȺोŁݗĤٙÍΏſƲɟaͽǴǓLJō̵Ů́ǃ؍€طѺܻĿ؏ȚԹÏۻȝއح࠳γҝБȕϗUׅ¨ЕDŽ˹͝{׭ȂٽʺɽЄȁטӷӐ̃ӰуֺףͲۉgՉڑۣʦѡʪȽҦ˧Ѯӿτїˈ̩̖ป@C΋ڗ@ဩOቿפ౓ТĀǒ੩ĝॕÝƙіխӚϻĴğʌһ¦̝ɪޭĊɉƌĹҢࠁࡊ۩ୠˆȚχˤٯ۴řۆ҃ҞȀۢ…ܜˍ٢͠ߊĸނĺނƱૼˇܘʓ϶ĸǐ௒˷҂ߋȺɜƇې˷ێᛸ@᠂@ࠜ@ᢢ@៚@ᡀ@ᡄ@᭰@ᮞBაAF͔˴J'], + ['@@࠽͋ѕɐŽЀބ̘҆Ÿ֐ÉΤʻܫЍ'], + ['@@ԧŽսƾԛɮࠦƞښùĂ͑'], + ['@@԰DžԾĒڸɛ࠲őéĝُDZٕǾ͋Ʋݍµȧôº̈́'], + ['@@؊ϛώnjහ»¹ȕ౾ƛࡨČᄚ˅ྤā٨ʼn૦Ǝౢʧࣲŝ@@MᷱIⷍࠠ{ࠌɵהρݜցࠈҺࡈ˖Ҁѡ֤·ޒϙՂ׽࡮य़ේ՗xՋұЙҥ͂ݍˌʃܺએںҍߎ߯Ä೷rটʌ჉ࢎߩDŽ฽̜୑í࿻ϬৃΨटǯǦ׏ҫÁঁǫ݉˱झdzťӶϚࠚࣀʶɱɂੱҵֵ֑௅ױؚСߏ׿ࣗΗࡁʱȻωಽѡ˅ϿছΫֽÞ޷ɻ࡝˹ۧ˫෹ʉſƘऀϾࠔʸࣆҠਬĨвΈ୘ԊȈǚب̒ƢْђӸॹʫ˓Ơҕ̧շюɧ̝̽м࠿ͳԩBïԄƲ̮ե̚થLJ܁ЀַȬIӈ٩Ϊ͘ӘۆҸ̚њںÖ־ƇڴМ؎ï٘ʼƻϨҹưج͖ԩWࢻǽʯȃڏȄஏĥ௷ȬΛ͸੟Ӧ୾ΘመШ۔@ŕнᄢŽڽԶਕ͌ױр߫ΨଽˈҺѲ๰‚ਗ਼ϦȨФ࡬ЎࠊĪཪώޜÉಐ҄ౚǭ'] + ], + 'encodeOffsets': [ + [[ + -159275, + 19542 + ]], + [[ + -159825, + 21140 + ]], + [[ + -160520, + 21686 + ]], + [[ + -161436, + 21834 + ]], + [[ + -163169, + 22510 + ]], + [[ + -97093, + 50575 + ]], + [[ + -156678, + 58487 + ]], + [[ + -169553, + 61348 + ]], + [[ + -175853, + 65314 + ]], + [[ + -158789, + 72856 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'UZB', + 'properties': { 'name': 'Uzbekistan' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@xԦૣά࢝ЪշЄ॥׈Яࡾ˭ƴࣥ͏ǤěڢଅѺ۽ӥܕ́Ɛхॅ[ᶾᓘӺƾïದ׻یͅߤݵঢŪ෸à৔ؗÙࡅЦMǢۍ੬ɲЉ̺Lπ׺૎הӖƺʠĉ۵խئ́ײȾ়ѷ੽؁ٕĊ΍uţɺǪ϶૱țˋաЋҫۭ ɓυؠȧǺصҿࡗهǰҳN'], + 'encodeOffsets': [[ + 68116, + 38260 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'VEN', + 'properties': { 'name': 'Venezuela' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@yȣӱĭ˜ϡYѭυӥ͆ڙδÆȌ؈ʻ̒§َਸ਼΀řІ̎ˆ̞ןל_մҵ˧ݮQ࣌ĔӖϕٞĻҼʾXɄਨ¼৖\\܉ʛ˼Їڦ×ِЯƆڧѬn͢ȣڕӱó̫˾̷ȽƽԫƉjϱɫɱّ֪Őʁ̭͍ऱ̽׿Žʏȣڛɀثņƿýϔɑ‘֝ŜՉ܆ï°ǭ׷ʅĭΣΉƏسȝNjʱٷÅҧѼʯ࠺ɟ̧̌Ȅюм…ȊʅʠǛ֒à׼Ȉ˰ƲҎ̓Ơӏĩ؁®ͻęסܢӥńઉăȧ̊ȷê‡ǬĴ̶áͺȃȂŅϮѡÈɸӮĺ׶ʔ̸͘ʌɈрդƖ'], + 'encodeOffsets': [[ + -73043, + 12059 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'VNM', + 'properties': { 'name': 'Vietnam' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@૭ܗ۫ߍȁ׍٠ࢭ޺ળނԱԞګϪ།ŕ๓۫փ१եۇ۫਷ޱ̧ՠʀ֬دӌܬ͸ࢦÔσԚප٨ļ৖ț֖ƶࡀɃצٍאՋ݌ۥ঴৓Ԋʊ̠՞ɘ͙ܺਙPϕކӭڐҊȴڢIࠈĬܒ҄К̿ސƵƃӛАͿࡎɓ'], + 'encodeOffsets': [[ + 110644, + 22070 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'VUT', + 'properties': { 'name': 'Vanuatu' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@ˣō˭ςŒɤՆӗ'], + ['@@ƌڱɥŀǩ­ťɴi٢Дʵ'] + ], + 'encodeOffsets': [ + [[ + 171874, + -16861 + ]], + [[ + 171119, + -15292 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'PSE', + 'properties': { 'name': 'West Bank' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@ԣŭʙЃŕ˜ɜɌŚɁĦǬ̤֔ś'], + 'encodeOffsets': [[ + 36399, + 33172 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'YEM', + 'properties': { 'name': 'Yemen' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@؉ɥNjύo˹࠷Οഇϻݩףυ±ʥºӭΑ՗lj۷©ɃµǿɛəÕŻɇеlˍœ׉¨ɓӬzҠƍʜǑتʋΊǚ¤đϨĸNJ™ξςˌđΠɞЮΊɓɬúॺnƸċ߼č͐¨ɂ˫ϺƖ׼ࢦ޸Ϛᝒ͒ڀ൳˞ח'], + 'encodeOffsets': [[ + 54384, + 17051 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'ZAF', + 'properties': { 'name': 'South Africa' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': [ + '@@ǏŧΣяɻћӇ׻ोࢁףԋًϣ࢛͙ѓ«ŇɷԛŰеDž࣫NJԙĹΏ¬ࡿͩܓƃԱͅϡoΣ̚˳fαϒŸśŏɦLӰ˙֞˔ƴs٤ս޼х܈AF׽તДдͪɯƘΫϘÓՈǃҌÖݤіB᷌ɨűӾߙûԟȈ̏׼ĒрϒЊʨȶДЦȚΠķВɽۂ£՞ȜĐʾƨДҚäʨ͂˪֔ݮغஒؤ΂UОƛ˲Ķ҂ċД஁ɔׯƫऩî̟чƶʏÑāʓɯ̿T̃ԆҕӮĜǢώْQȿؑıۥɑϛֵщ', + '@@νʶϻǟҕ҃͡Տـ٧̜ČƺˎҴƀƜ˜ʴФ̅ʪ' + ], + 'encodeOffsets': [ + [ + 32278, + -29959 + ], + [ + 29674, + -29650 + ] + ] + } + }, + { + 'type': 'Feature', + 'id': 'ZMB', + 'properties': { 'name': 'Zambia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ІϏɊ܋ƝɩǙڻLjۡ˃̇ʭޭѶɓᢇۗĂׯٍřӍͯĹ̛̅ßܵۓҭխ˳o˗ĬऱĠƯÚOêͧȎկ¶ۋȑչԾ֣یžᦶშYí̂Ű̀ƧЀĪТėʺ̂q¶ʽϾrՖûˬϡڨŝԤˆȌѯ٠ş̴ΧΈҥ٠Që࣠ɱƳח͞ɧƬļࡈƬসȉψʈ՚ɤĶ଀ƚͦđΘɇͰƗՖƗӊʧ'], + 'encodeOffsets': [[ + 33546, + -9452 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'ZWE', + 'properties': { 'name': 'Zimbabwe' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ҁČ˱ĵНƜ΁VՙϞٯźʙՒC̒έĞ्ई˃ӢǛƮ͓ڤलğ˘ī˴pҮծܶ۔̜àĺ̆ӎͰَŚÆ̻۬hϴǯǺȻАÓѦˑF੟Ǐ׋—عƊʝħӵŵùɛ؅ࢫ॓'], + 'encodeOffsets': [[ + 31941, + -22785 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/xiang_gang_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [{ + 'type': 'Feature', + 'id': '8100', + 'properties': { + 'name': '香港', + 'cp': [ + 114.2784, + 22.3057 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@™@}ScTʟ@cWuJÁ–]„l¦RLj¼BĄà˜ ŽH@TOHCTDDDHDNAT@PEHDDNJLX@BABALHFF@DKHADBBLDHHFBLEJB@GDBBFBADDB@@KFAFBBJJA@BB@@FFDDADFF@FADDDBJC@AFBD@@DDD@DAA@D@DB@DHHBFJBBFEHDFAN@DGDC@DLCBDDCFDlAFBFCBEF@BC@GDAB@FD@DZJ‚X´HĐMja@Ý`p_PCZ@lLnRGSDMFK|a\\Y}­ƒ§™Mën'], + 'encodeOffsets': [[ + 117078, + 22678 + ]] + } + }], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/xin_jiang_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '6528', + 'properties': { + 'name': '巴音郭楞蒙古自治州', + 'cp': [ + 88.1653, + 39.6002 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@˜@ÈÒĊanwŎV„™Ȯ¦ͪŃĢ„ÜōȂçČéƐżLɆóĊ‚ĊaʊŁ±¯²Um»ˌmÈ»V™ʠţWÑůǓ郙ôƑƒğÆīŎī@Ƿ™wô™˺LÞ¯ƨVǪуšĢ™ȘV°wĢŽôk°¯ƒ»΀@Ȃ»ĸŽǔ@΀ƒ͔ôôLɆó̐ÝɜLɲōͪƒƨóŤK@ī@IU܃ÛmȻţǩÝ˹ÛljťǓǫō@Ɲ²¯VçōKͿŁΗÇţ»ƽ™ɅƑLÓŏÅÅɱV@ÝĊU¯ÑĊĭÞLšÞŎJ±̃XȣˌōlƒUÈ¯ŎKÆƅ°™XÑܱnŗġV¯™óaUƒƧUōŁ„Ñ™±„çɲ¥lĉkğ°ƒk¥˜ƒnğţL¯ÝÝUƽĬ΁lķ°@„ō„XÿݯV»ŹLʉÞɱŤĉó°ÝJ™¦ÝKÝ£ţܙÈĉ@ƒxǩUċƑ@ky͓¹™`U²ĉVġ»ğa¯¥ť@ĉ™‚ó@ŻÛÛJƒw¯nó¯ġWƽʩķÝɛwĉĕݼȭÞķō@ó£Å΀ƑŽ¯ôȯÞ¯Ȱ™ÆōèĉXǼó@ݚnºƒĸ„ÞVƜĸȚUʶõˀĵĖɱŎÝĖVࢰӒѢ°˘nϚVˌ™ÈmɼĵŦW¤öʊõʔ@°ÈXVŽ™ènŎȁb¯ǫĉ„±Èğ`ġwōÔğ»mVVŽ„Ý¥ó@™ĸķô@ššbX„ĶmV²²`Þ_˜˜ɴbͪÈ°„ÞWĸÈŌmބškɲŽÈUÆ»n¼ǬVķĸźô¯°n¦ɄǜÈ'], + 'encodeOffsets': [[ + 86986, + 44534 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6532', + 'properties': { + 'name': '和田地区', + 'cp': [ + 81.167, + 36.9855 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ƨ¥šèź٨ΘƑᩄbUࢯÞĕɲōĶĕöʿVʵķșUƛƒÝ„ķm¹Þ™ô@È»ĊWŎçšÅ°ȯȰÝ°óƒÆͿĉ»̽çnƒmɱĵƧºóU™™ƽ@±wóL¯°̻L±Æ¯Vƴķb¯VÇ¥ğ²Ǖbk¥ÇKlÅɱġ@у™óK@™ÇaÝXğţxĉČǫķê¯K@уaŹ„ƑKƒ¼¯Vóaónġw™óÞéU™ġbóĉğÇl¹™aUóğKW„Vůn›ÇŋƑ›ķnʇ»óxĉw™çÇ°Åw™°ċ„XŽ™„ób±ƒkÈÇJ—ƒm²ţx@ÒݎšŦǺn„ó¼n°ÇbUÒ±¼XĸĠłƽXmwĉºƒzÈÜmnxmx²ĖmҚbnŽƧêUºĊêÆVóĖóUĉ¼ÅĬƑ°ɆƆŻŚlłÞLš¼nĠƒ¼@ޙšÞź@ŎÞ°VšɄɴжϼِ͈Ŏ„'], + 'encodeOffsets': [[ + 81293, + 39764 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6522', + 'properties': { + 'name': '哈密地区', + 'cp': [ + 93.7793, + 42.9236 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@WnŐÆĶLĢ¦ţºź„lxÅĸƽŚ‚Ʉ—Į˜è@ô²ÞUĔƐńV°¯ĸX¦Ɛm̐bƒ»Ɇa΀šĢ™ƐLˤ™ȘÑnƒІljĸÿn¯ĶaŎ¯ĢĕȘ¯°΂œla¯¥™ǕǔwˤӱlťО̻nŻmɃĕċţUw°WUóƨÅţķ°ýV±óÅǓéʉ¯ƽŁƒéōǖȁÝƏůǕw˹ǫȗǓƧǕVý™é@ĬţLƧôͩ„ɱŎɛK̏ÞɅôóK@²@°ōؚ¼lŦ¯ŰóƜÛlV¼ķ¼ƒ°kȰ™Ű„ĠƒǬ™ŚÝŎmĖ`@ÇÜn„'], + 'encodeOffsets': [[ + 93387, + 44539 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6529', + 'properties': { + 'name': '阿克苏地区', + 'cp': [ + 82.9797, + 41.0229 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': [ + '@@VƚxˌŎÞŎƒ°n„ȂÒ°²VĊ¯VğƾˍǬƨÞÞKÈÞĊVźôɆÞĢèŌôWČ²ŤVÞĸʶbl‚¯ôn_VÆĸlmÞnVź_ĸ¼Ȯmǖ„šéĸW°°„ĸJ„kʠ¼Æw°¤ÈƒlxɆzČºĶI²ÆǔUš°ô@Þ¦‚ƒUnUĠ¼ŎÓĢxĠ_²ÇĊƒǬ°ŽȂamōšçUÇW@¯öʓõʉX£ĶťnɻšÇUˋmϙ¯˗ӑѡᩃaΗƒœɜ°xWƴUxɃÒˣ¤Ʌwğ„ʉōóÝŹ±°ȗ@¯„ƃ²¼', + '@@ō™гwȁ¥Ƨ°ŹÑķV™¼ÞêĊ»‚lĵšm¦ÅW@ĀôÈźaɜxÈbÞÆĶIОŘnIÇŃÛÝĊÑĠƏ' + ], + 'encodeOffsets': [ + [ + 80022, + 41294 + ], + [ + 83914, + 41474 + ] + ] + } + }, + { + 'type': 'Feature', + 'id': '6543', + 'properties': { + 'name': '阿勒泰地区', + 'cp': [ + 88.2971, + 47.0929 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ɲˣĊIÈ¥‚ÅU±Ċýkō°ƒĉƽó»ĶƽXóʵʵ™ȯƑÅȁɅ¯ĉ@ÇሗK֛@@ˤV֜ʵрƒǬVĸƑŎ@ƆϯÑóŽķ@ʇ»ķ¦έmlÈĸĊX¼WźÛÞÝѸ‚ĢČþ„ĀĊôάVö¼ĊUƨ°°èŎČUÜƐóôVôôŽ²êȘlˌç°`n²ǬŽĊaš™ƒÛ°±kğmm»š@°ÝɆÛÅÇVaݍVm͔ğôÝÈb‚„@„ƒ™n¯š™ÜUĢÑĊ@źīżWŤÈǖWôŁÆI²ÓƨL@ŽĊX„mmÑÆ»ȰÑkƒĶō@ý°m—¯'], + 'encodeOffsets': [[ + 92656, + 48460 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6531', + 'properties': { + 'name': '喀什地区', + 'cp': [ + 77.168, + 37.8534 + ], + 'childNum': 13 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': [ + '@@Č@°ƒĠ„ôÓô@Ŏĉ@Ƴĸ@Ť£ĢlVôWVóřXĉŤêÞ@ƐÒĢÑlèÈV@šĠIk°ÆŘ@ÈÈĀ@ǶťÒğ@š„@ÒĉlŻ_@šƧĖÅĬōÆ@bźÞnƒƒlVœÝĬšWƼʇ„ƒÝÅ@ÇÅÈwWóĉ±ğz‚ĬČƨƂÝIĉݯbÇÑĉƒ¯ʈV°xUŰĊ¤ƪ_ôÓɚI@lȚXȮ™ŎlɴȘ՘š„¦ɲÆʈ_ɴŽźŽôÞʊŎĠƒɆxˤ£ɄÑVwXƳ¯w›ɛŹ٧™çƧ¦ōƒُ͇еϻɃɳU™Ý¯@ōÝŹš™@݄»mğ™»ÝKkŁżřɅƅƒ¯ÆīĊ»ôVôĕÅUĉéV¹ƨém™anѱĕnwmwnÇۄyĉ¹ŹlŏkĵèķmōÞġKñÔċKÅèĉzƒŽ„ômxȗÿƿI@þÅČÝKÝ°@¼ÈVºš@ÅĢšÆUċłn„ÝÆǕČĵJm£ÝJ¦@ĊƒxV°ƏLċ¼ǩ™@™m@ÅĢómÇÆğ¹Çš™ÆšĖÞKšx„wô¦ÆÑÆL²ÆƾŽU„Ž±ŚÅŻĖ@ĬŤÈñ„@ǔÇx„Èǃ', + '@@VÇ™ţ°ğUĠ¯mk¯ó¥ķIġÿƏbƒ„ĉa±ÒĸĀlKU„_m»nwšŽ„m@ÈŤ¦ĉbÞ°±Þżł̦°ĢŁVé' + ], + 'encodeOffsets': [ + [ + 76624, + 39196 + ], + [ + 81507, + 40877 + ] + ] + } + }, + { + 'type': 'Feature', + 'id': '6542', + 'properties': { + 'name': '塔城地区', + 'cp': [ + 86.6272, + 45.8514 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': [ + '@@ήnĸ¥ʈ¼ĸ@ôϰÒ@ƅƒōUķƑǫʶпU֛܃LګK@΋ĸ@Æ£ÞġÅĠċšLV݄»™@Å»Ýnm¯š»nŻĊ@nķŃ@¯ómóÛÝǟ¯aÝóȭ¥ƒšōUmxĉbÇї@›bUº¯X¯ÆƧbVÒĉnǕw¯°ƑŽV„—ŽÇ@kx±Uƒšɱn™ŽÅKƒ„¯ƒĠǠU°ɜL@°ƒxnĬ‚ĀŋŎÇLƒŽğšϱÞέƜkôÅĀǕłƒĸĊŤUŰĢ°„¦ȂϰÜɨ°x@°żǠÆƈČVĠ»ČL°ÇšbĊÑ̐óÞlĶwބɆVÞwǬxǪţȼÜLŐĶˢ@', + '@@óKĵĀV͈ĉłƾNJÆŤƒzXl°ƒÆL²¼źŽôÈĢǔ™¦l„ô°ɜÞʊĠğŃm»ʵƳƑʝȗīV¥¯ĉ°Ñ@ŃÅI™»ĉmğn™ƒašƒċƨbš™Vğ—w›ġ¯@Uōa™ĉÝJğÑÆŎkŎÞĀlźƒ¦' + ], + 'encodeOffsets': [ + [ + 87593, + 48184 + ], + [ + 86884, + 45760 + ] + ] + } + }, + { + 'type': 'Feature', + 'id': '6523', + 'properties': { + 'name': '昌吉回族自治州', + 'cp': [ + 89.6814, + 44.4507 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@መL@È°ĊȂɆƒÆĊ£„ťôWÓɆbĢÅŎƒÆ¦ČÑW¥°ķU¯ƏŃVē±Ý@ó—ç˜ĭɃƾřÆķkwŹƒŤ¹ġ¥ĵKŏÅXmˍщwǓ¤Ƒ@wóōVķ£ɱšġôÛa±Òȁ„óèţIVŽƽ¼k¤ó¹ġJmx—»ÝUƒ²™@ÅƃĸǫŎ„ĊmŎǬ՘'], + ['@@Þô°bÞǠôÜôn@°ĸń˜Ƕkłƒ¼UޙKğȂÆÝĢŤķ@@ΌڬL܄K@ˣȂ˭lĉńW¥ĵVÆý@ŃÞēUŃȗƅ@ŹƩǕĉ»k»Ç™VğóřX™ŻKƏŽċêȁèÛŎġƒͩń'] + ], + 'encodeOffsets': [ + [[ + 90113, + 46080 + ]], + [[ + 87638, + 44579 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': '6530', + 'properties': { + 'name': '克孜勒苏柯尔克孜自治州', + 'cp': [ + 74.6301, + 39.5233 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ˎǫĠƽ°UUĉ¯±ȁÑmƒ„¯Ýōˋō™wUű»ÅƑ°ƒȘ@²¯ɳʇ`ɱŃ¥՗™ɳȗōkȭšșW@kəJóÔƩ`ĉ£Vů¯wU°ʇĊ„ÈÒ°aĊÞÞJŁċƧīĠyĊ²XôÇxÈÆÆ@„ÞʈƒÅ»™XÞīU›Ƒkm„ŹÝ@aŎÅÆīƨĕ@™ż`Ċk@љƒĠ@ŦÑ@ǵÇÿ@ÇÅŗl¯ğJ@™ÇUkçġÒƏÑÝ@ţéWĊôŚUŽóXUġkţ¤ķ@@ƴōĊó@óÔğƒ¯„ċ@@Қ¤kôˣŰ͓„k»ƒKX¯ċwƧôğɐšÒôIVƙš¯UķǬķšnŽ™¼ôb°ÒȰVVÈÞ°ƒĸó¤V¼°„V°²êƒlĢ҂Uƨ¦ôȰƴĊVV¼ǖIċĊ„ÞɜéšnČW˸Ǹša„řÈw±īšçĸ¤ĊšôšwšŽĸUĢ¦˜éǖĬ„Āô¼lÞkÒ°x°ƆÞx„šÆV²ǔ»„b°wގȘ¥°n„šŎV@°„„ʠè‚ŰȂb'], + 'encodeOffsets': [[ + 80269, + 42396 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6521', + 'properties': { + 'name': '吐鲁番地区', + 'cp': [ + 89.6375, + 42.4127 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ôK„ĉǪa²¼lÜô@ʠê°Ĭ™ôȂƒ²ÑÜbĢóɲ™ĸ¤ŎUô@xƒŽǔ£ъxˎmƒÈÛ@‚_nĕÞōšř„ǫƒğšůlȯ„¯ĸ»U»Ükôƛ°ůkť™»Ŏŗ@¯@±͓óͿ„Ǔ@ķȁ¼Ϳ@Ƒ¼¯°ólġ¯xȗUġšƑ™ǩÒƧUÝ°˹Kóššx@ǸōĬÅĬƑĠ󃄚ǔêÆ°XÒʟŤUšÇ¼ˋnn¼±V²°ȂUŌݜbʟǔɅô@żǬaҎÈ'], + 'encodeOffsets': [[ + 90248, + 44371 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6540', + 'properties': { + 'name': '伊犁哈萨克自治州', + 'cp': [ + 82.5513, + 43.5498 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@ĉ„ÆŘȁ̐mÞ¯ĀX°±¼@ƾ¯ƴ°ŎÝþŋ¦WÜÞbȂĉźUœÇmwVUȂóô@ȰÝ΀nÆJn™ƾ™ʠ™ŌLČóǪ¯œ¥ǔaǖšŌaôÝĢLšx„ƒÆLšɲm„™²VlwÈ@˜Uƒƒ°¯ǖxĊmUÑƨa°Å°WV¹œa›ÇɃÈm¥°¯ŹóĸķǫUm»Å¼ÇVɱ™l݃ŋnķÇÝX¯ƒͩÇɳa——Ý`±_U±ĵnWƒ™a@™ĸóšķ™¯ǓV±ÅĵJċ¹ɅykwDŽ¯£Åxʟ»ƒlķI¯ƒX¯ķ‚™êǕƒȭnķ»Ź`±„kÞ@Žš„Ýô@Þ°xšŤŎIƨÆUxōš¯²ǔĬǬlUŚ'], + ['@@ÞĀlźƒ¦¯ĸŤKޙšƒċƨbš™Vğ—w›ġ¯@ţƽJ'] + ], + 'encodeOffsets': [ + [[ + 82722, + 44337 + ]], + [[ + 86817, + 45456 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': '6527', + 'properties': { + 'name': '博尔塔拉蒙古自治州', + 'cp': [ + 81.8481, + 44.6979 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ήƛϲÝĠ™„ÈKŌōÿmī„w@¯ɛKV¯ğǟ°Ƒ™wġKóÞŋbǕ™Ǔb›¦ǩ°ċôŋKʟšƽšmšÅImŽͿŽȯÞó@ȁôUVnx›ÈŹVȁĊÝabŻ£¯°l„óxȂŤĸkĊšÞyĊêĊmĢxV„ƨÈŽĠX„ŽΘÆĠÔź‚Ɇţ°LXƾŤŤb'], + 'encodeOffsets': [[ + 84555, + 46311 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6501', + 'properties': { + 'name': '乌鲁木齐市', + 'cp': [ + 87.9236, + 43.5883 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@šŽWŽôŚUĠȚl¼Ċ¼ƪǖ@źȘƆ@ýlܚXVŘޙš¦V¼kĖó҃èkĊȁˮ֜@ǫ՗nōƒĉǬō„ķÆŚ@„±ÞV˜¼nwĢIôºl£ƾ»UŤJôçšó¯īʟéó@kÛ±»ǩbƒĊóLҍÇǫb@ŻɆóʠǓ›aŋÞȁVʉłĉbĉɅô'], + 'encodeOffsets': [[ + 88887, + 44146 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6502', + 'properties': { + 'name': '克拉玛依市', + 'cp': [ + 85.2869, + 45.5054 + ], + 'childNum': 2 + }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@ɜÞʊĊýVaŃm»ʵƳƑʝȗīV¥¯ĉ°Ñ@ŃÅI™»ĉmğn™ƒaݚţL°ķóKĵĀV͈ĉłƾNJÆŤƒzXl°ƒÆL²¼źŽôÈĢǔ™¦l„ô°'], + ['@@ƾIŤ@UUwōa™ĉÝJğÑÆŎkŎ'] + ], + 'encodeOffsets': [ + [[ + 87424, + 47245 + ]], + [[ + 86817, + 45456 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': '659002', + 'properties': { + 'name': '阿拉尔市', + 'cp': [ + 81.2769, + 40.6549 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nIÇŃÛÝĊÑĠƏō™гwȁ¥Ƨ°ŹÑķV™¼ÞêĊ»‚lĵšm¦ÅW@ĀôÈźaɜxÈbÞÆĶIОŘ'], + 'encodeOffsets': [[ + 83824, + 41929 + ]] + } + }, + { + 'type': 'Feature', + 'id': '659003', + 'properties': { + 'name': '图木舒克市', + 'cp': [ + 79.1345, + 39.8749 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VéVÇ™ţ°ğUĠ¯mk¯ó¥ķIġÿƏbƒ„ĉa±ÒĸĀlKU„_m»nwšŽ„m@ÈŤ¦ĉbÞ°±Þżł̦°ĢŁ'], + 'encodeOffsets': [[ + 81496, + 40962 + ]] + } + }, + { + 'type': 'Feature', + 'id': '659004', + 'properties': { + 'name': '五家渠市', + 'cp': [ + 87.5391, + 44.3024 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„çôÑlĕU»™¥ÝšUŗ™WkÛ@þVńÝĔ@ńÅþĶUX¦Æƒ'], + 'encodeOffsets': [[ + 89674, + 45636 + ]] + } + }, + { + 'type': 'Feature', + 'id': '659001', + 'properties': { + 'name': '石河子市', + 'cp': [ + 86.0229, + 44.2914 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lŁ—ǵm‚ĉ@mż™¼n°ÞmƼš@'], + 'encodeOffsets': [[ + 88178, + 45529 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/xi_zang_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '5424', + 'properties': { + 'name': '那曲地区', + 'cp': [ + 88.1982, + 33.3215 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ƨʔĸbܺÞwnxźbÞ°ô@„ĶŽĸIȼĊJŎÈôUšÝƒ¤ǔLސŎ@ĢŽȘblƒôL„ÇźçȤôLš¥ÞIÞ¯Ķxʊťƨ™ƿÑĉXVķŦ¯ȂKÇǕšÑ¯IUš£¯Óƿ£VĕōÞÿÆwƒƑ„£ǖxÞĕ±ÇÝaUÑȃU¯‚UōÈ݃wWŁĵ™±Ý„óĢÿ°IÞ±mÅĢ¯mÿ„¥°UnÑŤĢĕĶwǬŻͪwŎ¼źÇĢ„ĠĕˎŁ°óƨ¼Èa‚m@¥°wǔ„ǖ°ŽƨÇŤœšġƨ„ŎŃôbÈÛŎĊ°@Ġw²ÑÞJƃÆb²ƒ°êĊUނlȲƒV„ÈKĊÒĸĉ›»ÅôťUÅǃk¯@ǂÑklǁÅl™Ģ™VÑóƒ@°@„ÛĸƒV¯ƒÇĊ™n¯Uĕšƽ¯m›¯b™È@Ò°Ĭƒbĵ›¼„‚kxķýÇJk£ÝaUÑÅóĶǟkÓʉnĉƒÝ¼Ƒ„ó»Þmn£m™Č¯@ƒȮÿV¯ĸƒ™k@Ýówƒ»ğ„ġ±ǓLō„ƒšV¼Əèķĉ™è±b@Òţ„UÑóakƒl£™Ó@¯L@™ÇlUóȁš¯aġÈÅĕÝLķ¯Ė¯@WĬ—x‚ÒÈnW°ţôU²ǓÓġ²V°¯ôƒǔÝL—ċšk™š»Ý»Ýš¯ÞƒVƒwۄÝÇōͩÈĉċ»ĉm¯£W¥ţKkóġƏW@¯±kōŽÈ›b@җšÇaƒÆ¯a™„ƒkóŽÛƒÇ¦Ýa¯šÝ™ĉ@ǻۄmƒǓxķƛ¯lVĀÅÞġb™™ÇJUÅV™ĖƑW™zō»ōšƒW™n@è¯ÞóVkwƩnkźÇބҙޯƒƒýğÇUxÆÈnè±bĉÝ»ÈуwšwÞ@m»ÈV@ýÇ°ķ™xƒa„ݯXċ¥ƒÈóW@ôkxlnxVÈóĊkŤġ¼@°¯ŰƑL̻۱ŎÝV—Þ›VƒÇÞŎÇakƞ‚š@èğŎĸżšƾ°ÒšLÞôĠKȰĖźVÈÒĠ„¤™VôšŽU„ÈþťL@ôǬÞlÜÈnÇÒUŚ™@šĊƨW°™°Xƒ‚@ČÇþ„ƴĉÒķ¦@ŽĢôWĀôłUÞĢǬ™ź°¼š@ƒôV°„bUÆnzm¤ƽĸƒÈ'], + 'encodeOffsets': [[ + 88133, + 36721 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5425', + 'properties': { + 'name': '阿里地区', + 'cp': [ + 82.3645, + 32.7667 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„Çƾķn£myVŃaU¯„ó™@¯»šŹġǫVÝóŁXÿġó@ĸ¥ĊуƳÈý@ċ„Wš¯X¯ĉƧ‚™š@VřÈÑÇmkÛǫÝ@óŦKÇýVƒ™U󚏃£ğÇÑŹUȯĕğLÝó™K¯Ñ™ƽķŻĠō@灙lƝÈbƍÈ݂„œU˜ÝÞU²ō̼ůƒK°ů@¯UK±—ĊƧbōÇmçÈġƒóšÅób™™źóš¥kīƯól™ç™KôĵUƒÅ„VŃķ¥nÅŏm¯¹Å‚™»@ÑǍóxÝkʇȤU¤ķb@ƒ¯ĊÇx¯ĸĉKm°šĀk¦l„„KnĬȀƾÛ¦WÆŐmNJĉ°ōUţ¤UšŎ°šŎKÞłÆ„Ǔ¦ƒÞ™‚™„ř¯bmUÝl¯Um™ğl¯£șwŎǫaÝnĉĶƒk@¯™K™šō»ĉn™aÞ»ťnkml™ĸ¥UŚŻkÑťƒĉV™ôó°LôīĠU„ÿĉǕÅz±Kƒ¤„²ō¤¯Ė¯UÝ¥Vĵ™óÈťÝwķșÑk¤ó„™ƒWýĵĕ™„VĠƒV󍃎Ǔ„ķ°k±VU±ţ¦UǟÝřJVљ¥XUċUŎlÛƆǕÆȗƆ¯wŏÞÅ@™šĉl݁óŽƒÒ™nUôńlxólÝôێ±™™LÛôÝL@‚ġ¯X¯ÇUżóa󤛼XÒġŎóLk¦‚ôżĸĠ™¼™KġƆô¦„ÆƑÔĉĶ¯ImÒ°¦n°¯Þl˜ÝČn„ƒÒšKĠޚĕkƒlýƾťœšôI‚ĖŤÒnƜm¼¯lnżóÞ@Ůó¦™ôƽĖċŚn°Ý°ôÈUƜƒblÞóŽ@Žǖô°UÈƆ°X„þôŽô‚lѢšŽ²Ėm¦°š@¤™XŽĊblܚzkºƒĖmX„šŎWVšóÞn°lĠxȚa°»żLźƒ„b@Æ°XĠÝȚxĊĕŤaȚ‚°È@„„@èŤ¦Ü¼œW˜ÞkŽÈ@V°lŤkŎ±²¦ƐUšlj°aÈÑŎbĢƒŎbÆ¥ÞIȘlššôVÈU‚™šb„kɲĶn„mnXb̼òƾĖŎ@ĢȂÑôÓĠĖʊšĊÔ'], + 'encodeOffsets': [[ + 88133, + 36721 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5423', + 'properties': { + 'name': '日喀则地区', + 'cp': [ + 86.2427, + 29.5093 + ], + 'childNum': 18 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ĶĖXþš„ôƒl£šÒĸÇÞxÇŦšôUĶÞ¦°V°ĕŎ£ƒ±„£²LÆyĊǖƒĀğVóĬ¯KóôUš‚ĊŦ„lҙżVÆķ¦kšlnŦmݼšbĊmŎ¼š™šL@°„lĊĵÞmǬbƍȚx°¤Ġknš°VÞkVn°aƒŚš‚š„Ýǔ¥ÅƒÝŁōL¯™ōV™Ť£ŎVĊ¯nljƏXÅÜ¥ǿƽmīƒLkƒl¥™ÿn¯ĊL°ķÈw°ĉ@ƑĸaV£ʈȣÞlôwȎ@Қ¼Æ°ºŐnmÆĸ¦UńƃV„óĶšLšèôkÅ°lĬ™¦Źôššôa™Æ„ôÇĢnèŎÈƨa˜ĉ²‚VLĢ»lţôĉUǂwkmlw@óôX„ÇȦ°WƒÞ„b‚wĸšÈ¯@þÇUn¼Ý@™x„xÇńÞ¼ĊŽ²amçÅÇVwĠȄþ°„šÝƒÑÈÝlŹƪmlxôU°Ý@çšm„XŎ™Ŏ¼šyƒXšĕÆUVÈIššĢaÆÝUÿ°kĸƜǔwn„܃ȼĊ@ޚ°™Þbȥ܄ô„lšƒ°b„ÅÈb˜™@ќa‚ǯUU¯Vġš»ƒ™¯aV¯Ç°Å™mnÑŤçǬVǬ™±ĉ¯¥Vĕ¯Ýk£˜ō—w@±ġÛ°ÇVїƒ@ۘa@ČL™Ƴ™„ƒÇa¯¤ÝIĵ¼U¥ƿōķÅţŻókÝóĕ‚¥¯™U»Æ£X¯ġŃÛkÝ°V°ó¼¯èWôÞĖ„ȎƒŽkĀƧĀówm¥¯JŹÝJݙōVVŁaݐƑ@ƒ˜ğŭǂ¯_ƒ˜ĵ—›VnxŃón›ƒĵxÇĖĉVÝÈğV™Ò󃯐±Żĉ£ķÆÅL™Ljĉý˜ţۃ¯VƒnV¤ÝÈ@°ÅÞݤ™ŰğŁm¦ÝxóKƒ¥ɱÈUĠôêVôÛ¼ÇWÝçĵaō¦óĖƧlÇĢƑŽnŎDŽV¼¼‚ºÛ@m¦ƽ„ĉmm¯ÝKÛç¯bŏłĬ™bƒ¼ÅLmŽ„xť°ÅU™šÝXkŽÝmĉ¦W„¯K„ÒknÝaV„Ýè¯KɅńÝKnÞ¯¼'], + 'encodeOffsets': [[ + 84117, + 30927 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5426', + 'properties': { + 'name': '林芝地区', + 'cp': [ + 95.4602, + 29.1138 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@‚VÈłVôÈk@š°K@ŽšÔk¤l„ôbVÒŤƒ@ѲašçĸĊƐçU»„™ŎƒǔKĢ²Ġƒ„¼ôx@ޚlƨĬ„Ul¯ÈLV‚šÞJ„°Ünʊ„wÜbXê‚VÞ¯°ššanaU°wƼɴÑWÑ°mÈýÈam¥Þ£Ť@„¥ôblÞĢ„ź¥ôxÈÅmݚ™ƒĕŃV»ĉōŤōnóƒ»ÈīķIUƒĠÑ°ġĸLÞ¯VÒƂ@Ābš¼WôÈ@V¼ôóŤKÈÑU»šwVǫżnWÒÈx™¼‚lŦ£ĊōŤx²¯@ƒÆƒU¯šçÆ@„¤°£„é°k°lšůÈó@¯ŤÇÈĉƒkkÿó¥ÝXķљÜ@ÒóŚÝ¯°ĉówÇ±¦ÅJUÒĉĀķw¯°mĖ¯„±akxÝÅnƒ™»lуK@¯lU™¯UVѯóĊ¯mōğVǓƅƒÞƒWÝÈÛ@ƿô¯ÜġzÅþ¯ólmôʇġĊÅUͿřŏȁˋŁóÇˡōƧƒÇb™w°Ķôk¦šÒƒnUþġҙÔkǔķèó@ƒ²@ŘōńĵyƒzġaݤÅIƒ¤Ƀť¦ğѯ¤ķbóš¯ó±ŽU²°¤ČÜVnÈƂ„ŚŎ°ôĢ„þÆzèVĀǎĀǘƒXŹÑ¯¤ówċķk¦šłUÒġzÇ@ƒ™ÆÝx@²Þ@Ƥ„Uô¦Uš°x„U'], + 'encodeOffsets': [[ + 94737, + 30809 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5421', + 'properties': { + 'name': '昌都地区', + 'cp': [ + 97.0203, + 30.7068 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@™ŽVĖm°ĉš„ÈU°ķ„ƒÜ¯@@ô„UÒġškš‚ÆkÈlŽÒ@Èl°È„VÆóŦƂœ¼‚a„ÅĢ™Ʉwnōw@¥Ŏ¦°ŹÞmVš°wnÿƒw„wÝw@¯šmÞŗ°wĠ˜ĸkÞğlĔ²¦°@„ĕĸwVóšal@nĢÇĊn°@¦šŽźUXçǔůĸVš™ÆK„ÈÝĠš²ÅĔô@lšŽÈ_m˜„zǖl„šaU¼ôwV°¯¦‚ĬÈa„l@Čǎ„¼™„nŽ˜I„xô»ɜ@ƨ¥ɆŁ„ŃǪȁkƛƨȍʊȡóĭ›@—ÈÇVƒůރĸƅmēƨť™ÅÈʉVǵ°ġVŭÅɧ°ÿnɛš£mƒķ²ŃóÑUĉ°mÇ»¯@mxUĀ¯èţ°ȁÝç„ġU¯ÆÇţÈ@°Çô™Ű¯k¯lƒê¯¤ƒ£Å@™èV°Å„@„±°ţwĉŎť¤kš»ÇwXÑŻmUǬ™xV¼ÇÒţLóôU»Ç@X󙻂a@ÿŁUÑÝ°ķK¯ĢğÒV„ĸJÇĬ„¼môţŎĊŎU¼Æ„„Ė™šnÞÇÆówŹ¦ġƒkÝóaƒ¦ţ@ݤn¦ÇbÇþ¯nXÒɳÒÅ»¯xVmb™b¯™Ý°UWéÛaƒxʉÛmƒ¯ÝI™‚UÇKk°ƒVƧīķ„U°ȭĀ@„ċ°nšm¤Ýnô¼ƒƒÞ»Ċ„ʊmlÔĵǠÆôVÒÞbl¤ÈIĸþlwƒœ»ĶŽ„a¯ī@њǰanœƾ°'], + 'encodeOffsets': [[ + 97302, + 31917 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5422', + 'properties': { + 'name': '山南地区', + 'cp': [ + 92.2083, + 28.3392 + ], + 'childNum': 12 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@°ÞUĖ°¦²ĊôÇÜLǖĀɜŽȘŰÞLĸźêÞ@UÜUŤ°ɞ¯Ü„°WŦĀmŎ„¦ĢyVљŁl¥Čĸôx°£źÒ„Wȗ‚ÿȍUÿ‚çÅyƒýóġō¯ƒřŁmÇÛUċŽ¯£V±²°ôô™ĸa°£ĠÒŦ¥ɄŽ„£ÆJÞ£Ģb„yĶzŎŃ@ŗ„±ô@ĸçlǓšÓĢÑVý„m™Ñl¥ĵó‚¯̻̥™ƛǫÝһÇƧĉyţ¼ҍēVĶĉŎ°ĸmšÞVÝĸ™ÒÛaċ„ó™ŹĖƒèÈÈl¼k¤ÝX@`ސŏ¼Æō¼ÇçĉKUÝÝ£ğ¤@¦ġl¯Òġĉ¯óš™móxÝÞğVšƴċK@—b@ܘ„UÒ¯ÈĢÜ@²˜x—Ŏl¤'], + 'encodeOffsets': [[ + 92363, + 29672 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5401', + 'properties': { + 'name': '拉萨市', + 'cp': [ + 91.1865, + 30.1465 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Ŏ²l@°‚XĢƐlôŤLX¦°¤ĊnČ¼ÇĊŎͪÞÈ܃„x„U°Ýޙ޼™¼lšČ™˜ŽÞK„Ǔ°óU¯Ģ±ǔÔV±ŤóX¯ÇmÑ˜wXī°@°ĕĸÞKÆĖĢÇ°bȂ™ÇŁUƒV¯wV™ó¥ƒVÅ£Ý@@±ÞwšÅ‚„È@ƒ¥nōťÿ¯Xۃɝ°ţ¯ÛVVÝ@ŹéķÝKȗůɛǕÿÛKóÈǫšǫUţèmҚn¯Æ°ÈU‚°b„š™¼UĢV°°V'], + 'encodeOffsets': [[ + 92059, + 30696 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/yun_nan_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '5308', + 'properties': { + 'name': '普洱市', + 'cp': [ + 100.7446, + 23.4229 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@U‚ô²‚a@Ž²²Ķ¥œV°šĶ²bl¤kVxl‚@œ°‚Ś²@˜„„y„@ô¦¯„@xƒxVxU„VššbVšÜm¼Ŏ„„ĢmºXXWÆ@ĀœšmŽmXU°ÅÒm¼Þx°w„@°‚XêĠ°»nV°U„l@k„@V±ôī@£‚ƒČŃÆ£„KÞý@¥‚k@y„a@—nWV„UVƒšwƒmƒ£Jƒknm@wmkn‚X„˜šX„¥mUUlUnbš¯°ŽnkƒVInlIUw°n™mk@@mlanXlanmšk@wVWUw™_@éĠašnmUaÜ£ƒmXƒ¥¯@@„óUmݯ¯ÞÝlKnxô£š»„»Ġ„J°aV„UÝÿV¥ÛbƒI@wmŽón¯yÛL@ƒWkŎmș`IWa¯K@¯mUnmaXm™bmak„¯ŽƒĢ™ÒÝm¯mV¯KÇb¯KۜWW™X@a™V™knċLUWV™kXóW@k™a@ƒób¯Uƒwmb¥UUlaU¥U£maķšƒKXkƒmÝ@kwmѯk±ċbUUVakaġ¦ƒƒkL@`ƒœ™a¯xƒm™Åƒ™LUWƒ@ċnŎUV°LkL@b°°@¤š²ƒ‚šnôôk„l°kè›ÒÈzV¤È„WôôƒnV@„ƒ¦@¼Ux'], + 'encodeOffsets': [[ + 101903, + 23637 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5325', + 'properties': { + 'name': '红河哈尼族彝族自治州', + 'cp': [ + 103.0408, + 23.6041 + ], + 'childNum': 13 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@°°nÞôV@ƒ°@„¦WŽ„nÛ¤Vbmn™ğb@êš`VxUX@xš„ƏÞUnn˜WÞĸĢƒšÈ@ŽÇè@zÛÜWšÅêlš²„˜KnV¯ĖĊx@bk@@„°JÆ£Èbl„nnm°nlUkVUUwVm„Kn„‚nVŽÞxVLX¥laX@@xl@VzȎVmšk@b°šÈĸmŽV¦`W„XšƒbUb‚bX¼°x@ašVVkn@lþnXUlVxŤÅ„y‚IUƒka‚IŎĊ@lXx@b„z@‚ô„ƒ¥„_V@l‚n@„ôy@al_l`nmƒÈ»@kƒmXwWK™U¯»™a™Å@wƒmUÝKUa™UUƒ™wWƒ@w²»@kƃV£—mm£VKkÑV@@»nwƒ¥™ƒ@kƙnllIVlnLVakalknJšWmnaUaVÑVVލn¥m@ƒ„¯Uÿl™@™™™VçƒaXaV¯UyVLVkš@nJlšXLlŽkxlbla²Òl@nVJVkšx„KlkUaVķÝÑU@Åm¯@±™Uó°ğńķĠmU™Ñ@ǯ¯Å¼@nml@°¯¯`@w™£@¯Çƒk@ƒ»nmċ¯U»™I™Ž¯LÇĶÛn@bó°™U›šwmŽ¯„™Umǯa„™ƒ™ƒI@ykIƒVUŽ¯bƒIğŽƒ¼™¼ó¤mwkLÝÞ'], + 'encodeOffsets': [[ + 104243, + 23429 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5326', + 'properties': { + 'name': '文山壮族苗族自治州', + 'cp': [ + 104.8865, + 23.5712 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@šwô„š@²¯maUmôUÆxš@Xš˜bÞInlVUVw„JVaU„K°¥„xmÞXnlKlnna°@ĊČ„ÆwUmnkl@°ƒƒ£nyn@VV@Vak™ƒ@@kÞ݄bmx°Vnw°klÞInĖÞVlKl™@Xa°„„KlV„U@šJnx‚U@ÈĢbUKlm@ak_‚wšanWUk°ƒl»„k@Wk@lwU_ƒ@UalóU¥ƒÇnƒ™kJWƒ@mVXx±bƒK@nV±a@™Åa™£ÝK²ƒWknamKknǏk¯ƒaV™™V¯ĀƒU™„™Ò¥ƒI@mm¯¯xōW@@`k@ó»ƒUU¯lm£ÅWlĵ„w@mmwÅmWU@y±U—xmwU„¯Uƒ¥Ý¥¯£m@kŽÇVUV°VbklƒL™wUlUIm‚k@±ÑkbkalwkWKk™mI™@UlUKVzU°Wb„bU蚚@škšVĀƒ°@„n‚m¦ÝŽUUUÒVbmbXn™‚mIkllbUbmKUkkJmkŚ@lš„„¦mx@¼U@lÒULn¤˜nU¤Å„@l±¼@xX„šxV„šVVbÞLVŽ„n@xšÆšb°¼šV'], + 'encodeOffsets': [[ + 106504, + 25037 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5303', + 'properties': { + 'name': '曲靖市', + 'cp': [ + 103.9417, + 25.7025 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ȦlKÞĕUV¯Um¯„ÇVUnVVUƒĉn™ĊÇƾLn°°È„JÆw„@lbÞa„¦V„XJ°¯W¯„aÞJVkUša„ƒ@lKnÅmWUk¯a¯»@m±@уkkbWWX_WÓU»_l™kÑm@U»m@l@IWċn¯l@VanV„UV™UVwVx„KȄVmUē‚@„ƒn@VÝÆL„w„VVwnVlmkUVÑÇ°ka@k™ÿÝaÞUl£™›—ċĕX±±ĉƒa@UnVnalónk@wl™UVmkÝJ—aW™™@ÅwóVVnnb±°™@óƒ™xXLWx„n@lǼn„m‚k_k`@bózƒ‚m@kU@ƒ`„¦óƒ@nWš@ÜÅXWw@ƒyƒb¦@ÒlnUb@x™lܐk‚@²Ç@Uƒ¯bmy@kV@bƒb„¦U`lLVx@b—Ll¼Þ¤@„°VVބU@WސUb›J@nnš@lnnm„šxUŽƒUUbƒK@šÇwklkUƒVWakn@ŽlbU@@„ULVxkKUn‚°¯Ò@¼™„kmƒ¦m@kl™Ȱ@lU„l¦„@Vl°wšnnþĊUÆbUx™b„ŽV„šĖU°„a‚nnašV„al@@b'], + 'encodeOffsets': [[ + 106099, + 27653 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5323', + 'properties': { + 'name': '楚雄彝族自治州', + 'cp': [ + 101.6016, + 25.3619 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@mҁXU`Wnšš™@Xl±¦š„Uxnbl°knmKUx„„ƒxVôUx°¼ôÒȄ°JlnÞKĠœW°¦ƒ„Vx²JVwš_°¥@UV@@wnymknK¯I@‚™²b°ƒš£V¥šwU‚V„¤nLškÆJÈwôô°„l»Č¯ƒġVƒUU@@ƒ°ƒƒÝXl@U»°Å„@U„¯@w±¯VmUUlm@m™„ÑnIVyUwmak£Vwm±—@Çw@nƒ@UxkwlÇnL‚mkř@±Žk™ka@kóJV¯Ç»U£lw¯™Xalbl¥¯UXƒ@a˜™UaÈL@ÇVIVƒkaU¯mm™akLWkUJ¯Umxnšƒ@ƒkUx¯xƒ„mWÅīÝkkbƒŤƒbkxWmXwWk¯wƒKkƒƒLŤċń„@¤óĬU²ƒ@@lƒk¯VmU¯¼@xV@k°l°kbUš°nm‚VnUš@°„š„UVèރÆbUÒÞnU¦›V—¼lô„@Vl'], + 'encodeOffsets': [[ + 103433, + 26196 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5329', + 'properties': { + 'name': '大理白族自治州', + 'cp': [ + 99.9536, + 25.6805 + ], + 'childNum': 12 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lbœKVIUa˜@²m@b™xôÒÜxXLmbnšl@š„„K°šš¼k„Uô‚xôlV¦nJ„Uš™Ænšm„@šx„ÆwšbXšÆôô„LUVwôK@wlmšaVwœ@WknmƒIUmlnJla@_™@kÝmKUašÑm¯Xw°aUaVl»²JV„bÆJkôĶĀ²VVk„mšbVwUó„wƒƒVwnLlmk¯maVw™ƒ²¥Wkš@™™XmV_‚WnÑUkƒ@k󘻜UV¥ÝmVÑÅa݄UçƒVƒ™@¯V™Umn¯mV™lak¯l¯U@@wğŽW鯁ƒ@¯xÝw¯š¯Jċa¯U¥mLU¤„bÞȤƒbÇLWUwmIUVW¼kbš`U„Vb¯L±ĊÛkƒÿÝKkwƒKţê™UĉþƒÈƒV¯ÞVbUŽ°KVšk²Ý‚mI—ƒmV@kƒm™UkšVxm„¯KXÈķJU¦V°ULWxšL@môƒšb@bkx±LnVUŽVLnkÜWnwlLŃmW@kkJU_ƒV„šWĊ„Þ'], + 'encodeOffsets': [[ + 101408, + 26770 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5309', + 'properties': { + 'name': '临沧市', + 'cp': [ + 99.613, + 24.0546 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@‚xĢ„l`²X°ŽV„šx@x°Þ°KXašğUњW‚bnIl`X²°b„xl°„„šV@xVxk¦mb„l@xšXV‚ÆzX¤™Æ˜k°„kx@lźêlaX»VUnJVx‚XÈK„aÝȣƒaV£nKV¦°‚Čb°I°™n»ÆÑV¯nWn›™@ÿXÅWWn¹ƒġōƒn»‚ÛU™™aU™VƒUw„w@w°ƒó¥ƒ@ƒz—ƒ±@ř›¯@kUwlk£±aĵŽ¯™›Uĵ¦±±@bó±VÝ@ó¤ƒw¯I@mńóm±XŽ¯IólƒK@š°Ullb™zkKlln@@ԙºƒUmVk²ôҙx™ŎUVóLƒb„ŽmÈnŽmbnl‚a„x@z„@Ǝ„¦kš'], + 'encodeOffsets': [[ + 101251, + 24734 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5334', + 'properties': { + 'name': '迪庆藏族自治州', + 'cp': [ + 99.4592, + 27.9327 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@W™Xwƒ™@akk@y›—k°īX¥›Uóķ¯w@n»UaVaUۃ¯ƒmV¼k‚™Þċô@n¯xÛÒm„V‚¯Ô@xƒ‚@šk™wm™Åa@ƒUa‚݁¯VŃyV„a@ÿšn»ÝVmank™mmÞÅôƒ@n£±›ğzÇmU¦™Vm„nÜmbn@°nV@xmzÅ@mºV¦k°ln¤š¼õô„n@xkƃIUxUš@Ťƒ¦VšmVkmkXW¤XzVx@ƚx™¼ƒÞ¯b@lVš™ĸގV„m¼XŽm¦V„ŽÞ@Ǝš¹Vón¥ÆKn„‚KX¯x@èĊȱłXšaÆxnlV@UÛlȻkğV¥„m²ljmÅÞĕƒƛm°„ÆmX¤mznƃŽV¦ÞVVb°bnÞWbnŽ°l@V„È@„‚VĵĊ±@ó„InxÆw„¥@£Þ›W¯ĸ£UƒUK‚ƒk±akkkbmWmÈķ„aÆÇU—ȃÆW@wmknmU¯'], + 'encodeOffsets': [[ + 102702, + 28401 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5306', + 'properties': { + 'name': '昭通市', + 'cp': [ + 104.0955, + 27.6031 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@mƒnK@wmƒUř¥mšóXǓŏmX@Ž—VƒmL@xţ™nk@mlUšŻÒğŋ@ƒL@mmLkm™š@b™XŎW¼ka¯lÇŹ¯aÇ»™ÝÝ_@m„@@a™@UklwUm@ak@ƒb™UmbmƒbV¯™ĕUƒƒšaVwÅaĉVmý™m¯xUkƒ@k¥VƒUXƒ¤VÈm`@„—ńÇÜ@Ākn‚ĔkƞÆĠ„™Þš‚U„VôƆÞI@ŽUxƦn„l@ĊĊnxUÒ°¦Vb¯WUnWŽIml@xn„Ubô¤‚¼ÈxlI„»šKVš„@ÈԂJkšUĖ±ÆVb@nœ„VÜVUVƒšL„wĠl„kn„Ġ@nx°¥Æ„²mUwƒ@m™mÅUl¯UњÑUm„Lll„Il±š@VkwƒW@w°@U»™kUóI°ƒ„»ĢтL„™š`nUĠ²lm„bôV@n„JUxƦX¦l@š‚ŎUƒV„@lV„KVřV£UaÞU™ƒnW@¯VU@ó™'], + 'encodeOffsets': [[ + 107787, + 28244 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5301', + 'properties': { + 'name': '昆明市', + 'cp': [ + 102.9199, + 25.4663 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@n@Vk‚VUn²°@xƒ°Vƒ@¯ÆV¼k@WŽ„Þ¯„@„@‚VVU„„Ģċ°k¼V„Ċxœ¤Ōœx°mVkƒÑȏšL‚°„x°Xœ°VmĊLVxUĖ°bX¦VW@kšȯlkn@„¥lnšƒ@»°Ñ¯VmlLUwVK@ƒV@ka@lmXb„UlVlkÈx@™„LVa„VV™wnƒmm@km™@mœIVaݏ@XƒVUݯU@ƒÝ£k»˜K@aUwkKV_ƒ¥„a@alU@nz°aV„È@@±lÛšk@wVakm@т¥„a„z‚@XxÆW@ÛX™@m@ƒy@aWw@kōĉJlbV„JƒzţÆUwVkmWkým@Ul™U@b¯wVºƒU™VUêšĠƒXUaUbVĊUŽWXUmkK™™WnUUU™V™ƒƒVV™Ý@kk±‚™¯ƒƒLkƒš±WkXlVklƒ@ƒwXbmLƒ›VUIVmk@Ubma@kkaVKUƒ™kmlXLWn™J¯ÒĊ°@zkºlLUŤn@@n›ô@lƁnmKkÈlxVw„@@mÈx˜@n²Uxl¤nbVxUzmJƒÒnš'], + 'encodeOffsets': [[ + 104828, + 25999 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5307', + 'properties': { + 'name': '丽江市', + 'cp': [ + 100.448, + 26.955 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@l@™„@w°ÓUnƒÜÑ°w@mČóšÝlU»n°„„VÜUbVbm¼@Ž°xôĸœVW¦¯Ĭlœ˜@zll@b„šWxXš‚a„X@ÆĠÆaXwl@XaƦn¼˜Jn@mnKW¯È»V¯°ak™VanXVwl@VyUĕVU„bÈīlaUk°ƒk¯lƒ²V˜Ukƛô@ƒ„I@mVwĊa„™ƒVaka„™ÆbUŽVLšaXIWKUw™ƒ„aWÑÅKUaVk°ƒ@Uw„ƒ¯¥›XğÝLkm¯Iǃóѯ»™aƒnUl±UĵÿlóÅIƒaU‚±Ik¼UŽVb¯bWxn°™ÒVbnLlޚ@@`kbmIkŽVn„JmnXl›@Ux™bkn@xóLUxVŽƒKóóŐW™™aÅxƒŽ™wƒ@™nÅm™šƒV™„ƒôX„ƒLlVU¤ƒb¦m¼™Ž@ĀƒbU‚„zUƂ°ÞVb@„Æbnššx'], + 'encodeOffsets': [[ + 101937, + 28227 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5328', + 'properties': { + 'name': '西双版纳傣族自治州', + 'cp': [ + 100.8984, + 21.8628 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@l²°ŽnÒlxÞ@„nWl„Lĸ™nbV¤V¦kbVV‚¦na„x°Vôa@„šb@lôXlWUšVXČKlmššU@bšWXXܛ°LÈa°LnU°‚ÞnšÑ„ġ°lƒnbšaƒ¯¯KWƒœó@kmK@UšĉV@k°„VV¹„a@y‚_ċl_nÓlL@anI@ƒóWl£VU—ƒl™kĕl™šKVw„U@™kVƒam¯ÅL@bƒ‚Ýk@Vn„UbÇbÝwÅ@ċ¥¯lk‚¼ÅŽ™Ò°b@¦nlUn@ŽÇV„mƁbWôU@ÝÅōm™¯ƒaU™™mk™WWw—@±ƒ™n¯U™è™a™Lƒ¯mƒL™škwƒl@°mnÈÒ¯šów@V™xƒĀU¤°Įƒ°Xl'], + 'encodeOffsets': [[ + 102376, + 22579 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5305', + 'properties': { + 'name': '保山市', + 'cp': [ + 99.0637, + 24.9884 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@X°„Il‚@¦ƒŽÈ¼m¼ÞaÞÅl„ÈxV¼šlVôÈÆlLޣȺlkUƒ‚ƒUw„¯UĕVwĊ@n¦mlnVĸIWÇ°LnƒUwl™šV„n@lnU˜„nJށl±U™¯LVUa°Ý„U„ÇĊýšVŤé„LlxÞL„ĀÜl²ĉ°KUaVƒ™_Źé@klw¯ƒlÅ—šW£ÅyU™W@wƒknal¥Uw@w™Uƒƒk¯ƒw¯aW±k_mJa™XVҙĠWb¯L¯Ý@w™wUƒ¯±Wk_ġƒwƒwōKmb@¤„bk°lĖƒô„UJƒšVnÅlťUš¯°VbnbWxX„m„ÞššWUĀ™L™yWzÛKmbUxVKkn݃kŽVšĀċ¤Ux„@Ž¯Žm@ƒ¦'], + 'encodeOffsets': [[ + 100440, + 25943 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5304', + 'properties': { + 'name': '玉溪市', + 'cp': [ + 101.9312, + 23.8898 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@l„„L°xXlWxXnlw„a„ţlaÞlÆĬnX„ƒ°wVw„l„@m™nw°VVIXllKšbnnV°lbU„UJ@ÈÇKVb—š@bW„°Vk¦kaWb°škxV¤È¼U°ôI@llblš²š@‚@œó@mm@VţkKl¹@yĉ¯°ÑšIXmWKnkšlV„ULlb@lnbVal@UnVJœU‚„nKWa„x„@lkkUlW²X„™‚l„K°„šl²@lšÞUŽ„U‚„UšVšVVXmššlLVnXWVUĉVaVb„W™ğVéšU„VU¹W»aVa„aW™Xƒ‚_U¥nÇķ¯™@a™lUnǍUyk@@wW@kbW¦UKÝwUmmƒƒLUnVxUVVlk¯mmnƒmkÇaŤ¯I@ƒl@@aĉw°ĕmU—L±ƒk™ÆéX™ÜÛ@yÈç@™Çġ„Ýķ—XmmÝVՙƒ™lmnkbmWkb@nl@nŽmš¯VxkJmUJ„ml¯™°makVVnVƒ¦™Wƒ—Wmnl@xmn„l‚I„¤„n™xU„ƒVUŽmX@˜ƒb@zl@¦Ýþ'], + 'encodeOffsets': [[ + 103703, + 24874 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5333', + 'properties': { + 'name': '怒江傈僳族自治州', + 'cp': [ + 99.1516, + 26.5594 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@WyX£lWlnnUU™„¥@ţV™Vw„JlÅ@wƒmö󙻂£kml¯U¥n¹Æ@ny@wmU@¯mnamÛnƒšUV¥ÈnĠy²œm¤„@ÆónݚnmlnbÞU‚¥„aV£kU„KWƒ„óšƒmIU¥ókwVólƒ™»¯™ƒL™ƒk@m™naWKÛwóњw@a±n—@VbUJ›LkaƒÝXĉƒ™„UV`lI@lnXÆƑkKmxÛXmlUKVmU²Klw@a™aó„@n™KXwVKU¯V¥mUnkm¥ĉ@UxVĖƒ°Vx„V„klmޙkKWĀkVWšnl°Lnm@°ŽUxlV@nk¦™JVÈ°ŽVÒ@nX°@ÆlUômlnôƒ²nxmłnVV„¯x@Èm°XblVUšl°@xkXU¤WXX‚W„Xƃ„mkÅJmށw±bƒxUīkKmÅVUĖÝèV„kx@š›lX„lnk¤ƒLkŽ‚Ėk¦‚xUššL°‚¯Ė@LnK@b°xVI„¥Ua°Ñ@»nm@¹‚KŎÞÈWln²n'], + 'encodeOffsets': [[ + 101071, + 28891 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5331', + 'properties': { + 'name': '德宏傣族景颇族自治州', + 'cp': [ + 98.1299, + 24.5874 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„¥n@°@ƒVwČ£™ÿUlÞ„lmULVwnaÜLXyšzšKVÿ™XݙnƒWƒXwmaUa°¯V™ŦŽÆkUm„™VIƒ„ókĕl¯ƒa@£nama™@¯m¯œó@óyţbġkÅm±ÛammVkƒLwU`Wk@VƒkUmŃlUUKmbkkUVUwƒ¦óŽ°¼šbn°ô¦lºƒz@xšŽ¯„™@UŽ°nƒšU¤ţU„°VƆ@ÈmlnzÞl°¦Æa„xUxƒLkxWƒn@‚š²ŰšW„™‚@°ÈXl°Llx'], + 'encodeOffsets': [[ + 100440, + 25943 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/zhe_jiang_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '3311', + 'properties': { + 'name': '丽水市', + 'cp': [ + 119.5642, + 28.1854 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@V‚bVl@Xn‚UXƒKVŽ@¦nxlUXV‚n„KVmnL‚UV@bn¤lLXK˜²„`nnlJXIVJ‚I„Vnn°KnnVll@VLXWV@UkVaVK„zV@„ƒšVVaUK@U»VUl@@WnUUƒ@wVLn@Vwl@XW°LVbn@VU‚@X„l`@XnKVbkl@XVJlUnlV„„xlL@lnXl„@VšUnV°°„@a„UVLXblWVXn@VVUV@Lš¤VLV„U‚VbnalLUUVX_laVa„WVzXKV@@a@KUmImmXama@kU@yVIUK‚aVa@kXK@aWU@VIUmW@kkVm„Uš@VwUa@K@k@Uƒ`@kUKVk@UV@VaUm²Vy@klUUWUkVmUa@_ƒKVaXa›XmƒU@mUlWkaUXƒ@mmkL@w™JƒnVVÅbWKXa™@@I@aƒJUUÇ@V„UL™W@akLmb@K@a™XXw@mƒVmUVkUy@£@aU@@VkUWm@kUKƒXUWU_mW@wkkmJUUkLWWUXƒW@IkJ@k@mW_kӃ_Ul™Lƒm@I@aUa¯m@kƒa¯LUJƒ@mVVxUb™a@LUKkXƒbm@Uak@@a@Um`ƒIUbUJ@nUVW@@LnVV@lšUbVlUX@`š@blXklW„Ušm„Xlm¦U@@V¯bml@š@nUb@llnn@VbX@lV@ŽUVULmU@JVn„bVbkb™VWxU@@nUVk@'], + 'encodeOffsets': [[ + 121546, + 28992 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3301', + 'properties': { + 'name': '杭州市', + 'cp': [ + 119.5313, + 29.8773 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@X@l„°KXXlW„b@²„`šššb‚I„šX`l@„@bWl@n@VnLUV@V„@°¦@šl@XVlU@š@xVbUb@Vkb@‚@XVJVz™J@Lޚ@VmLUxUJ@LU„Vx‚b„xXUl@VaÈw„b‚aÞa@Vl@XUVx@V@V„LlbnV„al@lb„Vnn‚LnKnL@VlbVJXalIšb@KUU@mVInJ˜„U„Vl@xUšVLnUš@UÞaV@lkV@UanK„L@UlKVUnbÆmn@@nUlVnVJl@@UXU„L@WVIVJVxVLXV@IÜKnbn@V¥V@@I@ƒƒ„y°b@UUwnk°ÆƨVlUšçXm›£aƒÇ™IkVƒ@WV@@aWIUWUIkb@WW@UnƒK@UU@kaWVkƒVIVVnU@UWVUV@VmVkKkWIkVWaULU`UImJUImm—U@ƒƒwmwUV™IUWVkUamaU@mV—kƒb@KVU@aVU@anKULVJ‚U@kÛU™JUV›kkƒVakU@ƒaVwkW@UWkXmWaULUaUK@XƒJUUmƒVU@UVƒUkJ@ImwmKU@k„@lU„W@@akKm„kamIkWl_UwVm@UkaVUUaƒ@UamakbWlkL@aUalU@mkL@U@U™lmK@XkKm@Ýakb@xƒnXbƒ`ƒnUUU@›™U@™wU@@ƒmKkkƒV¯U@lULUbVbUb@V‚a@L™ºÝb@bLmK™x@VUL@bk@mxULWl'], + 'encodeOffsets': [[ + 121185, + 30184 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3303', + 'properties': { + 'name': '温州市', + 'cp': [ + 120.498, + 27.8119 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ll@xnXV`VX„WVL@lXnlV@UV@@b@¤VzUlnV„U@nWxšW@b@LnalK@bšXVKUƒÈ@VV„I@b@Jš@WbXLÆaUU„mšI@xlKnn„@VWlbkXV‚@n„VWnœ‚WbUb„L@`VbUnVlVXkV@lUz±‚VnUbU@@VUlVL@l„_@V@l@LVbV@XLV`VÈlxn@lU@aœaVV‚k„@XJ@nl@@LU`°LVb„L°a@a„UVy@anI@a„a‚nV@²wÜJX@VšVV°k„na@WVk„aWwU@m@™ƒkƒaUĕ™ÝšÝŤnÈa„aóI›»@±X™WkUķ@kV±kw™ƒUkWw„™UƒÝ»ÛkɳlImaUaWóXÿǬk‚UnWVmmk™KţnŏÞğl™„UlUx@XWb„V@JkXƒ°mb@VULVxUVk@@LWWk@WIkšƒUkJmUkVmI@yƒ@Ua™kLm‚U@mUUUkaVk™@mK@UlUU@UmKmbUUUJ@n@KVLUL@VkJWXX`mnULWlkL@JVLVb@°kxkU@LVŽ™V@„VLV`UL@VUX'], + 'encodeOffsets': [[ + 122502, + 28334 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3302', + 'properties': { + 'name': '宁波市', + 'cp': [ + 121.5967, + 29.6466 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Ċ¦ĸĀ°‚nXÞVšKškƨƑźÿ°»n„@wô¥ÜbœU°ÆXÞWóçĉݱIUƒÈ¥@U°wÆ»²mm_@aXƒVKÞVlk@akk›̅@£X»VwƏXWa¯aȗb™KƽۃĊ™xƒLóŽk@ƒƒƒ@¯nƒKUL@xkL›ÑkWULUUmJUXVŽU@mŽUX¯@V`mbXbV@@nn¤WXšx@škJ@nVVUVl²UbÝVUVk@Wx@V@„ƒVXzmlaƒL@VlLU`„XUVVVUnl@VbnJlnUVVnƒlUKkbmnn„VxlJnxmbU@UL@KUV™X@xmb@lk@mnVVUš™è'], + 'encodeOffsets': [[ + 123784, + 30977 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3309', + 'properties': { + 'name': '舟山市', + 'cp': [ + 122.2559, + 30.2234 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@l΢ƒʠþÆVĢLĊƒǬXĊ܄XôV„ÑÆw„ƒlšƏÈóVĭVǓ@ƒĉwɛkmK@ĉXīWaĉUĵÝmƒ¯ĉƒwĉ±±nż¯x@VǦV„²JĊÞôèÝXÅW¯›VÛaó¦@xƒŽmŽ¯¼ŹĀ'], + 'encodeOffsets': [[ + 124437, + 30983 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3310', + 'properties': { + 'name': '台州市', + 'cp': [ + 121.1353, + 28.6688 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lV„IVWVz@bXJl@Xal@°„nLll@nVxnV„K@UJVbƒ¦°„k`UIWJXnƚ@bUJ„Xl@lb„Wn@UzVV@bVVšmVnnJVXna‚bšKUKnUVVUnVLlKVLXa„Jm£@mU@WanaU_°@VWnV@UVWnIVVVKlXœÒlK@wVK„L°m„@„„l@ô„Kšw„ĉƾůUƒl£@»UƒVk„m@ƅUƒƒaÛIŏmUk@m„w@a™£ƒWk@ţšƒIm±@ankôUlaU™Uw¯ƒōaƒbÇbţm™ÞšÞVĖ„b„l@š@n‚VXxƒbUl@XmbƒŽ¯lUUU™W@ÛI±xU@mƒb@bmJ@bUzƒV@b¯bƒKUa¯KV_@Kk@@mWIƒ@lUU›b@bkVm@kwUÇU_WKU@Ux™@ƒVUnllX@Vn‚J@UXV@bWL@lUbbVLUJ@z‚V@lnbWbnnnJVŽ@L'], + 'encodeOffsets': [[ + 123312, + 29526 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3307', + 'properties': { + 'name': '金华市', + 'cp': [ + 120.0037, + 29.1028 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nbVb„@VbUVlb@VUnVxk`lXnJlbnƒlL@bX@Vƒ@klƒV@nLnx@JlI„V‚U@VUVn„VV„I@WVLVbVKXbWnXl@VlXUx„b@ŽlVUbl„œlVUšIÜVnalKX@@bV@@aUUlUƒwUw„@naWW„UVaUUšaVb„LlxXJVk°ƒUƒlkU¥@k„a@LVlXLVlšVWznVn@lxšJl_@WX_@mVa„a@alU@kVVna„KVLlK„b@UUaVašbnUWmXU@k@yVI@ařWmXIVJl_¯ƒ„¥UaVI@ƒLmUUw@mkkmK¯ƒk@Wbk@WI@aUyUXƒJkU@bU@WLUyƒXUbkbW`UVVkKmbUaVUƒUK™£@KVUUUm@UWkXWaUKƒV@b¯ƒ¯mU™V@UkƒmW@kkKƒwUƒmkkVUI@WlkUamL@Wk_Wƒ@UVm@Ua¯KWXk@Uxm@UK@xV„mV@Xk@UVV¼@‚VLUb™Uƒ„U@ƒyULUbVlU@@XlVUVVbƒU@lXXVW@XUVl@@VUVƒÈn@VVU„@lVa@„U„mL@`X@`WL@VUX@lUL@xlx'], + 'encodeOffsets': [[ + 122119, + 29948 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3308', + 'properties': { + 'name': '衢州市', + 'cp': [ + 118.6853, + 28.8666 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@XkVKnwl@@aVK@UšwnL‚K@aÞaš¹@Kb@UVaUaVaVK@k°V„UllnL@„V@šxV@œšV@VV„m„_Wa„m@wlaÞbn@lL@WnLšk@V@VlK@nkVVb@blKXklakw@wVK@kVW@UXK@_‚W@_nKVƒ@ƒUb@kVƒUUm@„ÇVU@Uk@VU@WUXWW@k„VUaVUkU@WWXUKk@Ukmm¯LmmƒUJUIWJkImmƒ_—±WLkKm£@aVUmKUnƒLmWUkVmw@¥U„LVWm@WUka@UmmLmm@@bUX™@@WUIm@UVUK@UVUUU™VVJmb@b„Xn‚mVƒ¼nnn¦mJUVƒL„V@VW@UzUlVnUbl`UnVl@XU@kl@bmÈUx™Vk@@J@„ƒ¼W@ÅaVVnzmVƒ„@WJk@kWJ@ƒlXbWbXxmVnšlLXb@°lKVXnWšbWV„„X„mbV@Xl‚bšI@Kn@@x@šVLlm'], + 'encodeOffsets': [[ + 121185, + 30184 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3306', + 'properties': { + 'name': '绍兴市', + 'cp': [ + 120.564, + 29.7565 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„x@„˜VnnVJnIVJV_VKXblUXJlŽlLUŽUnU@UVVX@ŽmVUUUJl„XUlbV@@V„LVmX@@XlaVJVXXJ@b‚@XU„@lUšJ„È‚bœ¤Ō„JšçV™UUnml@@kna@wšWVU@LVKV@namwkIUwmƒnmlaVL„kUmVUkmmIUak@VmUUVUƒWV_kK@U„K‚bnkWy„U@ƒ@UXwl@VUÞUVak±VUUU@mlI@™™wXWƒIWbUKkLUKVmUUmVVL™LambUWmIUm™nUU@aUUVym@ƒXkak@ƒW@z@lWVXnmV™aUbVb@VƒakLUKƒLmbUU@lkV@bƒbUb@nW`@Xk`™Ikwm@mUXy™UUkWKUk@Kƒb@lV¦klV„¯„UlWIkwƒKUa™bVVUbƒVXXmbƒ@Vx„xkVVV@bU@@aW@kLmb@lVUIVKmL@bUV@bUV@L„a˜lnUV@nbVbUlVXšJVUnx'], + 'encodeOffsets': [[ + 122997, + 30561 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3304', + 'properties': { + 'name': '嘉兴市', + 'cp': [ + 120.9155, + 30.6354 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@blIX@@VÜVUnn@l‚k„lKnI°Þl`²LVKVbnbVaVLUVn@W¦@VkVVb„@VI„`@blLnL‚aX@„VVb@U‚@XlVa„@@kVaUKV»U_lWXUƒƒ@alb„k@VllnLVKn@@UVIUw@y°IVVXU@VV@lw„m@wVkƾaœJ‚LkΡƧƒ™l™LÝUmW¯ķÿĉ¥ƒIŋŽWn™èkVƧU¯ÅmlVx@V¯aƒz„Ž@„@JU@U¦m@@šnVmn@V„LV‚'], + 'encodeOffsets': [[ + 123233, + 31382 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3305', + 'properties': { + 'name': '湖州市', + 'cp': [ + 119.8608, + 30.7782 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@kLlƒkm@VmÛU@UW@kJ@aUƒK@UnmmU@™maÛL@JWUUKUwUIUJ@XƒKWV@Vk@UIUmVk@mm@ÅnmaUVkL@VƒKmLVbU@klU@ÝbV™@mVUKV™@wUkVƒ—ƒmIUJ@nVV@L™akJWbUIka@UmKmLKmmƒUUVk@@nmLX`WXUV@Ž@nUl™kmlU@Ub„„ƒxVVšIlV„Žšnn„@@n˜„UҚ@„°n@@xmb@„VbnV@šš„@b@`@L@L@x@blVklVbnnV@‚aXb°VlU@W„b°U„LXWVUV™„™VwÈwÜ»ĸaĠnUVw²X@V@lVU@wlaUUVm@knUV›'], + 'encodeOffsets': [[ + 123379, + 31500 + ]] + } + } + ], + 'UTF8Encoding': true + }; +}); \ No newline at end of file diff --git a/build/source/chart/pie.js b/build/source/chart/pie.js new file mode 100644 index 0000000..e0dd84e --- /dev/null +++ b/build/source/chart/pie.js @@ -0,0 +1,730 @@ +define('echarts/chart/pie', [ + 'require', + './base', + 'zrender/shape/Text', + 'zrender/shape/Ring', + 'zrender/shape/Circle', + 'zrender/shape/Sector', + 'zrender/shape/Polyline', + '../config', + '../util/ecData', + 'zrender/tool/util', + 'zrender/tool/math', + 'zrender/tool/color', + '../chart' +], function (require) { + var ChartBase = require('./base'); + var TextShape = require('zrender/shape/Text'); + var RingShape = require('zrender/shape/Ring'); + var CircleShape = require('zrender/shape/Circle'); + var SectorShape = require('zrender/shape/Sector'); + var PolylineShape = require('zrender/shape/Polyline'); + var ecConfig = require('../config'); + ecConfig.pie = { + zlevel: 0, + z: 2, + clickable: true, + legendHoverLink: true, + center: [ + '50%', + '50%' + ], + radius: [ + 0, + '75%' + ], + clockWise: true, + startAngle: 90, + minAngle: 0, + selectedOffset: 10, + itemStyle: { + normal: { + borderColor: 'rgba(0,0,0,0)', + borderWidth: 1, + label: { + show: true, + position: 'outer' + }, + labelLine: { + show: true, + length: 20, + lineStyle: { + width: 1, + type: 'solid' + } + } + }, + emphasis: { + borderColor: 'rgba(0,0,0,0)', + borderWidth: 1, + label: { show: false }, + labelLine: { + show: false, + length: 20, + lineStyle: { + width: 1, + type: 'solid' + } + } + } + } + }; + var ecData = require('../util/ecData'); + var zrUtil = require('zrender/tool/util'); + var zrMath = require('zrender/tool/math'); + var zrColor = require('zrender/tool/color'); + function Pie(ecTheme, messageCenter, zr, option, myChart) { + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); + var self = this; + self.shapeHandler.onmouseover = function (param) { + var shape = param.target; + var seriesIndex = ecData.get(shape, 'seriesIndex'); + var dataIndex = ecData.get(shape, 'dataIndex'); + var percent = ecData.get(shape, 'special'); + var center = [ + shape.style.x, + shape.style.y + ]; + var startAngle = shape.style.startAngle; + var endAngle = shape.style.endAngle; + var midAngle = ((endAngle + startAngle) / 2 + 360) % 360; + var defaultColor = shape.highlightStyle.color; + var label = self.getLabel(seriesIndex, dataIndex, percent, center, midAngle, defaultColor, true); + if (label) { + self.zr.addHoverShape(label); + } + var labelLine = self.getLabelLine(seriesIndex, dataIndex, center, shape.style.r0, shape.style.r, midAngle, defaultColor, true); + if (labelLine) { + self.zr.addHoverShape(labelLine); + } + }; + this.refresh(option); + } + Pie.prototype = { + type: ecConfig.CHART_TYPE_PIE, + _buildShape: function () { + var series = this.series; + var legend = this.component.legend; + this.selectedMap = {}; + this._selected = {}; + var center; + var radius; + var pieCase; + this._selectedMode = false; + var serieName; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type === ecConfig.CHART_TYPE_PIE) { + series[i] = this.reformOption(series[i]); + this.legendHoverLink = series[i].legendHoverLink || this.legendHoverLink; + serieName = series[i].name || ''; + this.selectedMap[serieName] = legend ? legend.isSelected(serieName) : true; + if (!this.selectedMap[serieName]) { + continue; + } + center = this.parseCenter(this.zr, series[i].center); + radius = this.parseRadius(this.zr, series[i].radius); + this._selectedMode = this._selectedMode || series[i].selectedMode; + this._selected[i] = []; + if (this.deepQuery([ + series[i], + this.option + ], 'calculable')) { + pieCase = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: center[0], + y: center[1], + r0: radius[0] <= 10 ? 0 : radius[0] - 10, + r: radius[1] + 10, + brushType: 'stroke', + lineWidth: 1, + strokeColor: series[i].calculableHolderColor || this.ecTheme.calculableHolderColor || ecConfig.calculableHolderColor + } + }; + ecData.pack(pieCase, series[i], i, undefined, -1); + this.setCalculable(pieCase); + pieCase = radius[0] <= 10 ? new CircleShape(pieCase) : new RingShape(pieCase); + this.shapeList.push(pieCase); + } + this._buildSinglePie(i); + this.buildMark(i); + } + } + this.addShapeList(); + }, + _buildSinglePie: function (seriesIndex) { + var series = this.series; + var serie = series[seriesIndex]; + var data = serie.data; + var legend = this.component.legend; + var itemName; + var totalSelected = 0; + var totalSelectedValue0 = 0; + var totalValue = 0; + var maxValue = Number.NEGATIVE_INFINITY; + var singleShapeList = []; + for (var i = 0, l = data.length; i < l; i++) { + itemName = data[i].name; + this.selectedMap[itemName] = legend ? legend.isSelected(itemName) : true; + if (this.selectedMap[itemName] && !isNaN(data[i].value)) { + if (+data[i].value !== 0) { + totalSelected++; + } else { + totalSelectedValue0++; + } + totalValue += +data[i].value; + maxValue = Math.max(maxValue, +data[i].value); + } + } + if (totalValue === 0) { + return; + } + var percent = 100; + var clockWise = serie.clockWise; + var startAngle = (serie.startAngle.toFixed(2) - 0 + 360) % 360; + var endAngle; + var minAngle = serie.minAngle || 0.01; + var totalAngle = 360 - minAngle * totalSelected - 0.01 * totalSelectedValue0; + var defaultColor; + var roseType = serie.roseType; + var center; + var radius; + var r0; + var r1; + for (var i = 0, l = data.length; i < l; i++) { + itemName = data[i].name; + if (!this.selectedMap[itemName] || isNaN(data[i].value)) { + continue; + } + defaultColor = legend ? legend.getColor(itemName) : this.zr.getColor(i); + percent = data[i].value / totalValue; + if (roseType != 'area') { + endAngle = clockWise ? startAngle - percent * totalAngle - (percent !== 0 ? minAngle : 0.01) : percent * totalAngle + startAngle + (percent !== 0 ? minAngle : 0.01); + } else { + endAngle = clockWise ? startAngle - 360 / l : 360 / l + startAngle; + } + endAngle = endAngle.toFixed(2) - 0; + percent = (percent * 100).toFixed(2); + center = this.parseCenter(this.zr, serie.center); + radius = this.parseRadius(this.zr, serie.radius); + r0 = +radius[0]; + r1 = +radius[1]; + if (roseType === 'radius') { + r1 = data[i].value / maxValue * (r1 - r0) * 0.8 + (r1 - r0) * 0.2 + r0; + } else if (roseType === 'area') { + r1 = Math.sqrt(data[i].value / maxValue) * (r1 - r0) + r0; + } + if (clockWise) { + var temp; + temp = startAngle; + startAngle = endAngle; + endAngle = temp; + } + this._buildItem(singleShapeList, seriesIndex, i, percent, data[i].selected, center, r0, r1, startAngle, endAngle, defaultColor); + if (!clockWise) { + startAngle = endAngle; + } + } + this._autoLabelLayout(singleShapeList, center, r1); + for (var i = 0, l = singleShapeList.length; i < l; i++) { + this.shapeList.push(singleShapeList[i]); + } + singleShapeList = null; + }, + _buildItem: function (singleShapeList, seriesIndex, dataIndex, percent, isSelected, center, r0, r1, startAngle, endAngle, defaultColor) { + var series = this.series; + var midAngle = ((endAngle + startAngle) / 2 + 360) % 360; + var sector = this.getSector(seriesIndex, dataIndex, percent, isSelected, center, r0, r1, startAngle, endAngle, defaultColor); + ecData.pack(sector, series[seriesIndex], seriesIndex, series[seriesIndex].data[dataIndex], dataIndex, series[seriesIndex].data[dataIndex].name, percent); + singleShapeList.push(sector); + var label = this.getLabel(seriesIndex, dataIndex, percent, center, midAngle, defaultColor, false); + var labelLine = this.getLabelLine(seriesIndex, dataIndex, center, r0, r1, midAngle, defaultColor, false); + if (labelLine) { + ecData.pack(labelLine, series[seriesIndex], seriesIndex, series[seriesIndex].data[dataIndex], dataIndex, series[seriesIndex].data[dataIndex].name, percent); + singleShapeList.push(labelLine); + } + if (label) { + ecData.pack(label, series[seriesIndex], seriesIndex, series[seriesIndex].data[dataIndex], dataIndex, series[seriesIndex].data[dataIndex].name, percent); + label._labelLine = labelLine; + singleShapeList.push(label); + } + }, + getSector: function (seriesIndex, dataIndex, percent, isSelected, center, r0, r1, startAngle, endAngle, defaultColor) { + var series = this.series; + var serie = series[seriesIndex]; + var data = serie.data[dataIndex]; + var queryTarget = [ + data, + serie + ]; + var normal = this.deepMerge(queryTarget, 'itemStyle.normal') || {}; + var emphasis = this.deepMerge(queryTarget, 'itemStyle.emphasis') || {}; + var normalColor = this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) || defaultColor; + var emphasisColor = this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data) || (typeof normalColor === 'string' ? zrColor.lift(normalColor, -0.2) : normalColor); + var sector = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + clickable: this.deepQuery(queryTarget, 'clickable'), + style: { + x: center[0], + y: center[1], + r0: r0, + r: r1, + startAngle: startAngle, + endAngle: endAngle, + brushType: 'both', + color: normalColor, + lineWidth: normal.borderWidth, + strokeColor: normal.borderColor, + lineJoin: 'round' + }, + highlightStyle: { + color: emphasisColor, + lineWidth: emphasis.borderWidth, + strokeColor: emphasis.borderColor, + lineJoin: 'round' + }, + _seriesIndex: seriesIndex, + _dataIndex: dataIndex + }; + if (isSelected) { + var midAngle = ((sector.style.startAngle + sector.style.endAngle) / 2).toFixed(2) - 0; + sector.style._hasSelected = true; + sector.style._x = sector.style.x; + sector.style._y = sector.style.y; + var offset = this.query(serie, 'selectedOffset'); + sector.style.x += zrMath.cos(midAngle, true) * offset; + sector.style.y -= zrMath.sin(midAngle, true) * offset; + this._selected[seriesIndex][dataIndex] = true; + } else { + this._selected[seriesIndex][dataIndex] = false; + } + if (this._selectedMode) { + sector.onclick = this.shapeHandler.onclick; + } + if (this.deepQuery([ + data, + serie, + this.option + ], 'calculable')) { + this.setCalculable(sector); + sector.draggable = true; + } + if (this._needLabel(serie, data, true) || this._needLabelLine(serie, data, true)) { + sector.onmouseover = this.shapeHandler.onmouseover; + } + sector = new SectorShape(sector); + return sector; + }, + getLabel: function (seriesIndex, dataIndex, percent, center, midAngle, defaultColor, isEmphasis) { + var series = this.series; + var serie = series[seriesIndex]; + var data = serie.data[dataIndex]; + if (!this._needLabel(serie, data, isEmphasis)) { + return; + } + var status = isEmphasis ? 'emphasis' : 'normal'; + var itemStyle = zrUtil.merge(zrUtil.clone(data.itemStyle) || {}, serie.itemStyle); + var labelControl = itemStyle[status].label; + var textStyle = labelControl.textStyle || {}; + var centerX = center[0]; + var centerY = center[1]; + var x; + var y; + var radius = this.parseRadius(this.zr, serie.radius); + var textAlign; + var textBaseline = 'middle'; + labelControl.position = labelControl.position || itemStyle.normal.label.position; + if (labelControl.position === 'center') { + x = centerX; + y = centerY; + textAlign = 'center'; + } else if (labelControl.position === 'inner' || labelControl.position === 'inside') { + radius = (radius[0] + radius[1]) * (labelControl.distance || 0.5); + x = Math.round(centerX + radius * zrMath.cos(midAngle, true)); + y = Math.round(centerY - radius * zrMath.sin(midAngle, true)); + defaultColor = '#fff'; + textAlign = 'center'; + } else { + radius = radius[1] - -itemStyle[status].labelLine.length; + x = Math.round(centerX + radius * zrMath.cos(midAngle, true)); + y = Math.round(centerY - radius * zrMath.sin(midAngle, true)); + textAlign = midAngle >= 90 && midAngle <= 270 ? 'right' : 'left'; + } + if (labelControl.position != 'center' && labelControl.position != 'inner' && labelControl.position != 'inside') { + x += textAlign === 'left' ? 20 : -20; + } + data.__labelX = x - (textAlign === 'left' ? 5 : -5); + data.__labelY = y; + var ts = new TextShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + hoverable: false, + style: { + x: x, + y: y, + color: textStyle.color || defaultColor, + text: this.getLabelText(seriesIndex, dataIndex, percent, status), + textAlign: textStyle.align || textAlign, + textBaseline: textStyle.baseline || textBaseline, + textFont: this.getFont(textStyle) + }, + highlightStyle: { brushType: 'fill' } + }); + ts._radius = radius; + ts._labelPosition = labelControl.position || 'outer'; + ts._rect = ts.getRect(ts.style); + ts._seriesIndex = seriesIndex; + ts._dataIndex = dataIndex; + return ts; + }, + getLabelText: function (seriesIndex, dataIndex, percent, status) { + var series = this.series; + var serie = series[seriesIndex]; + var data = serie.data[dataIndex]; + var formatter = this.deepQuery([ + data, + serie + ], 'itemStyle.' + status + '.label.formatter'); + if (formatter) { + if (typeof formatter === 'function') { + return formatter.call(this.myChart, { + seriesIndex: seriesIndex, + seriesName: serie.name || '', + series: serie, + dataIndex: dataIndex, + data: data, + name: data.name, + value: data.value, + percent: percent + }); + } else if (typeof formatter === 'string') { + formatter = formatter.replace('{a}', '{a0}').replace('{b}', '{b0}').replace('{c}', '{c0}').replace('{d}', '{d0}'); + formatter = formatter.replace('{a0}', serie.name).replace('{b0}', data.name).replace('{c0}', data.value).replace('{d0}', percent); + return formatter; + } + } else { + return data.name; + } + }, + getLabelLine: function (seriesIndex, dataIndex, center, r0, r1, midAngle, defaultColor, isEmphasis) { + var series = this.series; + var serie = series[seriesIndex]; + var data = serie.data[dataIndex]; + if (this._needLabelLine(serie, data, isEmphasis)) { + var status = isEmphasis ? 'emphasis' : 'normal'; + var itemStyle = zrUtil.merge(zrUtil.clone(data.itemStyle) || {}, serie.itemStyle); + var labelLineControl = itemStyle[status].labelLine; + var lineStyle = labelLineControl.lineStyle || {}; + var centerX = center[0]; + var centerY = center[1]; + var minRadius = r1; + var maxRadius = this.parseRadius(this.zr, serie.radius)[1] - -labelLineControl.length; + var cosValue = zrMath.cos(midAngle, true); + var sinValue = zrMath.sin(midAngle, true); + return new PolylineShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + hoverable: false, + style: { + pointList: [ + [ + centerX + minRadius * cosValue, + centerY - minRadius * sinValue + ], + [ + centerX + maxRadius * cosValue, + centerY - maxRadius * sinValue + ], + [ + data.__labelX, + data.__labelY + ] + ], + strokeColor: lineStyle.color || defaultColor, + lineType: lineStyle.type, + lineWidth: lineStyle.width + }, + _seriesIndex: seriesIndex, + _dataIndex: dataIndex + }); + } else { + return; + } + }, + _needLabel: function (serie, data, isEmphasis) { + return this.deepQuery([ + data, + serie + ], 'itemStyle.' + (isEmphasis ? 'emphasis' : 'normal') + '.label.show'); + }, + _needLabelLine: function (serie, data, isEmphasis) { + return this.deepQuery([ + data, + serie + ], 'itemStyle.' + (isEmphasis ? 'emphasis' : 'normal') + '.labelLine.show'); + }, + _autoLabelLayout: function (sList, center, r) { + var leftList = []; + var rightList = []; + for (var i = 0, l = sList.length; i < l; i++) { + if (sList[i]._labelPosition === 'outer' || sList[i]._labelPosition === 'outside') { + sList[i]._rect._y = sList[i]._rect.y; + if (sList[i]._rect.x < center[0]) { + leftList.push(sList[i]); + } else { + rightList.push(sList[i]); + } + } + } + this._layoutCalculate(leftList, center, r, -1); + this._layoutCalculate(rightList, center, r, 1); + }, + _layoutCalculate: function (tList, center, r, direction) { + tList.sort(function (a, b) { + return a._rect.y - b._rect.y; + }); + function _changeDown(start, end, delta, direction) { + for (var j = start; j < end; j++) { + tList[j]._rect.y += delta; + tList[j].style.y += delta; + if (tList[j]._labelLine) { + tList[j]._labelLine.style.pointList[1][1] += delta; + tList[j]._labelLine.style.pointList[2][1] += delta; + } + if (j > start && j + 1 < end && tList[j + 1]._rect.y > tList[j]._rect.y + tList[j]._rect.height) { + _changeUp(j, delta / 2); + return; + } + } + _changeUp(end - 1, delta / 2); + } + function _changeUp(end, delta) { + for (var j = end; j >= 0; j--) { + tList[j]._rect.y -= delta; + tList[j].style.y -= delta; + if (tList[j]._labelLine) { + tList[j]._labelLine.style.pointList[1][1] -= delta; + tList[j]._labelLine.style.pointList[2][1] -= delta; + } + if (j > 0 && tList[j]._rect.y > tList[j - 1]._rect.y + tList[j - 1]._rect.height) { + break; + } + } + } + function _changeX(sList, isDownList, center, r, direction) { + var x = center[0]; + var y = center[1]; + var deltaX; + var deltaY; + var length; + var lastDeltaX = direction > 0 ? isDownList ? Number.MAX_VALUE : 0 : isDownList ? Number.MAX_VALUE : 0; + for (var i = 0, l = sList.length; i < l; i++) { + deltaY = Math.abs(sList[i]._rect.y - y); + length = sList[i]._radius - r; + deltaX = deltaY < r + length ? Math.sqrt((r + length + 20) * (r + length + 20) - Math.pow(sList[i]._rect.y - y, 2)) : Math.abs(sList[i]._rect.x + (direction > 0 ? 0 : sList[i]._rect.width) - x); + if (isDownList && deltaX >= lastDeltaX) { + deltaX = lastDeltaX - 10; + } + if (!isDownList && deltaX <= lastDeltaX) { + deltaX = lastDeltaX + 10; + } + sList[i]._rect.x = sList[i].style.x = x + deltaX * direction; + if (sList[i]._labelLine) { + sList[i]._labelLine.style.pointList[2][0] = x + (deltaX - 5) * direction; + sList[i]._labelLine.style.pointList[1][0] = x + (deltaX - 20) * direction; + } + lastDeltaX = deltaX; + } + } + var lastY = 0; + var delta; + var len = tList.length; + var upList = []; + var downList = []; + for (var i = 0; i < len; i++) { + delta = tList[i]._rect.y - lastY; + if (delta < 0) { + _changeDown(i, len, -delta, direction); + } + lastY = tList[i]._rect.y + tList[i]._rect.height; + } + if (this.zr.getHeight() - lastY < 0) { + _changeUp(len - 1, lastY - this.zr.getHeight()); + } + for (var i = 0; i < len; i++) { + if (tList[i]._rect.y >= center[1]) { + downList.push(tList[i]); + } else { + upList.push(tList[i]); + } + } + _changeX(downList, true, center, r, direction); + _changeX(upList, false, center, r, direction); + }, + reformOption: function (opt) { + var _merge = zrUtil.merge; + opt = _merge(_merge(opt || {}, zrUtil.clone(this.ecTheme.pie || {})), zrUtil.clone(ecConfig.pie)); + opt.itemStyle.normal.label.textStyle = this.getTextStyle(opt.itemStyle.normal.label.textStyle); + opt.itemStyle.emphasis.label.textStyle = this.getTextStyle(opt.itemStyle.emphasis.label.textStyle); + return opt; + }, + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + this.backupShapeList(); + this._buildShape(); + }, + addDataAnimation: function (params) { + var series = this.series; + var aniMap = {}; + for (var i = 0, l = params.length; i < l; i++) { + aniMap[params[i][0]] = params[i]; + } + var sectorMap = {}; + var textMap = {}; + var lineMap = {}; + var backupShapeList = this.shapeList; + this.shapeList = []; + var seriesIndex; + var isHead; + var dataGrow; + var deltaIdxMap = {}; + for (var i = 0, l = params.length; i < l; i++) { + seriesIndex = params[i][0]; + isHead = params[i][2]; + dataGrow = params[i][3]; + if (series[seriesIndex] && series[seriesIndex].type === ecConfig.CHART_TYPE_PIE) { + if (isHead) { + if (!dataGrow) { + sectorMap[seriesIndex + '_' + series[seriesIndex].data.length] = 'delete'; + } + deltaIdxMap[seriesIndex] = 1; + } else { + if (!dataGrow) { + sectorMap[seriesIndex + '_-1'] = 'delete'; + deltaIdxMap[seriesIndex] = -1; + } else { + deltaIdxMap[seriesIndex] = 0; + } + } + this._buildSinglePie(seriesIndex); + } + } + var dataIndex; + var key; + for (var i = 0, l = this.shapeList.length; i < l; i++) { + seriesIndex = this.shapeList[i]._seriesIndex; + dataIndex = this.shapeList[i]._dataIndex; + key = seriesIndex + '_' + dataIndex; + switch (this.shapeList[i].type) { + case 'sector': + sectorMap[key] = this.shapeList[i]; + break; + case 'text': + textMap[key] = this.shapeList[i]; + break; + case 'polyline': + lineMap[key] = this.shapeList[i]; + break; + } + } + this.shapeList = []; + var targeSector; + for (var i = 0, l = backupShapeList.length; i < l; i++) { + seriesIndex = backupShapeList[i]._seriesIndex; + if (aniMap[seriesIndex]) { + dataIndex = backupShapeList[i]._dataIndex + deltaIdxMap[seriesIndex]; + key = seriesIndex + '_' + dataIndex; + targeSector = sectorMap[key]; + if (!targeSector) { + continue; + } + if (backupShapeList[i].type === 'sector') { + if (targeSector != 'delete') { + this.zr.animate(backupShapeList[i].id, 'style').when(400, { + startAngle: targeSector.style.startAngle, + endAngle: targeSector.style.endAngle + }).start(); + } else { + this.zr.animate(backupShapeList[i].id, 'style').when(400, deltaIdxMap[seriesIndex] < 0 ? { startAngle: backupShapeList[i].style.startAngle } : { endAngle: backupShapeList[i].style.endAngle }).start(); + } + } else if (backupShapeList[i].type === 'text' || backupShapeList[i].type === 'polyline') { + if (targeSector === 'delete') { + this.zr.delShape(backupShapeList[i].id); + } else { + switch (backupShapeList[i].type) { + case 'text': + targeSector = textMap[key]; + this.zr.animate(backupShapeList[i].id, 'style').when(400, { + x: targeSector.style.x, + y: targeSector.style.y + }).start(); + break; + case 'polyline': + targeSector = lineMap[key]; + this.zr.animate(backupShapeList[i].id, 'style').when(400, { pointList: targeSector.style.pointList }).start(); + break; + } + } + } + } + } + this.shapeList = backupShapeList; + }, + onclick: function (param) { + var series = this.series; + if (!this.isClick || !param.target) { + return; + } + this.isClick = false; + var offset; + var target = param.target; + var style = target.style; + var seriesIndex = ecData.get(target, 'seriesIndex'); + var dataIndex = ecData.get(target, 'dataIndex'); + for (var i = 0, len = this.shapeList.length; i < len; i++) { + if (this.shapeList[i].id === target.id) { + seriesIndex = ecData.get(target, 'seriesIndex'); + dataIndex = ecData.get(target, 'dataIndex'); + if (!style._hasSelected) { + var midAngle = ((style.startAngle + style.endAngle) / 2).toFixed(2) - 0; + target.style._hasSelected = true; + this._selected[seriesIndex][dataIndex] = true; + target.style._x = target.style.x; + target.style._y = target.style.y; + offset = this.query(series[seriesIndex], 'selectedOffset'); + target.style.x += zrMath.cos(midAngle, true) * offset; + target.style.y -= zrMath.sin(midAngle, true) * offset; + } else { + target.style.x = target.style._x; + target.style.y = target.style._y; + target.style._hasSelected = false; + this._selected[seriesIndex][dataIndex] = false; + } + this.zr.modShape(target.id, target); + } else if (this.shapeList[i].style._hasSelected && this._selectedMode === 'single') { + seriesIndex = ecData.get(this.shapeList[i], 'seriesIndex'); + dataIndex = ecData.get(this.shapeList[i], 'dataIndex'); + this.shapeList[i].style.x = this.shapeList[i].style._x; + this.shapeList[i].style.y = this.shapeList[i].style._y; + this.shapeList[i].style._hasSelected = false; + this._selected[seriesIndex][dataIndex] = false; + this.zr.modShape(this.shapeList[i].id, this.shapeList[i]); + } + } + this.messageCenter.dispatch(ecConfig.EVENT.PIE_SELECTED, param.event, { + selected: this._selected, + target: ecData.get(target, 'name') + }, this.myChart); + this.zr.refreshNextFrame(); + } + }; + zrUtil.inherits(Pie, ChartBase); + require('../chart').define('pie', Pie); + return Pie; +}); \ No newline at end of file diff --git a/build/source/chart/radar.js b/build/source/chart/radar.js new file mode 100644 index 0000000..bbed548 --- /dev/null +++ b/build/source/chart/radar.js @@ -0,0 +1,926 @@ +define('echarts/chart/radar', [ + 'require', + './base', + 'zrender/shape/Polygon', + '../component/polar', + '../config', + '../util/ecData', + 'zrender/tool/util', + 'zrender/tool/color', + '../util/accMath', + '../chart' +], function (require) { + var ChartBase = require('./base'); + var PolygonShape = require('zrender/shape/Polygon'); + require('../component/polar'); + var ecConfig = require('../config'); + ecConfig.radar = { + zlevel: 0, + z: 2, + clickable: true, + legendHoverLink: true, + polarIndex: 0, + itemStyle: { + normal: { + label: { show: false }, + lineStyle: { + width: 2, + type: 'solid' + } + }, + emphasis: { label: { show: false } } + }, + symbolSize: 2 + }; + var ecData = require('../util/ecData'); + var zrUtil = require('zrender/tool/util'); + var zrColor = require('zrender/tool/color'); + function Radar(ecTheme, messageCenter, zr, option, myChart) { + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); + this.refresh(option); + } + Radar.prototype = { + type: ecConfig.CHART_TYPE_RADAR, + _buildShape: function () { + this.selectedMap = {}; + this._symbol = this.option.symbolList; + this._queryTarget; + this._dropBoxList = []; + this._radarDataCounter = 0; + var series = this.series; + var legend = this.component.legend; + var serieName; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type === ecConfig.CHART_TYPE_RADAR) { + this.serie = this.reformOption(series[i]); + this.legendHoverLink = series[i].legendHoverLink || this.legendHoverLink; + serieName = this.serie.name || ''; + this.selectedMap[serieName] = legend ? legend.isSelected(serieName) : true; + if (this.selectedMap[serieName]) { + this._queryTarget = [ + this.serie, + this.option + ]; + if (this.deepQuery(this._queryTarget, 'calculable')) { + this._addDropBox(i); + } + this._buildSingleRadar(i); + this.buildMark(i); + } + } + } + this.addShapeList(); + }, + _buildSingleRadar: function (index) { + var legend = this.component.legend; + var iconShape; + var data = this.serie.data; + var defaultColor; + var name; + var pointList; + var calculable = this.deepQuery(this._queryTarget, 'calculable'); + for (var i = 0; i < data.length; i++) { + name = data[i].name || ''; + this.selectedMap[name] = legend ? legend.isSelected(name) : true; + if (!this.selectedMap[name]) { + continue; + } + if (legend) { + defaultColor = legend.getColor(name); + iconShape = legend.getItemShape(name); + if (iconShape) { + iconShape.style.brushType = this.deepQuery([ + data[i], + this.serie + ], 'itemStyle.normal.areaStyle') ? 'both' : 'stroke'; + legend.setItemShape(name, iconShape); + } + } else { + defaultColor = this.zr.getColor(i); + } + pointList = this._getPointList(this.serie.polarIndex, data[i]); + this._addSymbol(pointList, defaultColor, i, index, this.serie.polarIndex); + this._addDataShape(pointList, defaultColor, data[i], index, i, calculable); + this._radarDataCounter++; + } + }, + _getPointList: function (polarIndex, dataArr) { + var pointList = []; + var vector; + var polar = this.component.polar; + var value; + for (var i = 0, l = dataArr.value.length; i < l; i++) { + value = this.getDataFromOption(dataArr.value[i]); + vector = value != '-' ? polar.getVector(polarIndex, i, value) : false; + if (vector) { + pointList.push(vector); + } + } + return pointList; + }, + _addSymbol: function (pointList, defaultColor, dataIndex, seriesIndex, polarIndex) { + var series = this.series; + var itemShape; + var polar = this.component.polar; + for (var i = 0, l = pointList.length; i < l; i++) { + itemShape = this.getSymbolShape(this.deepMerge([ + series[seriesIndex].data[dataIndex], + series[seriesIndex] + ]), seriesIndex, series[seriesIndex].data[dataIndex].value[i], i, polar.getIndicatorText(polarIndex, i), pointList[i][0], pointList[i][1], this._symbol[this._radarDataCounter % this._symbol.length], defaultColor, '#fff', 'vertical'); + itemShape.zlevel = this.getZlevelBase(); + itemShape.z = this.getZBase() + 1; + ecData.set(itemShape, 'data', series[seriesIndex].data[dataIndex]); + ecData.set(itemShape, 'value', series[seriesIndex].data[dataIndex].value); + ecData.set(itemShape, 'dataIndex', dataIndex); + ecData.set(itemShape, 'special', i); + this.shapeList.push(itemShape); + } + }, + _addDataShape: function (pointList, defaultColor, data, seriesIndex, dataIndex, calculable) { + var series = this.series; + var queryTarget = [ + data, + this.serie + ]; + var nColor = this.getItemStyleColor(this.deepQuery(queryTarget, 'itemStyle.normal.color'), seriesIndex, dataIndex, data); + var nLineWidth = this.deepQuery(queryTarget, 'itemStyle.normal.lineStyle.width'); + var nLineType = this.deepQuery(queryTarget, 'itemStyle.normal.lineStyle.type'); + var nAreaColor = this.deepQuery(queryTarget, 'itemStyle.normal.areaStyle.color'); + var nIsAreaFill = this.deepQuery(queryTarget, 'itemStyle.normal.areaStyle'); + var shape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + pointList: pointList, + brushType: nIsAreaFill ? 'both' : 'stroke', + color: nAreaColor || nColor || (typeof defaultColor === 'string' ? zrColor.alpha(defaultColor, 0.5) : defaultColor), + strokeColor: nColor || defaultColor, + lineWidth: nLineWidth, + lineType: nLineType + }, + highlightStyle: { + brushType: this.deepQuery(queryTarget, 'itemStyle.emphasis.areaStyle') || nIsAreaFill ? 'both' : 'stroke', + color: this.deepQuery(queryTarget, 'itemStyle.emphasis.areaStyle.color') || nAreaColor || nColor || (typeof defaultColor === 'string' ? zrColor.alpha(defaultColor, 0.5) : defaultColor), + strokeColor: this.getItemStyleColor(this.deepQuery(queryTarget, 'itemStyle.emphasis.color'), seriesIndex, dataIndex, data) || nColor || defaultColor, + lineWidth: this.deepQuery(queryTarget, 'itemStyle.emphasis.lineStyle.width') || nLineWidth, + lineType: this.deepQuery(queryTarget, 'itemStyle.emphasis.lineStyle.type') || nLineType + } + }; + ecData.pack(shape, series[seriesIndex], seriesIndex, data, dataIndex, data.name, this.component.polar.getIndicator(series[seriesIndex].polarIndex)); + if (calculable) { + shape.draggable = true; + this.setCalculable(shape); + } + shape = new PolygonShape(shape); + this.shapeList.push(shape); + }, + _addDropBox: function (index) { + var series = this.series; + var polarIndex = this.deepQuery(this._queryTarget, 'polarIndex'); + if (!this._dropBoxList[polarIndex]) { + var shape = this.component.polar.getDropBox(polarIndex); + shape.zlevel = this.getZlevelBase(); + shape.z = this.getZBase(); + this.setCalculable(shape); + ecData.pack(shape, series, index, undefined, -1); + this.shapeList.push(shape); + this._dropBoxList[polarIndex] = true; + } + }, + ondragend: function (param, status) { + var series = this.series; + if (!this.isDragend || !param.target) { + return; + } + var target = param.target; + var seriesIndex = ecData.get(target, 'seriesIndex'); + var dataIndex = ecData.get(target, 'dataIndex'); + this.component.legend && this.component.legend.del(series[seriesIndex].data[dataIndex].name); + series[seriesIndex].data.splice(dataIndex, 1); + status.dragOut = true; + status.needRefresh = true; + this.isDragend = false; + return; + }, + ondrop: function (param, status) { + var series = this.series; + if (!this.isDrop || !param.target) { + return; + } + var target = param.target; + var dragged = param.dragged; + var seriesIndex = ecData.get(target, 'seriesIndex'); + var dataIndex = ecData.get(target, 'dataIndex'); + var data; + var legend = this.component.legend; + var value; + if (dataIndex === -1) { + data = { + value: ecData.get(dragged, 'value'), + name: ecData.get(dragged, 'name') + }; + series[seriesIndex].data.push(data); + legend && legend.add(data.name, dragged.style.color || dragged.style.strokeColor); + } else { + var accMath = require('../util/accMath'); + data = series[seriesIndex].data[dataIndex]; + legend && legend.del(data.name); + data.name += this.option.nameConnector + ecData.get(dragged, 'name'); + value = ecData.get(dragged, 'value'); + for (var i = 0; i < value.length; i++) { + data.value[i] = accMath.accAdd(data.value[i], value[i]); + } + legend && legend.add(data.name, dragged.style.color || dragged.style.strokeColor); + } + status.dragIn = status.dragIn || true; + this.isDrop = false; + return; + }, + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + this.backupShapeList(); + this._buildShape(); + } + }; + zrUtil.inherits(Radar, ChartBase); + require('../chart').define('radar', Radar); + return Radar; +});define('echarts/component/polar', [ + 'require', + './base', + 'zrender/shape/Text', + 'zrender/shape/Line', + 'zrender/shape/Polygon', + 'zrender/shape/Circle', + 'zrender/shape/Ring', + '../config', + 'zrender/tool/util', + '../util/coordinates', + '../util/accMath', + '../util/smartSteps', + '../component' +], function (require) { + var Base = require('./base'); + var TextShape = require('zrender/shape/Text'); + var LineShape = require('zrender/shape/Line'); + var PolygonShape = require('zrender/shape/Polygon'); + var Circle = require('zrender/shape/Circle'); + var Ring = require('zrender/shape/Ring'); + var ecConfig = require('../config'); + ecConfig.polar = { + zlevel: 0, + z: 0, + center: [ + '50%', + '50%' + ], + radius: '75%', + startAngle: 90, + boundaryGap: [ + 0, + 0 + ], + splitNumber: 5, + name: { + show: true, + textStyle: { color: '#333' } + }, + axisLine: { + show: true, + lineStyle: { + color: '#ccc', + width: 1, + type: 'solid' + } + }, + axisLabel: { + show: false, + textStyle: { color: '#333' } + }, + splitArea: { + show: true, + areaStyle: { + color: [ + 'rgba(250,250,250,0.3)', + 'rgba(200,200,200,0.3)' + ] + } + }, + splitLine: { + show: true, + lineStyle: { + width: 1, + color: '#ccc' + } + }, + type: 'polygon' + }; + var zrUtil = require('zrender/tool/util'); + var ecCoordinates = require('../util/coordinates'); + function Polar(ecTheme, messageCenter, zr, option, myChart) { + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + this.refresh(option); + } + Polar.prototype = { + type: ecConfig.COMPONENT_TYPE_POLAR, + _buildShape: function () { + for (var i = 0; i < this.polar.length; i++) { + this._index = i; + this.reformOption(this.polar[i]); + this._queryTarget = [ + this.polar[i], + this.option + ]; + this._createVector(i); + this._buildSpiderWeb(i); + this._buildText(i); + this._adjustIndicatorValue(i); + this._addAxisLabel(i); + } + for (var i = 0; i < this.shapeList.length; i++) { + this.zr.addShape(this.shapeList[i]); + } + }, + _createVector: function (index) { + var item = this.polar[index]; + var indicator = this.deepQuery(this._queryTarget, 'indicator'); + var length = indicator.length; + var startAngle = item.startAngle; + var dStep = 2 * Math.PI / length; + var radius = this._getRadius(); + var __ecIndicator = item.__ecIndicator = []; + var vector; + for (var i = 0; i < length; i++) { + vector = ecCoordinates.polar2cartesian(radius, startAngle * Math.PI / 180 + dStep * i); + __ecIndicator.push({ + vector: [ + vector[1], + -vector[0] + ] + }); + } + }, + _getRadius: function () { + var item = this.polar[this._index]; + return this.parsePercent(item.radius, Math.min(this.zr.getWidth(), this.zr.getHeight()) / 2); + }, + _buildSpiderWeb: function (index) { + var item = this.polar[index]; + var __ecIndicator = item.__ecIndicator; + var splitArea = item.splitArea; + var splitLine = item.splitLine; + var center = this.getCenter(index); + var splitNumber = item.splitNumber; + var strokeColor = splitLine.lineStyle.color; + var lineWidth = splitLine.lineStyle.width; + var show = splitLine.show; + var axisLine = this.deepQuery(this._queryTarget, 'axisLine'); + this._addArea(__ecIndicator, splitNumber, center, splitArea, strokeColor, lineWidth, show); + axisLine.show && this._addLine(__ecIndicator, center, axisLine); + }, + _addAxisLabel: function (index) { + var accMath = require('../util/accMath'); + var item = this.polar[index]; + var indicator = this.deepQuery(this._queryTarget, 'indicator'); + var __ecIndicator = item.__ecIndicator; + var axisLabel; + var vector; + var style; + var newStyle; + var splitNumber = this.deepQuery(this._queryTarget, 'splitNumber'); + var center = this.getCenter(index); + var vector; + var value; + var text; + var theta; + var offset; + var interval; + for (var i = 0; i < indicator.length; i++) { + axisLabel = this.deepQuery([ + indicator[i], + item, + this.option + ], 'axisLabel'); + if (axisLabel.show) { + var textStyle = this.deepQuery([ + axisLabel, + item, + this.option + ], 'textStyle'); + style = {}; + style.textFont = this.getFont(textStyle); + style.color = textStyle.color; + style = zrUtil.merge(style, axisLabel); + style.lineWidth = style.width; + vector = __ecIndicator[i].vector; + value = __ecIndicator[i].value; + theta = i / indicator.length * 2 * Math.PI; + offset = axisLabel.offset || 10; + interval = axisLabel.interval || 0; + if (!value) { + return; + } + for (var j = 1; j <= splitNumber; j += interval + 1) { + newStyle = zrUtil.merge({}, style); + text = accMath.accAdd(value.min, accMath.accMul(value.step, j)); + newStyle.text = this.numAddCommas(text); + newStyle.x = j * vector[0] / splitNumber + Math.cos(theta) * offset + center[0]; + newStyle.y = j * vector[1] / splitNumber + Math.sin(theta) * offset + center[1]; + this.shapeList.push(new TextShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: newStyle, + draggable: false, + hoverable: false + })); + } + } + } + }, + _buildText: function (index) { + var item = this.polar[index]; + var __ecIndicator = item.__ecIndicator; + var vector; + var indicator = this.deepQuery(this._queryTarget, 'indicator'); + var center = this.getCenter(index); + var style; + var textAlign; + var name; + var rotation; + var x = 0; + var y = 0; + var margin; + var textStyle; + for (var i = 0; i < indicator.length; i++) { + name = this.deepQuery([ + indicator[i], + item, + this.option + ], 'name'); + if (!name.show) { + continue; + } + textStyle = this.deepQuery([ + name, + item, + this.option + ], 'textStyle'); + style = {}; + style.textFont = this.getFont(textStyle); + style.color = textStyle.color; + if (typeof name.formatter == 'function') { + style.text = name.formatter.call(this.myChart, indicator[i].text, i); + } else if (typeof name.formatter == 'string') { + style.text = name.formatter.replace('{value}', indicator[i].text); + } else { + style.text = indicator[i].text; + } + __ecIndicator[i].text = style.text; + vector = __ecIndicator[i].vector; + if (Math.round(vector[0]) > 0) { + textAlign = 'left'; + } else if (Math.round(vector[0]) < 0) { + textAlign = 'right'; + } else { + textAlign = 'center'; + } + if (name.margin == null) { + vector = this._mapVector(vector, center, 1.1); + } else { + margin = name.margin; + x = vector[0] > 0 ? margin : -margin; + y = vector[1] > 0 ? margin : -margin; + x = vector[0] === 0 ? 0 : x; + y = vector[1] === 0 ? 0 : y; + vector = this._mapVector(vector, center, 1); + } + style.textAlign = textAlign; + style.x = vector[0] + x; + style.y = vector[1] + y; + if (name.rotate) { + rotation = [ + name.rotate / 180 * Math.PI, + vector[0], + vector[1] + ]; + } else { + rotation = [ + 0, + 0, + 0 + ]; + } + this.shapeList.push(new TextShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: style, + draggable: false, + hoverable: false, + rotation: rotation + })); + } + }, + getIndicatorText: function (polarIndex, indicatorIndex) { + return this.polar[polarIndex] && this.polar[polarIndex].__ecIndicator[indicatorIndex] && this.polar[polarIndex].__ecIndicator[indicatorIndex].text; + }, + getDropBox: function (index) { + var index = index || 0; + var item = this.polar[index]; + var center = this.getCenter(index); + var __ecIndicator = item.__ecIndicator; + var len = __ecIndicator.length; + var pointList = []; + var vector; + var shape; + var type = item.type; + if (type == 'polygon') { + for (var i = 0; i < len; i++) { + vector = __ecIndicator[i].vector; + pointList.push(this._mapVector(vector, center, 1.2)); + } + shape = this._getShape(pointList, 'fill', 'rgba(0,0,0,0)', '', 1); + } else if (type == 'circle') { + shape = this._getCircle('', 1, 1.2, center, 'fill', 'rgba(0,0,0,0)'); + } + return shape; + }, + _addArea: function (__ecIndicator, splitNumber, center, splitArea, strokeColor, lineWidth, show) { + var shape; + var scale; + var scale1; + var pointList; + var type = this.deepQuery(this._queryTarget, 'type'); + for (var i = 0; i < splitNumber; i++) { + scale = (splitNumber - i) / splitNumber; + if (show) { + if (type == 'polygon') { + pointList = this._getPointList(__ecIndicator, scale, center); + shape = this._getShape(pointList, 'stroke', '', strokeColor, lineWidth); + } else if (type == 'circle') { + shape = this._getCircle(strokeColor, lineWidth, scale, center, 'stroke'); + } + this.shapeList.push(shape); + } + if (splitArea.show) { + scale1 = (splitNumber - i - 1) / splitNumber; + this._addSplitArea(__ecIndicator, splitArea, scale, scale1, center, i); + } + } + }, + _getCircle: function (strokeColor, lineWidth, scale, center, brushType, color) { + var radius = this._getRadius(); + return new Circle({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: center[0], + y: center[1], + r: radius * scale, + brushType: brushType, + strokeColor: strokeColor, + lineWidth: lineWidth, + color: color + }, + hoverable: false, + draggable: false + }); + }, + _getRing: function (color, scale0, scale1, center) { + var radius = this._getRadius(); + return new Ring({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: center[0], + y: center[1], + r: scale0 * radius, + r0: scale1 * radius, + color: color, + brushType: 'fill' + }, + hoverable: false, + draggable: false + }); + }, + _getPointList: function (__ecIndicator, scale, center) { + var pointList = []; + var len = __ecIndicator.length; + var vector; + for (var i = 0; i < len; i++) { + vector = __ecIndicator[i].vector; + pointList.push(this._mapVector(vector, center, scale)); + } + return pointList; + }, + _getShape: function (pointList, brushType, color, strokeColor, lineWidth) { + return new PolygonShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + pointList: pointList, + brushType: brushType, + color: color, + strokeColor: strokeColor, + lineWidth: lineWidth + }, + hoverable: false, + draggable: false + }); + }, + _addSplitArea: function (__ecIndicator, splitArea, scale, scale1, center, colorInd) { + var indLen = __ecIndicator.length; + var color; + var colorArr = splitArea.areaStyle.color; + var colorLen; + var vector; + var vector1; + var pointList = []; + var indLen = __ecIndicator.length; + var shape; + var type = this.deepQuery(this._queryTarget, 'type'); + if (typeof colorArr == 'string') { + colorArr = [colorArr]; + } + colorLen = colorArr.length; + color = colorArr[colorInd % colorLen]; + if (type == 'polygon') { + for (var i = 0; i < indLen; i++) { + pointList = []; + vector = __ecIndicator[i].vector; + vector1 = __ecIndicator[(i + 1) % indLen].vector; + pointList.push(this._mapVector(vector, center, scale)); + pointList.push(this._mapVector(vector, center, scale1)); + pointList.push(this._mapVector(vector1, center, scale1)); + pointList.push(this._mapVector(vector1, center, scale)); + shape = this._getShape(pointList, 'fill', color, '', 1); + this.shapeList.push(shape); + } + } else if (type == 'circle') { + shape = this._getRing(color, scale, scale1, center); + this.shapeList.push(shape); + } + }, + _mapVector: function (vector, center, scale) { + return [ + vector[0] * scale + center[0], + vector[1] * scale + center[1] + ]; + }, + getCenter: function (index) { + var index = index || 0; + return this.parseCenter(this.zr, this.polar[index].center); + }, + _addLine: function (__ecIndicator, center, axisLine) { + var indLen = __ecIndicator.length; + var line; + var vector; + var lineStyle = axisLine.lineStyle; + var strokeColor = lineStyle.color; + var lineWidth = lineStyle.width; + var lineType = lineStyle.type; + for (var i = 0; i < indLen; i++) { + vector = __ecIndicator[i].vector; + line = this._getLine(center[0], center[1], vector[0] + center[0], vector[1] + center[1], strokeColor, lineWidth, lineType); + this.shapeList.push(line); + } + }, + _getLine: function (xStart, yStart, xEnd, yEnd, strokeColor, lineWidth, lineType) { + return new LineShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + xStart: xStart, + yStart: yStart, + xEnd: xEnd, + yEnd: yEnd, + strokeColor: strokeColor, + lineWidth: lineWidth, + lineType: lineType + }, + hoverable: false + }); + }, + _adjustIndicatorValue: function (index) { + var item = this.polar[index]; + var indicator = this.deepQuery(this._queryTarget, 'indicator'); + var len = indicator.length; + var __ecIndicator = item.__ecIndicator; + var max; + var min; + var data = this._getSeriesData(index); + var boundaryGap = item.boundaryGap; + var splitNumber = item.splitNumber; + var scale = item.scale; + var smartSteps = require('../util/smartSteps'); + for (var i = 0; i < len; i++) { + if (typeof indicator[i].max == 'number') { + max = indicator[i].max; + min = indicator[i].min || 0; + } else { + var value = this._findValue(data, i, splitNumber, boundaryGap); + min = value.min; + max = value.max; + } + if (!scale && min >= 0 && max >= 0) { + min = 0; + } + if (!scale && min <= 0 && max <= 0) { + max = 0; + } + var stepOpt = smartSteps(min, max, splitNumber); + __ecIndicator[i].value = { + min: stepOpt.min, + max: stepOpt.max, + step: stepOpt.step + }; + } + }, + _getSeriesData: function (index) { + var data = []; + var serie; + var serieData; + var legend = this.component.legend; + var polarIndex; + for (var i = 0; i < this.series.length; i++) { + serie = this.series[i]; + if (serie.type != ecConfig.CHART_TYPE_RADAR) { + continue; + } + serieData = serie.data || []; + for (var j = 0; j < serieData.length; j++) { + polarIndex = this.deepQuery([ + serieData[j], + serie, + this.option + ], 'polarIndex') || 0; + if (polarIndex == index && (!legend || legend.isSelected(serieData[j].name))) { + data.push(serieData[j]); + } + } + } + return data; + }, + _findValue: function (data, index, splitNumber, boundaryGap) { + var max; + var min; + var one; + if (!data || data.length === 0) { + return; + } + function _compare(item) { + (item > max || max === undefined) && (max = item); + (item < min || min === undefined) && (min = item); + } + if (data.length == 1) { + min = 0; + } + if (data.length != 1) { + for (var i = 0; i < data.length; i++) { + _compare(this.getDataFromOption(data[i].value[index])); + } + } else { + one = data[0]; + for (var i = 0; i < one.value.length; i++) { + _compare(this.getDataFromOption(one.value[i])); + } + } + var gap = Math.abs(max - min); + min = min - Math.abs(gap * boundaryGap[0]); + max = max + Math.abs(gap * boundaryGap[1]); + if (min === max) { + if (max === 0) { + max = 1; + } else if (max > 0) { + min = max / splitNumber; + } else { + max = max / splitNumber; + } + } + return { + max: max, + min: min + }; + }, + getVector: function (polarIndex, indicatorIndex, value) { + polarIndex = polarIndex || 0; + indicatorIndex = indicatorIndex || 0; + var __ecIndicator = this.polar[polarIndex].__ecIndicator; + if (indicatorIndex >= __ecIndicator.length) { + return; + } + var indicator = this.polar[polarIndex].__ecIndicator[indicatorIndex]; + var center = this.getCenter(polarIndex); + var vector = indicator.vector; + var max = indicator.value.max; + var min = indicator.value.min; + var alpha; + if (typeof value == 'undefined') { + return center; + } + switch (value) { + case 'min': + value = min; + break; + case 'max': + value = max; + break; + case 'center': + value = (max + min) / 2; + break; + } + if (max != min) { + alpha = (value - min) / (max - min); + } else { + alpha = 0.5; + } + return this._mapVector(vector, center, alpha); + }, + isInside: function (vector) { + var polar = this.getNearestIndex(vector); + if (polar) { + return polar.polarIndex; + } + return -1; + }, + getNearestIndex: function (vector) { + var item; + var center; + var radius; + var polarVector; + var startAngle; + var indicator; + var len; + var angle; + var finalAngle; + for (var i = 0; i < this.polar.length; i++) { + item = this.polar[i]; + center = this.getCenter(i); + if (vector[0] == center[0] && vector[1] == center[1]) { + return { + polarIndex: i, + valueIndex: 0 + }; + } + radius = this._getRadius(); + startAngle = item.startAngle; + indicator = item.indicator; + len = indicator.length; + angle = 2 * Math.PI / len; + polarVector = ecCoordinates.cartesian2polar(vector[0] - center[0], center[1] - vector[1]); + if (vector[0] - center[0] < 0) { + polarVector[1] += Math.PI; + } + if (polarVector[1] < 0) { + polarVector[1] += 2 * Math.PI; + } + finalAngle = polarVector[1] - startAngle / 180 * Math.PI + Math.PI * 2; + if (Math.abs(Math.cos(finalAngle % (angle / 2))) * radius > polarVector[0]) { + return { + polarIndex: i, + valueIndex: Math.floor((finalAngle + angle / 2) / angle) % len + }; + } + } + }, + getIndicator: function (index) { + var index = index || 0; + return this.polar[index].indicator; + }, + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.polar = this.option.polar; + this.series = this.option.series; + } + this.clear(); + this._buildShape(); + } + }; + zrUtil.inherits(Polar, Base); + require('../component').define('polar', Polar); + return Polar; +});define('echarts/util/coordinates', [ + 'require', + 'zrender/tool/math' +], function (require) { + var zrMath = require('zrender/tool/math'); + function polar2cartesian(r, theta) { + return [ + r * zrMath.sin(theta), + r * zrMath.cos(theta) + ]; + } + function cartesian2polar(x, y) { + return [ + Math.sqrt(x * x + y * y), + Math.atan(y / x) + ]; + } + return { + polar2cartesian: polar2cartesian, + cartesian2polar: cartesian2polar + }; +}); \ No newline at end of file diff --git a/build/source/chart/scatter.js b/build/source/chart/scatter.js new file mode 100644 index 0000000..0271b4e --- /dev/null +++ b/build/source/chart/scatter.js @@ -0,0 +1,1588 @@ +define('echarts/chart/scatter', [ + 'require', + './base', + '../util/shape/Symbol', + '../component/axis', + '../component/grid', + '../component/dataZoom', + '../component/dataRange', + '../config', + 'zrender/tool/util', + 'zrender/tool/color', + '../chart' +], function (require) { + var ChartBase = require('./base'); + var SymbolShape = require('../util/shape/Symbol'); + require('../component/axis'); + require('../component/grid'); + require('../component/dataZoom'); + require('../component/dataRange'); + var ecConfig = require('../config'); + ecConfig.scatter = { + zlevel: 0, + z: 2, + clickable: true, + legendHoverLink: true, + xAxisIndex: 0, + yAxisIndex: 0, + symbolSize: 4, + large: false, + largeThreshold: 2000, + itemStyle: { + normal: { label: { show: false } }, + emphasis: { label: { show: false } } + } + }; + var zrUtil = require('zrender/tool/util'); + var zrColor = require('zrender/tool/color'); + function Scatter(ecTheme, messageCenter, zr, option, myChart) { + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); + this.refresh(option); + } + Scatter.prototype = { + type: ecConfig.CHART_TYPE_SCATTER, + _buildShape: function () { + var series = this.series; + this._sIndex2ColorMap = {}; + this._symbol = this.option.symbolList; + this._sIndex2ShapeMap = {}; + this.selectedMap = {}; + this.xMarkMap = {}; + var legend = this.component.legend; + var seriesArray = []; + var serie; + var serieName; + var iconShape; + var iconType; + for (var i = 0, l = series.length; i < l; i++) { + serie = series[i]; + serieName = serie.name; + if (serie.type === ecConfig.CHART_TYPE_SCATTER) { + series[i] = this.reformOption(series[i]); + this.legendHoverLink = series[i].legendHoverLink || this.legendHoverLink; + this._sIndex2ShapeMap[i] = this.query(serie, 'symbol') || this._symbol[i % this._symbol.length]; + if (legend) { + this.selectedMap[serieName] = legend.isSelected(serieName); + this._sIndex2ColorMap[i] = zrColor.alpha(legend.getColor(serieName), 0.5); + iconShape = legend.getItemShape(serieName); + if (iconShape) { + var iconType = this._sIndex2ShapeMap[i]; + iconShape.style.brushType = iconType.match('empty') ? 'stroke' : 'both'; + iconType = iconType.replace('empty', '').toLowerCase(); + if (iconType.match('rectangle')) { + iconShape.style.x += Math.round((iconShape.style.width - iconShape.style.height) / 2); + iconShape.style.width = iconShape.style.height; + } + if (iconType.match('star')) { + iconShape.style.n = iconType.replace('star', '') - 0 || 5; + iconType = 'star'; + } + if (iconType.match('image')) { + iconShape.style.image = iconType.replace(new RegExp('^image:\\/\\/'), ''); + iconShape.style.x += Math.round((iconShape.style.width - iconShape.style.height) / 2); + iconShape.style.width = iconShape.style.height; + iconType = 'image'; + } + iconShape.style.iconType = iconType; + legend.setItemShape(serieName, iconShape); + } + } else { + this.selectedMap[serieName] = true; + this._sIndex2ColorMap[i] = zrColor.alpha(this.zr.getColor(i), 0.5); + } + if (this.selectedMap[serieName]) { + seriesArray.push(i); + } + } + } + this._buildSeries(seriesArray); + this.addShapeList(); + }, + _buildSeries: function (seriesArray) { + if (seriesArray.length === 0) { + return; + } + var series = this.series; + var seriesIndex; + var serie; + var data; + var value; + var xAxis; + var yAxis; + var pointList = {}; + var x; + var y; + for (var j = 0, k = seriesArray.length; j < k; j++) { + seriesIndex = seriesArray[j]; + serie = series[seriesIndex]; + if (serie.data.length === 0) { + continue; + } + xAxis = this.component.xAxis.getAxis(serie.xAxisIndex || 0); + yAxis = this.component.yAxis.getAxis(serie.yAxisIndex || 0); + pointList[seriesIndex] = []; + for (var i = 0, l = serie.data.length; i < l; i++) { + data = serie.data[i]; + value = this.getDataFromOption(data, '-'); + if (value === '-' || value.length < 2) { + continue; + } + x = xAxis.getCoord(value[0]); + y = yAxis.getCoord(value[1]); + pointList[seriesIndex].push([ + x, + y, + i, + data.name || '' + ]); + } + this.xMarkMap[seriesIndex] = this._markMap(xAxis, yAxis, serie.data, pointList[seriesIndex]); + this.buildMark(seriesIndex); + } + this._buildPointList(pointList); + }, + _markMap: function (xAxis, yAxis, data, pointList) { + var xMarkMap = { + min0: Number.POSITIVE_INFINITY, + max0: Number.NEGATIVE_INFINITY, + sum0: 0, + counter0: 0, + average0: 0, + min1: Number.POSITIVE_INFINITY, + max1: Number.NEGATIVE_INFINITY, + sum1: 0, + counter1: 0, + average1: 0 + }; + var value; + for (var i = 0, l = pointList.length; i < l; i++) { + value = data[pointList[i][2]].value || data[pointList[i][2]]; + if (xMarkMap.min0 > value[0]) { + xMarkMap.min0 = value[0]; + xMarkMap.minY0 = pointList[i][1]; + xMarkMap.minX0 = pointList[i][0]; + } + if (xMarkMap.max0 < value[0]) { + xMarkMap.max0 = value[0]; + xMarkMap.maxY0 = pointList[i][1]; + xMarkMap.maxX0 = pointList[i][0]; + } + xMarkMap.sum0 += value[0]; + xMarkMap.counter0++; + if (xMarkMap.min1 > value[1]) { + xMarkMap.min1 = value[1]; + xMarkMap.minY1 = pointList[i][1]; + xMarkMap.minX1 = pointList[i][0]; + } + if (xMarkMap.max1 < value[1]) { + xMarkMap.max1 = value[1]; + xMarkMap.maxY1 = pointList[i][1]; + xMarkMap.maxX1 = pointList[i][0]; + } + xMarkMap.sum1 += value[1]; + xMarkMap.counter1++; + } + var gridX = this.component.grid.getX(); + var gridXend = this.component.grid.getXend(); + var gridY = this.component.grid.getY(); + var gridYend = this.component.grid.getYend(); + xMarkMap.average0 = xMarkMap.sum0 / xMarkMap.counter0; + var x = xAxis.getCoord(xMarkMap.average0); + xMarkMap.averageLine0 = [ + [ + x, + gridYend + ], + [ + x, + gridY + ] + ]; + xMarkMap.minLine0 = [ + [ + xMarkMap.minX0, + gridYend + ], + [ + xMarkMap.minX0, + gridY + ] + ]; + xMarkMap.maxLine0 = [ + [ + xMarkMap.maxX0, + gridYend + ], + [ + xMarkMap.maxX0, + gridY + ] + ]; + xMarkMap.average1 = xMarkMap.sum1 / xMarkMap.counter1; + var y = yAxis.getCoord(xMarkMap.average1); + xMarkMap.averageLine1 = [ + [ + gridX, + y + ], + [ + gridXend, + y + ] + ]; + xMarkMap.minLine1 = [ + [ + gridX, + xMarkMap.minY1 + ], + [ + gridXend, + xMarkMap.minY1 + ] + ]; + xMarkMap.maxLine1 = [ + [ + gridX, + xMarkMap.maxY1 + ], + [ + gridXend, + xMarkMap.maxY1 + ] + ]; + return xMarkMap; + }, + _buildPointList: function (pointList) { + var series = this.series; + var serie; + var seriesPL; + var singlePoint; + var shape; + for (var seriesIndex in pointList) { + serie = series[seriesIndex]; + seriesPL = pointList[seriesIndex]; + if (serie.large && serie.data.length > serie.largeThreshold) { + this.shapeList.push(this._getLargeSymbol(seriesPL, this.getItemStyleColor(this.query(serie, 'itemStyle.normal.color'), seriesIndex, -1) || this._sIndex2ColorMap[seriesIndex])); + continue; + } + for (var i = 0, l = seriesPL.length; i < l; i++) { + singlePoint = seriesPL[i]; + shape = this._getSymbol(seriesIndex, singlePoint[2], singlePoint[3], singlePoint[0], singlePoint[1]); + shape && this.shapeList.push(shape); + } + } + }, + _getSymbol: function (seriesIndex, dataIndex, name, x, y) { + var series = this.series; + var serie = series[seriesIndex]; + var data = serie.data[dataIndex]; + var dataRange = this.component.dataRange; + var rangColor; + if (dataRange) { + rangColor = isNaN(data[2]) ? this._sIndex2ColorMap[seriesIndex] : dataRange.getColor(data[2]); + if (!rangColor) { + return null; + } + } else { + rangColor = this._sIndex2ColorMap[seriesIndex]; + } + var itemShape = this.getSymbolShape(serie, seriesIndex, data, dataIndex, name, x, y, this._sIndex2ShapeMap[seriesIndex], rangColor, 'rgba(0,0,0,0)', 'vertical'); + itemShape.zlevel = this.getZlevelBase(); + itemShape.z = this.getZBase(); + itemShape._main = true; + return itemShape; + }, + _getLargeSymbol: function (pointList, nColor) { + return new SymbolShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + _main: true, + hoverable: false, + style: { + pointList: pointList, + color: nColor, + strokeColor: nColor + }, + highlightStyle: { pointList: [] } + }); + }, + getMarkCoord: function (seriesIndex, mpData) { + var serie = this.series[seriesIndex]; + var xMarkMap = this.xMarkMap[seriesIndex]; + var xAxis = this.component.xAxis.getAxis(serie.xAxisIndex); + var yAxis = this.component.yAxis.getAxis(serie.yAxisIndex); + var pos; + if (mpData.type && (mpData.type === 'max' || mpData.type === 'min' || mpData.type === 'average')) { + var valueIndex = mpData.valueIndex != null ? mpData.valueIndex : 1; + pos = [ + xMarkMap[mpData.type + 'X' + valueIndex], + xMarkMap[mpData.type + 'Y' + valueIndex], + xMarkMap[mpData.type + 'Line' + valueIndex], + xMarkMap[mpData.type + valueIndex] + ]; + } else { + pos = [ + typeof mpData.xAxis != 'string' && xAxis.getCoordByIndex ? xAxis.getCoordByIndex(mpData.xAxis || 0) : xAxis.getCoord(mpData.xAxis || 0), + typeof mpData.yAxis != 'string' && yAxis.getCoordByIndex ? yAxis.getCoordByIndex(mpData.yAxis || 0) : yAxis.getCoord(mpData.yAxis || 0) + ]; + } + return pos; + }, + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + this.backupShapeList(); + this._buildShape(); + }, + ondataRange: function (param, status) { + if (this.component.dataRange) { + this.refresh(); + status.needRefresh = true; + } + return; + } + }; + zrUtil.inherits(Scatter, ChartBase); + require('../chart').define('scatter', Scatter); + return Scatter; +});define('echarts/component/dataRange', [ + 'require', + './base', + 'zrender/shape/Text', + 'zrender/shape/Rectangle', + '../util/shape/HandlePolygon', + '../config', + 'zrender/tool/util', + 'zrender/tool/event', + 'zrender/tool/area', + 'zrender/tool/color', + '../component' +], function (require) { + var Base = require('./base'); + var TextShape = require('zrender/shape/Text'); + var RectangleShape = require('zrender/shape/Rectangle'); + var HandlePolygonShape = require('../util/shape/HandlePolygon'); + var ecConfig = require('../config'); + ecConfig.dataRange = { + zlevel: 0, + z: 4, + show: true, + orient: 'vertical', + x: 'left', + y: 'bottom', + backgroundColor: 'rgba(0,0,0,0)', + borderColor: '#ccc', + borderWidth: 0, + padding: 5, + itemGap: 10, + itemWidth: 20, + itemHeight: 14, + precision: 0, + splitNumber: 5, + calculable: false, + selectedMode: true, + hoverLink: true, + realtime: true, + color: [ + '#006edd', + '#e0ffff' + ], + textStyle: { color: '#333' } + }; + var zrUtil = require('zrender/tool/util'); + var zrEvent = require('zrender/tool/event'); + var zrArea = require('zrender/tool/area'); + var zrColor = require('zrender/tool/color'); + function DataRange(ecTheme, messageCenter, zr, option, myChart) { + if (typeof this.query(option, 'dataRange.min') == 'undefined' || typeof this.query(option, 'dataRange.max') == 'undefined') { + console.error('option.dataRange.min or option.dataRange.max has not been defined.'); + return; + } + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + var self = this; + self._ondrift = function (dx, dy) { + return self.__ondrift(this, dx, dy); + }; + self._ondragend = function () { + return self.__ondragend(); + }; + self._dataRangeSelected = function (param) { + return self.__dataRangeSelected(param); + }; + self._dispatchHoverLink = function (param) { + return self.__dispatchHoverLink(param); + }; + self._onhoverlink = function (params) { + return self.__onhoverlink(params); + }; + this._selectedMap = {}; + this._range = {}; + this.refresh(option); + messageCenter.bind(ecConfig.EVENT.HOVER, this._onhoverlink); + } + DataRange.prototype = { + type: ecConfig.COMPONENT_TYPE_DATARANGE, + _textGap: 10, + _buildShape: function () { + this._itemGroupLocation = this._getItemGroupLocation(); + this._buildBackground(); + if (this.dataRangeOption.splitNumber <= 0 || this.dataRangeOption.calculable) { + this._buildGradient(); + } else { + this._buildItem(); + } + if (this.dataRangeOption.show) { + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + } + this._syncShapeFromRange(); + }, + _buildItem: function () { + var data = this._valueTextList; + var dataLength = data.length; + var itemName; + var itemShape; + var textShape; + var font = this.getFont(this.dataRangeOption.textStyle); + var lastX = this._itemGroupLocation.x; + var lastY = this._itemGroupLocation.y; + var itemWidth = this.dataRangeOption.itemWidth; + var itemHeight = this.dataRangeOption.itemHeight; + var itemGap = this.dataRangeOption.itemGap; + var textHeight = zrArea.getTextHeight('国', font); + var color; + if (this.dataRangeOption.orient == 'vertical' && this.dataRangeOption.x == 'right') { + lastX = this._itemGroupLocation.x + this._itemGroupLocation.width - itemWidth; + } + var needValueText = true; + if (this.dataRangeOption.text) { + needValueText = false; + if (this.dataRangeOption.text[0]) { + textShape = this._getTextShape(lastX, lastY, this.dataRangeOption.text[0]); + if (this.dataRangeOption.orient == 'horizontal') { + lastX += zrArea.getTextWidth(this.dataRangeOption.text[0], font) + this._textGap; + } else { + lastY += textHeight + this._textGap; + textShape.style.y += textHeight / 2 + this._textGap; + textShape.style.textBaseline = 'bottom'; + } + this.shapeList.push(new TextShape(textShape)); + } + } + for (var i = 0; i < dataLength; i++) { + itemName = data[i]; + color = this.getColorByIndex(i); + itemShape = this._getItemShape(lastX, lastY, itemWidth, itemHeight, this._selectedMap[i] ? color : '#ccc'); + itemShape._idx = i; + itemShape.onmousemove = this._dispatchHoverLink; + if (this.dataRangeOption.selectedMode) { + itemShape.clickable = true; + itemShape.onclick = this._dataRangeSelected; + } + this.shapeList.push(new RectangleShape(itemShape)); + if (needValueText) { + textShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: lastX + itemWidth + 5, + y: lastY, + color: this._selectedMap[i] ? this.dataRangeOption.textStyle.color : '#ccc', + text: data[i], + textFont: font, + textBaseline: 'top' + }, + highlightStyle: { brushType: 'fill' } + }; + if (this.dataRangeOption.orient == 'vertical' && this.dataRangeOption.x == 'right') { + textShape.style.x -= itemWidth + 10; + textShape.style.textAlign = 'right'; + } + textShape._idx = i; + textShape.onmousemove = this._dispatchHoverLink; + if (this.dataRangeOption.selectedMode) { + textShape.clickable = true; + textShape.onclick = this._dataRangeSelected; + } + this.shapeList.push(new TextShape(textShape)); + } + if (this.dataRangeOption.orient == 'horizontal') { + lastX += itemWidth + (needValueText ? 5 : 0) + (needValueText ? zrArea.getTextWidth(itemName, font) : 0) + itemGap; + } else { + lastY += itemHeight + itemGap; + } + } + if (!needValueText && this.dataRangeOption.text[1]) { + if (this.dataRangeOption.orient == 'horizontal') { + lastX = lastX - itemGap + this._textGap; + } else { + lastY = lastY - itemGap + this._textGap; + } + textShape = this._getTextShape(lastX, lastY, this.dataRangeOption.text[1]); + if (this.dataRangeOption.orient != 'horizontal') { + textShape.style.y -= 5; + textShape.style.textBaseline = 'top'; + } + this.shapeList.push(new TextShape(textShape)); + } + }, + _buildGradient: function () { + var itemShape; + var textShape; + var font = this.getFont(this.dataRangeOption.textStyle); + var lastX = this._itemGroupLocation.x; + var lastY = this._itemGroupLocation.y; + var itemWidth = this.dataRangeOption.itemWidth; + var itemHeight = this.dataRangeOption.itemHeight; + var textHeight = zrArea.getTextHeight('国', font); + var mSize = 10; + var needValueText = true; + if (this.dataRangeOption.text) { + needValueText = false; + if (this.dataRangeOption.text[0]) { + textShape = this._getTextShape(lastX, lastY, this.dataRangeOption.text[0]); + if (this.dataRangeOption.orient == 'horizontal') { + lastX += zrArea.getTextWidth(this.dataRangeOption.text[0], font) + this._textGap; + } else { + lastY += textHeight + this._textGap; + textShape.style.y += textHeight / 2 + this._textGap; + textShape.style.textBaseline = 'bottom'; + } + this.shapeList.push(new TextShape(textShape)); + } + } + var zrColor = require('zrender/tool/color'); + var per = 1 / (this.dataRangeOption.color.length - 1); + var colorList = []; + for (var i = 0, l = this.dataRangeOption.color.length; i < l; i++) { + colorList.push([ + i * per, + this.dataRangeOption.color[i] + ]); + } + if (this.dataRangeOption.orient == 'horizontal') { + itemShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: lastX, + y: lastY, + width: itemWidth * mSize, + height: itemHeight, + color: zrColor.getLinearGradient(lastX, lastY, lastX + itemWidth * mSize, lastY, colorList) + }, + hoverable: false + }; + lastX += itemWidth * mSize + this._textGap; + } else { + itemShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: lastX, + y: lastY, + width: itemWidth, + height: itemHeight * mSize, + color: zrColor.getLinearGradient(lastX, lastY, lastX, lastY + itemHeight * mSize, colorList) + }, + hoverable: false + }; + lastY += itemHeight * mSize + this._textGap; + } + this.shapeList.push(new RectangleShape(itemShape)); + this._calculableLocation = itemShape.style; + if (this.dataRangeOption.calculable) { + this._buildFiller(); + this._bulidMask(); + this._bulidHandle(); + } + this._buildIndicator(); + if (!needValueText && this.dataRangeOption.text[1]) { + textShape = this._getTextShape(lastX, lastY, this.dataRangeOption.text[1]); + this.shapeList.push(new TextShape(textShape)); + } + }, + _buildIndicator: function () { + var x = this._calculableLocation.x; + var y = this._calculableLocation.y; + var width = this._calculableLocation.width; + var height = this._calculableLocation.height; + var size = 5; + var pointList; + var textPosition; + if (this.dataRangeOption.orient == 'horizontal') { + if (this.dataRangeOption.y != 'bottom') { + pointList = [ + [ + x, + y + height + ], + [ + x - size, + y + height + size + ], + [ + x + size, + y + height + size + ] + ]; + textPosition = 'bottom'; + } else { + pointList = [ + [ + x, + y + ], + [ + x - size, + y - size + ], + [ + x + size, + y - size + ] + ]; + textPosition = 'top'; + } + } else { + if (this.dataRangeOption.x != 'right') { + pointList = [ + [ + x + width, + y + ], + [ + x + width + size, + y - size + ], + [ + x + width + size, + y + size + ] + ]; + textPosition = 'right'; + } else { + pointList = [ + [ + x, + y + ], + [ + x - size, + y - size + ], + [ + x - size, + y + size + ] + ]; + textPosition = 'left'; + } + } + this._indicatorShape = { + style: { + pointList: pointList, + color: '#fff', + __rect: { + x: Math.min(pointList[0][0], pointList[1][0]), + y: Math.min(pointList[0][1], pointList[1][1]), + width: size * (this.dataRangeOption.orient == 'horizontal' ? 2 : 1), + height: size * (this.dataRangeOption.orient == 'horizontal' ? 1 : 2) + } + }, + highlightStyle: { + brushType: 'fill', + textPosition: textPosition, + textColor: this.dataRangeOption.textStyle.color + }, + hoverable: false + }; + this._indicatorShape = new HandlePolygonShape(this._indicatorShape); + }, + _buildFiller: function () { + this._fillerShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + style: { + x: this._calculableLocation.x, + y: this._calculableLocation.y, + width: this._calculableLocation.width, + height: this._calculableLocation.height, + color: 'rgba(255,255,255,0)' + }, + highlightStyle: { + strokeColor: 'rgba(255,255,255,0.5)', + lineWidth: 1 + }, + draggable: true, + ondrift: this._ondrift, + ondragend: this._ondragend, + onmousemove: this._dispatchHoverLink, + _type: 'filler' + }; + this._fillerShape = new RectangleShape(this._fillerShape); + this.shapeList.push(this._fillerShape); + }, + _bulidHandle: function () { + var x = this._calculableLocation.x; + var y = this._calculableLocation.y; + var width = this._calculableLocation.width; + var height = this._calculableLocation.height; + var font = this.getFont(this.dataRangeOption.textStyle); + var textHeight = zrArea.getTextHeight('国', font); + var textWidth = Math.max(zrArea.getTextWidth(this._textFormat(this.dataRangeOption.max), font), zrArea.getTextWidth(this._textFormat(this.dataRangeOption.min), font)) + 2; + var pointListStart; + var textXStart; + var textYStart; + var coverRectStart; + var pointListEnd; + var textXEnd; + var textYEnd; + var coverRectEnd; + if (this.dataRangeOption.orient == 'horizontal') { + if (this.dataRangeOption.y != 'bottom') { + pointListStart = [ + [ + x, + y + ], + [ + x, + y + height + textHeight + ], + [ + x - textHeight, + y + height + textHeight + ], + [ + x - 1, + y + height + ], + [ + x - 1, + y + ] + ]; + textXStart = x - textWidth / 2 - textHeight; + textYStart = y + height + textHeight / 2 + 2; + coverRectStart = { + x: x - textWidth - textHeight, + y: y + height, + width: textWidth + textHeight, + height: textHeight + }; + pointListEnd = [ + [ + x + width, + y + ], + [ + x + width, + y + height + textHeight + ], + [ + x + width + textHeight, + y + height + textHeight + ], + [ + x + width + 1, + y + height + ], + [ + x + width + 1, + y + ] + ]; + textXEnd = x + width + textWidth / 2 + textHeight; + textYEnd = textYStart; + coverRectEnd = { + x: x + width, + y: y + height, + width: textWidth + textHeight, + height: textHeight + }; + } else { + pointListStart = [ + [ + x, + y + height + ], + [ + x, + y - textHeight + ], + [ + x - textHeight, + y - textHeight + ], + [ + x - 1, + y + ], + [ + x - 1, + y + height + ] + ]; + textXStart = x - textWidth / 2 - textHeight; + textYStart = y - textHeight / 2 - 2; + coverRectStart = { + x: x - textWidth - textHeight, + y: y - textHeight, + width: textWidth + textHeight, + height: textHeight + }; + pointListEnd = [ + [ + x + width, + y + height + ], + [ + x + width, + y - textHeight + ], + [ + x + width + textHeight, + y - textHeight + ], + [ + x + width + 1, + y + ], + [ + x + width + 1, + y + height + ] + ]; + textXEnd = x + width + textWidth / 2 + textHeight; + textYEnd = textYStart; + coverRectEnd = { + x: x + width, + y: y - textHeight, + width: textWidth + textHeight, + height: textHeight + }; + } + } else { + textWidth += textHeight; + if (this.dataRangeOption.x != 'right') { + pointListStart = [ + [ + x, + y + ], + [ + x + width + textHeight, + y + ], + [ + x + width + textHeight, + y - textHeight + ], + [ + x + width, + y - 1 + ], + [ + x, + y - 1 + ] + ]; + textXStart = x + width + textWidth / 2 + textHeight / 2; + textYStart = y - textHeight / 2; + coverRectStart = { + x: x + width, + y: y - textHeight, + width: textWidth + textHeight, + height: textHeight + }; + pointListEnd = [ + [ + x, + y + height + ], + [ + x + width + textHeight, + y + height + ], + [ + x + width + textHeight, + y + textHeight + height + ], + [ + x + width, + y + 1 + height + ], + [ + x, + y + height + 1 + ] + ]; + textXEnd = textXStart; + textYEnd = y + height + textHeight / 2; + coverRectEnd = { + x: x + width, + y: y + height, + width: textWidth + textHeight, + height: textHeight + }; + } else { + pointListStart = [ + [ + x + width, + y + ], + [ + x - textHeight, + y + ], + [ + x - textHeight, + y - textHeight + ], + [ + x, + y - 1 + ], + [ + x + width, + y - 1 + ] + ]; + textXStart = x - textWidth / 2 - textHeight / 2; + textYStart = y - textHeight / 2; + coverRectStart = { + x: x - textWidth - textHeight, + y: y - textHeight, + width: textWidth + textHeight, + height: textHeight + }; + pointListEnd = [ + [ + x + width, + y + height + ], + [ + x - textHeight, + y + height + ], + [ + x - textHeight, + y + textHeight + height + ], + [ + x, + y + 1 + height + ], + [ + x + width, + y + height + 1 + ] + ]; + textXEnd = textXStart; + textYEnd = y + height + textHeight / 2; + coverRectEnd = { + x: x - textWidth - textHeight, + y: y + height, + width: textWidth + textHeight, + height: textHeight + }; + } + } + this._startShape = { + style: { + pointList: pointListStart, + text: this._textFormat(this.dataRangeOption.max), + textX: textXStart, + textY: textYStart, + textFont: font, + color: this.getColor(this.dataRangeOption.max), + rect: coverRectStart, + x: pointListStart[0][0], + y: pointListStart[0][1], + _x: pointListStart[0][0], + _y: pointListStart[0][1] + } + }; + this._startShape.highlightStyle = { + strokeColor: this._startShape.style.color, + lineWidth: 1 + }; + this._endShape = { + style: { + pointList: pointListEnd, + text: this._textFormat(this.dataRangeOption.min), + textX: textXEnd, + textY: textYEnd, + textFont: font, + color: this.getColor(this.dataRangeOption.min), + rect: coverRectEnd, + x: pointListEnd[0][0], + y: pointListEnd[0][1], + _x: pointListEnd[0][0], + _y: pointListEnd[0][1] + } + }; + this._endShape.highlightStyle = { + strokeColor: this._endShape.style.color, + lineWidth: 1 + }; + this._startShape.zlevel = this._endShape.zlevel = this.getZlevelBase(); + this._startShape.z = this._endShape.z = this.getZBase() + 1; + this._startShape.draggable = this._endShape.draggable = true; + this._startShape.ondrift = this._endShape.ondrift = this._ondrift; + this._startShape.ondragend = this._endShape.ondragend = this._ondragend; + this._startShape.style.textColor = this._endShape.style.textColor = this.dataRangeOption.textStyle.color; + this._startShape.style.textAlign = this._endShape.style.textAlign = 'center'; + this._startShape.style.textPosition = this._endShape.style.textPosition = 'specific'; + this._startShape.style.textBaseline = this._endShape.style.textBaseline = 'middle'; + this._startShape.style.width = this._endShape.style.width = 0; + this._startShape.style.height = this._endShape.style.height = 0; + this._startShape.style.textPosition = this._endShape.style.textPosition = 'specific'; + this._startShape = new HandlePolygonShape(this._startShape); + this._endShape = new HandlePolygonShape(this._endShape); + this.shapeList.push(this._startShape); + this.shapeList.push(this._endShape); + }, + _bulidMask: function () { + var x = this._calculableLocation.x; + var y = this._calculableLocation.y; + var width = this._calculableLocation.width; + var height = this._calculableLocation.height; + this._startMask = { + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + style: { + x: x, + y: y, + width: this.dataRangeOption.orient == 'horizontal' ? 0 : width, + height: this.dataRangeOption.orient == 'horizontal' ? height : 0, + color: '#ccc' + }, + hoverable: false + }; + this._endMask = { + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + style: { + x: this.dataRangeOption.orient == 'horizontal' ? x + width : x, + y: this.dataRangeOption.orient == 'horizontal' ? y : y + height, + width: this.dataRangeOption.orient == 'horizontal' ? 0 : width, + height: this.dataRangeOption.orient == 'horizontal' ? height : 0, + color: '#ccc' + }, + hoverable: false + }; + this._startMask = new RectangleShape(this._startMask); + this._endMask = new RectangleShape(this._endMask); + this.shapeList.push(this._startMask); + this.shapeList.push(this._endMask); + }, + _buildBackground: function () { + var padding = this.reformCssArray(this.dataRangeOption.padding); + this.shapeList.push(new RectangleShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: this._itemGroupLocation.x - padding[3], + y: this._itemGroupLocation.y - padding[0], + width: this._itemGroupLocation.width + padding[3] + padding[1], + height: this._itemGroupLocation.height + padding[0] + padding[2], + brushType: this.dataRangeOption.borderWidth === 0 ? 'fill' : 'both', + color: this.dataRangeOption.backgroundColor, + strokeColor: this.dataRangeOption.borderColor, + lineWidth: this.dataRangeOption.borderWidth + } + })); + }, + _getItemGroupLocation: function () { + var data = this._valueTextList; + var dataLength = data.length; + var itemGap = this.dataRangeOption.itemGap; + var itemWidth = this.dataRangeOption.itemWidth; + var itemHeight = this.dataRangeOption.itemHeight; + var totalWidth = 0; + var totalHeight = 0; + var font = this.getFont(this.dataRangeOption.textStyle); + var textHeight = zrArea.getTextHeight('国', font); + var mSize = 10; + if (this.dataRangeOption.orient == 'horizontal') { + if (this.dataRangeOption.text || this.dataRangeOption.splitNumber <= 0 || this.dataRangeOption.calculable) { + totalWidth = (this.dataRangeOption.splitNumber <= 0 || this.dataRangeOption.calculable ? itemWidth * mSize + itemGap : dataLength * (itemWidth + itemGap)) + (this.dataRangeOption.text && typeof this.dataRangeOption.text[0] != 'undefined' ? zrArea.getTextWidth(this.dataRangeOption.text[0], font) + this._textGap : 0) + (this.dataRangeOption.text && typeof this.dataRangeOption.text[1] != 'undefined' ? zrArea.getTextWidth(this.dataRangeOption.text[1], font) + this._textGap : 0); + } else { + itemWidth += 5; + for (var i = 0; i < dataLength; i++) { + totalWidth += itemWidth + zrArea.getTextWidth(data[i], font) + itemGap; + } + } + totalWidth -= itemGap; + totalHeight = Math.max(textHeight, itemHeight); + } else { + var maxWidth; + if (this.dataRangeOption.text || this.dataRangeOption.splitNumber <= 0 || this.dataRangeOption.calculable) { + totalHeight = (this.dataRangeOption.splitNumber <= 0 || this.dataRangeOption.calculable ? itemHeight * mSize + itemGap : dataLength * (itemHeight + itemGap)) + (this.dataRangeOption.text && typeof this.dataRangeOption.text[0] != 'undefined' ? this._textGap + textHeight : 0) + (this.dataRangeOption.text && typeof this.dataRangeOption.text[1] != 'undefined' ? this._textGap + textHeight : 0); + maxWidth = Math.max(zrArea.getTextWidth(this.dataRangeOption.text && this.dataRangeOption.text[0] || '', font), zrArea.getTextWidth(this.dataRangeOption.text && this.dataRangeOption.text[1] || '', font)); + totalWidth = Math.max(itemWidth, maxWidth); + } else { + totalHeight = (itemHeight + itemGap) * dataLength; + itemWidth += 5; + maxWidth = 0; + for (var i = 0; i < dataLength; i++) { + maxWidth = Math.max(maxWidth, zrArea.getTextWidth(data[i], font)); + } + totalWidth = itemWidth + maxWidth; + } + totalHeight -= itemGap; + } + var padding = this.reformCssArray(this.dataRangeOption.padding); + var x; + var zrWidth = this.zr.getWidth(); + switch (this.dataRangeOption.x) { + case 'center': + x = Math.floor((zrWidth - totalWidth) / 2); + break; + case 'left': + x = padding[3] + this.dataRangeOption.borderWidth; + break; + case 'right': + x = zrWidth - totalWidth - padding[1] - this.dataRangeOption.borderWidth; + break; + default: + x = this.parsePercent(this.dataRangeOption.x, zrWidth); + x = isNaN(x) ? 0 : x; + break; + } + var y; + var zrHeight = this.zr.getHeight(); + switch (this.dataRangeOption.y) { + case 'top': + y = padding[0] + this.dataRangeOption.borderWidth; + break; + case 'bottom': + y = zrHeight - totalHeight - padding[2] - this.dataRangeOption.borderWidth; + break; + case 'center': + y = Math.floor((zrHeight - totalHeight) / 2); + break; + default: + y = this.parsePercent(this.dataRangeOption.y, zrHeight); + y = isNaN(y) ? 0 : y; + break; + } + if (this.dataRangeOption.calculable) { + var handlerWidth = Math.max(zrArea.getTextWidth(this.dataRangeOption.max, font), zrArea.getTextWidth(this.dataRangeOption.min, font)) + textHeight; + if (this.dataRangeOption.orient == 'horizontal') { + if (x < handlerWidth) { + x = handlerWidth; + } + if (x + totalWidth + handlerWidth > zrWidth) { + x -= handlerWidth; + } + } else { + if (y < textHeight) { + y = textHeight; + } + if (y + totalHeight + textHeight > zrHeight) { + y -= textHeight; + } + } + } + return { + x: x, + y: y, + width: totalWidth, + height: totalHeight + }; + }, + _getTextShape: function (x, y, text) { + return { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: this.dataRangeOption.orient == 'horizontal' ? x : this._itemGroupLocation.x + this._itemGroupLocation.width / 2, + y: this.dataRangeOption.orient == 'horizontal' ? this._itemGroupLocation.y + this._itemGroupLocation.height / 2 : y, + color: this.dataRangeOption.textStyle.color, + text: text, + textFont: this.getFont(this.dataRangeOption.textStyle), + textBaseline: this.dataRangeOption.orient == 'horizontal' ? 'middle' : 'top', + textAlign: this.dataRangeOption.orient == 'horizontal' ? 'left' : 'center' + }, + hoverable: false + }; + }, + _getItemShape: function (x, y, width, height, color) { + return { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: x, + y: y + 1, + width: width, + height: height - 2, + color: color + }, + highlightStyle: { + strokeColor: color, + lineWidth: 1 + } + }; + }, + __ondrift: function (shape, dx, dy) { + var x = this._calculableLocation.x; + var y = this._calculableLocation.y; + var width = this._calculableLocation.width; + var height = this._calculableLocation.height; + if (this.dataRangeOption.orient == 'horizontal') { + if (shape.style.x + dx <= x) { + shape.style.x = x; + } else if (shape.style.x + dx + shape.style.width >= x + width) { + shape.style.x = x + width - shape.style.width; + } else { + shape.style.x += dx; + } + } else { + if (shape.style.y + dy <= y) { + shape.style.y = y; + } else if (shape.style.y + dy + shape.style.height >= y + height) { + shape.style.y = y + height - shape.style.height; + } else { + shape.style.y += dy; + } + } + if (shape._type == 'filler') { + this._syncHandleShape(); + } else { + this._syncFillerShape(shape); + } + if (this.dataRangeOption.realtime) { + this._dispatchDataRange(); + } + return true; + }, + __ondragend: function () { + this.isDragend = true; + }, + ondragend: function (param, status) { + if (!this.isDragend || !param.target) { + return; + } + status.dragOut = true; + status.dragIn = true; + if (!this.dataRangeOption.realtime) { + this._dispatchDataRange(); + } + status.needRefresh = false; + this.isDragend = false; + return; + }, + _syncShapeFromRange: function () { + var range = this.dataRangeOption.range || {}; + this._range.end = typeof this._range.end != 'undefined' ? this._range.end : typeof range.start != 'undefined' ? range.start : 0; + this._range.start = typeof this._range.start != 'undefined' ? this._range.start : typeof range.end != 'undefined' ? range.end : 100; + if (this._range.start != 100 || this._range.end !== 0) { + if (this.dataRangeOption.orient == 'horizontal') { + var width = this._fillerShape.style.width; + this._fillerShape.style.x += width * (100 - this._range.start) / 100; + this._fillerShape.style.width = width * (this._range.start - this._range.end) / 100; + } else { + var height = this._fillerShape.style.height; + this._fillerShape.style.y += height * (100 - this._range.start) / 100; + this._fillerShape.style.height = height * (this._range.start - this._range.end) / 100; + } + this.zr.modShape(this._fillerShape.id); + this._syncHandleShape(); + } + }, + _syncHandleShape: function () { + var x = this._calculableLocation.x; + var y = this._calculableLocation.y; + var width = this._calculableLocation.width; + var height = this._calculableLocation.height; + if (this.dataRangeOption.orient == 'horizontal') { + this._startShape.style.x = this._fillerShape.style.x; + this._startMask.style.width = this._startShape.style.x - x; + this._endShape.style.x = this._fillerShape.style.x + this._fillerShape.style.width; + this._endMask.style.x = this._endShape.style.x; + this._endMask.style.width = x + width - this._endShape.style.x; + this._range.start = Math.ceil(100 - (this._startShape.style.x - x) / width * 100); + this._range.end = Math.floor(100 - (this._endShape.style.x - x) / width * 100); + } else { + this._startShape.style.y = this._fillerShape.style.y; + this._startMask.style.height = this._startShape.style.y - y; + this._endShape.style.y = this._fillerShape.style.y + this._fillerShape.style.height; + this._endMask.style.y = this._endShape.style.y; + this._endMask.style.height = y + height - this._endShape.style.y; + this._range.start = Math.ceil(100 - (this._startShape.style.y - y) / height * 100); + this._range.end = Math.floor(100 - (this._endShape.style.y - y) / height * 100); + } + this._syncShape(); + }, + _syncFillerShape: function (e) { + var x = this._calculableLocation.x; + var y = this._calculableLocation.y; + var width = this._calculableLocation.width; + var height = this._calculableLocation.height; + var a; + var b; + if (this.dataRangeOption.orient == 'horizontal') { + a = this._startShape.style.x; + b = this._endShape.style.x; + if (e.id == this._startShape.id && a >= b) { + b = a; + this._endShape.style.x = a; + } else if (e.id == this._endShape.id && a >= b) { + a = b; + this._startShape.style.x = a; + } + this._fillerShape.style.x = a; + this._fillerShape.style.width = b - a; + this._startMask.style.width = a - x; + this._endMask.style.x = b; + this._endMask.style.width = x + width - b; + this._range.start = Math.ceil(100 - (a - x) / width * 100); + this._range.end = Math.floor(100 - (b - x) / width * 100); + } else { + a = this._startShape.style.y; + b = this._endShape.style.y; + if (e.id == this._startShape.id && a >= b) { + b = a; + this._endShape.style.y = a; + } else if (e.id == this._endShape.id && a >= b) { + a = b; + this._startShape.style.y = a; + } + this._fillerShape.style.y = a; + this._fillerShape.style.height = b - a; + this._startMask.style.height = a - y; + this._endMask.style.y = b; + this._endMask.style.height = y + height - b; + this._range.start = Math.ceil(100 - (a - y) / height * 100); + this._range.end = Math.floor(100 - (b - y) / height * 100); + } + this._syncShape(); + }, + _syncShape: function () { + this._startShape.position = [ + this._startShape.style.x - this._startShape.style._x, + this._startShape.style.y - this._startShape.style._y + ]; + this._startShape.style.text = this._textFormat(this._gap * this._range.start + this.dataRangeOption.min); + this._startShape.style.color = this._startShape.highlightStyle.strokeColor = this.getColor(this._gap * this._range.start + this.dataRangeOption.min); + this._endShape.position = [ + this._endShape.style.x - this._endShape.style._x, + this._endShape.style.y - this._endShape.style._y + ]; + this._endShape.style.text = this._textFormat(this._gap * this._range.end + this.dataRangeOption.min); + this._endShape.style.color = this._endShape.highlightStyle.strokeColor = this.getColor(this._gap * this._range.end + this.dataRangeOption.min); + this.zr.modShape(this._startShape.id); + this.zr.modShape(this._endShape.id); + this.zr.modShape(this._startMask.id); + this.zr.modShape(this._endMask.id); + this.zr.modShape(this._fillerShape.id); + this.zr.refreshNextFrame(); + }, + _dispatchDataRange: function () { + this.messageCenter.dispatch(ecConfig.EVENT.DATA_RANGE, null, { + range: { + start: this._range.end, + end: this._range.start + } + }, this.myChart); + }, + __dataRangeSelected: function (param) { + if (this.dataRangeOption.selectedMode === 'single') { + for (var k in this._selectedMap) { + this._selectedMap[k] = false; + } + } + var idx = param.target._idx; + this._selectedMap[idx] = !this._selectedMap[idx]; + var valueMax = (this._colorList.length - idx) * this._gap + this.dataRangeOption.min; + this.messageCenter.dispatch(ecConfig.EVENT.DATA_RANGE_SELECTED, param.event, { + selected: this._selectedMap, + target: idx, + valueMax: valueMax, + valueMin: valueMax - this._gap + }, this.myChart); + this.messageCenter.dispatch(ecConfig.EVENT.REFRESH, null, null, this.myChart); + }, + __dispatchHoverLink: function (param) { + var valueMin; + var valueMax; + if (this.dataRangeOption.calculable) { + var totalValue = this.dataRangeOption.max - this.dataRangeOption.min; + var curValue; + if (this.dataRangeOption.orient == 'horizontal') { + curValue = (1 - (zrEvent.getX(param.event) - this._calculableLocation.x) / this._calculableLocation.width) * totalValue; + } else { + curValue = (1 - (zrEvent.getY(param.event) - this._calculableLocation.y) / this._calculableLocation.height) * totalValue; + } + valueMin = curValue - totalValue * 0.05; + valueMax = curValue + totalValue * 0.05; + } else { + var idx = param.target._idx; + valueMax = (this._colorList.length - idx) * this._gap + this.dataRangeOption.min; + valueMin = valueMax - this._gap; + } + this.messageCenter.dispatch(ecConfig.EVENT.DATA_RANGE_HOVERLINK, param.event, { + valueMin: valueMin, + valueMax: valueMax + }, this.myChart); + return; + }, + __onhoverlink: function (param) { + if (this.dataRangeOption.show && this.dataRangeOption.hoverLink && this._indicatorShape && param && param.seriesIndex != null && param.dataIndex != null) { + var curValue = param.value; + if (curValue === '' || isNaN(curValue)) { + return; + } + if (curValue < this.dataRangeOption.min) { + curValue = this.dataRangeOption.min; + } else if (curValue > this.dataRangeOption.max) { + curValue = this.dataRangeOption.max; + } + if (this.dataRangeOption.orient == 'horizontal') { + this._indicatorShape.position = [ + (this.dataRangeOption.max - curValue) / (this.dataRangeOption.max - this.dataRangeOption.min) * this._calculableLocation.width, + 0 + ]; + } else { + this._indicatorShape.position = [ + 0, + (this.dataRangeOption.max - curValue) / (this.dataRangeOption.max - this.dataRangeOption.min) * this._calculableLocation.height + ]; + } + this._indicatorShape.style.text = this._textFormat(param.value); + this._indicatorShape.style.color = this.getColor(curValue); + this.zr.addHoverShape(this._indicatorShape); + } + }, + _textFormat: function (valueStart, valueEnd) { + valueStart = valueStart.toFixed(this.dataRangeOption.precision); + valueEnd = valueEnd != null ? valueEnd.toFixed(this.dataRangeOption.precision) : ''; + if (this.dataRangeOption.formatter) { + if (typeof this.dataRangeOption.formatter == 'string') { + return this.dataRangeOption.formatter.replace('{value}', valueStart).replace('{value2}', valueEnd); + } else if (typeof this.dataRangeOption.formatter == 'function') { + return this.dataRangeOption.formatter.call(this.myChart, valueStart, valueEnd); + } + } + if (valueEnd !== '') { + return valueStart + ' - ' + valueEnd; + } + return valueStart; + }, + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.option.dataRange = this.reformOption(this.option.dataRange); + this.dataRangeOption = this.option.dataRange; + if (!this.myChart.canvasSupported) { + this.dataRangeOption.realtime = false; + } + var splitNumber = this.dataRangeOption.splitNumber <= 0 || this.dataRangeOption.calculable ? 100 : this.dataRangeOption.splitNumber; + this._colorList = zrColor.getGradientColors(this.dataRangeOption.color, Math.max((splitNumber - this.dataRangeOption.color.length) / (this.dataRangeOption.color.length - 1), 0) + 1); + if (this._colorList.length > splitNumber) { + var len = this._colorList.length; + var newColorList = [this._colorList[0]]; + var step = len / (splitNumber - 1); + for (var i = 1; i < splitNumber - 1; i++) { + newColorList.push(this._colorList[Math.floor(i * step)]); + } + newColorList.push(this._colorList[len - 1]); + this._colorList = newColorList; + } + var precision = this.dataRangeOption.precision; + this._gap = (this.dataRangeOption.max - this.dataRangeOption.min) / splitNumber; + while (this._gap.toFixed(precision) - 0 != this._gap && precision < 5) { + precision++; + } + this.dataRangeOption.precision = precision; + this._gap = ((this.dataRangeOption.max - this.dataRangeOption.min) / splitNumber).toFixed(precision) - 0; + this._valueTextList = []; + for (var i = 0; i < splitNumber; i++) { + this._selectedMap[i] = true; + this._valueTextList.unshift(this._textFormat(i * this._gap + this.dataRangeOption.min, (i + 1) * this._gap + this.dataRangeOption.min)); + } + } + this.clear(); + this._buildShape(); + }, + getColor: function (value) { + if (isNaN(value)) { + return null; + } + if (this.dataRangeOption.min == this.dataRangeOption.max) { + return this._colorList[0]; + } + if (value < this.dataRangeOption.min) { + value = this.dataRangeOption.min; + } else if (value > this.dataRangeOption.max) { + value = this.dataRangeOption.max; + } + if (this.dataRangeOption.calculable) { + if (value - (this._gap * this._range.start + this.dataRangeOption.min) > 0.00005 || value - (this._gap * this._range.end + this.dataRangeOption.min) < -0.00005) { + return null; + } + } + var idx = this._colorList.length - Math.ceil((value - this.dataRangeOption.min) / (this.dataRangeOption.max - this.dataRangeOption.min) * this._colorList.length); + if (idx == this._colorList.length) { + idx--; + } + if (this._selectedMap[idx]) { + return this._colorList[idx]; + } else { + return null; + } + }, + getColorByIndex: function (idx) { + if (idx >= this._colorList.length) { + idx = this._colorList.length - 1; + } else if (idx < 0) { + idx = 0; + } + return this._colorList[idx]; + }, + onbeforDispose: function () { + this.messageCenter.unbind(ecConfig.EVENT.HOVER, this._onhoverlink); + } + }; + zrUtil.inherits(DataRange, Base); + require('../component').define('dataRange', DataRange); + return DataRange; +});define('echarts/util/shape/HandlePolygon', [ + 'require', + 'zrender/shape/Base', + 'zrender/shape/Polygon', + 'zrender/tool/util' +], function (require) { + var Base = require('zrender/shape/Base'); + var PolygonShape = require('zrender/shape/Polygon'); + var zrUtil = require('zrender/tool/util'); + function HandlePolygon(options) { + Base.call(this, options); + } + HandlePolygon.prototype = { + type: 'handle-polygon', + buildPath: function (ctx, style) { + PolygonShape.prototype.buildPath(ctx, style); + }, + isCover: function (x, y) { + var originPos = this.getTansform(x, y); + x = originPos[0]; + y = originPos[1]; + var rect = this.style.rect; + if (x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height) { + return true; + } else { + return false; + } + } + }; + zrUtil.inherits(HandlePolygon, Base); + return HandlePolygon; +}); \ No newline at end of file diff --git a/build/source/echarts-all.js b/build/source/echarts-all.js new file mode 100644 index 0000000..b0c96cf --- /dev/null +++ b/build/source/echarts-all.js @@ -0,0 +1,46053 @@ +(function(_global){ +var require, define; +(function () { + var mods = {}; + + define = function (id, deps, factory) { + mods[id] = { + id: id, + deps: deps, + factory: factory, + defined: 0, + exports: {}, + require: createRequire(id) + }; + }; + + require = createRequire(''); + + function normalize(id, baseId) { + if (!baseId) { + return id; + } + + if (id.indexOf('.') === 0) { + var basePath = baseId.split('/'); + var namePath = id.split('/'); + var baseLen = basePath.length - 1; + var nameLen = namePath.length; + var cutBaseTerms = 0; + var cutNameTerms = 0; + + pathLoop: for (var i = 0; i < nameLen; i++) { + switch (namePath[i]) { + case '..': + if (cutBaseTerms < baseLen) { + cutBaseTerms++; + cutNameTerms++; + } + else { + break pathLoop; + } + break; + case '.': + cutNameTerms++; + break; + default: + break pathLoop; + } + } + + basePath.length = baseLen - cutBaseTerms; + namePath = namePath.slice(cutNameTerms); + + return basePath.concat(namePath).join('/'); + } + + return id; + } + + function createRequire(baseId) { + var cacheMods = {}; + + function localRequire(id, callback) { + if (typeof id === 'string') { + var exports = cacheMods[id]; + if (!exports) { + exports = getModExports(normalize(id, baseId)); + cacheMods[id] = exports; + } + + return exports; + } + else if (id instanceof Array) { + callback = callback || function () {}; + callback.apply(this, getModsExports(id, callback, baseId)); + } + }; + + return localRequire; + } + + function getModsExports(ids, factory, baseId) { + var es = []; + var mod = mods[baseId]; + + for (var i = 0, l = Math.min(ids.length, factory.length); i < l; i++) { + var id = normalize(ids[i], baseId); + var arg; + switch (id) { + case 'require': + arg = (mod && mod.require) || require; + break; + case 'exports': + arg = mod.exports; + break; + case 'module': + arg = mod; + break; + default: + arg = getModExports(id); + } + es.push(arg); + } + + return es; + } + + function getModExports(id) { + var mod = mods[id]; + if (!mod) { + throw new Error('No ' + id); + } + + if (!mod.defined) { + var factory = mod.factory; + var factoryReturn = factory.apply( + this, + getModsExports(mod.deps || [], factory, id) + ); + if (typeof factoryReturn !== 'undefined') { + mod.exports = factoryReturn; + } + mod.defined = 1; + } + + return mod.exports; + } +}()); +define('echarts', ['echarts/echarts'], function (main) {return main;}); +define('echarts/echarts', [ + 'require', + './config', + 'zrender/tool/util', + 'zrender/tool/event', + 'zrender/tool/env', + 'zrender', + 'zrender/config', + './chart/island', + './component/toolbox', + './component', + './component/title', + './component/tooltip', + './component/legend', + './util/ecData', + './chart', + 'zrender/tool/color', + './component/timeline', + 'zrender/shape/Image', + 'zrender/loadingEffect/Bar', + 'zrender/loadingEffect/Bubble', + 'zrender/loadingEffect/DynamicLine', + 'zrender/loadingEffect/Ring', + 'zrender/loadingEffect/Spin', + 'zrender/loadingEffect/Whirling', + './theme/macarons', + './theme/infographic' +], function (require) { + var ecConfig = require('./config'); + var zrUtil = require('zrender/tool/util'); + var zrEvent = require('zrender/tool/event'); + var self = {}; + var _canvasSupported = require('zrender/tool/env').canvasSupported; + var _idBase = new Date() - 0; + var _instances = {}; + var DOM_ATTRIBUTE_KEY = '_echarts_instance_'; + self.version = '2.2.0'; + self.dependencies = { zrender: '2.0.7' }; + self.init = function (dom, theme) { + var zrender = require('zrender'); + if (zrender.version.replace('.', '') - 0 < self.dependencies.zrender.replace('.', '') - 0) { + console.error('ZRender ' + zrender.version + ' is too old for ECharts ' + self.version + '. Current version need ZRender ' + self.dependencies.zrender + '+'); + } + dom = dom instanceof Array ? dom[0] : dom; + var key = dom.getAttribute(DOM_ATTRIBUTE_KEY); + if (!key) { + key = _idBase++; + dom.setAttribute(DOM_ATTRIBUTE_KEY, key); + } + if (_instances[key]) { + _instances[key].dispose(); + } + _instances[key] = new Echarts(dom); + _instances[key].id = key; + _instances[key].canvasSupported = _canvasSupported; + _instances[key].setTheme(theme); + return _instances[key]; + }; + self.getInstanceById = function (key) { + return _instances[key]; + }; + function MessageCenter() { + zrEvent.Dispatcher.call(this); + } + zrUtil.merge(MessageCenter.prototype, zrEvent.Dispatcher.prototype, true); + function Echarts(dom) { + dom.innerHTML = ''; + this._themeConfig = {}; + this.dom = dom; + this._connected = false; + this._status = { + dragIn: false, + dragOut: false, + needRefresh: false + }; + this._curEventType = false; + this._chartList = []; + this._messageCenter = new MessageCenter(); + this._messageCenterOutSide = new MessageCenter(); + this.resize = this.resize(); + this._init(); + } + var ZR_EVENT = require('zrender/config').EVENT; + var ZR_EVENT_LISTENS = [ + 'CLICK', + 'DBLCLICK', + 'MOUSEOVER', + 'MOUSEOUT', + 'DRAGSTART', + 'DRAGEND', + 'DRAGENTER', + 'DRAGOVER', + 'DRAGLEAVE', + 'DROP' + ]; + function callChartListMethodReverse(ecInstance, methodName, arg0, arg1, arg2) { + var chartList = ecInstance._chartList; + var len = chartList.length; + while (len--) { + var chart = chartList[len]; + if (typeof chart[methodName] === 'function') { + chart[methodName](arg0, arg1, arg2); + } + } + } + Echarts.prototype = { + _init: function () { + var self = this; + var _zr = require('zrender').init(this.dom); + this._zr = _zr; + this._messageCenter.dispatch = function (type, event, eventPackage, that) { + eventPackage = eventPackage || {}; + eventPackage.type = type; + eventPackage.event = event; + self._messageCenter.dispatchWithContext(type, eventPackage, that); + if (type != 'HOVER' && type != 'MOUSEOUT') { + setTimeout(function () { + self._messageCenterOutSide.dispatchWithContext(type, eventPackage, that); + }, 50); + } else { + self._messageCenterOutSide.dispatchWithContext(type, eventPackage, that); + } + }; + this._onevent = function (param) { + return self.__onevent(param); + }; + for (var e in ecConfig.EVENT) { + if (e != 'CLICK' && e != 'DBLCLICK' && e != 'HOVER' && e != 'MOUSEOUT' && e != 'MAP_ROAM') { + this._messageCenter.bind(ecConfig.EVENT[e], this._onevent, this); + } + } + var eventBehaviors = {}; + this._onzrevent = function (param) { + return self[eventBehaviors[param.type]](param); + }; + for (var i = 0, len = ZR_EVENT_LISTENS.length; i < len; i++) { + var eventName = ZR_EVENT_LISTENS[i]; + var eventValue = ZR_EVENT[eventName]; + eventBehaviors[eventValue] = '_on' + eventName.toLowerCase(); + _zr.on(eventValue, this._onzrevent); + } + this.chart = {}; + this.component = {}; + var Island = require('./chart/island'); + this._island = new Island(this._themeConfig, this._messageCenter, _zr, {}, this); + this.chart.island = this._island; + var Toolbox = require('./component/toolbox'); + this._toolbox = new Toolbox(this._themeConfig, this._messageCenter, _zr, {}, this); + this.component.toolbox = this._toolbox; + var componentLibrary = require('./component'); + componentLibrary.define('title', require('./component/title')); + componentLibrary.define('tooltip', require('./component/tooltip')); + componentLibrary.define('legend', require('./component/legend')); + if (_zr.getWidth() === 0 || _zr.getHeight() === 0) { + console.error('Dom’s width & height should be ready before init.'); + } + }, + __onevent: function (param) { + param.__echartsId = param.__echartsId || this.id; + var fromMyself = param.__echartsId === this.id; + if (!this._curEventType) { + this._curEventType = param.type; + } + switch (param.type) { + case ecConfig.EVENT.LEGEND_SELECTED: + this._onlegendSelected(param); + break; + case ecConfig.EVENT.DATA_ZOOM: + if (!fromMyself) { + var dz = this.component.dataZoom; + if (dz) { + dz.silence(true); + dz.absoluteZoom(param.zoom); + dz.silence(false); + } + } + this._ondataZoom(param); + break; + case ecConfig.EVENT.DATA_RANGE: + fromMyself && this._ondataRange(param); + break; + case ecConfig.EVENT.MAGIC_TYPE_CHANGED: + if (!fromMyself) { + var tb = this.component.toolbox; + if (tb) { + tb.silence(true); + tb.setMagicType(param.magicType); + tb.silence(false); + } + } + this._onmagicTypeChanged(param); + break; + case ecConfig.EVENT.DATA_VIEW_CHANGED: + fromMyself && this._ondataViewChanged(param); + break; + case ecConfig.EVENT.TOOLTIP_HOVER: + fromMyself && this._tooltipHover(param); + break; + case ecConfig.EVENT.RESTORE: + this._onrestore(); + break; + case ecConfig.EVENT.REFRESH: + fromMyself && this._onrefresh(param); + break; + case ecConfig.EVENT.TOOLTIP_IN_GRID: + case ecConfig.EVENT.TOOLTIP_OUT_GRID: + if (!fromMyself) { + var grid = this.component.grid; + if (grid) { + this._zr.trigger('mousemove', { + connectTrigger: true, + zrenderX: grid.getX() + param.x * grid.getWidth(), + zrenderY: grid.getY() + param.y * grid.getHeight() + }); + } + } else if (this._connected) { + var grid = this.component.grid; + if (grid) { + param.x = (param.event.zrenderX - grid.getX()) / grid.getWidth(); + param.y = (param.event.zrenderY - grid.getY()) / grid.getHeight(); + } + } + break; + } + if (this._connected && fromMyself && this._curEventType === param.type) { + for (var c in this._connected) { + this._connected[c].connectedEventHandler(param); + } + this._curEventType = null; + } + if (!fromMyself || !this._connected && fromMyself) { + this._curEventType = null; + } + }, + _onclick: function (param) { + callChartListMethodReverse(this, 'onclick', param); + if (param.target) { + var ecData = this._eventPackage(param.target); + if (ecData && ecData.seriesIndex != null) { + this._messageCenter.dispatch(ecConfig.EVENT.CLICK, param.event, ecData, this); + } + } + }, + _ondblclick: function (param) { + callChartListMethodReverse(this, 'ondblclick', param); + if (param.target) { + var ecData = this._eventPackage(param.target); + if (ecData && ecData.seriesIndex != null) { + this._messageCenter.dispatch(ecConfig.EVENT.DBLCLICK, param.event, ecData, this); + } + } + }, + _onmouseover: function (param) { + if (param.target) { + var ecData = this._eventPackage(param.target); + if (ecData && ecData.seriesIndex != null) { + this._messageCenter.dispatch(ecConfig.EVENT.HOVER, param.event, ecData, this); + } + } + }, + _onmouseout: function (param) { + if (param.target) { + var ecData = this._eventPackage(param.target); + if (ecData && ecData.seriesIndex != null) { + this._messageCenter.dispatch(ecConfig.EVENT.MOUSEOUT, param.event, ecData, this); + } + } + }, + _ondragstart: function (param) { + this._status = { + dragIn: false, + dragOut: false, + needRefresh: false + }; + callChartListMethodReverse(this, 'ondragstart', param); + }, + _ondragenter: function (param) { + callChartListMethodReverse(this, 'ondragenter', param); + }, + _ondragover: function (param) { + callChartListMethodReverse(this, 'ondragover', param); + }, + _ondragleave: function (param) { + callChartListMethodReverse(this, 'ondragleave', param); + }, + _ondrop: function (param) { + callChartListMethodReverse(this, 'ondrop', param, this._status); + this._island.ondrop(param, this._status); + }, + _ondragend: function (param) { + callChartListMethodReverse(this, 'ondragend', param, this._status); + this._timeline && this._timeline.ondragend(param, this._status); + this._island.ondragend(param, this._status); + if (this._status.needRefresh) { + this._syncBackupData(this._option); + var messageCenter = this._messageCenter; + messageCenter.dispatch(ecConfig.EVENT.DATA_CHANGED, param.event, this._eventPackage(param.target), this); + messageCenter.dispatch(ecConfig.EVENT.REFRESH, null, null, this); + } + }, + _onlegendSelected: function (param) { + this._status.needRefresh = false; + callChartListMethodReverse(this, 'onlegendSelected', param, this._status); + if (this._status.needRefresh) { + this._messageCenter.dispatch(ecConfig.EVENT.REFRESH, null, null, this); + } + }, + _ondataZoom: function (param) { + this._status.needRefresh = false; + callChartListMethodReverse(this, 'ondataZoom', param, this._status); + if (this._status.needRefresh) { + this._messageCenter.dispatch(ecConfig.EVENT.REFRESH, null, null, this); + } + }, + _ondataRange: function (param) { + this._clearEffect(); + this._status.needRefresh = false; + callChartListMethodReverse(this, 'ondataRange', param, this._status); + if (this._status.needRefresh) { + this._zr.refreshNextFrame(); + } + }, + _onmagicTypeChanged: function () { + this._clearEffect(); + this._render(this._toolbox.getMagicOption()); + }, + _ondataViewChanged: function (param) { + this._syncBackupData(param.option); + this._messageCenter.dispatch(ecConfig.EVENT.DATA_CHANGED, null, param, this); + this._messageCenter.dispatch(ecConfig.EVENT.REFRESH, null, null, this); + }, + _tooltipHover: function (param) { + var tipShape = []; + callChartListMethodReverse(this, 'ontooltipHover', param, tipShape); + }, + _onrestore: function () { + this.restore(); + }, + _onrefresh: function (param) { + this._refreshInside = true; + this.refresh(param); + this._refreshInside = false; + }, + _syncBackupData: function (curOption) { + this.component.dataZoom && this.component.dataZoom.syncBackupData(curOption); + }, + _eventPackage: function (target) { + if (target) { + var ecData = require('./util/ecData'); + var seriesIndex = ecData.get(target, 'seriesIndex'); + var dataIndex = ecData.get(target, 'dataIndex'); + dataIndex = seriesIndex != -1 && this.component.dataZoom ? this.component.dataZoom.getRealDataIndex(seriesIndex, dataIndex) : dataIndex; + return { + seriesIndex: seriesIndex, + seriesName: (ecData.get(target, 'series') || {}).name, + dataIndex: dataIndex, + data: ecData.get(target, 'data'), + name: ecData.get(target, 'name'), + value: ecData.get(target, 'value'), + special: ecData.get(target, 'special') + }; + } + return; + }, + _noDataCheck: function (magicOption) { + var series = magicOption.series; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type == ecConfig.CHART_TYPE_MAP || series[i].data && series[i].data.length > 0 || series[i].markPoint && series[i].markPoint.data && series[i].markPoint.data.length > 0 || series[i].markLine && series[i].markLine.data && series[i].markLine.data.length > 0 || series[i].nodes && series[i].nodes.length > 0 || series[i].links && series[i].links.length > 0 || series[i].matrix && series[i].matrix.length > 0 || series[i].eventList && series[i].eventList.length > 0) { + return false; + } + } + this.clear(); + var loadOption = this._option && this._option.noDataLoadingOption || this._themeConfig.noDataLoadingOption || ecConfig.noDataLoadingOption || { + text: this._option && this._option.noDataText || this._themeConfig.noDataText || ecConfig.noDataText, + effect: this._option && this._option.noDataEffect || this._themeConfig.noDataEffect || ecConfig.noDataEffect + }; + this.showLoading(loadOption); + return true; + }, + _render: function (magicOption) { + this._mergeGlobalConifg(magicOption); + if (this._noDataCheck(magicOption)) { + return; + } + var bgColor = magicOption.backgroundColor; + if (bgColor) { + if (!_canvasSupported && bgColor.indexOf('rgba') != -1) { + var cList = bgColor.split(','); + this.dom.style.filter = 'alpha(opacity=' + cList[3].substring(0, cList[3].lastIndexOf(')')) * 100 + ')'; + cList.length = 3; + cList[0] = cList[0].replace('a', ''); + this.dom.style.backgroundColor = cList.join(',') + ')'; + } else { + this.dom.style.backgroundColor = bgColor; + } + } + this._zr.clearAnimation(); + this._chartList = []; + var chartLibrary = require('./chart'); + var componentLibrary = require('./component'); + if (magicOption.xAxis || magicOption.yAxis) { + magicOption.grid = magicOption.grid || {}; + magicOption.dataZoom = magicOption.dataZoom || {}; + } + var componentList = [ + 'title', + 'legend', + 'tooltip', + 'dataRange', + 'roamController', + 'grid', + 'dataZoom', + 'xAxis', + 'yAxis', + 'polar' + ]; + var ComponentClass; + var componentType; + var component; + for (var i = 0, l = componentList.length; i < l; i++) { + componentType = componentList[i]; + component = this.component[componentType]; + if (magicOption[componentType]) { + if (component) { + component.refresh && component.refresh(magicOption); + } else { + ComponentClass = componentLibrary.get(/^[xy]Axis$/.test(componentType) ? 'axis' : componentType); + component = new ComponentClass(this._themeConfig, this._messageCenter, this._zr, magicOption, this, componentType); + this.component[componentType] = component; + } + this._chartList.push(component); + } else if (component) { + component.dispose(); + this.component[componentType] = null; + delete this.component[componentType]; + } + } + var ChartClass; + var chartType; + var chart; + var chartMap = {}; + for (var i = 0, l = magicOption.series.length; i < l; i++) { + chartType = magicOption.series[i].type; + if (!chartType) { + console.error('series[' + i + '] chart type has not been defined.'); + continue; + } + if (!chartMap[chartType]) { + chartMap[chartType] = true; + ChartClass = chartLibrary.get(chartType); + if (ChartClass) { + if (this.chart[chartType]) { + chart = this.chart[chartType]; + chart.refresh(magicOption); + } else { + chart = new ChartClass(this._themeConfig, this._messageCenter, this._zr, magicOption, this); + } + this._chartList.push(chart); + this.chart[chartType] = chart; + } else { + console.error(chartType + ' has not been required.'); + } + } + } + for (chartType in this.chart) { + if (chartType != ecConfig.CHART_TYPE_ISLAND && !chartMap[chartType]) { + this.chart[chartType].dispose(); + this.chart[chartType] = null; + delete this.chart[chartType]; + } + } + this.component.grid && this.component.grid.refixAxisShape(this.component); + this._island.refresh(magicOption); + this._toolbox.refresh(magicOption); + magicOption.animation && !magicOption.renderAsImage ? this._zr.refresh() : this._zr.render(); + var imgId = 'IMG' + this.id; + var img = document.getElementById(imgId); + if (magicOption.renderAsImage && _canvasSupported) { + if (img) { + img.src = this.getDataURL(magicOption.renderAsImage); + } else { + img = this.getImage(magicOption.renderAsImage); + img.id = imgId; + img.style.position = 'absolute'; + img.style.left = 0; + img.style.top = 0; + this.dom.firstChild.appendChild(img); + } + this.un(); + this._zr.un(); + this._disposeChartList(); + this._zr.clear(); + } else if (img) { + img.parentNode.removeChild(img); + } + img = null; + this._option = magicOption; + }, + restore: function () { + this._clearEffect(); + this._option = zrUtil.clone(this._optionRestore); + this._disposeChartList(); + this._island.clear(); + this._toolbox.reset(this._option, true); + this._render(this._option); + }, + refresh: function (param) { + this._clearEffect(); + param = param || {}; + var magicOption = param.option; + if (!this._refreshInside && magicOption) { + magicOption = this.getOption(); + zrUtil.merge(magicOption, param.option, true); + zrUtil.merge(this._optionRestore, param.option, true); + this._toolbox.reset(magicOption); + } + this._island.refresh(magicOption); + this._toolbox.refresh(magicOption); + this._zr.clearAnimation(); + for (var i = 0, l = this._chartList.length; i < l; i++) { + this._chartList[i].refresh && this._chartList[i].refresh(magicOption); + } + this.component.grid && this.component.grid.refixAxisShape(this.component); + this._zr.refresh(); + }, + _disposeChartList: function () { + this._clearEffect(); + this._zr.clearAnimation(); + var len = this._chartList.length; + while (len--) { + var chart = this._chartList[len]; + if (chart) { + var chartType = chart.type; + this.chart[chartType] && delete this.chart[chartType]; + this.component[chartType] && delete this.component[chartType]; + chart.dispose && chart.dispose(); + } + } + this._chartList = []; + }, + _mergeGlobalConifg: function (magicOption) { + var mergeList = [ + 'backgroundColor', + 'calculable', + 'calculableColor', + 'calculableHolderColor', + 'nameConnector', + 'valueConnector', + 'animation', + 'animationThreshold', + 'animationDuration', + 'animationDurationUpdate', + 'animationEasing', + 'addDataAnimation', + 'symbolList', + 'DRAG_ENABLE_TIME' + ]; + var len = mergeList.length; + while (len--) { + var mergeItem = mergeList[len]; + if (magicOption[mergeItem] == null) { + magicOption[mergeItem] = this._themeConfig[mergeItem] != null ? this._themeConfig[mergeItem] : ecConfig[mergeItem]; + } + } + var themeColor = magicOption.color; + if (!(themeColor && themeColor.length)) { + themeColor = this._themeConfig.color || ecConfig.color; + } + this._zr.getColor = function (idx) { + var zrColor = require('zrender/tool/color'); + return zrColor.getColor(idx, themeColor); + }; + if (!_canvasSupported) { + magicOption.animation = false; + magicOption.addDataAnimation = false; + } + }, + setOption: function (option, notMerge) { + if (!option.timeline) { + return this._setOption(option, notMerge); + } else { + return this._setTimelineOption(option); + } + }, + _setOption: function (option, notMerge) { + if (!notMerge && this._option) { + this._option = zrUtil.merge(this.getOption(), zrUtil.clone(option), true); + } else { + this._option = zrUtil.clone(option); + } + this._optionRestore = zrUtil.clone(this._option); + if (!this._option.series || this._option.series.length === 0) { + this._zr.clear(); + return; + } + if (this.component.dataZoom && (this._option.dataZoom || this._option.toolbox && this._option.toolbox.feature && this._option.toolbox.feature.dataZoom && this._option.toolbox.feature.dataZoom.show)) { + this.component.dataZoom.syncOption(this._option); + } + this._toolbox.reset(this._option); + this._render(this._option); + return this; + }, + getOption: function () { + var magicOption = zrUtil.clone(this._option); + var self = this; + function restoreOption(prop) { + var restoreSource = self._optionRestore[prop]; + if (restoreSource) { + if (restoreSource instanceof Array) { + var len = restoreSource.length; + while (len--) { + magicOption[prop][len].data = zrUtil.clone(restoreSource[len].data); + } + } else { + magicOption[prop].data = zrUtil.clone(restoreSource.data); + } + } + } + restoreOption('xAxis'); + restoreOption('yAxis'); + restoreOption('series'); + return magicOption; + }, + setSeries: function (series, notMerge) { + if (!notMerge) { + this.setOption({ series: series }); + } else { + this._option.series = series; + this.setOption(this._option, notMerge); + } + return this; + }, + getSeries: function () { + return this.getOption().series; + }, + _setTimelineOption: function (option) { + this._timeline && this._timeline.dispose(); + var Timeline = require('./component/timeline'); + var timeline = new Timeline(this._themeConfig, this._messageCenter, this._zr, option, this); + this._timeline = timeline; + this.component.timeline = this._timeline; + return this; + }, + addData: function (seriesIdx, data, isHead, dataGrow, additionData) { + var params = seriesIdx instanceof Array ? seriesIdx : [[ + seriesIdx, + data, + isHead, + dataGrow, + additionData + ]]; + var magicOption = this.getOption(); + var optionRestore = this._optionRestore; + for (var i = 0, l = params.length; i < l; i++) { + seriesIdx = params[i][0]; + data = params[i][1]; + isHead = params[i][2]; + dataGrow = params[i][3]; + additionData = params[i][4]; + var seriesItem = optionRestore.series[seriesIdx]; + var inMethod = isHead ? 'unshift' : 'push'; + var outMethod = isHead ? 'pop' : 'shift'; + if (seriesItem) { + var seriesItemData = seriesItem.data; + var mSeriesItemData = magicOption.series[seriesIdx].data; + seriesItemData[inMethod](data); + mSeriesItemData[inMethod](data); + if (!dataGrow) { + seriesItemData[outMethod](); + data = mSeriesItemData[outMethod](); + } + if (additionData != null) { + var legend; + var legendData; + if (seriesItem.type === ecConfig.CHART_TYPE_PIE && (legend = optionRestore.legend) && (legendData = legend.data)) { + var mLegendData = magicOption.legend.data; + legendData[inMethod](additionData); + mLegendData[inMethod](additionData); + if (!dataGrow) { + var legendDataIdx = zrUtil.indexOf(legendData, data.name); + legendDataIdx != -1 && legendData.splice(legendDataIdx, 1); + legendDataIdx = zrUtil.indexOf(mLegendData, data.name); + legendDataIdx != -1 && mLegendData.splice(legendDataIdx, 1); + } + } else if (optionRestore.xAxis != null && optionRestore.yAxis != null) { + var axisData; + var mAxisData; + var axisIdx = seriesItem.xAxisIndex || 0; + if (optionRestore.xAxis[axisIdx].type == null || optionRestore.xAxis[axisIdx].type === 'category') { + axisData = optionRestore.xAxis[axisIdx].data; + mAxisData = magicOption.xAxis[axisIdx].data; + axisData[inMethod](additionData); + mAxisData[inMethod](additionData); + if (!dataGrow) { + axisData[outMethod](); + mAxisData[outMethod](); + } + } + axisIdx = seriesItem.yAxisIndex || 0; + if (optionRestore.yAxis[axisIdx].type === 'category') { + axisData = optionRestore.yAxis[axisIdx].data; + mAxisData = magicOption.yAxis[axisIdx].data; + axisData[inMethod](additionData); + mAxisData[inMethod](additionData); + if (!dataGrow) { + axisData[outMethod](); + mAxisData[outMethod](); + } + } + } + } + this._option.series[seriesIdx].data = magicOption.series[seriesIdx].data; + } + } + this._zr.clearAnimation(); + var chartList = this._chartList; + for (var i = 0, l = chartList.length; i < l; i++) { + if (magicOption.addDataAnimation && chartList[i].addDataAnimation) { + chartList[i].addDataAnimation(params); + } + } + this.component.dataZoom && this.component.dataZoom.syncOption(magicOption); + this._option = magicOption; + var self = this; + setTimeout(function () { + if (!self._zr) { + return; + } + self._zr.clearAnimation(); + for (var i = 0, l = chartList.length; i < l; i++) { + chartList[i].motionlessOnce = magicOption.addDataAnimation && chartList[i].addDataAnimation; + } + self._messageCenter.dispatch(ecConfig.EVENT.REFRESH, null, { option: magicOption }, self); + }, magicOption.addDataAnimation ? magicOption.animationDurationUpdate : 0); + return this; + }, + addMarkPoint: function (seriesIdx, markData) { + return this._addMark(seriesIdx, markData, 'markPoint'); + }, + addMarkLine: function (seriesIdx, markData) { + return this._addMark(seriesIdx, markData, 'markLine'); + }, + _addMark: function (seriesIdx, markData, markType) { + var series = this._option.series; + var seriesItem; + if (series && (seriesItem = series[seriesIdx])) { + var seriesR = this._optionRestore.series; + var seriesRItem = seriesR[seriesIdx]; + var markOpt = seriesItem[markType]; + var markOptR = seriesRItem[markType]; + markOpt = seriesItem[markType] = markOpt || { data: [] }; + markOptR = seriesRItem[markType] = markOptR || { data: [] }; + for (var key in markData) { + if (key === 'data') { + markOpt.data = markOpt.data.concat(markData.data); + markOptR.data = markOptR.data.concat(markData.data); + } else if (typeof markData[key] != 'object' || markOpt[key] == null) { + markOpt[key] = markOptR[key] = markData[key]; + } else { + zrUtil.merge(markOpt[key], markData[key], true); + zrUtil.merge(markOptR[key], markData[key], true); + } + } + var chart = this.chart[seriesItem.type]; + chart && chart.addMark(seriesIdx, markData, markType); + } + return this; + }, + delMarkPoint: function (seriesIdx, markName) { + return this._delMark(seriesIdx, markName, 'markPoint'); + }, + delMarkLine: function (seriesIdx, markName) { + return this._delMark(seriesIdx, markName, 'markLine'); + }, + _delMark: function (seriesIdx, markName, markType) { + var series = this._option.series; + var seriesItem; + var mark; + var dataArray; + if (!(series && (seriesItem = series[seriesIdx]) && (mark = seriesItem[markType]) && (dataArray = mark.data))) { + return this; + } + markName = markName.split(' > '); + var targetIndex = -1; + for (var i = 0, l = dataArray.length; i < l; i++) { + var dataItem = dataArray[i]; + if (dataItem instanceof Array) { + if (dataItem[0].name === markName[0] && dataItem[1].name === markName[1]) { + targetIndex = i; + break; + } + } else if (dataItem.name === markName[0]) { + targetIndex = i; + break; + } + } + if (targetIndex > -1) { + dataArray.splice(targetIndex, 1); + this._optionRestore.series[seriesIdx][markType].data.splice(targetIndex, 1); + var chart = this.chart[seriesItem.type]; + chart && chart.delMark(seriesIdx, markName.join(' > '), markType); + } + return this; + }, + getDom: function () { + return this.dom; + }, + getZrender: function () { + return this._zr; + }, + getDataURL: function (imgType) { + if (!_canvasSupported) { + return ''; + } + if (this._chartList.length === 0) { + var imgId = 'IMG' + this.id; + var img = document.getElementById(imgId); + if (img) { + return img.src; + } + } + var tooltip = this.component.tooltip; + tooltip && tooltip.hideTip(); + switch (imgType) { + case 'jpeg': + break; + default: + imgType = 'png'; + } + var bgColor = this._option.backgroundColor; + if (bgColor && bgColor.replace(' ', '') === 'rgba(0,0,0,0)') { + bgColor = '#fff'; + } + return this._zr.toDataURL('image/' + imgType, bgColor); + }, + getImage: function (imgType) { + var title = this._optionRestore.title; + var imgDom = document.createElement('img'); + imgDom.src = this.getDataURL(imgType); + imgDom.title = title && title.text || 'ECharts'; + return imgDom; + }, + getConnectedDataURL: function (imgType) { + if (!this.isConnected()) { + return this.getDataURL(imgType); + } + var tempDom = this.dom; + var imgList = { + 'self': { + img: this.getDataURL(imgType), + left: tempDom.offsetLeft, + top: tempDom.offsetTop, + right: tempDom.offsetLeft + tempDom.offsetWidth, + bottom: tempDom.offsetTop + tempDom.offsetHeight + } + }; + var minLeft = imgList.self.left; + var minTop = imgList.self.top; + var maxRight = imgList.self.right; + var maxBottom = imgList.self.bottom; + for (var c in this._connected) { + tempDom = this._connected[c].getDom(); + imgList[c] = { + img: this._connected[c].getDataURL(imgType), + left: tempDom.offsetLeft, + top: tempDom.offsetTop, + right: tempDom.offsetLeft + tempDom.offsetWidth, + bottom: tempDom.offsetTop + tempDom.offsetHeight + }; + minLeft = Math.min(minLeft, imgList[c].left); + minTop = Math.min(minTop, imgList[c].top); + maxRight = Math.max(maxRight, imgList[c].right); + maxBottom = Math.max(maxBottom, imgList[c].bottom); + } + var zrDom = document.createElement('div'); + zrDom.style.position = 'absolute'; + zrDom.style.left = '-4000px'; + zrDom.style.width = maxRight - minLeft + 'px'; + zrDom.style.height = maxBottom - minTop + 'px'; + document.body.appendChild(zrDom); + var zrImg = require('zrender').init(zrDom); + var ImageShape = require('zrender/shape/Image'); + for (var c in imgList) { + zrImg.addShape(new ImageShape({ + style: { + x: imgList[c].left - minLeft, + y: imgList[c].top - minTop, + image: imgList[c].img + } + })); + } + zrImg.render(); + var bgColor = this._option.backgroundColor; + if (bgColor && bgColor.replace(/ /g, '') === 'rgba(0,0,0,0)') { + bgColor = '#fff'; + } + var image = zrImg.toDataURL('image/png', bgColor); + setTimeout(function () { + zrImg.dispose(); + zrDom.parentNode.removeChild(zrDom); + zrDom = null; + }, 100); + return image; + }, + getConnectedImage: function (imgType) { + var title = this._optionRestore.title; + var imgDom = document.createElement('img'); + imgDom.src = this.getConnectedDataURL(imgType); + imgDom.title = title && title.text || 'ECharts'; + return imgDom; + }, + on: function (eventName, eventListener) { + this._messageCenterOutSide.bind(eventName, eventListener, this); + return this; + }, + un: function (eventName, eventListener) { + this._messageCenterOutSide.unbind(eventName, eventListener); + return this; + }, + connect: function (connectTarget) { + if (!connectTarget) { + return this; + } + if (!this._connected) { + this._connected = {}; + } + if (connectTarget instanceof Array) { + for (var i = 0, l = connectTarget.length; i < l; i++) { + this._connected[connectTarget[i].id] = connectTarget[i]; + } + } else { + this._connected[connectTarget.id] = connectTarget; + } + return this; + }, + disConnect: function (connectTarget) { + if (!connectTarget || !this._connected) { + return this; + } + if (connectTarget instanceof Array) { + for (var i = 0, l = connectTarget.length; i < l; i++) { + delete this._connected[connectTarget[i].id]; + } + } else { + delete this._connected[connectTarget.id]; + } + for (var k in this._connected) { + return k, this; + } + this._connected = false; + return this; + }, + connectedEventHandler: function (param) { + if (param.__echartsId != this.id) { + this._onevent(param); + } + }, + isConnected: function () { + return !!this._connected; + }, + showLoading: function (loadingOption) { + var effectList = { + bar: require('zrender/loadingEffect/Bar'), + bubble: require('zrender/loadingEffect/Bubble'), + dynamicLine: require('zrender/loadingEffect/DynamicLine'), + ring: require('zrender/loadingEffect/Ring'), + spin: require('zrender/loadingEffect/Spin'), + whirling: require('zrender/loadingEffect/Whirling') + }; + this._toolbox.hideDataView(); + loadingOption = loadingOption || {}; + var textStyle = loadingOption.textStyle || {}; + loadingOption.textStyle = textStyle; + var finalTextStyle = zrUtil.merge(zrUtil.merge(zrUtil.clone(textStyle), this._themeConfig.textStyle), ecConfig.textStyle); + textStyle.textFont = finalTextStyle.fontStyle + ' ' + finalTextStyle.fontWeight + ' ' + finalTextStyle.fontSize + 'px ' + finalTextStyle.fontFamily; + textStyle.text = loadingOption.text || this._option && this._option.loadingText || this._themeConfig.loadingText || ecConfig.loadingText; + if (loadingOption.x != null) { + textStyle.x = loadingOption.x; + } + if (loadingOption.y != null) { + textStyle.y = loadingOption.y; + } + loadingOption.effectOption = loadingOption.effectOption || {}; + loadingOption.effectOption.textStyle = textStyle; + var Effect = loadingOption.effect; + if (typeof Effect === 'string' || Effect == null) { + Effect = effectList[loadingOption.effect || this._option && this._option.loadingEffect || this._themeConfig.loadingEffect || ecConfig.loadingEffect] || effectList.spin; + } + this._zr.showLoading(new Effect(loadingOption.effectOption)); + return this; + }, + hideLoading: function () { + this._zr.hideLoading(); + return this; + }, + setTheme: function (theme) { + if (theme) { + if (typeof theme === 'string') { + switch (theme) { + case 'macarons': + theme = require('./theme/macarons'); + break; + case 'infographic': + theme = require('./theme/infographic'); + break; + default: + theme = {}; + } + } else { + theme = theme || {}; + } + this._themeConfig = theme; + } + if (!_canvasSupported) { + var textStyle = this._themeConfig.textStyle; + textStyle && textStyle.fontFamily && textStyle.fontFamily2 && (textStyle.fontFamily = textStyle.fontFamily2); + textStyle = ecConfig.textStyle; + textStyle.fontFamily = textStyle.fontFamily2; + } + this._timeline && this._timeline.setTheme(true); + this._optionRestore && this.restore(); + }, + resize: function () { + var self = this; + return function () { + self._clearEffect(); + self._zr.resize(); + if (self._option && self._option.renderAsImage && _canvasSupported) { + self._render(self._option); + return self; + } + self._zr.clearAnimation(); + self._island.resize(); + self._toolbox.resize(); + self._timeline && self._timeline.resize(); + for (var i = 0, l = self._chartList.length; i < l; i++) { + self._chartList[i].resize && self._chartList[i].resize(); + } + self.component.grid && self.component.grid.refixAxisShape(self.component); + self._zr.refresh(); + self._messageCenter.dispatch(ecConfig.EVENT.RESIZE, null, null, self); + return self; + }; + }, + _clearEffect: function () { + this._zr.modLayer(ecConfig.EFFECT_ZLEVEL, { motionBlur: false }); + this._zr.painter.clearLayer(ecConfig.EFFECT_ZLEVEL); + }, + clear: function () { + this._disposeChartList(); + this._zr.clear(); + this._option = {}; + this._optionRestore = {}; + this.dom.style.backgroundColor = null; + return this; + }, + dispose: function () { + var key = this.dom.getAttribute(DOM_ATTRIBUTE_KEY); + key && delete _instances[key]; + this._island.dispose(); + this._toolbox.dispose(); + this._timeline && this._timeline.dispose(); + this._messageCenter.unbind(); + this.clear(); + this._zr.dispose(); + this._zr = null; + } + }; + return self; +});define('echarts/config', [], function () { + var config = { + CHART_TYPE_LINE: 'line', + CHART_TYPE_BAR: 'bar', + CHART_TYPE_SCATTER: 'scatter', + CHART_TYPE_PIE: 'pie', + CHART_TYPE_RADAR: 'radar', + CHART_TYPE_MAP: 'map', + CHART_TYPE_K: 'k', + CHART_TYPE_ISLAND: 'island', + CHART_TYPE_FORCE: 'force', + CHART_TYPE_CHORD: 'chord', + CHART_TYPE_GAUGE: 'gauge', + CHART_TYPE_FUNNEL: 'funnel', + CHART_TYPE_EVENTRIVER: 'eventRiver', + COMPONENT_TYPE_TITLE: 'title', + COMPONENT_TYPE_LEGEND: 'legend', + COMPONENT_TYPE_DATARANGE: 'dataRange', + COMPONENT_TYPE_DATAVIEW: 'dataView', + COMPONENT_TYPE_DATAZOOM: 'dataZoom', + COMPONENT_TYPE_TOOLBOX: 'toolbox', + COMPONENT_TYPE_TOOLTIP: 'tooltip', + COMPONENT_TYPE_GRID: 'grid', + COMPONENT_TYPE_AXIS: 'axis', + COMPONENT_TYPE_POLAR: 'polar', + COMPONENT_TYPE_X_AXIS: 'xAxis', + COMPONENT_TYPE_Y_AXIS: 'yAxis', + COMPONENT_TYPE_AXIS_CATEGORY: 'categoryAxis', + COMPONENT_TYPE_AXIS_VALUE: 'valueAxis', + COMPONENT_TYPE_TIMELINE: 'timeline', + COMPONENT_TYPE_ROAMCONTROLLER: 'roamController', + backgroundColor: 'rgba(0,0,0,0)', + color: [ + '#ff7f50', + '#87cefa', + '#da70d6', + '#32cd32', + '#6495ed', + '#ff69b4', + '#ba55d3', + '#cd5c5c', + '#ffa500', + '#40e0d0', + '#1e90ff', + '#ff6347', + '#7b68ee', + '#00fa9a', + '#ffd700', + '#6699FF', + '#ff6666', + '#3cb371', + '#b8860b', + '#30e0e0' + ], + markPoint: { + clickable: true, + symbol: 'pin', + symbolSize: 10, + large: false, + effect: { + show: false, + loop: true, + period: 15, + type: 'scale', + scaleSize: 2, + bounceDistance: 10 + }, + itemStyle: { + normal: { + borderWidth: 2, + label: { + show: true, + position: 'inside' + } + }, + emphasis: { label: { show: true } } + } + }, + markLine: { + clickable: true, + symbol: [ + 'circle', + 'arrow' + ], + symbolSize: [ + 2, + 4 + ], + smoothRadian: 0.2, + precision: 2, + effect: { + show: false, + loop: true, + period: 15, + scaleSize: 2 + }, + itemStyle: { + normal: { + borderWidth: 1.5, + label: { + show: true, + position: 'end' + }, + lineStyle: { type: 'dashed' } + }, + emphasis: { + label: { show: false }, + lineStyle: {} + } + } + }, + textStyle: { + decoration: 'none', + fontFamily: 'Arial, Verdana, sans-serif', + fontFamily2: '微软雅黑', + fontSize: 12, + fontStyle: 'normal', + fontWeight: 'normal' + }, + EVENT: { + REFRESH: 'refresh', + RESTORE: 'restore', + RESIZE: 'resize', + CLICK: 'click', + DBLCLICK: 'dblclick', + HOVER: 'hover', + MOUSEOUT: 'mouseout', + DATA_CHANGED: 'dataChanged', + DATA_ZOOM: 'dataZoom', + DATA_RANGE: 'dataRange', + DATA_RANGE_SELECTED: 'dataRangeSelected', + DATA_RANGE_HOVERLINK: 'dataRangeHoverLink', + LEGEND_SELECTED: 'legendSelected', + LEGEND_HOVERLINK: 'legendHoverLink', + MAP_SELECTED: 'mapSelected', + PIE_SELECTED: 'pieSelected', + MAGIC_TYPE_CHANGED: 'magicTypeChanged', + DATA_VIEW_CHANGED: 'dataViewChanged', + TIMELINE_CHANGED: 'timelineChanged', + MAP_ROAM: 'mapRoam', + FORCE_LAYOUT_END: 'forceLayoutEnd', + TOOLTIP_HOVER: 'tooltipHover', + TOOLTIP_IN_GRID: 'tooltipInGrid', + TOOLTIP_OUT_GRID: 'tooltipOutGrid', + ROAMCONTROLLER: 'roamController' + }, + DRAG_ENABLE_TIME: 120, + EFFECT_ZLEVEL: 10, + symbolList: [ + 'circle', + 'rectangle', + 'triangle', + 'diamond', + 'emptyCircle', + 'emptyRectangle', + 'emptyTriangle', + 'emptyDiamond' + ], + loadingEffect: 'spin', + loadingText: '数据读取中...', + noDataEffect: 'bubble', + noDataText: '暂无数据', + calculable: false, + calculableColor: 'rgba(255,165,0,0.6)', + calculableHolderColor: '#ccc', + nameConnector: ' & ', + valueConnector: ': ', + animation: true, + addDataAnimation: true, + animationThreshold: 2000, + animationDuration: 2000, + animationDurationUpdate: 500, + animationEasing: 'ExponentialOut' + }; + return config; +});define('zrender/tool/util', [ + 'require', + '../dep/excanvas' +], function (require) { + var BUILTIN_OBJECT = { + '[object Function]': 1, + '[object RegExp]': 1, + '[object Date]': 1, + '[object Error]': 1, + '[object CanvasGradient]': 1 + }; + var objToString = Object.prototype.toString; + function isDom(obj) { + return obj && obj.nodeType === 1 && typeof obj.nodeName == 'string'; + } + function clone(source) { + if (typeof source == 'object' && source !== null) { + var result = source; + if (source instanceof Array) { + result = []; + for (var i = 0, len = source.length; i < len; i++) { + result[i] = clone(source[i]); + } + } else if (!BUILTIN_OBJECT[objToString.call(source)] && !isDom(source)) { + result = {}; + for (var key in source) { + if (source.hasOwnProperty(key)) { + result[key] = clone(source[key]); + } + } + } + return result; + } + return source; + } + function mergeItem(target, source, key, overwrite) { + if (source.hasOwnProperty(key)) { + var targetProp = target[key]; + if (typeof targetProp == 'object' && !BUILTIN_OBJECT[objToString.call(targetProp)] && !isDom(targetProp)) { + merge(target[key], source[key], overwrite); + } else if (overwrite || !(key in target)) { + target[key] = source[key]; + } + } + } + function merge(target, source, overwrite) { + for (var i in source) { + mergeItem(target, source, i, overwrite); + } + return target; + } + var _ctx; + function getContext() { + if (!_ctx) { + require('../dep/excanvas'); + if (window['G_vmlCanvasManager']) { + var _div = document.createElement('div'); + _div.style.position = 'absolute'; + _div.style.top = '-1000px'; + document.body.appendChild(_div); + _ctx = G_vmlCanvasManager.initElement(_div).getContext('2d'); + } else { + _ctx = document.createElement('canvas').getContext('2d'); + } + } + return _ctx; + } + var _canvas; + var _pixelCtx; + var _width; + var _height; + var _offsetX = 0; + var _offsetY = 0; + function getPixelContext() { + if (!_pixelCtx) { + _canvas = document.createElement('canvas'); + _width = _canvas.width; + _height = _canvas.height; + _pixelCtx = _canvas.getContext('2d'); + } + return _pixelCtx; + } + function adjustCanvasSize(x, y) { + var _v = 100; + var _flag; + if (x + _offsetX > _width) { + _width = x + _offsetX + _v; + _canvas.width = _width; + _flag = true; + } + if (y + _offsetY > _height) { + _height = y + _offsetY + _v; + _canvas.height = _height; + _flag = true; + } + if (x < -_offsetX) { + _offsetX = Math.ceil(-x / _v) * _v; + _width += _offsetX; + _canvas.width = _width; + _flag = true; + } + if (y < -_offsetY) { + _offsetY = Math.ceil(-y / _v) * _v; + _height += _offsetY; + _canvas.height = _height; + _flag = true; + } + if (_flag) { + _pixelCtx.translate(_offsetX, _offsetY); + } + } + function getPixelOffset() { + return { + x: _offsetX, + y: _offsetY + }; + } + function indexOf(array, value) { + if (array.indexOf) { + return array.indexOf(value); + } + for (var i = 0, len = array.length; i < len; i++) { + if (array[i] === value) { + return i; + } + } + return -1; + } + function inherits(clazz, baseClazz) { + var clazzPrototype = clazz.prototype; + function F() { + } + F.prototype = baseClazz.prototype; + clazz.prototype = new F(); + for (var prop in clazzPrototype) { + clazz.prototype[prop] = clazzPrototype[prop]; + } + clazz.constructor = clazz; + } + return { + inherits: inherits, + clone: clone, + merge: merge, + getContext: getContext, + getPixelContext: getPixelContext, + getPixelOffset: getPixelOffset, + adjustCanvasSize: adjustCanvasSize, + indexOf: indexOf + }; +});define('zrender/tool/event', [ + 'require', + '../mixin/Eventful' +], function (require) { + 'use strict'; + var Eventful = require('../mixin/Eventful'); + function getX(e) { + return typeof e.zrenderX != 'undefined' && e.zrenderX || typeof e.offsetX != 'undefined' && e.offsetX || typeof e.layerX != 'undefined' && e.layerX || typeof e.clientX != 'undefined' && e.clientX; + } + function getY(e) { + return typeof e.zrenderY != 'undefined' && e.zrenderY || typeof e.offsetY != 'undefined' && e.offsetY || typeof e.layerY != 'undefined' && e.layerY || typeof e.clientY != 'undefined' && e.clientY; + } + function getDelta(e) { + return typeof e.zrenderDelta != 'undefined' && e.zrenderDelta || typeof e.wheelDelta != 'undefined' && e.wheelDelta || typeof e.detail != 'undefined' && -e.detail; + } + var stop = typeof window.addEventListener === 'function' ? function (e) { + e.preventDefault(); + e.stopPropagation(); + e.cancelBubble = true; + } : function (e) { + e.returnValue = false; + e.cancelBubble = true; + }; + return { + getX: getX, + getY: getY, + getDelta: getDelta, + stop: stop, + Dispatcher: Eventful + }; +});define('zrender/tool/env', [], function () { + function detect(ua) { + var os = this.os = {}; + var browser = this.browser = {}; + var webkit = ua.match(/Web[kK]it[\/]{0,1}([\d.]+)/); + var android = ua.match(/(Android);?[\s\/]+([\d.]+)?/); + var ipad = ua.match(/(iPad).*OS\s([\d_]+)/); + var ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/); + var iphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/); + var webos = ua.match(/(webOS|hpwOS)[\s\/]([\d.]+)/); + var touchpad = webos && ua.match(/TouchPad/); + var kindle = ua.match(/Kindle\/([\d.]+)/); + var silk = ua.match(/Silk\/([\d._]+)/); + var blackberry = ua.match(/(BlackBerry).*Version\/([\d.]+)/); + var bb10 = ua.match(/(BB10).*Version\/([\d.]+)/); + var rimtabletos = ua.match(/(RIM\sTablet\sOS)\s([\d.]+)/); + var playbook = ua.match(/PlayBook/); + var chrome = ua.match(/Chrome\/([\d.]+)/) || ua.match(/CriOS\/([\d.]+)/); + var firefox = ua.match(/Firefox\/([\d.]+)/); + var ie = ua.match(/MSIE ([\d.]+)/); + var safari = webkit && ua.match(/Mobile\//) && !chrome; + var webview = ua.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/) && !chrome; + var ie = ua.match(/MSIE\s([\d.]+)/); + if (browser.webkit = !!webkit) + browser.version = webkit[1]; + if (android) + os.android = true, os.version = android[2]; + if (iphone && !ipod) + os.ios = os.iphone = true, os.version = iphone[2].replace(/_/g, '.'); + if (ipad) + os.ios = os.ipad = true, os.version = ipad[2].replace(/_/g, '.'); + if (ipod) + os.ios = os.ipod = true, os.version = ipod[3] ? ipod[3].replace(/_/g, '.') : null; + if (webos) + os.webos = true, os.version = webos[2]; + if (touchpad) + os.touchpad = true; + if (blackberry) + os.blackberry = true, os.version = blackberry[2]; + if (bb10) + os.bb10 = true, os.version = bb10[2]; + if (rimtabletos) + os.rimtabletos = true, os.version = rimtabletos[2]; + if (playbook) + browser.playbook = true; + if (kindle) + os.kindle = true, os.version = kindle[1]; + if (silk) + browser.silk = true, browser.version = silk[1]; + if (!silk && os.android && ua.match(/Kindle Fire/)) + browser.silk = true; + if (chrome) + browser.chrome = true, browser.version = chrome[1]; + if (firefox) + browser.firefox = true, browser.version = firefox[1]; + if (ie) + browser.ie = true, browser.version = ie[1]; + if (safari && (ua.match(/Safari/) || !!os.ios)) + browser.safari = true; + if (webview) + browser.webview = true; + if (ie) + browser.ie = true, browser.version = ie[1]; + os.tablet = !!(ipad || playbook || android && !ua.match(/Mobile/) || firefox && ua.match(/Tablet/) || ie && !ua.match(/Phone/) && ua.match(/Touch/)); + os.phone = !!(!os.tablet && !os.ipod && (android || iphone || webos || blackberry || bb10 || chrome && ua.match(/Android/) || chrome && ua.match(/CriOS\/([\d.]+)/) || firefox && ua.match(/Mobile/) || ie && ua.match(/Touch/))); + return { + browser: browser, + os: os, + canvasSupported: document.createElement('canvas').getContext ? true : false + }; + } + return detect(navigator.userAgent); +});define('zrender', ['zrender/zrender'], function (main) {return main;}); +define('zrender/zrender', [ + 'require', + './dep/excanvas', + './tool/util', + './tool/log', + './tool/guid', + './Handler', + './Painter', + './Storage', + './animation/Animation', + './tool/env' +], function (require) { + require('./dep/excanvas'); + var util = require('./tool/util'); + var log = require('./tool/log'); + var guid = require('./tool/guid'); + var Handler = require('./Handler'); + var Painter = require('./Painter'); + var Storage = require('./Storage'); + var Animation = require('./animation/Animation'); + var _instances = {}; + var zrender = {}; + zrender.version = '2.0.7'; + zrender.init = function (dom) { + var zr = new ZRender(guid(), dom); + _instances[zr.id] = zr; + return zr; + }; + zrender.dispose = function (zr) { + if (zr) { + zr.dispose(); + } else { + for (var key in _instances) { + _instances[key].dispose(); + } + _instances = {}; + } + return zrender; + }; + zrender.getInstance = function (id) { + return _instances[id]; + }; + zrender.delInstance = function (id) { + delete _instances[id]; + return zrender; + }; + function getFrameCallback(zrInstance) { + return function () { + var animatingElements = zrInstance.animatingElements; + for (var i = 0, l = animatingElements.length; i < l; i++) { + zrInstance.storage.mod(animatingElements[i].id); + } + if (animatingElements.length || zrInstance._needsRefreshNextFrame) { + zrInstance.refresh(); + } + }; + } + var ZRender = function (id, dom) { + this.id = id; + this.env = require('./tool/env'); + this.storage = new Storage(); + this.painter = new Painter(dom, this.storage); + this.handler = new Handler(dom, this.storage, this.painter); + this.animatingElements = []; + this.animation = new Animation({ stage: { update: getFrameCallback(this) } }); + this.animation.start(); + var self = this; + this.painter.refreshNextFrame = function () { + self.refreshNextFrame(); + }; + this._needsRefreshNextFrame = false; + }; + ZRender.prototype.getId = function () { + return this.id; + }; + ZRender.prototype.addShape = function (shape) { + this.storage.addRoot(shape); + return this; + }; + ZRender.prototype.addGroup = function (group) { + this.storage.addRoot(group); + return this; + }; + ZRender.prototype.delShape = function (shapeId) { + this.storage.delRoot(shapeId); + return this; + }; + ZRender.prototype.delGroup = function (groupId) { + this.storage.delRoot(groupId); + return this; + }; + ZRender.prototype.modShape = function (shapeId, shape) { + this.storage.mod(shapeId, shape); + return this; + }; + ZRender.prototype.modGroup = function (groupId, group) { + this.storage.mod(groupId, group); + return this; + }; + ZRender.prototype.modLayer = function (zLevel, config) { + this.painter.modLayer(zLevel, config); + return this; + }; + ZRender.prototype.addHoverShape = function (shape) { + this.storage.addHover(shape); + return this; + }; + ZRender.prototype.render = function (callback) { + this.painter.render(callback); + this._needsRefreshNextFrame = false; + return this; + }; + ZRender.prototype.refresh = function (callback) { + this.painter.refresh(callback); + this._needsRefreshNextFrame = false; + return this; + }; + ZRender.prototype.refreshNextFrame = function () { + this._needsRefreshNextFrame = true; + return this; + }; + ZRender.prototype.refreshHover = function (callback) { + this.painter.refreshHover(callback); + return this; + }; + ZRender.prototype.refreshShapes = function (shapeList, callback) { + this.painter.refreshShapes(shapeList, callback); + return this; + }; + ZRender.prototype.resize = function () { + this.painter.resize(); + return this; + }; + ZRender.prototype.animate = function (el, path, loop) { + if (typeof el === 'string') { + el = this.storage.get(el); + } + if (el) { + var target; + if (path) { + var pathSplitted = path.split('.'); + var prop = el; + for (var i = 0, l = pathSplitted.length; i < l; i++) { + if (!prop) { + continue; + } + prop = prop[pathSplitted[i]]; + } + if (prop) { + target = prop; + } + } else { + target = el; + } + if (!target) { + log('Property "' + path + '" is not existed in element ' + el.id); + return; + } + var animatingElements = this.animatingElements; + if (typeof el.__aniCount === 'undefined') { + el.__aniCount = 0; + } + if (el.__aniCount === 0) { + animatingElements.push(el); + } + el.__aniCount++; + return this.animation.animate(target, { loop: loop }).done(function () { + el.__aniCount--; + if (el.__aniCount === 0) { + var idx = util.indexOf(animatingElements, el); + animatingElements.splice(idx, 1); + } + }); + } else { + log('Element not existed'); + } + }; + ZRender.prototype.clearAnimation = function () { + this.animation.clear(); + }; + ZRender.prototype.showLoading = function (loadingEffect) { + this.painter.showLoading(loadingEffect); + return this; + }; + ZRender.prototype.hideLoading = function () { + this.painter.hideLoading(); + return this; + }; + ZRender.prototype.getWidth = function () { + return this.painter.getWidth(); + }; + ZRender.prototype.getHeight = function () { + return this.painter.getHeight(); + }; + ZRender.prototype.toDataURL = function (type, backgroundColor, args) { + return this.painter.toDataURL(type, backgroundColor, args); + }; + ZRender.prototype.shapeToImage = function (e, width, height) { + var id = guid(); + return this.painter.shapeToImage(id, e, width, height); + }; + ZRender.prototype.on = function (eventName, eventHandler, context) { + this.handler.on(eventName, eventHandler, context); + return this; + }; + ZRender.prototype.un = function (eventName, eventHandler) { + this.handler.un(eventName, eventHandler); + return this; + }; + ZRender.prototype.trigger = function (eventName, event) { + this.handler.trigger(eventName, event); + return this; + }; + ZRender.prototype.clear = function () { + this.storage.delRoot(); + this.painter.clear(); + return this; + }; + ZRender.prototype.dispose = function () { + this.animation.stop(); + this.clear(); + this.storage.dispose(); + this.painter.dispose(); + this.handler.dispose(); + this.animation = this.animatingElements = this.storage = this.painter = this.handler = null; + zrender.delInstance(this.id); + }; + return zrender; +});define('zrender/config', [], function () { + var config = { + EVENT: { + RESIZE: 'resize', + CLICK: 'click', + DBLCLICK: 'dblclick', + MOUSEWHEEL: 'mousewheel', + MOUSEMOVE: 'mousemove', + MOUSEOVER: 'mouseover', + MOUSEOUT: 'mouseout', + MOUSEDOWN: 'mousedown', + MOUSEUP: 'mouseup', + GLOBALOUT: 'globalout', + DRAGSTART: 'dragstart', + DRAGEND: 'dragend', + DRAGENTER: 'dragenter', + DRAGOVER: 'dragover', + DRAGLEAVE: 'dragleave', + DROP: 'drop', + touchClickDelay: 300 + }, + catchBrushException: false, + debugMode: 0, + devicePixelRatio: Math.max(window.devicePixelRatio || 1, 1) + }; + return config; +});define('echarts/chart/island', [ + 'require', + './base', + 'zrender/shape/Circle', + '../config', + '../util/ecData', + 'zrender/tool/util', + 'zrender/tool/event', + 'zrender/tool/color', + '../util/accMath', + '../chart' +], function (require) { + var ChartBase = require('./base'); + var CircleShape = require('zrender/shape/Circle'); + var ecConfig = require('../config'); + ecConfig.island = { + zlevel: 0, + z: 5, + r: 15, + calculateStep: 0.1 + }; + var ecData = require('../util/ecData'); + var zrUtil = require('zrender/tool/util'); + var zrEvent = require('zrender/tool/event'); + function Island(ecTheme, messageCenter, zr, option, myChart) { + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); + this._nameConnector; + this._valueConnector; + this._zrHeight = this.zr.getHeight(); + this._zrWidth = this.zr.getWidth(); + var self = this; + self.shapeHandler.onmousewheel = function (param) { + var shape = param.target; + var event = param.event; + var delta = zrEvent.getDelta(event); + delta = delta > 0 ? -1 : 1; + shape.style.r -= delta; + shape.style.r = shape.style.r < 5 ? 5 : shape.style.r; + var value = ecData.get(shape, 'value'); + var dvalue = value * self.option.island.calculateStep; + value = dvalue > 1 ? Math.round(value - dvalue * delta) : +(value - dvalue * delta).toFixed(2); + var name = ecData.get(shape, 'name'); + shape.style.text = name + ':' + value; + ecData.set(shape, 'value', value); + ecData.set(shape, 'name', name); + self.zr.modShape(shape.id); + self.zr.refreshNextFrame(); + zrEvent.stop(event); + }; + } + Island.prototype = { + type: ecConfig.CHART_TYPE_ISLAND, + _combine: function (tarShape, srcShape) { + var zrColor = require('zrender/tool/color'); + var accMath = require('../util/accMath'); + var value = accMath.accAdd(ecData.get(tarShape, 'value'), ecData.get(srcShape, 'value')); + var name = ecData.get(tarShape, 'name') + this._nameConnector + ecData.get(srcShape, 'name'); + tarShape.style.text = name + this._valueConnector + value; + ecData.set(tarShape, 'value', value); + ecData.set(tarShape, 'name', name); + tarShape.style.r = this.option.island.r; + tarShape.style.color = zrColor.mix(tarShape.style.color, srcShape.style.color); + }, + refresh: function (newOption) { + if (newOption) { + newOption.island = this.reformOption(newOption.island); + this.option = newOption; + this._nameConnector = this.option.nameConnector; + this._valueConnector = this.option.valueConnector; + } + }, + getOption: function () { + return this.option; + }, + resize: function () { + var newWidth = this.zr.getWidth(); + var newHieght = this.zr.getHeight(); + var xScale = newWidth / (this._zrWidth || newWidth); + var yScale = newHieght / (this._zrHeight || newHieght); + if (xScale === 1 && yScale === 1) { + return; + } + this._zrWidth = newWidth; + this._zrHeight = newHieght; + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.modShape(this.shapeList[i].id, { + style: { + x: Math.round(this.shapeList[i].style.x * xScale), + y: Math.round(this.shapeList[i].style.y * yScale) + } + }); + } + }, + add: function (shape) { + var name = ecData.get(shape, 'name'); + var value = ecData.get(shape, 'value'); + var seriesName = ecData.get(shape, 'series') != null ? ecData.get(shape, 'series').name : ''; + var font = this.getFont(this.option.island.textStyle); + var islandShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: shape.style.x, + y: shape.style.y, + r: this.option.island.r, + color: shape.style.color || shape.style.strokeColor, + text: name + this._valueConnector + value, + textFont: font + }, + draggable: true, + hoverable: true, + onmousewheel: this.shapeHandler.onmousewheel, + _type: 'island' + }; + if (islandShape.style.color === '#fff') { + islandShape.style.color = shape.style.strokeColor; + } + this.setCalculable(islandShape); + islandShape.dragEnableTime = 0; + ecData.pack(islandShape, { name: seriesName }, -1, value, -1, name); + islandShape = new CircleShape(islandShape); + this.shapeList.push(islandShape); + this.zr.addShape(islandShape); + }, + del: function (shape) { + this.zr.delShape(shape.id); + var newShapeList = []; + for (var i = 0, l = this.shapeList.length; i < l; i++) { + if (this.shapeList[i].id != shape.id) { + newShapeList.push(this.shapeList[i]); + } + } + this.shapeList = newShapeList; + }, + ondrop: function (param, status) { + if (!this.isDrop || !param.target) { + return; + } + var target = param.target; + var dragged = param.dragged; + this._combine(target, dragged); + this.zr.modShape(target.id); + status.dragIn = true; + this.isDrop = false; + return; + }, + ondragend: function (param, status) { + var target = param.target; + if (!this.isDragend) { + if (!status.dragIn) { + target.style.x = zrEvent.getX(param.event); + target.style.y = zrEvent.getY(param.event); + this.add(target); + status.needRefresh = true; + } + } else { + if (status.dragIn) { + this.del(target); + status.needRefresh = true; + } + } + this.isDragend = false; + return; + } + }; + zrUtil.inherits(Island, ChartBase); + require('../chart').define('island', Island); + return Island; +});define('echarts/component/toolbox', [ + 'require', + './base', + 'zrender/shape/Line', + 'zrender/shape/Image', + 'zrender/shape/Rectangle', + '../util/shape/Icon', + '../config', + 'zrender/tool/util', + 'zrender/config', + 'zrender/tool/event', + './dataView', + '../component' +], function (require) { + var Base = require('./base'); + var LineShape = require('zrender/shape/Line'); + var ImageShape = require('zrender/shape/Image'); + var RectangleShape = require('zrender/shape/Rectangle'); + var IconShape = require('../util/shape/Icon'); + var ecConfig = require('../config'); + ecConfig.toolbox = { + zlevel: 0, + z: 6, + show: false, + orient: 'horizontal', + x: 'right', + y: 'top', + color: [ + '#1e90ff', + '#22bb22', + '#4b0082', + '#d2691e' + ], + disableColor: '#ddd', + effectiveColor: 'red', + backgroundColor: 'rgba(0,0,0,0)', + borderColor: '#ccc', + borderWidth: 0, + padding: 5, + itemGap: 10, + itemSize: 16, + showTitle: true, + feature: { + mark: { + show: false, + title: { + mark: '辅助线开关', + markUndo: '删除辅助线', + markClear: '清空辅助线' + }, + lineStyle: { + width: 1, + color: '#1e90ff', + type: 'dashed' + } + }, + dataZoom: { + show: false, + title: { + dataZoom: '区域缩放', + dataZoomReset: '区域缩放后退' + } + }, + dataView: { + show: false, + title: '数据视图', + readOnly: false, + lang: [ + '数据视图', + '关闭', + '刷新' + ] + }, + magicType: { + show: false, + title: { + line: '折线图切换', + bar: '柱形图切换', + stack: '堆积', + tiled: '平铺', + force: '力导向布局图切换', + chord: '和弦图切换', + pie: '饼图切换', + funnel: '漏斗图切换' + }, + type: [] + }, + restore: { + show: false, + title: '还原' + }, + saveAsImage: { + show: false, + title: '保存为图片', + type: 'png', + lang: ['点击保存'] + } + } + }; + var zrUtil = require('zrender/tool/util'); + var zrConfig = require('zrender/config'); + var zrEvent = require('zrender/tool/event'); + var _MAGICTYPE_STACK = 'stack'; + var _MAGICTYPE_TILED = 'tiled'; + function Toolbox(ecTheme, messageCenter, zr, option, myChart) { + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + this.dom = myChart.dom; + this._magicType = {}; + this._magicMap = {}; + this._isSilence = false; + this._iconList; + this._iconShapeMap = {}; + this._featureTitle = {}; + this._featureIcon = {}; + this._featureColor = {}; + this._featureOption = {}; + this._enableColor = 'red'; + this._disableColor = '#ccc'; + this._markShapeList = []; + var self = this; + self._onMark = function (param) { + self.__onMark(param); + }; + self._onMarkUndo = function (param) { + self.__onMarkUndo(param); + }; + self._onMarkClear = function (param) { + self.__onMarkClear(param); + }; + self._onDataZoom = function (param) { + self.__onDataZoom(param); + }; + self._onDataZoomReset = function (param) { + self.__onDataZoomReset(param); + }; + self._onDataView = function (param) { + self.__onDataView(param); + }; + self._onRestore = function (param) { + self.__onRestore(param); + }; + self._onSaveAsImage = function (param) { + self.__onSaveAsImage(param); + }; + self._onMagicType = function (param) { + self.__onMagicType(param); + }; + self._onCustomHandler = function (param) { + self.__onCustomHandler(param); + }; + self._onmousemove = function (param) { + return self.__onmousemove(param); + }; + self._onmousedown = function (param) { + return self.__onmousedown(param); + }; + self._onmouseup = function (param) { + return self.__onmouseup(param); + }; + self._onclick = function (param) { + return self.__onclick(param); + }; + } + Toolbox.prototype = { + type: ecConfig.COMPONENT_TYPE_TOOLBOX, + _buildShape: function () { + this._iconList = []; + var toolboxOption = this.option.toolbox; + this._enableColor = toolboxOption.effectiveColor; + this._disableColor = toolboxOption.disableColor; + var feature = toolboxOption.feature; + var iconName = []; + for (var key in feature) { + if (feature[key].show) { + switch (key) { + case 'mark': + iconName.push({ + key: key, + name: 'mark' + }); + iconName.push({ + key: key, + name: 'markUndo' + }); + iconName.push({ + key: key, + name: 'markClear' + }); + break; + case 'magicType': + for (var i = 0, l = feature[key].type.length; i < l; i++) { + feature[key].title[feature[key].type[i] + 'Chart'] = feature[key].title[feature[key].type[i]]; + if (feature[key].option) { + feature[key].option[feature[key].type[i] + 'Chart'] = feature[key].option[feature[key].type[i]]; + } + iconName.push({ + key: key, + name: feature[key].type[i] + 'Chart' + }); + } + break; + case 'dataZoom': + iconName.push({ + key: key, + name: 'dataZoom' + }); + iconName.push({ + key: key, + name: 'dataZoomReset' + }); + break; + case 'saveAsImage': + if (this.canvasSupported) { + iconName.push({ + key: key, + name: 'saveAsImage' + }); + } + break; + default: + iconName.push({ + key: key, + name: key + }); + break; + } + } + } + if (iconName.length > 0) { + var name; + var key; + for (var i = 0, l = iconName.length; i < l; i++) { + name = iconName[i].name; + key = iconName[i].key; + this._iconList.push(name); + this._featureTitle[name] = feature[key].title[name] || feature[key].title; + if (feature[key].icon) { + this._featureIcon[name] = feature[key].icon[name] || feature[key].icon; + } + if (feature[key].color) { + this._featureColor[name] = feature[key].color[name] || feature[key].color; + } + if (feature[key].option) { + this._featureOption[name] = feature[key].option[name] || feature[key].option; + } + } + this._itemGroupLocation = this._getItemGroupLocation(); + this._buildBackground(); + this._buildItem(); + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + if (this._iconShapeMap['mark']) { + this._iconDisable(this._iconShapeMap['markUndo']); + this._iconDisable(this._iconShapeMap['markClear']); + } + if (this._iconShapeMap['dataZoomReset'] && this._zoomQueue.length === 0) { + this._iconDisable(this._iconShapeMap['dataZoomReset']); + } + } + }, + _buildItem: function () { + var toolboxOption = this.option.toolbox; + var iconLength = this._iconList.length; + var lastX = this._itemGroupLocation.x; + var lastY = this._itemGroupLocation.y; + var itemSize = toolboxOption.itemSize; + var itemGap = toolboxOption.itemGap; + var itemShape; + var color = toolboxOption.color instanceof Array ? toolboxOption.color : [toolboxOption.color]; + var textFont = this.getFont(toolboxOption.textStyle); + var textPosition; + var textAlign; + var textBaseline; + if (toolboxOption.orient === 'horizontal') { + textPosition = this._itemGroupLocation.y / this.zr.getHeight() < 0.5 ? 'bottom' : 'top'; + textAlign = this._itemGroupLocation.x / this.zr.getWidth() < 0.5 ? 'left' : 'right'; + textBaseline = this._itemGroupLocation.y / this.zr.getHeight() < 0.5 ? 'top' : 'bottom'; + } else { + textPosition = this._itemGroupLocation.x / this.zr.getWidth() < 0.5 ? 'right' : 'left'; + } + this._iconShapeMap = {}; + var self = this; + for (var i = 0; i < iconLength; i++) { + itemShape = { + type: 'icon', + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: lastX, + y: lastY, + width: itemSize, + height: itemSize, + iconType: this._iconList[i], + lineWidth: 1, + strokeColor: this._featureColor[this._iconList[i]] || color[i % color.length], + brushType: 'stroke' + }, + highlightStyle: { + lineWidth: 1, + text: toolboxOption.showTitle ? this._featureTitle[this._iconList[i]] : undefined, + textFont: textFont, + textPosition: textPosition, + strokeColor: this._featureColor[this._iconList[i]] || color[i % color.length] + }, + hoverable: true, + clickable: true + }; + if (this._featureIcon[this._iconList[i]]) { + itemShape.style.image = this._featureIcon[this._iconList[i]].replace(new RegExp('^image:\\/\\/'), ''); + itemShape.style.opacity = 0.8; + itemShape.highlightStyle.opacity = 1; + itemShape.type = 'image'; + } + if (toolboxOption.orient === 'horizontal') { + if (i === 0 && textAlign === 'left') { + itemShape.highlightStyle.textPosition = 'specific'; + itemShape.highlightStyle.textAlign = textAlign; + itemShape.highlightStyle.textBaseline = textBaseline; + itemShape.highlightStyle.textX = lastX; + itemShape.highlightStyle.textY = textBaseline === 'top' ? lastY + itemSize + 10 : lastY - 10; + } + if (i === iconLength - 1 && textAlign === 'right') { + itemShape.highlightStyle.textPosition = 'specific'; + itemShape.highlightStyle.textAlign = textAlign; + itemShape.highlightStyle.textBaseline = textBaseline; + itemShape.highlightStyle.textX = lastX + itemSize; + itemShape.highlightStyle.textY = textBaseline === 'top' ? lastY + itemSize + 10 : lastY - 10; + } + } + switch (this._iconList[i]) { + case 'mark': + itemShape.onclick = self._onMark; + break; + case 'markUndo': + itemShape.onclick = self._onMarkUndo; + break; + case 'markClear': + itemShape.onclick = self._onMarkClear; + break; + case 'dataZoom': + itemShape.onclick = self._onDataZoom; + break; + case 'dataZoomReset': + itemShape.onclick = self._onDataZoomReset; + break; + case 'dataView': + if (!this._dataView) { + var DataView = require('./dataView'); + this._dataView = new DataView(this.ecTheme, this.messageCenter, this.zr, this.option, this.myChart); + } + itemShape.onclick = self._onDataView; + break; + case 'restore': + itemShape.onclick = self._onRestore; + break; + case 'saveAsImage': + itemShape.onclick = self._onSaveAsImage; + break; + default: + if (this._iconList[i].match('Chart')) { + itemShape._name = this._iconList[i].replace('Chart', ''); + itemShape.onclick = self._onMagicType; + } else { + itemShape.onclick = self._onCustomHandler; + } + break; + } + if (itemShape.type === 'icon') { + itemShape = new IconShape(itemShape); + } else if (itemShape.type === 'image') { + itemShape = new ImageShape(itemShape); + } + this.shapeList.push(itemShape); + this._iconShapeMap[this._iconList[i]] = itemShape; + if (toolboxOption.orient === 'horizontal') { + lastX += itemSize + itemGap; + } else { + lastY += itemSize + itemGap; + } + } + }, + _buildBackground: function () { + var toolboxOption = this.option.toolbox; + var padding = this.reformCssArray(this.option.toolbox.padding); + this.shapeList.push(new RectangleShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: this._itemGroupLocation.x - padding[3], + y: this._itemGroupLocation.y - padding[0], + width: this._itemGroupLocation.width + padding[3] + padding[1], + height: this._itemGroupLocation.height + padding[0] + padding[2], + brushType: toolboxOption.borderWidth === 0 ? 'fill' : 'both', + color: toolboxOption.backgroundColor, + strokeColor: toolboxOption.borderColor, + lineWidth: toolboxOption.borderWidth + } + })); + }, + _getItemGroupLocation: function () { + var toolboxOption = this.option.toolbox; + var padding = this.reformCssArray(this.option.toolbox.padding); + var iconLength = this._iconList.length; + var itemGap = toolboxOption.itemGap; + var itemSize = toolboxOption.itemSize; + var totalWidth = 0; + var totalHeight = 0; + if (toolboxOption.orient === 'horizontal') { + totalWidth = (itemSize + itemGap) * iconLength - itemGap; + totalHeight = itemSize; + } else { + totalHeight = (itemSize + itemGap) * iconLength - itemGap; + totalWidth = itemSize; + } + var x; + var zrWidth = this.zr.getWidth(); + switch (toolboxOption.x) { + case 'center': + x = Math.floor((zrWidth - totalWidth) / 2); + break; + case 'left': + x = padding[3] + toolboxOption.borderWidth; + break; + case 'right': + x = zrWidth - totalWidth - padding[1] - toolboxOption.borderWidth; + break; + default: + x = toolboxOption.x - 0; + x = isNaN(x) ? 0 : x; + break; + } + var y; + var zrHeight = this.zr.getHeight(); + switch (toolboxOption.y) { + case 'top': + y = padding[0] + toolboxOption.borderWidth; + break; + case 'bottom': + y = zrHeight - totalHeight - padding[2] - toolboxOption.borderWidth; + break; + case 'center': + y = Math.floor((zrHeight - totalHeight) / 2); + break; + default: + y = toolboxOption.y - 0; + y = isNaN(y) ? 0 : y; + break; + } + return { + x: x, + y: y, + width: totalWidth, + height: totalHeight + }; + }, + __onmousemove: function (param) { + if (this._marking) { + this._markShape.style.xEnd = zrEvent.getX(param.event); + this._markShape.style.yEnd = zrEvent.getY(param.event); + this.zr.addHoverShape(this._markShape); + } + if (this._zooming) { + this._zoomShape.style.width = zrEvent.getX(param.event) - this._zoomShape.style.x; + this._zoomShape.style.height = zrEvent.getY(param.event) - this._zoomShape.style.y; + this.zr.addHoverShape(this._zoomShape); + this.dom.style.cursor = 'crosshair'; + zrEvent.stop(param.event); + } + if (this._zoomStart && (this.dom.style.cursor != 'pointer' && this.dom.style.cursor != 'move')) { + this.dom.style.cursor = 'crosshair'; + } + }, + __onmousedown: function (param) { + if (param.target) { + return; + } + this._zooming = true; + var x = zrEvent.getX(param.event); + var y = zrEvent.getY(param.event); + var zoomOption = this.option.dataZoom || {}; + this._zoomShape = new RectangleShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: x, + y: y, + width: 1, + height: 1, + brushType: 'both' + }, + highlightStyle: { + lineWidth: 2, + color: zoomOption.fillerColor || ecConfig.dataZoom.fillerColor, + strokeColor: zoomOption.handleColor || ecConfig.dataZoom.handleColor, + brushType: 'both' + } + }); + this.zr.addHoverShape(this._zoomShape); + return true; + }, + __onmouseup: function () { + if (!this._zoomShape || Math.abs(this._zoomShape.style.width) < 10 || Math.abs(this._zoomShape.style.height) < 10) { + this._zooming = false; + return true; + } + if (this._zooming && this.component.dataZoom) { + this._zooming = false; + var zoom = this.component.dataZoom.rectZoom(this._zoomShape.style); + if (zoom) { + this._zoomQueue.push({ + start: zoom.start, + end: zoom.end, + start2: zoom.start2, + end2: zoom.end2 + }); + this._iconEnable(this._iconShapeMap['dataZoomReset']); + this.zr.refreshNextFrame(); + } + } + return true; + }, + __onclick: function (param) { + if (param.target) { + return; + } + if (this._marking) { + this._marking = false; + this._markShapeList.push(this._markShape); + this._iconEnable(this._iconShapeMap['markUndo']); + this._iconEnable(this._iconShapeMap['markClear']); + this.zr.addShape(this._markShape); + this.zr.refreshNextFrame(); + } else if (this._markStart) { + this._marking = true; + var x = zrEvent.getX(param.event); + var y = zrEvent.getY(param.event); + this._markShape = new LineShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + xStart: x, + yStart: y, + xEnd: x, + yEnd: y, + lineWidth: this.query(this.option, 'toolbox.feature.mark.lineStyle.width'), + strokeColor: this.query(this.option, 'toolbox.feature.mark.lineStyle.color'), + lineType: this.query(this.option, 'toolbox.feature.mark.lineStyle.type') + } + }); + this.zr.addHoverShape(this._markShape); + } + }, + __onMark: function (param) { + var target = param.target; + if (this._marking || this._markStart) { + this._resetMark(); + this.zr.refreshNextFrame(); + } else { + this._resetZoom(); + this.zr.modShape(target.id, { style: { strokeColor: this._enableColor } }); + this.zr.refreshNextFrame(); + this._markStart = true; + var self = this; + setTimeout(function () { + self.zr && self.zr.on(zrConfig.EVENT.CLICK, self._onclick) && self.zr.on(zrConfig.EVENT.MOUSEMOVE, self._onmousemove); + }, 10); + } + return true; + }, + __onMarkUndo: function () { + if (this._marking) { + this._marking = false; + } else { + var len = this._markShapeList.length; + if (len >= 1) { + var target = this._markShapeList[len - 1]; + this.zr.delShape(target.id); + this.zr.refreshNextFrame(); + this._markShapeList.pop(); + if (len === 1) { + this._iconDisable(this._iconShapeMap['markUndo']); + this._iconDisable(this._iconShapeMap['markClear']); + } + } + } + return true; + }, + __onMarkClear: function () { + if (this._marking) { + this._marking = false; + } + var len = this._markShapeList.length; + if (len > 0) { + while (len--) { + this.zr.delShape(this._markShapeList.pop().id); + } + this._iconDisable(this._iconShapeMap['markUndo']); + this._iconDisable(this._iconShapeMap['markClear']); + this.zr.refreshNextFrame(); + } + return true; + }, + __onDataZoom: function (param) { + var target = param.target; + if (this._zooming || this._zoomStart) { + this._resetZoom(); + this.zr.refreshNextFrame(); + this.dom.style.cursor = 'default'; + } else { + this._resetMark(); + this.zr.modShape(target.id, { style: { strokeColor: this._enableColor } }); + this.zr.refreshNextFrame(); + this._zoomStart = true; + var self = this; + setTimeout(function () { + self.zr && self.zr.on(zrConfig.EVENT.MOUSEDOWN, self._onmousedown) && self.zr.on(zrConfig.EVENT.MOUSEUP, self._onmouseup) && self.zr.on(zrConfig.EVENT.MOUSEMOVE, self._onmousemove); + }, 10); + this.dom.style.cursor = 'crosshair'; + } + return true; + }, + __onDataZoomReset: function () { + if (this._zooming) { + this._zooming = false; + } + this._zoomQueue.pop(); + if (this._zoomQueue.length > 0) { + this.component.dataZoom.absoluteZoom(this._zoomQueue[this._zoomQueue.length - 1]); + } else { + this.component.dataZoom.rectZoom(); + this._iconDisable(this._iconShapeMap['dataZoomReset']); + this.zr.refreshNextFrame(); + } + return true; + }, + _resetMark: function () { + this._marking = false; + if (this._markStart) { + this._markStart = false; + if (this._iconShapeMap['mark']) { + this.zr.modShape(this._iconShapeMap['mark'].id, { style: { strokeColor: this._iconShapeMap['mark'].highlightStyle.strokeColor } }); + } + this.zr.un(zrConfig.EVENT.CLICK, this._onclick); + this.zr.un(zrConfig.EVENT.MOUSEMOVE, this._onmousemove); + } + }, + _resetZoom: function () { + this._zooming = false; + if (this._zoomStart) { + this._zoomStart = false; + if (this._iconShapeMap['dataZoom']) { + this.zr.modShape(this._iconShapeMap['dataZoom'].id, { style: { strokeColor: this._iconShapeMap['dataZoom'].highlightStyle.strokeColor } }); + } + this.zr.un(zrConfig.EVENT.MOUSEDOWN, this._onmousedown); + this.zr.un(zrConfig.EVENT.MOUSEUP, this._onmouseup); + this.zr.un(zrConfig.EVENT.MOUSEMOVE, this._onmousemove); + } + }, + _iconDisable: function (target) { + if (target.type != 'image') { + this.zr.modShape(target.id, { + hoverable: false, + clickable: false, + style: { strokeColor: this._disableColor } + }); + } else { + this.zr.modShape(target.id, { + hoverable: false, + clickable: false, + style: { opacity: 0.3 } + }); + } + }, + _iconEnable: function (target) { + if (target.type != 'image') { + this.zr.modShape(target.id, { + hoverable: true, + clickable: true, + style: { strokeColor: target.highlightStyle.strokeColor } + }); + } else { + this.zr.modShape(target.id, { + hoverable: true, + clickable: true, + style: { opacity: 0.8 } + }); + } + }, + __onDataView: function () { + this._dataView.show(this.option); + return true; + }, + __onRestore: function () { + this._resetMark(); + this._resetZoom(); + this.messageCenter.dispatch(ecConfig.EVENT.RESTORE, null, null, this.myChart); + return true; + }, + __onSaveAsImage: function () { + var saveOption = this.option.toolbox.feature.saveAsImage; + var imgType = saveOption.type || 'png'; + if (imgType != 'png' && imgType != 'jpeg') { + imgType = 'png'; + } + var image; + if (!this.myChart.isConnected()) { + image = this.zr.toDataURL('image/' + imgType, this.option.backgroundColor && this.option.backgroundColor.replace(' ', '') === 'rgba(0,0,0,0)' ? '#fff' : this.option.backgroundColor); + } else { + image = this.myChart.getConnectedDataURL(imgType); + } + var downloadDiv = document.createElement('div'); + downloadDiv.id = '__echarts_download_wrap__'; + downloadDiv.style.cssText = 'position:fixed;' + 'z-index:99999;' + 'display:block;' + 'top:0;left:0;' + 'background-color:rgba(33,33,33,0.5);' + 'text-align:center;' + 'width:100%;' + 'height:100%;' + 'line-height:' + document.documentElement.clientHeight + 'px;'; + var downloadLink = document.createElement('a'); + downloadLink.href = image; + downloadLink.setAttribute('download', (saveOption.name ? saveOption.name : this.option.title && (this.option.title.text || this.option.title.subtext) ? this.option.title.text || this.option.title.subtext : 'ECharts') + '.' + imgType); + downloadLink.innerHTML = ''; + downloadDiv.appendChild(downloadLink); + document.body.appendChild(downloadDiv); + downloadLink = null; + downloadDiv = null; + setTimeout(function () { + var _d = document.getElementById('__echarts_download_wrap__'); + if (_d) { + _d.onclick = function () { + var d = document.getElementById('__echarts_download_wrap__'); + d.onclick = null; + d.innerHTML = ''; + document.body.removeChild(d); + d = null; + }; + _d = null; + } + }, 500); + return; + }, + __onMagicType: function (param) { + this._resetMark(); + var itemName = param.target._name; + if (!this._magicType[itemName]) { + this._magicType[itemName] = true; + if (itemName === ecConfig.CHART_TYPE_LINE) { + this._magicType[ecConfig.CHART_TYPE_BAR] = false; + } else if (itemName === ecConfig.CHART_TYPE_BAR) { + this._magicType[ecConfig.CHART_TYPE_LINE] = false; + } + if (itemName === ecConfig.CHART_TYPE_PIE) { + this._magicType[ecConfig.CHART_TYPE_FUNNEL] = false; + } else if (itemName === ecConfig.CHART_TYPE_FUNNEL) { + this._magicType[ecConfig.CHART_TYPE_PIE] = false; + } + if (itemName === ecConfig.CHART_TYPE_FORCE) { + this._magicType[ecConfig.CHART_TYPE_CHORD] = false; + } else if (itemName === ecConfig.CHART_TYPE_CHORD) { + this._magicType[ecConfig.CHART_TYPE_FORCE] = false; + } + if (itemName === _MAGICTYPE_STACK) { + this._magicType[_MAGICTYPE_TILED] = false; + } else if (itemName === _MAGICTYPE_TILED) { + this._magicType[_MAGICTYPE_STACK] = false; + } + this.messageCenter.dispatch(ecConfig.EVENT.MAGIC_TYPE_CHANGED, param.event, { magicType: this._magicType }, this.myChart); + } + return true; + }, + setMagicType: function (magicType) { + this._resetMark(); + this._magicType = magicType; + !this._isSilence && this.messageCenter.dispatch(ecConfig.EVENT.MAGIC_TYPE_CHANGED, null, { magicType: this._magicType }, this.myChart); + }, + __onCustomHandler: function (param) { + var target = param.target.style.iconType; + var featureHandler = this.option.toolbox.feature[target].onclick; + if (typeof featureHandler === 'function') { + featureHandler.call(this, this.option); + } + }, + reset: function (newOption, isRestore) { + isRestore && this.clear(); + if (this.query(newOption, 'toolbox.show') && this.query(newOption, 'toolbox.feature.magicType.show')) { + var magicType = newOption.toolbox.feature.magicType.type; + var len = magicType.length; + this._magicMap = {}; + while (len--) { + this._magicMap[magicType[len]] = true; + } + len = newOption.series.length; + var oriType; + var axis; + while (len--) { + oriType = newOption.series[len].type; + if (this._magicMap[oriType]) { + axis = newOption.xAxis instanceof Array ? newOption.xAxis[newOption.series[len].xAxisIndex || 0] : newOption.xAxis; + if (axis && (axis.type || 'category') === 'category') { + axis.__boundaryGap = axis.boundaryGap != null ? axis.boundaryGap : true; + } + axis = newOption.yAxis instanceof Array ? newOption.yAxis[newOption.series[len].yAxisIndex || 0] : newOption.yAxis; + if (axis && axis.type === 'category') { + axis.__boundaryGap = axis.boundaryGap != null ? axis.boundaryGap : true; + } + newOption.series[len].__type = oriType; + newOption.series[len].__itemStyle = zrUtil.clone(newOption.series[len].itemStyle || {}); + } + if (this._magicMap[_MAGICTYPE_STACK] || this._magicMap[_MAGICTYPE_TILED]) { + newOption.series[len].__stack = newOption.series[len].stack; + } + } + } + this._magicType = isRestore ? {} : this._magicType || {}; + for (var itemName in this._magicType) { + if (this._magicType[itemName]) { + this.option = newOption; + this.getMagicOption(); + break; + } + } + var zoomOption = newOption.dataZoom; + if (zoomOption && zoomOption.show) { + var start = zoomOption.start != null && zoomOption.start >= 0 && zoomOption.start <= 100 ? zoomOption.start : 0; + var end = zoomOption.end != null && zoomOption.end >= 0 && zoomOption.end <= 100 ? zoomOption.end : 100; + if (start > end) { + start = start + end; + end = start - end; + start = start - end; + } + this._zoomQueue = [{ + start: start, + end: end, + start2: 0, + end2: 100 + }]; + } else { + this._zoomQueue = []; + } + }, + getMagicOption: function () { + var axis; + var chartType; + if (this._magicType[ecConfig.CHART_TYPE_LINE] || this._magicType[ecConfig.CHART_TYPE_BAR]) { + var boundaryGap = this._magicType[ecConfig.CHART_TYPE_LINE] ? false : true; + for (var i = 0, l = this.option.series.length; i < l; i++) { + chartType = this.option.series[i].type; + if (chartType == ecConfig.CHART_TYPE_LINE || chartType == ecConfig.CHART_TYPE_BAR) { + axis = this.option.xAxis instanceof Array ? this.option.xAxis[this.option.series[i].xAxisIndex || 0] : this.option.xAxis; + if (axis && (axis.type || 'category') === 'category') { + axis.boundaryGap = boundaryGap ? true : axis.__boundaryGap; + } + axis = this.option.yAxis instanceof Array ? this.option.yAxis[this.option.series[i].yAxisIndex || 0] : this.option.yAxis; + if (axis && axis.type === 'category') { + axis.boundaryGap = boundaryGap ? true : axis.__boundaryGap; + } + } + } + this._defaultMagic(ecConfig.CHART_TYPE_LINE, ecConfig.CHART_TYPE_BAR); + } + this._defaultMagic(ecConfig.CHART_TYPE_CHORD, ecConfig.CHART_TYPE_FORCE); + this._defaultMagic(ecConfig.CHART_TYPE_PIE, ecConfig.CHART_TYPE_FUNNEL); + if (this._magicType[_MAGICTYPE_STACK] || this._magicType[_MAGICTYPE_TILED]) { + for (var i = 0, l = this.option.series.length; i < l; i++) { + if (this._magicType[_MAGICTYPE_STACK]) { + this.option.series[i].stack = '_ECHARTS_STACK_KENER_2014_'; + chartType = _MAGICTYPE_STACK; + } else if (this._magicType[_MAGICTYPE_TILED]) { + this.option.series[i].stack = null; + chartType = _MAGICTYPE_TILED; + } + if (this._featureOption[chartType + 'Chart']) { + zrUtil.merge(this.option.series[i], this._featureOption[chartType + 'Chart'] || {}, true); + } + } + } + return this.option; + }, + _defaultMagic: function (cType1, cType2) { + if (this._magicType[cType1] || this._magicType[cType2]) { + for (var i = 0, l = this.option.series.length; i < l; i++) { + var chartType = this.option.series[i].type; + if (chartType == cType1 || chartType == cType2) { + this.option.series[i].type = this._magicType[cType1] ? cType1 : cType2; + this.option.series[i].itemStyle = zrUtil.clone(this.option.series[i].__itemStyle); + chartType = this.option.series[i].type; + if (this._featureOption[chartType + 'Chart']) { + zrUtil.merge(this.option.series[i], this._featureOption[chartType + 'Chart'] || {}, true); + } + } + } + } + }, + silence: function (s) { + this._isSilence = s; + }, + resize: function () { + this._resetMark(); + this.clear(); + if (this.option && this.option.toolbox && this.option.toolbox.show) { + this._buildShape(); + } + if (this._dataView) { + this._dataView.resize(); + } + }, + hideDataView: function () { + if (this._dataView) { + this._dataView.hide(); + } + }, + clear: function (notMark) { + if (this.zr) { + this.zr.delShape(this.shapeList); + this.shapeList = []; + if (!notMark) { + this.zr.delShape(this._markShapeList); + this._markShapeList = []; + } + } + }, + onbeforDispose: function () { + if (this._dataView) { + this._dataView.dispose(); + this._dataView = null; + } + this._markShapeList = null; + }, + refresh: function (newOption) { + if (newOption) { + this._resetMark(); + this._resetZoom(); + newOption.toolbox = this.reformOption(newOption.toolbox); + this.option = newOption; + this.clear(true); + if (newOption.toolbox.show) { + this._buildShape(); + } + this.hideDataView(); + } + } + }; + zrUtil.inherits(Toolbox, Base); + require('../component').define('toolbox', Toolbox); + return Toolbox; +});define('echarts/component', [], function () { + var self = {}; + var _componentLibrary = {}; + self.define = function (name, clazz) { + _componentLibrary[name] = clazz; + return self; + }; + self.get = function (name) { + return _componentLibrary[name]; + }; + return self; +});define('echarts/component/title', [ + 'require', + './base', + 'zrender/shape/Text', + 'zrender/shape/Rectangle', + '../config', + 'zrender/tool/util', + 'zrender/tool/area', + 'zrender/tool/color', + '../component' +], function (require) { + var Base = require('./base'); + var TextShape = require('zrender/shape/Text'); + var RectangleShape = require('zrender/shape/Rectangle'); + var ecConfig = require('../config'); + ecConfig.title = { + zlevel: 0, + z: 6, + show: true, + text: '', + subtext: '', + x: 'left', + y: 'top', + backgroundColor: 'rgba(0,0,0,0)', + borderColor: '#ccc', + borderWidth: 0, + padding: 5, + itemGap: 5, + textStyle: { + fontSize: 18, + fontWeight: 'bolder', + color: '#333' + }, + subtextStyle: { color: '#aaa' } + }; + var zrUtil = require('zrender/tool/util'); + var zrArea = require('zrender/tool/area'); + var zrColor = require('zrender/tool/color'); + function Title(ecTheme, messageCenter, zr, option, myChart) { + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + this.refresh(option); + } + Title.prototype = { + type: ecConfig.COMPONENT_TYPE_TITLE, + _buildShape: function () { + if (!this.titleOption.show) { + return; + } + this._itemGroupLocation = this._getItemGroupLocation(); + this._buildBackground(); + this._buildItem(); + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + }, + _buildItem: function () { + var text = this.titleOption.text; + var link = this.titleOption.link; + var target = this.titleOption.target; + var subtext = this.titleOption.subtext; + var sublink = this.titleOption.sublink; + var subtarget = this.titleOption.subtarget; + var font = this.getFont(this.titleOption.textStyle); + var subfont = this.getFont(this.titleOption.subtextStyle); + var x = this._itemGroupLocation.x; + var y = this._itemGroupLocation.y; + var width = this._itemGroupLocation.width; + var height = this._itemGroupLocation.height; + var textShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + y: y, + color: this.titleOption.textStyle.color, + text: text, + textFont: font, + textBaseline: 'top' + }, + highlightStyle: { + color: zrColor.lift(this.titleOption.textStyle.color, 1), + brushType: 'fill' + }, + hoverable: false + }; + if (link) { + textShape.hoverable = true; + textShape.clickable = true; + textShape.onclick = function () { + if (!target || target != 'self') { + window.open(link); + } else { + window.location = link; + } + }; + } + var subtextShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + y: y + height, + color: this.titleOption.subtextStyle.color, + text: subtext, + textFont: subfont, + textBaseline: 'bottom' + }, + highlightStyle: { + color: zrColor.lift(this.titleOption.subtextStyle.color, 1), + brushType: 'fill' + }, + hoverable: false + }; + if (sublink) { + subtextShape.hoverable = true; + subtextShape.clickable = true; + subtextShape.onclick = function () { + if (!subtarget || subtarget != 'self') { + window.open(sublink); + } else { + window.location = sublink; + } + }; + } + switch (this.titleOption.x) { + case 'center': + textShape.style.x = subtextShape.style.x = x + width / 2; + textShape.style.textAlign = subtextShape.style.textAlign = 'center'; + break; + case 'left': + textShape.style.x = subtextShape.style.x = x; + textShape.style.textAlign = subtextShape.style.textAlign = 'left'; + break; + case 'right': + textShape.style.x = subtextShape.style.x = x + width; + textShape.style.textAlign = subtextShape.style.textAlign = 'right'; + break; + default: + x = this.titleOption.x - 0; + x = isNaN(x) ? 0 : x; + textShape.style.x = subtextShape.style.x = x; + break; + } + if (this.titleOption.textAlign) { + textShape.style.textAlign = subtextShape.style.textAlign = this.titleOption.textAlign; + } + this.shapeList.push(new TextShape(textShape)); + subtext !== '' && this.shapeList.push(new TextShape(subtextShape)); + }, + _buildBackground: function () { + var padding = this.reformCssArray(this.titleOption.padding); + this.shapeList.push(new RectangleShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: this._itemGroupLocation.x - padding[3], + y: this._itemGroupLocation.y - padding[0], + width: this._itemGroupLocation.width + padding[3] + padding[1], + height: this._itemGroupLocation.height + padding[0] + padding[2], + brushType: this.titleOption.borderWidth === 0 ? 'fill' : 'both', + color: this.titleOption.backgroundColor, + strokeColor: this.titleOption.borderColor, + lineWidth: this.titleOption.borderWidth + } + })); + }, + _getItemGroupLocation: function () { + var padding = this.reformCssArray(this.titleOption.padding); + var text = this.titleOption.text; + var subtext = this.titleOption.subtext; + var font = this.getFont(this.titleOption.textStyle); + var subfont = this.getFont(this.titleOption.subtextStyle); + var totalWidth = Math.max(zrArea.getTextWidth(text, font), zrArea.getTextWidth(subtext, subfont)); + var totalHeight = zrArea.getTextHeight(text, font) + (subtext === '' ? 0 : this.titleOption.itemGap + zrArea.getTextHeight(subtext, subfont)); + var x; + var zrWidth = this.zr.getWidth(); + switch (this.titleOption.x) { + case 'center': + x = Math.floor((zrWidth - totalWidth) / 2); + break; + case 'left': + x = padding[3] + this.titleOption.borderWidth; + break; + case 'right': + x = zrWidth - totalWidth - padding[1] - this.titleOption.borderWidth; + break; + default: + x = this.titleOption.x - 0; + x = isNaN(x) ? 0 : x; + break; + } + var y; + var zrHeight = this.zr.getHeight(); + switch (this.titleOption.y) { + case 'top': + y = padding[0] + this.titleOption.borderWidth; + break; + case 'bottom': + y = zrHeight - totalHeight - padding[2] - this.titleOption.borderWidth; + break; + case 'center': + y = Math.floor((zrHeight - totalHeight) / 2); + break; + default: + y = this.titleOption.y - 0; + y = isNaN(y) ? 0 : y; + break; + } + return { + x: x, + y: y, + width: totalWidth, + height: totalHeight + }; + }, + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.option.title = this.reformOption(this.option.title); + this.titleOption = this.option.title; + this.titleOption.textStyle = this.getTextStyle(this.titleOption.textStyle); + this.titleOption.subtextStyle = this.getTextStyle(this.titleOption.subtextStyle); + } + this.clear(); + this._buildShape(); + } + }; + zrUtil.inherits(Title, Base); + require('../component').define('title', Title); + return Title; +});define('echarts/component/tooltip', [ + 'require', + './base', + '../util/shape/Cross', + 'zrender/shape/Line', + 'zrender/shape/Rectangle', + '../config', + '../util/ecData', + 'zrender/config', + 'zrender/tool/event', + 'zrender/tool/area', + 'zrender/tool/color', + 'zrender/tool/util', + 'zrender/shape/Base', + '../component' +], function (require) { + var Base = require('./base'); + var CrossShape = require('../util/shape/Cross'); + var LineShape = require('zrender/shape/Line'); + var RectangleShape = require('zrender/shape/Rectangle'); + var rectangleInstance = new RectangleShape({}); + var ecConfig = require('../config'); + ecConfig.tooltip = { + zlevel: 1, + z: 8, + show: true, + showContent: true, + trigger: 'item', + islandFormatter: '{a}
{b} : {c}', + showDelay: 20, + hideDelay: 100, + transitionDuration: 0.4, + enterable: false, + backgroundColor: 'rgba(0,0,0,0.7)', + borderColor: '#333', + borderRadius: 4, + borderWidth: 0, + padding: 5, + axisPointer: { + type: 'line', + lineStyle: { + color: '#48b', + width: 2, + type: 'solid' + }, + crossStyle: { + color: '#1e90ff', + width: 1, + type: 'dashed' + }, + shadowStyle: { + color: 'rgba(150,150,150,0.3)', + width: 'auto', + type: 'default' + } + }, + textStyle: { color: '#fff' } + }; + var ecData = require('../util/ecData'); + var zrConfig = require('zrender/config'); + var zrEvent = require('zrender/tool/event'); + var zrArea = require('zrender/tool/area'); + var zrColor = require('zrender/tool/color'); + var zrUtil = require('zrender/tool/util'); + var zrShapeBase = require('zrender/shape/Base'); + function Tooltip(ecTheme, messageCenter, zr, option, myChart) { + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + this.dom = myChart.dom; + var self = this; + self._onmousemove = function (param) { + return self.__onmousemove(param); + }; + self._onglobalout = function (param) { + return self.__onglobalout(param); + }; + this.zr.on(zrConfig.EVENT.MOUSEMOVE, self._onmousemove); + this.zr.on(zrConfig.EVENT.GLOBALOUT, self._onglobalout); + self._hide = function (param) { + return self.__hide(param); + }; + self._tryShow = function (param) { + return self.__tryShow(param); + }; + self._refixed = function (param) { + return self.__refixed(param); + }; + self._setContent = function (ticket, res) { + return self.__setContent(ticket, res); + }; + this._tDom = this._tDom || document.createElement('div'); + this._tDom.onselectstart = function () { + return false; + }; + this._tDom.onmouseover = function () { + self._mousein = true; + }; + this._tDom.onmouseout = function () { + self._mousein = false; + }; + this._tDom.className = 'echarts-tooltip'; + this._tDom.style.position = 'absolute'; + this.hasAppend = false; + this._axisLineShape && this.zr.delShape(this._axisLineShape.id); + this._axisLineShape = new LineShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + invisible: true, + hoverable: false + }); + this.shapeList.push(this._axisLineShape); + this.zr.addShape(this._axisLineShape); + this._axisShadowShape && this.zr.delShape(this._axisShadowShape.id); + this._axisShadowShape = new LineShape({ + zlevel: this.getZlevelBase(), + z: 1, + invisible: true, + hoverable: false + }); + this.shapeList.push(this._axisShadowShape); + this.zr.addShape(this._axisShadowShape); + this._axisCrossShape && this.zr.delShape(this._axisCrossShape.id); + this._axisCrossShape = new CrossShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + invisible: true, + hoverable: false + }); + this.shapeList.push(this._axisCrossShape); + this.zr.addShape(this._axisCrossShape); + this.showing = false; + this.refresh(option); + } + Tooltip.prototype = { + type: ecConfig.COMPONENT_TYPE_TOOLTIP, + _gCssText: 'position:absolute;display:block;border-style:solid;white-space:nowrap;', + _style: function (opt) { + if (!opt) { + return ''; + } + var cssText = []; + if (opt.transitionDuration) { + var transitionText = 'left ' + opt.transitionDuration + 's,' + 'top ' + opt.transitionDuration + 's'; + cssText.push('transition:' + transitionText); + cssText.push('-moz-transition:' + transitionText); + cssText.push('-webkit-transition:' + transitionText); + cssText.push('-o-transition:' + transitionText); + } + if (opt.backgroundColor) { + cssText.push('background-Color:' + zrColor.toHex(opt.backgroundColor)); + cssText.push('filter:alpha(opacity=70)'); + cssText.push('background-Color:' + opt.backgroundColor); + } + if (opt.borderWidth != null) { + cssText.push('border-width:' + opt.borderWidth + 'px'); + } + if (opt.borderColor != null) { + cssText.push('border-color:' + opt.borderColor); + } + if (opt.borderRadius != null) { + cssText.push('border-radius:' + opt.borderRadius + 'px'); + cssText.push('-moz-border-radius:' + opt.borderRadius + 'px'); + cssText.push('-webkit-border-radius:' + opt.borderRadius + 'px'); + cssText.push('-o-border-radius:' + opt.borderRadius + 'px'); + } + var textStyle = opt.textStyle; + if (textStyle) { + textStyle.color && cssText.push('color:' + textStyle.color); + textStyle.decoration && cssText.push('text-decoration:' + textStyle.decoration); + textStyle.align && cssText.push('text-align:' + textStyle.align); + textStyle.fontFamily && cssText.push('font-family:' + textStyle.fontFamily); + textStyle.fontSize && cssText.push('font-size:' + textStyle.fontSize + 'px'); + textStyle.fontSize && cssText.push('line-height:' + Math.round(textStyle.fontSize * 3 / 2) + 'px'); + textStyle.fontStyle && cssText.push('font-style:' + textStyle.fontStyle); + textStyle.fontWeight && cssText.push('font-weight:' + textStyle.fontWeight); + } + var padding = opt.padding; + if (padding != null) { + padding = this.reformCssArray(padding); + cssText.push('padding:' + padding[0] + 'px ' + padding[1] + 'px ' + padding[2] + 'px ' + padding[3] + 'px'); + } + cssText = cssText.join(';') + ';'; + return cssText; + }, + __hide: function () { + this._lastDataIndex = -1; + this._lastSeriesIndex = -1; + this._lastItemTriggerId = -1; + if (this._tDom) { + this._tDom.style.display = 'none'; + } + var needRefresh = false; + if (!this._axisLineShape.invisible) { + this._axisLineShape.invisible = true; + this.zr.modShape(this._axisLineShape.id); + needRefresh = true; + } + if (!this._axisShadowShape.invisible) { + this._axisShadowShape.invisible = true; + this.zr.modShape(this._axisShadowShape.id); + needRefresh = true; + } + if (!this._axisCrossShape.invisible) { + this._axisCrossShape.invisible = true; + this.zr.modShape(this._axisCrossShape.id); + needRefresh = true; + } + if (this._lastTipShape && this._lastTipShape.tipShape.length > 0) { + this.zr.delShape(this._lastTipShape.tipShape); + this._lastTipShape = false; + this.shapeList.length = 2; + } + needRefresh && this.zr.refreshNextFrame(); + this.showing = false; + }, + _show: function (position, x, y, specialCssText) { + var domHeight = this._tDom.offsetHeight; + var domWidth = this._tDom.offsetWidth; + if (position) { + if (typeof position === 'function') { + position = position([ + x, + y + ]); + } + if (position instanceof Array) { + x = position[0]; + y = position[1]; + } + } + if (x + domWidth > this._zrWidth) { + x -= domWidth + 40; + } + if (y + domHeight > this._zrHeight) { + y -= domHeight - 20; + } + if (y < 20) { + y = 0; + } + this._tDom.style.cssText = this._gCssText + this._defaultCssText + (specialCssText ? specialCssText : '') + 'left:' + x + 'px;top:' + y + 'px;'; + if (domHeight < 10 || domWidth < 10) { + setTimeout(this._refixed, 20); + } + this.showing = true; + }, + __refixed: function () { + if (this._tDom) { + var cssText = ''; + var domHeight = this._tDom.offsetHeight; + var domWidth = this._tDom.offsetWidth; + if (this._tDom.offsetLeft + domWidth > this._zrWidth) { + cssText += 'left:' + (this._zrWidth - domWidth - 20) + 'px;'; + } + if (this._tDom.offsetTop + domHeight > this._zrHeight) { + cssText += 'top:' + (this._zrHeight - domHeight - 10) + 'px;'; + } + if (cssText !== '') { + this._tDom.style.cssText += cssText; + } + } + }, + __tryShow: function () { + var needShow; + var trigger; + if (!this._curTarget) { + this._findPolarTrigger() || this._findAxisTrigger(); + } else { + if (this._curTarget._type === 'island' && this.option.tooltip.show) { + this._showItemTrigger(); + return; + } + var serie = ecData.get(this._curTarget, 'series'); + var data = ecData.get(this._curTarget, 'data'); + needShow = this.deepQuery([ + data, + serie, + this.option + ], 'tooltip.show'); + if (serie == null || data == null || !needShow) { + clearTimeout(this._hidingTicket); + clearTimeout(this._showingTicket); + this._hidingTicket = setTimeout(this._hide, this._hideDelay); + } else { + trigger = this.deepQuery([ + data, + serie, + this.option + ], 'tooltip.trigger'); + trigger === 'axis' ? this._showAxisTrigger(serie.xAxisIndex, serie.yAxisIndex, ecData.get(this._curTarget, 'dataIndex')) : this._showItemTrigger(); + } + } + }, + _findAxisTrigger: function () { + if (!this.component.xAxis || !this.component.yAxis) { + this._hidingTicket = setTimeout(this._hide, this._hideDelay); + return; + } + var series = this.option.series; + var xAxisIndex; + var yAxisIndex; + for (var i = 0, l = series.length; i < l; i++) { + if (this.deepQuery([ + series[i], + this.option + ], 'tooltip.trigger') === 'axis') { + xAxisIndex = series[i].xAxisIndex || 0; + yAxisIndex = series[i].yAxisIndex || 0; + if (this.component.xAxis.getAxis(xAxisIndex) && this.component.xAxis.getAxis(xAxisIndex).type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY) { + this._showAxisTrigger(xAxisIndex, yAxisIndex, this._getNearestDataIndex('x', this.component.xAxis.getAxis(xAxisIndex))); + return; + } else if (this.component.yAxis.getAxis(yAxisIndex) && this.component.yAxis.getAxis(yAxisIndex).type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY) { + this._showAxisTrigger(xAxisIndex, yAxisIndex, this._getNearestDataIndex('y', this.component.yAxis.getAxis(yAxisIndex))); + return; + } else { + this._showAxisTrigger(xAxisIndex, yAxisIndex, -1); + return; + } + } + } + if (this.option.tooltip.axisPointer.type === 'cross') { + this._showAxisTrigger(-1, -1, -1); + } + }, + _findPolarTrigger: function () { + if (!this.component.polar) { + return false; + } + var x = zrEvent.getX(this._event); + var y = zrEvent.getY(this._event); + var polarIndex = this.component.polar.getNearestIndex([ + x, + y + ]); + var valueIndex; + if (polarIndex) { + valueIndex = polarIndex.valueIndex; + polarIndex = polarIndex.polarIndex; + } else { + polarIndex = -1; + } + if (polarIndex != -1) { + return this._showPolarTrigger(polarIndex, valueIndex); + } + return false; + }, + _getNearestDataIndex: function (direction, categoryAxis) { + var dataIndex = -1; + var x = zrEvent.getX(this._event); + var y = zrEvent.getY(this._event); + if (direction === 'x') { + var left; + var right; + var xEnd = this.component.grid.getXend(); + var curCoord = categoryAxis.getCoordByIndex(dataIndex); + while (curCoord < xEnd) { + right = curCoord; + if (curCoord <= x) { + left = curCoord; + } else { + break; + } + curCoord = categoryAxis.getCoordByIndex(++dataIndex); + } + if (dataIndex <= 0) { + dataIndex = 0; + } else if (x - left <= right - x) { + dataIndex -= 1; + } else { + if (categoryAxis.getNameByIndex(dataIndex) == null) { + dataIndex -= 1; + } + } + return dataIndex; + } else { + var top; + var bottom; + var yStart = this.component.grid.getY(); + var curCoord = categoryAxis.getCoordByIndex(dataIndex); + while (curCoord > yStart) { + top = curCoord; + if (curCoord >= y) { + bottom = curCoord; + } else { + break; + } + curCoord = categoryAxis.getCoordByIndex(++dataIndex); + } + if (dataIndex <= 0) { + dataIndex = 0; + } else if (y - top >= bottom - y) { + dataIndex -= 1; + } else { + if (categoryAxis.getNameByIndex(dataIndex) == null) { + dataIndex -= 1; + } + } + return dataIndex; + } + return -1; + }, + _showAxisTrigger: function (xAxisIndex, yAxisIndex, dataIndex) { + !this._event.connectTrigger && this.messageCenter.dispatch(ecConfig.EVENT.TOOLTIP_IN_GRID, this._event, null, this.myChart); + if (this.component.xAxis == null || this.component.yAxis == null || xAxisIndex == null || yAxisIndex == null) { + clearTimeout(this._hidingTicket); + clearTimeout(this._showingTicket); + this._hidingTicket = setTimeout(this._hide, this._hideDelay); + return; + } + var series = this.option.series; + var seriesArray = []; + var seriesIndex = []; + var categoryAxis; + var formatter; + var position; + var showContent; + var specialCssText = ''; + if (this.option.tooltip.trigger === 'axis') { + if (!this.option.tooltip.show) { + return; + } + formatter = this.option.tooltip.formatter; + position = this.option.tooltip.position; + } + var axisLayout = xAxisIndex != -1 && this.component.xAxis.getAxis(xAxisIndex).type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY ? 'xAxis' : yAxisIndex != -1 && this.component.yAxis.getAxis(yAxisIndex).type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY ? 'yAxis' : false; + var x; + var y; + if (axisLayout) { + var axisIndex = axisLayout == 'xAxis' ? xAxisIndex : yAxisIndex; + categoryAxis = this.component[axisLayout].getAxis(axisIndex); + for (var i = 0, l = series.length; i < l; i++) { + if (!this._isSelected(series[i].name)) { + continue; + } + if (series[i][axisLayout + 'Index'] === axisIndex && this.deepQuery([ + series[i], + this.option + ], 'tooltip.trigger') === 'axis') { + showContent = this.query(series[i], 'tooltip.showContent') || showContent; + formatter = this.query(series[i], 'tooltip.formatter') || formatter; + position = this.query(series[i], 'tooltip.position') || position; + specialCssText += this._style(this.query(series[i], 'tooltip')); + if (series[i].stack != null && axisLayout == 'xAxis') { + seriesArray.unshift(series[i]); + seriesIndex.unshift(i); + } else { + seriesArray.push(series[i]); + seriesIndex.push(i); + } + } + } + this.messageCenter.dispatch(ecConfig.EVENT.TOOLTIP_HOVER, this._event, { + seriesIndex: seriesIndex, + dataIndex: dataIndex + }, this.myChart); + var rect; + if (axisLayout == 'xAxis') { + x = this.subPixelOptimize(categoryAxis.getCoordByIndex(dataIndex), this._axisLineWidth); + y = zrEvent.getY(this._event); + rect = [ + x, + this.component.grid.getY(), + x, + this.component.grid.getYend() + ]; + } else { + x = zrEvent.getX(this._event); + y = this.subPixelOptimize(categoryAxis.getCoordByIndex(dataIndex), this._axisLineWidth); + rect = [ + this.component.grid.getX(), + y, + this.component.grid.getXend(), + y + ]; + } + this._styleAxisPointer(seriesArray, rect[0], rect[1], rect[2], rect[3], categoryAxis.getGap(), x, y); + } else { + x = zrEvent.getX(this._event); + y = zrEvent.getY(this._event); + this._styleAxisPointer(series, this.component.grid.getX(), y, this.component.grid.getXend(), y, 0, x, y); + if (dataIndex >= 0) { + this._showItemTrigger(true); + } else { + clearTimeout(this._hidingTicket); + clearTimeout(this._showingTicket); + this._tDom.style.display = 'none'; + } + } + if (seriesArray.length > 0) { + this._lastItemTriggerId = -1; + if (this._lastDataIndex != dataIndex || this._lastSeriesIndex != seriesIndex[0]) { + this._lastDataIndex = dataIndex; + this._lastSeriesIndex = seriesIndex[0]; + var data; + var value; + if (typeof formatter === 'function') { + var params = []; + for (var i = 0, l = seriesArray.length; i < l; i++) { + data = seriesArray[i].data[dataIndex]; + value = this.getDataFromOption(data, '-'); + params.push({ + seriesIndex: seriesIndex[i], + seriesName: seriesArray[i].name || '', + series: seriesArray[i], + dataIndex: dataIndex, + data: data, + name: categoryAxis.getNameByIndex(dataIndex), + value: value, + 0: seriesArray[i].name || '', + 1: categoryAxis.getNameByIndex(dataIndex), + 2: value, + 3: data + }); + } + this._curTicket = 'axis:' + dataIndex; + this._tDom.innerHTML = formatter.call(this.myChart, params, this._curTicket, this._setContent); + } else if (typeof formatter === 'string') { + this._curTicket = NaN; + formatter = formatter.replace('{a}', '{a0}').replace('{b}', '{b0}').replace('{c}', '{c0}'); + for (var i = 0, l = seriesArray.length; i < l; i++) { + formatter = formatter.replace('{a' + i + '}', this._encodeHTML(seriesArray[i].name || '')); + formatter = formatter.replace('{b' + i + '}', this._encodeHTML(categoryAxis.getNameByIndex(dataIndex))); + data = seriesArray[i].data[dataIndex]; + data = this.getDataFromOption(data, '-'); + formatter = formatter.replace('{c' + i + '}', data instanceof Array ? data : this.numAddCommas(data)); + } + this._tDom.innerHTML = formatter; + } else { + this._curTicket = NaN; + formatter = this._encodeHTML(categoryAxis.getNameByIndex(dataIndex)); + for (var i = 0, l = seriesArray.length; i < l; i++) { + formatter += '
' + this._encodeHTML(seriesArray[i].name || '') + ' : '; + data = seriesArray[i].data[dataIndex]; + data = this.getDataFromOption(data, '-'); + formatter += data instanceof Array ? data : this.numAddCommas(data); + } + this._tDom.innerHTML = formatter; + } + } + if (showContent === false || !this.option.tooltip.showContent) { + return; + } + if (!this.hasAppend) { + this._tDom.style.left = this._zrWidth / 2 + 'px'; + this._tDom.style.top = this._zrHeight / 2 + 'px'; + this.dom.firstChild.appendChild(this._tDom); + this.hasAppend = true; + } + this._show(position, x + 10, y + 10, specialCssText); + } + }, + _showPolarTrigger: function (polarIndex, dataIndex) { + if (this.component.polar == null || polarIndex == null || dataIndex == null || dataIndex < 0) { + return false; + } + var series = this.option.series; + var seriesArray = []; + var seriesIndex = []; + var formatter; + var position; + var showContent; + var specialCssText = ''; + if (this.option.tooltip.trigger === 'axis') { + if (!this.option.tooltip.show) { + return false; + } + formatter = this.option.tooltip.formatter; + position = this.option.tooltip.position; + } + var indicatorName = this.option.polar[polarIndex].indicator[dataIndex].text; + for (var i = 0, l = series.length; i < l; i++) { + if (!this._isSelected(series[i].name)) { + continue; + } + if (series[i].polarIndex === polarIndex && this.deepQuery([ + series[i], + this.option + ], 'tooltip.trigger') === 'axis') { + showContent = this.query(series[i], 'tooltip.showContent') || showContent; + formatter = this.query(series[i], 'tooltip.formatter') || formatter; + position = this.query(series[i], 'tooltip.position') || position; + specialCssText += this._style(this.query(series[i], 'tooltip')); + seriesArray.push(series[i]); + seriesIndex.push(i); + } + } + if (seriesArray.length > 0) { + var polarData; + var data; + var value; + var params = []; + for (var i = 0, l = seriesArray.length; i < l; i++) { + polarData = seriesArray[i].data; + for (var j = 0, k = polarData.length; j < k; j++) { + data = polarData[j]; + if (!this._isSelected(data.name)) { + continue; + } + data = data != null ? data : { + name: '', + value: { dataIndex: '-' } + }; + value = this.getDataFromOption(data.value[dataIndex]); + params.push({ + seriesIndex: seriesIndex[i], + seriesName: seriesArray[i].name || '', + series: seriesArray[i], + dataIndex: dataIndex, + data: data, + name: data.name, + indicator: indicatorName, + value: value, + 0: seriesArray[i].name || '', + 1: data.name, + 2: value, + 3: indicatorName + }); + } + } + if (params.length <= 0) { + return; + } + this._lastItemTriggerId = -1; + if (this._lastDataIndex != dataIndex || this._lastSeriesIndex != seriesIndex[0]) { + this._lastDataIndex = dataIndex; + this._lastSeriesIndex = seriesIndex[0]; + if (typeof formatter === 'function') { + this._curTicket = 'axis:' + dataIndex; + this._tDom.innerHTML = formatter.call(this.myChart, params, this._curTicket, this._setContent); + } else if (typeof formatter === 'string') { + formatter = formatter.replace('{a}', '{a0}').replace('{b}', '{b0}').replace('{c}', '{c0}').replace('{d}', '{d0}'); + for (var i = 0, l = params.length; i < l; i++) { + formatter = formatter.replace('{a' + i + '}', this._encodeHTML(params[i].seriesName)); + formatter = formatter.replace('{b' + i + '}', this._encodeHTML(params[i].name)); + formatter = formatter.replace('{c' + i + '}', this.numAddCommas(params[i].value)); + formatter = formatter.replace('{d' + i + '}', this._encodeHTML(params[i].indicator)); + } + this._tDom.innerHTML = formatter; + } else { + formatter = this._encodeHTML(params[0].name) + '
' + this._encodeHTML(params[0].indicator) + ' : ' + this.numAddCommas(params[0].value); + for (var i = 1, l = params.length; i < l; i++) { + formatter += '
' + this._encodeHTML(params[i].name) + '
'; + formatter += this._encodeHTML(params[i].indicator) + ' : ' + this.numAddCommas(params[i].value); + } + this._tDom.innerHTML = formatter; + } + } + if (showContent === false || !this.option.tooltip.showContent) { + return; + } + if (!this.hasAppend) { + this._tDom.style.left = this._zrWidth / 2 + 'px'; + this._tDom.style.top = this._zrHeight / 2 + 'px'; + this.dom.firstChild.appendChild(this._tDom); + this.hasAppend = true; + } + this._show(position, zrEvent.getX(this._event), zrEvent.getY(this._event), specialCssText); + return true; + } + }, + _showItemTrigger: function (axisTrigger) { + if (!this._curTarget) { + return; + } + var serie = ecData.get(this._curTarget, 'series'); + var seriesIndex = ecData.get(this._curTarget, 'seriesIndex'); + var data = ecData.get(this._curTarget, 'data'); + var dataIndex = ecData.get(this._curTarget, 'dataIndex'); + var name = ecData.get(this._curTarget, 'name'); + var value = ecData.get(this._curTarget, 'value'); + var special = ecData.get(this._curTarget, 'special'); + var special2 = ecData.get(this._curTarget, 'special2'); + var queryTarget = [ + data, + serie, + this.option + ]; + var formatter; + var position; + var showContent; + var specialCssText = ''; + if (this._curTarget._type != 'island') { + var trigger = axisTrigger ? 'axis' : 'item'; + if (this.option.tooltip.trigger === trigger) { + formatter = this.option.tooltip.formatter; + position = this.option.tooltip.position; + } + if (this.query(serie, 'tooltip.trigger') === trigger) { + showContent = this.query(serie, 'tooltip.showContent') || showContent; + formatter = this.query(serie, 'tooltip.formatter') || formatter; + position = this.query(serie, 'tooltip.position') || position; + specialCssText += this._style(this.query(serie, 'tooltip')); + } + showContent = this.query(data, 'tooltip.showContent') || showContent; + formatter = this.query(data, 'tooltip.formatter') || formatter; + position = this.query(data, 'tooltip.position') || position; + specialCssText += this._style(this.query(data, 'tooltip')); + } else { + this._lastItemTriggerId = NaN; + showContent = this.deepQuery(queryTarget, 'tooltip.showContent'); + formatter = this.deepQuery(queryTarget, 'tooltip.islandFormatter'); + position = this.deepQuery(queryTarget, 'tooltip.islandPosition'); + } + this._lastDataIndex = -1; + this._lastSeriesIndex = -1; + if (this._lastItemTriggerId !== this._curTarget.id) { + this._lastItemTriggerId = this._curTarget.id; + if (typeof formatter === 'function') { + this._curTicket = (serie.name || '') + ':' + dataIndex; + this._tDom.innerHTML = formatter.call(this.myChart, { + seriesIndex: seriesIndex, + seriesName: serie.name || '', + series: serie, + dataIndex: dataIndex, + data: data, + name: name, + value: value, + percent: special, + indicator: special, + value2: special2, + indicator2: special2, + 0: serie.name || '', + 1: name, + 2: value, + 3: special, + 4: special2, + 5: data, + 6: seriesIndex, + 7: dataIndex + }, this._curTicket, this._setContent); + } else if (typeof formatter === 'string') { + this._curTicket = NaN; + formatter = formatter.replace('{a}', '{a0}').replace('{b}', '{b0}').replace('{c}', '{c0}'); + formatter = formatter.replace('{a0}', this._encodeHTML(serie.name || '')).replace('{b0}', this._encodeHTML(name)).replace('{c0}', value instanceof Array ? value : this.numAddCommas(value)); + formatter = formatter.replace('{d}', '{d0}').replace('{d0}', special || ''); + formatter = formatter.replace('{e}', '{e0}').replace('{e0}', ecData.get(this._curTarget, 'special2') || ''); + this._tDom.innerHTML = formatter; + } else { + this._curTicket = NaN; + if (serie.type === ecConfig.CHART_TYPE_RADAR && special) { + this._tDom.innerHTML = this._itemFormatter.radar.call(this, serie, name, value, special); + } else if (serie.type === ecConfig.CHART_TYPE_EVENTRIVER) { + this._tDom.innerHTML = this._itemFormatter.eventRiver.call(this, serie, name, value, data); + } else { + this._tDom.innerHTML = '' + (serie.name != null ? this._encodeHTML(serie.name) + '
' : '') + (name === '' ? '' : this._encodeHTML(name) + ' : ') + (value instanceof Array ? value : this.numAddCommas(value)); + } + } + } + var x = zrEvent.getX(this._event); + var y = zrEvent.getY(this._event); + if (this.deepQuery(queryTarget, 'tooltip.axisPointer.show') && this.component.grid) { + this._styleAxisPointer([serie], this.component.grid.getX(), y, this.component.grid.getXend(), y, 0, x, y); + } + if (showContent === false || !this.option.tooltip.showContent) { + return; + } + if (!this.hasAppend) { + this._tDom.style.left = this._zrWidth / 2 + 'px'; + this._tDom.style.top = this._zrHeight / 2 + 'px'; + this.dom.firstChild.appendChild(this._tDom); + this.hasAppend = true; + } + this._show(position, x + 20, y - 20, specialCssText); + }, + _itemFormatter: { + radar: function (serie, name, value, indicator) { + var html = ''; + html += this._encodeHTML(name === '' ? serie.name || '' : name); + html += html === '' ? '' : '
'; + for (var i = 0; i < indicator.length; i++) { + html += this._encodeHTML(indicator[i].text) + ' : ' + this.numAddCommas(value[i]) + '
'; + } + return html; + }, + chord: function (serie, name, value, special, special2) { + if (special2 == null) { + return this._encodeHTML(name) + ' (' + this.numAddCommas(value) + ')'; + } else { + var name1 = this._encodeHTML(name); + var name2 = this._encodeHTML(special); + return '' + (serie.name != null ? this._encodeHTML(serie.name) + '
' : '') + name1 + ' -> ' + name2 + ' (' + this.numAddCommas(value) + ')' + '
' + name2 + ' -> ' + name1 + ' (' + this.numAddCommas(special2) + ')'; + } + }, + eventRiver: function (serie, name, value, data) { + var html = ''; + html += this._encodeHTML(serie.name === '' ? '' : serie.name + ' : '); + html += this._encodeHTML(name); + html += html === '' ? '' : '
'; + data = data.evolution; + for (var i = 0, l = data.length; i < l; i++) { + html += '
'; + if (!data[i].detail) { + continue; + } + if (data[i].detail.img) { + html += ''; + } + html += '
' + data[i].time + '
'; + html += ''; + html += data[i].detail.text + '
'; + html += '
'; + } + return html; + } + }, + _styleAxisPointer: function (seriesArray, xStart, yStart, xEnd, yEnd, gap, x, y) { + if (seriesArray.length > 0) { + var queryTarget; + var curType; + var axisPointer = this.option.tooltip.axisPointer; + var pointType = axisPointer.type; + var style = { + line: {}, + cross: {}, + shadow: {} + }; + for (var pType in style) { + style[pType].color = axisPointer[pType + 'Style'].color; + style[pType].width = axisPointer[pType + 'Style'].width; + style[pType].type = axisPointer[pType + 'Style'].type; + } + for (var i = 0, l = seriesArray.length; i < l; i++) { + queryTarget = seriesArray[i]; + curType = this.query(queryTarget, 'tooltip.axisPointer.type'); + pointType = curType || pointType; + if (curType) { + style[curType].color = this.query(queryTarget, 'tooltip.axisPointer.' + curType + 'Style.color') || style[curType].color; + style[curType].width = this.query(queryTarget, 'tooltip.axisPointer.' + curType + 'Style.width') || style[curType].width; + style[curType].type = this.query(queryTarget, 'tooltip.axisPointer.' + curType + 'Style.type') || style[curType].type; + } + } + if (pointType === 'line') { + var lineWidth = style.line.width; + var isVertical = xStart == xEnd; + this._axisLineShape.style = { + xStart: isVertical ? this.subPixelOptimize(xStart, lineWidth) : xStart, + yStart: isVertical ? yStart : this.subPixelOptimize(yStart, lineWidth), + xEnd: isVertical ? this.subPixelOptimize(xEnd, lineWidth) : xEnd, + yEnd: isVertical ? yEnd : this.subPixelOptimize(yEnd, lineWidth), + strokeColor: style.line.color, + lineWidth: lineWidth, + lineType: style.line.type + }; + this._axisLineShape.invisible = false; + this.zr.modShape(this._axisLineShape.id); + } else if (pointType === 'cross') { + var crossWidth = style.cross.width; + this._axisCrossShape.style = { + brushType: 'stroke', + rect: this.component.grid.getArea(), + x: this.subPixelOptimize(x, crossWidth), + y: this.subPixelOptimize(y, crossWidth), + text: ('( ' + this.component.xAxis.getAxis(0).getValueFromCoord(x) + ' , ' + this.component.yAxis.getAxis(0).getValueFromCoord(y) + ' )').replace(' , ', ' ').replace(' , ', ' '), + textPosition: 'specific', + strokeColor: style.cross.color, + lineWidth: crossWidth, + lineType: style.cross.type + }; + if (this.component.grid.getXend() - x > 100) { + this._axisCrossShape.style.textAlign = 'left'; + this._axisCrossShape.style.textX = x + 10; + } else { + this._axisCrossShape.style.textAlign = 'right'; + this._axisCrossShape.style.textX = x - 10; + } + if (y - this.component.grid.getY() > 50) { + this._axisCrossShape.style.textBaseline = 'bottom'; + this._axisCrossShape.style.textY = y - 10; + } else { + this._axisCrossShape.style.textBaseline = 'top'; + this._axisCrossShape.style.textY = y + 10; + } + this._axisCrossShape.invisible = false; + this.zr.modShape(this._axisCrossShape.id); + } else if (pointType === 'shadow') { + if (style.shadow.width == null || style.shadow.width === 'auto' || isNaN(style.shadow.width)) { + style.shadow.width = gap; + } + if (xStart === xEnd) { + if (Math.abs(this.component.grid.getX() - xStart) < 2) { + style.shadow.width /= 2; + xStart = xEnd = xEnd + style.shadow.width / 2; + } else if (Math.abs(this.component.grid.getXend() - xStart) < 2) { + style.shadow.width /= 2; + xStart = xEnd = xEnd - style.shadow.width / 2; + } + } else if (yStart === yEnd) { + if (Math.abs(this.component.grid.getY() - yStart) < 2) { + style.shadow.width /= 2; + yStart = yEnd = yEnd + style.shadow.width / 2; + } else if (Math.abs(this.component.grid.getYend() - yStart) < 2) { + style.shadow.width /= 2; + yStart = yEnd = yEnd - style.shadow.width / 2; + } + } + this._axisShadowShape.style = { + xStart: xStart, + yStart: yStart, + xEnd: xEnd, + yEnd: yEnd, + strokeColor: style.shadow.color, + lineWidth: style.shadow.width + }; + this._axisShadowShape.invisible = false; + this.zr.modShape(this._axisShadowShape.id); + } + this.zr.refreshNextFrame(); + } + }, + __onmousemove: function (param) { + clearTimeout(this._hidingTicket); + clearTimeout(this._showingTicket); + if (this._mousein && this._enterable) { + return; + } + var target = param.target; + var mx = zrEvent.getX(param.event); + var my = zrEvent.getY(param.event); + if (!target) { + this._curTarget = false; + this._event = param.event; + this._event.zrenderX = mx; + this._event.zrenderY = my; + if (this._needAxisTrigger && this.component.grid && zrArea.isInside(rectangleInstance, this.component.grid.getArea(), mx, my)) { + this._showingTicket = setTimeout(this._tryShow, this._showDelay); + } else if (this._needAxisTrigger && this.component.polar && this.component.polar.isInside([ + mx, + my + ]) != -1) { + this._showingTicket = setTimeout(this._tryShow, this._showDelay); + } else { + !this._event.connectTrigger && this.messageCenter.dispatch(ecConfig.EVENT.TOOLTIP_OUT_GRID, this._event, null, this.myChart); + this._hidingTicket = setTimeout(this._hide, this._hideDelay); + } + } else { + this._curTarget = target; + this._event = param.event; + this._event.zrenderX = mx; + this._event.zrenderY = my; + var polarIndex; + if (this._needAxisTrigger && this.component.polar && (polarIndex = this.component.polar.isInside([ + mx, + my + ])) != -1) { + var series = this.option.series; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].polarIndex === polarIndex && this.deepQuery([ + series[i], + this.option + ], 'tooltip.trigger') === 'axis') { + this._curTarget = null; + break; + } + } + } + this._showingTicket = setTimeout(this._tryShow, this._showDelay); + } + }, + __onglobalout: function () { + clearTimeout(this._hidingTicket); + clearTimeout(this._showingTicket); + this._hidingTicket = setTimeout(this._hide, this._hideDelay); + }, + __setContent: function (ticket, content) { + if (!this._tDom) { + return; + } + if (ticket === this._curTicket) { + this._tDom.innerHTML = content; + } + setTimeout(this._refixed, 20); + }, + ontooltipHover: function (param, tipShape) { + if (!this._lastTipShape || this._lastTipShape && this._lastTipShape.dataIndex != param.dataIndex) { + if (this._lastTipShape && this._lastTipShape.tipShape.length > 0) { + this.zr.delShape(this._lastTipShape.tipShape); + this.shapeList.length = 2; + } + for (var i = 0, l = tipShape.length; i < l; i++) { + tipShape[i].zlevel = this.getZlevelBase(); + tipShape[i].z = this.getZBase(); + tipShape[i].style = zrShapeBase.prototype.getHighlightStyle(tipShape[i].style, tipShape[i].highlightStyle); + tipShape[i].draggable = false; + tipShape[i].hoverable = false; + tipShape[i].clickable = false; + tipShape[i].ondragend = null; + tipShape[i].ondragover = null; + tipShape[i].ondrop = null; + this.shapeList.push(tipShape[i]); + this.zr.addShape(tipShape[i]); + } + this._lastTipShape = { + dataIndex: param.dataIndex, + tipShape: tipShape + }; + } + }, + ondragend: function () { + this._hide(); + }, + onlegendSelected: function (param) { + this._selectedMap = param.selected; + }, + _setSelectedMap: function () { + if (this.component.legend) { + this._selectedMap = zrUtil.clone(this.component.legend.getSelectedMap()); + } else { + this._selectedMap = {}; + } + }, + _isSelected: function (itemName) { + if (this._selectedMap[itemName] != null) { + return this._selectedMap[itemName]; + } else { + return true; + } + }, + showTip: function (params) { + if (!params) { + return; + } + var seriesIndex; + var series = this.option.series; + if (params.seriesIndex != null) { + seriesIndex = params.seriesIndex; + } else { + var seriesName = params.seriesName; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].name === seriesName) { + seriesIndex = i; + break; + } + } + } + var serie = series[seriesIndex]; + if (serie == null) { + return; + } + var chart = this.myChart.chart[serie.type]; + var isAxisTrigger = this.deepQuery([ + serie, + this.option + ], 'tooltip.trigger') === 'axis'; + if (!chart) { + return; + } + if (isAxisTrigger) { + var dataIndex = params.dataIndex; + switch (chart.type) { + case ecConfig.CHART_TYPE_LINE: + case ecConfig.CHART_TYPE_BAR: + case ecConfig.CHART_TYPE_K: + if (this.component.xAxis == null || this.component.yAxis == null || serie.data.length <= dataIndex) { + return; + } + var xAxisIndex = serie.xAxisIndex || 0; + var yAxisIndex = serie.yAxisIndex || 0; + if (this.component.xAxis.getAxis(xAxisIndex).type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY) { + this._event = { + zrenderX: this.component.xAxis.getAxis(xAxisIndex).getCoordByIndex(dataIndex), + zrenderY: this.component.grid.getY() + (this.component.grid.getYend() - this.component.grid.getY()) / 4 + }; + } else { + this._event = { + zrenderX: this.component.grid.getX() + (this.component.grid.getXend() - this.component.grid.getX()) / 4, + zrenderY: this.component.yAxis.getAxis(yAxisIndex).getCoordByIndex(dataIndex) + }; + } + this._showAxisTrigger(xAxisIndex, yAxisIndex, dataIndex); + break; + case ecConfig.CHART_TYPE_RADAR: + if (this.component.polar == null || serie.data[0].value.length <= dataIndex) { + return; + } + var polarIndex = serie.polarIndex || 0; + var vector = this.component.polar.getVector(polarIndex, dataIndex, 'max'); + this._event = { + zrenderX: vector[0], + zrenderY: vector[1] + }; + this._showPolarTrigger(polarIndex, dataIndex); + break; + } + } else { + var shapeList = chart.shapeList; + var x; + var y; + switch (chart.type) { + case ecConfig.CHART_TYPE_LINE: + case ecConfig.CHART_TYPE_BAR: + case ecConfig.CHART_TYPE_K: + case ecConfig.CHART_TYPE_SCATTER: + var dataIndex = params.dataIndex; + for (var i = 0, l = shapeList.length; i < l; i++) { + if (shapeList[i]._mark == null && ecData.get(shapeList[i], 'seriesIndex') == seriesIndex && ecData.get(shapeList[i], 'dataIndex') == dataIndex) { + this._curTarget = shapeList[i]; + x = shapeList[i].style.x; + y = chart.type != ecConfig.CHART_TYPE_K ? shapeList[i].style.y : shapeList[i].style.y[0]; + break; + } + } + break; + case ecConfig.CHART_TYPE_RADAR: + var dataIndex = params.dataIndex; + for (var i = 0, l = shapeList.length; i < l; i++) { + if (shapeList[i].type === 'polygon' && ecData.get(shapeList[i], 'seriesIndex') == seriesIndex && ecData.get(shapeList[i], 'dataIndex') == dataIndex) { + this._curTarget = shapeList[i]; + var vector = this.component.polar.getCenter(serie.polarIndex || 0); + x = vector[0]; + y = vector[1]; + break; + } + } + break; + case ecConfig.CHART_TYPE_PIE: + var name = params.name; + for (var i = 0, l = shapeList.length; i < l; i++) { + if (shapeList[i].type === 'sector' && ecData.get(shapeList[i], 'seriesIndex') == seriesIndex && ecData.get(shapeList[i], 'name') == name) { + this._curTarget = shapeList[i]; + var style = this._curTarget.style; + var midAngle = (style.startAngle + style.endAngle) / 2 * Math.PI / 180; + x = this._curTarget.style.x + Math.cos(midAngle) * style.r / 1.5; + y = this._curTarget.style.y - Math.sin(midAngle) * style.r / 1.5; + break; + } + } + break; + case ecConfig.CHART_TYPE_MAP: + var name = params.name; + var mapType = serie.mapType; + for (var i = 0, l = shapeList.length; i < l; i++) { + if (shapeList[i].type === 'text' && shapeList[i]._mapType === mapType && shapeList[i].style._name === name) { + this._curTarget = shapeList[i]; + x = this._curTarget.style.x + this._curTarget.position[0]; + y = this._curTarget.style.y + this._curTarget.position[1]; + break; + } + } + break; + case ecConfig.CHART_TYPE_CHORD: + var name = params.name; + for (var i = 0, l = shapeList.length; i < l; i++) { + if (shapeList[i].type === 'sector' && ecData.get(shapeList[i], 'name') == name) { + this._curTarget = shapeList[i]; + var style = this._curTarget.style; + var midAngle = (style.startAngle + style.endAngle) / 2 * Math.PI / 180; + x = this._curTarget.style.x + Math.cos(midAngle) * (style.r - 2); + y = this._curTarget.style.y - Math.sin(midAngle) * (style.r - 2); + this.zr.trigger(zrConfig.EVENT.MOUSEMOVE, { + zrenderX: x, + zrenderY: y + }); + return; + } + } + break; + case ecConfig.CHART_TYPE_FORCE: + var name = params.name; + for (var i = 0, l = shapeList.length; i < l; i++) { + if (shapeList[i].type === 'circle' && ecData.get(shapeList[i], 'name') == name) { + this._curTarget = shapeList[i]; + x = this._curTarget.position[0]; + y = this._curTarget.position[1]; + break; + } + } + break; + } + if (x != null && y != null) { + this._event = { + zrenderX: x, + zrenderY: y + }; + this.zr.addHoverShape(this._curTarget); + this.zr.refreshHover(); + this._showItemTrigger(); + } + } + }, + hideTip: function () { + this._hide(); + }, + refresh: function (newOption) { + this._zrHeight = this.zr.getHeight(); + this._zrWidth = this.zr.getWidth(); + if (this._lastTipShape && this._lastTipShape.tipShape.length > 0) { + this.zr.delShape(this._lastTipShape.tipShape); + } + this._lastTipShape = false; + this.shapeList.length = 2; + this._lastDataIndex = -1; + this._lastSeriesIndex = -1; + this._lastItemTriggerId = -1; + if (newOption) { + this.option = newOption; + this.option.tooltip = this.reformOption(this.option.tooltip); + this.option.tooltip.textStyle = zrUtil.merge(this.option.tooltip.textStyle, this.ecTheme.textStyle); + this._needAxisTrigger = false; + if (this.option.tooltip.trigger === 'axis') { + this._needAxisTrigger = true; + } + var series = this.option.series; + for (var i = 0, l = series.length; i < l; i++) { + if (this.query(series[i], 'tooltip.trigger') === 'axis') { + this._needAxisTrigger = true; + break; + } + } + this._showDelay = this.option.tooltip.showDelay; + this._hideDelay = this.option.tooltip.hideDelay; + this._defaultCssText = this._style(this.option.tooltip); + this._setSelectedMap(); + this._axisLineWidth = this.option.tooltip.axisPointer.lineStyle.width; + this._enterable = this.option.tooltip.enterable; + } + if (this.showing) { + var self = this; + setTimeout(function () { + self.zr.trigger(zrConfig.EVENT.MOUSEMOVE, self.zr.handler._event); + }, 50); + } + }, + onbeforDispose: function () { + if (this._lastTipShape && this._lastTipShape.tipShape.length > 0) { + this.zr.delShape(this._lastTipShape.tipShape); + } + clearTimeout(this._hidingTicket); + clearTimeout(this._showingTicket); + this.zr.un(zrConfig.EVENT.MOUSEMOVE, this._onmousemove); + this.zr.un(zrConfig.EVENT.GLOBALOUT, this._onglobalout); + if (this.hasAppend && !!this.dom.firstChild) { + this.dom.firstChild.removeChild(this._tDom); + } + this._tDom = null; + }, + _encodeHTML: function (source) { + return String(source).replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"').replace(/'/g, '''); + } + }; + zrUtil.inherits(Tooltip, Base); + require('../component').define('tooltip', Tooltip); + return Tooltip; +});define('echarts/component/legend', [ + 'require', + './base', + 'zrender/shape/Text', + 'zrender/shape/Rectangle', + 'zrender/shape/Sector', + '../util/shape/Icon', + '../util/shape/Candle', + '../config', + 'zrender/tool/util', + 'zrender/tool/area', + '../component' +], function (require) { + var Base = require('./base'); + var TextShape = require('zrender/shape/Text'); + var RectangleShape = require('zrender/shape/Rectangle'); + var SectorShape = require('zrender/shape/Sector'); + var IconShape = require('../util/shape/Icon'); + var CandleShape = require('../util/shape/Candle'); + var ecConfig = require('../config'); + ecConfig.legend = { + zlevel: 0, + z: 4, + show: true, + orient: 'horizontal', + x: 'center', + y: 'top', + backgroundColor: 'rgba(0,0,0,0)', + borderColor: '#ccc', + borderWidth: 0, + padding: 5, + itemGap: 10, + itemWidth: 20, + itemHeight: 14, + textStyle: { color: '#333' }, + selectedMode: true + }; + var zrUtil = require('zrender/tool/util'); + var zrArea = require('zrender/tool/area'); + function Legend(ecTheme, messageCenter, zr, option, myChart) { + if (!this.query(option, 'legend.data')) { + console.error('option.legend.data has not been defined.'); + return; + } + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + var self = this; + self._legendSelected = function (param) { + self.__legendSelected(param); + }; + self._dispatchHoverLink = function (param) { + return self.__dispatchHoverLink(param); + }; + this._colorIndex = 0; + this._colorMap = {}; + this._selectedMap = {}; + this._hasDataMap = {}; + this.refresh(option); + } + Legend.prototype = { + type: ecConfig.COMPONENT_TYPE_LEGEND, + _buildShape: function () { + if (!this.legendOption.show) { + return; + } + this._itemGroupLocation = this._getItemGroupLocation(); + this._buildBackground(); + this._buildItem(); + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + }, + _buildItem: function () { + var data = this.legendOption.data; + var dataLength = data.length; + var itemName; + var itemType; + var itemShape; + var textShape; + var textStyle = this.legendOption.textStyle; + var dataTextStyle; + var dataFont; + var formattedName; + var zrWidth = this.zr.getWidth(); + var zrHeight = this.zr.getHeight(); + var lastX = this._itemGroupLocation.x; + var lastY = this._itemGroupLocation.y; + var itemWidth = this.legendOption.itemWidth; + var itemHeight = this.legendOption.itemHeight; + var itemGap = this.legendOption.itemGap; + var color; + if (this.legendOption.orient === 'vertical' && this.legendOption.x === 'right') { + lastX = this._itemGroupLocation.x + this._itemGroupLocation.width - itemWidth; + } + for (var i = 0; i < dataLength; i++) { + dataTextStyle = zrUtil.merge(data[i].textStyle || {}, textStyle); + dataFont = this.getFont(dataTextStyle); + itemName = this._getName(data[i]); + formattedName = this._getFormatterName(itemName); + if (itemName === '') { + if (this.legendOption.orient === 'horizontal') { + lastX = this._itemGroupLocation.x; + lastY += itemHeight + itemGap; + } else { + this.legendOption.x === 'right' ? lastX -= this._itemGroupLocation.maxWidth + itemGap : lastX += this._itemGroupLocation.maxWidth + itemGap; + lastY = this._itemGroupLocation.y; + } + continue; + } + itemType = data[i].icon || this._getSomethingByName(itemName).type; + color = this.getColor(itemName); + if (this.legendOption.orient === 'horizontal') { + if (zrWidth - lastX < 200 && itemWidth + 5 + zrArea.getTextWidth(formattedName, dataFont) + (i === dataLength - 1 || data[i + 1] === '' ? 0 : itemGap) >= zrWidth - lastX) { + lastX = this._itemGroupLocation.x; + lastY += itemHeight + itemGap; + } + } else { + if (zrHeight - lastY < 200 && itemHeight + (i === dataLength - 1 || data[i + 1] === '' ? 0 : itemGap) >= zrHeight - lastY) { + this.legendOption.x === 'right' ? lastX -= this._itemGroupLocation.maxWidth + itemGap : lastX += this._itemGroupLocation.maxWidth + itemGap; + lastY = this._itemGroupLocation.y; + } + } + itemShape = this._getItemShapeByType(lastX, lastY, itemWidth, itemHeight, this._selectedMap[itemName] && this._hasDataMap[itemName] ? color : '#ccc', itemType, color); + itemShape._name = itemName; + itemShape = new IconShape(itemShape); + textShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: lastX + itemWidth + 5, + y: lastY + itemHeight / 2, + color: this._selectedMap[itemName] ? dataTextStyle.color === 'auto' ? color : dataTextStyle.color : '#ccc', + text: formattedName, + textFont: dataFont, + textBaseline: 'middle' + }, + highlightStyle: { + color: color, + brushType: 'fill' + }, + hoverable: !!this.legendOption.selectedMode, + clickable: !!this.legendOption.selectedMode + }; + if (this.legendOption.orient === 'vertical' && this.legendOption.x === 'right') { + textShape.style.x -= itemWidth + 10; + textShape.style.textAlign = 'right'; + } + textShape._name = itemName; + textShape = new TextShape(textShape); + if (this.legendOption.selectedMode) { + itemShape.onclick = textShape.onclick = this._legendSelected; + itemShape.onmouseover = textShape.onmouseover = this._dispatchHoverLink; + itemShape.hoverConnect = textShape.id; + textShape.hoverConnect = itemShape.id; + } + this.shapeList.push(itemShape); + this.shapeList.push(textShape); + if (this.legendOption.orient === 'horizontal') { + lastX += itemWidth + 5 + zrArea.getTextWidth(formattedName, dataFont) + itemGap; + } else { + lastY += itemHeight + itemGap; + } + } + if (this.legendOption.orient === 'horizontal' && this.legendOption.x === 'center' && lastY != this._itemGroupLocation.y) { + this._mLineOptimize(); + } + }, + _getName: function (data) { + return typeof data.name != 'undefined' ? data.name : data; + }, + _getFormatterName: function (itemName) { + var formatter = this.legendOption.formatter; + var formattedName; + if (typeof formatter === 'function') { + formattedName = formatter.call(this.myChart, itemName); + } else if (typeof formatter === 'string') { + formattedName = formatter.replace('{name}', itemName); + } else { + formattedName = itemName; + } + return formattedName; + }, + _getFormatterNameFromData: function (data) { + var itemName = this._getName(data); + return this._getFormatterName(itemName); + }, + _mLineOptimize: function () { + var lineOffsetArray = []; + var lastX = this._itemGroupLocation.x; + for (var i = 2, l = this.shapeList.length; i < l; i++) { + if (this.shapeList[i].style.x === lastX) { + lineOffsetArray.push((this._itemGroupLocation.width - (this.shapeList[i - 1].style.x + zrArea.getTextWidth(this.shapeList[i - 1].style.text, this.shapeList[i - 1].style.textFont) - lastX)) / 2); + } else if (i === l - 1) { + lineOffsetArray.push((this._itemGroupLocation.width - (this.shapeList[i].style.x + zrArea.getTextWidth(this.shapeList[i].style.text, this.shapeList[i].style.textFont) - lastX)) / 2); + } + } + var curLineIndex = -1; + for (var i = 1, l = this.shapeList.length; i < l; i++) { + if (this.shapeList[i].style.x === lastX) { + curLineIndex++; + } + if (lineOffsetArray[curLineIndex] === 0) { + continue; + } else { + this.shapeList[i].style.x += lineOffsetArray[curLineIndex]; + } + } + }, + _buildBackground: function () { + var padding = this.reformCssArray(this.legendOption.padding); + this.shapeList.push(new RectangleShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: this._itemGroupLocation.x - padding[3], + y: this._itemGroupLocation.y - padding[0], + width: this._itemGroupLocation.width + padding[3] + padding[1], + height: this._itemGroupLocation.height + padding[0] + padding[2], + brushType: this.legendOption.borderWidth === 0 ? 'fill' : 'both', + color: this.legendOption.backgroundColor, + strokeColor: this.legendOption.borderColor, + lineWidth: this.legendOption.borderWidth + } + })); + }, + _getItemGroupLocation: function () { + var data = this.legendOption.data; + var dataLength = data.length; + var itemGap = this.legendOption.itemGap; + var itemWidth = this.legendOption.itemWidth + 5; + var itemHeight = this.legendOption.itemHeight; + var textStyle = this.legendOption.textStyle; + var font = this.getFont(textStyle); + var totalWidth = 0; + var totalHeight = 0; + var padding = this.reformCssArray(this.legendOption.padding); + var zrWidth = this.zr.getWidth() - padding[1] - padding[3]; + var zrHeight = this.zr.getHeight() - padding[0] - padding[2]; + var temp = 0; + var maxWidth = 0; + if (this.legendOption.orient === 'horizontal') { + totalHeight = itemHeight; + for (var i = 0; i < dataLength; i++) { + if (this._getName(data[i]) === '') { + temp -= itemGap; + totalWidth = Math.max(totalWidth, temp); + totalHeight += itemHeight + itemGap; + temp = 0; + continue; + } + var tempTextWidth = zrArea.getTextWidth(this._getFormatterNameFromData(data[i]), data[i].textStyle ? this.getFont(zrUtil.merge(data[i].textStyle || {}, textStyle)) : font); + if (temp + itemWidth + tempTextWidth + itemGap > zrWidth) { + temp -= itemGap; + totalWidth = Math.max(totalWidth, temp); + totalHeight += itemHeight + itemGap; + temp = 0; + } else { + temp += itemWidth + tempTextWidth + itemGap; + totalWidth = Math.max(totalWidth, temp - itemGap); + } + } + } else { + for (var i = 0; i < dataLength; i++) { + maxWidth = Math.max(maxWidth, zrArea.getTextWidth(this._getFormatterNameFromData(data[i]), data[i].textStyle ? this.getFont(zrUtil.merge(data[i].textStyle || {}, textStyle)) : font)); + } + maxWidth += itemWidth; + totalWidth = maxWidth; + for (var i = 0; i < dataLength; i++) { + if (this._getName(data[i]) === '') { + totalWidth += maxWidth + itemGap; + temp -= itemGap; + totalHeight = Math.max(totalHeight, temp); + temp = 0; + continue; + } + if (temp + itemHeight + itemGap > zrHeight) { + totalWidth += maxWidth + itemGap; + temp -= itemGap; + totalHeight = Math.max(totalHeight, temp); + temp = 0; + } else { + temp += itemHeight + itemGap; + totalHeight = Math.max(totalHeight, temp - itemGap); + } + } + } + zrWidth = this.zr.getWidth(); + zrHeight = this.zr.getHeight(); + var x; + switch (this.legendOption.x) { + case 'center': + x = Math.floor((zrWidth - totalWidth) / 2); + break; + case 'left': + x = padding[3] + this.legendOption.borderWidth; + break; + case 'right': + x = zrWidth - totalWidth - padding[1] - padding[3] - this.legendOption.borderWidth * 2; + break; + default: + x = this.parsePercent(this.legendOption.x, zrWidth); + break; + } + var y; + switch (this.legendOption.y) { + case 'top': + y = padding[0] + this.legendOption.borderWidth; + break; + case 'bottom': + y = zrHeight - totalHeight - padding[0] - padding[2] - this.legendOption.borderWidth * 2; + break; + case 'center': + y = Math.floor((zrHeight - totalHeight) / 2); + break; + default: + y = this.parsePercent(this.legendOption.y, zrHeight); + break; + } + return { + x: x, + y: y, + width: totalWidth, + height: totalHeight, + maxWidth: maxWidth + }; + }, + _getSomethingByName: function (name) { + var series = this.option.series; + var data; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].name === name) { + return { + type: series[i].type, + series: series[i], + seriesIndex: i, + data: null, + dataIndex: -1 + }; + } + if (series[i].type === ecConfig.CHART_TYPE_PIE || series[i].type === ecConfig.CHART_TYPE_RADAR || series[i].type === ecConfig.CHART_TYPE_CHORD || series[i].type === ecConfig.CHART_TYPE_FORCE || series[i].type === ecConfig.CHART_TYPE_FUNNEL) { + data = series[i].categories || series[i].data || series[i].nodes; + for (var j = 0, k = data.length; j < k; j++) { + if (data[j].name === name) { + return { + type: series[i].type, + series: series[i], + seriesIndex: i, + data: data[j], + dataIndex: j + }; + } + } + } + } + return { + type: 'bar', + series: null, + seriesIndex: -1, + data: null, + dataIndex: -1 + }; + }, + _getItemShapeByType: function (x, y, width, height, color, itemType, defaultColor) { + var highlightColor = color === '#ccc' ? defaultColor : color; + var itemShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + iconType: 'legendicon' + itemType, + x: x, + y: y, + width: width, + height: height, + color: color, + strokeColor: color, + lineWidth: 2 + }, + highlightStyle: { + color: highlightColor, + strokeColor: highlightColor, + lineWidth: 1 + }, + hoverable: this.legendOption.selectedMode, + clickable: this.legendOption.selectedMode + }; + var imageLocation; + if (itemType.match('image')) { + var imageLocation = itemType.replace(new RegExp('^image:\\/\\/'), ''); + itemType = 'image'; + } + switch (itemType) { + case 'line': + itemShape.style.brushType = 'stroke'; + itemShape.highlightStyle.lineWidth = 3; + break; + case 'radar': + case 'scatter': + itemShape.highlightStyle.lineWidth = 3; + break; + case 'k': + itemShape.style.brushType = 'both'; + itemShape.highlightStyle.lineWidth = 3; + itemShape.highlightStyle.color = itemShape.style.color = this.deepQuery([ + this.ecTheme, + ecConfig + ], 'k.itemStyle.normal.color') || '#fff'; + itemShape.style.strokeColor = color != '#ccc' ? this.deepQuery([ + this.ecTheme, + ecConfig + ], 'k.itemStyle.normal.lineStyle.color') || '#ff3200' : color; + break; + case 'image': + itemShape.style.iconType = 'image'; + itemShape.style.image = imageLocation; + if (color === '#ccc') { + itemShape.style.opacity = 0.5; + } + break; + } + return itemShape; + }, + __legendSelected: function (param) { + var itemName = param.target._name; + if (this.legendOption.selectedMode === 'single') { + for (var k in this._selectedMap) { + this._selectedMap[k] = false; + } + } + this._selectedMap[itemName] = !this._selectedMap[itemName]; + this.messageCenter.dispatch(ecConfig.EVENT.LEGEND_SELECTED, param.event, { + selected: this._selectedMap, + target: itemName + }, this.myChart); + }, + __dispatchHoverLink: function (param) { + this.messageCenter.dispatch(ecConfig.EVENT.LEGEND_HOVERLINK, param.event, { target: param.target._name }, this.myChart); + return; + }, + refresh: function (newOption) { + if (newOption) { + this.option = newOption || this.option; + this.option.legend = this.reformOption(this.option.legend); + this.legendOption = this.option.legend; + var data = this.legendOption.data || []; + var itemName; + var something; + var color; + var queryTarget; + if (this.legendOption.selected) { + for (var k in this.legendOption.selected) { + this._selectedMap[k] = typeof this._selectedMap[k] != 'undefined' ? this._selectedMap[k] : this.legendOption.selected[k]; + } + } + for (var i = 0, dataLength = data.length; i < dataLength; i++) { + itemName = this._getName(data[i]); + if (itemName === '') { + continue; + } + something = this._getSomethingByName(itemName); + if (!something.series) { + this._hasDataMap[itemName] = false; + } else { + this._hasDataMap[itemName] = true; + if (something.data && (something.type === ecConfig.CHART_TYPE_PIE || something.type === ecConfig.CHART_TYPE_FORCE || something.type === ecConfig.CHART_TYPE_FUNNEL)) { + queryTarget = [ + something.data, + something.series + ]; + } else { + queryTarget = [something.series]; + } + color = this.getItemStyleColor(this.deepQuery(queryTarget, 'itemStyle.normal.color'), something.seriesIndex, something.dataIndex, something.data); + if (color && something.type != ecConfig.CHART_TYPE_K) { + this.setColor(itemName, color); + } + this._selectedMap[itemName] = this._selectedMap[itemName] != null ? this._selectedMap[itemName] : true; + } + } + } + this.clear(); + this._buildShape(); + }, + getRelatedAmount: function (name) { + var amount = 0; + var series = this.option.series; + var data; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].name === name) { + amount++; + } + if (series[i].type === ecConfig.CHART_TYPE_PIE || series[i].type === ecConfig.CHART_TYPE_RADAR || series[i].type === ecConfig.CHART_TYPE_CHORD || series[i].type === ecConfig.CHART_TYPE_FORCE || series[i].type === ecConfig.CHART_TYPE_FUNNEL) { + data = series[i].type != ecConfig.CHART_TYPE_FORCE ? series[i].data : series[i].categories; + for (var j = 0, k = data.length; j < k; j++) { + if (data[j].name === name && data[j].value != '-') { + amount++; + } + } + } + } + return amount; + }, + setColor: function (legendName, color) { + this._colorMap[legendName] = color; + }, + getColor: function (legendName) { + if (!this._colorMap[legendName]) { + this._colorMap[legendName] = this.zr.getColor(this._colorIndex++); + } + return this._colorMap[legendName]; + }, + hasColor: function (legendName) { + return this._colorMap[legendName] ? this._colorMap[legendName] : false; + }, + add: function (name, color) { + var data = this.legendOption.data; + for (var i = 0, dataLength = data.length; i < dataLength; i++) { + if (this._getName(data[i]) === name) { + return; + } + } + this.legendOption.data.push(name); + this.setColor(name, color); + this._selectedMap[name] = true; + this._hasDataMap[name] = true; + }, + del: function (name) { + var data = this.legendOption.data; + for (var i = 0, dataLength = data.length; i < dataLength; i++) { + if (this._getName(data[i]) === name) { + return this.legendOption.data.splice(i, 1); + } + } + }, + getItemShape: function (name) { + if (name == null) { + return; + } + var shape; + for (var i = 0, l = this.shapeList.length; i < l; i++) { + shape = this.shapeList[i]; + if (shape._name === name && shape.type != 'text') { + return shape; + } + } + }, + setItemShape: function (name, itemShape) { + var shape; + for (var i = 0, l = this.shapeList.length; i < l; i++) { + shape = this.shapeList[i]; + if (shape._name === name && shape.type != 'text') { + if (!this._selectedMap[name]) { + itemShape.style.color = '#ccc'; + itemShape.style.strokeColor = '#ccc'; + } + this.zr.modShape(shape.id, itemShape); + } + } + }, + isSelected: function (itemName) { + if (typeof this._selectedMap[itemName] != 'undefined') { + return this._selectedMap[itemName]; + } else { + return true; + } + }, + getSelectedMap: function () { + return this._selectedMap; + }, + setSelected: function (itemName, selectStatus) { + if (this.legendOption.selectedMode === 'single') { + for (var k in this._selectedMap) { + this._selectedMap[k] = false; + } + } + this._selectedMap[itemName] = selectStatus; + this.messageCenter.dispatch(ecConfig.EVENT.LEGEND_SELECTED, null, { + selected: this._selectedMap, + target: itemName + }, this.myChart); + }, + onlegendSelected: function (param, status) { + var legendSelected = param.selected; + for (var itemName in legendSelected) { + if (this._selectedMap[itemName] != legendSelected[itemName]) { + status.needRefresh = true; + } + this._selectedMap[itemName] = legendSelected[itemName]; + } + return; + } + }; + var legendIcon = { + line: function (ctx, style) { + var dy = style.height / 2; + ctx.moveTo(style.x, style.y + dy); + ctx.lineTo(style.x + style.width, style.y + dy); + }, + pie: function (ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + SectorShape.prototype.buildPath(ctx, { + x: x + width / 2, + y: y + height + 2, + r: height, + r0: 6, + startAngle: 45, + endAngle: 135 + }); + }, + eventRiver: function (ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + ctx.moveTo(x, y + height); + ctx.bezierCurveTo(x + width, y + height, x, y + 4, x + width, y + 4); + ctx.lineTo(x + width, y); + ctx.bezierCurveTo(x, y, x + width, y + height - 4, x, y + height - 4); + ctx.lineTo(x, y + height); + }, + k: function (ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + CandleShape.prototype.buildPath(ctx, { + x: x + width / 2, + y: [ + y + 1, + y + 1, + y + height - 6, + y + height + ], + width: width - 6 + }); + }, + bar: function (ctx, style) { + var x = style.x; + var y = style.y + 1; + var width = style.width; + var height = style.height - 2; + var r = 3; + ctx.moveTo(x + r, y); + ctx.lineTo(x + width - r, y); + ctx.quadraticCurveTo(x + width, y, x + width, y + r); + ctx.lineTo(x + width, y + height - r); + ctx.quadraticCurveTo(x + width, y + height, x + width - r, y + height); + ctx.lineTo(x + r, y + height); + ctx.quadraticCurveTo(x, y + height, x, y + height - r); + ctx.lineTo(x, y + r); + ctx.quadraticCurveTo(x, y, x + r, y); + }, + force: function (ctx, style) { + IconShape.prototype.iconLibrary.circle(ctx, style); + }, + radar: function (ctx, style) { + var n = 6; + var x = style.x + style.width / 2; + var y = style.y + style.height / 2; + var r = style.height / 2; + var dStep = 2 * Math.PI / n; + var deg = -Math.PI / 2; + var xStart = x + r * Math.cos(deg); + var yStart = y + r * Math.sin(deg); + ctx.moveTo(xStart, yStart); + deg += dStep; + for (var i = 0, end = n - 1; i < end; i++) { + ctx.lineTo(x + r * Math.cos(deg), y + r * Math.sin(deg)); + deg += dStep; + } + ctx.lineTo(xStart, yStart); + } + }; + legendIcon.chord = legendIcon.pie; + legendIcon.map = legendIcon.bar; + for (var k in legendIcon) { + IconShape.prototype.iconLibrary['legendicon' + k] = legendIcon[k]; + } + zrUtil.inherits(Legend, Base); + require('../component').define('legend', Legend); + return Legend; +});define('echarts/util/ecData', [], function () { + function pack(shape, series, seriesIndex, data, dataIndex, name, special, special2) { + var value; + if (typeof data != 'undefined') { + value = data.value == null ? data : data.value; + } + shape._echartsData = { + '_series': series, + '_seriesIndex': seriesIndex, + '_data': data, + '_dataIndex': dataIndex, + '_name': name, + '_value': value, + '_special': special, + '_special2': special2 + }; + return shape._echartsData; + } + function get(shape, key) { + var data = shape._echartsData; + if (!key) { + return data; + } + switch (key) { + case 'series': + case 'seriesIndex': + case 'data': + case 'dataIndex': + case 'name': + case 'value': + case 'special': + case 'special2': + return data && data['_' + key]; + } + return null; + } + function set(shape, key, value) { + shape._echartsData = shape._echartsData || {}; + switch (key) { + case 'series': + case 'seriesIndex': + case 'data': + case 'dataIndex': + case 'name': + case 'value': + case 'special': + case 'special2': + shape._echartsData['_' + key] = value; + break; + } + } + function clone(source, target) { + target._echartsData = { + '_series': source._echartsData._series, + '_seriesIndex': source._echartsData._seriesIndex, + '_data': source._echartsData._data, + '_dataIndex': source._echartsData._dataIndex, + '_name': source._echartsData._name, + '_value': source._echartsData._value, + '_special': source._echartsData._special, + '_special2': source._echartsData._special2 + }; + } + return { + pack: pack, + set: set, + get: get, + clone: clone + }; +});define('echarts/chart', [], function () { + var self = {}; + var _chartLibrary = {}; + self.define = function (name, clazz) { + _chartLibrary[name] = clazz; + return self; + }; + self.get = function (name) { + return _chartLibrary[name]; + }; + return self; +});define('zrender/tool/color', [ + 'require', + '../tool/util' +], function (require) { + var util = require('../tool/util'); + var _ctx; + var palette = [ + '#ff9277', + ' #dddd00', + ' #ffc877', + ' #bbe3ff', + ' #d5ffbb', + '#bbbbff', + ' #ddb000', + ' #b0dd00', + ' #e2bbff', + ' #ffbbe3', + '#ff7777', + ' #ff9900', + ' #83dd00', + ' #77e3ff', + ' #778fff', + '#c877ff', + ' #ff77ab', + ' #ff6600', + ' #aa8800', + ' #77c7ff', + '#ad77ff', + ' #ff77ff', + ' #dd0083', + ' #777700', + ' #00aa00', + '#0088aa', + ' #8400dd', + ' #aa0088', + ' #dd0000', + ' #772e00' + ]; + var _palette = palette; + var highlightColor = 'rgba(255,255,0,0.5)'; + var _highlightColor = highlightColor; + var colorRegExp = /^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i; + var _nameColors = { + aliceblue: '#f0f8ff', + antiquewhite: '#faebd7', + aqua: '#0ff', + aquamarine: '#7fffd4', + azure: '#f0ffff', + beige: '#f5f5dc', + bisque: '#ffe4c4', + black: '#000', + blanchedalmond: '#ffebcd', + blue: '#00f', + blueviolet: '#8a2be2', + brown: '#a52a2a', + burlywood: '#deb887', + cadetblue: '#5f9ea0', + chartreuse: '#7fff00', + chocolate: '#d2691e', + coral: '#ff7f50', + cornflowerblue: '#6495ed', + cornsilk: '#fff8dc', + crimson: '#dc143c', + cyan: '#0ff', + darkblue: '#00008b', + darkcyan: '#008b8b', + darkgoldenrod: '#b8860b', + darkgray: '#a9a9a9', + darkgrey: '#a9a9a9', + darkgreen: '#006400', + darkkhaki: '#bdb76b', + darkmagenta: '#8b008b', + darkolivegreen: '#556b2f', + darkorange: '#ff8c00', + darkorchid: '#9932cc', + darkred: '#8b0000', + darksalmon: '#e9967a', + darkseagreen: '#8fbc8f', + darkslateblue: '#483d8b', + darkslategray: '#2f4f4f', + darkslategrey: '#2f4f4f', + darkturquoise: '#00ced1', + darkviolet: '#9400d3', + deeppink: '#ff1493', + deepskyblue: '#00bfff', + dimgray: '#696969', + dimgrey: '#696969', + dodgerblue: '#1e90ff', + firebrick: '#b22222', + floralwhite: '#fffaf0', + forestgreen: '#228b22', + fuchsia: '#f0f', + gainsboro: '#dcdcdc', + ghostwhite: '#f8f8ff', + gold: '#ffd700', + goldenrod: '#daa520', + gray: '#808080', + grey: '#808080', + green: '#008000', + greenyellow: '#adff2f', + honeydew: '#f0fff0', + hotpink: '#ff69b4', + indianred: '#cd5c5c', + indigo: '#4b0082', + ivory: '#fffff0', + khaki: '#f0e68c', + lavender: '#e6e6fa', + lavenderblush: '#fff0f5', + lawngreen: '#7cfc00', + lemonchiffon: '#fffacd', + lightblue: '#add8e6', + lightcoral: '#f08080', + lightcyan: '#e0ffff', + lightgoldenrodyellow: '#fafad2', + lightgray: '#d3d3d3', + lightgrey: '#d3d3d3', + lightgreen: '#90ee90', + lightpink: '#ffb6c1', + lightsalmon: '#ffa07a', + lightseagreen: '#20b2aa', + lightskyblue: '#87cefa', + lightslategray: '#789', + lightslategrey: '#789', + lightsteelblue: '#b0c4de', + lightyellow: '#ffffe0', + lime: '#0f0', + limegreen: '#32cd32', + linen: '#faf0e6', + magenta: '#f0f', + maroon: '#800000', + mediumaquamarine: '#66cdaa', + mediumblue: '#0000cd', + mediumorchid: '#ba55d3', + mediumpurple: '#9370d8', + mediumseagreen: '#3cb371', + mediumslateblue: '#7b68ee', + mediumspringgreen: '#00fa9a', + mediumturquoise: '#48d1cc', + mediumvioletred: '#c71585', + midnightblue: '#191970', + mintcream: '#f5fffa', + mistyrose: '#ffe4e1', + moccasin: '#ffe4b5', + navajowhite: '#ffdead', + navy: '#000080', + oldlace: '#fdf5e6', + olive: '#808000', + olivedrab: '#6b8e23', + orange: '#ffa500', + orangered: '#ff4500', + orchid: '#da70d6', + palegoldenrod: '#eee8aa', + palegreen: '#98fb98', + paleturquoise: '#afeeee', + palevioletred: '#d87093', + papayawhip: '#ffefd5', + peachpuff: '#ffdab9', + peru: '#cd853f', + pink: '#ffc0cb', + plum: '#dda0dd', + powderblue: '#b0e0e6', + purple: '#800080', + red: '#f00', + rosybrown: '#bc8f8f', + royalblue: '#4169e1', + saddlebrown: '#8b4513', + salmon: '#fa8072', + sandybrown: '#f4a460', + seagreen: '#2e8b57', + seashell: '#fff5ee', + sienna: '#a0522d', + silver: '#c0c0c0', + skyblue: '#87ceeb', + slateblue: '#6a5acd', + slategray: '#708090', + slategrey: '#708090', + snow: '#fffafa', + springgreen: '#00ff7f', + steelblue: '#4682b4', + tan: '#d2b48c', + teal: '#008080', + thistle: '#d8bfd8', + tomato: '#ff6347', + turquoise: '#40e0d0', + violet: '#ee82ee', + wheat: '#f5deb3', + white: '#fff', + whitesmoke: '#f5f5f5', + yellow: '#ff0', + yellowgreen: '#9acd32' + }; + function customPalette(userPalete) { + palette = userPalete; + } + function resetPalette() { + palette = _palette; + } + function getColor(idx, userPalete) { + idx = idx | 0; + userPalete = userPalete || palette; + return userPalete[idx % userPalete.length]; + } + function customHighlight(userHighlightColor) { + highlightColor = userHighlightColor; + } + function resetHighlight() { + _highlightColor = highlightColor; + } + function getHighlightColor() { + return highlightColor; + } + function getRadialGradient(x0, y0, r0, x1, y1, r1, colorList) { + if (!_ctx) { + _ctx = util.getContext(); + } + var gradient = _ctx.createRadialGradient(x0, y0, r0, x1, y1, r1); + for (var i = 0, l = colorList.length; i < l; i++) { + gradient.addColorStop(colorList[i][0], colorList[i][1]); + } + gradient.__nonRecursion = true; + return gradient; + } + function getLinearGradient(x0, y0, x1, y1, colorList) { + if (!_ctx) { + _ctx = util.getContext(); + } + var gradient = _ctx.createLinearGradient(x0, y0, x1, y1); + for (var i = 0, l = colorList.length; i < l; i++) { + gradient.addColorStop(colorList[i][0], colorList[i][1]); + } + gradient.__nonRecursion = true; + return gradient; + } + function getStepColors(start, end, step) { + start = toRGBA(start); + end = toRGBA(end); + start = getData(start); + end = getData(end); + var colors = []; + var stepR = (end[0] - start[0]) / step; + var stepG = (end[1] - start[1]) / step; + var stepB = (end[2] - start[2]) / step; + var stepA = (end[3] - start[3]) / step; + for (var i = 0, r = start[0], g = start[1], b = start[2], a = start[3]; i < step; i++) { + colors[i] = toColor([ + adjust(Math.floor(r), [ + 0, + 255 + ]), + adjust(Math.floor(g), [ + 0, + 255 + ]), + adjust(Math.floor(b), [ + 0, + 255 + ]), + a.toFixed(4) - 0 + ], 'rgba'); + r += stepR; + g += stepG; + b += stepB; + a += stepA; + } + r = end[0]; + g = end[1]; + b = end[2]; + a = end[3]; + colors[i] = toColor([ + r, + g, + b, + a + ], 'rgba'); + return colors; + } + function getGradientColors(colors, step) { + var ret = []; + var len = colors.length; + if (step === undefined) { + step = 20; + } + if (len === 1) { + ret = getStepColors(colors[0], colors[0], step); + } else if (len > 1) { + for (var i = 0, n = len - 1; i < n; i++) { + var steps = getStepColors(colors[i], colors[i + 1], step); + if (i < n - 1) { + steps.pop(); + } + ret = ret.concat(steps); + } + } + return ret; + } + function toColor(data, format) { + format = format || 'rgb'; + if (data && (data.length === 3 || data.length === 4)) { + data = map(data, function (c) { + return c > 1 ? Math.ceil(c) : c; + }); + if (format.indexOf('hex') > -1) { + return '#' + ((1 << 24) + (data[0] << 16) + (data[1] << 8) + +data[2]).toString(16).slice(1); + } else if (format.indexOf('hs') > -1) { + var sx = map(data.slice(1, 3), function (c) { + return c + '%'; + }); + data[1] = sx[0]; + data[2] = sx[1]; + } + if (format.indexOf('a') > -1) { + if (data.length === 3) { + data.push(1); + } + data[3] = adjust(data[3], [ + 0, + 1 + ]); + return format + '(' + data.slice(0, 4).join(',') + ')'; + } + return format + '(' + data.slice(0, 3).join(',') + ')'; + } + } + function toArray(color) { + color = trim(color); + if (color.indexOf('rgba') < 0) { + color = toRGBA(color); + } + var data = []; + var i = 0; + color.replace(/[\d.]+/g, function (n) { + if (i < 3) { + n = n | 0; + } else { + n = +n; + } + data[i++] = n; + }); + return data; + } + function convert(color, format) { + if (!isCalculableColor(color)) { + return color; + } + var data = getData(color); + var alpha = data[3]; + if (typeof alpha === 'undefined') { + alpha = 1; + } + if (color.indexOf('hsb') > -1) { + data = _HSV_2_RGB(data); + } else if (color.indexOf('hsl') > -1) { + data = _HSL_2_RGB(data); + } + if (format.indexOf('hsb') > -1 || format.indexOf('hsv') > -1) { + data = _RGB_2_HSB(data); + } else if (format.indexOf('hsl') > -1) { + data = _RGB_2_HSL(data); + } + data[3] = alpha; + return toColor(data, format); + } + function toRGBA(color) { + return convert(color, 'rgba'); + } + function toRGB(color) { + return convert(color, 'rgb'); + } + function toHex(color) { + return convert(color, 'hex'); + } + function toHSVA(color) { + return convert(color, 'hsva'); + } + function toHSV(color) { + return convert(color, 'hsv'); + } + function toHSBA(color) { + return convert(color, 'hsba'); + } + function toHSB(color) { + return convert(color, 'hsb'); + } + function toHSLA(color) { + return convert(color, 'hsla'); + } + function toHSL(color) { + return convert(color, 'hsl'); + } + function toName(color) { + for (var key in _nameColors) { + if (toHex(_nameColors[key]) === toHex(color)) { + return key; + } + } + return null; + } + function trim(color) { + return String(color).replace(/\s+/g, ''); + } + function normalize(color) { + if (_nameColors[color]) { + color = _nameColors[color]; + } + color = trim(color); + color = color.replace(/hsv/i, 'hsb'); + if (/^#[\da-f]{3}$/i.test(color)) { + color = parseInt(color.slice(1), 16); + var r = (color & 3840) << 8; + var g = (color & 240) << 4; + var b = color & 15; + color = '#' + ((1 << 24) + (r << 4) + r + (g << 4) + g + (b << 4) + b).toString(16).slice(1); + } + return color; + } + function lift(color, level) { + if (!isCalculableColor(color)) { + return color; + } + var direct = level > 0 ? 1 : -1; + if (typeof level === 'undefined') { + level = 0; + } + level = Math.abs(level) > 1 ? 1 : Math.abs(level); + color = toRGB(color); + var data = getData(color); + for (var i = 0; i < 3; i++) { + if (direct === 1) { + data[i] = data[i] * (1 - level) | 0; + } else { + data[i] = (255 - data[i]) * level + data[i] | 0; + } + } + return 'rgb(' + data.join(',') + ')'; + } + function reverse(color) { + if (!isCalculableColor(color)) { + return color; + } + var data = getData(toRGBA(color)); + data = map(data, function (c) { + return 255 - c; + }); + return toColor(data, 'rgb'); + } + function mix(color1, color2, weight) { + if (!isCalculableColor(color1) || !isCalculableColor(color2)) { + return color1; + } + if (typeof weight === 'undefined') { + weight = 0.5; + } + weight = 1 - adjust(weight, [ + 0, + 1 + ]); + var w = weight * 2 - 1; + var data1 = getData(toRGBA(color1)); + var data2 = getData(toRGBA(color2)); + var d = data1[3] - data2[3]; + var weight1 = ((w * d === -1 ? w : (w + d) / (1 + w * d)) + 1) / 2; + var weight2 = 1 - weight1; + var data = []; + for (var i = 0; i < 3; i++) { + data[i] = data1[i] * weight1 + data2[i] * weight2; + } + var alpha = data1[3] * weight + data2[3] * (1 - weight); + alpha = Math.max(0, Math.min(1, alpha)); + if (data1[3] === 1 && data2[3] === 1) { + return toColor(data, 'rgb'); + } + data[3] = alpha; + return toColor(data, 'rgba'); + } + function random() { + return '#' + (Math.random().toString(16) + '0000').slice(2, 8); + } + function getData(color) { + color = normalize(color); + var r = color.match(colorRegExp); + if (r === null) { + throw new Error('The color format error'); + } + var d; + var a; + var data = []; + var rgb; + if (r[2]) { + d = r[2].replace('#', '').split(''); + rgb = [ + d[0] + d[1], + d[2] + d[3], + d[4] + d[5] + ]; + data = map(rgb, function (c) { + return adjust(parseInt(c, 16), [ + 0, + 255 + ]); + }); + } else if (r[4]) { + var rgba = r[4].split(','); + a = rgba[3]; + rgb = rgba.slice(0, 3); + data = map(rgb, function (c) { + c = Math.floor(c.indexOf('%') > 0 ? parseInt(c, 0) * 2.55 : c); + return adjust(c, [ + 0, + 255 + ]); + }); + if (typeof a !== 'undefined') { + data.push(adjust(parseFloat(a), [ + 0, + 1 + ])); + } + } else if (r[5] || r[6]) { + var hsxa = (r[5] || r[6]).split(','); + var h = parseInt(hsxa[0], 0) / 360; + var s = hsxa[1]; + var x = hsxa[2]; + a = hsxa[3]; + data = map([ + s, + x + ], function (c) { + return adjust(parseFloat(c) / 100, [ + 0, + 1 + ]); + }); + data.unshift(h); + if (typeof a !== 'undefined') { + data.push(adjust(parseFloat(a), [ + 0, + 1 + ])); + } + } + return data; + } + function alpha(color, a) { + if (!isCalculableColor(color)) { + return color; + } + if (a === null) { + a = 1; + } + var data = getData(toRGBA(color)); + data[3] = adjust(Number(a).toFixed(4), [ + 0, + 1 + ]); + return toColor(data, 'rgba'); + } + function map(array, fun) { + if (typeof fun !== 'function') { + throw new TypeError(); + } + var len = array ? array.length : 0; + for (var i = 0; i < len; i++) { + array[i] = fun(array[i]); + } + return array; + } + function adjust(value, region) { + if (value <= region[0]) { + value = region[0]; + } else if (value >= region[1]) { + value = region[1]; + } + return value; + } + function isCalculableColor(color) { + return color instanceof Array || typeof color === 'string'; + } + function _HSV_2_RGB(data) { + var H = data[0]; + var S = data[1]; + var V = data[2]; + var R; + var G; + var B; + if (S === 0) { + R = V * 255; + G = V * 255; + B = V * 255; + } else { + var h = H * 6; + if (h === 6) { + h = 0; + } + var i = h | 0; + var v1 = V * (1 - S); + var v2 = V * (1 - S * (h - i)); + var v3 = V * (1 - S * (1 - (h - i))); + var r = 0; + var g = 0; + var b = 0; + if (i === 0) { + r = V; + g = v3; + b = v1; + } else if (i === 1) { + r = v2; + g = V; + b = v1; + } else if (i === 2) { + r = v1; + g = V; + b = v3; + } else if (i === 3) { + r = v1; + g = v2; + b = V; + } else if (i === 4) { + r = v3; + g = v1; + b = V; + } else { + r = V; + g = v1; + b = v2; + } + R = r * 255; + G = g * 255; + B = b * 255; + } + return [ + R, + G, + B + ]; + } + function _HSL_2_RGB(data) { + var H = data[0]; + var S = data[1]; + var L = data[2]; + var R; + var G; + var B; + if (S === 0) { + R = L * 255; + G = L * 255; + B = L * 255; + } else { + var v2; + if (L < 0.5) { + v2 = L * (1 + S); + } else { + v2 = L + S - S * L; + } + var v1 = 2 * L - v2; + R = 255 * _HUE_2_RGB(v1, v2, H + 1 / 3); + G = 255 * _HUE_2_RGB(v1, v2, H); + B = 255 * _HUE_2_RGB(v1, v2, H - 1 / 3); + } + return [ + R, + G, + B + ]; + } + function _HUE_2_RGB(v1, v2, vH) { + if (vH < 0) { + vH += 1; + } + if (vH > 1) { + vH -= 1; + } + if (6 * vH < 1) { + return v1 + (v2 - v1) * 6 * vH; + } + if (2 * vH < 1) { + return v2; + } + if (3 * vH < 2) { + return v1 + (v2 - v1) * (2 / 3 - vH) * 6; + } + return v1; + } + function _RGB_2_HSB(data) { + var R = data[0] / 255; + var G = data[1] / 255; + var B = data[2] / 255; + var vMin = Math.min(R, G, B); + var vMax = Math.max(R, G, B); + var delta = vMax - vMin; + var V = vMax; + var H; + var S; + if (delta === 0) { + H = 0; + S = 0; + } else { + S = delta / vMax; + var deltaR = ((vMax - R) / 6 + delta / 2) / delta; + var deltaG = ((vMax - G) / 6 + delta / 2) / delta; + var deltaB = ((vMax - B) / 6 + delta / 2) / delta; + if (R === vMax) { + H = deltaB - deltaG; + } else if (G === vMax) { + H = 1 / 3 + deltaR - deltaB; + } else if (B === vMax) { + H = 2 / 3 + deltaG - deltaR; + } + if (H < 0) { + H += 1; + } + if (H > 1) { + H -= 1; + } + } + H = H * 360; + S = S * 100; + V = V * 100; + return [ + H, + S, + V + ]; + } + function _RGB_2_HSL(data) { + var R = data[0] / 255; + var G = data[1] / 255; + var B = data[2] / 255; + var vMin = Math.min(R, G, B); + var vMax = Math.max(R, G, B); + var delta = vMax - vMin; + var L = (vMax + vMin) / 2; + var H; + var S; + if (delta === 0) { + H = 0; + S = 0; + } else { + if (L < 0.5) { + S = delta / (vMax + vMin); + } else { + S = delta / (2 - vMax - vMin); + } + var deltaR = ((vMax - R) / 6 + delta / 2) / delta; + var deltaG = ((vMax - G) / 6 + delta / 2) / delta; + var deltaB = ((vMax - B) / 6 + delta / 2) / delta; + if (R === vMax) { + H = deltaB - deltaG; + } else if (G === vMax) { + H = 1 / 3 + deltaR - deltaB; + } else if (B === vMax) { + H = 2 / 3 + deltaG - deltaR; + } + if (H < 0) { + H += 1; + } + if (H > 1) { + H -= 1; + } + } + H = H * 360; + S = S * 100; + L = L * 100; + return [ + H, + S, + L + ]; + } + return { + customPalette: customPalette, + resetPalette: resetPalette, + getColor: getColor, + getHighlightColor: getHighlightColor, + customHighlight: customHighlight, + resetHighlight: resetHighlight, + getRadialGradient: getRadialGradient, + getLinearGradient: getLinearGradient, + getGradientColors: getGradientColors, + getStepColors: getStepColors, + reverse: reverse, + mix: mix, + lift: lift, + trim: trim, + random: random, + toRGB: toRGB, + toRGBA: toRGBA, + toHex: toHex, + toHSL: toHSL, + toHSLA: toHSLA, + toHSB: toHSB, + toHSBA: toHSBA, + toHSV: toHSV, + toHSVA: toHSVA, + toName: toName, + toColor: toColor, + toArray: toArray, + alpha: alpha, + getData: getData + }; +});define('echarts/component/timeline', [ + 'require', + './base', + 'zrender/shape/Rectangle', + '../util/shape/Icon', + '../util/shape/Chain', + '../config', + 'zrender/tool/util', + 'zrender/tool/area', + 'zrender/tool/event', + '../component' +], function (require) { + var Base = require('./base'); + var RectangleShape = require('zrender/shape/Rectangle'); + var IconShape = require('../util/shape/Icon'); + var ChainShape = require('../util/shape/Chain'); + var ecConfig = require('../config'); + ecConfig.timeline = { + zlevel: 0, + z: 4, + show: true, + type: 'time', + notMerge: false, + realtime: true, + x: 80, + x2: 80, + y2: 0, + height: 50, + backgroundColor: 'rgba(0,0,0,0)', + borderColor: '#ccc', + borderWidth: 0, + padding: 5, + controlPosition: 'left', + autoPlay: false, + loop: true, + playInterval: 2000, + lineStyle: { + width: 1, + color: '#666', + type: 'dashed' + }, + label: { + show: true, + interval: 'auto', + rotate: 0, + textStyle: { color: '#333' } + }, + checkpointStyle: { + symbol: 'auto', + symbolSize: 'auto', + color: 'auto', + borderColor: 'auto', + borderWidth: 'auto', + label: { + show: false, + textStyle: { color: 'auto' } + } + }, + controlStyle: { + itemSize: 15, + itemGap: 5, + normal: { color: '#333' }, + emphasis: { color: '#1e90ff' } + }, + symbol: 'emptyDiamond', + symbolSize: 4, + currentIndex: 0 + }; + var zrUtil = require('zrender/tool/util'); + var zrArea = require('zrender/tool/area'); + var zrEvent = require('zrender/tool/event'); + function Timeline(ecTheme, messageCenter, zr, option, myChart) { + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + var self = this; + self._onclick = function (param) { + return self.__onclick(param); + }; + self._ondrift = function (dx, dy) { + return self.__ondrift(this, dx, dy); + }; + self._ondragend = function () { + return self.__ondragend(); + }; + self._setCurrentOption = function () { + var timelineOption = self.timelineOption; + self.currentIndex %= timelineOption.data.length; + var curOption = self.options[self.currentIndex] || {}; + self.myChart.setOption(curOption, timelineOption.notMerge); + self.messageCenter.dispatch(ecConfig.EVENT.TIMELINE_CHANGED, null, { + currentIndex: self.currentIndex, + data: timelineOption.data[self.currentIndex].name != null ? timelineOption.data[self.currentIndex].name : timelineOption.data[self.currentIndex] + }, self.myChart); + }; + self._onFrame = function () { + self._setCurrentOption(); + self._syncHandleShape(); + if (self.timelineOption.autoPlay) { + self.playTicket = setTimeout(function () { + self.currentIndex += 1; + if (!self.timelineOption.loop && self.currentIndex >= self.timelineOption.data.length) { + self.currentIndex = self.timelineOption.data.length - 1; + self.stop(); + return; + } + self._onFrame(); + }, self.timelineOption.playInterval); + } + }; + this.setTheme(false); + this.options = this.option.options; + this.currentIndex = this.timelineOption.currentIndex % this.timelineOption.data.length; + if (!this.timelineOption.notMerge && this.currentIndex !== 0) { + this.options[this.currentIndex] = zrUtil.merge(this.options[this.currentIndex], this.options[0]); + } + if (this.timelineOption.show) { + this._buildShape(); + this._syncHandleShape(); + } + this._setCurrentOption(); + if (this.timelineOption.autoPlay) { + var self = this; + this.playTicket = setTimeout(function () { + self.play(); + }, this.ecTheme.animationDuration != null ? this.ecTheme.animationDuration : ecConfig.animationDuration); + } + } + Timeline.prototype = { + type: ecConfig.COMPONENT_TYPE_TIMELINE, + _buildShape: function () { + this._location = this._getLocation(); + this._buildBackground(); + this._buildControl(); + this._chainPoint = this._getChainPoint(); + if (this.timelineOption.label.show) { + var interval = this._getInterval(); + for (var i = 0, len = this._chainPoint.length; i < len; i += interval) { + this._chainPoint[i].showLabel = true; + } + } + this._buildChain(); + this._buildHandle(); + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + }, + _getLocation: function () { + var timelineOption = this.timelineOption; + var padding = this.reformCssArray(this.timelineOption.padding); + var zrWidth = this.zr.getWidth(); + var x = this.parsePercent(timelineOption.x, zrWidth); + var x2 = this.parsePercent(timelineOption.x2, zrWidth); + var width; + if (timelineOption.width == null) { + width = zrWidth - x - x2; + x2 = zrWidth - x2; + } else { + width = this.parsePercent(timelineOption.width, zrWidth); + x2 = x + width; + } + var zrHeight = this.zr.getHeight(); + var height = this.parsePercent(timelineOption.height, zrHeight); + var y; + var y2; + if (timelineOption.y != null) { + y = this.parsePercent(timelineOption.y, zrHeight); + y2 = y + height; + } else { + y2 = zrHeight - this.parsePercent(timelineOption.y2, zrHeight); + y = y2 - height; + } + return { + x: x + padding[3], + y: y + padding[0], + x2: x2 - padding[1], + y2: y2 - padding[2], + width: width - padding[1] - padding[3], + height: height - padding[0] - padding[2] + }; + }, + _getReformedLabel: function (idx) { + var timelineOption = this.timelineOption; + var data = timelineOption.data[idx].name != null ? timelineOption.data[idx].name : timelineOption.data[idx]; + var formatter = timelineOption.data[idx].formatter || timelineOption.label.formatter; + if (formatter) { + if (typeof formatter === 'function') { + data = formatter.call(this.myChart, data); + } else if (typeof formatter === 'string') { + data = formatter.replace('{value}', data); + } + } + return data; + }, + _getInterval: function () { + var chainPoint = this._chainPoint; + var timelineOption = this.timelineOption; + var interval = timelineOption.label.interval; + if (interval === 'auto') { + var fontSize = timelineOption.label.textStyle.fontSize; + var data = timelineOption.data; + var dataLength = timelineOption.data.length; + if (dataLength > 3) { + var isEnough = false; + var labelSpace; + var labelSize; + interval = 0; + while (!isEnough && interval < dataLength) { + interval++; + isEnough = true; + for (var i = interval; i < dataLength; i += interval) { + labelSpace = chainPoint[i].x - chainPoint[i - interval].x; + if (timelineOption.label.rotate !== 0) { + labelSize = fontSize; + } else if (data[i].textStyle) { + labelSize = zrArea.getTextWidth(chainPoint[i].name, chainPoint[i].textFont); + } else { + var label = chainPoint[i].name + ''; + var wLen = (label.match(/\w/g) || '').length; + var oLen = label.length - wLen; + labelSize = wLen * fontSize * 2 / 3 + oLen * fontSize; + } + if (labelSpace < labelSize) { + isEnough = false; + break; + } + } + } + } else { + interval = 1; + } + } else { + interval = interval - 0 + 1; + } + return interval; + }, + _getChainPoint: function () { + var timelineOption = this.timelineOption; + var symbol = timelineOption.symbol.toLowerCase(); + var symbolSize = timelineOption.symbolSize; + var rotate = timelineOption.label.rotate; + var textStyle = timelineOption.label.textStyle; + var textFont = this.getFont(textStyle); + var dataTextStyle; + var data = timelineOption.data; + var x = this._location.x; + var y = this._location.y + this._location.height / 4 * 3; + var width = this._location.x2 - this._location.x; + var len = data.length; + function _getName(i) { + return data[i].name != null ? data[i].name : data[i] + ''; + } + var xList = []; + if (len > 1) { + var boundaryGap = width / len; + boundaryGap = boundaryGap > 50 ? 50 : boundaryGap < 20 ? 5 : boundaryGap; + width -= boundaryGap * 2; + if (timelineOption.type === 'number') { + for (var i = 0; i < len; i++) { + xList.push(x + boundaryGap + width / (len - 1) * i); + } + } else { + xList[0] = new Date(_getName(0).replace(/-/g, '/')); + xList[len - 1] = new Date(_getName(len - 1).replace(/-/g, '/')) - xList[0]; + for (var i = 1; i < len; i++) { + xList[i] = x + boundaryGap + width * (new Date(_getName(i).replace(/-/g, '/')) - xList[0]) / xList[len - 1]; + } + xList[0] = x + boundaryGap; + } + } else { + xList.push(x + width / 2); + } + var list = []; + var curSymbol; + var n; + var isEmpty; + var textAlign; + var rotation; + for (var i = 0; i < len; i++) { + x = xList[i]; + curSymbol = data[i].symbol && data[i].symbol.toLowerCase() || symbol; + if (curSymbol.match('empty')) { + curSymbol = curSymbol.replace('empty', ''); + isEmpty = true; + } else { + isEmpty = false; + } + if (curSymbol.match('star')) { + n = curSymbol.replace('star', '') - 0 || 5; + curSymbol = 'star'; + } + dataTextStyle = data[i].textStyle ? zrUtil.merge(data[i].textStyle || {}, textStyle) : textStyle; + textAlign = dataTextStyle.align || 'center'; + if (rotate) { + textAlign = rotate > 0 ? 'right' : 'left'; + rotation = [ + rotate * Math.PI / 180, + x, + y - 5 + ]; + } else { + rotation = false; + } + list.push({ + x: x, + n: n, + isEmpty: isEmpty, + symbol: curSymbol, + symbolSize: data[i].symbolSize || symbolSize, + color: data[i].color, + borderColor: data[i].borderColor, + borderWidth: data[i].borderWidth, + name: this._getReformedLabel(i), + textColor: dataTextStyle.color, + textAlign: textAlign, + textBaseline: dataTextStyle.baseline || 'middle', + textX: x, + textY: y - (rotate ? 5 : 0), + textFont: data[i].textStyle ? this.getFont(dataTextStyle) : textFont, + rotation: rotation, + showLabel: false + }); + } + return list; + }, + _buildBackground: function () { + var timelineOption = this.timelineOption; + var padding = this.reformCssArray(this.timelineOption.padding); + var width = this._location.width; + var height = this._location.height; + if (timelineOption.borderWidth !== 0 || timelineOption.backgroundColor.replace(/\s/g, '') != 'rgba(0,0,0,0)') { + this.shapeList.push(new RectangleShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: this._location.x - padding[3], + y: this._location.y - padding[0], + width: width + padding[1] + padding[3], + height: height + padding[0] + padding[2], + brushType: timelineOption.borderWidth === 0 ? 'fill' : 'both', + color: timelineOption.backgroundColor, + strokeColor: timelineOption.borderColor, + lineWidth: timelineOption.borderWidth + } + })); + } + }, + _buildControl: function () { + var self = this; + var timelineOption = this.timelineOption; + var lineStyle = timelineOption.lineStyle; + var controlStyle = timelineOption.controlStyle; + if (timelineOption.controlPosition === 'none') { + return; + } + var iconSize = controlStyle.itemSize; + var iconGap = controlStyle.itemGap; + var x; + if (timelineOption.controlPosition === 'left') { + x = this._location.x; + this._location.x += (iconSize + iconGap) * 3; + } else { + x = this._location.x2 - ((iconSize + iconGap) * 3 - iconGap); + this._location.x2 -= (iconSize + iconGap) * 3; + } + var y = this._location.y; + var iconStyle = { + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + style: { + iconType: 'timelineControl', + symbol: 'last', + x: x, + y: y, + width: iconSize, + height: iconSize, + brushType: 'stroke', + color: controlStyle.normal.color, + strokeColor: controlStyle.normal.color, + lineWidth: lineStyle.width + }, + highlightStyle: { + color: controlStyle.emphasis.color, + strokeColor: controlStyle.emphasis.color, + lineWidth: lineStyle.width + 1 + }, + clickable: true + }; + this._ctrLastShape = new IconShape(iconStyle); + this._ctrLastShape.onclick = function () { + self.last(); + }; + this.shapeList.push(this._ctrLastShape); + x += iconSize + iconGap; + this._ctrPlayShape = new IconShape(zrUtil.clone(iconStyle)); + this._ctrPlayShape.style.brushType = 'fill'; + this._ctrPlayShape.style.symbol = 'play'; + this._ctrPlayShape.style.status = this.timelineOption.autoPlay ? 'playing' : 'stop'; + this._ctrPlayShape.style.x = x; + this._ctrPlayShape.onclick = function () { + if (self._ctrPlayShape.style.status === 'stop') { + self.play(); + } else { + self.stop(); + } + }; + this.shapeList.push(this._ctrPlayShape); + x += iconSize + iconGap; + this._ctrNextShape = new IconShape(zrUtil.clone(iconStyle)); + this._ctrNextShape.style.symbol = 'next'; + this._ctrNextShape.style.x = x; + this._ctrNextShape.onclick = function () { + self.next(); + }; + this.shapeList.push(this._ctrNextShape); + }, + _buildChain: function () { + var timelineOption = this.timelineOption; + var lineStyle = timelineOption.lineStyle; + this._timelineShae = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: this._location.x, + y: this.subPixelOptimize(this._location.y, lineStyle.width), + width: this._location.x2 - this._location.x, + height: this._location.height, + chainPoint: this._chainPoint, + brushType: 'both', + strokeColor: lineStyle.color, + lineWidth: lineStyle.width, + lineType: lineStyle.type + }, + hoverable: false, + clickable: true, + onclick: this._onclick + }; + this._timelineShae = new ChainShape(this._timelineShae); + this.shapeList.push(this._timelineShae); + }, + _buildHandle: function () { + var curPoint = this._chainPoint[this.currentIndex]; + var symbolSize = curPoint.symbolSize + 1; + symbolSize = symbolSize < 5 ? 5 : symbolSize; + this._handleShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + hoverable: false, + draggable: true, + style: { + iconType: 'diamond', + n: curPoint.n, + x: curPoint.x - symbolSize, + y: this._location.y + this._location.height / 4 - symbolSize, + width: symbolSize * 2, + height: symbolSize * 2, + brushType: 'both', + textPosition: 'specific', + textX: curPoint.x, + textY: this._location.y - this._location.height / 4, + textAlign: 'center', + textBaseline: 'middle' + }, + highlightStyle: {}, + ondrift: this._ondrift, + ondragend: this._ondragend + }; + this._handleShape = new IconShape(this._handleShape); + this.shapeList.push(this._handleShape); + }, + _syncHandleShape: function () { + if (!this.timelineOption.show) { + return; + } + var timelineOption = this.timelineOption; + var cpStyle = timelineOption.checkpointStyle; + var curPoint = this._chainPoint[this.currentIndex]; + this._handleShape.style.text = cpStyle.label.show ? curPoint.name : ''; + this._handleShape.style.textFont = curPoint.textFont; + this._handleShape.style.n = curPoint.n; + if (cpStyle.symbol === 'auto') { + this._handleShape.style.iconType = curPoint.symbol != 'none' ? curPoint.symbol : 'diamond'; + } else { + this._handleShape.style.iconType = cpStyle.symbol; + if (cpStyle.symbol.match('star')) { + this._handleShape.style.n = cpStyle.symbol.replace('star', '') - 0 || 5; + this._handleShape.style.iconType = 'star'; + } + } + var symbolSize; + if (cpStyle.symbolSize === 'auto') { + symbolSize = curPoint.symbolSize + 2; + symbolSize = symbolSize < 5 ? 5 : symbolSize; + } else { + symbolSize = cpStyle.symbolSize - 0; + } + this._handleShape.style.color = cpStyle.color === 'auto' ? curPoint.color ? curPoint.color : timelineOption.controlStyle.emphasis.color : cpStyle.color; + this._handleShape.style.textColor = cpStyle.label.textStyle.color === 'auto' ? this._handleShape.style.color : cpStyle.label.textStyle.color; + this._handleShape.highlightStyle.strokeColor = this._handleShape.style.strokeColor = cpStyle.borderColor === 'auto' ? curPoint.borderColor ? curPoint.borderColor : '#fff' : cpStyle.borderColor; + this._handleShape.style.lineWidth = cpStyle.borderWidth === 'auto' ? curPoint.borderWidth ? curPoint.borderWidth : 0 : cpStyle.borderWidth - 0; + this._handleShape.highlightStyle.lineWidth = this._handleShape.style.lineWidth + 1; + this.zr.animate(this._handleShape.id, 'style').when(500, { + x: curPoint.x - symbolSize, + textX: curPoint.x, + y: this._location.y + this._location.height / 4 - symbolSize, + width: symbolSize * 2, + height: symbolSize * 2 + }).start('ExponentialOut'); + }, + _findChainIndex: function (x) { + var chainPoint = this._chainPoint; + var len = chainPoint.length; + if (x <= chainPoint[0].x) { + return 0; + } else if (x >= chainPoint[len - 1].x) { + return len - 1; + } + for (var i = 0; i < len - 1; i++) { + if (x >= chainPoint[i].x && x <= chainPoint[i + 1].x) { + return Math.abs(x - chainPoint[i].x) < Math.abs(x - chainPoint[i + 1].x) ? i : i + 1; + } + } + }, + __onclick: function (param) { + var x = zrEvent.getX(param.event); + var newIndex = this._findChainIndex(x); + if (newIndex === this.currentIndex) { + return true; + } + this.currentIndex = newIndex; + this.timelineOption.autoPlay && this.stop(); + clearTimeout(this.playTicket); + this._onFrame(); + }, + __ondrift: function (shape, dx) { + this.timelineOption.autoPlay && this.stop(); + var chainPoint = this._chainPoint; + var len = chainPoint.length; + var newIndex; + if (shape.style.x + dx <= chainPoint[0].x - chainPoint[0].symbolSize) { + shape.style.x = chainPoint[0].x - chainPoint[0].symbolSize; + newIndex = 0; + } else if (shape.style.x + dx >= chainPoint[len - 1].x - chainPoint[len - 1].symbolSize) { + shape.style.x = chainPoint[len - 1].x - chainPoint[len - 1].symbolSize; + newIndex = len - 1; + } else { + shape.style.x += dx; + newIndex = this._findChainIndex(shape.style.x); + } + var curPoint = chainPoint[newIndex]; + var symbolSize = curPoint.symbolSize + 2; + shape.style.iconType = curPoint.symbol; + shape.style.n = curPoint.n; + shape.style.textX = shape.style.x + symbolSize / 2; + shape.style.y = this._location.y + this._location.height / 4 - symbolSize; + shape.style.width = symbolSize * 2; + shape.style.height = symbolSize * 2; + shape.style.text = curPoint.name; + if (newIndex === this.currentIndex) { + return true; + } + this.currentIndex = newIndex; + if (this.timelineOption.realtime) { + clearTimeout(this.playTicket); + var self = this; + this.playTicket = setTimeout(function () { + self._setCurrentOption(); + }, 200); + } + return true; + }, + __ondragend: function () { + this.isDragend = true; + }, + ondragend: function (param, status) { + if (!this.isDragend || !param.target) { + return; + } + !this.timelineOption.realtime && this._setCurrentOption(); + status.dragOut = true; + status.dragIn = true; + status.needRefresh = false; + this.isDragend = false; + this._syncHandleShape(); + return; + }, + last: function () { + this.timelineOption.autoPlay && this.stop(); + this.currentIndex -= 1; + if (this.currentIndex < 0) { + this.currentIndex = this.timelineOption.data.length - 1; + } + this._onFrame(); + return this.currentIndex; + }, + next: function () { + this.timelineOption.autoPlay && this.stop(); + this.currentIndex += 1; + if (this.currentIndex >= this.timelineOption.data.length) { + this.currentIndex = 0; + } + this._onFrame(); + return this.currentIndex; + }, + play: function (targetIndex, autoPlay) { + if (this._ctrPlayShape && this._ctrPlayShape.style.status != 'playing') { + this._ctrPlayShape.style.status = 'playing'; + this.zr.modShape(this._ctrPlayShape.id); + this.zr.refreshNextFrame(); + } + this.timelineOption.autoPlay = autoPlay != null ? autoPlay : true; + if (!this.timelineOption.autoPlay) { + clearTimeout(this.playTicket); + } + this.currentIndex = targetIndex != null ? targetIndex : this.currentIndex + 1; + if (this.currentIndex >= this.timelineOption.data.length) { + this.currentIndex = 0; + } + this._onFrame(); + return this.currentIndex; + }, + stop: function () { + if (this._ctrPlayShape && this._ctrPlayShape.style.status != 'stop') { + this._ctrPlayShape.style.status = 'stop'; + this.zr.modShape(this._ctrPlayShape.id); + this.zr.refreshNextFrame(); + } + this.timelineOption.autoPlay = false; + clearTimeout(this.playTicket); + return this.currentIndex; + }, + resize: function () { + if (this.timelineOption.show) { + this.clear(); + this._buildShape(); + this._syncHandleShape(); + } + }, + setTheme: function (needRefresh) { + this.timelineOption = this.reformOption(zrUtil.clone(this.option.timeline)); + this.timelineOption.label.textStyle = this.getTextStyle(this.timelineOption.label.textStyle); + this.timelineOption.checkpointStyle.label.textStyle = this.getTextStyle(this.timelineOption.checkpointStyle.label.textStyle); + if (!this.myChart.canvasSupported) { + this.timelineOption.realtime = false; + } + if (this.timelineOption.show && needRefresh) { + this.clear(); + this._buildShape(); + this._syncHandleShape(); + } + }, + onbeforDispose: function () { + clearTimeout(this.playTicket); + } + }; + function timelineControl(ctx, style) { + var lineWidth = 2; + var x = style.x + lineWidth; + var y = style.y + lineWidth + 2; + var width = style.width - lineWidth; + var height = style.height - lineWidth; + var symbol = style.symbol; + if (symbol === 'last') { + ctx.moveTo(x + width - 2, y + height / 3); + ctx.lineTo(x + width - 2, y); + ctx.lineTo(x + 2, y + height / 2); + ctx.lineTo(x + width - 2, y + height); + ctx.lineTo(x + width - 2, y + height / 3 * 2); + ctx.moveTo(x, y); + ctx.lineTo(x, y); + } else if (symbol === 'next') { + ctx.moveTo(x + 2, y + height / 3); + ctx.lineTo(x + 2, y); + ctx.lineTo(x + width - 2, y + height / 2); + ctx.lineTo(x + 2, y + height); + ctx.lineTo(x + 2, y + height / 3 * 2); + ctx.moveTo(x, y); + ctx.lineTo(x, y); + } else if (symbol === 'play') { + if (style.status === 'stop') { + ctx.moveTo(x + 2, y); + ctx.lineTo(x + width - 2, y + height / 2); + ctx.lineTo(x + 2, y + height); + ctx.lineTo(x + 2, y); + } else { + var delta = style.brushType === 'both' ? 2 : 3; + ctx.rect(x + 2, y, delta, height); + ctx.rect(x + width - delta - 2, y, delta, height); + } + } else if (symbol.match('image')) { + var imageLocation = ''; + imageLocation = symbol.replace(new RegExp('^image:\\/\\/'), ''); + symbol = IconShape.prototype.iconLibrary.image; + symbol(ctx, { + x: x, + y: y, + width: width, + height: height, + image: imageLocation + }); + } + } + IconShape.prototype.iconLibrary['timelineControl'] = timelineControl; + zrUtil.inherits(Timeline, Base); + require('../component').define('timeline', Timeline); + return Timeline; +});define('zrender/shape/Image', [ + 'require', + './Base', + '../tool/util' +], function (require) { + var Base = require('./Base'); + var ZImage = function (options) { + Base.call(this, options); + }; + ZImage.prototype = { + type: 'image', + brush: function (ctx, isHighlight, refreshNextFrame) { + var style = this.style || {}; + if (isHighlight) { + style = this.getHighlightStyle(style, this.highlightStyle || {}); + } + var image = style.image; + var self = this; + if (!this._imageCache) { + this._imageCache = {}; + } + if (typeof image === 'string') { + var src = image; + if (this._imageCache[src]) { + image = this._imageCache[src]; + } else { + image = new Image(); + image.onload = function () { + image.onload = null; + self.modSelf(); + refreshNextFrame(); + }; + image.src = src; + this._imageCache[src] = image; + } + } + if (image) { + if (image.nodeName.toUpperCase() == 'IMG') { + if (window.ActiveXObject) { + if (image.readyState != 'complete') { + return; + } + } else { + if (!image.complete) { + return; + } + } + } + var width = style.width || image.width; + var height = style.height || image.height; + var x = style.x; + var y = style.y; + if (!image.width || !image.height) { + return; + } + ctx.save(); + this.doClip(ctx); + this.setContext(ctx, style); + this.setTransform(ctx); + if (style.sWidth && style.sHeight) { + var sx = style.sx || 0; + var sy = style.sy || 0; + ctx.drawImage(image, sx, sy, style.sWidth, style.sHeight, x, y, width, height); + } else if (style.sx && style.sy) { + var sx = style.sx; + var sy = style.sy; + var sWidth = width - sx; + var sHeight = height - sy; + ctx.drawImage(image, sx, sy, sWidth, sHeight, x, y, width, height); + } else { + ctx.drawImage(image, x, y, width, height); + } + if (!style.width) { + style.width = width; + } + if (!style.height) { + style.height = height; + } + if (!this.style.width) { + this.style.width = width; + } + if (!this.style.height) { + this.style.height = height; + } + this.drawText(ctx, style, this.style); + ctx.restore(); + } + }, + getRect: function (style) { + return { + x: style.x, + y: style.y, + width: style.width, + height: style.height + }; + }, + clearCache: function () { + this._imageCache = {}; + } + }; + require('../tool/util').inherits(ZImage, Base); + return ZImage; +});define('zrender/loadingEffect/Bar', [ + 'require', + './Base', + '../tool/util', + '../tool/color', + '../shape/Rectangle' +], function (require) { + var Base = require('./Base'); + var util = require('../tool/util'); + var zrColor = require('../tool/color'); + var RectangleShape = require('../shape/Rectangle'); + function Bar(options) { + Base.call(this, options); + } + util.inherits(Bar, Base); + Bar.prototype._start = function (addShapeHandle, refreshHandle) { + var options = util.merge(this.options, { + textStyle: { color: '#888' }, + backgroundColor: 'rgba(250, 250, 250, 0.8)', + effectOption: { + x: 0, + y: this.canvasHeight / 2 - 30, + width: this.canvasWidth, + height: 5, + brushType: 'fill', + timeInterval: 100 + } + }); + var textShape = this.createTextShape(options.textStyle); + var background = this.createBackgroundShape(options.backgroundColor); + var effectOption = options.effectOption; + var barShape = new RectangleShape({ highlightStyle: util.clone(effectOption) }); + barShape.highlightStyle.color = effectOption.color || zrColor.getLinearGradient(effectOption.x, effectOption.y, effectOption.x + effectOption.width, effectOption.y + effectOption.height, [ + [ + 0, + '#ff6400' + ], + [ + 0.5, + '#ffe100' + ], + [ + 1, + '#b1ff00' + ] + ]); + if (options.progress != null) { + addShapeHandle(background); + barShape.highlightStyle.width = this.adjust(options.progress, [ + 0, + 1 + ]) * options.effectOption.width; + addShapeHandle(barShape); + addShapeHandle(textShape); + refreshHandle(); + return; + } else { + barShape.highlightStyle.width = 0; + return setInterval(function () { + addShapeHandle(background); + if (barShape.highlightStyle.width < effectOption.width) { + barShape.highlightStyle.width += 8; + } else { + barShape.highlightStyle.width = 0; + } + addShapeHandle(barShape); + addShapeHandle(textShape); + refreshHandle(); + }, effectOption.timeInterval); + } + }; + return Bar; +});define('zrender/loadingEffect/Bubble', [ + 'require', + './Base', + '../tool/util', + '../tool/color', + '../shape/Circle' +], function (require) { + var Base = require('./Base'); + var util = require('../tool/util'); + var zrColor = require('../tool/color'); + var CircleShape = require('../shape/Circle'); + function Bubble(options) { + Base.call(this, options); + } + util.inherits(Bubble, Base); + Bubble.prototype._start = function (addShapeHandle, refreshHandle) { + var options = util.merge(this.options, { + textStyle: { color: '#888' }, + backgroundColor: 'rgba(250, 250, 250, 0.8)', + effect: { + n: 50, + lineWidth: 2, + brushType: 'stroke', + color: 'random', + timeInterval: 100 + } + }); + var textShape = this.createTextShape(options.textStyle); + var background = this.createBackgroundShape(options.backgroundColor); + var effectOption = options.effect; + var n = effectOption.n; + var brushType = effectOption.brushType; + var lineWidth = effectOption.lineWidth; + var shapeList = []; + var canvasWidth = this.canvasWidth; + var canvasHeight = this.canvasHeight; + for (var i = 0; i < n; i++) { + var color = effectOption.color == 'random' ? zrColor.alpha(zrColor.random(), 0.3) : effectOption.color; + shapeList[i] = new CircleShape({ + highlightStyle: { + x: Math.ceil(Math.random() * canvasWidth), + y: Math.ceil(Math.random() * canvasHeight), + r: Math.ceil(Math.random() * 40), + brushType: brushType, + color: color, + strokeColor: color, + lineWidth: lineWidth + }, + animationY: Math.ceil(Math.random() * 20) + }); + } + return setInterval(function () { + addShapeHandle(background); + for (var i = 0; i < n; i++) { + var style = shapeList[i].highlightStyle; + if (style.y - shapeList[i].animationY + style.r <= 0) { + shapeList[i].highlightStyle.y = canvasHeight + style.r; + shapeList[i].highlightStyle.x = Math.ceil(Math.random() * canvasWidth); + } + shapeList[i].highlightStyle.y -= shapeList[i].animationY; + addShapeHandle(shapeList[i]); + } + addShapeHandle(textShape); + refreshHandle(); + }, effectOption.timeInterval); + }; + return Bubble; +});define('zrender/loadingEffect/DynamicLine', [ + 'require', + './Base', + '../tool/util', + '../tool/color', + '../shape/Line' +], function (require) { + var Base = require('./Base'); + var util = require('../tool/util'); + var zrColor = require('../tool/color'); + var LineShape = require('../shape/Line'); + function DynamicLine(options) { + Base.call(this, options); + } + util.inherits(DynamicLine, Base); + DynamicLine.prototype._start = function (addShapeHandle, refreshHandle) { + var options = util.merge(this.options, { + textStyle: { color: '#fff' }, + backgroundColor: 'rgba(0, 0, 0, 0.8)', + effectOption: { + n: 30, + lineWidth: 1, + color: 'random', + timeInterval: 100 + } + }); + var textShape = this.createTextShape(options.textStyle); + var background = this.createBackgroundShape(options.backgroundColor); + var effectOption = options.effectOption; + var n = effectOption.n; + var lineWidth = effectOption.lineWidth; + var shapeList = []; + var canvasWidth = this.canvasWidth; + var canvasHeight = this.canvasHeight; + for (var i = 0; i < n; i++) { + var xStart = -Math.ceil(Math.random() * 1000); + var len = Math.ceil(Math.random() * 400); + var pos = Math.ceil(Math.random() * canvasHeight); + var color = effectOption.color == 'random' ? zrColor.random() : effectOption.color; + shapeList[i] = new LineShape({ + highlightStyle: { + xStart: xStart, + yStart: pos, + xEnd: xStart + len, + yEnd: pos, + strokeColor: color, + lineWidth: lineWidth + }, + animationX: Math.ceil(Math.random() * 100), + len: len + }); + } + return setInterval(function () { + addShapeHandle(background); + for (var i = 0; i < n; i++) { + var style = shapeList[i].highlightStyle; + if (style.xStart >= canvasWidth) { + shapeList[i].len = Math.ceil(Math.random() * 400); + style.xStart = -400; + style.xEnd = -400 + shapeList[i].len; + style.yStart = Math.ceil(Math.random() * canvasHeight); + style.yEnd = style.yStart; + } + style.xStart += shapeList[i].animationX; + style.xEnd += shapeList[i].animationX; + addShapeHandle(shapeList[i]); + } + addShapeHandle(textShape); + refreshHandle(); + }, effectOption.timeInterval); + }; + return DynamicLine; +});define('zrender/loadingEffect/Ring', [ + 'require', + './Base', + '../tool/util', + '../tool/color', + '../shape/Ring', + '../shape/Sector' +], function (require) { + var Base = require('./Base'); + var util = require('../tool/util'); + var zrColor = require('../tool/color'); + var RingShape = require('../shape/Ring'); + var SectorShape = require('../shape/Sector'); + function Ring(options) { + Base.call(this, options); + } + util.inherits(Ring, Base); + Ring.prototype._start = function (addShapeHandle, refreshHandle) { + var options = util.merge(this.options, { + textStyle: { color: '#07a' }, + backgroundColor: 'rgba(250, 250, 250, 0.8)', + effect: { + x: this.canvasWidth / 2, + y: this.canvasHeight / 2, + r0: 60, + r: 100, + color: '#bbdcff', + brushType: 'fill', + textPosition: 'inside', + textFont: 'normal 30px verdana', + textColor: 'rgba(30, 144, 255, 0.6)', + timeInterval: 100 + } + }); + var effectOption = options.effect; + var textStyle = options.textStyle; + if (textStyle.x == null) { + textStyle.x = effectOption.x; + } + if (textStyle.y == null) { + textStyle.y = effectOption.y + (effectOption.r0 + effectOption.r) / 2 - 5; + } + var textShape = this.createTextShape(options.textStyle); + var background = this.createBackgroundShape(options.backgroundColor); + var x = effectOption.x; + var y = effectOption.y; + var r0 = effectOption.r0 + 6; + var r = effectOption.r - 6; + var color = effectOption.color; + var darkColor = zrColor.lift(color, 0.1); + var shapeRing = new RingShape({ highlightStyle: util.clone(effectOption) }); + var shapeList = []; + var clolrList = zrColor.getGradientColors([ + '#ff6400', + '#ffe100', + '#97ff00' + ], 25); + var preAngle = 15; + var endAngle = 240; + for (var i = 0; i < 16; i++) { + shapeList.push(new SectorShape({ + highlightStyle: { + x: x, + y: y, + r0: r0, + r: r, + startAngle: endAngle - preAngle, + endAngle: endAngle, + brushType: 'fill', + color: darkColor + }, + _color: zrColor.getLinearGradient(x + r0 * Math.cos(endAngle, true), y - r0 * Math.sin(endAngle, true), x + r0 * Math.cos(endAngle - preAngle, true), y - r0 * Math.sin(endAngle - preAngle, true), [ + [ + 0, + clolrList[i * 2] + ], + [ + 1, + clolrList[i * 2 + 1] + ] + ]) + })); + endAngle -= preAngle; + } + endAngle = 360; + for (var i = 0; i < 4; i++) { + shapeList.push(new SectorShape({ + highlightStyle: { + x: x, + y: y, + r0: r0, + r: r, + startAngle: endAngle - preAngle, + endAngle: endAngle, + brushType: 'fill', + color: darkColor + }, + _color: zrColor.getLinearGradient(x + r0 * Math.cos(endAngle, true), y - r0 * Math.sin(endAngle, true), x + r0 * Math.cos(endAngle - preAngle, true), y - r0 * Math.sin(endAngle - preAngle, true), [ + [ + 0, + clolrList[i * 2 + 32] + ], + [ + 1, + clolrList[i * 2 + 33] + ] + ]) + })); + endAngle -= preAngle; + } + var n = 0; + if (options.progress != null) { + addShapeHandle(background); + n = this.adjust(options.progress, [ + 0, + 1 + ]).toFixed(2) * 100 / 5; + shapeRing.highlightStyle.text = n * 5 + '%'; + addShapeHandle(shapeRing); + for (var i = 0; i < 20; i++) { + shapeList[i].highlightStyle.color = i < n ? shapeList[i]._color : darkColor; + addShapeHandle(shapeList[i]); + } + addShapeHandle(textShape); + refreshHandle(); + return; + } + return setInterval(function () { + addShapeHandle(background); + n += n >= 20 ? -20 : 1; + addShapeHandle(shapeRing); + for (var i = 0; i < 20; i++) { + shapeList[i].highlightStyle.color = i < n ? shapeList[i]._color : darkColor; + addShapeHandle(shapeList[i]); + } + addShapeHandle(textShape); + refreshHandle(); + }, effectOption.timeInterval); + }; + return Ring; +});define('zrender/loadingEffect/Spin', [ + 'require', + './Base', + '../tool/util', + '../tool/color', + '../tool/area', + '../shape/Sector' +], function (require) { + var Base = require('./Base'); + var util = require('../tool/util'); + var zrColor = require('../tool/color'); + var zrArea = require('../tool/area'); + var SectorShape = require('../shape/Sector'); + function Spin(options) { + Base.call(this, options); + } + util.inherits(Spin, Base); + Spin.prototype._start = function (addShapeHandle, refreshHandle) { + var options = util.merge(this.options, { + textStyle: { + color: '#fff', + textAlign: 'start' + }, + backgroundColor: 'rgba(0, 0, 0, 0.8)' + }); + var textShape = this.createTextShape(options.textStyle); + var textGap = 10; + var textWidth = zrArea.getTextWidth(textShape.highlightStyle.text, textShape.highlightStyle.textFont); + var textHeight = zrArea.getTextHeight(textShape.highlightStyle.text, textShape.highlightStyle.textFont); + var effectOption = util.merge(this.options.effect || {}, { + r0: 9, + r: 15, + n: 18, + color: '#fff', + timeInterval: 100 + }); + var location = this.getLocation(this.options.textStyle, textWidth + textGap + effectOption.r * 2, Math.max(effectOption.r * 2, textHeight)); + effectOption.x = location.x + effectOption.r; + effectOption.y = textShape.highlightStyle.y = location.y + location.height / 2; + textShape.highlightStyle.x = effectOption.x + effectOption.r + textGap; + var background = this.createBackgroundShape(options.backgroundColor); + var n = effectOption.n; + var x = effectOption.x; + var y = effectOption.y; + var r0 = effectOption.r0; + var r = effectOption.r; + var color = effectOption.color; + var shapeList = []; + var preAngle = Math.round(180 / n); + for (var i = 0; i < n; i++) { + shapeList[i] = new SectorShape({ + highlightStyle: { + x: x, + y: y, + r0: r0, + r: r, + startAngle: preAngle * i * 2, + endAngle: preAngle * i * 2 + preAngle, + color: zrColor.alpha(color, (i + 1) / n), + brushType: 'fill' + } + }); + } + var pos = [ + 0, + x, + y + ]; + return setInterval(function () { + addShapeHandle(background); + pos[0] -= 0.3; + for (var i = 0; i < n; i++) { + shapeList[i].rotation = pos; + addShapeHandle(shapeList[i]); + } + addShapeHandle(textShape); + refreshHandle(); + }, effectOption.timeInterval); + }; + return Spin; +});define('zrender/loadingEffect/Whirling', [ + 'require', + './Base', + '../tool/util', + '../tool/area', + '../shape/Ring', + '../shape/Droplet', + '../shape/Circle' +], function (require) { + var Base = require('./Base'); + var util = require('../tool/util'); + var zrArea = require('../tool/area'); + var RingShape = require('../shape/Ring'); + var DropletShape = require('../shape/Droplet'); + var CircleShape = require('../shape/Circle'); + function Whirling(options) { + Base.call(this, options); + } + util.inherits(Whirling, Base); + Whirling.prototype._start = function (addShapeHandle, refreshHandle) { + var options = util.merge(this.options, { + textStyle: { + color: '#888', + textAlign: 'start' + }, + backgroundColor: 'rgba(250, 250, 250, 0.8)' + }); + var textShape = this.createTextShape(options.textStyle); + var textGap = 10; + var textWidth = zrArea.getTextWidth(textShape.highlightStyle.text, textShape.highlightStyle.textFont); + var textHeight = zrArea.getTextHeight(textShape.highlightStyle.text, textShape.highlightStyle.textFont); + var effectOption = util.merge(this.options.effect || {}, { + r: 18, + colorIn: '#fff', + colorOut: '#555', + colorWhirl: '#6cf', + timeInterval: 50 + }); + var location = this.getLocation(this.options.textStyle, textWidth + textGap + effectOption.r * 2, Math.max(effectOption.r * 2, textHeight)); + effectOption.x = location.x + effectOption.r; + effectOption.y = textShape.highlightStyle.y = location.y + location.height / 2; + textShape.highlightStyle.x = effectOption.x + effectOption.r + textGap; + var background = this.createBackgroundShape(options.backgroundColor); + var droplet = new DropletShape({ + highlightStyle: { + a: Math.round(effectOption.r / 2), + b: Math.round(effectOption.r - effectOption.r / 6), + brushType: 'fill', + color: effectOption.colorWhirl + } + }); + var circleIn = new CircleShape({ + highlightStyle: { + r: Math.round(effectOption.r / 6), + brushType: 'fill', + color: effectOption.colorIn + } + }); + var circleOut = new RingShape({ + highlightStyle: { + r0: Math.round(effectOption.r - effectOption.r / 3), + r: effectOption.r, + brushType: 'fill', + color: effectOption.colorOut + } + }); + var pos = [ + 0, + effectOption.x, + effectOption.y + ]; + droplet.highlightStyle.x = circleIn.highlightStyle.x = circleOut.highlightStyle.x = pos[1]; + droplet.highlightStyle.y = circleIn.highlightStyle.y = circleOut.highlightStyle.y = pos[2]; + return setInterval(function () { + addShapeHandle(background); + addShapeHandle(circleOut); + pos[0] -= 0.3; + droplet.rotation = pos; + addShapeHandle(droplet); + addShapeHandle(circleIn); + addShapeHandle(textShape); + refreshHandle(); + }, effectOption.timeInterval); + }; + return Whirling; +});define('echarts/theme/macarons', [], function () { + var theme = { + color: [ + '#2ec7c9', + '#b6a2de', + '#5ab1ef', + '#ffb980', + '#d87a80', + '#8d98b3', + '#e5cf0d', + '#97b552', + '#95706d', + '#dc69aa', + '#07a2a4', + '#9a7fd1', + '#588dd5', + '#f5994e', + '#c05050', + '#59678c', + '#c9ab00', + '#7eb00a', + '#6f5553', + '#c14089' + ], + title: { + textStyle: { + fontWeight: 'normal', + color: '#008acd' + } + }, + dataRange: { + itemWidth: 15, + color: [ + '#5ab1ef', + '#e0ffff' + ] + }, + toolbox: { + color: [ + '#1e90ff', + '#1e90ff', + '#1e90ff', + '#1e90ff' + ], + effectiveColor: '#ff4500' + }, + tooltip: { + backgroundColor: 'rgba(50,50,50,0.5)', + axisPointer: { + type: 'line', + lineStyle: { color: '#008acd' }, + crossStyle: { color: '#008acd' }, + shadowStyle: { color: 'rgba(200,200,200,0.2)' } + } + }, + dataZoom: { + dataBackgroundColor: '#efefff', + fillerColor: 'rgba(182,162,222,0.2)', + handleColor: '#008acd' + }, + grid: { borderColor: '#eee' }, + categoryAxis: { + axisLine: { lineStyle: { color: '#008acd' } }, + splitLine: { lineStyle: { color: ['#eee'] } } + }, + valueAxis: { + axisLine: { lineStyle: { color: '#008acd' } }, + splitArea: { + show: true, + areaStyle: { + color: [ + 'rgba(250,250,250,0.1)', + 'rgba(200,200,200,0.1)' + ] + } + }, + splitLine: { lineStyle: { color: ['#eee'] } } + }, + polar: { + axisLine: { lineStyle: { color: '#ddd' } }, + splitArea: { + show: true, + areaStyle: { + color: [ + 'rgba(250,250,250,0.2)', + 'rgba(200,200,200,0.2)' + ] + } + }, + splitLine: { lineStyle: { color: '#ddd' } } + }, + timeline: { + lineStyle: { color: '#008acd' }, + controlStyle: { + normal: { color: '#008acd' }, + emphasis: { color: '#008acd' } + }, + symbol: 'emptyCircle', + symbolSize: 3 + }, + bar: { + itemStyle: { + normal: { barBorderRadius: 5 }, + emphasis: { barBorderRadius: 5 } + } + }, + line: { + smooth: true, + symbol: 'emptyCircle', + symbolSize: 3 + }, + k: { + itemStyle: { + normal: { + color: '#d87a80', + color0: '#2ec7c9', + lineStyle: { + color: '#d87a80', + color0: '#2ec7c9' + } + } + } + }, + scatter: { + symbol: 'circle', + symbolSize: 4 + }, + radar: { + symbol: 'emptyCircle', + symbolSize: 3 + }, + map: { + itemStyle: { + normal: { + areaStyle: { color: '#ddd' }, + label: { textStyle: { color: '#d87a80' } } + }, + emphasis: { areaStyle: { color: '#fe994e' } } + } + }, + force: { itemStyle: { normal: { linkStyle: { color: '#1e90ff' } } } }, + chord: { + itemStyle: { + normal: { + borderWidth: 1, + borderColor: 'rgba(128, 128, 128, 0.5)', + chordStyle: { lineStyle: { color: 'rgba(128, 128, 128, 0.5)' } } + }, + emphasis: { + borderWidth: 1, + borderColor: 'rgba(128, 128, 128, 0.5)', + chordStyle: { lineStyle: { color: 'rgba(128, 128, 128, 0.5)' } } + } + } + }, + gauge: { + axisLine: { + lineStyle: { + color: [ + [ + 0.2, + '#2ec7c9' + ], + [ + 0.8, + '#5ab1ef' + ], + [ + 1, + '#d87a80' + ] + ], + width: 10 + } + }, + axisTick: { + splitNumber: 10, + length: 15, + lineStyle: { color: 'auto' } + }, + splitLine: { + length: 22, + lineStyle: { color: 'auto' } + }, + pointer: { width: 5 } + }, + textStyle: { fontFamily: '微软雅黑, Arial, Verdana, sans-serif' } + }; + return theme; +});define('echarts/theme/infographic', [], function () { + var theme = { + color: [ + '#C1232B', + '#B5C334', + '#FCCE10', + '#E87C25', + '#27727B', + '#FE8463', + '#9BCA63', + '#FAD860', + '#F3A43B', + '#60C0DD', + '#D7504B', + '#C6E579', + '#F4E001', + '#F0805A', + '#26C0C0' + ], + title: { + textStyle: { + fontWeight: 'normal', + color: '#27727B' + } + }, + dataRange: { + x: 'right', + y: 'center', + itemWidth: 5, + itemHeight: 25, + color: [ + '#C1232B', + '#FCCE10' + ] + }, + toolbox: { + color: [ + '#C1232B', + '#B5C334', + '#FCCE10', + '#E87C25', + '#27727B', + '#FE8463', + '#9BCA63', + '#FAD860', + '#F3A43B', + '#60C0DD' + ], + effectiveColor: '#ff4500' + }, + tooltip: { + backgroundColor: 'rgba(50,50,50,0.5)', + axisPointer: { + type: 'line', + lineStyle: { + color: '#27727B', + type: 'dashed' + }, + crossStyle: { color: '#27727B' }, + shadowStyle: { color: 'rgba(200,200,200,0.3)' } + } + }, + dataZoom: { + dataBackgroundColor: 'rgba(181,195,52,0.3)', + fillerColor: 'rgba(181,195,52,0.2)', + handleColor: '#27727B' + }, + grid: { borderWidth: 0 }, + categoryAxis: { + axisLine: { lineStyle: { color: '#27727B' } }, + splitLine: { show: false } + }, + valueAxis: { + axisLine: { show: false }, + splitArea: { show: false }, + splitLine: { + lineStyle: { + color: ['#ccc'], + type: 'dashed' + } + } + }, + polar: { + axisLine: { lineStyle: { color: '#ddd' } }, + splitArea: { + show: true, + areaStyle: { + color: [ + 'rgba(250,250,250,0.2)', + 'rgba(200,200,200,0.2)' + ] + } + }, + splitLine: { lineStyle: { color: '#ddd' } } + }, + timeline: { + lineStyle: { color: '#27727B' }, + controlStyle: { + normal: { color: '#27727B' }, + emphasis: { color: '#27727B' } + }, + symbol: 'emptyCircle', + symbolSize: 3 + }, + line: { + itemStyle: { + normal: { + borderWidth: 2, + borderColor: '#fff', + lineStyle: { width: 3 } + }, + emphasis: { borderWidth: 0 } + }, + symbol: 'circle', + symbolSize: 3.5 + }, + k: { + itemStyle: { + normal: { + color: '#C1232B', + color0: '#B5C334', + lineStyle: { + width: 1, + color: '#C1232B', + color0: '#B5C334' + } + } + } + }, + scatter: { + itemdStyle: { + normal: { + borderWidth: 1, + borderColor: 'rgba(200,200,200,0.5)' + }, + emphasis: { borderWidth: 0 } + }, + symbol: 'star4', + symbolSize: 4 + }, + radar: { + symbol: 'emptyCircle', + symbolSize: 3 + }, + map: { + itemStyle: { + normal: { + areaStyle: { color: '#ddd' }, + label: { textStyle: { color: '#C1232B' } } + }, + emphasis: { + areaStyle: { color: '#fe994e' }, + label: { textStyle: { color: 'rgb(100,0,0)' } } + } + } + }, + force: { itemStyle: { normal: { linkStyle: { color: '#27727B' } } } }, + chord: { + itemStyle: { + normal: { + borderWidth: 1, + borderColor: 'rgba(128, 128, 128, 0.5)', + chordStyle: { lineStyle: { color: 'rgba(128, 128, 128, 0.5)' } } + }, + emphasis: { + borderWidth: 1, + borderColor: 'rgba(128, 128, 128, 0.5)', + chordStyle: { lineStyle: { color: 'rgba(128, 128, 128, 0.5)' } } + } + } + }, + gauge: { + center: [ + '50%', + '80%' + ], + radius: '100%', + startAngle: 180, + endAngle: 0, + axisLine: { + show: true, + lineStyle: { + color: [ + [ + 0.2, + '#B5C334' + ], + [ + 0.8, + '#27727B' + ], + [ + 1, + '#C1232B' + ] + ], + width: '40%' + } + }, + axisTick: { + splitNumber: 2, + length: 5, + lineStyle: { color: '#fff' } + }, + axisLabel: { + textStyle: { + color: '#fff', + fontWeight: 'bolder' + } + }, + splitLine: { + length: '5%', + lineStyle: { color: '#fff' } + }, + pointer: { + width: '40%', + length: '80%', + color: '#fff' + }, + title: { + offsetCenter: [ + 0, + -20 + ], + textStyle: { + color: 'auto', + fontSize: 20 + } + }, + detail: { + offsetCenter: [ + 0, + 0 + ], + textStyle: { + color: 'auto', + fontSize: 40 + } + } + }, + textStyle: { fontFamily: '微软雅黑, Arial, Verdana, sans-serif' } + }; + return theme; +});define('zrender/dep/excanvas', ['require'], function (require) { + if (!document.createElement('canvas').getContext) { + (function () { + var m = Math; + var mr = m.round; + var ms = m.sin; + var mc = m.cos; + var abs = m.abs; + var sqrt = m.sqrt; + var Z = 10; + var Z2 = Z / 2; + var IE_VERSION = +navigator.userAgent.match(/MSIE ([\d.]+)?/)[1]; + function getContext() { + return this.context_ || (this.context_ = new CanvasRenderingContext2D_(this)); + } + var slice = Array.prototype.slice; + function bind(f, obj, var_args) { + var a = slice.call(arguments, 2); + return function () { + return f.apply(obj, a.concat(slice.call(arguments))); + }; + } + function encodeHtmlAttribute(s) { + return String(s).replace(/&/g, '&').replace(/"/g, '"'); + } + function addNamespace(doc, prefix, urn) { + if (!doc.namespaces[prefix]) { + doc.namespaces.add(prefix, urn, '#default#VML'); + } + } + function addNamespacesAndStylesheet(doc) { + addNamespace(doc, 'g_vml_', 'urn:schemas-microsoft-com:vml'); + addNamespace(doc, 'g_o_', 'urn:schemas-microsoft-com:office:office'); + if (!doc.styleSheets['ex_canvas_']) { + var ss = doc.createStyleSheet(); + ss.owningElement.id = 'ex_canvas_'; + ss.cssText = 'canvas{display:inline-block;overflow:hidden;' + 'text-align:left;width:300px;height:150px}'; + } + } + addNamespacesAndStylesheet(document); + var G_vmlCanvasManager_ = { + init: function (opt_doc) { + var doc = opt_doc || document; + doc.createElement('canvas'); + doc.attachEvent('onreadystatechange', bind(this.init_, this, doc)); + }, + init_: function (doc) { + var els = doc.getElementsByTagName('canvas'); + for (var i = 0; i < els.length; i++) { + this.initElement(els[i]); + } + }, + initElement: function (el) { + if (!el.getContext) { + el.getContext = getContext; + addNamespacesAndStylesheet(el.ownerDocument); + el.innerHTML = ''; + el.attachEvent('onpropertychange', onPropertyChange); + el.attachEvent('onresize', onResize); + var attrs = el.attributes; + if (attrs.width && attrs.width.specified) { + el.style.width = attrs.width.nodeValue + 'px'; + } else { + el.width = el.clientWidth; + } + if (attrs.height && attrs.height.specified) { + el.style.height = attrs.height.nodeValue + 'px'; + } else { + el.height = el.clientHeight; + } + } + return el; + } + }; + function onPropertyChange(e) { + var el = e.srcElement; + switch (e.propertyName) { + case 'width': + el.getContext().clearRect(); + el.style.width = el.attributes.width.nodeValue + 'px'; + el.firstChild.style.width = el.clientWidth + 'px'; + break; + case 'height': + el.getContext().clearRect(); + el.style.height = el.attributes.height.nodeValue + 'px'; + el.firstChild.style.height = el.clientHeight + 'px'; + break; + } + } + function onResize(e) { + var el = e.srcElement; + if (el.firstChild) { + el.firstChild.style.width = el.clientWidth + 'px'; + el.firstChild.style.height = el.clientHeight + 'px'; + } + } + G_vmlCanvasManager_.init(); + var decToHex = []; + for (var i = 0; i < 16; i++) { + for (var j = 0; j < 16; j++) { + decToHex[i * 16 + j] = i.toString(16) + j.toString(16); + } + } + function createMatrixIdentity() { + return [ + [ + 1, + 0, + 0 + ], + [ + 0, + 1, + 0 + ], + [ + 0, + 0, + 1 + ] + ]; + } + function matrixMultiply(m1, m2) { + var result = createMatrixIdentity(); + for (var x = 0; x < 3; x++) { + for (var y = 0; y < 3; y++) { + var sum = 0; + for (var z = 0; z < 3; z++) { + sum += m1[x][z] * m2[z][y]; + } + result[x][y] = sum; + } + } + return result; + } + function copyState(o1, o2) { + o2.fillStyle = o1.fillStyle; + o2.lineCap = o1.lineCap; + o2.lineJoin = o1.lineJoin; + o2.lineWidth = o1.lineWidth; + o2.miterLimit = o1.miterLimit; + o2.shadowBlur = o1.shadowBlur; + o2.shadowColor = o1.shadowColor; + o2.shadowOffsetX = o1.shadowOffsetX; + o2.shadowOffsetY = o1.shadowOffsetY; + o2.strokeStyle = o1.strokeStyle; + o2.globalAlpha = o1.globalAlpha; + o2.font = o1.font; + o2.textAlign = o1.textAlign; + o2.textBaseline = o1.textBaseline; + o2.scaleX_ = o1.scaleX_; + o2.scaleY_ = o1.scaleY_; + o2.lineScale_ = o1.lineScale_; + } + var colorData = { + aliceblue: '#F0F8FF', + antiquewhite: '#FAEBD7', + aquamarine: '#7FFFD4', + azure: '#F0FFFF', + beige: '#F5F5DC', + bisque: '#FFE4C4', + black: '#000000', + blanchedalmond: '#FFEBCD', + blueviolet: '#8A2BE2', + brown: '#A52A2A', + burlywood: '#DEB887', + cadetblue: '#5F9EA0', + chartreuse: '#7FFF00', + chocolate: '#D2691E', + coral: '#FF7F50', + cornflowerblue: '#6495ED', + cornsilk: '#FFF8DC', + crimson: '#DC143C', + cyan: '#00FFFF', + darkblue: '#00008B', + darkcyan: '#008B8B', + darkgoldenrod: '#B8860B', + darkgray: '#A9A9A9', + darkgreen: '#006400', + darkgrey: '#A9A9A9', + darkkhaki: '#BDB76B', + darkmagenta: '#8B008B', + darkolivegreen: '#556B2F', + darkorange: '#FF8C00', + darkorchid: '#9932CC', + darkred: '#8B0000', + darksalmon: '#E9967A', + darkseagreen: '#8FBC8F', + darkslateblue: '#483D8B', + darkslategray: '#2F4F4F', + darkslategrey: '#2F4F4F', + darkturquoise: '#00CED1', + darkviolet: '#9400D3', + deeppink: '#FF1493', + deepskyblue: '#00BFFF', + dimgray: '#696969', + dimgrey: '#696969', + dodgerblue: '#1E90FF', + firebrick: '#B22222', + floralwhite: '#FFFAF0', + forestgreen: '#228B22', + gainsboro: '#DCDCDC', + ghostwhite: '#F8F8FF', + gold: '#FFD700', + goldenrod: '#DAA520', + grey: '#808080', + greenyellow: '#ADFF2F', + honeydew: '#F0FFF0', + hotpink: '#FF69B4', + indianred: '#CD5C5C', + indigo: '#4B0082', + ivory: '#FFFFF0', + khaki: '#F0E68C', + lavender: '#E6E6FA', + lavenderblush: '#FFF0F5', + lawngreen: '#7CFC00', + lemonchiffon: '#FFFACD', + lightblue: '#ADD8E6', + lightcoral: '#F08080', + lightcyan: '#E0FFFF', + lightgoldenrodyellow: '#FAFAD2', + lightgreen: '#90EE90', + lightgrey: '#D3D3D3', + lightpink: '#FFB6C1', + lightsalmon: '#FFA07A', + lightseagreen: '#20B2AA', + lightskyblue: '#87CEFA', + lightslategray: '#778899', + lightslategrey: '#778899', + lightsteelblue: '#B0C4DE', + lightyellow: '#FFFFE0', + limegreen: '#32CD32', + linen: '#FAF0E6', + magenta: '#FF00FF', + mediumaquamarine: '#66CDAA', + mediumblue: '#0000CD', + mediumorchid: '#BA55D3', + mediumpurple: '#9370DB', + mediumseagreen: '#3CB371', + mediumslateblue: '#7B68EE', + mediumspringgreen: '#00FA9A', + mediumturquoise: '#48D1CC', + mediumvioletred: '#C71585', + midnightblue: '#191970', + mintcream: '#F5FFFA', + mistyrose: '#FFE4E1', + moccasin: '#FFE4B5', + navajowhite: '#FFDEAD', + oldlace: '#FDF5E6', + olivedrab: '#6B8E23', + orange: '#FFA500', + orangered: '#FF4500', + orchid: '#DA70D6', + palegoldenrod: '#EEE8AA', + palegreen: '#98FB98', + paleturquoise: '#AFEEEE', + palevioletred: '#DB7093', + papayawhip: '#FFEFD5', + peachpuff: '#FFDAB9', + peru: '#CD853F', + pink: '#FFC0CB', + plum: '#DDA0DD', + powderblue: '#B0E0E6', + rosybrown: '#BC8F8F', + royalblue: '#4169E1', + saddlebrown: '#8B4513', + salmon: '#FA8072', + sandybrown: '#F4A460', + seagreen: '#2E8B57', + seashell: '#FFF5EE', + sienna: '#A0522D', + skyblue: '#87CEEB', + slateblue: '#6A5ACD', + slategray: '#708090', + slategrey: '#708090', + snow: '#FFFAFA', + springgreen: '#00FF7F', + steelblue: '#4682B4', + tan: '#D2B48C', + thistle: '#D8BFD8', + tomato: '#FF6347', + turquoise: '#40E0D0', + violet: '#EE82EE', + wheat: '#F5DEB3', + whitesmoke: '#F5F5F5', + yellowgreen: '#9ACD32' + }; + function getRgbHslContent(styleString) { + var start = styleString.indexOf('(', 3); + var end = styleString.indexOf(')', start + 1); + var parts = styleString.substring(start + 1, end).split(','); + if (parts.length != 4 || styleString.charAt(3) != 'a') { + parts[3] = 1; + } + return parts; + } + function percent(s) { + return parseFloat(s) / 100; + } + function clamp(v, min, max) { + return Math.min(max, Math.max(min, v)); + } + function hslToRgb(parts) { + var r, g, b, h, s, l; + h = parseFloat(parts[0]) / 360 % 360; + if (h < 0) + h++; + s = clamp(percent(parts[1]), 0, 1); + l = clamp(percent(parts[2]), 0, 1); + if (s == 0) { + r = g = b = l; + } else { + var q = l < 0.5 ? l * (1 + s) : l + s - l * s; + var p = 2 * l - q; + r = hueToRgb(p, q, h + 1 / 3); + g = hueToRgb(p, q, h); + b = hueToRgb(p, q, h - 1 / 3); + } + return '#' + decToHex[Math.floor(r * 255)] + decToHex[Math.floor(g * 255)] + decToHex[Math.floor(b * 255)]; + } + function hueToRgb(m1, m2, h) { + if (h < 0) + h++; + if (h > 1) + h--; + if (6 * h < 1) + return m1 + (m2 - m1) * 6 * h; + else if (2 * h < 1) + return m2; + else if (3 * h < 2) + return m1 + (m2 - m1) * (2 / 3 - h) * 6; + else + return m1; + } + var processStyleCache = {}; + function processStyle(styleString) { + if (styleString in processStyleCache) { + return processStyleCache[styleString]; + } + var str, alpha = 1; + styleString = String(styleString); + if (styleString.charAt(0) == '#') { + str = styleString; + } else if (/^rgb/.test(styleString)) { + var parts = getRgbHslContent(styleString); + var str = '#', n; + for (var i = 0; i < 3; i++) { + if (parts[i].indexOf('%') != -1) { + n = Math.floor(percent(parts[i]) * 255); + } else { + n = +parts[i]; + } + str += decToHex[clamp(n, 0, 255)]; + } + alpha = +parts[3]; + } else if (/^hsl/.test(styleString)) { + var parts = getRgbHslContent(styleString); + str = hslToRgb(parts); + alpha = parts[3]; + } else { + str = colorData[styleString] || styleString; + } + return processStyleCache[styleString] = { + color: str, + alpha: alpha + }; + } + var DEFAULT_STYLE = { + style: 'normal', + variant: 'normal', + weight: 'normal', + size: 12, + family: '微软雅黑' + }; + var fontStyleCache = {}; + function processFontStyle(styleString) { + if (fontStyleCache[styleString]) { + return fontStyleCache[styleString]; + } + var el = document.createElement('div'); + var style = el.style; + var fontFamily; + try { + style.font = styleString; + fontFamily = style.fontFamily.split(',')[0]; + } catch (ex) { + } + return fontStyleCache[styleString] = { + style: style.fontStyle || DEFAULT_STYLE.style, + variant: style.fontVariant || DEFAULT_STYLE.variant, + weight: style.fontWeight || DEFAULT_STYLE.weight, + size: style.fontSize || DEFAULT_STYLE.size, + family: fontFamily || DEFAULT_STYLE.family + }; + } + function getComputedStyle(style, element) { + var computedStyle = {}; + for (var p in style) { + computedStyle[p] = style[p]; + } + var canvasFontSize = parseFloat(element.currentStyle.fontSize), fontSize = parseFloat(style.size); + if (typeof style.size == 'number') { + computedStyle.size = style.size; + } else if (style.size.indexOf('px') != -1) { + computedStyle.size = fontSize; + } else if (style.size.indexOf('em') != -1) { + computedStyle.size = canvasFontSize * fontSize; + } else if (style.size.indexOf('%') != -1) { + computedStyle.size = canvasFontSize / 100 * fontSize; + } else if (style.size.indexOf('pt') != -1) { + computedStyle.size = fontSize / 0.75; + } else { + computedStyle.size = canvasFontSize; + } + return computedStyle; + } + function buildStyle(style) { + return style.style + ' ' + style.variant + ' ' + style.weight + ' ' + style.size + 'px \'' + style.family + '\''; + } + var lineCapMap = { + 'butt': 'flat', + 'round': 'round' + }; + function processLineCap(lineCap) { + return lineCapMap[lineCap] || 'square'; + } + function CanvasRenderingContext2D_(canvasElement) { + this.m_ = createMatrixIdentity(); + this.mStack_ = []; + this.aStack_ = []; + this.currentPath_ = []; + this.strokeStyle = '#000'; + this.fillStyle = '#000'; + this.lineWidth = 1; + this.lineJoin = 'miter'; + this.lineCap = 'butt'; + this.miterLimit = Z * 1; + this.globalAlpha = 1; + this.font = '12px 微软雅黑'; + this.textAlign = 'left'; + this.textBaseline = 'alphabetic'; + this.canvas = canvasElement; + var cssText = 'width:' + canvasElement.clientWidth + 'px;height:' + canvasElement.clientHeight + 'px;overflow:hidden;position:absolute'; + var el = canvasElement.ownerDocument.createElement('div'); + el.style.cssText = cssText; + canvasElement.appendChild(el); + var overlayEl = el.cloneNode(false); + overlayEl.style.backgroundColor = '#fff'; + overlayEl.style.filter = 'alpha(opacity=0)'; + canvasElement.appendChild(overlayEl); + this.element_ = el; + this.scaleX_ = 1; + this.scaleY_ = 1; + this.lineScale_ = 1; + } + var contextPrototype = CanvasRenderingContext2D_.prototype; + contextPrototype.clearRect = function () { + if (this.textMeasureEl_) { + this.textMeasureEl_.removeNode(true); + this.textMeasureEl_ = null; + } + this.element_.innerHTML = ''; + }; + contextPrototype.beginPath = function () { + this.currentPath_ = []; + }; + contextPrototype.moveTo = function (aX, aY) { + var p = getCoords(this, aX, aY); + this.currentPath_.push({ + type: 'moveTo', + x: p.x, + y: p.y + }); + this.currentX_ = p.x; + this.currentY_ = p.y; + }; + contextPrototype.lineTo = function (aX, aY) { + var p = getCoords(this, aX, aY); + this.currentPath_.push({ + type: 'lineTo', + x: p.x, + y: p.y + }); + this.currentX_ = p.x; + this.currentY_ = p.y; + }; + contextPrototype.bezierCurveTo = function (aCP1x, aCP1y, aCP2x, aCP2y, aX, aY) { + var p = getCoords(this, aX, aY); + var cp1 = getCoords(this, aCP1x, aCP1y); + var cp2 = getCoords(this, aCP2x, aCP2y); + bezierCurveTo(this, cp1, cp2, p); + }; + function bezierCurveTo(self, cp1, cp2, p) { + self.currentPath_.push({ + type: 'bezierCurveTo', + cp1x: cp1.x, + cp1y: cp1.y, + cp2x: cp2.x, + cp2y: cp2.y, + x: p.x, + y: p.y + }); + self.currentX_ = p.x; + self.currentY_ = p.y; + } + contextPrototype.quadraticCurveTo = function (aCPx, aCPy, aX, aY) { + var cp = getCoords(this, aCPx, aCPy); + var p = getCoords(this, aX, aY); + var cp1 = { + x: this.currentX_ + 2 / 3 * (cp.x - this.currentX_), + y: this.currentY_ + 2 / 3 * (cp.y - this.currentY_) + }; + var cp2 = { + x: cp1.x + (p.x - this.currentX_) / 3, + y: cp1.y + (p.y - this.currentY_) / 3 + }; + bezierCurveTo(this, cp1, cp2, p); + }; + contextPrototype.arc = function (aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise) { + aRadius *= Z; + var arcType = aClockwise ? 'at' : 'wa'; + var xStart = aX + mc(aStartAngle) * aRadius - Z2; + var yStart = aY + ms(aStartAngle) * aRadius - Z2; + var xEnd = aX + mc(aEndAngle) * aRadius - Z2; + var yEnd = aY + ms(aEndAngle) * aRadius - Z2; + if (xStart == xEnd && !aClockwise) { + xStart += 0.125; + } + var p = getCoords(this, aX, aY); + var pStart = getCoords(this, xStart, yStart); + var pEnd = getCoords(this, xEnd, yEnd); + this.currentPath_.push({ + type: arcType, + x: p.x, + y: p.y, + radius: aRadius, + xStart: pStart.x, + yStart: pStart.y, + xEnd: pEnd.x, + yEnd: pEnd.y + }); + }; + contextPrototype.rect = function (aX, aY, aWidth, aHeight) { + this.moveTo(aX, aY); + this.lineTo(aX + aWidth, aY); + this.lineTo(aX + aWidth, aY + aHeight); + this.lineTo(aX, aY + aHeight); + this.closePath(); + }; + contextPrototype.strokeRect = function (aX, aY, aWidth, aHeight) { + var oldPath = this.currentPath_; + this.beginPath(); + this.moveTo(aX, aY); + this.lineTo(aX + aWidth, aY); + this.lineTo(aX + aWidth, aY + aHeight); + this.lineTo(aX, aY + aHeight); + this.closePath(); + this.stroke(); + this.currentPath_ = oldPath; + }; + contextPrototype.fillRect = function (aX, aY, aWidth, aHeight) { + var oldPath = this.currentPath_; + this.beginPath(); + this.moveTo(aX, aY); + this.lineTo(aX + aWidth, aY); + this.lineTo(aX + aWidth, aY + aHeight); + this.lineTo(aX, aY + aHeight); + this.closePath(); + this.fill(); + this.currentPath_ = oldPath; + }; + contextPrototype.createLinearGradient = function (aX0, aY0, aX1, aY1) { + var gradient = new CanvasGradient_('gradient'); + gradient.x0_ = aX0; + gradient.y0_ = aY0; + gradient.x1_ = aX1; + gradient.y1_ = aY1; + return gradient; + }; + contextPrototype.createRadialGradient = function (aX0, aY0, aR0, aX1, aY1, aR1) { + var gradient = new CanvasGradient_('gradientradial'); + gradient.x0_ = aX0; + gradient.y0_ = aY0; + gradient.r0_ = aR0; + gradient.x1_ = aX1; + gradient.y1_ = aY1; + gradient.r1_ = aR1; + return gradient; + }; + contextPrototype.drawImage = function (image, var_args) { + var dx, dy, dw, dh, sx, sy, sw, sh; + var oldRuntimeWidth = image.runtimeStyle.width; + var oldRuntimeHeight = image.runtimeStyle.height; + image.runtimeStyle.width = 'auto'; + image.runtimeStyle.height = 'auto'; + var w = image.width; + var h = image.height; + image.runtimeStyle.width = oldRuntimeWidth; + image.runtimeStyle.height = oldRuntimeHeight; + if (arguments.length == 3) { + dx = arguments[1]; + dy = arguments[2]; + sx = sy = 0; + sw = dw = w; + sh = dh = h; + } else if (arguments.length == 5) { + dx = arguments[1]; + dy = arguments[2]; + dw = arguments[3]; + dh = arguments[4]; + sx = sy = 0; + sw = w; + sh = h; + } else if (arguments.length == 9) { + sx = arguments[1]; + sy = arguments[2]; + sw = arguments[3]; + sh = arguments[4]; + dx = arguments[5]; + dy = arguments[6]; + dw = arguments[7]; + dh = arguments[8]; + } else { + throw Error('Invalid number of arguments'); + } + var d = getCoords(this, dx, dy); + var w2 = sw / 2; + var h2 = sh / 2; + var vmlStr = []; + var W = 10; + var H = 10; + var scaleX = scaleY = 1; + vmlStr.push(' '); + if (sx || sy) { + vmlStr.push('
'); + } + vmlStr.push('
'); + if (sx || sy) + vmlStr.push('
'); + vmlStr.push('
'); + this.element_.insertAdjacentHTML('BeforeEnd', vmlStr.join('')); + }; + contextPrototype.stroke = function (aFill) { + var lineStr = []; + var lineOpen = false; + var W = 10; + var H = 10; + lineStr.push(''); + if (!aFill) { + appendStroke(this, lineStr); + } else { + appendFill(this, lineStr, min, max); + } + lineStr.push(''); + this.element_.insertAdjacentHTML('beforeEnd', lineStr.join('')); + }; + function appendStroke(ctx, lineStr) { + var a = processStyle(ctx.strokeStyle); + var color = a.color; + var opacity = a.alpha * ctx.globalAlpha; + var lineWidth = ctx.lineScale_ * ctx.lineWidth; + if (lineWidth < 1) { + opacity *= lineWidth; + } + lineStr.push(''); + } + function appendFill(ctx, lineStr, min, max) { + var fillStyle = ctx.fillStyle; + var arcScaleX = ctx.scaleX_; + var arcScaleY = ctx.scaleY_; + var width = max.x - min.x; + var height = max.y - min.y; + if (fillStyle instanceof CanvasGradient_) { + var angle = 0; + var focus = { + x: 0, + y: 0 + }; + var shift = 0; + var expansion = 1; + if (fillStyle.type_ == 'gradient') { + var x0 = fillStyle.x0_ / arcScaleX; + var y0 = fillStyle.y0_ / arcScaleY; + var x1 = fillStyle.x1_ / arcScaleX; + var y1 = fillStyle.y1_ / arcScaleY; + var p0 = getCoords(ctx, x0, y0); + var p1 = getCoords(ctx, x1, y1); + var dx = p1.x - p0.x; + var dy = p1.y - p0.y; + angle = Math.atan2(dx, dy) * 180 / Math.PI; + if (angle < 0) { + angle += 360; + } + if (angle < 0.000001) { + angle = 0; + } + } else { + var p0 = getCoords(ctx, fillStyle.x0_, fillStyle.y0_); + focus = { + x: (p0.x - min.x) / width, + y: (p0.y - min.y) / height + }; + width /= arcScaleX * Z; + height /= arcScaleY * Z; + var dimension = m.max(width, height); + shift = 2 * fillStyle.r0_ / dimension; + expansion = 2 * fillStyle.r1_ / dimension - shift; + } + var stops = fillStyle.colors_; + stops.sort(function (cs1, cs2) { + return cs1.offset - cs2.offset; + }); + var length = stops.length; + var color1 = stops[0].color; + var color2 = stops[length - 1].color; + var opacity1 = stops[0].alpha * ctx.globalAlpha; + var opacity2 = stops[length - 1].alpha * ctx.globalAlpha; + var colors = []; + for (var i = 0; i < length; i++) { + var stop = stops[i]; + colors.push(stop.offset * expansion + shift + ' ' + stop.color); + } + lineStr.push(''); + } else if (fillStyle instanceof CanvasPattern_) { + if (width && height) { + var deltaLeft = -min.x; + var deltaTop = -min.y; + lineStr.push(''); + } + } else { + var a = processStyle(ctx.fillStyle); + var color = a.color; + var opacity = a.alpha * ctx.globalAlpha; + lineStr.push(''); + } + } + contextPrototype.fill = function () { + this.stroke(true); + }; + contextPrototype.closePath = function () { + this.currentPath_.push({ type: 'close' }); + }; + function getCoords(ctx, aX, aY) { + var m = ctx.m_; + return { + x: Z * (aX * m[0][0] + aY * m[1][0] + m[2][0]) - Z2, + y: Z * (aX * m[0][1] + aY * m[1][1] + m[2][1]) - Z2 + }; + } + ; + contextPrototype.save = function () { + var o = {}; + copyState(this, o); + this.aStack_.push(o); + this.mStack_.push(this.m_); + this.m_ = matrixMultiply(createMatrixIdentity(), this.m_); + }; + contextPrototype.restore = function () { + if (this.aStack_.length) { + copyState(this.aStack_.pop(), this); + this.m_ = this.mStack_.pop(); + } + }; + function matrixIsFinite(m) { + return isFinite(m[0][0]) && isFinite(m[0][1]) && isFinite(m[1][0]) && isFinite(m[1][1]) && isFinite(m[2][0]) && isFinite(m[2][1]); + } + function setM(ctx, m, updateLineScale) { + if (!matrixIsFinite(m)) { + return; + } + ctx.m_ = m; + ctx.scaleX_ = Math.sqrt(m[0][0] * m[0][0] + m[0][1] * m[0][1]); + ctx.scaleY_ = Math.sqrt(m[1][0] * m[1][0] + m[1][1] * m[1][1]); + if (updateLineScale) { + var det = m[0][0] * m[1][1] - m[0][1] * m[1][0]; + ctx.lineScale_ = sqrt(abs(det)); + } + } + contextPrototype.translate = function (aX, aY) { + var m1 = [ + [ + 1, + 0, + 0 + ], + [ + 0, + 1, + 0 + ], + [ + aX, + aY, + 1 + ] + ]; + setM(this, matrixMultiply(m1, this.m_), false); + }; + contextPrototype.rotate = function (aRot) { + var c = mc(aRot); + var s = ms(aRot); + var m1 = [ + [ + c, + s, + 0 + ], + [ + -s, + c, + 0 + ], + [ + 0, + 0, + 1 + ] + ]; + setM(this, matrixMultiply(m1, this.m_), false); + }; + contextPrototype.scale = function (aX, aY) { + var m1 = [ + [ + aX, + 0, + 0 + ], + [ + 0, + aY, + 0 + ], + [ + 0, + 0, + 1 + ] + ]; + setM(this, matrixMultiply(m1, this.m_), true); + }; + contextPrototype.transform = function (m11, m12, m21, m22, dx, dy) { + var m1 = [ + [ + m11, + m12, + 0 + ], + [ + m21, + m22, + 0 + ], + [ + dx, + dy, + 1 + ] + ]; + setM(this, matrixMultiply(m1, this.m_), true); + }; + contextPrototype.setTransform = function (m11, m12, m21, m22, dx, dy) { + var m = [ + [ + m11, + m12, + 0 + ], + [ + m21, + m22, + 0 + ], + [ + dx, + dy, + 1 + ] + ]; + setM(this, m, true); + }; + contextPrototype.drawText_ = function (text, x, y, maxWidth, stroke) { + var m = this.m_, delta = 1000, left = 0, right = delta, offset = { + x: 0, + y: 0 + }, lineStr = []; + var fontStyle = getComputedStyle(processFontStyle(this.font), this.element_); + var fontStyleString = buildStyle(fontStyle); + var elementStyle = this.element_.currentStyle; + var textAlign = this.textAlign.toLowerCase(); + switch (textAlign) { + case 'left': + case 'center': + case 'right': + break; + case 'end': + textAlign = elementStyle.direction == 'ltr' ? 'right' : 'left'; + break; + case 'start': + textAlign = elementStyle.direction == 'rtl' ? 'right' : 'left'; + break; + default: + textAlign = 'left'; + } + switch (this.textBaseline) { + case 'hanging': + case 'top': + offset.y = fontStyle.size / 1.75; + break; + case 'middle': + break; + default: + case null: + case 'alphabetic': + case 'ideographic': + case 'bottom': + offset.y = -fontStyle.size / 2.25; + break; + } + switch (textAlign) { + case 'right': + left = delta; + right = 0.05; + break; + case 'center': + left = right = delta / 2; + break; + } + var d = getCoords(this, x + offset.x, y + offset.y); + lineStr.push(''); + if (stroke) { + appendStroke(this, lineStr); + } else { + appendFill(this, lineStr, { + x: -left, + y: 0 + }, { + x: right, + y: fontStyle.size + }); + } + var skewM = m[0][0].toFixed(3) + ',' + m[1][0].toFixed(3) + ',' + m[0][1].toFixed(3) + ',' + m[1][1].toFixed(3) + ',0,0'; + var skewOffset = mr(d.x / Z) + ',' + mr(d.y / Z); + lineStr.push('', '', ''); + this.element_.insertAdjacentHTML('beforeEnd', lineStr.join('')); + }; + contextPrototype.fillText = function (text, x, y, maxWidth) { + this.drawText_(text, x, y, maxWidth, false); + }; + contextPrototype.strokeText = function (text, x, y, maxWidth) { + this.drawText_(text, x, y, maxWidth, true); + }; + contextPrototype.measureText = function (text) { + if (!this.textMeasureEl_) { + var s = ''; + this.element_.insertAdjacentHTML('beforeEnd', s); + this.textMeasureEl_ = this.element_.lastChild; + } + var doc = this.element_.ownerDocument; + this.textMeasureEl_.innerHTML = ''; + try { + this.textMeasureEl_.style.font = this.font; + } catch (ex) { + } + this.textMeasureEl_.appendChild(doc.createTextNode(text)); + return { width: this.textMeasureEl_.offsetWidth }; + }; + contextPrototype.clip = function () { + }; + contextPrototype.arcTo = function () { + }; + contextPrototype.createPattern = function (image, repetition) { + return new CanvasPattern_(image, repetition); + }; + function CanvasGradient_(aType) { + this.type_ = aType; + this.x0_ = 0; + this.y0_ = 0; + this.r0_ = 0; + this.x1_ = 0; + this.y1_ = 0; + this.r1_ = 0; + this.colors_ = []; + } + CanvasGradient_.prototype.addColorStop = function (aOffset, aColor) { + aColor = processStyle(aColor); + this.colors_.push({ + offset: aOffset, + color: aColor.color, + alpha: aColor.alpha + }); + }; + function CanvasPattern_(image, repetition) { + assertImageIsValid(image); + switch (repetition) { + case 'repeat': + case null: + case '': + this.repetition_ = 'repeat'; + break; + case 'repeat-x': + case 'repeat-y': + case 'no-repeat': + this.repetition_ = repetition; + break; + default: + throwException('SYNTAX_ERR'); + } + this.src_ = image.src; + this.width_ = image.width; + this.height_ = image.height; + } + function throwException(s) { + throw new DOMException_(s); + } + function assertImageIsValid(img) { + if (!img || img.nodeType != 1 || img.tagName != 'IMG') { + throwException('TYPE_MISMATCH_ERR'); + } + if (img.readyState != 'complete') { + throwException('INVALID_STATE_ERR'); + } + } + function DOMException_(s) { + this.code = this[s]; + this.message = s + ': DOM Exception ' + this.code; + } + var p = DOMException_.prototype = new Error(); + p.INDEX_SIZE_ERR = 1; + p.DOMSTRING_SIZE_ERR = 2; + p.HIERARCHY_REQUEST_ERR = 3; + p.WRONG_DOCUMENT_ERR = 4; + p.INVALID_CHARACTER_ERR = 5; + p.NO_DATA_ALLOWED_ERR = 6; + p.NO_MODIFICATION_ALLOWED_ERR = 7; + p.NOT_FOUND_ERR = 8; + p.NOT_SUPPORTED_ERR = 9; + p.INUSE_ATTRIBUTE_ERR = 10; + p.INVALID_STATE_ERR = 11; + p.SYNTAX_ERR = 12; + p.INVALID_MODIFICATION_ERR = 13; + p.NAMESPACE_ERR = 14; + p.INVALID_ACCESS_ERR = 15; + p.VALIDATION_ERR = 16; + p.TYPE_MISMATCH_ERR = 17; + G_vmlCanvasManager = G_vmlCanvasManager_; + CanvasRenderingContext2D = CanvasRenderingContext2D_; + CanvasGradient = CanvasGradient_; + CanvasPattern = CanvasPattern_; + DOMException = DOMException_; + }()); + } else { + G_vmlCanvasManager = false; + } + return G_vmlCanvasManager; +});define('zrender/mixin/Eventful', ['require'], function (require) { + var Eventful = function () { + this._handlers = {}; + }; + Eventful.prototype.one = function (event, handler, context) { + var _h = this._handlers; + if (!handler || !event) { + return this; + } + if (!_h[event]) { + _h[event] = []; + } + _h[event].push({ + h: handler, + one: true, + ctx: context || this + }); + return this; + }; + Eventful.prototype.bind = function (event, handler, context) { + var _h = this._handlers; + if (!handler || !event) { + return this; + } + if (!_h[event]) { + _h[event] = []; + } + _h[event].push({ + h: handler, + one: false, + ctx: context || this + }); + return this; + }; + Eventful.prototype.unbind = function (event, handler) { + var _h = this._handlers; + if (!event) { + this._handlers = {}; + return this; + } + if (handler) { + if (_h[event]) { + var newList = []; + for (var i = 0, l = _h[event].length; i < l; i++) { + if (_h[event][i]['h'] != handler) { + newList.push(_h[event][i]); + } + } + _h[event] = newList; + } + if (_h[event] && _h[event].length === 0) { + delete _h[event]; + } + } else { + delete _h[event]; + } + return this; + }; + Eventful.prototype.dispatch = function (type) { + if (this._handlers[type]) { + var args = arguments; + var argLen = args.length; + if (argLen > 3) { + args = Array.prototype.slice.call(args, 1); + } + var _h = this._handlers[type]; + var len = _h.length; + for (var i = 0; i < len;) { + switch (argLen) { + case 1: + _h[i]['h'].call(_h[i]['ctx']); + break; + case 2: + _h[i]['h'].call(_h[i]['ctx'], args[1]); + break; + case 3: + _h[i]['h'].call(_h[i]['ctx'], args[1], args[2]); + break; + default: + _h[i]['h'].apply(_h[i]['ctx'], args); + break; + } + if (_h[i]['one']) { + _h.splice(i, 1); + len--; + } else { + i++; + } + } + } + return this; + }; + Eventful.prototype.dispatchWithContext = function (type) { + if (this._handlers[type]) { + var args = arguments; + var argLen = args.length; + if (argLen > 4) { + args = Array.prototype.slice.call(args, 1, args.length - 1); + } + var ctx = args[args.length - 1]; + var _h = this._handlers[type]; + var len = _h.length; + for (var i = 0; i < len;) { + switch (argLen) { + case 1: + _h[i]['h'].call(ctx); + break; + case 2: + _h[i]['h'].call(ctx, args[1]); + break; + case 3: + _h[i]['h'].call(ctx, args[1], args[2]); + break; + default: + _h[i]['h'].apply(ctx, args); + break; + } + if (_h[i]['one']) { + _h.splice(i, 1); + len--; + } else { + i++; + } + } + } + return this; + }; + return Eventful; +});define('zrender/tool/log', [ + 'require', + '../config' +], function (require) { + var config = require('../config'); + return function () { + if (config.debugMode === 0) { + return; + } else if (config.debugMode == 1) { + for (var k in arguments) { + throw new Error(arguments[k]); + } + } else if (config.debugMode > 1) { + for (var k in arguments) { + console.log(arguments[k]); + } + } + }; +});define('zrender/tool/guid', [], function () { + var idStart = 2311; + return function () { + return 'zrender__' + idStart++; + }; +});define('zrender/Handler', [ + 'require', + './config', + './tool/env', + './tool/event', + './tool/util', + './tool/vector', + './tool/matrix', + './mixin/Eventful' +], function (require) { + 'use strict'; + var config = require('./config'); + var env = require('./tool/env'); + var eventTool = require('./tool/event'); + var util = require('./tool/util'); + var vec2 = require('./tool/vector'); + var mat2d = require('./tool/matrix'); + var EVENT = config.EVENT; + var Eventful = require('./mixin/Eventful'); + var domHandlerNames = [ + 'resize', + 'click', + 'dblclick', + 'mousewheel', + 'mousemove', + 'mouseout', + 'mouseup', + 'mousedown', + 'touchstart', + 'touchend', + 'touchmove' + ]; + var domHandlers = { + resize: function (event) { + event = event || window.event; + this._lastHover = null; + this._isMouseDown = 0; + this.dispatch(EVENT.RESIZE, event); + }, + click: function (event) { + event = this._zrenderEventFixed(event); + var _lastHover = this._lastHover; + if (_lastHover && _lastHover.clickable || !_lastHover) { + if (this._clickThreshold < 5) { + this._dispatchAgency(_lastHover, EVENT.CLICK, event); + } + } + this._mousemoveHandler(event); + }, + dblclick: function (event) { + event = event || window.event; + event = this._zrenderEventFixed(event); + var _lastHover = this._lastHover; + if (_lastHover && _lastHover.clickable || !_lastHover) { + if (this._clickThreshold < 5) { + this._dispatchAgency(_lastHover, EVENT.DBLCLICK, event); + } + } + this._mousemoveHandler(event); + }, + mousewheel: function (event) { + event = this._zrenderEventFixed(event); + var delta = event.wheelDelta || -event.detail; + var scale = delta > 0 ? 1.1 : 1 / 1.1; + var needsRefresh = false; + var mouseX = this._mouseX; + var mouseY = this._mouseY; + this.painter.eachBuildinLayer(function (layer) { + var pos = layer.position; + if (layer.zoomable) { + layer.__zoom = layer.__zoom || 1; + var newZoom = layer.__zoom; + newZoom *= scale; + newZoom = Math.max(Math.min(layer.maxZoom, newZoom), layer.minZoom); + scale = newZoom / layer.__zoom; + layer.__zoom = newZoom; + pos[0] -= (mouseX - pos[0]) * (scale - 1); + pos[1] -= (mouseY - pos[1]) * (scale - 1); + layer.scale[0] *= scale; + layer.scale[1] *= scale; + layer.dirty = true; + needsRefresh = true; + eventTool.stop(event); + } + }); + if (needsRefresh) { + this.painter.refresh(); + } + this._dispatchAgency(this._lastHover, EVENT.MOUSEWHEEL, event); + this._mousemoveHandler(event); + }, + mousemove: function (event) { + if (this.painter.isLoading()) { + return; + } + event = this._zrenderEventFixed(event); + this._lastX = this._mouseX; + this._lastY = this._mouseY; + this._mouseX = eventTool.getX(event); + this._mouseY = eventTool.getY(event); + var dx = this._mouseX - this._lastX; + var dy = this._mouseY - this._lastY; + this._processDragStart(event); + this._hasfound = 0; + this._event = event; + this._iterateAndFindHover(); + if (!this._hasfound) { + if (!this._draggingTarget || this._lastHover && this._lastHover != this._draggingTarget) { + this._processOutShape(event); + this._processDragLeave(event); + } + this._lastHover = null; + this.storage.delHover(); + this.painter.clearHover(); + } + var cursor = 'default'; + if (this._draggingTarget) { + this.storage.drift(this._draggingTarget.id, dx, dy); + this._draggingTarget.modSelf(); + this.storage.addHover(this._draggingTarget); + this._clickThreshold++; + } else if (this._isMouseDown) { + var needsRefresh = false; + this.painter.eachBuildinLayer(function (layer) { + if (layer.panable) { + cursor = 'move'; + layer.position[0] += dx; + layer.position[1] += dy; + needsRefresh = true; + layer.dirty = true; + } + }); + if (needsRefresh) { + this.painter.refresh(); + } + } + if (this._draggingTarget || this._hasfound && this._lastHover.draggable) { + cursor = 'move'; + } else if (this._hasfound && this._lastHover.clickable) { + cursor = 'pointer'; + } + this.root.style.cursor = cursor; + this._dispatchAgency(this._lastHover, EVENT.MOUSEMOVE, event); + if (this._draggingTarget || this._hasfound || this.storage.hasHoverShape()) { + this.painter.refreshHover(); + } + }, + mouseout: function (event) { + event = this._zrenderEventFixed(event); + var element = event.toElement || event.relatedTarget; + if (element != this.root) { + while (element && element.nodeType != 9) { + if (element == this.root) { + this._mousemoveHandler(event); + return; + } + element = element.parentNode; + } + } + event.zrenderX = this._lastX; + event.zrenderY = this._lastY; + this.root.style.cursor = 'default'; + this._isMouseDown = 0; + this._processOutShape(event); + this._processDrop(event); + this._processDragEnd(event); + if (!this.painter.isLoading()) { + this.painter.refreshHover(); + } + this.dispatch(EVENT.GLOBALOUT, event); + }, + mousedown: function (event) { + this._clickThreshold = 0; + if (this._lastDownButton == 2) { + this._lastDownButton = event.button; + this._mouseDownTarget = null; + return; + } + this._lastMouseDownMoment = new Date(); + event = this._zrenderEventFixed(event); + this._isMouseDown = 1; + this._mouseDownTarget = this._lastHover; + this._dispatchAgency(this._lastHover, EVENT.MOUSEDOWN, event); + this._lastDownButton = event.button; + }, + mouseup: function (event) { + event = this._zrenderEventFixed(event); + this.root.style.cursor = 'default'; + this._isMouseDown = 0; + this._mouseDownTarget = null; + this._dispatchAgency(this._lastHover, EVENT.MOUSEUP, event); + this._processDrop(event); + this._processDragEnd(event); + }, + touchstart: function (event) { + event = this._zrenderEventFixed(event, true); + this._lastTouchMoment = new Date(); + this._mobileFindFixed(event); + this._mousedownHandler(event); + }, + touchmove: function (event) { + event = this._zrenderEventFixed(event, true); + this._mousemoveHandler(event); + if (this._isDragging) { + eventTool.stop(event); + } + }, + touchend: function (event) { + event = this._zrenderEventFixed(event, true); + this._mouseupHandler(event); + var now = new Date(); + if (now - this._lastTouchMoment < EVENT.touchClickDelay) { + this._mobileFindFixed(event); + this._clickHandler(event); + if (now - this._lastClickMoment < EVENT.touchClickDelay / 2) { + this._dblclickHandler(event); + if (this._lastHover && this._lastHover.clickable) { + eventTool.stop(event); + } + } + this._lastClickMoment = now; + } + this.painter.clearHover(); + } + }; + function bind1Arg(handler, context) { + return function (e) { + return handler.call(context, e); + }; + } + function bind3Arg(handler, context) { + return function (arg1, arg2, arg3) { + return handler.call(context, arg1, arg2, arg3); + }; + } + function initDomHandler(instance) { + var len = domHandlerNames.length; + while (len--) { + var name = domHandlerNames[len]; + instance['_' + name + 'Handler'] = bind1Arg(domHandlers[name], instance); + } + } + var Handler = function (root, storage, painter) { + Eventful.call(this); + this.root = root; + this.storage = storage; + this.painter = painter; + this._lastX = this._lastY = this._mouseX = this._mouseY = 0; + this._findHover = bind3Arg(findHover, this); + this._domHover = painter.getDomHover(); + initDomHandler(this); + if (window.addEventListener) { + window.addEventListener('resize', this._resizeHandler); + if (env.os.tablet || env.os.phone) { + root.addEventListener('touchstart', this._touchstartHandler); + root.addEventListener('touchmove', this._touchmoveHandler); + root.addEventListener('touchend', this._touchendHandler); + } else { + root.addEventListener('click', this._clickHandler); + root.addEventListener('dblclick', this._dblclickHandler); + root.addEventListener('mousewheel', this._mousewheelHandler); + root.addEventListener('mousemove', this._mousemoveHandler); + root.addEventListener('mousedown', this._mousedownHandler); + root.addEventListener('mouseup', this._mouseupHandler); + } + root.addEventListener('DOMMouseScroll', this._mousewheelHandler); + root.addEventListener('mouseout', this._mouseoutHandler); + } else { + window.attachEvent('onresize', this._resizeHandler); + root.attachEvent('onclick', this._clickHandler); + root.ondblclick = this._dblclickHandler; + root.attachEvent('onmousewheel', this._mousewheelHandler); + root.attachEvent('onmousemove', this._mousemoveHandler); + root.attachEvent('onmouseout', this._mouseoutHandler); + root.attachEvent('onmousedown', this._mousedownHandler); + root.attachEvent('onmouseup', this._mouseupHandler); + } + }; + Handler.prototype.on = function (eventName, handler, context) { + this.bind(eventName, handler, context); + return this; + }; + Handler.prototype.un = function (eventName, handler) { + this.unbind(eventName, handler); + return this; + }; + Handler.prototype.trigger = function (eventName, eventArgs) { + switch (eventName) { + case EVENT.RESIZE: + case EVENT.CLICK: + case EVENT.DBLCLICK: + case EVENT.MOUSEWHEEL: + case EVENT.MOUSEMOVE: + case EVENT.MOUSEDOWN: + case EVENT.MOUSEUP: + case EVENT.MOUSEOUT: + this['_' + eventName + 'Handler'](eventArgs); + break; + } + }; + Handler.prototype.dispose = function () { + var root = this.root; + if (window.removeEventListener) { + window.removeEventListener('resize', this._resizeHandler); + if (env.os.tablet || env.os.phone) { + root.removeEventListener('touchstart', this._touchstartHandler); + root.removeEventListener('touchmove', this._touchmoveHandler); + root.removeEventListener('touchend', this._touchendHandler); + } else { + root.removeEventListener('click', this._clickHandler); + root.removeEventListener('dblclick', this._dblclickHandler); + root.removeEventListener('mousewheel', this._mousewheelHandler); + root.removeEventListener('mousemove', this._mousemoveHandler); + root.removeEventListener('mousedown', this._mousedownHandler); + root.removeEventListener('mouseup', this._mouseupHandler); + } + root.removeEventListener('DOMMouseScroll', this._mousewheelHandler); + root.removeEventListener('mouseout', this._mouseoutHandler); + } else { + window.detachEvent('onresize', this._resizeHandler); + root.detachEvent('onclick', this._clickHandler); + root.detachEvent('dblclick', this._dblclickHandler); + root.detachEvent('onmousewheel', this._mousewheelHandler); + root.detachEvent('onmousemove', this._mousemoveHandler); + root.detachEvent('onmouseout', this._mouseoutHandler); + root.detachEvent('onmousedown', this._mousedownHandler); + root.detachEvent('onmouseup', this._mouseupHandler); + } + this.root = this._domHover = this.storage = this.painter = null; + this.un(); + }; + Handler.prototype._processDragStart = function (event) { + var _lastHover = this._lastHover; + if (this._isMouseDown && _lastHover && _lastHover.draggable && !this._draggingTarget && this._mouseDownTarget == _lastHover) { + if (_lastHover.dragEnableTime && new Date() - this._lastMouseDownMoment < _lastHover.dragEnableTime) { + return; + } + var _draggingTarget = _lastHover; + this._draggingTarget = _draggingTarget; + this._isDragging = 1; + _draggingTarget.invisible = true; + this.storage.mod(_draggingTarget.id); + this._dispatchAgency(_draggingTarget, EVENT.DRAGSTART, event); + this.painter.refresh(); + } + }; + Handler.prototype._processDragEnter = function (event) { + if (this._draggingTarget) { + this._dispatchAgency(this._lastHover, EVENT.DRAGENTER, event, this._draggingTarget); + } + }; + Handler.prototype._processDragOver = function (event) { + if (this._draggingTarget) { + this._dispatchAgency(this._lastHover, EVENT.DRAGOVER, event, this._draggingTarget); + } + }; + Handler.prototype._processDragLeave = function (event) { + if (this._draggingTarget) { + this._dispatchAgency(this._lastHover, EVENT.DRAGLEAVE, event, this._draggingTarget); + } + }; + Handler.prototype._processDrop = function (event) { + if (this._draggingTarget) { + this._draggingTarget.invisible = false; + this.storage.mod(this._draggingTarget.id); + this.painter.refresh(); + this._dispatchAgency(this._lastHover, EVENT.DROP, event, this._draggingTarget); + } + }; + Handler.prototype._processDragEnd = function (event) { + if (this._draggingTarget) { + this._dispatchAgency(this._draggingTarget, EVENT.DRAGEND, event); + this._lastHover = null; + } + this._isDragging = 0; + this._draggingTarget = null; + }; + Handler.prototype._processOverShape = function (event) { + this._dispatchAgency(this._lastHover, EVENT.MOUSEOVER, event); + }; + Handler.prototype._processOutShape = function (event) { + this._dispatchAgency(this._lastHover, EVENT.MOUSEOUT, event); + }; + Handler.prototype._dispatchAgency = function (targetShape, eventName, event, draggedShape) { + var eventHandler = 'on' + eventName; + var eventPacket = { + type: eventName, + event: event, + target: targetShape, + cancelBubble: false + }; + var el = targetShape; + if (draggedShape) { + eventPacket.dragged = draggedShape; + } + while (el) { + el[eventHandler] && (eventPacket.cancelBubble = el[eventHandler](eventPacket)); + el.dispatch(eventName, eventPacket); + el = el.parent; + if (eventPacket.cancelBubble) { + break; + } + } + if (targetShape) { + if (!eventPacket.cancelBubble) { + this.dispatch(eventName, eventPacket); + } + } else if (!draggedShape) { + var eveObj = { + type: eventName, + event: event + }; + this.dispatch(eventName, eveObj); + this.painter.eachOtherLayer(function (layer) { + if (typeof layer[eventHandler] == 'function') { + layer[eventHandler](eveObj); + } + if (layer.dispatch) { + layer.dispatch(eventName, eveObj); + } + }); + } + }; + Handler.prototype._iterateAndFindHover = function () { + var invTransform = mat2d.create(); + return function () { + var list = this.storage.getShapeList(); + var currentZLevel; + var currentLayer; + var tmp = [ + 0, + 0 + ]; + for (var i = list.length - 1; i >= 0; i--) { + var shape = list[i]; + if (currentZLevel !== shape.zlevel) { + currentLayer = this.painter.getLayer(shape.zlevel, currentLayer); + tmp[0] = this._mouseX; + tmp[1] = this._mouseY; + if (currentLayer.needTransform) { + mat2d.invert(invTransform, currentLayer.transform); + vec2.applyTransform(tmp, tmp, invTransform); + } + } + if (this._findHover(shape, tmp[0], tmp[1])) { + break; + } + } + }; + }(); + var MOBILE_TOUCH_OFFSETS = [ + { x: 10 }, + { x: -20 }, + { + x: 10, + y: 10 + }, + { y: -20 } + ]; + Handler.prototype._mobileFindFixed = function (event) { + this._lastHover = null; + this._mouseX = event.zrenderX; + this._mouseY = event.zrenderY; + this._event = event; + this._iterateAndFindHover(); + for (var i = 0; !this._lastHover && i < MOBILE_TOUCH_OFFSETS.length; i++) { + var offset = MOBILE_TOUCH_OFFSETS[i]; + offset.x && (this._mouseX += offset.x); + offset.y && (this._mouseY += offset.y); + this._iterateAndFindHover(); + } + if (this._lastHover) { + event.zrenderX = this._mouseX; + event.zrenderY = this._mouseY; + } + }; + function findHover(shape, x, y) { + if (this._draggingTarget && this._draggingTarget.id == shape.id || shape.isSilent()) { + return false; + } + var event = this._event; + if (shape.isCover(x, y)) { + if (shape.hoverable) { + this.storage.addHover(shape); + } + var p = shape.parent; + while (p) { + if (p.clipShape && !p.clipShape.isCover(this._mouseX, this._mouseY)) { + return false; + } + p = p.parent; + } + if (this._lastHover != shape) { + this._processOutShape(event); + this._processDragLeave(event); + this._lastHover = shape; + this._processDragEnter(event); + } + this._processOverShape(event); + this._processDragOver(event); + this._hasfound = 1; + return true; + } + return false; + } + Handler.prototype._zrenderEventFixed = function (event, isTouch) { + if (event.zrenderFixed) { + return event; + } + if (!isTouch) { + event = event || window.event; + var target = event.toElement || event.relatedTarget || event.srcElement || event.target; + if (target && target != this._domHover) { + event.zrenderX = (typeof event.offsetX != 'undefined' ? event.offsetX : event.layerX) + target.offsetLeft; + event.zrenderY = (typeof event.offsetY != 'undefined' ? event.offsetY : event.layerY) + target.offsetTop; + } + } else { + var touch = event.type != 'touchend' ? event.targetTouches[0] : event.changedTouches[0]; + if (touch) { + var rBounding = this.painter._domRoot.getBoundingClientRect(); + event.zrenderX = touch.clientX - rBounding.left; + event.zrenderY = touch.clientY - rBounding.top; + } + } + event.zrenderFixed = 1; + return event; + }; + util.merge(Handler.prototype, Eventful.prototype, true); + return Handler; +});define('zrender/Painter', [ + 'require', + './config', + './tool/util', + './tool/log', + './loadingEffect/Base', + './Layer', + './shape/Image' +], function (require) { + 'use strict'; + var config = require('./config'); + var util = require('./tool/util'); + var log = require('./tool/log'); + var BaseLoadingEffect = require('./loadingEffect/Base'); + var Layer = require('./Layer'); + function returnFalse() { + return false; + } + function doNothing() { + } + function isLayerValid(layer) { + if (!layer) { + return false; + } + if (layer.isBuildin) { + return true; + } + if (typeof layer.resize !== 'function' || typeof layer.refresh !== 'function') { + return false; + } + return true; + } + var Painter = function (root, storage) { + this.root = root; + root.style['-webkit-tap-highlight-color'] = 'transparent'; + root.style['-webkit-user-select'] = 'none'; + root.style['user-select'] = 'none'; + root.style['-webkit-touch-callout'] = 'none'; + this.storage = storage; + root.innerHTML = ''; + this._width = this._getWidth(); + this._height = this._getHeight(); + var domRoot = document.createElement('div'); + this._domRoot = domRoot; + domRoot.style.position = 'relative'; + domRoot.style.overflow = 'hidden'; + domRoot.style.width = this._width + 'px'; + domRoot.style.height = this._height + 'px'; + root.appendChild(domRoot); + this._layers = {}; + this._zlevelList = []; + this._layerConfig = {}; + this._loadingEffect = new BaseLoadingEffect({}); + this.shapeToImage = this._createShapeToImageProcessor(); + this._bgDom = document.createElement('div'); + this._bgDom.style.cssText = [ + 'position:absolute;left:0px;top:0px;width:', + this._width, + 'px;height:', + this._height + 'px;', + '-webkit-user-select:none;user-select;none;', + '-webkit-touch-callout:none;' + ].join(''); + this._bgDom.setAttribute('data-zr-dom-id', 'bg'); + domRoot.appendChild(this._bgDom); + this._bgDom.onselectstart = returnFalse; + var hoverLayer = new Layer('_zrender_hover_', this); + this._layers['hover'] = hoverLayer; + domRoot.appendChild(hoverLayer.dom); + hoverLayer.initContext(); + hoverLayer.dom.onselectstart = returnFalse; + hoverLayer.dom.style['-webkit-user-select'] = 'none'; + hoverLayer.dom.style['user-select'] = 'none'; + hoverLayer.dom.style['-webkit-touch-callout'] = 'none'; + this.refreshNextFrame = null; + }; + Painter.prototype.render = function (callback) { + if (this.isLoading()) { + this.hideLoading(); + } + this.refresh(callback, true); + return this; + }; + Painter.prototype.refresh = function (callback, paintAll) { + var list = this.storage.getShapeList(true); + this._paintList(list, paintAll); + for (var i = 0; i < this._zlevelList.length; i++) { + var z = this._zlevelList[i]; + var layer = this._layers[z]; + if (!layer.isBuildin && layer.refresh) { + layer.refresh(); + } + } + if (typeof callback == 'function') { + callback(); + } + return this; + }; + Painter.prototype._preProcessLayer = function (layer) { + layer.unusedCount++; + layer.updateTransform(); + }; + Painter.prototype._postProcessLayer = function (layer) { + layer.dirty = false; + if (layer.unusedCount == 1) { + layer.clear(); + } + }; + Painter.prototype._paintList = function (list, paintAll) { + if (typeof paintAll == 'undefined') { + paintAll = false; + } + this._updateLayerStatus(list); + var currentLayer; + var currentZLevel; + var ctx; + this.eachBuildinLayer(this._preProcessLayer); + for (var i = 0, l = list.length; i < l; i++) { + var shape = list[i]; + if (currentZLevel !== shape.zlevel) { + if (currentLayer) { + if (currentLayer.needTransform) { + ctx.restore(); + } + ctx.flush && ctx.flush(); + } + currentZLevel = shape.zlevel; + currentLayer = this.getLayer(currentZLevel); + if (!currentLayer.isBuildin) { + log('ZLevel ' + currentZLevel + ' has been used by unkown layer ' + currentLayer.id); + } + ctx = currentLayer.ctx; + currentLayer.unusedCount = 0; + if (currentLayer.dirty || paintAll) { + currentLayer.clear(); + } + if (currentLayer.needTransform) { + ctx.save(); + currentLayer.setTransform(ctx); + } + } + if ((currentLayer.dirty || paintAll) && !shape.invisible) { + if (!shape.onbrush || shape.onbrush && !shape.onbrush(ctx, false)) { + if (config.catchBrushException) { + try { + shape.brush(ctx, false, this.refreshNextFrame); + } catch (error) { + log(error, 'brush error of ' + shape.type, shape); + } + } else { + shape.brush(ctx, false, this.refreshNextFrame); + } + } + } + shape.__dirty = false; + } + if (currentLayer) { + if (currentLayer.needTransform) { + ctx.restore(); + } + ctx.flush && ctx.flush(); + } + this.eachBuildinLayer(this._postProcessLayer); + }; + Painter.prototype.getLayer = function (zlevel) { + var layer = this._layers[zlevel]; + if (!layer) { + layer = new Layer(zlevel, this); + layer.isBuildin = true; + if (this._layerConfig[zlevel]) { + util.merge(layer, this._layerConfig[zlevel], true); + } + layer.updateTransform(); + this.insertLayer(zlevel, layer); + layer.initContext(); + } + return layer; + }; + Painter.prototype.insertLayer = function (zlevel, layer) { + if (this._layers[zlevel]) { + log('ZLevel ' + zlevel + ' has been used already'); + return; + } + if (!isLayerValid(layer)) { + log('Layer of zlevel ' + zlevel + ' is not valid'); + return; + } + var len = this._zlevelList.length; + var prevLayer = null; + var i = -1; + if (len > 0 && zlevel > this._zlevelList[0]) { + for (i = 0; i < len - 1; i++) { + if (this._zlevelList[i] < zlevel && this._zlevelList[i + 1] > zlevel) { + break; + } + } + prevLayer = this._layers[this._zlevelList[i]]; + } + this._zlevelList.splice(i + 1, 0, zlevel); + var prevDom = prevLayer ? prevLayer.dom : this._bgDom; + if (prevDom.nextSibling) { + prevDom.parentNode.insertBefore(layer.dom, prevDom.nextSibling); + } else { + prevDom.parentNode.appendChild(layer.dom); + } + this._layers[zlevel] = layer; + }; + Painter.prototype.eachLayer = function (cb, context) { + for (var i = 0; i < this._zlevelList.length; i++) { + var z = this._zlevelList[i]; + cb.call(context, this._layers[z], z); + } + }; + Painter.prototype.eachBuildinLayer = function (cb, context) { + for (var i = 0; i < this._zlevelList.length; i++) { + var z = this._zlevelList[i]; + var layer = this._layers[z]; + if (layer.isBuildin) { + cb.call(context, layer, z); + } + } + }; + Painter.prototype.eachOtherLayer = function (cb, context) { + for (var i = 0; i < this._zlevelList.length; i++) { + var z = this._zlevelList[i]; + var layer = this._layers[z]; + if (!layer.isBuildin) { + cb.call(context, layer, z); + } + } + }; + Painter.prototype.getLayers = function () { + return this._layers; + }; + Painter.prototype._updateLayerStatus = function (list) { + var layers = this._layers; + var elCounts = {}; + this.eachBuildinLayer(function (layer, z) { + elCounts[z] = layer.elCount; + layer.elCount = 0; + }); + for (var i = 0, l = list.length; i < l; i++) { + var shape = list[i]; + var zlevel = shape.zlevel; + var layer = layers[zlevel]; + if (layer) { + layer.elCount++; + if (layer.dirty) { + continue; + } + layer.dirty = shape.__dirty; + } + } + this.eachBuildinLayer(function (layer, z) { + if (elCounts[z] !== layer.elCount) { + layer.dirty = true; + } + }); + }; + Painter.prototype.refreshShapes = function (shapeList, callback) { + for (var i = 0, l = shapeList.length; i < l; i++) { + var shape = shapeList[i]; + shape.modSelf(); + } + this.refresh(callback); + return this; + }; + Painter.prototype.setLoadingEffect = function (loadingEffect) { + this._loadingEffect = loadingEffect; + return this; + }; + Painter.prototype.clear = function () { + this.eachBuildinLayer(this._clearLayer); + return this; + }; + Painter.prototype._clearLayer = function (layer) { + layer.clear(); + }; + Painter.prototype.modLayer = function (zlevel, config) { + if (config) { + if (!this._layerConfig[zlevel]) { + this._layerConfig[zlevel] = config; + } else { + util.merge(this._layerConfig[zlevel], config, true); + } + var layer = this._layers[zlevel]; + if (layer) { + util.merge(layer, this._layerConfig[zlevel], true); + } + } + }; + Painter.prototype.delLayer = function (zlevel) { + var layer = this._layers[zlevel]; + if (!layer) { + return; + } + this.modLayer(zlevel, { + position: layer.position, + rotation: layer.rotation, + scale: layer.scale + }); + layer.dom.parentNode.removeChild(layer.dom); + delete this._layers[zlevel]; + this._zlevelList.splice(util.indexOf(this._zlevelList, zlevel), 1); + }; + Painter.prototype.refreshHover = function () { + this.clearHover(); + var list = this.storage.getHoverShapes(true); + for (var i = 0, l = list.length; i < l; i++) { + this._brushHover(list[i]); + } + var ctx = this._layers.hover.ctx; + ctx.flush && ctx.flush(); + this.storage.delHover(); + return this; + }; + Painter.prototype.clearHover = function () { + var hover = this._layers.hover; + hover && hover.clear(); + return this; + }; + Painter.prototype.showLoading = function (loadingEffect) { + this._loadingEffect && this._loadingEffect.stop(); + loadingEffect && this.setLoadingEffect(loadingEffect); + this._loadingEffect.start(this); + this.loading = true; + return this; + }; + Painter.prototype.hideLoading = function () { + this._loadingEffect.stop(); + this.clearHover(); + this.loading = false; + return this; + }; + Painter.prototype.isLoading = function () { + return this.loading; + }; + Painter.prototype.resize = function () { + var domRoot = this._domRoot; + domRoot.style.display = 'none'; + var width = this._getWidth(); + var height = this._getHeight(); + domRoot.style.display = ''; + if (this._width != width || height != this._height) { + this._width = width; + this._height = height; + domRoot.style.width = width + 'px'; + domRoot.style.height = height + 'px'; + for (var id in this._layers) { + this._layers[id].resize(width, height); + } + this.refresh(null, true); + } + return this; + }; + Painter.prototype.clearLayer = function (zLevel) { + var layer = this._layers[zLevel]; + if (layer) { + layer.clear(); + } + }; + Painter.prototype.dispose = function () { + if (this.isLoading()) { + this.hideLoading(); + } + this.root.innerHTML = ''; + this.root = this.storage = this._domRoot = this._layers = null; + }; + Painter.prototype.getDomHover = function () { + return this._layers.hover.dom; + }; + Painter.prototype.toDataURL = function (type, backgroundColor, args) { + if (window['G_vmlCanvasManager']) { + return null; + } + var imageLayer = new Layer('image', this); + this._bgDom.appendChild(imageLayer.dom); + imageLayer.initContext(); + var ctx = imageLayer.ctx; + imageLayer.clearColor = backgroundColor || '#fff'; + imageLayer.clear(); + var self = this; + this.storage.iterShape(function (shape) { + if (!shape.invisible) { + if (!shape.onbrush || shape.onbrush && !shape.onbrush(ctx, false)) { + if (config.catchBrushException) { + try { + shape.brush(ctx, false, self.refreshNextFrame); + } catch (error) { + log(error, 'brush error of ' + shape.type, shape); + } + } else { + shape.brush(ctx, false, self.refreshNextFrame); + } + } + } + }, { + normal: 'up', + update: true + }); + var image = imageLayer.dom.toDataURL(type, args); + ctx = null; + this._bgDom.removeChild(imageLayer.dom); + return image; + }; + Painter.prototype.getWidth = function () { + return this._width; + }; + Painter.prototype.getHeight = function () { + return this._height; + }; + Painter.prototype._getWidth = function () { + var root = this.root; + var stl = root.currentStyle || document.defaultView.getComputedStyle(root); + return ((root.clientWidth || parseInt(stl.width, 10)) - parseInt(stl.paddingLeft, 10) - parseInt(stl.paddingRight, 10)).toFixed(0) - 0; + }; + Painter.prototype._getHeight = function () { + var root = this.root; + var stl = root.currentStyle || document.defaultView.getComputedStyle(root); + return ((root.clientHeight || parseInt(stl.height, 10)) - parseInt(stl.paddingTop, 10) - parseInt(stl.paddingBottom, 10)).toFixed(0) - 0; + }; + Painter.prototype._brushHover = function (shape) { + var ctx = this._layers.hover.ctx; + if (!shape.onbrush || shape.onbrush && !shape.onbrush(ctx, true)) { + var layer = this.getLayer(shape.zlevel); + if (layer.needTransform) { + ctx.save(); + layer.setTransform(ctx); + } + if (config.catchBrushException) { + try { + shape.brush(ctx, true, this.refreshNextFrame); + } catch (error) { + log(error, 'hoverBrush error of ' + shape.type, shape); + } + } else { + shape.brush(ctx, true, this.refreshNextFrame); + } + if (layer.needTransform) { + ctx.restore(); + } + } + }; + Painter.prototype._shapeToImage = function (id, shape, width, height, devicePixelRatio) { + var canvas = document.createElement('canvas'); + var ctx = canvas.getContext('2d'); + canvas.style.width = width + 'px'; + canvas.style.height = height + 'px'; + canvas.setAttribute('width', width * devicePixelRatio); + canvas.setAttribute('height', height * devicePixelRatio); + ctx.clearRect(0, 0, width * devicePixelRatio, height * devicePixelRatio); + var shapeTransform = { + position: shape.position, + rotation: shape.rotation, + scale: shape.scale + }; + shape.position = [ + 0, + 0, + 0 + ]; + shape.rotation = 0; + shape.scale = [ + 1, + 1 + ]; + if (shape) { + shape.brush(ctx, false); + } + var ImageShape = require('./shape/Image'); + var imgShape = new ImageShape({ + id: id, + style: { + x: 0, + y: 0, + image: canvas + } + }); + if (shapeTransform.position != null) { + imgShape.position = shape.position = shapeTransform.position; + } + if (shapeTransform.rotation != null) { + imgShape.rotation = shape.rotation = shapeTransform.rotation; + } + if (shapeTransform.scale != null) { + imgShape.scale = shape.scale = shapeTransform.scale; + } + return imgShape; + }; + Painter.prototype._createShapeToImageProcessor = function () { + if (window['G_vmlCanvasManager']) { + return doNothing; + } + var me = this; + return function (id, e, width, height) { + return me._shapeToImage(id, e, width, height, config.devicePixelRatio); + }; + }; + return Painter; +});define('zrender/Storage', [ + 'require', + './tool/util', + './Group' +], function (require) { + 'use strict'; + var util = require('./tool/util'); + var Group = require('./Group'); + var defaultIterateOption = { + hover: false, + normal: 'down', + update: false + }; + function shapeCompareFunc(a, b) { + if (a.zlevel == b.zlevel) { + if (a.z == b.z) { + return a.__renderidx - b.__renderidx; + } + return a.z - b.z; + } + return a.zlevel - b.zlevel; + } + var Storage = function () { + this._elements = {}; + this._hoverElements = []; + this._roots = []; + this._shapeList = []; + this._shapeListOffset = 0; + }; + Storage.prototype.iterShape = function (fun, option) { + if (!option) { + option = defaultIterateOption; + } + if (option.hover) { + for (var i = 0, l = this._hoverElements.length; i < l; i++) { + var el = this._hoverElements[i]; + el.updateTransform(); + if (fun(el)) { + return this; + } + } + } + if (option.update) { + this.updateShapeList(); + } + switch (option.normal) { + case 'down': + var l = this._shapeList.length; + while (l--) { + if (fun(this._shapeList[l])) { + return this; + } + } + break; + default: + for (var i = 0, l = this._shapeList.length; i < l; i++) { + if (fun(this._shapeList[i])) { + return this; + } + } + break; + } + return this; + }; + Storage.prototype.getHoverShapes = function (update) { + var hoverElements = []; + for (var i = 0, l = this._hoverElements.length; i < l; i++) { + hoverElements.push(this._hoverElements[i]); + var target = this._hoverElements[i].hoverConnect; + if (target) { + var shape; + target = target instanceof Array ? target : [target]; + for (var j = 0, k = target.length; j < k; j++) { + shape = target[j].id ? target[j] : this.get(target[j]); + if (shape) { + hoverElements.push(shape); + } + } + } + } + hoverElements.sort(shapeCompareFunc); + if (update) { + for (var i = 0, l = hoverElements.length; i < l; i++) { + hoverElements[i].updateTransform(); + } + } + return hoverElements; + }; + Storage.prototype.getShapeList = function (update) { + if (update) { + this.updateShapeList(); + } + return this._shapeList; + }; + Storage.prototype.updateShapeList = function () { + this._shapeListOffset = 0; + for (var i = 0, len = this._roots.length; i < len; i++) { + var root = this._roots[i]; + this._updateAndAddShape(root); + } + this._shapeList.length = this._shapeListOffset; + for (var i = 0, len = this._shapeList.length; i < len; i++) { + this._shapeList[i].__renderidx = i; + } + this._shapeList.sort(shapeCompareFunc); + }; + Storage.prototype._updateAndAddShape = function (el, clipShapes) { + if (el.ignore) { + return; + } + el.updateTransform(); + if (el.type == 'group') { + if (el.clipShape) { + el.clipShape.parent = el; + el.clipShape.updateTransform(); + if (clipShapes) { + clipShapes = clipShapes.slice(); + clipShapes.push(el.clipShape); + } else { + clipShapes = [el.clipShape]; + } + } + for (var i = 0; i < el._children.length; i++) { + var child = el._children[i]; + child.__dirty = el.__dirty || child.__dirty; + this._updateAndAddShape(child, clipShapes); + } + el.__dirty = false; + } else { + el.__clipShapes = clipShapes; + this._shapeList[this._shapeListOffset++] = el; + } + }; + Storage.prototype.mod = function (elId, params) { + var el = this._elements[elId]; + if (el) { + el.modSelf(); + if (params) { + if (params.parent || params._storage || params.__clipShapes) { + var target = {}; + for (var name in params) { + if (name === 'parent' || name === '_storage' || name === '__clipShapes') { + continue; + } + if (params.hasOwnProperty(name)) { + target[name] = params[name]; + } + } + util.merge(el, target, true); + } else { + util.merge(el, params, true); + } + } + } + return this; + }; + Storage.prototype.drift = function (shapeId, dx, dy) { + var shape = this._elements[shapeId]; + if (shape) { + shape.needTransform = true; + if (shape.draggable === 'horizontal') { + dy = 0; + } else if (shape.draggable === 'vertical') { + dx = 0; + } + if (!shape.ondrift || shape.ondrift && !shape.ondrift(dx, dy)) { + shape.drift(dx, dy); + } + } + return this; + }; + Storage.prototype.addHover = function (shape) { + shape.updateNeedTransform(); + this._hoverElements.push(shape); + return this; + }; + Storage.prototype.delHover = function () { + this._hoverElements = []; + return this; + }; + Storage.prototype.hasHoverShape = function () { + return this._hoverElements.length > 0; + }; + Storage.prototype.addRoot = function (el) { + if (el instanceof Group) { + el.addChildrenToStorage(this); + } + this.addToMap(el); + this._roots.push(el); + }; + Storage.prototype.delRoot = function (elId) { + if (typeof elId == 'undefined') { + for (var i = 0; i < this._roots.length; i++) { + var root = this._roots[i]; + if (root instanceof Group) { + root.delChildrenFromStorage(this); + } + } + this._elements = {}; + this._hoverElements = []; + this._roots = []; + this._shapeList = []; + this._shapeListOffset = 0; + return; + } + if (elId instanceof Array) { + for (var i = 0, l = elId.length; i < l; i++) { + this.delRoot(elId[i]); + } + return; + } + var el; + if (typeof elId == 'string') { + el = this._elements[elId]; + } else { + el = elId; + } + var idx = util.indexOf(this._roots, el); + if (idx >= 0) { + this.delFromMap(el.id); + this._roots.splice(idx, 1); + if (el instanceof Group) { + el.delChildrenFromStorage(this); + } + } + }; + Storage.prototype.addToMap = function (el) { + if (el instanceof Group) { + el._storage = this; + } + el.modSelf(); + this._elements[el.id] = el; + return this; + }; + Storage.prototype.get = function (elId) { + return this._elements[elId]; + }; + Storage.prototype.delFromMap = function (elId) { + var el = this._elements[elId]; + if (el) { + delete this._elements[elId]; + if (el instanceof Group) { + el._storage = null; + } + } + return this; + }; + Storage.prototype.dispose = function () { + this._elements = this._renderList = this._roots = this._hoverElements = null; + }; + return Storage; +});define('zrender/animation/Animation', [ + 'require', + './Clip', + '../tool/color', + '../tool/util', + '../tool/event' +], function (require) { + 'use strict'; + var Clip = require('./Clip'); + var color = require('../tool/color'); + var util = require('../tool/util'); + var Dispatcher = require('../tool/event').Dispatcher; + var requestAnimationFrame = window.requestAnimationFrame || window.msRequestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || function (func) { + setTimeout(func, 16); + }; + var arraySlice = Array.prototype.slice; + var Animation = function (options) { + options = options || {}; + this.stage = options.stage || {}; + this.onframe = options.onframe || function () { + }; + this._clips = []; + this._running = false; + this._time = 0; + Dispatcher.call(this); + }; + Animation.prototype = { + add: function (clip) { + this._clips.push(clip); + }, + remove: function (clip) { + var idx = util.indexOf(this._clips, clip); + if (idx >= 0) { + this._clips.splice(idx, 1); + } + }, + _update: function () { + var time = new Date().getTime(); + var delta = time - this._time; + var clips = this._clips; + var len = clips.length; + var deferredEvents = []; + var deferredClips = []; + for (var i = 0; i < len; i++) { + var clip = clips[i]; + var e = clip.step(time); + if (e) { + deferredEvents.push(e); + deferredClips.push(clip); + } + } + for (var i = 0; i < len;) { + if (clips[i]._needsRemove) { + clips[i] = clips[len - 1]; + clips.pop(); + len--; + } else { + i++; + } + } + len = deferredEvents.length; + for (var i = 0; i < len; i++) { + deferredClips[i].fire(deferredEvents[i]); + } + this._time = time; + this.onframe(delta); + this.dispatch('frame', delta); + if (this.stage.update) { + this.stage.update(); + } + }, + start: function () { + var self = this; + this._running = true; + function step() { + if (self._running) { + self._update(); + requestAnimationFrame(step); + } + } + this._time = new Date().getTime(); + requestAnimationFrame(step); + }, + stop: function () { + this._running = false; + }, + clear: function () { + this._clips = []; + }, + animate: function (target, options) { + options = options || {}; + var deferred = new Animator(target, options.loop, options.getter, options.setter); + deferred.animation = this; + return deferred; + }, + constructor: Animation + }; + util.merge(Animation.prototype, Dispatcher.prototype, true); + function _defaultGetter(target, key) { + return target[key]; + } + function _defaultSetter(target, key, value) { + target[key] = value; + } + function _interpolateNumber(p0, p1, percent) { + return (p1 - p0) * percent + p0; + } + function _interpolateArray(p0, p1, percent, out, arrDim) { + var len = p0.length; + if (arrDim == 1) { + for (var i = 0; i < len; i++) { + out[i] = _interpolateNumber(p0[i], p1[i], percent); + } + } else { + var len2 = p0[0].length; + for (var i = 0; i < len; i++) { + for (var j = 0; j < len2; j++) { + out[i][j] = _interpolateNumber(p0[i][j], p1[i][j], percent); + } + } + } + } + function _isArrayLike(data) { + switch (typeof data) { + case 'undefined': + case 'string': + return false; + } + return typeof data.length !== 'undefined'; + } + function _catmullRomInterpolateArray(p0, p1, p2, p3, t, t2, t3, out, arrDim) { + var len = p0.length; + if (arrDim == 1) { + for (var i = 0; i < len; i++) { + out[i] = _catmullRomInterpolate(p0[i], p1[i], p2[i], p3[i], t, t2, t3); + } + } else { + var len2 = p0[0].length; + for (var i = 0; i < len; i++) { + for (var j = 0; j < len2; j++) { + out[i][j] = _catmullRomInterpolate(p0[i][j], p1[i][j], p2[i][j], p3[i][j], t, t2, t3); + } + } + } + } + function _catmullRomInterpolate(p0, p1, p2, p3, t, t2, t3) { + var v0 = (p2 - p0) * 0.5; + var v1 = (p3 - p1) * 0.5; + return (2 * (p1 - p2) + v0 + v1) * t3 + (-3 * (p1 - p2) - 2 * v0 - v1) * t2 + v0 * t + p1; + } + function _cloneValue(value) { + if (_isArrayLike(value)) { + var len = value.length; + if (_isArrayLike(value[0])) { + var ret = []; + for (var i = 0; i < len; i++) { + ret.push(arraySlice.call(value[i])); + } + return ret; + } else { + return arraySlice.call(value); + } + } else { + return value; + } + } + function rgba2String(rgba) { + rgba[0] = Math.floor(rgba[0]); + rgba[1] = Math.floor(rgba[1]); + rgba[2] = Math.floor(rgba[2]); + return 'rgba(' + rgba.join(',') + ')'; + } + var Animator = function (target, loop, getter, setter) { + this._tracks = {}; + this._target = target; + this._loop = loop || false; + this._getter = getter || _defaultGetter; + this._setter = setter || _defaultSetter; + this._clipCount = 0; + this._delay = 0; + this._doneList = []; + this._onframeList = []; + this._clipList = []; + }; + Animator.prototype = { + when: function (time, props) { + for (var propName in props) { + if (!this._tracks[propName]) { + this._tracks[propName] = []; + if (time !== 0) { + this._tracks[propName].push({ + time: 0, + value: _cloneValue(this._getter(this._target, propName)) + }); + } + } + this._tracks[propName].push({ + time: parseInt(time, 10), + value: props[propName] + }); + } + return this; + }, + during: function (callback) { + this._onframeList.push(callback); + return this; + }, + start: function (easing) { + var self = this; + var setter = this._setter; + var getter = this._getter; + var useSpline = easing === 'spline'; + var ondestroy = function () { + self._clipCount--; + if (self._clipCount === 0) { + self._tracks = {}; + var len = self._doneList.length; + for (var i = 0; i < len; i++) { + self._doneList[i].call(self); + } + } + }; + var createTrackClip = function (keyframes, propName) { + var trackLen = keyframes.length; + if (!trackLen) { + return; + } + var firstVal = keyframes[0].value; + var isValueArray = _isArrayLike(firstVal); + var isValueColor = false; + var arrDim = isValueArray && _isArrayLike(firstVal[0]) ? 2 : 1; + keyframes.sort(function (a, b) { + return a.time - b.time; + }); + var trackMaxTime; + if (trackLen) { + trackMaxTime = keyframes[trackLen - 1].time; + } else { + return; + } + var kfPercents = []; + var kfValues = []; + for (var i = 0; i < trackLen; i++) { + kfPercents.push(keyframes[i].time / trackMaxTime); + var value = keyframes[i].value; + if (typeof value == 'string') { + value = color.toArray(value); + if (value.length === 0) { + value[0] = value[1] = value[2] = 0; + value[3] = 1; + } + isValueColor = true; + } + kfValues.push(value); + } + var cacheKey = 0; + var cachePercent = 0; + var start; + var i; + var w; + var p0; + var p1; + var p2; + var p3; + if (isValueColor) { + var rgba = [ + 0, + 0, + 0, + 0 + ]; + } + var onframe = function (target, percent) { + if (percent < cachePercent) { + start = Math.min(cacheKey + 1, trackLen - 1); + for (i = start; i >= 0; i--) { + if (kfPercents[i] <= percent) { + break; + } + } + i = Math.min(i, trackLen - 2); + } else { + for (i = cacheKey; i < trackLen; i++) { + if (kfPercents[i] > percent) { + break; + } + } + i = Math.min(i - 1, trackLen - 2); + } + cacheKey = i; + cachePercent = percent; + var range = kfPercents[i + 1] - kfPercents[i]; + if (range === 0) { + return; + } else { + w = (percent - kfPercents[i]) / range; + } + if (useSpline) { + p1 = kfValues[i]; + p0 = kfValues[i === 0 ? i : i - 1]; + p2 = kfValues[i > trackLen - 2 ? trackLen - 1 : i + 1]; + p3 = kfValues[i > trackLen - 3 ? trackLen - 1 : i + 2]; + if (isValueArray) { + _catmullRomInterpolateArray(p0, p1, p2, p3, w, w * w, w * w * w, getter(target, propName), arrDim); + } else { + var value; + if (isValueColor) { + value = _catmullRomInterpolateArray(p0, p1, p2, p3, w, w * w, w * w * w, rgba, 1); + value = rgba2String(rgba); + } else { + value = _catmullRomInterpolate(p0, p1, p2, p3, w, w * w, w * w * w); + } + setter(target, propName, value); + } + } else { + if (isValueArray) { + _interpolateArray(kfValues[i], kfValues[i + 1], w, getter(target, propName), arrDim); + } else { + var value; + if (isValueColor) { + _interpolateArray(kfValues[i], kfValues[i + 1], w, rgba, 1); + value = rgba2String(rgba); + } else { + value = _interpolateNumber(kfValues[i], kfValues[i + 1], w); + } + setter(target, propName, value); + } + } + for (i = 0; i < self._onframeList.length; i++) { + self._onframeList[i](target, percent); + } + }; + var clip = new Clip({ + target: self._target, + life: trackMaxTime, + loop: self._loop, + delay: self._delay, + onframe: onframe, + ondestroy: ondestroy + }); + if (easing && easing !== 'spline') { + clip.easing = easing; + } + self._clipList.push(clip); + self._clipCount++; + self.animation.add(clip); + }; + for (var propName in this._tracks) { + createTrackClip(this._tracks[propName], propName); + } + return this; + }, + stop: function () { + for (var i = 0; i < this._clipList.length; i++) { + var clip = this._clipList[i]; + this.animation.remove(clip); + } + this._clipList = []; + }, + delay: function (time) { + this._delay = time; + return this; + }, + done: function (cb) { + if (cb) { + this._doneList.push(cb); + } + return this; + } + }; + return Animation; +});define('zrender/tool/vector', [], function () { + var ArrayCtor = typeof Float32Array === 'undefined' ? Array : Float32Array; + var vector = { + create: function (x, y) { + var out = new ArrayCtor(2); + out[0] = x || 0; + out[1] = y || 0; + return out; + }, + copy: function (out, v) { + out[0] = v[0]; + out[1] = v[1]; + return out; + }, + set: function (out, a, b) { + out[0] = a; + out[1] = b; + return out; + }, + add: function (out, v1, v2) { + out[0] = v1[0] + v2[0]; + out[1] = v1[1] + v2[1]; + return out; + }, + scaleAndAdd: function (out, v1, v2, a) { + out[0] = v1[0] + v2[0] * a; + out[1] = v1[1] + v2[1] * a; + return out; + }, + sub: function (out, v1, v2) { + out[0] = v1[0] - v2[0]; + out[1] = v1[1] - v2[1]; + return out; + }, + len: function (v) { + return Math.sqrt(this.lenSquare(v)); + }, + lenSquare: function (v) { + return v[0] * v[0] + v[1] * v[1]; + }, + mul: function (out, v1, v2) { + out[0] = v1[0] * v2[0]; + out[1] = v1[1] * v2[1]; + return out; + }, + div: function (out, v1, v2) { + out[0] = v1[0] / v2[0]; + out[1] = v1[1] / v2[1]; + return out; + }, + dot: function (v1, v2) { + return v1[0] * v2[0] + v1[1] * v2[1]; + }, + scale: function (out, v, s) { + out[0] = v[0] * s; + out[1] = v[1] * s; + return out; + }, + normalize: function (out, v) { + var d = vector.len(v); + if (d === 0) { + out[0] = 0; + out[1] = 0; + } else { + out[0] = v[0] / d; + out[1] = v[1] / d; + } + return out; + }, + distance: function (v1, v2) { + return Math.sqrt((v1[0] - v2[0]) * (v1[0] - v2[0]) + (v1[1] - v2[1]) * (v1[1] - v2[1])); + }, + distanceSquare: function (v1, v2) { + return (v1[0] - v2[0]) * (v1[0] - v2[0]) + (v1[1] - v2[1]) * (v1[1] - v2[1]); + }, + negate: function (out, v) { + out[0] = -v[0]; + out[1] = -v[1]; + return out; + }, + lerp: function (out, v1, v2, t) { + out[0] = v1[0] + t * (v2[0] - v1[0]); + out[1] = v1[1] + t * (v2[1] - v1[1]); + return out; + }, + applyTransform: function (out, v, m) { + var x = v[0]; + var y = v[1]; + out[0] = m[0] * x + m[2] * y + m[4]; + out[1] = m[1] * x + m[3] * y + m[5]; + return out; + }, + min: function (out, v1, v2) { + out[0] = Math.min(v1[0], v2[0]); + out[1] = Math.min(v1[1], v2[1]); + return out; + }, + max: function (out, v1, v2) { + out[0] = Math.max(v1[0], v2[0]); + out[1] = Math.max(v1[1], v2[1]); + return out; + } + }; + vector.length = vector.len; + vector.lengthSquare = vector.lenSquare; + vector.dist = vector.distance; + vector.distSquare = vector.distanceSquare; + return vector; +});define('zrender/tool/matrix', [], function () { + var ArrayCtor = typeof Float32Array === 'undefined' ? Array : Float32Array; + var matrix = { + create: function () { + var out = new ArrayCtor(6); + matrix.identity(out); + return out; + }, + identity: function (out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = 0; + out[5] = 0; + return out; + }, + copy: function (out, m) { + out[0] = m[0]; + out[1] = m[1]; + out[2] = m[2]; + out[3] = m[3]; + out[4] = m[4]; + out[5] = m[5]; + return out; + }, + mul: function (out, m1, m2) { + out[0] = m1[0] * m2[0] + m1[2] * m2[1]; + out[1] = m1[1] * m2[0] + m1[3] * m2[1]; + out[2] = m1[0] * m2[2] + m1[2] * m2[3]; + out[3] = m1[1] * m2[2] + m1[3] * m2[3]; + out[4] = m1[0] * m2[4] + m1[2] * m2[5] + m1[4]; + out[5] = m1[1] * m2[4] + m1[3] * m2[5] + m1[5]; + return out; + }, + translate: function (out, a, v) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4] + v[0]; + out[5] = a[5] + v[1]; + return out; + }, + rotate: function (out, a, rad) { + var aa = a[0]; + var ac = a[2]; + var atx = a[4]; + var ab = a[1]; + var ad = a[3]; + var aty = a[5]; + var st = Math.sin(rad); + var ct = Math.cos(rad); + out[0] = aa * ct + ab * st; + out[1] = -aa * st + ab * ct; + out[2] = ac * ct + ad * st; + out[3] = -ac * st + ct * ad; + out[4] = ct * atx + st * aty; + out[5] = ct * aty - st * atx; + return out; + }, + scale: function (out, a, v) { + var vx = v[0]; + var vy = v[1]; + out[0] = a[0] * vx; + out[1] = a[1] * vy; + out[2] = a[2] * vx; + out[3] = a[3] * vy; + out[4] = a[4] * vx; + out[5] = a[5] * vy; + return out; + }, + invert: function (out, a) { + var aa = a[0]; + var ac = a[2]; + var atx = a[4]; + var ab = a[1]; + var ad = a[3]; + var aty = a[5]; + var det = aa * ad - ab * ac; + if (!det) { + return null; + } + det = 1 / det; + out[0] = ad * det; + out[1] = -ab * det; + out[2] = -ac * det; + out[3] = aa * det; + out[4] = (ac * aty - ad * atx) * det; + out[5] = (ab * atx - aa * aty) * det; + return out; + }, + mulVector: function (out, a, v) { + var aa = a[0]; + var ac = a[2]; + var atx = a[4]; + var ab = a[1]; + var ad = a[3]; + var aty = a[5]; + out[0] = v[0] * aa + v[1] * ac + atx; + out[1] = v[0] * ab + v[1] * ad + aty; + return out; + } + }; + return matrix; +});define('zrender/loadingEffect/Base', [ + 'require', + '../tool/util', + '../shape/Text', + '../shape/Rectangle' +], function (require) { + var util = require('../tool/util'); + var TextShape = require('../shape/Text'); + var RectangleShape = require('../shape/Rectangle'); + var DEFAULT_TEXT = 'Loading...'; + var DEFAULT_TEXT_FONT = 'normal 16px Arial'; + function Base(options) { + this.setOptions(options); + } + Base.prototype.createTextShape = function (textStyle) { + return new TextShape({ + highlightStyle: util.merge({ + x: this.canvasWidth / 2, + y: this.canvasHeight / 2, + text: DEFAULT_TEXT, + textAlign: 'center', + textBaseline: 'middle', + textFont: DEFAULT_TEXT_FONT, + color: '#333', + brushType: 'fill' + }, textStyle, true) + }); + }; + Base.prototype.createBackgroundShape = function (color) { + return new RectangleShape({ + highlightStyle: { + x: 0, + y: 0, + width: this.canvasWidth, + height: this.canvasHeight, + brushType: 'fill', + color: color + } + }); + }; + Base.prototype.start = function (painter) { + this.canvasWidth = painter._width; + this.canvasHeight = painter._height; + function addShapeHandle(param) { + painter.storage.addHover(param); + } + function refreshHandle() { + painter.refreshHover(); + } + this.loadingTimer = this._start(addShapeHandle, refreshHandle); + }; + Base.prototype._start = function () { + return setInterval(function () { + }, 10000); + }; + Base.prototype.stop = function () { + clearInterval(this.loadingTimer); + }; + Base.prototype.setOptions = function (options) { + this.options = options || {}; + }; + Base.prototype.adjust = function (value, region) { + if (value <= region[0]) { + value = region[0]; + } else if (value >= region[1]) { + value = region[1]; + } + return value; + }; + Base.prototype.getLocation = function (loc, totalWidth, totalHeight) { + var x = loc.x != null ? loc.x : 'center'; + switch (x) { + case 'center': + x = Math.floor((this.canvasWidth - totalWidth) / 2); + break; + case 'left': + x = 0; + break; + case 'right': + x = this.canvasWidth - totalWidth; + break; + } + var y = loc.y != null ? loc.y : 'center'; + switch (y) { + case 'center': + y = Math.floor((this.canvasHeight - totalHeight) / 2); + break; + case 'top': + y = 0; + break; + case 'bottom': + y = this.canvasHeight - totalHeight; + break; + } + return { + x: x, + y: y, + width: totalWidth, + height: totalHeight + }; + }; + return Base; +});define('zrender/Layer', [ + 'require', + './mixin/Transformable', + './tool/util', + './config' +], function (require) { + var Transformable = require('./mixin/Transformable'); + var util = require('./tool/util'); + var vmlCanvasManager = window['G_vmlCanvasManager']; + var config = require('./config'); + function returnFalse() { + return false; + } + function createDom(id, type, painter) { + var newDom = document.createElement(type); + var width = painter.getWidth(); + var height = painter.getHeight(); + newDom.style.position = 'absolute'; + newDom.style.left = 0; + newDom.style.top = 0; + newDom.style.width = width + 'px'; + newDom.style.height = height + 'px'; + newDom.width = width * config.devicePixelRatio; + newDom.height = height * config.devicePixelRatio; + newDom.setAttribute('data-zr-dom-id', id); + return newDom; + } + var Layer = function (id, painter) { + this.id = id; + this.dom = createDom(id, 'canvas', painter); + this.dom.onselectstart = returnFalse; + this.dom.style['-webkit-user-select'] = 'none'; + this.dom.style['user-select'] = 'none'; + this.dom.style['-webkit-touch-callout'] = 'none'; + this.dom.style['-webkit-tap-highlight-color'] = 'rgba(0,0,0,0)'; + vmlCanvasManager && vmlCanvasManager.initElement(this.dom); + this.domBack = null; + this.ctxBack = null; + this.painter = painter; + this.unusedCount = 0; + this.config = null; + this.dirty = true; + this.elCount = 0; + this.clearColor = 0; + this.motionBlur = false; + this.lastFrameAlpha = 0.7; + this.zoomable = false; + this.panable = false; + this.maxZoom = Infinity; + this.minZoom = 0; + Transformable.call(this); + }; + Layer.prototype.initContext = function () { + this.ctx = this.dom.getContext('2d'); + var dpr = config.devicePixelRatio; + if (dpr != 1) { + this.ctx.scale(dpr, dpr); + } + }; + Layer.prototype.createBackBuffer = function () { + if (vmlCanvasManager) { + return; + } + this.domBack = createDom('back-' + this.id, 'canvas', this.painter); + this.ctxBack = this.domBack.getContext('2d'); + var dpr = config.devicePixelRatio; + if (dpr != 1) { + this.ctxBack.scale(dpr, dpr); + } + }; + Layer.prototype.resize = function (width, height) { + var dpr = config.devicePixelRatio; + this.dom.style.width = width + 'px'; + this.dom.style.height = height + 'px'; + this.dom.setAttribute('width', width * dpr); + this.dom.setAttribute('height', height * dpr); + if (dpr != 1) { + this.ctx.scale(dpr, dpr); + } + if (this.domBack) { + this.domBack.setAttribute('width', width * dpr); + this.domBack.setAttribute('height', height * dpr); + if (dpr != 1) { + this.ctxBack.scale(dpr, dpr); + } + } + }; + Layer.prototype.clear = function () { + var dom = this.dom; + var ctx = this.ctx; + var width = dom.width; + var height = dom.height; + var haveClearColor = this.clearColor && !vmlCanvasManager; + var haveMotionBLur = this.motionBlur && !vmlCanvasManager; + var lastFrameAlpha = this.lastFrameAlpha; + var dpr = config.devicePixelRatio; + if (haveMotionBLur) { + if (!this.domBack) { + this.createBackBuffer(); + } + this.ctxBack.globalCompositeOperation = 'copy'; + this.ctxBack.drawImage(dom, 0, 0, width / dpr, height / dpr); + } + ctx.clearRect(0, 0, width / dpr, height / dpr); + if (haveClearColor) { + ctx.save(); + ctx.fillStyle = this.clearColor; + ctx.fillRect(0, 0, width / dpr, height / dpr); + ctx.restore(); + } + if (haveMotionBLur) { + var domBack = this.domBack; + ctx.save(); + ctx.globalAlpha = lastFrameAlpha; + ctx.drawImage(domBack, 0, 0, width / dpr, height / dpr); + ctx.restore(); + } + }; + util.merge(Layer.prototype, Transformable.prototype); + return Layer; +});define('zrender/shape/Text', [ + 'require', + '../tool/area', + './Base', + '../tool/util' +], function (require) { + var area = require('../tool/area'); + var Base = require('./Base'); + var Text = function (options) { + Base.call(this, options); + }; + Text.prototype = { + type: 'text', + brush: function (ctx, isHighlight) { + var style = this.style; + if (isHighlight) { + style = this.getHighlightStyle(style, this.highlightStyle || {}); + } + if (typeof style.text == 'undefined' || style.text === false) { + return; + } + ctx.save(); + this.doClip(ctx); + this.setContext(ctx, style); + this.setTransform(ctx); + if (style.textFont) { + ctx.font = style.textFont; + } + ctx.textAlign = style.textAlign || 'start'; + ctx.textBaseline = style.textBaseline || 'middle'; + var text = (style.text + '').split('\n'); + var lineHeight = area.getTextHeight('国', style.textFont); + var rect = this.getRect(style); + var x = style.x; + var y; + if (style.textBaseline == 'top') { + y = rect.y; + } else if (style.textBaseline == 'bottom') { + y = rect.y + lineHeight; + } else { + y = rect.y + lineHeight / 2; + } + for (var i = 0, l = text.length; i < l; i++) { + if (style.maxWidth) { + switch (style.brushType) { + case 'fill': + ctx.fillText(text[i], x, y, style.maxWidth); + break; + case 'stroke': + ctx.strokeText(text[i], x, y, style.maxWidth); + break; + case 'both': + ctx.fillText(text[i], x, y, style.maxWidth); + ctx.strokeText(text[i], x, y, style.maxWidth); + break; + default: + ctx.fillText(text[i], x, y, style.maxWidth); + } + } else { + switch (style.brushType) { + case 'fill': + ctx.fillText(text[i], x, y); + break; + case 'stroke': + ctx.strokeText(text[i], x, y); + break; + case 'both': + ctx.fillText(text[i], x, y); + ctx.strokeText(text[i], x, y); + break; + default: + ctx.fillText(text[i], x, y); + } + } + y += lineHeight; + } + ctx.restore(); + return; + }, + getRect: function (style) { + if (style.__rect) { + return style.__rect; + } + var width = area.getTextWidth(style.text, style.textFont); + var height = area.getTextHeight(style.text, style.textFont); + var textX = style.x; + if (style.textAlign == 'end' || style.textAlign == 'right') { + textX -= width; + } else if (style.textAlign == 'center') { + textX -= width / 2; + } + var textY; + if (style.textBaseline == 'top') { + textY = style.y; + } else if (style.textBaseline == 'bottom') { + textY = style.y - height; + } else { + textY = style.y - height / 2; + } + style.__rect = { + x: textX, + y: textY, + width: width, + height: height + }; + return style.__rect; + } + }; + require('../tool/util').inherits(Text, Base); + return Text; +});define('zrender/shape/Rectangle', [ + 'require', + './Base', + '../tool/util' +], function (require) { + var Base = require('./Base'); + var Rectangle = function (options) { + Base.call(this, options); + }; + Rectangle.prototype = { + type: 'rectangle', + _buildRadiusPath: function (ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + var r = style.radius; + var r1; + var r2; + var r3; + var r4; + if (typeof r === 'number') { + r1 = r2 = r3 = r4 = r; + } else if (r instanceof Array) { + if (r.length === 1) { + r1 = r2 = r3 = r4 = r[0]; + } else if (r.length === 2) { + r1 = r3 = r[0]; + r2 = r4 = r[1]; + } else if (r.length === 3) { + r1 = r[0]; + r2 = r4 = r[1]; + r3 = r[2]; + } else { + r1 = r[0]; + r2 = r[1]; + r3 = r[2]; + r4 = r[3]; + } + } else { + r1 = r2 = r3 = r4 = 0; + } + var total; + if (r1 + r2 > width) { + total = r1 + r2; + r1 *= width / total; + r2 *= width / total; + } + if (r3 + r4 > width) { + total = r3 + r4; + r3 *= width / total; + r4 *= width / total; + } + if (r2 + r3 > height) { + total = r2 + r3; + r2 *= height / total; + r3 *= height / total; + } + if (r1 + r4 > height) { + total = r1 + r4; + r1 *= height / total; + r4 *= height / total; + } + ctx.moveTo(x + r1, y); + ctx.lineTo(x + width - r2, y); + r2 !== 0 && ctx.quadraticCurveTo(x + width, y, x + width, y + r2); + ctx.lineTo(x + width, y + height - r3); + r3 !== 0 && ctx.quadraticCurveTo(x + width, y + height, x + width - r3, y + height); + ctx.lineTo(x + r4, y + height); + r4 !== 0 && ctx.quadraticCurveTo(x, y + height, x, y + height - r4); + ctx.lineTo(x, y + r1); + r1 !== 0 && ctx.quadraticCurveTo(x, y, x + r1, y); + }, + buildPath: function (ctx, style) { + if (!style.radius) { + ctx.moveTo(style.x, style.y); + ctx.lineTo(style.x + style.width, style.y); + ctx.lineTo(style.x + style.width, style.y + style.height); + ctx.lineTo(style.x, style.y + style.height); + ctx.lineTo(style.x, style.y); + } else { + this._buildRadiusPath(ctx, style); + } + ctx.closePath(); + return; + }, + getRect: function (style) { + if (style.__rect) { + return style.__rect; + } + var lineWidth; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } else { + lineWidth = 0; + } + style.__rect = { + x: Math.round(style.x - lineWidth / 2), + y: Math.round(style.y - lineWidth / 2), + width: style.width + lineWidth, + height: style.height + lineWidth + }; + return style.__rect; + } + }; + require('../tool/util').inherits(Rectangle, Base); + return Rectangle; +});define('zrender/tool/area', [ + 'require', + './util', + './curve' +], function (require) { + 'use strict'; + var util = require('./util'); + var curve = require('./curve'); + var _ctx; + var _textWidthCache = {}; + var _textHeightCache = {}; + var _textWidthCacheCounter = 0; + var _textHeightCacheCounter = 0; + var TEXT_CACHE_MAX = 5000; + var PI2 = Math.PI * 2; + function normalizeRadian(angle) { + angle %= PI2; + if (angle < 0) { + angle += PI2; + } + return angle; + } + function isInside(shape, area, x, y) { + if (!area || !shape) { + return false; + } + var zoneType = shape.type; + _ctx = _ctx || util.getContext(); + var _mathReturn = _mathMethod(shape, area, x, y); + if (typeof _mathReturn != 'undefined') { + return _mathReturn; + } + if (shape.buildPath && _ctx.isPointInPath) { + return _buildPathMethod(shape, _ctx, area, x, y); + } + switch (zoneType) { + case 'ellipse': + return true; + case 'trochoid': + var _r = area.location == 'out' ? area.r1 + area.r2 + area.d : area.r1 - area.r2 + area.d; + return isInsideCircle(area, x, y, _r); + case 'rose': + return isInsideCircle(area, x, y, area.maxr); + default: + return false; + } + } + function _mathMethod(shape, area, x, y) { + var zoneType = shape.type; + switch (zoneType) { + case 'bezier-curve': + if (typeof area.cpX2 === 'undefined') { + return isInsideQuadraticStroke(area.xStart, area.yStart, area.cpX1, area.cpY1, area.xEnd, area.yEnd, area.lineWidth, x, y); + } + return isInsideCubicStroke(area.xStart, area.yStart, area.cpX1, area.cpY1, area.cpX2, area.cpY2, area.xEnd, area.yEnd, area.lineWidth, x, y); + case 'line': + return isInsideLine(area.xStart, area.yStart, area.xEnd, area.yEnd, area.lineWidth, x, y); + case 'polyline': + return isInsidePolyline(area.pointList, area.lineWidth, x, y); + case 'ring': + return isInsideRing(area.x, area.y, area.r0, area.r, x, y); + case 'circle': + return isInsideCircle(area.x, area.y, area.r, x, y); + case 'sector': + var startAngle = area.startAngle * Math.PI / 180; + var endAngle = area.endAngle * Math.PI / 180; + if (!area.clockWise) { + startAngle = -startAngle; + endAngle = -endAngle; + } + return isInsideSector(area.x, area.y, area.r0, area.r, startAngle, endAngle, !area.clockWise, x, y); + case 'path': + return area.pathArray && isInsidePath(area.pathArray, Math.max(area.lineWidth, 5), area.brushType, x, y); + case 'polygon': + case 'star': + case 'isogon': + return isInsidePolygon(area.pointList, x, y); + case 'text': + var rect = area.__rect || shape.getRect(area); + return isInsideRect(rect.x, rect.y, rect.width, rect.height, x, y); + case 'rectangle': + case 'image': + return isInsideRect(area.x, area.y, area.width, area.height, x, y); + } + } + function _buildPathMethod(shape, context, area, x, y) { + context.beginPath(); + shape.buildPath(context, area); + context.closePath(); + return context.isPointInPath(x, y); + } + function isOutside(shape, area, x, y) { + return !isInside(shape, area, x, y); + } + function isInsideLine(x0, y0, x1, y1, lineWidth, x, y) { + if (lineWidth === 0) { + return false; + } + var _l = Math.max(lineWidth, 5); + var _a = 0; + var _b = x0; + if (y > y0 + _l && y > y1 + _l || y < y0 - _l && y < y1 - _l || x > x0 + _l && x > x1 + _l || x < x0 - _l && x < x1 - _l) { + return false; + } + if (x0 !== x1) { + _a = (y0 - y1) / (x0 - x1); + _b = (x0 * y1 - x1 * y0) / (x0 - x1); + } else { + return Math.abs(x - x0) <= _l / 2; + } + var tmp = _a * x - y + _b; + var _s = tmp * tmp / (_a * _a + 1); + return _s <= _l / 2 * _l / 2; + } + function isInsideCubicStroke(x0, y0, x1, y1, x2, y2, x3, y3, lineWidth, x, y) { + if (lineWidth === 0) { + return false; + } + var _l = Math.max(lineWidth, 5); + if (y > y0 + _l && y > y1 + _l && y > y2 + _l && y > y3 + _l || y < y0 - _l && y < y1 - _l && y < y2 - _l && y < y3 - _l || x > x0 + _l && x > x1 + _l && x > x2 + _l && x > x3 + _l || x < x0 - _l && x < x1 - _l && x < x2 - _l && x < x3 - _l) { + return false; + } + var d = curve.cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, null); + return d <= _l / 2; + } + function isInsideQuadraticStroke(x0, y0, x1, y1, x2, y2, lineWidth, x, y) { + if (lineWidth === 0) { + return false; + } + var _l = Math.max(lineWidth, 5); + if (y > y0 + _l && y > y1 + _l && y > y2 + _l || y < y0 - _l && y < y1 - _l && y < y2 - _l || x > x0 + _l && x > x1 + _l && x > x2 + _l || x < x0 - _l && x < x1 - _l && x < x2 - _l) { + return false; + } + var d = curve.quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, null); + return d <= _l / 2; + } + function isInsideArcStroke(cx, cy, r, startAngle, endAngle, anticlockwise, lineWidth, x, y) { + if (lineWidth === 0) { + return false; + } + var _l = Math.max(lineWidth, 5); + x -= cx; + y -= cy; + var d = Math.sqrt(x * x + y * y); + if (d - _l > r || d + _l < r) { + return false; + } + if (Math.abs(startAngle - endAngle) >= PI2) { + return true; + } + if (anticlockwise) { + var tmp = startAngle; + startAngle = normalizeRadian(endAngle); + endAngle = normalizeRadian(tmp); + } else { + startAngle = normalizeRadian(startAngle); + endAngle = normalizeRadian(endAngle); + } + if (startAngle > endAngle) { + endAngle += PI2; + } + var angle = Math.atan2(y, x); + if (angle < 0) { + angle += PI2; + } + return angle >= startAngle && angle <= endAngle || angle + PI2 >= startAngle && angle + PI2 <= endAngle; + } + function isInsidePolyline(points, lineWidth, x, y) { + var lineWidth = Math.max(lineWidth, 10); + for (var i = 0, l = points.length - 1; i < l; i++) { + var x0 = points[i][0]; + var y0 = points[i][1]; + var x1 = points[i + 1][0]; + var y1 = points[i + 1][1]; + if (isInsideLine(x0, y0, x1, y1, lineWidth, x, y)) { + return true; + } + } + return false; + } + function isInsideRing(cx, cy, r0, r, x, y) { + var d = (x - cx) * (x - cx) + (y - cy) * (y - cy); + return d < r * r && d > r0 * r0; + } + function isInsideRect(x0, y0, width, height, x, y) { + return x >= x0 && x <= x0 + width && y >= y0 && y <= y0 + height; + } + function isInsideCircle(x0, y0, r, x, y) { + return (x - x0) * (x - x0) + (y - y0) * (y - y0) < r * r; + } + function isInsideSector(cx, cy, r0, r, startAngle, endAngle, anticlockwise, x, y) { + return isInsideArcStroke(cx, cy, (r0 + r) / 2, startAngle, endAngle, anticlockwise, r - r0, x, y); + } + function isInsidePolygon(points, x, y) { + var N = points.length; + var w = 0; + for (var i = 0, j = N - 1; i < N; i++) { + var x0 = points[j][0]; + var y0 = points[j][1]; + var x1 = points[i][0]; + var y1 = points[i][1]; + w += windingLine(x0, y0, x1, y1, x, y); + j = i; + } + return w !== 0; + } + function windingLine(x0, y0, x1, y1, x, y) { + if (y > y0 && y > y1 || y < y0 && y < y1) { + return 0; + } + if (y1 == y0) { + return 0; + } + var dir = y1 < y0 ? 1 : -1; + var t = (y - y0) / (y1 - y0); + var x_ = t * (x1 - x0) + x0; + return x_ > x ? dir : 0; + } + var roots = [ + -1, + -1, + -1 + ]; + var extrema = [ + -1, + -1 + ]; + function swapExtrema() { + var tmp = extrema[0]; + extrema[0] = extrema[1]; + extrema[1] = tmp; + } + function windingCubic(x0, y0, x1, y1, x2, y2, x3, y3, x, y) { + if (y > y0 && y > y1 && y > y2 && y > y3 || y < y0 && y < y1 && y < y2 && y < y3) { + return 0; + } + var nRoots = curve.cubicRootAt(y0, y1, y2, y3, y, roots); + if (nRoots === 0) { + return 0; + } else { + var w = 0; + var nExtrema = -1; + var y0_, y1_; + for (var i = 0; i < nRoots; i++) { + var t = roots[i]; + var x_ = curve.cubicAt(x0, x1, x2, x3, t); + if (x_ < x) { + continue; + } + if (nExtrema < 0) { + nExtrema = curve.cubicExtrema(y0, y1, y2, y3, extrema); + if (extrema[1] < extrema[0] && nExtrema > 1) { + swapExtrema(); + } + y0_ = curve.cubicAt(y0, y1, y2, y3, extrema[0]); + if (nExtrema > 1) { + y1_ = curve.cubicAt(y0, y1, y2, y3, extrema[1]); + } + } + if (nExtrema == 2) { + if (t < extrema[0]) { + w += y0_ < y0 ? 1 : -1; + } else if (t < extrema[1]) { + w += y1_ < y0_ ? 1 : -1; + } else { + w += y3 < y1_ ? 1 : -1; + } + } else { + if (t < extrema[0]) { + w += y0_ < y0 ? 1 : -1; + } else { + w += y3 < y0_ ? 1 : -1; + } + } + } + return w; + } + } + function windingQuadratic(x0, y0, x1, y1, x2, y2, x, y) { + if (y > y0 && y > y1 && y > y2 || y < y0 && y < y1 && y < y2) { + return 0; + } + var nRoots = curve.quadraticRootAt(y0, y1, y2, y, roots); + if (nRoots === 0) { + return 0; + } else { + var t = curve.quadraticExtremum(y0, y1, y2); + if (t >= 0 && t <= 1) { + var w = 0; + var y_ = curve.quadraticAt(y0, y1, y2, t); + for (var i = 0; i < nRoots; i++) { + var x_ = curve.quadraticAt(x0, x1, x2, roots[i]); + if (x_ > x) { + continue; + } + if (roots[i] < t) { + w += y_ < y0 ? 1 : -1; + } else { + w += y2 < y_ ? 1 : -1; + } + } + return w; + } else { + var x_ = curve.quadraticAt(x0, x1, x2, roots[0]); + if (x_ > x) { + return 0; + } + return y2 < y0 ? 1 : -1; + } + } + } + function windingArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y) { + y -= cy; + if (y > r || y < -r) { + return 0; + } + var tmp = Math.sqrt(r * r - y * y); + roots[0] = -tmp; + roots[1] = tmp; + if (Math.abs(startAngle - endAngle) >= PI2) { + startAngle = 0; + endAngle = PI2; + var dir = anticlockwise ? 1 : -1; + if (x >= roots[0] + cx && x <= roots[1] + cx) { + return dir; + } else { + return 0; + } + } + if (anticlockwise) { + var tmp = startAngle; + startAngle = normalizeRadian(endAngle); + endAngle = normalizeRadian(tmp); + } else { + startAngle = normalizeRadian(startAngle); + endAngle = normalizeRadian(endAngle); + } + if (startAngle > endAngle) { + endAngle += PI2; + } + var w = 0; + for (var i = 0; i < 2; i++) { + var x_ = roots[i]; + if (x_ + cx > x) { + var angle = Math.atan2(y, x_); + var dir = anticlockwise ? 1 : -1; + if (angle < 0) { + angle = PI2 + angle; + } + if (angle >= startAngle && angle <= endAngle || angle + PI2 >= startAngle && angle + PI2 <= endAngle) { + if (angle > Math.PI / 2 && angle < Math.PI * 1.5) { + dir = -dir; + } + w += dir; + } + } + } + return w; + } + function isInsidePath(pathArray, lineWidth, brushType, x, y) { + var w = 0; + var xi = 0; + var yi = 0; + var x0 = 0; + var y0 = 0; + var beginSubpath = true; + var firstCmd = true; + brushType = brushType || 'fill'; + var hasStroke = brushType === 'stroke' || brushType === 'both'; + var hasFill = brushType === 'fill' || brushType === 'both'; + for (var i = 0; i < pathArray.length; i++) { + var seg = pathArray[i]; + var p = seg.points; + if (beginSubpath || seg.command === 'M') { + if (i > 0) { + if (hasFill) { + w += windingLine(xi, yi, x0, y0, x, y); + } + if (w !== 0) { + return true; + } + } + x0 = p[p.length - 2]; + y0 = p[p.length - 1]; + beginSubpath = false; + if (firstCmd && seg.command !== 'A') { + firstCmd = false; + xi = x0; + yi = y0; + } + } + switch (seg.command) { + case 'M': + xi = p[0]; + yi = p[1]; + break; + case 'L': + if (hasStroke) { + if (isInsideLine(xi, yi, p[0], p[1], lineWidth, x, y)) { + return true; + } + } + if (hasFill) { + w += windingLine(xi, yi, p[0], p[1], x, y); + } + xi = p[0]; + yi = p[1]; + break; + case 'C': + if (hasStroke) { + if (isInsideCubicStroke(xi, yi, p[0], p[1], p[2], p[3], p[4], p[5], lineWidth, x, y)) { + return true; + } + } + if (hasFill) { + w += windingCubic(xi, yi, p[0], p[1], p[2], p[3], p[4], p[5], x, y); + } + xi = p[4]; + yi = p[5]; + break; + case 'Q': + if (hasStroke) { + if (isInsideQuadraticStroke(xi, yi, p[0], p[1], p[2], p[3], lineWidth, x, y)) { + return true; + } + } + if (hasFill) { + w += windingQuadratic(xi, yi, p[0], p[1], p[2], p[3], x, y); + } + xi = p[2]; + yi = p[3]; + break; + case 'A': + var cx = p[0]; + var cy = p[1]; + var rx = p[2]; + var ry = p[3]; + var theta = p[4]; + var dTheta = p[5]; + var x1 = Math.cos(theta) * rx + cx; + var y1 = Math.sin(theta) * ry + cy; + if (!firstCmd) { + w += windingLine(xi, yi, x1, y1); + } else { + firstCmd = false; + x0 = x1; + y0 = y1; + } + var _x = (x - cx) * ry / rx + cx; + if (hasStroke) { + if (isInsideArcStroke(cx, cy, ry, theta, theta + dTheta, 1 - p[7], lineWidth, _x, y)) { + return true; + } + } + if (hasFill) { + w += windingArc(cx, cy, ry, theta, theta + dTheta, 1 - p[7], _x, y); + } + xi = Math.cos(theta + dTheta) * rx + cx; + yi = Math.sin(theta + dTheta) * ry + cy; + break; + case 'z': + if (hasStroke) { + if (isInsideLine(xi, yi, x0, y0, lineWidth, x, y)) { + return true; + } + } + beginSubpath = true; + break; + } + } + if (hasFill) { + w += windingLine(xi, yi, x0, y0, x, y); + } + return w !== 0; + } + function getTextWidth(text, textFont) { + var key = text + ':' + textFont; + if (_textWidthCache[key]) { + return _textWidthCache[key]; + } + _ctx = _ctx || util.getContext(); + _ctx.save(); + if (textFont) { + _ctx.font = textFont; + } + text = (text + '').split('\n'); + var width = 0; + for (var i = 0, l = text.length; i < l; i++) { + width = Math.max(_ctx.measureText(text[i]).width, width); + } + _ctx.restore(); + _textWidthCache[key] = width; + if (++_textWidthCacheCounter > TEXT_CACHE_MAX) { + _textWidthCacheCounter = 0; + _textWidthCache = {}; + } + return width; + } + function getTextHeight(text, textFont) { + var key = text + ':' + textFont; + if (_textHeightCache[key]) { + return _textHeightCache[key]; + } + _ctx = _ctx || util.getContext(); + _ctx.save(); + if (textFont) { + _ctx.font = textFont; + } + text = (text + '').split('\n'); + var height = (_ctx.measureText('国').width + 2) * text.length; + _ctx.restore(); + _textHeightCache[key] = height; + if (++_textHeightCacheCounter > TEXT_CACHE_MAX) { + _textHeightCacheCounter = 0; + _textHeightCache = {}; + } + return height; + } + return { + isInside: isInside, + isOutside: isOutside, + getTextWidth: getTextWidth, + getTextHeight: getTextHeight, + isInsidePath: isInsidePath, + isInsidePolygon: isInsidePolygon, + isInsideSector: isInsideSector, + isInsideCircle: isInsideCircle, + isInsideLine: isInsideLine, + isInsideRect: isInsideRect, + isInsidePolyline: isInsidePolyline, + isInsideCubicStroke: isInsideCubicStroke, + isInsideQuadraticStroke: isInsideQuadraticStroke + }; +});define('zrender/shape/Base', [ + 'require', + '../tool/matrix', + '../tool/guid', + '../tool/util', + '../tool/log', + '../mixin/Transformable', + '../mixin/Eventful', + '../tool/area', + '../tool/color' +], function (require) { + var vmlCanvasManager = window['G_vmlCanvasManager']; + var matrix = require('../tool/matrix'); + var guid = require('../tool/guid'); + var util = require('../tool/util'); + var log = require('../tool/log'); + var Transformable = require('../mixin/Transformable'); + var Eventful = require('../mixin/Eventful'); + function _fillText(ctx, text, x, y, textFont, textAlign, textBaseline) { + if (textFont) { + ctx.font = textFont; + } + ctx.textAlign = textAlign; + ctx.textBaseline = textBaseline; + var rect = _getTextRect(text, x, y, textFont, textAlign, textBaseline); + text = (text + '').split('\n'); + var lineHeight = require('../tool/area').getTextHeight('国', textFont); + switch (textBaseline) { + case 'top': + y = rect.y; + break; + case 'bottom': + y = rect.y + lineHeight; + break; + default: + y = rect.y + lineHeight / 2; + } + for (var i = 0, l = text.length; i < l; i++) { + ctx.fillText(text[i], x, y); + y += lineHeight; + } + } + function _getTextRect(text, x, y, textFont, textAlign, textBaseline) { + var area = require('../tool/area'); + var width = area.getTextWidth(text, textFont); + var lineHeight = area.getTextHeight('国', textFont); + text = (text + '').split('\n'); + switch (textAlign) { + case 'end': + case 'right': + x -= width; + break; + case 'center': + x -= width / 2; + break; + } + switch (textBaseline) { + case 'top': + break; + case 'bottom': + y -= lineHeight * text.length; + break; + default: + y -= lineHeight * text.length / 2; + } + return { + x: x, + y: y, + width: width, + height: lineHeight * text.length + }; + } + var Base = function (options) { + options = options || {}; + this.id = options.id || guid(); + for (var key in options) { + this[key] = options[key]; + } + this.style = this.style || {}; + this.highlightStyle = this.highlightStyle || null; + this.parent = null; + this.__dirty = true; + this.__clipShapes = []; + Transformable.call(this); + Eventful.call(this); + }; + Base.prototype.invisible = false; + Base.prototype.ignore = false; + Base.prototype.zlevel = 0; + Base.prototype.draggable = false; + Base.prototype.clickable = false; + Base.prototype.hoverable = true; + Base.prototype.z = 0; + Base.prototype.brush = function (ctx, isHighlight) { + var style = this.beforeBrush(ctx, isHighlight); + ctx.beginPath(); + this.buildPath(ctx, style); + switch (style.brushType) { + case 'both': + ctx.fill(); + case 'stroke': + style.lineWidth > 0 && ctx.stroke(); + break; + default: + ctx.fill(); + } + this.drawText(ctx, style, this.style); + this.afterBrush(ctx); + }; + Base.prototype.beforeBrush = function (ctx, isHighlight) { + var style = this.style; + if (this.brushTypeOnly) { + style.brushType = this.brushTypeOnly; + } + if (isHighlight) { + style = this.getHighlightStyle(style, this.highlightStyle || {}, this.brushTypeOnly); + } + if (this.brushTypeOnly == 'stroke') { + style.strokeColor = style.strokeColor || style.color; + } + ctx.save(); + this.doClip(ctx); + this.setContext(ctx, style); + this.setTransform(ctx); + return style; + }; + Base.prototype.afterBrush = function (ctx) { + ctx.restore(); + }; + var STYLE_CTX_MAP = [ + [ + 'color', + 'fillStyle' + ], + [ + 'strokeColor', + 'strokeStyle' + ], + [ + 'opacity', + 'globalAlpha' + ], + [ + 'lineCap', + 'lineCap' + ], + [ + 'lineJoin', + 'lineJoin' + ], + [ + 'miterLimit', + 'miterLimit' + ], + [ + 'lineWidth', + 'lineWidth' + ], + [ + 'shadowBlur', + 'shadowBlur' + ], + [ + 'shadowColor', + 'shadowColor' + ], + [ + 'shadowOffsetX', + 'shadowOffsetX' + ], + [ + 'shadowOffsetY', + 'shadowOffsetY' + ] + ]; + Base.prototype.setContext = function (ctx, style) { + for (var i = 0, len = STYLE_CTX_MAP.length; i < len; i++) { + var styleProp = STYLE_CTX_MAP[i][0]; + var styleValue = style[styleProp]; + var ctxProp = STYLE_CTX_MAP[i][1]; + if (typeof styleValue != 'undefined') { + ctx[ctxProp] = styleValue; + } + } + }; + var clipShapeInvTransform = matrix.create(); + Base.prototype.doClip = function (ctx) { + if (this.__clipShapes && !vmlCanvasManager) { + for (var i = 0; i < this.__clipShapes.length; i++) { + var clipShape = this.__clipShapes[i]; + if (clipShape.needTransform) { + var m = clipShape.transform; + matrix.invert(clipShapeInvTransform, m); + ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]); + } + ctx.beginPath(); + clipShape.buildPath(ctx, clipShape.style); + ctx.clip(); + if (clipShape.needTransform) { + var m = clipShapeInvTransform; + ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]); + } + } + } + }; + Base.prototype.getHighlightStyle = function (style, highlightStyle, brushTypeOnly) { + var newStyle = {}; + for (var k in style) { + newStyle[k] = style[k]; + } + var color = require('../tool/color'); + var highlightColor = color.getHighlightColor(); + if (style.brushType != 'stroke') { + newStyle.strokeColor = highlightColor; + newStyle.lineWidth = (style.lineWidth || 1) + this.getHighlightZoom(); + newStyle.brushType = 'both'; + } else { + if (brushTypeOnly != 'stroke') { + newStyle.strokeColor = highlightColor; + newStyle.lineWidth = (style.lineWidth || 1) + this.getHighlightZoom(); + } else { + newStyle.strokeColor = highlightStyle.strokeColor || color.mix(style.strokeColor, color.toRGB(highlightColor)); + } + } + for (var k in highlightStyle) { + if (typeof highlightStyle[k] != 'undefined') { + newStyle[k] = highlightStyle[k]; + } + } + return newStyle; + }; + Base.prototype.getHighlightZoom = function () { + return this.type != 'text' ? 6 : 2; + }; + Base.prototype.drift = function (dx, dy) { + this.position[0] += dx; + this.position[1] += dy; + }; + Base.prototype.getTansform = function () { + var invTransform = []; + return function (x, y) { + var originPos = [ + x, + y + ]; + if (this.needTransform && this.transform) { + matrix.invert(invTransform, this.transform); + matrix.mulVector(originPos, invTransform, [ + x, + y, + 1 + ]); + if (x == originPos[0] && y == originPos[1]) { + this.updateNeedTransform(); + } + } + return originPos; + }; + }(); + Base.prototype.buildPath = function (ctx, style) { + log('buildPath not implemented in ' + this.type); + }; + Base.prototype.getRect = function (style) { + log('getRect not implemented in ' + this.type); + }; + Base.prototype.isCover = function (x, y) { + var originPos = this.getTansform(x, y); + x = originPos[0]; + y = originPos[1]; + var rect = this.style.__rect; + if (!rect) { + rect = this.style.__rect = this.getRect(this.style); + } + if (x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height) { + return require('../tool/area').isInside(this, this.style, x, y); + } + return false; + }; + Base.prototype.drawText = function (ctx, style, normalStyle) { + if (typeof style.text == 'undefined' || style.text === false) { + return; + } + var textColor = style.textColor || style.color || style.strokeColor; + ctx.fillStyle = textColor; + var dd = 10; + var al; + var bl; + var tx; + var ty; + var textPosition = style.textPosition || this.textPosition || 'top'; + switch (textPosition) { + case 'inside': + case 'top': + case 'bottom': + case 'left': + case 'right': + if (this.getRect) { + var rect = (normalStyle || style).__rect || this.getRect(normalStyle || style); + switch (textPosition) { + case 'inside': + tx = rect.x + rect.width / 2; + ty = rect.y + rect.height / 2; + al = 'center'; + bl = 'middle'; + if (style.brushType != 'stroke' && textColor == style.color) { + ctx.fillStyle = '#fff'; + } + break; + case 'left': + tx = rect.x - dd; + ty = rect.y + rect.height / 2; + al = 'end'; + bl = 'middle'; + break; + case 'right': + tx = rect.x + rect.width + dd; + ty = rect.y + rect.height / 2; + al = 'start'; + bl = 'middle'; + break; + case 'top': + tx = rect.x + rect.width / 2; + ty = rect.y - dd; + al = 'center'; + bl = 'bottom'; + break; + case 'bottom': + tx = rect.x + rect.width / 2; + ty = rect.y + rect.height + dd; + al = 'center'; + bl = 'top'; + break; + } + } + break; + case 'start': + case 'end': + var pointList = style.pointList || [ + [ + style.xStart || 0, + style.yStart || 0 + ], + [ + style.xEnd || 0, + style.yEnd || 0 + ] + ]; + var length = pointList.length; + if (length < 2) { + return; + } + var xStart; + var xEnd; + var yStart; + var yEnd; + switch (textPosition) { + case 'start': + xStart = pointList[1][0]; + xEnd = pointList[0][0]; + yStart = pointList[1][1]; + yEnd = pointList[0][1]; + break; + case 'end': + xStart = pointList[length - 2][0]; + xEnd = pointList[length - 1][0]; + yStart = pointList[length - 2][1]; + yEnd = pointList[length - 1][1]; + break; + } + tx = xEnd; + ty = yEnd; + var angle = Math.atan((yStart - yEnd) / (xEnd - xStart)) / Math.PI * 180; + if (xEnd - xStart < 0) { + angle += 180; + } else if (yStart - yEnd < 0) { + angle += 360; + } + dd = 5; + if (angle >= 30 && angle <= 150) { + al = 'center'; + bl = 'bottom'; + ty -= dd; + } else if (angle > 150 && angle < 210) { + al = 'right'; + bl = 'middle'; + tx -= dd; + } else if (angle >= 210 && angle <= 330) { + al = 'center'; + bl = 'top'; + ty += dd; + } else { + al = 'left'; + bl = 'middle'; + tx += dd; + } + break; + case 'specific': + tx = style.textX || 0; + ty = style.textY || 0; + al = 'start'; + bl = 'middle'; + break; + } + if (tx != null && ty != null) { + _fillText(ctx, style.text, tx, ty, style.textFont, style.textAlign || al, style.textBaseline || bl); + } + }; + Base.prototype.modSelf = function () { + this.__dirty = true; + if (this.style) { + this.style.__rect = null; + } + if (this.highlightStyle) { + this.highlightStyle.__rect = null; + } + }; + Base.prototype.isSilent = function () { + return !(this.hoverable || this.draggable || this.clickable || this.onmousemove || this.onmouseover || this.onmouseout || this.onmousedown || this.onmouseup || this.onclick || this.ondragenter || this.ondragover || this.ondragleave || this.ondrop); + }; + util.merge(Base.prototype, Transformable.prototype, true); + util.merge(Base.prototype, Eventful.prototype, true); + return Base; +});define('zrender/tool/curve', [ + 'require', + './vector' +], function (require) { + var vector = require('./vector'); + 'use strict'; + var EPSILON = 0.0001; + var THREE_SQRT = Math.sqrt(3); + var ONE_THIRD = 1 / 3; + var _v0 = vector.create(); + var _v1 = vector.create(); + var _v2 = vector.create(); + function isAroundZero(val) { + return val > -EPSILON && val < EPSILON; + } + function isNotAroundZero(val) { + return val > EPSILON || val < -EPSILON; + } + function cubicAt(p0, p1, p2, p3, t) { + var onet = 1 - t; + return onet * onet * (onet * p0 + 3 * t * p1) + t * t * (t * p3 + 3 * onet * p2); + } + function cubicDerivativeAt(p0, p1, p2, p3, t) { + var onet = 1 - t; + return 3 * (((p1 - p0) * onet + 2 * (p2 - p1) * t) * onet + (p3 - p2) * t * t); + } + function cubicRootAt(p0, p1, p2, p3, val, roots) { + var a = p3 + 3 * (p1 - p2) - p0; + var b = 3 * (p2 - p1 * 2 + p0); + var c = 3 * (p1 - p0); + var d = p0 - val; + var A = b * b - 3 * a * c; + var B = b * c - 9 * a * d; + var C = c * c - 3 * b * d; + var n = 0; + if (isAroundZero(A) && isAroundZero(B)) { + if (isAroundZero(b)) { + roots[0] = 0; + } else { + var t1 = -c / b; + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + } + } else { + var disc = B * B - 4 * A * C; + if (isAroundZero(disc)) { + var K = B / A; + var t1 = -b / a + K; + var t2 = -K / 2; + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + if (t2 >= 0 && t2 <= 1) { + roots[n++] = t2; + } + } else if (disc > 0) { + var discSqrt = Math.sqrt(disc); + var Y1 = A * b + 1.5 * a * (-B + discSqrt); + var Y2 = A * b + 1.5 * a * (-B - discSqrt); + if (Y1 < 0) { + Y1 = -Math.pow(-Y1, ONE_THIRD); + } else { + Y1 = Math.pow(Y1, ONE_THIRD); + } + if (Y2 < 0) { + Y2 = -Math.pow(-Y2, ONE_THIRD); + } else { + Y2 = Math.pow(Y2, ONE_THIRD); + } + var t1 = (-b - (Y1 + Y2)) / (3 * a); + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + } else { + var T = (2 * A * b - 3 * a * B) / (2 * Math.sqrt(A * A * A)); + var theta = Math.acos(T) / 3; + var ASqrt = Math.sqrt(A); + var tmp = Math.cos(theta); + var t1 = (-b - 2 * ASqrt * tmp) / (3 * a); + var t2 = (-b + ASqrt * (tmp + THREE_SQRT * Math.sin(theta))) / (3 * a); + var t3 = (-b + ASqrt * (tmp - THREE_SQRT * Math.sin(theta))) / (3 * a); + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + if (t2 >= 0 && t2 <= 1) { + roots[n++] = t2; + } + if (t3 >= 0 && t3 <= 1) { + roots[n++] = t3; + } + } + } + return n; + } + function cubicExtrema(p0, p1, p2, p3, extrema) { + var b = 6 * p2 - 12 * p1 + 6 * p0; + var a = 9 * p1 + 3 * p3 - 3 * p0 - 9 * p2; + var c = 3 * p1 - 3 * p0; + var n = 0; + if (isAroundZero(a)) { + if (isNotAroundZero(b)) { + var t1 = -c / b; + if (t1 >= 0 && t1 <= 1) { + extrema[n++] = t1; + } + } + } else { + var disc = b * b - 4 * a * c; + if (isAroundZero(disc)) { + extrema[0] = -b / (2 * a); + } else if (disc > 0) { + var discSqrt = Math.sqrt(disc); + var t1 = (-b + discSqrt) / (2 * a); + var t2 = (-b - discSqrt) / (2 * a); + if (t1 >= 0 && t1 <= 1) { + extrema[n++] = t1; + } + if (t2 >= 0 && t2 <= 1) { + extrema[n++] = t2; + } + } + } + return n; + } + function cubicSubdivide(p0, p1, p2, p3, t, out) { + var p01 = (p1 - p0) * t + p0; + var p12 = (p2 - p1) * t + p1; + var p23 = (p3 - p2) * t + p2; + var p012 = (p12 - p01) * t + p01; + var p123 = (p23 - p12) * t + p12; + var p0123 = (p123 - p012) * t + p012; + out[0] = p0; + out[1] = p01; + out[2] = p012; + out[3] = p0123; + out[4] = p0123; + out[5] = p123; + out[6] = p23; + out[7] = p3; + } + function cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, out) { + var t; + var interval = 0.005; + var d = Infinity; + _v0[0] = x; + _v0[1] = y; + for (var _t = 0; _t < 1; _t += 0.05) { + _v1[0] = cubicAt(x0, x1, x2, x3, _t); + _v1[1] = cubicAt(y0, y1, y2, y3, _t); + var d1 = vector.distSquare(_v0, _v1); + if (d1 < d) { + t = _t; + d = d1; + } + } + d = Infinity; + for (var i = 0; i < 32; i++) { + if (interval < EPSILON) { + break; + } + var prev = t - interval; + var next = t + interval; + _v1[0] = cubicAt(x0, x1, x2, x3, prev); + _v1[1] = cubicAt(y0, y1, y2, y3, prev); + var d1 = vector.distSquare(_v1, _v0); + if (prev >= 0 && d1 < d) { + t = prev; + d = d1; + } else { + _v2[0] = cubicAt(x0, x1, x2, x3, next); + _v2[1] = cubicAt(y0, y1, y2, y3, next); + var d2 = vector.distSquare(_v2, _v0); + if (next <= 1 && d2 < d) { + t = next; + d = d2; + } else { + interval *= 0.5; + } + } + } + if (out) { + out[0] = cubicAt(x0, x1, x2, x3, t); + out[1] = cubicAt(y0, y1, y2, y3, t); + } + return Math.sqrt(d); + } + function quadraticAt(p0, p1, p2, t) { + var onet = 1 - t; + return onet * (onet * p0 + 2 * t * p1) + t * t * p2; + } + function quadraticDerivativeAt(p0, p1, p2, t) { + return 2 * ((1 - t) * (p1 - p0) + t * (p2 - p1)); + } + function quadraticRootAt(p0, p1, p2, val, roots) { + var a = p0 - 2 * p1 + p2; + var b = 2 * (p1 - p0); + var c = p0 - val; + var n = 0; + if (isAroundZero(a)) { + if (isNotAroundZero(b)) { + var t1 = -c / b; + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + } + } else { + var disc = b * b - 4 * a * c; + if (isAroundZero(disc)) { + var t1 = -b / (2 * a); + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + } else if (disc > 0) { + var discSqrt = Math.sqrt(disc); + var t1 = (-b + discSqrt) / (2 * a); + var t2 = (-b - discSqrt) / (2 * a); + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + if (t2 >= 0 && t2 <= 1) { + roots[n++] = t2; + } + } + } + return n; + } + function quadraticExtremum(p0, p1, p2) { + var divider = p0 + p2 - 2 * p1; + if (divider === 0) { + return 0.5; + } else { + return (p0 - p1) / divider; + } + } + function quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, out) { + var t; + var interval = 0.005; + var d = Infinity; + _v0[0] = x; + _v0[1] = y; + for (var _t = 0; _t < 1; _t += 0.05) { + _v1[0] = quadraticAt(x0, x1, x2, _t); + _v1[1] = quadraticAt(y0, y1, y2, _t); + var d1 = vector.distSquare(_v0, _v1); + if (d1 < d) { + t = _t; + d = d1; + } + } + d = Infinity; + for (var i = 0; i < 32; i++) { + if (interval < EPSILON) { + break; + } + var prev = t - interval; + var next = t + interval; + _v1[0] = quadraticAt(x0, x1, x2, prev); + _v1[1] = quadraticAt(y0, y1, y2, prev); + var d1 = vector.distSquare(_v1, _v0); + if (prev >= 0 && d1 < d) { + t = prev; + d = d1; + } else { + _v2[0] = quadraticAt(x0, x1, x2, next); + _v2[1] = quadraticAt(y0, y1, y2, next); + var d2 = vector.distSquare(_v2, _v0); + if (next <= 1 && d2 < d) { + t = next; + d = d2; + } else { + interval *= 0.5; + } + } + } + if (out) { + out[0] = quadraticAt(x0, x1, x2, t); + out[1] = quadraticAt(y0, y1, y2, t); + } + return Math.sqrt(d); + } + return { + cubicAt: cubicAt, + cubicDerivativeAt: cubicDerivativeAt, + cubicRootAt: cubicRootAt, + cubicExtrema: cubicExtrema, + cubicSubdivide: cubicSubdivide, + cubicProjectPoint: cubicProjectPoint, + quadraticAt: quadraticAt, + quadraticDerivativeAt: quadraticDerivativeAt, + quadraticRootAt: quadraticRootAt, + quadraticExtremum: quadraticExtremum, + quadraticProjectPoint: quadraticProjectPoint + }; +});define('zrender/mixin/Transformable', [ + 'require', + '../tool/matrix', + '../tool/vector' +], function (require) { + 'use strict'; + var matrix = require('../tool/matrix'); + var vector = require('../tool/vector'); + var origin = [ + 0, + 0 + ]; + var EPSILON = 0.00005; + function isAroundZero(val) { + return val > -EPSILON && val < EPSILON; + } + function isNotAroundZero(val) { + return val > EPSILON || val < -EPSILON; + } + var Transformable = function () { + if (!this.position) { + this.position = [ + 0, + 0 + ]; + } + if (typeof this.rotation == 'undefined') { + this.rotation = [ + 0, + 0, + 0 + ]; + } + if (!this.scale) { + this.scale = [ + 1, + 1, + 0, + 0 + ]; + } + this.needLocalTransform = false; + this.needTransform = false; + }; + Transformable.prototype = { + constructor: Transformable, + updateNeedTransform: function () { + this.needLocalTransform = isNotAroundZero(this.rotation[0]) || isNotAroundZero(this.position[0]) || isNotAroundZero(this.position[1]) || isNotAroundZero(this.scale[0] - 1) || isNotAroundZero(this.scale[1] - 1); + }, + updateTransform: function () { + this.updateNeedTransform(); + if (this.parent) { + this.needTransform = this.needLocalTransform || this.parent.needTransform; + } else { + this.needTransform = this.needLocalTransform; + } + if (!this.needTransform) { + return; + } + var m = this.transform || matrix.create(); + matrix.identity(m); + if (this.needLocalTransform) { + if (isNotAroundZero(this.scale[0]) || isNotAroundZero(this.scale[1])) { + origin[0] = -this.scale[2] || 0; + origin[1] = -this.scale[3] || 0; + var haveOrigin = isNotAroundZero(origin[0]) || isNotAroundZero(origin[1]); + if (haveOrigin) { + matrix.translate(m, m, origin); + } + matrix.scale(m, m, this.scale); + if (haveOrigin) { + origin[0] = -origin[0]; + origin[1] = -origin[1]; + matrix.translate(m, m, origin); + } + } + if (this.rotation instanceof Array) { + if (this.rotation[0] !== 0) { + origin[0] = -this.rotation[1] || 0; + origin[1] = -this.rotation[2] || 0; + var haveOrigin = isNotAroundZero(origin[0]) || isNotAroundZero(origin[1]); + if (haveOrigin) { + matrix.translate(m, m, origin); + } + matrix.rotate(m, m, this.rotation[0]); + if (haveOrigin) { + origin[0] = -origin[0]; + origin[1] = -origin[1]; + matrix.translate(m, m, origin); + } + } + } else { + if (this.rotation !== 0) { + matrix.rotate(m, m, this.rotation); + } + } + if (isNotAroundZero(this.position[0]) || isNotAroundZero(this.position[1])) { + matrix.translate(m, m, this.position); + } + } + this.transform = m; + if (this.parent && this.parent.needTransform) { + if (this.needLocalTransform) { + matrix.mul(this.transform, this.parent.transform, this.transform); + } else { + matrix.copy(this.transform, this.parent.transform); + } + } + }, + setTransform: function (ctx) { + if (this.needTransform) { + var m = this.transform; + ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]); + } + }, + lookAt: function () { + var v = vector.create(); + return function (target) { + if (!this.transform) { + this.transform = matrix.create(); + } + var m = this.transform; + vector.sub(v, target, this.position); + if (isAroundZero(v[0]) && isAroundZero(v[1])) { + return; + } + vector.normalize(v, v); + m[2] = v[0] * this.scale[1]; + m[3] = v[1] * this.scale[1]; + m[0] = v[1] * this.scale[0]; + m[1] = -v[0] * this.scale[0]; + m[4] = this.position[0]; + m[5] = this.position[1]; + this.decomposeTransform(); + }; + }(), + decomposeTransform: function () { + if (!this.transform) { + return; + } + var m = this.transform; + var sx = m[0] * m[0] + m[1] * m[1]; + var position = this.position; + var scale = this.scale; + var rotation = this.rotation; + if (isNotAroundZero(sx - 1)) { + sx = Math.sqrt(sx); + } + var sy = m[2] * m[2] + m[3] * m[3]; + if (isNotAroundZero(sy - 1)) { + sy = Math.sqrt(sy); + } + position[0] = m[4]; + position[1] = m[5]; + scale[0] = sx; + scale[1] = sy; + scale[2] = scale[3] = 0; + rotation[0] = Math.atan2(-m[1] / sy, m[0] / sx); + rotation[1] = rotation[2] = 0; + } + }; + return Transformable; +});define('zrender/Group', [ + 'require', + './tool/guid', + './tool/util', + './mixin/Transformable', + './mixin/Eventful' +], function (require) { + var guid = require('./tool/guid'); + var util = require('./tool/util'); + var Transformable = require('./mixin/Transformable'); + var Eventful = require('./mixin/Eventful'); + var Group = function (options) { + options = options || {}; + this.id = options.id || guid(); + for (var key in options) { + this[key] = options[key]; + } + this.type = 'group'; + this.clipShape = null; + this._children = []; + this._storage = null; + this.__dirty = true; + Transformable.call(this); + Eventful.call(this); + }; + Group.prototype.ignore = false; + Group.prototype.children = function () { + return this._children.slice(); + }; + Group.prototype.childAt = function (idx) { + return this._children[idx]; + }; + Group.prototype.addChild = function (child) { + if (child == this) { + return; + } + if (child.parent == this) { + return; + } + if (child.parent) { + child.parent.removeChild(child); + } + this._children.push(child); + child.parent = this; + if (this._storage && this._storage !== child._storage) { + this._storage.addToMap(child); + if (child instanceof Group) { + child.addChildrenToStorage(this._storage); + } + } + }; + Group.prototype.removeChild = function (child) { + var idx = util.indexOf(this._children, child); + this._children.splice(idx, 1); + child.parent = null; + if (this._storage) { + this._storage.delFromMap(child.id); + if (child instanceof Group) { + child.delChildrenFromStorage(this._storage); + } + } + }; + Group.prototype.clearChildren = function () { + for (var i = 0; i < this._children.length; i++) { + var child = this._children[i]; + if (this._storage) { + this._storage.delFromMap(child.id); + if (child instanceof Group) { + child.delChildrenFromStorage(this._storage); + } + } + } + this._children.length = 0; + }; + Group.prototype.eachChild = function (cb, context) { + var haveContext = !!context; + for (var i = 0; i < this._children.length; i++) { + var child = this._children[i]; + if (haveContext) { + cb.call(context, child); + } else { + cb(child); + } + } + }; + Group.prototype.traverse = function (cb, context) { + var haveContext = !!context; + for (var i = 0; i < this._children.length; i++) { + var child = this._children[i]; + if (haveContext) { + cb.call(context, child); + } else { + cb(child); + } + if (child.type === 'group') { + child.traverse(cb, context); + } + } + }; + Group.prototype.addChildrenToStorage = function (storage) { + for (var i = 0; i < this._children.length; i++) { + var child = this._children[i]; + storage.addToMap(child); + if (child instanceof Group) { + child.addChildrenToStorage(storage); + } + } + }; + Group.prototype.delChildrenFromStorage = function (storage) { + for (var i = 0; i < this._children.length; i++) { + var child = this._children[i]; + storage.delFromMap(child.id); + if (child instanceof Group) { + child.delChildrenFromStorage(storage); + } + } + }; + Group.prototype.modSelf = function () { + this.__dirty = true; + }; + util.merge(Group.prototype, Transformable.prototype, true); + util.merge(Group.prototype, Eventful.prototype, true); + return Group; +});define('zrender/animation/Clip', [ + 'require', + './easing' +], function (require) { + var Easing = require('./easing'); + function Clip(options) { + this._targetPool = options.target || {}; + if (!(this._targetPool instanceof Array)) { + this._targetPool = [this._targetPool]; + } + this._life = options.life || 1000; + this._delay = options.delay || 0; + this._startTime = new Date().getTime() + this._delay; + this._endTime = this._startTime + this._life * 1000; + this.loop = typeof options.loop == 'undefined' ? false : options.loop; + this.gap = options.gap || 0; + this.easing = options.easing || 'Linear'; + this.onframe = options.onframe; + this.ondestroy = options.ondestroy; + this.onrestart = options.onrestart; + } + Clip.prototype = { + step: function (time) { + var percent = (time - this._startTime) / this._life; + if (percent < 0) { + return; + } + percent = Math.min(percent, 1); + var easingFunc = typeof this.easing == 'string' ? Easing[this.easing] : this.easing; + var schedule = typeof easingFunc === 'function' ? easingFunc(percent) : percent; + this.fire('frame', schedule); + if (percent == 1) { + if (this.loop) { + this.restart(); + return 'restart'; + } + this._needsRemove = true; + return 'destroy'; + } + return null; + }, + restart: function () { + var time = new Date().getTime(); + var remainder = (time - this._startTime) % this._life; + this._startTime = new Date().getTime() - remainder + this.gap; + this._needsRemove = false; + }, + fire: function (eventType, arg) { + for (var i = 0, len = this._targetPool.length; i < len; i++) { + if (this['on' + eventType]) { + this['on' + eventType](this._targetPool[i], arg); + } + } + }, + constructor: Clip + }; + return Clip; +});define('zrender/animation/easing', [], function () { + var easing = { + Linear: function (k) { + return k; + }, + QuadraticIn: function (k) { + return k * k; + }, + QuadraticOut: function (k) { + return k * (2 - k); + }, + QuadraticInOut: function (k) { + if ((k *= 2) < 1) { + return 0.5 * k * k; + } + return -0.5 * (--k * (k - 2) - 1); + }, + CubicIn: function (k) { + return k * k * k; + }, + CubicOut: function (k) { + return --k * k * k + 1; + }, + CubicInOut: function (k) { + if ((k *= 2) < 1) { + return 0.5 * k * k * k; + } + return 0.5 * ((k -= 2) * k * k + 2); + }, + QuarticIn: function (k) { + return k * k * k * k; + }, + QuarticOut: function (k) { + return 1 - --k * k * k * k; + }, + QuarticInOut: function (k) { + if ((k *= 2) < 1) { + return 0.5 * k * k * k * k; + } + return -0.5 * ((k -= 2) * k * k * k - 2); + }, + QuinticIn: function (k) { + return k * k * k * k * k; + }, + QuinticOut: function (k) { + return --k * k * k * k * k + 1; + }, + QuinticInOut: function (k) { + if ((k *= 2) < 1) { + return 0.5 * k * k * k * k * k; + } + return 0.5 * ((k -= 2) * k * k * k * k + 2); + }, + SinusoidalIn: function (k) { + return 1 - Math.cos(k * Math.PI / 2); + }, + SinusoidalOut: function (k) { + return Math.sin(k * Math.PI / 2); + }, + SinusoidalInOut: function (k) { + return 0.5 * (1 - Math.cos(Math.PI * k)); + }, + ExponentialIn: function (k) { + return k === 0 ? 0 : Math.pow(1024, k - 1); + }, + ExponentialOut: function (k) { + return k === 1 ? 1 : 1 - Math.pow(2, -10 * k); + }, + ExponentialInOut: function (k) { + if (k === 0) { + return 0; + } + if (k === 1) { + return 1; + } + if ((k *= 2) < 1) { + return 0.5 * Math.pow(1024, k - 1); + } + return 0.5 * (-Math.pow(2, -10 * (k - 1)) + 2); + }, + CircularIn: function (k) { + return 1 - Math.sqrt(1 - k * k); + }, + CircularOut: function (k) { + return Math.sqrt(1 - --k * k); + }, + CircularInOut: function (k) { + if ((k *= 2) < 1) { + return -0.5 * (Math.sqrt(1 - k * k) - 1); + } + return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1); + }, + ElasticIn: function (k) { + var s; + var a = 0.1; + var p = 0.4; + if (k === 0) { + return 0; + } + if (k === 1) { + return 1; + } + if (!a || a < 1) { + a = 1; + s = p / 4; + } else { + s = p * Math.asin(1 / a) / (2 * Math.PI); + } + return -(a * Math.pow(2, 10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p)); + }, + ElasticOut: function (k) { + var s; + var a = 0.1; + var p = 0.4; + if (k === 0) { + return 0; + } + if (k === 1) { + return 1; + } + if (!a || a < 1) { + a = 1; + s = p / 4; + } else { + s = p * Math.asin(1 / a) / (2 * Math.PI); + } + return a * Math.pow(2, -10 * k) * Math.sin((k - s) * (2 * Math.PI) / p) + 1; + }, + ElasticInOut: function (k) { + var s; + var a = 0.1; + var p = 0.4; + if (k === 0) { + return 0; + } + if (k === 1) { + return 1; + } + if (!a || a < 1) { + a = 1; + s = p / 4; + } else { + s = p * Math.asin(1 / a) / (2 * Math.PI); + } + if ((k *= 2) < 1) { + return -0.5 * (a * Math.pow(2, 10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p)); + } + return a * Math.pow(2, -10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p) * 0.5 + 1; + }, + BackIn: function (k) { + var s = 1.70158; + return k * k * ((s + 1) * k - s); + }, + BackOut: function (k) { + var s = 1.70158; + return --k * k * ((s + 1) * k + s) + 1; + }, + BackInOut: function (k) { + var s = 1.70158 * 1.525; + if ((k *= 2) < 1) { + return 0.5 * (k * k * ((s + 1) * k - s)); + } + return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2); + }, + BounceIn: function (k) { + return 1 - easing.BounceOut(1 - k); + }, + BounceOut: function (k) { + if (k < 1 / 2.75) { + return 7.5625 * k * k; + } else if (k < 2 / 2.75) { + return 7.5625 * (k -= 1.5 / 2.75) * k + 0.75; + } else if (k < 2.5 / 2.75) { + return 7.5625 * (k -= 2.25 / 2.75) * k + 0.9375; + } else { + return 7.5625 * (k -= 2.625 / 2.75) * k + 0.984375; + } + }, + BounceInOut: function (k) { + if (k < 0.5) { + return easing.BounceIn(k * 2) * 0.5; + } + return easing.BounceOut(k * 2 - 1) * 0.5 + 0.5; + } + }; + return easing; +});define('echarts/chart/base', [ + 'require', + 'zrender/shape/Image', + '../util/shape/Icon', + '../util/shape/MarkLine', + '../util/shape/Symbol', + '../config', + '../util/ecData', + '../util/ecAnimation', + '../util/ecEffect', + '../util/accMath', + '../component/base', + 'zrender/tool/util', + 'zrender/tool/area' +], function (require) { + var ImageShape = require('zrender/shape/Image'); + var IconShape = require('../util/shape/Icon'); + var MarkLineShape = require('../util/shape/MarkLine'); + var SymbolShape = require('../util/shape/Symbol'); + var ecConfig = require('../config'); + var ecData = require('../util/ecData'); + var ecAnimation = require('../util/ecAnimation'); + var ecEffect = require('../util/ecEffect'); + var accMath = require('../util/accMath'); + var ComponentBase = require('../component/base'); + var zrUtil = require('zrender/tool/util'); + var zrArea = require('zrender/tool/area'); + function Base(ecTheme, messageCenter, zr, option, myChart) { + ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); + var self = this; + this.selectedMap = {}; + this.lastShapeList = []; + this.shapeHandler = { + onclick: function () { + self.isClick = true; + }, + ondragover: function (param) { + var calculableShape = param.target; + calculableShape.highlightStyle = calculableShape.highlightStyle || {}; + var highlightStyle = calculableShape.highlightStyle; + var brushType = highlightStyle.brushTyep; + var strokeColor = highlightStyle.strokeColor; + var lineWidth = highlightStyle.lineWidth; + highlightStyle.brushType = 'stroke'; + highlightStyle.strokeColor = self.ecTheme.calculableColor || ecConfig.calculableColor; + highlightStyle.lineWidth = calculableShape.type === 'icon' ? 30 : 10; + self.zr.addHoverShape(calculableShape); + setTimeout(function () { + if (highlightStyle) { + highlightStyle.brushType = brushType; + highlightStyle.strokeColor = strokeColor; + highlightStyle.lineWidth = lineWidth; + } + }, 20); + }, + ondrop: function (param) { + if (ecData.get(param.dragged, 'data') != null) { + self.isDrop = true; + } + }, + ondragend: function () { + self.isDragend = true; + } + }; + } + Base.prototype = { + setCalculable: function (shape) { + shape.dragEnableTime = this.ecTheme.DRAG_ENABLE_TIME || ecConfig.DRAG_ENABLE_TIME; + shape.ondragover = this.shapeHandler.ondragover; + shape.ondragend = this.shapeHandler.ondragend; + shape.ondrop = this.shapeHandler.ondrop; + return shape; + }, + ondrop: function (param, status) { + if (!this.isDrop || !param.target || status.dragIn) { + return; + } + var target = param.target; + var dragged = param.dragged; + var seriesIndex = ecData.get(target, 'seriesIndex'); + var dataIndex = ecData.get(target, 'dataIndex'); + var series = this.series; + var data; + var legend = this.component.legend; + if (dataIndex === -1) { + if (ecData.get(dragged, 'seriesIndex') == seriesIndex) { + status.dragOut = status.dragIn = status.needRefresh = true; + this.isDrop = false; + return; + } + data = { + value: ecData.get(dragged, 'value'), + name: ecData.get(dragged, 'name') + }; + if (this.type === ecConfig.CHART_TYPE_PIE && data.value < 0) { + data.value = 0; + } + var hasFind = false; + var sData = series[seriesIndex].data; + for (var i = 0, l = sData.length; i < l; i++) { + if (sData[i].name === data.name && sData[i].value === '-') { + series[seriesIndex].data[i].value = data.value; + hasFind = true; + } + } + !hasFind && series[seriesIndex].data.push(data); + legend && legend.add(data.name, dragged.style.color || dragged.style.strokeColor); + } else { + data = series[seriesIndex].data[dataIndex] || '-'; + if (data.value != null) { + if (data.value != '-') { + series[seriesIndex].data[dataIndex].value = accMath.accAdd(series[seriesIndex].data[dataIndex].value, ecData.get(dragged, 'value')); + } else { + series[seriesIndex].data[dataIndex].value = ecData.get(dragged, 'value'); + } + if (this.type === ecConfig.CHART_TYPE_FUNNEL || this.type === ecConfig.CHART_TYPE_PIE) { + legend && legend.getRelatedAmount(data.name) === 1 && this.component.legend.del(data.name); + data.name += this.option.nameConnector + ecData.get(dragged, 'name'); + legend && legend.add(data.name, dragged.style.color || dragged.style.strokeColor); + } + } else { + if (data != '-') { + series[seriesIndex].data[dataIndex] = accMath.accAdd(series[seriesIndex].data[dataIndex], ecData.get(dragged, 'value')); + } else { + series[seriesIndex].data[dataIndex] = ecData.get(dragged, 'value'); + } + } + } + status.dragIn = status.dragIn || true; + this.isDrop = false; + var self = this; + setTimeout(function () { + self.zr.trigger('mousemove', param.event); + }, 300); + return; + }, + ondragend: function (param, status) { + if (!this.isDragend || !param.target || status.dragOut) { + return; + } + var target = param.target; + var seriesIndex = ecData.get(target, 'seriesIndex'); + var dataIndex = ecData.get(target, 'dataIndex'); + var series = this.series; + if (series[seriesIndex].data[dataIndex].value != null) { + series[seriesIndex].data[dataIndex].value = '-'; + var name = series[seriesIndex].data[dataIndex].name; + var legend = this.component.legend; + if (legend && legend.getRelatedAmount(name) === 0) { + legend.del(name); + } + } else { + series[seriesIndex].data[dataIndex] = '-'; + } + status.dragOut = true; + status.needRefresh = true; + this.isDragend = false; + return; + }, + onlegendSelected: function (param, status) { + var legendSelected = param.selected; + for (var itemName in this.selectedMap) { + if (this.selectedMap[itemName] != legendSelected[itemName]) { + status.needRefresh = true; + } + this.selectedMap[itemName] = legendSelected[itemName]; + } + return; + }, + _buildPosition: function () { + this._symbol = this.option.symbolList; + this._sIndex2ShapeMap = {}; + this._sIndex2ColorMap = {}; + this.selectedMap = {}; + this.xMarkMap = {}; + var series = this.series; + var _position2sIndexMap = { + top: [], + bottom: [], + left: [], + right: [], + other: [] + }; + var xAxisIndex; + var yAxisIndex; + var xAxis; + var yAxis; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type === this.type) { + series[i] = this.reformOption(series[i]); + this.legendHoverLink = series[i].legendHoverLink || this.legendHoverLink; + xAxisIndex = series[i].xAxisIndex; + yAxisIndex = series[i].yAxisIndex; + xAxis = this.component.xAxis.getAxis(xAxisIndex); + yAxis = this.component.yAxis.getAxis(yAxisIndex); + if (xAxis.type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY) { + _position2sIndexMap[xAxis.getPosition()].push(i); + } else if (yAxis.type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY) { + _position2sIndexMap[yAxis.getPosition()].push(i); + } else { + _position2sIndexMap.other.push(i); + } + } + } + for (var position in _position2sIndexMap) { + if (_position2sIndexMap[position].length > 0) { + this._buildSinglePosition(position, _position2sIndexMap[position]); + } + } + this.addShapeList(); + }, + _buildSinglePosition: function (position, seriesArray) { + var mapData = this._mapData(seriesArray); + var locationMap = mapData.locationMap; + var maxDataLength = mapData.maxDataLength; + if (maxDataLength === 0 || locationMap.length === 0) { + return; + } + switch (position) { + case 'bottom': + case 'top': + this._buildHorizontal(seriesArray, maxDataLength, locationMap, this.xMarkMap); + break; + case 'left': + case 'right': + this._buildVertical(seriesArray, maxDataLength, locationMap, this.xMarkMap); + break; + case 'other': + this._buildOther(seriesArray, maxDataLength, locationMap, this.xMarkMap); + break; + } + for (var i = 0, l = seriesArray.length; i < l; i++) { + this.buildMark(seriesArray[i]); + } + }, + _mapData: function (seriesArray) { + var series = this.series; + var serie; + var dataIndex = 0; + var stackMap = {}; + var magicStackKey = '__kener__stack__'; + var stackKey; + var serieName; + var legend = this.component.legend; + var locationMap = []; + var maxDataLength = 0; + var iconShape; + for (var i = 0, l = seriesArray.length; i < l; i++) { + serie = series[seriesArray[i]]; + serieName = serie.name; + this._sIndex2ShapeMap[seriesArray[i]] = this._sIndex2ShapeMap[seriesArray[i]] || this.query(serie, 'symbol') || this._symbol[i % this._symbol.length]; + if (legend) { + this.selectedMap[serieName] = legend.isSelected(serieName); + this._sIndex2ColorMap[seriesArray[i]] = legend.getColor(serieName); + iconShape = legend.getItemShape(serieName); + if (iconShape) { + var style = iconShape.style; + if (this.type == ecConfig.CHART_TYPE_LINE) { + style.iconType = 'legendLineIcon'; + style.symbol = this._sIndex2ShapeMap[seriesArray[i]]; + } else if (serie.itemStyle.normal.barBorderWidth > 0) { + var highlightStyle = iconShape.highlightStyle; + style.brushType = 'both'; + style.x += 1; + style.y += 1; + style.width -= 2; + style.height -= 2; + style.strokeColor = highlightStyle.strokeColor = serie.itemStyle.normal.barBorderColor; + highlightStyle.lineWidth = 3; + } + legend.setItemShape(serieName, iconShape); + } + } else { + this.selectedMap[serieName] = true; + this._sIndex2ColorMap[seriesArray[i]] = this.zr.getColor(seriesArray[i]); + } + if (this.selectedMap[serieName]) { + stackKey = serie.stack || magicStackKey + seriesArray[i]; + if (stackMap[stackKey] == null) { + stackMap[stackKey] = dataIndex; + locationMap[dataIndex] = [seriesArray[i]]; + dataIndex++; + } else { + locationMap[stackMap[stackKey]].push(seriesArray[i]); + } + } + maxDataLength = Math.max(maxDataLength, serie.data.length); + } + return { + locationMap: locationMap, + maxDataLength: maxDataLength + }; + }, + _calculMarkMapXY: function (xMarkMap, locationMap, xy) { + var series = this.series; + for (var j = 0, k = locationMap.length; j < k; j++) { + for (var m = 0, n = locationMap[j].length; m < n; m++) { + var seriesIndex = locationMap[j][m]; + var valueIndex = xy == 'xy' ? 0 : ''; + var grid = this.component.grid; + var tarMark = xMarkMap[seriesIndex]; + if (xy.indexOf('x') != '-1') { + if (tarMark['counter' + valueIndex] > 0) { + tarMark['average' + valueIndex] = tarMark['sum' + valueIndex] / tarMark['counter' + valueIndex]; + } + var x = this.component.xAxis.getAxis(series[seriesIndex].xAxisIndex || 0).getCoord(tarMark['average' + valueIndex]); + tarMark['averageLine' + valueIndex] = [ + [ + x, + grid.getYend() + ], + [ + x, + grid.getY() + ] + ]; + tarMark['minLine' + valueIndex] = [ + [ + tarMark['minX' + valueIndex], + grid.getYend() + ], + [ + tarMark['minX' + valueIndex], + grid.getY() + ] + ]; + tarMark['maxLine' + valueIndex] = [ + [ + tarMark['maxX' + valueIndex], + grid.getYend() + ], + [ + tarMark['maxX' + valueIndex], + grid.getY() + ] + ]; + tarMark.isHorizontal = false; + } + valueIndex = xy == 'xy' ? 1 : ''; + if (xy.indexOf('y') != '-1') { + if (tarMark['counter' + valueIndex] > 0) { + tarMark['average' + valueIndex] = tarMark['sum' + valueIndex] / tarMark['counter' + valueIndex]; + } + var y = this.component.yAxis.getAxis(series[seriesIndex].yAxisIndex || 0).getCoord(tarMark['average' + valueIndex]); + tarMark['averageLine' + valueIndex] = [ + [ + grid.getX(), + y + ], + [ + grid.getXend(), + y + ] + ]; + tarMark['minLine' + valueIndex] = [ + [ + grid.getX(), + tarMark['minY' + valueIndex] + ], + [ + grid.getXend(), + tarMark['minY' + valueIndex] + ] + ]; + tarMark['maxLine' + valueIndex] = [ + [ + grid.getX(), + tarMark['maxY' + valueIndex] + ], + [ + grid.getXend(), + tarMark['maxY' + valueIndex] + ] + ]; + tarMark.isHorizontal = true; + } + } + } + }, + addLabel: function (tarShape, serie, data, name, orient) { + var queryTarget = [ + data, + serie + ]; + var nLabel = this.deepMerge(queryTarget, 'itemStyle.normal.label'); + var eLabel = this.deepMerge(queryTarget, 'itemStyle.emphasis.label'); + var nTextStyle = nLabel.textStyle || {}; + var eTextStyle = eLabel.textStyle || {}; + if (nLabel.show) { + var style = tarShape.style; + style.text = this._getLabelText(serie, data, name, 'normal'); + style.textPosition = nLabel.position == null ? orient === 'horizontal' ? 'right' : 'top' : nLabel.position; + style.textColor = nTextStyle.color; + style.textFont = this.getFont(nTextStyle); + style.textAlign = nTextStyle.align; + style.textBaseline = nTextStyle.baseline; + } + if (eLabel.show) { + var highlightStyle = tarShape.highlightStyle; + highlightStyle.text = this._getLabelText(serie, data, name, 'emphasis'); + highlightStyle.textPosition = nLabel.show ? tarShape.style.textPosition : eLabel.position == null ? orient === 'horizontal' ? 'right' : 'top' : eLabel.position; + highlightStyle.textColor = eTextStyle.color; + highlightStyle.textFont = this.getFont(eTextStyle); + highlightStyle.textAlign = eTextStyle.align; + highlightStyle.textBaseline = eTextStyle.baseline; + } + return tarShape; + }, + _getLabelText: function (serie, data, name, status) { + var formatter = this.deepQuery([ + data, + serie + ], 'itemStyle.' + status + '.label.formatter'); + if (!formatter && status === 'emphasis') { + formatter = this.deepQuery([ + data, + serie + ], 'itemStyle.normal.label.formatter'); + } + var value = this.getDataFromOption(data, '-'); + if (formatter) { + if (typeof formatter === 'function') { + return formatter.call(this.myChart, { + seriesName: serie.name, + series: serie, + name: name, + value: value, + data: data, + status: status + }); + } else if (typeof formatter === 'string') { + formatter = formatter.replace('{a}', '{a0}').replace('{b}', '{b0}').replace('{c}', '{c0}').replace('{a0}', serie.name).replace('{b0}', name).replace('{c0}', this.numAddCommas(value)); + return formatter; + } + } else { + if (value instanceof Array) { + return value[2] != null ? this.numAddCommas(value[2]) : value[0] + ' , ' + value[1]; + } else { + return this.numAddCommas(value); + } + } + }, + buildMark: function (seriesIndex) { + var serie = this.series[seriesIndex]; + if (this.selectedMap[serie.name]) { + serie.markLine && this._buildMarkLine(seriesIndex); + serie.markPoint && this._buildMarkPoint(seriesIndex); + } + }, + _buildMarkPoint: function (seriesIndex) { + var attachStyle = (this.markAttachStyle || {})[seriesIndex]; + var serie = this.series[seriesIndex]; + var mpData; + var pos; + var markPoint = zrUtil.clone(serie.markPoint); + for (var i = 0, l = markPoint.data.length; i < l; i++) { + mpData = markPoint.data[i]; + pos = this.getMarkCoord(seriesIndex, mpData); + mpData.x = mpData.x != null ? mpData.x : pos[0]; + mpData.y = mpData.y != null ? mpData.y : pos[1]; + if (mpData.type && (mpData.type === 'max' || mpData.type === 'min')) { + mpData.value = pos[3]; + mpData.name = mpData.name || mpData.type; + mpData.symbolSize = mpData.symbolSize || zrArea.getTextWidth(pos[3], this.getFont()) / 2 + 5; + } + } + var shapeList = this._markPoint(seriesIndex, markPoint); + for (var i = 0, l = shapeList.length; i < l; i++) { + var tarShape = shapeList[i]; + tarShape.zlevel = this.getZlevelBase(); + tarShape.z = this.getZBase() + 1; + for (var key in attachStyle) { + tarShape[key] = zrUtil.clone(attachStyle[key]); + } + this.shapeList.push(tarShape); + } + if (this.type === ecConfig.CHART_TYPE_FORCE || this.type === ecConfig.CHART_TYPE_CHORD) { + for (var i = 0, l = shapeList.length; i < l; i++) { + this.zr.addShape(shapeList[i]); + } + } + }, + _buildMarkLine: function (seriesIndex) { + var attachStyle = (this.markAttachStyle || {})[seriesIndex]; + var serie = this.series[seriesIndex]; + var pos; + var markLine = zrUtil.clone(serie.markLine); + for (var i = 0, l = markLine.data.length; i < l; i++) { + var mlData = markLine.data[i]; + if (mlData.type && (mlData.type === 'max' || mlData.type === 'min' || mlData.type === 'average')) { + pos = this.getMarkCoord(seriesIndex, mlData); + markLine.data[i] = [ + zrUtil.clone(mlData), + {} + ]; + markLine.data[i][0].name = mlData.name || mlData.type; + markLine.data[i][0].value = mlData.type !== 'average' ? pos[3] : +pos[3].toFixed(markLine.precision != null ? markLine.precision : this.deepQuery([ + this.ecTheme, + ecConfig + ], 'markLine.precision')); + pos = pos[2]; + mlData = [ + {}, + {} + ]; + } else { + pos = [ + this.getMarkCoord(seriesIndex, mlData[0]), + this.getMarkCoord(seriesIndex, mlData[1]) + ]; + } + if (pos == null || pos[0] == null || pos[1] == null) { + continue; + } + markLine.data[i][0].x = mlData[0].x != null ? mlData[0].x : pos[0][0]; + markLine.data[i][0].y = mlData[0].y != null ? mlData[0].y : pos[0][1]; + markLine.data[i][1].x = mlData[1].x != null ? mlData[1].x : pos[1][0]; + markLine.data[i][1].y = mlData[1].y != null ? mlData[1].y : pos[1][1]; + } + var shapeList = this._markLine(seriesIndex, markLine); + for (var i = 0, l = shapeList.length; i < l; i++) { + var tarShape = shapeList[i]; + tarShape.zlevel = this.getZlevelBase(); + tarShape.z = this.getZBase() + 1; + for (var key in attachStyle) { + tarShape[key] = zrUtil.clone(attachStyle[key]); + } + this.shapeList.push(tarShape); + } + if (this.type === ecConfig.CHART_TYPE_FORCE || this.type === ecConfig.CHART_TYPE_CHORD) { + for (var i = 0, l = shapeList.length; i < l; i++) { + this.zr.addShape(shapeList[i]); + } + } + }, + _markPoint: function (seriesIndex, mpOption) { + var serie = this.series[seriesIndex]; + var component = this.component; + zrUtil.merge(zrUtil.merge(mpOption, zrUtil.clone(this.ecTheme.markPoint || {})), zrUtil.clone(ecConfig.markPoint)); + mpOption.name = serie.name; + var pList = []; + var data = mpOption.data; + var itemShape; + var dataRange = component.dataRange; + var legend = component.legend; + var color; + var value; + var queryTarget; + var nColor; + var eColor; + var effect; + var zrWidth = this.zr.getWidth(); + var zrHeight = this.zr.getHeight(); + if (!mpOption.large) { + for (var i = 0, l = data.length; i < l; i++) { + if (data[i].x == null || data[i].y == null) { + continue; + } + value = data[i].value != null ? data[i].value : ''; + if (legend) { + color = legend.getColor(serie.name); + } + if (dataRange) { + color = isNaN(value) ? color : dataRange.getColor(value); + queryTarget = [ + data[i], + mpOption + ]; + nColor = this.deepQuery(queryTarget, 'itemStyle.normal.color') || color; + eColor = this.deepQuery(queryTarget, 'itemStyle.emphasis.color') || nColor; + if (nColor == null && eColor == null) { + continue; + } + } + color = color == null ? this.zr.getColor(seriesIndex) : color; + data[i].tooltip = data[i].tooltip || mpOption.tooltip || { trigger: 'item' }; + data[i].name = data[i].name != null ? data[i].name : ''; + data[i].value = value; + itemShape = this.getSymbolShape(mpOption, seriesIndex, data[i], i, data[i].name, this.parsePercent(data[i].x, zrWidth), this.parsePercent(data[i].y, zrHeight), 'pin', color, 'rgba(0,0,0,0)', 'horizontal'); + itemShape._mark = 'point'; + effect = this.deepMerge([ + data[i], + mpOption + ], 'effect'); + if (effect.show) { + itemShape.effect = effect; + } + if (serie.type === ecConfig.CHART_TYPE_MAP) { + itemShape._geo = this.getMarkGeo(data[i]); + } + ecData.pack(itemShape, serie, seriesIndex, data[i], i, data[i].name, value); + pList.push(itemShape); + } + } else { + itemShape = this.getLargeMarkPoingShape(seriesIndex, mpOption); + itemShape._mark = 'largePoint'; + itemShape && pList.push(itemShape); + } + return pList; + }, + _markLine: function (seriesIndex, mlOption) { + var serie = this.series[seriesIndex]; + var component = this.component; + zrUtil.merge(zrUtil.merge(mlOption, zrUtil.clone(this.ecTheme.markLine || {})), zrUtil.clone(ecConfig.markLine)); + mlOption.symbol = mlOption.symbol instanceof Array ? mlOption.symbol.length > 1 ? mlOption.symbol : [ + mlOption.symbol[0], + mlOption.symbol[0] + ] : [ + mlOption.symbol, + mlOption.symbol + ]; + mlOption.symbolSize = mlOption.symbolSize instanceof Array ? mlOption.symbolSize.length > 1 ? mlOption.symbolSize : [ + mlOption.symbolSize[0], + mlOption.symbolSize[0] + ] : [ + mlOption.symbolSize, + mlOption.symbolSize + ]; + mlOption.symbolRotate = mlOption.symbolRotate instanceof Array ? mlOption.symbolRotate.length > 1 ? mlOption.symbolRotate : [ + mlOption.symbolRotate[0], + mlOption.symbolRotate[0] + ] : [ + mlOption.symbolRotate, + mlOption.symbolRotate + ]; + mlOption.name = serie.name; + var pList = []; + var data = mlOption.data; + var itemShape; + var dataRange = component.dataRange; + var legend = component.legend; + var color; + var value; + var queryTarget; + var nColor; + var eColor; + var effect; + var zrWidth = this.zr.getWidth(); + var zrHeight = this.zr.getHeight(); + var mergeData; + for (var i = 0, l = data.length; i < l; i++) { + var mlData = data[i]; + if (mlData[0].x == null || mlData[0].y == null || mlData[1].x == null || mlData[1].y == null) { + continue; + } + color = legend ? legend.getColor(serie.name) : this.zr.getColor(seriesIndex); + mergeData = this.deepMerge(mlData); + value = mergeData.value != null ? mergeData.value : ''; + if (dataRange) { + color = isNaN(value) ? color : dataRange.getColor(value); + queryTarget = [ + mergeData, + mlOption + ]; + nColor = this.deepQuery(queryTarget, 'itemStyle.normal.color') || color; + eColor = this.deepQuery(queryTarget, 'itemStyle.emphasis.color') || nColor; + if (nColor == null && eColor == null) { + continue; + } + } + mlData[0].tooltip = mergeData.tooltip || mlOption.tooltip || { trigger: 'item' }; + mlData[0].name = mlData[0].name != null ? mlData[0].name : ''; + mlData[1].name = mlData[1].name != null ? mlData[1].name : ''; + mlData[0].value = value; + itemShape = this.getLineMarkShape(mlOption, seriesIndex, mlData, i, this.parsePercent(mlData[0].x, zrWidth), this.parsePercent(mlData[0].y, zrHeight), this.parsePercent(mlData[1].x, zrWidth), this.parsePercent(mlData[1].y, zrHeight), color); + itemShape._mark = 'line'; + effect = this.deepMerge([ + mergeData, + mlOption + ], 'effect'); + if (effect.show) { + itemShape.effect = effect; + } + if (serie.type === ecConfig.CHART_TYPE_MAP) { + itemShape._geo = [ + this.getMarkGeo(mlData[0]), + this.getMarkGeo(mlData[1]) + ]; + } + ecData.pack(itemShape, serie, seriesIndex, mlData[0], i, mlData[0].name + (mlData[1].name !== '' ? ' > ' + mlData[1].name : ''), value); + pList.push(itemShape); + } + return pList; + }, + getMarkCoord: function () { + return [ + 0, + 0 + ]; + }, + getSymbolShape: function (serie, seriesIndex, data, dataIndex, name, x, y, symbol, color, emptyColor, orient) { + var queryTarget = [ + data, + serie + ]; + var value = this.getDataFromOption(data, '-'); + symbol = this.deepQuery(queryTarget, 'symbol') || symbol; + var symbolSize = this.deepQuery(queryTarget, 'symbolSize'); + symbolSize = typeof symbolSize === 'function' ? symbolSize(value) : symbolSize; + var symbolRotate = this.deepQuery(queryTarget, 'symbolRotate'); + var normal = this.deepMerge(queryTarget, 'itemStyle.normal'); + var emphasis = this.deepMerge(queryTarget, 'itemStyle.emphasis'); + var nBorderWidth = normal.borderWidth != null ? normal.borderWidth : normal.lineStyle && normal.lineStyle.width; + if (nBorderWidth == null) { + nBorderWidth = symbol.match('empty') ? 2 : 0; + } + var eBorderWidth = emphasis.borderWidth != null ? emphasis.borderWidth : emphasis.lineStyle && emphasis.lineStyle.width; + if (eBorderWidth == null) { + eBorderWidth = nBorderWidth + 2; + } + var itemShape = new IconShape({ + style: { + iconType: symbol.replace('empty', '').toLowerCase(), + x: x - symbolSize, + y: y - symbolSize, + width: symbolSize * 2, + height: symbolSize * 2, + brushType: 'both', + color: symbol.match('empty') ? emptyColor : this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) || color, + strokeColor: normal.borderColor || this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) || color, + lineWidth: nBorderWidth + }, + highlightStyle: { + color: symbol.match('empty') ? emptyColor : this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data), + strokeColor: emphasis.borderColor || normal.borderColor || this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) || color, + lineWidth: eBorderWidth + }, + clickable: this.deepQuery(queryTarget, 'clickable') + }); + if (symbol.match('image')) { + itemShape.style.image = symbol.replace(new RegExp('^image:\\/\\/'), ''); + itemShape = new ImageShape({ + style: itemShape.style, + highlightStyle: itemShape.highlightStyle, + clickable: this.deepQuery(queryTarget, 'clickable') + }); + } + if (symbolRotate != null) { + itemShape.rotation = [ + symbolRotate * Math.PI / 180, + x, + y + ]; + } + if (symbol.match('star')) { + itemShape.style.iconType = 'star'; + itemShape.style.n = symbol.replace('empty', '').replace('star', '') - 0 || 5; + } + if (symbol === 'none') { + itemShape.invisible = true; + itemShape.hoverable = false; + } + itemShape = this.addLabel(itemShape, serie, data, name, orient); + if (symbol.match('empty')) { + if (itemShape.style.textColor == null) { + itemShape.style.textColor = itemShape.style.strokeColor; + } + if (itemShape.highlightStyle.textColor == null) { + itemShape.highlightStyle.textColor = itemShape.highlightStyle.strokeColor; + } + } + ecData.pack(itemShape, serie, seriesIndex, data, dataIndex, name); + itemShape._x = x; + itemShape._y = y; + itemShape._dataIndex = dataIndex; + itemShape._seriesIndex = seriesIndex; + return itemShape; + }, + getLineMarkShape: function (mlOption, seriesIndex, data, dataIndex, xStart, yStart, xEnd, yEnd, color) { + var value0 = data[0].value != null ? data[0].value : '-'; + var value1 = data[1].value != null ? data[1].value : '-'; + var symbol = [ + this.query(data[0], 'symbol') || mlOption.symbol[0], + this.query(data[1], 'symbol') || mlOption.symbol[1] + ]; + var symbolSize = [ + this.query(data[0], 'symbolSize') || mlOption.symbolSize[0], + this.query(data[1], 'symbolSize') || mlOption.symbolSize[1] + ]; + symbolSize[0] = typeof symbolSize[0] === 'function' ? symbolSize[0](value0) : symbolSize[0]; + symbolSize[1] = typeof symbolSize[1] === 'function' ? symbolSize[1](value1) : symbolSize[1]; + var symbolRotate = [ + this.query(data[0], 'symbolRotate') || mlOption.symbolRotate[0], + this.query(data[1], 'symbolRotate') || mlOption.symbolRotate[1] + ]; + var queryTarget = [ + data[0], + data[1], + mlOption + ]; + var normal = this.deepMerge(queryTarget, 'itemStyle.normal'); + normal.color = this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data); + var emphasis = this.deepMerge(queryTarget, 'itemStyle.emphasis'); + emphasis.color = this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data); + var nlineStyle = normal.lineStyle; + var elineStyle = emphasis.lineStyle; + var nBorderWidth = nlineStyle.width; + if (nBorderWidth == null) { + nBorderWidth = normal.borderWidth; + } + var eBorderWidth = elineStyle.width; + if (eBorderWidth == null) { + eBorderWidth = emphasis.borderWidth != null ? emphasis.borderWidth : nBorderWidth + 2; + } + var itemShape = new MarkLineShape({ + style: { + smooth: this.deepQuery([ + data[0], + data[1], + mlOption + ], 'smooth') ? 'spline' : false, + smoothRadian: this.deepQuery([ + data[0], + data[1], + mlOption + ], 'smoothRadian'), + symbol: symbol, + symbolSize: symbolSize, + symbolRotate: symbolRotate, + xStart: xStart, + yStart: yStart, + xEnd: xEnd, + yEnd: yEnd, + brushType: 'both', + lineType: nlineStyle.type, + shadowColor: nlineStyle.shadowColor || nlineStyle.color || normal.borderColor || normal.color || color, + shadowBlur: nlineStyle.shadowBlur, + shadowOffsetX: nlineStyle.shadowOffsetX, + shadowOffsetY: nlineStyle.shadowOffsetY, + color: normal.color || color, + strokeColor: nlineStyle.color || normal.borderColor || normal.color || color, + lineWidth: nBorderWidth, + symbolBorderColor: normal.borderColor || normal.color || color, + symbolBorder: normal.borderWidth + }, + highlightStyle: { + shadowColor: elineStyle.shadowColor, + shadowBlur: elineStyle.shadowBlur, + shadowOffsetX: elineStyle.shadowOffsetX, + shadowOffsetY: elineStyle.shadowOffsetY, + color: emphasis.color || normal.color || color, + strokeColor: elineStyle.color || nlineStyle.color || emphasis.borderColor || normal.borderColor || emphasis.color || normal.color || color, + lineWidth: eBorderWidth, + symbolBorderColor: emphasis.borderColor || normal.borderColor || emphasis.color || normal.color || color, + symbolBorder: emphasis.borderWidth == null ? normal.borderWidth + 2 : emphasis.borderWidth + }, + clickable: this.deepQuery(queryTarget, 'clickable') + }); + itemShape = this.addLabel(itemShape, mlOption, data[0], data[0].name + ' : ' + data[1].name); + itemShape._x = xEnd; + itemShape._y = yEnd; + return itemShape; + }, + getLargeMarkPoingShape: function (seriesIndex, mpOption) { + var serie = this.series[seriesIndex]; + var component = this.component; + var data = mpOption.data; + var itemShape; + var dataRange = component.dataRange; + var legend = component.legend; + var color; + var value; + var queryTarget = [ + data[0], + mpOption + ]; + var nColor; + var eColor; + var effect; + if (legend) { + color = legend.getColor(serie.name); + } + if (dataRange) { + value = data[0].value != null ? data[0].value : ''; + color = isNaN(value) ? color : dataRange.getColor(value); + nColor = this.deepQuery(queryTarget, 'itemStyle.normal.color') || color; + eColor = this.deepQuery(queryTarget, 'itemStyle.emphasis.color') || nColor; + if (nColor == null && eColor == null) { + return; + } + } + color = this.deepMerge(queryTarget, 'itemStyle.normal').color || color; + var symbol = this.deepQuery(queryTarget, 'symbol') || 'circle'; + symbol = symbol.replace('empty', '').replace(/\d/g, ''); + effect = this.deepMerge([ + data[0], + mpOption + ], 'effect'); + var devicePixelRatio = window.devicePixelRatio || 1; + itemShape = new SymbolShape({ + style: { + pointList: data, + color: color, + strokeColor: color, + shadowColor: effect.shadowColor || color, + shadowBlur: (effect.shadowBlur != null ? effect.shadowBlur : 8) * devicePixelRatio, + size: this.deepQuery(queryTarget, 'symbolSize'), + iconType: symbol, + brushType: 'fill', + lineWidth: 1 + }, + draggable: false, + hoverable: false + }); + if (effect.show) { + itemShape.effect = effect; + } + return itemShape; + }, + backupShapeList: function () { + if (this.shapeList && this.shapeList.length > 0) { + this.lastShapeList = this.shapeList; + this.shapeList = []; + } else { + this.lastShapeList = []; + } + }, + addShapeList: function () { + var maxLenth = this.option.animationThreshold / (this.canvasSupported ? 2 : 4); + var lastShapeList = this.lastShapeList; + var shapeList = this.shapeList; + var isUpdate = lastShapeList.length > 0; + var duration = isUpdate ? this.query(this.option, 'animationDurationUpdate') : this.query(this.option, 'animationDuration'); + var easing = this.query(this.option, 'animationEasing'); + var delay; + var key; + var oldMap = {}; + var newMap = {}; + if (this.option.animation && !this.option.renderAsImage && shapeList.length < maxLenth && !this.motionlessOnce) { + for (var i = 0, l = lastShapeList.length; i < l; i++) { + key = this._getAnimationKey(lastShapeList[i]); + if (key.match('undefined')) { + this.zr.delShape(lastShapeList[i].id); + } else { + key += lastShapeList[i].type; + if (oldMap[key]) { + this.zr.delShape(lastShapeList[i].id); + } else { + oldMap[key] = lastShapeList[i]; + } + } + } + for (var i = 0, l = shapeList.length; i < l; i++) { + key = this._getAnimationKey(shapeList[i]); + if (key.match('undefined')) { + this.zr.addShape(shapeList[i]); + } else { + key += shapeList[i].type; + newMap[key] = shapeList[i]; + } + } + for (key in oldMap) { + if (!newMap[key]) { + this.zr.delShape(oldMap[key].id); + } + } + for (key in newMap) { + if (oldMap[key]) { + this.zr.delShape(oldMap[key].id); + this._animateMod(oldMap[key], newMap[key], duration, easing, 0, isUpdate); + } else { + delay = (this.type == ecConfig.CHART_TYPE_LINE || this.type == ecConfig.CHART_TYPE_RADAR) && key.indexOf('icon') !== 0 ? duration / 2 : 0; + this._animateMod(false, newMap[key], duration, easing, delay, isUpdate); + } + } + this.zr.refresh(); + this.animationEffect(); + } else { + this.motionlessOnce = false; + this.zr.delShape(lastShapeList); + for (var i = 0, l = shapeList.length; i < l; i++) { + this.zr.addShape(shapeList[i]); + } + } + }, + _getAnimationKey: function (shape) { + if (this.type != ecConfig.CHART_TYPE_MAP) { + return ecData.get(shape, 'seriesIndex') + '_' + ecData.get(shape, 'dataIndex') + (shape._mark ? shape._mark : '') + (this.type === ecConfig.CHART_TYPE_RADAR ? ecData.get(shape, 'special') : ''); + } else { + return ecData.get(shape, 'seriesIndex') + '_' + ecData.get(shape, 'dataIndex') + (shape._mark ? shape._mark : 'undefined'); + } + }, + _animateMod: function (oldShape, newShape, duration, easing, delay, isUpdate) { + switch (newShape.type) { + case 'polyline': + case 'half-smooth-polygon': + ecAnimation.pointList(this.zr, oldShape, newShape, duration, easing); + break; + case 'rectangle': + ecAnimation.rectangle(this.zr, oldShape, newShape, duration, easing); + break; + case 'image': + case 'icon': + ecAnimation.icon(this.zr, oldShape, newShape, duration, easing, delay); + break; + case 'candle': + if (!isUpdate) { + ecAnimation.candle(this.zr, oldShape, newShape, duration, easing); + } else { + this.zr.addShape(newShape); + } + break; + case 'ring': + case 'sector': + case 'circle': + if (!isUpdate) { + ecAnimation.ring(this.zr, oldShape, newShape, duration + (ecData.get(newShape, 'dataIndex') || 0) % 20 * 100, easing); + } else if (newShape.type === 'sector') { + ecAnimation.sector(this.zr, oldShape, newShape, duration, easing); + } else { + this.zr.addShape(newShape); + } + break; + case 'text': + ecAnimation.text(this.zr, oldShape, newShape, duration, easing); + break; + case 'polygon': + if (!isUpdate) { + ecAnimation.polygon(this.zr, oldShape, newShape, duration, easing); + } else { + ecAnimation.pointList(this.zr, oldShape, newShape, duration, easing); + } + break; + case 'ribbon': + ecAnimation.ribbon(this.zr, oldShape, newShape, duration, easing); + break; + case 'gauge-pointer': + ecAnimation.gaugePointer(this.zr, oldShape, newShape, duration, easing); + break; + case 'mark-line': + ecAnimation.markline(this.zr, oldShape, newShape, duration, easing); + break; + case 'bezier-curve': + case 'line': + ecAnimation.line(this.zr, oldShape, newShape, duration, easing); + break; + default: + this.zr.addShape(newShape); + break; + } + }, + animationMark: function (duration, easing, addShapeList) { + var shapeList = addShapeList || this.shapeList; + for (var i = 0, l = shapeList.length; i < l; i++) { + if (!shapeList[i]._mark) { + continue; + } + this._animateMod(false, shapeList[i], duration, easing, 0, true); + } + this.animationEffect(addShapeList); + }, + animationEffect: function (addShapeList) { + !addShapeList && this.clearEffectShape(); + var shapeList = addShapeList || this.shapeList; + if (shapeList == null) { + return; + } + var zlevel = ecConfig.EFFECT_ZLEVEL; + if (this.canvasSupported) { + this.zr.modLayer(zlevel, { + motionBlur: true, + lastFrameAlpha: 0.95 + }); + } + var shape; + for (var i = 0, l = shapeList.length; i < l; i++) { + shape = shapeList[i]; + if (!(shape._mark && shape.effect && shape.effect.show && ecEffect[shape._mark])) { + continue; + } + ecEffect[shape._mark](this.zr, this.effectList, shape, zlevel); + this.effectList[this.effectList.length - 1]._mark = shape._mark; + } + }, + clearEffectShape: function (clearMotionBlur) { + if (this.zr && this.effectList && this.effectList.length > 0) { + clearMotionBlur && this.zr.modLayer(ecConfig.EFFECT_ZLEVEL, { motionBlur: false }); + this.zr.delShape(this.effectList); + } + this.effectList = []; + }, + addMark: function (seriesIndex, markData, markType) { + var serie = this.series[seriesIndex]; + if (this.selectedMap[serie.name]) { + var duration = this.query(this.option, 'animationDurationUpdate'); + var easing = this.query(this.option, 'animationEasing'); + var oriMarkData = serie[markType].data; + var lastLength = this.shapeList.length; + serie[markType].data = markData.data; + this['_build' + markType.replace('m', 'M')](seriesIndex); + if (this.option.animation && !this.option.renderAsImage) { + this.animationMark(duration, easing, this.shapeList.slice(lastLength)); + } else { + for (var i = lastLength, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + this.zr.refreshNextFrame(); + } + serie[markType].data = oriMarkData; + } + }, + delMark: function (seriesIndex, markName, markType) { + markType = markType.replace('mark', '').replace('large', '').toLowerCase(); + var serie = this.series[seriesIndex]; + if (this.selectedMap[serie.name]) { + var needRefresh = false; + var shapeList = [ + this.shapeList, + this.effectList + ]; + var len = 2; + while (len--) { + for (var i = 0, l = shapeList[len].length; i < l; i++) { + if (shapeList[len][i]._mark == markType && ecData.get(shapeList[len][i], 'seriesIndex') == seriesIndex && ecData.get(shapeList[len][i], 'name') == markName) { + this.zr.delShape(shapeList[len][i].id); + shapeList[len].splice(i, 1); + needRefresh = true; + break; + } + } + } + needRefresh && this.zr.refreshNextFrame(); + } + } + }; + zrUtil.inherits(Base, ComponentBase); + return Base; +});define('zrender/shape/Circle', [ + 'require', + './Base', + '../tool/util' +], function (require) { + 'use strict'; + var Base = require('./Base'); + var Circle = function (options) { + Base.call(this, options); + }; + Circle.prototype = { + type: 'circle', + buildPath: function (ctx, style) { + ctx.arc(style.x, style.y, style.r, 0, Math.PI * 2, true); + return; + }, + getRect: function (style) { + if (style.__rect) { + return style.__rect; + } + var lineWidth; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } else { + lineWidth = 0; + } + style.__rect = { + x: Math.round(style.x - style.r - lineWidth / 2), + y: Math.round(style.y - style.r - lineWidth / 2), + width: style.r * 2 + lineWidth, + height: style.r * 2 + lineWidth + }; + return style.__rect; + } + }; + require('../tool/util').inherits(Circle, Base); + return Circle; +});define('echarts/util/accMath', [], function () { + function accDiv(arg1, arg2) { + var s1 = arg1.toString(); + var s2 = arg2.toString(); + var m = 0; + try { + m = s2.split('.')[1].length; + } catch (e) { + } + try { + m -= s1.split('.')[1].length; + } catch (e) { + } + return (s1.replace('.', '') - 0) / (s2.replace('.', '') - 0) * Math.pow(10, m); + } + function accMul(arg1, arg2) { + var s1 = arg1.toString(); + var s2 = arg2.toString(); + var m = 0; + try { + m += s1.split('.')[1].length; + } catch (e) { + } + try { + m += s2.split('.')[1].length; + } catch (e) { + } + return (s1.replace('.', '') - 0) * (s2.replace('.', '') - 0) / Math.pow(10, m); + } + function accAdd(arg1, arg2) { + var r1 = 0; + var r2 = 0; + try { + r1 = arg1.toString().split('.')[1].length; + } catch (e) { + } + try { + r2 = arg2.toString().split('.')[1].length; + } catch (e) { + } + var m = Math.pow(10, Math.max(r1, r2)); + return (Math.round(arg1 * m) + Math.round(arg2 * m)) / m; + } + function accSub(arg1, arg2) { + return accAdd(arg1, -arg2); + } + return { + accDiv: accDiv, + accMul: accMul, + accAdd: accAdd, + accSub: accSub + }; +});define('echarts/util/shape/Icon', [ + 'require', + 'zrender/tool/util', + 'zrender/shape/Star', + 'zrender/shape/Heart', + 'zrender/shape/Droplet', + 'zrender/shape/Image', + 'zrender/shape/Base' +], function (require) { + var zrUtil = require('zrender/tool/util'); + function _iconMark(ctx, style) { + var x = style.x; + var y = style.y; + var dx = style.width / 16; + var dy = style.height / 16; + ctx.moveTo(x, y + style.height); + ctx.lineTo(x + 5 * dx, y + 14 * dy); + ctx.lineTo(x + style.width, y + 3 * dy); + ctx.lineTo(x + 13 * dx, y); + ctx.lineTo(x + 2 * dx, y + 11 * dy); + ctx.lineTo(x, y + style.height); + ctx.moveTo(x + 6 * dx, y + 10 * dy); + ctx.lineTo(x + 14 * dx, y + 2 * dy); + ctx.moveTo(x + 10 * dx, y + 13 * dy); + ctx.lineTo(x + style.width, y + 13 * dy); + ctx.moveTo(x + 13 * dx, y + 10 * dy); + ctx.lineTo(x + 13 * dx, y + style.height); + } + function _iconMarkUndo(ctx, style) { + var x = style.x; + var y = style.y; + var dx = style.width / 16; + var dy = style.height / 16; + ctx.moveTo(x, y + style.height); + ctx.lineTo(x + 5 * dx, y + 14 * dy); + ctx.lineTo(x + style.width, y + 3 * dy); + ctx.lineTo(x + 13 * dx, y); + ctx.lineTo(x + 2 * dx, y + 11 * dy); + ctx.lineTo(x, y + style.height); + ctx.moveTo(x + 6 * dx, y + 10 * dy); + ctx.lineTo(x + 14 * dx, y + 2 * dy); + ctx.moveTo(x + 10 * dx, y + 13 * dy); + ctx.lineTo(x + style.width, y + 13 * dy); + } + function _iconMarkClear(ctx, style) { + var x = style.x; + var y = style.y; + var dx = style.width / 16; + var dy = style.height / 16; + ctx.moveTo(x + 4 * dx, y + 15 * dy); + ctx.lineTo(x + 9 * dx, y + 13 * dy); + ctx.lineTo(x + 14 * dx, y + 8 * dy); + ctx.lineTo(x + 11 * dx, y + 5 * dy); + ctx.lineTo(x + 6 * dx, y + 10 * dy); + ctx.lineTo(x + 4 * dx, y + 15 * dy); + ctx.moveTo(x + 5 * dx, y); + ctx.lineTo(x + 11 * dx, y); + ctx.moveTo(x + 5 * dx, y + dy); + ctx.lineTo(x + 11 * dx, y + dy); + ctx.moveTo(x, y + 2 * dy); + ctx.lineTo(x + style.width, y + 2 * dy); + ctx.moveTo(x, y + 5 * dy); + ctx.lineTo(x + 3 * dx, y + style.height); + ctx.lineTo(x + 13 * dx, y + style.height); + ctx.lineTo(x + style.width, y + 5 * dy); + } + function _iconDataZoom(ctx, style) { + var x = style.x; + var y = style.y; + var dx = style.width / 16; + var dy = style.height / 16; + ctx.moveTo(x, y + 3 * dy); + ctx.lineTo(x + 6 * dx, y + 3 * dy); + ctx.moveTo(x + 3 * dx, y); + ctx.lineTo(x + 3 * dx, y + 6 * dy); + ctx.moveTo(x + 3 * dx, y + 8 * dy); + ctx.lineTo(x + 3 * dx, y + style.height); + ctx.lineTo(x + style.width, y + style.height); + ctx.lineTo(x + style.width, y + 3 * dy); + ctx.lineTo(x + 8 * dx, y + 3 * dy); + } + function _iconDataZoomReset(ctx, style) { + var x = style.x; + var y = style.y; + var dx = style.width / 16; + var dy = style.height / 16; + ctx.moveTo(x + 6 * dx, y); + ctx.lineTo(x + 2 * dx, y + 3 * dy); + ctx.lineTo(x + 6 * dx, y + 6 * dy); + ctx.moveTo(x + 2 * dx, y + 3 * dy); + ctx.lineTo(x + 14 * dx, y + 3 * dy); + ctx.lineTo(x + 14 * dx, y + 11 * dy); + ctx.moveTo(x + 2 * dx, y + 5 * dy); + ctx.lineTo(x + 2 * dx, y + 13 * dy); + ctx.lineTo(x + 14 * dx, y + 13 * dy); + ctx.moveTo(x + 10 * dx, y + 10 * dy); + ctx.lineTo(x + 14 * dx, y + 13 * dy); + ctx.lineTo(x + 10 * dx, y + style.height); + } + function _iconRestore(ctx, style) { + var x = style.x; + var y = style.y; + var dx = style.width / 16; + var dy = style.height / 16; + var r = style.width / 2; + ctx.lineWidth = 1.5; + ctx.arc(x + r, y + r, r - dx, 0, Math.PI * 2 / 3); + ctx.moveTo(x + 3 * dx, y + style.height); + ctx.lineTo(x + 0 * dx, y + 12 * dy); + ctx.lineTo(x + 5 * dx, y + 11 * dy); + ctx.moveTo(x, y + 8 * dy); + ctx.arc(x + r, y + r, r - dx, Math.PI, Math.PI * 5 / 3); + ctx.moveTo(x + 13 * dx, y); + ctx.lineTo(x + style.width, y + 4 * dy); + ctx.lineTo(x + 11 * dx, y + 5 * dy); + } + function _iconLineChart(ctx, style) { + var x = style.x; + var y = style.y; + var dx = style.width / 16; + var dy = style.height / 16; + ctx.moveTo(x, y); + ctx.lineTo(x, y + style.height); + ctx.lineTo(x + style.width, y + style.height); + ctx.moveTo(x + 2 * dx, y + 14 * dy); + ctx.lineTo(x + 7 * dx, y + 6 * dy); + ctx.lineTo(x + 11 * dx, y + 11 * dy); + ctx.lineTo(x + 15 * dx, y + 2 * dy); + } + function _iconBarChart(ctx, style) { + var x = style.x; + var y = style.y; + var dx = style.width / 16; + var dy = style.height / 16; + ctx.moveTo(x, y); + ctx.lineTo(x, y + style.height); + ctx.lineTo(x + style.width, y + style.height); + ctx.moveTo(x + 3 * dx, y + 14 * dy); + ctx.lineTo(x + 3 * dx, y + 6 * dy); + ctx.lineTo(x + 4 * dx, y + 6 * dy); + ctx.lineTo(x + 4 * dx, y + 14 * dy); + ctx.moveTo(x + 7 * dx, y + 14 * dy); + ctx.lineTo(x + 7 * dx, y + 2 * dy); + ctx.lineTo(x + 8 * dx, y + 2 * dy); + ctx.lineTo(x + 8 * dx, y + 14 * dy); + ctx.moveTo(x + 11 * dx, y + 14 * dy); + ctx.lineTo(x + 11 * dx, y + 9 * dy); + ctx.lineTo(x + 12 * dx, y + 9 * dy); + ctx.lineTo(x + 12 * dx, y + 14 * dy); + } + function _iconPieChart(ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width - 2; + var height = style.height - 2; + var r = Math.min(width, height) / 2; + y += 2; + ctx.moveTo(x + r + 3, y + r - 3); + ctx.arc(x + r + 3, y + r - 3, r - 1, 0, -Math.PI / 2, true); + ctx.lineTo(x + r + 3, y + r - 3); + ctx.moveTo(x + r, y); + ctx.lineTo(x + r, y + r); + ctx.arc(x + r, y + r, r, -Math.PI / 2, Math.PI * 2, true); + ctx.lineTo(x + r, y + r); + ctx.lineWidth = 1.5; + } + function _iconFunnelChart(ctx, style) { + var x = style.x; + var y = style.y; + var dx = style.width / 16; + var dy = style.height / 16; + y -= dy; + ctx.moveTo(x + 1 * dx, y + 2 * dy); + ctx.lineTo(x + 15 * dx, y + 2 * dy); + ctx.lineTo(x + 14 * dx, y + 3 * dy); + ctx.lineTo(x + 2 * dx, y + 3 * dy); + ctx.moveTo(x + 3 * dx, y + 6 * dy); + ctx.lineTo(x + 13 * dx, y + 6 * dy); + ctx.lineTo(x + 12 * dx, y + 7 * dy); + ctx.lineTo(x + 4 * dx, y + 7 * dy); + ctx.moveTo(x + 5 * dx, y + 10 * dy); + ctx.lineTo(x + 11 * dx, y + 10 * dy); + ctx.lineTo(x + 10 * dx, y + 11 * dy); + ctx.lineTo(x + 6 * dx, y + 11 * dy); + ctx.moveTo(x + 7 * dx, y + 14 * dy); + ctx.lineTo(x + 9 * dx, y + 14 * dy); + ctx.lineTo(x + 8 * dx, y + 15 * dy); + ctx.lineTo(x + 7 * dx, y + 15 * dy); + } + function _iconForceChart(ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + var dx = width / 16; + var dy = height / 16; + var r = Math.min(dx, dy) * 2; + ctx.moveTo(x + dx + r, y + dy + r); + ctx.arc(x + dx, y + dy, r, Math.PI / 4, Math.PI * 3); + ctx.lineTo(x + 7 * dx - r, y + 6 * dy - r); + ctx.arc(x + 7 * dx, y + 6 * dy, r, Math.PI / 4 * 5, Math.PI * 4); + ctx.arc(x + 7 * dx, y + 6 * dy, r / 2, Math.PI / 4 * 5, Math.PI * 4); + ctx.moveTo(x + 7 * dx - r / 2, y + 6 * dy + r); + ctx.lineTo(x + dx + r, y + 14 * dy - r); + ctx.arc(x + dx, y + 14 * dy, r, -Math.PI / 4, Math.PI * 2); + ctx.moveTo(x + 7 * dx + r / 2, y + 6 * dy); + ctx.lineTo(x + 14 * dx - r, y + 10 * dy - r / 2); + ctx.moveTo(x + 16 * dx, y + 10 * dy); + ctx.arc(x + 14 * dx, y + 10 * dy, r, 0, Math.PI * 3); + ctx.lineWidth = 1.5; + } + function _iconChordChart(ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + var r = Math.min(width, height) / 2; + ctx.moveTo(x + width, y + height / 2); + ctx.arc(x + r, y + r, r, 0, Math.PI * 2); + ctx.arc(x + r, y, r, Math.PI / 4, Math.PI / 5 * 4); + ctx.arc(x, y + r, r, -Math.PI / 3, Math.PI / 3); + ctx.arc(x + width, y + height, r, Math.PI, Math.PI / 2 * 3); + ctx.lineWidth = 1.5; + } + function _iconStackChart(ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + var dy = Math.round(height / 3); + var delta = Math.round((dy - 2) / 2); + var len = 3; + while (len--) { + ctx.rect(x, y + dy * len + delta, width, 2); + } + } + function _iconTiledChart(ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + var dx = Math.round(width / 3); + var delta = Math.round((dx - 2) / 2); + var len = 3; + while (len--) { + ctx.rect(x + dx * len + delta, y, 2, height); + } + } + function _iconDataView(ctx, style) { + var x = style.x; + var y = style.y; + var dx = style.width / 16; + ctx.moveTo(x + dx, y); + ctx.lineTo(x + dx, y + style.height); + ctx.lineTo(x + 15 * dx, y + style.height); + ctx.lineTo(x + 15 * dx, y); + ctx.lineTo(x + dx, y); + ctx.moveTo(x + 3 * dx, y + 3 * dx); + ctx.lineTo(x + 13 * dx, y + 3 * dx); + ctx.moveTo(x + 3 * dx, y + 6 * dx); + ctx.lineTo(x + 13 * dx, y + 6 * dx); + ctx.moveTo(x + 3 * dx, y + 9 * dx); + ctx.lineTo(x + 13 * dx, y + 9 * dx); + ctx.moveTo(x + 3 * dx, y + 12 * dx); + ctx.lineTo(x + 9 * dx, y + 12 * dx); + } + function _iconSave(ctx, style) { + var x = style.x; + var y = style.y; + var dx = style.width / 16; + var dy = style.height / 16; + ctx.moveTo(x, y); + ctx.lineTo(x, y + style.height); + ctx.lineTo(x + style.width, y + style.height); + ctx.lineTo(x + style.width, y); + ctx.lineTo(x, y); + ctx.moveTo(x + 4 * dx, y); + ctx.lineTo(x + 4 * dx, y + 8 * dy); + ctx.lineTo(x + 12 * dx, y + 8 * dy); + ctx.lineTo(x + 12 * dx, y); + ctx.moveTo(x + 6 * dx, y + 11 * dy); + ctx.lineTo(x + 6 * dx, y + 13 * dy); + ctx.lineTo(x + 10 * dx, y + 13 * dy); + ctx.lineTo(x + 10 * dx, y + 11 * dy); + ctx.lineTo(x + 6 * dx, y + 11 * dy); + } + function _iconCross(ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + ctx.moveTo(x, y + height / 2); + ctx.lineTo(x + width, y + height / 2); + ctx.moveTo(x + width / 2, y); + ctx.lineTo(x + width / 2, y + height); + } + function _iconCircle(ctx, style) { + var width = style.width / 2; + var height = style.height / 2; + var r = Math.min(width, height); + ctx.moveTo(style.x + width + r, style.y + height); + ctx.arc(style.x + width, style.y + height, r, 0, Math.PI * 2); + ctx.closePath(); + } + function _iconRectangle(ctx, style) { + ctx.rect(style.x, style.y, style.width, style.height); + ctx.closePath(); + } + function _iconTriangle(ctx, style) { + var width = style.width / 2; + var height = style.height / 2; + var x = style.x + width; + var y = style.y + height; + var symbolSize = Math.min(width, height); + ctx.moveTo(x, y - symbolSize); + ctx.lineTo(x + symbolSize, y + symbolSize); + ctx.lineTo(x - symbolSize, y + symbolSize); + ctx.lineTo(x, y - symbolSize); + ctx.closePath(); + } + function _iconDiamond(ctx, style) { + var width = style.width / 2; + var height = style.height / 2; + var x = style.x + width; + var y = style.y + height; + var symbolSize = Math.min(width, height); + ctx.moveTo(x, y - symbolSize); + ctx.lineTo(x + symbolSize, y); + ctx.lineTo(x, y + symbolSize); + ctx.lineTo(x - symbolSize, y); + ctx.lineTo(x, y - symbolSize); + ctx.closePath(); + } + function _iconArrow(ctx, style) { + var x = style.x; + var y = style.y; + var dx = style.width / 16; + ctx.moveTo(x + 8 * dx, y); + ctx.lineTo(x + dx, y + style.height); + ctx.lineTo(x + 8 * dx, y + style.height / 4 * 3); + ctx.lineTo(x + 15 * dx, y + style.height); + ctx.lineTo(x + 8 * dx, y); + ctx.closePath(); + } + function _iconStar(ctx, style) { + var StarShape = require('zrender/shape/Star'); + var width = style.width / 2; + var height = style.height / 2; + StarShape.prototype.buildPath(ctx, { + x: style.x + width, + y: style.y + height, + r: Math.min(width, height), + n: style.n || 5 + }); + } + function _iconHeart(ctx, style) { + var HeartShape = require('zrender/shape/Heart'); + HeartShape.prototype.buildPath(ctx, { + x: style.x + style.width / 2, + y: style.y + style.height * 0.2, + a: style.width / 2, + b: style.height * 0.8 + }); + } + function _iconDroplet(ctx, style) { + var DropletShape = require('zrender/shape/Droplet'); + DropletShape.prototype.buildPath(ctx, { + x: style.x + style.width * 0.5, + y: style.y + style.height * 0.5, + a: style.width * 0.5, + b: style.height * 0.8 + }); + } + function _iconPin(ctx, style) { + var x = style.x; + var y = style.y - style.height / 2 * 1.5; + var width = style.width / 2; + var height = style.height / 2; + var r = Math.min(width, height); + ctx.arc(x + width, y + height, r, Math.PI / 5 * 4, Math.PI / 5); + ctx.lineTo(x + width, y + height + r * 1.5); + ctx.closePath(); + } + function _iconImage(ctx, style, refreshNextFrame) { + var ImageShape = require('zrender/shape/Image'); + this._imageShape = this._imageShape || new ImageShape({ style: {} }); + for (var name in style) { + this._imageShape.style[name] = style[name]; + } + this._imageShape.brush(ctx, false, refreshNextFrame); + } + var Base = require('zrender/shape/Base'); + function Icon(options) { + Base.call(this, options); + } + Icon.prototype = { + type: 'icon', + iconLibrary: { + mark: _iconMark, + markUndo: _iconMarkUndo, + markClear: _iconMarkClear, + dataZoom: _iconDataZoom, + dataZoomReset: _iconDataZoomReset, + restore: _iconRestore, + lineChart: _iconLineChart, + barChart: _iconBarChart, + pieChart: _iconPieChart, + funnelChart: _iconFunnelChart, + forceChart: _iconForceChart, + chordChart: _iconChordChart, + stackChart: _iconStackChart, + tiledChart: _iconTiledChart, + dataView: _iconDataView, + saveAsImage: _iconSave, + cross: _iconCross, + circle: _iconCircle, + rectangle: _iconRectangle, + triangle: _iconTriangle, + diamond: _iconDiamond, + arrow: _iconArrow, + star: _iconStar, + heart: _iconHeart, + droplet: _iconDroplet, + pin: _iconPin, + image: _iconImage + }, + brush: function (ctx, isHighlight, refreshNextFrame) { + var style = isHighlight ? this.highlightStyle : this.style; + style = style || {}; + var iconType = style.iconType || this.style.iconType; + if (iconType === 'image') { + var ImageShape = require('zrender/shape/Image'); + ImageShape.prototype.brush.call(this, ctx, isHighlight, refreshNextFrame); + } else { + var style = this.beforeBrush(ctx, isHighlight); + ctx.beginPath(); + this.buildPath(ctx, style, refreshNextFrame); + switch (style.brushType) { + case 'both': + ctx.fill(); + case 'stroke': + style.lineWidth > 0 && ctx.stroke(); + break; + default: + ctx.fill(); + } + this.drawText(ctx, style, this.style); + this.afterBrush(ctx); + } + }, + buildPath: function (ctx, style, refreshNextFrame) { + if (this.iconLibrary[style.iconType]) { + this.iconLibrary[style.iconType].call(this, ctx, style, refreshNextFrame); + } else { + ctx.moveTo(style.x, style.y); + ctx.lineTo(style.x + style.width, style.y); + ctx.lineTo(style.x + style.width, style.y + style.height); + ctx.lineTo(style.x, style.y + style.height); + ctx.lineTo(style.x, style.y); + ctx.closePath(); + } + return; + }, + getRect: function (style) { + if (style.__rect) { + return style.__rect; + } + style.__rect = { + x: Math.round(style.x), + y: Math.round(style.y - (style.iconType == 'pin' ? style.height / 2 * 1.5 : 0)), + width: style.width, + height: style.height * (style.iconType === 'pin' ? 1.25 : 1) + }; + return style.__rect; + }, + isCover: function (x, y) { + var originPos = this.getTansform(x, y); + x = originPos[0]; + y = originPos[1]; + var rect = this.style.__rect; + if (!rect) { + rect = this.style.__rect = this.getRect(this.style); + } + var delta = rect.height < 8 || rect.width < 8 ? 4 : 0; + if (x >= rect.x - delta && x <= rect.x + rect.width + delta && y >= rect.y - delta && y <= rect.y + rect.height + delta) { + return true; + } else { + return false; + } + } + }; + zrUtil.inherits(Icon, Base); + return Icon; +});define('echarts/util/shape/MarkLine', [ + 'require', + 'zrender/shape/Base', + './Icon', + 'zrender/shape/Line', + 'zrender/shape/Polyline', + 'zrender/tool/matrix', + 'zrender/tool/area', + 'zrender/shape/util/dashedLineTo', + 'zrender/shape/util/smoothSpline', + 'zrender/tool/util' +], function (require) { + var Base = require('zrender/shape/Base'); + var IconShape = require('./Icon'); + var LineShape = require('zrender/shape/Line'); + var lineInstance = new LineShape({}); + var PolylineShape = require('zrender/shape/Polyline'); + var polylineInstance = new PolylineShape({}); + var matrix = require('zrender/tool/matrix'); + var area = require('zrender/tool/area'); + var dashedLineTo = require('zrender/shape/util/dashedLineTo'); + var smoothSpline = require('zrender/shape/util/smoothSpline'); + var zrUtil = require('zrender/tool/util'); + function MarkLine(options) { + Base.call(this, options); + } + MarkLine.prototype = { + type: 'mark-line', + brush: function (ctx, isHighlight) { + var style = this.style; + if (isHighlight) { + style = this.getHighlightStyle(style, this.highlightStyle || {}); + } + ctx.save(); + this.setContext(ctx, style); + this.setTransform(ctx); + ctx.save(); + ctx.beginPath(); + this.buildLinePath(ctx, style, this.style.lineWidth || 1); + ctx.stroke(); + ctx.restore(); + this.brushSymbol(ctx, style, 0); + this.brushSymbol(ctx, style, 1); + this.drawText(ctx, style, this.style); + ctx.restore(); + }, + buildLinePath: function (ctx, style, lineWidth) { + var pointList = style.pointList || this.getPointList(style); + style.pointList = pointList; + var len = Math.min(style.pointList.length, Math.round(style.pointListLength || style.pointList.length)); + if (!style.lineType || style.lineType == 'solid') { + ctx.moveTo(pointList[0][0], pointList[0][1]); + for (var i = 1; i < len; i++) { + ctx.lineTo(pointList[i][0], pointList[i][1]); + } + } else if (style.lineType == 'dashed' || style.lineType == 'dotted') { + if (style.smooth !== 'spline') { + var dashLength = lineWidth * (style.lineType == 'dashed' ? 5 : 1); + ctx.moveTo(pointList[0][0], pointList[0][1]); + for (var i = 1; i < len; i++) { + dashedLineTo(ctx, pointList[i - 1][0], pointList[i - 1][1], pointList[i][0], pointList[i][1], dashLength); + } + } else { + for (var i = 1; i < len; i += 2) { + ctx.moveTo(pointList[i - 1][0], pointList[i - 1][1]); + ctx.lineTo(pointList[i][0], pointList[i][1]); + } + } + } + }, + brushSymbol: function (ctx, style, idx) { + if (style.symbol[idx] == 'none') { + return; + } + ctx.save(); + ctx.beginPath(); + ctx.lineWidth = style.symbolBorder; + ctx.strokeStyle = style.symbolBorderColor; + style.iconType = style.symbol[idx].replace('empty', '').toLowerCase(); + if (style.symbol[idx].match('empty')) { + ctx.fillStyle = '#fff'; + } + var len = Math.min(style.pointList.length, Math.round(style.pointListLength || style.pointList.length)); + var x = idx === 0 ? style.pointList[0][0] : style.pointList[len - 1][0]; + var y = idx === 0 ? style.pointList[0][1] : style.pointList[len - 1][1]; + var rotate = typeof style.symbolRotate[idx] != 'undefined' ? style.symbolRotate[idx] - 0 : 0; + var transform; + if (rotate !== 0) { + transform = matrix.create(); + matrix.identity(transform); + if (x || y) { + matrix.translate(transform, transform, [ + -x, + -y + ]); + } + matrix.rotate(transform, transform, rotate * Math.PI / 180); + if (x || y) { + matrix.translate(transform, transform, [ + x, + y + ]); + } + ctx.transform.apply(ctx, transform); + } + if (style.iconType == 'arrow' && rotate === 0) { + this.buildArrawPath(ctx, style, idx); + } else { + var symbolSize = style.symbolSize[idx]; + style.x = x - symbolSize; + style.y = y - symbolSize, style.width = symbolSize * 2; + style.height = symbolSize * 2; + IconShape.prototype.buildPath(ctx, style); + } + ctx.closePath(); + ctx.fill(); + ctx.stroke(); + ctx.restore(); + }, + buildArrawPath: function (ctx, style, idx) { + var len = Math.min(style.pointList.length, Math.round(style.pointListLength || style.pointList.length)); + var symbolSize = style.symbolSize[idx] * 2; + var xStart = style.pointList[0][0]; + var xEnd = style.pointList[len - 1][0]; + var yStart = style.pointList[0][1]; + var yEnd = style.pointList[len - 1][1]; + var delta = 0; + if (style.smooth === 'spline') { + delta = style.smoothRadian * (xStart <= xEnd ? 1 : -1); + } + var rotate = Math.atan(Math.abs((yEnd - yStart) / (xStart - xEnd))); + if (idx === 0) { + if (xEnd > xStart) { + if (yEnd > yStart) { + rotate = Math.PI * 2 - rotate + delta; + } else { + rotate += delta; + } + } else { + if (yEnd > yStart) { + rotate += Math.PI - delta; + } else { + rotate = Math.PI - rotate - delta; + } + } + } else { + if (xStart > xEnd) { + if (yStart > yEnd) { + rotate = Math.PI * 2 - rotate + delta; + } else { + rotate += delta; + } + } else { + if (yStart > yEnd) { + rotate += Math.PI - delta; + } else { + rotate = Math.PI - rotate - delta; + } + } + } + var halfRotate = Math.PI / 8; + var x = idx === 0 ? xStart : xEnd; + var y = idx === 0 ? yStart : yEnd; + var point = [ + [ + x + symbolSize * Math.cos(rotate - halfRotate), + y - symbolSize * Math.sin(rotate - halfRotate) + ], + [ + x + symbolSize * 0.6 * Math.cos(rotate), + y - symbolSize * 0.6 * Math.sin(rotate) + ], + [ + x + symbolSize * Math.cos(rotate + halfRotate), + y - symbolSize * Math.sin(rotate + halfRotate) + ] + ]; + ctx.moveTo(x, y); + for (var i = 0, l = point.length; i < l; i++) { + ctx.lineTo(point[i][0], point[i][1]); + } + ctx.lineTo(x, y); + }, + getPointList: function (style) { + var pointList = [ + [ + style.xStart, + style.yStart + ], + [ + style.xEnd, + style.yEnd + ] + ]; + if (style.smooth === 'spline') { + var lastPointX = pointList[1][0]; + var lastPointY = pointList[1][1]; + if (style.smoothRadian <= 0.8) { + pointList[3] = [ + lastPointX, + lastPointY + ]; + var isReverse = pointList[0][0] <= pointList[3][0]; + pointList[1] = this.getOffetPoint(pointList[0], pointList[3], isReverse, style.smoothRadian); + pointList[2] = this.getOffetPoint(pointList[3], pointList[0], isReverse, style.smoothRadian); + } else { + pointList[2] = [ + lastPointX, + lastPointY + ]; + pointList[1] = this.getOffetPoint(pointList[0], pointList[2], pointList[0][0] <= pointList[2][0], style.smoothRadian); + } + pointList = smoothSpline(pointList, false); + pointList[pointList.length - 1] = [ + lastPointX, + lastPointY + ]; + } + return pointList; + }, + getOffetPoint: function (sp, ep, isReverse, deltaAngle) { + var split = (2 - Math.abs(deltaAngle)) / 0.6; + var distance = Math.sqrt(Math.round((sp[0] - ep[0]) * (sp[0] - ep[0]) + (sp[1] - ep[1]) * (sp[1] - ep[1]))) / split; + var mp = [ + sp[0], + sp[1] + ]; + var angle; + if (sp[0] != ep[0] && sp[1] != ep[1]) { + var k = (ep[1] - sp[1]) / (ep[0] - sp[0]); + angle = Math.atan(k); + } else if (sp[0] == ep[0]) { + angle = (sp[1] <= ep[1] ? 1 : -1) * Math.PI / 2; + } else { + angle = 0; + } + var dX; + var dY; + if (sp[0] <= ep[0]) { + angle -= deltaAngle * (isReverse ? 1 : -1); + dX = Math.round(Math.cos(angle) * distance); + dY = Math.round(Math.sin(angle) * distance); + mp[0] += dX; + mp[1] += dY; + } else { + angle += deltaAngle * (isReverse ? 1 : -1); + dX = Math.round(Math.cos(angle) * distance); + dY = Math.round(Math.sin(angle) * distance); + mp[0] -= dX; + mp[1] -= dY; + } + return mp; + }, + getRect: function (style) { + if (style.__rect) { + return style.__rect; + } + var lineWidth = style.lineWidth || 1; + style.__rect = { + x: Math.min(style.xStart, style.xEnd) - lineWidth, + y: Math.min(style.yStart, style.yEnd) - lineWidth, + width: Math.abs(style.xStart - style.xEnd) + lineWidth, + height: Math.abs(style.yStart - style.yEnd) + lineWidth + }; + return style.__rect; + }, + isCover: function (x, y) { + var originPos = this.getTansform(x, y); + x = originPos[0]; + y = originPos[1]; + var rect = this.style.__rect; + if (!rect) { + rect = this.style.__rect = this.getRect(this.style); + } + if (x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height) { + return this.style.smooth !== 'spline' ? area.isInside(lineInstance, this.style, x, y) : area.isInside(polylineInstance, this.style, x, y); + } + return false; + } + }; + zrUtil.inherits(MarkLine, Base); + return MarkLine; +});define('echarts/util/shape/Symbol', [ + 'require', + 'zrender/shape/Base', + 'zrender/shape/Polygon', + 'zrender/tool/util', + './normalIsCover' +], function (require) { + var Base = require('zrender/shape/Base'); + var PolygonShape = require('zrender/shape/Polygon'); + var polygonInstance = new PolygonShape({}); + var zrUtil = require('zrender/tool/util'); + function Symbol(options) { + Base.call(this, options); + } + Symbol.prototype = { + type: 'symbol', + buildPath: function (ctx, style) { + var pointList = style.pointList; + var len = pointList.length; + if (len === 0) { + return; + } + var subSize = 10000; + var subSetLength = Math.ceil(len / subSize); + var sub; + var subLen; + var isArray = pointList[0] instanceof Array; + var size = style.size ? style.size : 2; + var curSize = size; + var halfSize = size / 2; + var PI2 = Math.PI * 2; + var percent; + var x; + var y; + for (var j = 0; j < subSetLength; j++) { + ctx.beginPath(); + sub = j * subSize; + subLen = sub + subSize; + subLen = subLen > len ? len : subLen; + for (var i = sub; i < subLen; i++) { + if (style.random) { + percent = style['randomMap' + i % 20] / 100; + curSize = size * percent * percent; + halfSize = curSize / 2; + } + if (isArray) { + x = pointList[i][0]; + y = pointList[i][1]; + } else { + x = pointList[i].x; + y = pointList[i].y; + } + if (curSize < 3) { + ctx.rect(x - halfSize, y - halfSize, curSize, curSize); + } else { + switch (style.iconType) { + case 'circle': + ctx.moveTo(x, y); + ctx.arc(x, y, halfSize, 0, PI2, true); + break; + case 'diamond': + ctx.moveTo(x, y - halfSize); + ctx.lineTo(x + halfSize / 3, y - halfSize / 3); + ctx.lineTo(x + halfSize, y); + ctx.lineTo(x + halfSize / 3, y + halfSize / 3); + ctx.lineTo(x, y + halfSize); + ctx.lineTo(x - halfSize / 3, y + halfSize / 3); + ctx.lineTo(x - halfSize, y); + ctx.lineTo(x - halfSize / 3, y - halfSize / 3); + ctx.lineTo(x, y - halfSize); + break; + default: + ctx.rect(x - halfSize, y - halfSize, curSize, curSize); + } + } + } + ctx.closePath(); + if (j < subSetLength - 1) { + switch (style.brushType) { + case 'both': + ctx.fill(); + style.lineWidth > 0 && ctx.stroke(); + break; + case 'stroke': + style.lineWidth > 0 && ctx.stroke(); + break; + default: + ctx.fill(); + } + } + } + }, + getRect: function (style) { + return style.__rect || polygonInstance.getRect(style); + }, + isCover: require('./normalIsCover') + }; + zrUtil.inherits(Symbol, Base); + return Symbol; +});define('echarts/util/ecAnimation', [ + 'require', + 'zrender/tool/util', + 'zrender/shape/Polygon' +], function (require) { + var zrUtil = require('zrender/tool/util'); + function pointList(zr, oldShape, newShape, duration, easing) { + var newPointList = newShape.style.pointList; + var newPointListLen = newPointList.length; + var oldPointList; + if (!oldShape) { + oldPointList = []; + if (newShape._orient != 'vertical') { + var y = newPointList[0][1]; + for (var i = 0; i < newPointListLen; i++) { + oldPointList[i] = [ + newPointList[i][0], + y + ]; + } + } else { + var x = newPointList[0][0]; + for (var i = 0; i < newPointListLen; i++) { + oldPointList[i] = [ + x, + newPointList[i][1] + ]; + } + } + if (newShape.type == 'half-smooth-polygon') { + oldPointList[newPointListLen - 1] = zrUtil.clone(newPointList[newPointListLen - 1]); + oldPointList[newPointListLen - 2] = zrUtil.clone(newPointList[newPointListLen - 2]); + } + oldShape = { style: { pointList: oldPointList } }; + } + oldPointList = oldShape.style.pointList; + var oldPointListLen = oldPointList.length; + if (oldPointListLen == newPointListLen) { + newShape.style.pointList = oldPointList; + } else if (oldPointListLen < newPointListLen) { + newShape.style.pointList = oldPointList.concat(newPointList.slice(oldPointListLen)); + } else { + newShape.style.pointList = oldPointList.slice(0, newPointListLen); + } + zr.addShape(newShape); + newShape._animating = true; + zr.animate(newShape.id, 'style').when(duration, { pointList: newPointList }).done(function () { + newShape._animating = false; + }).start(easing); + } + function cloneStyle(target, source) { + var len = arguments.length; + for (var i = 2; i < len; i++) { + var prop = arguments[i]; + target.style[prop] = source.style[prop]; + } + } + function rectangle(zr, oldShape, newShape, duration, easing) { + var newShapeStyle = newShape.style; + if (!oldShape) { + oldShape = { + position: newShape.position, + style: { + x: newShapeStyle.x, + y: newShape._orient == 'vertical' ? newShapeStyle.y + newShapeStyle.height : newShapeStyle.y, + width: newShape._orient == 'vertical' ? newShapeStyle.width : 0, + height: newShape._orient != 'vertical' ? newShapeStyle.height : 0 + } + }; + } + var newX = newShapeStyle.x; + var newY = newShapeStyle.y; + var newWidth = newShapeStyle.width; + var newHeight = newShapeStyle.height; + var newPosition = [ + newShape.position[0], + newShape.position[1] + ]; + cloneStyle(newShape, oldShape, 'x', 'y', 'width', 'height'); + newShape.position = oldShape.position; + zr.addShape(newShape); + if (newPosition[0] != oldShape.position[0] || newPosition[1] != oldShape.position[1]) { + zr.animate(newShape.id, '').when(duration, { position: newPosition }).start(easing); + } + newShape._animating = true; + zr.animate(newShape.id, 'style').when(duration, { + x: newX, + y: newY, + width: newWidth, + height: newHeight + }).done(function () { + newShape._animating = false; + }).start(easing); + } + function candle(zr, oldShape, newShape, duration, easing) { + if (!oldShape) { + var y = newShape.style.y; + oldShape = { + style: { + y: [ + y[0], + y[0], + y[0], + y[0] + ] + } + }; + } + var newY = newShape.style.y; + newShape.style.y = oldShape.style.y; + zr.addShape(newShape); + newShape._animating = true; + zr.animate(newShape.id, 'style').when(duration, { y: newY }).done(function () { + newShape._animating = false; + }).start(easing); + } + function ring(zr, oldShape, newShape, duration, easing) { + var x = newShape.style.x; + var y = newShape.style.y; + var r0 = newShape.style.r0; + var r = newShape.style.r; + newShape._animating = true; + if (newShape._animationAdd != 'r') { + newShape.style.r0 = 0; + newShape.style.r = 0; + newShape.rotation = [ + Math.PI * 2, + x, + y + ]; + zr.addShape(newShape); + zr.animate(newShape.id, 'style').when(duration, { + r0: r0, + r: r + }).done(function () { + newShape._animating = false; + }).start(easing); + zr.animate(newShape.id, '').when(Math.round(duration / 3 * 2), { + rotation: [ + 0, + x, + y + ] + }).start(easing); + } else { + newShape.style.r0 = newShape.style.r; + zr.addShape(newShape); + zr.animate(newShape.id, 'style').when(duration, { r0: r0 }).done(function () { + newShape._animating = false; + }).start(easing); + } + } + function sector(zr, oldShape, newShape, duration, easing) { + if (!oldShape) { + if (newShape._animationAdd != 'r') { + oldShape = { + style: { + startAngle: newShape.style.startAngle, + endAngle: newShape.style.startAngle + } + }; + } else { + oldShape = { style: { r0: newShape.style.r } }; + } + } + var startAngle = newShape.style.startAngle; + var endAngle = newShape.style.endAngle; + cloneStyle(newShape, oldShape, 'startAngle', 'endAngle'); + zr.addShape(newShape); + newShape._animating = true; + zr.animate(newShape.id, 'style').when(duration, { + startAngle: startAngle, + endAngle: endAngle + }).done(function () { + newShape._animating = false; + }).start(easing); + } + function text(zr, oldShape, newShape, duration, easing) { + if (!oldShape) { + oldShape = { + style: { + x: newShape.style.textAlign == 'left' ? newShape.style.x + 100 : newShape.style.x - 100, + y: newShape.style.y + } + }; + } + var x = newShape.style.x; + var y = newShape.style.y; + cloneStyle(newShape, oldShape, 'x', 'y'); + zr.addShape(newShape); + newShape._animating = true; + zr.animate(newShape.id, 'style').when(duration, { + x: x, + y: y + }).done(function () { + newShape._animating = false; + }).start(easing); + } + function polygon(zr, oldShape, newShape, duration, easing) { + var rect = require('zrender/shape/Polygon').prototype.getRect(newShape.style); + var x = rect.x + rect.width / 2; + var y = rect.y + rect.height / 2; + newShape.scale = [ + 0.1, + 0.1, + x, + y + ]; + zr.addShape(newShape); + newShape._animating = true; + zr.animate(newShape.id, '').when(duration, { + scale: [ + 1, + 1, + x, + y + ] + }).done(function () { + newShape._animating = false; + }).start(easing); + } + function ribbon(zr, oldShape, newShape, duration, easing) { + if (!oldShape) { + oldShape = { + style: { + source0: 0, + source1: newShape.style.source1 > 0 ? 360 : -360, + target0: 0, + target1: newShape.style.target1 > 0 ? 360 : -360 + } + }; + } + var source0 = newShape.style.source0; + var source1 = newShape.style.source1; + var target0 = newShape.style.target0; + var target1 = newShape.style.target1; + if (oldShape.style) { + cloneStyle(newShape, oldShape, 'source0', 'source1', 'target0', 'target1'); + } + zr.addShape(newShape); + newShape._animating = true; + zr.animate(newShape.id, 'style').when(duration, { + source0: source0, + source1: source1, + target0: target0, + target1: target1 + }).done(function () { + newShape._animating = false; + }).start(easing); + } + function gaugePointer(zr, oldShape, newShape, duration, easing) { + if (!oldShape) { + oldShape = { style: { angle: newShape.style.startAngle } }; + } + var angle = newShape.style.angle; + newShape.style.angle = oldShape.style.angle; + zr.addShape(newShape); + newShape._animating = true; + zr.animate(newShape.id, 'style').when(duration, { angle: angle }).done(function () { + newShape._animating = false; + }).start(easing); + } + function icon(zr, oldShape, newShape, duration, easing, delay) { + newShape.style._x = newShape.style.x; + newShape.style._y = newShape.style.y; + newShape.style._width = newShape.style.width; + newShape.style._height = newShape.style.height; + if (!oldShape) { + var x = newShape._x || 0; + var y = newShape._y || 0; + newShape.scale = [ + 0.01, + 0.01, + x, + y + ]; + zr.addShape(newShape); + newShape._animating = true; + zr.animate(newShape.id, '').delay(delay).when(duration, { + scale: [ + 1, + 1, + x, + y + ] + }).done(function () { + newShape._animating = false; + }).start(easing || 'QuinticOut'); + } else { + rectangle(zr, oldShape, newShape, duration, easing); + } + } + function line(zr, oldShape, newShape, duration, easing) { + if (!oldShape) { + oldShape = { + style: { + xStart: newShape.style.xStart, + yStart: newShape.style.yStart, + xEnd: newShape.style.xStart, + yEnd: newShape.style.yStart + } + }; + } + var xStart = newShape.style.xStart; + var xEnd = newShape.style.xEnd; + var yStart = newShape.style.yStart; + var yEnd = newShape.style.yEnd; + cloneStyle(newShape, oldShape, 'xStart', 'xEnd', 'yStart', 'yEnd'); + zr.addShape(newShape); + newShape._animating = true; + zr.animate(newShape.id, 'style').when(duration, { + xStart: xStart, + xEnd: xEnd, + yStart: yStart, + yEnd: yEnd + }).done(function () { + newShape._animating = false; + }).start(easing); + } + function markline(zr, oldShape, newShape, duration, easing) { + if (!newShape.style.smooth) { + newShape.style.pointList = !oldShape ? [ + [ + newShape.style.xStart, + newShape.style.yStart + ], + [ + newShape.style.xStart, + newShape.style.yStart + ] + ] : oldShape.style.pointList; + zr.addShape(newShape); + newShape._animating = true; + zr.animate(newShape.id, 'style').when(duration, { + pointList: [ + [ + newShape.style.xStart, + newShape.style.yStart + ], + [ + newShape._x || 0, + newShape._y || 0 + ] + ] + }).done(function () { + newShape._animating = false; + }).start(easing || 'QuinticOut'); + } else { + if (!oldShape) { + newShape.style.pointListLength = 1; + zr.addShape(newShape); + newShape._animating = true; + newShape.style.pointList = newShape.style.pointList || newShape.getPointList(newShape.style); + zr.animate(newShape.id, 'style').when(duration, { pointListLength: newShape.style.pointList.length }).done(function () { + newShape._animating = false; + }).start(easing || 'QuinticOut'); + } else { + zr.addShape(newShape); + } + } + } + return { + pointList: pointList, + rectangle: rectangle, + candle: candle, + ring: ring, + sector: sector, + text: text, + polygon: polygon, + ribbon: ribbon, + gaugePointer: gaugePointer, + icon: icon, + line: line, + markline: markline + }; +});define('echarts/util/ecEffect', [ + 'require', + '../util/ecData', + 'zrender/shape/Circle', + 'zrender/shape/Image', + '../util/shape/Icon', + '../util/shape/Symbol', + 'zrender/tool/env' +], function (require) { + var ecData = require('../util/ecData'); + var CircleShape = require('zrender/shape/Circle'); + var ImageShape = require('zrender/shape/Image'); + var IconShape = require('../util/shape/Icon'); + var SymbolShape = require('../util/shape/Symbol'); + var canvasSupported = require('zrender/tool/env').canvasSupported; + function point(zr, effectList, shape, zlevel) { + var effect = shape.effect; + var color = effect.color || shape.style.strokeColor || shape.style.color; + var shadowColor = effect.shadowColor || color; + var size = effect.scaleSize; + var distance = effect.bounceDistance; + var shadowBlur = typeof effect.shadowBlur != 'undefined' ? effect.shadowBlur : size; + var effectShape; + if (shape.type !== 'image') { + effectShape = new IconShape({ + zlevel: zlevel, + style: { + brushType: 'stroke', + iconType: shape.style.iconType != 'droplet' ? shape.style.iconType : 'circle', + x: shadowBlur + 1, + y: shadowBlur + 1, + n: shape.style.n, + width: shape.style._width * size, + height: shape.style._height * size, + lineWidth: 1, + strokeColor: color, + shadowColor: shadowColor, + shadowBlur: shadowBlur + }, + draggable: false, + hoverable: false + }); + if (shape.style.iconType == 'pin') { + effectShape.style.y += effectShape.style.height / 2 * 1.5; + } + if (canvasSupported) { + effectShape.style.image = zr.shapeToImage(effectShape, effectShape.style.width + shadowBlur * 2 + 2, effectShape.style.height + shadowBlur * 2 + 2).style.image; + effectShape = new ImageShape({ + zlevel: effectShape.zlevel, + style: effectShape.style, + draggable: false, + hoverable: false + }); + } + } else { + effectShape = new ImageShape({ + zlevel: zlevel, + style: shape.style, + draggable: false, + hoverable: false + }); + } + ecData.clone(shape, effectShape); + effectShape.position = shape.position; + effectList.push(effectShape); + zr.addShape(effectShape); + var devicePixelRatio = shape.type !== 'image' ? window.devicePixelRatio || 1 : 1; + var offset = (effectShape.style.width / devicePixelRatio - shape.style._width) / 2; + effectShape.style.x = shape.style._x - offset; + effectShape.style.y = shape.style._y - offset; + if (shape.style.iconType == 'pin') { + effectShape.style.y -= shape.style.height / 2 * 1.5; + } + var duration = (effect.period + Math.random() * 10) * 100; + zr.modShape(shape.id, { invisible: true }); + var centerX = effectShape.style.x + effectShape.style.width / 2 / devicePixelRatio; + var centerY = effectShape.style.y + effectShape.style.height / 2 / devicePixelRatio; + if (effect.type === 'scale') { + zr.modShape(effectShape.id, { + scale: [ + 0.1, + 0.1, + centerX, + centerY + ] + }); + zr.animate(effectShape.id, '', effect.loop).when(duration, { + scale: [ + 1, + 1, + centerX, + centerY + ] + }).done(function () { + shape.effect.show = false; + zr.delShape(effectShape.id); + }).start(); + } else { + zr.animate(effectShape.id, 'style', effect.loop).when(duration, { y: effectShape.style.y - distance }).when(duration * 2, { y: effectShape.style.y }).done(function () { + shape.effect.show = false; + zr.delShape(effectShape.id); + }).start(); + } + } + function largePoint(zr, effectList, shape, zlevel) { + var effect = shape.effect; + var color = effect.color || shape.style.strokeColor || shape.style.color; + var size = effect.scaleSize; + var shadowColor = effect.shadowColor || color; + var shadowBlur = typeof effect.shadowBlur != 'undefined' ? effect.shadowBlur : size * 2; + var devicePixelRatio = window.devicePixelRatio || 1; + var effectShape = new SymbolShape({ + zlevel: zlevel, + position: shape.position, + scale: shape.scale, + style: { + pointList: shape.style.pointList, + iconType: shape.style.iconType, + color: color, + strokeColor: color, + shadowColor: shadowColor, + shadowBlur: shadowBlur * devicePixelRatio, + random: true, + brushType: 'fill', + lineWidth: 1, + size: shape.style.size + }, + draggable: false, + hoverable: false + }); + effectList.push(effectShape); + zr.addShape(effectShape); + zr.modShape(shape.id, { invisible: true }); + var duration = Math.round(effect.period * 100); + var clip1 = {}; + var clip2 = {}; + for (var i = 0; i < 20; i++) { + effectShape.style['randomMap' + i] = 0; + clip1 = {}; + clip1['randomMap' + i] = 100; + clip2 = {}; + clip2['randomMap' + i] = 0; + effectShape.style['randomMap' + i] = Math.random() * 100; + zr.animate(effectShape.id, 'style', true).when(duration, clip1).when(duration * 2, clip2).when(duration * 3, clip1).when(duration * 4, clip1).delay(Math.random() * duration * i).start(); + } + } + function line(zr, effectList, shape, zlevel) { + var effect = shape.effect; + var color = effect.color || shape.style.strokeColor || shape.style.color; + var shadowColor = effect.shadowColor || shape.style.strokeColor || color; + var size = shape.style.lineWidth * effect.scaleSize; + var shadowBlur = typeof effect.shadowBlur != 'undefined' ? effect.shadowBlur : size; + var effectShape = new CircleShape({ + zlevel: zlevel, + style: { + x: shadowBlur, + y: shadowBlur, + r: size, + color: color, + shadowColor: shadowColor, + shadowBlur: shadowBlur + }, + draggable: false, + hoverable: false + }); + var offset; + if (canvasSupported) { + effectShape.style.image = zr.shapeToImage(effectShape, (size + shadowBlur) * 2, (size + shadowBlur) * 2).style.image; + effectShape = new ImageShape({ + zlevel: effectShape.zlevel, + style: effectShape.style, + draggable: false, + hoverable: false + }); + offset = shadowBlur; + } else { + offset = 0; + } + ecData.clone(shape, effectShape); + effectShape.position = shape.position; + effectList.push(effectShape); + zr.addShape(effectShape); + effectShape.style.x = shape.style.xStart - offset; + effectShape.style.y = shape.style.yStart - offset; + var distance = (shape.style.xStart - shape.style.xEnd) * (shape.style.xStart - shape.style.xEnd) + (shape.style.yStart - shape.style.yEnd) * (shape.style.yStart - shape.style.yEnd); + var duration = Math.round(Math.sqrt(Math.round(distance * effect.period * effect.period))); + if (!shape.style.smooth) { + zr.animate(effectShape.id, 'style', effect.loop).when(duration, { + x: shape._x - offset, + y: shape._y - offset + }).done(function () { + shape.effect.show = false; + zr.delShape(effectShape.id); + }).start(); + } else { + var pointList = shape.style.pointList || shape.getPointList(shape.style); + var len = pointList.length; + duration = Math.round(duration / len); + var deferred = zr.animate(effectShape.id, 'style', effect.loop); + var step = Math.ceil(len / 8); + for (var j = 0; j < len - step; j += step) { + deferred.when(duration * (j + 1), { + x: pointList[j][0] - offset, + y: pointList[j][1] - offset + }); + } + deferred.when(duration * len, { + x: pointList[len - 1][0] - offset, + y: pointList[len - 1][1] - offset + }); + deferred.done(function () { + shape.effect.show = false; + zr.delShape(effectShape.id); + }); + deferred.start('spline'); + } + } + return { + point: point, + largePoint: largePoint, + line: line + }; +});define('echarts/component/base', [ + 'require', + '../config', + '../util/ecData', + '../util/ecQuery', + '../util/number', + 'zrender/tool/util', + 'zrender/tool/env' +], function (require) { + var ecConfig = require('../config'); + var ecData = require('../util/ecData'); + var ecQuery = require('../util/ecQuery'); + var number = require('../util/number'); + var zrUtil = require('zrender/tool/util'); + function Base(ecTheme, messageCenter, zr, option, myChart) { + this.ecTheme = ecTheme; + this.messageCenter = messageCenter; + this.zr = zr; + this.option = option; + this.series = option.series; + this.myChart = myChart; + this.component = myChart.component; + this.shapeList = []; + this.effectList = []; + var self = this; + self._onlegendhoverlink = function (param) { + if (self.legendHoverLink) { + var targetName = param.target; + var name; + for (var i = self.shapeList.length - 1; i >= 0; i--) { + name = self.type == ecConfig.CHART_TYPE_PIE || self.type == ecConfig.CHART_TYPE_FUNNEL ? ecData.get(self.shapeList[i], 'name') : (ecData.get(self.shapeList[i], 'series') || {}).name; + if (name == targetName && !self.shapeList[i].invisible && !self.shapeList[i]._animating) { + self.zr.addHoverShape(self.shapeList[i]); + } + } + } + }; + messageCenter && messageCenter.bind(ecConfig.EVENT.LEGEND_HOVERLINK, this._onlegendhoverlink); + } + Base.prototype = { + canvasSupported: require('zrender/tool/env').canvasSupported, + _getZ: function (zWhat) { + var opt = this.ecTheme[this.type]; + if (opt && opt[zWhat] != null) { + return opt[zWhat]; + } + opt = ecConfig[this.type]; + if (opt && opt[zWhat] != null) { + return opt[zWhat]; + } + return 0; + }, + getZlevelBase: function () { + return this._getZ('zlevel'); + }, + getZBase: function () { + return this._getZ('z'); + }, + reformOption: function (opt) { + return zrUtil.merge(zrUtil.merge(opt || {}, zrUtil.clone(this.ecTheme[this.type] || {})), zrUtil.clone(ecConfig[this.type] || {})); + }, + reformCssArray: function (p) { + if (p instanceof Array) { + switch (p.length + '') { + case '4': + return p; + case '3': + return [ + p[0], + p[1], + p[2], + p[1] + ]; + case '2': + return [ + p[0], + p[1], + p[0], + p[1] + ]; + case '1': + return [ + p[0], + p[0], + p[0], + p[0] + ]; + case '0': + return [ + 0, + 0, + 0, + 0 + ]; + } + } else { + return [ + p, + p, + p, + p + ]; + } + }, + getShapeById: function (id) { + for (var i = 0, l = this.shapeList.length; i < l; i++) { + if (this.shapeList[i].id === id) { + return this.shapeList[i]; + } + } + return null; + }, + getFont: function (textStyle) { + var finalTextStyle = this.getTextStyle(zrUtil.clone(textStyle)); + return finalTextStyle.fontStyle + ' ' + finalTextStyle.fontWeight + ' ' + finalTextStyle.fontSize + 'px ' + finalTextStyle.fontFamily; + }, + getTextStyle: function (targetStyle) { + return zrUtil.merge(zrUtil.merge(targetStyle || {}, this.ecTheme.textStyle), ecConfig.textStyle); + }, + getItemStyleColor: function (itemColor, seriesIndex, dataIndex, data) { + return typeof itemColor === 'function' ? itemColor.call(this.myChart, { + seriesIndex: seriesIndex, + series: this.series[seriesIndex], + dataIndex: dataIndex, + data: data + }) : itemColor; + }, + getDataFromOption: function (data, defaultData) { + return data != null ? data.value != null ? data.value : data : defaultData; + }, + subPixelOptimize: function (position, lineWidth) { + if (lineWidth % 2 === 1) { + position = Math.floor(position) + 0.5; + } else { + position = Math.round(position); + } + return position; + }, + resize: function () { + this.refresh && this.refresh(); + this.clearEffectShape && this.clearEffectShape(true); + var self = this; + setTimeout(function () { + self.animationEffect && self.animationEffect(); + }, 200); + }, + clear: function () { + this.clearEffectShape && this.clearEffectShape(); + this.zr && this.zr.delShape(this.shapeList); + this.shapeList = []; + }, + dispose: function () { + this.onbeforDispose && this.onbeforDispose(); + this.clear(); + this.shapeList = null; + this.effectList = null; + this.messageCenter && this.messageCenter.unbind(ecConfig.EVENT.LEGEND_HOVERLINK, this._onlegendhoverlink); + this.onafterDispose && this.onafterDispose(); + }, + query: ecQuery.query, + deepQuery: ecQuery.deepQuery, + deepMerge: ecQuery.deepMerge, + parsePercent: number.parsePercent, + parseCenter: number.parseCenter, + parseRadius: number.parseRadius, + numAddCommas: number.addCommas + }; + return Base; +});define('zrender/shape/Star', [ + 'require', + '../tool/math', + './Base', + '../tool/util' +], function (require) { + var math = require('../tool/math'); + var sin = math.sin; + var cos = math.cos; + var PI = Math.PI; + var Base = require('./Base'); + var Star = function (options) { + Base.call(this, options); + }; + Star.prototype = { + type: 'star', + buildPath: function (ctx, style) { + var n = style.n; + if (!n || n < 2) { + return; + } + var x = style.x; + var y = style.y; + var r = style.r; + var r0 = style.r0; + if (r0 == null) { + r0 = n > 4 ? r * cos(2 * PI / n) / cos(PI / n) : r / 3; + } + var dStep = PI / n; + var deg = -PI / 2; + var xStart = x + r * cos(deg); + var yStart = y + r * sin(deg); + deg += dStep; + var pointList = style.pointList = []; + pointList.push([ + xStart, + yStart + ]); + for (var i = 0, end = n * 2 - 1, ri; i < end; i++) { + ri = i % 2 === 0 ? r0 : r; + pointList.push([ + x + ri * cos(deg), + y + ri * sin(deg) + ]); + deg += dStep; + } + pointList.push([ + xStart, + yStart + ]); + ctx.moveTo(pointList[0][0], pointList[0][1]); + for (var i = 0; i < pointList.length; i++) { + ctx.lineTo(pointList[i][0], pointList[i][1]); + } + ctx.closePath(); + return; + }, + getRect: function (style) { + if (style.__rect) { + return style.__rect; + } + var lineWidth; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } else { + lineWidth = 0; + } + style.__rect = { + x: Math.round(style.x - style.r - lineWidth / 2), + y: Math.round(style.y - style.r - lineWidth / 2), + width: style.r * 2 + lineWidth, + height: style.r * 2 + lineWidth + }; + return style.__rect; + } + }; + require('../tool/util').inherits(Star, Base); + return Star; +});define('zrender/shape/Heart', [ + 'require', + './Base', + './util/PathProxy', + '../tool/area', + '../tool/util' +], function (require) { + 'use strict'; + var Base = require('./Base'); + var PathProxy = require('./util/PathProxy'); + var area = require('../tool/area'); + var Heart = function (options) { + Base.call(this, options); + this._pathProxy = new PathProxy(); + }; + Heart.prototype = { + type: 'heart', + buildPath: function (ctx, style) { + var path = this._pathProxy || new PathProxy(); + path.begin(ctx); + path.moveTo(style.x, style.y); + path.bezierCurveTo(style.x + style.a / 2, style.y - style.b * 2 / 3, style.x + style.a * 2, style.y + style.b / 3, style.x, style.y + style.b); + path.bezierCurveTo(style.x - style.a * 2, style.y + style.b / 3, style.x - style.a / 2, style.y - style.b * 2 / 3, style.x, style.y); + path.closePath(); + return; + }, + getRect: function (style) { + if (style.__rect) { + return style.__rect; + } + if (!this._pathProxy.isEmpty()) { + this.buildPath(null, style); + } + return this._pathProxy.fastBoundingRect(); + }, + isCover: function (x, y) { + var originPos = this.getTansform(x, y); + x = originPos[0]; + y = originPos[1]; + var rect = this.getRect(this.style); + if (x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height) { + return area.isInsidePath(this._pathProxy.pathCommands, this.style.lineWidth, this.style.brushType, x, y); + } + } + }; + require('../tool/util').inherits(Heart, Base); + return Heart; +});define('zrender/shape/Droplet', [ + 'require', + './Base', + './util/PathProxy', + '../tool/area', + '../tool/util' +], function (require) { + 'use strict'; + var Base = require('./Base'); + var PathProxy = require('./util/PathProxy'); + var area = require('../tool/area'); + var Droplet = function (options) { + Base.call(this, options); + this._pathProxy = new PathProxy(); + }; + Droplet.prototype = { + type: 'droplet', + buildPath: function (ctx, style) { + var path = this._pathProxy || new PathProxy(); + path.begin(ctx); + path.moveTo(style.x, style.y + style.a); + path.bezierCurveTo(style.x + style.a, style.y + style.a, style.x + style.a * 3 / 2, style.y - style.a / 3, style.x, style.y - style.b); + path.bezierCurveTo(style.x - style.a * 3 / 2, style.y - style.a / 3, style.x - style.a, style.y + style.a, style.x, style.y + style.a); + path.closePath(); + }, + getRect: function (style) { + if (style.__rect) { + return style.__rect; + } + if (!this._pathProxy.isEmpty()) { + this.buildPath(null, style); + } + return this._pathProxy.fastBoundingRect(); + }, + isCover: function (x, y) { + var originPos = this.getTansform(x, y); + x = originPos[0]; + y = originPos[1]; + var rect = this.getRect(this.style); + if (x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height) { + return area.isInsidePath(this._pathProxy.pathCommands, this.style.lineWidth, this.style.brushType, x, y); + } + } + }; + require('../tool/util').inherits(Droplet, Base); + return Droplet; +});define('zrender/tool/math', [], function () { + var _radians = Math.PI / 180; + function sin(angle, isDegrees) { + return Math.sin(isDegrees ? angle * _radians : angle); + } + function cos(angle, isDegrees) { + return Math.cos(isDegrees ? angle * _radians : angle); + } + function degreeToRadian(angle) { + return angle * _radians; + } + function radianToDegree(angle) { + return angle / _radians; + } + return { + sin: sin, + cos: cos, + degreeToRadian: degreeToRadian, + radianToDegree: radianToDegree + }; +});define('zrender/shape/util/PathProxy', [ + 'require', + '../../tool/vector' +], function (require) { + var vector = require('../../tool/vector'); + var PathSegment = function (command, points) { + this.command = command; + this.points = points || null; + }; + var PathProxy = function () { + this.pathCommands = []; + this._ctx = null; + this._min = []; + this._max = []; + }; + PathProxy.prototype.fastBoundingRect = function () { + var min = this._min; + var max = this._max; + min[0] = min[1] = Infinity; + max[0] = max[1] = -Infinity; + for (var i = 0; i < this.pathCommands.length; i++) { + var seg = this.pathCommands[i]; + var p = seg.points; + switch (seg.command) { + case 'M': + vector.min(min, min, p); + vector.max(max, max, p); + break; + case 'L': + vector.min(min, min, p); + vector.max(max, max, p); + break; + case 'C': + for (var j = 0; j < 6; j += 2) { + min[0] = Math.min(min[0], min[0], p[j]); + min[1] = Math.min(min[1], min[1], p[j + 1]); + max[0] = Math.max(max[0], max[0], p[j]); + max[1] = Math.max(max[1], max[1], p[j + 1]); + } + break; + case 'Q': + for (var j = 0; j < 4; j += 2) { + min[0] = Math.min(min[0], min[0], p[j]); + min[1] = Math.min(min[1], min[1], p[j + 1]); + max[0] = Math.max(max[0], max[0], p[j]); + max[1] = Math.max(max[1], max[1], p[j + 1]); + } + break; + case 'A': + var cx = p[0]; + var cy = p[1]; + var rx = p[2]; + var ry = p[3]; + min[0] = Math.min(min[0], min[0], cx - rx); + min[1] = Math.min(min[1], min[1], cy - ry); + max[0] = Math.max(max[0], max[0], cx + rx); + max[1] = Math.max(max[1], max[1], cy + ry); + break; + } + } + return { + x: min[0], + y: min[1], + width: max[0] - min[0], + height: max[1] - min[1] + }; + }; + PathProxy.prototype.begin = function (ctx) { + this._ctx = ctx || null; + this.pathCommands.length = 0; + return this; + }; + PathProxy.prototype.moveTo = function (x, y) { + this.pathCommands.push(new PathSegment('M', [ + x, + y + ])); + if (this._ctx) { + this._ctx.moveTo(x, y); + } + return this; + }; + PathProxy.prototype.lineTo = function (x, y) { + this.pathCommands.push(new PathSegment('L', [ + x, + y + ])); + if (this._ctx) { + this._ctx.lineTo(x, y); + } + return this; + }; + PathProxy.prototype.bezierCurveTo = function (x1, y1, x2, y2, x3, y3) { + this.pathCommands.push(new PathSegment('C', [ + x1, + y1, + x2, + y2, + x3, + y3 + ])); + if (this._ctx) { + this._ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3); + } + return this; + }; + PathProxy.prototype.quadraticCurveTo = function (x1, y1, x2, y2) { + this.pathCommands.push(new PathSegment('Q', [ + x1, + y1, + x2, + y2 + ])); + if (this._ctx) { + this._ctx.quadraticCurveTo(x1, y1, x2, y2); + } + return this; + }; + PathProxy.prototype.arc = function (cx, cy, r, startAngle, endAngle, anticlockwise) { + this.pathCommands.push(new PathSegment('A', [ + cx, + cy, + r, + r, + startAngle, + endAngle - startAngle, + 0, + anticlockwise ? 0 : 1 + ])); + if (this._ctx) { + this._ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise); + } + return this; + }; + PathProxy.prototype.arcTo = function (x1, y1, x2, y2, radius) { + if (this._ctx) { + this._ctx.arcTo(x1, y1, x2, y2, radius); + } + return this; + }; + PathProxy.prototype.rect = function (x, y, w, h) { + if (this._ctx) { + this._ctx.rect(x, y, w, h); + } + return this; + }; + PathProxy.prototype.closePath = function () { + this.pathCommands.push(new PathSegment('z')); + if (this._ctx) { + this._ctx.closePath(); + } + return this; + }; + PathProxy.prototype.isEmpty = function () { + return this.pathCommands.length === 0; + }; + PathProxy.PathSegment = PathSegment; + return PathProxy; +});define('zrender/shape/Line', [ + 'require', + './Base', + './util/dashedLineTo', + '../tool/util' +], function (require) { + var Base = require('./Base'); + var dashedLineTo = require('./util/dashedLineTo'); + var Line = function (options) { + this.brushTypeOnly = 'stroke'; + this.textPosition = 'end'; + Base.call(this, options); + }; + Line.prototype = { + type: 'line', + buildPath: function (ctx, style) { + if (!style.lineType || style.lineType == 'solid') { + ctx.moveTo(style.xStart, style.yStart); + ctx.lineTo(style.xEnd, style.yEnd); + } else if (style.lineType == 'dashed' || style.lineType == 'dotted') { + var dashLength = (style.lineWidth || 1) * (style.lineType == 'dashed' ? 5 : 1); + dashedLineTo(ctx, style.xStart, style.yStart, style.xEnd, style.yEnd, dashLength); + } + }, + getRect: function (style) { + if (style.__rect) { + return style.__rect; + } + var lineWidth = style.lineWidth || 1; + style.__rect = { + x: Math.min(style.xStart, style.xEnd) - lineWidth, + y: Math.min(style.yStart, style.yEnd) - lineWidth, + width: Math.abs(style.xStart - style.xEnd) + lineWidth, + height: Math.abs(style.yStart - style.yEnd) + lineWidth + }; + return style.__rect; + } + }; + require('../tool/util').inherits(Line, Base); + return Line; +});define('zrender/shape/Polyline', [ + 'require', + './Base', + './util/smoothSpline', + './util/smoothBezier', + './util/dashedLineTo', + './Polygon', + '../tool/util' +], function (require) { + var Base = require('./Base'); + var smoothSpline = require('./util/smoothSpline'); + var smoothBezier = require('./util/smoothBezier'); + var dashedLineTo = require('./util/dashedLineTo'); + var Polyline = function (options) { + this.brushTypeOnly = 'stroke'; + this.textPosition = 'end'; + Base.call(this, options); + }; + Polyline.prototype = { + type: 'polyline', + buildPath: function (ctx, style) { + var pointList = style.pointList; + if (pointList.length < 2) { + return; + } + var len = Math.min(style.pointList.length, Math.round(style.pointListLength || style.pointList.length)); + if (style.smooth && style.smooth !== 'spline') { + var controlPoints = smoothBezier(pointList, style.smooth, false, style.smoothConstraint); + ctx.moveTo(pointList[0][0], pointList[0][1]); + var cp1; + var cp2; + var p; + for (var i = 0; i < len - 1; i++) { + cp1 = controlPoints[i * 2]; + cp2 = controlPoints[i * 2 + 1]; + p = pointList[i + 1]; + ctx.bezierCurveTo(cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]); + } + } else { + if (style.smooth === 'spline') { + pointList = smoothSpline(pointList); + len = pointList.length; + } + if (!style.lineType || style.lineType == 'solid') { + ctx.moveTo(pointList[0][0], pointList[0][1]); + for (var i = 1; i < len; i++) { + ctx.lineTo(pointList[i][0], pointList[i][1]); + } + } else if (style.lineType == 'dashed' || style.lineType == 'dotted') { + var dashLength = (style.lineWidth || 1) * (style.lineType == 'dashed' ? 5 : 1); + ctx.moveTo(pointList[0][0], pointList[0][1]); + for (var i = 1; i < len; i++) { + dashedLineTo(ctx, pointList[i - 1][0], pointList[i - 1][1], pointList[i][0], pointList[i][1], dashLength); + } + } + } + return; + }, + getRect: function (style) { + return require('./Polygon').prototype.getRect(style); + } + }; + require('../tool/util').inherits(Polyline, Base); + return Polyline; +});define('zrender/shape/util/dashedLineTo', [], function () { + var dashPattern = [ + 5, + 5 + ]; + return function (ctx, x1, y1, x2, y2, dashLength) { + if (ctx.setLineDash) { + dashPattern[0] = dashPattern[1] = dashLength; + ctx.setLineDash(dashPattern); + ctx.moveTo(x1, y1); + ctx.lineTo(x2, y2); + return; + } + dashLength = typeof dashLength != 'number' ? 5 : dashLength; + var dx = x2 - x1; + var dy = y2 - y1; + var numDashes = Math.floor(Math.sqrt(dx * dx + dy * dy) / dashLength); + dx = dx / numDashes; + dy = dy / numDashes; + var flag = true; + for (var i = 0; i < numDashes; ++i) { + if (flag) { + ctx.moveTo(x1, y1); + } else { + ctx.lineTo(x1, y1); + } + flag = !flag; + x1 += dx; + y1 += dy; + } + ctx.lineTo(x2, y2); + }; +});define('zrender/shape/util/smoothSpline', [ + 'require', + '../../tool/vector' +], function (require) { + var vector = require('../../tool/vector'); + function interpolate(p0, p1, p2, p3, t, t2, t3) { + var v0 = (p2 - p0) * 0.5; + var v1 = (p3 - p1) * 0.5; + return (2 * (p1 - p2) + v0 + v1) * t3 + (-3 * (p1 - p2) - 2 * v0 - v1) * t2 + v0 * t + p1; + } + return function (points, isLoop, constraint) { + var len = points.length; + var ret = []; + var distance = 0; + for (var i = 1; i < len; i++) { + distance += vector.distance(points[i - 1], points[i]); + } + var segs = distance / 5; + segs = segs < len ? len : segs; + for (var i = 0; i < segs; i++) { + var pos = i / (segs - 1) * (isLoop ? len : len - 1); + var idx = Math.floor(pos); + var w = pos - idx; + var p0; + var p1 = points[idx % len]; + var p2; + var p3; + if (!isLoop) { + p0 = points[idx === 0 ? idx : idx - 1]; + p2 = points[idx > len - 2 ? len - 1 : idx + 1]; + p3 = points[idx > len - 3 ? len - 1 : idx + 2]; + } else { + p0 = points[(idx - 1 + len) % len]; + p2 = points[(idx + 1) % len]; + p3 = points[(idx + 2) % len]; + } + var w2 = w * w; + var w3 = w * w2; + ret.push([ + interpolate(p0[0], p1[0], p2[0], p3[0], w, w2, w3), + interpolate(p0[1], p1[1], p2[1], p3[1], w, w2, w3) + ]); + } + return ret; + }; +});define('zrender/shape/util/smoothBezier', [ + 'require', + '../../tool/vector' +], function (require) { + var vector = require('../../tool/vector'); + return function (points, smooth, isLoop, constraint) { + var cps = []; + var v = []; + var v1 = []; + var v2 = []; + var prevPoint; + var nextPoint; + var hasConstraint = !!constraint; + var min, max; + if (hasConstraint) { + min = [ + Infinity, + Infinity + ]; + max = [ + -Infinity, + -Infinity + ]; + for (var i = 0, len = points.length; i < len; i++) { + vector.min(min, min, points[i]); + vector.max(max, max, points[i]); + } + vector.min(min, min, constraint[0]); + vector.max(max, max, constraint[1]); + } + for (var i = 0, len = points.length; i < len; i++) { + var point = points[i]; + var prevPoint; + var nextPoint; + if (isLoop) { + prevPoint = points[i ? i - 1 : len - 1]; + nextPoint = points[(i + 1) % len]; + } else { + if (i === 0 || i === len - 1) { + cps.push(points[i]); + continue; + } else { + prevPoint = points[i - 1]; + nextPoint = points[i + 1]; + } + } + vector.sub(v, nextPoint, prevPoint); + vector.scale(v, v, smooth); + var d0 = vector.distance(point, prevPoint); + var d1 = vector.distance(point, nextPoint); + var sum = d0 + d1; + if (sum !== 0) { + d0 /= sum; + d1 /= sum; + } + vector.scale(v1, v, -d0); + vector.scale(v2, v, d1); + var cp0 = vector.add([], point, v1); + var cp1 = vector.add([], point, v2); + if (hasConstraint) { + vector.max(cp0, cp0, min); + vector.min(cp0, cp0, max); + vector.max(cp1, cp1, min); + vector.min(cp1, cp1, max); + } + cps.push(cp0); + cps.push(cp1); + } + if (isLoop) { + cps.push(cps.shift()); + } + return cps; + }; +});define('zrender/shape/Polygon', [ + 'require', + './Base', + './util/smoothSpline', + './util/smoothBezier', + './util/dashedLineTo', + '../tool/util' +], function (require) { + var Base = require('./Base'); + var smoothSpline = require('./util/smoothSpline'); + var smoothBezier = require('./util/smoothBezier'); + var dashedLineTo = require('./util/dashedLineTo'); + var Polygon = function (options) { + Base.call(this, options); + }; + Polygon.prototype = { + type: 'polygon', + buildPath: function (ctx, style) { + var pointList = style.pointList; + if (pointList.length < 2) { + return; + } + if (style.smooth && style.smooth !== 'spline') { + var controlPoints = smoothBezier(pointList, style.smooth, true, style.smoothConstraint); + ctx.moveTo(pointList[0][0], pointList[0][1]); + var cp1; + var cp2; + var p; + var len = pointList.length; + for (var i = 0; i < len; i++) { + cp1 = controlPoints[i * 2]; + cp2 = controlPoints[i * 2 + 1]; + p = pointList[(i + 1) % len]; + ctx.bezierCurveTo(cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]); + } + } else { + if (style.smooth === 'spline') { + pointList = smoothSpline(pointList, true); + } + if (!style.lineType || style.lineType == 'solid') { + ctx.moveTo(pointList[0][0], pointList[0][1]); + for (var i = 1, l = pointList.length; i < l; i++) { + ctx.lineTo(pointList[i][0], pointList[i][1]); + } + ctx.lineTo(pointList[0][0], pointList[0][1]); + } else if (style.lineType == 'dashed' || style.lineType == 'dotted') { + var dashLength = style._dashLength || (style.lineWidth || 1) * (style.lineType == 'dashed' ? 5 : 1); + style._dashLength = dashLength; + ctx.moveTo(pointList[0][0], pointList[0][1]); + for (var i = 1, l = pointList.length; i < l; i++) { + dashedLineTo(ctx, pointList[i - 1][0], pointList[i - 1][1], pointList[i][0], pointList[i][1], dashLength); + } + dashedLineTo(ctx, pointList[pointList.length - 1][0], pointList[pointList.length - 1][1], pointList[0][0], pointList[0][1], dashLength); + } + } + ctx.closePath(); + return; + }, + getRect: function (style) { + if (style.__rect) { + return style.__rect; + } + var minX = Number.MAX_VALUE; + var maxX = Number.MIN_VALUE; + var minY = Number.MAX_VALUE; + var maxY = Number.MIN_VALUE; + var pointList = style.pointList; + for (var i = 0, l = pointList.length; i < l; i++) { + if (pointList[i][0] < minX) { + minX = pointList[i][0]; + } + if (pointList[i][0] > maxX) { + maxX = pointList[i][0]; + } + if (pointList[i][1] < minY) { + minY = pointList[i][1]; + } + if (pointList[i][1] > maxY) { + maxY = pointList[i][1]; + } + } + var lineWidth; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } else { + lineWidth = 0; + } + style.__rect = { + x: Math.round(minX - lineWidth / 2), + y: Math.round(minY - lineWidth / 2), + width: maxX - minX + lineWidth, + height: maxY - minY + lineWidth + }; + return style.__rect; + } + }; + require('../tool/util').inherits(Polygon, Base); + return Polygon; +});define('echarts/util/shape/normalIsCover', [], function () { + return function (x, y) { + var originPos = this.getTansform(x, y); + x = originPos[0]; + y = originPos[1]; + var rect = this.style.__rect; + if (!rect) { + rect = this.style.__rect = this.getRect(this.style); + } + return x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height; + }; +});define('echarts/util/ecQuery', [ + 'require', + 'zrender/tool/util' +], function (require) { + var zrUtil = require('zrender/tool/util'); + function query(optionTarget, optionLocation) { + if (typeof optionTarget == 'undefined') { + return; + } + if (!optionLocation) { + return optionTarget; + } + optionLocation = optionLocation.split('.'); + var length = optionLocation.length; + var curIdx = 0; + while (curIdx < length) { + optionTarget = optionTarget[optionLocation[curIdx]]; + if (typeof optionTarget == 'undefined') { + return; + } + curIdx++; + } + return optionTarget; + } + function deepQuery(ctrList, optionLocation) { + var finalOption; + for (var i = 0, l = ctrList.length; i < l; i++) { + finalOption = query(ctrList[i], optionLocation); + if (typeof finalOption != 'undefined') { + return finalOption; + } + } + } + function deepMerge(ctrList, optionLocation) { + var finalOption; + var len = ctrList.length; + while (len--) { + var tempOption = query(ctrList[len], optionLocation); + if (typeof tempOption != 'undefined') { + if (typeof finalOption == 'undefined') { + finalOption = zrUtil.clone(tempOption); + } else { + zrUtil.merge(finalOption, tempOption, true); + } + } + } + return finalOption; + } + return { + query: query, + deepQuery: deepQuery, + deepMerge: deepMerge + }; +});define('echarts/util/number', [], function () { + function _trim(str) { + return str.replace(/^\s+/, '').replace(/\s+$/, ''); + } + function parsePercent(value, maxValue) { + if (typeof value === 'string') { + if (_trim(value).match(/%$/)) { + return parseFloat(value) / 100 * maxValue; + } + return parseFloat(value); + } + return value; + } + function parseCenter(zr, center) { + return [ + parsePercent(center[0], zr.getWidth()), + parsePercent(center[1], zr.getHeight()) + ]; + } + function parseRadius(zr, radius) { + if (!(radius instanceof Array)) { + radius = [ + 0, + radius + ]; + } + var zrSize = Math.min(zr.getWidth(), zr.getHeight()) / 2; + return [ + parsePercent(radius[0], zrSize), + parsePercent(radius[1], zrSize) + ]; + } + function addCommas(x) { + if (isNaN(x)) { + return '-'; + } + x = (x + '').split('.'); + return x[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g, '$1,') + (x.length > 1 ? '.' + x[1] : ''); + } + return { + parsePercent: parsePercent, + parseCenter: parseCenter, + parseRadius: parseRadius, + addCommas: addCommas + }; +});define('echarts/component/dataView', [ + 'require', + './base', + '../config', + 'zrender/tool/util', + '../component' +], function (require) { + var Base = require('./base'); + var ecConfig = require('../config'); + var zrUtil = require('zrender/tool/util'); + function DataView(ecTheme, messageCenter, zr, option, myChart) { + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + this.dom = myChart.dom; + this._tDom = document.createElement('div'); + this._textArea = document.createElement('textArea'); + this._buttonRefresh = document.createElement('button'); + this._buttonClose = document.createElement('button'); + this._hasShow = false; + this._zrHeight = zr.getHeight(); + this._zrWidth = zr.getWidth(); + this._tDom.className = 'echarts-dataview'; + this.hide(); + this.dom.firstChild.appendChild(this._tDom); + if (window.addEventListener) { + this._tDom.addEventListener('click', this._stop); + this._tDom.addEventListener('mousewheel', this._stop); + this._tDom.addEventListener('mousemove', this._stop); + this._tDom.addEventListener('mousedown', this._stop); + this._tDom.addEventListener('mouseup', this._stop); + this._tDom.addEventListener('touchstart', this._stop); + this._tDom.addEventListener('touchmove', this._stop); + this._tDom.addEventListener('touchend', this._stop); + } else { + this._tDom.attachEvent('onclick', this._stop); + this._tDom.attachEvent('onmousewheel', this._stop); + this._tDom.attachEvent('onmousemove', this._stop); + this._tDom.attachEvent('onmousedown', this._stop); + this._tDom.attachEvent('onmouseup', this._stop); + } + } + DataView.prototype = { + type: ecConfig.COMPONENT_TYPE_DATAVIEW, + _lang: [ + 'Data View', + 'close', + 'refresh' + ], + _gCssText: 'position:absolute;' + 'display:block;' + 'overflow:hidden;' + 'transition:height 0.8s,background-color 1s;' + '-moz-transition:height 0.8s,background-color 1s;' + '-webkit-transition:height 0.8s,background-color 1s;' + '-o-transition:height 0.8s,background-color 1s;' + 'z-index:1;' + 'left:0;' + 'top:0;', + hide: function () { + this._sizeCssText = 'width:' + this._zrWidth + 'px;' + 'height:' + 0 + 'px;' + 'background-color:#f0ffff;'; + this._tDom.style.cssText = this._gCssText + this._sizeCssText; + }, + show: function (newOption) { + this._hasShow = true; + var lang = this.query(this.option, 'toolbox.feature.dataView.lang') || this._lang; + this.option = newOption; + this._tDom.innerHTML = '

' + (lang[0] || this._lang[0]) + '

'; + this._textArea.style.cssText = 'display:block;margin:0 0 8px 0;padding:4px 6px;overflow:auto;' + 'width:' + (this._zrWidth - 15) + 'px;' + 'height:' + (this._zrHeight - 100) + 'px;'; + var customContent = this.query(this.option, 'toolbox.feature.dataView.optionToContent'); + if (typeof customContent != 'function') { + this._textArea.value = this._optionToContent(); + } else { + this._textArea.value = customContent(this.option); + } + this._tDom.appendChild(this._textArea); + this._buttonClose.style.cssText = 'float:right;padding:1px 6px;'; + this._buttonClose.innerHTML = lang[1] || this._lang[1]; + var self = this; + this._buttonClose.onclick = function () { + self.hide(); + }; + this._tDom.appendChild(this._buttonClose); + if (this.query(this.option, 'toolbox.feature.dataView.readOnly') === false) { + this._buttonRefresh.style.cssText = 'float:right;margin-right:10px;padding:1px 6px;'; + this._buttonRefresh.innerHTML = lang[2] || this._lang[2]; + this._buttonRefresh.onclick = function () { + self._save(); + }; + this._tDom.appendChild(this._buttonRefresh); + this._textArea.readOnly = false; + this._textArea.style.cursor = 'default'; + } else { + this._textArea.readOnly = true; + this._textArea.style.cursor = 'text'; + } + this._sizeCssText = 'width:' + this._zrWidth + 'px;' + 'height:' + this._zrHeight + 'px;' + 'background-color:#fff;'; + this._tDom.style.cssText = this._gCssText + this._sizeCssText; + }, + _optionToContent: function () { + var i; + var j; + var k; + var len; + var data; + var valueList; + var axisList = []; + var content = ''; + if (this.option.xAxis) { + if (this.option.xAxis instanceof Array) { + axisList = this.option.xAxis; + } else { + axisList = [this.option.xAxis]; + } + for (i = 0, len = axisList.length; i < len; i++) { + if ((axisList[i].type || 'category') == 'category') { + valueList = []; + for (j = 0, k = axisList[i].data.length; j < k; j++) { + valueList.push(this.getDataFromOption(axisList[i].data[j])); + } + content += valueList.join(', ') + '\n\n'; + } + } + } + if (this.option.yAxis) { + if (this.option.yAxis instanceof Array) { + axisList = this.option.yAxis; + } else { + axisList = [this.option.yAxis]; + } + for (i = 0, len = axisList.length; i < len; i++) { + if (axisList[i].type == 'category') { + valueList = []; + for (j = 0, k = axisList[i].data.length; j < k; j++) { + valueList.push(this.getDataFromOption(axisList[i].data[j])); + } + content += valueList.join(', ') + '\n\n'; + } + } + } + var series = this.option.series; + var itemName; + for (i = 0, len = series.length; i < len; i++) { + valueList = []; + for (j = 0, k = series[i].data.length; j < k; j++) { + data = series[i].data[j]; + if (series[i].type == ecConfig.CHART_TYPE_PIE || series[i].type == ecConfig.CHART_TYPE_MAP) { + itemName = (data.name || '-') + ':'; + } else { + itemName = ''; + } + if (series[i].type == ecConfig.CHART_TYPE_SCATTER) { + data = this.getDataFromOption(data).join(', '); + } + valueList.push(itemName + this.getDataFromOption(data)); + } + content += (series[i].name || '-') + ' : \n'; + content += valueList.join(series[i].type == ecConfig.CHART_TYPE_SCATTER ? '\n' : ', '); + content += '\n\n'; + } + return content; + }, + _save: function () { + var text = this._textArea.value; + var customContent = this.query(this.option, 'toolbox.feature.dataView.contentToOption'); + if (typeof customContent != 'function') { + text = text.split('\n'); + var content = []; + for (var i = 0, l = text.length; i < l; i++) { + text[i] = this._trim(text[i]); + if (text[i] !== '') { + content.push(text[i]); + } + } + this._contentToOption(content); + } else { + customContent(text, this.option); + } + this.hide(); + var self = this; + setTimeout(function () { + self.messageCenter && self.messageCenter.dispatch(ecConfig.EVENT.DATA_VIEW_CHANGED, null, { option: self.option }, self.myChart); + }, self.canvasSupported ? 800 : 100); + }, + _contentToOption: function (content) { + var i; + var j; + var k; + var len; + var data; + var axisList = []; + var contentIdx = 0; + var contentValueList; + var value; + if (this.option.xAxis) { + if (this.option.xAxis instanceof Array) { + axisList = this.option.xAxis; + } else { + axisList = [this.option.xAxis]; + } + for (i = 0, len = axisList.length; i < len; i++) { + if ((axisList[i].type || 'category') == 'category') { + contentValueList = content[contentIdx].split(','); + for (j = 0, k = axisList[i].data.length; j < k; j++) { + value = this._trim(contentValueList[j] || ''); + data = axisList[i].data[j]; + if (typeof axisList[i].data[j].value != 'undefined') { + axisList[i].data[j].value = value; + } else { + axisList[i].data[j] = value; + } + } + contentIdx++; + } + } + } + if (this.option.yAxis) { + if (this.option.yAxis instanceof Array) { + axisList = this.option.yAxis; + } else { + axisList = [this.option.yAxis]; + } + for (i = 0, len = axisList.length; i < len; i++) { + if (axisList[i].type == 'category') { + contentValueList = content[contentIdx].split(','); + for (j = 0, k = axisList[i].data.length; j < k; j++) { + value = this._trim(contentValueList[j] || ''); + data = axisList[i].data[j]; + if (typeof axisList[i].data[j].value != 'undefined') { + axisList[i].data[j].value = value; + } else { + axisList[i].data[j] = value; + } + } + contentIdx++; + } + } + } + var series = this.option.series; + for (i = 0, len = series.length; i < len; i++) { + contentIdx++; + if (series[i].type == ecConfig.CHART_TYPE_SCATTER) { + for (var j = 0, k = series[i].data.length; j < k; j++) { + contentValueList = content[contentIdx]; + value = contentValueList.replace(' ', '').split(','); + if (typeof series[i].data[j].value != 'undefined') { + series[i].data[j].value = value; + } else { + series[i].data[j] = value; + } + contentIdx++; + } + } else { + contentValueList = content[contentIdx].split(','); + for (var j = 0, k = series[i].data.length; j < k; j++) { + value = (contentValueList[j] || '').replace(/.*:/, ''); + value = this._trim(value); + value = value != '-' && value !== '' ? value - 0 : '-'; + if (typeof series[i].data[j].value != 'undefined') { + series[i].data[j].value = value; + } else { + series[i].data[j] = value; + } + } + contentIdx++; + } + } + }, + _trim: function (str) { + var trimer = new RegExp('(^[\\s\\t\\xa0\\u3000]+)|([\\u3000\\xa0\\s\\t]+$)', 'g'); + return str.replace(trimer, ''); + }, + _stop: function (e) { + e = e || window.event; + if (e.stopPropagation) { + e.stopPropagation(); + } else { + e.cancelBubble = true; + } + }, + resize: function () { + this._zrHeight = this.zr.getHeight(); + this._zrWidth = this.zr.getWidth(); + if (this._tDom.offsetHeight > 10) { + this._sizeCssText = 'width:' + this._zrWidth + 'px;' + 'height:' + this._zrHeight + 'px;' + 'background-color:#fff;'; + this._tDom.style.cssText = this._gCssText + this._sizeCssText; + this._textArea.style.cssText = 'display:block;margin:0 0 8px 0;' + 'padding:4px 6px;overflow:auto;' + 'width:' + (this._zrWidth - 15) + 'px;' + 'height:' + (this._zrHeight - 100) + 'px;'; + } + }, + dispose: function () { + if (window.removeEventListener) { + this._tDom.removeEventListener('click', this._stop); + this._tDom.removeEventListener('mousewheel', this._stop); + this._tDom.removeEventListener('mousemove', this._stop); + this._tDom.removeEventListener('mousedown', this._stop); + this._tDom.removeEventListener('mouseup', this._stop); + this._tDom.removeEventListener('touchstart', this._stop); + this._tDom.removeEventListener('touchmove', this._stop); + this._tDom.removeEventListener('touchend', this._stop); + } else { + this._tDom.detachEvent('onclick', this._stop); + this._tDom.detachEvent('onmousewheel', this._stop); + this._tDom.detachEvent('onmousemove', this._stop); + this._tDom.detachEvent('onmousedown', this._stop); + this._tDom.detachEvent('onmouseup', this._stop); + } + this._buttonRefresh.onclick = null; + this._buttonClose.onclick = null; + if (this._hasShow) { + this._tDom.removeChild(this._textArea); + this._tDom.removeChild(this._buttonRefresh); + this._tDom.removeChild(this._buttonClose); + } + this._textArea = null; + this._buttonRefresh = null; + this._buttonClose = null; + this.dom.firstChild.removeChild(this._tDom); + this._tDom = null; + } + }; + zrUtil.inherits(DataView, Base); + require('../component').define('dataView', DataView); + return DataView; +});define('echarts/util/shape/Cross', [ + 'require', + 'zrender/shape/Base', + 'zrender/shape/Line', + 'zrender/tool/util', + './normalIsCover' +], function (require) { + var Base = require('zrender/shape/Base'); + var LineShape = require('zrender/shape/Line'); + var zrUtil = require('zrender/tool/util'); + function Cross(options) { + Base.call(this, options); + } + Cross.prototype = { + type: 'cross', + buildPath: function (ctx, style) { + var rect = style.rect; + style.xStart = rect.x; + style.xEnd = rect.x + rect.width; + style.yStart = style.yEnd = style.y; + LineShape.prototype.buildPath(ctx, style); + style.xStart = style.xEnd = style.x; + style.yStart = rect.y; + style.yEnd = rect.y + rect.height; + LineShape.prototype.buildPath(ctx, style); + }, + getRect: function (style) { + return style.rect; + }, + isCover: require('./normalIsCover') + }; + zrUtil.inherits(Cross, Base); + return Cross; +});define('zrender/shape/Sector', [ + 'require', + '../tool/math', + '../tool/computeBoundingBox', + '../tool/vector', + './Base', + '../tool/util' +], function (require) { + var math = require('../tool/math'); + var computeBoundingBox = require('../tool/computeBoundingBox'); + var vec2 = require('../tool/vector'); + var Base = require('./Base'); + var min0 = vec2.create(); + var min1 = vec2.create(); + var max0 = vec2.create(); + var max1 = vec2.create(); + var Sector = function (options) { + Base.call(this, options); + }; + Sector.prototype = { + type: 'sector', + buildPath: function (ctx, style) { + var x = style.x; + var y = style.y; + var r0 = style.r0 || 0; + var r = style.r; + var startAngle = style.startAngle; + var endAngle = style.endAngle; + var clockWise = style.clockWise || false; + startAngle = math.degreeToRadian(startAngle); + endAngle = math.degreeToRadian(endAngle); + if (!clockWise) { + startAngle = -startAngle; + endAngle = -endAngle; + } + var unitX = math.cos(startAngle); + var unitY = math.sin(startAngle); + ctx.moveTo(unitX * r0 + x, unitY * r0 + y); + ctx.lineTo(unitX * r + x, unitY * r + y); + ctx.arc(x, y, r, startAngle, endAngle, !clockWise); + ctx.lineTo(math.cos(endAngle) * r0 + x, math.sin(endAngle) * r0 + y); + if (r0 !== 0) { + ctx.arc(x, y, r0, endAngle, startAngle, clockWise); + } + ctx.closePath(); + return; + }, + getRect: function (style) { + if (style.__rect) { + return style.__rect; + } + var x = style.x; + var y = style.y; + var r0 = style.r0 || 0; + var r = style.r; + var startAngle = math.degreeToRadian(style.startAngle); + var endAngle = math.degreeToRadian(style.endAngle); + var clockWise = style.clockWise; + if (!clockWise) { + startAngle = -startAngle; + endAngle = -endAngle; + } + if (r0 > 1) { + computeBoundingBox.arc(x, y, r0, startAngle, endAngle, !clockWise, min0, max0); + } else { + min0[0] = max0[0] = x; + min0[1] = max0[1] = y; + } + computeBoundingBox.arc(x, y, r, startAngle, endAngle, !clockWise, min1, max1); + vec2.min(min0, min0, min1); + vec2.max(max0, max0, max1); + style.__rect = { + x: min0[0], + y: min0[1], + width: max0[0] - min0[0], + height: max0[1] - min0[1] + }; + return style.__rect; + } + }; + require('../tool/util').inherits(Sector, Base); + return Sector; +});define('echarts/util/shape/Candle', [ + 'require', + 'zrender/shape/Base', + 'zrender/tool/util', + './normalIsCover' +], function (require) { + var Base = require('zrender/shape/Base'); + var zrUtil = require('zrender/tool/util'); + function Candle(options) { + Base.call(this, options); + } + Candle.prototype = { + type: 'candle', + _numberOrder: function (a, b) { + return b - a; + }, + buildPath: function (ctx, style) { + var yList = zrUtil.clone(style.y).sort(this._numberOrder); + ctx.moveTo(style.x, yList[3]); + ctx.lineTo(style.x, yList[2]); + ctx.moveTo(style.x - style.width / 2, yList[2]); + ctx.rect(style.x - style.width / 2, yList[2], style.width, yList[1] - yList[2]); + ctx.moveTo(style.x, yList[1]); + ctx.lineTo(style.x, yList[0]); + }, + getRect: function (style) { + if (!style.__rect) { + var lineWidth = 0; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } + var yList = zrUtil.clone(style.y).sort(this._numberOrder); + style.__rect = { + x: Math.round(style.x - style.width / 2 - lineWidth / 2), + y: Math.round(yList[3] - lineWidth / 2), + width: style.width + lineWidth, + height: yList[0] - yList[3] + lineWidth + }; + } + return style.__rect; + }, + isCover: require('./normalIsCover') + }; + zrUtil.inherits(Candle, Base); + return Candle; +});define('zrender/tool/computeBoundingBox', [ + 'require', + './vector', + './curve' +], function (require) { + var vec2 = require('./vector'); + var curve = require('./curve'); + function computeBoundingBox(points, min, max) { + if (points.length === 0) { + return; + } + var left = points[0][0]; + var right = points[0][0]; + var top = points[0][1]; + var bottom = points[0][1]; + for (var i = 1; i < points.length; i++) { + var p = points[i]; + if (p[0] < left) { + left = p[0]; + } + if (p[0] > right) { + right = p[0]; + } + if (p[1] < top) { + top = p[1]; + } + if (p[1] > bottom) { + bottom = p[1]; + } + } + min[0] = left; + min[1] = top; + max[0] = right; + max[1] = bottom; + } + function computeCubeBezierBoundingBox(p0, p1, p2, p3, min, max) { + var xDim = []; + curve.cubicExtrema(p0[0], p1[0], p2[0], p3[0], xDim); + for (var i = 0; i < xDim.length; i++) { + xDim[i] = curve.cubicAt(p0[0], p1[0], p2[0], p3[0], xDim[i]); + } + var yDim = []; + curve.cubicExtrema(p0[1], p1[1], p2[1], p3[1], yDim); + for (var i = 0; i < yDim.length; i++) { + yDim[i] = curve.cubicAt(p0[1], p1[1], p2[1], p3[1], yDim[i]); + } + xDim.push(p0[0], p3[0]); + yDim.push(p0[1], p3[1]); + var left = Math.min.apply(null, xDim); + var right = Math.max.apply(null, xDim); + var top = Math.min.apply(null, yDim); + var bottom = Math.max.apply(null, yDim); + min[0] = left; + min[1] = top; + max[0] = right; + max[1] = bottom; + } + function computeQuadraticBezierBoundingBox(p0, p1, p2, min, max) { + var t1 = curve.quadraticExtremum(p0[0], p1[0], p2[0]); + var t2 = curve.quadraticExtremum(p0[1], p1[1], p2[1]); + t1 = Math.max(Math.min(t1, 1), 0); + t2 = Math.max(Math.min(t2, 1), 0); + var ct1 = 1 - t1; + var ct2 = 1 - t2; + var x1 = ct1 * ct1 * p0[0] + 2 * ct1 * t1 * p1[0] + t1 * t1 * p2[0]; + var y1 = ct1 * ct1 * p0[1] + 2 * ct1 * t1 * p1[1] + t1 * t1 * p2[1]; + var x2 = ct2 * ct2 * p0[0] + 2 * ct2 * t2 * p1[0] + t2 * t2 * p2[0]; + var y2 = ct2 * ct2 * p0[1] + 2 * ct2 * t2 * p1[1] + t2 * t2 * p2[1]; + min[0] = Math.min(p0[0], p2[0], x1, x2); + min[1] = Math.min(p0[1], p2[1], y1, y2); + max[0] = Math.max(p0[0], p2[0], x1, x2); + max[1] = Math.max(p0[1], p2[1], y1, y2); + } + var start = vec2.create(); + var end = vec2.create(); + var extremity = vec2.create(); + var computeArcBoundingBox = function (x, y, r, startAngle, endAngle, anticlockwise, min, max) { + if (Math.abs(startAngle - endAngle) >= Math.PI * 2) { + min[0] = x - r; + min[1] = y - r; + max[0] = x + r; + max[1] = y + r; + return; + } + start[0] = Math.cos(startAngle) * r + x; + start[1] = Math.sin(startAngle) * r + y; + end[0] = Math.cos(endAngle) * r + x; + end[1] = Math.sin(endAngle) * r + y; + vec2.min(min, start, end); + vec2.max(max, start, end); + startAngle = startAngle % (Math.PI * 2); + if (startAngle < 0) { + startAngle = startAngle + Math.PI * 2; + } + endAngle = endAngle % (Math.PI * 2); + if (endAngle < 0) { + endAngle = endAngle + Math.PI * 2; + } + if (startAngle > endAngle && !anticlockwise) { + endAngle += Math.PI * 2; + } else if (startAngle < endAngle && anticlockwise) { + startAngle += Math.PI * 2; + } + if (anticlockwise) { + var tmp = endAngle; + endAngle = startAngle; + startAngle = tmp; + } + for (var angle = 0; angle < endAngle; angle += Math.PI / 2) { + if (angle > startAngle) { + extremity[0] = Math.cos(angle) * r + x; + extremity[1] = Math.sin(angle) * r + y; + vec2.min(min, extremity, min); + vec2.max(max, extremity, max); + } + } + }; + computeBoundingBox.cubeBezier = computeCubeBezierBoundingBox; + computeBoundingBox.quadraticBezier = computeQuadraticBezierBoundingBox; + computeBoundingBox.arc = computeArcBoundingBox; + return computeBoundingBox; +});define('echarts/util/shape/Chain', [ + 'require', + 'zrender/shape/Base', + './Icon', + 'zrender/shape/util/dashedLineTo', + 'zrender/tool/util', + 'zrender/tool/matrix' +], function (require) { + var Base = require('zrender/shape/Base'); + var IconShape = require('./Icon'); + var dashedLineTo = require('zrender/shape/util/dashedLineTo'); + var zrUtil = require('zrender/tool/util'); + var matrix = require('zrender/tool/matrix'); + function Chain(options) { + Base.call(this, options); + } + Chain.prototype = { + type: 'chain', + brush: function (ctx, isHighlight) { + var style = this.style; + if (isHighlight) { + style = this.getHighlightStyle(style, this.highlightStyle || {}); + } + ctx.save(); + this.setContext(ctx, style); + this.setTransform(ctx); + ctx.save(); + ctx.beginPath(); + this.buildLinePath(ctx, style); + ctx.stroke(); + ctx.restore(); + this.brushSymbol(ctx, style); + ctx.restore(); + return; + }, + buildLinePath: function (ctx, style) { + var x = style.x; + var y = style.y + 5; + var width = style.width; + var height = style.height / 2 - 10; + ctx.moveTo(x, y); + ctx.lineTo(x, y + height); + ctx.moveTo(x + width, y); + ctx.lineTo(x + width, y + height); + ctx.moveTo(x, y + height / 2); + if (!style.lineType || style.lineType == 'solid') { + ctx.lineTo(x + width, y + height / 2); + } else if (style.lineType == 'dashed' || style.lineType == 'dotted') { + var dashLength = (style.lineWidth || 1) * (style.lineType == 'dashed' ? 5 : 1); + dashedLineTo(ctx, x, y + height / 2, x + width, y + height / 2, dashLength); + } + }, + brushSymbol: function (ctx, style) { + var y = style.y + style.height / 4; + ctx.save(); + var chainPoint = style.chainPoint; + var curPoint; + for (var idx = 0, l = chainPoint.length; idx < l; idx++) { + curPoint = chainPoint[idx]; + if (curPoint.symbol != 'none') { + ctx.beginPath(); + var symbolSize = curPoint.symbolSize; + IconShape.prototype.buildPath(ctx, { + iconType: curPoint.symbol, + x: curPoint.x - symbolSize, + y: y - symbolSize, + width: symbolSize * 2, + height: symbolSize * 2, + n: curPoint.n + }); + ctx.fillStyle = curPoint.isEmpty ? '#fff' : style.strokeColor; + ctx.closePath(); + ctx.fill(); + ctx.stroke(); + } + if (curPoint.showLabel) { + ctx.font = curPoint.textFont; + ctx.fillStyle = curPoint.textColor; + ctx.textAlign = curPoint.textAlign; + ctx.textBaseline = curPoint.textBaseline; + if (curPoint.rotation) { + ctx.save(); + this._updateTextTransform(ctx, curPoint.rotation); + ctx.fillText(curPoint.name, curPoint.textX, curPoint.textY); + ctx.restore(); + } else { + ctx.fillText(curPoint.name, curPoint.textX, curPoint.textY); + } + } + } + ctx.restore(); + }, + _updateTextTransform: function (ctx, rotation) { + var _transform = matrix.create(); + matrix.identity(_transform); + if (rotation[0] !== 0) { + var originX = rotation[1] || 0; + var originY = rotation[2] || 0; + if (originX || originY) { + matrix.translate(_transform, _transform, [ + -originX, + -originY + ]); + } + matrix.rotate(_transform, _transform, rotation[0]); + if (originX || originY) { + matrix.translate(_transform, _transform, [ + originX, + originY + ]); + } + } + ctx.transform.apply(ctx, _transform); + }, + isCover: function (x, y) { + var rect = this.style; + if (x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height) { + return true; + } else { + return false; + } + } + }; + zrUtil.inherits(Chain, Base); + return Chain; +});define('zrender/shape/Ring', [ + 'require', + './Base', + '../tool/util' +], function (require) { + var Base = require('./Base'); + var Ring = function (options) { + Base.call(this, options); + }; + Ring.prototype = { + type: 'ring', + buildPath: function (ctx, style) { + ctx.arc(style.x, style.y, style.r, 0, Math.PI * 2, false); + ctx.moveTo(style.x + style.r0, style.y); + ctx.arc(style.x, style.y, style.r0, 0, Math.PI * 2, true); + return; + }, + getRect: function (style) { + if (style.__rect) { + return style.__rect; + } + var lineWidth; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } else { + lineWidth = 0; + } + style.__rect = { + x: Math.round(style.x - style.r - lineWidth / 2), + y: Math.round(style.y - style.r - lineWidth / 2), + width: style.r * 2 + lineWidth, + height: style.r * 2 + lineWidth + }; + return style.__rect; + } + }; + require('../tool/util').inherits(Ring, Base); + return Ring; +});define('echarts/component/axis', [ + 'require', + './base', + 'zrender/shape/Line', + '../config', + '../util/ecData', + 'zrender/tool/util', + 'zrender/tool/color', + './categoryAxis', + './valueAxis', + '../component' +], function (require) { + var Base = require('./base'); + var LineShape = require('zrender/shape/Line'); + var ecConfig = require('../config'); + var ecData = require('../util/ecData'); + var zrUtil = require('zrender/tool/util'); + var zrColor = require('zrender/tool/color'); + function Axis(ecTheme, messageCenter, zr, option, myChart, axisType) { + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + this.axisType = axisType; + this._axisList = []; + this.refresh(option); + } + Axis.prototype = { + type: ecConfig.COMPONENT_TYPE_AXIS, + axisBase: { + _buildAxisLine: function () { + var lineWidth = this.option.axisLine.lineStyle.width; + var halfLineWidth = lineWidth / 2; + var axShape = { + _axisShape: 'axisLine', + zlevel: this.getZlevelBase(), + z: this.getZBase() + 3, + hoverable: false + }; + var grid = this.grid; + switch (this.option.position) { + case 'left': + axShape.style = { + xStart: grid.getX() - halfLineWidth, + yStart: grid.getYend(), + xEnd: grid.getX() - halfLineWidth, + yEnd: grid.getY(), + lineCap: 'round' + }; + break; + case 'right': + axShape.style = { + xStart: grid.getXend() + halfLineWidth, + yStart: grid.getYend(), + xEnd: grid.getXend() + halfLineWidth, + yEnd: grid.getY(), + lineCap: 'round' + }; + break; + case 'bottom': + axShape.style = { + xStart: grid.getX(), + yStart: grid.getYend() + halfLineWidth, + xEnd: grid.getXend(), + yEnd: grid.getYend() + halfLineWidth, + lineCap: 'round' + }; + break; + case 'top': + axShape.style = { + xStart: grid.getX(), + yStart: grid.getY() - halfLineWidth, + xEnd: grid.getXend(), + yEnd: grid.getY() - halfLineWidth, + lineCap: 'round' + }; + break; + } + var style = axShape.style; + if (this.option.name !== '') { + style.text = this.option.name; + style.textPosition = this.option.nameLocation; + style.textFont = this.getFont(this.option.nameTextStyle); + if (this.option.nameTextStyle.align) { + style.textAlign = this.option.nameTextStyle.align; + } + if (this.option.nameTextStyle.baseline) { + style.textBaseline = this.option.nameTextStyle.baseline; + } + if (this.option.nameTextStyle.color) { + style.textColor = this.option.nameTextStyle.color; + } + } + style.strokeColor = this.option.axisLine.lineStyle.color; + style.lineWidth = lineWidth; + if (this.isHorizontal()) { + style.yStart = style.yEnd = this.subPixelOptimize(style.yEnd, lineWidth); + } else { + style.xStart = style.xEnd = this.subPixelOptimize(style.xEnd, lineWidth); + } + style.lineType = this.option.axisLine.lineStyle.type; + axShape = new LineShape(axShape); + this.shapeList.push(axShape); + }, + _axisLabelClickable: function (clickable, axShape) { + if (clickable) { + ecData.pack(axShape, undefined, -1, undefined, -1, axShape.style.text); + axShape.hoverable = true; + axShape.clickable = true; + axShape.highlightStyle = { + color: zrColor.lift(axShape.style.color, 1), + brushType: 'fill' + }; + return axShape; + } else { + return axShape; + } + }, + refixAxisShape: function (zeroX, zeroY) { + if (!this.option.axisLine.onZero) { + return; + } + var tickLength; + if (this.isHorizontal() && zeroY != null) { + for (var i = 0, l = this.shapeList.length; i < l; i++) { + if (this.shapeList[i]._axisShape === 'axisLine') { + this.shapeList[i].style.yStart = this.shapeList[i].style.yEnd = this.subPixelOptimize(zeroY, this.shapeList[i].stylelineWidth); + this.zr.modShape(this.shapeList[i].id); + } else if (this.shapeList[i]._axisShape === 'axisTick') { + tickLength = this.shapeList[i].style.yEnd - this.shapeList[i].style.yStart; + this.shapeList[i].style.yStart = zeroY - tickLength; + this.shapeList[i].style.yEnd = zeroY; + this.zr.modShape(this.shapeList[i].id); + } + } + } + if (!this.isHorizontal() && zeroX != null) { + for (var i = 0, l = this.shapeList.length; i < l; i++) { + if (this.shapeList[i]._axisShape === 'axisLine') { + this.shapeList[i].style.xStart = this.shapeList[i].style.xEnd = this.subPixelOptimize(zeroX, this.shapeList[i].stylelineWidth); + this.zr.modShape(this.shapeList[i].id); + } else if (this.shapeList[i]._axisShape === 'axisTick') { + tickLength = this.shapeList[i].style.xEnd - this.shapeList[i].style.xStart; + this.shapeList[i].style.xStart = zeroX; + this.shapeList[i].style.xEnd = zeroX + tickLength; + this.zr.modShape(this.shapeList[i].id); + } + } + } + }, + getPosition: function () { + return this.option.position; + }, + isHorizontal: function () { + return this.option.position === 'bottom' || this.option.position === 'top'; + } + }, + reformOption: function (opt) { + if (!opt || opt instanceof Array && opt.length === 0) { + opt = [{ type: ecConfig.COMPONENT_TYPE_AXIS_VALUE }]; + } else if (!(opt instanceof Array)) { + opt = [opt]; + } + if (opt.length > 2) { + opt = [ + opt[0], + opt[1] + ]; + } + if (this.axisType === 'xAxis') { + if (!opt[0].position || opt[0].position != 'bottom' && opt[0].position != 'top') { + opt[0].position = 'bottom'; + } + if (opt.length > 1) { + opt[1].position = opt[0].position === 'bottom' ? 'top' : 'bottom'; + } + for (var i = 0, l = opt.length; i < l; i++) { + opt[i].type = opt[i].type || 'category'; + opt[i].xAxisIndex = i; + opt[i].yAxisIndex = -1; + } + } else { + if (!opt[0].position || opt[0].position != 'left' && opt[0].position != 'right') { + opt[0].position = 'left'; + } + if (opt.length > 1) { + opt[1].position = opt[0].position === 'left' ? 'right' : 'left'; + } + for (var i = 0, l = opt.length; i < l; i++) { + opt[i].type = opt[i].type || 'value'; + opt[i].xAxisIndex = -1; + opt[i].yAxisIndex = i; + } + } + return opt; + }, + refresh: function (newOption) { + var axisOption; + if (newOption) { + this.option = newOption; + if (this.axisType === 'xAxis') { + this.option.xAxis = this.reformOption(newOption.xAxis); + axisOption = this.option.xAxis; + } else { + this.option.yAxis = this.reformOption(newOption.yAxis); + axisOption = this.option.yAxis; + } + this.series = newOption.series; + } + var CategoryAxis = require('./categoryAxis'); + var ValueAxis = require('./valueAxis'); + var len = Math.max(axisOption && axisOption.length || 0, this._axisList.length); + for (var i = 0; i < len; i++) { + if (this._axisList[i] && newOption && (!axisOption[i] || this._axisList[i].type != axisOption[i].type)) { + this._axisList[i].dispose && this._axisList[i].dispose(); + this._axisList[i] = false; + } + if (this._axisList[i]) { + this._axisList[i].refresh && this._axisList[i].refresh(axisOption ? axisOption[i] : false, this.series); + } else if (axisOption && axisOption[i]) { + this._axisList[i] = axisOption[i].type === 'category' ? new CategoryAxis(this.ecTheme, this.messageCenter, this.zr, axisOption[i], this.myChart, this.axisBase) : new ValueAxis(this.ecTheme, this.messageCenter, this.zr, axisOption[i], this.myChart, this.axisBase, this.series); + } + } + }, + getAxis: function (idx) { + return this._axisList[idx]; + }, + clear: function () { + for (var i = 0, l = this._axisList.length; i < l; i++) { + this._axisList[i].dispose && this._axisList[i].dispose(); + } + this._axisList = []; + } + }; + zrUtil.inherits(Axis, Base); + require('../component').define('axis', Axis); + return Axis; +});define('echarts/component/grid', [ + 'require', + './base', + 'zrender/shape/Rectangle', + '../config', + 'zrender/tool/util', + '../component' +], function (require) { + var Base = require('./base'); + var RectangleShape = require('zrender/shape/Rectangle'); + var ecConfig = require('../config'); + ecConfig.grid = { + zlevel: 0, + z: 0, + x: 80, + y: 60, + x2: 80, + y2: 60, + backgroundColor: 'rgba(0,0,0,0)', + borderWidth: 1, + borderColor: '#ccc' + }; + var zrUtil = require('zrender/tool/util'); + function Grid(ecTheme, messageCenter, zr, option, myChart) { + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + this.refresh(option); + } + Grid.prototype = { + type: ecConfig.COMPONENT_TYPE_GRID, + getX: function () { + return this._x; + }, + getY: function () { + return this._y; + }, + getWidth: function () { + return this._width; + }, + getHeight: function () { + return this._height; + }, + getXend: function () { + return this._x + this._width; + }, + getYend: function () { + return this._y + this._height; + }, + getArea: function () { + return { + x: this._x, + y: this._y, + width: this._width, + height: this._height + }; + }, + getBbox: function () { + return [ + [ + this._x, + this._y + ], + [ + this.getXend(), + this.getYend() + ] + ]; + }, + refixAxisShape: function (component) { + var zeroX; + var zeroY; + var axisList = component.xAxis._axisList.concat(component.yAxis ? component.yAxis._axisList : []); + var len = axisList.length; + var axis; + while (len--) { + axis = axisList[len]; + if (axis.type == ecConfig.COMPONENT_TYPE_AXIS_VALUE && axis._min < 0 && axis._max >= 0) { + axis.isHorizontal() ? zeroX = axis.getCoord(0) : zeroY = axis.getCoord(0); + } + } + if (typeof zeroX != 'undefined' || typeof zeroY != 'undefined') { + len = axisList.length; + while (len--) { + axisList[len].refixAxisShape(zeroX, zeroY); + } + } + }, + refresh: function (newOption) { + if (newOption || this._zrWidth != this.zr.getWidth() || this._zrHeight != this.zr.getHeight()) { + this.clear(); + this.option = newOption || this.option; + this.option.grid = this.reformOption(this.option.grid); + var gridOption = this.option.grid; + this._zrWidth = this.zr.getWidth(); + this._zrHeight = this.zr.getHeight(); + this._x = this.parsePercent(gridOption.x, this._zrWidth); + this._y = this.parsePercent(gridOption.y, this._zrHeight); + var x2 = this.parsePercent(gridOption.x2, this._zrWidth); + var y2 = this.parsePercent(gridOption.y2, this._zrHeight); + if (typeof gridOption.width == 'undefined') { + this._width = this._zrWidth - this._x - x2; + } else { + this._width = this.parsePercent(gridOption.width, this._zrWidth); + } + this._width = this._width <= 0 ? 10 : this._width; + if (typeof gridOption.height == 'undefined') { + this._height = this._zrHeight - this._y - y2; + } else { + this._height = this.parsePercent(gridOption.height, this._zrHeight); + } + this._height = this._height <= 0 ? 10 : this._height; + this._x = this.subPixelOptimize(this._x, gridOption.borderWidth); + this._y = this.subPixelOptimize(this._y, gridOption.borderWidth); + this.shapeList.push(new RectangleShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: this._x, + y: this._y, + width: this._width, + height: this._height, + brushType: gridOption.borderWidth > 0 ? 'both' : 'fill', + color: gridOption.backgroundColor, + strokeColor: gridOption.borderColor, + lineWidth: gridOption.borderWidth + } + })); + this.zr.addShape(this.shapeList[0]); + } + } + }; + zrUtil.inherits(Grid, Base); + require('../component').define('grid', Grid); + return Grid; +});define('echarts/component/dataZoom', [ + 'require', + './base', + 'zrender/shape/Rectangle', + 'zrender/shape/Polygon', + '../util/shape/Icon', + '../config', + '../util/date', + 'zrender/tool/util', + '../component' +], function (require) { + var Base = require('./base'); + var RectangleShape = require('zrender/shape/Rectangle'); + var PolygonShape = require('zrender/shape/Polygon'); + var IconShape = require('../util/shape/Icon'); + var ecConfig = require('../config'); + ecConfig.dataZoom = { + zlevel: 0, + z: 4, + show: false, + orient: 'horizontal', + backgroundColor: 'rgba(0,0,0,0)', + dataBackgroundColor: '#eee', + fillerColor: 'rgba(144,197,237,0.2)', + handleColor: 'rgba(70,130,180,0.8)', + handleSize: 8, + showDetail: true, + realtime: true + }; + var ecDate = require('../util/date'); + var zrUtil = require('zrender/tool/util'); + function DataZoom(ecTheme, messageCenter, zr, option, myChart) { + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + var self = this; + self._ondrift = function (dx, dy) { + return self.__ondrift(this, dx, dy); + }; + self._ondragend = function () { + return self.__ondragend(); + }; + this._fillerSize = 30; + this._isSilence = false; + this._zoom = {}; + this.option.dataZoom = this.reformOption(this.option.dataZoom); + this.zoomOption = this.option.dataZoom; + this._handleSize = this.zoomOption.handleSize; + if (!this.myChart.canvasSupported) { + this.zoomOption.realtime = false; + } + this._location = this._getLocation(); + this._zoom = this._getZoom(); + this._backupData(); + if (this.option.dataZoom.show) { + this._buildShape(); + } + this._syncData(); + } + DataZoom.prototype = { + type: ecConfig.COMPONENT_TYPE_DATAZOOM, + _buildShape: function () { + this._buildBackground(); + this._buildFiller(); + this._buildHandle(); + this._buildFrame(); + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + this._syncFrameShape(); + }, + _getLocation: function () { + var x; + var y; + var width; + var height; + var grid = this.component.grid; + if (this.zoomOption.orient == 'horizontal') { + width = this.zoomOption.width || grid.getWidth(); + height = this.zoomOption.height || this._fillerSize; + x = this.zoomOption.x != null ? this.zoomOption.x : grid.getX(); + y = this.zoomOption.y != null ? this.zoomOption.y : this.zr.getHeight() - height - 2; + } else { + width = this.zoomOption.width || this._fillerSize; + height = this.zoomOption.height || grid.getHeight(); + x = this.zoomOption.x != null ? this.zoomOption.x : 2; + y = this.zoomOption.y != null ? this.zoomOption.y : grid.getY(); + } + return { + x: x, + y: y, + width: width, + height: height + }; + }, + _getZoom: function () { + var series = this.option.series; + var xAxis = this.option.xAxis; + if (xAxis && !(xAxis instanceof Array)) { + xAxis = [xAxis]; + this.option.xAxis = xAxis; + } + var yAxis = this.option.yAxis; + if (yAxis && !(yAxis instanceof Array)) { + yAxis = [yAxis]; + this.option.yAxis = yAxis; + } + var zoomSeriesIndex = []; + var xAxisIndex; + var yAxisIndex; + var zOptIdx = this.zoomOption.xAxisIndex; + if (xAxis && zOptIdx == null) { + xAxisIndex = []; + for (var i = 0, l = xAxis.length; i < l; i++) { + if (xAxis[i].type == 'category' || xAxis[i].type == null) { + xAxisIndex.push(i); + } + } + } else { + if (zOptIdx instanceof Array) { + xAxisIndex = zOptIdx; + } else if (zOptIdx != null) { + xAxisIndex = [zOptIdx]; + } else { + xAxisIndex = []; + } + } + zOptIdx = this.zoomOption.yAxisIndex; + if (yAxis && zOptIdx == null) { + yAxisIndex = []; + for (var i = 0, l = yAxis.length; i < l; i++) { + if (yAxis[i].type == 'category') { + yAxisIndex.push(i); + } + } + } else { + if (zOptIdx instanceof Array) { + yAxisIndex = zOptIdx; + } else if (zOptIdx != null) { + yAxisIndex = [zOptIdx]; + } else { + yAxisIndex = []; + } + } + var serie; + for (var i = 0, l = series.length; i < l; i++) { + serie = series[i]; + if (serie.type != ecConfig.CHART_TYPE_LINE && serie.type != ecConfig.CHART_TYPE_BAR && serie.type != ecConfig.CHART_TYPE_SCATTER && serie.type != ecConfig.CHART_TYPE_K) { + continue; + } + for (var j = 0, k = xAxisIndex.length; j < k; j++) { + if (xAxisIndex[j] == (serie.xAxisIndex || 0)) { + zoomSeriesIndex.push(i); + break; + } + } + for (var j = 0, k = yAxisIndex.length; j < k; j++) { + if (yAxisIndex[j] == (serie.yAxisIndex || 0)) { + zoomSeriesIndex.push(i); + break; + } + } + if (this.zoomOption.xAxisIndex == null && this.zoomOption.yAxisIndex == null && serie.data && this.getDataFromOption(serie.data[0]) instanceof Array && (serie.type == ecConfig.CHART_TYPE_SCATTER || serie.type == ecConfig.CHART_TYPE_LINE || serie.type == ecConfig.CHART_TYPE_BAR)) { + zoomSeriesIndex.push(i); + } + } + var start = this._zoom.start != null ? this._zoom.start : this.zoomOption.start != null ? this.zoomOption.start : 0; + var end = this._zoom.end != null ? this._zoom.end : this.zoomOption.end != null ? this.zoomOption.end : 100; + if (start > end) { + start = start + end; + end = start - end; + start = start - end; + } + var size = Math.round((end - start) / 100 * (this.zoomOption.orient == 'horizontal' ? this._location.width : this._location.height)); + return { + start: start, + end: end, + start2: 0, + end2: 100, + size: size, + xAxisIndex: xAxisIndex, + yAxisIndex: yAxisIndex, + seriesIndex: zoomSeriesIndex, + scatterMap: this._zoom.scatterMap || {} + }; + }, + _backupData: function () { + this._originalData = { + xAxis: {}, + yAxis: {}, + series: {} + }; + var xAxis = this.option.xAxis; + var xAxisIndex = this._zoom.xAxisIndex; + for (var i = 0, l = xAxisIndex.length; i < l; i++) { + this._originalData.xAxis[xAxisIndex[i]] = xAxis[xAxisIndex[i]].data; + } + var yAxis = this.option.yAxis; + var yAxisIndex = this._zoom.yAxisIndex; + for (var i = 0, l = yAxisIndex.length; i < l; i++) { + this._originalData.yAxis[yAxisIndex[i]] = yAxis[yAxisIndex[i]].data; + } + var series = this.option.series; + var seriesIndex = this._zoom.seriesIndex; + var serie; + for (var i = 0, l = seriesIndex.length; i < l; i++) { + serie = series[seriesIndex[i]]; + this._originalData.series[seriesIndex[i]] = serie.data; + if (serie.data && this.getDataFromOption(serie.data[0]) instanceof Array && (serie.type == ecConfig.CHART_TYPE_SCATTER || serie.type == ecConfig.CHART_TYPE_LINE || serie.type == ecConfig.CHART_TYPE_BAR)) { + this._backupScale(); + this._calculScatterMap(seriesIndex[i]); + } + } + }, + _calculScatterMap: function (seriesIndex) { + this._zoom.scatterMap = this._zoom.scatterMap || {}; + this._zoom.scatterMap[seriesIndex] = this._zoom.scatterMap[seriesIndex] || {}; + var componentLibrary = require('../component'); + var Axis = componentLibrary.get('axis'); + var axisOption = zrUtil.clone(this.option.xAxis); + if (axisOption[0].type == 'category') { + axisOption[0].type = 'value'; + } + if (axisOption[1] && axisOption[1].type == 'category') { + axisOption[1].type = 'value'; + } + var vAxis = new Axis(this.ecTheme, null, false, { + xAxis: axisOption, + series: this.option.series + }, this, 'xAxis'); + var axisIndex = this.option.series[seriesIndex].xAxisIndex || 0; + this._zoom.scatterMap[seriesIndex].x = vAxis.getAxis(axisIndex).getExtremum(); + vAxis.dispose(); + axisOption = zrUtil.clone(this.option.yAxis); + if (axisOption[0].type == 'category') { + axisOption[0].type = 'value'; + } + if (axisOption[1] && axisOption[1].type == 'category') { + axisOption[1].type = 'value'; + } + vAxis = new Axis(this.ecTheme, null, false, { + yAxis: axisOption, + series: this.option.series + }, this, 'yAxis'); + axisIndex = this.option.series[seriesIndex].yAxisIndex || 0; + this._zoom.scatterMap[seriesIndex].y = vAxis.getAxis(axisIndex).getExtremum(); + vAxis.dispose(); + }, + _buildBackground: function () { + var width = this._location.width; + var height = this._location.height; + this.shapeList.push(new RectangleShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: this._location.x, + y: this._location.y, + width: width, + height: height, + color: this.zoomOption.backgroundColor + } + })); + var maxLength = 0; + var xAxis = this._originalData.xAxis; + var xAxisIndex = this._zoom.xAxisIndex; + for (var i = 0, l = xAxisIndex.length; i < l; i++) { + maxLength = Math.max(maxLength, xAxis[xAxisIndex[i]].length); + } + var yAxis = this._originalData.yAxis; + var yAxisIndex = this._zoom.yAxisIndex; + for (var i = 0, l = yAxisIndex.length; i < l; i++) { + maxLength = Math.max(maxLength, yAxis[yAxisIndex[i]].length); + } + var seriesIndex = this._zoom.seriesIndex[0]; + var data = this._originalData.series[seriesIndex]; + var maxValue = Number.MIN_VALUE; + var minValue = Number.MAX_VALUE; + var value; + for (var i = 0, l = data.length; i < l; i++) { + value = this.getDataFromOption(data[i], 0); + if (this.option.series[seriesIndex].type == ecConfig.CHART_TYPE_K) { + value = value[1]; + } + if (isNaN(value)) { + value = 0; + } + maxValue = Math.max(maxValue, value); + minValue = Math.min(minValue, value); + } + var valueRange = maxValue - minValue; + var pointList = []; + var x = width / (maxLength - (maxLength > 1 ? 1 : 0)); + var y = height / (maxLength - (maxLength > 1 ? 1 : 0)); + var step = 1; + if (this.zoomOption.orient == 'horizontal' && x < 1) { + step = Math.floor(maxLength * 3 / width); + } else if (this.zoomOption.orient == 'vertical' && y < 1) { + step = Math.floor(maxLength * 3 / height); + } + for (var i = 0, l = maxLength; i < l; i += step) { + value = this.getDataFromOption(data[i], 0); + if (this.option.series[seriesIndex].type == ecConfig.CHART_TYPE_K) { + value = value[1]; + } + if (isNaN(value)) { + value = 0; + } + if (this.zoomOption.orient == 'horizontal') { + pointList.push([ + this._location.x + x * i, + this._location.y + height - 1 - Math.round((value - minValue) / valueRange * (height - 10)) + ]); + } else { + pointList.push([ + this._location.x + 1 + Math.round((value - minValue) / valueRange * (width - 10)), + this._location.y + y * (l - i - 1) + ]); + } + } + if (this.zoomOption.orient == 'horizontal') { + pointList.push([ + this._location.x + width, + this._location.y + height + ]); + pointList.push([ + this._location.x, + this._location.y + height + ]); + } else { + pointList.push([ + this._location.x, + this._location.y + ]); + pointList.push([ + this._location.x, + this._location.y + height + ]); + } + this.shapeList.push(new PolygonShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + pointList: pointList, + color: this.zoomOption.dataBackgroundColor + }, + hoverable: false + })); + }, + _buildFiller: function () { + this._fillerShae = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + draggable: true, + ondrift: this._ondrift, + ondragend: this._ondragend, + _type: 'filler' + }; + if (this.zoomOption.orient == 'horizontal') { + this._fillerShae.style = { + x: this._location.x + Math.round(this._zoom.start / 100 * this._location.width) + this._handleSize, + y: this._location.y, + width: this._zoom.size - this._handleSize * 2, + height: this._location.height, + color: this.zoomOption.fillerColor, + text: ':::', + textPosition: 'inside' + }; + } else { + this._fillerShae.style = { + x: this._location.x, + y: this._location.y + Math.round(this._zoom.start / 100 * this._location.height) + this._handleSize, + width: this._location.width, + height: this._zoom.size - this._handleSize * 2, + color: this.zoomOption.fillerColor, + text: '::', + textPosition: 'inside' + }; + } + this._fillerShae.highlightStyle = { + brushType: 'fill', + color: 'rgba(0,0,0,0)' + }; + this._fillerShae = new RectangleShape(this._fillerShae); + this.shapeList.push(this._fillerShae); + }, + _buildHandle: function () { + var detail = this.zoomOption.showDetail ? this._getDetail() : { + start: '', + end: '' + }; + this._startShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + draggable: true, + style: { + iconType: 'rectangle', + x: this._location.x, + y: this._location.y, + width: this._handleSize, + height: this._handleSize, + color: this.zoomOption.handleColor, + text: '=', + textPosition: 'inside' + }, + highlightStyle: { + text: detail.start, + brushType: 'fill', + textPosition: 'left' + }, + ondrift: this._ondrift, + ondragend: this._ondragend + }; + if (this.zoomOption.orient == 'horizontal') { + this._startShape.style.height = this._location.height; + this._endShape = zrUtil.clone(this._startShape); + this._startShape.style.x = this._fillerShae.style.x - this._handleSize, this._endShape.style.x = this._fillerShae.style.x + this._fillerShae.style.width; + this._endShape.highlightStyle.text = detail.end; + this._endShape.highlightStyle.textPosition = 'right'; + } else { + this._startShape.style.width = this._location.width; + this._endShape = zrUtil.clone(this._startShape); + this._startShape.style.y = this._fillerShae.style.y + this._fillerShae.style.height; + this._startShape.highlightStyle.textPosition = 'bottom'; + this._endShape.style.y = this._fillerShae.style.y - this._handleSize; + this._endShape.highlightStyle.text = detail.end; + this._endShape.highlightStyle.textPosition = 'top'; + } + this._startShape = new IconShape(this._startShape); + this._endShape = new IconShape(this._endShape); + this.shapeList.push(this._startShape); + this.shapeList.push(this._endShape); + }, + _buildFrame: function () { + var x = this.subPixelOptimize(this._location.x, 1); + var y = this.subPixelOptimize(this._location.y, 1); + this._startFrameShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: x, + y: y, + width: this._location.width - (x > this._location.x ? 1 : 0), + height: this._location.height - (y > this._location.y ? 1 : 0), + lineWidth: 1, + brushType: 'stroke', + strokeColor: this.zoomOption.handleColor + } + }; + this._endFrameShape = zrUtil.clone(this._startFrameShape); + this._startFrameShape = new RectangleShape(this._startFrameShape); + this._endFrameShape = new RectangleShape(this._endFrameShape); + this.shapeList.push(this._startFrameShape); + this.shapeList.push(this._endFrameShape); + return; + }, + _syncHandleShape: function () { + if (this.zoomOption.orient == 'horizontal') { + this._startShape.style.x = this._fillerShae.style.x - this._handleSize; + this._endShape.style.x = this._fillerShae.style.x + this._fillerShae.style.width; + this._zoom.start = (this._startShape.style.x - this._location.x) / this._location.width * 100; + this._zoom.end = (this._endShape.style.x + this._handleSize - this._location.x) / this._location.width * 100; + } else { + this._startShape.style.y = this._fillerShae.style.y + this._fillerShae.style.height; + this._endShape.style.y = this._fillerShae.style.y - this._handleSize; + this._zoom.start = (this._location.y + this._location.height - this._startShape.style.y) / this._location.height * 100; + this._zoom.end = (this._location.y + this._location.height - this._endShape.style.y - this._handleSize) / this._location.height * 100; + } + this.zr.modShape(this._startShape.id); + this.zr.modShape(this._endShape.id); + this._syncFrameShape(); + this.zr.refreshNextFrame(); + }, + _syncFillerShape: function () { + var a; + var b; + if (this.zoomOption.orient == 'horizontal') { + a = this._startShape.style.x; + b = this._endShape.style.x; + this._fillerShae.style.x = Math.min(a, b) + this._handleSize; + this._fillerShae.style.width = Math.abs(a - b) - this._handleSize; + this._zoom.start = (Math.min(a, b) - this._location.x) / this._location.width * 100; + this._zoom.end = (Math.max(a, b) + this._handleSize - this._location.x) / this._location.width * 100; + } else { + a = this._startShape.style.y; + b = this._endShape.style.y; + this._fillerShae.style.y = Math.min(a, b) + this._handleSize; + this._fillerShae.style.height = Math.abs(a - b) - this._handleSize; + this._zoom.start = (this._location.y + this._location.height - Math.max(a, b)) / this._location.height * 100; + this._zoom.end = (this._location.y + this._location.height - Math.min(a, b) - this._handleSize) / this._location.height * 100; + } + this.zr.modShape(this._fillerShae.id); + this._syncFrameShape(); + this.zr.refreshNextFrame(); + }, + _syncFrameShape: function () { + if (this.zoomOption.orient == 'horizontal') { + this._startFrameShape.style.width = this._fillerShae.style.x - this._location.x; + this._endFrameShape.style.x = this._fillerShae.style.x + this._fillerShae.style.width; + this._endFrameShape.style.width = this._location.x + this._location.width - this._endFrameShape.style.x; + } else { + this._startFrameShape.style.y = this._fillerShae.style.y + this._fillerShae.style.height; + this._startFrameShape.style.height = this._location.y + this._location.height - this._startFrameShape.style.y; + this._endFrameShape.style.height = this._fillerShae.style.y - this._location.y; + } + this.zr.modShape(this._startFrameShape.id); + this.zr.modShape(this._endFrameShape.id); + }, + _syncShape: function () { + if (!this.zoomOption.show) { + return; + } + if (this.zoomOption.orient == 'horizontal') { + this._startShape.style.x = this._location.x + this._zoom.start / 100 * this._location.width; + this._endShape.style.x = this._location.x + this._zoom.end / 100 * this._location.width - this._handleSize; + this._fillerShae.style.x = this._startShape.style.x + this._handleSize; + this._fillerShae.style.width = this._endShape.style.x - this._startShape.style.x - this._handleSize; + } else { + this._startShape.style.y = this._location.y + this._location.height - this._zoom.start / 100 * this._location.height; + this._endShape.style.y = this._location.y + this._location.height - this._zoom.end / 100 * this._location.height - this._handleSize; + this._fillerShae.style.y = this._endShape.style.y + this._handleSize; + this._fillerShae.style.height = this._startShape.style.y - this._endShape.style.y - this._handleSize; + } + this.zr.modShape(this._startShape.id); + this.zr.modShape(this._endShape.id); + this.zr.modShape(this._fillerShae.id); + this._syncFrameShape(); + this.zr.refresh(); + }, + _syncData: function (dispatchNow) { + var target; + var start; + var end; + var length; + var data; + for (var key in this._originalData) { + target = this._originalData[key]; + for (var idx in target) { + data = target[idx]; + if (data == null) { + continue; + } + length = data.length; + start = Math.floor(this._zoom.start / 100 * length); + end = Math.ceil(this._zoom.end / 100 * length); + if (!(this.getDataFromOption(data[0]) instanceof Array) || this.option[key][idx].type == ecConfig.CHART_TYPE_K) { + this.option[key][idx].data = data.slice(start, end); + } else { + this._setScale(); + this.option[key][idx].data = this._synScatterData(idx, data); + } + } + } + if (!this._isSilence && (this.zoomOption.realtime || dispatchNow)) { + this.messageCenter.dispatch(ecConfig.EVENT.DATA_ZOOM, null, { zoom: this._zoom }, this.myChart); + } + }, + _synScatterData: function (seriesIndex, data) { + if (this._zoom.start === 0 && this._zoom.end == 100 && this._zoom.start2 === 0 && this._zoom.end2 == 100) { + return data; + } + var newData = []; + var scale = this._zoom.scatterMap[seriesIndex]; + var total; + var xStart; + var xEnd; + var yStart; + var yEnd; + if (this.zoomOption.orient == 'horizontal') { + total = scale.x.max - scale.x.min; + xStart = this._zoom.start / 100 * total + scale.x.min; + xEnd = this._zoom.end / 100 * total + scale.x.min; + total = scale.y.max - scale.y.min; + yStart = this._zoom.start2 / 100 * total + scale.y.min; + yEnd = this._zoom.end2 / 100 * total + scale.y.min; + } else { + total = scale.x.max - scale.x.min; + xStart = this._zoom.start2 / 100 * total + scale.x.min; + xEnd = this._zoom.end2 / 100 * total + scale.x.min; + total = scale.y.max - scale.y.min; + yStart = this._zoom.start / 100 * total + scale.y.min; + yEnd = this._zoom.end / 100 * total + scale.y.min; + } + var value; + for (var i = 0, l = data.length; i < l; i++) { + value = data[i].value || data[i]; + if (value[0] >= xStart && value[0] <= xEnd && value[1] >= yStart && value[1] <= yEnd) { + newData.push(data[i]); + } + } + return newData; + }, + _setScale: function () { + var needScale = this._zoom.start !== 0 || this._zoom.end !== 100 || this._zoom.start2 !== 0 || this._zoom.end2 !== 100; + var axis = { + xAxis: this.option.xAxis, + yAxis: this.option.yAxis + }; + for (var key in axis) { + for (var i = 0, l = axis[key].length; i < l; i++) { + axis[key][i].scale = needScale || axis[key][i]._scale; + } + } + }, + _backupScale: function () { + var axis = { + xAxis: this.option.xAxis, + yAxis: this.option.yAxis + }; + for (var key in axis) { + for (var i = 0, l = axis[key].length; i < l; i++) { + axis[key][i]._scale = axis[key][i].scale; + } + } + }, + _getDetail: function () { + var key = this.zoomOption.orient == 'horizontal' ? 'xAxis' : 'yAxis'; + var target = this._originalData[key]; + for (var idx in target) { + var data = target[idx]; + if (data == null) { + continue; + } + var length = data.length; + var start = Math.floor(this._zoom.start / 100 * length); + var end = Math.ceil(this._zoom.end / 100 * length); + end -= end > 0 ? 1 : 0; + return { + start: this.getDataFromOption(data[start]), + end: this.getDataFromOption(data[end]) + }; + } + var seriesIndex = this._zoom.seriesIndex[0]; + var axisIndex = this.option.series[seriesIndex][key + 'Index'] || 0; + var axisType = this.option[key][axisIndex].type; + var min = this._zoom.scatterMap[seriesIndex][key.charAt(0)].min; + var max = this._zoom.scatterMap[seriesIndex][key.charAt(0)].max; + var gap = max - min; + if (axisType == 'value') { + return { + start: min + gap * this._zoom.start / 100, + end: min + gap * this._zoom.end / 100 + }; + } else if (axisType == 'time') { + max = min + gap * this._zoom.end / 100; + min = min + gap * this._zoom.start / 100; + var formatter = ecDate.getAutoFormatter(min, max).formatter; + return { + start: ecDate.format(formatter, min), + end: ecDate.format(formatter, max) + }; + } + return { + start: '', + end: '' + }; + }, + __ondrift: function (shape, dx, dy) { + if (this.zoomOption.zoomLock) { + shape = this._fillerShae; + } + var detailSize = shape._type == 'filler' ? this._handleSize : 0; + if (this.zoomOption.orient == 'horizontal') { + if (shape.style.x + dx - detailSize <= this._location.x) { + shape.style.x = this._location.x + detailSize; + } else if (shape.style.x + dx + shape.style.width + detailSize >= this._location.x + this._location.width) { + shape.style.x = this._location.x + this._location.width - shape.style.width - detailSize; + } else { + shape.style.x += dx; + } + } else { + if (shape.style.y + dy - detailSize <= this._location.y) { + shape.style.y = this._location.y + detailSize; + } else if (shape.style.y + dy + shape.style.height + detailSize >= this._location.y + this._location.height) { + shape.style.y = this._location.y + this._location.height - shape.style.height - detailSize; + } else { + shape.style.y += dy; + } + } + if (shape._type == 'filler') { + this._syncHandleShape(); + } else { + this._syncFillerShape(); + } + if (this.zoomOption.realtime) { + this._syncData(); + } + if (this.zoomOption.showDetail) { + var detail = this._getDetail(); + this._startShape.style.text = this._startShape.highlightStyle.text = detail.start; + this._endShape.style.text = this._endShape.highlightStyle.text = detail.end; + this._startShape.style.textPosition = this._startShape.highlightStyle.textPosition; + this._endShape.style.textPosition = this._endShape.highlightStyle.textPosition; + } + return true; + }, + __ondragend: function () { + if (this.zoomOption.showDetail) { + this._startShape.style.text = this._endShape.style.text = '='; + this._startShape.style.textPosition = this._endShape.style.textPosition = 'inside'; + this.zr.modShape(this._startShape.id); + this.zr.modShape(this._endShape.id); + this.zr.refreshNextFrame(); + } + this.isDragend = true; + }, + ondragend: function (param, status) { + if (!this.isDragend || !param.target) { + return; + } + !this.zoomOption.realtime && this._syncData(); + status.dragOut = true; + status.dragIn = true; + if (!this._isSilence && !this.zoomOption.realtime) { + this.messageCenter.dispatch(ecConfig.EVENT.DATA_ZOOM, null, { zoom: this._zoom }, this.myChart); + } + status.needRefresh = false; + this.isDragend = false; + return; + }, + ondataZoom: function (param, status) { + status.needRefresh = true; + return; + }, + absoluteZoom: function (param) { + this._zoom.start = param.start; + this._zoom.end = param.end; + this._zoom.start2 = param.start2; + this._zoom.end2 = param.end2; + this._syncShape(); + this._syncData(true); + return; + }, + rectZoom: function (param) { + if (!param) { + this._zoom.start = this._zoom.start2 = 0; + this._zoom.end = this._zoom.end2 = 100; + this._syncShape(); + this._syncData(true); + return this._zoom; + } + var gridArea = this.component.grid.getArea(); + var rect = { + x: param.x, + y: param.y, + width: param.width, + height: param.height + }; + if (rect.width < 0) { + rect.x += rect.width; + rect.width = -rect.width; + } + if (rect.height < 0) { + rect.y += rect.height; + rect.height = -rect.height; + } + if (rect.x > gridArea.x + gridArea.width || rect.y > gridArea.y + gridArea.height) { + return false; + } + if (rect.x < gridArea.x) { + rect.x = gridArea.x; + } + if (rect.x + rect.width > gridArea.x + gridArea.width) { + rect.width = gridArea.x + gridArea.width - rect.x; + } + if (rect.y + rect.height > gridArea.y + gridArea.height) { + rect.height = gridArea.y + gridArea.height - rect.y; + } + var total; + var sdx = (rect.x - gridArea.x) / gridArea.width; + var edx = 1 - (rect.x + rect.width - gridArea.x) / gridArea.width; + var sdy = 1 - (rect.y + rect.height - gridArea.y) / gridArea.height; + var edy = (rect.y - gridArea.y) / gridArea.height; + if (this.zoomOption.orient == 'horizontal') { + total = this._zoom.end - this._zoom.start; + this._zoom.start += total * sdx; + this._zoom.end -= total * edx; + total = this._zoom.end2 - this._zoom.start2; + this._zoom.start2 += total * sdy; + this._zoom.end2 -= total * edy; + } else { + total = this._zoom.end - this._zoom.start; + this._zoom.start += total * sdy; + this._zoom.end -= total * edy; + total = this._zoom.end2 - this._zoom.start2; + this._zoom.start2 += total * sdx; + this._zoom.end2 -= total * edx; + } + this._syncShape(); + this._syncData(true); + return this._zoom; + }, + syncBackupData: function (curOption) { + var start; + var target = this._originalData['series']; + var curSeries = curOption.series; + var curData; + for (var i = 0, l = curSeries.length; i < l; i++) { + curData = curSeries[i].data || curSeries[i].eventList; + if (target[i]) { + start = Math.floor(this._zoom.start / 100 * target[i].length); + } else { + start = 0; + } + for (var j = 0, k = curData.length; j < k; j++) { + if (target[i]) { + target[i][j + start] = curData[j]; + } + } + } + }, + syncOption: function (magicOption) { + this.silence(true); + this.option = magicOption; + this.option.dataZoom = this.reformOption(this.option.dataZoom); + this.zoomOption = this.option.dataZoom; + if (!this.myChart.canvasSupported) { + this.zoomOption.realtime = false; + } + this.clear(); + this._location = this._getLocation(); + this._zoom = this._getZoom(); + this._backupData(); + if (this.option.dataZoom && this.option.dataZoom.show) { + this._buildShape(); + } + this._syncData(); + this.silence(false); + }, + silence: function (s) { + this._isSilence = s; + }, + getRealDataIndex: function (sIdx, dIdx) { + if (!this._originalData || this._zoom.start === 0 && this._zoom.end == 100) { + return dIdx; + } + var sreies = this._originalData.series; + if (sreies[sIdx]) { + return Math.floor(this._zoom.start / 100 * sreies[sIdx].length) + dIdx; + } + return -1; + }, + resize: function () { + this.clear(); + this._location = this._getLocation(); + this._zoom = this._getZoom(); + if (this.option.dataZoom.show) { + this._buildShape(); + } + } + }; + zrUtil.inherits(DataZoom, Base); + require('../component').define('dataZoom', DataZoom); + return DataZoom; +});define('echarts/component/categoryAxis', [ + 'require', + './base', + 'zrender/shape/Text', + 'zrender/shape/Line', + 'zrender/shape/Rectangle', + '../config', + 'zrender/tool/util', + 'zrender/tool/area', + '../component' +], function (require) { + var Base = require('./base'); + var TextShape = require('zrender/shape/Text'); + var LineShape = require('zrender/shape/Line'); + var RectangleShape = require('zrender/shape/Rectangle'); + var ecConfig = require('../config'); + ecConfig.categoryAxis = { + zlevel: 0, + z: 0, + show: true, + position: 'bottom', + name: '', + nameLocation: 'end', + nameTextStyle: {}, + boundaryGap: true, + axisLine: { + show: true, + onZero: true, + lineStyle: { + color: '#48b', + width: 2, + type: 'solid' + } + }, + axisTick: { + show: true, + interval: 'auto', + inside: false, + length: 5, + lineStyle: { + color: '#333', + width: 1 + } + }, + axisLabel: { + show: true, + interval: 'auto', + rotate: 0, + margin: 8, + textStyle: { color: '#333' } + }, + splitLine: { + show: true, + lineStyle: { + color: ['#ccc'], + width: 1, + type: 'solid' + } + }, + splitArea: { + show: false, + areaStyle: { + color: [ + 'rgba(250,250,250,0.3)', + 'rgba(200,200,200,0.3)' + ] + } + } + }; + var zrUtil = require('zrender/tool/util'); + var zrArea = require('zrender/tool/area'); + function CategoryAxis(ecTheme, messageCenter, zr, option, myChart, axisBase) { + if (option.data.length < 1) { + console.error('option.data.length < 1.'); + return; + } + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + this.grid = this.component.grid; + for (var method in axisBase) { + this[method] = axisBase[method]; + } + this.refresh(option); + } + CategoryAxis.prototype = { + type: ecConfig.COMPONENT_TYPE_AXIS_CATEGORY, + _getReformedLabel: function (idx) { + var data = this.getDataFromOption(this.option.data[idx]); + var formatter = this.option.data[idx].formatter || this.option.axisLabel.formatter; + if (formatter) { + if (typeof formatter == 'function') { + data = formatter.call(this.myChart, data); + } else if (typeof formatter == 'string') { + data = formatter.replace('{value}', data); + } + } + return data; + }, + _getInterval: function () { + var interval = this.option.axisLabel.interval; + if (interval == 'auto') { + var fontSize = this.option.axisLabel.textStyle.fontSize; + var data = this.option.data; + var dataLength = this.option.data.length; + if (this.isHorizontal()) { + if (dataLength > 3) { + var gap = this.getGap(); + var isEnough = false; + var labelSpace; + var labelSize; + var step = Math.floor(0.5 / gap); + step = step < 1 ? 1 : step; + interval = Math.floor(15 / gap); + while (!isEnough && interval < dataLength) { + interval += step; + isEnough = true; + labelSpace = Math.floor(gap * interval); + for (var i = Math.floor((dataLength - 1) / interval) * interval; i >= 0; i -= interval) { + if (this.option.axisLabel.rotate !== 0) { + labelSize = fontSize; + } else if (data[i].textStyle) { + labelSize = zrArea.getTextWidth(this._getReformedLabel(i), this.getFont(zrUtil.merge(data[i].textStyle, this.option.axisLabel.textStyle))); + } else { + var label = this._getReformedLabel(i) + ''; + var wLen = (label.match(/\w/g) || '').length; + var oLen = label.length - wLen; + labelSize = wLen * fontSize * 2 / 3 + oLen * fontSize; + } + if (labelSpace < labelSize) { + isEnough = false; + break; + } + } + } + } else { + interval = 1; + } + } else { + if (dataLength > 3) { + var gap = this.getGap(); + interval = Math.floor(11 / gap); + while (gap * interval - 6 < fontSize && interval < dataLength) { + interval++; + } + } else { + interval = 1; + } + } + } else { + interval = typeof interval == 'function' ? 1 : interval - 0 + 1; + } + return interval; + }, + _buildShape: function () { + this._interval = this._getInterval(); + if (!this.option.show) { + return; + } + this.option.splitArea.show && this._buildSplitArea(); + this.option.splitLine.show && this._buildSplitLine(); + this.option.axisLine.show && this._buildAxisLine(); + this.option.axisTick.show && this._buildAxisTick(); + this.option.axisLabel.show && this._buildAxisLabel(); + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + }, + _buildAxisTick: function () { + var axShape; + var data = this.option.data; + var dataLength = this.option.data.length; + var tickOption = this.option.axisTick; + var length = tickOption.length; + var color = tickOption.lineStyle.color; + var lineWidth = tickOption.lineStyle.width; + var intervalFunction = typeof tickOption.interval == 'function' ? tickOption.interval : tickOption.interval == 'auto' ? typeof this.option.axisLabel.interval == 'function' ? this.option.axisLabel.interval : false : false; + var interval = intervalFunction ? 1 : tickOption.interval == 'auto' ? this._interval : tickOption.interval - 0 + 1; + var onGap = tickOption.onGap; + var optGap = onGap ? this.getGap() / 2 : typeof onGap == 'undefined' ? this.option.boundaryGap ? this.getGap() / 2 : 0 : 0; + var startIndex = optGap > 0 ? -interval : 0; + if (this.isHorizontal()) { + var yPosition = this.option.position == 'bottom' ? tickOption.inside ? this.grid.getYend() - length - 1 : this.grid.getYend() + 1 : tickOption.inside ? this.grid.getY() + 1 : this.grid.getY() - length - 1; + var x; + for (var i = startIndex; i < dataLength; i += interval) { + if (intervalFunction && !intervalFunction(i, data[i])) { + continue; + } + x = this.subPixelOptimize(this.getCoordByIndex(i) + (i >= 0 ? optGap : 0), lineWidth); + axShape = { + _axisShape: 'axisTick', + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + xStart: x, + yStart: yPosition, + xEnd: x, + yEnd: yPosition + length, + strokeColor: color, + lineWidth: lineWidth + } + }; + this.shapeList.push(new LineShape(axShape)); + } + } else { + var xPosition = this.option.position == 'left' ? tickOption.inside ? this.grid.getX() + 1 : this.grid.getX() - length - 1 : tickOption.inside ? this.grid.getXend() - length - 1 : this.grid.getXend() + 1; + var y; + for (var i = startIndex; i < dataLength; i += interval) { + if (intervalFunction && !intervalFunction(i, data[i])) { + continue; + } + y = this.subPixelOptimize(this.getCoordByIndex(i) - (i >= 0 ? optGap : 0), lineWidth); + axShape = { + _axisShape: 'axisTick', + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + xStart: xPosition, + yStart: y, + xEnd: xPosition + length, + yEnd: y, + strokeColor: color, + lineWidth: lineWidth + } + }; + this.shapeList.push(new LineShape(axShape)); + } + } + }, + _buildAxisLabel: function () { + var axShape; + var data = this.option.data; + var dataLength = this.option.data.length; + var labelOption = this.option.axisLabel; + var rotate = labelOption.rotate; + var margin = labelOption.margin; + var clickable = labelOption.clickable; + var textStyle = labelOption.textStyle; + var intervalFunction = typeof labelOption.interval == 'function' ? labelOption.interval : false; + var dataTextStyle; + if (this.isHorizontal()) { + var yPosition; + var baseLine; + if (this.option.position == 'bottom') { + yPosition = this.grid.getYend() + margin; + baseLine = 'top'; + } else { + yPosition = this.grid.getY() - margin; + baseLine = 'bottom'; + } + for (var i = 0; i < dataLength; i += this._interval) { + if (intervalFunction && !intervalFunction(i, data[i]) || this._getReformedLabel(i) === '') { + continue; + } + dataTextStyle = zrUtil.merge(data[i].textStyle || {}, textStyle); + axShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase() + 3, + hoverable: false, + style: { + x: this.getCoordByIndex(i), + y: yPosition, + color: dataTextStyle.color, + text: this._getReformedLabel(i), + textFont: this.getFont(dataTextStyle), + textAlign: dataTextStyle.align || 'center', + textBaseline: dataTextStyle.baseline || baseLine + } + }; + if (rotate) { + axShape.style.textAlign = rotate > 0 ? this.option.position == 'bottom' ? 'right' : 'left' : this.option.position == 'bottom' ? 'left' : 'right'; + axShape.rotation = [ + rotate * Math.PI / 180, + axShape.style.x, + axShape.style.y + ]; + } + this.shapeList.push(new TextShape(this._axisLabelClickable(clickable, axShape))); + } + } else { + var xPosition; + var align; + if (this.option.position == 'left') { + xPosition = this.grid.getX() - margin; + align = 'right'; + } else { + xPosition = this.grid.getXend() + margin; + align = 'left'; + } + for (var i = 0; i < dataLength; i += this._interval) { + if (intervalFunction && !intervalFunction(i, data[i]) || this._getReformedLabel(i) === '') { + continue; + } + dataTextStyle = zrUtil.merge(data[i].textStyle || {}, textStyle); + axShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase() + 3, + hoverable: false, + style: { + x: xPosition, + y: this.getCoordByIndex(i), + color: dataTextStyle.color, + text: this._getReformedLabel(i), + textFont: this.getFont(dataTextStyle), + textAlign: dataTextStyle.align || align, + textBaseline: dataTextStyle.baseline || i === 0 && this.option.name !== '' ? 'bottom' : i == dataLength - 1 && this.option.name !== '' ? 'top' : 'middle' + } + }; + if (rotate) { + axShape.rotation = [ + rotate * Math.PI / 180, + axShape.style.x, + axShape.style.y + ]; + } + this.shapeList.push(new TextShape(this._axisLabelClickable(clickable, axShape))); + } + } + }, + _buildSplitLine: function () { + var axShape; + var data = this.option.data; + var dataLength = this.option.data.length; + var sLineOption = this.option.splitLine; + var lineType = sLineOption.lineStyle.type; + var lineWidth = sLineOption.lineStyle.width; + var color = sLineOption.lineStyle.color; + color = color instanceof Array ? color : [color]; + var colorLength = color.length; + var intervalFunction = typeof this.option.axisLabel.interval == 'function' ? this.option.axisLabel.interval : false; + var onGap = sLineOption.onGap; + var optGap = onGap ? this.getGap() / 2 : typeof onGap == 'undefined' ? this.option.boundaryGap ? this.getGap() / 2 : 0 : 0; + dataLength -= onGap || typeof onGap == 'undefined' && this.option.boundaryGap ? 1 : 0; + if (this.isHorizontal()) { + var sy = this.grid.getY(); + var ey = this.grid.getYend(); + var x; + for (var i = 0; i < dataLength; i += this._interval) { + if (intervalFunction && !intervalFunction(i, data[i])) { + continue; + } + x = this.subPixelOptimize(this.getCoordByIndex(i) + optGap, lineWidth); + axShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + xStart: x, + yStart: sy, + xEnd: x, + yEnd: ey, + strokeColor: color[i / this._interval % colorLength], + lineType: lineType, + lineWidth: lineWidth + } + }; + this.shapeList.push(new LineShape(axShape)); + } + } else { + var sx = this.grid.getX(); + var ex = this.grid.getXend(); + var y; + for (var i = 0; i < dataLength; i += this._interval) { + if (intervalFunction && !intervalFunction(i, data[i])) { + continue; + } + y = this.subPixelOptimize(this.getCoordByIndex(i) - optGap, lineWidth); + axShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + xStart: sx, + yStart: y, + xEnd: ex, + yEnd: y, + strokeColor: color[i / this._interval % colorLength], + lineType: lineType, + lineWidth: lineWidth + } + }; + this.shapeList.push(new LineShape(axShape)); + } + } + }, + _buildSplitArea: function () { + var axShape; + var data = this.option.data; + var sAreaOption = this.option.splitArea; + var color = sAreaOption.areaStyle.color; + if (!(color instanceof Array)) { + axShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: this.grid.getX(), + y: this.grid.getY(), + width: this.grid.getWidth(), + height: this.grid.getHeight(), + color: color + } + }; + this.shapeList.push(new RectangleShape(axShape)); + } else { + var colorLength = color.length; + var dataLength = this.option.data.length; + var intervalFunction = typeof this.option.axisLabel.interval == 'function' ? this.option.axisLabel.interval : false; + var onGap = sAreaOption.onGap; + var optGap = onGap ? this.getGap() / 2 : typeof onGap == 'undefined' ? this.option.boundaryGap ? this.getGap() / 2 : 0 : 0; + if (this.isHorizontal()) { + var y = this.grid.getY(); + var height = this.grid.getHeight(); + var lastX = this.grid.getX(); + var curX; + for (var i = 0; i <= dataLength; i += this._interval) { + if (intervalFunction && !intervalFunction(i, data[i]) && i < dataLength) { + continue; + } + curX = i < dataLength ? this.getCoordByIndex(i) + optGap : this.grid.getXend(); + axShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: lastX, + y: y, + width: curX - lastX, + height: height, + color: color[i / this._interval % colorLength] + } + }; + this.shapeList.push(new RectangleShape(axShape)); + lastX = curX; + } + } else { + var x = this.grid.getX(); + var width = this.grid.getWidth(); + var lastYend = this.grid.getYend(); + var curY; + for (var i = 0; i <= dataLength; i += this._interval) { + if (intervalFunction && !intervalFunction(i, data[i]) && i < dataLength) { + continue; + } + curY = i < dataLength ? this.getCoordByIndex(i) - optGap : this.grid.getY(); + axShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: x, + y: curY, + width: width, + height: lastYend - curY, + color: color[i / this._interval % colorLength] + } + }; + this.shapeList.push(new RectangleShape(axShape)); + lastYend = curY; + } + } + } + }, + refresh: function (newOption) { + if (newOption) { + this.option = this.reformOption(newOption); + this.option.axisLabel.textStyle = this.getTextStyle(this.option.axisLabel.textStyle); + } + this.clear(); + this._buildShape(); + }, + getGap: function () { + var dataLength = this.option.data.length; + var total = this.isHorizontal() ? this.grid.getWidth() : this.grid.getHeight(); + if (this.option.boundaryGap) { + return total / dataLength; + } else { + return total / (dataLength > 1 ? dataLength - 1 : 1); + } + }, + getCoord: function (value) { + var data = this.option.data; + var dataLength = data.length; + var gap = this.getGap(); + var position = this.option.boundaryGap ? gap / 2 : 0; + for (var i = 0; i < dataLength; i++) { + if (this.getDataFromOption(data[i]) == value) { + if (this.isHorizontal()) { + position = this.grid.getX() + position; + } else { + position = this.grid.getYend() - position; + } + return position; + } + position += gap; + } + }, + getCoordByIndex: function (dataIndex) { + if (dataIndex < 0) { + if (this.isHorizontal()) { + return this.grid.getX(); + } else { + return this.grid.getYend(); + } + } else if (dataIndex > this.option.data.length - 1) { + if (this.isHorizontal()) { + return this.grid.getXend(); + } else { + return this.grid.getY(); + } + } else { + var gap = this.getGap(); + var position = this.option.boundaryGap ? gap / 2 : 0; + position += dataIndex * gap; + if (this.isHorizontal()) { + position = this.grid.getX() + position; + } else { + position = this.grid.getYend() - position; + } + return position; + } + }, + getNameByIndex: function (dataIndex) { + return this.getDataFromOption(this.option.data[dataIndex]); + }, + getIndexByName: function (name) { + var data = this.option.data; + var dataLength = data.length; + for (var i = 0; i < dataLength; i++) { + if (this.getDataFromOption(data[i]) == name) { + return i; + } + } + return -1; + }, + getValueFromCoord: function () { + return ''; + }, + isMainAxis: function (dataIndex) { + return dataIndex % this._interval === 0; + } + }; + zrUtil.inherits(CategoryAxis, Base); + require('../component').define('categoryAxis', CategoryAxis); + return CategoryAxis; +});define('echarts/component/valueAxis', [ + 'require', + './base', + 'zrender/shape/Text', + 'zrender/shape/Line', + 'zrender/shape/Rectangle', + '../config', + '../util/date', + 'zrender/tool/util', + '../util/smartSteps', + '../util/accMath', + '../component' +], function (require) { + var Base = require('./base'); + var TextShape = require('zrender/shape/Text'); + var LineShape = require('zrender/shape/Line'); + var RectangleShape = require('zrender/shape/Rectangle'); + var ecConfig = require('../config'); + ecConfig.valueAxis = { + zlevel: 0, + z: 0, + show: true, + position: 'left', + name: '', + nameLocation: 'end', + nameTextStyle: {}, + boundaryGap: [ + 0, + 0 + ], + axisLine: { + show: true, + onZero: true, + lineStyle: { + color: '#48b', + width: 2, + type: 'solid' + } + }, + axisTick: { + show: false, + inside: false, + length: 5, + lineStyle: { + color: '#333', + width: 1 + } + }, + axisLabel: { + show: true, + rotate: 0, + margin: 8, + textStyle: { color: '#333' } + }, + splitLine: { + show: true, + lineStyle: { + color: ['#ccc'], + width: 1, + type: 'solid' + } + }, + splitArea: { + show: false, + areaStyle: { + color: [ + 'rgba(250,250,250,0.3)', + 'rgba(200,200,200,0.3)' + ] + } + } + }; + var ecDate = require('../util/date'); + var zrUtil = require('zrender/tool/util'); + function ValueAxis(ecTheme, messageCenter, zr, option, myChart, axisBase, series) { + if (!series || series.length === 0) { + console.err('option.series.length == 0.'); + return; + } + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + this.series = series; + this.grid = this.component.grid; + for (var method in axisBase) { + this[method] = axisBase[method]; + } + this.refresh(option, series); + } + ValueAxis.prototype = { + type: ecConfig.COMPONENT_TYPE_AXIS_VALUE, + _buildShape: function () { + this._hasData = false; + this._calculateValue(); + if (!this._hasData || !this.option.show) { + return; + } + this.option.splitArea.show && this._buildSplitArea(); + this.option.splitLine.show && this._buildSplitLine(); + this.option.axisLine.show && this._buildAxisLine(); + this.option.axisTick.show && this._buildAxisTick(); + this.option.axisLabel.show && this._buildAxisLabel(); + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + }, + _buildAxisTick: function () { + var axShape; + var data = this._valueList; + var dataLength = this._valueList.length; + var tickOption = this.option.axisTick; + var length = tickOption.length; + var color = tickOption.lineStyle.color; + var lineWidth = tickOption.lineStyle.width; + if (this.isHorizontal()) { + var yPosition = this.option.position === 'bottom' ? tickOption.inside ? this.grid.getYend() - length - 1 : this.grid.getYend() + 1 : tickOption.inside ? this.grid.getY() + 1 : this.grid.getY() - length - 1; + var x; + for (var i = 0; i < dataLength; i++) { + x = this.subPixelOptimize(this.getCoord(data[i]), lineWidth); + axShape = { + _axisShape: 'axisTick', + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + xStart: x, + yStart: yPosition, + xEnd: x, + yEnd: yPosition + length, + strokeColor: color, + lineWidth: lineWidth + } + }; + this.shapeList.push(new LineShape(axShape)); + } + } else { + var xPosition = this.option.position === 'left' ? tickOption.inside ? this.grid.getX() + 1 : this.grid.getX() - length - 1 : tickOption.inside ? this.grid.getXend() - length - 1 : this.grid.getXend() + 1; + var y; + for (var i = 0; i < dataLength; i++) { + y = this.subPixelOptimize(this.getCoord(data[i]), lineWidth); + axShape = { + _axisShape: 'axisTick', + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + xStart: xPosition, + yStart: y, + xEnd: xPosition + length, + yEnd: y, + strokeColor: color, + lineWidth: lineWidth + } + }; + this.shapeList.push(new LineShape(axShape)); + } + } + }, + _buildAxisLabel: function () { + var axShape; + var data = this._valueList; + var dataLength = this._valueList.length; + var rotate = this.option.axisLabel.rotate; + var margin = this.option.axisLabel.margin; + var clickable = this.option.axisLabel.clickable; + var textStyle = this.option.axisLabel.textStyle; + if (this.isHorizontal()) { + var yPosition; + var baseLine; + if (this.option.position === 'bottom') { + yPosition = this.grid.getYend() + margin; + baseLine = 'top'; + } else { + yPosition = this.grid.getY() - margin; + baseLine = 'bottom'; + } + for (var i = 0; i < dataLength; i++) { + axShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase() + 3, + hoverable: false, + style: { + x: this.getCoord(data[i]), + y: yPosition, + color: typeof textStyle.color === 'function' ? textStyle.color(data[i]) : textStyle.color, + text: this._valueLabel[i], + textFont: this.getFont(textStyle), + textAlign: textStyle.align || 'center', + textBaseline: textStyle.baseline || baseLine + } + }; + if (rotate) { + axShape.style.textAlign = rotate > 0 ? this.option.position === 'bottom' ? 'right' : 'left' : this.option.position === 'bottom' ? 'left' : 'right'; + axShape.rotation = [ + rotate * Math.PI / 180, + axShape.style.x, + axShape.style.y + ]; + } + this.shapeList.push(new TextShape(this._axisLabelClickable(clickable, axShape))); + } + } else { + var xPosition; + var align; + if (this.option.position === 'left') { + xPosition = this.grid.getX() - margin; + align = 'right'; + } else { + xPosition = this.grid.getXend() + margin; + align = 'left'; + } + for (var i = 0; i < dataLength; i++) { + axShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase() + 3, + hoverable: false, + style: { + x: xPosition, + y: this.getCoord(data[i]), + color: typeof textStyle.color === 'function' ? textStyle.color(data[i]) : textStyle.color, + text: this._valueLabel[i], + textFont: this.getFont(textStyle), + textAlign: textStyle.align || align, + textBaseline: textStyle.baseline || (i === 0 && this.option.name !== '' ? 'bottom' : i === dataLength - 1 && this.option.name !== '' ? 'top' : 'middle') + } + }; + if (rotate) { + axShape.rotation = [ + rotate * Math.PI / 180, + axShape.style.x, + axShape.style.y + ]; + } + this.shapeList.push(new TextShape(this._axisLabelClickable(clickable, axShape))); + } + } + }, + _buildSplitLine: function () { + var axShape; + var data = this._valueList; + var dataLength = this._valueList.length; + var sLineOption = this.option.splitLine; + var lineType = sLineOption.lineStyle.type; + var lineWidth = sLineOption.lineStyle.width; + var color = sLineOption.lineStyle.color; + color = color instanceof Array ? color : [color]; + var colorLength = color.length; + if (this.isHorizontal()) { + var sy = this.grid.getY(); + var ey = this.grid.getYend(); + var x; + for (var i = 0; i < dataLength; i++) { + x = this.subPixelOptimize(this.getCoord(data[i]), lineWidth); + axShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + xStart: x, + yStart: sy, + xEnd: x, + yEnd: ey, + strokeColor: color[i % colorLength], + lineType: lineType, + lineWidth: lineWidth + } + }; + this.shapeList.push(new LineShape(axShape)); + } + } else { + var sx = this.grid.getX(); + var ex = this.grid.getXend(); + var y; + for (var i = 0; i < dataLength; i++) { + y = this.subPixelOptimize(this.getCoord(data[i]), lineWidth); + axShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + xStart: sx, + yStart: y, + xEnd: ex, + yEnd: y, + strokeColor: color[i % colorLength], + lineType: lineType, + lineWidth: lineWidth + } + }; + this.shapeList.push(new LineShape(axShape)); + } + } + }, + _buildSplitArea: function () { + var axShape; + var color = this.option.splitArea.areaStyle.color; + if (!(color instanceof Array)) { + axShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: this.grid.getX(), + y: this.grid.getY(), + width: this.grid.getWidth(), + height: this.grid.getHeight(), + color: color + } + }; + this.shapeList.push(new RectangleShape(axShape)); + } else { + var colorLength = color.length; + var data = this._valueList; + var dataLength = this._valueList.length; + if (this.isHorizontal()) { + var y = this.grid.getY(); + var height = this.grid.getHeight(); + var lastX = this.grid.getX(); + var curX; + for (var i = 0; i <= dataLength; i++) { + curX = i < dataLength ? this.getCoord(data[i]) : this.grid.getXend(); + axShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: lastX, + y: y, + width: curX - lastX, + height: height, + color: color[i % colorLength] + } + }; + this.shapeList.push(new RectangleShape(axShape)); + lastX = curX; + } + } else { + var x = this.grid.getX(); + var width = this.grid.getWidth(); + var lastYend = this.grid.getYend(); + var curY; + for (var i = 0; i <= dataLength; i++) { + curY = i < dataLength ? this.getCoord(data[i]) : this.grid.getY(); + axShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: x, + y: curY, + width: width, + height: lastYend - curY, + color: color[i % colorLength] + } + }; + this.shapeList.push(new RectangleShape(axShape)); + lastYend = curY; + } + } + } + }, + _calculateValue: function () { + if (isNaN(this.option.min - 0) || isNaN(this.option.max - 0)) { + var data = {}; + var xIdx; + var yIdx; + var legend = this.component.legend; + for (var i = 0, l = this.series.length; i < l; i++) { + if (this.series[i].type != ecConfig.CHART_TYPE_LINE && this.series[i].type != ecConfig.CHART_TYPE_BAR && this.series[i].type != ecConfig.CHART_TYPE_SCATTER && this.series[i].type != ecConfig.CHART_TYPE_K && this.series[i].type != ecConfig.CHART_TYPE_EVENTRIVER) { + continue; + } + if (legend && !legend.isSelected(this.series[i].name)) { + continue; + } + xIdx = this.series[i].xAxisIndex || 0; + yIdx = this.series[i].yAxisIndex || 0; + if (this.option.xAxisIndex != xIdx && this.option.yAxisIndex != yIdx) { + continue; + } + this._calculSum(data, i); + } + var oriData; + for (var i in data) { + oriData = data[i]; + for (var j = 0, k = oriData.length; j < k; j++) { + if (!isNaN(oriData[j])) { + this._hasData = true; + this._min = oriData[j]; + this._max = oriData[j]; + break; + } + } + if (this._hasData) { + break; + } + } + for (var i in data) { + oriData = data[i]; + for (var j = 0, k = oriData.length; j < k; j++) { + if (!isNaN(oriData[j])) { + this._min = Math.min(this._min, oriData[j]); + this._max = Math.max(this._max, oriData[j]); + } + } + } + var gap = Math.abs(this._max - this._min); + this._min = isNaN(this.option.min - 0) ? this._min - Math.abs(gap * this.option.boundaryGap[0]) : this.option.min - 0; + this._max = isNaN(this.option.max - 0) ? this._max + Math.abs(gap * this.option.boundaryGap[1]) : this.option.max - 0; + if (this._min === this._max) { + if (this._max === 0) { + this._max = 1; + } else if (this._max > 0) { + this._min = this._max / this.option.splitNumber != null ? this.option.splitNumber : 5; + } else { + this._max = this._max / this.option.splitNumber != null ? this.option.splitNumber : 5; + } + } + this.option.type != 'time' ? this._reformValue(this.option.scale) : this._reformTimeValue(); + } else { + this._hasData = true; + this._min = this.option.min - 0; + this._max = this.option.max - 0; + this.option.type != 'time' ? this._customerValue() : this._reformTimeValue(); + } + }, + _calculSum: function (data, i) { + var key = this.series[i].name || 'kener'; + var value; + var oriData; + if (!this.series[i].stack) { + data[key] = data[key] || []; + if (this.series[i].type != ecConfig.CHART_TYPE_EVENTRIVER) { + oriData = this.series[i].data; + for (var j = 0, k = oriData.length; j < k; j++) { + value = this.getDataFromOption(oriData[j]); + if (this.series[i].type === ecConfig.CHART_TYPE_K) { + data[key].push(value[0]); + data[key].push(value[1]); + data[key].push(value[2]); + data[key].push(value[3]); + } else if (value instanceof Array) { + if (this.option.xAxisIndex != -1) { + data[key].push(this.option.type != 'time' ? value[0] : ecDate.getNewDate(value[0])); + } + if (this.option.yAxisIndex != -1) { + data[key].push(this.option.type != 'time' ? value[1] : ecDate.getNewDate(value[1])); + } + } else { + data[key].push(value); + } + } + } else { + oriData = this.series[i].eventList; + for (var j = 0, k = oriData.length; j < k; j++) { + var evolution = oriData[j].evolution; + for (var m = 0, n = evolution.length; m < n; m++) { + data[key].push(ecDate.getNewDate(evolution[m].time)); + } + } + } + } else { + var keyP = '__Magic_Key_Positive__' + this.series[i].stack; + var keyN = '__Magic_Key_Negative__' + this.series[i].stack; + data[keyP] = data[keyP] || []; + data[keyN] = data[keyN] || []; + data[key] = data[key] || []; + oriData = this.series[i].data; + for (var j = 0, k = oriData.length; j < k; j++) { + value = this.getDataFromOption(oriData[j]); + if (value === '-') { + continue; + } + value = value - 0; + if (value >= 0) { + if (data[keyP][j] != null) { + data[keyP][j] += value; + } else { + data[keyP][j] = value; + } + } else { + if (data[keyN][j] != null) { + data[keyN][j] += value; + } else { + data[keyN][j] = value; + } + } + if (this.option.scale) { + data[key].push(value); + } + } + } + }, + _reformValue: function (scale) { + var smartSteps = require('../util/smartSteps'); + var splitNumber = this.option.splitNumber; + if (!scale && this._min >= 0 && this._max >= 0) { + this._min = 0; + } + if (!scale && this._min <= 0 && this._max <= 0) { + this._max = 0; + } + var stepOpt = smartSteps(this._min, this._max, splitNumber); + splitNumber = splitNumber != null ? splitNumber : stepOpt.secs; + this._min = stepOpt.min; + this._max = stepOpt.max; + this._valueList = stepOpt.pnts; + this._reformLabelData(); + }, + _reformTimeValue: function () { + var splitNumber = this.option.splitNumber != null ? this.option.splitNumber : 5; + var curValue = ecDate.getAutoFormatter(this._min, this._max, splitNumber); + var formatter = curValue.formatter; + var gapValue = curValue.gapValue; + this._valueList = [ecDate.getNewDate(this._min)]; + var startGap; + switch (formatter) { + case 'week': + startGap = ecDate.nextMonday(this._min); + break; + case 'month': + startGap = ecDate.nextNthOnMonth(this._min, 1); + break; + case 'quarter': + startGap = ecDate.nextNthOnQuarterYear(this._min, 1); + break; + case 'half-year': + startGap = ecDate.nextNthOnHalfYear(this._min, 1); + break; + case 'year': + startGap = ecDate.nextNthOnYear(this._min, 1); + break; + default: + if (gapValue <= 3600000 * 2) { + startGap = (Math.floor(this._min / gapValue) + 1) * gapValue; + } else { + startGap = ecDate.getNewDate(this._min - -gapValue); + startGap.setHours(Math.round(startGap.getHours() / 6) * 6); + startGap.setMinutes(0); + startGap.setSeconds(0); + } + break; + } + if (startGap - this._min < gapValue / 2) { + startGap -= -gapValue; + } + curValue = ecDate.getNewDate(startGap); + splitNumber *= 1.5; + while (splitNumber-- >= 0) { + if (formatter == 'month' || formatter == 'quarter' || formatter == 'half-year' || formatter == 'year') { + curValue.setDate(1); + } + if (this._max - curValue < gapValue / 2) { + break; + } + this._valueList.push(curValue); + curValue = ecDate.getNewDate(curValue - -gapValue); + } + this._valueList.push(ecDate.getNewDate(this._max)); + this._reformLabelData(formatter); + }, + _customerValue: function () { + var accMath = require('../util/accMath'); + var splitNumber = this.option.splitNumber != null ? this.option.splitNumber : 5; + var splitGap = (this._max - this._min) / splitNumber; + this._valueList = []; + for (var i = 0; i <= splitNumber; i++) { + this._valueList.push(accMath.accAdd(this._min, accMath.accMul(splitGap, i))); + } + this._reformLabelData(); + }, + _reformLabelData: function (timeFormatter) { + this._valueLabel = []; + var formatter = this.option.axisLabel.formatter; + if (formatter) { + for (var i = 0, l = this._valueList.length; i < l; i++) { + if (typeof formatter === 'function') { + this._valueLabel.push(timeFormatter ? formatter.call(this.myChart, this._valueList[i], timeFormatter) : formatter.call(this.myChart, this._valueList[i])); + } else if (typeof formatter === 'string') { + this._valueLabel.push(timeFormatter ? ecDate.format(formatter, this._valueList[i]) : formatter.replace('{value}', this._valueList[i])); + } + } + } else if (timeFormatter) { + for (var i = 0, l = this._valueList.length; i < l; i++) { + this._valueLabel.push(ecDate.format(timeFormatter, this._valueList[i])); + } + } else { + for (var i = 0, l = this._valueList.length; i < l; i++) { + this._valueLabel.push(this.numAddCommas(this._valueList[i])); + } + } + }, + getExtremum: function () { + this._calculateValue(); + return { + min: this._min, + max: this._max + }; + }, + refresh: function (newOption, newSeries) { + if (newOption) { + this.option = this.reformOption(newOption); + this.option.axisLabel.textStyle = zrUtil.merge(this.option.axisLabel.textStyle || {}, this.ecTheme.textStyle); + this.series = newSeries; + } + if (this.zr) { + this.clear(); + this._buildShape(); + } + }, + getCoord: function (value) { + value = value < this._min ? this._min : value; + value = value > this._max ? this._max : value; + var result; + if (!this.isHorizontal()) { + result = this.grid.getYend() - (value - this._min) / (this._max - this._min) * this.grid.getHeight(); + } else { + result = this.grid.getX() + (value - this._min) / (this._max - this._min) * this.grid.getWidth(); + } + return result; + }, + getCoordSize: function (value) { + if (!this.isHorizontal()) { + return Math.abs(value / (this._max - this._min) * this.grid.getHeight()); + } else { + return Math.abs(value / (this._max - this._min) * this.grid.getWidth()); + } + }, + getValueFromCoord: function (coord) { + var result; + if (!this.isHorizontal()) { + coord = coord < this.grid.getY() ? this.grid.getY() : coord; + coord = coord > this.grid.getYend() ? this.grid.getYend() : coord; + result = this._max - (coord - this.grid.getY()) / this.grid.getHeight() * (this._max - this._min); + } else { + coord = coord < this.grid.getX() ? this.grid.getX() : coord; + coord = coord > this.grid.getXend() ? this.grid.getXend() : coord; + result = this._min + (coord - this.grid.getX()) / this.grid.getWidth() * (this._max - this._min); + } + return result.toFixed(2) - 0; + }, + isMaindAxis: function (value) { + for (var i = 0, l = this._valueList.length; i < l; i++) { + if (this._valueList[i] === value) { + return true; + } + } + return false; + } + }; + zrUtil.inherits(ValueAxis, Base); + require('../component').define('valueAxis', ValueAxis); + return ValueAxis; +});define('echarts/util/date', [], function () { + var _timeGap = [ + { + formatter: 'hh : mm : ss', + value: 1000 + }, + { + formatter: 'hh : mm : ss', + value: 1000 * 5 + }, + { + formatter: 'hh : mm : ss', + value: 1000 * 10 + }, + { + formatter: 'hh : mm : ss', + value: 1000 * 15 + }, + { + formatter: 'hh : mm : ss', + value: 1000 * 30 + }, + { + formatter: 'hh : mm\nMM - dd', + value: 60000 + }, + { + formatter: 'hh : mm\nMM - dd', + value: 60000 * 5 + }, + { + formatter: 'hh : mm\nMM - dd', + value: 60000 * 10 + }, + { + formatter: 'hh : mm\nMM - dd', + value: 60000 * 15 + }, + { + formatter: 'hh : mm\nMM - dd', + value: 60000 * 30 + }, + { + formatter: 'hh : mm\nMM - dd', + value: 3600000 + }, + { + formatter: 'hh : mm\nMM - dd', + value: 3600000 * 2 + }, + { + formatter: 'hh : mm\nMM - dd', + value: 3600000 * 6 + }, + { + formatter: 'hh : mm\nMM - dd', + value: 3600000 * 12 + }, + { + formatter: 'MM - dd\nyyyy', + value: 3600000 * 24 + }, + { + formatter: 'week', + value: 3600000 * 24 * 7 + }, + { + formatter: 'month', + value: 3600000 * 24 * 31 + }, + { + formatter: 'quarter', + value: 3600000 * 24 * 380 / 4 + }, + { + formatter: 'half-year', + value: 3600000 * 24 * 380 / 2 + }, + { + formatter: 'year', + value: 3600000 * 24 * 380 + } + ]; + function getAutoFormatter(min, max, splitNumber) { + splitNumber = splitNumber > 1 ? splitNumber : 2; + var curValue; + var totalGap; + var formatter; + var gapValue; + for (var i = 0, l = _timeGap.length; i < l; i++) { + curValue = _timeGap[i].value; + totalGap = Math.ceil(max / curValue) * curValue - Math.floor(min / curValue) * curValue; + if (Math.round(totalGap / curValue) <= splitNumber * 1.2) { + formatter = _timeGap[i].formatter; + gapValue = _timeGap[i].value; + break; + } + } + if (formatter == null) { + formatter = 'year'; + curValue = 3600000 * 24 * 367; + totalGap = Math.ceil(max / curValue) * curValue - Math.floor(min / curValue) * curValue; + gapValue = Math.round(totalGap / (splitNumber - 1) / curValue) * curValue; + } + return { + formatter: formatter, + gapValue: gapValue + }; + } + function s2d(v) { + return v < 10 ? '0' + v : v; + } + function format(formatter, value) { + if (formatter == 'week' || formatter == 'month' || formatter == 'quarter' || formatter == 'half-year' || formatter == 'year') { + formatter = 'MM - dd\nyyyy'; + } + var date = getNewDate(value); + var y = date.getFullYear(); + var M = date.getMonth() + 1; + var d = date.getDate(); + var h = date.getHours(); + var m = date.getMinutes(); + var s = date.getSeconds(); + formatter = formatter.replace('MM', s2d(M)); + formatter = formatter.toLowerCase(); + formatter = formatter.replace('yyyy', y); + formatter = formatter.replace('yy', y % 100); + formatter = formatter.replace('dd', s2d(d)); + formatter = formatter.replace('d', d); + formatter = formatter.replace('hh', s2d(h)); + formatter = formatter.replace('h', h); + formatter = formatter.replace('mm', s2d(m)); + formatter = formatter.replace('m', m); + formatter = formatter.replace('ss', s2d(s)); + formatter = formatter.replace('s', s); + return formatter; + } + function nextMonday(value) { + value = getNewDate(value); + value.setDate(value.getDate() + 8 - value.getDay()); + return value; + } + function nextNthPerNmonth(value, nth, nmon) { + value = getNewDate(value); + value.setMonth(Math.ceil((value.getMonth() + 1) / nmon) * nmon); + value.setDate(nth); + return value; + } + function nextNthOnMonth(value, nth) { + return nextNthPerNmonth(value, nth, 1); + } + function nextNthOnQuarterYear(value, nth) { + return nextNthPerNmonth(value, nth, 3); + } + function nextNthOnHalfYear(value, nth) { + return nextNthPerNmonth(value, nth, 6); + } + function nextNthOnYear(value, nth) { + return nextNthPerNmonth(value, nth, 12); + } + function getNewDate(value) { + return value instanceof Date ? value : new Date(typeof value == 'string' ? value.replace(/-/g, '/') : value); + } + return { + getAutoFormatter: getAutoFormatter, + getNewDate: getNewDate, + format: format, + nextMonday: nextMonday, + nextNthPerNmonth: nextNthPerNmonth, + nextNthOnMonth: nextNthOnMonth, + nextNthOnQuarterYear: nextNthOnQuarterYear, + nextNthOnHalfYear: nextNthOnHalfYear, + nextNthOnYear: nextNthOnYear + }; +});define('echarts/util/smartSteps', [], function () { + var mySteps = [ + 10, + 20, + 25, + 50 + ]; + var mySections = [ + 4, + 5, + 6 + ]; + var custOpts; + var custSteps; + var custSecs; + var minLocked; + var maxLocked; + var MT = Math; + var MATH_ROUND = MT.round; + var MATH_FLOOR = MT.floor; + var MATH_CEIL = MT.ceil; + var MATH_ABS = MT.abs; + function MATH_LOG(n) { + return MT.log(MATH_ABS(n)) / MT.LN10; + } + function MATH_POW(n) { + return MT.pow(10, n); + } + function MATH_ISINT(n) { + return n === MATH_FLOOR(n); + } + function smartSteps(min, max, section, opts) { + custOpts = opts || {}; + custSteps = custOpts.steps || mySteps; + custSecs = custOpts.secs || mySections; + section = MATH_ROUND(+section || 0) % 99; + min = +min || 0; + max = +max || 0; + minLocked = maxLocked = 0; + if ('min' in custOpts) { + min = +custOpts.min || 0; + minLocked = 1; + } + if ('max' in custOpts) { + max = +custOpts.max || 0; + maxLocked = 1; + } + if (min > max) { + max = [ + min, + min = max + ][0]; + } + var span = max - min; + if (minLocked && maxLocked) { + return bothLocked(min, max, section); + } + if (span < (section || 5)) { + if (MATH_ISINT(min) && MATH_ISINT(max)) { + return forInteger(min, max, section); + } else if (span === 0) { + return forSpan0(min, max, section); + } + } + return coreCalc(min, max, section); + } + function makeResult(newMin, newMax, section, expon) { + expon = expon || 0; + var expStep = expNum((newMax - newMin) / section, -1); + var expMin = expNum(newMin, -1, 1); + var expMax = expNum(newMax, -1); + var minExp = MT.min(expStep.e, expMin.e, expMax.e); + if (expMin.c === 0) { + minExp = MT.min(expStep.e, expMax.e); + } else if (expMax.c === 0) { + minExp = MT.min(expStep.e, expMin.e); + } + expFixTo(expStep, { + c: 0, + e: minExp + }); + expFixTo(expMin, expStep, 1); + expFixTo(expMax, expStep); + expon += minExp; + newMin = expMin.c; + newMax = expMax.c; + var step = (newMax - newMin) / section; + var zoom = MATH_POW(expon); + var fixTo = 0; + var points = []; + for (var i = section + 1; i--;) { + points[i] = (newMin + step * i) * zoom; + } + if (expon < 0) { + fixTo = decimals(zoom); + step = +(step * zoom).toFixed(fixTo); + newMin = +(newMin * zoom).toFixed(fixTo); + newMax = +(newMax * zoom).toFixed(fixTo); + for (var i = points.length; i--;) { + points[i] = points[i].toFixed(fixTo); + +points[i] === 0 && (points[i] = '0'); + } + } else { + newMin *= zoom; + newMax *= zoom; + step *= zoom; + } + custSecs = 0; + custSteps = 0; + custOpts = 0; + return { + min: newMin, + max: newMax, + secs: section, + step: step, + fix: fixTo, + exp: expon, + pnts: points + }; + } + function expNum(num, digit, byFloor) { + digit = MATH_ROUND(digit % 10) || 2; + if (digit < 0) { + if (MATH_ISINT(num)) { + digit = ('' + MATH_ABS(num)).replace(/0+$/, '').length || 1; + } else { + num = num.toFixed(15).replace(/0+$/, ''); + digit = num.replace('.', '').replace(/^[-0]+/, '').length; + num = +num; + } + } + var expon = MATH_FLOOR(MATH_LOG(num)) - digit + 1; + var cNum = +(num * MATH_POW(-expon)).toFixed(15) || 0; + cNum = byFloor ? MATH_FLOOR(cNum) : MATH_CEIL(cNum); + !cNum && (expon = 0); + if (('' + MATH_ABS(cNum)).length > digit) { + expon += 1; + cNum /= 10; + } + return { + c: cNum, + e: expon + }; + } + function expFixTo(expnum1, expnum2, byFloor) { + var deltaExp = expnum2.e - expnum1.e; + if (deltaExp) { + expnum1.e += deltaExp; + expnum1.c *= MATH_POW(-deltaExp); + expnum1.c = byFloor ? MATH_FLOOR(expnum1.c) : MATH_CEIL(expnum1.c); + } + } + function expFixMin(expnum1, expnum2, byFloor) { + if (expnum1.e < expnum2.e) { + expFixTo(expnum2, expnum1, byFloor); + } else { + expFixTo(expnum1, expnum2, byFloor); + } + } + function getCeil(num, rounds) { + rounds = rounds || mySteps; + num = expNum(num); + var cNum = num.c; + var i = 0; + while (cNum > rounds[i]) { + i++; + } + if (!rounds[i]) { + cNum /= 10; + num.e += 1; + i = 0; + while (cNum > rounds[i]) { + i++; + } + } + num.c = rounds[i]; + return num; + } + function coreCalc(min, max, section) { + var step; + var secs = section || +custSecs.slice(-1); + var expStep = getCeil((max - min) / secs, custSteps); + var expSpan = expNum(max - min); + var expMin = expNum(min, -1, 1); + var expMax = expNum(max, -1); + expFixTo(expSpan, expStep); + expFixTo(expMin, expStep, 1); + expFixTo(expMax, expStep); + if (!section) { + secs = look4sections(expMin, expMax); + } else { + step = look4step(expMin, expMax, secs); + } + if (MATH_ISINT(min) && MATH_ISINT(max) && min * max >= 0) { + if (max - min < secs) { + return forInteger(min, max, secs); + } + secs = tryForInt(min, max, section, expMin, expMax, secs); + } + var arrMM = cross0(min, max, expMin.c, expMax.c); + expMin.c = arrMM[0]; + expMax.c = arrMM[1]; + if (minLocked || maxLocked) { + singleLocked(min, max, expMin, expMax); + } + return makeResult(expMin.c, expMax.c, secs, expMax.e); + } + function look4sections(expMin, expMax) { + var section; + var tmpStep, tmpMin, tmpMax; + var reference = []; + for (var i = custSecs.length; i--;) { + section = custSecs[i]; + tmpStep = getCeil((expMax.c - expMin.c) / section, custSteps); + tmpStep = tmpStep.c * MATH_POW(tmpStep.e); + tmpMin = MATH_FLOOR(expMin.c / tmpStep) * tmpStep; + tmpMax = MATH_CEIL(expMax.c / tmpStep) * tmpStep; + reference[i] = { + min: tmpMin, + max: tmpMax, + step: tmpStep, + span: tmpMax - tmpMin + }; + } + reference.sort(function (a, b) { + var delta = a.span - b.span; + if (delta === 0) { + delta = a.step - b.step; + } + return delta; + }); + reference = reference[0]; + section = reference.span / reference.step; + expMin.c = reference.min; + expMax.c = reference.max; + return section < 3 ? section * 2 : section; + } + function look4step(expMin, expMax, secs) { + var span; + var tmpMax; + var tmpMin = expMax.c; + var tmpStep = (expMax.c - expMin.c) / secs - 1; + while (tmpMin > expMin.c) { + tmpStep = getCeil(tmpStep + 1, custSteps); + tmpStep = tmpStep.c * MATH_POW(tmpStep.e); + span = tmpStep * secs; + tmpMax = MATH_CEIL(expMax.c / tmpStep) * tmpStep; + tmpMin = tmpMax - span; + } + var deltaMin = expMin.c - tmpMin; + var deltaMax = tmpMax - expMax.c; + var deltaDelta = deltaMin - deltaMax; + if (deltaDelta > tmpStep * 1.1) { + deltaDelta = MATH_ROUND(deltaDelta / tmpStep / 2) * tmpStep; + tmpMin += deltaDelta; + tmpMax += deltaDelta; + } + expMin.c = tmpMin; + expMax.c = tmpMax; + return tmpStep; + } + function tryForInt(min, max, section, expMin, expMax, secs) { + var span = expMax.c - expMin.c; + var step = span / secs * MATH_POW(expMax.e); + if (!MATH_ISINT(step)) { + step = MATH_FLOOR(step); + span = step * secs; + if (span < max - min) { + step += 1; + span = step * secs; + if (!section && step * (secs - 1) >= max - min) { + secs -= 1; + span = step * secs; + } + } + if (span >= max - min) { + var delta = span - (max - min); + expMin.c = MATH_ROUND(min - delta / 2); + expMax.c = MATH_ROUND(max + delta / 2); + expMin.e = 0; + expMax.e = 0; + } + } + return secs; + } + function forInteger(min, max, section) { + section = section || 5; + if (minLocked) { + max = min + section; + } else if (maxLocked) { + min = max - section; + } else { + var delta = section - (max - min); + var newMin = MATH_ROUND(min - delta / 2); + var newMax = MATH_ROUND(max + delta / 2); + var arrMM = cross0(min, max, newMin, newMax); + min = arrMM[0]; + max = arrMM[1]; + } + return makeResult(min, max, section); + } + function forSpan0(min, max, section) { + section = section || 5; + var delta = MT.min(MATH_ABS(max / section), section) / 2.1; + if (minLocked) { + max = min + delta; + } else if (maxLocked) { + min = max - delta; + } else { + min = min - delta; + max = max + delta; + } + return coreCalc(min, max, section); + } + function cross0(min, max, newMin, newMax) { + if (min >= 0 && newMin < 0) { + newMax -= newMin; + newMin = 0; + } else if (max <= 0 && newMax > 0) { + newMin -= newMax; + newMax = 0; + } + return [ + newMin, + newMax + ]; + } + function decimals(num) { + num = (+num).toFixed(15).split('.'); + return num.pop().replace(/0+$/, '').length; + } + function singleLocked(min, max, emin, emax) { + if (minLocked) { + var expMin = expNum(min, 4, 1); + if (emin.e - expMin.e > 6) { + expMin = { + c: 0, + e: emin.e + }; + } + expFixMin(emin, expMin); + expFixMin(emax, expMin); + emax.c += expMin.c - emin.c; + emin.c = expMin.c; + } else if (maxLocked) { + var expMax = expNum(max, 4); + if (emax.e - expMax.e > 6) { + expMax = { + c: 0, + e: emax.e + }; + } + expFixMin(emin, expMax); + expFixMin(emax, expMax); + emin.c += expMax.c - emax.c; + emax.c = expMax.c; + } + } + function bothLocked(min, max, section) { + var trySecs = section ? [section] : custSecs; + var span = max - min; + if (span === 0) { + max = expNum(max, 3); + section = trySecs[0]; + max.c = MATH_ROUND(max.c + section / 2); + return makeResult(max.c - section, max.c, section, max.e); + } + if (MATH_ABS(max / span) < 0.000001) { + max = 0; + } + if (MATH_ABS(min / span) < 0.000001) { + min = 0; + } + var step, deltaSpan, score; + var scoreS = [ + [ + 5, + 10 + ], + [ + 10, + 2 + ], + [ + 50, + 10 + ], + [ + 100, + 2 + ] + ]; + var reference = []; + var debugLog = []; + var expSpan = expNum(max - min, 3); + var expMin = expNum(min, -1, 1); + var expMax = expNum(max, -1); + expFixTo(expMin, expSpan, 1); + expFixTo(expMax, expSpan); + span = expMax.c - expMin.c; + expSpan.c = span; + for (var i = trySecs.length; i--;) { + section = trySecs[i]; + step = MATH_CEIL(span / section); + deltaSpan = step * section - span; + score = (deltaSpan + 3) * 3; + score += (section - trySecs[0] + 2) * 2; + if (section % 5 === 0) { + score -= 10; + } + for (var j = scoreS.length; j--;) { + if (step % scoreS[j][0] === 0) { + score /= scoreS[j][1]; + } + } + debugLog[i] = [ + section, + step, + deltaSpan, + score + ].join(); + reference[i] = { + secs: section, + step: step, + delta: deltaSpan, + score: score + }; + } + reference.sort(function (a, b) { + return a.score - b.score; + }); + reference = reference[0]; + expMin.c = MATH_ROUND(expMin.c - reference.delta / 2); + expMax.c = MATH_ROUND(expMax.c + reference.delta / 2); + return makeResult(expMin.c, expMax.c, reference.secs, expSpan.e); + } + return smartSteps; +});define('echarts/chart/line', [ + 'require', + './base', + 'zrender/shape/Polyline', + '../util/shape/Icon', + '../util/shape/HalfSmoothPolygon', + '../component/axis', + '../component/grid', + '../component/dataZoom', + '../config', + '../util/ecData', + 'zrender/tool/util', + 'zrender/tool/color', + '../chart' +], function (require) { + var ChartBase = require('./base'); + var PolylineShape = require('zrender/shape/Polyline'); + var IconShape = require('../util/shape/Icon'); + var HalfSmoothPolygonShape = require('../util/shape/HalfSmoothPolygon'); + require('../component/axis'); + require('../component/grid'); + require('../component/dataZoom'); + var ecConfig = require('../config'); + ecConfig.line = { + zlevel: 0, + z: 2, + clickable: true, + legendHoverLink: true, + xAxisIndex: 0, + yAxisIndex: 0, + itemStyle: { + normal: { + label: { show: false }, + lineStyle: { + width: 2, + type: 'solid', + shadowColor: 'rgba(0,0,0,0)', + shadowBlur: 0, + shadowOffsetX: 0, + shadowOffsetY: 0 + } + }, + emphasis: { label: { show: false } } + }, + symbolSize: 2, + showAllSymbol: false + }; + var ecData = require('../util/ecData'); + var zrUtil = require('zrender/tool/util'); + var zrColor = require('zrender/tool/color'); + function Line(ecTheme, messageCenter, zr, option, myChart) { + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); + this.refresh(option); + } + Line.prototype = { + type: ecConfig.CHART_TYPE_LINE, + _buildShape: function () { + this.finalPLMap = {}; + this._buildPosition(); + }, + _buildHorizontal: function (seriesArray, maxDataLength, locationMap, xMarkMap) { + var series = this.series; + var seriesIndex = locationMap[0][0]; + var serie = series[seriesIndex]; + var categoryAxis = this.component.xAxis.getAxis(serie.xAxisIndex || 0); + var valueAxis; + var x; + var y; + var lastYP; + var baseYP; + var lastYN; + var baseYN; + var curPLMap = {}; + var data; + var value; + for (var i = 0, l = maxDataLength; i < l; i++) { + if (categoryAxis.getNameByIndex(i) == null) { + break; + } + x = categoryAxis.getCoordByIndex(i); + for (var j = 0, k = locationMap.length; j < k; j++) { + valueAxis = this.component.yAxis.getAxis(series[locationMap[j][0]].yAxisIndex || 0); + baseYP = lastYP = baseYN = lastYN = valueAxis.getCoord(0); + for (var m = 0, n = locationMap[j].length; m < n; m++) { + seriesIndex = locationMap[j][m]; + serie = series[seriesIndex]; + data = serie.data[i]; + value = this.getDataFromOption(data, '-'); + curPLMap[seriesIndex] = curPLMap[seriesIndex] || []; + xMarkMap[seriesIndex] = xMarkMap[seriesIndex] || { + min: Number.POSITIVE_INFINITY, + max: Number.NEGATIVE_INFINITY, + sum: 0, + counter: 0, + average: 0 + }; + if (value === '-') { + if (curPLMap[seriesIndex].length > 0) { + this.finalPLMap[seriesIndex] = this.finalPLMap[seriesIndex] || []; + this.finalPLMap[seriesIndex].push(curPLMap[seriesIndex]); + curPLMap[seriesIndex] = []; + } + continue; + } + if (value >= 0) { + lastYP -= m > 0 ? valueAxis.getCoordSize(value) : baseYP - valueAxis.getCoord(value); + y = lastYP; + } else if (value < 0) { + lastYN += m > 0 ? valueAxis.getCoordSize(value) : valueAxis.getCoord(value) - baseYN; + y = lastYN; + } + curPLMap[seriesIndex].push([ + x, + y, + i, + categoryAxis.getNameByIndex(i), + x, + baseYP + ]); + if (xMarkMap[seriesIndex].min > value) { + xMarkMap[seriesIndex].min = value; + xMarkMap[seriesIndex].minY = y; + xMarkMap[seriesIndex].minX = x; + } + if (xMarkMap[seriesIndex].max < value) { + xMarkMap[seriesIndex].max = value; + xMarkMap[seriesIndex].maxY = y; + xMarkMap[seriesIndex].maxX = x; + } + xMarkMap[seriesIndex].sum += value; + xMarkMap[seriesIndex].counter++; + } + } + lastYP = this.component.grid.getY(); + var symbolSize; + for (var j = 0, k = locationMap.length; j < k; j++) { + for (var m = 0, n = locationMap[j].length; m < n; m++) { + seriesIndex = locationMap[j][m]; + serie = series[seriesIndex]; + data = serie.data[i]; + value = this.getDataFromOption(data, '-'); + if (value != '-') { + continue; + } + if (this.deepQuery([ + data, + serie, + this.option + ], 'calculable')) { + symbolSize = this.deepQuery([ + data, + serie + ], 'symbolSize'); + lastYP += symbolSize * 2 + 5; + y = lastYP; + this.shapeList.push(this._getCalculableItem(seriesIndex, i, categoryAxis.getNameByIndex(i), x, y, 'horizontal')); + } + } + } + } + for (var sId in curPLMap) { + if (curPLMap[sId].length > 0) { + this.finalPLMap[sId] = this.finalPLMap[sId] || []; + this.finalPLMap[sId].push(curPLMap[sId]); + curPLMap[sId] = []; + } + } + this._calculMarkMapXY(xMarkMap, locationMap, 'y'); + this._buildBorkenLine(seriesArray, this.finalPLMap, categoryAxis, 'horizontal'); + }, + _buildVertical: function (seriesArray, maxDataLength, locationMap, xMarkMap) { + var series = this.series; + var seriesIndex = locationMap[0][0]; + var serie = series[seriesIndex]; + var categoryAxis = this.component.yAxis.getAxis(serie.yAxisIndex || 0); + var valueAxis; + var x; + var y; + var lastXP; + var baseXP; + var lastXN; + var baseXN; + var curPLMap = {}; + var data; + var value; + for (var i = 0, l = maxDataLength; i < l; i++) { + if (categoryAxis.getNameByIndex(i) == null) { + break; + } + y = categoryAxis.getCoordByIndex(i); + for (var j = 0, k = locationMap.length; j < k; j++) { + valueAxis = this.component.xAxis.getAxis(series[locationMap[j][0]].xAxisIndex || 0); + baseXP = lastXP = baseXN = lastXN = valueAxis.getCoord(0); + for (var m = 0, n = locationMap[j].length; m < n; m++) { + seriesIndex = locationMap[j][m]; + serie = series[seriesIndex]; + data = serie.data[i]; + value = this.getDataFromOption(data, '-'); + curPLMap[seriesIndex] = curPLMap[seriesIndex] || []; + xMarkMap[seriesIndex] = xMarkMap[seriesIndex] || { + min: Number.POSITIVE_INFINITY, + max: Number.NEGATIVE_INFINITY, + sum: 0, + counter: 0, + average: 0 + }; + if (value === '-') { + if (curPLMap[seriesIndex].length > 0) { + this.finalPLMap[seriesIndex] = this.finalPLMap[seriesIndex] || []; + this.finalPLMap[seriesIndex].push(curPLMap[seriesIndex]); + curPLMap[seriesIndex] = []; + } + continue; + } + if (value >= 0) { + lastXP += m > 0 ? valueAxis.getCoordSize(value) : valueAxis.getCoord(value) - baseXP; + x = lastXP; + } else if (value < 0) { + lastXN -= m > 0 ? valueAxis.getCoordSize(value) : baseXN - valueAxis.getCoord(value); + x = lastXN; + } + curPLMap[seriesIndex].push([ + x, + y, + i, + categoryAxis.getNameByIndex(i), + baseXP, + y + ]); + if (xMarkMap[seriesIndex].min > value) { + xMarkMap[seriesIndex].min = value; + xMarkMap[seriesIndex].minX = x; + xMarkMap[seriesIndex].minY = y; + } + if (xMarkMap[seriesIndex].max < value) { + xMarkMap[seriesIndex].max = value; + xMarkMap[seriesIndex].maxX = x; + xMarkMap[seriesIndex].maxY = y; + } + xMarkMap[seriesIndex].sum += value; + xMarkMap[seriesIndex].counter++; + } + } + lastXP = this.component.grid.getXend(); + var symbolSize; + for (var j = 0, k = locationMap.length; j < k; j++) { + for (var m = 0, n = locationMap[j].length; m < n; m++) { + seriesIndex = locationMap[j][m]; + serie = series[seriesIndex]; + data = serie.data[i]; + value = this.getDataFromOption(data, '-'); + if (value != '-') { + continue; + } + if (this.deepQuery([ + data, + serie, + this.option + ], 'calculable')) { + symbolSize = this.deepQuery([ + data, + serie + ], 'symbolSize'); + lastXP -= symbolSize * 2 + 5; + x = lastXP; + this.shapeList.push(this._getCalculableItem(seriesIndex, i, categoryAxis.getNameByIndex(i), x, y, 'vertical')); + } + } + } + } + for (var sId in curPLMap) { + if (curPLMap[sId].length > 0) { + this.finalPLMap[sId] = this.finalPLMap[sId] || []; + this.finalPLMap[sId].push(curPLMap[sId]); + curPLMap[sId] = []; + } + } + this._calculMarkMapXY(xMarkMap, locationMap, 'x'); + this._buildBorkenLine(seriesArray, this.finalPLMap, categoryAxis, 'vertical'); + }, + _buildOther: function (seriesArray, maxDataLength, locationMap, xMarkMap) { + var series = this.series; + var curPLMap = {}; + var xAxis; + for (var j = 0, k = locationMap.length; j < k; j++) { + for (var m = 0, n = locationMap[j].length; m < n; m++) { + var seriesIndex = locationMap[j][m]; + var serie = series[seriesIndex]; + xAxis = this.component.xAxis.getAxis(serie.xAxisIndex || 0); + var yAxis = this.component.yAxis.getAxis(serie.yAxisIndex || 0); + var baseY = yAxis.getCoord(0); + curPLMap[seriesIndex] = curPLMap[seriesIndex] || []; + xMarkMap[seriesIndex] = xMarkMap[seriesIndex] || { + min0: Number.POSITIVE_INFINITY, + min1: Number.POSITIVE_INFINITY, + max0: Number.NEGATIVE_INFINITY, + max1: Number.NEGATIVE_INFINITY, + sum0: 0, + sum1: 0, + counter0: 0, + counter1: 0, + average0: 0, + average1: 0 + }; + for (var i = 0, l = serie.data.length; i < l; i++) { + var data = serie.data[i]; + var value = this.getDataFromOption(data, '-'); + if (!(value instanceof Array)) { + continue; + } + var x = xAxis.getCoord(value[0]); + var y = yAxis.getCoord(value[1]); + curPLMap[seriesIndex].push([ + x, + y, + i, + value[0], + x, + baseY + ]); + if (xMarkMap[seriesIndex].min0 > value[0]) { + xMarkMap[seriesIndex].min0 = value[0]; + xMarkMap[seriesIndex].minY0 = y; + xMarkMap[seriesIndex].minX0 = x; + } + if (xMarkMap[seriesIndex].max0 < value[0]) { + xMarkMap[seriesIndex].max0 = value[0]; + xMarkMap[seriesIndex].maxY0 = y; + xMarkMap[seriesIndex].maxX0 = x; + } + xMarkMap[seriesIndex].sum0 += value[0]; + xMarkMap[seriesIndex].counter0++; + if (xMarkMap[seriesIndex].min1 > value[1]) { + xMarkMap[seriesIndex].min1 = value[1]; + xMarkMap[seriesIndex].minY1 = y; + xMarkMap[seriesIndex].minX1 = x; + } + if (xMarkMap[seriesIndex].max1 < value[1]) { + xMarkMap[seriesIndex].max1 = value[1]; + xMarkMap[seriesIndex].maxY1 = y; + xMarkMap[seriesIndex].maxX1 = x; + } + xMarkMap[seriesIndex].sum1 += value[1]; + xMarkMap[seriesIndex].counter1++; + } + } + } + for (var sId in curPLMap) { + if (curPLMap[sId].length > 0) { + this.finalPLMap[sId] = this.finalPLMap[sId] || []; + this.finalPLMap[sId].push(curPLMap[sId]); + curPLMap[sId] = []; + } + } + this._calculMarkMapXY(xMarkMap, locationMap, 'xy'); + this._buildBorkenLine(seriesArray, this.finalPLMap, xAxis, 'other'); + }, + _buildBorkenLine: function (seriesArray, pointList, categoryAxis, curOrient) { + var orient = curOrient == 'other' ? 'horizontal' : curOrient; + var series = this.series; + var data; + for (var sIdx = seriesArray.length - 1; sIdx >= 0; sIdx--) { + var seriesIndex = seriesArray[sIdx]; + var serie = series[seriesIndex]; + var seriesPL = pointList[seriesIndex]; + if (serie.type === this.type && seriesPL != null) { + var bbox = this._getBbox(seriesIndex, orient); + var defaultColor = this._sIndex2ColorMap[seriesIndex]; + var lineWidth = this.query(serie, 'itemStyle.normal.lineStyle.width'); + var lineType = this.query(serie, 'itemStyle.normal.lineStyle.type'); + var lineColor = this.query(serie, 'itemStyle.normal.lineStyle.color'); + var normalColor = this.getItemStyleColor(this.query(serie, 'itemStyle.normal.color'), seriesIndex, -1); + var isFill = this.query(serie, 'itemStyle.normal.areaStyle') != null; + var fillNormalColor = this.query(serie, 'itemStyle.normal.areaStyle.color'); + for (var i = 0, l = seriesPL.length; i < l; i++) { + var singlePL = seriesPL[i]; + var isLarge = curOrient != 'other' && this._isLarge(orient, singlePL); + if (!isLarge) { + for (var j = 0, k = singlePL.length; j < k; j++) { + data = serie.data[singlePL[j][2]]; + if (this.deepQuery([ + data, + serie, + this.option + ], 'calculable') || this.deepQuery([ + data, + serie + ], 'showAllSymbol') || categoryAxis.type === 'categoryAxis' && categoryAxis.isMainAxis(singlePL[j][2]) && this.deepQuery([ + data, + serie + ], 'symbol') != 'none') { + this.shapeList.push(this._getSymbol(seriesIndex, singlePL[j][2], singlePL[j][3], singlePL[j][0], singlePL[j][1], orient)); + } + } + } else { + singlePL = this._getLargePointList(orient, singlePL); + } + var polylineShape = new PolylineShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + miterLimit: lineWidth, + pointList: singlePL, + strokeColor: lineColor || normalColor || defaultColor, + lineWidth: lineWidth, + lineType: lineType, + smooth: this._getSmooth(serie.smooth), + smoothConstraint: bbox, + shadowColor: this.query(serie, 'itemStyle.normal.lineStyle.shadowColor'), + shadowBlur: this.query(serie, 'itemStyle.normal.lineStyle.shadowBlur'), + shadowOffsetX: this.query(serie, 'itemStyle.normal.lineStyle.shadowOffsetX'), + shadowOffsetY: this.query(serie, 'itemStyle.normal.lineStyle.shadowOffsetY') + }, + hoverable: false, + _main: true, + _seriesIndex: seriesIndex, + _orient: orient + }); + ecData.pack(polylineShape, series[seriesIndex], seriesIndex, 0, i, series[seriesIndex].name); + this.shapeList.push(polylineShape); + if (isFill) { + var halfSmoothPolygonShape = new HalfSmoothPolygonShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + miterLimit: lineWidth, + pointList: zrUtil.clone(singlePL).concat([ + [ + singlePL[singlePL.length - 1][4], + singlePL[singlePL.length - 1][5] + ], + [ + singlePL[0][4], + singlePL[0][5] + ] + ]), + brushType: 'fill', + smooth: this._getSmooth(serie.smooth), + smoothConstraint: bbox, + color: fillNormalColor ? fillNormalColor : zrColor.alpha(defaultColor, 0.5) + }, + highlightStyle: { brushType: 'fill' }, + hoverable: false, + _main: true, + _seriesIndex: seriesIndex, + _orient: orient + }); + ecData.pack(halfSmoothPolygonShape, series[seriesIndex], seriesIndex, 0, i, series[seriesIndex].name); + this.shapeList.push(halfSmoothPolygonShape); + } + } + } + } + }, + _getBbox: function (seriesIndex, orient) { + var bbox = this.component.grid.getBbox(); + var xMarkMap = this.xMarkMap[seriesIndex]; + if (xMarkMap.minX0 != null) { + return [ + [ + Math.min(xMarkMap.minX0, xMarkMap.maxX0, xMarkMap.minX1, xMarkMap.maxX1), + Math.min(xMarkMap.minY0, xMarkMap.maxY0, xMarkMap.minY1, xMarkMap.maxY1) + ], + [ + Math.max(xMarkMap.minX0, xMarkMap.maxX0, xMarkMap.minX1, xMarkMap.maxX1), + Math.max(xMarkMap.minY0, xMarkMap.maxY0, xMarkMap.minY1, xMarkMap.maxY1) + ] + ]; + } else if (orient === 'horizontal') { + bbox[0][1] = Math.min(xMarkMap.minY, xMarkMap.maxY); + bbox[1][1] = Math.max(xMarkMap.minY, xMarkMap.maxY); + } else { + bbox[0][0] = Math.min(xMarkMap.minX, xMarkMap.maxX); + bbox[1][0] = Math.max(xMarkMap.minX, xMarkMap.maxX); + } + return bbox; + }, + _isLarge: function (orient, singlePL) { + if (singlePL.length < 2) { + return false; + } else { + return orient === 'horizontal' ? Math.abs(singlePL[0][0] - singlePL[1][0]) < 0.5 : Math.abs(singlePL[0][1] - singlePL[1][1]) < 0.5; + } + }, + _getLargePointList: function (orient, singlePL) { + var total; + if (orient === 'horizontal') { + total = this.component.grid.getWidth(); + } else { + total = this.component.grid.getHeight(); + } + var len = singlePL.length; + var newList = []; + for (var i = 0; i < total; i++) { + newList[i] = singlePL[Math.floor(len / total * i)]; + } + return newList; + }, + _getSmooth: function (isSmooth) { + if (isSmooth) { + return 0.3; + } else { + return 0; + } + }, + _getCalculableItem: function (seriesIndex, dataIndex, name, x, y, orient) { + var series = this.series; + var color = series[seriesIndex].calculableHolderColor || this.ecTheme.calculableHolderColor || ecConfig.calculableHolderColor; + var itemShape = this._getSymbol(seriesIndex, dataIndex, name, x, y, orient); + itemShape.style.color = color; + itemShape.style.strokeColor = color; + itemShape.rotation = [ + 0, + 0 + ]; + itemShape.hoverable = false; + itemShape.draggable = false; + itemShape.style.text = undefined; + return itemShape; + }, + _getSymbol: function (seriesIndex, dataIndex, name, x, y, orient) { + var series = this.series; + var serie = series[seriesIndex]; + var data = serie.data[dataIndex]; + var itemShape = this.getSymbolShape(serie, seriesIndex, data, dataIndex, name, x, y, this._sIndex2ShapeMap[seriesIndex], this._sIndex2ColorMap[seriesIndex], '#fff', orient === 'vertical' ? 'horizontal' : 'vertical'); + itemShape.zlevel = this.getZlevelBase(); + itemShape.z = this.getZBase() + 1; + if (this.deepQuery([ + data, + serie, + this.option + ], 'calculable')) { + this.setCalculable(itemShape); + itemShape.draggable = true; + } + return itemShape; + }, + getMarkCoord: function (seriesIndex, mpData) { + var serie = this.series[seriesIndex]; + var xMarkMap = this.xMarkMap[seriesIndex]; + var xAxis = this.component.xAxis.getAxis(serie.xAxisIndex); + var yAxis = this.component.yAxis.getAxis(serie.yAxisIndex); + if (mpData.type && (mpData.type === 'max' || mpData.type === 'min' || mpData.type === 'average')) { + var valueIndex = mpData.valueIndex != null ? mpData.valueIndex : xMarkMap.maxX0 != null ? '1' : ''; + return [ + xMarkMap[mpData.type + 'X' + valueIndex], + xMarkMap[mpData.type + 'Y' + valueIndex], + xMarkMap[mpData.type + 'Line' + valueIndex], + xMarkMap[mpData.type + valueIndex] + ]; + } + return [ + typeof mpData.xAxis != 'string' && xAxis.getCoordByIndex ? xAxis.getCoordByIndex(mpData.xAxis || 0) : xAxis.getCoord(mpData.xAxis || 0), + typeof mpData.yAxis != 'string' && yAxis.getCoordByIndex ? yAxis.getCoordByIndex(mpData.yAxis || 0) : yAxis.getCoord(mpData.yAxis || 0) + ]; + }, + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + this.backupShapeList(); + this._buildShape(); + }, + ontooltipHover: function (param, tipShape) { + var seriesIndex = param.seriesIndex; + var dataIndex = param.dataIndex; + var seriesPL; + var singlePL; + var len = seriesIndex.length; + while (len--) { + seriesPL = this.finalPLMap[seriesIndex[len]]; + if (seriesPL) { + for (var i = 0, l = seriesPL.length; i < l; i++) { + singlePL = seriesPL[i]; + for (var j = 0, k = singlePL.length; j < k; j++) { + if (dataIndex === singlePL[j][2]) { + tipShape.push(this._getSymbol(seriesIndex[len], singlePL[j][2], singlePL[j][3], singlePL[j][0], singlePL[j][1], 'horizontal')); + } + } + } + } + } + }, + addDataAnimation: function (params) { + var series = this.series; + var aniMap = {}; + for (var i = 0, l = params.length; i < l; i++) { + aniMap[params[i][0]] = params[i]; + } + var x; + var dx; + var y; + var dy; + var seriesIndex; + var pointList; + var isHorizontal; + for (var i = this.shapeList.length - 1; i >= 0; i--) { + seriesIndex = this.shapeList[i]._seriesIndex; + if (aniMap[seriesIndex] && !aniMap[seriesIndex][3]) { + if (this.shapeList[i]._main && this.shapeList[i].style.pointList.length > 1) { + pointList = this.shapeList[i].style.pointList; + dx = Math.abs(pointList[0][0] - pointList[1][0]); + dy = Math.abs(pointList[0][1] - pointList[1][1]); + isHorizontal = this.shapeList[i]._orient === 'horizontal'; + if (aniMap[seriesIndex][2]) { + if (this.shapeList[i].type === 'half-smooth-polygon') { + var len = pointList.length; + this.shapeList[i].style.pointList[len - 3] = pointList[len - 2]; + this.shapeList[i].style.pointList[len - 3][isHorizontal ? 0 : 1] = pointList[len - 4][isHorizontal ? 0 : 1]; + this.shapeList[i].style.pointList[len - 2] = pointList[len - 1]; + } + this.shapeList[i].style.pointList.pop(); + isHorizontal ? (x = dx, y = 0) : (x = 0, y = -dy); + } else { + this.shapeList[i].style.pointList.shift(); + if (this.shapeList[i].type === 'half-smooth-polygon') { + var targetPoint = this.shapeList[i].style.pointList.pop(); + isHorizontal ? targetPoint[0] = pointList[0][0] : targetPoint[1] = pointList[0][1]; + this.shapeList[i].style.pointList.push(targetPoint); + } + isHorizontal ? (x = -dx, y = 0) : (x = 0, y = dy); + } + this.zr.modShape(this.shapeList[i].id, { style: { pointList: this.shapeList[i].style.pointList } }, true); + } else { + if (aniMap[seriesIndex][2] && this.shapeList[i]._dataIndex === series[seriesIndex].data.length - 1) { + this.zr.delShape(this.shapeList[i].id); + continue; + } else if (!aniMap[seriesIndex][2] && this.shapeList[i]._dataIndex === 0) { + this.zr.delShape(this.shapeList[i].id); + continue; + } + } + this.shapeList[i].position = [ + 0, + 0 + ]; + this.zr.animate(this.shapeList[i].id, '').when(this.query(this.option, 'animationDurationUpdate'), { + position: [ + x, + y + ] + }).start(); + } + } + } + }; + function legendLineIcon(ctx, style, refreshNextFrame) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + var dy = height / 2; + if (style.symbol.match('empty')) { + ctx.fillStyle = '#fff'; + } + style.brushType = 'both'; + var symbol = style.symbol.replace('empty', '').toLowerCase(); + if (symbol.match('star')) { + dy = symbol.replace('star', '') - 0 || 5; + y -= 1; + symbol = 'star'; + } else if (symbol === 'rectangle' || symbol === 'arrow') { + x += (width - height) / 2; + width = height; + } + var imageLocation = ''; + if (symbol.match('image')) { + imageLocation = symbol.replace(new RegExp('^image:\\/\\/'), ''); + symbol = 'image'; + x += Math.round((width - height) / 2) - 1; + width = height = height + 2; + } + symbol = IconShape.prototype.iconLibrary[symbol]; + if (symbol) { + var x2 = style.x; + var y2 = style.y; + ctx.moveTo(x2, y2 + dy); + ctx.lineTo(x2 + 5, y2 + dy); + ctx.moveTo(x2 + style.width - 5, y2 + dy); + ctx.lineTo(x2 + style.width, y2 + dy); + var self = this; + symbol(ctx, { + x: x + 4, + y: y + 4, + width: width - 8, + height: height - 8, + n: dy, + image: imageLocation + }, function () { + self.modSelf(); + refreshNextFrame(); + }); + } else { + ctx.moveTo(x, y + dy); + ctx.lineTo(x + width, y + dy); + } + } + IconShape.prototype.iconLibrary['legendLineIcon'] = legendLineIcon; + zrUtil.inherits(Line, ChartBase); + require('../chart').define('line', Line); + return Line; +});define('echarts/util/shape/HalfSmoothPolygon', [ + 'require', + 'zrender/shape/Base', + 'zrender/shape/util/smoothBezier', + 'zrender/tool/util', + 'zrender/shape/Polygon' +], function (require) { + var Base = require('zrender/shape/Base'); + var smoothBezier = require('zrender/shape/util/smoothBezier'); + var zrUtil = require('zrender/tool/util'); + function HalfSmoothPolygon(options) { + Base.call(this, options); + } + HalfSmoothPolygon.prototype = { + type: 'half-smooth-polygon', + buildPath: function (ctx, style) { + var pointList = style.pointList; + if (pointList.length < 2) { + return; + } + if (style.smooth) { + var controlPoints = smoothBezier(pointList.slice(0, -2), style.smooth, false, style.smoothConstraint); + ctx.moveTo(pointList[0][0], pointList[0][1]); + var cp1; + var cp2; + var p; + var l = pointList.length; + for (var i = 0; i < l - 3; i++) { + cp1 = controlPoints[i * 2]; + cp2 = controlPoints[i * 2 + 1]; + p = pointList[i + 1]; + ctx.bezierCurveTo(cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]); + } + ctx.lineTo(pointList[l - 2][0], pointList[l - 2][1]); + ctx.lineTo(pointList[l - 1][0], pointList[l - 1][1]); + ctx.lineTo(pointList[0][0], pointList[0][1]); + } else { + require('zrender/shape/Polygon').prototype.buildPath(ctx, style); + } + return; + } + }; + zrUtil.inherits(HalfSmoothPolygon, Base); + return HalfSmoothPolygon; +});define('echarts/chart/bar', [ + 'require', + './base', + 'zrender/shape/Rectangle', + '../component/axis', + '../component/grid', + '../component/dataZoom', + '../config', + '../util/ecData', + 'zrender/tool/util', + 'zrender/tool/color', + '../chart' +], function (require) { + var ChartBase = require('./base'); + var RectangleShape = require('zrender/shape/Rectangle'); + require('../component/axis'); + require('../component/grid'); + require('../component/dataZoom'); + var ecConfig = require('../config'); + ecConfig.bar = { + zlevel: 0, + z: 2, + clickable: true, + legendHoverLink: true, + xAxisIndex: 0, + yAxisIndex: 0, + barMinHeight: 0, + barGap: '30%', + barCategoryGap: '20%', + itemStyle: { + normal: { + barBorderColor: '#fff', + barBorderRadius: 0, + barBorderWidth: 0, + label: { show: false } + }, + emphasis: { + barBorderColor: '#fff', + barBorderRadius: 0, + barBorderWidth: 0, + label: { show: false } + } + } + }; + var ecData = require('../util/ecData'); + var zrUtil = require('zrender/tool/util'); + var zrColor = require('zrender/tool/color'); + function Bar(ecTheme, messageCenter, zr, option, myChart) { + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); + this.refresh(option); + } + Bar.prototype = { + type: ecConfig.CHART_TYPE_BAR, + _buildShape: function () { + this._buildPosition(); + }, + _buildNormal: function (seriesArray, maxDataLength, locationMap, xMarkMap, orient) { + var series = this.series; + var seriesIndex = locationMap[0][0]; + var serie = series[seriesIndex]; + var isHorizontal = orient == 'horizontal'; + var xAxis = this.component.xAxis; + var yAxis = this.component.yAxis; + var categoryAxis = isHorizontal ? xAxis.getAxis(serie.xAxisIndex) : yAxis.getAxis(serie.yAxisIndex); + var valueAxis; + var size = this._mapSize(categoryAxis, locationMap); + var gap = size.gap; + var barGap = size.barGap; + var barWidthMap = size.barWidthMap; + var barMaxWidthMap = size.barMaxWidthMap; + var barWidth = size.barWidth; + var barMinHeightMap = size.barMinHeightMap; + var barHeight; + var curBarWidth; + var interval = size.interval; + var x; + var y; + var lastP; + var baseP; + var lastN; + var baseN; + var barShape; + var data; + var value; + var islandR = this.deepQuery([ + this.ecTheme, + ecConfig + ], 'island.r'); + for (var i = 0, l = maxDataLength; i < l; i++) { + if (categoryAxis.getNameByIndex(i) == null) { + break; + } + isHorizontal ? x = categoryAxis.getCoordByIndex(i) - gap / 2 : y = categoryAxis.getCoordByIndex(i) + gap / 2; + for (var j = 0, k = locationMap.length; j < k; j++) { + var yAxisIndex = series[locationMap[j][0]].yAxisIndex || 0; + var xAxisIndex = series[locationMap[j][0]].xAxisIndex || 0; + valueAxis = isHorizontal ? yAxis.getAxis(yAxisIndex) : xAxis.getAxis(xAxisIndex); + baseP = lastP = baseN = lastN = valueAxis.getCoord(0); + for (var m = 0, n = locationMap[j].length; m < n; m++) { + seriesIndex = locationMap[j][m]; + serie = series[seriesIndex]; + data = serie.data[i]; + value = this.getDataFromOption(data, '-'); + xMarkMap[seriesIndex] = xMarkMap[seriesIndex] || { + min: Number.POSITIVE_INFINITY, + max: Number.NEGATIVE_INFINITY, + sum: 0, + counter: 0, + average: 0 + }; + curBarWidth = Math.min(barMaxWidthMap[seriesIndex] || Number.MAX_VALUE, barWidthMap[seriesIndex] || barWidth); + if (value === '-') { + continue; + } + if (value > 0) { + barHeight = m > 0 ? valueAxis.getCoordSize(value) : isHorizontal ? baseP - valueAxis.getCoord(value) : valueAxis.getCoord(value) - baseP; + if (n === 1 && barMinHeightMap[seriesIndex] > barHeight) { + barHeight = barMinHeightMap[seriesIndex]; + } + if (isHorizontal) { + lastP -= barHeight; + y = lastP; + } else { + x = lastP; + lastP += barHeight; + } + } else if (value < 0) { + barHeight = m > 0 ? valueAxis.getCoordSize(value) : isHorizontal ? valueAxis.getCoord(value) - baseN : baseN - valueAxis.getCoord(value); + if (n === 1 && barMinHeightMap[seriesIndex] > barHeight) { + barHeight = barMinHeightMap[seriesIndex]; + } + if (isHorizontal) { + y = lastN; + lastN += barHeight; + } else { + lastN -= barHeight; + x = lastN; + } + } else { + barHeight = 0; + if (isHorizontal) { + lastP -= barHeight; + y = lastP; + } else { + x = lastP; + lastP += barHeight; + } + } + xMarkMap[seriesIndex][i] = isHorizontal ? x + curBarWidth / 2 : y - curBarWidth / 2; + if (xMarkMap[seriesIndex].min > value) { + xMarkMap[seriesIndex].min = value; + if (isHorizontal) { + xMarkMap[seriesIndex].minY = y; + xMarkMap[seriesIndex].minX = xMarkMap[seriesIndex][i]; + } else { + xMarkMap[seriesIndex].minX = x + barHeight; + xMarkMap[seriesIndex].minY = xMarkMap[seriesIndex][i]; + } + } + if (xMarkMap[seriesIndex].max < value) { + xMarkMap[seriesIndex].max = value; + if (isHorizontal) { + xMarkMap[seriesIndex].maxY = y; + xMarkMap[seriesIndex].maxX = xMarkMap[seriesIndex][i]; + } else { + xMarkMap[seriesIndex].maxX = x + barHeight; + xMarkMap[seriesIndex].maxY = xMarkMap[seriesIndex][i]; + } + } + xMarkMap[seriesIndex].sum += value; + xMarkMap[seriesIndex].counter++; + if (i % interval === 0) { + barShape = this._getBarItem(seriesIndex, i, categoryAxis.getNameByIndex(i), x, y - (isHorizontal ? 0 : curBarWidth), isHorizontal ? curBarWidth : barHeight, isHorizontal ? barHeight : curBarWidth, isHorizontal ? 'vertical' : 'horizontal'); + this.shapeList.push(new RectangleShape(barShape)); + } + } + for (var m = 0, n = locationMap[j].length; m < n; m++) { + seriesIndex = locationMap[j][m]; + serie = series[seriesIndex]; + data = serie.data[i]; + value = this.getDataFromOption(data, '-'); + curBarWidth = Math.min(barMaxWidthMap[seriesIndex] || Number.MAX_VALUE, barWidthMap[seriesIndex] || barWidth); + if (value != '-') { + continue; + } + if (this.deepQuery([ + data, + serie, + this.option + ], 'calculable')) { + if (isHorizontal) { + lastP -= islandR; + y = lastP; + } else { + x = lastP; + lastP += islandR; + } + barShape = this._getBarItem(seriesIndex, i, categoryAxis.getNameByIndex(i), x, y - (isHorizontal ? 0 : curBarWidth), isHorizontal ? curBarWidth : islandR, isHorizontal ? islandR : curBarWidth, isHorizontal ? 'vertical' : 'horizontal'); + barShape.hoverable = false; + barShape.draggable = false; + barShape.style.lineWidth = 1; + barShape.style.brushType = 'stroke'; + barShape.style.strokeColor = serie.calculableHolderColor || this.ecTheme.calculableHolderColor || ecConfig.calculableHolderColor; + this.shapeList.push(new RectangleShape(barShape)); + } + } + isHorizontal ? x += curBarWidth + barGap : y -= curBarWidth + barGap; + } + } + this._calculMarkMapXY(xMarkMap, locationMap, isHorizontal ? 'y' : 'x'); + }, + _buildHorizontal: function (seriesArray, maxDataLength, locationMap, xMarkMap) { + return this._buildNormal(seriesArray, maxDataLength, locationMap, xMarkMap, 'horizontal'); + }, + _buildVertical: function (seriesArray, maxDataLength, locationMap, xMarkMap) { + return this._buildNormal(seriesArray, maxDataLength, locationMap, xMarkMap, 'vertical'); + }, + _buildOther: function (seriesArray, maxDataLength, locationMap, xMarkMap) { + var series = this.series; + for (var j = 0, k = locationMap.length; j < k; j++) { + for (var m = 0, n = locationMap[j].length; m < n; m++) { + var seriesIndex = locationMap[j][m]; + var serie = series[seriesIndex]; + var xAxisIndex = serie.xAxisIndex || 0; + var xAxis = this.component.xAxis.getAxis(xAxisIndex); + var baseX = xAxis.getCoord(0); + var yAxisIndex = serie.yAxisIndex || 0; + var yAxis = this.component.yAxis.getAxis(yAxisIndex); + var baseY = yAxis.getCoord(0); + xMarkMap[seriesIndex] = xMarkMap[seriesIndex] || { + min0: Number.POSITIVE_INFINITY, + min1: Number.POSITIVE_INFINITY, + max0: Number.NEGATIVE_INFINITY, + max1: Number.NEGATIVE_INFINITY, + sum0: 0, + sum1: 0, + counter0: 0, + counter1: 0, + average0: 0, + average1: 0 + }; + for (var i = 0, l = serie.data.length; i < l; i++) { + var data = serie.data[i]; + var value = this.getDataFromOption(data, '-'); + if (!(value instanceof Array)) { + continue; + } + var x = xAxis.getCoord(value[0]); + var y = yAxis.getCoord(value[1]); + var queryTarget = [ + data, + serie + ]; + var barWidth = this.deepQuery(queryTarget, 'barWidth') || 10; + var barHeight = this.deepQuery(queryTarget, 'barHeight'); + var orient; + var barShape; + if (barHeight != null) { + orient = 'horizontal'; + if (value[0] > 0) { + barWidth = x - baseX; + x -= barWidth; + } else if (value[0] < 0) { + barWidth = baseX - x; + } else { + barWidth = 0; + } + barShape = this._getBarItem(seriesIndex, i, value[0], x, y - barHeight / 2, barWidth, barHeight, orient); + } else { + orient = 'vertical'; + if (value[1] > 0) { + barHeight = baseY - y; + } else if (value[1] < 0) { + barHeight = y - baseY; + y -= barHeight; + } else { + barHeight = 0; + } + barShape = this._getBarItem(seriesIndex, i, value[0], x - barWidth / 2, y, barWidth, barHeight, orient); + } + this.shapeList.push(new RectangleShape(barShape)); + x = xAxis.getCoord(value[0]); + y = yAxis.getCoord(value[1]); + if (xMarkMap[seriesIndex].min0 > value[0]) { + xMarkMap[seriesIndex].min0 = value[0]; + xMarkMap[seriesIndex].minY0 = y; + xMarkMap[seriesIndex].minX0 = x; + } + if (xMarkMap[seriesIndex].max0 < value[0]) { + xMarkMap[seriesIndex].max0 = value[0]; + xMarkMap[seriesIndex].maxY0 = y; + xMarkMap[seriesIndex].maxX0 = x; + } + xMarkMap[seriesIndex].sum0 += value[0]; + xMarkMap[seriesIndex].counter0++; + if (xMarkMap[seriesIndex].min1 > value[1]) { + xMarkMap[seriesIndex].min1 = value[1]; + xMarkMap[seriesIndex].minY1 = y; + xMarkMap[seriesIndex].minX1 = x; + } + if (xMarkMap[seriesIndex].max1 < value[1]) { + xMarkMap[seriesIndex].max1 = value[1]; + xMarkMap[seriesIndex].maxY1 = y; + xMarkMap[seriesIndex].maxX1 = x; + } + xMarkMap[seriesIndex].sum1 += value[1]; + xMarkMap[seriesIndex].counter1++; + } + } + } + this._calculMarkMapXY(xMarkMap, locationMap, 'xy'); + }, + _mapSize: function (categoryAxis, locationMap, ignoreUserDefined) { + var res = this._findSpecialBarSzie(locationMap, ignoreUserDefined); + var barWidthMap = res.barWidthMap; + var barMaxWidthMap = res.barMaxWidthMap; + var barMinHeightMap = res.barMinHeightMap; + var sBarWidthCounter = res.sBarWidthCounter; + var sBarWidthTotal = res.sBarWidthTotal; + var barGap = res.barGap; + var barCategoryGap = res.barCategoryGap; + var gap; + var barWidth; + var interval = 1; + if (locationMap.length != sBarWidthCounter) { + if (!ignoreUserDefined) { + gap = typeof barCategoryGap === 'string' && barCategoryGap.match(/%$/) ? (categoryAxis.getGap() * (100 - parseFloat(barCategoryGap)) / 100).toFixed(2) - 0 : categoryAxis.getGap() - barCategoryGap; + if (typeof barGap === 'string' && barGap.match(/%$/)) { + barGap = parseFloat(barGap) / 100; + barWidth = +((gap - sBarWidthTotal) / ((locationMap.length - 1) * barGap + locationMap.length - sBarWidthCounter)).toFixed(2); + barGap = barWidth * barGap; + } else { + barGap = parseFloat(barGap); + barWidth = +((gap - sBarWidthTotal - barGap * (locationMap.length - 1)) / (locationMap.length - sBarWidthCounter)).toFixed(2); + } + if (barWidth <= 0) { + return this._mapSize(categoryAxis, locationMap, true); + } + } else { + gap = categoryAxis.getGap(); + barGap = 0; + barWidth = +(gap / locationMap.length).toFixed(2); + if (barWidth <= 0) { + interval = Math.floor(locationMap.length / gap); + barWidth = 1; + } + } + } else { + gap = sBarWidthCounter > 1 ? typeof barCategoryGap === 'string' && barCategoryGap.match(/%$/) ? +(categoryAxis.getGap() * (100 - parseFloat(barCategoryGap)) / 100).toFixed(2) : categoryAxis.getGap() - barCategoryGap : sBarWidthTotal; + barWidth = 0; + barGap = sBarWidthCounter > 1 ? +((gap - sBarWidthTotal) / (sBarWidthCounter - 1)).toFixed(2) : 0; + if (barGap < 0) { + return this._mapSize(categoryAxis, locationMap, true); + } + } + return this._recheckBarMaxWidth(locationMap, barWidthMap, barMaxWidthMap, barMinHeightMap, gap, barWidth, barGap, interval); + }, + _findSpecialBarSzie: function (locationMap, ignoreUserDefined) { + var series = this.series; + var barWidthMap = {}; + var barMaxWidthMap = {}; + var barMinHeightMap = {}; + var sBarWidth; + var sBarMaxWidth; + var sBarWidthCounter = 0; + var sBarWidthTotal = 0; + var barGap; + var barCategoryGap; + for (var j = 0, k = locationMap.length; j < k; j++) { + var hasFound = { + barWidth: false, + barMaxWidth: false + }; + for (var m = 0, n = locationMap[j].length; m < n; m++) { + var seriesIndex = locationMap[j][m]; + var queryTarget = series[seriesIndex]; + if (!ignoreUserDefined) { + if (!hasFound.barWidth) { + sBarWidth = this.query(queryTarget, 'barWidth'); + if (sBarWidth != null) { + barWidthMap[seriesIndex] = sBarWidth; + sBarWidthTotal += sBarWidth; + sBarWidthCounter++; + hasFound.barWidth = true; + for (var ii = 0, ll = m; ii < ll; ii++) { + var pSeriesIndex = locationMap[j][ii]; + barWidthMap[pSeriesIndex] = sBarWidth; + } + } + } else { + barWidthMap[seriesIndex] = sBarWidth; + } + if (!hasFound.barMaxWidth) { + sBarMaxWidth = this.query(queryTarget, 'barMaxWidth'); + if (sBarMaxWidth != null) { + barMaxWidthMap[seriesIndex] = sBarMaxWidth; + hasFound.barMaxWidth = true; + for (var ii = 0, ll = m; ii < ll; ii++) { + var pSeriesIndex = locationMap[j][ii]; + barMaxWidthMap[pSeriesIndex] = sBarMaxWidth; + } + } + } else { + barMaxWidthMap[seriesIndex] = sBarMaxWidth; + } + } + barMinHeightMap[seriesIndex] = this.query(queryTarget, 'barMinHeight'); + barGap = barGap != null ? barGap : this.query(queryTarget, 'barGap'); + barCategoryGap = barCategoryGap != null ? barCategoryGap : this.query(queryTarget, 'barCategoryGap'); + } + } + return { + barWidthMap: barWidthMap, + barMaxWidthMap: barMaxWidthMap, + barMinHeightMap: barMinHeightMap, + sBarWidth: sBarWidth, + sBarMaxWidth: sBarMaxWidth, + sBarWidthCounter: sBarWidthCounter, + sBarWidthTotal: sBarWidthTotal, + barGap: barGap, + barCategoryGap: barCategoryGap + }; + }, + _recheckBarMaxWidth: function (locationMap, barWidthMap, barMaxWidthMap, barMinHeightMap, gap, barWidth, barGap, interval) { + for (var j = 0, k = locationMap.length; j < k; j++) { + var seriesIndex = locationMap[j][0]; + if (barMaxWidthMap[seriesIndex] && barMaxWidthMap[seriesIndex] < barWidth) { + gap -= barWidth - barMaxWidthMap[seriesIndex]; + } + } + return { + barWidthMap: barWidthMap, + barMaxWidthMap: barMaxWidthMap, + barMinHeightMap: barMinHeightMap, + gap: gap, + barWidth: barWidth, + barGap: barGap, + interval: interval + }; + }, + _getBarItem: function (seriesIndex, dataIndex, name, x, y, width, height, orient) { + var series = this.series; + var barShape; + var serie = series[seriesIndex]; + var data = serie.data[dataIndex]; + var defaultColor = this._sIndex2ColorMap[seriesIndex]; + var queryTarget = [ + data, + serie + ]; + var normal = this.deepMerge(queryTarget, 'itemStyle.normal'); + var emphasis = this.deepMerge(queryTarget, 'itemStyle.emphasis'); + var normalBorderWidth = normal.barBorderWidth; + barShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + clickable: this.deepQuery(queryTarget, 'clickable'), + style: { + x: x, + y: y, + width: width, + height: height, + brushType: 'both', + color: this.getItemStyleColor(this.deepQuery(queryTarget, 'itemStyle.normal.color') || defaultColor, seriesIndex, dataIndex, data), + radius: normal.barBorderRadius, + lineWidth: normalBorderWidth, + strokeColor: normal.barBorderColor + }, + highlightStyle: { + color: this.getItemStyleColor(this.deepQuery(queryTarget, 'itemStyle.emphasis.color'), seriesIndex, dataIndex, data), + radius: emphasis.barBorderRadius, + lineWidth: emphasis.barBorderWidth, + strokeColor: emphasis.barBorderColor + }, + _orient: orient + }; + var barShapeStyle = barShape.style; + barShape.highlightStyle.color = barShape.highlightStyle.color || (typeof barShapeStyle.color === 'string' ? zrColor.lift(barShapeStyle.color, -0.3) : barShapeStyle.color); + barShapeStyle.x = Math.floor(barShapeStyle.x); + barShapeStyle.y = Math.floor(barShapeStyle.y); + barShapeStyle.height = Math.ceil(barShapeStyle.height); + barShapeStyle.width = Math.ceil(barShapeStyle.width); + if (normalBorderWidth > 0 && barShapeStyle.height > normalBorderWidth && barShapeStyle.width > normalBorderWidth) { + barShapeStyle.y += normalBorderWidth / 2; + barShapeStyle.height -= normalBorderWidth; + barShapeStyle.x += normalBorderWidth / 2; + barShapeStyle.width -= normalBorderWidth; + } else { + barShapeStyle.brushType = 'fill'; + } + barShape.highlightStyle.textColor = barShape.highlightStyle.color; + barShape = this.addLabel(barShape, serie, data, name, orient); + var textPosition = barShapeStyle.textPosition; + if (textPosition === 'insideLeft' || textPosition === 'insideRight' || textPosition === 'insideTop' || textPosition === 'insideBottom') { + var gap = 5; + switch (textPosition) { + case 'insideLeft': + barShapeStyle.textX = barShapeStyle.x + gap; + barShapeStyle.textY = barShapeStyle.y + barShapeStyle.height / 2; + barShapeStyle.textAlign = 'left'; + barShapeStyle.textBaseline = 'middle'; + break; + case 'insideRight': + barShapeStyle.textX = barShapeStyle.x + barShapeStyle.width - gap; + barShapeStyle.textY = barShapeStyle.y + barShapeStyle.height / 2; + barShapeStyle.textAlign = 'right'; + barShapeStyle.textBaseline = 'middle'; + break; + case 'insideTop': + barShapeStyle.textX = barShapeStyle.x + barShapeStyle.width / 2; + barShapeStyle.textY = barShapeStyle.y + gap / 2; + barShapeStyle.textAlign = 'center'; + barShapeStyle.textBaseline = 'top'; + break; + case 'insideBottom': + barShapeStyle.textX = barShapeStyle.x + barShapeStyle.width / 2; + barShapeStyle.textY = barShapeStyle.y + barShapeStyle.height - gap / 2; + barShapeStyle.textAlign = 'center'; + barShapeStyle.textBaseline = 'bottom'; + break; + } + barShapeStyle.textPosition = 'specific'; + barShapeStyle.textColor = barShapeStyle.textColor || '#fff'; + } + if (this.deepQuery([ + data, + serie, + this.option + ], 'calculable')) { + this.setCalculable(barShape); + barShape.draggable = true; + } + ecData.pack(barShape, series[seriesIndex], seriesIndex, series[seriesIndex].data[dataIndex], dataIndex, name); + return barShape; + }, + getMarkCoord: function (seriesIndex, mpData) { + var serie = this.series[seriesIndex]; + var xMarkMap = this.xMarkMap[seriesIndex]; + var xAxis = this.component.xAxis.getAxis(serie.xAxisIndex); + var yAxis = this.component.yAxis.getAxis(serie.yAxisIndex); + var dataIndex; + var pos; + if (mpData.type && (mpData.type === 'max' || mpData.type === 'min' || mpData.type === 'average')) { + var valueIndex = mpData.valueIndex != null ? mpData.valueIndex : xMarkMap.maxX0 != null ? '1' : ''; + pos = [ + xMarkMap[mpData.type + 'X' + valueIndex], + xMarkMap[mpData.type + 'Y' + valueIndex], + xMarkMap[mpData.type + 'Line' + valueIndex], + xMarkMap[mpData.type + valueIndex] + ]; + } else if (xMarkMap.isHorizontal) { + dataIndex = typeof mpData.xAxis === 'string' && xAxis.getIndexByName ? xAxis.getIndexByName(mpData.xAxis) : mpData.xAxis || 0; + var x = xMarkMap[dataIndex]; + x = x != null ? x : typeof mpData.xAxis != 'string' && xAxis.getCoordByIndex ? xAxis.getCoordByIndex(mpData.xAxis || 0) : xAxis.getCoord(mpData.xAxis || 0); + pos = [ + x, + yAxis.getCoord(mpData.yAxis || 0) + ]; + } else { + dataIndex = typeof mpData.yAxis === 'string' && yAxis.getIndexByName ? yAxis.getIndexByName(mpData.yAxis) : mpData.yAxis || 0; + var y = xMarkMap[dataIndex]; + y = y != null ? y : typeof mpData.yAxis != 'string' && yAxis.getCoordByIndex ? yAxis.getCoordByIndex(mpData.yAxis || 0) : yAxis.getCoord(mpData.yAxis || 0); + pos = [ + xAxis.getCoord(mpData.xAxis || 0), + y + ]; + } + return pos; + }, + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + this.backupShapeList(); + this._buildShape(); + }, + addDataAnimation: function (params) { + var series = this.series; + var aniMap = {}; + for (var i = 0, l = params.length; i < l; i++) { + aniMap[params[i][0]] = params[i]; + } + var x; + var dx; + var y; + var dy; + var serie; + var seriesIndex; + var dataIndex; + for (var i = this.shapeList.length - 1; i >= 0; i--) { + seriesIndex = ecData.get(this.shapeList[i], 'seriesIndex'); + if (aniMap[seriesIndex] && !aniMap[seriesIndex][3]) { + if (this.shapeList[i].type === 'rectangle') { + dataIndex = ecData.get(this.shapeList[i], 'dataIndex'); + serie = series[seriesIndex]; + if (aniMap[seriesIndex][2] && dataIndex === serie.data.length - 1) { + this.zr.delShape(this.shapeList[i].id); + continue; + } else if (!aniMap[seriesIndex][2] && dataIndex === 0) { + this.zr.delShape(this.shapeList[i].id); + continue; + } + if (this.shapeList[i]._orient === 'horizontal') { + dy = this.component.yAxis.getAxis(serie.yAxisIndex || 0).getGap(); + y = aniMap[seriesIndex][2] ? -dy : dy; + x = 0; + } else { + dx = this.component.xAxis.getAxis(serie.xAxisIndex || 0).getGap(); + x = aniMap[seriesIndex][2] ? dx : -dx; + y = 0; + } + this.shapeList[i].position = [ + 0, + 0 + ]; + this.zr.animate(this.shapeList[i].id, '').when(this.query(this.option, 'animationDurationUpdate'), { + position: [ + x, + y + ] + }).start(); + } + } + } + } + }; + zrUtil.inherits(Bar, ChartBase); + require('../chart').define('bar', Bar); + return Bar; +});define('echarts/chart/scatter', [ + 'require', + './base', + '../util/shape/Symbol', + '../component/axis', + '../component/grid', + '../component/dataZoom', + '../component/dataRange', + '../config', + 'zrender/tool/util', + 'zrender/tool/color', + '../chart' +], function (require) { + var ChartBase = require('./base'); + var SymbolShape = require('../util/shape/Symbol'); + require('../component/axis'); + require('../component/grid'); + require('../component/dataZoom'); + require('../component/dataRange'); + var ecConfig = require('../config'); + ecConfig.scatter = { + zlevel: 0, + z: 2, + clickable: true, + legendHoverLink: true, + xAxisIndex: 0, + yAxisIndex: 0, + symbolSize: 4, + large: false, + largeThreshold: 2000, + itemStyle: { + normal: { label: { show: false } }, + emphasis: { label: { show: false } } + } + }; + var zrUtil = require('zrender/tool/util'); + var zrColor = require('zrender/tool/color'); + function Scatter(ecTheme, messageCenter, zr, option, myChart) { + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); + this.refresh(option); + } + Scatter.prototype = { + type: ecConfig.CHART_TYPE_SCATTER, + _buildShape: function () { + var series = this.series; + this._sIndex2ColorMap = {}; + this._symbol = this.option.symbolList; + this._sIndex2ShapeMap = {}; + this.selectedMap = {}; + this.xMarkMap = {}; + var legend = this.component.legend; + var seriesArray = []; + var serie; + var serieName; + var iconShape; + var iconType; + for (var i = 0, l = series.length; i < l; i++) { + serie = series[i]; + serieName = serie.name; + if (serie.type === ecConfig.CHART_TYPE_SCATTER) { + series[i] = this.reformOption(series[i]); + this.legendHoverLink = series[i].legendHoverLink || this.legendHoverLink; + this._sIndex2ShapeMap[i] = this.query(serie, 'symbol') || this._symbol[i % this._symbol.length]; + if (legend) { + this.selectedMap[serieName] = legend.isSelected(serieName); + this._sIndex2ColorMap[i] = zrColor.alpha(legend.getColor(serieName), 0.5); + iconShape = legend.getItemShape(serieName); + if (iconShape) { + var iconType = this._sIndex2ShapeMap[i]; + iconShape.style.brushType = iconType.match('empty') ? 'stroke' : 'both'; + iconType = iconType.replace('empty', '').toLowerCase(); + if (iconType.match('rectangle')) { + iconShape.style.x += Math.round((iconShape.style.width - iconShape.style.height) / 2); + iconShape.style.width = iconShape.style.height; + } + if (iconType.match('star')) { + iconShape.style.n = iconType.replace('star', '') - 0 || 5; + iconType = 'star'; + } + if (iconType.match('image')) { + iconShape.style.image = iconType.replace(new RegExp('^image:\\/\\/'), ''); + iconShape.style.x += Math.round((iconShape.style.width - iconShape.style.height) / 2); + iconShape.style.width = iconShape.style.height; + iconType = 'image'; + } + iconShape.style.iconType = iconType; + legend.setItemShape(serieName, iconShape); + } + } else { + this.selectedMap[serieName] = true; + this._sIndex2ColorMap[i] = zrColor.alpha(this.zr.getColor(i), 0.5); + } + if (this.selectedMap[serieName]) { + seriesArray.push(i); + } + } + } + this._buildSeries(seriesArray); + this.addShapeList(); + }, + _buildSeries: function (seriesArray) { + if (seriesArray.length === 0) { + return; + } + var series = this.series; + var seriesIndex; + var serie; + var data; + var value; + var xAxis; + var yAxis; + var pointList = {}; + var x; + var y; + for (var j = 0, k = seriesArray.length; j < k; j++) { + seriesIndex = seriesArray[j]; + serie = series[seriesIndex]; + if (serie.data.length === 0) { + continue; + } + xAxis = this.component.xAxis.getAxis(serie.xAxisIndex || 0); + yAxis = this.component.yAxis.getAxis(serie.yAxisIndex || 0); + pointList[seriesIndex] = []; + for (var i = 0, l = serie.data.length; i < l; i++) { + data = serie.data[i]; + value = this.getDataFromOption(data, '-'); + if (value === '-' || value.length < 2) { + continue; + } + x = xAxis.getCoord(value[0]); + y = yAxis.getCoord(value[1]); + pointList[seriesIndex].push([ + x, + y, + i, + data.name || '' + ]); + } + this.xMarkMap[seriesIndex] = this._markMap(xAxis, yAxis, serie.data, pointList[seriesIndex]); + this.buildMark(seriesIndex); + } + this._buildPointList(pointList); + }, + _markMap: function (xAxis, yAxis, data, pointList) { + var xMarkMap = { + min0: Number.POSITIVE_INFINITY, + max0: Number.NEGATIVE_INFINITY, + sum0: 0, + counter0: 0, + average0: 0, + min1: Number.POSITIVE_INFINITY, + max1: Number.NEGATIVE_INFINITY, + sum1: 0, + counter1: 0, + average1: 0 + }; + var value; + for (var i = 0, l = pointList.length; i < l; i++) { + value = data[pointList[i][2]].value || data[pointList[i][2]]; + if (xMarkMap.min0 > value[0]) { + xMarkMap.min0 = value[0]; + xMarkMap.minY0 = pointList[i][1]; + xMarkMap.minX0 = pointList[i][0]; + } + if (xMarkMap.max0 < value[0]) { + xMarkMap.max0 = value[0]; + xMarkMap.maxY0 = pointList[i][1]; + xMarkMap.maxX0 = pointList[i][0]; + } + xMarkMap.sum0 += value[0]; + xMarkMap.counter0++; + if (xMarkMap.min1 > value[1]) { + xMarkMap.min1 = value[1]; + xMarkMap.minY1 = pointList[i][1]; + xMarkMap.minX1 = pointList[i][0]; + } + if (xMarkMap.max1 < value[1]) { + xMarkMap.max1 = value[1]; + xMarkMap.maxY1 = pointList[i][1]; + xMarkMap.maxX1 = pointList[i][0]; + } + xMarkMap.sum1 += value[1]; + xMarkMap.counter1++; + } + var gridX = this.component.grid.getX(); + var gridXend = this.component.grid.getXend(); + var gridY = this.component.grid.getY(); + var gridYend = this.component.grid.getYend(); + xMarkMap.average0 = xMarkMap.sum0 / xMarkMap.counter0; + var x = xAxis.getCoord(xMarkMap.average0); + xMarkMap.averageLine0 = [ + [ + x, + gridYend + ], + [ + x, + gridY + ] + ]; + xMarkMap.minLine0 = [ + [ + xMarkMap.minX0, + gridYend + ], + [ + xMarkMap.minX0, + gridY + ] + ]; + xMarkMap.maxLine0 = [ + [ + xMarkMap.maxX0, + gridYend + ], + [ + xMarkMap.maxX0, + gridY + ] + ]; + xMarkMap.average1 = xMarkMap.sum1 / xMarkMap.counter1; + var y = yAxis.getCoord(xMarkMap.average1); + xMarkMap.averageLine1 = [ + [ + gridX, + y + ], + [ + gridXend, + y + ] + ]; + xMarkMap.minLine1 = [ + [ + gridX, + xMarkMap.minY1 + ], + [ + gridXend, + xMarkMap.minY1 + ] + ]; + xMarkMap.maxLine1 = [ + [ + gridX, + xMarkMap.maxY1 + ], + [ + gridXend, + xMarkMap.maxY1 + ] + ]; + return xMarkMap; + }, + _buildPointList: function (pointList) { + var series = this.series; + var serie; + var seriesPL; + var singlePoint; + var shape; + for (var seriesIndex in pointList) { + serie = series[seriesIndex]; + seriesPL = pointList[seriesIndex]; + if (serie.large && serie.data.length > serie.largeThreshold) { + this.shapeList.push(this._getLargeSymbol(seriesPL, this.getItemStyleColor(this.query(serie, 'itemStyle.normal.color'), seriesIndex, -1) || this._sIndex2ColorMap[seriesIndex])); + continue; + } + for (var i = 0, l = seriesPL.length; i < l; i++) { + singlePoint = seriesPL[i]; + shape = this._getSymbol(seriesIndex, singlePoint[2], singlePoint[3], singlePoint[0], singlePoint[1]); + shape && this.shapeList.push(shape); + } + } + }, + _getSymbol: function (seriesIndex, dataIndex, name, x, y) { + var series = this.series; + var serie = series[seriesIndex]; + var data = serie.data[dataIndex]; + var dataRange = this.component.dataRange; + var rangColor; + if (dataRange) { + rangColor = isNaN(data[2]) ? this._sIndex2ColorMap[seriesIndex] : dataRange.getColor(data[2]); + if (!rangColor) { + return null; + } + } else { + rangColor = this._sIndex2ColorMap[seriesIndex]; + } + var itemShape = this.getSymbolShape(serie, seriesIndex, data, dataIndex, name, x, y, this._sIndex2ShapeMap[seriesIndex], rangColor, 'rgba(0,0,0,0)', 'vertical'); + itemShape.zlevel = this.getZlevelBase(); + itemShape.z = this.getZBase(); + itemShape._main = true; + return itemShape; + }, + _getLargeSymbol: function (pointList, nColor) { + return new SymbolShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + _main: true, + hoverable: false, + style: { + pointList: pointList, + color: nColor, + strokeColor: nColor + }, + highlightStyle: { pointList: [] } + }); + }, + getMarkCoord: function (seriesIndex, mpData) { + var serie = this.series[seriesIndex]; + var xMarkMap = this.xMarkMap[seriesIndex]; + var xAxis = this.component.xAxis.getAxis(serie.xAxisIndex); + var yAxis = this.component.yAxis.getAxis(serie.yAxisIndex); + var pos; + if (mpData.type && (mpData.type === 'max' || mpData.type === 'min' || mpData.type === 'average')) { + var valueIndex = mpData.valueIndex != null ? mpData.valueIndex : 1; + pos = [ + xMarkMap[mpData.type + 'X' + valueIndex], + xMarkMap[mpData.type + 'Y' + valueIndex], + xMarkMap[mpData.type + 'Line' + valueIndex], + xMarkMap[mpData.type + valueIndex] + ]; + } else { + pos = [ + typeof mpData.xAxis != 'string' && xAxis.getCoordByIndex ? xAxis.getCoordByIndex(mpData.xAxis || 0) : xAxis.getCoord(mpData.xAxis || 0), + typeof mpData.yAxis != 'string' && yAxis.getCoordByIndex ? yAxis.getCoordByIndex(mpData.yAxis || 0) : yAxis.getCoord(mpData.yAxis || 0) + ]; + } + return pos; + }, + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + this.backupShapeList(); + this._buildShape(); + }, + ondataRange: function (param, status) { + if (this.component.dataRange) { + this.refresh(); + status.needRefresh = true; + } + return; + } + }; + zrUtil.inherits(Scatter, ChartBase); + require('../chart').define('scatter', Scatter); + return Scatter; +});define('echarts/component/dataRange', [ + 'require', + './base', + 'zrender/shape/Text', + 'zrender/shape/Rectangle', + '../util/shape/HandlePolygon', + '../config', + 'zrender/tool/util', + 'zrender/tool/event', + 'zrender/tool/area', + 'zrender/tool/color', + '../component' +], function (require) { + var Base = require('./base'); + var TextShape = require('zrender/shape/Text'); + var RectangleShape = require('zrender/shape/Rectangle'); + var HandlePolygonShape = require('../util/shape/HandlePolygon'); + var ecConfig = require('../config'); + ecConfig.dataRange = { + zlevel: 0, + z: 4, + show: true, + orient: 'vertical', + x: 'left', + y: 'bottom', + backgroundColor: 'rgba(0,0,0,0)', + borderColor: '#ccc', + borderWidth: 0, + padding: 5, + itemGap: 10, + itemWidth: 20, + itemHeight: 14, + precision: 0, + splitNumber: 5, + calculable: false, + selectedMode: true, + hoverLink: true, + realtime: true, + color: [ + '#006edd', + '#e0ffff' + ], + textStyle: { color: '#333' } + }; + var zrUtil = require('zrender/tool/util'); + var zrEvent = require('zrender/tool/event'); + var zrArea = require('zrender/tool/area'); + var zrColor = require('zrender/tool/color'); + function DataRange(ecTheme, messageCenter, zr, option, myChart) { + if (typeof this.query(option, 'dataRange.min') == 'undefined' || typeof this.query(option, 'dataRange.max') == 'undefined') { + console.error('option.dataRange.min or option.dataRange.max has not been defined.'); + return; + } + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + var self = this; + self._ondrift = function (dx, dy) { + return self.__ondrift(this, dx, dy); + }; + self._ondragend = function () { + return self.__ondragend(); + }; + self._dataRangeSelected = function (param) { + return self.__dataRangeSelected(param); + }; + self._dispatchHoverLink = function (param) { + return self.__dispatchHoverLink(param); + }; + self._onhoverlink = function (params) { + return self.__onhoverlink(params); + }; + this._selectedMap = {}; + this._range = {}; + this.refresh(option); + messageCenter.bind(ecConfig.EVENT.HOVER, this._onhoverlink); + } + DataRange.prototype = { + type: ecConfig.COMPONENT_TYPE_DATARANGE, + _textGap: 10, + _buildShape: function () { + this._itemGroupLocation = this._getItemGroupLocation(); + this._buildBackground(); + if (this.dataRangeOption.splitNumber <= 0 || this.dataRangeOption.calculable) { + this._buildGradient(); + } else { + this._buildItem(); + } + if (this.dataRangeOption.show) { + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + } + this._syncShapeFromRange(); + }, + _buildItem: function () { + var data = this._valueTextList; + var dataLength = data.length; + var itemName; + var itemShape; + var textShape; + var font = this.getFont(this.dataRangeOption.textStyle); + var lastX = this._itemGroupLocation.x; + var lastY = this._itemGroupLocation.y; + var itemWidth = this.dataRangeOption.itemWidth; + var itemHeight = this.dataRangeOption.itemHeight; + var itemGap = this.dataRangeOption.itemGap; + var textHeight = zrArea.getTextHeight('国', font); + var color; + if (this.dataRangeOption.orient == 'vertical' && this.dataRangeOption.x == 'right') { + lastX = this._itemGroupLocation.x + this._itemGroupLocation.width - itemWidth; + } + var needValueText = true; + if (this.dataRangeOption.text) { + needValueText = false; + if (this.dataRangeOption.text[0]) { + textShape = this._getTextShape(lastX, lastY, this.dataRangeOption.text[0]); + if (this.dataRangeOption.orient == 'horizontal') { + lastX += zrArea.getTextWidth(this.dataRangeOption.text[0], font) + this._textGap; + } else { + lastY += textHeight + this._textGap; + textShape.style.y += textHeight / 2 + this._textGap; + textShape.style.textBaseline = 'bottom'; + } + this.shapeList.push(new TextShape(textShape)); + } + } + for (var i = 0; i < dataLength; i++) { + itemName = data[i]; + color = this.getColorByIndex(i); + itemShape = this._getItemShape(lastX, lastY, itemWidth, itemHeight, this._selectedMap[i] ? color : '#ccc'); + itemShape._idx = i; + itemShape.onmousemove = this._dispatchHoverLink; + if (this.dataRangeOption.selectedMode) { + itemShape.clickable = true; + itemShape.onclick = this._dataRangeSelected; + } + this.shapeList.push(new RectangleShape(itemShape)); + if (needValueText) { + textShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: lastX + itemWidth + 5, + y: lastY, + color: this._selectedMap[i] ? this.dataRangeOption.textStyle.color : '#ccc', + text: data[i], + textFont: font, + textBaseline: 'top' + }, + highlightStyle: { brushType: 'fill' } + }; + if (this.dataRangeOption.orient == 'vertical' && this.dataRangeOption.x == 'right') { + textShape.style.x -= itemWidth + 10; + textShape.style.textAlign = 'right'; + } + textShape._idx = i; + textShape.onmousemove = this._dispatchHoverLink; + if (this.dataRangeOption.selectedMode) { + textShape.clickable = true; + textShape.onclick = this._dataRangeSelected; + } + this.shapeList.push(new TextShape(textShape)); + } + if (this.dataRangeOption.orient == 'horizontal') { + lastX += itemWidth + (needValueText ? 5 : 0) + (needValueText ? zrArea.getTextWidth(itemName, font) : 0) + itemGap; + } else { + lastY += itemHeight + itemGap; + } + } + if (!needValueText && this.dataRangeOption.text[1]) { + if (this.dataRangeOption.orient == 'horizontal') { + lastX = lastX - itemGap + this._textGap; + } else { + lastY = lastY - itemGap + this._textGap; + } + textShape = this._getTextShape(lastX, lastY, this.dataRangeOption.text[1]); + if (this.dataRangeOption.orient != 'horizontal') { + textShape.style.y -= 5; + textShape.style.textBaseline = 'top'; + } + this.shapeList.push(new TextShape(textShape)); + } + }, + _buildGradient: function () { + var itemShape; + var textShape; + var font = this.getFont(this.dataRangeOption.textStyle); + var lastX = this._itemGroupLocation.x; + var lastY = this._itemGroupLocation.y; + var itemWidth = this.dataRangeOption.itemWidth; + var itemHeight = this.dataRangeOption.itemHeight; + var textHeight = zrArea.getTextHeight('国', font); + var mSize = 10; + var needValueText = true; + if (this.dataRangeOption.text) { + needValueText = false; + if (this.dataRangeOption.text[0]) { + textShape = this._getTextShape(lastX, lastY, this.dataRangeOption.text[0]); + if (this.dataRangeOption.orient == 'horizontal') { + lastX += zrArea.getTextWidth(this.dataRangeOption.text[0], font) + this._textGap; + } else { + lastY += textHeight + this._textGap; + textShape.style.y += textHeight / 2 + this._textGap; + textShape.style.textBaseline = 'bottom'; + } + this.shapeList.push(new TextShape(textShape)); + } + } + var zrColor = require('zrender/tool/color'); + var per = 1 / (this.dataRangeOption.color.length - 1); + var colorList = []; + for (var i = 0, l = this.dataRangeOption.color.length; i < l; i++) { + colorList.push([ + i * per, + this.dataRangeOption.color[i] + ]); + } + if (this.dataRangeOption.orient == 'horizontal') { + itemShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: lastX, + y: lastY, + width: itemWidth * mSize, + height: itemHeight, + color: zrColor.getLinearGradient(lastX, lastY, lastX + itemWidth * mSize, lastY, colorList) + }, + hoverable: false + }; + lastX += itemWidth * mSize + this._textGap; + } else { + itemShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: lastX, + y: lastY, + width: itemWidth, + height: itemHeight * mSize, + color: zrColor.getLinearGradient(lastX, lastY, lastX, lastY + itemHeight * mSize, colorList) + }, + hoverable: false + }; + lastY += itemHeight * mSize + this._textGap; + } + this.shapeList.push(new RectangleShape(itemShape)); + this._calculableLocation = itemShape.style; + if (this.dataRangeOption.calculable) { + this._buildFiller(); + this._bulidMask(); + this._bulidHandle(); + } + this._buildIndicator(); + if (!needValueText && this.dataRangeOption.text[1]) { + textShape = this._getTextShape(lastX, lastY, this.dataRangeOption.text[1]); + this.shapeList.push(new TextShape(textShape)); + } + }, + _buildIndicator: function () { + var x = this._calculableLocation.x; + var y = this._calculableLocation.y; + var width = this._calculableLocation.width; + var height = this._calculableLocation.height; + var size = 5; + var pointList; + var textPosition; + if (this.dataRangeOption.orient == 'horizontal') { + if (this.dataRangeOption.y != 'bottom') { + pointList = [ + [ + x, + y + height + ], + [ + x - size, + y + height + size + ], + [ + x + size, + y + height + size + ] + ]; + textPosition = 'bottom'; + } else { + pointList = [ + [ + x, + y + ], + [ + x - size, + y - size + ], + [ + x + size, + y - size + ] + ]; + textPosition = 'top'; + } + } else { + if (this.dataRangeOption.x != 'right') { + pointList = [ + [ + x + width, + y + ], + [ + x + width + size, + y - size + ], + [ + x + width + size, + y + size + ] + ]; + textPosition = 'right'; + } else { + pointList = [ + [ + x, + y + ], + [ + x - size, + y - size + ], + [ + x - size, + y + size + ] + ]; + textPosition = 'left'; + } + } + this._indicatorShape = { + style: { + pointList: pointList, + color: '#fff', + __rect: { + x: Math.min(pointList[0][0], pointList[1][0]), + y: Math.min(pointList[0][1], pointList[1][1]), + width: size * (this.dataRangeOption.orient == 'horizontal' ? 2 : 1), + height: size * (this.dataRangeOption.orient == 'horizontal' ? 1 : 2) + } + }, + highlightStyle: { + brushType: 'fill', + textPosition: textPosition, + textColor: this.dataRangeOption.textStyle.color + }, + hoverable: false + }; + this._indicatorShape = new HandlePolygonShape(this._indicatorShape); + }, + _buildFiller: function () { + this._fillerShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + style: { + x: this._calculableLocation.x, + y: this._calculableLocation.y, + width: this._calculableLocation.width, + height: this._calculableLocation.height, + color: 'rgba(255,255,255,0)' + }, + highlightStyle: { + strokeColor: 'rgba(255,255,255,0.5)', + lineWidth: 1 + }, + draggable: true, + ondrift: this._ondrift, + ondragend: this._ondragend, + onmousemove: this._dispatchHoverLink, + _type: 'filler' + }; + this._fillerShape = new RectangleShape(this._fillerShape); + this.shapeList.push(this._fillerShape); + }, + _bulidHandle: function () { + var x = this._calculableLocation.x; + var y = this._calculableLocation.y; + var width = this._calculableLocation.width; + var height = this._calculableLocation.height; + var font = this.getFont(this.dataRangeOption.textStyle); + var textHeight = zrArea.getTextHeight('国', font); + var textWidth = Math.max(zrArea.getTextWidth(this._textFormat(this.dataRangeOption.max), font), zrArea.getTextWidth(this._textFormat(this.dataRangeOption.min), font)) + 2; + var pointListStart; + var textXStart; + var textYStart; + var coverRectStart; + var pointListEnd; + var textXEnd; + var textYEnd; + var coverRectEnd; + if (this.dataRangeOption.orient == 'horizontal') { + if (this.dataRangeOption.y != 'bottom') { + pointListStart = [ + [ + x, + y + ], + [ + x, + y + height + textHeight + ], + [ + x - textHeight, + y + height + textHeight + ], + [ + x - 1, + y + height + ], + [ + x - 1, + y + ] + ]; + textXStart = x - textWidth / 2 - textHeight; + textYStart = y + height + textHeight / 2 + 2; + coverRectStart = { + x: x - textWidth - textHeight, + y: y + height, + width: textWidth + textHeight, + height: textHeight + }; + pointListEnd = [ + [ + x + width, + y + ], + [ + x + width, + y + height + textHeight + ], + [ + x + width + textHeight, + y + height + textHeight + ], + [ + x + width + 1, + y + height + ], + [ + x + width + 1, + y + ] + ]; + textXEnd = x + width + textWidth / 2 + textHeight; + textYEnd = textYStart; + coverRectEnd = { + x: x + width, + y: y + height, + width: textWidth + textHeight, + height: textHeight + }; + } else { + pointListStart = [ + [ + x, + y + height + ], + [ + x, + y - textHeight + ], + [ + x - textHeight, + y - textHeight + ], + [ + x - 1, + y + ], + [ + x - 1, + y + height + ] + ]; + textXStart = x - textWidth / 2 - textHeight; + textYStart = y - textHeight / 2 - 2; + coverRectStart = { + x: x - textWidth - textHeight, + y: y - textHeight, + width: textWidth + textHeight, + height: textHeight + }; + pointListEnd = [ + [ + x + width, + y + height + ], + [ + x + width, + y - textHeight + ], + [ + x + width + textHeight, + y - textHeight + ], + [ + x + width + 1, + y + ], + [ + x + width + 1, + y + height + ] + ]; + textXEnd = x + width + textWidth / 2 + textHeight; + textYEnd = textYStart; + coverRectEnd = { + x: x + width, + y: y - textHeight, + width: textWidth + textHeight, + height: textHeight + }; + } + } else { + textWidth += textHeight; + if (this.dataRangeOption.x != 'right') { + pointListStart = [ + [ + x, + y + ], + [ + x + width + textHeight, + y + ], + [ + x + width + textHeight, + y - textHeight + ], + [ + x + width, + y - 1 + ], + [ + x, + y - 1 + ] + ]; + textXStart = x + width + textWidth / 2 + textHeight / 2; + textYStart = y - textHeight / 2; + coverRectStart = { + x: x + width, + y: y - textHeight, + width: textWidth + textHeight, + height: textHeight + }; + pointListEnd = [ + [ + x, + y + height + ], + [ + x + width + textHeight, + y + height + ], + [ + x + width + textHeight, + y + textHeight + height + ], + [ + x + width, + y + 1 + height + ], + [ + x, + y + height + 1 + ] + ]; + textXEnd = textXStart; + textYEnd = y + height + textHeight / 2; + coverRectEnd = { + x: x + width, + y: y + height, + width: textWidth + textHeight, + height: textHeight + }; + } else { + pointListStart = [ + [ + x + width, + y + ], + [ + x - textHeight, + y + ], + [ + x - textHeight, + y - textHeight + ], + [ + x, + y - 1 + ], + [ + x + width, + y - 1 + ] + ]; + textXStart = x - textWidth / 2 - textHeight / 2; + textYStart = y - textHeight / 2; + coverRectStart = { + x: x - textWidth - textHeight, + y: y - textHeight, + width: textWidth + textHeight, + height: textHeight + }; + pointListEnd = [ + [ + x + width, + y + height + ], + [ + x - textHeight, + y + height + ], + [ + x - textHeight, + y + textHeight + height + ], + [ + x, + y + 1 + height + ], + [ + x + width, + y + height + 1 + ] + ]; + textXEnd = textXStart; + textYEnd = y + height + textHeight / 2; + coverRectEnd = { + x: x - textWidth - textHeight, + y: y + height, + width: textWidth + textHeight, + height: textHeight + }; + } + } + this._startShape = { + style: { + pointList: pointListStart, + text: this._textFormat(this.dataRangeOption.max), + textX: textXStart, + textY: textYStart, + textFont: font, + color: this.getColor(this.dataRangeOption.max), + rect: coverRectStart, + x: pointListStart[0][0], + y: pointListStart[0][1], + _x: pointListStart[0][0], + _y: pointListStart[0][1] + } + }; + this._startShape.highlightStyle = { + strokeColor: this._startShape.style.color, + lineWidth: 1 + }; + this._endShape = { + style: { + pointList: pointListEnd, + text: this._textFormat(this.dataRangeOption.min), + textX: textXEnd, + textY: textYEnd, + textFont: font, + color: this.getColor(this.dataRangeOption.min), + rect: coverRectEnd, + x: pointListEnd[0][0], + y: pointListEnd[0][1], + _x: pointListEnd[0][0], + _y: pointListEnd[0][1] + } + }; + this._endShape.highlightStyle = { + strokeColor: this._endShape.style.color, + lineWidth: 1 + }; + this._startShape.zlevel = this._endShape.zlevel = this.getZlevelBase(); + this._startShape.z = this._endShape.z = this.getZBase() + 1; + this._startShape.draggable = this._endShape.draggable = true; + this._startShape.ondrift = this._endShape.ondrift = this._ondrift; + this._startShape.ondragend = this._endShape.ondragend = this._ondragend; + this._startShape.style.textColor = this._endShape.style.textColor = this.dataRangeOption.textStyle.color; + this._startShape.style.textAlign = this._endShape.style.textAlign = 'center'; + this._startShape.style.textPosition = this._endShape.style.textPosition = 'specific'; + this._startShape.style.textBaseline = this._endShape.style.textBaseline = 'middle'; + this._startShape.style.width = this._endShape.style.width = 0; + this._startShape.style.height = this._endShape.style.height = 0; + this._startShape.style.textPosition = this._endShape.style.textPosition = 'specific'; + this._startShape = new HandlePolygonShape(this._startShape); + this._endShape = new HandlePolygonShape(this._endShape); + this.shapeList.push(this._startShape); + this.shapeList.push(this._endShape); + }, + _bulidMask: function () { + var x = this._calculableLocation.x; + var y = this._calculableLocation.y; + var width = this._calculableLocation.width; + var height = this._calculableLocation.height; + this._startMask = { + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + style: { + x: x, + y: y, + width: this.dataRangeOption.orient == 'horizontal' ? 0 : width, + height: this.dataRangeOption.orient == 'horizontal' ? height : 0, + color: '#ccc' + }, + hoverable: false + }; + this._endMask = { + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + style: { + x: this.dataRangeOption.orient == 'horizontal' ? x + width : x, + y: this.dataRangeOption.orient == 'horizontal' ? y : y + height, + width: this.dataRangeOption.orient == 'horizontal' ? 0 : width, + height: this.dataRangeOption.orient == 'horizontal' ? height : 0, + color: '#ccc' + }, + hoverable: false + }; + this._startMask = new RectangleShape(this._startMask); + this._endMask = new RectangleShape(this._endMask); + this.shapeList.push(this._startMask); + this.shapeList.push(this._endMask); + }, + _buildBackground: function () { + var padding = this.reformCssArray(this.dataRangeOption.padding); + this.shapeList.push(new RectangleShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: this._itemGroupLocation.x - padding[3], + y: this._itemGroupLocation.y - padding[0], + width: this._itemGroupLocation.width + padding[3] + padding[1], + height: this._itemGroupLocation.height + padding[0] + padding[2], + brushType: this.dataRangeOption.borderWidth === 0 ? 'fill' : 'both', + color: this.dataRangeOption.backgroundColor, + strokeColor: this.dataRangeOption.borderColor, + lineWidth: this.dataRangeOption.borderWidth + } + })); + }, + _getItemGroupLocation: function () { + var data = this._valueTextList; + var dataLength = data.length; + var itemGap = this.dataRangeOption.itemGap; + var itemWidth = this.dataRangeOption.itemWidth; + var itemHeight = this.dataRangeOption.itemHeight; + var totalWidth = 0; + var totalHeight = 0; + var font = this.getFont(this.dataRangeOption.textStyle); + var textHeight = zrArea.getTextHeight('国', font); + var mSize = 10; + if (this.dataRangeOption.orient == 'horizontal') { + if (this.dataRangeOption.text || this.dataRangeOption.splitNumber <= 0 || this.dataRangeOption.calculable) { + totalWidth = (this.dataRangeOption.splitNumber <= 0 || this.dataRangeOption.calculable ? itemWidth * mSize + itemGap : dataLength * (itemWidth + itemGap)) + (this.dataRangeOption.text && typeof this.dataRangeOption.text[0] != 'undefined' ? zrArea.getTextWidth(this.dataRangeOption.text[0], font) + this._textGap : 0) + (this.dataRangeOption.text && typeof this.dataRangeOption.text[1] != 'undefined' ? zrArea.getTextWidth(this.dataRangeOption.text[1], font) + this._textGap : 0); + } else { + itemWidth += 5; + for (var i = 0; i < dataLength; i++) { + totalWidth += itemWidth + zrArea.getTextWidth(data[i], font) + itemGap; + } + } + totalWidth -= itemGap; + totalHeight = Math.max(textHeight, itemHeight); + } else { + var maxWidth; + if (this.dataRangeOption.text || this.dataRangeOption.splitNumber <= 0 || this.dataRangeOption.calculable) { + totalHeight = (this.dataRangeOption.splitNumber <= 0 || this.dataRangeOption.calculable ? itemHeight * mSize + itemGap : dataLength * (itemHeight + itemGap)) + (this.dataRangeOption.text && typeof this.dataRangeOption.text[0] != 'undefined' ? this._textGap + textHeight : 0) + (this.dataRangeOption.text && typeof this.dataRangeOption.text[1] != 'undefined' ? this._textGap + textHeight : 0); + maxWidth = Math.max(zrArea.getTextWidth(this.dataRangeOption.text && this.dataRangeOption.text[0] || '', font), zrArea.getTextWidth(this.dataRangeOption.text && this.dataRangeOption.text[1] || '', font)); + totalWidth = Math.max(itemWidth, maxWidth); + } else { + totalHeight = (itemHeight + itemGap) * dataLength; + itemWidth += 5; + maxWidth = 0; + for (var i = 0; i < dataLength; i++) { + maxWidth = Math.max(maxWidth, zrArea.getTextWidth(data[i], font)); + } + totalWidth = itemWidth + maxWidth; + } + totalHeight -= itemGap; + } + var padding = this.reformCssArray(this.dataRangeOption.padding); + var x; + var zrWidth = this.zr.getWidth(); + switch (this.dataRangeOption.x) { + case 'center': + x = Math.floor((zrWidth - totalWidth) / 2); + break; + case 'left': + x = padding[3] + this.dataRangeOption.borderWidth; + break; + case 'right': + x = zrWidth - totalWidth - padding[1] - this.dataRangeOption.borderWidth; + break; + default: + x = this.parsePercent(this.dataRangeOption.x, zrWidth); + x = isNaN(x) ? 0 : x; + break; + } + var y; + var zrHeight = this.zr.getHeight(); + switch (this.dataRangeOption.y) { + case 'top': + y = padding[0] + this.dataRangeOption.borderWidth; + break; + case 'bottom': + y = zrHeight - totalHeight - padding[2] - this.dataRangeOption.borderWidth; + break; + case 'center': + y = Math.floor((zrHeight - totalHeight) / 2); + break; + default: + y = this.parsePercent(this.dataRangeOption.y, zrHeight); + y = isNaN(y) ? 0 : y; + break; + } + if (this.dataRangeOption.calculable) { + var handlerWidth = Math.max(zrArea.getTextWidth(this.dataRangeOption.max, font), zrArea.getTextWidth(this.dataRangeOption.min, font)) + textHeight; + if (this.dataRangeOption.orient == 'horizontal') { + if (x < handlerWidth) { + x = handlerWidth; + } + if (x + totalWidth + handlerWidth > zrWidth) { + x -= handlerWidth; + } + } else { + if (y < textHeight) { + y = textHeight; + } + if (y + totalHeight + textHeight > zrHeight) { + y -= textHeight; + } + } + } + return { + x: x, + y: y, + width: totalWidth, + height: totalHeight + }; + }, + _getTextShape: function (x, y, text) { + return { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: this.dataRangeOption.orient == 'horizontal' ? x : this._itemGroupLocation.x + this._itemGroupLocation.width / 2, + y: this.dataRangeOption.orient == 'horizontal' ? this._itemGroupLocation.y + this._itemGroupLocation.height / 2 : y, + color: this.dataRangeOption.textStyle.color, + text: text, + textFont: this.getFont(this.dataRangeOption.textStyle), + textBaseline: this.dataRangeOption.orient == 'horizontal' ? 'middle' : 'top', + textAlign: this.dataRangeOption.orient == 'horizontal' ? 'left' : 'center' + }, + hoverable: false + }; + }, + _getItemShape: function (x, y, width, height, color) { + return { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: x, + y: y + 1, + width: width, + height: height - 2, + color: color + }, + highlightStyle: { + strokeColor: color, + lineWidth: 1 + } + }; + }, + __ondrift: function (shape, dx, dy) { + var x = this._calculableLocation.x; + var y = this._calculableLocation.y; + var width = this._calculableLocation.width; + var height = this._calculableLocation.height; + if (this.dataRangeOption.orient == 'horizontal') { + if (shape.style.x + dx <= x) { + shape.style.x = x; + } else if (shape.style.x + dx + shape.style.width >= x + width) { + shape.style.x = x + width - shape.style.width; + } else { + shape.style.x += dx; + } + } else { + if (shape.style.y + dy <= y) { + shape.style.y = y; + } else if (shape.style.y + dy + shape.style.height >= y + height) { + shape.style.y = y + height - shape.style.height; + } else { + shape.style.y += dy; + } + } + if (shape._type == 'filler') { + this._syncHandleShape(); + } else { + this._syncFillerShape(shape); + } + if (this.dataRangeOption.realtime) { + this._dispatchDataRange(); + } + return true; + }, + __ondragend: function () { + this.isDragend = true; + }, + ondragend: function (param, status) { + if (!this.isDragend || !param.target) { + return; + } + status.dragOut = true; + status.dragIn = true; + if (!this.dataRangeOption.realtime) { + this._dispatchDataRange(); + } + status.needRefresh = false; + this.isDragend = false; + return; + }, + _syncShapeFromRange: function () { + var range = this.dataRangeOption.range || {}; + this._range.end = typeof this._range.end != 'undefined' ? this._range.end : typeof range.start != 'undefined' ? range.start : 0; + this._range.start = typeof this._range.start != 'undefined' ? this._range.start : typeof range.end != 'undefined' ? range.end : 100; + if (this._range.start != 100 || this._range.end !== 0) { + if (this.dataRangeOption.orient == 'horizontal') { + var width = this._fillerShape.style.width; + this._fillerShape.style.x += width * (100 - this._range.start) / 100; + this._fillerShape.style.width = width * (this._range.start - this._range.end) / 100; + } else { + var height = this._fillerShape.style.height; + this._fillerShape.style.y += height * (100 - this._range.start) / 100; + this._fillerShape.style.height = height * (this._range.start - this._range.end) / 100; + } + this.zr.modShape(this._fillerShape.id); + this._syncHandleShape(); + } + }, + _syncHandleShape: function () { + var x = this._calculableLocation.x; + var y = this._calculableLocation.y; + var width = this._calculableLocation.width; + var height = this._calculableLocation.height; + if (this.dataRangeOption.orient == 'horizontal') { + this._startShape.style.x = this._fillerShape.style.x; + this._startMask.style.width = this._startShape.style.x - x; + this._endShape.style.x = this._fillerShape.style.x + this._fillerShape.style.width; + this._endMask.style.x = this._endShape.style.x; + this._endMask.style.width = x + width - this._endShape.style.x; + this._range.start = Math.ceil(100 - (this._startShape.style.x - x) / width * 100); + this._range.end = Math.floor(100 - (this._endShape.style.x - x) / width * 100); + } else { + this._startShape.style.y = this._fillerShape.style.y; + this._startMask.style.height = this._startShape.style.y - y; + this._endShape.style.y = this._fillerShape.style.y + this._fillerShape.style.height; + this._endMask.style.y = this._endShape.style.y; + this._endMask.style.height = y + height - this._endShape.style.y; + this._range.start = Math.ceil(100 - (this._startShape.style.y - y) / height * 100); + this._range.end = Math.floor(100 - (this._endShape.style.y - y) / height * 100); + } + this._syncShape(); + }, + _syncFillerShape: function (e) { + var x = this._calculableLocation.x; + var y = this._calculableLocation.y; + var width = this._calculableLocation.width; + var height = this._calculableLocation.height; + var a; + var b; + if (this.dataRangeOption.orient == 'horizontal') { + a = this._startShape.style.x; + b = this._endShape.style.x; + if (e.id == this._startShape.id && a >= b) { + b = a; + this._endShape.style.x = a; + } else if (e.id == this._endShape.id && a >= b) { + a = b; + this._startShape.style.x = a; + } + this._fillerShape.style.x = a; + this._fillerShape.style.width = b - a; + this._startMask.style.width = a - x; + this._endMask.style.x = b; + this._endMask.style.width = x + width - b; + this._range.start = Math.ceil(100 - (a - x) / width * 100); + this._range.end = Math.floor(100 - (b - x) / width * 100); + } else { + a = this._startShape.style.y; + b = this._endShape.style.y; + if (e.id == this._startShape.id && a >= b) { + b = a; + this._endShape.style.y = a; + } else if (e.id == this._endShape.id && a >= b) { + a = b; + this._startShape.style.y = a; + } + this._fillerShape.style.y = a; + this._fillerShape.style.height = b - a; + this._startMask.style.height = a - y; + this._endMask.style.y = b; + this._endMask.style.height = y + height - b; + this._range.start = Math.ceil(100 - (a - y) / height * 100); + this._range.end = Math.floor(100 - (b - y) / height * 100); + } + this._syncShape(); + }, + _syncShape: function () { + this._startShape.position = [ + this._startShape.style.x - this._startShape.style._x, + this._startShape.style.y - this._startShape.style._y + ]; + this._startShape.style.text = this._textFormat(this._gap * this._range.start + this.dataRangeOption.min); + this._startShape.style.color = this._startShape.highlightStyle.strokeColor = this.getColor(this._gap * this._range.start + this.dataRangeOption.min); + this._endShape.position = [ + this._endShape.style.x - this._endShape.style._x, + this._endShape.style.y - this._endShape.style._y + ]; + this._endShape.style.text = this._textFormat(this._gap * this._range.end + this.dataRangeOption.min); + this._endShape.style.color = this._endShape.highlightStyle.strokeColor = this.getColor(this._gap * this._range.end + this.dataRangeOption.min); + this.zr.modShape(this._startShape.id); + this.zr.modShape(this._endShape.id); + this.zr.modShape(this._startMask.id); + this.zr.modShape(this._endMask.id); + this.zr.modShape(this._fillerShape.id); + this.zr.refreshNextFrame(); + }, + _dispatchDataRange: function () { + this.messageCenter.dispatch(ecConfig.EVENT.DATA_RANGE, null, { + range: { + start: this._range.end, + end: this._range.start + } + }, this.myChart); + }, + __dataRangeSelected: function (param) { + if (this.dataRangeOption.selectedMode === 'single') { + for (var k in this._selectedMap) { + this._selectedMap[k] = false; + } + } + var idx = param.target._idx; + this._selectedMap[idx] = !this._selectedMap[idx]; + var valueMax = (this._colorList.length - idx) * this._gap + this.dataRangeOption.min; + this.messageCenter.dispatch(ecConfig.EVENT.DATA_RANGE_SELECTED, param.event, { + selected: this._selectedMap, + target: idx, + valueMax: valueMax, + valueMin: valueMax - this._gap + }, this.myChart); + this.messageCenter.dispatch(ecConfig.EVENT.REFRESH, null, null, this.myChart); + }, + __dispatchHoverLink: function (param) { + var valueMin; + var valueMax; + if (this.dataRangeOption.calculable) { + var totalValue = this.dataRangeOption.max - this.dataRangeOption.min; + var curValue; + if (this.dataRangeOption.orient == 'horizontal') { + curValue = (1 - (zrEvent.getX(param.event) - this._calculableLocation.x) / this._calculableLocation.width) * totalValue; + } else { + curValue = (1 - (zrEvent.getY(param.event) - this._calculableLocation.y) / this._calculableLocation.height) * totalValue; + } + valueMin = curValue - totalValue * 0.05; + valueMax = curValue + totalValue * 0.05; + } else { + var idx = param.target._idx; + valueMax = (this._colorList.length - idx) * this._gap + this.dataRangeOption.min; + valueMin = valueMax - this._gap; + } + this.messageCenter.dispatch(ecConfig.EVENT.DATA_RANGE_HOVERLINK, param.event, { + valueMin: valueMin, + valueMax: valueMax + }, this.myChart); + return; + }, + __onhoverlink: function (param) { + if (this.dataRangeOption.show && this.dataRangeOption.hoverLink && this._indicatorShape && param && param.seriesIndex != null && param.dataIndex != null) { + var curValue = param.value; + if (curValue === '' || isNaN(curValue)) { + return; + } + if (curValue < this.dataRangeOption.min) { + curValue = this.dataRangeOption.min; + } else if (curValue > this.dataRangeOption.max) { + curValue = this.dataRangeOption.max; + } + if (this.dataRangeOption.orient == 'horizontal') { + this._indicatorShape.position = [ + (this.dataRangeOption.max - curValue) / (this.dataRangeOption.max - this.dataRangeOption.min) * this._calculableLocation.width, + 0 + ]; + } else { + this._indicatorShape.position = [ + 0, + (this.dataRangeOption.max - curValue) / (this.dataRangeOption.max - this.dataRangeOption.min) * this._calculableLocation.height + ]; + } + this._indicatorShape.style.text = this._textFormat(param.value); + this._indicatorShape.style.color = this.getColor(curValue); + this.zr.addHoverShape(this._indicatorShape); + } + }, + _textFormat: function (valueStart, valueEnd) { + valueStart = valueStart.toFixed(this.dataRangeOption.precision); + valueEnd = valueEnd != null ? valueEnd.toFixed(this.dataRangeOption.precision) : ''; + if (this.dataRangeOption.formatter) { + if (typeof this.dataRangeOption.formatter == 'string') { + return this.dataRangeOption.formatter.replace('{value}', valueStart).replace('{value2}', valueEnd); + } else if (typeof this.dataRangeOption.formatter == 'function') { + return this.dataRangeOption.formatter.call(this.myChart, valueStart, valueEnd); + } + } + if (valueEnd !== '') { + return valueStart + ' - ' + valueEnd; + } + return valueStart; + }, + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.option.dataRange = this.reformOption(this.option.dataRange); + this.dataRangeOption = this.option.dataRange; + if (!this.myChart.canvasSupported) { + this.dataRangeOption.realtime = false; + } + var splitNumber = this.dataRangeOption.splitNumber <= 0 || this.dataRangeOption.calculable ? 100 : this.dataRangeOption.splitNumber; + this._colorList = zrColor.getGradientColors(this.dataRangeOption.color, Math.max((splitNumber - this.dataRangeOption.color.length) / (this.dataRangeOption.color.length - 1), 0) + 1); + if (this._colorList.length > splitNumber) { + var len = this._colorList.length; + var newColorList = [this._colorList[0]]; + var step = len / (splitNumber - 1); + for (var i = 1; i < splitNumber - 1; i++) { + newColorList.push(this._colorList[Math.floor(i * step)]); + } + newColorList.push(this._colorList[len - 1]); + this._colorList = newColorList; + } + var precision = this.dataRangeOption.precision; + this._gap = (this.dataRangeOption.max - this.dataRangeOption.min) / splitNumber; + while (this._gap.toFixed(precision) - 0 != this._gap && precision < 5) { + precision++; + } + this.dataRangeOption.precision = precision; + this._gap = ((this.dataRangeOption.max - this.dataRangeOption.min) / splitNumber).toFixed(precision) - 0; + this._valueTextList = []; + for (var i = 0; i < splitNumber; i++) { + this._selectedMap[i] = true; + this._valueTextList.unshift(this._textFormat(i * this._gap + this.dataRangeOption.min, (i + 1) * this._gap + this.dataRangeOption.min)); + } + } + this.clear(); + this._buildShape(); + }, + getColor: function (value) { + if (isNaN(value)) { + return null; + } + if (this.dataRangeOption.min == this.dataRangeOption.max) { + return this._colorList[0]; + } + if (value < this.dataRangeOption.min) { + value = this.dataRangeOption.min; + } else if (value > this.dataRangeOption.max) { + value = this.dataRangeOption.max; + } + if (this.dataRangeOption.calculable) { + if (value - (this._gap * this._range.start + this.dataRangeOption.min) > 0.00005 || value - (this._gap * this._range.end + this.dataRangeOption.min) < -0.00005) { + return null; + } + } + var idx = this._colorList.length - Math.ceil((value - this.dataRangeOption.min) / (this.dataRangeOption.max - this.dataRangeOption.min) * this._colorList.length); + if (idx == this._colorList.length) { + idx--; + } + if (this._selectedMap[idx]) { + return this._colorList[idx]; + } else { + return null; + } + }, + getColorByIndex: function (idx) { + if (idx >= this._colorList.length) { + idx = this._colorList.length - 1; + } else if (idx < 0) { + idx = 0; + } + return this._colorList[idx]; + }, + onbeforDispose: function () { + this.messageCenter.unbind(ecConfig.EVENT.HOVER, this._onhoverlink); + } + }; + zrUtil.inherits(DataRange, Base); + require('../component').define('dataRange', DataRange); + return DataRange; +});define('echarts/util/shape/HandlePolygon', [ + 'require', + 'zrender/shape/Base', + 'zrender/shape/Polygon', + 'zrender/tool/util' +], function (require) { + var Base = require('zrender/shape/Base'); + var PolygonShape = require('zrender/shape/Polygon'); + var zrUtil = require('zrender/tool/util'); + function HandlePolygon(options) { + Base.call(this, options); + } + HandlePolygon.prototype = { + type: 'handle-polygon', + buildPath: function (ctx, style) { + PolygonShape.prototype.buildPath(ctx, style); + }, + isCover: function (x, y) { + var originPos = this.getTansform(x, y); + x = originPos[0]; + y = originPos[1]; + var rect = this.style.rect; + if (x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height) { + return true; + } else { + return false; + } + } + }; + zrUtil.inherits(HandlePolygon, Base); + return HandlePolygon; +});define('echarts/chart/k', [ + 'require', + './base', + '../util/shape/Candle', + '../component/axis', + '../component/grid', + '../component/dataZoom', + '../config', + '../util/ecData', + 'zrender/tool/util', + '../chart' +], function (require) { + var ChartBase = require('./base'); + var CandleShape = require('../util/shape/Candle'); + require('../component/axis'); + require('../component/grid'); + require('../component/dataZoom'); + var ecConfig = require('../config'); + ecConfig.k = { + zlevel: 0, + z: 2, + clickable: true, + hoverable: true, + legendHoverLink: false, + xAxisIndex: 0, + yAxisIndex: 0, + itemStyle: { + normal: { + color: '#fff', + color0: '#00aa11', + lineStyle: { + width: 1, + color: '#ff3200', + color0: '#00aa11' + } + }, + emphasis: {} + } + }; + var ecData = require('../util/ecData'); + var zrUtil = require('zrender/tool/util'); + function K(ecTheme, messageCenter, zr, option, myChart) { + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); + this.refresh(option); + } + K.prototype = { + type: ecConfig.CHART_TYPE_K, + _buildShape: function () { + var series = this.series; + this.selectedMap = {}; + var _position2sIndexMap = { + top: [], + bottom: [] + }; + var xAxis; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type === ecConfig.CHART_TYPE_K) { + series[i] = this.reformOption(series[i]); + this.legendHoverLink = series[i].legendHoverLink || this.legendHoverLink; + xAxis = this.component.xAxis.getAxis(series[i].xAxisIndex); + if (xAxis.type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY) { + _position2sIndexMap[xAxis.getPosition()].push(i); + } + } + } + for (var position in _position2sIndexMap) { + if (_position2sIndexMap[position].length > 0) { + this._buildSinglePosition(position, _position2sIndexMap[position]); + } + } + this.addShapeList(); + }, + _buildSinglePosition: function (position, seriesArray) { + var mapData = this._mapData(seriesArray); + var locationMap = mapData.locationMap; + var maxDataLength = mapData.maxDataLength; + if (maxDataLength === 0 || locationMap.length === 0) { + return; + } + this._buildHorizontal(seriesArray, maxDataLength, locationMap); + for (var i = 0, l = seriesArray.length; i < l; i++) { + this.buildMark(seriesArray[i]); + } + }, + _mapData: function (seriesArray) { + var series = this.series; + var serie; + var serieName; + var legend = this.component.legend; + var locationMap = []; + var maxDataLength = 0; + for (var i = 0, l = seriesArray.length; i < l; i++) { + serie = series[seriesArray[i]]; + serieName = serie.name; + this.selectedMap[serieName] = legend ? legend.isSelected(serieName) : true; + if (this.selectedMap[serieName]) { + locationMap.push(seriesArray[i]); + } + maxDataLength = Math.max(maxDataLength, serie.data.length); + } + return { + locationMap: locationMap, + maxDataLength: maxDataLength + }; + }, + _buildHorizontal: function (seriesArray, maxDataLength, locationMap) { + var series = this.series; + var seriesIndex; + var serie; + var xAxisIndex; + var categoryAxis; + var yAxisIndex; + var valueAxis; + var pointList = {}; + var candleWidth; + var data; + var value; + var barMaxWidth; + for (var j = 0, k = locationMap.length; j < k; j++) { + seriesIndex = locationMap[j]; + serie = series[seriesIndex]; + xAxisIndex = serie.xAxisIndex || 0; + categoryAxis = this.component.xAxis.getAxis(xAxisIndex); + candleWidth = serie.barWidth || Math.floor(categoryAxis.getGap() / 2); + barMaxWidth = serie.barMaxWidth; + if (barMaxWidth && barMaxWidth < candleWidth) { + candleWidth = barMaxWidth; + } + yAxisIndex = serie.yAxisIndex || 0; + valueAxis = this.component.yAxis.getAxis(yAxisIndex); + pointList[seriesIndex] = []; + for (var i = 0, l = maxDataLength; i < l; i++) { + if (categoryAxis.getNameByIndex(i) == null) { + break; + } + data = serie.data[i]; + value = this.getDataFromOption(data, '-'); + if (value === '-' || value.length != 4) { + continue; + } + pointList[seriesIndex].push([ + categoryAxis.getCoordByIndex(i), + candleWidth, + valueAxis.getCoord(value[0]), + valueAxis.getCoord(value[1]), + valueAxis.getCoord(value[2]), + valueAxis.getCoord(value[3]), + i, + categoryAxis.getNameByIndex(i) + ]); + } + } + this._buildKLine(seriesArray, pointList); + }, + _buildKLine: function (seriesArray, pointList) { + var series = this.series; + var nLineWidth; + var nLineColor; + var nLineColor0; + var nColor; + var nColor0; + var eLineWidth; + var eLineColor; + var eLineColor0; + var eColor; + var eColor0; + var serie; + var queryTarget; + var data; + var seriesPL; + var singlePoint; + var candleType; + var seriesIndex; + for (var sIdx = 0, len = seriesArray.length; sIdx < len; sIdx++) { + seriesIndex = seriesArray[sIdx]; + serie = series[seriesIndex]; + seriesPL = pointList[seriesIndex]; + if (this._isLarge(seriesPL)) { + seriesPL = this._getLargePointList(seriesPL); + } + if (serie.type === ecConfig.CHART_TYPE_K && seriesPL != null) { + queryTarget = serie; + nLineWidth = this.query(queryTarget, 'itemStyle.normal.lineStyle.width'); + nLineColor = this.query(queryTarget, 'itemStyle.normal.lineStyle.color'); + nLineColor0 = this.query(queryTarget, 'itemStyle.normal.lineStyle.color0'); + nColor = this.query(queryTarget, 'itemStyle.normal.color'); + nColor0 = this.query(queryTarget, 'itemStyle.normal.color0'); + eLineWidth = this.query(queryTarget, 'itemStyle.emphasis.lineStyle.width'); + eLineColor = this.query(queryTarget, 'itemStyle.emphasis.lineStyle.color'); + eLineColor0 = this.query(queryTarget, 'itemStyle.emphasis.lineStyle.color0'); + eColor = this.query(queryTarget, 'itemStyle.emphasis.color'); + eColor0 = this.query(queryTarget, 'itemStyle.emphasis.color0'); + for (var i = 0, l = seriesPL.length; i < l; i++) { + singlePoint = seriesPL[i]; + data = serie.data[singlePoint[6]]; + queryTarget = data; + candleType = singlePoint[3] < singlePoint[2]; + this.shapeList.push(this._getCandle(seriesIndex, singlePoint[6], singlePoint[7], singlePoint[0], singlePoint[1], singlePoint[2], singlePoint[3], singlePoint[4], singlePoint[5], candleType ? this.query(queryTarget, 'itemStyle.normal.color') || nColor : this.query(queryTarget, 'itemStyle.normal.color0') || nColor0, this.query(queryTarget, 'itemStyle.normal.lineStyle.width') || nLineWidth, candleType ? this.query(queryTarget, 'itemStyle.normal.lineStyle.color') || nLineColor : this.query(queryTarget, 'itemStyle.normal.lineStyle.color0') || nLineColor0, candleType ? this.query(queryTarget, 'itemStyle.emphasis.color') || eColor || nColor : this.query(queryTarget, 'itemStyle.emphasis.color0') || eColor0 || nColor0, this.query(queryTarget, 'itemStyle.emphasis.lineStyle.width') || eLineWidth || nLineWidth, candleType ? this.query(queryTarget, 'itemStyle.emphasis.lineStyle.color') || eLineColor || nLineColor : this.query(queryTarget, 'itemStyle.emphasis.lineStyle.color0') || eLineColor0 || nLineColor0)); + } + } + } + }, + _isLarge: function (singlePL) { + return singlePL[0][1] < 0.5; + }, + _getLargePointList: function (singlePL) { + var total = this.component.grid.getWidth(); + var len = singlePL.length; + var newList = []; + for (var i = 0; i < total; i++) { + newList[i] = singlePL[Math.floor(len / total * i)]; + } + return newList; + }, + _getCandle: function (seriesIndex, dataIndex, name, x, width, y0, y1, y2, y3, nColor, nLinewidth, nLineColor, eColor, eLinewidth, eLineColor) { + var series = this.series; + var itemShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + clickable: this.deepQuery([ + series[seriesIndex].data[dataIndex], + series[seriesIndex] + ], 'clickable'), + hoverable: this.deepQuery([ + series[seriesIndex].data[dataIndex], + series[seriesIndex] + ], 'hoverable'), + style: { + x: x, + y: [ + y0, + y1, + y2, + y3 + ], + width: width, + color: nColor, + strokeColor: nLineColor, + lineWidth: nLinewidth, + brushType: 'both' + }, + highlightStyle: { + color: eColor, + strokeColor: eLineColor, + lineWidth: eLinewidth + }, + _seriesIndex: seriesIndex + }; + ecData.pack(itemShape, series[seriesIndex], seriesIndex, series[seriesIndex].data[dataIndex], dataIndex, name); + itemShape = new CandleShape(itemShape); + return itemShape; + }, + getMarkCoord: function (seriesIndex, mpData) { + var serie = this.series[seriesIndex]; + var xAxis = this.component.xAxis.getAxis(serie.xAxisIndex); + var yAxis = this.component.yAxis.getAxis(serie.yAxisIndex); + return [ + typeof mpData.xAxis != 'string' && xAxis.getCoordByIndex ? xAxis.getCoordByIndex(mpData.xAxis || 0) : xAxis.getCoord(mpData.xAxis || 0), + typeof mpData.yAxis != 'string' && yAxis.getCoordByIndex ? yAxis.getCoordByIndex(mpData.yAxis || 0) : yAxis.getCoord(mpData.yAxis || 0) + ]; + }, + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + this.backupShapeList(); + this._buildShape(); + }, + addDataAnimation: function (params) { + var series = this.series; + var aniMap = {}; + for (var i = 0, l = params.length; i < l; i++) { + aniMap[params[i][0]] = params[i]; + } + var x; + var dx; + var y; + var serie; + var seriesIndex; + var dataIndex; + for (var i = 0, l = this.shapeList.length; i < l; i++) { + seriesIndex = this.shapeList[i]._seriesIndex; + if (aniMap[seriesIndex] && !aniMap[seriesIndex][3]) { + if (this.shapeList[i].type === 'candle') { + dataIndex = ecData.get(this.shapeList[i], 'dataIndex'); + serie = series[seriesIndex]; + if (aniMap[seriesIndex][2] && dataIndex === serie.data.length - 1) { + this.zr.delShape(this.shapeList[i].id); + continue; + } else if (!aniMap[seriesIndex][2] && dataIndex === 0) { + this.zr.delShape(this.shapeList[i].id); + continue; + } + dx = this.component.xAxis.getAxis(serie.xAxisIndex || 0).getGap(); + x = aniMap[seriesIndex][2] ? dx : -dx; + y = 0; + this.zr.animate(this.shapeList[i].id, '').when(this.query(this.option, 'animationDurationUpdate'), { + position: [ + x, + y + ] + }).start(); + } + } + } + } + }; + zrUtil.inherits(K, ChartBase); + require('../chart').define('k', K); + return K; +});define('echarts/chart/pie', [ + 'require', + './base', + 'zrender/shape/Text', + 'zrender/shape/Ring', + 'zrender/shape/Circle', + 'zrender/shape/Sector', + 'zrender/shape/Polyline', + '../config', + '../util/ecData', + 'zrender/tool/util', + 'zrender/tool/math', + 'zrender/tool/color', + '../chart' +], function (require) { + var ChartBase = require('./base'); + var TextShape = require('zrender/shape/Text'); + var RingShape = require('zrender/shape/Ring'); + var CircleShape = require('zrender/shape/Circle'); + var SectorShape = require('zrender/shape/Sector'); + var PolylineShape = require('zrender/shape/Polyline'); + var ecConfig = require('../config'); + ecConfig.pie = { + zlevel: 0, + z: 2, + clickable: true, + legendHoverLink: true, + center: [ + '50%', + '50%' + ], + radius: [ + 0, + '75%' + ], + clockWise: true, + startAngle: 90, + minAngle: 0, + selectedOffset: 10, + itemStyle: { + normal: { + borderColor: 'rgba(0,0,0,0)', + borderWidth: 1, + label: { + show: true, + position: 'outer' + }, + labelLine: { + show: true, + length: 20, + lineStyle: { + width: 1, + type: 'solid' + } + } + }, + emphasis: { + borderColor: 'rgba(0,0,0,0)', + borderWidth: 1, + label: { show: false }, + labelLine: { + show: false, + length: 20, + lineStyle: { + width: 1, + type: 'solid' + } + } + } + } + }; + var ecData = require('../util/ecData'); + var zrUtil = require('zrender/tool/util'); + var zrMath = require('zrender/tool/math'); + var zrColor = require('zrender/tool/color'); + function Pie(ecTheme, messageCenter, zr, option, myChart) { + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); + var self = this; + self.shapeHandler.onmouseover = function (param) { + var shape = param.target; + var seriesIndex = ecData.get(shape, 'seriesIndex'); + var dataIndex = ecData.get(shape, 'dataIndex'); + var percent = ecData.get(shape, 'special'); + var center = [ + shape.style.x, + shape.style.y + ]; + var startAngle = shape.style.startAngle; + var endAngle = shape.style.endAngle; + var midAngle = ((endAngle + startAngle) / 2 + 360) % 360; + var defaultColor = shape.highlightStyle.color; + var label = self.getLabel(seriesIndex, dataIndex, percent, center, midAngle, defaultColor, true); + if (label) { + self.zr.addHoverShape(label); + } + var labelLine = self.getLabelLine(seriesIndex, dataIndex, center, shape.style.r0, shape.style.r, midAngle, defaultColor, true); + if (labelLine) { + self.zr.addHoverShape(labelLine); + } + }; + this.refresh(option); + } + Pie.prototype = { + type: ecConfig.CHART_TYPE_PIE, + _buildShape: function () { + var series = this.series; + var legend = this.component.legend; + this.selectedMap = {}; + this._selected = {}; + var center; + var radius; + var pieCase; + this._selectedMode = false; + var serieName; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type === ecConfig.CHART_TYPE_PIE) { + series[i] = this.reformOption(series[i]); + this.legendHoverLink = series[i].legendHoverLink || this.legendHoverLink; + serieName = series[i].name || ''; + this.selectedMap[serieName] = legend ? legend.isSelected(serieName) : true; + if (!this.selectedMap[serieName]) { + continue; + } + center = this.parseCenter(this.zr, series[i].center); + radius = this.parseRadius(this.zr, series[i].radius); + this._selectedMode = this._selectedMode || series[i].selectedMode; + this._selected[i] = []; + if (this.deepQuery([ + series[i], + this.option + ], 'calculable')) { + pieCase = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: center[0], + y: center[1], + r0: radius[0] <= 10 ? 0 : radius[0] - 10, + r: radius[1] + 10, + brushType: 'stroke', + lineWidth: 1, + strokeColor: series[i].calculableHolderColor || this.ecTheme.calculableHolderColor || ecConfig.calculableHolderColor + } + }; + ecData.pack(pieCase, series[i], i, undefined, -1); + this.setCalculable(pieCase); + pieCase = radius[0] <= 10 ? new CircleShape(pieCase) : new RingShape(pieCase); + this.shapeList.push(pieCase); + } + this._buildSinglePie(i); + this.buildMark(i); + } + } + this.addShapeList(); + }, + _buildSinglePie: function (seriesIndex) { + var series = this.series; + var serie = series[seriesIndex]; + var data = serie.data; + var legend = this.component.legend; + var itemName; + var totalSelected = 0; + var totalSelectedValue0 = 0; + var totalValue = 0; + var maxValue = Number.NEGATIVE_INFINITY; + var singleShapeList = []; + for (var i = 0, l = data.length; i < l; i++) { + itemName = data[i].name; + this.selectedMap[itemName] = legend ? legend.isSelected(itemName) : true; + if (this.selectedMap[itemName] && !isNaN(data[i].value)) { + if (+data[i].value !== 0) { + totalSelected++; + } else { + totalSelectedValue0++; + } + totalValue += +data[i].value; + maxValue = Math.max(maxValue, +data[i].value); + } + } + if (totalValue === 0) { + return; + } + var percent = 100; + var clockWise = serie.clockWise; + var startAngle = (serie.startAngle.toFixed(2) - 0 + 360) % 360; + var endAngle; + var minAngle = serie.minAngle || 0.01; + var totalAngle = 360 - minAngle * totalSelected - 0.01 * totalSelectedValue0; + var defaultColor; + var roseType = serie.roseType; + var center; + var radius; + var r0; + var r1; + for (var i = 0, l = data.length; i < l; i++) { + itemName = data[i].name; + if (!this.selectedMap[itemName] || isNaN(data[i].value)) { + continue; + } + defaultColor = legend ? legend.getColor(itemName) : this.zr.getColor(i); + percent = data[i].value / totalValue; + if (roseType != 'area') { + endAngle = clockWise ? startAngle - percent * totalAngle - (percent !== 0 ? minAngle : 0.01) : percent * totalAngle + startAngle + (percent !== 0 ? minAngle : 0.01); + } else { + endAngle = clockWise ? startAngle - 360 / l : 360 / l + startAngle; + } + endAngle = endAngle.toFixed(2) - 0; + percent = (percent * 100).toFixed(2); + center = this.parseCenter(this.zr, serie.center); + radius = this.parseRadius(this.zr, serie.radius); + r0 = +radius[0]; + r1 = +radius[1]; + if (roseType === 'radius') { + r1 = data[i].value / maxValue * (r1 - r0) * 0.8 + (r1 - r0) * 0.2 + r0; + } else if (roseType === 'area') { + r1 = Math.sqrt(data[i].value / maxValue) * (r1 - r0) + r0; + } + if (clockWise) { + var temp; + temp = startAngle; + startAngle = endAngle; + endAngle = temp; + } + this._buildItem(singleShapeList, seriesIndex, i, percent, data[i].selected, center, r0, r1, startAngle, endAngle, defaultColor); + if (!clockWise) { + startAngle = endAngle; + } + } + this._autoLabelLayout(singleShapeList, center, r1); + for (var i = 0, l = singleShapeList.length; i < l; i++) { + this.shapeList.push(singleShapeList[i]); + } + singleShapeList = null; + }, + _buildItem: function (singleShapeList, seriesIndex, dataIndex, percent, isSelected, center, r0, r1, startAngle, endAngle, defaultColor) { + var series = this.series; + var midAngle = ((endAngle + startAngle) / 2 + 360) % 360; + var sector = this.getSector(seriesIndex, dataIndex, percent, isSelected, center, r0, r1, startAngle, endAngle, defaultColor); + ecData.pack(sector, series[seriesIndex], seriesIndex, series[seriesIndex].data[dataIndex], dataIndex, series[seriesIndex].data[dataIndex].name, percent); + singleShapeList.push(sector); + var label = this.getLabel(seriesIndex, dataIndex, percent, center, midAngle, defaultColor, false); + var labelLine = this.getLabelLine(seriesIndex, dataIndex, center, r0, r1, midAngle, defaultColor, false); + if (labelLine) { + ecData.pack(labelLine, series[seriesIndex], seriesIndex, series[seriesIndex].data[dataIndex], dataIndex, series[seriesIndex].data[dataIndex].name, percent); + singleShapeList.push(labelLine); + } + if (label) { + ecData.pack(label, series[seriesIndex], seriesIndex, series[seriesIndex].data[dataIndex], dataIndex, series[seriesIndex].data[dataIndex].name, percent); + label._labelLine = labelLine; + singleShapeList.push(label); + } + }, + getSector: function (seriesIndex, dataIndex, percent, isSelected, center, r0, r1, startAngle, endAngle, defaultColor) { + var series = this.series; + var serie = series[seriesIndex]; + var data = serie.data[dataIndex]; + var queryTarget = [ + data, + serie + ]; + var normal = this.deepMerge(queryTarget, 'itemStyle.normal') || {}; + var emphasis = this.deepMerge(queryTarget, 'itemStyle.emphasis') || {}; + var normalColor = this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) || defaultColor; + var emphasisColor = this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data) || (typeof normalColor === 'string' ? zrColor.lift(normalColor, -0.2) : normalColor); + var sector = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + clickable: this.deepQuery(queryTarget, 'clickable'), + style: { + x: center[0], + y: center[1], + r0: r0, + r: r1, + startAngle: startAngle, + endAngle: endAngle, + brushType: 'both', + color: normalColor, + lineWidth: normal.borderWidth, + strokeColor: normal.borderColor, + lineJoin: 'round' + }, + highlightStyle: { + color: emphasisColor, + lineWidth: emphasis.borderWidth, + strokeColor: emphasis.borderColor, + lineJoin: 'round' + }, + _seriesIndex: seriesIndex, + _dataIndex: dataIndex + }; + if (isSelected) { + var midAngle = ((sector.style.startAngle + sector.style.endAngle) / 2).toFixed(2) - 0; + sector.style._hasSelected = true; + sector.style._x = sector.style.x; + sector.style._y = sector.style.y; + var offset = this.query(serie, 'selectedOffset'); + sector.style.x += zrMath.cos(midAngle, true) * offset; + sector.style.y -= zrMath.sin(midAngle, true) * offset; + this._selected[seriesIndex][dataIndex] = true; + } else { + this._selected[seriesIndex][dataIndex] = false; + } + if (this._selectedMode) { + sector.onclick = this.shapeHandler.onclick; + } + if (this.deepQuery([ + data, + serie, + this.option + ], 'calculable')) { + this.setCalculable(sector); + sector.draggable = true; + } + if (this._needLabel(serie, data, true) || this._needLabelLine(serie, data, true)) { + sector.onmouseover = this.shapeHandler.onmouseover; + } + sector = new SectorShape(sector); + return sector; + }, + getLabel: function (seriesIndex, dataIndex, percent, center, midAngle, defaultColor, isEmphasis) { + var series = this.series; + var serie = series[seriesIndex]; + var data = serie.data[dataIndex]; + if (!this._needLabel(serie, data, isEmphasis)) { + return; + } + var status = isEmphasis ? 'emphasis' : 'normal'; + var itemStyle = zrUtil.merge(zrUtil.clone(data.itemStyle) || {}, serie.itemStyle); + var labelControl = itemStyle[status].label; + var textStyle = labelControl.textStyle || {}; + var centerX = center[0]; + var centerY = center[1]; + var x; + var y; + var radius = this.parseRadius(this.zr, serie.radius); + var textAlign; + var textBaseline = 'middle'; + labelControl.position = labelControl.position || itemStyle.normal.label.position; + if (labelControl.position === 'center') { + x = centerX; + y = centerY; + textAlign = 'center'; + } else if (labelControl.position === 'inner' || labelControl.position === 'inside') { + radius = (radius[0] + radius[1]) * (labelControl.distance || 0.5); + x = Math.round(centerX + radius * zrMath.cos(midAngle, true)); + y = Math.round(centerY - radius * zrMath.sin(midAngle, true)); + defaultColor = '#fff'; + textAlign = 'center'; + } else { + radius = radius[1] - -itemStyle[status].labelLine.length; + x = Math.round(centerX + radius * zrMath.cos(midAngle, true)); + y = Math.round(centerY - radius * zrMath.sin(midAngle, true)); + textAlign = midAngle >= 90 && midAngle <= 270 ? 'right' : 'left'; + } + if (labelControl.position != 'center' && labelControl.position != 'inner' && labelControl.position != 'inside') { + x += textAlign === 'left' ? 20 : -20; + } + data.__labelX = x - (textAlign === 'left' ? 5 : -5); + data.__labelY = y; + var ts = new TextShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + hoverable: false, + style: { + x: x, + y: y, + color: textStyle.color || defaultColor, + text: this.getLabelText(seriesIndex, dataIndex, percent, status), + textAlign: textStyle.align || textAlign, + textBaseline: textStyle.baseline || textBaseline, + textFont: this.getFont(textStyle) + }, + highlightStyle: { brushType: 'fill' } + }); + ts._radius = radius; + ts._labelPosition = labelControl.position || 'outer'; + ts._rect = ts.getRect(ts.style); + ts._seriesIndex = seriesIndex; + ts._dataIndex = dataIndex; + return ts; + }, + getLabelText: function (seriesIndex, dataIndex, percent, status) { + var series = this.series; + var serie = series[seriesIndex]; + var data = serie.data[dataIndex]; + var formatter = this.deepQuery([ + data, + serie + ], 'itemStyle.' + status + '.label.formatter'); + if (formatter) { + if (typeof formatter === 'function') { + return formatter.call(this.myChart, { + seriesIndex: seriesIndex, + seriesName: serie.name || '', + series: serie, + dataIndex: dataIndex, + data: data, + name: data.name, + value: data.value, + percent: percent + }); + } else if (typeof formatter === 'string') { + formatter = formatter.replace('{a}', '{a0}').replace('{b}', '{b0}').replace('{c}', '{c0}').replace('{d}', '{d0}'); + formatter = formatter.replace('{a0}', serie.name).replace('{b0}', data.name).replace('{c0}', data.value).replace('{d0}', percent); + return formatter; + } + } else { + return data.name; + } + }, + getLabelLine: function (seriesIndex, dataIndex, center, r0, r1, midAngle, defaultColor, isEmphasis) { + var series = this.series; + var serie = series[seriesIndex]; + var data = serie.data[dataIndex]; + if (this._needLabelLine(serie, data, isEmphasis)) { + var status = isEmphasis ? 'emphasis' : 'normal'; + var itemStyle = zrUtil.merge(zrUtil.clone(data.itemStyle) || {}, serie.itemStyle); + var labelLineControl = itemStyle[status].labelLine; + var lineStyle = labelLineControl.lineStyle || {}; + var centerX = center[0]; + var centerY = center[1]; + var minRadius = r1; + var maxRadius = this.parseRadius(this.zr, serie.radius)[1] - -labelLineControl.length; + var cosValue = zrMath.cos(midAngle, true); + var sinValue = zrMath.sin(midAngle, true); + return new PolylineShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + hoverable: false, + style: { + pointList: [ + [ + centerX + minRadius * cosValue, + centerY - minRadius * sinValue + ], + [ + centerX + maxRadius * cosValue, + centerY - maxRadius * sinValue + ], + [ + data.__labelX, + data.__labelY + ] + ], + strokeColor: lineStyle.color || defaultColor, + lineType: lineStyle.type, + lineWidth: lineStyle.width + }, + _seriesIndex: seriesIndex, + _dataIndex: dataIndex + }); + } else { + return; + } + }, + _needLabel: function (serie, data, isEmphasis) { + return this.deepQuery([ + data, + serie + ], 'itemStyle.' + (isEmphasis ? 'emphasis' : 'normal') + '.label.show'); + }, + _needLabelLine: function (serie, data, isEmphasis) { + return this.deepQuery([ + data, + serie + ], 'itemStyle.' + (isEmphasis ? 'emphasis' : 'normal') + '.labelLine.show'); + }, + _autoLabelLayout: function (sList, center, r) { + var leftList = []; + var rightList = []; + for (var i = 0, l = sList.length; i < l; i++) { + if (sList[i]._labelPosition === 'outer' || sList[i]._labelPosition === 'outside') { + sList[i]._rect._y = sList[i]._rect.y; + if (sList[i]._rect.x < center[0]) { + leftList.push(sList[i]); + } else { + rightList.push(sList[i]); + } + } + } + this._layoutCalculate(leftList, center, r, -1); + this._layoutCalculate(rightList, center, r, 1); + }, + _layoutCalculate: function (tList, center, r, direction) { + tList.sort(function (a, b) { + return a._rect.y - b._rect.y; + }); + function _changeDown(start, end, delta, direction) { + for (var j = start; j < end; j++) { + tList[j]._rect.y += delta; + tList[j].style.y += delta; + if (tList[j]._labelLine) { + tList[j]._labelLine.style.pointList[1][1] += delta; + tList[j]._labelLine.style.pointList[2][1] += delta; + } + if (j > start && j + 1 < end && tList[j + 1]._rect.y > tList[j]._rect.y + tList[j]._rect.height) { + _changeUp(j, delta / 2); + return; + } + } + _changeUp(end - 1, delta / 2); + } + function _changeUp(end, delta) { + for (var j = end; j >= 0; j--) { + tList[j]._rect.y -= delta; + tList[j].style.y -= delta; + if (tList[j]._labelLine) { + tList[j]._labelLine.style.pointList[1][1] -= delta; + tList[j]._labelLine.style.pointList[2][1] -= delta; + } + if (j > 0 && tList[j]._rect.y > tList[j - 1]._rect.y + tList[j - 1]._rect.height) { + break; + } + } + } + function _changeX(sList, isDownList, center, r, direction) { + var x = center[0]; + var y = center[1]; + var deltaX; + var deltaY; + var length; + var lastDeltaX = direction > 0 ? isDownList ? Number.MAX_VALUE : 0 : isDownList ? Number.MAX_VALUE : 0; + for (var i = 0, l = sList.length; i < l; i++) { + deltaY = Math.abs(sList[i]._rect.y - y); + length = sList[i]._radius - r; + deltaX = deltaY < r + length ? Math.sqrt((r + length + 20) * (r + length + 20) - Math.pow(sList[i]._rect.y - y, 2)) : Math.abs(sList[i]._rect.x + (direction > 0 ? 0 : sList[i]._rect.width) - x); + if (isDownList && deltaX >= lastDeltaX) { + deltaX = lastDeltaX - 10; + } + if (!isDownList && deltaX <= lastDeltaX) { + deltaX = lastDeltaX + 10; + } + sList[i]._rect.x = sList[i].style.x = x + deltaX * direction; + if (sList[i]._labelLine) { + sList[i]._labelLine.style.pointList[2][0] = x + (deltaX - 5) * direction; + sList[i]._labelLine.style.pointList[1][0] = x + (deltaX - 20) * direction; + } + lastDeltaX = deltaX; + } + } + var lastY = 0; + var delta; + var len = tList.length; + var upList = []; + var downList = []; + for (var i = 0; i < len; i++) { + delta = tList[i]._rect.y - lastY; + if (delta < 0) { + _changeDown(i, len, -delta, direction); + } + lastY = tList[i]._rect.y + tList[i]._rect.height; + } + if (this.zr.getHeight() - lastY < 0) { + _changeUp(len - 1, lastY - this.zr.getHeight()); + } + for (var i = 0; i < len; i++) { + if (tList[i]._rect.y >= center[1]) { + downList.push(tList[i]); + } else { + upList.push(tList[i]); + } + } + _changeX(downList, true, center, r, direction); + _changeX(upList, false, center, r, direction); + }, + reformOption: function (opt) { + var _merge = zrUtil.merge; + opt = _merge(_merge(opt || {}, zrUtil.clone(this.ecTheme.pie || {})), zrUtil.clone(ecConfig.pie)); + opt.itemStyle.normal.label.textStyle = this.getTextStyle(opt.itemStyle.normal.label.textStyle); + opt.itemStyle.emphasis.label.textStyle = this.getTextStyle(opt.itemStyle.emphasis.label.textStyle); + return opt; + }, + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + this.backupShapeList(); + this._buildShape(); + }, + addDataAnimation: function (params) { + var series = this.series; + var aniMap = {}; + for (var i = 0, l = params.length; i < l; i++) { + aniMap[params[i][0]] = params[i]; + } + var sectorMap = {}; + var textMap = {}; + var lineMap = {}; + var backupShapeList = this.shapeList; + this.shapeList = []; + var seriesIndex; + var isHead; + var dataGrow; + var deltaIdxMap = {}; + for (var i = 0, l = params.length; i < l; i++) { + seriesIndex = params[i][0]; + isHead = params[i][2]; + dataGrow = params[i][3]; + if (series[seriesIndex] && series[seriesIndex].type === ecConfig.CHART_TYPE_PIE) { + if (isHead) { + if (!dataGrow) { + sectorMap[seriesIndex + '_' + series[seriesIndex].data.length] = 'delete'; + } + deltaIdxMap[seriesIndex] = 1; + } else { + if (!dataGrow) { + sectorMap[seriesIndex + '_-1'] = 'delete'; + deltaIdxMap[seriesIndex] = -1; + } else { + deltaIdxMap[seriesIndex] = 0; + } + } + this._buildSinglePie(seriesIndex); + } + } + var dataIndex; + var key; + for (var i = 0, l = this.shapeList.length; i < l; i++) { + seriesIndex = this.shapeList[i]._seriesIndex; + dataIndex = this.shapeList[i]._dataIndex; + key = seriesIndex + '_' + dataIndex; + switch (this.shapeList[i].type) { + case 'sector': + sectorMap[key] = this.shapeList[i]; + break; + case 'text': + textMap[key] = this.shapeList[i]; + break; + case 'polyline': + lineMap[key] = this.shapeList[i]; + break; + } + } + this.shapeList = []; + var targeSector; + for (var i = 0, l = backupShapeList.length; i < l; i++) { + seriesIndex = backupShapeList[i]._seriesIndex; + if (aniMap[seriesIndex]) { + dataIndex = backupShapeList[i]._dataIndex + deltaIdxMap[seriesIndex]; + key = seriesIndex + '_' + dataIndex; + targeSector = sectorMap[key]; + if (!targeSector) { + continue; + } + if (backupShapeList[i].type === 'sector') { + if (targeSector != 'delete') { + this.zr.animate(backupShapeList[i].id, 'style').when(400, { + startAngle: targeSector.style.startAngle, + endAngle: targeSector.style.endAngle + }).start(); + } else { + this.zr.animate(backupShapeList[i].id, 'style').when(400, deltaIdxMap[seriesIndex] < 0 ? { startAngle: backupShapeList[i].style.startAngle } : { endAngle: backupShapeList[i].style.endAngle }).start(); + } + } else if (backupShapeList[i].type === 'text' || backupShapeList[i].type === 'polyline') { + if (targeSector === 'delete') { + this.zr.delShape(backupShapeList[i].id); + } else { + switch (backupShapeList[i].type) { + case 'text': + targeSector = textMap[key]; + this.zr.animate(backupShapeList[i].id, 'style').when(400, { + x: targeSector.style.x, + y: targeSector.style.y + }).start(); + break; + case 'polyline': + targeSector = lineMap[key]; + this.zr.animate(backupShapeList[i].id, 'style').when(400, { pointList: targeSector.style.pointList }).start(); + break; + } + } + } + } + } + this.shapeList = backupShapeList; + }, + onclick: function (param) { + var series = this.series; + if (!this.isClick || !param.target) { + return; + } + this.isClick = false; + var offset; + var target = param.target; + var style = target.style; + var seriesIndex = ecData.get(target, 'seriesIndex'); + var dataIndex = ecData.get(target, 'dataIndex'); + for (var i = 0, len = this.shapeList.length; i < len; i++) { + if (this.shapeList[i].id === target.id) { + seriesIndex = ecData.get(target, 'seriesIndex'); + dataIndex = ecData.get(target, 'dataIndex'); + if (!style._hasSelected) { + var midAngle = ((style.startAngle + style.endAngle) / 2).toFixed(2) - 0; + target.style._hasSelected = true; + this._selected[seriesIndex][dataIndex] = true; + target.style._x = target.style.x; + target.style._y = target.style.y; + offset = this.query(series[seriesIndex], 'selectedOffset'); + target.style.x += zrMath.cos(midAngle, true) * offset; + target.style.y -= zrMath.sin(midAngle, true) * offset; + } else { + target.style.x = target.style._x; + target.style.y = target.style._y; + target.style._hasSelected = false; + this._selected[seriesIndex][dataIndex] = false; + } + this.zr.modShape(target.id, target); + } else if (this.shapeList[i].style._hasSelected && this._selectedMode === 'single') { + seriesIndex = ecData.get(this.shapeList[i], 'seriesIndex'); + dataIndex = ecData.get(this.shapeList[i], 'dataIndex'); + this.shapeList[i].style.x = this.shapeList[i].style._x; + this.shapeList[i].style.y = this.shapeList[i].style._y; + this.shapeList[i].style._hasSelected = false; + this._selected[seriesIndex][dataIndex] = false; + this.zr.modShape(this.shapeList[i].id, this.shapeList[i]); + } + } + this.messageCenter.dispatch(ecConfig.EVENT.PIE_SELECTED, param.event, { + selected: this._selected, + target: ecData.get(target, 'name') + }, this.myChart); + this.zr.refreshNextFrame(); + } + }; + zrUtil.inherits(Pie, ChartBase); + require('../chart').define('pie', Pie); + return Pie; +});define('echarts/chart/radar', [ + 'require', + './base', + 'zrender/shape/Polygon', + '../component/polar', + '../config', + '../util/ecData', + 'zrender/tool/util', + 'zrender/tool/color', + '../util/accMath', + '../chart' +], function (require) { + var ChartBase = require('./base'); + var PolygonShape = require('zrender/shape/Polygon'); + require('../component/polar'); + var ecConfig = require('../config'); + ecConfig.radar = { + zlevel: 0, + z: 2, + clickable: true, + legendHoverLink: true, + polarIndex: 0, + itemStyle: { + normal: { + label: { show: false }, + lineStyle: { + width: 2, + type: 'solid' + } + }, + emphasis: { label: { show: false } } + }, + symbolSize: 2 + }; + var ecData = require('../util/ecData'); + var zrUtil = require('zrender/tool/util'); + var zrColor = require('zrender/tool/color'); + function Radar(ecTheme, messageCenter, zr, option, myChart) { + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); + this.refresh(option); + } + Radar.prototype = { + type: ecConfig.CHART_TYPE_RADAR, + _buildShape: function () { + this.selectedMap = {}; + this._symbol = this.option.symbolList; + this._queryTarget; + this._dropBoxList = []; + this._radarDataCounter = 0; + var series = this.series; + var legend = this.component.legend; + var serieName; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type === ecConfig.CHART_TYPE_RADAR) { + this.serie = this.reformOption(series[i]); + this.legendHoverLink = series[i].legendHoverLink || this.legendHoverLink; + serieName = this.serie.name || ''; + this.selectedMap[serieName] = legend ? legend.isSelected(serieName) : true; + if (this.selectedMap[serieName]) { + this._queryTarget = [ + this.serie, + this.option + ]; + if (this.deepQuery(this._queryTarget, 'calculable')) { + this._addDropBox(i); + } + this._buildSingleRadar(i); + this.buildMark(i); + } + } + } + this.addShapeList(); + }, + _buildSingleRadar: function (index) { + var legend = this.component.legend; + var iconShape; + var data = this.serie.data; + var defaultColor; + var name; + var pointList; + var calculable = this.deepQuery(this._queryTarget, 'calculable'); + for (var i = 0; i < data.length; i++) { + name = data[i].name || ''; + this.selectedMap[name] = legend ? legend.isSelected(name) : true; + if (!this.selectedMap[name]) { + continue; + } + if (legend) { + defaultColor = legend.getColor(name); + iconShape = legend.getItemShape(name); + if (iconShape) { + iconShape.style.brushType = this.deepQuery([ + data[i], + this.serie + ], 'itemStyle.normal.areaStyle') ? 'both' : 'stroke'; + legend.setItemShape(name, iconShape); + } + } else { + defaultColor = this.zr.getColor(i); + } + pointList = this._getPointList(this.serie.polarIndex, data[i]); + this._addSymbol(pointList, defaultColor, i, index, this.serie.polarIndex); + this._addDataShape(pointList, defaultColor, data[i], index, i, calculable); + this._radarDataCounter++; + } + }, + _getPointList: function (polarIndex, dataArr) { + var pointList = []; + var vector; + var polar = this.component.polar; + var value; + for (var i = 0, l = dataArr.value.length; i < l; i++) { + value = this.getDataFromOption(dataArr.value[i]); + vector = value != '-' ? polar.getVector(polarIndex, i, value) : false; + if (vector) { + pointList.push(vector); + } + } + return pointList; + }, + _addSymbol: function (pointList, defaultColor, dataIndex, seriesIndex, polarIndex) { + var series = this.series; + var itemShape; + var polar = this.component.polar; + for (var i = 0, l = pointList.length; i < l; i++) { + itemShape = this.getSymbolShape(this.deepMerge([ + series[seriesIndex].data[dataIndex], + series[seriesIndex] + ]), seriesIndex, series[seriesIndex].data[dataIndex].value[i], i, polar.getIndicatorText(polarIndex, i), pointList[i][0], pointList[i][1], this._symbol[this._radarDataCounter % this._symbol.length], defaultColor, '#fff', 'vertical'); + itemShape.zlevel = this.getZlevelBase(); + itemShape.z = this.getZBase() + 1; + ecData.set(itemShape, 'data', series[seriesIndex].data[dataIndex]); + ecData.set(itemShape, 'value', series[seriesIndex].data[dataIndex].value); + ecData.set(itemShape, 'dataIndex', dataIndex); + ecData.set(itemShape, 'special', i); + this.shapeList.push(itemShape); + } + }, + _addDataShape: function (pointList, defaultColor, data, seriesIndex, dataIndex, calculable) { + var series = this.series; + var queryTarget = [ + data, + this.serie + ]; + var nColor = this.getItemStyleColor(this.deepQuery(queryTarget, 'itemStyle.normal.color'), seriesIndex, dataIndex, data); + var nLineWidth = this.deepQuery(queryTarget, 'itemStyle.normal.lineStyle.width'); + var nLineType = this.deepQuery(queryTarget, 'itemStyle.normal.lineStyle.type'); + var nAreaColor = this.deepQuery(queryTarget, 'itemStyle.normal.areaStyle.color'); + var nIsAreaFill = this.deepQuery(queryTarget, 'itemStyle.normal.areaStyle'); + var shape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + pointList: pointList, + brushType: nIsAreaFill ? 'both' : 'stroke', + color: nAreaColor || nColor || (typeof defaultColor === 'string' ? zrColor.alpha(defaultColor, 0.5) : defaultColor), + strokeColor: nColor || defaultColor, + lineWidth: nLineWidth, + lineType: nLineType + }, + highlightStyle: { + brushType: this.deepQuery(queryTarget, 'itemStyle.emphasis.areaStyle') || nIsAreaFill ? 'both' : 'stroke', + color: this.deepQuery(queryTarget, 'itemStyle.emphasis.areaStyle.color') || nAreaColor || nColor || (typeof defaultColor === 'string' ? zrColor.alpha(defaultColor, 0.5) : defaultColor), + strokeColor: this.getItemStyleColor(this.deepQuery(queryTarget, 'itemStyle.emphasis.color'), seriesIndex, dataIndex, data) || nColor || defaultColor, + lineWidth: this.deepQuery(queryTarget, 'itemStyle.emphasis.lineStyle.width') || nLineWidth, + lineType: this.deepQuery(queryTarget, 'itemStyle.emphasis.lineStyle.type') || nLineType + } + }; + ecData.pack(shape, series[seriesIndex], seriesIndex, data, dataIndex, data.name, this.component.polar.getIndicator(series[seriesIndex].polarIndex)); + if (calculable) { + shape.draggable = true; + this.setCalculable(shape); + } + shape = new PolygonShape(shape); + this.shapeList.push(shape); + }, + _addDropBox: function (index) { + var series = this.series; + var polarIndex = this.deepQuery(this._queryTarget, 'polarIndex'); + if (!this._dropBoxList[polarIndex]) { + var shape = this.component.polar.getDropBox(polarIndex); + shape.zlevel = this.getZlevelBase(); + shape.z = this.getZBase(); + this.setCalculable(shape); + ecData.pack(shape, series, index, undefined, -1); + this.shapeList.push(shape); + this._dropBoxList[polarIndex] = true; + } + }, + ondragend: function (param, status) { + var series = this.series; + if (!this.isDragend || !param.target) { + return; + } + var target = param.target; + var seriesIndex = ecData.get(target, 'seriesIndex'); + var dataIndex = ecData.get(target, 'dataIndex'); + this.component.legend && this.component.legend.del(series[seriesIndex].data[dataIndex].name); + series[seriesIndex].data.splice(dataIndex, 1); + status.dragOut = true; + status.needRefresh = true; + this.isDragend = false; + return; + }, + ondrop: function (param, status) { + var series = this.series; + if (!this.isDrop || !param.target) { + return; + } + var target = param.target; + var dragged = param.dragged; + var seriesIndex = ecData.get(target, 'seriesIndex'); + var dataIndex = ecData.get(target, 'dataIndex'); + var data; + var legend = this.component.legend; + var value; + if (dataIndex === -1) { + data = { + value: ecData.get(dragged, 'value'), + name: ecData.get(dragged, 'name') + }; + series[seriesIndex].data.push(data); + legend && legend.add(data.name, dragged.style.color || dragged.style.strokeColor); + } else { + var accMath = require('../util/accMath'); + data = series[seriesIndex].data[dataIndex]; + legend && legend.del(data.name); + data.name += this.option.nameConnector + ecData.get(dragged, 'name'); + value = ecData.get(dragged, 'value'); + for (var i = 0; i < value.length; i++) { + data.value[i] = accMath.accAdd(data.value[i], value[i]); + } + legend && legend.add(data.name, dragged.style.color || dragged.style.strokeColor); + } + status.dragIn = status.dragIn || true; + this.isDrop = false; + return; + }, + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + this.backupShapeList(); + this._buildShape(); + } + }; + zrUtil.inherits(Radar, ChartBase); + require('../chart').define('radar', Radar); + return Radar; +});define('echarts/component/polar', [ + 'require', + './base', + 'zrender/shape/Text', + 'zrender/shape/Line', + 'zrender/shape/Polygon', + 'zrender/shape/Circle', + 'zrender/shape/Ring', + '../config', + 'zrender/tool/util', + '../util/coordinates', + '../util/accMath', + '../util/smartSteps', + '../component' +], function (require) { + var Base = require('./base'); + var TextShape = require('zrender/shape/Text'); + var LineShape = require('zrender/shape/Line'); + var PolygonShape = require('zrender/shape/Polygon'); + var Circle = require('zrender/shape/Circle'); + var Ring = require('zrender/shape/Ring'); + var ecConfig = require('../config'); + ecConfig.polar = { + zlevel: 0, + z: 0, + center: [ + '50%', + '50%' + ], + radius: '75%', + startAngle: 90, + boundaryGap: [ + 0, + 0 + ], + splitNumber: 5, + name: { + show: true, + textStyle: { color: '#333' } + }, + axisLine: { + show: true, + lineStyle: { + color: '#ccc', + width: 1, + type: 'solid' + } + }, + axisLabel: { + show: false, + textStyle: { color: '#333' } + }, + splitArea: { + show: true, + areaStyle: { + color: [ + 'rgba(250,250,250,0.3)', + 'rgba(200,200,200,0.3)' + ] + } + }, + splitLine: { + show: true, + lineStyle: { + width: 1, + color: '#ccc' + } + }, + type: 'polygon' + }; + var zrUtil = require('zrender/tool/util'); + var ecCoordinates = require('../util/coordinates'); + function Polar(ecTheme, messageCenter, zr, option, myChart) { + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + this.refresh(option); + } + Polar.prototype = { + type: ecConfig.COMPONENT_TYPE_POLAR, + _buildShape: function () { + for (var i = 0; i < this.polar.length; i++) { + this._index = i; + this.reformOption(this.polar[i]); + this._queryTarget = [ + this.polar[i], + this.option + ]; + this._createVector(i); + this._buildSpiderWeb(i); + this._buildText(i); + this._adjustIndicatorValue(i); + this._addAxisLabel(i); + } + for (var i = 0; i < this.shapeList.length; i++) { + this.zr.addShape(this.shapeList[i]); + } + }, + _createVector: function (index) { + var item = this.polar[index]; + var indicator = this.deepQuery(this._queryTarget, 'indicator'); + var length = indicator.length; + var startAngle = item.startAngle; + var dStep = 2 * Math.PI / length; + var radius = this._getRadius(); + var __ecIndicator = item.__ecIndicator = []; + var vector; + for (var i = 0; i < length; i++) { + vector = ecCoordinates.polar2cartesian(radius, startAngle * Math.PI / 180 + dStep * i); + __ecIndicator.push({ + vector: [ + vector[1], + -vector[0] + ] + }); + } + }, + _getRadius: function () { + var item = this.polar[this._index]; + return this.parsePercent(item.radius, Math.min(this.zr.getWidth(), this.zr.getHeight()) / 2); + }, + _buildSpiderWeb: function (index) { + var item = this.polar[index]; + var __ecIndicator = item.__ecIndicator; + var splitArea = item.splitArea; + var splitLine = item.splitLine; + var center = this.getCenter(index); + var splitNumber = item.splitNumber; + var strokeColor = splitLine.lineStyle.color; + var lineWidth = splitLine.lineStyle.width; + var show = splitLine.show; + var axisLine = this.deepQuery(this._queryTarget, 'axisLine'); + this._addArea(__ecIndicator, splitNumber, center, splitArea, strokeColor, lineWidth, show); + axisLine.show && this._addLine(__ecIndicator, center, axisLine); + }, + _addAxisLabel: function (index) { + var accMath = require('../util/accMath'); + var item = this.polar[index]; + var indicator = this.deepQuery(this._queryTarget, 'indicator'); + var __ecIndicator = item.__ecIndicator; + var axisLabel; + var vector; + var style; + var newStyle; + var splitNumber = this.deepQuery(this._queryTarget, 'splitNumber'); + var center = this.getCenter(index); + var vector; + var value; + var text; + var theta; + var offset; + var interval; + for (var i = 0; i < indicator.length; i++) { + axisLabel = this.deepQuery([ + indicator[i], + item, + this.option + ], 'axisLabel'); + if (axisLabel.show) { + var textStyle = this.deepQuery([ + axisLabel, + item, + this.option + ], 'textStyle'); + style = {}; + style.textFont = this.getFont(textStyle); + style.color = textStyle.color; + style = zrUtil.merge(style, axisLabel); + style.lineWidth = style.width; + vector = __ecIndicator[i].vector; + value = __ecIndicator[i].value; + theta = i / indicator.length * 2 * Math.PI; + offset = axisLabel.offset || 10; + interval = axisLabel.interval || 0; + if (!value) { + return; + } + for (var j = 1; j <= splitNumber; j += interval + 1) { + newStyle = zrUtil.merge({}, style); + text = accMath.accAdd(value.min, accMath.accMul(value.step, j)); + newStyle.text = this.numAddCommas(text); + newStyle.x = j * vector[0] / splitNumber + Math.cos(theta) * offset + center[0]; + newStyle.y = j * vector[1] / splitNumber + Math.sin(theta) * offset + center[1]; + this.shapeList.push(new TextShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: newStyle, + draggable: false, + hoverable: false + })); + } + } + } + }, + _buildText: function (index) { + var item = this.polar[index]; + var __ecIndicator = item.__ecIndicator; + var vector; + var indicator = this.deepQuery(this._queryTarget, 'indicator'); + var center = this.getCenter(index); + var style; + var textAlign; + var name; + var rotation; + var x = 0; + var y = 0; + var margin; + var textStyle; + for (var i = 0; i < indicator.length; i++) { + name = this.deepQuery([ + indicator[i], + item, + this.option + ], 'name'); + if (!name.show) { + continue; + } + textStyle = this.deepQuery([ + name, + item, + this.option + ], 'textStyle'); + style = {}; + style.textFont = this.getFont(textStyle); + style.color = textStyle.color; + if (typeof name.formatter == 'function') { + style.text = name.formatter.call(this.myChart, indicator[i].text, i); + } else if (typeof name.formatter == 'string') { + style.text = name.formatter.replace('{value}', indicator[i].text); + } else { + style.text = indicator[i].text; + } + __ecIndicator[i].text = style.text; + vector = __ecIndicator[i].vector; + if (Math.round(vector[0]) > 0) { + textAlign = 'left'; + } else if (Math.round(vector[0]) < 0) { + textAlign = 'right'; + } else { + textAlign = 'center'; + } + if (name.margin == null) { + vector = this._mapVector(vector, center, 1.1); + } else { + margin = name.margin; + x = vector[0] > 0 ? margin : -margin; + y = vector[1] > 0 ? margin : -margin; + x = vector[0] === 0 ? 0 : x; + y = vector[1] === 0 ? 0 : y; + vector = this._mapVector(vector, center, 1); + } + style.textAlign = textAlign; + style.x = vector[0] + x; + style.y = vector[1] + y; + if (name.rotate) { + rotation = [ + name.rotate / 180 * Math.PI, + vector[0], + vector[1] + ]; + } else { + rotation = [ + 0, + 0, + 0 + ]; + } + this.shapeList.push(new TextShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: style, + draggable: false, + hoverable: false, + rotation: rotation + })); + } + }, + getIndicatorText: function (polarIndex, indicatorIndex) { + return this.polar[polarIndex] && this.polar[polarIndex].__ecIndicator[indicatorIndex] && this.polar[polarIndex].__ecIndicator[indicatorIndex].text; + }, + getDropBox: function (index) { + var index = index || 0; + var item = this.polar[index]; + var center = this.getCenter(index); + var __ecIndicator = item.__ecIndicator; + var len = __ecIndicator.length; + var pointList = []; + var vector; + var shape; + var type = item.type; + if (type == 'polygon') { + for (var i = 0; i < len; i++) { + vector = __ecIndicator[i].vector; + pointList.push(this._mapVector(vector, center, 1.2)); + } + shape = this._getShape(pointList, 'fill', 'rgba(0,0,0,0)', '', 1); + } else if (type == 'circle') { + shape = this._getCircle('', 1, 1.2, center, 'fill', 'rgba(0,0,0,0)'); + } + return shape; + }, + _addArea: function (__ecIndicator, splitNumber, center, splitArea, strokeColor, lineWidth, show) { + var shape; + var scale; + var scale1; + var pointList; + var type = this.deepQuery(this._queryTarget, 'type'); + for (var i = 0; i < splitNumber; i++) { + scale = (splitNumber - i) / splitNumber; + if (show) { + if (type == 'polygon') { + pointList = this._getPointList(__ecIndicator, scale, center); + shape = this._getShape(pointList, 'stroke', '', strokeColor, lineWidth); + } else if (type == 'circle') { + shape = this._getCircle(strokeColor, lineWidth, scale, center, 'stroke'); + } + this.shapeList.push(shape); + } + if (splitArea.show) { + scale1 = (splitNumber - i - 1) / splitNumber; + this._addSplitArea(__ecIndicator, splitArea, scale, scale1, center, i); + } + } + }, + _getCircle: function (strokeColor, lineWidth, scale, center, brushType, color) { + var radius = this._getRadius(); + return new Circle({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: center[0], + y: center[1], + r: radius * scale, + brushType: brushType, + strokeColor: strokeColor, + lineWidth: lineWidth, + color: color + }, + hoverable: false, + draggable: false + }); + }, + _getRing: function (color, scale0, scale1, center) { + var radius = this._getRadius(); + return new Ring({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: center[0], + y: center[1], + r: scale0 * radius, + r0: scale1 * radius, + color: color, + brushType: 'fill' + }, + hoverable: false, + draggable: false + }); + }, + _getPointList: function (__ecIndicator, scale, center) { + var pointList = []; + var len = __ecIndicator.length; + var vector; + for (var i = 0; i < len; i++) { + vector = __ecIndicator[i].vector; + pointList.push(this._mapVector(vector, center, scale)); + } + return pointList; + }, + _getShape: function (pointList, brushType, color, strokeColor, lineWidth) { + return new PolygonShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + pointList: pointList, + brushType: brushType, + color: color, + strokeColor: strokeColor, + lineWidth: lineWidth + }, + hoverable: false, + draggable: false + }); + }, + _addSplitArea: function (__ecIndicator, splitArea, scale, scale1, center, colorInd) { + var indLen = __ecIndicator.length; + var color; + var colorArr = splitArea.areaStyle.color; + var colorLen; + var vector; + var vector1; + var pointList = []; + var indLen = __ecIndicator.length; + var shape; + var type = this.deepQuery(this._queryTarget, 'type'); + if (typeof colorArr == 'string') { + colorArr = [colorArr]; + } + colorLen = colorArr.length; + color = colorArr[colorInd % colorLen]; + if (type == 'polygon') { + for (var i = 0; i < indLen; i++) { + pointList = []; + vector = __ecIndicator[i].vector; + vector1 = __ecIndicator[(i + 1) % indLen].vector; + pointList.push(this._mapVector(vector, center, scale)); + pointList.push(this._mapVector(vector, center, scale1)); + pointList.push(this._mapVector(vector1, center, scale1)); + pointList.push(this._mapVector(vector1, center, scale)); + shape = this._getShape(pointList, 'fill', color, '', 1); + this.shapeList.push(shape); + } + } else if (type == 'circle') { + shape = this._getRing(color, scale, scale1, center); + this.shapeList.push(shape); + } + }, + _mapVector: function (vector, center, scale) { + return [ + vector[0] * scale + center[0], + vector[1] * scale + center[1] + ]; + }, + getCenter: function (index) { + var index = index || 0; + return this.parseCenter(this.zr, this.polar[index].center); + }, + _addLine: function (__ecIndicator, center, axisLine) { + var indLen = __ecIndicator.length; + var line; + var vector; + var lineStyle = axisLine.lineStyle; + var strokeColor = lineStyle.color; + var lineWidth = lineStyle.width; + var lineType = lineStyle.type; + for (var i = 0; i < indLen; i++) { + vector = __ecIndicator[i].vector; + line = this._getLine(center[0], center[1], vector[0] + center[0], vector[1] + center[1], strokeColor, lineWidth, lineType); + this.shapeList.push(line); + } + }, + _getLine: function (xStart, yStart, xEnd, yEnd, strokeColor, lineWidth, lineType) { + return new LineShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + xStart: xStart, + yStart: yStart, + xEnd: xEnd, + yEnd: yEnd, + strokeColor: strokeColor, + lineWidth: lineWidth, + lineType: lineType + }, + hoverable: false + }); + }, + _adjustIndicatorValue: function (index) { + var item = this.polar[index]; + var indicator = this.deepQuery(this._queryTarget, 'indicator'); + var len = indicator.length; + var __ecIndicator = item.__ecIndicator; + var max; + var min; + var data = this._getSeriesData(index); + var boundaryGap = item.boundaryGap; + var splitNumber = item.splitNumber; + var scale = item.scale; + var smartSteps = require('../util/smartSteps'); + for (var i = 0; i < len; i++) { + if (typeof indicator[i].max == 'number') { + max = indicator[i].max; + min = indicator[i].min || 0; + } else { + var value = this._findValue(data, i, splitNumber, boundaryGap); + min = value.min; + max = value.max; + } + if (!scale && min >= 0 && max >= 0) { + min = 0; + } + if (!scale && min <= 0 && max <= 0) { + max = 0; + } + var stepOpt = smartSteps(min, max, splitNumber); + __ecIndicator[i].value = { + min: stepOpt.min, + max: stepOpt.max, + step: stepOpt.step + }; + } + }, + _getSeriesData: function (index) { + var data = []; + var serie; + var serieData; + var legend = this.component.legend; + var polarIndex; + for (var i = 0; i < this.series.length; i++) { + serie = this.series[i]; + if (serie.type != ecConfig.CHART_TYPE_RADAR) { + continue; + } + serieData = serie.data || []; + for (var j = 0; j < serieData.length; j++) { + polarIndex = this.deepQuery([ + serieData[j], + serie, + this.option + ], 'polarIndex') || 0; + if (polarIndex == index && (!legend || legend.isSelected(serieData[j].name))) { + data.push(serieData[j]); + } + } + } + return data; + }, + _findValue: function (data, index, splitNumber, boundaryGap) { + var max; + var min; + var one; + if (!data || data.length === 0) { + return; + } + function _compare(item) { + (item > max || max === undefined) && (max = item); + (item < min || min === undefined) && (min = item); + } + if (data.length == 1) { + min = 0; + } + if (data.length != 1) { + for (var i = 0; i < data.length; i++) { + _compare(this.getDataFromOption(data[i].value[index])); + } + } else { + one = data[0]; + for (var i = 0; i < one.value.length; i++) { + _compare(this.getDataFromOption(one.value[i])); + } + } + var gap = Math.abs(max - min); + min = min - Math.abs(gap * boundaryGap[0]); + max = max + Math.abs(gap * boundaryGap[1]); + if (min === max) { + if (max === 0) { + max = 1; + } else if (max > 0) { + min = max / splitNumber; + } else { + max = max / splitNumber; + } + } + return { + max: max, + min: min + }; + }, + getVector: function (polarIndex, indicatorIndex, value) { + polarIndex = polarIndex || 0; + indicatorIndex = indicatorIndex || 0; + var __ecIndicator = this.polar[polarIndex].__ecIndicator; + if (indicatorIndex >= __ecIndicator.length) { + return; + } + var indicator = this.polar[polarIndex].__ecIndicator[indicatorIndex]; + var center = this.getCenter(polarIndex); + var vector = indicator.vector; + var max = indicator.value.max; + var min = indicator.value.min; + var alpha; + if (typeof value == 'undefined') { + return center; + } + switch (value) { + case 'min': + value = min; + break; + case 'max': + value = max; + break; + case 'center': + value = (max + min) / 2; + break; + } + if (max != min) { + alpha = (value - min) / (max - min); + } else { + alpha = 0.5; + } + return this._mapVector(vector, center, alpha); + }, + isInside: function (vector) { + var polar = this.getNearestIndex(vector); + if (polar) { + return polar.polarIndex; + } + return -1; + }, + getNearestIndex: function (vector) { + var item; + var center; + var radius; + var polarVector; + var startAngle; + var indicator; + var len; + var angle; + var finalAngle; + for (var i = 0; i < this.polar.length; i++) { + item = this.polar[i]; + center = this.getCenter(i); + if (vector[0] == center[0] && vector[1] == center[1]) { + return { + polarIndex: i, + valueIndex: 0 + }; + } + radius = this._getRadius(); + startAngle = item.startAngle; + indicator = item.indicator; + len = indicator.length; + angle = 2 * Math.PI / len; + polarVector = ecCoordinates.cartesian2polar(vector[0] - center[0], center[1] - vector[1]); + if (vector[0] - center[0] < 0) { + polarVector[1] += Math.PI; + } + if (polarVector[1] < 0) { + polarVector[1] += 2 * Math.PI; + } + finalAngle = polarVector[1] - startAngle / 180 * Math.PI + Math.PI * 2; + if (Math.abs(Math.cos(finalAngle % (angle / 2))) * radius > polarVector[0]) { + return { + polarIndex: i, + valueIndex: Math.floor((finalAngle + angle / 2) / angle) % len + }; + } + } + }, + getIndicator: function (index) { + var index = index || 0; + return this.polar[index].indicator; + }, + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.polar = this.option.polar; + this.series = this.option.series; + } + this.clear(); + this._buildShape(); + } + }; + zrUtil.inherits(Polar, Base); + require('../component').define('polar', Polar); + return Polar; +});define('echarts/util/coordinates', [ + 'require', + 'zrender/tool/math' +], function (require) { + var zrMath = require('zrender/tool/math'); + function polar2cartesian(r, theta) { + return [ + r * zrMath.sin(theta), + r * zrMath.cos(theta) + ]; + } + function cartesian2polar(x, y) { + return [ + Math.sqrt(x * x + y * y), + Math.atan(y / x) + ]; + } + return { + polar2cartesian: polar2cartesian, + cartesian2polar: cartesian2polar + }; +});define('echarts/chart/chord', [ + 'require', + './base', + 'zrender/shape/Text', + 'zrender/shape/Line', + 'zrender/shape/Sector', + '../util/shape/Ribbon', + '../util/shape/Icon', + 'zrender/shape/BezierCurve', + '../config', + '../util/ecData', + 'zrender/tool/util', + 'zrender/tool/vector', + '../data/Graph', + '../layout/Chord', + '../chart' +], function (require) { + 'use strict'; + var ChartBase = require('./base'); + var TextShape = require('zrender/shape/Text'); + var LineShape = require('zrender/shape/Line'); + var SectorShape = require('zrender/shape/Sector'); + var RibbonShape = require('../util/shape/Ribbon'); + var IconShape = require('../util/shape/Icon'); + var BezierCurveShape = require('zrender/shape/BezierCurve'); + var ecConfig = require('../config'); + ecConfig.chord = { + zlevel: 0, + z: 2, + clickable: true, + radius: [ + '65%', + '75%' + ], + center: [ + '50%', + '50%' + ], + padding: 2, + sort: 'none', + sortSub: 'none', + startAngle: 90, + clockWise: true, + ribbonType: true, + minRadius: 10, + maxRadius: 20, + symbol: 'circle', + showScale: false, + showScaleText: false, + itemStyle: { + normal: { + borderWidth: 0, + borderColor: '#000', + label: { + show: true, + rotate: false, + distance: 5 + }, + chordStyle: { + width: 1, + color: 'black', + borderWidth: 1, + borderColor: '#999', + opacity: 0.5 + } + }, + emphasis: { + borderWidth: 0, + borderColor: '#000', + chordStyle: { + width: 1, + color: 'black', + borderWidth: 1, + borderColor: '#999' + } + } + } + }; + var ecData = require('../util/ecData'); + var zrUtil = require('zrender/tool/util'); + var vec2 = require('zrender/tool/vector'); + var Graph = require('../data/Graph'); + var ChordLayout = require('../layout/Chord'); + function Chord(ecTheme, messageCenter, zr, option, myChart) { + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); + this.scaleLineLength = 4; + this.scaleUnitAngle = 4; + this.refresh(option); + } + Chord.prototype = { + type: ecConfig.CHART_TYPE_CHORD, + _init: function () { + var series = this.series; + this.selectedMap = {}; + var chordSeriesMap = {}; + var chordSeriesGroups = {}; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type === this.type) { + var _isSelected = this.isSelected(series[i].name); + this.selectedMap[series[i].name] = _isSelected; + if (_isSelected) { + this.buildMark(i); + } + this.reformOption(series[i]); + chordSeriesMap[series[i].name] = series[i]; + } + } + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type === this.type) { + if (series[i].insertToSerie) { + var referenceSerie = chordSeriesMap[series[i].insertToSerie]; + series[i]._referenceSerie = referenceSerie; + } else { + chordSeriesGroups[series[i].name] = [series[i]]; + } + } + } + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type === this.type) { + if (series[i].insertToSerie) { + var mainSerie = series[i]._referenceSerie; + while (mainSerie && mainSerie._referenceSerie) { + mainSerie = mainSerie._referenceSerie; + } + if (chordSeriesGroups[mainSerie.name] && this.selectedMap[series[i].name]) { + chordSeriesGroups[mainSerie.name].push(series[i]); + } + } + } + } + for (var name in chordSeriesGroups) { + this._buildChords(chordSeriesGroups[name]); + } + this.addShapeList(); + }, + _getNodeCategory: function (serie, group) { + return serie.categories && serie.categories[group.category || 0]; + }, + _getNodeQueryTarget: function (serie, group) { + var category = this._getNodeCategory(serie, group); + return [ + group, + category, + serie + ]; + }, + _getEdgeQueryTarget: function (serie, edge, type) { + type = type || 'normal'; + return [ + edge.itemStyle && edge.itemStyle[type], + serie.itemStyle[type].chordStyle + ]; + }, + _buildChords: function (series) { + var graphs = []; + var mainSerie = series[0]; + var nodeFilter = function (n) { + return n.layout.size > 0; + }; + var createEdgeFilter = function (graph) { + return function (e) { + return graph.getEdge(e.node2, e.node1); + }; + }; + for (var i = 0; i < series.length; i++) { + var serie = series[i]; + if (this.selectedMap[serie.name]) { + var graph; + if (serie.data && serie.matrix) { + graph = this._getSerieGraphFromDataMatrix(serie, mainSerie); + } else if (serie.nodes && serie.links) { + graph = this._getSerieGraphFromNodeLinks(serie, mainSerie); + } + graph.filterNode(nodeFilter, this); + if (serie.ribbonType) { + graph.filterEdge(createEdgeFilter(graph)); + } + graphs.push(graph); + graph.__serie = serie; + } + } + if (!graphs.length) { + return; + } + var mainGraph = graphs[0]; + if (!mainSerie.ribbonType) { + var minRadius = mainSerie.minRadius; + var maxRadius = mainSerie.maxRadius; + var min = Infinity, max = -Infinity; + mainGraph.eachNode(function (node) { + max = Math.max(node.layout.size, max); + min = Math.min(node.layout.size, min); + }); + var multiplier = (maxRadius - minRadius) / (max - min); + mainGraph.eachNode(function (node) { + var queryTarget = this._getNodeQueryTarget(mainSerie, node); + var symbolSize = this.query(queryTarget, 'symbolSize'); + if (max === min) { + node.layout.size = symbolSize || min; + } else { + node.layout.size = symbolSize || (node.layout.size - min) * multiplier + minRadius; + } + }, this); + } + var layout = new ChordLayout(); + layout.clockWise = mainSerie.clockWise; + layout.startAngle = mainSerie.startAngle * Math.PI / 180; + if (!layout.clockWise) { + layout.startAngle = -layout.startAngle; + } + layout.padding = mainSerie.padding * Math.PI / 180; + layout.sort = mainSerie.sort; + layout.sortSub = mainSerie.sortSub; + layout.directed = mainSerie.ribbonType; + layout.run(graphs); + var showLabel = this.query(mainSerie, 'itemStyle.normal.label.show'); + if (mainSerie.ribbonType) { + this._buildSectors(mainSerie, 0, mainGraph, mainSerie, graphs); + if (showLabel) { + this._buildLabels(mainSerie, 0, mainGraph, mainSerie, graphs); + } + for (var i = 0, j = 0; i < series.length; i++) { + if (this.selectedMap[series[i].name]) { + this._buildRibbons(series, i, graphs[j++], mainSerie); + } + } + if (mainSerie.showScale) { + this._buildScales(mainSerie, 0, mainGraph); + } + } else { + this._buildNodeIcons(mainSerie, 0, mainGraph, mainSerie, graphs); + if (showLabel) { + this._buildLabels(mainSerie, 0, mainGraph, mainSerie, graphs); + } + for (var i = 0, j = 0; i < series.length; i++) { + if (this.selectedMap[series[i].name]) { + this._buildEdgeCurves(series, i, graphs[j++], mainSerie, mainGraph); + } + } + } + this._initHoverHandler(series, graphs); + }, + _getSerieGraphFromDataMatrix: function (serie, mainSerie) { + var nodesData = []; + var count = 0; + var matrix = []; + for (var i = 0; i < serie.matrix.length; i++) { + matrix[i] = serie.matrix[i].slice(); + } + var data = serie.data || serie.nodes; + for (var i = 0; i < data.length; i++) { + var node = {}; + var group = data[i]; + group.rawIndex = i; + for (var key in group) { + if (key === 'name') { + node['id'] = group['name']; + } else { + node[key] = group[key]; + } + } + var category = this._getNodeCategory(mainSerie, group); + var name = category ? category.name : group.name; + this.selectedMap[name] = this.isSelected(name); + if (this.selectedMap[name]) { + nodesData.push(node); + count++; + } else { + matrix.splice(count, 1); + for (var j = 0; j < matrix.length; j++) { + matrix[j].splice(count, 1); + } + } + } + var graph = Graph.fromMatrix(nodesData, matrix, true); + graph.eachNode(function (n, idx) { + n.layout = { size: n.data.outValue }; + n.rawIndex = n.data.rawIndex; + }); + graph.eachEdge(function (e) { + e.layout = { weight: e.data.weight }; + }); + return graph; + }, + _getSerieGraphFromNodeLinks: function (serie, mainSerie) { + var graph = new Graph(true); + var nodes = serie.data || serie.nodes; + for (var i = 0, len = nodes.length; i < len; i++) { + var n = nodes[i]; + if (!n || n.ignore) { + continue; + } + var category = this._getNodeCategory(mainSerie, n); + var name = category ? category.name : n.name; + this.selectedMap[name] = this.isSelected(name); + if (this.selectedMap[name]) { + var node = graph.addNode(n.name, n); + node.rawIndex = i; + } + } + for (var i = 0, len = serie.links.length; i < len; i++) { + var e = serie.links[i]; + var n1 = e.source; + var n2 = e.target; + if (typeof n1 === 'number') { + n1 = nodes[n1]; + if (n1) { + n1 = n1.name; + } + } + if (typeof n2 === 'number') { + n2 = nodes[n2]; + if (n2) { + n2 = n2.name; + } + } + var edge = graph.addEdge(n1, n2, e); + if (edge) { + edge.rawIndex = i; + } + } + graph.eachNode(function (n) { + var value = n.data.value; + if (value == null) { + value = 0; + if (mainSerie.ribbonType) { + for (var i = 0; i < n.outEdges.length; i++) { + value += n.outEdges[i].data.weight || 0; + } + } else { + for (var i = 0; i < n.edges.length; i++) { + value += n.edges[i].data.weight || 0; + } + } + } + n.layout = { size: value }; + }); + graph.eachEdge(function (e) { + e.layout = { weight: e.data.weight == null ? 1 : e.data.weight }; + }); + return graph; + }, + _initHoverHandler: function (series, graphs) { + var mainSerie = series[0]; + var mainGraph = graphs[0]; + var self = this; + mainGraph.eachNode(function (node) { + node.shape.onmouseover = function () { + mainGraph.eachNode(function (n) { + n.shape.style.opacity = 0.1; + if (n.labelShape) { + n.labelShape.style.opacity = 0.1; + n.labelShape.modSelf(); + } + n.shape.modSelf(); + }); + for (var i = 0; i < graphs.length; i++) { + for (var j = 0; j < graphs[i].edges.length; j++) { + var e = graphs[i].edges[j]; + var queryTarget = self._getEdgeQueryTarget(graphs[i].__serie, e.data); + e.shape.style.opacity = self.deepQuery(queryTarget, 'opacity') * 0.1; + e.shape.modSelf(); + } + } + node.shape.style.opacity = 1; + if (node.labelShape) { + node.labelShape.style.opacity = 1; + } + for (var i = 0; i < graphs.length; i++) { + var n = graphs[i].getNodeById(node.id); + if (n) { + for (var j = 0; j < n.outEdges.length; j++) { + var e = n.outEdges[j]; + var queryTarget = self._getEdgeQueryTarget(graphs[i].__serie, e.data); + e.shape.style.opacity = self.deepQuery(queryTarget, 'opacity'); + var other = graphs[0].getNodeById(e.node2.id); + if (other) { + if (other.shape) { + other.shape.style.opacity = 1; + } + if (other.labelShape) { + other.labelShape.style.opacity = 1; + } + } + } + } + } + self.zr.refreshNextFrame(); + }; + node.shape.onmouseout = function () { + mainGraph.eachNode(function (n) { + n.shape.style.opacity = 1; + if (n.labelShape) { + n.labelShape.style.opacity = 1; + n.labelShape.modSelf(); + } + n.shape.modSelf(); + }); + for (var i = 0; i < graphs.length; i++) { + for (var j = 0; j < graphs[i].edges.length; j++) { + var e = graphs[i].edges[j]; + var queryTarget = [ + e.data, + mainSerie + ]; + e.shape.style.opacity = self.deepQuery(queryTarget, 'itemStyle.normal.chordStyle.opacity'); + e.shape.modSelf(); + } + } + self.zr.refreshNextFrame(); + }; + }); + }, + _buildSectors: function (serie, serieIdx, graph, mainSerie) { + var center = this.parseCenter(this.zr, mainSerie.center); + var radius = this.parseRadius(this.zr, mainSerie.radius); + var clockWise = mainSerie.clockWise; + var sign = clockWise ? 1 : -1; + graph.eachNode(function (node) { + var category = this._getNodeCategory(mainSerie, node.data); + var color = category ? this.getColor(category.name) : this.getColor(node.id); + var startAngle = node.layout.startAngle / Math.PI * 180 * sign; + var endAngle = node.layout.endAngle / Math.PI * 180 * sign; + var sector = new SectorShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: center[0], + y: center[1], + r0: radius[0], + r: radius[1], + startAngle: startAngle, + endAngle: endAngle, + brushType: 'fill', + opacity: 1, + color: color, + clockWise: clockWise + }, + clickable: mainSerie.clickable, + highlightStyle: { brushType: 'fill' } + }); + sector.style.lineWidth = this.deepQuery([ + node.data, + mainSerie + ], 'itemStyle.normal.borderWidth'); + sector.highlightStyle.lineWidth = this.deepQuery([ + node.data, + mainSerie + ], 'itemStyle.emphasis.borderWidth'); + sector.style.strokeColor = this.deepQuery([ + node.data, + mainSerie + ], 'itemStyle.normal.borderColor'); + sector.highlightStyle.strokeColor = this.deepQuery([ + node.data, + mainSerie + ], 'itemStyle.emphasis.borderColor'); + if (sector.style.lineWidth > 0) { + sector.style.brushType = 'both'; + } + if (sector.highlightStyle.lineWidth > 0) { + sector.highlightStyle.brushType = 'both'; + } + ecData.pack(sector, serie, serieIdx, node.data, node.rawIndex, node.id, node.category); + this.shapeList.push(sector); + node.shape = sector; + }, this); + }, + _buildNodeIcons: function (serie, serieIdx, graph, mainSerie) { + var center = this.parseCenter(this.zr, mainSerie.center); + var radius = this.parseRadius(this.zr, mainSerie.radius); + var r = radius[1]; + graph.eachNode(function (node) { + var startAngle = node.layout.startAngle; + var endAngle = node.layout.endAngle; + var angle = (startAngle + endAngle) / 2; + var x = r * Math.cos(angle); + var y = r * Math.sin(angle); + var queryTarget = this._getNodeQueryTarget(mainSerie, node.data); + var category = this._getNodeCategory(mainSerie, node.data); + var color = this.deepQuery(queryTarget, 'itemStyle.normal.color'); + if (!color) { + color = category ? this.getColor(category.name) : this.getColor(node.id); + } + var iconShape = new IconShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + style: { + x: -node.layout.size, + y: -node.layout.size, + width: node.layout.size * 2, + height: node.layout.size * 2, + iconType: this.deepQuery(queryTarget, 'symbol'), + color: color, + brushType: 'both', + lineWidth: this.deepQuery(queryTarget, 'itemStyle.normal.borderWidth'), + strokeColor: this.deepQuery(queryTarget, 'itemStyle.normal.borderColor') + }, + highlightStyle: { + color: this.deepQuery(queryTarget, 'itemStyle.emphasis.color'), + lineWidth: this.deepQuery(queryTarget, 'itemStyle.emphasis.borderWidth'), + strokeColor: this.deepQuery(queryTarget, 'itemStyle.emphasis.borderColor') + }, + clickable: mainSerie.clickable, + position: [ + x + center[0], + y + center[1] + ] + }); + ecData.pack(iconShape, serie, serieIdx, node.data, node.rawIndex, node.id, node.category); + this.shapeList.push(iconShape); + node.shape = iconShape; + }, this); + }, + _buildLabels: function (serie, serieIdx, graph, mainSerie) { + var labelColor = this.query(mainSerie, 'itemStyle.normal.label.color'); + var rotateLabel = this.query(mainSerie, 'itemStyle.normal.label.rotate'); + var labelDistance = this.query(mainSerie, 'itemStyle.normal.label.distance'); + var center = this.parseCenter(this.zr, mainSerie.center); + var radius = this.parseRadius(this.zr, mainSerie.radius); + var clockWise = mainSerie.clockWise; + var sign = clockWise ? 1 : -1; + graph.eachNode(function (node) { + var startAngle = node.layout.startAngle / Math.PI * 180 * sign; + var endAngle = node.layout.endAngle / Math.PI * 180 * sign; + var angle = (startAngle * -sign + endAngle * -sign) / 2; + angle %= 360; + if (angle < 0) { + angle += 360; + } + var isRightSide = angle <= 90 || angle >= 270; + angle = angle * Math.PI / 180; + var v = [ + Math.cos(angle), + -Math.sin(angle) + ]; + var distance = 0; + if (mainSerie.ribbonType) { + distance = mainSerie.showScaleText ? 35 + labelDistance : labelDistance; + } else { + distance = labelDistance + node.layout.size; + } + var start = vec2.scale([], v, radius[1] + distance); + vec2.add(start, start, center); + var labelShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + hoverable: false, + style: { + text: node.data.label == null ? node.id : node.data.label, + textAlign: isRightSide ? 'left' : 'right', + color: labelColor || '#000000' + } + }; + if (rotateLabel) { + labelShape.rotation = isRightSide ? angle : Math.PI + angle; + if (isRightSide) { + labelShape.style.x = radius[1] + distance; + } else { + labelShape.style.x = -radius[1] - distance; + } + labelShape.style.y = 0; + labelShape.position = center.slice(); + } else { + labelShape.style.x = start[0]; + labelShape.style.y = start[1]; + } + labelShape.style.textColor = this.deepQuery([ + node.data, + mainSerie + ], 'itemStyle.normal.label.textStyle.color') || '#fff'; + labelShape.style.textFont = this.getFont(this.deepQuery([ + node.data, + mainSerie + ], 'itemStyle.normal.label.textStyle')); + labelShape = new TextShape(labelShape); + this.shapeList.push(labelShape); + node.labelShape = labelShape; + }, this); + }, + _buildRibbons: function (series, serieIdx, graph, mainSerie) { + var serie = series[serieIdx]; + var center = this.parseCenter(this.zr, mainSerie.center); + var radius = this.parseRadius(this.zr, mainSerie.radius); + graph.eachEdge(function (edge, idx) { + var color; + var other = graph.getEdge(edge.node2, edge.node1); + if (!other || edge.shape) { + return; + } + if (other.shape) { + edge.shape = other.shape; + return; + } + var s0 = edge.layout.startAngle / Math.PI * 180; + var s1 = edge.layout.endAngle / Math.PI * 180; + var t0 = other.layout.startAngle / Math.PI * 180; + var t1 = other.layout.endAngle / Math.PI * 180; + if (series.length === 1) { + if (edge.layout.weight <= other.layout.weight) { + color = this.getColor(edge.node1.id); + } else { + color = this.getColor(edge.node2.id); + } + } else { + color = this.getColor(serie.name); + } + var queryTarget = this._getEdgeQueryTarget(serie, edge.data); + var queryTargetEmphasis = this._getEdgeQueryTarget(serie, edge.data, 'emphasis'); + var ribbon = new RibbonShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: center[0], + y: center[1], + r: radius[0], + source0: s0, + source1: s1, + target0: t0, + target1: t1, + brushType: 'both', + opacity: this.deepQuery(queryTarget, 'opacity'), + color: color, + lineWidth: this.deepQuery(queryTarget, 'borderWidth'), + strokeColor: this.deepQuery(queryTarget, 'borderColor'), + clockWise: mainSerie.clockWise + }, + clickable: mainSerie.clickable, + highlightStyle: { + brushType: 'both', + opacity: this.deepQuery(queryTargetEmphasis, 'opacity'), + lineWidth: this.deepQuery(queryTargetEmphasis, 'borderWidth'), + strokeColor: this.deepQuery(queryTargetEmphasis, 'borderColor') + } + }); + var node1, node2; + if (edge.layout.weight <= other.layout.weight) { + node1 = other.node1; + node2 = other.node2; + } else { + node1 = edge.node1; + node2 = edge.node2; + } + ecData.pack(ribbon, serie, serieIdx, edge.data, edge.rawIndex == null ? idx : edge.rawIndex, edge.data.name || node1.id + '-' + node2.id, node1.id, node2.id); + this.shapeList.push(ribbon); + edge.shape = ribbon; + }, this); + }, + _buildEdgeCurves: function (series, serieIdx, graph, mainSerie, mainGraph) { + var serie = series[serieIdx]; + var center = this.parseCenter(this.zr, mainSerie.center); + graph.eachEdge(function (e, idx) { + var node1 = mainGraph.getNodeById(e.node1.id); + var node2 = mainGraph.getNodeById(e.node2.id); + var shape1 = node1.shape; + var shape2 = node2.shape; + var queryTarget = this._getEdgeQueryTarget(serie, e.data); + var queryTargetEmphasis = this._getEdgeQueryTarget(serie, e.data, 'emphasis'); + var curveShape = new BezierCurveShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + xStart: shape1.position[0], + yStart: shape1.position[1], + xEnd: shape2.position[0], + yEnd: shape2.position[1], + cpX1: center[0], + cpY1: center[1], + lineWidth: this.deepQuery(queryTarget, 'width'), + strokeColor: this.deepQuery(queryTarget, 'color'), + opacity: this.deepQuery(queryTarget, 'opacity') + }, + highlightStyle: { + lineWidth: this.deepQuery(queryTargetEmphasis, 'width'), + strokeColor: this.deepQuery(queryTargetEmphasis, 'color'), + opacity: this.deepQuery(queryTargetEmphasis, 'opacity') + } + }); + ecData.pack(curveShape, serie, serieIdx, e.data, e.rawIndex == null ? idx : e.rawIndex, e.data.name || e.node1.id + '-' + e.node2.id, e.node1.id, e.node2.id); + this.shapeList.push(curveShape); + e.shape = curveShape; + }, this); + }, + _buildScales: function (serie, serieIdx, graph) { + var clockWise = serie.clockWise; + var center = this.parseCenter(this.zr, serie.center); + var radius = this.parseRadius(this.zr, serie.radius); + var sign = clockWise ? 1 : -1; + var sumValue = 0; + var maxValue = -Infinity; + var unitPostfix; + var unitScale; + if (serie.showScaleText) { + graph.eachNode(function (node) { + var val = node.data.value; + if (val > maxValue) { + maxValue = val; + } + sumValue += val; + }); + if (maxValue > 10000000000) { + unitPostfix = 'b'; + unitScale = 1e-9; + } else if (maxValue > 10000000) { + unitPostfix = 'm'; + unitScale = 0.000001; + } else if (maxValue > 10000) { + unitPostfix = 'k'; + unitScale = 0.001; + } else { + unitPostfix = ''; + unitScale = 1; + } + } + var unitValue = sumValue / (360 - serie.padding); + graph.eachNode(function (node) { + var startAngle = node.layout.startAngle / Math.PI * 180; + var endAngle = node.layout.endAngle / Math.PI * 180; + var scaleAngle = startAngle; + while (true) { + if (clockWise && scaleAngle > endAngle || !clockWise && scaleAngle < endAngle) { + break; + } + var theta = scaleAngle / 180 * Math.PI; + var v = [ + Math.cos(theta), + Math.sin(theta) + ]; + var start = vec2.scale([], v, radius[1] + 1); + vec2.add(start, start, center); + var end = vec2.scale([], v, radius[1] + this.scaleLineLength); + vec2.add(end, end, center); + var scaleShape = new LineShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase() - 1, + hoverable: false, + style: { + xStart: start[0], + yStart: start[1], + xEnd: end[0], + yEnd: end[1], + lineCap: 'round', + brushType: 'stroke', + strokeColor: '#666', + lineWidth: 1 + } + }); + this.shapeList.push(scaleShape); + scaleAngle += sign * this.scaleUnitAngle; + } + if (!serie.showScaleText) { + return; + } + var scaleTextAngle = startAngle; + var step = unitValue * 5 * this.scaleUnitAngle; + var scaleValue = 0; + while (true) { + if (clockWise && scaleTextAngle > endAngle || !clockWise && scaleTextAngle < endAngle) { + break; + } + var theta = scaleTextAngle; + theta = theta % 360; + if (theta < 0) { + theta += 360; + } + var isRightSide = theta <= 90 || theta >= 270; + var textShape = new TextShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase() - 1, + hoverable: false, + style: { + x: isRightSide ? radius[1] + this.scaleLineLength + 4 : -radius[1] - this.scaleLineLength - 4, + y: 0, + text: Math.round(scaleValue * 10) / 10 + unitPostfix, + textAlign: isRightSide ? 'left' : 'right' + }, + position: center.slice(), + rotation: isRightSide ? [ + -theta / 180 * Math.PI, + 0, + 0 + ] : [ + -(theta + 180) / 180 * Math.PI, + 0, + 0 + ] + }); + this.shapeList.push(textShape); + scaleValue += step * unitScale; + scaleTextAngle += sign * this.scaleUnitAngle * 5; + } + }, this); + }, + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + this.legend = this.component.legend; + if (this.legend) { + this.getColor = function (param) { + return this.legend.getColor(param); + }; + this.isSelected = function (param) { + return this.legend.isSelected(param); + }; + } else { + var colorMap = {}; + var count = 0; + this.getColor = function (key) { + if (colorMap[key]) { + return colorMap[key]; + } + if (!colorMap[key]) { + colorMap[key] = this.zr.getColor(count++); + } + return colorMap[key]; + }; + this.isSelected = function () { + return true; + }; + } + this.backupShapeList(); + this._init(); + }, + reformOption: function (opt) { + var _merge = zrUtil.merge; + opt = _merge(_merge(opt || {}, this.ecTheme.chord), ecConfig.chord); + opt.itemStyle.normal.label.textStyle = this.getTextStyle(opt.itemStyle.normal.label.textStyle); + } + }; + zrUtil.inherits(Chord, ChartBase); + require('../chart').define('chord', Chord); + return Chord; +});define('echarts/util/shape/Ribbon', [ + 'require', + 'zrender/shape/Base', + 'zrender/shape/util/PathProxy', + 'zrender/tool/util', + 'zrender/tool/area' +], function (require) { + var Base = require('zrender/shape/Base'); + var PathProxy = require('zrender/shape/util/PathProxy'); + var zrUtil = require('zrender/tool/util'); + var area = require('zrender/tool/area'); + function RibbonShape(options) { + Base.call(this, options); + this._pathProxy = new PathProxy(); + } + RibbonShape.prototype = { + type: 'ribbon', + buildPath: function (ctx, style) { + var clockWise = style.clockWise || false; + var path = this._pathProxy; + path.begin(ctx); + var cx = style.x; + var cy = style.y; + var r = style.r; + var s0 = style.source0 / 180 * Math.PI; + var s1 = style.source1 / 180 * Math.PI; + var t0 = style.target0 / 180 * Math.PI; + var t1 = style.target1 / 180 * Math.PI; + var sx0 = cx + Math.cos(s0) * r; + var sy0 = cy + Math.sin(s0) * r; + var sx1 = cx + Math.cos(s1) * r; + var sy1 = cy + Math.sin(s1) * r; + var tx0 = cx + Math.cos(t0) * r; + var ty0 = cy + Math.sin(t0) * r; + var tx1 = cx + Math.cos(t1) * r; + var ty1 = cy + Math.sin(t1) * r; + path.moveTo(sx0, sy0); + path.arc(cx, cy, style.r, s0, s1, !clockWise); + path.bezierCurveTo((cx - sx1) * 0.7 + sx1, (cy - sy1) * 0.7 + sy1, (cx - tx0) * 0.7 + tx0, (cy - ty0) * 0.7 + ty0, tx0, ty0); + if (style.source0 === style.target0 && style.source1 === style.target1) { + return; + } + path.arc(cx, cy, style.r, t0, t1, !clockWise); + path.bezierCurveTo((cx - tx1) * 0.7 + tx1, (cy - ty1) * 0.7 + ty1, (cx - sx0) * 0.7 + sx0, (cy - sy0) * 0.7 + sy0, sx0, sy0); + }, + getRect: function (style) { + if (style.__rect) { + return style.__rect; + } + if (!this._pathProxy.isEmpty()) { + this.buildPath(null, style); + } + return this._pathProxy.fastBoundingRect(); + }, + isCover: function (x, y) { + var rect = this.getRect(this.style); + if (x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height) { + return area.isInsidePath(this._pathProxy.pathCommands, 0, 'fill', x, y); + } + } + }; + zrUtil.inherits(RibbonShape, Base); + return RibbonShape; +});define('zrender/shape/BezierCurve', [ + 'require', + './Base', + '../tool/util' +], function (require) { + 'use strict'; + var Base = require('./Base'); + var BezierCurve = function (options) { + this.brushTypeOnly = 'stroke'; + this.textPosition = 'end'; + Base.call(this, options); + }; + BezierCurve.prototype = { + type: 'bezier-curve', + buildPath: function (ctx, style) { + ctx.moveTo(style.xStart, style.yStart); + if (typeof style.cpX2 != 'undefined' && typeof style.cpY2 != 'undefined') { + ctx.bezierCurveTo(style.cpX1, style.cpY1, style.cpX2, style.cpY2, style.xEnd, style.yEnd); + } else { + ctx.quadraticCurveTo(style.cpX1, style.cpY1, style.xEnd, style.yEnd); + } + }, + getRect: function (style) { + if (style.__rect) { + return style.__rect; + } + var _minX = Math.min(style.xStart, style.xEnd, style.cpX1); + var _minY = Math.min(style.yStart, style.yEnd, style.cpY1); + var _maxX = Math.max(style.xStart, style.xEnd, style.cpX1); + var _maxY = Math.max(style.yStart, style.yEnd, style.cpY1); + var _x2 = style.cpX2; + var _y2 = style.cpY2; + if (typeof _x2 != 'undefined' && typeof _y2 != 'undefined') { + _minX = Math.min(_minX, _x2); + _minY = Math.min(_minY, _y2); + _maxX = Math.max(_maxX, _x2); + _maxY = Math.max(_maxY, _y2); + } + var lineWidth = style.lineWidth || 1; + style.__rect = { + x: _minX - lineWidth, + y: _minY - lineWidth, + width: _maxX - _minX + lineWidth, + height: _maxY - _minY + lineWidth + }; + return style.__rect; + } + }; + require('../tool/util').inherits(BezierCurve, Base); + return BezierCurve; +});define('echarts/data/Graph', [ + 'require', + 'zrender/tool/util' +], function (require) { + var util = require('zrender/tool/util'); + 'use strict'; + var Graph = function (directed) { + this._directed = directed || false; + this.nodes = []; + this.edges = []; + this._nodesMap = {}; + this._edgesMap = {}; + }; + Graph.prototype.isDirected = function () { + return this._directed; + }; + Graph.prototype.addNode = function (id, data) { + if (this._nodesMap[id]) { + return this._nodesMap[id]; + } + var node = new Graph.Node(id, data); + this.nodes.push(node); + this._nodesMap[id] = node; + return node; + }; + Graph.prototype.getNodeById = function (id) { + return this._nodesMap[id]; + }; + Graph.prototype.addEdge = function (n1, n2, data) { + if (typeof n1 == 'string') { + n1 = this._nodesMap[n1]; + } + if (typeof n2 == 'string') { + n2 = this._nodesMap[n2]; + } + if (!n1 || !n2) { + return; + } + var key = n1.id + '-' + n2.id; + if (this._edgesMap[key]) { + return this._edgesMap[key]; + } + var edge = new Graph.Edge(n1, n2, data); + if (this._directed) { + n1.outEdges.push(edge); + n2.inEdges.push(edge); + } + n1.edges.push(edge); + if (n1 !== n2) { + n2.edges.push(edge); + } + this.edges.push(edge); + this._edgesMap[key] = edge; + return edge; + }; + Graph.prototype.removeEdge = function (edge) { + var n1 = edge.node1; + var n2 = edge.node2; + var key = n1.id + '-' + n2.id; + if (this._directed) { + n1.outEdges.splice(util.indexOf(n1.outEdges, edge), 1); + n2.inEdges.splice(util.indexOf(n2.inEdges, edge), 1); + } + n1.edges.splice(util.indexOf(n1.edges, edge), 1); + if (n1 !== n2) { + n2.edges.splice(util.indexOf(n2.edges, edge), 1); + } + delete this._edgesMap[key]; + this.edges.splice(util.indexOf(this.edges, edge), 1); + }; + Graph.prototype.getEdge = function (n1, n2) { + if (typeof n1 !== 'string') { + n1 = n1.id; + } + if (typeof n2 !== 'string') { + n2 = n2.id; + } + if (this._directed) { + return this._edgesMap[n1 + '-' + n2]; + } else { + return this._edgesMap[n1 + '-' + n2] || this._edgesMap[n2 + '-' + n1]; + } + }; + Graph.prototype.removeNode = function (node) { + if (typeof node === 'string') { + node = this._nodesMap[node]; + if (!node) { + return; + } + } + delete this._nodesMap[node.id]; + this.nodes.splice(util.indexOf(this.nodes, node), 1); + for (var i = 0; i < this.edges.length;) { + var edge = this.edges[i]; + if (edge.node1 === node || edge.node2 === node) { + this.removeEdge(edge); + } else { + i++; + } + } + }; + Graph.prototype.filterNode = function (cb, context) { + var len = this.nodes.length; + for (var i = 0; i < len;) { + if (cb.call(context, this.nodes[i], i)) { + i++; + } else { + this.removeNode(this.nodes[i]); + len--; + } + } + }; + Graph.prototype.filterEdge = function (cb, context) { + var len = this.edges.length; + for (var i = 0; i < len;) { + if (cb.call(context, this.edges[i], i)) { + i++; + } else { + this.removeEdge(this.edges[i]); + len--; + } + } + }; + Graph.prototype.eachNode = function (cb, context) { + var len = this.nodes.length; + for (var i = 0; i < len; i++) { + if (this.nodes[i]) { + cb.call(context, this.nodes[i], i); + } + } + }; + Graph.prototype.eachEdge = function (cb, context) { + var len = this.edges.length; + for (var i = 0; i < len; i++) { + if (this.edges[i]) { + cb.call(context, this.edges[i], i); + } + } + }; + Graph.prototype.clear = function () { + this.nodes.length = 0; + this.edges.length = 0; + this._nodesMap = {}; + this._edgesMap = {}; + }; + Graph.prototype.breadthFirstTraverse = function (cb, startNode, direction, context) { + if (typeof startNode === 'string') { + startNode = this._nodesMap[startNode]; + } + if (!startNode) { + return; + } + var edgeType = 'edges'; + if (direction === 'out') { + edgeType = 'outEdges'; + } else if (direction === 'in') { + edgeType = 'inEdges'; + } + for (var i = 0; i < this.nodes.length; i++) { + this.nodes[i].__visited = false; + } + if (cb.call(context, startNode, null)) { + return; + } + var queue = [startNode]; + while (queue.length) { + var currentNode = queue.shift(); + var edges = currentNode[edgeType]; + for (var i = 0; i < edges.length; i++) { + var e = edges[i]; + var otherNode = e.node1 === currentNode ? e.node2 : e.node1; + if (!otherNode.__visited) { + if (cb.call(otherNode, otherNode, currentNode)) { + return; + } + queue.push(otherNode); + otherNode.__visited = true; + } + } + } + }; + Graph.prototype.clone = function () { + var graph = new Graph(this._directed); + for (var i = 0; i < this.nodes.length; i++) { + graph.addNode(this.nodes[i].id, this.nodes[i].data); + } + for (var i = 0; i < this.edges.length; i++) { + var e = this.edges[i]; + graph.addEdge(e.node1.id, e.node2.id, e.data); + } + return graph; + }; + var Node = function (id, data) { + this.id = id; + this.data = data || null; + this.inEdges = []; + this.outEdges = []; + this.edges = []; + }; + Node.prototype.degree = function () { + return this.edges.length; + }; + Node.prototype.inDegree = function () { + return this.inEdges.length; + }; + Node.prototype.outDegree = function () { + return this.outEdges.length; + }; + var Edge = function (node1, node2, data) { + this.node1 = node1; + this.node2 = node2; + this.data = data || null; + }; + Graph.Node = Node; + Graph.Edge = Edge; + Graph.fromMatrix = function (nodesData, matrix, directed) { + if (!matrix || !matrix.length || matrix[0].length !== matrix.length || nodesData.length !== matrix.length) { + return; + } + var size = matrix.length; + var graph = new Graph(directed); + for (var i = 0; i < size; i++) { + var node = graph.addNode(nodesData[i].id, nodesData[i]); + node.data.value = 0; + if (directed) { + node.data.outValue = node.data.inValue = 0; + } + } + for (var i = 0; i < size; i++) { + for (var j = 0; j < size; j++) { + var item = matrix[i][j]; + if (directed) { + graph.nodes[i].data.outValue += item; + graph.nodes[j].data.inValue += item; + } + graph.nodes[i].data.value += item; + graph.nodes[j].data.value += item; + } + } + for (var i = 0; i < size; i++) { + for (var j = i; j < size; j++) { + var item = matrix[i][j]; + if (item === 0) { + continue; + } + var n1 = graph.nodes[i]; + var n2 = graph.nodes[j]; + var edge = graph.addEdge(n1, n2, {}); + edge.data.weight = item; + if (i !== j) { + if (directed && matrix[j][i]) { + var inEdge = graph.addEdge(n2, n1, {}); + inEdge.data.weight = matrix[j][i]; + } + } + } + } + return graph; + }; + return Graph; +});define('echarts/layout/Chord', ['require'], function (require) { + var ChordLayout = function (opts) { + opts = opts || {}; + this.sort = opts.sort || null; + this.sortSub = opts.sortSub || null; + this.padding = 0.05; + this.startAngle = opts.startAngle || 0; + this.clockWise = opts.clockWise == null ? false : opts.clockWise; + this.center = opts.center || [ + 0, + 0 + ]; + this.directed = true; + }; + ChordLayout.prototype.run = function (graphs) { + if (!(graphs instanceof Array)) { + graphs = [graphs]; + } + var gl = graphs.length; + if (!gl) { + return; + } + var graph0 = graphs[0]; + var nl = graph0.nodes.length; + var groups = []; + var sumSize = 0; + for (var i = 0; i < nl; i++) { + var g0node = graph0.nodes[i]; + var group = { + size: 0, + subGroups: [], + node: g0node + }; + groups.push(group); + var sumWeight = 0; + for (var k = 0; k < graphs.length; k++) { + var graph = graphs[k]; + var node = graph.getNodeById(g0node.id); + if (!node) { + continue; + } + group.size += node.layout.size; + var edges = this.directed ? node.outEdges : node.edges; + for (var j = 0; j < edges.length; j++) { + var e = edges[j]; + var w = e.layout.weight; + group.subGroups.push({ + weight: w, + edge: e, + graph: graph + }); + sumWeight += w; + } + } + sumSize += group.size; + var multiplier = group.size / sumWeight; + for (var j = 0; j < group.subGroups.length; j++) { + group.subGroups[j].weight *= multiplier; + } + if (this.sortSub === 'ascending') { + group.subGroups.sort(compareSubGroups); + } else if (this.sort === 'descending') { + group.subGroups.sort(compareSubGroups); + group.subGroups.reverse(); + } + } + if (this.sort === 'ascending') { + groups.sort(compareGroups); + } else if (this.sort === 'descending') { + groups.sort(compareGroups); + groups.reverse(); + } + var multiplier = (Math.PI * 2 - this.padding * nl) / sumSize; + var angle = this.startAngle; + var sign = this.clockWise ? 1 : -1; + for (var i = 0; i < nl; i++) { + var group = groups[i]; + group.node.layout.startAngle = angle; + group.node.layout.endAngle = angle + sign * group.size * multiplier; + group.node.layout.subGroups = []; + for (var j = 0; j < group.subGroups.length; j++) { + var subGroup = group.subGroups[j]; + subGroup.edge.layout.startAngle = angle; + angle += sign * subGroup.weight * multiplier; + subGroup.edge.layout.endAngle = angle; + } + angle = group.node.layout.endAngle + sign * this.padding; + } + }; + var compareSubGroups = function (a, b) { + return a.weight - b.weight; + }; + var compareGroups = function (a, b) { + return a.size - b.size; + }; + return ChordLayout; +});define('echarts/chart/force', [ + 'require', + './base', + '../data/Graph', + '../layout/Force', + 'zrender/shape/Line', + 'zrender/shape/BezierCurve', + 'zrender/shape/Image', + '../util/shape/Icon', + '../config', + '../util/ecData', + 'zrender/tool/util', + 'zrender/config', + 'zrender/tool/vector', + '../chart' +], function (require) { + 'use strict'; + var ChartBase = require('./base'); + var Graph = require('../data/Graph'); + var ForceLayout = require('../layout/Force'); + var LineShape = require('zrender/shape/Line'); + var BezierCurveShape = require('zrender/shape/BezierCurve'); + var ImageShape = require('zrender/shape/Image'); + var IconShape = require('../util/shape/Icon'); + var ecConfig = require('../config'); + ecConfig.force = { + zlevel: 1, + z: 2, + center: [ + '50%', + '50%' + ], + size: '100%', + preventOverlap: false, + coolDown: 0.99, + minRadius: 10, + maxRadius: 20, + ratioScaling: false, + large: false, + useWorker: false, + steps: 1, + scaling: 1, + gravity: 1, + symbol: 'circle', + symbolSize: 0, + linkSymbol: null, + linkSymbolSize: [ + 10, + 15 + ], + draggable: true, + clickable: true, + roam: false, + itemStyle: { + normal: { + label: { + show: false, + position: 'inside' + }, + nodeStyle: { + brushType: 'both', + borderColor: '#5182ab', + borderWidth: 1 + }, + linkStyle: { + color: '#5182ab', + width: 1, + type: 'line' + } + }, + emphasis: { + label: { show: false }, + nodeStyle: {}, + linkStyle: { opacity: 0 } + } + } + }; + var ecData = require('../util/ecData'); + var zrUtil = require('zrender/tool/util'); + var zrConfig = require('zrender/config'); + var vec2 = require('zrender/tool/vector'); + function Force(ecTheme, messageCenter, zr, option, myChart) { + var self = this; + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); + this.__nodePositionMap = {}; + this._graph = new Graph(true); + this._layout = new ForceLayout(); + this._layout.onupdate = function () { + self._step(); + }; + this._steps = 1; + this.ondragstart = function () { + ondragstart.apply(self, arguments); + }; + this.ondragend = function () { + ondragend.apply(self, arguments); + }; + this.ondrop = function () { + }; + this.shapeHandler.ondragstart = function () { + self.isDragstart = true; + }; + this.onmousemove = function () { + onmousemove.apply(self, arguments); + }; + this.refresh(option); + } + Force.prototype = { + constructor: Force, + type: ecConfig.CHART_TYPE_FORCE, + _init: function () { + var legend = this.component.legend; + var series = this.series; + var serieName; + this.clear(); + for (var i = 0, l = series.length; i < l; i++) { + var serie = series[i]; + if (serie.type === ecConfig.CHART_TYPE_FORCE) { + series[i] = this.reformOption(series[i]); + serieName = series[i].name || ''; + this.selectedMap[serieName] = legend ? legend.isSelected(serieName) : true; + if (!this.selectedMap[serieName]) { + continue; + } + this.buildMark(i); + this._initSerie(serie, i); + break; + } + } + this.animationEffect(); + }, + _getNodeCategory: function (serie, node) { + return serie.categories && serie.categories[node.category || 0]; + }, + _getNodeQueryTarget: function (serie, node, type) { + type = type || 'normal'; + var category = this._getNodeCategory(serie, node) || {}; + return [ + node.itemStyle && node.itemStyle[type], + category && category.itemStyle && category.itemStyle[type], + serie.itemStyle[type].nodeStyle + ]; + }, + _getEdgeQueryTarget: function (serie, edge, type) { + type = type || 'normal'; + return [ + edge.itemStyle && edge.itemStyle[type], + serie.itemStyle[type].linkStyle + ]; + }, + _initSerie: function (serie, serieIdx) { + this._temperature = 1; + if (serie.data) { + this._graph = this._getSerieGraphFromDataMatrix(serie); + } else { + this._graph = this._getSerieGraphFromNodeLinks(serie); + } + this._buildLinkShapes(serie, serieIdx); + this._buildNodeShapes(serie, serieIdx); + var panable = serie.roam === true || serie.roam === 'move'; + var zoomable = serie.roam === true || serie.roam === 'scale'; + this.zr.modLayer(this.getZlevelBase(), { + panable: panable, + zoomable: zoomable + }); + if (this.query('markPoint.effect.show') || this.query('markLine.effect.show')) { + this.zr.modLayer(ecConfig.EFFECT_ZLEVEL, { + panable: panable, + zoomable: zoomable + }); + } + this._initLayout(serie); + this._step(); + }, + _getSerieGraphFromDataMatrix: function (serie) { + var nodesData = []; + var count = 0; + var matrix = []; + for (var i = 0; i < serie.matrix.length; i++) { + matrix[i] = serie.matrix[i].slice(); + } + var data = serie.data || serie.nodes; + for (var i = 0; i < data.length; i++) { + var node = {}; + var group = data[i]; + for (var key in group) { + if (key === 'name') { + node['id'] = group['name']; + } else { + node[key] = group[key]; + } + } + var category = this._getNodeCategory(serie, group); + var name = category ? category.name : group.name; + this.selectedMap[name] = this.isSelected(name); + if (this.selectedMap[name]) { + nodesData.push(node); + count++; + } else { + matrix.splice(count, 1); + for (var j = 0; j < matrix.length; j++) { + matrix[j].splice(count, 1); + } + } + } + var graph = Graph.fromMatrix(nodesData, matrix, true); + graph.eachNode(function (n, idx) { + n.layout = { + size: n.data.value, + mass: 0 + }; + n.rawIndex = idx; + }); + graph.eachEdge(function (e) { + e.layout = { weight: e.data.weight }; + }); + return graph; + }, + _getSerieGraphFromNodeLinks: function (serie) { + var graph = new Graph(true); + var nodes = serie.data || serie.nodes; + for (var i = 0, len = nodes.length; i < len; i++) { + var n = nodes[i]; + if (!n || n.ignore) { + continue; + } + var category = this._getNodeCategory(serie, n); + var name = category ? category.name : n.name; + this.selectedMap[name] = this.isSelected(name); + if (this.selectedMap[name]) { + var node = graph.addNode(n.name, n); + node.rawIndex = i; + } + } + for (var i = 0, len = serie.links.length; i < len; i++) { + var e = serie.links[i]; + var n1 = e.source; + var n2 = e.target; + if (typeof n1 === 'number') { + n1 = nodes[n1]; + if (n1) { + n1 = n1.name; + } + } + if (typeof n2 === 'number') { + n2 = nodes[n2]; + if (n2) { + n2 = n2.name; + } + } + var edge = graph.addEdge(n1, n2, e); + if (edge) { + edge.rawIndex = i; + } + } + graph.eachNode(function (n) { + var value = n.data.value; + if (value == null) { + value = 0; + for (var i = 0; i < n.edges.length; i++) { + value += n.edges[i].data.weight || 0; + } + } + n.layout = { + size: value, + mass: 0 + }; + }); + graph.eachEdge(function (e) { + e.layout = { weight: e.data.weight == null ? 1 : e.data.weight }; + }); + return graph; + }, + _initLayout: function (serie) { + var graph = this._graph; + var len = graph.nodes.length; + var minRadius = this.query(serie, 'minRadius'); + var maxRadius = this.query(serie, 'maxRadius'); + this._steps = serie.steps || 1; + this._layout.center = this.parseCenter(this.zr, serie.center); + this._layout.width = this.parsePercent(serie.size, this.zr.getWidth()); + this._layout.height = this.parsePercent(serie.size, this.zr.getHeight()); + this._layout.large = serie.large; + this._layout.scaling = serie.scaling; + this._layout.ratioScaling = serie.ratioScaling; + this._layout.gravity = serie.gravity; + this._layout.temperature = 1; + this._layout.coolDown = serie.coolDown; + this._layout.preventNodeEdgeOverlap = serie.preventOverlap; + this._layout.preventNodeOverlap = serie.preventOverlap; + var min = Infinity; + var max = -Infinity; + for (var i = 0; i < len; i++) { + var gNode = graph.nodes[i]; + max = Math.max(gNode.layout.size, max); + min = Math.min(gNode.layout.size, min); + } + var divider = max - min; + for (var i = 0; i < len; i++) { + var gNode = graph.nodes[i]; + if (divider > 0) { + gNode.layout.size = (gNode.layout.size - min) * (maxRadius - minRadius) / divider + minRadius; + gNode.layout.mass = gNode.layout.size / maxRadius; + } else { + gNode.layout.size = (maxRadius - minRadius) / 2; + gNode.layout.mass = 0.5; + } + } + for (var i = 0; i < len; i++) { + var gNode = graph.nodes[i]; + if (typeof this.__nodePositionMap[gNode.id] !== 'undefined') { + gNode.layout.position = vec2.create(); + vec2.copy(gNode.layout.position, this.__nodePositionMap[gNode.id]); + } else if (typeof gNode.data.initial !== 'undefined') { + gNode.layout.position = vec2.create(); + vec2.copy(gNode.layout.position, gNode.data.initial); + } else { + var center = this._layout.center; + var size = Math.min(this._layout.width, this._layout.height); + gNode.layout.position = _randomInSquare(center[0], center[1], size * 0.8); + } + var style = gNode.shape.style; + var radius = gNode.layout.size; + style.width = style.width || radius * 2; + style.height = style.height || radius * 2; + style.x = -style.width / 2; + style.y = -style.height / 2; + vec2.copy(gNode.shape.position, gNode.layout.position); + } + len = graph.edges.length; + max = -Infinity; + for (var i = 0; i < len; i++) { + var e = graph.edges[i]; + if (e.layout.weight > max) { + max = e.layout.weight; + } + } + for (var i = 0; i < len; i++) { + var e = graph.edges[i]; + e.layout.weight /= max; + } + this._layout.init(graph, serie.useWorker); + }, + _buildNodeShapes: function (serie, serieIdx) { + var graph = this._graph; + var categories = this.query(serie, 'categories'); + graph.eachNode(function (node) { + var category = this._getNodeCategory(serie, node.data); + var queryTarget = [ + node.data, + category, + serie + ]; + var styleQueryTarget = this._getNodeQueryTarget(serie, node.data); + var emphasisStyleQueryTarget = this._getNodeQueryTarget(serie, node.data, 'emphasis'); + var shape = new IconShape({ + style: { + x: 0, + y: 0, + color: this.deepQuery(styleQueryTarget, 'color'), + brushType: 'both', + strokeColor: this.deepQuery(styleQueryTarget, 'strokeColor') || this.deepQuery(styleQueryTarget, 'borderColor'), + lineWidth: this.deepQuery(styleQueryTarget, 'lineWidth') || this.deepQuery(styleQueryTarget, 'borderWidth') + }, + highlightStyle: { + color: this.deepQuery(emphasisStyleQueryTarget, 'color'), + strokeColor: this.deepQuery(emphasisStyleQueryTarget, 'strokeColor') || this.deepQuery(emphasisStyleQueryTarget, 'borderColor'), + lineWidth: this.deepQuery(emphasisStyleQueryTarget, 'lineWidth') || this.deepQuery(emphasisStyleQueryTarget, 'borderWidth') + }, + clickable: serie.clickable, + zlevel: this.getZlevelBase(), + z: this.getZBase() + }); + if (!shape.style.color) { + shape.style.color = category ? this.getColor(category.name) : this.getColor(node.id); + } + shape.style.iconType = this.deepQuery(queryTarget, 'symbol'); + shape.style.width = shape.style.height = (this.deepQuery(queryTarget, 'symbolSize') || 0) * 2; + if (shape.style.iconType.match('image')) { + shape.style.image = shape.style.iconType.replace(new RegExp('^image:\\/\\/'), ''); + shape = new ImageShape({ + style: shape.style, + highlightStyle: shape.highlightStyle, + clickable: shape.clickable, + zlevel: this.getZlevelBase(), + z: this.getZBase() + }); + } + if (this.deepQuery(queryTarget, 'itemStyle.normal.label.show')) { + shape.style.text = node.data.label == null ? node.id : node.data.label; + shape.style.textPosition = this.deepQuery(queryTarget, 'itemStyle.normal.label.position'); + shape.style.textColor = this.deepQuery(queryTarget, 'itemStyle.normal.label.textStyle.color'); + shape.style.textFont = this.getFont(this.deepQuery(queryTarget, 'itemStyle.normal.label.textStyle') || {}); + } + if (this.deepQuery(queryTarget, 'itemStyle.emphasis.label.show')) { + shape.highlightStyle.textPosition = this.deepQuery(queryTarget, 'itemStyle.emphasis.label.position'); + shape.highlightStyle.textColor = this.deepQuery(queryTarget, 'itemStyle.emphasis.label.textStyle.color'); + shape.highlightStyle.textFont = this.getFont(this.deepQuery(queryTarget, 'itemStyle.emphasis.label.textStyle') || {}); + } + if (this.deepQuery(queryTarget, 'draggable')) { + this.setCalculable(shape); + shape.dragEnableTime = 0; + shape.draggable = true; + shape.ondragstart = this.shapeHandler.ondragstart; + shape.ondragover = null; + } + var categoryName = ''; + if (typeof node.category !== 'undefined') { + var category = categories[node.category]; + categoryName = category && category.name || ''; + } + ecData.pack(shape, serie, serieIdx, node.data, node.rawIndex, node.data.name || '', node.category); + this.shapeList.push(shape); + this.zr.addShape(shape); + node.shape = shape; + }, this); + }, + _buildLinkShapes: function (serie, serieIdx) { + var graph = this._graph; + var len = graph.edges.length; + for (var i = 0; i < len; i++) { + var gEdge = graph.edges[i]; + var link = gEdge.data; + var source = gEdge.node1; + var target = gEdge.node2; + var queryTarget = this._getEdgeQueryTarget(serie, link); + var linkType = this.deepQuery(queryTarget, 'type'); + if (serie.linkSymbol && serie.linkSymbol !== 'none') { + linkType = 'line'; + } + var LinkShapeCtor = linkType === 'line' ? LineShape : BezierCurveShape; + var linkShape = new LinkShapeCtor({ + style: { + xStart: 0, + yStart: 0, + xEnd: 0, + yEnd: 0 + }, + clickable: this.query(serie, 'clickable'), + highlightStyle: {}, + zlevel: this.getZlevelBase(), + z: this.getZBase() + }); + zrUtil.merge(linkShape.style, this.query(serie, 'itemStyle.normal.linkStyle'), true); + zrUtil.merge(linkShape.highlightStyle, this.query(serie, 'itemStyle.emphasis.linkStyle'), true); + if (typeof link.itemStyle !== 'undefined') { + if (link.itemStyle.normal) { + zrUtil.merge(linkShape.style, link.itemStyle.normal, true); + } + if (link.itemStyle.emphasis) { + zrUtil.merge(linkShape.highlightStyle, link.itemStyle.emphasis, true); + } + } + linkShape.style.lineWidth = linkShape.style.lineWidth || linkShape.style.width; + linkShape.style.strokeColor = linkShape.style.strokeColor || linkShape.style.color; + linkShape.highlightStyle.lineWidth = linkShape.highlightStyle.lineWidth || linkShape.highlightStyle.width; + linkShape.highlightStyle.strokeColor = linkShape.highlightStyle.strokeColor || linkShape.highlightStyle.color; + ecData.pack(linkShape, serie, serieIdx, gEdge.data, gEdge.rawIndex == null ? i : gEdge.rawIndex, gEdge.data.name || source.id + ' - ' + target.id, source.id, target.id); + this.shapeList.push(linkShape); + this.zr.addShape(linkShape); + gEdge.shape = linkShape; + if (serie.linkSymbol && serie.linkSymbol !== 'none') { + var symbolShape = new IconShape({ + style: { + x: -5, + y: 0, + width: serie.linkSymbolSize[0], + height: serie.linkSymbolSize[1], + iconType: serie.linkSymbol, + brushType: 'fill', + color: linkShape.style.strokeColor + }, + highlightStyle: { brushType: 'fill' }, + position: [ + 0, + 0 + ], + rotation: 0 + }); + linkShape._symbolShape = symbolShape; + this.shapeList.push(symbolShape); + this.zr.addShape(symbolShape); + } + } + }, + _updateLinkShapes: function () { + var v = vec2.create(); + var edges = this._graph.edges; + for (var i = 0, len = edges.length; i < len; i++) { + var edge = edges[i]; + var sourceShape = edge.node1.shape; + var targetShape = edge.node2.shape; + var p1 = sourceShape.position; + var p2 = targetShape.position; + edge.shape.style.xStart = p1[0]; + edge.shape.style.yStart = p1[1]; + edge.shape.style.xEnd = p2[0]; + edge.shape.style.yEnd = p2[1]; + if (edge.shape.type === 'bezier-curve') { + edge.shape.style.cpX1 = (p1[0] + p2[0]) / 2 - (p2[1] - p1[1]) / 4; + edge.shape.style.cpY1 = (p1[1] + p2[1]) / 2 - (p1[0] - p2[0]) / 4; + } + edge.shape.modSelf(); + if (edge.shape._symbolShape) { + var symbolShape = edge.shape._symbolShape; + vec2.copy(symbolShape.position, targetShape.position); + vec2.sub(v, sourceShape.position, targetShape.position); + vec2.normalize(v, v); + vec2.scaleAndAdd(symbolShape.position, symbolShape.position, v, targetShape.style.width / 2 + 2); + var angle = Math.atan2(v[1], v[0]); + symbolShape.rotation = Math.PI / 2 - angle; + symbolShape.modSelf(); + } + } + }, + _syncNodePositions: function () { + var graph = this._graph; + for (var i = 0; i < graph.nodes.length; i++) { + var gNode = graph.nodes[i]; + var position = gNode.layout.position; + var node = gNode.data; + var shape = gNode.shape; + var fixX = shape.fixed || node.fixX; + var fixY = shape.fixed || node.fixY; + if (fixX === true) { + fixX = 1; + } else if (isNaN(fixX)) { + fixX = 0; + } + if (fixY === true) { + fixY = 1; + } else if (isNaN(fixY)) { + fixY = 0; + } + shape.position[0] += (position[0] - shape.position[0]) * (1 - fixX); + shape.position[1] += (position[1] - shape.position[1]) * (1 - fixY); + vec2.copy(position, shape.position); + var nodeName = node.name; + if (nodeName) { + var gPos = this.__nodePositionMap[nodeName]; + if (!gPos) { + gPos = this.__nodePositionMap[nodeName] = vec2.create(); + } + vec2.copy(gPos, position); + } + shape.modSelf(); + } + }, + _step: function (e) { + this._syncNodePositions(); + this._updateLinkShapes(); + this.zr.refreshNextFrame(); + if (this._layout.temperature > 0.01) { + this._layout.step(this._steps); + } else { + this.messageCenter.dispatch(ecConfig.EVENT.FORCE_LAYOUT_END, {}, {}, this.myChart); + } + }, + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.series = this.option.series; + } + this.legend = this.component.legend; + if (this.legend) { + this.getColor = function (param) { + return this.legend.getColor(param); + }; + this.isSelected = function (param) { + return this.legend.isSelected(param); + }; + } else { + var colorMap = {}; + var count = 0; + this.getColor = function (key) { + if (colorMap[key]) { + return colorMap[key]; + } + if (!colorMap[key]) { + colorMap[key] = this.zr.getColor(count++); + } + return colorMap[key]; + }; + this.isSelected = function () { + return true; + }; + } + this._init(); + }, + dispose: function () { + this.clear(); + this.shapeList = null; + this.effectList = null; + this._layout.dispose(); + this._layout = null; + this.__nodePositionMap = {}; + }, + getPosition: function () { + var position = []; + this._graph.eachNode(function (n) { + if (n.layout) { + position.push({ + name: n.data.name, + position: Array.prototype.slice.call(n.layout.position) + }); + } + }); + return position; + } + }; + function ondragstart(param) { + if (!this.isDragstart || !param.target) { + return; + } + var shape = param.target; + shape.fixed = true; + this.isDragstart = false; + this.zr.on(zrConfig.EVENT.MOUSEMOVE, this.onmousemove); + } + function onmousemove() { + this._layout.temperature = 0.8; + this._step(); + } + function ondragend(param, status) { + if (!this.isDragend || !param.target) { + return; + } + var shape = param.target; + shape.fixed = false; + status.dragIn = true; + status.needRefresh = false; + this.isDragend = false; + this.zr.un(zrConfig.EVENT.MOUSEMOVE, this.onmousemove); + } + function _randomInSquare(x, y, size) { + var v = vec2.create(); + v[0] = (Math.random() - 0.5) * size + x; + v[1] = (Math.random() - 0.5) * size + y; + return v; + } + zrUtil.inherits(Force, ChartBase); + require('../chart').define('force', Force); + return Force; +});define('echarts/layout/Force', [ + 'require', + './forceLayoutWorker', + 'zrender/tool/vector' +], function (require) { + var ForceLayoutWorker = require('./forceLayoutWorker'); + var vec2 = require('zrender/tool/vector'); + var requestAnimationFrame = window.requestAnimationFrame || window.msRequestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || function (func) { + setTimeout(func, 16); + }; + var ArrayCtor = typeof Float32Array == 'undefined' ? Array : Float32Array; + var workerUrl; + function createWorkerUrl() { + if (typeof Worker !== 'undefined' && typeof Blob !== 'undefined') { + try { + var blob = new Blob([ForceLayoutWorker.getWorkerCode()]); + workerUrl = window.URL.createObjectURL(blob); + } catch (e) { + workerUrl = ''; + } + } + return workerUrl; + } + var ForceLayout = function (opts) { + if (typeof workerUrl === 'undefined') { + createWorkerUrl(); + } + opts = opts || {}; + this.width = opts.width || 500; + this.height = opts.height || 500; + this.center = opts.center || [ + this.width / 2, + this.height / 2 + ]; + this.ratioScaling = opts.ratioScaling || false; + this.scaling = opts.scaling || 1; + this.gravity = typeof opts.gravity !== 'undefined' ? opts.gravity : 1; + this.large = opts.large || false; + this.preventNodeOverlap = opts.preventNodeOverlap || false; + this.preventNodeEdgeOverlap = opts.preventNodeEdgeOverlap || false; + this.maxSpeedIncrease = opts.maxSpeedIncrease || 1; + this.onupdate = opts.onupdate || function () { + }; + this.temperature = opts.temperature || 1; + this.coolDown = opts.coolDown || 0.99; + this._layout = null; + this._layoutWorker = null; + var self = this; + var _$onupdate = this._$onupdate; + this._$onupdate = function (e) { + _$onupdate.call(self, e); + }; + }; + ForceLayout.prototype.updateConfig = function () { + var width = this.width; + var height = this.height; + var size = Math.min(width, height); + var config = { + center: this.center, + width: this.ratioScaling ? width : size, + height: this.ratioScaling ? height : size, + scaling: this.scaling || 1, + gravity: this.gravity || 1, + barnesHutOptimize: this.large, + preventNodeOverlap: this.preventNodeOverlap, + preventNodeEdgeOverlap: this.preventNodeEdgeOverlap, + maxSpeedIncrease: this.maxSpeedIncrease + }; + if (this._layoutWorker) { + this._layoutWorker.postMessage({ + cmd: 'updateConfig', + config: config + }); + } else { + for (var name in config) { + this._layout[name] = config[name]; + } + } + }; + ForceLayout.prototype.init = function (graph, useWorker) { + if (workerUrl && useWorker) { + try { + if (!this._layoutWorker) { + this._layoutWorker = new Worker(workerUrl); + this._layoutWorker.onmessage = this._$onupdate; + } + this._layout = null; + } catch (e) { + this._layoutWorker = null; + if (!this._layout) { + this._layout = new ForceLayoutWorker(); + } + } + } else { + if (!this._layout) { + this._layout = new ForceLayoutWorker(); + } + if (this._layoutWorker) { + this._layoutWorker.terminate(); + this._layoutWorker = null; + } + } + this.temperature = 1; + this.graph = graph; + var len = graph.nodes.length; + var positionArr = new ArrayCtor(len * 2); + var massArr = new ArrayCtor(len); + var sizeArr = new ArrayCtor(len); + for (var i = 0; i < len; i++) { + var n = graph.nodes[i]; + positionArr[i * 2] = n.layout.position[0]; + positionArr[i * 2 + 1] = n.layout.position[1]; + massArr[i] = typeof n.layout.mass === 'undefined' ? 1 : n.layout.mass; + sizeArr[i] = typeof n.layout.size === 'undefined' ? 1 : n.layout.size; + n.layout.__index = i; + } + len = graph.edges.length; + var edgeArr = new ArrayCtor(len * 2); + var edgeWeightArr = new ArrayCtor(len); + for (var i = 0; i < len; i++) { + var edge = graph.edges[i]; + edgeArr[i * 2] = edge.node1.layout.__index; + edgeArr[i * 2 + 1] = edge.node2.layout.__index; + edgeWeightArr[i] = edge.layout.weight || 1; + } + if (this._layoutWorker) { + this._layoutWorker.postMessage({ + cmd: 'init', + nodesPosition: positionArr, + nodesMass: massArr, + nodesSize: sizeArr, + edges: edgeArr, + edgesWeight: edgeWeightArr + }); + } else { + this._layout.initNodes(positionArr, massArr, sizeArr); + this._layout.initEdges(edgeArr, edgeWeightArr); + } + this.updateConfig(); + }; + ForceLayout.prototype.step = function (steps) { + var nodes = this.graph.nodes; + if (this._layoutWorker) { + var positionArr = new ArrayCtor(nodes.length * 2); + for (var i = 0; i < nodes.length; i++) { + var n = nodes[i]; + positionArr[i * 2] = n.layout.position[0]; + positionArr[i * 2 + 1] = n.layout.position[1]; + } + this._layoutWorker.postMessage(positionArr.buffer, [positionArr.buffer]); + this._layoutWorker.postMessage({ + cmd: 'update', + steps: steps, + temperature: this.temperature, + coolDown: this.coolDown + }); + for (var i = 0; i < steps; i++) { + this.temperature *= this.coolDown; + } + } else { + requestAnimationFrame(this._$onupdate); + for (var i = 0; i < nodes.length; i++) { + var n = nodes[i]; + vec2.copy(this._layout.nodes[i].position, n.layout.position); + } + for (var i = 0; i < steps; i++) { + this._layout.temperature = this.temperature; + this._layout.update(); + this.temperature *= this.coolDown; + } + } + }; + ForceLayout.prototype._$onupdate = function (e) { + if (this._layoutWorker) { + var positionArr = new Float32Array(e.data); + for (var i = 0; i < this.graph.nodes.length; i++) { + var n = this.graph.nodes[i]; + n.layout.position[0] = positionArr[i * 2]; + n.layout.position[1] = positionArr[i * 2 + 1]; + } + this.onupdate && this.onupdate(); + } else if (this._layout) { + for (var i = 0; i < this.graph.nodes.length; i++) { + var n = this.graph.nodes[i]; + vec2.copy(n.layout.position, this._layout.nodes[i].position); + } + this.onupdate && this.onupdate(); + } + }; + ForceLayout.prototype.dispose = function () { + if (this._layoutWorker) { + this._layoutWorker.terminate(); + } + this._layoutWorker = null; + this._layout = null; + }; + return ForceLayout; +});define('echarts/layout/forceLayoutWorker', [ + 'require', + 'zrender/tool/vector' +], function __echartsForceLayoutWorker(require) { + 'use strict'; + var vec2; + var inWorker = typeof window === 'undefined' && typeof require === 'undefined'; + if (inWorker) { + vec2 = { + create: function (x, y) { + var out = new Float32Array(2); + out[0] = x || 0; + out[1] = y || 0; + return out; + }, + dist: function (a, b) { + var x = b[0] - a[0]; + var y = b[1] - a[1]; + return Math.sqrt(x * x + y * y); + }, + len: function (a) { + var x = a[0]; + var y = a[1]; + return Math.sqrt(x * x + y * y); + }, + scaleAndAdd: function (out, a, b, scale) { + out[0] = a[0] + b[0] * scale; + out[1] = a[1] + b[1] * scale; + return out; + }, + scale: function (out, a, b) { + out[0] = a[0] * b; + out[1] = a[1] * b; + return out; + }, + add: function (out, a, b) { + out[0] = a[0] + b[0]; + out[1] = a[1] + b[1]; + return out; + }, + sub: function (out, a, b) { + out[0] = a[0] - b[0]; + out[1] = a[1] - b[1]; + return out; + }, + dot: function (v1, v2) { + return v1[0] * v2[0] + v1[1] * v2[1]; + }, + normalize: function (out, a) { + var x = a[0]; + var y = a[1]; + var len = x * x + y * y; + if (len > 0) { + len = 1 / Math.sqrt(len); + out[0] = a[0] * len; + out[1] = a[1] * len; + } + return out; + }, + negate: function (out, a) { + out[0] = -a[0]; + out[1] = -a[1]; + return out; + }, + copy: function (out, a) { + out[0] = a[0]; + out[1] = a[1]; + return out; + }, + set: function (out, x, y) { + out[0] = x; + out[1] = y; + return out; + } + }; + } else { + vec2 = require('zrender/tool/vector'); + } + var ArrayCtor = typeof Float32Array == 'undefined' ? Array : Float32Array; + function Region() { + this.subRegions = []; + this.nSubRegions = 0; + this.node = null; + this.mass = 0; + this.centerOfMass = null; + this.bbox = new ArrayCtor(4); + this.size = 0; + } + Region.prototype.beforeUpdate = function () { + for (var i = 0; i < this.nSubRegions; i++) { + this.subRegions[i].beforeUpdate(); + } + this.mass = 0; + if (this.centerOfMass) { + this.centerOfMass[0] = 0; + this.centerOfMass[1] = 0; + } + this.nSubRegions = 0; + this.node = null; + }; + Region.prototype.afterUpdate = function () { + this.subRegions.length = this.nSubRegions; + for (var i = 0; i < this.nSubRegions; i++) { + this.subRegions[i].afterUpdate(); + } + }; + Region.prototype.addNode = function (node) { + if (this.nSubRegions === 0) { + if (this.node == null) { + this.node = node; + return; + } else { + this._addNodeToSubRegion(this.node); + this.node = null; + } + } + this._addNodeToSubRegion(node); + this._updateCenterOfMass(node); + }; + Region.prototype.findSubRegion = function (x, y) { + for (var i = 0; i < this.nSubRegions; i++) { + var region = this.subRegions[i]; + if (region.contain(x, y)) { + return region; + } + } + }; + Region.prototype.contain = function (x, y) { + return this.bbox[0] <= x && this.bbox[2] >= x && this.bbox[1] <= y && this.bbox[3] >= y; + }; + Region.prototype.setBBox = function (minX, minY, maxX, maxY) { + this.bbox[0] = minX; + this.bbox[1] = minY; + this.bbox[2] = maxX; + this.bbox[3] = maxY; + this.size = (maxX - minX + maxY - minY) / 2; + }; + Region.prototype._newSubRegion = function () { + var subRegion = this.subRegions[this.nSubRegions]; + if (!subRegion) { + subRegion = new Region(); + this.subRegions[this.nSubRegions] = subRegion; + } + this.nSubRegions++; + return subRegion; + }; + Region.prototype._addNodeToSubRegion = function (node) { + var subRegion = this.findSubRegion(node.position[0], node.position[1]); + var bbox = this.bbox; + if (!subRegion) { + var cx = (bbox[0] + bbox[2]) / 2; + var cy = (bbox[1] + bbox[3]) / 2; + var w = (bbox[2] - bbox[0]) / 2; + var h = (bbox[3] - bbox[1]) / 2; + var xi = node.position[0] >= cx ? 1 : 0; + var yi = node.position[1] >= cy ? 1 : 0; + var subRegion = this._newSubRegion(); + subRegion.setBBox(xi * w + bbox[0], yi * h + bbox[1], (xi + 1) * w + bbox[0], (yi + 1) * h + bbox[1]); + } + subRegion.addNode(node); + }; + Region.prototype._updateCenterOfMass = function (node) { + if (this.centerOfMass == null) { + this.centerOfMass = vec2.create(); + } + var x = this.centerOfMass[0] * this.mass; + var y = this.centerOfMass[1] * this.mass; + x += node.position[0] * node.mass; + y += node.position[1] * node.mass; + this.mass += node.mass; + this.centerOfMass[0] = x / this.mass; + this.centerOfMass[1] = y / this.mass; + }; + function GraphNode() { + this.position = vec2.create(); + this.force = vec2.create(); + this.forcePrev = vec2.create(); + this.speed = vec2.create(); + this.speedPrev = vec2.create(); + this.mass = 1; + this.inDegree = 0; + this.outDegree = 0; + } + function GraphEdge(node1, node2) { + this.node1 = node1; + this.node2 = node2; + this.weight = 1; + } + function ForceLayout() { + this.barnesHutOptimize = false; + this.barnesHutTheta = 1.5; + this.repulsionByDegree = false; + this.preventNodeOverlap = false; + this.preventNodeEdgeOverlap = false; + this.strongGravity = true; + this.gravity = 1; + this.scaling = 1; + this.edgeWeightInfluence = 1; + this.center = [ + 0, + 0 + ]; + this.width = 500; + this.height = 500; + this.maxSpeedIncrease = 1; + this.nodes = []; + this.edges = []; + this.bbox = new ArrayCtor(4); + this._rootRegion = new Region(); + this._rootRegion.centerOfMass = vec2.create(); + this._massArr = null; + this._k = 0; + } + ForceLayout.prototype.nodeToNodeRepulsionFactor = function (mass, d, k) { + return k * k * mass / d; + }; + ForceLayout.prototype.edgeToNodeRepulsionFactor = function (mass, d, k) { + return k * mass / d; + }; + ForceLayout.prototype.attractionFactor = function (w, d, k) { + return w * d / k; + }; + ForceLayout.prototype.initNodes = function (positionArr, massArr, sizeArr) { + this.temperature = 1; + var nNodes = positionArr.length / 2; + this.nodes.length = 0; + var haveSize = typeof sizeArr !== 'undefined'; + for (var i = 0; i < nNodes; i++) { + var node = new GraphNode(); + node.position[0] = positionArr[i * 2]; + node.position[1] = positionArr[i * 2 + 1]; + node.mass = massArr[i]; + if (haveSize) { + node.size = sizeArr[i]; + } + this.nodes.push(node); + } + this._massArr = massArr; + if (haveSize) { + this._sizeArr = sizeArr; + } + }; + ForceLayout.prototype.initEdges = function (edgeArr, edgeWeightArr) { + var nEdges = edgeArr.length / 2; + this.edges.length = 0; + var edgeHaveWeight = typeof edgeWeightArr !== 'undefined'; + for (var i = 0; i < nEdges; i++) { + var sIdx = edgeArr[i * 2]; + var tIdx = edgeArr[i * 2 + 1]; + var sNode = this.nodes[sIdx]; + var tNode = this.nodes[tIdx]; + if (!sNode || !tNode) { + continue; + } + sNode.outDegree++; + tNode.inDegree++; + var edge = new GraphEdge(sNode, tNode); + if (edgeHaveWeight) { + edge.weight = edgeWeightArr[i]; + } + this.edges.push(edge); + } + }; + ForceLayout.prototype.update = function () { + var nNodes = this.nodes.length; + this.updateBBox(); + this._k = 0.4 * this.scaling * Math.sqrt(this.width * this.height / nNodes); + if (this.barnesHutOptimize) { + this._rootRegion.setBBox(this.bbox[0], this.bbox[1], this.bbox[2], this.bbox[3]); + this._rootRegion.beforeUpdate(); + for (var i = 0; i < nNodes; i++) { + this._rootRegion.addNode(this.nodes[i]); + } + this._rootRegion.afterUpdate(); + } else { + var mass = 0; + var centerOfMass = this._rootRegion.centerOfMass; + vec2.set(centerOfMass, 0, 0); + for (var i = 0; i < nNodes; i++) { + var node = this.nodes[i]; + mass += node.mass; + vec2.scaleAndAdd(centerOfMass, centerOfMass, node.position, node.mass); + } + if (mass > 0) { + vec2.scale(centerOfMass, centerOfMass, 1 / mass); + } + } + this.updateForce(); + this.updatePosition(); + }; + ForceLayout.prototype.updateForce = function () { + var nNodes = this.nodes.length; + for (var i = 0; i < nNodes; i++) { + var node = this.nodes[i]; + vec2.copy(node.forcePrev, node.force); + vec2.copy(node.speedPrev, node.speed); + vec2.set(node.force, 0, 0); + } + this.updateNodeNodeForce(); + if (this.gravity > 0) { + this.updateGravityForce(); + } + this.updateEdgeForce(); + if (this.preventNodeEdgeOverlap) { + this.updateNodeEdgeForce(); + } + }; + ForceLayout.prototype.updatePosition = function () { + var nNodes = this.nodes.length; + var v = vec2.create(); + for (var i = 0; i < nNodes; i++) { + var node = this.nodes[i]; + var speed = node.speed; + vec2.scale(node.force, node.force, 1 / 30); + var df = vec2.len(node.force) + 0.1; + var scale = Math.min(df, 500) / df; + vec2.scale(node.force, node.force, scale); + vec2.add(speed, speed, node.force); + vec2.scale(speed, speed, this.temperature); + vec2.sub(v, speed, node.speedPrev); + var swing = vec2.len(v); + if (swing > 0) { + vec2.scale(v, v, 1 / swing); + var base = vec2.len(node.speedPrev); + if (base > 0) { + swing = Math.min(swing / base, this.maxSpeedIncrease) * base; + vec2.scaleAndAdd(speed, node.speedPrev, v, swing); + } + } + var ds = vec2.len(speed); + var scale = Math.min(ds, 100) / (ds + 0.1); + vec2.scale(speed, speed, scale); + vec2.add(node.position, node.position, speed); + } + }; + ForceLayout.prototype.updateNodeNodeForce = function () { + var nNodes = this.nodes.length; + for (var i = 0; i < nNodes; i++) { + var na = this.nodes[i]; + if (this.barnesHutOptimize) { + this.applyRegionToNodeRepulsion(this._rootRegion, na); + } else { + for (var j = i + 1; j < nNodes; j++) { + var nb = this.nodes[j]; + this.applyNodeToNodeRepulsion(na, nb, false); + } + } + } + }; + ForceLayout.prototype.updateGravityForce = function () { + for (var i = 0; i < this.nodes.length; i++) { + this.applyNodeGravity(this.nodes[i]); + } + }; + ForceLayout.prototype.updateEdgeForce = function () { + for (var i = 0; i < this.edges.length; i++) { + this.applyEdgeAttraction(this.edges[i]); + } + }; + ForceLayout.prototype.updateNodeEdgeForce = function () { + for (var i = 0; i < this.nodes.length; i++) { + for (var j = 0; j < this.edges.length; j++) { + this.applyEdgeToNodeRepulsion(this.edges[j], this.nodes[i]); + } + } + }; + ForceLayout.prototype.applyRegionToNodeRepulsion = function () { + var v = vec2.create(); + return function applyRegionToNodeRepulsion(region, node) { + if (region.node) { + this.applyNodeToNodeRepulsion(region.node, node, true); + } else { + if (region.mass === 0 && node.mass === 0) { + return; + } + vec2.sub(v, node.position, region.centerOfMass); + var d2 = v[0] * v[0] + v[1] * v[1]; + if (d2 > this.barnesHutTheta * region.size * region.size) { + var factor = this._k * this._k * (node.mass + region.mass) / (d2 + 1); + vec2.scaleAndAdd(node.force, node.force, v, factor * 2); + } else { + for (var i = 0; i < region.nSubRegions; i++) { + this.applyRegionToNodeRepulsion(region.subRegions[i], node); + } + } + } + }; + }(); + ForceLayout.prototype.applyNodeToNodeRepulsion = function () { + var v = vec2.create(); + return function applyNodeToNodeRepulsion(na, nb, oneWay) { + if (na === nb) { + return; + } + if (na.mass === 0 && nb.mass === 0) { + return; + } + vec2.sub(v, na.position, nb.position); + var d2 = v[0] * v[0] + v[1] * v[1]; + if (d2 === 0) { + return; + } + var factor; + var mass = na.mass + nb.mass; + var d = Math.sqrt(d2); + vec2.scale(v, v, 1 / d); + if (this.preventNodeOverlap) { + d = d - na.size - nb.size; + if (d > 0) { + factor = this.nodeToNodeRepulsionFactor(mass, d, this._k); + } else if (d <= 0) { + factor = this._k * this._k * 10 * mass; + } + } else { + factor = this.nodeToNodeRepulsionFactor(mass, d, this._k); + } + if (!oneWay) { + vec2.scaleAndAdd(na.force, na.force, v, factor * 2); + } + vec2.scaleAndAdd(nb.force, nb.force, v, -factor * 2); + }; + }(); + ForceLayout.prototype.applyEdgeAttraction = function () { + var v = vec2.create(); + return function applyEdgeAttraction(edge) { + var na = edge.node1; + var nb = edge.node2; + vec2.sub(v, na.position, nb.position); + var d = vec2.len(v); + var w; + if (this.edgeWeightInfluence === 0) { + w = 1; + } else if (this.edgeWeightInfluence == 1) { + w = edge.weight; + } else { + w = Math.pow(edge.weight, this.edgeWeightInfluence); + } + var factor; + if (this.preventOverlap) { + d = d - na.size - nb.size; + if (d <= 0) { + return; + } + } + var factor = this.attractionFactor(w, d, this._k); + vec2.scaleAndAdd(na.force, na.force, v, -factor); + vec2.scaleAndAdd(nb.force, nb.force, v, factor); + }; + }(); + ForceLayout.prototype.applyNodeGravity = function () { + var v = vec2.create(); + return function (node) { + vec2.sub(v, this.center, node.position); + if (this.width > this.height) { + v[1] *= this.width / this.height; + } else { + v[0] *= this.height / this.width; + } + var d = vec2.len(v) / 100; + if (this.strongGravity) { + vec2.scaleAndAdd(node.force, node.force, v, d * this.gravity * node.mass); + } else { + vec2.scaleAndAdd(node.force, node.force, v, this.gravity * node.mass / (d + 1)); + } + }; + }(); + ForceLayout.prototype.applyEdgeToNodeRepulsion = function () { + var v12 = vec2.create(); + var v13 = vec2.create(); + var p = vec2.create(); + return function (e, n3) { + var n1 = e.node1; + var n2 = e.node2; + if (n1 === n3 || n2 === n3) { + return; + } + vec2.sub(v12, n2.position, n1.position); + vec2.sub(v13, n3.position, n1.position); + var len12 = vec2.len(v12); + vec2.scale(v12, v12, 1 / len12); + var len = vec2.dot(v12, v13); + if (len < 0 || len > len12) { + return; + } + vec2.scaleAndAdd(p, n1.position, v12, len); + var dist = vec2.dist(p, n3.position) - n3.size; + var factor = this.edgeToNodeRepulsionFactor(n3.mass, Math.max(dist, 0.1), 100); + vec2.sub(v12, n3.position, p); + vec2.normalize(v12, v12); + vec2.scaleAndAdd(n3.force, n3.force, v12, factor); + vec2.scaleAndAdd(n1.force, n1.force, v12, -factor); + vec2.scaleAndAdd(n2.force, n2.force, v12, -factor); + }; + }(); + ForceLayout.prototype.updateBBox = function () { + var minX = Infinity; + var minY = Infinity; + var maxX = -Infinity; + var maxY = -Infinity; + for (var i = 0; i < this.nodes.length; i++) { + var pos = this.nodes[i].position; + minX = Math.min(minX, pos[0]); + minY = Math.min(minY, pos[1]); + maxX = Math.max(maxX, pos[0]); + maxY = Math.max(maxY, pos[1]); + } + this.bbox[0] = minX; + this.bbox[1] = minY; + this.bbox[2] = maxX; + this.bbox[3] = maxY; + }; + ForceLayout.getWorkerCode = function () { + var str = __echartsForceLayoutWorker.toString(); + return str.slice(str.indexOf('{') + 1, str.lastIndexOf('return')); + }; + if (inWorker) { + var forceLayout = null; + self.onmessage = function (e) { + if (e.data instanceof ArrayBuffer) { + if (!forceLayout) + return; + var positionArr = new Float32Array(e.data); + var nNodes = positionArr.length / 2; + for (var i = 0; i < nNodes; i++) { + var node = forceLayout.nodes[i]; + node.position[0] = positionArr[i * 2]; + node.position[1] = positionArr[i * 2 + 1]; + } + return; + } + switch (e.data.cmd) { + case 'init': + if (!forceLayout) { + forceLayout = new ForceLayout(); + } + forceLayout.initNodes(e.data.nodesPosition, e.data.nodesMass, e.data.nodesSize); + forceLayout.initEdges(e.data.edges, e.data.edgesWeight); + break; + case 'updateConfig': + if (forceLayout) { + for (var name in e.data.config) { + forceLayout[name] = e.data.config[name]; + } + } + break; + case 'update': + var steps = e.data.steps; + if (forceLayout) { + var nNodes = forceLayout.nodes.length; + var positionArr = new Float32Array(nNodes * 2); + forceLayout.temperature = e.data.temperature; + for (var i = 0; i < steps; i++) { + forceLayout.update(); + forceLayout.temperature *= e.data.coolDown; + } + for (var i = 0; i < nNodes; i++) { + var node = forceLayout.nodes[i]; + positionArr[i * 2] = node.position[0]; + positionArr[i * 2 + 1] = node.position[1]; + } + self.postMessage(positionArr.buffer, [positionArr.buffer]); + } else { + var emptyArr = new Float32Array(); + self.postMessage(emptyArr.buffer, [emptyArr.buffer]); + } + break; + } + }; + } + return ForceLayout; +});define('echarts/chart/map', [ + 'require', + './base', + 'zrender/shape/Text', + 'zrender/shape/Path', + 'zrender/shape/Circle', + 'zrender/shape/Rectangle', + 'zrender/shape/Line', + 'zrender/shape/Polygon', + 'zrender/shape/Ellipse', + '../component/dataRange', + '../component/roamController', + '../config', + '../util/ecData', + 'zrender/tool/util', + 'zrender/config', + 'zrender/tool/event', + '../util/mapData/params', + '../util/mapData/textFixed', + '../util/mapData/geoCoord', + '../util/projection/svg', + '../util/projection/normal', + '../chart' +], function (require) { + var ChartBase = require('./base'); + var TextShape = require('zrender/shape/Text'); + var PathShape = require('zrender/shape/Path'); + var CircleShape = require('zrender/shape/Circle'); + var RectangleShape = require('zrender/shape/Rectangle'); + var LineShape = require('zrender/shape/Line'); + var PolygonShape = require('zrender/shape/Polygon'); + var EllipseShape = require('zrender/shape/Ellipse'); + require('../component/dataRange'); + require('../component/roamController'); + var ecConfig = require('../config'); + ecConfig.map = { + zlevel: 0, + z: 2, + mapType: 'china', + mapValuePrecision: 0, + showLegendSymbol: true, + dataRangeHoverLink: true, + hoverable: true, + clickable: true, + itemStyle: { + normal: { + borderColor: 'rgba(0,0,0,0)', + borderWidth: 1, + areaStyle: { color: '#ccc' }, + label: { + show: false, + textStyle: { color: 'rgb(139,69,19)' } + } + }, + emphasis: { + borderColor: 'rgba(0,0,0,0)', + borderWidth: 1, + areaStyle: { color: 'rgba(255,215,0,0.8)' }, + label: { + show: false, + textStyle: { color: 'rgb(100,0,0)' } + } + } + } + }; + var ecData = require('../util/ecData'); + var zrUtil = require('zrender/tool/util'); + var zrConfig = require('zrender/config'); + var zrEvent = require('zrender/tool/event'); + var _mapParams = require('../util/mapData/params').params; + var _textFixed = require('../util/mapData/textFixed'); + var _geoCoord = require('../util/mapData/geoCoord'); + function Map(ecTheme, messageCenter, zr, option, myChart) { + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); + var self = this; + self._onmousewheel = function (params) { + return self.__onmousewheel(params); + }; + self._onmousedown = function (params) { + return self.__onmousedown(params); + }; + self._onmousemove = function (params) { + return self.__onmousemove(params); + }; + self._onmouseup = function (params) { + return self.__onmouseup(params); + }; + self._onroamcontroller = function (params) { + return self.__onroamcontroller(params); + }; + self._ondrhoverlink = function (params) { + return self.__ondrhoverlink(params); + }; + this._isAlive = true; + this._selectedMode = {}; + this._activeMapType = {}; + this._clickable = {}; + this._hoverable = {}; + this._showLegendSymbol = {}; + this._selected = {}; + this._mapTypeMap = {}; + this._mapDataMap = {}; + this._nameMap = {}; + this._specialArea = {}; + this._refreshDelayTicket; + this._mapDataRequireCounter; + this._markAnimation = false; + this._hoverLinkMap = {}; + this._roamMap = {}; + this._scaleLimitMap = {}; + this._mx; + this._my; + this._mousedown; + this._justMove; + this._curMapType; + this.refresh(option); + this.zr.on(zrConfig.EVENT.MOUSEWHEEL, this._onmousewheel); + this.zr.on(zrConfig.EVENT.MOUSEDOWN, this._onmousedown); + messageCenter.bind(ecConfig.EVENT.ROAMCONTROLLER, this._onroamcontroller); + messageCenter.bind(ecConfig.EVENT.DATA_RANGE_HOVERLINK, this._ondrhoverlink); + } + Map.prototype = { + type: ecConfig.CHART_TYPE_MAP, + _buildShape: function () { + var series = this.series; + this.selectedMap = {}; + this._activeMapType = {}; + var legend = this.component.legend; + var seriesName; + var valueData = {}; + var mapType; + var data; + var name; + var mapSeries = {}; + var mapValuePrecision = {}; + var valueCalculation = {}; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type == ecConfig.CHART_TYPE_MAP) { + series[i] = this.reformOption(series[i]); + mapType = series[i].mapType; + mapSeries[mapType] = mapSeries[mapType] || {}; + mapSeries[mapType][i] = true; + mapValuePrecision[mapType] = mapValuePrecision[mapType] || series[i].mapValuePrecision; + this._scaleLimitMap[mapType] = this._scaleLimitMap[mapType] || {}; + series[i].scaleLimit && zrUtil.merge(this._scaleLimitMap[mapType], series[i].scaleLimit, true); + this._roamMap[mapType] = series[i].roam || this._roamMap[mapType]; + this._hoverLinkMap[mapType] = series[i].dataRangeHoverLink || this._hoverLinkMap[mapType]; + this._nameMap[mapType] = this._nameMap[mapType] || {}; + series[i].nameMap && zrUtil.merge(this._nameMap[mapType], series[i].nameMap, true); + this._activeMapType[mapType] = true; + if (series[i].textFixed) { + zrUtil.merge(_textFixed, series[i].textFixed, true); + } + if (series[i].geoCoord) { + zrUtil.merge(_geoCoord, series[i].geoCoord, true); + } + this._selectedMode[mapType] = this._selectedMode[mapType] || series[i].selectedMode; + if (this._hoverable[mapType] == null || this._hoverable[mapType]) { + this._hoverable[mapType] = series[i].hoverable; + } + if (this._clickable[mapType] == null || this._clickable[mapType]) { + this._clickable[mapType] = series[i].clickable; + } + if (this._showLegendSymbol[mapType] == null || this._showLegendSymbol[mapType]) { + this._showLegendSymbol[mapType] = series[i].showLegendSymbol; + } + valueCalculation[mapType] = valueCalculation[mapType] || series[i].mapValueCalculation; + seriesName = series[i].name; + this.selectedMap[seriesName] = legend ? legend.isSelected(seriesName) : true; + if (this.selectedMap[seriesName]) { + valueData[mapType] = valueData[mapType] || {}; + data = series[i].data; + for (var j = 0, k = data.length; j < k; j++) { + name = this._nameChange(mapType, data[j].name); + valueData[mapType][name] = valueData[mapType][name] || { seriesIndex: [] }; + for (var key in data[j]) { + if (key != 'value') { + valueData[mapType][name][key] = data[j][key]; + } else if (!isNaN(data[j].value)) { + valueData[mapType][name].value == null && (valueData[mapType][name].value = 0); + valueData[mapType][name].value += data[j].value; + } + } + valueData[mapType][name].seriesIndex.push(i); + } + } + } + } + this._mapDataRequireCounter = 0; + for (var mt in valueData) { + this._mapDataRequireCounter++; + } + this._clearSelected(); + if (this._mapDataRequireCounter === 0) { + this.clear(); + this.zr && this.zr.delShape(this.lastShapeList); + this.lastShapeList = []; + } + for (var mt in valueData) { + if (valueCalculation[mt] && valueCalculation[mt] == 'average') { + for (var k in valueData[mt]) { + valueData[mt][k].value = (valueData[mt][k].value / valueData[mt][k].seriesIndex.length).toFixed(mapValuePrecision[mt]) - 0; + } + } + this._mapDataMap[mt] = this._mapDataMap[mt] || {}; + if (this._mapDataMap[mt].mapData) { + this._mapDataCallback(mt, valueData[mt], mapSeries[mt])(this._mapDataMap[mt].mapData); + } else if (_mapParams[mt.replace(/\|.*/, '')].getGeoJson) { + this._specialArea[mt] = _mapParams[mt.replace(/\|.*/, '')].specialArea || this._specialArea[mt]; + _mapParams[mt.replace(/\|.*/, '')].getGeoJson(this._mapDataCallback(mt, valueData[mt], mapSeries[mt])); + } + } + }, + _mapDataCallback: function (mt, vd, ms) { + var self = this; + return function (md) { + if (!self._isAlive || self._activeMapType[mt] == null) { + return; + } + if (mt.indexOf('|') != -1) { + md = self._getSubMapData(mt, md); + } + self._mapDataMap[mt].mapData = md; + if (md.firstChild) { + self._mapDataMap[mt].rate = 1; + self._mapDataMap[mt].projection = require('../util/projection/svg'); + } else { + self._mapDataMap[mt].rate = 0.75; + self._mapDataMap[mt].projection = require('../util/projection/normal'); + } + self._buildMap(mt, self._getProjectionData(mt, md, ms), vd, ms); + self._buildMark(mt, ms); + if (--self._mapDataRequireCounter <= 0) { + self.addShapeList(); + self.zr.refreshNextFrame(); + } + }; + }, + _clearSelected: function () { + for (var k in this._selected) { + if (!this._activeMapType[this._mapTypeMap[k]]) { + delete this._selected[k]; + delete this._mapTypeMap[k]; + } + } + }, + _getSubMapData: function (mapType, mapData) { + var subType = mapType.replace(/^.*\|/, ''); + var features = mapData.features; + for (var i = 0, l = features.length; i < l; i++) { + if (features[i].properties && features[i].properties.name == subType) { + features = features[i]; + if (subType == 'United States of America' && features.geometry.coordinates.length > 1) { + features = { + geometry: { + coordinates: features.geometry.coordinates.slice(5, 6), + type: features.geometry.type + }, + id: features.id, + properties: features.properties, + type: features.type + }; + } + break; + } + } + return { + 'type': 'FeatureCollection', + 'features': [features] + }; + }, + _getProjectionData: function (mapType, mapData, mapSeries) { + var normalProjection = this._mapDataMap[mapType].projection; + var province = []; + var bbox = this._mapDataMap[mapType].bbox || normalProjection.getBbox(mapData, this._specialArea[mapType]); + var transform; + if (!this._mapDataMap[mapType].hasRoam) { + transform = this._getTransform(bbox, mapSeries, this._mapDataMap[mapType].rate); + } else { + transform = this._mapDataMap[mapType].transform; + } + var lastTransform = this._mapDataMap[mapType].lastTransform || { scale: {} }; + var pathArray; + if (transform.left != lastTransform.left || transform.top != lastTransform.top || transform.scale.x != lastTransform.scale.x || transform.scale.y != lastTransform.scale.y) { + pathArray = normalProjection.geoJson2Path(mapData, transform, this._specialArea[mapType]); + lastTransform = zrUtil.clone(transform); + } else { + transform = this._mapDataMap[mapType].transform; + pathArray = this._mapDataMap[mapType].pathArray; + } + this._mapDataMap[mapType].bbox = bbox; + this._mapDataMap[mapType].transform = transform; + this._mapDataMap[mapType].lastTransform = lastTransform; + this._mapDataMap[mapType].pathArray = pathArray; + var position = [ + transform.left, + transform.top + ]; + for (var i = 0, l = pathArray.length; i < l; i++) { + province.push(this._getSingleProvince(mapType, pathArray[i], position)); + } + if (this._specialArea[mapType]) { + for (var area in this._specialArea[mapType]) { + province.push(this._getSpecialProjectionData(mapType, mapData, area, this._specialArea[mapType][area], position)); + } + } + if (mapType == 'china') { + var leftTop = this.geo2pos(mapType, _geoCoord['南海诸岛'] || _mapParams['南海诸岛'].textCoord); + var scale = transform.scale.x / 10.5; + var textPosition = [ + 32 * scale + leftTop[0], + 83 * scale + leftTop[1] + ]; + if (_textFixed['南海诸岛']) { + textPosition[0] += _textFixed['南海诸岛'][0]; + textPosition[1] += _textFixed['南海诸岛'][1]; + } + province.push({ + name: this._nameChange(mapType, '南海诸岛'), + path: _mapParams['南海诸岛'].getPath(leftTop, scale), + position: position, + textX: textPosition[0], + textY: textPosition[1] + }); + } + return province; + }, + _getSpecialProjectionData: function (mapType, mapData, areaName, mapSize, position) { + mapData = this._getSubMapData('x|' + areaName, mapData); + var normalProjection = require('../util/projection/normal'); + var bbox = normalProjection.getBbox(mapData); + var leftTop = this.geo2pos(mapType, [ + mapSize.left, + mapSize.top + ]); + var rightBottom = this.geo2pos(mapType, [ + mapSize.left + mapSize.width, + mapSize.top + mapSize.height + ]); + var width = Math.abs(rightBottom[0] - leftTop[0]); + var height = Math.abs(rightBottom[1] - leftTop[1]); + var mapWidth = bbox.width; + var mapHeight = bbox.height; + var xScale = width / 0.75 / mapWidth; + var yScale = height / mapHeight; + if (xScale > yScale) { + xScale = yScale * 0.75; + width = mapWidth * xScale; + } else { + yScale = xScale; + xScale = yScale * 0.75; + height = mapHeight * yScale; + } + var transform = { + OffsetLeft: leftTop[0], + OffsetTop: leftTop[1], + scale: { + x: xScale, + y: yScale + } + }; + var pathArray = normalProjection.geoJson2Path(mapData, transform); + return this._getSingleProvince(mapType, pathArray[0], position); + }, + _getSingleProvince: function (mapType, path, position) { + var textPosition; + var name = path.properties.name; + var textFixed = _textFixed[name] || [ + 0, + 0 + ]; + if (_geoCoord[name]) { + textPosition = this.geo2pos(mapType, _geoCoord[name]); + } else if (path.cp) { + textPosition = [ + path.cp[0] + textFixed[0], + path.cp[1] + textFixed[1] + ]; + } else { + var bbox = this._mapDataMap[mapType].bbox; + textPosition = this.geo2pos(mapType, [ + bbox.left + bbox.width / 2, + bbox.top + bbox.height / 2 + ]); + textPosition[0] += textFixed[0]; + textPosition[1] += textFixed[1]; + } + path.name = this._nameChange(mapType, name); + path.position = position; + path.textX = textPosition[0]; + path.textY = textPosition[1]; + return path; + }, + _getTransform: function (bbox, mapSeries, rate) { + var series = this.series; + var mapLocation; + var x; + var cusX; + var y; + var cusY; + var width; + var height; + var zrWidth = this.zr.getWidth(); + var zrHeight = this.zr.getHeight(); + var padding = Math.round(Math.min(zrWidth, zrHeight) * 0.02); + for (var key in mapSeries) { + mapLocation = series[key].mapLocation || {}; + cusX = mapLocation.x || cusX; + cusY = mapLocation.y || cusY; + width = mapLocation.width || width; + height = mapLocation.height || height; + } + x = this.parsePercent(cusX, zrWidth); + x = isNaN(x) ? padding : x; + y = this.parsePercent(cusY, zrHeight); + y = isNaN(y) ? padding : y; + width = width == null ? zrWidth - x - 2 * padding : this.parsePercent(width, zrWidth); + height = height == null ? zrHeight - y - 2 * padding : this.parsePercent(height, zrHeight); + var mapWidth = bbox.width; + var mapHeight = bbox.height; + var xScale = width / rate / mapWidth; + var yScale = height / mapHeight; + if (xScale > yScale) { + xScale = yScale * rate; + width = mapWidth * xScale; + } else { + yScale = xScale; + xScale = yScale * rate; + height = mapHeight * yScale; + } + if (isNaN(cusX)) { + cusX = cusX || 'center'; + switch (cusX + '') { + case 'center': + x = Math.floor((zrWidth - width) / 2); + break; + case 'right': + x = zrWidth - width; + break; + } + } + if (isNaN(cusY)) { + cusY = cusY || 'center'; + switch (cusY + '') { + case 'center': + y = Math.floor((zrHeight - height) / 2); + break; + case 'bottom': + y = zrHeight - height; + break; + } + } + return { + left: x, + top: y, + width: width, + height: height, + baseScale: 1, + scale: { + x: xScale, + y: yScale + } + }; + }, + _buildMap: function (mapType, mapData, valueData, mapSeries) { + var series = this.series; + var legend = this.component.legend; + var dataRange = this.component.dataRange; + var seriesName; + var name; + var data; + var value; + var queryTarget; + var color; + var font; + var style; + var highlightStyle; + var shape; + var textShape; + for (var i = 0, l = mapData.length; i < l; i++) { + style = zrUtil.clone(mapData[i]); + highlightStyle = { + name: style.name, + path: style.path, + position: zrUtil.clone(style.position) + }; + name = style.name; + data = valueData[name]; + if (data) { + queryTarget = [data]; + seriesName = ''; + for (var j = 0, k = data.seriesIndex.length; j < k; j++) { + queryTarget.push(series[data.seriesIndex[j]]); + seriesName += series[data.seriesIndex[j]].name + ' '; + if (legend && this._showLegendSymbol[mapType] && legend.hasColor(series[data.seriesIndex[j]].name)) { + this.shapeList.push(new CircleShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + position: zrUtil.clone(style.position), + _mapType: mapType, + style: { + x: style.textX + 3 + j * 7, + y: style.textY - 10, + r: 3, + color: legend.getColor(series[data.seriesIndex[j]].name) + }, + hoverable: false + })); + } + } + value = data.value; + } else { + data = '-'; + seriesName = ''; + queryTarget = []; + for (var key in mapSeries) { + queryTarget.push(series[key]); + } + value = '-'; + } + this.ecTheme.map && queryTarget.push(this.ecTheme.map); + queryTarget.push(ecConfig); + color = dataRange && !isNaN(value) ? dataRange.getColor(value) : null; + style.color = style.color || color || this.getItemStyleColor(this.deepQuery(queryTarget, 'itemStyle.normal.color'), data.seriesIndex, -1, data) || this.deepQuery(queryTarget, 'itemStyle.normal.areaStyle.color'); + style.strokeColor = style.strokeColor || this.deepQuery(queryTarget, 'itemStyle.normal.borderColor'); + style.lineWidth = style.lineWidth || this.deepQuery(queryTarget, 'itemStyle.normal.borderWidth'); + highlightStyle.color = this.getItemStyleColor(this.deepQuery(queryTarget, 'itemStyle.emphasis.color'), data.seriesIndex, -1, data) || this.deepQuery(queryTarget, 'itemStyle.emphasis.areaStyle.color') || style.color; + highlightStyle.strokeColor = this.deepQuery(queryTarget, 'itemStyle.emphasis.borderColor') || style.strokeColor; + highlightStyle.lineWidth = this.deepQuery(queryTarget, 'itemStyle.emphasis.borderWidth') || style.lineWidth; + style.brushType = highlightStyle.brushType = style.brushType || 'both'; + style.lineJoin = highlightStyle.lineJoin = 'round'; + style._name = highlightStyle._name = name; + font = this.deepQuery(queryTarget, 'itemStyle.normal.label.textStyle'); + textShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + position: zrUtil.clone(style.position), + _mapType: mapType, + _geo: this.pos2geo(mapType, [ + style.textX, + style.textY + ]), + style: { + brushType: 'fill', + x: style.textX, + y: style.textY, + text: this.getLabelText(name, value, queryTarget, 'normal'), + _name: name, + textAlign: 'center', + color: this.deepQuery(queryTarget, 'itemStyle.normal.label.show') ? this.deepQuery(queryTarget, 'itemStyle.normal.label.textStyle.color') : 'rgba(0,0,0,0)', + textFont: this.getFont(font) + } + }; + textShape._style = zrUtil.clone(textShape.style); + textShape.highlightStyle = zrUtil.clone(textShape.style); + if (this.deepQuery(queryTarget, 'itemStyle.emphasis.label.show')) { + textShape.highlightStyle.text = this.getLabelText(name, value, queryTarget, 'emphasis'); + textShape.highlightStyle.color = this.deepQuery(queryTarget, 'itemStyle.emphasis.label.textStyle.color') || textShape.style.color; + font = this.deepQuery(queryTarget, 'itemStyle.emphasis.label.textStyle') || font; + textShape.highlightStyle.textFont = this.getFont(font); + } else { + textShape.highlightStyle.color = 'rgba(0,0,0,0)'; + } + shape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + position: zrUtil.clone(style.position), + style: style, + highlightStyle: highlightStyle, + _style: zrUtil.clone(style), + _mapType: mapType + }; + if (style.scale != null) { + shape.scale = zrUtil.clone(style.scale); + } + textShape = new TextShape(textShape); + switch (shape.style.shapeType) { + case 'rectangle': + shape = new RectangleShape(shape); + break; + case 'line': + shape = new LineShape(shape); + break; + case 'circle': + shape = new CircleShape(shape); + break; + case 'polygon': + shape = new PolygonShape(shape); + break; + case 'ellipse': + shape = new EllipseShape(shape); + break; + default: + shape = new PathShape(shape); + if (shape.buildPathArray) { + shape.style.pathArray = shape.buildPathArray(shape.style.path); + } + break; + } + if (this._selectedMode[mapType] && this._selected[name] || data.selected && this._selected[name] !== false) { + textShape.style = textShape.highlightStyle; + shape.style = shape.highlightStyle; + } + textShape.clickable = shape.clickable = this._clickable[mapType] && (data.clickable == null || data.clickable); + if (this._selectedMode[mapType]) { + this._selected[name] = this._selected[name] != null ? this._selected[name] : data.selected; + this._mapTypeMap[name] = mapType; + if (data.selectable == null || data.selectable) { + shape.clickable = textShape.clickable = true; + shape.onclick = textShape.onclick = this.shapeHandler.onclick; + } + } + if (this._hoverable[mapType] && (data.hoverable == null || data.hoverable)) { + textShape.hoverable = shape.hoverable = true; + shape.hoverConnect = textShape.id; + textShape.hoverConnect = shape.id; + } else { + textShape.hoverable = shape.hoverable = false; + } + ecData.pack(textShape, { + name: seriesName, + tooltip: this.deepQuery(queryTarget, 'tooltip') + }, 0, data, 0, name); + this.shapeList.push(textShape); + ecData.pack(shape, { + name: seriesName, + tooltip: this.deepQuery(queryTarget, 'tooltip') + }, 0, data, 0, name); + this.shapeList.push(shape); + } + }, + _buildMark: function (mapType, mapSeries) { + this._seriesIndexToMapType = this._seriesIndexToMapType || {}; + this.markAttachStyle = this.markAttachStyle || {}; + var position = [ + this._mapDataMap[mapType].transform.left, + this._mapDataMap[mapType].transform.top + ]; + if (mapType == 'none') { + position = [ + 0, + 0 + ]; + } + for (var sIdx in mapSeries) { + this._seriesIndexToMapType[sIdx] = mapType; + this.markAttachStyle[sIdx] = { + position: position, + _mapType: mapType + }; + this.buildMark(sIdx); + } + }, + getMarkCoord: function (seriesIndex, mpData) { + return mpData.geoCoord || _geoCoord[mpData.name] ? this.geo2pos(this._seriesIndexToMapType[seriesIndex], mpData.geoCoord || _geoCoord[mpData.name]) : [ + 0, + 0 + ]; + }, + getMarkGeo: function (mpData) { + return mpData.geoCoord || _geoCoord[mpData.name]; + }, + _nameChange: function (mapType, name) { + return this._nameMap[mapType][name] || name; + }, + getLabelText: function (name, value, queryTarget, status) { + var formatter = this.deepQuery(queryTarget, 'itemStyle.' + status + '.label.formatter'); + if (formatter) { + if (typeof formatter == 'function') { + return formatter.call(this.myChart, name, value); + } else if (typeof formatter == 'string') { + formatter = formatter.replace('{a}', '{a0}').replace('{b}', '{b0}'); + formatter = formatter.replace('{a0}', name).replace('{b0}', value); + return formatter; + } + } else { + return name; + } + }, + _findMapTypeByPos: function (mx, my) { + var transform; + var left; + var top; + var width; + var height; + for (var mapType in this._mapDataMap) { + transform = this._mapDataMap[mapType].transform; + if (!transform || !this._roamMap[mapType] || !this._activeMapType[mapType]) { + continue; + } + left = transform.left; + top = transform.top; + width = transform.width; + height = transform.height; + if (mx >= left && mx <= left + width && my >= top && my <= top + height) { + return mapType; + } + } + return; + }, + __onmousewheel: function (params) { + if (this.shapeList.length <= 0) { + return; + } + var event = params.event; + var mx = zrEvent.getX(event); + var my = zrEvent.getY(event); + var delta; + var eventDelta = zrEvent.getDelta(event); + var mapType; + var mapTypeControl = params.mapTypeControl; + if (!mapTypeControl) { + mapTypeControl = {}; + mapType = this._findMapTypeByPos(mx, my); + if (mapType && this._roamMap[mapType] && this._roamMap[mapType] != 'move') { + mapTypeControl[mapType] = true; + } + } + var haveScale = false; + for (mapType in mapTypeControl) { + if (mapTypeControl[mapType]) { + haveScale = true; + var transform = this._mapDataMap[mapType].transform; + var left = transform.left; + var top = transform.top; + var width = transform.width; + var height = transform.height; + var geoAndPos = this.pos2geo(mapType, [ + mx - left, + my - top + ]); + if (eventDelta > 0) { + delta = 1.2; + if (this._scaleLimitMap[mapType].max != null && transform.baseScale >= this._scaleLimitMap[mapType].max) { + continue; + } + } else { + delta = 1 / 1.2; + if (this._scaleLimitMap[mapType].min != null && transform.baseScale <= this._scaleLimitMap[mapType].min) { + continue; + } + } + transform.baseScale *= delta; + transform.scale.x *= delta; + transform.scale.y *= delta; + transform.width = width * delta; + transform.height = height * delta; + this._mapDataMap[mapType].hasRoam = true; + this._mapDataMap[mapType].transform = transform; + geoAndPos = this.geo2pos(mapType, geoAndPos); + transform.left -= geoAndPos[0] - (mx - left); + transform.top -= geoAndPos[1] - (my - top); + this._mapDataMap[mapType].transform = transform; + this.clearEffectShape(true); + for (var i = 0, l = this.shapeList.length; i < l; i++) { + if (this.shapeList[i]._mapType == mapType) { + this.shapeList[i].position[0] = transform.left; + this.shapeList[i].position[1] = transform.top; + if (this.shapeList[i].type == 'path' || this.shapeList[i].type == 'symbol' || this.shapeList[i].type == 'circle' || this.shapeList[i].type == 'rectangle' || this.shapeList[i].type == 'polygon' || this.shapeList[i].type == 'line' || this.shapeList[i].type == 'ellipse') { + this.shapeList[i].scale[0] *= delta; + this.shapeList[i].scale[1] *= delta; + } else if (this.shapeList[i].type == 'mark-line') { + this.shapeList[i].style.pointListLength = undefined; + this.shapeList[i].style.pointList = false; + geoAndPos = this.geo2pos(mapType, this.shapeList[i]._geo[0]); + this.shapeList[i].style.xStart = geoAndPos[0]; + this.shapeList[i].style.yStart = geoAndPos[1]; + geoAndPos = this.geo2pos(mapType, this.shapeList[i]._geo[1]); + this.shapeList[i]._x = this.shapeList[i].style.xEnd = geoAndPos[0]; + this.shapeList[i]._y = this.shapeList[i].style.yEnd = geoAndPos[1]; + } else if (this.shapeList[i].type == 'icon' || this.shapeList[i].type == 'image') { + geoAndPos = this.geo2pos(mapType, this.shapeList[i]._geo); + this.shapeList[i].style.x = this.shapeList[i].style._x = geoAndPos[0] - this.shapeList[i].style.width / 2; + this.shapeList[i].style.y = this.shapeList[i].style._y = geoAndPos[1] - this.shapeList[i].style.height / 2; + } else { + geoAndPos = this.geo2pos(mapType, this.shapeList[i]._geo); + this.shapeList[i].style.x = geoAndPos[0]; + this.shapeList[i].style.y = geoAndPos[1]; + if (this.shapeList[i].type == 'text') { + this.shapeList[i]._style.x = this.shapeList[i].highlightStyle.x = geoAndPos[0]; + this.shapeList[i]._style.y = this.shapeList[i].highlightStyle.y = geoAndPos[1]; + } + } + this.zr.modShape(this.shapeList[i].id); + } + } + } + } + if (haveScale) { + zrEvent.stop(event); + this.zr.refreshNextFrame(); + var self = this; + clearTimeout(this._refreshDelayTicket); + this._refreshDelayTicket = setTimeout(function () { + self && self.shapeList && self.animationEffect(); + }, 100); + this.messageCenter.dispatch(ecConfig.EVENT.MAP_ROAM, params.event, { type: 'scale' }, this.myChart); + } + }, + __onmousedown: function (params) { + if (this.shapeList.length <= 0) { + return; + } + var target = params.target; + if (target && target.draggable) { + return; + } + var event = params.event; + var mx = zrEvent.getX(event); + var my = zrEvent.getY(event); + var mapType = this._findMapTypeByPos(mx, my); + if (mapType && this._roamMap[mapType] && this._roamMap[mapType] != 'scale') { + this._mousedown = true; + this._mx = mx; + this._my = my; + this._curMapType = mapType; + this.zr.on(zrConfig.EVENT.MOUSEUP, this._onmouseup); + var self = this; + setTimeout(function () { + self.zr.on(zrConfig.EVENT.MOUSEMOVE, self._onmousemove); + }, 100); + } + }, + __onmousemove: function (params) { + if (!this._mousedown || !this._isAlive) { + return; + } + var event = params.event; + var mx = zrEvent.getX(event); + var my = zrEvent.getY(event); + var transform = this._mapDataMap[this._curMapType].transform; + transform.hasRoam = true; + transform.left -= this._mx - mx; + transform.top -= this._my - my; + this._mx = mx; + this._my = my; + this._mapDataMap[this._curMapType].transform = transform; + for (var i = 0, l = this.shapeList.length; i < l; i++) { + if (this.shapeList[i]._mapType == this._curMapType) { + this.shapeList[i].position[0] = transform.left; + this.shapeList[i].position[1] = transform.top; + this.zr.modShape(this.shapeList[i].id); + } + } + this.messageCenter.dispatch(ecConfig.EVENT.MAP_ROAM, params.event, { type: 'move' }, this.myChart); + this.clearEffectShape(true); + this.zr.refreshNextFrame(); + this._justMove = true; + zrEvent.stop(event); + }, + __onmouseup: function (params) { + var event = params.event; + this._mx = zrEvent.getX(event); + this._my = zrEvent.getY(event); + this._mousedown = false; + var self = this; + setTimeout(function () { + self._justMove && self.animationEffect(); + self._justMove = false; + self.zr.un(zrConfig.EVENT.MOUSEMOVE, self._onmousemove); + self.zr.un(zrConfig.EVENT.MOUSEUP, self._onmouseup); + }, 120); + }, + __onroamcontroller: function (params) { + var event = params.event; + event.zrenderX = this.zr.getWidth() / 2; + event.zrenderY = this.zr.getHeight() / 2; + var mapTypeControl = params.mapTypeControl; + var top = 0; + var left = 0; + var step = params.step; + switch (params.roamType) { + case 'scaleUp': + event.zrenderDelta = 1; + this.__onmousewheel({ + event: event, + mapTypeControl: mapTypeControl + }); + return; + case 'scaleDown': + event.zrenderDelta = -1; + this.__onmousewheel({ + event: event, + mapTypeControl: mapTypeControl + }); + return; + case 'up': + top = -step; + break; + case 'down': + top = step; + break; + case 'left': + left = -step; + break; + case 'right': + left = step; + break; + } + var transform; + var curMapType; + for (curMapType in mapTypeControl) { + if (!this._mapDataMap[curMapType] || !this._activeMapType[curMapType]) { + continue; + } + transform = this._mapDataMap[curMapType].transform; + transform.hasRoam = true; + transform.left -= left; + transform.top -= top; + this._mapDataMap[curMapType].transform = transform; + } + for (var i = 0, l = this.shapeList.length; i < l; i++) { + curMapType = this.shapeList[i]._mapType; + if (!mapTypeControl[curMapType] || !this._activeMapType[curMapType]) { + continue; + } + transform = this._mapDataMap[curMapType].transform; + this.shapeList[i].position[0] = transform.left; + this.shapeList[i].position[1] = transform.top; + this.zr.modShape(this.shapeList[i].id); + } + this.messageCenter.dispatch(ecConfig.EVENT.MAP_ROAM, params.event, { type: 'move' }, this.myChart); + this.clearEffectShape(true); + this.zr.refreshNextFrame(); + clearTimeout(this.dircetionTimer); + var self = this; + this.dircetionTimer = setTimeout(function () { + self.animationEffect(); + }, 150); + }, + __ondrhoverlink: function (param) { + var curMapType; + var value; + for (var i = 0, l = this.shapeList.length; i < l; i++) { + curMapType = this.shapeList[i]._mapType; + if (!this._hoverLinkMap[curMapType] || !this._activeMapType[curMapType]) { + continue; + } + value = ecData.get(this.shapeList[i], 'value'); + if (value != null && value >= param.valueMin && value <= param.valueMax) { + this.zr.addHoverShape(this.shapeList[i]); + } + } + }, + onclick: function (params) { + if (!this.isClick || !params.target || this._justMove || params.target.type == 'icon') { + return; + } + this.isClick = false; + var target = params.target; + var name = target.style._name; + var len = this.shapeList.length; + var mapType = target._mapType || ''; + if (this._selectedMode[mapType] == 'single') { + for (var p in this._selected) { + if (this._selected[p] && this._mapTypeMap[p] == mapType) { + for (var i = 0; i < len; i++) { + if (this.shapeList[i].style._name == p && this.shapeList[i]._mapType == mapType) { + this.shapeList[i].style = this.shapeList[i]._style; + this.zr.modShape(this.shapeList[i].id); + } + } + p != name && (this._selected[p] = false); + } + } + } + this._selected[name] = !this._selected[name]; + for (var i = 0; i < len; i++) { + if (this.shapeList[i].style._name == name && this.shapeList[i]._mapType == mapType) { + if (this._selected[name]) { + this.shapeList[i].style = this.shapeList[i].highlightStyle; + } else { + this.shapeList[i].style = this.shapeList[i]._style; + } + this.zr.modShape(this.shapeList[i].id); + } + } + this.messageCenter.dispatch(ecConfig.EVENT.MAP_SELECTED, params.event, { + selected: this._selected, + target: name + }, this.myChart); + this.zr.refreshNextFrame(); + var self = this; + setTimeout(function () { + self.zr.trigger(zrConfig.EVENT.MOUSEMOVE, params.event); + }, 100); + }, + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + if (this._mapDataRequireCounter > 0) { + this.clear(); + } else { + this.backupShapeList(); + } + this._buildShape(); + this.zr.refreshHover(); + }, + ondataRange: function (param, status) { + if (this.component.dataRange) { + this.refresh(); + status.needRefresh = true; + } + return; + }, + pos2geo: function (mapType, p) { + if (!this._mapDataMap[mapType].transform) { + return null; + } + return this._mapDataMap[mapType].projection.pos2geo(this._mapDataMap[mapType].transform, p); + }, + getGeoByPos: function (mapType, p) { + if (!this._mapDataMap[mapType].transform) { + return null; + } + var position = [ + this._mapDataMap[mapType].transform.left, + this._mapDataMap[mapType].transform.top + ]; + if (p instanceof Array) { + p[0] -= position[0]; + p[1] -= position[1]; + } else { + p.x -= position[0]; + p.y -= position[1]; + } + return this.pos2geo(mapType, p); + }, + geo2pos: function (mapType, p) { + if (!this._mapDataMap[mapType].transform) { + return null; + } + return this._mapDataMap[mapType].projection.geo2pos(this._mapDataMap[mapType].transform, p); + }, + getPosByGeo: function (mapType, p) { + if (!this._mapDataMap[mapType].transform) { + return null; + } + var pos = this.geo2pos(mapType, p); + pos[0] += this._mapDataMap[mapType].transform.left; + pos[1] += this._mapDataMap[mapType].transform.top; + return pos; + }, + getMapPosition: function (mapType) { + if (!this._mapDataMap[mapType].transform) { + return null; + } + return [ + this._mapDataMap[mapType].transform.left, + this._mapDataMap[mapType].transform.top + ]; + }, + onbeforDispose: function () { + this._isAlive = false; + this.zr.un(zrConfig.EVENT.MOUSEWHEEL, this._onmousewheel); + this.zr.un(zrConfig.EVENT.MOUSEDOWN, this._onmousedown); + this.messageCenter.unbind(ecConfig.EVENT.ROAMCONTROLLER, this._onroamcontroller); + this.messageCenter.unbind(ecConfig.EVENT.DATA_RANGE_HOVERLINK, this._ondrhoverlink); + } + }; + zrUtil.inherits(Map, ChartBase); + require('../chart').define('map', Map); + return Map; +});define('zrender/shape/Path', [ + 'require', + './Base', + './util/PathProxy', + '../tool/util' +], function (require) { + var Base = require('./Base'); + var PathProxy = require('./util/PathProxy'); + var PathSegment = PathProxy.PathSegment; + var vMag = function (v) { + return Math.sqrt(v[0] * v[0] + v[1] * v[1]); + }; + var vRatio = function (u, v) { + return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v)); + }; + var vAngle = function (u, v) { + return (u[0] * v[1] < u[1] * v[0] ? -1 : 1) * Math.acos(vRatio(u, v)); + }; + var Path = function (options) { + Base.call(this, options); + }; + Path.prototype = { + type: 'path', + buildPathArray: function (data, x, y) { + if (!data) { + return []; + } + x = x || 0; + y = y || 0; + var cs = data; + var cc = [ + 'm', + 'M', + 'l', + 'L', + 'v', + 'V', + 'h', + 'H', + 'z', + 'Z', + 'c', + 'C', + 'q', + 'Q', + 't', + 'T', + 's', + 'S', + 'a', + 'A' + ]; + cs = cs.replace(/-/g, ' -'); + cs = cs.replace(/ /g, ' '); + cs = cs.replace(/ /g, ','); + cs = cs.replace(/,,/g, ','); + var n; + for (n = 0; n < cc.length; n++) { + cs = cs.replace(new RegExp(cc[n], 'g'), '|' + cc[n]); + } + var arr = cs.split('|'); + var ca = []; + var cpx = 0; + var cpy = 0; + for (n = 1; n < arr.length; n++) { + var str = arr[n]; + var c = str.charAt(0); + str = str.slice(1); + str = str.replace(new RegExp('e,-', 'g'), 'e-'); + var p = str.split(','); + if (p.length > 0 && p[0] === '') { + p.shift(); + } + for (var i = 0; i < p.length; i++) { + p[i] = parseFloat(p[i]); + } + while (p.length > 0) { + if (isNaN(p[0])) { + break; + } + var cmd = null; + var points = []; + var ctlPtx; + var ctlPty; + var prevCmd; + var rx; + var ry; + var psi; + var fa; + var fs; + var x1 = cpx; + var y1 = cpy; + switch (c) { + case 'l': + cpx += p.shift(); + cpy += p.shift(); + cmd = 'L'; + points.push(cpx, cpy); + break; + case 'L': + cpx = p.shift(); + cpy = p.shift(); + points.push(cpx, cpy); + break; + case 'm': + cpx += p.shift(); + cpy += p.shift(); + cmd = 'M'; + points.push(cpx, cpy); + c = 'l'; + break; + case 'M': + cpx = p.shift(); + cpy = p.shift(); + cmd = 'M'; + points.push(cpx, cpy); + c = 'L'; + break; + case 'h': + cpx += p.shift(); + cmd = 'L'; + points.push(cpx, cpy); + break; + case 'H': + cpx = p.shift(); + cmd = 'L'; + points.push(cpx, cpy); + break; + case 'v': + cpy += p.shift(); + cmd = 'L'; + points.push(cpx, cpy); + break; + case 'V': + cpy = p.shift(); + cmd = 'L'; + points.push(cpx, cpy); + break; + case 'C': + points.push(p.shift(), p.shift(), p.shift(), p.shift()); + cpx = p.shift(); + cpy = p.shift(); + points.push(cpx, cpy); + break; + case 'c': + points.push(cpx + p.shift(), cpy + p.shift(), cpx + p.shift(), cpy + p.shift()); + cpx += p.shift(); + cpy += p.shift(); + cmd = 'C'; + points.push(cpx, cpy); + break; + case 'S': + ctlPtx = cpx; + ctlPty = cpy; + prevCmd = ca[ca.length - 1]; + if (prevCmd.command === 'C') { + ctlPtx = cpx + (cpx - prevCmd.points[2]); + ctlPty = cpy + (cpy - prevCmd.points[3]); + } + points.push(ctlPtx, ctlPty, p.shift(), p.shift()); + cpx = p.shift(); + cpy = p.shift(); + cmd = 'C'; + points.push(cpx, cpy); + break; + case 's': + ctlPtx = cpx, ctlPty = cpy; + prevCmd = ca[ca.length - 1]; + if (prevCmd.command === 'C') { + ctlPtx = cpx + (cpx - prevCmd.points[2]); + ctlPty = cpy + (cpy - prevCmd.points[3]); + } + points.push(ctlPtx, ctlPty, cpx + p.shift(), cpy + p.shift()); + cpx += p.shift(); + cpy += p.shift(); + cmd = 'C'; + points.push(cpx, cpy); + break; + case 'Q': + points.push(p.shift(), p.shift()); + cpx = p.shift(); + cpy = p.shift(); + points.push(cpx, cpy); + break; + case 'q': + points.push(cpx + p.shift(), cpy + p.shift()); + cpx += p.shift(); + cpy += p.shift(); + cmd = 'Q'; + points.push(cpx, cpy); + break; + case 'T': + ctlPtx = cpx, ctlPty = cpy; + prevCmd = ca[ca.length - 1]; + if (prevCmd.command === 'Q') { + ctlPtx = cpx + (cpx - prevCmd.points[0]); + ctlPty = cpy + (cpy - prevCmd.points[1]); + } + cpx = p.shift(); + cpy = p.shift(); + cmd = 'Q'; + points.push(ctlPtx, ctlPty, cpx, cpy); + break; + case 't': + ctlPtx = cpx, ctlPty = cpy; + prevCmd = ca[ca.length - 1]; + if (prevCmd.command === 'Q') { + ctlPtx = cpx + (cpx - prevCmd.points[0]); + ctlPty = cpy + (cpy - prevCmd.points[1]); + } + cpx += p.shift(); + cpy += p.shift(); + cmd = 'Q'; + points.push(ctlPtx, ctlPty, cpx, cpy); + break; + case 'A': + rx = p.shift(); + ry = p.shift(); + psi = p.shift(); + fa = p.shift(); + fs = p.shift(); + x1 = cpx, y1 = cpy; + cpx = p.shift(), cpy = p.shift(); + cmd = 'A'; + points = this._convertPoint(x1, y1, cpx, cpy, fa, fs, rx, ry, psi); + break; + case 'a': + rx = p.shift(); + ry = p.shift(); + psi = p.shift(); + fa = p.shift(); + fs = p.shift(); + x1 = cpx, y1 = cpy; + cpx += p.shift(); + cpy += p.shift(); + cmd = 'A'; + points = this._convertPoint(x1, y1, cpx, cpy, fa, fs, rx, ry, psi); + break; + } + for (var j = 0, l = points.length; j < l; j += 2) { + points[j] += x; + points[j + 1] += y; + } + ca.push(new PathSegment(cmd || c, points)); + } + if (c === 'z' || c === 'Z') { + ca.push(new PathSegment('z', [])); + } + } + return ca; + }, + _convertPoint: function (x1, y1, x2, y2, fa, fs, rx, ry, psiDeg) { + var psi = psiDeg * (Math.PI / 180); + var xp = Math.cos(psi) * (x1 - x2) / 2 + Math.sin(psi) * (y1 - y2) / 2; + var yp = -1 * Math.sin(psi) * (x1 - x2) / 2 + Math.cos(psi) * (y1 - y2) / 2; + var lambda = xp * xp / (rx * rx) + yp * yp / (ry * ry); + if (lambda > 1) { + rx *= Math.sqrt(lambda); + ry *= Math.sqrt(lambda); + } + var f = Math.sqrt((rx * rx * (ry * ry) - rx * rx * (yp * yp) - ry * ry * (xp * xp)) / (rx * rx * (yp * yp) + ry * ry * (xp * xp))); + if (fa === fs) { + f *= -1; + } + if (isNaN(f)) { + f = 0; + } + var cxp = f * rx * yp / ry; + var cyp = f * -ry * xp / rx; + var cx = (x1 + x2) / 2 + Math.cos(psi) * cxp - Math.sin(psi) * cyp; + var cy = (y1 + y2) / 2 + Math.sin(psi) * cxp + Math.cos(psi) * cyp; + var theta = vAngle([ + 1, + 0 + ], [ + (xp - cxp) / rx, + (yp - cyp) / ry + ]); + var u = [ + (xp - cxp) / rx, + (yp - cyp) / ry + ]; + var v = [ + (-1 * xp - cxp) / rx, + (-1 * yp - cyp) / ry + ]; + var dTheta = vAngle(u, v); + if (vRatio(u, v) <= -1) { + dTheta = Math.PI; + } + if (vRatio(u, v) >= 1) { + dTheta = 0; + } + if (fs === 0 && dTheta > 0) { + dTheta = dTheta - 2 * Math.PI; + } + if (fs === 1 && dTheta < 0) { + dTheta = dTheta + 2 * Math.PI; + } + return [ + cx, + cy, + rx, + ry, + theta, + dTheta, + psi, + fs + ]; + }, + buildPath: function (ctx, style) { + var path = style.path; + var x = style.x || 0; + var y = style.y || 0; + style.pathArray = style.pathArray || this.buildPathArray(path, x, y); + var pathArray = style.pathArray; + var pointList = style.pointList = []; + var singlePointList = []; + for (var i = 0, l = pathArray.length; i < l; i++) { + if (pathArray[i].command.toUpperCase() == 'M') { + singlePointList.length > 0 && pointList.push(singlePointList); + singlePointList = []; + } + var p = pathArray[i].points; + for (var j = 0, k = p.length; j < k; j += 2) { + singlePointList.push([ + p[j], + p[j + 1] + ]); + } + } + singlePointList.length > 0 && pointList.push(singlePointList); + for (var i = 0, l = pathArray.length; i < l; i++) { + var c = pathArray[i].command; + var p = pathArray[i].points; + switch (c) { + case 'L': + ctx.lineTo(p[0], p[1]); + break; + case 'M': + ctx.moveTo(p[0], p[1]); + break; + case 'C': + ctx.bezierCurveTo(p[0], p[1], p[2], p[3], p[4], p[5]); + break; + case 'Q': + ctx.quadraticCurveTo(p[0], p[1], p[2], p[3]); + break; + case 'A': + var cx = p[0]; + var cy = p[1]; + var rx = p[2]; + var ry = p[3]; + var theta = p[4]; + var dTheta = p[5]; + var psi = p[6]; + var fs = p[7]; + var r = rx > ry ? rx : ry; + var scaleX = rx > ry ? 1 : rx / ry; + var scaleY = rx > ry ? ry / rx : 1; + ctx.translate(cx, cy); + ctx.rotate(psi); + ctx.scale(scaleX, scaleY); + ctx.arc(0, 0, r, theta, theta + dTheta, 1 - fs); + ctx.scale(1 / scaleX, 1 / scaleY); + ctx.rotate(-psi); + ctx.translate(-cx, -cy); + break; + case 'z': + ctx.closePath(); + break; + } + } + return; + }, + getRect: function (style) { + if (style.__rect) { + return style.__rect; + } + var lineWidth; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } else { + lineWidth = 0; + } + var minX = Number.MAX_VALUE; + var maxX = Number.MIN_VALUE; + var minY = Number.MAX_VALUE; + var maxY = Number.MIN_VALUE; + var x = style.x || 0; + var y = style.y || 0; + var pathArray = style.pathArray || this.buildPathArray(style.path); + for (var i = 0; i < pathArray.length; i++) { + var p = pathArray[i].points; + for (var j = 0; j < p.length; j++) { + if (j % 2 === 0) { + if (p[j] + x < minX) { + minX = p[j]; + } + if (p[j] + x > maxX) { + maxX = p[j]; + } + } else { + if (p[j] + y < minY) { + minY = p[j]; + } + if (p[j] + y > maxY) { + maxY = p[j]; + } + } + } + } + var rect; + if (minX === Number.MAX_VALUE || maxX === Number.MIN_VALUE || minY === Number.MAX_VALUE || maxY === Number.MIN_VALUE) { + rect = { + x: 0, + y: 0, + width: 0, + height: 0 + }; + } else { + rect = { + x: Math.round(minX - lineWidth / 2), + y: Math.round(minY - lineWidth / 2), + width: maxX - minX + lineWidth, + height: maxY - minY + lineWidth + }; + } + style.__rect = rect; + return rect; + } + }; + require('../tool/util').inherits(Path, Base); + return Path; +});define('zrender/shape/Ellipse', [ + 'require', + './Base', + '../tool/util' +], function (require) { + var Base = require('./Base'); + var Ellipse = function (options) { + Base.call(this, options); + }; + Ellipse.prototype = { + type: 'ellipse', + buildPath: function (ctx, style) { + var k = 0.5522848; + var x = style.x; + var y = style.y; + var a = style.a; + var b = style.b; + var ox = a * k; + var oy = b * k; + ctx.moveTo(x - a, y); + ctx.bezierCurveTo(x - a, y - oy, x - ox, y - b, x, y - b); + ctx.bezierCurveTo(x + ox, y - b, x + a, y - oy, x + a, y); + ctx.bezierCurveTo(x + a, y + oy, x + ox, y + b, x, y + b); + ctx.bezierCurveTo(x - ox, y + b, x - a, y + oy, x - a, y); + ctx.closePath(); + }, + getRect: function (style) { + if (style.__rect) { + return style.__rect; + } + var lineWidth; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } else { + lineWidth = 0; + } + style.__rect = { + x: Math.round(style.x - style.a - lineWidth / 2), + y: Math.round(style.y - style.b - lineWidth / 2), + width: style.a * 2 + lineWidth, + height: style.b * 2 + lineWidth + }; + return style.__rect; + } + }; + require('../tool/util').inherits(Ellipse, Base); + return Ellipse; +});define('echarts/component/roamController', [ + 'require', + './base', + 'zrender/shape/Rectangle', + 'zrender/shape/Sector', + 'zrender/shape/Circle', + '../config', + 'zrender/tool/util', + 'zrender/tool/color', + 'zrender/tool/event', + '../component' +], function (require) { + var Base = require('./base'); + var RectangleShape = require('zrender/shape/Rectangle'); + var SectorShape = require('zrender/shape/Sector'); + var CircleShape = require('zrender/shape/Circle'); + var ecConfig = require('../config'); + ecConfig.roamController = { + zlevel: 0, + z: 4, + show: true, + x: 'left', + y: 'top', + width: 80, + height: 120, + backgroundColor: 'rgba(0,0,0,0)', + borderColor: '#ccc', + borderWidth: 0, + padding: 5, + handleColor: '#6495ed', + fillerColor: '#fff', + step: 15, + mapTypeControl: null + }; + var zrUtil = require('zrender/tool/util'); + var zrColor = require('zrender/tool/color'); + var zrEvent = require('zrender/tool/event'); + function RoamController(ecTheme, messageCenter, zr, option, myChart) { + if (!option.roamController || !option.roamController.show) { + return; + } + if (!option.roamController.mapTypeControl) { + console.error('option.roamController.mapTypeControl has not been defined.'); + return; + } + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + this.rcOption = option.roamController; + var self = this; + this._drictionMouseDown = function (params) { + return self.__drictionMouseDown(params); + }; + this._drictionMouseUp = function (params) { + return self.__drictionMouseUp(params); + }; + this._drictionMouseMove = function (params) { + return self.__drictionMouseMove(params); + }; + this._drictionMouseOut = function (params) { + return self.__drictionMouseOut(params); + }; + this._scaleHandler = function (params) { + return self.__scaleHandler(params); + }; + this.refresh(option); + } + RoamController.prototype = { + type: ecConfig.COMPONENT_TYPE_ROAMCONTROLLER, + _buildShape: function () { + if (!this.rcOption.show) { + return; + } + this._itemGroupLocation = this._getItemGroupLocation(); + this._buildBackground(); + this._buildItem(); + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + }, + _buildItem: function () { + this.shapeList.push(this._getDirectionShape('up')); + this.shapeList.push(this._getDirectionShape('down')); + this.shapeList.push(this._getDirectionShape('left')); + this.shapeList.push(this._getDirectionShape('right')); + this.shapeList.push(this._getScaleShape('scaleUp')); + this.shapeList.push(this._getScaleShape('scaleDown')); + }, + _getDirectionShape: function (direction) { + var r = this._itemGroupLocation.r; + var x = this._itemGroupLocation.x + r; + var y = this._itemGroupLocation.y + r; + var sectorShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: x, + y: y, + r: r, + startAngle: -45, + endAngle: 45, + color: this.rcOption.handleColor, + text: '>', + textX: x + r / 2 + 4, + textY: y - 0.5, + textAlign: 'center', + textBaseline: 'middle', + textPosition: 'specific', + textColor: this.rcOption.fillerColor, + textFont: Math.floor(r / 2) + 'px arial' + }, + highlightStyle: { + color: zrColor.lift(this.rcOption.handleColor, -0.2), + brushType: 'fill' + }, + clickable: true + }; + switch (direction) { + case 'up': + sectorShape.rotation = [ + Math.PI / 2, + x, + y + ]; + break; + case 'left': + sectorShape.rotation = [ + Math.PI, + x, + y + ]; + break; + case 'down': + sectorShape.rotation = [ + -Math.PI / 2, + x, + y + ]; + break; + } + sectorShape = new SectorShape(sectorShape); + sectorShape._roamType = direction; + sectorShape.onmousedown = this._drictionMouseDown; + sectorShape.onmouseup = this._drictionMouseUp; + sectorShape.onmousemove = this._drictionMouseMove; + sectorShape.onmouseout = this._drictionMouseOut; + return sectorShape; + }, + _getScaleShape: function (text) { + var width = this._itemGroupLocation.width; + var height = this._itemGroupLocation.height - width; + height = height < 0 ? 20 : height; + var r = Math.min(width / 2 - 5, height) / 2; + var x = this._itemGroupLocation.x + (text === 'scaleDown' ? width - r : r); + var y = this._itemGroupLocation.y + this._itemGroupLocation.height - r; + var scaleShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: x, + y: y, + r: r, + color: this.rcOption.handleColor, + text: text === 'scaleDown' ? '-' : '+', + textX: x, + textY: y - 2, + textAlign: 'center', + textBaseline: 'middle', + textPosition: 'specific', + textColor: this.rcOption.fillerColor, + textFont: Math.floor(r) + 'px verdana' + }, + highlightStyle: { + color: zrColor.lift(this.rcOption.handleColor, -0.2), + brushType: 'fill' + }, + clickable: true + }; + scaleShape = new CircleShape(scaleShape); + scaleShape._roamType = text; + scaleShape.onmousedown = this._scaleHandler; + return scaleShape; + }, + _buildBackground: function () { + var padding = this.reformCssArray(this.rcOption.padding); + this.shapeList.push(new RectangleShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: this._itemGroupLocation.x - padding[3], + y: this._itemGroupLocation.y - padding[0], + width: this._itemGroupLocation.width + padding[3] + padding[1], + height: this._itemGroupLocation.height + padding[0] + padding[2], + brushType: this.rcOption.borderWidth === 0 ? 'fill' : 'both', + color: this.rcOption.backgroundColor, + strokeColor: this.rcOption.borderColor, + lineWidth: this.rcOption.borderWidth + } + })); + }, + _getItemGroupLocation: function () { + var padding = this.reformCssArray(this.rcOption.padding); + var width = this.rcOption.width; + var height = this.rcOption.height; + var zrWidth = this.zr.getWidth(); + var zrHeight = this.zr.getHeight(); + var x; + switch (this.rcOption.x) { + case 'center': + x = Math.floor((zrWidth - width) / 2); + break; + case 'left': + x = padding[3] + this.rcOption.borderWidth; + break; + case 'right': + x = zrWidth - width - padding[1] - padding[3] - this.rcOption.borderWidth * 2; + break; + default: + x = this.parsePercent(this.rcOption.x, zrWidth); + break; + } + var y; + switch (this.rcOption.y) { + case 'top': + y = padding[0] + this.rcOption.borderWidth; + break; + case 'bottom': + y = zrHeight - height - padding[0] - padding[2] - this.rcOption.borderWidth * 2; + break; + case 'center': + y = Math.floor((zrHeight - height) / 2); + break; + default: + y = this.parsePercent(this.rcOption.y, zrHeight); + break; + } + return { + x: x, + y: y, + r: width / 2, + width: width, + height: height + }; + }, + __drictionMouseDown: function (params) { + this.mousedown = true; + this._drictionHandlerOn(params); + }, + __drictionMouseUp: function (params) { + this.mousedown = false; + this._drictionHandlerOff(params); + }, + __drictionMouseMove: function (params) { + if (this.mousedown) { + this._drictionHandlerOn(params); + } + }, + __drictionMouseOut: function (params) { + this._drictionHandlerOff(params); + }, + _drictionHandlerOn: function (params) { + this._dispatchEvent(params.event, params.target._roamType); + clearInterval(this.dircetionTimer); + var self = this; + this.dircetionTimer = setInterval(function () { + self._dispatchEvent(params.event, params.target._roamType); + }, 100); + zrEvent.stop(params.event); + }, + _drictionHandlerOff: function (params) { + clearInterval(this.dircetionTimer); + }, + __scaleHandler: function (params) { + this._dispatchEvent(params.event, params.target._roamType); + zrEvent.stop(params.event); + }, + _dispatchEvent: function (event, roamType) { + this.messageCenter.dispatch(ecConfig.EVENT.ROAMCONTROLLER, event, { + roamType: roamType, + mapTypeControl: this.rcOption.mapTypeControl, + step: this.rcOption.step + }, this.myChart); + }, + refresh: function (newOption) { + if (newOption) { + this.option = newOption || this.option; + this.option.roamController = this.reformOption(this.option.roamController); + this.rcOption = this.option.roamController; + } + this.clear(); + this._buildShape(); + } + }; + zrUtil.inherits(RoamController, Base); + require('../component').define('roamController', RoamController); + return RoamController; +});define('echarts/util/mapData/params', ['require'], function (require) { + function decode(json) { + if (!json.UTF8Encoding) { + return json; + } + var features = json.features; + for (var f = 0; f < features.length; f++) { + var feature = features[f]; + var coordinates = feature.geometry.coordinates; + var encodeOffsets = feature.geometry.encodeOffsets; + for (var c = 0; c < coordinates.length; c++) { + var coordinate = coordinates[c]; + if (feature.geometry.type === 'Polygon') { + coordinates[c] = decodePolygon(coordinate, encodeOffsets[c]); + } else if (feature.geometry.type === 'MultiPolygon') { + for (var c2 = 0; c2 < coordinate.length; c2++) { + var polygon = coordinate[c2]; + coordinate[c2] = decodePolygon(polygon, encodeOffsets[c][c2]); + } + } + } + } + json.UTF8Encoding = false; + return json; + } + function decodePolygon(coordinate, encodeOffsets) { + var result = []; + var prevX = encodeOffsets[0]; + var prevY = encodeOffsets[1]; + for (var i = 0; i < coordinate.length; i += 2) { + var x = coordinate.charCodeAt(i) - 64; + var y = coordinate.charCodeAt(i + 1) - 64; + x = x >> 1 ^ -(x & 1); + y = y >> 1 ^ -(y & 1); + x += prevX; + y += prevY; + prevX = x; + prevY = y; + result.push([ + x / 1024, + y / 1024 + ]); + } + return result; + } + var mapParams = { + 'none': { + getGeoJson: function (callback) { + callback({ + type: 'FeatureCollection', + features: [{ + type: 'Feature', + geometry: { + coordinates: [], + encodeOffsets: [], + type: 'Polygon' + }, + properties: {} + }] + }); + } + }, + 'world': { + getGeoJson: function (callback) { + require(['./geoJson/world_geo'], function (md) { + callback(decode(md)); + }); + } + }, + 'china': { + getGeoJson: function (callback) { + require(['./geoJson/china_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '南海诸岛': { + textCoord: [ + 126, + 25 + ], + getPath: function (leftTop, scale) { + var pList = [ + [ + [ + 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 + ] + ] + ]; + var str = ''; + var left = leftTop[0]; + var top = leftTop[1]; + for (var i = 0, l = pList.length; i < l; i++) { + str += 'M ' + ((pList[i][0][0] * scale + left).toFixed(2) - 0) + ' ' + ((pList[i][0][1] * scale + top).toFixed(2) - 0) + ' '; + for (var j = 1, k = pList[i].length; j < k; j++) { + str += 'L ' + ((pList[i][j][0] * scale + left).toFixed(2) - 0) + ' ' + ((pList[i][j][1] * scale + top).toFixed(2) - 0) + ' '; + } + } + return str + ' Z'; + } + }, + '新疆': { + getGeoJson: function (callback) { + require(['./geoJson/xin_jiang_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '西藏': { + getGeoJson: function (callback) { + require(['./geoJson/xi_zang_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '内蒙古': { + getGeoJson: function (callback) { + require(['./geoJson/nei_meng_gu_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '青海': { + getGeoJson: function (callback) { + require(['./geoJson/qing_hai_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '四川': { + getGeoJson: function (callback) { + require(['./geoJson/si_chuan_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '黑龙江': { + getGeoJson: function (callback) { + require(['./geoJson/hei_long_jiang_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '甘肃': { + getGeoJson: function (callback) { + require(['./geoJson/gan_su_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '云南': { + getGeoJson: function (callback) { + require(['./geoJson/yun_nan_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '广西': { + getGeoJson: function (callback) { + require(['./geoJson/guang_xi_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '湖南': { + getGeoJson: function (callback) { + require(['./geoJson/hu_nan_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '陕西': { + getGeoJson: function (callback) { + require(['./geoJson/shan_xi_1_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '广东': { + getGeoJson: function (callback) { + require(['./geoJson/guang_dong_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '吉林': { + getGeoJson: function (callback) { + require(['./geoJson/ji_lin_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '河北': { + getGeoJson: function (callback) { + require(['./geoJson/he_bei_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '湖北': { + getGeoJson: function (callback) { + require(['./geoJson/hu_bei_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '贵州': { + getGeoJson: function (callback) { + require(['./geoJson/gui_zhou_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '山东': { + getGeoJson: function (callback) { + require(['./geoJson/shan_dong_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '江西': { + getGeoJson: function (callback) { + require(['./geoJson/jiang_xi_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '河南': { + getGeoJson: function (callback) { + require(['./geoJson/he_nan_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '辽宁': { + getGeoJson: function (callback) { + require(['./geoJson/liao_ning_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '山西': { + getGeoJson: function (callback) { + require(['./geoJson/shan_xi_2_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '安徽': { + getGeoJson: function (callback) { + require(['./geoJson/an_hui_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '福建': { + getGeoJson: function (callback) { + require(['./geoJson/fu_jian_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '浙江': { + getGeoJson: function (callback) { + require(['./geoJson/zhe_jiang_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '江苏': { + getGeoJson: function (callback) { + require(['./geoJson/jiang_su_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '重庆': { + getGeoJson: function (callback) { + require(['./geoJson/chong_qing_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '宁夏': { + getGeoJson: function (callback) { + require(['./geoJson/ning_xia_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '海南': { + getGeoJson: function (callback) { + require(['./geoJson/hai_nan_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '台湾': { + getGeoJson: function (callback) { + require(['./geoJson/tai_wan_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '北京': { + getGeoJson: function (callback) { + require(['./geoJson/bei_jing_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '天津': { + getGeoJson: function (callback) { + require(['./geoJson/tian_jin_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '上海': { + getGeoJson: function (callback) { + require(['./geoJson/shang_hai_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '香港': { + getGeoJson: function (callback) { + require(['./geoJson/xiang_gang_geo'], function (md) { + callback(decode(md)); + }); + } + }, + '澳门': { + getGeoJson: function (callback) { + require(['./geoJson/ao_men_geo'], function (md) { + callback(decode(md)); + }); + } + } + }; + return { + decode: decode, + params: mapParams + }; +});define('echarts/util/mapData/textFixed', [], function () { + return { + '广东': [ + 0, + -10 + ], + '香港': [ + 10, + 10 + ], + '澳门': [ + -10, + 18 + ], + '黑龙江': [ + 0, + 20 + ], + '天津': [ + 5, + 5 + ], + '深圳市': [ + -35, + 0 + ], + '红河哈尼族彝族自治州': [ + 0, + 20 + ], + '楚雄彝族自治州': [ + -5, + 15 + ], + '石河子市': [ + -5, + 5 + ], + '五家渠市': [ + 0, + -10 + ], + '昌吉回族自治州': [ + 10, + 10 + ], + '昌江黎族自治县': [ + 0, + 20 + ], + '陵水黎族自治县': [ + 0, + 20 + ], + '东方市': [ + 0, + 20 + ], + '渭南市': [ + 0, + 20 + ] + }; +});define('echarts/util/mapData/geoCoord', [], function () { + return { + 'Russia': [ + 100, + 60 + ], + 'United States of America': [ + -99, + 38 + ] + }; +});define('echarts/util/projection/svg', [ + 'require', + 'zrender/shape/Path' +], function (require) { + var PathShape = require('zrender/shape/Path'); + function toFloat(str) { + return parseFloat(str || 0); + } + function getBbox(root) { + var svgNode = root.firstChild; + while (!(svgNode.nodeName.toLowerCase() == 'svg' && svgNode.nodeType == 1)) { + svgNode = svgNode.nextSibling; + } + var x = toFloat(svgNode.getAttribute('x')); + var y = toFloat(svgNode.getAttribute('y')); + var width = toFloat(svgNode.getAttribute('width')); + var height = toFloat(svgNode.getAttribute('height')); + return { + left: x, + top: y, + width: width, + height: height + }; + } + function geoJson2Path(root, transform) { + var scale = [ + transform.scale.x, + transform.scale.y + ]; + var elList = []; + function _getShape(root) { + var tagName = root.tagName; + if (shapeBuilders[tagName]) { + var obj = shapeBuilders[tagName](root, scale); + if (obj) { + obj.scale = scale; + obj.properties = { name: root.getAttribute('name') || '' }; + obj.id = root.id; + extendCommonAttributes(obj, root); + elList.push(obj); + } + } + var shapes = root.childNodes; + for (var i = 0, len = shapes.length; i < len; i++) { + _getShape(shapes[i]); + } + } + _getShape(root); + return elList; + } + function pos2geo(obj, p) { + var point = p instanceof Array ? [ + p[0] * 1, + p[1] * 1 + ] : [ + p.x * 1, + p.y * 1 + ]; + return [ + point[0] / obj.scale.x, + point[1] / obj.scale.y + ]; + } + function geo2pos(obj, p) { + var point = p instanceof Array ? [ + p[0] * 1, + p[1] * 1 + ] : [ + p.x * 1, + p.y * 1 + ]; + return [ + point[0] * obj.scale.x, + point[1] * obj.scale.y + ]; + } + function trim(str) { + return str.replace(/^\s\s*/, '').replace(/\s\s*$/, ''); + } + function extendCommonAttributes(obj, xmlNode) { + var color = xmlNode.getAttribute('fill'); + var strokeColor = xmlNode.getAttribute('stroke'); + var lineWidth = xmlNode.getAttribute('stroke-width'); + var opacity = xmlNode.getAttribute('opacity'); + if (color && color != 'none') { + obj.color = color; + if (strokeColor) { + obj.brushType = 'both'; + obj.strokeColor = strokeColor; + } else { + obj.brushType = 'fill'; + } + } else if (strokeColor && strokeColor != 'none') { + obj.strokeColor = strokeColor; + obj.brushType = 'stroke'; + } + if (lineWidth && lineWidth != 'none') { + obj.lineWidth = parseFloat(lineWidth); + } + if (opacity && opacity != 'none') { + obj.opacity = parseFloat(opacity); + } + } + function parsePoints(str) { + var list = trim(str).replace(/,/g, ' ').split(/\s+/); + var points = []; + for (var i = 0; i < list.length;) { + var x = parseFloat(list[i++]); + var y = parseFloat(list[i++]); + points.push([ + x, + y + ]); + } + return points; + } + var shapeBuilders = { + path: function (xmlNode, scale) { + var path = xmlNode.getAttribute('d'); + var rect = PathShape.prototype.getRect({ path: path }); + return { + shapeType: 'path', + path: path, + cp: [ + (rect.x + rect.width / 2) * scale[0], + (rect.y + rect.height / 2) * scale[1] + ] + }; + }, + rect: function (xmlNode, scale) { + var x = toFloat(xmlNode.getAttribute('x')); + var y = toFloat(xmlNode.getAttribute('y')); + var width = toFloat(xmlNode.getAttribute('width')); + var height = toFloat(xmlNode.getAttribute('height')); + return { + shapeType: 'rectangle', + x: x, + y: y, + width: width, + height: height, + cp: [ + (x + width / 2) * scale[0], + (y + height / 2) * scale[1] + ] + }; + }, + line: function (xmlNode, scale) { + var x1 = toFloat(xmlNode.getAttribute('x1')); + var y1 = toFloat(xmlNode.getAttribute('y1')); + var x2 = toFloat(xmlNode.getAttribute('x2')); + var y2 = toFloat(xmlNode.getAttribute('y2')); + return { + shapeType: 'line', + xStart: x1, + yStart: y1, + xEnd: x2, + yEnd: y2, + cp: [ + (x1 + x2) * 0.5 * scale[0], + (y1 + y2) * 0.5 * scale[1] + ] + }; + }, + circle: function (xmlNode, scale) { + var cx = toFloat(xmlNode.getAttribute('cx')); + var cy = toFloat(xmlNode.getAttribute('cy')); + var r = toFloat(xmlNode.getAttribute('r')); + return { + shapeType: 'circle', + x: cx, + y: cy, + r: r, + cp: [ + cx * scale[0], + cy * scale[1] + ] + }; + }, + ellipse: function (xmlNode, scale) { + var cx = parseFloat(xmlNode.getAttribute('cx') || 0); + var cy = parseFloat(xmlNode.getAttribute('cy') || 0); + var rx = parseFloat(xmlNode.getAttribute('rx') || 0); + var ry = parseFloat(xmlNode.getAttribute('ry') || 0); + return { + shapeType: 'ellipse', + x: cx, + y: cy, + a: rx, + b: ry, + cp: [ + cx * scale[0], + cy * scale[1] + ] + }; + }, + polygon: function (xmlNode, scale) { + var points = xmlNode.getAttribute('points'); + var min = [ + Infinity, + Infinity + ]; + var max = [ + -Infinity, + -Infinity + ]; + if (points) { + points = parsePoints(points); + for (var i = 0; i < points.length; i++) { + var p = points[i]; + min[0] = Math.min(p[0], min[0]); + min[1] = Math.min(p[1], min[1]); + max[0] = Math.max(p[0], max[0]); + max[1] = Math.max(p[1], max[1]); + } + return { + shapeType: 'polygon', + pointList: points, + cp: [ + (min[0] + max[0]) / 2 * scale[0], + (min[1] + max[1]) / 2 * scale[0] + ] + }; + } + }, + polyline: function (xmlNode, scale) { + var obj = shapeBuilders.polygon(xmlNode, scale); + return obj; + } + }; + return { + getBbox: getBbox, + geoJson2Path: geoJson2Path, + pos2geo: pos2geo, + geo2pos: geo2pos + }; +});define('echarts/util/projection/normal', [], function () { + function getBbox(json, specialArea) { + specialArea = specialArea || {}; + if (!json.srcSize) { + parseSrcSize(json, specialArea); + } + return json.srcSize; + } + function parseSrcSize(json, specialArea) { + specialArea = specialArea || {}; + convertorParse.xmin = 360; + convertorParse.xmax = -360; + convertorParse.ymin = 180; + convertorParse.ymax = -180; + var shapes = json.features; + var geometries; + var shape; + for (var i = 0, len = shapes.length; i < len; i++) { + shape = shapes[i]; + if (shape.properties.name && specialArea[shape.properties.name]) { + continue; + } + switch (shape.type) { + case 'Feature': + convertorParse[shape.geometry.type](shape.geometry.coordinates); + break; + case 'GeometryCollection': + geometries = shape.geometries; + for (var j = 0, len2 = geometries.length; j < len2; j++) { + convertorParse[geometries[j].type](geometries[j].coordinates); + } + break; + } + } + json.srcSize = { + left: convertorParse.xmin.toFixed(4) * 1, + top: convertorParse.ymin.toFixed(4) * 1, + width: (convertorParse.xmax - convertorParse.xmin).toFixed(4) * 1, + height: (convertorParse.ymax - convertorParse.ymin).toFixed(4) * 1 + }; + return json; + } + var convertor = { + formatPoint: function (p) { + return [ + (p[0] < -168.5 && p[1] > 63.8 ? p[0] + 360 : p[0]) + 168.5, + 90 - p[1] + ]; + }, + makePoint: function (p) { + var self = this; + var point = self.formatPoint(p); + if (self._bbox.xmin > p[0]) { + self._bbox.xmin = p[0]; + } + if (self._bbox.xmax < p[0]) { + self._bbox.xmax = p[0]; + } + if (self._bbox.ymin > p[1]) { + self._bbox.ymin = p[1]; + } + if (self._bbox.ymax < p[1]) { + self._bbox.ymax = p[1]; + } + var x = (point[0] - convertor.offset.x) * convertor.scale.x + convertor.offset.left; + var y = (point[1] - convertor.offset.y) * convertor.scale.y + convertor.offset.top; + return [ + x, + y + ]; + }, + Point: function (coordinates) { + coordinates = this.makePoint(coordinates); + return coordinates.join(','); + }, + LineString: function (coordinates) { + var str = ''; + var point; + for (var i = 0, len = coordinates.length; i < len; i++) { + point = convertor.makePoint(coordinates[i]); + if (i === 0) { + str = 'M' + point.join(','); + } else { + str = str + 'L' + point.join(','); + } + } + return str; + }, + Polygon: function (coordinates) { + var str = ''; + for (var i = 0, len = coordinates.length; i < len; i++) { + str = str + convertor.LineString(coordinates[i]) + 'z'; + } + return str; + }, + MultiPoint: function (coordinates) { + var arr = []; + for (var i = 0, len = coordinates.length; i < len; i++) { + arr.push(convertor.Point(coordinates[i])); + } + return arr; + }, + MultiLineString: function (coordinates) { + var str = ''; + for (var i = 0, len = coordinates.length; i < len; i++) { + str += convertor.LineString(coordinates[i]); + } + return str; + }, + MultiPolygon: function (coordinates) { + var str = ''; + for (var i = 0, len = coordinates.length; i < len; i++) { + str += convertor.Polygon(coordinates[i]); + } + return str; + } + }; + var convertorParse = { + formatPoint: convertor.formatPoint, + makePoint: function (p) { + var self = this; + var point = self.formatPoint(p); + var x = point[0]; + var y = point[1]; + if (self.xmin > x) { + self.xmin = x; + } + if (self.xmax < x) { + self.xmax = x; + } + if (self.ymin > y) { + self.ymin = y; + } + if (self.ymax < y) { + self.ymax = y; + } + }, + Point: function (coordinates) { + this.makePoint(coordinates); + }, + LineString: function (coordinates) { + for (var i = 0, len = coordinates.length; i < len; i++) { + this.makePoint(coordinates[i]); + } + }, + Polygon: function (coordinates) { + for (var i = 0, len = coordinates.length; i < len; i++) { + this.LineString(coordinates[i]); + } + }, + MultiPoint: function (coordinates) { + for (var i = 0, len = coordinates.length; i < len; i++) { + this.Point(coordinates[i]); + } + }, + MultiLineString: function (coordinates) { + for (var i = 0, len = coordinates.length; i < len; i++) { + this.LineString(coordinates[i]); + } + }, + MultiPolygon: function (coordinates) { + for (var i = 0, len = coordinates.length; i < len; i++) { + this.Polygon(coordinates[i]); + } + } + }; + function geoJson2Path(json, transform, specialArea) { + specialArea = specialArea || {}; + convertor.scale = null; + convertor.offset = null; + if (!json.srcSize) { + parseSrcSize(json, specialArea); + } + transform.offset = { + x: json.srcSize.left, + y: json.srcSize.top, + left: transform.OffsetLeft || 0, + top: transform.OffsetTop || 0 + }; + convertor.scale = transform.scale; + convertor.offset = transform.offset; + var shapes = json.features; + var geometries; + var pathArray = []; + var val; + var shape; + for (var i = 0, len = shapes.length; i < len; i++) { + shape = shapes[i]; + if (shape.properties.name && specialArea[shape.properties.name]) { + continue; + } + if (shape.type == 'Feature') { + pushApath(shape.geometry, shape); + } else if (shape.type == 'GeometryCollection') { + geometries = shape.geometries; + for (var j = 0, len2 = geometries.length; j < len2; j++) { + val = geometries[j]; + pushApath(val, val); + } + } + } + var shapeType; + var shapeCoordinates; + var str; + function pushApath(gm, shape) { + shapeType = gm.type; + shapeCoordinates = gm.coordinates; + convertor._bbox = { + xmin: 360, + xmax: -360, + ymin: 180, + ymax: -180 + }; + str = convertor[shapeType](shapeCoordinates); + pathArray.push({ + path: str, + cp: shape.properties.cp ? convertor.makePoint(shape.properties.cp) : convertor.makePoint([ + (convertor._bbox.xmin + convertor._bbox.xmax) / 2, + (convertor._bbox.ymin + convertor._bbox.ymax) / 2 + ]), + properties: shape.properties, + id: shape.id + }); + } + return pathArray; + } + function pos2geo(obj, p) { + var x; + var y; + if (p instanceof Array) { + x = p[0] * 1; + y = p[1] * 1; + } else { + x = p.x * 1; + y = p.y * 1; + } + x = x / obj.scale.x + obj.offset.x - 168.5; + x = x > 180 ? x - 360 : x; + y = 90 - (y / obj.scale.y + obj.offset.y); + return [ + x, + y + ]; + } + function geo2pos(obj, p) { + convertor.offset = obj.offset; + convertor.scale = obj.scale; + return p instanceof Array ? convertor.makePoint([ + p[0] * 1, + p[1] * 1 + ]) : convertor.makePoint([ + p.x * 1, + p.y * 1 + ]); + } + return { + getBbox: getBbox, + geoJson2Path: geoJson2Path, + pos2geo: pos2geo, + geo2pos: geo2pos + }; +});define('echarts/util/mapData/geoJson/an_hui_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '3415', + 'properties': { + 'name': '六安市', + 'cp': [ + 116.3123, + 31.8329 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„„nJ‚UXUVƒ°U„ÑnU@mlLVaVln@@bn@VU@xlb@lšLnKlšƒVI„JšUVxnI@lVL@b„Ž°VX@˜b„x„nVVUnVVnU‚›@kX@VwV@„al¥UUnUWa@ƒ@wĸU„LU¥lKUa@aUI@alLVaUƒ¯anƒWkUKm@XV@VaXlW@aU_UWVUƒI¯@ma¯W¯™™I@UU@WWU@U@@UU@VkV@@WUUm@UaU@„lK@IUK„L@KWmXUWaXI@ƒ@a@a@U@U@KV¥lw„k°b²JVIVKlV@UX„la„Ul`œUVLVVVUšJ„U@Lnm@_VK@KUIW@™J@Xk@WW@U—ƒmm™XmWk@kK@aUUƒVmmkUwUmWL™@WmU@™UJmUULkKWakLWVkIƒlƒwULƒW@X°lUJ@°ULƒWV—wmJ@bmb¯Vkm@@WkWm¯wƒL@lkXƒWmXym¯UImJUbkV™@Vn¯„@V@lUbƒ@mk@maUxmlUbULWn@J—LmKUkWKkwUKƒbm„X„WxkVUKmLkVV@JUUWL@xkJUUƒV@X@VVlUbVX@xk¤šx‚¼œxWxn„‚nn@Þ¼„JVb°aVn„@šmlnXU„JlbVlkz@‚lUŽlXJmxVxXnWxXÈWlUŽ@šUxU@VX@xUL@šUÆmLnV@lWXk@@JlbXblnlJ'], + 'encodeOffsets': [[ + 118710, + 33351 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3408', + 'properties': { + 'name': '安庆市', + 'cp': [ + 116.7517, + 30.5255 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@n°‚znW„XlW@k„K°xXn‚l@Xn@l‚°Una@anI˜xXU„ŽVK@¯VIkW¯X@‚„VK„x„klJXUlKXblLVKnVVIšŽV@Xn‚@šŽXKVnVxlŽnn„UlmV@²óUkV™lW„b„lƒšƒn@VVVIn@lw@WVIXblV„@Èx‚aUaVIVVnKVLšK„ƒln@b²K@»U£ƒÑķƒġÝÅb™K™a@Im@ۍ„@kWÓkkmKÅnóJƒUÅ£›W@w„ĕ@wĉţ¯¯ƒUkK±l¯Uƒ¥UÑkÝUķ»Ý¥¯™JƒIUŽVbUl¯ÈV¼VJU¼Vb@bkLUl@„VJ@bUXǚ@lkVmXmKkLVxš‚Ž„VƒL@VkVVVlzW˜kbmLUUUbVbUV™šlÒnJlUnLllUL@bU„Vx„l‚LXVƦÈVU¦WJ'], + 'encodeOffsets': [[ + 118834, + 31759 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3411', + 'properties': { + 'name': '滁州市', + 'cp': [ + 118.1909, + 32.536 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@š„@`nnl@„xšK@X°KXV˜IXVlbXVWnX‚lL@šÈ»‚LVan@VJ„êVVn@‚X@laÞbVaƒyn@„_‚xnWVXnWl@VnUVkI@l‚nXKVLVV@V@kW@LlVô„@J@bVnnKnkVa@»lç@ƒnwšKma™UUUVњ@n™mWXalI@alVn@VwUaVU„@„nlaôJnU„VVXlJšaXXVK@UšV@VWx@nXVWšXVšUlLUbV‚ULVVnUVbUbVbš@@a„KÆnnKVK@U@UU@@a„@Vƒ°¯ÈJVIlķ@aa˜UaVKU_@mkxUI@aƒUlyU@@™wkKWmUbUnUVWbkJW_J@bƒn@Vm@@KULk@V@@bVbÅm@LW@UVVbkK@UkKWL@VULUKWIUJUbkK@_WVXU›Jka@XƒVa@kšy@aVIUUW@@m„UlLœKWÑUKVan@UkVmmIXKƒaVaUwVU@UmykU¯@±UUL@WUIVUU@KkIWaƒaU@kUUaǃUó»mKƒk¯@y@kWK@bkI¯`mn™l¯XWlkVUzUJlbUbVJl@nnm„@VULV`XnWƗbmUUn™JmUknƒJ¯km@ƒyk@kU›xL@VUbmnn¤lX@`™z@JmaULUVl@Xn@xllkXWa—aW@UVmUbƒ@mVXšWxXbWbUŽƒÒnVVnVVUL'], + 'encodeOffsets': [[ + 120004, + 33520 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3418', + 'properties': { + 'name': '宣城市', + 'cp': [ + 118.8062, + 30.6244 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Vb@„XL˜JXxlIXxlVlV@I²¤šnlUnVšU@VULWVUJ@Lnb@lV@UnV@@VVVlLnbnJ‚UVkUUVWn@@anUVnVJVIV‚@@nUJVbUb‚„@VUbVK@bn@VbnIlxkllXVlXKWUXUlL°¤UVVb@bš„UlkXW‚ƒxXz@‚„Ila„UlƒnUlJVInVÆJ„U„LVUnV„K°@VnlVnxV@XLlK@wVL@KnUlJXU˜bnKVLX„lUw@VWlLXKm@@a„@VLnmlIVVnKn@škVašVlwk@@a@k@ƒVIUa™@maUa@wna@kmWƒ™UUmVUIVǗ@aƒKm™aƒ™kU™J@InmUUaVa„k‚lX@Vk@m@VU@wnK@alKVUkUkKƒbmUkmƒ@U£WVk@@UÝbbƒaÇx@b@WVUa¯ƒ@wVwUUV@VwnK@KWaŁ@KšIUyUI@WmXó™UbWaKm™@km@IUyƒIUaWKƒx@zUKUL@llVUnkLVVkJWX@VUKUVƒIkVWakb@VWb@n@JkXUlmL@xkL@`VxšLUÈUJ@Vm@@bmIUlUL@VUVVbknm@mKUw™KVÈ@J@LV±kkJUIƒl'], + 'encodeOffsets': [[ + 120803, + 31247 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3412', + 'properties': { + 'name': '阜阳市', + 'cp': [ + 115.7629, + 32.9919 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@V™nƒš@ša„k°aš±@‚¥@UUI@aUmlwUUx›b@¥XU@mmI@a@Kn@@_W@@W„I@mšUVVXUl@XaV@‚K@I@a„LX@aVI°K@KVL„UUw‚yXkšK@kšKÆbXnlK@k@a„JlU@w@U@»@aXKWƒn_‚JXkVKnƒ@°LlKXƒW@¯Uƒ@aUK@kmJUw™VƒIUJ™„kŽmL™K@kka@wUVm@@am@UkUbkK@nmVƒÒ¯VU„WVVmIƒƒULk@ƒƒma@kkKƒƒ@nUbUamU™`UUVUkKVkkƒW@@bkmƒnƒmUXVKXVƒL@VƒbU„m‚™bVXJ@nmKÅI@KWKUXVJUL@VUKUX@KUKWL@LUJmaXXm@kVVV@L@VUL@VlK@L@V@LUK@VUb@UUU@°@nVxU`‚Lkn@`@XVJ@X™Vm„k@UKmV¯LVVn±Wm@Ub@JlLUl„@VLk„@lmVVn@bnV@V°IV™šaVJXI°K°V@XXVlVVU„nšKVlUš„bWXnV@bV`U„„@@m@@‚ƒ@nxmn@bXVlL@¤nb„Ul¦šVVUnJVU„Vl@@bÞL'], + 'encodeOffsets': [[ + 118418, + 34392 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3413', + 'properties': { + 'name': '宿州市', + 'cp': [ + 117.5208, + 33.6841 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@UWU@bkW@aWU@aUIkWV™lLXb„lVIUVV@‚mn@V_n@VaUK@I‚@UašanJVU„@lV„UVnnKVVlaUa„I@wnK‚Lnll@nVlk@wVKXkl@@b„bUJ@V‚U@U„UUyVk@aVUXwlWXX‚WU¹@aU™@WUI@mlUšn„J@Il@šaXbV@VKl@XxVL@W„IšJlb„@„al@„IUUm@@aVK@¥¯—@mUķ¯bWƒk£Vm@akm@VaÅ@UVWaƒ@UJWkƒJ—UƒbWbU@UlƒXk@ƒamV@K¯nk@ƒlU@Uxmz@bU`ÇbUbÅVm£U@Ww™x@akLUK@UlakwUJWVkLmaUal@n_ƒmVUnKVUUmÅXWa™@kJmx@XUJ@bVLXxl@VVUVV„UbkLWbU@@lUVV„VVX„›K@XkJ@nU@@bV@VxUVlb„U@xXLWŽn@UxVbVĊ„V@b@XV`mnkJ@kUKmbƒaU@VbnbÆx@XU@@`k@@bl„™@@bkL@WƒakXWaU@Vmkx@XWW@@wUUUbƒJ™U¯V™@¯ÞU@WxXŽlL@bkb@ŽlVlnb™JW@kkU@mbkaWJ—IVlmz¯`UnU@mb™@@„ƒ`@bkVlœnV@b@šV@„aVxn@Vx‚KXnl@nbVK„bVK@a„_V@Vƒ„w@W„LlwnK@UmIU@VWš@šUÈ@lKnal„wš@@V°@šaUmlUUw@„ƒV@@UXK'], + 'encodeOffsets': [[ + 119836, + 35061 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3410', + 'properties': { + 'name': '黄山市', + 'cp': [ + 118.0481, + 29.9542 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lXnlWX@VUJVnUJVzXJVx„kVJlI²l‚U@K@IUǚLVxnLn@lmUaVU@UVKVknJ@an@@UVIVǙKUw@_lK@wnKVklW@I@mXa@UlaXblU„JVUVL@UXWlIUUlKVmkU@kVKVL@y„wXLVb„JVz@Jlnš@nŽ‚LXbVaôšnW@la@UVWUa@@a@mk@WIk@VwUa¯¥m@UUVK@ImK@aX£ƒkK›ÅV™a™™ƒ_@±ƒakXWW—LƒƒƒnU@@a@¯mK@L™JUWwUV™VmbXX@lWLn`mzUJUb™Lƒ„k@makVWmkX™ambkKknƒaƒ@ƒaƒb@‚U@Unm@—ƒWVƒ@VbUbUJWIk@@lmL@°UVUVm„nš™@@kmWkb@xƒ_m@@aU@b@JlŽUz™lWxXn„@‚b²@l`„IVl„UlL@VšK„nVbUl@VlIn@@b„bVWUk‚@@bX@Valb@bnb°Vn@„xVKlbVnV@V‚x„L@ln@UXVV‚L˜'], + 'encodeOffsets': [[ + 120747, + 31095 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3414', + 'properties': { + 'name': '巢湖市', + 'cp': [ + 117.7734, + 31.4978 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VV@blL@ŽXlWnnšnŽ˜„@VXXl@@WšIX@VJ@LšxŎxlnšŽ@bXJVblX@VVbUVn@VbUVlb@LnJVbVLV‚XLšÒVL„ÒšV„bVIVylUXk°Wšknm°_lJ@aXL@l‚z°@„lnLô¼V‚È„VUUaVKU@WW@@UUa@knmVLlaV@„a@kšak±@UmwkKmk™lj™ÝUUkL@mlIVmnÝWkkUÝ@KƑĉ™a@»ƒmma@mX™¤¯Uƒw@ƒ@UU@bU±±L@akmƒ„™LUKmLUUUJVbbÇwƒ@kUWaUJ@Xkxm@UJUUm@™„k„ƒ‚ƒakXUšVl±ôU@kn'], + 'encodeOffsets': [[ + 119847, + 32007 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3416', + 'properties': { + 'name': '亳州市', + 'cp': [ + 116.1914, + 33.4698 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lU@Un@@anUlw@KVmUwlaX_lKna@KU@@kWKUU@ankW™XK˜@@V²VVIÈU@al@VaÈamK@wU™@klaUƒV@XƒVUU»WUUbkmUkVmk@aÈw@mWU@VkIkVWKUÑķXȭºU¯lƒ@kkLWmÅa™L@l™LWlzVxƒVUK@L¯LUJ@bWƒK@b@JLU@Wbk@WVUU™V@nƒJ@XX@@`m@@L@bnJ@nWV@¦œa‚wVVkxVn@bVJ@V¦@Ž™²¯bƒl™b™@m„UšUŽƒŽ@¼ƒ¦Xb‚UV`@nnxUxWLkUkVWKkV@XV@@VVL@VX„@lVV@L@blL@`šL@xXKVL‚@„VnUš@lwnU@ml@XnV@@UVW°LnalƒUI@aUK@a‚a@U„kXW@I@mWL@UXK@UVW@U‚@@k„Wn‚@@V„@XblaVxšL@bVKXb„IlJ'], + 'encodeOffsets': [[ + 119183, + 34594 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3417', + 'properties': { + 'name': '池州市', + 'cp': [ + 117.3889, + 30.2014 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': [ + '@@„V°°ĊŤ@xƒĖ@xœXƤ„VôIÆmnLllXÔ@lƒÜŽn@@JšbšLÆaĢÞĸ„°VVUUKVanK@UV@VL„VVn„ln@‚xnklxXamk@WV@Xa˜@naVk„Klk™@mkUWwkJWw—IWK@ƒUaUwWIUyVIUmVI@UXWmkkW‚—KUUVWm@@kƒKw@U‚UUmkaULƒwm@¯Uma@akaUbW@@a@VlUXƒa@am@kJ@UVkUaƒm™L@UkKƒVUkƒJk_±@aƒ@WmXwÇkkaVaUa±ƒœwV@VkƒwnyUaW@UU¯amLk@m™@kmmU™™¯K@L@lUX¯ƒWlkXƒŽVb„bƒVUL@J@LVKnlJXnlb@`nXlalV@bnL@Vnb˜¼@lXbWlkL™K@zUJmIUxUVUVmX', + '@@llUL@VlxšL@a@UƒwXa¯@' + ], + 'encodeOffsets': [ + [ + 119543, + 30781 + ], + [ + 120061, + 31152 + ] + ] + } + }, + { + 'type': 'Feature', + 'id': '3401', + 'properties': { + 'name': '合肥市', + 'cp': [ + 117.29, + 32.0581 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„L„xV‚ĊLÞkšVlVVXaWaXwW™nU„@‚anVVUX@˜bXblWkk@wWmk@VUVKnb@Išy@_kWm£nmVa@U‚KœwlVl@„zn@°l„IlmnVšIVmnV˜aXÅWmU_VK@Unƒmmk@UIVakaƒa™UƒÑUK™ÑWKUUKUamI@KkaVUUam@VUUa@UkWUaWI@a™kmōw™wUL@`mn@KƒV™IUVUUUK›Vk_ƒVkbWƒ@VkUULUJ±I¯aƒlkxU¦@L@V@V@b@b@„WJXbWVXn@LƒKVL@JkLƒŽV@Vbn@VV@XU@UlV@@VV@V@XXV@@VšJ°š°Xnb°@„JUVVXV`@bkXWŽUbU@WŽn@VLXlm„°bV„UbkK@bVJ@bVbkLV¦ƒKķV@x@„XbmVVVk¦'], + 'encodeOffsets': [[ + 119678, + 33323 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3403', + 'properties': { + 'name': '蚌埠市', + 'cp': [ + 117.4109, + 33.1073 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VÒXLlUlJ@UXV@nÇx@bnlUVllnVaXVV¼UVW„U@V„²wVV@Vl@„VnwlIš@XbÆWVnUVmLUV„nm`k@VbnblKXUVIlxkb@VVLlK@bšwXxV@n¤ÆUVaÈaV_@anyVwV@„kl@°m@LnU„bl@„WVkV@Xa„a˜V„IXl‚IV‚„@XbVUÆ@XKWwUkmW@_UmnIlJXkWKXmV@‚w@_XV@Kl@kU@KlX@@UUUUKWLm@klJVUUmk@mXUWmXwƒ`m@„zUbÝakbW@m@UUƒéUIm@UbKǼ@™kKWXmWUkaWU—JWU¯L@W™Lƒwk@mm@_™ƒÅl™UVkmWUnV@VWLUb™bƑĬ¯l'], + 'encodeOffsets': [[ + 119543, + 33722 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3402', + 'properties': { + 'name': '芜湖市', + 'cp': [ + 118.3557, + 31.0858 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„bVaV@XllLXU°ŽlL@V@VUnVl¯Ikš›VUVU@@b@lUXUWmb„n@¼šbƒĊ‚LÞ@lVXlmÞUnkJ@nlKVVšÞXklWVaVI@aUKn»lL@Kn@‚XXwlm@mn°@„V@Wy„wXlWVk™ƒ@aUaVU¯£kKWVXVWLUkkWlkkwmJUam@@aULVa@UƒVaUaVI@m‚@UUJUIUmmV@bm@UXVVUlVmImakKUU@UU@VmU@@kma@KVIXUVK@U™VmUkV™m±£@JkU@nlšk‚ƒLUlmb—@WbU@@XnlWb'], + 'encodeOffsets': [[ + 120814, + 31585 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3406', + 'properties': { + 'name': '淮北市', + 'cp': [ + 116.6968, + 33.6896 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@lnnK@¦n@@V‚V„@@VV@nIV„V@VW²a@b@bVnUVVV@V™z@lš@°UšV„IVaVV@x@ŽXX@WlwUnV@XblW„b@XlK@aš@kƒ@al@@_V@@WÅwmaUaV@„bnaVL@llInmU_@W@aƒUUĉUaVwm@XWK@wƒVkaVUUwU@@aV@@mlI@WœLWƒUUUƒVU@kV@XalKVaUƒVUUUk@WwUK@aVI@WƒUk@@UUU±xkb@lVš@xnLÇbUbk@@bÇVUJ±U@U—@WLXšml@bVVXL@lV@@LmbkLW`kbVxUn@LkxmV@bm@@VkV'], + ['@@VVVkV@¥@UV@U@VUUJƒkWakKUšlXVJ@bXV@blX@aXV@V'] + ], + 'encodeOffsets': [ + [[ + 119183, + 34594 + ]], + [[ + 119836, + 35061 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': '3404', + 'properties': { + 'name': '淮南市', + 'cp': [ + 116.7847, + 32.7722 + ], + 'childNum': 2 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@°kƒīšaVaXK@U‚UVmnXUlšVÆkVKUUUmmU„ÑkU™UÝlĉKUƒwƒKƒbU@UxW@@lœmVUUVmUUƒmƒw—aW„kL¯K@Žm„ULWlIm`X„WL@b@¼@V@xkVƒI@b@l@lk„V°Ȯ¹ĸW'], + 'encodeOffsets': [[ + 119543, + 33722 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3405', + 'properties': { + 'name': '马鞍山市', + 'cp': [ + 118.6304, + 31.5363 + ], + 'childNum': 2 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@šNJnllLnxV@laXLVKma„aXbVI„bVKVVVIVyn@n_ƒƒW@@ƒ„UnJlUVVXlLnaUWlV@VV„IXW@_W@XK@K@UVUUwVamÑXmmwƒw™KUnUK™çU@ƒJƒU¯@mŽ@nknWxWm@@LkKm¼VL@bUJUbkXWl'], + 'encodeOffsets': [[ + 121219, + 32288 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3407', + 'properties': { + 'name': '铜陵市', + 'cp': [ + 117.9382, + 30.9375 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@„ÒV¤@¼V²@aVV@Ž@„„x°Vš£nW‚@nbnaVXVW@k@aV@VUœUl™°JUkVm@U@UkK¯WVkKWkU@Ubƒakwmlwm@ƒkUmƒUUKU@@VmLUbVLUV¯U'], + ['@@LllUL@VlxšL@a@UƒwXamK'] + ], + 'encodeOffsets': [ + [[ + 120522, + 31529 + ]], + [[ + 120094, + 31146 + ]] + ] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/ao_men_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [{ + 'type': 'Feature', + 'id': '8200', + 'properties': { + 'name': '澳门', + 'cp': [ + 113.5715, + 22.1583 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@HQFMDIDGBI@E@EEKEGCEIGGEKEMGSEU@CBEDAJAP@F@LBT@JCHMPOdADCFADAB@LFLDFFP@DAB@@AF@D@B@@FBD@FADHBBHAD@FAJ@JEDCJI`gFIJW'], + 'encodeOffsets': [[ + 116325, + 22699 + ]] + } + }], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/bei_jing_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '110228', + 'properties': { + 'name': '密云县', + 'cp': [ + 117.0923, + 40.5121 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@vIHZDZQtDLNMXIbHRCXXITbJ@H`LGPRDDJNCLHTOCWFGvGBUJMKGFO^IHWXITQCI’Y^AXGfRˆDXF`DJOLB~G\\DZIHHpErUVMhHb]\\M†BVF@FTP`@zTbD\\@~M\\K`H^EVODWICAakAQXoIcCOCIgGYNWFWNGGKKGaJEGMEIKYJUT_J_Go@_SyQaSFMEGTcYOQLIIi@EKAUPCV[EEXQCW|aMUMAaYCYNIDGGACIMGGSKDQGaF_C[GaB@GOIiOKAYL“mI@CN]F[SWWAcKKI@HMUimEKbeYQYISNUOcBKPIFBNgvDPGZYFSf]CMSIWGEUFgDIQ[MeDMJS@RR@LphFPCHaBAJKF@J]IBJO@HlO@@RKAMPJHCNDJTHFP@ZGNANBRFH@J_fM^ONJNF\\VTDJHDON@XRND\\XRCPVETCLBVKDFJINHRGPRV@\\CLJN@VbXbLVT'], + 'encodeOffsets': [[ + 119561, + 41684 + ]] + } + }, + { + 'type': 'Feature', + 'id': '110116', + 'properties': { + 'name': '怀柔区', + 'cp': [ + 116.6377, + 40.6219 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@JHTVHXCHPfnDJGHNDJSB[JSBGVSAOH@PMPuDEHHXZN@PHF@ZLJ@LHVYJA\\OFWP]BMtMBSRGV[JeVAPQVIFENMD¡–@^NV\\JH@NNL@NM\\kTQ\\I^FNIpBHGTBFFAZQfKDIXQTLXFXNNVMVHRGpCFLlRLEVBBH`IVO\\G`RDPAXLXBXORHZEHTDLLN@VGTMrQNFPeASKG@GMOAKBYMK@GTUHUXSHMVDNMOUEOZMJML@^KRACMZEZMRQLUHE@OFENPR@DI\\ChMHIDG\\GJMDWHCKGMDCIQCHO_K@GaIJSWWQDaGWJMNCKRsCYGYuJUSaKaW@UIMDK@[QUHOGQJMEILCAUDKFSOUQD[WMC‚Q@WPMGCCIUSE[IMPMN]`e@IEGAQBMHM@YEOSGCIDMIGNOLB@QP@GkP@AI^J@ILEBIbADGEOog@KQQWSekWQQUOFKZLF@PUNmIaHIUeBCTSHENcJa@_IWSaGu`GLSBKJQFOXGDXVQVOBIHcDSJWBEFGTMH[^mLaXcHiKElTRKtFXZ`MHMPCNRDxZˆB\\ICIHK@KŽHbIVFZ@BPnGTGbDXRDJaZKRiGEFSFEJhjFNZFjn'], + 'encodeOffsets': [[ + 119314, + 41552 + ]] + } + }, + { + 'type': 'Feature', + 'id': '110111', + 'properties': { + 'name': '房山区', + 'cp': [ + 115.8453, + 39.7163 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@h@bl@HRJDZ``TA\\VVD^H`\\pF\\JŒ`JGv@ZO\\GPSTEjPTR`FnEbDTDHEhLFMTK@ETSPULKEI@OVISKSJACEQNQbV˜IXGDIN@dMB[IIBcN]ZHNLP@XOWCFWŠCNRHTpATD@^NVNLED@Rh@jCEF}E[OOHUEW]W@QGGDIQSH_MmFmCUT_K]i@MHCMW—FCF‹E{BMHMPOHKS]CFNGBELDH_@BcAKOACESAOBELaXAROB@FODMEDWJAG[aE@UM@DImEWJMC@OeCA{aE[@{L@MINUCQXKfUJORCHqJBF@TCXWNQX]M[EAJO@@KMBQJIC]EWMCCUBEBFHKDOTMBGNGF]MWDBRDdMDQVyE@LPVHDCP@JVVMTG~HNSH[CmRUvHPHBbA\\PTNRC\\YNJ€PRARPJDDR'], + 'encodeOffsets': [[ + 118343, + 40770 + ]] + } + }, + { + 'type': 'Feature', + 'id': '110229', + 'properties': { + 'name': '延庆县', + 'cp': [ + 116.1543, + 40.5286 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@^AXOPEB[ZIGU@KKI@YGE@OYMGWFGvCNO@OPGTBHUTA\\ITACIGMIHmCOeDGGWSUIGimYEEMgiFITEFEjHLQbYCIWQaCSHmHAOY@UEaJG@LGLDJ[J‡AwYQCDMNONGY_EWLsSQFkMO[NWAIGaIYL@HMBOKiOQDWEUDMQSF_QIUBWdg@[NaAKQ@M]OQ@WhgLUMMFYQDIRCEUZOOCIOJ[KIUMKL@HIDKVEBM`HJAJSJUdBLGNEdMBMO[BYEWJSNKNaD]PE\\SjOT_RQVEZPpƒNQXfŠNA~lNG`@PNLp¼RFLfbdKbATUh@FSNWjGFZVLFHVA~X¨PPROfFJbNJPLFbENJPrEFNPFRHDDJdENJLVEPBJTVTHGHFRFH@PXP\\ORQHW\\BjWFDERLPPBbB\\E`B\\D\\L`@F]FCnJ^AZL'], + 'encodeOffsets': [[ + 119262, + 41751 + ]] + } + }, + { + 'type': 'Feature', + 'id': '110109', + 'properties': { + 'name': '门头沟区', + 'cp': [ + 115.8, + 39.9957 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@V@XMnGPY²‰JQNEhH\\AZMPDVTTDZCPiJkHSHCjIdFtEHITCNITQEKUAMCEIKCECABYESKFWAKBEIIHABGDCKCAIHMHALKEI\\CFIBILIJQZS]BBEECS@E@@C]COKI@CABAAEEDMGƒCH]A[M@CJWH—JaUMRFRBDTITLUJ@PFJKLOVST@FSLENgKGFSCaCmF_ESQiOSFOT[HYPu@IH‹_[IoE_[]GUC[USB__CYQI@Gakg@qZeHQNMNV\\FVLPgJAFJPRLCH[XcPELUT[JiV_EELFTADBXRTRLJC@fHXHHbPd`fR@NfT`@TLplHMpCEJHJBVLFŽ@JT‚VnG^KXDXHNVGRLRXFJVdDHSNWLGfEzA'], + 'encodeOffsets': [[ + 118635, + 41113 + ]] + } + }, + { + 'type': 'Feature', + 'id': '110114', + 'properties': { + 'name': '昌平区', + 'cp': [ + 116.1777, + 40.2134 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VNLJI\\JPPDYPFVQDCJZRNEVNhKXgR@^P@NLRbB\\Mh@XcVARJE`RTCNFV€XRCjPPLNA@GZKbJJHXB\\MNPjLdGbWnK\\]NGHSFEXATIdCJGPARUWUHCPWRELITAHKv_E@iYCaW_BQ\\Y@QIO@QDCIGZCEMWGFMFAFgHEDOCSqKCCFGAMKEAC@ODGCGs@WH@KQA@EE@CE@GEA@EH@GGUEEJEAYD@JM@@DAA@FHD@FTJEHUC@JUBKCKG@G[CIIQReAYhO@OXGDO@@FF@IHJFCPEBACBIAAKDOABXARHPNEHGbQAAKQFGIAM[C@WHKaGiCEGOA‹HUKCIokSCUSOCYN[BgGMFIR±ŠOZmHWNU@ShbbXDHVXXGJ^lZ@PZ\\Nb@\\FHJAD'], + 'encodeOffsets': [[ + 118750, + 41232 + ]] + } + }, + { + 'type': 'Feature', + 'id': '110115', + 'properties': { + 'name': '大兴区', + 'cp': [ + 116.4716, + 39.6352 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@F\\E~DFN@BDFEpHFCHBBEGCDCJBHUDSBB@ELCPbF@B\\J@BJVAFJ\\ADKTCBGECFMT@BMN@@FH@DaNBEnvB@FPBATK@FHEFIAKFBFL@@PKBFJHC@FXBRAFCDMPDTOL@JIVFDHH@DDH@BGRFCDLD@N^@@CNA@KNOAEBCECFEGCFGMGFIPMOEJOLBADBBHGG@GCHIECY@INC@DMGS\\AIOZAAEYA@GT@KKMBEETCGMVINFxA@MJADB@FlA@HJA@NND@DFA@DVAZBBOFKH_JA@K^GBC@EFE„G@gAENMXKJigC@IbSJMqGOP£RGSMGE@kbQFDPEFiBSGGSBK]I{CDWCIDOic[C_G@SuSO@EWKCO@MNY@\\uZOPENQD[LKESSKGBKEG@EJGAGHoH¥CqhifeJkX_XFFGHFNEDFPENKHM^IFIVL^S`DVEnNnG`RTCJHH@R^XFXGVPP'], + 'encodeOffsets': [[ + 119042, + 40704 + ]] + } + }, + { + 'type': 'Feature', + 'id': '110113', + 'properties': { + 'name': '顺义区', + 'cp': [ + 116.7242, + 40.1619 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': [ + '@@EhEBENXHFNYDJHCD@RJP@R[ZARX`DbjZF@bHXT`Jb@dIFMTGDSfAJVbGnJVM@OKELYPERVXRflXTT@NIfC\\NJRhCVEHFJXNT^DTeZEHYCOhuAMJELOdAVPTMOWBWNMNEJgl]@WGUFIC[T{EEDEHGCIGMI@SECUQI[D{A{GQESPUH]CsiMCmHUeoHENcAaDGCMDGMQCACCBaCGLMAHB@DIEQLOAAEEJ@CW@CDINGAAGKQOCgV@LG@BEGDKNeREFBNCFIDOPKD[@YRW@GFWDAFE@EHDDrLDTCPGF', + '@@KrJEH[\\B@FF@CHFBHUN‹AJKADGECBCMAG^E@EbI@BEGP' + ], + 'encodeOffsets': [ + [ + 119283, + 41084 + ], + [ + 119377, + 41046 + ] + ] + } + }, + { + 'type': 'Feature', + 'id': '110117', + 'properties': { + 'name': '平谷区', + 'cp': [ + 117.1706, + 40.2052 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ZJZRafFLjn€VGNJ@LLBdXX\\T^EDMJ@”nZKLBjPPJ@HbA\\H`DbERHLCFK^BZaFWXQLAGMHa\\OLO@SBIpBdCLƒVQfElO@GSAKEDQTC@GEBKG@ORIJBDAPDFA@CaOq@GGQAAEJK@KMUGAAGEAa@MGMBGCGSIIW@WSUCMDOJeWOM@IUF{WMWaDIMgIoRoCOKeEOEAG_I[cg@wLIFENQFDVTFJ@HNDJGHCFFFS|D\\EJHV@Xk^IhMFMNAXPX'], + 'encodeOffsets': [[ + 119748, + 41190 + ]] + } + }, + { + 'type': 'Feature', + 'id': '110112', + 'properties': { + 'name': '通州区', + 'cp': [ + 116.7297, + 39.8131 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@FDAJTGDNDCTDDEDBBE@DT@@EHCDGJ@EIZ@@FDBR@ATFBBVFFE@@HNA\\VE@CLIFNJFNJBCP]A@LJFA@HJEDD\\C@DBCHLAEPF@@DH@APHAERDF\\GIxDTM@CFLBBFJ@CNUPMHECGDBF]BMFPDLRBHHBJMDCX@@DFIBFPBRKJF@CGANBHKbDDABDRDHNNCHDbCdBFMpGHiOYMefKJMC}HWAUNW\\NNBNA„kNU|]HMTMN@MZBLFFF@RIRUT‘BMFIEGaAGGAOIIUGTSFcYKS@MSLYPKRUBU]EWDOI]CKGASgW@MTWKIMCS@uMAKKADMECGAKVUTSDy@IjWLMNBF@hƒHEF@FAD]H@LIBG`ELAPYAUB@CEB@CMC@MIB@GkB@ECAIB@NwBMEUJHNSDFFNALLS@@HZBBFYBJP[BHTCND@JMZ@FDGJHDH@GHAABCKAIPPFONEJNHEHHDEFFDADBFMP@L'], + 'encodeOffsets': [[ + 119329, + 40782 + ]] + } + }, + { + 'type': 'Feature', + 'id': '110105', + 'properties': { + 'name': '朝阳区', + 'cp': [ + 116.4977, + 39.949 + ], + 'childNum': 2 + }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@bFGHBHFBFIVFHHG@@FFB@HDFF@@FRB@LXGt@DHCH@PBDLFBNF@BEXCHEX@ZQ\\@LCPOJCDEAMFEfQLMHCAFH@@KhUNE^AAEHCFDNGVODMI@AEKADEN@CSJw[HCEFQGBBOG@@CE@FOKBDGCAD@C[FCGIB@IE@K^BDOIAEMMIJEDKF@[UMB@GF@EEAUEABSQ@CA@EY@FJI@CHGD@FS@@CAFCACFSCCDCMSHBIECMB@D]@@MKCDCQEAHG@CCG@CGUEIJK@SPOCCNEDQBDNDB@DJCDLFCBBALJB@BVGPBKVO@KHCCCD@FE@BNA@FNCTDDJA@FGB@NBDW@CL@hT@@ZHHQDDDAFSAANBC@HG@EFS@@DE@@PCB@Ue@CADNJB@FCBWA@LI^ix@FIHrH'], + ['@@HUN‹AJKADGECBCMAG^E@EbI@BEGPKrJEH[\\B@FF@CHFB'] + ], + 'encodeOffsets': [ + [[ + 119169, + 40992 + ]], + [[ + 119398, + 41063 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': '110108', + 'properties': { + 'name': '海淀区', + 'cp': [ + 116.2202, + 40.0239 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@plDJVLŒGPBFHjDbHGL@X\\DBNHJREBLRBHaFGŽMGOBQAWPBLCBBAJBDFADOIEJGE@@EP@HCPWP@ZgfBRQJJ\\D@HLHLDVA@IVDFGSI@EGC@EBB@CN@@IZCAGHGaEqGJG@EjwJ]@K@GSA@e_I@NE@CA@Kg@KC@ENCFƒAKQAW@WIMK@V‹@I@@F@^EDFB@HcIaDYCBRRDCHD@EFLN@FE@CJUPEJOJMTBPEDIFCMIAKNOGMRFJNDVBFLSRMJSDGJsFcEiJGDGTIlOjYD'], + 'encodeOffsets': [[ + 118834, + 41050 + ]] + } + }, + { + 'type': 'Feature', + 'id': '110106', + 'properties': { + 'name': '丰台区', + 'cp': [ + 116.2683, + 39.8309 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@hMN@NFTQCFRCBJFA@HJ@@HJ@HJ\\FTACDŒ@@UNLXJX@@MA@@IECAQlDFEHBDI~D@GXCFMVDFCH@@NF@ANJC@FnAB@AMF@@EDCDDLGP@LUOAUH@AIABKAAEDCKID@CCACMWA@EGDEILA@OK@AELEJBFEEGL@BSOA@EuAFmMACbG@@EM@ANS@ENFDAHSDCL[BEIUBAII@A[E@OaKD@FAACTGVIACDHDAFGAEDoGEFACM@i€g@@QFCMKMU@]SCoBGSMQ‰DEXXDWPO@MKYGM^AdJJA\\cNB\\G^„DNHFCBFABDBJ@PL^D@DF@T@FDAF^A'], + 'encodeOffsets': [[ + 118958, + 40846 + ]] + } + }, + { + 'type': 'Feature', + 'id': '110107', + 'properties': { + 'name': '石景山区', + 'cp': [ + 116.1887, + 39.9346 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@NQPHLMJBDNJEFCAONSPIFIVODIF@@EKMFEC@DGQCAQZDbCdJ@GEAFC@]@EJ@DCSB[EGII@@GI@@GEBAIQDDESRMEM@gNYTIRKJAJEJ[DFJKLGBGNBJLDCDAHGBJJAFBLEXTLZFBAFDLD'], + 'encodeOffsets': [[ + 118940, + 40953 + ]] + } + }, + { + 'type': 'Feature', + 'id': '110102', + 'properties': { + 'name': '西城区', + 'cp': [ + 116.3631, + 39.9353 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@XBDA@EIACM@IJAD]BC@SFABISAD]H@@OAEDQEW@BLE„MD@FLDh@@LDBF@@M`J@fTB@H'], + 'encodeOffsets': [[ + 119175, + 40932 + ]] + } + }, + { + 'type': 'Feature', + 'id': '110101', + 'properties': { + 'name': '东城区', + 'cp': [ + 116.418, + 39.9367 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@DBf@@VDA@OF@@CT@FEH@@GADBMTBBECCRCGG@YS@@gDK@A‘C@PG@C^TBAJEB@TADC^IB@J'], + 'encodeOffsets': [[ + 119182, + 40921 + ]] + } + }, + { + 'type': 'Feature', + 'id': '110104', + 'properties': { + 'name': '宣武区', + 'cp': [ + 116.3603, + 39.8852 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@RBX@RFFCŽBFU@aK@WA}CCJGAEFkCBRFD@JB@@N'], + 'encodeOffsets': [[ + 119118, + 40855 + ]] + } + }, + { + 'type': 'Feature', + 'id': '110103', + 'properties': { + 'name': '崇文区', + 'cp': [ + 116.4166, + 39.8811 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@XBL@@bEV’D@BX@AC@MHA@EIBCCDSEMmB@EIDBME@@MG@EDUCENWD@H'], + 'encodeOffsets': [[ + 119175, + 40829 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/china_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': 'xin_jiang', + 'properties': { + 'name': '新疆', + 'cp': [ + 84.9023, + 41.748 + ], + 'childNum': 18 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@›ρȁôƧƦóəʵסʵóƪԫʵѵͩƧͩړ›υࡓɛʵ@ȃ@óᇑѵƨɝɚôóНѺͩɜ̏ԭʵôƧɞñ@υƩ—݇ȂóƩƧ@ѵȂυœƥŌਗ—॥ɛóʵѵƧѹ˜݇̍ࢯ˜əɞυ˜ρͩ̏óਙƨƧŋôōóš̍ͩóʵן›óŋړͪƧѶ@ɜԭ—ԫƦɛȄ̍›ɝȄöςƩȂ̏œñȀ̏œƩóóŎə˜@Ő̎@ɞȀɝŎôƨóנѵȄƧ@óŏɝœóɜôŎ̍ͨςŎ@ƨóôƨɞ݈ʶóƨφó̎Ȁƨ̍ԮòѸԮמ@ѺȀ@ƪၬֆòȂñ̐òȂɜ˜óƨ̒Ŏ̑߼@φρȀ@Ő๐ς̎Ƨφ@ɝφڔ೦Ԯǿࢰ@ƦŏԮƨƨȄƧ۬ɜʶڔŐɚɚóŐôƨ߼˜ôƧƧó̐ƥóŏѺǿƦȁφƧς˜ƨƧ̒@ɜƥƦυ̐ɛƪͩƩəƪʷ̑ə@ȃƨʵנŋྸōਚԭԪ—@ɝƨŋ̒օςʵôƧ'], + 'encodeOffsets': [[ + 98730, + 43786 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'xi_zang', + 'properties': { + 'name': '西藏', + 'cp': [ + 88.7695, + 31.6846 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ôŌנœôʶ̎ͪô™óŎƨŌਚƧ̐ôςͪφ—ɚɝࢰ—݈̎Ѻ—Ѷƨôʶ०ɜਘ˜Ʀŋφ›Ѷȁ̍—ôŏɚŋ@̑ə—@ŏò̍ɜ›óƥôʷƧ̍φѹԪ̍ע@Ѹʷɜ@ôñנ@Ѷɛɞô̐ŏѶƨѸƧƥōƦœôŏô—@ƧôƩ̒ŋƨŌƦǿô̎ɜȁ̒—óʶѶôôО̒›ςƥɜНφσɛȁ̎υƨఱƧŏ@ʵƥœ@ŌóóóͩƨƧóŋ̑õóɞóɝԩͪɝρôƧ̍ƧѹͨڑŎ̑ōóƧࢭͩ̏ѵɝóఱóóԪυô@̒ƥŌ̏Ƨ̑Ȅ݇ŎƧ›ѵӏ@ɛõŏɛȄôӒƧŌѵǿɝ˜Ƨŋԫ@̏ʴƥ@óǿ̑Ȁóǿ̍ςóóυô@ʶɛñρƦƩŐó̎óœѵó̑ͪࢯОóɜן˜Ƨ̏ƥȄ߻̎̏̐ןŎɝɜöɞƩȀôöɛȀóͪ̐ƨƪ̍̎ȂƥԪυО@φɞ˜ôƪ'], + 'encodeOffsets': [[ + 80911, + 35146 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'nei_meng_gu', + 'properties': { + 'name': '内蒙古', + 'cp': [ + 117.5977, + 44.3408 + ], + 'childNum': 12 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ኊȁ૊ö߼ƩɜɛנñԮɛѶóԮô@ȁѸóמ̎ගѺၬ@߼ʶԮӒ߼̎@ŐѹӒ̒Ԫƨöග̑ѶȄ̒ς।œѶɚöɞɜʴڔôôȂ̎—ѺȀς—ƨ˜ƪóԪ—ɜôɛОਕڔԭ˜ѵ̍ѹȂԫ›ɛƥ̍Ȃóɜ̎ô@ʶ݊ੲࢮʵږͪנƨôȂƧ˜̐ͪ@ŐƦƨφԬѶɜôƦ@ŐƧôôƦəŐ̏›@ŐڒѶԬô̐ʳԩНςōôŏɞ@ƨȂѶəóƧ̒ػ̎ó̐Őנóƨô̒@ƨɚɚ@עԫɛɛ@ȁυͩƥʳòևρ—̑ࡗƧͪ༃ॣԮփ̎Ʀ@ôô@ôō@š@ȁѵóƨ̍υȃóʵɛƨƥóυȂóəƪ›̐ρƧͩɜԭڔȄ̎عƧȁ̐ŏó̍ɛ›ƥƧ̑óρŐ@Ƨ̏˜ɝəɛ˜߻ͩ̍ͩɝО̍ƪƧóóӓƨóƧʳ݇@ɝςƪœ@ʴƩ—ƧƦôƨɛȄə›Ƨŋυ›óͩѵ@ɝǿóŌן̍ɛ˜óО̍œ̑̏ôȁ̍ŏòȁñóƦͩ@ǿə@ɛƧ̑˜ρȁυô̍օѹœóȃə™@ȂσʵѷƪòƩ̍—ôó߻ۯôʳƧ™óšõʵѵóѹɜ̍ȂѹôɛŌφֈƩͨρóυӑóޟఱ̑݇ͪóƪƨŌóȄڔԬƩςםñ̑ȃѵŐԭŏƨȁɛǿρôõɚɛóƧОə@ѹ̐ѵöԪͨôͪɛ̒ןŏƧƥóôƥƧɛŌôóɝó@̒݇Ӓ̒Ō@Ŏԭࢰ'], + 'encodeOffsets': [[ + 99540, + 43830 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'qing_hai', + 'properties': { + 'name': '青海', + 'cp': [ + 96.2402, + 35.4199 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ƨ@ôƪ݈ȁƪ˜@φɝòóƨԮʶɛ̐ѹͪôОəóƧɞᇒѶ@ôږô@ǿѶ›ƪȁςœɜͩφ˜ςŋɞôѶɛƨŌɞ—@ɚςŐñԪॢͩƨȂɞóƨŐ̎ŏעӏ̎óƧƦôœ̒ȁɜ›ςͩ̒œɚɛƨôƨɝφɛóȁƨŋóóɚͩƨóóƩ@ƧəŋƦƩ̍@ƧƧôǿυ̑@ȁɞǿõŏρƥסɚƧóτԫɞœôƧƦ@ñȃòñƥóυôôѹѵ—@ŏ̏Ȅɝó@ȂəŌóəѹƦ@Ő̍Ōυ݈ԩŐƧóôƧ̑›ôʵɞƧ̑ѵôƩɞƧ̑œóНѵóôʵ̑˜ɛȂó̍ƥȀƧŋ̑Ōóƪ@ƨó˜óŐƥ›ƦŎѷƨѵƧ̏Őɝóѵɜן@óòɛ@ѷʸס@ԩ̎υѺƨ̎óʸôƦɛœñ̎@Őɚ˜@̒əŌóŐ̎˜'], + 'encodeOffsets': [[ + 91890, + 36945 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'si_chuan', + 'properties': { + 'name': '四川', + 'cp': [ + 102.9199, + 30.1904 + ], + 'childNum': 21 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ô˜ôŋó̑Ԯ̒ɛОמͪƨōöͫ߼ƥôȃƨóóñôƧóƧôōڔŏƨŐ@Ŏô˜òƥѺŎ@ōɜóנ˜ôǿô›ƦôԮ̍ɜôɚ›Ƨ—ñɛɚȁ̍Ƨɛևυ@óóôŋρԭɝ@Ƨʸ̍ŏυɜƧƧóƧƨȁρ̍ƨȃɚ—ôʵφóô̑̏Ȃ̑ʵɜʵɞ@ƨʳסƩóŎə—óɜƧôƩƧρ˜óôôô@ŎƧƨƨƪѹ˜ó̍̍Ʃ@̏ѹНôޟ̍Ʃóƪυɝɛ—əƨôŎɛȀ@Ȃ@ñɝʶ@Ōρנ̏—õóɛͨƨȂѵОɛʵ@̏ƩŐó߼Ƨల̍φɜȂυτɛОρƦɝƨóƪ̒Ѷɝƨóʶ̒œóƨƨôԪŏφ݇̎ŋ@ŏѺƥôɚɚŋ@ȁɞô̐ȃ@ŐѶ˜óѺφóƦôñòòȄ'], + 'encodeOffsets': [[ + 104220, + 34336 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'hei_long_jiang', + 'properties': { + 'name': '黑龙江', + 'cp': [ + 128.1445, + 48.5156 + ], + 'childNum': 13 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ᇔȂਚНƨŐѶŏöƥςŏñƧƦóƨȁ@óƨ—óȁφӑóóƨ˜óǿ̎̑ôНɞ—ó̑ɜə߼›̎ǿ̒ôڒӑφ@Ƨȁ̎̏ƥƩ̎ρశ˜ôȂςƨφ@נɞ݈˜̑ƥƧɛƨʵƧȃƥ@Ƨƥ@ŏ̑ԩôɝρρóɛƧ›ƩͩƧó߻ʸ̍ʷѹƥɞڕõ̍öɝυ—̍ȂƧ̐̑ŏóƨñŋѹóóȁ̍›̏Ԭõʸ̏ŏ@ǿ̍@ƧОυ@ñƨòȀƥŎ̑ŐѵóɛŌóȂԫōƧŎѹñ̍ʶóОן@Ƨ̎Ѷô@Ȃ@™óŎó@@ó̍ƥԭք༄।ƨͩ̒ࡘς˜ñֈƦʴφͪ@ȂɜɜסԬə@Ƨə̑@Ƨóןô̏ŏ̍ô̑ؼôƨѵɚƧȁɝ@óŐρŎԪО̏ʴ'], + 'encodeOffsets': [[ + 124380, + 54630 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'gan_su', + 'properties': { + 'name': '甘肃', + 'cp': [ + 95.7129, + 40.166 + ], + 'childNum': 14 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ڔôԮࢯ@ō̑ŋ݈ӑ@̑ɞôóôɜŋƦƨôóƨƦנŐɜ̑óͩԩͧѶõѺ̏ɚ@ƨНɜôöəςóɜȀƧȂԮŐѶŏ̒ȄמòƪρړԫôȃƧŋôƩ݈ͩɚ@@ǿɜ@φͩóŏɜӑƧōôǿ̎›ôƥƪóõ›ö@ô—ƨ˜ôƧƦôó̒ɜ@ɞŌõʶ̏Ő@ȀóôƨȂ@ʶע@@ƥ୾ӑó̑óŋôʵóɛړ@@ƩöóƩóρ—ɛƨ̑@óʷƥƥ̎ɛƧ›ôōƧǿôͩѵôɝȃɞȁõƧρóó—@ōƧŏړŐóŎôƨóƨôòƧôóȄ߻ƦõͬƧŎםͩɜНԭ̑ô̒óŌó—ƥ@óƨɝ›σԬƨôעəςƦöŐɝȀ@Ȃφ̒óȀƨƨ̎@ƥƪɚŌ@ƨôƪƧôəͪôôƧŌôȂυɜƧɞƧóəɜ̑›ρͪɛœ̑Ȃó›ƨƥ̍ôסӐ̍ŐƧŏɝôƧȁॡͪòԩρŏ@əɝ˜ƧŋѵɜɝóρŌυ—ɛͪρ›ƩȂѵœ@Ȁڕó@ȄɜʶφࡔڔœƨͪѶͪԬʶôƩעʶɚʶƥôóƨςȂ'], + 'encodeOffsets': [[ + 98730, + 43740 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'yun_nan', + 'properties': { + 'name': '云南', + 'cp': [ + 101.8652, + 25.1807 + ], + 'childNum': 16 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ôɞôɝ̒öôŌƧƨôͪôô@ŋƦ›@ʶƨŐô߻ƪŏ@̐ɜʶѶНƧȁɜͧöô̐˜ςן@ŋɞʵ@ò@ȁɜǿóōɚƧɜ˜φɞôƩ̎ƪóޠѺО@̐̎ƪô̎Ѻ—ƧƩƨƧ@ōóóôóς—ƪƨƨóôɛó̑ԭ—ƥŌɛǿɝƨɛͩô›@ǿƨȁѺŌɚɛ̍ןѶНɛƧôóƥȁƦͩôŎɞ—ƨ̑ɜ—òôφ@ƨʵ@ɛѹōóȃəƨυǿóʵρƧƧŌƩɛ̏ȄñƧƧȀɝ̍ԩʶƧ̑υ—óŌƥʳɚӑóНƥô̑›óӒѵʵѹœƧӐןôƪφõŌƪ̒ԫŌƧؼƨƨס›ρȁƧœƨȂóʶó@@ʴƨôôφ̎Ŏ@Ȁƨ—ƪɚƨœóƨôôôςóޤƧŌƩŋƧԪ'], + 'encodeOffsets': [[ + 100530, + 28800 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'guang_xi', + 'properties': { + 'name': '广西', + 'cp': [ + 108.2813, + 23.6426 + ], + 'childNum': 14 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ƦŋѺ̎ڔʵƨŐ@ƦמȄƪôóȂɜŌɚͩɜ@öóɜôôȂƦôɜȁ@ɞφ›óȄ̎›ƨʶɞŋƨʴɚǿ̐̎Ԭ@ôñ@̏ƨ›ρ۫ô›ɚƨƨНƪŐ̎›ƥóƦʵƥŋ@ȃóƥƧ@@ŏɝǿôυƧȁѵɛ@əóŏ̑@@ə̍›óƧó—@ȁƩ˜ρóòНƥô@Ӓ̑@óŎ̍ƥσŎυ@̍ƨ@Ō̑ôóͪƨ̒óŌړœ̏Ŏ@ŌôȄѺŎ@ɜƧʶυ@ñóɛ˜Ƨ̒ɝ˜óōƥͪ'], + 'encodeOffsets': [[ + 107011, + 25335 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'hu_nan', + 'properties': { + 'name': '湖南', + 'cp': [ + 111.5332, + 27.3779 + ], + 'childNum': 14 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@քɜОƨ@öŐמóƪôƩɚ̒Ő߼ȁςͩɜòƪ—ɜȀò—ñɝò—Ѻͪ@ŏƨŋóɝôǿƨ™ɚȃóəƨȃѵͩó̍@ȃƨóóƥƨƧ@ʵƦ›óͩɜ—ɛóñԭɛōυȂ̍ƧƦō@ɛƥ—ɛȀ̑œóʷóō̍œƩŏƧОəƧóœς۬Ƨœ@̐óòԫ@̏̍əȀƧʳɝŌóɞƧ˜ƨɜóŐƨò@ȄƧŌρŋóôԪОóʶ@̎óȄ'], + 'encodeOffsets': [[ + 111870, + 29161 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'shan_xi_1', + 'properties': { + 'name': '陕西', + 'cp': [ + 109.5996, + 35.6396 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ςôöƨɝȂɞȄѶóóͪƨȀóŎƨœ̍ɜƦƦôʸ̒@ɜƧς˜ƪôõô@ƪڔ@ôɜóʶôŌô̒୽Ӓ@Ʀ@Ѻ̎ɜѺɛѶôöʶô™ƨšóʴ߼۰óô̎˜ñƪѸƩτʶ@ȁòŋəѹóǿ̑ʵ@ȁ̒ʷυփô݉ôН̏ط@ȁƨóô̏ƪõ@ʳ̐ʵ@ɝɛŋƩŌɛóןôƧŋ̒ó@ŏ̐ƥ@ŏυ@ƧƧôן̏@ƥȂѹɜəœɛóԭ̎ƥóóœóȀן—ɛô@ŎѹōñƦ'], + 'encodeOffsets': [[ + 108001, + 33705 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'guang_dong', + 'properties': { + 'name': '广东', + 'cp': [ + 113.4668, + 22.8076 + ], + 'childNum': 21 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': [ + '@@@Ȃô˜ôƨ̎œ@ɚ̒@ôŐ@ɚѶɜƨȂóφɞȀ@Őƨ@ôƦ@ȄƦŌƥʶƦôôŎôʸ̒›ɜǿƦ˜@ɜƥŎ̎ƨφȁɜŎòƥԮŎƨōóŏɛƧɝəɞƧ߼ɜςȃñȄƦŎ̒ōôòƨəƨ˜ɚН@əƨ̏ƪʵυŌəɛóəԭŏəœóŏѹœρʵɝƦ̏™ƥʳѶ›öō̑óóŋρȀυƧƥɛѹōƧôן—ɛŏѵ@óŋôʵɝ›ƪԩõ@Ƨō̍@Ƨ@@ƦɝԮƪО@@', + '@@X¯aWĀ„@l' + ], + 'encodeOffsets': [ + [ + 112411, + 21916 + ], + [ + 116325, + 22697 + ] + ] + } + }, + { + 'type': 'Feature', + 'id': 'ji_lin', + 'properties': { + 'name': '吉林', + 'cp': [ + 126.4746, + 43.5938 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@נ@ôН̎ʵѺòƨōԬŎôȁɜŋѶô̒ŏƦōñǿòƧφ@ƨН̎@@Ȁ̐Őöʷ̐ԫ̎œôȂѺôòŌôƧ̒Őƨ̏̎ȁφ˜@ŋƩͩםȃƨ—@ȁ̑ʶ@Ōóôɛœƥѹ̑—συ݇@ɜρƧȃࢯƨôœəȂɛōƩɛ̏υρóõœƪʴυφ@ʶôŌóœρք@ɜƧ@ɝǿƧͪρȀƩó̏ŐƨȂ̍غړȃɛԮƨͪ̏ςƩœôɚφȁƦôɜƧôʶφȄ'], + 'encodeOffsets': [[ + 126181, + 47341 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'he_bei', + 'properties': { + 'name': '河北', + 'cp': [ + 115.4004, + 37.9688 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@Ʃ̒̏ŌѺ̒Ʃ˜óȄƧŌƥͪòôñȂ̎ŐóȂ̒̐̎›ôНɜ—נ̎ôŋɞȀѶ@ôͪφœƨŌɚœɜȃóƧƨƥƪ˜@ʳƩ›ɞρ݈@υНφʵɜ˜ƦρƨƧ̍ɝóɛѹ̍ρŏ̑ôóƨ@œƧƦôƨɛ@ƥƨ@ȂƦ@@ôəŐƧʶƨŌυœ̍̎ɛŋôōɝ@óƧ̍›ƦʵѵʳôʵɜŏςôƪŋƨŌɚ@ôНƥƧ@ōѸɛ̐ô̎ʵѵНԭ@̍̍Ƨò@ȁɝ@əρυͩƪ̏ƩõƧŎƧōóšॡȄɛʶɜȀ@ɞςѶƧœƥςɛŐ@ɚɜɜ@Ŏôôςœƪς'], + ['@@õə@Ƨɛ˜@ŐóƦφô'] + ], + 'encodeOffsets': [ + [[ + 117271, + 40455 + ]], + [[ + 120061, + 41040 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'hu_bei', + 'properties': { + 'name': '湖北', + 'cp': [ + 112.2363, + 31.1572 + ], + 'childNum': 17 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ñȄυƦöŐƩ˜óנƨƨφ@@Ő̏Ʀ@Ő̑ôƨŌנóɜôƪŋɜŌѶօڔə݈òɞōɜŎôӏƦóƨô̒óôȃƨó̎ŐôƧƪ@ƨȁςƧə̑̎Н@̍Ƨŏρôԭͩԫ—̍ʵƧšóȀôɞƧŌ@Őѹͩñ˜òɞñ˜ɛǿƩ˜ɛñρͪ߻Ȃ̑ŏƪəƩóםôõŏƧ@ɛНƥȄó›̑ѺƧ›ôφóƨƨƦƪóɜŐôóòôƨóφ̐ƨóƦ̎'], + 'encodeOffsets': [[ + 112860, + 31905 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'gui_zhou', + 'properties': { + 'name': '贵州', + 'cp': [ + 106.6113, + 26.9385 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ɜȀƦŋԮ˜ô̒ɚ˜ôōעƪƧʴɝ@ɛʶ̒ʶ̐ȁƦœóȂô@ôŏ@ōô—ƨʶѸô@ʶƨ˜ɞó@ōτöòυƨ@@əƨô@ɛ̒@Ʀɜôȃ@̍ôʵԩНôóςŌƨŋ@ȃƧñôŏƧɛƨ—ôɝƧʵ̍œôȃυœ@ɝɛȂƥóóȁɛóõôɛ@əͪɛŋôȁƩóםȃ@ƥƧŏړʶѹ̍ƥŌƦȂóôɜƨѵО̎נəɜѹŋƧȂ@ȀóœɜͪɞƧ'], + 'encodeOffsets': [[ + 106651, + 27901 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'shan_dong', + 'properties': { + 'name': '山东', + 'cp': [ + 118.7402, + 36.4307 + ], + 'childNum': 17 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Ʃ̐φͪɚςɞ@@Ȃƨñ̎̎Ԯ@ѶОƨƧڔ@φН̑ŋ@Ʃ̒ǿ̎@ƨɜԬςôʶ̐ʶöԫƨƧנƥɜŎôō̎@ôŏóρƧŏԫôóƧԩó@ƥɜƧԭóƨʵɛƨ߻ӑɜНԩ˜óô̑óƧʳə™óɛƧ@õȀƧœ̍ȃɛŐóŏυО̍—óɝƩ—ԩ@ƧɚԫȄɚʶƨ˜ɞʶԪ̐ړɛƪ̒'], + 'encodeOffsets': [[ + 118261, + 37036 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'jiang_xi', + 'properties': { + 'name': '江西', + 'cp': [ + 116.0156, + 27.29 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ƧȄôɚəȄ̎ʶԬ˜ԮͪςóƨŐƪ›τɞƦōƥƧ@ŏςôóŐôô̒ʷѶ—ƪƩƩǿ@ō̒ɛôυ@—Ƨȁѹɛəƨѹ̑ƨ̏óƥѵʷô̍ɛȁôŏɝǿƧԫƧ›ôʳƥōòȃρȄ߻ɛɝƨɞɚɜƨôŐƧŎԭōñƦòԮɜôɛ˜ôͪƥœ@ʶƧƨôƦƧô@Ȅô̎Ѷͪ'], + 'encodeOffsets': [[ + 117000, + 29025 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'he_nan', + 'properties': { + 'name': '河南', + 'cp': [ + 113.4668, + 33.8818 + ], + 'childNum': 17 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@φ˜̎ƪ̐˜ɞȄɚ@@Ȃעó̎ŌѺ̒ôֆॢȃô™ƨŎƨōƪöƩ̑ڔɜԩ̏ɝʵƧ—əʵԬȃƨəԪ@@Ƨ̒ŏô̍υȁƧɚ̍ôóŋ@ɝƧŋõ̑σ—@ŏɜŋôɝ̒ƧɚôôطρóóɛƩ@óƨ̍ŏƧôóȄ̑ôƧóƥôóӐɛōɝŎ݇ñړɚѵֆ@ɞ̏ʶ@ʴƩöó̐'], + 'encodeOffsets': [[ + 113040, + 35416 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'liao_ning', + 'properties': { + 'name': '辽宁', + 'cp': [ + 122.3438, + 41.0889 + ], + 'childNum': 14 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ƨʴƧôôӔƨô̎ƩɞН̎ͪ߼ͪɜ—ɞɚ̐—@ƨςŏ̒ôƦƨɜœô̎ƪôςǿƨͩɞȀƨ@@ɛςփô›óŋ@ʵφυƩʳö›॥փρѹס@əɛ@ͩࢯ@ѹʵρ—ƩʶφȀƧ݈̒۬óʸɝŎѵ@ԭԫןɛƧƨƥςɛ—υʶφО'], + 'encodeOffsets': [[ + 122131, + 42301 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'shan_xi_2', + 'properties': { + 'name': '山西', + 'cp': [ + 112.4121, + 37.6611 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ɚѺñŌɚšôȄѺ›̎ֆφóςȂ̒—ɜƨɚ@@Ȁƨŋôȃƪ—ѹ̑̐ŋƪ̑Ʃρρ›óó@ōɛɛ@əɜŏƦρƨ›ρѵ@ɝɛǿɜʵóօѹ̑̍ŋסô@ȁə@ɝȃ̏—̍Ʃυ—Ƨô@Ȃ̐ظóОó݊φք̑ʸ@Ȃ̒ʶôȀ'], + 'encodeOffsets': [[ + 113581, + 39645 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'an_hui', + 'properties': { + 'name': '安徽', + 'cp': [ + 117.2461, + 32.0361 + ], + 'childNum': 17 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ó̎̑Ő@ƨƪ˜Ѷǿɜ̑φ—Ʀʵ̐˜Ƨѵôóƪôôυς—ƨȂɞŏ@̍ԫôò̑ƥ—óȃѶͩƧƥôŏѺœôŏƦ—@›ƥͩƧ—ôȁυó@̑ƧɛѵʵƩƪѵ˜̑ʸóóôŏρó@ŐƦƨƥŎσɝƩœ@̎̍Оɚ̒ρƨƧȂôɜςôóظəó̑ƨóɞɛŌ@Őτ˜ö̒ƨŌ@ɞôŌ̎óƨəφȂ'], + 'encodeOffsets': [[ + 119431, + 34741 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'fu_jian', + 'properties': { + 'name': '福建', + 'cp': [ + 118.3008, + 25.9277 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@̎›óȁƨӑ̒—̎ɚƨͩφŐƨɝ̎ŋóŏρ—@ōƨ›òʳəóƨō̏˜õɛƧ@ƨѵƧōəŏóŋƧô̑ɝɛʳƥ@@óɛõ@Ƨ̑ƧóȁəƧ̑—Ƨ̐@ɚəОƧ—Ƨɚóñ̑ŎóʴƨœƨԬɞȀóŐɜȂó̎ѶʸôƦƧ̐Ѻ̒ɚƧѺɜƨȂ'], + 'encodeOffsets': [[ + 121321, + 28981 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'zhe_jiang', + 'properties': { + 'name': '浙江', + 'cp': [ + 120.498, + 29.0918 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Ѷʶƨɜ@̒φôóȂƨ˜Ʀͪ@œ̐˜Ѹ̍τȂ̒̑נŐמôƪƧôӑ̑›@ƥρͩƨօ̏@@υɝó@ŋɛ@ôƩəóƧѵυó@ƩɜŋƧ@̍ŌƧɞυŏƧͪ̍ə̑˜ƧӒôȂ̍œ@˜óφ̑ɜ@ŎƪȀ'], + 'encodeOffsets': [[ + 121051, + 30105 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'jiang_su', + 'properties': { + 'name': '江苏', + 'cp': [ + 120.0586, + 32.915 + ], + 'childNum': 13 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ôɞ̎˜φНôŐɜŏ̎Ȅƨ›öǿƨ@ôɜɚšƨʴ̒ôôó@Ƨ̎əԮȃԪૉöͩ̐ƧòʵφƧôʵ@óړɜóŏɜǿƧ›ɝρσȁѷ̎̏—ƥ˜óŐѹ›óŐƨƦѵͪôȄƦ˜ñ̒Ԭó@̎ɝŐƧȁρ˜óφƩóóôƨѶ̏—ƥʶυ˜ɛ̒ѵȀ'], + 'encodeOffsets': [[ + 119161, + 35460 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'chong_qing', + 'properties': { + 'name': '重庆', + 'cp': [ + 107.7539, + 30.1904 + ], + 'childNum': 40 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@əȂòɜƨ˜ѺɛƦȁ̐@ƪ—õŏφƥòȃƥ̍Ƨôυ̏ƧôñóóôɛŏƩôƧƥôƧóυƨœ̒ѹôœƦȃ@փƥɛ̑@@ɜƧó@ɚƧ@ñφσõ@ŎɝôƧ—@ʵѷóƧʵó˜@ŎóŐó@ôȁƥ›ó̒υôóʶə˜ƧȄς̎ƧȂôƨƨƨφɛ̎Őƨʷɞ@ςԮóŌôôφ@ɜֈ̎ƨ'], + 'encodeOffsets': [[ + 111150, + 32446 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'ning_xia', + 'properties': { + 'name': '宁夏', + 'cp': [ + 105.9961, + 37.3096 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ల̒ôޠφӒςôƪͧυևɜŋѺó̎ȁ̍ɛ@ѹס@@ʵƧȁôó@ǿ̐ŏöʵɝŋɛ@ô̑ƥóóƨƧ—ó˜ôœó@ƩôóƦ̍œóȀƨŎɛӒôŐυͪɛ@@Ȁə@'], + 'encodeOffsets': [[ + 106831, + 38340 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'hai_nan', + 'properties': { + 'name': '海南', + 'cp': [ + 109.9512, + 19.2041 + ], + 'childNum': 18 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@φɜƦʶ̐ôφô̎@ƨŎö@τʵƦ˜ԩ۫õН̏óƥȃƧ@Ʃəםƨ̑Ʀ@ޤ'], + 'encodeOffsets': [[ + 111240, + 19846 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'tai_wan', + 'properties': { + 'name': '台湾', + 'cp': [ + 121.0254, + 23.5986 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ô—ƩɝöƧɝѵəޣ̏ρƩԭóōóͪρɞƧОôԪ݈ଦѶɜ̒ɛ'], + 'encodeOffsets': [[ + 124831, + 25650 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'bei_jing', + 'properties': { + 'name': '北京', + 'cp': [ + 116.4551, + 40.2539 + ], + 'childNum': 19 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@óóó›υóôƥ@ŏóóə@ƧŋƩŌρóɛŐóʶѶʴƥʶ̎œôƨɞ@óŎɜŌ̎̍φ›Ƨŋƨʵ'], + 'encodeOffsets': [[ + 120241, + 41176 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'tian_jin', + 'properties': { + 'name': '天津', + 'cp': [ + 117.4219, + 39.4189 + ], + 'childNum': 18 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ôôɜ—@ƨöɚôœôôɚŏ@óƥ@@ȁƦƧɜ@óƧƨƥ@›ƧóəН̏óѷɜ@ŎƦƨóО'], + 'encodeOffsets': [[ + 119610, + 40545 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'shang_hai', + 'properties': { + 'name': '上海', + 'cp': [ + 121.4648, + 31.2891 + ], + 'childNum': 19 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ɞςƨœɛȀôŐڔɛóυô̍ןŏ̑̒'], + 'encodeOffsets': [[ + 123840, + 31771 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'xiang_gang', + 'properties': { + 'name': '香港', + 'cp': [ + 114.2578, + 22.3242 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@óɛƩ@ρ@óœôȀɚŎƨ@ö@@ōƨ@'], + 'encodeOffsets': [[ + 117361, + 22950 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'ao_men', + 'properties': { + 'name': '澳门', + 'cp': [ + 113.5547, + 22.1484 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@X¯aWĀ„@l'], + 'encodeOffsets': [[ + 116325, + 22697 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/chong_qing_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '500242', + 'properties': { + 'name': '酉阳土家族苗族自治县', + 'cp': [ + 108.8196, + 28.8666 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@XJ°œlJX@lbl@XbV@VLnJlxnbšƒUU@IVK@lVIVwnJlU@n@J@L@Jn@l_nWVLVln@@blLšmV@@xœÔ‚`nœ™xV‚ÈLlx„LVxVVšƒV_U»VWn_m¥XwVmnX°ƒlmUUVwÞaVƒk@a@mmIUa@™mwk@™ƒm@@U¯a@UV@@K™@ykkmwkV@kU@ƒÑƒVkKWLÅamaUm@kyU@WkU@Ua™IUašVaUUmUUa@aVLXKWa¯UUbmJXnWnX`l@@xkzWÆ@V„LU¦‚x@b@JkIkJ@LmbUamJwm@óxƒnk@V„@x„ŽVnUVmVUVŽUbVlUbkXWŽ'], + 'encodeOffsets': [[ + 110914, + 29695 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500236', + 'properties': { + 'name': '奉节县', + 'cp': [ + 109.3909, + 30.9265 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@WVXb‚UnK@x@b‚²kxmKkl¯_ƒVV°™VU@bnKVVV@@nkŽ@n›bn‚@š°@VLČUš@°WV@V™nU@InKVl@nU„b˜KnX„WlknLlKUwnalLša„VlUXmWk@UU@UWWIUyķ¹XaWW@X™ƒKUIVm„U@W@UVU@KV@n»VkUkÇmUmVIUmULUbm@ƒwUaƒKkkm¯ÑUL@bWVnx@VmxUI@„klmkkK@aƒK@IlJ@I¯ƒk@mak@mnkJVL@bV@Ub„„W`UUUV™I@VƒU@VVbUJVLUVVbUX„VVxk¦VJUnVxnVVUšJV@Ubl@@bXV@L'], + 'encodeOffsets': [[ + 111781, + 31658 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500238', + 'properties': { + 'name': '巫溪县', + 'cp': [ + 109.3359, + 31.4813 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nLWbX‚VLVU„V@KšIVl@b„@lbšU„VnU@JÆU@V@n°KĢUl@VbÞKšVš@„_„V‚KXU‚U@KXƒ@wlkkU@mWKUU@UôJ@XV@œaVmÞIVaVLƒƒ@»kmƒ@ƒUkL™U@aU@WWƒLUUU™™KkbƒwWa@KU@kaƒXmW—LƒamVk@UmL@JmVUšU@¯X™@ċVUK¯@ÅnWK™LkKULWK@UXK@wW@™LkV@bVLƒlXn›`¯xU„°LnŽlV@n°Lnl'], + 'encodeOffsets': [[ + 111488, + 32361 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500234', + 'properties': { + 'name': '开县', + 'cp': [ + 108.4131, + 31.2561 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@n@na‚I„wš@@VVK„LVbVxnVÆUnanKWXamKmk¯K@mkUm¯KVƒ°w@Wm@UIUUlKUU@a¯KWanwmUXamKkUWUnU@KƒkUwWKXaWLUWkImaUUUƒƒKka±k@lƒ¯w™wmbUƒ™ƒkXm@UJkIW‚XXƒbƒmƒ„UJ™XUV@°šKlšlVXV@xmbnV@blV@VšœU`UL@V™a@bULlb°VXbܚ@V@bƒL@J„xnLVb@lVb@V@@z˜bXWšX„KVLV‚š@@bUVVL@b„„lVna@ll@„zl@@J'], + 'encodeOffsets': [[ + 111150, + 32434 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500243', + 'properties': { + 'name': '彭水苗族土家族自治县', + 'cp': [ + 108.2043, + 29.3994 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„Jlb@nVV@bXb@ÆlL„Ul`nVKU¼VxkbW„nlUxlXX‚@°°WnnJ@VUn@J„k°L@VlV@nUJ„x@bVVVz@VnLla„KnalVlIUŽ„¼@nV@@anKUwVal@UlJœƒlI@akU@UWXKVI‚¯Uak@@KmkXWÜkXWykIWwXw@laXamkVUUym_XmlkkmmakwmIUKU@Wak@kaW@kI¯›WIk¦VŽƒUUƒmaUV@XkVUV±aUb¯b¯¥m@@ImJ—@mƒmL@kUKUkkJƒbV¦'], + 'encodeOffsets': [[ + 110408, + 29729 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500235', + 'properties': { + 'name': '云阳县', + 'cp': [ + 108.8306, + 31.0089 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lb„LV„VVnblJVXXKWbXLVx„l@LmVXVVl‚nLWbnVmxXb°L@bVVkLVVVJn@@X‚‚œ_Wm„kUK@alUšKX@@xWL@VXLVKlLšKXLÆm@™mœa@ml@mU@UUmL@aVšUU¯„U°`lknLlw±@a@wmLVWaXU@KWU@ak@VaU@™IUVmUUwVmUIl¥UwƒUVWUaVUUKVIUa@UUUUJƒUUm™kƒ„nl@„@VWV@L¯aUb™Ulxƒ@@b@VULUx@VUxVV™U@bU@mxU„U@mUVŽklkkƒ@WxknlxK@amLƒKU„K'], + 'encodeOffsets': [[ + 111016, + 31742 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500101', + 'properties': { + 'name': '万州区', + 'cp': [ + 108.3911, + 30.6958 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ĸĊVI„ƒ„n„aWWXlJVIn@lWš„V„našx°xk„l@²Ž‚LVƒ„LnK@b‚LkwlmXw„@lllkUnVV@VƒnwV@@ašVUUVw@UVwVK@U@a„@kwšVVa°b@KXU@U@ƒmk„ƒÇсaml™kUVmn@VULU˜m@kUVkUaƒwUWm@Uw¯„mKUUmVUUULUKU„W@XbWVkaWwkUU™ƒ™k@maUbmbVlk¦ƒxUVUIWVU„kJVVkL@UmJ™UUVU@lLUVU„lx„@@VbƒJ™U™L¯¤@Vƒ„'], + 'encodeOffsets': [[ + 110464, + 31551 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500229', + 'properties': { + 'name': '城口县', + 'cp': [ + 108.7756, + 31.9098 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VK@w¯L@m@UÅV@ImVƒU™Vkaƒ@@aUk™J@LƒUUVUKmLmbÅVmUUwUaƒKUL@U™@ƒxJmbm@nVJ@X@VkV‚n™lƒLXx™@ƒb@bUVƒLU`UnƒbU@@ŽmVVX@JX@VLVVšklV—„‚`@bUL@V„LVKn@‚U@„UJkn@lmLmK@X@Jn@mb„nÞWVXnJ‚k„KČÑÆ@VK@knaÜmXlUČW°kôÇƁ@a@yÞ_VmƒUnU@K'], + 'encodeOffsets': [[ + 111893, + 32513 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500116', + 'properties': { + 'name': '江津区', + 'cp': [ + 106.2158, + 28.9874 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„InWUUlU@LVašlX@°²lÒXxlK@Ul@@Un@UaVJ@I@W@UƒUUVUwVIUKUa‚UUVwn@Üx@XUlnn‚bœJ@¥VklKUUlk@ynU@kVƒUUVWnI@¥V£VWVIUKU@UVƒa@n@Vm@@nlUaVkUwƒJ@blLkLW@XWmXkmmLn™@m@U@UVm@™„UVUUlakUVa„ƒVkV@@wnaWUk@VwkƒlmVIkUUxmJ@U„™@KƒIkx±V@IUm@K@IUKkbWKUbn„m„@bmVnbmb@xkxUJ@ULW`@bX@WVXL@Vƒš¯„mk¯@UJ@VmLUaWnX@WJ@nkKkxW@UIV@@KkImmkK@UW@XaWIU@U‚ƒIkbWb„xXŽlLVbnV@bWlX@VxVLnl@nÆÞVÜ'], + 'encodeOffsets': [[ + 108585, + 30032 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500240', + 'properties': { + 'name': '石柱土家族自治县', + 'cp': [ + 108.2813, + 30.1025 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„š@kl@š¼UbmVXJ@bV@nxVIVJULVVk@@LWbnJVU@bVbUJ@blLXnWV—@mbnV‚@V„„bn@VJVLnaVanbl@„šVšlVXxlbXUWaX@VƒUUVwUUVm@I@WmI@a„mlLœ™lK@alwnUV@kóVaƒÝk@UlbVK@™VU»VUUVWUƒ@U`ULkwm@@KmU@knKƒ»VkJkUmbƒLkbmK@UUyUU@aƒwm@@XXJ@VVLVVUbVnUJVX@K„„k`WXXJWXUbmW@bkL™Um`Xnƒb@JVL@LU@™°VVXKVnUxVLUbmJ'], + 'encodeOffsets': [[ + 110588, + 30769 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500237', + 'properties': { + 'name': '巫山县', + 'cp': [ + 109.8853, + 31.1188 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@kVƒU™bkKmbVxkLmKkllbV@@LXb„xlašLVšVV„KXXV@@bšVlK„V„@ln@¼°KXa„U@Ulw°JXalIUa„ÝWXW@kVU@ƒVUVWUUUamUw@aVamwn@VUUƒlLXWm£@wÇĉkKklmLUÒ¯ƒWn™@ğ±kwmaWm¼U@@LUV@V@XƒVUnVJ„LWš@‚XXWbĸºVzXJVXV@@VXlWn'], + 'encodeOffsets': [[ + 112399, + 31917 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500102', + 'properties': { + 'name': '涪陵区', + 'cp': [ + 107.3364, + 29.6796 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nèVblĖVVnLšŽ„@šx‚V„n@nšJ@L„UVVX@lbUJV@@nn@VVVK@z„˜V@nzVJVUlmX@@_VVVbnaVal@@knW@wnaƒVK@aVI„J@£kUVW@‚wXUVJ„amƒ@Ikƒƒƒƒ_X¥ƒ@WwkKkwmŽ™šƒkUxƒnÅmm¥™WV@Um@UlVL@JU@@Xƒ@UVkKVk™KVk™Kkb@bmJVXU„VVUbU@@`W_UV¯b'], + 'encodeOffsets': [[ + 109508, + 30207 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500230', + 'properties': { + 'name': '丰都县', + 'cp': [ + 107.8418, + 29.9048 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Þè@XUK@LlV@blbUJ@„„V@bnV‚@VVVXU@ƒlbXal@VXnKV@maXUރ@amk@aVKXV‚anbš£°mnIVaUKVwUmWLUUš¯V@@KUK@I„aWmn_šVlK@anXVaXWWIXWl_ƒƒ@LUWVIUmVaUUUK@UWI@Wn@VI@mkU@U¯Kƒl@ImVÅLƒwU¤óbUU@wWXkmm@LU@@VUIWVUL@JUnƒaƒx@Jn„ƒbUIWVx@ŽUXlV@¤ƒIUJ@bUL„Žmb@xmX@lk@UbmbUaUU@`W@kn'], + 'encodeOffsets': [[ + 110048, + 30713 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500232', + 'properties': { + 'name': '武隆县', + 'cp': [ + 107.655, + 29.35 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@l„„w„bVm@IVKXUVJ@UV@@KnnWlX@xVVôaV£„xÆKnUVm@UmIXm¯¯@WkWVwmkXƒlaUwV»ULmk_ƒVkK@ÅWa@aUU@mkaƒIƒb@‚n¼ƒnm‚_@mmK@UƒLUVVmI@aUJ@XWJ@U`UIkm±kk@@lULmUmKUnVšnlUVmI@VkVlx™bkIƒVmLUxkKUŽ‚Xš‚n¦Æn„mVw„lš™nlxlLXx„@W¦„`„„'], + 'encodeOffsets': [[ + 110262, + 30291 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500119', + 'properties': { + 'name': '南川区', + 'cp': [ + 107.1716, + 29.1302 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VšUbVJVUn@VLX@WVXVVI@VUVWxU@mš@ĊX@@¼V°aVUX`@_V@VaUUVƒUWnI@alašLUlšLUllLVU„@@WV@@IUKVkn@@VlLVwnK„UlJšakwlU@UnJVUmkU™VmXa@wVK@UUw™@VƒVI@akƒ@alInwlKXUmaUW@wWLk™™KVak_ÇaUƒƒV@šXbƒLVxUlWIk@UK@V™@ƒkU@VbUVUlVnƒLUV@lVXmxkV@L@V@Vk@WbUwmL@JUI@xVxkx'], + 'encodeOffsets': [[ + 109463, + 29830 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500241', + 'properties': { + 'name': '秀山土家族苗族自治县', + 'cp': [ + 109.0173, + 28.5205 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@XlV@lzn@VŽnbÆbXKlL„U„ÒV@@llUnxll@zšŽ@LU@@V°b@Vn@š„l@VÑUƒnK@UšU@aUaƒkVm@K¯wƒklmnn„Ul`nI@almkIUwmWVkUaƒkkJmUUa@K@aU@@_m@@wUyVUUa@Umƒ@awl@Wka±„UkUykIWV™b@bUVk@›aU@UXU‚UIWakUWmUxUV@nUVWbšŽ@XXVVŽmXXŽ@VƒbVLkVWx'], + 'encodeOffsets': [[ + 111330, + 29183 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500114', + 'properties': { + 'name': '黔江区', + 'cp': [ + 108.7207, + 29.4708 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VX@V@LV@VJUL@lVnnxlb@VXV‚XV@@W„@UIVK@kUKna@£VWUaVUUalIVJVIUW„_lm@bXKV@mn@J„UUw@KnIVll@VanLVmUkVKXLVKUIVamw@UaU_lw„KlwUWV_Ua@aUa@KUšwm›_›Ó@wU@™nkK@am@UkUKmXk`m@@I@K@I@mkVmIUxUJ@kUL@JVV™„lnklWnn`VzUVnlWbkb@WxXxlJXzWŽÛlWXnl@Ll@Vb°UJWLX@VlV@bkJ'], + 'encodeOffsets': [[ + 111106, + 30420 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500117', + 'properties': { + 'name': '合川区', + 'cp': [ + 106.3257, + 30.108 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@XKVXlK„ƒVL@UnV@aValXXK„U@WVwUaVU@IV@@aVW„L@U@anVV@@bVK@UVL@bnJWL@VnUnb˜@@JnIlVl‚@@bXIWbn@UKVLVKXLlaV@VVnK@bVL„m„IVƒ@KmknUUWVI@aVJ@_„WU_VmUwƒU@K™ƒVak@am¯mJU_UJUkU@WkIV`UI@JV@LmmU@@mƒbUzś™@„VK@nUKƒ„ƒb™akb@UWK@bkVVbV„Û@@`ƒXk@WŽ@n@lXL@bmb@VVJUn@JnUlnUlmX@`XLlbkJW@kzlb@`@b@b'], + 'encodeOffsets': [[ + 108529, + 31101 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500222', + 'properties': { + 'name': '綦江县', + 'cp': [ + 106.6553, + 28.8171 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@¦‚@X„lVX@@UVKl„VUX@lanVlUVbXWVXVƒ„VVUnKVUlwUwU@UJ@nmVkUV™lwXam@VaUUUw@W@kk»mV@UmKkwVKVUU@@LUKVI@mV@XVWxnXVKUUUK@wWU@UUWnUlLXa‚mUI„am@wI@K@amIm‚UUkI@m‚akUkKWUUanƒ@wƒamLVxk@UVmUUL@Vm@kV@I@ak@@bWVXJlLVbVL@š@bn@@`Un„@WbUKULWVXbƒ@UVmbX„WVƒb@bVmxUKUƒV@šUn@V@V@nmšnKlnnWWXX@lKkK@a„IVxUlVb‚k@mn@@U@m„bVUV@VLUJUXU¤'], + 'encodeOffsets': [[ + 109137, + 29779 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500233', + 'properties': { + 'name': '忠县', + 'cp': [ + 107.8967, + 30.3223 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VLÞĊ„U@Wš@¼V‚„@lk@w²mlšVUœ„llšVnI@VlKUUlIVƒXUVJVU„wl¥UkUKUIm@ƒaUƒ@mUna˜@XUWmkK@aVIUa@aUVmIXa@Kl@UUVKUIUJmwU@@aWInUVa™»k@@lƒ™¯n™¤mabWUUL@bnl@b݄WVnbU@mLUWk@Wbka@„WVUU@UmUmVkUULV„lVUx„l@L@VƒbÈÒlb'], + 'encodeOffsets': [[ + 110239, + 31146 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500228', + 'properties': { + 'name': '梁平县', + 'cp': [ + 107.7429, + 30.6519 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@XLV@VV@b°°nšƒnkb@bƒšnJWVXblIUVšxWnUJnVVLVU„JlUnLVK@UnUVJš²nKVbVKla@aXlJ„k„Klb„ƒ@U°£šKšV„IUa@ƒ@kwVƒVUkKV@VUkk›ƒUVk™±n@xklƒ@U@»™‚@XƒVÝĉUJnxWb@UX›KkVUbUKWUkVmkkLU`›b'], + 'encodeOffsets': [[ + 109980, + 31247 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500113', + 'properties': { + 'name': '巴南区', + 'cp': [ + 106.7322, + 29.4214 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nxnVlJlUXLƒ¦@x@Vl@nKVVX@V_V@@KlVXU„@lKlxXIl@ÈĊ@Vl@n_VJlŽnVlnb„²VVVJVVmUUkĕUamçU@»W@@ĉn™V@XwVU@UUJWUXUW@UKm@UVUIVaU™UVmLUVƒUU„UWWXUakVmUkbW@UVkƒUL@VW@kUWƒ@mJUXVVU„@lmV@zklVVkLUl@¦›I'], + 'encodeOffsets': [[ + 108990, + 30061 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500223', + 'properties': { + 'name': '潼南县', + 'cp': [ + 105.7764, + 30.1135 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@a@a@_kalyX@lIkaWK@_nWVkkmmV@IVmUI@Una@aWK@k@mkbWaknmJUk@mk@@kUal@Uaš@Wa@aXLlwUKlkkƒ@KmI@VUJ@Lk@@VUUmL@amJU£kKUaWakLmU@bVVUbnbWV@xkL@bUb‚xUxVbXJVbUVWIUVU@kLWxkKWV@n¯VUbU@@VVX@VmaUL@VUK@VVbn@lVnI‚@@lnLULm@Ub@Žl@na„@lK@XVVkJ@b@zl@@VnV@bVb@J@bnXV`lXXmVI@W@InbV@@aVKUblKVLUanLlmnLlK'], + 'encodeOffsets': [[ + 108529, + 31101 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500118', + 'properties': { + 'name': '永川区', + 'cp': [ + 105.8643, + 29.2566 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@b܄nWVLX„lxV„VxXxlVn@@bVblK@a@UnLVJV@@UnLVU@VXaVKVXš@n`WUÿ@IUKlaUUUkWyUÛÅÝ@mmkUKUwW@Xk@amUUakKWƒwXaƒK@VVLklƒXVlkxV„UL@bm@Vxn`ƒIVxUVkLVšUšl@@lkXmmƒVUn@VV@Xb'], + 'encodeOffsets': [[ + 108192, + 30038 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500231', + 'properties': { + 'name': '垫江县', + 'cp': [ + 107.4573, + 30.2454 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@šĊ°¤nҘ¼œaV_lKnllUXVVLValUœLVW‚@XamwVIUKkaÇфa@U@KƒkVwkUUƒVKlVnU@aƒU@ƒVIka@akU@KVL@WÝçUV@Vmbů@L™KƒnnJW„ƒVkxlL@VX@VxmnXVWxUb@bkn'], + 'encodeOffsets': [[ + 109812, + 30961 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500112', + 'properties': { + 'name': '渝北区', + 'cp': [ + 106.7212, + 29.8499 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@bVVXL‚a@lnbWn@L„@XVlK@VVLUVlbkLUKVVVL@VšnX‚VL@VV@UbVb@x@¦UxVb@bUJƒL@L„VVxlK@™nk@U@W„UVLlKXV„@VblU@UUKVU@wn@VJVanLlkX@VaVK™¯@a@U@U@ƒVaUK„kUUƒ±maUkm@UUkbm@@Vk@@JƒwU@Ub@I@JmwUL@aƒ@@KkVÇLkƒWkƒ@kUU@@xUVmKUnllUb'], + 'encodeOffsets': [[ + 109013, + 30381 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500115', + 'properties': { + 'name': '长寿区', + 'cp': [ + 107.1606, + 29.9762 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VVšU„bX‚lX„¥l@XnVmlxUx„@@blVnnôĀlm@aVaXwWUnmUwW@@UkKlw„UXƒmI„mšL@KÆ°na@UUImyU@ƒ—@yULUUm@@mU@VIkaW@UUƒV@K™I@mƒmU™wƒ@™mKUnU‚UIƒlVLUb@„@V@V@bš°ULUbW@klmKUbUIm@@xUVVL'], + 'encodeOffsets': [[ + 109429, + 30747 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500225', + 'properties': { + 'name': '大足县', + 'cp': [ + 105.7544, + 29.6136 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@XUmaVaUU@anVlKXbValU@aV@@IXKš@@bV@VxVK@UXLlUšJXa@_‚@@aVK—ÅWVkwWaƒƒwUa@am@kUWLU@kWmX@ykI@W@UV@na@LlLV@UƒkwWƒUKmXX`mIVl@bXLWVkbkkƒx@`VXm@@J@U@UUKUxk@WbUIVl@VXLW„ƒJUkUlUImxXlmb@X@VUJUnVbšW@UV@@VVX@bnW@LVxUnlJUV@n„@VxVIn@l`„UVVVL'], + 'encodeOffsets': [[ + 108270, + 30578 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500224', + 'properties': { + 'name': '铜梁县', + 'cp': [ + 106.0291, + 29.8059 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VblLV¤nI@bnKVV@Ul@@KVI@UnJ@Ll„klVLkxWK@bXb™@Vbk@Vb@ll@@nVlnIlmXblaXl@„W@_Ü@UƒUalU@aXL@Vlašb„a„ƒVL@mUL@ƒUUƒƒÇXUW›X_WaƒƒUƒ»m_™@UWULWb@UUVmK@VU@UImK@V@bkL„x‚„XblxXU˜ÆUL@b@@`Wb™IkVWK@VULUwU@@a™@WL@JU@@bkVUb'], + 'encodeOffsets': [[ + 108316, + 30527 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500226', + 'properties': { + 'name': '荣昌县', + 'cp': [ + 105.5127, + 29.4708 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VI@U@WnaWknwVJVkVl„IXƒWK@UUkVJXal@VwVL@V@V@In@UW@_„wlllaXUWK@aUknJW_ۃ@aWaU@@UVm„UUaUImJVnÅUmVUm`kUUVWLnVU@VVmXƒK@„nxmŽULkx™ImJ@nU`@X@Vkn@`@nlV@nVJVaX„VLnK@bVV@nV@lbXWš@'], + 'encodeOffsets': [[ + 108012, + 30392 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500227', + 'properties': { + 'name': '璧山县', + 'cp': [ + 106.2048, + 29.5807 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@XzVlVVkbVL@JVĀXŽ‚¼V„„„XbW`XœWVȎ„„VVšŽVkV@@UXa@alK@IƒƒU@UKWUyUI@wVUUWVak@VUkƒW¹@WXI@yVIUK@kWwkѯ±W@™kUb@KkVVVmXƒJ'], + 'encodeOffsets': [[ + 108585, + 30032 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500109', + 'properties': { + 'name': '北碚区', + 'cp': [ + 106.5674, + 29.8883 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@X‚VLV@„„@JkL@bWb@VU@UlƜVy„a@nV@nn@KU@IVJU_lJXV@VlVIV`nIn°@b‚lUbš„„KVI@aUaVw@¥@wUaVaU@@UUKW™m@UUKUUVLlKkaVUUK@UkLWUƒ@@KXmma@kbWKUU@aUamLnÞ@VWLk@@Wm@ULU@@U™KUVWI'], + 'encodeOffsets': [[ + 108855, + 30449 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500110', + 'properties': { + 'name': '万盛区', + 'cp': [ + 106.908, + 28.9325 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VIV@@wVJ@InKVxXal@@U@U@KlUnwUW@kVU„KUmVkUa@I@KW@@bk@@mƒU@m@k@a@aƒIUxmJk@ƒwULƒwkKmVVX@VXV@xVLVVULmWXwWUU@@nUJVL@KV@UVULlxnL@VnUl¼@l@XVxVVUbn@WbkxUšlVnU@m'], + 'encodeOffsets': [[ + 109452, + 29779 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500107', + 'properties': { + 'name': '九龙坡区', + 'cp': [ + 106.3586, + 29.4049 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@XK‚L@Vš@XbV@lW@UV@@VXIV@U™VKlL@KnnJ@VV@VU@I„@@mVUVWUUmL@V¯LUK@UV@UU@a@U@yU@WLUK@X@KUVmL@ƒ@aXI@w@ammVk@WÛwm@UxVVVbVLUJVxVU„V@V@X@JUIVbm@@Vk@@VkL@lVLUJ@zWJ@X'], + 'encodeOffsets': [[ + 108799, + 30241 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500106', + 'properties': { + 'name': '沙坪坝区', + 'cp': [ + 106.3696, + 29.6191 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Xºl„UVl@UbVXUV@xVJVzXJVUšL@VV@VKn@@Xl@XK@UmÝnKVbVakkVm@k„ƒUK@UmIm@LkKULVšU@WJ@UU@@VkXU@Wa™@@UKWL'], + 'encodeOffsets': [[ + 108799, + 30241 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500108', + 'properties': { + 'name': '南岸区', + 'cp': [ + 106.6663, + 29.5367 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VV„JVL@bUVVnl`XIlwXJlw°nnl‚IXW@UÇĉk@WJkwkLƒ@WVkU@LU@U`W@UXUV@n'], + 'encodeOffsets': [[ + 109092, + 30241 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500105', + 'properties': { + 'name': '江北区', + 'cp': [ + 106.8311, + 29.6191 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nLVU@wV@lV„@Xll„ÈKlU@L„@@bVKnx@I@JVaV@„x@Il@@Un@laVVn@mkUIm`k@WXJmk¯mkxWIkxWJk_UmVUUKƒ@UU™@ƒ„@l'], + 'encodeOffsets': [[ + 109013, + 30319 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500104', + 'properties': { + 'name': '大渡口区', + 'cp': [ + 106.4905, + 29.4214 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@k@@U@w„¥WKkVkImUmwa@b@xWJ@b@„nKVU@L@WVLXKV@@z@V@bVVU@@VVL°K@U'], + 'encodeOffsets': [[ + 109080, + 30190 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500111', + 'properties': { + 'name': '双桥区', + 'cp': [ + 105.7874, + 29.4928 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@WwUwU@kK@KmbU@@V@XlJ@znWlXV@XK'], + 'encodeOffsets': [[ + 108372, + 30235 + ]] + } + }, + { + 'type': 'Feature', + 'id': '500103', + 'properties': { + 'name': '渝中区', + 'cp': [ + 106.5344, + 29.5477 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VLš@VV„@VL@aUKƒIUUƒ@@JUVU@'], + 'encodeOffsets': [[ + 109036, + 30257 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/fu_jian_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '3507', + 'properties': { + 'name': '南平市', + 'cp': [ + 118.136, + 27.2845 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@knyƒk@ƒKU¥šwV@nkƒWƒzUmk@@lKUa@aVI@UƒKUamKUUVaUI‚@Xƒ@UV@K±IUVVlUbUbUL@KWUXmWk@KkXmmkŃKUƒ™a@amUƒbkUkKWUnwUƒÇwV™UUƒÝUKV£U™@ƒnKWwXLVKm¥@wUXkmWk@ƒ@wX@lU„@šyVImaXwVƒƒ@kŽƒnU@mbk@mlUXƒmU@mV@n@bnW@bUIWJ—ImVUKWbUK@nkKƒaU@W_VUUmWmL@UU@™bUWUL@V@bmVUz@`mUUVVbXL@V™L@lmLUxmVamXkW@xWbU„VbUxkU±@ÅUmmkLUbW@@`kLknVlV@lbXxlVUXVV™ŽU„U@UbWŽkIWVUUUJkI@llbUxVL@V™VƒUU°ULUmWXUV@VULWb@™xm@UaVLVKUa@ƒw@V›bkmVambUUm@@VkK@„@b„xlxX@‚„n¤@Xƒ@@lkLWV@Žn„V„kb@bWJXLWx@nkxmm™bXn@VWVUn@VnJ@bVXl@„™VJXnWbX`lL„UlJVI@Žœ@VXV@Vl@bn@@Æmn@VšxXU@mVIlxšVššnI„l@nVJ‚aXI@mlU@aXkVm°klmnVV_naš°@V@xܦXK„V‚nnUlVXbVK‚LXKV@naV@@VVl@@lXblXšWnLlbVK²nš@@‚VLUnlV@lƒXxô°‚V@UnaUUlKXLVUVVUbVVlUnJVX„@VW@an@lb„@nl@VU@anƒšUVW@kƒaUm@InVVKVU@kUW@Uam@km@kVa@a@™nwšU@WlI@mVI@WXaW_nƒ@™nƒlkkW@U‚¥@kV@Uw@wUƒ@@IXK‚¥VIn@nU@`@Xl@VV„LnašW‚bVaUwnU„@VIšKlV'], + 'encodeOffsets': [[ + 122119, + 28086 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3504', + 'properties': { + 'name': '三明市', + 'cp': [ + 117.5317, + 26.3013 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lL@Un@VVna‚bnUlœa@U‚x@„VbULUKVbn@šw‚@XaVK@UVUXWVnVKV¯„VšU@UUKVwka@klJVIVVXUlJXVaV@VƒšUUVWkUWwkaU@UklmlK@_X@ValKnnÆV²@lVVwUaVƒXa@wlXnW‚bnUVwnK@kšK@UWKUaVUnV@_VynU@a@UVKVXšaV@@VnKnXVV‚UX`V@„blL@mVLXaVLnU˜JXIVJ@amX@a@mnUV@„nVWnkl@naV@„ml„@@KmKUam@UU@ƒ@UlKU™Vk™U™K@aVaUwV™U¥UIkJ@wmI@‚mbkwkVW@UXƒKULU`™IVKUa@LƒkkVmUU@WlULUWÅU@I@ƒWW™nU@@w@a@ƒUam_XyVIVWkkƒ@mwVKXUV@nw˜VXkWƒÅ™U@ƒaƒU¯KUnƒK@ƒ¯šmUƒLXŽVLnWVbVbUVm@Ub¯¼W@amƒ`kb™amLUUUƒ™aUXV`@x@XmJ@n@L@xkJUU@kU@mWm@kUUwUUVWl@VUkIƒy@kkaVUUm™IWVXbWxU@k„mVkK@nWVX¦WxU@@bkx@VU@WŽk@™kUbmJUUmkUW@_kKWKƒ@knV¤kIUKWLUbV‚@Wbk@@VWL@VkI@lUXVxUVU@@mWIƒV@a¯nUaƒaUV@„ƒJ™b@bÞ°VbUš@X™aUVmL@‚VXblŽnV„°˜n@Vnx„@VUUUlK@InJVb@„Vlnn@V™L@VWJU„x@XlJUVVVl@LUUUJ@Lƒ„@lUL°¦k˜V„VnV@„xV„„l@blLnlšLVaXll@šnVUn@‚xn@nml°‚X@lb'], + 'encodeOffsets': [[ + 119858, + 27754 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3508', + 'properties': { + 'name': '龙岩市', + 'cp': [ + 116.8066, + 25.2026 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ša„I@ƒVU„bVb°m@b„UXJ@nV@VUUwVW@klJ@UXK@Ul@Xa‚@UVaXKVLlJU£lm„@XLlL@`VXnlVVnIVašll@XV@@Ulw@aV@XwW¥XU@mlLnUlƒV@XwWaXUšJVnUVlb@l„zlJUVk@UXVVVxlVn@nXV@@lVVlI@w@K@mnI@W@wU_VWšbV„VVnKšbla„_n‚bX@°»Van@VUUaUamXUKW„K@a@Ukƒ@wWkXƒWW@wUU™Kw@_lyƒwUkU@@Uƒ@kamVmƒXašUVUka@Wk@»UUUVƒKkbWU™VUbk@mkƒxkƒƒKnIVUmW@kUKmXUmVaU@kU@m@KUWVkIWJ@ŽU@UI@wUUUa@KW»nU@mVkUmm@XwWU@ƒUUmL@ƒw@mnƒVUU@aWak@@amxU@UxULWVXbVLU`mbUImVU„ƒbn‚V@@bVn@bnVWxLmyUbƒIUKƒ@aƒVm™akbV‚UXW„UlKWbkV@„WLUlk@@nšbƒb@lkKmU@ƒUIWJkw¯UUVVxm@@XkbWx—›XKƒlUzWJkUUL@bmKkVƒ@@VUIUlWV@X„K@VkbWx°xUb@LUbk@@VWb@LXJ@VWXU@@bUVV„VVn@VVlLn„@l„@‚xk¦Vx@bVJXbƒn@JlnXxV@@„nJ@X@V@lmx„bUn@xVL@VVKlL@l„„nLVaVL@xkl@LƒxVl°š„X„WVX„Vl„œJWnxlJ'], + 'encodeOffsets': [[ + 119194, + 26657 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3509', + 'properties': { + 'name': '宁德市', + 'cp': [ + 119.6521, + 26.9824 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@LVKVaVaUkVU²J@LVU„@@W‚VJUbVVnLVb„L@VUJ@bVbkL@Žl@Vn„y„XmlU@™xV¦„L@Ž„lmz@lnL@bVVšbVb@l„nšKVk„Vl¤@zXV@šl@XJVLVKnXVK‚VnU@wUm@šKUƒ@UlVlw@U@U@ƒUaUKlU@kXKlmXIWKXaVIVUVK@KU@@k„JVUnLVJUL@V‚IVa@VnLšKUnl`Vb„V„V@š‚Vbn@Vzn@lKnVlI„VVKUalkXJl@XXVWVLVUUmVU@Unm„£lK@Uk@WUXK@U@WVwVkšƒĠkĢÇ°aUÅUwmaţƒɱUÇa™w„±V¹XalKôx„@„UVaÜʓͿVóbÅLƒJm„¯Vk¦ƒŽk@mamXkKUƒUL›akbk@mV@LkJWb@Vk„mXk@UVmaUV@amLUKUamI@KUaU@WbU@UUUƒUIWJUkm@šƒw™Kk„VJm@kxǁVƒUK@mUVUkmlkkVm@amwƒLVWU@UbVLkšUbƒ@VƒmK@XaVWU_VJnwV@@kUmWakxƒ@kwWakIWxnbUJ™zƒ@kVW@@x@„XllnVW@xn¦ULWKXxmL@„VšU¤VL„ÞVVUšÈxV„mxXVlLlV„anV@bšbV„„LlÆnnlW@LXlWnXV'], + 'encodeOffsets': [[ + 121816, + 27816 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3501', + 'properties': { + 'name': '福州市', + 'cp': [ + 119.4543, + 25.9222 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lxna@nJ@xlIVJV¦UšVxUb@bšLšVUlVškL@V@„VVn@Vb‚Ln‚@LU„lJXblx„@lwXbVn@lU@mxUIV`UXWb@‚nLU„„@Val™UKVaV@UX„Knx‚bn@lUkllnUVnV‚@VLU„È‚lwn@UIlƒšL„x‚™n@VlXIVJV„VVV@XaV@Vb@LnJVbVLnK@bVUnbVUl@nWlƒ@UXalI@KnUl@laœbVKV„lLnWnbl@„l¥°Unƒ„IÆKôa΀U„a@UUwÇWǓIUWUÅVkƨm@ƒ@£@KmLU¤ULˣJ™kUƒVǟUUķ@ĉVƒKUk@Ñ°wôǚç@īšé@Åţ¥mīÛkm¼Å@ƒVķVó°ō¦U°ƒn@bVJXVVL@bUŽƒakLmx@xmxXzW`XbWnXV@bWLÛ@™aƒ@ƒaXbWVkaÝwU@mlWKkLWWkLUKULW@kVmVUU݁UamV—¤›n@xUVUzkJV¦lJU„'], + 'encodeOffsets': [[ + 121253, + 26511 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3506', + 'properties': { + 'name': '漳州市', + 'cp': [ + 117.5757, + 24.3732 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@bl@Xb@bVVUŽm„@n„x‚@nKVV@„XVWxn@VnUl@nmVX¼@LVbVV@xVJV@@XIlJXU‚V@Ln‚@lVV@UbVnnWVL@lnXUVmJ„Ll„„wnll@VašUXVla„LVUVV@¼Xl@lbUV™VWbn„nUlb„@@VV@„aVUšmlUašUny@kU@Wkk@WaUVk@@ammk@@U@UlU@aUa@wl@šmXLllnL‚U@anVnU@L@VVV@KlXnWVnVanUšw@w@wm›nÅ@wƒaUam@Uk„mUl@@a„a@U@¥škôK‚wȯ°w@ŻkwǕaK›ÑÛk@ĕōřċ£ĵƒUKW»kÅŻLU@Ulġw@¤Vz™VUbkKUbmLmlULU¼UxmbXl@bWVƒb@bUnV‚UšVbULU@@VkbVL@`U@WX@ŽXV@b°„@b¯š@¤@Xm@@b@`U„VVUL'], + 'encodeOffsets': [[ + 119712, + 24953 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3505', + 'properties': { + 'name': '泉州市', + 'cp': [ + 118.3228, + 25.1147 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Vl„xkz@`‚xšLVV@xXXW„Xl@xl„@V@bnV°™@„„LVm°L„V„bV@ƚX„Wl—UmxU@WVULnx„@llUXUJWzn`Vb@„@b@xV@šmXX@„@JÆVVXVKXkV@nVlU„l@KVbULšJV_VK„LVWX@lUVƒkIU¥lIVyVU@wœm˜£nUVWU@aƒm@UmWw@UX@@am™VUn@@aUUlUVanaWUXWmUnkšK@VšUlVVUUwš@XLWWX™ma@knm‚bVb„VXbVL‚@XJlInlšL„w˜mXóšw@çV»ÇçŋaķƧóƅóKġ°nÅUķƑUÇW@—¯xÇ°öÆlV„n@llšaš@„Lšbƒ`™@™„VšXVƒVx@V@bULVJUk‚Ç@ƒ¼ƒXUKk@mmULkaWbk@ƒx@UkL@a@K@U@UmKmbU@kV@UmVUbUmmXkW@LUU@U@KmVmU@bVmKkkWK™nk@@xVb@bkV@V@Vl@nn@bl@VUXbl@XlV@@lmz™VVbkŽ™nUVƒb'], + 'encodeOffsets': [[ + 120398, + 25797 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3503', + 'properties': { + 'name': '莆田市', + 'cp': [ + 119.0918, + 25.3455 + ], + 'childNum': 2 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VbނVVnUlUX@VKVLlKXXlKXL‚‚nkV@ÞxlbXUWa„b„@šbÜ@XK@aWUXmWaX_Wynw@wnwlK„bV@aUKWUUI@a„mV¯Ŏ¥ô¯ĸU„UÆ@n»¯aƿé@ţ¯nĉĬÝK™óó@™ÑU¼@è™xWô—nƒx™KmkkJWI@UKWaƒUUaamn@lnbWšXXWK™@VxUVkU™V@U™LmlnVWXXVmbUbkVVV@bm@UVnš@bW@@VXx‚n@V„n@bV‚UX'], + 'encodeOffsets': [[ + 121388, + 26264 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3502', + 'properties': { + 'name': '厦门市', + 'cp': [ + 118.1689, + 24.6478 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@VlUV@nanL@V@V@L@blK@V„wl@XalbVKnnl@VL„W„»È@lVUIVK@a@UUw„WUU™šƒš@„_™aƒK™@™bkkm@UƒkõŁxóL™l@¦@Vƒb@bk@VŽƒnVln@Vb„b@xmÆnœ@x@x™x'], + 'encodeOffsets': [[ + 120747, + 25465 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/gan_su_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '6209', + 'properties': { + 'name': '酒泉市', + 'cp': [ + 96.2622, + 40.4517 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ÇnÅaĉ@ƒU¯¥›UŹ‚ƒ£™WUýUU±JkkUw‚yÞIČxĊĕĊ¯š¥ÆUkţ™UÅÓ±¼™IUx¯UƒÒƑ‚ݐŰƒKÝnğ°ÅU@Žƒ@Vn@þš¼¯šWnŎ°XLWlnVnbWnƒVXxmbƒa—bóUƒlǕUUa™IUmlU™ƒš¥™kƒ¥ĉwkkƒÝɛa@¯™™U¯°mVƒkVnKlƒōÑÇÑU@kl™UġŽkUŻnUW™@š¯ƒk»šmWV£UKnUƒmUw‚w@ƒUIVaX™šwm»Èmmwn¯ċ™¯LĉŽUƒJUalka±Va@U‚k@ƒÛф¯WmnUaɝ¤Ûmƒn¯m±x@wóxÛLġÒUx¯VƒÈ™JUbóz݃ÇKĉ¯ōlÝUŎWl¯nťbÝ@¯ǩLġmV@ƯĢkÆm™ĊkVťLɃmÝXó°@„ĢbVŽóVݦɱ@Ƨaġ„UV„ĠÇÈV¼UVţwmbJÇwˋa™XmǯKkkmŽƒbXšm¼V¼ǬŚ²¤ôŰÆƴô̐ŤǪnɆӨ¼ɆLÆłUĊšxŎƞȘǔˎǬǪnƨŮǬö°»šġ„„ÞÜÆĸÒĊ„ǀbƾèôÈ@¼¯þŤĸƧ°VĀ¯b@lÈĊ‚šʠń̐„ȘKǀŽֲॗţÿǕý@ʊǓƨóÆÑǖŃôw@΋ʈƆÅÈVVĊV„óĊÅ@ÞƒĬV@Þīš@°Ž„V@ĸĢƒ°XτƜĠ@ÈaÜ¥Őƅ‚™nğóĕVġUůƿŋ—ĕƒa±V—UťÇğÑ'], + 'encodeOffsets': [[ + 101892, + 40821 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6207', + 'properties': { + 'name': '张掖市', + 'cp': [ + 99.7998, + 38.7433 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ÈÒŎÒk„mLUŽlŽU„¯nV°šš@°ɜb„ÞĠaÈ»ĸl‚š„LVUÈ@Ċ@ýUm„@@ÆVĠ¯Þm„LƯޏƒ„Ñ°VVwšJ²»ÆԚVlŤÅV™¦ĉ°ĉĖċwÝJzVxll²IVVVþšX„¤źœV°¦„VĊ@ÆbÈmǔLĸĠ¯Ģaô¯ĸmÆÛUƒlÇĸk°XyĊUǔV„ǩnmV»ƒa@ýnK°n@l¥@»ż„Ċ¤m皃@£ČU@mƒmVkÞUƐ±²¹°‚ĠwÅƑŃU¯™›V¯aÈŁšƒÇ»™ġn_°xŎKlxœklx„@Þw‚„„@Æm²b‚DzLlkšWXať¯ĊaœÑšK±w@wƒUÅçV±Uk™@@„¯š¯xƒU™±±UU°ōxVxÅÔō°ó¯UÝ¦óbÝþƒ@ĉÈóUV‚Ux„„@VŽUVÝwÅÈǎóVkk¯JǐkmmL@„™KÇx@bkš™@U°ķ²ó`ƒš™šmn¯°ƒUwlÅkUƒ`™¦ɛô™Žķz@ŽÅnÇ°U¼¯KmVk²ƒJƒ¼ƏÞķôš¤ULƒ@mnğ`™šÇnUxÇ@Ûÿ™U@ƒƒkŻŽ@x@móJkŃ¥VŹĉóÒĉlċ°ķ„Uƽ܃@›x'], + 'encodeOffsets': [[ + 99720, + 40090 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6230', + 'properties': { + 'name': '甘南藏族自治州', + 'cp': [ + 102.9199, + 34.6893 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ލš™nKlnšwX¥WÝXk˜xÞUnƒ°aĊVnUUKlÞĶWXnĠ¥ô»„™@nmVL@¤°™Vz„JšanU@aÆwna@k›ƒU¯šyX_›aĉb™ƒ„wƒéXkWwÅaš¯V¥mƒ¯UƒƒI@ƒš@„mšb°aÈçšUš¥@»‚knwɜƇ°I°ÑÈmVU™¯Xa@w‚W@wšV¯Č¥l¯Uwnm@k˜aUaóKkk@™Ça™b@ŽÒWa¯IÇxÛam¼™VUƒxÒl‚@zÝÒ¯bÝaĉVĉwDŽW›zJ™mJn²mܯUƒ¯ĉ@ġ¤Åb@²nšmlƒ@@Ž„„U„ƒLVxšV™„U¼Ålma™b@ƒ°™l@WIUƒ¯@mƒ™@™™ó„™„@U›zţyƒXÇU™ÇVUUVLkbWakVWmUbkkƒKUÆ»nƒ°Knk@aƒUVmšnk»l¯Ģ›lw@_kKVU@ƒnaƒ@lUk@¯¥mV@kmbW™b¯Åõa@mkU@kƒÇŽkU@›`@™óó—bl¼Uxƒn„¼šlVȄx@blVkVVnƒ`XÈġÈ@ǃK£ÝJmUUnUĖmlU„mKUn™VÅaUw›Uĉ`¯n¯wW¼nxVŽ™š@bĉnƒ‚kIċŘkXUŽ±Ò™xšÈ@ŽX°`l„œV˜IȯĊV„ƒšVVan@VašUVażVmšblkÈW„ƒWIXa„alL@wVb„„V„¦lL@lĠ™n҄U‚nk‚šL@ÆÞkšÞšK‚bñþW¦Û„ċVƒ„ULUºkÈlŎUxÆxÞUUxšÒ‚x„@XbšL@lÆ@„ÒlXVln@„bm¼ƒJ@„Ån„šƒx@bnšĠm„xVXmbÈè@ŽĊ£ČW˜w'], + 'encodeOffsets': [[ + 105210, + 36349 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6206', + 'properties': { + 'name': '武威市', + 'cp': [ + 103.0188, + 38.1061 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@±¯¥@klwU»ƒƒÞÝmwKm¯™™ç@™kVÇUL¯lVUKġ„ġm@a@U„@X£°l°LŎÇ@aōVÝw™ÔƒKUŽÅš„WJ¯lm@ÛVWa™@klĉUmaƒLUanaƒ™ƒk¯J„™™±KkXóÜÅxƒ²Ç‚@„„nUÒĊb°@™ÆkL™Ž™XÇÆ@xÝn—xWxţ„¯¤ƒI@Æn„ƒVV„VlU²Æè„V@x²x™L›ÒĉbŦ°Wb™Xklބš@l¤šXĊ`„wl@ĢÈŎm@bšnV‚Ubƒ„@șÆÛLƒèǚUÒŦlĸ™`°ĮʟÆǓbĉôϚĊƚĢnŤé΀ÑĸĀĊ¦„@@l°lœ¦Ȯ¦ɆÞĊKŤ™ĵĸů„»mŁyġ™ķŭ@Çɱȭ¯mƧUĊķnŁŻ»UaU™˜ƛɞÝƨů'], + 'encodeOffsets': [[ + 106336, + 38543 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6212', + 'properties': { + 'name': '陇南市', + 'cp': [ + 105.304, + 33.5632 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@šÈÞ@l`UmVƒ¼œŽ‚@nnÆwVlnVVa„LVƒÈ_‚ÿރ@n„a„xÆ@„lš_š@VxnK@llLnxmÈŎJnbUxšI°Žl@n¦‚lÈIlmX¥„k°@šk‚J„k²é˜@klaUaVaU@@ÝnIWnmnx‚k„ºÞ„„aV™°„V@nw‚KšxôbÞ£šVšU„bšþšLn»mƒVw„IšJ°Ž@„nb@°°I„ġUkÇKVƒ™™@ů»lƒ„Lnmƒ£@anK@Ñ܍n@»mL@£™yk„UUmbUÞÝ@kyÇbó»™XUxƒWVzb±mÝbXaƒwUamL¯»@wUKVwm¯ĵJ°ÅUWVk„KVk°wÈVšVуlUšƒ¥škmVamknƒUw¯¯ƒbċ¥ÅKƒk™Kk„™VċVk£kKVw‚Ñ„a@kóyÛ¯ÇVk™ów›š—Xō¥Ç¼ów™Ž¯U±‚k„ƒ@x›IĉÒÅVmÈnšÜ@n°„bUbÝV‚ŽUnnJ¯Į@‚m¦nV܃@„„L°JXb‚Ñ@šaÈb@šllôLVb—b@lmnVxk°ċ¦U°™Ž@xX@xWbš°UVÇn¯Ò¯Jɛƈmxl@¼'], + 'encodeOffsets': [[ + 106527, + 34943 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6210', + 'properties': { + 'name': '庆阳市', + 'cp': [ + 107.5342, + 36.2 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@kw‚ĉ—»VamƒƒV¯wƒIóVkl¯™Km™Vō¯ÝWkL@bÝKō¦@Ž™„@š™Lx›@b@l™a@km@@l¯nm@UaÅ@ƒ„óWUXm¥™nƒw`@UUxķôÇ°ğ¦@„VJš_n‚‚IVŽnalxkX„JWn¯šnVƒLšxl¤nnVbklVX@xnxmV@bUK@nm@@xƒV—°±aÅnƒŽkUWnUaƒx@m™n@ƒ¯LƒššmUĀlU@lV@blLUblxklkIÇx¯°‚UXbšaVŽUnšV@°‚LUlnbšX@`°nVmbnÆmV‚kLmK™¦UŽ@X„y@kl@U„°K@¼XbW„ƒš@b„WnLVa„VšƒVz@xlVČ¥lbUxލlV„U@nÆWôn²™VJlU„Ƨ„LnmÜLXa˜n@mœw@wlUlV²mšblwšVȃlLލ„±@lVnUlxnkma@mškšJ@kXV‚U@mn@š¼VXUƒVƒlLnmVbôaVnWV»ÈUl°È¯ÆIn›ÆU@kk»mKkÆġk¯@»mƒk—¯@óÇlÇ@—Vykkl™Uml¯Þ™@w'], + 'encodeOffsets': [[ + 111229, + 36383 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6204', + 'properties': { + 'name': '白银市', + 'cp': [ + 104.8645, + 36.5076 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VKUȚl@šè°šnŽ‚LnxÝބ„V¼kx@l‚¦²°ĊóĠ„™Ċ»š@ÈxšaĊxlwÈVŤa@¯²aÇ£ƒJk£lƒnUÞ@°šô™@y„wl»lIX¥Ǫnw@ÑÞWla„ÅlL@ƒUwĉakƒl@ƒš¯mwna°J„V¯nUVÓÞÑm£²óWaUƒÇ@óÝUçV»ÈkkW@¯‚xV@XlK@wX@Vmm_@wÈݙKU¯ÇwVwÅK¯VƒkƒJ™™™XkWVaƒImŽ¯Uk„ÇlVšœĀV°mxóšk„@¼ó„WxĉÜU@Ub‚zÛJÇk@‚ÆnVlԙ@kŽ„x™ô@ĬWL¯ƒƒK@aÛImm™@ƒIUaƒ@™™UŽÇêU¤VÒÇx¯ÒV„šš™lk@Wbĉ¦UbkWV_‚y¯Lƒaó„kŽ@b@nmbkx„°'], + 'encodeOffsets': [[ + 106077, + 37885 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6211', + 'properties': { + 'name': '定西市', + 'cp': [ + 104.5569, + 35.0848 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„a‚V²wVJV_@„LlanÅllŦçÜӚ_šlnƒWaôk„xUš„bmV@È°lèšnk°l¦„`@nnL‚@ÈlÜIyVaV@ĊÛXwôƒ@»lƒô™nwU¯›ÿU™Èklƒ°Vn„JUblXšWšš„I„l°U„ƒVƒš—@aVVVmnL@„lƒ„UUw‚mkƒš£„bV¥VUVwۂƒlaÇÝރmk£ƒLUy¯L@WlkKW_XaWƒ—mƒ„ġU@a™k™‚ƒakXkmVwmŹVƒU™b™WƒónmwnWW£„KÈnV¥ƒ¥„ƒÆ_k™lW„bU¯„V°aôbnaVwmaōInÇmwkK@kmLUw™@™`ƒkÅ@ƒwƒb@m݄ĀÇ`U„ƒKUbmUUkÅxmm@›„»nUVk_Ý@™Ç™¦™VÇè¯b™aƒn™@@„„JV„°Žn„U¦™°ÆbXxWl„êƒxš„ĊaœbW`™zV°œ„@lmbÅx@bmV™bƒI™`™¦@ÒUVUI@ƃL@bš¼@ššŽ@„šlmxnL„°ULƒŽƒÞğޛ°kLUŽƒL™°™xVŽ„n„KVƒl@šzX@'], + 'encodeOffsets': [[ + 106122, + 36794 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6205', + 'properties': { + 'name': '天水市', + 'cp': [ + 105.6445, + 34.6289 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@UyȍVƒVUnn@ƒVU„`UblzšJnk‚@Vb„KU„°l„wš„„W°„nkVŽ‚UÈlš£°V@n¥šV„kl™kU˜±U„ƒn™ƒlw¯UkwmKUlmkUmnkym@ō@U„mWÈU°l°anlJškUKlU„¯Èm@kmWV»kkÝLUWUx±b™@¯ma@ƒ¯™IƒJUxn„m¼™K™ýƒa™V™Uݤóa™wLmxU@¯ƒUšƒb݃ƒ¹lmwmnXŽmJ@ÞV@UbVbkblŽ—@±êƒlI™l¯@ƒlW¦knÇJkm¥k@¯™Jmbóa¯bƒUV°ƒakXlšÅ`ƒ„„¦U¦ÇmƒLX¤mXnxm‚„ôšXša„VźUnŽUxlnlW„bššl@bĢV„ƒ˜nX„WbX`lLXk@Ž°KVz„Kl¤„nÞ݂Èkb„‚܁'], + 'encodeOffsets': [[ + 108180, + 35984 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6201', + 'properties': { + 'name': '兰州市', + 'cp': [ + 103.5901, + 36.3043 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@lW²LššƒŽ°I„l„šmbVb„KnbĊVlkš@XbÜU@Žkn°‚XIƒÆ™V„LšÓÞxŎUlôƒ„b°KzU`lXVaĊ¥Xal@šk™™Uƒ°ÑÈwUтV£ÈéVšš„@Vb„Jš@nnÜJ@b„L°„XK@īšóƒwlš@kÓmUÅmK@mƒ_k¥l¯™mkçǯ@nUƒaV™ƒwólXbm„™k™`ÛÔťèkkmÆkbƒK@U`UI±xUƒbWlX„mbVbÅÒólkƒƒIWJkšƒ@ƒz—KŻ¼™@™xUx󎃄¯LWb@ŽÅ҄„±¦U`nbťĀUšVb„LšŽ„U'], + ['@@ƒ¯lwna@mōȯK¯kW¤ƒ@@V@bĢnĢƒVLU‚°k'] + ], + 'encodeOffsets': [ + [[ + 105188, + 37649 + ]], + [[ + 106077, + 37885 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': '6208', + 'properties': { + 'name': '平凉市', + 'cp': [ + 107.0728, + 35.321 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': [ + '@@ÆLUxÈxV°šLÇÞ@xn`Ü@X@nĊŽÆwnJmwUx‚aUkšw@V@w„aVmlLXÝl@X‚VĢmV°@nl@UUUWK@w„ÿVI²Òlmš@nÝĊýVV@nšJ°„„šUłm@kV¼nK›ĢȤôK„blnKllVk²aĠ¥È¯ĸóVw@V‚_„xšmn¦VWôX„ƒÆ@Vbn@°m@kn@@lšb@k‚aœ@‚wšK@™šƒ@UlKVaƒWX™W²¹lӄw@_°›n@@_lKōķW™@ŽmLUWƒn™»Û@›l_Ç`ƒÛmm°ÅbWb@š—VWbƒUUKDŽÅaġlmkUġlƒ»—Lƒl™Um¦@Ž¯U™¤ÇkVUml¯ƒƒX™ƒƒx¯kVƒƒLUa@ml™IkyVaƒ_UV@„mmUVU„ÇŽVzUxUVU¦ƒa™¤l„nVxƒVk„@ƒmKUnUU@b™˜U„ƒ„', + '@@@Žż@™mlkƒġk' + ], + 'encodeOffsets': [ + [ + 107877, + 36338 + ], + [ + 108439, + 36265 + ] + ] + } + }, + { + 'type': 'Feature', + 'id': '6229', + 'properties': { + 'name': '临夏回族自治州', + 'cp': [ + 103.2715, + 35.5737 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@š@ż»˜L„y„@l™XI„Jl„ôkÆÑUanaWƒXkW@™yk@U„ƒLƒmUšwš¯„KVlKœ¯Ġ݄݄VKƒ¯mKnw™k@ƒ™@™™»@a„K@ÅVJVU@њ¥š_Uy¯š@£UKmn@‚ƒšó¼ğ¦WmĵXݎkŽVLmVĉU¯bm„ÝV—wWlXÞW¦™xkmmL™šÝŽœ„±U@Vގ™š@„ÅÈW°X„ܼƨyUĮnŽWŽnXÝxUx°lVXJlôV'], + 'encodeOffsets': [[ + 105548, + 37075 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6203', + 'properties': { + 'name': '金昌市', + 'cp': [ + 102.074, + 38.5126 + ], + 'childNum': 2 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@šĢȼ™„Çł°bœU°šV‚ƒń‚ÆǖŰnšÆ„ōĬǔaʠůĭš_kķÆ¥VÑș„çÜKšÅ@DŽƒVaU™m@aōnġÇk@ƒxĉ_™Wk£™@݃±KÈ±aÅnƒ@ƒÝxƒ@kw›lkwōL¯wm`'], + 'encodeOffsets': [[ + 103849, + 38970 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6202', + 'properties': { + 'name': '嘉峪关市', + 'cp': [ + 98.1738, + 39.8035 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@llĊx„¦šl™¦š„kVVnšJVbǖV„kôV˜a„bnaWw„UXmmamUXkWKō¯Xm°™™»ĉÇ@UVƒK™ķkǼğb'], + 'encodeOffsets': [[ + 100182, + 40664 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/guang_dong_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '4418', + 'properties': { + 'name': '清远市', + 'cp': [ + 112.9175, + 24.3292 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lǯkÿƒaV¯™VaÈU„¥ÆDŽIlxšmnb‚Uœxl™„Uôl°kš„„Wl„š@ô™VwUanUl@„xVkšaX¥‚kU»„aš¯±@kka@ƒUwmUkwƒJk™˜„±k@ƒ™™L@ÝWUwV݃—xÇU¯ŽÇX@m™Åƒ@@yĉ£VmUwȗ»ÇšUn„lUnWU¯`Ukƒ@@„™x„Ž@bÇxX¼ƒVVš¯LšĀk‚ÝLƒ„¯@VŽƒĀ¯lnĊW¦kVÇôkUDŽUK@ţ™U@a™™ó܃UU»ƒ@™¦k@Vx„KVb„n‚š@„Æ™„l„@xšƒbWšnlU„lxÈlV„È°Æ„@¼™„@x„šWxœŎ‚V„šK°„š¥ššnƒÆkŎ@ÈÑm™„K@¥šk@™ô@„nôV'], + 'encodeOffsets': [[ + 115707, + 25527 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4402', + 'properties': { + 'name': '韶关市', + 'cp': [ + 113.7964, + 24.7028 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@W™Xk±Ñ@ƒUw™mUwĉwlmn@Æwn£mkIš¥ÇÅ@¥šaƒón£nWWwš£V`Þ@šnVml@xô¼„IV¥ƒkUmkamUkVWwÛ»móƒ£UVÅKmn@x™@kbmm¯a™Xka›VĉaUb݃ƒ²—‚lš„IlxnVVx@„lb@l²™°ƒbV¼lW¦™bUlƒwk@mVVbUxóš™@kƒƒX™ƒ¯lókƒVkš›wVma™nkwƒJÅȃ¦ÇVUbšŽU°„blĀ°ŽkÈ@x™¦Æܙ°@„°„¦óa™VUôlUlbXl@nÜV„„nKlŽnIVÞ°Wš„°U@bnm@¥šIVƒ²Ulƒ°VnalzXyl_Vyƒ¦lƒœLlxš„@ŽÞbšKm„knVWanwƒÑVwČº˜@n_ÞV„aVŽÜIœl@„˜KȚ„VJ@aš£È@˜™@km™„aV¯W@_ƒa¯KmbkÇkLmwƒ@Å¥'], + 'encodeOffsets': [[ + 117147, + 25549 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4408', + 'properties': { + 'name': '湛江市', + 'cp': [ + 110.3577, + 20.9894 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@ƒkXƒ™@a„UUċlk„Jƒk„™@wVJXUWk°W@nKnwlUlš²ƒ„blU@‚lI„l@„XbW„šxnm@lW@w„wU‚JX¯VU°`ŎóˋkÝÝkÅ@ÇmğÈřmw™aĵV›xUہ»°™ĠǷnýmóX¥ɅĵҏÇ@°²ĊUĖ±ĮU¤Ç°™Ā¯ɐnżUĊĊĬV@脎@ԃÒU¼l¤nƒĠb„êVĠ°Èy„zVaV‚nUÆL„ašbVl„wÆ@'], + 'encodeOffsets': [[ + 113040, + 22416 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4414', + 'properties': { + 'name': '梅州市', + 'cp': [ + 116.1255, + 24.1534 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„‚nԚlW¼x‚¦@lœVl™lLkè„a@zš¤ƒĖ„¼UxlnUKUbÝlU¼lb@„Vx„V„klJÈwV¯š@ĠlÛĖšnƒbkšÆźÞƒUÈôklmšL„¥‚LœW˜„„™nKUkVa°V„x@IVV@x°bUk„a™a@mV@„@y„w‚L„ÑUwVUšV„‚„U‚bÞVVann‚@XwÇÿš¯²aVamkXaÆ»@»nw@¥›UXaƒkbWa¯KUw@¥m@kwmLU»UU™J@kmU@UUWUƒ@ƒyƒanwmçÛl¯ƒŽ¯UƒmKUmƒwVkmÝXbW@XWÝbƒk¯@±‚w@»U@W¯Å@ƒÇ¥UƒU@ƒƒ™IU™ƒakJƒĀ„ꃰšþƒXkamŽ@Žƒ_J°m‚@X'], + 'encodeOffsets': [[ + 118125, + 24419 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4416', + 'properties': { + 'name': '河源市', + 'cp': [ + 114.917, + 23.9722 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@°VlmX¹laĢÒlm„@„„šVš£‚‚@¦Ģklynn¼lW°z„W„„°VbÈV@lÆbnn‚JškX„šVÆašÅ„W@™ƒUUw@ƒkaV»ÞkVaVLkmVwƒ»„ĕ™£@yƒblçkKkš›U@k¥‚wX»™kmӃ@Wn¯‚I„`@nlb„W™ý„¯ƒé„ÿlI@™XUmWUwƒ@@UJU„Ç„mKUV@x™„ţk¯¯LWƒƒnUxK@ű»Vwa¯š@¤WX@ŽÛ¦@¤ÇIȼWxXŽƒ@Wx—w›ŽUnVbÅèmVa±²UWl@Žk„lȄ¤nôܼXxlUnVlbVn„lU¦ƒJó»@wnkmU™‚Ý@U_™¤XxmXm¤„ô™b@¦Èƙ¦lJn'], + 'encodeOffsets': [[ + 117057, + 25167 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4412', + 'properties': { + 'name': '肇庆市', + 'cp': [ + 112.1265, + 23.5822 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@l@š¥„@V¼„Vôۚš@bšV@ŤVLȃlVÈólUX¥mĉ°k„ÿU°@„ƒÞKl™ÿ°KU™„UW»Èw@aƒšw@ƒ„@nm@w›£kÓVUVn„Kš™k¥™£Vamƒ@nkKkbÆǫma—kmLU¥™UmƒÛwmVU™mUƒJ—ÇaUxÇIn`mb@Þ¯b@„nJ@nl„U‚V„lVU„L›W¯—Û`Ç_¯`mš¯I™bĉWċzx±J™xš¯ÆUƒƒ_k@™šƒJ@Umb„šXôlLš˜n¦@¼ĊxlUXŽ˜xUbL‚Ġ„UnVĊwlšUš„b@lW„X„‚m²˜@ÞWxXš‚Unb'], + 'encodeOffsets': [[ + 114627, + 24818 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4413', + 'properties': { + 'name': '惠州市', + 'cp': [ + 114.6204, + 23.1647 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lbšW°bnnlaš@@wnmÆLVUkÇlƒ@Xk‚V²±‚bnUÆçUaVmœ˜xXw„@WXwÇ»ÈJ@£Ü¥@XW@£°™‚bUx²¼@ƂLVw„mX„°K°Ťlšƒ@wVUnLȃVƒVIky±wkƒKU¯ƒÅkƒ™XġÑۃlwUwlm@m„nKWašÅm›¯óÇmğb¯alĉUwķbmb@lÞÒVn—šmĀŹ@VŽƒbVŽUnmakLm`@xĉkklVÔVJVn—lV„UnmJmaLUbl‚™zmŽkL™a™‚ō@@zš‚V¦UŽV²kJ„nÜU@˜VXUŽL@„lJƒL@bݤUnVŽ—b@xVnlK²„Vx°V„xlI„lkVl²k¤@n'], + 'encodeOffsets': [[ + 116776, + 24492 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4409', + 'properties': { + 'name': '茂名市', + 'cp': [ + 111.0059, + 22.0221 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@‚LnÇlk„KnkÆL„ƒUm™ÈxlUœJló°n@ššanŽš„„a@ƒ˜@X_@mÝóóU@a™aU¯mL¯ƒƒkV¯™ÇVwkw@V±Ŏ£@™™@šalw±Vk@m„Åm¯™ÿŃƧIÇ`ōô¯_UVW°IV‚ƒx@xkX@Žmn™wXƒWa@ƒƒkkJ@kVƒa±„k™kVmxmL@‚¯XXlWVUI@xƒš„lƒIklVȃV@b„šlW@„@nUxVblVxkôlx™n„‚y„šnIƻư„aXwlK„bVnƒŽXb‚L„¤„k‚L—èƒVV¼ƒŽ²IlĠVX„ynz°KVx°@VlœLlblKœš'], + 'encodeOffsets': [[ + 113761, + 23237 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4407', + 'properties': { + 'name': '江门市', + 'cp': [ + 112.6318, + 22.1484 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lUXx°JWnnƚXVš„W„X@„šºVLV¯nU‚Vnb™ô„x‚aXmW™XIšŽUb°xlK„l¯œK˜xXÞ°ŽšXÈ¥Ü@„ĉޏU™‚çš»nóƒVma—x‚¯UÅU¥Ý¯@ƒƒç@ș@çĉÅUmU籃ĉKÝxÝ_ÅJƒk¯»ó¯nmèkǀšŽWxœ¼mnUÜġ°@¦@ƒxƒLkŽÇaVnUxV„™šVlnIlbnÆÆKX¦'], + 'encodeOffsets': [[ + 114852, + 22928 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4417', + 'properties': { + 'name': '阳江市', + 'cp': [ + 111.8298, + 22.0715 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@°„nKV°šb@bôVÞô@n„VlÒôÆUnlnn@lmkmVkƒaÈkÆƄ™k¥‚ÅÞ»ÆKXkW¥ÅLmÅkamJUkš™UƒVwUmÈbl„K„w‚@@¥Ģ¯VÛnm›»Xw™lƿ™@kbW™—aʵ@óL›l¯ƽ@™ƒƒLn°ƒÆ@nUl‚²kx™b@‚š@šō¤U²@ŽlxUxšÈU°lŽ„'], + 'encodeOffsets': [[ + 114053, + 22782 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4453', + 'properties': { + 'name': '云浮市', + 'cp': [ + 111.7859, + 22.8516 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@V„Iš™l@„`V„°Å™šw²I‚wČyĊXša°Jn™°_È`Ü_°˜œX‚KVƒkUUƒVkƒ@mmI@ƒ°a@Ýnam_ÈJVwlĉX@„šlUšómaUmVU°UK™¹@ƒƒWƒXU™™WmÅXm¯IWwkVWlÅLݼÆl¦ƒšÅÅÇl„bUllnknm@kmVmóÅkуUW`—@@„ƒb™ƒm™b@™¯mkô›IkVÇwnš„VƒÅKmlƒLklmȁKƒšVĊK°²„`n˜¤n„U„bWl„xVx™LUx@°nXm`VklVxmnnx'], + 'encodeOffsets': [[ + 114053, + 23873 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4401', + 'properties': { + 'name': '广州市', + 'cp': [ + 113.5107, + 23.2196 + ], + 'childNum': 13 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Ș¼VxUnĊ¤@z„@šÆ@nÈW°ÈV˜w„ŽUÞVxÞX@ŽšK„šl@ބVaĊbœU@ml£k±lUƒkkJƒw¯UUw±ƒkLUm@w˜aUVmÞ£@a„KkI@ƒ‚KVUW@—ÛVƒmlIU±VU¥™@yğzƧǃƒšƽĠřšÅnī±m@ƒ²¯lƒ°@nÝÆóUll@XnÝVU¦mVV°—„V¼™Jƒn„b@°mbn„ƒ‚@²¯‚¯wVwƒ@@nmxX¤¯L@ŽVLU„m@@l'], + 'encodeOffsets': [[ + 115673, + 24019 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4415', + 'properties': { + 'name': '汕尾市', + 'cp': [ + 115.5762, + 23.0438 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@‚„@VxnXWV@š„bVššJ„„V@ÞÅU¥Ċxš£UWU‚wÅUU¥WVUkĊÇnkV`°LV™„wƒƒnU@™„ƒlbĊ¯„Vnalšš@@çkUÝ¥ġaó¯ÅaÅLŻÆUýmy¯ó@ĉÆó„ȯw™ÆXbmLƒ‚@nknVxkx܄ĢҚW„Æl„V°„Ll‚²xlz'], + 'encodeOffsets': [[ + 118193, + 23806 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4452', + 'properties': { + 'name': '揭阳市', + 'cp': [ + 116.1255, + 23.313 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@V„Ȧ„Æ@X°V@@¼‚x²°@„lÞaWXX@‚aÞWlnUŽ„xVnnL„‚°V„@k‚mĢl@„ak™@mlk°aXƒ±„nwm±™²¯JV²@ƒwW˜—_mƒa„V»ƒU@m¯ĉUф™šJl™„ašbVn„lĸLlƅÛDZwÝ@ĉxó@è™@k™mbƒUĉ°kaƒ„@šmV„„ƒxUš¯KU_mlĉÈVlXUV¦ÆVxVŽVX™¤ĉwV¦ÝÆ'], + 'encodeOffsets': [[ + 118384, + 24036 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4404', + 'properties': { + 'name': '珠海市', + 'cp': [ + 113.7305, + 22.1155 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': [ + '@@„è@„Þ°V¦VƁ°˜wnb„UÆ»nçƏ@nxܤ²llU°VnÈJސ°UôéšķUklƒô£VVˌKÞV°£n¥ƒ£ȗ™Ýy¯¯mÅkw¯bÇĔğ@Ýn¯ĊƒVğōŁŻƒķJ@Ț', + '@@X¯kmèVbnJ‚™' + ], + 'encodeOffsets': [ + [ + 115774, + 22602 + ], + [ + 116325, + 22697 + ] + ] + } + }, + { + 'type': 'Feature', + 'id': '4406', + 'properties': { + 'name': '佛山市', + 'cp': [ + 112.8955, + 23.1097 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Èb˜Ž„InVVšnUÜxn„šVV¦nK˜lnbÅǬlalL@mn„Ubš¤l¦™šƒLUmUVlԜ¤@xmnVl°_XVVmƒkVmș@kn@VƒUK@°KW£nw@m„@Ux°x°@±„mƒna@¯ƒa„mšIU»˜ƒU¯nUV¥ÞUWmk@Vk¯™Ukn›ÑWݐƒĊÛ@Ǧ™W¯Wݗw›Lk°ƒkL¯wVa™WJXšWnbƒwkVƒ™W@kĊ'], + 'encodeOffsets': [[ + 115088, + 23316 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4451', + 'properties': { + 'name': '潮州市', + 'cp': [ + 116.7847, + 23.8293 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@°ŽÜknèmx„b„z„@V‚VX@VnV@lšIVVV¼nKlxn@@¦Vx°LXbla„ŽWbœV°£¯™W@nW@™‚aUñVœwWš»@¥ŤÅUÝǓÝóV@ńǎkUVmƒIUwÅVWÇX¹›—@W„¯bkl@nlšƒb@‚kġŽn@l'], + 'encodeOffsets': [[ + 119161, + 24306 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4405', + 'properties': { + 'name': '汕头市', + 'cp': [ + 117.1692, + 23.3405 + ], + 'childNum': 2 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@‚@U±°Iš±n²mx²ƒ˜@œWºXÈÆUVx„JUnlVȍ@ŃôUǔÞVçn»VyĢÛVm@»kaÝUǼóšÛÈķKċ¥X„¥Wwğk™ƒ¯@ƒwķKƒkUm™aƒbkš™IƒšVÒ°Ċ@n„VU¼ƒ‚„bn˜`X—„x'], + 'encodeOffsets': [[ + 119251, + 24059 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4403', + 'properties': { + 'name': '深圳市', + 'cp': [ + 114.5435, + 22.5439 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ÞLš„@xšbV„šVšK°™X°Kô¥Vw@anU„胐š‚lkĊl@wn_lKnbVmU„aUź@nÿ˜™UmÝѯUƒbk„@ÆkxŻ@™aÇX—wƒJƒƒ¯LķÝUĕ™ó™ĸóêWº@b²nmĬ™Æ'], + 'encodeOffsets': [[ + 116404, + 23265 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4419', + 'properties': { + 'name': '东莞市', + 'cp': [ + 113.8953, + 22.901 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Ŏ@ššblKnšykVa‚KnbnIVmUƒ˜kUmUIUә„ƒçmV@bUxó¦¯LW‚¯š™L™UUƒ™a@w™ƒÝKğŚ™ƾ„„ƨÈĠy'], + 'encodeOffsets': [[ + 116573, + 23670 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4420', + 'properties': { + 'name': '中山市', + 'cp': [ + 113.4229, + 22.478 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@‚XœÒlmšV°ôÞÅ@m„¯°k„±‚@@aX¹¯VݏÇIUmV¯kk‚±Û£mw@‚Őmèżmô™¼èVš'], + 'encodeOffsets': [[ + 115887, + 23209 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/guang_xi_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '4510', + 'properties': { + 'name': '百色市', + 'cp': [ + 106.6003, + 23.9227 + ], + 'childNum': 12 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lklWXL@VšI‚l@XnJn@VUUalk@mK@kny@UlU@a°™„ƒUU@VmaU@Ua@UWw@ƒn@KmLm@alkšmnI‚m@an@VIUamWÅImwU@@a@K„X@JVL„UVmUaVkUa@m„@@Ulmkk°ƒUaVUlKXbVwVIkaVmUk@KVk@a„aW¯m@w„¥laœX@KmaškVmnUl@nxVKšInU@yVaVIV@na°KlxX@@_lmXšUV`VIV™V@„n@lšbn@@WUkValK@²yl@„„VUV@@K°L@KU@@UVaXIVVV@naVkVa@K@UUK@UUa™LWa—w@m@K@UVVƒ@mVUUVKnL„mVL„K‚bVK@UUIk›mI@mUIVK@IUK@VkLƒ@WU@mU@WmUk@ƒI@VƒJk@WwX_@amK@UUWkIƒ„ƒK@LVb@mVmakL@J@bU@Ux@xƒbmI@`ƒIwm@UbmKUaUWa¯UkJWV@XƒJUU¯LUmV@ma@kkamKwƒLUUmWVkkm@aVUUkVKnVVUmXK@UW@km@Ukkm@@W@U™kUy@I@aUUmbƒ¤U@kUmL@bmJU@Ua@wkLWWkL@Uƒ@VaU@ƒLUakKWbkUWVkKkLVLUV@JVbƒz@Vƒ„@ƒVmUU@kVmK¯@VƒU_™VWakVmIUKUaU@@bml@XU@@V@LmKUV„mVUKƒƒKƒbkaUXƒKUL@x@V@l@„mxU¦„V@ŽlL@V@Ln@@VV@„nlKUaV@nLUbmJnL@VWLkbmV„@@L„W‚„XLlx„VVIVV@x@V²blUVm„LVUœK@kWWXUlV@Xl`„LX„l@@VšŽƒn@VnbVš@lVUVUÈVbš@@`UXU`l@@XUVm@kš@xmVknUJVXUbmKULmbx@VlJ@LVbkKUbVLÇUUVƒUVmU@VaUkUKƒVUwmLkUUVVlƒbka™XmwƒKUšVVU@@V±Uk@VWUUm»XamU™bƒKk™`ƒ„™U@UnWW_kKmbUVUVmnUV@„nJVUlšUbU@UV@n@JmI@VmbnVUXlx¯ŽkKmnVV@L@V™bkV™Umm™@Ub¯LmlUƒL@VWLkmkLmmn£WmnKU_mW™š™bnbmxƒ@U¦UJU„@Xmlk¦@‚mnUUm@@Jn@lV„ÔVJnIVW„I@a„ƒÆK@I@aVK„IlŽÞnnl@nl`nbÆX²l@xV„@llbVn²ŽVVl@nn„V@IlW@Un@@kVa°KšnÈmVaVXUlaVƒÈU„VlwôUlynIVašan@lVXb‚Iš@n¥la@Kš_n‚@bÆx@XnJV„nKVz@`VXVšU`@bƒ¦UV@VšIlx„UnV‚K„XÈbšVllšbVbnVn@'], + 'encodeOffsets': [[ + 109126, + 25684 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4512', + 'properties': { + 'name': '河池市', + 'cp': [ + 107.8638, + 24.5819 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lLVl„bVV@nXVlI@JVX„mšn„W°b„IVV@‚ln„@nalVUb„nW‚@kVkÒlbVKn²°bUŽlV²@˜X@`nb„aUI@ƒ°wlU@aXJVI@aVK@wUamIXm‚@XUV@@bV@Vm„ImnUUwVaVKXU‚nVK@akƒVwV@nL@UV`n@@X‚lnIUJl@X¦˜V@aUIVm@anƒV@UwnL@VlbVL@KVVXUWƒ„wUUVUka@UVJnUlbnalbVVn@°„„LV`Þ@šXVxV@@bVlUVVbXnWlXnmlš@XXWVXJmbUI@V„llUVkn@@VWV@Vnb„@VXUJVnn`lLVk„a„»lVšLnw@WV@lInw@WnU@U@m‚knUVó„K‚wUmUXUƒU@@wVJVIl@XKVVVbVI„J@Un@lŽVLnm„b@U@Ul@nUš°VUVJnnVJV@„@mVU@ƒ@wkUVwkKWk™yUUkU@alkÈ@lJ@x„Ilƒ@UUWVkUw@Kn@@kmaƒVUl™UUL™ÇƒUUKl@UUmL@aXU@mlUUwmKkUUVKVUƒaƒKUnK@U@Vl@XUWU„KlwX@šb@K‚@XkV@UwWJka@aUwmV@U™@@U@wUm@»kLWVkIWŽXnmV@VkbmKƒLUbk™Va@aƒa@@aVU@aVak£@ƒ±UkVU¯V™UUƒJVƒUIƒ@kxmUmWUbL›w@K@aU@@aVU@Kma@aka@_VWkk@UWVUKULWKULUš@KUnƒwVaUKƒxU@UmaƒL—m@kVmVa@UkƒmI@ƒ@KmIkxU@@K™U@mmakI@VƒLkmWkkJ™_U‚@V@L@n˜xXbšKVb@VVL@V@LUbUlmbU@UUWJUb@VV@@L¯K@LU@UVƒƒk@±z@‚kLUbVl@Xm@™akm@ƒU@UšUJU_™VWŽkn@`W@kw¯LmbU@UJUb@zmV™JULmwk@mVUn™lnb@L›Wkbƒ¦@x°nXŽƒb@bUl@LVlUnlbUJUxWakLUVVb¯„llkn@Vƒ@@nVbUlVbUnƒVUK@IƒW@L@bV@nxÆJnXVbUJm@@bnmJ™nkl@b‚nnK@L„m‚@Xx@VVbV@nb@UVVƒ„¯š@bkV@Vmz@lnLl@kŽVbUVm@mI@Wk™J@UWKkXkl'], + 'encodeOffsets': [[ + 109126, + 25684 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4503', + 'properties': { + 'name': '桂林市', + 'cp': [ + 110.5554, + 25.318 + ], + 'childNum': 13 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nU@J‚X@`XLm¦Vb`lšVXXWš@VblČnVšŽlanLnmVLšK@_Vaƒ¥@kUa„@VmVb„aV@XVVzlVVK@knKVmX£VKšLlbnš@b@llL@xĊôXaV@°È@¤„bn„V@@Wl_„V„U@W„nVamw„wVbn@„K‚VšLX@VmVUxlV@šnVV_nK@m‚I@Wn@@IšUĊ@@wVWX@@I°VVm@wmU@m@IUƒV™kƒlkUmmkÅV@@aV@@Wn_UKla@kšaV„šlVanb@k„@@KlVn@@aV@nIWW™UUaVU@™kKmwU@UImKk@UU@w@W@‚™k@™UkWƒ@mk_W@Ua@a™ƒƒ@—¯ƒmV£@mƒUUam@—kWakƒVama@UUm@nw@alaUmnUlVlIœV‚™šLVyk£Vm@k@UUJkƒK@kmKUw™KkWK@UXImyVwnI@m‚ƒkUlkUKkUVmƒw@kkJWUÈm@_k@@aƒaW@U„UJUwU@@IWKkƒmUUV@nVl@bVb@bU‚UXƒakw@ƒWUkbkKƒbm@™xUlkLm@@wmKUX@‚™UaVW™XVmU@@UUUƒxkmWXkKkUWaUaUb™L@`UL@LV`UXmK@VmakLVbkL‚xUJUIVbUVVb¯KƒV@Xnl@lVXbmÒnV@L@VWKkVUIWJkIƒŽUamUUbm@U„kU@JUbW@X„WxUam@kbVVUnUJmUUV@bƒU@UUV™@ƒVk@ƒbƒmULV¦U@V„U`VLUL@xVbn@UJ@nWJXXVŽVV@bkxVbUx‚Lšš@x„¦@šU‚lXUVVlULV@@šnŽU„ƒb@xl„nJVnlVknUlVUbmŽU@ƒbVš„x'], + 'encodeOffsets': [[ + 112399, + 26500 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4501', + 'properties': { + 'name': '南宁市', + 'cp': [ + 108.479, + 23.1152 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lKnbnU‚@Ua@K„L„ƒlJVX@VnL@bW`Xxl@„I@U„Jl@nV@X‚V@nXV„@lK@UVL@JULVJ@nnJlœVJ@VULaƒLUKƒnmKULVVUŽ@nU„š`lIXlln„K@UlJnb@nšV@LV@lwnJ@L@„nJl„@VUbUn@l˜n„KnbVŽV@„wVLUb„xVm@LV™VKXLVKVLXU@VllUX@`lb@bnb‚L@ŽUV@bV@@b@Lœx‚KVanXVƒUUmVUUUaVUky‚UUa„ImK@mUUVUkKU_@W@UVVVIUW„UVaVU@UUKnƒ@k@al@ll@bnL@b„VUV˜X@Vœ@@b‚Knblmn@V_@aUalL@a@akK@kVKUKlwUUnV¥VmU_VWVIVaX@Va„alńK@LVJnalL@LnK„wlVUw‚mX@VXšƒlLUVnblaUmVUVwXU@Wm¯Va@ÞKnw@w™mšk„»‚UVW²a@_mW@U@I„y„LVUUKW@@™„LX@VUV@@yVU@UV@nwUUmJka@IU@ƒmƒVkaW@UwUX@`ƒ@kLWUk@mƒkUUm@k‚UUWkUƒkWxk@@VƒK@nV@UVaƒUUJmIkVƒ@UamLUbkVmamLka™@ƒ‚kmL¯WI@wJmwƒx@akU@aUKmbkaW_nW@_U@Wm@a@wkwUKmƒk@ƒbkb›w@mKUkkU@J@bW@kVWz@bVUa›VUx@„ULkJWbXVVXƒ`@œmJUVU@@Lk@WbU@UJlnXlm„Vx@Ln@‚b@K„LX„WJUUW@kƒaUVUbmV@nnV@n@lVLƒVmLX‚mXkV±@kxÅL›šUbJWIÅJ@I‚mXalkUamKkškL±aVwKƒUU@mÞnbWJX„m„@lbmKULWUUVkaƒbnn@Vl@VVV@VƒbVbnLWLXJWxXLV@@VV'], + 'encodeOffsets': [[ + 109958, + 23806 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4502', + 'properties': { + 'name': '柳州市', + 'cp': [ + 109.3799, + 24.9774 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ƒwU™„aV@nVaUVklmkUUmmIkƒ@w„aVƒm@™U@VKUkVUkWV@™ƒ¥@w™™KVwUalw@aUUUWWXI@mVIm@Ua@wVKUKV_UƒV@U¥VK„n„al@„Uš@VU@V„V@aVUnVVIVmUUlan@VbXwWƒX@Va@IlVVƒn@VanVVb„lJXIVJlUXL@U@KmUnÑWakU@mkƒJUI@mk™@wUmmUV@JXaWIXWmaUIƒJƒkk@W„nJ@„ƒaUak@›kkJ@kUKU_ƒ@myUóWUkm¥kUmL@KUKm@k_UmVa@ƒk@@UmU@mm_—JWIUVUŽWLUlbVUJÇVUIVwƒKUVk@mU@n@lUL@Km@@l@L™VƒzJmUU¤m@UbV²U`U@@¼Vn@x@Vš@@VnUVx@blbXIVxU@Wl@@L™aW@kxƒLXVWVk@@U@VmLVŽ„L„bUVULVV‚lnLVxkV@nWV@bnKVVk@VL„VšÈVKšVVk„Unb@lm@@LVxUlVX@Vk„ƒJ@wkIÇ@kl@blVVVšzXllLUxlV@x@„UV@nƒ‚U@UImmUIUV™¯mVk@@V@VƒamnUKkm@@VƒIUJUaUUWLk@UJUI@xV@V„VWVnxƒLUômVV„@VkVVVUnV@UVkL@VVV@bVxla@bkXVJVn„`nU@bƒb@bVL@VnJ@„l@šV„aU@@_lW@UUU@Unƒlll@XLl@@UX@°bVWVanLlknVV@VVX@VVƒnUŽVLmbXJ@nllXX@`VXƒlmaXVWk@Wkƒw—J@„VL@J‚bnU@bn@@bVKUnVJVIVVVL²a@bV@@Vl@nUVakalmš„UL@VUL@V‚a@mXl@nK@UlK„L@Vl@@nkllb@š„Vnn@‚šnV„™V°l„šVInwlKXxlU°Žn@@ƒ‚I@UnVlakUJWkUK@anUWK@_ÞJ@U'], + 'encodeOffsets': [[ + 112399, + 26500 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4514', + 'properties': { + 'name': '崇左市', + 'cp': [ + 107.3364, + 22.4725 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@JVzšl@V@Xn@ll@VlnX@@VWLnŽUVmUULVlUV@blnUlnXVV„K‚xnLlb@lnbU@Vn°KVV„I@WXUlI°VXb‚VVbnLVan@‚x„J@_nJ„a@wVwV@@a@IU@UU@WKXwWIXKmKUa„a@U‚UUUk@@Umm„albVUXVVKnL‚a@knƒWƒXImanÝV@„V‚LUx²blKl™nLVbklWbn@JÆIXJ‚IVaœ™ÆKlw²@lUnWWnK„UUK@k@mmU@mnUVaVU„b@lVXVXIWƒƒK@Lam@@KUwnƒWkkmVIV@Xal@@KV@VUnI@›„_UWWUkam@kkm@ka@mƒk@wkJWIUU@WXkW™XkWWLUUƒ@UakLƒW™XV±VIVWUU@anUWaUK@IU@Vak@@UUKWaƒ@m@ak@@wUkla@mUaUklakwVƒ¯¯@WWUkLkKmaƒ™kLUnV`UxWX@Jkn@bmlƒakkk@ƒb@l¯bm„ƒbJ›b@VXn„bVV@„ƒbƒJUkkKWVU@mœÛVUUW@UVUJWXkVkKmUL@WW@U„Vl@XXKW„XJ@XVlmbUxnnm@UlVnV@XVm¦VJb@šmLkKÇbXblVkn@l@bWnX`V@@IVV@ŽV„V°n@@_naÆVVbUVVbUJnzlVUl‚XkV@Vlx@X„VnxƒbƒKUK@b¯VVUV™L'], + 'encodeOffsets': [[ + 109227, + 23440 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4513', + 'properties': { + 'name': '来宾市', + 'cp': [ + 109.7095, + 23.8403 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nVlw„@VJU„„IVVUšV°lU²V@„l¤Ub@bUV@b‚@„b@bUblšVa„KnLla@UnUWmXlJXUlKV@V_U±Van@V£nV‚I„yšU@K@kn@@LVK@k@mnVl@VU„LUxVJÈUVIU‚aVkXKVVUXJ˜In`@nnV@Vl@@„UbVnl`n@VL@LnKlVn¦VlôXV‚nz„@V`VL@llIœll@Vb„b@ƒmIXƒl@„l„IVJnbWXXJWb@IU‚nVVn@xlš@nVJ„I@W„U°LUaVUUaVJVIwlKUalKnb@UnLVWU_@KVK@_šKVa„@VKU¯VLVKn@la„aUkU@maVU„J@k™@Um@XmbkyVaUIUU@KV@laVn@KXKWUkUk@ƒaW™UUVw@aXKmƒVaUUkšmIƒlUU@wUa™xUmmU™¯™U@WƒLUmVIUym@UVmUa@wmw@çm@aWLU„™JUIUamKmL@™aƒx¯¥ƒkU¥U@±„k„UVmKU_mJUbkKm„ƒLÅǙ_@WWUXUmaVUkK™„UWW@nVxkUƒxmL@KkKmbUI@KƒLkƃbUbW@UbUJUXV`UnU¦mŽVVkxVLUL@llL@b@bkKVb@bU`m@knmaL@a›@@U—WVUƒU@amK@akkk@@b@lm„VL@VUVUbƒVVXUJUU@V@XV`lLUVVV@nnLƒJVbVlzUVVbVVnUVVU„'], + 'encodeOffsets': [[ + 111083, + 24599 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4509', + 'properties': { + 'name': '玉林市', + 'cp': [ + 110.2148, + 22.3792 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VJUXVVXlWX@V™xVnX@@`ššULWŽUXÅbWK@mULUUmJ@n¯b@l@VULVx„x‚XU`VXXJVI„V@nm`@nUŽVXn@lWVn@b@Jn@nU@Lm`@Xn@WJƒ¦U@@VnL„lV@@Xl`nIlJnkVL„w@KVK@UšaVL@bVKX™lUUKVK@I„VšL„a@U@WšLUlVL@bU@@blb@VlbUxVbXUVJ@xVL„U„lV@VU„bVLnKl„XJ@L‚b@an@VanL@`VLšKV_UWl@U_„a@WVInlVUUUVm@I@W@wVakIWm@U@ƒXwlaVbnI@ƒm»Va@aXaVLšU„»@aVa@k™KkL@KmU@WƒzUK@wU@VWUUVUUKUa@mKmbUK@_nWVaUkVaUaVUVLXKVƒVUVmVI@UkKkLm`UkW@UwWW_„UaU@WakXmK@xUXƒJkƒUUWUk@Wl—mJ@km@@aUKzmyVk„a@kkWVUU¯lmU@@w‚kkmV@Vk@mÅIƒ‚Ukƒaƒ@Ub@m@UUU`mUbWaWmb™X™XKWIXUWm@љ@y@UkIUJUUWLUWƒL@UkVUxW@kaWbKWnXxW¦n„m`XLVlUbVbUx™I@JmLUKUb@VW@@bkL@b@VlU@xkš@L@lƒxXxWXX°V@VVVbUVV@UVVbULVnVJUb²b‚aUb@VVVVInlV@VnXaVUšlI„VUb'], + 'encodeOffsets': [[ + 112478, + 22872 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4504', + 'properties': { + 'name': '梧州市', + 'cp': [ + 110.9949, + 23.5052 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VbXblVlLXWln„wVV@VV@UnšWUXVbš‚@VWXa@kVK„UaVaVkšUlyX@Vaƒ—VmUwUaVU@UÈymI@aU°@š™nWV@VaVaw@IV@VmnLVK@kmmna@™„™VbVI@aV@XbW`U„„LUVVx„@VbUV@bl@VLXblJn¦lL„°°@n™@K@UlLnK„a°LWbnJ„¦UÒV„UllLlVnKnbWnn„V`„w‚@@Xa±™n™l@XKV_„WVkVa@kVyUa@wU£UW@UIVW‚@@a—wWaX_WKkVmUULmak@UJUI@±m»™—k@m»VyUIm™nmmwnkUmVaVIUn_mW@»Vk„@VwkmmUXa@IƒaVm—mƒ@Wm_U@mIUWóLmUk@laXmmkUK@UmKULUUmWULƒ@VakU™@Ub@bƒ¼™VUKWb@bUbn¼@„mJUakbWx@„@VXnlJUb@x@X@JUnVVUVmkUJ@XƒbV`k@VXU`™LUK@_mKUbm@@b@„U`@nlV@b„UnbVbn@@`VbUbVV¯bm@@mJXb@bVnUllVXUlbUl@LU¦VVmŽkLVb@b™l@V@XlK@V@nUJUz„°mŽwmLmlXbWVU@UUUlƒIU@VVmV@@¦‚bXbWxX„WlXVWL@LUmkbU@@LVVVJUblzna@WVnš@@lƒIUVnbV@Vlƒbkbm@ULUKV°ULƒ@'], + 'encodeOffsets': [[ + 112973, + 24863 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4511', + 'properties': { + 'name': '贺州市', + 'cp': [ + 111.3135, + 24.4006 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nL@xn@lKVkšwn@„alLlaXV@„lx„bVWV@aUa@aUk@mVUnVl„XL@JV@VxVIVƒX@„b@bl@@`ÇnXVlI@l„xUnlVVLkllV„@nmJUxnzWJ@VXLlŽšLVxnL@l„LlŽVI@V@lUnl¤Uz™Kš@„Vl@š„L‚l„Lnš‚b@VnVVU@k„a‚Knxn@VkVJ@ńUlakmWIUaVanm@_UK@UVWUa@klXam™U@Vmƒ™VIXW„@lUVknVlKVLXŽVXšW@b@VlšnnVL@KXL‚Kn@lb@UnW°@Va„X„WVb°aVa@I¯aUkUaVKVwƒaXk@a„a‚™@wkm@alanUVw@alK@Umkw@UƒaUmU@WXUaUK@UW@UaVWI@¥Xa@w@WWšVƒXwƒU@mKUXUWVU@a¯kl@akU@UULmK¯VUVW@U_m`U@@xVbUz@lUbUlƒXU`WLk@mš²šWb@Ž@ƒxU_mƒXmmamLkUkKVkUƒVу¥mIXa¯KƒbmLkK@V@Lmš¯@ƒ¯kKm¥kIWaUKk@@aVUUaƒ@UwVUƒKVƒX_WaU@@bUJUaƒš@šmbnn@lULmKUnU@@J‚xUbUbU@mX™š¯@VŽ@bnJÇz@VUVVbVxUn„˜UbW@kz™VUlUbVbƒŽUL@lWb'], + 'encodeOffsets': [[ + 113220, + 24947 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4507', + 'properties': { + 'name': '钦州市', + 'cp': [ + 109.0283, + 22.0935 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@IlVVlnL‚@œxla„al@n„VLlx@x@bXnV@@`mXX`lbnaVL@blV@b„wnx‚I@xXJ°nK‚l„š@lbnKnblUVanKVb„@lUnJVI„VUb@V‚U@m„L@Ul@Xw„llVVXV@lVnlVn„l@XVlK„@@_VWVxX@lb„U„nV@@JlbnIlmnVV@UwVK@U@k°a@mnIVVVK@nXLÆaVWXVK™™@_W@Umšw@UXWWkUUVWUIVaƒUkJ™UVWbUmU@mkUJUU@UVab±aVaUIUmVKUaVUU@VUUaUUU@W¯XWWw„w@k@Kl™@wkV@U@alK@aX@@UmIUWUIƒ@mmkXU`U_WJUnUJmUk@@amLU@UVW@UkU@@VƒbUWVUk@@wmKkUWLUWX@JmIƒlUkkKWKkLWU@UKWa@bU@@a@_UKWƒUUUmJmw@nV_@ġğKóLmbU¼VÆ@xUXƒ@Um@wklVnUn›lkaUV@„lV²WVklWXXbWlkVkIm`UUƒLƒUU@UWƒx@XU@@lWLU@kbUbV`UXllUV@bmb@LnKVbULm‚šnVVIV`X@'], + 'encodeOffsets': [[ + 110881, + 22742 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4508', + 'properties': { + 'name': '贵港市', + 'cp': [ + 109.9402, + 23.3459 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@n@VzUJ‚nVŽ„K@XšVš°nVVnšwVb@xVV„knJl™VVUbn„WL@bUxVVXš„bl@lVXkWƒXwWaa@¥‚@nUUUV@„JVkVVV@XUWanknK‚xnƒ¯VyVI@m@UkL@W@Ušk@aUalKnUUV¥@KVkkaWVkUVkUm@aWanI@n@°aUUVaUa@_m@UamaƒV@akU@mV_@ƒa@KWIkƒmLUKƒaUVU@ƒkƒVUK@wUIWVUaVwka@Uka@aV@@aUKVk™K@X@Vƒb™KƒU@JULVLkVWšUL@aUK™b@VUL@LƒxUKmlkImJk_@WU@ƒkmK@UV@„¥XIm@@Wn_@KmVm@@I@aUmkXm@UWV@mn_@mƒUUJWIUWV_WƒwU@mUknVVmxU@@VUV@zU@UVW@ƒK@šX@VLUVƒKƒz@J@VnX@`±bUXVƒ¼™lšn@xmxÝL@‚Ubn°@XWVUxUVVnkbWVXV@Xš`ÆȄKnƒlLVanIV`nLVUlƒ²ƒV@V¦„l°¦„w‚b@šnKnLVbVJšIVƒXK@b‚n@ènx@xVbUnV‚'], + 'encodeOffsets': [[ + 112568, + 24255 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4506', + 'properties': { + 'name': '防城港市', + 'cp': [ + 108.0505, + 21.9287 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@XV@X°°U„lxkbVlVb@nkbVl@xl@@b@n„‚XbVL@Vl@UbV@@JVLXbmV@bVVUXUJU²šW„XlKVb„@VVXKlXšWlXXWV@VXJlI@x„l@nlbn@lln@lbXalIVK@ƒVwœUVb‚U@aXylUX@@aW@U_UJmU™nVKUamL@Kna@aVUkkVWU_ValaV@XK@kV@@W„wVXV@„V„KVVn_lJlUXkWaXWlkXU‚±kU@ƒVUlbœkVmUmlk™¯Ý™™W@mb@¦VxULm™kJUU@ma¯wƒmkX@VóJ±bUVUXÝWk™lWXXlƒxUaƒbƒIğ™Ç@U@mVUKkkm@UJm@XnWV@x'], + 'encodeOffsets': [[ + 110070, + 22174 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4505', + 'properties': { + 'name': '北海市', + 'cp': [ + 109.314, + 21.6211 + ], + 'childNum': 2 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VaVLnK@IšJVwUaVaUkWKn_mƒX¥WwXm‚LXalbU£UyV„Å@ݙwm@™°l›LÅUƒmk™mwÛaƑLÝUUm@ȣƃV_„Ó@£UƒƒUVƒ„™¼U°W̄™ÞVbXbôx@b@bmV@ǃ™UÝ@@ĢU`m@ŽnxnIVV‚VX„VL@`@bV@@aXbVL‚@XVlKXLlLVl„knJ@I‚WVXXKlVnL@xl@UVVX„a@UV@VlX@VUV@nK@bl@nVVIVmXIV`V_lWnn„@VJVXnJ'], + 'encodeOffsets': [[ + 112242, + 22444 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/gui_zhou_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '5203', + 'properties': { + 'name': '遵义市', + 'cp': [ + 106.908, + 28.1744 + ], + 'childNum': 14 + }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@@UnUlJn„w‚JU°VL@bnVšU„wlJ@XƒŽXVlU@klVUJknl„UllL@bUJ@xULUlƒ„UblVkblbnw‚UXmla@„wV@VK@L@UXaVKVLXWƒUVa@U@Im@@W@£UKUakKWIXU@al@@llUnL@W@Un@@VlUV@VIUanKl@Xb@lmxVb@b°bb@nlJVVnnJ@b@L‚V@ln„@LmV@Vx@blnVK„nlJXIlw„J@҄b@nlK@Un@UL@VVVVUUUVK„l„@VUVL„J@UVUUw„@Wm@™„UV„ÈVlbUb@JšLlŽX@@x„„ƒLmŽk@@nlx@bUJUzVJ„@@LVxUV@bWxnLnVVK@_‚K²xVbV@n¥@aVI@b„@l@Va„Knb@n‚`n„mmý„W@ƒU_šwV@VlVV@Vn@n„˜@nI@Jn@°¦VaUU@™„mVVWVaUńU@aVKnƒVbVUmmU@a@kUw™m@aUUmUUJ¯lakU‚aXaWUUaVƒkk„amkmUnVlULƒVlJ@XU@UJWUUw„k@aU@WbkWƒL@U@WU@@XUKmV@aUVwUĕUJUamUUVUÑm™nIVJ@kl@XalJVn@KVLœ¥@UWIXWmU@mVUKnUWLUKUaWUUKVU@U@anUny@UlUkK@w@a@aVUƒ»UkVw@Wmk—JƒÅmUUVmwXalLXWWUnam@XkƒJ@UVU@U@W„@@U@I@Wl@Ènlw@KXLWb„lVUkalKUU„VVaV@@wnIlaUmkUƒKWU@KkUkLWaƒKUUWUn@VƒK@LnnWJUIƒVkUWVnV@V™@@XƒK@VUIUJ@IWJkX@VVJ™IƒVkK@I@UVaUWk@m„@wnUWKk@mxk@@„lV@b„xmb@x@VUmLkUƒJ@nVV@b@VkLVbU`¯I›l@™U_UW@UU@™™ƒK¯wm@™xƒL¯¥kIƒ™ƒ‚@bkbƒ@Ua@ƒm@kkW@XVbmV@ŽkV@bWbUbV@„¦ƒxXlmVk@ƒ¦™bkaWL@KUImK@wUK@VUI™b@bmK@LÅy@akXW@kbWlXblL@ŽULUbƒ`@U™kUymX¯@mšUJUUJƒL@Lm@@WX@lU„VlšXll„@l@Èk°V°Ž„X@VU@UVll@XUJVXUVm@@VXLWlnV@Xƒšk@mVULnxV@@bm‚kL@VWLUbU@UVm@ƒb@ķ¥UnmJ@UUVƒkkJUšlÔU`UIW@ƒ°kLUlUI@WVI™U@mWKkXk@ƒ‚WU@bXšW„@J@xX@l@LVl@xšLVxXX@x‚KnxVknb‚KVV@U„L„WlXU`@nUlšX@llVXšVU„KlkUKlI@anKVLXKVaUIVWV_VK@VnLlU„»VKVL„m'], + ['@@@KlKkUUVVX'] + ], + 'encodeOffsets': [ + [[ + 108799, + 29239 + ]], + [[ + 110532, + 27822 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': '5226', + 'properties': { + 'name': '黔东南苗族侗族自治州', + 'cp': [ + 108.4241, + 26.4166 + ], + 'childNum': 17 + }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + [ + '@@VV@XkV@bUbWJU¼Vb@Vnb@bš„@J@bƒL@LV@UVƒlUI@a™KULVb@bkJmx„šlLVxknVJk„‚xnKmnnL@bn`WIXlWLU@UxVbUVmKV„XI@JVIVJ@U„L@Wš@@UmUXUlV„UVJXImm@K„L@UVmVXV‚„LXblKlV@LXV„LlVVnkbmJ@xnXl@šbXa‚@Vana„ÒšL„m‚VnIl‚Þ¦°k@b„@@lV„nJlUnš‚VX_„@lVlK„šV„UUxVLVWVIXJšUlnnWlI@KUaUUVKn@VaVXV@na@ƒmw¯@mUkJUamI@lk@@am@@I„ƒUmVImUUw˜™@anUVaUU@LU@WaWUXWW„wV@VwnU@L@ynbl@@X@a„J@nW@@Vn@„lVLlxnI„lš@@UWKUƒnIlJXIVllIVVš¼XK@aVI„V‚@@bn@VKXLVKVVVInw„J@UWI@mX@WKnI@KmU„UVJUL@V„KW@@k„@aU@@W@InJWUXwWI@Wƒ@¯wkaVaUIl@nŽValIXWWI@UUm@anwWkXWWIUbk@UJmIUamKVUUUVVama¯VkIVVUlKnXVwX@@WVaUUVa@IlƒaVmƒkna›wk™UU@ƒU@mUVƒšUVwœl°LVbnJVU™¯la@mX@@UWKXU@aV_V@@JlkUƒ¯@V™nK@km¯k„U@ƒWUW@mmƒU@™kmlU@wkL@WƒUkL@VmLƒJ@b@V@bknUUVK@UVKUK@Uk@Wa@LUVVnUbmVk@@UU@@aƒV¯K@U@UU@WmUL@aU@WV—w@ƒ˜I„xXll@UX‚K@KXXVJna@wWaƒ£naUKV„m@UU@mUmalm@@XkVm@U@VƒLmWU@kkWxU@@bVV@VkXVlƒVƒ@UUk@@ƒmI@KUw„m@UmVƒUUwU@lwkV@IUa@mUaVIVKVa@w@U@™UJkb@n@bmJ@XmlVUxWXkJmUkUUVW™xUlU@ƒaULUšmbU@@‚WXkmƒL@xUV@nUxÇm@„XLWbnlƒnV‚nnUV˜U‚nVVz„@lbUVVlULVb@V@nUJkwm@Ux@bWbUK@UULka›JbƒU™U@U@lUK@XUJmn™J@bU@UwWa™x@zkJWnUJUUVšVV@bXn@xVb@J™L™m@X™w@`@bkb@VmXUV¯L@mW@@n@V@‚ƒL@K—IW@@aƒaUx¯@U„m@XbW@@L„V@bnVWVkKUzlV@bÆa@lnI@VV@@LnVVKUaV_VJVbnU@bn@‚‚nX@yVIVxXKVLlUVaXU°J', + '@@@KlKkUUVVX' + ], + ['@@UUVUkUmV@ln@VXVK@K'] + ], + 'encodeOffsets': [ + [ + [ + 110318, + 27214 + ], + [ + 110532, + 27822 + ] + ], + [[ + 112219, + 27394 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': '5224', + 'properties': { + 'name': '毕节地区', + 'cp': [ + 105.1611, + 27.0648 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': [ + '@@UkVƒ@k‚W@Xn@@K„KVIVVIn™°@nWVzšl@V„_VaVK@kKWaXklaX@lW@bÆz@KnL@ašaVJ@UVL@xnLVJ@LXKlbša„¥l@nUWk„wƒ¥U@VaXa@amLkUƒKmƒ¯kƒmkIUaƒKUIWƒkKm@anw@mlwXIƒmƒUk¯@a@amUƒ`kkKWVkxmUUak_mJmw@w„mXUW¯X›_@WnI@aVwkWWýŃU@WLkU™aUbVV@lUVVnm@kUmV¯™kK™LƒwmVUUaWV™aaWw¯wƒÈ@VULUVUUƒK@nWJkI™l@Umxnbm@kbUJƒa¯bUbVxmLUV™aU@VUUWxkVVV@bUV@XWbnlUbƒbUJlbUV¯b@z„`WbXnmbƒaƒwUwVWUƒbUxmbU@Uam™@Vƒk™VaƒwVaUƒWI@mUKóz@lUlÅ@WIƒb@xXxml@XklULWKUmwUa¯KUXWJkaULmKkLWbkKUVƒImƒƒWa@kUaULƒW¯LƒK¯@kbƒL@b™x@J@bmnnlUšlzU`U@@Uƒb@„m‚n¦°bU„Vx@bkVm¼mx@mk™mVV@bkxVn„aVV@bU@mL@b²`lIVV@lXLlš„bVxn@@bl@XllIVšnbVšn°°wlbXw@mVa°lVnU@mš™VLVbn@@b„@@WVnUV@Xlxn`VznJVb@L@bV`V@šUnwšU„@WUXKV@UUlmUUlaXalLšm„bšIVbnJVIlVVaUUnWVXn‚VL‚k@ƒnWnblnlb²x„xVKVXlVXLVW„LlUVJna@wVL„¼@JVX@`@nnx@nWJU@Vx@XXKšŽUblxUš°„LVKVVlL@KnbVUnJ„IlUšƒnKl£VW„x„IlJ@nšVÞUVVnb‚VX@V_°lnK', + '@@@UmWUwkU@Um@@VkL@V@„„‚V„VkV@nbVa@ƒ' + ], + 'encodeOffsets': [ + [ + 108552, + 28412 + ], + [ + 107213, + 27445 + ] + ] + } + }, + { + 'type': 'Feature', + 'id': '5227', + 'properties': { + 'name': '黔南布依族苗族自治州', + 'cp': [ + 107.2485, + 25.8398 + ], + 'childNum': 12 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@‚V@IöalK@UV@@KUaVIVVœLlaVbVWnX@‚@LnUlxl@naVLXVVaVU„J@lUUanWWI„@VlV@Xbƒb@V„n@VmVVbk@kU@V›V@X„J@zn`ULW@kK@_WVUK@LUb@Jlxn@nnWlU@@b„x@XVVU@UbVb‚@n`VI@VVLUlUIUV@KmL@VV@XIV@@lVLVmXV„@WLXLW@U`šnkb@Vl@UL@VVV„L„llX@`lIXb„J˜IXW„L‚aVL@ŽXXW‚Ģ™b@bmK@L@°@Vnxmxšn„K@xVn@VkL@V™Lƒakbl`VnnxVnUlššV@@VVXV`@šœk°JV_UalK@U@aUU@m„IlVnK‚V@U@wnaƒw@akU@ƒl@nwl@XLmV@xnƒl@VXUb@V@JlL„UšJUI@UlWUƒnLVUUaVwV@XKWkXJm_@amKnmmLwlƒUIlmUwkKƒ™nwlI@aUaVKšL@bVJ„kVUU@@K„K@a@I™ƒ@ama@UUaV»XIVa@alU@WUU¯IWVUbkVUKWLUwUJ@zmWm@@amVUaUIU`VbULmU@KU@@UmJ@kÅb@akUVylLXUmU@aƒU@KX@Wan@Vƒ°@Vw„b@bX@˜J@L„K@@U@mX@@n°KVUnW@Ula@a@_šx@WšnšK@IUa@wWm@aUUU™VVVIXmlI@yšwXbVxV@@ašInmVI@WVL@k@VšV„V‚aœIlbVK@VVLXa@aVwn@lxVI@m@UUaVKUkVUkaƒ@UymUV—VUmmU„mmkXaWK@ƒÈnVw@mVU@w„KlnXW@V@naV™VKUk@KVIUWƒ@mk@KXU@Um@@lVƒk@UVJna@UWaƒL@a@ƒXa@kmmVUUk@mkkƒamJ—ImJUUmIm±aUUkambkamVUU@VlbUbVVƒxX„WVUU@VUakU@UmUV‚U@mnUVVnUbVJ@b—UW¥kLVamVkUaWJU_UVWKk@@nl„UVVJUXm@Vm@UnVlmbnmJUbULU@@UUKWVIWxnJVb@xUL@bUJWIkxƒbkb@xVJƒbmU@kW±LkKUkVa@a¯am¥ULkalÑlKXUWƒXƒaVakImVƒ@ka@UUƒJ¯aƒX™mmb—KWU@wUUƒaUa™KmU@UXlWb—¼WLUKUb°„UlVbkbVL@VƒšƒJ@nVlUbUXmJ@VX@lbUbU@@bWb@VnLVJ@bVVUz„ŽVL@lnL@b™VVVULmKUk™Jkbm@ƒxVb@V—kƒKVnnV@b@ŽWXU‚„nV„l‚VVXVJUXlVXbWV@VU@Ubk@@KWbUUmL@JnXV°XJ@_‚`UbkXVVlÆkbƒ@VLXVV@‚V@k„KXX@`V@@n'], + 'encodeOffsets': [[ + 108912, + 26905 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5222', + 'properties': { + 'name': '铜仁地区', + 'cp': [ + 108.6218, + 28.0096 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@°a@aÈbVUlU@aVKnVV„VUlyX¹lWVa@U™VƒnUVU@m™@mUl@„mÞw„@‚xnIVbna@KVI‚J@kwV¥ƒUXÇVkVW@kkKWU@aXUWmnIVa°VXbmL@VVbnVVVUb™VbšJVbVKXkVKVanU@aWnWUWa@U™nk@mVIVK@wXxlLXbVJVlKœbl@VI@mšaXalVV„VbX@@ašalnkx@b@V‚b@Vnx@bVVUXn¤WXn@Vl@Vlzn@š`@I@KUU@ƒV£namVkXa@aVK‚nnU@anVlKƒa@UUU@amk@»kƒU¯@aš„VWnkWmkImU@akaVm@»VUV@UKnkW¯XWlkUKnIWaš@nmlIXmWUnwUwWm@wULmaUJkIUaƒaWa—klwkwmJmU@bkJ@XUJ¯W@XbWbUKUkWJUUVKnn@UmmXUWa@mU@@UI@WmXVykwm@kaULWwU@¯ƒlKUUVU@mU@UkmaUbmV@b—š‚xVnVUJVnƒ„@Jn@@bl@@knJVblInV°@nx@„mbU@UWUbm@ULVVVb@LkJmXkm™VWIUJUXUKVwƒV™UƒŽkLkUƒ@W`Um™kVmIUƒ@kƒ@@a¯lÝ¥kmJUƒn™KƒÑmbUb@Wb™ak@mWU@UbƒUVVkLlbUVƒkXaWK@LkxÇmk@@X@J@Vƒ@@X@VUV@V„IWln@mbXVWXkKWbnxVUnV„ƘInl@XUxVl„¼UV@b@b@xlLkV@VmzmV@b@VUVVLXVVbVLXKmVVLU‚@nnVWXXJ@V›¦UK@LUmkIWbk@@lUImJnšVÒVUnVVbVIVĖUxV‚@bnUVL@WV@@X@V„KlXXaV@@bƒlVxXVVIV@@WkI„UVKUkVmlnnŽƒbllU„VbXVWbblVkb°ŽVInVVV@bšnVx@l@bnVVnUŽUam„UL@bƒVVÆUbUXU‚ƒn@šVVUb'], + 'encodeOffsets': [[ + 110667, + 29785 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5223', + 'properties': { + 'name': '黔西南布依族苗族自治州', + 'cp': [ + 105.5347, + 25.3949 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VL@Vl@@IXW@kVUVbnW@XlKVVnU„VlL@b„aVbƒb@xX‚°ÔUxV@kbm@VxkxWJœ„V¦ƒŽ@ÈnšVKšxWXJmV@n„Ò@xVbn@@blLk`VX@bššla²JVUlnn@U±lw@wnw@mlwVIX@@m@klKnk‚a„KnwmmXkƍVm„Uš¥l@nb°n@„aVwVmVIVnI@a„¯@mšU°ƒl@@VnI@JV@UV@b@IUbVJmXöºƒzllUbVa@aXUl@„U@llLnKVaUa@UmK@UšwV„bnKV@VwVK@UXƒV@Vbn@‚w@U„WnX‚@„a@m„I„™@UUKlaUaVk¯ƒVaVLXK˜»XaWk¯mƒkğwmW@mIƒVkwƒJUIšÇVwU™UkVKkƒm@UkmU@WÅwm£Vƒ„m¤¯IkJWa™_™lUbmJzÝJk„ƒUÇVU„ƒ‚@bU„Ýn™m¯LUb@`mL@VkL@VƒUmmk@UU±Umka@kUƒ@ķymUkk@mmkÝmUaUakImV@V@VÅLƒ¦ƒJUXmJXšWb@n°Æœx‚¼nV@LlbUŽUbmL¯@ÞbV¤nbVx@bUVlblIœ™@KVVUnVJUn@VlLUlmLUUUxmK@I@@VW@@bU@UJmUkLVVUl@b@V'], + 'encodeOffsets': [[ + 107157, + 25965 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5202', + 'properties': { + 'name': '六盘水市', + 'cp': [ + 104.7546, + 26.0925 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@ôyVL@nXJV„Ub„x‚bUŽlšU„@ŽšnŽVbV@naVw„a‚VUXVx„x„bnaWmXaƒ_@y°aVUkaVI„aVamkXa@WVU@aUUlUXwVV@UVšbVUnKUwVa°a„bVIlan@manw@VšklJXI@m„LVVVUVK@U„ǃk@KUa@UkaVU@UVWV_XWVXVWlLXKlLXaÆKšwVL@akKm@Uwƒ@@XUVk@VUI@wWK@aUV™I@UkK@ƒmL™Wƒ@kImJƒUÅVmkXUW@UJkx@nmx@xkxV²m@kmUV±Ikb™™@aUWl_kK@am@Ua@wƒÑ@mnUWIX™wULm™@DŽU¥›ƒXIlwUwn@laU@Vw¯ÓW@w„aUaƒb@akKƒUmVUUkL@WmXUaUV@lWX@Jk@@UUKULmLUJmzkKmVX°VšUnWKUL™ƒƒL@mU@UnVJ@b@„UV@Xƒ`m_@l@@bmbXJmnnš@°˜wnn@ŽVLX@V‚@nVl@nk@@b‚l@nn°WlXzW`XXVKnUlxVbUb@‚V„Xb@Ž‚VxÈbVlnbmn@ŽkVUL@„ƒŽmLUVVL'], + ['@@@ƒ@UmWUwkU@Um@@VkL@V@„„‚@„V@VkV@nbVa'] + ], + 'encodeOffsets': [ + [[ + 107089, + 27181 + ]], + [[ + 107213, + 27479 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': '5204', + 'properties': { + 'name': '安顺市', + 'cp': [ + 105.9082, + 25.9882 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lL@bUK™xÅLWbkKWLkKUXUWWXU`UX@VUVlb@VVb@L„l°xXx‚bšbXUVb‚VnU„xšKlL°šnUlVn@UmVU@kUUVašblVXKV@ƄXþlXUxnU@mVK@_@ml@UU„@šblU@KnLVyUw„@@UmkšWVw@UVK@VXzVK@n„VVUUW@kVJnlaš@nKW™kaWL@U—™õb@JU@mU@@_WWƒL@lUU@WUUK„@lakÅUUlWVa_@`WIU¯mW@InKVVXa@Ll@VaV@@UXUWakUVWUIUW‚UkUƒƒmVXW@@amUUm„L˜l@UUa„wn@lašIVlnLVKUUšU@amK@kUKƒVyUU@aUImK@UXa@aV@VakaW@@UnIVWVaUkƒb@mWƒX@Vxm@UaU@W„@VULUxU@mLƒaUŽ™x@VnL@VVbUbmLkK@kƒVk@WV@bUbVakk„yõ¹nWUIVa@J@aVUU@@ImJ@Uk@¯„™V@nƒ°@bmJUUJUnUxƒbm@¯Žmak@™¦ƒVUnŎWlnnmxƒLbmlkL@l@nWVnlÆU„VnIlJ„@šXnK@„lL@VšJVU@bXL@xVJUl@VU@W„@Vxn@'], + 'encodeOffsets': [[ + 108237, + 26792 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5201', + 'properties': { + 'name': '贵阳市', + 'cp': [ + 106.6992, + 26.7682 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nŽlLX„VJ„LVblJ„n°ln„„LlVnKlU@nUUa@WlX@l„n@‚Vb„@la@a„„šlJ°¦„Kšwn@°x„LVkUmmwUmk_la„bšK@UlK@UUm@wƒL™mnwmw@U@¯@KnL@aša‚ġXWW@UKbƒKWX—JƒIWakJ@_kWƒkƒKUU@UVKk@@Ula™mV_X@WKXKƒ@WUUnUK@kU@WJU@@UnK@LVUVJVkUK@UUJm_@UaVaV@UU@Wƒw@aV@Xkmmm@kw@IVa@KVLXU@`lLX@VKm_@yƒI@WœU@UlVl@UanU@Uƒm@U„aWaU@Ukƒ@XJmXVbkV@ŽƒIUVUbWUUKmbk@kwmV@K@mWUXUakb›KUUUJVb@LU@@VkL˜š@VXKlbXšmL™@kbm‚UI@lVXUVƒU@mULWy@UUL@VUx™Xnl@Vƒ@VxUzmK@LkV™aƒ@VVk@@n@`UL@nmV@bmJ@Xœ`WX°WVƒn@xnxnIl`VbnVlwXUlLl‚„_nV@b@bl°„V„nWJkx@nmx@b'], + 'encodeOffsets': [[ + 108945, + 27760 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/hai_nan_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '469003', + 'properties': { + 'name': '儋州市', + 'cp': [ + 109.3291, + 19.5653 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@஼jpnr’``ŽpRVHʘ̤žZt^JÖA˜[†CâlTébQhRPOhMBcRSQiROE[FYdGNOEIH]MgEAMLLIAG_WMCSL@ED]PCLYC[ZIHgjSxJTMbHNEFCMEE_HSDFHSLECRNSFDRICHNADGPI\\RZGIJTIAHLDQOHG`GTNCOIC@eIGDWHIS[kiE[FMbECZS@KKS[FDWsCeRuU_DUQNOE[LKGUBM¨EDQP@HWHGDImXƒCog_~‹I_fGDG|QDUWKBC\\ore|}[KLsISBHVXHCN`lNdQLOnFJSXcUEJMCKSHOUMDIm_‹DI`kNDIGEYFM\\YPEEIPMSGLIKOVAU_EBGQ@CIk`WGGDUM_XcIOLCJphHT_NCISG_R@V]\\OjSGAQSAKF]@q^mGFKSW^cQUC[]T}SGD@^_ˆaRUTO@OHATŸ”'], + 'encodeOffsets': [[ + 111506, + 20018 + ]] + } + }, + { + 'type': 'Feature', + 'id': '469005', + 'properties': { + 'name': '文昌市', + 'cp': [ + 110.8905, + 19.7823 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@€hIJ¤Ī¯LQDaFßL[VQìw€G‚F~Z^Ab[€¹ZYöpFº lN®D´INQQk]U‘[GSU©S_­c‹}aoSiA£cŁ¡©EiQeU­qWoESKSSOmwŸćõWkàmJMAAMMCWHGoM]gA[FGZLZCTURFNBncVOXCdGB@TSbk\\gDOKMNKWQHIvXDJ\\VDTXPERHJMFNj@OwX@LOTGzL^GHN^@RPHPE^KTDhhtBjZL[Pg@MNGLEdHV[HbRb@JHEV_NKLBRTPZhERHJcH^HDRlZJOPGdDJPOpXTETaV[GOZXTARQTRLBLWDa^QAF`ENUPBP…\\Eji`yºEvåà'], + 'encodeOffsets': [[ + 113115, + 20665 + ]] + } + }, + { + 'type': 'Feature', + 'id': '469033', + 'properties': { + 'name': '乐东黎族自治县', + 'cp': [ + 109.0283, + 18.6301 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ªVLP`@PEdNRAHOPEAKHEVL`GZBJfvdTAXNNTZJFPrHHNpKTD\\ILHbEVd^J‚OHLh@NNBnHP`\\xH@NBRLJTlŽNv_^CTLd@bNDVFbxdFV€UPBTKOGEOUO@OEBXQP[H_EI\\EbeYa@UO_J‹MEJ_IEDKJUGMDcNUd_FMTEJSGoZ]EIYGO[YW‘gEQ]a@WHEDQKUSDUGAbYBUpSCYNiWqOSQEoF[UcQISWWNMSDe_cLQ_UBiKQOOASQAWgS­ā]ZaŽSPÝZ]XMXSŒ[^oVËNgNKlE RôEø'], + 'encodeOffsets': [[ + 111263, + 19164 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4602', + 'properties': { + 'name': '三亚市', + 'cp': [ + 109.3716, + 18.3698 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@®ĂhTBXTRPBRPjLVAR`dKf`TC‚NXMTXRJVdE\\FpTRrPjXZMTDVoZABaVHTCLVCRGF@X^bFR’hZXP\\ZHHMA[^wBWXJlW¤EJ[bCTOF‹WWMm@ILMGWQ@DQ^QNWFSHEbF`OXNbO„VNKTEPDTLTCCVTREfvfEHNbRAENH^RJXCFHNFRpVGHWISDOTMVCZeGamaLoLÛD¹¹ėgsia{OųE—Tt‰lɂwr}jŸR±E{L}j]HąKÃT[P'], + 'encodeOffsets': [[ + 111547, + 18737 + ]] + } + }, + { + 'type': 'Feature', + 'id': '469036', + 'properties': { + 'name': '琼中黎族苗族自治县', + 'cp': [ + 109.8413, + 19.0736 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@bRFnHNbHŒgN@NPEnbXP@bND`NT\\@\\QZb@`@J]V@XhžDpW„nCJGHGXO@CR§FANHVKLF\\MPVR`CvVfQtDPKpGHG@S`WJP~^dSTHWX\\RHTFACQTIAUPOU@MG__IaYSFQK‘NSbORHXCZeTFJg„B`YBMNMFi~IVDV[tGJWXGDQRGF]ˆJrALgESLSAYDGIaFeXQLS\\MKSLSQYJY}eKO[EHiGSaK[Yw[bmdURgEK^_kcSGEOHKIAS]aFSU@Y]IWFUTYlkP_CUOUEkmYbSQK@EMWUuAU\\M@EpK^_ZMDQ^OXwC_ZODBrERURGVVZ\\DTXcFWNIAWJWAYUUFYEWLQQaCIZeDM`cLKRGpanJZQd'], + 'encodeOffsets': [[ + 112153, + 19488 + ]] + } + }, + { + 'type': 'Feature', + 'id': '469007', + 'properties': { + 'name': '东方市', + 'cp': [ + 108.8498, + 19.0414 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ºŸx‹JYZQ”IŠYXLl@dR\\WZEn]bA\\S~F`KXaDeTiNO^EEKWEDQXITBXaWaDQMUJOIaTWf@NJV@dSxGZ‰Fu_@WMKAUˆ}AQ@MwG_[GOAmMMg@GKP]IUcaFKG[JSCoLGMqGEOYIMSWMSBucIeYA_HUKGFBLOFGPQBcMOF_@KO©UAtERadwZQ\\@ÊJÒgòUĪRlR°KĮVŽLJ'], + 'encodeOffsets': [[ + 111208, + 19833 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4601', + 'properties': { + 'name': '海口市', + 'cp': [ + 110.3893, + 19.8516 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ńZƂtĢ¬æßFuz¹j_Fi†[AOVOFME_RBb]XCAKQKRSBQWSPY\\HbUFSWSPoIOcCOHIPkYCQ]GdGGIFQYgSOAQLK`MFUIGa@aQ\\GGUFcHKNMh@\\OYKAigsCgLSF]GOQO]@GM]HyKSHKPW@Pxi@EMINYREXWRQ@MQcFGWIAwXGRH\\yDI`KJIdOCGRNPNtd\\UTMbQYi@]JeYOWaL[EcICMUJqWGDNZEXGJWFEXNbZRELFV]XQbAZFrYVUBCLNFCHmJaMIDDHXHEhQNXZ_TARFHVB@DTQIRR@YHAJVnAbKFUEMLd\\c^ÍÞ'], + 'encodeOffsets': [[ + 112711, + 20572 + ]] + } + }, + { + 'type': 'Feature', + 'id': '469006', + 'properties': { + 'name': '万宁市', + 'cp': [ + 110.3137, + 18.8388 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@^J@ZTVbET^JBGLFPTHld]`FLQhcVanx\\\\ZbLHTGj\\FLP~fIZRZPVTQFSVAFJE^NDLEE[~LjsxVTG\\NZZNGlLRRGLJTV@hPZANN^@T\\NEPPbDZXO`d^HSvcJDIV\\XZAJUFCLNP@PQ¤@[ïKLÑIÏ]ÇE±I{uƒ­YśUćFcYUmsVeBSVgB[RO@aYYPO^]@UVaNeDShMLG\\EfFVE\\F`'], + 'encodeOffsets': [[ + 112657, + 19182 + ]] + } + }, + { + 'type': 'Feature', + 'id': '469027', + 'properties': { + 'name': '澄迈县', + 'cp': [ + 109.9937, + 19.7314 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@T\\GJCXJH@fJDDPNCNJENN^NLHBNSx@DDYbBLLDRbjZTj@`XXTlG^Xr@PJLW\\WLTlWR@HDJTD@X_PO@STMDNTMVV@NLDM`M\\XM\\JNBH[PYZ‡úYzŸ`Ċ\\ÎÝd]c[NKVFLEBaUmBIZGQ@JQSR@CUAEGBQ`SWYRMFgWGCGJCbNnIDGMEDKVAZUEqBYRa^WEUFKYQMaFWXEHIFWMYHCrXVIIiaK@aMCUYNSIISTwXALKH@XWXIEIJQCG[IEQDE_XSBaa[AIPW@]RS[FWS[CD]PEBYNGFSaSyJG]@ugEUDQlGHiBKHUIoNSKqHFaPMICK]UUHIPDJMuCA[SCPIDIOILGAEmU[POPBVSJDREBGS[QXWSGcT}]IO_X@TGHoHOLCX\\ELT@LYTD‚aFENF\\lj'], + 'encodeOffsets': [[ + 112385, + 19987 + ]] + } + }, + { + 'type': 'Feature', + 'id': '469030', + 'properties': { + 'name': '白沙黎族自治县', + 'cp': [ + 109.3703, + 19.211 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@D\\RV]dTXELnHr]^@LETBBRTHPi^[@U`QTHDJ`MGSogDIPKdJ`WVNHCXHl_DJR@AH`FBVPUJLHKNTJOFFZON[ZEHFCJlMJ_ŒCn`CJVNGPLTNDFIdVTWEIPmRKMc_kDMWGGUTAtJLK~\\f{pqD[LAVXRCH{HC`eŒJ`}@W^U@I@_Ya[R[@MSC_aMO@aWFmMOM@‹haGGMEmaQ[@MESHaIQJQ……MckBIw[AOSKKAMPSDSLOAV_@@`KJRbKRDfMdHZERgAWVsDMTUHqOUr@VQXTT@Tƒfg‚L^NH\\@heTCZaESNObHPƒHeZF\\X^ElM^F^'], + 'encodeOffsets': [[ + 111665, + 19890 + ]] + } + }, + { + 'type': 'Feature', + 'id': '469002', + 'properties': { + 'name': '琼海市', + 'cp': [ + 110.4208, + 19.224 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@TP\\pATHTGlZDJGAQjE\\Rb@jVBDCN`JZ[NCNHNXbULPrP\\KNbMTLjJJRFP`“pNLZz^FLRHjVPZ@hxVKbHBHMNNJFRlLzGPnNHhIrHHADcPWdUAmEMVQDSKYHY\\EhBN^HpXGNDBNNBnIß‹Å_g{³So]ã@ORO@KMEDIVYB[WJUICudGTc]P_YWaCOOMFS[]@MMYBgOU@ISHKQQkKMHYY[MSHwUit}KF\\KFMCF]EIUBETSROUKTLT[NKTWREfJbCHBZKTFTKh'], + 'encodeOffsets': [[ + 112763, + 19595 + ]] + } + }, + { + 'type': 'Feature', + 'id': '469031', + 'properties': { + 'name': '昌江黎族自治县', + 'cp': [ + 109.0407, + 19.2137 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@`ZĤd–`òüˆ˜ “BSPGP@VSbQ`‡@]HC~T^SE]N]FkW]E[fY„GGOPaTMbFDYfS@g[MGK]h„e@SSSRW@UVqrPVGNStCXUhBFQGYNcCeLQQaLI@_`@EUwcEaCUaMc@SK]Du`MSkKI‡~BVNL@X`‚EvYŠwHcTU@MIe@SXJbIPNVCRXbWbSAWJCRXFFL]FMPSjCfWb_L}E[TaBm^YF[XcQk@WK‰Z“JYRIZwŒ¹ '], + 'encodeOffsets': [[ + 111208, + 19833 + ]] + } + }, + { + 'type': 'Feature', + 'id': '469028', + 'properties': { + 'name': '临高县', + 'cp': [ + 109.6957, + 19.8063 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@jD`hNd\\^dZädĒH´Op@ˆùZY\\OAGIMN[[W_NCNMKU@NUMSNCTSP@`O@WSCCI@GXQSkXKX[IK@OWqH]SkWW@_SiiYQaKCAKZaCCw@MTGAMKM]FMMIMDSM_HGHRPKCBGSJJIYH[QOJCHMBDGQJECMTDQKFGTCEGTF`NFEDMFaGSNwIiTGhYJD\\KZODC^@FTKND`XBHKJNKFBNhG^FJMPcHEZF\\QPRjQTAdgNOPgQaRSê'], + 'encodeOffsets': [[ + 112122, + 20431 + ]] + } + }, + { + 'type': 'Feature', + 'id': '469034', + 'properties': { + 'name': '陵水黎族自治县', + 'cp': [ + 109.9924, + 18.5415 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@R]NC`YL]FoN@V[vBXVFNL@TRZalnVFVP`DlOZkVSXEE_F[EUFeH[NKTgfCbMVU^@P]ZObZP@\\QhATUfAtUasñiāEoI]eYǯ@aKmaeƒWuCºKÜKpnbHbYfUDSNCPJTRAHJTDJSfDNLHXC``VBNGTYCQDIXMDSP@xLNEFRNXBIpVNLXah@RgF@`qOML@LJNSPLbaHAh@Jdj'], + 'encodeOffsets': [[ + 112409, + 19261 + ]] + } + }, + { + 'type': 'Feature', + 'id': '469026', + 'properties': { + 'name': '屯昌县', + 'cp': [ + 110.0377, + 19.362 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@\\OnVBFKHPJCJOJTDB\\vDINOCGJVVL^JDONEbrGTLpMVJLGjAHGRkVChF@vH^zIbTETMHAZOFC^\\DXT\\EffAP\\PdAV@UIYfS|S@YPICMeM@sC[_A]VQEwyHSMuNcAUlQJMVGMS@mVBZPFO\\CSFQK[LqDMACiUa@[QiFBRIHYCHkGSBS[oSOqB‡IE^QHCRWHIXsHU\\UC}JEjMNAN_ZƒAIhSEYfWDQGaPMTL’ERZTJb``NHV@'], + 'encodeOffsets': [[ + 112513, + 19852 + ]] + } + }, + { + 'type': 'Feature', + 'id': '469025', + 'properties': { + 'name': '定安县', + 'cp': [ + 110.3384, + 19.4698 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@JjDNdJ\\FbKPXfZ^Ij@RZNaVSc[MsMOHQPDJcLIJ_zCG[HQxWJBHXdENRR@XQFWZQQGOFSWUCI[WCJuRGLXNMPLhCl[Ta@SqGgJMGOmyHkKEQMINMAGaGULgwY@UOGiKQ]EYyMK”oO_QEIIKiNSMa[LqOKOaVMWMGMDY\\_IKrL\\ERT[DEPYOUA@nNTUHINkRBVMdNvGTxzRF^U`BD\\@tfNDNOJ@Z{TeTJZ@VU€cB[OBOeeQT@^OXBJb\\AbWTF`RCJFH\\RDJIJFXW@WLGBKxWTSJJMTVZND@bbL'], + 'encodeOffsets': [[ + 112903, + 20139 + ]] + } + }, + { + 'type': 'Feature', + 'id': '469035', + 'properties': { + 'name': '保亭黎族苗族自治县', + 'cp': [ + 109.6284, + 18.6108 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@FJp@fxpQ\\ApN\\GNPNBM`HLMrXLXj\\PEHnI@WUCEM\\GTc\\GZYHTPBHRCPTd€H\\K\\@HXi–BJILJJAVNTOZJNtFPC`YxDPWci@IBgbGKaTOIM@KNKrP@_hE@QbgKWUMJoWAQMFEKM@wTONCJWRCZDHSAM_UD_GWMKeCITSCGIQBGXUHQoMEEGWDQIG]FMQBMaFGueFeSQDUSDSKOCSFMLƒUaPWM_PaEGFETMX]RCRR@HXKN@JNnXXEŒSPaDI\\£FkXWIAX]xB\\GN'], + 'encodeOffsets': [[ + 112031, + 19071 + ]] + } + }, + { + 'type': 'Feature', + 'id': '469001', + 'properties': { + 'name': '五指山市', + 'cp': [ + 109.5282, + 18.8299 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@TCNOLBTLBPx\\AJdl†NR†RIbJTGNF\\@RcIYbmHoLQdKN_fCJYbDRRXKZFVEZVXBXIJBXMdESW[CUYHUVQFQAqsEIMPYMSBUIIJKAIj•GW[@[LGScDOGQOAGSYZ[HSd[HFNVD@XmJFG[OWiWKNqGKN_MAMO[HoM[BoRewo@Y^HpITSFENc`MVCdHNIVCLJFI`NFIŒP`@VZbaf[FFJG`O\\WRFA@PVPFPPH'], + 'encodeOffsets': [[ + 111973, + 19401 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/hei_long_jiang_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '2311', + 'properties': { + 'name': '黑河市', + 'cp': [ + 127.1448, + 49.2957 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VÈÞ@Žkx˜nXŽ°VÈa°V@kôw„b‚š„JVškXlVUx„„@ŽlL@xkVV°ƒ„VbxlVUnVxk@ƒ„ƒKkŽVb„Il„@°kVl„@„™lÆnkll@@V„VXƒŽš@V„²bUlƒVlV„U„VÇn@nkJšŽlkVbœ@›x²V@n°VUnlKU„n`@n°bWLnVUblVUVVbknV`°kkŽl@@V°@nz„J@XšxlWXb°n@bƒĠlbXb™bVbƒJ@Všb„a@„„@lbUbšVmnœ@lšVmnIW‚œ@WbÞ@„n@x°@š„ĢaƐéϚnœ„‚lČ¯ĠŻÈwm@ôçU™mm£Xy°UV™›@wÈ£Ǫ¯kõÝçUњ™Uķ‚ƒĢkVфÆšÞU°nŎ¥ČUĊx°m°¦żVƐœx°ƒÇ£@y„UônރÆ@Èĉ°Kô¦šW„kWU—bÇ»@™ÈĕWÇÈ£ŤU@›n£ÆUUKVamanwŃmÝJ¯k@JƒIkaVaUUÇbkaÆÑkWmÝUۙ™Ý@™ƒwnU±ƒ@kkV¯KUkƒJƒ¼U¦ƒšÅ@ówķaķůV¥Uaó@Åwmƒƒ_kVƒwĉ‚ĉmmn_V»™a@U™ƒVwķóƒ‚U¦LǫéóXÇmōLǓÇķxÝkƒƒĉ™kmakbUĶ°@W¼„@bƒšÈÆ@Ė™L„l@„°J¯„mkl¯L݃±L—amJ@¼ƒ„™VƧUó„™UX˜ċb¯ńVbkÆÝI@llx„k°V²šV@Uxގ˜L@b„@b™`ƒšÇzkókݤ@ğ¯Wƒ™LĉǙLmmnċVkbUaƒL@Ž¯„‚bU°ğL݂Ý@'], + 'encodeOffsets': [[ + 127744, + 50102 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2327', + 'properties': { + 'name': '大兴安岭地区', + 'cp': [ + 124.1016, + 52.2345 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@k›ƒϙmƏêġb™ƒ¯@@wƒmÝ@XV@IlŽl@bUxl¯VlV™bV@ULVlUV™_kx™VVV™ÈÝJ@„¯šU„™lm¯x@xóÒĉ¼m„¯Wƒxţ@Uz¯ƒWwnUwťƒ@knƒWƒ£óVƒUUwğyó¦WI—Vmm™I@±kwÇ@@bƒ@ĉ¼ó@¯wó@¯aó¼›KՃaUwmWUwÅI@aƒKó@Ua™LƒaƒVÅwō¼UUÝl±I—¤VxÇx@zkJmnn‚mbnz™xlŽƒl¯ČkJl™°@„kb„Žmx@x™@kêmVnŽWxôXšxU°„bWLóJnÇWĵ„V¦™ŽƒUUb™b™ÆġK™šk¯™VU±aXmċÑUwĉKġ„k„™ŽVxk„ÇKkbƒIƒ‚ÛXWl¯bƒŽ™X¯K™bĊš„„ÞVƚnŽĸ²lxUŽ°n°òÈb‚¦—xVbƒŽƒ@¯„Vx@¯VķÞČlĊ°KĸŽȘI°¤ČIôŽò»ƨnȰKǬ¦ôWŎÈƨwlƒnKVXmbX`lbšwkVW‚XXŽ„L°a„ƾaĊ£nƒ°@°¥ŎzÞ¥‚»œalwôkƒJ„a@ĶK„£„bU°ĊxźVÈUĠ¥ƨ™VI@XU°x°Ln¥šw°UmwXm݁V¥ĢŽ°@nU@mÆ£š¯lKœšÜw@aÅU‚¥UaÝIkmV²‚nn@Ķ»@Uk¥VKÞ@ÞÛ@ƒkVmĢa@_ƒJómƒǖ¯Æw—óÇa@alƒUwšwĢřšk@wÆWXUWXƒWa™m@_ƒ»ÇéXaĸwVa@ÝKkUWkX‚kšKXxƒn@lĊV@¯m¯nřÆwš¥'], + 'encodeOffsets': [[ + 130084, + 52206 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2301', + 'properties': { + 'name': '哈尔滨市', + 'cp': [ + 127.9688, + 45.368 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@°`„_šJlUšŽ@„„@V¦°JUšŽnLôlnŤ@@šÈaUÒVbkbl¤ƒzk°ÇVÛô°IlVUVôU„xÆU„Ž@bźĀ„º@¦šb@l²‚UVlœ@°ÒĠxšnXxÆVô¼Þ@Üx²KލlƒVÑ°UȰôlwô@²ƒĸ°„lanV@„šVŎUll@bÈnÜm„wĢ@la@ÝÞb°UXb˜lŎ²ÆškšV‚I@ŽnJnĠŽ°knƒÜbĢwna@a˜kÞKƒĀ„a‚™œ‚‚IVbU¥wĠwkô˜xnLƒċVçkaUƒ±IUmnġW„°WôĉšalƒÞÅĵ¯@W¹XÝaƒb¯a±X¯ºLƒaVƒmkLóƒƒbkaƒVUKVkkKV_@aÝykk±L@ƒÅU@yV_™aU¥ówÇx™@UkVƒn@lƒkÅlwšWVwUkĉmkklW@šašbVwnWWƒ—wWL™™@Ušƒ™UƒÇLšÇmƒ„@wƒJĉƒL¥@ƒÝ_@a¯y„UWw¯ƒ¯Uġx¯aÝXVmaU£ó±›¯nwƒa¯óÅVƒXman™„Uƒ›lUXkWa@mkI„›ğaƒm™IklÇU™„kĊƒƒzkKƒš„lU„ōĬlš™„@ŽnX°@llUxŹ²mKĉVWwk@UbUK@bmVmI—ƒVmwaWxXlWȁšmºšÞÆbUxV@ĵńWÆĉLkWUbƒaWzkbĉ`U„±LklōwUVÝ£™UW`Uwk@mk¯VkaõVX@WbL™K@XƧºWzxƒK@lmX@bkVVÆk¼Vbk@Vn'], + 'encodeOffsets': [[ + 128712, + 46604 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2302', + 'properties': { + 'name': '齐齐哈尔市', + 'cp': [ + 124.541, + 47.5818 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Þ@ށĠKV¯a°ƒ@„KVblaČU‚mnnšKĊȚKX„°ŽĠ@Þ£ôllÈy„™š_@a‚ƒ@a—KݍVwU@±™¯Uƒlkw@kÞJlÅUa°ŃČaW—šVôƒƨVšU„ƒ@»nI˜b²Kބ°Klkn°ƒ¯I@ƒƒkšK@ĕÇń™@aƒX»¯@VĵlaÿVamI@aÅÝउýƒĊȗJƒôȁÅkmƑۃ@kxġ@@l™aVk¯»ƒīŹaƒkƒ¥Å¯™JUaWU@@w™aƒ»„KUkÆkUm„UmwÛ±±UUbUŽUXƒwWwÆÝk™lkUanaWwnKl™kal¯ka™ƽa›kÅx™a¯@™amb¯V™lÇwÛĀ™V@x™šmêVƜVV‚aôV„wÈx@šˌx„¦VÞ¯VšlmX@‚ƒL@¯Ua¯LmV@„„°X„ċK™V™ƒ@UƒÈ@‚¥@w—ƒġIU™km¥Źwƒ¦¯lmn@°kxVV@¦óam„n¦l@nx™lĉVóšmx™n™ÒĉĀĊ¼„þ„šǔêÞ°ˌĠÞÒ°ĀɲĀƨźˤȤƨĊ°w@£nymwnkUUV¥ôÑVmkÆmUUVa™mVIkmô„lxkXÞþƒbl„ƒl@kV„ƆƒV„xV@š¼VÒ@šŽUŽšnnނJ'], + 'encodeOffsets': [[ + 127744, + 50102 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2310', + 'properties': { + 'name': '牡丹江市', + 'cp': [ + 129.7815, + 44.7089 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@U`lLUlVL„Ulb„aô„lKnŽU„„b‚K°¹²W°b„aÞb˜knyUlUkamř²L@m°@lšmš²n`ôÅlK„x„ÜKnxV@„l@œƒ›ÅXyW_k@™wm™ŹĕmƒX™»‚ƒÛ™l°ƒôšÈ„»š—ô˜ô_WW@Uœal»šwU@@wšUVƒš@VƒXI@w‚Ģ͑ÞȻ›aU_@mUkly@¯óV»XmWUXUWmnm¥nUUaWLk»Æ²IÇa™wÅaÝ°¯nUa±a™ƒ™@¦õÆğ„@„™@Åb›xU܁nÇłlb¯¦„ôó»mƒ—@±ƒUk@Wwƒa¯xU„V°ƒxXbǎŁUV™™ƒK@¹ƒKUaȯ@ōݙXƒal™ƒlÛkalÇUǫÇńÇakbÝƆ¯nlš¯Ž@¼™VUx@x¯W¼™Æ¯šmĖ„Ĭ¯ČƒVk‚ķÅmxœ°ô²V¤‚bUnÞW°bĢw°V°„XxƒV°z@bÞ`@„‚¦„KĊŽ„I@xƒŽn„™ÈÈK‚„šV™„@VššXK˜xX„mXUx™a™b@‚kXllĊnVlUx™XkxlÆk„m@U„Vlš@ÈwôxV¦šbU`@zÆV@„²KllÞz@b'], + 'encodeOffsets': [[ + 132672, + 46936 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2312', + 'properties': { + 'name': '绥化市', + 'cp': [ + 126.7163, + 46.8018 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ऊþÆÞ@bnJUb‚ĀnblŽĊš„„ÞlĸwǔÈŎKÈnôWǬê‚KV¥„ĸôUxš„@VšbU¼m`nnĊŽĊ„xlUšmkaVÿšLšwš@°»UmbKmݙUšwUmVknKUUl¯ƒKU™ƒUȃ‚™nK@ĠkX±lX„°„L@¯¥@wV_m›ĵ¯Ww™L¯ƒUkōƒÇVU™l›w—V󁱃¯aƒVka°wVk°mÞ¯Ŧřƙl™²™Ŏk™U@ƒmUkb¯ƒķŽ±„ó@kxȯó¯VUÒk„ÝŽ±LÛwÝ@ó»ÅUWw™mğw¯Ñ›@UkV±@k™a@¥ƒ¹Źÿ@aƒÅVƒwóVVUkU¯JÜóÈUl¯„yk£laUaVÑÇb@™ţ@kmómK™V¯IU¥ƒ@@ƒ™kV™Iƒ`@ô™¼„blU„lƒ™bÈb@xÇKkĢɳaÅɆō@ƒŽVƒK@z™@@¥ÆKnÜ@@aۏUw›wnU‚ķ@ƒ_ƒV°Ž@„klVššnULVVÞbVl@°™@nx™n°LŚÆlV„ȃmU²@VmĠLƒx„n¯xkWƒzšJ‚wnLmbXbW°šÆ‚™²™@™Žšx@JVx„L‚Ā²Æ°I¯º‚È@ÒnÈ'], + 'encodeOffsets': [[ + 128352, + 48421 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2307', + 'properties': { + 'name': '伊春市', + 'cp': [ + 129.1992, + 47.9608 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ƒKƒ¯kWW²ğl@ŽmLšÇ„„VVš„Lk°VVmLUlVn™xšVnނLnaVŽ¯¼™@™x™KUĀlb™n„`n„Æxô@VbU¦ĸŰĸbôxÆ@„™V¥„»„IVl°LUŽll@²„mV„x@ššÞܚÞVnŽlXÅÒlbÈaVVUblb„J@I°lÞIn‚Æ„mxnbUbVLÅVm¤@œţVǤXÈÇĖ@šÈ¼˜aXVÜaXbWŽnzŎašř„KôbšUlw@¯naÆKnUU¯Üa@mkkVUĊm„™żÝ‚ǖŽ‚K„™°L²lÆI@ƒ¯¥ĉƛVaÞk@ÝVaĠlnUVwƒœómaƒ@™wĉ@™a™VƒxamX@aƒ@UaÅLƒaVWƒ_nWm£nWm_ÅV¯ƒm@m„󤁚ݦƒ¯ÅalmX£ƒ™VWUŚw™mÇ@@IV™„WUw@ašI@„k@wŎ»Wƒ„ƒ™ÅVaœK›Ika@¥lUkUlwÅwVyÈwWU@a¯U°m—Ç@UçƒaVa¯mV»ÅwÝUlƒUk™V@k„mUk‚X£šw°@@ǃaÝIƒƒam™Ûam„¯lğmmI@J™U™l±ÅōŽ—kWa¯VÝa@Þkbġ@ƒxÛnÇm@akkōVōl±škšÅšťŚÝ°¯nUl¯xlb„U°b²„ô‚˜Uœxšk‚VÈUŎ„Vl°„šKXxĶ°nœU`@x°¦@'], + 'encodeOffsets': [[ + 131637, + 48556 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2308', + 'properties': { + 'name': '佳木斯市', + 'cp': [ + 133.0005, + 47.5763 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nš„b‚„ÞJ„b@ȯ@™xW¤Vlƒn@lšUVlk„ÞVÆxU¼°nUb„bVèÈ@˜ŽnIn‚@šĢmlUw°™żƒ‚VUn@lnL@VôbšwĊ‚lœ„JķĸĢl„wôwƨxVVUƒŦšxšLź™Èš°`nnĠwŎJސĶwôJ„@¤Xn܄ĸlšn°¼È°lŽ„„Uš‚b„xš@„l@ÞÞÈm°„lôwšL°¼ĸ‚°Þ²nĠ@ôwÞ`ŤI„V„ÒĠU„„@„VJĸbƄ²@°ŽĊKšœ„JĶaĢȰ@ô¥°nš¤‚bČUš@Vx„mUw@a݁ţƒÇ™ķƒ@ĕķīU¯²@ÆmVÑô¯X¥ċç@™ĉ»U¥ÝţKWVÅkUVÝŎUmǍÝx¯aķxÛUóL¯a±óōb¯™ƒÑŃVÿƒ_Åķ„a@UƒK@wm@Van@UmmLVa—@VImmXUWƒÝUřƒKUwÝUUƒkVƒk@l¯X›‚Å_ƒJ¯k™Jm„ÅLƒa@¥U@¯Vƒz¯@ƒ`@¼šmxƥšŏKÛk@±laÛ@@Xm@™ƒ@xƽ@WŎnšˣĕÅ@@aÅ@@nÝbǏ¯@ƒ_U›kUWƒkb™wÝU@ç„Wlw@anIƒ¯lyœX°m°VšašÛšm@„mVwÞK°ƒšXlaXmm_ƒ@UƒkwÝK@ƒVI™ƒXmV»ƒI@aƒ¯ğW™bġaU_¯JU¯ġŽƒ„ĉ„k„ō`±nÝÆk„™bóĊ¯Xƒ‚ĢX‚mVn²JV„lbUè„ČmK—wlóğx‚xV¦UaJ›šƒbƑÿÝL—l@bmbġx'], + 'encodeOffsets': [[ + 132615, + 47740 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2303', + 'properties': { + 'name': '鸡西市', + 'cp': [ + 132.7917, + 45.7361 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@‚LšKVVnkšbVšÈb‚²U°VnklVlaÈL@anU°ÜmXV`œnôLƒèšxlŽšLX„˜L²ašVVmÈX@ķ˜lnU„Èl`ȹš@ŤŽ°U@x„KnnV„mlnnUl‚lVnnaŎwlVÞ҄@n¦šLVŽ°lšwVk„Lšaގl„n҄š@xmLÞ¤Wnœ¼‚WÈLVVUxlÈô„„WVaU_VKšKXUÆbn™‚nôK„bÞw°bÆWXamVwœK˜™Uw¯WUk„UlJUwVUa™@@kmyzm›ĉw@kVwškƒW¯ÅKU_Vmƒƒ™xU@aW@@kK@w„a@Kƒ@@kVUƒaky°_Vm™kna¯K@™ƒL™wġk@@IÇóX™ƒwVakmV@mwXUWanƒlĉ@ǙUw™KƒƒóšܛNJۄm°@›w—Å@ƒ±b¯Wƒ¹„WVwŹĕ¯kVmōb¯w@aƒwmV™UUb™V™IkaVwķ™xk¼›b@VXXó`󗙘ƒ¼Çó™¯„kŽÜš„š¼WŽn„źĖnššxl@X`WzœÆ'], + 'encodeOffsets': [[ + 133921, + 46716 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2305', + 'properties': { + 'name': '双鸭山市', + 'cp': [ + 133.5938, + 46.7523 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@™UƒƒUwó™mÑÞÑUÝÝUkmmŃyV¯ī„¥ƒUÿĉ¯mÇkaWbÅX¯aÝxƒaóLmmšÅaWV™LULV`UbƒXóƒkÇVwUUÇKX›»XmÝ£nK@wƒ™mÑkƒÝ™bƒKUl™x¯kU™Km¥ƒ@ÝÑkUōxmbUmkVkmmnkUƒmmƒL@w¯Vţ™@Ǻk_ƒÇmV—k@ĸVx‚VÈ°lLkllšUbōwƒnVW¼nlUx¯XmWUnÝ@™xÝUó¼¯J@LVbkJWnkb™W¯„ÝLUxƒn@‚™n™Ü™b¯U¯n›Wkz„°mJ@bkxƒX@èÞVšxlaX„lVVœ„`°@ȐÞa@mÆ@@bÆ@ˤĖm™Xōƾ@@wš„n@@WÜ@kb@²ÜlŐLƦ™nw™@»„_°@„y°UV@@¦„bÆKnƒšI°l„IÆ`œ°W@k„llUV„ÞVVx„LƚÞVX„WVnnUJ˜@UbnKVnm@Ubn@@x„L@VƒbÆĸ„`UĀƄ„Ò°šŎa²ô°bôKÜVĸw°bÞwȎVnÞōVUÆlXU'], + 'encodeOffsets': [[ + 137577, + 48578 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2306', + 'properties': { + 'name': '大庆市', + 'cp': [ + 124.7717, + 46.4282 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@mÇ@сǰ¹¯J±ÅÿƒKUw‚I@™wšš@š±Å‚™X¯WanamKx™I„ylX°wƒm„wğKUn±@nVDŽUƒÅkƙ¯Kšmmwš@@¯UkÝaUUVK™mU™lk@ƒ¯„U„`ĸ@V‚mœxVxܐ@bÛ@m‚ÅL@¦š@@y„L‚U„Ŏ@ÆɅɴblġÈL@wÇaša„ƒkkVƒaš»@ó¯_ÝJ™wÇaÅXny›U¯¥Å„@w™bÝa™Lmm@@ƒVUŽlbğVmš™¯Xƒm_ƒ`¯_Ux™m™L™a¯b@mƒaó¦Çk™¤V„@bóJknVx™VXx±aƒLUbVxkLVlLWlƒ@nX@VÅbWlÈnƒx„bWšÅbmŽ@xœbml°b™„XbW„XVmnn`ƒLmšnbmb@šk@mwU@@š¯Jlbk°lbkšmLXxmbVbkllšÅނxX„xVWVVa²VܲnxƒVVnÅlVlƒL„¼šb@xV@XŽVbšIÆ°„¦„lźb„Ĭ°¼Ulšb@kĢ@lw„@ƒÜlnȂƄóȘI„ĉ'], + 'encodeOffsets': [[ + 128352, + 48421 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2304', + 'properties': { + 'name': '鹤岗市', + 'cp': [ + 130.4407, + 47.7081 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Þ¥‚™ô£nƒn@°„ÆUn`mXn¤mX„`UX„bÆKVb„@@bnW‚b„wšUšbĊ@šx„@nbšWVmƒ_mm@ó»Um„ŘWXkĠ»²¯‚¯nķšwŎ@ĊšŎK°bĸUnјKȦĠÈbÆknJššÆUĢV°IšŽšVƾƒwaV™ƒƒkÇ¯¯»™mķkۃWm@£ƒóIĵxݏōIğxmm¯_ǙŹš™K™wťŽ„UVUŽƧwóxƒxġkĸķƒIk›ĉ™xóa@UmK@kVmUŻ„¯šVxkŽġn™‚@mmJ¯n°V@bXVÇxUzÆxkxlVkV@¦lbœJ›LUbšÆƒ„X„ō¼@xƒl@™J@bVxƒXUš@JÈ@šn™xVÆUXš‚„W¤knÆb„°'], + 'encodeOffsets': [[ + 132998, + 49478 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2309', + 'properties': { + 'name': '七台河市', + 'cp': [ + 131.2756, + 45.9558 + ], + 'childNum': 2 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@²mŎ_lƒĊƒ„ƒĢV°°IV`ĢbšaĠX„°@b„JU¼Wnš„UJ@„ÞLlxV„„@n`lIUa@K°Iô»ÞVšwÞ@VmnX°WVwmkX»‚U„mŎxVak™lkkKǯUUwÇWUn™U±b—KWƒ™Kk™w„çóK›mU_nW¯ÛmV@bÇKkbkUml¯U±VÇaU™™amlUU™LK›„k@ƒU@mwÛLƒŽƒwkLóÆm_™±™nkŽ¯@@n±KnŚlbkVV‚mz—lWXº@Ķ°'], + 'encodeOffsets': [[ + 133369, + 47228 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/he_bei_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '1308', + 'properties': { + 'name': '承德市', + 'cp': [ + 117.5757, + 41.4075 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lLnlmxn„„IVVlUnb@VVxXJWL@LގVnnV„J˜_@wkmšK„b‚x„wXk˜WXXšKlb²K@nVVVb„L@WlU²„lKVnUJVz@VVb@lżmVUVnbôaVX@°Ub@lWbXš@b@bVb°x„@VxÈLVlšaÆ@Þb²k°@lVUŽ@Xn@VW‚LXb@¤VXšKVVVLnm°_ƨ¤@aUIVa„alkX›°k„™V@„alwUVy„U@k󙰃na°UVUUmUÆw@mkLVUƒWVI„WšLnn@xlVnK„myU@ƒU°UXaV@U¥ƒU@Uƙ@aVUkWU¯ƒaU@WLUV@bkbmKULmKkUVUkmVIUwlWV²™Uml°U@W„LUwVm@UUK@_ƒKUUÜaXw@ƒVKUU@mVIUUlmnIVVVbÈVlKnbVKš@nI˜@nVnwVLVK„K„„˜Vnb@aUIVW@In™°@lVnIš@lWĢ@°UVL@b„@VyUUƒa@w@WUnU@Wǯ™K@UkkJWaÛbmk@mVaÞU@amkWƒ@mXUKkÿƒ£@a„kl@Um°UXwla„al@nmlXnW°znW@aƒwV™@ƒakbĉ¥VmU@ƒIƒVƒUƒJkUmWU™KbmkUaƒKkUVU@KV@@klw—™WaU@kmƒXVènbmlUUƒKƒX¯JkbƒI@JmIUWU@ƒLml@XkJ@U™kƒK@aVKwWa—IWwƒmUƒ@mU@J@UaċU™aUUƒVkI±ƒk@UUƒ@UbVVm@UVKƒLƒlkIWaULUWƒXUJU„ƒ@WbUb@lkXUxm@@JVn@J@b„nƒb@Vkx@bšLU‚Æn„JšaVXnKVVmzX‚°V@_lJXxWXƒK¯bÅamUƒ@lUI›bñJ@LÇKkIÇ`kxWL@„ƒ@@bUVUb¯xWKk„Å„VlULW@ƒŽn¦Ul@I™lmUUUVm@kWƒnkKma¯XUKWmnwVwÝL„mŽ™VUbUVWb@Lnxm„xVŽmbXx›¦@„nb@`™„ƒVƒ@kbƒLU„mVUlkbVXkºmnm@@xk¦šbĢÜlš'], + 'encodeOffsets': [[ + 118868, + 42784 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1307', + 'properties': { + 'name': '张家口市', + 'cp': [ + 115.1477, + 40.8527 + ], + 'childNum': 15 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@k™ġۙal¥@wn@nml¹UWlaVknUVƒ„Kla„@„Ušƒ@_ma@ƒœ¥WwnaU‚wnƒmw@KXaVUVašUnmWUk°™lƒnUVUXWVw™IWVóKUI@WXƒxUU@mma@kUKWLkw@yk@ƒaVkUUċaUU@Wk@Unm@UVmLm±IUƒkJ™kWƒ@a„I@m@U„ƒVƒ„Ula„@VXVƒXmVwnkWKƒKU_k@m¥ƒmX_™JmnU@km@U@KmU™VƒU@U™@Umk@@LƒmW@Û£Wƒka@wk™@aƒI@mmk@mUa@UmUƒIƒwW@aWUƒbU@kbÇ@kwƒ@makVUk™U@aƒm@aU@mxkUƒbƒKUXUƒ±KXVWLUK@wkU@V™@WXUa@WbUxƒJIƒŽ@¦VèVVX@±ê¯KUIƒ`¯UULVx@Vƒ@UKƒIƒVkLmVkKmš@nUJÝbkIUJVXšVVxVbU„VJ„Un™°bV„mlU°„XnK@Ul@lVÈVUXšx@W„@VXšV‚KÞb„n@VnbV„m`ƒUx™kW@UVkL™Km¼@lUnUJVnV„XV@Vm@@LV„klƒIkl@VƒWlŽULWKUL@mJ„@blbUVUlmzUJUxm@UUbċÜk@Ub@VšLVV„¦ôbVŽmšUKUkU@m„„@VlVn¼WbUJ¯@@„°šnIllÈl˜@nXšWlLœk‚J@bkxlxkxlXUlklJƒšXL@bW„n`@nƎXxlL@xl@Xb‚LœKlVlIXblVUbUJW@lX@VL@VVŽšXšJšw„n@WnL°K„bVbl@VI@K„@U@nmVmV@XUWI@aXm@™VUUkWmn@lmUUk@mUmK@UnwVĉ@ƒƒmU_V@XJôVVUšLVUn@šllUnJl_n@šml@XŽlLlw²LVJUL@VmbVblVXmVnlš@Ť¦„nn@܎@bšl„@@XV`„Unb@VlLVb²J‚Xn¥ÆÑ@¥Þ@'], + 'encodeOffsets': [[ + 118868, + 42784 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1306', + 'properties': { + 'name': '保定市', + 'cp': [ + 115.0488, + 39.0948 + ], + 'childNum': 23 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VbXWš@@UlV@xVLXKWU²LV„VW„L„alVnwV@@b„n@bšVVllUnb„@lxÈ@laV@„aXV@b‚X„x„J‚nV@VVb@nnl@n„J@blšl@„ašƒU_VWUwVUškUm™Ukb±mVwœU@VIUW@UWk„@VU@ynL„m@IV@‚bnK„LVaVmnIlaXwV@@WVL°@@xnX„@V`V@VbUVVLVKnwnL@ll@@_V@VVnaÆ@œKVXÆ@nƒ@wƒKmU—™Wm@km@kÜKXU@ÑW±nIUwVƒ„Kla@I°wU±kškmm¯mƒ_ƒJnƒaƒwW@IVaUama@wƒUƒmU@mVw@aXk@mWa@£km@aƒ_kVmUnWW@¯bƒkUmk@ƒVÇm@@kUU™KUU™@UVUamVUaWIkb@xU@@amUkKƒVkam@@kVUkUWmKmUkLUb@xmJƒ™U@UImVÛVmnUwƒJƒU@VƒX@UWm@Ub°¦UšmxklmX@`ULU@@UW@@xkn¯@makV™UmxUb™°ƒlUšƒbUbƒnUJƒUUVƒa™LkbUU›JUU@mUUUƒJkaƒ@™xUIWJƒUnƒJ@V™zƒ@kb@`@bln@l™bƒŽ@X@š@š„@Xl‚bnbVb„@„„VJlInlšbVw@U„K„l@lbnan@Vb‚JôLn‚UzlV@lÈLVbVK@LVx—VWXX`WxXz‚bV`UXV¤nx@„bVlVnVlUL'], + 'encodeOffsets': [[ + 117304, + 40512 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1302', + 'properties': { + 'name': '唐山市', + 'cp': [ + 118.4766, + 39.6826 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„@VVl@²„lJ„UVVšbČVVb‚@@InV„@‚V„nXx˜JXb‚xUL@b„Lšl@VlI@Wnk„KV@VXnJ@I„Jla°I„W„LVVnkmaUç„WVkôaܯ„@nV°wnJlaV@VUnUUaW¯wXWWwna@£UaWKU¯ƒ¯@aVUkKUamUUƒn»‚an™„IVwUWlkš@„LlWVakU@K„_lƒšbÞU°@šy°n„@„KÈkWW™ţ¥ĉōƒkġWUw¯£¯ƒÇwţwƒ@kK@kƒ¥ÝwÅbǤېťV™lW°@ĸ™x@VVVULVLkl@V@Xƒ`Ub@Xm@UWbƒk@ÆVbnLWV@lnXUbl‚@X¯lmU™VkKWLkK@_UK@U@UmmUxmVXLWVULkU@`W@ULUK@XlJXzV@@xml@VU@UX@Kk@WbUK@Xn`ƒXmJnšmškxUVbUVlVVxUbV@nKlL„kVKÞbVKXI°KVšmVUIUKULVxVJVLkV@Vƒ@UbU@WUU@UbUK@b@nƒV@VkLmb@b'], + 'encodeOffsets': [[ + 120398, + 41159 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1309', + 'properties': { + 'name': '沧州市', + 'cp': [ + 116.8286, + 38.2104 + ], + 'childNum': 15 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@ln@UȄŽl@Vn„l°aX@mXnVlU„`@bln@¤Xb@nWl@bUx@nnV‚„„V@xnbVbUb@J‚X„x„b‚mXa@k„UVwlW„k„KôVm@w™kkK@kl»Èƒm™VKXkla°@XVV@VI@ml@@Vn@VX@V@J„@VxUzVVšš²blVk¦@šĠ@@»š@VK@VÈLlK@XnJ@alIUl„a„VVbš@„n@a„U@WUIV@mUn@mKXml@lL@LnWšb@XV@@a„VVb„V„@VV„IVWÈb˜IÈ»ƒǟlWšaVUÅUƒƒ™Um@kVU™WVkaUwmaóUƒJUU¯ÑU¥mk™¯UaƒKÅnÇyóXmWÛX¯aċbÛa›J—W™ÝU¯»ƒaóóUm@IƒšVVl@bƒLUJWLX@@xšXUxl¤V@V„nVUV„XVbVš@Ž„@@VVn„°VŽ@ţU¯VƒUmƒUWV@mUXƒaƒbUKUwUaÇKn„ƒVk¦Wb@VnLmV@bkV@n„xW`Å_UVƒV@bƒUklVX@VmlUƒx@VVL@x—VWVL@VW@UUm@'], + 'encodeOffsets': [[ + 118485, + 39280 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1301', + 'properties': { + 'name': '石家庄市', + 'cp': [ + 114.4995, + 38.1006 + ], + 'childNum': 19 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@la„@šy@U„I‚m„VXIVJšw„@lb„IVVnV‚@VVœIVVlašK„bVU„VVI„mVa„aV™„kš¯VanwšVlUnb°@lm@wX@@VV@VK@_nWlknwV™¯¥Van@VX‚@„W@U„V„IVxnmÜUnUVJV@„šnI@wValKnV@k‚mU£na@mVk°K„LVa@UU@UƒmknWWkXU@aWW@@km@UaU@@klK@UkaWaUnamm@U„a¯wWU@UkƒL@ŽUn@x™V™lUXVJUb™LmU@aUWUkmKkLUUm@mW—XƒaƒmmkkWUm@@U¯JUUm™kU¯@mKĉxÝwÝ¥LƒUóŽmwkUUUWVkKm™kKmLX„lxVLVxXJ@nVJnz@VWL@`nX@šƒxƒ@kVUUmJmIXx„JV„ƒnUVƒ@UVV„@LUšƒ`UXVVƒ„ƒlXL@l@b@VmX@b™xn°™UƒbkKWLXlW@@bƒK„mKULmakLUlmb@šXb@xmXU`V„b@`lLx@nWVXL@‚°WlXnlb„KVK„XVb@˜X@l_lJ@V@XnŽ„I'], + 'encodeOffsets': [[ + 116562, + 39691 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1305', + 'properties': { + 'name': '邢台市', + 'cp': [ + 114.8071, + 37.2821 + ], + 'childNum': 18 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nKlLnšlLXUVVlVnxô„V‚KÞ¦ÞxĊwnL°@lVnšVV°I@Vn@V‚lXnl„n„b˜WnXn@VVlKnLVlVX@bnVšKVaUIVWškšU@wVm@¯@U¥VmU_°lšK„k‚w@LX‚Va„U@wšUƒUUKlUóW@UVUœUlƒ°K„wlKU_na„KVnlKkkšWWa@IœJVa@IlJnU@„KVUUmVlaXUl@lm@kXWÝÑnkƒ™±™k@wğ›@@U@mKĉLmVJ@zmlnŽWLUÝJU_ƒ@@šmJkXUVlbklÝ@Ýa™b¯@¯±JÅwġaUU@ƒkU™@mVI±bUKƒL™WUXƒJkaƒLóKULWbUVkKmnk@@bmLUŽƒl@b@mnmJkUULƒaƒbnŽmn@lVV@¦n@„l@b‚znx@`Vz@b„xnV@xl„lbnKVx'], + 'encodeOffsets': [[ + 116764, + 38346 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1304', + 'properties': { + 'name': '邯郸市', + 'cp': [ + 114.4775, + 36.535 + ], + 'childNum': 18 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„bVKlVnInm‚@@a„kVnK@al@nmlLVUXaVKôL„Klb„IVWšX„KVL²a‚JnUš@lV@„VVĢbÆx²I°Ž°@šaÞbÞ@lkkaVUlWnI@™„@V`ÞI‚VXKmnk@y‚InUĊKƒÇkUUamUUkƒƒ@aU@U™ƒk@WUwVkVJVkkw°a@„mK@UX@VV„LVW@wšwVa@¯Xm@@lUIWaU@UWkXWmU@UwmUkKmn@lkVƒ²™VƒaULUVmJUUUwƒLma@™UmkIUm›L—mVšmx@b™LUamKÅL@VmbkU¯KÝamzkJUb±Vkb™L@lU@WIkJƒzkKmKƒnUalWkkKW@@nkbk@WW¯XUVUJ@XlJ@Xƒ@XlWLkUƒ`VUnaWa„UV@UVIƒaUxUUmVƒK@I@W@DŽU@@U@bƒ‚@nmKXmx™@UxkVWUX„@`VLlL@`™zX‚Ýb@b‚„@VUVkIUJVz°KVlnLlKnL„xlLVVUVlXUJ@nn‚„I@mVUlbn@@Žm„@bV„nV'], + 'encodeOffsets': [[ + 116528, + 37885 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1303', + 'properties': { + 'name': '秦皇岛市', + 'cp': [ + 119.2126, + 40.0232 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lnV@Xb˜škx@lU@@LUVlV„LVbnl‚ašLXVVn‚l„I„V„U„JV@UnĊ¦la„bš@nJ°UmƒV@„wn@VU„JVI°bnWlXnWVLVK²b‚akk„lI@aUaVƒUwVUUalaVwnUVak¥šX@W‚kœLVÓm„mUK@_lWš@n_UK@alÅ@ğÅƑŃݍmƒ@їţÇlƒLƒ@¯m™z¯@ÝV™ak„ƒ`@LlVUbkXƒK™@klVXUxƒJmšbm¼V„nVVblLUV@b„°V°XLVb@¤mbXxWX°xXŽVbmVUVU@kbmI¯xmUƒ@Û°óbUl'], + 'encodeOffsets': [[ + 121411, + 41254 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1311', + 'properties': { + 'name': '衡水市', + 'cp': [ + 115.8838, + 37.7161 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„KVlV@X°xƒb@VnnmbVŽXblb@VkL@lV@Vbn@@l‚@XX@bWVXlmXnlV„V@@VUbƒK¯LUl@nmbV¤n@l‚LXnlVUV@ln@lb„UlLnV@bV@@wlaXJVbnUVbVUš@VVšLVVn@VVX@@U‚KXU˜U@wUK@U„wVnk@UUWlk„V@a„UVUÆ`X_ƒw@mlU@anUmK@UXal¥„UmƒÈLVbVxVL„a„bVW@nXU‚Vn„„V°UŤV@Uƒ¯Um@Uƒ@@U™UaƒWVUmUUƒU@k£Vw™W@wW@XKƒIUa@wU@@al@UK@_mKXKƒbUU@aVKmš@Xmƒƒ±@kbÇakLğVaUw@a@ƒmkUJƒk@ykw@£ƒWX@lknk@WVkbUŽVnUVƒL@‚mVkI@JUb›I@JXb™XllkLUmƒLmbV`kLƒx¯Lk„›VUV@VôXkVVL„V™V@xƒVUbW@Kxƒl™L¯kV`UnV¦°@'], + 'encodeOffsets': [[ + 118024, + 38549 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1310', + 'properties': { + 'name': '廊坊市', + 'cp': [ + 116.521, + 39.0509 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@la„Ušš@šUnL@VWbklWxnIVV„V@X„JlbUlšXVbn@@K„mV@@X°WVInJmn²@lmVbnL@amKV_kwlmX@@LVamaXaƒaVU@UnJVanLlUkaW@UaVakK@IlKUU@an@ln@alKUƒkIVa@a@klaUKUV@UkUV¯šKVƒV@kUmƒU@@a¯ImJUU@VV@UL@Uƒ@@WXUWa@Ukwm™@ƒX@@w@al@@aVIUmVUUUVWUknK@I@™l¥kU±a™™UUVyUwƒ@@I@UUWm@@Uk@@nUJU@WU¯@kbWlULnšÇ„k¼@llLšl@xUnóŽƒLƒlkXUxƒV@lWb„I„`°nnn™llŽV²¯x@JkbƒLU„VxmJX²@ÒWVÛL@lln@‚Xn˜šnV„L'], + ['@@@kX@Valaa@KWI@UXW@WanaUIW@UaUKķŽk_W@UVUKUš@bƒ@UamxVXnJUbWVXLVbn@W°kb@U@Wó¼mIU¼k`V„@bVbl@„lX@lUôVlUœIV`lX„Vn@lUlVn@„l@UVaƒIUWl£Um™VWU@@UUKlUUUnƒVL@KšUnLVWUa›@™U'] + ], + 'encodeOffsets': [ + [[ + 119037, + 40467 + ]], + [[ + 119970, + 40776 + ]] + ] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/he_nan_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '4113', + 'properties': { + 'name': '南阳市', + 'cp': [ + 112.4011, + 33.0359 + ], + 'childNum': 12 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lKl@nVV@„bn„@VVnm‚nL‚LXx@š„‚VLlKVU„IXWÜ@șlbl@XUĊUlwnW„LÞw‚m@ÞUVmnVl@nX‚JXLm@VnnJla„I@VkxVb„@VŽln„J@knKVn„@°aVanal@XK°b„‚@š¯VJXIš„VK@al@nV„k‚@nK„a‚b„@XL@blVVKVLXK„@VaVI°mVaX@V_@a@yUkVw„VšIVašJ°™@anIlaV@nKnXÆm@wUUV±UUWUKnaWwXUWmŁ¯Vƒam@kakImƒUKƒ»lan@VXXa˜W@@UlUUa@a@UlwUƒV@Xal@@anIVaUK@V™XmwVmUmV„LXl‚@nalLnal@„šnKlkV@@UnJ‚UXnl@nVl¦V@@VnJ@nUVVVVIn@Va„JƗn@@K@m„kƒa@kmWVaUI@a@™k@@aUL@mmaVIUKUVƒ@@IU@mƒUmmL@K@UUUU@mW@@nU@ğ»mVmbk@klW@UXnV@LƒJm„™lUnUJ™UUUWƒƒ@UnkKƒxmLa@ƒ@@lUU™bmUVWk@@nkUmam@UakJU_ƒVm@ÅlÇLUVmVUwULƒKU@ƒk@UƒVUlU@@Uƒ@UaUUWaŎƒzJƒaWLkl™b@bmL@„kKƒabWŽUVƒ_@mV@b¯JmXUbUK™¤ÇLUU@b@JkLWmkUWIkJ@VmX@JUbVXU`¯VV¯blK@LXKl„UV@Um@@Uk@kxWŽkbƒL@KkbmL@‚UXmaU@@l@x@blX@xUJ@bULUlULÇ@@VšnU`W@@nÛ¼U@@VmKUkm@VVX@@xǚ@bUbVb@VX@@x‚LUb@lƒ¼XLlbUlVVU„Ub@n'], + 'encodeOffsets': [[ + 113671, + 34364 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4115', + 'properties': { + 'name': '信阳市', + 'cp': [ + 114.8291, + 32.0197 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VllInJlknJVkVU@mXlUÞ`VnV™VU@U@y„@nXlKV„nJVkXKWaXI‚b@yVk„VUkVwn@‚K@nW@k„KlUXVVUlbnUV`n@V_V@llX@@V„b@bV@@nlVUb¯‚WLnbmb@ŽnLnK˜b„U„bVWnLlaX@VVUX@Vln@`kL@ll@VXVJÈIVl@XÞJ°Una„LlylU@UXKlnn@lanLWWnbVI@KXKVL@LVWVL@UVKUIVWX@@XÆJ@In`@lJVI@a„WšÛnK@UlK@UU@VK„nlm„nXal„UllLUbVVšknJ@nV@Vm@a„l@@xnV„„lJVUU@™w@aƒk„@XW@_mWnUlŁUmVKV@VXwW»XƒWaUwnkWUkVUƒU@@@WlaUkkaƒIWVkm¯xmIUmƒLUVƒaUIó»m@mmwXk@a›mk¯¯l™@wƒmkLmmU@UbkUWJ@XUbƒJ@b@l@znÆmK@Xk@Ub@lm@ƒI@akmVKUUVUkU@U±JUbkƒ@IWmkxƒa@UUV™UWVkIUaW@UlLWn@VkJƒI@VkK@L@bmKƒkJmUUaUKWXk¼VxnJ@„V@@VULV¼ƒ@@UkaUlWL@U@W@IkKmL@KULUWULWKUXUJmIƒb—KƒŽƒ²UW™nWKUUkLUƒmUUam@UU™@ƒmUL@xkV@„VV@bmV@Vk@mwkUƒVUx@mbX‚ÇnVb„‚UL¯šWŽnUVLVb@xnlWnU@UVUVVUbVVlVkn@llVUXUWUXVbUJ@bmLUJnb@nVK@bl@@š@bVJUbnX@l„b'], + 'encodeOffsets': [[ + 116551, + 33385 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4103', + 'properties': { + 'name': '洛阳市', + 'cp': [ + 112.0605, + 34.3158 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VVUllLXl@LWn@J„@bƒKUVmnL@`VblLnbV@„b@JmL@LnV@VV@¯„VJVnXL˜@nm@aÞ@‚a„k@m„IšmVbXL‚ynLšk°@°aVJnUV@UVVXk@WJ@VXLlUnJVnnƒ°U@»°U„wl@šb„WmUXƒÆ@VLXU@m@U„a@I›mkb™a@naWW@_@WXUV@@U‚ƒ²@„K@I±U@¥kKWLóLlƒa@£Um@kWKXU@mlLXUVKUU±J¯_@`UL¯Wmk@Wa„kkƒlUnƒVUVaU@KUU@mmK@_ƒa@KX@VaUIm±™k„aVKVUkw™@kaƒƒW@kbkL±UUaƒK@UUKVak£ƒ@UmmL@lƒIkmUƒ@Ualw@UƒJkbmIUmn@WKImWk@mUUnÝV@ŽnÝxƒKmXkxĉVWVk@kaċšÛ@WXƒJUV@zŽm„VWnbUbVbšLlUnŽ‚lUÒnWV—VWnk@@Vm@kxm@Un™l@Ll@@V@šXnƒškJV„šV@nlVXx˜U@l„n@aš@VLnWĊ¦nxš@lbVKXLl@ރVLƒ„XJl@XXl`lIXVl@Xl‚XUVšK„wV@lanx„zUbVJ@VVX@b'], + 'encodeOffsets': [[ + 114683, + 35551 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4117', + 'properties': { + 'name': '驻马店市', + 'cp': [ + 114.1589, + 32.9041 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@n@„b°UƂXnVlnLÜ@VLœm@n˜@na@J„„m@k„@lVšVxXX@„V`lLV„XVV@VVÞLVV°„²@lašbnxV@@b„Lšmlm„_VWnIWUna@lšLšbnV°ƒVL@KšV„LVUVaVLXK@mÆXna@wVm„a‚@Xw@KlL@a„@Va@wUkaWnIVƒla@Kn@Vn@VUl@nKVn„J@LnK@aVkVUUWƒ@VakUVanI‚²X‚W@UUU°KnUVLl@XaVK@ašU@KUI@W@_lm@KkLUKV_Uƒ@»@UVJ@XV@@mVL@K@U@Kk@VwUUm@kmWL@VkVkzƒKmb¯VÝI@WUkÇJUIUWk@@klK@_km@UVWUUW@kbmKUXƒaƒV—amLmK@namaXK°VakU@mU@@aƒa@UW@kkU@U`m@U_mVkaUVWUkVƒL@lmX@ŽLm@UxVlƒUUl@zaWJXbWLUlmIUƒkLmWƒ@@z@VUVUšUmÝ_kVWŽ@nUVUlmIklmIkJUkƒl@n@Lm@؃IUbm@UJUUVU@mmI@UU@k¥mUk@WmVmI@VU@klmLƒ™k@mbkKmb@WkƒKUŽVnUnnxšW@UVLUbmJ@bk@WbU@V„kx@V@bVbkV@V‚@‚—XWbUWm@kb„¼VLn„lJlb'], + 'encodeOffsets': [[ + 115920, + 33863 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4116', + 'properties': { + 'name': '周口市', + 'cp': [ + 114.873, + 33.6951 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lšnb@xlJ@UnLlKXUlJl_„KnV@xVL@bkbVVUè@šWb@„Ubmš„ŽkšVšmbX„VJnUl@„a°@@b„LVbƒlXx˜InmnLVw‚anJÆw²IlmnXVl°VVbÈaVb„@lkn@VWnLlUVmÞUUklƒkƒVkUaVaVaUw™K@kkaVWmw„_„‚l@nU„VVb@b„aV@VV@zXJl@@kl@šlœk°WVnÆbnbUšVJ„Iš@VKVm@k™K@_kK@a@aU@@wW@@k@aUW@IUWVUnLlUlVXKVwmk@W@—VWa„¥@k@lnƒUIÇKUaU@ƒUUVmIUV™Uk¥ƒVma@¯k@Wanwmƒ„@@n@@m@UIVƒkUVamUXWƒaV™U_™@ƒmUVUImW@aUIĉK@VmI™b@lU@@n™JƒkU™@KƒIUmmLk@UVm@UŽm@@LkbU„mJXlbV‚@xUbƒ@@bkK@LWx@ƒbUn@xmbÅW@nWLUKUbUVƒK™U@LUK¯„mU@šVV@xULUŽVL@bU`WšUz¯aUamKUaƒ@@xkX@x'], + 'encodeOffsets': [[ + 116832, + 34527 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4114', + 'properties': { + 'name': '商丘市', + 'cp': [ + 115.741, + 34.2828 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@XVl@lLȃ„@VkV@V»UanƒWX@VaÆÇô@ÈaVX@xVJXUÞU‚aVLĸbXKl„V@šm°Vn_ny˜XX»mUk¥lK@a„_@yšInaVKVa°_@WXI@ƒ@K‚VnIlbnaV@„l„@‚a@_w@ƒlwUKm™Xa@UV@š»Vƒšw@kUKVUUm@w±VUXUKUwmJUUƒ@km@@±mXkmUI™@mm™KUwkbWakLWaUIkJmŽƒX@l@@VUX@JWbX@VbULWbƒlUVULknlV@bVJk„mb¯KknWmk@@nmVkx™@ƒVmU¯KUnUL™@ƒJUIV™maÅaUm¯X›l™kk@@lk@WI@yUUU@ƒb@aUaƒUmVk@ƒƒ`nxUXlb@lšLVxUbUbVbUll„k„VlÝVUnkVmKUXm@klƒ@ƒnUx@xnxƒn@`VX@V²x@V@b@„Wl@zU`VUVVb„L@Vƒb™W@bkXllkLWV@V„@VVÈwlVœ@@X˜K²Llb„WnnÆL@VnJWn'], + 'encodeOffsets': [[ + 118024, + 35680 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4112', + 'properties': { + 'name': '三门峡市', + 'cp': [ + 110.8301, + 34.3158 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@WKUmUI°ƒU@@UmU@KnK@IƒaU@makKUa@_‚KnmVU„L@a‚ƒ@IXm@KWkkKVkUU@aUW@UUIVaƒymwkbU@ƒx™LVUWWkk@WUkJk_WWk@WI„ƒUK݄k@WKULka™@mwĉ¥mXUK™@@bƒm@k—VWwkU@m™UUƒlI„™Wm@™@Uk@@KškVmn@lwn@@Ul@Xm˜UXUmVсkmkV™KUaVamaUXnƒ‚@ykLUKƒ@™WwKmKnUm@UmƒƒaU@mUk@kL@lƒxċxUnkVmnXxWb@`kzWJ@V—LmVUn™lmUL@lW@Ub@VšXUbš`VLUbUJ@nmnUlUUm@@bUJlnU„š‚U@lxkbƒ@@XƒJUnƒ@kb¯VVVmlXXlJlzn@VlkVW@bkK™bmškŽUbVb„lƒXVxšKÈnšwÞlĊKlšVnKlwX@lL@xlUnVn„@šl@lmX@ƄÈb°¼ÈwVJlx„_°xšašlšUÈxlUnbVxnL@lllšbm„n@nb‚@@V„L@V„@@„VLšJnIVVlKnV„_'], + 'encodeOffsets': [[ + 114661, + 35911 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4107', + 'properties': { + 'name': '新乡市', + 'cp': [ + 114.2029, + 35.3595 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@XVlL„K°bUblbUbšl@nX@W„XVVKVkš@@Žmb@„Ubn„W`kL„LƒV@VVLnKlVXIlVš@@a„@l£nWlƒkVa„@°bnUlLVlna‚bnUVUXKlU@ƒ@lk@a„I°y„@ôkUU@wšmôšnkWakml™UkVmkUlmUUm@nkUKWanamU„LXW@U‚VnUln„`l„œblL°KXV@ĠJ@L°„šJšUVw„anK@UUImmƒkK@¯±Um@IVmUmmÅnWaUK¯aUk„w@W±kVƒx™U™VƒwƒnÅJUIWaÝJóI—bm`ÝbÅImJUI¯¥¯@mU¯UƒJmnUVóUkl±V@zXl„bWVXL@bm„mº@@XmJUXU°llk„@nWJk@U„@¦U`m¯ŽWx'], + 'encodeOffsets': [[ + 116100, + 36349 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4104', + 'properties': { + 'name': '平顶山市', + 'cp': [ + 112.9724, + 33.739 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@l¤UbVL@V„LVb²VlKlaX@„„lbš@lxUVULƒbšln²VJUbW@@L„b@`nL@nVV@LVŽUbUVm„kVl„ƒlXbl@Xn°ŽVK@_°`²IVVV@VUVJnInaWK@Uš@„K„LÆ@nmlXXWVUUw@klKVa@knyVkVanI‚JXUl@XbVUl@@aša@mXk‚bnK@UlK@UUUVaXaWmkUm¥n—WmXaWaœkl@VmÞb„KVL@aVI@mUwVm„@KōméUL™KVaUk@kUK@U˜WXI@VlKXU‚@VVnInVV@VLlK@UUƒkKU_@ƒWWUwU™@klƒn@ƒƒ@Imb—@@m›nUKÛ@mKUkWVXxmbVLXŽVVU²VV@xÅnmWmLU@kbmJ@b¯š™IUb™JƒUUxVl@z@bU`W@Ub¯nUJUbƒ@WLUKULkU@aWKƒ@aƒbmL@ƒlmUk@@bUL™ƒWJUI™°@ƒŽ¯aWLk@mbUb¯b'], + 'encodeOffsets': [[ + 114942, + 34527 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4101', + 'properties': { + 'name': '郑州市', + 'cp': [ + 113.4668, + 34.6234 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@nWVUKÅ@W„nVnI‚ŽV@œkƂšwV@šnn@lxÞlnôJ˜zXJl@nalUČVlƒl@²UlkôVVUnm„I°VnV°@°¦VJnIÆJÞan_VmU@ama™@kU˜¥kaUklw@UIV¥kVUI@ƒmmUÅmUlƒwVU@amU—JWbUakVƒ—Vé¯Im`ƒk—@ƒwVWmLkU¯ŽƒXkWmLmx@UUƒbm@@x™J@LbW@UUVWUkVKƒ@ka™IUamKUkkmmLƒUkJUVWXkWmnÅ@ƒKƒL™@@VXLmbmJUIUVU@ULWVkK@nWVXL@lVn@¤„b‚kôKXKlL@¦²V@JƒL±@„@VU@WV@X@`XXmb@Žšblaœn@Jƒb@V'], + 'encodeOffsets': [[ + 115617, + 35584 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4105', + 'properties': { + 'name': '安阳市', + 'cp': [ + 114.5325, + 36.0022 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@°kVaV¥kVmUkWkWVkVKUwkkmKUU@a„wWWXWakKWkXmlašIVmX¥ƒU@a„@WnK@kƒƒ™V™I¯ƒ@KğI@WU¯LkK›akƒƒ_kmmVU@VWXƒKnVmbXbVLmln@VVknlVUnVlkšlnXbmlmlXblnÈlWbn@@nšK@V„L„bVV°VVzšlnš@V™xƒI™b™ŽU@WLUa¯V™UkWõ@¯kkmxk¼l‚„XUlVbVLnlULmU@lƒLkVUlƒX@xW@¯mUƒ@UmIUW™L@aXa˜kU™¯anƒWk°@k™kKmmUIWaambUkkKmV¯aƒ@UblŽk„mXk¤ƒ@@b™@UbULWVnb@lUVVnmšnVVU„J@bWXX@WJkL@blVU°UV@XlWnXUbW@UVkVšVWbnLUJWLUK@Lnn@blVU‚„nUblxVUVJXU„a˜@Ub„LnUVV@mVIVVn@UbV@‚XbmbUV„_lVXUWanJVI@WkI@WVIVU°WXXl@la@mX@lLXl‚kVbœm‚X„ylIXJV@@kšKla²UVa„IVyÞb°LlVna@UÆKnLVbšK@anwU™'], + 'encodeOffsets': [[ + 117676, + 36917 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4102', + 'properties': { + 'name': '开封市', + 'cp': [ + 114.5764, + 34.6124 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lUVbXa˜InV@bUV„x‚knVVÆnn@„VJlUU¦VJ@kxVllb—¦lVš@nb@bVŽUn˜aôJÞIXbVJÆI„m„xšUšV„w‚U²l@XƒxVl°bVLXb‚`XklUnmVblLœ@lmšx°LVK@UXIVašWlL@Ukƒ°KkVaVUXmmI@UÅKmmƒXka±K—L@W›@kUÇxUUƒ@@UXUlKkklW@ašX„a@UƒKUaVUUV_@yXk@ƒ@a@U±w@UUW@_„mmw@wVw„mUaÇbUa¯UUkmWkn±JÅxmIbUxmKmn—JWw„kUaƒK@a¯@ƒbk@mVUIWƒ—Lmwm@Ua@WJUb@LUl™@UUmLUbWJ@VL@VmXWWzUJUꄘ'], + 'encodeOffsets': [[ + 116641, + 35280 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4108', + 'properties': { + 'name': '焦作市', + 'cp': [ + 112.8406, + 35.1508 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@V@VL@x@bXŽWV@XkššlUŽWX@J„@nI@KlL„KšUVaV@œJlL@KUk@KÞL‚l²_‚@nWlL„UVVš@nLWVUJVn@anV@a„wÞUVLVx„b„@lW„@lbXn‚Vn@@¼šL°mšKVn@bnl@nVK@blb„L„W„U@VWLXV@nlKn@lVVbXw°nV_@¥Vƒl@XI@mlƒkkV¯VWnI@W‚@n¹nƒ@aWKXUƒaWk@yk@k„ċUkVmbk@WI—yóImÝkkwm@™mU@™xŁ›lU@mJƒX™ak@ƒx¯V@¼¯Vm„UmmIkVWK@UXIl@UWVUU@mVUI¯b¯@™lmKzWKUa™nƒJ@nƒlbÝ@@b'], + 'encodeOffsets': [[ + 114728, + 35888 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4110', + 'properties': { + 'name': '许昌市', + 'cp': [ + 113.6975, + 34.0466 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lI„VnKlnVlnLVbšJlb„@ULVlUXVVX@‚a@KšI@wn@„aVV‚@nwnKlX„W°lVnKUX„x˜@„ln_°JVIXy‚XnW@U‚K@UXIVanKVVš@Vk@KVaXI‚@Vbn@nx˜KnaU™l™ƒn™Va@ƒXa@™VçUUla@aUK@wmUƒLk`kIWVkLmK@V@XUlƒn@JXV@nm„™bU‚óIƒmUa±@@ÑóVUUk@UlKVU@akWVUUlUUaUK@UUKWbUkÅJ@XWaƒ@XbmJ@nUJ@bUKƒLÝaUnk@›lXbWbXnm˜n¦lVXnWbUbVV@VkL@VmLaWl@n™b@bk@UVWak@WVImJUbUlmz@lUbkL@lVx'], + 'encodeOffsets': [[ + 115797, + 35089 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4109', + 'properties': { + 'name': '濮阳市', + 'cp': [ + 115.1917, + 35.799 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lLXbW‚XXƒx@bVVnLllVxULUl‚XXlVlUnlŽU¦Ub¯l˜nœK@V‚bVb@šXbVL„KVxVVnIlašb„a„¥lU@wnalLnVVlVLXnlWVXn@@lVI@WnU@mƒÅW¥—aW_k@WwXy@kmƒ@wU„mš„š¦šlUxVLV@UwšJ°xš@VX„@Vb„@š`VX@VX@llšIVbnJlI„bšV„l„˜J@ƒmѯLóa@ƒƒKUa„k™ƒ™Xƒ@UK@wU@ƒlWUUݯImW¯aƒLUKU@ƒkƒ»k@mƒwƒa@UnKWI@ƒUU@akVWK—k@a±ƒbóUWKXUmk™KUmLƒbUx„„@lmLXŽƒ@@b„VW¦Un™JkbWnXl'], + 'encodeOffsets': [[ + 117642, + 36501 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4111', + 'properties': { + 'name': '漯河市', + 'cp': [ + 113.8733, + 33.6951 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@Lƒ‚UnVxnIWa„@Xb@WÆIVlXaVL@VVLVbkVVŽUVlX@bUVkLV‚l@VVôU@Ò²@Vb„nôJVšanƒ@mWU@I„mVk@WkI@wmak™@wlW@w„@VbnLVb°bVyX™V_@aUKVVK@wUU@™™a™K@kmbXVmJUXƒ`kn™nƒK@aU@mw™akb±@¯ƒUUÝKUUU@WU@VkLUKU@mUmJUU@WVkL@UWJ—X@VVL@lVlUbšLVKnêƎ'], + 'encodeOffsets': [[ + 116348, + 34431 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4106', + 'properties': { + 'name': '鹤壁市', + 'cp': [ + 114.3787, + 35.744 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ó™™n@xVVólƒ@¯zƒJ@bkl@@„kVWLUVmVXbVJnnlLlš¯@Xlm„°bVš—lWb@bšKVXnJ@VV„°nX@@w„WVklU„K@knVVKmkUKUaVkƒWkl»nwlŽ°lö@lXšV°UVbXKV@šša„Jšw@Um™™kUy¯UUUƒaƒK@U™L@mm@XaÇkkmWank'], + 'encodeOffsets': [[ + 117158, + 36338 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/hu_bei_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '4228', + 'properties': { + 'name': '恩施土家族苗族自治州', + 'cp': [ + 109.5007, + 30.2563 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VK‚bX@lbUVnL°„@VlVnUl@VUX@„aVƒmaXƒlašUUU@wmaVUn@Vƒnmmk@m™U@kna™aU¥Vam™X_@WƒU™mW@_kƒVaVKnL‚lœ@VVal@k¥@kUW@kUKVUlUVсW@kÇaU»ValmkUVUVak™@aƒV¯_@W‚UkmVUlU@aœƒƒalI@akkVWUaWXUWwœWVbÆ@„„l„alIVK@U™m@UU„W@al²a‚¯UağÇm@ƒbkk@wƒ@@W™aULmxƒIU‚™ƒb¯@U`UX™JmL¯aƒKX›WUL@aknmK™@aWUXaWm@I@UÅmVU@™™aUV@b™VƒI@WkU›bXkm@VakwUKULWKXmJ@XUK@ƒmL@KUwVaUI@KU@mmn™mXka@»V@@UUaƒw¯yVk@ƒUUVmmkÛÈU@mWUnmx„šmlUbV¦UlbWVUL@UUƒ™IUmÇKV„VbUVVxkn™LUxV`VX@š„„kJVVUXWaUVVlUnmKUbkI@WULmK@L@LVlƒLnmUIWV@aknƒ`VXUJIVlUVVbUX@¤mbnLm‚m@UXk@mm@Ukaƒ¥@kV@@KkU@aUKWbkLWVkIVŽk@UbVlmX@bU@@mmL@bn`@Ln@llVLVk„@XVVU@`VXUš‚¼k`VULka@VllVIn¤VU@@bl܃bkx@bkL›škKƒn@bn@@b@JUnV`UnVbVKlVXUlbn@°ƒVx„@@b„nVbUllVn@V—VK@UnW@UVUšlnk‚VÈޚxVb„VVI„xVaÆ@@aka@UVaU@@a„k@Wl@nbVIƎ@Jk@„L@VlXnlla@VJnw@UmwXU@aVK°ÒnllnLlb„xnKVaV@l¦²nVl@llL„x@XVVœ‚Ķš@našx@U@al™XUVa‚LÈþV°XxWXkK@šmLnlUb@b‚xnLVlVVkb@UJ@xWXXš'], + 'encodeOffsets': [[ + 112816, + 32052 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4203', + 'properties': { + 'name': '十堰市', + 'cp': [ + 110.5115, + 32.3877 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@@a@w@kV@nbVK@ƒnUla„@la„Ål@nlVakwWX@WkLšaVmšwV@anK@UlIXmWkk@@mmLkWlwk@U_mKXwWK@U¯K@UU@ƒVUa™kmƒkI™yUUVUmanU@mlwkƒ@_mWXaƒUWU@ǃ@U@aUaVwUKUIƒVkK@UWIXƒmaV@k@Vm@UnwlƒUamk@V@„ULUamxUJkU@Iƒ`WkkK¯XWak@@W@IUV™LWJkXkaÇVUKƒ@kUmbmUUƒUKƒbkKWUkI@ƒkKÝ@@aƒUm»nI@mƒU@UnWV_@aUmWbkLUl¯b@a›kkk@WkkJm_k@UV±@J@b›nU@@WÝIUJVbXL@nlJkx@„Wn@VkJmb—LmUƒ`VbUL@xVn„@XVƒŽ@„mVVnnJVbU„ƒx@„V„nVUbVVƒx@šn„™bUK@bƒ„@bƒJ„šm²„VU‚lbXzVJV„„JVbn@@Xmb@V@bVJÈ@‚Vnkn@°aVVV@šX„KnalLVmšUnnVKVlnLWlXX„Klk°š™šXŽWškLUVVV@nU@ml¯nmbk@W`Å@mb—LWm¯UƒxnêVèk@mbƒVƒnUK™@kKmXk@@JUI›lÛLllnbVnlJ@LULnlÆaVLnŽV@nkVJ„@lkô@²bÆm°w„L„WV@VXšKšVXI@W°ÆVšK„b°U„JVIVV„¦XKVL@l‚InaVÝnUl@@bX@‚™nmVL@lVL„lVLVUnbVW@xXn˜bœU°¤V@š™„a@kWKUUn@VlnL@UV@Ü»@mX@V_ƒakaÞ@VK‚¯@kkW'], + ['@@mUkUUm@nllVKXXVK'] + ], + 'encodeOffsets': [ + [[ + 113918, + 33739 + ]], + [[ + 113817, + 32811 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': '4205', + 'properties': { + 'name': '宜昌市', + 'cp': [ + 111.1707, + 30.7617 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@°`„U@blšUbUVlVkn‚ŽUbV¼Èb@l‚XUÒkVUVVL@lVX@ll¦k@UbU‚›@kmKULUbl„@`nXšŽ„V@XW`nšUbV¦šbmb@lšV@nnlmnU„m@UVnb@xVV™VkbW„nb‚VnVa@an@UaVU‚JXnWlXX@l„¦@ŽlKÆX„bX‚V@VV„@°¯°xXx‚XV@nV°UVWU_VWXkmaVnWVkn@lln@lb@UVLXWlnX@˜aXUmaVK@UXU„U@WVI‚W„XXV‚U@¥VKœ@‚Uގ„„‚a²LlV@kV@UanKma@UVUnK@UVLXyVL‚knJ@UV@@UXKWUXaV@Vb@mVLnKW„m@aUUm@@UkK@Ula„LXKWaXI@alKlmUk@wVKXL@m@WWn@UVa@K@wna@aW_XWWkXbVW@k@U¯WWwka@UUaVIVƒkU@m±@U@@wVKkaš_@VV@XUVwU¥‚šyUkm@V±ÈUKk»ÇL„m˜mLk@ó£kmWwƒm@U„IkWKXwWU@ƒkLƒwkbmaƒbkK@VƒLkmWIUKkUUƒÇIǫJ™XÅJULVŽÇLUVƒ@UK™@kI@WVI@UaƒWmXVVUL`±kÅLmKkƒƒkƒÅ@Ua›XXxWVXŽVbUXll@bkJ„b›„@bkVUVlnV@X'], + 'encodeOffsets': [[ + 112906, + 30961 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4206', + 'properties': { + 'name': '襄樊市', + 'cp': [ + 111.9397, + 31.9263 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': [ + '@@@Xl@Xb°WlLXl„_@JlVVInwVbVK@ƒ@UnlVbk„mx@VUnl@U@nbW„XJ@VlL„UVJVLUxVb@b@VȄ‚@XV„VWbnX@`l„kx@nmVnbUVVVšzlJn„šlVb„UV@@V°L@VXLWxnLV`l@kxlXnK@nl@XlWn„`Xnl@@UVa@VÈKš£VLVanW°U@UVU„@„`VIn‚mV@„nV@Xa@aVW@UšalkXKšblI„yƍXnlJXbl@@VV@nklU@`„nVK„LVKVb@V„U@UÈK„UVKšIlUX@V`lIVbn@nblVVmV@@XXJšUVV@knKVn@`@X‚VnK„wlLVmUUU@ƒU@aXL@WlU@UUW@UmU@KkLWaXkWmXUWm@U@ƒnk@UmK@U@UaUVUUKV_@al@namWUI@KUƒK@aV@WUIƒbƒ¥ULUJkIm™ƒK@U@K™V@U@a@UkU@K@wVaUwlU@mUƒULmKUkV@@anIWmUK@I¯„mKkl@LUb±lUakLmk@WwUKÝVUIm`¯n@Uk@makJU_@ƒƒJma¯ImwUVkKƒb™aUÅ@wWaU@VU@mXIVmmUkJkwm@mIlUKWzUK@VmLUV@VnbmLVbU@@lkU±KbƒƒÝV›@UL@¦VWUƒWXUJ@XƒVWV@VULnbWV—bW@kmWXUK@Vkam@kkm@UlmXUŽnbWlUXV`UX¯VmUU@Ul@Lll@nnJ@LƒnWmbmš@b™`ƒš', + '@@kUUm@nllVKXXVKmU' + ], + 'encodeOffsets': [ + [ + 113423, + 32597 + ], + [ + 113794, + 32800 + ] + ] + } + }, + { + 'type': 'Feature', + 'id': '4211', + 'properties': { + 'name': '黄冈市', + 'cp': [ + 115.2686, + 30.6628 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VVUnWVXnVJ@„‚U@V@VXŽV@@IVJUnŽ@V@L@KlIVlVanLVbnVlI„ƒn@@a@Kl@@I„JlI@aXU@KlK„kVblJXU„VlU@V„bVkVKXn@VlxVa²I@VlVUxln@bšJXklaVWnLmÅ@y@k@ašI@W@aXIlVVaV@nnlKnLVW@IUa@a@K„UVVlI@wXKVV@IUƒla„@lUXwWƒnƒnalLlxXLll°@XwVKVaXIl™nb˜@nln@Va@U@k°ƒUmÆUVaXI„JV¯ÇUmmkU@WaKmakVm@U@aVKkkmKkVmIkÇ°£@aUUVaVVnKlkX‚mkƒ@ƒlUVaX@@Um@‚™UmlUXV„UVU@w‚K²¥Ua@I@UV™l@U™V±UIUÇ°»VkUmVI@a@U™m™ĉ™¯V±bŹĖğaÇL¯lmŽkX@‚óĀ@ŽmšÝêb±WkLƒn@xXx@Ž@b@V@LW@UbƒlţXƒ`kxWnXô¯¦ÆV@L@JVLƒxkK@V@bkz°l‚lXz@J„UlVla@XUV„bVKXnW`XXV@laVV@V„X@V¯xƒx@xULVbUJ@n@LU@VmmakbUK@b™IWWUUVkUmkLm@VJkb@nUJƒ@`V@kX™aUaVmmLkUmJ@Uk@U„±lkzmJUb@b„VUxVXU¤ƒL@JƒX@VlL@JkLUVU@mnUl„¦@V'], + 'encodeOffsets': [[ + 117181, + 32063 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4210', + 'properties': { + 'name': '荆州市', + 'cp': [ + 113.291, + 30.0092 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ÈJV„lVVLXJln„K@UlL„anbla„xlK@„XVWxXLlƒJ@V„nXxlnô¤l@nKn—‚ƒÈKl¼VL²Ç‚Un@Vl™zŽV¦UxWVU@@U™`lbUL@xV@²@@nlVU„UJVb@VlbXx°XVWX_VKUwVKVa@UVKUUVk@KnblaUU@wnWl@UX@lÆ@@a„IVmUk„™šxVJ„U„bܙ@Uk@WWnk@Vƒ„™Vm@I@m@Un@m™XUlVlUnJ@knJVU°@@aÆLX@ƒllL@¦nJV@XblLVa²U@UlWš@VX@`@LV@@bXJlIXml_lJœU°b„KÆLnVVl‚@ö—Vƒ‚mXaVIĢllUlVnLVlX@@b‚ašnnxšV„L‚bn@°ÆXmmkĉƒ¯w±™™™Uċ@KÝÅƧŃÝ癙Uw¯ƒm™¯k@W‚kV@¯UIUJW¼kb™Uƒwk@W`@¦Uônb@VƚlÈ@VU@ƒƒ£UWWnUÆUnmJkUÇ£VWUI@aUU@WkI@Uƒa@JW@k£kaWVUKmnkKƒb™kkVWb—VmUUmwU@kk›@UakUUa@V@nlx@lUb±lUbnnWLUyk@UamœUK™@mlk@Wb@VXL@x@xWI@a¯Ž¯V@bVn@LkKmL@`XmKmVU@@bkL@V±bk@Uaƒa™L™KUVƒIƒ„™W™XamVVbUK@b@Lm@UWkxULWVUnm@UlUX'], + 'encodeOffsets': [[ + 113918, + 30764 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4208', + 'properties': { + 'name': '荆门市', + 'cp': [ + 112.6758, + 30.9979 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@n@lxlInVUnWJ@nUVV@Xb@xVƚb„alLVUnx°Jnb„I@„V`lInbl@@V°mn_VJÞUVLXx‚@nllKVb²kVa@KlknL°ƒ@JVLXnmJ@bU@VlnLVKV„@nX@lUšKVaXal@VKn@¥°L@Unw˜bnašV@KV@VUX@lVXI@KW@@IXWV@laVL„„KlaXUVVnkVWV@lwXblIXWVkVmšaU£VaUmVIkU@y@WakKUamU@UUK@kmK@w@@mK@LƒV¯™U@WwkmULƒamVVUU@ƒƒIƒbUKUa™kmƒm@UakLmxU@UÒWlULţÿmwkIUm@a‚kÈblW@UVƒUUk@JW@XkWWUkUKUIlw@aUWknWUUmnIWƒ™aUwVaۚƒaƒVUI™wƒšVlUnƒJ@bÅ@@kVWk@mX@xVVkbma@LUlVVUL@VUbULVxULW`UX@V@lUXWaXlWXX`@bmb@x@LUb@VmŽXX@‚@nWKUL@xVlknkL@bWJXbWLƒKkb@VlL@Vn@VV@bƒnX‚mLUK@nUaU@WbXVWL@VU@@V'], + 'encodeOffsets': [[ + 114548, + 31984 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4212', + 'properties': { + 'name': '咸宁市', + 'cp': [ + 114.2578, + 29.6631 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ÞƂLČ@šV‚š²š°xĊ„nlWnŎ¯m@aƒK@„„°‚n„Jšwn™VIUaÆJšÅ@wšwV™XW@aV_l@²V°lĊwlaXLšwlUkalVVaX@lVXI@a˜UXJ@U°UU¥VIVKVklanLVa@VÈIVV@nk@aVa@mV_@a„K@klKUa@UnKWk@@lU@@UW@@nUWUwmaVIXƒ„lV@mLXblJ@kV@kk@KU@WƒkUWVÅwkLmW@UmL@lUL™KULƒak@maUUÝwUJƒIb›KUUƒ@š™aWK@kUWVkUwVw@™mÝ@™I@wkW@a›ww@LU¥™kƒJ@nVJƒIkVVnkV›UkyUIUl@xWUkaW@@°kz„ŽWxkLUWmzk@@bVVVš„b@‚@XlVœ@Vl@bVbUn™`Wn—@Wb„VVI@`„LVbXLV`mnU@@lƒL@LUŽƒak@ƒLk@WbUJn¦@lVb@xVb@n'], + 'encodeOffsets': [[ + 116303, + 30567 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4213', + 'properties': { + 'name': '随州市', + 'cp': [ + 113.4338, + 31.8768 + ], + 'childNum': 2 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„@nš`lw„k„ƒ„UmUVWX@lk„@VanUĠ¼V@@mX@@nVV‚VXLmJVLnK@b„V@@J„@VUn@VaVUUUVWVLV@@Kk_@almaVkUU@WVƒVUVLXmmk@wUaUKUV@°™@kmaUaÈmW„mUƒVklaX@lVnxl@@UnaUk@ƒVUVwVK„nš@VVn@VbVJUknUmmVmk_Vw„KUUm™Vak¥@UVKVIkW@UmIVWkIVƒkmmLkwmVUƒ@LƒUU@VVXL@JmLUbmK@UUKmkKUUmVUaUnÇlk¯™mJUnmLUaUJUaWL@UkJ™ƒUƒ@ƒaklkU@¯@KWLUmUUWVkbƒLƒŽUKkbU@WX@JX@@LWJkUW@UVU@@L™Umb—amx@V¯K@¦mŽULk@WbUb™LkVW@kVVxUb@x@LlV@V@b@VšU@L@V„LnšlJVIVK„¦„aVJ@XUŽ@b„LV‚@LVJnXmbk@@bU`VLUVV‚b@V@VnL@Vml@„@VXnWVXnWlXblK@LnV@VVX@VkV@XWK@b„VV@VV'], + 'encodeOffsets': [[ + 115830, + 33154 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4209', + 'properties': { + 'name': '孝感市', + 'cp': [ + 113.9502, + 31.1188 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VnXK@L@°lVlk„b„@„VšlI@VXKVbVIVbnKVmnI°šlŽÈkVmVbnUVVlLnVL@VnLVanK@IWKUUV@„V@KV„nUlxnKlnU„lJUXnJ@VlXUJUL@Vl¦UbnšVVƒLUxl`UnnnmVVlnVK„bšmVX@a°Ý°LšaXJV@VUnKVXVK@LnKlLUbVVX@VwVJVn„@@UU¥V@@UUK@ƒmaUVUkkJ@L@K@UmVUI@JU@W@U@UV@ƒUIWmXUVmUUÇ@UVmIlmnmakK@akaW@UwVUkKVnUlKVwk™ƒVU_WKUkVW@UXaWkUa@w@VU@XaW±@IkbƒKƒb¯L@WƒXkWƒ@UakL@UV@UmVUmL@UXWVL@ašUƒVUUUVU@yUUƒIUa@wUKWVU@kƒ™™Wk¯UkwVKƒLUx™K@nVxUlUUWVUmw@wƒUUyXWlX¦WbUV@„U‚@blbUVVbXXƒl@lVL@bk@lxkVVnVx™¦ƒ`UnkL@V@L@Ž‚@@xnL@lVL@VnVVblLXb@‚@zlVUJVnUbV¤™bUnUlWXkJWakxU@UXml'], + 'encodeOffsets': [[ + 116033, + 32091 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4201', + 'properties': { + 'name': '武汉市', + 'cp': [ + 114.3896, + 30.6628 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nbnm‚knJVUÈ@@Uƒ¥VknmV@VUlK@IkK@U„W@I„KV£UWVwƒU@aVanIly²kVƒl@@VnIlVnKUnVbšblWU@@_„‚VI@mlaUIn@lKVnUlVVXXšJ@aVLlanbUnV@@K@mVIUaVK@w„w°w@UƒW@UUUkbU@WWX_WmULƒaVU@WkbkUƒV@IWyk¯kly@a@UlL„wUK@I@KÅUW@ѱUm@wl¥kaƒ@@_Vw@ķƒa@akw@ƒkKW£XVUVwVwUaU@VUU™™xWKkbĉx¯k±Uk@U`@bWXUš™x@x™ÆÅIVbUJmš™xƒImƒ¯@ƒ™Umx™nUVVbnJV„@Lƒ@@ŽkV@bVnƒ@UVULlx°VXlššl„V@XUVL@xVb„JVV@zUVVVUV„™V@bUKWX@VnKUVVnU@@VlKVb„@lX„W@X°K„a„Lla@JX²Wb@ŽUV@@xVbXlWb@VUXVlXLV`Uš„lŽUxkLmVUŽlLUVVxX@lb@blL'], + 'encodeOffsets': [[ + 117000, + 32097 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4202', + 'properties': { + 'name': '黄石市', + 'cp': [ + 115.0159, + 29.9213 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VšUVV@VbUx„aWUœblUVmnKlX@bXJVIlVUxVVVIU‚zlx¯š@‚VbnL@x‚x@UVaXK„b˜@Xk‚WU_Vm²klW„XVK„Žl@nXV@@w„mlK²X‚aÞén™@ôÿ@lWn°kUKmmUљUmm@ƒwkImWU@UakL@bVLUVċ@™bUK@alIXKWK@™nXnKmkUVwƒ@¯b@L„lUL±W™n@KULUaW@kL@lƒL@bU`@nUb@bmlU@UÇJ@UUbmKkblŽUULUJV¦¯V@VWI—V@bWJkUW@UbkUlbkV'], + 'encodeOffsets': [[ + 117282, + 30685 + ]] + } + }, + { + 'type': 'Feature', + 'id': '429021', + 'properties': { + 'name': '神农架林区', + 'cp': [ + 110.4565, + 31.5802 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@n`lIXll@lœl@b°aVklKXaVn@bU`mX@V„V@nmJn¼„V@bÞ@lL@„lJXVlL„aVLV„nVnalV„@VLÈUlblWXIšKVU@J„™š_‚@an™na‚X„m@KmI@mkk@KVkWWw¯w¯°ƒ@UUU@WƒaÅWkL@ƒ¥@kWWXkWmIUVVbm@@bUbmUU„ƒbW@UVk@mVkU@U¯ƒmKVUkaW@aULƒÆVbƒb@VÅ@Un@VƒLWl¯Lš„'], + 'encodeOffsets': [[ + 112624, + 32266 + ]] + } + }, + { + 'type': 'Feature', + 'id': '429006', + 'properties': { + 'name': '天门市', + 'cp': [ + 113.0273, + 30.6409 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@K@UlKVm„_š¥UwUmlUkwl@@aUK@k„kWWUaVUka@aV@ƒVUXaW¥Xk@WWIklm@ÅxmI™VÝUkxkaƒ„@bWJaUL@„W@™l¯UULU‚ƒbƒkV™Ua¯bm¤UnÇUkmUšUx˜b@VkXÇal@bVnlJnxŤĀVKXkVÑV@nwlKVbn@n„šlVbVL„a„J@„VV‚UnU„bVKlnXxV@°š„U@KnL'], + 'encodeOffsets': [[ + 116056, + 31636 + ]] + } + }, + { + 'type': 'Feature', + 'id': '429004', + 'properties': { + 'name': '仙桃市', + 'cp': [ + 113.3789, + 30.3003 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VK°VškX@@ƒVK‚bXI@a„ƒlblwÞVšUnJÆwn@lkXJ@X‚WVz„V@xnx‚VXUVVVkUw@mšLVw„KVU„@Um@alU@„@@KUƒmIUaVUšmnwmw™mb@aW@UkmKkUkVġkUJWbnU„õ˜@UkmUÅKƒL¯a›VkIk`WnkJƒ@xVLUVVbUbk@WlXbm„VxnxUblbUV™@@VUV@nVL'], + 'encodeOffsets': [[ + 115662, + 31259 + ]] + } + }, + { + 'type': 'Feature', + 'id': '429005', + 'properties': { + 'name': '潜江市', + 'cp': [ + 112.7637, + 30.3607 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@UbVxšbX„mJVnXVlmVX@bkxVJVLVlXXWlX@@IVl„V‚U—aVwV™lnÈVVmn£°aVbUš„l„aVUK@mVU@Uš@VUkaVamwUwnƒWaXkl@VaUaVUUK@w„WI@aU@@K@_UW™@kX@V±VUbkKWaU@mI@¥kK„kW@ÅK@b¯@UVmI@lmIkVkUWVnšm@@V@n@JUnƒšU„@ŽmlXXl@@V'], + 'encodeOffsets': [[ + 115234, + 31118 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4207', + 'properties': { + 'name': '鄂州市', + 'cp': [ + 114.7302, + 30.4102 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@°¥WóXmlw„_ŤW„kVaX@@K@U@a@WwU@mWk@ƒULƒWkX±lUnV`XWl—@ƒaWLUb@Vw@wmKUa@°™kw‚yVUJUUVwkUUJWI@akWmLUnkV›aXVƒbUxUVWX¤lL@„lx@b„b@ĸUx@`„@lbk¦@x‚n²VƄX@'], + 'encodeOffsets': [[ + 117541, + 31349 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/hu_nan_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '4312', + 'properties': { + 'name': '怀化市', + 'cp': [ + 109.9512, + 27.4438 + ], + 'childNum': 12 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': [ + '@@@n„‚@b@XnJ@k°x@aVUnl‚UXnV@@VnJWUJV„nIVV°ŽUbVVVL@Ž²LUVa°V@aV@nm‚UXblLXWVXVmVLVK@an_„`@X@l°„VlXXW`nX@Jmn@b„@nV@Lm`„bUb‚n@VUVl@nIVbUlƒV@LkJUnVV@xVblVUbU@ƒzUKU@mx@xUnn@@WV@lbUb@šnVWXX‚V@VIV@VUnJ@VUz@JWbXllI@VXVVL@ŽVn@„„Wlb@„Žl„XVlL„aV@VJ@XX`„kVwVl@bk„‚bUŽlVXIlƒnLVa„mVwV@@nV@XaVJVbX@lwV@n„@nV@VWnIVVUŽÆ@Xx‚a@I„UUKmk@mVƒ„IXmWUš™VJnUVU@anaVwk™›U@UXa@W™@m_@a¯@@K@UVƒ„bnK@blIlbXa@WW_n@VƒU@¯bmyƒUkUJÇÅ@WU@kWKÅwƒnm°KVkmankVWnXVWV@UƒƒwXkV@mƒ„UlLnaƒVaX@VUn@VnVK@xlnXWšU@a™@@klak™Vw™mUaV@™wmIÛ`m—@mVUXmlIXƒV‚I@K@aU@UaV_UK@wkUmmUKWXŽmVkUƒL@mƒƒU_nK‚™@aVU@Ukak»@U™™@ymUƒ„¯™ƒUUƒVKkam@™nka@ƒmwkLWb¯mkaƒ_VaVKUƒ™IUw@kKmU@WK@UnƒmaULkU@wUalWV¹U@@WUI@WU@‚_@W@U@mƒU@WbbUK@Um@@UmbUwWWkk@WU„a@anUUwlWUwUU@wlJVUnnV@@mnI@m‚K@U@w„a@wUm@_mƒVUUaVUkƒƒƒ_kċUk™VWLƒ@mlU@kn¥W@UwUWV@VÝU@lXLWVUbVLXlVIl‚knmU@VUJk@@„ƒ@™kVmwmVkxU@@XmVUb@xnKVLl@VxUxkIU`@bWVXX@JWL@bkb„¤@bmUUU¯Kƒkmb@V™VU„VVn@@„Vb@`lnœxmb„lUn‚bk„@xU„mV@bmWbUV@VJ„Il@nVUb‚K@nn@VbnJVIlJVkXJ@X@lmx@bnnWVXJWXU@UlU@mk@@llb°x„IUbnJ@VWbXVmI@JVX@bk‚@bWL@JUXUK@U@Uƒ`n@@Xm@XVW@@nX@@`ƒImxU@@JUI@KƒLmK@UÅUUV@VW@™¯kUU@UamVUUmJ@n„xmLKƒkmJkwkKm_mKXU@aƒU@b@Wk@ma@zUJVUmbUlU@™xnXlWlXXblK„¤V@@nUVVLkVš„l@Xb@VVK‚nXKVx@znW@X‚@@lVK@X@JXbWbnn@JUamLVVXIVxnK@aWUX@˜x@VnI@WlI@anV„IVxk‚l@lbXXšxVVVJVInbV@@ln¦ml@XXVWbkJWb', + '@@XLVKVXVKUa@UUUmV@l' + ], + 'encodeOffsets': [ + [ + 112050, + 28384 + ], + [ + 112174, + 27394 + ] + ] + } + }, + { + 'type': 'Feature', + 'id': '4311', + 'properties': { + 'name': '永州市', + 'cp': [ + 111.709, + 25.752 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lxUXV‚lXUVnlVĢ„JVbUXVJV@XUW¯„VIUK@klW@Un@„nl@V`XUVL@l@šVx@„XXW`UnUbšxUlVnUšV„lb@VnJšUVVVInJlUšVnwVklKnw„LVJVšV@nIV@nbVa@KVVVUUa„KV_nVVJ@_VW„nV@n¥lI@anƒl¥X_VKlwVlULUVVVš@šU@VXL˜ƒ@IUmn@VU@wmKXUWU@m²šl@VIXWWkWUkWlkIVamUXamUnmWUU@@Un™lK@XJl@kVUk@mWKXkl@@aVU@UVWUUVa„In`VUVLnw@U@K@Uƒƒ@w@UVmUUƒ™°K@UnV@bV@Xk@KVm@amk„aU£VWUUmUUwm`UbULka›KXU@kVmU™@aV_UWVIn@˜y„XXK@klmV„V_kWVUn@WUU@UƒmaU@™wnwWanUmmXkƒam@UakLmK@b™xUUUU@Km¥Vaƒ¯@ƒkUaVUlm„UU@mUUÇmUk™Uyƒb™bUa™XUWWbÅLmL@V™aL@WWXUKmmk@a@UUK™XW¥kU@VƒUkxmVkUWbUJnVJ@nVJXzWxkŽ@lVbUX@VVL@`mbUnšŽUn™VV¼k@Ulm@mwLƒb@lmLUK@UamƒWkƒK@£Ua@ƒ›UkJkUmbVlkX@bWbUŽVŽnnUVl„@bšbVK@VX@lb„V@nU¤šx‚²„Knblb@x„V„ô@šlŽ@b@l@XWxnVl@„VV@XLVl‚LUŽUXV`šbXXmJU@@bm@UUkLW@UlUKWUUb™wUm™L@nklVVmVXXm@@bUKlÆn„‚XkllVUVVL@nUbV‚@V@nnV@xUn¯U@JW@UX@xĉ@™`m@@LV@b'], + 'encodeOffsets': [[ + 113671, + 26989 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4305', + 'properties': { + 'name': '邵阳市', + 'cp': [ + 110.9619, + 26.8121 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@XIlJšI„VVK@n@VVVKnLVwVmnLVK@U„@šw„J@wVIƚ°X@ÜȄUÈxll@kn@VwVaXJWXn@@WVL@UUKVKV_U@@aVK„x@U„aV@lk„@XylbUaV_šVnal@W„U@a„I@aV@@aVUl@Xm‚UXWaXml@@kk@ma@V_UnUV™UUWJUa@kkaWLUmk@@LUVWUkJWkK@¼UnWJƒIkV@b@JUIm@Ul™V™m@Uw@a@kWƒXWKUknW@ƒWUU@k™mx™UkVmIUJUU™VmI@UkaUƒV™UmVk™wVaVmX_WW@ƒUw@™@kUKWVU_k@ƒmm@@VkX@lVLUJƒX°WVU@UIVWUaƒIUġmkVUkWUVWkwWXk`mI@¥kUVƒUƒUn±@m›XkWknV„UVmmU@@XƒVƒUk`@Xƒƒƒk@¥¯»mbĉó@mkU@kU™ƒƒ™KmX@˜UnmL@lULkKUƒWUU@ƒbUaUnƒ@Vb@l„¦Ub@l™@UKmnƒKUnl„UVVbUVn„@`Vn@xƒb@x@VL@nmJ@nU@mmUVkI@xVVVxkXVxmV@bƒbXVl@Xl‚XVxna@Vn@@VVL‚aXaV@n„‚@@V@X`V@@XVJ@XV@UºkXVb@xlVVKnbm„@VXLV@n‚lL@VxšJV„ULUb„`lb°nXalKnx@„lbšmn@lbULV„„V°š„ƒnV@zšš@Vl¼lb@VUV@bšmLV`„„@n„KlVnU‚XWVLnnlV@xVLU`VbV@'], + 'encodeOffsets': [[ + 113535, + 28322 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4310', + 'properties': { + 'name': '郴州市', + 'cp': [ + 113.2361, + 25.8673 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@²zVaVlnVl@nšVk„Jl_XJlIVmnL@mV@VXn@lV@‚XzV@lyV¯²U@UlJ@XVKnVVIXl@UVLV`@n@J„I@mlI„KVLnUlVUVVLXašKVLl@nb@ŽW„XV°KUnVV„L@xVJ„L@b@LUVVVU„˜VXbmbVbn@@lUbm@x@XVVVŽ@@˜@bkImx@Vm@Xbƒb@l°XU¤„a‚L„mnL@bl@@™VUX@VxnV˜anLnƒWƒ¥XKVwnUWXmVIUWÆLVx„L„w@wVmlU@¥XƒWUkwlÇn_Uw„WV@VU°wnU—ƒy@aVškVlnL@lVn„w@VlJ@b„X„x@bVKnb@U@WVUl@@Vnbl@XLlK@aVLVKnxÞn@a„LlmUaVU™ƒm@ÅknUmaUKmVk@m™kk@UlWUkVm@w@kUU@W™U¯™¥@w„Ç@aVIlUV@kUWU@UUm»@k@mKVkUKUwƒaUaUa›@k„kUWJkImaU@UK™@maUzk`@zƒy@XmJkL@UUJmUkV@z›@kŽkVmK@¦UbWL@a@UbmKmwUK™Xk›VUUkmVkw@UUKmL@WUIWa—JW_k@@WmI@mk@WkWULUUVKUUVm@šU„bš@‚nUǃ@U@w„™V@Ua@aƒL@ak„›l@k™UƒJƒwó@@L@V@„™`@œƒJ@xnn™šmV@bkJmUó@ƒn—JW„UUmƒU@UV@Lk„WlnnmVXbmxšxV@nbV„V@XVm@UVlXU`ƒUŽkn@lWLƒW—zm@UJVXU`@bVšUn@lWVœLlbVKVan_VxnVVVUXV¤ƒbnl@bUn@LWlU@@amU@V¯L„šVVUn@V@x„„@V@L@VmxUKUVm_ƒJUbVV'], + 'encodeOffsets': [[ + 114930, + 26747 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4307', + 'properties': { + 'name': '常德市', + 'cp': [ + 111.4014, + 29.2676 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@l™U™mkUwUyV™@VW@¯Va—VmUU@KVUVUVLnaWƒnkUÓV_@mVU@݄w@ƒka@kVmƒUmK@IkaUamKkXWaUW@WUk„™@@KVU@aU@™L@J@XÇVUKVak_mWkLWakVUbmLUUmlUVKUU@kUWW@UImJ@xkLkKm@@Xƒ@ó݃@UUk@UKƒV™ƒULƒKƒXkWWbkaƒIUƒWU@mUk@WLaUJġ™ƒ@@XÈÆVIl‚„Vnz°aV@U„m@X`@XWbkakJ@amLƒaU„@V@L°@@bn`š@@XWb@VœVlšUxmb@bUVmVUI™šXVWnƒJU„@nnlVLƒV@JbWzk`m@UVK²V‚x„k„LVl„@Vn@V„„°xVKVkœVVlUblx@bU„‚Æœ@@nVnUll„kx@VW@@VkLWxUL@bÝ@kKkVõV@bkXVVUVƒ@ƒVkUkV›LkV™a™@@™ƒ¯xUxmX@JVb°WXkK@Vm@k„Vb™bn¤‚xUXkJƒblxnXÆK²l‚_@Wnašn@ŽUL@b‚JnIlV„@lUœ@@¯ô@lWȂIVKVm„U@aXaV@lwVXn@@K@UVKUUnU‚bn@lWšX„ƒlJnUšLšKV@„„l@²a@UlK@aV@naVX„WV_nKlL@KUm@a°U°@VXL@a@wWmXal@„k„@VLn›V@@bl@VnX@mwVa²aVU@mk@'], + 'encodeOffsets': [[ + 114976, + 30201 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4331', + 'properties': { + 'name': '湘西土家族苗族自治州', + 'cp': [ + 109.7864, + 28.6743 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@KšL@wnK±nƒnm‚—@WUk„ƒÜÈn@n»@mVamk„mšU„„l@V™nmmU@wUan¯VKšLn„VWlInyWUœI@WWk@KXU˜n@mnUmU@WœƒmkV@ƒkXašaVaUm‚Ikƒƒ@kaƒX@ƒUm@UKWU@UkJWkXa@IVy@UmIUVU@UJU@WXWmU@™VakaU@@Xm@Vm@wnwV@VL„yV@VakUUa@wUUVmlI@K„UVkUamJk@VU@UmVaƒan_@KmUƒ@@anm@ImWX_WWUk¯ƒ@k@Wƒ_m`@bULUKUnUWWXkKWaVmnU@@b¯UUbVŽ±K@UKUUVa¯UUmJUƒVIXmI@UU@WmVmkUV@b¯w@lmI@W@aƒ@m¯LXbmJVLklWL@V@XXŽmbVVU@@VU²Ul@VlX@bš`Xx›zUmkUVÒlŽ@bXLWxXVlš@V„bkLma@nmVmULVbmVUb@lnzmbUÒVl@°nLV„lJkn@bmJk_ƒVmmkblxÈx@LUb„xVb@V™n@JmLVŽUš@„nV@¦VbnJ@lVVbkx™bm@UxVLV@n`UnVVV„kl°z„xVb@VU@@ÆlXnWm¦nbVK@XVVUVVl@X„KUV@nVL@WnIWŽXLVKVLlxUbVKXVWbn@@UnKVLVb„JšU@aVU°b'], + 'encodeOffsets': [[ + 112354, + 30325 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4304', + 'properties': { + 'name': '衡阳市', + 'cp': [ + 112.4121, + 26.7902 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lšV@XV@„mXVlXL„W‚X@l@bVxn@šŽšUVkn@VJ@I@alU„JXIVm@»‚LXllIXVVU@Kl@VnXKlb@lVbXIVVUšmVVU`@nbl@@lXLVVVKVbnXWJ@VXbWxXb„Ul™VK„¦nLVVUVVbšb„K@U˜LnK@Un@VxlUV`UnnL@VVL@JV@VUnxnKVbV@@VšIVUnJUVUl@nW„XllIUa„KVbÞLV¼²`V@VIUwlaVmXa@IWanK@U@m„kVƒVUVaX@lšnaVLÈ@‚¥@kkJUWJUaƒXkaUm‚wVXJ@_lWUU@¥n_‚KkamUK„™@amKƒnKƒbV£¯W@k„aWan@@UnwlJ@a@—@UUU@W‚wn@Va@km@UanaWa—UVƒUUVU@K@aƒKUI@wƒKUUVm¯LWUXƒ@mak@UK™LWbUKVUkUmVUKƒLkJ@nƒJ@I@mU_UK@VWkUJmUUL@WkI@V±VU°kzU@Wy@kUm@UWU@@nmKUnkJWIk`ƒIUlm™k@mUUkUb±yUX@VUV@bk@WlXL@nVlUl‚k@WI@ŽkLmš@VV@XVmnnVWbnVUblJXkVl‚XXlWXUJk@±™@nXVWVnL@xUVm@Vn@J—„WK@U™V™@UUVUVKUkkxULW`k¦m„@bkJm¦U@ƒmUX@`UImUU`ƒLVbUVUU@LUbmaU@mJU@U™UIƒKmxkLUl'], + 'encodeOffsets': [[ + 114222, + 27484 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4306', + 'properties': { + 'name': '岳阳市', + 'cp': [ + 113.2361, + 29.1357 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@wUklmUUmU@@UVm@wUaV_mmUKmwkIkJmUUnm@™™@UUƒbUKUƒmÛamm¯xVLkbÇƃUƒVUzkVUlƒUUKWLX¦W@ƒVUUUaƒKUbmLKm„@akU@aƒmVaUUVIVWkk@wkƒƒ@@xmLlmÅwmbVlXlÝIWVkK@kkVƒL@VWKU@Ublnaƒƒm@b@bšnW`@XUJk@UUWKƒk@UKƒnn‚@xmLUVm@kbVbV„nV@V„b‚@KnV„LWšXŽÆVĢ¦VblŽš„n„UJWz@ƙVóUVbkV™aÅx@¦lVUbVVknWKƒ„k@ƒwƒK™VU„Å„ƒl@zkb@`m_mJ@xX„mbVbœ@llV@n„@llbXL˜UXalUšl„alVnwnLVKlšVbX@@I„V@blJ@bVL@VVVUXȤ‚VnkVÑXmlbnš‚„VKkÑř@UmaVç@±XUlI„xlV„@VaX¯lUVVUšVJn—V@°°nŽ°„Vxĸł°¦šb²¦lJ@U@aUK@kUm@_m±VIXal@„Kl@„bV@K„K@k„m@UmUUaƒK@_UJƒaXU˜@Xmš_VmUk@WUk›@kU@a@m@UƒaUUU@al@ny‚XXWWwkly@¯n@@bnV@k@mVI‚„œVlUUmlU„JUw„I‚bXƒVaUal@K„b@ƒVKVkXVl@VkUU@ylUœVVaVL'], + 'encodeOffsets': [[ + 116888, + 29526 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4309', + 'properties': { + 'name': '益阳市', + 'cp': [ + 111.731, + 28.3832 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„ŽÆxXL@l‚V„@ĢšVI‚bXKl@nVV@„XVŽ„JlbXalX„W„LVKš„„UVLl@VV„@ôބ@@Wn@lLlK@wnIVJX@VX@lVVUL‚VnkVVnKValUXblKnXl`UbVLÈU@W@IšKV@@bUV@Lš@lƒXV‚@VXXblWnLVblb@JnL„VUn@llb@„ƒx@ÞUV@nU`VÔmlX„mbUKUVUV@LVVUn˜ŽUb@°UXš@U‚VzVxnlVškšVnlVnaWƒ@wnIn`@_la@y„kƃVƒšU„L„xl@„ƒXLlmUUVakU@¥ÆwšblUUaôVšU@ÅXyVImƒ™ƒkUaġ¥ÅUWX™ƒKmU@Lƒa@UmUUƒUalan@VUnK@wm„m‚L@V„lXLVVl@VI@WX_™m@a™¯mKUkwW¥UK@_UWWLUVkUWL@WUIkVƒU@JƒwkLUUmJVI@WkXm@VmkKUIU@mmm_@VUV™@™„kJċwUU@KUWkkW@IWW@km@klwkWVkkU™V¯m@kWLU`mIkmkXm@@`@L@xUKWkU@VL@JUU@mbUKVa¯WVnL@`lXUVkU@xW@UbUWVU@UJ@„lnU@m‚nÈmVƒa@bUL™wUb™@@VkxmUUƒ™UV›K@IƒUƒmk@akm@wmIƒŽkK@b™VWXkm@wULUmm@UVW@Ub„mbkKƒVn„U@Wl„xV„U@UXmWUXmlnbUl¯Lmn'], + 'encodeOffsets': [[ + 113378, + 28981 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4301', + 'properties': { + 'name': '长沙市', + 'cp': [ + 113.0823, + 28.2568 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lVUllXkx@lln@‚XX@JlXXl‚V@LVVČxlIšƒš@VU@Un`nnV@VJlLUnn@lW@XUJnIVVlK„x@I„VlUVJ@XXKlVVUXKVX@`VLX¦lxVŽnLš°‚an@„„‚bkmVaV@XL@U„KlU@llLXUÞJWkUknaÆxnŽ‚knK@w„@l„@xllUXUJVVUb„n@blV@bnƒ‚LnKVa„LVbVV„UX@W¥XKVL„VVklUVy„U„VÈÅlaUK°wnnÜbn‚V„VL„aVVš@šn@VmnVlIlJna„@Valkn@na@amwm@„UXw˜K@aUUVUUaVa—wWK@kU@UaW@kKUUƒƒ@k™W¯XWan@k„™mmÅ@@I@U@KmLkaVUƒKkLWVUƒk@UVmU@am@kkk¥ƒUƒVUK™„maUb@ŽUb™I@aƒKkkWm@W¯K¯b@VmaULVxUXlVk@UxVJVbUb@xULƒ@ULWW—LƒĕmxVVL@šVb™KUwƒaŲWwX@@WƒUWLU@VbkV@aU@@VUnmJ@VUn@VƒLUK@U‚mUIk@UÇmU@@UW@J@LƒbUmVI@aUmW@@bkXUx@lmLUbm@UbkJ@V@XmlUbkKm@ma@kUaVU@aUK@mImJUIkVƒUƒVUakbWwka@UWKkLUamKUXm`Å_U˜ƒULmaU@@lUV@X'], + 'encodeOffsets': [[ + 114582, + 28694 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4302', + 'properties': { + 'name': '株洲市', + 'cp': [ + 113.5327, + 27.0319 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@X‚‚Unw„Ė˜KXXVK„@VK@wVaUaUIVwl@kUVWUwVKnb@U°a°LXŽ‚@Xnll„L@bšJVa@VanbšƒVL„U„V@al@@UV¯ÅÇ@Ummk™w@¯ƒyVwnUVVVUkmWV—nKVUƒa@WXkVKn@lUVU„VVVXIlV°VnI@VlKnV@mwVm@LXKWkU¥wWwƒƒ@k@m„X@KX¯V@VUVa@VnKWkœƒV@VUkm@aWa@wkUWwkmV£VÿXUVL@mVIXaò@nW@ašUš@@am™@aUU„UmXmWUk@ƒƒnUW@_maVm™wUkamaUL@aƒwƒW@akI@UƒxUm@kmKUk™lUŽ@b„zV˜m¯xUVU@ƒXVxm`kÈlxXVW„@¦kVUn@xƒxƒKUwÅKVXUJWnXŽmVUxWL„¦XŽm„mK—bmUUwW@UV@šk@ƒšVLnŽlbLm`@¦VVkX@`WIUŽxVnlb„WVbXIV‚lI@l¦Ç@UKmbk™W@UbUVU„ƒl@n@VmLXb@JWbUnkbVxUJUxWXXlWL@V@V@XXJWx„zUVVVVKnXW`@bkIUl‚„nLVJUbUIWVXlWV@XklVbnn@xlš'], + 'encodeOffsets': [[ + 115774, + 28587 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4308', + 'properties': { + 'name': '张家界市', + 'cp': [ + 110.5115, + 29.328 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@InWVw°wš„@š@šblUœKlUlV„U„@VUUUlW@aöUlUlLÞ@@aVKXwlK@UX@@UlwkƒVkUm@m›@ÅVƒ@akwVaUk›UUlUL¯wƒƒ@UUmƒ@UkƒKƒlw±UULVn@l_XyWwÅ@VUUmJUXU@@mmƒU@kxW@UaUIWbU@@mU@UxƒnUbmKk„WJkUValƒ@aUkUxƒlW_@WUIU@ƒbkKWUJVnUb™bWb„lU@nl›„@XnVmV@n—mWV@LXl@X›JXVmzkJUXmƒ™KULm°Vb@xnVmnUšk@ƒƒ™VƒnnlUb@nm¼m@Ûǃ„Vl@X˜mnm„²ŽmL@x™K@LUl@nULÆx@V@VXVWbXX˜l„@nLlm@bVKœX‚W„L°bnUš@VaVUš@šmšVw„JnwVK°zn@V‚Vb„a„@Ċ¼'], + 'encodeOffsets': [[ + 113288, + 30471 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4313', + 'properties': { + 'name': '娄底市', + 'cp': [ + 111.6431, + 27.7185 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lL„nJ@xln@bnlV„‚„@JœLVUšŽV„nVlw@Uš@VašxVK@a„bnUmÇnV@km@ƒ‚I@VUVVXVaX@@wlVVUkW@_mKXU°‚UbVLnaV@‚V@IUKV@XlVL@w@K@_n@lWlnnJV_XK@l°nšU@WVU@kV@nbVK„V—lƒ@nLlƒ„LXU@ƒlmkw@nW@UKVa¯IVn@@aVUUKl@nXVKVn²a˜ŽXblKnLlmVI@KUU@akLUaVa‚UXm@aƒ@wVUVKnLnWlXl‚n@@U@anUVm@U‚Inm@IUK@UmKVmU_kVUwm@@VmL—K@VƒL™aUaVUUUmKƒ¥ULkšƒVWaXwWa@UXImWUaULUUWKk@WnXbWŽVWnk@UV@bU@@bƒJ@bƒV@XkŽmb™UU`VbkaWzƒ@klU@ƒb@VƒwUL@bV@U`ULVL@VUK@Xm@XWWIUbUxm@@lkkÇwƒVÛÇW@¯Å™UJ@xƒI™xƒ@@VULmKUnUxmKULUUm@@‚ULƒU™JkIWJ@b@LJUW„kJWnUV@nn˜Ü_nJšxU@VbšnUxlškb@lš@'], + 'encodeOffsets': [[ + 113682, + 28699 + ]] + } + }, + { + 'type': 'Feature', + 'id': '4303', + 'properties': { + 'name': '湘潭市', + 'cp': [ + 112.5439, + 27.7075 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Æ`n_VWnLVblKXL@VlbXxlaVb„U„VlUVJnInJ‚@VL@bUVVb@lnbn@lLVank@W@UlIVan@VanK@kVwlW@aX@Vn@bUJVn„a@K‚IX@@VV@nŽVÈl@VJn@VVL„K@UVm@UnIVm@UV@@blUUaV@XK„V@XW@XxƱ„bVxšLUa@™UKWk™@wmmUalk@WXUWkXUVJVaUImKƒVklJ@aX_mWULUUVUƒyXwWI@W@U@UXKWkXWVwU@±_U»ÝKUaƒLVbkJkƒWmXk@UVVŽmIUV™J@UU@UamLmwUVU@mnJ@VUnmV@b@Vm@kkWmXmKULUV@x„Ž@bWnVUbVblK@bVV@LUJknmKkLWa—±bUmULmWk@VLUV@bm@U°JUbVLX@@mlxkn@„WVƒKk„mK@k„'], + 'encodeOffsets': [[ + 114683, + 28576 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/jiang_su_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '3209', + 'properties': { + 'name': '盐城市', + 'cp': [ + 120.2234, + 33.5577 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„n@‚°ĀÞ°@¦ULWKkx@bkLWb@lUlVXXJVbƒnUKmxXV@bm@@Xš‚„LޚܦXlVnš‚mzVJ@n@‚²ÞôkƃÞaȰĉ‚wnljÜó„éVÛnĊīČlj‚ĉ@ō@KÞUlU@ƒkklÇÈњÑlġXɛ@UġƒƒaU@U_ƒW@n™@kaUL@VW@kKmkUV@bkbWW@bkzma@ƒJWI@KUKULƒ@U¦™`@XUJ™U@KmXƒw¯KXkmy@aUIWJXXmV@K¯UU@@bVL@¤VLXbV@@JVXVK@„„JVn@bkKmakVVXUVVVlI@`U@nzVVƒb@¤n@@UlKXLVVšI@V@nV@V‚@ÈUx@šóVōšƒkÅWó@mU@bk@Ýwk@WbXxm@@J@zV@kVƒbV‚nLWVUX™WUXUŽWLUŽ@Wl°z@VkxU@UVWIxWJkbƒĬ„nW@@bUl'], + 'encodeOffsets': [[ + 122344, + 34504 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3203', + 'properties': { + 'name': '徐州市', + 'cp': [ + 117.5208, + 34.3268 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@XKVX@WnIVx@K°Lnll@@I°K„nVašU°x²mlxš@VanU@aƒk@akmV@@w™@Ua@aUwVwUw@w›@UK@£kaĉlóIÇVkŽ±@@kUKmVkIkxW@Ua¯UUm@UVI@WVI„JV@ƒ@Um@Uana„U@m‚I@J@XV@XaVlkXƒVaUUWLUyVIXmWak@ƒXkJókƒJUL@KWkk@ULU@Wa™lUIkJmI™mk„VbVš@lV°kXUKWKULU„mb@VUlVnƒb@VV@IVKUUmU@ak@@bmV@xklƒUƒU@UKmV@nƒJVbkXƒKUamLUJ¯UUVmI™bVV—Ll`@LƒLU`m@kXUVU@V„lxUK@xkIWbUKƒx@V‚kVVn™b¯@@U™@ƒxk‚mbkLÇK™b™@@XnJ@LmVklƒ@@XƒlUƒVkxƒakVVb@bVnUbU@@x˜VUšVb@š„ŽnIĊ`šXVVôJš_„K@xlU²Klk„U„@VaVVÈm@kVUVmnamUUaVƒXIVJ„@‚ç@¥nkVLn›„@@XVK@VUX@JVUV@UnVJVLUJVLUVlšnI„b‚KnU@m°™VanI@anV‚KVL„an„lK„blš„KÞk@¦@¤@„VKnLVK„L„KVzlWšLX@VmV@VbnU°@Ualk™˜WXLVU„KWkUUWšƒ@£Wa'], + 'encodeOffsets': [[ + 121005, + 35213 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3206', + 'properties': { + 'name': '南通市', + 'cp': [ + 121.1023, + 32.1625 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VJ@bnzWl°L„xnW@LšVVI@Wš_V¥„@VKVL@LXJ„I‚@nbly@aXXla@aVUnllLX@@UVKlbš@@m„XV`V@„bĢ„lkČÇƃȘ¯šwnĕVĉVÿšUƒUĠƒŦğlXÑVǵ@±ōLʵĖ¯lÇbÝÞ¯xk@Çkķé™n¯@ğŽġƴǫ@kVVlUbƒL@xULǂóLUl¤@nkVV°VLkxVb@l™aUXUKWĖklVX@¤UšƒUkb'], + 'encodeOffsets': [[ + 123087, + 33385 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3208', + 'properties': { + 'name': '淮安市', + 'cp': [ + 118.927, + 33.4039 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@šnźUôÒɴ胚l¦nĖV‚kbmš„X@xVlVL@xUb@bUJVnUx‚šœ„lKVLÈx‚m„zXV@lW@XV‚b@bȚVxnb‚ƒVIXa°L„aÆVVaXUlK@aXIƄVlXKVUlIXalK@alwXLVK@¥Ý¯¯ÿ@ƒmVk@aX@ƒm„īlaXI‚wXJVUV@lw@U¯yb›UaƒUġUÅaUKVknaġm@kUm@wÆIV±nLÆw„ÇnUUkƒ@ƅÝU¯JÝI¯¦Ul@bƒ@@VVL@l@LƒLÅmƒL@b™@UaVaUWmLUKV¹KƒLWKX¥WI@mXk@UmaUVUU@VmL@W™bkIUWƒUmVóIkbmm™@UbVLUxmJkU@bkJWbnXU`Wz™KUÞÈlVb™Lmx@„kè@Æ'], + 'encodeOffsets': [[ + 121062, + 33975 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3205', + 'properties': { + 'name': '苏州市', + 'cp': [ + 120.6519, + 31.3989 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ôèĊVnX°¤²„lxƒÈÜ@²x@J@b@X‚`nIUƙUUV@bl@VVnL@L@xƒJ@X@blJXnW@@`XbW„kVƒ@UbVxƒXUxkV@LóxVbUVWš²šVJĸklUǬ@ĢƳĠ°@šmƒī°»ÈÇ¥ULUU±a@bU@¯ƒU@KnImUVWUk™mXUVU@lIVaUUVWKUbUkWKU¥n£WakJUkUL›K¯L™KkƒVIn@VaUƒVUUƒ›UkVk@ƒU@amUkJƒ@UUlwX¥W@@UkVmk@JUakL›@kk¯ÝmJUn@nmVXlmbVVkn@„UJ@±WUxV¯a¯KōbżÇxUxƒšUUlWL'], + 'encodeOffsets': [[ + 122794, + 31917 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3213', + 'properties': { + 'name': '宿迁市', + 'cp': [ + 118.5535, + 33.7775 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@XbWnUJVzXKVVUbW„klUWbU@@W@IJ@nƒVmbVbn@@V@„UŽƒIUJ@XUJ@VVn°VVbX@lwlJnUVL@l²@lÈUôJĊklb@¤VLœ@@xVxUxVx@bVbš@@xU@ln„mnX˜mXLVmV@X@lxVnVJôL„LXa‚x@b„@@KVL@bn@@m@™@alLUUVaU¥nIV±‚I@mXI@aWWXU@LlUXWW_XWmaUwǙ@aaWUX@@kWUƒynÇwUKkL›ƒ™VwUmVI@aVa@wUKUk@wƒWn™laUmĕk¥„™ɳçóÑŹV™mmzkVmm@a@Ióƒk@@LWU@`—„WbXLWlkImJVn@`nXVbXŽmL@Vn@‚l@nUVl°Xx°U@LVĠ@z°˜@¦UV@Xn@VJmV'], + 'encodeOffsets': [[ + 121005, + 34560 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3207', + 'properties': { + 'name': '连云港市', + 'cp': [ + 119.1248, + 34.552 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@‚lzXxmÆV„„@@¦„@l`XnlKšXXm‚KnLla„b„@„xmbm@kL@V@Vl@@VUXšJX„mbš@@„°Æ@èÈzlW°XĢJlÈ`lInbšWV_@mš™@UUķnƒôw°ÆmnaVƒVÛVmĸ»Ģw±Ý@@mUIny™UmWkۥݙƒK™@Wn@@aWUnwVL„mUaWIUWVk@kkJUVWLUkŃWJ@bkLWVUbÅUƒb¯KWbUJ„WXX`WXkV@KWVXX@bWJ@nJU²mJV¦UbVVkK@b@š@nm@@aUK@Lƒ@@awWbƒKóKUIUmkwW@U@UnWK—nmWƒn@b„l@bmVUb™@kw±n¯w™VUb'], + 'encodeOffsets': [[ + 121253, + 35264 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3210', + 'properties': { + 'name': '扬州市', + 'cp': [ + 119.4653, + 32.8162 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VUXblVVV„b@xV@kz„V@l‚wVLUbVV@VU@VbUbl‚b@nkĶ°IÞV@Ɔ„VlmVƒÈÅxmKU²ÅJ@xVn@lĢnmbUlVLÆbĢV„V‚bœV‚aXk‚@VXKVVWšXVWXUmKU„aWaU@™¥@£XW‚UUV@@ynam_VWkUVUna@ÆV@mnkWmXkWU„W@k„@@akklƒlWUI@UnKl¥™I@VVma@a@I@U@a@anK@UmK@ÅVUnJl™kI@aVwka@mVIUW@UWL@WÅbmIƒƒULka™UWƒUxkLUKWlXL@VƒImƒÅVƒU™mĉL™Uól¯I±l@ÒUbVbUVVXUJUnVV@lnbl@'], + 'encodeOffsets': [[ + 121928, + 33244 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3201', + 'properties': { + 'name': '南京市', + 'cp': [ + 118.8062, + 31.9208 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@k@ma@kUUVmVIUWVUUaVa@Ѳk°Jôk@Wmk¯KmX¯aUakKƒƒWU„@XU‚LXaV@@mUaVUUl@VmkaUXm@ƒWUUna°IlmV™m™IUW‚@Uk@@aV@VVX@„V‚I°»nm„U@VKVan@m»UaU@U_@WlIUa™aVaUala@¯n@‚ƒkaUkUUWKU@mwkUUmmL@K@ƒLmUUVƒKƒVÅImU—JƒƒVkVVLšèVLVU@W„L„V„š@nVÜULVŽUL@bW@XbWbkJƒUUVUxVXmVk@WUUkVmIƒV@„nbnVWbƒJU„kUULƒa@Jma@XkK@VVL@L@JƒLUVU@V¼ƒnXlƒbm@kbUKmn@lVb@VXXV‚UV@b@LVbÆxXbl@@lV@U„VV@XVK²VlIš`„UbVbUlVVn@WXn@@VUV@„@KmbVLXқLkKƒV@nX@VVUV@b™nVllbšmnb„IWVXU@`lLlknVnmlLlbUmVInK°nUƒU@l@VU@Vn@„ƒ@alI„`VIXaVaVa'], + 'encodeOffsets': [[ + 121928, + 33244 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3212', + 'properties': { + 'name': '泰州市', + 'cp': [ + 120.0586, + 32.5525 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lUU@@y@In@WwXal@Þxl@@anVô@ÆX„lŎ™ôU@™Vw@ÇUU@@m@U™JUUWKkL@Vm@@£„aUUmyV@@_kJUUVUUWlUnblL@aUmƒI@ƒULUW@IU@WaUK@£UK@aV@°V@LnUWWXIla„VV™@£UWlkXĕVLVWšb@kUalwUKU¯lU@mk£VôKȁVK@w„KVaUkķlUI±™ğ¥ÝUŹš™Ž¯ôm¦ƒĸ™‚@XXK@VVXUJ@nlbUx@blJkšmIUV@ÆnL@VmL@b@b@V@J@bnb‚U@UšJk¦mL@VVJkXk„ll@bƒ@@lƒXXVWlXnml@nÅU@ŽmbUVlVUXn`mb@zU@V‚VWX@¤š¦V@Xb'], + 'encodeOffsets': [[ + 122592, + 34015 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3202', + 'properties': { + 'name': '无锡市', + 'cp': [ + 120.3442, + 31.5527 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nLƒÒlxUVkL™am@™ƒkVWUULUxVVVbUV@bVLU‚nnź™ÞVĠ¦X™VUUaôw@KlUVw„WUwVa„@lUXƒWa@_X@WmkI@a@W„I@w@KmKUUk@@aVUšVVÅmJ_@W@a@I±wÛ@ƑÇkw±ƒ¯£mWĉUóçƒK¯VkUWK@XkV¯UWabƒmUa™UUb™lln@b@xƒbXŽWX`@„VxUblL@bn@Vb@`m@XbWnn@l¤„n@xnVlU„™VLÆWœkV@VbÞJ‚_nƒl@nKVU@aU™U@mVk°WVLUV¯bVXŽ˜bXlVn@VmL@x—V@bl„š‚@œnW@X@VVJ@²VJVU'], + 'encodeOffsets': [[ + 123064, + 32513 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3204', + 'properties': { + 'name': '常州市', + 'cp': [ + 119.4543, + 31.5582 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„L˜ŽnxUbVVƒL@xnnW‚nn@VVXn@‚yœImx„„°ƒšL„a‚¥n@VkšKVw„W@nX„VJ@b‚@UVn„ƒ@UnUV@L‚b@`VLklVÞn„Æ@VaXLl™ÈJšmmVUK@aVUUaUUVwVKXVlUš„n@šblKVUkw„ÑmKUVUI@±UI@U@WmX@›™kƒ@a˜U@wnK@UUmWk—aWU°aVUUK¯XUl@nVŽVš@bUVmLk@m„`ÝIUaU@›lÅXUKƒškVmU@wƒmk£m@XmWan@@_Uam@@akKVaUw@ƒW_XW„a@w@akmm@mL@UJmnUKƒ@@XnJWLkKUb@„Vxk„WƒL—aWVUImVULUK@L@lkLVVVllb„m@@°kbVbUbšbVbkJ@XV`V@Vbn¼'], + 'encodeOffsets': [[ + 122097, + 32389 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3211', + 'properties': { + 'name': '镇江市', + 'cp': [ + 119.4763, + 31.9702 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@šVĊKšn„VÆUn„„J@UWKXkVLlKVwX„šVlbVK„„nJÆaš„ķn¥°óÇIkšWKUbÅ@mƒUÝlkUK@_a@KVUVm„@mƒVU@@aUIWƒ@mƒXUx™LUlm@¦ƒb™K¯„ƒƒnw›Jzm@UW@UmmXmm@w„KUUVamw—ƒKm@UbUL@ŽƒVmn¯¼JƒUW@UUU@@bl@@VŽVXšJšnnU‚‚k¯JmbVV„Xn@VWlbUnk@VVUŽVb@nU@WbKWVƒ@XV„„lLVb°bnW°Lnl@X'], + 'encodeOffsets': [[ + 122097, + 32997 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/jiang_xi_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '3607', + 'properties': { + 'name': '赣州市', + 'cp': [ + 115.2795, + 25.8124 + ], + 'childNum': 18 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„`l@Èbln„@„KVLl@„V@bȎlnšKXkVlVL@„lJnb„¦VKVVnX„W@w°@VU„mln„UV`šU„bVUV@„xnKVI°KXKVkVL@al@Xa„LVlULWV™VVL@b„x@VXVmb@x@V™VV@nn¤„šlb°b°KXXWbX`lbXx‚z@x„`VIVUnK„L‚x„WXLVKVbVLVU@wnW°b„@nalX„‚mXVJn@U²mKkVl„U@@xlnœaVmlKnœ@JVLlŽnVššl@XXÆèVlUX@xVLXVšb°W@wnUWmXk@K‚LVwUmUkUKUw@wVaVK@kƒ@WnkUKWkwlmXL@KVUlLVKXmWU„L@ašL@malaVk@aa‚ašƒnXš@VVUblb„Jn˜ƒXa„V‚wn£„K@UWmUk@ƒUaWIV@b™JW@KmmU@aUUUkmKkVKlUU™nKVU„lVaV£Å¥WUUK@UkUUw@m@mIkƒƒUUWƒLƒK¯Uw°¯@wUKUbƒKmƒ@kkKUL@UUKV¥U@manw@k@U@Wm@@U@Wwkm„wWaUU@UUmV¯kwƒ@@kmƒkKkUW@UK@ÅV@XWWkXa@Ul@Va@KVaUUU@ƒaXwla@UkVWaXk@K@lmkUmV@Vmbk@ƒ»XIƒ¥VUkƒVUVU@anKVUƒKUalU@wX@˜™@a@K—@ÝwƒL@ŽUnÇlUIkJmn@ŽƒbVVb@VmnkLƒV¯U@ƒ±l—IWmƒ@kaUI@aÇU@K@KUIkbWbƒJUIUyƒX¯ƒUbU@méUUmUk„WK—xWIkJm@V¥U_UJUwmVkšƒUU@ƒƒƒ@knƒwm@UmkWJkL@n@VW@@‚U@knm@kUml@xÅxƒ@@XUJlb„@VX„JVxn@lbV„@lULnV@VlnV@bWV@bXL@lVLVb„V@blLn@Vl„K@xln@bX@lašLVbnKUVVb„KlXVVkxƒV@nnVUb‚lV@@z—°WWkbƒIk‚WL@LUJ@bUI@b™`@UmI@mkK¯XW™™mUV¯@UUVUUam@@VULWUJƒIm`IUJ›KUkW@Uxn‚WbnnmlXbmIUVmV@Vnb@V™LUKWLnÒVVV@V„UL@„kJUV@bƒÈ@ŽšV°šŽ@XVV@l@xUz'], + 'encodeOffsets': [[ + 116753, + 26596 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3608', + 'properties': { + 'name': '吉安市', + 'cp': [ + 114.884, + 26.9659 + ], + 'childNum': 12 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lxnb@V@bV@ln@‚n„‚lInš@blVXK‚nk¼@VUKWL@b™L@`UXU`ƒ@V¦XLĠ@lJ„¦@„nV@l°nn@‚mVXnaš@nb‚K„n@l„IVƒš@VanJ@_lKVVnš„L@L‚K@Vn@VbšUVanKlLnbnJVbšnWVnVVanI@‚Vb@L„bVKVanXVbVJVU@aXLll„bôlƼXxVLVK@Xn@ƒxnVVVmb@LnVVKVXV@@mnaVXUVnV˜K@_UaUmšwnKV_‚anKVLš»„K@¯ÝU@›™U@kWlUn™lknK‚VnaUkma@ƒUIUwl»Åw@ƒVwV@n™‚n@ÈXlKVmna@kVw@anm‚@n_WWk@™™mUkUK@Im›kLUn›bkm@wV@kƒlUnLV±m@UInWƒkWmbƒ@¯amX@xUVUKUaULWKƒXwƒKmLUVUJƒ_@wyWwkaW_XaWW¯L¯akaƒ™m£@mUUš@U@wnaWU@Uƒw@aUKšUXUVKUkƒKWbk@@bUKUlWL¯LUJmLƒwU@UVƒa™VU_ƒVkmƒnUV¯@@xƒXmWUUULƒ¥makI@ƒUKUkWl™LkmǍ@aƒUk@UKƒLƒ@kmÇak@ƒ_VlkL@`lbnšlLVanLnbmVÆln@škJlbknmKUbÝmmwULUK@bkLWKULUUma@Kk@UV@L@llbVzšxUxnl@bVLmŽšŽ@IVJXœVlƒLV`@bn²@J™@™V@Xmbñ@WbUJ@bm@@LUĬU‚„¦lV@xXb@blnUV'], + 'encodeOffsets': [[ + 116652, + 27608 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3611', + 'properties': { + 'name': '上饶市', + 'cp': [ + 117.8613, + 28.7292 + ], + 'childNum': 12 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„„@„V‚š„„I°`nm¤²@bVJUVVXUl@Vmb@xV@XbmVVœ@lkLmbn`VbnU‚@Va„UnbVllUXV„a@w°VW@_VWšLššnVlbšLVbnl„KšnVK@IUW@_@am@™‚ÑUólK@U@WU@VwU@UI@aUU‚aXƒƒ@kwmJV@yX@k‚anƒƒ@mkwVmmI@aUU@aUUW@kVkV@@anKš»„XVWnIVUl`@_„W@wlUœV@UWKnU‚bnŽ°InJl„UV@VnI‚b„Wn@VklL@l@Vn²m@U`kI@bWJƒnV@°VXnJm„XVmx@VVL@bkLmWULUmU@ƒbWXb@llnX@‚xkxVV„nVV@¤nL‚nVxnJVXX@˜ššbn`VI„b„@„blmlLnaV@„blWXnlUnbl@„ƒšKVanUVmm_XK@kWWnašU@UnaWUXa›ƒXamUkKmXUWƒLX¯WakKm™nUWwXa@KW_„aXWW_@WnIVl@XU‚LnWVknK@ImyUUÆbXK„Û@W@IÆUnƒVÝlkVK@mUIVwkUVaUm@aVIVyXIƒaÈwmmk@UnanVUmÅaó»lwšW@kkUVmUK@WKLƒUmWULkamK™Lk@Wa@wk@UU@U@mbUIWVKUXWmkUmVm›U@LkakKƒw@w@U™¯ƒ‚ƒUUn¯l@bmn@xkJWxkL@VkI@mƒkmJUI@V@b@VVxnbWlkÈkVƒLƒbkKmVƒL@V@²nxW‚kLUL@xlKVx„bXmVnšWJ@ޙ°@n™xUKUw±`UImVmnU@kalm@akwƒU@UUJmxU@@Uƒ@kU@Um@@Kn™ƒVm@k™KmkU@@WUnkLWxkVUwmKmLkU™bmKUbVŽ@xUnkJ@n±ŽšUxVXUšWJ@LUb™lUnm@ƒW@nknUJUVm@kXllknVbÆK„VVbš¼V„@šUl'], + 'encodeOffsets': [[ + 119194, + 29751 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3604', + 'properties': { + 'name': '九江市', + 'cp': [ + 115.4224, + 29.3774 + ], + 'childNum': 12 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@WUkVUkmaƒVUb@mVUam_nalK@kU›nUWaU@@wna@UVkUWVUUI@a‚±n£m¯_ƒJ™ƒU@ƒƒƒĉ¦Ul@UV™Km™mLlm@ğ¹m`Uk¯@@UVK¯™@UUK@amkmKkVVUa@UkUƒKƒŽUa™L@VVXUJ™@ƒnƒ@™š™WUbƒnVb¯V@LÅlÝIƒJÅkݙm@Ua™WUU@UmUXmmwVUUKWUX±mUam@kWƒzUaVmÇw@aÅLmKXƒ‚UWKkL@W¯IƒwVw™lkUƒJ@Um@ÛÈWŽKUxWkƒaUU@KkLVl@„UKUX±KUb@nVVUbUVmaUlUL@„ƒaUL@‚@nUlWzX`@„V@lx²„@Vlb@bšVÞ@°nl@UxVL@lUbVV@n²xVUVmnUÞb‚a„J@IšV°xnbl@nbÆ@VwnK@VnXlK°xnUlVX„V@Vl@L@lk@W_XK@KƒkWxUL@J„nVx@aX@VVUa˜IXlmL@bVVX@VbnK‚a²XVWƒk°a„@UnV¤nbmLmW@XbmJUbVL„aÞK„L@K@U@aVKlbV@nXlJœxV@VnšŽVȚ„ÞKôbźĕČmV@ĊšŽ²xÆIšV@Þ¦ĸ¼ÞVlŽVÞnxln°Jœk‚LXWVUVUVwnJVI@yn@lXlaXmWI@w—»ma@UmK@akKkXmW@_kaWakKWk@@K@IšWƒkUa„ƒ'], + 'encodeOffsets': [[ + 119487, + 30319 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3610', + 'properties': { + 'name': '抚州市', + 'cp': [ + 116.4441, + 27.4933 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@°V°UnÜ@n@lnLlV@bšV°L„lnLllVzVVXlV„V@@L@xX@WlX„m@UVƒL@V@n„°škVmVUnKlaXxVbšnlU@lVVnaVI@aX@V„šJš@V„@b„b@šVbš‚@X@lUL@Ž@VlIVm@wUVanLšalVnKnLVxlUXwlKVm@k@Una@mWIXKWUÛVƒk@a@UVWn@@kl@@W„XlW@_Um@UVK@a„LnalInWV@@xnI@¥‚K„—šm@kKmƒnk@mlI„¤laXbVblknV@U‚KXVlUXa‚@@Unw@±mU@ak_±a@ƒUJUIƒVKW_Xa@aWU™šK@mmUVa@IXa@UWmšannlmX¯WKXwVUVwƒ@XUlK@klJXa@kƒkmm@Uwƒw@¯ƒW¯kw@WmbULƒaUUU@mVUU™WmkUb™KmkkK@aƒkUƒ¯¥Uƒl—ƒm@akU@mš@KVIVV@KUkUVUkaƒUWb—„mƒIkaVaUU™@mW™„b‚b@bUlkb‚b@n™K@bƒKXVWnULkKUV@LWKknlxXŽVLml@X„Ž@lULUb@xVxVLVlVnUxK@LWlXnmV@x¯X™aWUUK@wVWUkÅçm`@mn@bUx@lmbUnkLÇWm@mšU@Ux@„Æxk¼VxVJ@„nbVlmbUmLklmškVlX@‚VœšV@°Þ'], + 'encodeOffsets': [[ + 118508, + 28396 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3609', + 'properties': { + 'name': '宜春市', + 'cp': [ + 115.0159, + 28.3228 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@VlbnK@b@JšLlUnx±ĀXxÆW„X@lš@V„@@blJ@nX@˜xUbVVUbVV@b—VmnmJœ„@bmbm@klUbƒLmbœš@lVb@xUX@bVVVbV¤@LVV„bXlVw‚LXÜÇn@@V„IlVškUx„x°J@XlKXLV„‚WnLÆK@bÈxUnVb„ylXn@Vbn‚W²XV‚LVVUŽnxWnnV@VVVšXVbn@ޚÆl„IÞJÆk@K°UUa„mVa@UUUš»@wV@VƒkkUKUVW£U@UmW@@aXkVUnVlKVV„UUkVmU™@kWaUanU„VVamIX¥W@@aUaUVW@_mW@UnIVVn@VbVm@bVL@anKVUkƒWK„UXV‚Ikx‚@na„bVK„b@nVJ„_V›@Vw„‚VUVVXUlUUaV@X@VblašbnKlkVaXaƒ¯@m@U„KVUn@WƒXkW@@w@KU@UƒWkUUUykkmKƒk¯K™U@akUmK@k@mmÛ¯V¯U@‚ƒL™¼UKmLbU`mL™xVnVb@`—LmUVUUWmb@nU@UWULmU@KnaUUmU„wmJ¯IUJWIkVkaWVUIUlWaUIUVkKmbUIƒÒlVUnnŽ@VlLUJ@bUX¯@ƒaWVUKUXƒKUbm@UwKWa@a@VkUWn™@Uak@mbX„WJXbm@mL—aWVk@™wƒL@WmanU@knwWmkaWL—KWUXaƒU@¥l„UVVVbnwƒ¥nKV™»@aUk@a@UƒJ@kƒmLma™@mbUWnm@ULǺ@LXnmxUŽm@UbkbW@@akLmWk@UXmJmUkV@VUXVlULmKUxkL@lmXnJ@X‚l°Vnb@bU@WbKUX@VmKUX'], + 'encodeOffsets': [[ + 116652, + 28666 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3601', + 'properties': { + 'name': '南昌市', + 'cp': [ + 116.0046, + 28.6633 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@šXš™„@„mš@VIUW@UšKVb„„LlV@VVbUŽlUnLnl@bVL@V°šUL@V°@Vln_Ġºn@‚knKnššLVU@VkĊ¥Vk@™Uƒ™»UaƒUÅLUalmkklWn@VUVIlm@m„Xn@VmškVa@KXIV™UWVw‚™²@m@U@VK@k@W™Ua@™ƒa@aUƒ™@™IUƒW@@bUJmbUU@kkV™mUaWwkbmLUVUn™lWbUbklmL™akbUaW@U@VbkVWVUUUVƒUx@‚Uœƒ`UI@mƒaULƒamb@lwJWUƒVXLl„UVmL@bUK@aUnUam@UUmJ@VnX@`UXVŽVb@bX@W¦nJUbƒUmVVbXb@lVšUnVlƒVUUkLmUUVWl@bX@VnV@X¤VUVLllU„U@@x™¼VV@V'], + 'encodeOffsets': [[ + 118249, + 29700 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3602', + 'properties': { + 'name': '景德镇市', + 'cp': [ + 117.334, + 29.3225 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VVX@Vbmz„xUlU@mbmL@V²xVbUVVblbX@šVškVykValKVI@bn@n`lVWnX@l„L@™WKnƒVIVa@¯nK@alIXJVIVWUw‚ƒn@nU˜„nK@alI@a@anKm_™a—™W@UWmIUwmmK@£UUƒmUUlwwW@km@kWaX„aV@VnVKnXlK@aUK@UnwWUnƒmIUW@¯mU„XI@alJV_n@m±@U@kkKUlm@ƒXamJ@UVUkƒmI¯JmamVXL@V›UkV@xƒX@`k_UVmJUXƒW™¼mL@bU@UllX@VV@bVV@bnJUnlx@n„Žm„b@lWŽ@zU‚nIlx„@W„bVV@bVJV@UxV@@X@VkLVôÒ‚šn@@b@`VX@J'], + 'encodeOffsets': [[ + 119903, + 30409 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3603', + 'properties': { + 'name': '萍乡市', + 'cp': [ + 113.9282, + 27.4823 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VWnL@UVW‚LXaV@@ama¯Uk@WmInW@klKVwnLVKUkVW@UlUnVnIVWl@nXlK@bX@laVan@VnwWm@KȹVK¯m@kmU@ƒƒ¥kIğ@WKU¥„@V_VW@_šK@aXKVL@Ul»mWLkU@am™kJƒm@kmU@@a@UmakwU@›„Xlƒ@VXk`UIW¼kWWX@‚œ@l‚xV¦XlW@Ubn„@ŽmUkL@UmJ¯UkUWVUaƒUlm@UXWl„nUJ@LmLU˜nXll@bUVUUmVUn„Ž@¦šxlŽnn@VÆÈU°kbV„VxllnL@VnVVUl@V„„anL'], + 'encodeOffsets': [[ + 116652, + 28666 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3606', + 'properties': { + 'name': '鹰潭市', + 'cp': [ + 117.0813, + 28.2349 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@XV@nlšL@lUnš„mŽ@Ln@@VlV„@@VV@nwVI@V„Vlx@bknlbV@nmnUVJ‚_²‚VxVLšw@mš¯@ÝXIm™nUWƒaUwkL@wVKlKXmw@±@U„KnUlL„a„KlUlÇXkmaUw@U@a@Uƒ™UkwUJ@zWJ™w@WbkVWUL@VmUklUaWakbƒ£kJ@nmln„lL@Ž™nƒ˜L@¦mJ@wU@mXkJmbƒK@bUL@VVn@`kXƒW@Xk@@lm@UX@V@b„lÜUXVWLXJ@nmb@V@l'], + 'encodeOffsets': [[ + 119599, + 29025 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3605', + 'properties': { + 'name': '新余市', + 'cp': [ + 114.95, + 27.8174 + ], + 'childNum': 2 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@m@@WULUKWwÅ»ókƒakkWK@bUVUIUamWUbULƒa@KUa@mJUbmUXU™mUamImakKmLUb™VUam@@UL@KƒKm™UUkL@`mIUb™@U„@V@bVl@bš¼UŽmL„¦mxUaUUƒVkŽ@¦„VWbXV˜LXKlbXnmx@lmVnb@X„Kšxl@XU˜bnKn@WaXIWƒnal@Vbš@XmlV@U@bXb‚LVxn@Va„LVWVLXU„b°@VW@aVIkK@UmVmkU„ÑVJnalLVUVJXbVkVJXUlblUXJVI°JnI'], + 'encodeOffsets': [[ + 118182, + 28542 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/ji_lin_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '2224', + 'properties': { + 'name': '延边朝鲜族自治州', + 'cp': [ + 129.397, + 43.2587 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Wxĵ„mš@„ó¤VX@@xܼƨš²xWxƒV„V@„XVƒ„„„ƒbWšXllaÞU°Ċ„@ô¼„LôÝWanV¥ƒÑnĉ°¥šÅX¥°¯@w°w@»°k£°mÈŹ‚mÈbƃŎ¦„K°z@Žkxl¦UbU¤šššklV„KŤÞȰ@@bšV@nVVUlÞ¦lUllœVlU°ÑU¯Vƒ°w„bXxl@VŽ²„˜@n„ô¼ƒó°™kmVk²ĕ‚w@wV™ÞÞ@@Ġƒö»˜¯œ@‚„šbnb°mÞ¯°V°„ÈJmX¥mam™UřƒUƒlaU¯™ƒ@w™Kk—l±n@@wƒkÝVUUl±¯I¯b™a™lƒ@™kLmakbƒ@ġƒŹé°™Þb°šékƒƒLm™„wX™‚aÅb@bVlƒbVb—ÒVbUb›UUanwƒakbVŽUV›ak„¯„UŽƒLmxV°UxnôŻX@J„Xkl‚bkbĉaƒbƒWU„ƒ@ƒk„WUU¯@@klmƒ@@™Å@aƒwWXlKkI@WbUaVIUanUƒƒ@ĕƒ¯K™„mUnWUwm@£ċèkUmbUmm@@nkJUalwk@@nmWUan_óaWmnw±KœIƒwl@UmƒI@an@@mlUÅmV_™KUkƒ@U`@_ƒKUmU™@U¯™mmb¯@kb™ImV¯ƒƒLkbƒKƒƒÛ@ÇnɱJóaÝĢkb@„›x—ÒÇllœ@‚Ž²V‚„ÆUVV„UÇ°X„óxlV¯„lV@bƒV@n—x›@—¤@„șŎnxV¼knšJ‚nšKX°˜¦UlnVbUbÆVnÞWVX¦llšb@l°œVJôÒnLVbšbXŽ'], + 'encodeOffsets': [[ + 131086, + 44798 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2202', + 'properties': { + 'name': '吉林市', + 'cp': [ + 126.8372, + 43.6047 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ôl‚zšaÈV°„šK@„mŽ—LWl™nšVxUV‚È@ŽÝĬUÈn‚ôLša‚„²VmĀkV@„ĠĊnU@b„V@b˜@nl°UVnÞaôJ@bš™V„¦mlkššbmVXx¯@Vxm„nbƒ„šbÈK‚V@bÈL„wĠyônšmnbÜ@nn„V˜x@n²K‚„„J@k„al@nxÞU„Lź±Vwkw¯LWWUš™kŎīVwƒw„°y„Vĕ°wÈVlkÛ»@wW@Uô£@ƒn™ĶƒXwW™aUamKóÑUI¯›@k™akkW¥XUmÝÅUVaUa‚mVk—¥W¯™Lm™IlmU»mwȚō@ƒ˜£kJUÇk@am¯y¯UVwƒa@wġx¦ƒKƒƒ¯X°Ċ¯¦U°ċWULÅa±b¯@UkÅWmVƒ™ƒkIUlóŽċ¹™`óIƒlX„WŽXxmbUƒLݏƒbƧ@ƒx¯bƒÈ—l@xƒš¯zƒaݤ@nšm„VWb²bmn¯J¯Ò@n„š'], + 'encodeOffsets': [[ + 128701, + 44303 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2208', + 'properties': { + 'name': '白城市', + 'cp': [ + 123.0029, + 45.2637 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ó™ǩŁ@WlwUaƑwÛÅÇéĉamKƒōÇ@Iƒ™ôġVƒȁÑŹçƒ™ÝUƧċĉwóóÝ@Ƒ»ğL¯ll²@ƆÅV@¦m‚Åb@nmlU²VxšlUn™@VbnW„bÇbk҃š„n@èlnlšU҄Ž°Lšx@¼ĉb@҄šUŽċxՃènLVxƒÒƒbÅJ±a@_ÅJÅnƒŽVb„Kl„nUÜĊ@„Uš™xXVÆn„mšVššJÞ¯V™ĠwšƒXw°xWL„x„KV¦ôU„wVÝǬóÞޙ¼‚‚„ÞkŽVôȘxބU„lVn¦ÞšĊa°w„b°@šbÆw„lŤL²`„z°@V@@™nJVnl@@¥nUmmn„@mwnmmUnk@mlwUaƒLnƒ›wn¯°anƒWakI„ƒÇmXwÆamUXUlJXa‚UUklKUknmÞV@‚K@VWÞ@VkUwVƒ'], + 'encodeOffsets': [[ + 127350, + 46553 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2207', + 'properties': { + 'name': '松原市', + 'cp': [ + 124.0906, + 44.7198 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„šźèȂÒU„óĢ„š@JŎȄ‚‚LnŽĊbÈêÜƃxVbkx@XǪłôš„kÞ`„šW„b@n°ašbšKšnVw°`š_X`W„š¦„ĊIkmVšakw‚K„x°UÞb„U@lšƒl@°¦œVW„šaÞbšxÞI@mVI@ƒVkŚUWK„¥nL‚a@ƒ„@ȍ„@°ƒÆ@nU@KÞalkUwVékUWw„™kU›VkkƒJk¯@»ókƒV¯ÆÇI@bĉô¯@™ķw¯nmmÅL¯wƒVƒUÞy@UówÇLkmm@@UóxkkĉmL¯wVwkWWX™mLõm@kűV_ƒƒô»ÛƒÆ¯@™Va™VšaĠVlmğwķUóÝƽ£ÇJkbǫaƽLW@nxݤkzƒy¯XɅm@VšôÇX¯Ė¯ºÝnUŽnLVlUÔmV'], + 'encodeOffsets': [[ + 126068, + 45580 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2201', + 'properties': { + 'name': '长春市', + 'cp': [ + 125.8154, + 44.2584 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„U°xÆKnn°mĸxš°@Ċó@aÈJ°Å„Uôl@¼l°„IllœUlVƒšXxlVUêVxkllnÈUVll@Vx²IÞ¤VUlVnIôlރlwô_„›„bVaĶLXÅÞÇ@K˜¯@wÛaƒçn¥š¯WXyW¯XwƒUmmÛ@ma™nómğzƒxÇK@aUÇL™a„ƒmanƒUw°@WwnU™al™nkƒ¥šU™@aóIÝbUm¯Vmk—@@aƒU@amVğĉ@ƒlUnÿ±Uƒ™bóKmVÇÞī@ÇVUUw‚™šmXk˜Kn@ƒ™L¯ƒÇU™byókōè@b‚n@lÝX@x¯ô@ƙUV_maXm@aóƒJWxnX@ŽVVnĖVnUJ@nōÆǼV¼kxƒLklÝw@xƒx@zV`ÅbmxU±xU„nnm‚kn‚ŽğU™bUŽ‚šUb@šÅ°Ü„󼄄U`Ʋ@lön‚KšnXWlXUx°xnKĊllôw@Vn@lnÈKôx@VÝz„V'], + 'encodeOffsets': [[ + 128262, + 45940 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2206', + 'properties': { + 'name': '白山市', + 'cp': [ + 127.2217, + 42.0941 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Ušl¦kÒÆ°„IlÒU¤ôz„¼lJš„U„n‚ÆXVl°@²aÆbVKČXV¯°¥¯ĉ°W„„„L‚¥Ģw@x„bUx°V°zn‚‚b@ÈlVŽlIœ@˜w@m„U@akU°ƒkUôwWƒÈ¯VUƒVUƒÅ±U›@kÈk˜Ñœw@ƒlaÞġƒUÞ£@ƅ‚KnÑĢ¯@W‚aUaVUVkkw@a¯@¯™Ý™ƒVXnW@@WkXmK@xkKUb@bW@Uw¯„mmb@WKUbmUbUaWbƒJĉIVW@I—l±LkšmU™bUm™@ƒnkKWa¯n™@„`Ubma™„ĉL@bƚ—@W`ƒL@n¯‚Xb‚@kb@x™Lƒ„™@V‚kL±™™mlUIU¥mL@lÅx@_laƒƒ@U—aƒV@kmmƒK„£ƒƒLƒƒmKUnÅKVbmXVlèĉUUbml„ĢŤƒIlŽ¯bǦœl‚@ô¼Ģ„@x°„l¤„n„a„l@x™b'], + 'encodeOffsets': [[ + 129567, + 43262 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2205', + 'properties': { + 'name': '通化市', + 'cp': [ + 125.9583, + 41.8579 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ÆlXnĠxĢ°lÈ°š„K„°kXm‚@¦Vbk„ŤJšnݤk„VÞVVkȄb°y„™@w˜k„Ç°a„wƨ@„aސ„K‚VnaWwXWƒ„kôJš_ČºôVkƒ»óyV£kуJůlÑk¥V™ša@wƒkƒbƒmk£¯ƒ@wġƒó»@›kÈ¥°ak„JÆ£ƒġnkVaĊVkçWUnUaÆLVmnL„„‚KU™±@—„m@a¯U„bmV¯m@_ƒK™™U™ƒaƒÅ™Wó¹ƒ@UanmWak@@wmI@y™@mk„JVa™@UaƒIkJ@n™@Um±kkxƒm™Ik„ƒbÇm@Ž°bXn„V@Ž°ÈmlÞ¼¯XVº¯Lm„kWWXLmVVlknƒ@@lnWƙ„Vxbmšnšm„¯lÝaVȁè@¼V„„b™„ÆŽ°ÞUVšJ„„kx›I—xƒƒƒIV¤™ÒXxmn'], + 'encodeOffsets': [[ + 128273, + 43330 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2203', + 'properties': { + 'name': '四平市', + 'cp': [ + 124.541, + 43.4894 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Ɇn°W„zlyÞ£mwX@ƾKǬblaÈIƾ¤ôÞĸVĠxnmmVƒ²w‚VnwÆaU_@y„w@wÞxlk„KlwU»È»ŎÅ@mVIUmmĕUU@mWXw„Iô‚@bWnnbU`‚šV@Å°ó@wÞW@km@aŎ烙@m°Ñ°Inm±aXaƒU™n@mƑšU¦@šÇŽ¯aU£šaU™ġ¦ÅҙJōUŻókUÇ@™¥¯ak¯mUVak@@aċçÅaUƒm¦Ý`XbƄ@n`ƒI™xĊÞōÞml@šUb@Wl™_¯JkšÇUÝÆÅb@n™„llUb¯„±a@ƒ—ƒWĉJġĀ¯™Unóšm¤œxôaVnƒxôI@x„V@bmƙ„@lnLmޯޙxVb¯þ'], + 'encodeOffsets': [[ + 126293, + 45124 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2204', + 'properties': { + 'name': '辽源市', + 'cp': [ + 125.343, + 42.7643 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@żôŎVšIÆÑĢ¥Vš™bV¤°bȍ@™V¥ƒ™Þ£lÇUUUÝlƒÞ£™mţIlƒUa@¥nlWƒ¯ƒL¯™kÇġ¯ğwWmÅk¯UƒVU„„bWlXlmnƒbUx¯xVVknlŽUbV„ÇKUb@„™VnbmlnzUº±bmJUbWÈnèm҄š@X`WL'], + 'encodeOffsets': [[ + 127879, + 44168 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/liao_ning_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '2102', + 'properties': { + 'name': '大连市', + 'cp': [ + 122.2229, + 39.4409 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@‚IÞmVk@wXWÜbnwlLnU„@‚nLlbXW@a‚wnbl@XL‚aš@Ċ¥@LULnJ@xVnmV@VXXV@VJkn@VÜKXXôJlb„xl@„IVbnJVLUbn‚lnVw„JVU@ƒXU‚aUUlwn@°ƒn„VKnV°_VJšwl@nwlV„IXWlIVVnK@IWmkIVaVU@WÈUlmU@U„WUalkXġŻ@kIƒ»mm™akUm›ĉUŁV»²ġVĕ@aUU؍IɃ`ȃ@kƒw@ƒUƒmwĉ™@ƒWķсIĉÇbÝLkymbIƒwÇmÛbmbU„¯ÜõÈkÆVbŎxnXVÆnšǪ¦„bš¤Uš™xÝnĉÒmĊVȄ¤Èš„bƼ„Ā„„ÆÆބźb„VVbX„‚°²¤'], + 'encodeOffsets': [[ + 124786, + 41102 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2113', + 'properties': { + 'name': '朝阳市', + 'cp': [ + 120.0696, + 41.4899 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@na@UVI@m„ÑW™kaV¥UI@wl@„aÈbšm@wVašk„@@K@kƒ™@a@UUmƒUUalmU@KÇUű¯@±kUKVkUaƒaU@¥m@@¯k@WLUmkn@mmIkm@amU@wVmkU@Klk@U—m˜aXIWWUL™aULVbƒmk@UUmUk±™_Uym@mbkImaX¯WW™xWKzU@WƒkJWwkV™@Um@UbVVVVXb@VWX—@WŽ@Vkb@V™nUK±aUUlwX™ÇWKknU@mmUkƒLUVƒVUUVƒUaƒw™bkKmwnIƒ™kJ@nmbƒ`kmVkLWwUm@UUU™K@UmaUa@UUaWK@mUƒ¯Wkk¯VmUUŽ„xVXUVmL¯ymXkWUbmXUKƒVknWx¯JVnkLƒl@VVxnxlĀVL²WlX„l@bÝVUn@bnlÜaXblIVl@šš@Ȧ@VmbXV‚@@x„VVnUn@`°@VnXU@K@„VV@VmbnVn@ln@b„xƒ°Ub@bšLV`Ånƒ„W@@lUšnnWVU@Vbkl@Xl`XxV„UblŽkX@Ž°¦V„UVVbUlkV›@UbVbkLUxmJkXšš@b‚bœxVKÆlXX˜bnŽnala@ƒUk@U„VVklKVUXKVU°KVan@VUnLšKVL„WVaU_@mmUXa@m˜wXwVkVWXk‚k@›„k@klm@wXKl@U@KVUUUVaUƒV@„alL„xUx@b°°VnnVšxlIXJmx„LUVlV@bnX@Všb„aVx‚@XJ@b‚n@VŽVXȄl@llX@lU„Vô°°@ބVbn@‚V„k„@VW'], + 'encodeOffsets': [[ + 123919, + 43262 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2106', + 'properties': { + 'name': '丹东市', + 'cp': [ + 124.541, + 40.4242 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lzXJ‚U@š²x‚@@Vš„@bUVmKUn„°n@lnVK„„nV@n@VlV„°WbXn@‚VzƒJ@¦@bkb‚bUl@bkbƒJ¯zƒWULWbklV„nb™¦VJ@„„K°U„kl@@W„bVn°@„Všm²U˜nX`„UÜLXmVXlKVbUVVnUbn˜ƒX@VUL@lUbWxš@²kl`n@Vlb„@nUVWVLVU@aV@²bl@ÈmšxWX„VÈU„JV„l@„„la„WnX‚KÈkÈ@Va°bÆm„@XV°IVV°UnalƒVUn@UwVU„@@VVJ„I@bl@XK@wWmXU‚UVbkJVXnJVI@mƒknwlKXL@`l@VI@UUaVKÞn„aVm@aÇ£XW„U@aÇUU@mbkKm£™@WW™ƒL@@Kk@kl›U—bWKUkUU¯UõÛƒmUUaVU„U@WU_W@kVkJƒ_WKkV@bUL™¯¯ƒ±mk¯ġƒğÑ@UmwƒKUakƒ™ƒa@a„m¥ÝƒIUWmk@w™mţ—L›KʝbȗKWĢklVbƒX@VV‚knÇV@XUVUblJXn@J'], + 'encodeOffsets': [[ + 126372, + 40967 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2112', + 'properties': { + 'name': '铁岭市', + 'cp': [ + 124.2773, + 42.7423 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@XJm@¯šmXUlnVbUJƒU@bV@UJWL@VXLmJVbkXlJXxVL@b@V@n@b@`Vbk@lxknV@VV™V@bUL@bV@@bVK@VXLWLXJ@LV@nbWJ@IUV„x@LVJUXVxVx@VV@@LXJWL@VU@@L@VnL@bVVmVX@@VVInJmbnLWVnVULVVU@VVmX@@JVz‚l@„nVVKVXރ@mk_lm„UUWV_nJlUÞÑÞVVUVƒVL„UVJ@I„Vna‚@@KV@XwWknwnKlalU„w„aĉݚwšJl_@aUaƒKUUU@WU@WXUÆ@@UVK@n@UnVVšblK@bœllb@b„bW@Xbl@UlnLl°°bš¦nKlVnI„V@UWU@WXkƒw@am@nm@aVw@I@KUaVIm±XÑlknJVnVJšaX_VaUaVKmwnkmmn@lU@U@mnašXlKUmUIVmklaUK@UlUVUW@U™kVm™a@UUU@JmUU@@bmb—KWV¯XUKm@ka@UVKVk@aUKmLkKUUÝUmbXbÇJ@k@WU_@m™™@klm@UXKVaUI@KWUXaƒÇWk™aWUkWUL±U@lUU@ƒUJƒI@V¯JmIm@@aU@Uwƒa™@UV@VkI›V¯aUkƒWkb@bVL„@@VVVUXW@Uaƒ@@b—‚ÝbUV݄@ŽƒLmUkVUbVllLUV@LššXŽWbUXm@U`@„kxlnnJlbnIllšLX„lVlUXmVK„n‚V@L'], + 'encodeOffsets': [[ + 126720, + 43572 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2101', + 'properties': { + 'name': '沈阳市', + 'cp': [ + 123.1238, + 42.1216 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ȚĊÜ°„b„L‚lÞxUbUn±‚@ÈnVÆL@xnLšlUVƒbƒxkImJkn@V±LUxkV@bšbšKVKnzVl@L°@Va„xÞUlbôxVVœ@@V±bnŽ@llXL˜ŽöXĶŽnal@nkVJVI@aU@@aVK@ašUUUU@lmkwl@Ua@_@a@m@U@aUKWwkIlWUanIWK@UXKVIU@@a„VVIUa‚mVknW°™n@WI@KUƒmULWnkVkUWƒ™KkkmJkamIkmlw@ƒV_n@VWXaW™™@KVUkKUkValUnV„K@ÞƒVUÞa˜@a„@VbX@VWUU@Uƒ@UK@ala@IkKmUUa@U@ƒVƒkk™WVwU_@KÜUXbl@V¥XUVmƒƒƒXa‚kŃlUUkIm`UIUJW@UIKmkm@UUJƒImmU@ƒVUXU`mIUbUK@LƒJUU™l@Xƒ@UbƒJ™kU@ƒŽn„m@Uam@@ƒ™aUmLKƒwƒ™mWXUK@kUaÇa@JUIUa@aƒKVUƒUXmƒUy™_@lmbkLUKWLX`‚n@bVL@JXL„‚WX@Vnb@Vm@UbnVmL@V@x@LUbVV@V@LƒUVl@mb¯U@xU@UVVV@X@VVblJ@bn„VKUn„x@llnL±¤™b@k`VXÆK@„kV@¼kl@bWIUl@VmLnbm@@JXXmb'], + 'encodeOffsets': [[ + 125359, + 43139 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2104', + 'properties': { + 'name': '抚顺市', + 'cp': [ + 124.585, + 41.8579 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„XVl°bœUlJ@UVUš@„bVxV@@bn@nJ°I@U„J‚I„VV@V@k²VVKlXXVšb‚lÈX„ŽWbXV@LVJUbWL@Vkn@lšš@nV`@X@lÈIWanaÞVVVlLnKVL@bUlUL@Vlbn@VL°WXU˜Lna@aV@nV@IVV@VšbUnšl@V‚XnKVa@U„UnyWkXaƒaVk@ašašbnm@_WKXmWanU@alaU—l@XJVLVxX@˜wnKnVlwƒƒ™@V_@a¯¥@UkKWUaUU‚anK@IƒaU@WUaVw@klUVyUUVUUÇ@Iôbša@mnUma@kXa@UWak@Wa—l@a›@WUƒLmU@U`mIUU™`mUk@@UUK±nkJƒbUam@kwm@@a@UU@Ua@@K@ƒVK@kmKU_UKƒUUaĉWmkkL@`™LƒnmlkLkbmK@k™@Ulmb@b™„@Ž„xUVƒIUlmVXXƒxm@™JUUk@WUk@ƒakx±@¯x¯Umb™KUUVmUU¯UmVVn™WkÆ„lWb„„„ŽUnWVU¦k@WaÛV@LV`UxšXllU„@„@VVbnVlL@J'], + 'encodeOffsets': [[ + 126754, + 42992 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2114', + 'properties': { + 'name': '葫芦岛市', + 'cp': [ + 120.1575, + 40.578 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ll°X„ŽnV‚@XLVb@VVbnb@VšLVV@VVnXxlKnU‚l„_na@mlI„šmJnxlLša„xVbU„VV„UVU„KVlnnV@lmXLšÈWŽkxVV²bVLšm@Ula@UX˜@XW@UWaUUUUVan@V‚š@lUXxlIX„V@‚yXLšw‚ŽXXW°nblJnan@Vzš`l²nVVVl@„nUaVKšbVKnXVaUaVUšyšnXK@kVK‚@X@m@m‚LXa„LWƒU¯„w@™ƒa@UVw„¥°™ó¯¯y¯ƒUǯ»›w¯Iƒm—¯Ç™UUl™¯»ţKċÑţķm¯w@mU_ómk¼VnU`±IkbVlƒnnŽU¼±Lk`@X™Wl¦UbmVUxkXVlkbllU„Vb@bkVmx@XVV@Jb±aULkKWXkWmX¯aUJmIkVm@ƒxU@n„'], + 'encodeOffsets': [[ + 122097, + 41575 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2109', + 'properties': { + 'name': '阜新市', + 'cp': [ + 122.0032, + 42.2699 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@šXnb°lš„VlnXVJ„LlVnl@zÆxnK@b„blKVLn@@V„aVLVK@L@Vl@XVVInVVKVwlUXwlKšL„ššVVb@aV@X„lUXbVW@n„lWnXKV@@V@XUVVLUVV@@bVVV@@ln@VbVUXV‚I„xVanJ@UšIVWšL@UV@@¤V@nInw˜W„k„lnIVx‚lnzUVÇJ¦VVÜLĸUnW@aV_šWĊXXa‚Knkl@nm™L™a@alUVw²K@UlmnIlJ„w„aVU™kmK@wÅKmU@DzVmVaÝwkƒKƒaÛ¯șĉķ¥ğ¥ƒ@kUWkƏī݃ƒ@@akU„K@KWIUm¯nƒU¯JmwUVmIkJÇLm@™UImJUU@aW@U@@nUb™JƒaƒbXVWn@UVmX@V@b„š@l@Lƒ@™lUb@x™nÇaƒbk@@xVJU¦lbXšƒÒ@nUJ@Vmb'], + 'encodeOffsets': [[ + 123919, + 43262 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2107', + 'properties': { + 'name': '锦州市', + 'cp': [ + 121.6626, + 41.4294 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nJ@nlmVnXKl@@°n@@¦‚V„bVbUlVL²l°@ƲÈV@LV‚knVb„VVnnWVU‚@XmWU„a„bšIVa@mV@X@@bVVnIVJ@š‚nÈKlInJVUnx°I„V°mVnXJ@LƒLlV@b„@ބƐĬXllV„@Ġ¦ĸ¦naWW@In@manK@UVkXJ@alk@»lU@ƒÅLUWl_@ša²£‚Kkm@kƒwVmULmƒ@akIUa@U@WUUVU™aÝ@ğ›wkƒƒmĉ£UWƒ@@bÇL@m—a@_mKƒlƒXUwKƒLţÓ@UWw@K@U„I@m™U@UV¥„@°UnJ°@@_™KUwƒW@UnaWUmmI@m™ķwUaÇLóVĵwݙUUW™¯šƒ¦Ux@V„b@šƒxV°X„ƒKWbK@n@nW‚@UL@lWL™m™zUVVbUbmWXXWJ—b˜n@Vkl@LlVUn@xnV@bln'], + 'encodeOffsets': [[ + 123694, + 42391 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2103', + 'properties': { + 'name': '鞍山市', + 'cp': [ + 123.0798, + 40.6055 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@l„œxĠŽÞ@šbV@@w°Vna‚@Uk„V@K@UUUVa@K@w@UnKmUVan@@Uma@UXWƒWK@IUK@amW_XKVLlKna@kmKVak@VU„@VmšU@anIÆan@‚a„šUVnb@blLV`ÞLlU„bna‚Kn@naVU@¥°IVK@anUUKVaƒUVak™@mJƒkXƒ™UVwkƒVUUa°U@Wƒ@WlkXWlIXUlJlaœx‚IVVXLšll@nLV@lLXl„KĊzš¥maUƒlkXaVK„X°y„Ila@aVkala@a@¥„IUy@WmXaƒ¯kU@U@mmUƒƒULkmm@ƒ¯VmnLVU@a™ƒ@U@±w@™VWIkymLUUkJWXƒJkUmxk@™xUI¯`mUULmƒ¯„m@kxVVbWV@„UVƒIUx@bkšVšVVšxUbVV@V@zšJVXU‚lnk@@lkLƒlƒLUU±Jkšm@UIUVƒLUVU@™K@UƒnnV@l@Ll„ƒaUJ@zn`@nWlƒIUVUUUV±Ln‚@nmL@VUVkLVlUxVLVlÅXma™@@akLmWUX@JUnVJVkXJ@X@`WX„VUVUIlb„W@bVUVL@`Un@¦U`@bUV@z@Jm@@XV`„LUL¯J@IVKmKÅI@J™nWVnLnšVxV¤™z@bmV@VUV@bUL'], + 'encodeOffsets': [[ + 125123, + 42447 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2105', + 'properties': { + 'name': '本溪市', + 'cp': [ + 124.1455, + 41.1987 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lb@Vn„lnVVUb@šVJ@nnJ@bmXUx@xVbkbkŽWLUxnl@Ul@„xWx@nUV@¼Ull„knkK@bmbnl‚LVJX@VIVJn_lJVVšXUmnU°VVVUnVVšLna°V°w²@lw„bl@XVl@VVšIn@„wWWnUVk„JVUƒw@šƒ@anaVkš@@lnLlalKnk„mšK@_lKnlĊXVb„VVLV`nL@lUL@„@L@‚VbV@@V@bn@lxn@Vb„alI²mVL@Vl@nVš_VVnJV_‚@nV„K‚V@Xœ‚@b˜kXbl@XblylUUkš™@Xa@UVIlK@UUWVU„Llm@UUUnKWU@K@UXm„XVa@U°KVUUWUk@ašUVKkaWkƒKUknaWa@U—@m@mk@ƒaUJk@@_WKkLmx„l@nUJmIUWlIUaVWVXn@xWLk@@aƒJUI@Uƒ@UVVxm@UVk„mb¯VUU¯JWUƒ@Ån¯aUbÇ@ÇlLmWƒXkbƒƒk@UƒƒIÇVƒUXW™wÇnk@±aU@@bUVUKUXmVƒ@kaUm@k_±l™@XwVa@kVK@U„Wm—VaUmVUUakLUWWnÛKƒVW_—m±V™nƒU¯@Umƒa@Xk@ƒl¯V'], + 'encodeOffsets': [[ + 126552, + 41839 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2108', + 'properties': { + 'name': '营口市', + 'cp': [ + 122.4316, + 40.4297 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ĊĖƐn¤„„°Ċ¯ŎWšô„@xXb‚wnKl@nX@VUVƒKmL@VU@Ux݄@Vlb„x„U@VUb@b‚kœ`‚IUlVUn„V@@UV@@JnXlK@bš@nbÆWUkUKVwUklKVU@UnK@mm²KVUVVVU„JXk@mm_@yVI„bkƒ@K@kmU„m@VšLV@VU„KVUVJn@l™²IVV„K„klK@kl@kmVUW™I@y@UUUVa™wUUU™l™@akmmVaUKmIUaƒJk@ƒwkaóIWWÛL@UlmUIU@WW@UnUUm@wmIVK@Kĉ¦™@bWKk@max@bWXkamKƒ@mVkKmxÛaWX@xUlÝnJ'], + 'encodeOffsets': [[ + 124786, + 41102 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2110', + 'properties': { + 'name': '辽阳市', + 'cp': [ + 123.4094, + 41.1383 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@š`Vz„‚Wn„VUV„L@bVbVJ@IÈbVb@lVLXW‚n„š„x‚LnKVŽšb@„n@Vbn@mƒ„V@šl„IVa„@@WškVV„I@KVLVanJV_VW„UV@nn„JVI‚Vn@na@alLlmkƒVk@»VU@mXwƒwk@@VmkVwXKllaUa@wVwnW@amI@mUI@™VaUUkmmƒ@UkaƒL@ƒUIĉyƒLWkkKU@mKk@™kWKUUJ›wkbkIWVkJWXkl@X„‚@X¯VVbUVl„UxšVW„„lnIš@l‚Ub„VUbVLmV@bUL¯J@¦UVmbm@LmbƒakVÝKU_kK@amaVUƒ™bm@ÅbmJ@b™VUnƒ@UVl@UbnL'], + 'encodeOffsets': [[ + 125562, + 42194 + ]] + } + }, + { + 'type': 'Feature', + 'id': '2111', + 'properties': { + 'name': '盘锦市', + 'cp': [ + 121.9482, + 41.0449 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Vbĸx‚š@nnJVnXŽmb@V„XVxšL@`¯@mI¯Vƒ@U¦@VšV@nƒJ@V@LXx@VŤÔ„K‚LVx„W„knL@`˜b@nÈK@a„@VXĊ¤„nVK@aVU@UnU@ašyU£Uwm™mKXUšm@IÆJnLUL@J°IVKƒKU_@Wn@@I@yVU@aV_@¥Vm@_UKUV@aƒXkaVJVUƒUXW@_@WWIUlUIVm@IVW@IU@@VU@mƒUVVkJ›_l@aVa@UƒVƒwka@UރVwV@@UnK„LVU@UmWk@mLxWa@wóƒUVUIÇÆĉ¦¯¦¯xʟJ'], + 'encodeOffsets': [[ + 124392, + 41822 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/nei_meng_gu_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '1507', + 'properties': { + 'name': '呼伦贝尔市', + 'cp': [ + 120.8057, + 50.2185 + ], + 'childNum': 13 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„m@Łkƒ™Žƒklƒôƒ@£kJ°ý™ɅķÑó¤ğLĉÅlÇğŁW¯¯›™ƥóÿlwkţÈéÝƛó™°ÞÅxV¤ĉĖWƒ¯lȭţυ̃ɱÿķƅˋğɱřÝţϙȍƧĊţ@¯kWKUKm¹Å@ķJU@ƧÑƧ„ō¥˹Ɔ@L@„Þ‚VLnš@VōČWJX¦@JŻbU@ţÞmVU@ȁýóbkWWLƒƒÅ™¯UWġkmóƒ±UŹôV¼ƽ¼ƒł̥ĖƽǬʉxĉŽŻȗKΕ̛ʵƨʟÞ˹»Ƨţ»Ǖō˷Ȍ±ȚʊĠUɾɜɨmÜ֞߼˸ƅȂ¯ǖKˢğÈÒǔnƾŎՂ@šĊbôô̐¼ƒ@ĊôĊŽÞĀ™xšĖƧL±ŽœŽ‚Uš°U„°ĬƒČ°ÜƒêɴȂVł°@ƒ„nxŎèƒbȄÞȌ΀ǸlŽ²IlxĊl²ÒmšôĖ™Èl„ĵºm„ÈêVþ„xɛČʉÇĵVmš„ÒƒÈɆôƐŰǀĊ°ÆǬĮƾb„yĊ@ĠšƒXǀċm»ôw°Ûk¥Çm¯ç™kkÇǫţǕéX_ĶWǖīŎaÆĵĸĊ@ȚȘ‚™ĊLĢĉ„VÆĉʊÇĕóaU¥šĉ°mkÅ°ġUĠřk°mƒÑČÿ˜ÛƒWĸ£ʠšÆxÈÞŎÞ»ʈ²ĊÇČalÒ°Ť±ĸz„ŽĊKȲm¤Ŏ@Ò°¼nyȂUźīǖƳÈē°@šÝĶƒ@ƒÈkl¥Ççkxk™›JXÇƒUÅ@˜£k»„óƿīÛ@lÅJl¥óý@¯ƽġƍÅan™ċ™°é¯¹'], + 'encodeOffsets': [[ + 128194, + 51014 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1529', + 'properties': { + 'name': '阿拉善盟', + 'cp': [ + 102.019, + 40.1001 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@™ƏnǟƨʫšŹɆÿ°¯ÆV²ˢ™żÿ@ÝÆŁȰ¯ȀƳĉó™™@ğkyš¹@īš›ƒwl£Źƒƒ¯Ŧé@™ÇÇxŋĉƩUUŃōL™Ç™ĵóÝnƒóç@™™ó@ġƒƱ„¥ƒç™WUçÆōƒ@é—çťK™çȭVһƽ̻aW¥ȁ£ʵNJǓƲɳޗǔlżÞmĠóĬȂɲȮ@ÈĢŮźÔnĶŻǠšŎȭœгŃċóȭţΗÆƑÞƧÅΫóȘǫɱȁġlÛkÇ°ȁÈnšõl¯ô„ÞɛÝkĢóWĊ„zÇɼʝ@ÇÈķlUČÅÜķnέƒǓKȮŎŎb°ĢǀŌ@ȼôĬmĠğŰōĖƧbЇƧōx@ķó£Ål±ĀƧīXÝġƃêĉK°Ýʇƅ@ΌʉżÅÒϱʈ@˺ƾ֛।࡬ţશóЈèʞUš¤Ґ_޸Ƒʠɽ̦ÝɜL׈ɛϜóȂJϚÈ@ǟͪaÞ»Ȯź'], + 'encodeOffsets': [[ + 107764, + 42750 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1525', + 'properties': { + 'name': '锡林郭勒盟', + 'cp': [ + 115.6421, + 44.176 + ], + 'childNum': 12 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ʶĬĊIȘƨƨŽ@ĬÛĢșŤĉĬƒĀóšU‚ÈŚÜènŦƐȤȄłϰUƨťƾÑ܆ğɲƜǔÈèʈƲĊƞƒšɆ¯̼V˺Ò˺ȂŤVĢêU܃x„Āˌ˘ƨ„Æ°ѢmÞżU¼ÆlŎ@ĊçŎnÈÒͪŎźƒĸU°lżwUb°°°Vš£ÞlĠĉĊLޏɆnźÞ„n¦ĊaȂīġŃ¯Iĉůl»kƒ„™Çý„¥Ŏ¯ƒén£ġљÝȭxƒÇ™@Åçķ»óƱŎ¥™çWÿmlóa£Çb™yVÅČÇV»ÝU¯™KĉýǕċţnġ¯»ÇōUm»ğƒÑ™wƏbċÇŎċwˋÈÛÿʉÑ°Łkw@óÇ»ĉw™¥VÑŹU™mW»ğğljVÿŤÅźī@ř¯ğnõƐ@ÞÅnŁVljóJƒwĊÑkĕÝw¯nk¥ŏaó¦ĉƒV¦Å`ğуÑÝ@mwn¯m±@óƒÛKˍƏǓ±UšÝ™a¯lƒōšșk„èƒĬގn@ŤġŰk°ċx@œĉ`Ƨĕ°@ţÒĉwmĉ@ƒƒnƒƒa„™¥ķnƒÞĉVóÆókĉŽķ@ÝkƧƧÛaƒ°Ç@ÝÈU˜óbݼ@„ÛÒV°™@V¼ˋL™ÞɅŤŹǠVÞȗŤÇĖŚōbȁƜ'], + 'encodeOffsets': [[ + 113817, + 44421 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1506', + 'properties': { + 'name': '鄂尔多斯市', + 'cp': [ + 108.9734, + 39.2487 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ĶL²ĬVłƑkkl@Ȏ™ŘWńÈĬȗ¯™ºlz@ĠššĊôŦô„ÒĠ°kÞܚ™n@¤„UĸèĸbŌÈXŽĸLlÒĢxɲÆ¤ÈÛƾJÈÝ°UšÅĶ»²VW¯ĸJôšbk‚V@ôlbnĊyÈzVôašb@ĸ‚ÞUl°yǬ²Ǭm°ššk„±lbn°@È»˜JX„VŎÑÆJ@k„LšƒÆl²™Ġ²ʊůĊġ‚řóƛÞÅ@m„ƒmLUÿóĉƧ@™»L@„›`ČĸmšȗÑţů±ĉğl¯Ā™wǎƒçƧŤÛI@±ÜĉǓçō°Uwô™ǫůķƳř±bÅ£™ÓÇwnÑó@ȁƽ@™ƒÇƧĢón»ŏĕóĊ¯b„Å™™VȯÅImƒōKU„™LǓ±Ýxċ—ŋ˜V±Āȗ°™„Źl±šÛ@WÒȁŚŹНŚÅèŌô„¼°ȰɞȂVĊ'], + 'encodeOffsets': [[ + 109542, + 39983 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1504', + 'properties': { + 'name': '赤峰市', + 'cp': [ + 118.6743, + 43.2642 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ɲŁĢljĊwƾōÞĭ°_ŎŃźȹƒUČÿl»¯ôķVÿǬƽ™ɅġÅÑǫ»̐ʟȣU™¯wVWݍÈġW»Þ¹m݃ɛŎÿŎōͩůV¹›ō™éċ™óŹÅVVĢǩʈ@Ėċ@ķšÛšV°¯xÇÅţ¥™»°Ûô™ĉʟ„¥WýČ¥™w‚灻±mnÅķ¥ˋVƒbUÒġ»ÅxğLƧ™ƒbWĖÅxš¦U°ÝVóŰlô²@š¥ÜÞÛô„V@²±`š¦™„™¯Ý@„ŽÅ„VÒō¼ôš™¤V²ŹĬÇĊƑƒţxƒç¯Lk»ʟlƽýmłÝÆƏ@mö°Ġ@ŚŹĬţÆUĀĠNJĠŽX¼šnźVUҚ¦Ċxȼ@ôlx¯łʊÒÜĀˌÇČxƍČÈƐašx„ÒĠŽn¼ŎVȐ‚¼Ģ°ŤmǖČĊþšLV°ÞŽU¼ċÈUƚzÈa‚¤ôbkŽ‚nXĀšè'], + 'encodeOffsets': [[ + 122232, + 46328 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1508', + 'properties': { + 'name': '巴彦淖尔市', + 'cp': [ + 107.5562, + 41.3196 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@²@Ζǀݴʶհĸ„˜ƒ¦Ķ™̒Uˌ¼ӾÇƾ¼̨UÞĉ˜Ƨ—éÝ»ƒĕĉ—ƐȍœōǪakó‚ó¯a@™ôţ™aV¯Þ¯°@²él¥ĵğťwōxó¯k±š—Vó@™aóbUÇyĉzmŽkaóŽU@l™aó‚ķIX°±Uĵ¼™Æ¯VÇÞƽIÇÜÅ£ɱŽġwkÑķKWŋÇķaķçƒV@£šmۙlÝğ¯ƒÑťóǿƴȯ°Åł@ÞŻĀˡš±ŽÅU¯°ɅĀ™źƧʬmǠšƐ'], + 'encodeOffsets': [[ + 107764, + 42750 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1505', + 'properties': { + 'name': '通辽市', + 'cp': [ + 121.4758, + 43.9673 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ôƲĸ¼Æèš@„ÈȮwƾ»ʠĢ¥VÆ@²¥@»Ŏњ¯ĊJŤ£k»ÆÇX¯̼ōšī°aX£ôƒƾȁź¥„ƒ™aôŤ™ĢL°ƒĸ@Ȯ¼ÈÒʈŚôVXůÆaĠƛÈKƒķšĉôÿ@ğÈĉ™»ÇVn™ĉV›wXĠÝ°šČÿĸwVƒ™¯¯ǵ±™ĉ‚ǫ™ÅÅm»²Ż±ƽIm¥ţÈķ@¯šƧJV»ÞUÝç¯UġºU£ţŽóaÅÅlƒƒ™Ƨī¯K¯Þ݃ğL̑ȍƽ@ōŎōĀƑɜnÞݺX¼ÇĢގUX°xVšʠȤ̏Ǭ¼ÆÒɆĢšŽǫƾUĀóĸ°‚k¼ċĀƑVŹȺōń¯`ÝĮƽŎĉxġNJɱłō¦'], + 'encodeOffsets': [[ + 122097, + 46379 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1509', + 'properties': { + 'name': '乌兰察布市', + 'cp': [ + 112.5769, + 41.77 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ʠǠÞĸɲȺƒÒȂƛŎaƙÈĕȘţUÝźǟɆţšÝˌKU»š@U¯ÜÑ@ƒÞ»ôaV—ÞÇÈ@„¯ÜbƨƨÞlĸ@ĊôlôÅĊU„Ýĸmš¦ƒŽ„bm„„„Ċ@n‚ĊxŤÑ@¯‚ƨĖĊ_@›Čwl¯™ƒȭL›Ý„»ƽ¯ķů„Ǔ@ÇǓbċ™ÅÅÆwÿĠÇU£óaƒ¥¯aŎğĠţkw°»¯ůlÝĵkǻݰɱƧǫaóôɱ»Çk¯ŃóƒʇŐŻ›ĉNJŻĢ„Ž¯ÒÈUl°ƒx°n„Ò™Ĭón™Ċğ°ÇŚĉ¦ʵVƒ°°ĬÛżÇJȁńʇʹó˂ƽŎ›Æţ¦'], + 'encodeOffsets': [[ + 112984, + 43763 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1522', + 'properties': { + 'name': '兴安盟', + 'cp': [ + 121.3879, + 46.1426 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ÆXnlŎ°@LVLĠþœxĊUȮĊnU„ĠV@żaW¯XIŎġƒ¥Ý@K@w@K@I˺ŻŎ¦ƨƒƨÒŎIÆ@X@VºnX°lŎ@ƾĉˤƒȘǷȘÑÝݚÞbVţĸÿŤxÈĖƐŽêÇKnĸ¥ô@›ķÞUnÒl@UŚaƒīˋƒ¯ÑƧx@±kXřƐƏÛéV™ˋ»lō¯ĉ„ÅÇÓǫޗĖġV@ğ»›°ĵ„ÇÞǓ¼¯m˜ÛÅŃĉĠÇƾb²çƒ™šéż¯VƒƒğÞml»ōÑV痻V¯™¯šĕÆU¯y°k¯¯V»ôDŽѰa@Źk™ġKţšóŽšbƒ„Ź¦ƽȂó„W¤¯b™Ĭ̻ŎW°ÅÈl¼ţ¤ĉI™°ōÒ@¼±¦Å@UŽġ¦ʟŽƽ¼šÞĢÒm¤„êō°ƒ¦Èþƒšl„k¼ĊŰ°JĢńȁĬ„°ƒżn‚ÇbV„ݼ@¼óĸţ¤@°Ånšl'], + 'encodeOffsets': [[ + 122412, + 48482 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1502', + 'properties': { + 'name': '包头市', + 'cp': [ + 110.3467, + 41.4899 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@źxżĀǔÆǬVȘĀŤ¥œÅƾōôˁʈͳȂŃÈIÜŻ¯ī„¯ōm™¯ɱĖ¯ƒķÒÝIÝ»ÅV™ƒlÅôфġ™ğVmÞnnƒWçkW܁XƝÆwU»Șĕš£ĉÑ𱱚Åk™„ƒK@lÅIō҃UW‚—IǼ¯@m‚kaƒ²™l¯™ǫnǫ±¯zkŽÝVķUô™˜l²ô°ŎwŦxĶĠk¦±ê¯@Ý°U°šbóŤ@š°bôlôǩb›ŎƏȎĊ˜„ĖÞ¼˜ê—ƨÝĊ'], + 'encodeOffsets': [[ + 112017, + 43465 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1501', + 'properties': { + 'name': '呼和浩特市', + 'cp': [ + 111.4124, + 40.4901 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ʶUĊ¥ÈřĠ¯šĉômšīƒÑ¯m„wk¯ÇV°ÑƒżġĊljǓɱţǓ›ƝóX¯ƒɛÒóa@nÝÆôƜŚĉĢʉŰĊҙ¤ȗĖV¼ÅxWƞۂlXXèm„ÝmUnšĠƒĢóÒkƚ„ÆUÞ¼ÞJĸÑ°„ɲĕš°Ŏn'], + 'encodeOffsets': [[ + 114098, + 42312 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1503', + 'properties': { + 'name': '乌海市', + 'cp': [ + 106.886, + 39.4739 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Ș°ÇīXњŗ@ȍlkƒlUŁ±īĵKō¼VŽÇôXĸ¯Ž@šťê„°ź„k¤„x™œ@Ĭ'], + 'encodeOffsets': [[ + 109317, + 40799 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/ning_xia_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '6403', + 'properties': { + 'name': '吴忠市', + 'cp': [ + 106.853, + 37.3755 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nLV‚@šVLšaÞbn@@l˜š@bUVlUV„zVx™¤kÞVèšXnš‚@nm°a@UƒÑ„@VŽXnV@Va„UšŽVKUUU@@U‚@@KVa@U²@‚wXkWnk„±lLnU@UmmVKnIVWnI@UK›@UK@@UVKXkmWLWUXmlkVwUyVa@w„w@aVI„K@aVÈw„KlLVV@LnV„VVnU‚ܲ°WÈIUÆ@nÞ¼‚‚@¦™@UÞUVW@UxUxVn„b„K‚b¯ÞU`VbǬ™V@XXÆVVl°InmnUôƒ°¯‚anam£œWVX‚KXmškôaVU@ƒVak@@wmaƒn@K@UÛUWKXUƒÇƒ@UI™b@alW@akLUKV@@Ukw±Iš›nL@kmwkWmk@JUIƒůVmnnU@m@UƒK„VKlkUwkƒƒnVUKmbkI±š—KƒkmVkKƒb@U@aƒVkUmn™`kIlaUK@UUKmbUIݚUa@mUa@aƒ„m@UUULUK@bmKkbWI@WXwlkXƒWa@k@kKƒLVkkK@L@JUVmzUKlwUUnW˜£XVlKUwVU@aXI@aWaUw@W@_nam@¯‚UkWVkUWaU@nwmJkUVkWVUmUkJ@ImbUaƒ@@WÅ_mJknmak@@mƒXƒaUV@„ƒxUšƒ„@‚ƒ„@VUnkVƒ@Vn@`ULUbWLXVW@kbUJ@XW`@ƒnÅĖWJƒ@—m°@xƒxšbnUa‚w²lƒÞ°xŤIVVULۂWbšbkVVXÆ`UbVL„@kx°LlV@Vœ„WbƒJn@bl¤ULV„°@lmL@ƒƒ£U@@aUwmKULVxUVVx@„™@kU™@mK¯LÇa¯@'], + 'encodeOffsets': [[ + 108124, + 38605 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6405', + 'properties': { + 'name': '中卫市', + 'cp': [ + 105.4028, + 36.9525 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@°@Èb°KnLš@lVš@@ƒUwVUUwVKnLVx@bV@„¤@„nK@k‚¯UƒVKk£@a‚m„IXa›ƒ@UkU¯Klwƒ@UKVaÅ_UWlU™aXa܁VKUUţJ¯w„ݱkxVbmŽ™a„w@wn¯˜„@XIÆĕ„m‚@X_@WVIlaX@WUXKVaVK@_Um„@lUVm@U„ƒ@„ƒV™„w@ƒVUÛwm@@W@ImKUkU@Ua‚aXƒ@wWaUKkw@UVaUamLU™nk@»±`¯@k—W@Ua™ykbƒI„„@VWJkLWUkJƒwU@ƒn¤mL¯wm@Umƒ²XVWbnV@bmxƒVkxUblLUV@kVWKU¼ƒŽkUƒ@mn@JnV@bUnmJUn@„k‚@XlxšLVVnKlLVV@š@LkKULVbk`WL@lkXW@kVƒ@UÞUlÇX™lkaUbmV¯@@L@šƒV@bkb@xƒlW„—bƒbW@—±@UJ@IU@mVk„VxV@@l„Illœn@Vm@ƒVUbl„@JLmKÛXmVkU›KULU`@LĉwƒKUX„lVUl@Vb„JX¦̼bÞxŎxɜĖĠ„Ŏaô@'], + 'encodeOffsets': [[ + 108124, + 38605 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6404', + 'properties': { + 'name': '固原市', + 'cp': [ + 106.1389, + 35.9363 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@Vnn@°xnK‚£„mV@„xlIXVlKXI@Uƒƒ„JlašzVbX@l˜°@²_@¼mlVšnKVbUb@VlxVLXb@xW„bVbV@VlnL@J@Xn@Üx„b„W@nl@nblmnIÆ`@X„@Vbna@aVUUWVkƒ@kbWakbU@VwšW@_l@nmn@@alVlk@UkmVak@@a‚UXaƒL@¯@KVa@axWI@KnkVaVJn_lJ@„X@‚m@nVanUVb@mXLlJ„VWnLla„VVaVX@KXVVkVKlknKVa@aVU@KXb@klJUknUmƒ@K@_UW@alIUamaU¯kJma@IUK@U„@@UW@@aXLVƒVJVaXIƒKlaUkUV@ambUUJkIWJ@wUI™V@JU@UwV@@Um@™nU`@UkUmVUxWUUV@aÅb@aWXkKUUƒUUaWK@wnm@IVU@aXwm@UmVaUalk@anKUwlƒUwlkK@wmaƒUkmmIk@VmkUUbW@UVUnW@kV@xkVmbVnU‚™@UbUV@a›k@kkW@„kLW¤@„nV@VU@W_UV™UU`VLUV@IUVõVULU@UUUJ@wmkUJ@šWI@l@bkKkbVVƒbVbUL@UUJ@Vm@@L@xbVVVLVlVwX@Vb@bmUkbk@@JWIUVÅw@Km@UkWKXxWLÅ@UVUnWK@xkVW„@KULwWVXVWzXVVKVXkV›V@VUbV@U„VV@š@LXxVL@V„b‚Ž„LnKVLVxXVmb@l'], + ['@@@J@aƒU@LWK¯UUxVVn@Ġ„„LUW@UbUUUa@KUX'] + ], + 'encodeOffsets': [ + [[ + 108023, + 37052 + ]], + [[ + 108541, + 36299 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': '6401', + 'properties': { + 'name': '银川市', + 'cp': [ + 106.3586, + 38.1775 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@šUšwVK@UVWÞUšbšw„V@knV˜@@KU_VK@K„ƒn@W_XWlL@Vn@Ċw@Ulaœ@Wanamī@aƒ»ŋó@aÆÅɲÿUaV_°ÝaƒLƒaUmVwVwX@VUVݚ@@¥Ý»@mVÅÇJ¯XÛ±VUmƒUmU@KUUkKƒLÇxUŽ@bƒLUJ@bƒx@xUbVzUxklWnXV‚KnXWlUL@V@ŽVLœ@VL@ŽmJUXmJULnn@VmVkKƒ²mlXWlx±@@VUb@L@@VV@VVUL™ƒVUbU@WmUƒ@„Ò@V¯bmn@VŽƒ„@lVnUšnVWŽXVl@¦VVUn@x‚š@‚XL@¦‚lXxš„Vb'], + 'encodeOffsets': [[ + 108563, + 39803 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6402', + 'properties': { + 'name': '石嘴山市', + 'cp': [ + 106.4795, + 39.0015 + ], + 'childNum': 2 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@U¯ķó±ÇÛ¯™ķmbXb›@kb@Vĉxm@@UkKWXX`m@ƒ„@LULV`@L—@mU@lƒU™x™aÝVUX@VUL™x™VkLWVšš@J„nVLXVlŽUV@zl‚VL@V@b„„n@lU²WVLlLVbUŽVxUx@xǀL˜xôҜk‚K²ŽVa‚U@wXa@W™ÈĉUa@‚bÈk„m@¯'], + 'encodeOffsets': [[ + 109542, + 39938 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/qing_hai_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '6328', + 'properties': { + 'name': '海西蒙古族藏族自治州', + 'cp': [ + 94.9768, + 37.1118 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@„V£°š@laœXô±źwš™ô@„Ulƒża܍n™Kƒw@U„aƒ™ša²L‚mÈLƚÈxlaUa„wÞmÜbÞUšnJ°a„kôƒ‚ÑkwÝVğwÇ@ÝkkV¯¥@ò„»„nŤ¥XImw@mVwša@Åw™mLkaW—wƒ¥l»kçƒó„»@ƒWÑĉŽğ@ĉ„™‚Ń„UwóřVómĵ»™™Ý@VǕ¯kšÝĊÅk™°ÓUklkU±šI„ÇÞkƒ±@šƽJƒ™@UġIk@W¦™VÑșÓÅnťKULnŽ¯X›ƒ@¯mUÛ@WřmóKknōbƒxÝ@ƒŽU@kw@ÿÇLţšÝUkšmwƒŽk™lċVŚU¦™ŽƒLkUWlÅÑ@aƒ@ÅѱUóġŹ¼ƒÈĉmŻ@@wkw™Kl¯U™ġ@—„lÇU™Ó¯_ƒ‚Waĉ²Åló¼VbknƒKǎÅ@ƧĢō°Ý@ğ„W™ÅxUUm@™‚ÝXۂW„ULUè¯@mbUaƒLƒbUWġxIUJWz™a¯b™y™@ōÈóLU`ÇXUl™UĉV¯n›mÛbǕLklƒUĉVƒšóaġ„ƏbġKţnkbÝmmnÝWȭȃŽÝXţWókUÇl¯U¯‚ġUɅĀ@°¯„„š¯„VÆnmJ@ĊķnóJUbÝXUlVškL@lVxnnmb@¤Vzš`ÞÞŤ@„VnÆJV„°b„UôJkzlŽkl@²óš@ÆÇ°kĖƒšÇbÛU@lmb™XV˜kzƒV™ŽɅĀXˢlń„ĬŹ@›éÅ@ĉńÆ°ğbUšlŽɜ_°‚@xŦ˜škbVbƒKĢ„ŤVŎŽ°@żÈźlĊ„ôKôb@nôxŦ„Æ@ôŽŎL@þÆb@šnnšWˌbÈx‚InaŎxlU@Ѳ±ƒğVUĢƒƨbɲ@Þ¥ôUUķWVô¯ĊWʶnôaŤˁ@£nmnIôŽǪK°xUXô@Ŧa°m‚kXÆÞVŎkĊ°ÞLȄôyVašIlwX°UVwĢÑÜKôw@nV@œm°nmŽn„Ü‚ɞ£VbmŽXnƒ°ÜÒ@xx@V‚b²UlbkxVnšJUnVVĊ°KȚm°nxÇnn¤±¦@ŽUXVV@„lV„„bmVVȁŽVxšÒ™°šIšbźaȃšbVwš@šƒVL„™ƾÑ@ƒŦô¯ĊkôÑ'], + ['@@„@šƒ„@n„òVœa‚w²bVxšxÜaČVô_ĊJšIVmšL„a°@Ŏ¥XlK@ƒšk„l„KVbUb˜@nUĢn‚aÈ@lmǬ»Ġ¯œn‚mnƒƨVy™Ñǖ™Ġ»ɲInŽ‚@@ÅĢƳ@¯°™ôV„KÈbVIÇ¥¯@Ýó„™@ÑnīWKšƒk™‚k@¥š™¯™Åa™Xƒ±VÅw@±Ġ¯@»™š™n™Wmw@ƒ™@¯ƒVƒUUWçƒKĉ„a±VkkƒV¯w™x@šUJ‚x@bknÇb™mÅ@Uw±U¯¦UŽ™Kmš¯I¯Žť¼ğĊ™@ǃŹÈ¯@Ý»ÇnˡJƒbÛèÇnƒ„ÅK¯„ġĠŹW¼Ålm„@¤n²ƒŽÝb@b„š¯lƒ¯@ƒšÅ¤W„™¼nV@x„„°@Vx„@lbUblbX¼W‚œšÇ²lšUŽ@¼ŽV¦@bÇlVxUbVxÞbVšœbm¦ƒVV„'] + ], + 'encodeOffsets': [ + [[ + 100452, + 39719 + ]], + [[ + 91980, + 35742 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': '6327', + 'properties': { + 'name': '玉树藏族自治州', + 'cp': [ + 93.5925, + 33.9368 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ɆÿĢV°°VÈklVôŤXÞW„ȮÇÞXnmÞnlaŤmĢLƐaĢƒôb„™ĊU„VlkǖKÜaœn°mĊUšVVkÈWV_ôKŎǚ@šz°ašbXyVI‚JĢwVX„a„KVbna°@VçVKXƒÜÞWšn@VVÆwXšĠƒÞ@Ŏ¯ƨġÆ@ȍ„LlmUaô»ÆkĊ±Xb„°`šÔV‚kȘƒĢ@Všk°šLlx@xż@Ċn„Çź»ôĢ²VÆ҄@@bÆÒXklV„KšV¥Æ™ČUšk‚l„nxl™çƒ¥ċç@±m¥ƒwÅJƒ@™™™Vƒ„mÈIléÈa°U¥™™@kÞV‚K²ÑWƒ°w²Ñ‚K²ñšyƐ„ÝšVmw„»kkWĉ—JWUƒVÅwƒL™mÅ@@ƒmw„kn¥Vу»°™°@@»„¯„Lla„JônV‚UůƒU@W¯Umѯ¯k@WykU@¯„wV¥ƒkVwţƒk»šwWǜĉĶçšK„ƒÞ™ÇaĉbƒI™lUƒ@kwƒWƒXUƒ°w™±@UšKn£Wĉ—KWxƒkĕVƒšamwXw™@™„Wmnk@aƒVkƒ™bĉLƒl™Imm„wUÇ‚Wx™nÝJn@¥Æ™kwƒaXƒÜĉ™¯ÅV¯¤mkƒx¯kķܙ²VWôŹVUƒƒ@V£™¥@ƒ°wn@™m@¯@UbUôķŽmn@ÆÛ@ÇýVaUÇĊVƒ@Çlğ—¯xÝŤ™lVÈÈVƒx„ƒ¤Vx™„kK@™@ƒx@„kVƒĖġ¥kIWbXŽŎx@nƒxÅUW`ƒ_—@±ŽUa™LUxƒK¯„WbkVlb—bmŽƒLÛÆWIUwƒWkwÝV@kI›ŽéUb›UUk™V¯Km¯k@Umݐ¯m¯›m—L›Þĉ‚ÛUm™ġ£UxkKm°™Lw›šk@kšƒVm„ƒKVUk›@¯a¯Ģ™móKUU™x™ImlÅn™™ÇbXèVVU„°„@ŽšŽ@„‚xXnmš™ššŽ@¼ğ°@²ÆxU‚„²šWÆb°š™š@¦llš™„XLmĬ@҃šÞô°@ȦUJÇaƒLóU¯š@°ġƴ@Ɓ@mɱJğ¼ǕššÒUzƧ‚m„n›mğ°ǫ¼knÇ@bġmmV—@VaUaƒLƒk™l@„kLW‚ō¦¯@ƒb™KUn™JĉIó`ċUÛb™wUw±ax›bñUmƒƒ@™„ƒ@—bƒaƒbǏÅXm˜„ƒÝ„ÅôVbގ™bl„UšÞVޚ„U‚°„VUxƒ@U„V„@l`™¼nL@Ċ„LW„„¤kXķWġXUVVVķ„UbVb@°kVVxÈa‚@ȦĊbšaźJ„U@Ț„„˜Vœƒlš@XkôaWƒĢ™Þ@laĸUÆb²mÞLĠ™ÞÑôbšÒĊa„JVbm¦'], + 'encodeOffsets': [[ + 93285, + 37030 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6326', + 'properties': { + 'name': '果洛藏族自治州', + 'cp': [ + 99.3823, + 34.0466 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ÞVŤ™ÈK@ĀlxV@„Þ@„wŎalmôLšnXÆÜ@nV‚°@œ„°WmVKŦLÆmȚԂҚUX¥l@ĢJVš@„ŽƾI@w™W°™™Ån¥›kÅÝVwôƒÈç„@lÑĊĕša„JnaÆLVw°kny°UnkÆVȍĊll¦„Vƾ@@™nUźƒÈǂIn°X„wÞKô¦VWV£„@£°ókċ±I™™am¯Va™»ČĉV¥°™@m„k„¥l@„Ċm@ašU™mwXƒ@wÆxšmĢ_„`VnÆbšKVw„@@ƒnUVğVmVVöIlŽl@@çÛmƒ£UDŽw°@VUƒ¯»m¯ƒJōĖÅLƒa@»ĉĢ±`U_k`ÇçšóƒkX™lK@ƒakÝރš£WċkÝ™kxƒJݯÅw™xķxmIÅx„@k±J@ýŋš›¤UœkŽmV™°ÅÝxkwmġƒnÝVU„š¦ƒŤlmšóXk¤™UKƒç™@mVkK@klīƒ£mš¯VUbƒW¯¼ċb¯ĵam¼mVX„m@k¤ÇX‚ÇbƒUƒ„¯J¯„¯È@˜™bVXVҙ¤V¼kxݚV„@l‚V—„WxÛ¦Wš¯šmKnlŽkŽ‚šU‚@nƑUĉ„Ý@ǺۄċUĉ¥™UƒÞŏ™z±òL±Ò¯xX„±ÒLÝU@lššV¦¯‚ÇbkêÇJƒnU„šš@š„‚ÆI„xn¦‚‚@²Č脦‚è'], + 'encodeOffsets': [[ + 99709, + 36130 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6325', + 'properties': { + 'name': '海南藏族自治州', + 'cp': [ + 100.3711, + 35.9418 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VxƒŽńƒš@ĊĠŽĊXÒ°UƾĕÞm°£nb@‚@LUUW„Ûº@nlÆǬšĠ£ÞV°UXb‚VȂǵ„éƒ@kWanm°@™x„z„K°¯ĠVšƒVƒkw™Lnm°kÞxÆa„¥@‚wnĉƏ@™œ_l›š_VwšmĸèŤÅČU@™˜Wn@ÑmKU™nğƒK@ƒ°¯UÿV£nmšLl™„UƒUÛé±óókkmƒnƒakV@Ç°óÝXƒWəÞťIţxmm™VÛUVȂÓnWyȁĉkƒVš°WnkĊa„¥‚_œK°ÿWna@ƒmU¯wƒlÝIU¤UXó¥ÝLƒx¯WmJÇÈŹ„mV@šƽ@ƒUk¥ĉkċŽÅUml¯Vmz¯lUxÅKmbƒI™bĉĖk҃@Çèó„UxÆޜlm¦šÆ¯ššX@x™Ž@Ž„²ÝlƒÈ™JV²klVl¯ÔlšĉƙްlUǖÞ@ššĶ¼nŽUôôŚ'], + 'encodeOffsets': [[ + 101712, + 37632 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6322', + 'properties': { + 'name': '海北藏族自治州', + 'cp': [ + 100.3711, + 37.9138 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ōmġxƽUm±Lǿþġԙ@kxmWƒb¯I¯‚mIUx@bƒbŹVǎƒkĵbƒlĉI¯¥ƒUšm@ƒÆ¯È@šašóšUlƒČ»@w›œ»›wXaƒƒó°ţç݄kUƒaV¥ÅbÝw¯lmnšKlxU„™„ğU¯°ƒLƒyšw¯@mnXb‚l„@ƒêȁǶUWa¯VÝUğ¤ǫ™kÅ@mܹXƒVV@K@ma¯¤ÝnƽĖ¯V@„ƒ¼„ôlèk¼„¦˜xXŽlbnKšÆx@Ž™bUx@nnxWJţ¦ƒmƒ¼ñ@Ž°¦lUÞlÈ@ĠxÞUlxÒó„ƒl¯bmI™ŽÝVÛaÝnƒxVbkbÇwřÇKn±K™b„šƒb@V„xšLmŽÛŽŻbk„ƒVó@™šŹxó²›Wkb™@¯U¤ƒźĊ@lUX„°lÆôU„ƒlLX‚aœV°wšxUb°xÜôÈKVkÈmlwškÈKšwšK™™VUŤĉŎ»„»„Il¥na°LV»²¯Üy@wĢƒ°ĸwlwĢw°±„_lVkš@°ƒbƒÆ¯zƒ‚„š„@l_„@Ģ±lŚVlUaރ„LVƒnKlnȏ°IllČa˜wÞÑ°x„UU™@wƒVkmĠLô»„KÞýôaÞ¥ôĀÞmƁ„™‚mUƒŎV¥Èl°²°a²¥V„@@w„amm@Ñn@Æ£żƒVƒĠ£@W„¯Þƒšl@š»@Uk@'], + 'encodeOffsets': [[ + 105087, + 37992 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6323', + 'properties': { + 'name': '黄南藏族自治州', + 'cp': [ + 101.5686, + 35.1178 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ôl²ôÜê„VƒVkš™KmnU¤VĀ¯°@„„LmĠVšnLÈL@alb@al@n°Vš_XmWUÈamaVIn@n‚aV£œóVWƒ™U£°ašxÈ¥@™‚aĊwȹ@óša™ƒğbm@k„w@mƒaÆw@ƒ„In¯mmƒ@UkkWƒÑÅ@@kċÅçVkÝJÅkVykŹl¥@¯š™ĢU܃X¥òý—mmX™ÝÅlmU@£™Wly™XW»Åbƒl@aI›»k@klm@UxUUƒVƒ¼¯Xƒl™aUnķ‚ƒI@x™@¯„ƒK™„ĉUU`óšlČ¯ô@¤ƒÞJ„k°xVŽ„n@ŽmbXŽ¯Ā›L`ƒ¦ĉbml¯X™ŽUŽl„ȂĊXzm‚ȁÔU‚ÜVšUnnŤwŦJɚ݄XÞW¯ô@ÈlU„b„mln'], + 'encodeOffsets': [[ + 103984, + 36344 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6321', + 'properties': { + 'name': '海东地区', + 'cp': [ + 102.3706, + 36.2988 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@҄bš¤ÆI°ôU¼š°UŽnnWx™š@b¯L@lUUWbXxWl„ƨnxVUllš„XVŽUŽnL@lȀý²KVnƾ‚ĢwV»ƒ@mÞ£nÆƒÞÑmL™ƒKUaVżĕƒWVk²ƒƒÆÝ@ƒXw°@„ô™@a°wóUUmIk™™aVmÞwmknyƒ¹VÿƧnŏm£X»˜™naV±„Ýw@ašb@aƒm¯„ĉVó¦kÝWKUU@WanU™b@ôǺĉxb@šÇ¦™w¯bV¤„šUX›ôU¤bmm@UJnbÇbXVWn™`¯Umk@@bka@bÇK'], + 'encodeOffsets': [[ + 104108, + 37030 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6301', + 'properties': { + 'name': '西宁市', + 'cp': [ + 101.4038, + 36.8207 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@kmKVUƒWk™VkUmwƒƧXkWwXaVV@k°K@aš™XwmmV™¯V»¯óÅJ™£ƒamŽ—X@šċVţÆķç™nUx™`kœ›`@šÅmĊx@Žƒ¦U¦„blVރŤèô¯„„Wbœx›¼œŽ@xċ¼k„™V™ô™bÇ@Å°@„™n„V°¦ĊJ„kĶa„lȍźU„a@aVwnJ°°J„anXlwš@ĢÓ'], + 'encodeOffsets': [[ + 104356, + 38042 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/shang_hai_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '310230', + 'properties': { + 'name': '崇明县', + 'cp': [ + 121.5637, + 31.5383 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@uŏu»GPIV±ÐɃŜ{\\qJmC[W\\t„¾ÕjÕp‡nα|ěÔe`²„ †nZzZ~V|B^IpUbU†{bs\\a\\OvQ’Kªs†Mň£RAhQĤ‹lA`GĂA@ĥWĝO“'], + 'encodeOffsets': [[ + 124908, + 32105 + ]] + } + }, + { + 'type': 'Feature', + 'id': '310119', + 'properties': { + 'name': '南汇区', + 'cp': [ + 121.8755, + 30.954 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@`y”ĉNǕDwǏ»ƒÖLxCdJ`HB@LBTD@CPFXANC@@PGBKNECCBB@EBFHEDDDSNKAUNBDMNqf[HcDCCcF…@EFGLEBa@ACoCCDDD@LGHD@DJFBBJED@BGAEGGFKIGDBDLBAD@FHBEF@RFDMLE@SGANFFJBANPH@@E@FJjRIACDMDOEKLFD@DbDAJI@AP@BGHFBCBGDCC@DCA@CECGH@FKCEHFJGBFDIHACEDNJDCVFBDCRKRLDLITB@CjNJI^DBCfNVDHDFKHAFGDIICDWBIF@@CFAjFJNJBBHD@CJ@AEFJ@@DH@BFBCPDBMFEQGDIFCNDHIP@HDABFACBJFHEBSZC@DP@@JDBƤ~'], + 'encodeOffsets': [[ + 124854, + 31907 + ]] + } + }, + { + 'type': 'Feature', + 'id': '310120', + 'properties': { + 'name': '奉贤区', + 'cp': [ + 121.5747, + 30.8475 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@~T~JjZdDbLXDLCB_J@@FHFZJJIAGH@HGR@BENBLID@@LFCDF\\FpDBDb@FAHKFE†@dEDDdC\\GreNMACVMLBTMCCFCEGFAA@DAFDLMHA@OD@BMEWDOC@AS@KGAI_DcKw„ÕísƝ‘åĆctKbMBQ@EGEBEJ@@MBKL@BJB@FIBGKE@ABG@@FMFCPL@AjCD@ZOFCJIDICIlKJHNGJALH@@FPDCTJDGDBNCn'], + 'encodeOffsets': [[ + 124274, + 31722 + ]] + } + }, + { + 'type': 'Feature', + 'id': '310115', + 'properties': { + 'name': '浦东新区', + 'cp': [ + 121.6928, + 31.2561 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@EN@JJLNHjLJNR^GRYVBNZJRBV@PDvbLNDN@LGNER@nCNQNuT_TIVFV\\Z\\XnDrI|[Ʉś²ÏJUHOƣ}CA@IO@@CYDATGFIEDAEBBAGCO@GJMCEDCJRHEFANOCADAEG@@CI@FE@BDIC@AGIAIMiEEB@DE@AJCXJDCJEHGBELGCUCeMAD]CIJiM@DSAKJKCLQDQACUECDMIFCBDJGECHAEIWCK@GLMCCGEACNKCEJG@MMBMC@@CIJUINT@JAJSTEPZZCP'], + 'encodeOffsets': [[ + 124383, + 31915 + ]] + } + }, + { + 'type': 'Feature', + 'id': '310116', + 'properties': { + 'name': '金山区', + 'cp': [ + 121.2657, + 30.8112 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@L@BIHFN@@EE@@EFBDGDAADVDD@@EF@CA@IIsRE@GDAF@BF@CV@|FBCHBLCNHAFCADBMDCFZXHILBVEEQA@MWFARJJ@DCX@@TEFBLHAAERE@AJABRPBNK\\BrJ\\VHGND@CNADKDADQjGAGNC@GJ@FCFFHC@JF@@dLBDSFADHVG\\DTEPDDHJALIJkJDJCDIPE@YDCBiK@DONE@EH@BAF@HLJA@EIA@ALKNA@@FIFAFHR@NALadsæąyQY@ƒA±DʼnXUVI^BF@FFF@HBJEDFFGFEBSRkVEXGHFBMFIVW@GAEEFOIAIPKABGWEKFSCQLQBSEIBC\\FdBLRR@JGACFDDEF@AWB@LJJYNABBA@CUEGPaO_AIE@MYMFIGAEFECHSAAKAO\\[JEDB@E@MMA@@AGBKMGDFFCDDFEDFJF@NPBAFLHFH@EDDHBADDC@DDCDHHCDDFDABDAD@FEFOBCJ[D@HEDDNJBDDHABJIBBvGLBJAH'], + 'encodeOffsets': [[ + 123901, + 31695 + ]] + } + }, + { + 'type': 'Feature', + 'id': '310118', + 'properties': { + 'name': '青浦区', + 'cp': [ + 121.1751, + 31.1909 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@RUNKdOFDJCbRFMLAHPLDN@JGL@@APBWYCKN@TU@SHGCEJIDIJKVIZVNM`iNY@CIE@CA@KBOEGEUFCCSADEIEFCDDDIDDHC@CKIeDCG@IG@DHWFEEGCH@@GO@@O]CNpeEQDBFME[JC]DGF@CKOA@QSB@GB@@GW@@ED@AQIJIAAFE@@DO@CFI@KNG@CDACAFEGKGBEGBDCCAIFCCLIECFI@MBCLDHGNAHSF@DMB@EEKBA@@C]DEICFG@ADBHGFKCDAKKHKD@@FHGAANGEEFCHKCECBCKG@ADKCNE\\[A[I@@mGBDQQEO@BCE@AI[AML@JGACLOAFKEMM@EQKC@CUCBCCBCHEA@FF@@FM@GEAJK@GNF@EXPH@FD@M^@HIADJCFDBER@DK@@DE@CAKFOCCBDHIBCNSB@GFC@GQEEOWFICGDUAEJIDBTAHJHEB@DIF@NE@H|HBDBEH@DKBAHEF@HEEUB@FGFGCCCE@AHOB@NH@PRLVNNFBX@RC€PbAvMtBfH@DJF@ELBFA@EH@HNED@FFB@HLC@CJ@@DJ@PIRf@HE@CFF@GPHD@DKE@FFBEFFD@DEFCA@DD@IjCRFBAHFDKD@HF@@PM@H@BlbDJDBFEF@DLXB@HCD@@IFCBIFEJD@FDC@FBALLF@PAACJERACAJCBD@EL@JD'], + 'encodeOffsets': [[ + 124061, + 32028 + ]] + } + }, + { + 'type': 'Feature', + 'id': '310117', + 'properties': { + 'name': '松江区', + 'cp': [ + 121.1984, + 31.0268 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@DLDFRN@FNELPBDKHB@INK\\BBJF@ADP@RFCRHA@nJ@B\\[\\MFLDBCH@DLDADFGLEDFFMHBBGH@EC@GLLLCBLDHEAGBCH@DEFJ^C@DB@LAFFA@CNE@GTMBGHKCAD@NEJFDKJDDJEDBCDHAAFLHFHBEBDDCH@LMJ@DEP@@CF@BEJBJIBRC@@FX@@HA@@HTA@RPBDLE@CHD^\\INFAERCfFMo^D@PP@@HG@HDFFXECGH@@JDHfCLJ@DGDCCCJCCEDJFCFTBDDVEHFPFLAB@NBFCFKFC@CHIACNOHWHCAAFIDD@CDAGEI@ACFMF@R@R_@GQED@EGFEQEDE_IAHKAEXCQUOQCUDEN@ZI\\DDmAMHCICDSOC@EG@BKHIGMIBCGOCSF[CUHCGEBCTKA@cE@@IGDEEEDI@@HMDBHiHCRCBCLMB@DMCGH[UqI[AMLOAAQIB@BQFBFGBAKFE@SW@CDI@QIEBNXB@FRUFKAGJYWDENCCADBBEMGKDGAAD{EU@@DAEE@CB@HQFJt@JDBE@@FC@'], + 'encodeOffsets': [[ + 123933, + 31687 + ]] + } + }, + { + 'type': 'Feature', + 'id': '310114', + 'properties': { + 'name': '嘉定区', + 'cp': [ + 121.2437, + 31.3625 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@F@LI@IDKJADKIEJICADGACFECCJ@HKCAFOHAJI@aCBEE@ICAEB[GFGCKL@FGEIFADMLCAEJM@ELQECEIG@BE^QKKLQCA@EHBIGQ[GEHOMGGDHKH@JOECFCjCBEFDNCACMBCILGTABDLEEOEIG@GFIMM@CGKFBFCDE@@GEAGEEACIcGaHMFITIHDN[AKF@FS@OA@BK@IHM@KCGOKBENaQIDECcPMLQVFHFB@BFBKLGD@FAJOVGIACQ@A`LPCB@JEF@RU@ANS@@RCL\\HIFpRBFRBBDKLLDADJDGBFDABHBEDNF@DGBBBADKDAHC@\\JJFBDEH[DEFDH\\LX@XLBLbT@DNJLDCEL@VJABJNDHB@HBHYFBAA@GNFB@@AFB@AFABFLFBHFCL@HJBAFBLC@DN@HN'], + 'encodeOffsets': [[ + 124213, + 32254 + ]] + } + }, + { + 'type': 'Feature', + 'id': '310113', + 'properties': { + 'name': '宝山区', + 'cp': [ + 121.4346, + 31.4051 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ˆmÖoÖiƒ½[s[YEUJU`SCIEBCCWJY_LIICDWU@@FaBCJIB[ICH[@@CDKEE@MK@@IMCAEBCH@AMFI@SMGEFGB@FK@BHCAIFJNQD@FEBDFMBKGACG@ECWH@@CDDTOEEBGEK@GC@EE@GPHFR\\JHGA@FDBKRLL]RAFH@FJFDKR@FINBFKDCNEBFJEHK@DLEH\\HFADB@JFFDA@bIJGBEPDBGLI@DDEFBDCHDBIJJFCLIBCL@JKJE@ADHDBHJ@HIBBDFHBBAEIJ@BJFAVL¢ˆ'], + 'encodeOffsets': [[ + 124300, + 32302 + ]] + } + }, + { + 'type': 'Feature', + 'id': '310112', + 'properties': { + 'name': '闵行区', + 'cp': [ + 121.4992, + 31.0838 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@T@@ELE\\BCMJGJSNEbGdHDJFBJAFIEIFCEWG@@gMENSFCVJFAxR~B@IH@AIiI@GE@FGEAFQPDRiV[\\DFSGMHAXHDOMCJCDETBBNVJJI@DD@ANNNH@FILDDMFBDHNDHKL@XDFGLD@EHGFD@DDB@CDDHCDAEAHG@ABOJ@BIaC@CECLKPFNCDCJBiQEIF@@@OGBMIAEEBMTHF@NKEC@QFEGA@EBCKAACHCLJHEFHHB@AFCAIEACIC@HG@KCCDC[ECEED@KC@KJMAAFQ@GHG@BHIJYIGE@EI@A`KDWCaKcCiY}I}S[CYJM@CFDVPRRVWDFžLBBG`JCFRFEFFHC@RF@HQ`Q@E@ENBDJ@HFCB@DCCEJBBGDGXMPBDGJ@DEDELEDMA@DJF@DMZ_jMNYUUJILCJIJDFGH@TSVM@DLXZ'], + 'encodeOffsets': [[ + 124165, + 32010 + ]] + } + }, + { + 'type': 'Feature', + 'id': '310110', + 'properties': { + 'name': '杨浦区', + 'cp': [ + 121.528, + 31.2966 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@V@CXJDKJZ`XIDDFADJvSRMDM@mFQHM@KCMKMuaOCU@BDAJSX@HKJGD@PNJCJWAGT@R'], + 'encodeOffsets': [[ + 124402, + 32064 + ]] + } + }, + { + 'type': 'Feature', + 'id': '310107', + 'properties': { + 'name': '普陀区', + 'cp': [ + 121.3879, + 31.2602 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@F@@FHDL@HFFAPFCSDC@@XGFDH@BDLHNACEFA@ERCIMJEDBAGL@@EHAFENHHJ\\ONQBQCIBC[MKACKI@GGGH@I_G@CW@[DMHCDIBMTDHN@JNHEH@FJFPKFACSBKHDJNABDMDECAFiDEDFDIPG@GLHCNH'], + 'encodeOffsets': [[ + 124248, + 32045 + ]] + } + }, + { + 'type': 'Feature', + 'id': '310104', + 'properties': { + 'name': '徐汇区', + 'cp': [ + 121.4333, + 31.1607 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@RADL\\NCPHFfLJaJ@FWLGMGIK@IFMDOYYFOTSBI@IMSAMSACFIDNDCPWGGBHNET[CU\\QjOCERFBEHF@@HjJBJG@@J'], + 'encodeOffsets': [[ + 124327, + 31941 + ]] + } + }, + { + 'type': 'Feature', + 'id': '310105', + 'properties': { + 'name': '长宁区', + 'cp': [ + 121.3852, + 31.2115 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@HFFB@HF@DCAELENSJADCNG\\CX@@D`H@JHGHHJ@BINBFUGEDO[MCKQB}AwQEBUIEDMTNF@hH@FXEDFJEJIB'], + 'encodeOffsets': [[ + 124250, + 31987 + ]] + } + }, + { + 'type': 'Feature', + 'id': '310108', + 'properties': { + 'name': '闸北区', + 'cp': [ + 121.4511, + 31.2794 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@CSG@BQGODUPWTOBQAAFMECKBGEMFKEOHADDJARMR[PGI@TEJBNG@ADBFND@JL@@NFFCL@D\\@DG\\JJADI'], + 'encodeOffsets': [[ + 124385, + 32068 + ]] + } + }, + { + 'type': 'Feature', + 'id': '310109', + 'properties': { + 'name': '虹口区', + 'cp': [ + 121.4882, + 31.2788 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@bA@E@QHSXBDIMI@OHCLI@GTWBIACQAYIOFGCENBBARSPOXCVHPARH@DT'], + 'encodeOffsets': [[ + 124385, + 32068 + ]] + } + }, + { + 'type': 'Feature', + 'id': '310101', + 'properties': { + 'name': '黄浦区', + 'cp': [ + 121.4868, + 31.219 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@NEHFLAFDHDPEAMZUHQQ]IMKJG@EPERABHBGRUCCNGV'], + 'encodeOffsets': [[ + 124379, + 31992 + ]] + } + }, + { + 'type': 'Feature', + 'id': '310103', + 'properties': { + 'name': '卢湾区', + 'cp': [ + 121.4758, + 31.2074 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VDHQGABAFQFOH@LIiKKHEXI@IbAFZB'], + 'encodeOffsets': [[ + 124385, + 31974 + ]] + } + }, + { + 'type': 'Feature', + 'id': '310106', + 'properties': { + 'name': '静安区', + 'cp': [ + 121.4484, + 31.2286 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@DLLB\\NPGLFHUDMYABEeKEVMAAJ'], + 'encodeOffsets': [[ + 124343, + 31979 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/shan_dong_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '3706', + 'properties': { + 'name': '烟台市', + 'cp': [ + 120.7397, + 37.5128 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ŤLšLllVń²è°xżĢĠÆl҄šŤbœ„V¤ĊXnŽlĢVĊ„Òš„È°ĊŰÞè˜L„±@џn»VUźċ²»ÆkôVɆkĊŃ²kŤVVwUUVmUaƒ@KkU@ƒmUmmk@UwUkmW@UVIXa@ƒmw@a™KULƒaƒx@Uk@UbWU@yULmK¯@kXƒVUwm@@JUUknWKUVƒLUbU@™wWykIƒa@w@mUI@ašUVynIWa„k„@@W„bl@@knmƒK@wnIl™°Kna@V¥ğ@ġUķ»™¥@UōJƒX¯¤k@™wmI¯‚k@mwƒak@@šlX@bUJ@VƒbknWxkLkxlŽšLVlkLmŽšb@bU@ƒbU@VbU`Vb@n„L@Žmb—U@˜VnUVmnU@mm™@kIUWVIUK›VkkUJUnmL@VmLUaVWaXamU@™™U@KUUmVƒU—JƒU™VÇwğn™mƒ@mXĉV@l¯xnô'], + 'encodeOffsets': [[ + 122446, + 38042 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3713', + 'properties': { + 'name': '临沂市', + 'cp': [ + 118.3118, + 35.2936 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@˜bXlƒl@zlV@lXXmŽkbVVlš„U@Vn@@Vmb@XšKšVX„WJ@XXl@„‚ŽÈbVLšUl`„@XXV@VVUxVbUxVbš¦„@‚WnXVJ@bnVUzl@„°Æx„U„KlU@mUUnUlUVWVUnVV@XX°V@Všll@Vk„aXVl@Ux@bmbXLlKlb@b@bUJn@@„„b@n°x°K@an@@UlLVKVbXb@bVVnK°LVa@UVa@™Xw‚KVxnLšU°@naV@UWUkWƒULmV—wÝKUUla@aó_@mƒK@aUU@ƒWUkwVm@aVI°W„@@IUw@a±¯@¥kUVUm@a‚wkw™@ƒK@kVKk@maXalI@alL„WXblaVLVU„V@LnKš@„l@w˜aXašLlnUl„LšmV@n°J@_VmnIVym£UKmI@WnIVm@anUVmÇ_kġIÅWUXÇm@U@ݯÅ@ƒ™@naWƒ™IVW@IkK@klKn@naWIƒmk@ƒaƒbkKkLWn™WkLWmk_ƒ@UaVƒUKmLUw@mn£WwUmU™ƒaóV@UkUm@UKULUwmJUX@WW@XҙzVblJXŽWXk@UVWK—X‚¤UL@xU@ƒ@ƒVUaU@@XmVkLmWkXUyÝLmKXnVŽ@n@l™x@bWLnVVn™`knULmxUl„„WLXŽVb@VƒK@z¯x¯¼Wx™KUn@bk@ƒlƒVVVz'], + 'encodeOffsets': [[ + 120241, + 36119 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3707', + 'properties': { + 'name': '潍坊市', + 'cp': [ + 119.0918, + 36.524 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@l@@UšK@Ž@L@bX@@VlL@JƒLUVnX@`ÜXn`V²mJ@bU@@n„b@l°xnnĸVƚ°@„ƒĊ£Þ@lWnÑnkʶJmó°w@kk»V@»ƒ¥k@V@kw@wVm„a˜Å„mšaô£ŎƒXI@mln„Kla@mV_UKƒ@kUkw@alW™IU»™mƒ—@WUIl±UUÅU›bkJƒ@a@wUKUaVIÆmXIWaka@m@Ul£XKVw@ƒUIƒJUkmJ™ƒVkU@a„ƒWK—ImVƒ@UxmL@bX`WXU@U`ÇkUak@@°UblXk‚mLUKmL@VULóƒƒVk@@Vlbn@Ub@ċaUJUbƒIUlVLUVVbVKX„VlVXU@mb¯@™VmKUwLWx@šUb@VUb¯KmLUU@aWaUaULkK@Vm@@b¯L¯w@mƒa@ƒm@UUU@U¦lJUXƒVƒmkb@nm„XVWŽkb™IVxUV@VUbWLXVƒLW`Ux@nk@Vn@x@VkJ@œV`mXkŽ@V„xV@lVššI@VULš˜VU„IV`°bVXXx„V@VWVnL@xV„Ub'], + 'encodeOffsets': [[ + 121332, + 37840 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3702', + 'properties': { + 'name': '青岛市', + 'cp': [ + 120.4651, + 36.3373 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„@nU˜JXLƒ„@blVU‚š„nIVl„IVJ@„UxWLk¤@V@nlbXbWJÅnUJVbVL@x@b„ŽlIœaÆVVVk²VJ@X„˜šnV¼šJkX@blxlV„@VLU`@nkbƒLkm@nWJō„ó¤™bƒn—ƃbUn@xlxU@l@„¦@¼UŽl¼ĊUnW„@šnĠmÈxšU„V˜I„VnUVV@LšV@šnVWbXb‚UVbnK@UnKVmVIllœUVLUJVXlJš@nnV@nmVUUm@—˜Vna@ƒK@mUaV_UaV@„aV@@a™anlKUk™KklwlKXwlm„a@UVI@akW@™l@„bnxl@°nJšxl@°£„WŎIUÑn»lašmô¹Ŏ¥VaUUkƒmkġWɱIUUŹ`›@kk@ĉƨřV¥_Ç@™Ĭƒ¤ÝL¯m¯£ƽóķwUW±ī¯kōaĉĕ™kğmó°ƒbW@UKkLUaƒVmz@V@ŽUxVn'], + 'encodeOffsets': [[ + 122389, + 36580 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3717', + 'properties': { + 'name': '菏泽市', + 'cp': [ + 115.6201, + 35.2057 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@¥šIVUÈmÞ»@UlU@Un@VW@UVmkk@aVUUKVÝ@UVknK@UV@VVnIVƒ@wnƒmwmKXaWaXI@UV@Vy²blkVKkam™U@kb@Um@VmUkmƒKmkXKWwkU@Ulƒ@UnK@UVUUm‚KXwšUVL„w‚K„U„@@Wl@@wUkV¥—@@I@W@_V@VWUw@UUa@aƒaWa—@@_mKUw™l¯amzmV—@WK™nU@kƒWLķaUKbÝVmV@UWÇbÛ@ƒX™°UbW@XŽm„Vlk²UJUbmLÇxÅWUzl‚¯Ll„@VkK™XUbWJ@bU@¯@™ƒkbƒLmKka™„@l™_WšXºVbUz@J‚n²V@¤lX„Ž„nV°šLn`WbXLôVlKVUšxXn˜lXLlU@bVV@„XJWLUVnVV@„„@n‚l„°nn‚V„KÈbVXÆJU°VnXV„kV@@xVL„@šWlb'], + 'encodeOffsets': [[ + 118654, + 36726 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3708', + 'properties': { + 'name': '济宁市', + 'cp': [ + 116.8286, + 35.3375 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nam_nKlVLXa„Il`š_@KVVXI@m@w‚ƒ„@@k@Kšnô@n`VbV@@L„L@KVVn@VX@‚VL„Jl„š@VUUƒU@Uam@Uk„wšKWaXamkJmIUVUÈblašUnV@kVKl@@lXL°kVJ@VÈnVJUX@V‚LXl@xVLnU‚@VK„V@a„IUaV@„bĊU„x„K‚kVJXUlV„ƒ„UVašI@WUI@KlUnw„mWk@WXIWƒ™U™L@Wna@Um@@UƒVk™UUlanWW@kkU@y„kWk—aWVUlÝbUU@kƒJUIU@@ƒ™JmaókƒLKǃUUkKWLk@WbkUUaƒbmKn¯°¥V@XwV@VanaVaU_@Wlk@WÈ@VUÈVVۂm„aklKȯlLVUX@lK@aX@@kV@VmV@VwnJV_UWUwƒX™am@kW@wVUkKVIUUVmU@UV@IVK@aUL@aƒV@Lm„UKmx@ŽômLkUWJ@šnXmlUxUL@Vkn›VUšU„@V™L™`Ub±LkV@kUKÇbÛ@ƒU™Wó_mJƒ@Wk@@Xƒ@ƒVLƒxUK™VWxLVnUV@VmL@Vk„@VlVXxWLnl‚Ln„VlUnn@@VlaV@nšlbULkl±aUzU@@VWJXbWbnLnxm„@xU„mJUUU@@VmLUl@VUÞVLUV@bllUn@VUXm@@VkV@VݼÇnUV™J@¦nnƒlnVlL@„Þb°KVV'], + 'encodeOffsets': [[ + 118834, + 36844 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3714', + 'properties': { + 'name': '德州市', + 'cp': [ + 116.6858, + 37.2107 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„¤@VmbVXnVVbVJššX@Žll@z„lVInl@„@bVxUbĠ‚l@Èbla„IšxXVWb@L™@n‚ULWVXXšWWLnL@`@LUVVL@lVn„JšU@UUk‚a„™nš‚Vôô„b°¼V‚ސXš˜‚œIÜbČa˜bôW„XÞWÈzÆmnLVJ°ÈnlV²lbnW@™@UƒUV™šmnwmkkKWƒkla@mVIUKUa™aUwmn™JU@@amIk@@bVlkX@mmUklUUƒƒa@_UaUUƒV@wƒw™WkXmW@I@WUaÝU@UXaWUU@UUVW@UUUWUn¥nUVa@m@k@alU@wk™LWa@UUm@@wnmU™wla@anKn_@alK@ݙ_ƒ@@WUUUmlkaƒIƒyU@UwU_Wa¯yU_mWUwkImm@InWWUk@@UVWV—kW¯U@VƒL@b¯b@l±¦@šVV@lUbV„@škxVnUšl¼XV@b@lV@nIWxnbƒ‚™@UU™LƒxÅxm¯ƒaUƒ™wU@mUÅVÝKULm@bmKUXó@'], + 'encodeOffsets': [[ + 118542, + 37801 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3716', + 'properties': { + 'name': '滨州市', + 'cp': [ + 117.8174, + 37.4963 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Vb@`„bV„kVlnV@nlWUk@al@nJ@bV@šInmVxšbVbVLUJ@nkb‚lX„lLnlmx™nUš„V@V@šmXn˜lbĸ@nnVx‚b@lnXV@UJ@nVxšxnxVbÆVn¯ƒĕ‚@@wÈçUÇlķVIœb‚@„Çmk@¥k@UkUK@aWakUóJW_UW@wkkWK@U@Kš@XUƒƒUkmUUalKXala@U@kkWlkÈl@kšV„mVIVmU_‚a„ƒƒwnwVW@wƒwUƒ@wU£ƒwkJWIyUI±bk‚VUJ@nmV™Ukl„Xmx@lnbW„kVƒUkLWŽƒxkKUUmUkb™J±—LÇxUKmkUmkkW™™a„mUaVkšJÆ_²KĠ@U„W@w„U‚¥nUWwK@aÝUkÅVaVK@akLWƒƒƒ¯I@bnbVx¯JW„ñšWbUL@šƒŽnV@VmbkUUV@IÇak@@bWak@WJUœJWL@bXV@„‚@„V„Jlb@zUlUŽUImšnbV‚mz@°UV@V™bV@@V@L@xLmKUnmJVX„J@VkLW@UVUL@b'], + 'encodeOffsets': [[ + 120083, + 38442 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3715', + 'properties': { + 'name': '聊城市', + 'cp': [ + 115.9167, + 36.4032 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ô@VWnL‚an@VKÞLÆUnVV@šxV„„bn°Æw„wšKVVš@„maXwmJU@@k@aWUk»V™Umlw@™UƒVa@kUU@™²¥@k°a@a„K@U›ƒU@mmm@ów—ѱ¥¯@@w™Kmw—I›¥kU¯UmakJmIUaƒVkKUkm@VUUa™Uƒ@UaƒKUK¯@™w™UVŽUIUKVw™k™¥™wƒbVŽ@xn„@lWnXxlL@`„XlJX¦l°XxW¦@¦Ul™n@Ž™@@Um@@VXVmx@¯bllUnUJ@VULVn@b„xV‚VL@b„„VlnVVblV„ÈnVlIVJœLô„lJ@xl²„'], + 'encodeOffsets': [[ + 118542, + 37801 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3705', + 'properties': { + 'name': '东营市', + 'cp': [ + 118.7073, + 37.5513 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ͬUǪlô@°Uœw°ōĠ¯š»Ģ炻XÇ@w™wƑa™ÇƒkwVƑ¯@řķUmm¯w@kƒa@mV@@anIU±m_ÛW@_mWVU„K@IkK@UW@@a@K@™L@Vk@±U@UV@lm@mUU@kLm„„xV¤@xV„„x@xUXmx„xƒ„bV`UnUJƒn™U@lÇkkllX@l@VkbWbkLVbnVVl„„WV™@@L@VXLll@xVXX`ôIlVXb@bVLVll@@¦nlƒÈ@›aUJkĸVÈÇè@x'], + 'encodeOffsets': [[ + 121005, + 39066 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3701', + 'properties': { + 'name': '济南市', + 'cp': [ + 117.1582, + 36.8701 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@²¦˜Òôxn@nn‚@V‚œ„°VlXU˜UX@Vl@XVmX@JnnlJVxnXV`°zXbV`VxV@„z„JlbkŽVnVV@X„@š`@ÞkL@bm`mL@bkbšxnVm@xn@VV‚@XbšKl@xkV@b@l@nUbmVm¦XVVV@VUXVVV@XVWb@VÞVVb@X@JnXlWšX„x@x„UVV@aVKVUX@lK@UƒIUWnIVmnL‚K@w@K@UU@ša@UVU@¯nyUman™VJVVk@ykaƒIƒU@@ƒWU@aXK‚IV›XIl@Xb@al@Èb@JVUlVna@UmU„@™VKXaò™Xƒ°IUwma@aU@UU@wVW@фw@a™I±`kbƒUkw™UmJ@UkmÇUUkmKknUVƒ@mJUkaWkƒa@KmKkUƒLmyXa¯_@WmImmbƒLmUkVUbUVƒJ™bƒUkkWJkUƒl™IUm™k™Lƒ›„lK@knaVmkI@mWaƒLUK™UU@@VmLUVLWK@UUUƒWUkkVmx@„Vl™¦'], + 'encodeOffsets': [[ + 119014, + 37041 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3709', + 'properties': { + 'name': '泰安市', + 'cp': [ + 117.0264, + 36.0516 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@n¼šŽW„nxšL@x°@š¥Uk@ƒnwlUVl„XVV@VXL‚KVUnK@UV@šVVL„KXb@nlJUnmb@lkLƒ‚„œšKšlVnšJ„klVXIll„Vša„IVUValUnV„K‚annnJ@X°`Wbnz„KlVnL‚Ž@L„bXl‚bVlnI„@VUU@UmVƒ@U@Uš¥@VmV@@_Ua@m°@@ƒ„kmUUm@UVmn@nX‚@@a„anJVUVL„mlIVJn@nkVLVa@KVmVLXVVLš@@U°bn@VaV@@K@aVkœbWaXUVymU@aUImWXƒ@™¥UaVwUaVwUUU@WWƒ@k_™VUKÇa@ƒƒnmxkV@LVJ@X™JUbƒVƒ„kUWVUIlƒLƒwĉVƒaU@VbƒJ@bƒUUL@mVUK@wWkK@UVWUIÇm@UUI¯lWK@kk@UL@lmU™VkbÇaUVVnJlIn‚WbXb™LƒxVln@VbV@V„UV™@kƒƒIUK@UWm@UU@LƒK@KU@Uam_ó@™m@L@lƒ@„@x@nWJUU@L™`k_ƒJWbUKkmLn`mb'], + 'encodeOffsets': [[ + 118834, + 36844 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3710', + 'properties': { + 'name': '威海市', + 'cp': [ + 121.9482, + 37.1393 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VbUnVVUxĊ¼š¼ô@Þф¯‚WǬLŎUÆW„¹Uǃō¯ÑƒÝkţ™™ţóġ™óL™ł̥U™wm¥kÝmkkKóbÝ@U¦@‚mb¯LkšmJ@x„Lmn@lk@ƒa@Xƒ@ƒlXbmJUz™V@bVJ@n@x„blJXzšxV@Va„KVUXLlmVV@In@Vx„UlW°@nLVK@zXVVal@@V„w„bVKšL@bnx@„WbUJ@VnXVlVxl@nnnV@„lV@L„‚'], + 'encodeOffsets': [[ + 124842, + 38312 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3711', + 'properties': { + 'name': '日照市', + 'cp': [ + 119.2786, + 35.5023 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@UaVUUKVk„JVaVIČb@Vam@ka@Ul@„Uô„VK@UnKVLnKlkWVa@¯l@VbÈlV_V@XWW_@anKVwUmVw@@Uny„UVblKVLX@„aô¯ó¥mÛĊÿÈ¥š™Þ¹lUīƒ¯Kĉ¼ʟbÇV™U™ŽUŽ™XmakJUnmV@bUnmJ@XnJVLn¤UzmJUn@`¯ImŽU@™nƒKVkkm™KWb—b@xƒk™@mL@KƒUUVUKkbWaƒXkK@bkJWbnbl@UL@l„Lš@lxx@b‚nUVlV@¦²°@bVx@Jƒ@¯XUJ@bUnlxVŽ„X@‚VV@b„L@nô`@bkbVVÞL˜xnU'], + 'encodeOffsets': [[ + 121883, + 36895 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3703', + 'properties': { + 'name': '淄博市', + 'cp': [ + 118.0371, + 36.6064 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nƒlKV@nVn@@kVU‚@²VVaUƒ@wmKXU@UƒUWwUW¯aU_ƒJUV™—VK@U™JU™@kUƒw@UlnWU_@›lI@U@wUml@@mVwX_„KWUXKVa@UVUUwšJlaXWUnƒ@mla„n„UVWkIV¥V@VVVI@a@akakLWKna@aVwk@WUƒbUlk@™k@U¯UWWU@mUUVUXkVmVVV@nkVƒLƒVÅwƒ¯k@WVXb›aUl@bV@@b@xkVVXVxkJ@nk@@ŽVLUlVb‚VXUVVUzV‚™LVbUbV„VWVkLmškJ@n±@UxU„VVkV@bƒx@ÒUX@xVVV@°J„„X„lK@bULUblÆÞV@b‚LXxmV¦ƒV@xƒXVŽğ@±LÅ`™IUlVbƒnšbXšllVnnlVLÈw˜K²ŽšIlanVVVlL„wXlK„VlUXƒma@knwƒWlkšVnU@mVIUl²aVJ‚zXJlI'], + 'encodeOffsets': [[ + 121129, + 37891 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3704', + 'properties': { + 'name': '枣庄市', + 'cp': [ + 117.323, + 34.8926 + ], + 'childNum': 2 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@‚yUU„U„kl@@aVmšLXw°»°w@y„L@UUaWXKƒƒVknwVKlmš_UmmUXK@ašw@k@mUWmUL@ƒ@™@£@KƒbÝV@akw™aULmƒƒbUK™LUU@lm@—°mL@nUJVxVXU`mIUxU@UnU@@lW@@bkLW@UVkKÇ°kLlŽƒbnUÜÇUUVÇ@@Xkl@XV`UbmbUbU@WxU@¯¦m°nL„aVblVXal@XKlLVVȄ‚L„KôlnbšI@„V@VJ„I@lVVÞaVkXU'], + 'encodeOffsets': [[ + 120241, + 36119 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3712', + 'properties': { + 'name': '莱芜市', + 'cp': [ + 117.6526, + 36.2714 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lmnLVlÈVln@VnIšVlx„Vla²_šJlUUUVƒVw²@@mlIn™lKXU‚UUƒVaUašKUVyUUWVUUaVkUK@l@@mlIUwUWlU@w@aU@@LU@Ubm@¯a@V™@UKWUUKUn@LUbUKmlm@UIkJƒnUKUVmIƒb@b@mWm@Un@VVnnVƒl@„¯@@nVb@`U@Un@Ž™¦@V@VU„VnV@'], + 'encodeOffsets': [[ + 120173, + 37334 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/shan_xi_1_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '6108', + 'properties': { + 'name': '榆林市', + 'cp': [ + 109.8743, + 38.205 + ], + 'childNum': 12 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@™ýVƒnIW»ƒW@»kUÇL—݃U¯¥ÇIUWWїUWwX¯mƒ@»n@ÜÈķô™@a±kȱƒw„ÑmwçċmU»ÆkkVyIm™ĉÿ@ƒÝ¹ƒWnwÇVš™Åaƒzmmĉ¦ó™kVmx™xU¼VškVm_UlVlk„°IV‚kmJa›¦k™™LmmV@XmKnšlUô›VXbƒbƒ@UaÇLğܙ™Åwƒ£mKnmċwÅ@UkƒbmaVƒƒƒn@m¯aU™Jm_k˜@kWXyl@@kÅamw™LU™Þ™ƒ™mWÅzUKƒš™Uk±@™b@nnK‚bX¤mzVšŽVxÇn„‚¯„@ÒknWƒƒVUbkķÈÑWkk@Va™™U@„mUkbƒÝÅ@Ý¥ÇbkĬ™XV`kLǍVmalUUa™nV±nwmkƒJ@Inƒ°KVw¯UnÅ@¥™ƒ™U±bUU˜±œmWbÛKWnUm`UƒVK@bmnœm‚Èż@V„L@xƒxmš„Ť°nŽ@VmK™²VlšlKk„ô@„êÜV@VXLlmš¦UššV°Ș¯²ÿ@¥š@ƁĊ˜²IšmĶnnb°b„KVƒĸLl„Þ@UȮš™Ü°IVƒÞÝސlŽœx@ŽķĀWŽ„Ux„èƐ@š°ŽXnšlĊĖ°m„nƒšV„²V°ÒƦ„aބ„˜@zll@bÞĀšlš¼nKĊ¼óȂb²±šIǪÒ¯ĖV@„lxnVlk„JlaXwŌĉ„„@VnŽššlÆĕ„UÆLœèŌŤôxȚlUœ@šxlaUċĕXm„IWmnkšVVƒ„VW_@aÈWUUmk@ƒ¯çVm»™±W¯n¥V™mkXw±ÇVwƒ'], + 'encodeOffsets': [[ + 113592, + 39645 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6106', + 'properties': { + 'name': '延安市', + 'cp': [ + 109.1052, + 36.4252 + ], + 'childNum': 13 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@kkÇmIšmUwVkUƒƒU²WmšVkm@m`mIĢĕUƒVa@™mXƒƒÿVVkyUýšĕ@l_UmnƒW„KVkţ™™¥™aƒwğ@™@aôƒ„ƒWa„kUmƒa¯¯™a±£kx™mmxUwÝ@xmU™b¯K™wó„Ý@kmm¹Ub@lklVbmnnVUV@x›UknƧJUX@ŽƒLÇWkw™LķƧÅwWJk„ƒLkþĉxWz™JUnǚkš@Ɛk¼ÜÔÈKšè@°lșÆk¦l„n@l¼@l¯L™°UU™VÇ°ƒ¹—`m¼mXk‚™bUaƒV@U¯x@¦™Ç™„UUmlmUVm„nnmlkw™@@šƒ¦Å‚ÇLmx¯Iklš„@¦mÆ°VUx¯Lm„@J„InlmxU²šmVbkV‚bUnȎlKU_šWlīÈaÞ¦Æ@„ÞlanV@ƒšVšUbl@XlÇÒĸlŽVa„UX„lm@Ñ°ƒƒÈmUw‚U™nyW£amL@mša²@lšV„™VLÆynX„šÝšVššKnxÆb@lk@WzXŽ@ll—n`šIV‚°b@n„m„„‚Unb„aVlÆ@ČxmnnL„¤ÆxššĠÛÈKVb„@„aWaœU‚ókVm™nL@W‚UnnšKlšœ¥‚bnIlU¯JlƒUkVkn`lUU™V»šwnwlUôšĊ¥nn„yÆb'], + 'encodeOffsets': [[ + 113074, + 37862 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6107', + 'properties': { + 'name': '汉中市', + 'cp': [ + 106.886, + 33.0139 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lKnb@n„lWb°bkxĸwVb@ł„nlŽ„ƒĊ¥šL@XŽl™ÈƒVblÈK‚b„akVwôml²`‚nœ@‚nVKœl˜k²xŎƒ°¦VU„JĊw@çnWçރVkUóÛ@¥kwš™šUmƒX¯WšÑkƒ@UymIUwlUn¥‚mUk²a°¯V»@™ÝVș„ÝċÅÅVl»@l@a°±@_kammÅb™a@ƒƒm@ż™KknõĠ—@mšƒ„¯LÅw›‚—LVxmb@¼kV™@mw¯wVakKW»X±¼¯Vkxƒb„¼WŽ@nx@x±bóakbƒ@ÝmU™@ķÓÛL™kƒVUm™k¯¤ÝLUlÝ@Ýz™š„x@x™°™™™bƒmƒX¯aUJW¯—k@bÇWƒwÛwWxƒ@XWlb@Žƒ„VŽÈUlwšLnl°VlUô¦œU°¤VšUxVXUxlbkVVlƒI„°„ÅVlU°m@k„ÇU¯xUlƒLUlVL@b™°ĠInĠ°ÈnK‚„@xÞa²n‚aUyšXUKVkšWô¼Èa‚z°JXUVÇV_„JVƒšz@Žnb'], + 'encodeOffsets': [[ + 109137, + 34392 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6109', + 'properties': { + 'name': '安康市', + 'cp': [ + 109.1162, + 32.7722 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„bĊaƨèšwôô„¼šb°ašXVƒÞVUÞ@‚aXƒm¥kImx¯¯ƒV@anU@UÇéğL@ƒ¯¥V£mƒ@ÝÈb„K‚™„X°wČÿ˜ƒ„b@xÈblxȯĊ„„mÆUVƒ„nÈ@ƨÜLĢ¥ƒŹnƒ°Vnn˜K„aô_ȃšwU‚aXmnW‚¯kl›LXƒÇ™ō¦ÝaÅVmbğUn¥±wÅéVƒan¥ƒ„U„»°am¥„£ƒÝ@ƒ„wVw™¥nU„уUmmVwmķIÅaóVWxkblb@ból@œğÒĉ¤ċXƒ˜¯X™xk„Ç@óÆÅx@š™xķ_kmݎǣkblb@`¯²@bk‚‚@k¼ÆUČƃÞǚÞU@šU¼¯°±bVlnm¦kVVxnJVz@‚l„™ÒXW°n„™V™šlx@¦ôÜVUl݄Xèm@è'], + 'encodeOffsets': [[ + 110644, + 34521 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6110', + 'properties': { + 'name': '商洛市', + 'cp': [ + 109.8083, + 33.761 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@²nl‚ôbš„°aVwnKÞIš`°wšXôw°VĊ°@ŽÅš„ÞÆV„zÞK@xšŽ@a‚LŚ@b@ŽnLlƒ@šln„mnLVw„a„bVƒ‚VnbU¼„Vƒ°„bl„šbÈ@ĶŦb˜@nÇ@amIyUI@ĠVmôƒU™ƒVwkwlanJ„¯lwó¥@an°Jš_„‚@š™nóƒó@£l¥UwmašÑ@ƒUm±V_ƒJ—£›J—UW¥¯@ƒ_k¯¼mUƒVUè¯b@wmL™»ğVmağI¯¤ċIUW™XƒKĵ¦ķaƒJUb™IƒlUóVmk@WÅÅÇ@ƒmU„ÅVƒnĉƒÇ°kwÇa@wƒa—„ċĀ¯xƒWšƒLÇa@Þn„U¤°¦@„ĠKÈê@VmV@b„U°°nwlJn¦W„bÝ@VŽ'], + 'encodeOffsets': [[ + 111454, + 34628 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6103', + 'properties': { + 'name': '宝鸡市', + 'cp': [ + 107.1826, + 34.3433 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@ƒ„£@›°Išb@¯°ynŹƒaUƒlƒU£„Umšĵĉ@@ylUÞ@@£kWU¯WaU£¯ÇV¥ƒ@kb¯wƒn™¥ÇkUÇnUƒ@¯±›kULm›@m±_kŽónUxlŽƒbaÇLkŽUaDŽkšW@™Kĉ¦ƒ„kƒm@ŁUaķxlw¯aXaƒk@mmakL@šmšÛŽ@¼m„@l„XV`ƒn™KUš°°@²š¤UÈ@VxmôƒxKl„VV²aVw„Xla„Vlx@UVnŽÇnk°ƒVVL™lkI™šƒJÇk¯V@šknƘn@lznmlVkzVŽ„VVxš@Ux„z@x±¼VxxU„l‚kb˜@„¼Čk˜VXlĠkôV²w‚LUKlwœJ@a‚IV¥Þƒn¯Ün„‚„@nk˜l²kÆ@š°„aVbnI@™š‚Ťn'], + 'encodeOffsets': [[ + 110408, + 35815 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6105', + 'properties': { + 'name': '渭南市', + 'cp': [ + 109.7864, + 35.0299 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@ÈôL„xUŽ°„Þ@mŽÈnl¤nUôL‚wX`@ÞÝL™ŽUšmLô„„ŽôbVbnºlnÞ@ôƒšx°LšanV‚wÞ@Vxnwšnlw²¤šb°°„bVnƒlXbƒ„ó„@bš‚Ġ@„xšbš¦ŤšV™Xġ„£W¥ƽɽƒó@ýóƝÝ»„£X™mƅšĊkUƒ„@™™šó„kťaĵŽÇ@™akƒƒa„¯ƒUV»maUU„ƒaƒbUxmKƒnkm@™k„mK@ƒxó@¯n¯KǦ@ôÅèlxkx°nƒƾ¯KU¯WķL@VÝIUb™yWbX¼Ç°'], + 'encodeOffsets': [[ + 111589, + 35657 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6104', + 'properties': { + 'name': '咸阳市', + 'cp': [ + 108.4131, + 34.8706 + ], + 'childNum': 14 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@šIXyĊwlý„KlƒXIVaķƒ™»a›£„¯aVU@a™‚wÈō‚ašL²»‚VœUln°WȯW»XašzVaÞJ@Uƒ»@¯Ýbğwly@£kÑţ±Wу@ka™IUƒƒnƒ@¯ƒómţU™b™U¯lÇIÝb@¤Ý@kV@zĊ@™ĶnƒVV¤k„V„„bmź¯z@°™a¯J@œƒ¤@„„bUx™bƒ„@`™xUÔ±ºVXœW‚„UnUJ‚LĢ¯ÈKlblmÈXŎ°šU„°LšŽlkÞKš@Èxl_°ĶUÒkblš'], + 'encodeOffsets': [[ + 111229, + 36394 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6101', + 'properties': { + 'name': '西安市', + 'cp': [ + 109.1162, + 34.2004 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@°²@‚„mVVÈÈlš¦„m°xla„@U¦°ÈV¤XbV°lXÞaÈJ°kšVšaŤVôn°„„@„mV„šJlb„@XÒŤ²lÒ@¤kzĠxÞa@°„¼ĸK°XV‚°L„ƽ¯mlwkwÆç@óÈ¥°L°mô@„w@aƙK@b™@wÝLƒyÅUƒÝƙ@ĉ¯¯Uóx™W¯x™_ÝJmLUx¯b™ƒóak±mÝUU„™W¯b™aƒ»óó™xƧçĉbƒaĉxƒIUV¯¥ō„±w—l'], + 'encodeOffsets': [[ + 110206, + 34532 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6102', + 'properties': { + 'name': '铜川市', + 'cp': [ + 109.0393, + 35.1947 + ], + 'childNum': 2 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ÆxĸƨšKlxÈX„K@VWƨIlmœV@wVUmUnmUalk@kVaUaóaƒóƒnKV™šÞK@ÝW_xóKmVk£ÇmnÝ@¯ƒVƒwóK@ǯXkm›VU±¼™KbÇŎx‚š@bUV°bƒœ¤‚bš¼ĸ„Ub'], + 'encodeOffsets': [[ + 111477, + 36192 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/shan_xi_2_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '1409', + 'properties': { + 'name': '忻州市', + 'cp': [ + 112.4561, + 38.8971 + ], + 'childNum': 14 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Vx@lnbn¦WlnnUšmš°š²VšV‚VVVnUn„ºlz@l„„@Jƒ@kXWVXl@Lƒa@„ƒKUL„ŽlbnKlLnK‚LnKÆXn°šbVV@bUVl°Un@LnaVJUbW@UX²l‚@ČwlVVIšWnkÆa°„„anV‚Kn°™UW¯@™aVUVk@Un@„aV@ValwUanmWU„k@WVUUanaVwnLVl°@nk@mVU@UVK@w„LVKVU@ƒ„K@UUKVUV@@bnL„a‚V„aôšlIXmlKX_°KVV@bVV„@šzV`kblI„V„Ul‚šL@bnV@V„Ċll„„VlIXW@k„a‚U²blKšVnIlJ„albXXlWVn°JnšnL@l@XlJlaX@„X˜W²@l_VmnKšU„blU@mnkVK„¯@U@ƒma@kX¥VƒmakkƒLƒa@aƒ@WIUUVXWWnk@a°a@kkm@kUUmJm@WUUUIk`m@V—kaWWkX™KmƒXk¯ƒ@WKƒLkak@±bƒw@ƒaƒa@akaƒ@ma¯@ƒL—KÇÅkKWbkmġ™±ÅUƒLUK™VVkƒm¯LUVVbƒ„UwUW¯bm„ƒULƒxWJ—@ƒklmkUm@@KnwVkVK@akwƒ@@a¯bƒKkn›VUI™b¯mmbk@UbmKUL@xUUƒ@klmLUŽlVXI‚VVVUVUœU`mLXVWbXnW`Ų°xmŽxU@mĉƒƒwU@mbU@UƒmbkVW¦kJ™@ƒX@`¯Im@UlUVVnb@bWJXnmbƒJUU™UUaƒ@UamIkaƒxƒ@@x@b'], + 'encodeOffsets': [[ + 113614, + 39657 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1411', + 'properties': { + 'name': '吕梁市', + 'cp': [ + 111.3574, + 37.7325 + ], + 'childNum': 13 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@a@w„@„wlbnJVb„@VbšVVV„InaWmXI@a‚aUmVUVkn@°J@_„Wš@lIX¥lUnaV„V@naV@„xĊ„n‚V@‚wn¯wƱX_WmXaWUnKV_V›VUUUUWJkUVnKlk¯™@@kmKUaŁ±KkU@WmI@WUIlUUmVwXƒ‚w@ƒUlUVwœV‚@„Lnb‚W@anU@UšaVkô@l»n@na˜JnUÈLVaƃUUVm„VKVƒ²L@mU_lK@UVWkU‚a@a@U¯aUaƒÑóÑUb™„ƒKk@@aƒk¯mVaUwVƒÑkWUmK@UUKmXUWÝwUa™LUU@aWJUUU@Ua݄U@WL@VKVaVI@WnU@alIVKƒƒ@kIƒmIkJ@™m@ƒ™@@_™K@xƒ@kaW@U„@Vmn@ŽUK@mIƒJUXV¤XXWlkKƒkkK@XmJVakImJU@ó™¯LWKUV@nUVƒLkxmKkLma@kXKmmƒLƒab™LmK@V@mXVÆUxƒX@`nL„aV@@VmLUVnLlLš˜„b@„šŽ°²nx@b‚VUxlb@V¯bUV@zV‚XVĊXVx@lVn@VnnmŽUš@LlJXVƒz¯VWVXbšV@bmn™VUVk„Çþń@XVxmbUlV„Uln„W„@„Xl‚@VLXÒ@bÞJ°¦„L˜ò„@nU‚b@°„X@ŽXbmVU„V„nb@x‚x'], + 'encodeOffsets': [[ + 113614, + 39657 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1410', + 'properties': { + 'name': '临汾市', + 'cp': [ + 111.4783, + 36.1615 + ], + 'childNum': 17 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nW‚@@UnLšK‚a„b„KnnWL@lnblKnLlw„KVU@mVUXL°KôšV@nIlJUbnI@WlL„llLXkWWU£VW„InJ‚@VL@nm@UVƒX@lb„@@wšL@`‚@„šn@V@lw„@n„VmVX„WmwnUlƒœa@_lK„wVlUn°xVKVXXWlUšVVI@K@K„n°KœwlVlU@kna@V_„Wn‚m„UVm@kXml_@m„LlKXw°m@_ôJVUV@X™l@UaV@Va°I„lk»VwUkVmwUmmVn@V¯@KƒU—wmK@U¯wUVÝ@mJƒU—nWK™@@UnKVa„_lykUmKÛnm@™x@ƒUUlwVk™ƒXW@ƒa@Uƒ@@K@ƒkIV™nammVakUlƒ@wX@@kƒ™¯@ƒVVbml@„„°UbULmlVbnbÅK±VƒKVXUJWa@ULWaUU@@U@aWK@UkxUKƒLUUUJ±UkL@V±kk@kam@UV@l@LWl@n@VVUx„LlUUx@VUV™U@aƒIUl™L@°mLU‚ƒbkUUaWUUaUU@aWK—LWJ@bUL@VUVVbU@m@a@kmKmnĉlUK™XƒWUblb—xmIkƒƒU@xWb@lkšVx™LXŽmzVV@bklVVUzm˜@bk„@Vx@xlŽU„@lUbVnl@„Wxnl@n@ŽUbV„mL‚mƒb@`X@lUX@@xlnkLWaUJnnWV™Vn@l„@bULVV@l™V@XnJVX'], + 'encodeOffsets': [[ + 113063, + 37784 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1407', + 'properties': { + 'name': '晋中市', + 'cp': [ + 112.7747, + 37.37 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@šlInJ„lJ„@‚„ULkJ@bmV@XUJUb‚L@UXKV@ރVbV@VVXI@bVVšKVbÞxVXnWVL@VnLV‚lX„ÒUŽVxUb°n„l@bl@„LšƒVaô҄ÒVb°b@VnLnnV@lmn@lb„U„V@„‚JœUVV‚Xkl@lUzmJ@xšXkl‚bUn„JVšUb„nU‚lb„V@nlLX@lakšV`Ub°š@XVJnU‚L²KlxnI@KV@lbUbVV„KnVl@„zlm@Uš@nŽšI@WUaVl@@mVU„@XkW@ƒnkVKVƒ„_Vw„y@knwVa‚@XalU„@šVnml@„X@V„L‚KVaÞbnnlJšI„mVKn„VVVInVlU„@„m@™mXK@UmyUI@mWUUakamw@wUwmLkakwVƒmK™w@wUam£y@am_ƒW@™UU@knmm„amU@WUa@knw@ƒUUUUV@nƒJm@mVUkKVUUUkKmwƒKULƒKUImV@lUn™nŽm@mbUK@°™bUnmbUmkkƒWUb@am@UXkK@a±@™V™@ĉř„V‚UXVxUVkLWl¯@@bULUlm@@nm`—XƒlWakIkm›VUbUL@Vm@kIƒ@@Kšm@—VaX‚I@W@aU@kUƒVU_™KƒbƒJkkǎ™b@nkKmL™wÅW@kVUUƒVU@WUIƒJmIXmma@_kyVaUUlkUm@ƒkU›x¯Lƒm@L@LUJ™UkVWXUWUL¯wVmUkƒxkL@`›bk„mVnxƒXUWUnmƒƒ@kxU@'], + 'encodeOffsets': [[ + 114087, + 37682 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1408', + 'properties': { + 'name': '运城市', + 'cp': [ + 111.1487, + 35.2002 + ], + 'childNum': 13 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„Vl„nJ˜wkaVa„XšWVLĊknmnL‚l@@bn‚V@UaVU@UVK@aXI˜KXL@bVVVbXVVblV„aVnK@¯šKVk„J@bšVVU@UVwkVƒKVwUUm@@Xk@K@kVUn@lbl@²l@UlK²VVIVV„KVLlw@VXL@b@VV@VŽXbVK‚@XbVIUW„L‚U²ÆLmaUankVKVaƒ¯@ƒnkUa„U°@„š‚n@@kWa„UVaXUW@IXKVw@U™ƒ„™WU@W@@UUƒU@mn@ƒ`m@UUULkUmJ™IUƒ@@UƒK@U@›anƒ™ak_@wmKUwmakV™kmK™V™k¯b™wƒ`kwUIÇx¯»ÇaŃmn@@™mƒmUkV@wkKW@kxmL™UkĉLÝk™xÝw¯lóVU„mV@ĀVVX¦W¤kz@`Vx°„²ĸ‚š@„Ul@x„êĸNJ°¤V„VlXLWnXxmV@nUl@„'], + 'encodeOffsets': [[ + 113232, + 36597 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1402', + 'properties': { + 'name': '大同市', + 'cp': [ + 113.7854, + 39.8035 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@²£šyl@Ȑ˜Ė@bĸŽĢbĸ„˜X„a‚KŤnn@ŎôllÈx„nVnÞDŽV@b‚nXllL°KšbVb@J@b—„‚„@ŽU„„xlKXLlKlXk„@Ulk„JlkUƒVKXUƒÇVIVm@_nǚLšašl‚w„VnU@UUwma@aƒaÝaLmUk@@Wƒ@U@@X™wVWÝUUUk@@VmLƒKV»nwUw™aUL@`mzƒJUIVƒUaUw™KUaVIlJôanÑlLVUn@ša„@VV„@@UUwVK°Vn_lJÆLœéW@UUUÅ@»lm@aÞIVwXW˜UUkkm@U@aƒU@mwU£VWU_kWmƒXwW_°yUkkK@UÇK@kkUVymóK—U@KWIƒbUak@mJ@bkbmLkŽ™UmƒkVU„W¦@lnb@„@Vƒ°ULml@nkVƒa™VmLUnk`±@—XƒWW@kbǦXŽ¯„WxI@xmbmxXlWV„„@bŎUz@J‚b@bÞb™ŽU@Wbk@ƒxk@WX¯VۙƒWÝbÝUkVUU@alI@a@akLWa™m@U¯UUmÇL@K@aU@¯VUkƒKmX@`@œkJ@nV‚Ub@lbVÆXVW„ULU`VbkLUV@XWl@bXJ˜@VbV@Vl'], + 'encodeOffsets': [[ + 115335, + 41209 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1404', + 'properties': { + 'name': '长治市', + 'cp': [ + 112.8625, + 36.4746 + ], + 'childNum': 12 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Uk™Lky@I‚JVa@mÞaWšy@_W@_WƒXVlUVwš@nw°K@m„UƒVaƒmVkU@mmmnLVUmKXa™U@IlKVUnK@UmWkX@WV_Vƒ@akU@a„KWIXyƒIUVmUn™Ua@WaXUVKVmkUWVkUƒLU@@VƒbƒKbƒIUmƒ@mbVL—x›WUUkn±V¯wƒbÅJUbmLkbmKÅKƒbVnUbƒV™KUb™KUbmLKmƒb™aƒKkUm@UŽnn‚VnxUVlUxl¼ƒk¯JUbU@Vbk@WšU@UVóI@`¯nWxkLƒK@nk`Wn@lUnƒVnm‚ƒXU`@mb@lkV@„VnklVVUblz@`nbWnnJ„IVJ@XUVV„UV@lÆXšxnKlL@mšaȍll„I„ašLV`„UlVV@@b@XJWUb@˜™n@L„@lJn@@UVKVaœUlnlJXb„k˜Wn_@mn@VkVK@a°@XklKVUUwVWUšƒĊƚ@šU²@@blLVWn@@bVa„XllVnnaVmša@¯VLnan@‚šmVm@knUVJ'], + 'encodeOffsets': [[ + 116269, + 37637 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1406', + 'properties': { + 'name': '朔州市', + 'cp': [ + 113.0713, + 39.6991 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@XXWVXVWnnlnn@èƼ@„„xlš„ŽV„nblšššVŽÈUVl‚š@„blnœL܃ĊmUkU@Ua‚—@WI@aXk@WVUlKUaV_VKXƒWUUÅka@VaU@mlI@›@_nW„LVl°UV@@b@LÈKVn°V@VšnXblK@b@bkJ@bVVlUÞVÞa„Xܚ°UXWl@„wl@XaV@šÝa@aa@IVyƍ@aƒƒXUWknwna@w‚JXw°ƒWÈ¥kI@W@kmKm™¯IUmkXWWkaƒbkImJ™UkL±aVƒb@lWXkJƒUkƒĉkƒ@UmU@a™KkƒVƒUkJlaU_™yƒ@UU@aUU¯LW`kLWnkJó™ƒbUƒbmK@aU@UVVL@VƒL@„UVULƒK@xUL@VUV@nml¯@UkmKUxmbVbUV@XƒlXVmnVbkxUbU@ƒbm@@VUlUVšb°@VX¯šm‚'], + 'encodeOffsets': [[ + 114615, + 40562 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1405', + 'properties': { + 'name': '晋城市', + 'cp': [ + 112.7856, + 35.6342 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lV„Lšb„an‚LnKVašLVašL„UVaUm„aÆLnLlanKVaÆI„a°x²UlmVVœX˜wUKna„@Vn„J‚a„L„a@UV@@alUkKVKnkmmVwUk„w@ƒ™@kxWUXƒW@@mƒk@aUa@a¯aƒLkKmwkUm@kL@K@aWIXmƒVƒXƒWkUVakL@UVKƒw@aUK@UUKmLU@¯n™KUwVƒUIWJUWmka™@UXƒJƒk@UkmW@kLWKVƒx@bmI@VUaVU@a¯@UUmVKmX@±`kÝKVxUL±akL@V™bƒLkKmVƒ@XWVUbƒVXb@lm@@lW@@xk„lVUbnnmbUšlJ@„@L„@@V„b@‚WXš„UlkxVV@„šwn@ÜmnLlVkzƒ`UbmL@Vš@XL˜m„VnIÞ@VU°x@VnL˜x„V@LU°'], + 'encodeOffsets': [[ + 115223, + 36895 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1401', + 'properties': { + 'name': '太原市', + 'cp': [ + 112.3352, + 37.9413 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„@VV@wVKnLVal@na°nšaVJœUlm„L°a@b„@lx@bULUlmx@Ln@lVkn„l˜@XI„w‚K„Vnƒ°aVXVx„ƒUaVU°K„nUlšUVL„KÆVš²Ģ‚lnXalLÈƘL„KUaVkUanmWU™a@WwkUWU¯y¯Ñ@anIl@@aVU„m„I„ymUƒLUUVakaU@@LmJkw±LKmVUI@W¯™VaU_l™kbW@kK@mƒUkaVƒmVaU™ƒIVmalk™W@wnIVy@klkWUU›VI@ƒƒUƒVkam@knU@mmmK@bblVUX@VkLV`@n±KU„ULƒ‚UnVVńUbÇKmV—Imbm@k¼ó@Ul™b@VmV@bXmaƒK@›UUxkV‚V@„xW„UxVnkVVJ@XnJ@XlV²LƂVbnL@lš@°'], + 'encodeOffsets': [[ + 114503, + 39134 + ]] + } + }, + { + 'type': 'Feature', + 'id': '1403', + 'properties': { + 'name': '阳泉市', + 'cp': [ + 113.4778, + 38.0951 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@°@nb„@lb@b„b„b‚@„x²al@lb„KXU@m‚kUWkkmUUƒVwV@XUW@™naVklKXblKnL‚ƒnLVanImaXKlL„ašV@U@KUKW„alƒXK@£WKXUV@VU„ƒUUVW„_V™@W@@K„@šƒUƒƒIWmXUmƒULƒn™JkImmÝaUbLƒK@UƒWk@mn™Uƒ@kVWb@Ubmx@lƒzUxƒ`U„ULml@„XWlƒ@UV@nk@U‚Vb@X™Jm™@@Vknƒyk@ƒzƒJƒnUV@bk@mJ@b°Ò°zXVlVXx‚@šbXVmnVbUlVb'], + 'encodeOffsets': [[ + 115864, + 39336 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/si_chuan_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '5133', + 'properties': { + 'name': '甘孜藏族自治州', + 'cp': [ + 99.9207, + 31.0803 + ], + 'childNum': 18 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ƒaXamƒ¯wm@±°wUwV@UaVw²Kš™„U@UƒU„¥‚a„ƒ@£Þ™ôx‚Knkm™X¥™IUƒÝUwlk°V„@ƒÈ™‚KUwlkUyV¹„mšx²Xll„ÑW»š„l„w°UŎ„nƒ„„˜Jœƒl¯°V@wôIVÇn™nUllšLšVǚLô¼XW£@±„@¥k_ÇJƒkUéƒkšƒƒwXa@ƒšLlw²™Vx„b‚mš¼ÈxlLȃ„VWÞn¯mǙÑUÝlÛkwlĉmƒULmwUJ™ç@wkm@ÑlUX™ƒÑôġƒVa™ƒUф¯@wķÓkbV„mnU@@y¯IķKƒV@¹šaƒé@k„mÞU°¥@a¯@anKlblU„¥@óğç@Çw@wkla„çݱk¯±@ğÝUÛmݯwƒ@kb±¯akXWÜkXUÆÇUš¤X_Ɛw„V@¤ƒXU‚ƒbUƒŽƒIUlÇUkŽġ@™aXČmlUlèUV@„mVk¦Vxš@¦±š¯ƒƒ¯¯anlWš¯nƒƒÅw@w°KVak£m@klƒKknÇU™»óKšīlaUaV£@™™¯@ƙU™VƒÛÝÇXƒÇl—ÓlŹ„»WUğJ¯£mx™Lĵô›ºX„VlUll²bl„„lŽƒxónn°ÝšU¼mJUš¯nƒƒƒV@êĉ°Uĸ™w™@mƒ@¯kmXamѯaUwÝKU¥„mÅn¥Wmn™ƒ¹n±ƑƆÇôXê±NJnšƒ‚UôlĖkȂVÒ¯¼VnƒȮ¯ĀnƆ˜Ģ@Žk°V°¯ĢVlkšVxm¼X²™Ŏ@ŽVxknWÜ°U‚¯n™Æݜ@`„ôݲÒƒ‚Çzn‚mX@x„è°K°Å„UČĬóĖ݄ƒ˜ó¼ÅêƒÒƒbmšk@V„Ž˜„@ҁl@nĉܛê—x@Ėml՛J¯¦óxȭ°ÝmŽ¯Lĵè›Ā@Ɓ„l°żƒ‚šX@xmŽkV@z@‚„°blŽnÞ°J@bn@ƼUVƒUóŽóLƒ°X°ÝLƒxUn„°ƒĬƒn@lnL@ŽÆ@šn„KÆxnUnV˜InĬmÆnxŎ¼ĊIĢóÞ@ĊƒƨbUƒ‚mV¥lkƒ‚wnL„mšÅÆ¥Xƒ˜wU@w‚wUÞ™@alUUŚU™Vkkm°aU—°Ó°w°U„ƒ„b°aš²K˜¯œĕ˜@ÈbޏĊaš»„XVm°In„‚Ĭk¼Vb„ašJšôš£VĊan™‚k„ů™™nƒÜU@anKnĮ‚bÈmƎš»nI‚霣Ġ™'], + 'encodeOffsets': [[ + 103073, + 33295 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5132', + 'properties': { + 'name': '阿坝藏族羌族自治州', + 'cp': [ + 102.4805, + 32.4536 + ], + 'childNum': 13 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@l@@þ²I@lƒ„VL°wnJ°Uĸ™Ŏè„Ilw„V°¤nĮ™¤Ý„lè„L@„ƒ„@x„l™è²ôĊ_ĊġVÈôJżīlbXšÆÈVŽkxÇVƒ„n°„¦Üb@è@nn@@°šUÈ¥WDŽ_Uala¯¯UǙkƒ»„mVwk»˜k²°VxlL@¤œ_@x‚`ȍ‚Ėöb˜š@l²alX„a@bnK°¦VK@nnWmx@nUnl@@lƒlĉk°l°UXkmW@Unš`k„ÇL„ŽW„ÛÈVxšVVlVk@l„IXb@ylXÈW˜Į„WŤzœy@šmIƒŽ²šJ‚š@nŽ°@V„„J°a„Å@ƒŎkVǚk™aUw„KVw™™Vƒ„@nkm™@±ôkô™ĊJš¼šInÑm±nIššÞ‚XȃĊxĊUÈbÜyÈ£Vkw@kVUV™„m@ša„»ÜbÈmƒUXwÝxƒUn¥@°ġ™Å‚aœJVk™aW¯Û@W¥—UŏĶ™@¯kUƒŃ@ašI@mmanwސ‚W@œ™mw°»Uřk¹±W„xVx¯¦U°ƒzţW™w@°ÇVÑk¯@„y°aš£š@šmšnl¼„ašÝÝakwUƒ±aĉImlĵn@ƒm@kkVƒ¯Ñm™ĸ™°x„l™œ@˜ƒXVÞmlÛݙĉUÅ¥mwÅ¥VaUw›™XġċaVůÛŹlwU¯U™ó±™xÛV±¯¯n¯mċƒLmnĊm‚™@™_kJWaXmwUƒĉK™»™@mwX݃UDŽkKÇw™»nƒaUw±škx™K@„Wb„x™„„lVê„lÈIl`@¦ƒŽ@²X¤Wó»™KUșŽ™KkkmVmšUÈóJ@x¯Uk°›„—Iƒƒm„ōƒ¯Vƒxƒk™ŽX¼ƒÒkk±W™wƒnUºVzklVxLǚ@„ƒŽ¯UklVxސV„šJW¦nšmlLówݚ@¤ƒ„bƒ¦„V@VƒV™š±LUxVbU@Vx¯x@²n‚°xn„Wb„b'], + 'encodeOffsets': [[ + 103073, + 33295 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5134', + 'properties': { + 'name': '凉山彝族自治州', + 'cp': [ + 101.9641, + 27.6746 + ], + 'childNum': 17 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ĶóšKnw°¤ĠIXVƒ¼kź˜Ôk‚„ÈWŽÞȄÜUVšÅš°@šš‚@U¤Vbkb™ĬôLš¼ÈVlm„Llkn@l¤Ub¯L@xÆx„„°mX™mk°b„°°„²™@¥‚™Uwl¥nU@ƒVUkçVnkWċšbĢ@lÈVVk„J„‚V„aV„W@£ƒUƏxW`™£ÈVVÅlWXÛlW°b²la„@°xnÞVÜĠÞ²@l°Þ²ƒèkblŽ@xÈx@Ġènal£nU‚Dz@‚ÞK„nn¤@¼˜°U¼„nV‚šXU‚šbn™ĠUVbUlVš°LX„@lV„èÜUnK@_ƒyXVyUwmIU»Vƒ„kÇ¥šÿkkV¯m±n@ƒn¯ÜanVVƄz@Ž‚bœwÜb„m@wša@kƒmk»@™a@VUUó„w˜@nb°mš„XŽmnVbގVôanwšJ‚ak£lw„˜šLšÅnÝ@wl¥IÇӃ@U™™Lƒ¼kVǃÅó¯kVmmw@ƒn_‚Vn»°LÅ»@éÇçŹīVÇÝ@ÝğU™ƒaVݙ™š¯ķlŭġlƒ@óÞۂċ@¯nkUӄ—m±™IVġUwóKUn±¯—K›w»ƒKݐV„nl@„óxUwţ›£ĉƒUmŗÇ݃K™„ÝUlmKƒ£UVŽ@ÞȎW¦„Ò@Ĭšnny‚@nÒmœVŽ—¼@°Vbl@VlnUUwl™°a@„œ„@llnk°lbnKWĀnŽU„VxUŽ‚²Å‚m¦Û›ÇŚƒaU„Vbš@¦m`móX™Umm™xÅ@±Þn虲™U¯»m™ƒV—m@wƒU@wݚÝmLƒa@„™VÇUk„l°¯„VlkVƒ¦UšmxƒaULUèVx@„kIUxmWV¼¯VmȯšU„nl›È—@m»Å™ƒVWxÅbÅğW@kƒm@kVV¦mlnn@‚ō„l¦Åƙxkœ'], + 'encodeOffsets': [[ + 102466, + 28756 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5107', + 'properties': { + 'name': '绵阳市', + 'cp': [ + 104.7327, + 31.8713 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„ńlV°š@Őĵ˜VX»ÆUĊќJ‚w„@È»m»š£°Kšk@ÇnÑƍš@„w°JUwnw@wšbVbš@VlźLUw„aƒ»„aUklyUUVakwWXwWƒUxkLƒmn¥mšwk™˜UX™lJ„w@aƒIk°X„¥Wƒ²l¥šaU™„IlmkklƒÈL@m°nlWU™aW—š@Vƒ„@UaV¥@ašk@Çk¹ƒK@a™K@kƒKkšÇX@VU@kx±V™èkIWwUVUkkKÇ@ƒa@wkml¯@kUWn£Wa„aVwnaV݃w¯@UaWx—n›JńUxUšma@L@„mbUŽU±VVnkxUƙ„VŽm@kkKW°„X@¤ÇUkÆÇnU¦¯ŽkƒmLVwÅK@UóbÇƁVƒ¦™L@‚±êX¦mVޚkÜÝnWU—„›@kšƒŽ¯wķšnš°ÒU„lln@@„ĶmnkĊJ²bV„lxÞb™Þƒbk»™m™n™@™¤¯bƒz@Žl°UÒ¯È@ŽšxŤX„yV¯°¥Uwƒw²XlºVŚ¯¼nx›š@ŽXݏmxnb@n™J@b'], + 'encodeOffsets': [[ + 106448, + 33694 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5117', + 'properties': { + 'name': '达州市', + 'cp': [ + 107.6111, + 31.333 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Uxn°‚bnŽlUnÒƃnn@n‚¤„LnxlU„ššV@„Æl„x°XXxl`XœƒVW‚œL˜è—„±nÈbƒŽ°b@š²x°Kܼ°ĉ„V¦lJnU@¦šÞ‚JÞğ„mšLÞ»šxU„lb„VÆann„alŽ„VƍX@lnŎV„mU™maÅXƒa@aWmœ@‚£@wĉJVƒkk‚kkmƒnk@ƒmna@šal„Kš™‚J@Þwm‚ÅŃ@ambkUƒƒ@™™KUġKU@m‚ak¯±ƒ„a@aĉÑÅaVwšXlwƒ±—V¥l@@a™kƒ›@@£šmƒĉÝónWV@ŽnÝÇÇx—UmbƒaVkkk@m„@m°ƒÝýXm›akÅīƒ@@ƒmb@@xmšnbƒ@mxšŽkWL@ƒ¯b@WUXmWœWKkbm@kx™Xmm@LUl„xlêóK™nUš„all™LƒlLó°m¯JVšU„K„„@x˜K²Āô¦l°'], + 'encodeOffsets': [[ + 109519, + 31917 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5108', + 'properties': { + 'name': '广元市', + 'cp': [ + 105.6885, + 32.2284 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ÆL„Ċx°»Ŧ¦˜W„™šLȄ@xÞKÜ°ÞnVxÅĀlÒnJ°a@w„V¯l@XWknKnw˜VȚ°XXa˜lX°VI°b„W„nšaššš¥@ƒw°™n@šyÆ@nkÞ@°¯lJn„°IÈl‚UšlXÅ@ķlUV¥VUUÝޙUUƒ@UwƒJUkĉm@ýƒƒlk™WUwVwWJk@VUK™lUkaVƒUƒmLk„m@ƒƒ@Uƒ›Ik`@„™UmlUkV¯ÇXKÝ_mm¯@Uƒ`kwmƒl¼±KV¯—¯Vk±Vk±kzma™KUnDZ™bk¦±ŽX„ƒ¦¯Wl„J@bƒxkIWš—Vlš™xnŽm¦„nlKVwX„WxXŽlxUbVVkzVlƒb„¼ƒbVxŹKUk™@Ua™a@xmxVx¯Iƒx™@ŎmÒ@șl¯L™¤n¼'], + 'encodeOffsets': [[ + 107146, + 33452 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5118', + 'properties': { + 'name': '雅安市', + 'cp': [ + 102.6672, + 29.8938 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ln@xšèVInxVKn„‚ĊklxkÜVޚÒnÈm°nxš@š¼ĊLV„nx‚WXblIš`š@nmĉn‚KȄôÅlUÑmU„K²¹@ÇÅVÓůVýÞW„‚UVmX„ÆbnwšKUÿ‚™@UmmIUb¯¥Uwƒ™¯™Çmš™„çmanUm»UUƒl—kƒ¤ƒa¯bV™U_WĕmÇŚ±ĢUlƒUl™ÛVƒçkUƒ@WŽ¯KU™VkUağVmš™aV™WUƒmV»—¯@»m£ƒmÝLŽ±@ÈmVk¤mb@ôƒ¦kVkamL@b°‚@b¯¦ÝVƒn@l„ê™b@º„UĸL°J@zV@nmUƒlaĸÔ@xƒ°VҚ„Ub„‚óĢ„ÒWškV@Ò'], + 'encodeOffsets': [[ + 104727, + 30797 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5115', + 'properties': { + 'name': '宜宾市', + 'cp': [ + 104.6558, + 28.548 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VlÈnl‚XnWLX`m„²nV‚@b°xĢçlnšVm‚nn„@@„°‚UzšlV°nޘÒkxl„w„`UnVb„mšL@albÞKÈۚmܼ°@Xǚ@wmW@ńKĊL„lV„šLVŎçÞL²±‚ğkw@Uƒy@¹lKX™lKVa@w™™Č@‚w@a˜ÇU¯n™@@wġak—™aō‚ƒƒK@Å»VakUWmķwkbğ¥mL™akš™@ġރ°¯xVVÞ@VšxVš—VWx„XlxU‚™@k²WVŃULmèULVĊklĠ„VœJVx±nŃ¯¦mwğ@mƒƒlğkkl±@kšUk@¯±Ç™Kƒ—kxl¤b™Imx'], + 'encodeOffsets': [[ + 106099, + 29279 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5111', + 'properties': { + 'name': '乐山市', + 'cp': [ + 103.5791, + 29.1742 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@kšVŽk„ššÆkšV²UlºÈIlxƒLXèÜlU„„XU‚mkƒbVè„x°@„@¼°Knnn@m˜ÆIUbnJ@bVI°b°±@nK@mVakkƒKl¯nbšmĸ„èl@VnÈl‚UUw„wmwnm°¥„L„™lLnU@Va™ImbkƒmK„ƒƒnk@mƒb™ƒƒLV„JVUUƒ„VnkVmb@a¯JUaÆkk¥„IW¥„Klw—ÑmÝU¯™kVy¯@ƒƒ@mmn™Ukmġè¯w@aU±mnƒW_XKWmkÇmUkóbUÝUanmW™ƒ¯nma—@ƒxVôUV@šb@‚l¼„n@l™b@xƒnÛa›xa@ƒyUÅmUÛbm°@„m‚n²U°ll™ĀȦƒlU„V¼nJVxUz‚W„z@`mL'], + 'encodeOffsets': [[ + 105480, + 29993 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5113', + 'properties': { + 'name': '南充市', + 'cp': [ + 106.2048, + 31.1517 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ȲVmšLnblyl²²UUl˜°U°²L‚»„knlx„_VŽ°@nnÞ`WL°ÈUŽVlnkšV@ƒl_œJV„‚@„„n@lƒnKV£™Çšƒ„UV¯šm„@laX˜U„‚UbVx„@VkôJU°Jn™@™‚wUk°wnUƒV_nJmknmm¯Vwk¯ó¥±ÿ—L@wƒƒƒLVU™kU›bX¯mykI@a±Kk¦ULmaXƒƒVm¯ƒK—z±ƒklUIVbÇJšƒkL¯™l™ƒU™ÿ™UƒlUkJƒUmŽUUkVVklKk@@a™U@„™J„²ƒxƒ¦kĬ@¼±ºXnWb—xƒU@xƒx@lšL@b„Llº@șl@bU¦Vbƒ@U„™@X˜‚bVškX¯m@nÇKk„llknƒJVš'], + 'encodeOffsets': [[ + 107989, + 32282 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5119', + 'properties': { + 'name': '巴中市', + 'cp': [ + 107.0618, + 31.9977 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@V„U„lbkVšŽVLUŽl@XI‚ŽUxVxšXkl„„@þĊnVl„IVx„@VVݚVÞUVU¦kV@ĸWÆô²š@VÞnš@Vaôb²W@‚K@XUmÑUW°¯°Ina@y„_lWn¼lLUbô¼„Kla@™nkUyô—Æx°@šn£™Ý@¥mVkIU¥Ċƒ‚¯Û»¯L±w@™¯a„Ça²m˜ƒ—ç›KX„UW›k_Ww¯WƒwÅk@ƒ™Uƒ™kVmwƒK£@mmmńmÑkVmamnnlmIU`V„m¯xVlx@šmš¯IV‚óIUlƒ@UwVaƒ—VW‚kbƒ@™nU°ƒV™„šÈU¤'], + 'encodeOffsets': [[ + 108957, + 32569 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5105', + 'properties': { + 'name': '泸州市', + 'cp': [ + 105.4578, + 28.493 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VVXwVKn„˜wnVƒn„l@b¯xmKUbVn°°X°@blLšènV„@Vn‚l@U„LnmmUna„VV_ĶV@wnJ„„l@@kkKVólaUwnJm„wUlm@ašUaôKVnJWbޚ@VšwVLX¥VVš_Þ`šw„WƒÞŹmmnIn¥Wƒ@k„WV¯@ƒ°kI™ŽƒLk¼Ç@k¤±Xk˜™nmݯUlÅÛKWV¯kƒlUwkLƒÓ™@U—@ƒ‚w@ġXV„˜WX„š@UbVbšV›š_kÇV™lU°lnwŎ¦ÞaƯnmm¯šU„™m¥nkVmkƒl_ó¥¯UÇl¯@™ƒ™L™kƒ`¯ķLUy¯@mw—¼ķ°ġ_řU°mlšnÇVUޚ„@‚ƒš_ƒJUnV‚UXšbl˜Ģb@x@mšV°—È‚b@‚xċ@šš@xUbkLWškL@º„zV‚@lxĠ±²'], + 'encodeOffsets': [[ + 107674, + 29639 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5101', + 'properties': { + 'name': '成都市', + 'cp': [ + 103.9526, + 30.7617 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@°n°m²°ÜUšw²ŽôVš°ŽVkxÜźUŰČb‚ŽĢlaÈL„»ƒ@k„wVǂ@„ƒnÛƻșUÝ°Kl_„V°Uš`Vbn@VbÈLšaVU@ƨ»V™nIl™šUUa„±lIk±š@VnKmÅ@WaƒK¦™lVōškK™Ý@maXÇmw¯IU‚@kƒVƒwUmVIƒƒƒç—ÿƒU±ŽÅ@¯È@xƒK@wƒLUbÇKō@mÝ£@yóUóóUxkI@WlIUaƒbƒaŽVĀ™LmxÅaWƒUnVƒÝXUþÆ°UÔÈÆ@±ºƒLnVVÒkóÆ'], + 'encodeOffsets': [[ + 105492, + 31534 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5120', + 'properties': { + 'name': '资阳市', + 'cp': [ + 104.9744, + 30.1575 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„è„„UJVn„x„U@lV°JnxWÈnbÞ@šŽlLŎ™Ušk‚¥„LXbÆ@nŽmLU‚@zlbXmlnVynL„çšJVb‚UnómUnamU„an¥lKV_²aValWô„n@nƒ‚bVœK°¯VblW@kkƒlUnlV£°W@w„UXk°KVwƒmVkwVyVI@wkmƒVÅ_Umm@Uÿmbk£™xUaVw±V¼V¤kLWxU@Uk™bƒyƒXšómƒ°V@@zÝÒkKƒn™±U@@_VVkƒÇaVwnLWalm@@kkVVl™¦kIV`±n@w„Kƒƒk²™aƒVUUV¤™nkxmUkVWVnLUbVbƒ`kUU„mLU‚mX@`ÅbǚXbWLXŽ›n'], + 'encodeOffsets': [[ + 106695, + 31062 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5104', + 'properties': { + 'name': '攀枝花市', + 'cp': [ + 101.6895, + 26.7133 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„b‚KÞnޙ@x„V@x˜n„Unš°¼šVš±mç²ÝÆ@šwnnšVWŽnôn_@¥‚™UaVƒ„bƙœÈ܎n¥Æ±VUwVƒmXÿmLkal¯km@k›ƒ@ƒ¯bkšVxmVUkk@Ua@¯˜»Un›mс@mz™m@īƒÑX¥Ç@ݙxU¦ƒšÅŽÇUkx@šlb„UWVX„mV@xĵĖ±@@Ž¯xUšÆLnÆm„šx@nXL±lUUVwKWak@WxkbšÞƒŽĉbUn@‚ƒ@@xó¦„Ŏ'], + 'encodeOffsets': [[ + 103602, + 27816 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5114', + 'properties': { + 'name': '眉山市', + 'cp': [ + 103.8098, + 30.0146 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„šVx°¦VanJVnš@„b„aVbkJ@XlJVwôôôV@zÞ¤@nƎÈLVa„K@x„L@w°ÇÆ@²„V˜ĀœmWXKWașÆa@_nWVnKVƒlV„_UaVamKXUWwnmmwœÑm£@ynUƒkWƒĉUkWVkkV±çkJmkKƒšƒK¯¦mnnxƒxVxVÇkUmk@ƒçķ™nmak°„LllUb@nmL@‚¯²¯aUJ@amIVaÅJn—m@mm¯L@»ƒŽ¯@ƒwUç„anlVƒWVƒÛkWç„KkwÇJk¹±V™UÅl™™ġV™²ÈƂnXĖV`Uš°a„b„£˜l„kVVn¼mVnbƒè™šÈn°š'], + 'encodeOffsets': [[ + 105683, + 30685 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5116', + 'properties': { + 'name': '广安市', + 'cp': [ + 106.6333, + 30.4376 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„VlIV‚„kšVšĀ„Vkš°šlK™„ÈIUaVJlk²„˜y„Ln°„UW„nbVKl¥²L@blJnzW°œalV°Inô¯‚K„kšKkkƒbV™šmôLkéƒwVk@KnnšWlwn@laXL›ŽnXVW@X°a@„XKl™nw„@man™@w‚@na@„„@ƒw™ĕġġ™wUkUWb@mk@™¦ƒ¥mUÛb±yÅn@bml@kV@„ƒlknVbmVnlmš—bÇk¯bWyk@V_UamJ@I—@WaƒVXamIVWkUkbVaƒUUxƒ@VnkVU¼›bkKUxmK™„@WšƒxnV@n'], + 'encodeOffsets': [[ + 108518, + 31208 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5106', + 'properties': { + 'name': '德阳市', + 'cp': [ + 104.48, + 31.1133 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nUW¥²é@šK„¥‚UÈÅôa@VÆLUxnKl„°V¥ÈmlÅÈV@£ƒWX¯lLln@UšƒVÅlwUm²U‚VVna@ƒ@KnbV™VwƃœI˜mXwWƒkIVwÝĕVUa™IƒèmKUzkmWnka@y™@l²kJƒ²Vb™VkšmJUšƧ¼@UV™bÇKUam@Ua™_¯VƒUk`¯LVÞǚżm܃„@Uȃx@l„ƒ¼ÇKkbWŽœšVxUbƦnxƦĊV'], + 'encodeOffsets': [[ + 106594, + 32457 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5110', + 'properties': { + 'name': '内江市', + 'cp': [ + 104.8535, + 29.6136 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@²èlUUllXĊVX„„lmV@zn¤›ÒnxmnXxlUnVlwšmU£VV„Ušbl±„„ƒL@x²mU_lJš¥UklU@ln@‚kXbmKUxÈbl„UU@`V@š²„mlLÞÑ@yU@„¯ôn‚™„W„zšaVlV@XwlKU£‚»—aVaUwm@mwUVUwkƒlVDzLlƒ„KV™m_@ykUmƒ@mU™çkKmxkIU‚Ý„@LUJ@n±„kº‚LXb™¼@mmIXa™@mamnkW™ƒKUƒƒxƒ_U`UklwUw™mUbƒV™²ƒakbƒmkn@`„UmҙšVxUb™I™`UƒaÝÈ'], + 'encodeOffsets': [[ + 106774, + 30342 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5109', + 'properties': { + 'name': '遂宁市', + 'cp': [ + 105.5347, + 30.6683 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ÞĖUxlJX„Vb°@„xUÞmbUxƒbXbm¤VX@lk°ln@x„bÈ@lLVlVUXxlJšç²UlwV@@UÈWl™„L„w@w„V˜wXaWm²¹@»lī„¥„wƒ±šI@ƒšV@bl@kLUllUVVn@mmU„wX™ċbVb@VUkbmamšW@kƒa@™™k@ƒlaUa™@¯b@šmmwó@@lkXUa¯°›LU‚am„m@óƒkXUb±bU`kLm¦ƒbnVmbnVmô'], + 'encodeOffsets': [[ + 107595, + 31270 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5103', + 'properties': { + 'name': '自贡市', + 'cp': [ + 104.6667, + 29.2786 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lIÞDŽbVŽš_šJVaUwš™nуV@_lm„nla„bš±„UVašnVxkxVlV_„`„wV„„LšlXnmnbš@WbnJ@nš»WaKl¹²ƒ@mVI@KރVlJnw@aW¯¯¯UmVanL°w@aƒk„mmU—xmƒULWxUUÝKōèU™KUƒƒkĉKƒL@ÆnX@x™‚Wȯ@Û»™nÇÜÝLka@b™KƒnUaVmƒ_ƒxkƒLX¦ƒJl¦ÅlVb°I@bnaUŽmlƒUV„UVƒIUŽ„Kš„„a@nml„„ƒŽnLl„našJUbV@'], + 'encodeOffsets': [[ + 106752, + 30347 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/tai_wan_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [{ + 'type': 'Feature', + 'id': '7100', + 'properties': { + 'name': '台湾', + 'cp': [ + 121.0295, + 23.6082 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@\\sŽ@pS}aekgKSu™SsMß`¡CqZ·be@Q^o@‹gieMp‹‰]}•}Ľc_Kk…{™ù“A¡r‰[uom@эĥJiq©mʼnq¯Bq]ÙYgSåk_gwU­isTE…“‘ĕiqiUEkue_‰OSsZ‹aWKo¡­q“ycY£w}‹ĩ™ĕS§Z©S™N¥SyLÑ¡±Ks^IY‰PdƒY[Uo†Fp}´\\¬\\j]ˆe܍ò‹¤¡–ā a\\bn™U㺹Ìs¼j®[cíȈEŽĝĆ`ļf¶Š®K|VØDdKGpVnU‚FjpH—F`†B’[pMºxÖjbpÎxp€¬‚|ΟÜÒCŠ²®‚ÜAp„ZG~€Šd˜ÞàV¨|¸€`|Œ²tx~\\~|dFf^zG€ĄŚhœdL\\hĸž¼†ŠOªP®lV`p\\]Xpll˜æ¤œCpQ|oF}fMRi†NSon_²qämœM„NM‹\\•'], + 'encodeOffsets': [[ + 124853, + 25650 + ]] + } + }], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/tian_jin_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '120225', + 'properties': { + 'name': '蓟县', + 'cp': [ + 117.4672, + 40.004 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@EUDAEI@WNMNCBFAHFFNACDJDPBD@@GD@DIFFHEFGDBDEQOFG@EI_KG@OcJQM]RMEKBGPG@[LaCIICBWKCEEG@WBQHCDFD@HSLEJI@IHWECFGAAEKCGDBFCBSBIDCKKHEADMJMFABKOKEQAA@IEEG@GIQAEK@OZEESMOL“lu@SLUTYFQCMG@@SQUAYKAACA@IB@BDB@B@DC@@BGAEFAA@BEGKJCC@AGAIHA@@JC@QEIP@@A@EGIDC@O@C@@@@CJCWKABFLBBEBSQGBAAMIEM@AKBcJEN@BEBCFMAEFEF@J@BG@BFABECKFG@AFQ@@F@BEB@@A@@AAAKAE@GFGDECEFEECBKIKDELDFEDYH@EIACDCHKBEB@BAAC@ADBHABKJIAIJICEDGDCD@@A@A@DHCHJHDFEFGBKRKBGIK@GIMHSBCH_BOJECCJCFKKMD@DNJEDEGC@OJCJHRUL@HRJ@H[DCNKDZHCTFDHCFFKR`TANVDFZRDLFARB@HPAPG`ILAR@TERNDFNHDLCLDDCXDYbHF@FEB@LDDVE@JPNfXPINCVDJJD@NJPAJHLXHDNANHhB@DPNLRMTBFRBHHr@`NBFEBOCCBIAQJDHCHLHFA@HSDCRLFTB@HEFLNF@PELBDJALFLTC@EPFLLP@tUHQJDfIHGTB^JTCPDLKAIBATFPADIEGECEMJ@JIAIHGECFEAGDI\\SPOXAFCL@BQTQBBTMZECYGAHA@GJAE@HCAEME@IECFKJADDBABLTHHG@ILEAMNDJCDHEBF@@JNFJELDFKTOT@JETBFFHBHEHKI@@IJEJ@XKEOUMS@AF@CEB'], + 'encodeOffsets': [[ + 120575, + 41009 + ]] + } + }, + { + 'type': 'Feature', + 'id': '120114', + 'properties': { + 'name': '武清区', + 'cp': [ + 117.0621, + 39.4121 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@FWôµ@IFCLIB@EHNBp]AGEAKAEDMGZKFGBGME@ILGP@HEFB@BXMEAHUGC@IHCLOD@X[NWHWPKAEF[@EKIOL@EKGBNMJ@EIEHKBIC@BAKMIACCFQZCF]DB@ERAKADIHGEIBCGIIECFaGLZO@EFCNGAGDGAKL@BMG@IE@ADSDEH[JGC@CGA@BMDeK@EIACFE@@GG@FIAMM@CCGC@EM@ADE@CFMAAGHBDKIEAJG@DOGCDEKAGIS@KFCHKAEHIE]BeKNO[IFIOELC@A]GMBKVYCDDgGAICARc@MW@AQE@DGI@@AQ@@BKBAIQQYEFW@CEADIGGBCEIiMEMF_LGEKMBBDWEBGRC@E_CHYGCH_IAED@FFBQh@FGJaJ}AHRAREF@bE\\C@CT`FHC@\\BBF@BID@HGDDJ@@FAHKBARECKDAZBJIVNHCTA@EREAMLHDAFFBVFFC@RNRETHD@FOJMACH@CAB@P@DF@@FGDWE@FFSIEMKQDYCCHKb^JADOCIDGNDBdBCFJB@EC\\A@BJEA@JAAAD@HHD@LFBCFF@BERDHNhZQHMBGHOACCEBWEGD@PSJKCGEUD@CINLFGHE@AJK@HDABBHTB@F`DBFLBBHEDARCFG@ABJBAPVFE^FBGLGCFG_BMLEXGAAFE@@JNRVJHFALFBEHQJCTbNDHCF@PlFLJSXCHFHfVBTNJ\\BPJXC^FAVNFCHFB@FFH@JF@\\ABCFD\\BDMCAAJKQBGAILOEGHILECQLWFENJHADC@QxNHFJNLDFA@CBA@D˜UÂmR@FBL@BD'], + 'encodeOffsets': [[ + 119959, + 40574 + ]] + } + }, + { + 'type': 'Feature', + 'id': '120115', + 'properties': { + 'name': '宝坻区', + 'cp': [ + 117.4274, + 39.5913 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@TZbB@JHD@DODCLM@AP@LL@BNH@ETFN@`E@DNG@CHLBCJA@AICFKDDBKA@\\N@AFNAGRBFjFFFL@DHLBLFQPcXAZMJ]GAVHAIZJFNE@JpDRRDCLFDGXA@EFF@CFFPDfEBDB@DCHCFCJDJIJBLI@I@CB@@ADBB@FALADGDC@@H@BB@FZGFCCE@@FMLALJDAFFFEFDFCB@@AHCF@L@@BBB@BB@FC@E@@R@BEL@HEFD@G@AH@AIB@@@FEFEBALDDEFAFO^IF@JCBBFPNJJ@D@PRDCEKBAXL@BIFD@T@JE@BHHJORFDI@@B@JGH@@B@BDDLIFFHCD@D@DEE@BAAAB@DAF@B@H@NGLJLMRDNMfGIEPMI@GDAKK@KIDIJ@GE@CFDN@FE@GFEPGV@TCDFKHBBF@RW@DD@@ID@TJFKIKLI@EP@IGBCLAEKLEN@KSHIGYACSD@SEAMBBMGEBMQBCMIGKFB[D@HDLPHDBC@IFITDLG@IIIFGVBNJDLN@VIRI@YIAIHIC@CLKZCBEE@JECEIHEAKGDGECBGEEM@@DA@CCCBBEGA[GEDBBoNAAH]MKiIAWKQoIIPMFQAEEDMH@FMSUYIeF@EK@BIOEKJEBICFKaKPFAFSE@LWCCFMHDDEKESBOGBKIEIODLG@CCDEQCEDWEMDIEIB@EHGEEDAEAa@@HqDEJGF[AECCFa@WCEIKAAEQB@FCAE^YDERDDJBLNABD@AJGLJF@FNIAMLH@FPKLJ@FE\\BFOLGXMXW\\C@KPGD@JHDGVFBWN@AEAGFO@KH@JNFAHEHYLNHFCLBFBBHo^MAFGA@KJED@Jó¶EX'], + 'encodeOffsets': [[ + 119959, + 40574 + ]] + } + }, + { + 'type': 'Feature', + 'id': '120223', + 'properties': { + 'name': '静海县', + 'cp': [ + 116.9824, + 38.8312 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@NGFMDATCNDR@CCbINEHNJA@C\\EEGVE@IhE–[˜w”epc¢·²›^QEKIEKIgiQDkehY£uSDBMkUDOJDHC@GF@CAFBFEN@C‹Q@BeP@@G@HD@@MHQKi@[IGCOCESE@GMA_OcCGDu`aˆ@VZzKDkJBLNXGDqKEWE@cFEFA@ƒISIi@@KMABJGBcMuFEzGVH\\ATSEUBeALCEMG@CEBUHUCGXaBPtUBBFIBFTDFF@DDKBFNGBJPHXDDMDCLJ^mBIHIL@LR\\@LCR[@@z@NFD@LLBNb@RHDBNTPT\\F@BJF@BXCFBHHBDLFB@HODADE@@JHVXCPDHCFTLBBFNCDCCCU@@GAABEHHZHBCAEdEjFDD@GfD@DXFCHF@ERFDLBH@'], + 'encodeOffsets': [[ + 119688, + 40010 + ]] + } + }, + { + 'type': 'Feature', + 'id': '120221', + 'properties': { + 'name': '宁河县', + 'cp': [ + 117.6801, + 39.3853 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@BFLBFJXDb@DEFD\\BHEFIrC@Gb@FBCBFFGH@FJAJFNCXFFCRDCFDDH@CKJPJFALPHTALFCFGCENDDKXF@ETEBO‚bLELJDFALIPFAJL@@FfEZJTVENG@CNFFRBNEJOpJLRBXjJNLG^BBpMAAFC\\HHBAFDADDB@@CN@FFAHFDCHLHFBJGFCFUNKJJTD\\XUXF\\^F@DDDQXXBRLRCBDFEVCDLVDpUl@LEDJHAPRFGL@CETGPBTCDDVI@CFF@GFDCCVGLKEK[Y@MECISG@BKNSCGCKWEAaEBEKNGFSECO@GGM@GYI@DÅCMLHPTF@DJHAVVNKEGDETJ^[TJNNd@NOAMFYJ@@GFANDPEJB^aOadSTQSI@MHBDIEOKCG@EEFCKCqXO@@DMFENCDDHCCGJ]AKFoDaGGHYFDHKJiCMFGC@EQ@AEHGAC@IEAATKOHGIC@IXIFEoƒGE[JCFCDHNmRADFZMF[EEBMO{GU@AOW@@]ZeHBDEHBKEfQkuIWBs‡@EC@d[@[^EDMTKCEEcI@cDAB@FCBCACmOCG{PYHeBgPwPFDDALFFFCHQGSD@BHFAR[TaFYXMASUiGFL@DQNCJI@@D@PLDN`ETEFIGMCGBCE‘~CAIFDPEHGEQPHJADFJGHCJLB'], + 'encodeOffsets': [[ + 120145, + 40295 + ]] + } + }, + { + 'type': 'Feature', + 'id': '120109', + 'properties': { + 'name': '大港区', + 'cp': [ + 117.3875, + 38.757 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@JFFL°_`ONJKDDFIFZN xlb~yFVNRŒrdJGzDPVFBCTNND\\UR@E`F@@Ip@IWGUoawOEE@ÏDgK{İEEMFëC—b…™@—KwOCDHHKBDJCDEEEAGHOABFABMCgDLSQ@CFEB‰MgYIDQINE@AUSwSAdYEHQMEyK[KI@GRMLE@@OqOoBOnpJ@BmEAFHL^FDB[C@BBDVFAHFJENB@sNEjQAMYsUgCSBGDJH@\\LjGR@NC@@G@HO@AfR@DŒM@EFEADBE@@HGDICCPlVANTC¤vgZlfRChjLJ'], + 'encodeOffsets': [[ + 120065, + 39771 + ]] + } + }, + { + 'type': 'Feature', + 'id': '120107', + 'properties': { + 'name': '塘沽区', + 'cp': [ + 117.6801, + 38.9987 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@|ODHnPBDADEDA@CB@ddJFFLDNSFC\\]\\@@cFDˆ@nACOMW@M@ITURBRZNHNWRQšoO•j½f‡cqŸAqeiDÿÍyÓįFL|Ch@ÐFFxPpbHVJXo@@JCTR^BPABQA]^MB@bE@@FQBFVJRH@FXtPNZSBAja@@NƒDTŽLJrQTHFXZFB`'], + 'encodeOffsets': [[ + 120391, + 40118 + ]] + } + }, + { + 'type': 'Feature', + 'id': '120111', + 'properties': { + 'name': '西青区', + 'cp': [ + 117.1829, + 39.0022 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@LHAHRHATh`LHNHDG`HDGZ`D@FQDAHXFACNAFLVRTBFOfHDCVBFQH@HSXHEPFB@LDBF[bDbLFKJBFLADBDjLvCPEI]FGEIGCBEUSjcFiBIVWfaHCjN^HtwBBFGPBJGjFBEGECGDONMFAP]TDHQOWCMGAMHKIJEIGQ]aDlUG]VGEGDC„{PEbBZmE@@GH@BCA@FMQCFMYMJECELCMI_P¯`]R±œ¡¸od“f—x•\\gF@JUFFH[F@DIBGMMFaJDDQ@MCSDCBENMH'], + 'encodeOffsets': [[ + 119688, + 40010 + ]] + } + }, + { + 'type': 'Feature', + 'id': '120113', + 'properties': { + 'name': '北辰区', + 'cp': [ + 117.1761, + 39.2548 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ROHFFGCOJEDB’}DFHANDJHFEFSM_KC@O@CJ@DIRM@CEKKA…L…FKACHoLSJSIBETDJaEIIE]E]K[MYUYQILC@GF[MGNKEK@A@BCWECAIFEFYAGFOMI[OFuDiKACBCEKIAELaKaCE\\CA@KEAFOWGGTG@ERUACDeGEPSAUQKHE`FNjNFJADHHCJFB@DEXZFRRBJLA@AR@@BJ@CHF@BRX@@NQdDBBJhHCCZDLUNA^H@BKDPFEJ\\JMPfL^AJFFGLBDGLET@HJLBCFHDCPH@BIJFCLGABHNBDEF@BCN@@FHDDDN@BNEJH@@HF@DEJB@FfLNC@AHB@DHD\\IFGTCBCF@@JNH@ALKHBHCHBDMFEP@KYbHDEJF'], + 'encodeOffsets': [[ + 120139, + 40273 + ]] + } + }, + { + 'type': 'Feature', + 'id': '120110', + 'properties': { + 'name': '东丽区', + 'cp': [ + 117.4013, + 39.1223 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ZV\\N^L^FJFFJIbSCAFTJTIpKDGLB†E†KLBjHTVNBZWbE\\SBQGE@ATCRHDGEEKECBECxOhOfAZGA_YEEWSGqRKIS„C@Mb@BiTAMYsOEWG@IQEURA@EF@@acUOXQRYCUDCHDTEF[SUEgAYDcVGJM`iAWDWLQRMHUHgDsDBLHJFCFDFGHBFFVEAGHCJN@RJF‡PIhBD\\FENCPWA@LFBAFHBEJUEARCDIAEDQBRNa^'], + 'encodeOffsets': [[ + 120048, + 40134 + ]] + } + }, + { + 'type': 'Feature', + 'id': '120108', + 'properties': { + 'name': '汉沽区', + 'cp': [ + 117.8888, + 39.2191 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@LMEI\\MTABKN@FCDMH@COAcH[AoēA™M¡Wa[Meq™pQRMXMGQYQASV@J@NNXDPmBAtJXlveRLFGACFGAYf@^X@BPV@|HNPFA\\FNEEYBCnQGMDCDE\\IHFp„EFWJ@JJDGHLPBSFB@JBDGHBFR@@FHDNEjDLICGZEHGbHpCLE^BHIDDCGDCFMNE@CP@rWLDEDFFH@'], + 'encodeOffsets': [[ + 120859, + 40235 + ]] + } + }, + { + 'type': 'Feature', + 'id': '120112', + 'properties': { + 'name': '津南区', + 'cp': [ + 117.3958, + 38.9603 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@TLv@CNHFFBHGZFETNPhCVGNGRQXKXCjBN_HIdUZChBVF\\TFECSDGVCZDRQPWdVNA^]RBBAAOQ]DSE@F_Q@[VMCSMADUECOHycI‹qMQEU}zkaŸwENRDENB@ADG@@HF@YnaAOFƒ|CDFHUHH^kVbCR^JHIFLJNGHBDNPXGRSCO^EBMNCPDHHFAFiEIHOAEH'], + 'encodeOffsets': [[ + 120045, + 39982 + ]] + } + }, + { + 'type': 'Feature', + 'id': '120103', + 'properties': { + 'name': '河西区', + 'cp': [ + 117.2365, + 39.0804 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@d@hZNFdcLYXKRCtCMOFSYEGHEAGEDMu@SKAAsx]GMTGt'], + 'encodeOffsets': [[ + 119992, + 40041 + ]] + } + }, + { + 'type': 'Feature', + 'id': '120102', + 'properties': { + 'name': '河东区', + 'cp': [ + 117.2571, + 39.1209 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ZBVFFIGABEEA@KXBDOFM[EACJgˆOIE@QIMGDBHUFEEGAEHECEDGIAKQDWLKZcdQPEP@FOFBJTJ@HNORJf@DBCN'], + 'encodeOffsets': [[ + 120063, + 40098 + ]] + } + }, + { + 'type': 'Feature', + 'id': '120104', + 'properties': { + 'name': '南开区', + 'cp': [ + 117.1527, + 39.1065 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@NMVDCG\\E^B@HlB@YEDS@C…HsNSiMGDebUXAJEjidVTAFHDFJ'], + 'encodeOffsets': [[ + 119940, + 40093 + ]] + } + }, + { + 'type': 'Feature', + 'id': '120105', + 'properties': { + 'name': '河北区', + 'cp': [ + 117.2145, + 39.1615 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@DBXFADB@L@LFHM\\NHED@JKZRb]QMRAFCJBDCBQYADMCAe@QIMP@GSIAIPE@E[EGH@ZEF]^HJAXK@KF'], + 'encodeOffsets': [[ + 119980, + 40125 + ]] + } + }, + { + 'type': 'Feature', + 'id': '120106', + 'properties': { + 'name': '红桥区', + 'cp': [ + 117.1596, + 39.1663 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@J\\PNHEZBFEJELEL@BWGI^]FEkA@G]A[FDHUCMNEHJ^'], + 'encodeOffsets': [[ + 119942, + 40112 + ]] + } + }, + { + 'type': 'Feature', + 'id': '120101', + 'properties': { + 'name': '和平区', + 'cp': [ + 117.2008, + 39.1189 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@D†T@FCHG\\FFOROMEgYc@'], + 'encodeOffsets': [[ + 119992, + 40041 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/world_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'offset': { + 'x': 170, + 'y': 90 + }, + 'features': [ + { + 'type': 'Feature', + 'id': 'AFG', + 'properties': { 'name': 'Afghanistan' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ࡪ͇وŐǬϠڐŶӂʮǚڦ۾njƀ̚ІɣʪҴMوǯʲĹ،˒˰Nj˖ϪԈiżŬĘͺβ̈Ҕȏĝʱʪ¡ý۷ͪ˟̊ǰώĊԼϖׂ×ࢀAƬʋӧĥяƹ७ĭࣗǭӫλȤΣĪллΛ–͑ɳ̡ߛ€ͦ։՗ɅΥԕ²ԋ͡ɿ̳þٝŋğɻسDҵӇ‡܍થΓבôǝȁԇņ࠿űටіހހåզُƚßՔ˟ڢάҢιŮɲؒ΂ਸ'], + 'encodeOffsets': [[ + 62680, + 36506 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'AGO', + 'properties': { 'name': 'Angola' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@ȸصʌԋȘ˕͐ѯ֊æˤŠҬşŲɀɂӨԶ®ƤіHñ̡৴RfՉǞ͕ūԑÖԫ˪̷­ৃȼüκsԴŴϦ¹ĘʹĩСƨϿů̿î́ყZᦵ֤ۋպԽ໳΁᎝Š׋Ж₭—ŵÏԃϞկ~ԉƝЙDžÿՈŜ݊̂ޒªΰ˚ݶȨΆӘռːϐĘج«ӊʣ̜ɡԚȵԎ®Ǩʶͬʭ߼ǣ֚сՐĄǎΌŔʒg̎ĸៜ['], + ['@@ɉėɣلͼδʪƘ̀˽̩ǯƍɍλ'] + ], + 'encodeOffsets': [ + [[ + 16719, + -6018 + ]], + [[ + 12736, + -5820 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'ALB', + 'properties': { 'name': 'Albania' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Ń˷ŢέΒȳiə˗ŧ»˙ϷСƛÐgȂү˰ñАîֶŖʼƗƂÉˌθаÂƿɨôǴɥȪďȨ̂'], + 'encodeOffsets': [[ + 21085, + 42860 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'ARE', + 'properties': { 'name': 'United Arab Emirates' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Ƭ¤ŒɱڂƂ۞uԖ{ֺ֪ظՠՎԮdž˹ŖڑѕGçճƪŝϝǑE΅ʓΏuͷǝDZᡋъ͏࡚Ț'], + 'encodeOffsets': [[ + 52818, + 24828 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'ARG', + 'properties': { 'name': 'Argentina' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@ߗ§ѓ̔ԑx࣑@Aሞ͒ϵрؿનԋ୲ȿϙп'], + ['@@Ӵ؇͠ڰॠ“ƊǷ໶ോۊŷਆاࡾ͡Ŧχࠡ౧ࡒɭ़ŷڔƈނ٢ƎݐжLjфӝiڣۻҩ֟΁ॅࠃ૭ଧȽڥɣࡹT࠷ǽȇÝիËѫ੨ܙŗ׃Հν§Ч߯ઁఛ҉။ǩउĎǰԅǣػƺщԋ̏ࡱř̪͕߱ɗŜ࠳֨ʧҠˆʢѧޛʻڭԹūࡋȣ҇ߏEڃљʋؿؙࠞߦǝ˿ݭ঳Ӄձটލͧ΅Ͽ˔ࢍ֔ӡΟ¨ީƀ᎓ŒΑӪhؾ֓Ą̃̏óࢺ٤φˈՒĭьѾܔ̬૘ěӲξDŽę̈́ϵǚˢΜϛ͈ȝॺ͸Ǣƙ਀ȠࡲɤݢԊ̨ʭࠐEޚَոo۰ӒࠎDޜɓƶϭฐԬࡺÿࠀ̜ބռ߂צԺʥ͢Ǭ˔ඔࣶд̀ࢎĹɂ۬ݺશȱ'] + ], + 'encodeOffsets': [ + [[ + -67072, + -56524 + ]], + [[ + -66524, + -22605 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'ARM', + 'properties': { 'name': 'Armenia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@୞ƀǨə͌ƣǛɁ҄˽ʁˋΦɫϘƏl׋̣}΃ӢHżχCʝɤǩuͧʖرȼĄФƛ̒'], + 'encodeOffsets': [[ + 44629, + 42079 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'ATF', + 'properties': { 'name': 'French Southern and Antarctic Lands' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ը˃ߐĿˆDžɽϣಇÃq҂ŮΎÊǢ'], + 'encodeOffsets': [[ + 70590, + -49792 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'AUS', + 'properties': { 'name': 'Australia' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@ߺ́ҜŘپNJԎÉÐঽ˽́ēگ̉ɰ׍בǧ®ԫ€ԭܘŗֈӝܸtϬռõ'], + ['@@̢ڇբ̈́˦ΡЖ͟đϋǴܛŸнɄĹɬܕąѥ˖֭࣬ѭצЋ֞λŋȯӔՃࣧ͜ͲȂ;ηȴźƢࢹ׬ԩϸ͋ڀڹʀڭtӏËԳА܋µݓơϵɩݡjӕǕ׻χއثЭ̫ٱ˫гʝܧ͕нɅػʼnׁªˇӕ̇व‰ޡ·ϫ͙ԕέ۟ψԥƪżѬҝǃ݁؉ܩɪӉƄӑÔ߿ʐիԮƻْțьЭ;߱ĸˢРȯزЧ׉ݝƷѮҬŶӞ͘ЬãجہܑԿ˽͏ڛٽΊ~ҀԿ،ѹ̀ǂȘઃԚןz߯Цຓāછ̝ख़˫ߡÈࢻљܯȗljѱ̳Ϳ܉qՅõݑƶ׿ğֽԁ҃ʕœуʁЗˋؕ֛Bࢽ՜ҋDŽlӖкŘƚȒ‡̠ĺאģӼѻࡖƏӒ˜ӎͭնsʚϋͰĽڄӓڔřΪτε˳ެиʑʞ͗aјеڎă˄țʦĠӠǢȸŘрęӮΎ؀Úٕ΢׀ۀˬЦΪٜ̰ϤàɴĻڎ̺ԚĤŶȀɞüҬoࢨʖҚώɊ҆ӲѐœͲvҘט܎ΠܩΦǚ̗Ј˂ТψǻĸٖҠаȮͨцƜ`ɼτĭdɂτŦОŔبϫҲӽՂMՖÿDZҦДڪϜɘſȾκӒԘ̒јıۺǂeі؛ˢ҂Ū֎ȻҀ·ۼɋʈĐԶʵӬʊ͂ñȠNJϬеɡ͉҇ͻ˿ƒĮͱʙп̗ЭÔʁڜҫ٨ˏѠ́؈ӻʂBѰɍŶʷߤ˵ֈ˼ǐҊǠόľҤʰڞŝОÔʔīӔŌنLjǠŽˬȮѾdžҦtʈ̸̾ʂЩÎՃȾķ˜Λ̨ёÚӇ‡̥'] + ], + 'encodeOffsets': [ + [[ + 148888, + -41771 + ]], + [[ + 147008, + -14093 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'AUT', + 'properties': { 'name': 'Austria' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Û΃ӁCǎǻ˧էLJƗܽsщȏۛÞயɐȉ̊ࠧƣĭDžԗŢѕxϝƶźȴƬʪ²ьɹŤɜݎ•׸ƮЖ}ˀǣþƜšո̠ń̒ϰز˓ӀΆ̐ÚٶʱЂªϰǁãŃČ̅'], + 'encodeOffsets': [[ + 17388, + 49279 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'AZE', + 'properties': { 'name': 'Azerbaijan' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@ʞɣψDGŻ΄ӡֽŒщϰƃ͆Ǫv'], + ['@@ϊËƞɈԈͺѴѵђ׭ϺŸʸɧۗãƣٵƟ̭̍ȝvзȽ¥ԻѲ̂дʝʚ̿×যإk׌ϗƐΥɬʂˌ҃˾ǜɂ͋ƤǧɚȶƎضʍҐ¹ŘIJбҔɔŚʀ…׀ԙ'] + ], + 'encodeOffsets': [ + [[ + 46083, + 40694 + ]], + [[ + 48511, + 42210 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'BDI', + 'properties': { 'name': 'Burundi' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Á০ɃϢԜßʲӎҀŸͧǸȏT˗ȹǭ͛ѫ̧̥΍Ÿ'], + 'encodeOffsets': [[ + 30045, + -4607 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'BEL', + 'properties': { 'name': 'Belgium' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@؜áުǪՐοҦȝħ֧ɕĝһܿϦћßדІϷͶϷ`ũ̒ڪǔ'], + 'encodeOffsets': [[ + 3395, + 52579 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'BEN', + 'properties': { 'name': 'Benin' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ۛįȹ׆žኞǛǦЮ̇̌ʱʞņѶ̀ĨǠξЪĀȀʤˮʘ̠F٘ә˩ȎӽǓͷĘɧСԳʵʳǁՉt՗µണ'], + 'encodeOffsets': [[ + 2757, + 6410 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'BFA', + 'properties': { 'name': 'Burkina Faso' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ֹɐϽ‹̍Ƀϗǰƥ˦ϙǾÅӦɮΤo˴ښۢŬּɲȴОœΚǢŘɎٴϖdžˀ޼ΒҦŢɀLJՠJáСŔϣӀչ€НॺȏmֻǿʣЩÿǟν˿ħ݁lϳâ˓ƉωÖร¡qӉŘم'], + 'encodeOffsets': [[ + -2895, + 9874 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'BGD', + 'properties': { 'name': 'Bangladesh' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@i׽̉ŶÆگʉѬµєDžКΕӨޟ’ü΋˃ҳΧǠũƵʃĠ͗øŽۖ̅لƜԒԫɤȆ̪Հ̼؅Ѽ֮̔ږεВ£ô׏ߞřު^Ӟƛϯ܅ϕµʷӍҢѥƎ՞ɶFѶ೯'], + 'encodeOffsets': [[ + 94897, + 22571 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'BGR', + 'properties': { 'name': 'Bulgaria' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ʎΉ͚Ö٦ſ௾«иɌবȜ̩ؒӴĕѥΏ̫׹˔ӏܣŒࡥ˃Uлޅÿס̊ڧɱة|Ñ֊сːƒŢĝĴƘˌ͌ˀСδ÷̬ȸȐ'], + 'encodeOffsets': [[ + 23201, + 45297 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'BHS', + 'properties': { 'name': 'The Bahamas' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@ȵ£ɇӜ̿ʐǾՔʨ‘ۣ̎Jӥ'], + ['@@ࣷƅÏ̴Ђäֈ{~ɕ'], + ['@@ƟׯƷņ`ѮϓͪCĪڐϗ'] + ], + 'encodeOffsets': [ + [[ + -79395, + 24330 + ]], + [[ + -79687, + 27218 + ]], + [[ + -78848, + 27229 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'BIH', + 'properties': { 'name': 'Bosnia and Herzegovina' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@̦FȿσМ͓ūЃȡ™ƽû˙țūҥݓ͈ͅΘ͋Ȅϭ̾ǻʺЩϾǬΒ̞ȕǼǨϾnܠƓ׈\\Ϟȅ'], + 'encodeOffsets': [[ + 19462, + 45937 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'BLR', + 'properties': { 'name': 'Belarus' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@߼Mࣰ̈́ȚӄېːÿϔԜƚ͖ࣘࢮɁŢȻѲĴࠒȧĊЁǷɧՄս΂Ƴ»Ʊ֦Ʃʎɡ͝ǿڳˆljÿȠ˧ȸ՝ܝ¹ʵȁÃхͭĆݷ¡əȞ̿ƥ́ŨڍjफȬࡕàٱmҡɩГeϐʷϴԌǢLͰɷ͌™ϊ'], + 'encodeOffsets': [[ + 24048, + 55207 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'BLZ', + 'properties': { 'name': 'Belize' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@OŮĸžƴı̞ԔDŽZHūDŽGaɭƋεôŻĕ̝ÀăīщǓɟƱǓ̅ʣ@àॆPژ'], + 'encodeOffsets': [[ + -91282, + 18236 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'BMU', + 'properties': { 'name': 'Bermuda' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@OEMA]NOGNG\\Q^McMOI_OK@CQSGa@WNLVWHFLJXVFGJ`ZRTDLeeWKIHGIK@@[MQNi`]VDTBHCJAPBJLVFjT^LV\\RJZRn^RH`TfJjZHHOTTFJP_NOX[EYQQKMEJOLANJH@HQHAARF@ZEPS[U_IcRQXE@EEKKOCGGCQCOGISKYGUC'], + 'encodeOffsets': [[ + -66334, + 33083 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'BOL', + 'properties': { 'name': 'Bolivia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@य़”͟گӳ؈વȲ۫ݹ؅ŗ͡୆ҋऺˆ߾ѳ΢ŏ؆ЫֲՌ࣢αۺȖ˰ƭ̶͠рh܎¤נǸ˶ܩഠزíѠnȈʪ݀;Ѷ͂સƚęؽļ͓ãࣰ֛ݫऴƑ̻ͦ֨ǕΐʑՈTӦʟšӟǐʕZγʓa͒এྖ“ūӟĜͧҞɽȤԹƫڋɯρĄӏʿǥaʶ޳јޭ^ัʓЕ݋sҋͥ৕ƉǸ'], + 'encodeOffsets': [[ + -64354, + -22563 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'BRA', + 'properties': { 'name': 'Brazil' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@૮ନॆࠄ֠΂ۼҪjڤуӞеLJǒӜŖӼBҦ̡ƴ̿Ƌ̻œį͔ýޔƿʤ֥ɪ΃ǏࢱLjÈଜʝҴˀǦăӐɰςƬڌȣԺҝɾěͨŬӠྕ”͑ঐʔbYδǏʖ™ӠӥʠՇSΏʒ֧ǖ̼ͥळƒ࣯ݬä֜Ļ͔Ěؾષƙѵ́ܿͽȇʩџmرîӃƟϡĪÈ౨ۏӷݏv҄ͅ֏¶DzΰұԞΓݴɜƶA΢ԖʎċҔɊ̈Ôϼ०ֲێNJŔŴݴŸϚᘰpθſӔύ̬LؐӀƒǚē†͐ӯĔYՀ࿖k˦̂ɸˉǐӷǂļҨѻٸÆnjʲشȞΊƐĮΤ׸ʆ¯Ǯ܅ðśՊ’֞ϓɒǀþجŅڜȿʐȤ؀žल̮͎̾ŏʂѪšȜȗʼnσ̀ŵȖϷɷ̏ƅ܏ɌыÔϳԬϿЮ¥Ģǒˆ˜ϠƦ˚ɢҬíȲŠҚçøǢƗǘĎʐͺõЈĒӔDZξǥʺɪȊ•ŘɿДÒ͒͊ʴؤӼޒ˺¢ȺҫҼ฽҈Ƒxׅمەʾʩ๤ƁŠࡃٔր੐̟ඊԡШӱƏҫ঎ʶ࿐ѹఴŽఔ۝੸व٪ʏܖ‘̦˅˸੭Ɣԗͯ൹ёշஅୡՙोثܯȿgɻءÒ༽ɹಓęօˇͧƫ૱࡛઱ƛࢁڹηȟԋ࣯Fೕ͓סύवʗ঩ڝ܅࠯ũطƔҫƽࡓȏЧחҥट๕݉ڗ֯Ͻϥߛ։ӑɷӈψЊӟֲڇҬࡹՠ̹{ࡅٰձę'], + 'encodeOffsets': [[ + -59008, + -30941 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'BRN', + 'properties': { 'name': 'Brunei' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ͬ̾܎Ң›Я·՛Б€ǭ˹ϥѦ'], + 'encodeOffsets': [[ + 116945, + 4635 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'BTN', + 'properties': { 'name': 'Bhutan' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@΂ˍÏԩۇ{ۿÈՇſޅ͊kǚ֌زҒɈ׸șѺqπɥ'], + 'encodeOffsets': [[ + 93898, + 28439 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'BWA', + 'properties': { 'name': 'Botswana' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ǜƭ˄ӡॎइήĝD̑ʚՑٰŹ՚ϝ஑أݭع˩֓ʧ́ҙãƧГďʽ՝țہ¤БɾΟĸХșȵГЉʧпϑ׻đȇ̐üԠӽߚɧŲAរࠤˆ|Ჾش„ಖ͎̎΍՜ͤʮDӂȎưÙ͔ڣ'], + 'encodeOffsets': [[ + 26265, + -18980 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'CAF', + 'properties': { 'name': 'Central African Republic' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ۜÚƺɎƔgȾȏ੔͐Τ͠Ѭ̌ĉ̐ʂüߺ½߆ϴ؊ࣺю;ՐƜĪΫӜԿF΃ƋΓÄʻ̆ʍٖοҢͻT˗֠ѫΖεɆԋغͩƊˉˣęաpكĘ̹ïųȱ˕}ͧDzधнϥĎŗÝʥԕطǐؙĊ՗̴ۓ˸҉˓͛яùדգ²֩Ƙԅѻѯޱėʐ›Ϧϧ˔̳Ѡï̠ЇѮæʢċΞÞٴȬƴц࡜'], + 'encodeOffsets': [[ + 15647, + 7601 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'CAN', + 'properties': { 'name': 'Canada' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@؎œުxЯ΅̵Å੥Φȿˬ͆ʸ̎С'], + ['@@Хcઝ˂ޯІ̄î૆Ɂ࡮Η|Ʒ'], + ['@@хŝൡϢʥ̘ݩ̌Ưʈࡻư͕ҜðȚࢨǿԨŵ߄ė˺̃дЋ࠼΍Όҩ'], + ['@@։ܿո˴֠ǵ̏̉ݚɱϰȴ࠼ʵʹ؛טƞņѿʼԷΝ݉ϝ‹փǂǾیɻńইܯԅ†צЂ߫Ȳࣙ¹࿅~ŹʠԼ̐λɬ۸Ԓࢄ೾Զӎܲ̂϶™Njɫ҅Չ'], + ['@@@@@@@@߰äʥ॓ܶگͯDԑϪ̵ϮчʾƻτºˎЂŋ'], + ['@@͡ѳχîəʢ Î͖ʦΆkɈǣ'], + ['@@ঝҧץnǿɪزϲ଼SiǍ'], + ['@@ƼυјżӨɗं˽४ʽöЍؤÞ׶˥ݙ˃ಳȬҽϚ࠭ҁ஡ѣ˿Ӯଗăܴдņڌ˺ޔ؈å'], + ['@@ष¥ȿЪΦҼޖŜپɷXέħřձʛ'], + ['@@Է̍ଉʬۃğଫϘ݊ʼטζࢼʃԎƯʦDžԠ͍'], + ['@@G࡭૰ڄ৐եʡح߾֥࢚؈ؖܨ°ईஞÝఔūૼй¼зس҃פ҇ŃУ࿩חୡŻࢃʨʣуߵ۽ʓοই֩ளÇڏΡÇձ঍Ŀਉڻ࣭ु͙ڏ±উంƕϜ޻ϼّ୲ǔ༞εࡀ͋׺Ѕ੆ɳࢸΟ൶µࣴąƍܫʼࡋ،ळనߗ٨˚ҔࡺѭೢףѶഎЀ॒לҮהç֭֘܌৷لলࢤνݾ˫ಾגȘ෸ɫࡸć۠ɚ޴˵ਚӣʮ͙ຄÛ}۷˪ਜ਼ގſ،ӵ௖Ұߦऔ֌ϸٺݣબੳघ৙͵Յ૤Ӂݰӓംɏբˍͬ܃ټŏͶͅÖऻ؍́׽̏൯̗੏ۑ෇ƋᅛǮుPࢇÍ۱׽ੳω௉૗ॵޡ܌Ɛഘૄᄈ۪సČݔЫߍ֟ˊࣟ˜هતп൸ŨࡆीÎ؍ժ̥ਣսᇷԁ࠯ͽय؁ٓ֍܆ฤ۞഍ƒणĹջӆBନύʐ֛ƛ˧ɚٙىʱٹ̕ϡΥŽˏ¥čȹ໽A౥MϛƷࢵ؃Ŀßˍ͝ޗBࠛGϛƅƊǑøʯeďષлࡽſউ҅Ɂ@˷ƂĥŦnĔȂ̎ЂҦʘӺǙܴǵނ࢕ЂľƬūĺɳ@ǛƆ¥ȤǍēɥ€¾ĊȡĊćɚٵːڹ˪ࠑ͘߁̨ݧʃ˝Sਕɔڻʼnࠁʺ࡫Ɔו¾ʻƜƫҤ˳IE͓჏BᮝA᭯@ᡃ@ᠿ@៙@ᢡ@ࠛ@᠁@ᛷ@őF྽ࠜ׵δຽΐҳݖŤԨ੻ΨƧڴ৭؎iѠҲКwՌෙ՘࡭ॠՁ׾ޑϚ֣ΈѿѢࡇ˕ࠇҹݛւדπࠋɸࠟ|JⷎNᷲ༬ȭ೘Й࢘û݆ΖৰˀఢĹ఼τ൘Ⱦ־ΑظȠȊЄ׈ęෆݫ૦֬ŖّਔƐ͆ʖৰ·౼Λዸ̭ୄƛࠖÄଊэ஁зຶǷᗘIJܒƦࣆԋࣴьࡩΦժ˼৾žڦĎڴȩࡊҗरä๢ϛಬƄ௬oĭԺݞƦದ˵KߑՖڠڰuϞࡊ࣑԰কͺäघশ؎ૌƇࡘχଞॅݗЭ༠ǝ'], + ['@@нϿሎʬୠщॊіސ˟یࠛфΒ׭ࡰ݊Ŭ࠲Ƈश͹ՆࠉʼץථеະЉĝσൡã՚͓˱ູ̯Ƃฃɪঋ»ཅ˷ᒃű๻āҕІଫɮݙģਛږ֔ĚಘƜஈ›રƦྷȞᅗã஗jѷ̴ዎͲಗ[ืɚ۶ـגͮᖬԠ࡬Nj'], + ['@@݉ևಹך˸Ş૸’ٔȁ'], + ['@@öɵࢿ|ࣟjࣿőʑ¼ऍѾ˜̠ИÈነěชң'], + ['@@ڎԽޤڴᒆΈ෺ࢅůջဒʒߒͮሀыୄЏŊν༚Ȑ࢘՗᎐ܸͩ͹ߐ޻໯ϹጘչೲȁீޙೖÇʽכ้ঋਗά೓߲ઙĿŁӕࢪӥଜϯΌɟմࠩ́׿੕ɪᑏڨஎܣ࢔ԕƎ̉ᗱͲᅩӤ৳Ц̌ʂయќ௥Т`ʑᝡƅ܃˾ֆؤ཈dႸņ˫̜̊оચࠊɳϊ͕˾౿Рၳ˺՞ɆࢷԺ݋´ڏ˸҇ʛ຿ŅᵝȈᄫʚഹŴۥ̐࢞Ϧ஝Hˉ࡚٦ݨࡺ΄ᓪɢأի'], + ['@@৊ǯຄńɖʑ޷Е౜αƱݳ൝͗߳ê׉͎ᐡٮjˎ႖ĽएռসР'], + ['@@࣓عय़ŒԽ݆`кѮΨ࠰ɮც‡ྈȱళݟ৉Ǎ'], + ['@@ᕍЙѷςኹѺήΤ׌ؘܰւࠑԦᭊƀ஬ǧᒰ±ࠄʑࣖΝ੍ɃᏝןਫי@ν'], + ['@@ҙ͙௝Øৱɖ҂Ϛீɨܼ̬̍ˇ'], + ['@@ٞϵ€љϣس൱đࣗƈjӬ൝ÝÁٮࣜౌ˺ஂµÜŎ'], + ['@@̙͢ݠƘࢢ™ƪЩԝЋ᭗Žᑯη౩mŅ˜პϊ④ij୯Ʈପࠐ߈ɾᛄ˳๶ӻฺÛறߨޔ̪ࢄĭ˲Џ'], + ['@@ढ˓ကFܨˡȑ́८ȍՔȧଊ™௬ë೸ǼႊðീÏ࣒ͅȊ΍ԽɟభǷ੽ĸᜱŻႫcഫļᖁ˔̃ҦĹжࡇξ჋ĺঅʼ͂ΈႾÁ'], + ['@@ŗ٣٩̇޹£༝Ϋ഍ŹଗǼ@@ුؼႮծಆ[ସŬ'], + ['@@ϣy༽Âɡɼၜ]מƻĵĩ'], + ['@@༩ʋఝ˔ڼˎ௮Đஈſ˩ʥ'], + ['@@৽ǏඉBbŤࡴʦҌદǝ'], + ['@@కǥۃȚέ͂áΎજ‘ӪÅ৐̇ɫ̣'], + ['@@͜Ε൏Ĥ൩˘ሏŒߺʠ৫ȮÕ͐࿶ŕᗢ̫ٞЍ'], + ['@@০˕ଽʟ༇ك๥Óდņࣗ΄^̦ڔɢ໡Oए˨ՑϠ׌ώ׊ʲࡴÎοȖዜ¨੶҅මǵ൞ǃڒև'], + ['@@ᖢßᅮŅ໤ɫ™ɡᏅη᎙ǟݻȉᆬJጡԙേʃ෯ۇႿƓՙǡᡷěୈĿׇƭ۞бߙ˽ಛʃЋ͡୫ʣŞȏ෬lȳᖟԋᔧɴឿŻధĸཟªĿЖ༊Ȑб؆ԢÐᖤγ଩բഹLjڼ͘๰Ȩʄ̊஋͠ΥѠᘞ—ڒĝ಼̪ቃĬ᰽Á๣˸۩ͼগʘȁ˺దLjঘ‚࿲ƌం̺ਬ©ࣤɽٔҒૐƈບĢᢲ–Ҁĝ᝚ƚᆔÁᆒÁ'] + ], + 'encodeOffsets': [ + [[ + -65192, + 47668 + ]], + [[ + -63289, + 50284 + ]], + [[ + -126474, + 49675 + ]], + [[ + -57481, + 51904 + ]], + [[ + -135895, + 55337 + ]], + [[ + -81168, + 63651 + ]], + [[ + -83863, + 64216 + ]], + [[ + -87205, + 67234 + ]], + [[ + -77686, + 68761 + ]], + [[ + -97943, + 70767 + ]], + [[ + -92720, + 71166 + ]], + [[ + -116907, + 74877 + ]], + [[ + -107008, + 75183 + ]], + [[ + -78172, + 74858 + ]], + [[ + -88639, + 74914 + ]], + [[ + -102764, + 75617 + ]], + [[ + -95433, + 74519 + ]], + [[ + -123351, + 73097 + ]], + [[ + -95859, + 76780 + ]], + [[ + -100864, + 78562 + ]], + [[ + -110808, + 78031 + ]], + [[ + -96956, + 78949 + ]], + [[ + -118987, + 79509 + ]], + [[ + -96092, + 79381 + ]], + [[ + -112831, + 79562 + ]], + [[ + -112295, + 80489 + ]], + [[ + -98130, + 79931 + ]], + [[ + -102461, + 80205 + ]], + [[ + -89108, + 81572 + ]], + [[ + -70144, + 85101 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'CHE', + 'properties': { 'name': 'Switzerland' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ƫŹȳϞƵіwá΅χƙةŀǻ͹ЏơƄһ˵Л¡αǶ˽ςБſ^ϠؚҾɈϤûɲƞ܎MǦǼ࣒ʱ'], + 'encodeOffsets': [[ + 9825, + 48666 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'CHL', + 'properties': { 'name': 'Chile' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@Bም࣒@Ԓw˧ͻܛʻЭ‚ӻä؏ʨ࢟ŨੑҸ࡫Ҏୃशۘǭ୼֗૜̟ѢϬ˘ֺޠΎװı'], + ['@@͢୅؆ŘĺɁ˿ࢍࣵг€ඓǫ˓ʦ͡ץԹջ߁̛ރĀ߿ԫࡹϮฏɔƵCޛӑࠍpۯٍշFޙʮࠏԉ̧ɣݡȟࡱƚ৿ͷǡȞॹϜ͇ˡΛ϶ǙĚ̓νǃĜӱ̫૗ѽܓĮыˇՑ٣υôࢹ̧̐֔ÄgؽΒө᎔őުſݝPЙȷݷ̣Ɖ޹Σoॅ˚१ג@@ਲ਼ӔˁՒʄӰх֒Ņ෤Φ߰ࢴٰౣʔߞݒ˸ඊत̏Ѯგ֝ɠʿ਻ՉŠ˂ல˺༒ϮָʍࠎéूΠ„Ԩപ׈എΤబȗ఼ʤۚĵਞӮਆưྺ˒ნˀሤÕ൘ǩ஄ќɌɦњЬֱŐ؅ѴΡ˅߽Ҍह'] + ], + 'encodeOffsets': [ + [[ + -70281, + -53899 + ]], + [[ + -69857, + -22010 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'CHN', + 'properties': { 'name': 'China' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + [ + '@@ԑഓΫۏѷ܂ĩخӶࠜڦَϨʡƣԓ', + '@@ܩЗۏʺyܢаϠࣾɾӚoȊ͍σσșӟ' + ], + ['@@ฬˍ঺ׯͼ߃౨Cܰͨ൸ʜѳݱ͙̭˽ः֡ࠇ৵ƪܝ̑ɜܙť঳ѕwLяթӺͯһಙαƀѹܩŒЍ˂ֽ׭ऑҋۃա୭ʑأϽࣝɭ҂ϴǭ͞ږ֠ѹѲܷ̓ॉ׏ԫթ࠙¡ѓϻѸ֩یƏ„ϕڔʕस׶ݚ͝լuƌѱஓɻϻҏࠇућיࣜҥͦࠝԞޓ֮٥_دՅɯȪ҃ӶʻŻۃɇڗҷ÷ؗࣧڹિޭোିޡୟۻृĩԣύ̃˘Ӈй୭сࢵŹ˻ࢱҭ·ə؎Ȧ͘ૻːЇƍࡍɔЏ΀ƄӜޏƶЙܑ̀҃ࠇīڡJ҉ȳѥūŶ॥҃x÷Ȣ}Ύ؝ʓεƸر͂ʔۤՏǎȧޜࢱƓĴাߔۮ”ۚ{٠νȨ˭ӶӭÙࣟŲ˴ΜϿԺ׳Ν۵ȸॷ՗އسڳĿοɦѹr׷Țґɇ֋رëڌԟǭওĈोȖڿτٵǔ˯ЖҽŦࡓոکʴΑȩଢ଼טࠛՒɽऐ׾ő‚іͭјĐۆࣙঠ൧ͼʝ٦ةϼƫʌųӎˆ͜ԛȔ˟ďɇިʈȔśȠߤЈ׈ǐࢸő͆՜ંIJͮ̚೜ҔŠȐãӐּɔݱฦဘͲјȈ؆ຒဠˡҲϞ¢ࡆۦĀٖ֔͢èɚו۸ѽப̿׆ڱ͕ঙ̢ηূƝଆŝ৪ԻԲġϤޟӲӿऒnჄȉ૤Ŝࠦůఔԛ৮BόʽঐҌബ̈ాŒঘ̒׾҈ך˰Ƌˤˍ͔ѴըӀùࡺǝ࠸Ѿ౲͚؞֊נʆ௠ŐڐĥĠ̘ݿזګː٥̳ࠣžӇŃɏΆר࠾Цو৚̓ஆՎQτݸࢾҲːWҪңȦۜмਰƲ૜vసʡ݈̱԰ࡏ̀α̊ԩ̶ࠕ'] + ], + 'encodeOffsets': [ + [ + [ + 124701, + 24980 + ], + [ + 112988, + 19127 + ] + ], + [[ + 130722, + 50955 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'CIV', + 'properties': { 'name': 'Ivory Coast' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ϣUוǒ՟Wহƥ׍ʍ̯ࠫNjvÞۖĄŀ}ͨΣΚˉÈʕɲǾώčО ʔƄB¸ξÝnjĄŜ̸ĶȹڨȗΎæ˸ǘÞŊúɸųٮOƸʖƢgʎĦžΫȞłΌŰϚǽƦ˥Ϙǯ̎ɄϾŒֺɏɠ஡Ο۷ɕेθܣ›ͧ'], + 'encodeOffsets': [[ + -2924, + 5115 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'CMR', + 'properties': { 'name': 'Cameroon' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Ľ°ӻŇԝŒЋÅ൅nŬڒ͟֊ϧƚǟϖɋŦXɶɎתЎ߸ʒRԄӮ͈bҾΉ־˲ĀΔȌͺžь҆ΊǞךDzȊŢѨɜ՚۾ٲ¬˨ĠƲͫͰ‚ˌʂ¶ͮ՟Ê֏‹֏ҜޅҷTʁÏϥČǻЅӸөμƛŠΏˆ׃ſɩх࡛ȫƳÝٳČΝåʡЈѭð̴̟џϨ˓œϥĘʏÓґڛȤڷɜ੗'], + 'encodeOffsets': [[ + 13390, + 2322 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'COD', + 'properties': { 'name': 'Democratic Republic of the Congo' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@»ঙͶŕˑ̗͓ɟ͍ѫǯϷ±ګț͍Oهʍɹ‹ԃŗÝýҟɄϡÂ৥ưޝċѧǘӣӤҹҒ੕ͥĒ૿ƙɣĵʇՙȊχƫষĻࡇɨƫט͝ɲƴìٟࣟR·Ҧ̳ΨٟŠȋѰԣ˅ڧŞ˫ϢՕüϽqµʾ́rϥºԳųιtȻû®ৄ˩̸ÕԬŬԒǝ͖eՊ৳Qò̢ѕG­ƣԵɁӧűȿҫŠˣş։å͏Ѱȗ˖ʋԌȷض៛\\̍ķʑh΋œşʼɊʀμƎɎ̪ǰɚđ˼͐ҜSÄʃ̼ƩӶՄӨШɆːƒ۔θࠆϬўքМĪˌt̰Ǝ̆«ӊŀݖǐԾʦ҈¸Ԕúה͜ѐҊ˔۔˷՘ؚ̳ĉظǏʦԖŘÞϦčनоͨDZ˖~ŴȲ̺ðلėբoˤĚԘۙϘķɤƖϲÅҶDzȦΫ݊֏'], + 'encodeOffsets': [[ + 31574, + 3594 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'COG', + 'properties': { 'name': 'Republic of the Congo' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@̿˾ʩƗͻγۏࢸٖҪ̓֌˾ɂ֦ĺäό҆Зݐ•ʴЈł֒ĝڀЉӺζ঄ȽǘسçɻѢÔξ੘ڸɛڜȣÔҒѰ޲ԆѼ֪Ɨդ±·ԓʥ҇ǏԽĿݕ¬Ӊƍ̅s̯ĩˋփЛϫѝηࠅ„ۓɅˏӧЧӵՃ̻ƪÃʄқT˻͏əĒ'], + 'encodeOffsets': [[ + 13308, + -4895 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'COL', + 'properties': { 'name': 'Colombia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ΫȤЭ˨ʅƅ܉Ŝȱΰƽ_࠿Ӓŕʺ̼ڛтȢ̦иÊΞՆ͐Ѵ̳ȦDŽӦȏސǸɚƃ܄ͻ҄ņТ˔ÑǂʠțӶĺŬѢـהΌĚT˦ƺ܂ӖϸՊfäǪڂéڌъ͞ȊОК̖»ɚɛǍ˱գƕɇп͗ʋʓ̷Ĺ׵ɷӭѢÇņϭȄȁâ͹ij̵ˆǫȸéȨ̉ઊĄӦŃעܡͼĚ؂­ӐĪ̔ƟƱҍȇ˯ß׻ǜ֑ʆʟ†ȉэл̨ȃɠ̋ʰ࠹ǁĻǏӸɷˊ˥́࿕lZԿӰē…͏ǙĔҿƑK؏ώ̫ƀӓoηϙᘯп҂ʣpժࡤٟϾԍị̈ƤҧɝصŀӵࢤϳɐˍІ֑Њɡā'], + 'encodeOffsets': [[ + -77182, + -155 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'CRI', + 'properties': { 'name': 'Costa Rica' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@җȆǟǮĬƤ‰ȄɷȪͥǔ́ņÅʖəƮÄʑǗȩȓɸˑĊŗǞLʮŎˆʁŠȖnjŴňֆɝȖŊˊéƔǥʜÇȪDzɈҙ͖ͷЂΩ͗õLͷǪűűıƱëǟ©Ǖ'], + 'encodeOffsets': [[ + -84956, + 8423 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'CUB', + 'properties': { 'name': 'Cuba' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ܨÑڊW߄˹̭ͮ޺Ĩ̔ȡ܈ԳԺϛˢ\\ԆǟÕʁئ“ٌ΅ıȟ֑Ń֡¥׃âளą֜Ҷ΁ɔէÈ̃ʐȥӎӃ޵ɦʥǬભž̋ǐ̀ɀࠗ¨׿ѧΏ[ťȳеğΫĂѺʸǼ̤ϞȈіǎَĄȰĢ'], + 'encodeOffsets': [[ + -84242, + 23746 + ]] + } + }, + { + 'type': 'Feature', + 'id': '-99', + 'properties': { 'name': 'Northern Cyprus' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ÐJŨȮ؄Yކʢ֧ΧÔƿęˆLJÙűj¥iĎѾNjVɫïƿ¬'], + 'encodeOffsets': [[ + 33518, + 35984 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'CYP', + 'properties': { 'name': 'Cyprus' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@€ãࡱͿЩŊȟͶЎŒǀ«ɬðnjUÒ½j覎ŲiLjÚ̇'], + 'encodeOffsets': [[ + 34789, + 35900 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'CZE', + 'properties': { 'name': 'Czech Republic' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ϯǂЁ©ٵʲ̏Ùҿ΅ر˔ӃΰѕȬėΠƧʠؒǾ̸Ⱦ׾ǎɂdžɜīϒĖЊ˓ؼñ¿ɳҘǧŲɒּĥĄʿز»ϮЯʡCŽƯȕ—ÅȑLJ¡wý˹ēϋbšȁ'], + 'encodeOffsets': [[ + 17368, + 49764 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'DEU', + 'properties': { 'name': 'Germany' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@d͗ࡔțS̗ࡢǂҾɰॊͧІˋȞёɹɣ̨̙Ⱥ҅ß́Έ՛ϑĕɛĬɁDž׽Ǎ̷ȽؑǽƨʟĘΟіȫӄί̑ϯ̟ŃŢշýƛʿǤЕ~׷ƭݍ–ţɛыɺʩ±࣑ʲǥǻ܍Nń״ьֺ௅ƸЇɘ´ςǗȐĨ֨ƗࢢԎ@Ɉ͂Ⱦޔƿ˴ǐDz۰°Ƽȃ֮вȓ̀ӈٌōՠŸ'], + 'encodeOffsets': [[ + 10161, + 56303 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'DJI', + 'properties': { 'name': 'Djibouti' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ȤʹΑӏȩήɯ̱҇ȅƬȭÏҷb_ʮßɶ˴Ѐ̐ϊήñʪȴ'], + 'encodeOffsets': [[ + 44116, + 13005 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'DNK', + 'properties': { 'name': 'Denmark' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@ԋڹ࢟ӄŝΒ௼˨ˎу'], + ['@@ȵ̓ʡĞ؁؁ɮХ՟ŷًŎͽҲ}࡬Ɣɪʌʦ݌À̐ɴڮʂƒѝʟ˙ĶɽҘŵ'] + ], + 'encodeOffsets': [ + [[ + 12995, + 56945 + ]], + [[ + 11175, + 57814 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'DOM', + 'properties': { 'name': 'Dominican Republic' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ŀƞپIӾɏɜtƴ̕Ҡhʡϐ‰Ю̷̯ͿЍǼϫ•ˡ¢ƱƵ͑½ŷȲˣťͳֻɏƆ§ʎjɬɍʦȲƚÞ͒óҜ'], + 'encodeOffsets': [[ + -73433, + 20188 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'DZA', + 'properties': { 'name': 'Algeria' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ᮩཽᝩ࿷இϑटćU՘ϵƌԹʊȧЀᬻᆴᬻᆴṕᎠfnj@ÊQ঺ബب࠼Ÿێɦ͎тচͪ˜جӢòϞ̶સƚƸ͜ɛDz̃ࢲ¹Ԟ́ՠ߰ҠࣦƢՌΎ߶ʰ෎Ƭർæшůߊͨ࣌P΀ȝֺ¾ǟћƄߟȡۙԭҵôمۊԃRȯԮ͹Ϊຝ˖ݏ°ϵƧۇÔϥŃҟòՇͫΗӺؓŽέ̘ҵϼƸڒϷςՃ'], + 'encodeOffsets': [[ + 12288, + 24035 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'ECU', + 'properties': { 'name': 'Ecuador' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@҂غǻξ͍ϵԉςǞʀƙބ̎ŴƺԼ͆զÍ΄ҢǸ׀Ͱࡀӑƾ`Ȳί܊śʆƆЮ˧άȣŞٓʽճࣷ࢟য়ͧԥܵǃ֣Ӆ΋ΙъͻĞ΍áw̮ʈȨıΔ'], + 'encodeOffsets': [[ + -82229, + -3486 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'EGY', + 'properties': { 'name': 'Egypt' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ɽͷǹىɫѩȝƥ˩˔ϛϒ׵ஸđùΐࢯԪࡋٌವ̴ҙ˒ӃݮछǗƣ‚ճ঒ݭƨǣΏ@Ὁ@⁩@@ᶶ@Ჴʥڲɐ԰Żά̤Ж૦b߲ɝ࠲ʛϴſ٨ˊΌʊݎêװŃɮеȜ˜ڨȣټ³аɄւ෽'], + 'encodeOffsets': [[ + 35761, + 30210 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'ERI', + 'properties': { 'name': 'Eritrea' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@˻˖ΉӰϋ˒ɏܷ̄ͶֻXȭǬӯȡԛϢʽط঑ǬęʹβఀĊ֒ˆʴؤƐьӒӦঃɴޗҢУବߏҲӍҖӝˀ˿аʧʩȳέò'], + 'encodeOffsets': [[ + 43368, + 12844 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'ESP', + 'properties': { 'name': 'Spain' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@¦״΃θஒ؆ਊƱ૾NࣂƝۦªമƒͰ͛໺ϡ̨ǺीϝআŊ®ӥߓ֓ઁǯõ˱ԩү͕ہ͞ӑӟϑǹճىǗש٥੧_ߟhՃ͍̓ͅЩê̵˴ʃӚ޷žé˦̶̀Śɬ̃ʢɶրͳԌδè’ЈƎŬZپϲɪɻфөˆƝŁӹCɁЬ΃ū̥ɇ'], + 'encodeOffsets': [[ + -9251, + 42886 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'EST', + 'properties': { 'name': 'Estonia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ĮӸ̱ŁՓ̘ñӘਫ਼ɼ੔Ũ࣮Ƒࢂ|Ŵƣׯӝʞ޵ΫˉۙDܡ̸ρļ܏Ʃ'], + 'encodeOffsets': [[ + 24897, + 59181 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'ETH', + 'properties': { 'name': 'Ethiopia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ԜϡӰȢȮǫּWܸ͵ɐ̃όˑΊӯ˼˕̏ω˳Ͽàɵ`ʭҸaȮÐȆƫǽ̴̕ҧ̴Й̛͎ᩨঽۺNᛛᡃફ™ݟףաeɯ˅ַB͹˴ލΙʝΓ֕àȃĬȟwˇT੟܌ב@˹ˢ@ҾѧƘӻࣴϥȚƧʹэЦԧÒ˸ӐҀrŲʰ[ݲʞࢠЊɾĎ΄ήٜԔи΀ࠠƆܠ঒ǫʾظ'], + 'encodeOffsets': [[ + 38816, + 15319 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'FIN', + 'properties': { 'name': 'Finland' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ūיಀ֓ޡى঎ख़֡ܛݴس΅յఘֻ́ѓޭӟᅡੵໃá๑̯ൃǯӡҞ߿ˠȈࠢСݶАӪނՆ኎࣮֖Ǭē΢ୟЈ˳͜uಒ಻ֲ૩ЪԊɞतѻલ¦ࣘȭߠϊЬ؞ಬ˶઄ͯΡכ'], + 'encodeOffsets': [[ + 29279, + 70723 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'FJI', + 'properties': { 'name': 'Fiji' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@̂ʍƓѭԳŗҩļąτ͖̀ϤĻȼƐ'], + ['@@՛ǯŅ̼оǤˊ°Ӱˀ@ЧՕȷ'], + ['@@é­@ШǨžĽЗ'] + ], + 'encodeOffsets': [ + [[ + 182655, + -17756 + ]], + [[ + 183669, + -17204 + ]], + [[ + -184235, + -16897 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'FLK', + 'properties': { 'name': 'Falkland Islands' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@৘Ԍ܎ȿԌʹڦϙʥ̋ଋʥϙ̌܋ϙпϚ'], + 'encodeOffsets': [[ + -62668, + -53094 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'FRA', + 'properties': { 'name': 'France' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@ˣ٭ϡǠș֢ǜ̺ը͎Ɯܛ'], + ['@@הЅќà݀ϥȊñʎjЈɗெƷыֹŃ׳ɱƝϣü‚ɇؙҽ]ϟВƀ˾ρ“ʁʚ̿̅ʯɐٱҖŃĩηݿӅစɬ௧˗ĩԑঅʼnिϞ̧ǹ໹Ϣͯ͜ѢԎdžူࢁࢤإю౹͒čؖઠǾථɏˇॎߌέዠپʨێܾǞŪ̑ϸ_ϸ͵'] + ], + 'encodeOffsets': [ + [[ + 9790, + 43165 + ]], + [[ + 3675, + 51589 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'GAB', + 'properties': { 'name': 'Gabon' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ࡹࡔ։ۚԙࢄ‚˨ǾˎȲؔǜخ˴¶௢SOৠЌÆԞőӼňľ¯ÓνɼѡشèȾǗεঃЊӹĞٿŁ֑ʳЇݏ–҅Иãϋ֥Ĺ˽Ɂ̈́֋ٕҩ'], + 'encodeOffsets': [[ + 11361, + -4074 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'GBR', + 'properties': { 'name': 'United Kingdom' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@҉ֽًǦԱ[ǦҊǥ҈۴–ࣔԳ'], + ['@@࣋ࣧࡦŘऄIɕۅݯݩࢄÃäĕݠ঱ֺƇԬढ़ʈͧৰDžķ՝ѓʗͲѣݱѯ૳Rෝɱϻǒ։ϿޥĪם͍ҁǘ௼ࢨݪǺOBಽƔʃͰ࢜ʺҡҐdžռఢ÷D@ŮӤ֛Ԯ_\\৵ƨȧɬ̨ϒˡɴҍЇ·߶щє̨ࢆٶھڤá০ì'] + ], + 'encodeOffsets': [ + [[ + -5797, + 55864 + ]], + [[ + -3077, + 60043 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'GEO', + 'properties': { 'name': 'Georgia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Ųάȿִӟ̲ҭĬ̯ʴĺIJ܄ƝఆƋଦЕƦƻԚƂ޶ǭʴ·Նșɓřвғŗıҏºصʎȵƍଢ଼ſ߳Юࣅ¡'], + 'encodeOffsets': [[ + 42552, + 42533 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'GHA', + 'properties': { 'name': 'Ghana' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@೉ӯҳ˽ݳʑݡʆœͨηܤɖैΠ۸ɟ஢ŗنrӊฤ¢ϊÕ˔ƊϴáÕʿΖџC؍Ąڍɂ̫ȅݳäйɢՓȈ̍'], + 'encodeOffsets': [[ + 1086, + 6072 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'GIN', + 'properties': { 'name': 'Guinea' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ʃtǡͷʁJǏǴÈͶΗԨɕħǵmɳ³V̮Ƈɘ‚ʔǻΜɹ̜ڥDțǁɵoƝǷīɹ҅σρӼ͛͢ɋŊȿǖħϊūȂʓƐώЦʮeɖƘȄDƄŎï˨ĢĖd˶МU؀ȱȄlÚĤҜáŨ´¶̭ƆBɖŒƔƒɸɇάãɲǺ˖ŒȬŠǚuȈȁĴɳΆΙǣɏ˙ǴĊŀį«ʡʲʍǗÝå˷Ș΍Ⱥڧ̷ĵăśÞNj·νƃA'], + 'encodeOffsets': [[ + -8641, + 7871 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'GMB', + 'properties': { 'name': 'Gambia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ņόࣶzȎȦˊ`ͨȷʼIˢƚǞʏεȋιdέǰ̷ȗƭQȫŝއl'], + 'encodeOffsets': [[ + -17245, + 13468 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'GNB', + 'properties': { 'name': 'Guinea Bissau' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@҅ΘΝÈȕʀLŸʯǴÁǶѼƌ˦ɦĨ༈•c˵ġĕð˧ƃōȃCɕƗʭfύХ'], + 'encodeOffsets': [[ + -15493, + 11306 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'GNQ', + 'properties': { 'name': 'Equatorial Guinea' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ƿŴ़̀െmPয়௡T˳µ'], + 'encodeOffsets': [[ + 9721, + 1035 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'GRC', + 'properties': { 'name': 'Greece' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@Ҡ˱ٺ¶شÑqƣҜĶĿʛ௃íTƒਁǎƺΦ'], + ['@@ʹՁȥĥԟ|ѫĀৱɓ׌ҿяƋҳAѻўƿȁȊԅрЁ̓ǿҴϯжʑ^ӅޥɠʜѕՓĕ͈ݏ֏Yۍμ̿ڦƧ֒͝ϮљӐÉʆϸТ¼˚˘Ũjɚռö͌ȀҖgƒƦdž„ت{ڨɲע̉ކĀVмЦɝ'] + ], + 'encodeOffsets': [ + [[ + 24269, + 36562 + ]], + [[ + 27243, + 42560 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'GRL', + 'properties': { 'name': 'Greenland' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ᬜԆ᱒›ੴ̴ᲈĄ䀦Ŀ㉊ڗ༅͕ộ™⭏ćшƫᲐĠᡚ́࿈ʴۦ̝इӧᒞ̺✘͚ᠼNjҾΫ⃝ױӃȕ᧑ơወ¡ছؕگկ€ध৚շಽ“൧ˇ༂ѽȢ܋࣍ýઞܡህÑঈ΁˟̑இŽ୥E੆֩\\Ϗပΐћɣଌȿ઼ԣ͈ڱກlj٫͖ਣӘ˼֭উѵᕖ•୆¯ᖯܵᗿڏឧ́ओIࢅ͓ୟࢱᅵכׅ“૧ȷ஽ȝܛԱ[כыտോڧͺٿϗ۝љࠍஅ½఍ۈဿLࠁҢ֕ࠐฝਲэոŗݮ୓ޢ̢ئ֗̒ࠪচొ̺ͨΘǬڀॡ̕қůݯţਏ˜Éְ͢҂ެ\\႔ɟ෿Քݩ˾࠷ş۫ȼम޴ԝ̺ڗ׈ৡࢼ੯͚XΚᖷӮᄻÖᖟ‘Ꮕ×ইˌวՈᕂ˄ၚ¬≹ɖ቉΄Ś͜ẊИᶎИ̪͘ᗗ̠ܺͰ᯲ז௢ĚΓϘጲɜᣚƂᣖRࣺʽᕺҨፘ̽୺áპ˙ፅҐŘή'], + 'encodeOffsets': [[ + -47886, + 84612 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'GTM', + 'properties': { 'name': 'Guatemala' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ћƦԻfϩǖҍΌrʖĮȠšƾКۆ઄Ft˸Ƌ¾ġǺ̵Ț̹ˬϜDBӂ޸BަUOڗßॅʤ@˚ƱòŰʘŃϥ͍ЉɻÏljâǑǧɇȟ½¬ıƿġ˽Ƀ}ŭ'], + 'encodeOffsets': [[ + -92257, + 14065 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'GUF', + 'properties': { 'name': 'French Guiana' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@͉͑ГÑŗʀȉ–ʹɩνǦɈΪòϤƢή͛ӸáֺѪܠ˸ğؤȥࢸۿƔ·ӻޑʳأ'], + 'encodeOffsets': [[ + -53817, + 2565 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'GUY', + 'properties': { 'name': 'Guyana' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ր̯Դյzџ̈́o҈Чͪ̇Ƈݱԛɕ°ȣƹџϊ؏ːAŎӃԢܳȱ‰ҫî˙ɡϟƥ˅—ġǑЭ¦ԫЀÓϴɋьƆܐɸ̐ȕϸ˿ŶŊτțȘѩ™ْ֩ɬɲiϲԬƊȾƾ˽̸ô̬ږӲ'], + 'encodeOffsets': [[ + -61192, + 8568 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'HND', + 'properties': { 'name': 'Honduras' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ơˀʭòÐʹŗĞǣÒσij‹ŔʩƈǷǚʛìǨɈáǒÐNJЊɼϦ͎ĔȂƨʊ\\þ垦ϸùϲv˒ĢİĦˎ©ȪÉɘnǖòϨśƄkʲƿʐį̏Źɜɳ˽jśŕ̇ŋɃAȅŃǙœƛźĕ{ŇȩăRaǥ̉ɳƹıđĽʛǞǹɣǫPȟqlЭūQĿȓʽ“'], + 'encodeOffsets': [[ + -89412, + 13297 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'HRV', + 'properties': { 'name': 'Croatia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Ȳ͗ˊʇ͓̓ϝȆׇ[ܟƔϽmǻǧ̝ȖǫΑЪϽǼʹϮ̽͌ȃ͆Ηݔ͇ġƛ߃̶ӣ̢ޑʠ۹ؤǞØϥΞe˲եƄʱγʝˮn̆Šbג…Ƹƚ˸ƍͤgGɼ̈ĒĈͺڞɠˊĻؼέۜlj̼Ų'], + 'encodeOffsets': [[ + 19282, + 47011 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'HTI', + 'properties': { 'name': 'Haiti' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Ԣ™ܰƁôқÝ͑ȱƙɎʥiɫ֏ƜЅÍԡÔϽƿ҉ʾö˔ޜśيã̢ȈϧθP͎ՋžȌɶ'], + 'encodeOffsets': [[ + -74946, + 20394 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'HUN', + 'properties': { 'name': 'Hungary' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@˨ըǍǼӂDÜ΄ђɋ̲ğ۸ļäǚͮ~ЦžĜÃЂŀȠȢˠ¼࣒ʭǴĒҲɭÎɣԡǭЉ֫ԕ֭کǁԽš١ə̻űۛNJػήˉļǍ˴ƗV'], + 'encodeOffsets': [[ + 16592, + 47977 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'IDN', + 'properties': { 'name': 'Indonesia' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@Λe૝ך޴ǒѴʭ̎ʭ»ɩ'], + ['@@ܙȁijĶø˸ΰԢࠨͬĐǓfʫշع'], + ['@@̢ɣԲèȼΥॿǛ׉őҍP̀ӚҤPɤ̖'], + ['@@ūұ౅ʅૣľE̬ښǪՂʥ֔Üݬ̮'], + ['@@ྔċȂΌ༘З̪կీƵਐӿय़͋ऍ͸ݻwࢍØ޻ưঅ͎؝ČΓŁ໕ΌƣΰޑØּߤ৶·ڴ͡ΒÛŘ̗'], + ['@@ѝֱćنƬ̠Ǭ˴ȒʗCЏ'], + ['@@̿˥ׅƸǏΰࡘ¢Ⱦˣ'], + ['@@̨ٝۿΌۯìӃÅׇˆȦҦਠ”ऎʕ'], + ['@@ɼയ࢈ԉ۰ࢼ८ԔݜBܘ̉خ̛ࣘLJbᩑbᩑݟې࡟ǜȷʇ੡}ΦۂՈɺɕࣲЕ۸࿃܆ۗêృަʛУ͑óȏ̮GκٛЮ̢ࣞ״gëɠ௵DͩԄݥƺΡдଈȰњ˜ഘ·Ƃ̹'], + ['@@ڭ࠭كlj߱ǐඓ¥ܽŧţٍݪݛҒϠ༪˸çϯλŪιӯ͙݉ߒ੿Ƶ˿ݲॻQտ҅ʙ̐͡Мی࠙͗ȻɶŊ͖؅ӲØࠌ֕ʭîও”றՓũίʚʌޜŽ߸ΛPʻֺΎվŤښф౎ǮΎ܎ذپʛ੖śॴ–ࠨ؎Ʀȉ'], + ['@@©ܽџĈŷԝΌѷɽĵ͹Ւʟ੺ǚڤ˨̨ÔҝӸóĀ΃'], + ['@@सާহį˫ֵšݿַ߱u࠷͕౻ŭ̚ॕϙͫԤ׳´лːৃ̟̩Оս¯ۗĬŹૺнɺЕܘŝ݀ĮުԂ֐Ɩָ֗ӅըǠ՜ÑӪъЖôߒɽۆǶњୠ͔̈̆क़ॲ@ܰƙӍݷآߓơϭ'], + ['@@छkۻ۰અۊέԚٍۄзؾٕ୴۪݅ʙܠ̳ڀݵՊѭܘمҺࢗऒóђզ‘ಢNjݔࠓٮ֫ҪΓߔࣙࡢ_ۺֹӠ۳٘ϥͳۉӖ̞̅sƜו̊ҵؠõФՏɁ਱‘ಟ'] + ], + 'encodeOffsets': [ + [[ + 123613, + -10485 + ]], + [[ + 127423, + -10383 + ]], + [[ + 120730, + -8289 + ]], + [[ + 125854, + -8288 + ]], + [[ + 111231, + -6940 + ]], + [[ + 137959, + -6363 + ]], + [[ + 130304, + -3542 + ]], + [[ + 133603, + -3168 + ]], + [[ + 137363, + -1179 + ]], + [[ + 128247, + 1454 + ]], + [[ + 131777, + 1160 + ]], + [[ + 120705, + 1872 + ]], + [[ + 108358, + -5992 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'IND', + 'properties': { 'name': 'India' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ࣚটďۅͮїѕ׽ŒɾएࠜՑ୞חՑϟ͛޻ࠀͅߊЭરһସʼnӜёٮāৠȝ۪bĪͪŋՖÞβԠǮìڋlǙކ͉Ոƀ܀Çۈ|ÐԪ΁ˎڴŀވشॸ՘۶ȷ״ΞЀԹ˳Λ࣠űÜ͇̍Ʒèԫ׷Ʋછׅ~ӓҩ۵§ХϏۗځȒࢇȏ˹ĚΣгȥѵ೰ɵEƍ՝ҡѦʸӎϖ¶ϰ܆ӝƜީ]ߝŚóאБ¤ڕζ֭̓؆ѻԿ̻ȅ̩Ԭɣƛԑ̆كžەţֱ̫Zਛǩ´ك҃ӻ௃֡ळ঩كՋ࠷ջCϭлȹݳ̝Ͻ«ʥٙǪધ®ۡΣߙI෗ѣ¡ϣٙʰˣދʃ˱֯͵ʍߑ޸ϳ୴͑ࡒ̍Јѿ߰ȻੂơՀޅ଼Α࿀ʣ੾HৰǍ޾௣ԉףĶ઱৲И̤ʝͤড܊֖֔ᇜCǗܞҽюĩ٨ջϘऒࢢঊÙ࢞ࢢՄ࡞ࠄࡈ_״ܒӠڳд֪݂̇̕Ьβ౤ȱपŰߺ۸'], + 'encodeOffsets': [[ + 79706, + 36346 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'IRL', + 'properties': { 'name': 'Ireland' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ƒ׷ًݣ๯ӹ஑Ŷڼ࢚ѭࡢତڄٌϼǦ҇ǥ҉Բ\\ٌǥ'], + 'encodeOffsets': [[ + -6346, + 55161 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'IRN', + 'properties': { 'name': 'Iran' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@݈njװӔ֚{τƾװýघэڤğ।ݓظ‰òۻ΁਷ɱؑκŭΫҡˠڡàՓِƙæեݿݿжѵ͸ԓߦυx݉ДƋêϯ௉ѡ̓উཌྷʪࣷȖेŊΧਐЕƪ٣ƭࡑНਇ˦ࡑ٦߳ʈ֗ߘا૪ҍƋՕ˦̻͝ҭѴS҂ˍ@Ɛ،ѝٔ਍Ң׉ߜȜپц̂ÙӬտʨխ৊ҟڨǐʼʿ६ּʈƄͅъϯ־ő̤~রئ̀Øʞʙ́гԼѱȾ¦ˈإߖǩ׎у஠ƟಾɞĄȞ'], + 'encodeOffsets': [[ + 55216, + 38092 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'IRQ', + 'properties': { 'name': 'Iraq' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@րʧÚӫх́țٽ׊ߛ਎ҡўٓƏ؋ˎ@TҁҮѳӿ¤֟ê؝߭༟äᛍၖఫךৡɪ͹৾ᇶ࢔͆৬āؘҢȺјԾΰž঎Ň̐ɉЖƚծ৉'], + 'encodeOffsets': [[ + 46511, + 36842 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'ISL', + 'properties': { 'name': 'Iceland' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@șիॊֵથٙᝓֹܣƵૉŮᚑˈࠠψᆧЪ๪ǎ—ʘᄋȜ֨նౠŰಸ֭౨Ҝ੒ʃൌ҄ආÑ'], + 'encodeOffsets': [[ + -14856, + 68051 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'ISR', + 'properties': { 'name': 'Israel' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ƥ˅̣Ŝǫ֓ɂĥɋř—ɛЄŖp͛нഉց෾ʔˢ˶ɞϼǠيŤɆzVˬCþƦɤ\\`·ŕŵhM'], + 'encodeOffsets': [[ + 36578, + 33495 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'ITA', + 'properties': { 'name': 'Italy' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@̟ڋŲʹǭѝٝ̈́ёĞ୩ѐŞќজûࡪĠْò'], + ['@@Ԍ׭ş૕ϣÂ΁˫͇ɞ‘২ȓӒҨ¥рʼ'], + ['@@ரɏĝЯȬΧڝŪہ̗²зĻʇˠё߀чцۛदڱچLȲȃɽǗݪ̥ؠʩܜѫĔƿƽ̛үϼܳƐΝի؈̷ıѫΗ¹҅ܛΕÝHʲǢҊǼǶ͝ӤʱшΑŀʛδգƴεͶثÆٿϜޑմ֯ӜʿࠪйĮہˤϯŕӝϵΓÕĪθҕńɏٲ̆ʰʙ̀”ʂβǵМ¢Ҽ˶ƢƃА€ǼͺتĿψƚâΆԘšĮdžࠨƤȊ̉'] + ], + 'encodeOffsets': [ + [[ + 15893, + 39149 + ]], + [[ + 9432, + 42200 + ]], + [[ + 12674, + 47890 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'JAM', + 'properties': { 'name': 'Jamaica' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@֢÷ҀȫƔɯןeʭƗҹƊӑ̪ĶȔΜÎȒƒ'], + 'encodeOffsets': [[ + -79431, + 18935 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'JOR', + 'properties': { 'name': 'Jordan' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Ʀˆपͫ࿪ࣆͺ৽Džų၅у࠸࠿ˣƛƑ˭ٙřȩ̡εʵधƆƒŨоഊo͜Ůʚ@Ԥ'], + 'encodeOffsets': [[ + 36399, + 33172 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'JPN', + 'properties': { 'name': 'Japan' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@ņ˽ҿԕΉːљțɝӭշʈRЊҬԆӌīΊΜؠǹ'], + ['@@́ڡƤсѩף੹Ѓ๏½ணॡ͔֡“غษȃষЃঝe࡞أ֗෗իΝН͜ȶݶՏʒͿ־ߐʶѲՈࡌѢ؞ָာʤ࣎ǣࢠ๺֔Б௾ࡀӌ͜ՈਈƟा΢ՎࣀƸҞୗ}ڻޥࡍbࢁ'], + ['@@נǵרΤȈहఝɯ݁࠱೓ָқँण]ř࠴д٨࣌²ʖ୐ʜټন࢓٤˯'] + ], + 'encodeOffsets': [ + [[ + 137870, + 34969 + ]], + [[ + 144360, + 38034 + ]], + [[ + 147365, + 45235 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'KAZ', + 'properties': { 'name': 'Kazakhstan' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ӕƹ્דο׹̹KɱЊ੫‚ǡێХNÚࡆ৓ؘ෷ßডũߣݶۋ͆ಥ׼ƽðᓗӹᶽљ£יچ֧ɼॕǩχ˧±ȲȶΖDž̊অ˺ϛݮҩɆ…˜ࠊāŽؘ܎ƎܼűƲࠎƭԲ࠿£܍ȴঃσ޵ǭяƌĐўՙ֘دw܉֬ӞِʕǢڢऊࡺӣŀؘჄࣴಾtᇢ׉঺ͻࢼΠ೰j੺ѥʔʠ୼—ɂЊഷ׀߮Цƿɮ߮ɔ؅ֺϬ˼Ḯ̈ШȺᑆ̴ݰΒຢǹ˄ࢉ࢚Ȳઆ˹éҝ߮´ᑌߎ̭ˁ੶٭ሠᒑ҄ѰୄӛீɎҪƯКӟטNjΨΥ઎ŒѾԣٕ֓ۥÿ¡ࡅұϝဟˢ؅ຑїȇဗͱݲลֻɓäӏԭŬу̠ఝĖඃx̧ġ஥ΞӉǧŽӹ൩̂փşȉρ'], + 'encodeOffsets': [[ + 72666, + 43281 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'KEN', + 'properties': { 'name': 'Kenya' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ӾۙיͱȹΕ̿Õšףˑ͹Ǐ֑ͷ˥஻ࡀËӤᵁႌƙĢSࢺʊ;а֌̨ؔσ॰įтЉ׎ԬԈ֬ֆѨƗ@ҽ˺ˡג@੠܋ˈSȠxȄī֖ßʞΔގΚͺ˳ָAܽ॑Xᵣ'], + 'encodeOffsets': [[ + 41977, + -878 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'KGZ', + 'properties': { 'name': 'Kyrgyzstan' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ȊςքŠ൪́žӺӊǨ஦Ν̨Ģ඄wఞĕф̟Ԯūşȏ೛ғ̙ͭઁıͅ՛ࢷŒׇǏߣЇŜȟʇȓཟŵਡ˘࣫ÝĂӜࣴƕ̮ʸٖĉ੾؂঻ѸױȽإ͂۶ծʟĊ'], + 'encodeOffsets': [[ + 72666, + 43281 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'KHM', + 'properties': { 'name': 'Cambodia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@΁Ѭыࢄȣ২ՠۨઘdž߀ťۚ͡Ϟׄݖ̱Ȝ֕Ļ৕ඳ٧τԙࢥÓܫͷ۱Ū'], + 'encodeOffsets': [[ + 105982, + 10888 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'KOR', + 'properties': { 'name': 'South Korea' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ܨযȺխPॷ̓ҥݽljڥΏݳïĥҚƼـχ࢔ذƚֻܘÂúϒ‡͞Ϝצ¢ΨÈŨȮ'], + 'encodeOffsets': [[ + 131431, + 39539 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'CS-KM', + 'properties': { 'name': 'Kosovo' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@›ǣŃPĘ́ȩĐdzɦƾȌȪÒŜ˨ư²Ţşƾ¿ŌƅƒŸǎƻŢLĥȳijij„×ȉӹŻ'], + 'encodeOffsets': [[ + 21261, + 43062 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'KWT', + 'properties': { 'name': 'Kuwait' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Ǭχõȓ˔هשuȽАݟĆ؞߮֠é'], + 'encodeOffsets': [[ + 49126, + 30696 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'LAO', + 'properties': { 'name': 'Laos' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@˚Ϝœ܆ڹܸ¿ٕࠦھٍÎǛ̉ӯyʣƨࢯԅoݬȸࢮ֧ž³ԎηʸǴ̲ܐնøȡ҄wŵ०ѦŬӮڏϖޅਚO͚ܹ՝ɗʉ̟৔ԉۦ঳Ռ݋َ׏ɄץƵ࠿ݕ̲ϝ׃ۙ͢'], + 'encodeOffsets': [[ + 107745, + 14616 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'LBN', + 'properties': { 'name': 'Lebanon' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ɣ[ýƥ˫D̘ۄмעfˆϘ§Ɛͣқ̓ȷҟ'], + 'encodeOffsets': [[ + 36681, + 34077 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'LBR', + 'properties': { 'name': 'Liberia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ɗQࡽАޅٖ܏Ң֣ըȪː¬ʔϜҘϺϺǶnɖĨΘԧÇ͵ǐdzʂIǢ͸ʄsŸʓĎНǽύʖɱˊÇΤΙ~ͧăĿÝە'], + 'encodeOffsets': [[ + -7897, + 4470 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'LBY', + 'properties': { 'name': 'Libya' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ק̷ҿҤ೧βρՄڑϸϻƷ̗ҶήӹؔͬΘñՈńҠÓϦƨۈ¯϶˕ݐШȜðΠėΒ־͔ʶːЦʌ´٦দ́ΜðۮƓ૞ϓЀݛݮǍஆΙࣆйЦɔЖϮț٠˂Ф؄ЀׂŘ଒ǣ˺ϑ̺Iˌƛ࠴ıȲˣ̣ЕżΫɏԯʦڱ@Ჳ@ᶵ@့ॱGYΙ‧ྐ‧ྒࡓҟ'], + 'encodeOffsets': [[ + 15208, + 23412 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'LKA', + 'properties': { 'name': 'Sri Lanka' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ų࢓ΙʇܵȓЍڜƫீϠ഼׆ұϺסО࢓'], + 'encodeOffsets': [[ + 83751, + 7704 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'LSO', + 'properties': { 'name': 'Lesotho' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@̆ʩʳУƛ˛ҳſƹˍ̛ċؿ٨҄ՐҖ͢ϼǠξʵ'], + 'encodeOffsets': [[ + 29674, + -29650 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'LTU', + 'properties': { 'name': 'Lithuania' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ãɊĚɲχƄࢡƨDZ۸२ʴඬÁࠜĊŞǩ҂Ã߲СĀϓۏˏșӃ࣯̓߻NȫʶљĜ'], + 'encodeOffsets': [[ + 23277, + 55632 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'LUX', + 'properties': { 'name': 'Luxembourg' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ǘȏ³ρʍiȉòĞҼɖŽ'], + 'encodeOffsets': [[ + 6189, + 51332 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'LVA', + 'properties': { 'name': 'Latvia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@†نЮՆߊ˼ڜعڪhNJ٤ܐƪςĻܢ̷ۚCКȕîС˒ӷ͕ࣗԛƙ߱ТҁÄŝǪࠛĉණÂ१ʳ'], + 'encodeOffsets': [[ + 21562, + 57376 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'MAR', + 'properties': { 'name': 'Morocco' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ԒΥߜÎࢊȃκU͂՟ºԝ̄ࢱɜDZƷ͛ષƙϝ̵ӡñ—ثঙ͍ͩсۍɥ࠻ŷഫاRহŷ@@@p҉Ա˓ȑϡ@̥Ŋ۹ě˛ٻʿÕЁ੕ୟ࣡ˣୋ΅ϗĵ̡ቅãaD ϶͒ɮ˞ѪÃ˶̀פҴՖ˲ƊɞӬp҂̤Բ̪֔Ւ࡬f\\ц͔ްĢڎָтɠۮۮȿਸ਼͊ܢŔѶդ֨ࡈϦخΐ֘࢈˄ԪؤI'], + 'encodeOffsets': [[ + -5318, + 36614 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'MDA', + 'properties': { 'name': 'Moldova' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ȨŮ֒ĊؤʽΊϞɥÑ˵̪ƏŨΗ̊ɇÏűƾčɝ×ӷ|ĉŜǫãÒƭɱˍƥ˽ɁĝƯϦĘΪςӝԂˉΠʹʠʯĈ'], + 'encodeOffsets': [[ + 27259, + 49379 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'MDG', + 'properties': { 'name': 'Madagascar' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ɠΥȺ։Ɗঢ়ɒϽĉЗƩʙ˷ӰǁʝLjثõΥɵȗ¿܅ͧওб୅ԯཧ͑ୟϛইہȣܻΡӛɊڙ̜ɳѺÇݘ̑ڠù؂Ʈ؄ϰƢD˪Дِø՚șЈǃՌãޠ̊ҺŔՒмŒҶǤ̶Ʋτ\\ӐӎۖԮʦцŗάΦĵҪ׎fԐ˦ϔ̊ί'], + 'encodeOffsets': [[ + 50733, + -12769 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'MEX', + 'properties': { 'name': 'Mexico' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@͙݅ƥ؁Õ૷ąЧƤқʺЧǚٳ֎سȞӏ͢бࢾɝΐΙ݄ɾٚĎؼưՊƠՖ΂ȨӬè۸Ƣʖ֬ɚࢶȚݔ‡ԚîȬDZ…ЙҋԁȥԝƸƥűγɁٽɅɎǭcǃY̝ԓƳIJķPŭޥV޷AAӁϛC̺˫̶șĢǹƌ½s˷ઃEЙۅŢƽĭȟqʕ्ࣞџ˘ۇɖҷÓګ́чĉץɜؿDŽ޹ϬؿŠ्ϸ۱ВɃɤҹº࡯ˈΓϦࣗӊсՌȧЦ˪ĈđʈȖɔJ̄˱Ϙùͮ˭ъ݋࠴ࡋڀУԼܝ΄ƷȴŸԲѓȞӹФȽהҍæӣѸϿФ™ˀҍو̓٠^͔؇ͬ˫™ӑɴƇͿƔЕĆف̀΋خׁƒȡŸÓŎ˽Ƭ\\ǜթʮɇǴ̕Նё˨ޯʠρɸϿ²ѷКƒͶϡ̨ϑqƭΝ̱ƫJɛԞջӎ؃РїɈ„ؚŵҖЏʺֿϒŏŇɃɖԭȰӷӦÖÚΊ³̸̼ŽϜ٩׶ӱɶ̱Հ̷վϳڦͿݲॖÞ੪ĞÿǑ౔СኀףဪPژ@DΌผ@̪̕јˇԀσ˨ѭȾҥѢʩۤʥՊڒۊhפͱфֹ̄ӯӸӏȂחɾЃپʹ׮ȁ͞|'], + 'encodeOffsets': [[ + -99471, + 26491 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'MKD', + 'properties': { 'name': 'Macedonia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ńOœǤӺżȊ˺¶ϴbтˏÒ։DžƒƑƥҕh͋ǿջõΑȴšήń˸'], + 'encodeOffsets': [[ + 21085, + 42860 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'MLI', + 'properties': { 'name': 'Mali' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@˰ƶƘӶˊpזɻӄǖ͖ÇŴȈ⁚^ȈךƣļЛ⋈Л⋆౾dᬼᆳᬼᆳȨϿԺʉ϶ƋV՗ठĈFካҟ֗íԭݛƃ଩ï̳̗ա՟IȿLjҥš޻ΑDžʿٳϕŗɍΙǡНŔɱȳūֻڙۡp˳ɭΣÆӥ΋ůȝŁŽάʍĥơhƷʕ٭PɷŴʼnùʱʎ¬ʢĿİdzĉ˚Ǥɐ΅ΚijɴȇȂǙvȫş˕őɱǹΫäɷɈƓ„ɕőƅAµ̮žʾí̽͘ʀǓӔԺ'], + 'encodeOffsets': [[ + -12462, + 14968 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'MMR', + 'properties': { 'name': 'Myanmar' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ӫηץ›ϥࣥΟƳО݅ՔؗΈօ̭ܵ̃ƹȪу֖ڙĪҷ_ϵ͠ދң޵Сࡷăذʴ٠˯ӼæࣸͽѤ˛৔Ʊਗ਼εۢօуॕ׳ҽöԳȠ̂ਪǫ޾څॺļ̢ӭņ׭ۆÅڰ̊ŵj׾дȦęΤȐ˺Ž࢈ڂȑϐۘ¨ЦҪ۶}Ӕજ׆׸ƱçԬ̎ƸÛ͈ӮÚˮӵξȧ|ٟ“ۙߓۭijঽࢲƔȨޛՐǍʓۣز́ζƷ؞ʔ~΍܏յdẕӓȗ'], + 'encodeOffsets': [[ + 101933, + 20672 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'MNE', + 'properties': { 'name': 'Montenegro' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ÁǀηЯÊˋǫÞɽ˞εǖĢƜŬҦ˚ȜƾüɠƟŬśˠě͌ǧçïƽȋɧó'], + 'encodeOffsets': [[ + 20277, + 43521 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'MNG', + 'properties': { 'name': 'Mongolia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ࢮƢ྄ܤ౬Єܴʳ࢚]֘Ͻ࠼‰ௐɁࠈגͿӶࢊࢊश΍ނįনɍLjؿஜΛߐƺਫ਼ŌࡆōࠖЗԚѕެT੒Ƌޜȼૈƒ௸פԌĝѰ˭ৌêХهק࠽ɐ΅ӈńࠤŽ٦̴ڬˏހוğ̗ڏĦ௟ŏןʅ؝։౱͙࠷ѽࡹǞҿúѳէˎ͓ƌˣי˯׽҇গ̑ఽ‹ഫ̇এҋϋʾ৭AఓԜࠥŰૣśჃȊऑmӱԀϣޠԱĢ৩ԼଅŞুƞ̡θ͖চׅڲன̀۷Ѿəז'], + 'encodeOffsets': [[ + 89858, + 50481 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'MOZ', + 'properties': { 'name': 'Mozambique' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@لæ৞ʁɖńגt̚ʦԌaऀ͜ڞӤƊϕ“࠷ľ݅ಿƨЫʣ׷͙׍՗Եޏ͉ृСॉ͓ࣕƵוׯ΋ȗí׳ЌُǔӱZʣƪ¦{ࠗƋϷȤƝűΓΗ̗ۗ˳য়ҕρ̳ðΟɊÉíѵّRïϊůϖí̠ƬपɓװГஂࢬ॔ɜ؆ŶúĨӶƉʞ˜غǐ׌E੠ѥ˒ЏÔǹȼϳǰ۫gÅ̼āװᢈۘӚЕɴüͨɅ¸͵ǯϷØסոԱʲ׌ζǰíઊΙ؈̣˖̅]ɽદɾٔ'], + 'encodeOffsets': [[ + 35390, + -11796 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'MRT', + 'properties': { 'name': 'Mauritania' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@և־ԗؤ֍ɞГʚҵUЧǽйð˽ˏïҐɺаŀߊģࠨĵкČмɑЎѵδǾˬᾔMǃ௎ȴќ߀øᒸ᪂©F౞Ṗ᎟౽cМ⋅М⋇ƤĻȇי⁙]ųȇ͕ÈӃǕוɼˉoƗӵ˯Ƶ'], + 'encodeOffsets': [[ + -12462, + 14968 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'MWI', + 'properties': { 'name': 'Malawi' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ɽٓɾથ̆^̤˕Κ؇îઉεǯʱ׋շԲ×עǰϸ·ͶͧɆɳûәЖѵɔʮޮ˄̈LJۢǚڼƞɪɉ܌Ѕϐ࠘ƽǜɵ˶Ϲɾଡ'], + 'encodeOffsets': [[ + 35390, + -11796 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'MYS', + 'properties': { 'name': 'Malaysia' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@àћֈĶ˞ΈȘýӸԓΜ֛¶֣ęϡĆ˿Öӻ̒ɵͤݑe˳׫Éߑخ঵ښįђӟ֚ś̡۠ҜĠؔȃΤƤƮۈρ'], + ['@@أ˹ܯƚॱ@̅ॗ͓̇љୟۅǵߑɾЕóөщ՛Òէǟַӆƕ֘؜˽ٮǀǜ܆άǂ৖Ǻ׾ڔЬՐϦѥǮ˺В¸՜œа٪אшڀͼHќыžιֆɻ۬ʧÑ֝͡¥ƮЧ'] + ], + 'encodeOffsets': [ + [[ + 103502, + 6354 + ]], + [[ + 121466, + 4586 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'NAM', + 'properties': { 'name': 'Namibia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@رٌؖ͡ȃࠊȷ،˯ಒm৒ŅҞ͛Όѡۜѳ৘ǽՆۃࠐ»٢КdžԊƞհ}ԄϝŶÐ₮˜׌Е᎞ş໴΂یȒհµͨȍPéӁȍʭC՛͍ͣΎಕ̍سƒ{Ჽࠣ‡BយA᷋ݣѕҋÕՇDŽϗÔƗάͩɰГг'], + 'encodeOffsets': [[ + 16738, + -29262 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'NCL', + 'properties': { 'name': 'New Caledonia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ېԵѨϭ͉ȫҥɪ׹ϚէѼ։פś˶β[Һ˹φ˷ˎɻ'], + 'encodeOffsets': [[ + 169759, + -21585 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'NER', + 'properties': { 'name': 'Niger' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nּॹȐОҿպœϤâТբ̴̘ପðݜƄîԮҠ֘Eኬஈϒᝪ࿸᮪ཾ೨αӀңר̸ȸಯ̾ɓ`ˋΔ˽ǻί͕ၻ«ધੳߋγૉΔ̵CեբmčЃʁµˋƻm֩ंȟ’ځҷٱʔҍ¸ʏşӯ~ӷΧѓq৯ѢЉȵѓb̿͆ࡅ̼ࣗıɕǻşӗʋ͹ÍݣٗӚ̟E˭ʗ'], + 'encodeOffsets': [[ + 2207, + 12227 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'NGA', + 'properties': { 'name': 'Nigeria' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ࢍ̡͉¬͓ȉڥl҇Ղˡ؊שֆكYݍB¶തs՘ǂՊʶʴТԴėɨǔ͸ȍӾ˪ÎݤʌͺŠӘɖǼࣘIJࡆ̻̀ͅєaЊȶৰѡєrӸΨӰ}ʐŠҎ·ٲʓڂҸȠ‘֪ँƼnͬͯğƱ«˧۽ٱɛՙšѧDZȉǝי҅ΉŽыȋ͹ÿΓֽ˱ҽΊ͇aԃӭʑQЍ߷ɍש'], + 'encodeOffsets': [[ + 8705, + 4887 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'NIC', + 'properties': { 'name': 'Nicaragua' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@̃ˆϽͺȁ˲Ο˄сϜĤžƒŵÚÒʾ”ŀȔŬRkЮȠrǬOǺɤʜǝĒľƺIJ̊ɴbǦĄQňȪĖ|ƜŹǚ›ȆńɄB̈ŌŜŖ˾iïă§ȉĐ̫ȗ˹ěͷυ®ɏtϙŹĉýΫÌɛǣɋ ɩźƏȩDZʛÈƓǦˉêȕʼnօɞųŇ'], + 'encodeOffsets': [[ + -87769, + 11355 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'NLD', + 'properties': { 'name': 'Netherlands' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ۦyǀ˳Ƚޓɇ́ԍ@ƘࢡҥȞՏπީǩ؛âѠɲ݀ఆଲΘ'], + 'encodeOffsets': [[ + 6220, + 54795 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'NOR', + 'properties': { 'name': 'Norway' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@᥆ؙઍɣऄՅෛ͵ڵû΢לઃͰಫ˵Ы؝ߟωࣗȮ઱¥णѼԉɝԷ“ūփནƊɝҵ߭Hևױ࠿झಫ஁̨˹̇ͫ࠯bձ޿¾૟՞э˥ধֻۧυӛ֝Ԫဋঁ૫ȟ୏є̛ࣚˇ኶ޞզᕠ۶ဌࢂ໤୦፺ྴඦلᘼ੊ᇎπ൪­౮ۢ໖›ພǘ'], + ['@@ም΅๝Ȝ׆ɐԕˎეǚͮ̿ொȍ'], + ['@@᪖صᑟͥұأ݅ǁЍۡৣᅵԢނ̘ఽʐ࿕܂ٷڄᘎ̜Ң̋஦\\͊˼௾ˆ੖̋'], + ['@@࿮̏ఝҍ᝱ı៙ƖƫɴஹdँϬᣴɼ௞ȫࡘʤᑺȽ'] + ], + 'encodeOffsets': [ + [[ + 28842, + 72894 + ]], + [[ + 25318, + 79723 + ]], + [[ + 18690, + 81615 + ]], + [[ + 26059, + 82338 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'NPL', + 'properties': { 'name': 'Nepal' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ÝαŌՕĩͩ۩aয়Ȟ٭ĂӛђଷŊયҼ߉Ю߿͆͜޼ՒϠΒȪڪʳࡔշҾť˰ЕٶǓۀσौȕঔć'], + 'encodeOffsets': [[ + 90236, + 28546 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'NZL', + 'properties': { 'name': 'New Zealand' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@Ȓ΋װ;ʐΡBΝ̹ϳչإїͷ̴З٭Yܗ̓ɣջӋࡗڇϓнʇޝlխˢࣱÐƗ̰Ҍذ੐ࠦժǀ׾͌ܜѰԎѦώظ͈ɆŰҶלϴȆΧ'], + ['@@،ࢫlָϜɯŲًڰ˛֨ãӒ͎юĭȯݗʯӫٛjɡʭþαūƻͅҏзֹ٭ͯƟɘΕŨӞ۔˟ҨࣛͲz̦؈̌ƚ٨Ÿլͻ֜vƪБΎڋݔΗת̸àҚұٺɑʂݡ'] + ], + 'encodeOffsets': [ + [[ + 177173, + -41901 + ]], + [[ + 178803, + -37024 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'OMN', + 'properties': { 'name': 'Oman' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@ֹ̻ϟªǩȧƉэļ֗ÿĻϯFԽ̻ćХȓǯԹP͡ɃJͻПɷҩĂ֗˳ϱ³˝טٿ൴ᠾ࠾֖၂ϩתv͸ʔΐFΆϞǒƩŞèմіHϖֵҸ̧؞ŋӼƳϜӕɨ˧̞ŃCȉ̩ԃƅɽΟˏ'], + ['@@ʼnƳDž˺ʔ˺ľñā΍'] + ], + 'encodeOffsets': [ + [[ + 60274, + 21621 + ]], + [[ + 57745, + 26518 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'PAK', + 'properties': { 'name': 'Pakistan' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@تϻʞ٥൨ͻ߹۷ऩůౣȲЫα̖݁̈֩ڴгܑӟ`׳ࠃࡇՃ࡝࢝ࢡউÚऑࢡռϗĪ٧ҾэǘܝᇛD֓֕؛Ɇʣ؀٭٘໻ǁിeஃŝ̈́ঊொѢéϰГƌw݊ߥφͷԔеѶඨѕࡀŲԈŅǞȂגóદĈ܎ҶӈشCĠɼٞŌ̴ý͢ʀ±ԌΦԖ՘Ɇͥ֊ߜɴ̢•͒мΜĩмȣΤӬμࣘǮ८ĮѐƺӨĦ'], + 'encodeOffsets': [[ + 76962, + 38025 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'PAN', + 'properties': { 'name': 'Panama' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@˫ʎǵҒȺɢɅÎƿˤлɸοÁǝ̇ͻɁǽ‡ĉǩВҗɯŅŧŭϷ©ơԈŋƛˡ¸ǝ͸·ÈɓİέCǻĩŶªǖìǠƲŲIJǩŲK͸͘ö̠̝iDZͲ›ĀæɴȵЮÔΨɄԜǞ˺ʤҬ·‹ĉҶ…ώơ˜ʧ̈́ɵĹūȜӵǁʟ˓ÒŅС'], + 'encodeOffsets': [[ + -79750, + 7398 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'PER', + 'properties': { 'name': 'Peru' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ɥљћɋࡅӘñΈရࡊທࣾ٫԰ΏۜƐʎ܅ાࠣ༄ߍီ΅Ϥ˃ؤٷպױͼ˖ϒПߢʼךڢՎIJΓʇȧx̭ΎâͼĝΚщӆΌDŽ֤ԦܶৠͨࣸࢠʾմŝٔɢĂ֒ЉˎЅϴɏӶࢣضĿҨɞ̤ƣԎð٠Ͻթࡣʤoрҁݳ œųۍlj॥ֱÓϻɉ̇ČғԕʍBΡɛƵΔݳҲԝDZί֐µ͆҃ݐuېӸÇ౧ϢĩӄƠܪടǷ˵£ןg܍͟пƮ̵ȕ˯β۹Ջ࣡'], + 'encodeOffsets': [[ + -71260, + -18001 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'PHL', + 'properties': { 'name': 'Philippines' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@Đ֏ºҽ˹ޑ̫ࡨϽэˎإʉϿ঩Ӧɿ؊ʰЎՑЈˁΑЃثҵƑʖ͢۾ՌʀҜ̈́̔ϝٔɰƎϒרv·ٰڼЋêхÐ̱'], + ['@@̟ˡˁՍ˃ʝԫ׈ǦɤɂɾĢԸҨ¸Ɖ֣جߺāߡ'], + ['@@ૣߕЬט؈԰Ԏ׊Ѱ࠲Ʈۅևҧѳֿ'], + ['@@Ԏʹ՘BgΗϳΣՕʧ‡ϸÒєŽА'], + ['@@ʀभ٫ɞj˭ȶԯЍȋ•עʧªƁԘӶãY͈ԣٜ߮mɴ̻'], + ['@@ɟܩέоѓ٘ܚ‰̡̈'], + ['@@ԮʉʶɖüɇƍΑ˼׻ɛۥӷ˥ƁڳȊڝѾġϊIJਾүăҙ˜ȫēϯٻЮ̵Ѵɍ̯՗ԊރůлȆ¨ΎˀɊʣȘŇ̡бӚűμߨͺˡĔೄ˜ހԘA'] + ], + 'encodeOffsets': [ + [[ + 129410, + 8617 + ]], + [[ + 126959, + 10526 + ]], + [[ + 121349, + 9540 + ]], + [[ + 124809, + 12178 + ]], + [[ + 128515, + 12455 + ]], + [[ + 124445, + 13384 + ]], + [[ + 124234, + 18949 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'PNG', + 'properties': { 'name': 'Papua New Guinea' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@ɽčε͔ρՔǷ٘ŜĆĜʡʬȏРՑЈ˵ŝɽ'], + ['@@ѯçƃɽҟȱћȟѽBۏʔӑɺêʺݬũҠàŶЖŦrĆѽӐÜʂ˼Ҹ̚ġӸԌfǜƏgү˯ԡ'], + ['@@ݤտղࢻӖ„‘ω٬ƛʥǁࣀΝġʏ֋ÏȷɔܟĦࡕŴٷ՚ӉҦѧ݀ભπ܇ʇԡˣńإڇ˿һƖࢅ–aᩒaᩒภ׃༊ӓׄїҴхŸӵඔԱȲѽޛěȄ֕'], + ['@@ʿɡǁӸȝ͘ϝ˞ӍΪ؇ʚɺȮҒɻ˸ȁΜȫʹΛ͊ˏĶѧ'] + ], + 'encodeOffsets': [ + [[ + 159622, + -6983 + ]], + [[ + 155631, + -5609 + ]], + [[ + 150725, + -7565 + ]], + [[ + 156816, + -4607 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'POL', + 'properties': { 'name': 'Poland' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@·՜à̂ȹ̧҆̚ɺɤȝђָʘ಼ϴ੒˴࠼ƙÚȱ߸Yਚħ໶^њěȬʵšωɸ͋KͯԋǡʸϳfϏцܻěɽзįރۥɒϗǿ¶ߙ͔؁šЇĒӹǵч̖Ήŕ³¼ϭаر¼ăˀֻĦűɑҗǨÀɴػòЉ˔'], + 'encodeOffsets': [[ + 15378, + 52334 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'PRI', + 'properties': { 'name': 'Puerto Rico' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@јõưǕɋɃمLӫ‡·άŢŬیK'], + 'encodeOffsets': [[ + -67873, + 18960 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'PRK', + 'properties': { 'name': 'North Korea' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Şƥ͉ºη˵ʣ˷Ž׽ѣȅƫƧ̓ʝ֓ƏηɥηįġͰƋӈσŧȭΧÇץ¡͝ϛϑˆÁùСdžĵƿʙé‡ǀɑüɥƆɰφȤİõƶɆҒÅƎөĠЇɤۄբऒҌ־׮Ўˁܪ‹ſѺಚβͰҼժӹ'], + 'encodeOffsets': [[ + 133776, + 43413 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'PRT', + 'properties': { 'name': 'Portugal' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@̦Ɉ΄ŬɂЫӺDƞłӪ‡ɼуϱɩYٽƍū‘Їγçʹԋɵտ̄ʡřɫ̵̿ê˥ͷɓѷŠџġŸڂÿԬϓþȩ͈äռͰ̨ÒͼǪԎkΤǙ̠™˲'], + 'encodeOffsets': [[ + -9251, + 42886 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'PRY', + 'properties': { 'name': 'Paraguay' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ͦ৖tҌЖ݌าʔޮ]޴їbʵʞҳÇଛࢲLJ΄ǐ֦ɩǀʣþޓİ͓̼›̀ƌ̢ƳAҥŕӻǑӛƍݏށ١ړƇऻŸࡑɮࠢ౨ťψࡽ͢ਅبۉŸ໵ൌ'], + 'encodeOffsets': [[ + -64189, + -22783 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'QAT', + 'properties': { 'name': 'Qatar' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ÇؔɨѲɰĜʬˁdӯǽӳɵÑʫǖ'], + 'encodeOffsets': [[ + 52030, + 25349 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'ROU', + 'properties': { 'name': 'Romania' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@δǶԴġՠGϸȳ˺źبĄɄȠΠ@ʰćʺʟˊΟӞԁ€ρėΩưϥϒƹЂƊϠƟpɏПǹʯĀɻ৥ӳĖ̪ؑফțзɋ௽¬٥ƀ͙ÕʍΊƵƦȚƘȷŀ˃ȋөʔßΌԟȢĥˌҕͤڪǂԖ֮Њ֬ԢǮ'], + 'encodeOffsets': [[ + 23256, + 49032 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'RUS', + 'properties': { 'name': 'Russia' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@ࡌ๫కˤԫ்ࠌࡳyוُԒսٱƻ۸Ĥࠊħ࣢Țٌš૴ӯࠜôରަϮͭϴϐŠɔ։̆ߵuࠟΎࡑ'], + ['@@໵]ਙĨȒτ୊˚ࢢƧψƃęɱäɉ'], + ['@@֦Ƚțؐᗸű࿨޻࠭λ൛ēsࠑͳǩ޽~ٗ̊ૣʖȉθ࡟Ǝॗʼnҗ̎Ǽ̸৓ȥϚЃӉΣ@„Ꮪٛᔺ࠳ïԷ'], + ['@@ः©ƭˌੲΖ@ַ'], + ['@@ળ»@ָň–܈E௒ʉïŗࡽȩ'], + ['@@ౡMႣĤƧ¬ߘͪੀþஞ͏ĸə'], + ['@@ॿͩഉø༛ͨȪ˖༨ųᑔɗ'], + ['@@ډرᶽzඃȣမղҎ׀૎ǂᕞ™ᴬѽ'], + ['@@ӹóᩣŊɟώູɦūҒ࡮Ƕ…Ҟသܒޙĺ፨݆ɩϢሤѺ᪪բ᫠ǀ෴̸࿐Ŋאͩ֟ʻᲗз᢭Џᤙߝఫࠍ೉߱Ǡۥྎۏ'], + ['@@ɨгސȲឤYቈЧڬ̿ȽѧङʝᕅүفʟਬşఖɃݴDŽєաτɔഊƂ᧪ƑȴϽ↲ů´ٜᄼƥഄLബѷϮ՝ӹΙੌڋ೔Ϳ߸ࢦഖϙ෢ɦྼʵؤʀൖş؅ޮૐζ䢀ձܐӿᔲٛ₎DŽာƑ۪΍Ĺؙਜʇ૴Ǥ๰vཚǑཪĢะݛਪˎڷ՞ϐώᧆɻფºᝂБ୲ν@”MKઇσઝÖݶҁԄەϲɧĮΏɑɝ༧Ǿ᚝مݛĭ౽ן௛ԧ̱ϣய׊ᔗڇϣ̸ߵΫ૱Ř˓ց৙߽Šͻड़ȋő௣ޭ‹Ϋ۱Δα฽ѕ̅ॡభȳʥ࡟ே޳ׂ̳έ௬ҵለИ୘܀ԆªϾರȊຊ੒คࡺຢڢڮஆ৷ëԍۗᒉइۍਖᓧ˷ᑃටۚԧሙɕಝēÔ؊ಯŶ਩ЭᢵƠ᪏ʟᨩ࿛ủጝ೚ŁаՃࠄȅ՞оईÃௌऍ†܍ځ࠽ë্ϛഉ్௓˯ׇଙ঑ଇॻթӹ૩ӱՉYՇФૻؙſ˩ŝƦKѐіxŦ঴ɛܚܞ̒৶Ʃ֢ࠈ˾ऄ͚̮Ѵݲ൷ʛܯͧ౧Dͻ߄হװหˎ̵ࠖ̉Ԫ̿βԯࡐ̲݇షʢ૛uਯƱۛлҤȥXҩұˑݷࢻRσஅՍ৙̈́োéѯˮԋĞ௷ףેƑޛȻੑƌޫSԙіࠕИࡅŎ੝ŋߏƹ஛ΜLJـধɎށİवΎࢉࢉ΀ӵࠇב௏ɂ࠻Š֗Ͼ࢙^ܳʴ౫Ѓྃܣࢭơ͡çѽԤઍőΧΦחnjЙӠҩưிɍୃӜ҃ѯሟᒒੵٮ̮˂ᑋߍ߭³êҞઅ˺࢙ȱ˃ࢊມǺݯΑᑅ̳Чȹḭ̇ϫ˻؆ֹ߭ɓǀɭ߭ХസֿɁЉ୻˜ʓʟ੹Ѧ೯iࢻΟহͼᇡ׊ಽsჃࣳĿؗࡹӤڡउʖǡӝُ܊֫ذx՚֗ďѝѐƋϥӽ߿Ƒ࠳ࢁކߕĉ֣ࣼফԇ͹ƝɇωÌֿԚɿ†ՅȚʳΈ޵ǮԙƁƥƼଥЖఅƌ܃ƞĹıੱ܂य़̈́ܩӴؒƈۤ۰ҹͪఌ΄uȀݯƉ‚ώѠɼ߼ÖƄ˪ȅҪ΀ѰWʚఉ˚ӭUԯЀ١ƃ੩̐lǒ̗θڟ¤éʼɀǞ՝ӈࢋąʭ¦Ƀȑ̽”ȷ՞ȟ˨NJĀڴ‡͞Ȁʍɢ֥ƪ¼Ʋ΁ƴՃվǸɨĉЂࠑȨѱijšȼࢭɂˑӸíТЙȖάˊʝ޶װӞųƤक़ҬࢡЎᅢ੶ޮӠ͂єగּΆնݳش֢ܜ঍ग़ޢي౿֔ŬךڶüොͶࢀ̈൦ԕᘨȧṺो٤ЋÆ֓टѳ൏ɡ⏷ٔ؟Ńൌ؛ÂϵÆ࡫ઌʯڂɓňРԑΰ՘͈᎖Թ۾Ȳ֣؜ዦࠖޢµ޸̋Ӫ׀۫ԄЪԊءԶᚠˑӔҹ੡ĻNҳڌ˽ಜǼȶ՚ჶАᰪܞي£ࠣԙਬĕ׼˼༾xఢΐफ़ԏॖ֌ࢡӢѪˤ២ʫ୒ʿᴾॣ֚ѰࡡѺ{ǴৣĈˢЌ҅ټ}ː༄ݾրކزǒᕮɛǬұߕڽԺˋ˒חȏଵऒԧέ֕࿫஝०ŭ̢ͮऎɎɞжܮЎөӌϼֈࣿêȫҲڢࡈણۆຒ֦șװмnѴүͧ߷࣐Ƶϥ؄ඤͦლ¬༈ӏݛ۪ċࣆศǞ፾™ᆘŌہѮংւॲx࿎иᕠŐ˪ɲᕂþیȋሴҀ໲aɶδߤΨጤΈ෸˗ଥȷበŹ'], + ['@@ⵙ͕ໞીےĦقÃᒈӋʟͿ'], + ['@@૽ōݱÛśƏঙƑ࣫ȦӐʾል~࿞ƶ౨XǢɧӘȬߊƐఞǿ͗ŷ'], + ['@@ᆳĿᚉʎඅ͎٣׾଩ǔᔆָᆎȎ࿌чኬ߻ȹݯ'] + ], + 'encodeOffsets': [ + [[ + 147096, + 51966 + ]], + [[ + 23277, + 55632 + ]], + [[ + -179214, + 68183 + ]], + [[ + 184320, + 72533 + ]], + [[ + -182982, + 72595 + ]], + [[ + 147051, + 74970 + ]], + [[ + 154350, + 76887 + ]], + [[ + 148569, + 77377 + ]], + [[ + 58917, + 72418 + ]], + [[ + 109538, + 78822 + ]], + [[ + 107598, + 80187 + ]], + [[ + 52364, + 82481 + ]], + [[ + 102339, + 80775 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'RWA', + 'properties': { 'name': 'Rwanda' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ͬӃµӵʏŁѿÆʱӍԛàþҠŘތԄʎɺȰďԈʸ'], + 'encodeOffsets': [[ + 31150, + -1161 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'ESH', + 'properties': { 'name': 'Western Sahara' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@oҊŸ@@ÉeNjEౝ᪁ª‚ᒷ޿÷ȳћDŽ்ᾓNǽ˫˜΢bCቆäĶ̢ΆϘˤୌୠ࣢Ђ੖ˀÖ˜ټۺĜ̦ʼnϢ@˔ȒԲ‚'], + 'encodeOffsets': [[ + -9005, + 27772 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'SAU', + 'properties': { 'name': 'Saudi Arabia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ʼnΪʩʨÝͲѡ̞҃۴ʁۆׇ׀ϑƐ֋ߠīא–ӾӕञϿ͠ґǨˡӖ°ȎɹѦʕȊ͝زԟڴѓ־лIžҦœ̌ļͲनƅζʶȪ̢ٚŚƒˮˤƜ࠷ࡀ၆фdžŴৢɩబיᛎၕ༠ãݠąȾЏתv͠ܥаȓƠִ̏Λ¼΍ċ˩ł˯ʎɽŐ˟ŲȵʬǕɶÒdž͍Žș࡙͐ᡌщǞDzϪש֕၁ᠽ࠽ᝑ͑޷ϙ׻ࢥϹƕɁˬ͏§߻ĎƷČॹmɫùΉɔɝЭĒΟρˋ'], + 'encodeOffsets': [[ + 43807, + 16741 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'SDN', + 'properties': { 'name': 'Sudan' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@śhdмĵ̀џͨĵ؄ĶبϳÌÍȇԍ©Ȭʕðԍңңл؅џđ۹Ӫͅǥđʓџǃ…ǥ࠵@řǦ؃†̡ƝɳîѝӬƟɲ؃ŗɱϵɏݣ˿ǁʳğå ̅ʎÃʼƌΔE΄ӛՀĩάZȰ̱ʜUӦǭ͖̍µĎ̰ɒΖħΐˢʴǫȞɞ԰ϨئܦÏ¥ ZΚॲH@း@Ὂ@ῼ@˔ࠗȁƳŪࡻ্̰͌ȷҠ̳ыӑأƏ˅ʳĉ֑α௿ĚͳƅܟͿࠟԓзέٛč΃Љɽʝ࢟Dij'], + 'encodeOffsets': [[ + 34779, + 9692 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'SDS', + 'properties': { 'name': 'South Sudan' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Xٽűʯѿq˷ӏԨÑюХƨͳϦșӼࣳ֫օԫԇԫϭסFگȟՕȊ΋ɭ݉֐ȥάҵDZϱÆɣƕϗĸԗۚƉˊعͪɅԌΕζ֟ѬS˘ҡͼ֯͠ʴĠ̀ǂɐݤɲ϶؄ŘƠɱўӫɴí̢ƞ؄…Śǥ࠶@†ǦѠDŽĒʔ͆ǦۺөѠĒм؆ҤҤïԎȫʖԎªÎȈϴËĵاĶ؃ѠͧĶ˿cлŜg'], + 'encodeOffsets': [[ + 34779, + 9692 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'SEN', + 'properties': { 'name': 'Senegal' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@΍ٺн̚φDŽРמȦќ˾ːкïШǾҶVДʙ֎ɝԘأֈֽžԹǔӓ̾ɿî͗ʽŧ³қâÙģȃk׿ȲЛV༇–ɥħ˥‚ѻƋƏ٢ވkȬŞƮR̸ȘήǯκcζȌǝʐˡƙʻJͧȸˉ_ȍȥࣵy'], + 'encodeOffsets': [[ + -17114, + 13922 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'SLB', + 'properties': { 'name': 'Solomon Islands' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@ɾ˿חN͉ԬԈȯǜ‰'], + ['@@͝mԧĎǫżÀͮֈƁ˜ǭƎə'], + ['@@ųƹحܰǫԈ˺@̠ڥʹЗ'], + ['@@–ǛڅΦҟ̠̿˪ŰĐϮȫېϭȢˉ'], + ['@@Ǘ³οȒ·Ί¨ƖԈΡͰ˛'] + ], + 'encodeOffsets': [ + [[ + 166010, + -10734 + ]], + [[ + 164713, + -10109 + ]], + [[ + 165561, + -9830 + ]], + [[ + 163713, + -8537 + ]], + [[ + 161320, + -7524 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'SLE', + 'properties': { 'name': 'Sierra Leone' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ɧØ؁ͺѩ҈Ƨ̬Ĺت҆τĬɺƞǸɶpȜǂڦCɺ̛ǼˁʓƈɗṶɴ´ϹϹϛҗ«ʓȩˏ'], + 'encodeOffsets': [[ + -11713, + 6949 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'SLV', + 'properties': { 'name': 'El Salvador' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ġȡӡ^̡Ą΍ǘұÀʃǶ~Ů˾ɄǀĢ«IJȠ¾ʜëǸǙʪƇŒœτĴǤÑŘĝÏͳ'], + 'encodeOffsets': [[ + -89900, + 13706 + ]] + } + }, + { + 'type': 'Feature', + 'id': '-99', + 'properties': { 'name': 'Somaliland' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ϛԩד۫۹Mᩧা͍̜̳К̳ҨǾ̖̲҈˚ƹǒΏϜΗкGߊɌࣴĴ݌ʼиÆ̚ƶӎˆKaE΋Aࡑ@ѫ'], + 'encodeOffsets': [[ + 50113, + 9679 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'SOM', + 'properties': { 'name': 'Somalia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ѼĎЊ˾͈FpɵýӧHѳǯ̣ʁࣥЙयԱ੷ܝ௷ܓवধ଩ࡁڹష࠯޳ٕँৱȗѷȍȣӽۚWᵤܾ॒ɰˆբfݠפબšᛜᡄה۬ϜԪ@ѬBࡒFΌLbːhϰŰ'], + 'encodeOffsets': [[ + 50923, + 11857 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'SRB', + 'properties': { 'name': 'Republic of Serbia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Ԡȡà΋Ӫʓ˄ȌȸĿșƗƶƥȷȏø̫Тγ͋ʿƗˋĞijƑšϳa˹µƒØĴĴĦȴšKǍƼƑ ŋƆƽÀšŠƯ±ś˧ȩÑèð͋Ǩ˟ĜūŜɟƠȢšŬЄЛ͔ɀτ̥Ë͔́ˉʈȱ͘٢ɚԾ™ҖͣĦˋ'], + 'encodeOffsets': [[ + 21376, + 46507 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'SUR', + 'properties': { 'name': 'Suriname' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@৔ǙĞưڶÔࣚɥѩܟâֹͤӽƥίóϩɉΛӓDzЇđ͹öčʏƘǗ÷ǡҙèԡܴōӄˏBωؐƺѠ¯ȤԜɖƈݲ'], + 'encodeOffsets': [[ + -58518, + 6117 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'SVK', + 'properties': { 'name': 'Slovakia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@´»ΊŖш̕ӺǶЈđ؂Ţߚ͓ɷɓǏ͹dzđ࣑ʮ˟»ȟȡЁĿěÄХŽͭ}ãǙ۷Ļ̱ĠёɌċ̆äńŢȂόa˺ĔxþLj¢ÆȒȖ˜žưʢD'], + 'encodeOffsets': [[ + 19306, + 50685 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'SVN', + 'properties': { 'name': 'Slovenia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ۜÝъȐܾtLjƘƘUǎ˳ڝɟć͹̇đHɻͣh˷ƎƷƙב†ȈúȫΨĞа'], + 'encodeOffsets': [[ + 14138, + 47626 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'SWE', + 'properties': { 'name': 'Sweden' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ࠁוƀԥ೹ڭྱܡؓஃײףߦүޗॅ࢑ȝ͍තӋ޿৳ĆӅڗঃˉߐ۳॔ٓஐφӜּۨ˦ন՝ю½ૠղ߀࠰ä̧ͬ˺ಬஂࡀञֈײ߮GɞҶཔƉŬքԸ”૪Щ಼ֱv಑˴͛ฃʃ'], + 'encodeOffsets': [[ + 22716, + 67302 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'SWZ', + 'properties': { 'name': 'Swaziland' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ǡύӭěԅҖS̄ɰ̀ĂʔʐÒшƵŰϕðω'], + 'encodeOffsets': [[ + 32842, + -27375 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'SYR', + 'properties': { 'name': 'Syria' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@࿩ࣅऩͬgNŖŶ_ΈȸҠҜ̈́Əͤϗ¨ÿٞȶΌɤȀɤȀ°Ҹ˞Ǐऎɺ҂ƿۖFॴ̀Ґaक़žїԽҡȹĂؗͅ৫ᇵ࢓'], + 'encodeOffsets': [[ + 39724, + 34180 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'TCD', + 'properties': { 'name': 'Chad' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ĎЄաnDզΓ̶δ૊ੴߌ¬ન͖ၼǼΰΓ˾_ˌ̽ɔȷರࡔҠ…ྑ…ྏ¦ ܥÐϧإɝԯǬȝˡʳĨΏɑΕč̯̎¶Ǯ͕Vӥ̲ʛYȯՏƛэͽ؉ࣹ߅ϳ߹¾ʁûĊ̏ѫ̋Σ͟੓͏ȽȐƓhƹɍۛÙƀɪ˅ׄşΐλƜӷӪǼІϦċʂÐҸSқކŒ֐É֐ͭՠ'], + 'encodeOffsets': [[ + 14844, + 13169 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'TGO', + 'properties': { 'name': 'Togo' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ڱdzȇ̎ɡՔãкȆݴɁ̬ăڎD؎ΕѠÖˀ݂kŅѵʲʝ̈̋ŽЭǜǥኝȺׅ'], + 'encodeOffsets': [[ + 1911, + 6290 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'THA', + 'properties': { 'name': 'Thailand' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ݭϬܗeŬڈ݉Káऋґ௯˙ݏÌ؋ն΀ދưܭҶӓԚĭѤѧ˝·ևĵßќۇςƣƭͧ͒ƝжҁӄПЌƏӳǃҲĠԾʚ߬ТࡸҤ޶͟ތ`϶ĩҸ֕ښȩф̄ƺ̮ܶ·ֆՓؘН݆ΠƴϦࣦצœӬθӔȘθʷ´ԍ֨ȷࢭpݫࢰԆʤƧӰzǜَ̊ÍٖڽÀࠥںܷ›܅˙ϛ޿ŦગDž՟ۧȤ১'], + 'encodeOffsets': [[ + 105047, + 12480 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'TJK', + 'properties': { 'name': 'Tajikistan' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@̭ʷࣳƖāӛ࣬Þਢ˗འŶɈާˠĐԜȓ‡͛ŴӍࡿBׁØԻϕύĉ̉ǯͩˠþ۸ʩ¢ĞʲғȐα̇ė͹Żūԇj˕ϩ˯nj؋ˑʱĺӀࡘǹض؟ȨɔφۮŸЌҬˌբ૲ȜǩϵŤɹΎv'], + 'encodeOffsets': [[ + 72719, + 41211 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'TKM', + 'properties': { 'name': 'Turkmenistan' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ñۼطŠॣݔڣĠगюׯþσƽ֙|ׯӓ݇NjƻרŪ࢞ٽ˶Ɏֺ֏¸Ȇ۾ߊȵ݈ˎؓԎʉӔڱɋď؛ʿհψ˨ॖǪ֨ɻךڅњ¤ॆ\\Əцܖ̂۾ӦଆѹĜڡ͐ǣࣦžˮƳаࡽ०ׇոЃ࢞Щ૤Ϋwԥʩ€Ѕɤſ̙۽NjǙڥӁʭڏŵǫϟهŏࡩ͈'], + 'encodeOffsets': [[ + 62680, + 36506 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'TLS', + 'properties': { 'name': 'East Timor' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@IJȤܢȌז†ˀŀ͆Ľ̯ɫ࢕ο۳ʋeʬďǔ'], + 'encodeOffsets': [[ + 127968, + -9106 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'TTO', + 'properties': { 'name': 'Trinidad and Tobago' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ӚŊǮ‡‘صۭġƯúʒɲiͪ'], + 'encodeOffsets': [[ + -63160, + 11019 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'TUN', + 'properties': { 'name': 'Tunisia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ΩພԭͺQȰۉԄóنԮҶȢۚƃߠǠќࣶͺךĵ}ы܊̲ÒljпЫMϱ̆ȽōܫփхDŽқѤaɄЍ͊ſ³٥Хʋʵˏֽ͓ĘΑïΟЧț'], + 'encodeOffsets': [[ + 9710, + 31035 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'TUR', + 'properties': { 'name': 'Turkey' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@஺͗ঐżܤõলѬࣆ¢ߴЭƜ̑ăУزȻͨʕֻʇˀ५ǏʻҠڧЕƙ̏Ɋ঍ňίŽॗŽҏbॳ̿ەEҁǀऍɹ˝ǐ¯ҷɣǿɣǿ̱Ϡ͈͂ԟí۱ȖֿәౣĥڹҊࣟ†ȗΑׇij߻҄ࣻeӽ࠶ؗҰЦٸՓВठߨಒ’Μྀٔŏ৞հ঒ʄർlุף'], + ['@@۫ҏ˃Ϻ\\ǦȦĦʺՂХɞࡦ˄ܤőĴ͓ܼ˓Ƶȵি±Ωʷ'] + ], + 'encodeOffsets': [ + [[ + 37800, + 42328 + ]], + [[ + 27845, + 41668 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'TZA', + 'properties': { 'name': 'United Republic of Tanzania' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ƚġᵂႋÌӣ஼࠿ϱਙ¸Ӊՠ̩~ɓɳԓ¶ʭÇГ̌Ճΐ̰ࠡǿڝӣࣿ͛ԋb̙ʥבsɕŃঢ়ʂكåɽଢ˵ϺǛɶࠗƾӉʨՕƘͯƘΗɈґ੖ӣҺǗӤČѨƯޞΎ ̨̦͜ѬȺǮS˘ǷȐ·ͨʐł¶Ӷͫӄ̎Ķऄ[ႎà'], + 'encodeOffsets': [[ + 34718, + -972 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'UGA', + 'properties': { 'name': 'Uganda' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ः\\̍ĵԇʷȯĐPوȜ͎²ڬǰϸ͎Ѭ͔ɠ˒̘͵Ŗ¼চΌɮՖȉڰȠעEԬϮЊ׍İсτ९̧ؓЯ֋ʉͽTࢹႍß'], + 'encodeOffsets': [[ + 32631, + -1052 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'UKR', + 'properties': { 'name': 'Ukraine' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@̾“ɄȒʮ¥ࢌĆ՞Ӈȿǝêʻڠ£̘ηkǑ੪̏٢Ƅ԰ϿӮVఊ˙XʙͿѯȆҩƃ˩߻Õџɻύڡã֑˕޽«ܣ̻¸ԹЪȭࡨ¼Ǐ̛ँơଛӟұǠȄЂࣽʘƨLjߪ˪ʑȔಯɆË̼ީĻ̷ҧٱةϟƠЁƉϑƺɂĞƦ˾ɲˎÑƮǬäĊśӸ{ɞØƽĎÐŲ̉ɈŧΘ̩ƐÒ˶ϝɦΉŽأʾ֑ĉȧŭΟ@Ƀȟاă˹ŹϷȴ՟HԳĢγǵÍɤұɮǐͺɸɔȀµɑϘބۦиİĜɾхܼДҢɪٲnࡖßबȫڎi͂ŧ̀Ʀɚȝݸ¢ͮąÄцʶȂܞº'], + 'encodeOffsets': [[ + 32549, + 53353 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'URY', + 'properties': { 'name': 'Uruguay' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ղĚࡆٯ̺|ࡺ՟ڈҫӠֱχЉɸӇεՇॉұاǚғěޥΰ֫ԟҬÞլǾȈS࠸ɤࡺȾڦ'], + 'encodeOffsets': [[ + -59008, + -30941 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'USA', + 'properties': { 'name': 'United States of America' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@ũƕȽŤ|ɾƓ̨¦ĤƤƎÍǔ¸þÜe͐ƙƬñƌőɊ̍q¯͟ǵˏſ'], + ['@@˭ÑƟǮīèQÀĈî̘āɘŹëĵ'], + ['@@ĝ҉|Úĸа•'], + ['@@­µÓŻˆŃȒ’ɤŚêÃʐ˥'], + ['@@ıĉ˱ƴªÖŸĈȘijȝ'], + ['@@Ƭңʼƛז½࡬ƅࠂʹڼŊਖɓ˞Tݨʄ߂̧ࠒ͗ں˩ٶˏĈəȢĉ½ĉɦǎĔ¦ȣǜƅɴ@ŬĹĽƫ࢖ЁǶށǚܳʗӹЁҥȁ̍mēĦť˸Ɓɂ@ঊ҆ࡾƀસмfĐ÷ʰƉǒϜƆࠜHޘAˎ͞ŀàࢶ؄ϜƸ౦N໾BĎȺː¦Φž̖Ϣʲٺٚي˨ə֜ƜώʏAଧռӅƢ˝࣋Пࡷ̃ࢱʝѻӿƛȋSѽˤѽΒsė̬ʦȇãʇ֥ƋЗhةƥλ¥ӥ¥۫ʏఀǂʠǃ୳ʥ՗C|ĺʭɷʚǹ׽ؑ٧×Ɏȁª˟ɀǪҍȼƭ^ͅˏ͛ҿڡûʺֲѕ͎įۦljεǴՑևƀׂ˓˜ߛʊÍĖ̃ŠࡁՕدࢇʝցӱнÁэ̱ţ˭इձӁЍЅӽŻׯƪ׍ˬܗώשLεЊঅ֥—͛ȿԡʣŃЯĺƁς͋ȖѻܢϹٞű͢Ǥ֐ɽҦٻ۲͟źࡑϡƭ¦СϼՃȺोŁݗĤٙÍΏſƲɟaͽǴǓLJō̵Ů́ǃ؍€طѺܻĿ؏ȚԹÏۻȝއح࠳γҝБȕϗUׅ¨ЕDŽ˹͝{׭ȂٽʺɽЄȁטӷӐ̃ӰуֺףͲۉgՉڑۣʦѡʪȽҦ˧Ѯӿτїˈ̩̖ป@C΋ڗ@ဩOቿפ౓ТĀǒ੩ĝॕÝƙіխӚϻĴğʌһ¦̝ɪޭĊɉƌĹҢࠁࡊ۩ୠˆȚχˤٯ۴řۆ҃ҞȀۢ…ܜˍ٢͠ߊĸނĺނƱૼˇܘʓ϶ĸǐ௒˷҂ߋȺɜƇې˷ێᛸ@᠂@ࠜ@ᢢ@៚@ᡀ@ᡄ@᭰@ᮞBაAF͔˴J'], + ['@@࠽͋ѕɐŽЀބ̘҆Ÿ֐ÉΤʻܫЍ'], + ['@@ԧŽսƾԛɮࠦƞښùĂ͑'], + ['@@԰DžԾĒڸɛ࠲őéĝُDZٕǾ͋Ʋݍµȧôº̈́'], + ['@@؊ϛώnjහ»¹ȕ౾ƛࡨČᄚ˅ྤā٨ʼn૦Ǝౢʧࣲŝ@@MᷱIⷍࠠ{ࠌɵהρݜցࠈҺࡈ˖Ҁѡ֤·ޒϙՂ׽࡮य़ේ՗xՋұЙҥ͂ݍˌʃܺએںҍߎ߯Ä೷rটʌ჉ࢎߩDŽ฽̜୑í࿻ϬৃΨटǯǦ׏ҫÁঁǫ݉˱झdzťӶϚࠚࣀʶɱɂੱҵֵ֑௅ױؚСߏ׿ࣗΗࡁʱȻωಽѡ˅ϿছΫֽÞ޷ɻ࡝˹ۧ˫෹ʉſƘऀϾࠔʸࣆҠਬĨвΈ୘ԊȈǚب̒ƢْђӸॹʫ˓Ơҕ̧շюɧ̝̽м࠿ͳԩBïԄƲ̮ե̚થLJ܁ЀַȬIӈ٩Ϊ͘ӘۆҸ̚њںÖ־ƇڴМ؎ï٘ʼƻϨҹưج͖ԩWࢻǽʯȃڏȄஏĥ௷ȬΛ͸੟Ӧ୾ΘመШ۔@ŕнᄢŽڽԶਕ͌ױр߫ΨଽˈҺѲ๰‚ਗ਼ϦȨФ࡬ЎࠊĪཪώޜÉಐ҄ౚǭ'] + ], + 'encodeOffsets': [ + [[ + -159275, + 19542 + ]], + [[ + -159825, + 21140 + ]], + [[ + -160520, + 21686 + ]], + [[ + -161436, + 21834 + ]], + [[ + -163169, + 22510 + ]], + [[ + -97093, + 50575 + ]], + [[ + -156678, + 58487 + ]], + [[ + -169553, + 61348 + ]], + [[ + -175853, + 65314 + ]], + [[ + -158789, + 72856 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'UZB', + 'properties': { 'name': 'Uzbekistan' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@xԦૣά࢝ЪշЄ॥׈Яࡾ˭ƴࣥ͏ǤěڢଅѺ۽ӥܕ́Ɛхॅ[ᶾᓘӺƾïದ׻یͅߤݵঢŪ෸à৔ؗÙࡅЦMǢۍ੬ɲЉ̺Lπ׺૎הӖƺʠĉ۵խئ́ײȾ়ѷ੽؁ٕĊ΍uţɺǪ϶૱țˋաЋҫۭ ɓυؠȧǺصҿࡗهǰҳN'], + 'encodeOffsets': [[ + 68116, + 38260 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'VEN', + 'properties': { 'name': 'Venezuela' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@yȣӱĭ˜ϡYѭυӥ͆ڙδÆȌ؈ʻ̒§َਸ਼΀řІ̎ˆ̞ןל_մҵ˧ݮQ࣌ĔӖϕٞĻҼʾXɄਨ¼৖\\܉ʛ˼Їڦ×ِЯƆڧѬn͢ȣڕӱó̫˾̷ȽƽԫƉjϱɫɱّ֪Őʁ̭͍ऱ̽׿Žʏȣڛɀثņƿýϔɑ‘֝ŜՉ܆ï°ǭ׷ʅĭΣΉƏسȝNjʱٷÅҧѼʯ࠺ɟ̧̌Ȅюм…ȊʅʠǛ֒à׼Ȉ˰ƲҎ̓Ơӏĩ؁®ͻęסܢӥńઉăȧ̊ȷê‡ǬĴ̶áͺȃȂŅϮѡÈɸӮĺ׶ʔ̸͘ʌɈрդƖ'], + 'encodeOffsets': [[ + -73043, + 12059 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'VNM', + 'properties': { 'name': 'Vietnam' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@૭ܗ۫ߍȁ׍٠ࢭ޺ળނԱԞګϪ།ŕ๓۫փ१եۇ۫਷ޱ̧ՠʀ֬دӌܬ͸ࢦÔσԚප٨ļ৖ț֖ƶࡀɃצٍאՋ݌ۥ঴৓Ԋʊ̠՞ɘ͙ܺਙPϕކӭڐҊȴڢIࠈĬܒ҄К̿ސƵƃӛАͿࡎɓ'], + 'encodeOffsets': [[ + 110644, + 22070 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'VUT', + 'properties': { 'name': 'Vanuatu' }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@ˣō˭ςŒɤՆӗ'], + ['@@ƌڱɥŀǩ­ťɴi٢Дʵ'] + ], + 'encodeOffsets': [ + [[ + 171874, + -16861 + ]], + [[ + 171119, + -15292 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': 'PSE', + 'properties': { 'name': 'West Bank' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@ԣŭʙЃŕ˜ɜɌŚɁĦǬ̤֔ś'], + 'encodeOffsets': [[ + 36399, + 33172 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'YEM', + 'properties': { 'name': 'Yemen' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@؉ɥNjύo˹࠷Οഇϻݩףυ±ʥºӭΑ՗lj۷©ɃµǿɛəÕŻɇеlˍœ׉¨ɓӬzҠƍʜǑتʋΊǚ¤đϨĸNJ™ξςˌđΠɞЮΊɓɬúॺnƸċ߼č͐¨ɂ˫ϺƖ׼ࢦ޸Ϛᝒ͒ڀ൳˞ח'], + 'encodeOffsets': [[ + 54384, + 17051 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'ZAF', + 'properties': { 'name': 'South Africa' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': [ + '@@ǏŧΣяɻћӇ׻ोࢁףԋًϣ࢛͙ѓ«ŇɷԛŰеDž࣫NJԙĹΏ¬ࡿͩܓƃԱͅϡoΣ̚˳fαϒŸśŏɦLӰ˙֞˔ƴs٤ս޼х܈AF׽તДдͪɯƘΫϘÓՈǃҌÖݤіB᷌ɨűӾߙûԟȈ̏׼ĒрϒЊʨȶДЦȚΠķВɽۂ£՞ȜĐʾƨДҚäʨ͂˪֔ݮغஒؤ΂UОƛ˲Ķ҂ċД஁ɔׯƫऩî̟чƶʏÑāʓɯ̿T̃ԆҕӮĜǢώْQȿؑıۥɑϛֵщ', + '@@νʶϻǟҕ҃͡Տـ٧̜ČƺˎҴƀƜ˜ʴФ̅ʪ' + ], + 'encodeOffsets': [ + [ + 32278, + -29959 + ], + [ + 29674, + -29650 + ] + ] + } + }, + { + 'type': 'Feature', + 'id': 'ZMB', + 'properties': { 'name': 'Zambia' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ІϏɊ܋ƝɩǙڻLjۡ˃̇ʭޭѶɓᢇۗĂׯٍřӍͯĹ̛̅ßܵۓҭխ˳o˗ĬऱĠƯÚOêͧȎկ¶ۋȑչԾ֣یžᦶშYí̂Ű̀ƧЀĪТėʺ̂q¶ʽϾrՖûˬϡڨŝԤˆȌѯ٠ş̴ΧΈҥ٠Që࣠ɱƳח͞ɧƬļࡈƬসȉψʈ՚ɤĶ଀ƚͦđΘɇͰƗՖƗӊʧ'], + 'encodeOffsets': [[ + 33546, + -9452 + ]] + } + }, + { + 'type': 'Feature', + 'id': 'ZWE', + 'properties': { 'name': 'Zimbabwe' }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ҁČ˱ĵНƜ΁VՙϞٯźʙՒC̒έĞ्ई˃ӢǛƮ͓ڤलğ˘ī˴pҮծܶ۔̜àĺ̆ӎͰَŚÆ̻۬hϴǯǺȻАÓѦˑF੟Ǐ׋—عƊʝħӵŵùɛ؅ࢫ॓'], + 'encodeOffsets': [[ + 31941, + -22785 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/xiang_gang_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [{ + 'type': 'Feature', + 'id': '8100', + 'properties': { + 'name': '香港', + 'cp': [ + 114.2784, + 22.3057 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@™@}ScTʟ@cWuJÁ–]„l¦RLj¼BĄà˜ ŽH@TOHCTDDDHDNAT@PEHDDNJLX@BABALHFF@DKHADBBLDHHFBLEJB@GDBBFBADDB@@KFAFBBJJA@BB@@FFDDADFF@FADDDBJC@AFBD@@DDD@DAA@D@DB@DHHBFJBBFEHDFAN@DGDC@DLCBDDCFDlAFBFCBEF@BC@GDAB@FD@DZJ‚X´HĐMja@Ý`p_PCZ@lLnRGSDMFK|a\\Y}­ƒ§™Mën'], + 'encodeOffsets': [[ + 117078, + 22678 + ]] + } + }], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/xin_jiang_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '6528', + 'properties': { + 'name': '巴音郭楞蒙古自治州', + 'cp': [ + 88.1653, + 39.6002 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@˜@ÈÒĊanwŎV„™Ȯ¦ͪŃĢ„ÜōȂçČéƐżLɆóĊ‚ĊaʊŁ±¯²Um»ˌmÈ»V™ʠţWÑůǓ郙ôƑƒğÆīŎī@Ƿ™wô™˺LÞ¯ƨVǪуšĢ™ȘV°wĢŽôk°¯ƒ»΀@Ȃ»ĸŽǔ@΀ƒ͔ôôLɆó̐ÝɜLɲōͪƒƨóŤK@ī@IU܃ÛmȻţǩÝ˹ÛljťǓǫō@Ɲ²¯VçōKͿŁΗÇţ»ƽ™ɅƑLÓŏÅÅɱV@ÝĊU¯ÑĊĭÞLšÞŎJ±̃XȣˌōlƒUÈ¯ŎKÆƅ°™XÑܱnŗġV¯™óaUƒƧUōŁ„Ñ™±„çɲ¥lĉkğ°ƒk¥˜ƒnğţL¯ÝÝUƽĬ΁lķ°@„ō„XÿݯV»ŹLʉÞɱŤĉó°ÝJ™¦ÝKÝ£ţܙÈĉ@ƒxǩUċƑ@ky͓¹™`U²ĉVġ»ğa¯¥ť@ĉ™‚ó@ŻÛÛJƒw¯nó¯ġWƽʩķÝɛwĉĕݼȭÞķō@ó£Å΀ƑŽ¯ôȯÞ¯Ȱ™ÆōèĉXǼó@ݚnºƒĸ„ÞVƜĸȚUʶõˀĵĖɱŎÝĖVࢰӒѢ°˘nϚVˌ™ÈmɼĵŦW¤öʊõʔ@°ÈXVŽ™ènŎȁb¯ǫĉ„±Èğ`ġwōÔğ»mVVŽ„Ý¥ó@™ĸķô@ššbX„ĶmV²²`Þ_˜˜ɴbͪÈ°„ÞWĸÈŌmބškɲŽÈUÆ»n¼ǬVķĸźô¯°n¦ɄǜÈ'], + 'encodeOffsets': [[ + 86986, + 44534 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6532', + 'properties': { + 'name': '和田地区', + 'cp': [ + 81.167, + 36.9855 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ƨ¥šèź٨ΘƑᩄbUࢯÞĕɲōĶĕöʿVʵķșUƛƒÝ„ķm¹Þ™ô@È»ĊWŎçšÅ°ȯȰÝ°óƒÆͿĉ»̽çnƒmɱĵƧºóU™™ƽ@±wóL¯°̻L±Æ¯Vƴķb¯VÇ¥ğ²Ǖbk¥ÇKlÅɱġ@у™óK@™ÇaÝXğţxĉČǫķê¯K@уaŹ„ƑKƒ¼¯Vóaónġw™óÞéU™ġbóĉğÇl¹™aUóğKW„Vůn›ÇŋƑ›ķnʇ»óxĉw™çÇ°Åw™°ċ„XŽ™„ób±ƒkÈÇJ—ƒm²ţx@ÒݎšŦǺn„ó¼n°ÇbUÒ±¼XĸĠłƽXmwĉºƒzÈÜmnxmx²ĖmҚbnŽƧêUºĊêÆVóĖóUĉ¼ÅĬƑ°ɆƆŻŚlłÞLš¼nĠƒ¼@ޙšÞź@ŎÞ°VšɄɴжϼِ͈Ŏ„'], + 'encodeOffsets': [[ + 81293, + 39764 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6522', + 'properties': { + 'name': '哈密地区', + 'cp': [ + 93.7793, + 42.9236 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@WnŐÆĶLĢ¦ţºź„lxÅĸƽŚ‚Ʉ—Į˜è@ô²ÞUĔƐńV°¯ĸX¦Ɛm̐bƒ»Ɇa΀šĢ™ƐLˤ™ȘÑnƒІljĸÿn¯ĶaŎ¯ĢĕȘ¯°΂œla¯¥™ǕǔwˤӱlťО̻nŻmɃĕċţUw°WUóƨÅţķ°ýV±óÅǓéʉ¯ƽŁƒéōǖȁÝƏůǕw˹ǫȗǓƧǕVý™é@ĬţLƧôͩ„ɱŎɛK̏ÞɅôóK@²@°ōؚ¼lŦ¯ŰóƜÛlV¼ķ¼ƒ°kȰ™Ű„ĠƒǬ™ŚÝŎmĖ`@ÇÜn„'], + 'encodeOffsets': [[ + 93387, + 44539 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6529', + 'properties': { + 'name': '阿克苏地区', + 'cp': [ + 82.9797, + 41.0229 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': [ + '@@VƚxˌŎÞŎƒ°n„ȂÒ°²VĊ¯VğƾˍǬƨÞÞKÈÞĊVźôɆÞĢèŌôWČ²ŤVÞĸʶbl‚¯ôn_VÆĸlmÞnVź_ĸ¼Ȯmǖ„šéĸW°°„ĸJ„kʠ¼Æw°¤ÈƒlxɆzČºĶI²ÆǔUš°ô@Þ¦‚ƒUnUĠ¼ŎÓĢxĠ_²ÇĊƒǬ°ŽȂamōšçUÇW@¯öʓõʉX£ĶťnɻšÇUˋmϙ¯˗ӑѡᩃaΗƒœɜ°xWƴUxɃÒˣ¤Ʌwğ„ʉōóÝŹ±°ȗ@¯„ƃ²¼', + '@@ō™гwȁ¥Ƨ°ŹÑķV™¼ÞêĊ»‚lĵšm¦ÅW@ĀôÈźaɜxÈbÞÆĶIОŘnIÇŃÛÝĊÑĠƏ' + ], + 'encodeOffsets': [ + [ + 80022, + 41294 + ], + [ + 83914, + 41474 + ] + ] + } + }, + { + 'type': 'Feature', + 'id': '6543', + 'properties': { + 'name': '阿勒泰地区', + 'cp': [ + 88.2971, + 47.0929 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ɲˣĊIÈ¥‚ÅU±Ċýkō°ƒĉƽó»ĶƽXóʵʵ™ȯƑÅȁɅ¯ĉ@ÇሗK֛@@ˤV֜ʵрƒǬVĸƑŎ@ƆϯÑóŽķ@ʇ»ķ¦έmlÈĸĊX¼WźÛÞÝѸ‚ĢČþ„ĀĊôάVö¼ĊUƨ°°èŎČUÜƐóôVôôŽ²êȘlˌç°`n²ǬŽĊaš™ƒÛ°±kğmm»š@°ÝɆÛÅÇVaݍVm͔ğôÝÈb‚„@„ƒ™n¯š™ÜUĢÑĊ@źīżWŤÈǖWôŁÆI²ÓƨL@ŽĊX„mmÑÆ»ȰÑkƒĶō@ý°m—¯'], + 'encodeOffsets': [[ + 92656, + 48460 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6531', + 'properties': { + 'name': '喀什地区', + 'cp': [ + 77.168, + 37.8534 + ], + 'childNum': 13 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': [ + '@@Č@°ƒĠ„ôÓô@Ŏĉ@Ƴĸ@Ť£ĢlVôWVóřXĉŤêÞ@ƐÒĢÑlèÈV@šĠIk°ÆŘ@ÈÈĀ@ǶťÒğ@š„@ÒĉlŻ_@šƧĖÅĬōÆ@bźÞnƒƒlVœÝĬšWƼʇ„ƒÝÅ@ÇÅÈwWóĉ±ğz‚ĬČƨƂÝIĉݯbÇÑĉƒ¯ʈV°xUŰĊ¤ƪ_ôÓɚI@lȚXȮ™ŎlɴȘ՘š„¦ɲÆʈ_ɴŽźŽôÞʊŎĠƒɆxˤ£ɄÑVwXƳ¯w›ɛŹ٧™çƧ¦ōƒُ͇еϻɃɳU™Ý¯@ōÝŹš™@݄»mğ™»ÝKkŁżřɅƅƒ¯ÆīĊ»ôVôĕÅUĉéV¹ƨém™anѱĕnwmwnÇۄyĉ¹ŹlŏkĵèķmōÞġKñÔċKÅèĉzƒŽ„ômxȗÿƿI@þÅČÝKÝ°@¼ÈVºš@ÅĢšÆUċłn„ÝÆǕČĵJm£ÝJ¦@ĊƒxV°ƏLċ¼ǩ™@™m@ÅĢómÇÆğ¹Çš™ÆšĖÞKšx„wô¦ÆÑÆL²ÆƾŽU„Ž±ŚÅŻĖ@ĬŤÈñ„@ǔÇx„Èǃ', + '@@VÇ™ţ°ğUĠ¯mk¯ó¥ķIġÿƏbƒ„ĉa±ÒĸĀlKU„_m»nwšŽ„m@ÈŤ¦ĉbÞ°±Þżł̦°ĢŁVé' + ], + 'encodeOffsets': [ + [ + 76624, + 39196 + ], + [ + 81507, + 40877 + ] + ] + } + }, + { + 'type': 'Feature', + 'id': '6542', + 'properties': { + 'name': '塔城地区', + 'cp': [ + 86.6272, + 45.8514 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': [ + '@@ήnĸ¥ʈ¼ĸ@ôϰÒ@ƅƒōUķƑǫʶпU֛܃LګK@΋ĸ@Æ£ÞġÅĠċšLV݄»™@Å»Ýnm¯š»nŻĊ@nķŃ@¯ómóÛÝǟ¯aÝóȭ¥ƒšōUmxĉbÇї@›bUº¯X¯ÆƧbVÒĉnǕw¯°ƑŽV„—ŽÇ@kx±Uƒšɱn™ŽÅKƒ„¯ƒĠǠU°ɜL@°ƒxnĬ‚ĀŋŎÇLƒŽğšϱÞέƜkôÅĀǕłƒĸĊŤUŰĢ°„¦ȂϰÜɨ°x@°żǠÆƈČVĠ»ČL°ÇšbĊÑ̐óÞlĶwބɆVÞwǬxǪţȼÜLŐĶˢ@', + '@@óKĵĀV͈ĉłƾNJÆŤƒzXl°ƒÆL²¼źŽôÈĢǔ™¦l„ô°ɜÞʊĠğŃm»ʵƳƑʝȗīV¥¯ĉ°Ñ@ŃÅI™»ĉmğn™ƒašƒċƨbš™Vğ—w›ġ¯@Uōa™ĉÝJğÑÆŎkŎÞĀlźƒ¦' + ], + 'encodeOffsets': [ + [ + 87593, + 48184 + ], + [ + 86884, + 45760 + ] + ] + } + }, + { + 'type': 'Feature', + 'id': '6523', + 'properties': { + 'name': '昌吉回族自治州', + 'cp': [ + 89.6814, + 44.4507 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@መL@È°ĊȂɆƒÆĊ£„ťôWÓɆbĢÅŎƒÆ¦ČÑW¥°ķU¯ƏŃVē±Ý@ó—ç˜ĭɃƾřÆķkwŹƒŤ¹ġ¥ĵKŏÅXmˍщwǓ¤Ƒ@wóōVķ£ɱšġôÛa±Òȁ„óèţIVŽƽ¼k¤ó¹ġJmx—»ÝUƒ²™@ÅƃĸǫŎ„ĊmŎǬ՘'], + ['@@Þô°bÞǠôÜôn@°ĸń˜Ƕkłƒ¼UޙKğȂÆÝĢŤķ@@ΌڬL܄K@ˣȂ˭lĉńW¥ĵVÆý@ŃÞēUŃȗƅ@ŹƩǕĉ»k»Ç™VğóřX™ŻKƏŽċêȁèÛŎġƒͩń'] + ], + 'encodeOffsets': [ + [[ + 90113, + 46080 + ]], + [[ + 87638, + 44579 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': '6530', + 'properties': { + 'name': '克孜勒苏柯尔克孜自治州', + 'cp': [ + 74.6301, + 39.5233 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ˎǫĠƽ°UUĉ¯±ȁÑmƒ„¯Ýōˋō™wUű»ÅƑ°ƒȘ@²¯ɳʇ`ɱŃ¥՗™ɳȗōkȭšșW@kəJóÔƩ`ĉ£Vů¯wU°ʇĊ„ÈÒ°aĊÞÞJŁċƧīĠyĊ²XôÇxÈÆÆ@„ÞʈƒÅ»™XÞīU›Ƒkm„ŹÝ@aŎÅÆīƨĕ@™ż`Ċk@љƒĠ@ŦÑ@ǵÇÿ@ÇÅŗl¯ğJ@™ÇUkçġÒƏÑÝ@ţéWĊôŚUŽóXUġkţ¤ķ@@ƴōĊó@óÔğƒ¯„ċ@@Қ¤kôˣŰ͓„k»ƒKX¯ċwƧôğɐšÒôIVƙš¯UķǬķšnŽ™¼ôb°ÒȰVVÈÞ°ƒĸó¤V¼°„V°²êƒlĢ҂Uƨ¦ôȰƴĊVV¼ǖIċĊ„ÞɜéšnČW˸Ǹša„řÈw±īšçĸ¤ĊšôšwšŽĸUĢ¦˜éǖĬ„Āô¼lÞkÒ°x°ƆÞx„šÆV²ǔ»„b°wގȘ¥°n„šŎV@°„„ʠè‚ŰȂb'], + 'encodeOffsets': [[ + 80269, + 42396 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6521', + 'properties': { + 'name': '吐鲁番地区', + 'cp': [ + 89.6375, + 42.4127 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ôK„ĉǪa²¼lÜô@ʠê°Ĭ™ôȂƒ²ÑÜbĢóɲ™ĸ¤ŎUô@xƒŽǔ£ъxˎmƒÈÛ@‚_nĕÞōšř„ǫƒğšůlȯ„¯ĸ»U»Ükôƛ°ůkť™»Ŏŗ@¯@±͓óͿ„Ǔ@ķȁ¼Ϳ@Ƒ¼¯°ólġ¯xȗUġšƑ™ǩÒƧUÝ°˹Kóššx@ǸōĬÅĬƑĠ󃄚ǔêÆ°XÒʟŤUšÇ¼ˋnn¼±V²°ȂUŌݜbʟǔɅô@żǬaҎÈ'], + 'encodeOffsets': [[ + 90248, + 44371 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6540', + 'properties': { + 'name': '伊犁哈萨克自治州', + 'cp': [ + 82.5513, + 43.5498 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@ĉ„ÆŘȁ̐mÞ¯ĀX°±¼@ƾ¯ƴ°ŎÝþŋ¦WÜÞbȂĉźUœÇmwVUȂóô@ȰÝ΀nÆJn™ƾ™ʠ™ŌLČóǪ¯œ¥ǔaǖšŌaôÝĢLšx„ƒÆLšɲm„™²VlwÈ@˜Uƒƒ°¯ǖxĊmUÑƨa°Å°WV¹œa›ÇɃÈm¥°¯ŹóĸķǫUm»Å¼ÇVɱ™l݃ŋnķÇÝX¯ƒͩÇɳa——Ý`±_U±ĵnWƒ™a@™ĸóšķ™¯ǓV±ÅĵJċ¹ɅykwDŽ¯£Åxʟ»ƒlķI¯ƒX¯ķ‚™êǕƒȭnķ»Ź`±„kÞ@Žš„Ýô@Þ°xšŤŎIƨÆUxōš¯²ǔĬǬlUŚ'], + ['@@ÞĀlźƒ¦¯ĸŤKޙšƒċƨbš™Vğ—w›ġ¯@ţƽJ'] + ], + 'encodeOffsets': [ + [[ + 82722, + 44337 + ]], + [[ + 86817, + 45456 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': '6527', + 'properties': { + 'name': '博尔塔拉蒙古自治州', + 'cp': [ + 81.8481, + 44.6979 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ήƛϲÝĠ™„ÈKŌōÿmī„w@¯ɛKV¯ğǟ°Ƒ™wġKóÞŋbǕ™Ǔb›¦ǩ°ċôŋKʟšƽšmšÅImŽͿŽȯÞó@ȁôUVnx›ÈŹVȁĊÝabŻ£¯°l„óxȂŤĸkĊšÞyĊêĊmĢxV„ƨÈŽĠX„ŽΘÆĠÔź‚Ɇţ°LXƾŤŤb'], + 'encodeOffsets': [[ + 84555, + 46311 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6501', + 'properties': { + 'name': '乌鲁木齐市', + 'cp': [ + 87.9236, + 43.5883 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@šŽWŽôŚUĠȚl¼Ċ¼ƪǖ@źȘƆ@ýlܚXVŘޙš¦V¼kĖó҃èkĊȁˮ֜@ǫ՗nōƒĉǬō„ķÆŚ@„±ÞV˜¼nwĢIôºl£ƾ»UŤJôçšó¯īʟéó@kÛ±»ǩbƒĊóLҍÇǫb@ŻɆóʠǓ›aŋÞȁVʉłĉbĉɅô'], + 'encodeOffsets': [[ + 88887, + 44146 + ]] + } + }, + { + 'type': 'Feature', + 'id': '6502', + 'properties': { + 'name': '克拉玛依市', + 'cp': [ + 85.2869, + 45.5054 + ], + 'childNum': 2 + }, + 'geometry': { + 'type': 'MultiPolygon', + 'coordinates': [ + ['@@ɜÞʊĊýVaŃm»ʵƳƑʝȗīV¥¯ĉ°Ñ@ŃÅI™»ĉmğn™ƒaݚţL°ķóKĵĀV͈ĉłƾNJÆŤƒzXl°ƒÆL²¼źŽôÈĢǔ™¦l„ô°'], + ['@@ƾIŤ@UUwōa™ĉÝJğÑÆŎkŎ'] + ], + 'encodeOffsets': [ + [[ + 87424, + 47245 + ]], + [[ + 86817, + 45456 + ]] + ] + } + }, + { + 'type': 'Feature', + 'id': '659002', + 'properties': { + 'name': '阿拉尔市', + 'cp': [ + 81.2769, + 40.6549 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nIÇŃÛÝĊÑĠƏō™гwȁ¥Ƨ°ŹÑķV™¼ÞêĊ»‚lĵšm¦ÅW@ĀôÈźaɜxÈbÞÆĶIОŘ'], + 'encodeOffsets': [[ + 83824, + 41929 + ]] + } + }, + { + 'type': 'Feature', + 'id': '659003', + 'properties': { + 'name': '图木舒克市', + 'cp': [ + 79.1345, + 39.8749 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@VéVÇ™ţ°ğUĠ¯mk¯ó¥ķIġÿƏbƒ„ĉa±ÒĸĀlKU„_m»nwšŽ„m@ÈŤ¦ĉbÞ°±Þżł̦°ĢŁ'], + 'encodeOffsets': [[ + 81496, + 40962 + ]] + } + }, + { + 'type': 'Feature', + 'id': '659004', + 'properties': { + 'name': '五家渠市', + 'cp': [ + 87.5391, + 44.3024 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„çôÑlĕU»™¥ÝšUŗ™WkÛ@þVńÝĔ@ńÅþĶUX¦Æƒ'], + 'encodeOffsets': [[ + 89674, + 45636 + ]] + } + }, + { + 'type': 'Feature', + 'id': '659001', + 'properties': { + 'name': '石河子市', + 'cp': [ + 86.0229, + 44.2914 + ], + 'childNum': 1 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lŁ—ǵm‚ĉ@mż™¼n°ÞmƼš@'], + 'encodeOffsets': [[ + 88178, + 45529 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/xi_zang_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '5424', + 'properties': { + 'name': '那曲地区', + 'cp': [ + 88.1982, + 33.3215 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ƨʔĸbܺÞwnxźbÞ°ô@„ĶŽĸIȼĊJŎÈôUšÝƒ¤ǔLސŎ@ĢŽȘblƒôL„ÇźçȤôLš¥ÞIÞ¯Ķxʊťƨ™ƿÑĉXVķŦ¯ȂKÇǕšÑ¯IUš£¯Óƿ£VĕōÞÿÆwƒƑ„£ǖxÞĕ±ÇÝaUÑȃU¯‚UōÈ݃wWŁĵ™±Ý„óĢÿ°IÞ±mÅĢ¯mÿ„¥°UnÑŤĢĕĶwǬŻͪwŎ¼źÇĢ„ĠĕˎŁ°óƨ¼Èa‚m@¥°wǔ„ǖ°ŽƨÇŤœšġƨ„ŎŃôbÈÛŎĊ°@Ġw²ÑÞJƃÆb²ƒ°êĊUނlȲƒV„ÈKĊÒĸĉ›»ÅôťUÅǃk¯@ǂÑklǁÅl™Ģ™VÑóƒ@°@„ÛĸƒV¯ƒÇĊ™n¯Uĕšƽ¯m›¯b™È@Ò°Ĭƒbĵ›¼„‚kxķýÇJk£ÝaUÑÅóĶǟkÓʉnĉƒÝ¼Ƒ„ó»Þmn£m™Č¯@ƒȮÿV¯ĸƒ™k@Ýówƒ»ğ„ġ±ǓLō„ƒšV¼Əèķĉ™è±b@Òţ„UÑóakƒl£™Ó@¯L@™ÇlUóȁš¯aġÈÅĕÝLķ¯Ė¯@WĬ—x‚ÒÈnW°ţôU²ǓÓġ²V°¯ôƒǔÝL—ċšk™š»Ý»Ýš¯ÞƒVƒwۄÝÇōͩÈĉċ»ĉm¯£W¥ţKkóġƏW@¯±kōŽÈ›b@җšÇaƒÆ¯a™„ƒkóŽÛƒÇ¦Ýa¯šÝ™ĉ@ǻۄmƒǓxķƛ¯lVĀÅÞġb™™ÇJUÅV™ĖƑW™zō»ōšƒW™n@è¯ÞóVkwƩnkźÇބҙޯƒƒýğÇUxÆÈnè±bĉÝ»ÈуwšwÞ@m»ÈV@ýÇ°ķ™xƒa„ݯXċ¥ƒÈóW@ôkxlnxVÈóĊkŤġ¼@°¯ŰƑL̻۱ŎÝV—Þ›VƒÇÞŎÇakƞ‚š@èğŎĸżšƾ°ÒšLÞôĠKȰĖźVÈÒĠ„¤™VôšŽU„ÈþťL@ôǬÞlÜÈnÇÒUŚ™@šĊƨW°™°Xƒ‚@ČÇþ„ƴĉÒķ¦@ŽĢôWĀôłUÞĢǬ™ź°¼š@ƒôV°„bUÆnzm¤ƽĸƒÈ'], + 'encodeOffsets': [[ + 88133, + 36721 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5425', + 'properties': { + 'name': '阿里地区', + 'cp': [ + 82.3645, + 32.7667 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„Çƾķn£myVŃaU¯„ó™@¯»šŹġǫVÝóŁXÿġó@ĸ¥ĊуƳÈý@ċ„Wš¯X¯ĉƧ‚™š@VřÈÑÇmkÛǫÝ@óŦKÇýVƒ™U󚏃£ğÇÑŹUȯĕğLÝó™K¯Ñ™ƽķŻĠō@灙lƝÈbƍÈ݂„œU˜ÝÞU²ō̼ůƒK°ů@¯UK±—ĊƧbōÇmçÈġƒóšÅób™™źóš¥kīƯól™ç™KôĵUƒÅ„VŃķ¥nÅŏm¯¹Å‚™»@ÑǍóxÝkʇȤU¤ķb@ƒ¯ĊÇx¯ĸĉKm°šĀk¦l„„KnĬȀƾÛ¦WÆŐmNJĉ°ōUţ¤UšŎ°šŎKÞłÆ„Ǔ¦ƒÞ™‚™„ř¯bmUÝl¯Um™ğl¯£șwŎǫaÝnĉĶƒk@¯™K™šō»ĉn™aÞ»ťnkml™ĸ¥UŚŻkÑťƒĉV™ôó°LôīĠU„ÿĉǕÅz±Kƒ¤„²ō¤¯Ė¯UÝ¥Vĵ™óÈťÝwķșÑk¤ó„™ƒWýĵĕ™„VĠƒV󍃎Ǔ„ķ°k±VU±ţ¦UǟÝřJVљ¥XUċUŎlÛƆǕÆȗƆ¯wŏÞÅ@™šĉl݁óŽƒÒ™nUôńlxólÝôێ±™™LÛôÝL@‚ġ¯X¯ÇUżóa󤛼XÒġŎóLk¦‚ôżĸĠ™¼™KġƆô¦„ÆƑÔĉĶ¯ImÒ°¦n°¯Þl˜ÝČn„ƒÒšKĠޚĕkƒlýƾťœšôI‚ĖŤÒnƜm¼¯lnżóÞ@Ůó¦™ôƽĖċŚn°Ý°ôÈUƜƒblÞóŽ@Žǖô°UÈƆ°X„þôŽô‚lѢšŽ²Ėm¦°š@¤™XŽĊblܚzkºƒĖmX„šŎWVšóÞn°lĠxȚa°»żLźƒ„b@Æ°XĠÝȚxĊĕŤaȚ‚°È@„„@èŤ¦Ü¼œW˜ÞkŽÈ@V°lŤkŎ±²¦ƐUšlj°aÈÑŎbĢƒŎbÆ¥ÞIȘlššôVÈU‚™šb„kɲĶn„mnXb̼òƾĖŎ@ĢȂÑôÓĠĖʊšĊÔ'], + 'encodeOffsets': [[ + 88133, + 36721 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5423', + 'properties': { + 'name': '日喀则地区', + 'cp': [ + 86.2427, + 29.5093 + ], + 'childNum': 18 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ĶĖXþš„ôƒl£šÒĸÇÞxÇŦšôUĶÞ¦°V°ĕŎ£ƒ±„£²LÆyĊǖƒĀğVóĬ¯KóôUš‚ĊŦ„lҙżVÆķ¦kšlnŦmݼšbĊmŎ¼š™šL@°„lĊĵÞmǬbƍȚx°¤Ġknš°VÞkVn°aƒŚš‚š„Ýǔ¥ÅƒÝŁōL¯™ōV™Ť£ŎVĊ¯nljƏXÅÜ¥ǿƽmīƒLkƒl¥™ÿn¯ĊL°ķÈw°ĉ@ƑĸaV£ʈȣÞlôwȎ@Қ¼Æ°ºŐnmÆĸ¦UńƃV„óĶšLšèôkÅ°lĬ™¦Źôššôa™Æ„ôÇĢnèŎÈƨa˜ĉ²‚VLĢ»lţôĉUǂwkmlw@óôX„ÇȦ°WƒÞ„b‚wĸšÈ¯@þÇUn¼Ý@™x„xÇńÞ¼ĊŽ²amçÅÇVwĠȄþ°„šÝƒÑÈÝlŹƪmlxôU°Ý@çšm„XŎ™Ŏ¼šyƒXšĕÆUVÈIššĢaÆÝUÿ°kĸƜǔwn„܃ȼĊ@ޚ°™Þbȥ܄ô„lšƒ°b„ÅÈb˜™@ќa‚ǯUU¯Vġš»ƒ™¯aV¯Ç°Å™mnÑŤçǬVǬ™±ĉ¯¥Vĕ¯Ýk£˜ō—w@±ġÛ°ÇVїƒ@ۘa@ČL™Ƴ™„ƒÇa¯¤ÝIĵ¼U¥ƿōķÅţŻókÝóĕ‚¥¯™U»Æ£X¯ġŃÛkÝ°V°ó¼¯èWôÞĖ„ȎƒŽkĀƧĀówm¥¯JŹÝJݙōVVŁaݐƑ@ƒ˜ğŭǂ¯_ƒ˜ĵ—›VnxŃón›ƒĵxÇĖĉVÝÈğV™Ò󃯐±Żĉ£ķÆÅL™Ljĉý˜ţۃ¯VƒnV¤ÝÈ@°ÅÞݤ™ŰğŁm¦ÝxóKƒ¥ɱÈUĠôêVôÛ¼ÇWÝçĵaō¦óĖƧlÇĢƑŽnŎDŽV¼¼‚ºÛ@m¦ƽ„ĉmm¯ÝKÛç¯bŏłĬ™bƒ¼ÅLmŽ„xť°ÅU™šÝXkŽÝmĉ¦W„¯K„ÒknÝaV„Ýè¯KɅńÝKnÞ¯¼'], + 'encodeOffsets': [[ + 84117, + 30927 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5426', + 'properties': { + 'name': '林芝地区', + 'cp': [ + 95.4602, + 29.1138 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@‚VÈłVôÈk@š°K@ŽšÔk¤l„ôbVÒŤƒ@ѲašçĸĊƐçU»„™ŎƒǔKĢ²Ġƒ„¼ôx@ޚlƨĬ„Ul¯ÈLV‚šÞJ„°Ünʊ„wÜbXê‚VÞ¯°ššanaU°wƼɴÑWÑ°mÈýÈam¥Þ£Ť@„¥ôblÞĢ„ź¥ôxÈÅmݚ™ƒĕŃV»ĉōŤōnóƒ»ÈīķIUƒĠÑ°ġĸLÞ¯VÒƂ@Ābš¼WôÈ@V¼ôóŤKÈÑU»šwVǫżnWÒÈx™¼‚lŦ£ĊōŤx²¯@ƒÆƒU¯šçÆ@„¤°£„é°k°lšůÈó@¯ŤÇÈĉƒkkÿó¥ÝXķљÜ@ÒóŚÝ¯°ĉówÇ±¦ÅJUÒĉĀķw¯°mĖ¯„±akxÝÅnƒ™»lуK@¯lU™¯UVѯóĊ¯mōğVǓƅƒÞƒWÝÈÛ@ƿô¯ÜġzÅþ¯ólmôʇġĊÅUͿřŏȁˋŁóÇˡōƧƒÇb™w°Ķôk¦šÒƒnUþġҙÔkǔķèó@ƒ²@ŘōńĵyƒzġaݤÅIƒ¤Ƀť¦ğѯ¤ķbóš¯ó±ŽU²°¤ČÜVnÈƂ„ŚŎ°ôĢ„þÆzèVĀǎĀǘƒXŹÑ¯¤ówċķk¦šłUÒġzÇ@ƒ™ÆÝx@²Þ@Ƥ„Uô¦Uš°x„U'], + 'encodeOffsets': [[ + 94737, + 30809 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5421', + 'properties': { + 'name': '昌都地区', + 'cp': [ + 97.0203, + 30.7068 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@™ŽVĖm°ĉš„ÈU°ķ„ƒÜ¯@@ô„UÒġškš‚ÆkÈlŽÒ@Èl°È„VÆóŦƂœ¼‚a„ÅĢ™Ʉwnōw@¥Ŏ¦°ŹÞmVš°wnÿƒw„wÝw@¯šmÞŗ°wĠ˜ĸkÞğlĔ²¦°@„ĕĸwVóšal@nĢÇĊn°@¦šŽźUXçǔůĸVš™ÆK„ÈÝĠš²ÅĔô@lšŽÈ_m˜„zǖl„šaU¼ôwV°¯¦‚ĬÈa„l@Čǎ„¼™„nŽ˜I„xô»ɜ@ƨ¥ɆŁ„ŃǪȁkƛƨȍʊȡóĭ›@—ÈÇVƒůރĸƅmēƨť™ÅÈʉVǵ°ġVŭÅɧ°ÿnɛš£mƒķ²ŃóÑUĉ°mÇ»¯@mxUĀ¯èţ°ȁÝç„ġU¯ÆÇţÈ@°Çô™Ű¯k¯lƒê¯¤ƒ£Å@™èV°Å„@„±°ţwĉŎť¤kš»ÇwXÑŻmUǬ™xV¼ÇÒţLóôU»Ç@X󙻂a@ÿŁUÑÝ°ķK¯ĢğÒV„ĸJÇĬ„¼môţŎĊŎU¼Æ„„Ė™šnÞÇÆówŹ¦ġƒkÝóaƒ¦ţ@ݤn¦ÇbÇþ¯nXÒɳÒÅ»¯xVmb™b¯™Ý°UWéÛaƒxʉÛmƒ¯ÝI™‚UÇKk°ƒVƧīķ„U°ȭĀ@„ċ°nšm¤Ýnô¼ƒƒÞ»Ċ„ʊmlÔĵǠÆôVÒÞbl¤ÈIĸþlwƒœ»ĶŽ„a¯ī@њǰanœƾ°'], + 'encodeOffsets': [[ + 97302, + 31917 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5422', + 'properties': { + 'name': '山南地区', + 'cp': [ + 92.2083, + 28.3392 + ], + 'childNum': 12 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@°ÞUĖ°¦²ĊôÇÜLǖĀɜŽȘŰÞLĸźêÞ@UÜUŤ°ɞ¯Ü„°WŦĀmŎ„¦ĢyVљŁl¥Čĸôx°£źÒ„Wȗ‚ÿȍUÿ‚çÅyƒýóġō¯ƒřŁmÇÛUċŽ¯£V±²°ôô™ĸa°£ĠÒŦ¥ɄŽ„£ÆJÞ£Ģb„yĶzŎŃ@ŗ„±ô@ĸçlǓšÓĢÑVý„m™Ñl¥ĵó‚¯̻̥™ƛǫÝһÇƧĉyţ¼ҍēVĶĉŎ°ĸmšÞVÝĸ™ÒÛaċ„ó™ŹĖƒèÈÈl¼k¤ÝX@`ސŏ¼Æō¼ÇçĉKUÝÝ£ğ¤@¦ġl¯Òġĉ¯óš™móxÝÞğVšƴċK@—b@ܘ„UÒ¯ÈĢÜ@²˜x—Ŏl¤'], + 'encodeOffsets': [[ + 92363, + 29672 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5401', + 'properties': { + 'name': '拉萨市', + 'cp': [ + 91.1865, + 30.1465 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Ŏ²l@°‚XĢƐlôŤLX¦°¤ĊnČ¼ÇĊŎͪÞÈ܃„x„U°Ýޙ޼™¼lšČ™˜ŽÞK„Ǔ°óU¯Ģ±ǔÔV±ŤóX¯ÇmÑ˜wXī°@°ĕĸÞKÆĖĢÇ°bȂ™ÇŁUƒV¯wV™ó¥ƒVÅ£Ý@@±ÞwšÅ‚„È@ƒ¥nōťÿ¯Xۃɝ°ţ¯ÛVVÝ@ŹéķÝKȗůɛǕÿÛKóÈǫšǫUţèmҚn¯Æ°ÈU‚°b„š™¼UĢV°°V'], + 'encodeOffsets': [[ + 92059, + 30696 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/yun_nan_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '5308', + 'properties': { + 'name': '普洱市', + 'cp': [ + 100.7446, + 23.4229 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@U‚ô²‚a@Ž²²Ķ¥œV°šĶ²bl¤kVxl‚@œ°‚Ś²@˜„„y„@ô¦¯„@xƒxVxU„VššbVšÜm¼Ŏ„„ĢmºXXWÆ@ĀœšmŽmXU°ÅÒm¼Þx°w„@°‚XêĠ°»nV°U„l@k„@V±ôī@£‚ƒČŃÆ£„KÞý@¥‚k@y„a@—nWV„UVƒšwƒmƒ£Jƒknm@wmkn‚X„˜šX„¥mUUlUnbš¯°ŽnkƒVInlIUw°n™mk@@mlanXlanmšk@wVWUw™_@éĠašnmUaÜ£ƒmXƒ¥¯@@„óUmݯ¯ÞÝlKnxô£š»„»Ġ„J°aV„UÝÿV¥ÛbƒI@wmŽón¯yÛL@ƒWkŎmș`IWa¯K@¯mUnmaXm™bmak„¯ŽƒĢ™ÒÝm¯mV¯KÇb¯KۜWW™X@a™V™knċLUWV™kXóW@k™a@ƒób¯Uƒwmb¥UUlaU¥U£maķšƒKXkƒmÝ@kwmѯk±ċbUUVakaġ¦ƒƒkL@`ƒœ™a¯xƒm™Åƒ™LUWƒ@ċnŎUV°LkL@b°°@¤š²ƒ‚šnôôk„l°kè›ÒÈzV¤È„WôôƒnV@„ƒ¦@¼Ux'], + 'encodeOffsets': [[ + 101903, + 23637 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5325', + 'properties': { + 'name': '红河哈尼族彝族自治州', + 'cp': [ + 103.0408, + 23.6041 + ], + 'childNum': 13 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@°°nÞôV@ƒ°@„¦WŽ„nÛ¤Vbmn™ğb@êš`VxUX@xš„ƏÞUnn˜WÞĸĢƒšÈ@ŽÇè@zÛÜWšÅêlš²„˜KnV¯ĖĊx@bk@@„°JÆ£Èbl„nnm°nlUkVUUwVm„Kn„‚nVŽÞxVLX¥laX@@xl@VzȎVmšk@b°šÈĸmŽV¦`W„XšƒbUb‚bX¼°x@ašVVkn@lþnXUlVxŤÅ„y‚IUƒka‚IŎĊ@lXx@b„z@‚ô„ƒ¥„_V@l‚n@„ôy@al_l`nmƒÈ»@kƒmXwWK™U¯»™a™Å@wƒmUÝKUa™UUƒ™wWƒ@w²»@kƃV£—mm£VKkÑV@@»nwƒ¥™ƒ@kƙnllIVlnLVakalknJšWmnaUaVÑVVލn¥m@ƒ„¯Uÿl™@™™™VçƒaXaV¯UyVLVkš@nJlšXLlŽkxlbla²Òl@nVJVkšx„KlkUaVķÝÑU@Åm¯@±™Uó°ğńķĠmU™Ñ@ǯ¯Å¼@nml@°¯¯`@w™£@¯Çƒk@ƒ»nmċ¯U»™I™Ž¯LÇĶÛn@bó°™U›šwmŽ¯„™Umǯa„™ƒ™ƒI@ykIƒVUŽ¯bƒIğŽƒ¼™¼ó¤mwkLÝÞ'], + 'encodeOffsets': [[ + 104243, + 23429 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5326', + 'properties': { + 'name': '文山壮族苗族自治州', + 'cp': [ + 104.8865, + 23.5712 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@šwô„š@²¯maUmôUÆxš@Xš˜bÞInlVUVw„JVaU„K°¥„xmÞXnlKlnna°@ĊČ„ÆwUmnkl@°ƒƒ£nyn@VV@Vak™ƒ@@kÞ݄bmx°Vnw°klÞInĖÞVlKl™@Xa°„„KlV„U@šJnx‚U@ÈĢbUKlm@ak_‚wšanWUk°ƒl»„k@Wk@lwU_ƒ@UalóU¥ƒÇnƒ™kJWƒ@mVXx±bƒK@nV±a@™Åa™£ÝK²ƒWknamKknǏk¯ƒaV™™V¯ĀƒU™„™Ò¥ƒI@mm¯¯xōW@@`k@ó»ƒUU¯lm£ÅWlĵ„w@mmwÅmWU@y±U—xmwU„¯Uƒ¥Ý¥¯£m@kŽÇVUV°VbklƒL™wUlUIm‚k@±ÑkbkalwkWKk™mI™@UlUKVzU°Wb„bU蚚@škšVĀƒ°@„n‚m¦ÝŽUUUÒVbmbXn™‚mIkllbUbmKUkkJmkŚ@lš„„¦mx@¼U@lÒULn¤˜nU¤Å„@l±¼@xX„šxV„šVVbÞLVŽ„n@xšÆšb°¼šV'], + 'encodeOffsets': [[ + 106504, + 25037 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5303', + 'properties': { + 'name': '曲靖市', + 'cp': [ + 103.9417, + 25.7025 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ȦlKÞĕUV¯Um¯„ÇVUnVVUƒĉn™ĊÇƾLn°°È„JÆw„@lbÞa„¦V„XJ°¯W¯„aÞJVkUša„ƒ@lKnÅmWUk¯a¯»@m±@уkkbWWX_WÓU»_l™kÑm@U»m@l@IWċn¯l@VanV„UV™UVwVx„KȄVmUē‚@„ƒn@VÝÆL„w„VVwnVlmkUVÑÇ°ka@k™ÿÝaÞUl£™›—ċĕX±±ĉƒa@UnVnalónk@wl™UVmkÝJ—aW™™@ÅwóVVnnb±°™@óƒ™xXLWx„n@lǼn„m‚k_k`@bózƒ‚m@kU@ƒ`„¦óƒ@nWš@ÜÅXWw@ƒyƒb¦@ÒlnUb@x™lܐk‚@²Ç@Uƒ¯bmy@kV@bƒb„¦U`lLVx@b—Ll¼Þ¤@„°VVބU@WސUb›J@nnš@lnnm„šxUŽƒUUbƒK@šÇwklkUƒVWakn@ŽlbU@@„ULVxkKUn‚°¯Ò@¼™„kmƒ¦m@kl™Ȱ@lU„l¦„@Vl°wšnnþĊUÆbUx™b„ŽV„šĖU°„a‚nnašV„al@@b'], + 'encodeOffsets': [[ + 106099, + 27653 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5323', + 'properties': { + 'name': '楚雄彝族自治州', + 'cp': [ + 101.6016, + 25.3619 + ], + 'childNum': 10 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@mҁXU`Wnšš™@Xl±¦š„Uxnbl°knmKUx„„ƒxVôUx°¼ôÒȄ°JlnÞKĠœW°¦ƒ„Vx²JVwš_°¥@UV@@wnymknK¯I@‚™²b°ƒš£V¥šwU‚V„¤nLškÆJÈwôô°„l»Č¯ƒġVƒUU@@ƒ°ƒƒÝXl@U»°Å„@U„¯@w±¯VmUUlm@m™„ÑnIVyUwmak£Vwm±—@Çw@nƒ@UxkwlÇnL‚mkř@±Žk™ka@kóJV¯Ç»U£lw¯™Xalbl¥¯UXƒ@a˜™UaÈL@ÇVIVƒkaU¯mm™akLWkUJ¯Umxnšƒ@ƒkUx¯xƒ„mWÅīÝkkbƒŤƒbkxWmXwWk¯wƒKkƒƒLŤċń„@¤óĬU²ƒ@@lƒk¯VmU¯¼@xV@k°l°kbUš°nm‚VnUš@°„š„UVèރÆbUÒÞnU¦›V—¼lô„@Vl'], + 'encodeOffsets': [[ + 103433, + 26196 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5329', + 'properties': { + 'name': '大理白族自治州', + 'cp': [ + 99.9536, + 25.6805 + ], + 'childNum': 12 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lbœKVIUa˜@²m@b™xôÒÜxXLmbnšl@š„„K°šš¼k„Uô‚xôlV¦nJ„Uš™Ænšm„@šx„ÆwšbXšÆôô„LUVwôK@wlmšaVwœ@WknmƒIUmlnJla@_™@kÝmKUašÑm¯Xw°aUaVl»²JV„bÆJkôĶĀ²VVk„mšbVwUó„wƒƒVwnLlmk¯maVw™ƒ²¥Wkš@™™XmV_‚WnÑUkƒ@k󘻜UV¥ÝmVÑÅa݄UçƒVƒ™@¯V™Umn¯mV™lak¯l¯U@@wğŽW鯁ƒ@¯xÝw¯š¯Jċa¯U¥mLU¤„bÞȤƒbÇLWUwmIUVW¼kbš`U„Vb¯L±ĊÛkƒÿÝKkwƒKţê™UĉþƒÈƒV¯ÞVbUŽ°KVšk²Ý‚mI—ƒmV@kƒm™UkšVxm„¯KXÈķJU¦V°ULWxšL@môƒšb@bkx±LnVUŽVLnkÜWnwlLŃmW@kkJU_ƒV„šWĊ„Þ'], + 'encodeOffsets': [[ + 101408, + 26770 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5309', + 'properties': { + 'name': '临沧市', + 'cp': [ + 99.613, + 24.0546 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@‚xĢ„l`²X°ŽV„šx@x°Þ°KXašğUњW‚bnIl`X²°b„xl°„„šV@xVxk¦mb„l@xšXV‚ÆzX¤™Æ˜k°„kx@lźêlaX»VUnJVx‚XÈK„aÝȣƒaV£nKV¦°‚Čb°I°™n»ÆÑV¯nWn›™@ÿXÅWWn¹ƒġōƒn»‚ÛU™™aU™VƒUw„w@w°ƒó¥ƒ@ƒz—ƒ±@ř›¯@kUwlk£±aĵŽ¯™›Uĵ¦±±@bó±VÝ@ó¤ƒw¯I@mńóm±XŽ¯IólƒK@š°Ullb™zkKlln@@ԙºƒUmVk²ôҙx™ŎUVóLƒb„ŽmÈnŽmbnl‚a„x@z„@Ǝ„¦kš'], + 'encodeOffsets': [[ + 101251, + 24734 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5334', + 'properties': { + 'name': '迪庆藏族自治州', + 'cp': [ + 99.4592, + 27.9327 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@W™Xwƒ™@akk@y›—k°īX¥›Uóķ¯w@n»UaVaUۃ¯ƒmV¼k‚™Þċô@n¯xÛÒm„V‚¯Ô@xƒ‚@šk™wm™Åa@ƒUa‚݁¯VŃyV„a@ÿšn»ÝVmank™mmÞÅôƒ@n£±›ğzÇmU¦™Vm„nÜmbn@°nV@xmzÅ@mºV¦k°ln¤š¼õô„n@xkƃIUxUš@Ťƒ¦VšmVkmkXW¤XzVx@ƚx™¼ƒÞ¯b@lVš™ĸގV„m¼XŽm¦V„ŽÞ@Ǝš¹Vón¥ÆKn„‚KX¯x@èĊȱłXšaÆxnlV@UÛlȻkğV¥„m²ljmÅÞĕƒƛm°„ÆmX¤mznƃŽV¦ÞVVb°bnÞWbnŽ°l@V„È@„‚VĵĊ±@ó„InxÆw„¥@£Þ›W¯ĸ£UƒUK‚ƒk±akkkbmWmÈķ„aÆÇU—ȃÆW@wmknmU¯'], + 'encodeOffsets': [[ + 102702, + 28401 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5306', + 'properties': { + 'name': '昭通市', + 'cp': [ + 104.0955, + 27.6031 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@mƒnK@wmƒUř¥mšóXǓŏmX@Ž—VƒmL@xţ™nk@mlUšŻÒğŋ@ƒL@mmLkm™š@b™XŎW¼ka¯lÇŹ¯aÇ»™ÝÝ_@m„@@a™@UklwUm@ak@ƒb™UmbmƒbV¯™ĕUƒƒšaVwÅaĉVmý™m¯xUkƒ@k¥VƒUXƒ¤VÈm`@„—ńÇÜ@Ākn‚ĔkƞÆĠ„™Þš‚U„VôƆÞI@ŽUxƦn„l@ĊĊnxUÒ°¦Vb¯WUnWŽIml@xn„Ubô¤‚¼ÈxlI„»šKVš„@ÈԂJkšUĖ±ÆVb@nœ„VÜVUVƒšL„wĠl„kn„Ġ@nx°¥Æ„²mUwƒ@m™mÅUl¯UњÑUm„Lll„Il±š@VkwƒW@w°@U»™kUóI°ƒ„»ĢтL„™š`nUĠ²lm„bôV@n„JUxƦX¦l@š‚ŎUƒV„@lV„KVřV£UaÞU™ƒnW@¯VU@ó™'], + 'encodeOffsets': [[ + 107787, + 28244 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5301', + 'properties': { + 'name': '昆明市', + 'cp': [ + 102.9199, + 25.4663 + ], + 'childNum': 11 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@n@Vk‚VUn²°@xƒ°Vƒ@¯ÆV¼k@WŽ„Þ¯„@„@‚VVU„„Ģċ°k¼V„Ċxœ¤Ōœx°mVkƒÑȏšL‚°„x°Xœ°VmĊLVxUĖ°bX¦VW@kšȯlkn@„¥lnšƒ@»°Ñ¯VmlLUwVK@ƒV@ka@lmXb„UlVlkÈx@™„LVa„VV™wnƒmm@km™@mœIVaݏ@XƒVUݯU@ƒÝ£k»˜K@aUwkKV_ƒ¥„a@alU@nz°aV„È@@±lÛšk@wVakm@т¥„a„z‚@XxÆW@ÛX™@m@ƒy@aWw@kōĉJlbV„JƒzţÆUwVkmWkým@Ul™U@b¯wVºƒU™VUêšĠƒXUaUbVĊUŽWXUmkK™™WnUUU™V™ƒƒVV™Ý@kk±‚™¯ƒƒLkƒš±WkXlVklƒ@ƒwXbmLƒ›VUIVmk@Ubma@kkaVKUƒ™kmlXLWn™J¯ÒĊ°@zkºlLUŤn@@n›ô@lƁnmKkÈlxVw„@@mÈx˜@n²Uxl¤nbVxUzmJƒÒnš'], + 'encodeOffsets': [[ + 104828, + 25999 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5307', + 'properties': { + 'name': '丽江市', + 'cp': [ + 100.448, + 26.955 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@l@™„@w°ÓUnƒÜÑ°w@mČóšÝlU»n°„„VÜUbVbm¼@Ž°xôĸœVW¦¯Ĭlœ˜@zll@b„šWxXš‚a„X@ÆĠÆaXwl@XaƦn¼˜Jn@mnKW¯È»V¯°ak™VanXVwl@VyUĕVU„bÈīlaUk°ƒk¯lƒ²V˜Ukƛô@ƒ„I@mVwĊa„™ƒVaka„™ÆbUŽVLšaXIWKUw™ƒ„aWÑÅKUaVk°ƒ@Uw„ƒ¯¥›XğÝLkm¯Iǃóѯ»™aƒnUl±UĵÿlóÅIƒaU‚±Ik¼UŽVb¯bWxn°™ÒVbnLlޚ@@`kbmIkŽVn„JmnXl›@Ux™bkn@xóLUxVŽƒKóóŐW™™aÅxƒŽ™wƒ@™nÅm™šƒV™„ƒôX„ƒLlVU¤ƒb¦m¼™Ž@ĀƒbU‚„zUƂ°ÞVb@„Æbnššx'], + 'encodeOffsets': [[ + 101937, + 28227 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5328', + 'properties': { + 'name': '西双版纳傣族自治州', + 'cp': [ + 100.8984, + 21.8628 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@l²°ŽnÒlxÞ@„nWl„Lĸ™nbV¤V¦kbVV‚¦na„x°Vôa@„šb@lôXlWUšVXČKlmššU@bšWXXܛ°LÈa°LnU°‚ÞnšÑ„ġ°lƒnbšaƒ¯¯KWƒœó@kmK@UšĉV@k°„VV¹„a@y‚_ċl_nÓlL@anI@ƒóWl£VU—ƒl™kĕl™šKVw„U@™kVƒam¯ÅL@bƒ‚Ýk@Vn„UbÇbÝwÅ@ċ¥¯lk‚¼ÅŽ™Ò°b@¦nlUn@ŽÇV„mƁbWôU@ÝÅōm™¯ƒaU™™mk™WWw—@±ƒ™n¯U™è™a™Lƒ¯mƒL™škwƒl@°mnÈÒ¯šów@V™xƒĀU¤°Įƒ°Xl'], + 'encodeOffsets': [[ + 102376, + 22579 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5305', + 'properties': { + 'name': '保山市', + 'cp': [ + 99.0637, + 24.9884 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@X°„Il‚@¦ƒŽÈ¼m¼ÞaÞÅl„ÈxV¼šlVôÈÆlLޣȺlkUƒ‚ƒUw„¯UĕVwĊ@n¦mlnVĸIWÇ°LnƒUwl™šV„n@lnU˜„nJށl±U™¯LVUa°Ý„U„ÇĊýšVŤé„LlxÞL„ĀÜl²ĉ°KUaVƒ™_Źé@klw¯ƒlÅ—šW£ÅyU™W@wƒknal¥Uw@w™Uƒƒk¯ƒw¯aW±k_mJa™XVҙĠWb¯L¯Ý@w™wUƒ¯±Wk_ġƒwƒwōKmb@¤„bk°lĖƒô„UJƒšVnÅlťUš¯°VbnbWxX„m„ÞššWUĀ™L™yWzÛKmbUxVKkn݃kŽVšĀċ¤Ux„@Ž¯Žm@ƒ¦'], + 'encodeOffsets': [[ + 100440, + 25943 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5304', + 'properties': { + 'name': '玉溪市', + 'cp': [ + 101.9312, + 23.8898 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@l„„L°xXlWxXnlw„a„ţlaÞlÆĬnX„ƒ°wVw„l„@m™nw°VVIXllKšbnnV°lbU„UJ@ÈÇKVb—š@bW„°Vk¦kaWb°škxV¤È¼U°ôI@llblš²š@‚@œó@mm@VţkKl¹@yĉ¯°ÑšIXmWKnkšlV„ULlb@lnbVal@UnVJœU‚„nKWa„x„@lkkUlW²X„™‚l„K°„šl²@lšÞUŽ„U‚„UšVšVVXmššlLVnXWVUĉVaVb„W™ğVéšU„VU¹W»aVa„aW™Xƒ‚_U¥nÇķ¯™@a™lUnǍUyk@@wW@kbW¦UKÝwUmmƒƒLUnVxUVVlk¯mmnƒmkÇaŤ¯I@ƒl@@aĉw°ĕmU—L±ƒk™ÆéX™ÜÛ@yÈç@™Çġ„Ýķ—XmmÝVՙƒ™lmnkbmWkb@nl@nŽmš¯VxkJmUJ„ml¯™°makVVnVƒ¦™Wƒ—Wmnl@xmn„l‚I„¤„n™xU„ƒVUŽmX@˜ƒb@zl@¦Ýþ'], + 'encodeOffsets': [[ + 103703, + 24874 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5333', + 'properties': { + 'name': '怒江傈僳族自治州', + 'cp': [ + 99.1516, + 26.5594 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@WyX£lWlnnUU™„¥@ţV™Vw„JlÅ@wƒmö󙻂£kml¯U¥n¹Æ@ny@wmU@¯mnamÛnƒšUV¥ÈnĠy²œm¤„@ÆónݚnmlnbÞU‚¥„aV£kU„KWƒ„óšƒmIU¥ókwVólƒ™»¯™ƒL™ƒk@m™naWKÛwóњw@a±n—@VbUJ›LkaƒÝXĉƒ™„UV`lI@lnXÆƑkKmxÛXmlUKVmU²Klw@a™aó„@n™KXwVKU¯V¥mUnkm¥ĉ@UxVĖƒ°Vx„V„klmޙkKWĀkVWšnl°Lnm@°ŽUxlV@nk¦™JVÈ°ŽVÒ@nX°@ÆlUômlnôƒ²nxmłnVV„¯x@Èm°XblVUšl°@xkXU¤WXX‚W„Xƃ„mkÅJmށw±bƒxUīkKmÅVUĖÝèV„kx@š›lX„lnk¤ƒLkŽ‚Ėk¦‚xUššL°‚¯Ė@LnK@b°xVI„¥Ua°Ñ@»nm@¹‚KŎÞÈWln²n'], + 'encodeOffsets': [[ + 101071, + 28891 + ]] + } + }, + { + 'type': 'Feature', + 'id': '5331', + 'properties': { + 'name': '德宏傣族景颇族自治州', + 'cp': [ + 98.1299, + 24.5874 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„¥n@°@ƒVwČ£™ÿUlÞ„lmULVwnaÜLXyšzšKVÿ™XݙnƒWƒXwmaUa°¯V™ŦŽÆkUm„™VIƒ„ókĕl¯ƒa@£nama™@¯m¯œó@óyţbġkÅm±ÛammVkƒLwU`Wk@VƒkUmŃlUUKmbkkUVUwƒ¦óŽ°¼šbn°ô¦lºƒz@xšŽ¯„™@UŽ°nƒšU¤ţU„°VƆ@ÈmlnzÞl°¦Æa„xUxƒLkxWƒn@‚š²ŰšW„™‚@°ÈXl°Llx'], + 'encodeOffsets': [[ + 100440, + 25943 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/util/mapData/geoJson/zhe_jiang_geo', [], function () { + return { + 'type': 'FeatureCollection', + 'features': [ + { + 'type': 'Feature', + 'id': '3311', + 'properties': { + 'name': '丽水市', + 'cp': [ + 119.5642, + 28.1854 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@V‚bVl@Xn‚UXƒKVŽ@¦nxlUXV‚n„KVmnL‚UV@bn¤lLXK˜²„`nnlJXIVJ‚I„Vnn°KnnVll@VLXWV@UkVaVK„zV@„ƒšVVaUK@U»VUl@@WnUUƒ@wVLn@Vwl@XW°LVbn@VU‚@X„l`@XnKVbkl@XVJlUnlV„„xlL@lnXl„@VšUnV°°„@a„UVLXblWVXn@VVUV@Lš¤VLV„U‚VbnalLUUVX_laVa„WVzXKV@@a@KUmImmXama@kU@yVIUK‚aVa@kXK@aWU@VIUmW@kkVm„Uš@VwUa@K@k@Uƒ`@kUKVk@UV@VaUm²Vy@klUUWUkVmUa@_ƒKVaXa›XmƒU@mUlWkaUXƒ@mmkL@w™JƒnVVÅbWKXa™@@I@aƒJUUÇ@V„UL™W@akLmb@K@a™XXw@mƒVmUVkUy@£@aU@@VkUWm@kUKƒXUWU_mW@wkkmJUUkLWWUXƒW@IkJ@k@mW_kӃ_Ul™Lƒm@I@aUa¯m@kƒa¯LUJƒ@mVVxUb™a@LUKkXƒbm@Uak@@a@Um`ƒIUbUJ@nUVW@@LnVV@lšUbVlUX@`š@blXklW„Ušm„Xlm¦U@@V¯bml@š@nUb@llnn@VbX@lV@ŽUVULmU@JVn„bVbkb™VWxU@@nUVk@'], + 'encodeOffsets': [[ + 121546, + 28992 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3301', + 'properties': { + 'name': '杭州市', + 'cp': [ + 119.5313, + 29.8773 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@X@l„°KXXlW„b@²„`šššb‚I„šX`l@„@bWl@n@VnLUV@V„@°¦@šl@XVlU@š@xVbUb@Vkb@‚@XVJVz™J@Lޚ@VmLUxUJ@LU„Vx‚b„xXUl@VaÈw„b‚aÞa@Vl@XUVx@V@V„LlbnV„al@lb„Vnn‚LnKnL@VlbVJXalIšb@KUU@mVInJ˜„U„Vl@xUšVLnUš@UÞaV@lkV@UanK„L@UlKVUnbÆmn@@nUlVnVJl@@UXU„L@WVIVJVxVLXV@IÜKnbn@V¥V@@I@ƒƒ„y°b@UUwnk°ÆƨVlUšçXm›£aƒÇ™IkVƒ@WV@@aWIUWUIkb@WW@UnƒK@UU@kaWVkƒVIVVnU@UWVUV@VmVkKkWIkVWaULU`UImJUImm—U@ƒƒwmwUV™IUWVkUamaU@mV—kƒb@KVU@aVU@anKULVJ‚U@kÛU™JUV›kkƒVakU@ƒaVwkW@UWkXmWaULUaUK@XƒJUUmƒVU@UVƒUkJ@ImwmKU@k„@lU„W@@akKm„kamIkWl_UwVm@UkaVUUaƒ@UamakbWlkL@aUalU@mkL@U@U™lmK@XkKm@Ýakb@xƒnXbƒ`ƒnUUU@›™U@™wU@@ƒmKkkƒV¯U@lULUbVbUb@V‚a@L™ºÝb@bLmK™x@VUL@bk@mxULWl'], + 'encodeOffsets': [[ + 121185, + 30184 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3303', + 'properties': { + 'name': '温州市', + 'cp': [ + 120.498, + 27.8119 + ], + 'childNum': 9 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@ll@xnXV`VX„WVL@lXnlV@UV@@b@¤VzUlnV„U@nWxšW@b@LnalK@bšXVKUƒÈ@VV„I@b@Jš@WbXLÆaUU„mšI@xlKnn„@VWlbkXV‚@n„VWnœ‚WbUb„L@`VbUnVlVXkV@lUz±‚VnUbU@@VUlVL@l„_@V@l@LVbV@XLV`VÈlxn@lU@aœaVV‚k„@XJ@nl@@LU`°LVb„L°a@a„UVy@anI@a„a‚nV@²wÜJX@VšVV°k„na@WVk„aWwU@m@™ƒkƒaUĕ™ÝšÝŤnÈa„aóI›»@±X™WkUķ@kV±kw™ƒUkWw„™UƒÝ»ÛkɳlImaUaWóXÿǬk‚UnWVmmk™KţnŏÞğl™„UlUx@XWb„V@JkXƒ°mb@VULVxUVk@@LWWk@WIkšƒUkJmUkVmI@yƒ@Ua™kLm‚U@mUUUkaVk™@mK@UlUU@UmKmbUUUJ@n@KVLUL@VkJWXX`mnULWlkL@JVLVb@°kxkU@LVŽ™V@„VLV`UL@VUX'], + 'encodeOffsets': [[ + 122502, + 28334 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3302', + 'properties': { + 'name': '宁波市', + 'cp': [ + 121.5967, + 29.6466 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@Ċ¦ĸĀ°‚nXÞVšKškƨƑźÿ°»n„@wô¥ÜbœU°ÆXÞWóçĉݱIUƒÈ¥@U°wÆ»²mm_@aXƒVKÞVlk@akk›̅@£X»VwƏXWa¯aȗb™KƽۃĊ™xƒLóŽk@ƒƒƒ@¯nƒKUL@xkL›ÑkWULUUmJUXVŽU@mŽUX¯@V`mbXbV@@nn¤WXšx@škJ@nVVUVl²UbÝVUVk@Wx@V@„ƒVXzmlaƒL@VlLU`„XUVVVUnl@VbnJlnUVVnƒlUKkbmnn„VxlJnxmbU@UL@KUV™X@xmb@lk@mnVVUš™è'], + 'encodeOffsets': [[ + 123784, + 30977 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3309', + 'properties': { + 'name': '舟山市', + 'cp': [ + 122.2559, + 30.2234 + ], + 'childNum': 3 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@l΢ƒʠþÆVĢLĊƒǬXĊ܄XôV„ÑÆw„ƒlšƏÈóVĭVǓ@ƒĉwɛkmK@ĉXīWaĉUĵÝmƒ¯ĉƒwĉ±±nż¯x@VǦV„²JĊÞôèÝXÅW¯›VÛaó¦@xƒŽmŽ¯¼ŹĀ'], + 'encodeOffsets': [[ + 124437, + 30983 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3310', + 'properties': { + 'name': '台州市', + 'cp': [ + 121.1353, + 28.6688 + ], + 'childNum': 7 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@lV„IVWVz@bXJl@Xal@°„nLll@nVxnV„K@UJVbƒ¦°„k`UIWJXnƚ@bUJ„Xl@lb„Wn@UzVV@bVVšmVnnJVXna‚bšKUKnUVVUnVLlKVLXa„Jm£@mU@WanaU_°@VWnV@UVWnIVVVKlXœÒlK@wVK„L°m„@„„l@ô„Kšw„ĉƾůUƒl£@»UƒVk„m@ƅUƒƒaÛIŏmUk@m„w@a™£ƒWk@ţšƒIm±@ankôUlaU™Uw¯ƒōaƒbÇbţm™ÞšÞVĖ„b„l@š@n‚VXxƒbUl@XmbƒŽ¯lUUU™W@ÛI±xU@mƒb@bmJ@bUzƒV@b¯bƒKUa¯KV_@Kk@@mWIƒ@lUU›b@bkVm@kwUÇU_WKU@Ux™@ƒVUnllX@Vn‚J@UXV@bWL@lUbbVLUJ@z‚V@lnbWbnnnJVŽ@L'], + 'encodeOffsets': [[ + 123312, + 29526 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3307', + 'properties': { + 'name': '金华市', + 'cp': [ + 120.0037, + 29.1028 + ], + 'childNum': 8 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@nbVb„@VbUVlb@VUnVxk`lXnJlbnƒlL@bX@Vƒ@klƒV@nLnx@JlI„V‚U@VUVn„VV„I@WVLVbVKXbWnXl@VlXUx„b@ŽlVUbl„œlVUšIÜVnalKX@@bV@@aUUlUƒwUw„@naWW„UVaUUšaVb„LlxXJVk°ƒUƒlkU¥@k„a@LVlXLVlšVWznVn@lxšJl_@WX_@mVa„a@alU@kVVna„KVLlK„b@UUaVašbnUWmXU@k@yVI@ařWmXIVJl_¯ƒ„¥UaVI@ƒLmUUw@mkkmK¯ƒk@Wbk@WI@aUyUXƒJkU@bU@WLUyƒXUbkbW`UVVkKmbUaVUƒUK™£@KVUUUm@UWkXWaUKƒV@b¯ƒ¯mU™V@UkƒmW@kkKƒwUƒmkkVUI@WlkUamL@Wk_Wƒ@UVm@Ua¯KWXk@Uxm@UK@xV„mV@Xk@UVV¼@‚VLUb™Uƒ„U@ƒyULUbVlU@@XlVUVVbƒU@lXXVW@XUVl@@VUVƒÈn@VVU„@lVa@„U„mL@`X@`WL@VUX@lUL@xlx'], + 'encodeOffsets': [[ + 122119, + 29948 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3308', + 'properties': { + 'name': '衢州市', + 'cp': [ + 118.6853, + 28.8666 + ], + 'childNum': 5 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@XkVKnwl@@aVK@UšwnL‚K@aÞaš¹@Kb@UVaUaVaVK@k°V„UllnL@„V@šxV@œšV@VV„m„_Wa„m@wlaÞbn@lL@WnLšk@V@VlK@nkVVb@blKXklakw@wVK@kVW@UXK@_‚W@_nKVƒ@ƒUb@kVƒUUm@„ÇVU@Uk@VU@WUXWW@k„VUaVUkU@WWXUKk@Ukmm¯LmmƒUJUIWJkImmƒ_—±WLkKm£@aVUmKUnƒLmWUkVmw@¥U„LVWm@WUka@UmmLmm@@bUX™@@WUIm@UVUK@UVUUU™VVJmb@b„Xn‚mVƒ¼nnn¦mJUVƒL„V@VW@UzUlVnUbl`UnVl@XU@kl@bmÈUx™Vk@@J@„ƒ¼W@ÅaVVnzmVƒ„@WJk@kWJ@ƒlXbWbXxmVnšlLXb@°lKVXnWšbWV„„X„mbV@Xl‚bšI@Kn@@x@šVLlm'], + 'encodeOffsets': [[ + 121185, + 30184 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3306', + 'properties': { + 'name': '绍兴市', + 'cp': [ + 120.564, + 29.7565 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@„x@„˜VnnVJnIVJV_VKXblUXJlŽlLUŽUnU@UVVX@ŽmVUUUJl„XUlbV@@V„LVmX@@XlaVJVXXJ@b‚@XU„@lUšJ„È‚bœ¤Ō„JšçV™UUnml@@kna@wšWVU@LVKV@namwkIUwmƒnmlaVL„kUmVUkmmIUak@VmUUVUƒWV_kK@U„K‚bnkWy„U@ƒ@UXwl@VUÞUVak±VUUU@mlI@™™wXWƒIWbUKkLUKVmUUmVVL™LambUWmIUm™nUU@aUUVym@ƒXkak@ƒW@z@lWVXnmV™aUbVb@VƒakLUKƒLmbUU@lkV@bƒbUb@nW`@Xk`™Ikwm@mUXy™UUkWKUk@Kƒb@lV¦klV„¯„UlWIkwƒKUa™bVVUbƒVXXmbƒ@Vx„xkVVV@bU@@aW@kLmb@lVUIVKmL@bUV@bUV@L„a˜lnUV@nbVbUlVXšJVUnx'], + 'encodeOffsets': [[ + 122997, + 30561 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3304', + 'properties': { + 'name': '嘉兴市', + 'cp': [ + 120.9155, + 30.6354 + ], + 'childNum': 6 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@@blIX@@VÜVUnn@l‚k„lKnI°Þl`²LVKVbnbVaVLUVn@W¦@VkVVb„@VI„`@blLnL‚aX@„VVb@U‚@XlVa„@@kVaUKV»U_lWXUƒƒ@alb„k@VllnLVKn@@UVIUw@y°IVVXU@VV@lw„m@wVkƾaœJ‚LkΡƧƒ™l™LÝUmW¯ķÿĉ¥ƒIŋŽWn™èkVƧU¯ÅmlVx@V¯aƒz„Ž@„@JU@U¦m@@šnVmn@V„LV‚'], + 'encodeOffsets': [[ + 123233, + 31382 + ]] + } + }, + { + 'type': 'Feature', + 'id': '3305', + 'properties': { + 'name': '湖州市', + 'cp': [ + 119.8608, + 30.7782 + ], + 'childNum': 4 + }, + 'geometry': { + 'type': 'Polygon', + 'coordinates': ['@@kLlƒkm@VmÛU@UW@kJ@aUƒK@UnmmU@™maÛL@JWUUKUwUIUJ@XƒKWV@Vk@UIUmVk@mm@ÅnmaUVkL@VƒKmLVbU@klU@ÝbV™@mVUKV™@wUkVƒ—ƒmIUJ@nVV@L™akJWbUIka@UmKmLKmmƒUUVk@@nmLX`WXUV@Ž@nUl™kmlU@Ub„„ƒxVVšIlV„Žšnn„@@n˜„UҚ@„°n@@xmb@„VbnV@šš„@b@`@L@L@x@blVklVbnnV@‚aXb°VlU@W„b°U„LXWVUV™„™VwÈwÜ»ĸaĠnUVw²X@V@lVU@wlaUUVm@knUV›'], + 'encodeOffsets': [[ + 123379, + 31500 + ]] + } + } + ], + 'UTF8Encoding': true + }; +});define('echarts/chart/gauge', [ + 'require', + './base', + '../util/shape/GaugePointer', + 'zrender/shape/Text', + 'zrender/shape/Line', + 'zrender/shape/Rectangle', + 'zrender/shape/Circle', + 'zrender/shape/Sector', + '../config', + '../util/ecData', + '../util/accMath', + 'zrender/tool/util', + '../chart' +], function (require) { + var ChartBase = require('./base'); + var GaugePointerShape = require('../util/shape/GaugePointer'); + var TextShape = require('zrender/shape/Text'); + var LineShape = require('zrender/shape/Line'); + var RectangleShape = require('zrender/shape/Rectangle'); + var CircleShape = require('zrender/shape/Circle'); + var SectorShape = require('zrender/shape/Sector'); + var ecConfig = require('../config'); + ecConfig.gauge = { + zlevel: 0, + z: 2, + center: [ + '50%', + '50%' + ], + clickable: true, + legendHoverLink: true, + radius: '75%', + startAngle: 225, + endAngle: -45, + min: 0, + max: 100, + precision: 0, + splitNumber: 10, + axisLine: { + show: true, + lineStyle: { + color: [ + [ + 0.2, + '#228b22' + ], + [ + 0.8, + '#48b' + ], + [ + 1, + '#ff4500' + ] + ], + width: 30 + } + }, + axisTick: { + show: true, + splitNumber: 5, + length: 8, + lineStyle: { + color: '#eee', + width: 1, + type: 'solid' + } + }, + axisLabel: { + show: true, + textStyle: { color: 'auto' } + }, + splitLine: { + show: true, + length: 30, + lineStyle: { + color: '#eee', + width: 2, + type: 'solid' + } + }, + pointer: { + show: true, + length: '80%', + width: 8, + color: 'auto' + }, + title: { + show: true, + offsetCenter: [ + 0, + '-40%' + ], + textStyle: { + color: '#333', + fontSize: 15 + } + }, + detail: { + show: true, + backgroundColor: 'rgba(0,0,0,0)', + borderWidth: 0, + borderColor: '#ccc', + width: 100, + height: 40, + offsetCenter: [ + 0, + '40%' + ], + textStyle: { + color: 'auto', + fontSize: 30 + } + } + }; + var ecData = require('../util/ecData'); + var accMath = require('../util/accMath'); + var zrUtil = require('zrender/tool/util'); + function Gauge(ecTheme, messageCenter, zr, option, myChart) { + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); + this.refresh(option); + } + Gauge.prototype = { + type: ecConfig.CHART_TYPE_GAUGE, + _buildShape: function () { + var series = this.series; + this._paramsMap = {}; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type === ecConfig.CHART_TYPE_GAUGE) { + series[i] = this.reformOption(series[i]); + this.legendHoverLink = series[i].legendHoverLink || this.legendHoverLink; + this._buildSingleGauge(i); + this.buildMark(i); + } + } + this.addShapeList(); + }, + _buildSingleGauge: function (seriesIndex) { + var serie = this.series[seriesIndex]; + this._paramsMap[seriesIndex] = { + center: this.parseCenter(this.zr, serie.center), + radius: this.parseRadius(this.zr, serie.radius), + startAngle: serie.startAngle.toFixed(2) - 0, + endAngle: serie.endAngle.toFixed(2) - 0 + }; + this._paramsMap[seriesIndex].totalAngle = this._paramsMap[seriesIndex].startAngle - this._paramsMap[seriesIndex].endAngle; + this._colorMap(seriesIndex); + this._buildAxisLine(seriesIndex); + this._buildSplitLine(seriesIndex); + this._buildAxisTick(seriesIndex); + this._buildAxisLabel(seriesIndex); + this._buildPointer(seriesIndex); + this._buildTitle(seriesIndex); + this._buildDetail(seriesIndex); + }, + _buildAxisLine: function (seriesIndex) { + var serie = this.series[seriesIndex]; + if (!serie.axisLine.show) { + return; + } + var min = serie.min; + var total = serie.max - min; + var params = this._paramsMap[seriesIndex]; + var center = params.center; + var startAngle = params.startAngle; + var totalAngle = params.totalAngle; + var colorArray = params.colorArray; + var lineStyle = serie.axisLine.lineStyle; + var lineWidth = this.parsePercent(lineStyle.width, params.radius[1]); + var r = params.radius[1]; + var r0 = r - lineWidth; + var sectorShape; + var lastAngle = startAngle; + var newAngle; + for (var i = 0, l = colorArray.length; i < l; i++) { + newAngle = startAngle - totalAngle * (colorArray[i][0] - min) / total; + sectorShape = this._getSector(center, r0, r, newAngle, lastAngle, colorArray[i][1], lineStyle); + lastAngle = newAngle; + sectorShape._animationAdd = 'r'; + ecData.set(sectorShape, 'seriesIndex', seriesIndex); + ecData.set(sectorShape, 'dataIndex', i); + this.shapeList.push(sectorShape); + } + }, + _buildSplitLine: function (seriesIndex) { + var serie = this.series[seriesIndex]; + if (!serie.splitLine.show) { + return; + } + var params = this._paramsMap[seriesIndex]; + var splitNumber = serie.splitNumber; + var min = serie.min; + var total = serie.max - min; + var splitLine = serie.splitLine; + var length = this.parsePercent(splitLine.length, params.radius[1]); + var lineStyle = splitLine.lineStyle; + var color = lineStyle.color; + var center = params.center; + var startAngle = params.startAngle * Math.PI / 180; + var totalAngle = params.totalAngle * Math.PI / 180; + var r = params.radius[1]; + var r0 = r - length; + var angle; + var sinAngle; + var cosAngle; + for (var i = 0; i <= splitNumber; i++) { + angle = startAngle - totalAngle / splitNumber * i; + sinAngle = Math.sin(angle); + cosAngle = Math.cos(angle); + this.shapeList.push(new LineShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + hoverable: false, + style: { + xStart: center[0] + cosAngle * r, + yStart: center[1] - sinAngle * r, + xEnd: center[0] + cosAngle * r0, + yEnd: center[1] - sinAngle * r0, + strokeColor: color === 'auto' ? this._getColor(seriesIndex, min + total / splitNumber * i) : color, + lineType: lineStyle.type, + lineWidth: lineStyle.width, + shadowColor: lineStyle.shadowColor, + shadowBlur: lineStyle.shadowBlur, + shadowOffsetX: lineStyle.shadowOffsetX, + shadowOffsetY: lineStyle.shadowOffsetY + } + })); + } + }, + _buildAxisTick: function (seriesIndex) { + var serie = this.series[seriesIndex]; + if (!serie.axisTick.show) { + return; + } + var params = this._paramsMap[seriesIndex]; + var splitNumber = serie.splitNumber; + var min = serie.min; + var total = serie.max - min; + var axisTick = serie.axisTick; + var tickSplit = axisTick.splitNumber; + var length = this.parsePercent(axisTick.length, params.radius[1]); + var lineStyle = axisTick.lineStyle; + var color = lineStyle.color; + var center = params.center; + var startAngle = params.startAngle * Math.PI / 180; + var totalAngle = params.totalAngle * Math.PI / 180; + var r = params.radius[1]; + var r0 = r - length; + var angle; + var sinAngle; + var cosAngle; + for (var i = 0, l = splitNumber * tickSplit; i <= l; i++) { + if (i % tickSplit === 0) { + continue; + } + angle = startAngle - totalAngle / l * i; + sinAngle = Math.sin(angle); + cosAngle = Math.cos(angle); + this.shapeList.push(new LineShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + hoverable: false, + style: { + xStart: center[0] + cosAngle * r, + yStart: center[1] - sinAngle * r, + xEnd: center[0] + cosAngle * r0, + yEnd: center[1] - sinAngle * r0, + strokeColor: color === 'auto' ? this._getColor(seriesIndex, min + total / l * i) : color, + lineType: lineStyle.type, + lineWidth: lineStyle.width, + shadowColor: lineStyle.shadowColor, + shadowBlur: lineStyle.shadowBlur, + shadowOffsetX: lineStyle.shadowOffsetX, + shadowOffsetY: lineStyle.shadowOffsetY + } + })); + } + }, + _buildAxisLabel: function (seriesIndex) { + var serie = this.series[seriesIndex]; + if (!serie.axisLabel.show) { + return; + } + var splitNumber = serie.splitNumber; + var min = serie.min; + var total = serie.max - min; + var textStyle = serie.axisLabel.textStyle; + var textFont = this.getFont(textStyle); + var color = textStyle.color; + var params = this._paramsMap[seriesIndex]; + var center = params.center; + var startAngle = params.startAngle; + var totalAngle = params.totalAngle; + var r0 = params.radius[1] - this.parsePercent(serie.splitLine.length, params.radius[1]) - 5; + var angle; + var sinAngle; + var cosAngle; + var value; + for (var i = 0; i <= splitNumber; i++) { + value = accMath.accAdd(min, accMath.accMul(accMath.accDiv(total, splitNumber), i)); + angle = startAngle - totalAngle / splitNumber * i; + sinAngle = Math.sin(angle * Math.PI / 180); + cosAngle = Math.cos(angle * Math.PI / 180); + angle = (angle + 360) % 360; + this.shapeList.push(new TextShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + hoverable: false, + style: { + x: center[0] + cosAngle * r0, + y: center[1] - sinAngle * r0, + color: color === 'auto' ? this._getColor(seriesIndex, value) : color, + text: this._getLabelText(serie.axisLabel.formatter, value), + textAlign: angle >= 110 && angle <= 250 ? 'left' : angle <= 70 || angle >= 290 ? 'right' : 'center', + textBaseline: angle >= 10 && angle <= 170 ? 'top' : angle >= 190 && angle <= 350 ? 'bottom' : 'middle', + textFont: textFont, + shadowColor: textStyle.shadowColor, + shadowBlur: textStyle.shadowBlur, + shadowOffsetX: textStyle.shadowOffsetX, + shadowOffsetY: textStyle.shadowOffsetY + } + })); + } + }, + _buildPointer: function (seriesIndex) { + var serie = this.series[seriesIndex]; + if (!serie.pointer.show) { + return; + } + var total = serie.max - serie.min; + var pointer = serie.pointer; + var params = this._paramsMap[seriesIndex]; + var length = this.parsePercent(pointer.length, params.radius[1]); + var width = this.parsePercent(pointer.width, params.radius[1]); + var center = params.center; + var value = this._getValue(seriesIndex); + value = value < serie.max ? value : serie.max; + var angle = (params.startAngle - params.totalAngle / total * (value - serie.min)) * Math.PI / 180; + var color = pointer.color === 'auto' ? this._getColor(seriesIndex, value) : pointer.color; + var pointShape = new GaugePointerShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + clickable: this.query(serie, 'clickable'), + style: { + x: center[0], + y: center[1], + r: length, + startAngle: params.startAngle * Math.PI / 180, + angle: angle, + color: color, + width: width, + shadowColor: pointer.shadowColor, + shadowBlur: pointer.shadowBlur, + shadowOffsetX: pointer.shadowOffsetX, + shadowOffsetY: pointer.shadowOffsetY + }, + highlightStyle: { + brushType: 'fill', + width: width > 2 ? 2 : width / 2, + color: '#fff' + } + }); + ecData.pack(pointShape, this.series[seriesIndex], seriesIndex, this.series[seriesIndex].data[0], 0, this.series[seriesIndex].data[0].name, value); + this.shapeList.push(pointShape); + this.shapeList.push(new CircleShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase() + 2, + hoverable: false, + style: { + x: center[0], + y: center[1], + r: pointer.width / 2.5, + color: '#fff' + } + })); + }, + _buildTitle: function (seriesIndex) { + var serie = this.series[seriesIndex]; + if (!serie.title.show) { + return; + } + var data = serie.data[0]; + var name = data.name != null ? data.name : ''; + if (name !== '') { + var title = serie.title; + var offsetCenter = title.offsetCenter; + var textStyle = title.textStyle; + var textColor = textStyle.color; + var params = this._paramsMap[seriesIndex]; + var x = params.center[0] + this.parsePercent(offsetCenter[0], params.radius[1]); + var y = params.center[1] + this.parsePercent(offsetCenter[1], params.radius[1]); + this.shapeList.push(new TextShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase() + (Math.abs(x - params.center[0]) + Math.abs(y - params.center[1]) < textStyle.fontSize * 2 ? 2 : 1), + hoverable: false, + style: { + x: x, + y: y, + color: textColor === 'auto' ? this._getColor(seriesIndex) : textColor, + text: name, + textAlign: 'center', + textFont: this.getFont(textStyle), + shadowColor: textStyle.shadowColor, + shadowBlur: textStyle.shadowBlur, + shadowOffsetX: textStyle.shadowOffsetX, + shadowOffsetY: textStyle.shadowOffsetY + } + })); + } + }, + _buildDetail: function (seriesIndex) { + var serie = this.series[seriesIndex]; + if (!serie.detail.show) { + return; + } + var detail = serie.detail; + var offsetCenter = detail.offsetCenter; + var color = detail.backgroundColor; + var textStyle = detail.textStyle; + var textColor = textStyle.color; + var params = this._paramsMap[seriesIndex]; + var value = this._getValue(seriesIndex); + var x = params.center[0] - detail.width / 2 + this.parsePercent(offsetCenter[0], params.radius[1]); + var y = params.center[1] + this.parsePercent(offsetCenter[1], params.radius[1]); + this.shapeList.push(new RectangleShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase() + (Math.abs(x + detail.width / 2 - params.center[0]) + Math.abs(y + detail.height / 2 - params.center[1]) < textStyle.fontSize ? 2 : 1), + hoverable: false, + style: { + x: x, + y: y, + width: detail.width, + height: detail.height, + brushType: 'both', + color: color === 'auto' ? this._getColor(seriesIndex, value) : color, + lineWidth: detail.borderWidth, + strokeColor: detail.borderColor, + shadowColor: detail.shadowColor, + shadowBlur: detail.shadowBlur, + shadowOffsetX: detail.shadowOffsetX, + shadowOffsetY: detail.shadowOffsetY, + text: this._getLabelText(detail.formatter, value), + textFont: this.getFont(textStyle), + textPosition: 'inside', + textColor: textColor === 'auto' ? this._getColor(seriesIndex, value) : textColor + } + })); + }, + _getValue: function (seriesIndex) { + return this.getDataFromOption(this.series[seriesIndex].data[0]); + }, + _colorMap: function (seriesIndex) { + var serie = this.series[seriesIndex]; + var min = serie.min; + var total = serie.max - min; + var color = serie.axisLine.lineStyle.color; + if (!(color instanceof Array)) { + color = [[ + 1, + color + ]]; + } + var colorArray = []; + for (var i = 0, l = color.length; i < l; i++) { + colorArray.push([ + color[i][0] * total + min, + color[i][1] + ]); + } + this._paramsMap[seriesIndex].colorArray = colorArray; + }, + _getColor: function (seriesIndex, value) { + if (value == null) { + value = this._getValue(seriesIndex); + } + var colorArray = this._paramsMap[seriesIndex].colorArray; + for (var i = 0, l = colorArray.length; i < l; i++) { + if (colorArray[i][0] >= value) { + return colorArray[i][1]; + } + } + return colorArray[colorArray.length - 1][1]; + }, + _getSector: function (center, r0, r, startAngle, endAngle, color, lineStyle) { + return new SectorShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: center[0], + y: center[1], + r0: r0, + r: r, + startAngle: startAngle, + endAngle: endAngle, + brushType: 'fill', + color: color, + shadowColor: lineStyle.shadowColor, + shadowBlur: lineStyle.shadowBlur, + shadowOffsetX: lineStyle.shadowOffsetX, + shadowOffsetY: lineStyle.shadowOffsetY + } + }); + }, + _getLabelText: function (formatter, value) { + if (formatter) { + if (typeof formatter === 'function') { + return formatter.call(this.myChart, value); + } else if (typeof formatter === 'string') { + return formatter.replace('{value}', value); + } + } + return value; + }, + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + this.backupShapeList(); + this._buildShape(); + } + }; + zrUtil.inherits(Gauge, ChartBase); + require('../chart').define('gauge', Gauge); + return Gauge; +});define('echarts/util/shape/GaugePointer', [ + 'require', + 'zrender/shape/Base', + 'zrender/tool/util', + './normalIsCover' +], function (require) { + var Base = require('zrender/shape/Base'); + var zrUtil = require('zrender/tool/util'); + function GaugePointer(options) { + Base.call(this, options); + } + GaugePointer.prototype = { + type: 'gauge-pointer', + buildPath: function (ctx, style) { + var r = style.r; + var width = style.width; + var angle = style.angle; + var x = style.x - Math.cos(angle) * width * (width >= r / 3 ? 1 : 2); + var y = style.y + Math.sin(angle) * width * (width >= r / 3 ? 1 : 2); + angle = style.angle - Math.PI / 2; + ctx.moveTo(x, y); + ctx.lineTo(style.x + Math.cos(angle) * width, style.y - Math.sin(angle) * width); + ctx.lineTo(style.x + Math.cos(style.angle) * r, style.y - Math.sin(style.angle) * r); + ctx.lineTo(style.x - Math.cos(angle) * width, style.y + Math.sin(angle) * width); + ctx.lineTo(x, y); + return; + }, + getRect: function (style) { + if (style.__rect) { + return style.__rect; + } + var width = style.width * 2; + var xStart = style.x; + var yStart = style.y; + var xEnd = xStart + Math.cos(style.angle) * style.r; + var yEnd = yStart - Math.sin(style.angle) * style.r; + style.__rect = { + x: Math.min(xStart, xEnd) - width, + y: Math.min(yStart, yEnd) - width, + width: Math.abs(xStart - xEnd) + width, + height: Math.abs(yStart - yEnd) + width + }; + return style.__rect; + }, + isCover: require('./normalIsCover') + }; + zrUtil.inherits(GaugePointer, Base); + return GaugePointer; +});define('echarts/chart/funnel', [ + 'require', + './base', + 'zrender/shape/Text', + 'zrender/shape/Line', + 'zrender/shape/Polygon', + '../config', + '../util/ecData', + '../util/number', + 'zrender/tool/util', + 'zrender/tool/color', + 'zrender/tool/area', + '../chart' +], function (require) { + var ChartBase = require('./base'); + var TextShape = require('zrender/shape/Text'); + var LineShape = require('zrender/shape/Line'); + var PolygonShape = require('zrender/shape/Polygon'); + var ecConfig = require('../config'); + ecConfig.funnel = { + zlevel: 0, + z: 2, + clickable: true, + legendHoverLink: true, + x: 80, + y: 60, + x2: 80, + y2: 60, + min: 0, + max: 100, + minSize: '0%', + maxSize: '100%', + sort: 'descending', + gap: 0, + funnelAlign: 'center', + itemStyle: { + normal: { + borderColor: '#fff', + borderWidth: 1, + label: { + show: true, + position: 'outer' + }, + labelLine: { + show: true, + length: 10, + lineStyle: { + width: 1, + type: 'solid' + } + } + }, + emphasis: { + borderColor: 'rgba(0,0,0,0)', + borderWidth: 1, + label: { show: true }, + labelLine: { show: true } + } + } + }; + var ecData = require('../util/ecData'); + var number = require('../util/number'); + var zrUtil = require('zrender/tool/util'); + var zrColor = require('zrender/tool/color'); + var zrArea = require('zrender/tool/area'); + function Funnel(ecTheme, messageCenter, zr, option, myChart) { + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); + this.refresh(option); + } + Funnel.prototype = { + type: ecConfig.CHART_TYPE_FUNNEL, + _buildShape: function () { + var series = this.series; + var legend = this.component.legend; + this._paramsMap = {}; + this._selected = {}; + this.selectedMap = {}; + var serieName; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type === ecConfig.CHART_TYPE_FUNNEL) { + series[i] = this.reformOption(series[i]); + this.legendHoverLink = series[i].legendHoverLink || this.legendHoverLink; + serieName = series[i].name || ''; + this.selectedMap[serieName] = legend ? legend.isSelected(serieName) : true; + if (!this.selectedMap[serieName]) { + continue; + } + this._buildSingleFunnel(i); + this.buildMark(i); + } + } + this.addShapeList(); + }, + _buildSingleFunnel: function (seriesIndex) { + var legend = this.component.legend; + var serie = this.series[seriesIndex]; + var data = this._mapData(seriesIndex); + var location = this._getLocation(seriesIndex); + this._paramsMap[seriesIndex] = { + location: location, + data: data + }; + var itemName; + var total = 0; + var selectedData = []; + for (var i = 0, l = data.length; i < l; i++) { + itemName = data[i].name; + this.selectedMap[itemName] = legend ? legend.isSelected(itemName) : true; + if (this.selectedMap[itemName] && !isNaN(data[i].value)) { + selectedData.push(data[i]); + total++; + } + } + if (total === 0) { + return; + } + var funnelCase = this._buildFunnelCase(seriesIndex); + var align = serie.funnelAlign; + var gap = serie.gap; + var height = total > 1 ? (location.height - (total - 1) * gap) / total : location.height; + var width; + var lastY = location.y; + var lastWidth = serie.sort === 'descending' ? this._getItemWidth(seriesIndex, selectedData[0].value) : number.parsePercent(serie.minSize, location.width); + var next = serie.sort === 'descending' ? 1 : 0; + var centerX = location.centerX; + var pointList = []; + var x; + var polygon; + var lastPolygon; + for (var i = 0, l = selectedData.length; i < l; i++) { + itemName = selectedData[i].name; + if (this.selectedMap[itemName] && !isNaN(selectedData[i].value)) { + width = i <= l - 2 ? this._getItemWidth(seriesIndex, selectedData[i + next].value) : serie.sort === 'descending' ? number.parsePercent(serie.minSize, location.width) : number.parsePercent(serie.maxSize, location.width); + switch (align) { + case 'left': + x = location.x; + break; + case 'right': + x = location.x + location.width - lastWidth; + break; + default: + x = centerX - lastWidth / 2; + } + polygon = this._buildItem(seriesIndex, selectedData[i]._index, legend ? legend.getColor(itemName) : this.zr.getColor(selectedData[i]._index), x, lastY, lastWidth, width, height, align); + lastY += height + gap; + lastPolygon = polygon.style.pointList; + pointList.unshift([ + lastPolygon[0][0] - 10, + lastPolygon[0][1] + ]); + pointList.push([ + lastPolygon[1][0] + 10, + lastPolygon[1][1] + ]); + if (i === 0) { + if (lastWidth === 0) { + lastPolygon = pointList.pop(); + align == 'center' && (pointList[0][0] += 10); + align == 'right' && (pointList[0][0] = lastPolygon[0]); + pointList[0][1] -= align == 'center' ? 10 : 15; + if (l == 1) { + lastPolygon = polygon.style.pointList; + } + } else { + pointList[pointList.length - 1][1] -= 5; + pointList[0][1] -= 5; + } + } + lastWidth = width; + } + } + if (funnelCase) { + pointList.unshift([ + lastPolygon[3][0] - 10, + lastPolygon[3][1] + ]); + pointList.push([ + lastPolygon[2][0] + 10, + lastPolygon[2][1] + ]); + if (lastWidth === 0) { + lastPolygon = pointList.pop(); + align == 'center' && (pointList[0][0] += 10); + align == 'right' && (pointList[0][0] = lastPolygon[0]); + pointList[0][1] += align == 'center' ? 10 : 15; + } else { + pointList[pointList.length - 1][1] += 5; + pointList[0][1] += 5; + } + funnelCase.style.pointList = pointList; + } + }, + _buildFunnelCase: function (seriesIndex) { + var serie = this.series[seriesIndex]; + if (this.deepQuery([ + serie, + this.option + ], 'calculable')) { + var location = this._paramsMap[seriesIndex].location; + var gap = 10; + var funnelCase = { + hoverable: false, + style: { + pointListd: [ + [ + location.x - gap, + location.y - gap + ], + [ + location.x + location.width + gap, + location.y - gap + ], + [ + location.x + location.width + gap, + location.y + location.height + gap + ], + [ + location.x - gap, + location.y + location.height + gap + ] + ], + brushType: 'stroke', + lineWidth: 1, + strokeColor: serie.calculableHolderColor || this.ecTheme.calculableHolderColor || ecConfig.calculableHolderColor + } + }; + ecData.pack(funnelCase, serie, seriesIndex, undefined, -1); + this.setCalculable(funnelCase); + funnelCase = new PolygonShape(funnelCase); + this.shapeList.push(funnelCase); + return funnelCase; + } + }, + _getLocation: function (seriesIndex) { + var gridOption = this.series[seriesIndex]; + var zrWidth = this.zr.getWidth(); + var zrHeight = this.zr.getHeight(); + var x = this.parsePercent(gridOption.x, zrWidth); + var y = this.parsePercent(gridOption.y, zrHeight); + var width = gridOption.width == null ? zrWidth - x - this.parsePercent(gridOption.x2, zrWidth) : this.parsePercent(gridOption.width, zrWidth); + return { + x: x, + y: y, + width: width, + height: gridOption.height == null ? zrHeight - y - this.parsePercent(gridOption.y2, zrHeight) : this.parsePercent(gridOption.height, zrHeight), + centerX: x + width / 2 + }; + }, + _mapData: function (seriesIndex) { + var serie = this.series[seriesIndex]; + var funnelData = zrUtil.clone(serie.data); + for (var i = 0, l = funnelData.length; i < l; i++) { + funnelData[i]._index = i; + } + function numDescending(a, b) { + if (a.value === '-') { + return 1; + } else if (b.value === '-') { + return -1; + } + return b.value - a.value; + } + function numAscending(a, b) { + return -numDescending(a, b); + } + if (serie.sort != 'none') { + funnelData.sort(serie.sort === 'descending' ? numDescending : numAscending); + } + return funnelData; + }, + _buildItem: function (seriesIndex, dataIndex, defaultColor, x, y, topWidth, bottomWidth, height, align) { + var series = this.series; + var serie = series[seriesIndex]; + var data = serie.data[dataIndex]; + var polygon = this.getPolygon(seriesIndex, dataIndex, defaultColor, x, y, topWidth, bottomWidth, height, align); + ecData.pack(polygon, series[seriesIndex], seriesIndex, series[seriesIndex].data[dataIndex], dataIndex, series[seriesIndex].data[dataIndex].name); + this.shapeList.push(polygon); + var label = this.getLabel(seriesIndex, dataIndex, defaultColor, x, y, topWidth, bottomWidth, height, align); + ecData.pack(label, series[seriesIndex], seriesIndex, series[seriesIndex].data[dataIndex], dataIndex, series[seriesIndex].data[dataIndex].name); + this.shapeList.push(label); + if (!this._needLabel(serie, data, false)) { + label.invisible = true; + } + var labelLine = this.getLabelLine(seriesIndex, dataIndex, defaultColor, x, y, topWidth, bottomWidth, height, align); + this.shapeList.push(labelLine); + if (!this._needLabelLine(serie, data, false)) { + labelLine.invisible = true; + } + var polygonHoverConnect = []; + var labelHoverConnect = []; + if (this._needLabelLine(serie, data, true)) { + polygonHoverConnect.push(labelLine.id); + labelHoverConnect.push(labelLine.id); + } + if (this._needLabel(serie, data, true)) { + polygonHoverConnect.push(label.id); + labelHoverConnect.push(polygon.id); + } + polygon.hoverConnect = polygonHoverConnect; + label.hoverConnect = labelHoverConnect; + return polygon; + }, + _getItemWidth: function (seriesIndex, value) { + var serie = this.series[seriesIndex]; + var location = this._paramsMap[seriesIndex].location; + var min = serie.min; + var max = serie.max; + var minSize = number.parsePercent(serie.minSize, location.width); + var maxSize = number.parsePercent(serie.maxSize, location.width); + return value * (maxSize - minSize) / (max - min); + }, + getPolygon: function (seriesIndex, dataIndex, defaultColor, xLT, y, topWidth, bottomWidth, height, align) { + var serie = this.series[seriesIndex]; + var data = serie.data[dataIndex]; + var queryTarget = [ + data, + serie + ]; + var normal = this.deepMerge(queryTarget, 'itemStyle.normal') || {}; + var emphasis = this.deepMerge(queryTarget, 'itemStyle.emphasis') || {}; + var normalColor = this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) || defaultColor; + var emphasisColor = this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data) || (typeof normalColor === 'string' ? zrColor.lift(normalColor, -0.2) : normalColor); + var xLB; + switch (align) { + case 'left': + xLB = xLT; + break; + case 'right': + xLB = xLT + (topWidth - bottomWidth); + break; + default: + xLB = xLT + (topWidth - bottomWidth) / 2; + break; + } + var polygon = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + clickable: this.deepQuery(queryTarget, 'clickable'), + style: { + pointList: [ + [ + xLT, + y + ], + [ + xLT + topWidth, + y + ], + [ + xLB + bottomWidth, + y + height + ], + [ + xLB, + y + height + ] + ], + brushType: 'both', + color: normalColor, + lineWidth: normal.borderWidth, + strokeColor: normal.borderColor + }, + highlightStyle: { + color: emphasisColor, + lineWidth: emphasis.borderWidth, + strokeColor: emphasis.borderColor + } + }; + if (this.deepQuery([ + data, + serie, + this.option + ], 'calculable')) { + this.setCalculable(polygon); + polygon.draggable = true; + } + return new PolygonShape(polygon); + }, + getLabel: function (seriesIndex, dataIndex, defaultColor, x, y, topWidth, bottomWidth, height, align) { + var serie = this.series[seriesIndex]; + var data = serie.data[dataIndex]; + var location = this._paramsMap[seriesIndex].location; + var itemStyle = zrUtil.merge(zrUtil.clone(data.itemStyle) || {}, serie.itemStyle); + var status = 'normal'; + var labelControl = itemStyle[status].label; + var textStyle = labelControl.textStyle || {}; + var lineLength = itemStyle[status].labelLine.length; + var text = this.getLabelText(seriesIndex, dataIndex, status); + var textFont = this.getFont(textStyle); + var textAlign; + var textColor = defaultColor; + labelControl.position = labelControl.position || itemStyle.normal.label.position; + if (labelControl.position === 'inner' || labelControl.position === 'inside' || labelControl.position === 'center') { + textAlign = align; + textColor = Math.max(topWidth, bottomWidth) / 2 > zrArea.getTextWidth(text, textFont) ? '#fff' : zrColor.reverse(defaultColor); + } else if (labelControl.position === 'left') { + textAlign = 'right'; + } else { + textAlign = 'left'; + } + var textShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + style: { + x: this._getLabelPoint(labelControl.position, x, location, topWidth, bottomWidth, lineLength, align), + y: y + height / 2, + color: textStyle.color || textColor, + text: text, + textAlign: textStyle.align || textAlign, + textBaseline: textStyle.baseline || 'middle', + textFont: textFont + } + }; + status = 'emphasis'; + labelControl = itemStyle[status].label || labelControl; + textStyle = labelControl.textStyle || textStyle; + lineLength = itemStyle[status].labelLine.length || lineLength; + labelControl.position = labelControl.position || itemStyle.normal.label.position; + text = this.getLabelText(seriesIndex, dataIndex, status); + textFont = this.getFont(textStyle); + textColor = defaultColor; + if (labelControl.position === 'inner' || labelControl.position === 'inside' || labelControl.position === 'center') { + textAlign = align; + textColor = Math.max(topWidth, bottomWidth) / 2 > zrArea.getTextWidth(text, textFont) ? '#fff' : zrColor.reverse(defaultColor); + } else if (labelControl.position === 'left') { + textAlign = 'right'; + } else { + textAlign = 'left'; + } + textShape.highlightStyle = { + x: this._getLabelPoint(labelControl.position, x, location, topWidth, bottomWidth, lineLength, align), + color: textStyle.color || textColor, + text: text, + textAlign: textStyle.align || textAlign, + textFont: textFont, + brushType: 'fill' + }; + return new TextShape(textShape); + }, + getLabelText: function (seriesIndex, dataIndex, status) { + var series = this.series; + var serie = series[seriesIndex]; + var data = serie.data[dataIndex]; + var formatter = this.deepQuery([ + data, + serie + ], 'itemStyle.' + status + '.label.formatter'); + if (formatter) { + if (typeof formatter === 'function') { + return formatter.call(this.myChart, { + seriesIndex: seriesIndex, + seriesName: serie.name || '', + series: serie, + dataIndex: dataIndex, + data: data, + name: data.name, + value: data.value + }); + } else if (typeof formatter === 'string') { + formatter = formatter.replace('{a}', '{a0}').replace('{b}', '{b0}').replace('{c}', '{c0}').replace('{a0}', serie.name).replace('{b0}', data.name).replace('{c0}', data.value); + return formatter; + } + } else { + return data.name; + } + }, + getLabelLine: function (seriesIndex, dataIndex, defaultColor, x, y, topWidth, bottomWidth, height, align) { + var serie = this.series[seriesIndex]; + var data = serie.data[dataIndex]; + var location = this._paramsMap[seriesIndex].location; + var itemStyle = zrUtil.merge(zrUtil.clone(data.itemStyle) || {}, serie.itemStyle); + var status = 'normal'; + var labelLineControl = itemStyle[status].labelLine; + var lineLength = itemStyle[status].labelLine.length; + var lineStyle = labelLineControl.lineStyle || {}; + var labelControl = itemStyle[status].label; + labelControl.position = labelControl.position || itemStyle.normal.label.position; + var lineShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + hoverable: false, + style: { + xStart: this._getLabelLineStartPoint(x, location, topWidth, bottomWidth, align), + yStart: y + height / 2, + xEnd: this._getLabelPoint(labelControl.position, x, location, topWidth, bottomWidth, lineLength, align), + yEnd: y + height / 2, + strokeColor: lineStyle.color || defaultColor, + lineType: lineStyle.type, + lineWidth: lineStyle.width + } + }; + status = 'emphasis'; + labelLineControl = itemStyle[status].labelLine || labelLineControl; + lineLength = itemStyle[status].labelLine.length || lineLength; + lineStyle = labelLineControl.lineStyle || lineStyle; + labelControl = itemStyle[status].label || labelControl; + labelControl.position = labelControl.position; + lineShape.highlightStyle = { + xEnd: this._getLabelPoint(labelControl.position, x, location, topWidth, bottomWidth, lineLength, align), + strokeColor: lineStyle.color || defaultColor, + lineType: lineStyle.type, + lineWidth: lineStyle.width + }; + return new LineShape(lineShape); + }, + _getLabelPoint: function (position, x, location, topWidth, bottomWidth, lineLength, align) { + position = position === 'inner' || position === 'inside' ? 'center' : position; + switch (position) { + case 'center': + return align == 'center' ? x + topWidth / 2 : align == 'left' ? x + 10 : x + topWidth - 10; + case 'left': + if (lineLength === 'auto') { + return location.x - 10; + } else { + return align == 'center' ? location.centerX - Math.max(topWidth, bottomWidth) / 2 - lineLength : align == 'right' ? x - (topWidth < bottomWidth ? bottomWidth - topWidth : 0) - lineLength : location.x - lineLength; + } + break; + default: + if (lineLength === 'auto') { + return location.x + location.width + 10; + } else { + return align == 'center' ? location.centerX + Math.max(topWidth, bottomWidth) / 2 + lineLength : align == 'right' ? location.x + location.width + lineLength : x + Math.max(topWidth, bottomWidth) + lineLength; + } + } + }, + _getLabelLineStartPoint: function (x, location, topWidth, bottomWidth, align) { + return align == 'center' ? location.centerX : topWidth < bottomWidth ? x + Math.min(topWidth, bottomWidth) / 2 : x + Math.max(topWidth, bottomWidth) / 2; + }, + _needLabel: function (serie, data, isEmphasis) { + return this.deepQuery([ + data, + serie + ], 'itemStyle.' + (isEmphasis ? 'emphasis' : 'normal') + '.label.show'); + }, + _needLabelLine: function (serie, data, isEmphasis) { + return this.deepQuery([ + data, + serie + ], 'itemStyle.' + (isEmphasis ? 'emphasis' : 'normal') + '.labelLine.show'); + }, + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + this.backupShapeList(); + this._buildShape(); + } + }; + zrUtil.inherits(Funnel, ChartBase); + require('../chart').define('funnel', Funnel); + return Funnel; +});define('echarts/chart/eventRiver', [ + 'require', + './base', + '../layout/eventRiver', + 'zrender/shape/Polygon', + '../component/axis', + '../component/grid', + '../component/dataZoom', + '../config', + '../util/ecData', + '../util/date', + 'zrender/tool/util', + 'zrender/tool/color', + '../chart' +], function (require) { + var ChartBase = require('./base'); + var eventRiverLayout = require('../layout/eventRiver'); + var PolygonShape = require('zrender/shape/Polygon'); + require('../component/axis'); + require('../component/grid'); + require('../component/dataZoom'); + var ecConfig = require('../config'); + ecConfig.eventRiver = { + zlevel: 0, + z: 2, + clickable: true, + legendHoverLink: true, + itemStyle: { + normal: { + borderColor: 'rgba(0,0,0,0)', + borderWidth: 1, + label: { + show: true, + position: 'inside', + formatter: '{b}' + } + }, + emphasis: { + borderColor: 'rgba(0,0,0,0)', + borderWidth: 1, + label: { show: true } + } + } + }; + var ecData = require('../util/ecData'); + var ecDate = require('../util/date'); + var zrUtil = require('zrender/tool/util'); + var zrColor = require('zrender/tool/color'); + function EventRiver(ecTheme, messageCenter, zr, option, myChart) { + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); + var self = this; + self._ondragend = function () { + self.isDragend = true; + }; + this.refresh(option); + } + EventRiver.prototype = { + type: ecConfig.CHART_TYPE_EVENTRIVER, + _buildShape: function () { + var series = this.series; + this.selectedMap = {}; + this._dataPreprocessing(); + var legend = this.component.legend; + var eventRiverSeries = []; + for (var i = 0; i < series.length; i++) { + if (series[i].type === this.type) { + series[i] = this.reformOption(series[i]); + this.legendHoverLink = series[i].legendHoverLink || this.legendHoverLink; + var serieName = series[i].name || ''; + this.selectedMap[serieName] = legend ? legend.isSelected(serieName) : true; + if (!this.selectedMap[serieName]) { + continue; + } + this.buildMark(i); + eventRiverSeries.push(this.series[i]); + } + } + eventRiverLayout(eventRiverSeries, this._intervalX, this.component.grid.getArea()); + this._drawEventRiver(); + this.addShapeList(); + }, + _dataPreprocessing: function () { + var series = this.series; + var xAxis; + var evolutionList; + for (var i = 0, iLen = series.length; i < iLen; i++) { + if (series[i].type === this.type) { + xAxis = this.component.xAxis.getAxis(series[i].xAxisIndex || 0); + for (var j = 0, jLen = series[i].eventList.length; j < jLen; j++) { + evolutionList = series[i].eventList[j].evolution; + for (var k = 0, kLen = evolutionList.length; k < kLen; k++) { + evolutionList[k].timeScale = xAxis.getCoord(ecDate.getNewDate(evolutionList[k].time) - 0); + evolutionList[k].valueScale = Math.pow(evolutionList[k].value, 0.8); + } + } + } + } + this._intervalX = Math.round(this.component.grid.getWidth() / 40); + }, + _drawEventRiver: function () { + var series = this.series; + for (var i = 0; i < series.length; i++) { + var serieName = series[i].name || ''; + if (series[i].type === this.type && this.selectedMap[serieName]) { + for (var j = 0; j < series[i].eventList.length; j++) { + this._drawEventBubble(series[i].eventList[j], i, j); + } + } + } + }, + _drawEventBubble: function (oneEvent, seriesIndex, dataIndex) { + var series = this.series; + var serie = series[seriesIndex]; + var serieName = serie.name || ''; + var data = serie.eventList[dataIndex]; + var queryTarget = [ + data, + serie + ]; + var legend = this.component.legend; + var defaultColor = legend ? legend.getColor(serieName) : this.zr.getColor(seriesIndex); + var normal = this.deepMerge(queryTarget, 'itemStyle.normal') || {}; + var emphasis = this.deepMerge(queryTarget, 'itemStyle.emphasis') || {}; + var normalColor = this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) || defaultColor; + var emphasisColor = this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data) || (typeof normalColor === 'string' ? zrColor.lift(normalColor, -0.2) : normalColor); + var pts = this._calculateControlPoints(oneEvent); + var eventBubbleShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + clickable: this.deepQuery(queryTarget, 'clickable'), + style: { + pointList: pts, + smooth: 'spline', + brushType: 'both', + lineJoin: 'round', + color: normalColor, + lineWidth: normal.borderWidth, + strokeColor: normal.borderColor + }, + highlightStyle: { + color: emphasisColor, + lineWidth: emphasis.borderWidth, + strokeColor: emphasis.borderColor + }, + draggable: 'vertical', + ondragend: this._ondragend + }; + eventBubbleShape = new PolygonShape(eventBubbleShape); + this.addLabel(eventBubbleShape, serie, data, oneEvent.name); + ecData.pack(eventBubbleShape, series[seriesIndex], seriesIndex, series[seriesIndex].eventList[dataIndex], dataIndex, series[seriesIndex].eventList[dataIndex].name); + this.shapeList.push(eventBubbleShape); + }, + _calculateControlPoints: function (oneEvent) { + var intervalX = this._intervalX; + var posY = oneEvent.y; + var evolution = oneEvent.evolution; + var n = evolution.length; + if (n < 1) { + return; + } + var time = []; + var value = []; + for (var i = 0; i < n; i++) { + time.push(evolution[i].timeScale); + value.push(evolution[i].valueScale); + } + var pts = []; + pts.push([ + time[0], + posY + ]); + var i = 0; + for (i = 0; i < n - 1; i++) { + pts.push([ + (time[i] + time[i + 1]) / 2, + value[i] / -2 + posY + ]); + } + pts.push([ + (time[i] + (time[i] + intervalX)) / 2, + value[i] / -2 + posY + ]); + pts.push([ + time[i] + intervalX, + posY + ]); + pts.push([ + (time[i] + (time[i] + intervalX)) / 2, + value[i] / 2 + posY + ]); + for (i = n - 1; i > 0; i--) { + pts.push([ + (time[i] + time[i - 1]) / 2, + value[i - 1] / 2 + posY + ]); + } + return pts; + }, + ondragend: function (param, status) { + if (!this.isDragend || !param.target) { + return; + } + status.dragOut = true; + status.dragIn = true; + status.needRefresh = false; + this.isDragend = false; + }, + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + this.backupShapeList(); + this._buildShape(); + } + }; + zrUtil.inherits(EventRiver, ChartBase); + require('../chart').define('eventRiver', EventRiver); + return EventRiver; +});define('echarts/layout/eventRiver', ['require'], function (require) { + function eventRiverLayout(series, intervalX, area) { + var space = 5; + var scale = intervalX; + function importanceSort(a, b) { + var x = a.importance; + var y = b.importance; + return x > y ? -1 : x < y ? 1 : 0; + } + function indexOf(array, value) { + if (array.indexOf) { + return array.indexOf(value); + } + for (var i = 0, len = array.length; i < len; i++) { + if (array[i] === value) { + return i; + } + } + return -1; + } + for (var i = 0; i < series.length; i++) { + for (var j = 0; j < series[i].eventList.length; j++) { + if (series[i].eventList[j].weight == null) { + series[i].eventList[j].weight = 1; + } + var importance = 0; + for (var k = 0; k < series[i].eventList[j].evolution.length; k++) { + importance += series[i].eventList[j].evolution[k].valueScale; + } + series[i].eventList[j].importance = importance * series[i].eventList[j].weight; + } + series[i].eventList.sort(importanceSort); + } + for (var i = 0; i < series.length; i++) { + if (series[i].weight == null) { + series[i].weight = 1; + } + var importance = 0; + for (var j = 0; j < series[i].eventList.length; j++) { + importance += series[i].eventList[j].weight; + } + series[i].importance = importance * series[i].weight; + } + series.sort(importanceSort); + var minTime = Number.MAX_VALUE; + var maxTime = 0; + for (var i = 0; i < series.length; i++) { + for (var j = 0; j < series[i].eventList.length; j++) { + for (var k = 0; k < series[i].eventList[j].evolution.length; k++) { + var time = series[i].eventList[j].evolution[k].timeScale; + minTime = Math.min(minTime, time); + maxTime = Math.max(maxTime, time); + } + } + } + var root = segmentTreeBuild(Math.floor(minTime), Math.ceil(maxTime)); + var totalMaxY = 0; + for (var i = 0; i < series.length; i++) { + for (var j = 0; j < series[i].eventList.length; j++) { + var e = series[i].eventList[j]; + e.time = []; + e.value = []; + for (var k = 0; k < series[i].eventList[j].evolution.length; k++) { + e.time.push(series[i].eventList[j].evolution[k].timeScale); + e.value.push(series[i].eventList[j].evolution[k].valueScale); + } + var mxIndex = indexOf(e.value, Math.max.apply(Math, e.value)); + var maxY = segmentTreeQuery(root, e.time[mxIndex], e.time[mxIndex + 1]); + var k = 0; + e.y = maxY + e.value[mxIndex] / 2 + space; + for (k = 0; k < e.time.length - 1; k++) { + var curMaxY = segmentTreeQuery(root, e.time[k], e.time[k + 1]); + if (e.y - e.value[k] / 2 - space < curMaxY) { + e.y = curMaxY + e.value[k] / 2 + space; + } + } + var curMaxY = segmentTreeQuery(root, e.time[k], e.time[k] + scale); + if (e.y - e.value[k] / 2 - space < curMaxY) { + e.y = curMaxY + e.value[k] / 2 + space; + } + series[i].y = e.y; + totalMaxY = Math.max(totalMaxY, e.y + e.value[mxIndex] / 2); + for (k = 0; k < e.time.length - 1; k++) { + segmentTreeInsert(root, e.time[k], e.time[k + 1], e.y + e.value[k] / 2); + } + segmentTreeInsert(root, e.time[k], e.time[k] + scale, e.y + e.value[k] / 2); + } + } + scaleY(series, area, totalMaxY, space); + } + function scaleY(series, area, maxY, space) { + var yBase = area.y; + var yScale = (area.height - space) / maxY; + for (var i = 0; i < series.length; i++) { + series[i].y = series[i].y * yScale + yBase; + var eventList = series[i].eventList; + for (var j = 0; j < eventList.length; j++) { + eventList[j].y = eventList[j].y * yScale + yBase; + var evolutionList = eventList[j].evolution; + for (var k = 0; k < evolutionList.length; k++) { + evolutionList[k].valueScale *= yScale * 1; + } + } + } + } + function segmentTreeBuild(left, right) { + var root = { + 'left': left, + 'right': right, + 'leftChild': null, + 'rightChild': null, + 'maxValue': 0 + }; + if (left + 1 < right) { + var mid = Math.round((left + right) / 2); + root.leftChild = segmentTreeBuild(left, mid); + root.rightChild = segmentTreeBuild(mid, right); + } + return root; + } + function segmentTreeQuery(root, left, right) { + if (right - left < 1) { + return 0; + } + var mid = Math.round((root.left + root.right) / 2); + var result = 0; + if (left == root.left && right == root.right) { + result = root.maxValue; + } else if (right <= mid && root.leftChild != null) { + result = segmentTreeQuery(root.leftChild, left, right); + } else if (left >= mid && root.rightChild != null) { + result = segmentTreeQuery(root.rightChild, left, right); + } else { + var leftValue = 0; + var rightValue = 0; + if (root.leftChild != null) { + leftValue = segmentTreeQuery(root.leftChild, left, mid); + } + if (root.rightChild != null) { + rightValue = segmentTreeQuery(root.rightChild, mid, right); + } + result = leftValue > rightValue ? leftValue : rightValue; + } + return result; + } + function segmentTreeInsert(root, left, right, value) { + if (root == null) { + return; + } + var mid = Math.round((root.left + root.right) / 2); + root.maxValue = root.maxValue > value ? root.maxValue : value; + if (Math.floor(left * 10) == Math.floor(root.left * 10) && Math.floor(right * 10) == Math.floor(root.right * 10)) { + return; + } else if (right <= mid) { + segmentTreeInsert(root.leftChild, left, right, value); + } else if (left >= mid) { + segmentTreeInsert(root.rightChild, left, right, value); + } else { + segmentTreeInsert(root.leftChild, left, mid, value); + segmentTreeInsert(root.rightChild, mid, right, value); + } + } + return eventRiverLayout; +}); +var zrender = require('zrender'); +zrender.tool = { + color : require('zrender/tool/color'), + math : require('zrender/tool/math'), + util : require('zrender/tool/util'), + vector : require('zrender/tool/vector'), + area : require('zrender/tool/area'), + event : require('zrender/tool/event') +} + +zrender.animation = { + Animation : require('zrender/animation/Animation'), + Cip : require('zrender/animation/Clip'), + easing : require('zrender/animation/easing') +} +var echarts = require('echarts'); +echarts.config = require('echarts/config'); + +echarts.util = { + mapData : { + params : require('echarts/util/mapData/params') + } +} + + +require("echarts/chart/line"); + +require("echarts/chart/bar"); + +require("echarts/chart/scatter"); + +require("echarts/chart/k"); + +require("echarts/chart/pie"); + +require("echarts/chart/radar"); + +require("echarts/chart/chord"); + +require("echarts/chart/force"); + +require("echarts/chart/map"); + +require("echarts/chart/gauge"); + +require("echarts/chart/funnel"); + +require("echarts/chart/eventRiver"); + +_global['echarts'] = echarts; +_global['zrender'] = zrender; + +})(window); diff --git a/build/source/echarts.js b/build/source/echarts.js new file mode 100644 index 0000000..558e8b6 --- /dev/null +++ b/build/source/echarts.js @@ -0,0 +1,22079 @@ +/** + * ESL (Enterprise Standard Loader) + * Copyright 2013 Baidu Inc. All rights reserved. + * + * @file Browser端标准加载器,符合AMD规范 + * @author errorrik(errorrik@gmail.com) + * Firede(firede@firede.us) + */ + +/* jshint ignore:start */ +var define; +var require; +var esl; +/* jshint ignore:end */ + +/* eslint-disable guard-for-in */ +/* eslint-env amd:false */ + +(function (global) { + // "mod"开头的变量或函数为内部模块管理函数 + // 为提高压缩率,不使用function或object包装 + + /** + * 模块容器 + * + * @inner + * @type {Object} + */ + var modModules = {}; + + // 模块状态枚举量 + var MODULE_PRE_DEFINED = 1; + var MODULE_ANALYZED = 2; + var MODULE_PREPARED = 3; + var MODULE_DEFINED = 4; + + /** + * 自动定义的模块表 + * + * 模块define factory是用到时才执行,但是以下几种情况需要自动马上执行: + * 1. require([moduleId], callback) + * 2. plugin module and plugin resource: require('plugin!resource') + * 3. shim module + * + * @inner + * @type {Object} + */ + var modAutoDefineModules = {}; + + /** + * 标记模块自动进行定义 + * + * @inner + * @param {string} id 模块id + */ + function modFlagAutoDefine(id) { + if (!modIs(id, MODULE_DEFINED)) { + modAutoDefineModules[id] = 1; + } + } + + /** + * 内建module名称集合 + * + * @inner + * @type {Object} + */ + var BUILDIN_MODULE = { + require: globalRequire, + exports: 1, + module: 1 + }; + + /** + * 全局require函数 + * + * @inner + * @type {Function} + */ + var actualGlobalRequire = createLocalRequire(); + + // #begin-ignore + /** + * 超时提醒定时器 + * + * @inner + * @type {number} + */ + var waitTimeout; + // #end-ignore + + /* eslint-disable fecs-key-spacing */ + /* eslint-disable key-spacing */ + /** + * require配置 + * + * @inner + * @type {Object} + */ + var requireConf = { + baseUrl : './', + paths : {}, + config : {}, + map : {}, + packages : [], + shim : {}, + // #begin-ignore + waitSeconds: 0, + // #end-ignore + bundles : {}, + urlArgs : {} + }; + /* eslint-enable key-spacing */ + + /** + * 加载模块 + * + * @param {string|Array} requireId 模块id或模块id数组, + * @param {Function=} callback 加载完成的回调函数 + * @return {*} requireId为string时返回模块暴露对象 + */ + function globalRequire(requireId, callback) { + // #begin-ignore + // #begin assertNotContainRelativeId + // 确定require的模块id不包含相对id。用于global require,提前预防难以跟踪的错误出现 + var invalidIds = []; + + /** + * 监测模块id是否relative id + * + * @inner + * @param {string} id 模块id + */ + function monitor(id) { + if (id.indexOf('.') === 0) { + invalidIds.push(id); + } + } + + if (typeof requireId === 'string') { + monitor(requireId); + } + else { + each( + requireId, + function (id) { + monitor(id); + } + ); + } + + // 包含相对id时,直接抛出错误 + if (invalidIds.length > 0) { + throw new Error( + '[REQUIRE_FATAL]Relative ID is not allowed in global require: ' + + invalidIds.join(', ') + ); + } + // #end assertNotContainRelativeId + + // 超时提醒 + var timeout = requireConf.waitSeconds; + if (timeout && (requireId instanceof Array)) { + if (waitTimeout) { + clearTimeout(waitTimeout); + } + waitTimeout = setTimeout(waitTimeoutNotice, timeout * 1000); + } + // #end-ignore + + return actualGlobalRequire(requireId, callback); + } + + /** + * 版本号 + * + * @type {string} + */ + globalRequire.version = '2.0.2'; + + /** + * loader名称 + * + * @type {string} + */ + globalRequire.loader = 'esl'; + + /** + * 将模块标识转换成相对的url + * + * @param {string} id 模块标识 + * @return {string} + */ + globalRequire.toUrl = actualGlobalRequire.toUrl; + + // #begin-ignore + /** + * 超时提醒函数 + * + * @inner + */ + function waitTimeoutNotice() { + var hangModules = []; + var missModules = []; + var hangModulesMap = {}; + var missModulesMap = {}; + var visited = {}; + + /** + * 检查模块的加载错误 + * + * @inner + * @param {string} id 模块id + * @param {boolean} hard 是否装载时依赖 + */ + function checkError(id, hard) { + if (visited[id] || modIs(id, MODULE_DEFINED)) { + return; + } + + visited[id] = 1; + + if (!modIs(id, MODULE_PREPARED)) { + // HACK: 为gzip后体积优化,不做抽取 + if (!hangModulesMap[id]) { + hangModulesMap[id] = 1; + hangModules.push(id); + } + } + + var mod = modModules[id]; + if (!mod) { + if (!missModulesMap[id]) { + missModulesMap[id] = 1; + missModules.push(id); + } + } + else if (hard) { + if (!hangModulesMap[id]) { + hangModulesMap[id] = 1; + hangModules.push(id); + } + + each( + mod.depMs, + function (dep) { + checkError(dep.absId, dep.hard); + } + ); + } + } + + for (var id in modAutoDefineModules) { + checkError(id, 1); + } + + if (hangModules.length || missModules.length) { + throw new Error( + '[MODULE_TIMEOUT]Hang( ' + + (hangModules.join(', ') || 'none') + + ' ) Miss( ' + + (missModules.join(', ') || 'none') + + ' )' + ); + } + } + // #end-ignore + + /** + * 未预定义的模块集合 + * 主要存储匿名方式define的模块 + * + * @inner + * @type {Array} + */ + var wait4PreDefine = []; + + /** + * 完成模块预定义,此时处理的模块是匿名define的模块 + * + * @inner + * @param {string} currentId 匿名define的模块的id + */ + function modCompletePreDefine(currentId) { + // HACK: 这里在IE下有个性能陷阱,不能使用任何变量。 + // 否则貌似会形成变量引用和修改的读写锁,导致wait4PreDefine释放困难 + each(wait4PreDefine, function (mod) { + modPreDefine( + currentId, + mod.deps, + mod.factory + ); + }); + + wait4PreDefine.length = 0; + } + + /** + * 定义模块 + * + * @param {string=} id 模块标识 + * @param {Array=} dependencies 依赖模块列表 + * @param {Function=} factory 创建模块的工厂方法 + */ + function globalDefine(id, dependencies, factory) { + // define(factory) + // define(dependencies, factory) + // define(id, factory) + // define(id, dependencies, factory) + if (factory == null) { + if (dependencies == null) { + factory = id; + id = null; + } + else { + factory = dependencies; + dependencies = null; + if (id instanceof Array) { + dependencies = id; + id = null; + } + } + } + + if (factory == null) { + return; + } + + var opera = window.opera; + + // IE下通过current script的data-require-id获取当前id + if ( + !id + && document.attachEvent + && (!(opera && opera.toString() === '[object Opera]')) + ) { + var currentScript = getCurrentScript(); + id = currentScript && currentScript.getAttribute('data-require-id'); + } + + if (id) { + modPreDefine(id, dependencies, factory); + } + else { + // 纪录到共享变量中,在load或readystatechange中处理 + // 标准浏览器下,使用匿名define时,将进入这个分支 + wait4PreDefine[0] = { + deps: dependencies, + factory: factory + }; + } + } + + globalDefine.amd = {}; + + /** + * 模块配置获取函数 + * + * @inner + * @return {Object} 模块配置对象 + */ + function moduleConfigGetter() { + var conf = requireConf.config[this.id]; + if (conf && typeof conf === 'object') { + return conf; + } + + return {}; + } + + /** + * 预定义模块 + * + * @inner + * @param {string} id 模块标识 + * @param {Array.} dependencies 显式声明的依赖模块列表 + * @param {*} factory 模块定义函数或模块对象 + */ + function modPreDefine(id, dependencies, factory) { + // 将模块存入容器 + // + // 模块内部信息包括 + // ----------------------------------- + // id: module id + // depsDec: 模块定义时声明的依赖 + // deps: 模块依赖,默认为['require', 'exports', 'module'] + // factory: 初始化函数或对象 + // factoryDeps: 初始化函数的参数依赖 + // exports: 模块的实际暴露对象(AMD定义) + // config: 用于获取模块配置信息的函数(AMD定义) + // state: 模块当前状态 + // require: local require函数 + // depMs: 实际依赖的模块集合,数组形式 + // depMkv: 实际依赖的模块集合,表形式,便于查找 + // depRs: 实际依赖的资源集合 + // ------------------------------------ + if (!modModules[id]) { + /* eslint-disable key-spacing */ + modModules[id] = { + id : id, + depsDec : dependencies, + deps : dependencies || ['require', 'exports', 'module'], + factoryDeps : [], + factory : factory, + exports : {}, + config : moduleConfigGetter, + state : MODULE_PRE_DEFINED, + require : createLocalRequire(id), + depMs : [], + depMkv : {}, + depRs : [] + }; + /* eslint-enable key-spacing */ + } + } + + /** + * 开始执行模块定义前的准备工作 + * + * 首先,完成对factory中声明依赖的分析提取 + * 然后,尝试加载"资源加载所需模块" + * + * 需要先加载模块的原因是:如果模块不存在,无法进行resourceId normalize化 + * + * @inner + * @param {string} id 模块id + */ + function modPrepare(id) { + var mod = modModules[id]; + if (!mod || modIs(id, MODULE_ANALYZED)) { + return; + } + + var deps = mod.deps; + var factory = mod.factory; + var hardDependsCount = 0; + + // 分析function body中的require + // 如果包含显式依赖声明,根据AMD规定和性能考虑,可以不分析factoryBody + if (typeof factory === 'function') { + hardDependsCount = Math.min(factory.length, deps.length); + + // If the dependencies argument is present, the module loader + // SHOULD NOT scan for dependencies within the factory function. + !mod.depsDec && factory.toString() + .replace(/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg, '') + .replace(/require\(\s*(['"'])([^'"]+)\1\s*\)/g, + function ($0, $1, depId) { + deps.push(depId); + } + ); + } + + var requireModules = []; + var depResources = []; + each(deps, function (depId, index) { + var idInfo = parseId(depId); + var absId = normalize(idInfo.mod, id); + var moduleInfo; + var resInfo; + + if (absId && !BUILDIN_MODULE[absId]) { + // 如果依赖是一个资源,将其信息添加到module.depRs + // + // module.depRs中的项有可能是重复的。 + // 在这个阶段,加载resource的module可能还未defined, + // 导致此时resource id无法被normalize。 + // + // 比如对a/b/c而言,下面几个resource可能指的是同一个资源: + // - js!../name.js + // - js!a/name.js + // - ../../js!../name.js + // + // 所以加载资源的module ready时,需要遍历module.depRs进行处理 + if (idInfo.res) { + resInfo = { + id: depId, + mod: absId, + res: idInfo.res + }; + depResources.push(depId); + mod.depRs.push(resInfo); + } + + // 对依赖模块的id normalize能保证正确性,在此处进行去重 + moduleInfo = mod.depMkv[absId]; + if (!moduleInfo) { + moduleInfo = { + id: idInfo.mod, + absId: absId, + hard: index < hardDependsCount + }; + mod.depMs.push(moduleInfo); + mod.depMkv[absId] = moduleInfo; + requireModules.push(absId); + } + } + else { + moduleInfo = {absId: absId}; + } + + // 如果当前正在分析的依赖项是define中声明的, + // 则记录到module.factoryDeps中 + // 在factory invoke前将用于生成invoke arguments + if (index < hardDependsCount) { + mod.factoryDeps.push(resInfo || moduleInfo); + } + }); + + mod.state = MODULE_ANALYZED; + modInitFactoryInvoker(id); + nativeAsyncRequire(requireModules); + depResources.length && mod.require( + depResources, + function () { + each(mod.depRs, function (res) { + if (!res.absId) { + res.absId = normalize(res.id, id); + } + }); + modAutoDefine(); + } + ); + } + + /** + * 对一些需要自动定义的模块进行自动定义 + * + * @inner + */ + function modAutoDefine() { + for (var id in modAutoDefineModules) { + modPrepare(id); + modUpdatePreparedState(id); + modTryInvokeFactory(id); + } + } + + /** + * 更新模块的准备状态 + * + * @inner + * @param {string} id 模块id + */ + function modUpdatePreparedState(id) { + var visited = {}; + update(id); + + function update(id) { + modPrepare(id); + if (!modIs(id, MODULE_ANALYZED)) { + return false; + } + if (modIs(id, MODULE_PREPARED) || visited[id]) { + return true; + } + + visited[id] = 1; + var mod = modModules[id]; + var prepared = true; + + each( + mod.depMs, + function (dep) { + return (prepared = update(dep.absId)); + } + ); + + // 判断resource是否加载完成。如果resource未加载完成,则认为未准备好 + /* jshint ignore:start */ + prepared && each( + mod.depRs, + function (dep) { + prepared = !!dep.absId; + return prepared; + } + ); + /* jshint ignore:end */ + + if (prepared) { + mod.state = MODULE_PREPARED; + } + + return prepared; + } + } + + /** + * 初始化模块定义时所需的factory执行器 + * + * @inner + * @param {string} id 模块id + */ + function modInitFactoryInvoker(id) { + var mod = modModules[id]; + var invoking; + + mod.invokeFactory = invokeFactory; + + /** + * 初始化模块 + * + * @inner + */ + function invokeFactory() { + if (invoking || mod.state !== MODULE_PREPARED) { + return; + } + + invoking = 1; + + // 拼接factory invoke所需的arguments + var factoryReady = 1; + each( + mod.factoryDeps, + function (dep) { + var depId = dep.absId; + + if (!BUILDIN_MODULE[depId]) { + modTryInvokeFactory(depId); + return (factoryReady = modIs(depId, MODULE_DEFINED)); + } + } + ); + + if (factoryReady) { + try { + // 调用factory函数初始化module + var factory = mod.factory; + var exports = typeof factory === 'function' + ? factory.apply(global, modGetModulesExports( + mod.factoryDeps, + { + require: mod.require, + exports: mod.exports, + module: mod + } + )) + : factory; + + if (exports != null) { + mod.exports = exports; + } + + mod.invokeFactory = null; + } + catch (ex) { + if (/^\[MODULE_MISS\]"([^"]+)/.test(ex.message)) { + // 出错,则说明在factory的运行中,该require的模块是需要的 + // 所以把它加入强依赖中 + var hardCirclurDep = mod.depMkv[RegExp.$1]; + hardCirclurDep && (hardCirclurDep.hard = 1); + + // 如果是模块本身有问题导致的运行错误 + // 就不要把invoking置回去了,避免影响autoInvoke其他模块的初始化 + invoking = 0; + return; + } + + throw ex; + } + + // 完成define + // 不放在try里,避免后续的运行错误被这里吞掉 + modDefined(id); + } + } + } + + /** + * 判断模块是否完成相应的状态 + * + * @inner + * @param {string} id 模块标识 + * @param {number} state 状态码,使用时传入相应的枚举变量,比如`MODULE_DEFINED` + * @return {boolean} 是否完成相应的状态 + */ + function modIs(id, state) { + return modModules[id] && modModules[id].state >= state; + } + + /** + * 尝试执行模块factory函数,进行模块初始化 + * + * @inner + * @param {string} id 模块id + */ + function modTryInvokeFactory(id) { + var mod = modModules[id]; + + if (mod && mod.invokeFactory) { + mod.invokeFactory(); + } + } + + /** + * 根据模块id数组,获取其的exports数组 + * 用于模块初始化的factory参数或require的callback参数生成 + * + * @inner + * @param {Array} modules 模块id数组 + * @param {Object} buildinModules 内建模块对象 + * @return {Array} 模块exports数组 + */ + function modGetModulesExports(modules, buildinModules) { + var args = []; + each( + modules, + function (id, index) { + if (typeof id === 'object') { + id = id.absId; + } + args[index] = buildinModules[id] || modModules[id].exports; + } + ); + + return args; + } + + /** + * 模块定义完成事件监听器容器 + * + * @inner + * @type {Object} + */ + var modDefinedListeners = {}; + + /** + * 添加模块定义完成时间的监听器 + * + * @inner + * @param {string} id 模块标识 + * @param {Function} listener 监听函数 + */ + function modAddDefinedListener(id, listener) { + if (modIs(id, MODULE_DEFINED)) { + listener(); + return; + } + + var listeners = modDefinedListeners[id]; + if (!listeners) { + listeners = modDefinedListeners[id] = []; + } + + listeners.push(listener); + } + + /** + * 模块状态切换为定义完成 + * 因为需要触发事件,MODULE_DEFINED状态切换通过该函数 + * + * @inner + * @param {string} id 模块标识 + */ + function modDefined(id) { + var mod = modModules[id]; + mod.state = MODULE_DEFINED; + delete modAutoDefineModules[id]; + + var listeners = modDefinedListeners[id] || []; + var len = listeners.length; + while (len--) { + // 这里不做function类型的检测 + // 因为listener都是通过modOn传入的,modOn为内部调用 + listeners[len](); + } + + // 清理listeners + listeners.length = 0; + modDefinedListeners[id] = null; + } + + /** + * 异步加载模块 + * 内部使用,模块ID必须是经过normalize的Top-Level ID + * + * @inner + * @param {Array} ids 模块名称或模块名称列表 + * @param {Function=} callback 获取模块完成时的回调函数 + * @param {string} baseId 基础id,用于当ids是relative id时的normalize + */ + function nativeAsyncRequire(ids, callback, baseId) { + var isCallbackCalled = 0; + + each(ids, function (id) { + if (!(BUILDIN_MODULE[id] || modIs(id, MODULE_DEFINED))) { + modAddDefinedListener(id, tryFinishRequire); + (id.indexOf('!') > 0 + ? loadResource + : loadModule + )(id, baseId); + } + }); + tryFinishRequire(); + + /** + * 尝试完成require,调用callback + * 在模块与其依赖模块都加载完时调用 + * + * @inner + */ + function tryFinishRequire() { + if (typeof callback === 'function' && !isCallbackCalled) { + var isAllCompleted = 1; + each(ids, function (id) { + if (!BUILDIN_MODULE[id]) { + return (isAllCompleted = !!modIs(id, MODULE_DEFINED)); + } + }); + + // 检测并调用callback + if (isAllCompleted) { + isCallbackCalled = 1; + + callback.apply( + global, + modGetModulesExports(ids, BUILDIN_MODULE) + ); + } + } + } + } + + /** + * 正在加载的模块列表 + * + * @inner + * @type {Object} + */ + var loadingModules = {}; + + /** + * 加载模块 + * + * @inner + * @param {string} moduleId 模块标识 + */ + function loadModule(moduleId) { + // 加载过的模块,就不要再继续了 + if (loadingModules[moduleId] || modModules[moduleId]) { + return; + } + loadingModules[moduleId] = 1; + + // 初始化相关 shim 的配置 + var shimConf = requireConf.shim[moduleId]; + if (shimConf instanceof Array) { + requireConf.shim[moduleId] = shimConf = { + deps: shimConf + }; + } + + // shim依赖的模块需要自动标识为shim + // 无论是纯正的shim模块还是hybird模块 + var shimDeps = shimConf && (shimConf.deps || []); + if (shimDeps) { + each(shimDeps, function (dep) { + if (!requireConf.shim[dep]) { + requireConf.shim[dep] = {}; + } + }); + actualGlobalRequire(shimDeps, load); + } + else { + load(); + } + + /** + * 发送请求去加载模块 + * + * @inner + */ + function load() { + /* eslint-disable no-use-before-define */ + var bundleModuleId = bundlesIndex[moduleId]; + createScript(bundleModuleId || moduleId, loaded); + /* eslint-enable no-use-before-define */ + } + + /** + * script标签加载完成的事件处理函数 + * + * @inner + */ + function loaded() { + if (shimConf) { + var exports; + if (typeof shimConf.init === 'function') { + exports = shimConf.init.apply( + global, + modGetModulesExports(shimDeps, BUILDIN_MODULE) + ); + } + + if (exports == null && shimConf.exports) { + exports = global; + each( + shimConf.exports.split('.'), + function (prop) { + exports = exports[prop]; + return !!exports; + } + ); + } + + globalDefine(moduleId, shimDeps, exports || {}); + } + else { + modCompletePreDefine(moduleId); + } + + modAutoDefine(); + } + } + + /** + * 加载资源 + * + * @inner + * @param {string} pluginAndResource 插件与资源标识 + * @param {string} baseId 当前环境的模块标识 + */ + function loadResource(pluginAndResource, baseId) { + if (modModules[pluginAndResource]) { + return; + } + + /* eslint-disable no-use-before-define */ + var bundleModuleId = bundlesIndex[pluginAndResource]; + if (bundleModuleId) { + loadModule(bundleModuleId); + return; + } + /* eslint-enable no-use-before-define */ + + var idInfo = parseId(pluginAndResource); + var resource = { + id: pluginAndResource, + state: MODULE_ANALYZED + }; + modModules[pluginAndResource] = resource; + + /** + * plugin加载完成的回调函数 + * + * @inner + * @param {*} value resource的值 + */ + function pluginOnload(value) { + resource.exports = value || true; + modDefined(pluginAndResource); + } + + /* jshint ignore:start */ + /** + * 该方法允许plugin使用加载的资源声明模块 + * + * @param {string} id 模块id + * @param {string} text 模块声明字符串 + */ + pluginOnload.fromText = function (id, text) { + new Function(text)(); + modCompletePreDefine(id); + }; + /* jshint ignore:end */ + + /** + * 加载资源 + * + * @inner + * @param {Object} plugin 用于加载资源的插件模块 + */ + function load(plugin) { + var pluginRequire = baseId + ? modModules[baseId].require + : actualGlobalRequire; + + plugin.load( + idInfo.res, + pluginRequire, + pluginOnload, + moduleConfigGetter.call({id: pluginAndResource}) + ); + } + + load(actualGlobalRequire(idInfo.mod)); + } + + /** + * 配置require + * + * @param {Object} conf 配置对象 + */ + globalRequire.config = function (conf) { + if (conf) { + for (var key in requireConf) { + var newValue = conf[key]; + var oldValue = requireConf[key]; + + if (!newValue) { + continue; + } + + if (key === 'urlArgs' && typeof newValue === 'string') { + requireConf.urlArgs['*'] = newValue; + } + else { + // 简单的多处配置还是需要支持,所以配置实现为支持二级mix + if (oldValue instanceof Array) { + oldValue.push.apply(oldValue, newValue); + } + else if (typeof oldValue === 'object') { + for (var k in newValue) { + oldValue[k] = newValue[k]; + } + } + else { + requireConf[key] = newValue; + } + } + } + + createConfIndex(); + } + }; + + // 初始化时需要创建配置索引 + createConfIndex(); + + /** + * paths内部索引 + * + * @inner + * @type {Array} + */ + var pathsIndex; + + /** + * packages内部索引 + * + * @inner + * @type {Array} + */ + var packagesIndex; + + /** + * mapping内部索引 + * + * @inner + * @type {Array} + */ + var mappingIdIndex; + + /** + * bundles内部索引 + * + * @inner + * @type {Object} + */ + var bundlesIndex; + + /** + * urlArgs内部索引 + * + * @inner + * @type {Array} + */ + var urlArgsIndex; + + /** + * 将key为module id prefix的Object,生成数组形式的索引,并按照长度和字面排序 + * + * @inner + * @param {Object} value 源值 + * @param {boolean} allowAsterisk 是否允许*号表示匹配所有 + * @return {Array} 索引对象 + */ + function createKVSortedIndex(value, allowAsterisk) { + var index = kv2List(value, 1, allowAsterisk); + index.sort(descSorterByKOrName); + return index; + } + + /** + * 创建配置信息内部索引 + * + * @inner + */ + function createConfIndex() { + requireConf.baseUrl = requireConf.baseUrl.replace(/\/$/, '') + '/'; + + // create paths index + pathsIndex = createKVSortedIndex(requireConf.paths); + + // create mappingId index + mappingIdIndex = createKVSortedIndex(requireConf.map, 1); + each( + mappingIdIndex, + function (item) { + item.v = createKVSortedIndex(item.v); + } + ); + + // create packages index + packagesIndex = []; + each( + requireConf.packages, + function (packageConf) { + var pkg = packageConf; + if (typeof packageConf === 'string') { + pkg = { + name: packageConf.split('/')[0], + location: packageConf, + main: 'main' + }; + } + + pkg.location = pkg.location || pkg.name; + pkg.main = (pkg.main || 'main').replace(/\.js$/i, ''); + pkg.reg = createPrefixRegexp(pkg.name); + packagesIndex.push(pkg); + } + ); + packagesIndex.sort(descSorterByKOrName); + + // create urlArgs index + urlArgsIndex = createKVSortedIndex(requireConf.urlArgs, 1); + + // create bundles index + bundlesIndex = {}; + /* eslint-disable no-use-before-define */ + function bundlesIterator(id) { + bundlesIndex[id] = key; + } + /* eslint-enable no-use-before-define */ + for (var key in requireConf.bundles) { + each(requireConf.bundles[key], bundlesIterator); + } + } + + /** + * 对配置信息的索引进行检索 + * + * @inner + * @param {string} value 要检索的值 + * @param {Array} index 索引对象 + * @param {Function} hitBehavior 索引命中的行为函数 + */ + function indexRetrieve(value, index, hitBehavior) { + each(index, function (item) { + if (item.reg.test(value)) { + hitBehavior(item.v, item.k, item); + return false; + } + }); + } + + /** + * 将`模块标识+'.extension'`形式的字符串转换成相对的url + * + * @inner + * @param {string} source 源字符串 + * @return {string} url + */ + function toUrl(source) { + // 分离 模块标识 和 .extension + var extReg = /(\.[a-z0-9]+)$/i; + var queryReg = /(\?[^#]*)$/; + var extname = ''; + var id = source; + var query = ''; + + if (queryReg.test(source)) { + query = RegExp.$1; + source = source.replace(queryReg, ''); + } + + if (extReg.test(source)) { + extname = RegExp.$1; + id = source.replace(extReg, ''); + } + + var url = id; + + // paths处理和匹配 + var isPathMap; + indexRetrieve(id, pathsIndex, function (value, key) { + url = url.replace(key, value); + isPathMap = 1; + }); + + // packages处理和匹配 + if (!isPathMap) { + indexRetrieve(id, packagesIndex, function (value, key, item) { + url = url.replace(item.name, item.location); + }); + } + + // 相对路径时,附加baseUrl + if (!/^([a-z]{2,10}:\/)?\//i.test(url)) { + url = requireConf.baseUrl + url; + } + + // 附加 .extension 和 query + url += extname + query; + + // urlArgs处理和匹配 + indexRetrieve(id, urlArgsIndex, function (value) { + url += (url.indexOf('?') > 0 ? '&' : '?') + value; + }); + + return url; + } + + /** + * 创建local require函数 + * + * @inner + * @param {number} baseId 当前module id + * @return {Function} local require函数 + */ + function createLocalRequire(baseId) { + var requiredCache = {}; + + function req(requireId, callback) { + if (typeof requireId === 'string') { + if (!requiredCache[requireId]) { + var topLevelId = normalize(requireId, baseId); + + // 根据 https://github.com/amdjs/amdjs-api/wiki/require + // It MUST throw an error if the module has not + // already been loaded and evaluated. + modTryInvokeFactory(topLevelId); + if (!modIs(topLevelId, MODULE_DEFINED)) { + throw new Error('[MODULE_MISS]"' + topLevelId + '" is not exists!'); + } + + requiredCache[requireId] = modModules[topLevelId].exports; + } + + return requiredCache[requireId]; + } + else if (requireId instanceof Array) { + // 分析是否有resource,取出pluginModule先 + var pureModules = []; + var normalizedIds = []; + + each( + requireId, + function (id, i) { + var idInfo = parseId(id); + var absId = normalize(idInfo.mod, baseId); + var resId = idInfo.res; + var normalizedId = absId; + + if (resId) { + var trueResId = absId + '!' + resId; + if (resId.indexOf('.') !== 0 && bundlesIndex[trueResId]) { + absId = normalizedId = trueResId; + } + else { + normalizedId = null; + } + } + + normalizedIds[i] = normalizedId; + modFlagAutoDefine(absId); + pureModules.push(absId); + } + ); + + // 加载模块 + nativeAsyncRequire( + pureModules, + function () { + /* jshint ignore:start */ + each(normalizedIds, function (id, i) { + if (id == null) { + id = normalizedIds[i] = normalize(requireId[i], baseId); + modFlagAutoDefine(id); + } + }); + /* jshint ignore:end */ + + // modAutoDefine中,factory invoke可能发生错误 + // 从而导致nativeAsyncRequire没有被调用,callback没挂上 + // 所以nativeAsyncRequire要先运行 + nativeAsyncRequire(normalizedIds, callback, baseId); + modAutoDefine(); + }, + baseId + ); + modAutoDefine(); + } + } + + /** + * 将[module ID] + '.extension'格式的字符串转换成url + * + * @inner + * @param {string} id 符合描述格式的源字符串 + * @return {string} url + */ + req.toUrl = function (id) { + return toUrl(normalize(id, baseId)); + }; + + return req; + } + + /** + * id normalize化 + * + * @inner + * @param {string} id 需要normalize的模块标识 + * @param {string} baseId 当前环境的模块标识 + * @return {string} normalize结果 + */ + function normalize(id, baseId) { + if (!id) { + return ''; + } + + baseId = baseId || ''; + var idInfo = parseId(id); + if (!idInfo) { + return id; + } + + var resourceId = idInfo.res; + var moduleId = relative2absolute(idInfo.mod, baseId); + + each( + packagesIndex, + function (packageConf) { + var name = packageConf.name; + if (name === moduleId) { + moduleId = name + '/' + packageConf.main; + return false; + } + } + ); + + // 根据config中的map配置进行module id mapping + indexRetrieve( + baseId, + mappingIdIndex, + function (value) { + indexRetrieve( + moduleId, + value, + function (mdValue, mdKey) { + moduleId = moduleId.replace(mdKey, mdValue); + } + ); + } + ); + + if (resourceId) { + var mod = modIs(moduleId, MODULE_DEFINED) && actualGlobalRequire(moduleId); + resourceId = mod && mod.normalize + ? mod.normalize( + resourceId, + function (resId) { + return normalize(resId, baseId); + } + ) + : normalize(resourceId, baseId); + + moduleId += '!' + resourceId; + } + + return moduleId; + } + + /** + * 相对id转换成绝对id + * + * @inner + * @param {string} id 要转换的相对id + * @param {string} baseId 当前所在环境id + * @return {string} 绝对id + */ + function relative2absolute(id, baseId) { + if (id.indexOf('.') === 0) { + var basePath = baseId.split('/'); + var namePath = id.split('/'); + var baseLen = basePath.length - 1; + var nameLen = namePath.length; + var cutBaseTerms = 0; + var cutNameTerms = 0; + + /* eslint-disable block-scoped-var */ + pathLoop: for (var i = 0; i < nameLen; i++) { + switch (namePath[i]) { + case '..': + if (cutBaseTerms < baseLen) { + cutBaseTerms++; + cutNameTerms++; + } + else { + break pathLoop; + } + break; + case '.': + cutNameTerms++; + break; + default: + break pathLoop; + } + } + /* eslint-enable block-scoped-var */ + + basePath.length = baseLen - cutBaseTerms; + namePath = namePath.slice(cutNameTerms); + + return basePath.concat(namePath).join('/'); + } + + return id; + } + + /** + * 解析id,返回带有module和resource属性的Object + * + * @inner + * @param {string} id 标识 + * @return {Object} id解析结果对象 + */ + function parseId(id) { + var segs = id.split('!'); + + if (segs[0]) { + return { + mod: segs[0], + res: segs[1] + }; + } + } + + /** + * 将对象数据转换成数组,数组每项是带有k和v的Object + * + * @inner + * @param {Object} source 对象数据 + * @param {boolean} keyMatchable key是否允许被前缀匹配 + * @param {boolean} allowAsterisk 是否支持*匹配所有 + * @return {Array.} 对象转换数组 + */ + function kv2List(source, keyMatchable, allowAsterisk) { + var list = []; + for (var key in source) { + if (source.hasOwnProperty(key)) { + var item = { + k: key, + v: source[key] + }; + list.push(item); + + if (keyMatchable) { + item.reg = key === '*' && allowAsterisk + ? /^/ + : createPrefixRegexp(key); + } + } + } + + return list; + } + + // 感谢requirejs,通过currentlyAddingScript兼容老旧ie + // + // For some cache cases in IE 6-8, the script executes before the end + // of the appendChild execution, so to tie an anonymous define + // call to the module name (which is stored on the node), hold on + // to a reference to this node, but clear after the DOM insertion. + var currentlyAddingScript; + var interactiveScript; + + /** + * 获取当前script标签 + * 用于ie下define未指定module id时获取id + * + * @inner + * @return {HTMLScriptElement} 当前script标签 + */ + function getCurrentScript() { + if (currentlyAddingScript) { + return currentlyAddingScript; + } + else if ( + interactiveScript + && interactiveScript.readyState === 'interactive' + ) { + return interactiveScript; + } + + var scripts = document.getElementsByTagName('script'); + var scriptLen = scripts.length; + while (scriptLen--) { + var script = scripts[scriptLen]; + if (script.readyState === 'interactive') { + interactiveScript = script; + return script; + } + } + } + + var headElement = document.getElementsByTagName('head')[0]; + var baseElement = document.getElementsByTagName('base')[0]; + if (baseElement) { + headElement = baseElement.parentNode; + } + + function createScript(moduleId, onload) { + // 创建script标签 + // + // 这里不挂接onerror的错误处理 + // 因为高级浏览器在devtool的console面板会报错 + // 再throw一个Error多此一举了 + var script = document.createElement('script'); + script.setAttribute('data-require-id', moduleId); + script.src = toUrl(moduleId + '.js'); + script.async = true; + if (script.readyState) { + script.onreadystatechange = innerOnload; + } + else { + script.onload = innerOnload; + } + + function innerOnload() { + var readyState = script.readyState; + if ( + typeof readyState === 'undefined' + || /^(loaded|complete)$/.test(readyState) + ) { + script.onload = script.onreadystatechange = null; + script = null; + + onload(); + } + } + currentlyAddingScript = script; + + // If BASE tag is in play, using appendChild is a problem for IE6. + // See: http://dev.jquery.com/ticket/2709 + baseElement + ? headElement.insertBefore(script, baseElement) + : headElement.appendChild(script); + + currentlyAddingScript = null; + } + + /** + * 创建id前缀匹配的正则对象 + * + * @inner + * @param {string} prefix id前缀 + * @return {RegExp} 前缀匹配的正则对象 + */ + function createPrefixRegexp(prefix) { + return new RegExp('^' + prefix + '(/|$)'); + } + + /** + * 循环遍历数组集合 + * + * @inner + * @param {Array} source 数组源 + * @param {function(Array,Number):boolean} iterator 遍历函数 + */ + function each(source, iterator) { + if (source instanceof Array) { + for (var i = 0, len = source.length; i < len; i++) { + if (iterator(source[i], i) === false) { + break; + } + } + } + } + + /** + * 根据元素的k或name项进行数组字符数逆序的排序函数 + * + * @inner + * @param {Object} a 要比较的对象a + * @param {Object} b 要比较的对象b + * @return {number} 比较结果 + */ + function descSorterByKOrName(a, b) { + var aValue = a.k || a.name; + var bValue = b.k || b.name; + + if (bValue === '*') { + return -1; + } + + if (aValue === '*') { + return 1; + } + + return bValue.length - aValue.length; + } + + // 暴露全局对象 + if (!define) { + define = globalDefine; + + // 可能碰到其他形式的loader,所以,不要覆盖人家 + if (!require) { + require = globalRequire; + } + + // 如果存在其他版本的esl,在define那里就判断过了,不会进入这个分支 + // 所以这里就不判断了,直接写 + esl = globalRequire; + } +})(this); +define('echarts', ['echarts/echarts'], function (main) {return main;}); +define('echarts/echarts', [ + 'require', + './config', + 'zrender/tool/util', + 'zrender/tool/event', + 'zrender/tool/env', + 'zrender', + 'zrender/config', + './chart/island', + './component/toolbox', + './component', + './component/title', + './component/tooltip', + './component/legend', + './util/ecData', + './chart', + 'zrender/tool/color', + './component/timeline', + 'zrender/shape/Image', + 'zrender/loadingEffect/Bar', + 'zrender/loadingEffect/Bubble', + 'zrender/loadingEffect/DynamicLine', + 'zrender/loadingEffect/Ring', + 'zrender/loadingEffect/Spin', + 'zrender/loadingEffect/Whirling', + './theme/macarons', + './theme/infographic' +], function (require) { + var ecConfig = require('./config'); + var zrUtil = require('zrender/tool/util'); + var zrEvent = require('zrender/tool/event'); + var self = {}; + var _canvasSupported = require('zrender/tool/env').canvasSupported; + var _idBase = new Date() - 0; + var _instances = {}; + var DOM_ATTRIBUTE_KEY = '_echarts_instance_'; + self.version = '2.2.0'; + self.dependencies = { zrender: '2.0.7' }; + self.init = function (dom, theme) { + var zrender = require('zrender'); + if (zrender.version.replace('.', '') - 0 < self.dependencies.zrender.replace('.', '') - 0) { + console.error('ZRender ' + zrender.version + ' is too old for ECharts ' + self.version + '. Current version need ZRender ' + self.dependencies.zrender + '+'); + } + dom = dom instanceof Array ? dom[0] : dom; + var key = dom.getAttribute(DOM_ATTRIBUTE_KEY); + if (!key) { + key = _idBase++; + dom.setAttribute(DOM_ATTRIBUTE_KEY, key); + } + if (_instances[key]) { + _instances[key].dispose(); + } + _instances[key] = new Echarts(dom); + _instances[key].id = key; + _instances[key].canvasSupported = _canvasSupported; + _instances[key].setTheme(theme); + return _instances[key]; + }; + self.getInstanceById = function (key) { + return _instances[key]; + }; + function MessageCenter() { + zrEvent.Dispatcher.call(this); + } + zrUtil.merge(MessageCenter.prototype, zrEvent.Dispatcher.prototype, true); + function Echarts(dom) { + dom.innerHTML = ''; + this._themeConfig = {}; + this.dom = dom; + this._connected = false; + this._status = { + dragIn: false, + dragOut: false, + needRefresh: false + }; + this._curEventType = false; + this._chartList = []; + this._messageCenter = new MessageCenter(); + this._messageCenterOutSide = new MessageCenter(); + this.resize = this.resize(); + this._init(); + } + var ZR_EVENT = require('zrender/config').EVENT; + var ZR_EVENT_LISTENS = [ + 'CLICK', + 'DBLCLICK', + 'MOUSEOVER', + 'MOUSEOUT', + 'DRAGSTART', + 'DRAGEND', + 'DRAGENTER', + 'DRAGOVER', + 'DRAGLEAVE', + 'DROP' + ]; + function callChartListMethodReverse(ecInstance, methodName, arg0, arg1, arg2) { + var chartList = ecInstance._chartList; + var len = chartList.length; + while (len--) { + var chart = chartList[len]; + if (typeof chart[methodName] === 'function') { + chart[methodName](arg0, arg1, arg2); + } + } + } + Echarts.prototype = { + _init: function () { + var self = this; + var _zr = require('zrender').init(this.dom); + this._zr = _zr; + this._messageCenter.dispatch = function (type, event, eventPackage, that) { + eventPackage = eventPackage || {}; + eventPackage.type = type; + eventPackage.event = event; + self._messageCenter.dispatchWithContext(type, eventPackage, that); + if (type != 'HOVER' && type != 'MOUSEOUT') { + setTimeout(function () { + self._messageCenterOutSide.dispatchWithContext(type, eventPackage, that); + }, 50); + } else { + self._messageCenterOutSide.dispatchWithContext(type, eventPackage, that); + } + }; + this._onevent = function (param) { + return self.__onevent(param); + }; + for (var e in ecConfig.EVENT) { + if (e != 'CLICK' && e != 'DBLCLICK' && e != 'HOVER' && e != 'MOUSEOUT' && e != 'MAP_ROAM') { + this._messageCenter.bind(ecConfig.EVENT[e], this._onevent, this); + } + } + var eventBehaviors = {}; + this._onzrevent = function (param) { + return self[eventBehaviors[param.type]](param); + }; + for (var i = 0, len = ZR_EVENT_LISTENS.length; i < len; i++) { + var eventName = ZR_EVENT_LISTENS[i]; + var eventValue = ZR_EVENT[eventName]; + eventBehaviors[eventValue] = '_on' + eventName.toLowerCase(); + _zr.on(eventValue, this._onzrevent); + } + this.chart = {}; + this.component = {}; + var Island = require('./chart/island'); + this._island = new Island(this._themeConfig, this._messageCenter, _zr, {}, this); + this.chart.island = this._island; + var Toolbox = require('./component/toolbox'); + this._toolbox = new Toolbox(this._themeConfig, this._messageCenter, _zr, {}, this); + this.component.toolbox = this._toolbox; + var componentLibrary = require('./component'); + componentLibrary.define('title', require('./component/title')); + componentLibrary.define('tooltip', require('./component/tooltip')); + componentLibrary.define('legend', require('./component/legend')); + if (_zr.getWidth() === 0 || _zr.getHeight() === 0) { + console.error('Dom’s width & height should be ready before init.'); + } + }, + __onevent: function (param) { + param.__echartsId = param.__echartsId || this.id; + var fromMyself = param.__echartsId === this.id; + if (!this._curEventType) { + this._curEventType = param.type; + } + switch (param.type) { + case ecConfig.EVENT.LEGEND_SELECTED: + this._onlegendSelected(param); + break; + case ecConfig.EVENT.DATA_ZOOM: + if (!fromMyself) { + var dz = this.component.dataZoom; + if (dz) { + dz.silence(true); + dz.absoluteZoom(param.zoom); + dz.silence(false); + } + } + this._ondataZoom(param); + break; + case ecConfig.EVENT.DATA_RANGE: + fromMyself && this._ondataRange(param); + break; + case ecConfig.EVENT.MAGIC_TYPE_CHANGED: + if (!fromMyself) { + var tb = this.component.toolbox; + if (tb) { + tb.silence(true); + tb.setMagicType(param.magicType); + tb.silence(false); + } + } + this._onmagicTypeChanged(param); + break; + case ecConfig.EVENT.DATA_VIEW_CHANGED: + fromMyself && this._ondataViewChanged(param); + break; + case ecConfig.EVENT.TOOLTIP_HOVER: + fromMyself && this._tooltipHover(param); + break; + case ecConfig.EVENT.RESTORE: + this._onrestore(); + break; + case ecConfig.EVENT.REFRESH: + fromMyself && this._onrefresh(param); + break; + case ecConfig.EVENT.TOOLTIP_IN_GRID: + case ecConfig.EVENT.TOOLTIP_OUT_GRID: + if (!fromMyself) { + var grid = this.component.grid; + if (grid) { + this._zr.trigger('mousemove', { + connectTrigger: true, + zrenderX: grid.getX() + param.x * grid.getWidth(), + zrenderY: grid.getY() + param.y * grid.getHeight() + }); + } + } else if (this._connected) { + var grid = this.component.grid; + if (grid) { + param.x = (param.event.zrenderX - grid.getX()) / grid.getWidth(); + param.y = (param.event.zrenderY - grid.getY()) / grid.getHeight(); + } + } + break; + } + if (this._connected && fromMyself && this._curEventType === param.type) { + for (var c in this._connected) { + this._connected[c].connectedEventHandler(param); + } + this._curEventType = null; + } + if (!fromMyself || !this._connected && fromMyself) { + this._curEventType = null; + } + }, + _onclick: function (param) { + callChartListMethodReverse(this, 'onclick', param); + if (param.target) { + var ecData = this._eventPackage(param.target); + if (ecData && ecData.seriesIndex != null) { + this._messageCenter.dispatch(ecConfig.EVENT.CLICK, param.event, ecData, this); + } + } + }, + _ondblclick: function (param) { + callChartListMethodReverse(this, 'ondblclick', param); + if (param.target) { + var ecData = this._eventPackage(param.target); + if (ecData && ecData.seriesIndex != null) { + this._messageCenter.dispatch(ecConfig.EVENT.DBLCLICK, param.event, ecData, this); + } + } + }, + _onmouseover: function (param) { + if (param.target) { + var ecData = this._eventPackage(param.target); + if (ecData && ecData.seriesIndex != null) { + this._messageCenter.dispatch(ecConfig.EVENT.HOVER, param.event, ecData, this); + } + } + }, + _onmouseout: function (param) { + if (param.target) { + var ecData = this._eventPackage(param.target); + if (ecData && ecData.seriesIndex != null) { + this._messageCenter.dispatch(ecConfig.EVENT.MOUSEOUT, param.event, ecData, this); + } + } + }, + _ondragstart: function (param) { + this._status = { + dragIn: false, + dragOut: false, + needRefresh: false + }; + callChartListMethodReverse(this, 'ondragstart', param); + }, + _ondragenter: function (param) { + callChartListMethodReverse(this, 'ondragenter', param); + }, + _ondragover: function (param) { + callChartListMethodReverse(this, 'ondragover', param); + }, + _ondragleave: function (param) { + callChartListMethodReverse(this, 'ondragleave', param); + }, + _ondrop: function (param) { + callChartListMethodReverse(this, 'ondrop', param, this._status); + this._island.ondrop(param, this._status); + }, + _ondragend: function (param) { + callChartListMethodReverse(this, 'ondragend', param, this._status); + this._timeline && this._timeline.ondragend(param, this._status); + this._island.ondragend(param, this._status); + if (this._status.needRefresh) { + this._syncBackupData(this._option); + var messageCenter = this._messageCenter; + messageCenter.dispatch(ecConfig.EVENT.DATA_CHANGED, param.event, this._eventPackage(param.target), this); + messageCenter.dispatch(ecConfig.EVENT.REFRESH, null, null, this); + } + }, + _onlegendSelected: function (param) { + this._status.needRefresh = false; + callChartListMethodReverse(this, 'onlegendSelected', param, this._status); + if (this._status.needRefresh) { + this._messageCenter.dispatch(ecConfig.EVENT.REFRESH, null, null, this); + } + }, + _ondataZoom: function (param) { + this._status.needRefresh = false; + callChartListMethodReverse(this, 'ondataZoom', param, this._status); + if (this._status.needRefresh) { + this._messageCenter.dispatch(ecConfig.EVENT.REFRESH, null, null, this); + } + }, + _ondataRange: function (param) { + this._clearEffect(); + this._status.needRefresh = false; + callChartListMethodReverse(this, 'ondataRange', param, this._status); + if (this._status.needRefresh) { + this._zr.refreshNextFrame(); + } + }, + _onmagicTypeChanged: function () { + this._clearEffect(); + this._render(this._toolbox.getMagicOption()); + }, + _ondataViewChanged: function (param) { + this._syncBackupData(param.option); + this._messageCenter.dispatch(ecConfig.EVENT.DATA_CHANGED, null, param, this); + this._messageCenter.dispatch(ecConfig.EVENT.REFRESH, null, null, this); + }, + _tooltipHover: function (param) { + var tipShape = []; + callChartListMethodReverse(this, 'ontooltipHover', param, tipShape); + }, + _onrestore: function () { + this.restore(); + }, + _onrefresh: function (param) { + this._refreshInside = true; + this.refresh(param); + this._refreshInside = false; + }, + _syncBackupData: function (curOption) { + this.component.dataZoom && this.component.dataZoom.syncBackupData(curOption); + }, + _eventPackage: function (target) { + if (target) { + var ecData = require('./util/ecData'); + var seriesIndex = ecData.get(target, 'seriesIndex'); + var dataIndex = ecData.get(target, 'dataIndex'); + dataIndex = seriesIndex != -1 && this.component.dataZoom ? this.component.dataZoom.getRealDataIndex(seriesIndex, dataIndex) : dataIndex; + return { + seriesIndex: seriesIndex, + seriesName: (ecData.get(target, 'series') || {}).name, + dataIndex: dataIndex, + data: ecData.get(target, 'data'), + name: ecData.get(target, 'name'), + value: ecData.get(target, 'value'), + special: ecData.get(target, 'special') + }; + } + return; + }, + _noDataCheck: function (magicOption) { + var series = magicOption.series; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type == ecConfig.CHART_TYPE_MAP || series[i].data && series[i].data.length > 0 || series[i].markPoint && series[i].markPoint.data && series[i].markPoint.data.length > 0 || series[i].markLine && series[i].markLine.data && series[i].markLine.data.length > 0 || series[i].nodes && series[i].nodes.length > 0 || series[i].links && series[i].links.length > 0 || series[i].matrix && series[i].matrix.length > 0 || series[i].eventList && series[i].eventList.length > 0) { + return false; + } + } + this.clear(); + var loadOption = this._option && this._option.noDataLoadingOption || this._themeConfig.noDataLoadingOption || ecConfig.noDataLoadingOption || { + text: this._option && this._option.noDataText || this._themeConfig.noDataText || ecConfig.noDataText, + effect: this._option && this._option.noDataEffect || this._themeConfig.noDataEffect || ecConfig.noDataEffect + }; + this.showLoading(loadOption); + return true; + }, + _render: function (magicOption) { + this._mergeGlobalConifg(magicOption); + if (this._noDataCheck(magicOption)) { + return; + } + var bgColor = magicOption.backgroundColor; + if (bgColor) { + if (!_canvasSupported && bgColor.indexOf('rgba') != -1) { + var cList = bgColor.split(','); + this.dom.style.filter = 'alpha(opacity=' + cList[3].substring(0, cList[3].lastIndexOf(')')) * 100 + ')'; + cList.length = 3; + cList[0] = cList[0].replace('a', ''); + this.dom.style.backgroundColor = cList.join(',') + ')'; + } else { + this.dom.style.backgroundColor = bgColor; + } + } + this._zr.clearAnimation(); + this._chartList = []; + var chartLibrary = require('./chart'); + var componentLibrary = require('./component'); + if (magicOption.xAxis || magicOption.yAxis) { + magicOption.grid = magicOption.grid || {}; + magicOption.dataZoom = magicOption.dataZoom || {}; + } + var componentList = [ + 'title', + 'legend', + 'tooltip', + 'dataRange', + 'roamController', + 'grid', + 'dataZoom', + 'xAxis', + 'yAxis', + 'polar' + ]; + var ComponentClass; + var componentType; + var component; + for (var i = 0, l = componentList.length; i < l; i++) { + componentType = componentList[i]; + component = this.component[componentType]; + if (magicOption[componentType]) { + if (component) { + component.refresh && component.refresh(magicOption); + } else { + ComponentClass = componentLibrary.get(/^[xy]Axis$/.test(componentType) ? 'axis' : componentType); + component = new ComponentClass(this._themeConfig, this._messageCenter, this._zr, magicOption, this, componentType); + this.component[componentType] = component; + } + this._chartList.push(component); + } else if (component) { + component.dispose(); + this.component[componentType] = null; + delete this.component[componentType]; + } + } + var ChartClass; + var chartType; + var chart; + var chartMap = {}; + for (var i = 0, l = magicOption.series.length; i < l; i++) { + chartType = magicOption.series[i].type; + if (!chartType) { + console.error('series[' + i + '] chart type has not been defined.'); + continue; + } + if (!chartMap[chartType]) { + chartMap[chartType] = true; + ChartClass = chartLibrary.get(chartType); + if (ChartClass) { + if (this.chart[chartType]) { + chart = this.chart[chartType]; + chart.refresh(magicOption); + } else { + chart = new ChartClass(this._themeConfig, this._messageCenter, this._zr, magicOption, this); + } + this._chartList.push(chart); + this.chart[chartType] = chart; + } else { + console.error(chartType + ' has not been required.'); + } + } + } + for (chartType in this.chart) { + if (chartType != ecConfig.CHART_TYPE_ISLAND && !chartMap[chartType]) { + this.chart[chartType].dispose(); + this.chart[chartType] = null; + delete this.chart[chartType]; + } + } + this.component.grid && this.component.grid.refixAxisShape(this.component); + this._island.refresh(magicOption); + this._toolbox.refresh(magicOption); + magicOption.animation && !magicOption.renderAsImage ? this._zr.refresh() : this._zr.render(); + var imgId = 'IMG' + this.id; + var img = document.getElementById(imgId); + if (magicOption.renderAsImage && _canvasSupported) { + if (img) { + img.src = this.getDataURL(magicOption.renderAsImage); + } else { + img = this.getImage(magicOption.renderAsImage); + img.id = imgId; + img.style.position = 'absolute'; + img.style.left = 0; + img.style.top = 0; + this.dom.firstChild.appendChild(img); + } + this.un(); + this._zr.un(); + this._disposeChartList(); + this._zr.clear(); + } else if (img) { + img.parentNode.removeChild(img); + } + img = null; + this._option = magicOption; + }, + restore: function () { + this._clearEffect(); + this._option = zrUtil.clone(this._optionRestore); + this._disposeChartList(); + this._island.clear(); + this._toolbox.reset(this._option, true); + this._render(this._option); + }, + refresh: function (param) { + this._clearEffect(); + param = param || {}; + var magicOption = param.option; + if (!this._refreshInside && magicOption) { + magicOption = this.getOption(); + zrUtil.merge(magicOption, param.option, true); + zrUtil.merge(this._optionRestore, param.option, true); + this._toolbox.reset(magicOption); + } + this._island.refresh(magicOption); + this._toolbox.refresh(magicOption); + this._zr.clearAnimation(); + for (var i = 0, l = this._chartList.length; i < l; i++) { + this._chartList[i].refresh && this._chartList[i].refresh(magicOption); + } + this.component.grid && this.component.grid.refixAxisShape(this.component); + this._zr.refresh(); + }, + _disposeChartList: function () { + this._clearEffect(); + this._zr.clearAnimation(); + var len = this._chartList.length; + while (len--) { + var chart = this._chartList[len]; + if (chart) { + var chartType = chart.type; + this.chart[chartType] && delete this.chart[chartType]; + this.component[chartType] && delete this.component[chartType]; + chart.dispose && chart.dispose(); + } + } + this._chartList = []; + }, + _mergeGlobalConifg: function (magicOption) { + var mergeList = [ + 'backgroundColor', + 'calculable', + 'calculableColor', + 'calculableHolderColor', + 'nameConnector', + 'valueConnector', + 'animation', + 'animationThreshold', + 'animationDuration', + 'animationDurationUpdate', + 'animationEasing', + 'addDataAnimation', + 'symbolList', + 'DRAG_ENABLE_TIME' + ]; + var len = mergeList.length; + while (len--) { + var mergeItem = mergeList[len]; + if (magicOption[mergeItem] == null) { + magicOption[mergeItem] = this._themeConfig[mergeItem] != null ? this._themeConfig[mergeItem] : ecConfig[mergeItem]; + } + } + var themeColor = magicOption.color; + if (!(themeColor && themeColor.length)) { + themeColor = this._themeConfig.color || ecConfig.color; + } + this._zr.getColor = function (idx) { + var zrColor = require('zrender/tool/color'); + return zrColor.getColor(idx, themeColor); + }; + if (!_canvasSupported) { + magicOption.animation = false; + magicOption.addDataAnimation = false; + } + }, + setOption: function (option, notMerge) { + if (!option.timeline) { + return this._setOption(option, notMerge); + } else { + return this._setTimelineOption(option); + } + }, + _setOption: function (option, notMerge) { + if (!notMerge && this._option) { + this._option = zrUtil.merge(this.getOption(), zrUtil.clone(option), true); + } else { + this._option = zrUtil.clone(option); + } + this._optionRestore = zrUtil.clone(this._option); + if (!this._option.series || this._option.series.length === 0) { + this._zr.clear(); + return; + } + if (this.component.dataZoom && (this._option.dataZoom || this._option.toolbox && this._option.toolbox.feature && this._option.toolbox.feature.dataZoom && this._option.toolbox.feature.dataZoom.show)) { + this.component.dataZoom.syncOption(this._option); + } + this._toolbox.reset(this._option); + this._render(this._option); + return this; + }, + getOption: function () { + var magicOption = zrUtil.clone(this._option); + var self = this; + function restoreOption(prop) { + var restoreSource = self._optionRestore[prop]; + if (restoreSource) { + if (restoreSource instanceof Array) { + var len = restoreSource.length; + while (len--) { + magicOption[prop][len].data = zrUtil.clone(restoreSource[len].data); + } + } else { + magicOption[prop].data = zrUtil.clone(restoreSource.data); + } + } + } + restoreOption('xAxis'); + restoreOption('yAxis'); + restoreOption('series'); + return magicOption; + }, + setSeries: function (series, notMerge) { + if (!notMerge) { + this.setOption({ series: series }); + } else { + this._option.series = series; + this.setOption(this._option, notMerge); + } + return this; + }, + getSeries: function () { + return this.getOption().series; + }, + _setTimelineOption: function (option) { + this._timeline && this._timeline.dispose(); + var Timeline = require('./component/timeline'); + var timeline = new Timeline(this._themeConfig, this._messageCenter, this._zr, option, this); + this._timeline = timeline; + this.component.timeline = this._timeline; + return this; + }, + addData: function (seriesIdx, data, isHead, dataGrow, additionData) { + var params = seriesIdx instanceof Array ? seriesIdx : [[ + seriesIdx, + data, + isHead, + dataGrow, + additionData + ]]; + var magicOption = this.getOption(); + var optionRestore = this._optionRestore; + for (var i = 0, l = params.length; i < l; i++) { + seriesIdx = params[i][0]; + data = params[i][1]; + isHead = params[i][2]; + dataGrow = params[i][3]; + additionData = params[i][4]; + var seriesItem = optionRestore.series[seriesIdx]; + var inMethod = isHead ? 'unshift' : 'push'; + var outMethod = isHead ? 'pop' : 'shift'; + if (seriesItem) { + var seriesItemData = seriesItem.data; + var mSeriesItemData = magicOption.series[seriesIdx].data; + seriesItemData[inMethod](data); + mSeriesItemData[inMethod](data); + if (!dataGrow) { + seriesItemData[outMethod](); + data = mSeriesItemData[outMethod](); + } + if (additionData != null) { + var legend; + var legendData; + if (seriesItem.type === ecConfig.CHART_TYPE_PIE && (legend = optionRestore.legend) && (legendData = legend.data)) { + var mLegendData = magicOption.legend.data; + legendData[inMethod](additionData); + mLegendData[inMethod](additionData); + if (!dataGrow) { + var legendDataIdx = zrUtil.indexOf(legendData, data.name); + legendDataIdx != -1 && legendData.splice(legendDataIdx, 1); + legendDataIdx = zrUtil.indexOf(mLegendData, data.name); + legendDataIdx != -1 && mLegendData.splice(legendDataIdx, 1); + } + } else if (optionRestore.xAxis != null && optionRestore.yAxis != null) { + var axisData; + var mAxisData; + var axisIdx = seriesItem.xAxisIndex || 0; + if (optionRestore.xAxis[axisIdx].type == null || optionRestore.xAxis[axisIdx].type === 'category') { + axisData = optionRestore.xAxis[axisIdx].data; + mAxisData = magicOption.xAxis[axisIdx].data; + axisData[inMethod](additionData); + mAxisData[inMethod](additionData); + if (!dataGrow) { + axisData[outMethod](); + mAxisData[outMethod](); + } + } + axisIdx = seriesItem.yAxisIndex || 0; + if (optionRestore.yAxis[axisIdx].type === 'category') { + axisData = optionRestore.yAxis[axisIdx].data; + mAxisData = magicOption.yAxis[axisIdx].data; + axisData[inMethod](additionData); + mAxisData[inMethod](additionData); + if (!dataGrow) { + axisData[outMethod](); + mAxisData[outMethod](); + } + } + } + } + this._option.series[seriesIdx].data = magicOption.series[seriesIdx].data; + } + } + this._zr.clearAnimation(); + var chartList = this._chartList; + for (var i = 0, l = chartList.length; i < l; i++) { + if (magicOption.addDataAnimation && chartList[i].addDataAnimation) { + chartList[i].addDataAnimation(params); + } + } + this.component.dataZoom && this.component.dataZoom.syncOption(magicOption); + this._option = magicOption; + var self = this; + setTimeout(function () { + if (!self._zr) { + return; + } + self._zr.clearAnimation(); + for (var i = 0, l = chartList.length; i < l; i++) { + chartList[i].motionlessOnce = magicOption.addDataAnimation && chartList[i].addDataAnimation; + } + self._messageCenter.dispatch(ecConfig.EVENT.REFRESH, null, { option: magicOption }, self); + }, magicOption.addDataAnimation ? magicOption.animationDurationUpdate : 0); + return this; + }, + addMarkPoint: function (seriesIdx, markData) { + return this._addMark(seriesIdx, markData, 'markPoint'); + }, + addMarkLine: function (seriesIdx, markData) { + return this._addMark(seriesIdx, markData, 'markLine'); + }, + _addMark: function (seriesIdx, markData, markType) { + var series = this._option.series; + var seriesItem; + if (series && (seriesItem = series[seriesIdx])) { + var seriesR = this._optionRestore.series; + var seriesRItem = seriesR[seriesIdx]; + var markOpt = seriesItem[markType]; + var markOptR = seriesRItem[markType]; + markOpt = seriesItem[markType] = markOpt || { data: [] }; + markOptR = seriesRItem[markType] = markOptR || { data: [] }; + for (var key in markData) { + if (key === 'data') { + markOpt.data = markOpt.data.concat(markData.data); + markOptR.data = markOptR.data.concat(markData.data); + } else if (typeof markData[key] != 'object' || markOpt[key] == null) { + markOpt[key] = markOptR[key] = markData[key]; + } else { + zrUtil.merge(markOpt[key], markData[key], true); + zrUtil.merge(markOptR[key], markData[key], true); + } + } + var chart = this.chart[seriesItem.type]; + chart && chart.addMark(seriesIdx, markData, markType); + } + return this; + }, + delMarkPoint: function (seriesIdx, markName) { + return this._delMark(seriesIdx, markName, 'markPoint'); + }, + delMarkLine: function (seriesIdx, markName) { + return this._delMark(seriesIdx, markName, 'markLine'); + }, + _delMark: function (seriesIdx, markName, markType) { + var series = this._option.series; + var seriesItem; + var mark; + var dataArray; + if (!(series && (seriesItem = series[seriesIdx]) && (mark = seriesItem[markType]) && (dataArray = mark.data))) { + return this; + } + markName = markName.split(' > '); + var targetIndex = -1; + for (var i = 0, l = dataArray.length; i < l; i++) { + var dataItem = dataArray[i]; + if (dataItem instanceof Array) { + if (dataItem[0].name === markName[0] && dataItem[1].name === markName[1]) { + targetIndex = i; + break; + } + } else if (dataItem.name === markName[0]) { + targetIndex = i; + break; + } + } + if (targetIndex > -1) { + dataArray.splice(targetIndex, 1); + this._optionRestore.series[seriesIdx][markType].data.splice(targetIndex, 1); + var chart = this.chart[seriesItem.type]; + chart && chart.delMark(seriesIdx, markName.join(' > '), markType); + } + return this; + }, + getDom: function () { + return this.dom; + }, + getZrender: function () { + return this._zr; + }, + getDataURL: function (imgType) { + if (!_canvasSupported) { + return ''; + } + if (this._chartList.length === 0) { + var imgId = 'IMG' + this.id; + var img = document.getElementById(imgId); + if (img) { + return img.src; + } + } + var tooltip = this.component.tooltip; + tooltip && tooltip.hideTip(); + switch (imgType) { + case 'jpeg': + break; + default: + imgType = 'png'; + } + var bgColor = this._option.backgroundColor; + if (bgColor && bgColor.replace(' ', '') === 'rgba(0,0,0,0)') { + bgColor = '#fff'; + } + return this._zr.toDataURL('image/' + imgType, bgColor); + }, + getImage: function (imgType) { + var title = this._optionRestore.title; + var imgDom = document.createElement('img'); + imgDom.src = this.getDataURL(imgType); + imgDom.title = title && title.text || 'ECharts'; + return imgDom; + }, + getConnectedDataURL: function (imgType) { + if (!this.isConnected()) { + return this.getDataURL(imgType); + } + var tempDom = this.dom; + var imgList = { + 'self': { + img: this.getDataURL(imgType), + left: tempDom.offsetLeft, + top: tempDom.offsetTop, + right: tempDom.offsetLeft + tempDom.offsetWidth, + bottom: tempDom.offsetTop + tempDom.offsetHeight + } + }; + var minLeft = imgList.self.left; + var minTop = imgList.self.top; + var maxRight = imgList.self.right; + var maxBottom = imgList.self.bottom; + for (var c in this._connected) { + tempDom = this._connected[c].getDom(); + imgList[c] = { + img: this._connected[c].getDataURL(imgType), + left: tempDom.offsetLeft, + top: tempDom.offsetTop, + right: tempDom.offsetLeft + tempDom.offsetWidth, + bottom: tempDom.offsetTop + tempDom.offsetHeight + }; + minLeft = Math.min(minLeft, imgList[c].left); + minTop = Math.min(minTop, imgList[c].top); + maxRight = Math.max(maxRight, imgList[c].right); + maxBottom = Math.max(maxBottom, imgList[c].bottom); + } + var zrDom = document.createElement('div'); + zrDom.style.position = 'absolute'; + zrDom.style.left = '-4000px'; + zrDom.style.width = maxRight - minLeft + 'px'; + zrDom.style.height = maxBottom - minTop + 'px'; + document.body.appendChild(zrDom); + var zrImg = require('zrender').init(zrDom); + var ImageShape = require('zrender/shape/Image'); + for (var c in imgList) { + zrImg.addShape(new ImageShape({ + style: { + x: imgList[c].left - minLeft, + y: imgList[c].top - minTop, + image: imgList[c].img + } + })); + } + zrImg.render(); + var bgColor = this._option.backgroundColor; + if (bgColor && bgColor.replace(/ /g, '') === 'rgba(0,0,0,0)') { + bgColor = '#fff'; + } + var image = zrImg.toDataURL('image/png', bgColor); + setTimeout(function () { + zrImg.dispose(); + zrDom.parentNode.removeChild(zrDom); + zrDom = null; + }, 100); + return image; + }, + getConnectedImage: function (imgType) { + var title = this._optionRestore.title; + var imgDom = document.createElement('img'); + imgDom.src = this.getConnectedDataURL(imgType); + imgDom.title = title && title.text || 'ECharts'; + return imgDom; + }, + on: function (eventName, eventListener) { + this._messageCenterOutSide.bind(eventName, eventListener, this); + return this; + }, + un: function (eventName, eventListener) { + this._messageCenterOutSide.unbind(eventName, eventListener); + return this; + }, + connect: function (connectTarget) { + if (!connectTarget) { + return this; + } + if (!this._connected) { + this._connected = {}; + } + if (connectTarget instanceof Array) { + for (var i = 0, l = connectTarget.length; i < l; i++) { + this._connected[connectTarget[i].id] = connectTarget[i]; + } + } else { + this._connected[connectTarget.id] = connectTarget; + } + return this; + }, + disConnect: function (connectTarget) { + if (!connectTarget || !this._connected) { + return this; + } + if (connectTarget instanceof Array) { + for (var i = 0, l = connectTarget.length; i < l; i++) { + delete this._connected[connectTarget[i].id]; + } + } else { + delete this._connected[connectTarget.id]; + } + for (var k in this._connected) { + return k, this; + } + this._connected = false; + return this; + }, + connectedEventHandler: function (param) { + if (param.__echartsId != this.id) { + this._onevent(param); + } + }, + isConnected: function () { + return !!this._connected; + }, + showLoading: function (loadingOption) { + var effectList = { + bar: require('zrender/loadingEffect/Bar'), + bubble: require('zrender/loadingEffect/Bubble'), + dynamicLine: require('zrender/loadingEffect/DynamicLine'), + ring: require('zrender/loadingEffect/Ring'), + spin: require('zrender/loadingEffect/Spin'), + whirling: require('zrender/loadingEffect/Whirling') + }; + this._toolbox.hideDataView(); + loadingOption = loadingOption || {}; + var textStyle = loadingOption.textStyle || {}; + loadingOption.textStyle = textStyle; + var finalTextStyle = zrUtil.merge(zrUtil.merge(zrUtil.clone(textStyle), this._themeConfig.textStyle), ecConfig.textStyle); + textStyle.textFont = finalTextStyle.fontStyle + ' ' + finalTextStyle.fontWeight + ' ' + finalTextStyle.fontSize + 'px ' + finalTextStyle.fontFamily; + textStyle.text = loadingOption.text || this._option && this._option.loadingText || this._themeConfig.loadingText || ecConfig.loadingText; + if (loadingOption.x != null) { + textStyle.x = loadingOption.x; + } + if (loadingOption.y != null) { + textStyle.y = loadingOption.y; + } + loadingOption.effectOption = loadingOption.effectOption || {}; + loadingOption.effectOption.textStyle = textStyle; + var Effect = loadingOption.effect; + if (typeof Effect === 'string' || Effect == null) { + Effect = effectList[loadingOption.effect || this._option && this._option.loadingEffect || this._themeConfig.loadingEffect || ecConfig.loadingEffect] || effectList.spin; + } + this._zr.showLoading(new Effect(loadingOption.effectOption)); + return this; + }, + hideLoading: function () { + this._zr.hideLoading(); + return this; + }, + setTheme: function (theme) { + if (theme) { + if (typeof theme === 'string') { + switch (theme) { + case 'macarons': + theme = require('./theme/macarons'); + break; + case 'infographic': + theme = require('./theme/infographic'); + break; + default: + theme = {}; + } + } else { + theme = theme || {}; + } + this._themeConfig = theme; + } + if (!_canvasSupported) { + var textStyle = this._themeConfig.textStyle; + textStyle && textStyle.fontFamily && textStyle.fontFamily2 && (textStyle.fontFamily = textStyle.fontFamily2); + textStyle = ecConfig.textStyle; + textStyle.fontFamily = textStyle.fontFamily2; + } + this._timeline && this._timeline.setTheme(true); + this._optionRestore && this.restore(); + }, + resize: function () { + var self = this; + return function () { + self._clearEffect(); + self._zr.resize(); + if (self._option && self._option.renderAsImage && _canvasSupported) { + self._render(self._option); + return self; + } + self._zr.clearAnimation(); + self._island.resize(); + self._toolbox.resize(); + self._timeline && self._timeline.resize(); + for (var i = 0, l = self._chartList.length; i < l; i++) { + self._chartList[i].resize && self._chartList[i].resize(); + } + self.component.grid && self.component.grid.refixAxisShape(self.component); + self._zr.refresh(); + self._messageCenter.dispatch(ecConfig.EVENT.RESIZE, null, null, self); + return self; + }; + }, + _clearEffect: function () { + this._zr.modLayer(ecConfig.EFFECT_ZLEVEL, { motionBlur: false }); + this._zr.painter.clearLayer(ecConfig.EFFECT_ZLEVEL); + }, + clear: function () { + this._disposeChartList(); + this._zr.clear(); + this._option = {}; + this._optionRestore = {}; + this.dom.style.backgroundColor = null; + return this; + }, + dispose: function () { + var key = this.dom.getAttribute(DOM_ATTRIBUTE_KEY); + key && delete _instances[key]; + this._island.dispose(); + this._toolbox.dispose(); + this._timeline && this._timeline.dispose(); + this._messageCenter.unbind(); + this.clear(); + this._zr.dispose(); + this._zr = null; + } + }; + return self; +});define('echarts/config', [], function () { + var config = { + CHART_TYPE_LINE: 'line', + CHART_TYPE_BAR: 'bar', + CHART_TYPE_SCATTER: 'scatter', + CHART_TYPE_PIE: 'pie', + CHART_TYPE_RADAR: 'radar', + CHART_TYPE_MAP: 'map', + CHART_TYPE_K: 'k', + CHART_TYPE_ISLAND: 'island', + CHART_TYPE_FORCE: 'force', + CHART_TYPE_CHORD: 'chord', + CHART_TYPE_GAUGE: 'gauge', + CHART_TYPE_FUNNEL: 'funnel', + CHART_TYPE_EVENTRIVER: 'eventRiver', + COMPONENT_TYPE_TITLE: 'title', + COMPONENT_TYPE_LEGEND: 'legend', + COMPONENT_TYPE_DATARANGE: 'dataRange', + COMPONENT_TYPE_DATAVIEW: 'dataView', + COMPONENT_TYPE_DATAZOOM: 'dataZoom', + COMPONENT_TYPE_TOOLBOX: 'toolbox', + COMPONENT_TYPE_TOOLTIP: 'tooltip', + COMPONENT_TYPE_GRID: 'grid', + COMPONENT_TYPE_AXIS: 'axis', + COMPONENT_TYPE_POLAR: 'polar', + COMPONENT_TYPE_X_AXIS: 'xAxis', + COMPONENT_TYPE_Y_AXIS: 'yAxis', + COMPONENT_TYPE_AXIS_CATEGORY: 'categoryAxis', + COMPONENT_TYPE_AXIS_VALUE: 'valueAxis', + COMPONENT_TYPE_TIMELINE: 'timeline', + COMPONENT_TYPE_ROAMCONTROLLER: 'roamController', + backgroundColor: 'rgba(0,0,0,0)', + color: [ + '#ff7f50', + '#87cefa', + '#da70d6', + '#32cd32', + '#6495ed', + '#ff69b4', + '#ba55d3', + '#cd5c5c', + '#ffa500', + '#40e0d0', + '#1e90ff', + '#ff6347', + '#7b68ee', + '#00fa9a', + '#ffd700', + '#6699FF', + '#ff6666', + '#3cb371', + '#b8860b', + '#30e0e0' + ], + markPoint: { + clickable: true, + symbol: 'pin', + symbolSize: 10, + large: false, + effect: { + show: false, + loop: true, + period: 15, + type: 'scale', + scaleSize: 2, + bounceDistance: 10 + }, + itemStyle: { + normal: { + borderWidth: 2, + label: { + show: true, + position: 'inside' + } + }, + emphasis: { label: { show: true } } + } + }, + markLine: { + clickable: true, + symbol: [ + 'circle', + 'arrow' + ], + symbolSize: [ + 2, + 4 + ], + smoothRadian: 0.2, + precision: 2, + effect: { + show: false, + loop: true, + period: 15, + scaleSize: 2 + }, + itemStyle: { + normal: { + borderWidth: 1.5, + label: { + show: true, + position: 'end' + }, + lineStyle: { type: 'dashed' } + }, + emphasis: { + label: { show: false }, + lineStyle: {} + } + } + }, + textStyle: { + decoration: 'none', + fontFamily: 'Arial, Verdana, sans-serif', + fontFamily2: '微软雅黑', + fontSize: 12, + fontStyle: 'normal', + fontWeight: 'normal' + }, + EVENT: { + REFRESH: 'refresh', + RESTORE: 'restore', + RESIZE: 'resize', + CLICK: 'click', + DBLCLICK: 'dblclick', + HOVER: 'hover', + MOUSEOUT: 'mouseout', + DATA_CHANGED: 'dataChanged', + DATA_ZOOM: 'dataZoom', + DATA_RANGE: 'dataRange', + DATA_RANGE_SELECTED: 'dataRangeSelected', + DATA_RANGE_HOVERLINK: 'dataRangeHoverLink', + LEGEND_SELECTED: 'legendSelected', + LEGEND_HOVERLINK: 'legendHoverLink', + MAP_SELECTED: 'mapSelected', + PIE_SELECTED: 'pieSelected', + MAGIC_TYPE_CHANGED: 'magicTypeChanged', + DATA_VIEW_CHANGED: 'dataViewChanged', + TIMELINE_CHANGED: 'timelineChanged', + MAP_ROAM: 'mapRoam', + FORCE_LAYOUT_END: 'forceLayoutEnd', + TOOLTIP_HOVER: 'tooltipHover', + TOOLTIP_IN_GRID: 'tooltipInGrid', + TOOLTIP_OUT_GRID: 'tooltipOutGrid', + ROAMCONTROLLER: 'roamController' + }, + DRAG_ENABLE_TIME: 120, + EFFECT_ZLEVEL: 10, + symbolList: [ + 'circle', + 'rectangle', + 'triangle', + 'diamond', + 'emptyCircle', + 'emptyRectangle', + 'emptyTriangle', + 'emptyDiamond' + ], + loadingEffect: 'spin', + loadingText: '数据读取中...', + noDataEffect: 'bubble', + noDataText: '暂无数据', + calculable: false, + calculableColor: 'rgba(255,165,0,0.6)', + calculableHolderColor: '#ccc', + nameConnector: ' & ', + valueConnector: ': ', + animation: true, + addDataAnimation: true, + animationThreshold: 2000, + animationDuration: 2000, + animationDurationUpdate: 500, + animationEasing: 'ExponentialOut' + }; + return config; +});define('zrender/tool/util', [ + 'require', + '../dep/excanvas' +], function (require) { + var BUILTIN_OBJECT = { + '[object Function]': 1, + '[object RegExp]': 1, + '[object Date]': 1, + '[object Error]': 1, + '[object CanvasGradient]': 1 + }; + var objToString = Object.prototype.toString; + function isDom(obj) { + return obj && obj.nodeType === 1 && typeof obj.nodeName == 'string'; + } + function clone(source) { + if (typeof source == 'object' && source !== null) { + var result = source; + if (source instanceof Array) { + result = []; + for (var i = 0, len = source.length; i < len; i++) { + result[i] = clone(source[i]); + } + } else if (!BUILTIN_OBJECT[objToString.call(source)] && !isDom(source)) { + result = {}; + for (var key in source) { + if (source.hasOwnProperty(key)) { + result[key] = clone(source[key]); + } + } + } + return result; + } + return source; + } + function mergeItem(target, source, key, overwrite) { + if (source.hasOwnProperty(key)) { + var targetProp = target[key]; + if (typeof targetProp == 'object' && !BUILTIN_OBJECT[objToString.call(targetProp)] && !isDom(targetProp)) { + merge(target[key], source[key], overwrite); + } else if (overwrite || !(key in target)) { + target[key] = source[key]; + } + } + } + function merge(target, source, overwrite) { + for (var i in source) { + mergeItem(target, source, i, overwrite); + } + return target; + } + var _ctx; + function getContext() { + if (!_ctx) { + require('../dep/excanvas'); + if (window['G_vmlCanvasManager']) { + var _div = document.createElement('div'); + _div.style.position = 'absolute'; + _div.style.top = '-1000px'; + document.body.appendChild(_div); + _ctx = G_vmlCanvasManager.initElement(_div).getContext('2d'); + } else { + _ctx = document.createElement('canvas').getContext('2d'); + } + } + return _ctx; + } + var _canvas; + var _pixelCtx; + var _width; + var _height; + var _offsetX = 0; + var _offsetY = 0; + function getPixelContext() { + if (!_pixelCtx) { + _canvas = document.createElement('canvas'); + _width = _canvas.width; + _height = _canvas.height; + _pixelCtx = _canvas.getContext('2d'); + } + return _pixelCtx; + } + function adjustCanvasSize(x, y) { + var _v = 100; + var _flag; + if (x + _offsetX > _width) { + _width = x + _offsetX + _v; + _canvas.width = _width; + _flag = true; + } + if (y + _offsetY > _height) { + _height = y + _offsetY + _v; + _canvas.height = _height; + _flag = true; + } + if (x < -_offsetX) { + _offsetX = Math.ceil(-x / _v) * _v; + _width += _offsetX; + _canvas.width = _width; + _flag = true; + } + if (y < -_offsetY) { + _offsetY = Math.ceil(-y / _v) * _v; + _height += _offsetY; + _canvas.height = _height; + _flag = true; + } + if (_flag) { + _pixelCtx.translate(_offsetX, _offsetY); + } + } + function getPixelOffset() { + return { + x: _offsetX, + y: _offsetY + }; + } + function indexOf(array, value) { + if (array.indexOf) { + return array.indexOf(value); + } + for (var i = 0, len = array.length; i < len; i++) { + if (array[i] === value) { + return i; + } + } + return -1; + } + function inherits(clazz, baseClazz) { + var clazzPrototype = clazz.prototype; + function F() { + } + F.prototype = baseClazz.prototype; + clazz.prototype = new F(); + for (var prop in clazzPrototype) { + clazz.prototype[prop] = clazzPrototype[prop]; + } + clazz.constructor = clazz; + } + return { + inherits: inherits, + clone: clone, + merge: merge, + getContext: getContext, + getPixelContext: getPixelContext, + getPixelOffset: getPixelOffset, + adjustCanvasSize: adjustCanvasSize, + indexOf: indexOf + }; +});define('zrender/tool/event', [ + 'require', + '../mixin/Eventful' +], function (require) { + 'use strict'; + var Eventful = require('../mixin/Eventful'); + function getX(e) { + return typeof e.zrenderX != 'undefined' && e.zrenderX || typeof e.offsetX != 'undefined' && e.offsetX || typeof e.layerX != 'undefined' && e.layerX || typeof e.clientX != 'undefined' && e.clientX; + } + function getY(e) { + return typeof e.zrenderY != 'undefined' && e.zrenderY || typeof e.offsetY != 'undefined' && e.offsetY || typeof e.layerY != 'undefined' && e.layerY || typeof e.clientY != 'undefined' && e.clientY; + } + function getDelta(e) { + return typeof e.zrenderDelta != 'undefined' && e.zrenderDelta || typeof e.wheelDelta != 'undefined' && e.wheelDelta || typeof e.detail != 'undefined' && -e.detail; + } + var stop = typeof window.addEventListener === 'function' ? function (e) { + e.preventDefault(); + e.stopPropagation(); + e.cancelBubble = true; + } : function (e) { + e.returnValue = false; + e.cancelBubble = true; + }; + return { + getX: getX, + getY: getY, + getDelta: getDelta, + stop: stop, + Dispatcher: Eventful + }; +});define('zrender/tool/env', [], function () { + function detect(ua) { + var os = this.os = {}; + var browser = this.browser = {}; + var webkit = ua.match(/Web[kK]it[\/]{0,1}([\d.]+)/); + var android = ua.match(/(Android);?[\s\/]+([\d.]+)?/); + var ipad = ua.match(/(iPad).*OS\s([\d_]+)/); + var ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/); + var iphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/); + var webos = ua.match(/(webOS|hpwOS)[\s\/]([\d.]+)/); + var touchpad = webos && ua.match(/TouchPad/); + var kindle = ua.match(/Kindle\/([\d.]+)/); + var silk = ua.match(/Silk\/([\d._]+)/); + var blackberry = ua.match(/(BlackBerry).*Version\/([\d.]+)/); + var bb10 = ua.match(/(BB10).*Version\/([\d.]+)/); + var rimtabletos = ua.match(/(RIM\sTablet\sOS)\s([\d.]+)/); + var playbook = ua.match(/PlayBook/); + var chrome = ua.match(/Chrome\/([\d.]+)/) || ua.match(/CriOS\/([\d.]+)/); + var firefox = ua.match(/Firefox\/([\d.]+)/); + var ie = ua.match(/MSIE ([\d.]+)/); + var safari = webkit && ua.match(/Mobile\//) && !chrome; + var webview = ua.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/) && !chrome; + var ie = ua.match(/MSIE\s([\d.]+)/); + if (browser.webkit = !!webkit) + browser.version = webkit[1]; + if (android) + os.android = true, os.version = android[2]; + if (iphone && !ipod) + os.ios = os.iphone = true, os.version = iphone[2].replace(/_/g, '.'); + if (ipad) + os.ios = os.ipad = true, os.version = ipad[2].replace(/_/g, '.'); + if (ipod) + os.ios = os.ipod = true, os.version = ipod[3] ? ipod[3].replace(/_/g, '.') : null; + if (webos) + os.webos = true, os.version = webos[2]; + if (touchpad) + os.touchpad = true; + if (blackberry) + os.blackberry = true, os.version = blackberry[2]; + if (bb10) + os.bb10 = true, os.version = bb10[2]; + if (rimtabletos) + os.rimtabletos = true, os.version = rimtabletos[2]; + if (playbook) + browser.playbook = true; + if (kindle) + os.kindle = true, os.version = kindle[1]; + if (silk) + browser.silk = true, browser.version = silk[1]; + if (!silk && os.android && ua.match(/Kindle Fire/)) + browser.silk = true; + if (chrome) + browser.chrome = true, browser.version = chrome[1]; + if (firefox) + browser.firefox = true, browser.version = firefox[1]; + if (ie) + browser.ie = true, browser.version = ie[1]; + if (safari && (ua.match(/Safari/) || !!os.ios)) + browser.safari = true; + if (webview) + browser.webview = true; + if (ie) + browser.ie = true, browser.version = ie[1]; + os.tablet = !!(ipad || playbook || android && !ua.match(/Mobile/) || firefox && ua.match(/Tablet/) || ie && !ua.match(/Phone/) && ua.match(/Touch/)); + os.phone = !!(!os.tablet && !os.ipod && (android || iphone || webos || blackberry || bb10 || chrome && ua.match(/Android/) || chrome && ua.match(/CriOS\/([\d.]+)/) || firefox && ua.match(/Mobile/) || ie && ua.match(/Touch/))); + return { + browser: browser, + os: os, + canvasSupported: document.createElement('canvas').getContext ? true : false + }; + } + return detect(navigator.userAgent); +});define('zrender', ['zrender/zrender'], function (main) {return main;}); +define('zrender/zrender', [ + 'require', + './dep/excanvas', + './tool/util', + './tool/log', + './tool/guid', + './Handler', + './Painter', + './Storage', + './animation/Animation', + './tool/env' +], function (require) { + require('./dep/excanvas'); + var util = require('./tool/util'); + var log = require('./tool/log'); + var guid = require('./tool/guid'); + var Handler = require('./Handler'); + var Painter = require('./Painter'); + var Storage = require('./Storage'); + var Animation = require('./animation/Animation'); + var _instances = {}; + var zrender = {}; + zrender.version = '2.0.7'; + zrender.init = function (dom) { + var zr = new ZRender(guid(), dom); + _instances[zr.id] = zr; + return zr; + }; + zrender.dispose = function (zr) { + if (zr) { + zr.dispose(); + } else { + for (var key in _instances) { + _instances[key].dispose(); + } + _instances = {}; + } + return zrender; + }; + zrender.getInstance = function (id) { + return _instances[id]; + }; + zrender.delInstance = function (id) { + delete _instances[id]; + return zrender; + }; + function getFrameCallback(zrInstance) { + return function () { + var animatingElements = zrInstance.animatingElements; + for (var i = 0, l = animatingElements.length; i < l; i++) { + zrInstance.storage.mod(animatingElements[i].id); + } + if (animatingElements.length || zrInstance._needsRefreshNextFrame) { + zrInstance.refresh(); + } + }; + } + var ZRender = function (id, dom) { + this.id = id; + this.env = require('./tool/env'); + this.storage = new Storage(); + this.painter = new Painter(dom, this.storage); + this.handler = new Handler(dom, this.storage, this.painter); + this.animatingElements = []; + this.animation = new Animation({ stage: { update: getFrameCallback(this) } }); + this.animation.start(); + var self = this; + this.painter.refreshNextFrame = function () { + self.refreshNextFrame(); + }; + this._needsRefreshNextFrame = false; + }; + ZRender.prototype.getId = function () { + return this.id; + }; + ZRender.prototype.addShape = function (shape) { + this.storage.addRoot(shape); + return this; + }; + ZRender.prototype.addGroup = function (group) { + this.storage.addRoot(group); + return this; + }; + ZRender.prototype.delShape = function (shapeId) { + this.storage.delRoot(shapeId); + return this; + }; + ZRender.prototype.delGroup = function (groupId) { + this.storage.delRoot(groupId); + return this; + }; + ZRender.prototype.modShape = function (shapeId, shape) { + this.storage.mod(shapeId, shape); + return this; + }; + ZRender.prototype.modGroup = function (groupId, group) { + this.storage.mod(groupId, group); + return this; + }; + ZRender.prototype.modLayer = function (zLevel, config) { + this.painter.modLayer(zLevel, config); + return this; + }; + ZRender.prototype.addHoverShape = function (shape) { + this.storage.addHover(shape); + return this; + }; + ZRender.prototype.render = function (callback) { + this.painter.render(callback); + this._needsRefreshNextFrame = false; + return this; + }; + ZRender.prototype.refresh = function (callback) { + this.painter.refresh(callback); + this._needsRefreshNextFrame = false; + return this; + }; + ZRender.prototype.refreshNextFrame = function () { + this._needsRefreshNextFrame = true; + return this; + }; + ZRender.prototype.refreshHover = function (callback) { + this.painter.refreshHover(callback); + return this; + }; + ZRender.prototype.refreshShapes = function (shapeList, callback) { + this.painter.refreshShapes(shapeList, callback); + return this; + }; + ZRender.prototype.resize = function () { + this.painter.resize(); + return this; + }; + ZRender.prototype.animate = function (el, path, loop) { + if (typeof el === 'string') { + el = this.storage.get(el); + } + if (el) { + var target; + if (path) { + var pathSplitted = path.split('.'); + var prop = el; + for (var i = 0, l = pathSplitted.length; i < l; i++) { + if (!prop) { + continue; + } + prop = prop[pathSplitted[i]]; + } + if (prop) { + target = prop; + } + } else { + target = el; + } + if (!target) { + log('Property "' + path + '" is not existed in element ' + el.id); + return; + } + var animatingElements = this.animatingElements; + if (typeof el.__aniCount === 'undefined') { + el.__aniCount = 0; + } + if (el.__aniCount === 0) { + animatingElements.push(el); + } + el.__aniCount++; + return this.animation.animate(target, { loop: loop }).done(function () { + el.__aniCount--; + if (el.__aniCount === 0) { + var idx = util.indexOf(animatingElements, el); + animatingElements.splice(idx, 1); + } + }); + } else { + log('Element not existed'); + } + }; + ZRender.prototype.clearAnimation = function () { + this.animation.clear(); + }; + ZRender.prototype.showLoading = function (loadingEffect) { + this.painter.showLoading(loadingEffect); + return this; + }; + ZRender.prototype.hideLoading = function () { + this.painter.hideLoading(); + return this; + }; + ZRender.prototype.getWidth = function () { + return this.painter.getWidth(); + }; + ZRender.prototype.getHeight = function () { + return this.painter.getHeight(); + }; + ZRender.prototype.toDataURL = function (type, backgroundColor, args) { + return this.painter.toDataURL(type, backgroundColor, args); + }; + ZRender.prototype.shapeToImage = function (e, width, height) { + var id = guid(); + return this.painter.shapeToImage(id, e, width, height); + }; + ZRender.prototype.on = function (eventName, eventHandler, context) { + this.handler.on(eventName, eventHandler, context); + return this; + }; + ZRender.prototype.un = function (eventName, eventHandler) { + this.handler.un(eventName, eventHandler); + return this; + }; + ZRender.prototype.trigger = function (eventName, event) { + this.handler.trigger(eventName, event); + return this; + }; + ZRender.prototype.clear = function () { + this.storage.delRoot(); + this.painter.clear(); + return this; + }; + ZRender.prototype.dispose = function () { + this.animation.stop(); + this.clear(); + this.storage.dispose(); + this.painter.dispose(); + this.handler.dispose(); + this.animation = this.animatingElements = this.storage = this.painter = this.handler = null; + zrender.delInstance(this.id); + }; + return zrender; +});define('zrender/config', [], function () { + var config = { + EVENT: { + RESIZE: 'resize', + CLICK: 'click', + DBLCLICK: 'dblclick', + MOUSEWHEEL: 'mousewheel', + MOUSEMOVE: 'mousemove', + MOUSEOVER: 'mouseover', + MOUSEOUT: 'mouseout', + MOUSEDOWN: 'mousedown', + MOUSEUP: 'mouseup', + GLOBALOUT: 'globalout', + DRAGSTART: 'dragstart', + DRAGEND: 'dragend', + DRAGENTER: 'dragenter', + DRAGOVER: 'dragover', + DRAGLEAVE: 'dragleave', + DROP: 'drop', + touchClickDelay: 300 + }, + catchBrushException: false, + debugMode: 0, + devicePixelRatio: Math.max(window.devicePixelRatio || 1, 1) + }; + return config; +});define('echarts/chart/island', [ + 'require', + './base', + 'zrender/shape/Circle', + '../config', + '../util/ecData', + 'zrender/tool/util', + 'zrender/tool/event', + 'zrender/tool/color', + '../util/accMath', + '../chart' +], function (require) { + var ChartBase = require('./base'); + var CircleShape = require('zrender/shape/Circle'); + var ecConfig = require('../config'); + ecConfig.island = { + zlevel: 0, + z: 5, + r: 15, + calculateStep: 0.1 + }; + var ecData = require('../util/ecData'); + var zrUtil = require('zrender/tool/util'); + var zrEvent = require('zrender/tool/event'); + function Island(ecTheme, messageCenter, zr, option, myChart) { + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); + this._nameConnector; + this._valueConnector; + this._zrHeight = this.zr.getHeight(); + this._zrWidth = this.zr.getWidth(); + var self = this; + self.shapeHandler.onmousewheel = function (param) { + var shape = param.target; + var event = param.event; + var delta = zrEvent.getDelta(event); + delta = delta > 0 ? -1 : 1; + shape.style.r -= delta; + shape.style.r = shape.style.r < 5 ? 5 : shape.style.r; + var value = ecData.get(shape, 'value'); + var dvalue = value * self.option.island.calculateStep; + value = dvalue > 1 ? Math.round(value - dvalue * delta) : +(value - dvalue * delta).toFixed(2); + var name = ecData.get(shape, 'name'); + shape.style.text = name + ':' + value; + ecData.set(shape, 'value', value); + ecData.set(shape, 'name', name); + self.zr.modShape(shape.id); + self.zr.refreshNextFrame(); + zrEvent.stop(event); + }; + } + Island.prototype = { + type: ecConfig.CHART_TYPE_ISLAND, + _combine: function (tarShape, srcShape) { + var zrColor = require('zrender/tool/color'); + var accMath = require('../util/accMath'); + var value = accMath.accAdd(ecData.get(tarShape, 'value'), ecData.get(srcShape, 'value')); + var name = ecData.get(tarShape, 'name') + this._nameConnector + ecData.get(srcShape, 'name'); + tarShape.style.text = name + this._valueConnector + value; + ecData.set(tarShape, 'value', value); + ecData.set(tarShape, 'name', name); + tarShape.style.r = this.option.island.r; + tarShape.style.color = zrColor.mix(tarShape.style.color, srcShape.style.color); + }, + refresh: function (newOption) { + if (newOption) { + newOption.island = this.reformOption(newOption.island); + this.option = newOption; + this._nameConnector = this.option.nameConnector; + this._valueConnector = this.option.valueConnector; + } + }, + getOption: function () { + return this.option; + }, + resize: function () { + var newWidth = this.zr.getWidth(); + var newHieght = this.zr.getHeight(); + var xScale = newWidth / (this._zrWidth || newWidth); + var yScale = newHieght / (this._zrHeight || newHieght); + if (xScale === 1 && yScale === 1) { + return; + } + this._zrWidth = newWidth; + this._zrHeight = newHieght; + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.modShape(this.shapeList[i].id, { + style: { + x: Math.round(this.shapeList[i].style.x * xScale), + y: Math.round(this.shapeList[i].style.y * yScale) + } + }); + } + }, + add: function (shape) { + var name = ecData.get(shape, 'name'); + var value = ecData.get(shape, 'value'); + var seriesName = ecData.get(shape, 'series') != null ? ecData.get(shape, 'series').name : ''; + var font = this.getFont(this.option.island.textStyle); + var islandShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: shape.style.x, + y: shape.style.y, + r: this.option.island.r, + color: shape.style.color || shape.style.strokeColor, + text: name + this._valueConnector + value, + textFont: font + }, + draggable: true, + hoverable: true, + onmousewheel: this.shapeHandler.onmousewheel, + _type: 'island' + }; + if (islandShape.style.color === '#fff') { + islandShape.style.color = shape.style.strokeColor; + } + this.setCalculable(islandShape); + islandShape.dragEnableTime = 0; + ecData.pack(islandShape, { name: seriesName }, -1, value, -1, name); + islandShape = new CircleShape(islandShape); + this.shapeList.push(islandShape); + this.zr.addShape(islandShape); + }, + del: function (shape) { + this.zr.delShape(shape.id); + var newShapeList = []; + for (var i = 0, l = this.shapeList.length; i < l; i++) { + if (this.shapeList[i].id != shape.id) { + newShapeList.push(this.shapeList[i]); + } + } + this.shapeList = newShapeList; + }, + ondrop: function (param, status) { + if (!this.isDrop || !param.target) { + return; + } + var target = param.target; + var dragged = param.dragged; + this._combine(target, dragged); + this.zr.modShape(target.id); + status.dragIn = true; + this.isDrop = false; + return; + }, + ondragend: function (param, status) { + var target = param.target; + if (!this.isDragend) { + if (!status.dragIn) { + target.style.x = zrEvent.getX(param.event); + target.style.y = zrEvent.getY(param.event); + this.add(target); + status.needRefresh = true; + } + } else { + if (status.dragIn) { + this.del(target); + status.needRefresh = true; + } + } + this.isDragend = false; + return; + } + }; + zrUtil.inherits(Island, ChartBase); + require('../chart').define('island', Island); + return Island; +});define('echarts/component/toolbox', [ + 'require', + './base', + 'zrender/shape/Line', + 'zrender/shape/Image', + 'zrender/shape/Rectangle', + '../util/shape/Icon', + '../config', + 'zrender/tool/util', + 'zrender/config', + 'zrender/tool/event', + './dataView', + '../component' +], function (require) { + var Base = require('./base'); + var LineShape = require('zrender/shape/Line'); + var ImageShape = require('zrender/shape/Image'); + var RectangleShape = require('zrender/shape/Rectangle'); + var IconShape = require('../util/shape/Icon'); + var ecConfig = require('../config'); + ecConfig.toolbox = { + zlevel: 0, + z: 6, + show: false, + orient: 'horizontal', + x: 'right', + y: 'top', + color: [ + '#1e90ff', + '#22bb22', + '#4b0082', + '#d2691e' + ], + disableColor: '#ddd', + effectiveColor: 'red', + backgroundColor: 'rgba(0,0,0,0)', + borderColor: '#ccc', + borderWidth: 0, + padding: 5, + itemGap: 10, + itemSize: 16, + showTitle: true, + feature: { + mark: { + show: false, + title: { + mark: '辅助线开关', + markUndo: '删除辅助线', + markClear: '清空辅助线' + }, + lineStyle: { + width: 1, + color: '#1e90ff', + type: 'dashed' + } + }, + dataZoom: { + show: false, + title: { + dataZoom: '区域缩放', + dataZoomReset: '区域缩放后退' + } + }, + dataView: { + show: false, + title: '数据视图', + readOnly: false, + lang: [ + '数据视图', + '关闭', + '刷新' + ] + }, + magicType: { + show: false, + title: { + line: '折线图切换', + bar: '柱形图切换', + stack: '堆积', + tiled: '平铺', + force: '力导向布局图切换', + chord: '和弦图切换', + pie: '饼图切换', + funnel: '漏斗图切换' + }, + type: [] + }, + restore: { + show: false, + title: '还原' + }, + saveAsImage: { + show: false, + title: '保存为图片', + type: 'png', + lang: ['点击保存'] + } + } + }; + var zrUtil = require('zrender/tool/util'); + var zrConfig = require('zrender/config'); + var zrEvent = require('zrender/tool/event'); + var _MAGICTYPE_STACK = 'stack'; + var _MAGICTYPE_TILED = 'tiled'; + function Toolbox(ecTheme, messageCenter, zr, option, myChart) { + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + this.dom = myChart.dom; + this._magicType = {}; + this._magicMap = {}; + this._isSilence = false; + this._iconList; + this._iconShapeMap = {}; + this._featureTitle = {}; + this._featureIcon = {}; + this._featureColor = {}; + this._featureOption = {}; + this._enableColor = 'red'; + this._disableColor = '#ccc'; + this._markShapeList = []; + var self = this; + self._onMark = function (param) { + self.__onMark(param); + }; + self._onMarkUndo = function (param) { + self.__onMarkUndo(param); + }; + self._onMarkClear = function (param) { + self.__onMarkClear(param); + }; + self._onDataZoom = function (param) { + self.__onDataZoom(param); + }; + self._onDataZoomReset = function (param) { + self.__onDataZoomReset(param); + }; + self._onDataView = function (param) { + self.__onDataView(param); + }; + self._onRestore = function (param) { + self.__onRestore(param); + }; + self._onSaveAsImage = function (param) { + self.__onSaveAsImage(param); + }; + self._onMagicType = function (param) { + self.__onMagicType(param); + }; + self._onCustomHandler = function (param) { + self.__onCustomHandler(param); + }; + self._onmousemove = function (param) { + return self.__onmousemove(param); + }; + self._onmousedown = function (param) { + return self.__onmousedown(param); + }; + self._onmouseup = function (param) { + return self.__onmouseup(param); + }; + self._onclick = function (param) { + return self.__onclick(param); + }; + } + Toolbox.prototype = { + type: ecConfig.COMPONENT_TYPE_TOOLBOX, + _buildShape: function () { + this._iconList = []; + var toolboxOption = this.option.toolbox; + this._enableColor = toolboxOption.effectiveColor; + this._disableColor = toolboxOption.disableColor; + var feature = toolboxOption.feature; + var iconName = []; + for (var key in feature) { + if (feature[key].show) { + switch (key) { + case 'mark': + iconName.push({ + key: key, + name: 'mark' + }); + iconName.push({ + key: key, + name: 'markUndo' + }); + iconName.push({ + key: key, + name: 'markClear' + }); + break; + case 'magicType': + for (var i = 0, l = feature[key].type.length; i < l; i++) { + feature[key].title[feature[key].type[i] + 'Chart'] = feature[key].title[feature[key].type[i]]; + if (feature[key].option) { + feature[key].option[feature[key].type[i] + 'Chart'] = feature[key].option[feature[key].type[i]]; + } + iconName.push({ + key: key, + name: feature[key].type[i] + 'Chart' + }); + } + break; + case 'dataZoom': + iconName.push({ + key: key, + name: 'dataZoom' + }); + iconName.push({ + key: key, + name: 'dataZoomReset' + }); + break; + case 'saveAsImage': + if (this.canvasSupported) { + iconName.push({ + key: key, + name: 'saveAsImage' + }); + } + break; + default: + iconName.push({ + key: key, + name: key + }); + break; + } + } + } + if (iconName.length > 0) { + var name; + var key; + for (var i = 0, l = iconName.length; i < l; i++) { + name = iconName[i].name; + key = iconName[i].key; + this._iconList.push(name); + this._featureTitle[name] = feature[key].title[name] || feature[key].title; + if (feature[key].icon) { + this._featureIcon[name] = feature[key].icon[name] || feature[key].icon; + } + if (feature[key].color) { + this._featureColor[name] = feature[key].color[name] || feature[key].color; + } + if (feature[key].option) { + this._featureOption[name] = feature[key].option[name] || feature[key].option; + } + } + this._itemGroupLocation = this._getItemGroupLocation(); + this._buildBackground(); + this._buildItem(); + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + if (this._iconShapeMap['mark']) { + this._iconDisable(this._iconShapeMap['markUndo']); + this._iconDisable(this._iconShapeMap['markClear']); + } + if (this._iconShapeMap['dataZoomReset'] && this._zoomQueue.length === 0) { + this._iconDisable(this._iconShapeMap['dataZoomReset']); + } + } + }, + _buildItem: function () { + var toolboxOption = this.option.toolbox; + var iconLength = this._iconList.length; + var lastX = this._itemGroupLocation.x; + var lastY = this._itemGroupLocation.y; + var itemSize = toolboxOption.itemSize; + var itemGap = toolboxOption.itemGap; + var itemShape; + var color = toolboxOption.color instanceof Array ? toolboxOption.color : [toolboxOption.color]; + var textFont = this.getFont(toolboxOption.textStyle); + var textPosition; + var textAlign; + var textBaseline; + if (toolboxOption.orient === 'horizontal') { + textPosition = this._itemGroupLocation.y / this.zr.getHeight() < 0.5 ? 'bottom' : 'top'; + textAlign = this._itemGroupLocation.x / this.zr.getWidth() < 0.5 ? 'left' : 'right'; + textBaseline = this._itemGroupLocation.y / this.zr.getHeight() < 0.5 ? 'top' : 'bottom'; + } else { + textPosition = this._itemGroupLocation.x / this.zr.getWidth() < 0.5 ? 'right' : 'left'; + } + this._iconShapeMap = {}; + var self = this; + for (var i = 0; i < iconLength; i++) { + itemShape = { + type: 'icon', + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: lastX, + y: lastY, + width: itemSize, + height: itemSize, + iconType: this._iconList[i], + lineWidth: 1, + strokeColor: this._featureColor[this._iconList[i]] || color[i % color.length], + brushType: 'stroke' + }, + highlightStyle: { + lineWidth: 1, + text: toolboxOption.showTitle ? this._featureTitle[this._iconList[i]] : undefined, + textFont: textFont, + textPosition: textPosition, + strokeColor: this._featureColor[this._iconList[i]] || color[i % color.length] + }, + hoverable: true, + clickable: true + }; + if (this._featureIcon[this._iconList[i]]) { + itemShape.style.image = this._featureIcon[this._iconList[i]].replace(new RegExp('^image:\\/\\/'), ''); + itemShape.style.opacity = 0.8; + itemShape.highlightStyle.opacity = 1; + itemShape.type = 'image'; + } + if (toolboxOption.orient === 'horizontal') { + if (i === 0 && textAlign === 'left') { + itemShape.highlightStyle.textPosition = 'specific'; + itemShape.highlightStyle.textAlign = textAlign; + itemShape.highlightStyle.textBaseline = textBaseline; + itemShape.highlightStyle.textX = lastX; + itemShape.highlightStyle.textY = textBaseline === 'top' ? lastY + itemSize + 10 : lastY - 10; + } + if (i === iconLength - 1 && textAlign === 'right') { + itemShape.highlightStyle.textPosition = 'specific'; + itemShape.highlightStyle.textAlign = textAlign; + itemShape.highlightStyle.textBaseline = textBaseline; + itemShape.highlightStyle.textX = lastX + itemSize; + itemShape.highlightStyle.textY = textBaseline === 'top' ? lastY + itemSize + 10 : lastY - 10; + } + } + switch (this._iconList[i]) { + case 'mark': + itemShape.onclick = self._onMark; + break; + case 'markUndo': + itemShape.onclick = self._onMarkUndo; + break; + case 'markClear': + itemShape.onclick = self._onMarkClear; + break; + case 'dataZoom': + itemShape.onclick = self._onDataZoom; + break; + case 'dataZoomReset': + itemShape.onclick = self._onDataZoomReset; + break; + case 'dataView': + if (!this._dataView) { + var DataView = require('./dataView'); + this._dataView = new DataView(this.ecTheme, this.messageCenter, this.zr, this.option, this.myChart); + } + itemShape.onclick = self._onDataView; + break; + case 'restore': + itemShape.onclick = self._onRestore; + break; + case 'saveAsImage': + itemShape.onclick = self._onSaveAsImage; + break; + default: + if (this._iconList[i].match('Chart')) { + itemShape._name = this._iconList[i].replace('Chart', ''); + itemShape.onclick = self._onMagicType; + } else { + itemShape.onclick = self._onCustomHandler; + } + break; + } + if (itemShape.type === 'icon') { + itemShape = new IconShape(itemShape); + } else if (itemShape.type === 'image') { + itemShape = new ImageShape(itemShape); + } + this.shapeList.push(itemShape); + this._iconShapeMap[this._iconList[i]] = itemShape; + if (toolboxOption.orient === 'horizontal') { + lastX += itemSize + itemGap; + } else { + lastY += itemSize + itemGap; + } + } + }, + _buildBackground: function () { + var toolboxOption = this.option.toolbox; + var padding = this.reformCssArray(this.option.toolbox.padding); + this.shapeList.push(new RectangleShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: this._itemGroupLocation.x - padding[3], + y: this._itemGroupLocation.y - padding[0], + width: this._itemGroupLocation.width + padding[3] + padding[1], + height: this._itemGroupLocation.height + padding[0] + padding[2], + brushType: toolboxOption.borderWidth === 0 ? 'fill' : 'both', + color: toolboxOption.backgroundColor, + strokeColor: toolboxOption.borderColor, + lineWidth: toolboxOption.borderWidth + } + })); + }, + _getItemGroupLocation: function () { + var toolboxOption = this.option.toolbox; + var padding = this.reformCssArray(this.option.toolbox.padding); + var iconLength = this._iconList.length; + var itemGap = toolboxOption.itemGap; + var itemSize = toolboxOption.itemSize; + var totalWidth = 0; + var totalHeight = 0; + if (toolboxOption.orient === 'horizontal') { + totalWidth = (itemSize + itemGap) * iconLength - itemGap; + totalHeight = itemSize; + } else { + totalHeight = (itemSize + itemGap) * iconLength - itemGap; + totalWidth = itemSize; + } + var x; + var zrWidth = this.zr.getWidth(); + switch (toolboxOption.x) { + case 'center': + x = Math.floor((zrWidth - totalWidth) / 2); + break; + case 'left': + x = padding[3] + toolboxOption.borderWidth; + break; + case 'right': + x = zrWidth - totalWidth - padding[1] - toolboxOption.borderWidth; + break; + default: + x = toolboxOption.x - 0; + x = isNaN(x) ? 0 : x; + break; + } + var y; + var zrHeight = this.zr.getHeight(); + switch (toolboxOption.y) { + case 'top': + y = padding[0] + toolboxOption.borderWidth; + break; + case 'bottom': + y = zrHeight - totalHeight - padding[2] - toolboxOption.borderWidth; + break; + case 'center': + y = Math.floor((zrHeight - totalHeight) / 2); + break; + default: + y = toolboxOption.y - 0; + y = isNaN(y) ? 0 : y; + break; + } + return { + x: x, + y: y, + width: totalWidth, + height: totalHeight + }; + }, + __onmousemove: function (param) { + if (this._marking) { + this._markShape.style.xEnd = zrEvent.getX(param.event); + this._markShape.style.yEnd = zrEvent.getY(param.event); + this.zr.addHoverShape(this._markShape); + } + if (this._zooming) { + this._zoomShape.style.width = zrEvent.getX(param.event) - this._zoomShape.style.x; + this._zoomShape.style.height = zrEvent.getY(param.event) - this._zoomShape.style.y; + this.zr.addHoverShape(this._zoomShape); + this.dom.style.cursor = 'crosshair'; + zrEvent.stop(param.event); + } + if (this._zoomStart && (this.dom.style.cursor != 'pointer' && this.dom.style.cursor != 'move')) { + this.dom.style.cursor = 'crosshair'; + } + }, + __onmousedown: function (param) { + if (param.target) { + return; + } + this._zooming = true; + var x = zrEvent.getX(param.event); + var y = zrEvent.getY(param.event); + var zoomOption = this.option.dataZoom || {}; + this._zoomShape = new RectangleShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: x, + y: y, + width: 1, + height: 1, + brushType: 'both' + }, + highlightStyle: { + lineWidth: 2, + color: zoomOption.fillerColor || ecConfig.dataZoom.fillerColor, + strokeColor: zoomOption.handleColor || ecConfig.dataZoom.handleColor, + brushType: 'both' + } + }); + this.zr.addHoverShape(this._zoomShape); + return true; + }, + __onmouseup: function () { + if (!this._zoomShape || Math.abs(this._zoomShape.style.width) < 10 || Math.abs(this._zoomShape.style.height) < 10) { + this._zooming = false; + return true; + } + if (this._zooming && this.component.dataZoom) { + this._zooming = false; + var zoom = this.component.dataZoom.rectZoom(this._zoomShape.style); + if (zoom) { + this._zoomQueue.push({ + start: zoom.start, + end: zoom.end, + start2: zoom.start2, + end2: zoom.end2 + }); + this._iconEnable(this._iconShapeMap['dataZoomReset']); + this.zr.refreshNextFrame(); + } + } + return true; + }, + __onclick: function (param) { + if (param.target) { + return; + } + if (this._marking) { + this._marking = false; + this._markShapeList.push(this._markShape); + this._iconEnable(this._iconShapeMap['markUndo']); + this._iconEnable(this._iconShapeMap['markClear']); + this.zr.addShape(this._markShape); + this.zr.refreshNextFrame(); + } else if (this._markStart) { + this._marking = true; + var x = zrEvent.getX(param.event); + var y = zrEvent.getY(param.event); + this._markShape = new LineShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + xStart: x, + yStart: y, + xEnd: x, + yEnd: y, + lineWidth: this.query(this.option, 'toolbox.feature.mark.lineStyle.width'), + strokeColor: this.query(this.option, 'toolbox.feature.mark.lineStyle.color'), + lineType: this.query(this.option, 'toolbox.feature.mark.lineStyle.type') + } + }); + this.zr.addHoverShape(this._markShape); + } + }, + __onMark: function (param) { + var target = param.target; + if (this._marking || this._markStart) { + this._resetMark(); + this.zr.refreshNextFrame(); + } else { + this._resetZoom(); + this.zr.modShape(target.id, { style: { strokeColor: this._enableColor } }); + this.zr.refreshNextFrame(); + this._markStart = true; + var self = this; + setTimeout(function () { + self.zr && self.zr.on(zrConfig.EVENT.CLICK, self._onclick) && self.zr.on(zrConfig.EVENT.MOUSEMOVE, self._onmousemove); + }, 10); + } + return true; + }, + __onMarkUndo: function () { + if (this._marking) { + this._marking = false; + } else { + var len = this._markShapeList.length; + if (len >= 1) { + var target = this._markShapeList[len - 1]; + this.zr.delShape(target.id); + this.zr.refreshNextFrame(); + this._markShapeList.pop(); + if (len === 1) { + this._iconDisable(this._iconShapeMap['markUndo']); + this._iconDisable(this._iconShapeMap['markClear']); + } + } + } + return true; + }, + __onMarkClear: function () { + if (this._marking) { + this._marking = false; + } + var len = this._markShapeList.length; + if (len > 0) { + while (len--) { + this.zr.delShape(this._markShapeList.pop().id); + } + this._iconDisable(this._iconShapeMap['markUndo']); + this._iconDisable(this._iconShapeMap['markClear']); + this.zr.refreshNextFrame(); + } + return true; + }, + __onDataZoom: function (param) { + var target = param.target; + if (this._zooming || this._zoomStart) { + this._resetZoom(); + this.zr.refreshNextFrame(); + this.dom.style.cursor = 'default'; + } else { + this._resetMark(); + this.zr.modShape(target.id, { style: { strokeColor: this._enableColor } }); + this.zr.refreshNextFrame(); + this._zoomStart = true; + var self = this; + setTimeout(function () { + self.zr && self.zr.on(zrConfig.EVENT.MOUSEDOWN, self._onmousedown) && self.zr.on(zrConfig.EVENT.MOUSEUP, self._onmouseup) && self.zr.on(zrConfig.EVENT.MOUSEMOVE, self._onmousemove); + }, 10); + this.dom.style.cursor = 'crosshair'; + } + return true; + }, + __onDataZoomReset: function () { + if (this._zooming) { + this._zooming = false; + } + this._zoomQueue.pop(); + if (this._zoomQueue.length > 0) { + this.component.dataZoom.absoluteZoom(this._zoomQueue[this._zoomQueue.length - 1]); + } else { + this.component.dataZoom.rectZoom(); + this._iconDisable(this._iconShapeMap['dataZoomReset']); + this.zr.refreshNextFrame(); + } + return true; + }, + _resetMark: function () { + this._marking = false; + if (this._markStart) { + this._markStart = false; + if (this._iconShapeMap['mark']) { + this.zr.modShape(this._iconShapeMap['mark'].id, { style: { strokeColor: this._iconShapeMap['mark'].highlightStyle.strokeColor } }); + } + this.zr.un(zrConfig.EVENT.CLICK, this._onclick); + this.zr.un(zrConfig.EVENT.MOUSEMOVE, this._onmousemove); + } + }, + _resetZoom: function () { + this._zooming = false; + if (this._zoomStart) { + this._zoomStart = false; + if (this._iconShapeMap['dataZoom']) { + this.zr.modShape(this._iconShapeMap['dataZoom'].id, { style: { strokeColor: this._iconShapeMap['dataZoom'].highlightStyle.strokeColor } }); + } + this.zr.un(zrConfig.EVENT.MOUSEDOWN, this._onmousedown); + this.zr.un(zrConfig.EVENT.MOUSEUP, this._onmouseup); + this.zr.un(zrConfig.EVENT.MOUSEMOVE, this._onmousemove); + } + }, + _iconDisable: function (target) { + if (target.type != 'image') { + this.zr.modShape(target.id, { + hoverable: false, + clickable: false, + style: { strokeColor: this._disableColor } + }); + } else { + this.zr.modShape(target.id, { + hoverable: false, + clickable: false, + style: { opacity: 0.3 } + }); + } + }, + _iconEnable: function (target) { + if (target.type != 'image') { + this.zr.modShape(target.id, { + hoverable: true, + clickable: true, + style: { strokeColor: target.highlightStyle.strokeColor } + }); + } else { + this.zr.modShape(target.id, { + hoverable: true, + clickable: true, + style: { opacity: 0.8 } + }); + } + }, + __onDataView: function () { + this._dataView.show(this.option); + return true; + }, + __onRestore: function () { + this._resetMark(); + this._resetZoom(); + this.messageCenter.dispatch(ecConfig.EVENT.RESTORE, null, null, this.myChart); + return true; + }, + __onSaveAsImage: function () { + var saveOption = this.option.toolbox.feature.saveAsImage; + var imgType = saveOption.type || 'png'; + if (imgType != 'png' && imgType != 'jpeg') { + imgType = 'png'; + } + var image; + if (!this.myChart.isConnected()) { + image = this.zr.toDataURL('image/' + imgType, this.option.backgroundColor && this.option.backgroundColor.replace(' ', '') === 'rgba(0,0,0,0)' ? '#fff' : this.option.backgroundColor); + } else { + image = this.myChart.getConnectedDataURL(imgType); + } + var downloadDiv = document.createElement('div'); + downloadDiv.id = '__echarts_download_wrap__'; + downloadDiv.style.cssText = 'position:fixed;' + 'z-index:99999;' + 'display:block;' + 'top:0;left:0;' + 'background-color:rgba(33,33,33,0.5);' + 'text-align:center;' + 'width:100%;' + 'height:100%;' + 'line-height:' + document.documentElement.clientHeight + 'px;'; + var downloadLink = document.createElement('a'); + downloadLink.href = image; + downloadLink.setAttribute('download', (saveOption.name ? saveOption.name : this.option.title && (this.option.title.text || this.option.title.subtext) ? this.option.title.text || this.option.title.subtext : 'ECharts') + '.' + imgType); + downloadLink.innerHTML = ''; + downloadDiv.appendChild(downloadLink); + document.body.appendChild(downloadDiv); + downloadLink = null; + downloadDiv = null; + setTimeout(function () { + var _d = document.getElementById('__echarts_download_wrap__'); + if (_d) { + _d.onclick = function () { + var d = document.getElementById('__echarts_download_wrap__'); + d.onclick = null; + d.innerHTML = ''; + document.body.removeChild(d); + d = null; + }; + _d = null; + } + }, 500); + return; + }, + __onMagicType: function (param) { + this._resetMark(); + var itemName = param.target._name; + if (!this._magicType[itemName]) { + this._magicType[itemName] = true; + if (itemName === ecConfig.CHART_TYPE_LINE) { + this._magicType[ecConfig.CHART_TYPE_BAR] = false; + } else if (itemName === ecConfig.CHART_TYPE_BAR) { + this._magicType[ecConfig.CHART_TYPE_LINE] = false; + } + if (itemName === ecConfig.CHART_TYPE_PIE) { + this._magicType[ecConfig.CHART_TYPE_FUNNEL] = false; + } else if (itemName === ecConfig.CHART_TYPE_FUNNEL) { + this._magicType[ecConfig.CHART_TYPE_PIE] = false; + } + if (itemName === ecConfig.CHART_TYPE_FORCE) { + this._magicType[ecConfig.CHART_TYPE_CHORD] = false; + } else if (itemName === ecConfig.CHART_TYPE_CHORD) { + this._magicType[ecConfig.CHART_TYPE_FORCE] = false; + } + if (itemName === _MAGICTYPE_STACK) { + this._magicType[_MAGICTYPE_TILED] = false; + } else if (itemName === _MAGICTYPE_TILED) { + this._magicType[_MAGICTYPE_STACK] = false; + } + this.messageCenter.dispatch(ecConfig.EVENT.MAGIC_TYPE_CHANGED, param.event, { magicType: this._magicType }, this.myChart); + } + return true; + }, + setMagicType: function (magicType) { + this._resetMark(); + this._magicType = magicType; + !this._isSilence && this.messageCenter.dispatch(ecConfig.EVENT.MAGIC_TYPE_CHANGED, null, { magicType: this._magicType }, this.myChart); + }, + __onCustomHandler: function (param) { + var target = param.target.style.iconType; + var featureHandler = this.option.toolbox.feature[target].onclick; + if (typeof featureHandler === 'function') { + featureHandler.call(this, this.option); + } + }, + reset: function (newOption, isRestore) { + isRestore && this.clear(); + if (this.query(newOption, 'toolbox.show') && this.query(newOption, 'toolbox.feature.magicType.show')) { + var magicType = newOption.toolbox.feature.magicType.type; + var len = magicType.length; + this._magicMap = {}; + while (len--) { + this._magicMap[magicType[len]] = true; + } + len = newOption.series.length; + var oriType; + var axis; + while (len--) { + oriType = newOption.series[len].type; + if (this._magicMap[oriType]) { + axis = newOption.xAxis instanceof Array ? newOption.xAxis[newOption.series[len].xAxisIndex || 0] : newOption.xAxis; + if (axis && (axis.type || 'category') === 'category') { + axis.__boundaryGap = axis.boundaryGap != null ? axis.boundaryGap : true; + } + axis = newOption.yAxis instanceof Array ? newOption.yAxis[newOption.series[len].yAxisIndex || 0] : newOption.yAxis; + if (axis && axis.type === 'category') { + axis.__boundaryGap = axis.boundaryGap != null ? axis.boundaryGap : true; + } + newOption.series[len].__type = oriType; + newOption.series[len].__itemStyle = zrUtil.clone(newOption.series[len].itemStyle || {}); + } + if (this._magicMap[_MAGICTYPE_STACK] || this._magicMap[_MAGICTYPE_TILED]) { + newOption.series[len].__stack = newOption.series[len].stack; + } + } + } + this._magicType = isRestore ? {} : this._magicType || {}; + for (var itemName in this._magicType) { + if (this._magicType[itemName]) { + this.option = newOption; + this.getMagicOption(); + break; + } + } + var zoomOption = newOption.dataZoom; + if (zoomOption && zoomOption.show) { + var start = zoomOption.start != null && zoomOption.start >= 0 && zoomOption.start <= 100 ? zoomOption.start : 0; + var end = zoomOption.end != null && zoomOption.end >= 0 && zoomOption.end <= 100 ? zoomOption.end : 100; + if (start > end) { + start = start + end; + end = start - end; + start = start - end; + } + this._zoomQueue = [{ + start: start, + end: end, + start2: 0, + end2: 100 + }]; + } else { + this._zoomQueue = []; + } + }, + getMagicOption: function () { + var axis; + var chartType; + if (this._magicType[ecConfig.CHART_TYPE_LINE] || this._magicType[ecConfig.CHART_TYPE_BAR]) { + var boundaryGap = this._magicType[ecConfig.CHART_TYPE_LINE] ? false : true; + for (var i = 0, l = this.option.series.length; i < l; i++) { + chartType = this.option.series[i].type; + if (chartType == ecConfig.CHART_TYPE_LINE || chartType == ecConfig.CHART_TYPE_BAR) { + axis = this.option.xAxis instanceof Array ? this.option.xAxis[this.option.series[i].xAxisIndex || 0] : this.option.xAxis; + if (axis && (axis.type || 'category') === 'category') { + axis.boundaryGap = boundaryGap ? true : axis.__boundaryGap; + } + axis = this.option.yAxis instanceof Array ? this.option.yAxis[this.option.series[i].yAxisIndex || 0] : this.option.yAxis; + if (axis && axis.type === 'category') { + axis.boundaryGap = boundaryGap ? true : axis.__boundaryGap; + } + } + } + this._defaultMagic(ecConfig.CHART_TYPE_LINE, ecConfig.CHART_TYPE_BAR); + } + this._defaultMagic(ecConfig.CHART_TYPE_CHORD, ecConfig.CHART_TYPE_FORCE); + this._defaultMagic(ecConfig.CHART_TYPE_PIE, ecConfig.CHART_TYPE_FUNNEL); + if (this._magicType[_MAGICTYPE_STACK] || this._magicType[_MAGICTYPE_TILED]) { + for (var i = 0, l = this.option.series.length; i < l; i++) { + if (this._magicType[_MAGICTYPE_STACK]) { + this.option.series[i].stack = '_ECHARTS_STACK_KENER_2014_'; + chartType = _MAGICTYPE_STACK; + } else if (this._magicType[_MAGICTYPE_TILED]) { + this.option.series[i].stack = null; + chartType = _MAGICTYPE_TILED; + } + if (this._featureOption[chartType + 'Chart']) { + zrUtil.merge(this.option.series[i], this._featureOption[chartType + 'Chart'] || {}, true); + } + } + } + return this.option; + }, + _defaultMagic: function (cType1, cType2) { + if (this._magicType[cType1] || this._magicType[cType2]) { + for (var i = 0, l = this.option.series.length; i < l; i++) { + var chartType = this.option.series[i].type; + if (chartType == cType1 || chartType == cType2) { + this.option.series[i].type = this._magicType[cType1] ? cType1 : cType2; + this.option.series[i].itemStyle = zrUtil.clone(this.option.series[i].__itemStyle); + chartType = this.option.series[i].type; + if (this._featureOption[chartType + 'Chart']) { + zrUtil.merge(this.option.series[i], this._featureOption[chartType + 'Chart'] || {}, true); + } + } + } + } + }, + silence: function (s) { + this._isSilence = s; + }, + resize: function () { + this._resetMark(); + this.clear(); + if (this.option && this.option.toolbox && this.option.toolbox.show) { + this._buildShape(); + } + if (this._dataView) { + this._dataView.resize(); + } + }, + hideDataView: function () { + if (this._dataView) { + this._dataView.hide(); + } + }, + clear: function (notMark) { + if (this.zr) { + this.zr.delShape(this.shapeList); + this.shapeList = []; + if (!notMark) { + this.zr.delShape(this._markShapeList); + this._markShapeList = []; + } + } + }, + onbeforDispose: function () { + if (this._dataView) { + this._dataView.dispose(); + this._dataView = null; + } + this._markShapeList = null; + }, + refresh: function (newOption) { + if (newOption) { + this._resetMark(); + this._resetZoom(); + newOption.toolbox = this.reformOption(newOption.toolbox); + this.option = newOption; + this.clear(true); + if (newOption.toolbox.show) { + this._buildShape(); + } + this.hideDataView(); + } + } + }; + zrUtil.inherits(Toolbox, Base); + require('../component').define('toolbox', Toolbox); + return Toolbox; +});define('echarts/component', [], function () { + var self = {}; + var _componentLibrary = {}; + self.define = function (name, clazz) { + _componentLibrary[name] = clazz; + return self; + }; + self.get = function (name) { + return _componentLibrary[name]; + }; + return self; +});define('echarts/component/title', [ + 'require', + './base', + 'zrender/shape/Text', + 'zrender/shape/Rectangle', + '../config', + 'zrender/tool/util', + 'zrender/tool/area', + 'zrender/tool/color', + '../component' +], function (require) { + var Base = require('./base'); + var TextShape = require('zrender/shape/Text'); + var RectangleShape = require('zrender/shape/Rectangle'); + var ecConfig = require('../config'); + ecConfig.title = { + zlevel: 0, + z: 6, + show: true, + text: '', + subtext: '', + x: 'left', + y: 'top', + backgroundColor: 'rgba(0,0,0,0)', + borderColor: '#ccc', + borderWidth: 0, + padding: 5, + itemGap: 5, + textStyle: { + fontSize: 18, + fontWeight: 'bolder', + color: '#333' + }, + subtextStyle: { color: '#aaa' } + }; + var zrUtil = require('zrender/tool/util'); + var zrArea = require('zrender/tool/area'); + var zrColor = require('zrender/tool/color'); + function Title(ecTheme, messageCenter, zr, option, myChart) { + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + this.refresh(option); + } + Title.prototype = { + type: ecConfig.COMPONENT_TYPE_TITLE, + _buildShape: function () { + if (!this.titleOption.show) { + return; + } + this._itemGroupLocation = this._getItemGroupLocation(); + this._buildBackground(); + this._buildItem(); + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + }, + _buildItem: function () { + var text = this.titleOption.text; + var link = this.titleOption.link; + var target = this.titleOption.target; + var subtext = this.titleOption.subtext; + var sublink = this.titleOption.sublink; + var subtarget = this.titleOption.subtarget; + var font = this.getFont(this.titleOption.textStyle); + var subfont = this.getFont(this.titleOption.subtextStyle); + var x = this._itemGroupLocation.x; + var y = this._itemGroupLocation.y; + var width = this._itemGroupLocation.width; + var height = this._itemGroupLocation.height; + var textShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + y: y, + color: this.titleOption.textStyle.color, + text: text, + textFont: font, + textBaseline: 'top' + }, + highlightStyle: { + color: zrColor.lift(this.titleOption.textStyle.color, 1), + brushType: 'fill' + }, + hoverable: false + }; + if (link) { + textShape.hoverable = true; + textShape.clickable = true; + textShape.onclick = function () { + if (!target || target != 'self') { + window.open(link); + } else { + window.location = link; + } + }; + } + var subtextShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + y: y + height, + color: this.titleOption.subtextStyle.color, + text: subtext, + textFont: subfont, + textBaseline: 'bottom' + }, + highlightStyle: { + color: zrColor.lift(this.titleOption.subtextStyle.color, 1), + brushType: 'fill' + }, + hoverable: false + }; + if (sublink) { + subtextShape.hoverable = true; + subtextShape.clickable = true; + subtextShape.onclick = function () { + if (!subtarget || subtarget != 'self') { + window.open(sublink); + } else { + window.location = sublink; + } + }; + } + switch (this.titleOption.x) { + case 'center': + textShape.style.x = subtextShape.style.x = x + width / 2; + textShape.style.textAlign = subtextShape.style.textAlign = 'center'; + break; + case 'left': + textShape.style.x = subtextShape.style.x = x; + textShape.style.textAlign = subtextShape.style.textAlign = 'left'; + break; + case 'right': + textShape.style.x = subtextShape.style.x = x + width; + textShape.style.textAlign = subtextShape.style.textAlign = 'right'; + break; + default: + x = this.titleOption.x - 0; + x = isNaN(x) ? 0 : x; + textShape.style.x = subtextShape.style.x = x; + break; + } + if (this.titleOption.textAlign) { + textShape.style.textAlign = subtextShape.style.textAlign = this.titleOption.textAlign; + } + this.shapeList.push(new TextShape(textShape)); + subtext !== '' && this.shapeList.push(new TextShape(subtextShape)); + }, + _buildBackground: function () { + var padding = this.reformCssArray(this.titleOption.padding); + this.shapeList.push(new RectangleShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: this._itemGroupLocation.x - padding[3], + y: this._itemGroupLocation.y - padding[0], + width: this._itemGroupLocation.width + padding[3] + padding[1], + height: this._itemGroupLocation.height + padding[0] + padding[2], + brushType: this.titleOption.borderWidth === 0 ? 'fill' : 'both', + color: this.titleOption.backgroundColor, + strokeColor: this.titleOption.borderColor, + lineWidth: this.titleOption.borderWidth + } + })); + }, + _getItemGroupLocation: function () { + var padding = this.reformCssArray(this.titleOption.padding); + var text = this.titleOption.text; + var subtext = this.titleOption.subtext; + var font = this.getFont(this.titleOption.textStyle); + var subfont = this.getFont(this.titleOption.subtextStyle); + var totalWidth = Math.max(zrArea.getTextWidth(text, font), zrArea.getTextWidth(subtext, subfont)); + var totalHeight = zrArea.getTextHeight(text, font) + (subtext === '' ? 0 : this.titleOption.itemGap + zrArea.getTextHeight(subtext, subfont)); + var x; + var zrWidth = this.zr.getWidth(); + switch (this.titleOption.x) { + case 'center': + x = Math.floor((zrWidth - totalWidth) / 2); + break; + case 'left': + x = padding[3] + this.titleOption.borderWidth; + break; + case 'right': + x = zrWidth - totalWidth - padding[1] - this.titleOption.borderWidth; + break; + default: + x = this.titleOption.x - 0; + x = isNaN(x) ? 0 : x; + break; + } + var y; + var zrHeight = this.zr.getHeight(); + switch (this.titleOption.y) { + case 'top': + y = padding[0] + this.titleOption.borderWidth; + break; + case 'bottom': + y = zrHeight - totalHeight - padding[2] - this.titleOption.borderWidth; + break; + case 'center': + y = Math.floor((zrHeight - totalHeight) / 2); + break; + default: + y = this.titleOption.y - 0; + y = isNaN(y) ? 0 : y; + break; + } + return { + x: x, + y: y, + width: totalWidth, + height: totalHeight + }; + }, + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.option.title = this.reformOption(this.option.title); + this.titleOption = this.option.title; + this.titleOption.textStyle = this.getTextStyle(this.titleOption.textStyle); + this.titleOption.subtextStyle = this.getTextStyle(this.titleOption.subtextStyle); + } + this.clear(); + this._buildShape(); + } + }; + zrUtil.inherits(Title, Base); + require('../component').define('title', Title); + return Title; +});define('echarts/component/tooltip', [ + 'require', + './base', + '../util/shape/Cross', + 'zrender/shape/Line', + 'zrender/shape/Rectangle', + '../config', + '../util/ecData', + 'zrender/config', + 'zrender/tool/event', + 'zrender/tool/area', + 'zrender/tool/color', + 'zrender/tool/util', + 'zrender/shape/Base', + '../component' +], function (require) { + var Base = require('./base'); + var CrossShape = require('../util/shape/Cross'); + var LineShape = require('zrender/shape/Line'); + var RectangleShape = require('zrender/shape/Rectangle'); + var rectangleInstance = new RectangleShape({}); + var ecConfig = require('../config'); + ecConfig.tooltip = { + zlevel: 1, + z: 8, + show: true, + showContent: true, + trigger: 'item', + islandFormatter: '{a}
{b} : {c}', + showDelay: 20, + hideDelay: 100, + transitionDuration: 0.4, + enterable: false, + backgroundColor: 'rgba(0,0,0,0.7)', + borderColor: '#333', + borderRadius: 4, + borderWidth: 0, + padding: 5, + axisPointer: { + type: 'line', + lineStyle: { + color: '#48b', + width: 2, + type: 'solid' + }, + crossStyle: { + color: '#1e90ff', + width: 1, + type: 'dashed' + }, + shadowStyle: { + color: 'rgba(150,150,150,0.3)', + width: 'auto', + type: 'default' + } + }, + textStyle: { color: '#fff' } + }; + var ecData = require('../util/ecData'); + var zrConfig = require('zrender/config'); + var zrEvent = require('zrender/tool/event'); + var zrArea = require('zrender/tool/area'); + var zrColor = require('zrender/tool/color'); + var zrUtil = require('zrender/tool/util'); + var zrShapeBase = require('zrender/shape/Base'); + function Tooltip(ecTheme, messageCenter, zr, option, myChart) { + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + this.dom = myChart.dom; + var self = this; + self._onmousemove = function (param) { + return self.__onmousemove(param); + }; + self._onglobalout = function (param) { + return self.__onglobalout(param); + }; + this.zr.on(zrConfig.EVENT.MOUSEMOVE, self._onmousemove); + this.zr.on(zrConfig.EVENT.GLOBALOUT, self._onglobalout); + self._hide = function (param) { + return self.__hide(param); + }; + self._tryShow = function (param) { + return self.__tryShow(param); + }; + self._refixed = function (param) { + return self.__refixed(param); + }; + self._setContent = function (ticket, res) { + return self.__setContent(ticket, res); + }; + this._tDom = this._tDom || document.createElement('div'); + this._tDom.onselectstart = function () { + return false; + }; + this._tDom.onmouseover = function () { + self._mousein = true; + }; + this._tDom.onmouseout = function () { + self._mousein = false; + }; + this._tDom.className = 'echarts-tooltip'; + this._tDom.style.position = 'absolute'; + this.hasAppend = false; + this._axisLineShape && this.zr.delShape(this._axisLineShape.id); + this._axisLineShape = new LineShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + invisible: true, + hoverable: false + }); + this.shapeList.push(this._axisLineShape); + this.zr.addShape(this._axisLineShape); + this._axisShadowShape && this.zr.delShape(this._axisShadowShape.id); + this._axisShadowShape = new LineShape({ + zlevel: this.getZlevelBase(), + z: 1, + invisible: true, + hoverable: false + }); + this.shapeList.push(this._axisShadowShape); + this.zr.addShape(this._axisShadowShape); + this._axisCrossShape && this.zr.delShape(this._axisCrossShape.id); + this._axisCrossShape = new CrossShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + invisible: true, + hoverable: false + }); + this.shapeList.push(this._axisCrossShape); + this.zr.addShape(this._axisCrossShape); + this.showing = false; + this.refresh(option); + } + Tooltip.prototype = { + type: ecConfig.COMPONENT_TYPE_TOOLTIP, + _gCssText: 'position:absolute;display:block;border-style:solid;white-space:nowrap;', + _style: function (opt) { + if (!opt) { + return ''; + } + var cssText = []; + if (opt.transitionDuration) { + var transitionText = 'left ' + opt.transitionDuration + 's,' + 'top ' + opt.transitionDuration + 's'; + cssText.push('transition:' + transitionText); + cssText.push('-moz-transition:' + transitionText); + cssText.push('-webkit-transition:' + transitionText); + cssText.push('-o-transition:' + transitionText); + } + if (opt.backgroundColor) { + cssText.push('background-Color:' + zrColor.toHex(opt.backgroundColor)); + cssText.push('filter:alpha(opacity=70)'); + cssText.push('background-Color:' + opt.backgroundColor); + } + if (opt.borderWidth != null) { + cssText.push('border-width:' + opt.borderWidth + 'px'); + } + if (opt.borderColor != null) { + cssText.push('border-color:' + opt.borderColor); + } + if (opt.borderRadius != null) { + cssText.push('border-radius:' + opt.borderRadius + 'px'); + cssText.push('-moz-border-radius:' + opt.borderRadius + 'px'); + cssText.push('-webkit-border-radius:' + opt.borderRadius + 'px'); + cssText.push('-o-border-radius:' + opt.borderRadius + 'px'); + } + var textStyle = opt.textStyle; + if (textStyle) { + textStyle.color && cssText.push('color:' + textStyle.color); + textStyle.decoration && cssText.push('text-decoration:' + textStyle.decoration); + textStyle.align && cssText.push('text-align:' + textStyle.align); + textStyle.fontFamily && cssText.push('font-family:' + textStyle.fontFamily); + textStyle.fontSize && cssText.push('font-size:' + textStyle.fontSize + 'px'); + textStyle.fontSize && cssText.push('line-height:' + Math.round(textStyle.fontSize * 3 / 2) + 'px'); + textStyle.fontStyle && cssText.push('font-style:' + textStyle.fontStyle); + textStyle.fontWeight && cssText.push('font-weight:' + textStyle.fontWeight); + } + var padding = opt.padding; + if (padding != null) { + padding = this.reformCssArray(padding); + cssText.push('padding:' + padding[0] + 'px ' + padding[1] + 'px ' + padding[2] + 'px ' + padding[3] + 'px'); + } + cssText = cssText.join(';') + ';'; + return cssText; + }, + __hide: function () { + this._lastDataIndex = -1; + this._lastSeriesIndex = -1; + this._lastItemTriggerId = -1; + if (this._tDom) { + this._tDom.style.display = 'none'; + } + var needRefresh = false; + if (!this._axisLineShape.invisible) { + this._axisLineShape.invisible = true; + this.zr.modShape(this._axisLineShape.id); + needRefresh = true; + } + if (!this._axisShadowShape.invisible) { + this._axisShadowShape.invisible = true; + this.zr.modShape(this._axisShadowShape.id); + needRefresh = true; + } + if (!this._axisCrossShape.invisible) { + this._axisCrossShape.invisible = true; + this.zr.modShape(this._axisCrossShape.id); + needRefresh = true; + } + if (this._lastTipShape && this._lastTipShape.tipShape.length > 0) { + this.zr.delShape(this._lastTipShape.tipShape); + this._lastTipShape = false; + this.shapeList.length = 2; + } + needRefresh && this.zr.refreshNextFrame(); + this.showing = false; + }, + _show: function (position, x, y, specialCssText) { + var domHeight = this._tDom.offsetHeight; + var domWidth = this._tDom.offsetWidth; + if (position) { + if (typeof position === 'function') { + position = position([ + x, + y + ]); + } + if (position instanceof Array) { + x = position[0]; + y = position[1]; + } + } + if (x + domWidth > this._zrWidth) { + x -= domWidth + 40; + } + if (y + domHeight > this._zrHeight) { + y -= domHeight - 20; + } + if (y < 20) { + y = 0; + } + this._tDom.style.cssText = this._gCssText + this._defaultCssText + (specialCssText ? specialCssText : '') + 'left:' + x + 'px;top:' + y + 'px;'; + if (domHeight < 10 || domWidth < 10) { + setTimeout(this._refixed, 20); + } + this.showing = true; + }, + __refixed: function () { + if (this._tDom) { + var cssText = ''; + var domHeight = this._tDom.offsetHeight; + var domWidth = this._tDom.offsetWidth; + if (this._tDom.offsetLeft + domWidth > this._zrWidth) { + cssText += 'left:' + (this._zrWidth - domWidth - 20) + 'px;'; + } + if (this._tDom.offsetTop + domHeight > this._zrHeight) { + cssText += 'top:' + (this._zrHeight - domHeight - 10) + 'px;'; + } + if (cssText !== '') { + this._tDom.style.cssText += cssText; + } + } + }, + __tryShow: function () { + var needShow; + var trigger; + if (!this._curTarget) { + this._findPolarTrigger() || this._findAxisTrigger(); + } else { + if (this._curTarget._type === 'island' && this.option.tooltip.show) { + this._showItemTrigger(); + return; + } + var serie = ecData.get(this._curTarget, 'series'); + var data = ecData.get(this._curTarget, 'data'); + needShow = this.deepQuery([ + data, + serie, + this.option + ], 'tooltip.show'); + if (serie == null || data == null || !needShow) { + clearTimeout(this._hidingTicket); + clearTimeout(this._showingTicket); + this._hidingTicket = setTimeout(this._hide, this._hideDelay); + } else { + trigger = this.deepQuery([ + data, + serie, + this.option + ], 'tooltip.trigger'); + trigger === 'axis' ? this._showAxisTrigger(serie.xAxisIndex, serie.yAxisIndex, ecData.get(this._curTarget, 'dataIndex')) : this._showItemTrigger(); + } + } + }, + _findAxisTrigger: function () { + if (!this.component.xAxis || !this.component.yAxis) { + this._hidingTicket = setTimeout(this._hide, this._hideDelay); + return; + } + var series = this.option.series; + var xAxisIndex; + var yAxisIndex; + for (var i = 0, l = series.length; i < l; i++) { + if (this.deepQuery([ + series[i], + this.option + ], 'tooltip.trigger') === 'axis') { + xAxisIndex = series[i].xAxisIndex || 0; + yAxisIndex = series[i].yAxisIndex || 0; + if (this.component.xAxis.getAxis(xAxisIndex) && this.component.xAxis.getAxis(xAxisIndex).type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY) { + this._showAxisTrigger(xAxisIndex, yAxisIndex, this._getNearestDataIndex('x', this.component.xAxis.getAxis(xAxisIndex))); + return; + } else if (this.component.yAxis.getAxis(yAxisIndex) && this.component.yAxis.getAxis(yAxisIndex).type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY) { + this._showAxisTrigger(xAxisIndex, yAxisIndex, this._getNearestDataIndex('y', this.component.yAxis.getAxis(yAxisIndex))); + return; + } else { + this._showAxisTrigger(xAxisIndex, yAxisIndex, -1); + return; + } + } + } + if (this.option.tooltip.axisPointer.type === 'cross') { + this._showAxisTrigger(-1, -1, -1); + } + }, + _findPolarTrigger: function () { + if (!this.component.polar) { + return false; + } + var x = zrEvent.getX(this._event); + var y = zrEvent.getY(this._event); + var polarIndex = this.component.polar.getNearestIndex([ + x, + y + ]); + var valueIndex; + if (polarIndex) { + valueIndex = polarIndex.valueIndex; + polarIndex = polarIndex.polarIndex; + } else { + polarIndex = -1; + } + if (polarIndex != -1) { + return this._showPolarTrigger(polarIndex, valueIndex); + } + return false; + }, + _getNearestDataIndex: function (direction, categoryAxis) { + var dataIndex = -1; + var x = zrEvent.getX(this._event); + var y = zrEvent.getY(this._event); + if (direction === 'x') { + var left; + var right; + var xEnd = this.component.grid.getXend(); + var curCoord = categoryAxis.getCoordByIndex(dataIndex); + while (curCoord < xEnd) { + right = curCoord; + if (curCoord <= x) { + left = curCoord; + } else { + break; + } + curCoord = categoryAxis.getCoordByIndex(++dataIndex); + } + if (dataIndex <= 0) { + dataIndex = 0; + } else if (x - left <= right - x) { + dataIndex -= 1; + } else { + if (categoryAxis.getNameByIndex(dataIndex) == null) { + dataIndex -= 1; + } + } + return dataIndex; + } else { + var top; + var bottom; + var yStart = this.component.grid.getY(); + var curCoord = categoryAxis.getCoordByIndex(dataIndex); + while (curCoord > yStart) { + top = curCoord; + if (curCoord >= y) { + bottom = curCoord; + } else { + break; + } + curCoord = categoryAxis.getCoordByIndex(++dataIndex); + } + if (dataIndex <= 0) { + dataIndex = 0; + } else if (y - top >= bottom - y) { + dataIndex -= 1; + } else { + if (categoryAxis.getNameByIndex(dataIndex) == null) { + dataIndex -= 1; + } + } + return dataIndex; + } + return -1; + }, + _showAxisTrigger: function (xAxisIndex, yAxisIndex, dataIndex) { + !this._event.connectTrigger && this.messageCenter.dispatch(ecConfig.EVENT.TOOLTIP_IN_GRID, this._event, null, this.myChart); + if (this.component.xAxis == null || this.component.yAxis == null || xAxisIndex == null || yAxisIndex == null) { + clearTimeout(this._hidingTicket); + clearTimeout(this._showingTicket); + this._hidingTicket = setTimeout(this._hide, this._hideDelay); + return; + } + var series = this.option.series; + var seriesArray = []; + var seriesIndex = []; + var categoryAxis; + var formatter; + var position; + var showContent; + var specialCssText = ''; + if (this.option.tooltip.trigger === 'axis') { + if (!this.option.tooltip.show) { + return; + } + formatter = this.option.tooltip.formatter; + position = this.option.tooltip.position; + } + var axisLayout = xAxisIndex != -1 && this.component.xAxis.getAxis(xAxisIndex).type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY ? 'xAxis' : yAxisIndex != -1 && this.component.yAxis.getAxis(yAxisIndex).type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY ? 'yAxis' : false; + var x; + var y; + if (axisLayout) { + var axisIndex = axisLayout == 'xAxis' ? xAxisIndex : yAxisIndex; + categoryAxis = this.component[axisLayout].getAxis(axisIndex); + for (var i = 0, l = series.length; i < l; i++) { + if (!this._isSelected(series[i].name)) { + continue; + } + if (series[i][axisLayout + 'Index'] === axisIndex && this.deepQuery([ + series[i], + this.option + ], 'tooltip.trigger') === 'axis') { + showContent = this.query(series[i], 'tooltip.showContent') || showContent; + formatter = this.query(series[i], 'tooltip.formatter') || formatter; + position = this.query(series[i], 'tooltip.position') || position; + specialCssText += this._style(this.query(series[i], 'tooltip')); + if (series[i].stack != null && axisLayout == 'xAxis') { + seriesArray.unshift(series[i]); + seriesIndex.unshift(i); + } else { + seriesArray.push(series[i]); + seriesIndex.push(i); + } + } + } + this.messageCenter.dispatch(ecConfig.EVENT.TOOLTIP_HOVER, this._event, { + seriesIndex: seriesIndex, + dataIndex: dataIndex + }, this.myChart); + var rect; + if (axisLayout == 'xAxis') { + x = this.subPixelOptimize(categoryAxis.getCoordByIndex(dataIndex), this._axisLineWidth); + y = zrEvent.getY(this._event); + rect = [ + x, + this.component.grid.getY(), + x, + this.component.grid.getYend() + ]; + } else { + x = zrEvent.getX(this._event); + y = this.subPixelOptimize(categoryAxis.getCoordByIndex(dataIndex), this._axisLineWidth); + rect = [ + this.component.grid.getX(), + y, + this.component.grid.getXend(), + y + ]; + } + this._styleAxisPointer(seriesArray, rect[0], rect[1], rect[2], rect[3], categoryAxis.getGap(), x, y); + } else { + x = zrEvent.getX(this._event); + y = zrEvent.getY(this._event); + this._styleAxisPointer(series, this.component.grid.getX(), y, this.component.grid.getXend(), y, 0, x, y); + if (dataIndex >= 0) { + this._showItemTrigger(true); + } else { + clearTimeout(this._hidingTicket); + clearTimeout(this._showingTicket); + this._tDom.style.display = 'none'; + } + } + if (seriesArray.length > 0) { + this._lastItemTriggerId = -1; + if (this._lastDataIndex != dataIndex || this._lastSeriesIndex != seriesIndex[0]) { + this._lastDataIndex = dataIndex; + this._lastSeriesIndex = seriesIndex[0]; + var data; + var value; + if (typeof formatter === 'function') { + var params = []; + for (var i = 0, l = seriesArray.length; i < l; i++) { + data = seriesArray[i].data[dataIndex]; + value = this.getDataFromOption(data, '-'); + params.push({ + seriesIndex: seriesIndex[i], + seriesName: seriesArray[i].name || '', + series: seriesArray[i], + dataIndex: dataIndex, + data: data, + name: categoryAxis.getNameByIndex(dataIndex), + value: value, + 0: seriesArray[i].name || '', + 1: categoryAxis.getNameByIndex(dataIndex), + 2: value, + 3: data + }); + } + this._curTicket = 'axis:' + dataIndex; + this._tDom.innerHTML = formatter.call(this.myChart, params, this._curTicket, this._setContent); + } else if (typeof formatter === 'string') { + this._curTicket = NaN; + formatter = formatter.replace('{a}', '{a0}').replace('{b}', '{b0}').replace('{c}', '{c0}'); + for (var i = 0, l = seriesArray.length; i < l; i++) { + formatter = formatter.replace('{a' + i + '}', this._encodeHTML(seriesArray[i].name || '')); + formatter = formatter.replace('{b' + i + '}', this._encodeHTML(categoryAxis.getNameByIndex(dataIndex))); + data = seriesArray[i].data[dataIndex]; + data = this.getDataFromOption(data, '-'); + formatter = formatter.replace('{c' + i + '}', data instanceof Array ? data : this.numAddCommas(data)); + } + this._tDom.innerHTML = formatter; + } else { + this._curTicket = NaN; + formatter = this._encodeHTML(categoryAxis.getNameByIndex(dataIndex)); + for (var i = 0, l = seriesArray.length; i < l; i++) { + formatter += '
' + this._encodeHTML(seriesArray[i].name || '') + ' : '; + data = seriesArray[i].data[dataIndex]; + data = this.getDataFromOption(data, '-'); + formatter += data instanceof Array ? data : this.numAddCommas(data); + } + this._tDom.innerHTML = formatter; + } + } + if (showContent === false || !this.option.tooltip.showContent) { + return; + } + if (!this.hasAppend) { + this._tDom.style.left = this._zrWidth / 2 + 'px'; + this._tDom.style.top = this._zrHeight / 2 + 'px'; + this.dom.firstChild.appendChild(this._tDom); + this.hasAppend = true; + } + this._show(position, x + 10, y + 10, specialCssText); + } + }, + _showPolarTrigger: function (polarIndex, dataIndex) { + if (this.component.polar == null || polarIndex == null || dataIndex == null || dataIndex < 0) { + return false; + } + var series = this.option.series; + var seriesArray = []; + var seriesIndex = []; + var formatter; + var position; + var showContent; + var specialCssText = ''; + if (this.option.tooltip.trigger === 'axis') { + if (!this.option.tooltip.show) { + return false; + } + formatter = this.option.tooltip.formatter; + position = this.option.tooltip.position; + } + var indicatorName = this.option.polar[polarIndex].indicator[dataIndex].text; + for (var i = 0, l = series.length; i < l; i++) { + if (!this._isSelected(series[i].name)) { + continue; + } + if (series[i].polarIndex === polarIndex && this.deepQuery([ + series[i], + this.option + ], 'tooltip.trigger') === 'axis') { + showContent = this.query(series[i], 'tooltip.showContent') || showContent; + formatter = this.query(series[i], 'tooltip.formatter') || formatter; + position = this.query(series[i], 'tooltip.position') || position; + specialCssText += this._style(this.query(series[i], 'tooltip')); + seriesArray.push(series[i]); + seriesIndex.push(i); + } + } + if (seriesArray.length > 0) { + var polarData; + var data; + var value; + var params = []; + for (var i = 0, l = seriesArray.length; i < l; i++) { + polarData = seriesArray[i].data; + for (var j = 0, k = polarData.length; j < k; j++) { + data = polarData[j]; + if (!this._isSelected(data.name)) { + continue; + } + data = data != null ? data : { + name: '', + value: { dataIndex: '-' } + }; + value = this.getDataFromOption(data.value[dataIndex]); + params.push({ + seriesIndex: seriesIndex[i], + seriesName: seriesArray[i].name || '', + series: seriesArray[i], + dataIndex: dataIndex, + data: data, + name: data.name, + indicator: indicatorName, + value: value, + 0: seriesArray[i].name || '', + 1: data.name, + 2: value, + 3: indicatorName + }); + } + } + if (params.length <= 0) { + return; + } + this._lastItemTriggerId = -1; + if (this._lastDataIndex != dataIndex || this._lastSeriesIndex != seriesIndex[0]) { + this._lastDataIndex = dataIndex; + this._lastSeriesIndex = seriesIndex[0]; + if (typeof formatter === 'function') { + this._curTicket = 'axis:' + dataIndex; + this._tDom.innerHTML = formatter.call(this.myChart, params, this._curTicket, this._setContent); + } else if (typeof formatter === 'string') { + formatter = formatter.replace('{a}', '{a0}').replace('{b}', '{b0}').replace('{c}', '{c0}').replace('{d}', '{d0}'); + for (var i = 0, l = params.length; i < l; i++) { + formatter = formatter.replace('{a' + i + '}', this._encodeHTML(params[i].seriesName)); + formatter = formatter.replace('{b' + i + '}', this._encodeHTML(params[i].name)); + formatter = formatter.replace('{c' + i + '}', this.numAddCommas(params[i].value)); + formatter = formatter.replace('{d' + i + '}', this._encodeHTML(params[i].indicator)); + } + this._tDom.innerHTML = formatter; + } else { + formatter = this._encodeHTML(params[0].name) + '
' + this._encodeHTML(params[0].indicator) + ' : ' + this.numAddCommas(params[0].value); + for (var i = 1, l = params.length; i < l; i++) { + formatter += '
' + this._encodeHTML(params[i].name) + '
'; + formatter += this._encodeHTML(params[i].indicator) + ' : ' + this.numAddCommas(params[i].value); + } + this._tDom.innerHTML = formatter; + } + } + if (showContent === false || !this.option.tooltip.showContent) { + return; + } + if (!this.hasAppend) { + this._tDom.style.left = this._zrWidth / 2 + 'px'; + this._tDom.style.top = this._zrHeight / 2 + 'px'; + this.dom.firstChild.appendChild(this._tDom); + this.hasAppend = true; + } + this._show(position, zrEvent.getX(this._event), zrEvent.getY(this._event), specialCssText); + return true; + } + }, + _showItemTrigger: function (axisTrigger) { + if (!this._curTarget) { + return; + } + var serie = ecData.get(this._curTarget, 'series'); + var seriesIndex = ecData.get(this._curTarget, 'seriesIndex'); + var data = ecData.get(this._curTarget, 'data'); + var dataIndex = ecData.get(this._curTarget, 'dataIndex'); + var name = ecData.get(this._curTarget, 'name'); + var value = ecData.get(this._curTarget, 'value'); + var special = ecData.get(this._curTarget, 'special'); + var special2 = ecData.get(this._curTarget, 'special2'); + var queryTarget = [ + data, + serie, + this.option + ]; + var formatter; + var position; + var showContent; + var specialCssText = ''; + if (this._curTarget._type != 'island') { + var trigger = axisTrigger ? 'axis' : 'item'; + if (this.option.tooltip.trigger === trigger) { + formatter = this.option.tooltip.formatter; + position = this.option.tooltip.position; + } + if (this.query(serie, 'tooltip.trigger') === trigger) { + showContent = this.query(serie, 'tooltip.showContent') || showContent; + formatter = this.query(serie, 'tooltip.formatter') || formatter; + position = this.query(serie, 'tooltip.position') || position; + specialCssText += this._style(this.query(serie, 'tooltip')); + } + showContent = this.query(data, 'tooltip.showContent') || showContent; + formatter = this.query(data, 'tooltip.formatter') || formatter; + position = this.query(data, 'tooltip.position') || position; + specialCssText += this._style(this.query(data, 'tooltip')); + } else { + this._lastItemTriggerId = NaN; + showContent = this.deepQuery(queryTarget, 'tooltip.showContent'); + formatter = this.deepQuery(queryTarget, 'tooltip.islandFormatter'); + position = this.deepQuery(queryTarget, 'tooltip.islandPosition'); + } + this._lastDataIndex = -1; + this._lastSeriesIndex = -1; + if (this._lastItemTriggerId !== this._curTarget.id) { + this._lastItemTriggerId = this._curTarget.id; + if (typeof formatter === 'function') { + this._curTicket = (serie.name || '') + ':' + dataIndex; + this._tDom.innerHTML = formatter.call(this.myChart, { + seriesIndex: seriesIndex, + seriesName: serie.name || '', + series: serie, + dataIndex: dataIndex, + data: data, + name: name, + value: value, + percent: special, + indicator: special, + value2: special2, + indicator2: special2, + 0: serie.name || '', + 1: name, + 2: value, + 3: special, + 4: special2, + 5: data, + 6: seriesIndex, + 7: dataIndex + }, this._curTicket, this._setContent); + } else if (typeof formatter === 'string') { + this._curTicket = NaN; + formatter = formatter.replace('{a}', '{a0}').replace('{b}', '{b0}').replace('{c}', '{c0}'); + formatter = formatter.replace('{a0}', this._encodeHTML(serie.name || '')).replace('{b0}', this._encodeHTML(name)).replace('{c0}', value instanceof Array ? value : this.numAddCommas(value)); + formatter = formatter.replace('{d}', '{d0}').replace('{d0}', special || ''); + formatter = formatter.replace('{e}', '{e0}').replace('{e0}', ecData.get(this._curTarget, 'special2') || ''); + this._tDom.innerHTML = formatter; + } else { + this._curTicket = NaN; + if (serie.type === ecConfig.CHART_TYPE_RADAR && special) { + this._tDom.innerHTML = this._itemFormatter.radar.call(this, serie, name, value, special); + } else if (serie.type === ecConfig.CHART_TYPE_EVENTRIVER) { + this._tDom.innerHTML = this._itemFormatter.eventRiver.call(this, serie, name, value, data); + } else { + this._tDom.innerHTML = '' + (serie.name != null ? this._encodeHTML(serie.name) + '
' : '') + (name === '' ? '' : this._encodeHTML(name) + ' : ') + (value instanceof Array ? value : this.numAddCommas(value)); + } + } + } + var x = zrEvent.getX(this._event); + var y = zrEvent.getY(this._event); + if (this.deepQuery(queryTarget, 'tooltip.axisPointer.show') && this.component.grid) { + this._styleAxisPointer([serie], this.component.grid.getX(), y, this.component.grid.getXend(), y, 0, x, y); + } + if (showContent === false || !this.option.tooltip.showContent) { + return; + } + if (!this.hasAppend) { + this._tDom.style.left = this._zrWidth / 2 + 'px'; + this._tDom.style.top = this._zrHeight / 2 + 'px'; + this.dom.firstChild.appendChild(this._tDom); + this.hasAppend = true; + } + this._show(position, x + 20, y - 20, specialCssText); + }, + _itemFormatter: { + radar: function (serie, name, value, indicator) { + var html = ''; + html += this._encodeHTML(name === '' ? serie.name || '' : name); + html += html === '' ? '' : '
'; + for (var i = 0; i < indicator.length; i++) { + html += this._encodeHTML(indicator[i].text) + ' : ' + this.numAddCommas(value[i]) + '
'; + } + return html; + }, + chord: function (serie, name, value, special, special2) { + if (special2 == null) { + return this._encodeHTML(name) + ' (' + this.numAddCommas(value) + ')'; + } else { + var name1 = this._encodeHTML(name); + var name2 = this._encodeHTML(special); + return '' + (serie.name != null ? this._encodeHTML(serie.name) + '
' : '') + name1 + ' -> ' + name2 + ' (' + this.numAddCommas(value) + ')' + '
' + name2 + ' -> ' + name1 + ' (' + this.numAddCommas(special2) + ')'; + } + }, + eventRiver: function (serie, name, value, data) { + var html = ''; + html += this._encodeHTML(serie.name === '' ? '' : serie.name + ' : '); + html += this._encodeHTML(name); + html += html === '' ? '' : '
'; + data = data.evolution; + for (var i = 0, l = data.length; i < l; i++) { + html += '
'; + if (!data[i].detail) { + continue; + } + if (data[i].detail.img) { + html += ''; + } + html += '
' + data[i].time + '
'; + html += ''; + html += data[i].detail.text + '
'; + html += '
'; + } + return html; + } + }, + _styleAxisPointer: function (seriesArray, xStart, yStart, xEnd, yEnd, gap, x, y) { + if (seriesArray.length > 0) { + var queryTarget; + var curType; + var axisPointer = this.option.tooltip.axisPointer; + var pointType = axisPointer.type; + var style = { + line: {}, + cross: {}, + shadow: {} + }; + for (var pType in style) { + style[pType].color = axisPointer[pType + 'Style'].color; + style[pType].width = axisPointer[pType + 'Style'].width; + style[pType].type = axisPointer[pType + 'Style'].type; + } + for (var i = 0, l = seriesArray.length; i < l; i++) { + queryTarget = seriesArray[i]; + curType = this.query(queryTarget, 'tooltip.axisPointer.type'); + pointType = curType || pointType; + if (curType) { + style[curType].color = this.query(queryTarget, 'tooltip.axisPointer.' + curType + 'Style.color') || style[curType].color; + style[curType].width = this.query(queryTarget, 'tooltip.axisPointer.' + curType + 'Style.width') || style[curType].width; + style[curType].type = this.query(queryTarget, 'tooltip.axisPointer.' + curType + 'Style.type') || style[curType].type; + } + } + if (pointType === 'line') { + var lineWidth = style.line.width; + var isVertical = xStart == xEnd; + this._axisLineShape.style = { + xStart: isVertical ? this.subPixelOptimize(xStart, lineWidth) : xStart, + yStart: isVertical ? yStart : this.subPixelOptimize(yStart, lineWidth), + xEnd: isVertical ? this.subPixelOptimize(xEnd, lineWidth) : xEnd, + yEnd: isVertical ? yEnd : this.subPixelOptimize(yEnd, lineWidth), + strokeColor: style.line.color, + lineWidth: lineWidth, + lineType: style.line.type + }; + this._axisLineShape.invisible = false; + this.zr.modShape(this._axisLineShape.id); + } else if (pointType === 'cross') { + var crossWidth = style.cross.width; + this._axisCrossShape.style = { + brushType: 'stroke', + rect: this.component.grid.getArea(), + x: this.subPixelOptimize(x, crossWidth), + y: this.subPixelOptimize(y, crossWidth), + text: ('( ' + this.component.xAxis.getAxis(0).getValueFromCoord(x) + ' , ' + this.component.yAxis.getAxis(0).getValueFromCoord(y) + ' )').replace(' , ', ' ').replace(' , ', ' '), + textPosition: 'specific', + strokeColor: style.cross.color, + lineWidth: crossWidth, + lineType: style.cross.type + }; + if (this.component.grid.getXend() - x > 100) { + this._axisCrossShape.style.textAlign = 'left'; + this._axisCrossShape.style.textX = x + 10; + } else { + this._axisCrossShape.style.textAlign = 'right'; + this._axisCrossShape.style.textX = x - 10; + } + if (y - this.component.grid.getY() > 50) { + this._axisCrossShape.style.textBaseline = 'bottom'; + this._axisCrossShape.style.textY = y - 10; + } else { + this._axisCrossShape.style.textBaseline = 'top'; + this._axisCrossShape.style.textY = y + 10; + } + this._axisCrossShape.invisible = false; + this.zr.modShape(this._axisCrossShape.id); + } else if (pointType === 'shadow') { + if (style.shadow.width == null || style.shadow.width === 'auto' || isNaN(style.shadow.width)) { + style.shadow.width = gap; + } + if (xStart === xEnd) { + if (Math.abs(this.component.grid.getX() - xStart) < 2) { + style.shadow.width /= 2; + xStart = xEnd = xEnd + style.shadow.width / 2; + } else if (Math.abs(this.component.grid.getXend() - xStart) < 2) { + style.shadow.width /= 2; + xStart = xEnd = xEnd - style.shadow.width / 2; + } + } else if (yStart === yEnd) { + if (Math.abs(this.component.grid.getY() - yStart) < 2) { + style.shadow.width /= 2; + yStart = yEnd = yEnd + style.shadow.width / 2; + } else if (Math.abs(this.component.grid.getYend() - yStart) < 2) { + style.shadow.width /= 2; + yStart = yEnd = yEnd - style.shadow.width / 2; + } + } + this._axisShadowShape.style = { + xStart: xStart, + yStart: yStart, + xEnd: xEnd, + yEnd: yEnd, + strokeColor: style.shadow.color, + lineWidth: style.shadow.width + }; + this._axisShadowShape.invisible = false; + this.zr.modShape(this._axisShadowShape.id); + } + this.zr.refreshNextFrame(); + } + }, + __onmousemove: function (param) { + clearTimeout(this._hidingTicket); + clearTimeout(this._showingTicket); + if (this._mousein && this._enterable) { + return; + } + var target = param.target; + var mx = zrEvent.getX(param.event); + var my = zrEvent.getY(param.event); + if (!target) { + this._curTarget = false; + this._event = param.event; + this._event.zrenderX = mx; + this._event.zrenderY = my; + if (this._needAxisTrigger && this.component.grid && zrArea.isInside(rectangleInstance, this.component.grid.getArea(), mx, my)) { + this._showingTicket = setTimeout(this._tryShow, this._showDelay); + } else if (this._needAxisTrigger && this.component.polar && this.component.polar.isInside([ + mx, + my + ]) != -1) { + this._showingTicket = setTimeout(this._tryShow, this._showDelay); + } else { + !this._event.connectTrigger && this.messageCenter.dispatch(ecConfig.EVENT.TOOLTIP_OUT_GRID, this._event, null, this.myChart); + this._hidingTicket = setTimeout(this._hide, this._hideDelay); + } + } else { + this._curTarget = target; + this._event = param.event; + this._event.zrenderX = mx; + this._event.zrenderY = my; + var polarIndex; + if (this._needAxisTrigger && this.component.polar && (polarIndex = this.component.polar.isInside([ + mx, + my + ])) != -1) { + var series = this.option.series; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].polarIndex === polarIndex && this.deepQuery([ + series[i], + this.option + ], 'tooltip.trigger') === 'axis') { + this._curTarget = null; + break; + } + } + } + this._showingTicket = setTimeout(this._tryShow, this._showDelay); + } + }, + __onglobalout: function () { + clearTimeout(this._hidingTicket); + clearTimeout(this._showingTicket); + this._hidingTicket = setTimeout(this._hide, this._hideDelay); + }, + __setContent: function (ticket, content) { + if (!this._tDom) { + return; + } + if (ticket === this._curTicket) { + this._tDom.innerHTML = content; + } + setTimeout(this._refixed, 20); + }, + ontooltipHover: function (param, tipShape) { + if (!this._lastTipShape || this._lastTipShape && this._lastTipShape.dataIndex != param.dataIndex) { + if (this._lastTipShape && this._lastTipShape.tipShape.length > 0) { + this.zr.delShape(this._lastTipShape.tipShape); + this.shapeList.length = 2; + } + for (var i = 0, l = tipShape.length; i < l; i++) { + tipShape[i].zlevel = this.getZlevelBase(); + tipShape[i].z = this.getZBase(); + tipShape[i].style = zrShapeBase.prototype.getHighlightStyle(tipShape[i].style, tipShape[i].highlightStyle); + tipShape[i].draggable = false; + tipShape[i].hoverable = false; + tipShape[i].clickable = false; + tipShape[i].ondragend = null; + tipShape[i].ondragover = null; + tipShape[i].ondrop = null; + this.shapeList.push(tipShape[i]); + this.zr.addShape(tipShape[i]); + } + this._lastTipShape = { + dataIndex: param.dataIndex, + tipShape: tipShape + }; + } + }, + ondragend: function () { + this._hide(); + }, + onlegendSelected: function (param) { + this._selectedMap = param.selected; + }, + _setSelectedMap: function () { + if (this.component.legend) { + this._selectedMap = zrUtil.clone(this.component.legend.getSelectedMap()); + } else { + this._selectedMap = {}; + } + }, + _isSelected: function (itemName) { + if (this._selectedMap[itemName] != null) { + return this._selectedMap[itemName]; + } else { + return true; + } + }, + showTip: function (params) { + if (!params) { + return; + } + var seriesIndex; + var series = this.option.series; + if (params.seriesIndex != null) { + seriesIndex = params.seriesIndex; + } else { + var seriesName = params.seriesName; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].name === seriesName) { + seriesIndex = i; + break; + } + } + } + var serie = series[seriesIndex]; + if (serie == null) { + return; + } + var chart = this.myChart.chart[serie.type]; + var isAxisTrigger = this.deepQuery([ + serie, + this.option + ], 'tooltip.trigger') === 'axis'; + if (!chart) { + return; + } + if (isAxisTrigger) { + var dataIndex = params.dataIndex; + switch (chart.type) { + case ecConfig.CHART_TYPE_LINE: + case ecConfig.CHART_TYPE_BAR: + case ecConfig.CHART_TYPE_K: + if (this.component.xAxis == null || this.component.yAxis == null || serie.data.length <= dataIndex) { + return; + } + var xAxisIndex = serie.xAxisIndex || 0; + var yAxisIndex = serie.yAxisIndex || 0; + if (this.component.xAxis.getAxis(xAxisIndex).type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY) { + this._event = { + zrenderX: this.component.xAxis.getAxis(xAxisIndex).getCoordByIndex(dataIndex), + zrenderY: this.component.grid.getY() + (this.component.grid.getYend() - this.component.grid.getY()) / 4 + }; + } else { + this._event = { + zrenderX: this.component.grid.getX() + (this.component.grid.getXend() - this.component.grid.getX()) / 4, + zrenderY: this.component.yAxis.getAxis(yAxisIndex).getCoordByIndex(dataIndex) + }; + } + this._showAxisTrigger(xAxisIndex, yAxisIndex, dataIndex); + break; + case ecConfig.CHART_TYPE_RADAR: + if (this.component.polar == null || serie.data[0].value.length <= dataIndex) { + return; + } + var polarIndex = serie.polarIndex || 0; + var vector = this.component.polar.getVector(polarIndex, dataIndex, 'max'); + this._event = { + zrenderX: vector[0], + zrenderY: vector[1] + }; + this._showPolarTrigger(polarIndex, dataIndex); + break; + } + } else { + var shapeList = chart.shapeList; + var x; + var y; + switch (chart.type) { + case ecConfig.CHART_TYPE_LINE: + case ecConfig.CHART_TYPE_BAR: + case ecConfig.CHART_TYPE_K: + case ecConfig.CHART_TYPE_SCATTER: + var dataIndex = params.dataIndex; + for (var i = 0, l = shapeList.length; i < l; i++) { + if (shapeList[i]._mark == null && ecData.get(shapeList[i], 'seriesIndex') == seriesIndex && ecData.get(shapeList[i], 'dataIndex') == dataIndex) { + this._curTarget = shapeList[i]; + x = shapeList[i].style.x; + y = chart.type != ecConfig.CHART_TYPE_K ? shapeList[i].style.y : shapeList[i].style.y[0]; + break; + } + } + break; + case ecConfig.CHART_TYPE_RADAR: + var dataIndex = params.dataIndex; + for (var i = 0, l = shapeList.length; i < l; i++) { + if (shapeList[i].type === 'polygon' && ecData.get(shapeList[i], 'seriesIndex') == seriesIndex && ecData.get(shapeList[i], 'dataIndex') == dataIndex) { + this._curTarget = shapeList[i]; + var vector = this.component.polar.getCenter(serie.polarIndex || 0); + x = vector[0]; + y = vector[1]; + break; + } + } + break; + case ecConfig.CHART_TYPE_PIE: + var name = params.name; + for (var i = 0, l = shapeList.length; i < l; i++) { + if (shapeList[i].type === 'sector' && ecData.get(shapeList[i], 'seriesIndex') == seriesIndex && ecData.get(shapeList[i], 'name') == name) { + this._curTarget = shapeList[i]; + var style = this._curTarget.style; + var midAngle = (style.startAngle + style.endAngle) / 2 * Math.PI / 180; + x = this._curTarget.style.x + Math.cos(midAngle) * style.r / 1.5; + y = this._curTarget.style.y - Math.sin(midAngle) * style.r / 1.5; + break; + } + } + break; + case ecConfig.CHART_TYPE_MAP: + var name = params.name; + var mapType = serie.mapType; + for (var i = 0, l = shapeList.length; i < l; i++) { + if (shapeList[i].type === 'text' && shapeList[i]._mapType === mapType && shapeList[i].style._name === name) { + this._curTarget = shapeList[i]; + x = this._curTarget.style.x + this._curTarget.position[0]; + y = this._curTarget.style.y + this._curTarget.position[1]; + break; + } + } + break; + case ecConfig.CHART_TYPE_CHORD: + var name = params.name; + for (var i = 0, l = shapeList.length; i < l; i++) { + if (shapeList[i].type === 'sector' && ecData.get(shapeList[i], 'name') == name) { + this._curTarget = shapeList[i]; + var style = this._curTarget.style; + var midAngle = (style.startAngle + style.endAngle) / 2 * Math.PI / 180; + x = this._curTarget.style.x + Math.cos(midAngle) * (style.r - 2); + y = this._curTarget.style.y - Math.sin(midAngle) * (style.r - 2); + this.zr.trigger(zrConfig.EVENT.MOUSEMOVE, { + zrenderX: x, + zrenderY: y + }); + return; + } + } + break; + case ecConfig.CHART_TYPE_FORCE: + var name = params.name; + for (var i = 0, l = shapeList.length; i < l; i++) { + if (shapeList[i].type === 'circle' && ecData.get(shapeList[i], 'name') == name) { + this._curTarget = shapeList[i]; + x = this._curTarget.position[0]; + y = this._curTarget.position[1]; + break; + } + } + break; + } + if (x != null && y != null) { + this._event = { + zrenderX: x, + zrenderY: y + }; + this.zr.addHoverShape(this._curTarget); + this.zr.refreshHover(); + this._showItemTrigger(); + } + } + }, + hideTip: function () { + this._hide(); + }, + refresh: function (newOption) { + this._zrHeight = this.zr.getHeight(); + this._zrWidth = this.zr.getWidth(); + if (this._lastTipShape && this._lastTipShape.tipShape.length > 0) { + this.zr.delShape(this._lastTipShape.tipShape); + } + this._lastTipShape = false; + this.shapeList.length = 2; + this._lastDataIndex = -1; + this._lastSeriesIndex = -1; + this._lastItemTriggerId = -1; + if (newOption) { + this.option = newOption; + this.option.tooltip = this.reformOption(this.option.tooltip); + this.option.tooltip.textStyle = zrUtil.merge(this.option.tooltip.textStyle, this.ecTheme.textStyle); + this._needAxisTrigger = false; + if (this.option.tooltip.trigger === 'axis') { + this._needAxisTrigger = true; + } + var series = this.option.series; + for (var i = 0, l = series.length; i < l; i++) { + if (this.query(series[i], 'tooltip.trigger') === 'axis') { + this._needAxisTrigger = true; + break; + } + } + this._showDelay = this.option.tooltip.showDelay; + this._hideDelay = this.option.tooltip.hideDelay; + this._defaultCssText = this._style(this.option.tooltip); + this._setSelectedMap(); + this._axisLineWidth = this.option.tooltip.axisPointer.lineStyle.width; + this._enterable = this.option.tooltip.enterable; + } + if (this.showing) { + var self = this; + setTimeout(function () { + self.zr.trigger(zrConfig.EVENT.MOUSEMOVE, self.zr.handler._event); + }, 50); + } + }, + onbeforDispose: function () { + if (this._lastTipShape && this._lastTipShape.tipShape.length > 0) { + this.zr.delShape(this._lastTipShape.tipShape); + } + clearTimeout(this._hidingTicket); + clearTimeout(this._showingTicket); + this.zr.un(zrConfig.EVENT.MOUSEMOVE, this._onmousemove); + this.zr.un(zrConfig.EVENT.GLOBALOUT, this._onglobalout); + if (this.hasAppend && !!this.dom.firstChild) { + this.dom.firstChild.removeChild(this._tDom); + } + this._tDom = null; + }, + _encodeHTML: function (source) { + return String(source).replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"').replace(/'/g, '''); + } + }; + zrUtil.inherits(Tooltip, Base); + require('../component').define('tooltip', Tooltip); + return Tooltip; +});define('echarts/component/legend', [ + 'require', + './base', + 'zrender/shape/Text', + 'zrender/shape/Rectangle', + 'zrender/shape/Sector', + '../util/shape/Icon', + '../util/shape/Candle', + '../config', + 'zrender/tool/util', + 'zrender/tool/area', + '../component' +], function (require) { + var Base = require('./base'); + var TextShape = require('zrender/shape/Text'); + var RectangleShape = require('zrender/shape/Rectangle'); + var SectorShape = require('zrender/shape/Sector'); + var IconShape = require('../util/shape/Icon'); + var CandleShape = require('../util/shape/Candle'); + var ecConfig = require('../config'); + ecConfig.legend = { + zlevel: 0, + z: 4, + show: true, + orient: 'horizontal', + x: 'center', + y: 'top', + backgroundColor: 'rgba(0,0,0,0)', + borderColor: '#ccc', + borderWidth: 0, + padding: 5, + itemGap: 10, + itemWidth: 20, + itemHeight: 14, + textStyle: { color: '#333' }, + selectedMode: true + }; + var zrUtil = require('zrender/tool/util'); + var zrArea = require('zrender/tool/area'); + function Legend(ecTheme, messageCenter, zr, option, myChart) { + if (!this.query(option, 'legend.data')) { + console.error('option.legend.data has not been defined.'); + return; + } + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + var self = this; + self._legendSelected = function (param) { + self.__legendSelected(param); + }; + self._dispatchHoverLink = function (param) { + return self.__dispatchHoverLink(param); + }; + this._colorIndex = 0; + this._colorMap = {}; + this._selectedMap = {}; + this._hasDataMap = {}; + this.refresh(option); + } + Legend.prototype = { + type: ecConfig.COMPONENT_TYPE_LEGEND, + _buildShape: function () { + if (!this.legendOption.show) { + return; + } + this._itemGroupLocation = this._getItemGroupLocation(); + this._buildBackground(); + this._buildItem(); + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + }, + _buildItem: function () { + var data = this.legendOption.data; + var dataLength = data.length; + var itemName; + var itemType; + var itemShape; + var textShape; + var textStyle = this.legendOption.textStyle; + var dataTextStyle; + var dataFont; + var formattedName; + var zrWidth = this.zr.getWidth(); + var zrHeight = this.zr.getHeight(); + var lastX = this._itemGroupLocation.x; + var lastY = this._itemGroupLocation.y; + var itemWidth = this.legendOption.itemWidth; + var itemHeight = this.legendOption.itemHeight; + var itemGap = this.legendOption.itemGap; + var color; + if (this.legendOption.orient === 'vertical' && this.legendOption.x === 'right') { + lastX = this._itemGroupLocation.x + this._itemGroupLocation.width - itemWidth; + } + for (var i = 0; i < dataLength; i++) { + dataTextStyle = zrUtil.merge(data[i].textStyle || {}, textStyle); + dataFont = this.getFont(dataTextStyle); + itemName = this._getName(data[i]); + formattedName = this._getFormatterName(itemName); + if (itemName === '') { + if (this.legendOption.orient === 'horizontal') { + lastX = this._itemGroupLocation.x; + lastY += itemHeight + itemGap; + } else { + this.legendOption.x === 'right' ? lastX -= this._itemGroupLocation.maxWidth + itemGap : lastX += this._itemGroupLocation.maxWidth + itemGap; + lastY = this._itemGroupLocation.y; + } + continue; + } + itemType = data[i].icon || this._getSomethingByName(itemName).type; + color = this.getColor(itemName); + if (this.legendOption.orient === 'horizontal') { + if (zrWidth - lastX < 200 && itemWidth + 5 + zrArea.getTextWidth(formattedName, dataFont) + (i === dataLength - 1 || data[i + 1] === '' ? 0 : itemGap) >= zrWidth - lastX) { + lastX = this._itemGroupLocation.x; + lastY += itemHeight + itemGap; + } + } else { + if (zrHeight - lastY < 200 && itemHeight + (i === dataLength - 1 || data[i + 1] === '' ? 0 : itemGap) >= zrHeight - lastY) { + this.legendOption.x === 'right' ? lastX -= this._itemGroupLocation.maxWidth + itemGap : lastX += this._itemGroupLocation.maxWidth + itemGap; + lastY = this._itemGroupLocation.y; + } + } + itemShape = this._getItemShapeByType(lastX, lastY, itemWidth, itemHeight, this._selectedMap[itemName] && this._hasDataMap[itemName] ? color : '#ccc', itemType, color); + itemShape._name = itemName; + itemShape = new IconShape(itemShape); + textShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: lastX + itemWidth + 5, + y: lastY + itemHeight / 2, + color: this._selectedMap[itemName] ? dataTextStyle.color === 'auto' ? color : dataTextStyle.color : '#ccc', + text: formattedName, + textFont: dataFont, + textBaseline: 'middle' + }, + highlightStyle: { + color: color, + brushType: 'fill' + }, + hoverable: !!this.legendOption.selectedMode, + clickable: !!this.legendOption.selectedMode + }; + if (this.legendOption.orient === 'vertical' && this.legendOption.x === 'right') { + textShape.style.x -= itemWidth + 10; + textShape.style.textAlign = 'right'; + } + textShape._name = itemName; + textShape = new TextShape(textShape); + if (this.legendOption.selectedMode) { + itemShape.onclick = textShape.onclick = this._legendSelected; + itemShape.onmouseover = textShape.onmouseover = this._dispatchHoverLink; + itemShape.hoverConnect = textShape.id; + textShape.hoverConnect = itemShape.id; + } + this.shapeList.push(itemShape); + this.shapeList.push(textShape); + if (this.legendOption.orient === 'horizontal') { + lastX += itemWidth + 5 + zrArea.getTextWidth(formattedName, dataFont) + itemGap; + } else { + lastY += itemHeight + itemGap; + } + } + if (this.legendOption.orient === 'horizontal' && this.legendOption.x === 'center' && lastY != this._itemGroupLocation.y) { + this._mLineOptimize(); + } + }, + _getName: function (data) { + return typeof data.name != 'undefined' ? data.name : data; + }, + _getFormatterName: function (itemName) { + var formatter = this.legendOption.formatter; + var formattedName; + if (typeof formatter === 'function') { + formattedName = formatter.call(this.myChart, itemName); + } else if (typeof formatter === 'string') { + formattedName = formatter.replace('{name}', itemName); + } else { + formattedName = itemName; + } + return formattedName; + }, + _getFormatterNameFromData: function (data) { + var itemName = this._getName(data); + return this._getFormatterName(itemName); + }, + _mLineOptimize: function () { + var lineOffsetArray = []; + var lastX = this._itemGroupLocation.x; + for (var i = 2, l = this.shapeList.length; i < l; i++) { + if (this.shapeList[i].style.x === lastX) { + lineOffsetArray.push((this._itemGroupLocation.width - (this.shapeList[i - 1].style.x + zrArea.getTextWidth(this.shapeList[i - 1].style.text, this.shapeList[i - 1].style.textFont) - lastX)) / 2); + } else if (i === l - 1) { + lineOffsetArray.push((this._itemGroupLocation.width - (this.shapeList[i].style.x + zrArea.getTextWidth(this.shapeList[i].style.text, this.shapeList[i].style.textFont) - lastX)) / 2); + } + } + var curLineIndex = -1; + for (var i = 1, l = this.shapeList.length; i < l; i++) { + if (this.shapeList[i].style.x === lastX) { + curLineIndex++; + } + if (lineOffsetArray[curLineIndex] === 0) { + continue; + } else { + this.shapeList[i].style.x += lineOffsetArray[curLineIndex]; + } + } + }, + _buildBackground: function () { + var padding = this.reformCssArray(this.legendOption.padding); + this.shapeList.push(new RectangleShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: this._itemGroupLocation.x - padding[3], + y: this._itemGroupLocation.y - padding[0], + width: this._itemGroupLocation.width + padding[3] + padding[1], + height: this._itemGroupLocation.height + padding[0] + padding[2], + brushType: this.legendOption.borderWidth === 0 ? 'fill' : 'both', + color: this.legendOption.backgroundColor, + strokeColor: this.legendOption.borderColor, + lineWidth: this.legendOption.borderWidth + } + })); + }, + _getItemGroupLocation: function () { + var data = this.legendOption.data; + var dataLength = data.length; + var itemGap = this.legendOption.itemGap; + var itemWidth = this.legendOption.itemWidth + 5; + var itemHeight = this.legendOption.itemHeight; + var textStyle = this.legendOption.textStyle; + var font = this.getFont(textStyle); + var totalWidth = 0; + var totalHeight = 0; + var padding = this.reformCssArray(this.legendOption.padding); + var zrWidth = this.zr.getWidth() - padding[1] - padding[3]; + var zrHeight = this.zr.getHeight() - padding[0] - padding[2]; + var temp = 0; + var maxWidth = 0; + if (this.legendOption.orient === 'horizontal') { + totalHeight = itemHeight; + for (var i = 0; i < dataLength; i++) { + if (this._getName(data[i]) === '') { + temp -= itemGap; + totalWidth = Math.max(totalWidth, temp); + totalHeight += itemHeight + itemGap; + temp = 0; + continue; + } + var tempTextWidth = zrArea.getTextWidth(this._getFormatterNameFromData(data[i]), data[i].textStyle ? this.getFont(zrUtil.merge(data[i].textStyle || {}, textStyle)) : font); + if (temp + itemWidth + tempTextWidth + itemGap > zrWidth) { + temp -= itemGap; + totalWidth = Math.max(totalWidth, temp); + totalHeight += itemHeight + itemGap; + temp = 0; + } else { + temp += itemWidth + tempTextWidth + itemGap; + totalWidth = Math.max(totalWidth, temp - itemGap); + } + } + } else { + for (var i = 0; i < dataLength; i++) { + maxWidth = Math.max(maxWidth, zrArea.getTextWidth(this._getFormatterNameFromData(data[i]), data[i].textStyle ? this.getFont(zrUtil.merge(data[i].textStyle || {}, textStyle)) : font)); + } + maxWidth += itemWidth; + totalWidth = maxWidth; + for (var i = 0; i < dataLength; i++) { + if (this._getName(data[i]) === '') { + totalWidth += maxWidth + itemGap; + temp -= itemGap; + totalHeight = Math.max(totalHeight, temp); + temp = 0; + continue; + } + if (temp + itemHeight + itemGap > zrHeight) { + totalWidth += maxWidth + itemGap; + temp -= itemGap; + totalHeight = Math.max(totalHeight, temp); + temp = 0; + } else { + temp += itemHeight + itemGap; + totalHeight = Math.max(totalHeight, temp - itemGap); + } + } + } + zrWidth = this.zr.getWidth(); + zrHeight = this.zr.getHeight(); + var x; + switch (this.legendOption.x) { + case 'center': + x = Math.floor((zrWidth - totalWidth) / 2); + break; + case 'left': + x = padding[3] + this.legendOption.borderWidth; + break; + case 'right': + x = zrWidth - totalWidth - padding[1] - padding[3] - this.legendOption.borderWidth * 2; + break; + default: + x = this.parsePercent(this.legendOption.x, zrWidth); + break; + } + var y; + switch (this.legendOption.y) { + case 'top': + y = padding[0] + this.legendOption.borderWidth; + break; + case 'bottom': + y = zrHeight - totalHeight - padding[0] - padding[2] - this.legendOption.borderWidth * 2; + break; + case 'center': + y = Math.floor((zrHeight - totalHeight) / 2); + break; + default: + y = this.parsePercent(this.legendOption.y, zrHeight); + break; + } + return { + x: x, + y: y, + width: totalWidth, + height: totalHeight, + maxWidth: maxWidth + }; + }, + _getSomethingByName: function (name) { + var series = this.option.series; + var data; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].name === name) { + return { + type: series[i].type, + series: series[i], + seriesIndex: i, + data: null, + dataIndex: -1 + }; + } + if (series[i].type === ecConfig.CHART_TYPE_PIE || series[i].type === ecConfig.CHART_TYPE_RADAR || series[i].type === ecConfig.CHART_TYPE_CHORD || series[i].type === ecConfig.CHART_TYPE_FORCE || series[i].type === ecConfig.CHART_TYPE_FUNNEL) { + data = series[i].categories || series[i].data || series[i].nodes; + for (var j = 0, k = data.length; j < k; j++) { + if (data[j].name === name) { + return { + type: series[i].type, + series: series[i], + seriesIndex: i, + data: data[j], + dataIndex: j + }; + } + } + } + } + return { + type: 'bar', + series: null, + seriesIndex: -1, + data: null, + dataIndex: -1 + }; + }, + _getItemShapeByType: function (x, y, width, height, color, itemType, defaultColor) { + var highlightColor = color === '#ccc' ? defaultColor : color; + var itemShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + iconType: 'legendicon' + itemType, + x: x, + y: y, + width: width, + height: height, + color: color, + strokeColor: color, + lineWidth: 2 + }, + highlightStyle: { + color: highlightColor, + strokeColor: highlightColor, + lineWidth: 1 + }, + hoverable: this.legendOption.selectedMode, + clickable: this.legendOption.selectedMode + }; + var imageLocation; + if (itemType.match('image')) { + var imageLocation = itemType.replace(new RegExp('^image:\\/\\/'), ''); + itemType = 'image'; + } + switch (itemType) { + case 'line': + itemShape.style.brushType = 'stroke'; + itemShape.highlightStyle.lineWidth = 3; + break; + case 'radar': + case 'scatter': + itemShape.highlightStyle.lineWidth = 3; + break; + case 'k': + itemShape.style.brushType = 'both'; + itemShape.highlightStyle.lineWidth = 3; + itemShape.highlightStyle.color = itemShape.style.color = this.deepQuery([ + this.ecTheme, + ecConfig + ], 'k.itemStyle.normal.color') || '#fff'; + itemShape.style.strokeColor = color != '#ccc' ? this.deepQuery([ + this.ecTheme, + ecConfig + ], 'k.itemStyle.normal.lineStyle.color') || '#ff3200' : color; + break; + case 'image': + itemShape.style.iconType = 'image'; + itemShape.style.image = imageLocation; + if (color === '#ccc') { + itemShape.style.opacity = 0.5; + } + break; + } + return itemShape; + }, + __legendSelected: function (param) { + var itemName = param.target._name; + if (this.legendOption.selectedMode === 'single') { + for (var k in this._selectedMap) { + this._selectedMap[k] = false; + } + } + this._selectedMap[itemName] = !this._selectedMap[itemName]; + this.messageCenter.dispatch(ecConfig.EVENT.LEGEND_SELECTED, param.event, { + selected: this._selectedMap, + target: itemName + }, this.myChart); + }, + __dispatchHoverLink: function (param) { + this.messageCenter.dispatch(ecConfig.EVENT.LEGEND_HOVERLINK, param.event, { target: param.target._name }, this.myChart); + return; + }, + refresh: function (newOption) { + if (newOption) { + this.option = newOption || this.option; + this.option.legend = this.reformOption(this.option.legend); + this.legendOption = this.option.legend; + var data = this.legendOption.data || []; + var itemName; + var something; + var color; + var queryTarget; + if (this.legendOption.selected) { + for (var k in this.legendOption.selected) { + this._selectedMap[k] = typeof this._selectedMap[k] != 'undefined' ? this._selectedMap[k] : this.legendOption.selected[k]; + } + } + for (var i = 0, dataLength = data.length; i < dataLength; i++) { + itemName = this._getName(data[i]); + if (itemName === '') { + continue; + } + something = this._getSomethingByName(itemName); + if (!something.series) { + this._hasDataMap[itemName] = false; + } else { + this._hasDataMap[itemName] = true; + if (something.data && (something.type === ecConfig.CHART_TYPE_PIE || something.type === ecConfig.CHART_TYPE_FORCE || something.type === ecConfig.CHART_TYPE_FUNNEL)) { + queryTarget = [ + something.data, + something.series + ]; + } else { + queryTarget = [something.series]; + } + color = this.getItemStyleColor(this.deepQuery(queryTarget, 'itemStyle.normal.color'), something.seriesIndex, something.dataIndex, something.data); + if (color && something.type != ecConfig.CHART_TYPE_K) { + this.setColor(itemName, color); + } + this._selectedMap[itemName] = this._selectedMap[itemName] != null ? this._selectedMap[itemName] : true; + } + } + } + this.clear(); + this._buildShape(); + }, + getRelatedAmount: function (name) { + var amount = 0; + var series = this.option.series; + var data; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].name === name) { + amount++; + } + if (series[i].type === ecConfig.CHART_TYPE_PIE || series[i].type === ecConfig.CHART_TYPE_RADAR || series[i].type === ecConfig.CHART_TYPE_CHORD || series[i].type === ecConfig.CHART_TYPE_FORCE || series[i].type === ecConfig.CHART_TYPE_FUNNEL) { + data = series[i].type != ecConfig.CHART_TYPE_FORCE ? series[i].data : series[i].categories; + for (var j = 0, k = data.length; j < k; j++) { + if (data[j].name === name && data[j].value != '-') { + amount++; + } + } + } + } + return amount; + }, + setColor: function (legendName, color) { + this._colorMap[legendName] = color; + }, + getColor: function (legendName) { + if (!this._colorMap[legendName]) { + this._colorMap[legendName] = this.zr.getColor(this._colorIndex++); + } + return this._colorMap[legendName]; + }, + hasColor: function (legendName) { + return this._colorMap[legendName] ? this._colorMap[legendName] : false; + }, + add: function (name, color) { + var data = this.legendOption.data; + for (var i = 0, dataLength = data.length; i < dataLength; i++) { + if (this._getName(data[i]) === name) { + return; + } + } + this.legendOption.data.push(name); + this.setColor(name, color); + this._selectedMap[name] = true; + this._hasDataMap[name] = true; + }, + del: function (name) { + var data = this.legendOption.data; + for (var i = 0, dataLength = data.length; i < dataLength; i++) { + if (this._getName(data[i]) === name) { + return this.legendOption.data.splice(i, 1); + } + } + }, + getItemShape: function (name) { + if (name == null) { + return; + } + var shape; + for (var i = 0, l = this.shapeList.length; i < l; i++) { + shape = this.shapeList[i]; + if (shape._name === name && shape.type != 'text') { + return shape; + } + } + }, + setItemShape: function (name, itemShape) { + var shape; + for (var i = 0, l = this.shapeList.length; i < l; i++) { + shape = this.shapeList[i]; + if (shape._name === name && shape.type != 'text') { + if (!this._selectedMap[name]) { + itemShape.style.color = '#ccc'; + itemShape.style.strokeColor = '#ccc'; + } + this.zr.modShape(shape.id, itemShape); + } + } + }, + isSelected: function (itemName) { + if (typeof this._selectedMap[itemName] != 'undefined') { + return this._selectedMap[itemName]; + } else { + return true; + } + }, + getSelectedMap: function () { + return this._selectedMap; + }, + setSelected: function (itemName, selectStatus) { + if (this.legendOption.selectedMode === 'single') { + for (var k in this._selectedMap) { + this._selectedMap[k] = false; + } + } + this._selectedMap[itemName] = selectStatus; + this.messageCenter.dispatch(ecConfig.EVENT.LEGEND_SELECTED, null, { + selected: this._selectedMap, + target: itemName + }, this.myChart); + }, + onlegendSelected: function (param, status) { + var legendSelected = param.selected; + for (var itemName in legendSelected) { + if (this._selectedMap[itemName] != legendSelected[itemName]) { + status.needRefresh = true; + } + this._selectedMap[itemName] = legendSelected[itemName]; + } + return; + } + }; + var legendIcon = { + line: function (ctx, style) { + var dy = style.height / 2; + ctx.moveTo(style.x, style.y + dy); + ctx.lineTo(style.x + style.width, style.y + dy); + }, + pie: function (ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + SectorShape.prototype.buildPath(ctx, { + x: x + width / 2, + y: y + height + 2, + r: height, + r0: 6, + startAngle: 45, + endAngle: 135 + }); + }, + eventRiver: function (ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + ctx.moveTo(x, y + height); + ctx.bezierCurveTo(x + width, y + height, x, y + 4, x + width, y + 4); + ctx.lineTo(x + width, y); + ctx.bezierCurveTo(x, y, x + width, y + height - 4, x, y + height - 4); + ctx.lineTo(x, y + height); + }, + k: function (ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + CandleShape.prototype.buildPath(ctx, { + x: x + width / 2, + y: [ + y + 1, + y + 1, + y + height - 6, + y + height + ], + width: width - 6 + }); + }, + bar: function (ctx, style) { + var x = style.x; + var y = style.y + 1; + var width = style.width; + var height = style.height - 2; + var r = 3; + ctx.moveTo(x + r, y); + ctx.lineTo(x + width - r, y); + ctx.quadraticCurveTo(x + width, y, x + width, y + r); + ctx.lineTo(x + width, y + height - r); + ctx.quadraticCurveTo(x + width, y + height, x + width - r, y + height); + ctx.lineTo(x + r, y + height); + ctx.quadraticCurveTo(x, y + height, x, y + height - r); + ctx.lineTo(x, y + r); + ctx.quadraticCurveTo(x, y, x + r, y); + }, + force: function (ctx, style) { + IconShape.prototype.iconLibrary.circle(ctx, style); + }, + radar: function (ctx, style) { + var n = 6; + var x = style.x + style.width / 2; + var y = style.y + style.height / 2; + var r = style.height / 2; + var dStep = 2 * Math.PI / n; + var deg = -Math.PI / 2; + var xStart = x + r * Math.cos(deg); + var yStart = y + r * Math.sin(deg); + ctx.moveTo(xStart, yStart); + deg += dStep; + for (var i = 0, end = n - 1; i < end; i++) { + ctx.lineTo(x + r * Math.cos(deg), y + r * Math.sin(deg)); + deg += dStep; + } + ctx.lineTo(xStart, yStart); + } + }; + legendIcon.chord = legendIcon.pie; + legendIcon.map = legendIcon.bar; + for (var k in legendIcon) { + IconShape.prototype.iconLibrary['legendicon' + k] = legendIcon[k]; + } + zrUtil.inherits(Legend, Base); + require('../component').define('legend', Legend); + return Legend; +});define('echarts/util/ecData', [], function () { + function pack(shape, series, seriesIndex, data, dataIndex, name, special, special2) { + var value; + if (typeof data != 'undefined') { + value = data.value == null ? data : data.value; + } + shape._echartsData = { + '_series': series, + '_seriesIndex': seriesIndex, + '_data': data, + '_dataIndex': dataIndex, + '_name': name, + '_value': value, + '_special': special, + '_special2': special2 + }; + return shape._echartsData; + } + function get(shape, key) { + var data = shape._echartsData; + if (!key) { + return data; + } + switch (key) { + case 'series': + case 'seriesIndex': + case 'data': + case 'dataIndex': + case 'name': + case 'value': + case 'special': + case 'special2': + return data && data['_' + key]; + } + return null; + } + function set(shape, key, value) { + shape._echartsData = shape._echartsData || {}; + switch (key) { + case 'series': + case 'seriesIndex': + case 'data': + case 'dataIndex': + case 'name': + case 'value': + case 'special': + case 'special2': + shape._echartsData['_' + key] = value; + break; + } + } + function clone(source, target) { + target._echartsData = { + '_series': source._echartsData._series, + '_seriesIndex': source._echartsData._seriesIndex, + '_data': source._echartsData._data, + '_dataIndex': source._echartsData._dataIndex, + '_name': source._echartsData._name, + '_value': source._echartsData._value, + '_special': source._echartsData._special, + '_special2': source._echartsData._special2 + }; + } + return { + pack: pack, + set: set, + get: get, + clone: clone + }; +});define('echarts/chart', [], function () { + var self = {}; + var _chartLibrary = {}; + self.define = function (name, clazz) { + _chartLibrary[name] = clazz; + return self; + }; + self.get = function (name) { + return _chartLibrary[name]; + }; + return self; +});define('zrender/tool/color', [ + 'require', + '../tool/util' +], function (require) { + var util = require('../tool/util'); + var _ctx; + var palette = [ + '#ff9277', + ' #dddd00', + ' #ffc877', + ' #bbe3ff', + ' #d5ffbb', + '#bbbbff', + ' #ddb000', + ' #b0dd00', + ' #e2bbff', + ' #ffbbe3', + '#ff7777', + ' #ff9900', + ' #83dd00', + ' #77e3ff', + ' #778fff', + '#c877ff', + ' #ff77ab', + ' #ff6600', + ' #aa8800', + ' #77c7ff', + '#ad77ff', + ' #ff77ff', + ' #dd0083', + ' #777700', + ' #00aa00', + '#0088aa', + ' #8400dd', + ' #aa0088', + ' #dd0000', + ' #772e00' + ]; + var _palette = palette; + var highlightColor = 'rgba(255,255,0,0.5)'; + var _highlightColor = highlightColor; + var colorRegExp = /^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i; + var _nameColors = { + aliceblue: '#f0f8ff', + antiquewhite: '#faebd7', + aqua: '#0ff', + aquamarine: '#7fffd4', + azure: '#f0ffff', + beige: '#f5f5dc', + bisque: '#ffe4c4', + black: '#000', + blanchedalmond: '#ffebcd', + blue: '#00f', + blueviolet: '#8a2be2', + brown: '#a52a2a', + burlywood: '#deb887', + cadetblue: '#5f9ea0', + chartreuse: '#7fff00', + chocolate: '#d2691e', + coral: '#ff7f50', + cornflowerblue: '#6495ed', + cornsilk: '#fff8dc', + crimson: '#dc143c', + cyan: '#0ff', + darkblue: '#00008b', + darkcyan: '#008b8b', + darkgoldenrod: '#b8860b', + darkgray: '#a9a9a9', + darkgrey: '#a9a9a9', + darkgreen: '#006400', + darkkhaki: '#bdb76b', + darkmagenta: '#8b008b', + darkolivegreen: '#556b2f', + darkorange: '#ff8c00', + darkorchid: '#9932cc', + darkred: '#8b0000', + darksalmon: '#e9967a', + darkseagreen: '#8fbc8f', + darkslateblue: '#483d8b', + darkslategray: '#2f4f4f', + darkslategrey: '#2f4f4f', + darkturquoise: '#00ced1', + darkviolet: '#9400d3', + deeppink: '#ff1493', + deepskyblue: '#00bfff', + dimgray: '#696969', + dimgrey: '#696969', + dodgerblue: '#1e90ff', + firebrick: '#b22222', + floralwhite: '#fffaf0', + forestgreen: '#228b22', + fuchsia: '#f0f', + gainsboro: '#dcdcdc', + ghostwhite: '#f8f8ff', + gold: '#ffd700', + goldenrod: '#daa520', + gray: '#808080', + grey: '#808080', + green: '#008000', + greenyellow: '#adff2f', + honeydew: '#f0fff0', + hotpink: '#ff69b4', + indianred: '#cd5c5c', + indigo: '#4b0082', + ivory: '#fffff0', + khaki: '#f0e68c', + lavender: '#e6e6fa', + lavenderblush: '#fff0f5', + lawngreen: '#7cfc00', + lemonchiffon: '#fffacd', + lightblue: '#add8e6', + lightcoral: '#f08080', + lightcyan: '#e0ffff', + lightgoldenrodyellow: '#fafad2', + lightgray: '#d3d3d3', + lightgrey: '#d3d3d3', + lightgreen: '#90ee90', + lightpink: '#ffb6c1', + lightsalmon: '#ffa07a', + lightseagreen: '#20b2aa', + lightskyblue: '#87cefa', + lightslategray: '#789', + lightslategrey: '#789', + lightsteelblue: '#b0c4de', + lightyellow: '#ffffe0', + lime: '#0f0', + limegreen: '#32cd32', + linen: '#faf0e6', + magenta: '#f0f', + maroon: '#800000', + mediumaquamarine: '#66cdaa', + mediumblue: '#0000cd', + mediumorchid: '#ba55d3', + mediumpurple: '#9370d8', + mediumseagreen: '#3cb371', + mediumslateblue: '#7b68ee', + mediumspringgreen: '#00fa9a', + mediumturquoise: '#48d1cc', + mediumvioletred: '#c71585', + midnightblue: '#191970', + mintcream: '#f5fffa', + mistyrose: '#ffe4e1', + moccasin: '#ffe4b5', + navajowhite: '#ffdead', + navy: '#000080', + oldlace: '#fdf5e6', + olive: '#808000', + olivedrab: '#6b8e23', + orange: '#ffa500', + orangered: '#ff4500', + orchid: '#da70d6', + palegoldenrod: '#eee8aa', + palegreen: '#98fb98', + paleturquoise: '#afeeee', + palevioletred: '#d87093', + papayawhip: '#ffefd5', + peachpuff: '#ffdab9', + peru: '#cd853f', + pink: '#ffc0cb', + plum: '#dda0dd', + powderblue: '#b0e0e6', + purple: '#800080', + red: '#f00', + rosybrown: '#bc8f8f', + royalblue: '#4169e1', + saddlebrown: '#8b4513', + salmon: '#fa8072', + sandybrown: '#f4a460', + seagreen: '#2e8b57', + seashell: '#fff5ee', + sienna: '#a0522d', + silver: '#c0c0c0', + skyblue: '#87ceeb', + slateblue: '#6a5acd', + slategray: '#708090', + slategrey: '#708090', + snow: '#fffafa', + springgreen: '#00ff7f', + steelblue: '#4682b4', + tan: '#d2b48c', + teal: '#008080', + thistle: '#d8bfd8', + tomato: '#ff6347', + turquoise: '#40e0d0', + violet: '#ee82ee', + wheat: '#f5deb3', + white: '#fff', + whitesmoke: '#f5f5f5', + yellow: '#ff0', + yellowgreen: '#9acd32' + }; + function customPalette(userPalete) { + palette = userPalete; + } + function resetPalette() { + palette = _palette; + } + function getColor(idx, userPalete) { + idx = idx | 0; + userPalete = userPalete || palette; + return userPalete[idx % userPalete.length]; + } + function customHighlight(userHighlightColor) { + highlightColor = userHighlightColor; + } + function resetHighlight() { + _highlightColor = highlightColor; + } + function getHighlightColor() { + return highlightColor; + } + function getRadialGradient(x0, y0, r0, x1, y1, r1, colorList) { + if (!_ctx) { + _ctx = util.getContext(); + } + var gradient = _ctx.createRadialGradient(x0, y0, r0, x1, y1, r1); + for (var i = 0, l = colorList.length; i < l; i++) { + gradient.addColorStop(colorList[i][0], colorList[i][1]); + } + gradient.__nonRecursion = true; + return gradient; + } + function getLinearGradient(x0, y0, x1, y1, colorList) { + if (!_ctx) { + _ctx = util.getContext(); + } + var gradient = _ctx.createLinearGradient(x0, y0, x1, y1); + for (var i = 0, l = colorList.length; i < l; i++) { + gradient.addColorStop(colorList[i][0], colorList[i][1]); + } + gradient.__nonRecursion = true; + return gradient; + } + function getStepColors(start, end, step) { + start = toRGBA(start); + end = toRGBA(end); + start = getData(start); + end = getData(end); + var colors = []; + var stepR = (end[0] - start[0]) / step; + var stepG = (end[1] - start[1]) / step; + var stepB = (end[2] - start[2]) / step; + var stepA = (end[3] - start[3]) / step; + for (var i = 0, r = start[0], g = start[1], b = start[2], a = start[3]; i < step; i++) { + colors[i] = toColor([ + adjust(Math.floor(r), [ + 0, + 255 + ]), + adjust(Math.floor(g), [ + 0, + 255 + ]), + adjust(Math.floor(b), [ + 0, + 255 + ]), + a.toFixed(4) - 0 + ], 'rgba'); + r += stepR; + g += stepG; + b += stepB; + a += stepA; + } + r = end[0]; + g = end[1]; + b = end[2]; + a = end[3]; + colors[i] = toColor([ + r, + g, + b, + a + ], 'rgba'); + return colors; + } + function getGradientColors(colors, step) { + var ret = []; + var len = colors.length; + if (step === undefined) { + step = 20; + } + if (len === 1) { + ret = getStepColors(colors[0], colors[0], step); + } else if (len > 1) { + for (var i = 0, n = len - 1; i < n; i++) { + var steps = getStepColors(colors[i], colors[i + 1], step); + if (i < n - 1) { + steps.pop(); + } + ret = ret.concat(steps); + } + } + return ret; + } + function toColor(data, format) { + format = format || 'rgb'; + if (data && (data.length === 3 || data.length === 4)) { + data = map(data, function (c) { + return c > 1 ? Math.ceil(c) : c; + }); + if (format.indexOf('hex') > -1) { + return '#' + ((1 << 24) + (data[0] << 16) + (data[1] << 8) + +data[2]).toString(16).slice(1); + } else if (format.indexOf('hs') > -1) { + var sx = map(data.slice(1, 3), function (c) { + return c + '%'; + }); + data[1] = sx[0]; + data[2] = sx[1]; + } + if (format.indexOf('a') > -1) { + if (data.length === 3) { + data.push(1); + } + data[3] = adjust(data[3], [ + 0, + 1 + ]); + return format + '(' + data.slice(0, 4).join(',') + ')'; + } + return format + '(' + data.slice(0, 3).join(',') + ')'; + } + } + function toArray(color) { + color = trim(color); + if (color.indexOf('rgba') < 0) { + color = toRGBA(color); + } + var data = []; + var i = 0; + color.replace(/[\d.]+/g, function (n) { + if (i < 3) { + n = n | 0; + } else { + n = +n; + } + data[i++] = n; + }); + return data; + } + function convert(color, format) { + if (!isCalculableColor(color)) { + return color; + } + var data = getData(color); + var alpha = data[3]; + if (typeof alpha === 'undefined') { + alpha = 1; + } + if (color.indexOf('hsb') > -1) { + data = _HSV_2_RGB(data); + } else if (color.indexOf('hsl') > -1) { + data = _HSL_2_RGB(data); + } + if (format.indexOf('hsb') > -1 || format.indexOf('hsv') > -1) { + data = _RGB_2_HSB(data); + } else if (format.indexOf('hsl') > -1) { + data = _RGB_2_HSL(data); + } + data[3] = alpha; + return toColor(data, format); + } + function toRGBA(color) { + return convert(color, 'rgba'); + } + function toRGB(color) { + return convert(color, 'rgb'); + } + function toHex(color) { + return convert(color, 'hex'); + } + function toHSVA(color) { + return convert(color, 'hsva'); + } + function toHSV(color) { + return convert(color, 'hsv'); + } + function toHSBA(color) { + return convert(color, 'hsba'); + } + function toHSB(color) { + return convert(color, 'hsb'); + } + function toHSLA(color) { + return convert(color, 'hsla'); + } + function toHSL(color) { + return convert(color, 'hsl'); + } + function toName(color) { + for (var key in _nameColors) { + if (toHex(_nameColors[key]) === toHex(color)) { + return key; + } + } + return null; + } + function trim(color) { + return String(color).replace(/\s+/g, ''); + } + function normalize(color) { + if (_nameColors[color]) { + color = _nameColors[color]; + } + color = trim(color); + color = color.replace(/hsv/i, 'hsb'); + if (/^#[\da-f]{3}$/i.test(color)) { + color = parseInt(color.slice(1), 16); + var r = (color & 3840) << 8; + var g = (color & 240) << 4; + var b = color & 15; + color = '#' + ((1 << 24) + (r << 4) + r + (g << 4) + g + (b << 4) + b).toString(16).slice(1); + } + return color; + } + function lift(color, level) { + if (!isCalculableColor(color)) { + return color; + } + var direct = level > 0 ? 1 : -1; + if (typeof level === 'undefined') { + level = 0; + } + level = Math.abs(level) > 1 ? 1 : Math.abs(level); + color = toRGB(color); + var data = getData(color); + for (var i = 0; i < 3; i++) { + if (direct === 1) { + data[i] = data[i] * (1 - level) | 0; + } else { + data[i] = (255 - data[i]) * level + data[i] | 0; + } + } + return 'rgb(' + data.join(',') + ')'; + } + function reverse(color) { + if (!isCalculableColor(color)) { + return color; + } + var data = getData(toRGBA(color)); + data = map(data, function (c) { + return 255 - c; + }); + return toColor(data, 'rgb'); + } + function mix(color1, color2, weight) { + if (!isCalculableColor(color1) || !isCalculableColor(color2)) { + return color1; + } + if (typeof weight === 'undefined') { + weight = 0.5; + } + weight = 1 - adjust(weight, [ + 0, + 1 + ]); + var w = weight * 2 - 1; + var data1 = getData(toRGBA(color1)); + var data2 = getData(toRGBA(color2)); + var d = data1[3] - data2[3]; + var weight1 = ((w * d === -1 ? w : (w + d) / (1 + w * d)) + 1) / 2; + var weight2 = 1 - weight1; + var data = []; + for (var i = 0; i < 3; i++) { + data[i] = data1[i] * weight1 + data2[i] * weight2; + } + var alpha = data1[3] * weight + data2[3] * (1 - weight); + alpha = Math.max(0, Math.min(1, alpha)); + if (data1[3] === 1 && data2[3] === 1) { + return toColor(data, 'rgb'); + } + data[3] = alpha; + return toColor(data, 'rgba'); + } + function random() { + return '#' + (Math.random().toString(16) + '0000').slice(2, 8); + } + function getData(color) { + color = normalize(color); + var r = color.match(colorRegExp); + if (r === null) { + throw new Error('The color format error'); + } + var d; + var a; + var data = []; + var rgb; + if (r[2]) { + d = r[2].replace('#', '').split(''); + rgb = [ + d[0] + d[1], + d[2] + d[3], + d[4] + d[5] + ]; + data = map(rgb, function (c) { + return adjust(parseInt(c, 16), [ + 0, + 255 + ]); + }); + } else if (r[4]) { + var rgba = r[4].split(','); + a = rgba[3]; + rgb = rgba.slice(0, 3); + data = map(rgb, function (c) { + c = Math.floor(c.indexOf('%') > 0 ? parseInt(c, 0) * 2.55 : c); + return adjust(c, [ + 0, + 255 + ]); + }); + if (typeof a !== 'undefined') { + data.push(adjust(parseFloat(a), [ + 0, + 1 + ])); + } + } else if (r[5] || r[6]) { + var hsxa = (r[5] || r[6]).split(','); + var h = parseInt(hsxa[0], 0) / 360; + var s = hsxa[1]; + var x = hsxa[2]; + a = hsxa[3]; + data = map([ + s, + x + ], function (c) { + return adjust(parseFloat(c) / 100, [ + 0, + 1 + ]); + }); + data.unshift(h); + if (typeof a !== 'undefined') { + data.push(adjust(parseFloat(a), [ + 0, + 1 + ])); + } + } + return data; + } + function alpha(color, a) { + if (!isCalculableColor(color)) { + return color; + } + if (a === null) { + a = 1; + } + var data = getData(toRGBA(color)); + data[3] = adjust(Number(a).toFixed(4), [ + 0, + 1 + ]); + return toColor(data, 'rgba'); + } + function map(array, fun) { + if (typeof fun !== 'function') { + throw new TypeError(); + } + var len = array ? array.length : 0; + for (var i = 0; i < len; i++) { + array[i] = fun(array[i]); + } + return array; + } + function adjust(value, region) { + if (value <= region[0]) { + value = region[0]; + } else if (value >= region[1]) { + value = region[1]; + } + return value; + } + function isCalculableColor(color) { + return color instanceof Array || typeof color === 'string'; + } + function _HSV_2_RGB(data) { + var H = data[0]; + var S = data[1]; + var V = data[2]; + var R; + var G; + var B; + if (S === 0) { + R = V * 255; + G = V * 255; + B = V * 255; + } else { + var h = H * 6; + if (h === 6) { + h = 0; + } + var i = h | 0; + var v1 = V * (1 - S); + var v2 = V * (1 - S * (h - i)); + var v3 = V * (1 - S * (1 - (h - i))); + var r = 0; + var g = 0; + var b = 0; + if (i === 0) { + r = V; + g = v3; + b = v1; + } else if (i === 1) { + r = v2; + g = V; + b = v1; + } else if (i === 2) { + r = v1; + g = V; + b = v3; + } else if (i === 3) { + r = v1; + g = v2; + b = V; + } else if (i === 4) { + r = v3; + g = v1; + b = V; + } else { + r = V; + g = v1; + b = v2; + } + R = r * 255; + G = g * 255; + B = b * 255; + } + return [ + R, + G, + B + ]; + } + function _HSL_2_RGB(data) { + var H = data[0]; + var S = data[1]; + var L = data[2]; + var R; + var G; + var B; + if (S === 0) { + R = L * 255; + G = L * 255; + B = L * 255; + } else { + var v2; + if (L < 0.5) { + v2 = L * (1 + S); + } else { + v2 = L + S - S * L; + } + var v1 = 2 * L - v2; + R = 255 * _HUE_2_RGB(v1, v2, H + 1 / 3); + G = 255 * _HUE_2_RGB(v1, v2, H); + B = 255 * _HUE_2_RGB(v1, v2, H - 1 / 3); + } + return [ + R, + G, + B + ]; + } + function _HUE_2_RGB(v1, v2, vH) { + if (vH < 0) { + vH += 1; + } + if (vH > 1) { + vH -= 1; + } + if (6 * vH < 1) { + return v1 + (v2 - v1) * 6 * vH; + } + if (2 * vH < 1) { + return v2; + } + if (3 * vH < 2) { + return v1 + (v2 - v1) * (2 / 3 - vH) * 6; + } + return v1; + } + function _RGB_2_HSB(data) { + var R = data[0] / 255; + var G = data[1] / 255; + var B = data[2] / 255; + var vMin = Math.min(R, G, B); + var vMax = Math.max(R, G, B); + var delta = vMax - vMin; + var V = vMax; + var H; + var S; + if (delta === 0) { + H = 0; + S = 0; + } else { + S = delta / vMax; + var deltaR = ((vMax - R) / 6 + delta / 2) / delta; + var deltaG = ((vMax - G) / 6 + delta / 2) / delta; + var deltaB = ((vMax - B) / 6 + delta / 2) / delta; + if (R === vMax) { + H = deltaB - deltaG; + } else if (G === vMax) { + H = 1 / 3 + deltaR - deltaB; + } else if (B === vMax) { + H = 2 / 3 + deltaG - deltaR; + } + if (H < 0) { + H += 1; + } + if (H > 1) { + H -= 1; + } + } + H = H * 360; + S = S * 100; + V = V * 100; + return [ + H, + S, + V + ]; + } + function _RGB_2_HSL(data) { + var R = data[0] / 255; + var G = data[1] / 255; + var B = data[2] / 255; + var vMin = Math.min(R, G, B); + var vMax = Math.max(R, G, B); + var delta = vMax - vMin; + var L = (vMax + vMin) / 2; + var H; + var S; + if (delta === 0) { + H = 0; + S = 0; + } else { + if (L < 0.5) { + S = delta / (vMax + vMin); + } else { + S = delta / (2 - vMax - vMin); + } + var deltaR = ((vMax - R) / 6 + delta / 2) / delta; + var deltaG = ((vMax - G) / 6 + delta / 2) / delta; + var deltaB = ((vMax - B) / 6 + delta / 2) / delta; + if (R === vMax) { + H = deltaB - deltaG; + } else if (G === vMax) { + H = 1 / 3 + deltaR - deltaB; + } else if (B === vMax) { + H = 2 / 3 + deltaG - deltaR; + } + if (H < 0) { + H += 1; + } + if (H > 1) { + H -= 1; + } + } + H = H * 360; + S = S * 100; + L = L * 100; + return [ + H, + S, + L + ]; + } + return { + customPalette: customPalette, + resetPalette: resetPalette, + getColor: getColor, + getHighlightColor: getHighlightColor, + customHighlight: customHighlight, + resetHighlight: resetHighlight, + getRadialGradient: getRadialGradient, + getLinearGradient: getLinearGradient, + getGradientColors: getGradientColors, + getStepColors: getStepColors, + reverse: reverse, + mix: mix, + lift: lift, + trim: trim, + random: random, + toRGB: toRGB, + toRGBA: toRGBA, + toHex: toHex, + toHSL: toHSL, + toHSLA: toHSLA, + toHSB: toHSB, + toHSBA: toHSBA, + toHSV: toHSV, + toHSVA: toHSVA, + toName: toName, + toColor: toColor, + toArray: toArray, + alpha: alpha, + getData: getData + }; +});define('echarts/component/timeline', [ + 'require', + './base', + 'zrender/shape/Rectangle', + '../util/shape/Icon', + '../util/shape/Chain', + '../config', + 'zrender/tool/util', + 'zrender/tool/area', + 'zrender/tool/event', + '../component' +], function (require) { + var Base = require('./base'); + var RectangleShape = require('zrender/shape/Rectangle'); + var IconShape = require('../util/shape/Icon'); + var ChainShape = require('../util/shape/Chain'); + var ecConfig = require('../config'); + ecConfig.timeline = { + zlevel: 0, + z: 4, + show: true, + type: 'time', + notMerge: false, + realtime: true, + x: 80, + x2: 80, + y2: 0, + height: 50, + backgroundColor: 'rgba(0,0,0,0)', + borderColor: '#ccc', + borderWidth: 0, + padding: 5, + controlPosition: 'left', + autoPlay: false, + loop: true, + playInterval: 2000, + lineStyle: { + width: 1, + color: '#666', + type: 'dashed' + }, + label: { + show: true, + interval: 'auto', + rotate: 0, + textStyle: { color: '#333' } + }, + checkpointStyle: { + symbol: 'auto', + symbolSize: 'auto', + color: 'auto', + borderColor: 'auto', + borderWidth: 'auto', + label: { + show: false, + textStyle: { color: 'auto' } + } + }, + controlStyle: { + itemSize: 15, + itemGap: 5, + normal: { color: '#333' }, + emphasis: { color: '#1e90ff' } + }, + symbol: 'emptyDiamond', + symbolSize: 4, + currentIndex: 0 + }; + var zrUtil = require('zrender/tool/util'); + var zrArea = require('zrender/tool/area'); + var zrEvent = require('zrender/tool/event'); + function Timeline(ecTheme, messageCenter, zr, option, myChart) { + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + var self = this; + self._onclick = function (param) { + return self.__onclick(param); + }; + self._ondrift = function (dx, dy) { + return self.__ondrift(this, dx, dy); + }; + self._ondragend = function () { + return self.__ondragend(); + }; + self._setCurrentOption = function () { + var timelineOption = self.timelineOption; + self.currentIndex %= timelineOption.data.length; + var curOption = self.options[self.currentIndex] || {}; + self.myChart.setOption(curOption, timelineOption.notMerge); + self.messageCenter.dispatch(ecConfig.EVENT.TIMELINE_CHANGED, null, { + currentIndex: self.currentIndex, + data: timelineOption.data[self.currentIndex].name != null ? timelineOption.data[self.currentIndex].name : timelineOption.data[self.currentIndex] + }, self.myChart); + }; + self._onFrame = function () { + self._setCurrentOption(); + self._syncHandleShape(); + if (self.timelineOption.autoPlay) { + self.playTicket = setTimeout(function () { + self.currentIndex += 1; + if (!self.timelineOption.loop && self.currentIndex >= self.timelineOption.data.length) { + self.currentIndex = self.timelineOption.data.length - 1; + self.stop(); + return; + } + self._onFrame(); + }, self.timelineOption.playInterval); + } + }; + this.setTheme(false); + this.options = this.option.options; + this.currentIndex = this.timelineOption.currentIndex % this.timelineOption.data.length; + if (!this.timelineOption.notMerge && this.currentIndex !== 0) { + this.options[this.currentIndex] = zrUtil.merge(this.options[this.currentIndex], this.options[0]); + } + if (this.timelineOption.show) { + this._buildShape(); + this._syncHandleShape(); + } + this._setCurrentOption(); + if (this.timelineOption.autoPlay) { + var self = this; + this.playTicket = setTimeout(function () { + self.play(); + }, this.ecTheme.animationDuration != null ? this.ecTheme.animationDuration : ecConfig.animationDuration); + } + } + Timeline.prototype = { + type: ecConfig.COMPONENT_TYPE_TIMELINE, + _buildShape: function () { + this._location = this._getLocation(); + this._buildBackground(); + this._buildControl(); + this._chainPoint = this._getChainPoint(); + if (this.timelineOption.label.show) { + var interval = this._getInterval(); + for (var i = 0, len = this._chainPoint.length; i < len; i += interval) { + this._chainPoint[i].showLabel = true; + } + } + this._buildChain(); + this._buildHandle(); + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + }, + _getLocation: function () { + var timelineOption = this.timelineOption; + var padding = this.reformCssArray(this.timelineOption.padding); + var zrWidth = this.zr.getWidth(); + var x = this.parsePercent(timelineOption.x, zrWidth); + var x2 = this.parsePercent(timelineOption.x2, zrWidth); + var width; + if (timelineOption.width == null) { + width = zrWidth - x - x2; + x2 = zrWidth - x2; + } else { + width = this.parsePercent(timelineOption.width, zrWidth); + x2 = x + width; + } + var zrHeight = this.zr.getHeight(); + var height = this.parsePercent(timelineOption.height, zrHeight); + var y; + var y2; + if (timelineOption.y != null) { + y = this.parsePercent(timelineOption.y, zrHeight); + y2 = y + height; + } else { + y2 = zrHeight - this.parsePercent(timelineOption.y2, zrHeight); + y = y2 - height; + } + return { + x: x + padding[3], + y: y + padding[0], + x2: x2 - padding[1], + y2: y2 - padding[2], + width: width - padding[1] - padding[3], + height: height - padding[0] - padding[2] + }; + }, + _getReformedLabel: function (idx) { + var timelineOption = this.timelineOption; + var data = timelineOption.data[idx].name != null ? timelineOption.data[idx].name : timelineOption.data[idx]; + var formatter = timelineOption.data[idx].formatter || timelineOption.label.formatter; + if (formatter) { + if (typeof formatter === 'function') { + data = formatter.call(this.myChart, data); + } else if (typeof formatter === 'string') { + data = formatter.replace('{value}', data); + } + } + return data; + }, + _getInterval: function () { + var chainPoint = this._chainPoint; + var timelineOption = this.timelineOption; + var interval = timelineOption.label.interval; + if (interval === 'auto') { + var fontSize = timelineOption.label.textStyle.fontSize; + var data = timelineOption.data; + var dataLength = timelineOption.data.length; + if (dataLength > 3) { + var isEnough = false; + var labelSpace; + var labelSize; + interval = 0; + while (!isEnough && interval < dataLength) { + interval++; + isEnough = true; + for (var i = interval; i < dataLength; i += interval) { + labelSpace = chainPoint[i].x - chainPoint[i - interval].x; + if (timelineOption.label.rotate !== 0) { + labelSize = fontSize; + } else if (data[i].textStyle) { + labelSize = zrArea.getTextWidth(chainPoint[i].name, chainPoint[i].textFont); + } else { + var label = chainPoint[i].name + ''; + var wLen = (label.match(/\w/g) || '').length; + var oLen = label.length - wLen; + labelSize = wLen * fontSize * 2 / 3 + oLen * fontSize; + } + if (labelSpace < labelSize) { + isEnough = false; + break; + } + } + } + } else { + interval = 1; + } + } else { + interval = interval - 0 + 1; + } + return interval; + }, + _getChainPoint: function () { + var timelineOption = this.timelineOption; + var symbol = timelineOption.symbol.toLowerCase(); + var symbolSize = timelineOption.symbolSize; + var rotate = timelineOption.label.rotate; + var textStyle = timelineOption.label.textStyle; + var textFont = this.getFont(textStyle); + var dataTextStyle; + var data = timelineOption.data; + var x = this._location.x; + var y = this._location.y + this._location.height / 4 * 3; + var width = this._location.x2 - this._location.x; + var len = data.length; + function _getName(i) { + return data[i].name != null ? data[i].name : data[i] + ''; + } + var xList = []; + if (len > 1) { + var boundaryGap = width / len; + boundaryGap = boundaryGap > 50 ? 50 : boundaryGap < 20 ? 5 : boundaryGap; + width -= boundaryGap * 2; + if (timelineOption.type === 'number') { + for (var i = 0; i < len; i++) { + xList.push(x + boundaryGap + width / (len - 1) * i); + } + } else { + xList[0] = new Date(_getName(0).replace(/-/g, '/')); + xList[len - 1] = new Date(_getName(len - 1).replace(/-/g, '/')) - xList[0]; + for (var i = 1; i < len; i++) { + xList[i] = x + boundaryGap + width * (new Date(_getName(i).replace(/-/g, '/')) - xList[0]) / xList[len - 1]; + } + xList[0] = x + boundaryGap; + } + } else { + xList.push(x + width / 2); + } + var list = []; + var curSymbol; + var n; + var isEmpty; + var textAlign; + var rotation; + for (var i = 0; i < len; i++) { + x = xList[i]; + curSymbol = data[i].symbol && data[i].symbol.toLowerCase() || symbol; + if (curSymbol.match('empty')) { + curSymbol = curSymbol.replace('empty', ''); + isEmpty = true; + } else { + isEmpty = false; + } + if (curSymbol.match('star')) { + n = curSymbol.replace('star', '') - 0 || 5; + curSymbol = 'star'; + } + dataTextStyle = data[i].textStyle ? zrUtil.merge(data[i].textStyle || {}, textStyle) : textStyle; + textAlign = dataTextStyle.align || 'center'; + if (rotate) { + textAlign = rotate > 0 ? 'right' : 'left'; + rotation = [ + rotate * Math.PI / 180, + x, + y - 5 + ]; + } else { + rotation = false; + } + list.push({ + x: x, + n: n, + isEmpty: isEmpty, + symbol: curSymbol, + symbolSize: data[i].symbolSize || symbolSize, + color: data[i].color, + borderColor: data[i].borderColor, + borderWidth: data[i].borderWidth, + name: this._getReformedLabel(i), + textColor: dataTextStyle.color, + textAlign: textAlign, + textBaseline: dataTextStyle.baseline || 'middle', + textX: x, + textY: y - (rotate ? 5 : 0), + textFont: data[i].textStyle ? this.getFont(dataTextStyle) : textFont, + rotation: rotation, + showLabel: false + }); + } + return list; + }, + _buildBackground: function () { + var timelineOption = this.timelineOption; + var padding = this.reformCssArray(this.timelineOption.padding); + var width = this._location.width; + var height = this._location.height; + if (timelineOption.borderWidth !== 0 || timelineOption.backgroundColor.replace(/\s/g, '') != 'rgba(0,0,0,0)') { + this.shapeList.push(new RectangleShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: this._location.x - padding[3], + y: this._location.y - padding[0], + width: width + padding[1] + padding[3], + height: height + padding[0] + padding[2], + brushType: timelineOption.borderWidth === 0 ? 'fill' : 'both', + color: timelineOption.backgroundColor, + strokeColor: timelineOption.borderColor, + lineWidth: timelineOption.borderWidth + } + })); + } + }, + _buildControl: function () { + var self = this; + var timelineOption = this.timelineOption; + var lineStyle = timelineOption.lineStyle; + var controlStyle = timelineOption.controlStyle; + if (timelineOption.controlPosition === 'none') { + return; + } + var iconSize = controlStyle.itemSize; + var iconGap = controlStyle.itemGap; + var x; + if (timelineOption.controlPosition === 'left') { + x = this._location.x; + this._location.x += (iconSize + iconGap) * 3; + } else { + x = this._location.x2 - ((iconSize + iconGap) * 3 - iconGap); + this._location.x2 -= (iconSize + iconGap) * 3; + } + var y = this._location.y; + var iconStyle = { + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + style: { + iconType: 'timelineControl', + symbol: 'last', + x: x, + y: y, + width: iconSize, + height: iconSize, + brushType: 'stroke', + color: controlStyle.normal.color, + strokeColor: controlStyle.normal.color, + lineWidth: lineStyle.width + }, + highlightStyle: { + color: controlStyle.emphasis.color, + strokeColor: controlStyle.emphasis.color, + lineWidth: lineStyle.width + 1 + }, + clickable: true + }; + this._ctrLastShape = new IconShape(iconStyle); + this._ctrLastShape.onclick = function () { + self.last(); + }; + this.shapeList.push(this._ctrLastShape); + x += iconSize + iconGap; + this._ctrPlayShape = new IconShape(zrUtil.clone(iconStyle)); + this._ctrPlayShape.style.brushType = 'fill'; + this._ctrPlayShape.style.symbol = 'play'; + this._ctrPlayShape.style.status = this.timelineOption.autoPlay ? 'playing' : 'stop'; + this._ctrPlayShape.style.x = x; + this._ctrPlayShape.onclick = function () { + if (self._ctrPlayShape.style.status === 'stop') { + self.play(); + } else { + self.stop(); + } + }; + this.shapeList.push(this._ctrPlayShape); + x += iconSize + iconGap; + this._ctrNextShape = new IconShape(zrUtil.clone(iconStyle)); + this._ctrNextShape.style.symbol = 'next'; + this._ctrNextShape.style.x = x; + this._ctrNextShape.onclick = function () { + self.next(); + }; + this.shapeList.push(this._ctrNextShape); + }, + _buildChain: function () { + var timelineOption = this.timelineOption; + var lineStyle = timelineOption.lineStyle; + this._timelineShae = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: this._location.x, + y: this.subPixelOptimize(this._location.y, lineStyle.width), + width: this._location.x2 - this._location.x, + height: this._location.height, + chainPoint: this._chainPoint, + brushType: 'both', + strokeColor: lineStyle.color, + lineWidth: lineStyle.width, + lineType: lineStyle.type + }, + hoverable: false, + clickable: true, + onclick: this._onclick + }; + this._timelineShae = new ChainShape(this._timelineShae); + this.shapeList.push(this._timelineShae); + }, + _buildHandle: function () { + var curPoint = this._chainPoint[this.currentIndex]; + var symbolSize = curPoint.symbolSize + 1; + symbolSize = symbolSize < 5 ? 5 : symbolSize; + this._handleShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + hoverable: false, + draggable: true, + style: { + iconType: 'diamond', + n: curPoint.n, + x: curPoint.x - symbolSize, + y: this._location.y + this._location.height / 4 - symbolSize, + width: symbolSize * 2, + height: symbolSize * 2, + brushType: 'both', + textPosition: 'specific', + textX: curPoint.x, + textY: this._location.y - this._location.height / 4, + textAlign: 'center', + textBaseline: 'middle' + }, + highlightStyle: {}, + ondrift: this._ondrift, + ondragend: this._ondragend + }; + this._handleShape = new IconShape(this._handleShape); + this.shapeList.push(this._handleShape); + }, + _syncHandleShape: function () { + if (!this.timelineOption.show) { + return; + } + var timelineOption = this.timelineOption; + var cpStyle = timelineOption.checkpointStyle; + var curPoint = this._chainPoint[this.currentIndex]; + this._handleShape.style.text = cpStyle.label.show ? curPoint.name : ''; + this._handleShape.style.textFont = curPoint.textFont; + this._handleShape.style.n = curPoint.n; + if (cpStyle.symbol === 'auto') { + this._handleShape.style.iconType = curPoint.symbol != 'none' ? curPoint.symbol : 'diamond'; + } else { + this._handleShape.style.iconType = cpStyle.symbol; + if (cpStyle.symbol.match('star')) { + this._handleShape.style.n = cpStyle.symbol.replace('star', '') - 0 || 5; + this._handleShape.style.iconType = 'star'; + } + } + var symbolSize; + if (cpStyle.symbolSize === 'auto') { + symbolSize = curPoint.symbolSize + 2; + symbolSize = symbolSize < 5 ? 5 : symbolSize; + } else { + symbolSize = cpStyle.symbolSize - 0; + } + this._handleShape.style.color = cpStyle.color === 'auto' ? curPoint.color ? curPoint.color : timelineOption.controlStyle.emphasis.color : cpStyle.color; + this._handleShape.style.textColor = cpStyle.label.textStyle.color === 'auto' ? this._handleShape.style.color : cpStyle.label.textStyle.color; + this._handleShape.highlightStyle.strokeColor = this._handleShape.style.strokeColor = cpStyle.borderColor === 'auto' ? curPoint.borderColor ? curPoint.borderColor : '#fff' : cpStyle.borderColor; + this._handleShape.style.lineWidth = cpStyle.borderWidth === 'auto' ? curPoint.borderWidth ? curPoint.borderWidth : 0 : cpStyle.borderWidth - 0; + this._handleShape.highlightStyle.lineWidth = this._handleShape.style.lineWidth + 1; + this.zr.animate(this._handleShape.id, 'style').when(500, { + x: curPoint.x - symbolSize, + textX: curPoint.x, + y: this._location.y + this._location.height / 4 - symbolSize, + width: symbolSize * 2, + height: symbolSize * 2 + }).start('ExponentialOut'); + }, + _findChainIndex: function (x) { + var chainPoint = this._chainPoint; + var len = chainPoint.length; + if (x <= chainPoint[0].x) { + return 0; + } else if (x >= chainPoint[len - 1].x) { + return len - 1; + } + for (var i = 0; i < len - 1; i++) { + if (x >= chainPoint[i].x && x <= chainPoint[i + 1].x) { + return Math.abs(x - chainPoint[i].x) < Math.abs(x - chainPoint[i + 1].x) ? i : i + 1; + } + } + }, + __onclick: function (param) { + var x = zrEvent.getX(param.event); + var newIndex = this._findChainIndex(x); + if (newIndex === this.currentIndex) { + return true; + } + this.currentIndex = newIndex; + this.timelineOption.autoPlay && this.stop(); + clearTimeout(this.playTicket); + this._onFrame(); + }, + __ondrift: function (shape, dx) { + this.timelineOption.autoPlay && this.stop(); + var chainPoint = this._chainPoint; + var len = chainPoint.length; + var newIndex; + if (shape.style.x + dx <= chainPoint[0].x - chainPoint[0].symbolSize) { + shape.style.x = chainPoint[0].x - chainPoint[0].symbolSize; + newIndex = 0; + } else if (shape.style.x + dx >= chainPoint[len - 1].x - chainPoint[len - 1].symbolSize) { + shape.style.x = chainPoint[len - 1].x - chainPoint[len - 1].symbolSize; + newIndex = len - 1; + } else { + shape.style.x += dx; + newIndex = this._findChainIndex(shape.style.x); + } + var curPoint = chainPoint[newIndex]; + var symbolSize = curPoint.symbolSize + 2; + shape.style.iconType = curPoint.symbol; + shape.style.n = curPoint.n; + shape.style.textX = shape.style.x + symbolSize / 2; + shape.style.y = this._location.y + this._location.height / 4 - symbolSize; + shape.style.width = symbolSize * 2; + shape.style.height = symbolSize * 2; + shape.style.text = curPoint.name; + if (newIndex === this.currentIndex) { + return true; + } + this.currentIndex = newIndex; + if (this.timelineOption.realtime) { + clearTimeout(this.playTicket); + var self = this; + this.playTicket = setTimeout(function () { + self._setCurrentOption(); + }, 200); + } + return true; + }, + __ondragend: function () { + this.isDragend = true; + }, + ondragend: function (param, status) { + if (!this.isDragend || !param.target) { + return; + } + !this.timelineOption.realtime && this._setCurrentOption(); + status.dragOut = true; + status.dragIn = true; + status.needRefresh = false; + this.isDragend = false; + this._syncHandleShape(); + return; + }, + last: function () { + this.timelineOption.autoPlay && this.stop(); + this.currentIndex -= 1; + if (this.currentIndex < 0) { + this.currentIndex = this.timelineOption.data.length - 1; + } + this._onFrame(); + return this.currentIndex; + }, + next: function () { + this.timelineOption.autoPlay && this.stop(); + this.currentIndex += 1; + if (this.currentIndex >= this.timelineOption.data.length) { + this.currentIndex = 0; + } + this._onFrame(); + return this.currentIndex; + }, + play: function (targetIndex, autoPlay) { + if (this._ctrPlayShape && this._ctrPlayShape.style.status != 'playing') { + this._ctrPlayShape.style.status = 'playing'; + this.zr.modShape(this._ctrPlayShape.id); + this.zr.refreshNextFrame(); + } + this.timelineOption.autoPlay = autoPlay != null ? autoPlay : true; + if (!this.timelineOption.autoPlay) { + clearTimeout(this.playTicket); + } + this.currentIndex = targetIndex != null ? targetIndex : this.currentIndex + 1; + if (this.currentIndex >= this.timelineOption.data.length) { + this.currentIndex = 0; + } + this._onFrame(); + return this.currentIndex; + }, + stop: function () { + if (this._ctrPlayShape && this._ctrPlayShape.style.status != 'stop') { + this._ctrPlayShape.style.status = 'stop'; + this.zr.modShape(this._ctrPlayShape.id); + this.zr.refreshNextFrame(); + } + this.timelineOption.autoPlay = false; + clearTimeout(this.playTicket); + return this.currentIndex; + }, + resize: function () { + if (this.timelineOption.show) { + this.clear(); + this._buildShape(); + this._syncHandleShape(); + } + }, + setTheme: function (needRefresh) { + this.timelineOption = this.reformOption(zrUtil.clone(this.option.timeline)); + this.timelineOption.label.textStyle = this.getTextStyle(this.timelineOption.label.textStyle); + this.timelineOption.checkpointStyle.label.textStyle = this.getTextStyle(this.timelineOption.checkpointStyle.label.textStyle); + if (!this.myChart.canvasSupported) { + this.timelineOption.realtime = false; + } + if (this.timelineOption.show && needRefresh) { + this.clear(); + this._buildShape(); + this._syncHandleShape(); + } + }, + onbeforDispose: function () { + clearTimeout(this.playTicket); + } + }; + function timelineControl(ctx, style) { + var lineWidth = 2; + var x = style.x + lineWidth; + var y = style.y + lineWidth + 2; + var width = style.width - lineWidth; + var height = style.height - lineWidth; + var symbol = style.symbol; + if (symbol === 'last') { + ctx.moveTo(x + width - 2, y + height / 3); + ctx.lineTo(x + width - 2, y); + ctx.lineTo(x + 2, y + height / 2); + ctx.lineTo(x + width - 2, y + height); + ctx.lineTo(x + width - 2, y + height / 3 * 2); + ctx.moveTo(x, y); + ctx.lineTo(x, y); + } else if (symbol === 'next') { + ctx.moveTo(x + 2, y + height / 3); + ctx.lineTo(x + 2, y); + ctx.lineTo(x + width - 2, y + height / 2); + ctx.lineTo(x + 2, y + height); + ctx.lineTo(x + 2, y + height / 3 * 2); + ctx.moveTo(x, y); + ctx.lineTo(x, y); + } else if (symbol === 'play') { + if (style.status === 'stop') { + ctx.moveTo(x + 2, y); + ctx.lineTo(x + width - 2, y + height / 2); + ctx.lineTo(x + 2, y + height); + ctx.lineTo(x + 2, y); + } else { + var delta = style.brushType === 'both' ? 2 : 3; + ctx.rect(x + 2, y, delta, height); + ctx.rect(x + width - delta - 2, y, delta, height); + } + } else if (symbol.match('image')) { + var imageLocation = ''; + imageLocation = symbol.replace(new RegExp('^image:\\/\\/'), ''); + symbol = IconShape.prototype.iconLibrary.image; + symbol(ctx, { + x: x, + y: y, + width: width, + height: height, + image: imageLocation + }); + } + } + IconShape.prototype.iconLibrary['timelineControl'] = timelineControl; + zrUtil.inherits(Timeline, Base); + require('../component').define('timeline', Timeline); + return Timeline; +});define('zrender/shape/Image', [ + 'require', + './Base', + '../tool/util' +], function (require) { + var Base = require('./Base'); + var ZImage = function (options) { + Base.call(this, options); + }; + ZImage.prototype = { + type: 'image', + brush: function (ctx, isHighlight, refreshNextFrame) { + var style = this.style || {}; + if (isHighlight) { + style = this.getHighlightStyle(style, this.highlightStyle || {}); + } + var image = style.image; + var self = this; + if (!this._imageCache) { + this._imageCache = {}; + } + if (typeof image === 'string') { + var src = image; + if (this._imageCache[src]) { + image = this._imageCache[src]; + } else { + image = new Image(); + image.onload = function () { + image.onload = null; + self.modSelf(); + refreshNextFrame(); + }; + image.src = src; + this._imageCache[src] = image; + } + } + if (image) { + if (image.nodeName.toUpperCase() == 'IMG') { + if (window.ActiveXObject) { + if (image.readyState != 'complete') { + return; + } + } else { + if (!image.complete) { + return; + } + } + } + var width = style.width || image.width; + var height = style.height || image.height; + var x = style.x; + var y = style.y; + if (!image.width || !image.height) { + return; + } + ctx.save(); + this.doClip(ctx); + this.setContext(ctx, style); + this.setTransform(ctx); + if (style.sWidth && style.sHeight) { + var sx = style.sx || 0; + var sy = style.sy || 0; + ctx.drawImage(image, sx, sy, style.sWidth, style.sHeight, x, y, width, height); + } else if (style.sx && style.sy) { + var sx = style.sx; + var sy = style.sy; + var sWidth = width - sx; + var sHeight = height - sy; + ctx.drawImage(image, sx, sy, sWidth, sHeight, x, y, width, height); + } else { + ctx.drawImage(image, x, y, width, height); + } + if (!style.width) { + style.width = width; + } + if (!style.height) { + style.height = height; + } + if (!this.style.width) { + this.style.width = width; + } + if (!this.style.height) { + this.style.height = height; + } + this.drawText(ctx, style, this.style); + ctx.restore(); + } + }, + getRect: function (style) { + return { + x: style.x, + y: style.y, + width: style.width, + height: style.height + }; + }, + clearCache: function () { + this._imageCache = {}; + } + }; + require('../tool/util').inherits(ZImage, Base); + return ZImage; +});define('zrender/loadingEffect/Bar', [ + 'require', + './Base', + '../tool/util', + '../tool/color', + '../shape/Rectangle' +], function (require) { + var Base = require('./Base'); + var util = require('../tool/util'); + var zrColor = require('../tool/color'); + var RectangleShape = require('../shape/Rectangle'); + function Bar(options) { + Base.call(this, options); + } + util.inherits(Bar, Base); + Bar.prototype._start = function (addShapeHandle, refreshHandle) { + var options = util.merge(this.options, { + textStyle: { color: '#888' }, + backgroundColor: 'rgba(250, 250, 250, 0.8)', + effectOption: { + x: 0, + y: this.canvasHeight / 2 - 30, + width: this.canvasWidth, + height: 5, + brushType: 'fill', + timeInterval: 100 + } + }); + var textShape = this.createTextShape(options.textStyle); + var background = this.createBackgroundShape(options.backgroundColor); + var effectOption = options.effectOption; + var barShape = new RectangleShape({ highlightStyle: util.clone(effectOption) }); + barShape.highlightStyle.color = effectOption.color || zrColor.getLinearGradient(effectOption.x, effectOption.y, effectOption.x + effectOption.width, effectOption.y + effectOption.height, [ + [ + 0, + '#ff6400' + ], + [ + 0.5, + '#ffe100' + ], + [ + 1, + '#b1ff00' + ] + ]); + if (options.progress != null) { + addShapeHandle(background); + barShape.highlightStyle.width = this.adjust(options.progress, [ + 0, + 1 + ]) * options.effectOption.width; + addShapeHandle(barShape); + addShapeHandle(textShape); + refreshHandle(); + return; + } else { + barShape.highlightStyle.width = 0; + return setInterval(function () { + addShapeHandle(background); + if (barShape.highlightStyle.width < effectOption.width) { + barShape.highlightStyle.width += 8; + } else { + barShape.highlightStyle.width = 0; + } + addShapeHandle(barShape); + addShapeHandle(textShape); + refreshHandle(); + }, effectOption.timeInterval); + } + }; + return Bar; +});define('zrender/loadingEffect/Bubble', [ + 'require', + './Base', + '../tool/util', + '../tool/color', + '../shape/Circle' +], function (require) { + var Base = require('./Base'); + var util = require('../tool/util'); + var zrColor = require('../tool/color'); + var CircleShape = require('../shape/Circle'); + function Bubble(options) { + Base.call(this, options); + } + util.inherits(Bubble, Base); + Bubble.prototype._start = function (addShapeHandle, refreshHandle) { + var options = util.merge(this.options, { + textStyle: { color: '#888' }, + backgroundColor: 'rgba(250, 250, 250, 0.8)', + effect: { + n: 50, + lineWidth: 2, + brushType: 'stroke', + color: 'random', + timeInterval: 100 + } + }); + var textShape = this.createTextShape(options.textStyle); + var background = this.createBackgroundShape(options.backgroundColor); + var effectOption = options.effect; + var n = effectOption.n; + var brushType = effectOption.brushType; + var lineWidth = effectOption.lineWidth; + var shapeList = []; + var canvasWidth = this.canvasWidth; + var canvasHeight = this.canvasHeight; + for (var i = 0; i < n; i++) { + var color = effectOption.color == 'random' ? zrColor.alpha(zrColor.random(), 0.3) : effectOption.color; + shapeList[i] = new CircleShape({ + highlightStyle: { + x: Math.ceil(Math.random() * canvasWidth), + y: Math.ceil(Math.random() * canvasHeight), + r: Math.ceil(Math.random() * 40), + brushType: brushType, + color: color, + strokeColor: color, + lineWidth: lineWidth + }, + animationY: Math.ceil(Math.random() * 20) + }); + } + return setInterval(function () { + addShapeHandle(background); + for (var i = 0; i < n; i++) { + var style = shapeList[i].highlightStyle; + if (style.y - shapeList[i].animationY + style.r <= 0) { + shapeList[i].highlightStyle.y = canvasHeight + style.r; + shapeList[i].highlightStyle.x = Math.ceil(Math.random() * canvasWidth); + } + shapeList[i].highlightStyle.y -= shapeList[i].animationY; + addShapeHandle(shapeList[i]); + } + addShapeHandle(textShape); + refreshHandle(); + }, effectOption.timeInterval); + }; + return Bubble; +});define('zrender/loadingEffect/DynamicLine', [ + 'require', + './Base', + '../tool/util', + '../tool/color', + '../shape/Line' +], function (require) { + var Base = require('./Base'); + var util = require('../tool/util'); + var zrColor = require('../tool/color'); + var LineShape = require('../shape/Line'); + function DynamicLine(options) { + Base.call(this, options); + } + util.inherits(DynamicLine, Base); + DynamicLine.prototype._start = function (addShapeHandle, refreshHandle) { + var options = util.merge(this.options, { + textStyle: { color: '#fff' }, + backgroundColor: 'rgba(0, 0, 0, 0.8)', + effectOption: { + n: 30, + lineWidth: 1, + color: 'random', + timeInterval: 100 + } + }); + var textShape = this.createTextShape(options.textStyle); + var background = this.createBackgroundShape(options.backgroundColor); + var effectOption = options.effectOption; + var n = effectOption.n; + var lineWidth = effectOption.lineWidth; + var shapeList = []; + var canvasWidth = this.canvasWidth; + var canvasHeight = this.canvasHeight; + for (var i = 0; i < n; i++) { + var xStart = -Math.ceil(Math.random() * 1000); + var len = Math.ceil(Math.random() * 400); + var pos = Math.ceil(Math.random() * canvasHeight); + var color = effectOption.color == 'random' ? zrColor.random() : effectOption.color; + shapeList[i] = new LineShape({ + highlightStyle: { + xStart: xStart, + yStart: pos, + xEnd: xStart + len, + yEnd: pos, + strokeColor: color, + lineWidth: lineWidth + }, + animationX: Math.ceil(Math.random() * 100), + len: len + }); + } + return setInterval(function () { + addShapeHandle(background); + for (var i = 0; i < n; i++) { + var style = shapeList[i].highlightStyle; + if (style.xStart >= canvasWidth) { + shapeList[i].len = Math.ceil(Math.random() * 400); + style.xStart = -400; + style.xEnd = -400 + shapeList[i].len; + style.yStart = Math.ceil(Math.random() * canvasHeight); + style.yEnd = style.yStart; + } + style.xStart += shapeList[i].animationX; + style.xEnd += shapeList[i].animationX; + addShapeHandle(shapeList[i]); + } + addShapeHandle(textShape); + refreshHandle(); + }, effectOption.timeInterval); + }; + return DynamicLine; +});define('zrender/loadingEffect/Ring', [ + 'require', + './Base', + '../tool/util', + '../tool/color', + '../shape/Ring', + '../shape/Sector' +], function (require) { + var Base = require('./Base'); + var util = require('../tool/util'); + var zrColor = require('../tool/color'); + var RingShape = require('../shape/Ring'); + var SectorShape = require('../shape/Sector'); + function Ring(options) { + Base.call(this, options); + } + util.inherits(Ring, Base); + Ring.prototype._start = function (addShapeHandle, refreshHandle) { + var options = util.merge(this.options, { + textStyle: { color: '#07a' }, + backgroundColor: 'rgba(250, 250, 250, 0.8)', + effect: { + x: this.canvasWidth / 2, + y: this.canvasHeight / 2, + r0: 60, + r: 100, + color: '#bbdcff', + brushType: 'fill', + textPosition: 'inside', + textFont: 'normal 30px verdana', + textColor: 'rgba(30, 144, 255, 0.6)', + timeInterval: 100 + } + }); + var effectOption = options.effect; + var textStyle = options.textStyle; + if (textStyle.x == null) { + textStyle.x = effectOption.x; + } + if (textStyle.y == null) { + textStyle.y = effectOption.y + (effectOption.r0 + effectOption.r) / 2 - 5; + } + var textShape = this.createTextShape(options.textStyle); + var background = this.createBackgroundShape(options.backgroundColor); + var x = effectOption.x; + var y = effectOption.y; + var r0 = effectOption.r0 + 6; + var r = effectOption.r - 6; + var color = effectOption.color; + var darkColor = zrColor.lift(color, 0.1); + var shapeRing = new RingShape({ highlightStyle: util.clone(effectOption) }); + var shapeList = []; + var clolrList = zrColor.getGradientColors([ + '#ff6400', + '#ffe100', + '#97ff00' + ], 25); + var preAngle = 15; + var endAngle = 240; + for (var i = 0; i < 16; i++) { + shapeList.push(new SectorShape({ + highlightStyle: { + x: x, + y: y, + r0: r0, + r: r, + startAngle: endAngle - preAngle, + endAngle: endAngle, + brushType: 'fill', + color: darkColor + }, + _color: zrColor.getLinearGradient(x + r0 * Math.cos(endAngle, true), y - r0 * Math.sin(endAngle, true), x + r0 * Math.cos(endAngle - preAngle, true), y - r0 * Math.sin(endAngle - preAngle, true), [ + [ + 0, + clolrList[i * 2] + ], + [ + 1, + clolrList[i * 2 + 1] + ] + ]) + })); + endAngle -= preAngle; + } + endAngle = 360; + for (var i = 0; i < 4; i++) { + shapeList.push(new SectorShape({ + highlightStyle: { + x: x, + y: y, + r0: r0, + r: r, + startAngle: endAngle - preAngle, + endAngle: endAngle, + brushType: 'fill', + color: darkColor + }, + _color: zrColor.getLinearGradient(x + r0 * Math.cos(endAngle, true), y - r0 * Math.sin(endAngle, true), x + r0 * Math.cos(endAngle - preAngle, true), y - r0 * Math.sin(endAngle - preAngle, true), [ + [ + 0, + clolrList[i * 2 + 32] + ], + [ + 1, + clolrList[i * 2 + 33] + ] + ]) + })); + endAngle -= preAngle; + } + var n = 0; + if (options.progress != null) { + addShapeHandle(background); + n = this.adjust(options.progress, [ + 0, + 1 + ]).toFixed(2) * 100 / 5; + shapeRing.highlightStyle.text = n * 5 + '%'; + addShapeHandle(shapeRing); + for (var i = 0; i < 20; i++) { + shapeList[i].highlightStyle.color = i < n ? shapeList[i]._color : darkColor; + addShapeHandle(shapeList[i]); + } + addShapeHandle(textShape); + refreshHandle(); + return; + } + return setInterval(function () { + addShapeHandle(background); + n += n >= 20 ? -20 : 1; + addShapeHandle(shapeRing); + for (var i = 0; i < 20; i++) { + shapeList[i].highlightStyle.color = i < n ? shapeList[i]._color : darkColor; + addShapeHandle(shapeList[i]); + } + addShapeHandle(textShape); + refreshHandle(); + }, effectOption.timeInterval); + }; + return Ring; +});define('zrender/loadingEffect/Spin', [ + 'require', + './Base', + '../tool/util', + '../tool/color', + '../tool/area', + '../shape/Sector' +], function (require) { + var Base = require('./Base'); + var util = require('../tool/util'); + var zrColor = require('../tool/color'); + var zrArea = require('../tool/area'); + var SectorShape = require('../shape/Sector'); + function Spin(options) { + Base.call(this, options); + } + util.inherits(Spin, Base); + Spin.prototype._start = function (addShapeHandle, refreshHandle) { + var options = util.merge(this.options, { + textStyle: { + color: '#fff', + textAlign: 'start' + }, + backgroundColor: 'rgba(0, 0, 0, 0.8)' + }); + var textShape = this.createTextShape(options.textStyle); + var textGap = 10; + var textWidth = zrArea.getTextWidth(textShape.highlightStyle.text, textShape.highlightStyle.textFont); + var textHeight = zrArea.getTextHeight(textShape.highlightStyle.text, textShape.highlightStyle.textFont); + var effectOption = util.merge(this.options.effect || {}, { + r0: 9, + r: 15, + n: 18, + color: '#fff', + timeInterval: 100 + }); + var location = this.getLocation(this.options.textStyle, textWidth + textGap + effectOption.r * 2, Math.max(effectOption.r * 2, textHeight)); + effectOption.x = location.x + effectOption.r; + effectOption.y = textShape.highlightStyle.y = location.y + location.height / 2; + textShape.highlightStyle.x = effectOption.x + effectOption.r + textGap; + var background = this.createBackgroundShape(options.backgroundColor); + var n = effectOption.n; + var x = effectOption.x; + var y = effectOption.y; + var r0 = effectOption.r0; + var r = effectOption.r; + var color = effectOption.color; + var shapeList = []; + var preAngle = Math.round(180 / n); + for (var i = 0; i < n; i++) { + shapeList[i] = new SectorShape({ + highlightStyle: { + x: x, + y: y, + r0: r0, + r: r, + startAngle: preAngle * i * 2, + endAngle: preAngle * i * 2 + preAngle, + color: zrColor.alpha(color, (i + 1) / n), + brushType: 'fill' + } + }); + } + var pos = [ + 0, + x, + y + ]; + return setInterval(function () { + addShapeHandle(background); + pos[0] -= 0.3; + for (var i = 0; i < n; i++) { + shapeList[i].rotation = pos; + addShapeHandle(shapeList[i]); + } + addShapeHandle(textShape); + refreshHandle(); + }, effectOption.timeInterval); + }; + return Spin; +});define('zrender/loadingEffect/Whirling', [ + 'require', + './Base', + '../tool/util', + '../tool/area', + '../shape/Ring', + '../shape/Droplet', + '../shape/Circle' +], function (require) { + var Base = require('./Base'); + var util = require('../tool/util'); + var zrArea = require('../tool/area'); + var RingShape = require('../shape/Ring'); + var DropletShape = require('../shape/Droplet'); + var CircleShape = require('../shape/Circle'); + function Whirling(options) { + Base.call(this, options); + } + util.inherits(Whirling, Base); + Whirling.prototype._start = function (addShapeHandle, refreshHandle) { + var options = util.merge(this.options, { + textStyle: { + color: '#888', + textAlign: 'start' + }, + backgroundColor: 'rgba(250, 250, 250, 0.8)' + }); + var textShape = this.createTextShape(options.textStyle); + var textGap = 10; + var textWidth = zrArea.getTextWidth(textShape.highlightStyle.text, textShape.highlightStyle.textFont); + var textHeight = zrArea.getTextHeight(textShape.highlightStyle.text, textShape.highlightStyle.textFont); + var effectOption = util.merge(this.options.effect || {}, { + r: 18, + colorIn: '#fff', + colorOut: '#555', + colorWhirl: '#6cf', + timeInterval: 50 + }); + var location = this.getLocation(this.options.textStyle, textWidth + textGap + effectOption.r * 2, Math.max(effectOption.r * 2, textHeight)); + effectOption.x = location.x + effectOption.r; + effectOption.y = textShape.highlightStyle.y = location.y + location.height / 2; + textShape.highlightStyle.x = effectOption.x + effectOption.r + textGap; + var background = this.createBackgroundShape(options.backgroundColor); + var droplet = new DropletShape({ + highlightStyle: { + a: Math.round(effectOption.r / 2), + b: Math.round(effectOption.r - effectOption.r / 6), + brushType: 'fill', + color: effectOption.colorWhirl + } + }); + var circleIn = new CircleShape({ + highlightStyle: { + r: Math.round(effectOption.r / 6), + brushType: 'fill', + color: effectOption.colorIn + } + }); + var circleOut = new RingShape({ + highlightStyle: { + r0: Math.round(effectOption.r - effectOption.r / 3), + r: effectOption.r, + brushType: 'fill', + color: effectOption.colorOut + } + }); + var pos = [ + 0, + effectOption.x, + effectOption.y + ]; + droplet.highlightStyle.x = circleIn.highlightStyle.x = circleOut.highlightStyle.x = pos[1]; + droplet.highlightStyle.y = circleIn.highlightStyle.y = circleOut.highlightStyle.y = pos[2]; + return setInterval(function () { + addShapeHandle(background); + addShapeHandle(circleOut); + pos[0] -= 0.3; + droplet.rotation = pos; + addShapeHandle(droplet); + addShapeHandle(circleIn); + addShapeHandle(textShape); + refreshHandle(); + }, effectOption.timeInterval); + }; + return Whirling; +});define('echarts/theme/macarons', [], function () { + var theme = { + color: [ + '#2ec7c9', + '#b6a2de', + '#5ab1ef', + '#ffb980', + '#d87a80', + '#8d98b3', + '#e5cf0d', + '#97b552', + '#95706d', + '#dc69aa', + '#07a2a4', + '#9a7fd1', + '#588dd5', + '#f5994e', + '#c05050', + '#59678c', + '#c9ab00', + '#7eb00a', + '#6f5553', + '#c14089' + ], + title: { + textStyle: { + fontWeight: 'normal', + color: '#008acd' + } + }, + dataRange: { + itemWidth: 15, + color: [ + '#5ab1ef', + '#e0ffff' + ] + }, + toolbox: { + color: [ + '#1e90ff', + '#1e90ff', + '#1e90ff', + '#1e90ff' + ], + effectiveColor: '#ff4500' + }, + tooltip: { + backgroundColor: 'rgba(50,50,50,0.5)', + axisPointer: { + type: 'line', + lineStyle: { color: '#008acd' }, + crossStyle: { color: '#008acd' }, + shadowStyle: { color: 'rgba(200,200,200,0.2)' } + } + }, + dataZoom: { + dataBackgroundColor: '#efefff', + fillerColor: 'rgba(182,162,222,0.2)', + handleColor: '#008acd' + }, + grid: { borderColor: '#eee' }, + categoryAxis: { + axisLine: { lineStyle: { color: '#008acd' } }, + splitLine: { lineStyle: { color: ['#eee'] } } + }, + valueAxis: { + axisLine: { lineStyle: { color: '#008acd' } }, + splitArea: { + show: true, + areaStyle: { + color: [ + 'rgba(250,250,250,0.1)', + 'rgba(200,200,200,0.1)' + ] + } + }, + splitLine: { lineStyle: { color: ['#eee'] } } + }, + polar: { + axisLine: { lineStyle: { color: '#ddd' } }, + splitArea: { + show: true, + areaStyle: { + color: [ + 'rgba(250,250,250,0.2)', + 'rgba(200,200,200,0.2)' + ] + } + }, + splitLine: { lineStyle: { color: '#ddd' } } + }, + timeline: { + lineStyle: { color: '#008acd' }, + controlStyle: { + normal: { color: '#008acd' }, + emphasis: { color: '#008acd' } + }, + symbol: 'emptyCircle', + symbolSize: 3 + }, + bar: { + itemStyle: { + normal: { barBorderRadius: 5 }, + emphasis: { barBorderRadius: 5 } + } + }, + line: { + smooth: true, + symbol: 'emptyCircle', + symbolSize: 3 + }, + k: { + itemStyle: { + normal: { + color: '#d87a80', + color0: '#2ec7c9', + lineStyle: { + color: '#d87a80', + color0: '#2ec7c9' + } + } + } + }, + scatter: { + symbol: 'circle', + symbolSize: 4 + }, + radar: { + symbol: 'emptyCircle', + symbolSize: 3 + }, + map: { + itemStyle: { + normal: { + areaStyle: { color: '#ddd' }, + label: { textStyle: { color: '#d87a80' } } + }, + emphasis: { areaStyle: { color: '#fe994e' } } + } + }, + force: { itemStyle: { normal: { linkStyle: { color: '#1e90ff' } } } }, + chord: { + itemStyle: { + normal: { + borderWidth: 1, + borderColor: 'rgba(128, 128, 128, 0.5)', + chordStyle: { lineStyle: { color: 'rgba(128, 128, 128, 0.5)' } } + }, + emphasis: { + borderWidth: 1, + borderColor: 'rgba(128, 128, 128, 0.5)', + chordStyle: { lineStyle: { color: 'rgba(128, 128, 128, 0.5)' } } + } + } + }, + gauge: { + axisLine: { + lineStyle: { + color: [ + [ + 0.2, + '#2ec7c9' + ], + [ + 0.8, + '#5ab1ef' + ], + [ + 1, + '#d87a80' + ] + ], + width: 10 + } + }, + axisTick: { + splitNumber: 10, + length: 15, + lineStyle: { color: 'auto' } + }, + splitLine: { + length: 22, + lineStyle: { color: 'auto' } + }, + pointer: { width: 5 } + }, + textStyle: { fontFamily: '微软雅黑, Arial, Verdana, sans-serif' } + }; + return theme; +});define('echarts/theme/infographic', [], function () { + var theme = { + color: [ + '#C1232B', + '#B5C334', + '#FCCE10', + '#E87C25', + '#27727B', + '#FE8463', + '#9BCA63', + '#FAD860', + '#F3A43B', + '#60C0DD', + '#D7504B', + '#C6E579', + '#F4E001', + '#F0805A', + '#26C0C0' + ], + title: { + textStyle: { + fontWeight: 'normal', + color: '#27727B' + } + }, + dataRange: { + x: 'right', + y: 'center', + itemWidth: 5, + itemHeight: 25, + color: [ + '#C1232B', + '#FCCE10' + ] + }, + toolbox: { + color: [ + '#C1232B', + '#B5C334', + '#FCCE10', + '#E87C25', + '#27727B', + '#FE8463', + '#9BCA63', + '#FAD860', + '#F3A43B', + '#60C0DD' + ], + effectiveColor: '#ff4500' + }, + tooltip: { + backgroundColor: 'rgba(50,50,50,0.5)', + axisPointer: { + type: 'line', + lineStyle: { + color: '#27727B', + type: 'dashed' + }, + crossStyle: { color: '#27727B' }, + shadowStyle: { color: 'rgba(200,200,200,0.3)' } + } + }, + dataZoom: { + dataBackgroundColor: 'rgba(181,195,52,0.3)', + fillerColor: 'rgba(181,195,52,0.2)', + handleColor: '#27727B' + }, + grid: { borderWidth: 0 }, + categoryAxis: { + axisLine: { lineStyle: { color: '#27727B' } }, + splitLine: { show: false } + }, + valueAxis: { + axisLine: { show: false }, + splitArea: { show: false }, + splitLine: { + lineStyle: { + color: ['#ccc'], + type: 'dashed' + } + } + }, + polar: { + axisLine: { lineStyle: { color: '#ddd' } }, + splitArea: { + show: true, + areaStyle: { + color: [ + 'rgba(250,250,250,0.2)', + 'rgba(200,200,200,0.2)' + ] + } + }, + splitLine: { lineStyle: { color: '#ddd' } } + }, + timeline: { + lineStyle: { color: '#27727B' }, + controlStyle: { + normal: { color: '#27727B' }, + emphasis: { color: '#27727B' } + }, + symbol: 'emptyCircle', + symbolSize: 3 + }, + line: { + itemStyle: { + normal: { + borderWidth: 2, + borderColor: '#fff', + lineStyle: { width: 3 } + }, + emphasis: { borderWidth: 0 } + }, + symbol: 'circle', + symbolSize: 3.5 + }, + k: { + itemStyle: { + normal: { + color: '#C1232B', + color0: '#B5C334', + lineStyle: { + width: 1, + color: '#C1232B', + color0: '#B5C334' + } + } + } + }, + scatter: { + itemdStyle: { + normal: { + borderWidth: 1, + borderColor: 'rgba(200,200,200,0.5)' + }, + emphasis: { borderWidth: 0 } + }, + symbol: 'star4', + symbolSize: 4 + }, + radar: { + symbol: 'emptyCircle', + symbolSize: 3 + }, + map: { + itemStyle: { + normal: { + areaStyle: { color: '#ddd' }, + label: { textStyle: { color: '#C1232B' } } + }, + emphasis: { + areaStyle: { color: '#fe994e' }, + label: { textStyle: { color: 'rgb(100,0,0)' } } + } + } + }, + force: { itemStyle: { normal: { linkStyle: { color: '#27727B' } } } }, + chord: { + itemStyle: { + normal: { + borderWidth: 1, + borderColor: 'rgba(128, 128, 128, 0.5)', + chordStyle: { lineStyle: { color: 'rgba(128, 128, 128, 0.5)' } } + }, + emphasis: { + borderWidth: 1, + borderColor: 'rgba(128, 128, 128, 0.5)', + chordStyle: { lineStyle: { color: 'rgba(128, 128, 128, 0.5)' } } + } + } + }, + gauge: { + center: [ + '50%', + '80%' + ], + radius: '100%', + startAngle: 180, + endAngle: 0, + axisLine: { + show: true, + lineStyle: { + color: [ + [ + 0.2, + '#B5C334' + ], + [ + 0.8, + '#27727B' + ], + [ + 1, + '#C1232B' + ] + ], + width: '40%' + } + }, + axisTick: { + splitNumber: 2, + length: 5, + lineStyle: { color: '#fff' } + }, + axisLabel: { + textStyle: { + color: '#fff', + fontWeight: 'bolder' + } + }, + splitLine: { + length: '5%', + lineStyle: { color: '#fff' } + }, + pointer: { + width: '40%', + length: '80%', + color: '#fff' + }, + title: { + offsetCenter: [ + 0, + -20 + ], + textStyle: { + color: 'auto', + fontSize: 20 + } + }, + detail: { + offsetCenter: [ + 0, + 0 + ], + textStyle: { + color: 'auto', + fontSize: 40 + } + } + }, + textStyle: { fontFamily: '微软雅黑, Arial, Verdana, sans-serif' } + }; + return theme; +});define('zrender/dep/excanvas', ['require'], function (require) { + if (!document.createElement('canvas').getContext) { + (function () { + var m = Math; + var mr = m.round; + var ms = m.sin; + var mc = m.cos; + var abs = m.abs; + var sqrt = m.sqrt; + var Z = 10; + var Z2 = Z / 2; + var IE_VERSION = +navigator.userAgent.match(/MSIE ([\d.]+)?/)[1]; + function getContext() { + return this.context_ || (this.context_ = new CanvasRenderingContext2D_(this)); + } + var slice = Array.prototype.slice; + function bind(f, obj, var_args) { + var a = slice.call(arguments, 2); + return function () { + return f.apply(obj, a.concat(slice.call(arguments))); + }; + } + function encodeHtmlAttribute(s) { + return String(s).replace(/&/g, '&').replace(/"/g, '"'); + } + function addNamespace(doc, prefix, urn) { + if (!doc.namespaces[prefix]) { + doc.namespaces.add(prefix, urn, '#default#VML'); + } + } + function addNamespacesAndStylesheet(doc) { + addNamespace(doc, 'g_vml_', 'urn:schemas-microsoft-com:vml'); + addNamespace(doc, 'g_o_', 'urn:schemas-microsoft-com:office:office'); + if (!doc.styleSheets['ex_canvas_']) { + var ss = doc.createStyleSheet(); + ss.owningElement.id = 'ex_canvas_'; + ss.cssText = 'canvas{display:inline-block;overflow:hidden;' + 'text-align:left;width:300px;height:150px}'; + } + } + addNamespacesAndStylesheet(document); + var G_vmlCanvasManager_ = { + init: function (opt_doc) { + var doc = opt_doc || document; + doc.createElement('canvas'); + doc.attachEvent('onreadystatechange', bind(this.init_, this, doc)); + }, + init_: function (doc) { + var els = doc.getElementsByTagName('canvas'); + for (var i = 0; i < els.length; i++) { + this.initElement(els[i]); + } + }, + initElement: function (el) { + if (!el.getContext) { + el.getContext = getContext; + addNamespacesAndStylesheet(el.ownerDocument); + el.innerHTML = ''; + el.attachEvent('onpropertychange', onPropertyChange); + el.attachEvent('onresize', onResize); + var attrs = el.attributes; + if (attrs.width && attrs.width.specified) { + el.style.width = attrs.width.nodeValue + 'px'; + } else { + el.width = el.clientWidth; + } + if (attrs.height && attrs.height.specified) { + el.style.height = attrs.height.nodeValue + 'px'; + } else { + el.height = el.clientHeight; + } + } + return el; + } + }; + function onPropertyChange(e) { + var el = e.srcElement; + switch (e.propertyName) { + case 'width': + el.getContext().clearRect(); + el.style.width = el.attributes.width.nodeValue + 'px'; + el.firstChild.style.width = el.clientWidth + 'px'; + break; + case 'height': + el.getContext().clearRect(); + el.style.height = el.attributes.height.nodeValue + 'px'; + el.firstChild.style.height = el.clientHeight + 'px'; + break; + } + } + function onResize(e) { + var el = e.srcElement; + if (el.firstChild) { + el.firstChild.style.width = el.clientWidth + 'px'; + el.firstChild.style.height = el.clientHeight + 'px'; + } + } + G_vmlCanvasManager_.init(); + var decToHex = []; + for (var i = 0; i < 16; i++) { + for (var j = 0; j < 16; j++) { + decToHex[i * 16 + j] = i.toString(16) + j.toString(16); + } + } + function createMatrixIdentity() { + return [ + [ + 1, + 0, + 0 + ], + [ + 0, + 1, + 0 + ], + [ + 0, + 0, + 1 + ] + ]; + } + function matrixMultiply(m1, m2) { + var result = createMatrixIdentity(); + for (var x = 0; x < 3; x++) { + for (var y = 0; y < 3; y++) { + var sum = 0; + for (var z = 0; z < 3; z++) { + sum += m1[x][z] * m2[z][y]; + } + result[x][y] = sum; + } + } + return result; + } + function copyState(o1, o2) { + o2.fillStyle = o1.fillStyle; + o2.lineCap = o1.lineCap; + o2.lineJoin = o1.lineJoin; + o2.lineWidth = o1.lineWidth; + o2.miterLimit = o1.miterLimit; + o2.shadowBlur = o1.shadowBlur; + o2.shadowColor = o1.shadowColor; + o2.shadowOffsetX = o1.shadowOffsetX; + o2.shadowOffsetY = o1.shadowOffsetY; + o2.strokeStyle = o1.strokeStyle; + o2.globalAlpha = o1.globalAlpha; + o2.font = o1.font; + o2.textAlign = o1.textAlign; + o2.textBaseline = o1.textBaseline; + o2.scaleX_ = o1.scaleX_; + o2.scaleY_ = o1.scaleY_; + o2.lineScale_ = o1.lineScale_; + } + var colorData = { + aliceblue: '#F0F8FF', + antiquewhite: '#FAEBD7', + aquamarine: '#7FFFD4', + azure: '#F0FFFF', + beige: '#F5F5DC', + bisque: '#FFE4C4', + black: '#000000', + blanchedalmond: '#FFEBCD', + blueviolet: '#8A2BE2', + brown: '#A52A2A', + burlywood: '#DEB887', + cadetblue: '#5F9EA0', + chartreuse: '#7FFF00', + chocolate: '#D2691E', + coral: '#FF7F50', + cornflowerblue: '#6495ED', + cornsilk: '#FFF8DC', + crimson: '#DC143C', + cyan: '#00FFFF', + darkblue: '#00008B', + darkcyan: '#008B8B', + darkgoldenrod: '#B8860B', + darkgray: '#A9A9A9', + darkgreen: '#006400', + darkgrey: '#A9A9A9', + darkkhaki: '#BDB76B', + darkmagenta: '#8B008B', + darkolivegreen: '#556B2F', + darkorange: '#FF8C00', + darkorchid: '#9932CC', + darkred: '#8B0000', + darksalmon: '#E9967A', + darkseagreen: '#8FBC8F', + darkslateblue: '#483D8B', + darkslategray: '#2F4F4F', + darkslategrey: '#2F4F4F', + darkturquoise: '#00CED1', + darkviolet: '#9400D3', + deeppink: '#FF1493', + deepskyblue: '#00BFFF', + dimgray: '#696969', + dimgrey: '#696969', + dodgerblue: '#1E90FF', + firebrick: '#B22222', + floralwhite: '#FFFAF0', + forestgreen: '#228B22', + gainsboro: '#DCDCDC', + ghostwhite: '#F8F8FF', + gold: '#FFD700', + goldenrod: '#DAA520', + grey: '#808080', + greenyellow: '#ADFF2F', + honeydew: '#F0FFF0', + hotpink: '#FF69B4', + indianred: '#CD5C5C', + indigo: '#4B0082', + ivory: '#FFFFF0', + khaki: '#F0E68C', + lavender: '#E6E6FA', + lavenderblush: '#FFF0F5', + lawngreen: '#7CFC00', + lemonchiffon: '#FFFACD', + lightblue: '#ADD8E6', + lightcoral: '#F08080', + lightcyan: '#E0FFFF', + lightgoldenrodyellow: '#FAFAD2', + lightgreen: '#90EE90', + lightgrey: '#D3D3D3', + lightpink: '#FFB6C1', + lightsalmon: '#FFA07A', + lightseagreen: '#20B2AA', + lightskyblue: '#87CEFA', + lightslategray: '#778899', + lightslategrey: '#778899', + lightsteelblue: '#B0C4DE', + lightyellow: '#FFFFE0', + limegreen: '#32CD32', + linen: '#FAF0E6', + magenta: '#FF00FF', + mediumaquamarine: '#66CDAA', + mediumblue: '#0000CD', + mediumorchid: '#BA55D3', + mediumpurple: '#9370DB', + mediumseagreen: '#3CB371', + mediumslateblue: '#7B68EE', + mediumspringgreen: '#00FA9A', + mediumturquoise: '#48D1CC', + mediumvioletred: '#C71585', + midnightblue: '#191970', + mintcream: '#F5FFFA', + mistyrose: '#FFE4E1', + moccasin: '#FFE4B5', + navajowhite: '#FFDEAD', + oldlace: '#FDF5E6', + olivedrab: '#6B8E23', + orange: '#FFA500', + orangered: '#FF4500', + orchid: '#DA70D6', + palegoldenrod: '#EEE8AA', + palegreen: '#98FB98', + paleturquoise: '#AFEEEE', + palevioletred: '#DB7093', + papayawhip: '#FFEFD5', + peachpuff: '#FFDAB9', + peru: '#CD853F', + pink: '#FFC0CB', + plum: '#DDA0DD', + powderblue: '#B0E0E6', + rosybrown: '#BC8F8F', + royalblue: '#4169E1', + saddlebrown: '#8B4513', + salmon: '#FA8072', + sandybrown: '#F4A460', + seagreen: '#2E8B57', + seashell: '#FFF5EE', + sienna: '#A0522D', + skyblue: '#87CEEB', + slateblue: '#6A5ACD', + slategray: '#708090', + slategrey: '#708090', + snow: '#FFFAFA', + springgreen: '#00FF7F', + steelblue: '#4682B4', + tan: '#D2B48C', + thistle: '#D8BFD8', + tomato: '#FF6347', + turquoise: '#40E0D0', + violet: '#EE82EE', + wheat: '#F5DEB3', + whitesmoke: '#F5F5F5', + yellowgreen: '#9ACD32' + }; + function getRgbHslContent(styleString) { + var start = styleString.indexOf('(', 3); + var end = styleString.indexOf(')', start + 1); + var parts = styleString.substring(start + 1, end).split(','); + if (parts.length != 4 || styleString.charAt(3) != 'a') { + parts[3] = 1; + } + return parts; + } + function percent(s) { + return parseFloat(s) / 100; + } + function clamp(v, min, max) { + return Math.min(max, Math.max(min, v)); + } + function hslToRgb(parts) { + var r, g, b, h, s, l; + h = parseFloat(parts[0]) / 360 % 360; + if (h < 0) + h++; + s = clamp(percent(parts[1]), 0, 1); + l = clamp(percent(parts[2]), 0, 1); + if (s == 0) { + r = g = b = l; + } else { + var q = l < 0.5 ? l * (1 + s) : l + s - l * s; + var p = 2 * l - q; + r = hueToRgb(p, q, h + 1 / 3); + g = hueToRgb(p, q, h); + b = hueToRgb(p, q, h - 1 / 3); + } + return '#' + decToHex[Math.floor(r * 255)] + decToHex[Math.floor(g * 255)] + decToHex[Math.floor(b * 255)]; + } + function hueToRgb(m1, m2, h) { + if (h < 0) + h++; + if (h > 1) + h--; + if (6 * h < 1) + return m1 + (m2 - m1) * 6 * h; + else if (2 * h < 1) + return m2; + else if (3 * h < 2) + return m1 + (m2 - m1) * (2 / 3 - h) * 6; + else + return m1; + } + var processStyleCache = {}; + function processStyle(styleString) { + if (styleString in processStyleCache) { + return processStyleCache[styleString]; + } + var str, alpha = 1; + styleString = String(styleString); + if (styleString.charAt(0) == '#') { + str = styleString; + } else if (/^rgb/.test(styleString)) { + var parts = getRgbHslContent(styleString); + var str = '#', n; + for (var i = 0; i < 3; i++) { + if (parts[i].indexOf('%') != -1) { + n = Math.floor(percent(parts[i]) * 255); + } else { + n = +parts[i]; + } + str += decToHex[clamp(n, 0, 255)]; + } + alpha = +parts[3]; + } else if (/^hsl/.test(styleString)) { + var parts = getRgbHslContent(styleString); + str = hslToRgb(parts); + alpha = parts[3]; + } else { + str = colorData[styleString] || styleString; + } + return processStyleCache[styleString] = { + color: str, + alpha: alpha + }; + } + var DEFAULT_STYLE = { + style: 'normal', + variant: 'normal', + weight: 'normal', + size: 12, + family: '微软雅黑' + }; + var fontStyleCache = {}; + function processFontStyle(styleString) { + if (fontStyleCache[styleString]) { + return fontStyleCache[styleString]; + } + var el = document.createElement('div'); + var style = el.style; + var fontFamily; + try { + style.font = styleString; + fontFamily = style.fontFamily.split(',')[0]; + } catch (ex) { + } + return fontStyleCache[styleString] = { + style: style.fontStyle || DEFAULT_STYLE.style, + variant: style.fontVariant || DEFAULT_STYLE.variant, + weight: style.fontWeight || DEFAULT_STYLE.weight, + size: style.fontSize || DEFAULT_STYLE.size, + family: fontFamily || DEFAULT_STYLE.family + }; + } + function getComputedStyle(style, element) { + var computedStyle = {}; + for (var p in style) { + computedStyle[p] = style[p]; + } + var canvasFontSize = parseFloat(element.currentStyle.fontSize), fontSize = parseFloat(style.size); + if (typeof style.size == 'number') { + computedStyle.size = style.size; + } else if (style.size.indexOf('px') != -1) { + computedStyle.size = fontSize; + } else if (style.size.indexOf('em') != -1) { + computedStyle.size = canvasFontSize * fontSize; + } else if (style.size.indexOf('%') != -1) { + computedStyle.size = canvasFontSize / 100 * fontSize; + } else if (style.size.indexOf('pt') != -1) { + computedStyle.size = fontSize / 0.75; + } else { + computedStyle.size = canvasFontSize; + } + return computedStyle; + } + function buildStyle(style) { + return style.style + ' ' + style.variant + ' ' + style.weight + ' ' + style.size + 'px \'' + style.family + '\''; + } + var lineCapMap = { + 'butt': 'flat', + 'round': 'round' + }; + function processLineCap(lineCap) { + return lineCapMap[lineCap] || 'square'; + } + function CanvasRenderingContext2D_(canvasElement) { + this.m_ = createMatrixIdentity(); + this.mStack_ = []; + this.aStack_ = []; + this.currentPath_ = []; + this.strokeStyle = '#000'; + this.fillStyle = '#000'; + this.lineWidth = 1; + this.lineJoin = 'miter'; + this.lineCap = 'butt'; + this.miterLimit = Z * 1; + this.globalAlpha = 1; + this.font = '12px 微软雅黑'; + this.textAlign = 'left'; + this.textBaseline = 'alphabetic'; + this.canvas = canvasElement; + var cssText = 'width:' + canvasElement.clientWidth + 'px;height:' + canvasElement.clientHeight + 'px;overflow:hidden;position:absolute'; + var el = canvasElement.ownerDocument.createElement('div'); + el.style.cssText = cssText; + canvasElement.appendChild(el); + var overlayEl = el.cloneNode(false); + overlayEl.style.backgroundColor = '#fff'; + overlayEl.style.filter = 'alpha(opacity=0)'; + canvasElement.appendChild(overlayEl); + this.element_ = el; + this.scaleX_ = 1; + this.scaleY_ = 1; + this.lineScale_ = 1; + } + var contextPrototype = CanvasRenderingContext2D_.prototype; + contextPrototype.clearRect = function () { + if (this.textMeasureEl_) { + this.textMeasureEl_.removeNode(true); + this.textMeasureEl_ = null; + } + this.element_.innerHTML = ''; + }; + contextPrototype.beginPath = function () { + this.currentPath_ = []; + }; + contextPrototype.moveTo = function (aX, aY) { + var p = getCoords(this, aX, aY); + this.currentPath_.push({ + type: 'moveTo', + x: p.x, + y: p.y + }); + this.currentX_ = p.x; + this.currentY_ = p.y; + }; + contextPrototype.lineTo = function (aX, aY) { + var p = getCoords(this, aX, aY); + this.currentPath_.push({ + type: 'lineTo', + x: p.x, + y: p.y + }); + this.currentX_ = p.x; + this.currentY_ = p.y; + }; + contextPrototype.bezierCurveTo = function (aCP1x, aCP1y, aCP2x, aCP2y, aX, aY) { + var p = getCoords(this, aX, aY); + var cp1 = getCoords(this, aCP1x, aCP1y); + var cp2 = getCoords(this, aCP2x, aCP2y); + bezierCurveTo(this, cp1, cp2, p); + }; + function bezierCurveTo(self, cp1, cp2, p) { + self.currentPath_.push({ + type: 'bezierCurveTo', + cp1x: cp1.x, + cp1y: cp1.y, + cp2x: cp2.x, + cp2y: cp2.y, + x: p.x, + y: p.y + }); + self.currentX_ = p.x; + self.currentY_ = p.y; + } + contextPrototype.quadraticCurveTo = function (aCPx, aCPy, aX, aY) { + var cp = getCoords(this, aCPx, aCPy); + var p = getCoords(this, aX, aY); + var cp1 = { + x: this.currentX_ + 2 / 3 * (cp.x - this.currentX_), + y: this.currentY_ + 2 / 3 * (cp.y - this.currentY_) + }; + var cp2 = { + x: cp1.x + (p.x - this.currentX_) / 3, + y: cp1.y + (p.y - this.currentY_) / 3 + }; + bezierCurveTo(this, cp1, cp2, p); + }; + contextPrototype.arc = function (aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise) { + aRadius *= Z; + var arcType = aClockwise ? 'at' : 'wa'; + var xStart = aX + mc(aStartAngle) * aRadius - Z2; + var yStart = aY + ms(aStartAngle) * aRadius - Z2; + var xEnd = aX + mc(aEndAngle) * aRadius - Z2; + var yEnd = aY + ms(aEndAngle) * aRadius - Z2; + if (xStart == xEnd && !aClockwise) { + xStart += 0.125; + } + var p = getCoords(this, aX, aY); + var pStart = getCoords(this, xStart, yStart); + var pEnd = getCoords(this, xEnd, yEnd); + this.currentPath_.push({ + type: arcType, + x: p.x, + y: p.y, + radius: aRadius, + xStart: pStart.x, + yStart: pStart.y, + xEnd: pEnd.x, + yEnd: pEnd.y + }); + }; + contextPrototype.rect = function (aX, aY, aWidth, aHeight) { + this.moveTo(aX, aY); + this.lineTo(aX + aWidth, aY); + this.lineTo(aX + aWidth, aY + aHeight); + this.lineTo(aX, aY + aHeight); + this.closePath(); + }; + contextPrototype.strokeRect = function (aX, aY, aWidth, aHeight) { + var oldPath = this.currentPath_; + this.beginPath(); + this.moveTo(aX, aY); + this.lineTo(aX + aWidth, aY); + this.lineTo(aX + aWidth, aY + aHeight); + this.lineTo(aX, aY + aHeight); + this.closePath(); + this.stroke(); + this.currentPath_ = oldPath; + }; + contextPrototype.fillRect = function (aX, aY, aWidth, aHeight) { + var oldPath = this.currentPath_; + this.beginPath(); + this.moveTo(aX, aY); + this.lineTo(aX + aWidth, aY); + this.lineTo(aX + aWidth, aY + aHeight); + this.lineTo(aX, aY + aHeight); + this.closePath(); + this.fill(); + this.currentPath_ = oldPath; + }; + contextPrototype.createLinearGradient = function (aX0, aY0, aX1, aY1) { + var gradient = new CanvasGradient_('gradient'); + gradient.x0_ = aX0; + gradient.y0_ = aY0; + gradient.x1_ = aX1; + gradient.y1_ = aY1; + return gradient; + }; + contextPrototype.createRadialGradient = function (aX0, aY0, aR0, aX1, aY1, aR1) { + var gradient = new CanvasGradient_('gradientradial'); + gradient.x0_ = aX0; + gradient.y0_ = aY0; + gradient.r0_ = aR0; + gradient.x1_ = aX1; + gradient.y1_ = aY1; + gradient.r1_ = aR1; + return gradient; + }; + contextPrototype.drawImage = function (image, var_args) { + var dx, dy, dw, dh, sx, sy, sw, sh; + var oldRuntimeWidth = image.runtimeStyle.width; + var oldRuntimeHeight = image.runtimeStyle.height; + image.runtimeStyle.width = 'auto'; + image.runtimeStyle.height = 'auto'; + var w = image.width; + var h = image.height; + image.runtimeStyle.width = oldRuntimeWidth; + image.runtimeStyle.height = oldRuntimeHeight; + if (arguments.length == 3) { + dx = arguments[1]; + dy = arguments[2]; + sx = sy = 0; + sw = dw = w; + sh = dh = h; + } else if (arguments.length == 5) { + dx = arguments[1]; + dy = arguments[2]; + dw = arguments[3]; + dh = arguments[4]; + sx = sy = 0; + sw = w; + sh = h; + } else if (arguments.length == 9) { + sx = arguments[1]; + sy = arguments[2]; + sw = arguments[3]; + sh = arguments[4]; + dx = arguments[5]; + dy = arguments[6]; + dw = arguments[7]; + dh = arguments[8]; + } else { + throw Error('Invalid number of arguments'); + } + var d = getCoords(this, dx, dy); + var w2 = sw / 2; + var h2 = sh / 2; + var vmlStr = []; + var W = 10; + var H = 10; + var scaleX = scaleY = 1; + vmlStr.push(' '); + if (sx || sy) { + vmlStr.push('
'); + } + vmlStr.push('
'); + if (sx || sy) + vmlStr.push('
'); + vmlStr.push('
'); + this.element_.insertAdjacentHTML('BeforeEnd', vmlStr.join('')); + }; + contextPrototype.stroke = function (aFill) { + var lineStr = []; + var lineOpen = false; + var W = 10; + var H = 10; + lineStr.push(''); + if (!aFill) { + appendStroke(this, lineStr); + } else { + appendFill(this, lineStr, min, max); + } + lineStr.push(''); + this.element_.insertAdjacentHTML('beforeEnd', lineStr.join('')); + }; + function appendStroke(ctx, lineStr) { + var a = processStyle(ctx.strokeStyle); + var color = a.color; + var opacity = a.alpha * ctx.globalAlpha; + var lineWidth = ctx.lineScale_ * ctx.lineWidth; + if (lineWidth < 1) { + opacity *= lineWidth; + } + lineStr.push(''); + } + function appendFill(ctx, lineStr, min, max) { + var fillStyle = ctx.fillStyle; + var arcScaleX = ctx.scaleX_; + var arcScaleY = ctx.scaleY_; + var width = max.x - min.x; + var height = max.y - min.y; + if (fillStyle instanceof CanvasGradient_) { + var angle = 0; + var focus = { + x: 0, + y: 0 + }; + var shift = 0; + var expansion = 1; + if (fillStyle.type_ == 'gradient') { + var x0 = fillStyle.x0_ / arcScaleX; + var y0 = fillStyle.y0_ / arcScaleY; + var x1 = fillStyle.x1_ / arcScaleX; + var y1 = fillStyle.y1_ / arcScaleY; + var p0 = getCoords(ctx, x0, y0); + var p1 = getCoords(ctx, x1, y1); + var dx = p1.x - p0.x; + var dy = p1.y - p0.y; + angle = Math.atan2(dx, dy) * 180 / Math.PI; + if (angle < 0) { + angle += 360; + } + if (angle < 0.000001) { + angle = 0; + } + } else { + var p0 = getCoords(ctx, fillStyle.x0_, fillStyle.y0_); + focus = { + x: (p0.x - min.x) / width, + y: (p0.y - min.y) / height + }; + width /= arcScaleX * Z; + height /= arcScaleY * Z; + var dimension = m.max(width, height); + shift = 2 * fillStyle.r0_ / dimension; + expansion = 2 * fillStyle.r1_ / dimension - shift; + } + var stops = fillStyle.colors_; + stops.sort(function (cs1, cs2) { + return cs1.offset - cs2.offset; + }); + var length = stops.length; + var color1 = stops[0].color; + var color2 = stops[length - 1].color; + var opacity1 = stops[0].alpha * ctx.globalAlpha; + var opacity2 = stops[length - 1].alpha * ctx.globalAlpha; + var colors = []; + for (var i = 0; i < length; i++) { + var stop = stops[i]; + colors.push(stop.offset * expansion + shift + ' ' + stop.color); + } + lineStr.push(''); + } else if (fillStyle instanceof CanvasPattern_) { + if (width && height) { + var deltaLeft = -min.x; + var deltaTop = -min.y; + lineStr.push(''); + } + } else { + var a = processStyle(ctx.fillStyle); + var color = a.color; + var opacity = a.alpha * ctx.globalAlpha; + lineStr.push(''); + } + } + contextPrototype.fill = function () { + this.stroke(true); + }; + contextPrototype.closePath = function () { + this.currentPath_.push({ type: 'close' }); + }; + function getCoords(ctx, aX, aY) { + var m = ctx.m_; + return { + x: Z * (aX * m[0][0] + aY * m[1][0] + m[2][0]) - Z2, + y: Z * (aX * m[0][1] + aY * m[1][1] + m[2][1]) - Z2 + }; + } + ; + contextPrototype.save = function () { + var o = {}; + copyState(this, o); + this.aStack_.push(o); + this.mStack_.push(this.m_); + this.m_ = matrixMultiply(createMatrixIdentity(), this.m_); + }; + contextPrototype.restore = function () { + if (this.aStack_.length) { + copyState(this.aStack_.pop(), this); + this.m_ = this.mStack_.pop(); + } + }; + function matrixIsFinite(m) { + return isFinite(m[0][0]) && isFinite(m[0][1]) && isFinite(m[1][0]) && isFinite(m[1][1]) && isFinite(m[2][0]) && isFinite(m[2][1]); + } + function setM(ctx, m, updateLineScale) { + if (!matrixIsFinite(m)) { + return; + } + ctx.m_ = m; + ctx.scaleX_ = Math.sqrt(m[0][0] * m[0][0] + m[0][1] * m[0][1]); + ctx.scaleY_ = Math.sqrt(m[1][0] * m[1][0] + m[1][1] * m[1][1]); + if (updateLineScale) { + var det = m[0][0] * m[1][1] - m[0][1] * m[1][0]; + ctx.lineScale_ = sqrt(abs(det)); + } + } + contextPrototype.translate = function (aX, aY) { + var m1 = [ + [ + 1, + 0, + 0 + ], + [ + 0, + 1, + 0 + ], + [ + aX, + aY, + 1 + ] + ]; + setM(this, matrixMultiply(m1, this.m_), false); + }; + contextPrototype.rotate = function (aRot) { + var c = mc(aRot); + var s = ms(aRot); + var m1 = [ + [ + c, + s, + 0 + ], + [ + -s, + c, + 0 + ], + [ + 0, + 0, + 1 + ] + ]; + setM(this, matrixMultiply(m1, this.m_), false); + }; + contextPrototype.scale = function (aX, aY) { + var m1 = [ + [ + aX, + 0, + 0 + ], + [ + 0, + aY, + 0 + ], + [ + 0, + 0, + 1 + ] + ]; + setM(this, matrixMultiply(m1, this.m_), true); + }; + contextPrototype.transform = function (m11, m12, m21, m22, dx, dy) { + var m1 = [ + [ + m11, + m12, + 0 + ], + [ + m21, + m22, + 0 + ], + [ + dx, + dy, + 1 + ] + ]; + setM(this, matrixMultiply(m1, this.m_), true); + }; + contextPrototype.setTransform = function (m11, m12, m21, m22, dx, dy) { + var m = [ + [ + m11, + m12, + 0 + ], + [ + m21, + m22, + 0 + ], + [ + dx, + dy, + 1 + ] + ]; + setM(this, m, true); + }; + contextPrototype.drawText_ = function (text, x, y, maxWidth, stroke) { + var m = this.m_, delta = 1000, left = 0, right = delta, offset = { + x: 0, + y: 0 + }, lineStr = []; + var fontStyle = getComputedStyle(processFontStyle(this.font), this.element_); + var fontStyleString = buildStyle(fontStyle); + var elementStyle = this.element_.currentStyle; + var textAlign = this.textAlign.toLowerCase(); + switch (textAlign) { + case 'left': + case 'center': + case 'right': + break; + case 'end': + textAlign = elementStyle.direction == 'ltr' ? 'right' : 'left'; + break; + case 'start': + textAlign = elementStyle.direction == 'rtl' ? 'right' : 'left'; + break; + default: + textAlign = 'left'; + } + switch (this.textBaseline) { + case 'hanging': + case 'top': + offset.y = fontStyle.size / 1.75; + break; + case 'middle': + break; + default: + case null: + case 'alphabetic': + case 'ideographic': + case 'bottom': + offset.y = -fontStyle.size / 2.25; + break; + } + switch (textAlign) { + case 'right': + left = delta; + right = 0.05; + break; + case 'center': + left = right = delta / 2; + break; + } + var d = getCoords(this, x + offset.x, y + offset.y); + lineStr.push(''); + if (stroke) { + appendStroke(this, lineStr); + } else { + appendFill(this, lineStr, { + x: -left, + y: 0 + }, { + x: right, + y: fontStyle.size + }); + } + var skewM = m[0][0].toFixed(3) + ',' + m[1][0].toFixed(3) + ',' + m[0][1].toFixed(3) + ',' + m[1][1].toFixed(3) + ',0,0'; + var skewOffset = mr(d.x / Z) + ',' + mr(d.y / Z); + lineStr.push('', '', ''); + this.element_.insertAdjacentHTML('beforeEnd', lineStr.join('')); + }; + contextPrototype.fillText = function (text, x, y, maxWidth) { + this.drawText_(text, x, y, maxWidth, false); + }; + contextPrototype.strokeText = function (text, x, y, maxWidth) { + this.drawText_(text, x, y, maxWidth, true); + }; + contextPrototype.measureText = function (text) { + if (!this.textMeasureEl_) { + var s = ''; + this.element_.insertAdjacentHTML('beforeEnd', s); + this.textMeasureEl_ = this.element_.lastChild; + } + var doc = this.element_.ownerDocument; + this.textMeasureEl_.innerHTML = ''; + try { + this.textMeasureEl_.style.font = this.font; + } catch (ex) { + } + this.textMeasureEl_.appendChild(doc.createTextNode(text)); + return { width: this.textMeasureEl_.offsetWidth }; + }; + contextPrototype.clip = function () { + }; + contextPrototype.arcTo = function () { + }; + contextPrototype.createPattern = function (image, repetition) { + return new CanvasPattern_(image, repetition); + }; + function CanvasGradient_(aType) { + this.type_ = aType; + this.x0_ = 0; + this.y0_ = 0; + this.r0_ = 0; + this.x1_ = 0; + this.y1_ = 0; + this.r1_ = 0; + this.colors_ = []; + } + CanvasGradient_.prototype.addColorStop = function (aOffset, aColor) { + aColor = processStyle(aColor); + this.colors_.push({ + offset: aOffset, + color: aColor.color, + alpha: aColor.alpha + }); + }; + function CanvasPattern_(image, repetition) { + assertImageIsValid(image); + switch (repetition) { + case 'repeat': + case null: + case '': + this.repetition_ = 'repeat'; + break; + case 'repeat-x': + case 'repeat-y': + case 'no-repeat': + this.repetition_ = repetition; + break; + default: + throwException('SYNTAX_ERR'); + } + this.src_ = image.src; + this.width_ = image.width; + this.height_ = image.height; + } + function throwException(s) { + throw new DOMException_(s); + } + function assertImageIsValid(img) { + if (!img || img.nodeType != 1 || img.tagName != 'IMG') { + throwException('TYPE_MISMATCH_ERR'); + } + if (img.readyState != 'complete') { + throwException('INVALID_STATE_ERR'); + } + } + function DOMException_(s) { + this.code = this[s]; + this.message = s + ': DOM Exception ' + this.code; + } + var p = DOMException_.prototype = new Error(); + p.INDEX_SIZE_ERR = 1; + p.DOMSTRING_SIZE_ERR = 2; + p.HIERARCHY_REQUEST_ERR = 3; + p.WRONG_DOCUMENT_ERR = 4; + p.INVALID_CHARACTER_ERR = 5; + p.NO_DATA_ALLOWED_ERR = 6; + p.NO_MODIFICATION_ALLOWED_ERR = 7; + p.NOT_FOUND_ERR = 8; + p.NOT_SUPPORTED_ERR = 9; + p.INUSE_ATTRIBUTE_ERR = 10; + p.INVALID_STATE_ERR = 11; + p.SYNTAX_ERR = 12; + p.INVALID_MODIFICATION_ERR = 13; + p.NAMESPACE_ERR = 14; + p.INVALID_ACCESS_ERR = 15; + p.VALIDATION_ERR = 16; + p.TYPE_MISMATCH_ERR = 17; + G_vmlCanvasManager = G_vmlCanvasManager_; + CanvasRenderingContext2D = CanvasRenderingContext2D_; + CanvasGradient = CanvasGradient_; + CanvasPattern = CanvasPattern_; + DOMException = DOMException_; + }()); + } else { + G_vmlCanvasManager = false; + } + return G_vmlCanvasManager; +});define('zrender/mixin/Eventful', ['require'], function (require) { + var Eventful = function () { + this._handlers = {}; + }; + Eventful.prototype.one = function (event, handler, context) { + var _h = this._handlers; + if (!handler || !event) { + return this; + } + if (!_h[event]) { + _h[event] = []; + } + _h[event].push({ + h: handler, + one: true, + ctx: context || this + }); + return this; + }; + Eventful.prototype.bind = function (event, handler, context) { + var _h = this._handlers; + if (!handler || !event) { + return this; + } + if (!_h[event]) { + _h[event] = []; + } + _h[event].push({ + h: handler, + one: false, + ctx: context || this + }); + return this; + }; + Eventful.prototype.unbind = function (event, handler) { + var _h = this._handlers; + if (!event) { + this._handlers = {}; + return this; + } + if (handler) { + if (_h[event]) { + var newList = []; + for (var i = 0, l = _h[event].length; i < l; i++) { + if (_h[event][i]['h'] != handler) { + newList.push(_h[event][i]); + } + } + _h[event] = newList; + } + if (_h[event] && _h[event].length === 0) { + delete _h[event]; + } + } else { + delete _h[event]; + } + return this; + }; + Eventful.prototype.dispatch = function (type) { + if (this._handlers[type]) { + var args = arguments; + var argLen = args.length; + if (argLen > 3) { + args = Array.prototype.slice.call(args, 1); + } + var _h = this._handlers[type]; + var len = _h.length; + for (var i = 0; i < len;) { + switch (argLen) { + case 1: + _h[i]['h'].call(_h[i]['ctx']); + break; + case 2: + _h[i]['h'].call(_h[i]['ctx'], args[1]); + break; + case 3: + _h[i]['h'].call(_h[i]['ctx'], args[1], args[2]); + break; + default: + _h[i]['h'].apply(_h[i]['ctx'], args); + break; + } + if (_h[i]['one']) { + _h.splice(i, 1); + len--; + } else { + i++; + } + } + } + return this; + }; + Eventful.prototype.dispatchWithContext = function (type) { + if (this._handlers[type]) { + var args = arguments; + var argLen = args.length; + if (argLen > 4) { + args = Array.prototype.slice.call(args, 1, args.length - 1); + } + var ctx = args[args.length - 1]; + var _h = this._handlers[type]; + var len = _h.length; + for (var i = 0; i < len;) { + switch (argLen) { + case 1: + _h[i]['h'].call(ctx); + break; + case 2: + _h[i]['h'].call(ctx, args[1]); + break; + case 3: + _h[i]['h'].call(ctx, args[1], args[2]); + break; + default: + _h[i]['h'].apply(ctx, args); + break; + } + if (_h[i]['one']) { + _h.splice(i, 1); + len--; + } else { + i++; + } + } + } + return this; + }; + return Eventful; +});define('zrender/tool/log', [ + 'require', + '../config' +], function (require) { + var config = require('../config'); + return function () { + if (config.debugMode === 0) { + return; + } else if (config.debugMode == 1) { + for (var k in arguments) { + throw new Error(arguments[k]); + } + } else if (config.debugMode > 1) { + for (var k in arguments) { + console.log(arguments[k]); + } + } + }; +});define('zrender/tool/guid', [], function () { + var idStart = 2311; + return function () { + return 'zrender__' + idStart++; + }; +});define('zrender/Handler', [ + 'require', + './config', + './tool/env', + './tool/event', + './tool/util', + './tool/vector', + './tool/matrix', + './mixin/Eventful' +], function (require) { + 'use strict'; + var config = require('./config'); + var env = require('./tool/env'); + var eventTool = require('./tool/event'); + var util = require('./tool/util'); + var vec2 = require('./tool/vector'); + var mat2d = require('./tool/matrix'); + var EVENT = config.EVENT; + var Eventful = require('./mixin/Eventful'); + var domHandlerNames = [ + 'resize', + 'click', + 'dblclick', + 'mousewheel', + 'mousemove', + 'mouseout', + 'mouseup', + 'mousedown', + 'touchstart', + 'touchend', + 'touchmove' + ]; + var domHandlers = { + resize: function (event) { + event = event || window.event; + this._lastHover = null; + this._isMouseDown = 0; + this.dispatch(EVENT.RESIZE, event); + }, + click: function (event) { + event = this._zrenderEventFixed(event); + var _lastHover = this._lastHover; + if (_lastHover && _lastHover.clickable || !_lastHover) { + if (this._clickThreshold < 5) { + this._dispatchAgency(_lastHover, EVENT.CLICK, event); + } + } + this._mousemoveHandler(event); + }, + dblclick: function (event) { + event = event || window.event; + event = this._zrenderEventFixed(event); + var _lastHover = this._lastHover; + if (_lastHover && _lastHover.clickable || !_lastHover) { + if (this._clickThreshold < 5) { + this._dispatchAgency(_lastHover, EVENT.DBLCLICK, event); + } + } + this._mousemoveHandler(event); + }, + mousewheel: function (event) { + event = this._zrenderEventFixed(event); + var delta = event.wheelDelta || -event.detail; + var scale = delta > 0 ? 1.1 : 1 / 1.1; + var needsRefresh = false; + var mouseX = this._mouseX; + var mouseY = this._mouseY; + this.painter.eachBuildinLayer(function (layer) { + var pos = layer.position; + if (layer.zoomable) { + layer.__zoom = layer.__zoom || 1; + var newZoom = layer.__zoom; + newZoom *= scale; + newZoom = Math.max(Math.min(layer.maxZoom, newZoom), layer.minZoom); + scale = newZoom / layer.__zoom; + layer.__zoom = newZoom; + pos[0] -= (mouseX - pos[0]) * (scale - 1); + pos[1] -= (mouseY - pos[1]) * (scale - 1); + layer.scale[0] *= scale; + layer.scale[1] *= scale; + layer.dirty = true; + needsRefresh = true; + eventTool.stop(event); + } + }); + if (needsRefresh) { + this.painter.refresh(); + } + this._dispatchAgency(this._lastHover, EVENT.MOUSEWHEEL, event); + this._mousemoveHandler(event); + }, + mousemove: function (event) { + if (this.painter.isLoading()) { + return; + } + event = this._zrenderEventFixed(event); + this._lastX = this._mouseX; + this._lastY = this._mouseY; + this._mouseX = eventTool.getX(event); + this._mouseY = eventTool.getY(event); + var dx = this._mouseX - this._lastX; + var dy = this._mouseY - this._lastY; + this._processDragStart(event); + this._hasfound = 0; + this._event = event; + this._iterateAndFindHover(); + if (!this._hasfound) { + if (!this._draggingTarget || this._lastHover && this._lastHover != this._draggingTarget) { + this._processOutShape(event); + this._processDragLeave(event); + } + this._lastHover = null; + this.storage.delHover(); + this.painter.clearHover(); + } + var cursor = 'default'; + if (this._draggingTarget) { + this.storage.drift(this._draggingTarget.id, dx, dy); + this._draggingTarget.modSelf(); + this.storage.addHover(this._draggingTarget); + this._clickThreshold++; + } else if (this._isMouseDown) { + var needsRefresh = false; + this.painter.eachBuildinLayer(function (layer) { + if (layer.panable) { + cursor = 'move'; + layer.position[0] += dx; + layer.position[1] += dy; + needsRefresh = true; + layer.dirty = true; + } + }); + if (needsRefresh) { + this.painter.refresh(); + } + } + if (this._draggingTarget || this._hasfound && this._lastHover.draggable) { + cursor = 'move'; + } else if (this._hasfound && this._lastHover.clickable) { + cursor = 'pointer'; + } + this.root.style.cursor = cursor; + this._dispatchAgency(this._lastHover, EVENT.MOUSEMOVE, event); + if (this._draggingTarget || this._hasfound || this.storage.hasHoverShape()) { + this.painter.refreshHover(); + } + }, + mouseout: function (event) { + event = this._zrenderEventFixed(event); + var element = event.toElement || event.relatedTarget; + if (element != this.root) { + while (element && element.nodeType != 9) { + if (element == this.root) { + this._mousemoveHandler(event); + return; + } + element = element.parentNode; + } + } + event.zrenderX = this._lastX; + event.zrenderY = this._lastY; + this.root.style.cursor = 'default'; + this._isMouseDown = 0; + this._processOutShape(event); + this._processDrop(event); + this._processDragEnd(event); + if (!this.painter.isLoading()) { + this.painter.refreshHover(); + } + this.dispatch(EVENT.GLOBALOUT, event); + }, + mousedown: function (event) { + this._clickThreshold = 0; + if (this._lastDownButton == 2) { + this._lastDownButton = event.button; + this._mouseDownTarget = null; + return; + } + this._lastMouseDownMoment = new Date(); + event = this._zrenderEventFixed(event); + this._isMouseDown = 1; + this._mouseDownTarget = this._lastHover; + this._dispatchAgency(this._lastHover, EVENT.MOUSEDOWN, event); + this._lastDownButton = event.button; + }, + mouseup: function (event) { + event = this._zrenderEventFixed(event); + this.root.style.cursor = 'default'; + this._isMouseDown = 0; + this._mouseDownTarget = null; + this._dispatchAgency(this._lastHover, EVENT.MOUSEUP, event); + this._processDrop(event); + this._processDragEnd(event); + }, + touchstart: function (event) { + event = this._zrenderEventFixed(event, true); + this._lastTouchMoment = new Date(); + this._mobileFindFixed(event); + this._mousedownHandler(event); + }, + touchmove: function (event) { + event = this._zrenderEventFixed(event, true); + this._mousemoveHandler(event); + if (this._isDragging) { + eventTool.stop(event); + } + }, + touchend: function (event) { + event = this._zrenderEventFixed(event, true); + this._mouseupHandler(event); + var now = new Date(); + if (now - this._lastTouchMoment < EVENT.touchClickDelay) { + this._mobileFindFixed(event); + this._clickHandler(event); + if (now - this._lastClickMoment < EVENT.touchClickDelay / 2) { + this._dblclickHandler(event); + if (this._lastHover && this._lastHover.clickable) { + eventTool.stop(event); + } + } + this._lastClickMoment = now; + } + this.painter.clearHover(); + } + }; + function bind1Arg(handler, context) { + return function (e) { + return handler.call(context, e); + }; + } + function bind3Arg(handler, context) { + return function (arg1, arg2, arg3) { + return handler.call(context, arg1, arg2, arg3); + }; + } + function initDomHandler(instance) { + var len = domHandlerNames.length; + while (len--) { + var name = domHandlerNames[len]; + instance['_' + name + 'Handler'] = bind1Arg(domHandlers[name], instance); + } + } + var Handler = function (root, storage, painter) { + Eventful.call(this); + this.root = root; + this.storage = storage; + this.painter = painter; + this._lastX = this._lastY = this._mouseX = this._mouseY = 0; + this._findHover = bind3Arg(findHover, this); + this._domHover = painter.getDomHover(); + initDomHandler(this); + if (window.addEventListener) { + window.addEventListener('resize', this._resizeHandler); + if (env.os.tablet || env.os.phone) { + root.addEventListener('touchstart', this._touchstartHandler); + root.addEventListener('touchmove', this._touchmoveHandler); + root.addEventListener('touchend', this._touchendHandler); + } else { + root.addEventListener('click', this._clickHandler); + root.addEventListener('dblclick', this._dblclickHandler); + root.addEventListener('mousewheel', this._mousewheelHandler); + root.addEventListener('mousemove', this._mousemoveHandler); + root.addEventListener('mousedown', this._mousedownHandler); + root.addEventListener('mouseup', this._mouseupHandler); + } + root.addEventListener('DOMMouseScroll', this._mousewheelHandler); + root.addEventListener('mouseout', this._mouseoutHandler); + } else { + window.attachEvent('onresize', this._resizeHandler); + root.attachEvent('onclick', this._clickHandler); + root.ondblclick = this._dblclickHandler; + root.attachEvent('onmousewheel', this._mousewheelHandler); + root.attachEvent('onmousemove', this._mousemoveHandler); + root.attachEvent('onmouseout', this._mouseoutHandler); + root.attachEvent('onmousedown', this._mousedownHandler); + root.attachEvent('onmouseup', this._mouseupHandler); + } + }; + Handler.prototype.on = function (eventName, handler, context) { + this.bind(eventName, handler, context); + return this; + }; + Handler.prototype.un = function (eventName, handler) { + this.unbind(eventName, handler); + return this; + }; + Handler.prototype.trigger = function (eventName, eventArgs) { + switch (eventName) { + case EVENT.RESIZE: + case EVENT.CLICK: + case EVENT.DBLCLICK: + case EVENT.MOUSEWHEEL: + case EVENT.MOUSEMOVE: + case EVENT.MOUSEDOWN: + case EVENT.MOUSEUP: + case EVENT.MOUSEOUT: + this['_' + eventName + 'Handler'](eventArgs); + break; + } + }; + Handler.prototype.dispose = function () { + var root = this.root; + if (window.removeEventListener) { + window.removeEventListener('resize', this._resizeHandler); + if (env.os.tablet || env.os.phone) { + root.removeEventListener('touchstart', this._touchstartHandler); + root.removeEventListener('touchmove', this._touchmoveHandler); + root.removeEventListener('touchend', this._touchendHandler); + } else { + root.removeEventListener('click', this._clickHandler); + root.removeEventListener('dblclick', this._dblclickHandler); + root.removeEventListener('mousewheel', this._mousewheelHandler); + root.removeEventListener('mousemove', this._mousemoveHandler); + root.removeEventListener('mousedown', this._mousedownHandler); + root.removeEventListener('mouseup', this._mouseupHandler); + } + root.removeEventListener('DOMMouseScroll', this._mousewheelHandler); + root.removeEventListener('mouseout', this._mouseoutHandler); + } else { + window.detachEvent('onresize', this._resizeHandler); + root.detachEvent('onclick', this._clickHandler); + root.detachEvent('dblclick', this._dblclickHandler); + root.detachEvent('onmousewheel', this._mousewheelHandler); + root.detachEvent('onmousemove', this._mousemoveHandler); + root.detachEvent('onmouseout', this._mouseoutHandler); + root.detachEvent('onmousedown', this._mousedownHandler); + root.detachEvent('onmouseup', this._mouseupHandler); + } + this.root = this._domHover = this.storage = this.painter = null; + this.un(); + }; + Handler.prototype._processDragStart = function (event) { + var _lastHover = this._lastHover; + if (this._isMouseDown && _lastHover && _lastHover.draggable && !this._draggingTarget && this._mouseDownTarget == _lastHover) { + if (_lastHover.dragEnableTime && new Date() - this._lastMouseDownMoment < _lastHover.dragEnableTime) { + return; + } + var _draggingTarget = _lastHover; + this._draggingTarget = _draggingTarget; + this._isDragging = 1; + _draggingTarget.invisible = true; + this.storage.mod(_draggingTarget.id); + this._dispatchAgency(_draggingTarget, EVENT.DRAGSTART, event); + this.painter.refresh(); + } + }; + Handler.prototype._processDragEnter = function (event) { + if (this._draggingTarget) { + this._dispatchAgency(this._lastHover, EVENT.DRAGENTER, event, this._draggingTarget); + } + }; + Handler.prototype._processDragOver = function (event) { + if (this._draggingTarget) { + this._dispatchAgency(this._lastHover, EVENT.DRAGOVER, event, this._draggingTarget); + } + }; + Handler.prototype._processDragLeave = function (event) { + if (this._draggingTarget) { + this._dispatchAgency(this._lastHover, EVENT.DRAGLEAVE, event, this._draggingTarget); + } + }; + Handler.prototype._processDrop = function (event) { + if (this._draggingTarget) { + this._draggingTarget.invisible = false; + this.storage.mod(this._draggingTarget.id); + this.painter.refresh(); + this._dispatchAgency(this._lastHover, EVENT.DROP, event, this._draggingTarget); + } + }; + Handler.prototype._processDragEnd = function (event) { + if (this._draggingTarget) { + this._dispatchAgency(this._draggingTarget, EVENT.DRAGEND, event); + this._lastHover = null; + } + this._isDragging = 0; + this._draggingTarget = null; + }; + Handler.prototype._processOverShape = function (event) { + this._dispatchAgency(this._lastHover, EVENT.MOUSEOVER, event); + }; + Handler.prototype._processOutShape = function (event) { + this._dispatchAgency(this._lastHover, EVENT.MOUSEOUT, event); + }; + Handler.prototype._dispatchAgency = function (targetShape, eventName, event, draggedShape) { + var eventHandler = 'on' + eventName; + var eventPacket = { + type: eventName, + event: event, + target: targetShape, + cancelBubble: false + }; + var el = targetShape; + if (draggedShape) { + eventPacket.dragged = draggedShape; + } + while (el) { + el[eventHandler] && (eventPacket.cancelBubble = el[eventHandler](eventPacket)); + el.dispatch(eventName, eventPacket); + el = el.parent; + if (eventPacket.cancelBubble) { + break; + } + } + if (targetShape) { + if (!eventPacket.cancelBubble) { + this.dispatch(eventName, eventPacket); + } + } else if (!draggedShape) { + var eveObj = { + type: eventName, + event: event + }; + this.dispatch(eventName, eveObj); + this.painter.eachOtherLayer(function (layer) { + if (typeof layer[eventHandler] == 'function') { + layer[eventHandler](eveObj); + } + if (layer.dispatch) { + layer.dispatch(eventName, eveObj); + } + }); + } + }; + Handler.prototype._iterateAndFindHover = function () { + var invTransform = mat2d.create(); + return function () { + var list = this.storage.getShapeList(); + var currentZLevel; + var currentLayer; + var tmp = [ + 0, + 0 + ]; + for (var i = list.length - 1; i >= 0; i--) { + var shape = list[i]; + if (currentZLevel !== shape.zlevel) { + currentLayer = this.painter.getLayer(shape.zlevel, currentLayer); + tmp[0] = this._mouseX; + tmp[1] = this._mouseY; + if (currentLayer.needTransform) { + mat2d.invert(invTransform, currentLayer.transform); + vec2.applyTransform(tmp, tmp, invTransform); + } + } + if (this._findHover(shape, tmp[0], tmp[1])) { + break; + } + } + }; + }(); + var MOBILE_TOUCH_OFFSETS = [ + { x: 10 }, + { x: -20 }, + { + x: 10, + y: 10 + }, + { y: -20 } + ]; + Handler.prototype._mobileFindFixed = function (event) { + this._lastHover = null; + this._mouseX = event.zrenderX; + this._mouseY = event.zrenderY; + this._event = event; + this._iterateAndFindHover(); + for (var i = 0; !this._lastHover && i < MOBILE_TOUCH_OFFSETS.length; i++) { + var offset = MOBILE_TOUCH_OFFSETS[i]; + offset.x && (this._mouseX += offset.x); + offset.y && (this._mouseY += offset.y); + this._iterateAndFindHover(); + } + if (this._lastHover) { + event.zrenderX = this._mouseX; + event.zrenderY = this._mouseY; + } + }; + function findHover(shape, x, y) { + if (this._draggingTarget && this._draggingTarget.id == shape.id || shape.isSilent()) { + return false; + } + var event = this._event; + if (shape.isCover(x, y)) { + if (shape.hoverable) { + this.storage.addHover(shape); + } + var p = shape.parent; + while (p) { + if (p.clipShape && !p.clipShape.isCover(this._mouseX, this._mouseY)) { + return false; + } + p = p.parent; + } + if (this._lastHover != shape) { + this._processOutShape(event); + this._processDragLeave(event); + this._lastHover = shape; + this._processDragEnter(event); + } + this._processOverShape(event); + this._processDragOver(event); + this._hasfound = 1; + return true; + } + return false; + } + Handler.prototype._zrenderEventFixed = function (event, isTouch) { + if (event.zrenderFixed) { + return event; + } + if (!isTouch) { + event = event || window.event; + var target = event.toElement || event.relatedTarget || event.srcElement || event.target; + if (target && target != this._domHover) { + event.zrenderX = (typeof event.offsetX != 'undefined' ? event.offsetX : event.layerX) + target.offsetLeft; + event.zrenderY = (typeof event.offsetY != 'undefined' ? event.offsetY : event.layerY) + target.offsetTop; + } + } else { + var touch = event.type != 'touchend' ? event.targetTouches[0] : event.changedTouches[0]; + if (touch) { + var rBounding = this.painter._domRoot.getBoundingClientRect(); + event.zrenderX = touch.clientX - rBounding.left; + event.zrenderY = touch.clientY - rBounding.top; + } + } + event.zrenderFixed = 1; + return event; + }; + util.merge(Handler.prototype, Eventful.prototype, true); + return Handler; +});define('zrender/Painter', [ + 'require', + './config', + './tool/util', + './tool/log', + './loadingEffect/Base', + './Layer', + './shape/Image' +], function (require) { + 'use strict'; + var config = require('./config'); + var util = require('./tool/util'); + var log = require('./tool/log'); + var BaseLoadingEffect = require('./loadingEffect/Base'); + var Layer = require('./Layer'); + function returnFalse() { + return false; + } + function doNothing() { + } + function isLayerValid(layer) { + if (!layer) { + return false; + } + if (layer.isBuildin) { + return true; + } + if (typeof layer.resize !== 'function' || typeof layer.refresh !== 'function') { + return false; + } + return true; + } + var Painter = function (root, storage) { + this.root = root; + root.style['-webkit-tap-highlight-color'] = 'transparent'; + root.style['-webkit-user-select'] = 'none'; + root.style['user-select'] = 'none'; + root.style['-webkit-touch-callout'] = 'none'; + this.storage = storage; + root.innerHTML = ''; + this._width = this._getWidth(); + this._height = this._getHeight(); + var domRoot = document.createElement('div'); + this._domRoot = domRoot; + domRoot.style.position = 'relative'; + domRoot.style.overflow = 'hidden'; + domRoot.style.width = this._width + 'px'; + domRoot.style.height = this._height + 'px'; + root.appendChild(domRoot); + this._layers = {}; + this._zlevelList = []; + this._layerConfig = {}; + this._loadingEffect = new BaseLoadingEffect({}); + this.shapeToImage = this._createShapeToImageProcessor(); + this._bgDom = document.createElement('div'); + this._bgDom.style.cssText = [ + 'position:absolute;left:0px;top:0px;width:', + this._width, + 'px;height:', + this._height + 'px;', + '-webkit-user-select:none;user-select;none;', + '-webkit-touch-callout:none;' + ].join(''); + this._bgDom.setAttribute('data-zr-dom-id', 'bg'); + domRoot.appendChild(this._bgDom); + this._bgDom.onselectstart = returnFalse; + var hoverLayer = new Layer('_zrender_hover_', this); + this._layers['hover'] = hoverLayer; + domRoot.appendChild(hoverLayer.dom); + hoverLayer.initContext(); + hoverLayer.dom.onselectstart = returnFalse; + hoverLayer.dom.style['-webkit-user-select'] = 'none'; + hoverLayer.dom.style['user-select'] = 'none'; + hoverLayer.dom.style['-webkit-touch-callout'] = 'none'; + this.refreshNextFrame = null; + }; + Painter.prototype.render = function (callback) { + if (this.isLoading()) { + this.hideLoading(); + } + this.refresh(callback, true); + return this; + }; + Painter.prototype.refresh = function (callback, paintAll) { + var list = this.storage.getShapeList(true); + this._paintList(list, paintAll); + for (var i = 0; i < this._zlevelList.length; i++) { + var z = this._zlevelList[i]; + var layer = this._layers[z]; + if (!layer.isBuildin && layer.refresh) { + layer.refresh(); + } + } + if (typeof callback == 'function') { + callback(); + } + return this; + }; + Painter.prototype._preProcessLayer = function (layer) { + layer.unusedCount++; + layer.updateTransform(); + }; + Painter.prototype._postProcessLayer = function (layer) { + layer.dirty = false; + if (layer.unusedCount == 1) { + layer.clear(); + } + }; + Painter.prototype._paintList = function (list, paintAll) { + if (typeof paintAll == 'undefined') { + paintAll = false; + } + this._updateLayerStatus(list); + var currentLayer; + var currentZLevel; + var ctx; + this.eachBuildinLayer(this._preProcessLayer); + for (var i = 0, l = list.length; i < l; i++) { + var shape = list[i]; + if (currentZLevel !== shape.zlevel) { + if (currentLayer) { + if (currentLayer.needTransform) { + ctx.restore(); + } + ctx.flush && ctx.flush(); + } + currentZLevel = shape.zlevel; + currentLayer = this.getLayer(currentZLevel); + if (!currentLayer.isBuildin) { + log('ZLevel ' + currentZLevel + ' has been used by unkown layer ' + currentLayer.id); + } + ctx = currentLayer.ctx; + currentLayer.unusedCount = 0; + if (currentLayer.dirty || paintAll) { + currentLayer.clear(); + } + if (currentLayer.needTransform) { + ctx.save(); + currentLayer.setTransform(ctx); + } + } + if ((currentLayer.dirty || paintAll) && !shape.invisible) { + if (!shape.onbrush || shape.onbrush && !shape.onbrush(ctx, false)) { + if (config.catchBrushException) { + try { + shape.brush(ctx, false, this.refreshNextFrame); + } catch (error) { + log(error, 'brush error of ' + shape.type, shape); + } + } else { + shape.brush(ctx, false, this.refreshNextFrame); + } + } + } + shape.__dirty = false; + } + if (currentLayer) { + if (currentLayer.needTransform) { + ctx.restore(); + } + ctx.flush && ctx.flush(); + } + this.eachBuildinLayer(this._postProcessLayer); + }; + Painter.prototype.getLayer = function (zlevel) { + var layer = this._layers[zlevel]; + if (!layer) { + layer = new Layer(zlevel, this); + layer.isBuildin = true; + if (this._layerConfig[zlevel]) { + util.merge(layer, this._layerConfig[zlevel], true); + } + layer.updateTransform(); + this.insertLayer(zlevel, layer); + layer.initContext(); + } + return layer; + }; + Painter.prototype.insertLayer = function (zlevel, layer) { + if (this._layers[zlevel]) { + log('ZLevel ' + zlevel + ' has been used already'); + return; + } + if (!isLayerValid(layer)) { + log('Layer of zlevel ' + zlevel + ' is not valid'); + return; + } + var len = this._zlevelList.length; + var prevLayer = null; + var i = -1; + if (len > 0 && zlevel > this._zlevelList[0]) { + for (i = 0; i < len - 1; i++) { + if (this._zlevelList[i] < zlevel && this._zlevelList[i + 1] > zlevel) { + break; + } + } + prevLayer = this._layers[this._zlevelList[i]]; + } + this._zlevelList.splice(i + 1, 0, zlevel); + var prevDom = prevLayer ? prevLayer.dom : this._bgDom; + if (prevDom.nextSibling) { + prevDom.parentNode.insertBefore(layer.dom, prevDom.nextSibling); + } else { + prevDom.parentNode.appendChild(layer.dom); + } + this._layers[zlevel] = layer; + }; + Painter.prototype.eachLayer = function (cb, context) { + for (var i = 0; i < this._zlevelList.length; i++) { + var z = this._zlevelList[i]; + cb.call(context, this._layers[z], z); + } + }; + Painter.prototype.eachBuildinLayer = function (cb, context) { + for (var i = 0; i < this._zlevelList.length; i++) { + var z = this._zlevelList[i]; + var layer = this._layers[z]; + if (layer.isBuildin) { + cb.call(context, layer, z); + } + } + }; + Painter.prototype.eachOtherLayer = function (cb, context) { + for (var i = 0; i < this._zlevelList.length; i++) { + var z = this._zlevelList[i]; + var layer = this._layers[z]; + if (!layer.isBuildin) { + cb.call(context, layer, z); + } + } + }; + Painter.prototype.getLayers = function () { + return this._layers; + }; + Painter.prototype._updateLayerStatus = function (list) { + var layers = this._layers; + var elCounts = {}; + this.eachBuildinLayer(function (layer, z) { + elCounts[z] = layer.elCount; + layer.elCount = 0; + }); + for (var i = 0, l = list.length; i < l; i++) { + var shape = list[i]; + var zlevel = shape.zlevel; + var layer = layers[zlevel]; + if (layer) { + layer.elCount++; + if (layer.dirty) { + continue; + } + layer.dirty = shape.__dirty; + } + } + this.eachBuildinLayer(function (layer, z) { + if (elCounts[z] !== layer.elCount) { + layer.dirty = true; + } + }); + }; + Painter.prototype.refreshShapes = function (shapeList, callback) { + for (var i = 0, l = shapeList.length; i < l; i++) { + var shape = shapeList[i]; + shape.modSelf(); + } + this.refresh(callback); + return this; + }; + Painter.prototype.setLoadingEffect = function (loadingEffect) { + this._loadingEffect = loadingEffect; + return this; + }; + Painter.prototype.clear = function () { + this.eachBuildinLayer(this._clearLayer); + return this; + }; + Painter.prototype._clearLayer = function (layer) { + layer.clear(); + }; + Painter.prototype.modLayer = function (zlevel, config) { + if (config) { + if (!this._layerConfig[zlevel]) { + this._layerConfig[zlevel] = config; + } else { + util.merge(this._layerConfig[zlevel], config, true); + } + var layer = this._layers[zlevel]; + if (layer) { + util.merge(layer, this._layerConfig[zlevel], true); + } + } + }; + Painter.prototype.delLayer = function (zlevel) { + var layer = this._layers[zlevel]; + if (!layer) { + return; + } + this.modLayer(zlevel, { + position: layer.position, + rotation: layer.rotation, + scale: layer.scale + }); + layer.dom.parentNode.removeChild(layer.dom); + delete this._layers[zlevel]; + this._zlevelList.splice(util.indexOf(this._zlevelList, zlevel), 1); + }; + Painter.prototype.refreshHover = function () { + this.clearHover(); + var list = this.storage.getHoverShapes(true); + for (var i = 0, l = list.length; i < l; i++) { + this._brushHover(list[i]); + } + var ctx = this._layers.hover.ctx; + ctx.flush && ctx.flush(); + this.storage.delHover(); + return this; + }; + Painter.prototype.clearHover = function () { + var hover = this._layers.hover; + hover && hover.clear(); + return this; + }; + Painter.prototype.showLoading = function (loadingEffect) { + this._loadingEffect && this._loadingEffect.stop(); + loadingEffect && this.setLoadingEffect(loadingEffect); + this._loadingEffect.start(this); + this.loading = true; + return this; + }; + Painter.prototype.hideLoading = function () { + this._loadingEffect.stop(); + this.clearHover(); + this.loading = false; + return this; + }; + Painter.prototype.isLoading = function () { + return this.loading; + }; + Painter.prototype.resize = function () { + var domRoot = this._domRoot; + domRoot.style.display = 'none'; + var width = this._getWidth(); + var height = this._getHeight(); + domRoot.style.display = ''; + if (this._width != width || height != this._height) { + this._width = width; + this._height = height; + domRoot.style.width = width + 'px'; + domRoot.style.height = height + 'px'; + for (var id in this._layers) { + this._layers[id].resize(width, height); + } + this.refresh(null, true); + } + return this; + }; + Painter.prototype.clearLayer = function (zLevel) { + var layer = this._layers[zLevel]; + if (layer) { + layer.clear(); + } + }; + Painter.prototype.dispose = function () { + if (this.isLoading()) { + this.hideLoading(); + } + this.root.innerHTML = ''; + this.root = this.storage = this._domRoot = this._layers = null; + }; + Painter.prototype.getDomHover = function () { + return this._layers.hover.dom; + }; + Painter.prototype.toDataURL = function (type, backgroundColor, args) { + if (window['G_vmlCanvasManager']) { + return null; + } + var imageLayer = new Layer('image', this); + this._bgDom.appendChild(imageLayer.dom); + imageLayer.initContext(); + var ctx = imageLayer.ctx; + imageLayer.clearColor = backgroundColor || '#fff'; + imageLayer.clear(); + var self = this; + this.storage.iterShape(function (shape) { + if (!shape.invisible) { + if (!shape.onbrush || shape.onbrush && !shape.onbrush(ctx, false)) { + if (config.catchBrushException) { + try { + shape.brush(ctx, false, self.refreshNextFrame); + } catch (error) { + log(error, 'brush error of ' + shape.type, shape); + } + } else { + shape.brush(ctx, false, self.refreshNextFrame); + } + } + } + }, { + normal: 'up', + update: true + }); + var image = imageLayer.dom.toDataURL(type, args); + ctx = null; + this._bgDom.removeChild(imageLayer.dom); + return image; + }; + Painter.prototype.getWidth = function () { + return this._width; + }; + Painter.prototype.getHeight = function () { + return this._height; + }; + Painter.prototype._getWidth = function () { + var root = this.root; + var stl = root.currentStyle || document.defaultView.getComputedStyle(root); + return ((root.clientWidth || parseInt(stl.width, 10)) - parseInt(stl.paddingLeft, 10) - parseInt(stl.paddingRight, 10)).toFixed(0) - 0; + }; + Painter.prototype._getHeight = function () { + var root = this.root; + var stl = root.currentStyle || document.defaultView.getComputedStyle(root); + return ((root.clientHeight || parseInt(stl.height, 10)) - parseInt(stl.paddingTop, 10) - parseInt(stl.paddingBottom, 10)).toFixed(0) - 0; + }; + Painter.prototype._brushHover = function (shape) { + var ctx = this._layers.hover.ctx; + if (!shape.onbrush || shape.onbrush && !shape.onbrush(ctx, true)) { + var layer = this.getLayer(shape.zlevel); + if (layer.needTransform) { + ctx.save(); + layer.setTransform(ctx); + } + if (config.catchBrushException) { + try { + shape.brush(ctx, true, this.refreshNextFrame); + } catch (error) { + log(error, 'hoverBrush error of ' + shape.type, shape); + } + } else { + shape.brush(ctx, true, this.refreshNextFrame); + } + if (layer.needTransform) { + ctx.restore(); + } + } + }; + Painter.prototype._shapeToImage = function (id, shape, width, height, devicePixelRatio) { + var canvas = document.createElement('canvas'); + var ctx = canvas.getContext('2d'); + canvas.style.width = width + 'px'; + canvas.style.height = height + 'px'; + canvas.setAttribute('width', width * devicePixelRatio); + canvas.setAttribute('height', height * devicePixelRatio); + ctx.clearRect(0, 0, width * devicePixelRatio, height * devicePixelRatio); + var shapeTransform = { + position: shape.position, + rotation: shape.rotation, + scale: shape.scale + }; + shape.position = [ + 0, + 0, + 0 + ]; + shape.rotation = 0; + shape.scale = [ + 1, + 1 + ]; + if (shape) { + shape.brush(ctx, false); + } + var ImageShape = require('./shape/Image'); + var imgShape = new ImageShape({ + id: id, + style: { + x: 0, + y: 0, + image: canvas + } + }); + if (shapeTransform.position != null) { + imgShape.position = shape.position = shapeTransform.position; + } + if (shapeTransform.rotation != null) { + imgShape.rotation = shape.rotation = shapeTransform.rotation; + } + if (shapeTransform.scale != null) { + imgShape.scale = shape.scale = shapeTransform.scale; + } + return imgShape; + }; + Painter.prototype._createShapeToImageProcessor = function () { + if (window['G_vmlCanvasManager']) { + return doNothing; + } + var me = this; + return function (id, e, width, height) { + return me._shapeToImage(id, e, width, height, config.devicePixelRatio); + }; + }; + return Painter; +});define('zrender/Storage', [ + 'require', + './tool/util', + './Group' +], function (require) { + 'use strict'; + var util = require('./tool/util'); + var Group = require('./Group'); + var defaultIterateOption = { + hover: false, + normal: 'down', + update: false + }; + function shapeCompareFunc(a, b) { + if (a.zlevel == b.zlevel) { + if (a.z == b.z) { + return a.__renderidx - b.__renderidx; + } + return a.z - b.z; + } + return a.zlevel - b.zlevel; + } + var Storage = function () { + this._elements = {}; + this._hoverElements = []; + this._roots = []; + this._shapeList = []; + this._shapeListOffset = 0; + }; + Storage.prototype.iterShape = function (fun, option) { + if (!option) { + option = defaultIterateOption; + } + if (option.hover) { + for (var i = 0, l = this._hoverElements.length; i < l; i++) { + var el = this._hoverElements[i]; + el.updateTransform(); + if (fun(el)) { + return this; + } + } + } + if (option.update) { + this.updateShapeList(); + } + switch (option.normal) { + case 'down': + var l = this._shapeList.length; + while (l--) { + if (fun(this._shapeList[l])) { + return this; + } + } + break; + default: + for (var i = 0, l = this._shapeList.length; i < l; i++) { + if (fun(this._shapeList[i])) { + return this; + } + } + break; + } + return this; + }; + Storage.prototype.getHoverShapes = function (update) { + var hoverElements = []; + for (var i = 0, l = this._hoverElements.length; i < l; i++) { + hoverElements.push(this._hoverElements[i]); + var target = this._hoverElements[i].hoverConnect; + if (target) { + var shape; + target = target instanceof Array ? target : [target]; + for (var j = 0, k = target.length; j < k; j++) { + shape = target[j].id ? target[j] : this.get(target[j]); + if (shape) { + hoverElements.push(shape); + } + } + } + } + hoverElements.sort(shapeCompareFunc); + if (update) { + for (var i = 0, l = hoverElements.length; i < l; i++) { + hoverElements[i].updateTransform(); + } + } + return hoverElements; + }; + Storage.prototype.getShapeList = function (update) { + if (update) { + this.updateShapeList(); + } + return this._shapeList; + }; + Storage.prototype.updateShapeList = function () { + this._shapeListOffset = 0; + for (var i = 0, len = this._roots.length; i < len; i++) { + var root = this._roots[i]; + this._updateAndAddShape(root); + } + this._shapeList.length = this._shapeListOffset; + for (var i = 0, len = this._shapeList.length; i < len; i++) { + this._shapeList[i].__renderidx = i; + } + this._shapeList.sort(shapeCompareFunc); + }; + Storage.prototype._updateAndAddShape = function (el, clipShapes) { + if (el.ignore) { + return; + } + el.updateTransform(); + if (el.type == 'group') { + if (el.clipShape) { + el.clipShape.parent = el; + el.clipShape.updateTransform(); + if (clipShapes) { + clipShapes = clipShapes.slice(); + clipShapes.push(el.clipShape); + } else { + clipShapes = [el.clipShape]; + } + } + for (var i = 0; i < el._children.length; i++) { + var child = el._children[i]; + child.__dirty = el.__dirty || child.__dirty; + this._updateAndAddShape(child, clipShapes); + } + el.__dirty = false; + } else { + el.__clipShapes = clipShapes; + this._shapeList[this._shapeListOffset++] = el; + } + }; + Storage.prototype.mod = function (elId, params) { + var el = this._elements[elId]; + if (el) { + el.modSelf(); + if (params) { + if (params.parent || params._storage || params.__clipShapes) { + var target = {}; + for (var name in params) { + if (name === 'parent' || name === '_storage' || name === '__clipShapes') { + continue; + } + if (params.hasOwnProperty(name)) { + target[name] = params[name]; + } + } + util.merge(el, target, true); + } else { + util.merge(el, params, true); + } + } + } + return this; + }; + Storage.prototype.drift = function (shapeId, dx, dy) { + var shape = this._elements[shapeId]; + if (shape) { + shape.needTransform = true; + if (shape.draggable === 'horizontal') { + dy = 0; + } else if (shape.draggable === 'vertical') { + dx = 0; + } + if (!shape.ondrift || shape.ondrift && !shape.ondrift(dx, dy)) { + shape.drift(dx, dy); + } + } + return this; + }; + Storage.prototype.addHover = function (shape) { + shape.updateNeedTransform(); + this._hoverElements.push(shape); + return this; + }; + Storage.prototype.delHover = function () { + this._hoverElements = []; + return this; + }; + Storage.prototype.hasHoverShape = function () { + return this._hoverElements.length > 0; + }; + Storage.prototype.addRoot = function (el) { + if (el instanceof Group) { + el.addChildrenToStorage(this); + } + this.addToMap(el); + this._roots.push(el); + }; + Storage.prototype.delRoot = function (elId) { + if (typeof elId == 'undefined') { + for (var i = 0; i < this._roots.length; i++) { + var root = this._roots[i]; + if (root instanceof Group) { + root.delChildrenFromStorage(this); + } + } + this._elements = {}; + this._hoverElements = []; + this._roots = []; + this._shapeList = []; + this._shapeListOffset = 0; + return; + } + if (elId instanceof Array) { + for (var i = 0, l = elId.length; i < l; i++) { + this.delRoot(elId[i]); + } + return; + } + var el; + if (typeof elId == 'string') { + el = this._elements[elId]; + } else { + el = elId; + } + var idx = util.indexOf(this._roots, el); + if (idx >= 0) { + this.delFromMap(el.id); + this._roots.splice(idx, 1); + if (el instanceof Group) { + el.delChildrenFromStorage(this); + } + } + }; + Storage.prototype.addToMap = function (el) { + if (el instanceof Group) { + el._storage = this; + } + el.modSelf(); + this._elements[el.id] = el; + return this; + }; + Storage.prototype.get = function (elId) { + return this._elements[elId]; + }; + Storage.prototype.delFromMap = function (elId) { + var el = this._elements[elId]; + if (el) { + delete this._elements[elId]; + if (el instanceof Group) { + el._storage = null; + } + } + return this; + }; + Storage.prototype.dispose = function () { + this._elements = this._renderList = this._roots = this._hoverElements = null; + }; + return Storage; +});define('zrender/animation/Animation', [ + 'require', + './Clip', + '../tool/color', + '../tool/util', + '../tool/event' +], function (require) { + 'use strict'; + var Clip = require('./Clip'); + var color = require('../tool/color'); + var util = require('../tool/util'); + var Dispatcher = require('../tool/event').Dispatcher; + var requestAnimationFrame = window.requestAnimationFrame || window.msRequestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || function (func) { + setTimeout(func, 16); + }; + var arraySlice = Array.prototype.slice; + var Animation = function (options) { + options = options || {}; + this.stage = options.stage || {}; + this.onframe = options.onframe || function () { + }; + this._clips = []; + this._running = false; + this._time = 0; + Dispatcher.call(this); + }; + Animation.prototype = { + add: function (clip) { + this._clips.push(clip); + }, + remove: function (clip) { + var idx = util.indexOf(this._clips, clip); + if (idx >= 0) { + this._clips.splice(idx, 1); + } + }, + _update: function () { + var time = new Date().getTime(); + var delta = time - this._time; + var clips = this._clips; + var len = clips.length; + var deferredEvents = []; + var deferredClips = []; + for (var i = 0; i < len; i++) { + var clip = clips[i]; + var e = clip.step(time); + if (e) { + deferredEvents.push(e); + deferredClips.push(clip); + } + } + for (var i = 0; i < len;) { + if (clips[i]._needsRemove) { + clips[i] = clips[len - 1]; + clips.pop(); + len--; + } else { + i++; + } + } + len = deferredEvents.length; + for (var i = 0; i < len; i++) { + deferredClips[i].fire(deferredEvents[i]); + } + this._time = time; + this.onframe(delta); + this.dispatch('frame', delta); + if (this.stage.update) { + this.stage.update(); + } + }, + start: function () { + var self = this; + this._running = true; + function step() { + if (self._running) { + self._update(); + requestAnimationFrame(step); + } + } + this._time = new Date().getTime(); + requestAnimationFrame(step); + }, + stop: function () { + this._running = false; + }, + clear: function () { + this._clips = []; + }, + animate: function (target, options) { + options = options || {}; + var deferred = new Animator(target, options.loop, options.getter, options.setter); + deferred.animation = this; + return deferred; + }, + constructor: Animation + }; + util.merge(Animation.prototype, Dispatcher.prototype, true); + function _defaultGetter(target, key) { + return target[key]; + } + function _defaultSetter(target, key, value) { + target[key] = value; + } + function _interpolateNumber(p0, p1, percent) { + return (p1 - p0) * percent + p0; + } + function _interpolateArray(p0, p1, percent, out, arrDim) { + var len = p0.length; + if (arrDim == 1) { + for (var i = 0; i < len; i++) { + out[i] = _interpolateNumber(p0[i], p1[i], percent); + } + } else { + var len2 = p0[0].length; + for (var i = 0; i < len; i++) { + for (var j = 0; j < len2; j++) { + out[i][j] = _interpolateNumber(p0[i][j], p1[i][j], percent); + } + } + } + } + function _isArrayLike(data) { + switch (typeof data) { + case 'undefined': + case 'string': + return false; + } + return typeof data.length !== 'undefined'; + } + function _catmullRomInterpolateArray(p0, p1, p2, p3, t, t2, t3, out, arrDim) { + var len = p0.length; + if (arrDim == 1) { + for (var i = 0; i < len; i++) { + out[i] = _catmullRomInterpolate(p0[i], p1[i], p2[i], p3[i], t, t2, t3); + } + } else { + var len2 = p0[0].length; + for (var i = 0; i < len; i++) { + for (var j = 0; j < len2; j++) { + out[i][j] = _catmullRomInterpolate(p0[i][j], p1[i][j], p2[i][j], p3[i][j], t, t2, t3); + } + } + } + } + function _catmullRomInterpolate(p0, p1, p2, p3, t, t2, t3) { + var v0 = (p2 - p0) * 0.5; + var v1 = (p3 - p1) * 0.5; + return (2 * (p1 - p2) + v0 + v1) * t3 + (-3 * (p1 - p2) - 2 * v0 - v1) * t2 + v0 * t + p1; + } + function _cloneValue(value) { + if (_isArrayLike(value)) { + var len = value.length; + if (_isArrayLike(value[0])) { + var ret = []; + for (var i = 0; i < len; i++) { + ret.push(arraySlice.call(value[i])); + } + return ret; + } else { + return arraySlice.call(value); + } + } else { + return value; + } + } + function rgba2String(rgba) { + rgba[0] = Math.floor(rgba[0]); + rgba[1] = Math.floor(rgba[1]); + rgba[2] = Math.floor(rgba[2]); + return 'rgba(' + rgba.join(',') + ')'; + } + var Animator = function (target, loop, getter, setter) { + this._tracks = {}; + this._target = target; + this._loop = loop || false; + this._getter = getter || _defaultGetter; + this._setter = setter || _defaultSetter; + this._clipCount = 0; + this._delay = 0; + this._doneList = []; + this._onframeList = []; + this._clipList = []; + }; + Animator.prototype = { + when: function (time, props) { + for (var propName in props) { + if (!this._tracks[propName]) { + this._tracks[propName] = []; + if (time !== 0) { + this._tracks[propName].push({ + time: 0, + value: _cloneValue(this._getter(this._target, propName)) + }); + } + } + this._tracks[propName].push({ + time: parseInt(time, 10), + value: props[propName] + }); + } + return this; + }, + during: function (callback) { + this._onframeList.push(callback); + return this; + }, + start: function (easing) { + var self = this; + var setter = this._setter; + var getter = this._getter; + var useSpline = easing === 'spline'; + var ondestroy = function () { + self._clipCount--; + if (self._clipCount === 0) { + self._tracks = {}; + var len = self._doneList.length; + for (var i = 0; i < len; i++) { + self._doneList[i].call(self); + } + } + }; + var createTrackClip = function (keyframes, propName) { + var trackLen = keyframes.length; + if (!trackLen) { + return; + } + var firstVal = keyframes[0].value; + var isValueArray = _isArrayLike(firstVal); + var isValueColor = false; + var arrDim = isValueArray && _isArrayLike(firstVal[0]) ? 2 : 1; + keyframes.sort(function (a, b) { + return a.time - b.time; + }); + var trackMaxTime; + if (trackLen) { + trackMaxTime = keyframes[trackLen - 1].time; + } else { + return; + } + var kfPercents = []; + var kfValues = []; + for (var i = 0; i < trackLen; i++) { + kfPercents.push(keyframes[i].time / trackMaxTime); + var value = keyframes[i].value; + if (typeof value == 'string') { + value = color.toArray(value); + if (value.length === 0) { + value[0] = value[1] = value[2] = 0; + value[3] = 1; + } + isValueColor = true; + } + kfValues.push(value); + } + var cacheKey = 0; + var cachePercent = 0; + var start; + var i; + var w; + var p0; + var p1; + var p2; + var p3; + if (isValueColor) { + var rgba = [ + 0, + 0, + 0, + 0 + ]; + } + var onframe = function (target, percent) { + if (percent < cachePercent) { + start = Math.min(cacheKey + 1, trackLen - 1); + for (i = start; i >= 0; i--) { + if (kfPercents[i] <= percent) { + break; + } + } + i = Math.min(i, trackLen - 2); + } else { + for (i = cacheKey; i < trackLen; i++) { + if (kfPercents[i] > percent) { + break; + } + } + i = Math.min(i - 1, trackLen - 2); + } + cacheKey = i; + cachePercent = percent; + var range = kfPercents[i + 1] - kfPercents[i]; + if (range === 0) { + return; + } else { + w = (percent - kfPercents[i]) / range; + } + if (useSpline) { + p1 = kfValues[i]; + p0 = kfValues[i === 0 ? i : i - 1]; + p2 = kfValues[i > trackLen - 2 ? trackLen - 1 : i + 1]; + p3 = kfValues[i > trackLen - 3 ? trackLen - 1 : i + 2]; + if (isValueArray) { + _catmullRomInterpolateArray(p0, p1, p2, p3, w, w * w, w * w * w, getter(target, propName), arrDim); + } else { + var value; + if (isValueColor) { + value = _catmullRomInterpolateArray(p0, p1, p2, p3, w, w * w, w * w * w, rgba, 1); + value = rgba2String(rgba); + } else { + value = _catmullRomInterpolate(p0, p1, p2, p3, w, w * w, w * w * w); + } + setter(target, propName, value); + } + } else { + if (isValueArray) { + _interpolateArray(kfValues[i], kfValues[i + 1], w, getter(target, propName), arrDim); + } else { + var value; + if (isValueColor) { + _interpolateArray(kfValues[i], kfValues[i + 1], w, rgba, 1); + value = rgba2String(rgba); + } else { + value = _interpolateNumber(kfValues[i], kfValues[i + 1], w); + } + setter(target, propName, value); + } + } + for (i = 0; i < self._onframeList.length; i++) { + self._onframeList[i](target, percent); + } + }; + var clip = new Clip({ + target: self._target, + life: trackMaxTime, + loop: self._loop, + delay: self._delay, + onframe: onframe, + ondestroy: ondestroy + }); + if (easing && easing !== 'spline') { + clip.easing = easing; + } + self._clipList.push(clip); + self._clipCount++; + self.animation.add(clip); + }; + for (var propName in this._tracks) { + createTrackClip(this._tracks[propName], propName); + } + return this; + }, + stop: function () { + for (var i = 0; i < this._clipList.length; i++) { + var clip = this._clipList[i]; + this.animation.remove(clip); + } + this._clipList = []; + }, + delay: function (time) { + this._delay = time; + return this; + }, + done: function (cb) { + if (cb) { + this._doneList.push(cb); + } + return this; + } + }; + return Animation; +});define('zrender/tool/vector', [], function () { + var ArrayCtor = typeof Float32Array === 'undefined' ? Array : Float32Array; + var vector = { + create: function (x, y) { + var out = new ArrayCtor(2); + out[0] = x || 0; + out[1] = y || 0; + return out; + }, + copy: function (out, v) { + out[0] = v[0]; + out[1] = v[1]; + return out; + }, + set: function (out, a, b) { + out[0] = a; + out[1] = b; + return out; + }, + add: function (out, v1, v2) { + out[0] = v1[0] + v2[0]; + out[1] = v1[1] + v2[1]; + return out; + }, + scaleAndAdd: function (out, v1, v2, a) { + out[0] = v1[0] + v2[0] * a; + out[1] = v1[1] + v2[1] * a; + return out; + }, + sub: function (out, v1, v2) { + out[0] = v1[0] - v2[0]; + out[1] = v1[1] - v2[1]; + return out; + }, + len: function (v) { + return Math.sqrt(this.lenSquare(v)); + }, + lenSquare: function (v) { + return v[0] * v[0] + v[1] * v[1]; + }, + mul: function (out, v1, v2) { + out[0] = v1[0] * v2[0]; + out[1] = v1[1] * v2[1]; + return out; + }, + div: function (out, v1, v2) { + out[0] = v1[0] / v2[0]; + out[1] = v1[1] / v2[1]; + return out; + }, + dot: function (v1, v2) { + return v1[0] * v2[0] + v1[1] * v2[1]; + }, + scale: function (out, v, s) { + out[0] = v[0] * s; + out[1] = v[1] * s; + return out; + }, + normalize: function (out, v) { + var d = vector.len(v); + if (d === 0) { + out[0] = 0; + out[1] = 0; + } else { + out[0] = v[0] / d; + out[1] = v[1] / d; + } + return out; + }, + distance: function (v1, v2) { + return Math.sqrt((v1[0] - v2[0]) * (v1[0] - v2[0]) + (v1[1] - v2[1]) * (v1[1] - v2[1])); + }, + distanceSquare: function (v1, v2) { + return (v1[0] - v2[0]) * (v1[0] - v2[0]) + (v1[1] - v2[1]) * (v1[1] - v2[1]); + }, + negate: function (out, v) { + out[0] = -v[0]; + out[1] = -v[1]; + return out; + }, + lerp: function (out, v1, v2, t) { + out[0] = v1[0] + t * (v2[0] - v1[0]); + out[1] = v1[1] + t * (v2[1] - v1[1]); + return out; + }, + applyTransform: function (out, v, m) { + var x = v[0]; + var y = v[1]; + out[0] = m[0] * x + m[2] * y + m[4]; + out[1] = m[1] * x + m[3] * y + m[5]; + return out; + }, + min: function (out, v1, v2) { + out[0] = Math.min(v1[0], v2[0]); + out[1] = Math.min(v1[1], v2[1]); + return out; + }, + max: function (out, v1, v2) { + out[0] = Math.max(v1[0], v2[0]); + out[1] = Math.max(v1[1], v2[1]); + return out; + } + }; + vector.length = vector.len; + vector.lengthSquare = vector.lenSquare; + vector.dist = vector.distance; + vector.distSquare = vector.distanceSquare; + return vector; +});define('zrender/tool/matrix', [], function () { + var ArrayCtor = typeof Float32Array === 'undefined' ? Array : Float32Array; + var matrix = { + create: function () { + var out = new ArrayCtor(6); + matrix.identity(out); + return out; + }, + identity: function (out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = 0; + out[5] = 0; + return out; + }, + copy: function (out, m) { + out[0] = m[0]; + out[1] = m[1]; + out[2] = m[2]; + out[3] = m[3]; + out[4] = m[4]; + out[5] = m[5]; + return out; + }, + mul: function (out, m1, m2) { + out[0] = m1[0] * m2[0] + m1[2] * m2[1]; + out[1] = m1[1] * m2[0] + m1[3] * m2[1]; + out[2] = m1[0] * m2[2] + m1[2] * m2[3]; + out[3] = m1[1] * m2[2] + m1[3] * m2[3]; + out[4] = m1[0] * m2[4] + m1[2] * m2[5] + m1[4]; + out[5] = m1[1] * m2[4] + m1[3] * m2[5] + m1[5]; + return out; + }, + translate: function (out, a, v) { + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4] + v[0]; + out[5] = a[5] + v[1]; + return out; + }, + rotate: function (out, a, rad) { + var aa = a[0]; + var ac = a[2]; + var atx = a[4]; + var ab = a[1]; + var ad = a[3]; + var aty = a[5]; + var st = Math.sin(rad); + var ct = Math.cos(rad); + out[0] = aa * ct + ab * st; + out[1] = -aa * st + ab * ct; + out[2] = ac * ct + ad * st; + out[3] = -ac * st + ct * ad; + out[4] = ct * atx + st * aty; + out[5] = ct * aty - st * atx; + return out; + }, + scale: function (out, a, v) { + var vx = v[0]; + var vy = v[1]; + out[0] = a[0] * vx; + out[1] = a[1] * vy; + out[2] = a[2] * vx; + out[3] = a[3] * vy; + out[4] = a[4] * vx; + out[5] = a[5] * vy; + return out; + }, + invert: function (out, a) { + var aa = a[0]; + var ac = a[2]; + var atx = a[4]; + var ab = a[1]; + var ad = a[3]; + var aty = a[5]; + var det = aa * ad - ab * ac; + if (!det) { + return null; + } + det = 1 / det; + out[0] = ad * det; + out[1] = -ab * det; + out[2] = -ac * det; + out[3] = aa * det; + out[4] = (ac * aty - ad * atx) * det; + out[5] = (ab * atx - aa * aty) * det; + return out; + }, + mulVector: function (out, a, v) { + var aa = a[0]; + var ac = a[2]; + var atx = a[4]; + var ab = a[1]; + var ad = a[3]; + var aty = a[5]; + out[0] = v[0] * aa + v[1] * ac + atx; + out[1] = v[0] * ab + v[1] * ad + aty; + return out; + } + }; + return matrix; +});define('zrender/loadingEffect/Base', [ + 'require', + '../tool/util', + '../shape/Text', + '../shape/Rectangle' +], function (require) { + var util = require('../tool/util'); + var TextShape = require('../shape/Text'); + var RectangleShape = require('../shape/Rectangle'); + var DEFAULT_TEXT = 'Loading...'; + var DEFAULT_TEXT_FONT = 'normal 16px Arial'; + function Base(options) { + this.setOptions(options); + } + Base.prototype.createTextShape = function (textStyle) { + return new TextShape({ + highlightStyle: util.merge({ + x: this.canvasWidth / 2, + y: this.canvasHeight / 2, + text: DEFAULT_TEXT, + textAlign: 'center', + textBaseline: 'middle', + textFont: DEFAULT_TEXT_FONT, + color: '#333', + brushType: 'fill' + }, textStyle, true) + }); + }; + Base.prototype.createBackgroundShape = function (color) { + return new RectangleShape({ + highlightStyle: { + x: 0, + y: 0, + width: this.canvasWidth, + height: this.canvasHeight, + brushType: 'fill', + color: color + } + }); + }; + Base.prototype.start = function (painter) { + this.canvasWidth = painter._width; + this.canvasHeight = painter._height; + function addShapeHandle(param) { + painter.storage.addHover(param); + } + function refreshHandle() { + painter.refreshHover(); + } + this.loadingTimer = this._start(addShapeHandle, refreshHandle); + }; + Base.prototype._start = function () { + return setInterval(function () { + }, 10000); + }; + Base.prototype.stop = function () { + clearInterval(this.loadingTimer); + }; + Base.prototype.setOptions = function (options) { + this.options = options || {}; + }; + Base.prototype.adjust = function (value, region) { + if (value <= region[0]) { + value = region[0]; + } else if (value >= region[1]) { + value = region[1]; + } + return value; + }; + Base.prototype.getLocation = function (loc, totalWidth, totalHeight) { + var x = loc.x != null ? loc.x : 'center'; + switch (x) { + case 'center': + x = Math.floor((this.canvasWidth - totalWidth) / 2); + break; + case 'left': + x = 0; + break; + case 'right': + x = this.canvasWidth - totalWidth; + break; + } + var y = loc.y != null ? loc.y : 'center'; + switch (y) { + case 'center': + y = Math.floor((this.canvasHeight - totalHeight) / 2); + break; + case 'top': + y = 0; + break; + case 'bottom': + y = this.canvasHeight - totalHeight; + break; + } + return { + x: x, + y: y, + width: totalWidth, + height: totalHeight + }; + }; + return Base; +});define('zrender/Layer', [ + 'require', + './mixin/Transformable', + './tool/util', + './config' +], function (require) { + var Transformable = require('./mixin/Transformable'); + var util = require('./tool/util'); + var vmlCanvasManager = window['G_vmlCanvasManager']; + var config = require('./config'); + function returnFalse() { + return false; + } + function createDom(id, type, painter) { + var newDom = document.createElement(type); + var width = painter.getWidth(); + var height = painter.getHeight(); + newDom.style.position = 'absolute'; + newDom.style.left = 0; + newDom.style.top = 0; + newDom.style.width = width + 'px'; + newDom.style.height = height + 'px'; + newDom.width = width * config.devicePixelRatio; + newDom.height = height * config.devicePixelRatio; + newDom.setAttribute('data-zr-dom-id', id); + return newDom; + } + var Layer = function (id, painter) { + this.id = id; + this.dom = createDom(id, 'canvas', painter); + this.dom.onselectstart = returnFalse; + this.dom.style['-webkit-user-select'] = 'none'; + this.dom.style['user-select'] = 'none'; + this.dom.style['-webkit-touch-callout'] = 'none'; + this.dom.style['-webkit-tap-highlight-color'] = 'rgba(0,0,0,0)'; + vmlCanvasManager && vmlCanvasManager.initElement(this.dom); + this.domBack = null; + this.ctxBack = null; + this.painter = painter; + this.unusedCount = 0; + this.config = null; + this.dirty = true; + this.elCount = 0; + this.clearColor = 0; + this.motionBlur = false; + this.lastFrameAlpha = 0.7; + this.zoomable = false; + this.panable = false; + this.maxZoom = Infinity; + this.minZoom = 0; + Transformable.call(this); + }; + Layer.prototype.initContext = function () { + this.ctx = this.dom.getContext('2d'); + var dpr = config.devicePixelRatio; + if (dpr != 1) { + this.ctx.scale(dpr, dpr); + } + }; + Layer.prototype.createBackBuffer = function () { + if (vmlCanvasManager) { + return; + } + this.domBack = createDom('back-' + this.id, 'canvas', this.painter); + this.ctxBack = this.domBack.getContext('2d'); + var dpr = config.devicePixelRatio; + if (dpr != 1) { + this.ctxBack.scale(dpr, dpr); + } + }; + Layer.prototype.resize = function (width, height) { + var dpr = config.devicePixelRatio; + this.dom.style.width = width + 'px'; + this.dom.style.height = height + 'px'; + this.dom.setAttribute('width', width * dpr); + this.dom.setAttribute('height', height * dpr); + if (dpr != 1) { + this.ctx.scale(dpr, dpr); + } + if (this.domBack) { + this.domBack.setAttribute('width', width * dpr); + this.domBack.setAttribute('height', height * dpr); + if (dpr != 1) { + this.ctxBack.scale(dpr, dpr); + } + } + }; + Layer.prototype.clear = function () { + var dom = this.dom; + var ctx = this.ctx; + var width = dom.width; + var height = dom.height; + var haveClearColor = this.clearColor && !vmlCanvasManager; + var haveMotionBLur = this.motionBlur && !vmlCanvasManager; + var lastFrameAlpha = this.lastFrameAlpha; + var dpr = config.devicePixelRatio; + if (haveMotionBLur) { + if (!this.domBack) { + this.createBackBuffer(); + } + this.ctxBack.globalCompositeOperation = 'copy'; + this.ctxBack.drawImage(dom, 0, 0, width / dpr, height / dpr); + } + ctx.clearRect(0, 0, width / dpr, height / dpr); + if (haveClearColor) { + ctx.save(); + ctx.fillStyle = this.clearColor; + ctx.fillRect(0, 0, width / dpr, height / dpr); + ctx.restore(); + } + if (haveMotionBLur) { + var domBack = this.domBack; + ctx.save(); + ctx.globalAlpha = lastFrameAlpha; + ctx.drawImage(domBack, 0, 0, width / dpr, height / dpr); + ctx.restore(); + } + }; + util.merge(Layer.prototype, Transformable.prototype); + return Layer; +});define('zrender/shape/Text', [ + 'require', + '../tool/area', + './Base', + '../tool/util' +], function (require) { + var area = require('../tool/area'); + var Base = require('./Base'); + var Text = function (options) { + Base.call(this, options); + }; + Text.prototype = { + type: 'text', + brush: function (ctx, isHighlight) { + var style = this.style; + if (isHighlight) { + style = this.getHighlightStyle(style, this.highlightStyle || {}); + } + if (typeof style.text == 'undefined' || style.text === false) { + return; + } + ctx.save(); + this.doClip(ctx); + this.setContext(ctx, style); + this.setTransform(ctx); + if (style.textFont) { + ctx.font = style.textFont; + } + ctx.textAlign = style.textAlign || 'start'; + ctx.textBaseline = style.textBaseline || 'middle'; + var text = (style.text + '').split('\n'); + var lineHeight = area.getTextHeight('国', style.textFont); + var rect = this.getRect(style); + var x = style.x; + var y; + if (style.textBaseline == 'top') { + y = rect.y; + } else if (style.textBaseline == 'bottom') { + y = rect.y + lineHeight; + } else { + y = rect.y + lineHeight / 2; + } + for (var i = 0, l = text.length; i < l; i++) { + if (style.maxWidth) { + switch (style.brushType) { + case 'fill': + ctx.fillText(text[i], x, y, style.maxWidth); + break; + case 'stroke': + ctx.strokeText(text[i], x, y, style.maxWidth); + break; + case 'both': + ctx.fillText(text[i], x, y, style.maxWidth); + ctx.strokeText(text[i], x, y, style.maxWidth); + break; + default: + ctx.fillText(text[i], x, y, style.maxWidth); + } + } else { + switch (style.brushType) { + case 'fill': + ctx.fillText(text[i], x, y); + break; + case 'stroke': + ctx.strokeText(text[i], x, y); + break; + case 'both': + ctx.fillText(text[i], x, y); + ctx.strokeText(text[i], x, y); + break; + default: + ctx.fillText(text[i], x, y); + } + } + y += lineHeight; + } + ctx.restore(); + return; + }, + getRect: function (style) { + if (style.__rect) { + return style.__rect; + } + var width = area.getTextWidth(style.text, style.textFont); + var height = area.getTextHeight(style.text, style.textFont); + var textX = style.x; + if (style.textAlign == 'end' || style.textAlign == 'right') { + textX -= width; + } else if (style.textAlign == 'center') { + textX -= width / 2; + } + var textY; + if (style.textBaseline == 'top') { + textY = style.y; + } else if (style.textBaseline == 'bottom') { + textY = style.y - height; + } else { + textY = style.y - height / 2; + } + style.__rect = { + x: textX, + y: textY, + width: width, + height: height + }; + return style.__rect; + } + }; + require('../tool/util').inherits(Text, Base); + return Text; +});define('zrender/shape/Rectangle', [ + 'require', + './Base', + '../tool/util' +], function (require) { + var Base = require('./Base'); + var Rectangle = function (options) { + Base.call(this, options); + }; + Rectangle.prototype = { + type: 'rectangle', + _buildRadiusPath: function (ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + var r = style.radius; + var r1; + var r2; + var r3; + var r4; + if (typeof r === 'number') { + r1 = r2 = r3 = r4 = r; + } else if (r instanceof Array) { + if (r.length === 1) { + r1 = r2 = r3 = r4 = r[0]; + } else if (r.length === 2) { + r1 = r3 = r[0]; + r2 = r4 = r[1]; + } else if (r.length === 3) { + r1 = r[0]; + r2 = r4 = r[1]; + r3 = r[2]; + } else { + r1 = r[0]; + r2 = r[1]; + r3 = r[2]; + r4 = r[3]; + } + } else { + r1 = r2 = r3 = r4 = 0; + } + var total; + if (r1 + r2 > width) { + total = r1 + r2; + r1 *= width / total; + r2 *= width / total; + } + if (r3 + r4 > width) { + total = r3 + r4; + r3 *= width / total; + r4 *= width / total; + } + if (r2 + r3 > height) { + total = r2 + r3; + r2 *= height / total; + r3 *= height / total; + } + if (r1 + r4 > height) { + total = r1 + r4; + r1 *= height / total; + r4 *= height / total; + } + ctx.moveTo(x + r1, y); + ctx.lineTo(x + width - r2, y); + r2 !== 0 && ctx.quadraticCurveTo(x + width, y, x + width, y + r2); + ctx.lineTo(x + width, y + height - r3); + r3 !== 0 && ctx.quadraticCurveTo(x + width, y + height, x + width - r3, y + height); + ctx.lineTo(x + r4, y + height); + r4 !== 0 && ctx.quadraticCurveTo(x, y + height, x, y + height - r4); + ctx.lineTo(x, y + r1); + r1 !== 0 && ctx.quadraticCurveTo(x, y, x + r1, y); + }, + buildPath: function (ctx, style) { + if (!style.radius) { + ctx.moveTo(style.x, style.y); + ctx.lineTo(style.x + style.width, style.y); + ctx.lineTo(style.x + style.width, style.y + style.height); + ctx.lineTo(style.x, style.y + style.height); + ctx.lineTo(style.x, style.y); + } else { + this._buildRadiusPath(ctx, style); + } + ctx.closePath(); + return; + }, + getRect: function (style) { + if (style.__rect) { + return style.__rect; + } + var lineWidth; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } else { + lineWidth = 0; + } + style.__rect = { + x: Math.round(style.x - lineWidth / 2), + y: Math.round(style.y - lineWidth / 2), + width: style.width + lineWidth, + height: style.height + lineWidth + }; + return style.__rect; + } + }; + require('../tool/util').inherits(Rectangle, Base); + return Rectangle; +});define('zrender/tool/area', [ + 'require', + './util', + './curve' +], function (require) { + 'use strict'; + var util = require('./util'); + var curve = require('./curve'); + var _ctx; + var _textWidthCache = {}; + var _textHeightCache = {}; + var _textWidthCacheCounter = 0; + var _textHeightCacheCounter = 0; + var TEXT_CACHE_MAX = 5000; + var PI2 = Math.PI * 2; + function normalizeRadian(angle) { + angle %= PI2; + if (angle < 0) { + angle += PI2; + } + return angle; + } + function isInside(shape, area, x, y) { + if (!area || !shape) { + return false; + } + var zoneType = shape.type; + _ctx = _ctx || util.getContext(); + var _mathReturn = _mathMethod(shape, area, x, y); + if (typeof _mathReturn != 'undefined') { + return _mathReturn; + } + if (shape.buildPath && _ctx.isPointInPath) { + return _buildPathMethod(shape, _ctx, area, x, y); + } + switch (zoneType) { + case 'ellipse': + return true; + case 'trochoid': + var _r = area.location == 'out' ? area.r1 + area.r2 + area.d : area.r1 - area.r2 + area.d; + return isInsideCircle(area, x, y, _r); + case 'rose': + return isInsideCircle(area, x, y, area.maxr); + default: + return false; + } + } + function _mathMethod(shape, area, x, y) { + var zoneType = shape.type; + switch (zoneType) { + case 'bezier-curve': + if (typeof area.cpX2 === 'undefined') { + return isInsideQuadraticStroke(area.xStart, area.yStart, area.cpX1, area.cpY1, area.xEnd, area.yEnd, area.lineWidth, x, y); + } + return isInsideCubicStroke(area.xStart, area.yStart, area.cpX1, area.cpY1, area.cpX2, area.cpY2, area.xEnd, area.yEnd, area.lineWidth, x, y); + case 'line': + return isInsideLine(area.xStart, area.yStart, area.xEnd, area.yEnd, area.lineWidth, x, y); + case 'polyline': + return isInsidePolyline(area.pointList, area.lineWidth, x, y); + case 'ring': + return isInsideRing(area.x, area.y, area.r0, area.r, x, y); + case 'circle': + return isInsideCircle(area.x, area.y, area.r, x, y); + case 'sector': + var startAngle = area.startAngle * Math.PI / 180; + var endAngle = area.endAngle * Math.PI / 180; + if (!area.clockWise) { + startAngle = -startAngle; + endAngle = -endAngle; + } + return isInsideSector(area.x, area.y, area.r0, area.r, startAngle, endAngle, !area.clockWise, x, y); + case 'path': + return area.pathArray && isInsidePath(area.pathArray, Math.max(area.lineWidth, 5), area.brushType, x, y); + case 'polygon': + case 'star': + case 'isogon': + return isInsidePolygon(area.pointList, x, y); + case 'text': + var rect = area.__rect || shape.getRect(area); + return isInsideRect(rect.x, rect.y, rect.width, rect.height, x, y); + case 'rectangle': + case 'image': + return isInsideRect(area.x, area.y, area.width, area.height, x, y); + } + } + function _buildPathMethod(shape, context, area, x, y) { + context.beginPath(); + shape.buildPath(context, area); + context.closePath(); + return context.isPointInPath(x, y); + } + function isOutside(shape, area, x, y) { + return !isInside(shape, area, x, y); + } + function isInsideLine(x0, y0, x1, y1, lineWidth, x, y) { + if (lineWidth === 0) { + return false; + } + var _l = Math.max(lineWidth, 5); + var _a = 0; + var _b = x0; + if (y > y0 + _l && y > y1 + _l || y < y0 - _l && y < y1 - _l || x > x0 + _l && x > x1 + _l || x < x0 - _l && x < x1 - _l) { + return false; + } + if (x0 !== x1) { + _a = (y0 - y1) / (x0 - x1); + _b = (x0 * y1 - x1 * y0) / (x0 - x1); + } else { + return Math.abs(x - x0) <= _l / 2; + } + var tmp = _a * x - y + _b; + var _s = tmp * tmp / (_a * _a + 1); + return _s <= _l / 2 * _l / 2; + } + function isInsideCubicStroke(x0, y0, x1, y1, x2, y2, x3, y3, lineWidth, x, y) { + if (lineWidth === 0) { + return false; + } + var _l = Math.max(lineWidth, 5); + if (y > y0 + _l && y > y1 + _l && y > y2 + _l && y > y3 + _l || y < y0 - _l && y < y1 - _l && y < y2 - _l && y < y3 - _l || x > x0 + _l && x > x1 + _l && x > x2 + _l && x > x3 + _l || x < x0 - _l && x < x1 - _l && x < x2 - _l && x < x3 - _l) { + return false; + } + var d = curve.cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, null); + return d <= _l / 2; + } + function isInsideQuadraticStroke(x0, y0, x1, y1, x2, y2, lineWidth, x, y) { + if (lineWidth === 0) { + return false; + } + var _l = Math.max(lineWidth, 5); + if (y > y0 + _l && y > y1 + _l && y > y2 + _l || y < y0 - _l && y < y1 - _l && y < y2 - _l || x > x0 + _l && x > x1 + _l && x > x2 + _l || x < x0 - _l && x < x1 - _l && x < x2 - _l) { + return false; + } + var d = curve.quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, null); + return d <= _l / 2; + } + function isInsideArcStroke(cx, cy, r, startAngle, endAngle, anticlockwise, lineWidth, x, y) { + if (lineWidth === 0) { + return false; + } + var _l = Math.max(lineWidth, 5); + x -= cx; + y -= cy; + var d = Math.sqrt(x * x + y * y); + if (d - _l > r || d + _l < r) { + return false; + } + if (Math.abs(startAngle - endAngle) >= PI2) { + return true; + } + if (anticlockwise) { + var tmp = startAngle; + startAngle = normalizeRadian(endAngle); + endAngle = normalizeRadian(tmp); + } else { + startAngle = normalizeRadian(startAngle); + endAngle = normalizeRadian(endAngle); + } + if (startAngle > endAngle) { + endAngle += PI2; + } + var angle = Math.atan2(y, x); + if (angle < 0) { + angle += PI2; + } + return angle >= startAngle && angle <= endAngle || angle + PI2 >= startAngle && angle + PI2 <= endAngle; + } + function isInsidePolyline(points, lineWidth, x, y) { + var lineWidth = Math.max(lineWidth, 10); + for (var i = 0, l = points.length - 1; i < l; i++) { + var x0 = points[i][0]; + var y0 = points[i][1]; + var x1 = points[i + 1][0]; + var y1 = points[i + 1][1]; + if (isInsideLine(x0, y0, x1, y1, lineWidth, x, y)) { + return true; + } + } + return false; + } + function isInsideRing(cx, cy, r0, r, x, y) { + var d = (x - cx) * (x - cx) + (y - cy) * (y - cy); + return d < r * r && d > r0 * r0; + } + function isInsideRect(x0, y0, width, height, x, y) { + return x >= x0 && x <= x0 + width && y >= y0 && y <= y0 + height; + } + function isInsideCircle(x0, y0, r, x, y) { + return (x - x0) * (x - x0) + (y - y0) * (y - y0) < r * r; + } + function isInsideSector(cx, cy, r0, r, startAngle, endAngle, anticlockwise, x, y) { + return isInsideArcStroke(cx, cy, (r0 + r) / 2, startAngle, endAngle, anticlockwise, r - r0, x, y); + } + function isInsidePolygon(points, x, y) { + var N = points.length; + var w = 0; + for (var i = 0, j = N - 1; i < N; i++) { + var x0 = points[j][0]; + var y0 = points[j][1]; + var x1 = points[i][0]; + var y1 = points[i][1]; + w += windingLine(x0, y0, x1, y1, x, y); + j = i; + } + return w !== 0; + } + function windingLine(x0, y0, x1, y1, x, y) { + if (y > y0 && y > y1 || y < y0 && y < y1) { + return 0; + } + if (y1 == y0) { + return 0; + } + var dir = y1 < y0 ? 1 : -1; + var t = (y - y0) / (y1 - y0); + var x_ = t * (x1 - x0) + x0; + return x_ > x ? dir : 0; + } + var roots = [ + -1, + -1, + -1 + ]; + var extrema = [ + -1, + -1 + ]; + function swapExtrema() { + var tmp = extrema[0]; + extrema[0] = extrema[1]; + extrema[1] = tmp; + } + function windingCubic(x0, y0, x1, y1, x2, y2, x3, y3, x, y) { + if (y > y0 && y > y1 && y > y2 && y > y3 || y < y0 && y < y1 && y < y2 && y < y3) { + return 0; + } + var nRoots = curve.cubicRootAt(y0, y1, y2, y3, y, roots); + if (nRoots === 0) { + return 0; + } else { + var w = 0; + var nExtrema = -1; + var y0_, y1_; + for (var i = 0; i < nRoots; i++) { + var t = roots[i]; + var x_ = curve.cubicAt(x0, x1, x2, x3, t); + if (x_ < x) { + continue; + } + if (nExtrema < 0) { + nExtrema = curve.cubicExtrema(y0, y1, y2, y3, extrema); + if (extrema[1] < extrema[0] && nExtrema > 1) { + swapExtrema(); + } + y0_ = curve.cubicAt(y0, y1, y2, y3, extrema[0]); + if (nExtrema > 1) { + y1_ = curve.cubicAt(y0, y1, y2, y3, extrema[1]); + } + } + if (nExtrema == 2) { + if (t < extrema[0]) { + w += y0_ < y0 ? 1 : -1; + } else if (t < extrema[1]) { + w += y1_ < y0_ ? 1 : -1; + } else { + w += y3 < y1_ ? 1 : -1; + } + } else { + if (t < extrema[0]) { + w += y0_ < y0 ? 1 : -1; + } else { + w += y3 < y0_ ? 1 : -1; + } + } + } + return w; + } + } + function windingQuadratic(x0, y0, x1, y1, x2, y2, x, y) { + if (y > y0 && y > y1 && y > y2 || y < y0 && y < y1 && y < y2) { + return 0; + } + var nRoots = curve.quadraticRootAt(y0, y1, y2, y, roots); + if (nRoots === 0) { + return 0; + } else { + var t = curve.quadraticExtremum(y0, y1, y2); + if (t >= 0 && t <= 1) { + var w = 0; + var y_ = curve.quadraticAt(y0, y1, y2, t); + for (var i = 0; i < nRoots; i++) { + var x_ = curve.quadraticAt(x0, x1, x2, roots[i]); + if (x_ > x) { + continue; + } + if (roots[i] < t) { + w += y_ < y0 ? 1 : -1; + } else { + w += y2 < y_ ? 1 : -1; + } + } + return w; + } else { + var x_ = curve.quadraticAt(x0, x1, x2, roots[0]); + if (x_ > x) { + return 0; + } + return y2 < y0 ? 1 : -1; + } + } + } + function windingArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y) { + y -= cy; + if (y > r || y < -r) { + return 0; + } + var tmp = Math.sqrt(r * r - y * y); + roots[0] = -tmp; + roots[1] = tmp; + if (Math.abs(startAngle - endAngle) >= PI2) { + startAngle = 0; + endAngle = PI2; + var dir = anticlockwise ? 1 : -1; + if (x >= roots[0] + cx && x <= roots[1] + cx) { + return dir; + } else { + return 0; + } + } + if (anticlockwise) { + var tmp = startAngle; + startAngle = normalizeRadian(endAngle); + endAngle = normalizeRadian(tmp); + } else { + startAngle = normalizeRadian(startAngle); + endAngle = normalizeRadian(endAngle); + } + if (startAngle > endAngle) { + endAngle += PI2; + } + var w = 0; + for (var i = 0; i < 2; i++) { + var x_ = roots[i]; + if (x_ + cx > x) { + var angle = Math.atan2(y, x_); + var dir = anticlockwise ? 1 : -1; + if (angle < 0) { + angle = PI2 + angle; + } + if (angle >= startAngle && angle <= endAngle || angle + PI2 >= startAngle && angle + PI2 <= endAngle) { + if (angle > Math.PI / 2 && angle < Math.PI * 1.5) { + dir = -dir; + } + w += dir; + } + } + } + return w; + } + function isInsidePath(pathArray, lineWidth, brushType, x, y) { + var w = 0; + var xi = 0; + var yi = 0; + var x0 = 0; + var y0 = 0; + var beginSubpath = true; + var firstCmd = true; + brushType = brushType || 'fill'; + var hasStroke = brushType === 'stroke' || brushType === 'both'; + var hasFill = brushType === 'fill' || brushType === 'both'; + for (var i = 0; i < pathArray.length; i++) { + var seg = pathArray[i]; + var p = seg.points; + if (beginSubpath || seg.command === 'M') { + if (i > 0) { + if (hasFill) { + w += windingLine(xi, yi, x0, y0, x, y); + } + if (w !== 0) { + return true; + } + } + x0 = p[p.length - 2]; + y0 = p[p.length - 1]; + beginSubpath = false; + if (firstCmd && seg.command !== 'A') { + firstCmd = false; + xi = x0; + yi = y0; + } + } + switch (seg.command) { + case 'M': + xi = p[0]; + yi = p[1]; + break; + case 'L': + if (hasStroke) { + if (isInsideLine(xi, yi, p[0], p[1], lineWidth, x, y)) { + return true; + } + } + if (hasFill) { + w += windingLine(xi, yi, p[0], p[1], x, y); + } + xi = p[0]; + yi = p[1]; + break; + case 'C': + if (hasStroke) { + if (isInsideCubicStroke(xi, yi, p[0], p[1], p[2], p[3], p[4], p[5], lineWidth, x, y)) { + return true; + } + } + if (hasFill) { + w += windingCubic(xi, yi, p[0], p[1], p[2], p[3], p[4], p[5], x, y); + } + xi = p[4]; + yi = p[5]; + break; + case 'Q': + if (hasStroke) { + if (isInsideQuadraticStroke(xi, yi, p[0], p[1], p[2], p[3], lineWidth, x, y)) { + return true; + } + } + if (hasFill) { + w += windingQuadratic(xi, yi, p[0], p[1], p[2], p[3], x, y); + } + xi = p[2]; + yi = p[3]; + break; + case 'A': + var cx = p[0]; + var cy = p[1]; + var rx = p[2]; + var ry = p[3]; + var theta = p[4]; + var dTheta = p[5]; + var x1 = Math.cos(theta) * rx + cx; + var y1 = Math.sin(theta) * ry + cy; + if (!firstCmd) { + w += windingLine(xi, yi, x1, y1); + } else { + firstCmd = false; + x0 = x1; + y0 = y1; + } + var _x = (x - cx) * ry / rx + cx; + if (hasStroke) { + if (isInsideArcStroke(cx, cy, ry, theta, theta + dTheta, 1 - p[7], lineWidth, _x, y)) { + return true; + } + } + if (hasFill) { + w += windingArc(cx, cy, ry, theta, theta + dTheta, 1 - p[7], _x, y); + } + xi = Math.cos(theta + dTheta) * rx + cx; + yi = Math.sin(theta + dTheta) * ry + cy; + break; + case 'z': + if (hasStroke) { + if (isInsideLine(xi, yi, x0, y0, lineWidth, x, y)) { + return true; + } + } + beginSubpath = true; + break; + } + } + if (hasFill) { + w += windingLine(xi, yi, x0, y0, x, y); + } + return w !== 0; + } + function getTextWidth(text, textFont) { + var key = text + ':' + textFont; + if (_textWidthCache[key]) { + return _textWidthCache[key]; + } + _ctx = _ctx || util.getContext(); + _ctx.save(); + if (textFont) { + _ctx.font = textFont; + } + text = (text + '').split('\n'); + var width = 0; + for (var i = 0, l = text.length; i < l; i++) { + width = Math.max(_ctx.measureText(text[i]).width, width); + } + _ctx.restore(); + _textWidthCache[key] = width; + if (++_textWidthCacheCounter > TEXT_CACHE_MAX) { + _textWidthCacheCounter = 0; + _textWidthCache = {}; + } + return width; + } + function getTextHeight(text, textFont) { + var key = text + ':' + textFont; + if (_textHeightCache[key]) { + return _textHeightCache[key]; + } + _ctx = _ctx || util.getContext(); + _ctx.save(); + if (textFont) { + _ctx.font = textFont; + } + text = (text + '').split('\n'); + var height = (_ctx.measureText('国').width + 2) * text.length; + _ctx.restore(); + _textHeightCache[key] = height; + if (++_textHeightCacheCounter > TEXT_CACHE_MAX) { + _textHeightCacheCounter = 0; + _textHeightCache = {}; + } + return height; + } + return { + isInside: isInside, + isOutside: isOutside, + getTextWidth: getTextWidth, + getTextHeight: getTextHeight, + isInsidePath: isInsidePath, + isInsidePolygon: isInsidePolygon, + isInsideSector: isInsideSector, + isInsideCircle: isInsideCircle, + isInsideLine: isInsideLine, + isInsideRect: isInsideRect, + isInsidePolyline: isInsidePolyline, + isInsideCubicStroke: isInsideCubicStroke, + isInsideQuadraticStroke: isInsideQuadraticStroke + }; +});define('zrender/shape/Base', [ + 'require', + '../tool/matrix', + '../tool/guid', + '../tool/util', + '../tool/log', + '../mixin/Transformable', + '../mixin/Eventful', + '../tool/area', + '../tool/color' +], function (require) { + var vmlCanvasManager = window['G_vmlCanvasManager']; + var matrix = require('../tool/matrix'); + var guid = require('../tool/guid'); + var util = require('../tool/util'); + var log = require('../tool/log'); + var Transformable = require('../mixin/Transformable'); + var Eventful = require('../mixin/Eventful'); + function _fillText(ctx, text, x, y, textFont, textAlign, textBaseline) { + if (textFont) { + ctx.font = textFont; + } + ctx.textAlign = textAlign; + ctx.textBaseline = textBaseline; + var rect = _getTextRect(text, x, y, textFont, textAlign, textBaseline); + text = (text + '').split('\n'); + var lineHeight = require('../tool/area').getTextHeight('国', textFont); + switch (textBaseline) { + case 'top': + y = rect.y; + break; + case 'bottom': + y = rect.y + lineHeight; + break; + default: + y = rect.y + lineHeight / 2; + } + for (var i = 0, l = text.length; i < l; i++) { + ctx.fillText(text[i], x, y); + y += lineHeight; + } + } + function _getTextRect(text, x, y, textFont, textAlign, textBaseline) { + var area = require('../tool/area'); + var width = area.getTextWidth(text, textFont); + var lineHeight = area.getTextHeight('国', textFont); + text = (text + '').split('\n'); + switch (textAlign) { + case 'end': + case 'right': + x -= width; + break; + case 'center': + x -= width / 2; + break; + } + switch (textBaseline) { + case 'top': + break; + case 'bottom': + y -= lineHeight * text.length; + break; + default: + y -= lineHeight * text.length / 2; + } + return { + x: x, + y: y, + width: width, + height: lineHeight * text.length + }; + } + var Base = function (options) { + options = options || {}; + this.id = options.id || guid(); + for (var key in options) { + this[key] = options[key]; + } + this.style = this.style || {}; + this.highlightStyle = this.highlightStyle || null; + this.parent = null; + this.__dirty = true; + this.__clipShapes = []; + Transformable.call(this); + Eventful.call(this); + }; + Base.prototype.invisible = false; + Base.prototype.ignore = false; + Base.prototype.zlevel = 0; + Base.prototype.draggable = false; + Base.prototype.clickable = false; + Base.prototype.hoverable = true; + Base.prototype.z = 0; + Base.prototype.brush = function (ctx, isHighlight) { + var style = this.beforeBrush(ctx, isHighlight); + ctx.beginPath(); + this.buildPath(ctx, style); + switch (style.brushType) { + case 'both': + ctx.fill(); + case 'stroke': + style.lineWidth > 0 && ctx.stroke(); + break; + default: + ctx.fill(); + } + this.drawText(ctx, style, this.style); + this.afterBrush(ctx); + }; + Base.prototype.beforeBrush = function (ctx, isHighlight) { + var style = this.style; + if (this.brushTypeOnly) { + style.brushType = this.brushTypeOnly; + } + if (isHighlight) { + style = this.getHighlightStyle(style, this.highlightStyle || {}, this.brushTypeOnly); + } + if (this.brushTypeOnly == 'stroke') { + style.strokeColor = style.strokeColor || style.color; + } + ctx.save(); + this.doClip(ctx); + this.setContext(ctx, style); + this.setTransform(ctx); + return style; + }; + Base.prototype.afterBrush = function (ctx) { + ctx.restore(); + }; + var STYLE_CTX_MAP = [ + [ + 'color', + 'fillStyle' + ], + [ + 'strokeColor', + 'strokeStyle' + ], + [ + 'opacity', + 'globalAlpha' + ], + [ + 'lineCap', + 'lineCap' + ], + [ + 'lineJoin', + 'lineJoin' + ], + [ + 'miterLimit', + 'miterLimit' + ], + [ + 'lineWidth', + 'lineWidth' + ], + [ + 'shadowBlur', + 'shadowBlur' + ], + [ + 'shadowColor', + 'shadowColor' + ], + [ + 'shadowOffsetX', + 'shadowOffsetX' + ], + [ + 'shadowOffsetY', + 'shadowOffsetY' + ] + ]; + Base.prototype.setContext = function (ctx, style) { + for (var i = 0, len = STYLE_CTX_MAP.length; i < len; i++) { + var styleProp = STYLE_CTX_MAP[i][0]; + var styleValue = style[styleProp]; + var ctxProp = STYLE_CTX_MAP[i][1]; + if (typeof styleValue != 'undefined') { + ctx[ctxProp] = styleValue; + } + } + }; + var clipShapeInvTransform = matrix.create(); + Base.prototype.doClip = function (ctx) { + if (this.__clipShapes && !vmlCanvasManager) { + for (var i = 0; i < this.__clipShapes.length; i++) { + var clipShape = this.__clipShapes[i]; + if (clipShape.needTransform) { + var m = clipShape.transform; + matrix.invert(clipShapeInvTransform, m); + ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]); + } + ctx.beginPath(); + clipShape.buildPath(ctx, clipShape.style); + ctx.clip(); + if (clipShape.needTransform) { + var m = clipShapeInvTransform; + ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]); + } + } + } + }; + Base.prototype.getHighlightStyle = function (style, highlightStyle, brushTypeOnly) { + var newStyle = {}; + for (var k in style) { + newStyle[k] = style[k]; + } + var color = require('../tool/color'); + var highlightColor = color.getHighlightColor(); + if (style.brushType != 'stroke') { + newStyle.strokeColor = highlightColor; + newStyle.lineWidth = (style.lineWidth || 1) + this.getHighlightZoom(); + newStyle.brushType = 'both'; + } else { + if (brushTypeOnly != 'stroke') { + newStyle.strokeColor = highlightColor; + newStyle.lineWidth = (style.lineWidth || 1) + this.getHighlightZoom(); + } else { + newStyle.strokeColor = highlightStyle.strokeColor || color.mix(style.strokeColor, color.toRGB(highlightColor)); + } + } + for (var k in highlightStyle) { + if (typeof highlightStyle[k] != 'undefined') { + newStyle[k] = highlightStyle[k]; + } + } + return newStyle; + }; + Base.prototype.getHighlightZoom = function () { + return this.type != 'text' ? 6 : 2; + }; + Base.prototype.drift = function (dx, dy) { + this.position[0] += dx; + this.position[1] += dy; + }; + Base.prototype.getTansform = function () { + var invTransform = []; + return function (x, y) { + var originPos = [ + x, + y + ]; + if (this.needTransform && this.transform) { + matrix.invert(invTransform, this.transform); + matrix.mulVector(originPos, invTransform, [ + x, + y, + 1 + ]); + if (x == originPos[0] && y == originPos[1]) { + this.updateNeedTransform(); + } + } + return originPos; + }; + }(); + Base.prototype.buildPath = function (ctx, style) { + log('buildPath not implemented in ' + this.type); + }; + Base.prototype.getRect = function (style) { + log('getRect not implemented in ' + this.type); + }; + Base.prototype.isCover = function (x, y) { + var originPos = this.getTansform(x, y); + x = originPos[0]; + y = originPos[1]; + var rect = this.style.__rect; + if (!rect) { + rect = this.style.__rect = this.getRect(this.style); + } + if (x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height) { + return require('../tool/area').isInside(this, this.style, x, y); + } + return false; + }; + Base.prototype.drawText = function (ctx, style, normalStyle) { + if (typeof style.text == 'undefined' || style.text === false) { + return; + } + var textColor = style.textColor || style.color || style.strokeColor; + ctx.fillStyle = textColor; + var dd = 10; + var al; + var bl; + var tx; + var ty; + var textPosition = style.textPosition || this.textPosition || 'top'; + switch (textPosition) { + case 'inside': + case 'top': + case 'bottom': + case 'left': + case 'right': + if (this.getRect) { + var rect = (normalStyle || style).__rect || this.getRect(normalStyle || style); + switch (textPosition) { + case 'inside': + tx = rect.x + rect.width / 2; + ty = rect.y + rect.height / 2; + al = 'center'; + bl = 'middle'; + if (style.brushType != 'stroke' && textColor == style.color) { + ctx.fillStyle = '#fff'; + } + break; + case 'left': + tx = rect.x - dd; + ty = rect.y + rect.height / 2; + al = 'end'; + bl = 'middle'; + break; + case 'right': + tx = rect.x + rect.width + dd; + ty = rect.y + rect.height / 2; + al = 'start'; + bl = 'middle'; + break; + case 'top': + tx = rect.x + rect.width / 2; + ty = rect.y - dd; + al = 'center'; + bl = 'bottom'; + break; + case 'bottom': + tx = rect.x + rect.width / 2; + ty = rect.y + rect.height + dd; + al = 'center'; + bl = 'top'; + break; + } + } + break; + case 'start': + case 'end': + var pointList = style.pointList || [ + [ + style.xStart || 0, + style.yStart || 0 + ], + [ + style.xEnd || 0, + style.yEnd || 0 + ] + ]; + var length = pointList.length; + if (length < 2) { + return; + } + var xStart; + var xEnd; + var yStart; + var yEnd; + switch (textPosition) { + case 'start': + xStart = pointList[1][0]; + xEnd = pointList[0][0]; + yStart = pointList[1][1]; + yEnd = pointList[0][1]; + break; + case 'end': + xStart = pointList[length - 2][0]; + xEnd = pointList[length - 1][0]; + yStart = pointList[length - 2][1]; + yEnd = pointList[length - 1][1]; + break; + } + tx = xEnd; + ty = yEnd; + var angle = Math.atan((yStart - yEnd) / (xEnd - xStart)) / Math.PI * 180; + if (xEnd - xStart < 0) { + angle += 180; + } else if (yStart - yEnd < 0) { + angle += 360; + } + dd = 5; + if (angle >= 30 && angle <= 150) { + al = 'center'; + bl = 'bottom'; + ty -= dd; + } else if (angle > 150 && angle < 210) { + al = 'right'; + bl = 'middle'; + tx -= dd; + } else if (angle >= 210 && angle <= 330) { + al = 'center'; + bl = 'top'; + ty += dd; + } else { + al = 'left'; + bl = 'middle'; + tx += dd; + } + break; + case 'specific': + tx = style.textX || 0; + ty = style.textY || 0; + al = 'start'; + bl = 'middle'; + break; + } + if (tx != null && ty != null) { + _fillText(ctx, style.text, tx, ty, style.textFont, style.textAlign || al, style.textBaseline || bl); + } + }; + Base.prototype.modSelf = function () { + this.__dirty = true; + if (this.style) { + this.style.__rect = null; + } + if (this.highlightStyle) { + this.highlightStyle.__rect = null; + } + }; + Base.prototype.isSilent = function () { + return !(this.hoverable || this.draggable || this.clickable || this.onmousemove || this.onmouseover || this.onmouseout || this.onmousedown || this.onmouseup || this.onclick || this.ondragenter || this.ondragover || this.ondragleave || this.ondrop); + }; + util.merge(Base.prototype, Transformable.prototype, true); + util.merge(Base.prototype, Eventful.prototype, true); + return Base; +});define('zrender/tool/curve', [ + 'require', + './vector' +], function (require) { + var vector = require('./vector'); + 'use strict'; + var EPSILON = 0.0001; + var THREE_SQRT = Math.sqrt(3); + var ONE_THIRD = 1 / 3; + var _v0 = vector.create(); + var _v1 = vector.create(); + var _v2 = vector.create(); + function isAroundZero(val) { + return val > -EPSILON && val < EPSILON; + } + function isNotAroundZero(val) { + return val > EPSILON || val < -EPSILON; + } + function cubicAt(p0, p1, p2, p3, t) { + var onet = 1 - t; + return onet * onet * (onet * p0 + 3 * t * p1) + t * t * (t * p3 + 3 * onet * p2); + } + function cubicDerivativeAt(p0, p1, p2, p3, t) { + var onet = 1 - t; + return 3 * (((p1 - p0) * onet + 2 * (p2 - p1) * t) * onet + (p3 - p2) * t * t); + } + function cubicRootAt(p0, p1, p2, p3, val, roots) { + var a = p3 + 3 * (p1 - p2) - p0; + var b = 3 * (p2 - p1 * 2 + p0); + var c = 3 * (p1 - p0); + var d = p0 - val; + var A = b * b - 3 * a * c; + var B = b * c - 9 * a * d; + var C = c * c - 3 * b * d; + var n = 0; + if (isAroundZero(A) && isAroundZero(B)) { + if (isAroundZero(b)) { + roots[0] = 0; + } else { + var t1 = -c / b; + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + } + } else { + var disc = B * B - 4 * A * C; + if (isAroundZero(disc)) { + var K = B / A; + var t1 = -b / a + K; + var t2 = -K / 2; + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + if (t2 >= 0 && t2 <= 1) { + roots[n++] = t2; + } + } else if (disc > 0) { + var discSqrt = Math.sqrt(disc); + var Y1 = A * b + 1.5 * a * (-B + discSqrt); + var Y2 = A * b + 1.5 * a * (-B - discSqrt); + if (Y1 < 0) { + Y1 = -Math.pow(-Y1, ONE_THIRD); + } else { + Y1 = Math.pow(Y1, ONE_THIRD); + } + if (Y2 < 0) { + Y2 = -Math.pow(-Y2, ONE_THIRD); + } else { + Y2 = Math.pow(Y2, ONE_THIRD); + } + var t1 = (-b - (Y1 + Y2)) / (3 * a); + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + } else { + var T = (2 * A * b - 3 * a * B) / (2 * Math.sqrt(A * A * A)); + var theta = Math.acos(T) / 3; + var ASqrt = Math.sqrt(A); + var tmp = Math.cos(theta); + var t1 = (-b - 2 * ASqrt * tmp) / (3 * a); + var t2 = (-b + ASqrt * (tmp + THREE_SQRT * Math.sin(theta))) / (3 * a); + var t3 = (-b + ASqrt * (tmp - THREE_SQRT * Math.sin(theta))) / (3 * a); + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + if (t2 >= 0 && t2 <= 1) { + roots[n++] = t2; + } + if (t3 >= 0 && t3 <= 1) { + roots[n++] = t3; + } + } + } + return n; + } + function cubicExtrema(p0, p1, p2, p3, extrema) { + var b = 6 * p2 - 12 * p1 + 6 * p0; + var a = 9 * p1 + 3 * p3 - 3 * p0 - 9 * p2; + var c = 3 * p1 - 3 * p0; + var n = 0; + if (isAroundZero(a)) { + if (isNotAroundZero(b)) { + var t1 = -c / b; + if (t1 >= 0 && t1 <= 1) { + extrema[n++] = t1; + } + } + } else { + var disc = b * b - 4 * a * c; + if (isAroundZero(disc)) { + extrema[0] = -b / (2 * a); + } else if (disc > 0) { + var discSqrt = Math.sqrt(disc); + var t1 = (-b + discSqrt) / (2 * a); + var t2 = (-b - discSqrt) / (2 * a); + if (t1 >= 0 && t1 <= 1) { + extrema[n++] = t1; + } + if (t2 >= 0 && t2 <= 1) { + extrema[n++] = t2; + } + } + } + return n; + } + function cubicSubdivide(p0, p1, p2, p3, t, out) { + var p01 = (p1 - p0) * t + p0; + var p12 = (p2 - p1) * t + p1; + var p23 = (p3 - p2) * t + p2; + var p012 = (p12 - p01) * t + p01; + var p123 = (p23 - p12) * t + p12; + var p0123 = (p123 - p012) * t + p012; + out[0] = p0; + out[1] = p01; + out[2] = p012; + out[3] = p0123; + out[4] = p0123; + out[5] = p123; + out[6] = p23; + out[7] = p3; + } + function cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, out) { + var t; + var interval = 0.005; + var d = Infinity; + _v0[0] = x; + _v0[1] = y; + for (var _t = 0; _t < 1; _t += 0.05) { + _v1[0] = cubicAt(x0, x1, x2, x3, _t); + _v1[1] = cubicAt(y0, y1, y2, y3, _t); + var d1 = vector.distSquare(_v0, _v1); + if (d1 < d) { + t = _t; + d = d1; + } + } + d = Infinity; + for (var i = 0; i < 32; i++) { + if (interval < EPSILON) { + break; + } + var prev = t - interval; + var next = t + interval; + _v1[0] = cubicAt(x0, x1, x2, x3, prev); + _v1[1] = cubicAt(y0, y1, y2, y3, prev); + var d1 = vector.distSquare(_v1, _v0); + if (prev >= 0 && d1 < d) { + t = prev; + d = d1; + } else { + _v2[0] = cubicAt(x0, x1, x2, x3, next); + _v2[1] = cubicAt(y0, y1, y2, y3, next); + var d2 = vector.distSquare(_v2, _v0); + if (next <= 1 && d2 < d) { + t = next; + d = d2; + } else { + interval *= 0.5; + } + } + } + if (out) { + out[0] = cubicAt(x0, x1, x2, x3, t); + out[1] = cubicAt(y0, y1, y2, y3, t); + } + return Math.sqrt(d); + } + function quadraticAt(p0, p1, p2, t) { + var onet = 1 - t; + return onet * (onet * p0 + 2 * t * p1) + t * t * p2; + } + function quadraticDerivativeAt(p0, p1, p2, t) { + return 2 * ((1 - t) * (p1 - p0) + t * (p2 - p1)); + } + function quadraticRootAt(p0, p1, p2, val, roots) { + var a = p0 - 2 * p1 + p2; + var b = 2 * (p1 - p0); + var c = p0 - val; + var n = 0; + if (isAroundZero(a)) { + if (isNotAroundZero(b)) { + var t1 = -c / b; + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + } + } else { + var disc = b * b - 4 * a * c; + if (isAroundZero(disc)) { + var t1 = -b / (2 * a); + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + } else if (disc > 0) { + var discSqrt = Math.sqrt(disc); + var t1 = (-b + discSqrt) / (2 * a); + var t2 = (-b - discSqrt) / (2 * a); + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + if (t2 >= 0 && t2 <= 1) { + roots[n++] = t2; + } + } + } + return n; + } + function quadraticExtremum(p0, p1, p2) { + var divider = p0 + p2 - 2 * p1; + if (divider === 0) { + return 0.5; + } else { + return (p0 - p1) / divider; + } + } + function quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, out) { + var t; + var interval = 0.005; + var d = Infinity; + _v0[0] = x; + _v0[1] = y; + for (var _t = 0; _t < 1; _t += 0.05) { + _v1[0] = quadraticAt(x0, x1, x2, _t); + _v1[1] = quadraticAt(y0, y1, y2, _t); + var d1 = vector.distSquare(_v0, _v1); + if (d1 < d) { + t = _t; + d = d1; + } + } + d = Infinity; + for (var i = 0; i < 32; i++) { + if (interval < EPSILON) { + break; + } + var prev = t - interval; + var next = t + interval; + _v1[0] = quadraticAt(x0, x1, x2, prev); + _v1[1] = quadraticAt(y0, y1, y2, prev); + var d1 = vector.distSquare(_v1, _v0); + if (prev >= 0 && d1 < d) { + t = prev; + d = d1; + } else { + _v2[0] = quadraticAt(x0, x1, x2, next); + _v2[1] = quadraticAt(y0, y1, y2, next); + var d2 = vector.distSquare(_v2, _v0); + if (next <= 1 && d2 < d) { + t = next; + d = d2; + } else { + interval *= 0.5; + } + } + } + if (out) { + out[0] = quadraticAt(x0, x1, x2, t); + out[1] = quadraticAt(y0, y1, y2, t); + } + return Math.sqrt(d); + } + return { + cubicAt: cubicAt, + cubicDerivativeAt: cubicDerivativeAt, + cubicRootAt: cubicRootAt, + cubicExtrema: cubicExtrema, + cubicSubdivide: cubicSubdivide, + cubicProjectPoint: cubicProjectPoint, + quadraticAt: quadraticAt, + quadraticDerivativeAt: quadraticDerivativeAt, + quadraticRootAt: quadraticRootAt, + quadraticExtremum: quadraticExtremum, + quadraticProjectPoint: quadraticProjectPoint + }; +});define('zrender/mixin/Transformable', [ + 'require', + '../tool/matrix', + '../tool/vector' +], function (require) { + 'use strict'; + var matrix = require('../tool/matrix'); + var vector = require('../tool/vector'); + var origin = [ + 0, + 0 + ]; + var EPSILON = 0.00005; + function isAroundZero(val) { + return val > -EPSILON && val < EPSILON; + } + function isNotAroundZero(val) { + return val > EPSILON || val < -EPSILON; + } + var Transformable = function () { + if (!this.position) { + this.position = [ + 0, + 0 + ]; + } + if (typeof this.rotation == 'undefined') { + this.rotation = [ + 0, + 0, + 0 + ]; + } + if (!this.scale) { + this.scale = [ + 1, + 1, + 0, + 0 + ]; + } + this.needLocalTransform = false; + this.needTransform = false; + }; + Transformable.prototype = { + constructor: Transformable, + updateNeedTransform: function () { + this.needLocalTransform = isNotAroundZero(this.rotation[0]) || isNotAroundZero(this.position[0]) || isNotAroundZero(this.position[1]) || isNotAroundZero(this.scale[0] - 1) || isNotAroundZero(this.scale[1] - 1); + }, + updateTransform: function () { + this.updateNeedTransform(); + if (this.parent) { + this.needTransform = this.needLocalTransform || this.parent.needTransform; + } else { + this.needTransform = this.needLocalTransform; + } + if (!this.needTransform) { + return; + } + var m = this.transform || matrix.create(); + matrix.identity(m); + if (this.needLocalTransform) { + if (isNotAroundZero(this.scale[0]) || isNotAroundZero(this.scale[1])) { + origin[0] = -this.scale[2] || 0; + origin[1] = -this.scale[3] || 0; + var haveOrigin = isNotAroundZero(origin[0]) || isNotAroundZero(origin[1]); + if (haveOrigin) { + matrix.translate(m, m, origin); + } + matrix.scale(m, m, this.scale); + if (haveOrigin) { + origin[0] = -origin[0]; + origin[1] = -origin[1]; + matrix.translate(m, m, origin); + } + } + if (this.rotation instanceof Array) { + if (this.rotation[0] !== 0) { + origin[0] = -this.rotation[1] || 0; + origin[1] = -this.rotation[2] || 0; + var haveOrigin = isNotAroundZero(origin[0]) || isNotAroundZero(origin[1]); + if (haveOrigin) { + matrix.translate(m, m, origin); + } + matrix.rotate(m, m, this.rotation[0]); + if (haveOrigin) { + origin[0] = -origin[0]; + origin[1] = -origin[1]; + matrix.translate(m, m, origin); + } + } + } else { + if (this.rotation !== 0) { + matrix.rotate(m, m, this.rotation); + } + } + if (isNotAroundZero(this.position[0]) || isNotAroundZero(this.position[1])) { + matrix.translate(m, m, this.position); + } + } + this.transform = m; + if (this.parent && this.parent.needTransform) { + if (this.needLocalTransform) { + matrix.mul(this.transform, this.parent.transform, this.transform); + } else { + matrix.copy(this.transform, this.parent.transform); + } + } + }, + setTransform: function (ctx) { + if (this.needTransform) { + var m = this.transform; + ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]); + } + }, + lookAt: function () { + var v = vector.create(); + return function (target) { + if (!this.transform) { + this.transform = matrix.create(); + } + var m = this.transform; + vector.sub(v, target, this.position); + if (isAroundZero(v[0]) && isAroundZero(v[1])) { + return; + } + vector.normalize(v, v); + m[2] = v[0] * this.scale[1]; + m[3] = v[1] * this.scale[1]; + m[0] = v[1] * this.scale[0]; + m[1] = -v[0] * this.scale[0]; + m[4] = this.position[0]; + m[5] = this.position[1]; + this.decomposeTransform(); + }; + }(), + decomposeTransform: function () { + if (!this.transform) { + return; + } + var m = this.transform; + var sx = m[0] * m[0] + m[1] * m[1]; + var position = this.position; + var scale = this.scale; + var rotation = this.rotation; + if (isNotAroundZero(sx - 1)) { + sx = Math.sqrt(sx); + } + var sy = m[2] * m[2] + m[3] * m[3]; + if (isNotAroundZero(sy - 1)) { + sy = Math.sqrt(sy); + } + position[0] = m[4]; + position[1] = m[5]; + scale[0] = sx; + scale[1] = sy; + scale[2] = scale[3] = 0; + rotation[0] = Math.atan2(-m[1] / sy, m[0] / sx); + rotation[1] = rotation[2] = 0; + } + }; + return Transformable; +});define('zrender/Group', [ + 'require', + './tool/guid', + './tool/util', + './mixin/Transformable', + './mixin/Eventful' +], function (require) { + var guid = require('./tool/guid'); + var util = require('./tool/util'); + var Transformable = require('./mixin/Transformable'); + var Eventful = require('./mixin/Eventful'); + var Group = function (options) { + options = options || {}; + this.id = options.id || guid(); + for (var key in options) { + this[key] = options[key]; + } + this.type = 'group'; + this.clipShape = null; + this._children = []; + this._storage = null; + this.__dirty = true; + Transformable.call(this); + Eventful.call(this); + }; + Group.prototype.ignore = false; + Group.prototype.children = function () { + return this._children.slice(); + }; + Group.prototype.childAt = function (idx) { + return this._children[idx]; + }; + Group.prototype.addChild = function (child) { + if (child == this) { + return; + } + if (child.parent == this) { + return; + } + if (child.parent) { + child.parent.removeChild(child); + } + this._children.push(child); + child.parent = this; + if (this._storage && this._storage !== child._storage) { + this._storage.addToMap(child); + if (child instanceof Group) { + child.addChildrenToStorage(this._storage); + } + } + }; + Group.prototype.removeChild = function (child) { + var idx = util.indexOf(this._children, child); + this._children.splice(idx, 1); + child.parent = null; + if (this._storage) { + this._storage.delFromMap(child.id); + if (child instanceof Group) { + child.delChildrenFromStorage(this._storage); + } + } + }; + Group.prototype.clearChildren = function () { + for (var i = 0; i < this._children.length; i++) { + var child = this._children[i]; + if (this._storage) { + this._storage.delFromMap(child.id); + if (child instanceof Group) { + child.delChildrenFromStorage(this._storage); + } + } + } + this._children.length = 0; + }; + Group.prototype.eachChild = function (cb, context) { + var haveContext = !!context; + for (var i = 0; i < this._children.length; i++) { + var child = this._children[i]; + if (haveContext) { + cb.call(context, child); + } else { + cb(child); + } + } + }; + Group.prototype.traverse = function (cb, context) { + var haveContext = !!context; + for (var i = 0; i < this._children.length; i++) { + var child = this._children[i]; + if (haveContext) { + cb.call(context, child); + } else { + cb(child); + } + if (child.type === 'group') { + child.traverse(cb, context); + } + } + }; + Group.prototype.addChildrenToStorage = function (storage) { + for (var i = 0; i < this._children.length; i++) { + var child = this._children[i]; + storage.addToMap(child); + if (child instanceof Group) { + child.addChildrenToStorage(storage); + } + } + }; + Group.prototype.delChildrenFromStorage = function (storage) { + for (var i = 0; i < this._children.length; i++) { + var child = this._children[i]; + storage.delFromMap(child.id); + if (child instanceof Group) { + child.delChildrenFromStorage(storage); + } + } + }; + Group.prototype.modSelf = function () { + this.__dirty = true; + }; + util.merge(Group.prototype, Transformable.prototype, true); + util.merge(Group.prototype, Eventful.prototype, true); + return Group; +});define('zrender/animation/Clip', [ + 'require', + './easing' +], function (require) { + var Easing = require('./easing'); + function Clip(options) { + this._targetPool = options.target || {}; + if (!(this._targetPool instanceof Array)) { + this._targetPool = [this._targetPool]; + } + this._life = options.life || 1000; + this._delay = options.delay || 0; + this._startTime = new Date().getTime() + this._delay; + this._endTime = this._startTime + this._life * 1000; + this.loop = typeof options.loop == 'undefined' ? false : options.loop; + this.gap = options.gap || 0; + this.easing = options.easing || 'Linear'; + this.onframe = options.onframe; + this.ondestroy = options.ondestroy; + this.onrestart = options.onrestart; + } + Clip.prototype = { + step: function (time) { + var percent = (time - this._startTime) / this._life; + if (percent < 0) { + return; + } + percent = Math.min(percent, 1); + var easingFunc = typeof this.easing == 'string' ? Easing[this.easing] : this.easing; + var schedule = typeof easingFunc === 'function' ? easingFunc(percent) : percent; + this.fire('frame', schedule); + if (percent == 1) { + if (this.loop) { + this.restart(); + return 'restart'; + } + this._needsRemove = true; + return 'destroy'; + } + return null; + }, + restart: function () { + var time = new Date().getTime(); + var remainder = (time - this._startTime) % this._life; + this._startTime = new Date().getTime() - remainder + this.gap; + this._needsRemove = false; + }, + fire: function (eventType, arg) { + for (var i = 0, len = this._targetPool.length; i < len; i++) { + if (this['on' + eventType]) { + this['on' + eventType](this._targetPool[i], arg); + } + } + }, + constructor: Clip + }; + return Clip; +});define('zrender/animation/easing', [], function () { + var easing = { + Linear: function (k) { + return k; + }, + QuadraticIn: function (k) { + return k * k; + }, + QuadraticOut: function (k) { + return k * (2 - k); + }, + QuadraticInOut: function (k) { + if ((k *= 2) < 1) { + return 0.5 * k * k; + } + return -0.5 * (--k * (k - 2) - 1); + }, + CubicIn: function (k) { + return k * k * k; + }, + CubicOut: function (k) { + return --k * k * k + 1; + }, + CubicInOut: function (k) { + if ((k *= 2) < 1) { + return 0.5 * k * k * k; + } + return 0.5 * ((k -= 2) * k * k + 2); + }, + QuarticIn: function (k) { + return k * k * k * k; + }, + QuarticOut: function (k) { + return 1 - --k * k * k * k; + }, + QuarticInOut: function (k) { + if ((k *= 2) < 1) { + return 0.5 * k * k * k * k; + } + return -0.5 * ((k -= 2) * k * k * k - 2); + }, + QuinticIn: function (k) { + return k * k * k * k * k; + }, + QuinticOut: function (k) { + return --k * k * k * k * k + 1; + }, + QuinticInOut: function (k) { + if ((k *= 2) < 1) { + return 0.5 * k * k * k * k * k; + } + return 0.5 * ((k -= 2) * k * k * k * k + 2); + }, + SinusoidalIn: function (k) { + return 1 - Math.cos(k * Math.PI / 2); + }, + SinusoidalOut: function (k) { + return Math.sin(k * Math.PI / 2); + }, + SinusoidalInOut: function (k) { + return 0.5 * (1 - Math.cos(Math.PI * k)); + }, + ExponentialIn: function (k) { + return k === 0 ? 0 : Math.pow(1024, k - 1); + }, + ExponentialOut: function (k) { + return k === 1 ? 1 : 1 - Math.pow(2, -10 * k); + }, + ExponentialInOut: function (k) { + if (k === 0) { + return 0; + } + if (k === 1) { + return 1; + } + if ((k *= 2) < 1) { + return 0.5 * Math.pow(1024, k - 1); + } + return 0.5 * (-Math.pow(2, -10 * (k - 1)) + 2); + }, + CircularIn: function (k) { + return 1 - Math.sqrt(1 - k * k); + }, + CircularOut: function (k) { + return Math.sqrt(1 - --k * k); + }, + CircularInOut: function (k) { + if ((k *= 2) < 1) { + return -0.5 * (Math.sqrt(1 - k * k) - 1); + } + return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1); + }, + ElasticIn: function (k) { + var s; + var a = 0.1; + var p = 0.4; + if (k === 0) { + return 0; + } + if (k === 1) { + return 1; + } + if (!a || a < 1) { + a = 1; + s = p / 4; + } else { + s = p * Math.asin(1 / a) / (2 * Math.PI); + } + return -(a * Math.pow(2, 10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p)); + }, + ElasticOut: function (k) { + var s; + var a = 0.1; + var p = 0.4; + if (k === 0) { + return 0; + } + if (k === 1) { + return 1; + } + if (!a || a < 1) { + a = 1; + s = p / 4; + } else { + s = p * Math.asin(1 / a) / (2 * Math.PI); + } + return a * Math.pow(2, -10 * k) * Math.sin((k - s) * (2 * Math.PI) / p) + 1; + }, + ElasticInOut: function (k) { + var s; + var a = 0.1; + var p = 0.4; + if (k === 0) { + return 0; + } + if (k === 1) { + return 1; + } + if (!a || a < 1) { + a = 1; + s = p / 4; + } else { + s = p * Math.asin(1 / a) / (2 * Math.PI); + } + if ((k *= 2) < 1) { + return -0.5 * (a * Math.pow(2, 10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p)); + } + return a * Math.pow(2, -10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p) * 0.5 + 1; + }, + BackIn: function (k) { + var s = 1.70158; + return k * k * ((s + 1) * k - s); + }, + BackOut: function (k) { + var s = 1.70158; + return --k * k * ((s + 1) * k + s) + 1; + }, + BackInOut: function (k) { + var s = 1.70158 * 1.525; + if ((k *= 2) < 1) { + return 0.5 * (k * k * ((s + 1) * k - s)); + } + return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2); + }, + BounceIn: function (k) { + return 1 - easing.BounceOut(1 - k); + }, + BounceOut: function (k) { + if (k < 1 / 2.75) { + return 7.5625 * k * k; + } else if (k < 2 / 2.75) { + return 7.5625 * (k -= 1.5 / 2.75) * k + 0.75; + } else if (k < 2.5 / 2.75) { + return 7.5625 * (k -= 2.25 / 2.75) * k + 0.9375; + } else { + return 7.5625 * (k -= 2.625 / 2.75) * k + 0.984375; + } + }, + BounceInOut: function (k) { + if (k < 0.5) { + return easing.BounceIn(k * 2) * 0.5; + } + return easing.BounceOut(k * 2 - 1) * 0.5 + 0.5; + } + }; + return easing; +});define('echarts/chart/base', [ + 'require', + 'zrender/shape/Image', + '../util/shape/Icon', + '../util/shape/MarkLine', + '../util/shape/Symbol', + '../config', + '../util/ecData', + '../util/ecAnimation', + '../util/ecEffect', + '../util/accMath', + '../component/base', + 'zrender/tool/util', + 'zrender/tool/area' +], function (require) { + var ImageShape = require('zrender/shape/Image'); + var IconShape = require('../util/shape/Icon'); + var MarkLineShape = require('../util/shape/MarkLine'); + var SymbolShape = require('../util/shape/Symbol'); + var ecConfig = require('../config'); + var ecData = require('../util/ecData'); + var ecAnimation = require('../util/ecAnimation'); + var ecEffect = require('../util/ecEffect'); + var accMath = require('../util/accMath'); + var ComponentBase = require('../component/base'); + var zrUtil = require('zrender/tool/util'); + var zrArea = require('zrender/tool/area'); + function Base(ecTheme, messageCenter, zr, option, myChart) { + ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); + var self = this; + this.selectedMap = {}; + this.lastShapeList = []; + this.shapeHandler = { + onclick: function () { + self.isClick = true; + }, + ondragover: function (param) { + var calculableShape = param.target; + calculableShape.highlightStyle = calculableShape.highlightStyle || {}; + var highlightStyle = calculableShape.highlightStyle; + var brushType = highlightStyle.brushTyep; + var strokeColor = highlightStyle.strokeColor; + var lineWidth = highlightStyle.lineWidth; + highlightStyle.brushType = 'stroke'; + highlightStyle.strokeColor = self.ecTheme.calculableColor || ecConfig.calculableColor; + highlightStyle.lineWidth = calculableShape.type === 'icon' ? 30 : 10; + self.zr.addHoverShape(calculableShape); + setTimeout(function () { + if (highlightStyle) { + highlightStyle.brushType = brushType; + highlightStyle.strokeColor = strokeColor; + highlightStyle.lineWidth = lineWidth; + } + }, 20); + }, + ondrop: function (param) { + if (ecData.get(param.dragged, 'data') != null) { + self.isDrop = true; + } + }, + ondragend: function () { + self.isDragend = true; + } + }; + } + Base.prototype = { + setCalculable: function (shape) { + shape.dragEnableTime = this.ecTheme.DRAG_ENABLE_TIME || ecConfig.DRAG_ENABLE_TIME; + shape.ondragover = this.shapeHandler.ondragover; + shape.ondragend = this.shapeHandler.ondragend; + shape.ondrop = this.shapeHandler.ondrop; + return shape; + }, + ondrop: function (param, status) { + if (!this.isDrop || !param.target || status.dragIn) { + return; + } + var target = param.target; + var dragged = param.dragged; + var seriesIndex = ecData.get(target, 'seriesIndex'); + var dataIndex = ecData.get(target, 'dataIndex'); + var series = this.series; + var data; + var legend = this.component.legend; + if (dataIndex === -1) { + if (ecData.get(dragged, 'seriesIndex') == seriesIndex) { + status.dragOut = status.dragIn = status.needRefresh = true; + this.isDrop = false; + return; + } + data = { + value: ecData.get(dragged, 'value'), + name: ecData.get(dragged, 'name') + }; + if (this.type === ecConfig.CHART_TYPE_PIE && data.value < 0) { + data.value = 0; + } + var hasFind = false; + var sData = series[seriesIndex].data; + for (var i = 0, l = sData.length; i < l; i++) { + if (sData[i].name === data.name && sData[i].value === '-') { + series[seriesIndex].data[i].value = data.value; + hasFind = true; + } + } + !hasFind && series[seriesIndex].data.push(data); + legend && legend.add(data.name, dragged.style.color || dragged.style.strokeColor); + } else { + data = series[seriesIndex].data[dataIndex] || '-'; + if (data.value != null) { + if (data.value != '-') { + series[seriesIndex].data[dataIndex].value = accMath.accAdd(series[seriesIndex].data[dataIndex].value, ecData.get(dragged, 'value')); + } else { + series[seriesIndex].data[dataIndex].value = ecData.get(dragged, 'value'); + } + if (this.type === ecConfig.CHART_TYPE_FUNNEL || this.type === ecConfig.CHART_TYPE_PIE) { + legend && legend.getRelatedAmount(data.name) === 1 && this.component.legend.del(data.name); + data.name += this.option.nameConnector + ecData.get(dragged, 'name'); + legend && legend.add(data.name, dragged.style.color || dragged.style.strokeColor); + } + } else { + if (data != '-') { + series[seriesIndex].data[dataIndex] = accMath.accAdd(series[seriesIndex].data[dataIndex], ecData.get(dragged, 'value')); + } else { + series[seriesIndex].data[dataIndex] = ecData.get(dragged, 'value'); + } + } + } + status.dragIn = status.dragIn || true; + this.isDrop = false; + var self = this; + setTimeout(function () { + self.zr.trigger('mousemove', param.event); + }, 300); + return; + }, + ondragend: function (param, status) { + if (!this.isDragend || !param.target || status.dragOut) { + return; + } + var target = param.target; + var seriesIndex = ecData.get(target, 'seriesIndex'); + var dataIndex = ecData.get(target, 'dataIndex'); + var series = this.series; + if (series[seriesIndex].data[dataIndex].value != null) { + series[seriesIndex].data[dataIndex].value = '-'; + var name = series[seriesIndex].data[dataIndex].name; + var legend = this.component.legend; + if (legend && legend.getRelatedAmount(name) === 0) { + legend.del(name); + } + } else { + series[seriesIndex].data[dataIndex] = '-'; + } + status.dragOut = true; + status.needRefresh = true; + this.isDragend = false; + return; + }, + onlegendSelected: function (param, status) { + var legendSelected = param.selected; + for (var itemName in this.selectedMap) { + if (this.selectedMap[itemName] != legendSelected[itemName]) { + status.needRefresh = true; + } + this.selectedMap[itemName] = legendSelected[itemName]; + } + return; + }, + _buildPosition: function () { + this._symbol = this.option.symbolList; + this._sIndex2ShapeMap = {}; + this._sIndex2ColorMap = {}; + this.selectedMap = {}; + this.xMarkMap = {}; + var series = this.series; + var _position2sIndexMap = { + top: [], + bottom: [], + left: [], + right: [], + other: [] + }; + var xAxisIndex; + var yAxisIndex; + var xAxis; + var yAxis; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type === this.type) { + series[i] = this.reformOption(series[i]); + this.legendHoverLink = series[i].legendHoverLink || this.legendHoverLink; + xAxisIndex = series[i].xAxisIndex; + yAxisIndex = series[i].yAxisIndex; + xAxis = this.component.xAxis.getAxis(xAxisIndex); + yAxis = this.component.yAxis.getAxis(yAxisIndex); + if (xAxis.type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY) { + _position2sIndexMap[xAxis.getPosition()].push(i); + } else if (yAxis.type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY) { + _position2sIndexMap[yAxis.getPosition()].push(i); + } else { + _position2sIndexMap.other.push(i); + } + } + } + for (var position in _position2sIndexMap) { + if (_position2sIndexMap[position].length > 0) { + this._buildSinglePosition(position, _position2sIndexMap[position]); + } + } + this.addShapeList(); + }, + _buildSinglePosition: function (position, seriesArray) { + var mapData = this._mapData(seriesArray); + var locationMap = mapData.locationMap; + var maxDataLength = mapData.maxDataLength; + if (maxDataLength === 0 || locationMap.length === 0) { + return; + } + switch (position) { + case 'bottom': + case 'top': + this._buildHorizontal(seriesArray, maxDataLength, locationMap, this.xMarkMap); + break; + case 'left': + case 'right': + this._buildVertical(seriesArray, maxDataLength, locationMap, this.xMarkMap); + break; + case 'other': + this._buildOther(seriesArray, maxDataLength, locationMap, this.xMarkMap); + break; + } + for (var i = 0, l = seriesArray.length; i < l; i++) { + this.buildMark(seriesArray[i]); + } + }, + _mapData: function (seriesArray) { + var series = this.series; + var serie; + var dataIndex = 0; + var stackMap = {}; + var magicStackKey = '__kener__stack__'; + var stackKey; + var serieName; + var legend = this.component.legend; + var locationMap = []; + var maxDataLength = 0; + var iconShape; + for (var i = 0, l = seriesArray.length; i < l; i++) { + serie = series[seriesArray[i]]; + serieName = serie.name; + this._sIndex2ShapeMap[seriesArray[i]] = this._sIndex2ShapeMap[seriesArray[i]] || this.query(serie, 'symbol') || this._symbol[i % this._symbol.length]; + if (legend) { + this.selectedMap[serieName] = legend.isSelected(serieName); + this._sIndex2ColorMap[seriesArray[i]] = legend.getColor(serieName); + iconShape = legend.getItemShape(serieName); + if (iconShape) { + var style = iconShape.style; + if (this.type == ecConfig.CHART_TYPE_LINE) { + style.iconType = 'legendLineIcon'; + style.symbol = this._sIndex2ShapeMap[seriesArray[i]]; + } else if (serie.itemStyle.normal.barBorderWidth > 0) { + var highlightStyle = iconShape.highlightStyle; + style.brushType = 'both'; + style.x += 1; + style.y += 1; + style.width -= 2; + style.height -= 2; + style.strokeColor = highlightStyle.strokeColor = serie.itemStyle.normal.barBorderColor; + highlightStyle.lineWidth = 3; + } + legend.setItemShape(serieName, iconShape); + } + } else { + this.selectedMap[serieName] = true; + this._sIndex2ColorMap[seriesArray[i]] = this.zr.getColor(seriesArray[i]); + } + if (this.selectedMap[serieName]) { + stackKey = serie.stack || magicStackKey + seriesArray[i]; + if (stackMap[stackKey] == null) { + stackMap[stackKey] = dataIndex; + locationMap[dataIndex] = [seriesArray[i]]; + dataIndex++; + } else { + locationMap[stackMap[stackKey]].push(seriesArray[i]); + } + } + maxDataLength = Math.max(maxDataLength, serie.data.length); + } + return { + locationMap: locationMap, + maxDataLength: maxDataLength + }; + }, + _calculMarkMapXY: function (xMarkMap, locationMap, xy) { + var series = this.series; + for (var j = 0, k = locationMap.length; j < k; j++) { + for (var m = 0, n = locationMap[j].length; m < n; m++) { + var seriesIndex = locationMap[j][m]; + var valueIndex = xy == 'xy' ? 0 : ''; + var grid = this.component.grid; + var tarMark = xMarkMap[seriesIndex]; + if (xy.indexOf('x') != '-1') { + if (tarMark['counter' + valueIndex] > 0) { + tarMark['average' + valueIndex] = tarMark['sum' + valueIndex] / tarMark['counter' + valueIndex]; + } + var x = this.component.xAxis.getAxis(series[seriesIndex].xAxisIndex || 0).getCoord(tarMark['average' + valueIndex]); + tarMark['averageLine' + valueIndex] = [ + [ + x, + grid.getYend() + ], + [ + x, + grid.getY() + ] + ]; + tarMark['minLine' + valueIndex] = [ + [ + tarMark['minX' + valueIndex], + grid.getYend() + ], + [ + tarMark['minX' + valueIndex], + grid.getY() + ] + ]; + tarMark['maxLine' + valueIndex] = [ + [ + tarMark['maxX' + valueIndex], + grid.getYend() + ], + [ + tarMark['maxX' + valueIndex], + grid.getY() + ] + ]; + tarMark.isHorizontal = false; + } + valueIndex = xy == 'xy' ? 1 : ''; + if (xy.indexOf('y') != '-1') { + if (tarMark['counter' + valueIndex] > 0) { + tarMark['average' + valueIndex] = tarMark['sum' + valueIndex] / tarMark['counter' + valueIndex]; + } + var y = this.component.yAxis.getAxis(series[seriesIndex].yAxisIndex || 0).getCoord(tarMark['average' + valueIndex]); + tarMark['averageLine' + valueIndex] = [ + [ + grid.getX(), + y + ], + [ + grid.getXend(), + y + ] + ]; + tarMark['minLine' + valueIndex] = [ + [ + grid.getX(), + tarMark['minY' + valueIndex] + ], + [ + grid.getXend(), + tarMark['minY' + valueIndex] + ] + ]; + tarMark['maxLine' + valueIndex] = [ + [ + grid.getX(), + tarMark['maxY' + valueIndex] + ], + [ + grid.getXend(), + tarMark['maxY' + valueIndex] + ] + ]; + tarMark.isHorizontal = true; + } + } + } + }, + addLabel: function (tarShape, serie, data, name, orient) { + var queryTarget = [ + data, + serie + ]; + var nLabel = this.deepMerge(queryTarget, 'itemStyle.normal.label'); + var eLabel = this.deepMerge(queryTarget, 'itemStyle.emphasis.label'); + var nTextStyle = nLabel.textStyle || {}; + var eTextStyle = eLabel.textStyle || {}; + if (nLabel.show) { + var style = tarShape.style; + style.text = this._getLabelText(serie, data, name, 'normal'); + style.textPosition = nLabel.position == null ? orient === 'horizontal' ? 'right' : 'top' : nLabel.position; + style.textColor = nTextStyle.color; + style.textFont = this.getFont(nTextStyle); + style.textAlign = nTextStyle.align; + style.textBaseline = nTextStyle.baseline; + } + if (eLabel.show) { + var highlightStyle = tarShape.highlightStyle; + highlightStyle.text = this._getLabelText(serie, data, name, 'emphasis'); + highlightStyle.textPosition = nLabel.show ? tarShape.style.textPosition : eLabel.position == null ? orient === 'horizontal' ? 'right' : 'top' : eLabel.position; + highlightStyle.textColor = eTextStyle.color; + highlightStyle.textFont = this.getFont(eTextStyle); + highlightStyle.textAlign = eTextStyle.align; + highlightStyle.textBaseline = eTextStyle.baseline; + } + return tarShape; + }, + _getLabelText: function (serie, data, name, status) { + var formatter = this.deepQuery([ + data, + serie + ], 'itemStyle.' + status + '.label.formatter'); + if (!formatter && status === 'emphasis') { + formatter = this.deepQuery([ + data, + serie + ], 'itemStyle.normal.label.formatter'); + } + var value = this.getDataFromOption(data, '-'); + if (formatter) { + if (typeof formatter === 'function') { + return formatter.call(this.myChart, { + seriesName: serie.name, + series: serie, + name: name, + value: value, + data: data, + status: status + }); + } else if (typeof formatter === 'string') { + formatter = formatter.replace('{a}', '{a0}').replace('{b}', '{b0}').replace('{c}', '{c0}').replace('{a0}', serie.name).replace('{b0}', name).replace('{c0}', this.numAddCommas(value)); + return formatter; + } + } else { + if (value instanceof Array) { + return value[2] != null ? this.numAddCommas(value[2]) : value[0] + ' , ' + value[1]; + } else { + return this.numAddCommas(value); + } + } + }, + buildMark: function (seriesIndex) { + var serie = this.series[seriesIndex]; + if (this.selectedMap[serie.name]) { + serie.markLine && this._buildMarkLine(seriesIndex); + serie.markPoint && this._buildMarkPoint(seriesIndex); + } + }, + _buildMarkPoint: function (seriesIndex) { + var attachStyle = (this.markAttachStyle || {})[seriesIndex]; + var serie = this.series[seriesIndex]; + var mpData; + var pos; + var markPoint = zrUtil.clone(serie.markPoint); + for (var i = 0, l = markPoint.data.length; i < l; i++) { + mpData = markPoint.data[i]; + pos = this.getMarkCoord(seriesIndex, mpData); + mpData.x = mpData.x != null ? mpData.x : pos[0]; + mpData.y = mpData.y != null ? mpData.y : pos[1]; + if (mpData.type && (mpData.type === 'max' || mpData.type === 'min')) { + mpData.value = pos[3]; + mpData.name = mpData.name || mpData.type; + mpData.symbolSize = mpData.symbolSize || zrArea.getTextWidth(pos[3], this.getFont()) / 2 + 5; + } + } + var shapeList = this._markPoint(seriesIndex, markPoint); + for (var i = 0, l = shapeList.length; i < l; i++) { + var tarShape = shapeList[i]; + tarShape.zlevel = this.getZlevelBase(); + tarShape.z = this.getZBase() + 1; + for (var key in attachStyle) { + tarShape[key] = zrUtil.clone(attachStyle[key]); + } + this.shapeList.push(tarShape); + } + if (this.type === ecConfig.CHART_TYPE_FORCE || this.type === ecConfig.CHART_TYPE_CHORD) { + for (var i = 0, l = shapeList.length; i < l; i++) { + this.zr.addShape(shapeList[i]); + } + } + }, + _buildMarkLine: function (seriesIndex) { + var attachStyle = (this.markAttachStyle || {})[seriesIndex]; + var serie = this.series[seriesIndex]; + var pos; + var markLine = zrUtil.clone(serie.markLine); + for (var i = 0, l = markLine.data.length; i < l; i++) { + var mlData = markLine.data[i]; + if (mlData.type && (mlData.type === 'max' || mlData.type === 'min' || mlData.type === 'average')) { + pos = this.getMarkCoord(seriesIndex, mlData); + markLine.data[i] = [ + zrUtil.clone(mlData), + {} + ]; + markLine.data[i][0].name = mlData.name || mlData.type; + markLine.data[i][0].value = mlData.type !== 'average' ? pos[3] : +pos[3].toFixed(markLine.precision != null ? markLine.precision : this.deepQuery([ + this.ecTheme, + ecConfig + ], 'markLine.precision')); + pos = pos[2]; + mlData = [ + {}, + {} + ]; + } else { + pos = [ + this.getMarkCoord(seriesIndex, mlData[0]), + this.getMarkCoord(seriesIndex, mlData[1]) + ]; + } + if (pos == null || pos[0] == null || pos[1] == null) { + continue; + } + markLine.data[i][0].x = mlData[0].x != null ? mlData[0].x : pos[0][0]; + markLine.data[i][0].y = mlData[0].y != null ? mlData[0].y : pos[0][1]; + markLine.data[i][1].x = mlData[1].x != null ? mlData[1].x : pos[1][0]; + markLine.data[i][1].y = mlData[1].y != null ? mlData[1].y : pos[1][1]; + } + var shapeList = this._markLine(seriesIndex, markLine); + for (var i = 0, l = shapeList.length; i < l; i++) { + var tarShape = shapeList[i]; + tarShape.zlevel = this.getZlevelBase(); + tarShape.z = this.getZBase() + 1; + for (var key in attachStyle) { + tarShape[key] = zrUtil.clone(attachStyle[key]); + } + this.shapeList.push(tarShape); + } + if (this.type === ecConfig.CHART_TYPE_FORCE || this.type === ecConfig.CHART_TYPE_CHORD) { + for (var i = 0, l = shapeList.length; i < l; i++) { + this.zr.addShape(shapeList[i]); + } + } + }, + _markPoint: function (seriesIndex, mpOption) { + var serie = this.series[seriesIndex]; + var component = this.component; + zrUtil.merge(zrUtil.merge(mpOption, zrUtil.clone(this.ecTheme.markPoint || {})), zrUtil.clone(ecConfig.markPoint)); + mpOption.name = serie.name; + var pList = []; + var data = mpOption.data; + var itemShape; + var dataRange = component.dataRange; + var legend = component.legend; + var color; + var value; + var queryTarget; + var nColor; + var eColor; + var effect; + var zrWidth = this.zr.getWidth(); + var zrHeight = this.zr.getHeight(); + if (!mpOption.large) { + for (var i = 0, l = data.length; i < l; i++) { + if (data[i].x == null || data[i].y == null) { + continue; + } + value = data[i].value != null ? data[i].value : ''; + if (legend) { + color = legend.getColor(serie.name); + } + if (dataRange) { + color = isNaN(value) ? color : dataRange.getColor(value); + queryTarget = [ + data[i], + mpOption + ]; + nColor = this.deepQuery(queryTarget, 'itemStyle.normal.color') || color; + eColor = this.deepQuery(queryTarget, 'itemStyle.emphasis.color') || nColor; + if (nColor == null && eColor == null) { + continue; + } + } + color = color == null ? this.zr.getColor(seriesIndex) : color; + data[i].tooltip = data[i].tooltip || mpOption.tooltip || { trigger: 'item' }; + data[i].name = data[i].name != null ? data[i].name : ''; + data[i].value = value; + itemShape = this.getSymbolShape(mpOption, seriesIndex, data[i], i, data[i].name, this.parsePercent(data[i].x, zrWidth), this.parsePercent(data[i].y, zrHeight), 'pin', color, 'rgba(0,0,0,0)', 'horizontal'); + itemShape._mark = 'point'; + effect = this.deepMerge([ + data[i], + mpOption + ], 'effect'); + if (effect.show) { + itemShape.effect = effect; + } + if (serie.type === ecConfig.CHART_TYPE_MAP) { + itemShape._geo = this.getMarkGeo(data[i]); + } + ecData.pack(itemShape, serie, seriesIndex, data[i], i, data[i].name, value); + pList.push(itemShape); + } + } else { + itemShape = this.getLargeMarkPoingShape(seriesIndex, mpOption); + itemShape._mark = 'largePoint'; + itemShape && pList.push(itemShape); + } + return pList; + }, + _markLine: function (seriesIndex, mlOption) { + var serie = this.series[seriesIndex]; + var component = this.component; + zrUtil.merge(zrUtil.merge(mlOption, zrUtil.clone(this.ecTheme.markLine || {})), zrUtil.clone(ecConfig.markLine)); + mlOption.symbol = mlOption.symbol instanceof Array ? mlOption.symbol.length > 1 ? mlOption.symbol : [ + mlOption.symbol[0], + mlOption.symbol[0] + ] : [ + mlOption.symbol, + mlOption.symbol + ]; + mlOption.symbolSize = mlOption.symbolSize instanceof Array ? mlOption.symbolSize.length > 1 ? mlOption.symbolSize : [ + mlOption.symbolSize[0], + mlOption.symbolSize[0] + ] : [ + mlOption.symbolSize, + mlOption.symbolSize + ]; + mlOption.symbolRotate = mlOption.symbolRotate instanceof Array ? mlOption.symbolRotate.length > 1 ? mlOption.symbolRotate : [ + mlOption.symbolRotate[0], + mlOption.symbolRotate[0] + ] : [ + mlOption.symbolRotate, + mlOption.symbolRotate + ]; + mlOption.name = serie.name; + var pList = []; + var data = mlOption.data; + var itemShape; + var dataRange = component.dataRange; + var legend = component.legend; + var color; + var value; + var queryTarget; + var nColor; + var eColor; + var effect; + var zrWidth = this.zr.getWidth(); + var zrHeight = this.zr.getHeight(); + var mergeData; + for (var i = 0, l = data.length; i < l; i++) { + var mlData = data[i]; + if (mlData[0].x == null || mlData[0].y == null || mlData[1].x == null || mlData[1].y == null) { + continue; + } + color = legend ? legend.getColor(serie.name) : this.zr.getColor(seriesIndex); + mergeData = this.deepMerge(mlData); + value = mergeData.value != null ? mergeData.value : ''; + if (dataRange) { + color = isNaN(value) ? color : dataRange.getColor(value); + queryTarget = [ + mergeData, + mlOption + ]; + nColor = this.deepQuery(queryTarget, 'itemStyle.normal.color') || color; + eColor = this.deepQuery(queryTarget, 'itemStyle.emphasis.color') || nColor; + if (nColor == null && eColor == null) { + continue; + } + } + mlData[0].tooltip = mergeData.tooltip || mlOption.tooltip || { trigger: 'item' }; + mlData[0].name = mlData[0].name != null ? mlData[0].name : ''; + mlData[1].name = mlData[1].name != null ? mlData[1].name : ''; + mlData[0].value = value; + itemShape = this.getLineMarkShape(mlOption, seriesIndex, mlData, i, this.parsePercent(mlData[0].x, zrWidth), this.parsePercent(mlData[0].y, zrHeight), this.parsePercent(mlData[1].x, zrWidth), this.parsePercent(mlData[1].y, zrHeight), color); + itemShape._mark = 'line'; + effect = this.deepMerge([ + mergeData, + mlOption + ], 'effect'); + if (effect.show) { + itemShape.effect = effect; + } + if (serie.type === ecConfig.CHART_TYPE_MAP) { + itemShape._geo = [ + this.getMarkGeo(mlData[0]), + this.getMarkGeo(mlData[1]) + ]; + } + ecData.pack(itemShape, serie, seriesIndex, mlData[0], i, mlData[0].name + (mlData[1].name !== '' ? ' > ' + mlData[1].name : ''), value); + pList.push(itemShape); + } + return pList; + }, + getMarkCoord: function () { + return [ + 0, + 0 + ]; + }, + getSymbolShape: function (serie, seriesIndex, data, dataIndex, name, x, y, symbol, color, emptyColor, orient) { + var queryTarget = [ + data, + serie + ]; + var value = this.getDataFromOption(data, '-'); + symbol = this.deepQuery(queryTarget, 'symbol') || symbol; + var symbolSize = this.deepQuery(queryTarget, 'symbolSize'); + symbolSize = typeof symbolSize === 'function' ? symbolSize(value) : symbolSize; + var symbolRotate = this.deepQuery(queryTarget, 'symbolRotate'); + var normal = this.deepMerge(queryTarget, 'itemStyle.normal'); + var emphasis = this.deepMerge(queryTarget, 'itemStyle.emphasis'); + var nBorderWidth = normal.borderWidth != null ? normal.borderWidth : normal.lineStyle && normal.lineStyle.width; + if (nBorderWidth == null) { + nBorderWidth = symbol.match('empty') ? 2 : 0; + } + var eBorderWidth = emphasis.borderWidth != null ? emphasis.borderWidth : emphasis.lineStyle && emphasis.lineStyle.width; + if (eBorderWidth == null) { + eBorderWidth = nBorderWidth + 2; + } + var itemShape = new IconShape({ + style: { + iconType: symbol.replace('empty', '').toLowerCase(), + x: x - symbolSize, + y: y - symbolSize, + width: symbolSize * 2, + height: symbolSize * 2, + brushType: 'both', + color: symbol.match('empty') ? emptyColor : this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) || color, + strokeColor: normal.borderColor || this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) || color, + lineWidth: nBorderWidth + }, + highlightStyle: { + color: symbol.match('empty') ? emptyColor : this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data), + strokeColor: emphasis.borderColor || normal.borderColor || this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) || color, + lineWidth: eBorderWidth + }, + clickable: this.deepQuery(queryTarget, 'clickable') + }); + if (symbol.match('image')) { + itemShape.style.image = symbol.replace(new RegExp('^image:\\/\\/'), ''); + itemShape = new ImageShape({ + style: itemShape.style, + highlightStyle: itemShape.highlightStyle, + clickable: this.deepQuery(queryTarget, 'clickable') + }); + } + if (symbolRotate != null) { + itemShape.rotation = [ + symbolRotate * Math.PI / 180, + x, + y + ]; + } + if (symbol.match('star')) { + itemShape.style.iconType = 'star'; + itemShape.style.n = symbol.replace('empty', '').replace('star', '') - 0 || 5; + } + if (symbol === 'none') { + itemShape.invisible = true; + itemShape.hoverable = false; + } + itemShape = this.addLabel(itemShape, serie, data, name, orient); + if (symbol.match('empty')) { + if (itemShape.style.textColor == null) { + itemShape.style.textColor = itemShape.style.strokeColor; + } + if (itemShape.highlightStyle.textColor == null) { + itemShape.highlightStyle.textColor = itemShape.highlightStyle.strokeColor; + } + } + ecData.pack(itemShape, serie, seriesIndex, data, dataIndex, name); + itemShape._x = x; + itemShape._y = y; + itemShape._dataIndex = dataIndex; + itemShape._seriesIndex = seriesIndex; + return itemShape; + }, + getLineMarkShape: function (mlOption, seriesIndex, data, dataIndex, xStart, yStart, xEnd, yEnd, color) { + var value0 = data[0].value != null ? data[0].value : '-'; + var value1 = data[1].value != null ? data[1].value : '-'; + var symbol = [ + this.query(data[0], 'symbol') || mlOption.symbol[0], + this.query(data[1], 'symbol') || mlOption.symbol[1] + ]; + var symbolSize = [ + this.query(data[0], 'symbolSize') || mlOption.symbolSize[0], + this.query(data[1], 'symbolSize') || mlOption.symbolSize[1] + ]; + symbolSize[0] = typeof symbolSize[0] === 'function' ? symbolSize[0](value0) : symbolSize[0]; + symbolSize[1] = typeof symbolSize[1] === 'function' ? symbolSize[1](value1) : symbolSize[1]; + var symbolRotate = [ + this.query(data[0], 'symbolRotate') || mlOption.symbolRotate[0], + this.query(data[1], 'symbolRotate') || mlOption.symbolRotate[1] + ]; + var queryTarget = [ + data[0], + data[1], + mlOption + ]; + var normal = this.deepMerge(queryTarget, 'itemStyle.normal'); + normal.color = this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data); + var emphasis = this.deepMerge(queryTarget, 'itemStyle.emphasis'); + emphasis.color = this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data); + var nlineStyle = normal.lineStyle; + var elineStyle = emphasis.lineStyle; + var nBorderWidth = nlineStyle.width; + if (nBorderWidth == null) { + nBorderWidth = normal.borderWidth; + } + var eBorderWidth = elineStyle.width; + if (eBorderWidth == null) { + eBorderWidth = emphasis.borderWidth != null ? emphasis.borderWidth : nBorderWidth + 2; + } + var itemShape = new MarkLineShape({ + style: { + smooth: this.deepQuery([ + data[0], + data[1], + mlOption + ], 'smooth') ? 'spline' : false, + smoothRadian: this.deepQuery([ + data[0], + data[1], + mlOption + ], 'smoothRadian'), + symbol: symbol, + symbolSize: symbolSize, + symbolRotate: symbolRotate, + xStart: xStart, + yStart: yStart, + xEnd: xEnd, + yEnd: yEnd, + brushType: 'both', + lineType: nlineStyle.type, + shadowColor: nlineStyle.shadowColor || nlineStyle.color || normal.borderColor || normal.color || color, + shadowBlur: nlineStyle.shadowBlur, + shadowOffsetX: nlineStyle.shadowOffsetX, + shadowOffsetY: nlineStyle.shadowOffsetY, + color: normal.color || color, + strokeColor: nlineStyle.color || normal.borderColor || normal.color || color, + lineWidth: nBorderWidth, + symbolBorderColor: normal.borderColor || normal.color || color, + symbolBorder: normal.borderWidth + }, + highlightStyle: { + shadowColor: elineStyle.shadowColor, + shadowBlur: elineStyle.shadowBlur, + shadowOffsetX: elineStyle.shadowOffsetX, + shadowOffsetY: elineStyle.shadowOffsetY, + color: emphasis.color || normal.color || color, + strokeColor: elineStyle.color || nlineStyle.color || emphasis.borderColor || normal.borderColor || emphasis.color || normal.color || color, + lineWidth: eBorderWidth, + symbolBorderColor: emphasis.borderColor || normal.borderColor || emphasis.color || normal.color || color, + symbolBorder: emphasis.borderWidth == null ? normal.borderWidth + 2 : emphasis.borderWidth + }, + clickable: this.deepQuery(queryTarget, 'clickable') + }); + itemShape = this.addLabel(itemShape, mlOption, data[0], data[0].name + ' : ' + data[1].name); + itemShape._x = xEnd; + itemShape._y = yEnd; + return itemShape; + }, + getLargeMarkPoingShape: function (seriesIndex, mpOption) { + var serie = this.series[seriesIndex]; + var component = this.component; + var data = mpOption.data; + var itemShape; + var dataRange = component.dataRange; + var legend = component.legend; + var color; + var value; + var queryTarget = [ + data[0], + mpOption + ]; + var nColor; + var eColor; + var effect; + if (legend) { + color = legend.getColor(serie.name); + } + if (dataRange) { + value = data[0].value != null ? data[0].value : ''; + color = isNaN(value) ? color : dataRange.getColor(value); + nColor = this.deepQuery(queryTarget, 'itemStyle.normal.color') || color; + eColor = this.deepQuery(queryTarget, 'itemStyle.emphasis.color') || nColor; + if (nColor == null && eColor == null) { + return; + } + } + color = this.deepMerge(queryTarget, 'itemStyle.normal').color || color; + var symbol = this.deepQuery(queryTarget, 'symbol') || 'circle'; + symbol = symbol.replace('empty', '').replace(/\d/g, ''); + effect = this.deepMerge([ + data[0], + mpOption + ], 'effect'); + var devicePixelRatio = window.devicePixelRatio || 1; + itemShape = new SymbolShape({ + style: { + pointList: data, + color: color, + strokeColor: color, + shadowColor: effect.shadowColor || color, + shadowBlur: (effect.shadowBlur != null ? effect.shadowBlur : 8) * devicePixelRatio, + size: this.deepQuery(queryTarget, 'symbolSize'), + iconType: symbol, + brushType: 'fill', + lineWidth: 1 + }, + draggable: false, + hoverable: false + }); + if (effect.show) { + itemShape.effect = effect; + } + return itemShape; + }, + backupShapeList: function () { + if (this.shapeList && this.shapeList.length > 0) { + this.lastShapeList = this.shapeList; + this.shapeList = []; + } else { + this.lastShapeList = []; + } + }, + addShapeList: function () { + var maxLenth = this.option.animationThreshold / (this.canvasSupported ? 2 : 4); + var lastShapeList = this.lastShapeList; + var shapeList = this.shapeList; + var isUpdate = lastShapeList.length > 0; + var duration = isUpdate ? this.query(this.option, 'animationDurationUpdate') : this.query(this.option, 'animationDuration'); + var easing = this.query(this.option, 'animationEasing'); + var delay; + var key; + var oldMap = {}; + var newMap = {}; + if (this.option.animation && !this.option.renderAsImage && shapeList.length < maxLenth && !this.motionlessOnce) { + for (var i = 0, l = lastShapeList.length; i < l; i++) { + key = this._getAnimationKey(lastShapeList[i]); + if (key.match('undefined')) { + this.zr.delShape(lastShapeList[i].id); + } else { + key += lastShapeList[i].type; + if (oldMap[key]) { + this.zr.delShape(lastShapeList[i].id); + } else { + oldMap[key] = lastShapeList[i]; + } + } + } + for (var i = 0, l = shapeList.length; i < l; i++) { + key = this._getAnimationKey(shapeList[i]); + if (key.match('undefined')) { + this.zr.addShape(shapeList[i]); + } else { + key += shapeList[i].type; + newMap[key] = shapeList[i]; + } + } + for (key in oldMap) { + if (!newMap[key]) { + this.zr.delShape(oldMap[key].id); + } + } + for (key in newMap) { + if (oldMap[key]) { + this.zr.delShape(oldMap[key].id); + this._animateMod(oldMap[key], newMap[key], duration, easing, 0, isUpdate); + } else { + delay = (this.type == ecConfig.CHART_TYPE_LINE || this.type == ecConfig.CHART_TYPE_RADAR) && key.indexOf('icon') !== 0 ? duration / 2 : 0; + this._animateMod(false, newMap[key], duration, easing, delay, isUpdate); + } + } + this.zr.refresh(); + this.animationEffect(); + } else { + this.motionlessOnce = false; + this.zr.delShape(lastShapeList); + for (var i = 0, l = shapeList.length; i < l; i++) { + this.zr.addShape(shapeList[i]); + } + } + }, + _getAnimationKey: function (shape) { + if (this.type != ecConfig.CHART_TYPE_MAP) { + return ecData.get(shape, 'seriesIndex') + '_' + ecData.get(shape, 'dataIndex') + (shape._mark ? shape._mark : '') + (this.type === ecConfig.CHART_TYPE_RADAR ? ecData.get(shape, 'special') : ''); + } else { + return ecData.get(shape, 'seriesIndex') + '_' + ecData.get(shape, 'dataIndex') + (shape._mark ? shape._mark : 'undefined'); + } + }, + _animateMod: function (oldShape, newShape, duration, easing, delay, isUpdate) { + switch (newShape.type) { + case 'polyline': + case 'half-smooth-polygon': + ecAnimation.pointList(this.zr, oldShape, newShape, duration, easing); + break; + case 'rectangle': + ecAnimation.rectangle(this.zr, oldShape, newShape, duration, easing); + break; + case 'image': + case 'icon': + ecAnimation.icon(this.zr, oldShape, newShape, duration, easing, delay); + break; + case 'candle': + if (!isUpdate) { + ecAnimation.candle(this.zr, oldShape, newShape, duration, easing); + } else { + this.zr.addShape(newShape); + } + break; + case 'ring': + case 'sector': + case 'circle': + if (!isUpdate) { + ecAnimation.ring(this.zr, oldShape, newShape, duration + (ecData.get(newShape, 'dataIndex') || 0) % 20 * 100, easing); + } else if (newShape.type === 'sector') { + ecAnimation.sector(this.zr, oldShape, newShape, duration, easing); + } else { + this.zr.addShape(newShape); + } + break; + case 'text': + ecAnimation.text(this.zr, oldShape, newShape, duration, easing); + break; + case 'polygon': + if (!isUpdate) { + ecAnimation.polygon(this.zr, oldShape, newShape, duration, easing); + } else { + ecAnimation.pointList(this.zr, oldShape, newShape, duration, easing); + } + break; + case 'ribbon': + ecAnimation.ribbon(this.zr, oldShape, newShape, duration, easing); + break; + case 'gauge-pointer': + ecAnimation.gaugePointer(this.zr, oldShape, newShape, duration, easing); + break; + case 'mark-line': + ecAnimation.markline(this.zr, oldShape, newShape, duration, easing); + break; + case 'bezier-curve': + case 'line': + ecAnimation.line(this.zr, oldShape, newShape, duration, easing); + break; + default: + this.zr.addShape(newShape); + break; + } + }, + animationMark: function (duration, easing, addShapeList) { + var shapeList = addShapeList || this.shapeList; + for (var i = 0, l = shapeList.length; i < l; i++) { + if (!shapeList[i]._mark) { + continue; + } + this._animateMod(false, shapeList[i], duration, easing, 0, true); + } + this.animationEffect(addShapeList); + }, + animationEffect: function (addShapeList) { + !addShapeList && this.clearEffectShape(); + var shapeList = addShapeList || this.shapeList; + if (shapeList == null) { + return; + } + var zlevel = ecConfig.EFFECT_ZLEVEL; + if (this.canvasSupported) { + this.zr.modLayer(zlevel, { + motionBlur: true, + lastFrameAlpha: 0.95 + }); + } + var shape; + for (var i = 0, l = shapeList.length; i < l; i++) { + shape = shapeList[i]; + if (!(shape._mark && shape.effect && shape.effect.show && ecEffect[shape._mark])) { + continue; + } + ecEffect[shape._mark](this.zr, this.effectList, shape, zlevel); + this.effectList[this.effectList.length - 1]._mark = shape._mark; + } + }, + clearEffectShape: function (clearMotionBlur) { + if (this.zr && this.effectList && this.effectList.length > 0) { + clearMotionBlur && this.zr.modLayer(ecConfig.EFFECT_ZLEVEL, { motionBlur: false }); + this.zr.delShape(this.effectList); + } + this.effectList = []; + }, + addMark: function (seriesIndex, markData, markType) { + var serie = this.series[seriesIndex]; + if (this.selectedMap[serie.name]) { + var duration = this.query(this.option, 'animationDurationUpdate'); + var easing = this.query(this.option, 'animationEasing'); + var oriMarkData = serie[markType].data; + var lastLength = this.shapeList.length; + serie[markType].data = markData.data; + this['_build' + markType.replace('m', 'M')](seriesIndex); + if (this.option.animation && !this.option.renderAsImage) { + this.animationMark(duration, easing, this.shapeList.slice(lastLength)); + } else { + for (var i = lastLength, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + this.zr.refreshNextFrame(); + } + serie[markType].data = oriMarkData; + } + }, + delMark: function (seriesIndex, markName, markType) { + markType = markType.replace('mark', '').replace('large', '').toLowerCase(); + var serie = this.series[seriesIndex]; + if (this.selectedMap[serie.name]) { + var needRefresh = false; + var shapeList = [ + this.shapeList, + this.effectList + ]; + var len = 2; + while (len--) { + for (var i = 0, l = shapeList[len].length; i < l; i++) { + if (shapeList[len][i]._mark == markType && ecData.get(shapeList[len][i], 'seriesIndex') == seriesIndex && ecData.get(shapeList[len][i], 'name') == markName) { + this.zr.delShape(shapeList[len][i].id); + shapeList[len].splice(i, 1); + needRefresh = true; + break; + } + } + } + needRefresh && this.zr.refreshNextFrame(); + } + } + }; + zrUtil.inherits(Base, ComponentBase); + return Base; +});define('zrender/shape/Circle', [ + 'require', + './Base', + '../tool/util' +], function (require) { + 'use strict'; + var Base = require('./Base'); + var Circle = function (options) { + Base.call(this, options); + }; + Circle.prototype = { + type: 'circle', + buildPath: function (ctx, style) { + ctx.arc(style.x, style.y, style.r, 0, Math.PI * 2, true); + return; + }, + getRect: function (style) { + if (style.__rect) { + return style.__rect; + } + var lineWidth; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } else { + lineWidth = 0; + } + style.__rect = { + x: Math.round(style.x - style.r - lineWidth / 2), + y: Math.round(style.y - style.r - lineWidth / 2), + width: style.r * 2 + lineWidth, + height: style.r * 2 + lineWidth + }; + return style.__rect; + } + }; + require('../tool/util').inherits(Circle, Base); + return Circle; +});define('echarts/util/accMath', [], function () { + function accDiv(arg1, arg2) { + var s1 = arg1.toString(); + var s2 = arg2.toString(); + var m = 0; + try { + m = s2.split('.')[1].length; + } catch (e) { + } + try { + m -= s1.split('.')[1].length; + } catch (e) { + } + return (s1.replace('.', '') - 0) / (s2.replace('.', '') - 0) * Math.pow(10, m); + } + function accMul(arg1, arg2) { + var s1 = arg1.toString(); + var s2 = arg2.toString(); + var m = 0; + try { + m += s1.split('.')[1].length; + } catch (e) { + } + try { + m += s2.split('.')[1].length; + } catch (e) { + } + return (s1.replace('.', '') - 0) * (s2.replace('.', '') - 0) / Math.pow(10, m); + } + function accAdd(arg1, arg2) { + var r1 = 0; + var r2 = 0; + try { + r1 = arg1.toString().split('.')[1].length; + } catch (e) { + } + try { + r2 = arg2.toString().split('.')[1].length; + } catch (e) { + } + var m = Math.pow(10, Math.max(r1, r2)); + return (Math.round(arg1 * m) + Math.round(arg2 * m)) / m; + } + function accSub(arg1, arg2) { + return accAdd(arg1, -arg2); + } + return { + accDiv: accDiv, + accMul: accMul, + accAdd: accAdd, + accSub: accSub + }; +});define('echarts/util/shape/Icon', [ + 'require', + 'zrender/tool/util', + 'zrender/shape/Star', + 'zrender/shape/Heart', + 'zrender/shape/Droplet', + 'zrender/shape/Image', + 'zrender/shape/Base' +], function (require) { + var zrUtil = require('zrender/tool/util'); + function _iconMark(ctx, style) { + var x = style.x; + var y = style.y; + var dx = style.width / 16; + var dy = style.height / 16; + ctx.moveTo(x, y + style.height); + ctx.lineTo(x + 5 * dx, y + 14 * dy); + ctx.lineTo(x + style.width, y + 3 * dy); + ctx.lineTo(x + 13 * dx, y); + ctx.lineTo(x + 2 * dx, y + 11 * dy); + ctx.lineTo(x, y + style.height); + ctx.moveTo(x + 6 * dx, y + 10 * dy); + ctx.lineTo(x + 14 * dx, y + 2 * dy); + ctx.moveTo(x + 10 * dx, y + 13 * dy); + ctx.lineTo(x + style.width, y + 13 * dy); + ctx.moveTo(x + 13 * dx, y + 10 * dy); + ctx.lineTo(x + 13 * dx, y + style.height); + } + function _iconMarkUndo(ctx, style) { + var x = style.x; + var y = style.y; + var dx = style.width / 16; + var dy = style.height / 16; + ctx.moveTo(x, y + style.height); + ctx.lineTo(x + 5 * dx, y + 14 * dy); + ctx.lineTo(x + style.width, y + 3 * dy); + ctx.lineTo(x + 13 * dx, y); + ctx.lineTo(x + 2 * dx, y + 11 * dy); + ctx.lineTo(x, y + style.height); + ctx.moveTo(x + 6 * dx, y + 10 * dy); + ctx.lineTo(x + 14 * dx, y + 2 * dy); + ctx.moveTo(x + 10 * dx, y + 13 * dy); + ctx.lineTo(x + style.width, y + 13 * dy); + } + function _iconMarkClear(ctx, style) { + var x = style.x; + var y = style.y; + var dx = style.width / 16; + var dy = style.height / 16; + ctx.moveTo(x + 4 * dx, y + 15 * dy); + ctx.lineTo(x + 9 * dx, y + 13 * dy); + ctx.lineTo(x + 14 * dx, y + 8 * dy); + ctx.lineTo(x + 11 * dx, y + 5 * dy); + ctx.lineTo(x + 6 * dx, y + 10 * dy); + ctx.lineTo(x + 4 * dx, y + 15 * dy); + ctx.moveTo(x + 5 * dx, y); + ctx.lineTo(x + 11 * dx, y); + ctx.moveTo(x + 5 * dx, y + dy); + ctx.lineTo(x + 11 * dx, y + dy); + ctx.moveTo(x, y + 2 * dy); + ctx.lineTo(x + style.width, y + 2 * dy); + ctx.moveTo(x, y + 5 * dy); + ctx.lineTo(x + 3 * dx, y + style.height); + ctx.lineTo(x + 13 * dx, y + style.height); + ctx.lineTo(x + style.width, y + 5 * dy); + } + function _iconDataZoom(ctx, style) { + var x = style.x; + var y = style.y; + var dx = style.width / 16; + var dy = style.height / 16; + ctx.moveTo(x, y + 3 * dy); + ctx.lineTo(x + 6 * dx, y + 3 * dy); + ctx.moveTo(x + 3 * dx, y); + ctx.lineTo(x + 3 * dx, y + 6 * dy); + ctx.moveTo(x + 3 * dx, y + 8 * dy); + ctx.lineTo(x + 3 * dx, y + style.height); + ctx.lineTo(x + style.width, y + style.height); + ctx.lineTo(x + style.width, y + 3 * dy); + ctx.lineTo(x + 8 * dx, y + 3 * dy); + } + function _iconDataZoomReset(ctx, style) { + var x = style.x; + var y = style.y; + var dx = style.width / 16; + var dy = style.height / 16; + ctx.moveTo(x + 6 * dx, y); + ctx.lineTo(x + 2 * dx, y + 3 * dy); + ctx.lineTo(x + 6 * dx, y + 6 * dy); + ctx.moveTo(x + 2 * dx, y + 3 * dy); + ctx.lineTo(x + 14 * dx, y + 3 * dy); + ctx.lineTo(x + 14 * dx, y + 11 * dy); + ctx.moveTo(x + 2 * dx, y + 5 * dy); + ctx.lineTo(x + 2 * dx, y + 13 * dy); + ctx.lineTo(x + 14 * dx, y + 13 * dy); + ctx.moveTo(x + 10 * dx, y + 10 * dy); + ctx.lineTo(x + 14 * dx, y + 13 * dy); + ctx.lineTo(x + 10 * dx, y + style.height); + } + function _iconRestore(ctx, style) { + var x = style.x; + var y = style.y; + var dx = style.width / 16; + var dy = style.height / 16; + var r = style.width / 2; + ctx.lineWidth = 1.5; + ctx.arc(x + r, y + r, r - dx, 0, Math.PI * 2 / 3); + ctx.moveTo(x + 3 * dx, y + style.height); + ctx.lineTo(x + 0 * dx, y + 12 * dy); + ctx.lineTo(x + 5 * dx, y + 11 * dy); + ctx.moveTo(x, y + 8 * dy); + ctx.arc(x + r, y + r, r - dx, Math.PI, Math.PI * 5 / 3); + ctx.moveTo(x + 13 * dx, y); + ctx.lineTo(x + style.width, y + 4 * dy); + ctx.lineTo(x + 11 * dx, y + 5 * dy); + } + function _iconLineChart(ctx, style) { + var x = style.x; + var y = style.y; + var dx = style.width / 16; + var dy = style.height / 16; + ctx.moveTo(x, y); + ctx.lineTo(x, y + style.height); + ctx.lineTo(x + style.width, y + style.height); + ctx.moveTo(x + 2 * dx, y + 14 * dy); + ctx.lineTo(x + 7 * dx, y + 6 * dy); + ctx.lineTo(x + 11 * dx, y + 11 * dy); + ctx.lineTo(x + 15 * dx, y + 2 * dy); + } + function _iconBarChart(ctx, style) { + var x = style.x; + var y = style.y; + var dx = style.width / 16; + var dy = style.height / 16; + ctx.moveTo(x, y); + ctx.lineTo(x, y + style.height); + ctx.lineTo(x + style.width, y + style.height); + ctx.moveTo(x + 3 * dx, y + 14 * dy); + ctx.lineTo(x + 3 * dx, y + 6 * dy); + ctx.lineTo(x + 4 * dx, y + 6 * dy); + ctx.lineTo(x + 4 * dx, y + 14 * dy); + ctx.moveTo(x + 7 * dx, y + 14 * dy); + ctx.lineTo(x + 7 * dx, y + 2 * dy); + ctx.lineTo(x + 8 * dx, y + 2 * dy); + ctx.lineTo(x + 8 * dx, y + 14 * dy); + ctx.moveTo(x + 11 * dx, y + 14 * dy); + ctx.lineTo(x + 11 * dx, y + 9 * dy); + ctx.lineTo(x + 12 * dx, y + 9 * dy); + ctx.lineTo(x + 12 * dx, y + 14 * dy); + } + function _iconPieChart(ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width - 2; + var height = style.height - 2; + var r = Math.min(width, height) / 2; + y += 2; + ctx.moveTo(x + r + 3, y + r - 3); + ctx.arc(x + r + 3, y + r - 3, r - 1, 0, -Math.PI / 2, true); + ctx.lineTo(x + r + 3, y + r - 3); + ctx.moveTo(x + r, y); + ctx.lineTo(x + r, y + r); + ctx.arc(x + r, y + r, r, -Math.PI / 2, Math.PI * 2, true); + ctx.lineTo(x + r, y + r); + ctx.lineWidth = 1.5; + } + function _iconFunnelChart(ctx, style) { + var x = style.x; + var y = style.y; + var dx = style.width / 16; + var dy = style.height / 16; + y -= dy; + ctx.moveTo(x + 1 * dx, y + 2 * dy); + ctx.lineTo(x + 15 * dx, y + 2 * dy); + ctx.lineTo(x + 14 * dx, y + 3 * dy); + ctx.lineTo(x + 2 * dx, y + 3 * dy); + ctx.moveTo(x + 3 * dx, y + 6 * dy); + ctx.lineTo(x + 13 * dx, y + 6 * dy); + ctx.lineTo(x + 12 * dx, y + 7 * dy); + ctx.lineTo(x + 4 * dx, y + 7 * dy); + ctx.moveTo(x + 5 * dx, y + 10 * dy); + ctx.lineTo(x + 11 * dx, y + 10 * dy); + ctx.lineTo(x + 10 * dx, y + 11 * dy); + ctx.lineTo(x + 6 * dx, y + 11 * dy); + ctx.moveTo(x + 7 * dx, y + 14 * dy); + ctx.lineTo(x + 9 * dx, y + 14 * dy); + ctx.lineTo(x + 8 * dx, y + 15 * dy); + ctx.lineTo(x + 7 * dx, y + 15 * dy); + } + function _iconForceChart(ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + var dx = width / 16; + var dy = height / 16; + var r = Math.min(dx, dy) * 2; + ctx.moveTo(x + dx + r, y + dy + r); + ctx.arc(x + dx, y + dy, r, Math.PI / 4, Math.PI * 3); + ctx.lineTo(x + 7 * dx - r, y + 6 * dy - r); + ctx.arc(x + 7 * dx, y + 6 * dy, r, Math.PI / 4 * 5, Math.PI * 4); + ctx.arc(x + 7 * dx, y + 6 * dy, r / 2, Math.PI / 4 * 5, Math.PI * 4); + ctx.moveTo(x + 7 * dx - r / 2, y + 6 * dy + r); + ctx.lineTo(x + dx + r, y + 14 * dy - r); + ctx.arc(x + dx, y + 14 * dy, r, -Math.PI / 4, Math.PI * 2); + ctx.moveTo(x + 7 * dx + r / 2, y + 6 * dy); + ctx.lineTo(x + 14 * dx - r, y + 10 * dy - r / 2); + ctx.moveTo(x + 16 * dx, y + 10 * dy); + ctx.arc(x + 14 * dx, y + 10 * dy, r, 0, Math.PI * 3); + ctx.lineWidth = 1.5; + } + function _iconChordChart(ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + var r = Math.min(width, height) / 2; + ctx.moveTo(x + width, y + height / 2); + ctx.arc(x + r, y + r, r, 0, Math.PI * 2); + ctx.arc(x + r, y, r, Math.PI / 4, Math.PI / 5 * 4); + ctx.arc(x, y + r, r, -Math.PI / 3, Math.PI / 3); + ctx.arc(x + width, y + height, r, Math.PI, Math.PI / 2 * 3); + ctx.lineWidth = 1.5; + } + function _iconStackChart(ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + var dy = Math.round(height / 3); + var delta = Math.round((dy - 2) / 2); + var len = 3; + while (len--) { + ctx.rect(x, y + dy * len + delta, width, 2); + } + } + function _iconTiledChart(ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + var dx = Math.round(width / 3); + var delta = Math.round((dx - 2) / 2); + var len = 3; + while (len--) { + ctx.rect(x + dx * len + delta, y, 2, height); + } + } + function _iconDataView(ctx, style) { + var x = style.x; + var y = style.y; + var dx = style.width / 16; + ctx.moveTo(x + dx, y); + ctx.lineTo(x + dx, y + style.height); + ctx.lineTo(x + 15 * dx, y + style.height); + ctx.lineTo(x + 15 * dx, y); + ctx.lineTo(x + dx, y); + ctx.moveTo(x + 3 * dx, y + 3 * dx); + ctx.lineTo(x + 13 * dx, y + 3 * dx); + ctx.moveTo(x + 3 * dx, y + 6 * dx); + ctx.lineTo(x + 13 * dx, y + 6 * dx); + ctx.moveTo(x + 3 * dx, y + 9 * dx); + ctx.lineTo(x + 13 * dx, y + 9 * dx); + ctx.moveTo(x + 3 * dx, y + 12 * dx); + ctx.lineTo(x + 9 * dx, y + 12 * dx); + } + function _iconSave(ctx, style) { + var x = style.x; + var y = style.y; + var dx = style.width / 16; + var dy = style.height / 16; + ctx.moveTo(x, y); + ctx.lineTo(x, y + style.height); + ctx.lineTo(x + style.width, y + style.height); + ctx.lineTo(x + style.width, y); + ctx.lineTo(x, y); + ctx.moveTo(x + 4 * dx, y); + ctx.lineTo(x + 4 * dx, y + 8 * dy); + ctx.lineTo(x + 12 * dx, y + 8 * dy); + ctx.lineTo(x + 12 * dx, y); + ctx.moveTo(x + 6 * dx, y + 11 * dy); + ctx.lineTo(x + 6 * dx, y + 13 * dy); + ctx.lineTo(x + 10 * dx, y + 13 * dy); + ctx.lineTo(x + 10 * dx, y + 11 * dy); + ctx.lineTo(x + 6 * dx, y + 11 * dy); + } + function _iconCross(ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + ctx.moveTo(x, y + height / 2); + ctx.lineTo(x + width, y + height / 2); + ctx.moveTo(x + width / 2, y); + ctx.lineTo(x + width / 2, y + height); + } + function _iconCircle(ctx, style) { + var width = style.width / 2; + var height = style.height / 2; + var r = Math.min(width, height); + ctx.moveTo(style.x + width + r, style.y + height); + ctx.arc(style.x + width, style.y + height, r, 0, Math.PI * 2); + ctx.closePath(); + } + function _iconRectangle(ctx, style) { + ctx.rect(style.x, style.y, style.width, style.height); + ctx.closePath(); + } + function _iconTriangle(ctx, style) { + var width = style.width / 2; + var height = style.height / 2; + var x = style.x + width; + var y = style.y + height; + var symbolSize = Math.min(width, height); + ctx.moveTo(x, y - symbolSize); + ctx.lineTo(x + symbolSize, y + symbolSize); + ctx.lineTo(x - symbolSize, y + symbolSize); + ctx.lineTo(x, y - symbolSize); + ctx.closePath(); + } + function _iconDiamond(ctx, style) { + var width = style.width / 2; + var height = style.height / 2; + var x = style.x + width; + var y = style.y + height; + var symbolSize = Math.min(width, height); + ctx.moveTo(x, y - symbolSize); + ctx.lineTo(x + symbolSize, y); + ctx.lineTo(x, y + symbolSize); + ctx.lineTo(x - symbolSize, y); + ctx.lineTo(x, y - symbolSize); + ctx.closePath(); + } + function _iconArrow(ctx, style) { + var x = style.x; + var y = style.y; + var dx = style.width / 16; + ctx.moveTo(x + 8 * dx, y); + ctx.lineTo(x + dx, y + style.height); + ctx.lineTo(x + 8 * dx, y + style.height / 4 * 3); + ctx.lineTo(x + 15 * dx, y + style.height); + ctx.lineTo(x + 8 * dx, y); + ctx.closePath(); + } + function _iconStar(ctx, style) { + var StarShape = require('zrender/shape/Star'); + var width = style.width / 2; + var height = style.height / 2; + StarShape.prototype.buildPath(ctx, { + x: style.x + width, + y: style.y + height, + r: Math.min(width, height), + n: style.n || 5 + }); + } + function _iconHeart(ctx, style) { + var HeartShape = require('zrender/shape/Heart'); + HeartShape.prototype.buildPath(ctx, { + x: style.x + style.width / 2, + y: style.y + style.height * 0.2, + a: style.width / 2, + b: style.height * 0.8 + }); + } + function _iconDroplet(ctx, style) { + var DropletShape = require('zrender/shape/Droplet'); + DropletShape.prototype.buildPath(ctx, { + x: style.x + style.width * 0.5, + y: style.y + style.height * 0.5, + a: style.width * 0.5, + b: style.height * 0.8 + }); + } + function _iconPin(ctx, style) { + var x = style.x; + var y = style.y - style.height / 2 * 1.5; + var width = style.width / 2; + var height = style.height / 2; + var r = Math.min(width, height); + ctx.arc(x + width, y + height, r, Math.PI / 5 * 4, Math.PI / 5); + ctx.lineTo(x + width, y + height + r * 1.5); + ctx.closePath(); + } + function _iconImage(ctx, style, refreshNextFrame) { + var ImageShape = require('zrender/shape/Image'); + this._imageShape = this._imageShape || new ImageShape({ style: {} }); + for (var name in style) { + this._imageShape.style[name] = style[name]; + } + this._imageShape.brush(ctx, false, refreshNextFrame); + } + var Base = require('zrender/shape/Base'); + function Icon(options) { + Base.call(this, options); + } + Icon.prototype = { + type: 'icon', + iconLibrary: { + mark: _iconMark, + markUndo: _iconMarkUndo, + markClear: _iconMarkClear, + dataZoom: _iconDataZoom, + dataZoomReset: _iconDataZoomReset, + restore: _iconRestore, + lineChart: _iconLineChart, + barChart: _iconBarChart, + pieChart: _iconPieChart, + funnelChart: _iconFunnelChart, + forceChart: _iconForceChart, + chordChart: _iconChordChart, + stackChart: _iconStackChart, + tiledChart: _iconTiledChart, + dataView: _iconDataView, + saveAsImage: _iconSave, + cross: _iconCross, + circle: _iconCircle, + rectangle: _iconRectangle, + triangle: _iconTriangle, + diamond: _iconDiamond, + arrow: _iconArrow, + star: _iconStar, + heart: _iconHeart, + droplet: _iconDroplet, + pin: _iconPin, + image: _iconImage + }, + brush: function (ctx, isHighlight, refreshNextFrame) { + var style = isHighlight ? this.highlightStyle : this.style; + style = style || {}; + var iconType = style.iconType || this.style.iconType; + if (iconType === 'image') { + var ImageShape = require('zrender/shape/Image'); + ImageShape.prototype.brush.call(this, ctx, isHighlight, refreshNextFrame); + } else { + var style = this.beforeBrush(ctx, isHighlight); + ctx.beginPath(); + this.buildPath(ctx, style, refreshNextFrame); + switch (style.brushType) { + case 'both': + ctx.fill(); + case 'stroke': + style.lineWidth > 0 && ctx.stroke(); + break; + default: + ctx.fill(); + } + this.drawText(ctx, style, this.style); + this.afterBrush(ctx); + } + }, + buildPath: function (ctx, style, refreshNextFrame) { + if (this.iconLibrary[style.iconType]) { + this.iconLibrary[style.iconType].call(this, ctx, style, refreshNextFrame); + } else { + ctx.moveTo(style.x, style.y); + ctx.lineTo(style.x + style.width, style.y); + ctx.lineTo(style.x + style.width, style.y + style.height); + ctx.lineTo(style.x, style.y + style.height); + ctx.lineTo(style.x, style.y); + ctx.closePath(); + } + return; + }, + getRect: function (style) { + if (style.__rect) { + return style.__rect; + } + style.__rect = { + x: Math.round(style.x), + y: Math.round(style.y - (style.iconType == 'pin' ? style.height / 2 * 1.5 : 0)), + width: style.width, + height: style.height * (style.iconType === 'pin' ? 1.25 : 1) + }; + return style.__rect; + }, + isCover: function (x, y) { + var originPos = this.getTansform(x, y); + x = originPos[0]; + y = originPos[1]; + var rect = this.style.__rect; + if (!rect) { + rect = this.style.__rect = this.getRect(this.style); + } + var delta = rect.height < 8 || rect.width < 8 ? 4 : 0; + if (x >= rect.x - delta && x <= rect.x + rect.width + delta && y >= rect.y - delta && y <= rect.y + rect.height + delta) { + return true; + } else { + return false; + } + } + }; + zrUtil.inherits(Icon, Base); + return Icon; +});define('echarts/util/shape/MarkLine', [ + 'require', + 'zrender/shape/Base', + './Icon', + 'zrender/shape/Line', + 'zrender/shape/Polyline', + 'zrender/tool/matrix', + 'zrender/tool/area', + 'zrender/shape/util/dashedLineTo', + 'zrender/shape/util/smoothSpline', + 'zrender/tool/util' +], function (require) { + var Base = require('zrender/shape/Base'); + var IconShape = require('./Icon'); + var LineShape = require('zrender/shape/Line'); + var lineInstance = new LineShape({}); + var PolylineShape = require('zrender/shape/Polyline'); + var polylineInstance = new PolylineShape({}); + var matrix = require('zrender/tool/matrix'); + var area = require('zrender/tool/area'); + var dashedLineTo = require('zrender/shape/util/dashedLineTo'); + var smoothSpline = require('zrender/shape/util/smoothSpline'); + var zrUtil = require('zrender/tool/util'); + function MarkLine(options) { + Base.call(this, options); + } + MarkLine.prototype = { + type: 'mark-line', + brush: function (ctx, isHighlight) { + var style = this.style; + if (isHighlight) { + style = this.getHighlightStyle(style, this.highlightStyle || {}); + } + ctx.save(); + this.setContext(ctx, style); + this.setTransform(ctx); + ctx.save(); + ctx.beginPath(); + this.buildLinePath(ctx, style, this.style.lineWidth || 1); + ctx.stroke(); + ctx.restore(); + this.brushSymbol(ctx, style, 0); + this.brushSymbol(ctx, style, 1); + this.drawText(ctx, style, this.style); + ctx.restore(); + }, + buildLinePath: function (ctx, style, lineWidth) { + var pointList = style.pointList || this.getPointList(style); + style.pointList = pointList; + var len = Math.min(style.pointList.length, Math.round(style.pointListLength || style.pointList.length)); + if (!style.lineType || style.lineType == 'solid') { + ctx.moveTo(pointList[0][0], pointList[0][1]); + for (var i = 1; i < len; i++) { + ctx.lineTo(pointList[i][0], pointList[i][1]); + } + } else if (style.lineType == 'dashed' || style.lineType == 'dotted') { + if (style.smooth !== 'spline') { + var dashLength = lineWidth * (style.lineType == 'dashed' ? 5 : 1); + ctx.moveTo(pointList[0][0], pointList[0][1]); + for (var i = 1; i < len; i++) { + dashedLineTo(ctx, pointList[i - 1][0], pointList[i - 1][1], pointList[i][0], pointList[i][1], dashLength); + } + } else { + for (var i = 1; i < len; i += 2) { + ctx.moveTo(pointList[i - 1][0], pointList[i - 1][1]); + ctx.lineTo(pointList[i][0], pointList[i][1]); + } + } + } + }, + brushSymbol: function (ctx, style, idx) { + if (style.symbol[idx] == 'none') { + return; + } + ctx.save(); + ctx.beginPath(); + ctx.lineWidth = style.symbolBorder; + ctx.strokeStyle = style.symbolBorderColor; + style.iconType = style.symbol[idx].replace('empty', '').toLowerCase(); + if (style.symbol[idx].match('empty')) { + ctx.fillStyle = '#fff'; + } + var len = Math.min(style.pointList.length, Math.round(style.pointListLength || style.pointList.length)); + var x = idx === 0 ? style.pointList[0][0] : style.pointList[len - 1][0]; + var y = idx === 0 ? style.pointList[0][1] : style.pointList[len - 1][1]; + var rotate = typeof style.symbolRotate[idx] != 'undefined' ? style.symbolRotate[idx] - 0 : 0; + var transform; + if (rotate !== 0) { + transform = matrix.create(); + matrix.identity(transform); + if (x || y) { + matrix.translate(transform, transform, [ + -x, + -y + ]); + } + matrix.rotate(transform, transform, rotate * Math.PI / 180); + if (x || y) { + matrix.translate(transform, transform, [ + x, + y + ]); + } + ctx.transform.apply(ctx, transform); + } + if (style.iconType == 'arrow' && rotate === 0) { + this.buildArrawPath(ctx, style, idx); + } else { + var symbolSize = style.symbolSize[idx]; + style.x = x - symbolSize; + style.y = y - symbolSize, style.width = symbolSize * 2; + style.height = symbolSize * 2; + IconShape.prototype.buildPath(ctx, style); + } + ctx.closePath(); + ctx.fill(); + ctx.stroke(); + ctx.restore(); + }, + buildArrawPath: function (ctx, style, idx) { + var len = Math.min(style.pointList.length, Math.round(style.pointListLength || style.pointList.length)); + var symbolSize = style.symbolSize[idx] * 2; + var xStart = style.pointList[0][0]; + var xEnd = style.pointList[len - 1][0]; + var yStart = style.pointList[0][1]; + var yEnd = style.pointList[len - 1][1]; + var delta = 0; + if (style.smooth === 'spline') { + delta = style.smoothRadian * (xStart <= xEnd ? 1 : -1); + } + var rotate = Math.atan(Math.abs((yEnd - yStart) / (xStart - xEnd))); + if (idx === 0) { + if (xEnd > xStart) { + if (yEnd > yStart) { + rotate = Math.PI * 2 - rotate + delta; + } else { + rotate += delta; + } + } else { + if (yEnd > yStart) { + rotate += Math.PI - delta; + } else { + rotate = Math.PI - rotate - delta; + } + } + } else { + if (xStart > xEnd) { + if (yStart > yEnd) { + rotate = Math.PI * 2 - rotate + delta; + } else { + rotate += delta; + } + } else { + if (yStart > yEnd) { + rotate += Math.PI - delta; + } else { + rotate = Math.PI - rotate - delta; + } + } + } + var halfRotate = Math.PI / 8; + var x = idx === 0 ? xStart : xEnd; + var y = idx === 0 ? yStart : yEnd; + var point = [ + [ + x + symbolSize * Math.cos(rotate - halfRotate), + y - symbolSize * Math.sin(rotate - halfRotate) + ], + [ + x + symbolSize * 0.6 * Math.cos(rotate), + y - symbolSize * 0.6 * Math.sin(rotate) + ], + [ + x + symbolSize * Math.cos(rotate + halfRotate), + y - symbolSize * Math.sin(rotate + halfRotate) + ] + ]; + ctx.moveTo(x, y); + for (var i = 0, l = point.length; i < l; i++) { + ctx.lineTo(point[i][0], point[i][1]); + } + ctx.lineTo(x, y); + }, + getPointList: function (style) { + var pointList = [ + [ + style.xStart, + style.yStart + ], + [ + style.xEnd, + style.yEnd + ] + ]; + if (style.smooth === 'spline') { + var lastPointX = pointList[1][0]; + var lastPointY = pointList[1][1]; + if (style.smoothRadian <= 0.8) { + pointList[3] = [ + lastPointX, + lastPointY + ]; + var isReverse = pointList[0][0] <= pointList[3][0]; + pointList[1] = this.getOffetPoint(pointList[0], pointList[3], isReverse, style.smoothRadian); + pointList[2] = this.getOffetPoint(pointList[3], pointList[0], isReverse, style.smoothRadian); + } else { + pointList[2] = [ + lastPointX, + lastPointY + ]; + pointList[1] = this.getOffetPoint(pointList[0], pointList[2], pointList[0][0] <= pointList[2][0], style.smoothRadian); + } + pointList = smoothSpline(pointList, false); + pointList[pointList.length - 1] = [ + lastPointX, + lastPointY + ]; + } + return pointList; + }, + getOffetPoint: function (sp, ep, isReverse, deltaAngle) { + var split = (2 - Math.abs(deltaAngle)) / 0.6; + var distance = Math.sqrt(Math.round((sp[0] - ep[0]) * (sp[0] - ep[0]) + (sp[1] - ep[1]) * (sp[1] - ep[1]))) / split; + var mp = [ + sp[0], + sp[1] + ]; + var angle; + if (sp[0] != ep[0] && sp[1] != ep[1]) { + var k = (ep[1] - sp[1]) / (ep[0] - sp[0]); + angle = Math.atan(k); + } else if (sp[0] == ep[0]) { + angle = (sp[1] <= ep[1] ? 1 : -1) * Math.PI / 2; + } else { + angle = 0; + } + var dX; + var dY; + if (sp[0] <= ep[0]) { + angle -= deltaAngle * (isReverse ? 1 : -1); + dX = Math.round(Math.cos(angle) * distance); + dY = Math.round(Math.sin(angle) * distance); + mp[0] += dX; + mp[1] += dY; + } else { + angle += deltaAngle * (isReverse ? 1 : -1); + dX = Math.round(Math.cos(angle) * distance); + dY = Math.round(Math.sin(angle) * distance); + mp[0] -= dX; + mp[1] -= dY; + } + return mp; + }, + getRect: function (style) { + if (style.__rect) { + return style.__rect; + } + var lineWidth = style.lineWidth || 1; + style.__rect = { + x: Math.min(style.xStart, style.xEnd) - lineWidth, + y: Math.min(style.yStart, style.yEnd) - lineWidth, + width: Math.abs(style.xStart - style.xEnd) + lineWidth, + height: Math.abs(style.yStart - style.yEnd) + lineWidth + }; + return style.__rect; + }, + isCover: function (x, y) { + var originPos = this.getTansform(x, y); + x = originPos[0]; + y = originPos[1]; + var rect = this.style.__rect; + if (!rect) { + rect = this.style.__rect = this.getRect(this.style); + } + if (x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height) { + return this.style.smooth !== 'spline' ? area.isInside(lineInstance, this.style, x, y) : area.isInside(polylineInstance, this.style, x, y); + } + return false; + } + }; + zrUtil.inherits(MarkLine, Base); + return MarkLine; +});define('echarts/util/shape/Symbol', [ + 'require', + 'zrender/shape/Base', + 'zrender/shape/Polygon', + 'zrender/tool/util', + './normalIsCover' +], function (require) { + var Base = require('zrender/shape/Base'); + var PolygonShape = require('zrender/shape/Polygon'); + var polygonInstance = new PolygonShape({}); + var zrUtil = require('zrender/tool/util'); + function Symbol(options) { + Base.call(this, options); + } + Symbol.prototype = { + type: 'symbol', + buildPath: function (ctx, style) { + var pointList = style.pointList; + var len = pointList.length; + if (len === 0) { + return; + } + var subSize = 10000; + var subSetLength = Math.ceil(len / subSize); + var sub; + var subLen; + var isArray = pointList[0] instanceof Array; + var size = style.size ? style.size : 2; + var curSize = size; + var halfSize = size / 2; + var PI2 = Math.PI * 2; + var percent; + var x; + var y; + for (var j = 0; j < subSetLength; j++) { + ctx.beginPath(); + sub = j * subSize; + subLen = sub + subSize; + subLen = subLen > len ? len : subLen; + for (var i = sub; i < subLen; i++) { + if (style.random) { + percent = style['randomMap' + i % 20] / 100; + curSize = size * percent * percent; + halfSize = curSize / 2; + } + if (isArray) { + x = pointList[i][0]; + y = pointList[i][1]; + } else { + x = pointList[i].x; + y = pointList[i].y; + } + if (curSize < 3) { + ctx.rect(x - halfSize, y - halfSize, curSize, curSize); + } else { + switch (style.iconType) { + case 'circle': + ctx.moveTo(x, y); + ctx.arc(x, y, halfSize, 0, PI2, true); + break; + case 'diamond': + ctx.moveTo(x, y - halfSize); + ctx.lineTo(x + halfSize / 3, y - halfSize / 3); + ctx.lineTo(x + halfSize, y); + ctx.lineTo(x + halfSize / 3, y + halfSize / 3); + ctx.lineTo(x, y + halfSize); + ctx.lineTo(x - halfSize / 3, y + halfSize / 3); + ctx.lineTo(x - halfSize, y); + ctx.lineTo(x - halfSize / 3, y - halfSize / 3); + ctx.lineTo(x, y - halfSize); + break; + default: + ctx.rect(x - halfSize, y - halfSize, curSize, curSize); + } + } + } + ctx.closePath(); + if (j < subSetLength - 1) { + switch (style.brushType) { + case 'both': + ctx.fill(); + style.lineWidth > 0 && ctx.stroke(); + break; + case 'stroke': + style.lineWidth > 0 && ctx.stroke(); + break; + default: + ctx.fill(); + } + } + } + }, + getRect: function (style) { + return style.__rect || polygonInstance.getRect(style); + }, + isCover: require('./normalIsCover') + }; + zrUtil.inherits(Symbol, Base); + return Symbol; +});define('echarts/util/ecAnimation', [ + 'require', + 'zrender/tool/util', + 'zrender/shape/Polygon' +], function (require) { + var zrUtil = require('zrender/tool/util'); + function pointList(zr, oldShape, newShape, duration, easing) { + var newPointList = newShape.style.pointList; + var newPointListLen = newPointList.length; + var oldPointList; + if (!oldShape) { + oldPointList = []; + if (newShape._orient != 'vertical') { + var y = newPointList[0][1]; + for (var i = 0; i < newPointListLen; i++) { + oldPointList[i] = [ + newPointList[i][0], + y + ]; + } + } else { + var x = newPointList[0][0]; + for (var i = 0; i < newPointListLen; i++) { + oldPointList[i] = [ + x, + newPointList[i][1] + ]; + } + } + if (newShape.type == 'half-smooth-polygon') { + oldPointList[newPointListLen - 1] = zrUtil.clone(newPointList[newPointListLen - 1]); + oldPointList[newPointListLen - 2] = zrUtil.clone(newPointList[newPointListLen - 2]); + } + oldShape = { style: { pointList: oldPointList } }; + } + oldPointList = oldShape.style.pointList; + var oldPointListLen = oldPointList.length; + if (oldPointListLen == newPointListLen) { + newShape.style.pointList = oldPointList; + } else if (oldPointListLen < newPointListLen) { + newShape.style.pointList = oldPointList.concat(newPointList.slice(oldPointListLen)); + } else { + newShape.style.pointList = oldPointList.slice(0, newPointListLen); + } + zr.addShape(newShape); + newShape._animating = true; + zr.animate(newShape.id, 'style').when(duration, { pointList: newPointList }).done(function () { + newShape._animating = false; + }).start(easing); + } + function cloneStyle(target, source) { + var len = arguments.length; + for (var i = 2; i < len; i++) { + var prop = arguments[i]; + target.style[prop] = source.style[prop]; + } + } + function rectangle(zr, oldShape, newShape, duration, easing) { + var newShapeStyle = newShape.style; + if (!oldShape) { + oldShape = { + position: newShape.position, + style: { + x: newShapeStyle.x, + y: newShape._orient == 'vertical' ? newShapeStyle.y + newShapeStyle.height : newShapeStyle.y, + width: newShape._orient == 'vertical' ? newShapeStyle.width : 0, + height: newShape._orient != 'vertical' ? newShapeStyle.height : 0 + } + }; + } + var newX = newShapeStyle.x; + var newY = newShapeStyle.y; + var newWidth = newShapeStyle.width; + var newHeight = newShapeStyle.height; + var newPosition = [ + newShape.position[0], + newShape.position[1] + ]; + cloneStyle(newShape, oldShape, 'x', 'y', 'width', 'height'); + newShape.position = oldShape.position; + zr.addShape(newShape); + if (newPosition[0] != oldShape.position[0] || newPosition[1] != oldShape.position[1]) { + zr.animate(newShape.id, '').when(duration, { position: newPosition }).start(easing); + } + newShape._animating = true; + zr.animate(newShape.id, 'style').when(duration, { + x: newX, + y: newY, + width: newWidth, + height: newHeight + }).done(function () { + newShape._animating = false; + }).start(easing); + } + function candle(zr, oldShape, newShape, duration, easing) { + if (!oldShape) { + var y = newShape.style.y; + oldShape = { + style: { + y: [ + y[0], + y[0], + y[0], + y[0] + ] + } + }; + } + var newY = newShape.style.y; + newShape.style.y = oldShape.style.y; + zr.addShape(newShape); + newShape._animating = true; + zr.animate(newShape.id, 'style').when(duration, { y: newY }).done(function () { + newShape._animating = false; + }).start(easing); + } + function ring(zr, oldShape, newShape, duration, easing) { + var x = newShape.style.x; + var y = newShape.style.y; + var r0 = newShape.style.r0; + var r = newShape.style.r; + newShape._animating = true; + if (newShape._animationAdd != 'r') { + newShape.style.r0 = 0; + newShape.style.r = 0; + newShape.rotation = [ + Math.PI * 2, + x, + y + ]; + zr.addShape(newShape); + zr.animate(newShape.id, 'style').when(duration, { + r0: r0, + r: r + }).done(function () { + newShape._animating = false; + }).start(easing); + zr.animate(newShape.id, '').when(Math.round(duration / 3 * 2), { + rotation: [ + 0, + x, + y + ] + }).start(easing); + } else { + newShape.style.r0 = newShape.style.r; + zr.addShape(newShape); + zr.animate(newShape.id, 'style').when(duration, { r0: r0 }).done(function () { + newShape._animating = false; + }).start(easing); + } + } + function sector(zr, oldShape, newShape, duration, easing) { + if (!oldShape) { + if (newShape._animationAdd != 'r') { + oldShape = { + style: { + startAngle: newShape.style.startAngle, + endAngle: newShape.style.startAngle + } + }; + } else { + oldShape = { style: { r0: newShape.style.r } }; + } + } + var startAngle = newShape.style.startAngle; + var endAngle = newShape.style.endAngle; + cloneStyle(newShape, oldShape, 'startAngle', 'endAngle'); + zr.addShape(newShape); + newShape._animating = true; + zr.animate(newShape.id, 'style').when(duration, { + startAngle: startAngle, + endAngle: endAngle + }).done(function () { + newShape._animating = false; + }).start(easing); + } + function text(zr, oldShape, newShape, duration, easing) { + if (!oldShape) { + oldShape = { + style: { + x: newShape.style.textAlign == 'left' ? newShape.style.x + 100 : newShape.style.x - 100, + y: newShape.style.y + } + }; + } + var x = newShape.style.x; + var y = newShape.style.y; + cloneStyle(newShape, oldShape, 'x', 'y'); + zr.addShape(newShape); + newShape._animating = true; + zr.animate(newShape.id, 'style').when(duration, { + x: x, + y: y + }).done(function () { + newShape._animating = false; + }).start(easing); + } + function polygon(zr, oldShape, newShape, duration, easing) { + var rect = require('zrender/shape/Polygon').prototype.getRect(newShape.style); + var x = rect.x + rect.width / 2; + var y = rect.y + rect.height / 2; + newShape.scale = [ + 0.1, + 0.1, + x, + y + ]; + zr.addShape(newShape); + newShape._animating = true; + zr.animate(newShape.id, '').when(duration, { + scale: [ + 1, + 1, + x, + y + ] + }).done(function () { + newShape._animating = false; + }).start(easing); + } + function ribbon(zr, oldShape, newShape, duration, easing) { + if (!oldShape) { + oldShape = { + style: { + source0: 0, + source1: newShape.style.source1 > 0 ? 360 : -360, + target0: 0, + target1: newShape.style.target1 > 0 ? 360 : -360 + } + }; + } + var source0 = newShape.style.source0; + var source1 = newShape.style.source1; + var target0 = newShape.style.target0; + var target1 = newShape.style.target1; + if (oldShape.style) { + cloneStyle(newShape, oldShape, 'source0', 'source1', 'target0', 'target1'); + } + zr.addShape(newShape); + newShape._animating = true; + zr.animate(newShape.id, 'style').when(duration, { + source0: source0, + source1: source1, + target0: target0, + target1: target1 + }).done(function () { + newShape._animating = false; + }).start(easing); + } + function gaugePointer(zr, oldShape, newShape, duration, easing) { + if (!oldShape) { + oldShape = { style: { angle: newShape.style.startAngle } }; + } + var angle = newShape.style.angle; + newShape.style.angle = oldShape.style.angle; + zr.addShape(newShape); + newShape._animating = true; + zr.animate(newShape.id, 'style').when(duration, { angle: angle }).done(function () { + newShape._animating = false; + }).start(easing); + } + function icon(zr, oldShape, newShape, duration, easing, delay) { + newShape.style._x = newShape.style.x; + newShape.style._y = newShape.style.y; + newShape.style._width = newShape.style.width; + newShape.style._height = newShape.style.height; + if (!oldShape) { + var x = newShape._x || 0; + var y = newShape._y || 0; + newShape.scale = [ + 0.01, + 0.01, + x, + y + ]; + zr.addShape(newShape); + newShape._animating = true; + zr.animate(newShape.id, '').delay(delay).when(duration, { + scale: [ + 1, + 1, + x, + y + ] + }).done(function () { + newShape._animating = false; + }).start(easing || 'QuinticOut'); + } else { + rectangle(zr, oldShape, newShape, duration, easing); + } + } + function line(zr, oldShape, newShape, duration, easing) { + if (!oldShape) { + oldShape = { + style: { + xStart: newShape.style.xStart, + yStart: newShape.style.yStart, + xEnd: newShape.style.xStart, + yEnd: newShape.style.yStart + } + }; + } + var xStart = newShape.style.xStart; + var xEnd = newShape.style.xEnd; + var yStart = newShape.style.yStart; + var yEnd = newShape.style.yEnd; + cloneStyle(newShape, oldShape, 'xStart', 'xEnd', 'yStart', 'yEnd'); + zr.addShape(newShape); + newShape._animating = true; + zr.animate(newShape.id, 'style').when(duration, { + xStart: xStart, + xEnd: xEnd, + yStart: yStart, + yEnd: yEnd + }).done(function () { + newShape._animating = false; + }).start(easing); + } + function markline(zr, oldShape, newShape, duration, easing) { + if (!newShape.style.smooth) { + newShape.style.pointList = !oldShape ? [ + [ + newShape.style.xStart, + newShape.style.yStart + ], + [ + newShape.style.xStart, + newShape.style.yStart + ] + ] : oldShape.style.pointList; + zr.addShape(newShape); + newShape._animating = true; + zr.animate(newShape.id, 'style').when(duration, { + pointList: [ + [ + newShape.style.xStart, + newShape.style.yStart + ], + [ + newShape._x || 0, + newShape._y || 0 + ] + ] + }).done(function () { + newShape._animating = false; + }).start(easing || 'QuinticOut'); + } else { + if (!oldShape) { + newShape.style.pointListLength = 1; + zr.addShape(newShape); + newShape._animating = true; + newShape.style.pointList = newShape.style.pointList || newShape.getPointList(newShape.style); + zr.animate(newShape.id, 'style').when(duration, { pointListLength: newShape.style.pointList.length }).done(function () { + newShape._animating = false; + }).start(easing || 'QuinticOut'); + } else { + zr.addShape(newShape); + } + } + } + return { + pointList: pointList, + rectangle: rectangle, + candle: candle, + ring: ring, + sector: sector, + text: text, + polygon: polygon, + ribbon: ribbon, + gaugePointer: gaugePointer, + icon: icon, + line: line, + markline: markline + }; +});define('echarts/util/ecEffect', [ + 'require', + '../util/ecData', + 'zrender/shape/Circle', + 'zrender/shape/Image', + '../util/shape/Icon', + '../util/shape/Symbol', + 'zrender/tool/env' +], function (require) { + var ecData = require('../util/ecData'); + var CircleShape = require('zrender/shape/Circle'); + var ImageShape = require('zrender/shape/Image'); + var IconShape = require('../util/shape/Icon'); + var SymbolShape = require('../util/shape/Symbol'); + var canvasSupported = require('zrender/tool/env').canvasSupported; + function point(zr, effectList, shape, zlevel) { + var effect = shape.effect; + var color = effect.color || shape.style.strokeColor || shape.style.color; + var shadowColor = effect.shadowColor || color; + var size = effect.scaleSize; + var distance = effect.bounceDistance; + var shadowBlur = typeof effect.shadowBlur != 'undefined' ? effect.shadowBlur : size; + var effectShape; + if (shape.type !== 'image') { + effectShape = new IconShape({ + zlevel: zlevel, + style: { + brushType: 'stroke', + iconType: shape.style.iconType != 'droplet' ? shape.style.iconType : 'circle', + x: shadowBlur + 1, + y: shadowBlur + 1, + n: shape.style.n, + width: shape.style._width * size, + height: shape.style._height * size, + lineWidth: 1, + strokeColor: color, + shadowColor: shadowColor, + shadowBlur: shadowBlur + }, + draggable: false, + hoverable: false + }); + if (shape.style.iconType == 'pin') { + effectShape.style.y += effectShape.style.height / 2 * 1.5; + } + if (canvasSupported) { + effectShape.style.image = zr.shapeToImage(effectShape, effectShape.style.width + shadowBlur * 2 + 2, effectShape.style.height + shadowBlur * 2 + 2).style.image; + effectShape = new ImageShape({ + zlevel: effectShape.zlevel, + style: effectShape.style, + draggable: false, + hoverable: false + }); + } + } else { + effectShape = new ImageShape({ + zlevel: zlevel, + style: shape.style, + draggable: false, + hoverable: false + }); + } + ecData.clone(shape, effectShape); + effectShape.position = shape.position; + effectList.push(effectShape); + zr.addShape(effectShape); + var devicePixelRatio = shape.type !== 'image' ? window.devicePixelRatio || 1 : 1; + var offset = (effectShape.style.width / devicePixelRatio - shape.style._width) / 2; + effectShape.style.x = shape.style._x - offset; + effectShape.style.y = shape.style._y - offset; + if (shape.style.iconType == 'pin') { + effectShape.style.y -= shape.style.height / 2 * 1.5; + } + var duration = (effect.period + Math.random() * 10) * 100; + zr.modShape(shape.id, { invisible: true }); + var centerX = effectShape.style.x + effectShape.style.width / 2 / devicePixelRatio; + var centerY = effectShape.style.y + effectShape.style.height / 2 / devicePixelRatio; + if (effect.type === 'scale') { + zr.modShape(effectShape.id, { + scale: [ + 0.1, + 0.1, + centerX, + centerY + ] + }); + zr.animate(effectShape.id, '', effect.loop).when(duration, { + scale: [ + 1, + 1, + centerX, + centerY + ] + }).done(function () { + shape.effect.show = false; + zr.delShape(effectShape.id); + }).start(); + } else { + zr.animate(effectShape.id, 'style', effect.loop).when(duration, { y: effectShape.style.y - distance }).when(duration * 2, { y: effectShape.style.y }).done(function () { + shape.effect.show = false; + zr.delShape(effectShape.id); + }).start(); + } + } + function largePoint(zr, effectList, shape, zlevel) { + var effect = shape.effect; + var color = effect.color || shape.style.strokeColor || shape.style.color; + var size = effect.scaleSize; + var shadowColor = effect.shadowColor || color; + var shadowBlur = typeof effect.shadowBlur != 'undefined' ? effect.shadowBlur : size * 2; + var devicePixelRatio = window.devicePixelRatio || 1; + var effectShape = new SymbolShape({ + zlevel: zlevel, + position: shape.position, + scale: shape.scale, + style: { + pointList: shape.style.pointList, + iconType: shape.style.iconType, + color: color, + strokeColor: color, + shadowColor: shadowColor, + shadowBlur: shadowBlur * devicePixelRatio, + random: true, + brushType: 'fill', + lineWidth: 1, + size: shape.style.size + }, + draggable: false, + hoverable: false + }); + effectList.push(effectShape); + zr.addShape(effectShape); + zr.modShape(shape.id, { invisible: true }); + var duration = Math.round(effect.period * 100); + var clip1 = {}; + var clip2 = {}; + for (var i = 0; i < 20; i++) { + effectShape.style['randomMap' + i] = 0; + clip1 = {}; + clip1['randomMap' + i] = 100; + clip2 = {}; + clip2['randomMap' + i] = 0; + effectShape.style['randomMap' + i] = Math.random() * 100; + zr.animate(effectShape.id, 'style', true).when(duration, clip1).when(duration * 2, clip2).when(duration * 3, clip1).when(duration * 4, clip1).delay(Math.random() * duration * i).start(); + } + } + function line(zr, effectList, shape, zlevel) { + var effect = shape.effect; + var color = effect.color || shape.style.strokeColor || shape.style.color; + var shadowColor = effect.shadowColor || shape.style.strokeColor || color; + var size = shape.style.lineWidth * effect.scaleSize; + var shadowBlur = typeof effect.shadowBlur != 'undefined' ? effect.shadowBlur : size; + var effectShape = new CircleShape({ + zlevel: zlevel, + style: { + x: shadowBlur, + y: shadowBlur, + r: size, + color: color, + shadowColor: shadowColor, + shadowBlur: shadowBlur + }, + draggable: false, + hoverable: false + }); + var offset; + if (canvasSupported) { + effectShape.style.image = zr.shapeToImage(effectShape, (size + shadowBlur) * 2, (size + shadowBlur) * 2).style.image; + effectShape = new ImageShape({ + zlevel: effectShape.zlevel, + style: effectShape.style, + draggable: false, + hoverable: false + }); + offset = shadowBlur; + } else { + offset = 0; + } + ecData.clone(shape, effectShape); + effectShape.position = shape.position; + effectList.push(effectShape); + zr.addShape(effectShape); + effectShape.style.x = shape.style.xStart - offset; + effectShape.style.y = shape.style.yStart - offset; + var distance = (shape.style.xStart - shape.style.xEnd) * (shape.style.xStart - shape.style.xEnd) + (shape.style.yStart - shape.style.yEnd) * (shape.style.yStart - shape.style.yEnd); + var duration = Math.round(Math.sqrt(Math.round(distance * effect.period * effect.period))); + if (!shape.style.smooth) { + zr.animate(effectShape.id, 'style', effect.loop).when(duration, { + x: shape._x - offset, + y: shape._y - offset + }).done(function () { + shape.effect.show = false; + zr.delShape(effectShape.id); + }).start(); + } else { + var pointList = shape.style.pointList || shape.getPointList(shape.style); + var len = pointList.length; + duration = Math.round(duration / len); + var deferred = zr.animate(effectShape.id, 'style', effect.loop); + var step = Math.ceil(len / 8); + for (var j = 0; j < len - step; j += step) { + deferred.when(duration * (j + 1), { + x: pointList[j][0] - offset, + y: pointList[j][1] - offset + }); + } + deferred.when(duration * len, { + x: pointList[len - 1][0] - offset, + y: pointList[len - 1][1] - offset + }); + deferred.done(function () { + shape.effect.show = false; + zr.delShape(effectShape.id); + }); + deferred.start('spline'); + } + } + return { + point: point, + largePoint: largePoint, + line: line + }; +});define('echarts/component/base', [ + 'require', + '../config', + '../util/ecData', + '../util/ecQuery', + '../util/number', + 'zrender/tool/util', + 'zrender/tool/env' +], function (require) { + var ecConfig = require('../config'); + var ecData = require('../util/ecData'); + var ecQuery = require('../util/ecQuery'); + var number = require('../util/number'); + var zrUtil = require('zrender/tool/util'); + function Base(ecTheme, messageCenter, zr, option, myChart) { + this.ecTheme = ecTheme; + this.messageCenter = messageCenter; + this.zr = zr; + this.option = option; + this.series = option.series; + this.myChart = myChart; + this.component = myChart.component; + this.shapeList = []; + this.effectList = []; + var self = this; + self._onlegendhoverlink = function (param) { + if (self.legendHoverLink) { + var targetName = param.target; + var name; + for (var i = self.shapeList.length - 1; i >= 0; i--) { + name = self.type == ecConfig.CHART_TYPE_PIE || self.type == ecConfig.CHART_TYPE_FUNNEL ? ecData.get(self.shapeList[i], 'name') : (ecData.get(self.shapeList[i], 'series') || {}).name; + if (name == targetName && !self.shapeList[i].invisible && !self.shapeList[i]._animating) { + self.zr.addHoverShape(self.shapeList[i]); + } + } + } + }; + messageCenter && messageCenter.bind(ecConfig.EVENT.LEGEND_HOVERLINK, this._onlegendhoverlink); + } + Base.prototype = { + canvasSupported: require('zrender/tool/env').canvasSupported, + _getZ: function (zWhat) { + var opt = this.ecTheme[this.type]; + if (opt && opt[zWhat] != null) { + return opt[zWhat]; + } + opt = ecConfig[this.type]; + if (opt && opt[zWhat] != null) { + return opt[zWhat]; + } + return 0; + }, + getZlevelBase: function () { + return this._getZ('zlevel'); + }, + getZBase: function () { + return this._getZ('z'); + }, + reformOption: function (opt) { + return zrUtil.merge(zrUtil.merge(opt || {}, zrUtil.clone(this.ecTheme[this.type] || {})), zrUtil.clone(ecConfig[this.type] || {})); + }, + reformCssArray: function (p) { + if (p instanceof Array) { + switch (p.length + '') { + case '4': + return p; + case '3': + return [ + p[0], + p[1], + p[2], + p[1] + ]; + case '2': + return [ + p[0], + p[1], + p[0], + p[1] + ]; + case '1': + return [ + p[0], + p[0], + p[0], + p[0] + ]; + case '0': + return [ + 0, + 0, + 0, + 0 + ]; + } + } else { + return [ + p, + p, + p, + p + ]; + } + }, + getShapeById: function (id) { + for (var i = 0, l = this.shapeList.length; i < l; i++) { + if (this.shapeList[i].id === id) { + return this.shapeList[i]; + } + } + return null; + }, + getFont: function (textStyle) { + var finalTextStyle = this.getTextStyle(zrUtil.clone(textStyle)); + return finalTextStyle.fontStyle + ' ' + finalTextStyle.fontWeight + ' ' + finalTextStyle.fontSize + 'px ' + finalTextStyle.fontFamily; + }, + getTextStyle: function (targetStyle) { + return zrUtil.merge(zrUtil.merge(targetStyle || {}, this.ecTheme.textStyle), ecConfig.textStyle); + }, + getItemStyleColor: function (itemColor, seriesIndex, dataIndex, data) { + return typeof itemColor === 'function' ? itemColor.call(this.myChart, { + seriesIndex: seriesIndex, + series: this.series[seriesIndex], + dataIndex: dataIndex, + data: data + }) : itemColor; + }, + getDataFromOption: function (data, defaultData) { + return data != null ? data.value != null ? data.value : data : defaultData; + }, + subPixelOptimize: function (position, lineWidth) { + if (lineWidth % 2 === 1) { + position = Math.floor(position) + 0.5; + } else { + position = Math.round(position); + } + return position; + }, + resize: function () { + this.refresh && this.refresh(); + this.clearEffectShape && this.clearEffectShape(true); + var self = this; + setTimeout(function () { + self.animationEffect && self.animationEffect(); + }, 200); + }, + clear: function () { + this.clearEffectShape && this.clearEffectShape(); + this.zr && this.zr.delShape(this.shapeList); + this.shapeList = []; + }, + dispose: function () { + this.onbeforDispose && this.onbeforDispose(); + this.clear(); + this.shapeList = null; + this.effectList = null; + this.messageCenter && this.messageCenter.unbind(ecConfig.EVENT.LEGEND_HOVERLINK, this._onlegendhoverlink); + this.onafterDispose && this.onafterDispose(); + }, + query: ecQuery.query, + deepQuery: ecQuery.deepQuery, + deepMerge: ecQuery.deepMerge, + parsePercent: number.parsePercent, + parseCenter: number.parseCenter, + parseRadius: number.parseRadius, + numAddCommas: number.addCommas + }; + return Base; +});define('zrender/shape/Star', [ + 'require', + '../tool/math', + './Base', + '../tool/util' +], function (require) { + var math = require('../tool/math'); + var sin = math.sin; + var cos = math.cos; + var PI = Math.PI; + var Base = require('./Base'); + var Star = function (options) { + Base.call(this, options); + }; + Star.prototype = { + type: 'star', + buildPath: function (ctx, style) { + var n = style.n; + if (!n || n < 2) { + return; + } + var x = style.x; + var y = style.y; + var r = style.r; + var r0 = style.r0; + if (r0 == null) { + r0 = n > 4 ? r * cos(2 * PI / n) / cos(PI / n) : r / 3; + } + var dStep = PI / n; + var deg = -PI / 2; + var xStart = x + r * cos(deg); + var yStart = y + r * sin(deg); + deg += dStep; + var pointList = style.pointList = []; + pointList.push([ + xStart, + yStart + ]); + for (var i = 0, end = n * 2 - 1, ri; i < end; i++) { + ri = i % 2 === 0 ? r0 : r; + pointList.push([ + x + ri * cos(deg), + y + ri * sin(deg) + ]); + deg += dStep; + } + pointList.push([ + xStart, + yStart + ]); + ctx.moveTo(pointList[0][0], pointList[0][1]); + for (var i = 0; i < pointList.length; i++) { + ctx.lineTo(pointList[i][0], pointList[i][1]); + } + ctx.closePath(); + return; + }, + getRect: function (style) { + if (style.__rect) { + return style.__rect; + } + var lineWidth; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } else { + lineWidth = 0; + } + style.__rect = { + x: Math.round(style.x - style.r - lineWidth / 2), + y: Math.round(style.y - style.r - lineWidth / 2), + width: style.r * 2 + lineWidth, + height: style.r * 2 + lineWidth + }; + return style.__rect; + } + }; + require('../tool/util').inherits(Star, Base); + return Star; +});define('zrender/shape/Heart', [ + 'require', + './Base', + './util/PathProxy', + '../tool/area', + '../tool/util' +], function (require) { + 'use strict'; + var Base = require('./Base'); + var PathProxy = require('./util/PathProxy'); + var area = require('../tool/area'); + var Heart = function (options) { + Base.call(this, options); + this._pathProxy = new PathProxy(); + }; + Heart.prototype = { + type: 'heart', + buildPath: function (ctx, style) { + var path = this._pathProxy || new PathProxy(); + path.begin(ctx); + path.moveTo(style.x, style.y); + path.bezierCurveTo(style.x + style.a / 2, style.y - style.b * 2 / 3, style.x + style.a * 2, style.y + style.b / 3, style.x, style.y + style.b); + path.bezierCurveTo(style.x - style.a * 2, style.y + style.b / 3, style.x - style.a / 2, style.y - style.b * 2 / 3, style.x, style.y); + path.closePath(); + return; + }, + getRect: function (style) { + if (style.__rect) { + return style.__rect; + } + if (!this._pathProxy.isEmpty()) { + this.buildPath(null, style); + } + return this._pathProxy.fastBoundingRect(); + }, + isCover: function (x, y) { + var originPos = this.getTansform(x, y); + x = originPos[0]; + y = originPos[1]; + var rect = this.getRect(this.style); + if (x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height) { + return area.isInsidePath(this._pathProxy.pathCommands, this.style.lineWidth, this.style.brushType, x, y); + } + } + }; + require('../tool/util').inherits(Heart, Base); + return Heart; +});define('zrender/shape/Droplet', [ + 'require', + './Base', + './util/PathProxy', + '../tool/area', + '../tool/util' +], function (require) { + 'use strict'; + var Base = require('./Base'); + var PathProxy = require('./util/PathProxy'); + var area = require('../tool/area'); + var Droplet = function (options) { + Base.call(this, options); + this._pathProxy = new PathProxy(); + }; + Droplet.prototype = { + type: 'droplet', + buildPath: function (ctx, style) { + var path = this._pathProxy || new PathProxy(); + path.begin(ctx); + path.moveTo(style.x, style.y + style.a); + path.bezierCurveTo(style.x + style.a, style.y + style.a, style.x + style.a * 3 / 2, style.y - style.a / 3, style.x, style.y - style.b); + path.bezierCurveTo(style.x - style.a * 3 / 2, style.y - style.a / 3, style.x - style.a, style.y + style.a, style.x, style.y + style.a); + path.closePath(); + }, + getRect: function (style) { + if (style.__rect) { + return style.__rect; + } + if (!this._pathProxy.isEmpty()) { + this.buildPath(null, style); + } + return this._pathProxy.fastBoundingRect(); + }, + isCover: function (x, y) { + var originPos = this.getTansform(x, y); + x = originPos[0]; + y = originPos[1]; + var rect = this.getRect(this.style); + if (x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height) { + return area.isInsidePath(this._pathProxy.pathCommands, this.style.lineWidth, this.style.brushType, x, y); + } + } + }; + require('../tool/util').inherits(Droplet, Base); + return Droplet; +});define('zrender/tool/math', [], function () { + var _radians = Math.PI / 180; + function sin(angle, isDegrees) { + return Math.sin(isDegrees ? angle * _radians : angle); + } + function cos(angle, isDegrees) { + return Math.cos(isDegrees ? angle * _radians : angle); + } + function degreeToRadian(angle) { + return angle * _radians; + } + function radianToDegree(angle) { + return angle / _radians; + } + return { + sin: sin, + cos: cos, + degreeToRadian: degreeToRadian, + radianToDegree: radianToDegree + }; +});define('zrender/shape/util/PathProxy', [ + 'require', + '../../tool/vector' +], function (require) { + var vector = require('../../tool/vector'); + var PathSegment = function (command, points) { + this.command = command; + this.points = points || null; + }; + var PathProxy = function () { + this.pathCommands = []; + this._ctx = null; + this._min = []; + this._max = []; + }; + PathProxy.prototype.fastBoundingRect = function () { + var min = this._min; + var max = this._max; + min[0] = min[1] = Infinity; + max[0] = max[1] = -Infinity; + for (var i = 0; i < this.pathCommands.length; i++) { + var seg = this.pathCommands[i]; + var p = seg.points; + switch (seg.command) { + case 'M': + vector.min(min, min, p); + vector.max(max, max, p); + break; + case 'L': + vector.min(min, min, p); + vector.max(max, max, p); + break; + case 'C': + for (var j = 0; j < 6; j += 2) { + min[0] = Math.min(min[0], min[0], p[j]); + min[1] = Math.min(min[1], min[1], p[j + 1]); + max[0] = Math.max(max[0], max[0], p[j]); + max[1] = Math.max(max[1], max[1], p[j + 1]); + } + break; + case 'Q': + for (var j = 0; j < 4; j += 2) { + min[0] = Math.min(min[0], min[0], p[j]); + min[1] = Math.min(min[1], min[1], p[j + 1]); + max[0] = Math.max(max[0], max[0], p[j]); + max[1] = Math.max(max[1], max[1], p[j + 1]); + } + break; + case 'A': + var cx = p[0]; + var cy = p[1]; + var rx = p[2]; + var ry = p[3]; + min[0] = Math.min(min[0], min[0], cx - rx); + min[1] = Math.min(min[1], min[1], cy - ry); + max[0] = Math.max(max[0], max[0], cx + rx); + max[1] = Math.max(max[1], max[1], cy + ry); + break; + } + } + return { + x: min[0], + y: min[1], + width: max[0] - min[0], + height: max[1] - min[1] + }; + }; + PathProxy.prototype.begin = function (ctx) { + this._ctx = ctx || null; + this.pathCommands.length = 0; + return this; + }; + PathProxy.prototype.moveTo = function (x, y) { + this.pathCommands.push(new PathSegment('M', [ + x, + y + ])); + if (this._ctx) { + this._ctx.moveTo(x, y); + } + return this; + }; + PathProxy.prototype.lineTo = function (x, y) { + this.pathCommands.push(new PathSegment('L', [ + x, + y + ])); + if (this._ctx) { + this._ctx.lineTo(x, y); + } + return this; + }; + PathProxy.prototype.bezierCurveTo = function (x1, y1, x2, y2, x3, y3) { + this.pathCommands.push(new PathSegment('C', [ + x1, + y1, + x2, + y2, + x3, + y3 + ])); + if (this._ctx) { + this._ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3); + } + return this; + }; + PathProxy.prototype.quadraticCurveTo = function (x1, y1, x2, y2) { + this.pathCommands.push(new PathSegment('Q', [ + x1, + y1, + x2, + y2 + ])); + if (this._ctx) { + this._ctx.quadraticCurveTo(x1, y1, x2, y2); + } + return this; + }; + PathProxy.prototype.arc = function (cx, cy, r, startAngle, endAngle, anticlockwise) { + this.pathCommands.push(new PathSegment('A', [ + cx, + cy, + r, + r, + startAngle, + endAngle - startAngle, + 0, + anticlockwise ? 0 : 1 + ])); + if (this._ctx) { + this._ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise); + } + return this; + }; + PathProxy.prototype.arcTo = function (x1, y1, x2, y2, radius) { + if (this._ctx) { + this._ctx.arcTo(x1, y1, x2, y2, radius); + } + return this; + }; + PathProxy.prototype.rect = function (x, y, w, h) { + if (this._ctx) { + this._ctx.rect(x, y, w, h); + } + return this; + }; + PathProxy.prototype.closePath = function () { + this.pathCommands.push(new PathSegment('z')); + if (this._ctx) { + this._ctx.closePath(); + } + return this; + }; + PathProxy.prototype.isEmpty = function () { + return this.pathCommands.length === 0; + }; + PathProxy.PathSegment = PathSegment; + return PathProxy; +});define('zrender/shape/Line', [ + 'require', + './Base', + './util/dashedLineTo', + '../tool/util' +], function (require) { + var Base = require('./Base'); + var dashedLineTo = require('./util/dashedLineTo'); + var Line = function (options) { + this.brushTypeOnly = 'stroke'; + this.textPosition = 'end'; + Base.call(this, options); + }; + Line.prototype = { + type: 'line', + buildPath: function (ctx, style) { + if (!style.lineType || style.lineType == 'solid') { + ctx.moveTo(style.xStart, style.yStart); + ctx.lineTo(style.xEnd, style.yEnd); + } else if (style.lineType == 'dashed' || style.lineType == 'dotted') { + var dashLength = (style.lineWidth || 1) * (style.lineType == 'dashed' ? 5 : 1); + dashedLineTo(ctx, style.xStart, style.yStart, style.xEnd, style.yEnd, dashLength); + } + }, + getRect: function (style) { + if (style.__rect) { + return style.__rect; + } + var lineWidth = style.lineWidth || 1; + style.__rect = { + x: Math.min(style.xStart, style.xEnd) - lineWidth, + y: Math.min(style.yStart, style.yEnd) - lineWidth, + width: Math.abs(style.xStart - style.xEnd) + lineWidth, + height: Math.abs(style.yStart - style.yEnd) + lineWidth + }; + return style.__rect; + } + }; + require('../tool/util').inherits(Line, Base); + return Line; +});define('zrender/shape/Polyline', [ + 'require', + './Base', + './util/smoothSpline', + './util/smoothBezier', + './util/dashedLineTo', + './Polygon', + '../tool/util' +], function (require) { + var Base = require('./Base'); + var smoothSpline = require('./util/smoothSpline'); + var smoothBezier = require('./util/smoothBezier'); + var dashedLineTo = require('./util/dashedLineTo'); + var Polyline = function (options) { + this.brushTypeOnly = 'stroke'; + this.textPosition = 'end'; + Base.call(this, options); + }; + Polyline.prototype = { + type: 'polyline', + buildPath: function (ctx, style) { + var pointList = style.pointList; + if (pointList.length < 2) { + return; + } + var len = Math.min(style.pointList.length, Math.round(style.pointListLength || style.pointList.length)); + if (style.smooth && style.smooth !== 'spline') { + var controlPoints = smoothBezier(pointList, style.smooth, false, style.smoothConstraint); + ctx.moveTo(pointList[0][0], pointList[0][1]); + var cp1; + var cp2; + var p; + for (var i = 0; i < len - 1; i++) { + cp1 = controlPoints[i * 2]; + cp2 = controlPoints[i * 2 + 1]; + p = pointList[i + 1]; + ctx.bezierCurveTo(cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]); + } + } else { + if (style.smooth === 'spline') { + pointList = smoothSpline(pointList); + len = pointList.length; + } + if (!style.lineType || style.lineType == 'solid') { + ctx.moveTo(pointList[0][0], pointList[0][1]); + for (var i = 1; i < len; i++) { + ctx.lineTo(pointList[i][0], pointList[i][1]); + } + } else if (style.lineType == 'dashed' || style.lineType == 'dotted') { + var dashLength = (style.lineWidth || 1) * (style.lineType == 'dashed' ? 5 : 1); + ctx.moveTo(pointList[0][0], pointList[0][1]); + for (var i = 1; i < len; i++) { + dashedLineTo(ctx, pointList[i - 1][0], pointList[i - 1][1], pointList[i][0], pointList[i][1], dashLength); + } + } + } + return; + }, + getRect: function (style) { + return require('./Polygon').prototype.getRect(style); + } + }; + require('../tool/util').inherits(Polyline, Base); + return Polyline; +});define('zrender/shape/util/dashedLineTo', [], function () { + var dashPattern = [ + 5, + 5 + ]; + return function (ctx, x1, y1, x2, y2, dashLength) { + if (ctx.setLineDash) { + dashPattern[0] = dashPattern[1] = dashLength; + ctx.setLineDash(dashPattern); + ctx.moveTo(x1, y1); + ctx.lineTo(x2, y2); + return; + } + dashLength = typeof dashLength != 'number' ? 5 : dashLength; + var dx = x2 - x1; + var dy = y2 - y1; + var numDashes = Math.floor(Math.sqrt(dx * dx + dy * dy) / dashLength); + dx = dx / numDashes; + dy = dy / numDashes; + var flag = true; + for (var i = 0; i < numDashes; ++i) { + if (flag) { + ctx.moveTo(x1, y1); + } else { + ctx.lineTo(x1, y1); + } + flag = !flag; + x1 += dx; + y1 += dy; + } + ctx.lineTo(x2, y2); + }; +});define('zrender/shape/util/smoothSpline', [ + 'require', + '../../tool/vector' +], function (require) { + var vector = require('../../tool/vector'); + function interpolate(p0, p1, p2, p3, t, t2, t3) { + var v0 = (p2 - p0) * 0.5; + var v1 = (p3 - p1) * 0.5; + return (2 * (p1 - p2) + v0 + v1) * t3 + (-3 * (p1 - p2) - 2 * v0 - v1) * t2 + v0 * t + p1; + } + return function (points, isLoop, constraint) { + var len = points.length; + var ret = []; + var distance = 0; + for (var i = 1; i < len; i++) { + distance += vector.distance(points[i - 1], points[i]); + } + var segs = distance / 5; + segs = segs < len ? len : segs; + for (var i = 0; i < segs; i++) { + var pos = i / (segs - 1) * (isLoop ? len : len - 1); + var idx = Math.floor(pos); + var w = pos - idx; + var p0; + var p1 = points[idx % len]; + var p2; + var p3; + if (!isLoop) { + p0 = points[idx === 0 ? idx : idx - 1]; + p2 = points[idx > len - 2 ? len - 1 : idx + 1]; + p3 = points[idx > len - 3 ? len - 1 : idx + 2]; + } else { + p0 = points[(idx - 1 + len) % len]; + p2 = points[(idx + 1) % len]; + p3 = points[(idx + 2) % len]; + } + var w2 = w * w; + var w3 = w * w2; + ret.push([ + interpolate(p0[0], p1[0], p2[0], p3[0], w, w2, w3), + interpolate(p0[1], p1[1], p2[1], p3[1], w, w2, w3) + ]); + } + return ret; + }; +});define('zrender/shape/util/smoothBezier', [ + 'require', + '../../tool/vector' +], function (require) { + var vector = require('../../tool/vector'); + return function (points, smooth, isLoop, constraint) { + var cps = []; + var v = []; + var v1 = []; + var v2 = []; + var prevPoint; + var nextPoint; + var hasConstraint = !!constraint; + var min, max; + if (hasConstraint) { + min = [ + Infinity, + Infinity + ]; + max = [ + -Infinity, + -Infinity + ]; + for (var i = 0, len = points.length; i < len; i++) { + vector.min(min, min, points[i]); + vector.max(max, max, points[i]); + } + vector.min(min, min, constraint[0]); + vector.max(max, max, constraint[1]); + } + for (var i = 0, len = points.length; i < len; i++) { + var point = points[i]; + var prevPoint; + var nextPoint; + if (isLoop) { + prevPoint = points[i ? i - 1 : len - 1]; + nextPoint = points[(i + 1) % len]; + } else { + if (i === 0 || i === len - 1) { + cps.push(points[i]); + continue; + } else { + prevPoint = points[i - 1]; + nextPoint = points[i + 1]; + } + } + vector.sub(v, nextPoint, prevPoint); + vector.scale(v, v, smooth); + var d0 = vector.distance(point, prevPoint); + var d1 = vector.distance(point, nextPoint); + var sum = d0 + d1; + if (sum !== 0) { + d0 /= sum; + d1 /= sum; + } + vector.scale(v1, v, -d0); + vector.scale(v2, v, d1); + var cp0 = vector.add([], point, v1); + var cp1 = vector.add([], point, v2); + if (hasConstraint) { + vector.max(cp0, cp0, min); + vector.min(cp0, cp0, max); + vector.max(cp1, cp1, min); + vector.min(cp1, cp1, max); + } + cps.push(cp0); + cps.push(cp1); + } + if (isLoop) { + cps.push(cps.shift()); + } + return cps; + }; +});define('zrender/shape/Polygon', [ + 'require', + './Base', + './util/smoothSpline', + './util/smoothBezier', + './util/dashedLineTo', + '../tool/util' +], function (require) { + var Base = require('./Base'); + var smoothSpline = require('./util/smoothSpline'); + var smoothBezier = require('./util/smoothBezier'); + var dashedLineTo = require('./util/dashedLineTo'); + var Polygon = function (options) { + Base.call(this, options); + }; + Polygon.prototype = { + type: 'polygon', + buildPath: function (ctx, style) { + var pointList = style.pointList; + if (pointList.length < 2) { + return; + } + if (style.smooth && style.smooth !== 'spline') { + var controlPoints = smoothBezier(pointList, style.smooth, true, style.smoothConstraint); + ctx.moveTo(pointList[0][0], pointList[0][1]); + var cp1; + var cp2; + var p; + var len = pointList.length; + for (var i = 0; i < len; i++) { + cp1 = controlPoints[i * 2]; + cp2 = controlPoints[i * 2 + 1]; + p = pointList[(i + 1) % len]; + ctx.bezierCurveTo(cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]); + } + } else { + if (style.smooth === 'spline') { + pointList = smoothSpline(pointList, true); + } + if (!style.lineType || style.lineType == 'solid') { + ctx.moveTo(pointList[0][0], pointList[0][1]); + for (var i = 1, l = pointList.length; i < l; i++) { + ctx.lineTo(pointList[i][0], pointList[i][1]); + } + ctx.lineTo(pointList[0][0], pointList[0][1]); + } else if (style.lineType == 'dashed' || style.lineType == 'dotted') { + var dashLength = style._dashLength || (style.lineWidth || 1) * (style.lineType == 'dashed' ? 5 : 1); + style._dashLength = dashLength; + ctx.moveTo(pointList[0][0], pointList[0][1]); + for (var i = 1, l = pointList.length; i < l; i++) { + dashedLineTo(ctx, pointList[i - 1][0], pointList[i - 1][1], pointList[i][0], pointList[i][1], dashLength); + } + dashedLineTo(ctx, pointList[pointList.length - 1][0], pointList[pointList.length - 1][1], pointList[0][0], pointList[0][1], dashLength); + } + } + ctx.closePath(); + return; + }, + getRect: function (style) { + if (style.__rect) { + return style.__rect; + } + var minX = Number.MAX_VALUE; + var maxX = Number.MIN_VALUE; + var minY = Number.MAX_VALUE; + var maxY = Number.MIN_VALUE; + var pointList = style.pointList; + for (var i = 0, l = pointList.length; i < l; i++) { + if (pointList[i][0] < minX) { + minX = pointList[i][0]; + } + if (pointList[i][0] > maxX) { + maxX = pointList[i][0]; + } + if (pointList[i][1] < minY) { + minY = pointList[i][1]; + } + if (pointList[i][1] > maxY) { + maxY = pointList[i][1]; + } + } + var lineWidth; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } else { + lineWidth = 0; + } + style.__rect = { + x: Math.round(minX - lineWidth / 2), + y: Math.round(minY - lineWidth / 2), + width: maxX - minX + lineWidth, + height: maxY - minY + lineWidth + }; + return style.__rect; + } + }; + require('../tool/util').inherits(Polygon, Base); + return Polygon; +});define('echarts/util/shape/normalIsCover', [], function () { + return function (x, y) { + var originPos = this.getTansform(x, y); + x = originPos[0]; + y = originPos[1]; + var rect = this.style.__rect; + if (!rect) { + rect = this.style.__rect = this.getRect(this.style); + } + return x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height; + }; +});define('echarts/util/ecQuery', [ + 'require', + 'zrender/tool/util' +], function (require) { + var zrUtil = require('zrender/tool/util'); + function query(optionTarget, optionLocation) { + if (typeof optionTarget == 'undefined') { + return; + } + if (!optionLocation) { + return optionTarget; + } + optionLocation = optionLocation.split('.'); + var length = optionLocation.length; + var curIdx = 0; + while (curIdx < length) { + optionTarget = optionTarget[optionLocation[curIdx]]; + if (typeof optionTarget == 'undefined') { + return; + } + curIdx++; + } + return optionTarget; + } + function deepQuery(ctrList, optionLocation) { + var finalOption; + for (var i = 0, l = ctrList.length; i < l; i++) { + finalOption = query(ctrList[i], optionLocation); + if (typeof finalOption != 'undefined') { + return finalOption; + } + } + } + function deepMerge(ctrList, optionLocation) { + var finalOption; + var len = ctrList.length; + while (len--) { + var tempOption = query(ctrList[len], optionLocation); + if (typeof tempOption != 'undefined') { + if (typeof finalOption == 'undefined') { + finalOption = zrUtil.clone(tempOption); + } else { + zrUtil.merge(finalOption, tempOption, true); + } + } + } + return finalOption; + } + return { + query: query, + deepQuery: deepQuery, + deepMerge: deepMerge + }; +});define('echarts/util/number', [], function () { + function _trim(str) { + return str.replace(/^\s+/, '').replace(/\s+$/, ''); + } + function parsePercent(value, maxValue) { + if (typeof value === 'string') { + if (_trim(value).match(/%$/)) { + return parseFloat(value) / 100 * maxValue; + } + return parseFloat(value); + } + return value; + } + function parseCenter(zr, center) { + return [ + parsePercent(center[0], zr.getWidth()), + parsePercent(center[1], zr.getHeight()) + ]; + } + function parseRadius(zr, radius) { + if (!(radius instanceof Array)) { + radius = [ + 0, + radius + ]; + } + var zrSize = Math.min(zr.getWidth(), zr.getHeight()) / 2; + return [ + parsePercent(radius[0], zrSize), + parsePercent(radius[1], zrSize) + ]; + } + function addCommas(x) { + if (isNaN(x)) { + return '-'; + } + x = (x + '').split('.'); + return x[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g, '$1,') + (x.length > 1 ? '.' + x[1] : ''); + } + return { + parsePercent: parsePercent, + parseCenter: parseCenter, + parseRadius: parseRadius, + addCommas: addCommas + }; +});define('echarts/component/dataView', [ + 'require', + './base', + '../config', + 'zrender/tool/util', + '../component' +], function (require) { + var Base = require('./base'); + var ecConfig = require('../config'); + var zrUtil = require('zrender/tool/util'); + function DataView(ecTheme, messageCenter, zr, option, myChart) { + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + this.dom = myChart.dom; + this._tDom = document.createElement('div'); + this._textArea = document.createElement('textArea'); + this._buttonRefresh = document.createElement('button'); + this._buttonClose = document.createElement('button'); + this._hasShow = false; + this._zrHeight = zr.getHeight(); + this._zrWidth = zr.getWidth(); + this._tDom.className = 'echarts-dataview'; + this.hide(); + this.dom.firstChild.appendChild(this._tDom); + if (window.addEventListener) { + this._tDom.addEventListener('click', this._stop); + this._tDom.addEventListener('mousewheel', this._stop); + this._tDom.addEventListener('mousemove', this._stop); + this._tDom.addEventListener('mousedown', this._stop); + this._tDom.addEventListener('mouseup', this._stop); + this._tDom.addEventListener('touchstart', this._stop); + this._tDom.addEventListener('touchmove', this._stop); + this._tDom.addEventListener('touchend', this._stop); + } else { + this._tDom.attachEvent('onclick', this._stop); + this._tDom.attachEvent('onmousewheel', this._stop); + this._tDom.attachEvent('onmousemove', this._stop); + this._tDom.attachEvent('onmousedown', this._stop); + this._tDom.attachEvent('onmouseup', this._stop); + } + } + DataView.prototype = { + type: ecConfig.COMPONENT_TYPE_DATAVIEW, + _lang: [ + 'Data View', + 'close', + 'refresh' + ], + _gCssText: 'position:absolute;' + 'display:block;' + 'overflow:hidden;' + 'transition:height 0.8s,background-color 1s;' + '-moz-transition:height 0.8s,background-color 1s;' + '-webkit-transition:height 0.8s,background-color 1s;' + '-o-transition:height 0.8s,background-color 1s;' + 'z-index:1;' + 'left:0;' + 'top:0;', + hide: function () { + this._sizeCssText = 'width:' + this._zrWidth + 'px;' + 'height:' + 0 + 'px;' + 'background-color:#f0ffff;'; + this._tDom.style.cssText = this._gCssText + this._sizeCssText; + }, + show: function (newOption) { + this._hasShow = true; + var lang = this.query(this.option, 'toolbox.feature.dataView.lang') || this._lang; + this.option = newOption; + this._tDom.innerHTML = '

' + (lang[0] || this._lang[0]) + '

'; + this._textArea.style.cssText = 'display:block;margin:0 0 8px 0;padding:4px 6px;overflow:auto;' + 'width:' + (this._zrWidth - 15) + 'px;' + 'height:' + (this._zrHeight - 100) + 'px;'; + var customContent = this.query(this.option, 'toolbox.feature.dataView.optionToContent'); + if (typeof customContent != 'function') { + this._textArea.value = this._optionToContent(); + } else { + this._textArea.value = customContent(this.option); + } + this._tDom.appendChild(this._textArea); + this._buttonClose.style.cssText = 'float:right;padding:1px 6px;'; + this._buttonClose.innerHTML = lang[1] || this._lang[1]; + var self = this; + this._buttonClose.onclick = function () { + self.hide(); + }; + this._tDom.appendChild(this._buttonClose); + if (this.query(this.option, 'toolbox.feature.dataView.readOnly') === false) { + this._buttonRefresh.style.cssText = 'float:right;margin-right:10px;padding:1px 6px;'; + this._buttonRefresh.innerHTML = lang[2] || this._lang[2]; + this._buttonRefresh.onclick = function () { + self._save(); + }; + this._tDom.appendChild(this._buttonRefresh); + this._textArea.readOnly = false; + this._textArea.style.cursor = 'default'; + } else { + this._textArea.readOnly = true; + this._textArea.style.cursor = 'text'; + } + this._sizeCssText = 'width:' + this._zrWidth + 'px;' + 'height:' + this._zrHeight + 'px;' + 'background-color:#fff;'; + this._tDom.style.cssText = this._gCssText + this._sizeCssText; + }, + _optionToContent: function () { + var i; + var j; + var k; + var len; + var data; + var valueList; + var axisList = []; + var content = ''; + if (this.option.xAxis) { + if (this.option.xAxis instanceof Array) { + axisList = this.option.xAxis; + } else { + axisList = [this.option.xAxis]; + } + for (i = 0, len = axisList.length; i < len; i++) { + if ((axisList[i].type || 'category') == 'category') { + valueList = []; + for (j = 0, k = axisList[i].data.length; j < k; j++) { + valueList.push(this.getDataFromOption(axisList[i].data[j])); + } + content += valueList.join(', ') + '\n\n'; + } + } + } + if (this.option.yAxis) { + if (this.option.yAxis instanceof Array) { + axisList = this.option.yAxis; + } else { + axisList = [this.option.yAxis]; + } + for (i = 0, len = axisList.length; i < len; i++) { + if (axisList[i].type == 'category') { + valueList = []; + for (j = 0, k = axisList[i].data.length; j < k; j++) { + valueList.push(this.getDataFromOption(axisList[i].data[j])); + } + content += valueList.join(', ') + '\n\n'; + } + } + } + var series = this.option.series; + var itemName; + for (i = 0, len = series.length; i < len; i++) { + valueList = []; + for (j = 0, k = series[i].data.length; j < k; j++) { + data = series[i].data[j]; + if (series[i].type == ecConfig.CHART_TYPE_PIE || series[i].type == ecConfig.CHART_TYPE_MAP) { + itemName = (data.name || '-') + ':'; + } else { + itemName = ''; + } + if (series[i].type == ecConfig.CHART_TYPE_SCATTER) { + data = this.getDataFromOption(data).join(', '); + } + valueList.push(itemName + this.getDataFromOption(data)); + } + content += (series[i].name || '-') + ' : \n'; + content += valueList.join(series[i].type == ecConfig.CHART_TYPE_SCATTER ? '\n' : ', '); + content += '\n\n'; + } + return content; + }, + _save: function () { + var text = this._textArea.value; + var customContent = this.query(this.option, 'toolbox.feature.dataView.contentToOption'); + if (typeof customContent != 'function') { + text = text.split('\n'); + var content = []; + for (var i = 0, l = text.length; i < l; i++) { + text[i] = this._trim(text[i]); + if (text[i] !== '') { + content.push(text[i]); + } + } + this._contentToOption(content); + } else { + customContent(text, this.option); + } + this.hide(); + var self = this; + setTimeout(function () { + self.messageCenter && self.messageCenter.dispatch(ecConfig.EVENT.DATA_VIEW_CHANGED, null, { option: self.option }, self.myChart); + }, self.canvasSupported ? 800 : 100); + }, + _contentToOption: function (content) { + var i; + var j; + var k; + var len; + var data; + var axisList = []; + var contentIdx = 0; + var contentValueList; + var value; + if (this.option.xAxis) { + if (this.option.xAxis instanceof Array) { + axisList = this.option.xAxis; + } else { + axisList = [this.option.xAxis]; + } + for (i = 0, len = axisList.length; i < len; i++) { + if ((axisList[i].type || 'category') == 'category') { + contentValueList = content[contentIdx].split(','); + for (j = 0, k = axisList[i].data.length; j < k; j++) { + value = this._trim(contentValueList[j] || ''); + data = axisList[i].data[j]; + if (typeof axisList[i].data[j].value != 'undefined') { + axisList[i].data[j].value = value; + } else { + axisList[i].data[j] = value; + } + } + contentIdx++; + } + } + } + if (this.option.yAxis) { + if (this.option.yAxis instanceof Array) { + axisList = this.option.yAxis; + } else { + axisList = [this.option.yAxis]; + } + for (i = 0, len = axisList.length; i < len; i++) { + if (axisList[i].type == 'category') { + contentValueList = content[contentIdx].split(','); + for (j = 0, k = axisList[i].data.length; j < k; j++) { + value = this._trim(contentValueList[j] || ''); + data = axisList[i].data[j]; + if (typeof axisList[i].data[j].value != 'undefined') { + axisList[i].data[j].value = value; + } else { + axisList[i].data[j] = value; + } + } + contentIdx++; + } + } + } + var series = this.option.series; + for (i = 0, len = series.length; i < len; i++) { + contentIdx++; + if (series[i].type == ecConfig.CHART_TYPE_SCATTER) { + for (var j = 0, k = series[i].data.length; j < k; j++) { + contentValueList = content[contentIdx]; + value = contentValueList.replace(' ', '').split(','); + if (typeof series[i].data[j].value != 'undefined') { + series[i].data[j].value = value; + } else { + series[i].data[j] = value; + } + contentIdx++; + } + } else { + contentValueList = content[contentIdx].split(','); + for (var j = 0, k = series[i].data.length; j < k; j++) { + value = (contentValueList[j] || '').replace(/.*:/, ''); + value = this._trim(value); + value = value != '-' && value !== '' ? value - 0 : '-'; + if (typeof series[i].data[j].value != 'undefined') { + series[i].data[j].value = value; + } else { + series[i].data[j] = value; + } + } + contentIdx++; + } + } + }, + _trim: function (str) { + var trimer = new RegExp('(^[\\s\\t\\xa0\\u3000]+)|([\\u3000\\xa0\\s\\t]+$)', 'g'); + return str.replace(trimer, ''); + }, + _stop: function (e) { + e = e || window.event; + if (e.stopPropagation) { + e.stopPropagation(); + } else { + e.cancelBubble = true; + } + }, + resize: function () { + this._zrHeight = this.zr.getHeight(); + this._zrWidth = this.zr.getWidth(); + if (this._tDom.offsetHeight > 10) { + this._sizeCssText = 'width:' + this._zrWidth + 'px;' + 'height:' + this._zrHeight + 'px;' + 'background-color:#fff;'; + this._tDom.style.cssText = this._gCssText + this._sizeCssText; + this._textArea.style.cssText = 'display:block;margin:0 0 8px 0;' + 'padding:4px 6px;overflow:auto;' + 'width:' + (this._zrWidth - 15) + 'px;' + 'height:' + (this._zrHeight - 100) + 'px;'; + } + }, + dispose: function () { + if (window.removeEventListener) { + this._tDom.removeEventListener('click', this._stop); + this._tDom.removeEventListener('mousewheel', this._stop); + this._tDom.removeEventListener('mousemove', this._stop); + this._tDom.removeEventListener('mousedown', this._stop); + this._tDom.removeEventListener('mouseup', this._stop); + this._tDom.removeEventListener('touchstart', this._stop); + this._tDom.removeEventListener('touchmove', this._stop); + this._tDom.removeEventListener('touchend', this._stop); + } else { + this._tDom.detachEvent('onclick', this._stop); + this._tDom.detachEvent('onmousewheel', this._stop); + this._tDom.detachEvent('onmousemove', this._stop); + this._tDom.detachEvent('onmousedown', this._stop); + this._tDom.detachEvent('onmouseup', this._stop); + } + this._buttonRefresh.onclick = null; + this._buttonClose.onclick = null; + if (this._hasShow) { + this._tDom.removeChild(this._textArea); + this._tDom.removeChild(this._buttonRefresh); + this._tDom.removeChild(this._buttonClose); + } + this._textArea = null; + this._buttonRefresh = null; + this._buttonClose = null; + this.dom.firstChild.removeChild(this._tDom); + this._tDom = null; + } + }; + zrUtil.inherits(DataView, Base); + require('../component').define('dataView', DataView); + return DataView; +});define('echarts/util/shape/Cross', [ + 'require', + 'zrender/shape/Base', + 'zrender/shape/Line', + 'zrender/tool/util', + './normalIsCover' +], function (require) { + var Base = require('zrender/shape/Base'); + var LineShape = require('zrender/shape/Line'); + var zrUtil = require('zrender/tool/util'); + function Cross(options) { + Base.call(this, options); + } + Cross.prototype = { + type: 'cross', + buildPath: function (ctx, style) { + var rect = style.rect; + style.xStart = rect.x; + style.xEnd = rect.x + rect.width; + style.yStart = style.yEnd = style.y; + LineShape.prototype.buildPath(ctx, style); + style.xStart = style.xEnd = style.x; + style.yStart = rect.y; + style.yEnd = rect.y + rect.height; + LineShape.prototype.buildPath(ctx, style); + }, + getRect: function (style) { + return style.rect; + }, + isCover: require('./normalIsCover') + }; + zrUtil.inherits(Cross, Base); + return Cross; +});define('zrender/shape/Sector', [ + 'require', + '../tool/math', + '../tool/computeBoundingBox', + '../tool/vector', + './Base', + '../tool/util' +], function (require) { + var math = require('../tool/math'); + var computeBoundingBox = require('../tool/computeBoundingBox'); + var vec2 = require('../tool/vector'); + var Base = require('./Base'); + var min0 = vec2.create(); + var min1 = vec2.create(); + var max0 = vec2.create(); + var max1 = vec2.create(); + var Sector = function (options) { + Base.call(this, options); + }; + Sector.prototype = { + type: 'sector', + buildPath: function (ctx, style) { + var x = style.x; + var y = style.y; + var r0 = style.r0 || 0; + var r = style.r; + var startAngle = style.startAngle; + var endAngle = style.endAngle; + var clockWise = style.clockWise || false; + startAngle = math.degreeToRadian(startAngle); + endAngle = math.degreeToRadian(endAngle); + if (!clockWise) { + startAngle = -startAngle; + endAngle = -endAngle; + } + var unitX = math.cos(startAngle); + var unitY = math.sin(startAngle); + ctx.moveTo(unitX * r0 + x, unitY * r0 + y); + ctx.lineTo(unitX * r + x, unitY * r + y); + ctx.arc(x, y, r, startAngle, endAngle, !clockWise); + ctx.lineTo(math.cos(endAngle) * r0 + x, math.sin(endAngle) * r0 + y); + if (r0 !== 0) { + ctx.arc(x, y, r0, endAngle, startAngle, clockWise); + } + ctx.closePath(); + return; + }, + getRect: function (style) { + if (style.__rect) { + return style.__rect; + } + var x = style.x; + var y = style.y; + var r0 = style.r0 || 0; + var r = style.r; + var startAngle = math.degreeToRadian(style.startAngle); + var endAngle = math.degreeToRadian(style.endAngle); + var clockWise = style.clockWise; + if (!clockWise) { + startAngle = -startAngle; + endAngle = -endAngle; + } + if (r0 > 1) { + computeBoundingBox.arc(x, y, r0, startAngle, endAngle, !clockWise, min0, max0); + } else { + min0[0] = max0[0] = x; + min0[1] = max0[1] = y; + } + computeBoundingBox.arc(x, y, r, startAngle, endAngle, !clockWise, min1, max1); + vec2.min(min0, min0, min1); + vec2.max(max0, max0, max1); + style.__rect = { + x: min0[0], + y: min0[1], + width: max0[0] - min0[0], + height: max0[1] - min0[1] + }; + return style.__rect; + } + }; + require('../tool/util').inherits(Sector, Base); + return Sector; +});define('echarts/util/shape/Candle', [ + 'require', + 'zrender/shape/Base', + 'zrender/tool/util', + './normalIsCover' +], function (require) { + var Base = require('zrender/shape/Base'); + var zrUtil = require('zrender/tool/util'); + function Candle(options) { + Base.call(this, options); + } + Candle.prototype = { + type: 'candle', + _numberOrder: function (a, b) { + return b - a; + }, + buildPath: function (ctx, style) { + var yList = zrUtil.clone(style.y).sort(this._numberOrder); + ctx.moveTo(style.x, yList[3]); + ctx.lineTo(style.x, yList[2]); + ctx.moveTo(style.x - style.width / 2, yList[2]); + ctx.rect(style.x - style.width / 2, yList[2], style.width, yList[1] - yList[2]); + ctx.moveTo(style.x, yList[1]); + ctx.lineTo(style.x, yList[0]); + }, + getRect: function (style) { + if (!style.__rect) { + var lineWidth = 0; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } + var yList = zrUtil.clone(style.y).sort(this._numberOrder); + style.__rect = { + x: Math.round(style.x - style.width / 2 - lineWidth / 2), + y: Math.round(yList[3] - lineWidth / 2), + width: style.width + lineWidth, + height: yList[0] - yList[3] + lineWidth + }; + } + return style.__rect; + }, + isCover: require('./normalIsCover') + }; + zrUtil.inherits(Candle, Base); + return Candle; +});define('zrender/tool/computeBoundingBox', [ + 'require', + './vector', + './curve' +], function (require) { + var vec2 = require('./vector'); + var curve = require('./curve'); + function computeBoundingBox(points, min, max) { + if (points.length === 0) { + return; + } + var left = points[0][0]; + var right = points[0][0]; + var top = points[0][1]; + var bottom = points[0][1]; + for (var i = 1; i < points.length; i++) { + var p = points[i]; + if (p[0] < left) { + left = p[0]; + } + if (p[0] > right) { + right = p[0]; + } + if (p[1] < top) { + top = p[1]; + } + if (p[1] > bottom) { + bottom = p[1]; + } + } + min[0] = left; + min[1] = top; + max[0] = right; + max[1] = bottom; + } + function computeCubeBezierBoundingBox(p0, p1, p2, p3, min, max) { + var xDim = []; + curve.cubicExtrema(p0[0], p1[0], p2[0], p3[0], xDim); + for (var i = 0; i < xDim.length; i++) { + xDim[i] = curve.cubicAt(p0[0], p1[0], p2[0], p3[0], xDim[i]); + } + var yDim = []; + curve.cubicExtrema(p0[1], p1[1], p2[1], p3[1], yDim); + for (var i = 0; i < yDim.length; i++) { + yDim[i] = curve.cubicAt(p0[1], p1[1], p2[1], p3[1], yDim[i]); + } + xDim.push(p0[0], p3[0]); + yDim.push(p0[1], p3[1]); + var left = Math.min.apply(null, xDim); + var right = Math.max.apply(null, xDim); + var top = Math.min.apply(null, yDim); + var bottom = Math.max.apply(null, yDim); + min[0] = left; + min[1] = top; + max[0] = right; + max[1] = bottom; + } + function computeQuadraticBezierBoundingBox(p0, p1, p2, min, max) { + var t1 = curve.quadraticExtremum(p0[0], p1[0], p2[0]); + var t2 = curve.quadraticExtremum(p0[1], p1[1], p2[1]); + t1 = Math.max(Math.min(t1, 1), 0); + t2 = Math.max(Math.min(t2, 1), 0); + var ct1 = 1 - t1; + var ct2 = 1 - t2; + var x1 = ct1 * ct1 * p0[0] + 2 * ct1 * t1 * p1[0] + t1 * t1 * p2[0]; + var y1 = ct1 * ct1 * p0[1] + 2 * ct1 * t1 * p1[1] + t1 * t1 * p2[1]; + var x2 = ct2 * ct2 * p0[0] + 2 * ct2 * t2 * p1[0] + t2 * t2 * p2[0]; + var y2 = ct2 * ct2 * p0[1] + 2 * ct2 * t2 * p1[1] + t2 * t2 * p2[1]; + min[0] = Math.min(p0[0], p2[0], x1, x2); + min[1] = Math.min(p0[1], p2[1], y1, y2); + max[0] = Math.max(p0[0], p2[0], x1, x2); + max[1] = Math.max(p0[1], p2[1], y1, y2); + } + var start = vec2.create(); + var end = vec2.create(); + var extremity = vec2.create(); + var computeArcBoundingBox = function (x, y, r, startAngle, endAngle, anticlockwise, min, max) { + if (Math.abs(startAngle - endAngle) >= Math.PI * 2) { + min[0] = x - r; + min[1] = y - r; + max[0] = x + r; + max[1] = y + r; + return; + } + start[0] = Math.cos(startAngle) * r + x; + start[1] = Math.sin(startAngle) * r + y; + end[0] = Math.cos(endAngle) * r + x; + end[1] = Math.sin(endAngle) * r + y; + vec2.min(min, start, end); + vec2.max(max, start, end); + startAngle = startAngle % (Math.PI * 2); + if (startAngle < 0) { + startAngle = startAngle + Math.PI * 2; + } + endAngle = endAngle % (Math.PI * 2); + if (endAngle < 0) { + endAngle = endAngle + Math.PI * 2; + } + if (startAngle > endAngle && !anticlockwise) { + endAngle += Math.PI * 2; + } else if (startAngle < endAngle && anticlockwise) { + startAngle += Math.PI * 2; + } + if (anticlockwise) { + var tmp = endAngle; + endAngle = startAngle; + startAngle = tmp; + } + for (var angle = 0; angle < endAngle; angle += Math.PI / 2) { + if (angle > startAngle) { + extremity[0] = Math.cos(angle) * r + x; + extremity[1] = Math.sin(angle) * r + y; + vec2.min(min, extremity, min); + vec2.max(max, extremity, max); + } + } + }; + computeBoundingBox.cubeBezier = computeCubeBezierBoundingBox; + computeBoundingBox.quadraticBezier = computeQuadraticBezierBoundingBox; + computeBoundingBox.arc = computeArcBoundingBox; + return computeBoundingBox; +});define('echarts/util/shape/Chain', [ + 'require', + 'zrender/shape/Base', + './Icon', + 'zrender/shape/util/dashedLineTo', + 'zrender/tool/util', + 'zrender/tool/matrix' +], function (require) { + var Base = require('zrender/shape/Base'); + var IconShape = require('./Icon'); + var dashedLineTo = require('zrender/shape/util/dashedLineTo'); + var zrUtil = require('zrender/tool/util'); + var matrix = require('zrender/tool/matrix'); + function Chain(options) { + Base.call(this, options); + } + Chain.prototype = { + type: 'chain', + brush: function (ctx, isHighlight) { + var style = this.style; + if (isHighlight) { + style = this.getHighlightStyle(style, this.highlightStyle || {}); + } + ctx.save(); + this.setContext(ctx, style); + this.setTransform(ctx); + ctx.save(); + ctx.beginPath(); + this.buildLinePath(ctx, style); + ctx.stroke(); + ctx.restore(); + this.brushSymbol(ctx, style); + ctx.restore(); + return; + }, + buildLinePath: function (ctx, style) { + var x = style.x; + var y = style.y + 5; + var width = style.width; + var height = style.height / 2 - 10; + ctx.moveTo(x, y); + ctx.lineTo(x, y + height); + ctx.moveTo(x + width, y); + ctx.lineTo(x + width, y + height); + ctx.moveTo(x, y + height / 2); + if (!style.lineType || style.lineType == 'solid') { + ctx.lineTo(x + width, y + height / 2); + } else if (style.lineType == 'dashed' || style.lineType == 'dotted') { + var dashLength = (style.lineWidth || 1) * (style.lineType == 'dashed' ? 5 : 1); + dashedLineTo(ctx, x, y + height / 2, x + width, y + height / 2, dashLength); + } + }, + brushSymbol: function (ctx, style) { + var y = style.y + style.height / 4; + ctx.save(); + var chainPoint = style.chainPoint; + var curPoint; + for (var idx = 0, l = chainPoint.length; idx < l; idx++) { + curPoint = chainPoint[idx]; + if (curPoint.symbol != 'none') { + ctx.beginPath(); + var symbolSize = curPoint.symbolSize; + IconShape.prototype.buildPath(ctx, { + iconType: curPoint.symbol, + x: curPoint.x - symbolSize, + y: y - symbolSize, + width: symbolSize * 2, + height: symbolSize * 2, + n: curPoint.n + }); + ctx.fillStyle = curPoint.isEmpty ? '#fff' : style.strokeColor; + ctx.closePath(); + ctx.fill(); + ctx.stroke(); + } + if (curPoint.showLabel) { + ctx.font = curPoint.textFont; + ctx.fillStyle = curPoint.textColor; + ctx.textAlign = curPoint.textAlign; + ctx.textBaseline = curPoint.textBaseline; + if (curPoint.rotation) { + ctx.save(); + this._updateTextTransform(ctx, curPoint.rotation); + ctx.fillText(curPoint.name, curPoint.textX, curPoint.textY); + ctx.restore(); + } else { + ctx.fillText(curPoint.name, curPoint.textX, curPoint.textY); + } + } + } + ctx.restore(); + }, + _updateTextTransform: function (ctx, rotation) { + var _transform = matrix.create(); + matrix.identity(_transform); + if (rotation[0] !== 0) { + var originX = rotation[1] || 0; + var originY = rotation[2] || 0; + if (originX || originY) { + matrix.translate(_transform, _transform, [ + -originX, + -originY + ]); + } + matrix.rotate(_transform, _transform, rotation[0]); + if (originX || originY) { + matrix.translate(_transform, _transform, [ + originX, + originY + ]); + } + } + ctx.transform.apply(ctx, _transform); + }, + isCover: function (x, y) { + var rect = this.style; + if (x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height) { + return true; + } else { + return false; + } + } + }; + zrUtil.inherits(Chain, Base); + return Chain; +});define('zrender/shape/Ring', [ + 'require', + './Base', + '../tool/util' +], function (require) { + var Base = require('./Base'); + var Ring = function (options) { + Base.call(this, options); + }; + Ring.prototype = { + type: 'ring', + buildPath: function (ctx, style) { + ctx.arc(style.x, style.y, style.r, 0, Math.PI * 2, false); + ctx.moveTo(style.x + style.r0, style.y); + ctx.arc(style.x, style.y, style.r0, 0, Math.PI * 2, true); + return; + }, + getRect: function (style) { + if (style.__rect) { + return style.__rect; + } + var lineWidth; + if (style.brushType == 'stroke' || style.brushType == 'fill') { + lineWidth = style.lineWidth || 1; + } else { + lineWidth = 0; + } + style.__rect = { + x: Math.round(style.x - style.r - lineWidth / 2), + y: Math.round(style.y - style.r - lineWidth / 2), + width: style.r * 2 + lineWidth, + height: style.r * 2 + lineWidth + }; + return style.__rect; + } + }; + require('../tool/util').inherits(Ring, Base); + return Ring; +});define('echarts/component/axis', [ + 'require', + './base', + 'zrender/shape/Line', + '../config', + '../util/ecData', + 'zrender/tool/util', + 'zrender/tool/color', + './categoryAxis', + './valueAxis', + '../component' +], function (require) { + var Base = require('./base'); + var LineShape = require('zrender/shape/Line'); + var ecConfig = require('../config'); + var ecData = require('../util/ecData'); + var zrUtil = require('zrender/tool/util'); + var zrColor = require('zrender/tool/color'); + function Axis(ecTheme, messageCenter, zr, option, myChart, axisType) { + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + this.axisType = axisType; + this._axisList = []; + this.refresh(option); + } + Axis.prototype = { + type: ecConfig.COMPONENT_TYPE_AXIS, + axisBase: { + _buildAxisLine: function () { + var lineWidth = this.option.axisLine.lineStyle.width; + var halfLineWidth = lineWidth / 2; + var axShape = { + _axisShape: 'axisLine', + zlevel: this.getZlevelBase(), + z: this.getZBase() + 3, + hoverable: false + }; + var grid = this.grid; + switch (this.option.position) { + case 'left': + axShape.style = { + xStart: grid.getX() - halfLineWidth, + yStart: grid.getYend(), + xEnd: grid.getX() - halfLineWidth, + yEnd: grid.getY(), + lineCap: 'round' + }; + break; + case 'right': + axShape.style = { + xStart: grid.getXend() + halfLineWidth, + yStart: grid.getYend(), + xEnd: grid.getXend() + halfLineWidth, + yEnd: grid.getY(), + lineCap: 'round' + }; + break; + case 'bottom': + axShape.style = { + xStart: grid.getX(), + yStart: grid.getYend() + halfLineWidth, + xEnd: grid.getXend(), + yEnd: grid.getYend() + halfLineWidth, + lineCap: 'round' + }; + break; + case 'top': + axShape.style = { + xStart: grid.getX(), + yStart: grid.getY() - halfLineWidth, + xEnd: grid.getXend(), + yEnd: grid.getY() - halfLineWidth, + lineCap: 'round' + }; + break; + } + var style = axShape.style; + if (this.option.name !== '') { + style.text = this.option.name; + style.textPosition = this.option.nameLocation; + style.textFont = this.getFont(this.option.nameTextStyle); + if (this.option.nameTextStyle.align) { + style.textAlign = this.option.nameTextStyle.align; + } + if (this.option.nameTextStyle.baseline) { + style.textBaseline = this.option.nameTextStyle.baseline; + } + if (this.option.nameTextStyle.color) { + style.textColor = this.option.nameTextStyle.color; + } + } + style.strokeColor = this.option.axisLine.lineStyle.color; + style.lineWidth = lineWidth; + if (this.isHorizontal()) { + style.yStart = style.yEnd = this.subPixelOptimize(style.yEnd, lineWidth); + } else { + style.xStart = style.xEnd = this.subPixelOptimize(style.xEnd, lineWidth); + } + style.lineType = this.option.axisLine.lineStyle.type; + axShape = new LineShape(axShape); + this.shapeList.push(axShape); + }, + _axisLabelClickable: function (clickable, axShape) { + if (clickable) { + ecData.pack(axShape, undefined, -1, undefined, -1, axShape.style.text); + axShape.hoverable = true; + axShape.clickable = true; + axShape.highlightStyle = { + color: zrColor.lift(axShape.style.color, 1), + brushType: 'fill' + }; + return axShape; + } else { + return axShape; + } + }, + refixAxisShape: function (zeroX, zeroY) { + if (!this.option.axisLine.onZero) { + return; + } + var tickLength; + if (this.isHorizontal() && zeroY != null) { + for (var i = 0, l = this.shapeList.length; i < l; i++) { + if (this.shapeList[i]._axisShape === 'axisLine') { + this.shapeList[i].style.yStart = this.shapeList[i].style.yEnd = this.subPixelOptimize(zeroY, this.shapeList[i].stylelineWidth); + this.zr.modShape(this.shapeList[i].id); + } else if (this.shapeList[i]._axisShape === 'axisTick') { + tickLength = this.shapeList[i].style.yEnd - this.shapeList[i].style.yStart; + this.shapeList[i].style.yStart = zeroY - tickLength; + this.shapeList[i].style.yEnd = zeroY; + this.zr.modShape(this.shapeList[i].id); + } + } + } + if (!this.isHorizontal() && zeroX != null) { + for (var i = 0, l = this.shapeList.length; i < l; i++) { + if (this.shapeList[i]._axisShape === 'axisLine') { + this.shapeList[i].style.xStart = this.shapeList[i].style.xEnd = this.subPixelOptimize(zeroX, this.shapeList[i].stylelineWidth); + this.zr.modShape(this.shapeList[i].id); + } else if (this.shapeList[i]._axisShape === 'axisTick') { + tickLength = this.shapeList[i].style.xEnd - this.shapeList[i].style.xStart; + this.shapeList[i].style.xStart = zeroX; + this.shapeList[i].style.xEnd = zeroX + tickLength; + this.zr.modShape(this.shapeList[i].id); + } + } + } + }, + getPosition: function () { + return this.option.position; + }, + isHorizontal: function () { + return this.option.position === 'bottom' || this.option.position === 'top'; + } + }, + reformOption: function (opt) { + if (!opt || opt instanceof Array && opt.length === 0) { + opt = [{ type: ecConfig.COMPONENT_TYPE_AXIS_VALUE }]; + } else if (!(opt instanceof Array)) { + opt = [opt]; + } + if (opt.length > 2) { + opt = [ + opt[0], + opt[1] + ]; + } + if (this.axisType === 'xAxis') { + if (!opt[0].position || opt[0].position != 'bottom' && opt[0].position != 'top') { + opt[0].position = 'bottom'; + } + if (opt.length > 1) { + opt[1].position = opt[0].position === 'bottom' ? 'top' : 'bottom'; + } + for (var i = 0, l = opt.length; i < l; i++) { + opt[i].type = opt[i].type || 'category'; + opt[i].xAxisIndex = i; + opt[i].yAxisIndex = -1; + } + } else { + if (!opt[0].position || opt[0].position != 'left' && opt[0].position != 'right') { + opt[0].position = 'left'; + } + if (opt.length > 1) { + opt[1].position = opt[0].position === 'left' ? 'right' : 'left'; + } + for (var i = 0, l = opt.length; i < l; i++) { + opt[i].type = opt[i].type || 'value'; + opt[i].xAxisIndex = -1; + opt[i].yAxisIndex = i; + } + } + return opt; + }, + refresh: function (newOption) { + var axisOption; + if (newOption) { + this.option = newOption; + if (this.axisType === 'xAxis') { + this.option.xAxis = this.reformOption(newOption.xAxis); + axisOption = this.option.xAxis; + } else { + this.option.yAxis = this.reformOption(newOption.yAxis); + axisOption = this.option.yAxis; + } + this.series = newOption.series; + } + var CategoryAxis = require('./categoryAxis'); + var ValueAxis = require('./valueAxis'); + var len = Math.max(axisOption && axisOption.length || 0, this._axisList.length); + for (var i = 0; i < len; i++) { + if (this._axisList[i] && newOption && (!axisOption[i] || this._axisList[i].type != axisOption[i].type)) { + this._axisList[i].dispose && this._axisList[i].dispose(); + this._axisList[i] = false; + } + if (this._axisList[i]) { + this._axisList[i].refresh && this._axisList[i].refresh(axisOption ? axisOption[i] : false, this.series); + } else if (axisOption && axisOption[i]) { + this._axisList[i] = axisOption[i].type === 'category' ? new CategoryAxis(this.ecTheme, this.messageCenter, this.zr, axisOption[i], this.myChart, this.axisBase) : new ValueAxis(this.ecTheme, this.messageCenter, this.zr, axisOption[i], this.myChart, this.axisBase, this.series); + } + } + }, + getAxis: function (idx) { + return this._axisList[idx]; + }, + clear: function () { + for (var i = 0, l = this._axisList.length; i < l; i++) { + this._axisList[i].dispose && this._axisList[i].dispose(); + } + this._axisList = []; + } + }; + zrUtil.inherits(Axis, Base); + require('../component').define('axis', Axis); + return Axis; +});define('echarts/component/grid', [ + 'require', + './base', + 'zrender/shape/Rectangle', + '../config', + 'zrender/tool/util', + '../component' +], function (require) { + var Base = require('./base'); + var RectangleShape = require('zrender/shape/Rectangle'); + var ecConfig = require('../config'); + ecConfig.grid = { + zlevel: 0, + z: 0, + x: 80, + y: 60, + x2: 80, + y2: 60, + backgroundColor: 'rgba(0,0,0,0)', + borderWidth: 1, + borderColor: '#ccc' + }; + var zrUtil = require('zrender/tool/util'); + function Grid(ecTheme, messageCenter, zr, option, myChart) { + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + this.refresh(option); + } + Grid.prototype = { + type: ecConfig.COMPONENT_TYPE_GRID, + getX: function () { + return this._x; + }, + getY: function () { + return this._y; + }, + getWidth: function () { + return this._width; + }, + getHeight: function () { + return this._height; + }, + getXend: function () { + return this._x + this._width; + }, + getYend: function () { + return this._y + this._height; + }, + getArea: function () { + return { + x: this._x, + y: this._y, + width: this._width, + height: this._height + }; + }, + getBbox: function () { + return [ + [ + this._x, + this._y + ], + [ + this.getXend(), + this.getYend() + ] + ]; + }, + refixAxisShape: function (component) { + var zeroX; + var zeroY; + var axisList = component.xAxis._axisList.concat(component.yAxis ? component.yAxis._axisList : []); + var len = axisList.length; + var axis; + while (len--) { + axis = axisList[len]; + if (axis.type == ecConfig.COMPONENT_TYPE_AXIS_VALUE && axis._min < 0 && axis._max >= 0) { + axis.isHorizontal() ? zeroX = axis.getCoord(0) : zeroY = axis.getCoord(0); + } + } + if (typeof zeroX != 'undefined' || typeof zeroY != 'undefined') { + len = axisList.length; + while (len--) { + axisList[len].refixAxisShape(zeroX, zeroY); + } + } + }, + refresh: function (newOption) { + if (newOption || this._zrWidth != this.zr.getWidth() || this._zrHeight != this.zr.getHeight()) { + this.clear(); + this.option = newOption || this.option; + this.option.grid = this.reformOption(this.option.grid); + var gridOption = this.option.grid; + this._zrWidth = this.zr.getWidth(); + this._zrHeight = this.zr.getHeight(); + this._x = this.parsePercent(gridOption.x, this._zrWidth); + this._y = this.parsePercent(gridOption.y, this._zrHeight); + var x2 = this.parsePercent(gridOption.x2, this._zrWidth); + var y2 = this.parsePercent(gridOption.y2, this._zrHeight); + if (typeof gridOption.width == 'undefined') { + this._width = this._zrWidth - this._x - x2; + } else { + this._width = this.parsePercent(gridOption.width, this._zrWidth); + } + this._width = this._width <= 0 ? 10 : this._width; + if (typeof gridOption.height == 'undefined') { + this._height = this._zrHeight - this._y - y2; + } else { + this._height = this.parsePercent(gridOption.height, this._zrHeight); + } + this._height = this._height <= 0 ? 10 : this._height; + this._x = this.subPixelOptimize(this._x, gridOption.borderWidth); + this._y = this.subPixelOptimize(this._y, gridOption.borderWidth); + this.shapeList.push(new RectangleShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: this._x, + y: this._y, + width: this._width, + height: this._height, + brushType: gridOption.borderWidth > 0 ? 'both' : 'fill', + color: gridOption.backgroundColor, + strokeColor: gridOption.borderColor, + lineWidth: gridOption.borderWidth + } + })); + this.zr.addShape(this.shapeList[0]); + } + } + }; + zrUtil.inherits(Grid, Base); + require('../component').define('grid', Grid); + return Grid; +});define('echarts/component/dataZoom', [ + 'require', + './base', + 'zrender/shape/Rectangle', + 'zrender/shape/Polygon', + '../util/shape/Icon', + '../config', + '../util/date', + 'zrender/tool/util', + '../component' +], function (require) { + var Base = require('./base'); + var RectangleShape = require('zrender/shape/Rectangle'); + var PolygonShape = require('zrender/shape/Polygon'); + var IconShape = require('../util/shape/Icon'); + var ecConfig = require('../config'); + ecConfig.dataZoom = { + zlevel: 0, + z: 4, + show: false, + orient: 'horizontal', + backgroundColor: 'rgba(0,0,0,0)', + dataBackgroundColor: '#eee', + fillerColor: 'rgba(144,197,237,0.2)', + handleColor: 'rgba(70,130,180,0.8)', + handleSize: 8, + showDetail: true, + realtime: true + }; + var ecDate = require('../util/date'); + var zrUtil = require('zrender/tool/util'); + function DataZoom(ecTheme, messageCenter, zr, option, myChart) { + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + var self = this; + self._ondrift = function (dx, dy) { + return self.__ondrift(this, dx, dy); + }; + self._ondragend = function () { + return self.__ondragend(); + }; + this._fillerSize = 30; + this._isSilence = false; + this._zoom = {}; + this.option.dataZoom = this.reformOption(this.option.dataZoom); + this.zoomOption = this.option.dataZoom; + this._handleSize = this.zoomOption.handleSize; + if (!this.myChart.canvasSupported) { + this.zoomOption.realtime = false; + } + this._location = this._getLocation(); + this._zoom = this._getZoom(); + this._backupData(); + if (this.option.dataZoom.show) { + this._buildShape(); + } + this._syncData(); + } + DataZoom.prototype = { + type: ecConfig.COMPONENT_TYPE_DATAZOOM, + _buildShape: function () { + this._buildBackground(); + this._buildFiller(); + this._buildHandle(); + this._buildFrame(); + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + this._syncFrameShape(); + }, + _getLocation: function () { + var x; + var y; + var width; + var height; + var grid = this.component.grid; + if (this.zoomOption.orient == 'horizontal') { + width = this.zoomOption.width || grid.getWidth(); + height = this.zoomOption.height || this._fillerSize; + x = this.zoomOption.x != null ? this.zoomOption.x : grid.getX(); + y = this.zoomOption.y != null ? this.zoomOption.y : this.zr.getHeight() - height - 2; + } else { + width = this.zoomOption.width || this._fillerSize; + height = this.zoomOption.height || grid.getHeight(); + x = this.zoomOption.x != null ? this.zoomOption.x : 2; + y = this.zoomOption.y != null ? this.zoomOption.y : grid.getY(); + } + return { + x: x, + y: y, + width: width, + height: height + }; + }, + _getZoom: function () { + var series = this.option.series; + var xAxis = this.option.xAxis; + if (xAxis && !(xAxis instanceof Array)) { + xAxis = [xAxis]; + this.option.xAxis = xAxis; + } + var yAxis = this.option.yAxis; + if (yAxis && !(yAxis instanceof Array)) { + yAxis = [yAxis]; + this.option.yAxis = yAxis; + } + var zoomSeriesIndex = []; + var xAxisIndex; + var yAxisIndex; + var zOptIdx = this.zoomOption.xAxisIndex; + if (xAxis && zOptIdx == null) { + xAxisIndex = []; + for (var i = 0, l = xAxis.length; i < l; i++) { + if (xAxis[i].type == 'category' || xAxis[i].type == null) { + xAxisIndex.push(i); + } + } + } else { + if (zOptIdx instanceof Array) { + xAxisIndex = zOptIdx; + } else if (zOptIdx != null) { + xAxisIndex = [zOptIdx]; + } else { + xAxisIndex = []; + } + } + zOptIdx = this.zoomOption.yAxisIndex; + if (yAxis && zOptIdx == null) { + yAxisIndex = []; + for (var i = 0, l = yAxis.length; i < l; i++) { + if (yAxis[i].type == 'category') { + yAxisIndex.push(i); + } + } + } else { + if (zOptIdx instanceof Array) { + yAxisIndex = zOptIdx; + } else if (zOptIdx != null) { + yAxisIndex = [zOptIdx]; + } else { + yAxisIndex = []; + } + } + var serie; + for (var i = 0, l = series.length; i < l; i++) { + serie = series[i]; + if (serie.type != ecConfig.CHART_TYPE_LINE && serie.type != ecConfig.CHART_TYPE_BAR && serie.type != ecConfig.CHART_TYPE_SCATTER && serie.type != ecConfig.CHART_TYPE_K) { + continue; + } + for (var j = 0, k = xAxisIndex.length; j < k; j++) { + if (xAxisIndex[j] == (serie.xAxisIndex || 0)) { + zoomSeriesIndex.push(i); + break; + } + } + for (var j = 0, k = yAxisIndex.length; j < k; j++) { + if (yAxisIndex[j] == (serie.yAxisIndex || 0)) { + zoomSeriesIndex.push(i); + break; + } + } + if (this.zoomOption.xAxisIndex == null && this.zoomOption.yAxisIndex == null && serie.data && this.getDataFromOption(serie.data[0]) instanceof Array && (serie.type == ecConfig.CHART_TYPE_SCATTER || serie.type == ecConfig.CHART_TYPE_LINE || serie.type == ecConfig.CHART_TYPE_BAR)) { + zoomSeriesIndex.push(i); + } + } + var start = this._zoom.start != null ? this._zoom.start : this.zoomOption.start != null ? this.zoomOption.start : 0; + var end = this._zoom.end != null ? this._zoom.end : this.zoomOption.end != null ? this.zoomOption.end : 100; + if (start > end) { + start = start + end; + end = start - end; + start = start - end; + } + var size = Math.round((end - start) / 100 * (this.zoomOption.orient == 'horizontal' ? this._location.width : this._location.height)); + return { + start: start, + end: end, + start2: 0, + end2: 100, + size: size, + xAxisIndex: xAxisIndex, + yAxisIndex: yAxisIndex, + seriesIndex: zoomSeriesIndex, + scatterMap: this._zoom.scatterMap || {} + }; + }, + _backupData: function () { + this._originalData = { + xAxis: {}, + yAxis: {}, + series: {} + }; + var xAxis = this.option.xAxis; + var xAxisIndex = this._zoom.xAxisIndex; + for (var i = 0, l = xAxisIndex.length; i < l; i++) { + this._originalData.xAxis[xAxisIndex[i]] = xAxis[xAxisIndex[i]].data; + } + var yAxis = this.option.yAxis; + var yAxisIndex = this._zoom.yAxisIndex; + for (var i = 0, l = yAxisIndex.length; i < l; i++) { + this._originalData.yAxis[yAxisIndex[i]] = yAxis[yAxisIndex[i]].data; + } + var series = this.option.series; + var seriesIndex = this._zoom.seriesIndex; + var serie; + for (var i = 0, l = seriesIndex.length; i < l; i++) { + serie = series[seriesIndex[i]]; + this._originalData.series[seriesIndex[i]] = serie.data; + if (serie.data && this.getDataFromOption(serie.data[0]) instanceof Array && (serie.type == ecConfig.CHART_TYPE_SCATTER || serie.type == ecConfig.CHART_TYPE_LINE || serie.type == ecConfig.CHART_TYPE_BAR)) { + this._backupScale(); + this._calculScatterMap(seriesIndex[i]); + } + } + }, + _calculScatterMap: function (seriesIndex) { + this._zoom.scatterMap = this._zoom.scatterMap || {}; + this._zoom.scatterMap[seriesIndex] = this._zoom.scatterMap[seriesIndex] || {}; + var componentLibrary = require('../component'); + var Axis = componentLibrary.get('axis'); + var axisOption = zrUtil.clone(this.option.xAxis); + if (axisOption[0].type == 'category') { + axisOption[0].type = 'value'; + } + if (axisOption[1] && axisOption[1].type == 'category') { + axisOption[1].type = 'value'; + } + var vAxis = new Axis(this.ecTheme, null, false, { + xAxis: axisOption, + series: this.option.series + }, this, 'xAxis'); + var axisIndex = this.option.series[seriesIndex].xAxisIndex || 0; + this._zoom.scatterMap[seriesIndex].x = vAxis.getAxis(axisIndex).getExtremum(); + vAxis.dispose(); + axisOption = zrUtil.clone(this.option.yAxis); + if (axisOption[0].type == 'category') { + axisOption[0].type = 'value'; + } + if (axisOption[1] && axisOption[1].type == 'category') { + axisOption[1].type = 'value'; + } + vAxis = new Axis(this.ecTheme, null, false, { + yAxis: axisOption, + series: this.option.series + }, this, 'yAxis'); + axisIndex = this.option.series[seriesIndex].yAxisIndex || 0; + this._zoom.scatterMap[seriesIndex].y = vAxis.getAxis(axisIndex).getExtremum(); + vAxis.dispose(); + }, + _buildBackground: function () { + var width = this._location.width; + var height = this._location.height; + this.shapeList.push(new RectangleShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: this._location.x, + y: this._location.y, + width: width, + height: height, + color: this.zoomOption.backgroundColor + } + })); + var maxLength = 0; + var xAxis = this._originalData.xAxis; + var xAxisIndex = this._zoom.xAxisIndex; + for (var i = 0, l = xAxisIndex.length; i < l; i++) { + maxLength = Math.max(maxLength, xAxis[xAxisIndex[i]].length); + } + var yAxis = this._originalData.yAxis; + var yAxisIndex = this._zoom.yAxisIndex; + for (var i = 0, l = yAxisIndex.length; i < l; i++) { + maxLength = Math.max(maxLength, yAxis[yAxisIndex[i]].length); + } + var seriesIndex = this._zoom.seriesIndex[0]; + var data = this._originalData.series[seriesIndex]; + var maxValue = Number.MIN_VALUE; + var minValue = Number.MAX_VALUE; + var value; + for (var i = 0, l = data.length; i < l; i++) { + value = this.getDataFromOption(data[i], 0); + if (this.option.series[seriesIndex].type == ecConfig.CHART_TYPE_K) { + value = value[1]; + } + if (isNaN(value)) { + value = 0; + } + maxValue = Math.max(maxValue, value); + minValue = Math.min(minValue, value); + } + var valueRange = maxValue - minValue; + var pointList = []; + var x = width / (maxLength - (maxLength > 1 ? 1 : 0)); + var y = height / (maxLength - (maxLength > 1 ? 1 : 0)); + var step = 1; + if (this.zoomOption.orient == 'horizontal' && x < 1) { + step = Math.floor(maxLength * 3 / width); + } else if (this.zoomOption.orient == 'vertical' && y < 1) { + step = Math.floor(maxLength * 3 / height); + } + for (var i = 0, l = maxLength; i < l; i += step) { + value = this.getDataFromOption(data[i], 0); + if (this.option.series[seriesIndex].type == ecConfig.CHART_TYPE_K) { + value = value[1]; + } + if (isNaN(value)) { + value = 0; + } + if (this.zoomOption.orient == 'horizontal') { + pointList.push([ + this._location.x + x * i, + this._location.y + height - 1 - Math.round((value - minValue) / valueRange * (height - 10)) + ]); + } else { + pointList.push([ + this._location.x + 1 + Math.round((value - minValue) / valueRange * (width - 10)), + this._location.y + y * (l - i - 1) + ]); + } + } + if (this.zoomOption.orient == 'horizontal') { + pointList.push([ + this._location.x + width, + this._location.y + height + ]); + pointList.push([ + this._location.x, + this._location.y + height + ]); + } else { + pointList.push([ + this._location.x, + this._location.y + ]); + pointList.push([ + this._location.x, + this._location.y + height + ]); + } + this.shapeList.push(new PolygonShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + pointList: pointList, + color: this.zoomOption.dataBackgroundColor + }, + hoverable: false + })); + }, + _buildFiller: function () { + this._fillerShae = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + draggable: true, + ondrift: this._ondrift, + ondragend: this._ondragend, + _type: 'filler' + }; + if (this.zoomOption.orient == 'horizontal') { + this._fillerShae.style = { + x: this._location.x + Math.round(this._zoom.start / 100 * this._location.width) + this._handleSize, + y: this._location.y, + width: this._zoom.size - this._handleSize * 2, + height: this._location.height, + color: this.zoomOption.fillerColor, + text: ':::', + textPosition: 'inside' + }; + } else { + this._fillerShae.style = { + x: this._location.x, + y: this._location.y + Math.round(this._zoom.start / 100 * this._location.height) + this._handleSize, + width: this._location.width, + height: this._zoom.size - this._handleSize * 2, + color: this.zoomOption.fillerColor, + text: '::', + textPosition: 'inside' + }; + } + this._fillerShae.highlightStyle = { + brushType: 'fill', + color: 'rgba(0,0,0,0)' + }; + this._fillerShae = new RectangleShape(this._fillerShae); + this.shapeList.push(this._fillerShae); + }, + _buildHandle: function () { + var detail = this.zoomOption.showDetail ? this._getDetail() : { + start: '', + end: '' + }; + this._startShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + draggable: true, + style: { + iconType: 'rectangle', + x: this._location.x, + y: this._location.y, + width: this._handleSize, + height: this._handleSize, + color: this.zoomOption.handleColor, + text: '=', + textPosition: 'inside' + }, + highlightStyle: { + text: detail.start, + brushType: 'fill', + textPosition: 'left' + }, + ondrift: this._ondrift, + ondragend: this._ondragend + }; + if (this.zoomOption.orient == 'horizontal') { + this._startShape.style.height = this._location.height; + this._endShape = zrUtil.clone(this._startShape); + this._startShape.style.x = this._fillerShae.style.x - this._handleSize, this._endShape.style.x = this._fillerShae.style.x + this._fillerShae.style.width; + this._endShape.highlightStyle.text = detail.end; + this._endShape.highlightStyle.textPosition = 'right'; + } else { + this._startShape.style.width = this._location.width; + this._endShape = zrUtil.clone(this._startShape); + this._startShape.style.y = this._fillerShae.style.y + this._fillerShae.style.height; + this._startShape.highlightStyle.textPosition = 'bottom'; + this._endShape.style.y = this._fillerShae.style.y - this._handleSize; + this._endShape.highlightStyle.text = detail.end; + this._endShape.highlightStyle.textPosition = 'top'; + } + this._startShape = new IconShape(this._startShape); + this._endShape = new IconShape(this._endShape); + this.shapeList.push(this._startShape); + this.shapeList.push(this._endShape); + }, + _buildFrame: function () { + var x = this.subPixelOptimize(this._location.x, 1); + var y = this.subPixelOptimize(this._location.y, 1); + this._startFrameShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: x, + y: y, + width: this._location.width - (x > this._location.x ? 1 : 0), + height: this._location.height - (y > this._location.y ? 1 : 0), + lineWidth: 1, + brushType: 'stroke', + strokeColor: this.zoomOption.handleColor + } + }; + this._endFrameShape = zrUtil.clone(this._startFrameShape); + this._startFrameShape = new RectangleShape(this._startFrameShape); + this._endFrameShape = new RectangleShape(this._endFrameShape); + this.shapeList.push(this._startFrameShape); + this.shapeList.push(this._endFrameShape); + return; + }, + _syncHandleShape: function () { + if (this.zoomOption.orient == 'horizontal') { + this._startShape.style.x = this._fillerShae.style.x - this._handleSize; + this._endShape.style.x = this._fillerShae.style.x + this._fillerShae.style.width; + this._zoom.start = (this._startShape.style.x - this._location.x) / this._location.width * 100; + this._zoom.end = (this._endShape.style.x + this._handleSize - this._location.x) / this._location.width * 100; + } else { + this._startShape.style.y = this._fillerShae.style.y + this._fillerShae.style.height; + this._endShape.style.y = this._fillerShae.style.y - this._handleSize; + this._zoom.start = (this._location.y + this._location.height - this._startShape.style.y) / this._location.height * 100; + this._zoom.end = (this._location.y + this._location.height - this._endShape.style.y - this._handleSize) / this._location.height * 100; + } + this.zr.modShape(this._startShape.id); + this.zr.modShape(this._endShape.id); + this._syncFrameShape(); + this.zr.refreshNextFrame(); + }, + _syncFillerShape: function () { + var a; + var b; + if (this.zoomOption.orient == 'horizontal') { + a = this._startShape.style.x; + b = this._endShape.style.x; + this._fillerShae.style.x = Math.min(a, b) + this._handleSize; + this._fillerShae.style.width = Math.abs(a - b) - this._handleSize; + this._zoom.start = (Math.min(a, b) - this._location.x) / this._location.width * 100; + this._zoom.end = (Math.max(a, b) + this._handleSize - this._location.x) / this._location.width * 100; + } else { + a = this._startShape.style.y; + b = this._endShape.style.y; + this._fillerShae.style.y = Math.min(a, b) + this._handleSize; + this._fillerShae.style.height = Math.abs(a - b) - this._handleSize; + this._zoom.start = (this._location.y + this._location.height - Math.max(a, b)) / this._location.height * 100; + this._zoom.end = (this._location.y + this._location.height - Math.min(a, b) - this._handleSize) / this._location.height * 100; + } + this.zr.modShape(this._fillerShae.id); + this._syncFrameShape(); + this.zr.refreshNextFrame(); + }, + _syncFrameShape: function () { + if (this.zoomOption.orient == 'horizontal') { + this._startFrameShape.style.width = this._fillerShae.style.x - this._location.x; + this._endFrameShape.style.x = this._fillerShae.style.x + this._fillerShae.style.width; + this._endFrameShape.style.width = this._location.x + this._location.width - this._endFrameShape.style.x; + } else { + this._startFrameShape.style.y = this._fillerShae.style.y + this._fillerShae.style.height; + this._startFrameShape.style.height = this._location.y + this._location.height - this._startFrameShape.style.y; + this._endFrameShape.style.height = this._fillerShae.style.y - this._location.y; + } + this.zr.modShape(this._startFrameShape.id); + this.zr.modShape(this._endFrameShape.id); + }, + _syncShape: function () { + if (!this.zoomOption.show) { + return; + } + if (this.zoomOption.orient == 'horizontal') { + this._startShape.style.x = this._location.x + this._zoom.start / 100 * this._location.width; + this._endShape.style.x = this._location.x + this._zoom.end / 100 * this._location.width - this._handleSize; + this._fillerShae.style.x = this._startShape.style.x + this._handleSize; + this._fillerShae.style.width = this._endShape.style.x - this._startShape.style.x - this._handleSize; + } else { + this._startShape.style.y = this._location.y + this._location.height - this._zoom.start / 100 * this._location.height; + this._endShape.style.y = this._location.y + this._location.height - this._zoom.end / 100 * this._location.height - this._handleSize; + this._fillerShae.style.y = this._endShape.style.y + this._handleSize; + this._fillerShae.style.height = this._startShape.style.y - this._endShape.style.y - this._handleSize; + } + this.zr.modShape(this._startShape.id); + this.zr.modShape(this._endShape.id); + this.zr.modShape(this._fillerShae.id); + this._syncFrameShape(); + this.zr.refresh(); + }, + _syncData: function (dispatchNow) { + var target; + var start; + var end; + var length; + var data; + for (var key in this._originalData) { + target = this._originalData[key]; + for (var idx in target) { + data = target[idx]; + if (data == null) { + continue; + } + length = data.length; + start = Math.floor(this._zoom.start / 100 * length); + end = Math.ceil(this._zoom.end / 100 * length); + if (!(this.getDataFromOption(data[0]) instanceof Array) || this.option[key][idx].type == ecConfig.CHART_TYPE_K) { + this.option[key][idx].data = data.slice(start, end); + } else { + this._setScale(); + this.option[key][idx].data = this._synScatterData(idx, data); + } + } + } + if (!this._isSilence && (this.zoomOption.realtime || dispatchNow)) { + this.messageCenter.dispatch(ecConfig.EVENT.DATA_ZOOM, null, { zoom: this._zoom }, this.myChart); + } + }, + _synScatterData: function (seriesIndex, data) { + if (this._zoom.start === 0 && this._zoom.end == 100 && this._zoom.start2 === 0 && this._zoom.end2 == 100) { + return data; + } + var newData = []; + var scale = this._zoom.scatterMap[seriesIndex]; + var total; + var xStart; + var xEnd; + var yStart; + var yEnd; + if (this.zoomOption.orient == 'horizontal') { + total = scale.x.max - scale.x.min; + xStart = this._zoom.start / 100 * total + scale.x.min; + xEnd = this._zoom.end / 100 * total + scale.x.min; + total = scale.y.max - scale.y.min; + yStart = this._zoom.start2 / 100 * total + scale.y.min; + yEnd = this._zoom.end2 / 100 * total + scale.y.min; + } else { + total = scale.x.max - scale.x.min; + xStart = this._zoom.start2 / 100 * total + scale.x.min; + xEnd = this._zoom.end2 / 100 * total + scale.x.min; + total = scale.y.max - scale.y.min; + yStart = this._zoom.start / 100 * total + scale.y.min; + yEnd = this._zoom.end / 100 * total + scale.y.min; + } + var value; + for (var i = 0, l = data.length; i < l; i++) { + value = data[i].value || data[i]; + if (value[0] >= xStart && value[0] <= xEnd && value[1] >= yStart && value[1] <= yEnd) { + newData.push(data[i]); + } + } + return newData; + }, + _setScale: function () { + var needScale = this._zoom.start !== 0 || this._zoom.end !== 100 || this._zoom.start2 !== 0 || this._zoom.end2 !== 100; + var axis = { + xAxis: this.option.xAxis, + yAxis: this.option.yAxis + }; + for (var key in axis) { + for (var i = 0, l = axis[key].length; i < l; i++) { + axis[key][i].scale = needScale || axis[key][i]._scale; + } + } + }, + _backupScale: function () { + var axis = { + xAxis: this.option.xAxis, + yAxis: this.option.yAxis + }; + for (var key in axis) { + for (var i = 0, l = axis[key].length; i < l; i++) { + axis[key][i]._scale = axis[key][i].scale; + } + } + }, + _getDetail: function () { + var key = this.zoomOption.orient == 'horizontal' ? 'xAxis' : 'yAxis'; + var target = this._originalData[key]; + for (var idx in target) { + var data = target[idx]; + if (data == null) { + continue; + } + var length = data.length; + var start = Math.floor(this._zoom.start / 100 * length); + var end = Math.ceil(this._zoom.end / 100 * length); + end -= end > 0 ? 1 : 0; + return { + start: this.getDataFromOption(data[start]), + end: this.getDataFromOption(data[end]) + }; + } + var seriesIndex = this._zoom.seriesIndex[0]; + var axisIndex = this.option.series[seriesIndex][key + 'Index'] || 0; + var axisType = this.option[key][axisIndex].type; + var min = this._zoom.scatterMap[seriesIndex][key.charAt(0)].min; + var max = this._zoom.scatterMap[seriesIndex][key.charAt(0)].max; + var gap = max - min; + if (axisType == 'value') { + return { + start: min + gap * this._zoom.start / 100, + end: min + gap * this._zoom.end / 100 + }; + } else if (axisType == 'time') { + max = min + gap * this._zoom.end / 100; + min = min + gap * this._zoom.start / 100; + var formatter = ecDate.getAutoFormatter(min, max).formatter; + return { + start: ecDate.format(formatter, min), + end: ecDate.format(formatter, max) + }; + } + return { + start: '', + end: '' + }; + }, + __ondrift: function (shape, dx, dy) { + if (this.zoomOption.zoomLock) { + shape = this._fillerShae; + } + var detailSize = shape._type == 'filler' ? this._handleSize : 0; + if (this.zoomOption.orient == 'horizontal') { + if (shape.style.x + dx - detailSize <= this._location.x) { + shape.style.x = this._location.x + detailSize; + } else if (shape.style.x + dx + shape.style.width + detailSize >= this._location.x + this._location.width) { + shape.style.x = this._location.x + this._location.width - shape.style.width - detailSize; + } else { + shape.style.x += dx; + } + } else { + if (shape.style.y + dy - detailSize <= this._location.y) { + shape.style.y = this._location.y + detailSize; + } else if (shape.style.y + dy + shape.style.height + detailSize >= this._location.y + this._location.height) { + shape.style.y = this._location.y + this._location.height - shape.style.height - detailSize; + } else { + shape.style.y += dy; + } + } + if (shape._type == 'filler') { + this._syncHandleShape(); + } else { + this._syncFillerShape(); + } + if (this.zoomOption.realtime) { + this._syncData(); + } + if (this.zoomOption.showDetail) { + var detail = this._getDetail(); + this._startShape.style.text = this._startShape.highlightStyle.text = detail.start; + this._endShape.style.text = this._endShape.highlightStyle.text = detail.end; + this._startShape.style.textPosition = this._startShape.highlightStyle.textPosition; + this._endShape.style.textPosition = this._endShape.highlightStyle.textPosition; + } + return true; + }, + __ondragend: function () { + if (this.zoomOption.showDetail) { + this._startShape.style.text = this._endShape.style.text = '='; + this._startShape.style.textPosition = this._endShape.style.textPosition = 'inside'; + this.zr.modShape(this._startShape.id); + this.zr.modShape(this._endShape.id); + this.zr.refreshNextFrame(); + } + this.isDragend = true; + }, + ondragend: function (param, status) { + if (!this.isDragend || !param.target) { + return; + } + !this.zoomOption.realtime && this._syncData(); + status.dragOut = true; + status.dragIn = true; + if (!this._isSilence && !this.zoomOption.realtime) { + this.messageCenter.dispatch(ecConfig.EVENT.DATA_ZOOM, null, { zoom: this._zoom }, this.myChart); + } + status.needRefresh = false; + this.isDragend = false; + return; + }, + ondataZoom: function (param, status) { + status.needRefresh = true; + return; + }, + absoluteZoom: function (param) { + this._zoom.start = param.start; + this._zoom.end = param.end; + this._zoom.start2 = param.start2; + this._zoom.end2 = param.end2; + this._syncShape(); + this._syncData(true); + return; + }, + rectZoom: function (param) { + if (!param) { + this._zoom.start = this._zoom.start2 = 0; + this._zoom.end = this._zoom.end2 = 100; + this._syncShape(); + this._syncData(true); + return this._zoom; + } + var gridArea = this.component.grid.getArea(); + var rect = { + x: param.x, + y: param.y, + width: param.width, + height: param.height + }; + if (rect.width < 0) { + rect.x += rect.width; + rect.width = -rect.width; + } + if (rect.height < 0) { + rect.y += rect.height; + rect.height = -rect.height; + } + if (rect.x > gridArea.x + gridArea.width || rect.y > gridArea.y + gridArea.height) { + return false; + } + if (rect.x < gridArea.x) { + rect.x = gridArea.x; + } + if (rect.x + rect.width > gridArea.x + gridArea.width) { + rect.width = gridArea.x + gridArea.width - rect.x; + } + if (rect.y + rect.height > gridArea.y + gridArea.height) { + rect.height = gridArea.y + gridArea.height - rect.y; + } + var total; + var sdx = (rect.x - gridArea.x) / gridArea.width; + var edx = 1 - (rect.x + rect.width - gridArea.x) / gridArea.width; + var sdy = 1 - (rect.y + rect.height - gridArea.y) / gridArea.height; + var edy = (rect.y - gridArea.y) / gridArea.height; + if (this.zoomOption.orient == 'horizontal') { + total = this._zoom.end - this._zoom.start; + this._zoom.start += total * sdx; + this._zoom.end -= total * edx; + total = this._zoom.end2 - this._zoom.start2; + this._zoom.start2 += total * sdy; + this._zoom.end2 -= total * edy; + } else { + total = this._zoom.end - this._zoom.start; + this._zoom.start += total * sdy; + this._zoom.end -= total * edy; + total = this._zoom.end2 - this._zoom.start2; + this._zoom.start2 += total * sdx; + this._zoom.end2 -= total * edx; + } + this._syncShape(); + this._syncData(true); + return this._zoom; + }, + syncBackupData: function (curOption) { + var start; + var target = this._originalData['series']; + var curSeries = curOption.series; + var curData; + for (var i = 0, l = curSeries.length; i < l; i++) { + curData = curSeries[i].data || curSeries[i].eventList; + if (target[i]) { + start = Math.floor(this._zoom.start / 100 * target[i].length); + } else { + start = 0; + } + for (var j = 0, k = curData.length; j < k; j++) { + if (target[i]) { + target[i][j + start] = curData[j]; + } + } + } + }, + syncOption: function (magicOption) { + this.silence(true); + this.option = magicOption; + this.option.dataZoom = this.reformOption(this.option.dataZoom); + this.zoomOption = this.option.dataZoom; + if (!this.myChart.canvasSupported) { + this.zoomOption.realtime = false; + } + this.clear(); + this._location = this._getLocation(); + this._zoom = this._getZoom(); + this._backupData(); + if (this.option.dataZoom && this.option.dataZoom.show) { + this._buildShape(); + } + this._syncData(); + this.silence(false); + }, + silence: function (s) { + this._isSilence = s; + }, + getRealDataIndex: function (sIdx, dIdx) { + if (!this._originalData || this._zoom.start === 0 && this._zoom.end == 100) { + return dIdx; + } + var sreies = this._originalData.series; + if (sreies[sIdx]) { + return Math.floor(this._zoom.start / 100 * sreies[sIdx].length) + dIdx; + } + return -1; + }, + resize: function () { + this.clear(); + this._location = this._getLocation(); + this._zoom = this._getZoom(); + if (this.option.dataZoom.show) { + this._buildShape(); + } + } + }; + zrUtil.inherits(DataZoom, Base); + require('../component').define('dataZoom', DataZoom); + return DataZoom; +});define('echarts/component/categoryAxis', [ + 'require', + './base', + 'zrender/shape/Text', + 'zrender/shape/Line', + 'zrender/shape/Rectangle', + '../config', + 'zrender/tool/util', + 'zrender/tool/area', + '../component' +], function (require) { + var Base = require('./base'); + var TextShape = require('zrender/shape/Text'); + var LineShape = require('zrender/shape/Line'); + var RectangleShape = require('zrender/shape/Rectangle'); + var ecConfig = require('../config'); + ecConfig.categoryAxis = { + zlevel: 0, + z: 0, + show: true, + position: 'bottom', + name: '', + nameLocation: 'end', + nameTextStyle: {}, + boundaryGap: true, + axisLine: { + show: true, + onZero: true, + lineStyle: { + color: '#48b', + width: 2, + type: 'solid' + } + }, + axisTick: { + show: true, + interval: 'auto', + inside: false, + length: 5, + lineStyle: { + color: '#333', + width: 1 + } + }, + axisLabel: { + show: true, + interval: 'auto', + rotate: 0, + margin: 8, + textStyle: { color: '#333' } + }, + splitLine: { + show: true, + lineStyle: { + color: ['#ccc'], + width: 1, + type: 'solid' + } + }, + splitArea: { + show: false, + areaStyle: { + color: [ + 'rgba(250,250,250,0.3)', + 'rgba(200,200,200,0.3)' + ] + } + } + }; + var zrUtil = require('zrender/tool/util'); + var zrArea = require('zrender/tool/area'); + function CategoryAxis(ecTheme, messageCenter, zr, option, myChart, axisBase) { + if (option.data.length < 1) { + console.error('option.data.length < 1.'); + return; + } + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + this.grid = this.component.grid; + for (var method in axisBase) { + this[method] = axisBase[method]; + } + this.refresh(option); + } + CategoryAxis.prototype = { + type: ecConfig.COMPONENT_TYPE_AXIS_CATEGORY, + _getReformedLabel: function (idx) { + var data = this.getDataFromOption(this.option.data[idx]); + var formatter = this.option.data[idx].formatter || this.option.axisLabel.formatter; + if (formatter) { + if (typeof formatter == 'function') { + data = formatter.call(this.myChart, data); + } else if (typeof formatter == 'string') { + data = formatter.replace('{value}', data); + } + } + return data; + }, + _getInterval: function () { + var interval = this.option.axisLabel.interval; + if (interval == 'auto') { + var fontSize = this.option.axisLabel.textStyle.fontSize; + var data = this.option.data; + var dataLength = this.option.data.length; + if (this.isHorizontal()) { + if (dataLength > 3) { + var gap = this.getGap(); + var isEnough = false; + var labelSpace; + var labelSize; + var step = Math.floor(0.5 / gap); + step = step < 1 ? 1 : step; + interval = Math.floor(15 / gap); + while (!isEnough && interval < dataLength) { + interval += step; + isEnough = true; + labelSpace = Math.floor(gap * interval); + for (var i = Math.floor((dataLength - 1) / interval) * interval; i >= 0; i -= interval) { + if (this.option.axisLabel.rotate !== 0) { + labelSize = fontSize; + } else if (data[i].textStyle) { + labelSize = zrArea.getTextWidth(this._getReformedLabel(i), this.getFont(zrUtil.merge(data[i].textStyle, this.option.axisLabel.textStyle))); + } else { + var label = this._getReformedLabel(i) + ''; + var wLen = (label.match(/\w/g) || '').length; + var oLen = label.length - wLen; + labelSize = wLen * fontSize * 2 / 3 + oLen * fontSize; + } + if (labelSpace < labelSize) { + isEnough = false; + break; + } + } + } + } else { + interval = 1; + } + } else { + if (dataLength > 3) { + var gap = this.getGap(); + interval = Math.floor(11 / gap); + while (gap * interval - 6 < fontSize && interval < dataLength) { + interval++; + } + } else { + interval = 1; + } + } + } else { + interval = typeof interval == 'function' ? 1 : interval - 0 + 1; + } + return interval; + }, + _buildShape: function () { + this._interval = this._getInterval(); + if (!this.option.show) { + return; + } + this.option.splitArea.show && this._buildSplitArea(); + this.option.splitLine.show && this._buildSplitLine(); + this.option.axisLine.show && this._buildAxisLine(); + this.option.axisTick.show && this._buildAxisTick(); + this.option.axisLabel.show && this._buildAxisLabel(); + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + }, + _buildAxisTick: function () { + var axShape; + var data = this.option.data; + var dataLength = this.option.data.length; + var tickOption = this.option.axisTick; + var length = tickOption.length; + var color = tickOption.lineStyle.color; + var lineWidth = tickOption.lineStyle.width; + var intervalFunction = typeof tickOption.interval == 'function' ? tickOption.interval : tickOption.interval == 'auto' ? typeof this.option.axisLabel.interval == 'function' ? this.option.axisLabel.interval : false : false; + var interval = intervalFunction ? 1 : tickOption.interval == 'auto' ? this._interval : tickOption.interval - 0 + 1; + var onGap = tickOption.onGap; + var optGap = onGap ? this.getGap() / 2 : typeof onGap == 'undefined' ? this.option.boundaryGap ? this.getGap() / 2 : 0 : 0; + var startIndex = optGap > 0 ? -interval : 0; + if (this.isHorizontal()) { + var yPosition = this.option.position == 'bottom' ? tickOption.inside ? this.grid.getYend() - length - 1 : this.grid.getYend() + 1 : tickOption.inside ? this.grid.getY() + 1 : this.grid.getY() - length - 1; + var x; + for (var i = startIndex; i < dataLength; i += interval) { + if (intervalFunction && !intervalFunction(i, data[i])) { + continue; + } + x = this.subPixelOptimize(this.getCoordByIndex(i) + (i >= 0 ? optGap : 0), lineWidth); + axShape = { + _axisShape: 'axisTick', + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + xStart: x, + yStart: yPosition, + xEnd: x, + yEnd: yPosition + length, + strokeColor: color, + lineWidth: lineWidth + } + }; + this.shapeList.push(new LineShape(axShape)); + } + } else { + var xPosition = this.option.position == 'left' ? tickOption.inside ? this.grid.getX() + 1 : this.grid.getX() - length - 1 : tickOption.inside ? this.grid.getXend() - length - 1 : this.grid.getXend() + 1; + var y; + for (var i = startIndex; i < dataLength; i += interval) { + if (intervalFunction && !intervalFunction(i, data[i])) { + continue; + } + y = this.subPixelOptimize(this.getCoordByIndex(i) - (i >= 0 ? optGap : 0), lineWidth); + axShape = { + _axisShape: 'axisTick', + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + xStart: xPosition, + yStart: y, + xEnd: xPosition + length, + yEnd: y, + strokeColor: color, + lineWidth: lineWidth + } + }; + this.shapeList.push(new LineShape(axShape)); + } + } + }, + _buildAxisLabel: function () { + var axShape; + var data = this.option.data; + var dataLength = this.option.data.length; + var labelOption = this.option.axisLabel; + var rotate = labelOption.rotate; + var margin = labelOption.margin; + var clickable = labelOption.clickable; + var textStyle = labelOption.textStyle; + var intervalFunction = typeof labelOption.interval == 'function' ? labelOption.interval : false; + var dataTextStyle; + if (this.isHorizontal()) { + var yPosition; + var baseLine; + if (this.option.position == 'bottom') { + yPosition = this.grid.getYend() + margin; + baseLine = 'top'; + } else { + yPosition = this.grid.getY() - margin; + baseLine = 'bottom'; + } + for (var i = 0; i < dataLength; i += this._interval) { + if (intervalFunction && !intervalFunction(i, data[i]) || this._getReformedLabel(i) === '') { + continue; + } + dataTextStyle = zrUtil.merge(data[i].textStyle || {}, textStyle); + axShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase() + 3, + hoverable: false, + style: { + x: this.getCoordByIndex(i), + y: yPosition, + color: dataTextStyle.color, + text: this._getReformedLabel(i), + textFont: this.getFont(dataTextStyle), + textAlign: dataTextStyle.align || 'center', + textBaseline: dataTextStyle.baseline || baseLine + } + }; + if (rotate) { + axShape.style.textAlign = rotate > 0 ? this.option.position == 'bottom' ? 'right' : 'left' : this.option.position == 'bottom' ? 'left' : 'right'; + axShape.rotation = [ + rotate * Math.PI / 180, + axShape.style.x, + axShape.style.y + ]; + } + this.shapeList.push(new TextShape(this._axisLabelClickable(clickable, axShape))); + } + } else { + var xPosition; + var align; + if (this.option.position == 'left') { + xPosition = this.grid.getX() - margin; + align = 'right'; + } else { + xPosition = this.grid.getXend() + margin; + align = 'left'; + } + for (var i = 0; i < dataLength; i += this._interval) { + if (intervalFunction && !intervalFunction(i, data[i]) || this._getReformedLabel(i) === '') { + continue; + } + dataTextStyle = zrUtil.merge(data[i].textStyle || {}, textStyle); + axShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase() + 3, + hoverable: false, + style: { + x: xPosition, + y: this.getCoordByIndex(i), + color: dataTextStyle.color, + text: this._getReformedLabel(i), + textFont: this.getFont(dataTextStyle), + textAlign: dataTextStyle.align || align, + textBaseline: dataTextStyle.baseline || i === 0 && this.option.name !== '' ? 'bottom' : i == dataLength - 1 && this.option.name !== '' ? 'top' : 'middle' + } + }; + if (rotate) { + axShape.rotation = [ + rotate * Math.PI / 180, + axShape.style.x, + axShape.style.y + ]; + } + this.shapeList.push(new TextShape(this._axisLabelClickable(clickable, axShape))); + } + } + }, + _buildSplitLine: function () { + var axShape; + var data = this.option.data; + var dataLength = this.option.data.length; + var sLineOption = this.option.splitLine; + var lineType = sLineOption.lineStyle.type; + var lineWidth = sLineOption.lineStyle.width; + var color = sLineOption.lineStyle.color; + color = color instanceof Array ? color : [color]; + var colorLength = color.length; + var intervalFunction = typeof this.option.axisLabel.interval == 'function' ? this.option.axisLabel.interval : false; + var onGap = sLineOption.onGap; + var optGap = onGap ? this.getGap() / 2 : typeof onGap == 'undefined' ? this.option.boundaryGap ? this.getGap() / 2 : 0 : 0; + dataLength -= onGap || typeof onGap == 'undefined' && this.option.boundaryGap ? 1 : 0; + if (this.isHorizontal()) { + var sy = this.grid.getY(); + var ey = this.grid.getYend(); + var x; + for (var i = 0; i < dataLength; i += this._interval) { + if (intervalFunction && !intervalFunction(i, data[i])) { + continue; + } + x = this.subPixelOptimize(this.getCoordByIndex(i) + optGap, lineWidth); + axShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + xStart: x, + yStart: sy, + xEnd: x, + yEnd: ey, + strokeColor: color[i / this._interval % colorLength], + lineType: lineType, + lineWidth: lineWidth + } + }; + this.shapeList.push(new LineShape(axShape)); + } + } else { + var sx = this.grid.getX(); + var ex = this.grid.getXend(); + var y; + for (var i = 0; i < dataLength; i += this._interval) { + if (intervalFunction && !intervalFunction(i, data[i])) { + continue; + } + y = this.subPixelOptimize(this.getCoordByIndex(i) - optGap, lineWidth); + axShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + xStart: sx, + yStart: y, + xEnd: ex, + yEnd: y, + strokeColor: color[i / this._interval % colorLength], + lineType: lineType, + lineWidth: lineWidth + } + }; + this.shapeList.push(new LineShape(axShape)); + } + } + }, + _buildSplitArea: function () { + var axShape; + var data = this.option.data; + var sAreaOption = this.option.splitArea; + var color = sAreaOption.areaStyle.color; + if (!(color instanceof Array)) { + axShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: this.grid.getX(), + y: this.grid.getY(), + width: this.grid.getWidth(), + height: this.grid.getHeight(), + color: color + } + }; + this.shapeList.push(new RectangleShape(axShape)); + } else { + var colorLength = color.length; + var dataLength = this.option.data.length; + var intervalFunction = typeof this.option.axisLabel.interval == 'function' ? this.option.axisLabel.interval : false; + var onGap = sAreaOption.onGap; + var optGap = onGap ? this.getGap() / 2 : typeof onGap == 'undefined' ? this.option.boundaryGap ? this.getGap() / 2 : 0 : 0; + if (this.isHorizontal()) { + var y = this.grid.getY(); + var height = this.grid.getHeight(); + var lastX = this.grid.getX(); + var curX; + for (var i = 0; i <= dataLength; i += this._interval) { + if (intervalFunction && !intervalFunction(i, data[i]) && i < dataLength) { + continue; + } + curX = i < dataLength ? this.getCoordByIndex(i) + optGap : this.grid.getXend(); + axShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: lastX, + y: y, + width: curX - lastX, + height: height, + color: color[i / this._interval % colorLength] + } + }; + this.shapeList.push(new RectangleShape(axShape)); + lastX = curX; + } + } else { + var x = this.grid.getX(); + var width = this.grid.getWidth(); + var lastYend = this.grid.getYend(); + var curY; + for (var i = 0; i <= dataLength; i += this._interval) { + if (intervalFunction && !intervalFunction(i, data[i]) && i < dataLength) { + continue; + } + curY = i < dataLength ? this.getCoordByIndex(i) - optGap : this.grid.getY(); + axShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: x, + y: curY, + width: width, + height: lastYend - curY, + color: color[i / this._interval % colorLength] + } + }; + this.shapeList.push(new RectangleShape(axShape)); + lastYend = curY; + } + } + } + }, + refresh: function (newOption) { + if (newOption) { + this.option = this.reformOption(newOption); + this.option.axisLabel.textStyle = this.getTextStyle(this.option.axisLabel.textStyle); + } + this.clear(); + this._buildShape(); + }, + getGap: function () { + var dataLength = this.option.data.length; + var total = this.isHorizontal() ? this.grid.getWidth() : this.grid.getHeight(); + if (this.option.boundaryGap) { + return total / dataLength; + } else { + return total / (dataLength > 1 ? dataLength - 1 : 1); + } + }, + getCoord: function (value) { + var data = this.option.data; + var dataLength = data.length; + var gap = this.getGap(); + var position = this.option.boundaryGap ? gap / 2 : 0; + for (var i = 0; i < dataLength; i++) { + if (this.getDataFromOption(data[i]) == value) { + if (this.isHorizontal()) { + position = this.grid.getX() + position; + } else { + position = this.grid.getYend() - position; + } + return position; + } + position += gap; + } + }, + getCoordByIndex: function (dataIndex) { + if (dataIndex < 0) { + if (this.isHorizontal()) { + return this.grid.getX(); + } else { + return this.grid.getYend(); + } + } else if (dataIndex > this.option.data.length - 1) { + if (this.isHorizontal()) { + return this.grid.getXend(); + } else { + return this.grid.getY(); + } + } else { + var gap = this.getGap(); + var position = this.option.boundaryGap ? gap / 2 : 0; + position += dataIndex * gap; + if (this.isHorizontal()) { + position = this.grid.getX() + position; + } else { + position = this.grid.getYend() - position; + } + return position; + } + }, + getNameByIndex: function (dataIndex) { + return this.getDataFromOption(this.option.data[dataIndex]); + }, + getIndexByName: function (name) { + var data = this.option.data; + var dataLength = data.length; + for (var i = 0; i < dataLength; i++) { + if (this.getDataFromOption(data[i]) == name) { + return i; + } + } + return -1; + }, + getValueFromCoord: function () { + return ''; + }, + isMainAxis: function (dataIndex) { + return dataIndex % this._interval === 0; + } + }; + zrUtil.inherits(CategoryAxis, Base); + require('../component').define('categoryAxis', CategoryAxis); + return CategoryAxis; +});define('echarts/component/valueAxis', [ + 'require', + './base', + 'zrender/shape/Text', + 'zrender/shape/Line', + 'zrender/shape/Rectangle', + '../config', + '../util/date', + 'zrender/tool/util', + '../util/smartSteps', + '../util/accMath', + '../component' +], function (require) { + var Base = require('./base'); + var TextShape = require('zrender/shape/Text'); + var LineShape = require('zrender/shape/Line'); + var RectangleShape = require('zrender/shape/Rectangle'); + var ecConfig = require('../config'); + ecConfig.valueAxis = { + zlevel: 0, + z: 0, + show: true, + position: 'left', + name: '', + nameLocation: 'end', + nameTextStyle: {}, + boundaryGap: [ + 0, + 0 + ], + axisLine: { + show: true, + onZero: true, + lineStyle: { + color: '#48b', + width: 2, + type: 'solid' + } + }, + axisTick: { + show: false, + inside: false, + length: 5, + lineStyle: { + color: '#333', + width: 1 + } + }, + axisLabel: { + show: true, + rotate: 0, + margin: 8, + textStyle: { color: '#333' } + }, + splitLine: { + show: true, + lineStyle: { + color: ['#ccc'], + width: 1, + type: 'solid' + } + }, + splitArea: { + show: false, + areaStyle: { + color: [ + 'rgba(250,250,250,0.3)', + 'rgba(200,200,200,0.3)' + ] + } + } + }; + var ecDate = require('../util/date'); + var zrUtil = require('zrender/tool/util'); + function ValueAxis(ecTheme, messageCenter, zr, option, myChart, axisBase, series) { + if (!series || series.length === 0) { + console.err('option.series.length == 0.'); + return; + } + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + this.series = series; + this.grid = this.component.grid; + for (var method in axisBase) { + this[method] = axisBase[method]; + } + this.refresh(option, series); + } + ValueAxis.prototype = { + type: ecConfig.COMPONENT_TYPE_AXIS_VALUE, + _buildShape: function () { + this._hasData = false; + this._calculateValue(); + if (!this._hasData || !this.option.show) { + return; + } + this.option.splitArea.show && this._buildSplitArea(); + this.option.splitLine.show && this._buildSplitLine(); + this.option.axisLine.show && this._buildAxisLine(); + this.option.axisTick.show && this._buildAxisTick(); + this.option.axisLabel.show && this._buildAxisLabel(); + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + }, + _buildAxisTick: function () { + var axShape; + var data = this._valueList; + var dataLength = this._valueList.length; + var tickOption = this.option.axisTick; + var length = tickOption.length; + var color = tickOption.lineStyle.color; + var lineWidth = tickOption.lineStyle.width; + if (this.isHorizontal()) { + var yPosition = this.option.position === 'bottom' ? tickOption.inside ? this.grid.getYend() - length - 1 : this.grid.getYend() + 1 : tickOption.inside ? this.grid.getY() + 1 : this.grid.getY() - length - 1; + var x; + for (var i = 0; i < dataLength; i++) { + x = this.subPixelOptimize(this.getCoord(data[i]), lineWidth); + axShape = { + _axisShape: 'axisTick', + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + xStart: x, + yStart: yPosition, + xEnd: x, + yEnd: yPosition + length, + strokeColor: color, + lineWidth: lineWidth + } + }; + this.shapeList.push(new LineShape(axShape)); + } + } else { + var xPosition = this.option.position === 'left' ? tickOption.inside ? this.grid.getX() + 1 : this.grid.getX() - length - 1 : tickOption.inside ? this.grid.getXend() - length - 1 : this.grid.getXend() + 1; + var y; + for (var i = 0; i < dataLength; i++) { + y = this.subPixelOptimize(this.getCoord(data[i]), lineWidth); + axShape = { + _axisShape: 'axisTick', + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + xStart: xPosition, + yStart: y, + xEnd: xPosition + length, + yEnd: y, + strokeColor: color, + lineWidth: lineWidth + } + }; + this.shapeList.push(new LineShape(axShape)); + } + } + }, + _buildAxisLabel: function () { + var axShape; + var data = this._valueList; + var dataLength = this._valueList.length; + var rotate = this.option.axisLabel.rotate; + var margin = this.option.axisLabel.margin; + var clickable = this.option.axisLabel.clickable; + var textStyle = this.option.axisLabel.textStyle; + if (this.isHorizontal()) { + var yPosition; + var baseLine; + if (this.option.position === 'bottom') { + yPosition = this.grid.getYend() + margin; + baseLine = 'top'; + } else { + yPosition = this.grid.getY() - margin; + baseLine = 'bottom'; + } + for (var i = 0; i < dataLength; i++) { + axShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase() + 3, + hoverable: false, + style: { + x: this.getCoord(data[i]), + y: yPosition, + color: typeof textStyle.color === 'function' ? textStyle.color(data[i]) : textStyle.color, + text: this._valueLabel[i], + textFont: this.getFont(textStyle), + textAlign: textStyle.align || 'center', + textBaseline: textStyle.baseline || baseLine + } + }; + if (rotate) { + axShape.style.textAlign = rotate > 0 ? this.option.position === 'bottom' ? 'right' : 'left' : this.option.position === 'bottom' ? 'left' : 'right'; + axShape.rotation = [ + rotate * Math.PI / 180, + axShape.style.x, + axShape.style.y + ]; + } + this.shapeList.push(new TextShape(this._axisLabelClickable(clickable, axShape))); + } + } else { + var xPosition; + var align; + if (this.option.position === 'left') { + xPosition = this.grid.getX() - margin; + align = 'right'; + } else { + xPosition = this.grid.getXend() + margin; + align = 'left'; + } + for (var i = 0; i < dataLength; i++) { + axShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase() + 3, + hoverable: false, + style: { + x: xPosition, + y: this.getCoord(data[i]), + color: typeof textStyle.color === 'function' ? textStyle.color(data[i]) : textStyle.color, + text: this._valueLabel[i], + textFont: this.getFont(textStyle), + textAlign: textStyle.align || align, + textBaseline: textStyle.baseline || (i === 0 && this.option.name !== '' ? 'bottom' : i === dataLength - 1 && this.option.name !== '' ? 'top' : 'middle') + } + }; + if (rotate) { + axShape.rotation = [ + rotate * Math.PI / 180, + axShape.style.x, + axShape.style.y + ]; + } + this.shapeList.push(new TextShape(this._axisLabelClickable(clickable, axShape))); + } + } + }, + _buildSplitLine: function () { + var axShape; + var data = this._valueList; + var dataLength = this._valueList.length; + var sLineOption = this.option.splitLine; + var lineType = sLineOption.lineStyle.type; + var lineWidth = sLineOption.lineStyle.width; + var color = sLineOption.lineStyle.color; + color = color instanceof Array ? color : [color]; + var colorLength = color.length; + if (this.isHorizontal()) { + var sy = this.grid.getY(); + var ey = this.grid.getYend(); + var x; + for (var i = 0; i < dataLength; i++) { + x = this.subPixelOptimize(this.getCoord(data[i]), lineWidth); + axShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + xStart: x, + yStart: sy, + xEnd: x, + yEnd: ey, + strokeColor: color[i % colorLength], + lineType: lineType, + lineWidth: lineWidth + } + }; + this.shapeList.push(new LineShape(axShape)); + } + } else { + var sx = this.grid.getX(); + var ex = this.grid.getXend(); + var y; + for (var i = 0; i < dataLength; i++) { + y = this.subPixelOptimize(this.getCoord(data[i]), lineWidth); + axShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + xStart: sx, + yStart: y, + xEnd: ex, + yEnd: y, + strokeColor: color[i % colorLength], + lineType: lineType, + lineWidth: lineWidth + } + }; + this.shapeList.push(new LineShape(axShape)); + } + } + }, + _buildSplitArea: function () { + var axShape; + var color = this.option.splitArea.areaStyle.color; + if (!(color instanceof Array)) { + axShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: this.grid.getX(), + y: this.grid.getY(), + width: this.grid.getWidth(), + height: this.grid.getHeight(), + color: color + } + }; + this.shapeList.push(new RectangleShape(axShape)); + } else { + var colorLength = color.length; + var data = this._valueList; + var dataLength = this._valueList.length; + if (this.isHorizontal()) { + var y = this.grid.getY(); + var height = this.grid.getHeight(); + var lastX = this.grid.getX(); + var curX; + for (var i = 0; i <= dataLength; i++) { + curX = i < dataLength ? this.getCoord(data[i]) : this.grid.getXend(); + axShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: lastX, + y: y, + width: curX - lastX, + height: height, + color: color[i % colorLength] + } + }; + this.shapeList.push(new RectangleShape(axShape)); + lastX = curX; + } + } else { + var x = this.grid.getX(); + var width = this.grid.getWidth(); + var lastYend = this.grid.getYend(); + var curY; + for (var i = 0; i <= dataLength; i++) { + curY = i < dataLength ? this.getCoord(data[i]) : this.grid.getY(); + axShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: x, + y: curY, + width: width, + height: lastYend - curY, + color: color[i % colorLength] + } + }; + this.shapeList.push(new RectangleShape(axShape)); + lastYend = curY; + } + } + } + }, + _calculateValue: function () { + if (isNaN(this.option.min - 0) || isNaN(this.option.max - 0)) { + var data = {}; + var xIdx; + var yIdx; + var legend = this.component.legend; + for (var i = 0, l = this.series.length; i < l; i++) { + if (this.series[i].type != ecConfig.CHART_TYPE_LINE && this.series[i].type != ecConfig.CHART_TYPE_BAR && this.series[i].type != ecConfig.CHART_TYPE_SCATTER && this.series[i].type != ecConfig.CHART_TYPE_K && this.series[i].type != ecConfig.CHART_TYPE_EVENTRIVER) { + continue; + } + if (legend && !legend.isSelected(this.series[i].name)) { + continue; + } + xIdx = this.series[i].xAxisIndex || 0; + yIdx = this.series[i].yAxisIndex || 0; + if (this.option.xAxisIndex != xIdx && this.option.yAxisIndex != yIdx) { + continue; + } + this._calculSum(data, i); + } + var oriData; + for (var i in data) { + oriData = data[i]; + for (var j = 0, k = oriData.length; j < k; j++) { + if (!isNaN(oriData[j])) { + this._hasData = true; + this._min = oriData[j]; + this._max = oriData[j]; + break; + } + } + if (this._hasData) { + break; + } + } + for (var i in data) { + oriData = data[i]; + for (var j = 0, k = oriData.length; j < k; j++) { + if (!isNaN(oriData[j])) { + this._min = Math.min(this._min, oriData[j]); + this._max = Math.max(this._max, oriData[j]); + } + } + } + var gap = Math.abs(this._max - this._min); + this._min = isNaN(this.option.min - 0) ? this._min - Math.abs(gap * this.option.boundaryGap[0]) : this.option.min - 0; + this._max = isNaN(this.option.max - 0) ? this._max + Math.abs(gap * this.option.boundaryGap[1]) : this.option.max - 0; + if (this._min === this._max) { + if (this._max === 0) { + this._max = 1; + } else if (this._max > 0) { + this._min = this._max / this.option.splitNumber != null ? this.option.splitNumber : 5; + } else { + this._max = this._max / this.option.splitNumber != null ? this.option.splitNumber : 5; + } + } + this.option.type != 'time' ? this._reformValue(this.option.scale) : this._reformTimeValue(); + } else { + this._hasData = true; + this._min = this.option.min - 0; + this._max = this.option.max - 0; + this.option.type != 'time' ? this._customerValue() : this._reformTimeValue(); + } + }, + _calculSum: function (data, i) { + var key = this.series[i].name || 'kener'; + var value; + var oriData; + if (!this.series[i].stack) { + data[key] = data[key] || []; + if (this.series[i].type != ecConfig.CHART_TYPE_EVENTRIVER) { + oriData = this.series[i].data; + for (var j = 0, k = oriData.length; j < k; j++) { + value = this.getDataFromOption(oriData[j]); + if (this.series[i].type === ecConfig.CHART_TYPE_K) { + data[key].push(value[0]); + data[key].push(value[1]); + data[key].push(value[2]); + data[key].push(value[3]); + } else if (value instanceof Array) { + if (this.option.xAxisIndex != -1) { + data[key].push(this.option.type != 'time' ? value[0] : ecDate.getNewDate(value[0])); + } + if (this.option.yAxisIndex != -1) { + data[key].push(this.option.type != 'time' ? value[1] : ecDate.getNewDate(value[1])); + } + } else { + data[key].push(value); + } + } + } else { + oriData = this.series[i].eventList; + for (var j = 0, k = oriData.length; j < k; j++) { + var evolution = oriData[j].evolution; + for (var m = 0, n = evolution.length; m < n; m++) { + data[key].push(ecDate.getNewDate(evolution[m].time)); + } + } + } + } else { + var keyP = '__Magic_Key_Positive__' + this.series[i].stack; + var keyN = '__Magic_Key_Negative__' + this.series[i].stack; + data[keyP] = data[keyP] || []; + data[keyN] = data[keyN] || []; + data[key] = data[key] || []; + oriData = this.series[i].data; + for (var j = 0, k = oriData.length; j < k; j++) { + value = this.getDataFromOption(oriData[j]); + if (value === '-') { + continue; + } + value = value - 0; + if (value >= 0) { + if (data[keyP][j] != null) { + data[keyP][j] += value; + } else { + data[keyP][j] = value; + } + } else { + if (data[keyN][j] != null) { + data[keyN][j] += value; + } else { + data[keyN][j] = value; + } + } + if (this.option.scale) { + data[key].push(value); + } + } + } + }, + _reformValue: function (scale) { + var smartSteps = require('../util/smartSteps'); + var splitNumber = this.option.splitNumber; + if (!scale && this._min >= 0 && this._max >= 0) { + this._min = 0; + } + if (!scale && this._min <= 0 && this._max <= 0) { + this._max = 0; + } + var stepOpt = smartSteps(this._min, this._max, splitNumber); + splitNumber = splitNumber != null ? splitNumber : stepOpt.secs; + this._min = stepOpt.min; + this._max = stepOpt.max; + this._valueList = stepOpt.pnts; + this._reformLabelData(); + }, + _reformTimeValue: function () { + var splitNumber = this.option.splitNumber != null ? this.option.splitNumber : 5; + var curValue = ecDate.getAutoFormatter(this._min, this._max, splitNumber); + var formatter = curValue.formatter; + var gapValue = curValue.gapValue; + this._valueList = [ecDate.getNewDate(this._min)]; + var startGap; + switch (formatter) { + case 'week': + startGap = ecDate.nextMonday(this._min); + break; + case 'month': + startGap = ecDate.nextNthOnMonth(this._min, 1); + break; + case 'quarter': + startGap = ecDate.nextNthOnQuarterYear(this._min, 1); + break; + case 'half-year': + startGap = ecDate.nextNthOnHalfYear(this._min, 1); + break; + case 'year': + startGap = ecDate.nextNthOnYear(this._min, 1); + break; + default: + if (gapValue <= 3600000 * 2) { + startGap = (Math.floor(this._min / gapValue) + 1) * gapValue; + } else { + startGap = ecDate.getNewDate(this._min - -gapValue); + startGap.setHours(Math.round(startGap.getHours() / 6) * 6); + startGap.setMinutes(0); + startGap.setSeconds(0); + } + break; + } + if (startGap - this._min < gapValue / 2) { + startGap -= -gapValue; + } + curValue = ecDate.getNewDate(startGap); + splitNumber *= 1.5; + while (splitNumber-- >= 0) { + if (formatter == 'month' || formatter == 'quarter' || formatter == 'half-year' || formatter == 'year') { + curValue.setDate(1); + } + if (this._max - curValue < gapValue / 2) { + break; + } + this._valueList.push(curValue); + curValue = ecDate.getNewDate(curValue - -gapValue); + } + this._valueList.push(ecDate.getNewDate(this._max)); + this._reformLabelData(formatter); + }, + _customerValue: function () { + var accMath = require('../util/accMath'); + var splitNumber = this.option.splitNumber != null ? this.option.splitNumber : 5; + var splitGap = (this._max - this._min) / splitNumber; + this._valueList = []; + for (var i = 0; i <= splitNumber; i++) { + this._valueList.push(accMath.accAdd(this._min, accMath.accMul(splitGap, i))); + } + this._reformLabelData(); + }, + _reformLabelData: function (timeFormatter) { + this._valueLabel = []; + var formatter = this.option.axisLabel.formatter; + if (formatter) { + for (var i = 0, l = this._valueList.length; i < l; i++) { + if (typeof formatter === 'function') { + this._valueLabel.push(timeFormatter ? formatter.call(this.myChart, this._valueList[i], timeFormatter) : formatter.call(this.myChart, this._valueList[i])); + } else if (typeof formatter === 'string') { + this._valueLabel.push(timeFormatter ? ecDate.format(formatter, this._valueList[i]) : formatter.replace('{value}', this._valueList[i])); + } + } + } else if (timeFormatter) { + for (var i = 0, l = this._valueList.length; i < l; i++) { + this._valueLabel.push(ecDate.format(timeFormatter, this._valueList[i])); + } + } else { + for (var i = 0, l = this._valueList.length; i < l; i++) { + this._valueLabel.push(this.numAddCommas(this._valueList[i])); + } + } + }, + getExtremum: function () { + this._calculateValue(); + return { + min: this._min, + max: this._max + }; + }, + refresh: function (newOption, newSeries) { + if (newOption) { + this.option = this.reformOption(newOption); + this.option.axisLabel.textStyle = zrUtil.merge(this.option.axisLabel.textStyle || {}, this.ecTheme.textStyle); + this.series = newSeries; + } + if (this.zr) { + this.clear(); + this._buildShape(); + } + }, + getCoord: function (value) { + value = value < this._min ? this._min : value; + value = value > this._max ? this._max : value; + var result; + if (!this.isHorizontal()) { + result = this.grid.getYend() - (value - this._min) / (this._max - this._min) * this.grid.getHeight(); + } else { + result = this.grid.getX() + (value - this._min) / (this._max - this._min) * this.grid.getWidth(); + } + return result; + }, + getCoordSize: function (value) { + if (!this.isHorizontal()) { + return Math.abs(value / (this._max - this._min) * this.grid.getHeight()); + } else { + return Math.abs(value / (this._max - this._min) * this.grid.getWidth()); + } + }, + getValueFromCoord: function (coord) { + var result; + if (!this.isHorizontal()) { + coord = coord < this.grid.getY() ? this.grid.getY() : coord; + coord = coord > this.grid.getYend() ? this.grid.getYend() : coord; + result = this._max - (coord - this.grid.getY()) / this.grid.getHeight() * (this._max - this._min); + } else { + coord = coord < this.grid.getX() ? this.grid.getX() : coord; + coord = coord > this.grid.getXend() ? this.grid.getXend() : coord; + result = this._min + (coord - this.grid.getX()) / this.grid.getWidth() * (this._max - this._min); + } + return result.toFixed(2) - 0; + }, + isMaindAxis: function (value) { + for (var i = 0, l = this._valueList.length; i < l; i++) { + if (this._valueList[i] === value) { + return true; + } + } + return false; + } + }; + zrUtil.inherits(ValueAxis, Base); + require('../component').define('valueAxis', ValueAxis); + return ValueAxis; +});define('echarts/util/date', [], function () { + var _timeGap = [ + { + formatter: 'hh : mm : ss', + value: 1000 + }, + { + formatter: 'hh : mm : ss', + value: 1000 * 5 + }, + { + formatter: 'hh : mm : ss', + value: 1000 * 10 + }, + { + formatter: 'hh : mm : ss', + value: 1000 * 15 + }, + { + formatter: 'hh : mm : ss', + value: 1000 * 30 + }, + { + formatter: 'hh : mm\nMM - dd', + value: 60000 + }, + { + formatter: 'hh : mm\nMM - dd', + value: 60000 * 5 + }, + { + formatter: 'hh : mm\nMM - dd', + value: 60000 * 10 + }, + { + formatter: 'hh : mm\nMM - dd', + value: 60000 * 15 + }, + { + formatter: 'hh : mm\nMM - dd', + value: 60000 * 30 + }, + { + formatter: 'hh : mm\nMM - dd', + value: 3600000 + }, + { + formatter: 'hh : mm\nMM - dd', + value: 3600000 * 2 + }, + { + formatter: 'hh : mm\nMM - dd', + value: 3600000 * 6 + }, + { + formatter: 'hh : mm\nMM - dd', + value: 3600000 * 12 + }, + { + formatter: 'MM - dd\nyyyy', + value: 3600000 * 24 + }, + { + formatter: 'week', + value: 3600000 * 24 * 7 + }, + { + formatter: 'month', + value: 3600000 * 24 * 31 + }, + { + formatter: 'quarter', + value: 3600000 * 24 * 380 / 4 + }, + { + formatter: 'half-year', + value: 3600000 * 24 * 380 / 2 + }, + { + formatter: 'year', + value: 3600000 * 24 * 380 + } + ]; + function getAutoFormatter(min, max, splitNumber) { + splitNumber = splitNumber > 1 ? splitNumber : 2; + var curValue; + var totalGap; + var formatter; + var gapValue; + for (var i = 0, l = _timeGap.length; i < l; i++) { + curValue = _timeGap[i].value; + totalGap = Math.ceil(max / curValue) * curValue - Math.floor(min / curValue) * curValue; + if (Math.round(totalGap / curValue) <= splitNumber * 1.2) { + formatter = _timeGap[i].formatter; + gapValue = _timeGap[i].value; + break; + } + } + if (formatter == null) { + formatter = 'year'; + curValue = 3600000 * 24 * 367; + totalGap = Math.ceil(max / curValue) * curValue - Math.floor(min / curValue) * curValue; + gapValue = Math.round(totalGap / (splitNumber - 1) / curValue) * curValue; + } + return { + formatter: formatter, + gapValue: gapValue + }; + } + function s2d(v) { + return v < 10 ? '0' + v : v; + } + function format(formatter, value) { + if (formatter == 'week' || formatter == 'month' || formatter == 'quarter' || formatter == 'half-year' || formatter == 'year') { + formatter = 'MM - dd\nyyyy'; + } + var date = getNewDate(value); + var y = date.getFullYear(); + var M = date.getMonth() + 1; + var d = date.getDate(); + var h = date.getHours(); + var m = date.getMinutes(); + var s = date.getSeconds(); + formatter = formatter.replace('MM', s2d(M)); + formatter = formatter.toLowerCase(); + formatter = formatter.replace('yyyy', y); + formatter = formatter.replace('yy', y % 100); + formatter = formatter.replace('dd', s2d(d)); + formatter = formatter.replace('d', d); + formatter = formatter.replace('hh', s2d(h)); + formatter = formatter.replace('h', h); + formatter = formatter.replace('mm', s2d(m)); + formatter = formatter.replace('m', m); + formatter = formatter.replace('ss', s2d(s)); + formatter = formatter.replace('s', s); + return formatter; + } + function nextMonday(value) { + value = getNewDate(value); + value.setDate(value.getDate() + 8 - value.getDay()); + return value; + } + function nextNthPerNmonth(value, nth, nmon) { + value = getNewDate(value); + value.setMonth(Math.ceil((value.getMonth() + 1) / nmon) * nmon); + value.setDate(nth); + return value; + } + function nextNthOnMonth(value, nth) { + return nextNthPerNmonth(value, nth, 1); + } + function nextNthOnQuarterYear(value, nth) { + return nextNthPerNmonth(value, nth, 3); + } + function nextNthOnHalfYear(value, nth) { + return nextNthPerNmonth(value, nth, 6); + } + function nextNthOnYear(value, nth) { + return nextNthPerNmonth(value, nth, 12); + } + function getNewDate(value) { + return value instanceof Date ? value : new Date(typeof value == 'string' ? value.replace(/-/g, '/') : value); + } + return { + getAutoFormatter: getAutoFormatter, + getNewDate: getNewDate, + format: format, + nextMonday: nextMonday, + nextNthPerNmonth: nextNthPerNmonth, + nextNthOnMonth: nextNthOnMonth, + nextNthOnQuarterYear: nextNthOnQuarterYear, + nextNthOnHalfYear: nextNthOnHalfYear, + nextNthOnYear: nextNthOnYear + }; +});define('echarts/util/smartSteps', [], function () { + var mySteps = [ + 10, + 20, + 25, + 50 + ]; + var mySections = [ + 4, + 5, + 6 + ]; + var custOpts; + var custSteps; + var custSecs; + var minLocked; + var maxLocked; + var MT = Math; + var MATH_ROUND = MT.round; + var MATH_FLOOR = MT.floor; + var MATH_CEIL = MT.ceil; + var MATH_ABS = MT.abs; + function MATH_LOG(n) { + return MT.log(MATH_ABS(n)) / MT.LN10; + } + function MATH_POW(n) { + return MT.pow(10, n); + } + function MATH_ISINT(n) { + return n === MATH_FLOOR(n); + } + function smartSteps(min, max, section, opts) { + custOpts = opts || {}; + custSteps = custOpts.steps || mySteps; + custSecs = custOpts.secs || mySections; + section = MATH_ROUND(+section || 0) % 99; + min = +min || 0; + max = +max || 0; + minLocked = maxLocked = 0; + if ('min' in custOpts) { + min = +custOpts.min || 0; + minLocked = 1; + } + if ('max' in custOpts) { + max = +custOpts.max || 0; + maxLocked = 1; + } + if (min > max) { + max = [ + min, + min = max + ][0]; + } + var span = max - min; + if (minLocked && maxLocked) { + return bothLocked(min, max, section); + } + if (span < (section || 5)) { + if (MATH_ISINT(min) && MATH_ISINT(max)) { + return forInteger(min, max, section); + } else if (span === 0) { + return forSpan0(min, max, section); + } + } + return coreCalc(min, max, section); + } + function makeResult(newMin, newMax, section, expon) { + expon = expon || 0; + var expStep = expNum((newMax - newMin) / section, -1); + var expMin = expNum(newMin, -1, 1); + var expMax = expNum(newMax, -1); + var minExp = MT.min(expStep.e, expMin.e, expMax.e); + if (expMin.c === 0) { + minExp = MT.min(expStep.e, expMax.e); + } else if (expMax.c === 0) { + minExp = MT.min(expStep.e, expMin.e); + } + expFixTo(expStep, { + c: 0, + e: minExp + }); + expFixTo(expMin, expStep, 1); + expFixTo(expMax, expStep); + expon += minExp; + newMin = expMin.c; + newMax = expMax.c; + var step = (newMax - newMin) / section; + var zoom = MATH_POW(expon); + var fixTo = 0; + var points = []; + for (var i = section + 1; i--;) { + points[i] = (newMin + step * i) * zoom; + } + if (expon < 0) { + fixTo = decimals(zoom); + step = +(step * zoom).toFixed(fixTo); + newMin = +(newMin * zoom).toFixed(fixTo); + newMax = +(newMax * zoom).toFixed(fixTo); + for (var i = points.length; i--;) { + points[i] = points[i].toFixed(fixTo); + +points[i] === 0 && (points[i] = '0'); + } + } else { + newMin *= zoom; + newMax *= zoom; + step *= zoom; + } + custSecs = 0; + custSteps = 0; + custOpts = 0; + return { + min: newMin, + max: newMax, + secs: section, + step: step, + fix: fixTo, + exp: expon, + pnts: points + }; + } + function expNum(num, digit, byFloor) { + digit = MATH_ROUND(digit % 10) || 2; + if (digit < 0) { + if (MATH_ISINT(num)) { + digit = ('' + MATH_ABS(num)).replace(/0+$/, '').length || 1; + } else { + num = num.toFixed(15).replace(/0+$/, ''); + digit = num.replace('.', '').replace(/^[-0]+/, '').length; + num = +num; + } + } + var expon = MATH_FLOOR(MATH_LOG(num)) - digit + 1; + var cNum = +(num * MATH_POW(-expon)).toFixed(15) || 0; + cNum = byFloor ? MATH_FLOOR(cNum) : MATH_CEIL(cNum); + !cNum && (expon = 0); + if (('' + MATH_ABS(cNum)).length > digit) { + expon += 1; + cNum /= 10; + } + return { + c: cNum, + e: expon + }; + } + function expFixTo(expnum1, expnum2, byFloor) { + var deltaExp = expnum2.e - expnum1.e; + if (deltaExp) { + expnum1.e += deltaExp; + expnum1.c *= MATH_POW(-deltaExp); + expnum1.c = byFloor ? MATH_FLOOR(expnum1.c) : MATH_CEIL(expnum1.c); + } + } + function expFixMin(expnum1, expnum2, byFloor) { + if (expnum1.e < expnum2.e) { + expFixTo(expnum2, expnum1, byFloor); + } else { + expFixTo(expnum1, expnum2, byFloor); + } + } + function getCeil(num, rounds) { + rounds = rounds || mySteps; + num = expNum(num); + var cNum = num.c; + var i = 0; + while (cNum > rounds[i]) { + i++; + } + if (!rounds[i]) { + cNum /= 10; + num.e += 1; + i = 0; + while (cNum > rounds[i]) { + i++; + } + } + num.c = rounds[i]; + return num; + } + function coreCalc(min, max, section) { + var step; + var secs = section || +custSecs.slice(-1); + var expStep = getCeil((max - min) / secs, custSteps); + var expSpan = expNum(max - min); + var expMin = expNum(min, -1, 1); + var expMax = expNum(max, -1); + expFixTo(expSpan, expStep); + expFixTo(expMin, expStep, 1); + expFixTo(expMax, expStep); + if (!section) { + secs = look4sections(expMin, expMax); + } else { + step = look4step(expMin, expMax, secs); + } + if (MATH_ISINT(min) && MATH_ISINT(max) && min * max >= 0) { + if (max - min < secs) { + return forInteger(min, max, secs); + } + secs = tryForInt(min, max, section, expMin, expMax, secs); + } + var arrMM = cross0(min, max, expMin.c, expMax.c); + expMin.c = arrMM[0]; + expMax.c = arrMM[1]; + if (minLocked || maxLocked) { + singleLocked(min, max, expMin, expMax); + } + return makeResult(expMin.c, expMax.c, secs, expMax.e); + } + function look4sections(expMin, expMax) { + var section; + var tmpStep, tmpMin, tmpMax; + var reference = []; + for (var i = custSecs.length; i--;) { + section = custSecs[i]; + tmpStep = getCeil((expMax.c - expMin.c) / section, custSteps); + tmpStep = tmpStep.c * MATH_POW(tmpStep.e); + tmpMin = MATH_FLOOR(expMin.c / tmpStep) * tmpStep; + tmpMax = MATH_CEIL(expMax.c / tmpStep) * tmpStep; + reference[i] = { + min: tmpMin, + max: tmpMax, + step: tmpStep, + span: tmpMax - tmpMin + }; + } + reference.sort(function (a, b) { + var delta = a.span - b.span; + if (delta === 0) { + delta = a.step - b.step; + } + return delta; + }); + reference = reference[0]; + section = reference.span / reference.step; + expMin.c = reference.min; + expMax.c = reference.max; + return section < 3 ? section * 2 : section; + } + function look4step(expMin, expMax, secs) { + var span; + var tmpMax; + var tmpMin = expMax.c; + var tmpStep = (expMax.c - expMin.c) / secs - 1; + while (tmpMin > expMin.c) { + tmpStep = getCeil(tmpStep + 1, custSteps); + tmpStep = tmpStep.c * MATH_POW(tmpStep.e); + span = tmpStep * secs; + tmpMax = MATH_CEIL(expMax.c / tmpStep) * tmpStep; + tmpMin = tmpMax - span; + } + var deltaMin = expMin.c - tmpMin; + var deltaMax = tmpMax - expMax.c; + var deltaDelta = deltaMin - deltaMax; + if (deltaDelta > tmpStep * 1.1) { + deltaDelta = MATH_ROUND(deltaDelta / tmpStep / 2) * tmpStep; + tmpMin += deltaDelta; + tmpMax += deltaDelta; + } + expMin.c = tmpMin; + expMax.c = tmpMax; + return tmpStep; + } + function tryForInt(min, max, section, expMin, expMax, secs) { + var span = expMax.c - expMin.c; + var step = span / secs * MATH_POW(expMax.e); + if (!MATH_ISINT(step)) { + step = MATH_FLOOR(step); + span = step * secs; + if (span < max - min) { + step += 1; + span = step * secs; + if (!section && step * (secs - 1) >= max - min) { + secs -= 1; + span = step * secs; + } + } + if (span >= max - min) { + var delta = span - (max - min); + expMin.c = MATH_ROUND(min - delta / 2); + expMax.c = MATH_ROUND(max + delta / 2); + expMin.e = 0; + expMax.e = 0; + } + } + return secs; + } + function forInteger(min, max, section) { + section = section || 5; + if (minLocked) { + max = min + section; + } else if (maxLocked) { + min = max - section; + } else { + var delta = section - (max - min); + var newMin = MATH_ROUND(min - delta / 2); + var newMax = MATH_ROUND(max + delta / 2); + var arrMM = cross0(min, max, newMin, newMax); + min = arrMM[0]; + max = arrMM[1]; + } + return makeResult(min, max, section); + } + function forSpan0(min, max, section) { + section = section || 5; + var delta = MT.min(MATH_ABS(max / section), section) / 2.1; + if (minLocked) { + max = min + delta; + } else if (maxLocked) { + min = max - delta; + } else { + min = min - delta; + max = max + delta; + } + return coreCalc(min, max, section); + } + function cross0(min, max, newMin, newMax) { + if (min >= 0 && newMin < 0) { + newMax -= newMin; + newMin = 0; + } else if (max <= 0 && newMax > 0) { + newMin -= newMax; + newMax = 0; + } + return [ + newMin, + newMax + ]; + } + function decimals(num) { + num = (+num).toFixed(15).split('.'); + return num.pop().replace(/0+$/, '').length; + } + function singleLocked(min, max, emin, emax) { + if (minLocked) { + var expMin = expNum(min, 4, 1); + if (emin.e - expMin.e > 6) { + expMin = { + c: 0, + e: emin.e + }; + } + expFixMin(emin, expMin); + expFixMin(emax, expMin); + emax.c += expMin.c - emin.c; + emin.c = expMin.c; + } else if (maxLocked) { + var expMax = expNum(max, 4); + if (emax.e - expMax.e > 6) { + expMax = { + c: 0, + e: emax.e + }; + } + expFixMin(emin, expMax); + expFixMin(emax, expMax); + emin.c += expMax.c - emax.c; + emax.c = expMax.c; + } + } + function bothLocked(min, max, section) { + var trySecs = section ? [section] : custSecs; + var span = max - min; + if (span === 0) { + max = expNum(max, 3); + section = trySecs[0]; + max.c = MATH_ROUND(max.c + section / 2); + return makeResult(max.c - section, max.c, section, max.e); + } + if (MATH_ABS(max / span) < 0.000001) { + max = 0; + } + if (MATH_ABS(min / span) < 0.000001) { + min = 0; + } + var step, deltaSpan, score; + var scoreS = [ + [ + 5, + 10 + ], + [ + 10, + 2 + ], + [ + 50, + 10 + ], + [ + 100, + 2 + ] + ]; + var reference = []; + var debugLog = []; + var expSpan = expNum(max - min, 3); + var expMin = expNum(min, -1, 1); + var expMax = expNum(max, -1); + expFixTo(expMin, expSpan, 1); + expFixTo(expMax, expSpan); + span = expMax.c - expMin.c; + expSpan.c = span; + for (var i = trySecs.length; i--;) { + section = trySecs[i]; + step = MATH_CEIL(span / section); + deltaSpan = step * section - span; + score = (deltaSpan + 3) * 3; + score += (section - trySecs[0] + 2) * 2; + if (section % 5 === 0) { + score -= 10; + } + for (var j = scoreS.length; j--;) { + if (step % scoreS[j][0] === 0) { + score /= scoreS[j][1]; + } + } + debugLog[i] = [ + section, + step, + deltaSpan, + score + ].join(); + reference[i] = { + secs: section, + step: step, + delta: deltaSpan, + score: score + }; + } + reference.sort(function (a, b) { + return a.score - b.score; + }); + reference = reference[0]; + expMin.c = MATH_ROUND(expMin.c - reference.delta / 2); + expMax.c = MATH_ROUND(expMax.c + reference.delta / 2); + return makeResult(expMin.c, expMax.c, reference.secs, expSpan.e); + } + return smartSteps; +}); \ No newline at end of file diff --git a/build/wrap/almond.js b/build/wrap/almond.js deleted file mode 100644 index 28ed81a..0000000 --- a/build/wrap/almond.js +++ /dev/null @@ -1,405 +0,0 @@ -/** - * almond 0.2.5 Copyright (c) 2011-2012, The Dojo Foundation All Rights Reserved. - * Available via the MIT or new BSD license. - * see: http://github.com/jrburke/almond for details - */ -//Going sloppy to avoid 'use strict' string cost, but strict practices should -//be followed. -/*jslint sloppy: true */ -/*global setTimeout: false */ - -var requirejs, require, define; -(function (undef) { - var main, req, makeMap, handlers, - defined = {}, - waiting = {}, - config = {}, - defining = {}, - hasOwn = Object.prototype.hasOwnProperty, - aps = [].slice; - - function hasProp(obj, prop) { - return hasOwn.call(obj, prop); - } - - /** - * Given a relative module name, like ./something, normalize it to - * a real name that can be mapped to a path. - * @param {String} name the relative name - * @param {String} baseName a real name that the name arg is relative - * to. - * @returns {String} normalized name - */ - function normalize(name, baseName) { - var nameParts, nameSegment, mapValue, foundMap, - foundI, foundStarMap, starI, i, j, part, - baseParts = baseName && baseName.split("/"), - map = config.map, - starMap = (map && map['*']) || {}; - - //Adjust any relative paths. - if (name && name.charAt(0) === ".") { - //If have a base name, try to normalize against it, - //otherwise, assume it is a top-level require that will - //be relative to baseUrl in the end. - if (baseName) { - //Convert baseName to array, and lop off the last part, - //so that . matches that "directory" and not name of the baseName's - //module. For instance, baseName of "one/two/three", maps to - //"one/two/three.js", but we want the directory, "one/two" for - //this normalization. - baseParts = baseParts.slice(0, baseParts.length - 1); - - name = baseParts.concat(name.split("/")); - - //start trimDots - for (i = 0; i < name.length; i += 1) { - part = name[i]; - if (part === ".") { - name.splice(i, 1); - i -= 1; - } else if (part === "..") { - if (i === 1 && (name[2] === '..' || name[0] === '..')) { - //End of the line. Keep at least one non-dot - //path segment at the front so it can be mapped - //correctly to disk. Otherwise, there is likely - //no path mapping for a path starting with '..'. - //This can still fail, but catches the most reasonable - //uses of .. - break; - } else if (i > 0) { - name.splice(i - 1, 2); - i -= 2; - } - } - } - //end trimDots - - name = name.join("/"); - } else if (name.indexOf('./') === 0) { - // No baseName, so this is ID is resolved relative - // to baseUrl, pull off the leading dot. - name = name.substring(2); - } - } - - //Apply map config if available. - if ((baseParts || starMap) && map) { - nameParts = name.split('/'); - - for (i = nameParts.length; i > 0; i -= 1) { - nameSegment = nameParts.slice(0, i).join("/"); - - if (baseParts) { - //Find the longest baseName segment match in the config. - //So, do joins on the biggest to smallest lengths of baseParts. - for (j = baseParts.length; j > 0; j -= 1) { - mapValue = map[baseParts.slice(0, j).join('/')]; - - //baseName segment has config, find if it has one for - //this name. - if (mapValue) { - mapValue = mapValue[nameSegment]; - if (mapValue) { - //Match, update name to the new value. - foundMap = mapValue; - foundI = i; - break; - } - } - } - } - - if (foundMap) { - break; - } - - //Check for a star map match, but just hold on to it, - //if there is a shorter segment match later in a matching - //config, then favor over this star map. - if (!foundStarMap && starMap && starMap[nameSegment]) { - foundStarMap = starMap[nameSegment]; - starI = i; - } - } - - if (!foundMap && foundStarMap) { - foundMap = foundStarMap; - foundI = starI; - } - - if (foundMap) { - nameParts.splice(0, foundI, foundMap); - name = nameParts.join('/'); - } - } - - return name; - } - - function makeRequire(relName, forceSync) { - return function () { - //A version of a require function that passes a moduleName - //value for items that may need to - //look up paths relative to the moduleName - return req.apply(undef, aps.call(arguments, 0).concat([relName, forceSync])); - }; - } - - function makeNormalize(relName) { - return function (name) { - return normalize(name, relName); - }; - } - - function makeLoad(depName) { - return function (value) { - defined[depName] = value; - }; - } - - function callDep(name) { - if (hasProp(waiting, name)) { - var args = waiting[name]; - delete waiting[name]; - defining[name] = true; - main.apply(undef, args); - } - - if (!hasProp(defined, name) && !hasProp(defining, name)) { - throw new Error('No ' + name); - } - return defined[name]; - } - - //Turns a plugin!resource to [plugin, resource] - //with the plugin being undefined if the name - //did not have a plugin prefix. - function splitPrefix(name) { - var prefix, - index = name ? name.indexOf('!') : -1; - if (index > -1) { - prefix = name.substring(0, index); - name = name.substring(index + 1, name.length); - } - return [prefix, name]; - } - - /** - * Makes a name map, normalizing the name, and using a plugin - * for normalization if necessary. Grabs a ref to plugin - * too, as an optimization. - */ - makeMap = function (name, relName) { - var plugin, - parts = splitPrefix(name), - prefix = parts[0]; - - name = parts[1]; - - if (prefix) { - prefix = normalize(prefix, relName); - plugin = callDep(prefix); - } - - //Normalize according - if (prefix) { - if (plugin && plugin.normalize) { - name = plugin.normalize(name, makeNormalize(relName)); - } else { - name = normalize(name, relName); - } - } else { - name = normalize(name, relName); - parts = splitPrefix(name); - prefix = parts[0]; - name = parts[1]; - if (prefix) { - plugin = callDep(prefix); - } - } - - //Using ridiculous property names for space reasons - return { - f: prefix ? prefix + '!' + name : name, //fullName - n: name, - pr: prefix, - p: plugin - }; - }; - - function makeConfig(name) { - return function () { - return (config && config.config && config.config[name]) || {}; - }; - } - - handlers = { - require: function (name) { - return makeRequire(name); - }, - exports: function (name) { - var e = defined[name]; - if (typeof e !== 'undefined') { - return e; - } else { - return (defined[name] = {}); - } - }, - module: function (name) { - return { - id: name, - uri: '', - exports: defined[name], - config: makeConfig(name) - }; - } - }; - - main = function (name, deps, callback, relName) { - var cjsModule, depName, ret, map, i, - args = [], - usingExports; - - //Use name if no relName - relName = relName || name; - - //Call the callback to define the module, if necessary. - if (typeof callback === 'function') { - - //Pull out the defined dependencies and pass the ordered - //values to the callback. - //Default to [require, exports, module] if no deps - deps = !deps.length && callback.length ? ['require', 'exports', 'module'] : deps; - for (i = 0; i < deps.length; i += 1) { - map = makeMap(deps[i], relName); - depName = map.f; - - //Fast path CommonJS standard dependencies. - if (depName === "require") { - args[i] = handlers.require(name); - } else if (depName === "exports") { - //CommonJS module spec 1.1 - args[i] = handlers.exports(name); - usingExports = true; - } else if (depName === "module") { - //CommonJS module spec 1.1 - cjsModule = args[i] = handlers.module(name); - } else if (hasProp(defined, depName) || - hasProp(waiting, depName) || - hasProp(defining, depName)) { - args[i] = callDep(depName); - } else if (map.p) { - map.p.load(map.n, makeRequire(relName, true), makeLoad(depName), {}); - args[i] = defined[depName]; - } else { - throw new Error(name + ' missing ' + depName); - } - } - - ret = callback.apply(defined[name], args); - - if (name) { - //If setting exports via "module" is in play, - //favor that over return value and exports. After that, - //favor a non-undefined return value over exports use. - if (cjsModule && cjsModule.exports !== undef && - cjsModule.exports !== defined[name]) { - defined[name] = cjsModule.exports; - } else if (ret !== undef || !usingExports) { - //Use the return value from the function. - defined[name] = ret; - } - } - } else if (name) { - //May just be an object definition for the module. Only - //worry about defining if have a module name. - defined[name] = callback; - } - }; - - requirejs = require = req = function (deps, callback, relName, forceSync, alt) { - if (typeof deps === "string") { - if (handlers[deps]) { - //callback in this case is really relName - return handlers[deps](callback); - } - //Just return the module wanted. In this scenario, the - //deps arg is the module name, and second arg (if passed) - //is just the relName. - //Normalize module name, if it contains . or .. - return callDep(makeMap(deps, callback).f); - } else if (!deps.splice) { - //deps is a config object, not an array. - config = deps; - if (callback.splice) { - //callback is an array, which means it is a dependency list. - //Adjust args if there are dependencies - deps = callback; - callback = relName; - relName = null; - } else { - deps = undef; - } - } - - //Support require(['a']) - callback = callback || function () {}; - - //If relName is a function, it is an errback handler, - //so remove it. - if (typeof relName === 'function') { - relName = forceSync; - forceSync = alt; - } - - //Simulate async callback; - if (forceSync) { - main(undef, deps, callback, relName); - } else { - //Using a non-zero value because of concern for what old browsers - //do, and latest browsers "upgrade" to 4 if lower value is used: - //http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#dom-windowtimers-settimeout: - //If want a value immediately, use require('id') instead -- something - //that works in almond on the global level, but not guaranteed and - //unlikely to work in other AMD implementations. - setTimeout(function () { - main(undef, deps, callback, relName); - }, 4); - } - - return req; - }; - - /** - * Just drops the config on the floor, but returns req in case - * the config return value is used. - */ - req.config = function (cfg) { - config = cfg; - if (config.deps) { - req(config.deps, config.callback); - } - return req; - }; - - define = function (name, deps, callback) { - - //This module may not have dependencies - if (!deps.splice) { - //deps is not an array, so probably means - //an object literal or factory function for - //the value. Adjust args. - callback = deps; - deps = []; - } - - if (!hasProp(defined, name) && !hasProp(waiting, name)) { - waiting[name] = [name, deps, callback]; - } - }; - - define.amd = { - jQuery: true - }; -}()); diff --git a/build/wrap/end-map.js b/build/wrap/end-map.js deleted file mode 100644 index 8fe5d06..0000000 --- a/build/wrap/end-map.js +++ /dev/null @@ -1,31 +0,0 @@ - -var zrender = require('zrender'); -zrender.tool = { - color : require('zrender/tool/color'), - math : require('zrender/tool/math'), - util : require('zrender/tool/util'), - vector : require('zrender/tool/vector'), - area : require('zrender/tool/area'), - event : require('zrender/tool/event') -} - -zrender.animation = { - Animation : require('zrender/animation/Animation'), - Cip : require('zrender/animation/Clip'), - easing : require('zrender/animation/easing') -} -var echarts = require('echarts'); -echarts.config = require('echarts/config'); -echarts.util = { - mapData : { - params : require('echarts/util/mapData/params') - } -} - -// 加载需要的图表,由build.js临时生成 -var chart = require('_chart'); - -_global['echarts'] = echarts; -_global['zrender'] = zrender; - -})(window); diff --git a/build/wrap/end.js b/build/wrap/end.js deleted file mode 100644 index c6a9752..0000000 --- a/build/wrap/end.js +++ /dev/null @@ -1,27 +0,0 @@ - -var zrender = require('zrender'); -zrender.tool = { - color : require('zrender/tool/color'), - math : require('zrender/tool/math'), - util : require('zrender/tool/util'), - vector : require('zrender/tool/vector'), - area : require('zrender/tool/area'), - event : require('zrender/tool/event') -} - -zrender.animation = { - Animation : require('zrender/animation/Animation'), - Cip : require('zrender/animation/Clip'), - easing : require('zrender/animation/easing') -} -var echarts = require('echarts'); -echarts.config = require('echarts/config'); -echarts.util = {}; - -// 加载需要的图表,由build.js临时生成 -var chart = require('_chart'); - -_global['echarts'] = echarts; -_global['zrender'] = zrender; - -})(window); diff --git a/build/wrap/start.js b/build/wrap/start.js deleted file mode 100644 index 0a3049b..0000000 --- a/build/wrap/start.js +++ /dev/null @@ -1 +0,0 @@ -(function(_global){ diff --git a/src/chart.js b/src/chart.js index 69b6cd0..176c39a 100644 --- a/src/chart.js +++ b/src/chart.js @@ -2,7 +2,7 @@ * echart图表库 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) */ //chart var self = {}; diff --git a/src/chart/bar.js b/src/chart/bar.js index ede7e1b..5e84686 100644 --- a/src/chart/bar.js +++ b/src/chart/bar.js @@ -2,11 +2,10 @@ * echarts图表类:柱形图 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ -var ComponentBase = require('../component/base.js'); var ChartBase = require('./base.js'); // 图形依赖 @@ -17,6 +16,60 @@ require('../component/grid.js'); require('../component/dataZoom.js'); var ecConfig = require('../config.js'); +// 柱形图默认参数 +ecConfig.bar = { + zlevel: 0, + // 一级层叠 + z: 2, + // 二级层叠 + clickable: true, + legendHoverLink: true, + // stack: null + xAxisIndex: 0, + yAxisIndex: 0, + barMinHeight: 0, + // 最小高度改为0 + // barWidth: null, // 默认自适应 + barGap: '30%', + // 柱间距离,默认为柱形宽度的30%,可设固定值 + barCategoryGap: '20%', + // 类目间柱形距离,默认为类目间距的20%,可设固定值 + itemStyle: { + normal: { + // color: '各异', + barBorderColor: '#fff', + // 柱条边线 + barBorderRadius: 0, + // 柱条边线圆角,单位px,默认为0 + barBorderWidth: 0, + // 柱条边线线宽,单位px,默认为1 + label: { + show: false + // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调 + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 + // 'inside'|'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + } + }, + emphasis: { + // color: '各异', + barBorderColor: '#fff', + // 柱条边线 + barBorderRadius: 0, + // 柱条边线圆角,单位px,默认为0 + barBorderWidth: 0, + // 柱条边线线宽,单位px,默认为1 + label: { + show: false + // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调 + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 + // 'inside'|'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + } + } + } +}; + var ecData = require('../util/ecData.js'); var zrUtil = require('../zrender/tool/util.js'); var zrColor = require('../zrender/tool/color.js'); @@ -30,10 +83,8 @@ var zrColor = require('../zrender/tool/color.js'); */ function Bar(ecTheme, messageCenter, zr, option, myChart) { - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); // 图表基类 - ChartBase.call(this); + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); this.refresh(option); } @@ -44,211 +95,59 @@ Bar.prototype = { * 绘制图形 */ _buildShape: function () { - var series = this.series; - this.selectedMap = {}; - this.xMarkMap = {}; - - // series默认颜色索引,seriesIndex索引到color - this._sIndex2colorMap = {}; - - // 水平垂直双向series索引 ,position索引到seriesIndex - var _position2sIndexMap = { - top: [], - bottom: [], - left: [], - right: [] - }; - var xAxisIndex; - var yAxisIndex; - var xAxis; - var yAxis; - for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type == ecConfig.CHART_TYPE_BAR) { - series[i] = this.reformOption(series[i]); - xAxisIndex = series[i].xAxisIndex; - yAxisIndex = series[i].yAxisIndex; - xAxis = this.component.xAxis.getAxis(xAxisIndex); - yAxis = this.component.yAxis.getAxis(yAxisIndex); - if (xAxis.type == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY) { - _position2sIndexMap[xAxis.getPosition()].push(i); - } - else if (yAxis.type == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY) { - _position2sIndexMap[yAxis.getPosition()].push(i); - } - } - } - // console.log(_position2sIndexMap) - for (var position in _position2sIndexMap) { - if (_position2sIndexMap[position].length > 0) { - this._buildSinglePosition( - position, _position2sIndexMap[position], this.xMarkMap); - } - } - - this.addShapeList(); - }, - - /** - * 构建单个方向上的柱形图 - * - * @param {number} seriesIndex 系列索引 - */ - _buildSinglePosition: function (position, seriesArray, xMarkMap) { - var mapData = this._mapData(seriesArray); - var locationMap = mapData.locationMap; - var maxDataLength = mapData.maxDataLength; - - if (maxDataLength === 0 || locationMap.length === 0) { - return; - } - - switch (position) { - case 'bottom': - case 'top': - this._buildHorizontal(maxDataLength, locationMap, seriesArray, xMarkMap); - break; - case 'left': - case 'right': - this._buildVertical(maxDataLength, locationMap, seriesArray, xMarkMap); - break; - } - }, - - /** - * 数据整形 - * 数组位置映射到系列索引 - */ - _mapData: function (seriesArray) { - var series = this.series; - var serie; // 临时映射变量 - var dataIndex = 0; // 堆积数据所在位置映射 - var stackMap = {}; // 堆积数据位置映射,堆积组在二维中的第几项 - var magicStackKey = '__kener__stack__'; // 堆积命名,非堆积数据安单一堆积处理 - var stackKey; // 临时映射变量 - var serieName; // 临时映射变量 - var legend = this.component.legend; - var locationMap = []; // 需要返回的东西:数组位置映射到系列索引 - var maxDataLength = 0; // 需要返回的东西:最大数据长度 - var iconShape; - // 计算需要显示的个数和分配位置并记在下面这个结构里 - for (var i = 0, l = seriesArray.length; i < l; i++) { - serie = series[seriesArray[i]]; - serieName = serie.name; - if (legend) { - this.selectedMap[serieName] = legend.isSelected(serieName); - this._sIndex2colorMap[seriesArray[i]] = - legend.getColor(serieName); - - iconShape = legend.getItemShape(serieName); - if (iconShape) { - // 回调legend,换一个更形象的icon - if (serie.itemStyle.normal.borderWidth > 0) { - iconShape.style.x += 1; - iconShape.style.y += 1; - iconShape.style.width -= 2; - iconShape.style.height -= 2; - iconShape.style.strokeColor = - iconShape.highlightStyle.strokeColor = - serie.itemStyle.normal.borderColor; - iconShape.highlightStyle.lineWidth = 3; - iconShape.style.brushType = 'both'; - } - legend.setItemShape(serieName, iconShape); - } - } else { - this.selectedMap[serieName] = true; - this._sIndex2colorMap[seriesArray[i]] = - this.zr.getColor(seriesArray[i]); - } - - if (this.selectedMap[serieName]) { - stackKey = serie.stack || (magicStackKey + seriesArray[i]); - if (typeof stackMap[stackKey] == 'undefined') { - stackMap[stackKey] = dataIndex; - locationMap[dataIndex] = [seriesArray[i]]; - dataIndex++; - } - else { - // 已经分配了位置就推进去就行 - locationMap[stackMap[stackKey]].push(seriesArray[i]); - } - } - // 兼职帮算一下最大长度 - maxDataLength = Math.max(maxDataLength, serie.data.length); - } - -/* 调试输出 - var s = ''; - for (var i = 0, l = maxDataLength; i < l; i++) { - s = '['; - for (var j = 0, k = locationMap.length; j < k; j++) { - s +='[' - for (var m = 0, n = locationMap[j].length - 1; m < n; m++) { - s += series[locationMap[j][m]].data[i] + ',' - } - s += series[locationMap[j][locationMap[j].length - 1]] - .data[i]; - s += ']' - } - s += ']'; - console.log(s); - } - console.log(locationMap) - */ - - return { - locationMap: locationMap, - maxDataLength: maxDataLength - }; + this._buildPosition(); }, - /** - * 构建类目轴为水平方向的柱形图系列 - */ - _buildHorizontal: function (maxDataLength, locationMap, seriesArray, xMarkMap) { + _buildNormal: function (seriesArray, maxDataLength, locationMap, xMarkMap, orient) { var series = this.series; // 确定类目轴和数值轴,同一方向随便找一个即可 var seriesIndex = locationMap[0][0]; var serie = series[seriesIndex]; - var xAxisIndex = serie.xAxisIndex; - var categoryAxis = this.component.xAxis.getAxis(xAxisIndex); - var yAxisIndex; // 数值轴各异 + var isHorizontal = orient == 'horizontal'; + var xAxis = this.component.xAxis; + var yAxis = this.component.yAxis; + var categoryAxis = isHorizontal ? xAxis.getAxis(serie.xAxisIndex) : yAxis.getAxis(serie.yAxisIndex); var valueAxis; // 数值轴各异 var size = this._mapSize(categoryAxis, locationMap); var gap = size.gap; var barGap = size.barGap; var barWidthMap = size.barWidthMap; + var barMaxWidthMap = size.barMaxWidthMap; var barWidth = size.barWidth; // 自适应宽度 var barMinHeightMap = size.barMinHeightMap; var barHeight; + var curBarWidth; var interval = size.interval; var x; var y; - var lastYP; // 正向堆积处理 - var baseYP; - var lastYN; // 负向堆积处理 - var baseYN; + var lastP; // 正向堆积处理 + var baseP; + var lastN; // 负向堆积处理 + var baseN; var barShape; var data; var value; + var islandR = this.deepQuery([this.ecTheme, ecConfig], 'island.r'); for (var i = 0, l = maxDataLength; i < l; i++) { - if (typeof categoryAxis.getNameByIndex(i) == 'undefined') { + if (categoryAxis.getNameByIndex(i) == null) { // 系列数据超出类目轴长度 break; } - x = categoryAxis.getCoordByIndex(i) - gap / 2; + isHorizontal ? (x = categoryAxis.getCoordByIndex(i) - gap / 2) : (y = categoryAxis.getCoordByIndex(i) + gap / 2); + for (var j = 0, k = locationMap.length; j < k; j++) { // 堆积数据用第一条valueAxis - yAxisIndex = series[locationMap[j][0]].yAxisIndex || 0; - valueAxis = this.component.yAxis.getAxis(yAxisIndex); - baseYP = lastYP = baseYN = lastYN = valueAxis.getCoord(0); + var yAxisIndex = series[locationMap[j][0]].yAxisIndex || 0; + var xAxisIndex = series[locationMap[j][0]].xAxisIndex || 0; + valueAxis = isHorizontal ? yAxis.getAxis(yAxisIndex) : xAxis.getAxis(xAxisIndex); + baseP = lastP = baseN = lastN = valueAxis.getCoord(0); for (var m = 0, n = locationMap[j].length; m < n; m++) { seriesIndex = locationMap[j][m]; serie = series[seriesIndex]; data = serie.data[i]; - value = typeof data != 'undefined' ? (typeof data.value != 'undefined' ? data.value : data) : '-'; + value = this.getDataFromOption(data, '-'); xMarkMap[seriesIndex] = xMarkMap[seriesIndex] || { min: Number.POSITIVE_INFINITY, max: Number.NEGATIVE_INFINITY, @@ -256,58 +155,89 @@ Bar.prototype = { counter: 0, average: 0 }; - if (value == '-') { + curBarWidth = Math.min( + barMaxWidthMap[seriesIndex] || Number.MAX_VALUE, barWidthMap[seriesIndex] || barWidth); + if (value === '-') { // 空数据在做完后补充拖拽提示框 continue; } - //y = valueAxis.getCoord(value); if (value > 0) { // 正向堆积 - //barHeight = baseYP - y; - barHeight = m > 0 ? valueAxis.getCoordSize(value) : (baseYP - valueAxis.getCoord(value)); + barHeight = m > 0 ? valueAxis.getCoordSize(value) : ( + isHorizontal ? (baseP - valueAxis.getCoord(value)) : (valueAxis.getCoord(value) - baseP)); // 非堆积数据最小高度有效 - if (n == 1 && barMinHeightMap[seriesIndex] > barHeight) { + if (n === 1 && barMinHeightMap[seriesIndex] > barHeight) { barHeight = barMinHeightMap[seriesIndex]; } - lastYP -= barHeight; - y = lastYP; + if (isHorizontal) { + lastP -= barHeight; + y = lastP; + } + else { + x = lastP; + lastP += barHeight; + } } else if (value < 0) { // 负向堆积 - //barHeight = y - baseYN; - barHeight = m > 0 ? valueAxis.getCoordSize(value) : (valueAxis.getCoord(value) - baseYN); + barHeight = m > 0 ? valueAxis.getCoordSize(value) : ( + isHorizontal ? (valueAxis.getCoord(value) - baseN) : (baseN - valueAxis.getCoord(value))); // 非堆积数据最小高度有效 - if (n == 1 && barMinHeightMap[seriesIndex] > barHeight) { + if (n === 1 && barMinHeightMap[seriesIndex] > barHeight) { barHeight = barMinHeightMap[seriesIndex]; } - y = lastYN; - lastYN += barHeight; + if (isHorizontal) { + y = lastN; + lastN += barHeight; + } + else { + lastN -= barHeight; + x = lastN; + } } else { // 0值 - barHeight = 0; //baseYP - y; + barHeight = 0; // 最小高度无效 - lastYP -= barHeight; - y = lastYP; + if (isHorizontal) { + lastP -= barHeight; + y = lastP; + } + else { + x = lastP; + lastP += barHeight; + } } - xMarkMap[seriesIndex][i] = - x + (barWidthMap[seriesIndex] || barWidth) / 2; + xMarkMap[seriesIndex][i] = isHorizontal ? (x + curBarWidth / 2) : (y - curBarWidth / 2); if (xMarkMap[seriesIndex].min > value) { xMarkMap[seriesIndex].min = value; - xMarkMap[seriesIndex].minY = y; - xMarkMap[seriesIndex].minX = xMarkMap[seriesIndex][i]; + if (isHorizontal) { + xMarkMap[seriesIndex].minY = y; + xMarkMap[seriesIndex].minX = xMarkMap[seriesIndex][i]; + } + else { + xMarkMap[seriesIndex].minX = x + barHeight; + xMarkMap[seriesIndex].minY = xMarkMap[seriesIndex][i]; + } } if (xMarkMap[seriesIndex].max < value) { xMarkMap[seriesIndex].max = value; - xMarkMap[seriesIndex].maxY = y; - xMarkMap[seriesIndex].maxX = xMarkMap[seriesIndex][i]; + if (isHorizontal) { + xMarkMap[seriesIndex].maxY = y; + xMarkMap[seriesIndex].maxX = xMarkMap[seriesIndex][i]; + } + else { + xMarkMap[seriesIndex].maxX = x + barHeight; + xMarkMap[seriesIndex].maxY = xMarkMap[seriesIndex][i]; + } + } xMarkMap[seriesIndex].sum += value; xMarkMap[seriesIndex].counter++; if (i % interval === 0) { barShape = this._getBarItem( - seriesIndex, i, categoryAxis.getNameByIndex(i), x, y, barWidthMap[seriesIndex] || barWidth, barHeight, 'vertical'); + seriesIndex, i, categoryAxis.getNameByIndex(i), x, y - (isHorizontal ? 0 : curBarWidth), isHorizontal ? curBarWidth : barHeight, isHorizontal ? barHeight : curBarWidth, isHorizontal ? 'vertical' : 'horizontal'); this.shapeList.push(new RectangleShape(barShape)); } } @@ -317,230 +247,179 @@ Bar.prototype = { seriesIndex = locationMap[j][m]; serie = series[seriesIndex]; data = serie.data[i]; - value = typeof data != 'undefined' ? (typeof data.value != 'undefined' ? data.value : data) : '-'; + value = this.getDataFromOption(data, '-'); + curBarWidth = Math.min( + barMaxWidthMap[seriesIndex] || Number.MAX_VALUE, barWidthMap[seriesIndex] || barWidth); if (value != '-') { // 只关心空数据 continue; } if (this.deepQuery([data, serie, this.option], 'calculable')) { - lastYP -= this.ecTheme.island.r; - y = lastYP; + if (isHorizontal) { + lastP -= islandR; + y = lastP; + } + else { + x = lastP; + lastP += islandR; + } barShape = this._getBarItem( - seriesIndex, i, categoryAxis.getNameByIndex(i), x + 0.5, y + 0.5, (barWidthMap[seriesIndex] || barWidth) - 1, this.ecTheme.island.r - 1, 'vertical'); + seriesIndex, i, categoryAxis.getNameByIndex(i), x, y - (isHorizontal ? 0 : curBarWidth), isHorizontal ? curBarWidth : islandR, isHorizontal ? islandR : curBarWidth, isHorizontal ? 'vertical' : 'horizontal'); barShape.hoverable = false; barShape.draggable = false; barShape.style.lineWidth = 1; barShape.style.brushType = 'stroke'; - barShape.style.strokeColor = - serie.calculableHolderColor || this.ecTheme.calculableHolderColor; + barShape.style.strokeColor = serie.calculableHolderColor || this.ecTheme.calculableHolderColor || ecConfig.calculableHolderColor; this.shapeList.push(new RectangleShape(barShape)); } } - - x += ((barWidthMap[seriesIndex] || barWidth) + barGap); + isHorizontal ? (x += (curBarWidth + barGap)) : (y -= (curBarWidth + barGap)); } } - for (var j = 0, k = locationMap.length; j < k; j++) { - for (var m = 0, n = locationMap[j].length; m < n; m++) { - seriesIndex = locationMap[j][m]; - if (xMarkMap[seriesIndex].counter > 0) { - xMarkMap[seriesIndex].average = (xMarkMap[seriesIndex].sum / xMarkMap[seriesIndex].counter).toFixed(2) - 0; - } - - y = this.component.yAxis.getAxis(series[seriesIndex].yAxisIndex || 0).getCoord(xMarkMap[seriesIndex].average); - - xMarkMap[seriesIndex].averageLine = [ - [this.component.grid.getX(), y], - [this.component.grid.getXend(), y] - ]; - xMarkMap[seriesIndex].minLine = [ - [this.component.grid.getX(), xMarkMap[seriesIndex].minY], - [this.component.grid.getXend(), xMarkMap[seriesIndex].minY] - ]; - xMarkMap[seriesIndex].maxLine = [ - [this.component.grid.getX(), xMarkMap[seriesIndex].maxY], - [this.component.grid.getXend(), xMarkMap[seriesIndex].maxY] - ]; - - xMarkMap[seriesIndex].isHorizontal = true; - this.buildMark(seriesIndex); - } - } + this._calculMarkMapXY(xMarkMap, locationMap, isHorizontal ? 'y' : 'x'); + }, + /** + * 构建类目轴为水平方向的柱形图系列 + */ + _buildHorizontal: function (seriesArray, maxDataLength, locationMap, xMarkMap) { + return this._buildNormal( + seriesArray, maxDataLength, locationMap, xMarkMap, 'horizontal'); }, /** * 构建类目轴为垂直方向的柱形图系列 */ - _buildVertical: function (maxDataLength, locationMap, seriesArray, xMarkMap) { - var series = this.series; - // 确定类目轴和数值轴,同一方向随便找一个即可 - var seriesIndex = locationMap[0][0]; - var serie = series[seriesIndex]; - var yAxisIndex = serie.yAxisIndex; - var categoryAxis = this.component.yAxis.getAxis(yAxisIndex); - var xAxisIndex; // 数值轴各异 - var valueAxis; // 数值轴各异 + _buildVertical: function (seriesArray, maxDataLength, locationMap, xMarkMap) { + return this._buildNormal( + seriesArray, maxDataLength, locationMap, xMarkMap, 'vertical'); + }, - var size = this._mapSize(categoryAxis, locationMap); - var gap = size.gap; - var barGap = size.barGap; - var barWidthMap = size.barWidthMap; - var barWidth = size.barWidth; // 自适应宽度 - var barMinHeightMap = size.barMinHeightMap; - var barHeight; - var interval = size.interval; + /** + * 构建双数值轴柱形图 + */ + _buildOther: function (seriesArray, maxDataLength, locationMap, xMarkMap) { + var series = this.series; - var x; - var y; - var lastXP; // 正向堆积处理 - var baseXP; - var lastXN; // 负向堆积处理 - var baseXN; - var barShape; - var data; - var value; - for (var i = 0, l = maxDataLength; i < l; i++) { - if (typeof categoryAxis.getNameByIndex(i) == 'undefined') { - // 系列数据超出类目轴长度 - break; - } - y = categoryAxis.getCoordByIndex(i) + gap / 2; - for (var j = 0, k = locationMap.length; j < k; j++) { - // 堆积数据用第一条valueAxis - xAxisIndex = series[locationMap[j][0]].xAxisIndex || 0; - valueAxis = this.component.xAxis.getAxis(xAxisIndex); - baseXP = lastXP = baseXN = lastXN = valueAxis.getCoord(0); - for (var m = 0, n = locationMap[j].length; m < n; m++) { - seriesIndex = locationMap[j][m]; - serie = series[seriesIndex]; - data = serie.data[i]; - value = typeof data != 'undefined' ? (typeof data.value != 'undefined' ? data.value : data) : '-'; - xMarkMap[seriesIndex] = xMarkMap[seriesIndex] || { - min: Number.POSITIVE_INFINITY, - max: Number.NEGATIVE_INFINITY, - sum: 0, - counter: 0, - average: 0 - }; - if (value == '-') { - // 空数据在做完后补充拖拽提示框 + for (var j = 0, k = locationMap.length; j < k; j++) { + for (var m = 0, n = locationMap[j].length; m < n; m++) { + var seriesIndex = locationMap[j][m]; + var serie = series[seriesIndex]; + var xAxisIndex = serie.xAxisIndex || 0; + var xAxis = this.component.xAxis.getAxis(xAxisIndex); + var baseX = xAxis.getCoord(0); + var yAxisIndex = serie.yAxisIndex || 0; + var yAxis = this.component.yAxis.getAxis(yAxisIndex); + var baseY = yAxis.getCoord(0); + + xMarkMap[seriesIndex] = xMarkMap[seriesIndex] || { + min0: Number.POSITIVE_INFINITY, + min1: Number.POSITIVE_INFINITY, + max0: Number.NEGATIVE_INFINITY, + max1: Number.NEGATIVE_INFINITY, + sum0: 0, + sum1: 0, + counter0: 0, + counter1: 0, + average0: 0, + average1: 0 + }; + + for (var i = 0, l = serie.data.length; i < l; i++) { + var data = serie.data[i]; + var value = this.getDataFromOption(data, '-'); + if (!(value instanceof Array)) { continue; } - //x = valueAxis.getCoord(value); - if (value > 0) { - // 正向堆积 - //barHeight = x - baseXP; - barHeight = m > 0 ? valueAxis.getCoordSize(value) : (valueAxis.getCoord(value) - baseXP); - // 非堆积数据最小高度有效 - if (n == 1 && barMinHeightMap[seriesIndex] > barHeight) { - barHeight = barMinHeightMap[seriesIndex]; + + var x = xAxis.getCoord(value[0]); + var y = yAxis.getCoord(value[1]); + + var queryTarget = [data, serie]; + var barWidth = this.deepQuery(queryTarget, 'barWidth') || 10; // 默认柱形 + var barHeight = this.deepQuery(queryTarget, 'barHeight'); + var orient; + var barShape; + + if (barHeight != null) { + // 条形图 + orient = 'horizontal'; + + if (value[0] > 0) { + // 正向 + barWidth = x - baseX; + x -= barWidth; } - x = lastXP; - lastXP += barHeight; - } - else if (value < 0) { - // 负向堆积 - //barHeight = baseXN - x; - barHeight = m > 0 ? valueAxis.getCoordSize(value) : (baseXN - valueAxis.getCoord(value)); - // 非堆积数据最小高度有效 - if (n == 1 && barMinHeightMap[seriesIndex] > barHeight) { - barHeight = barMinHeightMap[seriesIndex]; + else if (value[0] < 0) { + // 负向 + barWidth = baseX - x; + } + else { + // 0值 + barWidth = 0; } - lastXN -= barHeight; - x = lastXN; - } - else { - // 0值 - barHeight = 0; //x - baseXP; - // 最小高度无效 - x = lastXP; - lastXP += barHeight; - } - - xMarkMap[seriesIndex][i] = - y - (barWidthMap[seriesIndex] || barWidth) / 2; - if (xMarkMap[seriesIndex].min > value) { - xMarkMap[seriesIndex].min = value; - xMarkMap[seriesIndex].minX = x + barHeight; - xMarkMap[seriesIndex].minY = xMarkMap[seriesIndex][i]; - } - if (xMarkMap[seriesIndex].max < value) { - xMarkMap[seriesIndex].max = value; - xMarkMap[seriesIndex].maxX = x + barHeight; - xMarkMap[seriesIndex].maxY = xMarkMap[seriesIndex][i]; - } - xMarkMap[seriesIndex].sum += value; - xMarkMap[seriesIndex].counter++; - if (i % interval === 0) { barShape = this._getBarItem( - seriesIndex, i, categoryAxis.getNameByIndex(i), x, y - (barWidthMap[seriesIndex] || barWidth), barHeight, barWidthMap[seriesIndex] || barWidth, 'horizontal'); - this.shapeList.push(new RectangleShape(barShape)); + seriesIndex, i, value[0], x, y - barHeight / 2, barWidth, barHeight, orient); } - } + else { + // 柱形 + orient = 'vertical'; - // 补充空数据的拖拽提示框 - for (var m = 0, n = locationMap[j].length; m < n; m++) { - seriesIndex = locationMap[j][m]; - serie = series[seriesIndex]; - data = serie.data[i]; - value = typeof data != 'undefined' ? (typeof data.value != 'undefined' ? data.value : data) : '-'; - if (value != '-') { - // 只关心空数据 - continue; + if (value[1] > 0) { + // 正向 + barHeight = baseY - y; + } + else if (value[1] < 0) { + // 负向 + barHeight = y - baseY; + y -= barHeight; + } + else { + // 0值 + barHeight = 0; + } + barShape = this._getBarItem( + seriesIndex, i, value[0], x - barWidth / 2, y, barWidth, barHeight, orient); } + this.shapeList.push(new RectangleShape(barShape)); - if (this.deepQuery([data, serie, this.option], 'calculable')) { - x = lastXP; - lastXP += this.ecTheme.island.r; - barShape = this._getBarItem( - seriesIndex, i, categoryAxis.getNameByIndex(i), x + 0.5, y + 0.5 - (barWidthMap[seriesIndex] || barWidth), this.ecTheme.island.r - 1, (barWidthMap[seriesIndex] || barWidth) - 1, 'horizontal'); - barShape.hoverable = false; - barShape.draggable = false; - barShape.style.lineWidth = 1; - barShape.style.brushType = 'stroke'; - barShape.style.strokeColor = - serie.calculableHolderColor || this.ecTheme.calculableHolderColor; + x = xAxis.getCoord(value[0]); + y = yAxis.getCoord(value[1]); + if (xMarkMap[seriesIndex].min0 > value[0]) { + xMarkMap[seriesIndex].min0 = value[0]; + xMarkMap[seriesIndex].minY0 = y; + xMarkMap[seriesIndex].minX0 = x; + } + if (xMarkMap[seriesIndex].max0 < value[0]) { + xMarkMap[seriesIndex].max0 = value[0]; + xMarkMap[seriesIndex].maxY0 = y; + xMarkMap[seriesIndex].maxX0 = x; + } + xMarkMap[seriesIndex].sum0 += value[0]; + xMarkMap[seriesIndex].counter0++; - this.shapeList.push(new RectangleShape(barShape)); + if (xMarkMap[seriesIndex].min1 > value[1]) { + xMarkMap[seriesIndex].min1 = value[1]; + xMarkMap[seriesIndex].minY1 = y; + xMarkMap[seriesIndex].minX1 = x; + } + if (xMarkMap[seriesIndex].max1 < value[1]) { + xMarkMap[seriesIndex].max1 = value[1]; + xMarkMap[seriesIndex].maxY1 = y; + xMarkMap[seriesIndex].maxX1 = x; } + xMarkMap[seriesIndex].sum1 += value[1]; + xMarkMap[seriesIndex].counter1++; } - - y -= ((barWidthMap[seriesIndex] || barWidth) + barGap); } } - for (var j = 0, k = locationMap.length; j < k; j++) { - for (var m = 0, n = locationMap[j].length; m < n; m++) { - seriesIndex = locationMap[j][m]; - if (xMarkMap[seriesIndex].counter > 0) { - xMarkMap[seriesIndex].average = (xMarkMap[seriesIndex].sum / xMarkMap[seriesIndex].counter).toFixed(2) - 0; - } - - x = this.component.xAxis.getAxis(series[seriesIndex].xAxisIndex || 0).getCoord(xMarkMap[seriesIndex].average); - - xMarkMap[seriesIndex].averageLine = [ - [x, this.component.grid.getYend()], - [x, this.component.grid.getY()] - ]; - xMarkMap[seriesIndex].minLine = [ - [xMarkMap[seriesIndex].minX, this.component.grid.getYend()], - [xMarkMap[seriesIndex].minX, this.component.grid.getY()] - ]; - xMarkMap[seriesIndex].maxLine = [ - [xMarkMap[seriesIndex].maxX, this.component.grid.getYend()], - [xMarkMap[seriesIndex].maxX, this.component.grid.getY()] - ]; - - xMarkMap[seriesIndex].isHorizontal = false; - this.buildMark(seriesIndex); - } - } + this._calculMarkMapXY(xMarkMap, locationMap, 'xy'); }, /** @@ -549,73 +428,35 @@ Bar.prototype = { * @param {Array} locationMap 整形数据的系列索引 */ _mapSize: function (categoryAxis, locationMap, ignoreUserDefined) { - var series = this.series; - var seriesIndex; - var barWidthMap = {}; - var barMinHeightMap = {}; - var sBarWidth; - var sBarWidthCounter = 0; - var sBarWidthTotal = 0; - var barGap; - var barCategoryGap; - var hasFound; - var queryTarget; - var interval = 1; - - for (var j = 0, k = locationMap.length; j < k; j++) { - hasFound = false; // 同一堆积第一个barWidth生效 - for (var m = 0, n = locationMap[j].length; m < n; m++) { - seriesIndex = locationMap[j][m]; - queryTarget = series[seriesIndex]; - if (!ignoreUserDefined) { - if (!hasFound) { - sBarWidth = this.query( - queryTarget, 'barWidth'); - if (typeof sBarWidth != 'undefined') { - // 同一堆积第一个生效barWidth - barWidthMap[seriesIndex] = sBarWidth; - sBarWidthTotal += sBarWidth; - sBarWidthCounter++; - hasFound = true; - // 复位前面同一堆积但没被定义的 - for (var ii = 0, ll = m; ii < ll; ii++) { - var pSeriesIndex = locationMap[j][ii]; - barWidthMap[pSeriesIndex] = sBarWidth; - } - } - } else { - barWidthMap[seriesIndex] = sBarWidth; // 用找到的一个 - } - } - - barMinHeightMap[seriesIndex] = this.query( - queryTarget, 'barMinHeight'); - barGap = typeof barGap != 'undefined' ? barGap : this.query( - queryTarget, 'barGap'); - barCategoryGap = typeof barCategoryGap != 'undefined' ? barCategoryGap : this.query( - queryTarget, 'barCategoryGap'); - } - } + var res = this._findSpecialBarSzie(locationMap, ignoreUserDefined); + var barWidthMap = res.barWidthMap; + var barMaxWidthMap = res.barMaxWidthMap; + var barMinHeightMap = res.barMinHeightMap; + var sBarWidthCounter = res.sBarWidthCounter; // 用户指定 + var sBarWidthTotal = res.sBarWidthTotal; // 用户指定 + var barGap = res.barGap; + var barCategoryGap = res.barCategoryGap; var gap; var barWidth; + var interval = 1; if (locationMap.length != sBarWidthCounter) { // 至少存在一个自适应宽度的柱形图 if (!ignoreUserDefined) { - gap = typeof barCategoryGap == 'string' && barCategoryGap.match(/%$/) + gap = typeof barCategoryGap === 'string' && barCategoryGap.match(/%$/) // 百分比 - ? Math.floor( - categoryAxis.getGap() * (100 - parseFloat(barCategoryGap)) / 100) + ? ((categoryAxis.getGap() * (100 - parseFloat(barCategoryGap)) / 100).toFixed(2) - 0) // 数值 : (categoryAxis.getGap() - barCategoryGap); - if (typeof barGap == 'string' && barGap.match(/%$/)) { + if (typeof barGap === 'string' && barGap.match(/%$/)) { barGap = parseFloat(barGap) / 100; - barWidth = Math.floor((gap - sBarWidthTotal) / ((locationMap.length - 1) * barGap + locationMap.length - sBarWidthCounter)); - barGap = Math.floor(barWidth * barGap); + barWidth = +((gap - sBarWidthTotal) / ((locationMap.length - 1) * barGap + locationMap.length - sBarWidthCounter)).toFixed(2); + barGap = barWidth * barGap; } else { barGap = parseFloat(barGap); - barWidth = Math.floor((gap - sBarWidthTotal - barGap * (locationMap.length - 1)) / (locationMap.length - sBarWidthCounter)); + barWidth = +((gap - sBarWidthTotal - barGap * (locationMap.length - 1)) / ( + locationMap.length - sBarWidthCounter)).toFixed(2); } // 无法满足用户定义的宽度设计,忽略用户宽度,打回重做 if (barWidth <= 0) { @@ -626,7 +467,7 @@ Bar.prototype = { // 忽略用户定义的宽度设定 gap = categoryAxis.getGap(); barGap = 0; - barWidth = Math.floor(gap / locationMap.length); + barWidth = +(gap / locationMap.length).toFixed(2); // 已经忽略用户定义的宽度设定依然还无法满足显示,只能硬来了; if (barWidth <= 0) { interval = Math.floor(locationMap.length / gap); @@ -636,26 +477,127 @@ Bar.prototype = { } else { // 全是自定义宽度,barGap无效,系列间隔决定barGap - gap = sBarWidthCounter > 1 ? (typeof barCategoryGap == 'string' && barCategoryGap.match(/%$/)) + gap = sBarWidthCounter > 1 ? (typeof barCategoryGap === 'string' && barCategoryGap.match(/%$/)) // 百分比 - ? Math.floor( - categoryAxis.getGap() * (100 - parseFloat(barCategoryGap)) / 100) + ? +(categoryAxis.getGap() * (100 - parseFloat(barCategoryGap)) / 100).toFixed(2) // 数值 : (categoryAxis.getGap() - barCategoryGap) // 只有一个 : sBarWidthTotal; barWidth = 0; - barGap = sBarWidthCounter > 1 ? Math.floor((gap - sBarWidthTotal) / (sBarWidthCounter - 1)) : 0; + barGap = sBarWidthCounter > 1 ? +((gap - sBarWidthTotal) / (sBarWidthCounter - 1)).toFixed(2) : 0; if (barGap < 0) { // 无法满足用户定义的宽度设计,忽略用户宽度,打回重做 return this._mapSize(categoryAxis, locationMap, true); } } + // 检查是否满足barMaxWidthMap + + return this._recheckBarMaxWidth( + locationMap, barWidthMap, barMaxWidthMap, barMinHeightMap, gap, // 总宽度 + barWidth, barGap, interval); + }, + + /** + * 计算堆积下用户特殊指定的各种size + */ + _findSpecialBarSzie: function (locationMap, ignoreUserDefined) { + var series = this.series; + var barWidthMap = {}; + var barMaxWidthMap = {}; + var barMinHeightMap = {}; + var sBarWidth; // 用户指定 + var sBarMaxWidth; // 用户指定 + var sBarWidthCounter = 0; // 用户指定 + var sBarWidthTotal = 0; // 用户指定 + var barGap; + var barCategoryGap; + for (var j = 0, k = locationMap.length; j < k; j++) { + var hasFound = { + barWidth: false, + barMaxWidth: false + }; + for (var m = 0, n = locationMap[j].length; m < n; m++) { + var seriesIndex = locationMap[j][m]; + var queryTarget = series[seriesIndex]; + if (!ignoreUserDefined) { + if (!hasFound.barWidth) { + sBarWidth = this.query(queryTarget, 'barWidth'); + if (sBarWidth != null) { + // 同一堆积第一个生效barWidth + barWidthMap[seriesIndex] = sBarWidth; + sBarWidthTotal += sBarWidth; + sBarWidthCounter++; + hasFound.barWidth = true; + // 复位前面同一堆积但没被定义的 + for (var ii = 0, ll = m; ii < ll; ii++) { + var pSeriesIndex = locationMap[j][ii]; + barWidthMap[pSeriesIndex] = sBarWidth; + } + } + } + else { + barWidthMap[seriesIndex] = sBarWidth; // 用找到的一个 + } + + if (!hasFound.barMaxWidth) { + sBarMaxWidth = this.query(queryTarget, 'barMaxWidth'); + if (sBarMaxWidth != null) { + // 同一堆积第一个生效barMaxWidth + barMaxWidthMap[seriesIndex] = sBarMaxWidth; + hasFound.barMaxWidth = true; + // 复位前面同一堆积但没被定义的 + for (var ii = 0, ll = m; ii < ll; ii++) { + var pSeriesIndex = locationMap[j][ii]; + barMaxWidthMap[pSeriesIndex] = sBarMaxWidth; + } + } + } + else { + barMaxWidthMap[seriesIndex] = sBarMaxWidth; // 用找到的一个 + } + } + + barMinHeightMap[seriesIndex] = this.query(queryTarget, 'barMinHeight'); + barGap = barGap != null ? barGap : this.query(queryTarget, 'barGap'); + barCategoryGap = barCategoryGap != null ? barCategoryGap : this.query(queryTarget, 'barCategoryGap'); + } + } + + return { + barWidthMap: barWidthMap, + barMaxWidthMap: barMaxWidthMap, + barMinHeightMap: barMinHeightMap, + sBarWidth: sBarWidth, + sBarMaxWidth: sBarMaxWidth, + sBarWidthCounter: sBarWidthCounter, + sBarWidthTotal: sBarWidthTotal, + barGap: barGap, + barCategoryGap: barCategoryGap + }; + }, + + /** + * 检查是否满足barMaxWidthMap + */ + _recheckBarMaxWidth: function ( + locationMap, barWidthMap, barMaxWidthMap, barMinHeightMap, gap, // 总宽度 + barWidth, barGap, interval) { + for (var j = 0, k = locationMap.length; j < k; j++) { + var seriesIndex = locationMap[j][0]; + if (barMaxWidthMap[seriesIndex] && barMaxWidthMap[seriesIndex] < barWidth) { + // 不满足最大宽度 + gap -= barWidth - barMaxWidthMap[seriesIndex]; // 总宽度减少 + } + } + return { barWidthMap: barWidthMap, + barMaxWidthMap: barMaxWidthMap, barMinHeightMap: barMinHeightMap, gap: gap, + // 总宽度 barWidth: barWidth, barGap: barGap, interval: interval @@ -671,89 +613,93 @@ Bar.prototype = { var serie = series[seriesIndex]; var data = serie.data[dataIndex]; // 多级控制 - var defaultColor = this._sIndex2colorMap[seriesIndex]; + var defaultColor = this._sIndex2ColorMap[seriesIndex]; var queryTarget = [data, serie]; - var normalColor = this.deepQuery( - queryTarget, 'itemStyle.normal.color') || defaultColor; - var emphasisColor = this.deepQuery( - queryTarget, 'itemStyle.emphasis.color'); - var normal = this.deepMerge( - queryTarget, 'itemStyle.normal'); - var normalBorderWidth = normal.borderWidth; - var emphasis = this.deepMerge( - queryTarget, 'itemStyle.emphasis'); + + var normal = this.deepMerge(queryTarget, 'itemStyle.normal'); + var emphasis = this.deepMerge(queryTarget, 'itemStyle.emphasis'); + var normalBorderWidth = normal.barBorderWidth; + barShape = { - zlevel: this._zlevelBase, - clickable: true, + zlevel: this.getZlevelBase(), + z: this.getZBase(), + clickable: this.deepQuery(queryTarget, 'clickable'), style: { x: x, y: y, width: width, height: height, brushType: 'both', - color: this.getItemStyleColor(normalColor, seriesIndex, dataIndex, data), - radius: normal.borderRadius, + color: this.getItemStyleColor( + this.deepQuery(queryTarget, 'itemStyle.normal.color') || defaultColor, seriesIndex, dataIndex, data), + radius: normal.barBorderRadius, lineWidth: normalBorderWidth, - strokeColor: normal.borderColor + strokeColor: normal.barBorderColor }, highlightStyle: { - color: this.getItemStyleColor(emphasisColor, seriesIndex, dataIndex, data), - radius: emphasis.borderRadius, - lineWidth: emphasis.borderWidth, - strokeColor: emphasis.borderColor + color: this.getItemStyleColor( + this.deepQuery(queryTarget, 'itemStyle.emphasis.color'), seriesIndex, dataIndex, data), + radius: emphasis.barBorderRadius, + lineWidth: emphasis.barBorderWidth, + strokeColor: emphasis.barBorderColor }, _orient: orient }; - barShape.highlightStyle.color = barShape.highlightStyle.color || (typeof barShape.style.color == 'string' ? zrColor.lift(barShape.style.color, -0.3) : barShape.style.color); + var barShapeStyle = barShape.style; + barShape.highlightStyle.color = barShape.highlightStyle.color || (typeof barShapeStyle.color === 'string' ? zrColor.lift(barShapeStyle.color, -0.3) : barShapeStyle.color); + //亚像素优化 + barShapeStyle.x = Math.floor(barShapeStyle.x); + barShapeStyle.y = Math.floor(barShapeStyle.y); + barShapeStyle.height = Math.ceil(barShapeStyle.height); + barShapeStyle.width = Math.ceil(barShapeStyle.width); // 考虑线宽的显示优化 - if (normalBorderWidth > 0 && barShape.style.height > normalBorderWidth && barShape.style.width > normalBorderWidth) { - barShape.style.y += normalBorderWidth / 2; - barShape.style.height -= normalBorderWidth; - barShape.style.x += normalBorderWidth / 2; - barShape.style.width -= normalBorderWidth; + if (normalBorderWidth > 0 && barShapeStyle.height > normalBorderWidth && barShapeStyle.width > normalBorderWidth) { + barShapeStyle.y += normalBorderWidth / 2; + barShapeStyle.height -= normalBorderWidth; + barShapeStyle.x += normalBorderWidth / 2; + barShapeStyle.width -= normalBorderWidth; } else { // 太小了或者线宽小于0,废了边线 - barShape.style.brushType = 'fill'; + barShapeStyle.brushType = 'fill'; } barShape.highlightStyle.textColor = barShape.highlightStyle.color; barShape = this.addLabel(barShape, serie, data, name, orient); - if (barShape.style.textPosition == 'insideLeft' || barShape.style.textPosition == 'insideRight' || barShape.style.textPosition == 'insideTop' || barShape.style.textPosition == 'insideBottom') { + var textPosition = barShapeStyle.textPosition; + if (textPosition === 'insideLeft' || textPosition === 'insideRight' || textPosition === 'insideTop' || textPosition === 'insideBottom') { var gap = 5; - switch (barShape.style.textPosition) { + switch (textPosition) { case 'insideLeft': - barShape.style.textX = barShape.style.x + gap; - barShape.style.textY = barShape.style.y + barShape.style.height / 2; - barShape.style.textAlign = 'left'; - barShape.style.textBaseline = 'middle'; + barShapeStyle.textX = barShapeStyle.x + gap; + barShapeStyle.textY = barShapeStyle.y + barShapeStyle.height / 2; + barShapeStyle.textAlign = 'left'; + barShapeStyle.textBaseline = 'middle'; break; case 'insideRight': - barShape.style.textX = barShape.style.x + barShape.style.width - gap; - barShape.style.textY = barShape.style.y + barShape.style.height / 2; - barShape.style.textAlign = 'right'; - barShape.style.textBaseline = 'middle'; + barShapeStyle.textX = barShapeStyle.x + barShapeStyle.width - gap; + barShapeStyle.textY = barShapeStyle.y + barShapeStyle.height / 2; + barShapeStyle.textAlign = 'right'; + barShapeStyle.textBaseline = 'middle'; break; case 'insideTop': - barShape.style.textX = barShape.style.x + barShape.style.width / 2; - barShape.style.textY = barShape.style.y + gap / 2; - barShape.style.textAlign = 'center'; - barShape.style.textBaseline = 'top'; + barShapeStyle.textX = barShapeStyle.x + barShapeStyle.width / 2; + barShapeStyle.textY = barShapeStyle.y + gap / 2; + barShapeStyle.textAlign = 'center'; + barShapeStyle.textBaseline = 'top'; break; case 'insideBottom': - barShape.style.textX = barShape.style.x + barShape.style.width / 2; - barShape.style.textY = barShape.style.y + barShape.style.height - gap / 2; - barShape.style.textAlign = 'center'; - barShape.style.textBaseline = 'bottom'; + barShapeStyle.textX = barShapeStyle.x + barShapeStyle.width / 2; + barShapeStyle.textY = barShapeStyle.y + barShapeStyle.height - gap / 2; + barShapeStyle.textAlign = 'center'; + barShapeStyle.textBaseline = 'bottom'; break; } - barShape.style.textPosition = 'specific'; - barShape.style.textColor = barShape.style.textColor || '#fff'; + barShapeStyle.textPosition = 'specific'; + barShapeStyle.textColor = barShapeStyle.textColor || '#fff'; } - - if (this.deepQuery([data, serie, this.option], 'calculable')) { this.setCalculable(barShape); barShape.draggable = true; @@ -773,26 +719,27 @@ Bar.prototype = { var yAxis = this.component.yAxis.getAxis(serie.yAxisIndex); var dataIndex; var pos; - if (mpData.type && (mpData.type == 'max' || mpData.type == 'min' || mpData.type == 'average')) { + if (mpData.type && (mpData.type === 'max' || mpData.type === 'min' || mpData.type === 'average')) { // 特殊值内置支持 + var valueIndex = mpData.valueIndex != null ? mpData.valueIndex : xMarkMap.maxX0 != null ? '1' : ''; pos = [ - xMarkMap[mpData.type + 'X'], xMarkMap[mpData.type + 'Y'], xMarkMap[mpData.type + 'Line'], xMarkMap[mpData.type]]; + xMarkMap[mpData.type + 'X' + valueIndex], xMarkMap[mpData.type + 'Y' + valueIndex], xMarkMap[mpData.type + 'Line' + valueIndex], xMarkMap[mpData.type + valueIndex]]; } else if (xMarkMap.isHorizontal) { // 横向 - dataIndex = typeof mpData.xAxis == 'string' && xAxis.getIndexByName ? xAxis.getIndexByName(mpData.xAxis) : (mpData.xAxis || 0); + dataIndex = typeof mpData.xAxis === 'string' && xAxis.getIndexByName ? xAxis.getIndexByName(mpData.xAxis) : (mpData.xAxis || 0); var x = xMarkMap[dataIndex]; - x = typeof x != 'undefined' ? x : typeof mpData.xAxis != 'string' && xAxis.getCoordByIndex ? xAxis.getCoordByIndex(mpData.xAxis || 0) : xAxis.getCoord(mpData.xAxis || 0); + x = x != null ? x : typeof mpData.xAxis != 'string' && xAxis.getCoordByIndex ? xAxis.getCoordByIndex(mpData.xAxis || 0) : xAxis.getCoord(mpData.xAxis || 0); pos = [x, yAxis.getCoord(mpData.yAxis || 0)]; } else { // 纵向 - dataIndex = typeof mpData.yAxis == 'string' && yAxis.getIndexByName ? yAxis.getIndexByName(mpData.yAxis) : (mpData.yAxis || 0); + dataIndex = typeof mpData.yAxis === 'string' && yAxis.getIndexByName ? yAxis.getIndexByName(mpData.yAxis) : (mpData.yAxis || 0); var y = xMarkMap[dataIndex]; - y = typeof y != 'undefined' ? y : typeof mpData.yAxis != 'string' && yAxis.getCoordByIndex ? yAxis.getCoordByIndex(mpData.yAxis || 0) : yAxis.getCoord(mpData.yAxis || 0); + y = y != null ? y : typeof mpData.yAxis != 'string' && yAxis.getCoordByIndex ? yAxis.getCoordByIndex(mpData.yAxis || 0) : yAxis.getCoord(mpData.yAxis || 0); pos = [xAxis.getCoord(mpData.xAxis || 0), y]; } @@ -833,11 +780,11 @@ Bar.prototype = { seriesIndex = ecData.get(this.shapeList[i], 'seriesIndex'); if (aniMap[seriesIndex] && !aniMap[seriesIndex][3]) { // 有数据删除才有移动的动画 - if (this.shapeList[i].type == 'rectangle') { + if (this.shapeList[i].type === 'rectangle') { // 主动画 dataIndex = ecData.get(this.shapeList[i], 'dataIndex'); serie = series[seriesIndex]; - if (aniMap[seriesIndex][2] && dataIndex == serie.data.length - 1) { + if (aniMap[seriesIndex][2] && dataIndex === serie.data.length - 1) { // 队头加入删除末尾 this.zr.delShape(this.shapeList[i].id); continue; @@ -847,23 +794,21 @@ Bar.prototype = { this.zr.delShape(this.shapeList[i].id); continue; } - if (this.shapeList[i]._orient == 'horizontal') { + if (this.shapeList[i]._orient === 'horizontal') { // 条形图 - dy = this.component.yAxis.getAxis( - serie.yAxisIndex || 0).getGap(); + dy = this.component.yAxis.getAxis(serie.yAxisIndex || 0).getGap(); y = aniMap[seriesIndex][2] ? -dy : dy; x = 0; } else { // 柱形图 - dx = this.component.xAxis.getAxis( - serie.xAxisIndex || 0).getGap(); + dx = this.component.xAxis.getAxis(serie.xAxisIndex || 0).getGap(); x = aniMap[seriesIndex][2] ? dx : -dx; y = 0; } this.shapeList[i].position = [0, 0]; this.zr.animate(this.shapeList[i].id, '').when( - 500, { + this.query(this.option, 'animationDurationUpdate'), { position: [x, y] }).start(); } @@ -873,7 +818,6 @@ Bar.prototype = { }; zrUtil.inherits(Bar, ChartBase); -zrUtil.inherits(Bar, ComponentBase); // 图表注册 require('../chart.js').define('bar', Bar); diff --git a/src/chart/base.js b/src/chart/base.js index 11e8c95..5518ae4 100644 --- a/src/chart/base.js +++ b/src/chart/base.js @@ -2,7 +2,7 @@ * echarts图表基类 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ @@ -17,10 +17,15 @@ var ecData = require('../util/ecData.js'); var ecAnimation = require('../util/ecAnimation.js'); var ecEffect = require('../util/ecEffect.js'); var accMath = require('../util/accMath.js'); +var ComponentBase = require('../component/base.js'); + var zrUtil = require('../zrender/tool/util.js'); var zrArea = require('../zrender/tool/area.js'); -function Base() { +function Base(ecTheme, messageCenter, zr, option, myChart) { + + ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); + var self = this; this.selectedMap = {}; this.lastShapeList = []; @@ -41,24 +46,24 @@ function Base() { var lineWidth = highlightStyle.lineWidth; highlightStyle.brushType = 'stroke'; - highlightStyle.strokeColor = self.ecTheme.calculableColor; - highlightStyle.lineWidth = calculableShape.type == 'icon' ? 30 : 10; + highlightStyle.strokeColor = self.ecTheme.calculableColor || ecConfig.calculableColor; + highlightStyle.lineWidth = calculableShape.type === 'icon' ? 30 : 10; self.zr.addHoverShape(calculableShape); setTimeout(function () { // 复位 - if (calculableShape.highlightStyle) { - calculableShape.highlightStyle.brushType = brushType; - calculableShape.highlightStyle.strokeColor = strokeColor; - calculableShape.highlightStyle.lineWidth = lineWidth; + if (highlightStyle) { + highlightStyle.brushType = brushType; + highlightStyle.strokeColor = strokeColor; + highlightStyle.lineWidth = lineWidth; } }, 20); }, ondrop: function (param) { // 排除一些非数据的拖拽进入 - if (typeof ecData.get(param.dragged, 'data') != 'undefined') { + if (ecData.get(param.dragged, 'data') != null) { self.isDrop = true; } }, @@ -77,7 +82,7 @@ Base.prototype = { * 图形拖拽特性 */ setCalculable: function (shape) { - shape.dragEnableTime = this.ecTheme.DRAG_ENABLE_TIME; + shape.dragEnableTime = this.ecTheme.DRAG_ENABLE_TIME || ecConfig.DRAG_ENABLE_TIME; shape.ondragover = this.shapeHandler.ondragover; shape.ondragend = this.shapeHandler.ondragend; shape.ondrop = this.shapeHandler.ondrop; @@ -88,8 +93,8 @@ Base.prototype = { * 数据项被拖拽进来 */ ondrop: function (param, status) { - if (!this.isDrop || !param.target) { - // 没有在当前实例上发生拖拽行为则直接返回 + if (!this.isDrop || !param.target || status.dragIn) { + // 没有在当前实例上发生拖拽行为或者已经被认领了则直接返回 return; } var target = param.target; // 拖拽安放目标 @@ -100,22 +105,29 @@ Base.prototype = { var series = this.series; var data; var legend = this.component.legend; - if (dataIndex == -1) { + if (dataIndex === -1) { // 落到calculableCase上,数据被拖拽进某个饼图|雷达|漏斗,增加数据 + if (ecData.get(dragged, 'seriesIndex') == seriesIndex) { + // 自己拖拽到自己 + status.dragOut = status.dragIn = status.needRefresh = true; + this.isDrop = false; + return; + } + data = { value: ecData.get(dragged, 'value'), name: ecData.get(dragged, 'name') }; // 修饼图数值不为负值 - if (this.type == ecConfig.CHART_TYPE_PIE && data.value < 0) { + if (this.type === ecConfig.CHART_TYPE_PIE && data.value < 0) { data.value = 0; } var hasFind = false; var sData = series[seriesIndex].data; for (var i = 0, l = sData.length; i < l; i++) { - if (sData[i].name == data.name && sData[i].value == '-') { + if (sData[i].name === data.name && sData[i].value === '-') { series[seriesIndex].data[i].value = data.value; hasFind = true; } @@ -126,20 +138,20 @@ Base.prototype = { } else { // 落到数据item上,数据被拖拽到某个数据项上,数据修改 - data = this.option.series[seriesIndex].data[dataIndex] || '-'; - if (typeof data.value != 'undefined') { + data = series[seriesIndex].data[dataIndex] || '-'; + if (data.value != null) { if (data.value != '-') { - this.option.series[seriesIndex].data[dataIndex].value = + series[seriesIndex].data[dataIndex].value = accMath.accAdd( - this.option.series[seriesIndex].data[dataIndex].value, ecData.get(dragged, 'value')); + series[seriesIndex].data[dataIndex].value, ecData.get(dragged, 'value')); } else { - this.option.series[seriesIndex].data[dataIndex].value = + series[seriesIndex].data[dataIndex].value = ecData.get(dragged, 'value'); } - if (this.type == ecConfig.CHART_TYPE_FUNNEL || this.type == ecConfig.CHART_TYPE_PIE) { - legend && legend.getRelatedAmount(data.name) == 1 && this.component.legend.del(data.name); + if (this.type === ecConfig.CHART_TYPE_FUNNEL || this.type === ecConfig.CHART_TYPE_PIE) { + legend && legend.getRelatedAmount(data.name) === 1 && this.component.legend.del(data.name); data.name += this.option.nameConnector + ecData.get(dragged, 'name'); legend && legend.add( data.name, dragged.style.color || dragged.style.strokeColor); @@ -147,12 +159,12 @@ Base.prototype = { } else { if (data != '-') { - this.option.series[seriesIndex].data[dataIndex] = + series[seriesIndex].data[dataIndex] = accMath.accAdd( - this.option.series[seriesIndex].data[dataIndex], ecData.get(dragged, 'value')); + series[seriesIndex].data[dataIndex], ecData.get(dragged, 'value')); } else { - this.option.series[seriesIndex].data[dataIndex] = + series[seriesIndex].data[dataIndex] = ecData.get(dragged, 'value'); } } @@ -176,8 +188,8 @@ Base.prototype = { * 数据项被拖拽出去 */ ondragend: function (param, status) { - if (!this.isDragend || !param.target) { - // 没有在当前实例上发生拖拽行为则直接返回 + if (!this.isDragend || !param.target || status.dragOut) { + // 没有在当前实例上发生拖拽行为或者已经被认领了则直接返回 return; } var target = param.target; // 被拖拽图形元素 @@ -187,12 +199,13 @@ Base.prototype = { var series = this.series; // 删除被拖拽走的数据 - if (typeof series[seriesIndex].data[dataIndex].value != 'undefined') { + if (series[seriesIndex].data[dataIndex].value != null) { series[seriesIndex].data[dataIndex].value = '-'; // 清理可能有且唯一的legend data var name = series[seriesIndex].data[dataIndex].name; - if (this.component.legend && this.component.legend.getRelatedAmount(name) === 0) { - this.component.legend.del(name); + var legend = this.component.legend; + if (legend && legend.getRelatedAmount(name) === 0) { + legend.del(name); } } else { @@ -224,6 +237,244 @@ Base.prototype = { return; }, + /** + * 折线图、柱形图公用方法 + */ + _buildPosition: function () { + this._symbol = this.option.symbolList; + this._sIndex2ShapeMap = {}; // series拐点图形类型,seriesIndex索引到shape type + this._sIndex2ColorMap = {}; // series默认颜色索引,seriesIndex索引到color + this.selectedMap = {}; + this.xMarkMap = {}; + + var series = this.series; + // 水平垂直双向series索引 ,position索引到seriesIndex + var _position2sIndexMap = { + top: [], + bottom: [], + left: [], + right: [], + other: [] + }; + var xAxisIndex; + var yAxisIndex; + var xAxis; + var yAxis; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type === this.type) { + series[i] = this.reformOption(series[i]); + this.legendHoverLink = series[i].legendHoverLink || this.legendHoverLink; + xAxisIndex = series[i].xAxisIndex; + yAxisIndex = series[i].yAxisIndex; + xAxis = this.component.xAxis.getAxis(xAxisIndex); + yAxis = this.component.yAxis.getAxis(yAxisIndex); + if (xAxis.type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY) { + _position2sIndexMap[xAxis.getPosition()].push(i); + } + else if (yAxis.type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY) { + _position2sIndexMap[yAxis.getPosition()].push(i); + } + else { + _position2sIndexMap.other.push(i); + } + } + } + // console.log(_position2sIndexMap); + for (var position in _position2sIndexMap) { + if (_position2sIndexMap[position].length > 0) { + this._buildSinglePosition( + position, _position2sIndexMap[position]); + } + } + + this.addShapeList(); + }, + + /** + * 构建单个方向上的折线图、柱形图公用方法 + * + * @param {number} seriesIndex 系列索引 + */ + _buildSinglePosition: function (position, seriesArray) { + var mapData = this._mapData(seriesArray); + var locationMap = mapData.locationMap; + var maxDataLength = mapData.maxDataLength; + + if (maxDataLength === 0 || locationMap.length === 0) { + return; + } + switch (position) { + case 'bottom': + case 'top': + this._buildHorizontal(seriesArray, maxDataLength, locationMap, this.xMarkMap); + break; + case 'left': + case 'right': + this._buildVertical(seriesArray, maxDataLength, locationMap, this.xMarkMap); + break; + case 'other': + this._buildOther(seriesArray, maxDataLength, locationMap, this.xMarkMap); + break; + } + + for (var i = 0, l = seriesArray.length; i < l; i++) { + this.buildMark(seriesArray[i]); + } + }, + + /** + * 数据整形,折线图、柱形图公用方法 + * 数组位置映射到系列索引 + */ + _mapData: function (seriesArray) { + var series = this.series; + var serie; // 临时映射变量 + var dataIndex = 0; // 堆积数据所在位置映射 + var stackMap = {}; // 堆积数据位置映射,堆积组在二维中的第几项 + var magicStackKey = '__kener__stack__'; // 堆积命名,非堆积数据安单一堆积处理 + var stackKey; // 临时映射变量 + var serieName; // 临时映射变量 + var legend = this.component.legend; + var locationMap = []; // 需要返回的东西:数组位置映射到系列索引 + var maxDataLength = 0; // 需要返回的东西:最大数据长度 + var iconShape; + // 计算需要显示的个数和分配位置并记在下面这个结构里 + for (var i = 0, l = seriesArray.length; i < l; i++) { + serie = series[seriesArray[i]]; + serieName = serie.name; + + this._sIndex2ShapeMap[seriesArray[i]] = this._sIndex2ShapeMap[seriesArray[i]] || this.query(serie, 'symbol') || this._symbol[i % this._symbol.length]; + + if (legend) { + this.selectedMap[serieName] = legend.isSelected(serieName); + + this._sIndex2ColorMap[seriesArray[i]] = legend.getColor(serieName); + + iconShape = legend.getItemShape(serieName); + if (iconShape) { + // 回调legend,换一个更形象的icon + var style = iconShape.style; + if (this.type == ecConfig.CHART_TYPE_LINE) { + style.iconType = 'legendLineIcon'; + style.symbol = this._sIndex2ShapeMap[seriesArray[i]]; + } + else if (serie.itemStyle.normal.barBorderWidth > 0) { + var highlightStyle = iconShape.highlightStyle; + style.brushType = 'both'; + style.x += 1; + style.y += 1; + style.width -= 2; + style.height -= 2; + style.strokeColor = highlightStyle.strokeColor = serie.itemStyle.normal.barBorderColor; + highlightStyle.lineWidth = 3; + } + + legend.setItemShape(serieName, iconShape); + } + } + else { + this.selectedMap[serieName] = true; + this._sIndex2ColorMap[seriesArray[i]] = this.zr.getColor(seriesArray[i]); + } + + if (this.selectedMap[serieName]) { + stackKey = serie.stack || (magicStackKey + seriesArray[i]); + if (stackMap[stackKey] == null) { + stackMap[stackKey] = dataIndex; + locationMap[dataIndex] = [seriesArray[i]]; + dataIndex++; + } + else { + // 已经分配了位置就推进去就行 + locationMap[stackMap[stackKey]].push(seriesArray[i]); + } + } + // 兼职帮算一下最大长度 + maxDataLength = Math.max(maxDataLength, serie.data.length); + } +/* 调试输出 + var s = ''; + for (var i = 0, l = maxDataLength; i < l; i++) { + s = '['; + for (var j = 0, k = locationMap.length; j < k; j++) { + s +='[' + for (var m = 0, n = locationMap[j].length - 1; m < n; m++) { + s += series[locationMap[j][m]].data[i] + ',' + } + s += series[locationMap[j][locationMap[j].length - 1]] + .data[i]; + s += ']' + } + s += ']'; + console.log(s); + } + console.log(locationMap) + */ + + return { + locationMap: locationMap, + maxDataLength: maxDataLength + }; + }, + + _calculMarkMapXY: function (xMarkMap, locationMap, xy) { + var series = this.series; + for (var j = 0, k = locationMap.length; j < k; j++) { + for (var m = 0, n = locationMap[j].length; m < n; m++) { + var seriesIndex = locationMap[j][m]; + var valueIndex = xy == 'xy' ? 0 : ''; + var grid = this.component.grid; + var tarMark = xMarkMap[seriesIndex]; + + if (xy.indexOf('x') != '-1') { + if (tarMark['counter' + valueIndex] > 0) { + tarMark['average' + valueIndex] = + tarMark['sum' + valueIndex] / tarMark['counter' + valueIndex]; + } + + var x = this.component.xAxis.getAxis(series[seriesIndex].xAxisIndex || 0).getCoord(tarMark['average' + valueIndex]); + tarMark['averageLine' + valueIndex] = [ + [x, grid.getYend()], + [x, grid.getY()] + ]; + tarMark['minLine' + valueIndex] = [ + [tarMark['minX' + valueIndex], grid.getYend()], + [tarMark['minX' + valueIndex], grid.getY()] + ]; + tarMark['maxLine' + valueIndex] = [ + [tarMark['maxX' + valueIndex], grid.getYend()], + [tarMark['maxX' + valueIndex], grid.getY()] + ]; + + tarMark.isHorizontal = false; + } + + valueIndex = xy == 'xy' ? 1 : ''; + if (xy.indexOf('y') != '-1') { + if (tarMark['counter' + valueIndex] > 0) { + tarMark['average' + valueIndex] = + tarMark['sum' + valueIndex] / tarMark['counter' + valueIndex]; + } + var y = this.component.yAxis.getAxis(series[seriesIndex].yAxisIndex || 0).getCoord(tarMark['average' + valueIndex]); + tarMark['averageLine' + valueIndex] = [ + [grid.getX(), y], + [grid.getXend(), y] + ]; + tarMark['minLine' + valueIndex] = [ + [grid.getX(), tarMark['minY' + valueIndex]], + [grid.getXend(), tarMark['minY' + valueIndex]] + ]; + tarMark['maxLine' + valueIndex] = [ + [grid.getX(), tarMark['maxY' + valueIndex]], + [grid.getXend(), tarMark['maxY' + valueIndex]] + ]; + + tarMark.isHorizontal = true; + } + } + } + }, + /** * 添加文本 */ @@ -237,18 +488,24 @@ Base.prototype = { var eTextStyle = eLabel.textStyle || {}; if (nLabel.show) { - tarShape.style.text = this._getLabelText( + var style = tarShape.style; + style.text = this._getLabelText( serie, data, name, 'normal'); - tarShape.style.textPosition = typeof nLabel.position == 'undefined' ? (orient == 'horizontal' ? 'right' : 'top') : nLabel.position; - tarShape.style.textColor = nTextStyle.color; - tarShape.style.textFont = this.getFont(nTextStyle); + style.textPosition = nLabel.position == null ? (orient === 'horizontal' ? 'right' : 'top') : nLabel.position; + style.textColor = nTextStyle.color; + style.textFont = this.getFont(nTextStyle); + style.textAlign = nTextStyle.align; + style.textBaseline = nTextStyle.baseline; } if (eLabel.show) { - tarShape.highlightStyle.text = this._getLabelText( + var highlightStyle = tarShape.highlightStyle; + highlightStyle.text = this._getLabelText( serie, data, name, 'emphasis'); - tarShape.highlightStyle.textPosition = nLabel.show ? tarShape.style.textPosition : (typeof eLabel.position == 'undefined' ? (orient == 'horizontal' ? 'right' : 'top') : eLabel.position); - tarShape.highlightStyle.textColor = eTextStyle.color; - tarShape.highlightStyle.textFont = this.getFont(eTextStyle); + highlightStyle.textPosition = nLabel.show ? tarShape.style.textPosition : (eLabel.position == null ? (orient === 'horizontal' ? 'right' : 'top') : eLabel.position); + highlightStyle.textColor = eTextStyle.color; + highlightStyle.textFont = this.getFont(eTextStyle); + highlightStyle.textAlign = eTextStyle.align; + highlightStyle.textBaseline = eTextStyle.baseline; } return tarShape; @@ -259,27 +516,38 @@ Base.prototype = { */ _getLabelText: function (serie, data, name, status) { var formatter = this.deepQuery([data, serie], 'itemStyle.' + status + '.label.formatter'); - if (!formatter && status == 'emphasis') { + if (!formatter && status === 'emphasis') { // emphasis时需要看看normal下是否有formatter formatter = this.deepQuery([data, serie], 'itemStyle.normal.label.formatter'); } - var value = typeof data != 'undefined' ? (typeof data.value != 'undefined' ? data.value : data) : '-'; + var value = this.getDataFromOption(data, '-'); if (formatter) { - if (typeof formatter == 'function') { + if (typeof formatter === 'function') { return formatter.call( - this.myChart, serie.name, name, value); + this.myChart, { + seriesName: serie.name, + series: serie, + name: name, + value: value, + data: data, + status: status + }); } - else if (typeof formatter == 'string') { - formatter = formatter.replace('{a}', '{a0}').replace('{b}', '{b0}').replace('{c}', '{c0}'); - formatter = formatter.replace('{a0}', serie.name).replace('{b0}', name).replace('{c0}', value); + else if (typeof formatter === 'string') { + formatter = formatter.replace('{a}', '{a0}').replace('{b}', '{b0}').replace('{c}', '{c0}').replace('{a0}', serie.name).replace('{b0}', name).replace('{c0}', this.numAddCommas(value)); return formatter; } } else { - return value; + if (value instanceof Array) { + return value[2] != null ? this.numAddCommas(value[2]) : (value[0] + ' , ' + value[1]); + } + else { + return this.numAddCommas(value); + } } }, @@ -289,8 +557,8 @@ Base.prototype = { buildMark: function (seriesIndex) { var serie = this.series[seriesIndex]; if (this.selectedMap[serie.name]) { - serie.markPoint && this._buildMarkPoint(seriesIndex); serie.markLine && this._buildMarkLine(seriesIndex); + serie.markPoint && this._buildMarkPoint(seriesIndex); } }, @@ -300,34 +568,35 @@ Base.prototype = { _buildMarkPoint: function (seriesIndex) { var attachStyle = (this.markAttachStyle || {})[seriesIndex]; var serie = this.series[seriesIndex]; - var _zlevelBase = this.getZlevelBase(); var mpData; var pos; var markPoint = zrUtil.clone(serie.markPoint); for (var i = 0, l = markPoint.data.length; i < l; i++) { mpData = markPoint.data[i]; pos = this.getMarkCoord(seriesIndex, mpData); - markPoint.data[i].x = typeof mpData.x != 'undefined' ? mpData.x : pos[0]; - markPoint.data[i].y = typeof mpData.y != 'undefined' ? mpData.y : pos[1]; - if (mpData.type && (mpData.type == 'max' || mpData.type == 'min')) { + mpData.x = mpData.x != null ? mpData.x : pos[0]; + mpData.y = mpData.y != null ? mpData.y : pos[1]; + if (mpData.type && (mpData.type === 'max' || mpData.type === 'min')) { // 特殊值内置支持 - markPoint.data[i].value = pos[3]; - markPoint.data[i].name = mpData.name || mpData.type; - markPoint.data[i].symbolSize = markPoint.data[i].symbolSize || (zrArea.getTextWidth(pos[3], this.getFont()) / 2 + 5); + mpData.value = pos[3]; + mpData.name = mpData.name || mpData.type; + mpData.symbolSize = mpData.symbolSize || (zrArea.getTextWidth(pos[3], this.getFont()) / 2 + 5); } } var shapeList = this._markPoint(seriesIndex, markPoint); for (var i = 0, l = shapeList.length; i < l; i++) { - shapeList[i].zlevel = _zlevelBase + 1; + var tarShape = shapeList[i]; + tarShape.zlevel = this.getZlevelBase(); + tarShape.z = this.getZBase() + 1; for (var key in attachStyle) { - shapeList[i][key] = zrUtil.clone(attachStyle[key]); + tarShape[key] = zrUtil.clone(attachStyle[key]); } - this.shapeList.push(shapeList[i]); + this.shapeList.push(tarShape); } // 个别特殊图表需要自己addShape - if (this.type == ecConfig.CHART_TYPE_FORCE || this.type == ecConfig.CHART_TYPE_CHORD) { + if (this.type === ecConfig.CHART_TYPE_FORCE || this.type === ecConfig.CHART_TYPE_CHORD) { for (var i = 0, l = shapeList.length; i < l; i++) { this.zr.addShape(shapeList[i]); } @@ -340,19 +609,18 @@ Base.prototype = { _buildMarkLine: function (seriesIndex) { var attachStyle = (this.markAttachStyle || {})[seriesIndex]; var serie = this.series[seriesIndex]; - var _zlevelBase = this.getZlevelBase(); - var mlData; var pos; var markLine = zrUtil.clone(serie.markLine); for (var i = 0, l = markLine.data.length; i < l; i++) { - mlData = markLine.data[i]; - if (mlData.type && (mlData.type == 'max' || mlData.type == 'min' || mlData.type == 'average')) { + var mlData = markLine.data[i]; + if (mlData.type && (mlData.type === 'max' || mlData.type === 'min' || mlData.type === 'average')) { // 特殊值内置支持 pos = this.getMarkCoord(seriesIndex, mlData); markLine.data[i] = [zrUtil.clone(mlData), {}]; markLine.data[i][0].name = mlData.name || mlData.type; - markLine.data[i][0].value = pos[3]; + markLine.data[i][0].value = mlData.type !== 'average' ? pos[3] : +pos[3].toFixed( + markLine.precision != null ? markLine.precision : this.deepQuery([this.ecTheme, ecConfig], 'markLine.precision')); pos = pos[2]; mlData = [{}, {}]; @@ -361,24 +629,29 @@ Base.prototype = { pos = [ this.getMarkCoord(seriesIndex, mlData[0]), this.getMarkCoord(seriesIndex, mlData[1])]; } - - markLine.data[i][0].x = typeof mlData[0].x != 'undefined' ? mlData[0].x : pos[0][0]; - markLine.data[i][0].y = typeof mlData[0].y != 'undefined' ? mlData[0].y : pos[0][1]; - markLine.data[i][1].x = typeof mlData[1].x != 'undefined' ? mlData[1].x : pos[1][0]; - markLine.data[i][1].y = typeof mlData[1].y != 'undefined' ? mlData[1].y : pos[1][1]; + if (pos == null || pos[0] == null || pos[1] == null) { + // 不在显示区域内 + continue; + } + markLine.data[i][0].x = mlData[0].x != null ? mlData[0].x : pos[0][0]; + markLine.data[i][0].y = mlData[0].y != null ? mlData[0].y : pos[0][1]; + markLine.data[i][1].x = mlData[1].x != null ? mlData[1].x : pos[1][0]; + markLine.data[i][1].y = mlData[1].y != null ? mlData[1].y : pos[1][1]; } var shapeList = this._markLine(seriesIndex, markLine); for (var i = 0, l = shapeList.length; i < l; i++) { - shapeList[i].zlevel = _zlevelBase + 1; + var tarShape = shapeList[i]; + tarShape.zlevel = this.getZlevelBase(); + tarShape.z = this.getZBase() + 1; for (var key in attachStyle) { - shapeList[i][key] = zrUtil.clone(attachStyle[key]); + tarShape[key] = zrUtil.clone(attachStyle[key]); } - this.shapeList.push(shapeList[i]); + this.shapeList.push(tarShape); } // 个别特殊图表需要自己addShape - if (this.type == ecConfig.CHART_TYPE_FORCE || this.type == ecConfig.CHART_TYPE_CHORD) { + if (this.type === ecConfig.CHART_TYPE_FORCE || this.type === ecConfig.CHART_TYPE_CHORD) { for (var i = 0, l = shapeList.length; i < l; i++) { this.zr.addShape(shapeList[i]); } @@ -392,7 +665,9 @@ Base.prototype = { var serie = this.series[seriesIndex]; var component = this.component; zrUtil.merge( - mpOption, this.ecTheme.markPoint); + zrUtil.merge( + mpOption, zrUtil.clone(this.ecTheme.markPoint || {})), zrUtil.clone(ecConfig.markPoint)); + mpOption.name = serie.name; var pList = []; @@ -412,7 +687,10 @@ Base.prototype = { if (!mpOption.large) { for (var i = 0, l = data.length; i < l; i++) { - value = typeof data[i] != 'undefined' && typeof data[i].value != 'undefined' ? data[i].value : ''; + if (data[i].x == null || data[i].y == null) { + continue; + } + value = data[i].value != null ? data[i].value : ''; // 图例 if (legend) { color = legend.getColor(serie.name); @@ -422,21 +700,21 @@ Base.prototype = { color = isNaN(value) ? color : dataRange.getColor(value); queryTarget = [data[i], mpOption]; - nColor = this.deepQuery( - queryTarget, 'itemStyle.normal.color') || color; - eColor = this.deepQuery( - queryTarget, 'itemStyle.emphasis.color') || nColor; + nColor = this.deepQuery(queryTarget, 'itemStyle.normal.color') || color; + eColor = this.deepQuery(queryTarget, 'itemStyle.emphasis.color') || nColor; // 有值域,并且值域返回null且用户没有自己定义颜色,则隐藏这个mark if (nColor == null && eColor == null) { continue; } } + color = color == null ? this.zr.getColor(seriesIndex) : color; + // 标准化一些参数 - data[i].tooltip = data[i].tooltip || { + data[i].tooltip = data[i].tooltip || mpOption.tooltip || { trigger: 'item' }; // tooltip.trigger指定为item - data[i].name = typeof data[i].name != 'undefined' ? data[i].name : ''; + data[i].name = data[i].name != null ? data[i].name : ''; data[i].value = value; // 复用getSymbolShape @@ -455,7 +733,7 @@ Base.prototype = { itemShape.effect = effect; } - if (serie.type == ecConfig.CHART_TYPE_MAP) { + if (serie.type === ecConfig.CHART_TYPE_MAP) { itemShape._geo = this.getMarkGeo(data[i]); } @@ -481,7 +759,9 @@ Base.prototype = { var serie = this.series[seriesIndex]; var component = this.component; zrUtil.merge( - mlOption, this.ecTheme.markLine); + zrUtil.merge( + mlOption, zrUtil.clone(this.ecTheme.markLine || {})), zrUtil.clone(ecConfig.markLine)); + // 标准化一些同时支持Array和String的参数 mlOption.symbol = mlOption.symbol instanceof Array ? mlOption.symbol.length > 1 ? mlOption.symbol : [mlOption.symbol[0], mlOption.symbol[0]] : [mlOption.symbol, mlOption.symbol]; mlOption.symbolSize = mlOption.symbolSize instanceof Array ? mlOption.symbolSize.length > 1 ? mlOption.symbolSize : [mlOption.symbolSize[0], mlOption.symbolSize[0]] : [mlOption.symbolSize, mlOption.symbolSize]; @@ -505,22 +785,23 @@ Base.prototype = { var zrHeight = this.zr.getHeight(); var mergeData; for (var i = 0, l = data.length; i < l; i++) { - // 图例 - if (legend) { - color = legend.getColor(serie.name); + var mlData = data[i]; + if (mlData[0].x == null || mlData[0].y == null || mlData[1].x == null || mlData[1].y == null) { + continue; } + + color = legend ? legend.getColor(serie.name) : this.zr.getColor(seriesIndex); + // 组装一个mergeData - mergeData = this.deepMerge(data[i]); - value = typeof mergeData != 'undefined' && typeof mergeData.value != 'undefined' ? mergeData.value : ''; + mergeData = this.deepMerge(mlData); + value = mergeData.value != null ? mergeData.value : ''; // 值域 if (dataRange) { color = isNaN(value) ? color : dataRange.getColor(value); queryTarget = [mergeData, mlOption]; - nColor = this.deepQuery( - queryTarget, 'itemStyle.normal.color') || color; - eColor = this.deepQuery( - queryTarget, 'itemStyle.emphasis.color') || nColor; + nColor = this.deepQuery(queryTarget, 'itemStyle.normal.color') || color; + eColor = this.deepQuery(queryTarget, 'itemStyle.emphasis.color') || nColor; // 有值域,并且值域返回null且用户没有自己定义颜色,则隐藏这个mark if (nColor == null && eColor == null) { continue; @@ -528,20 +809,20 @@ Base.prototype = { } // 标准化一些参数 - data[i][0].tooltip = mergeData.tooltip || { + mlData[0].tooltip = mergeData.tooltip || mlOption.tooltip || { trigger: 'item' }; // tooltip.trigger指定为item - data[i][0].name = typeof data[i][0].name != 'undefined' ? data[i][0].name : ''; - data[i][1].name = typeof data[i][1].name != 'undefined' ? data[i][1].name : ''; - data[i][0].value = typeof data[i][0].value != 'undefined' ? data[i][0].value : ''; + mlData[0].name = mlData[0].name != null ? mlData[0].name : ''; + mlData[1].name = mlData[1].name != null ? mlData[1].name : ''; + mlData[0].value = value; itemShape = this.getLineMarkShape( mlOption, // markLine - seriesIndex, data[i], // 数据 - i, this.parsePercent(data[i][0].x, zrWidth), // 坐标 - this.parsePercent(data[i][0].y, zrHeight), // 坐标 - this.parsePercent(data[i][1].x, zrWidth), // 坐标 - this.parsePercent(data[i][1].y, zrHeight), // 坐标 + seriesIndex, mlData, // 数据 + i, this.parsePercent(mlData[0].x, zrWidth), // 坐标 + this.parsePercent(mlData[0].y, zrHeight), // 坐标 + this.parsePercent(mlData[1].x, zrWidth), // 坐标 + this.parsePercent(mlData[1].y, zrHeight), // 坐标 color // 默认symbol和color ); itemShape._mark = 'line'; @@ -551,14 +832,16 @@ Base.prototype = { itemShape.effect = effect; } - if (serie.type == ecConfig.CHART_TYPE_MAP) { + if (serie.type === ecConfig.CHART_TYPE_MAP) { itemShape._geo = [ - this.getMarkGeo(data[i][0]), this.getMarkGeo(data[i][1])]; + this.getMarkGeo(mlData[0]), this.getMarkGeo(mlData[1])]; } // 重新pack一下数据 ecData.pack( - itemShape, serie, seriesIndex, data[i][0], i, data[i][0].name + (data[i][1].name !== '' ? (' > ' + data[i][1].name) : ''), value); + itemShape, serie, seriesIndex, mlData[0], i, mlData[0].name + // 不要帮我代码规范 + + (mlData[1].name !== '' ? (' > ' + mlData[1].name) : ''), value); pList.push(itemShape); } //console.log(pList); @@ -582,23 +865,23 @@ Base.prototype = { orient // 走向,用于默认文字定位 ) { var queryTarget = [data, serie]; - var value = typeof data != 'undefined' ? (typeof data.value != 'undefined' ? data.value : data) : '-'; + var value = this.getDataFromOption(data, '-'); symbol = this.deepQuery(queryTarget, 'symbol') || symbol; var symbolSize = this.deepQuery(queryTarget, 'symbolSize'); - symbolSize = typeof symbolSize == 'function' ? symbolSize(value) : symbolSize; + symbolSize = typeof symbolSize === 'function' ? symbolSize(value) : symbolSize; var symbolRotate = this.deepQuery(queryTarget, 'symbolRotate'); var normal = this.deepMerge( queryTarget, 'itemStyle.normal'); var emphasis = this.deepMerge( queryTarget, 'itemStyle.emphasis'); - var nBorderWidth = typeof normal.borderWidth != 'undefined' ? normal.borderWidth : (normal.lineStyle && normal.lineStyle.width); - if (typeof nBorderWidth == 'undefined') { + var nBorderWidth = normal.borderWidth != null ? normal.borderWidth : (normal.lineStyle && normal.lineStyle.width); + if (nBorderWidth == null) { nBorderWidth = symbol.match('empty') ? 2 : 0; } - var eBorderWidth = typeof emphasis.borderWidth != 'undefined' ? emphasis.borderWidth : (emphasis.lineStyle && emphasis.lineStyle.width); - if (typeof eBorderWidth == 'undefined') { + var eBorderWidth = emphasis.borderWidth != null ? emphasis.borderWidth : (emphasis.lineStyle && emphasis.lineStyle.width); + if (eBorderWidth == null) { eBorderWidth = nBorderWidth + 2; } @@ -619,20 +902,19 @@ Base.prototype = { strokeColor: emphasis.borderColor || normal.borderColor || this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) || color, lineWidth: eBorderWidth }, - clickable: true + clickable: this.deepQuery(queryTarget, 'clickable') }); if (symbol.match('image')) { - itemShape.style.image = - symbol.replace(new RegExp('^image:\\/\\/'), ''); + itemShape.style.image = symbol.replace(new RegExp('^image:\\/\\/'), ''); itemShape = new ImageShape({ style: itemShape.style, highlightStyle: itemShape.highlightStyle, - clickable: true + clickable: this.deepQuery(queryTarget, 'clickable') }); } - if (typeof symbolRotate != 'undefined') { + if (symbolRotate != null) { itemShape.rotation = [ symbolRotate * Math.PI / 180, x, y]; } @@ -642,7 +924,7 @@ Base.prototype = { itemShape.style.n = (symbol.replace('empty', '').replace('star', '') - 0) || 5; } - if (symbol == 'none') { + if (symbol === 'none') { itemShape.invisible = true; itemShape.hoverable = false; } @@ -658,10 +940,10 @@ Base.prototype = { itemShape, serie, data, name, orient); if (symbol.match('empty')) { - if (typeof itemShape.style.textColor == 'undefined') { + if (itemShape.style.textColor == null) { itemShape.style.textColor = itemShape.style.strokeColor; } - if (typeof itemShape.highlightStyle.textColor == 'undefined') { + if (itemShape.highlightStyle.textColor == null) { itemShape.highlightStyle.textColor = itemShape.highlightStyle.strokeColor; } @@ -691,18 +973,18 @@ Base.prototype = { xEnd, yEnd, // 坐标 color // 默认color,来自legend或dataRange全局分配 ) { - var value0 = typeof data[0] != 'undefined' ? (typeof data[0].value != 'undefined' ? data[0].value : data[0]) : '-'; - var value1 = typeof data[1] != 'undefined' ? (typeof data[1].value != 'undefined' ? data[1].value : data[1]) : '-'; + var value0 = data[0].value != null ? data[0].value : '-'; + var value1 = data[1].value != null ? data[1].value : '-'; var symbol = [ this.query(data[0], 'symbol') || mlOption.symbol[0], this.query(data[1], 'symbol') || mlOption.symbol[1]]; var symbolSize = [ this.query(data[0], 'symbolSize') || mlOption.symbolSize[0], this.query(data[1], 'symbolSize') || mlOption.symbolSize[1]]; - symbolSize[0] = typeof symbolSize[0] == 'function' ? symbolSize[0](value0) : symbolSize[0]; - symbolSize[1] = typeof symbolSize[1] == 'function' ? symbolSize[1](value1) : symbolSize[1]; + symbolSize[0] = typeof symbolSize[0] === 'function' ? symbolSize[0](value0) : symbolSize[0]; + symbolSize[1] = typeof symbolSize[1] === 'function' ? symbolSize[1](value1) : symbolSize[1]; var symbolRotate = [ this.query(data[0], 'symbolRotate') || mlOption.symbolRotate[0], this.query(data[1], 'symbolRotate') || mlOption.symbolRotate[1]]; //console.log(symbol, symbolSize, symbolRotate); - var queryTarget = [data[0], mlOption]; + var queryTarget = [data[0], data[1], mlOption]; var normal = this.deepMerge( queryTarget, 'itemStyle.normal'); normal.color = this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data); @@ -714,26 +996,22 @@ Base.prototype = { var elineStyle = emphasis.lineStyle; var nBorderWidth = nlineStyle.width; - if (typeof nBorderWidth == 'undefined') { + if (nBorderWidth == null) { nBorderWidth = normal.borderWidth; } var eBorderWidth = elineStyle.width; - if (typeof eBorderWidth == 'undefined') { - if (typeof emphasis.borderWidth != 'undefined') { - eBorderWidth = emphasis.borderWidth; - } - else { - eBorderWidth = nBorderWidth + 2; - } + if (eBorderWidth == null) { + eBorderWidth = emphasis.borderWidth != null ? emphasis.borderWidth : (nBorderWidth + 2); } var itemShape = new MarkLineShape({ style: { - smooth: mlOption.smooth ? 'spline' : false, + smooth: this.deepQuery([data[0], data[1], mlOption], 'smooth') ? 'spline' : false, + smoothRadian: this.deepQuery([data[0], data[1], mlOption], 'smoothRadian'), symbol: symbol, symbolSize: symbolSize, symbolRotate: symbolRotate, - //data : [data[0].name,data[1].name], + // data: [data[0].name,data[1].name], xStart: xStart, yStart: yStart, // 坐标 @@ -761,9 +1039,9 @@ Base.prototype = { strokeColor: elineStyle.color || nlineStyle.color || emphasis.borderColor || normal.borderColor || emphasis.color || normal.color || color, lineWidth: eBorderWidth, symbolBorderColor: emphasis.borderColor || normal.borderColor || emphasis.color || normal.color || color, - symbolBorder: typeof emphasis.borderWidth == 'undefined' ? (normal.borderWidth + 2) : (emphasis.borderWidth) + symbolBorder: emphasis.borderWidth == null ? (normal.borderWidth + 2) : (emphasis.borderWidth) }, - clickable: true + clickable: this.deepQuery(queryTarget, 'clickable') }); itemShape = this.addLabel( @@ -799,13 +1077,11 @@ Base.prototype = { } // 值域 if (dataRange) { - value = typeof data[0] != 'undefined' ? (typeof data[0].value != 'undefined' ? data[0].value : data[0]) : '-'; + value = data[0].value != null ? data[0].value : ''; color = isNaN(value) ? color : dataRange.getColor(value); - nColor = this.deepQuery( - queryTarget, 'itemStyle.normal.color') || color; - eColor = this.deepQuery( - queryTarget, 'itemStyle.emphasis.color') || nColor; + nColor = this.deepQuery(queryTarget, 'itemStyle.normal.color') || color; + eColor = this.deepQuery(queryTarget, 'itemStyle.emphasis.color') || nColor; // 有值域,并且值域返回null且用户没有自己定义颜色,则隐藏这个mark if (nColor == null && eColor == null) { return; @@ -827,7 +1103,7 @@ Base.prototype = { color: color, strokeColor: color, shadowColor: effect.shadowColor || color, - shadowBlur: (typeof effect.shadowBlur != 'undefined' ? effect.shadowBlur : 8) * devicePixelRatio, + shadowBlur: (effect.shadowBlur != null ? effect.shadowBlur : 8) * devicePixelRatio, size: this.deepQuery(queryTarget, 'symbolSize'), iconType: symbol, brushType: 'fill', @@ -858,8 +1134,10 @@ Base.prototype = { var maxLenth = this.option.animationThreshold / (this.canvasSupported ? 2 : 4); var lastShapeList = this.lastShapeList; var shapeList = this.shapeList; - var duration = lastShapeList.length > 0 ? 500 : this.query(this.option, 'animationDuration'); + var isUpdate = lastShapeList.length > 0; + var duration = isUpdate ? this.query(this.option, 'animationDurationUpdate') : this.query(this.option, 'animationDuration'); var easing = this.query(this.option, 'animationEasing'); + var delay; var key; var oldMap = {}; var newMap = {}; @@ -872,7 +1150,14 @@ Base.prototype = { } else { key += lastShapeList[i].type; - oldMap[key] = lastShapeList[i]; + // https://github.com/ecomfe/echarts/issues/1219#issuecomment-71987602 + // 响应中断可能产生的重复元素 + if (oldMap[key]) { + this.zr.delShape(lastShapeList[i].id); + } + else { + oldMap[key] = lastShapeList[i]; + } } } for (var i = 0, l = shapeList.length; i < l; i++) { @@ -896,12 +1181,15 @@ Base.prototype = { if (oldMap[key]) { // 新旧都有 动画过渡 this.zr.delShape(oldMap[key].id); - this._animateMod(oldMap[key], newMap[key], duration, easing); + this._animateMod( + oldMap[key], newMap[key], duration, easing, 0, isUpdate); } else { // 新有旧没有 添加并动画过渡 //this._animateAdd(newMap[key], duration, easing); - this._animateMod(false, newMap[key], duration, easing); + delay = (this.type == ecConfig.CHART_TYPE_LINE || this.type == ecConfig.CHART_TYPE_RADAR) && key.indexOf('icon') !== 0 ? duration / 2 : 0; + this._animateMod( + false, newMap[key], duration, easing, delay, isUpdate); } } this.zr.refresh(); @@ -920,7 +1208,7 @@ Base.prototype = { _getAnimationKey: function (shape) { if (this.type != ecConfig.CHART_TYPE_MAP) { - return ecData.get(shape, 'seriesIndex') + '_' + ecData.get(shape, 'dataIndex') + (shape._mark ? shape._mark : '') + (this.type == ecConfig.CHART_TYPE_RADAR ? ecData.get(shape, 'special') : ''); + return ecData.get(shape, 'seriesIndex') + '_' + ecData.get(shape, 'dataIndex') + (shape._mark ? shape._mark : '') + (this.type === ecConfig.CHART_TYPE_RADAR ? ecData.get(shape, 'special') : ''); } else { return ecData.get(shape, 'seriesIndex') + '_' + ecData.get(shape, 'dataIndex') + (shape._mark ? shape._mark : 'undefined'); @@ -930,20 +1218,21 @@ Base.prototype = { /** * 动画过渡 */ - _animateMod: function (oldShape, newShape, duration, easing) { + _animateMod: function (oldShape, newShape, duration, easing, delay, isUpdate) { switch (newShape.type) { - case 'broken-line': + case 'polyline': case 'half-smooth-polygon': ecAnimation.pointList(this.zr, oldShape, newShape, duration, easing); break; case 'rectangle': ecAnimation.rectangle(this.zr, oldShape, newShape, duration, easing); break; + case 'image': case 'icon': - ecAnimation.icon(this.zr, oldShape, newShape, duration, easing); + ecAnimation.icon(this.zr, oldShape, newShape, duration, easing, delay); break; case 'candle': - if (duration > 500) { + if (!isUpdate) { ecAnimation.candle(this.zr, oldShape, newShape, duration, easing); } else { @@ -953,12 +1242,12 @@ Base.prototype = { case 'ring': case 'sector': case 'circle': - if (duration > 500) { + if (!isUpdate) { // 进入动画,加旋转 ecAnimation.ring( this.zr, oldShape, newShape, duration + ((ecData.get(newShape, 'dataIndex') || 0) % 20 * 100), easing); } - else if (newShape.type == 'sector') { + else if (newShape.type === 'sector') { ecAnimation.sector(this.zr, oldShape, newShape, duration, easing); } else { @@ -969,15 +1258,15 @@ Base.prototype = { ecAnimation.text(this.zr, oldShape, newShape, duration, easing); break; case 'polygon': - if (duration > 500) { + if (!isUpdate) { ecAnimation.polygon(this.zr, oldShape, newShape, duration, easing); } else { ecAnimation.pointList(this.zr, oldShape, newShape, duration, easing); } break; - case 'chord': - ecAnimation.chord(this.zr, oldShape, newShape, duration, easing); + case 'ribbon': + ecAnimation.ribbon(this.zr, oldShape, newShape, duration, easing); break; case 'gauge-pointer': ecAnimation.gaugePointer(this.zr, oldShape, newShape, duration, easing); @@ -985,6 +1274,7 @@ Base.prototype = { case 'mark-line': ecAnimation.markline(this.zr, oldShape, newShape, duration, easing); break; + case 'bezier-curve': case 'line': ecAnimation.line(this.zr, oldShape, newShape, duration, easing); break; @@ -998,7 +1288,7 @@ Base.prototype = { * 标注动画 * @param {number} duration 时长 * @param {string=} easing 缓动效果 - * @param {Array=} addShapeList 指定特效对象,不知道默认使用this.shapeList + * @param {Array=} addShapeList 指定特效对象,不指定默认使用this.shapeList */ animationMark: function (duration, easing, addShapeList) { var shapeList = addShapeList || this.shapeList; @@ -1006,7 +1296,7 @@ Base.prototype = { if (!shapeList[i]._mark) { continue; } - this._animateMod(false, shapeList[i], duration, easing); + this._animateMod(false, shapeList[i], duration, easing, 0, true); } this.animationEffect(addShapeList); }, @@ -1018,6 +1308,9 @@ Base.prototype = { animationEffect: function (addShapeList) { !addShapeList && this.clearEffectShape(); var shapeList = addShapeList || this.shapeList; + if (shapeList == null) { + return; + } var zlevel = ecConfig.EFFECT_ZLEVEL; if (this.canvasSupported) { this.zr.modLayer( @@ -1057,7 +1350,7 @@ Base.prototype = { addMark: function (seriesIndex, markData, markType) { var serie = this.series[seriesIndex]; if (this.selectedMap[serie.name]) { - var duration = 500; + var duration = this.query(this.option, 'animationDurationUpdate'); var easing = this.query(this.option, 'animationEasing'); // 备份,复用_buildMarkX var oriMarkData = serie[markType].data; @@ -1065,14 +1358,16 @@ Base.prototype = { serie[markType].data = markData.data; this['_build' + markType.replace('m', 'M')](seriesIndex); - for (var i = lastLength, l = this.shapeList.length; i < l; i++) { - this.zr.addShape(this.shapeList[i]); - } - this.zr.refresh(); - if (this.option.animation && !this.option.renderAsImage) { + // animationMark就会addShape this.animationMark(duration, easing, this.shapeList.slice(lastLength)); } + else { + for (var i = lastLength, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + this.zr.refreshNextFrame(); + } // 还原,复用_buildMarkX serie[markType].data = oriMarkData; } @@ -1102,9 +1397,11 @@ Base.prototype = { } } - needRefresh && this.zr.refresh(); + needRefresh && this.zr.refreshNextFrame(); } } }; +zrUtil.inherits(Base, ComponentBase); + module.exports = Base; \ No newline at end of file diff --git a/src/chart/chord.js b/src/chart/chord.js index 17f2841..08afcee 100644 --- a/src/chart/chord.js +++ b/src/chart/chord.js @@ -3,33 +3,127 @@ * echarts图表类:chord diagram * * @author pissang (https://github.com/pissang/) - * + * + * TODO 非Ribbon Type 支持 undirected graph ? */ -var ComponentBase = require('../component/base.js'); var ChartBase = require('./base.js'); // 图形依赖 var TextShape = require('../zrender/shape/Text.js'); var LineShape = require('../zrender/shape/Line.js'); var SectorShape = require('../zrender/shape/Sector.js'); -var ChordShape = require('../util/shape/Chord.js'); +var RibbonShape = require('../util/shape/Ribbon.js'); +var IconShape = require('../util/shape/Icon.js'); +var BezierCurveShape = require('../zrender/shape/BezierCurve.js'); var ecConfig = require('../config.js'); +// 和弦图默认参数 +ecConfig.chord = { + zlevel: 0, + // 一级层叠 + z: 2, + // 二级层叠 + clickable: true, + radius: ['65%', '75%'], + center: ['50%', '50%'], + padding: 2, + sort: 'none', + // can be 'none', 'ascending', 'descending' + sortSub: 'none', + // can be 'none', 'ascending', 'descending' + startAngle: 90, + clockWise: true, + ribbonType: true, + + /***************** 下面的配置项在 ribbonType 为 false 时有效 */ + // 同force类似 + minRadius: 10, + maxRadius: 20, + symbol: 'circle', + /***************** 上面的配置项在 ribbonType 为 false 时有效 */ + + /***************** 下面的配置项在 ribbonType 为 true 时有效 */ + showScale: false, + showScaleText: false, + /***************** 上面的配置项在 ribbonType 为 true 时有效 */ + + // 分类里如果有样式会覆盖节点默认样式 + // categories: [{ + // itemStyle + // symbol + // symbolSize + // name + // }], + itemStyle: { + normal: { + borderWidth: 0, + borderColor: '#000', + label: { + show: true, + rotate: false, + distance: 5 + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + }, + chordStyle: { /** ribbonType = false 时有效 */ + width: 1, + color: 'black', + /** ribbonType = true 时有效 */ + borderWidth: 1, + borderColor: '#999', + opacity: 0.5 + } + }, + emphasis: { + borderWidth: 0, + borderColor: '#000', + chordStyle: { /** ribbonType = false 时有效 */ + width: 1, + color: 'black', + /** ribbonType = true 时有效 */ + borderWidth: 1, + borderColor: '#999' + } + } + } /****** 使用 Data-matrix 表示数据 */ + // data: [], + // Source data matrix + /** + * target + * -1--2--3--4--5- + * 1| x x x x x + * 2| x x x x x + * 3| x x x x x source + * 4| x x x x x + * 5| x x x x x + * + * Relation ship from source to target + * https://github.com/mbostock/d3/wiki/Chord-Layout#wiki-chord + * + * Row based + */ + // matrix: [], + /****** 使用 node-links 表示数据 */ + // 参考 force + // nodes: [], + // links: [] +}; + var ecData = require('../util/ecData.js'); var zrUtil = require('../zrender/tool/util.js'); var vec2 = require('../zrender/tool/vector.js'); -var NDArray = require('../util/ndarray.js'); - -var _devicePixelRatio = window.devicePixelRatio || 1; +var Graph = require('../data/Graph.js'); +var ChordLayout = require('../layout/Chord.js'); function Chord(ecTheme, messageCenter, zr, option, myChart) { - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); // 图表基类 - ChartBase.call(this); + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); + + this.scaleLineLength = 4; + + this.scaleUnitAngle = 4; this.refresh(option); } @@ -39,313 +133,427 @@ Chord.prototype = { /** * 绘制图形 */ - _buildShape: function () { + _init: function () { var series = this.series; this.selectedMap = {}; - this.chordSeries = []; - this.chordSerieSample = null; - var matrix = []; - var serieNumber = 0; + + var chordSeriesMap = {}; + + var chordSeriesGroups = {}; + for (var i = 0, l = series.length; i < l; i++) { if (series[i].type === this.type) { - // Use the config of first chord serie - if (!this.chordSerieSample) { - this.chordSerieSample = series[i]; - this.reformOption(this.chordSerieSample); - } - var _isSelected = this.isSelected(series[i].name); // Filter by selected serie this.selectedMap[series[i].name] = _isSelected; - if (!_isSelected) { - continue; + if (_isSelected) { + this.buildMark(i); } - this.chordSeries.push(series[i]); - this.buildMark(i); - matrix.push(series[i].matrix); - serieNumber++; + + this.reformOption(series[i]); + chordSeriesMap[series[i].name] = series[i]; } } - if (!this.chordSerieSample) { - return; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type === this.type) { + if (series[i].insertToSerie) { + var referenceSerie = chordSeriesMap[series[i].insertToSerie]; + series[i]._referenceSerie = referenceSerie; + } + else { + chordSeriesGroups[series[i].name] = [series[i]]; + } + } } - if (!this.chordSeries.length) { - this.addShapeList(); - return; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type === this.type) { + if (series[i].insertToSerie) { + // insertToSerie 可能会存在链式的使用,找到最原始的系列,分到一个 Group 里 + var mainSerie = series[i]._referenceSerie; + while (mainSerie && mainSerie._referenceSerie) { + mainSerie = mainSerie._referenceSerie; + } + if ( + chordSeriesGroups[mainSerie.name] && this.selectedMap[series[i].name]) { + chordSeriesGroups[mainSerie.name].push(series[i]); + } + } + } } - var zrWidth = this.zr.getWidth(); - var zrHeight = this.zr.getHeight(); - var zrSize = Math.min(zrWidth, zrHeight); - - this.groups = this.chordSerieSample.data; - this.startAngle = this.chordSerieSample.startAngle; - // Constrain to [0, 360] - this.startAngle = this.startAngle % 360; - if (this.startAngle < 0) { - this.startAngle = this.startAngle + 360; + for (var name in chordSeriesGroups) { + this._buildChords(chordSeriesGroups[name]); } - this.clockWise = this.chordSerieSample.clockWise; - this.innerRadius = this.parsePercent( - this.chordSerieSample.radius[0], zrSize / 2); - this.outerRadius = this.parsePercent( - this.chordSerieSample.radius[1], zrSize / 2); - this.padding = this.chordSerieSample.padding; - this.sortGroups = this.chordSerieSample.sort; - this.sortSubGroups = this.chordSerieSample.sortSub; - this.showScale = this.chordSerieSample.showScale; - this.showScaleText = this.chordSerieSample.showScaleText; - this.center = [ - this.parsePercent(this.chordSerieSample.center[0], zrWidth), this.parsePercent(this.chordSerieSample.center[1], zrHeight)]; - var fixSize = - this.chordSerieSample.itemStyle.normal.chordStyle.lineStyle.width - this.chordSerieSample.itemStyle.normal.lineStyle.width; - this.strokeFix = (fixSize / _devicePixelRatio) / this.innerRadius / Math.PI * 180; - - - this.dataMat = new NDArray(matrix); - this.dataMat = this.dataMat._transposelike([1, 2, 0]); - - // Filter the data by selected legend - var res = this._filterData(this.dataMat, this.groups); - this.dataMat = res[0]; - this.groups = res[1]; - - // Check if data is valid - var shape = this.dataMat.shape(); - if (shape[0] !== shape[1] || shape[0] !== this.groups.length) { - throw new Error('Data not valid'); + + this.addShapeList(); + }, + + _getNodeCategory: function (serie, group) { + return serie.categories && serie.categories[group.category || 0]; + }, + + _getNodeQueryTarget: function (serie, group) { + var category = this._getNodeCategory(serie, group); + return [group, category, serie]; + }, + + _getEdgeQueryTarget: function (serie, edge, type) { + type = type || 'normal'; + return [(edge.itemStyle && edge.itemStyle[type]), serie.itemStyle[type].chordStyle]; + }, + + _buildChords: function (series) { + var graphs = []; + var mainSerie = series[0]; + + var nodeFilter = function (n) { + return n.layout.size > 0; + }; + var createEdgeFilter = function (graph) { + return function (e) { + return graph.getEdge(e.node2, e.node1); + }; + }; + for (var i = 0; i < series.length; i++) { + var serie = series[i]; + + if (this.selectedMap[serie.name]) { + var graph; + if (serie.data && serie.matrix) { + graph = this._getSerieGraphFromDataMatrix( + serie, mainSerie); + } else if (serie.nodes && serie.links) { + graph = this._getSerieGraphFromNodeLinks( + serie, mainSerie); + } + // 过滤输出为0的节点 + graph.filterNode(nodeFilter, this); + if (serie.ribbonType) { + graph.filterEdge(createEdgeFilter(graph)); + } + + graphs.push(graph); + + graph.__serie = serie; + } } - if (shape[0] === 0 || shape[2] === 0) { - this.addShapeList(); + if (!graphs.length) { return; } - // Down to 2 dimension - // More convenient for angle calculating and sort - this.dataMat.reshape(shape[0], shape[1] * shape[2]); - - // Processing data - var sumOut = this.dataMat.sum(1); - var percents = sumOut.mul(1 / sumOut.sum()); - - var groupNumber = shape[0]; - var subGroupNumber = shape[1] * shape[2]; - - var groupAngles = percents.mul(360 - this.padding * groupNumber); - var subGroupAngles = this.dataMat.div( - this.dataMat.sum(1).reshape(groupNumber, 1)); - subGroupAngles = subGroupAngles.mul( - groupAngles.sub(this.strokeFix * 2).reshape(groupNumber, 1)); - - switch (this.sortGroups) { - case 'ascending': - case 'descending': - var groupIndices = groupAngles.argsort(0, this.sortGroups); - groupAngles['sort'](0, this.sortGroups); - sumOut['sort'](0, this.sortGroups); - break; - default: - var groupIndices = NDArray.range(shape[0]); - } - - switch (this.sortSubGroups) { - case 'ascending': - case 'descending': - var subGroupIndices = subGroupAngles.argsort(1, this.sortSubGroups); - subGroupAngles['sort'](1, this.sortSubGroups); - break; - default: - var subGroupIndices = NDArray.range(subGroupNumber).reshape(1, subGroupNumber).repeat(groupNumber, 0); + var mainGraph = graphs[0]; + + if (!mainSerie.ribbonType) { + var minRadius = mainSerie.minRadius; + var maxRadius = mainSerie.maxRadius; + // Map size to [minRadius, maxRadius] + var min = Infinity, + max = -Infinity; + mainGraph.eachNode(function (node) { + max = Math.max(node.layout.size, max); + min = Math.min(node.layout.size, min); + }); + var multiplier = (maxRadius - minRadius) / (max - min); + mainGraph.eachNode(function (node) { + var queryTarget = this._getNodeQueryTarget(mainSerie, node); + var symbolSize = this.query(queryTarget, 'symbolSize'); + if (max === min) { + node.layout.size = symbolSize || min; + } + else { + node.layout.size = symbolSize || (node.layout.size - min) * multiplier + minRadius; + } + }, this); } - var groupIndicesArr = groupIndices.toArray(); - var groupAnglesArr = groupAngles.toArray(); - var subGroupIndicesArr = subGroupIndices.toArray(); - var subGroupAnglesArr = subGroupAngles.toArray(); - var sumOutArray = sumOut.toArray(); - - var sectorAngles = []; - var chordAngles = new NDArray( - groupNumber, subGroupNumber).toArray(); - var values = []; - var start = 0; - var end = 0; - for (var i = 0; i < groupNumber; i++) { - var sortedIdx = groupIndicesArr[i]; - values[sortedIdx] = sumOutArray[i]; - - end = start + groupAnglesArr[i]; - sectorAngles[sortedIdx] = [start, end]; - - // Sub Group - var subStart = start + this.strokeFix; - var subEnd = subStart; - for (var j = 0; j < subGroupNumber; j++) { - subEnd = subStart + subGroupAnglesArr[sortedIdx][j]; - var subSortedIndex = subGroupIndicesArr[sortedIdx][j]; /*jshint maxlen : 200*/ - chordAngles[sortedIdx][subSortedIndex] = [subStart, subEnd]; - subStart = subEnd; - } - - start = end + this.padding; + // Do layout + var layout = new ChordLayout(); + layout.clockWise = mainSerie.clockWise; + layout.startAngle = mainSerie.startAngle * Math.PI / 180; + if (!layout.clockWise) { + layout.startAngle = -layout.startAngle; } + layout.padding = mainSerie.padding * Math.PI / 180; + layout.sort = mainSerie.sort; + layout.sortSub = mainSerie.sortSub; + layout.directed = mainSerie.ribbonType; + layout.run(graphs); - // reset data - this.chordShapes = new NDArray(groupNumber, groupNumber, serieNumber).toArray(); - this.sectorShapes = []; + var showLabel = this.query( + mainSerie, 'itemStyle.normal.label.show'); - this._buildSectors(sectorAngles, values); + if (mainSerie.ribbonType) { + this._buildSectors(mainSerie, 0, mainGraph, mainSerie, graphs); + if (showLabel) { + this._buildLabels(mainSerie, 0, mainGraph, mainSerie, graphs); + } - chordAngles = new NDArray(chordAngles).reshape( - groupNumber, groupNumber, serieNumber, 2).toArray(); - this._buildChords(chordAngles, this.dataMat.reshape(shape).toArray()); + for (var i = 0, j = 0; i < series.length; i++) { + if (this.selectedMap[series[i].name]) { + this._buildRibbons(series, i, graphs[j++], mainSerie); + } + } - var res = this.normalizeValue(values); - if (this.showScale) { - this._buildScales( - res[0], res[1], sectorAngles, new NDArray(res[0]).sum() / (360 - this.padding * groupNumber)); + if (mainSerie.showScale) { + this._buildScales(mainSerie, 0, mainGraph); + } + } + else { + this._buildNodeIcons(mainSerie, 0, mainGraph, mainSerie, graphs); + if (showLabel) { + this._buildLabels(mainSerie, 0, mainGraph, mainSerie, graphs); + } + for (var i = 0, j = 0; i < series.length; i++) { + if (this.selectedMap[series[i].name]) { + this._buildEdgeCurves(series, i, graphs[j++], mainSerie, mainGraph); + } + } } - this.addShapeList(); + this._initHoverHandler(series, graphs); }, - _filterData: function (dataMat, groups) { - var indices = []; - var groupsFilted = []; - // Filter by selected group - for (var i = 0; i < groups.length; i++) { - var name = groups[i].name; + _getSerieGraphFromDataMatrix: function (serie, mainSerie) { + var nodesData = []; + var count = 0; + var matrix = []; + // 复制一份新的matrix + for (var i = 0; i < serie.matrix.length; i++) { + matrix[i] = serie.matrix[i].slice(); + } + var data = serie.data || serie.nodes; + for (var i = 0; i < data.length; i++) { + var node = {}; + var group = data[i]; + group.rawIndex = i; + for (var key in group) { + // name改为id + if (key === 'name') { + node['id'] = group['name']; + } + else { + node[key] = group[key]; + } + } + // legends 选择优先级 category -> group + var category = this._getNodeCategory(mainSerie, group); + var name = category ? category.name : group.name; + this.selectedMap[name] = this.isSelected(name); - if (!this.selectedMap[name]) { - indices.push(i); - } else { - groupsFilted.push(groups[i]); + if (this.selectedMap[name]) { + nodesData.push(node); + count++; } - } - if (indices.length) { - dataMat = dataMat['delete'](indices, 0); - dataMat = dataMat['delete'](indices, 1); - } - if (!dataMat.size()) { - return [dataMat, groupsFilted]; - } - // Empty data also need to be removed - indices = []; - var groupsFilted2 = []; - var shape = dataMat.shape(); - dataMat.reshape(shape[0], shape[1] * shape[2]); - var sumOutArray = dataMat.sum(1).toArray(); - dataMat.reshape(shape); - for (var i = 0; i < groupsFilted.length; i++) { - if (sumOutArray[i] === 0) { - indices.push(i); - } else { - groupsFilted2.push(groupsFilted[i]); + else { + // 过滤legend未选中的数据 + matrix.splice(count, 1); + for (var j = 0; j < matrix.length; j++) { + matrix[j].splice(count, 1); + } } } - if (indices.length) { - dataMat = dataMat['delete'](indices, 0); - dataMat = dataMat['delete'](indices, 1); - } - return [dataMat, groupsFilted2]; - }, + var graph = Graph.fromMatrix(nodesData, matrix, true); + + // Prepare layout parameters + graph.eachNode(function (n, idx) { + n.layout = { + size: n.data.outValue + }; + n.rawIndex = n.data.rawIndex; + }); + graph.eachEdge(function (e) { + e.layout = { + weight: e.data.weight + }; + }); - _buildSectors: function (angles, data) { - var len = this.groups.length; - var len2 = this.chordSeries.length; + return graph; + }, - var timeout; + _getSerieGraphFromNodeLinks: function (serie, mainSerie) { + var graph = new Graph(true); + var nodes = serie.data || serie.nodes; + for (var i = 0, len = nodes.length; i < len; i++) { + var n = nodes[i]; + if (!n || n.ignore) { + continue; + } + // legends 选择优先级 category -> group + var category = this._getNodeCategory(mainSerie, n); + var name = category ? category.name : n.name; - var showLabel = this.query( - this.chordSerieSample, 'itemStyle.normal.label.show'); - var labelColor = this.query( - this.chordSerieSample, 'itemStyle.normal.label.color'); - var rotateLabel = this.query( - this.chordSerieSample, 'itemStyle.normal.label.rotate'); - var labelDistance = this.query( - this.chordSerieSample, 'itemStyle.normal.label.distance'); + this.selectedMap[name] = this.isSelected(name); + if (this.selectedMap[name]) { + var node = graph.addNode(n.name, n); + node.rawIndex = i; + } + } - var self = this; + for (var i = 0, len = serie.links.length; i < len; i++) { + var e = serie.links[i]; + var n1 = e.source; + var n2 = e.target; + if (typeof(n1) === 'number') { + n1 = nodes[n1]; + if (n1) { + n1 = n1.name; + } + } + if (typeof(n2) === 'number') { + n2 = nodes[n2]; + if (n2) { + n2 = n2.name; + } + } + var edge = graph.addEdge(n1, n2, e); + if (edge) { + edge.rawIndex = i; + } + } - function createMouseOver(idx) { - return function () { - if (timeout) { - clearTimeout(timeout); - } - timeout = setTimeout(function () { - for (var i = 0; i < len; i++) { - self.sectorShapes[i].style.opacity = i === idx ? 1 : 0.1; - self.zr.modShape(self.sectorShapes[i].id); - - for (var j = 0; j < len; j++) { - for (var k = 0; k < len2; k++) { - var chordShape = self.chordShapes[i][j][k]; - if (chordShape) { - chordShape.style.opacity = (i === idx || j === idx) ? 0.5 : 0.03; - self.zr.modShape(chordShape.id); - } - } - } + graph.eachNode(function (n) { + var value = n.data.value; + if (value == null) { // value 是 null 或者 undefined + value = 0; + if (mainSerie.ribbonType) { + // 默认使用所有出边值的和作为节点的大小, 不修改 data 里的数值 + for (var i = 0; i < n.outEdges.length; i++) { + value += n.outEdges[i].data.weight || 0; } - self.zr.refresh(); - }, 50); + } + else { + // 默认使用所有边值的和作为节点的大小, 不修改 data 里的数值 + for (var i = 0; i < n.edges.length; i++) { + value += n.edges[i].data.weight || 0; + } + } + } + n.layout = { + size: value }; - } + }); + graph.eachEdge(function (e) { + e.layout = { + // 默认 weight 为1 + weight: e.data.weight == null ? 1 : e.data.weight + }; + }); - function createMouseOut() { - return function () { - if (timeout) { - clearTimeout(timeout); - } - timeout = setTimeout(function () { - for (var i = 0; i < len; i++) { - self.sectorShapes[i].style.opacity = 1.0; - self.zr.modShape(self.sectorShapes[i].id); - - for (var j = 0; j < len; j++) { - for (var k = 0; k < len2; k++) { - var chordShape = self.chordShapes[i][j][k]; - if (chordShape) { - chordShape.style.opacity = 0.5; - self.zr.modShape(chordShape.id); + return graph; + }, + + _initHoverHandler: function (series, graphs) { + var mainSerie = series[0]; + var mainGraph = graphs[0]; + var self = this; + mainGraph.eachNode(function (node) { + node.shape.onmouseover = function () { + mainGraph.eachNode(function (n) { + n.shape.style.opacity = 0.1; + if (n.labelShape) { + n.labelShape.style.opacity = 0.1; + n.labelShape.modSelf(); + } + n.shape.modSelf(); + }); + for (var i = 0; i < graphs.length; i++) { + for (var j = 0; j < graphs[i].edges.length; j++) { + var e = graphs[i].edges[j]; + var queryTarget = self._getEdgeQueryTarget( + graphs[i].__serie, e.data); + e.shape.style.opacity = self.deepQuery( + queryTarget, 'opacity') * 0.1; + e.shape.modSelf(); + } + } + node.shape.style.opacity = 1; + if (node.labelShape) { + node.labelShape.style.opacity = 1; + } + for (var i = 0; i < graphs.length; i++) { + var n = graphs[i].getNodeById(node.id); + if (n) { // 节点有可能没数据被过滤掉了 + for (var j = 0; j < n.outEdges.length; j++) { + var e = n.outEdges[j]; + var queryTarget = self._getEdgeQueryTarget( + graphs[i].__serie, e.data); + e.shape.style.opacity = self.deepQuery( + queryTarget, 'opacity'); + var other = graphs[0].getNodeById(e.node2.id); + if (other) { + if (other.shape) { + other.shape.style.opacity = 1; + } + if (other.labelShape) { + other.labelShape.style.opacity = 1; } } } } - self.zr.refresh(); - }, 50); + } + self.zr.refreshNextFrame(); }; - } - - for (var i = 0; i < len; i++) { - var group = this.groups[i]; - var angle = angles[i]; - var _start = (this.clockWise ? (360 - angle[1]) : angle[0]) + this.startAngle; - var _end = (this.clockWise ? (360 - angle[0]) : angle[1]) + this.startAngle; + node.shape.onmouseout = function () { + mainGraph.eachNode(function (n) { + n.shape.style.opacity = 1; + if (n.labelShape) { + n.labelShape.style.opacity = 1; + n.labelShape.modSelf(); + } + n.shape.modSelf(); + }); + for (var i = 0; i < graphs.length; i++) { + for (var j = 0; j < graphs[i].edges.length; j++) { + var e = graphs[i].edges[j]; + var queryTarget = [e.data, mainSerie]; + e.shape.style.opacity = self.deepQuery( + queryTarget, 'itemStyle.normal.chordStyle.opacity'); + e.shape.modSelf(); + } + } + self.zr.refreshNextFrame(); + }; + }); + }, - var sector = { - zlevel: this._zlevelBase, + _buildSectors: function (serie, serieIdx, graph, mainSerie) { + var center = this.parseCenter(this.zr, mainSerie.center); + var radius = this.parseRadius(this.zr, mainSerie.radius); + var clockWise = mainSerie.clockWise; + var sign = clockWise ? 1 : -1; + + graph.eachNode(function (node) { + var category = this._getNodeCategory(mainSerie, node.data); + // 默认使用 category 分类颜色 + var color = category ? this.getColor(category.name) : this.getColor(node.id); + + var startAngle = node.layout.startAngle / Math.PI * 180 * sign; + var endAngle = node.layout.endAngle / Math.PI * 180 * sign; + var sector = new SectorShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), style: { - x: this.center[0], - y: this.center[1], - r0: this.innerRadius, - r: this.outerRadius, - startAngle: _start, - endAngle: _end, + x: center[0], + y: center[1], + r0: radius[0], + r: radius[1], + startAngle: startAngle, + endAngle: endAngle, brushType: 'fill', opacity: 1, - color: this.getColor(group.name) + color: color, + clockWise: clockWise }, - clickable: true, + clickable: mainSerie.clickable, highlightStyle: { brushType: 'fill' } - }; - sector.style.lineWidth = this.deepQuery([group, this.chordSerieSample], 'itemStyle.normal.lineStyle.width'); - sector.highlightStyle.lineWidth = this.deepQuery([group, this.chordSerieSample], 'itemStyle.emphasis.lineStyle.width'); - sector.style.strokeColor = this.deepQuery([group, this.chordSerieSample], 'itemStyle.normal.lineStyle.color'); - sector.highlightStyle.strokeColor = this.deepQuery([group, this.chordSerieSample], 'itemStyle.emphasis.lineStyle.color'); + }); + sector.style.lineWidth = this.deepQuery([node.data, mainSerie], 'itemStyle.normal.borderWidth'); + sector.highlightStyle.lineWidth = this.deepQuery([node.data, mainSerie], 'itemStyle.emphasis.borderWidth'); + sector.style.strokeColor = this.deepQuery([node.data, mainSerie], 'itemStyle.normal.borderColor'); + sector.highlightStyle.strokeColor = this.deepQuery([node.data, mainSerie], 'itemStyle.emphasis.borderColor'); if (sector.style.lineWidth > 0) { sector.style.brushType = 'both'; } @@ -353,148 +561,336 @@ Chord.prototype = { sector.highlightStyle.brushType = 'both'; } ecData.pack( - sector, this.chordSeries[0], 0, data[i], i, group.name); - if (showLabel) { - var halfAngle = [_start + _end] / 2; - halfAngle %= 360; // Constrain to [0,360] - var isRightSide = halfAngle <= 90 || halfAngle >= 270; - halfAngle = halfAngle * Math.PI / 180; - var v = [Math.cos(halfAngle), -Math.sin(halfAngle)]; - - var distance = this.showScaleText ? 35 + labelDistance : labelDistance; - var start = vec2.scale([], v, this.outerRadius + distance); - vec2.add(start, start, this.center); - - var labelShape = { - zlevel: this._zlevelBase - 1, - hoverable: false, - style: { - text: group.name, - textAlign: isRightSide ? 'left' : 'right', - color: labelColor - } - }; - if (rotateLabel) { - labelShape.rotation = isRightSide ? halfAngle : Math.PI + halfAngle; - if (isRightSide) { - labelShape.style.x = this.outerRadius + distance; - } else { - labelShape.style.x = -this.outerRadius - distance; - } - labelShape.style.y = 0; - labelShape.position = this.center; - } else { - labelShape.style.x = start[0]; - labelShape.style.y = start[1]; - } - labelShape.style.textColor = this.deepQuery([group, this.chordSerieSample], 'itemStyle.normal.label.textStyle.color') || '#fff'; - labelShape.style.textFont = this.getFont(this.deepQuery([group, this.chordSerieSample], 'itemStyle.normal.label.textStyle')); - labelShape = new TextShape(labelShape); - this.shapeList.push(labelShape); + sector, serie, serieIdx, node.data, node.rawIndex, node.id, + // special + node.category); + + this.shapeList.push(sector); + + node.shape = sector; + + }, this); + }, + + _buildNodeIcons: function (serie, serieIdx, graph, mainSerie) { + var center = this.parseCenter(this.zr, mainSerie.center); + var radius = this.parseRadius(this.zr, mainSerie.radius); + // PENDING + var r = radius[1]; + + graph.eachNode(function (node) { + var startAngle = node.layout.startAngle; + var endAngle = node.layout.endAngle; + var angle = (startAngle + endAngle) / 2; + var x = r * Math.cos(angle); + var y = r * Math.sin(angle); + var queryTarget = this._getNodeQueryTarget(mainSerie, node.data); + + var category = this._getNodeCategory(mainSerie, node.data); + var color = this.deepQuery(queryTarget, 'itemStyle.normal.color'); + if (!color) { + color = category ? this.getColor(category.name) : this.getColor(node.id); } + var iconShape = new IconShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + style: { + x: -node.layout.size, + y: -node.layout.size, + width: node.layout.size * 2, + height: node.layout.size * 2, + iconType: this.deepQuery(queryTarget, 'symbol'), + color: color, + brushType: 'both', + lineWidth: this.deepQuery(queryTarget, 'itemStyle.normal.borderWidth'), + strokeColor: this.deepQuery(queryTarget, 'itemStyle.normal.borderColor') + }, + highlightStyle: { + color: this.deepQuery(queryTarget, 'itemStyle.emphasis.color'), + lineWidth: this.deepQuery(queryTarget, 'itemStyle.emphasis.borderWidth'), + strokeColor: this.deepQuery(queryTarget, 'itemStyle.emphasis.borderColor') + }, + clickable: mainSerie.clickable, + position: [x + center[0], y + center[1]] + }); - sector.onmouseover = createMouseOver(i); - sector.onmouseout = createMouseOut(); + ecData.pack( + iconShape, serie, serieIdx, node.data, node.rawIndex, node.id, + // special + node.category); - sector = new SectorShape(sector); - this.shapeList.push(sector); - this.sectorShapes.push(sector); - } + this.shapeList.push(iconShape); + node.shape = iconShape; + }, this); }, - _buildChords: function (angles, dataArr) { - var len = angles.length; - if (!len) { - return; - } - var len2 = angles[0][0].length; + _buildLabels: function (serie, serieIdx, graph, mainSerie) { + var labelColor = this.query( + mainSerie, 'itemStyle.normal.label.color'); + var rotateLabel = this.query( + mainSerie, 'itemStyle.normal.label.rotate'); + var labelDistance = this.query( + mainSerie, 'itemStyle.normal.label.distance'); + var center = this.parseCenter(this.zr, mainSerie.center); + var radius = this.parseRadius(this.zr, mainSerie.radius); + var clockWise = mainSerie.clockWise; + var sign = clockWise ? 1 : -1; + + graph.eachNode(function (node) { + var startAngle = node.layout.startAngle / Math.PI * 180 * sign; + var endAngle = node.layout.endAngle / Math.PI * 180 * sign; + var angle = (startAngle * -sign + endAngle * -sign) / 2; + angle %= 360; + if (angle < 0) { // Constrain to [0,360] + angle += 360; + } + var isRightSide = angle <= 90 || angle >= 270; + angle = angle * Math.PI / 180; + var v = [Math.cos(angle), -Math.sin(angle)]; - var chordLineStyle = this.chordSerieSample.itemStyle.normal.chordStyle.lineStyle; - var chordLineStyleEmphsis = this.chordSerieSample.itemStyle.emphasis.chordStyle.lineStyle; + var distance = 0; + if (mainSerie.ribbonType) { + distance = mainSerie.showScaleText ? 35 + labelDistance : labelDistance; + } + else { + distance = labelDistance + node.layout.size; + } + var start = vec2.scale([], v, radius[1] + distance); + vec2.add(start, start, center); - for (var i = 0; i < len; i++) { - for (var j = 0; j < len; j++) { - for (var k = 0; k < len2; k++) { - if (this.chordShapes[j][i][k]) { - continue; - } + var labelShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + hoverable: false, + style: { + text: node.data.label == null ? node.id : node.data.label, + textAlign: isRightSide ? 'left' : 'right', + color: labelColor || '#000000' + } + }; + if (rotateLabel) { + labelShape.rotation = isRightSide ? angle : Math.PI + angle; + if (isRightSide) { + labelShape.style.x = radius[1] + distance; + } + else { + labelShape.style.x = -radius[1] - distance; + } + labelShape.style.y = 0; + labelShape.position = center.slice(); + } + else { + labelShape.style.x = start[0]; + labelShape.style.y = start[1]; + } + labelShape.style.textColor = this.deepQuery([node.data, mainSerie], 'itemStyle.normal.label.textStyle.color') || '#fff'; + labelShape.style.textFont = this.getFont(this.deepQuery([node.data, mainSerie], 'itemStyle.normal.label.textStyle')); + labelShape = new TextShape(labelShape); - var angleIJ0 = angles[i][j][k][0]; - var angleJI0 = angles[j][i][k][0]; + this.shapeList.push(labelShape); + node.labelShape = labelShape; + }, this); + }, - var angleIJ1 = angles[i][j][k][1]; - var angleJI1 = angles[j][i][k][1]; + _buildRibbons: function (series, serieIdx, graph, mainSerie) { + var serie = series[serieIdx]; + + var center = this.parseCenter(this.zr, mainSerie.center); + var radius = this.parseRadius(this.zr, mainSerie.radius); + + // graph.edges.length = 1; + graph.eachEdge(function (edge, idx) { + var color; + // 反向边 + var other = graph.getEdge(edge.node2, edge.node1); + if (!other // 只有单边 + || edge.shape // 已经创建过Ribbon + ) { + return; + } + if (other.shape) { // 已经创建过Ribbon + edge.shape = other.shape; + return; + } + var s0 = edge.layout.startAngle / Math.PI * 180; + var s1 = edge.layout.endAngle / Math.PI * 180; - if (angleIJ0 - angleJI1 === 0 || angleJI0 - angleJI1 === 0) { - this.chordShapes[i][j][k] = null; - continue; - } + var t0 = other.layout.startAngle / Math.PI * 180; + var t1 = other.layout.endAngle / Math.PI * 180; - var color; - if (len2 === 1) { - if (angleIJ1 - angleIJ0 <= angleJI1 - angleJI0) { - color = this.getColor(this.groups[i].name); - } else { - color = this.getColor(this.groups[j].name); - } - } else { - color = this.getColor(this.chordSeries[k].name); - } - var s0 = !this.clockWise ? (360 - angleIJ1) : angleIJ0; - var s1 = !this.clockWise ? (360 - angleIJ0) : angleIJ1; - var t0 = !this.clockWise ? (360 - angleJI1) : angleJI0; - var t1 = !this.clockWise ? (360 - angleJI0) : angleJI1; - var chord = { - zlevel: this._zlevelBase, - style: { - center: this.center, - r: this.innerRadius, - source0: s0 - this.startAngle, - source1: s1 - this.startAngle, - target0: t0 - this.startAngle, - target1: t1 - this.startAngle, - brushType: 'both', - opacity: 0.5, - color: color, - lineWidth: chordLineStyle.width, - strokeColor: chordLineStyle.color - }, - clickable: true, - highlightStyle: { - brushType: 'both', - lineWidth: chordLineStyleEmphsis.width, - strokeColor: chordLineStyleEmphsis.color - } - }; + if (series.length === 1) { + // 取小端的颜色 + if (edge.layout.weight <= other.layout.weight) { + color = this.getColor(edge.node1.id); + } + else { + color = this.getColor(edge.node2.id); + } + } else { + // 使用系列颜色 + color = this.getColor(serie.name); + } + var queryTarget = this._getEdgeQueryTarget(serie, edge.data); + var queryTargetEmphasis = this._getEdgeQueryTarget( + serie, edge.data, 'emphasis'); + var ribbon = new RibbonShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: center[0], + y: center[1], + r: radius[0], + source0: s0, + source1: s1, + target0: t0, + target1: t1, + brushType: 'both', + opacity: this.deepQuery( + queryTarget, 'opacity'), + color: color, + lineWidth: this.deepQuery(queryTarget, 'borderWidth'), + strokeColor: this.deepQuery(queryTarget, 'borderColor'), + clockWise: mainSerie.clockWise + }, + clickable: mainSerie.clickable, + highlightStyle: { + brushType: 'both', + opacity: this.deepQuery( + queryTargetEmphasis, 'opacity'), + lineWidth: this.deepQuery(queryTargetEmphasis, 'borderWidth'), + strokeColor: this.deepQuery(queryTargetEmphasis, 'borderColor') + } + }); + var node1, node2; + // 从大端到小端 + if (edge.layout.weight <= other.layout.weight) { + node1 = other.node1; + node2 = other.node2; + } else { + node1 = edge.node1; + node2 = edge.node2; + } + ecData.pack( + ribbon, serie, serieIdx, edge.data, edge.rawIndex == null ? idx : edge.rawIndex, edge.data.name || (node1.id + '-' + node2.id), + // special + node1.id, + // special2 + node2.id); + + this.shapeList.push(ribbon); + edge.shape = ribbon; + }, this); + }, + + _buildEdgeCurves: function (series, serieIdx, graph, mainSerie, mainGraph) { + var serie = series[serieIdx]; - ecData.pack( - chord, this.chordSeries[k], k, dataArr[i][j][k], i + '-' + j, this.groups[i].name, this.groups[j].name, dataArr[j][i][k]); + var center = this.parseCenter(this.zr, mainSerie.center); + + graph.eachEdge(function (e, idx) { + var node1 = mainGraph.getNodeById(e.node1.id); + var node2 = mainGraph.getNodeById(e.node2.id); + var shape1 = node1.shape; + var shape2 = node2.shape; + var queryTarget = this._getEdgeQueryTarget(serie, e.data); + var queryTargetEmphasis = this._getEdgeQueryTarget( + serie, e.data, 'emphasis'); + + var curveShape = new BezierCurveShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + xStart: shape1.position[0], + yStart: shape1.position[1], + xEnd: shape2.position[0], + yEnd: shape2.position[1], + cpX1: center[0], + cpY1: center[1], + lineWidth: this.deepQuery( + queryTarget, 'width'), + strokeColor: this.deepQuery( + queryTarget, 'color'), + opacity: this.deepQuery( + queryTarget, 'opacity') + }, + highlightStyle: { + lineWidth: this.deepQuery( + queryTargetEmphasis, 'width'), + strokeColor: this.deepQuery( + queryTargetEmphasis, 'color'), + opacity: this.deepQuery( + queryTargetEmphasis, 'opacity') + } + }); + + ecData.pack( + curveShape, serie, serieIdx, e.data, e.rawIndex == null ? idx : e.rawIndex, e.data.name || (e.node1.id + '-' + e.node2.id), + // special + e.node1.id, + // special2 + e.node2.id); + + this.shapeList.push(curveShape); + e.shape = curveShape; + }, this); + }, - chord = new ChordShape(chord); - this.chordShapes[i][j][k] = chord; - this.shapeList.push(chord); + _buildScales: function (serie, serieIdx, graph) { + var clockWise = serie.clockWise; + var center = this.parseCenter(this.zr, serie.center); + var radius = this.parseRadius(this.zr, serie.radius); + var sign = clockWise ? 1 : -1; + + var sumValue = 0; + var maxValue = -Infinity; + var unitPostfix; + var unitScale; + + if (serie.showScaleText) { + graph.eachNode(function (node) { + var val = node.data.value; + if (val > maxValue) { + maxValue = val; } + sumValue += val; + }); + if (maxValue > 1e10) { + unitPostfix = 'b'; + unitScale = 1e-9; + } + else if (maxValue > 1e7) { + unitPostfix = 'm'; + unitScale = 1e-6; + } + else if (maxValue > 1e4) { + unitPostfix = 'k'; + unitScale = 1e-3; + } + else { + unitPostfix = ''; + unitScale = 1; } } - }, - _buildScales: function ( - values, unitPostfix, angles, unitValue) { - for (var i = 0; i < angles.length; i++) { - var subStartAngle = angles[i][0]; - var subEndAngle = angles[i][1]; - - var scaleAngle = subStartAngle; - while (scaleAngle < subEndAngle) { - var thelta = ((this.clockWise ? (360 - scaleAngle) : scaleAngle) + this.startAngle) / 180 * Math.PI; - var v = [ - Math.cos(thelta), -Math.sin(thelta)]; - var start = vec2.scale([], v, this.outerRadius + 1); - vec2.add(start, start, this.center); - var end = vec2.scale([], v, this.outerRadius + this.scaleLineLength); - vec2.add(end, end, this.center); - var scaleShape = { - zlevel: this._zlevelBase - 1, + var unitValue = sumValue / (360 - serie.padding); + + graph.eachNode(function (node) { + var startAngle = node.layout.startAngle / Math.PI * 180; + var endAngle = node.layout.endAngle / Math.PI * 180; + var scaleAngle = startAngle; + while (true) { + if ((clockWise && scaleAngle > endAngle) || (!clockWise && scaleAngle < endAngle)) { + break; + } + var theta = scaleAngle / 180 * Math.PI; + var v = [Math.cos(theta), Math.sin(theta)]; + var start = vec2.scale([], v, radius[1] + 1); + vec2.add(start, start, center); + var end = vec2.scale([], v, radius[1] + this.scaleLineLength); + vec2.add(end, end, center); + var scaleShape = new LineShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase() - 1, hoverable: false, style: { xStart: start[0], @@ -506,66 +902,50 @@ Chord.prototype = { strokeColor: '#666', lineWidth: 1 } - }; + }); - scaleShape = new LineShape(scaleShape); this.shapeList.push(scaleShape); - scaleAngle += this.scaleUnitAngle; + scaleAngle += sign * this.scaleUnitAngle; } - if (!this.showScaleText) { - continue; + if (!serie.showScaleText) { + return; } - var scaleTextAngle = subStartAngle; + var scaleTextAngle = startAngle; var step = unitValue * 5 * this.scaleUnitAngle; - var scaleValues = NDArray.range(0, values[i], step).toArray(); - while (scaleTextAngle < subEndAngle) { - var thelta = this.clockWise ? (360 - scaleTextAngle) : scaleTextAngle; - thelta = (thelta + this.startAngle) % 360; - var isRightSide = thelta <= 90 || thelta >= 270; - var textShape = { - zlevel: this._zlevelBase - 1, + var scaleValue = 0; + while (true) { + if ((clockWise && scaleTextAngle > endAngle) || (!clockWise && scaleTextAngle < endAngle)) { + break; + } + var theta = scaleTextAngle; + theta = theta % 360; + if (theta < 0) { + theta += 360; + } + var isRightSide = theta <= 90 || theta >= 270; + + var textShape = new TextShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase() - 1, hoverable: false, style: { - x: isRightSide ? this.outerRadius + this.scaleLineLength + 4 : -this.outerRadius - this.scaleLineLength - 4, + x: isRightSide ? radius[1] + this.scaleLineLength + 4 : -radius[1] - this.scaleLineLength - 4, y: 0, - text: Math.round(scaleValues.shift() * 10) / 10 + unitPostfix, + text: Math.round(scaleValue * 10) / 10 + unitPostfix, textAlign: isRightSide ? 'left' : 'right' }, - position: this.center.slice(), - rotation: isRightSide ? [thelta / 180 * Math.PI, 0, 0] : [(thelta + 180) / 180 * Math.PI, 0, 0] - }; + position: center.slice(), + rotation: isRightSide ? [-theta / 180 * Math.PI, 0, 0] : [-(theta + 180) / 180 * Math.PI, 0, 0] + }); - textShape = new TextShape(textShape); this.shapeList.push(textShape); - scaleTextAngle += this.scaleUnitAngle * 5; - } - } - }, - normalizeValue: function (values) { - var result = []; - var max = new NDArray(values).max(); - var unitPostfix, unitScale; - if (max > 10000) { - unitPostfix = 'k'; - unitScale = 1 / 1000; - } else if (max > 10000000) { - unitPostfix = 'm'; - unitScale = 1 / 1000000; - } else if (max > 10000000000) { - unitPostfix = 'b'; - unitScale = 1 / 1000000000; - } else { - unitPostfix = ''; - unitScale = 1; - } - - for (var i = 0; i < values.length; i++) { - result[i] = values[i] * unitScale; - } - return [result, unitPostfix]; + scaleValue += step * unitScale; + scaleTextAngle += sign * this.scaleUnitAngle * 5; + } + }, this); }, refresh: function (newOption) { @@ -574,36 +954,6 @@ Chord.prototype = { this.series = newOption.series; } -/* - this.legend; - this.getColor; - this.isSelected; - this.chordSerieSample; - */ - // Config - this.chordSeries = []; -/* - this.groups; - this.startAngle; - this.clockWise; - this.innerRadius; - this.outerRadius; - this.padding; - this.sortGroups; - this.sortSubGroups; - this.center; - this.showScale; - this.showScaleText; - this.dataMat; - */ - this.strokeFix = 0; - // Adjacency matrix - this.sectorShapes = []; - this.chordShapes = []; - - this.scaleLineLength = 4; - this.scaleUnitAngle = 4; - this.legend = this.component.legend; if (this.legend) { this.getColor = function (param) { @@ -612,38 +962,16 @@ Chord.prototype = { this.isSelected = function (param) { return this.legend.isSelected(param); }; - } else { - var colorIndices = {}; + } + else { var colorMap = {}; var count = 0; this.getColor = function (key) { if (colorMap[key]) { return colorMap[key]; } - if (colorIndices[key] === undefined) { - colorIndices[key] = count++; - } - // key is serie name - for (var i = 0; i < this.chordSeries.length; i++) { - if (this.chordSeries[i].name === key) { - colorMap[key] = this.query( - this.chordSeries[i], 'itemStyle.normal.color'); - break; - } - } - if (!colorMap[key]) { - var len = this.groups.length; - // key is group name - for (var i = 0; i < len; i++) { - if (this.groups[i].name === key) { - colorMap[key] = this.query( - this.groups[i], 'itemStyle.normal.color'); - break; - } - } - } if (!colorMap[key]) { - colorMap[key] = this.zr.getColor(colorIndices[key]); + colorMap[key] = this.zr.getColor(count++); } return colorMap[key]; @@ -654,20 +982,20 @@ Chord.prototype = { } this.backupShapeList(); - this._buildShape(); + this._init(); }, reformOption: function (opt) { var _merge = zrUtil.merge; opt = _merge( - opt || {}, this.ecTheme.chord); - opt.itemStyle.normal.label.textStyle = _merge( - opt.itemStyle.normal.label.textStyle || {}, this.ecTheme.textStyle); + _merge( + opt || {}, this.ecTheme.chord), ecConfig.chord); + opt.itemStyle.normal.label.textStyle = this.getTextStyle( + opt.itemStyle.normal.label.textStyle); } }; zrUtil.inherits(Chord, ChartBase); -zrUtil.inherits(Chord, ComponentBase); // 图表注册 require('../chart.js').define('chord', Chord); diff --git a/src/chart/eventRiver.js b/src/chart/eventRiver.js new file mode 100644 index 0000000..c3761e9 --- /dev/null +++ b/src/chart/eventRiver.js @@ -0,0 +1,293 @@ +/** + * echarts图表类:事件河流图 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author clmtulip (车丽美, clmtulip@gmail.com) + * + */ + +var ChartBase = require('./base.js'); + +var eventRiverLayout = require('../layout/eventRiver.js'); + +// 图形依赖 +var PolygonShape = require('../zrender/shape/Polygon.js'); + +// 组件依赖 +require('../component/axis.js'); +require('../component/grid.js'); +require('../component/dataZoom.js'); + +var ecConfig = require('../config.js'); +// 事件河流图默认参数 +ecConfig.eventRiver = { + zlevel: 0, + // 一级层叠 + z: 2, + // 二级层叠 + clickable: true, + legendHoverLink: true, + itemStyle: { + normal: { + // color: 各异, + borderColor: 'rgba(0,0,0,0)', + borderWidth: 1, + label: { + show: true, + position: 'inside', + // 可选为'left'|'right'|'top'|'bottom' + formatter: '{b}' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + } + }, + emphasis: { + // color: 各异, + borderColor: 'rgba(0,0,0,0)', + borderWidth: 1, + label: { + show: true + } + } + } +}; + +var ecData = require('../util/ecData.js'); +var ecDate = require('../util/date.js'); +var zrUtil = require('../zrender/tool/util.js'); +var zrColor = require('../zrender/tool/color.js'); + +/** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} option 数据 + * @param {Object} component 组件 + */ + +function EventRiver(ecTheme, messageCenter, zr, option, myChart) { + // 图表基类 + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); + + var self = this; + self._ondragend = function () { + self.isDragend = true; + }; + this.refresh(option); +} + +EventRiver.prototype = { + type: ecConfig.CHART_TYPE_EVENTRIVER, + + _buildShape: function () { + var series = this.series; + this.selectedMap = {}; + + // 数据预处理 + this._dataPreprocessing(); + + var legend = this.component.legend; + // 调用布局算法计算事件在Y轴上的位置 + var eventRiverSeries = []; + for (var i = 0; i < series.length; i++) { + if (series[i].type === this.type) { + series[i] = this.reformOption(series[i]); + this.legendHoverLink = series[i].legendHoverLink || this.legendHoverLink; + var serieName = series[i].name || ''; + // 系列图例开关 + this.selectedMap[serieName] = legend ? legend.isSelected(serieName) : true; + if (!this.selectedMap[serieName]) { + continue; + } + this.buildMark(i); + eventRiverSeries.push(this.series[i]); + } + } + + eventRiverLayout( + eventRiverSeries, this._intervalX, this.component.grid.getArea()); + + // 绘制事件河 + this._drawEventRiver(); + + this.addShapeList(); + }, + + /** + * 处理数据 + */ + _dataPreprocessing: function () { + // 将年月日的时间转化为平面坐标 + var series = this.series; + var xAxis; + var evolutionList; + for (var i = 0, iLen = series.length; i < iLen; i++) { + if (series[i].type === this.type) { + xAxis = this.component.xAxis.getAxis(series[i].xAxisIndex || 0); + for (var j = 0, jLen = series[i].eventList.length; j < jLen; j++) { + evolutionList = series[i].eventList[j].evolution; + for (var k = 0, kLen = evolutionList.length; k < kLen; k++) { + evolutionList[k].timeScale = xAxis.getCoord( + ecDate.getNewDate(evolutionList[k].time) - 0); + // evolutionList[k].valueScale = evolutionList[k].value; + // modified by limei.che, to normalize the value range + evolutionList[k].valueScale = Math.pow(evolutionList[k].value, 0.8); + } + } + } + } + // 尾迹长度 + this._intervalX = Math.round(this.component.grid.getWidth() / 40); + }, + + /** + * 绘制事件河流 + */ + _drawEventRiver: function () { + var series = this.series; + for (var i = 0; i < series.length; i++) { + var serieName = series[i].name || ''; + if (series[i].type === this.type && this.selectedMap[serieName]) { + for (var j = 0; j < series[i].eventList.length; j++) { + this._drawEventBubble(series[i].eventList[j], i, j); + } + } + } + }, + + /** + * 绘制气泡图 + */ + _drawEventBubble: function (oneEvent, seriesIndex, dataIndex) { + var series = this.series; + var serie = series[seriesIndex]; + var serieName = serie.name || ''; + var data = serie.eventList[dataIndex]; + var queryTarget = [data, serie]; + + var legend = this.component.legend; + var defaultColor = legend ? legend.getColor(serieName) : this.zr.getColor(seriesIndex); + + // 多级控制 + var normal = this.deepMerge(queryTarget, 'itemStyle.normal') || {}; + var emphasis = this.deepMerge(queryTarget, 'itemStyle.emphasis') || {}; + var normalColor = this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) || defaultColor; + + var emphasisColor = this.getItemStyleColor( + emphasis.color, seriesIndex, dataIndex, data) || (typeof normalColor === 'string' ? zrColor.lift(normalColor, -0.2) : normalColor); + + var pts = this._calculateControlPoints(oneEvent); + + var eventBubbleShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + clickable: this.deepQuery(queryTarget, 'clickable'), + style: { + pointList: pts, + smooth: 'spline', + brushType: 'both', + lineJoin: 'round', + color: normalColor, + lineWidth: normal.borderWidth, + strokeColor: normal.borderColor + }, + highlightStyle: { + color: emphasisColor, + lineWidth: emphasis.borderWidth, + strokeColor: emphasis.borderColor + }, + draggable: 'vertical', + ondragend: this._ondragend + }; + + eventBubbleShape = new PolygonShape(eventBubbleShape); + + this.addLabel(eventBubbleShape, serie, data, oneEvent.name); + ecData.pack( + eventBubbleShape, series[seriesIndex], seriesIndex, series[seriesIndex].eventList[dataIndex], dataIndex, series[seriesIndex].eventList[dataIndex].name); + this.shapeList.push(eventBubbleShape); + }, + + /** + * 根据时间-热度,计算气泡形状的控制点 + */ + _calculateControlPoints: function (oneEvent) { + var intervalX = this._intervalX; + var posY = oneEvent.y; + + var evolution = oneEvent.evolution; + var n = evolution.length; + if (n < 1) { + return; + } + + var time = []; + var value = []; + for (var i = 0; i < n; i++) { + time.push(evolution[i].timeScale); + value.push(evolution[i].valueScale); + } + + var pts = []; + + // 从左向右绘制气泡的上半部分控制点 + // 第一个矩形的左端点 + pts.push([time[0], posY]); + // 从一个矩形 到 倒数第二个矩形 上半部分的中点 + var i = 0; + for (i = 0; i < n - 1; i++) { + pts.push([(time[i] + time[i + 1]) / 2.0, value[i] / -2.0 + posY]); + } + // 最后一个矩形上半部分的中点 + pts.push([(time[i] + (time[i] + intervalX)) / 2.0, value[i] / -2.0 + posY]); + // 最后一个矩形的右端点 + pts.push([time[i] + intervalX, posY]); + + // 从右向左绘制气泡的下半部分控制点 + // 最后一个矩形下半部分的中点 + pts.push([(time[i] + (time[i] + intervalX)) / 2.0, value[i] / 2.0 + posY]); + // 从倒数第二个矩形 到 一个矩形 下半部分的中点,由于polygon是闭合的,故不需要再加入左端点 + for (i = n - 1; i > 0; i--) { + pts.push([(time[i] + time[i - 1]) / 2.0, value[i - 1] / 2.0 + posY]); + } + + return pts; + }, + + /** + * 数据项被拖拽出去 + */ + ondragend: function (param, status) { + if (!this.isDragend || !param.target) { + // 没有在当前实例上发生拖拽行为则直接返回 + return; + } + + // 别status = {}赋值啊!! + status.dragOut = true; + status.dragIn = true; + status.needRefresh = false; // 会有消息触发fresh,不用再刷一遍 + // 处理完拖拽事件后复位 + this.isDragend = false; + }, + + /** + * 刷新 + */ + refresh: function (newOption) { + if (newOption) { + this.option = newOption; + this.series = newOption.series; + } + + this.backupShapeList(); + this._buildShape(); + } + +}; + +zrUtil.inherits(EventRiver, ChartBase); + +// 图表注册 +require('../chart.js').define('eventRiver', EventRiver); + +module.exports = EventRiver; \ No newline at end of file diff --git a/src/chart/force.js b/src/chart/force.js index a9ac6d7..94bb810 100644 --- a/src/chart/force.js +++ b/src/chart/force.js @@ -8,45 +8,135 @@ -var ComponentBase = require('../component/base.js'); var ChartBase = require('./base.js'); -var ForceLayout = require('./forceLayoutWorker.js'); +var Graph = require('../data/Graph.js'); +var ForceLayout = require('../layout/Force.js'); // 图形依赖 var LineShape = require('../zrender/shape/Line.js'); +var BezierCurveShape = require('../zrender/shape/BezierCurve.js'); +var ImageShape = require('../zrender/shape/Image.js'); var IconShape = require('../util/shape/Icon.js'); var ecConfig = require('../config.js'); +// 力导向布局图默认参数 +ecConfig.force = { + zlevel: 1, + // 一级层叠 + z: 2, + // 二级层叠 + // 布局中心 + center: ['50%', '50%'], + + // 布局大小 + size: '100%', + + // 防止节点和节点,节点和边之间的重叠 + preventOverlap: false, + + // 布局冷却因子,值越小结束时间越短,值越大时间越长但是结果也越收敛 + coolDown: 0.99, + + // 数据映射到圆的半径的最小值和最大值 + minRadius: 10, + maxRadius: 20, + + // 是否根据屏幕比例拉伸 + ratioScaling: false, + + // 在 500+ 顶点的图上建议设置 large 为 true, 会使用 Barnes-Hut simulation + // 同时开启 useWorker 并且把 steps 值调大 + // 关于Barnes-Hut simulation: http://en.wikipedia.org/wiki/Barnes–Hut_simulation + large: false, + + // 是否在浏览器支持 worker 的时候使用 web worker + useWorker: false, + // 每一帧 force 迭代的次数,仅在启用webworker的情况下有用 + steps: 1, + + // 布局缩放因子,并不完全精确, 效果跟布局大小类似 + scaling: 1.0, + + // 向心力因子,越大向心力越大( 所有顶点会往 center 的位置收拢 ) + gravity: 1, + + symbol: 'circle', + // symbolSize 为 0 的话使用映射到minRadius-maxRadius后的值 + symbolSize: 0, + + linkSymbol: null, + linkSymbolSize: [10, 15], + draggable: true, + clickable: true, + + roam: false, + + // 分类里如果有样式会覆盖节点默认样式 + // categories: [{ + // itemStyle + // symbol + // symbolSize + // name + // }], + itemStyle: { + normal: { + // color: 各异, + label: { + show: false, + position: 'inside' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + }, + nodeStyle: { + brushType: 'both', + borderColor: '#5182ab', + borderWidth: 1 + }, + linkStyle: { + color: '#5182ab', + width: 1, + type: 'line' + } + }, + emphasis: { + // color: 各异, + label: { + show: false + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + }, + nodeStyle: {}, + linkStyle: { + opacity: 0 + } + } + } + // nodes: [{ + // name: 'xxx', + // value: 1, + // itemStyle: {}, + // initial: [0, 0], + // fixX: false, + // fixY: false, + // ignore: false, + // symbol: 'circle', + // symbolSize: 0 + // }] + // links: [{ + // source: 1, + // target: 2, + // weight: 1, + // itemStyle: {} + // }, { + // source: 'xxx', + // target: 'ooo' + // }] +}; + var ecData = require('../util/ecData.js'); var zrUtil = require('../zrender/tool/util.js'); var zrConfig = require('../zrender/config.js'); var vec2 = require('../zrender/tool/vector.js'); -var NDArray = require('../util/ndarray.js'); -var ArrayCtor = typeof(Float32Array) == 'undefined' ? Array : Float32Array; - -var requestAnimationFrame = window.requestAnimationFrame || window.msRequestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || -function (func) { - setTimeout(func, 16); -}; - -// Use inline web worker -var workerUrl; -if ( -typeof(Worker) !== 'undefined' && typeof(Blob) !== 'undefined') { - try { - var blob = new Blob([ForceLayout.getWorkerCode()]); - workerUrl = window.URL.createObjectURL(blob); - } catch (e) { - workerUrl = ''; - } -} - -function getToken() { - return Math.round(new Date().getTime() / 100) % 10000000; -} - /** * 构造函数 * @param {Object} messageCenter echart消息中心 @@ -57,27 +147,20 @@ function getToken() { function Force(ecTheme, messageCenter, zr, option, myChart) { var self = this; - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); // 图表基类 - ChartBase.call(this); + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); // 保存节点的位置,改变数据时能够有更好的动画效果 - // TODO this.__nodePositionMap = {}; - this._nodeShapes = []; - this._linkShapes = []; - - this._updating = true; + this._graph = new Graph(true); + this._layout = new ForceLayout(); - this._filteredNodes = null; - this._filteredLinks = null; - this._rawNodes = null; - this._rawLinks = null; + this._layout.onupdate = function () { + self._step(); + }; this._steps = 1; - this._coolDown = 0.99; // 关闭可拖拽属性 this.ondragstart = function () { @@ -93,7 +176,8 @@ function Force(ecTheme, messageCenter, zr, option, myChart) { this.onmousemove = function () { onmousemove.apply(self, arguments); }; - this._init(); + + this.refresh(option); } /** @@ -106,52 +190,12 @@ Force.prototype = { type: ecConfig.CHART_TYPE_FORCE, _init: function () { - var self = this; - - this.clear(); - - this._updating = true; - - this._buildShape(); - - if (this._layoutWorker) { - this._layoutWorker.onmessage = function (e) { - if (self._temperature < 0.01) { - requestAnimationFrame(function () { - self._step.call(self, e); - }); - } else { - self._step.call(self, e); - } - }; - - this._layoutWorker.postMessage({ - cmd: 'update', - steps: this._steps, - temperature: this._temperature, - coolDown: this._coolDown - }); - } - else { - var cb = function () { - if (self._updating) { - self._step(); - requestAnimationFrame(cb); - } - }; - - requestAnimationFrame(cb); - } - }, - - _buildShape: function () { + // var self = this; var legend = this.component.legend; var series = this.series; var serieName; - this._temperature = 1; - - this.shapeList.length = 0; + this.clear(); for (var i = 0, l = series.length; i < l; i++) { var serie = series[i]; @@ -159,28 +203,6 @@ Force.prototype = { series[i] = this.reformOption(series[i]); serieName = series[i].name || ''; - if (workerUrl && serie.useWorker) { - try { - if (!this._layoutWorker) { - this._layoutWorker = new Worker(workerUrl); - } - this._layout = null; - } catch (e) { // IE10-11 will throw security error when using blog url - this._layoutWorker = null; - if (!this._layout) { - this._layout = new ForceLayout(); - } - } - } else { - if (!this._layout) { - this._layout = new ForceLayout(); - } - if (this._layoutWorker) { - this._layoutWorker.terminate(); - this._layoutWorker = null; - } - } - // 系列图例开关 this.selectedMap[serieName] = legend ? legend.isSelected(serieName) : true; @@ -190,292 +212,353 @@ Force.prototype = { this.buildMark(i); - // 同步selected状态 - var categories = serie.categories; - for (var j = 0, len = categories.length; j < len; j++) { - if (categories[j].name) { - if (legend) { - this.selectedMap[j] = - legend.isSelected(categories[j].name); - } else { - this.selectedMap[j] = true; - } - } - } + // TODO 多个 force + this._initSerie(serie, i); + break; + } + } + + this.animationEffect(); + }, + + _getNodeCategory: function (serie, node) { + return serie.categories && serie.categories[node.category || 0]; + }, - this._preProcessData(serie); + _getNodeQueryTarget: function (serie, node, type) { + type = type || 'normal'; + var category = this._getNodeCategory(serie, node) || {}; + return [ + // Node + node.itemStyle && node.itemStyle[type], + // Category + category && category.itemStyle && category.itemStyle[type], + // Serie + serie.itemStyle[type].nodeStyle]; + }, - this._nodeShapes.length = 0; - this._linkShapes.length = 0; + _getEdgeQueryTarget: function (serie, edge, type) { + type = type || 'normal'; + return [(edge.itemStyle && edge.itemStyle[type]), serie.itemStyle[type].linkStyle]; + }, - this._buildLinkShapes(serie); - this._buildNodeShapes(serie); + _initSerie: function (serie, serieIdx) { + this._temperature = 1; - this._initLayout(serie); + // data-matrix 表示数据 + if (serie.data) { + this._graph = this._getSerieGraphFromDataMatrix(serie); + } + // node-links 表示数据 + else { + this._graph = this._getSerieGraphFromNodeLinks(serie); + } - this._updateLinkShapes(); + this._buildLinkShapes(serie, serieIdx); + this._buildNodeShapes(serie, serieIdx); - // TODO 多个 force - this._forceSerie = serie; - break; - } + var panable = serie.roam === true || serie.roam === 'move'; + var zoomable = serie.roam === true || serie.roam === 'scale'; + // Enable pan and zooom + this.zr.modLayer(this.getZlevelBase(), { + panable: panable, + zoomable: zoomable + }); + + if ( + this.query('markPoint.effect.show') || this.query('markLine.effect.show')) { + // 斗胆修改 EFFECT 层配置项 + this.zr.modLayer(ecConfig.EFFECT_ZLEVEL, { + panable: panable, + zoomable: zoomable + }); } - }, - _preProcessData: function (serie) { - this._rawNodes = this.query(serie, 'nodes'); - this._rawLinks = zrUtil.clone(this.query(serie, 'links')); + this._initLayout(serie); - var filteredNodeList = []; - var filteredNodeMap = {}; - var cursor = 0; - var self = this; - this._filteredNodes = _filter(this._rawNodes, function (node, i) { - if (!node) { - return; - } - if (node.ignore) { - return; + this._step(); + }, + + _getSerieGraphFromDataMatrix: function (serie) { + var nodesData = []; + var count = 0; + var matrix = []; + // 复制一份新的matrix + for (var i = 0; i < serie.matrix.length; i++) { + matrix[i] = serie.matrix[i].slice(); + } + var data = serie.data || serie.nodes; + for (var i = 0; i < data.length; i++) { + var node = {}; + var group = data[i]; + for (var key in group) { + // name改为id + if (key === 'name') { + node['id'] = group['name']; + } + else { + node[key] = group[key]; + } } - var idx = -1; - if ( - typeof(node.category) == 'undefined' || self.selectedMap[node.category]) { - idx = cursor++; + // legends 选择优先级 category -> group + var category = this._getNodeCategory(serie, group); + var name = category ? category.name : group.name; + + this.selectedMap[name] = this.isSelected(name); + if (this.selectedMap[name]) { + nodesData.push(node); + count++; } - if (node.name) { - filteredNodeMap[node.name] = idx; + else { + // 过滤legend未选中的数据 + matrix.splice(count, 1); + for (var j = 0; j < matrix.length; j++) { + matrix[j].splice(count, 1); + } } - filteredNodeList[i] = idx; + } - return idx >= 0; + var graph = Graph.fromMatrix(nodesData, matrix, true); + + // Prepare layout parameters + graph.eachNode(function (n, idx) { + n.layout = { + size: n.data.value, + mass: 0 + }; + n.rawIndex = idx; + }); + graph.eachEdge(function (e) { + e.layout = { + weight: e.data.weight + }; }); - var source; - var target; - this._filteredLinks = _filter(this._rawLinks, function (link, i) { - source = link.source; - target = link.target; - var ret = true; - var idx = typeof(source) === 'string' ? filteredNodeMap[source] // source 用 node id 表示 - : filteredNodeList[source]; // source 用 node index 表示 - if (typeof(idx) == 'undefined') { - idx = -1; - } - - if (idx >= 0) { - link.source = idx; - } else { - ret = false; - } - var idx = typeof(target) === 'string' ? filteredNodeMap[target] // target 用 node id 表示 - : filteredNodeList[target]; // target 用 node index 表示 - if (typeof(idx) == 'undefined') { - idx = -1; + return graph; + }, + + _getSerieGraphFromNodeLinks: function (serie) { + var graph = new Graph(true); + var nodes = serie.data || serie.nodes; + for (var i = 0, len = nodes.length; i < len; i++) { + var n = nodes[i]; + if (!n || n.ignore) { + continue; + } + // legends 选择优先级 category -> group + var category = this._getNodeCategory(serie, n); + var name = category ? category.name : n.name; + + this.selectedMap[name] = this.isSelected(name); + if (this.selectedMap[name]) { + var node = graph.addNode(n.name, n); + node.rawIndex = i; } + } - if (idx >= 0) { - link.target = idx; - } else { - ret = false; + for (var i = 0, len = serie.links.length; i < len; i++) { + var e = serie.links[i]; + var n1 = e.source; + var n2 = e.target; + if (typeof(n1) === 'number') { + n1 = nodes[n1]; + if (n1) { + n1 = n1.name; + } } - // 保存原始链接中的index - link.rawIndex = i; + if (typeof(n2) === 'number') { + n2 = nodes[n2]; + if (n2) { + n2 = n2.name; + } + } + var edge = graph.addEdge(n1, n2, e); + if (edge) { + edge.rawIndex = i; + } + } - return ret; + graph.eachNode(function (n) { + var value = n.data.value; + if (value == null) { // value 是 null 或者 undefined + value = 0; + // 默认使用所有边值的和作为节点的大小, 不修改 data 里的数值 + for (var i = 0; i < n.edges.length; i++) { + value += n.edges[i].data.weight || 0; + } + } + n.layout = { + size: value, + mass: 0 + }; + }); + graph.eachEdge(function (e) { + e.layout = { + // 默认 weight 为1 + weight: e.data.weight == null ? 1 : e.data.weight + }; }); + + return graph; }, _initLayout: function (serie) { - - var nodes = this._filteredNodes; - var links = this._filteredLinks; - var shapes = this._nodeShapes; - var len = nodes.length; + var graph = this._graph; + var len = graph.nodes.length; var minRadius = this.query(serie, 'minRadius'); var maxRadius = this.query(serie, 'maxRadius'); + this._steps = serie.steps || 1; - this._coolDown = serie.coolDown || 0.99; - var center = this.parseCenter(this.zr, serie.center); - var width = this.parsePercent(serie.size, this.zr.getWidth()); - var height = this.parsePercent(serie.size, this.zr.getHeight()); - var size = Math.min(width, height); + this._layout.center = this.parseCenter(this.zr, serie.center); + this._layout.width = this.parsePercent(serie.size, this.zr.getWidth()); + this._layout.height = this.parsePercent(serie.size, this.zr.getHeight()); + + this._layout.large = serie.large; + this._layout.scaling = serie.scaling; + this._layout.ratioScaling = serie.ratioScaling; + this._layout.gravity = serie.gravity; + this._layout.temperature = 1; + this._layout.coolDown = serie.coolDown; + this._layout.preventNodeEdgeOverlap = serie.preventOverlap; + this._layout.preventNodeOverlap = serie.preventOverlap; // 将值映射到minRadius-maxRadius的范围上 - var radius = []; + var min = Infinity; + var max = -Infinity; for (var i = 0; i < len; i++) { - var node = nodes[i]; - radius.push(node.value || 1); + var gNode = graph.nodes[i]; + max = Math.max(gNode.layout.size, max); + min = Math.min(gNode.layout.size, min); } - - var arr = new NDArray(radius); - radius = arr.map(minRadius, maxRadius).toArray(); - var max = arr.max(); - if (max === 0) { - return; + var divider = max - min; + for (var i = 0; i < len; i++) { + var gNode = graph.nodes[i]; + if (divider > 0) { + gNode.layout.size = (gNode.layout.size - min) * (maxRadius - minRadius) / divider + minRadius; + // 节点质量是归一的 + gNode.layout.mass = gNode.layout.size / maxRadius; + } else { + gNode.layout.size = (maxRadius - minRadius) / 2; + gNode.layout.mass = 0.5; + } } - var massArr = arr.mul(1 / max, arr).toArray(); - var positionArr = new ArrayCtor(len * 2); for (var i = 0; i < len; i++) { - var initPos; - var node = nodes[i]; - if (typeof(this.__nodePositionMap[node.name]) !== 'undefined') { - initPos = vec2.create(); - vec2.copy(initPos, this.__nodePositionMap[node.name]); - } else if (typeof(node.initial) !== 'undefined') { - initPos = Array.prototype.slice.call(node.initial); - } else { - initPos = _randomInSquare( + // var initPos; + var gNode = graph.nodes[i]; + if (typeof(this.__nodePositionMap[gNode.id]) !== 'undefined') { + gNode.layout.position = vec2.create(); + vec2.copy(gNode.layout.position, this.__nodePositionMap[gNode.id]); + } + else if (typeof(gNode.data.initial) !== 'undefined') { + gNode.layout.position = vec2.create(); + vec2.copy(gNode.layout.position, gNode.data.initial); + } + else { + var center = this._layout.center; + var size = Math.min(this._layout.width, this._layout.height); + gNode.layout.position = _randomInSquare( center[0], center[1], size * 0.8); } - var style = shapes[i].style; - style.width = style.width || (radius[i] * 2); - style.height = style.height || (radius[i] * 2); + var style = gNode.shape.style; + var radius = gNode.layout.size; + style.width = style.width || (radius * 2); + style.height = style.height || (radius * 2); style.x = -style.width / 2; style.y = -style.height / 2; - shapes[i].position = initPos; - - positionArr[i * 2] = initPos[0]; - positionArr[i * 2 + 1] = initPos[1]; + vec2.copy(gNode.shape.position, gNode.layout.position); } - len = links.length; - var edgeArr = new ArrayCtor(len * 2); - var edgeWeightArr = new ArrayCtor(len); + // 边 + len = graph.edges.length; + max = -Infinity; for (var i = 0; i < len; i++) { - var link = links[i]; - edgeArr[i * 2] = link.source; - edgeArr[i * 2 + 1] = link.target; - edgeWeightArr[i] = link.weight || 1; + var e = graph.edges[i]; + if (e.layout.weight > max) { + max = e.layout.weight; + } } - - arr = new NDArray(edgeWeightArr); - var max = arr.max(); - if (max === 0) { - return; + // 权重归一 + for (var i = 0; i < len; i++) { + var e = graph.edges[i]; + e.layout.weight /= max; } - var edgeWeightArr = arr.mul(1 / max, arr)._array; - - var config = { - center: center, - width: serie.ratioScaling ? width : size, - height: serie.ratioScaling ? height : size, - scaling: serie.scaling || 1.0, - gravity: serie.gravity || 1.0, - barnesHutOptimize: serie.large - }; - - if (this._layoutWorker) { - - this._token = getToken(); - - this._layoutWorker.postMessage({ - cmd: 'init', - nodesPosition: positionArr, - nodesMass: massArr, - nodesSize: radius, - edges: edgeArr, - edgesWeight: edgeWeightArr, - token: this._token - }); - - this._layoutWorker.postMessage({ - cmd: 'updateConfig', - config: config - }); - } else { - - zrUtil.merge(this._layout, config, true); - this._layout.initNodes(positionArr, massArr, radius); - this._layout.initEdges(edgeArr, edgeWeightArr); - } + this._layout.init(graph, serie.useWorker); }, - _buildNodeShapes: function (serie) { + _buildNodeShapes: function (serie, serieIdx) { + var graph = this._graph; + var categories = this.query(serie, 'categories'); - var nodes = this._filteredNodes; - var len = nodes.length; - var legend = this.component.legend; - for (var i = 0; i < len; i++) { - var node = nodes[i]; + graph.eachNode(function (node) { + var category = this._getNodeCategory(serie, node.data); + var queryTarget = [node.data, category, serie]; + var styleQueryTarget = this._getNodeQueryTarget(serie, node.data); + var emphasisStyleQueryTarget = this._getNodeQueryTarget( + serie, node.data, 'emphasis'); var shape = new IconShape({ style: { x: 0, - y: 0 + y: 0, + color: this.deepQuery(styleQueryTarget, 'color'), + brushType: 'both', + // 兼容原有写法 + strokeColor: this.deepQuery(styleQueryTarget, 'strokeColor') || this.deepQuery(styleQueryTarget, 'borderColor'), + lineWidth: this.deepQuery(styleQueryTarget, 'lineWidth') || this.deepQuery(styleQueryTarget, 'borderWidth') }, - clickable: true, - highlightStyle: {} + highlightStyle: { + color: this.deepQuery(emphasisStyleQueryTarget, 'color'), + // 兼容原有写法 + strokeColor: this.deepQuery(emphasisStyleQueryTarget, 'strokeColor') || this.deepQuery(emphasisStyleQueryTarget, 'borderColor'), + lineWidth: this.deepQuery(emphasisStyleQueryTarget, 'lineWidth') || this.deepQuery(emphasisStyleQueryTarget, 'borderWidth') + }, + clickable: serie.clickable, + zlevel: this.getZlevelBase(), + z: this.getZBase() }); - - var queryTarget = []; - var shapeNormalStyle = []; - var shapeEmphasisStyle = []; - - queryTarget.push(node); - if (node.itemStyle) { - shapeNormalStyle.push(node.itemStyle.normal); - shapeEmphasisStyle.push(node.itemStyle.emphasis); + if (!shape.style.color) { + shape.style.color = category ? this.getColor(category.name) : this.getColor(node.id); } - if (typeof(node.category) !== 'undefined') { - var category = categories[node.category]; - if (category) { - // 使用 Legend.getColor 配置默认 category 的默认颜色 - category.itemStyle = category.itemStyle || {}; - category.itemStyle.normal = category.itemStyle.normal || {}; - category.itemStyle.normal.color = category.itemStyle.normal.color || legend.getColor(category.name); - - queryTarget.push(category); - shapeNormalStyle.unshift(category.itemStyle.normal); - shapeEmphasisStyle.unshift(category.itemStyle.emphasis); - } - } - queryTarget.push(serie); - shapeNormalStyle.unshift(serie.itemStyle.normal.nodeStyle); - shapeEmphasisStyle.unshift(serie.itemStyle.emphasis.nodeStyle); shape.style.iconType = this.deepQuery(queryTarget, 'symbol'); // 强制设定节点大小,否则默认映射到 minRadius 到 maxRadius 后的值 shape.style.width = shape.style.height = (this.deepQuery(queryTarget, 'symbolSize') || 0) * 2; - // 节点样式 - for (var k = 0; k < shapeNormalStyle.length; k++) { - if (shapeNormalStyle[k]) { - zrUtil.merge(shape.style, shapeNormalStyle[k], true); - } - } - // 节点高亮样式 - for (var k = 0; k < shapeEmphasisStyle.length; k++) { - if (shapeEmphasisStyle[k]) { - zrUtil.merge(shape.highlightStyle, shapeEmphasisStyle[k], true); - } + if (shape.style.iconType.match('image')) { + shape.style.image = shape.style.iconType.replace( + new RegExp('^image:\\/\\/'), ''); + shape = new ImageShape({ + style: shape.style, + highlightStyle: shape.highlightStyle, + clickable: shape.clickable, + zlevel: this.getZlevelBase(), + z: this.getZBase() + }); } // 节点标签样式 if (this.deepQuery(queryTarget, 'itemStyle.normal.label.show')) { - shape.style.text = node.name; - shape.style.textPosition = 'inside'; - var labelStyle = this.deepQuery( - queryTarget, 'itemStyle.normal.label.textStyle') || {}; - shape.style.textColor = labelStyle.color || '#fff'; - shape.style.textAlign = labelStyle.align || 'center'; - shape.style.textBaseline = labelStyle.baseline || 'middle'; - shape.style.textFont = this.getFont(labelStyle); + shape.style.text = node.data.label == null ? node.id : node.data.label; + shape.style.textPosition = this.deepQuery( + queryTarget, 'itemStyle.normal.label.position'); + shape.style.textColor = this.deepQuery( + queryTarget, 'itemStyle.normal.label.textStyle.color'); + shape.style.textFont = this.getFont(this.deepQuery( + queryTarget, 'itemStyle.normal.label.textStyle') || {}); } if (this.deepQuery(queryTarget, 'itemStyle.emphasis.label.show')) { - shape.highlightStyle.text = node.name; - shape.highlightStyle.textPosition = 'inside'; - var labelStyle = this.deepQuery( - queryTarget, 'itemStyle.emphasis.label.textStyle') || {}; - shape.highlightStyle.textColor = labelStyle.color || '#fff'; - shape.highlightStyle.textAlign = labelStyle.align || 'center'; - shape.highlightStyle.textBaseline = labelStyle.baseline || 'middle'; - shape.highlightStyle.textFont = this.getFont(labelStyle); + shape.highlightStyle.textPosition = this.deepQuery( + queryTarget, 'itemStyle.emphasis.label.position'); + shape.highlightStyle.textColor = this.deepQuery( + queryTarget, 'itemStyle.emphasis.label.textStyle.color'); + shape.highlightStyle.textFont = this.getFont(this.deepQuery( + queryTarget, 'itemStyle.emphasis.label.textStyle') || {}); } // 拖拽特性 @@ -494,49 +577,53 @@ Force.prototype = { } // !!Pack data before addShape ecData.pack( - shape, - // category - { - name: categoryName - }, - // series index - 0, + shape, serie, serieIdx, // data - node, + node.data, // data index - zrUtil.indexOf(this._rawNodes, node), + node.rawIndex, // name - node.name || '', - // value - node.value); + node.data.name || '', + // category + // special + node.category); - this._nodeShapes.push(shape); this.shapeList.push(shape); this.zr.addShape(shape); - } - }, - _buildLinkShapes: function (serie) { + node.shape = shape; + }, this); + }, - var nodes = this._filteredNodes; - var links = this._filteredLinks; - var len = links.length; + _buildLinkShapes: function (serie, serieIdx) { + var graph = this._graph; + var len = graph.edges.length; for (var i = 0; i < len; i++) { - var link = links[i]; - var source = nodes[link.source]; - var target = nodes[link.target]; + var gEdge = graph.edges[i]; + var link = gEdge.data; + var source = gEdge.node1; + var target = gEdge.node2; + + var queryTarget = this._getEdgeQueryTarget(serie, link); + var linkType = this.deepQuery(queryTarget, 'type'); + // TODO 暂时只有线段支持箭头 + if (serie.linkSymbol && serie.linkSymbol !== 'none') { + linkType = 'line'; + } + var LinkShapeCtor = linkType === 'line' ? LineShape : BezierCurveShape; - var linkShape = new LineShape({ + var linkShape = new LinkShapeCtor({ style: { xStart: 0, yStart: 0, xEnd: 0, - yEnd: 0, - lineWidth: 1 + yEnd: 0 }, - clickable: true, - highlightStyle: {} + clickable: this.query(serie, 'clickable'), + highlightStyle: {}, + zlevel: this.getZlevelBase(), + z: this.getZBase() }); zrUtil.merge( @@ -553,32 +640,34 @@ Force.prototype = { } } - var link = this._rawLinks[link.rawIndex]; + // 兼容原有写法 + linkShape.style.lineWidth = linkShape.style.lineWidth || linkShape.style.width; + linkShape.style.strokeColor = linkShape.style.strokeColor || linkShape.style.color; + linkShape.highlightStyle.lineWidth = linkShape.highlightStyle.lineWidth || linkShape.highlightStyle.width; + linkShape.highlightStyle.strokeColor = linkShape.highlightStyle.strokeColor || linkShape.highlightStyle.color; + ecData.pack( linkShape, // serie serie, // serie index - 0, + serieIdx, // link data - { - source: link.source, - target: link.target, - weight: link.weight || 0 - }, + gEdge.data, // link data index - link.rawIndex, + gEdge.rawIndex == null ? i : gEdge.rawIndex, // source name - target name - source.name + ' - ' + target.name, - // link weight - link.weight || 0, + gEdge.data.name || (source.id + ' - ' + target.id), + // link source id // special - // 这一项只是为了表明这是条边 - true); + source.id, + // link target id + // special2 + target.id); - this._linkShapes.push(linkShape); this.shapeList.push(linkShape); this.zr.addShape(linkShape); + gEdge.shape = linkShape; // Arrow shape if (serie.linkSymbol && serie.linkSymbol !== 'none') { @@ -591,12 +680,7 @@ Force.prototype = { iconType: serie.linkSymbol, brushType: 'fill', // Use same style with link shape - color: linkShape.style.strokeColor, - opacity: linkShape.style.opacity, - shadowBlur: linkShape.style.shadowBlur, - shadowColor: linkShape.style.shadowColor, - shadowOffsetX: linkShape.style.shadowOffsetX, - shadowOffsetY: linkShape.style.shadowOffsetY + color: linkShape.style.strokeColor }, highlightStyle: { brushType: 'fill' @@ -613,22 +697,29 @@ Force.prototype = { _updateLinkShapes: function () { var v = vec2.create(); - var links = this._filteredLinks; - for (var i = 0, len = links.length; i < len; i++) { - var link = links[i]; - var linkShape = this._linkShapes[i]; - var sourceShape = this._nodeShapes[link.source]; - var targetShape = this._nodeShapes[link.target]; - - linkShape.style.xStart = sourceShape.position[0]; - linkShape.style.yStart = sourceShape.position[1]; - linkShape.style.xEnd = targetShape.position[0]; - linkShape.style.yEnd = targetShape.position[1]; - - this.zr.modShape(linkShape.id); - - if (linkShape._symbolShape) { - var symbolShape = linkShape._symbolShape; + var edges = this._graph.edges; + for (var i = 0, len = edges.length; i < len; i++) { + var edge = edges[i]; + var sourceShape = edge.node1.shape; + var targetShape = edge.node2.shape; + + var p1 = sourceShape.position; + var p2 = targetShape.position; + + edge.shape.style.xStart = p1[0]; + edge.shape.style.yStart = p1[1]; + edge.shape.style.xEnd = p2[0]; + edge.shape.style.yEnd = p2[1]; + + if (edge.shape.type === 'bezier-curve') { + edge.shape.style.cpX1 = (p1[0] + p2[0]) / 2 - (p2[1] - p1[1]) / 4; + edge.shape.style.cpY1 = (p1[1] + p2[1]) / 2 - (p1[0] - p2[0]) / 4; + } + + edge.shape.modSelf(); + + if (edge.shape._symbolShape) { + var symbolShape = edge.shape._symbolShape; vec2.copy(symbolShape.position, targetShape.position); vec2.sub(v, sourceShape.position, targetShape.position); @@ -637,39 +728,37 @@ Force.prototype = { vec2.scaleAndAdd( symbolShape.position, symbolShape.position, v, targetShape.style.width / 2 + 2); - var angle; - if (v[1] < 0) { - angle = 2 * Math.PI - Math.acos(-v[0]); - } else { - angle = Math.acos(-v[0]); - } - symbolShape.rotation = angle - Math.PI / 2; + var angle = Math.atan2(v[1], v[0]); + symbolShape.rotation = Math.PI / 2 - angle; - this.zr.modShape(symbolShape.id); + symbolShape.modSelf(); } } }, - _update: function (e) { - - this._layout.temperature = this._temperature; - this._layout.update(); - - for (var i = 0; i < this._layout.nodes.length; i++) { - var position = this._layout.nodes[i].position; - var shape = this._nodeShapes[i]; - var node = this._filteredNodes[i]; - if (shape.fixed || (node.fixX && node.fixY)) { - vec2.copy(position, shape.position); - } else if (node.fixX) { - position[0] = shape.position[0]; - shape.position[1] = position[1]; - } else if (node.fixY) { - position[1] = shape.position[1]; - shape.position[0] = position[0]; - } else { - vec2.copy(shape.position, position); + _syncNodePositions: function () { + var graph = this._graph; + for (var i = 0; i < graph.nodes.length; i++) { + var gNode = graph.nodes[i]; + var position = gNode.layout.position; + var node = gNode.data; + var shape = gNode.shape; + var fixX = shape.fixed || node.fixX; + var fixY = shape.fixed || node.fixY; + if (fixX === true) { + fixX = 1; + } else if (isNaN(fixX)) { + fixX = 0; } + if (fixY === true) { + fixY = 1; + } else if (isNaN(fixY)) { + fixY = 0; + } + shape.position[0] += (position[0] - shape.position[0]) * (1 - fixX); + shape.position[1] += (position[1] - shape.position[1]) * (1 - fixY); + + vec2.copy(position, shape.position); var nodeName = node.name; if (nodeName) { @@ -679,92 +768,24 @@ Force.prototype = { } vec2.copy(gPos, position); } - } - - this._temperature *= this._coolDown; - }, - - _updateWorker: function (e) { - if (!this._updating) { - return; - } - - var positionArr = new Float32Array(e.data); - var token = positionArr[0]; - var ret = token === this._token; - // If token is from current layout instance - if (ret) { - var nNodes = (positionArr.length - 1) / 2; - - for (var i = 0; i < nNodes; i++) { - var shape = this._nodeShapes[i]; - var node = this._filteredNodes[i]; - - var x = positionArr[i * 2 + 1]; - var y = positionArr[i * 2 + 2]; - - if (shape.fixed || (node.fixX && node.fixY)) { - positionArr[i * 2 + 1] = shape.position[0]; - positionArr[i * 2 + 2] = shape.position[1]; - } else if (node.fixX) { - positionArr[i * 2 + 1] = shape.position[0]; - shape.position[1] = y; - } else if (node.fixY) { - positionArr[i * 2 + 2] = shape.position[1]; - shape.position[0] = x; - } else { - shape.position[0] = x; - shape.position[1] = y; - } - - var nodeName = node.name; - if (nodeName) { - var gPos = this.__nodePositionMap[nodeName]; - if (!gPos) { - gPos = this.__nodePositionMap[nodeName] = vec2.create(); - } - vec2.copy(gPos, shape.position); - } - } - this._layoutWorker.postMessage(positionArr.buffer, [positionArr.buffer]); + shape.modSelf(); } - - var self = this; - self._layoutWorker.postMessage({ - cmd: 'update', - steps: this._steps, - temperature: this._temperature, - coolDown: this._coolDown - }); - - for (var i = 0; i < this._steps; i++) { - this._temperature *= this._coolDown; - } - - return ret; }, _step: function (e) { - if (this._layoutWorker) { - var res = this._updateWorker(e); - if (!res) { - return; - } - } else { - if (this._temperature < 0.01) { - return; - } - this._update(); - } + this._syncNodePositions(); this._updateLinkShapes(); - for (var i = 0; i < this._nodeShapes.length; i++) { - this.zr.modShape(this._nodeShapes[i].id); - } + this.zr.refreshNextFrame(); - this.zr.refresh(); + if (this._layout.temperature > 0.01) { + this._layout.step(this._steps); + } else { + this.messageCenter.dispatch( + ecConfig.EVENT.FORCE_LAYOUT_END, {}, {}, this.myChart); + } }, refresh: function (newOption) { @@ -772,22 +793,59 @@ Force.prototype = { this.option = newOption; this.series = this.option.series; } - this.clear(); - this._buildShape(); + + this.legend = this.component.legend; + if (this.legend) { + this.getColor = function (param) { + return this.legend.getColor(param); + }; + this.isSelected = function (param) { + return this.legend.isSelected(param); + }; + } + else { + var colorMap = {}; + var count = 0; + this.getColor = function (key) { + if (colorMap[key]) { + return colorMap[key]; + } + if (!colorMap[key]) { + colorMap[key] = this.zr.getColor(count++); + } + + return colorMap[key]; + }; + this.isSelected = function () { + return true; + }; + } + + this._init(); }, dispose: function () { - this._updating = false; this.clear(); this.shapeList = null; this.effectList = null; - if (this._layoutWorker) { - this._layoutWorker.terminate(); - } - this._layoutWorker = null; + this._layout.dispose(); + this._layout = null; this.__nodePositionMap = {}; + }, + + getPosition: function () { + var position = []; + this._graph.eachNode(function (n) { + if (n.layout) { + position.push({ + name: n.data.name, + position: Array.prototype.slice.call(n.layout.position) + }); + } + }); + return position; } }; @@ -811,7 +869,8 @@ function ondragstart(param) { } function onmousemove() { - this._temperature = 0.8; + this._layout.temperature = 0.8; + this._step(); } /** @@ -838,22 +897,13 @@ function ondragend(param, status) { } function _randomInSquare(x, y, size) { - return [(Math.random() - 0.5) * size + x, (Math.random() - 0.5) * size + y]; -} - -function _filter(array, callback) { - var len = array.length; - var result = []; - for (var i = 0; i < len; i++) { - if (callback(array[i], i)) { - result.push(array[i]); - } - } - return result; + var v = vec2.create(); + v[0] = (Math.random() - 0.5) * size + x; + v[1] = (Math.random() - 0.5) * size + y; + return v; } zrUtil.inherits(Force, ChartBase); -zrUtil.inherits(Force, ComponentBase); // 图表注册 require('../chart.js').define('force', Force); diff --git a/src/chart/funnel.js b/src/chart/funnel.js index fb025f9..1c3f5ff 100644 --- a/src/chart/funnel.js +++ b/src/chart/funnel.js @@ -2,11 +2,10 @@ * echarts图表类:漏斗图 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ -var ComponentBase = require('../component/base.js'); var ChartBase = require('./base.js'); // 图形依赖 @@ -15,6 +14,63 @@ var LineShape = require('../zrender/shape/Line.js'); var PolygonShape = require('../zrender/shape/Polygon.js'); var ecConfig = require('../config.js'); +// 漏斗图默认参数 +ecConfig.funnel = { + zlevel: 0, + // 一级层叠 + z: 2, + // 二级层叠 + clickable: true, + legendHoverLink: true, + x: 80, + y: 60, + x2: 80, + y2: 60, + // width: {totalWidth} - x - x2, + // height: {totalHeight} - y - y2, + min: 0, + max: 100, + minSize: '0%', + maxSize: '100%', + sort: 'descending', + // 'ascending', 'descending' + gap: 0, + funnelAlign: 'center', + itemStyle: { + normal: { + // color: 各异, + borderColor: '#fff', + borderWidth: 1, + label: { + show: true, + position: 'outer' + // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调 + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + }, + labelLine: { + show: true, + length: 10, + lineStyle: { + // color: 各异, + width: 1, + type: 'solid' + } + } + }, + emphasis: { + // color: 各异, + borderColor: 'rgba(0,0,0,0)', + borderWidth: 1, + label: { + show: true + }, + labelLine: { + show: true + } + } + } +}; + var ecData = require('../util/ecData.js'); var number = require('../util/number.js'); var zrUtil = require('../zrender/tool/util.js'); @@ -30,10 +86,8 @@ var zrArea = require('../zrender/tool/area.js'); */ function Funnel(ecTheme, messageCenter, zr, option, myChart) { - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); // 图表基类 - ChartBase.call(this); + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); this.refresh(option); } @@ -52,12 +106,12 @@ Funnel.prototype = { var serieName; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type == ecConfig.CHART_TYPE_FUNNEL) { + if (series[i].type === ecConfig.CHART_TYPE_FUNNEL) { series[i] = this.reformOption(series[i]); + this.legendHoverLink = series[i].legendHoverLink || this.legendHoverLink; serieName = series[i].name || ''; // 系列图例开关 - this.selectedMap[serieName] = - legend ? legend.isSelected(serieName) : true; + this.selectedMap[serieName] = legend ? legend.isSelected(serieName) : true; if (!this.selectedMap[serieName]) { continue; } @@ -90,11 +144,8 @@ Funnel.prototype = { // 计算需要显示的个数和总值 for (var i = 0, l = data.length; i < l; i++) { itemName = data[i].name; - if (legend) { - this.selectedMap[itemName] = legend.isSelected(itemName); - } else { - this.selectedMap[itemName] = true; - } + this.selectedMap[itemName] = legend ? legend.isSelected(itemName) : true; + if (this.selectedMap[itemName] && !isNaN(data[i].value)) { selectedData.push(data[i]); total++; @@ -105,36 +156,67 @@ Funnel.prototype = { } // 可计算箱子 var funnelCase = this._buildFunnelCase(seriesIndex); + var align = serie.funnelAlign; var gap = serie.gap; var height = total > 1 ? (location.height - (total - 1) * gap) / total : location.height; var width; var lastY = location.y; - var lastWidth = serie.sort == 'descending' ? this._getItemWidth(seriesIndex, selectedData[0].value) : number.parsePercent(serie.minSize, location.width); - var next = serie.sort == 'descending' ? 1 : 0; + var lastWidth = serie.sort === 'descending' ? this._getItemWidth(seriesIndex, selectedData[0].value) : number.parsePercent(serie.minSize, location.width); + var next = serie.sort === 'descending' ? 1 : 0; var centerX = location.centerX; - var pointList = [ - [ - centerX - lastWidth / 2 - (lastWidth === 0 ? 0 : 10), lastY - (lastWidth === 0 ? 10 : 5)], - [ - centerX + lastWidth / 2 + (lastWidth === 0 ? 0 : 10), lastY - (lastWidth === 0 ? 10 : 5)] - ]; + var pointList = []; + var x; + var polygon; + var lastPolygon; for (var i = 0, l = selectedData.length; i < l; i++) { itemName = selectedData[i].name; if (this.selectedMap[itemName] && !isNaN(selectedData[i].value)) { - width = i <= l - 2 ? this._getItemWidth(seriesIndex, selectedData[i + next].value) : serie.sort == 'descending' ? number.parsePercent(serie.minSize, location.width) : number.parsePercent(serie.maxSize, location.width); - this._buildItem( - seriesIndex, selectedData[i]._index, legend ? legend.getColor(itemName) : this.zr.getColor(selectedData[i]._index), centerX - lastWidth / 2, lastY, lastWidth, width, height); + width = i <= l - 2 ? this._getItemWidth(seriesIndex, selectedData[i + next].value) : serie.sort === 'descending' ? number.parsePercent(serie.minSize, location.width) : number.parsePercent(serie.maxSize, location.width); + switch (align) { + case 'left': + x = location.x; + break; + case 'right': + x = location.x + location.width - lastWidth; + break; + default: + x = centerX - lastWidth / 2; + } + polygon = this._buildItem( + seriesIndex, selectedData[i]._index, legend // color + ? legend.getColor(itemName) : this.zr.getColor(selectedData[i]._index), x, lastY, lastWidth, width, height, align); lastY += height + gap; + lastPolygon = polygon.style.pointList; + + pointList.unshift([lastPolygon[0][0] - 10, lastPolygon[0][1]]); // 左 + pointList.push([lastPolygon[1][0] + 10, lastPolygon[1][1]]); // 右 + if (i === 0) { + if (lastWidth === 0) { + lastPolygon = pointList.pop(); + align == 'center' && (pointList[0][0] += 10); + align == 'right' && (pointList[0][0] = lastPolygon[0]); + pointList[0][1] -= align == 'center' ? 10 : 15; + if (l == 1) { + lastPolygon = polygon.style.pointList; + } + } + else { + pointList[pointList.length - 1][1] -= 5; + pointList[0][1] -= 5; + } + } lastWidth = width; - pointList.unshift([centerX - lastWidth / 2 - 10, lastY]); - pointList.push([centerX + lastWidth / 2 + 10, lastY]); } } + if (funnelCase) { + pointList.unshift([lastPolygon[3][0] - 10, lastPolygon[3][1]]); // 左 + pointList.push([lastPolygon[2][0] + 10, lastPolygon[2][1]]); // 右 if (lastWidth === 0) { - pointList.pop(); - pointList[0][0] += 10; - pointList[0][1] += 10; + lastPolygon = pointList.pop(); + align == 'center' && (pointList[0][0] += 10); + align == 'right' && (pointList[0][0] = lastPolygon[0]); + pointList[0][1] += align == 'center' ? 10 : 15; } else { pointList[pointList.length - 1][1] += 5; @@ -160,7 +242,7 @@ Funnel.prototype = { ], brushType: 'stroke', lineWidth: 1, - strokeColor: serie.calculableHolderColor || this.ecTheme.calculableHolderColor + strokeColor: serie.calculableHolderColor || this.ecTheme.calculableHolderColor || ecConfig.calculableHolderColor } }; ecData.pack(funnelCase, serie, seriesIndex, undefined, -1); @@ -178,27 +260,13 @@ Funnel.prototype = { var x = this.parsePercent(gridOption.x, zrWidth); var y = this.parsePercent(gridOption.y, zrHeight); - var width; - if (typeof gridOption.width == 'undefined') { - width = zrWidth - x - this.parsePercent(gridOption.x2, zrWidth); - } - else { - width = this.parsePercent(gridOption.width, zrWidth); - } - - var height; - if (typeof gridOption.height == 'undefined') { - height = zrHeight - y - this.parsePercent(gridOption.y2, zrHeight); - } - else { - height = this.parsePercent(gridOption.height, zrHeight); - } + var width = gridOption.width == null ? (zrWidth - x - this.parsePercent(gridOption.x2, zrWidth)) : this.parsePercent(gridOption.width, zrWidth); return { x: x, y: y, width: width, - height: height, + height: gridOption.height == null ? (zrHeight - y - this.parsePercent(gridOption.y2, zrHeight)) : this.parsePercent(gridOption.height, zrHeight), centerX: x + width / 2 }; }, @@ -211,10 +279,10 @@ Funnel.prototype = { } function numDescending(a, b) { - if (a.value == '-') { + if (a.value === '-') { return 1; } - else if (b.value == '-') { + else if (b.value === '-') { return -1; } return b.value - a.value; @@ -224,7 +292,7 @@ Funnel.prototype = { return -numDescending(a, b); } if (serie.sort != 'none') { - funnelData.sort(serie.sort == 'descending' ? numDescending : numAscending); + funnelData.sort(serie.sort === 'descending' ? numDescending : numAscending); } return funnelData; @@ -234,20 +302,21 @@ Funnel.prototype = { * 构建单个扇形及指标 */ _buildItem: function ( - seriesIndex, dataIndex, defaultColor, x, y, topWidth, bottomWidth, height) { + seriesIndex, dataIndex, defaultColor, x, y, topWidth, bottomWidth, height, align) { var series = this.series; var serie = series[seriesIndex]; var data = serie.data[dataIndex]; + // 漏斗 var polygon = this.getPolygon( - seriesIndex, dataIndex, defaultColor, x, y, topWidth, bottomWidth, height); + seriesIndex, dataIndex, defaultColor, x, y, topWidth, bottomWidth, height, align); ecData.pack( polygon, series[seriesIndex], seriesIndex, series[seriesIndex].data[dataIndex], dataIndex, series[seriesIndex].data[dataIndex].name); this.shapeList.push(polygon); // 文本标签 var label = this.getLabel( - seriesIndex, dataIndex, defaultColor, x, y, topWidth, bottomWidth, height); + seriesIndex, dataIndex, defaultColor, x, y, topWidth, bottomWidth, height, align); ecData.pack( label, series[seriesIndex], seriesIndex, series[seriesIndex].data[dataIndex], dataIndex, series[seriesIndex].data[dataIndex].name); this.shapeList.push(label); @@ -258,7 +327,7 @@ Funnel.prototype = { // 文本标签视觉引导线 var labelLine = this.getLabelLine( - seriesIndex, dataIndex, defaultColor, x, y, topWidth, bottomWidth, height); + seriesIndex, dataIndex, defaultColor, x, y, topWidth, bottomWidth, height, align); this.shapeList.push(labelLine); // 特定状态下是否需要显示文本标签引导线 if (!this._needLabelLine(serie, data, false)) { @@ -277,7 +346,8 @@ Funnel.prototype = { } polygon.hoverConnect = polygonHoverConnect; label.hoverConnect = labelHoverConnect; - polygon.onmouseover = label.onmouseover = this.hoverConnect; + + return polygon; }, /** @@ -297,29 +367,41 @@ Funnel.prototype = { * 构建扇形 */ getPolygon: function ( - seriesIndex, dataIndex, defaultColor, x, y, topWidth, bottomWidth, height) { + seriesIndex, dataIndex, defaultColor, xLT, y, topWidth, bottomWidth, height, align) { var serie = this.series[seriesIndex]; var data = serie.data[dataIndex]; var queryTarget = [data, serie]; // 多级控制 - var normal = this.deepMerge( - queryTarget, 'itemStyle.normal') || {}; - var emphasis = this.deepMerge( - queryTarget, 'itemStyle.emphasis') || {}; + var normal = this.deepMerge(queryTarget, 'itemStyle.normal') || {}; + var emphasis = this.deepMerge(queryTarget, 'itemStyle.emphasis') || {}; + var normalColor = this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) || defaultColor; - var emphasisColor = this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data) || (typeof normalColor == 'string' ? zrColor.lift(normalColor, -0.2) : normalColor); + var emphasisColor = this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data) || (typeof normalColor === 'string' ? zrColor.lift(normalColor, -0.2) : normalColor); + var xLB; + switch (align) { + case 'left': + xLB = xLT; + break; + case 'right': + xLB = xLT + (topWidth - bottomWidth); + break; + default: + xLB = xLT + (topWidth - bottomWidth) / 2; + break; + } var polygon = { - zlevel: this._zlevelBase, - clickable: true, + zlevel: this.getZlevelBase(), + z: this.getZBase(), + clickable: this.deepQuery(queryTarget, 'clickable'), style: { pointList: [ - [x, y], - [x + topWidth, y], - [x + topWidth - (topWidth - bottomWidth) / 2, y + height], - [x + (topWidth - bottomWidth) / 2, y + height] + [xLT, y], + [xLT + topWidth, y], + [xLB + bottomWidth, y + height], + [xLB, y + height] ], brushType: 'both', color: normalColor, @@ -345,7 +427,7 @@ Funnel.prototype = { * 需要显示则会有返回构建好的shape,否则返回undefined */ getLabel: function ( - seriesIndex, dataIndex, defaultColor, x, y, topWidth, bottomWidth, height) { + seriesIndex, dataIndex, defaultColor, x, y, topWidth, bottomWidth, height, align) { var serie = this.series[seriesIndex]; var data = serie.data[dataIndex]; var location = this._paramsMap[seriesIndex].location; @@ -361,35 +443,29 @@ Funnel.prototype = { var text = this.getLabelText(seriesIndex, dataIndex, status); var textFont = this.getFont(textStyle); var textAlign; - var textX; var textColor = defaultColor; labelControl.position = labelControl.position || itemStyle.normal.label.position; - if (labelControl.position == 'inner' || labelControl.position == 'inside') { + if (labelControl.position === 'inner' || labelControl.position === 'inside' || labelControl.position === 'center') { // 内部 - textAlign = 'center'; - textX = x + topWidth / 2; - if (Math.max(topWidth, bottomWidth) / 2 > zrArea.getTextWidth(text, textFont)) { - textColor = '#fff'; - } - else { - textColor = zrColor.reverse(defaultColor); - } + textAlign = align; + textColor = + Math.max(topWidth, bottomWidth) / 2 > zrArea.getTextWidth(text, textFont) ? '#fff' : zrColor.reverse(defaultColor); } - else if (labelControl.position == 'left') { + else if (labelControl.position === 'left') { // 左侧显示 textAlign = 'right'; - textX = lineLength == 'auto' ? (location.x - 10) : (location.centerX - Math.max(topWidth, bottomWidth) / 2 - lineLength); } else { - // 右侧显示,默认 labelControl.position == 'outer' || 'right) + // 右侧显示,默认 labelControl.position === 'outer' || 'right) textAlign = 'left'; - textX = lineLength == 'auto' ? (location.x + location.width + 10) : (location.centerX + Math.max(topWidth, bottomWidth) / 2 + lineLength); } var textShape = { - zlevel: this._zlevelBase + 1, + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, style: { - x: textX, + x: this._getLabelPoint( + labelControl.position, x, location, topWidth, bottomWidth, lineLength, align), y: y + height / 2, color: textStyle.color || textColor, text: text, @@ -409,29 +485,24 @@ Funnel.prototype = { text = this.getLabelText(seriesIndex, dataIndex, status); textFont = this.getFont(textStyle); textColor = defaultColor; - if (labelControl.position == 'inner' || labelControl.position == 'inside') { + if (labelControl.position === 'inner' || labelControl.position === 'inside' || labelControl.position === 'center') { // 内部 - textAlign = 'center'; - textX = x + topWidth / 2; - if (Math.max(topWidth, bottomWidth) / 2 > zrArea.getTextWidth(text, textFont)) { - textColor = '#fff'; - } - else { - textColor = zrColor.reverse(defaultColor); - } + textAlign = align; + textColor = + Math.max(topWidth, bottomWidth) / 2 > zrArea.getTextWidth(text, textFont) ? '#fff' : zrColor.reverse(defaultColor); } - else if (labelControl.position == 'left') { + else if (labelControl.position === 'left') { // 左侧显示 textAlign = 'right'; - textX = lineLength == 'auto' ? (location.x - 10) : (location.centerX - Math.max(topWidth, bottomWidth) / 2 - lineLength); } else { - // 右侧显示,默认 labelControl.position == 'outer' || 'right) + // 右侧显示,默认 labelControl.position === 'outer' || 'right) textAlign = 'left'; - textX = lineLength == 'auto' ? (location.x + location.width + 10) : (location.centerX + Math.max(topWidth, bottomWidth) / 2 + lineLength); } + textShape.highlightStyle = { - x: textX, + x: this._getLabelPoint( + labelControl.position, x, location, topWidth, bottomWidth, lineLength, align), color: textStyle.color || textColor, text: text, textAlign: textStyle.align || textAlign, @@ -452,13 +523,20 @@ Funnel.prototype = { var formatter = this.deepQuery([data, serie], 'itemStyle.' + status + '.label.formatter'); if (formatter) { - if (typeof formatter == 'function') { + if (typeof formatter === 'function') { return formatter.call( - this.myChart, serie.name, data.name, data.value); + this.myChart, { + seriesIndex: seriesIndex, + seriesName: serie.name || '', + series: serie, + dataIndex: dataIndex, + data: data, + name: data.name, + value: data.value + }); } - else if (typeof formatter == 'string') { - formatter = formatter.replace('{a}', '{a0}').replace('{b}', '{b0}').replace('{c}', '{c0}'); - formatter = formatter.replace('{a0}', serie.name).replace('{b0}', data.name).replace('{c0}', data.value); + else if (typeof formatter === 'string') { + formatter = formatter.replace('{a}', '{a0}').replace('{b}', '{b0}').replace('{c}', '{c0}').replace('{a0}', serie.name).replace('{b0}', data.name).replace('{c0}', data.value); return formatter; } @@ -472,7 +550,7 @@ Funnel.prototype = { * 需要显示则会有返回构建好的shape,否则返回undefined */ getLabelLine: function ( - seriesIndex, dataIndex, defaultColor, x, y, topWidth, bottomWidth, height) { + seriesIndex, dataIndex, defaultColor, x, y, topWidth, bottomWidth, height, align) { var serie = this.series[seriesIndex]; var data = serie.data[dataIndex]; var location = this._paramsMap[seriesIndex].location; @@ -488,26 +566,16 @@ Funnel.prototype = { var labelControl = itemStyle[status].label; labelControl.position = labelControl.position || itemStyle.normal.label.position; - var xEnd; - if (labelControl.position == 'inner' || labelControl.position == 'inside') { - // 内部 - xEnd = x + topWidth / 2; - } - else if (labelControl.position == 'left') { - // 左侧显示 - xEnd = lineLength == 'auto' ? (location.x - 10) : (location.centerX - Math.max(topWidth, bottomWidth) / 2 - lineLength); - } - else { - // 右侧显示,默认 labelControl.position == 'outer' || 'right) - xEnd = lineLength == 'auto' ? (location.x + location.width + 10) : (location.centerX + Math.max(topWidth, bottomWidth) / 2 + lineLength); - } + var lineShape = { - zlevel: this._zlevelBase + 1, + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, hoverable: false, style: { - xStart: location.centerX, + xStart: this._getLabelLineStartPoint(x, location, topWidth, bottomWidth, align), yStart: y + height / 2, - xEnd: xEnd, + xEnd: this._getLabelPoint( + labelControl.position, x, location, topWidth, bottomWidth, lineLength, align), yEnd: y + height / 2, strokeColor: lineStyle.color || defaultColor, lineType: lineStyle.type, @@ -523,20 +591,10 @@ Funnel.prototype = { labelControl = itemStyle[status].label || labelControl; labelControl.position = labelControl.position; - if (labelControl.position == 'inner' || labelControl.position == 'inside') { - // 内部 - xEnd = x + topWidth / 2; - } - else if (labelControl.position == 'left') { - // 左侧显示 - xEnd = lineLength == 'auto' ? (location.x - 10) : (location.centerX - Math.max(topWidth, bottomWidth) / 2 - lineLength); - } - else { - // 右侧显示,默认 labelControl.position == 'outer' || 'right) - xEnd = lineLength == 'auto' ? (location.x + location.width + 10) : (location.centerX + Math.max(topWidth, bottomWidth) / 2 + lineLength); - } + lineShape.highlightStyle = { - xEnd: xEnd, + xEnd: this._getLabelPoint( + labelControl.position, x, location, topWidth, bottomWidth, lineLength, align), strokeColor: lineStyle.color || defaultColor, lineType: lineStyle.type, lineWidth: lineStyle.width @@ -545,6 +603,47 @@ Funnel.prototype = { return new LineShape(lineShape); }, + _getLabelPoint: function (position, x, location, topWidth, bottomWidth, lineLength, align) { + position = (position === 'inner' || position === 'inside') ? 'center' : position; + switch (position) { + case 'center': + return align == 'center' ? (x + topWidth / 2) : align == 'left' ? (x + 10) : (x + topWidth - 10); + case 'left': + // 左侧文本 + if (lineLength === 'auto') { + return location.x - 10; + } + else { + return align == 'center' + // 居中布局 + ? (location.centerX - Math.max(topWidth, bottomWidth) / 2 - lineLength) : align == 'right' + // 右对齐布局 + ? (x - (topWidth < bottomWidth ? (bottomWidth - topWidth) : 0) - lineLength) + // 左对齐布局 + : (location.x - lineLength); + } + break; + default: + // 右侧文本 + if (lineLength === 'auto') { + return location.x + location.width + 10; + } + else { + return align == 'center' + // 居中布局 + ? (location.centerX + Math.max(topWidth, bottomWidth) / 2 + lineLength) : align == 'right' + // 右对齐布局 + ? (location.x + location.width + lineLength) + // 左对齐布局 + : (x + Math.max(topWidth, bottomWidth) + lineLength); + } + } + }, + + _getLabelLineStartPoint: function (x, location, topWidth, bottomWidth, align) { + return align == 'center' ? location.centerX : topWidth < bottomWidth ? (x + Math.min(topWidth, bottomWidth) / 2) : (x + Math.max(topWidth, bottomWidth) / 2); + }, + /** * 返回特定状态(normal or emphasis)下是否需要显示label标签文本 * @param {Object} serie @@ -580,7 +679,6 @@ Funnel.prototype = { }; zrUtil.inherits(Funnel, ChartBase); -zrUtil.inherits(Funnel, ComponentBase); // 图表注册 require('../chart.js').define('funnel', Funnel); diff --git a/src/chart/gauge.js b/src/chart/gauge.js index defeca1..331f09d 100644 --- a/src/chart/gauge.js +++ b/src/chart/gauge.js @@ -2,11 +2,10 @@ * echarts图表类:仪表盘 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ -var ComponentBase = require('../component/base.js'); var ChartBase = require('./base.js'); // 图形依赖 @@ -18,6 +17,102 @@ var CircleShape = require('../zrender/shape/Circle.js'); var SectorShape = require('../zrender/shape/Sector.js'); var ecConfig = require('../config.js'); +// 仪表盘默认参数 +ecConfig.gauge = { + zlevel: 0, + // 一级层叠 + z: 2, + // 二级层叠 + center: ['50%', '50%'], + // 默认全局居中 + clickable: true, + legendHoverLink: true, + radius: '75%', + startAngle: 225, + endAngle: -45, + min: 0, + // 最小值 + max: 100, + // 最大值 + precision: 0, + // 小数精度,默认为0,无小数点 + splitNumber: 10, + // 分割段数,默认为10 + axisLine: { // 坐标轴线 + show: true, + // 默认显示,属性show控制显示与否 + lineStyle: { // 属性lineStyle控制线条样式 + color: [ + [0.2, '#228b22'], + [0.8, '#48b'], + [1, '#ff4500'] + ], + width: 30 + } + }, + axisTick: { // 坐标轴小标记 + show: true, + // 属性show控制显示与否,默认不显示 + splitNumber: 5, + // 每份split细分多少段 + length: 8, + // 属性length控制线长 + lineStyle: { // 属性lineStyle控制线条样式 + color: '#eee', + width: 1, + type: 'solid' + } + }, + axisLabel: { // 坐标轴文本标签,详见axis.axisLabel + show: true, + // formatter: null, + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: 'auto' + } + }, + splitLine: { // 分隔线 + show: true, + // 默认显示,属性show控制显示与否 + length: 30, + // 属性length控制线长 + lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 + color: '#eee', + width: 2, + type: 'solid' + } + }, + pointer: { + show: true, + length: '80%', + width: 8, + color: 'auto' + }, + title: { + show: true, + offsetCenter: [0, '-40%'], + // x, y,单位px + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: '#333', + fontSize: 15 + } + }, + detail: { + show: true, + backgroundColor: 'rgba(0,0,0,0)', + borderWidth: 0, + borderColor: '#ccc', + width: 100, + height: 40, + offsetCenter: [0, '40%'], + // x, y,单位px + // formatter: null, + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: 'auto', + fontSize: 30 + } + } +}; + var ecData = require('../util/ecData.js'); var accMath = require('../util/accMath.js'); var zrUtil = require('../zrender/tool/util.js'); @@ -31,10 +126,8 @@ var zrUtil = require('../zrender/tool/util.js'); */ function Gauge(ecTheme, messageCenter, zr, option, myChart) { - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); // 图表基类 - ChartBase.call(this); + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); this.refresh(option); } @@ -48,8 +141,9 @@ Gauge.prototype = { // 复用参数索引 this._paramsMap = {}; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type == ecConfig.CHART_TYPE_GAUGE) { + if (series[i].type === ecConfig.CHART_TYPE_GAUGE) { series[i] = this.reformOption(series[i]); + this.legendHoverLink = series[i].legendHoverLink || this.legendHoverLink; this._buildSingleGauge(i); this.buildMark(i); } @@ -139,8 +233,7 @@ Gauge.prototype = { var min = serie.min; var total = serie.max - min; var splitLine = serie.splitLine; - var length = this.parsePercent( - splitLine.length, params.radius[1]); + var length = this.parsePercent(splitLine.length, params.radius[1]); var lineStyle = splitLine.lineStyle; var color = lineStyle.color; var center = params.center; @@ -157,14 +250,15 @@ Gauge.prototype = { sinAngle = Math.sin(angle); cosAngle = Math.cos(angle); this.shapeList.push(new LineShape({ - zlevel: this._zlevelBase + 1, + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, hoverable: false, style: { xStart: center[0] + cosAngle * r, yStart: center[1] - sinAngle * r, xEnd: center[0] + cosAngle * r0, yEnd: center[1] - sinAngle * r0, - strokeColor: color == 'auto' ? this._getColor(seriesIndex, min + total / splitNumber * i) : color, + strokeColor: color === 'auto' ? this._getColor(seriesIndex, min + total / splitNumber * i) : color, lineType: lineStyle.type, lineWidth: lineStyle.width, shadowColor: lineStyle.shadowColor, @@ -189,8 +283,7 @@ Gauge.prototype = { var total = serie.max - min; var axisTick = serie.axisTick; var tickSplit = axisTick.splitNumber; - var length = this.parsePercent( - axisTick.length, params.radius[1]); + var length = this.parsePercent(axisTick.length, params.radius[1]); var lineStyle = axisTick.lineStyle; var color = lineStyle.color; @@ -211,14 +304,15 @@ Gauge.prototype = { sinAngle = Math.sin(angle); cosAngle = Math.cos(angle); this.shapeList.push(new LineShape({ - zlevel: this._zlevelBase + 1, + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, hoverable: false, style: { xStart: center[0] + cosAngle * r, yStart: center[1] - sinAngle * r, xEnd: center[0] + cosAngle * r0, yEnd: center[1] - sinAngle * r0, - strokeColor: color == 'auto' ? this._getColor(seriesIndex, min + total / l * i) : color, + strokeColor: color === 'auto' ? this._getColor(seriesIndex, min + total / l * i) : color, lineType: lineStyle.type, lineWidth: lineStyle.width, shadowColor: lineStyle.shadowColor, @@ -248,26 +342,27 @@ Gauge.prototype = { var center = params.center; var startAngle = params.startAngle; var totalAngle = params.totalAngle; - var r0 = params.radius[1] - this.parsePercent( - serie.splitLine.length, params.radius[1]) - 10; + var r0 = params.radius[1] - this.parsePercent(serie.splitLine.length, params.radius[1]) - 5; var angle; var sinAngle; var cosAngle; var value; for (var i = 0; i <= splitNumber; i++) { - value = min + accMath.accMul(accMath.accDiv(total, splitNumber), i); + value = accMath.accAdd( + min, accMath.accMul(accMath.accDiv(total, splitNumber), i)); angle = startAngle - totalAngle / splitNumber * i; sinAngle = Math.sin(angle * Math.PI / 180); cosAngle = Math.cos(angle * Math.PI / 180); angle = (angle + 360) % 360; this.shapeList.push(new TextShape({ - zlevel: this._zlevelBase + 1, + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, hoverable: false, style: { x: center[0] + cosAngle * r0, y: center[1] - sinAngle * r0, - color: color == 'auto' ? this._getColor(seriesIndex, value) : color, + color: color === 'auto' ? this._getColor(seriesIndex, value) : color, text: this._getLabelText(serie.axisLabel.formatter, value), textAlign: (angle >= 110 && angle <= 250) ? 'left' : (angle <= 70 || angle >= 290) ? 'right' : 'center', textBaseline: (angle >= 10 && angle <= 170) ? 'top' : (angle >= 190 && angle <= 350) ? 'bottom' : 'middle', @@ -297,10 +392,12 @@ Gauge.prototype = { value = value < serie.max ? value : serie.max; var angle = (params.startAngle - params.totalAngle / total * (value - serie.min)) * Math.PI / 180; - var color = pointer.color == 'auto' ? this._getColor(seriesIndex, value) : pointer.color; + var color = pointer.color === 'auto' ? this._getColor(seriesIndex, value) : pointer.color; var pointShape = new GaugePointerShape({ - zlevel: this._zlevelBase + 1, + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + clickable: this.query(serie, 'clickable'), style: { x: center[0], y: center[1], @@ -325,7 +422,8 @@ Gauge.prototype = { this.shapeList.push(pointShape); this.shapeList.push(new CircleShape({ - zlevel: this._zlevelBase + 2, + zlevel: this.getZlevelBase(), + z: this.getZBase() + 2, hoverable: false, style: { x: center[0], @@ -343,8 +441,8 @@ Gauge.prototype = { } var data = serie.data[0]; - var name = typeof data.name != 'undefined' ? data.name : ''; - if (name !== '') { + var name = data.name != null ? data.name : ''; + if (name !== '') { // 不要帮我代码规范 var title = serie.title; var offsetCenter = title.offsetCenter; var textStyle = title.textStyle; @@ -353,12 +451,13 @@ Gauge.prototype = { var x = params.center[0] + this.parsePercent(offsetCenter[0], params.radius[1]); var y = params.center[1] + this.parsePercent(offsetCenter[1], params.radius[1]); this.shapeList.push(new TextShape({ - zlevel: this._zlevelBase + (Math.abs(x - params.center[0]) + Math.abs(y - params.center[1])) < textStyle.fontSize * 2 ? 2 : 1, + zlevel: this.getZlevelBase(), + z: this.getZBase() + ((Math.abs(x - params.center[0]) + Math.abs(y - params.center[1])) < textStyle.fontSize * 2 ? 2 : 1), hoverable: false, style: { x: x, y: y, - color: textColor == 'auto' ? this._getColor(seriesIndex) : textColor, + color: textColor === 'auto' ? this._getColor(seriesIndex) : textColor, text: name, textAlign: 'center', textFont: this.getFont(textStyle), @@ -388,7 +487,8 @@ Gauge.prototype = { var x = params.center[0] - detail.width / 2 + this.parsePercent(offsetCenter[0], params.radius[1]); var y = params.center[1] + this.parsePercent(offsetCenter[1], params.radius[1]); this.shapeList.push(new RectangleShape({ - zlevel: this._zlevelBase + (Math.abs(x + detail.width / 2 - params.center[0]) + Math.abs(y + detail.height / 2 - params.center[1])) < textStyle.fontSize ? 2 : 1, + zlevel: this.getZlevelBase(), + z: this.getZBase() + ((Math.abs(x + detail.width / 2 - params.center[0]) + Math.abs(y + detail.height / 2 - params.center[1])) < textStyle.fontSize ? 2 : 1), hoverable: false, style: { x: x, @@ -396,7 +496,7 @@ Gauge.prototype = { width: detail.width, height: detail.height, brushType: 'both', - color: color == 'auto' ? this._getColor(seriesIndex, value) : color, + color: color === 'auto' ? this._getColor(seriesIndex, value) : color, lineWidth: detail.borderWidth, strokeColor: detail.borderColor, @@ -408,14 +508,13 @@ Gauge.prototype = { text: this._getLabelText(detail.formatter, value), textFont: this.getFont(textStyle), textPosition: 'inside', - textColor: textColor == 'auto' ? this._getColor(seriesIndex, value) : textColor + textColor: textColor === 'auto' ? this._getColor(seriesIndex, value) : textColor } })); }, _getValue: function (seriesIndex) { - var data = this.series[seriesIndex].data[0]; - return typeof data.value != 'undefined' ? data.value : data; + return this.getDataFromOption(this.series[seriesIndex].data[0]); }, /** @@ -442,7 +541,7 @@ Gauge.prototype = { * 自动颜色 */ _getColor: function (seriesIndex, value) { - if (typeof value == 'undefined') { + if (value == null) { value = this._getValue(seriesIndex); } @@ -460,7 +559,8 @@ Gauge.prototype = { */ _getSector: function (center, r0, r, startAngle, endAngle, color, lineStyle) { return new SectorShape({ - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), hoverable: false, style: { x: center[0], @@ -488,10 +588,10 @@ Gauge.prototype = { */ _getLabelText: function (formatter, value) { if (formatter) { - if (typeof formatter == 'function') { + if (typeof formatter === 'function') { return formatter.call(this.myChart, value); } - else if (typeof formatter == 'string') { + else if (typeof formatter === 'string') { return formatter.replace('{value}', value); } } @@ -513,7 +613,6 @@ Gauge.prototype = { }; zrUtil.inherits(Gauge, ChartBase); -zrUtil.inherits(Gauge, ComponentBase); // 图表注册 require('../chart.js').define('gauge', Gauge); diff --git a/src/chart/island.js b/src/chart/island.js index 9ca3650..d6fa345 100644 --- a/src/chart/island.js +++ b/src/chart/island.js @@ -2,17 +2,25 @@ * echarts组件:孤岛数据 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ -var ComponentBase = require('../component/base.js'); var ChartBase = require('./base.js'); // 图形依赖 var CircleShape = require('../zrender/shape/Circle.js'); var ecConfig = require('../config.js'); +ecConfig.island = { + zlevel: 0, + // 一级层叠 + z: 5, + // 二级层叠 + r: 15, + calculateStep: 0.1 // 滚轮可计算步长 0.1 = 10% +}; + var ecData = require('../util/ecData.js'); var zrUtil = require('../zrender/tool/util.js'); var zrEvent = require('../zrender/tool/event.js'); @@ -25,10 +33,8 @@ var zrEvent = require('../zrender/tool/event.js'); */ function Island(ecTheme, messageCenter, zr, option, myChart) { - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, {}, myChart); // 图表基类 - ChartBase.call(this); + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); this._nameConnector; this._valueConnector; @@ -50,12 +56,7 @@ function Island(ecTheme, messageCenter, zr, option, myChart) { var value = ecData.get(shape, 'value'); var dvalue = value * self.option.island.calculateStep; - if (dvalue > 1) { - value = Math.round(value - dvalue * delta); - } - else { - value = (value - dvalue * delta).toFixed(2) - 0; - } + value = dvalue > 1 ? (Math.round(value - dvalue * delta)) : +(value - dvalue * delta).toFixed(2); var name = ecData.get(shape, 'name'); shape.style.text = name + ':' + value; @@ -64,7 +65,7 @@ function Island(ecTheme, messageCenter, zr, option, myChart) { ecData.set(shape, 'name', name); self.zr.modShape(shape.id); - self.zr.refresh(); + self.zr.refreshNextFrame(); zrEvent.stop(event); }; } @@ -115,7 +116,7 @@ Island.prototype = { var newHieght = this.zr.getHeight(); var xScale = newWidth / (this._zrWidth || newWidth); var yScale = newHieght / (this._zrHeight || newHieght); - if (xScale == 1 && yScale == 1) { + if (xScale === 1 && yScale === 1) { return; } this._zrWidth = newWidth; @@ -134,10 +135,11 @@ Island.prototype = { add: function (shape) { var name = ecData.get(shape, 'name'); var value = ecData.get(shape, 'value'); - var seriesName = typeof ecData.get(shape, 'series') != 'undefined' ? ecData.get(shape, 'series').name : ''; + var seriesName = ecData.get(shape, 'series') != null ? ecData.get(shape, 'series').name : ''; var font = this.getFont(this.option.island.textStyle); var islandShape = { - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), style: { x: shape.style.x, y: shape.style.y, @@ -151,7 +153,7 @@ Island.prototype = { onmousewheel: this.shapeHandler.onmousewheel, _type: 'island' }; - if (islandShape.style.color == '#fff') { + if (islandShape.style.color === '#fff') { islandShape.style.color = shape.style.strokeColor; } this.setCalculable(islandShape); @@ -229,7 +231,6 @@ Island.prototype = { }; zrUtil.inherits(Island, ChartBase); -zrUtil.inherits(Island, ComponentBase); // 图表注册 require('../chart.js').define('island', Island); diff --git a/src/chart/k.js b/src/chart/k.js index 26d7021..598f103 100644 --- a/src/chart/k.js +++ b/src/chart/k.js @@ -2,11 +2,10 @@ * echarts图表类:K线图 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ -var ComponentBase = require('../component/base.js'); var ChartBase = require('./base.js'); // 图形依赖 @@ -17,6 +16,39 @@ require('../component/grid.js'); require('../component/dataZoom.js'); var ecConfig = require('../config.js'); +// K线图默认参数 +ecConfig.k = { + zlevel: 0, + // 一级层叠 + z: 2, + // 二级层叠 + clickable: true, + hoverable: true, + legendHoverLink: false, + xAxisIndex: 0, + yAxisIndex: 0, + // barWidth: null // 默认自适应 + // barMaxWidth: null // 默认自适应 + itemStyle: { + normal: { + color: '#fff', + // 阳线填充颜色 + color0: '#00aa11', + // 阴线填充颜色 + lineStyle: { + width: 1, + color: '#ff3200', + // 阳线边框颜色 + color0: '#00aa11' // 阴线边框颜色 + } + }, + emphasis: { + // color: 各异, + // color0: 各异 + } + } +}; + var ecData = require('../util/ecData.js'); var zrUtil = require('../zrender/tool/util.js'); @@ -29,10 +61,8 @@ var zrUtil = require('../zrender/tool/util.js'); */ function K(ecTheme, messageCenter, zr, option, myChart) { - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); // 图表基类 - ChartBase.call(this); + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); this.refresh(option); } @@ -53,10 +83,11 @@ K.prototype = { }; var xAxis; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type == ecConfig.CHART_TYPE_K) { + if (series[i].type === ecConfig.CHART_TYPE_K) { series[i] = this.reformOption(series[i]); + this.legendHoverLink = series[i].legendHoverLink || this.legendHoverLink; xAxis = this.component.xAxis.getAxis(series[i].xAxisIndex); - if (xAxis.type == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY) { + if (xAxis.type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY) { _position2sIndexMap[xAxis.getPosition()].push(i); } } @@ -107,11 +138,7 @@ K.prototype = { for (var i = 0, l = seriesArray.length; i < l; i++) { serie = series[seriesArray[i]]; serieName = serie.name; - if (legend) { - this.selectedMap[serieName] = legend.isSelected(serieName); - } else { - this.selectedMap[serieName] = true; - } + this.selectedMap[serieName] = legend ? legend.isSelected(serieName) : true; if (this.selectedMap[serieName]) { locationMap.push(seriesArray[i]); @@ -159,14 +186,14 @@ K.prototype = { pointList[seriesIndex] = []; for (var i = 0, l = maxDataLength; i < l; i++) { - if (typeof categoryAxis.getNameByIndex(i) == 'undefined') { + if (categoryAxis.getNameByIndex(i) == null) { // 系列数据超出类目轴长度 break; } data = serie.data[i]; - value = typeof data != 'undefined' ? (typeof data.value != 'undefined' ? data.value : data) : '-'; - if (value == '-' || value.length != 4) { + value = this.getDataFromOption(data, '-'); + if (value === '-' || value.length != 4) { // 数据格式不符 continue; } @@ -221,7 +248,7 @@ K.prototype = { seriesPL = this._getLargePointList(seriesPL); } - if (serie.type == ecConfig.CHART_TYPE_K && typeof seriesPL != 'undefined') { + if (serie.type === ecConfig.CHART_TYPE_K && seriesPL != null) { // 多级控制 queryTarget = serie; nLineWidth = this.query( @@ -334,8 +361,10 @@ K.prototype = { seriesIndex, dataIndex, name, x, width, y0, y1, y2, y3, nColor, nLinewidth, nLineColor, eColor, eLinewidth, eLineColor) { var series = this.series; var itemShape = { - zlevel: this._zlevelBase, - clickable: true, + zlevel: this.getZlevelBase(), + z: this.getZBase(), + clickable: this.deepQuery([series[seriesIndex].data[dataIndex], series[seriesIndex]], 'clickable'), + hoverable: this.deepQuery([series[seriesIndex].data[dataIndex], series[seriesIndex]], 'hoverable'), style: { x: x, y: [y0, y1, y2, y3], @@ -403,10 +432,10 @@ K.prototype = { seriesIndex = this.shapeList[i]._seriesIndex; if (aniMap[seriesIndex] && !aniMap[seriesIndex][3]) { // 有数据删除才有移动的动画 - if (this.shapeList[i].type == 'candle') { + if (this.shapeList[i].type === 'candle') { dataIndex = ecData.get(this.shapeList[i], 'dataIndex'); serie = series[seriesIndex]; - if (aniMap[seriesIndex][2] && dataIndex == serie.data.length - 1) { + if (aniMap[seriesIndex][2] && dataIndex === serie.data.length - 1) { // 队头加入删除末尾 this.zr.delShape(this.shapeList[i].id); continue; @@ -421,7 +450,7 @@ K.prototype = { x = aniMap[seriesIndex][2] ? dx : -dx; y = 0; this.zr.animate(this.shapeList[i].id, '').when( - 500, { + this.query(this.option, 'animationDurationUpdate'), { position: [x, y] }).start(); } @@ -431,7 +460,6 @@ K.prototype = { }; zrUtil.inherits(K, ChartBase); -zrUtil.inherits(K, ComponentBase); // 图表注册 require('../chart.js').define('k', K); diff --git a/src/chart/line.js b/src/chart/line.js index 2b2f9d2..96ec2af 100644 --- a/src/chart/line.js +++ b/src/chart/line.js @@ -2,15 +2,14 @@ * echarts图表类:折线图 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ -var ComponentBase = require('../component/base.js'); var ChartBase = require('./base.js'); // 图形依赖 -var BrokenLineShape = require('../zrender/shape/BrokenLine.js'); +var PolylineShape = require('../zrender/shape/Polyline.js'); var IconShape = require('../util/shape/Icon.js'); var HalfSmoothPolygonShape = require('../util/shape/HalfSmoothPolygon.js'); // 组件依赖 @@ -19,6 +18,56 @@ require('../component/grid.js'); require('../component/dataZoom.js'); var ecConfig = require('../config.js'); +// 折线图默认参数 +ecConfig.line = { + zlevel: 0, + // 一级层叠 + z: 2, + // 二级层叠 + clickable: true, + legendHoverLink: true, + // stack: null + xAxisIndex: 0, + yAxisIndex: 0, + itemStyle: { + normal: { + // color: 各异, + label: { + show: false + // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调 + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 + // 'inside'|'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + }, + lineStyle: { + width: 2, + type: 'solid', + shadowColor: 'rgba(0,0,0,0)', + //默认透明 + shadowBlur: 0, + shadowOffsetX: 0, + shadowOffsetY: 0 + } + }, + emphasis: { + // color: 各异, + label: { + show: false + // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调 + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 + // 'inside'|'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + } + } + }, + // smooth: false, + // symbol: null, // 拐点图形类型 + symbolSize: 2, + // 拐点图形大小 + // symbolRotate: null, // 拐点图形旋转控制 + showAllSymbol: false // 标志图形默认只有主轴显示(随主轴标签间隔隐藏策略) +}; + var ecData = require('../util/ecData.js'); var zrUtil = require('../zrender/tool/util.js'); var zrColor = require('../zrender/tool/color.js'); @@ -32,10 +81,8 @@ var zrColor = require('../zrender/tool/color.js'); */ function Line(ecTheme, messageCenter, zr, option, myChart) { - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); // 图表基类 - ChartBase.call(this); + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); this.refresh(option); } @@ -46,160 +93,8 @@ Line.prototype = { * 绘制图形 */ _buildShape: function () { - var series = this.series; this.finalPLMap = {}; // 完成的point list(PL) - this._sIndex2ColorMap = {}; // series默认颜色索引,seriesIndex索引到color - this._symbol = this.option.symbolList; - this._sIndex2ShapeMap = {}; // series拐点图形类型,seriesIndex索引到shape type - - this.selectedMap = {}; - this.xMarkMap = {}; - - // 水平垂直双向series索引 ,position索引到seriesIndex - var _position2sIndexMap = { - top: [], - bottom: [], - left: [], - right: [] - }; - var xAxisIndex; - var yAxisIndex; - var xAxis; - var yAxis; - for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type == this.type) { - series[i] = this.reformOption(series[i]); - xAxisIndex = series[i].xAxisIndex; - yAxisIndex = series[i].yAxisIndex; - xAxis = this.component.xAxis.getAxis(xAxisIndex); - yAxis = this.component.yAxis.getAxis(yAxisIndex); - if (xAxis.type == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY) { - _position2sIndexMap[xAxis.getPosition()].push(i); - } - else if (yAxis.type == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY) { - _position2sIndexMap[yAxis.getPosition()].push(i); - } - } - } - // console.log(_position2sIndexMap); - for (var position in _position2sIndexMap) { - if (_position2sIndexMap[position].length > 0) { - this._buildSinglePosition( - position, _position2sIndexMap[position]); - } - } - this.addShapeList(); - }, - - /** - * 构建单个方向上的折线图 - * - * @param {number} seriesIndex 系列索引 - */ - _buildSinglePosition: function (position, seriesArray) { - var mapData = this._mapData(seriesArray); - var locationMap = mapData.locationMap; - var maxDataLength = mapData.maxDataLength; - - if (maxDataLength === 0 || locationMap.length === 0) { - return; - } - switch (position) { - case 'bottom': - case 'top': - this._buildHorizontal(seriesArray, maxDataLength, locationMap, this.xMarkMap); - break; - case 'left': - case 'right': - this._buildVertical(seriesArray, maxDataLength, locationMap, this.xMarkMap); - break; - } - - for (var i = 0, l = seriesArray.length; i < l; i++) { - this.buildMark(seriesArray[i]); - } - }, - - /** - * 数据整形 - * 数组位置映射到系列索引 - */ - _mapData: function (seriesArray) { - var series = this.series; - var serie; // 临时映射变量 - var dataIndex = 0; // 堆积数据所在位置映射 - var stackMap = {}; // 堆积数据位置映射,堆积组在二维中的第几项 - var magicStackKey = '__kener__stack__'; // 堆积命名,非堆积数据安单一堆积处理 - var stackKey; // 临时映射变量 - var serieName; // 临时映射变量 - var legend = this.component.legend; - var locationMap = []; // 需要返回的东西:数组位置映射到系列索引 - var maxDataLength = 0; // 需要返回的东西:最大数据长度 - var iconShape; - // 计算需要显示的个数和分配位置并记在下面这个结构里 - for (var i = 0, l = seriesArray.length; i < l; i++) { - serie = series[seriesArray[i]]; - serieName = serie.name; - - this._sIndex2ShapeMap[seriesArray[i]] = this._sIndex2ShapeMap[seriesArray[i]] || this.query(serie, 'symbol') || this._symbol[i % this._symbol.length]; - - if (legend) { - this.selectedMap[serieName] = legend.isSelected(serieName); - - this._sIndex2ColorMap[seriesArray[i]] = legend.getColor(serieName); - - iconShape = legend.getItemShape(serieName); - if (iconShape) { - // 回调legend,换一个更形象的icon - iconShape.style.iconType = 'legendLineIcon'; - iconShape.style.symbol = - this._sIndex2ShapeMap[seriesArray[i]]; - - legend.setItemShape(serieName, iconShape); - } - } else { - this.selectedMap[serieName] = true; - this._sIndex2ColorMap[seriesArray[i]] = this.zr.getColor(seriesArray[i]); - } - - if (this.selectedMap[serieName]) { - stackKey = serie.stack || (magicStackKey + seriesArray[i]); - if (typeof stackMap[stackKey] == 'undefined') { - stackMap[stackKey] = dataIndex; - locationMap[dataIndex] = [seriesArray[i]]; - dataIndex++; - } - else { - // 已经分配了位置就推进去就行 - locationMap[stackMap[stackKey]].push(seriesArray[i]); - } - } - // 兼职帮算一下最大长度 - maxDataLength = Math.max(maxDataLength, serie.data.length); - } -/* 调试输出 - var s = ''; - for (var i = 0, l = maxDataLength; i < l; i++) { - s = '['; - for (var j = 0, k = locationMap.length; j < k; j++) { - s +='[' - for (var m = 0, n = locationMap[j].length - 1; m < n; m++) { - s += series[locationMap[j][m]].data[i] + ',' - } - s += series[locationMap[j][locationMap[j].length - 1]] - .data[i]; - s += ']' - } - s += ']'; - console.log(s); - } - console.log(locationMap) - */ - - return { - locationMap: locationMap, - maxDataLength: maxDataLength - }; + this._buildPosition(); }, /** @@ -210,9 +105,7 @@ Line.prototype = { // 确定类目轴和数值轴,同一方向随便找一个即可 var seriesIndex = locationMap[0][0]; var serie = series[seriesIndex]; - var xAxisIndex = serie.xAxisIndex; - var categoryAxis = this.component.xAxis.getAxis(xAxisIndex); - var yAxisIndex; // 数值轴各异 + var categoryAxis = this.component.xAxis.getAxis(serie.xAxisIndex || 0); var valueAxis; // 数值轴各异 var x; @@ -226,21 +119,21 @@ Line.prototype = { var data; var value; for (var i = 0, l = maxDataLength; i < l; i++) { - if (typeof categoryAxis.getNameByIndex(i) == 'undefined') { + if (categoryAxis.getNameByIndex(i) == null) { // 系列数据超出类目轴长度 break; } x = categoryAxis.getCoordByIndex(i); for (var j = 0, k = locationMap.length; j < k; j++) { // 堆积数据用第一条valueAxis - yAxisIndex = series[locationMap[j][0]].yAxisIndex || 0; - valueAxis = this.component.yAxis.getAxis(yAxisIndex); + valueAxis = this.component.yAxis.getAxis( + series[locationMap[j][0]].yAxisIndex || 0); baseYP = lastYP = baseYN = lastYN = valueAxis.getCoord(0); for (var m = 0, n = locationMap[j].length; m < n; m++) { seriesIndex = locationMap[j][m]; serie = series[seriesIndex]; data = serie.data[i]; - value = typeof data != 'undefined' ? (typeof data.value != 'undefined' ? data.value : data) : '-'; + value = this.getDataFromOption(data, '-'); curPLMap[seriesIndex] = curPLMap[seriesIndex] || []; xMarkMap[seriesIndex] = xMarkMap[seriesIndex] || { min: Number.POSITIVE_INFINITY, @@ -249,7 +142,7 @@ Line.prototype = { counter: 0, average: 0 }; - if (value == '-') { + if (value === '-') { // 空数据则把正在记录的curPLMap添加到finalPLMap中 if (curPLMap[seriesIndex].length > 0) { this.finalPLMap[seriesIndex] = @@ -297,7 +190,7 @@ Line.prototype = { seriesIndex = locationMap[j][m]; serie = series[seriesIndex]; data = serie.data[i]; - value = typeof data != 'undefined' ? (typeof data.value != 'undefined' ? data.value : data) : '-'; + value = this.getDataFromOption(data, '-'); if (value != '-') { // 只关心空数据 continue; @@ -322,28 +215,7 @@ Line.prototype = { } } - for (var j = 0, k = locationMap.length; j < k; j++) { - for (var m = 0, n = locationMap[j].length; m < n; m++) { - seriesIndex = locationMap[j][m]; - if (xMarkMap[seriesIndex].counter > 0) { - xMarkMap[seriesIndex].average = (xMarkMap[seriesIndex].sum / xMarkMap[seriesIndex].counter).toFixed(2) - 0; - } - y = this.component.yAxis.getAxis(series[seriesIndex].yAxisIndex || 0).getCoord(xMarkMap[seriesIndex].average); - xMarkMap[seriesIndex].averageLine = [ - [this.component.grid.getX(), y], - [this.component.grid.getXend(), y] - ]; - - xMarkMap[seriesIndex].minLine = [ - [this.component.grid.getX(), xMarkMap[seriesIndex].minY], - [this.component.grid.getXend(), xMarkMap[seriesIndex].minY] - ]; - xMarkMap[seriesIndex].maxLine = [ - [this.component.grid.getX(), xMarkMap[seriesIndex].maxY], - [this.component.grid.getXend(), xMarkMap[seriesIndex].maxY] - ]; - } - } + this._calculMarkMapXY(xMarkMap, locationMap, 'y'); this._buildBorkenLine(seriesArray, this.finalPLMap, categoryAxis, 'horizontal'); }, @@ -356,9 +228,7 @@ Line.prototype = { // 确定类目轴和数值轴,同一方向随便找一个即可 var seriesIndex = locationMap[0][0]; var serie = series[seriesIndex]; - var yAxisIndex = serie.yAxisIndex; - var categoryAxis = this.component.yAxis.getAxis(yAxisIndex); - var xAxisIndex; // 数值轴各异 + var categoryAxis = this.component.yAxis.getAxis(serie.yAxisIndex || 0); var valueAxis; // 数值轴各异 var x; @@ -372,21 +242,21 @@ Line.prototype = { var data; var value; for (var i = 0, l = maxDataLength; i < l; i++) { - if (typeof categoryAxis.getNameByIndex(i) == 'undefined') { + if (categoryAxis.getNameByIndex(i) == null) { // 系列数据超出类目轴长度 break; } y = categoryAxis.getCoordByIndex(i); for (var j = 0, k = locationMap.length; j < k; j++) { // 堆积数据用第一条valueAxis - xAxisIndex = series[locationMap[j][0]].xAxisIndex || 0; - valueAxis = this.component.xAxis.getAxis(xAxisIndex); + valueAxis = this.component.xAxis.getAxis( + series[locationMap[j][0]].xAxisIndex || 0); baseXP = lastXP = baseXN = lastXN = valueAxis.getCoord(0); for (var m = 0, n = locationMap[j].length; m < n; m++) { seriesIndex = locationMap[j][m]; serie = series[seriesIndex]; data = serie.data[i]; - value = typeof data != 'undefined' ? (typeof data.value != 'undefined' ? data.value : data) : '-'; + value = this.getDataFromOption(data, '-'); curPLMap[seriesIndex] = curPLMap[seriesIndex] || []; xMarkMap[seriesIndex] = xMarkMap[seriesIndex] || { min: Number.POSITIVE_INFINITY, @@ -395,7 +265,7 @@ Line.prototype = { counter: 0, average: 0 }; - if (value == '-') { + if (value === '-') { // 空数据则把正在记录的curPLMap添加到finalPLMap中 if (curPLMap[seriesIndex].length > 0) { this.finalPLMap[seriesIndex] = @@ -443,7 +313,7 @@ Line.prototype = { seriesIndex = locationMap[j][m]; serie = series[seriesIndex]; data = serie.data[i]; - value = typeof data != 'undefined' ? (typeof data.value != 'undefined' ? data.value : data) : '-'; + value = this.getDataFromOption(data, '-'); if (value != '-') { // 只关心空数据 continue; @@ -468,93 +338,138 @@ Line.prototype = { } } + this._calculMarkMapXY(xMarkMap, locationMap, 'x'); + + this._buildBorkenLine(seriesArray, this.finalPLMap, categoryAxis, 'vertical'); + }, + + /** + * 构建双数值轴折线图 + */ + _buildOther: function (seriesArray, maxDataLength, locationMap, xMarkMap) { + var series = this.series; + var curPLMap = {}; // 正在记录的point list(PL) + var xAxis; + for (var j = 0, k = locationMap.length; j < k; j++) { for (var m = 0, n = locationMap[j].length; m < n; m++) { - seriesIndex = locationMap[j][m]; - if (xMarkMap[seriesIndex].counter > 0) { - xMarkMap[seriesIndex].average = (xMarkMap[seriesIndex].sum / xMarkMap[seriesIndex].counter).toFixed(2) - 0; + var seriesIndex = locationMap[j][m]; + var serie = series[seriesIndex]; + xAxis = this.component.xAxis.getAxis(serie.xAxisIndex || 0); + var yAxis = this.component.yAxis.getAxis(serie.yAxisIndex || 0); + var baseY = yAxis.getCoord(0); + + curPLMap[seriesIndex] = curPLMap[seriesIndex] || []; + xMarkMap[seriesIndex] = xMarkMap[seriesIndex] || { + min0: Number.POSITIVE_INFINITY, + min1: Number.POSITIVE_INFINITY, + max0: Number.NEGATIVE_INFINITY, + max1: Number.NEGATIVE_INFINITY, + sum0: 0, + sum1: 0, + counter0: 0, + counter1: 0, + average0: 0, + average1: 0 + }; + + for (var i = 0, l = serie.data.length; i < l; i++) { + var data = serie.data[i]; + var value = this.getDataFromOption(data, '-'); + if (!(value instanceof Array)) { + continue; + } + + var x = xAxis.getCoord(value[0]); + var y = yAxis.getCoord(value[1]); + curPLMap[seriesIndex].push( + // x, y, dataIndex, name, 填充用 + [x, y, i, value[0], x, baseY]); + + if (xMarkMap[seriesIndex].min0 > value[0]) { + xMarkMap[seriesIndex].min0 = value[0]; + xMarkMap[seriesIndex].minY0 = y; + xMarkMap[seriesIndex].minX0 = x; + } + if (xMarkMap[seriesIndex].max0 < value[0]) { + xMarkMap[seriesIndex].max0 = value[0]; + xMarkMap[seriesIndex].maxY0 = y; + xMarkMap[seriesIndex].maxX0 = x; + } + xMarkMap[seriesIndex].sum0 += value[0]; + xMarkMap[seriesIndex].counter0++; + + if (xMarkMap[seriesIndex].min1 > value[1]) { + xMarkMap[seriesIndex].min1 = value[1]; + xMarkMap[seriesIndex].minY1 = y; + xMarkMap[seriesIndex].minX1 = x; + } + if (xMarkMap[seriesIndex].max1 < value[1]) { + xMarkMap[seriesIndex].max1 = value[1]; + xMarkMap[seriesIndex].maxY1 = y; + xMarkMap[seriesIndex].maxX1 = x; + } + xMarkMap[seriesIndex].sum1 += value[1]; + xMarkMap[seriesIndex].counter1++; } + } + } - x = this.component.xAxis.getAxis(series[seriesIndex].xAxisIndex || 0).getCoord(xMarkMap[seriesIndex].average); - - xMarkMap[seriesIndex].averageLine = [ - [x, this.component.grid.getYend()], - [x, this.component.grid.getY()] - ]; - xMarkMap[seriesIndex].minLine = [ - [xMarkMap[seriesIndex].minX, this.component.grid.getYend()], - [xMarkMap[seriesIndex].minX, this.component.grid.getY()] - ]; - xMarkMap[seriesIndex].maxLine = [ - [xMarkMap[seriesIndex].maxX, this.component.grid.getYend()], - [xMarkMap[seriesIndex].maxX, this.component.grid.getY()] - ]; + // 把剩余未完成的curPLMap全部添加到finalPLMap中 + for (var sId in curPLMap) { + if (curPLMap[sId].length > 0) { + this.finalPLMap[sId] = this.finalPLMap[sId] || []; + this.finalPLMap[sId].push(curPLMap[sId]); + curPLMap[sId] = []; } } - this._buildBorkenLine(seriesArray, this.finalPLMap, categoryAxis, 'vertical'); + this._calculMarkMapXY(xMarkMap, locationMap, 'xy'); + + this._buildBorkenLine(seriesArray, this.finalPLMap, xAxis, 'other'); }, /** * 生成折线和折线上的拐点 */ - _buildBorkenLine: function (seriesArray, pointList, categoryAxis, orient) { + _buildBorkenLine: function (seriesArray, pointList, categoryAxis, curOrient) { + var orient = curOrient == 'other' ? 'horizontal' : curOrient; var series = this.series; - var defaultColor; - - // 折线相关 - var lineWidth; - var lineType; - var lineColor; - var normalColor; - - // 填充相关 - var isFill; - var fillNormalColor; - - var serie; var data; - var seriesPL; - var singlePL; - var brokenLineShape; - var halfSmoothPolygonShape; - - var isLarge; // 堆积层叠需求,反顺序构建 - var seriesIndex; for (var sIdx = seriesArray.length - 1; sIdx >= 0; sIdx--) { - seriesIndex = seriesArray[sIdx]; - serie = series[seriesIndex]; - seriesPL = pointList[seriesIndex]; - if (serie.type == this.type && typeof seriesPL != 'undefined') { - defaultColor = this._sIndex2ColorMap[seriesIndex]; - // 多级控制 - lineWidth = this.query( + var seriesIndex = seriesArray[sIdx]; + var serie = series[seriesIndex]; + var seriesPL = pointList[seriesIndex]; + if (serie.type === this.type && seriesPL != null) { + var bbox = this._getBbox(seriesIndex, orient); + var defaultColor = this._sIndex2ColorMap[seriesIndex]; + // 折线相关,多级控制 + var lineWidth = this.query( serie, 'itemStyle.normal.lineStyle.width'); - lineType = this.query( + var lineType = this.query( serie, 'itemStyle.normal.lineStyle.type'); - lineColor = this.query( + var lineColor = this.query( serie, 'itemStyle.normal.lineStyle.color'); - normalColor = this.getItemStyleColor( + var normalColor = this.getItemStyleColor( this.query(serie, 'itemStyle.normal.color'), seriesIndex, -1); - isFill = typeof this.query( - serie, 'itemStyle.normal.areaStyle') != 'undefined'; - - fillNormalColor = this.query( + // 填充相关 + var isFill = this.query(serie, 'itemStyle.normal.areaStyle') != null; + var fillNormalColor = this.query( serie, 'itemStyle.normal.areaStyle.color'); for (var i = 0, l = seriesPL.length; i < l; i++) { - singlePL = seriesPL[i]; - isLarge = this._isLarge(orient, singlePL); + var singlePL = seriesPL[i]; + var isLarge = curOrient != 'other' && this._isLarge(orient, singlePL); if (!isLarge) { // 非大数据模式才显示拐点symbol for (var j = 0, k = singlePL.length; j < k; j++) { data = serie.data[singlePL[j][2]]; - if (this.deepQuery([data, serie], 'showAllSymbol') // 全显示 - || (categoryAxis.isMainAxis(singlePL[j][2]) && this.deepQuery([data, serie], 'symbol') != 'none') // 主轴非空 - || this.deepQuery([data, serie, this.option], 'calculable') // 可计算 - ) { + if (this.deepQuery([data, serie, this.option], 'calculable') // 可计算 + || this.deepQuery([data, serie], 'showAllSymbol') // 全显示 + || (categoryAxis.type === 'categoryAxis' // 主轴非空 + && categoryAxis.isMainAxis(singlePL[j][2]) && this.deepQuery([data, serie], 'symbol') != 'none')) { this.shapeList.push(this._getSymbol( seriesIndex, singlePL[j][2], // dataIndex singlePL[j][3], // name @@ -570,8 +485,9 @@ Line.prototype = { } // 折线图 - brokenLineShape = new BrokenLineShape({ - zlevel: this._zlevelBase, + var polylineShape = new PolylineShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), style: { miterLimit: lineWidth, pointList: singlePL, @@ -579,6 +495,7 @@ Line.prototype = { lineWidth: lineWidth, lineType: lineType, smooth: this._getSmooth(serie.smooth), + smoothConstraint: bbox, shadowColor: this.query( serie, 'itemStyle.normal.lineStyle.shadowColor'), shadowBlur: this.query( @@ -595,13 +512,14 @@ Line.prototype = { }); ecData.pack( - brokenLineShape, series[seriesIndex], seriesIndex, 0, i, series[seriesIndex].name); + polylineShape, series[seriesIndex], seriesIndex, 0, i, series[seriesIndex].name); - this.shapeList.push(brokenLineShape); + this.shapeList.push(polylineShape); if (isFill) { - halfSmoothPolygonShape = new HalfSmoothPolygonShape({ - zlevel: this._zlevelBase, + var halfSmoothPolygonShape = new HalfSmoothPolygonShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), style: { miterLimit: lineWidth, pointList: zrUtil.clone(singlePL).concat([ @@ -612,8 +530,12 @@ Line.prototype = { ]), brushType: 'fill', smooth: this._getSmooth(serie.smooth), + smoothConstraint: bbox, color: fillNormalColor ? fillNormalColor : zrColor.alpha(defaultColor, 0.5) }, + highlightStyle: { + brushType: 'fill' + }, hoverable: false, _main: true, _seriesIndex: seriesIndex, @@ -628,12 +550,31 @@ Line.prototype = { } }, + _getBbox: function (seriesIndex, orient) { + var bbox = this.component.grid.getBbox(); + var xMarkMap = this.xMarkMap[seriesIndex]; + if (xMarkMap.minX0 != null) { + return [[ + Math.min(xMarkMap.minX0, xMarkMap.maxX0, xMarkMap.minX1, xMarkMap.maxX1), Math.min(xMarkMap.minY0, xMarkMap.maxY0, xMarkMap.minY1, xMarkMap.maxY1)], [ + Math.max(xMarkMap.minX0, xMarkMap.maxX0, xMarkMap.minX1, xMarkMap.maxX1), Math.max(xMarkMap.minY0, xMarkMap.maxY0, xMarkMap.minY1, xMarkMap.maxY1)]]; + } + else if (orient === 'horizontal') { + bbox[0][1] = Math.min(xMarkMap.minY, xMarkMap.maxY); + bbox[1][1] = Math.max(xMarkMap.minY, xMarkMap.maxY); + } + else { + bbox[0][0] = Math.min(xMarkMap.minX, xMarkMap.maxX); + bbox[1][0] = Math.max(xMarkMap.minX, xMarkMap.maxX); + } + return bbox; + }, + _isLarge: function (orient, singlePL) { if (singlePL.length < 2) { return false; } else { - return orient == 'horizontal' ? (Math.abs(singlePL[0][0] - singlePL[1][0]) < 0.5) : (Math.abs(singlePL[0][1] - singlePL[1][1]) < 0.5); + return orient === 'horizontal' ? (Math.abs(singlePL[0][0] - singlePL[1][0]) < 0.5) : (Math.abs(singlePL[0][1] - singlePL[1][1]) < 0.5); } }, @@ -642,7 +583,7 @@ Line.prototype = { */ _getLargePointList: function (orient, singlePL) { var total; - if (orient == 'horizontal') { + if (orient === 'horizontal') { total = this.component.grid.getWidth(); } else { @@ -661,7 +602,7 @@ Line.prototype = { if (isSmooth) { /* 不科学啊,发现0.3通用了 var delta; - if (orient == 'horizontal') { + if (orient === 'horizontal') { delta = Math.abs(pointList[0][0] - pointList[1][0]); } else { @@ -680,7 +621,7 @@ Line.prototype = { */ _getCalculableItem: function (seriesIndex, dataIndex, name, x, y, orient) { var series = this.series; - var color = series[seriesIndex].calculableHolderColor || this.ecTheme.calculableHolderColor; + var color = series[seriesIndex].calculableHolderColor || this.ecTheme.calculableHolderColor || ecConfig.calculableHolderColor; var itemShape = this._getSymbol( seriesIndex, dataIndex, name, x, y, orient); @@ -703,9 +644,10 @@ Line.prototype = { var data = serie.data[dataIndex]; var itemShape = this.getSymbolShape( - serie, seriesIndex, data, dataIndex, name, x, y, this._sIndex2ShapeMap[seriesIndex], this._sIndex2ColorMap[seriesIndex], '#fff', orient == 'vertical' ? 'horizontal' : 'vertical' // 翻转 + serie, seriesIndex, data, dataIndex, name, x, y, this._sIndex2ShapeMap[seriesIndex], this._sIndex2ColorMap[seriesIndex], '#fff', orient === 'vertical' ? 'horizontal' : 'vertical' // 翻转 ); - itemShape.zlevel = this._zlevelBase + 1; + itemShape.zlevel = this.getZlevelBase(); + itemShape.z = this.getZBase() + 1; if (this.deepQuery([data, serie, this.option], 'calculable')) { this.setCalculable(itemShape); @@ -722,10 +664,11 @@ Line.prototype = { var xAxis = this.component.xAxis.getAxis(serie.xAxisIndex); var yAxis = this.component.yAxis.getAxis(serie.yAxisIndex); - if (mpData.type && (mpData.type == 'max' || mpData.type == 'min' || mpData.type == 'average')) { + if (mpData.type && (mpData.type === 'max' || mpData.type === 'min' || mpData.type === 'average')) { // 特殊值内置支持 + var valueIndex = mpData.valueIndex != null ? mpData.valueIndex : xMarkMap.maxX0 != null ? '1' : ''; return [ - xMarkMap[mpData.type + 'X'], xMarkMap[mpData.type + 'Y'], xMarkMap[mpData.type + 'Line'], xMarkMap[mpData.type]]; + xMarkMap[mpData.type + 'X' + valueIndex], xMarkMap[mpData.type + 'Y' + valueIndex], xMarkMap[mpData.type + 'Line' + valueIndex], xMarkMap[mpData.type + valueIndex]]; } return [ @@ -759,7 +702,7 @@ Line.prototype = { for (var i = 0, l = seriesPL.length; i < l; i++) { singlePL = seriesPL[i]; for (var j = 0, k = singlePL.length; j < k; j++) { - if (dataIndex == singlePL[j][2]) { + if (dataIndex === singlePL[j][2]) { tipShape.push(this._getSymbol( seriesIndex[len], // seriesIndex singlePL[j][2], // dataIndex @@ -799,32 +742,28 @@ Line.prototype = { // 主线动画 dx = Math.abs(pointList[0][0] - pointList[1][0]); dy = Math.abs(pointList[0][1] - pointList[1][1]); - isHorizontal = - this.shapeList[i]._orient == 'horizontal'; + isHorizontal = this.shapeList[i]._orient === 'horizontal'; if (aniMap[seriesIndex][2]) { // 队头加入删除末尾 - if (this.shapeList[i].type == 'polygon') { + if (this.shapeList[i].type === 'half-smooth-polygon') { //区域图 var len = pointList.length; this.shapeList[i].style.pointList[len - 3] = pointList[len - 2]; - isHorizontal ? (this.shapeList[i].style.pointList[len - 3][0] = pointList[len - 4][0]) : (this.shapeList[i].style.pointList[len - 3][1] = pointList[len - 4][1]); + this.shapeList[i].style.pointList[len - 3][isHorizontal ? 0 : 1] = pointList[len - 4][isHorizontal ? 0 : 1]; this.shapeList[i].style.pointList[len - 2] = pointList[len - 1]; } this.shapeList[i].style.pointList.pop(); - isHorizontal ? (x = dx, y = 0) : (x = 0, y = -dy); } else { // 队尾加入删除头部 this.shapeList[i].style.pointList.shift(); - if (this.shapeList[i].type == 'polygon') { + if (this.shapeList[i].type === 'half-smooth-polygon') { //区域图 - var targetPoint = - this.shapeList[i].style.pointList.pop(); + var targetPoint = this.shapeList[i].style.pointList.pop(); isHorizontal ? (targetPoint[0] = pointList[0][0]) : (targetPoint[1] = pointList[0][1]); - this.shapeList[i].style.pointList.push( - targetPoint); + this.shapeList[i].style.pointList.push(targetPoint); } isHorizontal ? (x = -dx, y = 0) : (x = 0, y = dy); } @@ -838,7 +777,7 @@ Line.prototype = { } else { // 拐点动画 - if (aniMap[seriesIndex][2] && this.shapeList[i]._dataIndex == series[seriesIndex].data.length - 1) { + if (aniMap[seriesIndex][2] && this.shapeList[i]._dataIndex === series[seriesIndex].data.length - 1) { // 队头加入删除末尾 this.zr.delShape(this.shapeList[i].id); continue; @@ -851,7 +790,7 @@ Line.prototype = { } this.shapeList[i].position = [0, 0]; this.zr.animate(this.shapeList[i].id, '').when( - 500, { + this.query(this.option, 'animationDurationUpdate'), { position: [x, y] }).start(); } @@ -859,7 +798,7 @@ Line.prototype = { } }; -function legendLineIcon(ctx, style) { +function legendLineIcon(ctx, style, refreshNextFrame) { var x = style.x; var y = style.y; var width = style.width; @@ -878,7 +817,7 @@ function legendLineIcon(ctx, style) { y -= 1; symbol = 'star'; } - else if (symbol == 'rectangle' || symbol == 'arrow') { + else if (symbol === 'rectangle' || symbol === 'arrow') { x += (width - height) / 2; width = height; } @@ -900,16 +839,19 @@ function legendLineIcon(ctx, style) { ctx.lineTo(x2 + 5, y2 + dy); ctx.moveTo(x2 + style.width - 5, y2 + dy); ctx.lineTo(x2 + style.width, y2 + dy); - - symbol(ctx, { + var self = this; + symbol( + ctx, { x: x + 4, y: y + 4, width: width - 8, height: height - 8, n: dy, image: imageLocation + }, function () { + self.modSelf(); + refreshNextFrame(); }); - } else { ctx.moveTo(x, y + dy); @@ -919,7 +861,6 @@ function legendLineIcon(ctx, style) { IconShape.prototype.iconLibrary['legendLineIcon'] = legendLineIcon; zrUtil.inherits(Line, ChartBase); -zrUtil.inherits(Line, ComponentBase); // 图表注册 require('../chart.js').define('line', Line); diff --git a/src/chart/map.js b/src/chart/map.js index a2598c3..ec32ede 100644 --- a/src/chart/map.js +++ b/src/chart/map.js @@ -2,11 +2,10 @@ * echarts图表类:地图 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ -var ComponentBase = require('../component/base.js'); var ChartBase = require('./base.js'); // 图形依赖 @@ -19,8 +18,67 @@ var PolygonShape = require('../zrender/shape/Polygon.js'); var EllipseShape = require('../zrender/shape/Ellipse.js'); // 组件依赖 require('../component/dataRange.js'); +require('../component/roamController.js'); var ecConfig = require('../config.js'); +// 地图默认参数 +ecConfig.map = { + zlevel: 0, + // 一级层叠 + z: 2, + // 二级层叠 + mapType: 'china', + // 各省的mapType暂时都用中文 + //mapLocation: { + // x: 'center' | 'left' | 'right' | 'x%' | {number}, + // y: 'center' | 'top' | 'bottom' | 'x%' | {number} + // width // 自适应 + // height // 自适应 + //}, + // mapValueCalculation: 'sum', // 数值合并方式,默认加和,可选为: + // 'sum' | 'average' | 'max' | 'min' + mapValuePrecision: 0, + // 地图数值计算结果小数精度 + showLegendSymbol: true, + // 显示图例颜色标识(系列标识的小圆点),存在legend时生效 + // selectedMode: false, // 选择模式,默认关闭,可选single,multiple + dataRangeHoverLink: true, + hoverable: true, + clickable: true, + // roam: false, // 是否开启缩放及漫游模式 + // scaleLimit: null, + itemStyle: { + normal: { + // color: 各异, + borderColor: 'rgba(0,0,0,0)', + borderWidth: 1, + areaStyle: { + color: '#ccc' + }, + label: { + show: false, + textStyle: { + color: 'rgb(139,69,19)' + } + } + }, + emphasis: { // 也是选中样式 + // color: 各异, + borderColor: 'rgba(0,0,0,0)', + borderWidth: 1, + areaStyle: { + color: 'rgba(255,215,0,0.8)' + }, + label: { + show: false, + textStyle: { + color: 'rgb(100,0,0)' + } + } + } + } +}; + var ecData = require('../util/ecData.js'); var zrUtil = require('../zrender/tool/util.js'); var zrConfig = require('../zrender/config.js'); @@ -39,27 +97,33 @@ var _geoCoord = require('../util/mapData/geoCoord.js'); */ function Map(ecTheme, messageCenter, zr, option, myChart) { - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); // 图表基类 - ChartBase.call(this); + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); var self = this; - self._onmousewheel = function (param) { - return self.__onmousewheel(param); + self._onmousewheel = function (params) { + return self.__onmousewheel(params); }; - self._onmousedown = function (param) { - return self.__onmousedown(param); + self._onmousedown = function (params) { + return self.__onmousedown(params); }; - self._onmousemove = function (param) { - return self.__onmousemove(param); + self._onmousemove = function (params) { + return self.__onmousemove(params); }; - self._onmouseup = function (param) { - return self.__onmouseup(param); + self._onmouseup = function (params) { + return self.__onmouseup(params); + }; + self._onroamcontroller = function (params) { + return self.__onroamcontroller(params); + }; + self._ondrhoverlink = function (params) { + return self.__ondrhoverlink(params); }; this._isAlive = true; // 活着标记 this._selectedMode = {}; // 选择模式 + this._activeMapType = {}; // 当前活跃的地图类型 + this._clickable = {}; // 悬浮高亮模式,索引到图表 this._hoverable = {}; // 悬浮高亮模式,索引到图表 this._showLegendSymbol = {}; // 显示图例颜色标识 this._selected = {}; // 地图选择状态 @@ -70,11 +134,11 @@ function Map(ecTheme, messageCenter, zr, option, myChart) { this._refreshDelayTicket; // 滚轮缩放时让refresh飞一会 this._mapDataRequireCounter; // 异步回调计数器 this._markAnimation = false; + this._hoverLinkMap = {}; // 漫游相关信息 this._roamMap = {}; this._scaleLimitMap = {}; - this._needRoam; this._mx; this._my; this._mousedown; @@ -82,10 +146,11 @@ function Map(ecTheme, messageCenter, zr, option, myChart) { this._curMapType; // 当前移动的地图类型 this.refresh(option); - if (this._needRoam) { - this.zr.on(zrConfig.EVENT.MOUSEWHEEL, this._onmousewheel); - this.zr.on(zrConfig.EVENT.MOUSEDOWN, this._onmousedown); - } + + this.zr.on(zrConfig.EVENT.MOUSEWHEEL, this._onmousewheel); + this.zr.on(zrConfig.EVENT.MOUSEDOWN, this._onmousedown); + messageCenter.bind(ecConfig.EVENT.ROAMCONTROLLER, this._onroamcontroller); + messageCenter.bind(ecConfig.EVENT.DATA_RANGE_HOVERLINK, this._ondrhoverlink); } Map.prototype = { @@ -107,7 +172,6 @@ Map.prototype = { var mapSeries = {}; var mapValuePrecision = {}; var valueCalculation = {}; - this._needRoam = false; for (var i = 0, l = series.length; i < l; i++) { if (series[i].type == ecConfig.CHART_TYPE_MAP) { // map series[i] = this.reformOption(series[i]); @@ -119,7 +183,8 @@ Map.prototype = { series[i].scaleLimit && zrUtil.merge(this._scaleLimitMap[mapType], series[i].scaleLimit, true); this._roamMap[mapType] = series[i].roam || this._roamMap[mapType]; - this._needRoam = this._needRoam || this._roamMap[mapType]; + + this._hoverLinkMap[mapType] = series[i].dataRangeHoverLink || this._hoverLinkMap[mapType]; this._nameMap[mapType] = this._nameMap[mapType] || {}; series[i].nameMap && zrUtil.merge(this._nameMap[mapType], series[i].nameMap, true); @@ -135,12 +200,16 @@ Map.prototype = { } this._selectedMode[mapType] = this._selectedMode[mapType] || series[i].selectedMode; - if (typeof this._hoverable[mapType] == 'undefined' || this._hoverable[mapType] // false 1票否决 - ) { + if (this._hoverable[mapType] == null || this._hoverable[mapType]) { + // false 1票否决 this._hoverable[mapType] = series[i].hoverable; } - if (typeof this._showLegendSymbol[mapType] == 'undefined' || this._showLegendSymbol[mapType] // false 1票否决 - ) { + if (this._clickable[mapType] == null || this._clickable[mapType]) { + // false 1票否决 + this._clickable[mapType] = series[i].clickable; + } + if (this._showLegendSymbol[mapType] == null || this._showLegendSymbol[mapType]) { + // false 1票否决 this._showLegendSymbol[mapType] = series[i].showLegendSymbol; } @@ -162,7 +231,7 @@ Map.prototype = { data[j][key]; } else if (!isNaN(data[j].value)) { - typeof valueData[mapType][name].value == 'undefined' && (valueData[mapType][name].value = 0); + valueData[mapType][name].value == null && (valueData[mapType][name].value = 0); valueData[mapType][name].value += data[j].value; } @@ -218,7 +287,7 @@ Map.prototype = { _mapDataCallback: function (mt, vd, ms) { var self = this; return function (md) { - if (!self._isAlive) { + if (!self._isAlive || self._activeMapType[mt] == null) { // 异步地图数据回调时有可能实例已经被释放 return; } @@ -247,7 +316,7 @@ Map.prototype = { self._buildMark(mt, ms); if (--self._mapDataRequireCounter <= 0) { self.addShapeList(); - self.zr.refresh(); + self.zr.refreshNextFrame(); } }; }, @@ -501,19 +570,9 @@ Map.prototype = { //y = isNaN(cusY) ? padding : cusY; y = this.parsePercent(cusY, zrHeight); y = isNaN(y) ? padding : y; - if (typeof width == 'undefined') { - width = zrWidth - x - 2 * padding; - } - else { - width = this.parsePercent(width, zrWidth); - } - if (typeof height == 'undefined') { - height = zrHeight - y - 2 * padding; - } - else { - height = this.parsePercent(height, zrHeight); - } + width = width == null ? (zrWidth - x - 2 * padding) : (this.parsePercent(width, zrWidth)); + height = height == null ? (zrHeight - y - 2 * padding) : (this.parsePercent(height, zrHeight)); var mapWidth = bbox.width; var mapHeight = bbox.height; @@ -592,7 +651,6 @@ Map.prototype = { var data; var value; var queryTarget; - var defaultOption = this.ecTheme.map; var color; var font; @@ -619,7 +677,8 @@ Map.prototype = { seriesName += series[data.seriesIndex[j]].name + ' '; if (legend && this._showLegendSymbol[mapType] && legend.hasColor(series[data.seriesIndex[j]].name)) { this.shapeList.push(new CircleShape({ - zlevel: this._zlevelBase + 1, + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, position: zrUtil.clone(style.position), _mapType: mapType, /* @@ -638,7 +697,6 @@ Map.prototype = { })); } } - queryTarget.push(defaultOption); // level 1 value = data.value; } else { @@ -648,9 +706,10 @@ Map.prototype = { for (var key in mapSeries) { queryTarget.push(series[key]); } - queryTarget.push(defaultOption); value = '-'; } + this.ecTheme.map && queryTarget.push(this.ecTheme.map); // level 1 + queryTarget.push(ecConfig); // level 1 // 值域控件控制 color = (dataRange && !isNaN(value)) ? dataRange.getColor(value) : null; @@ -678,8 +737,10 @@ Map.prototype = { font = this.deepQuery(queryTarget, 'itemStyle.normal.label.textStyle'); // 文字标签避免覆盖单独一个shape textShape = { - zlevel: this._zlevelBase + 1, - hoverable: this._hoverable[mapType], + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, + //hoverable: this._hoverable[mapType], + //clickable: this._clickable[mapType], position: zrUtil.clone(style.position), _mapType: mapType, _geo: this.pos2geo( @@ -713,15 +774,17 @@ Map.prototype = { } shape = { - zlevel: this._zlevelBase, - hoverable: this._hoverable[mapType], + zlevel: this.getZlevelBase(), + z: this.getZBase(), + //hoverable: this._hoverable[mapType], + //clickable: this._clickable[mapType], position: zrUtil.clone(style.position), style: style, highlightStyle: highlightStyle, _style: zrUtil.clone(style), _mapType: mapType }; - if (typeof style.scale != 'undefined') { + if (style.scale != null) { shape.scale = zrUtil.clone(style.scale); } @@ -744,7 +807,9 @@ Map.prototype = { break; default: shape = new PathShape(shape); - shape.pathArray = shape._parsePathData(shape.style.path); + if (shape.buildPathArray) { + shape.style.pathArray = shape.buildPathArray(shape.style.path); + } break; } @@ -753,21 +818,23 @@ Map.prototype = { shape.style = shape.highlightStyle; } + textShape.clickable = shape.clickable = + this._clickable[mapType] && (data.clickable == null || data.clickable); + if (this._selectedMode[mapType]) { - this._selected[name] = typeof this._selected[name] != 'undefined' ? this._selected[name] : data.selected; + this._selected[name] = this._selected[name] != null ? this._selected[name] : data.selected; this._mapTypeMap[name] = mapType; - if (typeof data.selectable == 'undefined' || data.selectable) { + if (data.selectable == null || data.selectable) { shape.clickable = textShape.clickable = true; shape.onclick = textShape.onclick = this.shapeHandler.onclick; } } - if (this._hoverable[mapType] && (typeof data.hoverable == 'undefined' || data.hoverable)) { + if (this._hoverable[mapType] && (data.hoverable == null || data.hoverable)) { textShape.hoverable = shape.hoverable = true; shape.hoverConnect = textShape.id; textShape.hoverConnect = shape.id; - shape.onmouseover = textShape.onmouseover = this.hoverConnect; } else { textShape.hoverable = shape.hoverable = false; @@ -797,6 +864,9 @@ Map.prototype = { this.markAttachStyle = this.markAttachStyle || {}; var position = [ this._mapDataMap[mapType].transform.left, this._mapDataMap[mapType].transform.top]; + if (mapType == 'none') { + position = [0, 0]; + } for (var sIdx in mapSeries) { this._seriesIndexToMapType[sIdx] = mapType; this.markAttachStyle[sIdx] = { @@ -851,9 +921,10 @@ Map.prototype = { var height; for (var mapType in this._mapDataMap) { transform = this._mapDataMap[mapType].transform; - if (!transform || !this._roamMap[mapType]) { + if (!transform || !this._roamMap[mapType] || !this._activeMapType[mapType]) { continue; } + left = transform.left; top = transform.top; width = transform.width; @@ -868,93 +939,110 @@ Map.prototype = { /** * 滚轮缩放 */ - __onmousewheel: function (param) { + __onmousewheel: function (params) { if (this.shapeList.length <= 0) { return; } - var event = param.event; + + var event = params.event; var mx = zrEvent.getX(event); var my = zrEvent.getY(event); - var delta = zrEvent.getDelta(event); - //delta = delta > 0 ? (-1) : 1; - var mapType = this._findMapTypeByPos(mx, my); - if (mapType) { - zrEvent.stop(event); - var transform = this._mapDataMap[mapType].transform; - var left = transform.left; - var top = transform.top; - var width = transform.width; - var height = transform.height; - // 位置转经纬度 - var geoAndPos = this.pos2geo(mapType, [mx - left, my - top]); - if (delta > 0) { - delta = 1.2; // 放大 - if (typeof this._scaleLimitMap[mapType].max != 'undefined' && transform.baseScale >= this._scaleLimitMap[mapType].max) { - return; // 缩放限制 - } - } - else { - delta = 1 / 1.2; // 缩小 - if (typeof this._scaleLimitMap[mapType].min != 'undefined' && transform.baseScale <= this._scaleLimitMap[mapType].min) { - return; // 缩放限制 - } + var delta; + var eventDelta = zrEvent.getDelta(event); + //eventDelta = eventDelta > 0 ? (-1) : 1; + var mapType; + var mapTypeControl = params.mapTypeControl; + if (!mapTypeControl) { + mapTypeControl = {}; + mapType = this._findMapTypeByPos(mx, my); + if (mapType && this._roamMap[mapType] && this._roamMap[mapType] != 'move') { + mapTypeControl[mapType] = true; } - transform.baseScale *= delta; - transform.scale.x *= delta; - transform.scale.y *= delta; - transform.width = width * delta; - transform.height = height * delta; - - this._mapDataMap[mapType].hasRoam = true; - this._mapDataMap[mapType].transform = transform; - // 经纬度转位置 - geoAndPos = this.geo2pos(mapType, geoAndPos); - // 保持视觉中心 - transform.left -= geoAndPos[0] - (mx - left); - transform.top -= geoAndPos[1] - (my - top); - this._mapDataMap[mapType].transform = transform; - - this.clearEffectShape(true); - for (var i = 0, l = this.shapeList.length; i < l; i++) { - if (this.shapeList[i]._mapType == mapType) { - this.shapeList[i].position[0] = transform.left; - this.shapeList[i].position[1] = transform.top; - if (this.shapeList[i].type == 'path' || this.shapeList[i].type == 'symbol' || this.shapeList[i].type == 'circle' || this.shapeList[i].type == 'rectangle' || this.shapeList[i].type == 'polygon' || this.shapeList[i].type == 'line' || this.shapeList[i].type == 'ellipse') { - this.shapeList[i].scale[0] *= delta; - this.shapeList[i].scale[1] *= delta; - } - else if (this.shapeList[i].type == 'mark-line') { - this.shapeList[i].style.pointListLength = undefined; - this.shapeList[i].style.pointList = false; - geoAndPos = this.geo2pos(mapType, this.shapeList[i]._geo[0]); - this.shapeList[i].style.xStart = geoAndPos[0]; - this.shapeList[i].style.yStart = geoAndPos[1]; - geoAndPos = this.geo2pos(mapType, this.shapeList[i]._geo[1]); - this.shapeList[i]._x = this.shapeList[i].style.xEnd = geoAndPos[0]; - this.shapeList[i]._y = this.shapeList[i].style.yEnd = geoAndPos[1]; + } + + var haveScale = false; + for (mapType in mapTypeControl) { + if (mapTypeControl[mapType]) { + haveScale = true; + var transform = this._mapDataMap[mapType].transform; + var left = transform.left; + var top = transform.top; + var width = transform.width; + var height = transform.height; + // 位置转经纬度 + var geoAndPos = this.pos2geo(mapType, [mx - left, my - top]); + if (eventDelta > 0) { + delta = 1.2; // 放大 + if (this._scaleLimitMap[mapType].max != null && transform.baseScale >= this._scaleLimitMap[mapType].max) { + continue; // 缩放限制 } - else if (this.shapeList[i].type == 'icon') { - geoAndPos = this.geo2pos(mapType, this.shapeList[i]._geo); - this.shapeList[i].style.x = this.shapeList[i].style._x = - geoAndPos[0] - this.shapeList[i].style.width / 2; - this.shapeList[i].style.y = this.shapeList[i].style._y = - geoAndPos[1] - this.shapeList[i].style.height / 2; + } + else { + delta = 1 / 1.2; // 缩小 + if (this._scaleLimitMap[mapType].min != null && transform.baseScale <= this._scaleLimitMap[mapType].min) { + continue; // 缩放限制 } - else { - geoAndPos = this.geo2pos(mapType, this.shapeList[i]._geo); - this.shapeList[i].style.x = geoAndPos[0]; - this.shapeList[i].style.y = geoAndPos[1]; - if (this.shapeList[i].type == 'text') { - this.shapeList[i]._style.x = this.shapeList[i].highlightStyle.x = geoAndPos[0]; - this.shapeList[i]._style.y = this.shapeList[i].highlightStyle.y = geoAndPos[1]; + } + + transform.baseScale *= delta; + transform.scale.x *= delta; + transform.scale.y *= delta; + transform.width = width * delta; + transform.height = height * delta; + + this._mapDataMap[mapType].hasRoam = true; + this._mapDataMap[mapType].transform = transform; + // 经纬度转位置 + geoAndPos = this.geo2pos(mapType, geoAndPos); + // 保持视觉中心 + transform.left -= geoAndPos[0] - (mx - left); + transform.top -= geoAndPos[1] - (my - top); + this._mapDataMap[mapType].transform = transform; + + this.clearEffectShape(true); + for (var i = 0, l = this.shapeList.length; i < l; i++) { + if (this.shapeList[i]._mapType == mapType) { + this.shapeList[i].position[0] = transform.left; + this.shapeList[i].position[1] = transform.top; + if (this.shapeList[i].type == 'path' || this.shapeList[i].type == 'symbol' || this.shapeList[i].type == 'circle' || this.shapeList[i].type == 'rectangle' || this.shapeList[i].type == 'polygon' || this.shapeList[i].type == 'line' || this.shapeList[i].type == 'ellipse') { + this.shapeList[i].scale[0] *= delta; + this.shapeList[i].scale[1] *= delta; + } + else if (this.shapeList[i].type == 'mark-line') { + this.shapeList[i].style.pointListLength = undefined; + this.shapeList[i].style.pointList = false; + geoAndPos = this.geo2pos(mapType, this.shapeList[i]._geo[0]); + this.shapeList[i].style.xStart = geoAndPos[0]; + this.shapeList[i].style.yStart = geoAndPos[1]; + geoAndPos = this.geo2pos(mapType, this.shapeList[i]._geo[1]); + this.shapeList[i]._x = this.shapeList[i].style.xEnd = geoAndPos[0]; + this.shapeList[i]._y = this.shapeList[i].style.yEnd = geoAndPos[1]; + } + else if (this.shapeList[i].type == 'icon' || this.shapeList[i].type == 'image') { + geoAndPos = this.geo2pos(mapType, this.shapeList[i]._geo); + this.shapeList[i].style.x = this.shapeList[i].style._x = + geoAndPos[0] - this.shapeList[i].style.width / 2; + this.shapeList[i].style.y = this.shapeList[i].style._y = + geoAndPos[1] - this.shapeList[i].style.height / 2; + } + else { + geoAndPos = this.geo2pos(mapType, this.shapeList[i]._geo); + this.shapeList[i].style.x = geoAndPos[0]; + this.shapeList[i].style.y = geoAndPos[1]; + if (this.shapeList[i].type == 'text') { + this.shapeList[i]._style.x = this.shapeList[i].highlightStyle.x = geoAndPos[0]; + this.shapeList[i]._style.y = this.shapeList[i].highlightStyle.y = geoAndPos[1]; + } } - } - this.zr.modShape(this.shapeList[i].id); + this.zr.modShape(this.shapeList[i].id); + } } } - - this.zr.refresh(); + } + if (haveScale) { + zrEvent.stop(event); + this.zr.refreshNextFrame(); var self = this; clearTimeout(this._refreshDelayTicket); @@ -965,30 +1053,29 @@ Map.prototype = { }, 100); this.messageCenter.dispatch( - ecConfig.EVENT.MAP_ROAM, param.event, { + ecConfig.EVENT.MAP_ROAM, params.event, { type: 'scale' }, this.myChart); } }, - __onmousedown: function (param) { + __onmousedown: function (params) { if (this.shapeList.length <= 0) { return; } - var target = param.target; + var target = params.target; if (target && target.draggable) { return; } - var event = param.event; + var event = params.event; var mx = zrEvent.getX(event); var my = zrEvent.getY(event); var mapType = this._findMapTypeByPos(mx, my); - if (mapType) { + if (mapType && this._roamMap[mapType] && this._roamMap[mapType] != 'scale') { this._mousedown = true; this._mx = mx; this._my = my; this._curMapType = mapType; - this.zr.on(zrConfig.EVENT.MOUSEUP, this._onmouseup); var self = this; setTimeout(function () { @@ -998,11 +1085,11 @@ Map.prototype = { }, - __onmousemove: function (param) { + __onmousemove: function (params) { if (!this._mousedown || !this._isAlive) { return; } - var event = param.event; + var event = params.event; var mx = zrEvent.getX(event); var my = zrEvent.getY(event); var transform = this._mapDataMap[this._curMapType].transform; @@ -1022,19 +1109,19 @@ Map.prototype = { } this.messageCenter.dispatch( - ecConfig.EVENT.MAP_ROAM, param.event, { + ecConfig.EVENT.MAP_ROAM, params.event, { type: 'move' }, this.myChart); this.clearEffectShape(true); - this.zr.refresh(); + this.zr.refreshNextFrame(); this._justMove = true; zrEvent.stop(event); }, - __onmouseup: function (param) { - var event = param.event; + __onmouseup: function (params) { + var event = params.event; this._mx = zrEvent.getX(event); this._my = zrEvent.getY(event); this._mousedown = false; @@ -1047,17 +1134,114 @@ Map.prototype = { }, 120); }, + /** + * 漫游组件事件响应 + */ + __onroamcontroller: function (params) { + var event = params.event; + event.zrenderX = this.zr.getWidth() / 2; + event.zrenderY = this.zr.getHeight() / 2; + var mapTypeControl = params.mapTypeControl; + var top = 0; + var left = 0; + var step = params.step; + + switch (params.roamType) { + case 'scaleUp': + event.zrenderDelta = 1; + this.__onmousewheel({ + event: event, + mapTypeControl: mapTypeControl + }); + return; + case 'scaleDown': + event.zrenderDelta = -1; + this.__onmousewheel({ + event: event, + mapTypeControl: mapTypeControl + }); + return; + case 'up': + top = -step; + break; + case 'down': + top = step; + break; + case 'left': + left = -step; + break; + case 'right': + left = step; + break; + } + + var transform; + var curMapType; + for (curMapType in mapTypeControl) { + if (!this._mapDataMap[curMapType] || !this._activeMapType[curMapType]) { + continue; + } + transform = this._mapDataMap[curMapType].transform; + transform.hasRoam = true; + transform.left -= left; + transform.top -= top; + this._mapDataMap[curMapType].transform = transform; + } + for (var i = 0, l = this.shapeList.length; i < l; i++) { + curMapType = this.shapeList[i]._mapType; + if (!mapTypeControl[curMapType] || !this._activeMapType[curMapType]) { + continue; + } + transform = this._mapDataMap[curMapType].transform; + this.shapeList[i].position[0] = transform.left; + this.shapeList[i].position[1] = transform.top; + this.zr.modShape(this.shapeList[i].id); + } + + this.messageCenter.dispatch( + ecConfig.EVENT.MAP_ROAM, params.event, { + type: 'move' + }, this.myChart); + + this.clearEffectShape(true); + this.zr.refreshNextFrame(); + + clearTimeout(this.dircetionTimer); + var self = this; + this.dircetionTimer = setTimeout(function () { + self.animationEffect(); + }, 150); + }, + + /** + * dataRange hoverlink 事件响应 + */ + __ondrhoverlink: function (param) { + var curMapType; + var value; + for (var i = 0, l = this.shapeList.length; i < l; i++) { + curMapType = this.shapeList[i]._mapType; + if (!this._hoverLinkMap[curMapType] || !this._activeMapType[curMapType]) { + continue; + } + value = ecData.get(this.shapeList[i], 'value'); + if (value != null && value >= param.valueMin && value <= param.valueMax) { + this.zr.addHoverShape(this.shapeList[i]); + } + } + }, + /** * 点击响应 */ - onclick: function (param) { - if (!this.isClick || !param.target || this._justMove || param.target.type == 'icon') { + onclick: function (params) { + if (!this.isClick || !params.target || this._justMove || params.target.type == 'icon') { // 没有在当前实例上发生点击直接返回 return; } this.isClick = false; - var target = param.target; + var target = params.target; var name = target.style._name; var len = this.shapeList.length; var mapType = target._mapType || ''; @@ -1093,16 +1277,16 @@ Map.prototype = { } } this.messageCenter.dispatch( - ecConfig.EVENT.MAP_SELECTED, param.event, { + ecConfig.EVENT.MAP_SELECTED, params.event, { selected: this._selected, target: name }, this.myChart); - this.zr.refresh(); + this.zr.refreshNextFrame(); var self = this; setTimeout(function () { self.zr.trigger( - zrConfig.EVENT.MOUSEMOVE, param.event); + zrConfig.EVENT.MOUSEMOVE, params.event); }, 100); }, @@ -1211,7 +1395,8 @@ Map.prototype = { ? shapeList : [shapeList]; for (var i = 0, l = shapeList.length; i < l; i++) { if (typeof shapeList[i].zlevel == 'undefined') { - shapeList[i].zlevel = this._zlevelBase + 1; + shapeList[i].zlevel = this.getZlevelBase(); + shapeList[i].z = this.getZBase() + 1; } shapeList[i]._mapType = mapType; this.shapeList.push(shapeList[i]); @@ -1224,20 +1409,18 @@ Map.prototype = { /** * 释放后实例不可用 */ - dispose: function () { - this.clear(); - this.shapeList = null; - this.effectList = null; + onbeforDispose: function () { this._isAlive = false; - if (this._needRoam) { - this.zr.un(zrConfig.EVENT.MOUSEWHEEL, this._onmousewheel); - this.zr.un(zrConfig.EVENT.MOUSEDOWN, this._onmousedown); - } + this.zr.un(zrConfig.EVENT.MOUSEWHEEL, this._onmousewheel); + this.zr.un(zrConfig.EVENT.MOUSEDOWN, this._onmousedown); + this.messageCenter.unbind( + ecConfig.EVENT.ROAMCONTROLLER, this._onroamcontroller); + this.messageCenter.unbind( + ecConfig.EVENT.DATA_RANGE_HOVERLINK, this._ondrhoverlink); } }; zrUtil.inherits(Map, ChartBase); -zrUtil.inherits(Map, ComponentBase); // 图表注册 require('../chart.js').define('map', Map); diff --git a/src/chart/pie.js b/src/chart/pie.js index b9d8367..0864431 100644 --- a/src/chart/pie.js +++ b/src/chart/pie.js @@ -2,11 +2,10 @@ * echarts图表类:饼图 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ -var ComponentBase = require('../component/base.js'); var ChartBase = require('./base.js'); // 图形依赖 @@ -14,9 +13,75 @@ var TextShape = require('../zrender/shape/Text.js'); var RingShape = require('../zrender/shape/Ring.js'); var CircleShape = require('../zrender/shape/Circle.js'); var SectorShape = require('../zrender/shape/Sector.js'); -var BrokenLineShape = require('../zrender/shape/BrokenLine.js'); +var PolylineShape = require('../zrender/shape/Polyline.js'); var ecConfig = require('../config.js'); +// 饼图默认参数 +ecConfig.pie = { + zlevel: 0, + // 一级层叠 + z: 2, + // 二级层叠 + clickable: true, + legendHoverLink: true, + center: ['50%', '50%'], + // 默认全局居中 + radius: [0, '75%'], + clockWise: true, + // 默认顺时针 + startAngle: 90, + minAngle: 0, + // 最小角度改为0 + selectedOffset: 10, + // 选中是扇区偏移量 + // selectedMode: false, // 选择模式,默认关闭,可选single,multiple + // roseType: null, // 南丁格尔玫瑰图模式,'radius'(半径) | 'area'(面积) + itemStyle: { + normal: { + // color: 各异, + borderColor: 'rgba(0,0,0,0)', + borderWidth: 1, + label: { + show: true, + position: 'outer' + // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调 + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + // distance: 当position为inner时有效,为label位置到圆心的距离与圆半径(环状图为内外半径和)的比例系数 + }, + labelLine: { + show: true, + length: 20, + lineStyle: { + // color: 各异, + width: 1, + type: 'solid' + } + } + }, + emphasis: { + // color: 各异, + borderColor: 'rgba(0,0,0,0)', + borderWidth: 1, + label: { + show: false + // position: 'outer' + // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调 + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + // distance: 当position为inner时有效,为label位置到圆心的距离与圆半径(环状图为内外半径和)的比例系数 + }, + labelLine: { + show: false, + length: 20, + lineStyle: { + // color: 各异, + width: 1, + type: 'solid' + } + } + } + } +}; + var ecData = require('../util/ecData.js'); var zrUtil = require('../zrender/tool/util.js'); var zrMath = require('../zrender/tool/math.js'); @@ -31,10 +96,8 @@ var zrColor = require('../zrender/tool/color.js'); */ function Pie(ecTheme, messageCenter, zr, option, myChart) { - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); // 图表基类 - ChartBase.call(this); + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); var self = this; /** @@ -45,22 +108,25 @@ function Pie(ecTheme, messageCenter, zr, option, myChart) { var seriesIndex = ecData.get(shape, 'seriesIndex'); var dataIndex = ecData.get(shape, 'dataIndex'); var percent = ecData.get(shape, 'special'); - var lastAddRadius = shape._lastAddRadius; + var center = [shape.style.x, shape.style.y]; var startAngle = shape.style.startAngle; var endAngle = shape.style.endAngle; + var midAngle = ((endAngle + startAngle) / 2 + 360) % 360; // 中值 var defaultColor = shape.highlightStyle.color; // 文本标签,需要显示则会有返回 var label = self.getLabel( - seriesIndex, dataIndex, percent, lastAddRadius, startAngle, endAngle, defaultColor, true); + seriesIndex, dataIndex, percent, center, midAngle, defaultColor, true); + if (label) { self.zr.addHoverShape(label); } // 文本标签视觉引导线,需要显示则会有返回 var labelLine = self.getLabelLine( - seriesIndex, dataIndex, lastAddRadius, shape.style.r0, shape.style.r, startAngle, endAngle, defaultColor, true); + seriesIndex, dataIndex, center, shape.style.r0, shape.style.r, midAngle, defaultColor, true); + if (labelLine) { self.zr.addHoverShape(labelLine); } @@ -86,12 +152,12 @@ Pie.prototype = { this._selectedMode = false; var serieName; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type == ecConfig.CHART_TYPE_PIE) { + if (series[i].type === ecConfig.CHART_TYPE_PIE) { series[i] = this.reformOption(series[i]); + this.legendHoverLink = series[i].legendHoverLink || this.legendHoverLink; serieName = series[i].name || ''; // 系列图例开关 - this.selectedMap[serieName] = - legend ? legend.isSelected(serieName) : true; + this.selectedMap[serieName] = legend ? legend.isSelected(serieName) : true; if (!this.selectedMap[serieName]) { continue; } @@ -102,7 +168,8 @@ Pie.prototype = { this._selected[i] = []; if (this.deepQuery([series[i], this.option], 'calculable')) { pieCase = { - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), hoverable: false, style: { x: center[0], @@ -114,7 +181,7 @@ Pie.prototype = { r: radius[1] + 10, brushType: 'stroke', lineWidth: 1, - strokeColor: series[i].calculableHolderColor || this.ecTheme.calculableHolderColor + strokeColor: series[i].calculableHolderColor || this.ecTheme.calculableHolderColor || ecConfig.calculableHolderColor } }; ecData.pack(pieCase, series[i], i, undefined, -1); @@ -147,14 +214,12 @@ Pie.prototype = { var totalValue = 0; // 迭代累计 var maxValue = Number.NEGATIVE_INFINITY; + var singleShapeList = []; // 计算需要显示的个数和总值 for (var i = 0, l = data.length; i < l; i++) { itemName = data[i].name; - if (legend) { - this.selectedMap[itemName] = legend.isSelected(itemName); - } else { - this.selectedMap[itemName] = true; - } + this.selectedMap[itemName] = legend ? legend.isSelected(itemName) : true; + if (this.selectedMap[itemName] && !isNaN(data[i].value)) { if (+data[i].value !== 0) { totalSelected++; @@ -167,16 +232,19 @@ Pie.prototype = { } } + if (totalValue === 0) { + return; + } + var percent = 100; - var lastPercent; // 相邻细角度优化 - var lastAddRadius = 0; var clockWise = serie.clockWise; - var startAngle = serie.startAngle.toFixed(2) - 0; + var startAngle = (serie.startAngle.toFixed(2) - 0 + 360) % 360; var endAngle; var minAngle = serie.minAngle || 0.01; // #bugfixed var totalAngle = 360 - (minAngle * totalSelected) - 0.01 * totalSelectedValue0; var defaultColor; var roseType = serie.roseType; + var center; var radius; var r0; // 扇形内半径 var r1; // 扇形外半径 @@ -186,17 +254,9 @@ Pie.prototype = { if (!this.selectedMap[itemName] || isNaN(data[i].value)) { continue; } - // 默认颜色策略 - if (legend) { - // 有图例则从图例中获取颜色定义 - defaultColor = legend.getColor(itemName); - } - else { - // 全局颜色定义 - defaultColor = this.zr.getColor(i); - } + // 默认颜色策略,有图例则从图例中获取颜色定义,没有就全局颜色定义 + defaultColor = legend ? legend.getColor(itemName) : this.zr.getColor(i); - lastPercent = percent; percent = data[i].value / totalValue; if (roseType != 'area') { endAngle = clockWise ? (startAngle - percent * totalAngle - (percent !== 0 ? minAngle : 0.01)) : (percent * totalAngle + startAngle + (percent !== 0 ? minAngle : 0.01)); @@ -207,14 +267,15 @@ Pie.prototype = { endAngle = endAngle.toFixed(2) - 0; percent = (percent * 100).toFixed(2); + center = this.parseCenter(this.zr, serie.center); radius = this.parseRadius(this.zr, serie.radius); r0 = +radius[0]; r1 = +radius[1]; - if (roseType == 'radius') { + if (roseType === 'radius') { r1 = data[i].value / maxValue * (r1 - r0) * 0.8 + (r1 - r0) * 0.2 + r0; } - else if (roseType == 'area') { + else if (roseType === 'area') { r1 = Math.sqrt(data[i].value / maxValue) * (r1 - r0) + r0; } @@ -225,58 +286,52 @@ Pie.prototype = { endAngle = temp; } - // 当前小角度需要检查前一个是否也是小角度,如果是得调整长度,不能完全避免,但能大大降低覆盖概率 - if (i > 0 && Math.abs(startAngle - endAngle) < 15 // 约15度 - && lastPercent < 4 && this._needLabel(serie, data[i], false) && this.deepQuery([data[i], serie], 'itemStyle.normal.label.position') != 'center') { - // 都小就延长,前小后大就缩短 - lastAddRadius += (percent < 4 ? 20 : -20); - } - else { - lastAddRadius = 0; - } - this._buildItem( - seriesIndex, i, percent, lastAddRadius, // 相邻最小角度优化 - data[i].selected, r0, r1, startAngle, endAngle, defaultColor); + singleShapeList, seriesIndex, i, percent, data[i].selected, center, r0, r1, startAngle, endAngle, defaultColor); if (!clockWise) { startAngle = endAngle; } } + this._autoLabelLayout(singleShapeList, center, r1); + for (var i = 0, l = singleShapeList.length; i < l; i++) { + this.shapeList.push(singleShapeList[i]); + } + singleShapeList = null; }, /** * 构建单个扇形及指标 */ _buildItem: function ( - seriesIndex, dataIndex, percent, lastAddRadius, isSelected, r0, r1, startAngle, endAngle, defaultColor) { + singleShapeList, seriesIndex, dataIndex, percent, isSelected, center, r0, r1, startAngle, endAngle, defaultColor) { var series = this.series; + var midAngle = ((endAngle + startAngle) / 2 + 360) % 360; // 中值 + // 扇形 var sector = this.getSector( - seriesIndex, dataIndex, percent, isSelected, r0, r1, startAngle, endAngle, defaultColor); + seriesIndex, dataIndex, percent, isSelected, center, r0, r1, startAngle, endAngle, defaultColor); // 图形需要附加的私有数据 ecData.pack( sector, series[seriesIndex], seriesIndex, series[seriesIndex].data[dataIndex], dataIndex, series[seriesIndex].data[dataIndex].name, percent); - sector._lastAddRadius = lastAddRadius; - this.shapeList.push(sector); + singleShapeList.push(sector); // 文本标签,需要显示则会有返回 var label = this.getLabel( - seriesIndex, dataIndex, percent, lastAddRadius, startAngle, endAngle, defaultColor, false); - if (label) { - ecData.pack( - label, series[seriesIndex], seriesIndex, series[seriesIndex].data[dataIndex], dataIndex, series[seriesIndex].data[dataIndex].name, percent); - label._dataIndex = dataIndex; - this.shapeList.push(label); - } - + seriesIndex, dataIndex, percent, center, midAngle, defaultColor, false); // 文本标签视觉引导线,需要显示则会有返回 var labelLine = this.getLabelLine( - seriesIndex, dataIndex, lastAddRadius, r0, r1, startAngle, endAngle, defaultColor, false); + seriesIndex, dataIndex, center, r0, r1, midAngle, defaultColor, false); + if (labelLine) { ecData.pack( labelLine, series[seriesIndex], seriesIndex, series[seriesIndex].data[dataIndex], dataIndex, series[seriesIndex].data[dataIndex].name, percent); - labelLine._dataIndex = dataIndex; - this.shapeList.push(labelLine); + singleShapeList.push(labelLine); + } + if (label) { + ecData.pack( + label, series[seriesIndex], seriesIndex, series[seriesIndex].data[dataIndex], dataIndex, series[seriesIndex].data[dataIndex].name, percent); + label._labelLine = labelLine; + singleShapeList.push(label); } }, @@ -284,12 +339,11 @@ Pie.prototype = { * 构建扇形 */ getSector: function ( - seriesIndex, dataIndex, percent, isSelected, r0, r1, startAngle, endAngle, defaultColor) { + seriesIndex, dataIndex, percent, isSelected, center, r0, r1, startAngle, endAngle, defaultColor) { var series = this.series; var serie = series[seriesIndex]; var data = serie.data[dataIndex]; var queryTarget = [data, serie]; - var center = this.parseCenter(this.zr, serie.center); // 多级控制 var normal = this.deepMerge( @@ -298,11 +352,12 @@ Pie.prototype = { queryTarget, 'itemStyle.emphasis') || {}; var normalColor = this.getItemStyleColor(normal.color, seriesIndex, dataIndex, data) || defaultColor; - var emphasisColor = this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data) || (typeof normalColor == 'string' ? zrColor.lift(normalColor, -0.2) : normalColor); + var emphasisColor = this.getItemStyleColor(emphasis.color, seriesIndex, dataIndex, data) || (typeof normalColor === 'string' ? zrColor.lift(normalColor, -0.2) : normalColor); var sector = { - zlevel: this._zlevelBase, - clickable: true, + zlevel: this.getZlevelBase(), + z: this.getZBase(), + clickable: this.deepQuery(queryTarget, 'clickable'), style: { x: center[0], // 圆心横坐标 @@ -355,7 +410,7 @@ Pie.prototype = { sector.draggable = true; } - // “normal下不显示,emphasis显示”添加事件响应 + // “emphasis显示”添加事件响应 if (this._needLabel(serie, data, true) // emphasis下显示文本 || this._needLabelLine(serie, data, true) // emphasis下显示引导线 ) { @@ -370,7 +425,7 @@ Pie.prototype = { * 需要显示则会有返回构建好的shape,否则返回undefined */ getLabel: function ( - seriesIndex, dataIndex, percent, lastAddRadius, startAngle, endAngle, defaultColor, isEmphasis) { + seriesIndex, dataIndex, percent, center, midAngle, defaultColor, isEmphasis) { var series = this.series; var serie = series[seriesIndex]; var data = serie.data[dataIndex]; @@ -389,69 +444,66 @@ Pie.prototype = { var labelControl = itemStyle[status].label; var textStyle = labelControl.textStyle || {}; - var center = this.parseCenter(this.zr, serie.center); var centerX = center[0]; // 圆心横坐标 var centerY = center[1]; // 圆心纵坐标 var x; var y; - var midAngle = ((endAngle + startAngle) / 2 + 360) % 360; // 中值 var radius = this.parseRadius(this.zr, serie.radius); // 标签位置半径 var textAlign; var textBaseline = 'middle'; labelControl.position = labelControl.position || itemStyle.normal.label.position; - if (labelControl.position == 'center') { + if (labelControl.position === 'center') { // center显示 - radius = radius[1]; x = centerX; y = centerY; textAlign = 'center'; } - else if (labelControl.position == 'inner') { - // 内部显示 - radius = (radius[0] + radius[1]) / 2 + lastAddRadius; - x = Math.round( - centerX + radius * zrMath.cos(midAngle, true)); - y = Math.round( - centerY - radius * zrMath.sin(midAngle, true)); + else if (labelControl.position === 'inner' || labelControl.position === 'inside') { + // 内部标签显示, 按外半径比例计算标签位置 + radius = (radius[0] + radius[1]) * (labelControl.distance || 0.5); + x = Math.round(centerX + radius * zrMath.cos(midAngle, true)); + y = Math.round(centerY - radius * zrMath.sin(midAngle, true)); defaultColor = '#fff'; textAlign = 'center'; - } else { - // 外部显示,默认 labelControl.position == 'outer') - radius = radius[1] - (-itemStyle[status].labelLine.length) - //- (-textStyle.fontSize) - + lastAddRadius; - x = centerX + radius * zrMath.cos(midAngle, true); - y = centerY - radius * zrMath.sin(midAngle, true); + // 外部显示,默认 labelControl.position === 'outer') + radius = radius[1] - (-itemStyle[status].labelLine.length); + x = Math.round(centerX + radius * zrMath.cos(midAngle, true)); + y = Math.round(centerY - radius * zrMath.sin(midAngle, true)); textAlign = (midAngle >= 90 && midAngle <= 270) ? 'right' : 'left'; } - if (labelControl.position != 'center' && labelControl.position != 'inner') { - x += textAlign == 'left' ? 20 : -20; + if (labelControl.position != 'center' && labelControl.position != 'inner' && labelControl.position != 'inside') { + x += textAlign === 'left' ? 20 : -20; } - data.__labelX = x - (textAlign == 'left' ? 5 : -5); + data.__labelX = x - (textAlign === 'left' ? 5 : -5); data.__labelY = y; - return new TextShape({ - zlevel: this._zlevelBase + 1, + var ts = new TextShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, hoverable: false, style: { x: x, y: y, color: textStyle.color || defaultColor, - text: this.getLabelText( - seriesIndex, dataIndex, percent, status), + text: this.getLabelText(seriesIndex, dataIndex, percent, status), textAlign: textStyle.align || textAlign, textBaseline: textStyle.baseline || textBaseline, textFont: this.getFont(textStyle) }, highlightStyle: { brushType: 'fill' - }, - _seriesIndex: seriesIndex, - _dataIndex: dataIndex + } }); + ts._radius = radius; + ts._labelPosition = labelControl.position || 'outer'; + ts._rect = ts.getRect(ts.style); + ts._seriesIndex = seriesIndex; + ts._dataIndex = dataIndex; + return ts; + }, /** @@ -464,11 +516,20 @@ Pie.prototype = { var formatter = this.deepQuery([data, serie], 'itemStyle.' + status + '.label.formatter'); if (formatter) { - if (typeof formatter == 'function') { + if (typeof formatter === 'function') { return formatter.call( - this.myChart, serie.name, data.name, data.value, percent); + this.myChart, { + seriesIndex: seriesIndex, + seriesName: serie.name || '', + series: serie, + dataIndex: dataIndex, + data: data, + name: data.name, + value: data.value, + percent: percent + }); } - else if (typeof formatter == 'string') { + else if (typeof formatter === 'string') { formatter = formatter.replace('{a}', '{a0}').replace('{b}', '{b0}').replace('{c}', '{c0}').replace('{d}', '{d0}'); formatter = formatter.replace('{a0}', serie.name).replace('{b0}', data.name).replace('{c0}', data.value).replace('{d0}', percent); @@ -484,7 +545,7 @@ Pie.prototype = { * 需要显示则会有返回构建好的shape,否则返回undefined */ getLabelLine: function ( - seriesIndex, dataIndex, lastAddRadius, r0, r1, startAngle, endAngle, defaultColor, isEmphasis) { + seriesIndex, dataIndex, center, r0, r1, midAngle, defaultColor, isEmphasis) { var series = this.series; var serie = series[seriesIndex]; var data = serie.data[dataIndex]; @@ -500,34 +561,32 @@ Pie.prototype = { var labelLineControl = itemStyle[status].labelLine; var lineStyle = labelLineControl.lineStyle || {}; - var center = this.parseCenter(this.zr, serie.center); var centerX = center[0]; // 圆心横坐标 var centerY = center[1]; // 圆心纵坐标 // 视觉引导线起点半径 - var midRadius = r1; + var minRadius = r1; // 视觉引导线终点半径 - var maxRadius = this.parseRadius(this.zr, serie.radius)[1] - (-labelLineControl.length) + lastAddRadius; - var midAngle = ((endAngle + startAngle) / 2) % 360; // 角度中值 + var maxRadius = this.parseRadius(this.zr, serie.radius)[1] - (-labelLineControl.length); var cosValue = zrMath.cos(midAngle, true); var sinValue = zrMath.sin(midAngle, true); - // 三角函数缓存已在zrender/tool/math中做了 - return new BrokenLineShape({ - // shape : 'brokenLine', - zlevel: this._zlevelBase + 1, + + return new PolylineShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, hoverable: false, style: { pointList: [ [ - centerX + midRadius * cosValue, centerY - midRadius * sinValue], + centerX + minRadius * cosValue, centerY - minRadius * sinValue], [ centerX + maxRadius * cosValue, centerY - maxRadius * sinValue], [ data.__labelX, data.__labelY] ], - //xStart : centerX + midRadius * cosValue, - //yStart : centerY - midRadius * sinValue, - //xEnd : centerX + maxRadius * cosValue, - //yEnd : centerY - maxRadius * sinValue, + //xStart: centerX + minRadius * cosValue, + //yStart: centerY - minRadius * sinValue, + //xEnd: centerX + maxRadius * cosValue, + //yEnd: centerY - maxRadius * sinValue, strokeColor: lineStyle.color || defaultColor, lineType: lineStyle.type, lineWidth: lineStyle.width @@ -561,6 +620,135 @@ Pie.prototype = { return this.deepQuery([data, serie], 'itemStyle.' + (isEmphasis ? 'emphasis' : 'normal') + '.labelLine.show'); }, + /** + * @param {Array.} sList 单系列图形集合 + */ + _autoLabelLayout: function (sList, center, r) { + var leftList = []; + var rightList = []; + + for (var i = 0, l = sList.length; i < l; i++) { + if (sList[i]._labelPosition === 'outer' || sList[i]._labelPosition === 'outside') { + sList[i]._rect._y = sList[i]._rect.y; + if (sList[i]._rect.x < center[0]) { + leftList.push(sList[i]); + } + else { + rightList.push(sList[i]); + } + } + } + this._layoutCalculate(leftList, center, r, -1); + this._layoutCalculate(rightList, center, r, 1); + }, + + /** + * @param {Array.} tList 单系列文本图形集合 + * @param {number} direction 水平方向参数,left为-1,right为1 + */ + _layoutCalculate: function (tList, center, r, direction) { + tList.sort(function (a, b) { + return a._rect.y - b._rect.y; + }); + + // 压 + + function _changeDown(start, end, delta, direction) { + for (var j = start; j < end; j++) { + tList[j]._rect.y += delta; + tList[j].style.y += delta; + if (tList[j]._labelLine) { + tList[j]._labelLine.style.pointList[1][1] += delta; + tList[j]._labelLine.style.pointList[2][1] += delta; + } + if (j > start && j + 1 < end && tList[j + 1]._rect.y > tList[j]._rect.y + tList[j]._rect.height) { + _changeUp(j, delta / 2); + return; + } + } + + _changeUp(end - 1, delta / 2); + } + + // 弹 + + function _changeUp(end, delta) { + for (var j = end; j >= 0; j--) { + tList[j]._rect.y -= delta; + tList[j].style.y -= delta; + if (tList[j]._labelLine) { + tList[j]._labelLine.style.pointList[1][1] -= delta; + tList[j]._labelLine.style.pointList[2][1] -= delta; + } + if (j > 0 && tList[j]._rect.y > tList[j - 1]._rect.y + tList[j - 1]._rect.height) { + break; + } + } + } + + function _changeX(sList, isDownList, center, r, direction) { + var x = center[0]; + var y = center[1]; + var deltaX; + var deltaY; + var length; + var lastDeltaX = direction > 0 ? isDownList // 右侧 + ? Number.MAX_VALUE // 下 + : 0 // 上 + : isDownList // 左侧 + ? Number.MAX_VALUE // 下 + : 0; // 上 + + for (var i = 0, l = sList.length; i < l; i++) { + deltaY = Math.abs(sList[i]._rect.y - y); + length = sList[i]._radius - r; + deltaX = (deltaY < r + length) ? Math.sqrt((r + length + 20) * (r + length + 20) - Math.pow(sList[i]._rect.y - y, 2)) : Math.abs( + sList[i]._rect.x + (direction > 0 ? 0 : sList[i]._rect.width) - x); + if (isDownList && deltaX >= lastDeltaX) { + // 右下,左下 + deltaX = lastDeltaX - 10; + } + if (!isDownList && deltaX <= lastDeltaX) { + // 右上,左上 + deltaX = lastDeltaX + 10; + } + + sList[i]._rect.x = sList[i].style.x = x + deltaX * direction; + if (sList[i]._labelLine) { + sList[i]._labelLine.style.pointList[2][0] = x + (deltaX - 5) * direction; + sList[i]._labelLine.style.pointList[1][0] = x + (deltaX - 20) * direction; + } + lastDeltaX = deltaX; + } + } + + var lastY = 0; + var delta; + var len = tList.length; + var upList = []; + var downList = []; + for (var i = 0; i < len; i++) { + delta = tList[i]._rect.y - lastY; + if (delta < 0) { + _changeDown(i, len, -delta, direction); + } + lastY = tList[i]._rect.y + tList[i]._rect.height; + } + if (this.zr.getHeight() - lastY < 0) { + _changeUp(len - 1, lastY - this.zr.getHeight()); + } + for (var i = 0; i < len; i++) { + if (tList[i]._rect.y >= center[1]) { + downList.push(tList[i]); + } + else { + upList.push(tList[i]); + } + } + _changeX(downList, true, center, r, direction); + _changeX(upList, false, center, r, direction); + }, + /** * 参数修正&默认值赋值,重载基类方法 * @param {Object} opt 参数 @@ -569,13 +757,14 @@ Pie.prototype = { // 常用方法快捷方式 var _merge = zrUtil.merge; opt = _merge( - opt || {}, this.ecTheme.pie); + _merge( + opt || {}, zrUtil.clone(this.ecTheme.pie || {})), zrUtil.clone(ecConfig.pie)); // 通用字体设置 - opt.itemStyle.normal.label.textStyle = _merge( - opt.itemStyle.normal.label.textStyle || {}, this.ecTheme.textStyle); - opt.itemStyle.emphasis.label.textStyle = _merge( - opt.itemStyle.emphasis.label.textStyle || {}, this.ecTheme.textStyle); + opt.itemStyle.normal.label.textStyle = this.getTextStyle( + opt.itemStyle.normal.label.textStyle); + opt.itemStyle.emphasis.label.textStyle = this.getTextStyle( + opt.itemStyle.emphasis.label.textStyle); return opt; }, @@ -618,7 +807,7 @@ Pie.prototype = { seriesIndex = params[i][0]; isHead = params[i][2]; dataGrow = params[i][3]; - if (series[seriesIndex] && series[seriesIndex].type == ecConfig.CHART_TYPE_PIE) { + if (series[seriesIndex] && series[seriesIndex].type === ecConfig.CHART_TYPE_PIE) { if (isHead) { if (!dataGrow) { sectorMap[ @@ -652,7 +841,7 @@ Pie.prototype = { case 'text': textMap[key] = this.shapeList[i]; break; - case 'broken-line': + case 'polyline': lineMap[key] = this.shapeList[i]; break; } @@ -668,7 +857,7 @@ Pie.prototype = { if (!targeSector) { continue; } - if (backupShapeList[i].type == 'sector') { + if (backupShapeList[i].type === 'sector') { if (targeSector != 'delete') { // 原有扇形 this.zr.animate(backupShapeList[i].id, 'style').when( @@ -687,8 +876,8 @@ Pie.prototype = { }).start(); } } - else if (backupShapeList[i].type == 'text' || backupShapeList[i].type == 'broken-line') { - if (targeSector == 'delete') { + else if (backupShapeList[i].type === 'text' || backupShapeList[i].type === 'polyline') { + if (targeSector === 'delete') { // 删除逻辑一样 this.zr.delShape(backupShapeList[i].id); } @@ -703,7 +892,7 @@ Pie.prototype = { y: targeSector.style.y }).start(); break; - case 'broken-line': + case 'polyline': targeSector = lineMap[key]; this.zr.animate(backupShapeList[i].id, 'style').when( 400, { @@ -733,7 +922,7 @@ Pie.prototype = { var dataIndex = ecData.get(target, 'dataIndex'); for (var i = 0, len = this.shapeList.length; i < len; i++) { - if (this.shapeList[i].id == target.id) { + if (this.shapeList[i].id === target.id) { seriesIndex = ecData.get(target, 'seriesIndex'); dataIndex = ecData.get(target, 'dataIndex'); // 当前点击的 @@ -758,7 +947,7 @@ Pie.prototype = { this.zr.modShape(target.id, target); } - else if (this.shapeList[i].style._hasSelected && this._selectedMode == 'single') { + else if (this.shapeList[i].style._hasSelected && this._selectedMode === 'single') { seriesIndex = ecData.get(this.shapeList[i], 'seriesIndex'); dataIndex = ecData.get(this.shapeList[i], 'dataIndex'); // 单选模式下需要取消其他已经选中的 @@ -776,12 +965,11 @@ Pie.prototype = { selected: this._selected, target: ecData.get(target, 'name') }, this.myChart); - this.zr.refresh(); + this.zr.refreshNextFrame(); } }; zrUtil.inherits(Pie, ChartBase); -zrUtil.inherits(Pie, ComponentBase); // 图表注册 require('../chart.js').define('pie', Pie); diff --git a/src/chart/radar.js b/src/chart/radar.js index 8676d07..1d7352d 100644 --- a/src/chart/radar.js +++ b/src/chart/radar.js @@ -2,12 +2,10 @@ * echarts图表类:雷达图 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Neil (杨骥, yangji01@baidu.com) - * + * @author Neil (杨骥, 511415343@qq.com) */ -var ComponentBase = require('../component/base.js'); var ChartBase = require('./base.js'); // 图形依赖 @@ -16,6 +14,38 @@ var PolygonShape = require('../zrender/shape/Polygon.js'); require('../component/polar.js'); var ecConfig = require('../config.js'); +// 雷达图默认参数 +ecConfig.radar = { + zlevel: 0, + // 一级层叠 + z: 2, + // 二级层叠 + clickable: true, + legendHoverLink: true, + polarIndex: 0, + itemStyle: { + normal: { + // color: 各异, + label: { + show: false + }, + lineStyle: { + width: 2, + type: 'solid' + } + }, + emphasis: { + // color: 各异, + label: { + show: false + } + } + }, + // symbol: null, // 拐点图形类型 + symbolSize: 2 // 可计算特性参数,空数据拖拽提示图形大小 + // symbolRotate: null, // 图形旋转控制 +}; + var ecData = require('../util/ecData.js'); var zrUtil = require('../zrender/tool/util.js'); var zrColor = require('../zrender/tool/color.js'); @@ -26,13 +56,13 @@ var zrColor = require('../zrender/tool/color.js'); * @param {ZRender} zr zrender实例 * @param {Object} series 数据 * @param {Object} component 组件 + * @constructor + * @exports Radar */ function Radar(ecTheme, messageCenter, zr, option, myChart) { - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); // 图表基类 - ChartBase.call(this); + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); this.refresh(option); } @@ -53,8 +83,9 @@ Radar.prototype = { var legend = this.component.legend; var serieName; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type == ecConfig.CHART_TYPE_RADAR) { + if (series[i].type === ecConfig.CHART_TYPE_RADAR) { this.serie = this.reformOption(series[i]); + this.legendHoverLink = series[i].legendHoverLink || this.legendHoverLink; serieName = this.serie.name || ''; // 系列图例开关 this.selectedMap[serieName] = @@ -116,7 +147,8 @@ Radar.prototype = { pointList = this._getPointList(this.serie.polarIndex, data[i]); // 添加拐点形状 - this._addSymbol(pointList, defaultColor, i, index, this.serie.polarIndex); + this._addSymbol( + pointList, defaultColor, i, index, this.serie.polarIndex); // 添加数据形状 this._addDataShape( pointList, defaultColor, data[i], index, i, calculable); @@ -135,9 +167,10 @@ Radar.prototype = { var vector; var polar = this.component.polar; + var value; for (var i = 0, l = dataArr.value.length; i < l; i++) { - vector = polar.getVector( - polarIndex, i, typeof dataArr.value[i].value != 'undefined' ? dataArr.value[i].value : dataArr.value[i]); + value = this.getDataFromOption(dataArr.value[i]); + vector = value != '-' ? polar.getVector(polarIndex, i, value) : false; if (vector) { pointList.push(vector); } @@ -162,7 +195,9 @@ Radar.prototype = { this.deepMerge([series[seriesIndex].data[dataIndex], series[seriesIndex]]), seriesIndex, series[seriesIndex].data[dataIndex].value[i], i, polar.getIndicatorText(polarIndex, i), pointList[i][0], // x pointList[i][1], // y this._symbol[this._radarDataCounter % this._symbol.length], defaultColor, '#fff', 'vertical'); - itemShape.zlevel = this._zlevelBase + 1; + itemShape.zlevel = this.getZlevelBase(); + itemShape.z = this.getZBase() + 1; + ecData.set(itemShape, 'data', series[seriesIndex].data[dataIndex]); ecData.set(itemShape, 'value', series[seriesIndex].data[dataIndex].value); ecData.set(itemShape, 'dataIndex', dataIndex); @@ -197,11 +232,12 @@ Radar.prototype = { var nIsAreaFill = this.deepQuery( queryTarget, 'itemStyle.normal.areaStyle'); var shape = { - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), style: { pointList: pointList, brushType: nIsAreaFill ? 'both' : 'stroke', - color: nAreaColor || nColor || zrColor.alpha(defaultColor, 0.5), + color: nAreaColor || nColor || (typeof defaultColor === 'string' ? zrColor.alpha(defaultColor, 0.5) : defaultColor), strokeColor: nColor || defaultColor, lineWidth: nLineWidth, lineType: nLineType @@ -210,7 +246,7 @@ Radar.prototype = { brushType: this.deepQuery( queryTarget, 'itemStyle.emphasis.areaStyle') || nIsAreaFill ? 'both' : 'stroke', color: this.deepQuery( - queryTarget, 'itemStyle.emphasis.areaStyle.color') || nAreaColor || nColor || zrColor.alpha(defaultColor, 0.5), + queryTarget, 'itemStyle.emphasis.areaStyle.color') || nAreaColor || nColor || (typeof defaultColor === 'string' ? zrColor.alpha(defaultColor, 0.5) : defaultColor), strokeColor: this.getItemStyleColor( this.deepQuery( queryTarget, 'itemStyle.emphasis.color'), seriesIndex, dataIndex, data) || nColor || defaultColor, @@ -247,7 +283,9 @@ Radar.prototype = { this._queryTarget, 'polarIndex'); if (!this._dropBoxList[polarIndex]) { var shape = this.component.polar.getDropBox(polarIndex); - shape.zlevel = this._zlevelBase; + shape.zlevel = this.getZlevelBase(); + shape.z = this.getZBase(); + this.setCalculable(shape); ecData.pack(shape, series, index, undefined, -1); this.shapeList.push(shape); @@ -265,7 +303,8 @@ Radar.prototype = { return; } - var target = param.target; // 被拖拽图形元素 + // 被拖拽图形元素 + var target = param.target; var seriesIndex = ecData.get(target, 'seriesIndex'); var dataIndex = ecData.get(target, 'dataIndex'); @@ -306,7 +345,7 @@ Radar.prototype = { var legend = this.component.legend; var value; - if (dataIndex == -1) { + if (dataIndex === -1) { data = { value: ecData.get(dragged, 'value'), name: ecData.get(dragged, 'name') @@ -356,7 +395,6 @@ Radar.prototype = { }; zrUtil.inherits(Radar, ChartBase); -zrUtil.inherits(Radar, ComponentBase); // 图表注册 require('../chart.js').define('radar', Radar); diff --git a/src/chart/scatter.js b/src/chart/scatter.js index 1f0c798..6a7039d 100644 --- a/src/chart/scatter.js +++ b/src/chart/scatter.js @@ -2,11 +2,10 @@ * echarts图表类:散点图 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ -var ComponentBase = require('../component/base.js'); var ChartBase = require('./base.js'); // 图形依赖 @@ -18,6 +17,48 @@ require('../component/dataZoom.js'); require('../component/dataRange.js'); var ecConfig = require('../config.js'); +// 散点图默认参数 +ecConfig.scatter = { + zlevel: 0, + // 一级层叠 + z: 2, + // 二级层叠 + clickable: true, + legendHoverLink: true, + xAxisIndex: 0, + yAxisIndex: 0, + // symbol: null, // 图形类型 + symbolSize: 4, + // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 + // symbolRotate: null, // 图形旋转控制 + large: false, + // 大规模散点图 + largeThreshold: 2000, + // 大规模阀值,large为true且数据量>largeThreshold才启用大规模模式 + itemStyle: { + normal: { + // color: 各异, + label: { + show: false + // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调 + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 + // 'inside'|'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + } + }, + emphasis: { + // color: '各异' + label: { + show: false + // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调 + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 + // 'inside'|'left'|'right'|'top'|'bottom' + // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE + } + } + } +}; + var zrUtil = require('../zrender/tool/util.js'); var zrColor = require('../zrender/tool/color.js'); @@ -30,10 +71,8 @@ var zrColor = require('../zrender/tool/color.js'); */ function Scatter(ecTheme, messageCenter, zr, option, myChart) { - // 基类 - ComponentBase.call(this, ecTheme, messageCenter, zr, option, myChart); // 图表基类 - ChartBase.call(this); + ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart); this.refresh(option); } @@ -61,12 +100,12 @@ Scatter.prototype = { for (var i = 0, l = series.length; i < l; i++) { serie = series[i]; serieName = serie.name; - if (serie.type == ecConfig.CHART_TYPE_SCATTER) { + if (serie.type === ecConfig.CHART_TYPE_SCATTER) { series[i] = this.reformOption(series[i]); + this.legendHoverLink = series[i].legendHoverLink || this.legendHoverLink; this._sIndex2ShapeMap[i] = this.query(serie, 'symbol') || this._symbol[i % this._symbol.length]; if (legend) { this.selectedMap[serieName] = legend.isSelected(serieName); - this._sIndex2ColorMap[i] = zrColor.alpha(legend.getColor(serieName), 0.5); iconShape = legend.getItemShape(serieName); @@ -100,7 +139,7 @@ Scatter.prototype = { } else { this.selectedMap[serieName] = true; - this._sIndex2ColorMap[i] = this.zr.getColor(i); + this._sIndex2ColorMap[i] = zrColor.alpha(this.zr.getColor(i), 0.5); } if (this.selectedMap[serieName]) { @@ -145,8 +184,8 @@ Scatter.prototype = { pointList[seriesIndex] = []; for (var i = 0, l = serie.data.length; i < l; i++) { data = serie.data[i]; - value = typeof data != 'undefined' ? (typeof data.value != 'undefined' ? data.value : data) : '-'; - if (value == '-' || value.length < 2) { + value = this.getDataFromOption(data, '-'); + if (value === '-' || value.length < 2) { // 数据格式不符 continue; } @@ -225,7 +264,7 @@ Scatter.prototype = { var gridY = this.component.grid.getY(); var gridYend = this.component.grid.getYend(); - xMarkMap.average0 = (xMarkMap.sum0 / xMarkMap.counter0).toFixed(2) - 0; + xMarkMap.average0 = xMarkMap.sum0 / xMarkMap.counter0; var x = xAxis.getCoord(xMarkMap.average0); // 横轴平均纵向 xMarkMap.averageLine0 = [ @@ -241,7 +280,7 @@ Scatter.prototype = { [xMarkMap.maxX0, gridY] ]; - xMarkMap.average1 = (xMarkMap.sum1 / xMarkMap.counter1).toFixed(2) - 0; + xMarkMap.average1 = xMarkMap.sum1 / xMarkMap.counter1; var y = yAxis.getCoord(xMarkMap.average1); // 纵轴平均横向 xMarkMap.averageLine1 = [ @@ -326,14 +365,17 @@ Scatter.prototype = { var itemShape = this.getSymbolShape( serie, seriesIndex, data, dataIndex, name, x, y, this._sIndex2ShapeMap[seriesIndex], rangColor, 'rgba(0,0,0,0)', 'vertical'); - itemShape.zlevel = this._zlevelBase; + itemShape.zlevel = this.getZlevelBase(); + itemShape.z = this.getZBase(); + itemShape._main = true; return itemShape; }, _getLargeSymbol: function (pointList, nColor) { return new SymbolShape({ - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), _main: true, hoverable: false, style: { @@ -355,10 +397,10 @@ Scatter.prototype = { var yAxis = this.component.yAxis.getAxis(serie.yAxisIndex); var pos; - if (mpData.type && (mpData.type == 'max' || mpData.type == 'min' || mpData.type == 'average')) { + if (mpData.type && (mpData.type === 'max' || mpData.type === 'min' || mpData.type === 'average')) { // 特殊值内置支持 // 默认取纵值 - var valueIndex = typeof mpData.valueIndex != 'undefined' ? mpData.valueIndex : 1; + var valueIndex = mpData.valueIndex != null ? mpData.valueIndex : 1; pos = [ xMarkMap[mpData.type + 'X' + valueIndex], xMarkMap[mpData.type + 'Y' + valueIndex], xMarkMap[mpData.type + 'Line' + valueIndex], xMarkMap[mpData.type + valueIndex]]; } @@ -400,7 +442,6 @@ Scatter.prototype = { }; zrUtil.inherits(Scatter, ChartBase); -zrUtil.inherits(Scatter, ComponentBase); // 图表注册 require('../chart.js').define('scatter', Scatter); diff --git a/src/component.js b/src/component.js index 34e418e..428a5cf 100644 --- a/src/component.js +++ b/src/component.js @@ -2,7 +2,7 @@ * echart组件库 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ // component diff --git a/src/component/axis.js b/src/component/axis.js index 67524d7..0ee64bf 100644 --- a/src/component/axis.js +++ b/src/component/axis.js @@ -2,7 +2,7 @@ * echarts组件类: 坐标轴 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * * 直角坐标系中坐标轴数组,数组中每一项代表一条横轴(纵轴)坐标轴。 * 标准(1.0)中规定最多同时存在2条横轴和2条纵轴 @@ -52,75 +52,78 @@ Axis.prototype = { var halfLineWidth = lineWidth / 2; var axShape = { _axisShape: 'axisLine', - zlevel: this._zlevelBase + 1, + zlevel: this.getZlevelBase(), + z: this.getZBase() + 3, hoverable: false }; + var grid = this.grid; switch (this.option.position) { case 'left': axShape.style = { - xStart: this.grid.getX() - halfLineWidth, - yStart: this.grid.getYend(), - xEnd: this.grid.getX() - halfLineWidth, - yEnd: this.grid.getY(), + xStart: grid.getX() - halfLineWidth, + yStart: grid.getYend(), + xEnd: grid.getX() - halfLineWidth, + yEnd: grid.getY(), lineCap: 'round' }; break; case 'right': axShape.style = { - xStart: this.grid.getXend() + halfLineWidth, - yStart: this.grid.getYend(), - xEnd: this.grid.getXend() + halfLineWidth, - yEnd: this.grid.getY(), + xStart: grid.getXend() + halfLineWidth, + yStart: grid.getYend(), + xEnd: grid.getXend() + halfLineWidth, + yEnd: grid.getY(), lineCap: 'round' }; break; case 'bottom': axShape.style = { - xStart: this.grid.getX(), - yStart: this.grid.getYend() + halfLineWidth, - xEnd: this.grid.getXend(), - yEnd: this.grid.getYend() + halfLineWidth, + xStart: grid.getX(), + yStart: grid.getYend() + halfLineWidth, + xEnd: grid.getXend(), + yEnd: grid.getYend() + halfLineWidth, lineCap: 'round' }; break; case 'top': axShape.style = { - xStart: this.grid.getX(), - yStart: this.grid.getY() - halfLineWidth, - xEnd: this.grid.getXend(), - yEnd: this.grid.getY() - halfLineWidth, + xStart: grid.getX(), + yStart: grid.getY() - halfLineWidth, + xEnd: grid.getXend(), + yEnd: grid.getY() - halfLineWidth, lineCap: 'round' }; break; } - if (this.option.name !== '') { - axShape.style.text = this.option.name; - axShape.style.textPosition = this.option.nameLocation; - axShape.style.textFont = this.getFont(this.option.nameTextStyle); + var style = axShape.style; + if (this.option.name !== '') { // 别帮我代码规范 + style.text = this.option.name; + style.textPosition = this.option.nameLocation; + style.textFont = this.getFont(this.option.nameTextStyle); if (this.option.nameTextStyle.align) { - axShape.style.textAlign = this.option.nameTextStyle.align; + style.textAlign = this.option.nameTextStyle.align; } if (this.option.nameTextStyle.baseline) { - axShape.style.textBaseline = this.option.nameTextStyle.baseline; + style.textBaseline = this.option.nameTextStyle.baseline; } if (this.option.nameTextStyle.color) { - axShape.style.textColor = this.option.nameTextStyle.color; + style.textColor = this.option.nameTextStyle.color; } } - axShape.style.strokeColor = this.option.axisLine.lineStyle.color; + style.strokeColor = this.option.axisLine.lineStyle.color; - axShape.style.lineWidth = lineWidth; + style.lineWidth = lineWidth; // 亚像素优化 if (this.isHorizontal()) { // 横向布局,优化y - axShape.style.yStart = axShape.style.yEnd = this.subPixelOptimize(axShape.style.yEnd, lineWidth); + style.yStart = style.yEnd = this.subPixelOptimize(style.yEnd, lineWidth); } else { // 纵向布局,优化x - axShape.style.xStart = axShape.style.xEnd = this.subPixelOptimize(axShape.style.xEnd, lineWidth); + style.xStart = style.xEnd = this.subPixelOptimize(style.xEnd, lineWidth); } - axShape.style.lineType = this.option.axisLine.lineStyle.type; + style.lineType = this.option.axisLine.lineStyle.type; axShape = new LineShape(axShape); this.shapeList.push(axShape); @@ -148,15 +151,15 @@ Axis.prototype = { return; } var tickLength; - if (this.isHorizontal() && typeof zeroY != 'undefined') { + if (this.isHorizontal() && zeroY != null) { // 横向布局调整纵向y for (var i = 0, l = this.shapeList.length; i < l; i++) { - if (this.shapeList[i]._axisShape == 'axisLine') { + if (this.shapeList[i]._axisShape === 'axisLine') { this.shapeList[i].style.yStart = this.shapeList[i].style.yEnd = this.subPixelOptimize( zeroY, this.shapeList[i].stylelineWidth); this.zr.modShape(this.shapeList[i].id); } - else if (this.shapeList[i]._axisShape == 'axisTick') { + else if (this.shapeList[i]._axisShape === 'axisTick') { tickLength = this.shapeList[i].style.yEnd - this.shapeList[i].style.yStart; this.shapeList[i].style.yStart = zeroY - tickLength; this.shapeList[i].style.yEnd = zeroY; @@ -164,15 +167,15 @@ Axis.prototype = { } } } - if (!this.isHorizontal() && typeof zeroX != 'undefined') { + if (!this.isHorizontal() && zeroX != null) { // 纵向布局调整横向x for (var i = 0, l = this.shapeList.length; i < l; i++) { - if (this.shapeList[i]._axisShape == 'axisLine') { + if (this.shapeList[i]._axisShape === 'axisLine') { this.shapeList[i].style.xStart = this.shapeList[i].style.xEnd = this.subPixelOptimize( zeroX, this.shapeList[i].stylelineWidth); this.zr.modShape(this.shapeList[i].id); } - else if (this.shapeList[i]._axisShape == 'axisTick') { + else if (this.shapeList[i]._axisShape === 'axisTick') { tickLength = this.shapeList[i].style.xEnd - this.shapeList[i].style.xStart; this.shapeList[i].style.xStart = zeroX; this.shapeList[i].style.xEnd = zeroX + tickLength; @@ -187,7 +190,7 @@ Axis.prototype = { }, isHorizontal: function () { - return this.option.position == 'bottom' || this.option.position == 'top'; + return this.option.position === 'bottom' || this.option.position === 'top'; } }, /** @@ -210,14 +213,14 @@ Axis.prototype = { opt = [opt[0], opt[1]]; } - if (this.axisType == 'xAxis') { + if (this.axisType === 'xAxis') { // 横轴位置默认配置 if (!opt[0].position // 没配置或配置错 || (opt[0].position != 'bottom' && opt[0].position != 'top')) { opt[0].position = 'bottom'; } if (opt.length > 1) { - opt[1].position = opt[0].position == 'bottom' ? 'top' : 'bottom'; + opt[1].position = opt[0].position === 'bottom' ? 'top' : 'bottom'; } for (var i = 0, l = opt.length; i < l; i++) { @@ -236,7 +239,7 @@ Axis.prototype = { } if (opt.length > 1) { - opt[1].position = opt[0].position == 'left' ? 'right' : 'left'; + opt[1].position = opt[0].position === 'left' ? 'right' : 'left'; } for (var i = 0, l = opt.length; i < l; i++) { @@ -258,7 +261,7 @@ Axis.prototype = { var axisOption; if (newOption) { this.option = newOption; - if (this.axisType == 'xAxis') { + if (this.axisType === 'xAxis') { this.option.xAxis = this.reformOption(newOption.xAxis); axisOption = this.option.xAxis; } @@ -286,7 +289,7 @@ Axis.prototype = { axisOption ? axisOption[i] : false, this.series); } else if (axisOption && axisOption[i]) { - this._axisList[i] = axisOption[i].type == 'category' ? new CategoryAxis( + this._axisList[i] = axisOption[i].type === 'category' ? new CategoryAxis( this.ecTheme, this.messageCenter, this.zr, axisOption[i], this.myChart, this.axisBase) : new ValueAxis( this.ecTheme, this.messageCenter, this.zr, axisOption[i], this.myChart, this.axisBase, this.series); diff --git a/src/component/base.js b/src/component/base.js index b8512d6..5d0755f 100644 --- a/src/component/base.js +++ b/src/component/base.js @@ -2,11 +2,12 @@ * echarts组件基类 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ var ecConfig = require('../config.js'); +var ecData = require('../util/ecData.js'); var ecQuery = require('../util/ecQuery.js'); var number = require('../util/number.js'); var zrUtil = require('../zrender/tool/util.js'); @@ -20,35 +21,25 @@ function Base(ecTheme, messageCenter, zr, option, myChart) { this.myChart = myChart; this.component = myChart.component; - this._zlevelBase = this.getZlevelBase(); this.shapeList = []; this.effectList = []; var self = this; - self.hoverConnect = function (param) { - var target = (param.target || {}).hoverConnect; - if (target) { - var zlevel = 10; - var shape; - if (!(target instanceof Array)) { - shape = self.getShapeById(target); - if (shape) { - self.zr.addHoverShape(shape); - zlevel = Math.min(zlevel, shape.zlevel); - } - } - else { - for (var i = 0, l = target.length; i < l; i++) { - shape = self.getShapeById(target[i]); - self.zr.addHoverShape(shape); - zlevel = Math.min(zlevel, shape.zlevel); + + self._onlegendhoverlink = function (param) { + if (self.legendHoverLink) { + var targetName = param.target; + var name; + for (var i = self.shapeList.length - 1; i >= 0; i--) { + name = self.type == ecConfig.CHART_TYPE_PIE || self.type == ecConfig.CHART_TYPE_FUNNEL ? ecData.get(self.shapeList[i], 'name') : (ecData.get(self.shapeList[i], 'series') || {}).name; + if (name == targetName && !self.shapeList[i].invisible && !self.shapeList[i]._animating) { + self.zr.addHoverShape(self.shapeList[i]); } } - if (zlevel < param.target.zlevel) { - self.zr.addHoverShape(param.target); - } } }; + messageCenter && messageCenter.bind( + ecConfig.EVENT.LEGEND_HOVERLINK, this._onlegendhoverlink); } /** @@ -56,53 +47,30 @@ function Base(ecTheme, messageCenter, zr, option, myChart) { */ Base.prototype = { canvasSupported: require('../zrender/tool/env.js').canvasSupported, + _getZ: function (zWhat) { + var opt = this.ecTheme[this.type]; + if (opt && opt[zWhat] != null) { + return opt[zWhat]; + } + opt = ecConfig[this.type]; + if (opt && opt[zWhat] != null) { + return opt[zWhat]; + } + return 0; + }, + /** * 获取zlevel基数配置 - * @param {Object} contentType */ - getZlevelBase: function (contentType) { - contentType = contentType || this.type + ''; - - switch (contentType) { - case ecConfig.COMPONENT_TYPE_GRID: - case ecConfig.COMPONENT_TYPE_AXIS_CATEGORY: - case ecConfig.COMPONENT_TYPE_AXIS_VALUE: - case ecConfig.COMPONENT_TYPE_POLAR: - return 0; - - case ecConfig.CHART_TYPE_LINE: - case ecConfig.CHART_TYPE_BAR: - case ecConfig.CHART_TYPE_SCATTER: - case ecConfig.CHART_TYPE_PIE: - case ecConfig.CHART_TYPE_RADAR: - case ecConfig.CHART_TYPE_MAP: - case ecConfig.CHART_TYPE_K: - case ecConfig.CHART_TYPE_CHORD: - case ecConfig.CHART_TYPE_GUAGE: - case ecConfig.CHART_TYPE_FUNNEL: - return 2; - - case ecConfig.COMPONENT_TYPE_LEGEND: - case ecConfig.COMPONENT_TYPE_DATARANGE: - case ecConfig.COMPONENT_TYPE_DATAZOOM: - case ecConfig.COMPONENT_TYPE_TIMELINE: - return 4; - - case ecConfig.CHART_TYPE_ISLAND: - return 5; - - case ecConfig.COMPONENT_TYPE_TOOLBOX: - case ecConfig.COMPONENT_TYPE_TITLE: - return 6; - - // ecConfig.EFFECT_ZLEVEL = 7; - - case ecConfig.COMPONENT_TYPE_TOOLTIP: - return 8; - - default: - return 0; - } + getZlevelBase: function () { + return this._getZ('zlevel'); + }, + + /** + * 获取z基数配置 + */ + getZBase: function () { + return this._getZ('z'); }, /** @@ -112,8 +80,10 @@ Base.prototype = { * @return {Object} 修正后的参数 */ reformOption: function (opt) { + // 默认配置项动态多级合并,依赖加载的组件选项未被merge到ecTheme里,需要从config里取 return zrUtil.merge( - opt || {}, zrUtil.clone(this.ecTheme[this.type] || {})); + zrUtil.merge( + opt || {}, zrUtil.clone(this.ecTheme[this.type] || {})), zrUtil.clone(ecConfig[this.type] || {})); }, /** @@ -141,7 +111,7 @@ Base.prototype = { getShapeById: function (id) { for (var i = 0, l = this.shapeList.length; i < l; i++) { - if (this.shapeList[i].id == id) { + if (this.shapeList[i].id === id) { return this.shapeList[i]; } } @@ -152,20 +122,43 @@ Base.prototype = { * 获取自定义和默认配置合并后的字体设置 */ getFont: function (textStyle) { - var finalTextStyle = zrUtil.merge( - zrUtil.clone(textStyle) || {}, this.ecTheme.textStyle); + var finalTextStyle = this.getTextStyle( + zrUtil.clone(textStyle)); return finalTextStyle.fontStyle + ' ' + finalTextStyle.fontWeight + ' ' + finalTextStyle.fontSize + 'px ' + finalTextStyle.fontFamily; }, + /** + * 获取统一主题字体样式 + */ + getTextStyle: function (targetStyle) { + return zrUtil.merge( + zrUtil.merge( + targetStyle || {}, this.ecTheme.textStyle), ecConfig.textStyle); + }, + getItemStyleColor: function (itemColor, seriesIndex, dataIndex, data) { - return typeof itemColor == 'function' ? itemColor(seriesIndex, dataIndex, data) : itemColor; + return typeof itemColor === 'function' ? itemColor.call( + this.myChart, { + seriesIndex: seriesIndex, + series: this.series[seriesIndex], + dataIndex: dataIndex, + data: data + }) : itemColor; }, + /** + * @parmas {object | number} data 目标data + * @params {string= | number=} defaultData 无数据时默认返回 + */ + getDataFromOption: function (data, defaultData) { + return data != null ? (data.value != null ? data.value : data) : defaultData; + }, + // 亚像素优化 subPixelOptimize: function (position, lineWidth) { - if (lineWidth % 2 == 1) { - //position += position == Math.ceil(position) ? 0.5 : 0; + if (lineWidth % 2 === 1) { + //position += position === Math.ceil(position) ? 0.5 : 0; position = Math.floor(position) + 0.5; } else { @@ -174,7 +167,7 @@ Base.prototype = { return position; }, - + // 默认resize resize: function () { this.refresh && this.refresh(); this.clearEffectShape && this.clearEffectShape(true); @@ -197,9 +190,13 @@ Base.prototype = { * 释放后实例不可用 */ dispose: function () { + this.onbeforDispose && this.onbeforDispose(); this.clear(); this.shapeList = null; this.effectList = null; + this.messageCenter && this.messageCenter.unbind( + ecConfig.EVENT.LEGEND_HOVERLINK, this._onlegendhoverlink); + this.onafterDispose && this.onafterDispose(); }, query: ecQuery.query, diff --git a/src/component/categoryAxis.js b/src/component/categoryAxis.js index e3689ec..abb0fc9 100644 --- a/src/component/categoryAxis.js +++ b/src/component/categoryAxis.js @@ -2,7 +2,7 @@ * echarts组件: 类目轴 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ @@ -14,6 +14,78 @@ var LineShape = require('../zrender/shape/Line.js'); var RectangleShape = require('../zrender/shape/Rectangle.js'); var ecConfig = require('../config.js'); +// 类目轴 +ecConfig.categoryAxis = { + zlevel: 0, + // 一级层叠 + z: 0, + // 二级层叠 + show: true, + position: 'bottom', + // 位置 + name: '', + // 坐标轴名字,默认为空 + nameLocation: 'end', + // 坐标轴名字位置,支持'start' | 'end' + nameTextStyle: {}, + // 坐标轴文字样式,默认取全局样式 + boundaryGap: true, + // 类目起始和结束两端空白策略 + axisLine: { // 坐标轴线 + show: true, + // 默认显示,属性show控制显示与否 + onZero: true, + lineStyle: { // 属性lineStyle控制线条样式 + color: '#48b', + width: 2, + type: 'solid' + } + }, + axisTick: { // 坐标轴小标记 + show: true, + // 属性show控制显示与否,默认不显示 + interval: 'auto', + inside: false, + // 控制小标记是否在grid里 + // onGap: null, + length: 5, + // 属性length控制线长 + lineStyle: { // 属性lineStyle控制线条样式 + color: '#333', + width: 1 + } + }, + axisLabel: { // 坐标轴文本标签,详见axis.axisLabel + show: true, + interval: 'auto', + rotate: 0, + margin: 8, + // clickable: false, + // formatter: null, + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: '#333' + } + }, + splitLine: { // 分隔线 + show: true, + // 默认显示,属性show控制显示与否 + // onGap: null, + lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 + color: ['#ccc'], + width: 1, + type: 'solid' + } + }, + splitArea: { // 分隔区域 + show: false, + // 默认不显示,属性show控制显示与否 + // onGap: null, + areaStyle: { // 属性areaStyle(详见areaStyle)控制区域样式 + color: ['rgba(250,250,250,0.3)', 'rgba(200,200,200,0.3)'] + } + } +}; + var zrUtil = require('../zrender/tool/util.js'); var zrArea = require('../zrender/tool/area.js'); @@ -45,7 +117,7 @@ function CategoryAxis(ecTheme, messageCenter, zr, option, myChart, axisBase) { CategoryAxis.prototype = { type: ecConfig.COMPONENT_TYPE_AXIS_CATEGORY, _getReformedLabel: function (idx) { - var data = typeof this.option.data[idx].value != 'undefined' ? this.option.data[idx].value : this.option.data[idx]; + var data = this.getDataFromOption(this.option.data[idx]); var formatter = this.option.data[idx].formatter || this.option.axisLabel.formatter; if (formatter) { if (typeof formatter == 'function') { @@ -139,8 +211,8 @@ CategoryAxis.prototype = { } } else { - // 用户自定义间隔 - interval = interval - 0 + 1; + // 用户自定义间隔,支持funtion + interval = typeof interval == 'function' ? 1 : (interval - 0 + 1); } return interval; @@ -152,7 +224,9 @@ CategoryAxis.prototype = { _buildShape: function () { // 标签显示的挑选间隔 this._interval = this._getInterval(); - + if (!this.option.show) { + return; + } this.option.splitArea.show && this._buildSplitArea(); this.option.splitLine.show && this._buildSplitLine(); this.option.axisLine.show && this._buildAxisLine(); @@ -167,13 +241,14 @@ CategoryAxis.prototype = { // 小标记 _buildAxisTick: function () { var axShape; - //var data = this.option.data; + var data = this.option.data; var dataLength = this.option.data.length; var tickOption = this.option.axisTick; var length = tickOption.length; var color = tickOption.lineStyle.color; var lineWidth = tickOption.lineStyle.width; - var interval = tickOption.interval == 'auto' ? this._interval : (tickOption.interval - 0 + 1); + var intervalFunction = typeof tickOption.interval == 'function' ? tickOption.interval : tickOption.interval == 'auto' ? typeof this.option.axisLabel.interval == 'function' ? this.option.axisLabel.interval : false : false; + var interval = intervalFunction ? 1 : tickOption.interval == 'auto' ? this._interval : (tickOption.interval - 0 + 1); var onGap = tickOption.onGap; var optGap = onGap ? (this.getGap() / 2) : typeof onGap == 'undefined' ? (this.option.boundaryGap ? (this.getGap() / 2) : 0) : 0; var startIndex = optGap > 0 ? -interval : 0; @@ -182,12 +257,17 @@ CategoryAxis.prototype = { var yPosition = this.option.position == 'bottom' ? (tickOption.inside ? (this.grid.getYend() - length - 1) : (this.grid.getYend() + 1)) : (tickOption.inside ? (this.grid.getY() + 1) : (this.grid.getY() - length - 1)); var x; for (var i = startIndex; i < dataLength; i += interval) { + if (intervalFunction && !intervalFunction(i, data[i])) { + // 回调并且回调返回false则跳过渲染 + continue; + } // 亚像素优化 x = this.subPixelOptimize( this.getCoordByIndex(i) + (i >= 0 ? optGap : 0), lineWidth); axShape = { _axisShape: 'axisTick', - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), hoverable: false, style: { xStart: x, @@ -207,12 +287,17 @@ CategoryAxis.prototype = { var y; for (var i = startIndex; i < dataLength; i += interval) { + if (intervalFunction && !intervalFunction(i, data[i])) { + // 回调并且回调返回false则中断渲染 + continue; + } // 亚像素优化 y = this.subPixelOptimize( this.getCoordByIndex(i) - (i >= 0 ? optGap : 0), lineWidth); axShape = { _axisShape: 'axisTick', - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), hoverable: false, style: { xStart: xPosition, @@ -233,10 +318,12 @@ CategoryAxis.prototype = { var axShape; var data = this.option.data; var dataLength = this.option.data.length; - var rotate = this.option.axisLabel.rotate; - var margin = this.option.axisLabel.margin; - var clickable = this.option.axisLabel.clickable; - var textStyle = this.option.axisLabel.textStyle; + var labelOption = this.option.axisLabel; + var rotate = labelOption.rotate; + var margin = labelOption.margin; + var clickable = labelOption.clickable; + var textStyle = labelOption.textStyle; + var intervalFunction = typeof labelOption.interval == 'function' ? labelOption.interval : false; var dataTextStyle; if (this.isHorizontal()) { @@ -253,15 +340,18 @@ CategoryAxis.prototype = { } for (var i = 0; i < dataLength; i += this._interval) { - if (this._getReformedLabel(i) === '') { - // 空文本优化 + if ((intervalFunction && !intervalFunction(i, data[i])) + // 回调并且回调返回false则中断渲染 + || this._getReformedLabel(i) === '' // 空文本优化 + ) { continue; } dataTextStyle = zrUtil.merge( data[i].textStyle || {}, textStyle); axShape = { // shape : 'text', - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase() + 3, hoverable: false, style: { x: this.getCoordByIndex(i), @@ -296,15 +386,18 @@ CategoryAxis.prototype = { } for (var i = 0; i < dataLength; i += this._interval) { - if (this._getReformedLabel(i) === '') { - // 空文本优化 + if ((intervalFunction && !intervalFunction(i, data[i])) + // 回调并且回调返回false则中断渲染 + || this._getReformedLabel(i) === '' // 空文本优化 + ) { continue; } dataTextStyle = zrUtil.merge( data[i].textStyle || {}, textStyle); axShape = { // shape : 'text', - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase() + 3, hoverable: false, style: { x: xPosition, @@ -329,7 +422,7 @@ CategoryAxis.prototype = { _buildSplitLine: function () { var axShape; - //var data = this.option.data; + var data = this.option.data; var dataLength = this.option.data.length; var sLineOption = this.option.splitLine; var lineType = sLineOption.lineStyle.type; @@ -338,6 +431,9 @@ CategoryAxis.prototype = { color = color instanceof Array ? color : [color]; var colorLength = color.length; + // splitLine随axisLable + var intervalFunction = typeof this.option.axisLabel.interval == 'function' ? this.option.axisLabel.interval : false; + var onGap = sLineOption.onGap; var optGap = onGap ? (this.getGap() / 2) : typeof onGap == 'undefined' ? (this.option.boundaryGap ? (this.getGap() / 2) : 0) : 0; dataLength -= (onGap || (typeof onGap == 'undefined' && this.option.boundaryGap)) ? 1 : 0; @@ -348,12 +444,17 @@ CategoryAxis.prototype = { var x; for (var i = 0; i < dataLength; i += this._interval) { + if (intervalFunction && !intervalFunction(i, data[i])) { + // 回调并且回调返回false则跳过渲染 + continue; + } // 亚像素优化 x = this.subPixelOptimize( this.getCoordByIndex(i) + optGap, lineWidth); axShape = { // shape : 'line', - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), hoverable: false, style: { xStart: x, @@ -376,12 +477,17 @@ CategoryAxis.prototype = { var y; for (var i = 0; i < dataLength; i += this._interval) { + if (intervalFunction && !intervalFunction(i, data[i])) { + // 回调并且回调返回false则跳过渲染 + continue; + } // 亚像素优化 y = this.subPixelOptimize( this.getCoordByIndex(i) - optGap, lineWidth); axShape = { // shape : 'line', - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), hoverable: false, style: { xStart: sx, @@ -389,7 +495,7 @@ CategoryAxis.prototype = { xEnd: ex, yEnd: y, strokeColor: color[(i / this._interval) % colorLength], - linetype: lineType, + lineType: lineType, lineWidth: lineWidth } }; @@ -400,13 +506,15 @@ CategoryAxis.prototype = { _buildSplitArea: function () { var axShape; + var data = this.option.data; var sAreaOption = this.option.splitArea; var color = sAreaOption.areaStyle.color; if (!(color instanceof Array)) { // 非数组一律认为是单一颜色的字符串,单一颜色则用一个背景,颜色错误不负责啊!!! axShape = { // shape : 'rectangle', - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), hoverable: false, style: { x: this.grid.getX(), @@ -424,6 +532,9 @@ CategoryAxis.prototype = { var colorLength = color.length; var dataLength = this.option.data.length; + // splitArea随axisLable + var intervalFunction = typeof this.option.axisLabel.interval == 'function' ? this.option.axisLabel.interval : false; + var onGap = sAreaOption.onGap; var optGap = onGap ? (this.getGap() / 2) : typeof onGap == 'undefined' ? (this.option.boundaryGap ? (this.getGap() / 2) : 0) : 0; if (this.isHorizontal()) { @@ -434,10 +545,15 @@ CategoryAxis.prototype = { var curX; for (var i = 0; i <= dataLength; i += this._interval) { + if (intervalFunction && !intervalFunction(i, data[i]) && i < dataLength) { + // 回调并且回调返回false则跳过渲染 + continue; + } curX = i < dataLength ? (this.getCoordByIndex(i) + optGap) : this.grid.getXend(); axShape = { // shape : 'rectangle', - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), hoverable: false, style: { x: lastX, @@ -460,10 +576,15 @@ CategoryAxis.prototype = { var curY; for (var i = 0; i <= dataLength; i += this._interval) { + if (intervalFunction && !intervalFunction(i, data[i]) && i < dataLength) { + // 回调并且回调返回false则跳过渲染 + continue; + } curY = i < dataLength ? (this.getCoordByIndex(i) - optGap) : this.grid.getY(); axShape = { // shape : 'rectangle', - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), hoverable: false, style: { x: x, @@ -488,8 +609,8 @@ CategoryAxis.prototype = { if (newOption) { this.option = this.reformOption(newOption); // 通用字体设置 - this.option.axisLabel.textStyle = zrUtil.merge( - this.option.axisLabel.textStyle || {}, this.ecTheme.textStyle); + this.option.axisLabel.textStyle = this.getTextStyle( + this.option.axisLabel.textStyle); } this.clear(); this._buildShape(); @@ -517,7 +638,7 @@ CategoryAxis.prototype = { var position = this.option.boundaryGap ? (gap / 2) : 0; for (var i = 0; i < dataLength; i++) { - if (data[i] == value || (typeof data[i].value != 'undefined' && data[i].value == value)) { + if (this.getDataFromOption(data[i]) == value) { if (this.isHorizontal()) { // 横向 position = this.grid.getX() + position; @@ -582,13 +703,7 @@ CategoryAxis.prototype = { // 根据类目轴数据索引换算类目轴名称 getNameByIndex: function (dataIndex) { - var data = this.option.data[dataIndex]; - if (typeof data != 'undefined' && typeof data.value != 'undefined') { - return data.value; - } - else { - return data; - } + return this.getDataFromOption(this.option.data[dataIndex]); }, // 根据类目轴名称换算类目轴数据索引 @@ -597,7 +712,7 @@ CategoryAxis.prototype = { var dataLength = data.length; for (var i = 0; i < dataLength; i++) { - if (data[i] == name || (typeof data[i].value != 'undefined' && data[i].value == name)) { + if (this.getDataFromOption(data[i]) == name) { return i; } } diff --git a/src/component/dataRange.js b/src/component/dataRange.js index a93ef79..c22190f 100644 --- a/src/component/dataRange.js +++ b/src/component/dataRange.js @@ -2,7 +2,7 @@ * echarts组件:值域 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ @@ -14,7 +14,62 @@ var RectangleShape = require('../zrender/shape/Rectangle.js'); var HandlePolygonShape = require('../util/shape/HandlePolygon.js'); var ecConfig = require('../config.js'); +// 值域 +ecConfig.dataRange = { + zlevel: 0, + // 一级层叠 + z: 4, + // 二级层叠 + show: true, + orient: 'vertical', + // 布局方式,默认为垂直布局,可选为: + // 'horizontal' ¦ 'vertical' + x: 'left', + // 水平安放位置,默认为全图左对齐,可选为: + // 'center' ¦ 'left' ¦ 'right' + // ¦ {number}(x坐标,单位px) + y: 'bottom', + // 垂直安放位置,默认为全图底部,可选为: + // 'top' ¦ 'bottom' ¦ 'center' + // ¦ {number}(y坐标,单位px) + backgroundColor: 'rgba(0,0,0,0)', + borderColor: '#ccc', + // 值域边框颜色 + borderWidth: 0, + // 值域边框线宽,单位px,默认为0(无边框) + padding: 5, + // 值域内边距,单位px,默认各方向内边距为5, + // 接受数组分别设定上右下左边距,同css + itemGap: 10, + // 各个item之间的间隔,单位px,默认为10, + // 横向布局时为水平间隔,纵向布局时为纵向间隔 + itemWidth: 20, + // 值域图形宽度,线性渐变水平布局宽度为该值 * 10 + itemHeight: 14, + // 值域图形高度,线性渐变垂直布局高度为该值 * 10 + // min: null, // 最小值 + // max: null, // 最大值 + precision: 0, + // 小数精度,默认为0,无小数点 + splitNumber: 5, + // 分割段数,默认为5,为0时为线性渐变 + calculable: false, + // 是否值域漫游,启用后无视splitNumber,线性渐变 + selectedMode: true, + // 选择模式,默认开启值域开关 + hoverLink: true, + realtime: true, + color: ['#006edd', '#e0ffff'], + //颜色 + // formatter: null, + // text:['高','低'], // 文本,默认为数值文本 + textStyle: { + color: '#333' // 值域文字颜色 + } +}; + var zrUtil = require('../zrender/tool/util.js'); +var zrEvent = require('../zrender/tool/event.js'); var zrArea = require('../zrender/tool/area.js'); var zrColor = require('../zrender/tool/color.js'); @@ -44,10 +99,18 @@ function DataRange(ecTheme, messageCenter, zr, option, myChart) { self._dataRangeSelected = function (param) { return self.__dataRangeSelected(param); }; + self._dispatchHoverLink = function (param) { + return self.__dispatchHoverLink(param); + }; + self._onhoverlink = function (params) { + return self.__onhoverlink(params); + }; this._selectedMap = {}; this._range = {}; this.refresh(option); + + messageCenter.bind(ecConfig.EVENT.HOVER, this._onhoverlink); } DataRange.prototype = { @@ -65,8 +128,10 @@ DataRange.prototype = { this._buildItem(); } - for (var i = 0, l = this.shapeList.length; i < l; i++) { - this.zr.addShape(this.shapeList[i]); + if (this.dataRangeOption.show) { + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } } this._syncShapeFromRange(); @@ -116,18 +181,23 @@ DataRange.prototype = { for (var i = 0; i < dataLength; i++) { itemName = data[i]; - color = this.getColor((dataLength - i) * this._gap + this.dataRangeOption.min); + color = this.getColorByIndex(i); // 图形 itemShape = this._getItemShape( lastX, lastY, itemWidth, itemHeight, (this._selectedMap[i] ? color : '#ccc')); itemShape._idx = i; - itemShape.onclick = this._dataRangeSelected; + itemShape.onmousemove = this._dispatchHoverLink; + if (this.dataRangeOption.selectedMode) { + itemShape.clickable = true; + itemShape.onclick = this._dataRangeSelected; + } this.shapeList.push(new RectangleShape(itemShape)); if (needValueText) { // 文字 textShape = { - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), style: { x: lastX + itemWidth + 5, y: lastY, @@ -138,15 +208,18 @@ DataRange.prototype = { }, highlightStyle: { brushType: 'fill' - }, - clickable: true + } }; if (this.dataRangeOption.orient == 'vertical' && this.dataRangeOption.x == 'right') { textShape.style.x -= (itemWidth + 10); textShape.style.textAlign = 'right'; } textShape._idx = i; - textShape.onclick = this._dataRangeSelected; + textShape.onmousemove = this._dispatchHoverLink; + if (this.dataRangeOption.selectedMode) { + textShape.clickable = true; + textShape.onclick = this._dataRangeSelected; + } this.shapeList.push(new TextShape(textShape)); } @@ -191,6 +264,7 @@ DataRange.prototype = { var itemWidth = this.dataRangeOption.itemWidth; var itemHeight = this.dataRangeOption.itemHeight; var textHeight = zrArea.getTextHeight('国', font); + var mSize = 10; var needValueText = true; @@ -221,42 +295,45 @@ DataRange.prototype = { } if (this.dataRangeOption.orient == 'horizontal') { itemShape = { - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), style: { x: lastX, y: lastY, - width: itemWidth * 10, + width: itemWidth * mSize, height: itemHeight, color: zrColor.getLinearGradient( - lastX, lastY, lastX + itemWidth * 10, lastY, colorList) + lastX, lastY, lastX + itemWidth * mSize, lastY, colorList) }, hoverable: false }; - lastX += itemWidth * 10 + this._textGap; + lastX += itemWidth * mSize + this._textGap; } else { itemShape = { - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), style: { x: lastX, y: lastY, width: itemWidth, - height: itemHeight * 10, + height: itemHeight * mSize, color: zrColor.getLinearGradient( - lastX, lastY, lastX, lastY + itemHeight * 10, colorList) + lastX, lastY, lastX, lastY + itemHeight * mSize, colorList) }, hoverable: false }; - lastY += itemHeight * 10 + this._textGap; + lastY += itemHeight * mSize + this._textGap; } this.shapeList.push(new RectangleShape(itemShape)); + // 可计算元素的位置缓存 + this._calculableLocation = itemShape.style; if (this.dataRangeOption.calculable) { - // 可计算元素的位置缓存 - this._calculableLocation = itemShape.style; this._buildFiller(); this._bulidMask(); this._bulidHandle(); } + this._buildIndicator(); if (!needValueText && this.dataRangeOption.text[1]) { // 最后一个文字 @@ -267,12 +344,88 @@ DataRange.prototype = { } }, + /** + * 构建指示器 + */ + _buildIndicator: function () { + var x = this._calculableLocation.x; + var y = this._calculableLocation.y; + var width = this._calculableLocation.width; + var height = this._calculableLocation.height; + + var size = 5; + var pointList; + var textPosition; + if (this.dataRangeOption.orient == 'horizontal') { + // 水平 + if (this.dataRangeOption.y != 'bottom') { + // 手柄统统在下方 + pointList = [ + [x, y + height], + [x - size, y + height + size], + [x + size, y + height + size] + ]; + textPosition = 'bottom'; + } + else { + // 手柄在上方 + pointList = [ + [x, y], + [x - size, y - size], + [x + size, y - size] + ]; + textPosition = 'top'; + } + } + else { + // 垂直 + if (this.dataRangeOption.x != 'right') { + // 手柄统统在右侧 + pointList = [ + [x + width, y], + [x + width + size, y - size], + [x + width + size, y + size] + ]; + textPosition = 'right'; + } + else { + // 手柄在左侧 + pointList = [ + [x, y], + [x - size, y - size], + [x - size, y + size] + ]; + textPosition = 'left'; + } + } + this._indicatorShape = { + style: { + pointList: pointList, + color: '#fff', + __rect: { + x: Math.min(pointList[0][0], pointList[1][0]), + y: Math.min(pointList[0][1], pointList[1][1]), + width: size * (this.dataRangeOption.orient == 'horizontal' ? 2 : 1), + height: size * (this.dataRangeOption.orient == 'horizontal' ? 1 : 2) + } + }, + highlightStyle: { + brushType: 'fill', + textPosition: textPosition, + textColor: this.dataRangeOption.textStyle.color + }, + hoverable: false + }; + this._indicatorShape = new HandlePolygonShape(this._indicatorShape); + }, + /** * 构建填充物 */ _buildFiller: function () { - this._fillerShae = { - zlevel: this._zlevelBase + 1, + this._fillerShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, style: { x: this._calculableLocation.x, y: this._calculableLocation.y, @@ -287,10 +440,11 @@ DataRange.prototype = { draggable: true, ondrift: this._ondrift, ondragend: this._ondragend, + onmousemove: this._dispatchHoverLink, _type: 'filler' }; - this._fillerShae = new RectangleShape(this._fillerShae); - this.shapeList.push(this._fillerShae); + this._fillerShape = new RectangleShape(this._fillerShape); + this.shapeList.push(this._fillerShape); }, /** @@ -467,6 +621,7 @@ DataRange.prototype = { text: this._textFormat(this.dataRangeOption.max), textX: textXStart, textY: textYStart, + textFont: font, color: this.getColor(this.dataRangeOption.max), rect: coverRectStart, x: pointListStart[0][0], @@ -487,6 +642,7 @@ DataRange.prototype = { text: this._textFormat(this.dataRangeOption.min), textX: textXEnd, textY: textYEnd, + textFont: font, color: this.getColor(this.dataRangeOption.min), rect: coverRectEnd, x: pointListEnd[0][0], @@ -502,7 +658,8 @@ DataRange.prototype = { }; // 统一参数 - this._startShape.zlevel = this._endShape.zlevel = this._zlevelBase + 1; + this._startShape.zlevel = this._endShape.zlevel = this.getZlevelBase(); + this._startShape.z = this._endShape.z = this.getZBase() + 1; this._startShape.draggable = this._endShape.draggable = true; this._startShape.ondrift = this._endShape.ondrift = this._ondrift; this._startShape.ondragend = this._endShape.ondragend = this._ondragend; @@ -528,7 +685,8 @@ DataRange.prototype = { var width = this._calculableLocation.width; var height = this._calculableLocation.height; this._startMask = { - zlevel: this._zlevelBase + 1, + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, style: { x: x, y: y, @@ -539,7 +697,8 @@ DataRange.prototype = { hoverable: false }; this._endMask = { - zlevel: this._zlevelBase + 1, + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, style: { x: this.dataRangeOption.orient == 'horizontal' ? x + width : x, y: this.dataRangeOption.orient == 'horizontal' ? y : y + height, @@ -556,19 +715,17 @@ DataRange.prototype = { }, _buildBackground: function () { - var pTop = this.dataRangeOption.padding[0]; - var pRight = this.dataRangeOption.padding[1]; - var pBottom = this.dataRangeOption.padding[2]; - var pLeft = this.dataRangeOption.padding[3]; + var padding = this.reformCssArray(this.dataRangeOption.padding); this.shapeList.push(new RectangleShape({ - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), hoverable: false, style: { - x: this._itemGroupLocation.x - pLeft, - y: this._itemGroupLocation.y - pTop, - width: this._itemGroupLocation.width + pLeft + pRight, - height: this._itemGroupLocation.height + pTop + pBottom, + x: this._itemGroupLocation.x - padding[3], + y: this._itemGroupLocation.y - padding[0], + width: this._itemGroupLocation.width + padding[3] + padding[1], + height: this._itemGroupLocation.height + padding[0] + padding[2], brushType: this.dataRangeOption.borderWidth === 0 ? 'fill' : 'both', color: this.dataRangeOption.backgroundColor, strokeColor: this.dataRangeOption.borderColor, @@ -590,12 +747,13 @@ DataRange.prototype = { var totalHeight = 0; var font = this.getFont(this.dataRangeOption.textStyle); var textHeight = zrArea.getTextHeight('国', font); + var mSize = 10; if (this.dataRangeOption.orient == 'horizontal') { // 水平布局,计算总宽度 if (this.dataRangeOption.text || this.dataRangeOption.splitNumber <= 0 || this.dataRangeOption.calculable) { // 指定文字或线性渐变 - totalWidth = ((this.dataRangeOption.splitNumber <= 0 || this.dataRangeOption.calculable) ? (itemWidth * 10 + itemGap) : dataLength * (itemWidth + itemGap)) + (this.dataRangeOption.text && typeof this.dataRangeOption.text[0] != 'undefined' ? (zrArea.getTextWidth( + totalWidth = ((this.dataRangeOption.splitNumber <= 0 || this.dataRangeOption.calculable) ? (itemWidth * mSize + itemGap) : dataLength * (itemWidth + itemGap)) + (this.dataRangeOption.text && typeof this.dataRangeOption.text[0] != 'undefined' ? (zrArea.getTextWidth( this.dataRangeOption.text[0], font) + this._textGap) : 0) + (this.dataRangeOption.text && typeof this.dataRangeOption.text[1] != 'undefined' ? (zrArea.getTextWidth( this.dataRangeOption.text[1], font) + this._textGap) : 0); } @@ -615,7 +773,7 @@ DataRange.prototype = { var maxWidth; if (this.dataRangeOption.text || this.dataRangeOption.splitNumber <= 0 || this.dataRangeOption.calculable) { // 指定文字或线性渐变 - totalHeight = ((this.dataRangeOption.splitNumber <= 0 || this.dataRangeOption.calculable) ? (itemHeight * 10 + itemGap) : dataLength * (itemHeight + itemGap)) + (this.dataRangeOption.text && typeof this.dataRangeOption.text[0] != 'undefined' ? (this._textGap + textHeight) : 0) + (this.dataRangeOption.text && typeof this.dataRangeOption.text[1] != 'undefined' ? (this._textGap + textHeight) : 0); + totalHeight = ((this.dataRangeOption.splitNumber <= 0 || this.dataRangeOption.calculable) ? (itemHeight * mSize + itemGap) : dataLength * (itemHeight + itemGap)) + (this.dataRangeOption.text && typeof this.dataRangeOption.text[0] != 'undefined' ? (this._textGap + textHeight) : 0) + (this.dataRangeOption.text && typeof this.dataRangeOption.text[1] != 'undefined' ? (this._textGap + textHeight) : 0); maxWidth = Math.max( zrArea.getTextWidth((this.dataRangeOption.text && this.dataRangeOption.text[0]) || '', font), zrArea.getTextWidth((this.dataRangeOption.text && this.dataRangeOption.text[1]) || '', font)); @@ -636,6 +794,7 @@ DataRange.prototype = { totalHeight -= itemGap; // 减去最后一个的itemGap; } + var padding = this.reformCssArray(this.dataRangeOption.padding); var x; var zrWidth = this.zr.getWidth(); switch (this.dataRangeOption.x) { @@ -643,10 +802,10 @@ DataRange.prototype = { x = Math.floor((zrWidth - totalWidth) / 2); break; case 'left': - x = this.dataRangeOption.padding[3] + this.dataRangeOption.borderWidth; + x = padding[3] + this.dataRangeOption.borderWidth; break; case 'right': - x = zrWidth - totalWidth - this.dataRangeOption.padding[1] - this.dataRangeOption.borderWidth; + x = zrWidth - totalWidth - padding[1] - this.dataRangeOption.borderWidth; break; default: x = this.parsePercent(this.dataRangeOption.x, zrWidth); @@ -658,10 +817,10 @@ DataRange.prototype = { var zrHeight = this.zr.getHeight(); switch (this.dataRangeOption.y) { case 'top': - y = this.dataRangeOption.padding[0] + this.dataRangeOption.borderWidth; + y = padding[0] + this.dataRangeOption.borderWidth; break; case 'bottom': - y = zrHeight - totalHeight - this.dataRangeOption.padding[2] - this.dataRangeOption.borderWidth; + y = zrHeight - totalHeight - padding[2] - this.dataRangeOption.borderWidth; break; case 'center': y = Math.floor((zrHeight - totalHeight) / 2); @@ -705,7 +864,8 @@ DataRange.prototype = { // 指定文本 _getTextShape: function (x, y, text) { return { - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), style: { x: (this.dataRangeOption.orient == 'horizontal' ? x : this._itemGroupLocation.x + this._itemGroupLocation.width / 2), y: (this.dataRangeOption.orient == 'horizontal' ? this._itemGroupLocation.y + this._itemGroupLocation.height / 2 : y), @@ -722,7 +882,8 @@ DataRange.prototype = { // 色尺legend item shape _getItemShape: function (x, y, width, height, color) { return { - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), style: { x: x, y: y + 1, @@ -733,8 +894,7 @@ DataRange.prototype = { highlightStyle: { strokeColor: color, lineWidth: 1 - }, - clickable: true + } }; }, @@ -778,7 +938,7 @@ DataRange.prototype = { } if (this.dataRangeOption.realtime) { - this._syncData(); + this._dispatchDataRange(); } return true; @@ -797,20 +957,12 @@ DataRange.prototype = { return; } - !this.dataRangeOption.realtime && this._syncData(); - // 别status = {}赋值啊!! status.dragOut = true; status.dragIn = true; - if (!this.dataRangeOption.realtime && false) { - this.messageCenter.dispatch( - ecConfig.EVENT.DATA_RANGE, null, { - range: { - start: this._range.end, - end: this._range.start - } - }, this.myChart); + if (!this.dataRangeOption.realtime) { + this._dispatchDataRange(); } status.needRefresh = false; // 会有消息触发fresh,不用再刷一遍 @@ -831,19 +983,19 @@ DataRange.prototype = { // 非默认满值同步一下图形 if (this.dataRangeOption.orient == 'horizontal') { // 横向 - var width = this._fillerShae.style.width; - this._fillerShae.style.x += width * (100 - this._range.start) / 100; - this._fillerShae.style.width = + var width = this._fillerShape.style.width; + this._fillerShape.style.x += width * (100 - this._range.start) / 100; + this._fillerShape.style.width = width * (this._range.start - this._range.end) / 100; } else { // 纵向 - var height = this._fillerShae.style.height; - this._fillerShae.style.y += height * (100 - this._range.start) / 100; - this._fillerShae.style.height = + var height = this._fillerShape.style.height; + this._fillerShape.style.y += height * (100 - this._range.start) / 100; + this._fillerShape.style.height = height * (this._range.start - this._range.end) / 100; } - this.zr.modShape(this._fillerShae.id); + this.zr.modShape(this._fillerShape.id); this._syncHandleShape(); } }, @@ -855,10 +1007,10 @@ DataRange.prototype = { var height = this._calculableLocation.height; if (this.dataRangeOption.orient == 'horizontal') { - this._startShape.style.x = this._fillerShae.style.x; + this._startShape.style.x = this._fillerShape.style.x; this._startMask.style.width = this._startShape.style.x - x; - this._endShape.style.x = this._fillerShae.style.x + this._fillerShae.style.width; + this._endShape.style.x = this._fillerShape.style.x + this._fillerShape.style.width; this._endMask.style.x = this._endShape.style.x; this._endMask.style.width = x + width - this._endShape.style.x; @@ -868,10 +1020,10 @@ DataRange.prototype = { 100 - (this._endShape.style.x - x) / width * 100); } else { - this._startShape.style.y = this._fillerShae.style.y; + this._startShape.style.y = this._fillerShape.style.y; this._startMask.style.height = this._startShape.style.y - y; - this._endShape.style.y = this._fillerShae.style.y + this._fillerShae.style.height; + this._endShape.style.y = this._fillerShape.style.y + this._fillerShape.style.height; this._endMask.style.y = this._endShape.style.y; this._endMask.style.height = y + height - this._endShape.style.y; @@ -905,8 +1057,8 @@ DataRange.prototype = { a = b; this._startShape.style.x = a; } - this._fillerShae.style.x = a; - this._fillerShae.style.width = b - a; + this._fillerShape.style.x = a; + this._fillerShape.style.width = b - a; this._startMask.style.width = a - x; this._endMask.style.x = b; this._endMask.style.width = x + width - b; @@ -927,8 +1079,8 @@ DataRange.prototype = { a = b; this._startShape.style.y = a; } - this._fillerShae.style.y = a; - this._fillerShae.style.height = b - a; + this._fillerShape.style.y = a; + this._fillerShape.style.height = b - a; this._startMask.style.height = a - y; this._endMask.style.y = b; this._endMask.style.height = y + height - b; @@ -963,32 +1115,104 @@ DataRange.prototype = { this.zr.modShape(this._endShape.id); this.zr.modShape(this._startMask.id); this.zr.modShape(this._endMask.id); - this.zr.modShape(this._fillerShae.id); - this.zr.refresh(); + this.zr.modShape(this._fillerShape.id); + this.zr.refreshNextFrame(); }, - _syncData: function () { - if (this.dataRangeOption.realtime) { - this.messageCenter.dispatch( - ecConfig.EVENT.DATA_RANGE, null, { - range: { - start: this._range.end, - end: this._range.start - } - }, this.myChart); - } + _dispatchDataRange: function () { + this.messageCenter.dispatch( + ecConfig.EVENT.DATA_RANGE, null, { + range: { + start: this._range.end, + end: this._range.start + } + }, this.myChart); }, __dataRangeSelected: function (param) { + if (this.dataRangeOption.selectedMode === 'single') { + for (var k in this._selectedMap) { + this._selectedMap[k] = false; + } + } var idx = param.target._idx; this._selectedMap[idx] = !this._selectedMap[idx]; + var valueMax = (this._colorList.length - idx) * this._gap + this.dataRangeOption.min; + this.messageCenter.dispatch( + ecConfig.EVENT.DATA_RANGE_SELECTED, param.event, { + selected: this._selectedMap, + target: idx, + valueMax: valueMax, + valueMin: valueMax - this._gap + }, this.myChart); + this.messageCenter.dispatch(ecConfig.EVENT.REFRESH, null, null, this.myChart); }, + /** + * 产生hover link事件 + */ + __dispatchHoverLink: function (param) { + var valueMin; + var valueMax; + if (this.dataRangeOption.calculable) { + var totalValue = this.dataRangeOption.max - this.dataRangeOption.min; + var curValue; + if (this.dataRangeOption.orient == 'horizontal') { + curValue = (1 - (zrEvent.getX(param.event) - this._calculableLocation.x) / this._calculableLocation.width) * totalValue; + } + else { + curValue = (1 - (zrEvent.getY(param.event) - this._calculableLocation.y) / this._calculableLocation.height) * totalValue; + } + valueMin = curValue - totalValue * 0.05; + valueMax = curValue + totalValue * 0.05; + } + else { + var idx = param.target._idx; + valueMax = (this._colorList.length - idx) * this._gap + this.dataRangeOption.min; + valueMin = valueMax - this._gap; + } + + this.messageCenter.dispatch( + ecConfig.EVENT.DATA_RANGE_HOVERLINK, param.event, { + valueMin: valueMin, + valueMax: valueMax + }, this.myChart); + + // console.log(param,curValue); + return; + }, + + __onhoverlink: function (param) { + if (this.dataRangeOption.show && this.dataRangeOption.hoverLink && this._indicatorShape && param && param.seriesIndex != null && param.dataIndex != null) { + var curValue = param.value; + if (curValue === '' || isNaN(curValue)) { + return; + } + if (curValue < this.dataRangeOption.min) { + curValue = this.dataRangeOption.min; + } + else if (curValue > this.dataRangeOption.max) { + curValue = this.dataRangeOption.max; + } + + if (this.dataRangeOption.orient == 'horizontal') { + this._indicatorShape.position = [(this.dataRangeOption.max - curValue) / (this.dataRangeOption.max - this.dataRangeOption.min) * this._calculableLocation.width, 0]; + } + else { + this._indicatorShape.position = [ + 0, (this.dataRangeOption.max - curValue) / (this.dataRangeOption.max - this.dataRangeOption.min) * this._calculableLocation.height]; + } + this._indicatorShape.style.text = this._textFormat(param.value); + this._indicatorShape.style.color = this.getColor(curValue); + this.zr.addHoverShape(this._indicatorShape); + } + }, + _textFormat: function (valueStart, valueEnd) { valueStart = valueStart.toFixed(this.dataRangeOption.precision); - valueEnd = typeof valueEnd != 'undefined' ? valueEnd.toFixed(this.dataRangeOption.precision) : ''; + valueEnd = valueEnd != null ? valueEnd.toFixed(this.dataRangeOption.precision) : ''; if (this.dataRangeOption.formatter) { if (typeof this.dataRangeOption.formatter == 'string') { return this.dataRangeOption.formatter.replace('{value}', valueStart).replace('{value2}', valueEnd); @@ -1013,10 +1237,11 @@ DataRange.prototype = { if (newOption) { this.option = newOption; this.option.dataRange = this.reformOption(this.option.dataRange); - // 补全padding属性 - this.option.dataRange.padding = this.reformCssArray( - this.option.dataRange.padding); this.dataRangeOption = this.option.dataRange; + if (!this.myChart.canvasSupported) { + // 不支持Canvas的强制关闭实时动画 + this.dataRangeOption.realtime = false; + } var splitNumber = this.dataRangeOption.splitNumber <= 0 || this.dataRangeOption.calculable ? 100 : this.dataRangeOption.splitNumber; this._colorList = zrColor.getGradientColors( @@ -1062,6 +1287,10 @@ DataRange.prototype = { return null; } + if (this.dataRangeOption.min == this.dataRangeOption.max) { + return this._colorList[0]; + } + if (value < this.dataRangeOption.min) { value = this.dataRangeOption.min; } @@ -1079,6 +1308,7 @@ DataRange.prototype = { if (idx == this._colorList.length) { idx--; } + //console.log(value, idx,this._colorList[idx]) if (this._selectedMap[idx]) { return this._colorList[idx]; @@ -1086,6 +1316,24 @@ DataRange.prototype = { else { return null; } + + }, + + getColorByIndex: function (idx) { + if (idx >= this._colorList.length) { + idx = this._colorList.length - 1; + } + else if (idx < 0) { + idx = 0; + } + return this._colorList[idx]; + }, + + /** + * 释放后实例不可用 + */ + onbeforDispose: function () { + this.messageCenter.unbind(ecConfig.EVENT.HOVER, this._onhoverlink); } }; diff --git a/src/component/dataView.js b/src/component/dataView.js index 3271342..1f6c0a8 100644 --- a/src/component/dataView.js +++ b/src/component/dataView.js @@ -2,7 +2,7 @@ * echarts组件:提示框 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ @@ -35,7 +35,8 @@ function DataView(ecTheme, messageCenter, zr, option, myChart) { this._zrHeight = zr.getHeight(); this._zrWidth = zr.getWidth(); - this._tDom.className = 'echarts-dataview', this.hide(); + this._tDom.className = 'echarts-dataview'; + this.hide(); this.dom.firstChild.appendChild(this._tDom); if (window.addEventListener) { @@ -147,9 +148,7 @@ DataView.prototype = { if ((axisList[i].type || 'category') == 'category') { valueList = []; for (j = 0, k = axisList[i].data.length; j < k; j++) { - data = axisList[i].data[j]; - valueList.push( - typeof data.value != 'undefined' ? data.value : data); + valueList.push(this.getDataFromOption(axisList[i].data[j])); } content += valueList.join(', ') + '\n\n'; } @@ -166,9 +165,7 @@ DataView.prototype = { if (axisList[i].type == 'category') { valueList = []; for (j = 0, k = axisList[i].data.length; j < k; j++) { - data = axisList[i].data[j]; - valueList.push( - typeof data.value != 'undefined' ? data.value : data); + valueList.push(this.getDataFromOption(axisList[i].data[j])); } content += valueList.join(', ') + '\n\n'; } @@ -189,11 +186,9 @@ DataView.prototype = { } if (series[i].type == ecConfig.CHART_TYPE_SCATTER) { - data = typeof data.value != 'undefined' ? data.value : data; - data = data.join(', '); + data = this.getDataFromOption(data).join(', '); } - valueList.push( - itemName + (typeof data.value != 'undefined' ? data.value : data)); + valueList.push(itemName + this.getDataFromOption(data)); } content += (series[i].name || '-') + ' : \n'; content += valueList.join( diff --git a/src/component/dataZoom.js b/src/component/dataZoom.js index 01801a2..01bfe40 100644 --- a/src/component/dataZoom.js +++ b/src/component/dataZoom.js @@ -2,7 +2,7 @@ * echarts组件:数据区域缩放 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ @@ -14,6 +14,41 @@ var PolygonShape = require('../zrender/shape/Polygon.js'); var IconShape = require('../util/shape/Icon.js'); var ecConfig = require('../config.js'); +// 区域缩放控制器 +ecConfig.dataZoom = { + zlevel: 0, + // 一级层叠 + z: 4, + // 二级层叠 + show: false, + orient: 'horizontal', + // 布局方式,默认为水平布局,可选为: + // 'horizontal' ¦ 'vertical' + // x: {number}, // 水平安放位置,默认为根据grid参数适配,可选为: + // {number}(x坐标,单位px) + // y: {number}, // 垂直安放位置,默认为根据grid参数适配,可选为: + // {number}(y坐标,单位px) + // width: {number}, // 指定宽度,横向布局时默认为根据grid参数适配 + // height: {number}, // 指定高度,纵向布局时默认为根据grid参数适配 + backgroundColor: 'rgba(0,0,0,0)', + // 背景颜色 + dataBackgroundColor: '#eee', + // 数据背景颜色 + fillerColor: 'rgba(144,197,237,0.2)', + // 填充颜色 + handleColor: 'rgba(70,130,180,0.8)', + // 手柄颜色 + handleSize: 8, + showDetail: true, + // xAxisIndex: [], // 默认控制所有横向类目 + // yAxisIndex: [], // 默认控制所有横向类目 + // start: 0, // 默认为0 + // end: 100, // 默认为全部 100% + realtime: true + // zoomLock: false // 是否锁定选择区域大小 +}; + +var ecDate = require('../util/date.js'); var zrUtil = require('../zrender/tool/util.js'); /** @@ -35,8 +70,7 @@ function DataZoom(ecTheme, messageCenter, zr, option, myChart) { return self.__ondragend(); }; - this._fillerSize = 28; // 控件大小,水平布局为高,纵向布局为宽 - this._handleSize = 8; // 手柄大小 + this._fillerSize = 30; // 控件大小,水平布局为高,纵向布局为宽 // this._fillerShae; // 填充 // this._startShape; // 起始手柄 // this._endShape; // 结束手柄 @@ -49,6 +83,11 @@ function DataZoom(ecTheme, messageCenter, zr, option, myChart) { this.option.dataZoom = this.reformOption(this.option.dataZoom); this.zoomOption = this.option.dataZoom; + this._handleSize = this.zoomOption.handleSize; + if (!this.myChart.canvasSupported) { + // 不支持Canvas的强制关闭实时动画 + this.zoomOption.realtime = false; + } // 位置参数,通过计算所得x, y, width, height this._location = this._getLocation(); @@ -91,15 +130,15 @@ DataZoom.prototype = { // 水平布局 width = this.zoomOption.width || grid.getWidth(); height = this.zoomOption.height || this._fillerSize; - x = typeof this.zoomOption.x != 'undefined' ? this.zoomOption.x : grid.getX(); - y = typeof this.zoomOption.y != 'undefined' ? this.zoomOption.y : (this.zr.getHeight() - height - 2); + x = this.zoomOption.x != null ? this.zoomOption.x : grid.getX(); + y = this.zoomOption.y != null ? this.zoomOption.y : (this.zr.getHeight() - height - 2); } else { // 垂直布局 width = this.zoomOption.width || this._fillerSize; height = this.zoomOption.height || grid.getHeight(); - x = typeof this.zoomOption.x != 'undefined' ? this.zoomOption.x : 2; - y = typeof this.zoomOption.y != 'undefined' ? this.zoomOption.y : grid.getY(); + x = this.zoomOption.x != null ? this.zoomOption.x : 2; + y = this.zoomOption.y != null ? this.zoomOption.y : grid.getY(); } return { @@ -132,11 +171,11 @@ DataZoom.prototype = { var yAxisIndex; var zOptIdx = this.zoomOption.xAxisIndex; - if (xAxis && typeof zOptIdx == 'undefined') { + if (xAxis && zOptIdx == null) { xAxisIndex = []; for (var i = 0, l = xAxis.length; i < l; i++) { // 横纵默认为类目轴 - if (xAxis[i].type == 'category' || typeof xAxis[i].type == 'undefined') { + if (xAxis[i].type == 'category' || xAxis[i].type == null) { xAxisIndex.push(i); } } @@ -145,7 +184,7 @@ DataZoom.prototype = { if (zOptIdx instanceof Array) { xAxisIndex = zOptIdx; } - else if (typeof zOptIdx != 'undefined') { + else if (zOptIdx != null) { xAxisIndex = [zOptIdx]; } else { @@ -154,7 +193,7 @@ DataZoom.prototype = { } zOptIdx = this.zoomOption.yAxisIndex; - if (yAxis && typeof zOptIdx == 'undefined') { + if (yAxis && zOptIdx == null) { yAxisIndex = []; for (var i = 0, l = yAxis.length; i < l; i++) { if (yAxis[i].type == 'category') { @@ -166,7 +205,7 @@ DataZoom.prototype = { if (zOptIdx instanceof Array) { yAxisIndex = zOptIdx; } - else if (typeof zOptIdx != 'undefined') { + else if (zOptIdx != null) { yAxisIndex = [zOptIdx]; } else { @@ -175,47 +214,41 @@ DataZoom.prototype = { } // 找到缩放控制的所有series + var serie; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].type != ecConfig.CHART_TYPE_LINE && series[i].type != ecConfig.CHART_TYPE_BAR && series[i].type != ecConfig.CHART_TYPE_SCATTER && series[i].type != ecConfig.CHART_TYPE_K) { + serie = series[i]; + if (serie.type != ecConfig.CHART_TYPE_LINE && serie.type != ecConfig.CHART_TYPE_BAR && serie.type != ecConfig.CHART_TYPE_SCATTER && serie.type != ecConfig.CHART_TYPE_K) { continue; } for (var j = 0, k = xAxisIndex.length; j < k; j++) { - if (xAxisIndex[j] == (series[i].xAxisIndex || 0)) { + if (xAxisIndex[j] == (serie.xAxisIndex || 0)) { zoomSeriesIndex.push(i); break; } } for (var j = 0, k = yAxisIndex.length; j < k; j++) { - if (yAxisIndex[j] == (series[i].yAxisIndex || 0)) { + if (yAxisIndex[j] == (serie.yAxisIndex || 0)) { zoomSeriesIndex.push(i); break; } } - // 不指定接管坐标轴,则散点图被纳入接管范围 - if (series[i].type == ecConfig.CHART_TYPE_SCATTER && typeof this.zoomOption.xAxisIndex == 'undefined' && typeof this.zoomOption.yAxisIndex == 'undefined') { + // 不指定接管坐标轴,则散点图、双数值轴折线图柱形图都被纳入接管范围 + if (this.zoomOption.xAxisIndex == null && this.zoomOption.yAxisIndex == null && serie.data && this.getDataFromOption(serie.data[0]) instanceof Array && (serie.type == ecConfig.CHART_TYPE_SCATTER || serie.type == ecConfig.CHART_TYPE_LINE || serie.type == ecConfig.CHART_TYPE_BAR)) { zoomSeriesIndex.push(i); } } - var start = typeof this._zoom.start != 'undefined' ? this._zoom.start : (typeof this.zoomOption.start != 'undefined' ? this.zoomOption.start : 0); - var end = typeof this._zoom.end != 'undefined' ? this._zoom.end : (typeof this.zoomOption.end != 'undefined' ? this.zoomOption.end : 100); -/* - var start = typeof this.zoomOption.start != 'undefined' - && this.zoomOption.start >= 0 - && this.zoomOption.start <= 100 - ? this.zoomOption.start : 0; - var end = typeof this.zoomOption.end != 'undefined' - && this.zoomOption.end >= 0 - && this.zoomOption.end <= 100 - ? this.zoomOption.end : 100; - */ + var start = this._zoom.start != null ? this._zoom.start : (this.zoomOption.start != null ? this.zoomOption.start : 0); + var end = this._zoom.end != null ? this._zoom.end : (this.zoomOption.end != null ? this.zoomOption.end : 100); + if (start > end) { // 大小颠倒自动翻转 start = start + end; end = start - end; start = start - end; } - var size = Math.round((end - start) / 100 * (this.zoomOption.orient == 'horizontal' ? this._location.width : this._location.height)); + var size = Math.round((end - start) / 100 * ( + this.zoomOption.orient == 'horizontal' ? this._location.width : this._location.height)); return { start: start, end: end, @@ -253,7 +286,8 @@ DataZoom.prototype = { for (var i = 0, l = seriesIndex.length; i < l; i++) { serie = series[seriesIndex[i]]; this._originalData.series[seriesIndex[i]] = serie.data; - if (serie.type == ecConfig.CHART_TYPE_SCATTER) { + if (serie.data && this.getDataFromOption(serie.data[0]) instanceof Array && (serie.type == ecConfig.CHART_TYPE_SCATTER || serie.type == ecConfig.CHART_TYPE_LINE || serie.type == ecConfig.CHART_TYPE_BAR)) { + this._backupScale(); this._calculScatterMap(seriesIndex[i]); } } @@ -266,15 +300,15 @@ DataZoom.prototype = { // x轴极值 var Axis = componentLibrary.get('axis'); var axisOption = zrUtil.clone(this.option.xAxis); - if (axisOption instanceof Array) { + if (axisOption[0].type == 'category') { axisOption[0].type = 'value'; - axisOption[0].boundary = [0, 0]; - axisOption[1] && (axisOption[1].type = 'value', axisOption[1].boundary = [0, 0]); } - else { - axisOption.type = 'value'; - axisOption.boundary = [0, 0]; + // axisOption[0].scale = true; + // axisOption[0].boundary = [0, 0]; + if (axisOption[1] && axisOption[1].type == 'category') { + axisOption[1].type = 'value'; } + var vAxis = new Axis( this.ecTheme, null, // messageCenter false, // this.zr @@ -288,13 +322,13 @@ DataZoom.prototype = { // y轴极值 axisOption = zrUtil.clone(this.option.yAxis); - if (axisOption instanceof Array) { + if (axisOption[0].type == 'category') { axisOption[0].type = 'value'; - axisOption[1] && (axisOption[1].type = 'value', axisOption[1].boundary = [0, 0]); } - else { - axisOption.type = 'value'; - axisOption.boundary = [0, 0]; + // axisOption[0].scale = true; + // axisOption[1].boundary = [0, 0]; + if (axisOption[1] && axisOption[1].type == 'category') { + axisOption[1].type = 'value'; } vAxis = new Axis( this.ecTheme, null, // messageCenter @@ -315,7 +349,8 @@ DataZoom.prototype = { // 背景 this.shapeList.push(new RectangleShape({ - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), hoverable: false, style: { x: this._location.x, @@ -347,7 +382,7 @@ DataZoom.prototype = { var minValue = Number.MAX_VALUE; var value; for (var i = 0, l = data.length; i < l; i++) { - value = typeof data[i] != 'undefined' ? (typeof data[i].value != 'undefined' ? data[i].value : data[i]) : 0; + value = this.getDataFromOption(data[i], 0); if (this.option.series[seriesIndex].type == ecConfig.CHART_TYPE_K) { value = value[1]; // 收盘价 } @@ -371,7 +406,7 @@ DataZoom.prototype = { } for (var i = 0, l = maxLength; i < l; i += step) { - value = typeof data[i] != 'undefined' ? (typeof data[i].value != 'undefined' ? data[i].value : data[i]) : 0; + value = this.getDataFromOption(data[i], 0); if (this.option.series[seriesIndex].type == ecConfig.CHART_TYPE_K) { value = value[1]; // 收盘价 } @@ -384,7 +419,7 @@ DataZoom.prototype = { } else { pointList.push([ - this._location.x + 1 + Math.round((value - minValue) / valueRange * (width - 10)), this._location.y + y * i]); + this._location.x + 1 + Math.round((value - minValue) / valueRange * (width - 10)), this._location.y + y * (l - i - 1)]); } } if (this.zoomOption.orient == 'horizontal') { @@ -394,14 +429,15 @@ DataZoom.prototype = { this._location.x, this._location.y + height]); } else { - pointList.push([ - this._location.x, this._location.y + height]); pointList.push([ this._location.x, this._location.y]); + pointList.push([ + this._location.x, this._location.y + height]); } this.shapeList.push(new PolygonShape({ - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), style: { pointList: pointList, color: this.zoomOption.dataBackgroundColor @@ -415,7 +451,8 @@ DataZoom.prototype = { */ _buildFiller: function () { this._fillerShae = { - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), draggable: true, ondrift: this._ondrift, ondragend: this._ondragend, @@ -468,8 +505,13 @@ DataZoom.prototype = { * 构建拖拽手柄 */ _buildHandle: function () { + var detail = this.zoomOption.showDetail ? this._getDetail() : { + start: '', + end: '' + }; this._startShape = { - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), draggable: true, style: { iconType: 'rectangle', @@ -482,7 +524,9 @@ DataZoom.prototype = { textPosition: 'inside' }, highlightStyle: { - brushType: 'fill' + text: detail.start, + brushType: 'fill', + textPosition: 'left' }, ondrift: this._ondrift, ondragend: this._ondragend @@ -493,13 +537,19 @@ DataZoom.prototype = { this._endShape = zrUtil.clone(this._startShape); this._startShape.style.x = this._fillerShae.style.x - this._handleSize, this._endShape.style.x = this._fillerShae.style.x + this._fillerShae.style.width; + this._endShape.highlightStyle.text = detail.end; + this._endShape.highlightStyle.textPosition = 'right'; } else { this._startShape.style.width = this._location.width; this._endShape = zrUtil.clone(this._startShape); - this._startShape.style.y = this._fillerShae.style.y - this._handleSize; - this._endShape.style.y = this._fillerShae.style.y + this._fillerShae.style.height; + this._startShape.style.y = this._fillerShae.style.y + this._fillerShae.style.height; + this._startShape.highlightStyle.textPosition = 'bottom'; + + this._endShape.style.y = this._fillerShae.style.y - this._handleSize; + this._endShape.highlightStyle.text = detail.end; + this._endShape.highlightStyle.textPosition = 'top'; } this._startShape = new IconShape(this._startShape); this._endShape = new IconShape(this._endShape); @@ -515,7 +565,8 @@ DataZoom.prototype = { var x = this.subPixelOptimize(this._location.x, 1); var y = this.subPixelOptimize(this._location.y, 1); this._startFrameShape = { - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), hoverable: false, style: { x: x, @@ -541,23 +592,27 @@ DataZoom.prototype = { this._startShape.style.x = this._fillerShae.style.x - this._handleSize; this._endShape.style.x = this._fillerShae.style.x + this._fillerShae.style.width; - this._zoom.start = Math.floor((this._startShape.style.x - this._location.x) / this._location.width * 100); - this._zoom.end = Math.ceil((this._endShape.style.x + this._handleSize - this._location.x) / this._location.width * 100); + this._zoom.start = ( + this._startShape.style.x - this._location.x) / this._location.width * 100; + this._zoom.end = ( + this._endShape.style.x + this._handleSize - this._location.x) / this._location.width * 100; } else { - this._startShape.style.y = this._fillerShae.style.y - this._handleSize; - this._endShape.style.y = this._fillerShae.style.y + this._fillerShae.style.height; - this._zoom.start = Math.floor((this._startShape.style.y - this._location.y) / this._location.height * 100); - this._zoom.end = Math.ceil((this._endShape.style.y + this._handleSize - this._location.y) / this._location.height * 100); - } + this._startShape.style.y = this._fillerShae.style.y + this._fillerShae.style.height; + this._endShape.style.y = this._fillerShae.style.y - this._handleSize; + this._zoom.start = ( + this._location.y + this._location.height - this._startShape.style.y) / this._location.height * 100; + this._zoom.end = ( + this._location.y + this._location.height - this._endShape.style.y - this._handleSize) / this._location.height * 100; + } this.zr.modShape(this._startShape.id); this.zr.modShape(this._endShape.id); // 同步边框 this._syncFrameShape(); - this.zr.refresh(); + this.zr.refreshNextFrame(); }, _syncFillerShape: function () { @@ -568,16 +623,20 @@ DataZoom.prototype = { b = this._endShape.style.x; this._fillerShae.style.x = Math.min(a, b) + this._handleSize; this._fillerShae.style.width = Math.abs(a - b) - this._handleSize; - this._zoom.start = Math.floor((Math.min(a, b) - this._location.x) / this._location.width * 100); - this._zoom.end = Math.ceil((Math.max(a, b) + this._handleSize - this._location.x) / this._location.width * 100); + this._zoom.start = ( + Math.min(a, b) - this._location.x) / this._location.width * 100; + this._zoom.end = ( + Math.max(a, b) + this._handleSize - this._location.x) / this._location.width * 100; } else { a = this._startShape.style.y; b = this._endShape.style.y; this._fillerShae.style.y = Math.min(a, b) + this._handleSize; this._fillerShae.style.height = Math.abs(a - b) - this._handleSize; - this._zoom.start = Math.floor((Math.min(a, b) - this._location.y) / this._location.height * 100); - this._zoom.end = Math.ceil((Math.max(a, b) + this._handleSize - this._location.y) / this._location.height * 100); + this._zoom.start = ( + this._location.y + this._location.height - Math.max(a, b)) / this._location.height * 100; + this._zoom.end = ( + this._location.y + this._location.height - Math.min(a, b) - this._handleSize) / this._location.height * 100; } this.zr.modShape(this._fillerShae.id); @@ -585,7 +644,7 @@ DataZoom.prototype = { // 同步边框 this._syncFrameShape(); - this.zr.refresh(); + this.zr.refreshNextFrame(); }, _syncFrameShape: function () { @@ -598,12 +657,12 @@ DataZoom.prototype = { this._location.x + this._location.width - this._endFrameShape.style.x; } else { - this._startFrameShape.style.height = - this._fillerShae.style.y - this._location.y; - this._endFrameShape.style.y = + this._startFrameShape.style.y = this._fillerShae.style.y + this._fillerShae.style.height; + this._startFrameShape.style.height = + this._location.y + this._location.height - this._startFrameShape.style.y; this._endFrameShape.style.height = - this._location.y + this._location.height - this._endFrameShape.style.y; + this._fillerShae.style.y - this._location.y; } this.zr.modShape(this._startFrameShape.id); @@ -623,11 +682,11 @@ DataZoom.prototype = { this._fillerShae.style.width = this._endShape.style.x - this._startShape.style.x - this._handleSize; } else { - this._startShape.style.y = this._location.y + this._zoom.start / 100 * this._location.height; - this._endShape.style.y = this._location.y + this._zoom.end / 100 * this._location.height - this._handleSize; + this._startShape.style.y = this._location.y + this._location.height - this._zoom.start / 100 * this._location.height; + this._endShape.style.y = this._location.y + this._location.height - this._zoom.end / 100 * this._location.height - this._handleSize; - this._fillerShae.style.y = this._startShape.style.y + this._handleSize; - this._fillerShae.style.height = this._endShape.style.y - this._startShape.style.y - this._handleSize; + this._fillerShae.style.y = this._endShape.style.y + this._handleSize; + this._fillerShae.style.height = this._startShape.style.y - this._endShape.style.y - this._handleSize; } this.zr.modShape(this._startShape.id); @@ -649,17 +708,18 @@ DataZoom.prototype = { target = this._originalData[key]; for (var idx in target) { data = target[idx]; - if (typeof data == 'undefined') { + if (data == null) { continue; } length = data.length; start = Math.floor(this._zoom.start / 100 * length); end = Math.ceil(this._zoom.end / 100 * length); - if (this.option[key][idx].type != ecConfig.CHART_TYPE_SCATTER) { + if (!(this.getDataFromOption(data[0]) instanceof Array) || this.option[key][idx].type == ecConfig.CHART_TYPE_K) { this.option[key][idx].data = data.slice(start, end); } else { - // 散点图特殊处理 + // 散点图,双数值轴折线图柱形图特殊处理 + this._setScale(); this.option[key][idx].data = this._synScatterData(idx, data); } } @@ -715,9 +775,91 @@ DataZoom.prototype = { newData.push(data[i]); } } - return newData; }, + + /** + * 发生缩放后修改axis的scale + */ + _setScale: function () { + var needScale = this._zoom.start !== 0 || this._zoom.end !== 100 || this._zoom.start2 !== 0 || this._zoom.end2 !== 100; + var axis = { + xAxis: this.option.xAxis, + yAxis: this.option.yAxis + }; + for (var key in axis) { + for (var i = 0, l = axis[key].length; i < l; i++) { + axis[key][i].scale = needScale || axis[key][i]._scale; + } + } + }, + + /** + * 备份可能存在的scale设置 + */ + _backupScale: function () { + var axis = { + xAxis: this.option.xAxis, + yAxis: this.option.yAxis + }; + for (var key in axis) { + for (var i = 0, l = axis[key].length; i < l; i++) { + axis[key][i]._scale = axis[key][i].scale; + } + } + }, + + /** + * 获取当前定位 + */ + _getDetail: function () { + var key = this.zoomOption.orient == 'horizontal' ? 'xAxis' : 'yAxis'; + var target = this._originalData[key]; + for (var idx in target) { + var data = target[idx]; + if (data == null) { + continue; + } + var length = data.length; + var start = Math.floor(this._zoom.start / 100 * length); + var end = Math.ceil(this._zoom.end / 100 * length); + end -= end > 0 ? 1 : 0; + return { + start: this.getDataFromOption(data[start]), + end: this.getDataFromOption(data[end]) + }; + } + + var seriesIndex = this._zoom.seriesIndex[0]; + var axisIndex = this.option.series[seriesIndex][key + 'Index'] || 0; + var axisType = this.option[key][axisIndex].type; + var min = this._zoom.scatterMap[seriesIndex][key.charAt(0)].min; + var max = this._zoom.scatterMap[seriesIndex][key.charAt(0)].max; + var gap = max - min; + + if (axisType == 'value') { + return { + start: min + gap * this._zoom.start / 100, + end: min + gap * this._zoom.end / 100 + }; + } + else if (axisType == 'time') { + // 最优解 + max = min + gap * this._zoom.end / 100; + min = min + gap * this._zoom.start / 100; + var formatter = ecDate.getAutoFormatter(min, max).formatter; + return { + start: ecDate.format(formatter, min), + end: ecDate.format(formatter, max) + }; + } + + return { + start: '', + end: '' + }; + }, + /** * 拖拽范围控制 */ @@ -762,10 +904,24 @@ DataZoom.prototype = { this._syncData(); } + if (this.zoomOption.showDetail) { + var detail = this._getDetail(); + this._startShape.style.text = this._startShape.highlightStyle.text = detail.start; + this._endShape.style.text = this._endShape.highlightStyle.text = detail.end; + this._startShape.style.textPosition = this._startShape.highlightStyle.textPosition; + this._endShape.style.textPosition = this._endShape.highlightStyle.textPosition; + } return true; }, __ondragend: function () { + if (this.zoomOption.showDetail) { + this._startShape.style.text = this._endShape.style.text = '='; + this._startShape.style.textPosition = this._endShape.style.textPosition = 'inside'; + this.zr.modShape(this._startShape.id); + this.zr.modShape(this._endShape.id); + this.zr.refreshNextFrame(); + } this.isDragend = true; }, @@ -802,13 +958,9 @@ DataZoom.prototype = { }, absoluteZoom: function (param) { - //this.zoomOption.start = this._zoom.start = param.start; - //this.zoomOption.end = this._zoom.end = param.end; - //this.zoomOption.start2 = this._zoom.start2 = param.start2; - //this.zoomOption.end2 = this._zoom.end2 = param.end2; this._syncShape(); this._syncData(true); @@ -820,13 +972,11 @@ DataZoom.prototype = { // 重置拖拽 //this.zoomOption.start = //this.zoomOption.start2 = - this._zoom.start = - this._zoom.start2 = 0; + this._zoom.start = this._zoom.start2 = 0; //this.zoomOption.end = //this.zoomOption.end2 = - this._zoom.end = - this._zoom.end2 = 100; + this._zoom.end = this._zoom.end2 = 100; this._syncShape(); this._syncData(true); @@ -871,7 +1021,7 @@ DataZoom.prototype = { var edx = 1 - (rect.x + rect.width - gridArea.x) / gridArea.width; var sdy = 1 - (rect.y + rect.height - gridArea.y) / gridArea.height; var edy = (rect.y - gridArea.y) / gridArea.height; - //console.log('this',sdy,edy,this._zoom.start,this._zoom.end) + // console.log('this',sdy,edy,this._zoom.start,this._zoom.end) if (this.zoomOption.orient == 'horizontal') { total = this._zoom.end - this._zoom.start; this._zoom.start += total * sdx; @@ -907,7 +1057,7 @@ DataZoom.prototype = { var curSeries = curOption.series; var curData; for (var i = 0, l = curSeries.length; i < l; i++) { - curData = curSeries[i].data; + curData = curSeries[i].data || curSeries[i].eventList; if (target[i]) { // dataZoom接管的 start = Math.floor(this._zoom.start / 100 * target[i].length); @@ -929,6 +1079,12 @@ DataZoom.prototype = { syncOption: function (magicOption) { this.silence(true); this.option = magicOption; + this.option.dataZoom = this.reformOption(this.option.dataZoom); + this.zoomOption = this.option.dataZoom; + if (!this.myChart.canvasSupported) { + // 不支持Canvas的强制关闭实时动画 + this.zoomOption.realtime = false; + } this.clear(); // 位置参数,通过计算所得x, y, width, height diff --git a/src/component/grid.js b/src/component/grid.js index 7dc2ec0..7c90fd8 100644 --- a/src/component/grid.js +++ b/src/component/grid.js @@ -2,7 +2,7 @@ * echarts组件: 网格 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ @@ -12,6 +12,23 @@ var Base = require('./base.js'); var RectangleShape = require('../zrender/shape/Rectangle.js'); var ecConfig = require('../config.js'); +// 网格 +ecConfig.grid = { + zlevel: 0, + // 一级层叠 + z: 0, + // 二级层叠 + x: 80, + y: 60, + x2: 80, + y2: 60, + // width: {totalWidth} - x - x2, + // height: {totalHeight} - y - y2, + backgroundColor: 'rgba(0,0,0,0)', + borderWidth: 1, + borderColor: '#ccc' +}; + var zrUtil = require('../zrender/tool/util.js'); /** @@ -67,13 +84,18 @@ Grid.prototype = { }; }, + getBbox: function () { + return [[this._x, this._y], [this.getXend(), this.getYend()]]; + }, + /** * 实在找不到合适的地方做了,各种粗暴的写法~ -_- */ refixAxisShape: function (component) { var zeroX; var zeroY; - var axisList = component.xAxis._axisList.concat(component.yAxis._axisList); + var axisList = component.xAxis._axisList.concat( + component.yAxis ? component.yAxis._axisList : []); var len = axisList.length; var axis; while (len--) { @@ -111,6 +133,7 @@ Grid.prototype = { else { this._width = this.parsePercent(gridOption.width, this._zrWidth); } + this._width = this._width <= 0 ? 10 : this._width; if (typeof gridOption.height == 'undefined') { this._height = this._zrHeight - this._y - y2; @@ -118,12 +141,14 @@ Grid.prototype = { else { this._height = this.parsePercent(gridOption.height, this._zrHeight); } + this._height = this._height <= 0 ? 10 : this._height; this._x = this.subPixelOptimize(this._x, gridOption.borderWidth); this._y = this.subPixelOptimize(this._y, gridOption.borderWidth); this.shapeList.push(new RectangleShape({ - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), hoverable: false, style: { x: this._x, @@ -134,7 +159,7 @@ Grid.prototype = { color: gridOption.backgroundColor, strokeColor: gridOption.borderColor, lineWidth: gridOption.borderWidth - // type : this.option.splitArea.areaStyle.type, + // type: this.option.splitArea.areaStyle.type, } })); this.zr.addShape(this.shapeList[0]); diff --git a/src/component/legend.js b/src/component/legend.js index 18e8220..b2be44d 100644 --- a/src/component/legend.js +++ b/src/component/legend.js @@ -2,7 +2,7 @@ * echarts组件:图例 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ @@ -17,6 +17,47 @@ var IconShape = require('../util/shape/Icon.js'); var CandleShape = require('../util/shape/Candle.js'); var ecConfig = require('../config.js'); +// 图例 +ecConfig.legend = { + zlevel: 0, + // 一级层叠 + z: 4, + // 二级层叠 + show: true, + orient: 'horizontal', + // 布局方式,默认为水平布局,可选为: + // 'horizontal' ¦ 'vertical' + x: 'center', + // 水平安放位置,默认为全图居中,可选为: + // 'center' ¦ 'left' ¦ 'right' + // ¦ {number}(x坐标,单位px) + y: 'top', + // 垂直安放位置,默认为全图顶端,可选为: + // 'top' ¦ 'bottom' ¦ 'center' + // ¦ {number}(y坐标,单位px) + backgroundColor: 'rgba(0,0,0,0)', + borderColor: '#ccc', + // 图例边框颜色 + borderWidth: 0, + // 图例边框线宽,单位px,默认为0(无边框) + padding: 5, + // 图例内边距,单位px,默认各方向内边距为5, + // 接受数组分别设定上右下左边距,同css + itemGap: 10, + // 各个item之间的间隔,单位px,默认为10, + // 横向布局时为水平间隔,纵向布局时为纵向间隔 + itemWidth: 20, + // 图例图形宽度 + itemHeight: 14, + // 图例图形高度 + textStyle: { + color: '#333' // 图例文字颜色 + }, + selectedMode: true // 选择模式,默认开启图例开关 + // selected: null, // 配置默认选中状态,可配合LEGEND.SELECTED事件做动态数据载入 + // data: [], // 图例内容(详见legend.data,数组中每一项代表一个item +}; + var zrUtil = require('../zrender/tool/util.js'); var zrArea = require('../zrender/tool/area.js'); @@ -39,10 +80,14 @@ function Legend(ecTheme, messageCenter, zr, option, myChart) { self._legendSelected = function (param) { self.__legendSelected(param); }; + self._dispatchHoverLink = function (param) { + return self.__dispatchHoverLink(param); + }; this._colorIndex = 0; this._colorMap = {}; this._selectedMap = {}; + this._hasDataMap = {}; this.refresh(option); } @@ -50,6 +95,9 @@ function Legend(ecTheme, messageCenter, zr, option, myChart) { Legend.prototype = { type: ecConfig.COMPONENT_TYPE_LEGEND, _buildShape: function () { + if (!this.legendOption.show) { + return; + } // 图例元素组的位置参数,通过计算所得x, y, width, height this._itemGroupLocation = this._getItemGroupLocation(); @@ -85,7 +133,7 @@ Legend.prototype = { var itemGap = this.legendOption.itemGap; var color; - if (this.legendOption.orient == 'vertical' && this.legendOption.x == 'right') { + if (this.legendOption.orient === 'vertical' && this.legendOption.x === 'right') { lastX = this._itemGroupLocation.x + this._itemGroupLocation.width - itemWidth; } @@ -96,13 +144,13 @@ Legend.prototype = { itemName = this._getName(data[i]); formattedName = this._getFormatterName(itemName); - if (itemName === '') { - if (this.legendOption.orient == 'horizontal') { + if (itemName === '') { // 别帮我代码优化 + if (this.legendOption.orient === 'horizontal') { lastX = this._itemGroupLocation.x; lastY += itemHeight + itemGap; } else { - this.legendOption.x == 'right' ? lastX -= this._itemGroupLocation.maxWidth + itemGap : lastX += this._itemGroupLocation.maxWidth + itemGap; + this.legendOption.x === 'right' ? lastX -= this._itemGroupLocation.maxWidth + itemGap : lastX += this._itemGroupLocation.maxWidth + itemGap; lastY = this._itemGroupLocation.y; } continue; @@ -111,11 +159,11 @@ Legend.prototype = { color = this.getColor(itemName); - if (this.legendOption.orient == 'horizontal') { + if (this.legendOption.orient === 'horizontal') { if (zrWidth - lastX < 200 // 最后200px做分行预判 && (itemWidth + 5 + zrArea.getTextWidth(formattedName, dataFont) // 分行的最后一个不用算itemGap - + (i == dataLength - 1 || data[i + 1] === '' ? 0 : itemGap)) >= zrWidth - lastX) { + + (i === dataLength - 1 || data[i + 1] === '' ? 0 : itemGap)) >= zrWidth - lastX) { lastX = this._itemGroupLocation.x; lastY += itemHeight + itemGap; } @@ -124,22 +172,23 @@ Legend.prototype = { if (zrHeight - lastY < 200 // 最后200px做分行预判 && (itemHeight // 分行的最后一个不用算itemGap - + (i == dataLength - 1 || data[i + 1] === '' ? 0 : itemGap)) >= zrHeight - lastY) { - this.legendOption.x == 'right' ? lastX -= this._itemGroupLocation.maxWidth + itemGap : lastX += this._itemGroupLocation.maxWidth + itemGap; + + (i === dataLength - 1 || data[i + 1] === '' ? 0 : itemGap)) >= zrHeight - lastY) { + this.legendOption.x === 'right' ? lastX -= this._itemGroupLocation.maxWidth + itemGap : lastX += this._itemGroupLocation.maxWidth + itemGap; lastY = this._itemGroupLocation.y; } } // 图形 itemShape = this._getItemShapeByType( - lastX, lastY, itemWidth, itemHeight, (this._selectedMap[itemName] ? color : '#ccc'), itemType, color); + lastX, lastY, itemWidth, itemHeight, (this._selectedMap[itemName] && this._hasDataMap[itemName] ? color : '#ccc'), itemType, color); itemShape._name = itemName; itemShape = new IconShape(itemShape); // 文字 textShape = { - // shape : 'text', - zlevel: this._zlevelBase, + // shape: 'text', + zlevel: this.getZlevelBase(), + z: this.getZBase(), style: { x: lastX + itemWidth + 5, y: lastY + itemHeight / 2, @@ -156,7 +205,7 @@ Legend.prototype = { clickable: !! this.legendOption.selectedMode }; - if (this.legendOption.orient == 'vertical' && this.legendOption.x == 'right') { + if (this.legendOption.orient === 'vertical' && this.legendOption.x === 'right') { textShape.style.x -= (itemWidth + 10); textShape.style.textAlign = 'right'; } @@ -166,14 +215,14 @@ Legend.prototype = { if (this.legendOption.selectedMode) { itemShape.onclick = textShape.onclick = this._legendSelected; - itemShape.onmouseover = textShape.onmouseover = this.hoverConnect; + itemShape.onmouseover = textShape.onmouseover = this._dispatchHoverLink; itemShape.hoverConnect = textShape.id; textShape.hoverConnect = itemShape.id; } this.shapeList.push(itemShape); this.shapeList.push(textShape); - if (this.legendOption.orient == 'horizontal') { + if (this.legendOption.orient === 'horizontal') { lastX += itemWidth + 5 + zrArea.getTextWidth(formattedName, dataFont) + itemGap; } else { @@ -181,7 +230,7 @@ Legend.prototype = { } } - if (this.legendOption.orient == 'horizontal' && this.legendOption.x == 'center' && lastY != this._itemGroupLocation.y) { + if (this.legendOption.orient === 'horizontal' && this.legendOption.x === 'center' && lastY != this._itemGroupLocation.y) { // 多行橫排居中优化 this._mLineOptimize(); } @@ -194,10 +243,10 @@ Legend.prototype = { _getFormatterName: function (itemName) { var formatter = this.legendOption.formatter; var formattedName; - if (typeof formatter == 'function') { + if (typeof formatter === 'function') { formattedName = formatter.call(this.myChart, itemName); } - else if (typeof formatter == 'string') { + else if (typeof formatter === 'string') { formattedName = formatter.replace('{name}', itemName); } else { @@ -216,13 +265,13 @@ Legend.prototype = { var lineOffsetArray = []; // 每行宽度 var lastX = this._itemGroupLocation.x; for (var i = 2, l = this.shapeList.length; i < l; i++) { - if (this.shapeList[i].style.x == lastX) { + if (this.shapeList[i].style.x === lastX) { lineOffsetArray.push(( this._itemGroupLocation.width - ( this.shapeList[i - 1].style.x + zrArea.getTextWidth( this.shapeList[i - 1].style.text, this.shapeList[i - 1].style.textFont) - lastX)) / 2); } - else if (i == l - 1) { + else if (i === l - 1) { lineOffsetArray.push(( this._itemGroupLocation.width - ( this.shapeList[i].style.x + zrArea.getTextWidth( @@ -231,7 +280,7 @@ Legend.prototype = { } var curLineIndex = -1; for (var i = 1, l = this.shapeList.length; i < l; i++) { - if (this.shapeList[i].style.x == lastX) { + if (this.shapeList[i].style.x === lastX) { curLineIndex++; } if (lineOffsetArray[curLineIndex] === 0) { @@ -244,19 +293,17 @@ Legend.prototype = { }, _buildBackground: function () { - var pTop = this.legendOption.padding[0]; - var pRight = this.legendOption.padding[1]; - var pBottom = this.legendOption.padding[2]; - var pLeft = this.legendOption.padding[3]; + var padding = this.reformCssArray(this.legendOption.padding); this.shapeList.push(new RectangleShape({ - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), hoverable: false, style: { - x: this._itemGroupLocation.x - pLeft, - y: this._itemGroupLocation.y - pTop, - width: this._itemGroupLocation.width + pLeft + pRight, - height: this._itemGroupLocation.height + pTop + pBottom, + x: this._itemGroupLocation.x - padding[3], + y: this._itemGroupLocation.y - padding[0], + width: this._itemGroupLocation.width + padding[3] + padding[1], + height: this._itemGroupLocation.height + padding[0] + padding[2], brushType: this.legendOption.borderWidth === 0 ? 'fill' : 'both', color: this.legendOption.backgroundColor, strokeColor: this.legendOption.borderColor, @@ -278,40 +325,37 @@ Legend.prototype = { var font = this.getFont(textStyle); var totalWidth = 0; var totalHeight = 0; - var padding = this.legendOption.padding; + var padding = this.reformCssArray(this.legendOption.padding); var zrWidth = this.zr.getWidth() - padding[1] - padding[3]; var zrHeight = this.zr.getHeight() - padding[0] - padding[2]; var temp = 0; // 宽高计算,用于多行判断 var maxWidth = 0; // 垂直布局有用 - if (this.legendOption.orient == 'horizontal') { + if (this.legendOption.orient === 'horizontal') { // 水平布局,计算总宽度 totalHeight = itemHeight; for (var i = 0; i < dataLength; i++) { if (this._getName(data[i]) === '') { temp -= itemGap; - if (temp > zrWidth) { - totalWidth = zrWidth; - totalHeight += itemHeight + itemGap; - } - else { - totalWidth = Math.max(totalWidth, temp); - } + totalWidth = Math.max(totalWidth, temp); totalHeight += itemHeight + itemGap; temp = 0; continue; } - temp += itemWidth + zrArea.getTextWidth( + var tempTextWidth = zrArea.getTextWidth( this._getFormatterNameFromData(data[i]), data[i].textStyle ? this.getFont(zrUtil.merge( - data[i].textStyle || {}, textStyle)) : font) + itemGap; - } - totalHeight = Math.max(totalHeight, itemHeight); - temp -= itemGap; // 减去最后一个的itemGap - if (temp > zrWidth) { - totalWidth = zrWidth; - totalHeight += itemHeight + itemGap; - } else { - totalWidth = Math.max(totalWidth, temp); + data[i].textStyle || {}, textStyle)) : font); + if (temp + itemWidth + tempTextWidth + itemGap > zrWidth) { + // new line + temp -= itemGap; // 减去最后一个的itemGap + totalWidth = Math.max(totalWidth, temp); + totalHeight += itemHeight + itemGap; + temp = 0; + } + else { + temp += itemWidth + tempTextWidth + itemGap; + totalWidth = Math.max(totalWidth, temp - itemGap); + } } } else { @@ -326,27 +370,23 @@ Legend.prototype = { totalWidth = maxWidth; for (var i = 0; i < dataLength; i++) { if (this._getName(data[i]) === '') { - temp -= itemGap; - if (temp > zrHeight) { - totalHeight = zrHeight; - totalWidth += maxWidth + itemGap; - } - else { - totalHeight = Math.max(totalHeight, temp); - } totalWidth += maxWidth + itemGap; + temp -= itemGap; // 减去最后一个的itemGap + totalHeight = Math.max(totalHeight, temp); temp = 0; continue; } - temp += itemHeight + itemGap; - } - totalWidth = Math.max(totalWidth, maxWidth); - temp -= itemGap; // 减去最后一个的itemGap - if (temp > zrHeight) { - totalHeight = zrHeight; - totalWidth += maxWidth + itemGap; - } else { - totalHeight = Math.max(totalHeight, temp); + if (temp + itemHeight + itemGap > zrHeight) { + // new line + totalWidth += maxWidth + itemGap; + temp -= itemGap; // 减去最后一个的itemGap + totalHeight = Math.max(totalHeight, temp); + temp = 0; + } + else { + temp += itemHeight + itemGap; + totalHeight = Math.max(totalHeight, temp - itemGap); + } } } @@ -358,10 +398,10 @@ Legend.prototype = { x = Math.floor((zrWidth - totalWidth) / 2); break; case 'left': - x = this.legendOption.padding[3] + this.legendOption.borderWidth; + x = padding[3] + this.legendOption.borderWidth; break; case 'right': - x = zrWidth - totalWidth - this.legendOption.padding[1] - this.legendOption.padding[3] - this.legendOption.borderWidth * 2; + x = zrWidth - totalWidth - padding[1] - padding[3] - this.legendOption.borderWidth * 2; break; default: x = this.parsePercent(this.legendOption.x, zrWidth); @@ -371,10 +411,10 @@ Legend.prototype = { var y; switch (this.legendOption.y) { case 'top': - y = this.legendOption.padding[0] + this.legendOption.borderWidth; + y = padding[0] + this.legendOption.borderWidth; break; case 'bottom': - y = zrHeight - totalHeight - this.legendOption.padding[0] - this.legendOption.padding[2] - this.legendOption.borderWidth * 2; + y = zrHeight - totalHeight - padding[0] - padding[2] - this.legendOption.borderWidth * 2; break; case 'center': y = Math.floor((zrHeight - totalHeight) / 2); @@ -400,7 +440,7 @@ Legend.prototype = { var series = this.option.series; var data; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].name == name) { + if (series[i].name === name) { // 系列名称优先 return { type: series[i].type, @@ -412,11 +452,11 @@ Legend.prototype = { } if ( - series[i].type == ecConfig.CHART_TYPE_PIE || series[i].type == ecConfig.CHART_TYPE_RADAR || series[i].type == ecConfig.CHART_TYPE_CHORD || series[i].type == ecConfig.CHART_TYPE_FORCE || series[i].type == ecConfig.CHART_TYPE_FUNNEL) { - data = series[i].type != ecConfig.CHART_TYPE_FORCE ? series[i].data // 饼图、雷达图、和弦图得查找里面的数据名字 - : series[i].categories; // 力导布局查找categories配置 + series[i].type === ecConfig.CHART_TYPE_PIE || series[i].type === ecConfig.CHART_TYPE_RADAR || series[i].type === ecConfig.CHART_TYPE_CHORD || series[i].type === ecConfig.CHART_TYPE_FORCE || series[i].type === ecConfig.CHART_TYPE_FUNNEL) { + data = series[i].categories || series[i].data || series[i].nodes; + for (var j = 0, k = data.length; j < k; j++) { - if (data[j].name == name) { + if (data[j].name === name) { return { type: series[i].type, series: series[i], @@ -440,7 +480,8 @@ Legend.prototype = { _getItemShapeByType: function (x, y, width, height, color, itemType, defaultColor) { var highlightColor = color === '#ccc' ? defaultColor : color; var itemShape = { - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), style: { iconType: 'legendicon' + itemType, x: x, @@ -480,8 +521,9 @@ Legend.prototype = { itemShape.style.brushType = 'both'; itemShape.highlightStyle.lineWidth = 3; itemShape.highlightStyle.color = - itemShape.style.color = this.query(this.ecTheme, 'k.itemStyle.normal.color') || '#fff'; - itemShape.style.strokeColor = color != '#ccc' ? (this.query(this.ecTheme, 'k.itemStyle.normal.lineStyle.color') || '#ff3200') : color; + itemShape.style.color = this.deepQuery([this.ecTheme, ecConfig], 'k.itemStyle.normal.color') || '#fff'; + itemShape.style.strokeColor = color != '#ccc' ? ( + this.deepQuery([this.ecTheme, ecConfig], 'k.itemStyle.normal.lineStyle.color') || '#ff3200') : color; break; case 'image': itemShape.style.iconType = 'image'; @@ -509,6 +551,17 @@ Legend.prototype = { }, this.myChart); }, + /** + * 产生hover link事件 + */ + __dispatchHoverLink: function (param) { + this.messageCenter.dispatch( + ecConfig.EVENT.LEGEND_HOVERLINK, param.event, { + target: param.target._name + }, this.myChart); + return; + }, + /** * 刷新 */ @@ -516,9 +569,6 @@ Legend.prototype = { if (newOption) { this.option = newOption || this.option; this.option.legend = this.reformOption(this.option.legend); - // 补全padding属性 - this.option.legend.padding = this.reformCssArray( - this.option.legend.padding); this.legendOption = this.option.legend; var data = this.legendOption.data || []; @@ -538,10 +588,11 @@ Legend.prototype = { } something = this._getSomethingByName(itemName); if (!something.series) { - this._selectedMap[itemName] = false; + this._hasDataMap[itemName] = false; } else { - if (something.data && (something.type == ecConfig.CHART_TYPE_PIE || something.type == ecConfig.CHART_TYPE_FORCE || something.type == ecConfig.CHART_TYPE_FUNNEL)) { + this._hasDataMap[itemName] = true; + if (something.data && (something.type === ecConfig.CHART_TYPE_PIE || something.type === ecConfig.CHART_TYPE_FORCE || something.type === ecConfig.CHART_TYPE_FUNNEL)) { queryTarget = [something.data, something.series]; } else { @@ -554,7 +605,7 @@ Legend.prototype = { this.setColor(itemName, color); } this._selectedMap[itemName] = - typeof this._selectedMap[itemName] != 'undefined' ? this._selectedMap[itemName] : true; + this._selectedMap[itemName] != null ? this._selectedMap[itemName] : true; } } } @@ -567,17 +618,17 @@ Legend.prototype = { var series = this.option.series; var data; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].name == name) { + if (series[i].name === name) { // 系列名称优先 amount++; } if ( - series[i].type == ecConfig.CHART_TYPE_PIE || series[i].type == ecConfig.CHART_TYPE_RADAR || series[i].type == ecConfig.CHART_TYPE_CHORD || series[i].type == ecConfig.CHART_TYPE_FORCE || series[i].type == ecConfig.CHART_TYPE_FUNNEL) { + series[i].type === ecConfig.CHART_TYPE_PIE || series[i].type === ecConfig.CHART_TYPE_RADAR || series[i].type === ecConfig.CHART_TYPE_CHORD || series[i].type === ecConfig.CHART_TYPE_FORCE || series[i].type === ecConfig.CHART_TYPE_FUNNEL) { data = series[i].type != ecConfig.CHART_TYPE_FORCE ? series[i].data // 饼图、雷达图、和弦图得查找里面的数据名字 : series[i].categories; // 力导布局查找categories配置 for (var j = 0, k = data.length; j < k; j++) { - if (data[j].name == name && data[j].value != '-') { + if (data[j].name === name && data[j].value != '-') { amount++; } } @@ -604,7 +655,7 @@ Legend.prototype = { add: function (name, color) { var data = this.legendOption.data; for (var i = 0, dataLength = data.length; i < dataLength; i++) { - if (this._getName(data[i]) == name) { + if (this._getName(data[i]) === name) { // 已有就不重复加了 return; } @@ -612,12 +663,13 @@ Legend.prototype = { this.legendOption.data.push(name); this.setColor(name, color); this._selectedMap[name] = true; + this._hasDataMap[name] = true; }, del: function (name) { var data = this.legendOption.data; for (var i = 0, dataLength = data.length; i < dataLength; i++) { - if (this._getName(data[i]) == name) { + if (this._getName(data[i]) === name) { return this.legendOption.data.splice(i, 1); } } @@ -629,13 +681,13 @@ Legend.prototype = { * @param {Object} itemShape */ getItemShape: function (name) { - if (typeof name == 'undefined') { + if (name == null) { return; } var shape; for (var i = 0, l = this.shapeList.length; i < l; i++) { shape = this.shapeList[i]; - if (shape._name == name && shape.type != 'text') { + if (shape._name === name && shape.type != 'text') { return shape; } } @@ -650,7 +702,7 @@ Legend.prototype = { var shape; for (var i = 0, l = this.shapeList.length; i < l; i++) { shape = this.shapeList[i]; - if (shape._name == name && shape.type != 'text') { + if (shape._name === name && shape.type != 'text') { if (!this._selectedMap[name]) { itemShape.style.color = '#ccc'; itemShape.style.strokeColor = '#ccc'; @@ -719,43 +771,27 @@ var legendIcon = { SectorShape.prototype.buildPath(ctx, { x: x + width / 2, y: y + height + 2, - r: height + 2, + r: height, r0: 6, startAngle: 45, endAngle: 135 }); }, -/* - chord : function (ctx, style) { - var x = style.x; - var y = style.y; - var width = style.width; - var height = style.height; - ctx.moveTo(x, y + height); - BeziercurveShape.prototype.buildPath(ctx, { - xStart : x, - yStart : y + height, - cpX1 : x + width, - cpY1 : y + height, - cpX2 : x, - cpY2 : y + 4, - xEnd : x + width, - yEnd : y + 4 - }); - ctx.lineTo(x + width, y); - BeziercurveShape.prototype.buildPath(ctx, { - xStart : x + width, - yStart : y, - cpX1 : x, - cpY1 : y, - cpX2 : x + width, - cpY2 : y + height - 4, - xEnd : x, - yEnd : y + height - 4 - }); - ctx.lineTo(x, y + height); - }, - */ + + eventRiver: function (ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + ctx.moveTo(x, y + height); + ctx.bezierCurveTo( + x + width, y + height, x, y + 4, x + width, y + 4); + ctx.lineTo(x + width, y); + ctx.bezierCurveTo( + x, y, x + width, y + height - 4, x, y + height - 4); + ctx.lineTo(x, y + height); + }, + k: function (ctx, style) { var x = style.x; var y = style.y; diff --git a/src/component/polar.js b/src/component/polar.js index 351dbdb..114a950 100644 --- a/src/component/polar.js +++ b/src/component/polar.js @@ -2,7 +2,7 @@ * echarts组件类:极坐标 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Neil (杨骥, yangji01@baidu.com) + * @author Neil (杨骥, 511415343@qq.com) * */ @@ -16,6 +16,58 @@ var Circle = require('../zrender/shape/Circle.js'); var Ring = require('../zrender/shape/Ring.js'); var ecConfig = require('../config.js'); +ecConfig.polar = { + zlevel: 0, + // 一级层叠 + z: 0, + // 二级层叠 + center: ['50%', '50%'], + // 默认全局居中 + radius: '75%', + startAngle: 90, + boundaryGap: [0, 0], + // 数值起始和结束两端空白策略 + splitNumber: 5, + name: { + show: true, + // formatter: null, + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: '#333' + } + }, + axisLine: { // 坐标轴线 + show: true, + // 默认显示,属性show控制显示与否 + lineStyle: { // 属性lineStyle控制线条样式 + color: '#ccc', + width: 1, + type: 'solid' + } + }, + axisLabel: { // 坐标轴文本标签,详见axis.axisLabel + show: false, + // formatter: null, + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: '#333' + } + }, + splitArea: { + show: true, + areaStyle: { + color: ['rgba(250,250,250,0.3)', 'rgba(200,200,200,0.3)'] + } + }, + splitLine: { + show: true, + lineStyle: { + width: 1, + color: '#ccc' + } + }, + type: 'polygon' + // indicator: [] +}; + var zrUtil = require('../zrender/tool/util.js'); var ecCoordinates = require('../util/coordinates.js'); @@ -116,6 +168,7 @@ Polar.prototype = { * 绘制axisLabel */ _addAxisLabel: function (index) { + var accMath = require('../util/accMath.js'); var item = this.polar[index]; var indicator = this.deepQuery(this._queryTarget, 'indicator'); var __ecIndicator = item.__ecIndicator; @@ -131,16 +184,17 @@ Polar.prototype = { var theta; // var startAngle = this.deepQuery(this._queryTarget, 'startAngle'); var offset; - var precision = this.deepQuery(this._queryTarget, 'precision'); var interval; for (var i = 0; i < indicator.length; i++) { axisLabel = this.deepQuery([indicator[i], item, this.option], 'axisLabel'); if (axisLabel.show) { + var textStyle = this.deepQuery([axisLabel, item, this.option], 'textStyle'); style = {}; - style.textFont = this.getFont(); - //Todo: bug fix + style.textFont = this.getFont(textStyle); + style.color = textStyle.color; + style = zrUtil.merge(style, axisLabel); style.lineWidth = style.width; @@ -150,19 +204,20 @@ Polar.prototype = { offset = axisLabel.offset || 10; interval = axisLabel.interval || 0; + if (!value) { + return; + } + for (var j = 1; j <= splitNumber; j += interval + 1) { newStyle = zrUtil.merge({}, style); - text = - j * (value.max - value.min) / splitNumber + value.min; - if (precision) { - text = text.toFixed(precision); - } + text = accMath.accAdd(value.min, accMath.accMul(value.step, j)); newStyle.text = this.numAddCommas(text); newStyle.x = j * vector[0] / splitNumber + Math.cos(theta) * offset + center[0]; newStyle.y = j * vector[1] / splitNumber + Math.sin(theta) * offset + center[1]; this.shapeList.push(new TextShape({ - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), style: newStyle, draggable: false, hoverable: false @@ -227,8 +282,8 @@ Polar.prototype = { textAlign = 'center'; } - if (!name.margin) { - vector = this._mapVector(vector, center, 1.2); + if (name.margin == null) { + vector = this._mapVector(vector, center, 1.1); } else { margin = name.margin; @@ -254,7 +309,8 @@ Polar.prototype = { } this.shapeList.push(new TextShape({ - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), style: style, draggable: false, hoverable: false, @@ -270,7 +326,7 @@ Polar.prototype = { /** * 添加一个隐形的盒子 当做drop的容器 暴露给外部的图形类使用 * @param {number} polar的index - * @return {Object} 添加的盒子图形 + * @return {Object} 添加的盒子图形 */ getDropBox: function (index) { var index = index || 0; @@ -355,7 +411,8 @@ Polar.prototype = { strokeColor, lineWidth, scale, center, brushType, color) { var radius = this._getRadius(); return new Circle({ - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), style: { x: center[0], y: center[1], @@ -382,7 +439,8 @@ Polar.prototype = { _getRing: function (color, scale0, scale1, center) { var radius = this._getRadius(); return new Ring({ - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), style: { x: center[0], y: center[1], @@ -429,7 +487,8 @@ Polar.prototype = { _getShape: function ( pointList, brushType, color, strokeColor, lineWidth) { return new PolygonShape({ - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), style: { pointList: pointList, brushType: brushType, @@ -512,12 +571,12 @@ Polar.prototype = { /** * 绘制从中点出发的线 - * + * * @param {Array} 指标对象 * @param {Array} 中点坐标 * @param {string} 线条颜色 * @param {number} 线条宽度 - * @param {string} 线条绘制类型 + * @param {string} 线条绘制类型 * solid | dotted | dashed 实线 | 点线 | 虚线 */ _addLine: function ( @@ -538,7 +597,7 @@ Polar.prototype = { } }, - /** + /** * 获取线条对象 * @param {number} 出发点横坐标 * @param {number} 出发点纵坐标 @@ -553,7 +612,8 @@ Polar.prototype = { _getLine: function ( xStart, yStart, xEnd, yEnd, strokeColor, lineWidth, lineType) { return new LineShape({ - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), style: { xStart: xStart, yStart: yStart, @@ -576,32 +636,41 @@ Polar.prototype = { var indicator = this.deepQuery(this._queryTarget, 'indicator'); var len = indicator.length; var __ecIndicator = item.__ecIndicator; - var value; var max; var min; var data = this._getSeriesData(index); - var splitNumber = item.splitNumber; - var boundaryGap = this.deepQuery(this._queryTarget, 'boundaryGap'); - var precision = this.deepQuery(this._queryTarget, 'precision'); - var power = this.deepQuery(this._queryTarget, 'power'); - var scale = this.deepQuery(this._queryTarget, 'scale'); + var boundaryGap = item.boundaryGap; + var splitNumber = item.splitNumber; + var scale = item.scale; + var smartSteps = require('../util/smartSteps.js'); for (var i = 0; i < len; i++) { if (typeof indicator[i].max == 'number') { max = indicator[i].max; min = indicator[i].min || 0; - value = { - max: max, - min: min - }; } else { - value = this._findValue( - data, i, splitNumber, boundaryGap, precision, power, scale); + var value = this._findValue( + data, i, splitNumber, boundaryGap); + min = value.min; + max = value.max; + } + // 非scale下双正,修正最小值为0 + if (!scale && min >= 0 && max >= 0) { + min = 0; + } + // 非scale下双负,修正最大值为0 + if (!scale && min <= 0 && max <= 0) { + max = 0; } + var stepOpt = smartSteps(min, max, splitNumber); - __ecIndicator[i].value = value; + __ecIndicator[i].value = { + min: stepOpt.min, + max: stepOpt.max, + step: stepOpt.step + }; } }, @@ -637,25 +706,16 @@ Polar.prototype = { * 查找指标合适的值 * * 如果只有一组数据以数据中的最大值作为最大值 0为最小值 - * 如果是多组,使用同一维度的进行比较 选出最大值最小值 - * 对它们进行处理 + * 如果是多组,使用同一维度的进行比较 选出最大值最小值 + * 对它们进行处理 * @param {Object} serie 的 data - * @param {number} 指标的序号 - * @param {boolean} boundaryGap 两端留白 - * @param {number} precision 小数精度 - * @param {number} power 整数精度 - * @return {Object} 指标的最大值最小值 + * @param {number} index 指标的序号 + * @param {number} splitNumber 分段格式 + * * @param {boolean} boundaryGap 两端留白 */ - _findValue: function ( - data, index, splitNumber, boundaryGap, precision, power, scale) { + _findValue: function (data, index, splitNumber, boundaryGap) { var max; var min; - var value; - var delta; - var str; - var len = 0; - var max0; - var min0; var one; if (!data || data.length === 0) { @@ -672,66 +732,31 @@ Polar.prototype = { } if (data.length != 1) { for (var i = 0; i < data.length; i++) { - value = typeof data[i].value[index].value != 'undefined' ? data[i].value[index].value : data[i].value[index]; - _compare(value); + _compare(this.getDataFromOption(data[i].value[index])); } } else { one = data[0]; for (var i = 0; i < one.value.length; i++) { - _compare( - typeof one.value[i].value != 'undefined' ? one.value[i].value : one.value[i]); + _compare(this.getDataFromOption(one.value[i])); } } - if (data.length != 1) { - if (scale) { - delta = this._getDelta( - max, min, splitNumber, precision, power); - - if (delta >= 1) { - min = Math.floor(min / delta) * delta - delta; - } - else if (delta === 0) { - if (max > 0) { - min0 = 0; - max0 = 2 * max; - } - else if (max === 0) { - min0 = 0; - max0 = 100; - } - else { - max0 = 0; - min0 = 2 * min; - } - - return { - max: max0, - min: min0 - }; - } - else { - str = (delta + '').split('.')[1]; - len = str.length; - min = Math.floor( - min * Math.pow(10, len)) / Math.pow(10, len) - delta; - } - - if (Math.abs(min) <= delta) { - min = 0; - } - - max = min + Math.floor(delta * Math.pow(10, len) * (splitNumber + 1)) / Math.pow(10, len); + var gap = Math.abs(max - min); + min = min - Math.abs(gap * boundaryGap[0]); + max = max + Math.abs(gap * boundaryGap[1]); + if (min === max) { + if (max === 0) { + // 修复全0数据 + max = 1; } - else { - min = min > 0 ? 0 : min; + // 修复最大值==最小值时数据整形 + else if (max > 0) { + min = max / splitNumber; + } + else { // max < 0 + max = max / splitNumber; } - } - - if (boundaryGap) { - max = max > 0 ? max * 1.2 : max * 0.8; - min = min > 0 ? min * 0.8 : min * 1.2; } return { @@ -740,71 +765,10 @@ Polar.prototype = { }; }, - /** - * 获取最大值与最小值中间比较合适的差值 - * @param {number} max; - * @param {number} min - * @param {number} precision 小数精度 - * @param {number} power 整数精度 - * @return {number} delta - */ - _getDelta: function (max, min, splitNumber, precision, power) { - var delta = (max - min) / splitNumber; - var str; - var n; - - if (delta > 1) { - if (!power) { - str = (delta + '').split('.')[0]; - n = str.length; - if (str.charAt(0) >= 5) { - return Math.pow(10, n); - } - else { - return (str.charAt(0) - 0 + 1) * Math.pow(10, n - 1); - } - } - else { - delta = Math.ceil(delta); - if (delta % power > 0) { - return (Math.ceil(delta / power) + 1) * power; - } - else { - return delta; - } - } - } - else if (delta == 1) { - return 1; - } - else if (delta === 0) { - return 0; - } - else { - if (!precision) { - str = (delta + '').split('.')[1]; - n = 0; - while (str[n] == '0') { - n++; - } - - if (str[n] >= 5) { - return '0.' + str.substring(0, n + 1) - 0 + 1 / Math.pow(10, n); - } - else { - return '0.' + str.substring(0, n + 1) - 0 + 1 / Math.pow(10, n + 1); - } - } - else { - return Math.ceil(delta * Math.pow(10, precision)) / Math.pow(10, precision); - } - } - }, - /** * 获取每个指标上某个value对应的坐标 * @param {number} polarIndex - * @param {number} indicatorIndex + * @param {number} indicatorIndex * @param {number} value * @return {Array} 对应坐标 */ @@ -868,7 +832,7 @@ Polar.prototype = { * 如果一个点在网内,返回离它最近的数据轴的index * @param {Array} 坐标 * @return {Object} | false - * polarIndex + * polarIndex * valueIndex */ getNearestIndex: function (vector) { @@ -919,7 +883,7 @@ Polar.prototype = { }, /** - * 获取指标信息 + * 获取指标信息 * @param {number} polarIndex * @return {Array} indicator */ diff --git a/src/component/roamController.js b/src/component/roamController.js new file mode 100644 index 0000000..102922f --- /dev/null +++ b/src/component/roamController.js @@ -0,0 +1,351 @@ +/** + * echarts组件:漫游控制器 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + * + */ + +var Base = require('./base.js'); + +// 图形依赖 +var RectangleShape = require('../zrender/shape/Rectangle.js'); +var SectorShape = require('../zrender/shape/Sector.js'); +var CircleShape = require('../zrender/shape/Circle.js'); + +var ecConfig = require('../config.js'); +ecConfig.roamController = { + zlevel: 0, + // 一级层叠 + z: 4, + // 二级层叠 + show: true, + x: 'left', + // 水平安放位置,默认为全图左对齐,可选为: + // 'center' ¦ 'left' ¦ 'right' + // ¦ {number}(x坐标,单位px) + y: 'top', + // 垂直安放位置,默认为全图顶端,可选为: + // 'top' ¦ 'bottom' ¦ 'center' + // ¦ {number}(y坐标,单位px) + width: 80, + height: 120, + backgroundColor: 'rgba(0,0,0,0)', + borderColor: '#ccc', + // 图例边框颜色 + borderWidth: 0, + // 图例边框线宽,单位px,默认为0(无边框) + padding: 5, + // 图例内边距,单位px,默认各方向内边距为5, + // 接受数组分别设定上右下左边距,同css + handleColor: '#6495ed', + fillerColor: '#fff', + step: 15, + // 移动幅度 + mapTypeControl: null +}; + +var zrUtil = require('../zrender/tool/util.js'); +var zrColor = require('../zrender/tool/color.js'); +var zrEvent = require('../zrender/tool/event.js'); + +/** + * 构造函数 + * @param {Object} messageCenter echart消息中心 + * @param {ZRender} zr zrender实例 + * @param {Object} option 图表参数 + */ + +function RoamController(ecTheme, messageCenter, zr, option, myChart) { + if (!option.roamController || !option.roamController.show) { + return; + } + if (!option.roamController.mapTypeControl) { + console.error('option.roamController.mapTypeControl has not been defined.'); + return; + } + + Base.call(this, ecTheme, messageCenter, zr, option, myChart); + + this.rcOption = option.roamController; + + var self = this; + this._drictionMouseDown = function (params) { + return self.__drictionMouseDown(params); + }; + this._drictionMouseUp = function (params) { + return self.__drictionMouseUp(params); + }; + this._drictionMouseMove = function (params) { + return self.__drictionMouseMove(params); + }; + this._drictionMouseOut = function (params) { + return self.__drictionMouseOut(params); + }; + this._scaleHandler = function (params) { + return self.__scaleHandler(params); + }; + this.refresh(option); +} + +RoamController.prototype = { + type: ecConfig.COMPONENT_TYPE_ROAMCONTROLLER, + _buildShape: function () { + if (!this.rcOption.show) { + return; + } + // 元素组的位置参数,通过计算所得x, y, width, height + this._itemGroupLocation = this._getItemGroupLocation(); + + this._buildBackground(); + this._buildItem(); + + for (var i = 0, l = this.shapeList.length; i < l; i++) { + this.zr.addShape(this.shapeList[i]); + } + }, + + /** + * 构建所有漫游控制器元素 + */ + _buildItem: function () { + this.shapeList.push(this._getDirectionShape('up')); + this.shapeList.push(this._getDirectionShape('down')); + this.shapeList.push(this._getDirectionShape('left')); + this.shapeList.push(this._getDirectionShape('right')); + this.shapeList.push(this._getScaleShape('scaleUp')); + this.shapeList.push(this._getScaleShape('scaleDown')); + }, + + _getDirectionShape: function (direction) { + var r = this._itemGroupLocation.r; + var x = this._itemGroupLocation.x + r; + var y = this._itemGroupLocation.y + r; + + var sectorShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: x, + // 圆心横坐标 + y: y, + // 圆心纵坐标 + r: r, + // 圆环外半径 + startAngle: -45, + endAngle: 45, + color: this.rcOption.handleColor, + text: '>', + textX: x + r / 2 + 4, + textY: y - 0.5, + textAlign: 'center', + textBaseline: 'middle', + textPosition: 'specific', + textColor: this.rcOption.fillerColor, + textFont: Math.floor(r / 2) + 'px arial' + }, + highlightStyle: { + color: zrColor.lift(this.rcOption.handleColor, -0.2), + brushType: 'fill' + }, + clickable: true + }; + switch (direction) { + case 'up': + sectorShape.rotation = [Math.PI / 2, x, y]; + break; + case 'left': + sectorShape.rotation = [Math.PI, x, y]; + break; + case 'down': + sectorShape.rotation = [-Math.PI / 2, x, y]; + break; + } + + sectorShape = new SectorShape(sectorShape); + sectorShape._roamType = direction; + sectorShape.onmousedown = this._drictionMouseDown; + sectorShape.onmouseup = this._drictionMouseUp; + sectorShape.onmousemove = this._drictionMouseMove; + sectorShape.onmouseout = this._drictionMouseOut; + + return sectorShape; + }, + + _getScaleShape: function (text) { + var width = this._itemGroupLocation.width; + var height = this._itemGroupLocation.height - width; + height = height < 0 ? 20 : height; // 确保height不为负 + var r = Math.min(width / 2 - 5, height) / 2; + var x = this._itemGroupLocation.x + (text === 'scaleDown' ? (width - r) : r); + var y = this._itemGroupLocation.y + this._itemGroupLocation.height - r; + + var scaleShape = { + zlevel: this.getZlevelBase(), + z: this.getZBase(), + style: { + x: x, + y: y, + r: r, + color: this.rcOption.handleColor, + text: text === 'scaleDown' ? '-' : '+', + textX: x, + textY: y - 2, + textAlign: 'center', + textBaseline: 'middle', + textPosition: 'specific', + textColor: this.rcOption.fillerColor, + textFont: Math.floor(r) + 'px verdana' + }, + highlightStyle: { + color: zrColor.lift(this.rcOption.handleColor, -0.2), + brushType: 'fill' + }, + clickable: true + }; + + scaleShape = new CircleShape(scaleShape); + scaleShape._roamType = text; + scaleShape.onmousedown = this._scaleHandler; + + return scaleShape; + }, + + _buildBackground: function () { + var padding = this.reformCssArray(this.rcOption.padding); + + this.shapeList.push(new RectangleShape({ + zlevel: this.getZlevelBase(), + z: this.getZBase(), + hoverable: false, + style: { + x: this._itemGroupLocation.x - padding[3], + y: this._itemGroupLocation.y - padding[0], + width: this._itemGroupLocation.width + padding[3] + padding[1], + height: this._itemGroupLocation.height + padding[0] + padding[2], + brushType: this.rcOption.borderWidth === 0 ? 'fill' : 'both', + color: this.rcOption.backgroundColor, + strokeColor: this.rcOption.borderColor, + lineWidth: this.rcOption.borderWidth + } + })); + }, + + /** + * 根据选项计算漫游控制器实体的位置坐标 + */ + _getItemGroupLocation: function () { + var padding = this.reformCssArray(this.rcOption.padding); + var width = this.rcOption.width; + var height = this.rcOption.height; + + var zrWidth = this.zr.getWidth(); + var zrHeight = this.zr.getHeight(); + var x; + switch (this.rcOption.x) { + case 'center': + x = Math.floor((zrWidth - width) / 2); + break; + case 'left': + x = padding[3] + this.rcOption.borderWidth; + break; + case 'right': + x = zrWidth - width - padding[1] - padding[3] - this.rcOption.borderWidth * 2; + break; + default: + x = this.parsePercent(this.rcOption.x, zrWidth); + break; + } + + var y; + switch (this.rcOption.y) { + case 'top': + y = padding[0] + this.rcOption.borderWidth; + break; + case 'bottom': + y = zrHeight - height - padding[0] - padding[2] - this.rcOption.borderWidth * 2; + break; + case 'center': + y = Math.floor((zrHeight - height) / 2); + break; + default: + y = this.parsePercent(this.rcOption.y, zrHeight); + break; + } + + return { + x: x, + y: y, + r: width / 2, + width: width, + height: height + }; + }, + + __drictionMouseDown: function (params) { + this.mousedown = true; + this._drictionHandlerOn(params); + }, + + __drictionMouseUp: function (params) { + this.mousedown = false; + this._drictionHandlerOff(params); + }, + + __drictionMouseMove: function (params) { + if (this.mousedown) { + this._drictionHandlerOn(params); + } + }, + + __drictionMouseOut: function (params) { + this._drictionHandlerOff(params); + }, + + _drictionHandlerOn: function (params) { + this._dispatchEvent(params.event, params.target._roamType); + clearInterval(this.dircetionTimer); + var self = this; + this.dircetionTimer = setInterval(function () { + self._dispatchEvent(params.event, params.target._roamType); + }, 100); + zrEvent.stop(params.event); + }, + + _drictionHandlerOff: function (params) { + clearInterval(this.dircetionTimer); + }, + + __scaleHandler: function (params) { + this._dispatchEvent(params.event, params.target._roamType); + zrEvent.stop(params.event); + }, + + _dispatchEvent: function (event, roamType) { + this.messageCenter.dispatch( + ecConfig.EVENT.ROAMCONTROLLER, event, { + roamType: roamType, + mapTypeControl: this.rcOption.mapTypeControl, + step: this.rcOption.step + }, this.myChart); + }, + /** + * 刷新 + */ + refresh: function (newOption) { + if (newOption) { + this.option = newOption || this.option; + this.option.roamController = this.reformOption(this.option.roamController); + this.rcOption = this.option.roamController; + } + this.clear(); + this._buildShape(); + } +}; + + +zrUtil.inherits(RoamController, Base); + +require('../component.js').define('roamController', RoamController); + +module.exports = RoamController; \ No newline at end of file diff --git a/src/component/timeline.js b/src/component/timeline.js index 301663d..5617df7 100644 --- a/src/component/timeline.js +++ b/src/component/timeline.js @@ -2,7 +2,7 @@ * echarts组件:时间轴组件 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ @@ -14,6 +14,79 @@ var IconShape = require('../util/shape/Icon.js'); var ChainShape = require('../util/shape/Chain.js'); var ecConfig = require('../config.js'); +ecConfig.timeline = { + zlevel: 0, + // 一级层叠 + z: 4, + // 二级层叠 + show: true, + type: 'time', + // 模式是时间类型,支持 number + notMerge: false, + realtime: true, + x: 80, + // y: {number}, + x2: 80, + y2: 0, + // width: {totalWidth} - x - x2, + height: 50, + backgroundColor: 'rgba(0,0,0,0)', + // 时间轴背景颜色 + borderColor: '#ccc', + // 时间轴边框颜色 + borderWidth: 0, + // 时间轴边框线宽,单位px,默认为0(无边框) + padding: 5, + // 时间轴内边距,单位px,默认各方向内边距为5, + controlPosition: 'left', + // 'right' | 'none' + autoPlay: false, + loop: true, + playInterval: 2000, + // 播放时间间隔,单位ms + lineStyle: { + width: 1, + color: '#666', + type: 'dashed' + }, + label: { // 文本标签 + show: true, + interval: 'auto', + rotate: 0, + // formatter: null, + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: '#333' + } + }, + checkpointStyle: { + symbol: 'auto', + symbolSize: 'auto', + color: 'auto', + borderColor: 'auto', + borderWidth: 'auto', + label: { // 文本标签 + show: false, + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: 'auto' + } + } + }, + controlStyle: { + itemSize: 15, + itemGap: 5, + normal: { + color: '#333' + }, + emphasis: { + color: '#1e90ff' + } + }, + symbol: 'emptyDiamond', + symbolSize: 4, + currentIndex: 0 + // data: [] +}; + var zrUtil = require('../zrender/tool/util.js'); var zrArea = require('../zrender/tool/area.js'); var zrEvent = require('../zrender/tool/event.js'); @@ -48,7 +121,7 @@ function Timeline(ecTheme, messageCenter, zr, option, myChart) { self.messageCenter.dispatch( ecConfig.EVENT.TIMELINE_CHANGED, null, { currentIndex: self.currentIndex, - data: typeof timelineOption.data[self.currentIndex].name != 'undefined' ? timelineOption.data[self.currentIndex].name : timelineOption.data[self.currentIndex] + data: timelineOption.data[self.currentIndex].name != null ? timelineOption.data[self.currentIndex].name : timelineOption.data[self.currentIndex] }, self.myChart); }; self._onFrame = function () { @@ -99,7 +172,7 @@ function Timeline(ecTheme, messageCenter, zr, option, myChart) { function () { self.play(); - }, this.ecTheme.animationDuration); + }, this.ecTheme.animationDuration != null ? this.ecTheme.animationDuration : ecConfig.animationDuration); } } @@ -131,14 +204,14 @@ Timeline.prototype = { */ _getLocation: function () { var timelineOption = this.timelineOption; - var padding = timelineOption.padding; + var padding = this.reformCssArray(this.timelineOption.padding); // 水平布局 var zrWidth = this.zr.getWidth(); var x = this.parsePercent(timelineOption.x, zrWidth); var x2 = this.parsePercent(timelineOption.x2, zrWidth); var width; - if (typeof timelineOption.width == 'undefined') { + if (timelineOption.width == null) { width = zrWidth - x - x2; x2 = zrWidth - x2; } @@ -151,7 +224,7 @@ Timeline.prototype = { var height = this.parsePercent(timelineOption.height, zrHeight); var y; var y2; - if (typeof timelineOption.y != 'undefined') { + if (timelineOption.y != null) { y = this.parsePercent(timelineOption.y, zrHeight); y2 = y + height; } @@ -172,13 +245,13 @@ Timeline.prototype = { _getReformedLabel: function (idx) { var timelineOption = this.timelineOption; - var data = typeof timelineOption.data[idx].name != 'undefined' ? timelineOption.data[idx].name : timelineOption.data[idx]; + var data = timelineOption.data[idx].name != null ? timelineOption.data[idx].name : timelineOption.data[idx]; var formatter = timelineOption.data[idx].formatter || timelineOption.label.formatter; if (formatter) { - if (typeof formatter == 'function') { + if (typeof formatter === 'function') { data = formatter.call(this.myChart, data); } - else if (typeof formatter == 'string') { + else if (typeof formatter === 'string') { data = formatter.replace('{value}', data); } } @@ -192,7 +265,7 @@ Timeline.prototype = { var chainPoint = this._chainPoint; var timelineOption = this.timelineOption; var interval = timelineOption.label.interval; - if (interval == 'auto') { + if (interval === 'auto') { // 麻烦的自适应计算 var fontSize = timelineOption.label.textStyle.fontSize; var data = timelineOption.data; @@ -264,14 +337,14 @@ Timeline.prototype = { var len = data.length; function _getName(i) { - return typeof data[i].name != 'undefined' ? data[i].name : data[i]; + return (data[i].name != null ? data[i].name : data[i] + ''); } var xList = []; if (len > 1) { var boundaryGap = width / len; boundaryGap = boundaryGap > 50 ? 50 : (boundaryGap < 20 ? 5 : boundaryGap); width -= boundaryGap * 2; - if (timelineOption.type == 'number') { + if (timelineOption.type === 'number') { // 平均分布 for (var i = 0; i < len; i++) { xList.push(x + boundaryGap + width / (len - 1) * i); @@ -350,14 +423,15 @@ Timeline.prototype = { _buildBackground: function () { var timelineOption = this.timelineOption; - var padding = timelineOption.padding; + var padding = this.reformCssArray(this.timelineOption.padding); var width = this._location.width; var height = this._location.height; if (timelineOption.borderWidth !== 0 || timelineOption.backgroundColor.replace(/\s/g, '') != 'rgba(0,0,0,0)') { // 背景 this.shapeList.push(new RectangleShape({ - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), hoverable: false, style: { x: this._location.x - padding[3], @@ -378,13 +452,13 @@ Timeline.prototype = { var timelineOption = this.timelineOption; var lineStyle = timelineOption.lineStyle; var controlStyle = timelineOption.controlStyle; - if (timelineOption.controlPosition == 'none') { + if (timelineOption.controlPosition === 'none') { return; } - var iconSize = 15; - var iconGap = 5; + var iconSize = controlStyle.itemSize; + var iconGap = controlStyle.itemGap; var x; - if (timelineOption.controlPosition == 'left') { + if (timelineOption.controlPosition === 'left') { x = this._location.x; this._location.x += (iconSize + iconGap) * 3; } @@ -395,7 +469,8 @@ Timeline.prototype = { var y = this._location.y; var iconStyle = { - zlevel: this._zlevelBase + 1, + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, style: { iconType: 'timelineControl', symbol: 'last', @@ -429,7 +504,7 @@ Timeline.prototype = { this._ctrPlayShape.style.status = this.timelineOption.autoPlay ? 'playing' : 'stop'; this._ctrPlayShape.style.x = x; this._ctrPlayShape.onclick = function () { - if (self._ctrPlayShape.style.status == 'stop') { + if (self._ctrPlayShape.style.status === 'stop') { self.play(); } else { @@ -455,7 +530,8 @@ Timeline.prototype = { var timelineOption = this.timelineOption; var lineStyle = timelineOption.lineStyle; this._timelineShae = { - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), style: { x: this._location.x, y: this.subPixelOptimize(this._location.y, lineStyle.width), @@ -485,7 +561,8 @@ Timeline.prototype = { symbolSize = symbolSize < 5 ? 5 : symbolSize; this._handleShape = { - zlevel: this._zlevelBase + 1, + zlevel: this.getZlevelBase(), + z: this.getZBase() + 1, hoverable: false, draggable: true, style: { @@ -527,7 +604,7 @@ Timeline.prototype = { this._handleShape.style.textFont = curPoint.textFont; this._handleShape.style.n = curPoint.n; - if (cpStyle.symbol == 'auto') { + if (cpStyle.symbol === 'auto') { this._handleShape.style.iconType = curPoint.symbol != 'none' ? curPoint.symbol : 'diamond'; } else { @@ -539,7 +616,7 @@ Timeline.prototype = { } var symbolSize; - if (cpStyle.symbolSize == 'auto') { + if (cpStyle.symbolSize === 'auto') { symbolSize = curPoint.symbolSize + 2; symbolSize = symbolSize < 5 ? 5 : symbolSize; } @@ -547,11 +624,11 @@ Timeline.prototype = { symbolSize = cpStyle.symbolSize - 0; } - this._handleShape.style.color = cpStyle.color == 'auto' ? (curPoint.color ? curPoint.color : timelineOption.controlStyle.emphasis.color) : cpStyle.color; - this._handleShape.style.textColor = cpStyle.label.textStyle.color == 'auto' ? this._handleShape.style.color : cpStyle.label.textStyle.color; + this._handleShape.style.color = cpStyle.color === 'auto' ? (curPoint.color ? curPoint.color : timelineOption.controlStyle.emphasis.color) : cpStyle.color; + this._handleShape.style.textColor = cpStyle.label.textStyle.color === 'auto' ? this._handleShape.style.color : cpStyle.label.textStyle.color; this._handleShape.highlightStyle.strokeColor = - this._handleShape.style.strokeColor = cpStyle.borderColor == 'auto' ? (curPoint.borderColor ? curPoint.borderColor : '#fff') : cpStyle.borderColor; - this._handleShape.style.lineWidth = cpStyle.borderWidth == 'auto' ? (curPoint.borderWidth ? curPoint.borderWidth : 0) : (cpStyle.borderWidth - 0); + this._handleShape.style.strokeColor = cpStyle.borderColor === 'auto' ? (curPoint.borderColor ? curPoint.borderColor : '#fff') : cpStyle.borderColor; + this._handleShape.style.lineWidth = cpStyle.borderWidth === 'auto' ? (curPoint.borderWidth ? curPoint.borderWidth : 0) : (cpStyle.borderWidth - 0); this._handleShape.highlightStyle.lineWidth = this._handleShape.style.lineWidth + 1; this.zr.animate(this._handleShape.id, 'style').when( @@ -584,7 +661,7 @@ Timeline.prototype = { __onclick: function (param) { var x = zrEvent.getX(param.event); var newIndex = this._findChainIndex(x); - if (newIndex == this.currentIndex) { + if (newIndex === this.currentIndex) { return true; // 啥事都没发生 } @@ -625,7 +702,7 @@ Timeline.prototype = { shape.style.text = curPoint.name; //console.log(newIndex) - if (newIndex == this.currentIndex) { + if (newIndex === this.currentIndex) { return true; // 啥事都没发生 } @@ -690,17 +767,17 @@ Timeline.prototype = { if (this._ctrPlayShape && this._ctrPlayShape.style.status != 'playing') { this._ctrPlayShape.style.status = 'playing'; this.zr.modShape(this._ctrPlayShape.id); - this.zr.refresh(); + this.zr.refreshNextFrame(); } - this.timelineOption.autoPlay = typeof autoPlay != 'undefined' ? autoPlay : true; + this.timelineOption.autoPlay = autoPlay != null ? autoPlay : true; if (!this.timelineOption.autoPlay) { clearTimeout(this.playTicket); } - this.currentIndex = typeof targetIndex != 'undefined' ? targetIndex : (this.currentIndex + 1); + this.currentIndex = targetIndex != null ? targetIndex : (this.currentIndex + 1); if (this.currentIndex >= this.timelineOption.data.length) { this.currentIndex = 0; } @@ -713,7 +790,7 @@ Timeline.prototype = { if (this._ctrPlayShape && this._ctrPlayShape.style.status != 'stop') { this._ctrPlayShape.style.status = 'stop'; this.zr.modShape(this._ctrPlayShape.id); - this.zr.refresh(); + this.zr.refreshNextFrame(); } this.timelineOption.autoPlay = false; @@ -736,14 +813,15 @@ Timeline.prototype = { setTheme: function (needRefresh) { this.timelineOption = this.reformOption(zrUtil.clone(this.option.timeline)); - // 补全padding属性 - this.timelineOption.padding = this.reformCssArray( - this.timelineOption.padding); // 通用字体设置 - this.timelineOption.label.textStyle = zrUtil.merge( - this.timelineOption.label.textStyle || {}, this.ecTheme.textStyle); - this.timelineOption.checkpointStyle.label.textStyle = zrUtil.merge( - this.timelineOption.checkpointStyle.label.textStyle || {}, this.ecTheme.textStyle); + this.timelineOption.label.textStyle = this.getTextStyle( + this.timelineOption.label.textStyle); + this.timelineOption.checkpointStyle.label.textStyle = this.getTextStyle( + this.timelineOption.checkpointStyle.label.textStyle); + if (!this.myChart.canvasSupported) { + // 不支持Canvas的强制关闭实时动画 + this.timelineOption.realtime = false; + } if (this.timelineOption.show && needRefresh) { this.clear(); @@ -755,10 +833,7 @@ Timeline.prototype = { /** * 释放后实例不可用,重载基类方法 */ - dispose: function () { - this.clear(); - this.shapeList = null; - + onbeforDispose: function () { clearTimeout(this.playTicket); } }; @@ -772,7 +847,7 @@ function timelineControl(ctx, style) { var symbol = style.symbol; - if (symbol == 'last') { + if (symbol === 'last') { ctx.moveTo(x + width - 2, y + height / 3); ctx.lineTo(x + width - 2, y); ctx.lineTo(x + 2, y + height / 2); @@ -781,7 +856,7 @@ function timelineControl(ctx, style) { ctx.moveTo(x, y); ctx.lineTo(x, y); } - else if (symbol == 'next') { + else if (symbol === 'next') { ctx.moveTo(x + 2, y + height / 3); ctx.lineTo(x + 2, y); ctx.lineTo(x + width - 2, y + height / 2); @@ -790,15 +865,15 @@ function timelineControl(ctx, style) { ctx.moveTo(x, y); ctx.lineTo(x, y); } - else if (symbol == 'play') { - if (style.status == 'stop') { + else if (symbol === 'play') { + if (style.status === 'stop') { ctx.moveTo(x + 2, y); ctx.lineTo(x + width - 2, y + height / 2); ctx.lineTo(x + 2, y + height); ctx.lineTo(x + 2, y); } else { - var delta = style.brushType == 'both' ? 2 : 3; + var delta = style.brushType === 'both' ? 2 : 3; ctx.rect(x + 2, y, delta, height); ctx.rect(x + width - delta - 2, y, delta, height); } diff --git a/src/component/title.js b/src/component/title.js index 0637097..806cb10 100644 --- a/src/component/title.js +++ b/src/component/title.js @@ -2,7 +2,7 @@ * echarts组件:图表标题 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ @@ -13,6 +13,48 @@ var TextShape = require('../zrender/shape/Text.js'); var RectangleShape = require('../zrender/shape/Rectangle.js'); var ecConfig = require('../config.js'); +// 图表标题 +ecConfig.title = { + zlevel: 0, + // 一级层叠 + z: 6, + // 二级层叠 + show: true, + text: '', + // link: null, // 超链接跳转 + // target: null, // 仅支持self | blank + subtext: '', + // sublink: null, // 超链接跳转 + // subtarget: null, // 仅支持self | blank + x: 'left', + // 水平安放位置,默认为左对齐,可选为: + // 'center' ¦ 'left' ¦ 'right' + // ¦ {number}(x坐标,单位px) + y: 'top', + // 垂直安放位置,默认为全图顶端,可选为: + // 'top' ¦ 'bottom' ¦ 'center' + // ¦ {number}(y坐标,单位px) + //textAlign: null // 水平对齐方式,默认根据x设置自动调整 + backgroundColor: 'rgba(0,0,0,0)', + borderColor: '#ccc', + // 标题边框颜色 + borderWidth: 0, + // 标题边框线宽,单位px,默认为0(无边框) + padding: 5, + // 标题内边距,单位px,默认各方向内边距为5, + // 接受数组分别设定上右下左边距,同css + itemGap: 5, + // 主副标题纵向间隔,单位px,默认为10, + textStyle: { + fontSize: 18, + fontWeight: 'bolder', + color: '#333' // 主标题文字颜色 + }, + subtextStyle: { + color: '#aaa' // 副标题文字颜色 + } +}; + var zrUtil = require('../zrender/tool/util.js'); var zrArea = require('../zrender/tool/area.js'); var zrColor = require('../zrender/tool/color.js'); @@ -33,6 +75,9 @@ function Title(ecTheme, messageCenter, zr, option, myChart) { Title.prototype = { type: ecConfig.COMPONENT_TYPE_TITLE, _buildShape: function () { + if (!this.titleOption.show) { + return; + } // 标题元素组的位置参数,通过计算所得x, y, width, height this._itemGroupLocation = this._getItemGroupLocation(); @@ -63,7 +108,8 @@ Title.prototype = { var height = this._itemGroupLocation.height; var textShape = { - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), style: { y: y, color: this.titleOption.textStyle.color, @@ -91,7 +137,8 @@ Title.prototype = { } var subtextShape = { - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), style: { y: y + height, color: this.titleOption.subtextStyle.color, @@ -147,19 +194,17 @@ Title.prototype = { }, _buildBackground: function () { - var pTop = this.titleOption.padding[0]; - var pRight = this.titleOption.padding[1]; - var pBottom = this.titleOption.padding[2]; - var pLeft = this.titleOption.padding[3]; + var padding = this.reformCssArray(this.titleOption.padding); this.shapeList.push(new RectangleShape({ - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), hoverable: false, style: { - x: this._itemGroupLocation.x - pLeft, - y: this._itemGroupLocation.y - pTop, - width: this._itemGroupLocation.width + pLeft + pRight, - height: this._itemGroupLocation.height + pTop + pBottom, + x: this._itemGroupLocation.x - padding[3], + y: this._itemGroupLocation.y - padding[0], + width: this._itemGroupLocation.width + padding[3] + padding[1], + height: this._itemGroupLocation.height + padding[0] + padding[2], brushType: this.titleOption.borderWidth === 0 ? 'fill' : 'both', color: this.titleOption.backgroundColor, strokeColor: this.titleOption.borderColor, @@ -172,6 +217,7 @@ Title.prototype = { * 根据选项计算标题实体的位置坐标 */ _getItemGroupLocation: function () { + var padding = this.reformCssArray(this.titleOption.padding); var text = this.titleOption.text; var subtext = this.titleOption.subtext; var font = this.getFont(this.titleOption.textStyle); @@ -188,10 +234,10 @@ Title.prototype = { x = Math.floor((zrWidth - totalWidth) / 2); break; case 'left': - x = this.titleOption.padding[3] + this.titleOption.borderWidth; + x = padding[3] + this.titleOption.borderWidth; break; case 'right': - x = zrWidth - totalWidth - this.titleOption.padding[1] - this.titleOption.borderWidth; + x = zrWidth - totalWidth - padding[1] - this.titleOption.borderWidth; break; default: x = this.titleOption.x - 0; @@ -203,10 +249,10 @@ Title.prototype = { var zrHeight = this.zr.getHeight(); switch (this.titleOption.y) { case 'top': - y = this.titleOption.padding[0] + this.titleOption.borderWidth; + y = padding[0] + this.titleOption.borderWidth; break; case 'bottom': - y = zrHeight - totalHeight - this.titleOption.padding[2] - this.titleOption.borderWidth; + y = zrHeight - totalHeight - padding[2] - this.titleOption.borderWidth; break; case 'center': y = Math.floor((zrHeight - totalHeight) / 2); @@ -233,15 +279,11 @@ Title.prototype = { this.option = newOption; this.option.title = this.reformOption(this.option.title); - // 补全padding属性 - this.option.title.padding = this.reformCssArray( - this.option.title.padding); - this.titleOption = this.option.title; - this.titleOption.textStyle = zrUtil.merge( - this.titleOption.textStyle, this.ecTheme.textStyle); - this.titleOption.subtextStyle = zrUtil.merge( - this.titleOption.subtextStyle, this.ecTheme.textStyle); + this.titleOption.textStyle = this.getTextStyle( + this.titleOption.textStyle); + this.titleOption.subtextStyle = this.getTextStyle( + this.titleOption.subtextStyle); } this.clear(); diff --git a/src/component/toolbox.js b/src/component/toolbox.js index 0741a5e..f83d482 100644 --- a/src/component/toolbox.js +++ b/src/component/toolbox.js @@ -2,7 +2,7 @@ * echarts组件:工具箱 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ @@ -15,6 +15,108 @@ var RectangleShape = require('../zrender/shape/Rectangle.js'); var IconShape = require('../util/shape/Icon.js'); var ecConfig = require('../config.js'); +ecConfig.toolbox = { + zlevel: 0, + // 一级层叠 + z: 6, + // 二级层叠 + show: false, + orient: 'horizontal', + // 布局方式,默认为水平布局,可选为: + // 'horizontal' ¦ 'vertical' + x: 'right', + // 水平安放位置,默认为全图右对齐,可选为: + // 'center' ¦ 'left' ¦ 'right' + // ¦ {number}(x坐标,单位px) + y: 'top', + // 垂直安放位置,默认为全图顶端,可选为: + // 'top' ¦ 'bottom' ¦ 'center' + // ¦ {number}(y坐标,单位px) + color: ['#1e90ff', '#22bb22', '#4b0082', '#d2691e'], + disableColor: '#ddd', + effectiveColor: 'red', + backgroundColor: 'rgba(0,0,0,0)', + // 工具箱背景颜色 + borderColor: '#ccc', + // 工具箱边框颜色 + borderWidth: 0, + // 工具箱边框线宽,单位px,默认为0(无边框) + padding: 5, + // 工具箱内边距,单位px,默认各方向内边距为5, + // 接受数组分别设定上右下左边距,同css + itemGap: 10, + // 各个item之间的间隔,单位px,默认为10, + // 横向布局时为水平间隔,纵向布局时为纵向间隔 + itemSize: 16, + // 工具箱图形宽度 + showTitle: true, + // textStyle: {}, + feature: { + mark: { + show: false, + title: { + mark: '辅助线开关', + markUndo: '删除辅助线', + markClear: '清空辅助线' + }, + lineStyle: { + width: 1, + color: '#1e90ff', + type: 'dashed' + } + }, + dataZoom: { + show: false, + title: { + dataZoom: '区域缩放', + dataZoomReset: '区域缩放后退' + } + }, + dataView: { + show: false, + title: '数据视图', + readOnly: false, + lang: ['数据视图', '关闭', '刷新'] + }, + magicType: { + show: false, + title: { + line: '折线图切换', + bar: '柱形图切换', + stack: '堆积', + tiled: '平铺', + force: '力导向布局图切换', + chord: '和弦图切换', + pie: '饼图切换', + funnel: '漏斗图切换' + }, +/* + option: { + line: {}, + bar: {}, + stack: {}, + tiled: {}, + force: {}, + chord: {}, + pie: {}, + funnel: {} + }, + */ + type: [] // 'line', 'bar', 'stack', 'tiled', 'force', 'chord', 'pie', 'funnel' + }, + restore: { + show: false, + title: '还原' + }, + saveAsImage: { + show: false, + title: '保存为图片', + type: 'png', + lang: ['点击保存'] + } + } +}; + var zrUtil = require('../zrender/tool/util.js'); var zrConfig = require('../zrender/config.js'); var zrEvent = require('../zrender/tool/event.js'); @@ -36,7 +138,7 @@ function Toolbox(ecTheme, messageCenter, zr, option, myChart) { this.dom = myChart.dom; this._magicType = {}; - //this._magicMap; + this._magicMap = {}; this._isSilence = false; this._iconList; @@ -45,6 +147,7 @@ function Toolbox(ecTheme, messageCenter, zr, option, myChart) { this._featureTitle = {}; // 文字 this._featureIcon = {}; // 图标 this._featureColor = {}; // 颜色 + this._featureOption = {}; this._enableColor = 'red'; this._disableColor = '#ccc'; // this._markStart; @@ -133,6 +236,9 @@ Toolbox.prototype = { case 'magicType': for (var i = 0, l = feature[key].type.length; i < l; i++) { feature[key].title[feature[key].type[i] + 'Chart'] = feature[key].title[feature[key].type[i]]; + if (feature[key].option) { + feature[key].option[feature[key].type[i] + 'Chart'] = feature[key].option[feature[key].type[i]]; + } iconName.push({ key: key, name: feature[key].type[i] + 'Chart' @@ -180,6 +286,9 @@ Toolbox.prototype = { if (feature[key].color) { this._featureColor[name] = feature[key].color[name] || feature[key].color; } + if (feature[key].option) { + this._featureOption[name] = feature[key].option[name] || feature[key].option; + } } this._itemGroupLocation = this._getItemGroupLocation(); @@ -217,18 +326,13 @@ Toolbox.prototype = { var textPosition; var textAlign; var textBaseline; - if (toolboxOption.orient == 'horizontal') { + if (toolboxOption.orient === 'horizontal') { textPosition = this._itemGroupLocation.y / this.zr.getHeight() < 0.5 ? 'bottom' : 'top'; textAlign = this._itemGroupLocation.x / this.zr.getWidth() < 0.5 ? 'left' : 'right'; textBaseline = this._itemGroupLocation.y / this.zr.getHeight() < 0.5 ? 'top' : 'bottom'; } else { textPosition = this._itemGroupLocation.x / this.zr.getWidth() < 0.5 ? 'right' : 'left'; -/* - textAlign = this._itemGroupLocation.x / this.zr.getWidth() < 0.5 - ? 'right' : 'left'; - textBaseline = 'top'; - */ } this._iconShapeMap = {}; @@ -238,7 +342,8 @@ Toolbox.prototype = { // 图形 itemShape = { type: 'icon', - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), style: { x: lastX, y: lastY, @@ -268,21 +373,21 @@ Toolbox.prototype = { itemShape.type = 'image'; } - if (toolboxOption.orient == 'horizontal') { + if (toolboxOption.orient === 'horizontal') { // 修正左对齐第一个或右对齐最后一个 - if (i === 0 && textAlign == 'left') { + if (i === 0 && textAlign === 'left') { itemShape.highlightStyle.textPosition = 'specific'; itemShape.highlightStyle.textAlign = textAlign; itemShape.highlightStyle.textBaseline = textBaseline; itemShape.highlightStyle.textX = lastX; - itemShape.highlightStyle.textY = textBaseline == 'top' ? lastY + itemSize + 10 : lastY - 10; + itemShape.highlightStyle.textY = textBaseline === 'top' ? lastY + itemSize + 10 : lastY - 10; } - if (i == iconLength - 1 && textAlign == 'right') { + if (i === iconLength - 1 && textAlign === 'right') { itemShape.highlightStyle.textPosition = 'specific'; itemShape.highlightStyle.textAlign = textAlign; itemShape.highlightStyle.textBaseline = textBaseline; itemShape.highlightStyle.textX = lastX + itemSize; - itemShape.highlightStyle.textY = textBaseline == 'top' ? lastY + itemSize + 10 : lastY - 10; + itemShape.highlightStyle.textY = textBaseline === 'top' ? lastY + itemSize + 10 : lastY - 10; } } @@ -319,11 +424,6 @@ Toolbox.prototype = { default: if (this._iconList[i].match('Chart')) { itemShape._name = this._iconList[i].replace('Chart', ''); -/* - if (this._magicType[itemShape._name]) { - itemShape.style.strokeColor = this._enableColor; - } - */ itemShape.onclick = self._onMagicType; } else { @@ -332,16 +432,16 @@ Toolbox.prototype = { break; } - if (itemShape.type == 'icon') { + if (itemShape.type === 'icon') { itemShape = new IconShape(itemShape); } - else if (itemShape.type == 'image') { + else if (itemShape.type === 'image') { itemShape = new ImageShape(itemShape); } this.shapeList.push(itemShape); this._iconShapeMap[this._iconList[i]] = itemShape; - if (toolboxOption.orient == 'horizontal') { + if (toolboxOption.orient === 'horizontal') { lastX += itemSize + itemGap; } else { @@ -352,19 +452,17 @@ Toolbox.prototype = { _buildBackground: function () { var toolboxOption = this.option.toolbox; - var pTop = toolboxOption.padding[0]; - var pRight = toolboxOption.padding[1]; - var pBottom = toolboxOption.padding[2]; - var pLeft = toolboxOption.padding[3]; + var padding = this.reformCssArray(this.option.toolbox.padding); this.shapeList.push(new RectangleShape({ - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), hoverable: false, style: { - x: this._itemGroupLocation.x - pLeft, - y: this._itemGroupLocation.y - pTop, - width: this._itemGroupLocation.width + pLeft + pRight, - height: this._itemGroupLocation.height + pTop + pBottom, + x: this._itemGroupLocation.x - padding[3], + y: this._itemGroupLocation.y - padding[0], + width: this._itemGroupLocation.width + padding[3] + padding[1], + height: this._itemGroupLocation.height + padding[0] + padding[2], brushType: toolboxOption.borderWidth === 0 ? 'fill' : 'both', color: toolboxOption.backgroundColor, strokeColor: toolboxOption.borderColor, @@ -378,13 +476,14 @@ Toolbox.prototype = { */ _getItemGroupLocation: function () { var toolboxOption = this.option.toolbox; + var padding = this.reformCssArray(this.option.toolbox.padding); var iconLength = this._iconList.length; var itemGap = toolboxOption.itemGap; var itemSize = toolboxOption.itemSize; var totalWidth = 0; var totalHeight = 0; - if (toolboxOption.orient == 'horizontal') { + if (toolboxOption.orient === 'horizontal') { // 水平布局,计算总宽度,别忘减去最后一个的itemGap totalWidth = (itemSize + itemGap) * iconLength - itemGap; totalHeight = itemSize; @@ -402,10 +501,10 @@ Toolbox.prototype = { x = Math.floor((zrWidth - totalWidth) / 2); break; case 'left': - x = toolboxOption.padding[3] + toolboxOption.borderWidth; + x = padding[3] + toolboxOption.borderWidth; break; case 'right': - x = zrWidth - totalWidth - toolboxOption.padding[1] - toolboxOption.borderWidth; + x = zrWidth - totalWidth - padding[1] - toolboxOption.borderWidth; break; default: x = toolboxOption.x - 0; @@ -417,10 +516,10 @@ Toolbox.prototype = { var zrHeight = this.zr.getHeight(); switch (toolboxOption.y) { case 'top': - y = toolboxOption.padding[0] + toolboxOption.borderWidth; + y = padding[0] + toolboxOption.borderWidth; break; case 'bottom': - y = zrHeight - totalHeight - toolboxOption.padding[2] - toolboxOption.borderWidth; + y = zrHeight - totalHeight - padding[2] - toolboxOption.borderWidth; break; case 'center': y = Math.floor((zrHeight - totalHeight) / 2); @@ -452,6 +551,7 @@ Toolbox.prototype = { zrEvent.getY(param.event) - this._zoomShape.style.y; this.zr.addHoverShape(this._zoomShape); this.dom.style.cursor = 'crosshair'; + zrEvent.stop(param.event); } if (this._zoomStart && (this.dom.style.cursor != 'pointer' && this.dom.style.cursor != 'move')) { this.dom.style.cursor = 'crosshair'; @@ -467,7 +567,8 @@ Toolbox.prototype = { var y = zrEvent.getY(param.event); var zoomOption = this.option.dataZoom || {}; this._zoomShape = new RectangleShape({ - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), style: { x: x, y: y, @@ -503,7 +604,7 @@ Toolbox.prototype = { end2: zoom.end2 }); this._iconEnable(this._iconShapeMap['dataZoomReset']); - this.zr.refresh(); + this.zr.refreshNextFrame(); } } return true; // 阻塞全局事件 @@ -519,14 +620,15 @@ Toolbox.prototype = { this._iconEnable(this._iconShapeMap['markUndo']); this._iconEnable(this._iconShapeMap['markClear']); this.zr.addShape(this._markShape); - this.zr.refresh(); + this.zr.refreshNextFrame(); } else if (this._markStart) { this._marking = true; var x = zrEvent.getX(param.event); var y = zrEvent.getY(param.event); this._markShape = new LineShape({ - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), style: { xStart: x, yStart: y, @@ -549,7 +651,7 @@ Toolbox.prototype = { if (this._marking || this._markStart) { // 取消 this._resetMark(); - this.zr.refresh(); + this.zr.refreshNextFrame(); } else { // 启用Mark @@ -560,7 +662,7 @@ Toolbox.prototype = { strokeColor: this._enableColor } }); - this.zr.refresh(); + this.zr.refreshNextFrame(); this._markStart = true; var self = this; setTimeout(function () { @@ -578,9 +680,9 @@ Toolbox.prototype = { if (len >= 1) { var target = this._markShapeList[len - 1]; this.zr.delShape(target.id); - this.zr.refresh(); + this.zr.refreshNextFrame(); this._markShapeList.pop(); - if (len == 1) { + if (len === 1) { this._iconDisable(this._iconShapeMap['markUndo']); this._iconDisable(this._iconShapeMap['markClear']); } @@ -600,7 +702,7 @@ Toolbox.prototype = { } this._iconDisable(this._iconShapeMap['markUndo']); this._iconDisable(this._iconShapeMap['markClear']); - this.zr.refresh(); + this.zr.refreshNextFrame(); } return true; }, @@ -610,7 +712,7 @@ Toolbox.prototype = { if (this._zooming || this._zoomStart) { // 取消 this._resetZoom(); - this.zr.refresh(); + this.zr.refreshNextFrame(); this.dom.style.cursor = 'default'; } else { @@ -622,7 +724,7 @@ Toolbox.prototype = { strokeColor: this._enableColor } }); - this.zr.refresh(); + this.zr.refreshNextFrame(); this._zoomStart = true; var self = this; setTimeout(function () { @@ -647,7 +749,7 @@ Toolbox.prototype = { else { this.component.dataZoom.rectZoom(); this._iconDisable(this._iconShapeMap['dataZoomReset']); - this.zr.refresh(); + this.zr.refreshNextFrame(); } return true; @@ -755,7 +857,7 @@ Toolbox.prototype = { var image; if (!this.myChart.isConnected()) { - image = this.zr.toDataURL('image/' + imgType, this.option.backgroundColor && this.option.backgroundColor.replace(' ', '') == 'rgba(0,0,0,0)' ? '#fff' : this.option.backgroundColor); + image = this.zr.toDataURL('image/' + imgType, this.option.backgroundColor && this.option.backgroundColor.replace(' ', '') === 'rgba(0,0,0,0)' ? '#fff' : this.option.backgroundColor); } else { image = this.myChart.getConnectedDataURL(imgType); @@ -769,7 +871,7 @@ Toolbox.prototype = { //downloadLink.onclick = _saveImageForIE; downloadLink.href = image; downloadLink.setAttribute('download', (saveOption.name ? saveOption.name : (this.option.title && (this.option.title.text || this.option.title.subtext)) ? (this.option.title.text || this.option.title.subtext) : 'ECharts') + '.' + imgType); - downloadLink.innerHTML = ''; + downloadLink.innerHTML = ''; downloadDiv.appendChild(downloadLink); document.body.appendChild(downloadDiv); @@ -807,17 +909,31 @@ Toolbox.prototype = { // 启用 this._magicType[itemName] = true; // 折柱互斥 - if (itemName == ecConfig.CHART_TYPE_LINE) { + if (itemName === ecConfig.CHART_TYPE_LINE) { this._magicType[ecConfig.CHART_TYPE_BAR] = false; } - else if (itemName == ecConfig.CHART_TYPE_BAR) { + else if (itemName === ecConfig.CHART_TYPE_BAR) { this._magicType[ecConfig.CHART_TYPE_LINE] = false; } + // 饼图漏斗互斥 + if (itemName === ecConfig.CHART_TYPE_PIE) { + this._magicType[ecConfig.CHART_TYPE_FUNNEL] = false; + } + else if (itemName === ecConfig.CHART_TYPE_FUNNEL) { + this._magicType[ecConfig.CHART_TYPE_PIE] = false; + } + // 力导和弦互斥 + if (itemName === ecConfig.CHART_TYPE_FORCE) { + this._magicType[ecConfig.CHART_TYPE_CHORD] = false; + } + else if (itemName === ecConfig.CHART_TYPE_CHORD) { + this._magicType[ecConfig.CHART_TYPE_FORCE] = false; + } // 堆积平铺互斥 - if (itemName == _MAGICTYPE_STACK) { + if (itemName === _MAGICTYPE_STACK) { this._magicType[_MAGICTYPE_TILED] = false; } - else if (itemName == _MAGICTYPE_TILED) { + else if (itemName === _MAGICTYPE_TILED) { this._magicType[_MAGICTYPE_STACK] = false; } this.messageCenter.dispatch( @@ -844,7 +960,7 @@ Toolbox.prototype = { var target = param.target.style.iconType; var featureHandler = this.option.toolbox.feature[target].onclick; if (typeof featureHandler === 'function') { - featureHandler(this.option); + featureHandler.call(this, this.option); } }, @@ -867,12 +983,12 @@ Toolbox.prototype = { oriType = newOption.series[len].type; if (this._magicMap[oriType]) { axis = newOption.xAxis instanceof Array ? newOption.xAxis[newOption.series[len].xAxisIndex || 0] : newOption.xAxis; - if (axis && (axis.type || 'category') == 'category') { - axis.__boundaryGap = typeof axis.boundaryGap != 'undefined' ? axis.boundaryGap : true; + if (axis && (axis.type || 'category') === 'category') { + axis.__boundaryGap = axis.boundaryGap != null ? axis.boundaryGap : true; } axis = newOption.yAxis instanceof Array ? newOption.yAxis[newOption.series[len].yAxisIndex || 0] : newOption.yAxis; - if (axis && axis.type == 'category') { - axis.__boundaryGap = typeof axis.boundaryGap != 'undefined' ? axis.boundaryGap : true; + if (axis && axis.type === 'category') { + axis.__boundaryGap = axis.boundaryGap != null ? axis.boundaryGap : true; } newOption.series[len].__type = oriType; // 避免不同类型图表类型的样式污染 @@ -898,8 +1014,8 @@ Toolbox.prototype = { // 框选缩放 var zoomOption = newOption.dataZoom; if (zoomOption && zoomOption.show) { - var start = typeof zoomOption.start != 'undefined' && zoomOption.start >= 0 && zoomOption.start <= 100 ? zoomOption.start : 0; - var end = typeof zoomOption.end != 'undefined' && zoomOption.end >= 0 && zoomOption.end <= 100 ? zoomOption.end : 100; + var start = zoomOption.start != null && zoomOption.start >= 0 && zoomOption.start <= 100 ? zoomOption.start : 0; + var end = zoomOption.end != null && zoomOption.end >= 0 && zoomOption.end <= 100 ? zoomOption.end : 100; if (start > end) { // 大小颠倒自动翻转 start = start + end; @@ -920,27 +1036,28 @@ Toolbox.prototype = { getMagicOption: function () { var axis; + var chartType; if (this._magicType[ecConfig.CHART_TYPE_LINE] || this._magicType[ecConfig.CHART_TYPE_BAR]) { - // 图表类型有切换 + // 图表类型有折柱切换 var boundaryGap = this._magicType[ecConfig.CHART_TYPE_LINE] ? false : true; for (var i = 0, l = this.option.series.length; i < l; i++) { - if (this._magicMap[this.option.series[i].type]) { - this.option.series[i].type = this._magicType[ecConfig.CHART_TYPE_LINE] ? ecConfig.CHART_TYPE_LINE : ecConfig.CHART_TYPE_BAR; - // 避免不同类型图表类型的样式污染 - this.option.series[i].itemStyle = zrUtil.clone( - this.option.series[i].__itemStyle); - + chartType = this.option.series[i].type; + if (chartType == ecConfig.CHART_TYPE_LINE || chartType == ecConfig.CHART_TYPE_BAR) { axis = this.option.xAxis instanceof Array ? this.option.xAxis[this.option.series[i].xAxisIndex || 0] : this.option.xAxis; - if (axis && (axis.type || 'category') == 'category') { + if (axis && (axis.type || 'category') === 'category') { axis.boundaryGap = boundaryGap ? true : axis.__boundaryGap; } axis = this.option.yAxis instanceof Array ? this.option.yAxis[this.option.series[i].yAxisIndex || 0] : this.option.yAxis; - if (axis && axis.type == 'category') { + if (axis && axis.type === 'category') { axis.boundaryGap = boundaryGap ? true : axis.__boundaryGap; } } } + + this._defaultMagic(ecConfig.CHART_TYPE_LINE, ecConfig.CHART_TYPE_BAR); } + this._defaultMagic(ecConfig.CHART_TYPE_CHORD, ecConfig.CHART_TYPE_FORCE); + this._defaultMagic(ecConfig.CHART_TYPE_PIE, ecConfig.CHART_TYPE_FUNNEL); if (this._magicType[_MAGICTYPE_STACK] || this._magicType[_MAGICTYPE_TILED]) { // 有堆积平铺切换 @@ -948,17 +1065,41 @@ Toolbox.prototype = { if (this._magicType[_MAGICTYPE_STACK]) { // 启用堆积 this.option.series[i].stack = '_ECHARTS_STACK_KENER_2014_'; + chartType = _MAGICTYPE_STACK; } else if (this._magicType[_MAGICTYPE_TILED]) { // 启用平铺 this.option.series[i].stack = null; + chartType = _MAGICTYPE_TILED; + } + if (this._featureOption[chartType + 'Chart']) { + zrUtil.merge( + this.option.series[i], this._featureOption[chartType + 'Chart'] || {}, true); } } } - return this.option; }, + _defaultMagic: function (cType1, cType2) { + if (this._magicType[cType1] || this._magicType[cType2]) { + for (var i = 0, l = this.option.series.length; i < l; i++) { + var chartType = this.option.series[i].type; + if (chartType == cType1 || chartType == cType2) { + this.option.series[i].type = this._magicType[cType1] ? cType1 : cType2; + // 避免不同类型图表类型的样式污染 + this.option.series[i].itemStyle = zrUtil.clone( + this.option.series[i].__itemStyle); + chartType = this.option.series[i].type; + if (this._featureOption[chartType + 'Chart']) { + zrUtil.merge( + this.option.series[i], this._featureOption[chartType + 'Chart'] || {}, true); + } + } + } + } + }, + silence: function (s) { this._isSilence = s; }, @@ -995,13 +1136,11 @@ Toolbox.prototype = { /** * 释放后实例不可用 */ - dispose: function () { + onbeforDispose: function () { if (this._dataView) { this._dataView.dispose(); this._dataView = null; } - this.clear(); - this.shapeList = null; this._markShapeList = null; }, @@ -1014,9 +1153,6 @@ Toolbox.prototype = { this._resetZoom(); newOption.toolbox = this.reformOption(newOption.toolbox); - // 补全padding属性 - newOption.toolbox.padding = this.reformCssArray( - newOption.toolbox.padding); this.option = newOption; this.clear(true); diff --git a/src/component/tooltip.js b/src/component/tooltip.js index d63b2a1..71ac4a7 100644 --- a/src/component/tooltip.js +++ b/src/component/tooltip.js @@ -2,7 +2,7 @@ * echarts组件:提示框 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ @@ -15,6 +15,65 @@ var RectangleShape = require('../zrender/shape/Rectangle.js'); var rectangleInstance = new RectangleShape({}); var ecConfig = require('../config.js'); +// 提示框 +ecConfig.tooltip = { + zlevel: 1, + // 一级层叠,频繁变化的tooltip指示器在pc上独立一层 + z: 8, + // 二级层叠 + show: true, + showContent: true, + // tooltip主体内容 + trigger: 'item', + // 触发类型,默认数据触发,见下图,可选为:'item' ¦ 'axis' + // position: null // 位置 {Array} | {Function} + // formatter: null // 内容格式器:{string}(Template) ¦ {Function} + islandFormatter: '{a}
{b} : {c}', + // 数据孤岛内容格式器 + showDelay: 20, + // 显示延迟,添加显示延迟可以避免频繁切换,单位ms + hideDelay: 100, + // 隐藏延迟,单位ms + transitionDuration: 0.4, + // 动画变换时间,单位s + enterable: false, + backgroundColor: 'rgba(0,0,0,0.7)', + // 提示背景颜色,默认为透明度为0.7的黑色 + borderColor: '#333', + // 提示边框颜色 + borderRadius: 4, + // 提示边框圆角,单位px,默认为4 + borderWidth: 0, + // 提示边框线宽,单位px,默认为0(无边框) + padding: 5, + // 提示内边距,单位px,默认各方向内边距为5, + // 接受数组分别设定上右下左边距,同css + axisPointer: { // 坐标轴指示器,坐标轴触发有效 + type: 'line', + // 默认为直线,可选为:'line' | 'shadow' | 'cross' + lineStyle: { // 直线指示器样式设置 + color: '#48b', + width: 2, + type: 'solid' + }, + crossStyle: { + color: '#1e90ff', + width: 1, + type: 'dashed' + }, + shadowStyle: { // 阴影指示器样式设置 + color: 'rgba(150,150,150,0.3)', + // 阴影颜色 + width: 'auto', + // 阴影大小 + type: 'default' + } + }, + textStyle: { + color: '#fff' + } +}; + var ecData = require('../util/ecData.js'); var zrConfig = require('../zrender/config.js'); var zrEvent = require('../zrender/tool/event.js'); @@ -67,12 +126,20 @@ function Tooltip(ecTheme, messageCenter, zr, option, myChart) { this._tDom.onselectstart = function () { return false; }; + this._tDom.onmouseover = function () { + self._mousein = true; + }; + this._tDom.onmouseout = function () { + self._mousein = false; + }; + this._tDom.className = 'echarts-tooltip'; this._tDom.style.position = 'absolute'; // 不是多余的,别删! this.hasAppend = false; this._axisLineShape && this.zr.delShape(this._axisLineShape.id); this._axisLineShape = new LineShape({ - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), invisible: true, hoverable: false }); @@ -81,7 +148,8 @@ function Tooltip(ecTheme, messageCenter, zr, option, myChart) { this._axisShadowShape && this.zr.delShape(this._axisShadowShape.id); this._axisShadowShape = new LineShape({ - zlevel: 1, + zlevel: this.getZlevelBase(), + z: 1, // grid上,chart下 invisible: true, hoverable: false @@ -91,7 +159,8 @@ function Tooltip(ecTheme, messageCenter, zr, option, myChart) { this._axisCrossShape && this.zr.delShape(this._axisCrossShape.id); this._axisCrossShape = new CrossShape({ - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), invisible: true, hoverable: false }); @@ -105,7 +174,7 @@ function Tooltip(ecTheme, messageCenter, zr, option, myChart) { Tooltip.prototype = { type: ecConfig.COMPONENT_TYPE_TOOLTIP, // 通用样式 - _gCssText: 'position:absolute;' + 'display:block;' + 'border-style:solid;' + 'white-space:nowrap;', + _gCssText: 'position:absolute;display:block;border-style:solid;white-space:nowrap;', /** * 根据配置设置dom样式 */ @@ -130,15 +199,15 @@ Tooltip.prototype = { cssText.push('background-Color:' + opt.backgroundColor); } - if (typeof opt.borderWidth != 'undefined') { + if (opt.borderWidth != null) { cssText.push('border-width:' + opt.borderWidth + 'px'); } - if (typeof opt.borderColor != 'undefined') { + if (opt.borderColor != null) { cssText.push('border-color:' + opt.borderColor); } - if (typeof opt.borderRadius != 'undefined') { + if (opt.borderRadius != null) { cssText.push('border-radius:' + opt.borderRadius + 'px'); cssText.push('-moz-border-radius:' + opt.borderRadius + 'px'); cssText.push('-webkit-border-radius:' + opt.borderRadius + 'px'); @@ -159,7 +228,7 @@ Tooltip.prototype = { var padding = opt.padding; - if (typeof padding != 'undefined') { + if (padding != null) { padding = this.reformCssArray(padding); cssText.push('padding:' + padding[0] + 'px ' + padding[1] + 'px ' + padding[2] + 'px ' + padding[3] + 'px'); } @@ -170,6 +239,9 @@ Tooltip.prototype = { }, __hide: function () { + this._lastDataIndex = -1; + this._lastSeriesIndex = -1; + this._lastItemTriggerId = -1; if (this._tDom) { this._tDom.style.display = 'none'; } @@ -194,7 +266,7 @@ Tooltip.prototype = { this._lastTipShape = false; this.shapeList.length = 2; } - needRefresh && this.zr.refresh(); + needRefresh && this.zr.refreshNextFrame(); this.showing = false; }, @@ -202,7 +274,7 @@ Tooltip.prototype = { var domHeight = this._tDom.offsetHeight; var domWidth = this._tDom.offsetWidth; if (position) { - if (typeof position == 'function') { + if (typeof position === 'function') { position = position([x, y]); } if (position instanceof Array) { @@ -258,14 +330,14 @@ Tooltip.prototype = { } else { // 数据项事件 - if (this._curTarget._type == 'island' && this.option.tooltip.show) { + if (this._curTarget._type === 'island' && this.option.tooltip.show) { this._showItemTrigger(); return; } var serie = ecData.get(this._curTarget, 'series'); var data = ecData.get(this._curTarget, 'data'); needShow = this.deepQuery([data, serie, this.option], 'tooltip.show'); - if (typeof serie == 'undefined' || typeof data == 'undefined' || needShow === false) { + if (serie == null || data == null || !needShow) { // 不响应tooltip的数据对象延时隐藏 clearTimeout(this._hidingTicket); clearTimeout(this._showingTicket); @@ -274,7 +346,7 @@ Tooltip.prototype = { else { trigger = this.deepQuery([data, serie, this.option], 'tooltip.trigger'); - trigger == 'axis' ? this._showAxisTrigger( + trigger === 'axis' ? this._showAxisTrigger( serie.xAxisIndex, serie.yAxisIndex, ecData.get(this._curTarget, 'dataIndex')) : this._showItemTrigger(); } } @@ -293,15 +365,15 @@ Tooltip.prototype = { var yAxisIndex; for (var i = 0, l = series.length; i < l; i++) { // 找到第一个axis触发tooltip的系列 - if (this.deepQuery([series[i], this.option], 'tooltip.trigger') == 'axis') { + if (this.deepQuery([series[i], this.option], 'tooltip.trigger') === 'axis') { xAxisIndex = series[i].xAxisIndex || 0; yAxisIndex = series[i].yAxisIndex || 0; - if (this.component.xAxis.getAxis(xAxisIndex) && this.component.xAxis.getAxis(xAxisIndex).type == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY) { + if (this.component.xAxis.getAxis(xAxisIndex) && this.component.xAxis.getAxis(xAxisIndex).type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY) { // 横轴为类目轴 this._showAxisTrigger(xAxisIndex, yAxisIndex, this._getNearestDataIndex('x', this.component.xAxis.getAxis(xAxisIndex))); return; } - else if (this.component.yAxis.getAxis(yAxisIndex) && this.component.yAxis.getAxis(yAxisIndex).type == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY) { + else if (this.component.yAxis.getAxis(yAxisIndex) && this.component.yAxis.getAxis(yAxisIndex).type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY) { // 纵轴为类目轴 this._showAxisTrigger(xAxisIndex, yAxisIndex, this._getNearestDataIndex('y', this.component.yAxis.getAxis(yAxisIndex))); return; @@ -313,7 +385,7 @@ Tooltip.prototype = { } } } - if (this.option.tooltip.axisPointer.type == 'cross') { + if (this.option.tooltip.axisPointer.type === 'cross') { this._showAxisTrigger(-1, -1, -1); } }, @@ -351,28 +423,31 @@ Tooltip.prototype = { var dataIndex = -1; var x = zrEvent.getX(this._event); var y = zrEvent.getY(this._event); - if (direction == 'x') { + if (direction === 'x') { // 横轴为类目轴 var left; var right; var xEnd = this.component.grid.getXend(); var curCoord = categoryAxis.getCoordByIndex(dataIndex); while (curCoord < xEnd) { + right = curCoord; if (curCoord <= x) { left = curCoord; } - if (curCoord >= x) { + else { break; } curCoord = categoryAxis.getCoordByIndex(++dataIndex); - right = curCoord; } - if (x - left < right - x) { - dataIndex -= dataIndex !== 0 ? 1 : 0; + if (dataIndex <= 0) { + dataIndex = 0; + } + else if (x - left <= right - x) { + dataIndex -= 1; } else { // 离右边近,看是否为最后一个 - if (typeof categoryAxis.getNameByIndex(dataIndex) == 'undefined') { + if (categoryAxis.getNameByIndex(dataIndex) == null) { dataIndex -= 1; } } @@ -385,22 +460,25 @@ Tooltip.prototype = { var yStart = this.component.grid.getY(); var curCoord = categoryAxis.getCoordByIndex(dataIndex); while (curCoord > yStart) { + top = curCoord; if (curCoord >= y) { bottom = curCoord; } - if (curCoord <= y) { + else { break; } curCoord = categoryAxis.getCoordByIndex(++dataIndex); - top = curCoord; } - if (y - top > bottom - y) { - dataIndex -= dataIndex !== 0 ? 1 : 0; + if (dataIndex <= 0) { + dataIndex = 0; + } + else if (y - top >= bottom - y) { + dataIndex -= 1; } else { // 离上方边近,看是否为最后一个 - if (typeof categoryAxis.getNameByIndex(dataIndex) == 'undefined') { + if (categoryAxis.getNameByIndex(dataIndex) == null) { dataIndex -= 1; } } @@ -415,7 +493,7 @@ Tooltip.prototype = { _showAxisTrigger: function (xAxisIndex, yAxisIndex, dataIndex) { !this._event.connectTrigger && this.messageCenter.dispatch( ecConfig.EVENT.TOOLTIP_IN_GRID, this._event, null, this.myChart); - if (typeof this.component.xAxis == 'undefined' || typeof this.component.yAxis == 'undefined' || typeof xAxisIndex == 'undefined' || typeof yAxisIndex == 'undefined' + if (this.component.xAxis == null || this.component.yAxis == null || xAxisIndex == null || yAxisIndex == null // || dataIndex < 0 ) { // 不响应tooltip的数据对象延时隐藏 @@ -428,77 +506,72 @@ Tooltip.prototype = { var seriesArray = []; var seriesIndex = []; var categoryAxis; - var x; - var y; var formatter; var position; var showContent; var specialCssText = ''; - if (this.option.tooltip.trigger == 'axis') { - if (this.option.tooltip.show === false) { + if (this.option.tooltip.trigger === 'axis') { + if (!this.option.tooltip.show) { return; } formatter = this.option.tooltip.formatter; position = this.option.tooltip.position; } - if (xAxisIndex != -1 && this.component.xAxis.getAxis(xAxisIndex).type == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY) { - // 横轴为类目轴,找到所有用这条横轴并且axis触发的系列数据 - categoryAxis = this.component.xAxis.getAxis(xAxisIndex); + var axisLayout = xAxisIndex != -1 && this.component.xAxis.getAxis(xAxisIndex).type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY ? 'xAxis' // 横轴为类目轴,找到所有用这条横轴并且axis触发的系列数据 + : yAxisIndex != -1 && this.component.yAxis.getAxis(yAxisIndex).type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY ? 'yAxis' // 纵轴为类目轴,找到所有用这条纵轴并且axis触发的系列数据 + : false; + var x; + var y; + if (axisLayout) { + var axisIndex = axisLayout == 'xAxis' ? xAxisIndex : yAxisIndex; + categoryAxis = this.component[axisLayout].getAxis(axisIndex); for (var i = 0, l = series.length; i < l; i++) { if (!this._isSelected(series[i].name)) { continue; } - if (series[i].xAxisIndex == xAxisIndex && this.deepQuery([series[i], this.option], 'tooltip.trigger') == 'axis') { + if (series[i][axisLayout + 'Index'] === axisIndex && this.deepQuery([series[i], this.option], 'tooltip.trigger') === 'axis') { showContent = this.query(series[i], 'tooltip.showContent') || showContent; formatter = this.query(series[i], 'tooltip.formatter') || formatter; position = this.query(series[i], 'tooltip.position') || position; specialCssText += this._style(this.query(series[i], 'tooltip')); - seriesArray.push(series[i]); - seriesIndex.push(i); + if (series[i].stack != null && axisLayout == 'xAxis') { + seriesArray.unshift(series[i]); + seriesIndex.unshift(i); + } + else { + seriesArray.push(series[i]); + seriesIndex.push(i); + } } } + // 寻找高亮元素 this.messageCenter.dispatch( ecConfig.EVENT.TOOLTIP_HOVER, this._event, { seriesIndex: seriesIndex, dataIndex: dataIndex }, this.myChart); - y = zrEvent.getY(this._event); - x = this.subPixelOptimize( - categoryAxis.getCoordByIndex(dataIndex), this._axisLineWidth); - this._styleAxisPointer( - seriesArray, x, this.component.grid.getY(), x, this.component.grid.getYend(), categoryAxis.getGap(), x, y); - } - else if (yAxisIndex != -1 && this.component.yAxis.getAxis(yAxisIndex).type == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY) { - // 纵轴为类目轴,找到所有用这条纵轴并且axis触发的系列数据 - categoryAxis = this.component.yAxis.getAxis(yAxisIndex); - for (var i = 0, l = series.length; i < l; i++) { - if (!this._isSelected(series[i].name)) { - continue; - } - if (series[i].yAxisIndex == yAxisIndex && this.deepQuery([series[i], this.option], 'tooltip.trigger') == 'axis') { - showContent = this.query(series[i], 'tooltip.showContent') || showContent; - formatter = this.query(series[i], 'tooltip.formatter') || formatter; - position = this.query(series[i], 'tooltip.position') || position; - specialCssText += this._style(this.query(series[i], 'tooltip')); - seriesArray.push(series[i]); - seriesIndex.push(i); - } + + var rect; + if (axisLayout == 'xAxis') { + x = this.subPixelOptimize( + categoryAxis.getCoordByIndex(dataIndex), this._axisLineWidth); + y = zrEvent.getY(this._event); + rect = [ + x, this.component.grid.getY(), x, this.component.grid.getYend()]; + } + else { + x = zrEvent.getX(this._event); + y = this.subPixelOptimize( + categoryAxis.getCoordByIndex(dataIndex), this._axisLineWidth); + rect = [ + this.component.grid.getX(), y, this.component.grid.getXend(), y]; } - // 寻找高亮元素 - this.messageCenter.dispatch( - ecConfig.EVENT.TOOLTIP_HOVER, this._event, { - seriesIndex: seriesIndex, - dataIndex: dataIndex - }, this.myChart); - x = zrEvent.getX(this._event); - y = this.subPixelOptimize( - categoryAxis.getCoordByIndex(dataIndex), this._axisLineWidth); this._styleAxisPointer( - seriesArray, this.component.grid.getX(), y, this.component.grid.getXend(), y, categoryAxis.getGap(), x, y); + seriesArray, rect[0], rect[1], rect[2], rect[3], categoryAxis.getGap(), x, y); } else { // 双数值轴 @@ -507,7 +580,7 @@ Tooltip.prototype = { this._styleAxisPointer( series, this.component.grid.getX(), y, this.component.grid.getXend(), y, 0, x, y); if (dataIndex >= 0) { - this._showItemTrigger(); + this._showItemTrigger(true); } else { clearTimeout(this._hidingTicket); @@ -517,46 +590,67 @@ Tooltip.prototype = { } if (seriesArray.length > 0) { - var data; - if (typeof formatter == 'function') { - var params = []; - for (var i = 0, l = seriesArray.length; i < l; i++) { - data = seriesArray[i].data[dataIndex]; - data = typeof data != 'undefined' ? (typeof data.value != 'undefined' ? data.value : data) : '-'; - - params.push([ - seriesArray[i].name || '', categoryAxis.getNameByIndex(dataIndex), data]); + // 复位item trigger和axis trigger间短距离来回变换时的不响应 + this._lastItemTriggerId = -1; + // 相同dataIndex seriesIndex时不再触发内容更新 + if (this._lastDataIndex != dataIndex || this._lastSeriesIndex != seriesIndex[0]) { + this._lastDataIndex = dataIndex; + this._lastSeriesIndex = seriesIndex[0]; + var data; + var value; + if (typeof formatter === 'function') { + var params = []; + for (var i = 0, l = seriesArray.length; i < l; i++) { + data = seriesArray[i].data[dataIndex]; + value = this.getDataFromOption(data, '-'); + + params.push({ + seriesIndex: seriesIndex[i], + seriesName: seriesArray[i].name || '', + series: seriesArray[i], + dataIndex: dataIndex, + data: data, + name: categoryAxis.getNameByIndex(dataIndex), + value: value, + // 向下兼容 + 0: seriesArray[i].name || '', + 1: categoryAxis.getNameByIndex(dataIndex), + 2: value, + 3: data + }); + } + this._curTicket = 'axis:' + dataIndex; + this._tDom.innerHTML = formatter.call( + this.myChart, params, this._curTicket, this._setContent); } - this._curTicket = 'axis:' + dataIndex; - this._tDom.innerHTML = formatter.call( - this.myChart, params, this._curTicket, this._setContent); - } - else if (typeof formatter == 'string') { - this._curTicket = NaN; - formatter = formatter.replace('{a}', '{a0}').replace('{b}', '{b0}').replace('{c}', '{c0}'); - for (var i = 0, l = seriesArray.length; i < l; i++) { - formatter = formatter.replace('{a' + i + '}', this._encodeHTML(seriesArray[i].name || '')); - formatter = formatter.replace('{b' + i + '}', this._encodeHTML(categoryAxis.getNameByIndex(dataIndex))); - data = seriesArray[i].data[dataIndex]; - data = typeof data != 'undefined' ? (typeof data.value != 'undefined' ? data.value : data) : '-'; - formatter = formatter.replace('{c' + i + '}', data instanceof Array ? data : this.numAddCommas(data)); + else if (typeof formatter === 'string') { + this._curTicket = NaN; + formatter = formatter.replace('{a}', '{a0}').replace('{b}', '{b0}').replace('{c}', '{c0}'); + for (var i = 0, l = seriesArray.length; i < l; i++) { + formatter = formatter.replace('{a' + i + '}', this._encodeHTML(seriesArray[i].name || '')); + formatter = formatter.replace('{b' + i + '}', this._encodeHTML(categoryAxis.getNameByIndex(dataIndex))); + data = seriesArray[i].data[dataIndex]; + data = this.getDataFromOption(data, '-'); + formatter = formatter.replace('{c' + i + '}', data instanceof Array ? data : this.numAddCommas(data)); + } + this._tDom.innerHTML = formatter; } - this._tDom.innerHTML = formatter; - } - else { - this._curTicket = NaN; - formatter = this._encodeHTML( - categoryAxis.getNameByIndex(dataIndex)); - - for (var i = 0, l = seriesArray.length; i < l; i++) { - formatter += '
' + this._encodeHTML(seriesArray[i].name || '') + ' : '; - data = seriesArray[i].data[dataIndex]; - data = typeof data != 'undefined' ? (typeof data.value != 'undefined' ? data.value : data) : '-'; - formatter += data instanceof Array ? data : this.numAddCommas(data); + else { + this._curTicket = NaN; + formatter = this._encodeHTML( + categoryAxis.getNameByIndex(dataIndex)); + + for (var i = 0, l = seriesArray.length; i < l; i++) { + formatter += '
' + this._encodeHTML(seriesArray[i].name || '') + ' : '; + data = seriesArray[i].data[dataIndex]; + data = this.getDataFromOption(data, '-'); + formatter += data instanceof Array ? data : this.numAddCommas(data); + } + this._tDom.innerHTML = formatter; } - this._tDom.innerHTML = formatter; } + // don't modify, just false, showContent == undefined == true if (showContent === false || !this.option.tooltip.showContent) { // 只用tooltip的行为,不显示主体 return; @@ -576,18 +670,19 @@ Tooltip.prototype = { * 极坐标 */ _showPolarTrigger: function (polarIndex, dataIndex) { - if (typeof this.component.polar == 'undefined' || typeof polarIndex == 'undefined' || typeof dataIndex == 'undefined' || dataIndex < 0) { + if (this.component.polar == null || polarIndex == null || dataIndex == null || dataIndex < 0) { return false; } var series = this.option.series; var seriesArray = []; + var seriesIndex = []; var formatter; var position; var showContent; var specialCssText = ''; - if (this.option.tooltip.trigger == 'axis') { - if (this.option.tooltip.show === false) { + if (this.option.tooltip.trigger === 'axis') { + if (!this.option.tooltip.show) { return false; } formatter = this.option.tooltip.formatter; @@ -600,17 +695,19 @@ Tooltip.prototype = { if (!this._isSelected(series[i].name)) { continue; } - if (series[i].polarIndex == polarIndex && this.deepQuery([series[i], this.option], 'tooltip.trigger') == 'axis') { + if (series[i].polarIndex === polarIndex && this.deepQuery([series[i], this.option], 'tooltip.trigger') === 'axis') { showContent = this.query(series[i], 'tooltip.showContent') || showContent; formatter = this.query(series[i], 'tooltip.formatter') || formatter; position = this.query(series[i], 'tooltip.position') || position; specialCssText += this._style(this.query(series[i], 'tooltip')); seriesArray.push(series[i]); + seriesIndex.push(i); } } if (seriesArray.length > 0) { var polarData; var data; + var value; var params = []; for (var i = 0, l = seriesArray.length; i < l; i++) { @@ -620,44 +717,66 @@ Tooltip.prototype = { if (!this._isSelected(data.name)) { continue; } - data = typeof data != 'undefined' ? data : { + data = data != null ? data : { name: '', value: { dataIndex: '-' } }; - - params.push([ - seriesArray[i].name || '', data.name, typeof data.value[dataIndex].value != 'undefined' ? data.value[dataIndex].value : data.value[dataIndex], indicatorName]); + value = this.getDataFromOption(data.value[dataIndex]); + params.push({ + seriesIndex: seriesIndex[i], + seriesName: seriesArray[i].name || '', + series: seriesArray[i], + dataIndex: dataIndex, + data: data, + name: data.name, + indicator: indicatorName, + value: value, + // 向下兼容 + 0: seriesArray[i].name || '', + 1: data.name, + 2: value, + 3: indicatorName + }); } } if (params.length <= 0) { return; } - if (typeof formatter == 'function') { - this._curTicket = 'axis:' + dataIndex; - this._tDom.innerHTML = formatter.call( - this.myChart, params, this._curTicket, this._setContent); - } - else if (typeof formatter == 'string') { - formatter = formatter.replace('{a}', '{a0}').replace('{b}', '{b0}').replace('{c}', '{c0}').replace('{d}', '{d0}'); - for (var i = 0, l = params.length; i < l; i++) { - formatter = formatter.replace('{a' + i + '}', this._encodeHTML(params[i][0])); - formatter = formatter.replace('{b' + i + '}', this._encodeHTML(params[i][1])); - formatter = formatter.replace('{c' + i + '}', this.numAddCommas(params[i][2])); - formatter = formatter.replace('{d' + i + '}', this._encodeHTML(params[i][3])); + // 复位item trigger和axis trigger间短距离来回变换时的不响应 + this._lastItemTriggerId = -1; + + // 相同dataIndex seriesIndex时不再触发内容更新 + if (this._lastDataIndex != dataIndex || this._lastSeriesIndex != seriesIndex[0]) { + this._lastDataIndex = dataIndex; + this._lastSeriesIndex = seriesIndex[0]; + if (typeof formatter === 'function') { + this._curTicket = 'axis:' + dataIndex; + this._tDom.innerHTML = formatter.call( + this.myChart, params, this._curTicket, this._setContent); } - this._tDom.innerHTML = formatter; - } - else { - formatter = this._encodeHTML(params[0][1]) + '
' + this._encodeHTML(params[0][3]) + ' : ' + this.numAddCommas(params[0][2]); - for (var i = 1, l = params.length; i < l; i++) { - formatter += '
' + this._encodeHTML(params[i][1]) + '
'; - formatter += this._encodeHTML(params[i][3]) + ' : ' + this.numAddCommas(params[i][2]); + else if (typeof formatter === 'string') { + formatter = formatter.replace('{a}', '{a0}').replace('{b}', '{b0}').replace('{c}', '{c0}').replace('{d}', '{d0}'); + for (var i = 0, l = params.length; i < l; i++) { + formatter = formatter.replace('{a' + i + '}', this._encodeHTML(params[i].seriesName)); + formatter = formatter.replace('{b' + i + '}', this._encodeHTML(params[i].name)); + formatter = formatter.replace('{c' + i + '}', this.numAddCommas(params[i].value)); + formatter = formatter.replace('{d' + i + '}', this._encodeHTML(params[i].indicator)); + } + this._tDom.innerHTML = formatter; + } + else { + formatter = this._encodeHTML(params[0].name) + '
' + this._encodeHTML(params[0].indicator) + ' : ' + this.numAddCommas(params[0].value); + for (var i = 1, l = params.length; i < l; i++) { + formatter += '
' + this._encodeHTML(params[i].name) + '
'; + formatter += this._encodeHTML(params[i].indicator) + ' : ' + this.numAddCommas(params[i].value); + } + this._tDom.innerHTML = formatter; } - this._tDom.innerHTML = formatter; } + // don't modify, just false, showContent == undefined == true if (showContent === false || !this.option.tooltip.showContent) { // 只用tooltip的行为,不显示主体 return; @@ -675,31 +794,36 @@ Tooltip.prototype = { } }, - _showItemTrigger: function () { + /** + * @parma {boolean} axisTrigger + */ + _showItemTrigger: function (axisTrigger) { if (!this._curTarget) { return; } var serie = ecData.get(this._curTarget, 'series'); + var seriesIndex = ecData.get(this._curTarget, 'seriesIndex'); var data = ecData.get(this._curTarget, 'data'); + var dataIndex = ecData.get(this._curTarget, 'dataIndex'); var name = ecData.get(this._curTarget, 'name'); var value = ecData.get(this._curTarget, 'value'); var special = ecData.get(this._curTarget, 'special'); var special2 = ecData.get(this._curTarget, 'special2'); + var queryTarget = [data, serie, this.option]; // 从低优先级往上找到trigger为item的formatter和样式 var formatter; var position; var showContent; var specialCssText = ''; - var indicator; - var html = ''; if (this._curTarget._type != 'island') { // 全局 - if (this.option.tooltip.trigger == 'item') { + var trigger = axisTrigger ? 'axis' : 'item'; + if (this.option.tooltip.trigger === trigger) { formatter = this.option.tooltip.formatter; position = this.option.tooltip.position; } // 系列 - if (this.query(serie, 'tooltip.trigger') == 'item') { + if (this.query(serie, 'tooltip.trigger') === trigger) { showContent = this.query(serie, 'tooltip.showContent') || showContent; formatter = this.query(serie, 'tooltip.formatter') || formatter; position = this.query(serie, 'tooltip.position') || position; @@ -712,66 +836,86 @@ Tooltip.prototype = { specialCssText += this._style(this.query(data, 'tooltip')); } else { - showContent = this.deepQuery([data, serie, this.option], 'tooltip.showContent'); - formatter = this.deepQuery([data, serie, this.option], 'tooltip.islandFormatter'); - position = this.deepQuery([data, serie, this.option], 'tooltip.islandPosition'); + this._lastItemTriggerId = NaN; + showContent = this.deepQuery(queryTarget, 'tooltip.showContent'); + formatter = this.deepQuery(queryTarget, 'tooltip.islandFormatter'); + position = this.deepQuery(queryTarget, 'tooltip.islandPosition'); } - if (typeof formatter == 'function') { - this._curTicket = (serie.name || '') + ':' + ecData.get(this._curTarget, 'dataIndex'); - this._tDom.innerHTML = formatter.call( - this.myChart, [ - serie.name || '', name, value, special, special2, data], this._curTicket, this._setContent); - } - else if (typeof formatter == 'string') { - this._curTicket = NaN; - formatter = formatter.replace('{a}', '{a0}').replace('{b}', '{b0}').replace('{c}', '{c0}'); - formatter = formatter.replace('{a0}', this._encodeHTML(serie.name || '')).replace('{b0}', this._encodeHTML(name)).replace('{c0}', value instanceof Array ? value : this.numAddCommas(value)); + // 复位item trigger和axis trigger间短距离来回变换时的不响应 + this._lastDataIndex = -1; + this._lastSeriesIndex = -1; - formatter = formatter.replace('{d}', '{d0}').replace('{d0}', special || ''); - formatter = formatter.replace('{e}', '{e0}').replace('{e0}', ecData.get(this._curTarget, 'special2') || ''); + // 相同dataIndex seriesIndex时不再触发内容更新 + if (this._lastItemTriggerId !== this._curTarget.id) { + this._lastItemTriggerId = this._curTarget.id; + if (typeof formatter === 'function') { + this._curTicket = (serie.name || '') + ':' + dataIndex; + this._tDom.innerHTML = formatter.call( + this.myChart, { + seriesIndex: seriesIndex, + seriesName: serie.name || '', + series: serie, + dataIndex: dataIndex, + data: data, + name: name, + value: value, + percent: special, + // 饼图 + indicator: special, + // 雷达图 + value2: special2, + indicator2: special2, + // 向下兼容 + 0: serie.name || '', + 1: name, + 2: value, + 3: special, + 4: special2, + 5: data, + 6: seriesIndex, + 7: dataIndex + }, this._curTicket, this._setContent); + } + else if (typeof formatter === 'string') { + this._curTicket = NaN; + formatter = formatter.replace('{a}', '{a0}').replace('{b}', '{b0}').replace('{c}', '{c0}'); + formatter = formatter.replace('{a0}', this._encodeHTML(serie.name || '')).replace('{b0}', this._encodeHTML(name)).replace('{c0}', value instanceof Array ? value : this.numAddCommas(value)); - this._tDom.innerHTML = formatter; - } - else { - this._curTicket = NaN; - if (serie.type == ecConfig.CHART_TYPE_SCATTER) { - this._tDom.innerHTML = (typeof serie.name != 'undefined' ? (this._encodeHTML(serie.name) + '
') : '') + (name === '' ? '' : (this._encodeHTML(name) + ' : ')) + value + (typeof special == 'undefined' ? '' : (' (' + special + ')')); + formatter = formatter.replace('{d}', '{d0}').replace('{d0}', special || ''); + formatter = formatter.replace('{e}', '{e0}').replace('{e0}', ecData.get(this._curTarget, 'special2') || ''); + + this._tDom.innerHTML = formatter; } - else if (serie.type == ecConfig.CHART_TYPE_RADAR && special) { - indicator = special; - html += this._encodeHTML(name === '' ? (serie.name || '') : name); - html += html === '' ? '' : '
'; - for (var i = 0; i < indicator.length; i++) { - html += this._encodeHTML(indicator[i].text) + ' : ' + this.numAddCommas(value[i]) + '
'; + else { + this._curTicket = NaN; + if (serie.type === ecConfig.CHART_TYPE_RADAR && special) { + this._tDom.innerHTML = this._itemFormatter.radar.call( + this, serie, name, value, special); } - this._tDom.innerHTML = html; - } - else if (serie.type == ecConfig.CHART_TYPE_CHORD) { - if (typeof special2 == 'undefined') { - // 外环上 - this._tDom.innerHTML = this._encodeHTML(name) + ' (' + this.numAddCommas(value) + ')'; + // chord 处理暂时跟 force 一样 + // else if (serie.type === ecConfig.CHART_TYPE_CHORD) { + // this._tDom.innerHTML = this._itemFormatter.chord.call( + // this, serie, name, value, special, special2 + // ); + // } + else if (serie.type === ecConfig.CHART_TYPE_EVENTRIVER) { + this._tDom.innerHTML = this._itemFormatter.eventRiver.call( + this, serie, name, value, data); } else { - var name1 = this._encodeHTML(name); - var name2 = this._encodeHTML(special); - // 内部弦上 - this._tDom.innerHTML = (typeof serie.name != 'undefined' ? (this._encodeHTML(serie.name) + '
') : '') + name1 + ' -> ' + name2 + ' (' + this.numAddCommas(value) + ')' + '
' + name2 + ' -> ' + name1 + ' (' + this.numAddCommas(special2) + ')'; + this._tDom.innerHTML = '' + (serie.name != null ? (this._encodeHTML(serie.name) + '
') : '') + (name === '' ? '' : (this._encodeHTML(name) + ' : ')) + (value instanceof Array ? value : this.numAddCommas(value)); } } - else { - this._tDom.innerHTML = (typeof serie.name != 'undefined' ? (this._encodeHTML(serie.name) + '
') : '') + this._encodeHTML(name) + ' : ' + this.numAddCommas(value) + (typeof special == 'undefined' ? '' : (' (' + this.numAddCommas(special) + ')')); - } } - if (!this._axisLineShape.invisible || !this._axisShadowShape.invisible) { - this._axisLineShape.invisible = true; - this.zr.modShape(this._axisLineShape.id); - this._axisShadowShape.invisible = true; - this.zr.modShape(this._axisShadowShape.id); - this.zr.refresh(); + var x = zrEvent.getX(this._event); + var y = zrEvent.getY(this._event); + if (this.deepQuery(queryTarget, 'tooltip.axisPointer.show') && this.component.grid) { + this._styleAxisPointer([serie], this.component.grid.getX(), y, this.component.grid.getXend(), y, 0, x, y); } + // don't modify, just false, showContent == undefined == true if (showContent === false || !this.option.tooltip.showContent) { // 只用tooltip的行为,不显示主体 return; @@ -784,8 +928,52 @@ Tooltip.prototype = { this.hasAppend = true; } - this._show( - position, zrEvent.getX(this._event) + 20, zrEvent.getY(this._event) - 20, specialCssText); + this._show(position, x + 20, y - 20, specialCssText); + }, + + _itemFormatter: { + radar: function (serie, name, value, indicator) { + var html = ''; + html += this._encodeHTML(name === '' ? (serie.name || '') : name); + html += html === '' ? '' : '
'; + for (var i = 0; i < indicator.length; i++) { + html += this._encodeHTML(indicator[i].text) + ' : ' + this.numAddCommas(value[i]) + '
'; + } + return html; + }, + chord: function (serie, name, value, special, special2) { + if (special2 == null) { + // 外环上 + return this._encodeHTML(name) + ' (' + this.numAddCommas(value) + ')'; + } + else { + var name1 = this._encodeHTML(name); + var name2 = this._encodeHTML(special); + // 内部弦上 + return '' + (serie.name != null ? (this._encodeHTML(serie.name) + '
') : '') + name1 + ' -> ' + name2 + ' (' + this.numAddCommas(value) + ')' + '
' + name2 + ' -> ' + name1 + ' (' + this.numAddCommas(special2) + ')'; + } + }, + eventRiver: function (serie, name, value, data) { + var html = ''; + html += this._encodeHTML(serie.name === '' ? '' : (serie.name + ' : ')); + html += this._encodeHTML(name); + html += html === '' ? '' : '
'; + data = data.evolution; + for (var i = 0, l = data.length; i < l; i++) { + html += '
'; + if (!data[i].detail) { + continue; + } + if (data[i].detail.img) { + html += ''; + } + html += '
' + data[i].time + '
'; + html += ''; + html += data[i].detail.text + '
'; + html += '
'; + } + return html; + } }, /** @@ -808,44 +996,47 @@ Tooltip.prototype = { style[pType].type = axisPointer[pType + 'Style'].type; } for (var i = 0, l = seriesArray.length; i < l; i++) { - if (this.deepQuery([seriesArray[i], this.option], 'tooltip.trigger') == 'axis') { - queryTarget = seriesArray[i]; - curType = this.query(queryTarget, 'tooltip.axisPointer.type'); - pointType = curType || pointType; - if (curType) { - style[curType].color = this.query( - queryTarget, 'tooltip.axisPointer.' + curType + 'Style.color') || style[curType].color; - style[curType].width = this.query( - queryTarget, 'tooltip.axisPointer.' + curType + 'Style.width') || style[curType].width; - style[curType].type = this.query( - queryTarget, 'tooltip.axisPointer.' + curType + 'Style.type') || style[curType].type; - } + //if (this.deepQuery([seriesArray[i], this.option], 'tooltip.trigger') === 'axis') { + queryTarget = seriesArray[i]; + curType = this.query(queryTarget, 'tooltip.axisPointer.type'); + pointType = curType || pointType; + if (curType) { + style[curType].color = this.query( + queryTarget, 'tooltip.axisPointer.' + curType + 'Style.color') || style[curType].color; + style[curType].width = this.query( + queryTarget, 'tooltip.axisPointer.' + curType + 'Style.width') || style[curType].width; + style[curType].type = this.query( + queryTarget, 'tooltip.axisPointer.' + curType + 'Style.type') || style[curType].type; } + //} } - if (pointType == 'line') { + if (pointType === 'line') { + var lineWidth = style.line.width; + var isVertical = xStart == xEnd; this._axisLineShape.style = { - xStart: xStart, - yStart: yStart, - xEnd: xEnd, - yEnd: yEnd, + xStart: isVertical ? this.subPixelOptimize(xStart, lineWidth) : xStart, + yStart: isVertical ? yStart : this.subPixelOptimize(yStart, lineWidth), + xEnd: isVertical ? this.subPixelOptimize(xEnd, lineWidth) : xEnd, + yEnd: isVertical ? yEnd : this.subPixelOptimize(yEnd, lineWidth), strokeColor: style.line.color, - lineWidth: style.line.width, + lineWidth: lineWidth, lineType: style.line.type }; this._axisLineShape.invisible = false; this.zr.modShape(this._axisLineShape.id); } - else if (pointType == 'cross') { + else if (pointType === 'cross') { + var crossWidth = style.cross.width; this._axisCrossShape.style = { brushType: 'stroke', rect: this.component.grid.getArea(), - x: x, - y: y, + x: this.subPixelOptimize(x, crossWidth), + y: this.subPixelOptimize(y, crossWidth), text: ('( ' + this.component.xAxis.getAxis(0).getValueFromCoord(x) + ' , ' + this.component.yAxis.getAxis(0).getValueFromCoord(y) + ' )').replace(' , ', ' ').replace(' , ', ' '), textPosition: 'specific', strokeColor: style.cross.color, - lineWidth: style.cross.width, + lineWidth: crossWidth, lineType: style.cross.type }; if (this.component.grid.getXend() - x > 100) { // 右侧有空间 @@ -867,11 +1058,11 @@ Tooltip.prototype = { this._axisCrossShape.invisible = false; this.zr.modShape(this._axisCrossShape.id); } - else if (pointType == 'shadow') { - if (typeof style.shadow.width == 'undefined' || style.shadow.width == 'auto' || isNaN(style.shadow.width)) { + else if (pointType === 'shadow') { + if (style.shadow.width == null || style.shadow.width === 'auto' || isNaN(style.shadow.width)) { style.shadow.width = gap; } - if (xStart == xEnd) { + if (xStart === xEnd) { // 纵向 if (Math.abs(this.component.grid.getX() - xStart) < 2) { // 最左边 @@ -884,7 +1075,7 @@ Tooltip.prototype = { xStart = xEnd = xEnd - style.shadow.width / 2; } } - else if (yStart == yEnd) { + else if (yStart === yEnd) { // 横向 if (Math.abs(this.component.grid.getY() - yStart) < 2) { // 最上边 @@ -908,13 +1099,16 @@ Tooltip.prototype = { this._axisShadowShape.invisible = false; this.zr.modShape(this._axisShadowShape.id); } - this.zr.refresh(); + this.zr.refreshNextFrame(); } }, __onmousemove: function (param) { clearTimeout(this._hidingTicket); clearTimeout(this._showingTicket); + if (this._mousein && this._enterable) { + return; + } var target = param.target; var mx = zrEvent.getX(param.event); var my = zrEvent.getY(param.event); @@ -948,7 +1142,7 @@ Tooltip.prototype = { // 看用这个polar的系列数据是否是axis触发,如果是设置_curTarget为nul var series = this.option.series; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].polarIndex == polarIndex && this.deepQuery([series[i], this.option], 'tooltip.trigger') == 'axis') { + if (series[i].polarIndex === polarIndex && this.deepQuery([series[i], this.option], 'tooltip.trigger') === 'axis') { this._curTarget = null; break; } @@ -975,7 +1169,7 @@ Tooltip.prototype = { if (!this._tDom) { return; } - if (ticket == this._curTicket) { + if (ticket === this._curTicket) { this._tDom.innerHTML = content; } @@ -990,7 +1184,9 @@ Tooltip.prototype = { this.shapeList.length = 2; } for (var i = 0, l = tipShape.length; i < l; i++) { - tipShape[i].zlevel = this._zlevelBase; + tipShape[i].zlevel = this.getZlevelBase(); + tipShape[i].z = this.getZBase(); + tipShape[i].style = zrShapeBase.prototype.getHighlightStyle( tipShape[i].style, tipShape[i].highlightStyle); tipShape[i].draggable = false; @@ -1030,7 +1226,7 @@ Tooltip.prototype = { }, _isSelected: function (itemName) { - if (typeof this._selectedMap[itemName] != 'undefined') { + if (this._selectedMap[itemName] != null) { return this._selectedMap[itemName]; } else { @@ -1051,13 +1247,13 @@ Tooltip.prototype = { var seriesIndex; var series = this.option.series; - if (typeof params.seriesIndex != 'undefined') { + if (params.seriesIndex != null) { seriesIndex = params.seriesIndex; } else { var seriesName = params.seriesName; for (var i = 0, l = series.length; i < l; i++) { - if (series[i].name == seriesName) { + if (series[i].name === seriesName) { seriesIndex = i; break; } @@ -1065,11 +1261,11 @@ Tooltip.prototype = { } var serie = series[seriesIndex]; - if (typeof serie == 'undefined') { + if (serie == null) { return; } var chart = this.myChart.chart[serie.type]; - var isAxisTrigger = this.deepQuery([serie, this.option], 'tooltip.trigger') == 'axis'; + var isAxisTrigger = this.deepQuery([serie, this.option], 'tooltip.trigger') === 'axis'; if (!chart) { return; @@ -1082,12 +1278,12 @@ Tooltip.prototype = { case ecConfig.CHART_TYPE_LINE: case ecConfig.CHART_TYPE_BAR: case ecConfig.CHART_TYPE_K: - if (typeof this.component.xAxis == 'undefined' || typeof this.component.yAxis == 'undefined' || serie.data.length <= dataIndex) { + if (this.component.xAxis == null || this.component.yAxis == null || serie.data.length <= dataIndex) { return; } var xAxisIndex = serie.xAxisIndex || 0; var yAxisIndex = serie.yAxisIndex || 0; - if (this.component.xAxis.getAxis(xAxisIndex).type == ecConfig.COMPONENT_TYPE_AXIS_CATEGORY) { + if (this.component.xAxis.getAxis(xAxisIndex).type === ecConfig.COMPONENT_TYPE_AXIS_CATEGORY) { // 横轴是类目 this._event = { zrenderX: this.component.xAxis.getAxis(xAxisIndex).getCoordByIndex(dataIndex), @@ -1105,7 +1301,7 @@ Tooltip.prototype = { xAxisIndex, yAxisIndex, dataIndex); break; case ecConfig.CHART_TYPE_RADAR: - if (typeof this.component.polar == 'undefined' || serie.data[0].value.length <= dataIndex) { + if (this.component.polar == null || serie.data[0].value.length <= dataIndex) { return; } var polarIndex = serie.polarIndex || 0; @@ -1132,7 +1328,7 @@ Tooltip.prototype = { case ecConfig.CHART_TYPE_SCATTER: var dataIndex = params.dataIndex; for (var i = 0, l = shapeList.length; i < l; i++) { - if (ecData.get(shapeList[i], 'seriesIndex') == seriesIndex && ecData.get(shapeList[i], 'dataIndex') == dataIndex) { + if (shapeList[i]._mark == null && ecData.get(shapeList[i], 'seriesIndex') == seriesIndex && ecData.get(shapeList[i], 'dataIndex') == dataIndex) { this._curTarget = shapeList[i]; x = shapeList[i].style.x; y = chart.type != ecConfig.CHART_TYPE_K ? shapeList[i].style.y : shapeList[i].style.y[0]; @@ -1143,7 +1339,7 @@ Tooltip.prototype = { case ecConfig.CHART_TYPE_RADAR: var dataIndex = params.dataIndex; for (var i = 0, l = shapeList.length; i < l; i++) { - if (shapeList[i].type == 'polygon' && ecData.get(shapeList[i], 'seriesIndex') == seriesIndex && ecData.get(shapeList[i], 'dataIndex') == dataIndex) { + if (shapeList[i].type === 'polygon' && ecData.get(shapeList[i], 'seriesIndex') == seriesIndex && ecData.get(shapeList[i], 'dataIndex') == dataIndex) { this._curTarget = shapeList[i]; var vector = this.component.polar.getCenter( serie.polarIndex || 0); @@ -1156,7 +1352,7 @@ Tooltip.prototype = { case ecConfig.CHART_TYPE_PIE: var name = params.name; for (var i = 0, l = shapeList.length; i < l; i++) { - if (shapeList[i].type == 'sector' && ecData.get(shapeList[i], 'seriesIndex') == seriesIndex && ecData.get(shapeList[i], 'name') == name) { + if (shapeList[i].type === 'sector' && ecData.get(shapeList[i], 'seriesIndex') == seriesIndex && ecData.get(shapeList[i], 'name') == name) { this._curTarget = shapeList[i]; var style = this._curTarget.style; var midAngle = (style.startAngle + style.endAngle) / 2 * Math.PI / 180; @@ -1170,7 +1366,7 @@ Tooltip.prototype = { var name = params.name; var mapType = serie.mapType; for (var i = 0, l = shapeList.length; i < l; i++) { - if (shapeList[i].type == 'text' && shapeList[i]._mapType == mapType && shapeList[i].style._name == name) { + if (shapeList[i].type === 'text' && shapeList[i]._mapType === mapType && shapeList[i].style._name === name) { this._curTarget = shapeList[i]; x = this._curTarget.style.x + this._curTarget.position[0]; y = this._curTarget.style.y + this._curTarget.position[1]; @@ -1181,7 +1377,7 @@ Tooltip.prototype = { case ecConfig.CHART_TYPE_CHORD: var name = params.name; for (var i = 0, l = shapeList.length; i < l; i++) { - if (shapeList[i].type == 'sector' && ecData.get(shapeList[i], 'name') == name) { + if (shapeList[i].type === 'sector' && ecData.get(shapeList[i], 'name') == name) { this._curTarget = shapeList[i]; var style = this._curTarget.style; var midAngle = (style.startAngle + style.endAngle) / 2 * Math.PI / 180; @@ -1199,7 +1395,7 @@ Tooltip.prototype = { case ecConfig.CHART_TYPE_FORCE: var name = params.name; for (var i = 0, l = shapeList.length; i < l; i++) { - if (shapeList[i].type == 'circle' && ecData.get(shapeList[i], 'name') == name) { + if (shapeList[i].type === 'circle' && ecData.get(shapeList[i], 'name') == name) { this._curTarget = shapeList[i]; x = this._curTarget.position[0]; y = this._curTarget.position[1]; @@ -1208,7 +1404,7 @@ Tooltip.prototype = { } break; } - if (typeof x != 'undefined' && typeof y != 'undefined') { + if (x != null && y != null) { this._event = { zrenderX: x, zrenderY: y @@ -1248,23 +1444,24 @@ Tooltip.prototype = { this._lastTipShape = false; this.shapeList.length = 2; + this._lastDataIndex = -1; + this._lastSeriesIndex = -1; + this._lastItemTriggerId = -1; + if (newOption) { this.option = newOption; this.option.tooltip = this.reformOption(this.option.tooltip); + this.option.tooltip.textStyle = zrUtil.merge( this.option.tooltip.textStyle, this.ecTheme.textStyle); - // 补全padding属性 - this.option.tooltip.padding = this.reformCssArray( - this.option.tooltip.padding); - this._needAxisTrigger = false; - if (this.option.tooltip.trigger == 'axis') { + if (this.option.tooltip.trigger === 'axis') { this._needAxisTrigger = true; } var series = this.option.series; for (var i = 0, l = series.length; i < l; i++) { - if (this.query(series[i], 'tooltip.trigger') == 'axis') { + if (this.query(series[i], 'tooltip.trigger') === 'axis') { this._needAxisTrigger = true; break; } @@ -1277,28 +1474,29 @@ Tooltip.prototype = { this._setSelectedMap(); this._axisLineWidth = this.option.tooltip.axisPointer.lineStyle.width; + this._enterable = this.option.tooltip.enterable; } if (this.showing) { - this._tryShow(); + var self = this; + setTimeout(function () { + self.zr.trigger(zrConfig.EVENT.MOUSEMOVE, self.zr.handler._event); + }, 50); } }, /** * 释放后实例不可用,重载基类方法 */ - dispose: function () { + onbeforDispose: function () { if (this._lastTipShape && this._lastTipShape.tipShape.length > 0) { this.zr.delShape(this._lastTipShape.tipShape); } - this.clear(); - this.shapeList = null; - clearTimeout(this._hidingTicket); clearTimeout(this._showingTicket); this.zr.un(zrConfig.EVENT.MOUSEMOVE, this._onmousemove); this.zr.un(zrConfig.EVENT.GLOBALOUT, this._onglobalout); - if (this.hasAppend) { + if (this.hasAppend && !! this.dom.firstChild) { this.dom.firstChild.removeChild(this._tDom); } this._tDom = null; diff --git a/src/component/valueAxis.js b/src/component/valueAxis.js index cccaab2..610eb20 100644 --- a/src/component/valueAxis.js +++ b/src/component/valueAxis.js @@ -2,7 +2,7 @@ * echarts组件: 数值轴 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ @@ -14,6 +14,78 @@ var LineShape = require('../zrender/shape/Line.js'); var RectangleShape = require('../zrender/shape/Rectangle.js'); var ecConfig = require('../config.js'); +// 数值型坐标轴默认参数 +ecConfig.valueAxis = { + zlevel: 0, + // 一级层叠 + z: 0, + // 二级层叠 + show: true, + position: 'left', + // 位置 + name: '', + // 坐标轴名字,默认为空 + nameLocation: 'end', + // 坐标轴名字位置,支持'start' | 'end' + nameTextStyle: {}, + // 坐标轴文字样式,默认取全局样式 + boundaryGap: [0, 0], + // 数值起始和结束两端空白策略 + // min: null, // 最小值 + // max: null, // 最大值 + // scale: false, // 脱离0值比例,放大聚焦到最终_min,_max区间 + // splitNumber: 5, // 分割段数,默认为5 + axisLine: { // 坐标轴线 + show: true, + // 默认显示,属性show控制显示与否 + onZero: true, + lineStyle: { // 属性lineStyle控制线条样式 + color: '#48b', + width: 2, + type: 'solid' + } + }, + axisTick: { // 坐标轴小标记 + show: false, + // 属性show控制显示与否,默认不显示 + inside: false, + // 控制小标记是否在grid里 + length: 5, + // 属性length控制线长 + lineStyle: { // 属性lineStyle控制线条样式 + color: '#333', + width: 1 + } + }, + axisLabel: { // 坐标轴文本标签,详见axis.axisLabel + show: true, + rotate: 0, + margin: 8, + // clickable: false, + // formatter: null, + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: '#333' + } + }, + splitLine: { // 分隔线 + show: true, + // 默认显示,属性show控制显示与否 + lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 + color: ['#ccc'], + width: 1, + type: 'solid' + } + }, + splitArea: { // 分隔区域 + show: false, + // 默认不显示,属性show控制显示与否 + areaStyle: { // 属性areaStyle(详见areaStyle)控制区域样式 + color: ['rgba(250,250,250,0.3)', 'rgba(200,200,200,0.3)'] + } + } +}; + +var ecDate = require('../util/date.js'); var zrUtil = require('../zrender/tool/util.js'); /** @@ -45,12 +117,14 @@ function ValueAxis(ecTheme, messageCenter, zr, option, myChart, axisBase, series ValueAxis.prototype = { type: ecConfig.COMPONENT_TYPE_AXIS_VALUE, + _buildShape: function () { this._hasData = false; this._calculateValue(); - if (!this._hasData) { + if (!this._hasData || !this.option.show) { return; } + this.option.splitArea.show && this._buildSplitArea(); this.option.splitLine.show && this._buildSplitLine(); this.option.axisLine.show && this._buildAxisLine(); @@ -74,14 +148,15 @@ ValueAxis.prototype = { if (this.isHorizontal()) { // 横向 - var yPosition = this.option.position == 'bottom' ? (tickOption.inside ? (this.grid.getYend() - length - 1) : (this.grid.getYend()) + 1) : (tickOption.inside ? (this.grid.getY() + 1) : (this.grid.getY() - length - 1)); + var yPosition = this.option.position === 'bottom' ? (tickOption.inside ? (this.grid.getYend() - length - 1) : (this.grid.getYend()) + 1) : (tickOption.inside ? (this.grid.getY() + 1) : (this.grid.getY() - length - 1)); var x; for (var i = 0; i < dataLength; i++) { // 亚像素优化 x = this.subPixelOptimize(this.getCoord(data[i]), lineWidth); axShape = { _axisShape: 'axisTick', - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), hoverable: false, style: { xStart: x, @@ -97,7 +172,7 @@ ValueAxis.prototype = { } else { // 纵向 - var xPosition = this.option.position == 'left' ? (tickOption.inside ? (this.grid.getX() + 1) : (this.grid.getX() - length - 1)) : (tickOption.inside ? (this.grid.getXend() - length - 1) : (this.grid.getXend() + 1)); + var xPosition = this.option.position === 'left' ? (tickOption.inside ? (this.grid.getX() + 1) : (this.grid.getX() - length - 1)) : (tickOption.inside ? (this.grid.getXend() - length - 1) : (this.grid.getXend() + 1)); var y; for (var i = 0; i < dataLength; i++) { @@ -105,7 +180,8 @@ ValueAxis.prototype = { y = this.subPixelOptimize(this.getCoord(data[i]), lineWidth); axShape = { _axisShape: 'axisTick', - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), hoverable: false, style: { xStart: xPosition, @@ -135,7 +211,7 @@ ValueAxis.prototype = { // 横向 var yPosition; var baseLine; - if (this.option.position == 'bottom') { + if (this.option.position === 'bottom') { yPosition = this.grid.getYend() + margin; baseLine = 'top'; } @@ -146,12 +222,13 @@ ValueAxis.prototype = { for (var i = 0; i < dataLength; i++) { axShape = { - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase() + 3, hoverable: false, style: { x: this.getCoord(data[i]), y: yPosition, - color: typeof textStyle.color == 'function' ? textStyle.color(data[i]) : textStyle.color, + color: typeof textStyle.color === 'function' ? textStyle.color(data[i]) : textStyle.color, text: this._valueLabel[i], textFont: this.getFont(textStyle), textAlign: textStyle.align || 'center', @@ -159,7 +236,7 @@ ValueAxis.prototype = { } }; if (rotate) { - axShape.style.textAlign = rotate > 0 ? (this.option.position == 'bottom' ? 'right' : 'left') : (this.option.position == 'bottom' ? 'left' : 'right'); + axShape.style.textAlign = rotate > 0 ? (this.option.position === 'bottom' ? 'right' : 'left') : (this.option.position === 'bottom' ? 'left' : 'right'); axShape.rotation = [ rotate * Math.PI / 180, axShape.style.x, axShape.style.y]; } @@ -171,7 +248,7 @@ ValueAxis.prototype = { // 纵向 var xPosition; var align; - if (this.option.position == 'left') { + if (this.option.position === 'left') { xPosition = this.grid.getX() - margin; align = 'right'; } @@ -182,16 +259,17 @@ ValueAxis.prototype = { for (var i = 0; i < dataLength; i++) { axShape = { - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase() + 3, hoverable: false, style: { x: xPosition, y: this.getCoord(data[i]), - color: typeof textStyle.color == 'function' ? textStyle.color(data[i]) : textStyle.color, + color: typeof textStyle.color === 'function' ? textStyle.color(data[i]) : textStyle.color, text: this._valueLabel[i], textFont: this.getFont(textStyle), textAlign: textStyle.align || align, - textBaseline: textStyle.baseline || (i === 0 && this.option.name !== '') ? 'bottom' : (i == (dataLength - 1) && this.option.name !== '') ? 'top' : 'middle' + textBaseline: textStyle.baseline || ((i === 0 && this.option.name !== '') ? 'bottom' : (i === dataLength - 1 && this.option.name !== '') ? 'top' : 'middle') } }; @@ -226,7 +304,8 @@ ValueAxis.prototype = { // 亚像素优化 x = this.subPixelOptimize(this.getCoord(data[i]), lineWidth); axShape = { - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), hoverable: false, style: { xStart: x, @@ -252,7 +331,8 @@ ValueAxis.prototype = { // 亚像素优化 y = this.subPixelOptimize(this.getCoord(data[i]), lineWidth); axShape = { - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), hoverable: false, style: { xStart: sx, @@ -276,7 +356,8 @@ ValueAxis.prototype = { if (!(color instanceof Array)) { // 非数组一律认为是单一颜色的字符串,单一颜色则用一个背景,颜色错误不负责啊!!! axShape = { - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), hoverable: false, style: { x: this.grid.getX(), @@ -284,7 +365,7 @@ ValueAxis.prototype = { width: this.grid.getWidth(), height: this.grid.getHeight(), color: color - // type : this.option.splitArea.areaStyle.type, + // type: this.option.splitArea.areaStyle.type, } }; this.shapeList.push(new RectangleShape(axShape)); @@ -305,7 +386,8 @@ ValueAxis.prototype = { for (var i = 0; i <= dataLength; i++) { curX = i < dataLength ? this.getCoord(data[i]) : this.grid.getXend(); axShape = { - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), hoverable: false, style: { x: lastX, @@ -313,7 +395,7 @@ ValueAxis.prototype = { width: curX - lastX, height: height, color: color[i % colorLength] - // type : this.option.splitArea.areaStyle.type, + // type: this.option.splitArea.areaStyle.type, } }; this.shapeList.push(new RectangleShape(axShape)); @@ -330,7 +412,8 @@ ValueAxis.prototype = { for (var i = 0; i <= dataLength; i++) { curY = i < dataLength ? this.getCoord(data[i]) : this.grid.getY(); axShape = { - zlevel: this._zlevelBase, + zlevel: this.getZlevelBase(), + z: this.getZBase(), hoverable: false, style: { x: x, @@ -338,7 +421,7 @@ ValueAxis.prototype = { width: width, height: lastYend - curY, color: color[i % colorLength] - // type : this.option.splitArea.areaStyle.type + // type: this.option.splitArea.areaStyle.type } }; this.shapeList.push(new RectangleShape(axShape)); @@ -355,14 +438,12 @@ ValueAxis.prototype = { if (isNaN(this.option.min - 0) || isNaN(this.option.max - 0)) { // 有一个没指定都得算 // 数据整形 - var oriData; // 原始数据 var data = {}; // 整形后数据抽取 - var value; var xIdx; var yIdx; var legend = this.component.legend; for (var i = 0, l = this.series.length; i < l; i++) { - if (this.series[i].type != ecConfig.CHART_TYPE_LINE && this.series[i].type != ecConfig.CHART_TYPE_BAR && this.series[i].type != ecConfig.CHART_TYPE_SCATTER && this.series[i].type != ecConfig.CHART_TYPE_K) { + if (this.series[i].type != ecConfig.CHART_TYPE_LINE && this.series[i].type != ecConfig.CHART_TYPE_BAR && this.series[i].type != ecConfig.CHART_TYPE_SCATTER && this.series[i].type != ecConfig.CHART_TYPE_K && this.series[i].type != ecConfig.CHART_TYPE_EVENTRIVER) { // 非坐标轴支持的不算极值 continue; } @@ -379,68 +460,11 @@ ValueAxis.prototype = { continue; } - var key = this.series[i].name || 'kener'; - if (!this.series[i].stack) { - data[key] = data[key] || []; - oriData = this.series[i].data; - for (var j = 0, k = oriData.length; j < k; j++) { - value = typeof oriData[j].value != 'undefined' ? oriData[j].value : oriData[j]; - if (this.series[i].type == ecConfig.CHART_TYPE_SCATTER) { - if (this.option.xAxisIndex != -1) { - data[key].push(value[0]); - } - if (this.option.yAxisIndex != -1) { - data[key].push(value[1]); - } - } - else if (this.series[i].type == ecConfig.CHART_TYPE_K) { - data[key].push(value[0]); - data[key].push(value[1]); - data[key].push(value[2]); - data[key].push(value[3]); - } - else { - data[key].push(value); - } - } - } - else { - // 堆积数据,需要区分正负向堆积 - var keyP = '__Magic_Key_Positive__' + this.series[i].stack; - var keyN = '__Magic_Key_Negative__' + this.series[i].stack; - data[keyP] = data[keyP] || []; - data[keyN] = data[keyN] || []; - data[key] = data[key] || []; // scale下还需要记录每一个量 - oriData = this.series[i].data; - for (var j = 0, k = oriData.length; j < k; j++) { - value = typeof oriData[j].value != 'undefined' ? oriData[j].value : oriData[j]; - if (value == '-') { - continue; - } - value = value - 0; - if (value >= 0) { - if (typeof data[keyP][j] != 'undefined') { - data[keyP][j] += value; - } - else { - data[keyP][j] = value; - } - } - else { - if (typeof data[keyN][j] != 'undefined') { - data[keyN][j] += value; - } - else { - data[keyN][j] = value; - } - } - if (this.option.scale) { - data[key].push(value); - } - } - } + this._calculSum(data, i); } + // 找极值 + var oriData; // 原始数据 for (var i in data) { oriData = data[i]; for (var j = 0, k = oriData.length; j < k; j++) { @@ -465,247 +489,254 @@ ValueAxis.prototype = { } } - //console.log(this._min,this._max,'vvvvv111111') - this._min = isNaN(this.option.min - 0) ? (this._min - Math.abs(this._min * this.option.boundaryGap[0])) : (this.option.min - 0); // 指定min忽略boundaryGay[0] + // console.log(this._min,this._max,'vvvvv111111',this.option.type) + var gap = Math.abs(this._max - this._min); + this._min = isNaN(this.option.min - 0) ? (this._min - Math.abs(gap * this.option.boundaryGap[0])) : (this.option.min - 0); // 指定min忽略boundaryGay[0] - this._max = isNaN(this.option.max - 0) ? (this._max + Math.abs(this._max * this.option.boundaryGap[1])) : (this.option.max - 0); // 指定max忽略boundaryGay[1] - if (this._min == this._max) { + this._max = isNaN(this.option.max - 0) ? (this._max + Math.abs(gap * this.option.boundaryGap[1])) : (this.option.max - 0); // 指定max忽略boundaryGay[1] + if (this._min === this._max) { if (this._max === 0) { // 修复全0数据 - this._max = this.option.power > 0 ? this.option.power : 1; + this._max = 1; } // 修复最大值==最小值时数据整形 else if (this._max > 0) { - this._min = this._max / this.option.splitNumber; + this._min = this._max / this.option.splitNumber != null ? this.option.splitNumber : 5; } else { // this._max < 0 - this._max = this._max / this.option.splitNumber; + this._max = this._max / this.option.splitNumber != null ? this.option.splitNumber : 5; } } - this._reformValue(this.option.scale); + this.option.type != 'time' ? this._reformValue(this.option.scale) : this._reformTimeValue(); } else { this._hasData = true; // 用户指定min max就不多管闲事了 this._min = this.option.min - 0; // 指定min忽略boundaryGay[0] this._max = this.option.max - 0; // 指定max忽略boundaryGay[1] - this._customerValue(); + this.option.type != 'time' ? this._customerValue() : this._reformTimeValue(); } }, /** - * 找到原始数据的极值后根据选项整形最终 this._min / this._max / this._valueList - * 如果你不知道这个“整形”的用义,请不要试图去理解和修改这个方法!找我也没用,我相信我已经记不起来! - * 如果你有更简洁的数学推导欢迎重写,后果自负~ - * 一旦你不得不遇到了需要修改或重写的厄运,希望下面的脚手架能帮助你 - * ps:其实我是想说别搞砸了!升级后至少得保证这些case通过!! - * - * by linzhifeng@baidu.com 2013-1-8 - * -------- - this._valueList = []; - this.option = {splitNumber:5,power:100,precision:0}; - this._min = 1; this._max = 123; console.log(this._min, this._max); this._reformValue(); - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : 0 150 [0, 30, 60, 90, 120, 150]', - (this._min == 0 && this._max == 150) ? 'success' : 'failed'); - - this._min = 10; this._max = 1923; console.log(this._min, this._max); this._reformValue(); - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : 0 2000 [0, 400, 800, 1200, 1600, 2000]', - (this._min == 0 && this._max == 2000) ? 'success' : 'failed'); - - this._min = 10; this._max = 78; console.log(this._min, this._max); this._reformValue(); - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : 0 100 [0, 20, 40, 60, 80, 100]', - (this._min == 0 && this._max == 100) ? 'success' : 'failed'); - - this._min = -31; this._max = -3; console.log(this._min, this._max); this._reformValue(); - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : -35 0 [-35, -28, -21, -14, -7, 0]', - (this._min == -35 && this._max == 0) ? 'success' : 'failed'); - - this._min = -51; this._max = 203; console.log(this._min, this._max); this._reformValue(); - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : -60 240 [-60, 0, 60, 120, 180, 240]', - (this._min == -60 && this._max == 240) ? 'success' : 'failed'); - - this._min = -251; this._max = 23; console.log(this._min, this._max); this._reformValue(); - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : -280 70 [-280, -210, -140, -70, 0, 70]', - (this._min == -280 && this._max == 70) ? 'success' : 'failed'); - - this.option.precision = 2; - this._min = 0.23; this._max = 0.78; console.log(this._min, this._max); this._reformValue(); - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : 0.00 1.00' - + '["0.00", "0.20", "0.40", "0.60", "0.80", "1.00"]', - (this._min == 0.00 && this._max == 1.00) ? 'success' : 'failed'); - - this._min = -12.23; this._max = -0.78; console.log(this._min, this._max); - this._reformValue(); - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : -15.00 0.00' - + '["-15.00", "-12.00", "-9.00", "-6.00", "-3.00", "0.00"]', - (this._min == -15.00 && this._max == 0.00) ? 'success' : 'failed'); - - this._min = -0.23; this._max = 0.78; console.log(this._min, this._max); this._reformValue() - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : -0.30 1.20' - + '["-0.30", "0.00", "0.30", "0.60", "0.90", "1.20"]', - (this._min == -0.30 && this._max == 1.20) ? 'success' : 'failed'); - - this._min = -1.23; this._max = 0.78; console.log(this._min, this._max); _reformValue(); - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : -1.50 1.00' - + '["-1.50", "-1.00", "-0.50", "0.00", "0.50", "1.00"]', - (this._min == -1.50 && this._max == 1.00) ? 'success' : 'failed'); - - this.option.precision = 1; - this._min = -2.3; this._max = 0.5; console.log(this._min, this._max); _reformValue(); - console.log('result is :', this._min, this._max, this._valueList); - console.log('should be : -2.4 0.6' - + '["-2.4", "-1.8", "-1.2", "-0.6", "0.0", "0.6"]', - (this._min == -2.4 && this._max == 0.6) ? 'success' : 'failed'); - * -------- + * 内部使用,计算某系列下的堆叠和 */ - _reformValue: function (scale) { - var splitNumber = this.option.splitNumber; - var precision = this.option.precision; - var splitGap; - var power; - if (precision === 0) { // 整数 - power = this.option.power > 1 ? this.option.power : 1; - } - else { // 小数 - // 放大倍数后复用整数逻辑,最后再缩小回去 - power = Math.pow(10, precision); - this._min *= power; - this._max *= power; - power = this.option.power; - } - // console.log(this._min,this._max) - var total; - if (this._min >= 0 && this._max >= 0) { - // 双正 - if (!scale) { - // power自动降级 - while ((this._max / power < splitNumber) && power != 1) { - power = power / 10; + _calculSum: function (data, i) { + var key = this.series[i].name || 'kener'; + var value; + var oriData; + if (!this.series[i].stack) { + data[key] = data[key] || []; + if (this.series[i].type != ecConfig.CHART_TYPE_EVENTRIVER) { + oriData = this.series[i].data; + for (var j = 0, k = oriData.length; j < k; j++) { + value = this.getDataFromOption(oriData[j]); + if (this.series[i].type === ecConfig.CHART_TYPE_K) { + data[key].push(value[0]); + data[key].push(value[1]); + data[key].push(value[2]); + data[key].push(value[3]); + } + else if (value instanceof Array) { + // scatter 、 不等距 line bar + if (this.option.xAxisIndex != -1) { + data[key].push( + this.option.type != 'time' ? value[0] : ecDate.getNewDate(value[0])); + } + if (this.option.yAxisIndex != -1) { + data[key].push( + this.option.type != 'time' ? value[1] : ecDate.getNewDate(value[1])); + } + } + else { + data[key].push(value); + } } - this._min = 0; } else { - // power自动降级 - while (this._min < power && power != 1) { - power = power / 10; - } - if (precision === 0) { // 整数 - // 满足power - this._min = Math.floor(this._min / power) * power; - this._max = Math.ceil(this._max / power) * power; + // eventRiver + oriData = this.series[i].eventList; + for (var j = 0, k = oriData.length; j < k; j++) { + var evolution = oriData[j].evolution; + for (var m = 0, n = evolution.length; m < n; m++) { + data[key].push(ecDate.getNewDate(evolution[m].time)); + } } } - power = power > 1 ? power / 10 : 1; - total = this._max - this._min; - splitGap = Math.ceil((total / splitNumber) / power) * power; - this._max = this._min + splitGap * splitNumber; - } - else if (this._min <= 0 && this._max <= 0) { - // 双负 - power = -power; - if (!scale) { - // power自动降级 - while ((this._min / power < splitNumber) && power != -1) { - power = power / 10; + } + else { + // 堆积数据,需要区分正负向堆积 + var keyP = '__Magic_Key_Positive__' + this.series[i].stack; + var keyN = '__Magic_Key_Negative__' + this.series[i].stack; + data[keyP] = data[keyP] || []; + data[keyN] = data[keyN] || []; + data[key] = data[key] || []; // scale下还需要记录每一个量 + oriData = this.series[i].data; + for (var j = 0, k = oriData.length; j < k; j++) { + value = this.getDataFromOption(oriData[j]); + if (value === '-') { + continue; } - this._max = 0; - } - else { - // power自动降级 - while (this._max > power && power != -1) { - power = power / 10; + value = value - 0; + if (value >= 0) { + if (data[keyP][j] != null) { + data[keyP][j] += value; + } + else { + data[keyP][j] = value; + } + } + else { + if (data[keyN][j] != null) { + data[keyN][j] += value; + } + else { + data[keyN][j] = value; + } } - if (precision === 0) { // 整数 - // 满足power - this._min = Math.ceil(this._min / power) * power; - this._max = Math.floor(this._max / power) * power; + if (this.option.scale) { + data[key].push(value); } } - power = power < -1 ? power / 10 : -1; - total = this._min - this._max; - splitGap = -Math.ceil((total / splitNumber) / power) * power; - this._min = -splitGap * splitNumber + this._max; } - else { - // 一正一负,确保0被选中 - total = this._max - this._min; - // power自动降级 - while ((total / power < splitNumber) && power != 1) { - power = power / 10; + }, + + /** + * 找到原始数据的极值后根据选项整形最终 this._min / this._max / this._valueList + * 如果你不知道这个“整形”的用义,请不要试图去理解和修改这个方法!找我也没用,我相信我已经记不起来! + * 如果你有更简洁的数学推导欢迎重写,后果自负~ + * + * by kener.linfeng@gmail.com 2013-1-8 + * -------- + * 感谢谢世威(https://github.com/i6ma),终于有人改这个方法了 + * by Kener 2014-11-6 + */ + _reformValue: function (scale) { + var smartSteps = require('../util/smartSteps.js'); + var splitNumber = this.option.splitNumber; + + // 非scale下双正,修正最小值为0 + if (!scale && this._min >= 0 && this._max >= 0) { + this._min = 0; + } + // 非scale下双负,修正最大值为0 + if (!scale && this._min <= 0 && this._max <= 0) { + this._max = 0; + } + + var stepOpt = smartSteps(this._min, this._max, splitNumber); + splitNumber = splitNumber != null ? splitNumber : stepOpt.secs; + //this.option.splitNumber = splitNumber; + this._min = stepOpt.min; + this._max = stepOpt.max; + this._valueList = stepOpt.pnts; + this._reformLabelData(); + }, + + /** + * 格式化时间值 + */ + _reformTimeValue: function () { + var splitNumber = this.option.splitNumber != null ? this.option.splitNumber : 5; + + // 最优解 + var curValue = ecDate.getAutoFormatter(this._min, this._max, splitNumber); + // 目标 + var formatter = curValue.formatter; + var gapValue = curValue.gapValue; + + this._valueList = [ecDate.getNewDate(this._min)]; + var startGap; + switch (formatter) { + case 'week': + startGap = ecDate.nextMonday(this._min); + break; + case 'month': + startGap = ecDate.nextNthOnMonth(this._min, 1); + break; + case 'quarter': + startGap = ecDate.nextNthOnQuarterYear(this._min, 1); + break; + case 'half-year': + startGap = ecDate.nextNthOnHalfYear(this._min, 1); + break; + case 'year': + startGap = ecDate.nextNthOnYear(this._min, 1); + break; + default: + // 大于2小时需要考虑时区不能直接取整 + if (gapValue <= 3600000 * 2) { + startGap = (Math.floor(this._min / gapValue) + 1) * gapValue; } - // 正数部分的分隔数 - var partSplitNumber = Math.round(this._max / total * splitNumber); - // 修正数据范围极度偏正向,留给负数一个 - partSplitNumber -= (partSplitNumber == splitNumber ? 1 : 0); - // 修正数据范围极度偏负向,留给正数一个 - partSplitNumber += partSplitNumber === 0 ? 1 : 0; - splitGap = (Math.ceil(Math.max( - this._max / partSplitNumber, this._min / (partSplitNumber - splitNumber)) / power)) * power; - - this._max = splitGap * partSplitNumber; - this._min = splitGap * (partSplitNumber - splitNumber); - } - //console.log(this._min,this._max,'vvvvvrrrrrr') - this._valueList = []; - for (var i = 0; i <= splitNumber; i++) { - this._valueList.push(this._min + splitGap * i); + else { + startGap = ecDate.getNewDate(this._min - (-gapValue)); + startGap.setHours(Math.round(startGap.getHours() / 6) * 6); + startGap.setMinutes(0); + startGap.setSeconds(0); + } + break; } - if (precision !== 0) { // 小数 - // 放大倍数后复用整数逻辑,最后再缩小回去 - power = Math.pow(10, precision); - this._min = (this._min / power).toFixed(precision) - 0; - this._max = (this._max / power).toFixed(precision) - 0; - for (var i = 0; i <= splitNumber; i++) { - this._valueList[i] = (this._valueList[i] / power).toFixed(precision) - 0; + if (startGap - this._min < gapValue / 2) { + startGap -= -gapValue; + } + + // console.log(startGap,gapValue,this._min, this._max,formatter) + curValue = ecDate.getNewDate(startGap); + splitNumber *= 1.5; + while (splitNumber-- >= 0) { + if (formatter == 'month' || formatter == 'quarter' || formatter == 'half-year' || formatter == 'year') { + curValue.setDate(1); + } + if (this._max - curValue < gapValue / 2) { + break; } + this._valueList.push(curValue); + curValue = ecDate.getNewDate(curValue - (-gapValue)); } - this._reformLabelData(); + this._valueList.push(ecDate.getNewDate(this._max)); + + this._reformLabelData(formatter); }, _customerValue: function () { - var splitNumber = this.option.splitNumber; - var precision = this.option.precision; + var accMath = require('../util/accMath.js'); + var splitNumber = this.option.splitNumber != null ? this.option.splitNumber : 5; var splitGap = (this._max - this._min) / splitNumber; this._valueList = []; for (var i = 0; i <= splitNumber; i++) { - this._valueList.push((this._min + splitGap * i).toFixed(precision) - 0); + this._valueList.push(accMath.accAdd(this._min, accMath.accMul(splitGap, i))); } this._reformLabelData(); }, - _reformLabelData: function () { + _reformLabelData: function (timeFormatter) { this._valueLabel = []; var formatter = this.option.axisLabel.formatter; if (formatter) { for (var i = 0, l = this._valueList.length; i < l; i++) { - if (typeof formatter == 'function') { - this._valueLabel.push(formatter.call(this.myChart, this._valueList[i])); + if (typeof formatter === 'function') { + this._valueLabel.push( + timeFormatter ? formatter.call(this.myChart, this._valueList[i], timeFormatter) : formatter.call(this.myChart, this._valueList[i])); } - else if (typeof formatter == 'string') { + else if (typeof formatter === 'string') { this._valueLabel.push( - formatter.replace('{value}', this._valueList[i])); + timeFormatter ? ecDate.format(formatter, this._valueList[i]) : formatter.replace('{value}', this._valueList[i])); } } } + else if (timeFormatter) { + for (var i = 0, l = this._valueList.length; i < l; i++) { + this._valueLabel.push(ecDate.format(timeFormatter, this._valueList[i])); + } + } else { // 每三位默认加,格式化 for (var i = 0, l = this._valueList.length; i < l; i++) { this._valueLabel.push(this.numAddCommas(this._valueList[i])); } } - }, getExtremum: function () { @@ -751,7 +782,7 @@ ValueAxis.prototype = { return result; // Math.floor可能引起一些偏差,但性能会更好 /* 准确更重要 - return (value == this._min || value == this._max) + return (value === this._min || value === this._max) ? result : Math.floor(result); */ @@ -786,6 +817,15 @@ ValueAxis.prototype = { } return result.toFixed(2) - 0; + }, + + isMaindAxis: function (value) { + for (var i = 0, l = this._valueList.length; i < l; i++) { + if (this._valueList[i] === value) { + return true; + } + } + return false; } }; diff --git a/src/config.js b/src/config.js index be870fb..8dde4fe 100644 --- a/src/config.js +++ b/src/config.js @@ -2,7 +2,7 @@ * echarts默认配置项 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ @@ -21,6 +21,7 @@ var config = { CHART_TYPE_CHORD: 'chord', CHART_TYPE_GAUGE: 'gauge', CHART_TYPE_FUNNEL: 'funnel', + CHART_TYPE_EVENTRIVER: 'eventRiver', // 组件类型 COMPONENT_TYPE_TITLE: 'title', @@ -38,6 +39,7 @@ var config = { COMPONENT_TYPE_AXIS_CATEGORY: 'categoryAxis', COMPONENT_TYPE_AXIS_VALUE: 'valueAxis', COMPONENT_TYPE_TIMELINE: 'timeline', + COMPONENT_TYPE_ROAMCONTROLLER: 'roamController', // 全图默认背景 backgroundColor: 'rgba(0,0,0,0)', @@ -45,1189 +47,38 @@ var config = { // 默认色板 color: ['#ff7f50', '#87cefa', '#da70d6', '#32cd32', '#6495ed', '#ff69b4', '#ba55d3', '#cd5c5c', '#ffa500', '#40e0d0', '#1e90ff', '#ff6347', '#7b68ee', '#00fa9a', '#ffd700', '#6699FF', '#ff6666', '#3cb371', '#b8860b', '#30e0e0'], - // 图表标题 - title: { - text: '', - //link: null, // 超链接跳转 - //target: null, // 仅支持self | blank - subtext: '', - //sublink: null, // 超链接跳转 - //subtarget: null, // 仅支持self | blank - x: 'left', - // 水平安放位置,默认为左对齐,可选为: - // 'center' ¦ 'left' ¦ 'right' - // ¦ {number}(x坐标,单位px) - y: 'top', - // 垂直安放位置,默认为全图顶端,可选为: - // 'top' ¦ 'bottom' ¦ 'center' - // ¦ {number}(y坐标,单位px) - //textAlign: null // 水平对齐方式,默认根据x设置自动调整 - backgroundColor: 'rgba(0,0,0,0)', - borderColor: '#ccc', - // 标题边框颜色 - borderWidth: 0, - // 标题边框线宽,单位px,默认为0(无边框) - padding: 5, - // 标题内边距,单位px,默认各方向内边距为5, - // 接受数组分别设定上右下左边距,同css - itemGap: 5, - // 主副标题纵向间隔,单位px,默认为10, - textStyle: { - fontSize: 18, - fontWeight: 'bolder', - color: '#333' // 主标题文字颜色 - }, - subtextStyle: { - color: '#aaa' // 副标题文字颜色 - } - }, - - // 图例 - legend: { - orient: 'horizontal', - // 布局方式,默认为水平布局,可选为: - // 'horizontal' ¦ 'vertical' - x: 'center', - // 水平安放位置,默认为全图居中,可选为: - // 'center' ¦ 'left' ¦ 'right' - // ¦ {number}(x坐标,单位px) - y: 'top', - // 垂直安放位置,默认为全图顶端,可选为: - // 'top' ¦ 'bottom' ¦ 'center' - // ¦ {number}(y坐标,单位px) - backgroundColor: 'rgba(0,0,0,0)', - borderColor: '#ccc', - // 图例边框颜色 - borderWidth: 0, - // 图例边框线宽,单位px,默认为0(无边框) - padding: 5, - // 图例内边距,单位px,默认各方向内边距为5, - // 接受数组分别设定上右下左边距,同css - itemGap: 10, - // 各个item之间的间隔,单位px,默认为10, - // 横向布局时为水平间隔,纵向布局时为纵向间隔 - itemWidth: 20, - // 图例图形宽度 - itemHeight: 14, - // 图例图形高度 - textStyle: { - color: '#333' // 图例文字颜色 - }, - selectedMode: true // 选择模式,默认开启图例开关 - // selected: null, // 配置默认选中状态,可配合LEGEND.SELECTED事件做动态数据载入 - // data: [], // 图例内容(详见legend.data,数组中每一项代表一个item - }, - - // 值域 - dataRange: { - orient: 'vertical', - // 布局方式,默认为垂直布局,可选为: - // 'horizontal' ¦ 'vertical' - x: 'left', - // 水平安放位置,默认为全图左对齐,可选为: - // 'center' ¦ 'left' ¦ 'right' - // ¦ {number}(x坐标,单位px) - y: 'bottom', - // 垂直安放位置,默认为全图底部,可选为: - // 'top' ¦ 'bottom' ¦ 'center' - // ¦ {number}(y坐标,单位px) - backgroundColor: 'rgba(0,0,0,0)', - borderColor: '#ccc', - // 值域边框颜色 - borderWidth: 0, - // 值域边框线宽,单位px,默认为0(无边框) - padding: 5, - // 值域内边距,单位px,默认各方向内边距为5, - // 接受数组分别设定上右下左边距,同css - itemGap: 10, - // 各个item之间的间隔,单位px,默认为10, - // 横向布局时为水平间隔,纵向布局时为纵向间隔 - itemWidth: 20, - // 值域图形宽度,线性渐变水平布局宽度为该值 * 10 - itemHeight: 14, - // 值域图形高度,线性渐变垂直布局高度为该值 * 10 - // min: null, // 最小值 - // max: null, // 最大值 - precision: 0, - // 小数精度,默认为0,无小数点 - splitNumber: 5, - // 分割段数,默认为5,为0时为线性渐变 - calculable: false, - // 是否值域漫游,启用后无视splitNumber,线性渐变 - realtime: true, - color: ['#006edd', '#e0ffff'], - //颜色 - //formatter: null, - //text:['高','低'], // 文本,默认为数值文本 - textStyle: { - color: '#333' // 值域文字颜色 - } - }, - - toolbox: { - show: false, - orient: 'horizontal', - // 布局方式,默认为水平布局,可选为: - // 'horizontal' ¦ 'vertical' - x: 'right', - // 水平安放位置,默认为全图右对齐,可选为: - // 'center' ¦ 'left' ¦ 'right' - // ¦ {number}(x坐标,单位px) - y: 'top', - // 垂直安放位置,默认为全图顶端,可选为: - // 'top' ¦ 'bottom' ¦ 'center' - // ¦ {number}(y坐标,单位px) - color: ['#1e90ff', '#22bb22', '#4b0082', '#d2691e'], - disableColor: '#ddd', - effectiveColor: 'red', - backgroundColor: 'rgba(0,0,0,0)', - // 工具箱背景颜色 - borderColor: '#ccc', - // 工具箱边框颜色 - borderWidth: 0, - // 工具箱边框线宽,单位px,默认为0(无边框) - padding: 5, - // 工具箱内边距,单位px,默认各方向内边距为5, - // 接受数组分别设定上右下左边距,同css - itemGap: 10, - // 各个item之间的间隔,单位px,默认为10, - // 横向布局时为水平间隔,纵向布局时为纵向间隔 - itemSize: 16, - // 工具箱图形宽度 - showTitle: true, - //textStyle : {}, - feature: { - mark: { - show: false, - title: { - mark: '辅助线开关', - markUndo: '删除辅助线', - markClear: '清空辅助线' - }, - lineStyle: { - width: 1, - color: '#1e90ff', - type: 'dashed' - } - }, - dataZoom: { - show: false, - title: { - dataZoom: '区域缩放', - dataZoomReset: '区域缩放后退' - } - }, - dataView: { - show: false, - title: '数据视图', - readOnly: false, - lang: ['Data View', 'close', 'refresh'] - }, - magicType: { - show: false, - title: { - line: '折线图切换', - bar: '柱形图切换', - stack: '堆积', - tiled: '平铺' - }, - type: [] // 'line', 'bar', 'stack', 'tiled' - }, - restore: { - show: false, - title: '还原' - }, - saveAsImage: { - show: false, - title: '保存为图片', - type: 'png', - lang: ['点击保存'] - } - } - }, - - // 提示框 - tooltip: { - show: true, - showContent: true, - // tooltip主体内容 - trigger: 'item', - // 触发类型,默认数据触发,见下图,可选为:'item' ¦ 'axis' - // position : null // 位置 {Array} | {Function} - // formatter: null // 内容格式器:{string}(Template) ¦ {Function} - islandFormatter: '{a}
{b} : {c}', - // 数据孤岛内容格式器 - showDelay: 20, - // 显示延迟,添加显示延迟可以避免频繁切换,单位ms - hideDelay: 100, - // 隐藏延迟,单位ms - transitionDuration: 0.4, - // 动画变换时间,单位s - backgroundColor: 'rgba(0,0,0,0.7)', - // 提示背景颜色,默认为透明度为0.7的黑色 - borderColor: '#333', - // 提示边框颜色 - borderRadius: 4, - // 提示边框圆角,单位px,默认为4 - borderWidth: 0, - // 提示边框线宽,单位px,默认为0(无边框) - padding: 5, - // 提示内边距,单位px,默认各方向内边距为5, - // 接受数组分别设定上右下左边距,同css - axisPointer: { // 坐标轴指示器,坐标轴触发有效 - type: 'line', - // 默认为直线,可选为:'line' | 'shadow' | 'cross' - lineStyle: { // 直线指示器样式设置 - color: '#48b', - width: 2, - type: 'solid' - }, - crossStyle: { - color: '#1e90ff', - width: 1, - type: 'dashed' - }, - shadowStyle: { // 阴影指示器样式设置 - color: 'rgba(150,150,150,0.3)', - // 阴影颜色 - width: 'auto', - // 阴影大小 - type: 'default' - } - }, - textStyle: { - color: '#fff' - } - }, - - // 区域缩放控制器 - dataZoom: { - show: false, - orient: 'horizontal', - // 布局方式,默认为水平布局,可选为: - // 'horizontal' ¦ 'vertical' - // x: {number}, // 水平安放位置,默认为根据grid参数适配,可选为: - // {number}(x坐标,单位px) - // y: {number}, // 垂直安放位置,默认为根据grid参数适配,可选为: - // {number}(y坐标,单位px) - // width: {number}, // 指定宽度,横向布局时默认为根据grid参数适配 - // height: {number}, // 指定高度,纵向布局时默认为根据grid参数适配 - backgroundColor: 'rgba(0,0,0,0)', - // 背景颜色 - dataBackgroundColor: '#eee', - // 数据背景颜色 - fillerColor: 'rgba(144,197,237,0.2)', - // 填充颜色 - handleColor: 'rgba(70,130,180,0.8)', - // 手柄颜色 - // xAxisIndex: [], // 默认控制所有横向类目 - // yAxisIndex: [], // 默认控制所有横向类目 - // start: 0, // 默认为0 - // end: 100, // 默认为全部 100% - realtime: true - // zoomLock: false // 是否锁定选择区域大小 - }, - - // 网格 - grid: { - x: 80, - y: 60, - x2: 80, - y2: 60, - // width: {totalWidth} - x - x2, - // height: {totalHeight} - y - y2, - backgroundColor: 'rgba(0,0,0,0)', - borderWidth: 1, - borderColor: '#ccc' - }, - - // 类目轴 - categoryAxis: { - position: 'bottom', - // 位置 - name: '', - // 坐标轴名字,默认为空 - nameLocation: 'end', - // 坐标轴名字位置,支持'start' | 'end' - nameTextStyle: {}, - // 坐标轴文字样式,默认取全局样式 - boundaryGap: true, - // 类目起始和结束两端空白策略 - axisLine: { // 坐标轴线 - show: true, - // 默认显示,属性show控制显示与否 - onZero: true, - lineStyle: { // 属性lineStyle控制线条样式 - color: '#48b', - width: 2, - type: 'solid' - } - }, - axisTick: { // 坐标轴小标记 - show: true, - // 属性show控制显示与否,默认不显示 - interval: 'auto', - inside: false, - // 控制小标记是否在grid里 - // onGap: null, - length: 5, - // 属性length控制线长 - lineStyle: { // 属性lineStyle控制线条样式 - color: '#333', - width: 1 - } - }, - axisLabel: { // 坐标轴文本标签,详见axis.axisLabel - show: true, - interval: 'auto', - rotate: 0, - margin: 8, - // clickable: false, - // formatter: null, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#333' - } - }, - splitLine: { // 分隔线 - show: true, - // 默认显示,属性show控制显示与否 - // onGap: null, - lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 - color: ['#ccc'], - width: 1, - type: 'solid' - } - }, - splitArea: { // 分隔区域 - show: false, - // 默认不显示,属性show控制显示与否 - // onGap: null, - areaStyle: { // 属性areaStyle(详见areaStyle)控制区域样式 - color: ['rgba(250,250,250,0.3)', 'rgba(200,200,200,0.3)'] - } - } - }, - - // 数值型坐标轴默认参数 - valueAxis: { - position: 'left', - // 位置 - name: '', - // 坐标轴名字,默认为空 - nameLocation: 'end', - // 坐标轴名字位置,支持'start' | 'end' - nameTextStyle: {}, - // 坐标轴文字样式,默认取全局样式 - boundaryGap: [0, 0], - // 数值起始和结束两端空白策略 - // min: null, // 最小值 - // max: null, // 最大值 - // scale: false, // 脱离0值比例,放大聚焦到最终_min,_max区间 - precision: 0, - // 小数精度,默认为0,无小数点 - power: 100, - // 整数精度,默认为100,个位和百位为0 - splitNumber: 5, - // 分割段数,默认为5 - axisLine: { // 坐标轴线 - show: true, - // 默认显示,属性show控制显示与否 - onZero: true, - lineStyle: { // 属性lineStyle控制线条样式 - color: '#48b', - width: 2, - type: 'solid' - } - }, - axisTick: { // 坐标轴小标记 - show: false, - // 属性show控制显示与否,默认不显示 - inside: false, - // 控制小标记是否在grid里 - length: 5, - // 属性length控制线长 - lineStyle: { // 属性lineStyle控制线条样式 - color: '#333', - width: 1 - } - }, - axisLabel: { // 坐标轴文本标签,详见axis.axisLabel - show: true, - rotate: 0, - margin: 8, - // clickable: false, - // formatter: null, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#333' - } - }, - splitLine: { // 分隔线 - show: true, - // 默认显示,属性show控制显示与否 - lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 - color: ['#ccc'], - width: 1, - type: 'solid' - } - }, - splitArea: { // 分隔区域 - show: false, - // 默认不显示,属性show控制显示与否 - areaStyle: { // 属性areaStyle(详见areaStyle)控制区域样式 - color: ['rgba(250,250,250,0.3)', 'rgba(200,200,200,0.3)'] - } - } - }, - - polar: { - center: ['50%', '50%'], - // 默认全局居中 - radius: '75%', - startAngle: 90, - splitNumber: 5, - name: { - show: true, - // formatter: null, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#333' - } - }, - axisLine: { // 坐标轴线 - show: true, - // 默认显示,属性show控制显示与否 - lineStyle: { // 属性lineStyle控制线条样式 - color: '#ccc', - width: 1, - type: 'solid' - } - }, - axisLabel: { // 坐标轴文本标签,详见axis.axisLabel - show: false, - // formatter: null, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#333' - } - }, - splitArea: { - show: true, - areaStyle: { - color: ['rgba(250,250,250,0.3)', 'rgba(200,200,200,0.3)'] - } - }, - splitLine: { - show: true, - lineStyle: { - width: 1, - color: '#ccc' - } - }, - type: 'polygon' - //indicator : [] - }, - - timeline: { - show: true, - type: 'time', - // 模式是时间类型,支持 number - notMerge: false, - realtime: true, - x: 80, - // y: {number}, - x2: 80, - y2: 0, - // width: {totalWidth} - x - x2, - height: 50, - backgroundColor: 'rgba(0,0,0,0)', - // 时间轴背景颜色 - borderColor: '#ccc', - // 时间轴边框颜色 - borderWidth: 0, - // 时间轴边框线宽,单位px,默认为0(无边框) - padding: 5, - // 时间轴内边距,单位px,默认各方向内边距为5, - controlPosition: 'left', - // 'right' | 'none' - autoPlay: false, - loop: true, - playInterval: 2000, - // 播放时间间隔,单位ms - lineStyle: { - width: 1, - color: '#666', - type: 'dashed' - }, - label: { // 文本标签 - show: true, - interval: 'auto', - rotate: 0, - // formatter: null, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#333' - } - }, - checkpointStyle: { - symbol: 'auto', - symbolSize: 'auto', - color: 'auto', - borderColor: 'auto', - borderWidth: 'auto', - label: { // 文本标签 - show: false, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: 'auto' - } - } - }, - controlStyle: { - normal: { - color: '#333' - }, - emphasis: { - color: '#1e90ff' - } - }, - symbol: 'emptyDiamond', - symbolSize: 4, - currentIndex: 0 - // data : [] - }, - - // 柱形图默认参数 - bar: { - // stack: null - xAxisIndex: 0, - yAxisIndex: 0, - barMinHeight: 0, - // 最小高度改为0 - // barWidth: null, // 默认自适应 - barGap: '30%', - // 柱间距离,默认为柱形宽度的30%,可设固定值 - barCategoryGap: '20%', - // 类目间柱形距离,默认为类目间距的20%,可设固定值 - itemStyle: { - normal: { - // color: '各异', - borderColor: '#fff', - // 柱条边线 - borderRadius: 0, - // 柱条边线圆角,单位px,默认为0 - borderWidth: 0, - // 柱条边线线宽,单位px,默认为1 - label: { - show: false - // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - }, - emphasis: { - // color: '各异', - borderColor: '#fff', - // 柱条边线 - borderRadius: 0, - // 柱条边线圆角,单位px,默认为0 - borderWidth: 0, - // 柱条边线线宽,单位px,默认为1 - label: { - show: false - // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - } - } - }, - - // 折线图默认参数 - line: { - // stack: null - xAxisIndex: 0, - yAxisIndex: 0, - itemStyle: { - normal: { - // color: 各异, - label: { - show: false - // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - lineStyle: { - width: 2, - type: 'solid', - shadowColor: 'rgba(0,0,0,0)', - //默认透明 - shadowBlur: 0, - shadowOffsetX: 0, - shadowOffsetY: 0 - } - }, - emphasis: { - // color: 各异, - label: { - show: false - // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - } - }, - //smooth : false, - //symbol: null, // 拐点图形类型 - symbolSize: 2, - // 拐点图形大小 - //symbolRotate : null, // 拐点图形旋转控制 - showAllSymbol: false // 标志图形默认只有主轴显示(随主轴标签间隔隐藏策略) - }, - - // K线图默认参数 - k: { - xAxisIndex: 0, - yAxisIndex: 0, - // barWidth : null // 默认自适应 - // barMaxWidth : null // 默认自适应 - itemStyle: { - normal: { - color: '#fff', - // 阳线填充颜色 - color0: '#00aa11', - // 阴线填充颜色 - lineStyle: { - width: 1, - color: '#ff3200', - // 阳线边框颜色 - color0: '#00aa11' // 阴线边框颜色 - } - }, - emphasis: { - // color: 各异, - // color0: 各异 - } - } - }, - - // 散点图默认参数 - scatter: { - xAxisIndex: 0, - yAxisIndex: 0, - //symbol: null, // 图形类型 - symbolSize: 4, - // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 - //symbolRotate : null, // 图形旋转控制 - large: false, - // 大规模散点图 - largeThreshold: 2000, - // 大规模阀值,large为true且数据量>largeThreshold才启用大规模模式 - itemStyle: { - normal: { - // color: 各异, - label: { - show: false, - // 标签文本格式器,同Tooltip.formatter,不支持回调 - formatter: function (a, b, c) { - if (typeof c[2] != 'undefined') { - return c[2]; - } - else { - return c[0] + ' , ' + c[1]; - } - } - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - }, - emphasis: { - // color: '各异' - label: { - show: false, - // 标签文本格式器,同Tooltip.formatter,不支持回调 - formatter: function (a, b, c) { - if (typeof c[2] != 'undefined') { - return c[2]; - } - else { - return c[0] + ' , ' + c[1]; - } - } - // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 - // 'inside'|'left'|'right'|'top'|'bottom' - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - } - } - } - }, - - // 雷达图默认参数 - radar: { - polarIndex: 0, - itemStyle: { - normal: { - // color: 各异, - label: { - show: false - }, - lineStyle: { - width: 2, - type: 'solid' - } - }, - emphasis: { - // color: 各异, - label: { - show: false - } - } - }, - //symbol: null, // 拐点图形类型 - symbolSize: 2 // 可计算特性参数,空数据拖拽提示图形大小 - //symbolRotate : null, // 图形旋转控制 - }, - - // 饼图默认参数 - pie: { - center: ['50%', '50%'], - // 默认全局居中 - radius: [0, '75%'], - clockWise: true, - // 默认顺时针 - startAngle: 90, - minAngle: 0, - // 最小角度改为0 - selectedOffset: 10, - // 选中是扇区偏移量 - // selectedMode: false, // 选择模式,默认关闭,可选single,multiple - // roseType : null, // 南丁格尔玫瑰图模式,'radius'(半径) | 'area'(面积) - itemStyle: { - normal: { - // color: 各异, - borderColor: 'rgba(0,0,0,0)', - borderWidth: 1, - label: { - show: true, - position: 'outer' - // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - labelLine: { - show: true, - length: 20, - lineStyle: { - // color: 各异, - width: 1, - type: 'solid' - } - } - }, - emphasis: { - // color: 各异, - borderColor: 'rgba(0,0,0,0)', - borderWidth: 1, - label: { - show: false - // position: 'outer' - // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - labelLine: { - show: false, - length: 20, - lineStyle: { - // color: 各异, - width: 1, - type: 'solid' - } - } - } - } - }, - - map: { - mapType: 'china', - // 各省的mapType暂时都用中文 - //mapLocation: { - // x : 'center' | 'left' | 'right' | 'x%' | {number}, - // y : 'center' | 'top' | 'bottom' | 'x%' | {number} - // width // 自适应 - // height // 自适应 - //}, - // mapValueCalculation: 'sum', // 数值合并方式,默认加和,可选为: - // 'sum' | 'average' | 'max' | 'min' - mapValuePrecision: 0, - // 地图数值计算结果小数精度 - showLegendSymbol: true, - // 显示图例颜色标识(系列标识的小圆点),存在legend时生效 - // selectedMode: false, // 选择模式,默认关闭,可选single,multiple - hoverable: true, - // roam : false, // 是否开启缩放及漫游模式 - // scaleLimit : null, - itemStyle: { - normal: { - // color: 各异, - borderColor: 'rgba(0,0,0,0)', - borderWidth: 1, - areaStyle: { - color: '#ccc' - }, - label: { - show: false, - textStyle: { - color: 'rgb(139,69,19)' - } - } - }, - emphasis: { // 也是选中样式 - // color: 各异, - borderColor: 'rgba(0,0,0,0)', - borderWidth: 1, - areaStyle: { - color: 'rgba(255,215,0,0.8)' - }, - label: { - show: false, - textStyle: { - color: 'rgb(100,0,0)' - } - } - } - } - }, - - force: { - // 布局中心 - center: ['50%', '50%'], - - // 布局大小 - size: '100%', - - // 布局冷却因子,值越小结束时间越短,值越大时间越长但是结果也越收敛 - coolDown: 0.99, - - // 数据映射到圆的半径的最小值和最大值 - minRadius: 10, - maxRadius: 20, - - // 是否根据屏幕比例拉伸 - ratioScaling: false, - - // 在 500+ 顶点的图上建议设置 large 为 true, 会使用 Barnes-Hut simulation - // 同时开启 useWorker 并且把 steps 值调大 - // 关于Barnes-Hut simulation: http://en.wikipedia.org/wiki/Barnes–Hut_simulation - large: false, - - // 是否在浏览器支持 worker 的时候使用 web worker - useWorker: false, - // 每一帧 force 迭代的次数,仅在启用webworker的情况下有用 - steps: 1, - - // 布局缩放因子,并不完全精确, 效果跟布局大小类似 - scaling: 1.0, - - // 向心力因子,越大向心力越大( 所有顶点会往 center 的位置收拢 ) - gravity: 1, - - symbol: 'circle', - // symbolSize 为 0 的话使用映射到minRadius-maxRadius后的值 - symbolSize: 0, - - linkSymbol: null, - linkSymbolSize: [10, 15], - draggable: true, - - // 分类里如果有样式会覆盖节点默认样式 - categories: [{ - // itemStyle - // symbol - // symbolSize - // name - }], - itemStyle: { - normal: { - // color: 各异, - label: { - show: false - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - nodeStyle: { - brushType: 'both', - color: '#f08c2e', - strokeColor: '#5182ab', - lineWidth: 1 - }, - linkStyle: { - strokeColor: '#5182ab' - } - }, - emphasis: { - // color: 各异, - label: { - show: false - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - nodeStyle: {}, - linkStyle: { - opacity: 0 - } - } - } - // nodes: [{ - // name: 'xxx', - // value: 1, - // itemStyle: {}, - // initial: [0, 0], - // fixX: false, - // fixY: false, - // ignore: false, - // symbol: 'circle', - // symbolSize: 0 - // }] - // links: [{ - // source: 1, - // target: 2, - // weight: 1, - // itemStyle: {} - // }, { - // source: 'xxx', - // target: 'ooo' - // }] - }, - - chord: { - radius: ['65%', '75%'], - center: ['50%', '50%'], - padding: 2, - sort: 'none', - // can be 'none', 'ascending', 'descending' - sortSub: 'none', - // can be 'none', 'ascending', 'descending' - startAngle: 90, - clockWise: true, - showScale: false, - showScaleText: false, - itemStyle: { - normal: { - label: { - show: true, - rotate: false, - distance: 10 - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - lineStyle: { - width: 0, - color: '#000' - }, - chordStyle: { - lineStyle: { - width: 1, - color: '#999' - } - } - }, - emphasis: { - lineStyle: { - width: 0, - color: '#000' - }, - chordStyle: { - lineStyle: { - width: 1, - color: '#666' - } - } - } - }, - // Source data matrix - /** - * target - * -1--2--3--4--5- - * 1| x x x x x - * 2| x x x x x - * 3| x x x x x source - * 4| x x x x x - * 5| x x x x x - * - * Relation ship from source to target - * https://github.com/mbostock/d3/wiki/Chord-Layout#wiki-chord - * - * Row based - */ - matrix: [] - }, - - gauge: { - center: ['50%', '50%'], - // 默认全局居中 - radius: '75%', - startAngle: 225, - endAngle: -45, - min: 0, - // 最小值 - max: 100, - // 最大值 - precision: 0, - // 小数精度,默认为0,无小数点 - splitNumber: 10, - // 分割段数,默认为10 - axisLine: { // 坐标轴线 - show: true, - // 默认显示,属性show控制显示与否 - lineStyle: { // 属性lineStyle控制线条样式 - color: [ - [0.2, '#228b22'], - [0.8, '#48b'], - [1, '#ff4500'] - ], - width: 30 - } - }, - axisTick: { // 坐标轴小标记 - show: true, - // 属性show控制显示与否,默认不显示 - splitNumber: 5, - // 每份split细分多少段 - length: 8, - // 属性length控制线长 - lineStyle: { // 属性lineStyle控制线条样式 - color: '#eee', - width: 1, - type: 'solid' - } - }, - axisLabel: { // 坐标轴文本标签,详见axis.axisLabel - show: true, - // formatter: null, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: 'auto' - } - }, - splitLine: { // 分隔线 - show: true, - // 默认显示,属性show控制显示与否 - length: 30, - // 属性length控制线长 - lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 - color: '#eee', - width: 2, - type: 'solid' - } - }, - pointer: { - show: true, - length: '80%', - width: 8, - color: 'auto' - }, - title: { - show: true, - offsetCenter: [0, '-40%'], - // x, y,单位px - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: '#333', - fontSize: 15 - } - }, - detail: { - show: true, - backgroundColor: 'rgba(0,0,0,0)', - borderWidth: 0, - borderColor: '#ccc', - width: 100, - height: 40, - offsetCenter: [0, '40%'], - // x, y,单位px - // formatter: null, - textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE - color: 'auto', - fontSize: 30 - } - } - }, - - funnel: { - x: 80, - y: 60, - x2: 80, - y2: 60, - // width: {totalWidth} - x - x2, - // height: {totalHeight} - y - y2, - min: 0, - max: 100, - minSize: '0%', - maxSize: '100%', - sort: 'descending', - // 'ascending', 'descending' - gap: 0, - itemStyle: { - normal: { - // color: 各异, - borderColor: '#fff', - borderWidth: 1, - label: { - show: true, - position: 'outer' - // formatter: 标签文本格式器,同Tooltip.formatter,不支持回调 - // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE - }, - labelLine: { - show: true, - length: 10, - lineStyle: { - // color: 各异, - width: 1, - type: 'solid' - } - } - }, - emphasis: { - // color: 各异, - borderColor: 'rgba(0,0,0,0)', - borderWidth: 1, - label: { - show: true - }, - labelLine: { - show: true - } - } - } - }, - - island: { - r: 15, - calculateStep: 0.1 // 滚轮可计算步长 0.1 = 10% - }, - markPoint: { + clickable: true, symbol: 'pin', // 标注类型 symbolSize: 10, // 标注大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 - //symbolRotate : null, // 标注旋转控制 + // symbolRotate: null, // 标注旋转控制 large: false, effect: { show: false, loop: true, period: 15, // 运动周期,无单位,值越大越慢 - scaleSize: 2 // 放大倍数,以markPoint点size为基准 - // color : 'gold', - // shadowColor : 'rgba(255,215,0,0.8)', - // shadowBlur : 0 // 炫光模糊 + type: 'scale', + // 可用为 scale | bounce + scaleSize: 2, + // 放大倍数,以markPoint点size为基准 + bounceDistance: 10 // 跳动距离,单位px + // color: 'gold', + // shadowColor: 'rgba(255,215,0,0.8)', + // shadowBlur: 0 // 炫光模糊 }, itemStyle: { normal: { // color: 各异, - // borderColor: 各异, // 标注边线颜色,优先于color + // borderColor: 各异, // 标注边线颜色,优先于color borderWidth: 2, // 标注边线线宽,单位px,默认为1 label: { show: true, // 标签文本格式器,同Tooltip.formatter,不支持回调 - // formatter : null, + // formatter: null, position: 'inside' // 可选为'left'|'right'|'top'|'bottom' // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE } @@ -1237,7 +88,7 @@ var config = { label: { show: true // 标签文本格式器,同Tooltip.formatter,不支持回调 - // formatter : null, + // formatter: null, // position: 'inside' // 'left'|'right'|'top'|'bottom' // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE } @@ -1246,34 +97,37 @@ var config = { }, markLine: { + clickable: true, // 标线起始和结束的symbol介绍类型,如果都一样,可以直接传string symbol: ['circle', 'arrow'], // 标线起始和结束的symbol大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 symbolSize: [2, 4], // 标线起始和结束的symbol旋转控制 - //symbolRotate : null, - //smooth : false, - large: false, + //symbolRotate: null, + //smooth: false, + smoothRadian: 0.2, + // 平滑弧度 + precision: 2, effect: { show: false, loop: true, period: 15, // 运动周期,无单位,值越大越慢 scaleSize: 2 // 放大倍数,以markLine线lineWidth为基准 - // color : 'gold', - // shadowColor : 'rgba(255,215,0,0.8)', - // shadowBlur : lineWidth * 2 // 炫光模糊,默认等于scaleSize计算所得 + // color: 'gold', + // shadowColor: 'rgba(255,215,0,0.8)', + // shadowBlur: lineWidth * 2 // 炫光模糊,默认等于scaleSize计算所得 }, itemStyle: { normal: { - // color: 各异, // 标线主色,线色,symbol主色 + // color: 各异, // 标线主色,线色,symbol主色 // borderColor: 随color, // 标线symbol边框颜色,优先于color borderWidth: 1.5, // 标线symbol边框线宽,单位px,默认为2 label: { show: true, // 标签文本格式器,同Tooltip.formatter,不支持回调 - // formatter : null, + // formatter: null, // 可选为 'start'|'end'|'left'|'right'|'top'|'bottom' position: 'end' // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE @@ -1282,7 +136,7 @@ var config = { // color: 随borderColor, // 主色,线色,优先级高于borderColor和color // width: 随borderWidth, // 优先于borderWidth type: 'dashed' - // shadowColor : 'rgba(0,0,0,0)', //默认透明 + // shadowColor: 'rgba(0,0,0,0)', //默认透明 // shadowBlur: 0, // shadowOffsetX: 0, // shadowOffsetY: 0 @@ -1293,7 +147,7 @@ var config = { label: { show: false // 标签文本格式器,同Tooltip.formatter,不支持回调 - // formatter : null, + // formatter: null, // position: 'inside' // 'left'|'right'|'top'|'bottom' // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE }, @@ -1319,30 +173,42 @@ var config = { RESTORE: 'restore', RESIZE: 'resize', CLICK: 'click', + DBLCLICK: 'dblclick', HOVER: 'hover', + MOUSEOUT: 'mouseout', //MOUSEWHEEL: 'mousewheel', // -------业务交互逻辑 DATA_CHANGED: 'dataChanged', DATA_ZOOM: 'dataZoom', DATA_RANGE: 'dataRange', + DATA_RANGE_SELECTED: 'dataRangeSelected', + DATA_RANGE_HOVERLINK: 'dataRangeHoverLink', LEGEND_SELECTED: 'legendSelected', + LEGEND_HOVERLINK: 'legendHoverLink', MAP_SELECTED: 'mapSelected', PIE_SELECTED: 'pieSelected', MAGIC_TYPE_CHANGED: 'magicTypeChanged', DATA_VIEW_CHANGED: 'dataViewChanged', TIMELINE_CHANGED: 'timelineChanged', MAP_ROAM: 'mapRoam', + FORCE_LAYOUT_END: 'forceLayoutEnd', // -------内部通信 TOOLTIP_HOVER: 'tooltipHover', TOOLTIP_IN_GRID: 'tooltipInGrid', - TOOLTIP_OUT_GRID: 'tooltipOutGrid' + TOOLTIP_OUT_GRID: 'tooltipOutGrid', + ROAMCONTROLLER: 'roamController' }, DRAG_ENABLE_TIME: 120, // 降低图表内元素拖拽敏感度,单位ms,不建议外部干预 - EFFECT_ZLEVEL: 7, + EFFECT_ZLEVEL: 10, + // 特效动画zlevel // 主题,默认标志图形类型列表 symbolList: ['circle', 'rectangle', 'triangle', 'diamond', 'emptyCircle', 'emptyRectangle', 'emptyTriangle', 'emptyDiamond'], - loadingText: 'Loading...', + loadingEffect: 'spin', + loadingText: '数据读取中...', + noDataEffect: 'bubble', + noDataText: '暂无数据', + // noDataLoadingOption: null, // 可计算特性配置,孤岛,提示颜色 calculable: false, // 默认关闭可计算特性 @@ -1351,13 +217,17 @@ var config = { calculableHolderColor: '#ccc', // 可计算占位提示颜色 nameConnector: ' & ', - valueConnector: ' : ', + valueConnector: ': ', animation: true, + // 过渡动画是否开启 addDataAnimation: true, // 动态数据接口是否开启动画效果 animationThreshold: 2000, // 动画元素阀值,产生的图形原素超过2000不出动画 animationDuration: 2000, + // 过渡动画参数:进入 + animationDurationUpdate: 500, + // 过渡动画参数:更新 animationEasing: 'ExponentialOut' //BounceOut }; diff --git a/src/data/Graph.js b/src/data/Graph.js new file mode 100644 index 0000000..0432792 --- /dev/null +++ b/src/data/Graph.js @@ -0,0 +1,476 @@ +'use strict'; +/** + * Graph data structure + * + * @module echarts/data/Graph + * @author Yi Shen(https://www.github.com/pissang) + */ + + +/** + * @alias module:echarts/data/Graph + * @constructor + * @param {boolean} directed + */ +var Graph = function (directed) { + /** + * 是否是有向图 + * @type {boolean} + * @private + */ + this._directed = directed || false; + + /** + * @type {Array} + */ + this.nodes = []; + this.edges = []; + + this._nodesMap = {}; + this._edgesMap = {}; +}; + +/** + * 是否是有向图 + * @return {boolean} + */ +Graph.prototype.isDirected = function () { + return this._directed; +}; + +/** + * 添加一个新的节点 + * @param {string} id 节点名称 + * @param {*} [data] 存储的数据 + */ +Graph.prototype.addNode = function (id, data) { + if (this._nodesMap[id]) { + return this._nodesMap[id]; + } + + var node = new Graph.Node(id, data); + + this.nodes.push(node); + + this._nodesMap[id] = node; + return node; +}; + +/** + * 获取节点 + * @param {string} id + * @return {module:echarts/data/Graph~Node} + */ +Graph.prototype.getNodeById = function (id) { + return this._nodesMap[id]; +}; + +/** + * 添加边 + * @param {string|module:echarts/data/Graph~Node} n1 + * @param {string|module:echarts/data/Graph~Node} n2 + * @param {*} data + * @return {module:echarts/data/Graph~Edge} + */ +Graph.prototype.addEdge = function (n1, n2, data) { + if (typeof(n1) == 'string') { + n1 = this._nodesMap[n1]; + } + if (typeof(n2) == 'string') { + n2 = this._nodesMap[n2]; + } + if (!n1 || !n2) { + return; + } + + var key = n1.id + '-' + n2.id; + if (this._edgesMap[key]) { + return this._edgesMap[key]; + } + + var edge = new Graph.Edge(n1, n2, data); + + if (this._directed) { + n1.outEdges.push(edge); + n2.inEdges.push(edge); + } + n1.edges.push(edge); + if (n1 !== n2) { + n2.edges.push(edge); + } + + this.edges.push(edge); + this._edgesMap[key] = edge; + + return edge; +}; + +/** + * 移除边 + * @param {module:echarts/data/Graph~Edge} edge + */ +Graph.prototype.removeEdge = function (edge) { + var n1 = edge.node1; + var n2 = edge.node2; + var key = n1.id + '-' + n2.id; + if (this._directed) { + n1.outEdges.splice(util.indexOf(n1.outEdges, edge), 1); + n2.inEdges.splice(util.indexOf(n2.inEdges, edge), 1); + } + n1.edges.splice(util.indexOf(n1.edges, edge), 1); + if (n1 !== n2) { + n2.edges.splice(util.indexOf(n2.edges, edge), 1); + } + + delete this._edgesMap[key]; + this.edges.splice(util.indexOf(this.edges, edge), 1); +}; + +/** + * 获取边 + * @param {module:echarts/data/Graph~Node|string} n1 + * @param {module:echarts/data/Graph~Node|string} n2 + * @return {module:echarts/data/Graph~Edge} + */ +Graph.prototype.getEdge = function (n1, n2) { + if (typeof(n1) !== 'string') { + n1 = n1.id; + } + if (typeof(n2) !== 'string') { + n2 = n2.id; + } + + if (this._directed) { + return this._edgesMap[n1 + '-' + n2]; + } else { + return this._edgesMap[n1 + '-' + n2] || this._edgesMap[n2 + '-' + n1]; + } +}; + +/** + * 移除节点(及其邻接边) + * @param {module:echarts/data/Graph~Node|string} node + */ +Graph.prototype.removeNode = function (node) { + if (typeof(node) === 'string') { + node = this._nodesMap[node]; + if (!node) { + return; + } + } + + delete this._nodesMap[node.id]; + this.nodes.splice(util.indexOf(this.nodes, node), 1); + + for (var i = 0; i < this.edges.length;) { + var edge = this.edges[i]; + if (edge.node1 === node || edge.node2 === node) { + this.removeEdge(edge); + } else { + i++; + } + } +}; + +/** + * 遍历并且过滤指定的节点 + * @param {Function} cb + * @param {*} [context] + */ +Graph.prototype.filterNode = function (cb, context) { + var len = this.nodes.length; + for (var i = 0; i < len;) { + if (cb.call(context, this.nodes[i], i)) { + i++; + } else { + this.removeNode(this.nodes[i]); + len--; + } + } +}; + +/** + * 遍历并且过滤指定的边 + * @param {Function} cb + * @param {*} [context] + */ +Graph.prototype.filterEdge = function (cb, context) { + var len = this.edges.length; + for (var i = 0; i < len;) { + if (cb.call(context, this.edges[i], i)) { + i++; + } else { + this.removeEdge(this.edges[i]); + len--; + } + } +}; + +/** + * 线性遍历所有节点 + * @param {Function} cb + * @param {*} [context] + */ +Graph.prototype.eachNode = function (cb, context) { + var len = this.nodes.length; + for (var i = 0; i < len; i++) { + if (this.nodes[i]) { // 可能在遍历过程中存在节点删除 + cb.call(context, this.nodes[i], i); + } + } +}; + +/** + * 线性遍历所有边 + * @param {Function} cb + * @param {*} [context] + */ +Graph.prototype.eachEdge = function (cb, context) { + var len = this.edges.length; + for (var i = 0; i < len; i++) { + if (this.edges[i]) { // 可能在遍历过程中存在边删除 + cb.call(context, this.edges[i], i); + } + } +}; + +/** + * 清空图 + */ +Graph.prototype.clear = function () { + this.nodes.length = 0; + this.edges.length = 0; + + this._nodesMap = {}; + this._edgesMap = {}; +}; + +/** + * 广度优先遍历 + * @param {Function} cb + * @param {module:echarts/data/Graph~Node} startNode 遍历起始节点 + * @param {string} [direction=none] none, in, out 指定遍历边 + * @param {*} [context] 回调函数调用context + */ +Graph.prototype.breadthFirstTraverse = function ( +cb, startNode, direction, context) { + if (typeof(startNode) === 'string') { + startNode = this._nodesMap[startNode]; + } + if (!startNode) { + return; + } + + var edgeType = 'edges'; + if (direction === 'out') { + edgeType = 'outEdges'; + } else if (direction === 'in') { + edgeType = 'inEdges'; + } + + for (var i = 0; i < this.nodes.length; i++) { + this.nodes[i].__visited = false; + } + + if (cb.call(context, startNode, null)) { + return; + } + + var queue = [startNode]; + while (queue.length) { + var currentNode = queue.shift(); + var edges = currentNode[edgeType]; + + for (var i = 0; i < edges.length; i++) { + var e = edges[i]; + var otherNode = e.node1 === currentNode ? e.node2 : e.node1; + if (!otherNode.__visited) { + if (cb.call(otherNode, otherNode, currentNode)) { + // Stop traversing + return; + } + queue.push(otherNode); + otherNode.__visited = true; + } + } + } +}; + +/** + * 复制图 + */ +Graph.prototype.clone = function () { + var graph = new Graph(this._directed); + for (var i = 0; i < this.nodes.length; i++) { + graph.addNode(this.nodes[i].id, this.nodes[i].data); + } + for (var i = 0; i < this.edges.length; i++) { + var e = this.edges[i]; + graph.addEdge(e.node1.id, e.node2.id, e.data); + } + return graph; +}; + +/** + * 图节点 + * @alias module:echarts/data/Graph~Node + * @param {string} id + * @param {*} [data] + */ +var Node = function (id, data) { + /** + * 节点名称 + * @type {string} + */ + this.id = id; + /** + * 节点存储的数据 + * @type {*} + */ + this.data = data || null; + /** + * 入边,只在有向图上有效 + * @type {Array.} + */ + this.inEdges = []; + /** + * 出边,只在有向图上有效 + * @type {Array.} + */ + this.outEdges = []; + /** + * 邻接边 + * @type {Array.} + */ + this.edges = []; +}; + +/** + * 度 + * @return {number} + */ +Node.prototype.degree = function () { + return this.edges.length; +}; + +/** + * 入度,只在有向图上有效 + * @return {number} + */ +Node.prototype.inDegree = function () { + return this.inEdges.length; +}; + +/** + * 出度,只在有向图上有效 + * @return {number} + */ +Node.prototype.outDegree = function () { + return this.outEdges.length; +}; + +/** + * 图边 + * @alias module:echarts/data/Graph~Edge + * @param {module:echarts/data/Graph~Node} node1 + * @param {module:echarts/data/Graph~Node} node2 + * @param {extra} data + */ +var Edge = function (node1, node2, data) { + /** + * 节点1,如果是有向图则为源节点 + * @type {module:echarts/data/Graph~Node} + */ + this.node1 = node1; + /** + * 节点2,如果是有向图则为目标节点 + * @type {module:echarts/data/Graph~Node} + */ + this.node2 = node2; + + /** + * 边存储的数据 + * @type {*} + */ + this.data = data || null; +}; + +Graph.Node = Node; +Graph.Edge = Edge; + +/** + * 从邻接矩阵生成 + * ``` + * TARGET + * -1--2--3--4--5- + * 1| x x x x x + * 2| x x x x x + * 3| x x x x x SOURCE + * 4| x x x x x + * 5| x x x x x + * ``` + * 节点的行列总和会被写到`node.data.value` + * 对于有向图会计算每一行的和写到`node.data.outValue`, + * 计算每一列的和写到`node.data.inValue`。 + * 边的权重会被然后写到`edge.data.weight`。 + * + * @method module:echarts/data/Graph.fromMatrix + * @param {Array.} nodesData 节点信息,必须有`id`属性, 会保存到`node.data`中 + * @param {Array} matrix 邻接矩阵 + * @param {boolean} directed 是否是有向图 + * @return {module:echarts/data/Graph} + */ +Graph.fromMatrix = function (nodesData, matrix, directed) { + if (!matrix || !matrix.length || (matrix[0].length !== matrix.length) || (nodesData.length !== matrix.length)) { + // Not a valid data + return; + } + + var size = matrix.length; + var graph = new Graph(directed); + + for (var i = 0; i < size; i++) { + var node = graph.addNode(nodesData[i].id, nodesData[i]); + // TODO + // node.data已经有value的情况 + node.data.value = 0; + if (directed) { + node.data.outValue = node.data.inValue = 0; + } + } + for (var i = 0; i < size; i++) { + for (var j = 0; j < size; j++) { + var item = matrix[i][j]; + if (directed) { + graph.nodes[i].data.outValue += item; + graph.nodes[j].data.inValue += item; + } + graph.nodes[i].data.value += item; + graph.nodes[j].data.value += item; + } + } + + for (var i = 0; i < size; i++) { + for (var j = i; j < size; j++) { + var item = matrix[i][j]; + if (item === 0) { + continue; + } + var n1 = graph.nodes[i]; + var n2 = graph.nodes[j]; + var edge = graph.addEdge(n1, n2, {}); + edge.data.weight = item; + if (i !== j) { + if (directed && matrix[j][i]) { + var inEdge = graph.addEdge(n2, n1, {}); + inEdge.data.weight = matrix[j][i]; + } + } + } + } + + // console.log(graph.edges.map(function (e) {return e.node1.id + '-' + e.node2.id;})) + return graph; +}; + +module.exports = Graph; \ No newline at end of file diff --git a/src/data/KDTree.js b/src/data/KDTree.js new file mode 100644 index 0000000..84aff2f --- /dev/null +++ b/src/data/KDTree.js @@ -0,0 +1,241 @@ +/** + * K-Dimension Tree + * + * @module echarts/data/KDTree + * @author Yi Shen(https://github.com/pissang) + */ + + +var quickSelect = require('./quickSelect.js'); + +function Node(axis, data) { + this.left = null; + this.right = null; + this.axis = axis; + + this.data = data; +}; + +/** + * @constructor + * @alias module:echarts/data/KDTree + * @param {Array} points List of points. + * each point needs an array property to repesent the actual data + * @param {Number} [dimension] + * Point dimension. + * Default will use the first point's length as dimensiont + */ +var KDTree = function (points, dimension) { + if (!points.length) { + return; + } + + if (!dimension) { + dimension = points[0].array.length; + } + this.dimension = dimension; + this.root = this._buildTree(points, 0, points.length - 1, 0); + + // Use one stack to avoid allocation + // each time searching the nearest point + this._stack = []; + // Again avoid allocating a new array + // each time searching nearest N points + this._nearstNList = []; +}; + +/** + * Resursively build the tree + */ +KDTree.prototype._buildTree = function (points, left, right, axis) { + if (right < left) { + return null; + } + + var medianIndex = Math.floor((left + right) / 2); + medianIndex = quickSelect( + points, left, right, medianIndex, function (a, b) { + return a.array[axis] - b.array[axis]; + }); + var median = points[medianIndex]; + + var node = new Node(axis, median); + + axis = (axis + 1) % this.dimension; + if (right > left) { + node.left = this._buildTree(points, left, medianIndex - 1, axis); + node.right = this._buildTree(points, medianIndex + 1, right, axis); + } + + return node; +}; + +/** + * Find nearest point + * @param {Array} target Target point + * @param {Function} squaredDistance Squared distance function + * @return {Array} Nearest point + */ +KDTree.prototype.nearest = function (target, squaredDistance) { + var curr = this.root; + var stack = this._stack; + var idx = 0; + var minDist = Infinity; + var nearestNode = null; + if (curr.data !== target) { + minDist = squaredDistance(curr.data, target); + nearestNode = curr; + } + + if (target.array[curr.axis] < curr.data.array[curr.axis]) { + // Left first + curr.right && (stack[idx++] = curr.right); + curr.left && (stack[idx++] = curr.left); + } + else { + // Right first + curr.left && (stack[idx++] = curr.left); + curr.right && (stack[idx++] = curr.right); + } + + while (idx--) { + curr = stack[idx]; + var currDist = target.array[curr.axis] - curr.data.array[curr.axis]; + var isLeft = currDist < 0; + var needsCheckOtherSide = false; + currDist = currDist * currDist; + // Intersecting right hyperplane with minDist hypersphere + if (currDist < minDist) { + currDist = squaredDistance(curr.data, target); + if (currDist < minDist && curr.data !== target) { + minDist = currDist; + nearestNode = curr; + } + needsCheckOtherSide = true; + } + if (isLeft) { + if (needsCheckOtherSide) { + curr.right && (stack[idx++] = curr.right); + } + // Search in the left area + curr.left && (stack[idx++] = curr.left); + } + else { + if (needsCheckOtherSide) { + curr.left && (stack[idx++] = curr.left); + } + // Search the right area + curr.right && (stack[idx++] = curr.right); + } + } + + return nearestNode.data; +}; + +KDTree.prototype._addNearest = function (found, dist, node) { + var nearestNList = this._nearstNList; + + // Insert to the right position + // Sort from small to large + for (var i = found - 1; i > 0; i--) { + if (dist >= nearestNList[i - 1].dist) { + break; + } + else { + nearestNList[i].dist = nearestNList[i - 1].dist; + nearestNList[i].node = nearestNList[i - 1].node; + } + } + + nearestNList[i].dist = dist; + nearestNList[i].node = node; +}; + +/** + * Find nearest N points + * @param {Array} target Target point + * @param {number} N + * @param {Function} squaredDistance Squared distance function + * @param {Array} [output] Output nearest N points + */ +KDTree.prototype.nearestN = function (target, N, squaredDistance, output) { + if (N <= 0) { + output.length = 0; + return output; + } + + var curr = this.root; + var stack = this._stack; + var idx = 0; + + var nearestNList = this._nearstNList; + for (var i = 0; i < N; i++) { + // Allocate + if (!nearestNList[i]) { + nearestNList[i] = {} + } + nearestNList[i].dist = 0; + nearestNList[i].node = null; + } + var currDist = squaredDistance(curr.data, target); + + var found = 0; + if (curr.data !== target) { + found++; + this._addNearest(found, currDist, curr); + } + + if (target.array[curr.axis] < curr.data.array[curr.axis]) { + // Left first + curr.right && (stack[idx++] = curr.right); + curr.left && (stack[idx++] = curr.left); + } + else { + // Right first + curr.left && (stack[idx++] = curr.left); + curr.right && (stack[idx++] = curr.right); + } + + while (idx--) { + curr = stack[idx]; + var currDist = target.array[curr.axis] - curr.data.array[curr.axis]; + var isLeft = currDist < 0; + var needsCheckOtherSide = false; + currDist = currDist * currDist; + // Intersecting right hyperplane with minDist hypersphere + if (found < N || currDist < nearestNList[found - 1].dist) { + currDist = squaredDistance(curr.data, target); + if ((found < N || currDist < nearestNList[found - 1].dist) && curr.data !== target) { + if (found < N) { + found++; + } + this._addNearest(found, currDist, curr); + } + needsCheckOtherSide = true; + } + if (isLeft) { + if (needsCheckOtherSide) { + curr.right && (stack[idx++] = curr.right); + } + // Search in the left area + curr.left && (stack[idx++] = curr.left); + } + else { + if (needsCheckOtherSide) { + curr.left && (stack[idx++] = curr.left); + } + // Search the right area + curr.right && (stack[idx++] = curr.right); + } + } + + // Copy to output + for (var i = 0; i < found; i++) { + output[i] = nearestNList[i].node.data; + } + output.length = found; + + return output; +} + +module.exports = KDTree; \ No newline at end of file diff --git a/src/data/Tree.js b/src/data/Tree.js new file mode 100644 index 0000000..bd2c223 --- /dev/null +++ b/src/data/Tree.js @@ -0,0 +1,134 @@ +/** + * Tree data structure + * + * @module echarts/data/Tree + * @author Yi Shen(https://www.github.com/pissang) + */ + + +/** + * @constructor module:echarts/data/Tree~TreeNode + * @param {string} id Node ID + */ + +function TreeNode(id) { + /** + * @type {string} + */ + this.id = id; + /** + * @type {number} + */ + this.depth = 0; + /** + * @type {number} + */ + this.height = 0; + /** + * @type {Array.} + */ + this.children = []; +} + +TreeNode.prototype.traverse = function (cb, context) { + cb.call(context, this); + + for (var i = 0; i < this.children.length; i++) { + this.children[i].traverse(cb, context); + } +}; + +TreeNode.prototype.updateDepthAndHeight = function (depth) { + var height = 0; + this.depth = depth; + for (var i = 0; i < this.children.length; i++) { + var child = this.children[i]; + child.updateDepthAndHeight(depth + 1); + if (child.height > height) { + height = child.height; + } + } + this.height = height + 1; +}; + +TreeNode.prototype.getNodeById = function (id) { + if (this.id === id) { + return this; + } + for (var i = 0; i < this.children.length; i++) { + var res = this.children[i].getNodeById(id); + if (res) { + return res; + } + } +}; + +/** + * @constructor + * @alias module:echarts/data/Tree + * @param {string} id + */ + +function Tree(id) { + /** + * @type {module:echarts/data/Tree~TreeNode} + */ + this.root = new TreeNode(id); +} + +Tree.prototype.traverse = function (cb, context) { + this.root.traverse(cb, context); +}; + +Tree.prototype.getSubTree = function (id) { + var root = this.getNodeById(id); + if (root) { + var tree = new Tree(root.id); + tree.root = root; + return tree; + } +}; + +Tree.prototype.getNodeById = function (id) { + return this.root.getNodeById(id); +}; + +// TODO +Tree.fromGraph = function (graph) { + + function buildHierarch(root) { + var graphNode = graph.getNodeById(root.id); + for (var i = 0; i < graphNode.outEdges.length; i++) { + var edge = graphNode.outEdges[i]; + var childTreeNode = treeNodesMap[edge.node2.id]; + root.children.push(childTreeNode); + buildHierarch(childTreeNode); + } + } + + var treeMap = {}; + var treeNodesMap = {}; + for (var i = 0; i < graph.nodes.length; i++) { + var node = graph.nodes[i]; + var treeNode; + if (node.inDegree() === 0) { + treeMap[node.id] = new Tree(node.id); + treeNode = treeMap[node.id].root; + } else { + treeNode = new TreeNode(node.id); + } + + treeNode.data = node.data; + + treeNodesMap[node.id] = treeNode; + } + var treeList = []; + for (var id in treeMap) { + buildHierarch(treeMap[id].root); + treeMap[id].root.updateDepthAndHeight(0); + treeList.push(treeMap[id]); + } + return treeList; +}; + +module.exports = Tree; \ No newline at end of file diff --git a/src/data/quickSelect.js b/src/data/quickSelect.js new file mode 100644 index 0000000..8791ffc --- /dev/null +++ b/src/data/quickSelect.js @@ -0,0 +1,79 @@ +/** + * Quick select n-th element in an array. + * + * Note: it will change the elements placement in array. + * + * @module echarts/data/quickSelect + * @author Yi Shen(https://github.com/pissang) + */ + + +function defaultCompareFunc(a, b) { + return a - b; +} + +function swapElement(list, idx0, idx1) { + var tmp = list[idx0]; + list[idx0] = list[idx1]; + list[idx1] = tmp; +} + +function select(list, left, right, nth, compareFunc) { + var pivotIdx = left; + while (right > left) { + var pivotIdx = Math.round((right + left) / 2); + var pivotValue = list[pivotIdx]; + // Swap pivot to the end + swapElement(list, pivotIdx, right); + pivotIdx = left; + for (var i = left; i <= right - 1; i++) { + if (compareFunc(pivotValue, list[i]) >= 0) { + swapElement(list, i, pivotIdx); + pivotIdx++; + } + } + swapElement(list, right, pivotIdx); + + if (pivotIdx === nth) { + return pivotIdx; + } else if (pivotIdx < nth) { + left = pivotIdx + 1; + } else { + right = pivotIdx - 1; + } + } + // Left == right + return left; +} + +/** + * @alias module:echarts/data/quickSelect + * @param {Array} list + * @param {number} [left] + * @param {number} [right] + * @param {number} nth + * @param {Function} [compareFunc] + * @example + * var quickSelect = require('echarts/data/quickSelect.js'); + * var list = [5, 2, 1, 4, 3] + * quickSelect(list, 3); + * quickSelect(list, 0, 3, 1, function (a, b) {return a - b}); + * + * @return {number} + */ + +function quickSelect(list, left, right, nth, compareFunc) { + if (arguments.length <= 3) { + nth = left; + if (arguments.length == 2) { + compareFunc = defaultCompareFunc; + } else { + compareFunc = right; + } + left = 0; + right = list.length - 1; + } + return select(list, left, right, nth, compareFunc); +} + +module.exports = quickSelect; \ No newline at end of file diff --git a/src/echarts.js b/src/echarts.js index 7d3f2f7..c47e8df 100644 --- a/src/echarts.js +++ b/src/echarts.js @@ -1,7 +1,7 @@ /*! * ECharts, a javascript interactive chart library. * - * Copyright (c) 2014, Baidu Inc. + * Copyright (c) 2015, Baidu Inc. * All rights reserved. * * LICENSE @@ -12,7 +12,7 @@ * echarts * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ @@ -27,17 +27,17 @@ var _idBase = new Date() - 0; var _instances = {}; // ECharts实例map索引 var DOM_ATTRIBUTE_KEY = '_echarts_instance_'; -self.version = '2.0.2'; +self.version = '2.2.0'; self.dependencies = { - zrender: '2.0.2' + zrender: '2.0.7' }; /** * 入口方法 */ self.init = function (dom, theme) { var zrender = require('./zrender/zrender.js'); - if (((zrender.version || '1.0.3').replace('.', '') - 0) < (self.dependencies.zrender.replace('.', '') - 0)) { - console.error('ZRender ' + (zrender.version || '1.0.3-') + ' is too old for ECharts ' + self.version + '. Current version need ZRender ' + self.dependencies.zrender + '+'); + if ((zrender.version.replace('.', '') - 0) < (self.dependencies.zrender.replace('.', '') - 0)) { + console.error('ZRender ' + zrender.version + ' is too old for ECharts ' + self.version + '. Current version need ZRender ' + self.dependencies.zrender + '+'); } dom = dom instanceof Array ? dom[0] : dom; @@ -55,6 +55,7 @@ self.init = function (dom, theme) { } _instances[key] = new Echarts(dom); _instances[key].id = key; + _instances[key].canvasSupported = _canvasSupported; _instances[key].setTheme(theme); return _instances[key]; @@ -82,7 +83,11 @@ zrUtil.merge(MessageCenter.prototype, zrEvent.Dispatcher.prototype, true); */ function Echarts(dom) { - this._themeConfig = zrUtil.clone(ecConfig); + // Fxxk IE11 for breaking initialization without a warrant; + // Just set something to let it be! + // by kener 2015-01-09 + dom.innerHTML = ''; + this._themeConfig = {}; // zrUtil.clone(ecConfig); this.dom = dom; // this._zr; @@ -129,7 +134,7 @@ var ZR_EVENT = require('./zrender/config.js').EVENT; * @inner * @type {Array} */ -var ZR_EVENT_LISTENS = ['CLICK', 'MOUSEOVER', 'DRAGSTART', 'DRAGEND', 'DRAGENTER', 'DRAGOVER', 'DRAGLEAVE', 'DROP']; +var ZR_EVENT_LISTENS = ['CLICK', 'DBLCLICK', 'MOUSEOVER', 'MOUSEOUT', 'DRAGSTART', 'DRAGEND', 'DRAGENTER', 'DRAGOVER', 'DRAGLEAVE', 'DROP']; /** * 对echarts的实例中的chartList属性成员,逐个进行方法调用,遍历顺序为逆序 @@ -172,7 +177,7 @@ Echarts.prototype = { eventPackage.event = event; self._messageCenter.dispatchWithContext(type, eventPackage, that); - if (type != 'HOVER') { + if (type != 'HOVER' && type != 'MOUSEOUT') { // 频繁事件直接抛出 setTimeout(function () { self._messageCenterOutSide.dispatchWithContext( type, eventPackage, that); @@ -188,7 +193,7 @@ Echarts.prototype = { return self.__onevent(param); }; for (var e in ecConfig.EVENT) { - if (e != 'CLICK' && e != 'HOVER' && e != 'MAP_ROAM') { + if (e != 'CLICK' && e != 'DBLCLICK' && e != 'HOVER' && e != 'MOUSEOUT' && e != 'MAP_ROAM') { this._messageCenter.bind(ecConfig.EVENT[e], this._onevent, this); } } @@ -226,6 +231,10 @@ Echarts.prototype = { componentLibrary.define('title', require('./component/title.js')); componentLibrary.define('tooltip', require('./component/tooltip.js')); componentLibrary.define('legend', require('./component/legend.js')); + + if (_zr.getWidth() === 0 || _zr.getHeight() === 0) { + console.error('Dom’s width & height should be ready before init.'); + } }, /** @@ -235,7 +244,7 @@ Echarts.prototype = { param.__echartsId = param.__echartsId || this.id; // 来自其他联动图表的事件 - var fromMyself = (param.__echartsId == this.id); + var fromMyself = (param.__echartsId === this.id); if (!this._curEventType) { this._curEventType = param.type; @@ -315,7 +324,7 @@ Echarts.prototype = { } // 多图联动,只做自己的一级事件分发,避免级联事件循环 - if (this._connected && fromMyself && this._curEventType == param.type) { + if (this._connected && fromMyself && this._curEventType === param.type) { for (var c in this._connected) { this._connected[c].connectedEventHandler(param); } @@ -343,6 +352,21 @@ Echarts.prototype = { } }, + /** + * 双击事件,响应zrender事件,包装后分发到Echarts层 + */ + _ondblclick: function (param) { + callChartListMethodReverse(this, 'ondblclick', param); + + if (param.target) { + var ecData = this._eventPackage(param.target); + if (ecData && ecData.seriesIndex != null) { + this._messageCenter.dispatch( + ecConfig.EVENT.DBLCLICK, param.event, ecData, this); + } + } + }, + /** * 鼠标移入事件,响应zrender事件,包装后分发到Echarts层 */ @@ -356,6 +380,19 @@ Echarts.prototype = { } }, + /** + * 鼠标移出事件,响应zrender事件,包装后分发到Echarts层 + */ + _onmouseout: function (param) { + if (param.target) { + var ecData = this._eventPackage(param.target); + if (ecData && ecData.seriesIndex != null) { + this._messageCenter.dispatch( + ecConfig.EVENT.MOUSEOUT, param.event, ecData, this); + } + } + }, + /** * dragstart回调,可计算特性实现 */ @@ -456,7 +493,7 @@ Echarts.prototype = { // 没有相互影响,直接刷新即可 if (this._status.needRefresh) { - this._zr.refresh(); + this._zr.refreshNextFrame(); } }, @@ -523,6 +560,7 @@ Echarts.prototype = { seriesIndex, dataIndex) : dataIndex; return { seriesIndex: seriesIndex, + seriesName: (ecData.get(target, 'series') || {}).name, dataIndex: dataIndex, data: ecData.get(target, 'data'), name: ecData.get(target, 'name'), @@ -533,12 +571,33 @@ Echarts.prototype = { return; }, + _noDataCheck: function (magicOption) { + var series = magicOption.series; + for (var i = 0, l = series.length; i < l; i++) { + if (series[i].type == ecConfig.CHART_TYPE_MAP || (series[i].data && series[i].data.length > 0) || (series[i].markPoint && series[i].markPoint.data && series[i].markPoint.data.length > 0) || (series[i].markLine && series[i].markLine.data && series[i].markLine.data.length > 0) || (series[i].nodes && series[i].nodes.length > 0) || (series[i].links && series[i].links.length > 0) || (series[i].matrix && series[i].matrix.length > 0) || (series[i].eventList && series[i].eventList.length > 0)) { + return false; // 存在任意数据则为非空数据 + } + } + // 空数据 + this.clear(); + var loadOption = (this._option && this._option.noDataLoadingOption) || this._themeConfig.noDataLoadingOption || ecConfig.noDataLoadingOption || { + text: (this._option && this._option.noDataText) || this._themeConfig.noDataText || ecConfig.noDataText, + effect: (this._option && this._option.noDataEffect) || this._themeConfig.noDataEffect || ecConfig.noDataEffect + }; + this.showLoading(loadOption); + return true; + }, + /** * 图表渲染 */ _render: function (magicOption) { this._mergeGlobalConifg(magicOption); + if (this._noDataCheck(magicOption)) { + return; + } + var bgColor = magicOption.backgroundColor; if (bgColor) { if (!_canvasSupported && bgColor.indexOf('rgba') != -1) { @@ -565,7 +624,7 @@ Echarts.prototype = { magicOption.dataZoom = magicOption.dataZoom || {}; } - var componentList = ['title', 'legend', 'tooltip', 'dataRange', 'grid', 'dataZoom', 'xAxis', 'yAxis', 'polar']; + var componentList = ['title', 'legend', 'tooltip', 'dataRange', 'roamController', 'grid', 'dataZoom', 'xAxis', 'yAxis', 'polar']; var ComponentClass; var componentType; @@ -756,7 +815,7 @@ Echarts.prototype = { 'nameConnector', 'valueConnector', // 动画相关 - 'animation', 'animationThreshold', 'animationDuration', 'animationEasing', 'addDataAnimation', + 'animation', 'animationThreshold', 'animationDuration', 'animationDurationUpdate', 'animationEasing', 'addDataAnimation', // 默认标志图形类型列表 'symbolList', @@ -768,20 +827,26 @@ Echarts.prototype = { while (len--) { var mergeItem = mergeList[len]; if (magicOption[mergeItem] == null) { - magicOption[mergeItem] = this._themeConfig[mergeItem]; + magicOption[mergeItem] = this._themeConfig[mergeItem] != null ? this._themeConfig[mergeItem] : ecConfig[mergeItem]; } } // 数值系列的颜色列表,不传则采用内置颜色,可配数组,借用zrender实例注入,会有冲突风险,先这样 var themeColor = magicOption.color; if (!(themeColor && themeColor.length)) { - themeColor = this._themeConfig.color; + themeColor = this._themeConfig.color || ecConfig.color; } this._zr.getColor = function (idx) { var zrColor = require('./zrender/tool/color.js'); return zrColor.getColor(idx, themeColor); }; + + if (!_canvasSupported) { + // 不支持Canvas的强制关闭动画 + magicOption.animation = false; + magicOption.addDataAnimation = false; + } }, /** @@ -934,7 +999,6 @@ Echarts.prototype = { dataGrow = params[i][3]; additionData = params[i][4]; - var seriesItem = optionRestore.series[seriesIdx]; var inMethod = isHead ? 'unshift' : 'push'; var outMethod = isHead ? 'pop' : 'shift'; @@ -949,12 +1013,11 @@ Echarts.prototype = { data = mSeriesItemData[outMethod](); } - if (additionData != null) { var legend; var legendData; - if (seriesItem.type == ecConfig.CHART_TYPE_PIE && (legend = optionRestore.legend) && (legendData = legend.data)) { + if (seriesItem.type === ecConfig.CHART_TYPE_PIE && (legend = optionRestore.legend) && (legendData = legend.data)) { var mLegendData = magicOption.legend.data; legendData[inMethod](additionData); mLegendData[inMethod](additionData); @@ -973,7 +1036,7 @@ Echarts.prototype = { var mAxisData; var axisIdx = seriesItem.xAxisIndex || 0; - if (typeof optionRestore.xAxis[axisIdx].type == 'undefined' || optionRestore.xAxis[axisIdx].type == 'category') { + if (optionRestore.xAxis[axisIdx].type == null || optionRestore.xAxis[axisIdx].type === 'category') { axisData = optionRestore.xAxis[axisIdx].data; mAxisData = magicOption.xAxis[axisIdx].data; @@ -987,7 +1050,7 @@ Echarts.prototype = { // y轴类目 axisIdx = seriesItem.yAxisIndex || 0; - if (optionRestore.yAxis[axisIdx].type == 'category') { + if (optionRestore.yAxis[axisIdx].type === 'category') { axisData = optionRestore.yAxis[axisIdx].data; mAxisData = magicOption.yAxis[axisIdx].data; @@ -1033,7 +1096,7 @@ Echarts.prototype = { ecConfig.EVENT.REFRESH, null, { option: magicOption }, self); - }, magicOption.addDataAnimation ? 500 : 0); + }, magicOption.addDataAnimation ? magicOption.animationDurationUpdate : 0); return this; }, @@ -1068,12 +1131,12 @@ Echarts.prototype = { }; for (var key in markData) { - if (key == 'data') { + if (key === 'data') { // 数据concat markOpt.data = markOpt.data.concat(markData.data); markOptR.data = markOptR.data.concat(markData.data); } - else if (typeof markData[key] != 'object' || typeof markOpt[key] == 'undefined') { + else if (typeof markData[key] != 'object' || markOpt[key] == null) { // 简单类型或新值直接赋值 markOpt[key] = markOptR[key] = markData[key]; } @@ -1121,12 +1184,12 @@ Echarts.prototype = { for (var i = 0, l = dataArray.length; i < l; i++) { var dataItem = dataArray[i]; if (dataItem instanceof Array) { - if (dataItem[0].name == markName[0] && dataItem[1].name == markName[1]) { + if (dataItem[0].name === markName[0] && dataItem[1].name === markName[1]) { targetIndex = i; break; } } - else if (dataItem.name == markName[0]) { + else if (dataItem.name === markName[0]) { targetIndex = i; break; } @@ -1188,7 +1251,7 @@ Echarts.prototype = { } var bgColor = this._option.backgroundColor; - if (bgColor && bgColor.replace(' ', '') == 'rgba(0,0,0,0)') { + if (bgColor && bgColor.replace(' ', '') === 'rgba(0,0,0,0)') { bgColor = '#fff'; } @@ -1272,7 +1335,7 @@ Echarts.prototype = { zrImg.render(); var bgColor = this._option.backgroundColor; - if (bgColor && bgColor.replace(/ /g, '') == 'rgba(0,0,0,0)') { + if (bgColor && bgColor.replace(/ /g, '') === 'rgba(0,0,0,0)') { bgColor = '#fff'; } @@ -1410,10 +1473,12 @@ Echarts.prototype = { loadingOption.textStyle = textStyle; var finalTextStyle = zrUtil.merge( - zrUtil.clone(textStyle), this._themeConfig.textStyle); + zrUtil.merge( + zrUtil.clone(textStyle), this._themeConfig.textStyle), ecConfig.textStyle); + textStyle.textFont = finalTextStyle.fontStyle + ' ' + finalTextStyle.fontWeight + ' ' + finalTextStyle.fontSize + 'px ' + finalTextStyle.fontFamily; - textStyle.text = loadingOption.text || this._themeConfig.loadingText; + textStyle.text = loadingOption.text || (this._option && this._option.loadingText) || this._themeConfig.loadingText || ecConfig.loadingText; if (loadingOption.x != null) { textStyle.x = loadingOption.x; @@ -1426,8 +1491,9 @@ Echarts.prototype = { loadingOption.effectOption.textStyle = textStyle; var Effect = loadingOption.effect; - if (typeof Effect == 'string' || Effect == null) { - Effect = effectList[loadingOption.effect || 'spin']; + if (typeof Effect === 'string' || Effect == null) { + Effect = effectList[ + loadingOption.effect || (this._option && this._option.loadingEffect) || this._themeConfig.loadingEffect || ecConfig.loadingEffect] || effectList.spin; } this._zr.showLoading(new Effect(loadingOption.effectOption)); return this; @@ -1449,38 +1515,47 @@ Echarts.prototype = { if (typeof theme === 'string') { // 默认主题 switch (theme) { - // case 'themename': - // theme = require('./theme/themename.js'); + case 'macarons': + theme = require('./theme/macarons.js'); + break; + case 'infographic': + theme = require('./theme/infographic.js'); + break; default: - theme = require('./theme/default.js'); + theme = {}; // require('./theme/default.js'); } } else { theme = theme || {}; } - // 复位默认配置 - // this._themeConfig会被别的对象引用持有 - // 所以不能改成this._themeConfig = {}; - for (var key in this._themeConfig) { - delete this._themeConfig[key]; - } - for (var key in ecConfig) { - this._themeConfig[key] = zrUtil.clone(ecConfig[key]); - } - - // 颜色数组随theme,不merge - theme.color && (this._themeConfig.color = []); - - // 默认标志图形类型列表,不merge - theme.symbolList && (this._themeConfig.symbolList = []); - - // 应用新主题 - zrUtil.merge(this._themeConfig, zrUtil.clone(theme), true); + // // 复位默认配置 + // // this._themeConfig会被别的对象引用持有 + // // 所以不能改成this._themeConfig = {}; + // for (var key in this._themeConfig) { + // delete this._themeConfig[key]; + // } + // for (var key in ecConfig) { + // this._themeConfig[key] = zrUtil.clone(ecConfig[key]); + // } + + // // 颜色数组随theme,不merge + // theme.color && (this._themeConfig.color = []); + + // // 默认标志图形类型列表,不merge + // theme.symbolList && (this._themeConfig.symbolList = []); + + // // 应用新主题 + // zrUtil.merge(this._themeConfig, zrUtil.clone(theme), true); + this._themeConfig = theme; } if (!_canvasSupported) { // IE8- - this._themeConfig.textStyle.fontFamily = this._themeConfig.textStyle.fontFamily2; + var textStyle = this._themeConfig.textStyle; + textStyle && textStyle.fontFamily && textStyle.fontFamily2 && (textStyle.fontFamily = textStyle.fontFamily2); + + textStyle = ecConfig.textStyle; + textStyle.fontFamily = textStyle.fontFamily2; } this._timeline && this._timeline.setTheme(true); @@ -1532,6 +1607,7 @@ Echarts.prototype = { this._zr.clear(); this._option = {}; this._optionRestore = {}; + this.dom.style.backgroundColor = null; return this; }, diff --git a/src/layout/Chord.js b/src/layout/Chord.js new file mode 100644 index 0000000..ba9cafb --- /dev/null +++ b/src/layout/Chord.js @@ -0,0 +1,144 @@ +/** + * Chord layout + * @module echarts/layout/Chord + * @author pissang(http://github.com/pissang) + */ + + +var ChordLayout = function (opts) { + + opts = opts || {}; + + /** + * 是否排序组(即图的节点), 可以是`ascending`, `descending`, 或者为空不排序 + * @type {string} + */ + this.sort = opts.sort || null; + /** + * 是否排序子组(即图中每个节点的邻接边), 可以是`ascending`, `descending`, 或者为空不排序 + * @type {string} + */ + this.sortSub = opts.sortSub || null; + + this.padding = 0.05; + + this.startAngle = opts.startAngle || 0; + this.clockWise = opts.clockWise == null ? false : opts.clockWise; + + this.center = opts.center || [0, 0]; + + this.directed = true; +}; + +/** + * 对指定的一个或多个 Graph 运行 chord 布局 + * 可以有多个 Graph, 后面几个 Graph 的节点是第一个 Graph 的节点的子集(ID一一对应) + * + * 布局结果保存在第一个 Graph 的每个节点的 layout.startAngle 和 layout.endAngle. + * 以及每个图的边的 layout.startAngle 和 layout.endAngle + * + * @param {Array.|module:echarts/data/Graph} graphs + */ +ChordLayout.prototype.run = function (graphs) { + if (!(graphs instanceof Array)) { + graphs = [graphs]; + } + + var gl = graphs.length; + if (!gl) { + return; + } + var graph0 = graphs[0]; + var nl = graph0.nodes.length; + + var groups = []; + var sumSize = 0; + + // 使用第一个 graph 的节点 + for (var i = 0; i < nl; i++) { + var g0node = graph0.nodes[i]; + var group = { + size: 0, + subGroups: [], + node: g0node + }; + groups.push(group); + + var sumWeight = 0; + + // 合并所有 Graph 的 边 + for (var k = 0; k < graphs.length; k++) { + var graph = graphs[k]; + var node = graph.getNodeById(g0node.id); + // 节点可能没有值被过滤掉了 + if (!node) { + continue; + } + group.size += node.layout.size; + // PENDING + var edges = this.directed ? node.outEdges : node.edges; + for (var j = 0; j < edges.length; j++) { + var e = edges[j]; + var w = e.layout.weight; + group.subGroups.push({ + weight: w, + edge: e, + graph: graph + }); + sumWeight += w; + } + } + sumSize += group.size; + + // Sum sub group weights to group size + var multiplier = group.size / sumWeight; + for (var j = 0; j < group.subGroups.length; j++) { + group.subGroups[j].weight *= multiplier; + } + + if (this.sortSub === 'ascending') { + group.subGroups.sort(compareSubGroups); + } + else if (this.sort === 'descending') { + group.subGroups.sort(compareSubGroups); + group.subGroups.reverse(); + } + } + + if (this.sort === 'ascending') { + groups.sort(compareGroups); + } + else if (this.sort === 'descending') { + groups.sort(compareGroups); + groups.reverse(); + } + + var multiplier = (Math.PI * 2 - this.padding * nl) / sumSize; + var angle = this.startAngle; + var sign = this.clockWise ? 1 : -1; + // Calculate angles + for (var i = 0; i < nl; i++) { + var group = groups[i]; + group.node.layout.startAngle = angle; + group.node.layout.endAngle = angle + sign * group.size * multiplier; + + group.node.layout.subGroups = []; + for (var j = 0; j < group.subGroups.length; j++) { + var subGroup = group.subGroups[j]; + subGroup.edge.layout.startAngle = angle; + angle += sign * subGroup.weight * multiplier; + subGroup.edge.layout.endAngle = angle; + } + angle = group.node.layout.endAngle + sign * this.padding; + } +}; + +var compareSubGroups = function (a, b) { + return a.weight - b.weight; +}; + +var compareGroups = function (a, b) { + return a.size - b.size; +}; + +module.exports = ChordLayout; \ No newline at end of file diff --git a/src/layout/EdgeBundling.js b/src/layout/EdgeBundling.js new file mode 100644 index 0000000..4818749 --- /dev/null +++ b/src/layout/EdgeBundling.js @@ -0,0 +1,377 @@ +/** + * Edge bundling laytout + * + * Use MINGLE algorithm + * Multilevel agglomerative edge bundling for visualizing large graphs + * + * @module echarts/layout/EdgeBundling + */ + + +var KDTree = require('../data/KDTree.js'); +var vec2 = require('zrender/tool/vector.js'); +var v2Create = vec2.create; +var v2DistSquare = vec2.distSquare; +var v2Dist = vec2.dist; +var v2Copy = vec2.copy; + +function sqaredDistance(a, b) { + a = a.array; + b = b.array; + + var x = b[0] - a[0]; + var y = b[1] - a[1]; + var z = b[2] - a[2]; + var w = b[3] - a[3]; + + return x * x + y * y + z * z + w * w; +} + +function CoarsenedEdge(group) { + this.points = [ + group.mp0, group.mp1]; + + this.group = group; +}; + +function Edge(edge) { + var points = edge.points; + // Sort on y + if ( + points[0][1] < points[1][1] + // If coarsened edge is flipped, the final composition of meet point + // will be unordered + || edge instanceof CoarsenedEdge) { + this.array = [points[0][0], points[0][1], points[1][0], points[1][1]]; + this._startPoint = points[0]; + this._endPoint = points[1]; + } + else { + this.array = [points[1][0], points[1][1], points[0][0], points[0][1]]; + this._startPoint = points[1]; + this._endPoint = points[0]; + } + + this.ink = v2Dist(points[0], points[1]); + + this.edge = edge; + + this.group = null; +} + +Edge.prototype.getStartPoint = function () { + return this._startPoint; +}; + +Edge.prototype.getEndPoint = function () { + return this._endPoint; +}; + +function BundledEdgeGroup() { + + this.edgeList = []; + + this.mp0 = v2Create(); + this.mp1 = v2Create(); + + this.ink = 0; +} + +BundledEdgeGroup.prototype.addEdge = function (edge) { + edge.group = this; + this.edgeList.push(edge); +}; + +BundledEdgeGroup.prototype.removeEdge = function (edge) { + edge.group = null; + this.edgeList.splice(this.edgeList.indexOf(edge), 1); +}; + +/** + * @constructor + * @alias module:echarts/layout/EdgeBundling + */ + +function EdgeBundling() { + this.maxNearestEdge = 6; + this.maxTurningAngle = Math.PI / 4; + this.maxIteration = 10; +} + +EdgeBundling.prototype = { + + constructor: EdgeBundling, + + run: function (rawEdges) { + var res = this._iterate(rawEdges); + var nIterate = 0; + while (nIterate++ < this.maxIteration) { + var coarsenedEdges = []; + for (var i = 0; i < res.groups.length; i++) { + coarsenedEdges.push(new CoarsenedEdge(res.groups[i])); + } + var newRes = this._iterate(coarsenedEdges); + if (newRes.savedInk <= 0) { + break; + } else { + res = newRes; + } + } + + // Get new edges + var newEdges = []; + + var buildNewEdges = function (groups, fromEdge) { + for (var i = 0; i < groups.length; i++) { + var group = groups[i]; + if ( + group.edgeList[0] && (group.edgeList[0].edge instanceof CoarsenedEdge)) { + var newGroups = []; + for (var j = 0; j < group.edgeList.length; j++) { + newGroups.push(group.edgeList[j].edge.group); + } + if (!fromEdge) { + newEdge = []; + } else { + newEdge = fromEdge.slice(); + } + newEdge.unshift(group.mp0); + newEdge.push(group.mp1); + buildNewEdges(newGroups, newEdge); + } else { + // console.log(group.edgeList.length); + for (var j = 0; j < group.edgeList.length; j++) { + var edge = group.edgeList[j]; + if (!fromEdge) { + newEdge = []; + } else { + newEdge = fromEdge.slice(); + } + newEdge.unshift(group.mp0); + newEdge.push(group.mp1); + newEdge.unshift(edge.getStartPoint()); + newEdge.push(edge.getEndPoint()); + newEdges.push(newEdge); + } + } + } + }; + + buildNewEdges(res.groups); + + for (var i = 0; i < newEdges.length; i++) { + newEdges[i] = { + points: newEdges[i], + rawEdge: rawEdges[i] + } + } + + return newEdges; + }, + + _iterate: function (rawEdges) { + var edges = []; + var groups = []; + var totalSavedInk = 0; + for (var i = 0; i < rawEdges.length; i++) { + var edge = new Edge(rawEdges[i]); + edges.push(edge); + } + + var tree = new KDTree(edges, 4); + + var nearests = []; + + var _mp0 = v2Create(); + var _mp1 = v2Create(); + var _newGroupInk = 0; + var mp0 = v2Create(); + var mp1 = v2Create(); + var newGroupInk = 0; + for (var i = 0; i < edges.length; i++) { + var edge = edges[i]; + if (edge.group) { + // Edge have been groupped + continue; + } + tree.nearestN( + edge, this.maxNearestEdge, sqaredDistance, nearests); + var maxSavedInk = 0; + var mostSavingInkEdge = null; + var lastCheckedGroup = null; + for (var j = 0; j < nearests.length; j++) { + var nearest = nearests[j]; + var savedInk = 0; + if (nearest.group) { + if (nearest.group !== lastCheckedGroup) { + lastCheckedGroup = nearest.group; + _newGroupInk = this._calculateGroupEdgeInk( + nearest.group, edge, _mp0, _mp1); + savedInk = nearest.group.ink + edge.ink - _newGroupInk; + } + } + else { + _newGroupInk = this._calculateEdgeEdgeInk( + edge, nearest, _mp0, _mp1); + savedInk = nearest.ink + edge.ink - _newGroupInk; + } + if (savedInk > maxSavedInk) { + maxSavedInk = savedInk; + mostSavingInkEdge = nearest; + v2Copy(mp1, _mp1); + v2Copy(mp0, _mp0); + newGroupInk = _newGroupInk; + } + } + if (mostSavingInkEdge) { + totalSavedInk += maxSavedInk; + if (!mostSavingInkEdge.group) { + var group = new BundledEdgeGroup(); + groups.push(group); + group.addEdge(mostSavingInkEdge); + } + group = mostSavingInkEdge.group; + // Use the meet point and group ink calculated before + v2Copy(group.mp0, mp0); + v2Copy(group.mp1, mp1); + group.ink = newGroupInk; + mostSavingInkEdge.group.addEdge(edge); + } + else { + var group = new BundledEdgeGroup(); + groups.push(group); + v2Copy(group.mp0, edge.getStartPoint()); + v2Copy(group.mp1, edge.getEndPoint()); + group.ink = edge.ink; + group.addEdge(edge); + } + } + + return { + groups: groups, + edges: edges, + savedInk: totalSavedInk + } + }, + + _calculateEdgeEdgeInk: (function () { + var startPointSet = []; + var endPointSet = []; + return function (e0, e1, mp0, mp1) { + startPointSet[0] = e0.getStartPoint(); + startPointSet[1] = e1.getStartPoint(); + endPointSet[0] = e0.getEndPoint(); + endPointSet[1] = e1.getEndPoint(); + + this._calculateMeetPoints( + startPointSet, endPointSet, mp0, mp1); + var ink = v2Dist(startPointSet[0], mp0) + v2Dist(mp0, mp1) + v2Dist(mp1, endPointSet[0]) + v2Dist(startPointSet[1], mp0) + v2Dist(mp1, endPointSet[1]); + + return ink; + }; + })(), + + _calculateGroupEdgeInk: function (group, edgeTryAdd, mp0, mp1) { + var startPointSet = []; + var endPointSet = []; + for (var i = 0; i < group.edgeList.length; i++) { + var edge = group.edgeList[i]; + startPointSet.push(edge.getStartPoint()); + endPointSet.push(edge.getEndPoint()); + } + startPointSet.push(edgeTryAdd.getStartPoint()); + endPointSet.push(edgeTryAdd.getEndPoint()); + + this._calculateMeetPoints( + startPointSet, endPointSet, mp0, mp1); + + var ink = v2Dist(mp0, mp1); + for (var i = 0; i < startPointSet.length; i++) { + ink += v2Dist(startPointSet[i], mp0) + v2Dist(endPointSet[i], mp1); + } + + return ink; + }, + + /** + * Calculating the meet points + * @method + * @param {Array} startPointSet Start points set of bundled edges + * @param {Array} endPointSet End points set of bundled edges + * @param {Array.} mp0 Output meet point 0 + * @param {Array.} mp1 Output meet point 1 + */ + _calculateMeetPoints: (function () { + var cp0 = v2Create(); + var cp1 = v2Create(); + return function (startPointSet, endPointSet, mp0, mp1) { + vec2.set(cp0, 0, 0); + vec2.set(cp1, 0, 0); + var len = startPointSet.length; + // Calculate the centroid of start points set + for (var i = 0; i < len; i++) { + vec2.add(cp0, cp0, startPointSet[i]); + } + vec2.scale(cp0, cp0, 1 / len); + + // Calculate the centroid of end points set + len = endPointSet.length; + for (var i = 0; i < len; i++) { + vec2.add(cp1, cp1, endPointSet[i]); + } + vec2.scale(cp1, cp1, 1 / len); + + this._limitTurningAngle( + startPointSet, cp0, cp1, mp0); + this._limitTurningAngle( + endPointSet, cp1, cp0, mp1); + } + })(), + + _limitTurningAngle: (function () { + var v10 = v2Create(); + var vTmp = v2Create(); + var project = v2Create(); + var tmpOut = v2Create(); + return function (pointSet, p0, p1, out) { + // Limit the max turning angle + var maxTurningAngleCos = Math.cos(this.maxTurningAngle); + var maxTurningAngleTan = Math.tan(this.maxTurningAngle); + + vec2.sub(v10, p0, p1); + vec2.normalize(v10, v10); + + // Simply copy the centroid point if no need to turn the angle + vec2.copy(out, p0); + + var maxMovement = 0; + for (var i = 0; i < pointSet.length; i++) { + var p = pointSet[i]; + vec2.sub(vTmp, p, p0); + var len = vec2.len(vTmp); + vec2.scale(vTmp, vTmp, 1 / len); + var turningAngleCos = vec2.dot(vTmp, v10); + // Turning angle is to large + if (turningAngleCos < maxTurningAngleCos) { + // Calculat p's project point on vector p1-p0 + // and distance to the vector + vec2.scaleAndAdd( + project, p0, v10, len * turningAngleCos); + var distance = v2Dist(project, p); + + // Use the max turning angle to calculate the new meet point + var d = distance / maxTurningAngleTan; + vec2.scaleAndAdd(tmpOut, project, v10, -d); + + var movement = v2DistSquare(tmpOut, p0); + if (movement > maxMovement) { + maxMovement = movement; + vec2.copy(out, tmpOut); + } + } + } + }; + })() +} + +module.exports = EdgeBundling; \ No newline at end of file diff --git a/src/layout/Force.js b/src/layout/Force.js new file mode 100644 index 0000000..d3ccb85 --- /dev/null +++ b/src/layout/Force.js @@ -0,0 +1,242 @@ +/** + * 力导向布局 + * @module echarts/layout/Force + * @author pissang(http://github.com/pissang) + */ + + +var ForceLayoutWorker = require('./forceLayoutWorker.js'); +var vec2 = require('zrender/tool/vector.js'); + +var requestAnimationFrame = window.requestAnimationFrame || window.msRequestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || +function (func) { + setTimeout(func, 16); +}; +var ArrayCtor = typeof(Float32Array) == 'undefined' ? Array : Float32Array; + +var workerUrl; + +// function getToken() { +// return Math.round((new Date()).getTime() / 100) % 10000000; +// } + +function createWorkerUrl() { + if ( + typeof(Worker) !== 'undefined' && typeof(Blob) !== 'undefined') { + try { + var blob = new Blob([ForceLayoutWorker.getWorkerCode()]); + workerUrl = window.URL.createObjectURL(blob); + } + catch (e) { + workerUrl = ''; + } + } + + return workerUrl; +} + +var ForceLayout = function (opts) { + + if (typeof(workerUrl) === 'undefined') { + createWorkerUrl(); + } + opts = opts || {}; + // 配置项 + this.width = opts.width || 500; + this.height = opts.height || 500; + this.center = opts.center || [this.width / 2, this.height / 2]; + this.ratioScaling = opts.ratioScaling || false; + this.scaling = opts.scaling || 1; + this.gravity = typeof(opts.gravity) !== 'undefined' ? opts.gravity : 1; + this.large = opts.large || false; + this.preventNodeOverlap = opts.preventNodeOverlap || false; + this.preventNodeEdgeOverlap = opts.preventNodeEdgeOverlap || false; + this.maxSpeedIncrease = opts.maxSpeedIncrease || 1; + + this.onupdate = opts.onupdate || + function () {}; + this.temperature = opts.temperature || 1; + this.coolDown = opts.coolDown || 0.99; + + this._layout = null; + this._layoutWorker = null; + + var self = this; + var _$onupdate = this._$onupdate; + this._$onupdate = function (e) { + _$onupdate.call(self, e); + }; +}; + +ForceLayout.prototype.updateConfig = function () { + var width = this.width; + var height = this.height; + var size = Math.min(width, height); + + var config = { + center: this.center, + width: this.ratioScaling ? width : size, + height: this.ratioScaling ? height : size, + scaling: this.scaling || 1.0, + gravity: this.gravity || 1.0, + barnesHutOptimize: this.large, + preventNodeOverlap: this.preventNodeOverlap, + preventNodeEdgeOverlap: this.preventNodeEdgeOverlap, + + maxSpeedIncrease: this.maxSpeedIncrease + }; + + if (this._layoutWorker) { + this._layoutWorker.postMessage({ + cmd: 'updateConfig', + config: config + }); + } + else { + for (var name in config) { + this._layout[name] = config[name]; + } + } +}; + +ForceLayout.prototype.init = function (graph, useWorker) { + if (workerUrl && useWorker) { + try { + if (!this._layoutWorker) { + this._layoutWorker = new Worker(workerUrl); + this._layoutWorker.onmessage = this._$onupdate; + } + this._layout = null; + } + catch (e) { // IE10-11 will throw security error when using blog url + this._layoutWorker = null; + if (!this._layout) { + this._layout = new ForceLayoutWorker(); + } + } + } + else { + if (!this._layout) { + this._layout = new ForceLayoutWorker(); + } + if (this._layoutWorker) { + this._layoutWorker.terminate(); + this._layoutWorker = null; + } + } + + this.temperature = 1; + + this.graph = graph; + + // 节点数据 + var len = graph.nodes.length; + var positionArr = new ArrayCtor(len * 2); + var massArr = new ArrayCtor(len); + var sizeArr = new ArrayCtor(len); + + for (var i = 0; i < len; i++) { + var n = graph.nodes[i]; + positionArr[i * 2] = n.layout.position[0]; + positionArr[i * 2 + 1] = n.layout.position[1]; + massArr[i] = typeof(n.layout.mass) === 'undefined' ? 1 : n.layout.mass; + sizeArr[i] = typeof(n.layout.size) === 'undefined' ? 1 : n.layout.size; + + n.layout.__index = i; + } + // 边数据 + len = graph.edges.length; + var edgeArr = new ArrayCtor(len * 2); + var edgeWeightArr = new ArrayCtor(len); + for (var i = 0; i < len; i++) { + var edge = graph.edges[i]; + edgeArr[i * 2] = edge.node1.layout.__index; + edgeArr[i * 2 + 1] = edge.node2.layout.__index; + edgeWeightArr[i] = edge.layout.weight || 1; + } + + if (this._layoutWorker) { + + this._layoutWorker.postMessage({ + cmd: 'init', + nodesPosition: positionArr, + nodesMass: massArr, + nodesSize: sizeArr, + edges: edgeArr, + edgesWeight: edgeWeightArr + }); + } + else { + this._layout.initNodes(positionArr, massArr, sizeArr); + this._layout.initEdges(edgeArr, edgeWeightArr); + } + + this.updateConfig(); +}; + +ForceLayout.prototype.step = function (steps) { + var nodes = this.graph.nodes; + if (this._layoutWorker) { + // Sync back + var positionArr = new ArrayCtor(nodes.length * 2); + for (var i = 0; i < nodes.length; i++) { + var n = nodes[i]; + positionArr[i * 2] = n.layout.position[0]; + positionArr[i * 2 + 1] = n.layout.position[1]; + } + this._layoutWorker.postMessage(positionArr.buffer, [positionArr.buffer]); + + this._layoutWorker.postMessage({ + cmd: 'update', + steps: steps, + temperature: this.temperature, + coolDown: this.coolDown + }); + for (var i = 0; i < steps; i++) { + this.temperature *= this.coolDown; + } + } + else { + + requestAnimationFrame(this._$onupdate); + + for (var i = 0; i < nodes.length; i++) { + var n = nodes[i]; + vec2.copy(this._layout.nodes[i].position, n.layout.position); + } + for (var i = 0; i < steps; i++) { + this._layout.temperature = this.temperature; + this._layout.update(); + this.temperature *= this.coolDown; + } + } +}; + +ForceLayout.prototype._$onupdate = function (e) { + if (this._layoutWorker) { + var positionArr = new Float32Array(e.data); + for (var i = 0; i < this.graph.nodes.length; i++) { + var n = this.graph.nodes[i]; + n.layout.position[0] = positionArr[i * 2]; + n.layout.position[1] = positionArr[i * 2 + 1]; + } + this.onupdate && this.onupdate(); + } + else if (this._layout) { + for (var i = 0; i < this.graph.nodes.length; i++) { + var n = this.graph.nodes[i]; + vec2.copy(n.layout.position, this._layout.nodes[i].position); + } + this.onupdate && this.onupdate(); + } +}; + +ForceLayout.prototype.dispose = function () { + if (this._layoutWorker) { + this._layoutWorker.terminate(); + } + this._layoutWorker = null; + this._layout = null; +}; + +module.exports = ForceLayout; \ No newline at end of file diff --git a/src/layout/Tree.js b/src/layout/Tree.js new file mode 100644 index 0000000..00b7abb --- /dev/null +++ b/src/layout/Tree.js @@ -0,0 +1,89 @@ +/** + * Tree layout + * @module echarts/layout/Tree + * @author pissang(http://github.com/pissang) + */ + + +var vec2 = require('zrender/tool/vector.js'); + +function TreeLayout(opts) { + + opts = opts || {}; + + this.nodePadding = opts.nodePadding || 30; + + this.layerPadding = opts.layerPadding || 100; + + this._layerOffsets = []; + + this._layers = []; +} + +TreeLayout.prototype.run = function (tree) { + this._layerOffsets.length = 0; + for (var i = 0; i < tree.root.height + 1; i++) { + this._layerOffsets[i] = 0; + this._layers[i] = []; + } + this._updateNodeXPosition(tree.root); + var root = tree.root; + this._updateNodeYPosition(root, 0, root.layout.height); +}; + +TreeLayout.prototype._updateNodeXPosition = function (node) { + var minX = Infinity; + var maxX = -Infinity; + node.layout.position = node.layout.position || vec2.create(); + for (var i = 0; i < node.children.length; i++) { + var child = node.children[i]; + this._updateNodeXPosition(child); + var x = child.layout.position[0]; + if (x < minX) { + minX = x; + } + if (x > maxX) { + maxX = x; + } + } + if (node.children.length > 0) { + node.layout.position[0] = (minX + maxX) / 2; + } else { + node.layout.position[0] = 0; + } + var off = this._layerOffsets[node.depth] || 0; + if (off > node.layout.position[0]) { + var shift = off - node.layout.position[0]; + this._shiftSubtree(node, shift); + for (var i = node.depth + 1; i < node.height + node.depth; i++) { + this._layerOffsets[i] += shift; + } + } + this._layerOffsets[node.depth] = node.layout.position[0] + node.layout.width + this.nodePadding; + + this._layers[node.depth].push(node); +}; + +TreeLayout.prototype._shiftSubtree = function (root, offset) { + root.layout.position[0] += offset; + for (var i = 0; i < root.children.length; i++) { + this._shiftSubtree(root.children[i], offset); + } +}; + +TreeLayout.prototype._updateNodeYPosition = function (node, y, prevLayerHeight) { + node.layout.position[1] = y; + var layerHeight = 0; + for (var i = 0; i < node.children.length; i++) { + layerHeight = Math.max(node.children[i].layout.height, layerHeight); + } + var layerPadding = this.layerPadding; + if (typeof(layerPadding) === 'function') { + layerPadding = layerPadding(node.depth); + } + for (var i = 0; i < node.children.length; i++) { + this._updateNodeYPosition(node.children[i], y + layerPadding + prevLayerHeight, layerHeight); + } +}; + +module.exports = TreeLayout; \ No newline at end of file diff --git a/src/layout/eventRiver.js b/src/layout/eventRiver.js new file mode 100644 index 0000000..1e9e4bc --- /dev/null +++ b/src/layout/eventRiver.js @@ -0,0 +1,219 @@ +/** + * eventRiver 布局算法 + * @module echarts/layout/eventRiver + * @author clmtulip (车丽美, clmtulip@gmail.com) + */ + +function eventRiverLayout(series, intervalX, area) { + var space = 5; + var scale = intervalX; + + function importanceSort(a, b) { + var x = a.importance; + var y = b.importance; + return ((x > y) ? -1 : ((x < y) ? 1 : 0)); + } + + /** + * 查询数组中元素的index + */ + + function indexOf(array, value) { + if (array.indexOf) { + return array.indexOf(value); + } + for (var i = 0, len = array.length; i < len; i++) { + if (array[i] === value) { + return i; + } + } + return -1; + } + + // step 0. calculate event importance and sort descending + for (var i = 0; i < series.length; i++) { + for (var j = 0; j < series[i].eventList.length; j++) { + if (series[i].eventList[j].weight == null) { + series[i].eventList[j].weight = 1; + } + var importance = 0; + for (var k = 0; k < series[i].eventList[j].evolution.length; k++) { + importance += series[i].eventList[j].evolution[k].valueScale; + } + series[i].eventList[j].importance = importance * series[i].eventList[j].weight; + } + series[i].eventList.sort(importanceSort); + } + + // step 1. 计算每个group的重要值importance,并按递减顺序排序 + for (var i = 0; i < series.length; i++) { + if (series[i].weight == null) { + series[i].weight = 1; + } + var importance = 0; + for (var j = 0; j < series[i].eventList.length; j++) { + importance += series[i].eventList[j].weight; + } + series[i].importance = importance * series[i].weight; + } + // 根据importance对groups进行递减排序 + series.sort(importanceSort); + + // step 3. set bubble positions in group order, then in event order + // 找到包含所有事件的时间段,即最小和最大时间点 + var minTime = Number.MAX_VALUE; + var maxTime = 0; + for (var i = 0; i < series.length; i++) { + for (var j = 0; j < series[i].eventList.length; j++) { + for (var k = 0; k < series[i].eventList[j].evolution.length; k++) { + var time = series[i].eventList[j].evolution[k].timeScale; + minTime = Math.min(minTime, time); + maxTime = Math.max(maxTime, time); + } + } + } + // console.log('minTime: ' + minTime); + // console.log('maxTime: ' + maxTime); + // 建立线段树根节点 + var root = segmentTreeBuild(Math.floor(minTime), Math.ceil(maxTime)); + + var totalMaxY = 0; + for (var i = 0; i < series.length; i++) { + for (var j = 0; j < series[i].eventList.length; j++) { + var e = series[i].eventList[j]; + e.time = []; + e.value = []; + for (var k = 0; k < series[i].eventList[j].evolution.length; k++) { + e.time.push(series[i].eventList[j].evolution[k].timeScale); + e.value.push(series[i].eventList[j].evolution[k].valueScale); + } + + var mxIndex = indexOf(e.value, Math.max.apply(Math, e.value)); + var maxY = segmentTreeQuery(root, e.time[mxIndex], e.time[mxIndex + 1]); + var k = 0; + e.y = maxY + e.value[mxIndex] / 2 + space; + // 检测overlap,调整event.y + for (k = 0; k < e.time.length - 1; k++) { + var curMaxY = segmentTreeQuery(root, e.time[k], e.time[k + 1]); + if (e.y - e.value[k] / 2 - space < curMaxY) { + e.y = curMaxY + e.value[k] / 2 + space; + } + } + var curMaxY = segmentTreeQuery(root, e.time[k], e.time[k] + scale); + if (e.y - e.value[k] / 2 - space < curMaxY) { + e.y = curMaxY + e.value[k] / 2 + space; + } + series[i].y = e.y; + + totalMaxY = Math.max(totalMaxY, e.y + e.value[mxIndex] / 2); + + // 确定位置后更新线段树 + for (k = 0; k < e.time.length - 1; k++) { + segmentTreeInsert(root, e.time[k], e.time[k + 1], e.y + e.value[k] / 2); + } + segmentTreeInsert(root, e.time[k], e.time[k] + scale, e.y + e.value[k] / 2); + } + } + + // 映射到显示区域内 + scaleY(series, area, totalMaxY, space); +} + +/** + * 映射到显示区域内 + * @param {Object} series + * @param {Object} area + */ + +function scaleY(series, area, maxY, space) { + var yBase = area.y; + var yScale = (area.height - space) / maxY; + for (var i = 0; i < series.length; i++) { + series[i].y = series[i].y * yScale + yBase; + var eventList = series[i].eventList; + for (var j = 0; j < eventList.length; j++) { + eventList[j].y = eventList[j].y * yScale + yBase; + var evolutionList = eventList[j].evolution; + for (var k = 0; k < evolutionList.length; k++) { + evolutionList[k].valueScale *= yScale * 1; + } + } + + } +} + +function segmentTreeBuild(left, right) { + var root = { + 'left': left, + 'right': right, + 'leftChild': null, + 'rightChild': null, + 'maxValue': 0 + }; + + if (left + 1 < right) { + var mid = Math.round((left + right) / 2); + root.leftChild = segmentTreeBuild(left, mid); + root.rightChild = segmentTreeBuild(mid, right); + } + + return root; +} + +function segmentTreeQuery(root, left, right) { + if (right - left < 1) { + return 0; + } + + var mid = Math.round((root.left + root.right) / 2); + var result = 0; + + if (left == root.left && right == root.right) { + result = root.maxValue; + } + else if (right <= mid && root.leftChild != null) { + result = segmentTreeQuery(root.leftChild, left, right); + } + else if (left >= mid && root.rightChild != null) { + result = segmentTreeQuery(root.rightChild, left, right); + } + else { + var leftValue = 0; + var rightValue = 0; + if (root.leftChild != null) { + leftValue = segmentTreeQuery(root.leftChild, left, mid); + } + if (root.rightChild != null) { + rightValue = segmentTreeQuery(root.rightChild, mid, right); + } + result = leftValue > rightValue ? leftValue : rightValue; + } + return result; +} + +// 插入和更新线段树 + + +function segmentTreeInsert(root, left, right, value) { + if (root == null) { + return; + } + var mid = Math.round((root.left + root.right) / 2); + root.maxValue = root.maxValue > value ? root.maxValue : value; + + if (Math.floor(left * 10) == Math.floor(root.left * 10) && Math.floor(right * 10) == Math.floor(root.right * 10)) { + return; + } + else if (right <= mid) { + segmentTreeInsert(root.leftChild, left, right, value); + } + else if (left >= mid) { + segmentTreeInsert(root.rightChild, left, right, value); + } + else { + segmentTreeInsert(root.leftChild, left, mid, value); + segmentTreeInsert(root.rightChild, mid, right, value); + } +} + +module.exports = eventRiverLayout; \ No newline at end of file diff --git a/src/chart/forceLayoutWorker.js b/src/layout/forceLayoutWorker.js similarity index 76% rename from src/chart/forceLayoutWorker.js rename to src/layout/forceLayoutWorker.js index a8c66c3..b6c925e 100644 --- a/src/chart/forceLayoutWorker.js +++ b/src/layout/forceLayoutWorker.js @@ -43,6 +43,9 @@ if (inWorker) { out[1] = a[1] - b[1]; return out; }, + dot: function (v1, v2) { + return v1[0] * v2[0] + v1[1] * v2[1]; + }, normalize: function (out, a) { var x = a[0]; var y = a[1]; @@ -71,8 +74,9 @@ if (inWorker) { return out; } }; -} else { - vec2 = require('../zrender/tool/vector.js'); +} +else { + vec2 = require('zrender/tool/vector.js'); } var ArrayCtor = typeof(Float32Array) == 'undefined' ? Array : Float32Array; @@ -123,7 +127,8 @@ Region.prototype.addNode = function (node) { if (this.node == null) { this.node = node; return; - } else { + } + else { this._addNodeToSubRegion(this.node); this.node = null; } @@ -232,9 +237,9 @@ function GraphNode() { * Class: Graph Edge ***************************/ -function GraphEdge(source, target) { - this.source = source; - this.target = target; +function GraphEdge(node1, node2) { + this.node1 = node1; + this.node2 = node2; this.weight = 1; } @@ -250,7 +255,9 @@ function ForceLayout() { this.repulsionByDegree = false; - this.preventOverlap = false; + this.preventNodeOverlap = false; + this.preventNodeEdgeOverlap = false; + this.strongGravity = true; this.gravity = 1.0; @@ -262,7 +269,7 @@ function ForceLayout() { this.width = 500; this.height = 500; - this.maxSpeedIncrease = 1.0; + this.maxSpeedIncrease = 1; this.nodes = []; this.edges = []; @@ -277,6 +284,18 @@ function ForceLayout() { this._k = 0; } +ForceLayout.prototype.nodeToNodeRepulsionFactor = function (mass, d, k) { + return k * k * mass / d; +}; + +ForceLayout.prototype.edgeToNodeRepulsionFactor = function (mass, d, k) { + return k * mass / d; +}; + +ForceLayout.prototype.attractionFactor = function (w, d, k) { + return w * d / k; +}; + ForceLayout.prototype.initNodes = function (positionArr, massArr, sizeArr) { this.temperature = 1.0; @@ -344,7 +363,8 @@ ForceLayout.prototype.update = function () { this._rootRegion.addNode(this.nodes[i]); } this._rootRegion.afterUpdate(); - } else { + } + else { // Update center of mass of whole graph var mass = 0; var centerOfMass = this._rootRegion.centerOfMass; @@ -354,9 +374,18 @@ ForceLayout.prototype.update = function () { mass += node.mass; vec2.scaleAndAdd(centerOfMass, centerOfMass, node.position, node.mass); } - vec2.scale(centerOfMass, centerOfMass, 1 / mass); + if (mass > 0) { + vec2.scale(centerOfMass, centerOfMass, 1 / mass); + } } + this.updateForce(); + + this.updatePosition(); +}; + +ForceLayout.prototype.updateForce = function () { + var nNodes = this.nodes.length; // Reset forces for (var i = 0; i < nNodes; i++) { var node = this.nodes[i]; @@ -365,30 +394,21 @@ ForceLayout.prototype.update = function () { vec2.set(node.force, 0, 0); } - // Compute forces - // Repulsion - for (var i = 0; i < nNodes; i++) { - var na = this.nodes[i]; - if (this.barnesHutOptimize) { - this.applyRegionToNodeRepulsion(this._rootRegion, na); - } else { - for (var j = i + 1; j < nNodes; j++) { - var nb = this.nodes[j]; - this.applyNodeToNodeRepulsion(na, nb, false); - } - } + this.updateNodeNodeForce(); - // Gravity - if (this.gravity > 0) { - this.applyNodeGravity(na); - } + if (this.gravity > 0) { + this.updateGravityForce(); } - // Attraction - for (var i = 0; i < this.edges.length; i++) { - this.applyEdgeAttraction(this.edges[i]); + this.updateEdgeForce(); + + if (this.preventNodeEdgeOverlap) { + this.updateNodeEdgeForce(); } +}; +ForceLayout.prototype.updatePosition = function () { + var nNodes = this.nodes.length; // Apply forces // var speed = vec2.create(); var v = vec2.create(); @@ -407,12 +427,12 @@ ForceLayout.prototype.update = function () { vec2.scale(node.force, node.force, scale); vec2.add(speed, speed, node.force); - vec2.scale(speed, speed, this.temperature); // Prevent swinging // Limited the increase of speed up to 100% each step // TODO adjust by nodes number + // TODO First iterate speed control vec2.sub(v, speed, node.speedPrev); var swing = vec2.len(v); if (swing > 0) { @@ -433,18 +453,63 @@ ForceLayout.prototype.update = function () { } }; +ForceLayout.prototype.updateNodeNodeForce = function () { + var nNodes = this.nodes.length; + // Compute forces + // Repulsion + for (var i = 0; i < nNodes; i++) { + var na = this.nodes[i]; + if (this.barnesHutOptimize) { + this.applyRegionToNodeRepulsion(this._rootRegion, na); + } + else { + for (var j = i + 1; j < nNodes; j++) { + var nb = this.nodes[j]; + this.applyNodeToNodeRepulsion(na, nb, false); + } + } + } +}; + +ForceLayout.prototype.updateGravityForce = function () { + for (var i = 0; i < this.nodes.length; i++) { + this.applyNodeGravity(this.nodes[i]); + } +}; + +ForceLayout.prototype.updateEdgeForce = function () { + // Attraction + for (var i = 0; i < this.edges.length; i++) { + this.applyEdgeAttraction(this.edges[i]); + } +}; + +ForceLayout.prototype.updateNodeEdgeForce = function () { + for (var i = 0; i < this.nodes.length; i++) { + for (var j = 0; j < this.edges.length; j++) { + this.applyEdgeToNodeRepulsion(this.edges[j], this.nodes[i]); + } + } +}; + ForceLayout.prototype.applyRegionToNodeRepulsion = (function () { var v = vec2.create(); return function applyRegionToNodeRepulsion(region, node) { if (region.node) { // Region is a leaf this.applyNodeToNodeRepulsion(region.node, node, true); - } else { + } + else { + // Static region and node + if (region.mass === 0 && node.mass === 0) { + return; + } vec2.sub(v, node.position, region.centerOfMass); var d2 = v[0] * v[0] + v[1] * v[1]; if (d2 > this.barnesHutTheta * region.size * region.size) { var factor = this._k * this._k * (node.mass + region.mass) / (d2 + 1); vec2.scaleAndAdd(node.force, node.force, v, factor * 2); - } else { + } + else { for (var i = 0; i < region.nSubRegions; i++) { this.applyRegionToNodeRepulsion(region.subRegions[i], node); } @@ -456,9 +521,14 @@ ForceLayout.prototype.applyRegionToNodeRepulsion = (function () { ForceLayout.prototype.applyNodeToNodeRepulsion = (function () { var v = vec2.create(); return function applyNodeToNodeRepulsion(na, nb, oneWay) { - if (na == nb) { + if (na === nb) { + return; + } + // Two static node + if (na.mass === 0 && nb.mass === 0) { return; } + vec2.sub(v, na.position, nb.position); var d2 = v[0] * v[0] + v[1] * v[1]; @@ -468,21 +538,26 @@ ForceLayout.prototype.applyNodeToNodeRepulsion = (function () { } var factor; - var k2 = this._k * this._k; var mass = na.mass + nb.mass; + var d = Math.sqrt(d2); - if (this.preventOverlap) { - var d = Math.sqrt(d2); + // Normalize v + vec2.scale(v, v, 1 / d); + + if (this.preventNodeOverlap) { d = d - na.size - nb.size; if (d > 0) { - factor = k2 * mass / (d * d); - } else if (d <= 0) { + factor = this.nodeToNodeRepulsionFactor( + mass, d, this._k); + } + else if (d <= 0) { // A stronger repulsion if overlap - factor = k2 * 10 * mass; + factor = this._k * this._k * 10 * mass; } - } else { - // Divide factor by an extra `d` to normalize the `v` - factor = k2 * mass / d2; + } + else { + factor = this.nodeToNodeRepulsionFactor( + mass, d, this._k); } if (!oneWay) { @@ -495,8 +570,8 @@ ForceLayout.prototype.applyNodeToNodeRepulsion = (function () { ForceLayout.prototype.applyEdgeAttraction = (function () { var v = vec2.create(); return function applyEdgeAttraction(edge) { - var na = edge.source; - var nb = edge.target; + var na = edge.node1; + var nb = edge.node2; vec2.sub(v, na.position, nb.position); var d = vec2.len(v); @@ -504,9 +579,11 @@ ForceLayout.prototype.applyEdgeAttraction = (function () { var w; if (this.edgeWeightInfluence === 0) { w = 1; - } else if (this.edgeWeightInfluence == 1) { + } + else if (this.edgeWeightInfluence == 1) { w = edge.weight; - } else { + } + else { w = Math.pow(edge.weight, this.edgeWeightInfluence); } @@ -520,10 +597,10 @@ ForceLayout.prototype.applyEdgeAttraction = (function () { } } - var factor = -w * d / this._k; + var factor = this.attractionFactor(w, d, this._k); - vec2.scaleAndAdd(na.force, na.force, v, factor); - vec2.scaleAndAdd(nb.force, nb.force, v, -factor); + vec2.scaleAndAdd(na.force, na.force, v, -factor); + vec2.scaleAndAdd(nb.force, nb.force, v, factor); }; })(); @@ -537,7 +614,8 @@ ForceLayout.prototype.applyNodeGravity = (function () { if (this.width > this.height) { // Stronger gravity on y axis v[1] *= this.width / this.height; - } else { + } + else { // Stronger gravity on x axis v[0] *= this.height / this.width; } @@ -545,12 +623,55 @@ ForceLayout.prototype.applyNodeGravity = (function () { if (this.strongGravity) { vec2.scaleAndAdd(node.force, node.force, v, d * this.gravity * node.mass); - } else { + } + else { vec2.scaleAndAdd(node.force, node.force, v, this.gravity * node.mass / (d + 1)); } }; })(); +ForceLayout.prototype.applyEdgeToNodeRepulsion = (function () { + var v12 = vec2.create(); + var v13 = vec2.create(); + var p = vec2.create(); + return function (e, n3) { + var n1 = e.node1; + var n2 = e.node2; + + if (n1 === n3 || n2 === n3) { + return; + } + + vec2.sub(v12, n2.position, n1.position); + vec2.sub(v13, n3.position, n1.position); + + var len12 = vec2.len(v12); + vec2.scale(v12, v12, 1 / len12); + var len = vec2.dot(v12, v13); + + // n3 can't project on line n1-n2 + if (len < 0 || len > len12) { + return; + } + + // Project point + vec2.scaleAndAdd(p, n1.position, v12, len); + + // n3 distance to line n1-n2 + var dist = vec2.dist(p, n3.position) - n3.size; + var factor = this.edgeToNodeRepulsionFactor( + n3.mass, Math.max(dist, 0.1), 100); + // Use v12 as normal vector + vec2.sub(v12, n3.position, p); + vec2.normalize(v12, v12); + vec2.scaleAndAdd(n3.force, n3.force, v12, factor); + + // PENDING + vec2.scaleAndAdd(n1.force, n1.force, v12, -factor); + vec2.scaleAndAdd(n2.force, n2.force, v12, -factor); + }; +})(); + ForceLayout.prototype.updateBBox = function () { var minX = Infinity; var minY = Infinity; @@ -578,21 +699,21 @@ ForceLayout.getWorkerCode = function () { * Main process ***************************/ +/* jshint ignore:start */ if (inWorker) { var forceLayout = null; self.onmessage = function (e) { // Position read back if (e.data instanceof ArrayBuffer) { - if (!forceLayout) { - return; - } + if (!forceLayout) return; + var positionArr = new Float32Array(e.data); - var nNodes = (positionArr.length - 1) / 2; + var nNodes = positionArr.length / 2; for (var i = 0; i < nNodes; i++) { var node = forceLayout.nodes[i]; - node.position[0] = positionArr[i * 2 + 1]; - node.position[1] = positionArr[i * 2 + 2]; + node.position[0] = positionArr[i * 2]; + node.position[1] = positionArr[i * 2 + 1]; } return; } @@ -604,7 +725,6 @@ if (inWorker) { } forceLayout.initNodes(e.data.nodesPosition, e.data.nodesMass, e.data.nodesSize); forceLayout.initEdges(e.data.edges, e.data.edgesWeight); - forceLayout._token = e.data.token; break; case 'updateConfig': if (forceLayout) { @@ -618,27 +738,24 @@ if (inWorker) { if (forceLayout) { var nNodes = forceLayout.nodes.length; - var positionArr = new Float32Array(nNodes * 2 + 1); + var positionArr = new Float32Array(nNodes * 2); forceLayout.temperature = e.data.temperature; - if (e.data.temperature > 0.01) { - for (var i = 0; i < steps; i++) { - forceLayout.update(); - forceLayout.temperature *= e.data.coolDown; - } - // Callback - for (var i = 0; i < nNodes; i++) { - var node = forceLayout.nodes[i]; - positionArr[i * 2 + 1] = node.position[0]; - positionArr[i * 2 + 2] = node.position[1]; - } - - positionArr[0] = forceLayout._token; + for (var i = 0; i < steps; i++) { + forceLayout.update(); + forceLayout.temperature *= e.data.coolDown; + } + // Callback + for (var i = 0; i < nNodes; i++) { + var node = forceLayout.nodes[i]; + positionArr[i * 2] = node.position[0]; + positionArr[i * 2 + 1] = node.position[1]; } self.postMessage(positionArr.buffer, [positionArr.buffer]); - } else { + } + else { // Not initialzied yet var emptyArr = new Float32Array(); // Post transfer object @@ -647,6 +764,6 @@ if (inWorker) { break; } }; -} +} /* jshint ignore:end */ module.exports = ForceLayout; \ No newline at end of file diff --git a/src/theme/default.js b/src/theme/default.js index cf4401d..6551ee3 100644 --- a/src/theme/default.js +++ b/src/theme/default.js @@ -2,7 +2,7 @@ * echarts默认主题,开发中 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ diff --git a/src/theme/infographic.js b/src/theme/infographic.js new file mode 100644 index 0000000..7e73484 --- /dev/null +++ b/src/theme/infographic.js @@ -0,0 +1,311 @@ +var theme = { + // 默认色板 + color: ['#C1232B', '#B5C334', '#FCCE10', '#E87C25', '#27727B', '#FE8463', '#9BCA63', '#FAD860', '#F3A43B', '#60C0DD', '#D7504B', '#C6E579', '#F4E001', '#F0805A', '#26C0C0'], + + // 图表标题 + title: { + textStyle: { + fontWeight: 'normal', + color: '#27727B' // 主标题文字颜色 + } + }, + + // 值域 + dataRange: { + x: 'right', + y: 'center', + itemWidth: 5, + itemHeight: 25, + color: ['#C1232B', '#FCCE10'] + }, + + toolbox: { + color: ['#C1232B', '#B5C334', '#FCCE10', '#E87C25', '#27727B', '#FE8463', '#9BCA63', '#FAD860', '#F3A43B', '#60C0DD'], + effectiveColor: '#ff4500' + }, + + // 提示框 + tooltip: { + backgroundColor: 'rgba(50,50,50,0.5)', + // 提示背景颜色,默认为透明度为0.7的黑色 + axisPointer: { // 坐标轴指示器,坐标轴触发有效 + type: 'line', + // 默认为直线,可选为:'line' | 'shadow' + lineStyle: { // 直线指示器样式设置 + color: '#27727B', + type: 'dashed' + }, + crossStyle: { + color: '#27727B' + }, + shadowStyle: { // 阴影指示器样式设置 + color: 'rgba(200,200,200,0.3)' + } + } + }, + + // 区域缩放控制器 + dataZoom: { + dataBackgroundColor: 'rgba(181,195,52,0.3)', + // 数据背景颜色 + fillerColor: 'rgba(181,195,52,0.2)', + // 填充颜色 + handleColor: '#27727B' // 手柄颜色 + }, + + // 网格 + grid: { + borderWidth: 0 + }, + + // 类目轴 + categoryAxis: { + axisLine: { // 坐标轴线 + lineStyle: { // 属性lineStyle控制线条样式 + color: '#27727B' + } + }, + splitLine: { // 分隔线 + show: false + } + }, + + // 数值型坐标轴默认参数 + valueAxis: { + axisLine: { // 坐标轴线 + show: false + }, + splitArea: { + show: false + }, + splitLine: { // 分隔线 + lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 + color: ['#ccc'], + type: 'dashed' + } + } + }, + + polar: { + axisLine: { // 坐标轴线 + lineStyle: { // 属性lineStyle控制线条样式 + color: '#ddd' + } + }, + splitArea: { + show: true, + areaStyle: { + color: ['rgba(250,250,250,0.2)', 'rgba(200,200,200,0.2)'] + } + }, + splitLine: { + lineStyle: { + color: '#ddd' + } + } + }, + + timeline: { + lineStyle: { + color: '#27727B' + }, + controlStyle: { + normal: { + color: '#27727B' + }, + emphasis: { + color: '#27727B' + } + }, + symbol: 'emptyCircle', + symbolSize: 3 + }, + + // 折线图默认参数 + line: { + itemStyle: { + normal: { + borderWidth: 2, + borderColor: '#fff', + lineStyle: { + width: 3 + } + }, + emphasis: { + borderWidth: 0 + } + }, + symbol: 'circle', + // 拐点图形类型 + symbolSize: 3.5 // 拐点图形大小 + }, + + // K线图默认参数 + k: { + itemStyle: { + normal: { + color: '#C1232B', + // 阳线填充颜色 + color0: '#B5C334', + // 阴线填充颜色 + lineStyle: { + width: 1, + color: '#C1232B', + // 阳线边框颜色 + color0: '#B5C334' // 阴线边框颜色 + } + } + } + }, + + // 散点图默认参数 + scatter: { + itemdStyle: { + normal: { + borderWidth: 1, + borderColor: 'rgba(200,200,200,0.5)' + }, + emphasis: { + borderWidth: 0 + } + }, + symbol: 'star4', + // 图形类型 + symbolSize: 4 // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 + }, + + // 雷达图默认参数 + radar: { + symbol: 'emptyCircle', + // 图形类型 + symbolSize: 3 + //symbol: null, // 拐点图形类型 + //symbolRotate : null, // 图形旋转控制 + }, + + map: { + itemStyle: { + normal: { + areaStyle: { + color: '#ddd' + }, + label: { + textStyle: { + color: '#C1232B' + } + } + }, + emphasis: { // 也是选中样式 + areaStyle: { + color: '#fe994e' + }, + label: { + textStyle: { + color: 'rgb(100,0,0)' + } + } + } + } + }, + + force: { + itemStyle: { + normal: { + linkStyle: { + color: '#27727B' + } + } + } + }, + + chord: { + itemStyle: { + normal: { + borderWidth: 1, + borderColor: 'rgba(128, 128, 128, 0.5)', + chordStyle: { + lineStyle: { + color: 'rgba(128, 128, 128, 0.5)' + } + } + }, + emphasis: { + borderWidth: 1, + borderColor: 'rgba(128, 128, 128, 0.5)', + chordStyle: { + lineStyle: { + color: 'rgba(128, 128, 128, 0.5)' + } + } + } + } + }, + + gauge: { + center: ['50%', '80%'], + radius: '100%', + startAngle: 180, + endAngle: 0, + axisLine: { // 坐标轴线 + show: true, + // 默认显示,属性show控制显示与否 + lineStyle: { // 属性lineStyle控制线条样式 + color: [ + [0.2, '#B5C334'], + [0.8, '#27727B'], + [1, '#C1232B'] + ], + width: '40%' + } + }, + axisTick: { // 坐标轴小标记 + splitNumber: 2, + // 每份split细分多少段 + length: 5, + // 属性length控制线长 + lineStyle: { // 属性lineStyle控制线条样式 + color: '#fff' + } + }, + axisLabel: { // 坐标轴文本标签,详见axis.axisLabel + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: '#fff', + fontWeight: 'bolder' + } + }, + splitLine: { // 分隔线 + length: '5%', + // 属性length控制线长 + lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 + color: '#fff' + } + }, + pointer: { + width: '40%', + length: '80%', + color: '#fff' + }, + title: { + offsetCenter: [0, -20], + // x, y,单位px + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: 'auto', + fontSize: 20 + } + }, + detail: { + offsetCenter: [0, 0], + // x, y,单位px + textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: 'auto', + fontSize: 40 + } + } + }, + + textStyle: { + fontFamily: '微软雅黑, Arial, Verdana, sans-serif' + } +}; + +module.exports = theme; \ No newline at end of file diff --git a/src/theme/macarons.js b/src/theme/macarons.js new file mode 100644 index 0000000..761aa3b --- /dev/null +++ b/src/theme/macarons.js @@ -0,0 +1,270 @@ +var theme = { + // 默认色板 + color: ['#2ec7c9', '#b6a2de', '#5ab1ef', '#ffb980', '#d87a80', '#8d98b3', '#e5cf0d', '#97b552', '#95706d', '#dc69aa', '#07a2a4', '#9a7fd1', '#588dd5', '#f5994e', '#c05050', '#59678c', '#c9ab00', '#7eb00a', '#6f5553', '#c14089'], + + // 图表标题 + title: { + textStyle: { + fontWeight: 'normal', + color: '#008acd' // 主标题文字颜色 + } + }, + + // 值域 + dataRange: { + itemWidth: 15, + color: ['#5ab1ef', '#e0ffff'] + }, + + // 工具箱 + toolbox: { + color: ['#1e90ff', '#1e90ff', '#1e90ff', '#1e90ff'], + effectiveColor: '#ff4500' + }, + + // 提示框 + tooltip: { + backgroundColor: 'rgba(50,50,50,0.5)', + // 提示背景颜色,默认为透明度为0.7的黑色 + axisPointer: { // 坐标轴指示器,坐标轴触发有效 + type: 'line', + // 默认为直线,可选为:'line' | 'shadow' + lineStyle: { // 直线指示器样式设置 + color: '#008acd' + }, + crossStyle: { + color: '#008acd' + }, + shadowStyle: { // 阴影指示器样式设置 + color: 'rgba(200,200,200,0.2)' + } + } + }, + + // 区域缩放控制器 + dataZoom: { + dataBackgroundColor: '#efefff', + // 数据背景颜色 + fillerColor: 'rgba(182,162,222,0.2)', + // 填充颜色 + handleColor: '#008acd' // 手柄颜色 + }, + + // 网格 + grid: { + borderColor: '#eee' + }, + + // 类目轴 + categoryAxis: { + axisLine: { // 坐标轴线 + lineStyle: { // 属性lineStyle控制线条样式 + color: '#008acd' + } + }, + splitLine: { // 分隔线 + lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 + color: ['#eee'] + } + } + }, + + // 数值型坐标轴默认参数 + valueAxis: { + axisLine: { // 坐标轴线 + lineStyle: { // 属性lineStyle控制线条样式 + color: '#008acd' + } + }, + splitArea: { + show: true, + areaStyle: { + color: ['rgba(250,250,250,0.1)', 'rgba(200,200,200,0.1)'] + } + }, + splitLine: { // 分隔线 + lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 + color: ['#eee'] + } + } + }, + + polar: { + axisLine: { // 坐标轴线 + lineStyle: { // 属性lineStyle控制线条样式 + color: '#ddd' + } + }, + splitArea: { + show: true, + areaStyle: { + color: ['rgba(250,250,250,0.2)', 'rgba(200,200,200,0.2)'] + } + }, + splitLine: { + lineStyle: { + color: '#ddd' + } + } + }, + + timeline: { + lineStyle: { + color: '#008acd' + }, + controlStyle: { + normal: { + color: '#008acd' + }, + emphasis: { + color: '#008acd' + } + }, + symbol: 'emptyCircle', + symbolSize: 3 + }, + + // 柱形图默认参数 + bar: { + itemStyle: { + normal: { + barBorderRadius: 5 + }, + emphasis: { + barBorderRadius: 5 + } + } + }, + + // 折线图默认参数 + line: { + smooth: true, + symbol: 'emptyCircle', + // 拐点图形类型 + symbolSize: 3 // 拐点图形大小 + }, + + // K线图默认参数 + k: { + itemStyle: { + normal: { + color: '#d87a80', + // 阳线填充颜色 + color0: '#2ec7c9', + // 阴线填充颜色 + lineStyle: { + color: '#d87a80', + // 阳线边框颜色 + color0: '#2ec7c9' // 阴线边框颜色 + } + } + } + }, + + // 散点图默认参数 + scatter: { + symbol: 'circle', + // 图形类型 + symbolSize: 4 // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2 + }, + + // 雷达图默认参数 + radar: { + symbol: 'emptyCircle', + // 图形类型 + symbolSize: 3 + //symbol: null, // 拐点图形类型 + //symbolRotate : null, // 图形旋转控制 + }, + + map: { + itemStyle: { + normal: { + areaStyle: { + color: '#ddd' + }, + label: { + textStyle: { + color: '#d87a80' + } + } + }, + emphasis: { // 也是选中样式 + areaStyle: { + color: '#fe994e' + } + } + } + }, + + force: { + itemStyle: { + normal: { + linkStyle: { + color: '#1e90ff' + } + } + } + }, + + chord: { + itemStyle: { + normal: { + borderWidth: 1, + borderColor: 'rgba(128, 128, 128, 0.5)', + chordStyle: { + lineStyle: { + color: 'rgba(128, 128, 128, 0.5)' + } + } + }, + emphasis: { + borderWidth: 1, + borderColor: 'rgba(128, 128, 128, 0.5)', + chordStyle: { + lineStyle: { + color: 'rgba(128, 128, 128, 0.5)' + } + } + } + } + }, + + gauge: { + axisLine: { // 坐标轴线 + lineStyle: { // 属性lineStyle控制线条样式 + color: [ + [0.2, '#2ec7c9'], + [0.8, '#5ab1ef'], + [1, '#d87a80'] + ], + width: 10 + } + }, + axisTick: { // 坐标轴小标记 + splitNumber: 10, + // 每份split细分多少段 + length: 15, + // 属性length控制线长 + lineStyle: { // 属性lineStyle控制线条样式 + color: 'auto' + } + }, + splitLine: { // 分隔线 + length: 22, + // 属性length控制线长 + lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 + color: 'auto' + } + }, + pointer: { + width: 5 + } + }, + + textStyle: { + fontFamily: '微软雅黑, Arial, Verdana, sans-serif' + } +}; + +module.exports = theme; \ No newline at end of file diff --git a/src/util/accMath.js b/src/util/accMath.js index e396b5f..afc2b7f 100644 --- a/src/util/accMath.js +++ b/src/util/accMath.js @@ -9,7 +9,19 @@ function accDiv(arg1, arg2) { - return accMul(arg1, 1 / arg2); + var s1 = arg1.toString(); + var s2 = arg2.toString(); + var m = 0; + try { + m = s2.split('.')[1].length; + } + catch (e) {} + try { + m -= s1.split('.')[1].length; + } + catch (e) {} + + return (s1.replace('.', '') - 0) / (s2.replace('.', '') - 0) * Math.pow(10, m); } // 乘法函数,用来得到精确的乘法结果 @@ -19,14 +31,13 @@ function accDiv(arg1, arg2) { function accMul(arg1, arg2) { - var m = 0; var s1 = arg1.toString(); var s2 = arg2.toString(); + var m = 0; try { m += s1.split('.')[1].length; } catch (e) {} - try { m += s2.split('.')[1].length; } @@ -44,12 +55,10 @@ function accMul(arg1, arg2) { function accAdd(arg1, arg2) { var r1 = 0; var r2 = 0; - try { r1 = arg1.toString().split('.')[1].length; } catch (e) {} - try { r2 = arg2.toString().split('.')[1].length; } diff --git a/src/util/coordinates.js b/src/util/coordinates.js index cab1a96..b6a2799 100644 --- a/src/util/coordinates.js +++ b/src/util/coordinates.js @@ -1,7 +1,7 @@ /** * echarts坐标处理方法 * - * @author Neil (杨骥, yangji01@baidu.com) + * @author Neil (杨骥, 511415343@qq.com) */ diff --git a/src/util/date.js b/src/util/date.js new file mode 100644 index 0000000..c481e86 --- /dev/null +++ b/src/util/date.js @@ -0,0 +1,214 @@ +/** + * echarts日期运算格式化相关 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + * + */ + +var _timeGap = [{ + formatter: 'hh : mm : ss', + value: 1000 +}, // 1s +{ + formatter: 'hh : mm : ss', + value: 1000 * 5 +}, // 5s +{ + formatter: 'hh : mm : ss', + value: 1000 * 10 +}, // 10s +{ + formatter: 'hh : mm : ss', + value: 1000 * 15 +}, // 15s +{ + formatter: 'hh : mm : ss', + value: 1000 * 30 +}, // 30s +{ + formatter: 'hh : mm\nMM - dd', + value: 60000 +}, // 1m +{ + formatter: 'hh : mm\nMM - dd', + value: 60000 * 5 +}, // 5m +{ + formatter: 'hh : mm\nMM - dd', + value: 60000 * 10 +}, // 10m +{ + formatter: 'hh : mm\nMM - dd', + value: 60000 * 15 +}, // 15m +{ + formatter: 'hh : mm\nMM - dd', + value: 60000 * 30 +}, // 30m +{ + formatter: 'hh : mm\nMM - dd', + value: 3600000 +}, // 1h +{ + formatter: 'hh : mm\nMM - dd', + value: 3600000 * 2 +}, // 2h +{ + formatter: 'hh : mm\nMM - dd', + value: 3600000 * 6 +}, // 6h +{ + formatter: 'hh : mm\nMM - dd', + value: 3600000 * 12 +}, // 12h +{ + formatter: 'MM - dd\nyyyy', + value: 3600000 * 24 +}, // 1d +{ + formatter: 'week', + value: 3600000 * 24 * 7 +}, // 7d +{ + formatter: 'month', + value: 3600000 * 24 * 31 +}, // 1M +{ + formatter: 'quarter', + value: 3600000 * 24 * 380 / 4 +}, // 3M +{ + formatter: 'half-year', + value: 3600000 * 24 * 380 / 2 +}, // 6M +{ + formatter: 'year', + value: 3600000 * 24 * 380 +} // 1Y +]; + +/** + * 获取最佳formatter + * @params {number} min 最小值 + * @params {number} max 最大值 + * @params {=number} splitNumber 分隔段数 + */ + +function getAutoFormatter(min, max, splitNumber) { + splitNumber = splitNumber > 1 ? splitNumber : 2; + // 最优解 + var curValue; + var totalGap; + // 目标 + var formatter; + var gapValue; + for (var i = 0, l = _timeGap.length; i < l; i++) { + curValue = _timeGap[i].value; + totalGap = Math.ceil(max / curValue) * curValue - Math.floor(min / curValue) * curValue; + if (Math.round(totalGap / curValue) <= splitNumber * 1.2) { + formatter = _timeGap[i].formatter; + gapValue = _timeGap[i].value; + // console.log(formatter, gapValue,i); + break; + } + } + + if (formatter == null) { + formatter = 'year'; + curValue = 3600000 * 24 * 367; + totalGap = Math.ceil(max / curValue) * curValue - Math.floor(min / curValue) * curValue; + gapValue = Math.round(totalGap / (splitNumber - 1) / curValue) * curValue; + } + + return { + formatter: formatter, + gapValue: gapValue + }; +} + +/** + * 一位数字补0 + */ + +function s2d(v) { + return v < 10 ? ('0' + v) : v; +} + +/** + * 百分比计算 + */ + +function format(formatter, value) { + if (formatter == 'week' || formatter == 'month' || formatter == 'quarter' || formatter == 'half-year' || formatter == 'year') { + formatter = 'MM - dd\nyyyy'; + } + + var date = getNewDate(value); + var y = date.getFullYear(); + var M = date.getMonth() + 1; + var d = date.getDate(); + var h = date.getHours(); + var m = date.getMinutes(); + var s = date.getSeconds(); + + formatter = formatter.replace('MM', s2d(M)); + formatter = formatter.toLowerCase(); + formatter = formatter.replace('yyyy', y); + formatter = formatter.replace('yy', y % 100); + formatter = formatter.replace('dd', s2d(d)); + formatter = formatter.replace('d', d); + formatter = formatter.replace('hh', s2d(h)); + formatter = formatter.replace('h', h); + formatter = formatter.replace('mm', s2d(m)); + formatter = formatter.replace('m', m); + formatter = formatter.replace('ss', s2d(s)); + formatter = formatter.replace('s', s); + + return formatter; +} + +function nextMonday(value) { + value = getNewDate(value); + value.setDate(value.getDate() + 8 - value.getDay()); + return value; +} + +function nextNthPerNmonth(value, nth, nmon) { + value = getNewDate(value); + value.setMonth(Math.ceil((value.getMonth() + 1) / nmon) * nmon); + value.setDate(nth); + return value; +} + +function nextNthOnMonth(value, nth) { + return nextNthPerNmonth(value, nth, 1); +} + +function nextNthOnQuarterYear(value, nth) { + return nextNthPerNmonth(value, nth, 3); +} + +function nextNthOnHalfYear(value, nth) { + return nextNthPerNmonth(value, nth, 6); +} + +function nextNthOnYear(value, nth) { + return nextNthPerNmonth(value, nth, 12); +} + +function getNewDate(value) { + return value instanceof Date ? value : new Date(typeof value == 'string' ? value.replace(/-/g, '/') : value); +} + +module.exports = { + getAutoFormatter: getAutoFormatter, + getNewDate: getNewDate, + format: format, + nextMonday: nextMonday, + nextNthPerNmonth: nextNthPerNmonth, + nextNthOnMonth: nextNthOnMonth, + nextNthOnQuarterYear: nextNthOnQuarterYear, + nextNthOnHalfYear: nextNthOnHalfYear, + nextNthOnYear: nextNthOnYear +}; \ No newline at end of file diff --git a/src/util/ecAnimation.js b/src/util/ecAnimation.js index 941941a..acedc0a 100644 --- a/src/util/ecAnimation.js +++ b/src/util/ecAnimation.js @@ -2,7 +2,7 @@ * echarts图表动画基类 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ @@ -64,9 +64,12 @@ function pointList(zr, oldShape, newShape, duration, easing) { } zr.addShape(newShape); + newShape._animating = true; zr.animate(newShape.id, 'style').when( duration, { pointList: newPointList + }).done(function () { + newShape._animating = false; }).start(easing); } @@ -101,6 +104,7 @@ function rectangle(zr, oldShape, newShape, duration, easing) { var newShapeStyle = newShape.style; if (!oldShape) { // add oldShape = { + position: newShape.position, style: { x: newShapeStyle.x, y: newShape._orient == 'vertical' ? newShapeStyle.y + newShapeStyle.height : newShapeStyle.y, @@ -114,16 +118,28 @@ function rectangle(zr, oldShape, newShape, duration, easing) { var newY = newShapeStyle.y; var newWidth = newShapeStyle.width; var newHeight = newShapeStyle.height; + var newPosition = [newShape.position[0], newShape.position[1]]; cloneStyle( newShape, oldShape, 'x', 'y', 'width', 'height'); + newShape.position = oldShape.position; zr.addShape(newShape); + if (newPosition[0] != oldShape.position[0] || newPosition[1] != oldShape.position[1]) { + zr.animate(newShape.id, '').when( + duration, { + position: newPosition + }).start(easing); + } + + newShape._animating = true; zr.animate(newShape.id, 'style').when( duration, { x: newX, y: newY, width: newWidth, height: newHeight + }).done(function () { + newShape._animating = false; }).start(easing); } @@ -150,9 +166,12 @@ function candle(zr, oldShape, newShape, duration, easing) { var newY = newShape.style.y; newShape.style.y = oldShape.style.y; zr.addShape(newShape); + newShape._animating = true; zr.animate(newShape.id, 'style').when( duration, { y: newY + }).done(function () { + newShape._animating = false; }).start(easing); } @@ -172,6 +191,8 @@ function ring(zr, oldShape, newShape, duration, easing) { var r0 = newShape.style.r0; var r = newShape.style.r; + newShape._animating = true; + if (newShape._animationAdd != 'r') { newShape.style.r0 = 0; newShape.style.r = 0; @@ -182,6 +203,8 @@ function ring(zr, oldShape, newShape, duration, easing) { duration, { r0: r0, r: r + }).done(function () { + newShape._animating = false; }).start(easing); zr.animate(newShape.id, '').when( Math.round(duration / 3 * 2), { @@ -195,6 +218,8 @@ function ring(zr, oldShape, newShape, duration, easing) { zr.animate(newShape.id, 'style').when( duration, { r0: r0 + }).done(function () { + newShape._animating = false; }).start(easing); } } @@ -235,10 +260,13 @@ function sector(zr, oldShape, newShape, duration, easing) { newShape, oldShape, 'startAngle', 'endAngle'); zr.addShape(newShape); + newShape._animating = true; zr.animate(newShape.id, 'style').when( duration, { startAngle: startAngle, endAngle: endAngle + }).done(function () { + newShape._animating = false; }).start(easing); } @@ -269,10 +297,13 @@ function text(zr, oldShape, newShape, duration, easing) { newShape, oldShape, 'x', 'y'); zr.addShape(newShape); + newShape._animating = true; zr.animate(newShape.id, 'style').when( duration, { x: x, y: y + }).done(function () { + newShape._animating = false; }).start(easing); } @@ -293,9 +324,12 @@ function polygon(zr, oldShape, newShape, duration, easing) { newShape.scale = [0.1, 0.1, x, y]; zr.addShape(newShape); + newShape._animating = true; zr.animate(newShape.id, '').when( duration, { scale: [1, 1, x, y] + }).done(function () { + newShape._animating = false; }).start(easing); } @@ -309,14 +343,14 @@ function polygon(zr, oldShape, newShape, duration, easing) { * @param {tring} easing */ -function chord(zr, oldShape, newShape, duration, easing) { +function ribbon(zr, oldShape, newShape, duration, easing) { if (!oldShape) { // add oldShape = { style: { source0: 0, - source1: 360, + source1: newShape.style.source1 > 0 ? 360 : -360, target0: 0, - target1: 360 + target1: newShape.style.target1 > 0 ? 360 : -360 } }; } @@ -332,12 +366,15 @@ function chord(zr, oldShape, newShape, duration, easing) { } zr.addShape(newShape); + newShape._animating = true; zr.animate(newShape.id, 'style').when( duration, { source0: source0, source1: source1, target0: target0, target1: target1 + }).done(function () { + newShape._animating = false; }).start(easing); } @@ -363,9 +400,12 @@ function gaugePointer(zr, oldShape, newShape, duration, easing) { var angle = newShape.style.angle; newShape.style.angle = oldShape.style.angle; zr.addShape(newShape); + newShape._animating = true; zr.animate(newShape.id, 'style').when( duration, { angle: angle + }).done(function () { + newShape._animating = false; }).start(easing); } @@ -379,7 +419,7 @@ function gaugePointer(zr, oldShape, newShape, duration, easing) { * @param {tring} easing */ -function icon(zr, oldShape, newShape, duration, easing) { +function icon(zr, oldShape, newShape, duration, easing, delay) { // 避免markPoint特效取值在动画帧上 newShape.style._x = newShape.style.x; newShape.style._y = newShape.style.y; @@ -389,11 +429,14 @@ function icon(zr, oldShape, newShape, duration, easing) { if (!oldShape) { // add var x = newShape._x || 0; var y = newShape._y || 0; - newShape.scale = [0, 0, x, y]; + newShape.scale = [0.01, 0.01, x, y]; zr.addShape(newShape); - zr.animate(newShape.id, '').when( + newShape._animating = true; + zr.animate(newShape.id, '').delay(delay).when( duration, { scale: [1, 1, x, y] + }).done(function () { + newShape._animating = false; }).start(easing || 'QuinticOut'); } else { // mod @@ -415,6 +458,8 @@ function line(zr, oldShape, newShape, duration, easing) { if (!oldShape) { oldShape = { style: { + xStart: newShape.style.xStart, + yStart: newShape.style.yStart, xEnd: newShape.style.xStart, yEnd: newShape.style.yStart } @@ -430,12 +475,15 @@ function line(zr, oldShape, newShape, duration, easing) { newShape, oldShape, 'xStart', 'xEnd', 'yStart', 'yEnd'); zr.addShape(newShape); + newShape._animating = true; zr.animate(newShape.id, 'style').when( duration, { xStart: xStart, xEnd: xEnd, yStart: yStart, yEnd: yEnd + }).done(function () { + newShape._animating = false; }).start(easing); } @@ -456,6 +504,7 @@ function markline(zr, oldShape, newShape, duration, easing) { [newShape.style.xStart, newShape.style.yStart] ] : oldShape.style.pointList; zr.addShape(newShape); + newShape._animating = true; zr.animate(newShape.id, 'style').when( duration, { pointList: [ @@ -464,17 +513,29 @@ function markline(zr, oldShape, newShape, duration, easing) { [ newShape._x || 0, newShape._y || 0] ] + }).done(function () { + newShape._animating = false; }).start(easing || 'QuinticOut'); } else { // 曲线动画 - newShape.style.pointListLength = 1; - zr.addShape(newShape); - newShape.style.pointList = newShape.style.pointList || newShape.getPointList(newShape.style); - zr.animate(newShape.id, 'style').when( - duration, { - pointListLength: newShape.style.pointList.length - }).start(easing || 'QuinticOut'); + if (!oldShape) { + // 新增 + newShape.style.pointListLength = 1; + zr.addShape(newShape); + newShape._animating = true; + newShape.style.pointList = newShape.style.pointList || newShape.getPointList(newShape.style); + zr.animate(newShape.id, 'style').when( + duration, { + pointListLength: newShape.style.pointList.length + }).done(function () { + newShape._animating = false; + }).start(easing || 'QuinticOut'); + } + else { + // 过渡 + zr.addShape(newShape); + } } } @@ -486,7 +547,7 @@ module.exports = { sector: sector, text: text, polygon: polygon, - chord: chord, + ribbon: ribbon, gaugePointer: gaugePointer, icon: icon, line: line, diff --git a/src/util/ecData.js b/src/util/ecData.js index 76b2d89..985d252 100644 --- a/src/util/ecData.js +++ b/src/util/ecData.js @@ -2,7 +2,7 @@ * echarts通用私有数据服务 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ diff --git a/src/util/ecEffect.js b/src/util/ecEffect.js index a320774..22362cd 100644 --- a/src/util/ecEffect.js +++ b/src/util/ecEffect.js @@ -2,7 +2,7 @@ * echarts图表特效基类 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ @@ -20,35 +20,50 @@ function point(zr, effectList, shape, zlevel) { var color = effect.color || shape.style.strokeColor || shape.style.color; var shadowColor = effect.shadowColor || color; var size = effect.scaleSize; + var distance = effect.bounceDistance; var shadowBlur = typeof effect.shadowBlur != 'undefined' ? effect.shadowBlur : size; - var effectShape = new IconShape({ - zlevel: zlevel, - style: { - brushType: 'stroke', - iconType: (shape.style.iconType != 'pin' && shape.style.iconType != 'droplet') ? shape.style.iconType : 'circle', - x: shadowBlur + 1, - // 线宽 - y: shadowBlur + 1, - n: shape.style.n, - width: shape.style.width * size, - height: shape.style.height * size, - lineWidth: 1, - strokeColor: color, - shadowColor: shadowColor, - shadowBlur: shadowBlur - }, - draggable: false, - hoverable: false - }); + var effectShape; + if (shape.type !== 'image') { + effectShape = new IconShape({ + zlevel: zlevel, + style: { + brushType: 'stroke', + iconType: shape.style.iconType != 'droplet' ? shape.style.iconType : 'circle', + x: shadowBlur + 1, + // 线宽 + y: shadowBlur + 1, + n: shape.style.n, + width: shape.style._width * size, + height: shape.style._height * size, + lineWidth: 1, + strokeColor: color, + shadowColor: shadowColor, + shadowBlur: shadowBlur + }, + draggable: false, + hoverable: false + }); + if (shape.style.iconType == 'pin') { + effectShape.style.y += effectShape.style.height / 2 * 1.5; + } - if (canvasSupported) { // 提高性能,换成image - effectShape.style.image = zr.shapeToImage( - effectShape, effectShape.style.width + shadowBlur * 2 + 2, effectShape.style.height + shadowBlur * 2 + 2).style.image; + if (canvasSupported) { // 提高性能,换成image + effectShape.style.image = zr.shapeToImage( + effectShape, effectShape.style.width + shadowBlur * 2 + 2, effectShape.style.height + shadowBlur * 2 + 2).style.image; + effectShape = new ImageShape({ + zlevel: effectShape.zlevel, + style: effectShape.style, + draggable: false, + hoverable: false + }); + } + } + else { effectShape = new ImageShape({ - zlevel: effectShape.zlevel, - style: effectShape.style, + zlevel: zlevel, + style: shape.style, draggable: false, hoverable: false }); @@ -61,10 +76,15 @@ function point(zr, effectList, shape, zlevel) { effectList.push(effectShape); zr.addShape(effectShape); - var devicePixelRatio = window.devicePixelRatio || 1; - var offset = (effectShape.style.width / devicePixelRatio - shape.style.width) / 2; + var devicePixelRatio = shape.type !== 'image' ? (window.devicePixelRatio || 1) : 1; + var offset = (effectShape.style.width / devicePixelRatio - shape.style._width) / 2; effectShape.style.x = shape.style._x - offset; effectShape.style.y = shape.style._y - offset; + + if (shape.style.iconType == 'pin') { + effectShape.style.y -= shape.style.height / 2 * 1.5; + } + var duration = (effect.period + Math.random() * 10) * 100; zr.modShape( @@ -74,18 +94,35 @@ function point(zr, effectList, shape, zlevel) { var centerX = effectShape.style.x + (effectShape.style.width) / 2 / devicePixelRatio; var centerY = effectShape.style.y + (effectShape.style.height) / 2 / devicePixelRatio; - zr.modShape( - effectShape.id, { - scale: [0.1, 0.1, centerX, centerY] - }); - zr.animate(effectShape.id, '', effect.loop).when( - duration, { - scale: [1, 1, centerX, centerY] - }).done(function () { - shape.effect.show = false; - zr.delShape(effectShape.id); - }).start(); + if (effect.type === 'scale') { + // 放大效果 + zr.modShape( + effectShape.id, { + scale: [0.1, 0.1, centerX, centerY] + }); + + zr.animate(effectShape.id, '', effect.loop).when( + duration, { + scale: [1, 1, centerX, centerY] + }).done(function () { + shape.effect.show = false; + zr.delShape(effectShape.id); + }).start(); + } + else { + zr.animate(effectShape.id, 'style', effect.loop).when( + duration, { + y: effectShape.style.y - distance + }).when( + duration * 2, { + y: effectShape.style.y + }).done(function () { + shape.effect.show = false; + zr.delShape(effectShape.id); + }).start(); + } + } function largePoint(zr, effectList, shape, zlevel) { diff --git a/src/util/ecQuery.js b/src/util/ecQuery.js index 9413f44..2d86751 100644 --- a/src/util/ecQuery.js +++ b/src/util/ecQuery.js @@ -2,7 +2,7 @@ * echarts层级查找方法 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ diff --git a/src/util/mapData/params.js b/src/util/mapData/params.js index 96370f3..03eefba 100644 --- a/src/util/mapData/params.js +++ b/src/util/mapData/params.js @@ -61,6 +61,24 @@ function decodePolygon(coordinate, encodeOffsets) { } var mapParams = { + 'none': { + getGeoJson: function (callback) { + callback({ + type: 'FeatureCollection', + features: [{ + type: 'Feature', + geometry: { + coordinates: [], + encodeOffsets: [], + type: 'Polygon' + }, + properties: { + + } + }] + }); + } + }, 'world': { getGeoJson: function (callback) { require.async(['./geoJson/world_geo.js'], function (md) { @@ -78,7 +96,7 @@ var mapParams = { '南海诸岛': { textCoord: [126, 25], getPath: function (leftTop, scale) { - // scale.x : width = 10.51 : 64 + // scale.x: width = 10.51 : 64 var pList = [ [ [0, 3.5], diff --git a/src/util/ndarray.js b/src/util/ndarray.js index 049c965..c577133 100644 --- a/src/util/ndarray.js +++ b/src/util/ndarray.js @@ -249,7 +249,7 @@ NDArray.prototype = { /** * Get array dimension. - * @return {[type]} [description] + * @return {number} [description] */ dimension: function () { return this._shape.length; diff --git a/src/util/number.js b/src/util/number.js index 0d12b90..50e5fbf 100644 --- a/src/util/number.js +++ b/src/util/number.js @@ -2,7 +2,7 @@ * echarts数字运算相关 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ diff --git a/src/util/projection/albers.js b/src/util/projection/albers.js index 7998c12..2641994 100644 --- a/src/util/projection/albers.js +++ b/src/util/projection/albers.js @@ -2,7 +2,7 @@ * echarts地图投射算法 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ diff --git a/src/util/projection/mercator.js b/src/util/projection/mercator.js index 5da3bf6..d371976 100644 --- a/src/util/projection/mercator.js +++ b/src/util/projection/mercator.js @@ -2,7 +2,7 @@ * echarts地图投射算法 * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ diff --git a/src/util/projection/normal.js b/src/util/projection/normal.js index 5ba9efc..3c93f92 100644 --- a/src/util/projection/normal.js +++ b/src/util/projection/normal.js @@ -3,7 +3,7 @@ * modify from GeoMap v0.5.3 https://github.com/x6doooo/GeoMap * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ @@ -236,7 +236,7 @@ function geoJson2Path(json, transform, specialArea) { }; str = convertor[shapeType](shapeCoordinates); pathArray.push({ - //type : shapeType, + // type: shapeType, path: str, cp: shape.properties.cp ? convertor.makePoint(shape.properties.cp) : convertor.makePoint([(convertor._bbox.xmin + convertor._bbox.xmax) / 2, (convertor._bbox.ymin + convertor._bbox.ymax) / 2]), properties: shape.properties, diff --git a/src/util/projection/svg.js b/src/util/projection/svg.js index e112570..47b7795 100644 --- a/src/util/projection/svg.js +++ b/src/util/projection/svg.js @@ -3,7 +3,7 @@ * modify from GeoMap v0.5.3 https://github.com/x6doooo/GeoMap * * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * */ diff --git a/src/util/shape/Candle.js b/src/util/shape/Candle.js index 5fc7656..446d890 100644 --- a/src/util/shape/Candle.js +++ b/src/util/shape/Candle.js @@ -1,7 +1,7 @@ /** * zrender * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * * shape类:蜡烛 * 可配图形属性: diff --git a/src/util/shape/Chain.js b/src/util/shape/Chain.js index a9416dc..c554b7b 100644 --- a/src/util/shape/Chain.js +++ b/src/util/shape/Chain.js @@ -1,7 +1,7 @@ /** * zrender * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * * shape类:时间轴线 */ @@ -43,9 +43,11 @@ Chain.prototype = { // 设置transform this.setTransform(ctx); + ctx.save(); ctx.beginPath(); this.buildLinePath(ctx, style); ctx.stroke(); + ctx.restore(); this.brushSymbol(ctx, style); diff --git a/src/util/shape/Chord.js b/src/util/shape/Chord.js deleted file mode 100644 index 5d386c8..0000000 --- a/src/util/shape/Chord.js +++ /dev/null @@ -1,104 +0,0 @@ -/** - * zrender - * - * @author pissang (https://github.com/pissang) - * - * shape类:chord - * 可配图形属性: - { - // 基础属性 - shape : 'chord', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - center : {array}, - source0 : {number}, - source1 : {number}, - target0 : {number}, - target1 : {number}, - r : {number}, - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - */ - -var Base = require('../../zrender/shape/Base.js'); -var zrUtil = require('../../zrender/tool/util.js'); -var _ctx = zrUtil.getContext(); - -function ChordShape(options) { - Base.call(this, options); -} - -ChordShape.prototype = { - type: 'chord', - - // center, source0, source1, target0, target1, r - buildPath: function (ctx, style) { - var PI2 = Math.PI * 2; - var cx = style.center[0]; - var cy = style.center[1]; - var r = style.r; - var s0 = style.source0 / 180 * Math.PI; - var s1 = style.source1 / 180 * Math.PI; - var t0 = style.target0 / 180 * Math.PI; - var t1 = style.target1 / 180 * Math.PI; - var sx0 = cx + Math.cos(PI2 - s0) * r; - var sy0 = cy - Math.sin(PI2 - s0) * r; - var sx1 = cx + Math.cos(PI2 - s1) * r; - var sy1 = cy - Math.sin(PI2 - s1) * r; - var tx0 = cx + Math.cos(PI2 - t0) * r; - var ty0 = cy - Math.sin(PI2 - t0) * r; - var tx1 = cx + Math.cos(PI2 - t1) * r; - var ty1 = cy - Math.sin(PI2 - t1) * r; - - ctx.moveTo(sx0, sy0); - ctx.arc(cx, cy, style.r, s0, s1, false); - ctx.bezierCurveTo((cx - sx1) * 0.70 + sx1, (cy - sy1) * 0.70 + sy1, (cx - tx0) * 0.70 + tx0, (cy - ty0) * 0.70 + ty0, tx0, ty0); - // Chord to self - if (style.source0 === style.target0 && style.source1 === style.target1) { - return; - } - ctx.arc(cx, cy, style.r, t0, t1, false); - ctx.bezierCurveTo((cx - tx1) * 0.70 + tx1, (cy - ty1) * 0.70 + ty1, (cx - sx0) * 0.70 + sx0, (cy - sy0) * 0.70 + sy0, sx0, sy0); - }, - - getRect: function () { - return { - x: 0, - y: 0, - width: 0, - height: 0 - }; - }, - - isCover: function (x, y) { - if (!_ctx.isPointInPath) { // In ie - return false; - } - var originPos = this.getTansform(x, y); - x = originPos[0]; - y = originPos[1]; - - _ctx.beginPath(); - ChordShape.prototype.buildPath.call(null, _ctx, this.style); - _ctx.closePath(); - - return _ctx.isPointInPath(x, y); - } -}; - -zrUtil.inherits(ChordShape, Base); - -module.exports = ChordShape; \ No newline at end of file diff --git a/src/util/shape/Cross.js b/src/util/shape/Cross.js index ea483fb..20be2c1 100644 --- a/src/util/shape/Cross.js +++ b/src/util/shape/Cross.js @@ -1,7 +1,7 @@ /** * zrender * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * * shape类:十字准星 * 可配图形属性: diff --git a/src/util/shape/GaugePointer.js b/src/util/shape/GaugePointer.js index 1afe80b..132611a 100644 --- a/src/util/shape/GaugePointer.js +++ b/src/util/shape/GaugePointer.js @@ -1,7 +1,7 @@ /** * zrender * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * * shape类:仪表盘指针 * 可配图形属性: diff --git a/src/util/shape/HalfSmoothPolygon.js b/src/util/shape/HalfSmoothPolygon.js index 0dd2a9d..55a79d1 100644 --- a/src/util/shape/HalfSmoothPolygon.js +++ b/src/util/shape/HalfSmoothPolygon.js @@ -1,7 +1,7 @@ /** * zrender * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * * shape类:支持半平滑的polygon,折线面积图使用 * 可配图形属性: @@ -68,7 +68,7 @@ HalfSmoothPolygon.prototype = { } if (style.smooth) { var controlPoints = smoothBezier( - pointList.slice(0, -2), style.smooth); + pointList.slice(0, -2), style.smooth, false, style.smoothConstraint); ctx.moveTo(pointList[0][0], pointList[0][1]); var cp1; diff --git a/src/util/shape/HandlePolygon.js b/src/util/shape/HandlePolygon.js index 8f10e94..84ee4cf 100644 --- a/src/util/shape/HandlePolygon.js +++ b/src/util/shape/HandlePolygon.js @@ -1,7 +1,7 @@ /** * zrender * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * * shape类:handlePolygon,dataRange手柄 */ diff --git a/src/util/shape/Icon.js b/src/util/shape/Icon.js index 60eca67..89994d7 100644 --- a/src/util/shape/Icon.js +++ b/src/util/shape/Icon.js @@ -1,7 +1,7 @@ /** * echarts扩展zrender shape * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * * shape类:icon * 可配图形属性: @@ -35,181 +35,261 @@ var zrUtil = require('../../zrender/tool/util.js'); function _iconMark(ctx, style) { + var x = style.x; + var y = style.y; var dx = style.width / 16; var dy = style.height / 16; - ctx.moveTo(style.x, style.y + style.height); - ctx.lineTo(style.x + 5 * dx, style.y + 14 * dy); - ctx.lineTo(style.x + style.width, style.y + 3 * dy); - ctx.lineTo(style.x + 13 * dx, style.y); - ctx.lineTo(style.x + 2 * dx, style.y + 11 * dy); - ctx.lineTo(style.x, style.y + style.height); - - ctx.moveTo(style.x + 6 * dx, style.y + 10 * dy); - ctx.lineTo(style.x + 14 * dx, style.y + 2 * dy); + ctx.moveTo(x, y + style.height); + ctx.lineTo(x + 5 * dx, y + 14 * dy); + ctx.lineTo(x + style.width, y + 3 * dy); + ctx.lineTo(x + 13 * dx, y); + ctx.lineTo(x + 2 * dx, y + 11 * dy); + ctx.lineTo(x, y + style.height); - ctx.moveTo(style.x + 10 * dx, style.y + 13 * dy); - ctx.lineTo(style.x + style.width, style.y + 13 * dy); + ctx.moveTo(x + 6 * dx, y + 10 * dy); + ctx.lineTo(x + 14 * dx, y + 2 * dy); - ctx.moveTo(style.x + 13 * dx, style.y + 10 * dy); - ctx.lineTo(style.x + 13 * dx, style.y + style.height); + ctx.moveTo(x + 10 * dx, y + 13 * dy); + ctx.lineTo(x + style.width, y + 13 * dy); - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); + ctx.moveTo(x + 13 * dx, y + 10 * dy); + ctx.lineTo(x + 13 * dx, y + style.height); } function _iconMarkUndo(ctx, style) { + var x = style.x; + var y = style.y; var dx = style.width / 16; var dy = style.height / 16; - ctx.moveTo(style.x, style.y + style.height); - ctx.lineTo(style.x + 5 * dx, style.y + 14 * dy); - ctx.lineTo(style.x + style.width, style.y + 3 * dy); - ctx.lineTo(style.x + 13 * dx, style.y); - ctx.lineTo(style.x + 2 * dx, style.y + 11 * dy); - ctx.lineTo(style.x, style.y + style.height); - - ctx.moveTo(style.x + 6 * dx, style.y + 10 * dy); - ctx.lineTo(style.x + 14 * dx, style.y + 2 * dy); - - ctx.moveTo(style.x + 10 * dx, style.y + 13 * dy); - ctx.lineTo(style.x + style.width, style.y + 13 * dy); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); + ctx.moveTo(x, y + style.height); + ctx.lineTo(x + 5 * dx, y + 14 * dy); + ctx.lineTo(x + style.width, y + 3 * dy); + ctx.lineTo(x + 13 * dx, y); + ctx.lineTo(x + 2 * dx, y + 11 * dy); + ctx.lineTo(x, y + style.height); + + ctx.moveTo(x + 6 * dx, y + 10 * dy); + ctx.lineTo(x + 14 * dx, y + 2 * dy); + + ctx.moveTo(x + 10 * dx, y + 13 * dy); + ctx.lineTo(x + style.width, y + 13 * dy); } function _iconMarkClear(ctx, style) { + var x = style.x; + var y = style.y; var dx = style.width / 16; var dy = style.height / 16; - ctx.moveTo(style.x + 4 * dx, style.y + 15 * dy); - ctx.lineTo(style.x + 9 * dx, style.y + 13 * dy); - ctx.lineTo(style.x + 14 * dx, style.y + 8 * dy); - ctx.lineTo(style.x + 11 * dx, style.y + 5 * dy); - ctx.lineTo(style.x + 6 * dx, style.y + 10 * dy); - ctx.lineTo(style.x + 4 * dx, style.y + 15 * dy); - - ctx.moveTo(style.x + 5 * dx, style.y); - ctx.lineTo(style.x + 11 * dx, style.y); - ctx.moveTo(style.x + 5 * dx, style.y + dy); - ctx.lineTo(style.x + 11 * dx, style.y + dy); - ctx.moveTo(style.x, style.y + 2 * dy); - ctx.lineTo(style.x + style.width, style.y + 2 * dy); - - ctx.moveTo(style.x, style.y + 5 * dy); - ctx.lineTo(style.x + 3 * dx, style.y + style.height); - ctx.lineTo(style.x + 13 * dx, style.y + style.height); - ctx.lineTo(style.x + style.width, style.y + 5 * dy); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); + ctx.moveTo(x + 4 * dx, y + 15 * dy); + ctx.lineTo(x + 9 * dx, y + 13 * dy); + ctx.lineTo(x + 14 * dx, y + 8 * dy); + ctx.lineTo(x + 11 * dx, y + 5 * dy); + ctx.lineTo(x + 6 * dx, y + 10 * dy); + ctx.lineTo(x + 4 * dx, y + 15 * dy); + + ctx.moveTo(x + 5 * dx, y); + ctx.lineTo(x + 11 * dx, y); + ctx.moveTo(x + 5 * dx, y + dy); + ctx.lineTo(x + 11 * dx, y + dy); + ctx.moveTo(x, y + 2 * dy); + ctx.lineTo(x + style.width, y + 2 * dy); + + ctx.moveTo(x, y + 5 * dy); + ctx.lineTo(x + 3 * dx, y + style.height); + ctx.lineTo(x + 13 * dx, y + style.height); + ctx.lineTo(x + style.width, y + 5 * dy); } function _iconDataZoom(ctx, style) { + var x = style.x; + var y = style.y; var dx = style.width / 16; var dy = style.height / 16; - ctx.moveTo(style.x, style.y + 3 * dy); - ctx.lineTo(style.x + 6 * dx, style.y + 3 * dy); - - ctx.moveTo(style.x + 3 * dx, style.y); - ctx.lineTo(style.x + 3 * dx, style.y + 6 * dy); + ctx.moveTo(x, y + 3 * dy); + ctx.lineTo(x + 6 * dx, y + 3 * dy); - ctx.moveTo(style.x + 3 * dx, style.y + 8 * dy); - ctx.lineTo(style.x + 3 * dx, style.y + style.height); - ctx.lineTo(style.x + style.width, style.y + style.height); - ctx.lineTo(style.x + style.width, style.y + 3 * dy); - ctx.lineTo(style.x + 8 * dx, style.y + 3 * dy); + ctx.moveTo(x + 3 * dx, y); + ctx.lineTo(x + 3 * dx, y + 6 * dy); - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); + ctx.moveTo(x + 3 * dx, y + 8 * dy); + ctx.lineTo(x + 3 * dx, y + style.height); + ctx.lineTo(x + style.width, y + style.height); + ctx.lineTo(x + style.width, y + 3 * dy); + ctx.lineTo(x + 8 * dx, y + 3 * dy); } function _iconDataZoomReset(ctx, style) { + var x = style.x; + var y = style.y; var dx = style.width / 16; var dy = style.height / 16; - ctx.moveTo(style.x + 6 * dx, style.y); - ctx.lineTo(style.x + 2 * dx, style.y + 3 * dy); - ctx.lineTo(style.x + 6 * dx, style.y + 6 * dy); + ctx.moveTo(x + 6 * dx, y); + ctx.lineTo(x + 2 * dx, y + 3 * dy); + ctx.lineTo(x + 6 * dx, y + 6 * dy); - ctx.moveTo(style.x + 2 * dx, style.y + 3 * dy); - ctx.lineTo(style.x + 14 * dx, style.y + 3 * dy); - ctx.lineTo(style.x + 14 * dx, style.y + 11 * dy); + ctx.moveTo(x + 2 * dx, y + 3 * dy); + ctx.lineTo(x + 14 * dx, y + 3 * dy); + ctx.lineTo(x + 14 * dx, y + 11 * dy); - ctx.moveTo(style.x + 2 * dx, style.y + 5 * dy); - ctx.lineTo(style.x + 2 * dx, style.y + 13 * dy); - ctx.lineTo(style.x + 14 * dx, style.y + 13 * dy); + ctx.moveTo(x + 2 * dx, y + 5 * dy); + ctx.lineTo(x + 2 * dx, y + 13 * dy); + ctx.lineTo(x + 14 * dx, y + 13 * dy); - ctx.moveTo(style.x + 10 * dx, style.y + 10 * dy); - ctx.lineTo(style.x + 14 * dx, style.y + 13 * dy); - ctx.lineTo(style.x + 10 * dx, style.y + style.height); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); + ctx.moveTo(x + 10 * dx, y + 10 * dy); + ctx.lineTo(x + 14 * dx, y + 13 * dy); + ctx.lineTo(x + 10 * dx, y + style.height); } function _iconRestore(ctx, style) { + var x = style.x; + var y = style.y; var dx = style.width / 16; var dy = style.height / 16; var r = style.width / 2; ctx.lineWidth = 1.5; - ctx.arc(style.x + r, style.y + r, r - dx, 0, Math.PI * 2 / 3); - ctx.moveTo(style.x + 3 * dx, style.y + style.height); - ctx.lineTo(style.x + 0 * dx, style.y + 12 * dy); - ctx.lineTo(style.x + 5 * dx, style.y + 11 * dy); - - ctx.moveTo(style.x, style.y + 8 * dy); - ctx.arc(style.x + r, style.y + r, r - dx, Math.PI, Math.PI * 5 / 3); - ctx.moveTo(style.x + 13 * dx, style.y); - ctx.lineTo(style.x + style.width, style.y + 4 * dy); - ctx.lineTo(style.x + 11 * dx, style.y + 5 * dy); + ctx.arc(x + r, y + r, r - dx, 0, Math.PI * 2 / 3); + ctx.moveTo(x + 3 * dx, y + style.height); + ctx.lineTo(x + 0 * dx, y + 12 * dy); + ctx.lineTo(x + 5 * dx, y + 11 * dy); - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); + ctx.moveTo(x, y + 8 * dy); + ctx.arc(x + r, y + r, r - dx, Math.PI, Math.PI * 5 / 3); + ctx.moveTo(x + 13 * dx, y); + ctx.lineTo(x + style.width, y + 4 * dy); + ctx.lineTo(x + 11 * dx, y + 5 * dy); } function _iconLineChart(ctx, style) { + var x = style.x; + var y = style.y; var dx = style.width / 16; var dy = style.height / 16; - ctx.moveTo(style.x, style.y); - ctx.lineTo(style.x, style.y + style.height); - ctx.lineTo(style.x + style.width, style.y + style.height); - - ctx.moveTo(style.x + 2 * dx, style.y + 14 * dy); - ctx.lineTo(style.x + 7 * dx, style.y + 6 * dy); - ctx.lineTo(style.x + 11 * dx, style.y + 11 * dy); - ctx.lineTo(style.x + 15 * dx, style.y + 2 * dy); + ctx.moveTo(x, y); + ctx.lineTo(x, y + style.height); + ctx.lineTo(x + style.width, y + style.height); - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); + ctx.moveTo(x + 2 * dx, y + 14 * dy); + ctx.lineTo(x + 7 * dx, y + 6 * dy); + ctx.lineTo(x + 11 * dx, y + 11 * dy); + ctx.lineTo(x + 15 * dx, y + 2 * dy); } function _iconBarChart(ctx, style) { + var x = style.x; + var y = style.y; + var dx = style.width / 16; + var dy = style.height / 16; + + ctx.moveTo(x, y); + ctx.lineTo(x, y + style.height); + ctx.lineTo(x + style.width, y + style.height); + + ctx.moveTo(x + 3 * dx, y + 14 * dy); + ctx.lineTo(x + 3 * dx, y + 6 * dy); + ctx.lineTo(x + 4 * dx, y + 6 * dy); + ctx.lineTo(x + 4 * dx, y + 14 * dy); + ctx.moveTo(x + 7 * dx, y + 14 * dy); + ctx.lineTo(x + 7 * dx, y + 2 * dy); + ctx.lineTo(x + 8 * dx, y + 2 * dy); + ctx.lineTo(x + 8 * dx, y + 14 * dy); + ctx.moveTo(x + 11 * dx, y + 14 * dy); + ctx.lineTo(x + 11 * dx, y + 9 * dy); + ctx.lineTo(x + 12 * dx, y + 9 * dy); + ctx.lineTo(x + 12 * dx, y + 14 * dy); +} + +function _iconPieChart(ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width - 2; + var height = style.height - 2; + var r = Math.min(width, height) / 2; + y += 2; + ctx.moveTo(x + r + 3, y + r - 3); + ctx.arc(x + r + 3, y + r - 3, r - 1, 0, -Math.PI / 2, true); + ctx.lineTo(x + r + 3, y + r - 3); + + ctx.moveTo(x + r, y); + ctx.lineTo(x + r, y + r); + ctx.arc(x + r, y + r, r, -Math.PI / 2, Math.PI * 2, true); + ctx.lineTo(x + r, y + r); + ctx.lineWidth = 1.5; +} + +function _iconFunnelChart(ctx, style) { + var x = style.x; + var y = style.y; var dx = style.width / 16; var dy = style.height / 16; + y -= dy; + ctx.moveTo(x + 1 * dx, y + 2 * dy); + ctx.lineTo(x + 15 * dx, y + 2 * dy); + ctx.lineTo(x + 14 * dx, y + 3 * dy); + ctx.lineTo(x + 2 * dx, y + 3 * dy); + + ctx.moveTo(x + 3 * dx, y + 6 * dy); + ctx.lineTo(x + 13 * dx, y + 6 * dy); + ctx.lineTo(x + 12 * dx, y + 7 * dy); + ctx.lineTo(x + 4 * dx, y + 7 * dy); + + ctx.moveTo(x + 5 * dx, y + 10 * dy); + ctx.lineTo(x + 11 * dx, y + 10 * dy); + ctx.lineTo(x + 10 * dx, y + 11 * dy); + ctx.lineTo(x + 6 * dx, y + 11 * dy); + + ctx.moveTo(x + 7 * dx, y + 14 * dy); + ctx.lineTo(x + 9 * dx, y + 14 * dy); + ctx.lineTo(x + 8 * dx, y + 15 * dy); + ctx.lineTo(x + 7 * dx, y + 15 * dy); +} + +function _iconForceChart(ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + var dx = width / 16; + var dy = height / 16; + var r = Math.min(dx, dy) * 2; + + ctx.moveTo(x + dx + r, y + dy + r); + ctx.arc(x + dx, y + dy, r, Math.PI / 4, Math.PI * 3); + + ctx.lineTo(x + 7 * dx - r, y + 6 * dy - r); + ctx.arc(x + 7 * dx, y + 6 * dy, r, Math.PI / 4 * 5, Math.PI * 4); + ctx.arc(x + 7 * dx, y + 6 * dy, r / 2, Math.PI / 4 * 5, Math.PI * 4); + + ctx.moveTo(x + 7 * dx - r / 2, y + 6 * dy + r); + ctx.lineTo(x + dx + r, y + 14 * dy - r); + ctx.arc(x + dx, y + 14 * dy, r, -Math.PI / 4, Math.PI * 2); + + ctx.moveTo(x + 7 * dx + r / 2, y + 6 * dy); + ctx.lineTo(x + 14 * dx - r, y + 10 * dy - r / 2); + ctx.moveTo(x + 16 * dx, y + 10 * dy); + ctx.arc(x + 14 * dx, y + 10 * dy, r, 0, Math.PI * 3); + ctx.lineWidth = 1.5; +} + +function _iconChordChart(ctx, style) { + var x = style.x; + var y = style.y; + var width = style.width; + var height = style.height; + var r = Math.min(width, height) / 2; + + ctx.moveTo(x + width, y + height / 2); + ctx.arc(x + r, y + r, r, 0, Math.PI * 2); - ctx.moveTo(style.x, style.y); - ctx.lineTo(style.x, style.y + style.height); - ctx.lineTo(style.x + style.width, style.y + style.height); - - ctx.moveTo(style.x + 3 * dx, style.y + 14 * dy); - ctx.lineTo(style.x + 3 * dx, style.y + 6 * dy); - ctx.lineTo(style.x + 4 * dx, style.y + 6 * dy); - ctx.lineTo(style.x + 4 * dx, style.y + 14 * dy); - ctx.moveTo(style.x + 7 * dx, style.y + 14 * dy); - ctx.lineTo(style.x + 7 * dx, style.y + 2 * dy); - ctx.lineTo(style.x + 8 * dx, style.y + 2 * dy); - ctx.lineTo(style.x + 8 * dx, style.y + 14 * dy); - ctx.moveTo(style.x + 11 * dx, style.y + 14 * dy); - ctx.lineTo(style.x + 11 * dx, style.y + 9 * dy); - ctx.lineTo(style.x + 12 * dx, style.y + 9 * dy); - ctx.lineTo(style.x + 12 * dx, style.y + 14 * dy); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); + ctx.arc(x + r, y, r, Math.PI / 4, Math.PI / 5 * 4); + ctx.arc(x, y + r, r, -Math.PI / 3, Math.PI / 3); + ctx.arc(x + width, y + height, r, Math.PI, Math.PI / 2 * 3); + ctx.lineWidth = 1.5; } function _iconStackChart(ctx, style) { @@ -218,13 +298,11 @@ function _iconStackChart(ctx, style) { var width = style.width; var height = style.height; var dy = Math.round(height / 3); + var delta = Math.round((dy - 2) / 2); var len = 3; while (len--) { - ctx.rect(x, y + dy * len + 2, width, 2); + ctx.rect(x, y + dy * len + delta, width, 2); } - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); } function _iconTiledChart(ctx, style) { @@ -233,63 +311,59 @@ function _iconTiledChart(ctx, style) { var width = style.width; var height = style.height; var dx = Math.round(width / 3); + var delta = Math.round((dx - 2) / 2); var len = 3; while (len--) { - ctx.rect(x + dx * len, y, 2, height); + ctx.rect(x + dx * len + delta, y, 2, height); } - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); } function _iconDataView(ctx, style) { + var x = style.x; + var y = style.y; var dx = style.width / 16; - ctx.moveTo(style.x + dx, style.y); - ctx.lineTo(style.x + dx, style.y + style.height); - ctx.lineTo(style.x + 15 * dx, style.y + style.height); - ctx.lineTo(style.x + 15 * dx, style.y); - ctx.lineTo(style.x + dx, style.y); - - ctx.moveTo(style.x + 3 * dx, style.y + 3 * dx); - ctx.lineTo(style.x + 13 * dx, style.y + 3 * dx); + ctx.moveTo(x + dx, y); + ctx.lineTo(x + dx, y + style.height); + ctx.lineTo(x + 15 * dx, y + style.height); + ctx.lineTo(x + 15 * dx, y); + ctx.lineTo(x + dx, y); - ctx.moveTo(style.x + 3 * dx, style.y + 6 * dx); - ctx.lineTo(style.x + 13 * dx, style.y + 6 * dx); + ctx.moveTo(x + 3 * dx, y + 3 * dx); + ctx.lineTo(x + 13 * dx, y + 3 * dx); - ctx.moveTo(style.x + 3 * dx, style.y + 9 * dx); - ctx.lineTo(style.x + 13 * dx, style.y + 9 * dx); + ctx.moveTo(x + 3 * dx, y + 6 * dx); + ctx.lineTo(x + 13 * dx, y + 6 * dx); - ctx.moveTo(style.x + 3 * dx, style.y + 12 * dx); - ctx.lineTo(style.x + 9 * dx, style.y + 12 * dx); + ctx.moveTo(x + 3 * dx, y + 9 * dx); + ctx.lineTo(x + 13 * dx, y + 9 * dx); - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); + ctx.moveTo(x + 3 * dx, y + 12 * dx); + ctx.lineTo(x + 9 * dx, y + 12 * dx); } function _iconSave(ctx, style) { + var x = style.x; + var y = style.y; var dx = style.width / 16; var dy = style.height / 16; - ctx.moveTo(style.x, style.y); - ctx.lineTo(style.x, style.y + style.height); - ctx.lineTo(style.x + style.width, style.y + style.height); - ctx.lineTo(style.x + style.width, style.y); - ctx.lineTo(style.x, style.y); - - ctx.moveTo(style.x + 4 * dx, style.y); - ctx.lineTo(style.x + 4 * dx, style.y + 8 * dy); - ctx.lineTo(style.x + 12 * dx, style.y + 8 * dy); - ctx.lineTo(style.x + 12 * dx, style.y); - - ctx.moveTo(style.x + 6 * dx, style.y + 11 * dy); - ctx.lineTo(style.x + 6 * dx, style.y + 13 * dy); - ctx.lineTo(style.x + 10 * dx, style.y + 13 * dy); - ctx.lineTo(style.x + 10 * dx, style.y + 11 * dy); - ctx.lineTo(style.x + 6 * dx, style.y + 11 * dy); - - // 避免自动闭合路径 - ctx.moveTo(style.x, style.y); + ctx.moveTo(x, y); + ctx.lineTo(x, y + style.height); + ctx.lineTo(x + style.width, y + style.height); + ctx.lineTo(x + style.width, y); + ctx.lineTo(x, y); + + ctx.moveTo(x + 4 * dx, y); + ctx.lineTo(x + 4 * dx, y + 8 * dy); + ctx.lineTo(x + 12 * dx, y + 8 * dy); + ctx.lineTo(x + 12 * dx, y); + + ctx.moveTo(x + 6 * dx, y + 11 * dy); + ctx.lineTo(x + 6 * dx, y + 13 * dy); + ctx.lineTo(x + 10 * dx, y + 13 * dy); + ctx.lineTo(x + 10 * dx, y + 11 * dy); + ctx.lineTo(x + 6 * dx, y + 11 * dy); } function _iconCross(ctx, style) { @@ -312,10 +386,12 @@ function _iconCircle(ctx, style) { style.x + width + r, style.y + height); ctx.arc( style.x + width, style.y + height, r, 0, Math.PI * 2); + ctx.closePath(); } function _iconRectangle(ctx, style) { ctx.rect(style.x, style.y, style.width, style.height); + ctx.closePath(); } function _iconTriangle(ctx, style) { @@ -328,6 +404,7 @@ function _iconTriangle(ctx, style) { ctx.lineTo(x + symbolSize, y + symbolSize); ctx.lineTo(x - symbolSize, y + symbolSize); ctx.lineTo(x, y - symbolSize); + ctx.closePath(); } function _iconDiamond(ctx, style) { @@ -341,6 +418,7 @@ function _iconDiamond(ctx, style) { ctx.lineTo(x, y + symbolSize); ctx.lineTo(x - symbolSize, y); ctx.lineTo(x, y - symbolSize); + ctx.closePath(); } function _iconArrow(ctx, style) { @@ -352,6 +430,7 @@ function _iconArrow(ctx, style) { ctx.lineTo(x + 8 * dx, y + style.height / 4 * 3); ctx.lineTo(x + 15 * dx, y + style.height); ctx.lineTo(x + 8 * dx, y); + ctx.closePath(); } function _iconStar(ctx, style) { @@ -395,16 +474,18 @@ function _iconPin(ctx, style) { ctx.arc( x + width, y + height, r, Math.PI / 5 * 4, Math.PI / 5); ctx.lineTo(x + width, y + height + r * 1.5); + ctx.closePath(); } -function _iconImage(ctx, style) { - setTimeout(function () { - var ImageShape = require('../../zrender/shape/Image.js'); - var itemShape = new ImageShape({ - style: style - }); - itemShape.brush(ctx); - }, 100); +function _iconImage(ctx, style, refreshNextFrame) { + var ImageShape = require('../../zrender/shape/Image.js'); + this._imageShape = this._imageShape || new ImageShape({ + style: {} + }); + for (var name in style) { + this._imageShape.style[name] = style[name]; + } + this._imageShape.brush(ctx, false, refreshNextFrame); } var Base = require('../../zrender/shape/Base.js'); @@ -424,6 +505,10 @@ Icon.prototype = { restore: _iconRestore, lineChart: _iconLineChart, barChart: _iconBarChart, + pieChart: _iconPieChart, + funnelChart: _iconFunnelChart, + forceChart: _iconForceChart, + chordChart: _iconChordChart, stackChart: _iconStackChart, tiledChart: _iconTiledChart, dataView: _iconDataView, @@ -441,14 +526,44 @@ Icon.prototype = { pin: _iconPin, image: _iconImage }, + brush: function (ctx, isHighlight, refreshNextFrame) { + var style = isHighlight ? this.highlightStyle : this.style; + style = style || {}; + var iconType = style.iconType || this.style.iconType; + if (iconType === 'image') { + var ImageShape = require('../../zrender/shape/Image.js'); + ImageShape.prototype.brush.call(this, ctx, isHighlight, refreshNextFrame); + + } else { + + var style = this.beforeBrush(ctx, isHighlight); + + ctx.beginPath(); + this.buildPath(ctx, style, refreshNextFrame); + + switch (style.brushType) { /* jshint ignore:start */ + case 'both': + ctx.fill(); + case 'stroke': + style.lineWidth > 0 && ctx.stroke(); + break; /* jshint ignore:end */ + default: + ctx.fill(); + } + + this.drawText(ctx, style, this.style); + + this.afterBrush(ctx); + } + }, /** * 创建矩形路径 * @param {Context2D} ctx Canvas 2D上下文 * @param {Object} style 样式 */ - buildPath: function (ctx, style) { + buildPath: function (ctx, style, refreshNextFrame) { if (this.iconLibrary[style.iconType]) { - this.iconLibrary[style.iconType](ctx, style); + this.iconLibrary[style.iconType].call(this, ctx, style, refreshNextFrame); } else { ctx.moveTo(style.x, style.y); @@ -456,6 +571,7 @@ Icon.prototype = { ctx.lineTo(style.x + style.width, style.y + style.height); ctx.lineTo(style.x, style.y + style.height); ctx.lineTo(style.x, style.y); + ctx.closePath(); } return; @@ -475,7 +591,8 @@ Icon.prototype = { x: Math.round(style.x), y: Math.round(style.y - (style.iconType == 'pin' ? (style.height / 2 * 1.5) : 0)), width: style.width, - height: style.height + height: style.height * ( + style.iconType === 'pin' ? 1.25 : 1) }; return style.__rect; diff --git a/src/util/shape/MarkLine.js b/src/util/shape/MarkLine.js index 4c64cd7..3232804 100644 --- a/src/util/shape/MarkLine.js +++ b/src/util/shape/MarkLine.js @@ -1,7 +1,7 @@ /** * zrender * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * * shape类:标线 */ @@ -10,8 +10,8 @@ var Base = require('../../zrender/shape/Base.js'); var IconShape = require('./Icon.js'); var LineShape = require('../../zrender/shape/Line.js'); var lineInstance = new LineShape({}); -var BrokenLineShape = require('../../zrender/shape/BrokenLine.js'); -var brokenLineInstance = new BrokenLineShape({}); +var PolylineShape = require('../../zrender/shape/Polyline.js'); +var polylineInstance = new PolylineShape({}); var matrix = require('../../zrender/tool/matrix.js'); var area = require('../../zrender/tool/area.js'); @@ -49,9 +49,11 @@ MarkLine.prototype = { // 设置transform this.setTransform(ctx); + ctx.save(); ctx.beginPath(); - this.buildLinePath(ctx, style); + this.buildLinePath(ctx, style, this.style.lineWidth || 1); ctx.stroke(); + ctx.restore(); this.brushSymbol(ctx, style, 0); this.brushSymbol(ctx, style, 1); @@ -66,7 +68,7 @@ MarkLine.prototype = { * @param {Context2D} ctx Canvas 2D上下文 * @param {Object} style 样式 */ - buildLinePath: function (ctx, style) { + buildLinePath: function (ctx, style, lineWidth) { var pointList = style.pointList || this.getPointList(style); style.pointList = pointList; @@ -83,7 +85,7 @@ MarkLine.prototype = { else if (style.lineType == 'dashed' || style.lineType == 'dotted') { if (style.smooth !== 'spline') { // 直线 - var dashLength = (style.lineWidth || 1) * (style.lineType == 'dashed' ? 5 : 1); + var dashLength = lineWidth * (style.lineType == 'dashed' ? 5 : 1); ctx.moveTo(pointList[0][0], pointList[0][1]); for (var i = 1; i < len; i++) { dashedLineTo( @@ -168,7 +170,7 @@ MarkLine.prototype = { var yEnd = style.pointList[len - 1][1]; var delta = 0; if (style.smooth === 'spline') { - delta = 0.2; // 偏移0.2弧度 + delta = style.smoothRadian * (xStart <= xEnd ? 1 : -1); // 偏移0.2弧度 } // 原谅我吧,这三角函数实在没想明白,只能这么笨了 var rotate = Math.atan( @@ -236,9 +238,18 @@ MarkLine.prototype = { if (style.smooth === 'spline') { var lastPointX = pointList[1][0]; var lastPointY = pointList[1][1]; - pointList[3] = [lastPointX, lastPointY]; - pointList[1] = this.getOffetPoint(pointList[0], pointList[3]); - pointList[2] = this.getOffetPoint(pointList[3], pointList[0]); + if (style.smoothRadian <= 0.8) { + pointList[3] = [lastPointX, lastPointY]; + var isReverse = pointList[0][0] <= pointList[3][0]; + pointList[1] = this.getOffetPoint(pointList[0], pointList[3], isReverse, style.smoothRadian); + pointList[2] = this.getOffetPoint(pointList[3], pointList[0], isReverse, style.smoothRadian); + } + else { + pointList[2] = [lastPointX, lastPointY]; + pointList[1] = this.getOffetPoint( + pointList[0], pointList[2], pointList[0][0] <= pointList[2][0], style.smoothRadian); + } + pointList = smoothSpline(pointList, false); // 修正最后一点在插值产生的偏移 pointList[pointList.length - 1] = [lastPointX, lastPointY]; @@ -250,12 +261,12 @@ MarkLine.prototype = { * {Array} start point * {Array} end point */ - getOffetPoint: function (sp, ep) { - var distance = Math.sqrt(Math.round((sp[0] - ep[0]) * (sp[0] - ep[0]) + (sp[1] - ep[1]) * (sp[1] - ep[1]))) / 3; + getOffetPoint: function (sp, ep, isReverse, deltaAngle) { + var split = (2 - Math.abs(deltaAngle)) / 0.6; + var distance = Math.sqrt(Math.round((sp[0] - ep[0]) * (sp[0] - ep[0]) + (sp[1] - ep[1]) * (sp[1] - ep[1]))) / split; //console.log(delta); var mp = [sp[0], sp[1]]; var angle; - var deltaAngle = 0.2; // 偏移0.2弧度 if (sp[0] != ep[0] && sp[1] != ep[1]) { // 斜率存在 var k = (ep[1] - sp[1]) / (ep[0] - sp[0]); @@ -272,14 +283,14 @@ MarkLine.prototype = { var dX; var dY; if (sp[0] <= ep[0]) { - angle -= deltaAngle; + angle -= deltaAngle * (isReverse ? 1 : -1); dX = Math.round(Math.cos(angle) * distance); dY = Math.round(Math.sin(angle) * distance); mp[0] += dX; mp[1] += dY; } else { - angle += deltaAngle; + angle += deltaAngle * (isReverse ? 1 : -1); dX = Math.round(Math.cos(angle) * distance); dY = Math.round(Math.sin(angle) * distance); mp[0] -= dX; @@ -320,7 +331,7 @@ MarkLine.prototype = { } if (x >= rect.x && x <= (rect.x + rect.width) && y >= rect.y && y <= (rect.y + rect.height)) { // 矩形内 - return this.style.smooth !== 'spline' ? area.isInside(lineInstance, this.style, x, y) : area.isInside(brokenLineInstance, this.style, x, y); + return this.style.smooth !== 'spline' ? area.isInside(lineInstance, this.style, x, y) : area.isInside(polylineInstance, this.style, x, y); } return false; diff --git a/src/util/shape/Ribbon.js b/src/util/shape/Ribbon.js new file mode 100644 index 0000000..9c7a720 --- /dev/null +++ b/src/util/shape/Ribbon.js @@ -0,0 +1,107 @@ +/** + * @module echarts/util/shape/Ribbon + * @author pissang (https://github.com/pissang) + */ +/** + * @typedef {Object} IRibbonStyle + * @property {number} x + * @property {number} y + * @property {number} source0 + * @property {number} source1 + * @property {number} target0 + * @property {number} target1 + * @property {number} r + * @property {boolean} clockWise + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ + +var Base = require('../../zrender/shape/Base.js'); +var PathProxy = require('../../zrender/shape/util/PathProxy.js'); +var zrUtil = require('../../zrender/tool/util.js'); +var area = require('../../zrender/tool/area.js'); + +// var _ctx = zrUtil.getContext(); + +function RibbonShape(options) { + Base.call(this, options); + + this._pathProxy = new PathProxy(); +} + +RibbonShape.prototype = { + + type: 'ribbon', + + buildPath: function (ctx, style) { + + var clockWise = style.clockWise || false; + + var path = this._pathProxy; + path.begin(ctx); + + var cx = style.x; + var cy = style.y; + var r = style.r; + var s0 = style.source0 / 180 * Math.PI; + var s1 = style.source1 / 180 * Math.PI; + var t0 = style.target0 / 180 * Math.PI; + var t1 = style.target1 / 180 * Math.PI; + var sx0 = cx + Math.cos(s0) * r; + var sy0 = cy + Math.sin(s0) * r; + var sx1 = cx + Math.cos(s1) * r; + var sy1 = cy + Math.sin(s1) * r; + var tx0 = cx + Math.cos(t0) * r; + var ty0 = cy + Math.sin(t0) * r; + var tx1 = cx + Math.cos(t1) * r; + var ty1 = cy + Math.sin(t1) * r; + + path.moveTo(sx0, sy0); + path.arc(cx, cy, style.r, s0, s1, !clockWise); + path.bezierCurveTo((cx - sx1) * 0.70 + sx1, (cy - sy1) * 0.70 + sy1, (cx - tx0) * 0.70 + tx0, (cy - ty0) * 0.70 + ty0, tx0, ty0); + // Chord to self + if (style.source0 === style.target0 && style.source1 === style.target1) { + return; + } + path.arc(cx, cy, style.r, t0, t1, !clockWise); + path.bezierCurveTo((cx - tx1) * 0.70 + tx1, (cy - ty1) * 0.70 + ty1, (cx - sx0) * 0.70 + sx0, (cy - sy0) * 0.70 + sy0, sx0, sy0); + }, + + getRect: function (style) { + if (style.__rect) { + return style.__rect; + } + if (!this._pathProxy.isEmpty()) { + this.buildPath(null, style); + } + return this._pathProxy.fastBoundingRect(); + }, + + isCover: function (x, y) { + var rect = this.getRect(this.style); + if (x >= rect.x && x <= (rect.x + rect.width) && y >= rect.y && y <= (rect.y + rect.height)) { + return area.isInsidePath( + this._pathProxy.pathCommands, 0, 'fill', x, y); + } + } +}; + +zrUtil.inherits(RibbonShape, Base); + +module.exports = RibbonShape; \ No newline at end of file diff --git a/src/util/shape/Symbol.js b/src/util/shape/Symbol.js index 241e85e..58b9ce5 100644 --- a/src/util/shape/Symbol.js +++ b/src/util/shape/Symbol.js @@ -1,7 +1,7 @@ /** * zrender * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * * shape类:大规模散点图图形 * 可配图形属性: diff --git a/src/util/smartSteps.js b/src/util/smartSteps.js new file mode 100644 index 0000000..4739de0 --- /dev/null +++ b/src/util/smartSteps.js @@ -0,0 +1,585 @@ +/** + * echarts 值轴分段刻度计算方法 + * + * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。 + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + * @author xieshiwei (谢世威, i6ma@i6ma.com) + * + */ + + +/** + * 最值、跨度、步长取近似值 + * 注意:不适用于高精度需求,或者很多位有效数字的情况!!! + * @function smartSteps + * @param {Number} min 最小值 + * @param {Number} max 最大值 + * @param {Number} [section] 段数只能是 [0, 99] 的整数,段数为 0 或者不指定段数时,将自动调整段数 + * @param {Object} [opts] 其它扩展参数 + * @param {Array} opts.steps 自定义步长备选值,如 [10, 12, 15, 20, 25, 30, 40, 50, 60, 80] ,但必须 => [10, 99] + * @return {Object} {min: 新最小值, max: 新最大值, secs: 分段数, step: 每段长, fix: 小数保留位数, pnts: [分段结果]} + */ + + + + +var mySteps = [10, 20, 25, 50]; +var mySections = [4, 5, 6]; + +var custOpts; +var custSteps; +var custSecs; +var minLocked; +var maxLocked; + +var MT = Math; +var MATH_ROUND = MT.round; +var MATH_FLOOR = MT.floor; +var MATH_CEIL = MT.ceil; +var MATH_ABS = MT.abs; + + +function MATH_LOG(n) { + return MT.log(MATH_ABS(n)) / MT.LN10; +} + +function MATH_POW(n) { + return MT.pow(10, n); +} + +function MATH_ISINT(n) { + return n === MATH_FLOOR(n); +} + + +function smartSteps(min, max, section, opts) { + // 拿公共变量来接收 opts.steps 这个参数,就不用带着参数层层传递了,注意在函数的最终出口处释放这个值 + custOpts = opts || {}; + custSteps = custOpts.steps || mySteps; + custSecs = custOpts.secs || mySections; + section = MATH_ROUND(+section || 0) % 99; // 段数限定在 [0, 99] ,0 则自适应 + min = +min || 0; + max = +max || 0; + minLocked = maxLocked = 0; + if ('min' in custOpts) { + min = +custOpts.min || 0; + minLocked = 1; + } + if ('max' in custOpts) { + max = +custOpts.max || 0; + maxLocked = 1; + } + if (min > max) { + max = [min, min = max][0]; + } // 最值交换 + var span = max - min; + if (minLocked && maxLocked) { + return bothLocked(min, max, section); // 两个最值同时被锁定,注意差值为 0 的情况 + } + if (span < (section || 5)) { // 跨度值小于要分的段数,步长将会小于 1 + if (MATH_ISINT(min) && MATH_ISINT(max)) { // 步长小于 1 同时两个最值都是整数,特别处理 + return forInteger(min, max, section); // 也要考虑差值为 0 的情况 + } + else if (span === 0) { // 非整数且跨度为 0 的情况 + return forSpan0(min, max, section); + } + } + return coreCalc(min, max, section); // 非特殊情况的计算,须确保 min < max +} + + + +/** + * 构造返回值,处理小数精度等问题 + * @param {Number} newMin 最小值 + * @param {Number} newMax 最大值 + * @param {Number} section 分段数 + * @param {Number} [expon] 计算量级 + * @return {Object} 同 smartSteps + */ + +function makeResult(newMin, newMax, section, expon) { + expon = expon || 0; // 这是中间计算量级,受步长增长、特别是最值锁定的影响,可能会小于基准量级,因为整数部分被过度放大 + var expStep = expNum((newMax - newMin) / section, -1); + var expMin = expNum(newMin, -1, 1); // 锁定的最值有效数位可能很多,需要全精度保留 + var expMax = expNum(newMax, -1); + var minExp = MT.min(expStep.e, expMin.e, expMax.e); // 这个值实际上就是各值整数部分尾部多余的 0 的个数 + if (expMin.c === 0) { // 0 可以有任意多个尾0 + minExp = MT.min(expStep.e, expMax.e); + } else if (expMax.c === 0) { + minExp = MT.min(expStep.e, expMin.e); + } + expFixTo(expStep, { + c: 0, + e: minExp + }); + expFixTo(expMin, expStep, 1); + expFixTo(expMax, expStep); + expon += minExp; // 最终的基准量级,在这个量级下,各值刚好能表示成整数 + newMin = expMin.c; + newMax = expMax.c; + var step = (newMax - newMin) / section; + var zoom = MATH_POW(expon); + var fixTo = 0; + var points = []; + for (var i = section + 1; i--;) { // 因为点数比段数多 1 + points[i] = (newMin + step * i) * zoom; // 如果不涉及小数问题,这里就直接使用数值型 + } + if (expon < 0) { + fixTo = decimals(zoom); // 前面已经去掉了各值尾部多余的 0 ,所以 zoom 的小数位就是最终的 fix 位数 + step = +(step * zoom).toFixed(fixTo); // toFixed 处理长尾小数问题,如:0.2 * 0.1 = 0.020000000000000004 + newMin = +(newMin * zoom).toFixed(fixTo); + newMax = +(newMax * zoom).toFixed(fixTo); + for (var i = points.length; i--;) { + points[i] = points[i].toFixed(fixTo); // 为保证小数点对齐,统一转为字符型 + + points[i] === 0 && (points[i] = '0'); // 0.000 不好看 + } + } + else { + newMin *= zoom; + newMax *= zoom; + step *= zoom; + } + custSecs = 0; + custSteps = 0; + custOpts = 0; + // 这些公共变量可能持用了对用户参数的引用,这里是函数的最终出口,释放引用 + return { + min: newMin, + // 新最小值 + max: newMax, + // 新最大值 + secs: section, + // 分段数 + step: step, + // 每段长 + fix: fixTo, + // 小数保留位数,0 则为整数 + exp: expon, + // 基准量级,并非原值所在的量级,而是说在这个量级下,各值能表示成整数 + pnts: points // 分段结果,整数都是数值型,小数时为了对齐小数点,都是字符型,但其中 0 不带小数点,即没有 "0.000" + }; +} + + + +/** + * 量级计数法 表示数值,不适用于很大或者很小的数,0 更不行 + * @param {Number} num 原数 + * @param {Number} [digit = 2] 精度位数,必须 => [1, 9] + * @param {Boolean} [byFloor = 0] 默认为 0 表示近似值不小于原值,置 1 表示近似值不大于原值 + * @return {Object} {c: c, e: e} c e 都是整数,c * 10 ^ e 即为原值的近似数 + * @description 返回值应该更详细一点:{c: c, e: e, d: d, n: n} ,其中 d 是 c 的位数,n = c * 10 ^ e ,不过目前好像不太有用 + */ + +function expNum(num, digit, byFloor) { + digit = MATH_ROUND(digit % 10) || 2; + if (digit < 0) { // 全精度位数 + if (MATH_ISINT(num)) { // 整数的全精度位数,要去掉尾 0 ,但 0 也是整数,要专门留一位精度 + digit = ('' + MATH_ABS(num)).replace(/0+$/, '').length || 1; + } + else { // 小数的全精度位数,要去掉首 0 + num = num.toFixed(15).replace(/0+$/, ''); // toFixed 处理长尾小数 + digit = num.replace('.', '').replace(/^[-0]+/, '').length; + num = +num; // '' + 0.0000001 会得到 '1e-7' + } + } + var expon = MATH_FLOOR(MATH_LOG(num)) - digit + 1; + var cNum = +(num * MATH_POW(-expon)).toFixed(15) || 0; // toFixed 处理长尾小数问题 + cNum = byFloor ? MATH_FLOOR(cNum) : MATH_CEIL(cNum); // 向上取整可能发生进位,使精度位数增加 1 + !cNum && (expon = 0); + if (('' + MATH_ABS(cNum)).length > digit) { // 整数位数判断,字符串法比对数法快近一倍 + expon += 1; + cNum /= 10; + } + return { + c: cNum, + e: expon + }; +} + + +/** + * 将前者的指数对齐到后者,如果前者量级较小,就是强制加大指数,值误差可能严重放大,甚至值变为 0 + */ + +function expFixTo(expnum1, expnum2, byFloor) { + var deltaExp = expnum2.e - expnum1.e; + if (deltaExp) { + expnum1.e += deltaExp; // 指数减小时,只需将整数部分相应放大 + expnum1.c *= MATH_POW(-deltaExp); // 指数增加时,整数部分将缩小,就涉及 floor ceil 取整和变 0 问题 + expnum1.c = byFloor ? MATH_FLOOR(expnum1.c) : MATH_CEIL(expnum1.c); + } +} + + +/** + * 将两个量级数的指数对齐到较小者 + */ + +function expFixMin(expnum1, expnum2, byFloor) { + if (expnum1.e < expnum2.e) { + expFixTo(expnum2, expnum1, byFloor); + } + else { + expFixTo(expnum1, expnum2, byFloor); + } +} + + +/** + * 基于量级计数法,对原值的整数部分取近似,不适用于负数和 0 + * @param {Number} num 原值 + * @param {Array} [rounds] 在取近似时,提供预置选项,近似到 rounds 中的某项 + * @return {Object} expNum 2 位精度的量级计数法对象,不小于原值 + */ + +function getCeil(num, rounds) { + rounds = rounds || mySteps; + num = expNum(num); // 2 位精度量级计数法 + var cNum = num.c; + var i = 0; + while (cNum > rounds[i]) { // 在预置的近似数中,找到不小于目标 cNum 的项 + i++; + } + if (!rounds[i]) { // 如果没找到合适的预置项,一定是目标值大于全部的预置项 + cNum /= 10; // 将目标值缩小 10 倍,重找一次定能命中 + num.e += 1; + i = 0; + while (cNum > rounds[i]) { + i++; + } + } + num.c = rounds[i]; + return num; +} + + + + +/** + * 基于量级计数法的计算,必须 min < max + */ + +function coreCalc(min, max, section) { + var step; + var secs = section || +custSecs.slice(-1); + var expStep = getCeil((max - min) / secs, custSteps); // 这是可能的最小步长,以它的量级作为后续计算的基准量级,以保证整数计算特性 + var expSpan = expNum(max - min); // 2 位精度的最值跨度,过高的精度意味着有效数位更多 + var expMin = expNum(min, -1, 1); // 最小值向下近似,以涵盖原最小值 + var expMax = expNum(max, -1); // 最大值向上近似,参数 -1 表示保留全精度,因为要注意 min = 10000001, max = 10000002 等情况 + expFixTo(expSpan, expStep); // 指数对齐 + expFixTo(expMin, expStep, 1); // 经过指数对齐,原最大值、最小值都有可能变为 0 + expFixTo(expMax, expStep); + if (!section) { + secs = look4sections(expMin, expMax); + } + else { + step = look4step(expMin, expMax, secs); + } + + // 如果原最值都是整数,尽量让输出值也保持整数,但原最值跨 0 的则不调整 + if (MATH_ISINT(min) && MATH_ISINT(max) && min * max >= 0) { + if (max - min < secs) { // 再次出现跨度小于段数 + return forInteger(min, max, secs); + } + secs = tryForInt(min, max, section, expMin, expMax, secs); + } + var arrMM = cross0(min, max, expMin.c, expMax.c); + expMin.c = arrMM[0]; + expMax.c = arrMM[1]; + if (minLocked || maxLocked) { + singleLocked(min, max, expMin, expMax); + } + return makeResult(expMin.c, expMax.c, secs, expMax.e); +} + + + +/** + * 在预置的可选段数中,找出一个合适的值,让跨度误差尽量小 + */ + +function look4sections(expMin, expMax) { + var section; + var tmpStep, tmpMin, tmpMax; + var reference = []; + for (var i = custSecs.length; i--;) { // 逐步减小段数,步长就会渐大 + section = custSecs[i]; + tmpStep = getCeil((expMax.c - expMin.c) / section, custSteps); + tmpStep = tmpStep.c * MATH_POW(tmpStep.e); // 步长都用常规整数参与计算 + tmpMin = MATH_FLOOR(expMin.c / tmpStep) * tmpStep; + tmpMax = MATH_CEIL(expMax.c / tmpStep) * tmpStep; + reference[i] = { + min: tmpMin, + max: tmpMax, + step: tmpStep, + span: tmpMax - tmpMin // 步长的误差被 段数 成倍放大,可能会给跨度造成更大的误差,使最后的段数大于预置的最大值 + }; + } + reference.sort(function (a, b) { + var delta = a.span - b.span; // 分段调整之后的跨度,一定不小于原跨度,所以越小越好 + if (delta === 0) { + delta = a.step - b.step; // 跨度相同时,步长小者胜出 + } + return delta; + }); + reference = reference[0]; + section = reference.span / reference.step; + expMin.c = reference.min; + expMax.c = reference.max; + return section < 3 ? section * 2 : section; // 如果最终步长比最小步长大得多,段数就可能变得很小 +} + + +/** + * 指定段数,在预置的可选步长中,找出一个合适的值,让 步长 * 段数 积刚好涵盖原最大值与最小值 + */ + +function look4step(expMin, expMax, secs) { + var span; + var tmpMax; + var tmpMin = expMax.c; + var tmpStep = (expMax.c - expMin.c) / secs - 1; + while (tmpMin > expMin.c) { + tmpStep = getCeil(tmpStep + 1, custSteps); + tmpStep = tmpStep.c * MATH_POW(tmpStep.e); + span = tmpStep * secs; + tmpMax = MATH_CEIL(expMax.c / tmpStep) * tmpStep; + tmpMin = tmpMax - span; // 优先保证 max 端的误差最小,试看原 min 值能否被覆盖到 + } + var deltaMin = expMin.c - tmpMin; // 上面的计算可能会让 min 端的误差更大,下面尝试均衡误差 + var deltaMax = tmpMax - expMax.c; + var deltaDelta = deltaMin - deltaMax; + if (deltaDelta > tmpStep * 1.1) { // 当 min 端的误差比 max 端大很多时,考虑将 tmpMin tmpMax 同时上移 + deltaDelta = MATH_ROUND(deltaDelta / tmpStep / 2) * tmpStep; + tmpMin += deltaDelta; + tmpMax += deltaDelta; + } + expMin.c = tmpMin; + expMax.c = tmpMax; + return tmpStep; +} + + +/** + * 原最值都是整数时,尝试让输出也保持整数 + */ + +function tryForInt(min, max, section, expMin, expMax, secs) { + var span = expMax.c - expMin.c; + var step = span / secs * MATH_POW(expMax.e); + if (!MATH_ISINT(step)) { // 原最值都是整数,但计算步长可能出现小数,如 2.5 + step = MATH_FLOOR(step); // 步长总是要尽量小,以减小跨度误差,所以 2.5 可能被调整为 2 或者 3 + span = step * secs; + if (span < max - min) { + step += 1; + span = step * secs; + if (!section && (step * (secs - 1) >= (max - min))) { + secs -= 1; + span = step * secs; + } + } + if (span >= max - min) { + var delta = span - (max - min); // 误差均衡 + expMin.c = MATH_ROUND(min - delta / 2); + expMax.c = MATH_ROUND(max + delta / 2); + expMin.e = 0; + expMax.e = 0; + } + } + return secs; +} + + + + +/** + * 整数情况下,跨度小于段数的处理 + */ + +function forInteger(min, max, section) { + section = section || 5; + if (minLocked) { + max = min + section; // min max 没有写错,因为 min locked 所以 max 在 min 上浮动 + } + else if (maxLocked) { + min = max - section; + } + else { + var delta = section - (max - min); // 没有端点锁定时,向上下延展跨度 + var newMin = MATH_ROUND(min - delta / 2); + var newMax = MATH_ROUND(max + delta / 2); + var arrMM = cross0(min, max, newMin, newMax); // 避免跨 0 + min = arrMM[0]; + max = arrMM[1]; + } + return makeResult(min, max, section); +} + + +/** + * 非整数情况下,跨度为 0 的处理 + */ + +function forSpan0(min, max, section) { + section = section || 5; + // delta 一定不为 0 ,因为 min === max === 0 的情况会进入 forInteger 分支 + var delta = MT.min(MATH_ABS(max / section), section) / 2.1; + if (minLocked) { + max = min + delta; // min max 没有写错,因为 min locked 所以 max 在 min 上浮动 + } + else if (maxLocked) { + min = max - delta; + } + else { // 以最值为中心,上下各延展一小段 + min = min - delta; + max = max + delta; + } + return coreCalc(min, max, section); +} + + +/** + * 当原始最值都在 0 的同侧时,让输出也保持在 0 的同侧 + */ + +function cross0(min, max, newMin, newMax) { + if (min >= 0 && newMin < 0) { + newMax -= newMin; + newMin = 0; + } + else if (max <= 0 && newMax > 0) { + newMin -= newMax; + newMax = 0; + } + return [newMin, newMax]; +} + + +/** + * 取一个数的小数位数 + * @param {Number} num 原数值 + * @return {Number} decimals 整数则返回 0 ,小数则返回小数点后的位数 + */ + +function decimals(num) { + num = (+num).toFixed(15).split('.'); // String(0.0000001) 会得到 '1e-7' + return num.pop().replace(/0+$/, '').length; +} + + + + + + +/** + * 单个最值锁定处理,只是在原计算的基础上,锁定一个,平移另一个 + */ + +function singleLocked(min, max, emin, emax) { + if (minLocked) { + var expMin = expNum(min, 4, 1); // 4 位精度向下近似 + if (emin.e - expMin.e > 6) { // 如果锁定值的量级远小于基准量级,认为锁定失败,强置为 0 + expMin = { + c: 0, + e: emin.e + }; + } + expFixMin(emin, expMin); // 将指数与量级较小者对齐 + expFixMin(emax, expMin); + emax.c += expMin.c - emin.c; // 最大值平移 + emin.c = expMin.c; // 最小值锁定 + } + else if (maxLocked) { + var expMax = expNum(max, 4); // 4 位精度向上近似 + if (emax.e - expMax.e > 6) { // 如果锁定值的量级远小于基准量级,认为锁定失败,强置为 0 + expMax = { + c: 0, + e: emax.e + }; + } + expFixMin(emin, expMax); // 将指数与量级较小者对齐 + expFixMin(emax, expMax); + emin.c += expMax.c - emax.c; // 最小值平移 + emax.c = expMax.c; // 最大值锁定 + } +} + + +/** + * 最小值和最大值同时被锁定的情况在这里,其它地方只考虑单边最值锁定 + * @param {Number} min 锁定的最小值 + * @param {Number} max 锁定的最大值 + * @param {Number} [section] 段数 + * @return {Object} 同 smartSteps + */ + +function bothLocked(min, max, section) { + var trySecs = section ? [section] : custSecs; + var span = max - min; + if (span === 0) { // 最大最小值都锁定到同一个值上,认为锁定失败 + max = expNum(max, 3); // 3 位精度向上近似 + section = trySecs[0]; + max.c = MATH_ROUND(max.c + section / 2); + return makeResult(max.c - section, max.c, section, max.e); + } + if (MATH_ABS(max / span) < 1e-6) { // 如果锁定值远小于跨度,也认为锁定失败,强置为 0 + max = 0; + } + if (MATH_ABS(min / span) < 1e-6) { + min = 0; + } + var step, deltaSpan, score; + var scoreS = [ + [5, 10], + [10, 2], + [50, 10], + [100, 2] + ]; + var reference = []; + var debugLog = []; + var expSpan = expNum((max - min), 3); // 3 位精度向上近似 + var expMin = expNum(min, -1, 1); + var expMax = expNum(max, -1); + expFixTo(expMin, expSpan, 1); + expFixTo(expMax, expSpan); + span = expMax.c - expMin.c; + expSpan.c = span; + + for (var i = trySecs.length; i--;) { + section = trySecs[i]; + step = MATH_CEIL(span / section); + deltaSpan = step * section - span; + score = (deltaSpan + 3) * 3; // 误差越大得分越高 + score += (section - trySecs[0] + 2) * 2; // 分段越多得分越高 + if (section % 5 === 0) { // 段数为 5 可以减分 + score -= 10; + } + for (var j = scoreS.length; j--;) { // 好的步长是最重要的减分项 + if (step % scoreS[j][0] === 0) { + score /= scoreS[j][1]; + } + } + debugLog[i] = [section, step, deltaSpan, score].join(); + reference[i] = { + secs: section, + step: step, + delta: deltaSpan, + score: score + }; + } + //console.log(debugLog); + reference.sort(function (a, b) { + return a.score - b.score; + }); + reference = reference[0]; + expMin.c = MATH_ROUND(expMin.c - reference.delta / 2); + expMax.c = MATH_ROUND(expMax.c + reference.delta / 2); + return makeResult(expMin.c, expMax.c, reference.secs, expSpan.e); +} + + + + +module.exports = smartSteps; \ No newline at end of file diff --git a/src/zrender/Group.js b/src/zrender/Group.js new file mode 100644 index 0000000..81250a2 --- /dev/null +++ b/src/zrender/Group.js @@ -0,0 +1,228 @@ +/** + * Group是一个容器,可以插入子节点,Group的变换也会被应用到子节点上 + * @module zrender/Group + * @example + * var Group = require('zrender/Group.js'); + * var Circle = require('zrender/shape/Circle.js'); + * var g = new Group(); + * g.position[0] = 100; + * g.position[1] = 100; + * g.addChild(new Circle({ + * style: { + * x: 100, + * y: 100, + * r: 20, + * brushType: 'fill' + * } + * })); + * zr.addGroup(g); + */ + + +var guid = require('./tool/guid.js'); +var util = require('./tool/util.js'); + +var Transformable = require('./mixin/Transformable.js'); +var Eventful = require('./mixin/Eventful.js'); + +/** + * @alias module:zrender/Group + * @constructor + * @extends module:zrender/mixin/Transformable + * @extends module:zrender/mixin/Eventful + */ +var Group = function (options) { + + options = options || {}; + + /** + * Group id + * @type {string} + */ + this.id = options.id || guid(); + + for (var key in options) { + this[key] = options[key]; + } + + /** + * @type {string} + */ + this.type = 'group'; + + /** + * 用于裁剪的图形(shape),所有 Group 内的图形在绘制时都会被这个图形裁剪 + * 该图形会继承Group的变换 + * @type {module:zrender/shape/Base} + * @see http://www.w3.org/TR/2dcontext/#clipping-region + */ + this.clipShape = null; + + this._children = []; + + this._storage = null; + + this.__dirty = true; + + // Mixin + Transformable.call(this); + Eventful.call(this); +}; + +/** + * 是否忽略该 Group 及其所有子节点 + * @type {boolean} + * @default false + */ +Group.prototype.ignore = false; + +/** + * 复制并返回一份新的包含所有儿子节点的数组 + * @return {Array.} + */ +Group.prototype.children = function () { + return this._children.slice(); +}; + +/** + * 获取指定 index 的儿子节点 + * @param {number} idx + * @return {module:zrender/Group|module:zrender/shape/Base} + */ +Group.prototype.childAt = function (idx) { + return this._children[idx]; +}; + +/** + * 添加子节点,可以是Shape或者Group + * @param {module:zrender/Group|module:zrender/shape/Base} child + */ +// TODO Type Check +Group.prototype.addChild = function (child) { + if (child == this) { + return; + } + + if (child.parent == this) { + return; + } + if (child.parent) { + child.parent.removeChild(child); + } + + this._children.push(child); + child.parent = this; + + if (this._storage && this._storage !== child._storage) { + + this._storage.addToMap(child); + + if (child instanceof Group) { + child.addChildrenToStorage(this._storage); + } + } +}; + +/** + * 移除子节点 + * @param {module:zrender/Group|module:zrender/shape/Base} child + */ +// TODO Type Check +Group.prototype.removeChild = function (child) { + var idx = util.indexOf(this._children, child); + + this._children.splice(idx, 1); + child.parent = null; + + if (this._storage) { + + this._storage.delFromMap(child.id); + + if (child instanceof Group) { + child.delChildrenFromStorage(this._storage); + } + } +}; + +/** + * 移除所有子节点 + */ +Group.prototype.clearChildren = function () { + for (var i = 0; i < this._children.length; i++) { + var child = this._children[i]; + if (this._storage) { + this._storage.delFromMap(child.id); + if (child instanceof Group) { + child.delChildrenFromStorage(this._storage); + } + } + } + this._children.length = 0; +}; + +/** + * 遍历所有子节点 + * @param {Function} cb + * @param {} context + */ +Group.prototype.eachChild = function (cb, context) { + var haveContext = !! context; + for (var i = 0; i < this._children.length; i++) { + var child = this._children[i]; + if (haveContext) { + cb.call(context, child); + } else { + cb(child); + } + } +}; + +/** + * 深度优先遍历所有子孙节点 + * @param {Function} cb + * @param {} context + */ +Group.prototype.traverse = function (cb, context) { + var haveContext = !! context; + for (var i = 0; i < this._children.length; i++) { + var child = this._children[i]; + if (haveContext) { + cb.call(context, child); + } else { + cb(child); + } + + if (child.type === 'group') { + child.traverse(cb, context); + } + } +}; + +Group.prototype.addChildrenToStorage = function (storage) { + for (var i = 0; i < this._children.length; i++) { + var child = this._children[i]; + storage.addToMap(child); + if (child instanceof Group) { + child.addChildrenToStorage(storage); + } + } +}; + +Group.prototype.delChildrenFromStorage = function (storage) { + for (var i = 0; i < this._children.length; i++) { + var child = this._children[i]; + storage.delFromMap(child.id); + if (child instanceof Group) { + child.delChildrenFromStorage(storage); + } + } +}; + +Group.prototype.modSelf = function () { + this.__dirty = true; +}; + +util.merge(Group.prototype, Transformable.prototype, true); +util.merge(Group.prototype, Eventful.prototype, true); + +module.exports = Group; \ No newline at end of file diff --git a/src/zrender/Handler.js b/src/zrender/Handler.js index 3f19949..a0e3dd1 100644 --- a/src/zrender/Handler.js +++ b/src/zrender/Handler.js @@ -1,26 +1,30 @@ 'use strict'; /** * Handler控制模块 - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @module zrender/Handler + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * errorrik (errorrik@gmail.com) + * */ - - +// TODO mouseover 只触发一次 var config = require('./config.js'); var env = require('./tool/env.js'); var eventTool = require('./tool/event.js'); var util = require('./tool/util.js'); +var vec2 = require('./tool/vector.js'); +var mat2d = require('./tool/matrix.js'); var EVENT = config.EVENT; -var domHandlerNames = ['resize', 'click', 'mousewheel', 'mousemove', 'mouseout', 'mouseup', 'mousedown', 'touchstart', 'touchend', 'touchmove']; +var Eventful = require('./mixin/Eventful.js'); + +var domHandlerNames = ['resize', 'click', 'dblclick', 'mousewheel', 'mousemove', 'mouseout', 'mouseup', 'mousedown', 'touchstart', 'touchend', 'touchmove']; var domHandlers = { /** * 窗口大小改变响应函数 - * - * @param {event} event dom事件对象 + * @inner + * @param {Event} event */ resize: function (event) { event = event || window.event; @@ -33,38 +37,101 @@ var domHandlers = { /** * 点击响应函数 - * - * @param {event} event dom事件对象 + * @inner + * @param {Event} event */ click: function (event) { event = this._zrenderEventFixed(event); - //分发config.EVENT.CLICK事件 + // 分发config.EVENT.CLICK事件 var _lastHover = this._lastHover; if ((_lastHover && _lastHover.clickable) || !_lastHover) { - this._dispatchAgency(_lastHover, EVENT.CLICK, event); + + // 判断没有发生拖拽才触发click事件 + if (this._clickThreshold < 5) { + this._dispatchAgency(_lastHover, EVENT.CLICK, event); + } } this._mousemoveHandler(event); }, + /** + * 双击响应函数 + * @inner + * @param {Event} event + */ + dblclick: function (event) { + event = event || window.event; + event = this._zrenderEventFixed(event); + + // 分发config.EVENT.DBLCLICK事件 + var _lastHover = this._lastHover; + if ((_lastHover && _lastHover.clickable) || !_lastHover) { + + // 判断没有发生拖拽才触发dblclick事件 + if (this._clickThreshold < 5) { + this._dispatchAgency(_lastHover, EVENT.DBLCLICK, event); + } + } + + this._mousemoveHandler(event); + }, + + /** * 鼠标滚轮响应函数 - * - * @param {event} event dom事件对象 + * @inner + * @param {Event} event */ mousewheel: function (event) { event = this._zrenderEventFixed(event); - //分发config.EVENT.MOUSEWHEEL事件 + // http://www.sitepoint.com/html5-javascript-mouse-wheel/ + // https://developer.mozilla.org/en-US/docs/DOM/DOM_event_reference/mousewheel + var delta = event.wheelDelta // Webkit + || -event.detail; // Firefox + var scale = delta > 0 ? 1.1 : 1 / 1.1; + + var needsRefresh = false; + + var mouseX = this._mouseX; + var mouseY = this._mouseY; + this.painter.eachBuildinLayer(function (layer) { + var pos = layer.position; + if (layer.zoomable) { + layer.__zoom = layer.__zoom || 1; + var newZoom = layer.__zoom; + newZoom *= scale; + newZoom = Math.max( + Math.min(layer.maxZoom, newZoom), layer.minZoom); + scale = newZoom / layer.__zoom; + layer.__zoom = newZoom; + // Keep the mouse center when scaling + pos[0] -= (mouseX - pos[0]) * (scale - 1); + pos[1] -= (mouseY - pos[1]) * (scale - 1); + layer.scale[0] *= scale; + layer.scale[1] *= scale; + layer.dirty = true; + needsRefresh = true; + + // Prevent browser default scroll action + eventTool.stop(event); + } + }); + if (needsRefresh) { + this.painter.refresh(); + } + + // 分发config.EVENT.MOUSEWHEEL事件 this._dispatchAgency(this._lastHover, EVENT.MOUSEWHEEL, event); this._mousemoveHandler(event); }, /** * 鼠标(手指)移动响应函数 - * - * @param {event} event dom事件对象 + * @inner + * @param {Event} event */ mousemove: function (event) { if (this.painter.isLoading()) { @@ -76,17 +143,18 @@ var domHandlers = { this._lastY = this._mouseY; this._mouseX = eventTool.getX(event); this._mouseY = eventTool.getY(event); + var dx = this._mouseX - this._lastX; + var dy = this._mouseY - this._lastY; // 可能出现config.EVENT.DRAGSTART事件 // 避免手抖点击误认为拖拽 - //if (this._mouseX - this._lastX > 1 || this._mouseY - this._lastY > 1) { + // if (this._mouseX - this._lastX > 1 || this._mouseY - this._lastY > 1) { this._processDragStart(event); - //} + // } this._hasfound = 0; this._event = event; - this.storage.iterShape(this._findHover, { - normal: 'down' - }); + + this._iterateAndFindHover(); // 找到的在迭代函数里做了处理,没找到得在迭代完后处理 if (!this._hasfound) { @@ -103,15 +171,38 @@ var domHandlers = { this.storage.delHover(); this.painter.clearHover(); } - //如果存在拖拽中元素,被拖拽的图形元素最后addHover + + // set cursor for root element + var cursor = 'default'; + + // 如果存在拖拽中元素,被拖拽的图形元素最后addHover if (this._draggingTarget) { - this.storage.drift( - this._draggingTarget.id, this._mouseX - this._lastX, this._mouseY - this._lastY); + this.storage.drift(this._draggingTarget.id, dx, dy); + this._draggingTarget.modSelf(); this.storage.addHover(this._draggingTarget); + + // 拖拽不触发click事件 + this._clickThreshold++; + } + else if (this._isMouseDown) { + var needsRefresh = false; + // Layer dragging + this.painter.eachBuildinLayer(function (layer) { + if (layer.panable) { + // PENDING + cursor = 'move'; + // Keep the mouse center when scaling + layer.position[0] += dx; + layer.position[1] += dy; + needsRefresh = true; + layer.dirty = true; + } + }); + if (needsRefresh) { + this.painter.refresh(); + } } - // set cursor for root element - var cursor = 'default'; if (this._draggingTarget || (this._hasfound && this._lastHover.draggable)) { cursor = 'move'; } @@ -130,8 +221,8 @@ var domHandlers = { /** * 鼠标(手指)离开响应函数 - * - * @param {event} event dom事件对象 + * @inner + * @param {Event} event */ mouseout: function (event) { event = this._zrenderEventFixed(event); @@ -166,10 +257,13 @@ var domHandlers = { /** * 鼠标(手指)按下响应函数 - * - * @param {event} event dom事件对象 + * @inner + * @param {Event} event */ mousedown: function (event) { + // 重置 clickThreshold + this._clickThreshold = 0; + if (this._lastDownButton == 2) { this._lastDownButton = event.button; this._mouseDownTarget = null; @@ -181,7 +275,7 @@ var domHandlers = { event = this._zrenderEventFixed(event); this._isMouseDown = 1; - //分发config.EVENT.MOUSEDOWN事件 + // 分发config.EVENT.MOUSEDOWN事件 this._mouseDownTarget = this._lastHover; this._dispatchAgency(this._lastHover, EVENT.MOUSEDOWN, event); this._lastDownButton = event.button; @@ -189,8 +283,8 @@ var domHandlers = { /** * 鼠标(手指)抬起响应函数 - * - * @param {event} event dom事件对象 + * @inner + * @param {Event} event */ mouseup: function (event) { event = this._zrenderEventFixed(event); @@ -198,7 +292,7 @@ var domHandlers = { this._isMouseDown = 0; this._mouseDownTarget = null; - //分发config.EVENT.MOUSEUP事件 + // 分发config.EVENT.MOUSEUP事件 this._dispatchAgency(this._lastHover, EVENT.MOUSEUP, event); this._processDrop(event); this._processDragEnd(event); @@ -206,23 +300,23 @@ var domHandlers = { /** * Touch开始响应函数 - * - * @param {event} event dom事件对象 + * @inner + * @param {Event} event */ touchstart: function (event) { - //eventTool.stop(event);// 阻止浏览器默认事件,重要 + // eventTool.stop(event);// 阻止浏览器默认事件,重要 event = this._zrenderEventFixed(event, true); this._lastTouchMoment = new Date(); - //平板补充一次findHover - this._mobildFindFixed(event); + // 平板补充一次findHover + this._mobileFindFixed(event); this._mousedownHandler(event); }, /** * Touch移动响应函数 - * - * @param {event} event dom事件对象 + * @inner + * @param {Event} event */ touchmove: function (event) { event = this._zrenderEventFixed(event, true); @@ -234,17 +328,25 @@ var domHandlers = { /** * Touch结束响应函数 - * - * @param {event} event dom事件对象 + * @inner + * @param {Event} event */ touchend: function (event) { - //eventTool.stop(event);// 阻止浏览器默认事件,重要 + // eventTool.stop(event);// 阻止浏览器默认事件,重要 event = this._zrenderEventFixed(event, true); this._mouseupHandler(event); - if (new Date() - this._lastTouchMoment < EVENT.touchClickDelay) { - this._mobildFindFixed(event); + var now = new Date(); + if (now - this._lastTouchMoment < EVENT.touchClickDelay) { + this._mobileFindFixed(event); this._clickHandler(event); + if (now - this._lastClickMoment < EVENT.touchClickDelay / 2) { + this._dblclickHandler(event); + if (this._lastHover && this._lastHover.clickable) { + eventTool.stop(event); // 阻止浏览器默认事件,重要 + } + } + this._lastClickMoment = now; } this.painter.clearHover(); } @@ -264,12 +366,22 @@ function bind1Arg(handler, context) { return handler.call(context, e); }; } - +/**function bind2Arg(handler, context) { + return function (arg1, arg2) { + return handler.call(context, arg1, arg2); + }; + }*/ + +function bind3Arg(handler, context) { + return function (arg1, arg2, arg3) { + return handler.call(context, arg1, arg2, arg3); + }; +} /** * 为控制类实例初始化dom 事件处理函数 * * @inner - * @param {Handler} instance 控制类实例 + * @param {module:zrender/Handler} instance 控制类实例 */ function initDomHandler(instance) { @@ -281,18 +393,16 @@ function initDomHandler(instance) { } /** - * 控制类 (C) - * + * @alias module:zrender/Handler + * @constructor + * @extends module:zrender/mixin/Eventful * @param {HTMLElement} root 绘图区域 - * @param {storage} storage Storage实例 - * @param {painter} painter Painter实例 - * - * 分发事件支持详见config.EVENT + * @param {module:zrender/Storage} storage Storage实例 + * @param {module:zrender/Painter} painter Painter实例 */ - -function Handler(root, storage, painter) { +var Handler = function (root, storage, painter) { // 添加事件分发器特性 - eventTool.Dispatcher.call(this); + Eventful.call(this); this.root = root; this.storage = storage; @@ -313,7 +423,7 @@ function Handler(root, storage, painter) { this._mouseX = this._mouseY = 0; - this._findHover = bind1Arg(findHover, this); + this._findHover = bind3Arg(findHover, this); this._domHover = painter.getDomHover(); initDomHandler(this); @@ -330,6 +440,7 @@ function Handler(root, storage, painter) { else { // mobile的click/move/up/down自己模拟 root.addEventListener('click', this._clickHandler); + root.addEventListener('dblclick', this._dblclickHandler); root.addEventListener('mousewheel', this._mousewheelHandler); root.addEventListener('mousemove', this._mousemoveHandler); root.addEventListener('mousedown', this._mousedownHandler); @@ -342,21 +453,24 @@ function Handler(root, storage, painter) { window.attachEvent('onresize', this._resizeHandler); root.attachEvent('onclick', this._clickHandler); + //root.attachEvent('ondblclick ', this._dblclickHandler); + root.ondblclick = this._dblclickHandler; root.attachEvent('onmousewheel', this._mousewheelHandler); root.attachEvent('onmousemove', this._mousemoveHandler); root.attachEvent('onmouseout', this._mouseoutHandler); root.attachEvent('onmousedown', this._mousedownHandler); root.attachEvent('onmouseup', this._mouseupHandler); } -} +}; /** * 自定义事件绑定 * @param {string} eventName 事件名称,resize,hover,drag,etc~ * @param {Function} handler 响应函数 + * @param {Object} [context] 响应函数 */ -Handler.prototype.on = function (eventName, handler) { - this.bind(eventName, handler); +Handler.prototype.on = function (eventName, handler, context) { + this.bind(eventName, handler, context); return this; }; @@ -379,6 +493,7 @@ Handler.prototype.trigger = function (eventName, eventArgs) { switch (eventName) { case EVENT.RESIZE: case EVENT.CLICK: + case EVENT.DBLCLICK: case EVENT.MOUSEWHEEL: case EVENT.MOUSEMOVE: case EVENT.MOUSEDOWN: @@ -390,7 +505,7 @@ Handler.prototype.trigger = function (eventName, eventArgs) { }; /** - * 释放 + * 释放,解绑所有事件 */ Handler.prototype.dispose = function () { var root = this.root; @@ -407,6 +522,7 @@ Handler.prototype.dispose = function () { else { // mobile的click自己模拟 root.removeEventListener('click', this._clickHandler); + root.removeEventListener('dblclick', this._dblclickHandler); root.removeEventListener('mousewheel', this._mousewheelHandler); root.removeEventListener('mousemove', this._mousemoveHandler); root.removeEventListener('mousedown', this._mousedownHandler); @@ -419,6 +535,7 @@ Handler.prototype.dispose = function () { window.detachEvent('onresize', this._resizeHandler); root.detachEvent('onclick', this._clickHandler); + root.detachEvent('dblclick', this._dblclickHandler); root.detachEvent('onmousewheel', this._mousewheelHandler); root.detachEvent('onmousemove', this._mousemoveHandler); root.detachEvent('onmouseout', this._mouseoutHandler); @@ -456,7 +573,7 @@ Handler.prototype._processDragStart = function (event) { _draggingTarget.invisible = true; this.storage.mod(_draggingTarget.id); - //分发config.EVENT.DRAGSTART事件 + // 分发config.EVENT.DRAGSTART事件 this._dispatchAgency( _draggingTarget, EVENT.DRAGSTART, event); this.painter.refresh(); @@ -471,7 +588,7 @@ Handler.prototype._processDragStart = function (event) { */ Handler.prototype._processDragEnter = function (event) { if (this._draggingTarget) { - //分发config.EVENT.DRAGENTER事件 + // 分发config.EVENT.DRAGENTER事件 this._dispatchAgency( this._lastHover, EVENT.DRAGENTER, event, this._draggingTarget); } @@ -485,7 +602,7 @@ Handler.prototype._processDragEnter = function (event) { */ Handler.prototype._processDragOver = function (event) { if (this._draggingTarget) { - //分发config.EVENT.DRAGOVER事件 + // 分发config.EVENT.DRAGOVER事件 this._dispatchAgency( this._lastHover, EVENT.DRAGOVER, event, this._draggingTarget); } @@ -499,7 +616,7 @@ Handler.prototype._processDragOver = function (event) { */ Handler.prototype._processDragLeave = function (event) { if (this._draggingTarget) { - //分发config.EVENT.DRAGLEAVE事件 + // 分发config.EVENT.DRAGLEAVE事件 this._dispatchAgency( this._lastHover, EVENT.DRAGLEAVE, event, this._draggingTarget); } @@ -517,7 +634,7 @@ Handler.prototype._processDrop = function (event) { this.storage.mod(this._draggingTarget.id); this.painter.refresh(); - //分发config.EVENT.DROP事件 + // 分发config.EVENT.DROP事件 this._dispatchAgency( this._lastHover, EVENT.DROP, event, this._draggingTarget); } @@ -531,7 +648,7 @@ Handler.prototype._processDrop = function (event) { */ Handler.prototype._processDragEnd = function (event) { if (this._draggingTarget) { - //分发config.EVENT.DRAGEND事件 + // 分发config.EVENT.DRAGEND事件 this._dispatchAgency( this._draggingTarget, EVENT.DRAGEND, event); @@ -549,7 +666,7 @@ Handler.prototype._processDragEnd = function (event) { * @param {Object} event 事件对象 */ Handler.prototype._processOverShape = function (event) { - //分发config.EVENT.MOUSEOVER事件 + // 分发config.EVENT.MOUSEOVER事件 this._dispatchAgency(this._lastHover, EVENT.MOUSEOVER, event); }; @@ -560,7 +677,7 @@ Handler.prototype._processOverShape = function (event) { * @param {Object} event 事件对象 */ Handler.prototype._processOutShape = function (event) { - //分发config.EVENT.MOUSEOUT事件 + // 分发config.EVENT.MOUSEOUT事件 this._dispatchAgency(this._lastHover, EVENT.MOUSEOUT, event); }; @@ -589,7 +706,7 @@ Handler.prototype._dispatchAgency = function (targetShape, eventName, event, dra } while (el) { - el[eventHandler] && el[eventHandler](eventPacket); + el[eventHandler] && (eventPacket.cancelBubble = el[eventHandler](eventPacket)); el.dispatch(eventName, eventPacket); el = el.parent; @@ -606,14 +723,57 @@ Handler.prototype._dispatchAgency = function (targetShape, eventName, event, dra } } else if (!draggedShape) { - //无hover目标,无拖拽对象,原生事件分发 - this.dispatch(eventName, { + // 无hover目标,无拖拽对象,原生事件分发 + var eveObj = { type: eventName, event: event + }; + this.dispatch(eventName, eveObj); + // 分发事件到用户自定义层 + this.painter.eachOtherLayer(function (layer) { + if (typeof(layer[eventHandler]) == 'function') { + layer[eventHandler](eveObj); + } + if (layer.dispatch) { + layer.dispatch(eventName, eveObj); + } }); } }; +/** + * 迭代寻找hover shape + * @private + * @method + */ +Handler.prototype._iterateAndFindHover = (function () { + var invTransform = mat2d.create(); + return function () { + var list = this.storage.getShapeList(); + var currentZLevel; + var currentLayer; + var tmp = [0, 0]; + for (var i = list.length - 1; i >= 0; i--) { + var shape = list[i]; + + if (currentZLevel !== shape.zlevel) { + currentLayer = this.painter.getLayer(shape.zlevel, currentLayer); + tmp[0] = this._mouseX; + tmp[1] = this._mouseY; + + if (currentLayer.needTransform) { + mat2d.invert(invTransform, currentLayer.transform); + vec2.applyTransform(tmp, tmp, invTransform); + } + } + + if (this._findHover(shape, tmp[0], tmp[1])) { + break; + } + } + }; +})(); + // touch指尖错觉的尝试偏移量配置 var MOBILE_TOUCH_OFFSETS = [{ x: 10 @@ -630,22 +790,20 @@ var MOBILE_TOUCH_OFFSETS = [{ }]; // touch有指尖错觉,四向尝试,让touch上的点击更好触发事件 -Handler.prototype._mobildFindFixed = function (event) { +Handler.prototype._mobileFindFixed = function (event) { this._lastHover = null; this._mouseX = event.zrenderX; this._mouseY = event.zrenderY; this._event = event; - this.storage.iterShape(this._findHover, { - normal: 'down' - }); + + this._iterateAndFindHover(); for (var i = 0; !this._lastHover && i < MOBILE_TOUCH_OFFSETS.length; i++) { var offset = MOBILE_TOUCH_OFFSETS[i]; offset.x && (this._mouseX += offset.x); - offset.y && (this._mouseX += offset.y); - this.storage.iterShape(this._findHover, { - normal: 'down' - }); + offset.y && (this._mouseY += offset.y); + + this._iterateAndFindHover(); } if (this._lastHover) { @@ -657,19 +815,21 @@ Handler.prototype._mobildFindFixed = function (event) { /** * 迭代函数,查找hover到的图形元素并即时做些事件分发 * - * @private - * @param {Object} e 图形元素 + * @inner + * @param {Object} shape 图形元素 + * @param {number} x + * @param {number} y */ -function findHover(shape) { - if ((this._draggingTarget && this._draggingTarget.id == shape.id) //迭代到当前拖拽的图形上 +function findHover(shape, x, y) { + if ((this._draggingTarget && this._draggingTarget.id == shape.id) // 迭代到当前拖拽的图形上 || shape.isSilent() // 打酱油的路过,啥都不响应的shape~ ) { return false; } var event = this._event; - if (shape.isCover(this._mouseX, this._mouseY)) { + if (shape.isCover(x, y)) { if (shape.hoverable) { this.storage.addHover(shape); } @@ -686,23 +846,23 @@ function findHover(shape) { if (this._lastHover != shape) { this._processOutShape(event); - //可能出现config.EVENT.DRAGLEAVE事件 + // 可能出现config.EVENT.DRAGLEAVE事件 this._processDragLeave(event); this._lastHover = shape; - //可能出现config.EVENT.DRAGENTER事件 + // 可能出现config.EVENT.DRAGENTER事件 this._processDragEnter(event); } this._processOverShape(event); - //可能出现config.EVENT.DRAGOVER + // 可能出现config.EVENT.DRAGOVER this._processDragOver(event); this._hasfound = 1; - return true; //找到则中断迭代查找 + return true; // 找到则中断迭代查找 } return false; @@ -731,7 +891,7 @@ Handler.prototype._zrenderEventFixed = function (event, isTouch) { else { var touch = event.type != 'touchend' ? event.targetTouches[0] : event.changedTouches[0]; if (touch) { - var rBounding = this.root.getBoundingClientRect(); + var rBounding = this.painter._domRoot.getBoundingClientRect(); // touch事件坐标是全屏的~ event.zrenderX = touch.clientX - rBounding.left; event.zrenderY = touch.clientY - rBounding.top; @@ -742,6 +902,6 @@ Handler.prototype._zrenderEventFixed = function (event, isTouch) { return event; }; -util.merge(Handler.prototype, eventTool.Dispatcher.prototype, true); +util.merge(Handler.prototype, Eventful.prototype, true); module.exports = Handler; \ No newline at end of file diff --git a/src/zrender/Layer.js b/src/zrender/Layer.js new file mode 100644 index 0000000..5375d98 --- /dev/null +++ b/src/zrender/Layer.js @@ -0,0 +1,209 @@ +/** + * @module zrender/Layer + * @author pissang(https://www.github.com/pissang) + */ + + +var Transformable = require('./mixin/Transformable.js'); +var util = require('./tool/util.js'); +var vmlCanvasManager = window['G_vmlCanvasManager']; +var config = require('./config.js'); + +function returnFalse() { + return false; +} + +/** + * 创建dom + * + * @inner + * @param {string} id dom id 待用 + * @param {string} type dom type,such as canvas, div etc. + * @param {Painter} painter painter instance + */ + +function createDom(id, type, painter) { + var newDom = document.createElement(type); + var width = painter.getWidth(); + var height = painter.getHeight(); + + // 没append呢,请原谅我这样写,清晰~ + newDom.style.position = 'absolute'; + newDom.style.left = 0; + newDom.style.top = 0; + newDom.style.width = width + 'px'; + newDom.style.height = height + 'px'; + newDom.width = width * config.devicePixelRatio; + newDom.height = height * config.devicePixelRatio; + + // id不作为索引用,避免可能造成的重名,定义为私有属性 + newDom.setAttribute('data-zr-dom-id', id); + return newDom; +} + +/** + * @alias module:zrender/Layer + * @constructor + * @extends module:zrender/mixin/Transformable + * @param {string} id + * @param {module:zrender/Painter} painter + */ +var Layer = function (id, painter) { + + this.id = id; + + this.dom = createDom(id, 'canvas', painter); + this.dom.onselectstart = returnFalse; // 避免页面选中的尴尬 + this.dom.style['-webkit-user-select'] = 'none'; + this.dom.style['user-select'] = 'none'; + this.dom.style['-webkit-touch-callout'] = 'none'; + this.dom.style['-webkit-tap-highlight-color'] = 'rgba(0,0,0,0)'; + + vmlCanvasManager && vmlCanvasManager.initElement(this.dom); + + this.domBack = null; + this.ctxBack = null; + + this.painter = painter; + + this.unusedCount = 0; + + this.config = null; + + this.dirty = true; + + this.elCount = 0; + + // Configs + /** + * 每次清空画布的颜色 + * @type {string} + * @default 0 + */ + this.clearColor = 0; + /** + * 是否开启动态模糊 + * @type {boolean} + * @default false + */ + this.motionBlur = false; + /** + * 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显 + * @type {number} + * @default 0.7 + */ + this.lastFrameAlpha = 0.7; + /** + * 层是否支持鼠标平移操作 + * @type {boolean} + * @default false + */ + this.zoomable = false; + /** + * 层是否支持鼠标缩放操作 + * @type {boolean} + * @default false + */ + this.panable = false; + + this.maxZoom = Infinity; + this.minZoom = 0; + + Transformable.call(this); +}; + +Layer.prototype.initContext = function () { + this.ctx = this.dom.getContext('2d'); + + var dpr = config.devicePixelRatio; + if (dpr != 1) { + this.ctx.scale(dpr, dpr); + } +}; + +Layer.prototype.createBackBuffer = function () { + if (vmlCanvasManager) { // IE 8- should not support back buffer + return; + } + this.domBack = createDom('back-' + this.id, 'canvas', this.painter); + this.ctxBack = this.domBack.getContext('2d'); + + var dpr = config.devicePixelRatio; + + if (dpr != 1) { + this.ctxBack.scale(dpr, dpr); + } +}; + +/** + * @param {number} width + * @param {number} height + */ +Layer.prototype.resize = function (width, height) { + var dpr = config.devicePixelRatio; + + this.dom.style.width = width + 'px'; + this.dom.style.height = height + 'px'; + + this.dom.setAttribute('width', width * dpr); + this.dom.setAttribute('height', height * dpr); + + if (dpr != 1) { + this.ctx.scale(dpr, dpr); + } + + if (this.domBack) { + this.domBack.setAttribute('width', width * dpr); + this.domBack.setAttribute('height', height * dpr); + + if (dpr != 1) { + this.ctxBack.scale(dpr, dpr); + } + } +}; + +/** + * 清空该层画布 + */ +Layer.prototype.clear = function () { + var dom = this.dom; + var ctx = this.ctx; + var width = dom.width; + var height = dom.height; + + var haveClearColor = this.clearColor && !vmlCanvasManager; + var haveMotionBLur = this.motionBlur && !vmlCanvasManager; + var lastFrameAlpha = this.lastFrameAlpha; + + var dpr = config.devicePixelRatio; + + if (haveMotionBLur) { + if (!this.domBack) { + this.createBackBuffer(); + } + + this.ctxBack.globalCompositeOperation = 'copy'; + this.ctxBack.drawImage( + dom, 0, 0, width / dpr, height / dpr); + } + + ctx.clearRect(0, 0, width / dpr, height / dpr); + if (haveClearColor) { + ctx.save(); + ctx.fillStyle = this.clearColor; + ctx.fillRect(0, 0, width / dpr, height / dpr); + ctx.restore(); + } + + if (haveMotionBLur) { + var domBack = this.domBack; + ctx.save(); + ctx.globalAlpha = lastFrameAlpha; + ctx.drawImage(domBack, 0, 0, width / dpr, height / dpr); + ctx.restore(); + } +}; + +util.merge(Layer.prototype, Transformable.prototype); + +module.exports = Layer; \ No newline at end of file diff --git a/src/zrender/Painter.js b/src/zrender/Painter.js index 9c338f2..28121b6 100644 --- a/src/zrender/Painter.js +++ b/src/zrender/Painter.js @@ -1,53 +1,70 @@ 'use strict'; /** * Painter绘图模块 - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @module zrender/Painter + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * errorrik (errorrik@gmail.com) + * pissang (https://www.github.com/pissang) */ - - - var config = require('./config.js'); var util = require('./tool/util.js'); +// var vec2 = require('./tool/vector.js'); var log = require('./tool/log.js'); -var matrix = require('./tool/matrix.js'); +// var matrix = require('./tool/matrix.js'); var BaseLoadingEffect = require('./loadingEffect/Base.js'); -// retina 屏幕优化 -var devicePixelRatio = window.devicePixelRatio || 1; -devicePixelRatio = Math.max(devicePixelRatio, 1); -var vmlCanvasManager = window.G_vmlCanvasManager; +var Layer = require('./Layer.js'); + +// 返回false的方法,用于避免页面被选中 -/** - * 返回false的方法,用于避免页面被选中 - * - * @inner - */ function returnFalse() { return false; } -/** - * 什么都不干的空方法 - * - * @inner - */ +// 什么都不干的空方法 + function doNothing() {} +function isLayerValid(layer) { + if (!layer) { + return false; + } + + if (layer.isBuildin) { + return true; + } + + if (typeof(layer.resize) !== 'function' || typeof(layer.refresh) !== 'function') { + return false; + } + + return true; +} + /** - * 绘图类 (V) - * - * @param {HTMLElement} root 绘图区域 - * @param {storage} storage Storage实例 + * @alias module:zrender/Painter + * @constructor + * @param {HTMLElement} root 绘图容器 + * @param {module:zrender/Storage} storage */ - -function Painter(root, storage) { +var Painter = function (root, storage) { + /** + * 绘图容器 + * @type {HTMLElement} + */ this.root = root; + root.style['-webkit-tap-highlight-color'] = 'transparent'; + root.style['-webkit-user-select'] = 'none'; + root.style['user-select'] = 'none'; + root.style['-webkit-touch-callout'] = 'none'; + + /** + * @type {module:zrender/Storage} + */ this.storage = storage; root.innerHTML = ''; @@ -56,7 +73,7 @@ function Painter(root, storage) { var domRoot = document.createElement('div'); this._domRoot = domRoot; - //domRoot.onselectstart = returnFalse; // 避免页面选中的尴尬 + // domRoot.onselectstart = returnFalse; // 避免页面选中的尴尬 domRoot.style.position = 'relative'; domRoot.style.overflow = 'hidden'; domRoot.style.width = this._width + 'px'; @@ -65,6 +82,8 @@ function Painter(root, storage) { this._layers = {}; + this._zlevelList = []; + this._layerConfig = {}; this._loadingEffect = new BaseLoadingEffect({}); @@ -72,8 +91,12 @@ function Painter(root, storage) { // 创建各层canvas // 背景 - this._bgDom = createDom('bg', 'div', this); + this._bgDom = document.createElement('div'); + this._bgDom.style.cssText = ['position:absolute;left:0px;top:0px;width:', this._width, 'px;height:', this._height + 'px;', '-webkit-user-select:none;user-select;none;', '-webkit-touch-callout:none;'].join(''); + this._bgDom.setAttribute('data-zr-dom-id', 'bg'); + domRoot.appendChild(this._bgDom); + this._bgDom.onselectstart = returnFalse; // 高亮 var hoverLayer = new Layer('_zrender_hover_', this); @@ -81,18 +104,19 @@ function Painter(root, storage) { domRoot.appendChild(hoverLayer.dom); hoverLayer.initContext(); - hoverLayer.onselectstart = returnFalse; + hoverLayer.dom.onselectstart = returnFalse; + hoverLayer.dom.style['-webkit-user-select'] = 'none'; + hoverLayer.dom.style['user-select'] = 'none'; + hoverLayer.dom.style['-webkit-touch-callout'] = 'none'; - var me = this; - this.updatePainter = function (shapeList, callback) { - me.update(shapeList, callback); - }; -} + // Will be injected by zrender instance + this.refreshNextFrame = null; +}; /** * 首次绘图,创建各种dom和context * - * @param {Function=} callback 绘画结束后的回调函数 + * @param {Function} callback 绘画结束后的回调函数 */ Painter.prototype.render = function (callback) { if (this.isLoading()) { @@ -106,14 +130,22 @@ Painter.prototype.render = function (callback) { /** * 刷新 - * - * @param {Function=} callback 刷新结束后的回调函数 - * @param {Boolean} paintAll 强制绘制所有shape + * @param {Function} callback 刷新结束后的回调函数 + * @param {boolean} paintAll 强制绘制所有shape */ Painter.prototype.refresh = function (callback, paintAll) { var list = this.storage.getShapeList(true); this._paintList(list, paintAll); + // Paint custum layers + for (var i = 0; i < this._zlevelList.length; i++) { + var z = this._zlevelList[i]; + var layer = this._layers[z]; + if (!layer.isBuildin && layer.refresh) { + layer.refresh(); + } + } + if (typeof callback == 'function') { callback(); } @@ -121,6 +153,23 @@ Painter.prototype.refresh = function (callback, paintAll) { return this; }; +Painter.prototype._preProcessLayer = function (layer) { + layer.unusedCount++; + layer.updateTransform(); +}; + +Painter.prototype._postProcessLayer = function (layer) { + layer.dirty = false; + // 删除过期的层 + // PENDING + // if (layer.unusedCount >= 500) { + // this.delLayer(z); + // } + if (layer.unusedCount == 1) { + layer.clear(); + } +}; + Painter.prototype._paintList = function (list, paintAll) { if (typeof(paintAll) == 'undefined') { @@ -133,21 +182,29 @@ Painter.prototype._paintList = function (list, paintAll) { var currentZLevel; var ctx; - for (var id in this._layers) { - if (id !== 'hover') { - this._layers[id].unusedCount++; - } - } - - var invTransform = []; + this.eachBuildinLayer(this._preProcessLayer); + // var invTransform = []; for (var i = 0, l = list.length; i < l; i++) { var shape = list[i]; + // Change draw layer if (currentZLevel !== shape.zlevel) { - currentLayer = this.getLayer(shape.zlevel, currentLayer); - ctx = currentLayer.ctx; + if (currentLayer) { + if (currentLayer.needTransform) { + ctx.restore(); + } + ctx.flush && ctx.flush(); + } + currentZLevel = shape.zlevel; + currentLayer = this.getLayer(currentZLevel); + + if (!currentLayer.isBuildin) { + log('ZLevel ' + currentZLevel + ' has been used by unkown layer ' + currentLayer.id); + } + + ctx = currentLayer.ctx; // Reset the count currentLayer.unusedCount = 0; @@ -155,29 +212,10 @@ Painter.prototype._paintList = function (list, paintAll) { if (currentLayer.dirty || paintAll) { currentLayer.clear(); } - } - - // Start group clipping - if (shape.__startClip && !vmlCanvasManager) { - var clipShape = shape.__startClip; - ctx.save(); - // Set transform - if (clipShape.needTransform) { - var m = clipShape.transform; - matrix.invert(invTransform, m); - ctx.transform( - m[0], m[1], m[2], m[3], m[4], m[5]); - } - ctx.beginPath(); - clipShape.buildPath(ctx, clipShape.style); - ctx.clip(); - - // Transform back - if (clipShape.needTransform) { - var m = invTransform; - ctx.transform( - m[0], m[1], m[2], m[3], m[4], m[5]); + if (currentLayer.needTransform) { + ctx.save(); + currentLayer.setTransform(ctx); } } @@ -185,64 +223,133 @@ Painter.prototype._paintList = function (list, paintAll) { if (!shape.onbrush || (shape.onbrush && !shape.onbrush(ctx, false))) { if (config.catchBrushException) { try { - shape.brush(ctx, false, this.updatePainter); + shape.brush(ctx, false, this.refreshNextFrame); } catch (error) { log( error, 'brush error of ' + shape.type, shape); } - } else { - shape.brush(ctx, false, this.updatePainter); + } + else { + shape.brush(ctx, false, this.refreshNextFrame); } } } - // Stop group clipping - if (shape.__stopClip && !vmlCanvasManager) { + shape.__dirty = false; + } + + if (currentLayer) { + if (currentLayer.needTransform) { ctx.restore(); } + ctx.flush && ctx.flush(); + } - shape.__dirty = false; + this.eachBuildinLayer(this._postProcessLayer); +}; + +/** + * 获取 zlevel 所在层,如果不存在则会创建一个新的层 + * @param {number} zlevel + * @return {module:zrender/Layer} + */ +Painter.prototype.getLayer = function (zlevel) { + var layer = this._layers[zlevel]; + if (!layer) { + // Create a new layer + layer = new Layer(zlevel, this); + layer.isBuildin = true; + + if (this._layerConfig[zlevel]) { + util.merge(layer, this._layerConfig[zlevel], true); + } + + layer.updateTransform(); + + this.insertLayer(zlevel, layer); + + // Context is created after dom inserted to document + // Or excanvas will get 0px clientWidth and clientHeight + layer.initContext(); } - for (var id in this._layers) { - if (id !== 'hover') { - var layer = this._layers[id]; - layer.dirty = false; - // 删除过期的层 - if (layer.unusedCount >= 500) { - delete this._layers[id]; - layer.dom.parentNode.removeChild(layer.dom); - } - else if (layer.unusedCount == 1) { - layer.clear(); + return layer; +}; + +Painter.prototype.insertLayer = function (zlevel, layer) { + if (this._layers[zlevel]) { + log('ZLevel ' + zlevel + ' has been used already'); + return; + } + // Check if is a valid layer + if (!isLayerValid(layer)) { + log('Layer of zlevel ' + zlevel + ' is not valid'); + return; + } + + var len = this._zlevelList.length; + var prevLayer = null; + var i = -1; + if (len > 0 && zlevel > this._zlevelList[0]) { + for (i = 0; i < len - 1; i++) { + if ( + this._zlevelList[i] < zlevel && this._zlevelList[i + 1] > zlevel) { + break; } } + prevLayer = this._layers[this._zlevelList[i]]; } + this._zlevelList.splice(i + 1, 0, zlevel); + + var prevDom = prevLayer ? prevLayer.dom : this._bgDom; + if (prevDom.nextSibling) { + prevDom.parentNode.insertBefore( + layer.dom, prevDom.nextSibling); + } + else { + prevDom.parentNode.appendChild(layer.dom); + } + + this._layers[zlevel] = layer; }; -Painter.prototype.getLayer = function (zlevel, prevLayer) { - // Change draw layer - var currentLayer = this._layers[zlevel]; - if (!currentLayer) { - // Create a new layer - currentLayer = new Layer(zlevel, this); - var prevDom = prevLayer ? prevLayer.dom : this._bgDom; - if (prevDom.nextSibling) { - prevDom.parentNode.insertBefore( - currentLayer.dom, prevDom.nextSibling); - } else { - prevDom.parentNode.appendChild( - currentLayer.dom); - } - currentLayer.initContext(); +// Iterate each layer +Painter.prototype.eachLayer = function (cb, context) { + for (var i = 0; i < this._zlevelList.length; i++) { + var z = this._zlevelList[i]; + cb.call(context, this._layers[z], z); + } +}; - this._layers[zlevel] = currentLayer; +// Iterate each buildin layer +Painter.prototype.eachBuildinLayer = function (cb, context) { + for (var i = 0; i < this._zlevelList.length; i++) { + var z = this._zlevelList[i]; + var layer = this._layers[z]; + if (layer.isBuildin) { + cb.call(context, layer, z); + } + } +}; - currentLayer.config = this._layerConfig[zlevel]; +// Iterate each other layer except buildin layer +Painter.prototype.eachOtherLayer = function (cb, context) { + for (var i = 0; i < this._zlevelList.length; i++) { + var z = this._zlevelList[i]; + var layer = this._layers[z]; + if (!layer.isBuildin) { + cb.call(context, layer, z); + } } +}; - return currentLayer; +/** + * 获取所有已创建的层 + * @param {Array.} [prevLayer] + */ +Painter.prototype.getLayers = function () { + return this._layers; }; Painter.prototype._updateLayerStatus = function (list) { @@ -250,12 +357,11 @@ Painter.prototype._updateLayerStatus = function (list) { var layers = this._layers; var elCounts = {}; - for (var z in layers) { - if (z !== 'hover') { - elCounts[z] = layers[z].elCount; - layers[z].elCount = 0; - } - } + + this.eachBuildinLayer(function (layer, z) { + elCounts[z] = layer.elCount; + layer.elCount = 0; + }); for (var i = 0, l = list.length; i < l; i++) { var shape = list[i]; @@ -272,25 +378,22 @@ Painter.prototype._updateLayerStatus = function (list) { } // 层中的元素数量有发生变化 - for (var z in layers) { - if (z !== 'hover') { - if (elCounts[z] !== layers[z].elCount) { - layers[z].dirty = true; - } + this.eachBuildinLayer(function (layer, z) { + if (elCounts[z] !== layer.elCount) { + layer.dirty = true; } - } + }); }; /** - * 视图更新 - * - * @param {Array} shapeList 需要更新的图形元素列表 - * @param {Function} callback 视图更新后回调函数 + * 指定的图形列表 + * @param {Array.} shapeList 需要更新的图形元素列表 + * @param {Function} [callback] 视图更新后回调函数 */ -Painter.prototype.update = function (shapeList, callback) { +Painter.prototype.refreshShapes = function (shapeList, callback) { for (var i = 0, l = shapeList.length; i < l; i++) { var shape = shapeList[i]; - this.storage.mod(shape.id); + shape.modSelf(); } this.refresh(callback); @@ -312,35 +415,67 @@ Painter.prototype.setLoadingEffect = function (loadingEffect) { * 清除hover层外所有内容 */ Painter.prototype.clear = function () { - for (var k in this._layers) { - if (k == 'hover') { - continue; - } - this._layers[k].clear(); - } - + this.eachBuildinLayer(this._clearLayer); return this; }; +Painter.prototype._clearLayer = function (layer) { + layer.clear(); +}; + /** * 修改指定zlevel的绘制参数 + * + * @param {string} zlevel + * @param {Object} config 配置对象 + * @param {string} [config.clearColor=0] 每次清空画布的颜色 + * @param {string} [config.motionBlur=false] 是否开启动态模糊 + * @param {number} [config.lastFrameAlpha=0.7] + * 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显 + * @param {Array.} [position] 层的平移 + * @param {Array.} [rotation] 层的旋转 + * @param {Array.} [scale] 层的缩放 + * @param {boolean} [zoomable=false] 层是否支持鼠标缩放操作 + * @param {boolean} [panable=false] 层是否支持鼠标平移操作 */ Painter.prototype.modLayer = function (zlevel, config) { if (config) { if (!this._layerConfig[zlevel]) { this._layerConfig[zlevel] = config; - } else { + } + else { util.merge(this._layerConfig[zlevel], config, true); } var layer = this._layers[zlevel]; if (layer) { - layer.config = this._layerConfig[zlevel]; + util.merge(layer, this._layerConfig[zlevel], true); } } }; +/** + * 删除指定层 + * @param {number} zlevel 层所在的zlevel + */ +Painter.prototype.delLayer = function (zlevel) { + var layer = this._layers[zlevel]; + if (!layer) { + return; + } + // Save config + this.modLayer(zlevel, { + position: layer.position, + rotation: layer.rotation, + scale: layer.scale + }); + layer.dom.parentNode.removeChild(layer.dom); + delete this._layers[zlevel]; + + this._zlevelList.splice(util.indexOf(this._zlevelList, zlevel), 1); +}; + /** * 刷新hover层 */ @@ -350,6 +485,9 @@ Painter.prototype.refreshHover = function () { for (var i = 0, l = list.length; i < l; i++) { this._brushHover(list[i]); } + var ctx = this._layers.hover.ctx; + ctx.flush && ctx.flush(); + this.storage.delHover(); return this; @@ -430,9 +568,10 @@ Painter.prototype.resize = function () { /** * 清除单独的一个层 + * @param {number} zLevel */ -Painter.prototype.clearLayer = function (k) { - var layer = this._layers[k]; +Painter.prototype.clearLayer = function (zLevel) { + var layer = this._layers[zLevel]; if (layer) { layer.clear(); } @@ -459,32 +598,37 @@ Painter.prototype.getDomHover = function () { return this._layers.hover.dom; }; +/** + * 图像导出 + * @param {string} type + * @param {string} [backgroundColor='#fff'] 背景色 + * @return {string} 图片的Base64 url + */ Painter.prototype.toDataURL = function (type, backgroundColor, args) { - if (vmlCanvasManager) { + if (window['G_vmlCanvasManager']) { return null; } - var imageDom = createDom('image', 'canvas', this); - this._bgDom.appendChild(imageDom); - var ctx = imageDom.getContext('2d'); - devicePixelRatio != 1 && ctx.scale(devicePixelRatio, devicePixelRatio); + var imageLayer = new Layer('image', this); + this._bgDom.appendChild(imageLayer.dom); + imageLayer.initContext(); - ctx.fillStyle = backgroundColor || '#fff'; - ctx.rect( - 0, 0, this._width * devicePixelRatio, this._height * devicePixelRatio); - ctx.fill(); + var ctx = imageLayer.ctx; + imageLayer.clearColor = backgroundColor || '#fff'; + imageLayer.clear(); - //升序遍历,shape上的zlevel指定绘画图层的z轴层叠 + var self = this; + // 升序遍历,shape上的zlevel指定绘画图层的z轴层叠 this.storage.iterShape( function (shape) { if (!shape.invisible) { - if (!shape.onbrush //没有onbrush - //有onbrush并且调用执行返回false或undefined则继续粉刷 + if (!shape.onbrush // 没有onbrush + // 有onbrush并且调用执行返回false或undefined则继续粉刷 || (shape.onbrush && !shape.onbrush(ctx, false))) { if (config.catchBrushException) { try { - shape.brush(ctx, false, this.updatePainter); + shape.brush(ctx, false, self.refreshNextFrame); } catch (error) { log( @@ -492,7 +636,7 @@ Painter.prototype.toDataURL = function (type, backgroundColor, args) { } } else { - shape.brush(ctx, false, this.updatePainter); + shape.brush(ctx, false, self.refreshNextFrame); } } } @@ -500,9 +644,9 @@ Painter.prototype.toDataURL = function (type, backgroundColor, args) { normal: 'up', update: true }); - var image = imageDom.toDataURL(type, args); + var image = imageLayer.dom.toDataURL(type, args); ctx = null; - this._bgDom.removeChild(imageDom); + this._bgDom.removeChild(imageLayer.dom); return image; }; @@ -536,19 +680,21 @@ Painter.prototype._getHeight = function () { - parseInt(stl.paddingBottom, 10)).toFixed(0) - 0; }; -/** - * 鼠标悬浮刷画 - */ Painter.prototype._brushHover = function (shape) { var ctx = this._layers.hover.ctx; - if (!shape.onbrush //没有onbrush - //有onbrush并且调用执行返回false或undefined则继续粉刷 + if (!shape.onbrush // 没有onbrush + // 有onbrush并且调用执行返回false或undefined则继续粉刷 || (shape.onbrush && !shape.onbrush(ctx, true))) { + var layer = this.getLayer(shape.zlevel); + if (layer.needTransform) { + ctx.save(); + layer.setTransform(ctx); + } // Retina 优化 if (config.catchBrushException) { try { - shape.brush(ctx, true, this.updatePainter); + shape.brush(ctx, true, this.refreshNextFrame); } catch (error) { log( @@ -556,7 +702,10 @@ Painter.prototype._brushHover = function (shape) { } } else { - shape.brush(ctx, true, this.updatePainter); + shape.brush(ctx, true, this.refreshNextFrame); + } + if (layer.needTransform) { + ctx.restore(); } } }; @@ -565,7 +714,6 @@ Painter.prototype._shapeToImage = function ( id, shape, width, height, devicePixelRatio) { var canvas = document.createElement('canvas'); var ctx = canvas.getContext('2d'); - var devicePixelRatio = window.devicePixelRatio || 1; canvas.style.width = width + 'px'; canvas.style.height = height + 'px'; @@ -612,159 +760,16 @@ id, shape, width, height, devicePixelRatio) { }; Painter.prototype._createShapeToImageProcessor = function () { - if (vmlCanvasManager) { + if (window['G_vmlCanvasManager']) { return doNothing; } - var painter = this; + var me = this; return function (id, e, width, height) { - return painter._shapeToImage( - id, e, width, height, devicePixelRatio); + return me._shapeToImage( + id, e, width, height, config.devicePixelRatio); }; }; -/** - * 创建dom - * - * @inner - * @param {string} id dom id 待用 - * @param {string} type dom type,such as canvas, div etc. - * @param {Painter} painter painter instance - */ - -function createDom(id, type, painter) { - var newDom = document.createElement(type); - var width = painter._width; - var height = painter._height; - - // 没append呢,请原谅我这样写,清晰~ - newDom.style.position = 'absolute'; - newDom.style.left = 0; - newDom.style.top = 0; - newDom.style.width = width + 'px'; - newDom.style.height = height + 'px'; - newDom.setAttribute('width', width * devicePixelRatio); - newDom.setAttribute('height', height * devicePixelRatio); - - // id不作为索引用,避免可能造成的重名,定义为私有属性 - newDom.setAttribute('data-zr-dom-id', id); - return newDom; -} - -/***************************************** - * Layer - *****************************************/ - -function Layer(id, painter) { - this.dom = createDom(id, 'canvas', painter); - vmlCanvasManager && vmlCanvasManager.initElement(this.dom); - - this.domBack = null; - this.ctxBack = null; - - this.painter = painter; - - this.unusedCount = 0; - - this.config = null; - - this.dirty = true; - - this.elCount = 0; -} - -Layer.prototype.initContext = function () { - this.ctx = this.dom.getContext('2d'); - if (devicePixelRatio != 1) { - this.ctx.scale(devicePixelRatio, devicePixelRatio); - } -} - -Layer.prototype.createBackBuffer = function () { - if (vmlCanvasManager) { // IE 8- should not support back buffer - return; - } - this.domBack = createDom('back-' + this.id, 'canvas', this.painter); - this.ctxBack = this.domBack.getContext('2d'); - - if (devicePixelRatio != 1) { - this.ctxBack.scale(devicePixelRatio, devicePixelRatio); - } -}; - -Layer.prototype.resize = function (width, height) { - this.dom.style.width = width + 'px'; - this.dom.style.height = height + 'px'; - - this.dom.setAttribute('width', width * devicePixelRatio); - this.dom.setAttribute('height', height * devicePixelRatio); - - if (devicePixelRatio != 1) { - this.ctx.scale(devicePixelRatio, devicePixelRatio); - } - - if (this.domBack) { - this.domBack.setAttribute('width', width * devicePixelRatio); - this.domBack.setAttribute('height', height * devicePixelRatio); - - if (devicePixelRatio != 1) { - this.ctxBack.scale(devicePixelRatio, devicePixelRatio); - } - } -}; - -Layer.prototype.clear = function () { - var config = this.config; - var dom = this.dom; - var ctx = this.ctx; - var width = dom.width; - var height = dom.height; - - if (config) { - var haveClearColor = - typeof(config.clearColor) !== 'undefined' && !vmlCanvasManager; - var haveMotionBLur = config.motionBlur && !vmlCanvasManager; - var lastFrameAlpha = config.lastFrameAlpha; - if (typeof(lastFrameAlpha) == 'undefined') { - lastFrameAlpha = 0.7; - } - - if (haveMotionBLur) { - if (!this.domBack) { - this.createBackBuffer(); - } - - this.ctxBack.globalCompositeOperation = 'copy'; - this.ctxBack.drawImage( - dom, 0, 0, width / devicePixelRatio, height / devicePixelRatio); - } - - if (haveClearColor) { - ctx.save(); - ctx.fillStyle = this.config.clearColor; - ctx.fillRect( - 0, 0, width / devicePixelRatio, height / devicePixelRatio); - ctx.restore(); - } - else { - ctx.clearRect( - 0, 0, width / devicePixelRatio, height / devicePixelRatio); - } - - if (haveMotionBLur) { - var domBack = this.domBack; - ctx.save(); - ctx.globalAlpha = lastFrameAlpha; - ctx.drawImage( - domBack, 0, 0, width / devicePixelRatio, height / devicePixelRatio); - ctx.restore(); - } - } - else { - ctx.clearRect( - 0, 0, width / devicePixelRatio, height / devicePixelRatio); - } -}; - -module.exports = Painter; +module.exports = Painter; \ No newline at end of file diff --git a/src/zrender/Storage.js b/src/zrender/Storage.js index 8e39030..8e7c9b6 100644 --- a/src/zrender/Storage.js +++ b/src/zrender/Storage.js @@ -1,17 +1,16 @@ 'use strict'; /** * Storage内容仓库模块 - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * errorrik (errorrik@gmail.com) + * @module zrender/Storage + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + * @author errorrik (errorrik@gmail.com) + * @author pissang (https://github.com/pissang/) */ - - var util = require('./tool/util.js'); -var Group = require('./shape/Group.js'); +var Group = require('./Group.js'); var defaultIterateOption = { hover: false, @@ -30,10 +29,10 @@ function shapeCompareFunc(a, b) { } /** * 内容仓库 (M) - * + * @alias module:zrender/Storage + * @constructor */ - -function Storage() { +var Storage = function () { // 所有常规形状,id索引的map this._elements = {}; @@ -45,16 +44,17 @@ function Storage() { this._shapeList = []; this._shapeListOffset = 0; -} +}; /** * 遍历迭代器 * * @param {Function} fun 迭代回调函数,return true终止迭代 - * @param {Object=} option 迭代参数,缺省为仅降序遍历常规形状 - * hover : true 是否迭代高亮层数据 - * normal : 'down' | 'up' 是否迭代常规数据,迭代时是否指定及z轴顺序 - * update : false 是否更新shapeList + * @param {Object} [option] 迭代参数,缺省为仅降序遍历普通层图形 + * @param {boolean} [option.hover=true] 是否是高亮层图形 + * @param {string} [option.normal='up'] 是否是普通层图形,迭代时是否指定及z轴顺序 + * @param {boolean} [option.update=false] 是否在迭代前更新形状列表 + * */ Storage.prototype.iterShape = function (fun, option) { if (!option) { @@ -62,7 +62,7 @@ Storage.prototype.iterShape = function (fun, option) { } if (option.hover) { - //高亮层数据遍历 + // 高亮层数据遍历 for (var i = 0, l = this._hoverElements.length; i < l; i++) { var el = this._hoverElements[i]; el.updateTransform(); @@ -76,7 +76,7 @@ Storage.prototype.iterShape = function (fun, option) { this.updateShapeList(); } - //遍历: 'down' | 'up' + // 遍历: 'down' | 'up' switch (option.normal) { case 'down': // 降序遍历,高层优先 @@ -89,7 +89,7 @@ Storage.prototype.iterShape = function (fun, option) { break; // case 'up': default: - //升序遍历,底层优先 + // 升序遍历,底层优先 for (var i = 0, l = this._shapeList.length; i < l; i++) { if (fun(this._shapeList[i])) { return this; @@ -101,15 +101,43 @@ Storage.prototype.iterShape = function (fun, option) { return this; }; +/** + * 返回hover层的形状数组 + * @param {boolean} [update=false] 是否在返回前更新图形的变换 + * @return {Array.} + */ Storage.prototype.getHoverShapes = function (update) { + // hoverConnect + var hoverElements = []; + for (var i = 0, l = this._hoverElements.length; i < l; i++) { + hoverElements.push(this._hoverElements[i]); + var target = this._hoverElements[i].hoverConnect; + if (target) { + var shape; + target = target instanceof Array ? target : [target]; + for (var j = 0, k = target.length; j < k; j++) { + shape = target[j].id ? target[j] : this.get(target[j]); + if (shape) { + hoverElements.push(shape); + } + } + } + } + hoverElements.sort(shapeCompareFunc); if (update) { - for (var i = 0, l = this._hoverElements.length; i < l; i++) { - this._hoverElements[i].updateTransform(); + for (var i = 0, l = hoverElements.length; i < l; i++) { + hoverElements[i].updateTransform(); } } - return this._hoverElements; + return hoverElements; }; +/** + * 返回所有图形的绘制队列 + * @param {boolean} [update=false] 是否在返回前更新该数组 + * 详见{@link module:zrender/shape/Base.prototype.updateShapeList} + * @return {Array.} + */ Storage.prototype.getShapeList = function (update) { if (update) { this.updateShapeList(); @@ -117,7 +145,11 @@ Storage.prototype.getShapeList = function (update) { return this._shapeList; }; - +/** + * 更新图形的绘制队列。 + * 每次绘制前都会调用,该方法会先深度优先遍历整个树,更新所有Group和Shape的变换并且把所有可见的Shape保存到数组中, + * 最后根据绘制的优先级(zlevel > z > 插入顺序)排序得到绘制队列 + */ Storage.prototype.updateShapeList = function () { this._shapeListOffset = 0; for (var i = 0, len = this._roots.length; i < len; i++) { @@ -133,7 +165,7 @@ Storage.prototype.updateShapeList = function () { this._shapeList.sort(shapeCompareFunc); }; -Storage.prototype._updateAndAddShape = function (el) { +Storage.prototype._updateAndAddShape = function (el, clipShapes) { if (el.ignore) { return; @@ -148,9 +180,12 @@ Storage.prototype._updateAndAddShape = function (el) { el.clipShape.parent = el; el.clipShape.updateTransform(); - var startClipShape = el._children[0]; - if (startClipShape) { - startClipShape.__startClip = el.clipShape; + // PENDING 效率影响 + if (clipShapes) { + clipShapes = clipShapes.slice(); + clipShapes.push(el.clipShape); + } else { + clipShapes = [el.clipShape]; } } @@ -160,47 +195,41 @@ Storage.prototype._updateAndAddShape = function (el) { // Force to mark as dirty if group is dirty child.__dirty = el.__dirty || child.__dirty; - this._updateAndAddShape(child); - } - - if (el.clipShape) { - var stopClipShape = this._shapeList[this._shapeListOffset - 1]; - if (stopClipShape) { - stopClipShape.__stopClip = true; - } + this._updateAndAddShape(child, clipShapes); } // Mark group clean here el.__dirty = false; - } else { + } + else { + el.__clipShapes = clipShapes; + this._shapeList[this._shapeListOffset++] = el; } }; /** - * 修改 + * 修改图形(Shape)或者组(Group) * - * @param {string} idx 唯一标识 + * @param {string} elId 唯一标识 * @param {Object} [params] 参数 */ Storage.prototype.mod = function (elId, params) { var el = this._elements[elId]; if (el) { - if (!(el instanceof Group)) { - el.style.__rect = null; - } - el.__dirty = true; + + el.modSelf(); if (params) { // 如果第二个参数直接使用 shape - // parent, _storage, __startClip 三个属性会有循环引用 + // parent, _storage, __clipShapes 三个属性会有循环引用 // 主要为了向 1.x 版本兼容,2.x 版本不建议使用第二个参数 - if (params.parent || params._storage || params.__startClip) { + if (params.parent || params._storage || params.__clipShapes) { var target = {}; for (var name in params) { if ( - name == 'parent' || name == '_storage' || name == '__startClip') { + name === 'parent' || name === '_storage' || name === '__clipShapes') { continue; } if (params.hasOwnProperty(name)) { @@ -208,7 +237,8 @@ Storage.prototype.mod = function (elId, params) { } } util.merge(el, target, true); - } else { + } + else { util.merge(el, params, true); } } @@ -218,16 +248,23 @@ Storage.prototype.mod = function (elId, params) { }; /** - * 常规形状位置漂移,形状自身定义漂移函数 - * - * @param {string} idx 形状唯一标识 + * 移动指定的图形(Shape)或者组(Group)的位置 + * @param {string} shapeId 形状唯一标识 + * @param {number} dx + * @param {number} dy */ Storage.prototype.drift = function (shapeId, dx, dy) { var shape = this._elements[shapeId]; if (shape) { shape.needTransform = true; - if (!shape.ondrift //ondrift - //有onbrush并且调用执行返回false或undefined则继续 + if (shape.draggable === 'horizontal') { + dy = 0; + } + else if (shape.draggable === 'vertical') { + dx = 0; + } + if (!shape.ondrift // ondrift + // 有onbrush并且调用执行返回false或undefined则继续 || (shape.ondrift && !shape.ondrift(dx, dy))) { shape.drift(dx, dy); } @@ -239,7 +276,7 @@ Storage.prototype.drift = function (shapeId, dx, dy) { /** * 添加高亮层数据 * - * @param {Object} params 参数 + * @param {module:zrender/shape/Base} shape */ Storage.prototype.addHover = function (shape) { shape.updateNeedTransform(); @@ -248,21 +285,24 @@ Storage.prototype.addHover = function (shape) { }; /** - * 删除高亮层数据 + * 清空高亮层数据 */ Storage.prototype.delHover = function () { this._hoverElements = []; return this; }; +/** + * 是否有图形在高亮层里 + * @return {boolean} + */ Storage.prototype.hasHoverShape = function () { return this._hoverElements.length > 0; }; /** - * 添加到根节点 - * - * @param {Shape|Group} el 参数 + * 添加图形(Shape)或者组(Group)到根节点 + * @param {module:zrender/shape/Shape|module:zrender/Group} el */ Storage.prototype.addRoot = function (el) { if (el instanceof Group) { @@ -273,6 +313,10 @@ Storage.prototype.addRoot = function (el) { this._roots.push(el); }; +/** + * 删除指定的图形(Shape)或者组(Group) + * @param {string|Array.} [elId] 如果为空清空整个Storage + */ Storage.prototype.delRoot = function (elId) { if (typeof(elId) == 'undefined') { // 不指定elId清空 @@ -286,6 +330,8 @@ Storage.prototype.delRoot = function (elId) { this._elements = {}; this._hoverElements = []; this._roots = []; + this._shapeList = []; + this._shapeListOffset = 0; return; } @@ -300,7 +346,8 @@ Storage.prototype.delRoot = function (elId) { var el; if (typeof(elId) == 'string') { el = this._elements[elId]; - } else { + } + else { el = elId; } @@ -314,37 +361,21 @@ Storage.prototype.delRoot = function (elId) { } }; -/** - * 添加 - * - * @param {Shape|Group} el 参数 - */ Storage.prototype.addToMap = function (el) { if (el instanceof Group) { el._storage = this; - } else { - el.style.__rect = null; } + el.modSelf(); this._elements[el.id] = el; return this; }; -/** - * 根据指定的elId获取相应的shape属性 - * - * @param {string=} idx 唯一标识 - */ Storage.prototype.get = function (elId) { return this._elements[elId]; }; -/** - * 删除,elId不指定则全清空 - * - * @param {string} idx 唯一标识 - */ Storage.prototype.delFromMap = function (elId) { var el = this._elements[elId]; if (el) { @@ -360,7 +391,7 @@ Storage.prototype.delFromMap = function (elId) { /** - * 释放 + * 清空并且释放Storage */ Storage.prototype.dispose = function () { this._elements = diff --git a/src/zrender/animation/Animation.js b/src/zrender/animation/Animation.js index 97dcbab..94a6670 100644 --- a/src/zrender/animation/Animation.js +++ b/src/zrender/animation/Animation.js @@ -1,17 +1,9 @@ 'use strict'; /** * 动画主类, 调度和管理所有动画控制器 - * + * + * @module zrender/animation/Animation * @author pissang(https://github.com/pissang) - * - * @class : Animation - * @config : stage(optional) 绘制类, 需要提供update接口 - * @config : onframe(optional) - * @method : add - * @method : remove - * @method : update - * @method : start - * @method : stop */ @@ -27,7 +19,35 @@ function (func) { var arraySlice = Array.prototype.slice; -function Animation(options) { +/** + * @typedef {Object} IZRenderStage + * @property {Function} update + */ + +/** + * @alias module:zrender/animation/Animation + * @constructor + * @param {Object} [options] + * @param {Function} [options.onframe] + * @param {IZRenderStage} [options.stage] + * @example + * var animation = new Animation(); + * var obj = { + * x: 100, + * y: 100 + * }; + * animation.animate(node.position) + * .when(1000, { + * x: 500, + * y: 500 + * }) + * .when(2000, { + * x: 100, + * y: 100 + * }) + * .start('spline'); + */ +var Animation = function (options) { options = options || {}; @@ -44,19 +64,27 @@ function Animation(options) { this._time = 0; Dispatcher.call(this); -} +}; Animation.prototype = { + /** + * 添加动画片段 + * @param {module:zrender/animation/Clip} clip + */ add: function (clip) { this._clips.push(clip); }, + /** + * 删除动画片段 + * @param {module:zrender/animation/Clip} clip + */ remove: function (clip) { var idx = util.indexOf(this._clips, clip); if (idx >= 0) { this._clips.splice(idx, 1); } }, - update: function () { + _update: function () { var time = new Date().getTime(); var delta = time - this._time; @@ -75,9 +103,6 @@ Animation.prototype = { deferredClips.push(clip); } } - if (this.stage.update) { - this.stage.update(); - } // Remove the finished clip for (var i = 0; i < len;) { @@ -85,7 +110,8 @@ Animation.prototype = { clips[i] = clips[len - 1]; clips.pop(); len--; - } else { + } + else { i++; } } @@ -100,7 +126,14 @@ Animation.prototype = { this.onframe(delta); this.dispatch('frame', delta); + + if (this.stage.update) { + this.stage.update(); + } }, + /** + * 开始运行动画 + */ start: function () { var self = this; @@ -108,7 +141,7 @@ Animation.prototype = { function step() { if (self._running) { - self.update(); + self._update(); requestAnimationFrame(step); } } @@ -116,15 +149,32 @@ Animation.prototype = { this._time = new Date().getTime(); requestAnimationFrame(step); }, + /** + * 停止运行动画 + */ stop: function () { this._running = false; }, + /** + * 清除所有动画片段 + */ clear: function () { this._clips = []; }, + /** + * 对一个目标创建一个animator对象,可以指定目标中的属性使用动画 + * @param {Object} target + * @param {Object} options + * @param {boolean} [options.loop=false] 是否循环播放动画 + * @param {Function} [options.getter=null] + * 如果指定getter函数,会通过getter函数取属性值 + * @param {Function} [options.setter=null] + * 如果指定setter函数,会通过setter函数设置属性值 + * @return {module:zrender/animation/Animation~Animator} + */ animate: function (target, options) { options = options || {}; - var deferred = new Deferred( + var deferred = new Animator( target, options.loop, options.getter, options.setter); deferred.animation = this; return deferred; @@ -152,7 +202,8 @@ function _interpolateArray(p0, p1, percent, out, arrDim) { for (var i = 0; i < len; i++) { out[i] = _interpolateNumber(p0[i], p1[i], percent); } - } else { + } + else { var len2 = p0[0].length; for (var i = 0; i < len; i++) { for (var j = 0; j < len2; j++) { @@ -181,7 +232,8 @@ p0, p1, p2, p3, t, t2, t3, out, arrDim) { out[i] = _catmullRomInterpolate( p0[i], p1[i], p2[i], p3[i], t, t2, t3); } - } else { + } + else { var len2 = p0[0].length; for (var i = 0; i < len; i++) { for (var j = 0; j < len2; j++) { @@ -207,10 +259,12 @@ function _cloneValue(value) { ret.push(arraySlice.call(value[i])); } return ret; - } else { + } + else { return arraySlice.call(value); } - } else { + } + else { return value; } } @@ -223,7 +277,15 @@ function rgba2String(rgba) { return 'rgba(' + rgba.join(',') + ')'; } -function Deferred(target, loop, getter, setter) { +/** + * @alias module:zrender/animation/Animation~Animator + * @constructor + * @param {Object} target + * @param {boolean} loop + * @param {Function} getter + * @param {Function} setter + */ +var Animator = function (target, loop, getter, setter) { this._tracks = {}; this._target = target; @@ -241,9 +303,15 @@ function Deferred(target, loop, getter, setter) { this._onframeList = []; this._clipList = []; -} +}; -Deferred.prototype = { +Animator.prototype = { + /** + * 设置动画关键帧 + * @param {number} time 关键帧时间,单位是ms + * @param {Object} props 关键帧的属性值,key-value表示 + * @return {module:zrender/animation/Animation~Animator} + */ when: function (time /* ms */ , props) { for (var propName in props) { if (!this._tracks[propName]) { @@ -267,16 +335,26 @@ Deferred.prototype = { } return this; }, + /** + * 添加动画每一帧的回调函数 + * @param {Function} callback + * @return {module:zrender/animation/Animation~Animator} + */ during: function (callback) { this._onframeList.push(callback); return this; }, + /** + * 开始执行动画 + * @param {string|Function} easing + * 动画缓动函数,详见{@link module:zrender/animation/easing} + * @return {module:zrender/animation/Animation~Animator} + */ start: function (easing) { var self = this; var setter = this._setter; var getter = this._getter; - var onFrameListLen = self._onframeList.length; var useSpline = easing === 'spline'; var ondestroy = function () { @@ -312,7 +390,8 @@ Deferred.prototype = { var trackMaxTime; if (trackLen) { trackMaxTime = keyframes[trackLen - 1].time; - } else { + } + else { return; } // Percents of each keyframe @@ -339,8 +418,12 @@ Deferred.prototype = { var cacheKey = 0; var cachePercent = 0; var start; - var i, w; - var p0, p1, p2, p3; + var i; + var w; + var p0; + var p1; + var p2; + var p3; if (isValueColor) { @@ -360,7 +443,8 @@ Deferred.prototype = { } } i = Math.min(i, trackLen - 2); - } else { + } + else { for (i = cacheKey; i < trackLen; i++) { if (kfPercents[i] > percent) { break; @@ -374,7 +458,8 @@ Deferred.prototype = { var range = (kfPercents[i + 1] - kfPercents[i]); if (range === 0) { return; - } else { + } + else { w = (percent - kfPercents[i]) / range; } if (useSpline) { @@ -385,30 +470,35 @@ Deferred.prototype = { if (isValueArray) { _catmullRomInterpolateArray( p0, p1, p2, p3, w, w * w, w * w * w, getter(target, propName), arrDim); - } else { + } + else { var value; if (isValueColor) { value = _catmullRomInterpolateArray( p0, p1, p2, p3, w, w * w, w * w * w, rgba, 1); value = rgba2String(rgba); - } else { + } + else { value = _catmullRomInterpolate( p0, p1, p2, p3, w, w * w, w * w * w); } setter( target, propName, value); } - } else { + } + else { if (isValueArray) { _interpolateArray( kfValues[i], kfValues[i + 1], w, getter(target, propName), arrDim); - } else { + } + else { var value; if (isValueColor) { _interpolateArray( kfValues[i], kfValues[i + 1], w, rgba, 1); value = rgba2String(rgba); - } else { + } + else { value = _interpolateNumber(kfValues[i], kfValues[i + 1], w); } setter( @@ -416,7 +506,7 @@ Deferred.prototype = { } } - for (i = 0; i < onFrameListLen; i++) { + for (i = 0; i < self._onframeList.length; i++) { self._onframeList[i](target, percent); } }; @@ -443,6 +533,9 @@ Deferred.prototype = { } return this; }, + /** + * 停止动画 + */ stop: function () { for (var i = 0; i < this._clipList.length; i++) { var clip = this._clipList[i]; @@ -450,12 +543,24 @@ Deferred.prototype = { } this._clipList = []; }, + /** + * 设置动画延迟开始的时间 + * @param {number} time 单位ms + * @return {module:zrender/animation/Animation~Animator} + */ delay: function (time) { this._delay = time; return this; }, - done: function (func) { - this._doneList.push(func); + /** + * 添加动画结束的回调 + * @param {Function} cb + * @return {module:zrender/animation/Animation~Animator} + */ + done: function (cb) { + if (cb) { + this._doneList.push(cb); + } return this; } }; diff --git a/src/zrender/animation/Clip.js b/src/zrender/animation/Clip.js index 9f127cb..c26f163 100644 --- a/src/zrender/animation/Clip.js +++ b/src/zrender/animation/Clip.js @@ -21,17 +21,16 @@ function Clip(options) { this._targetPool = [this._targetPool]; } - //生命周期 + // 生命周期 this._life = options.life || 1000; - //延时 + // 延时 this._delay = options.delay || 0; - //开始时间 - this._startTime = new Date().getTime() + this._delay; //单位毫秒 - - //结束时间 + // 开始时间 + this._startTime = new Date().getTime() + this._delay; // 单位毫秒 + // 结束时间 this._endTime = this._startTime + this._life * 1000; - //是否循环 + // 是否循环 this.loop = typeof options.loop == 'undefined' ? false : options.loop; this.gap = options.gap || 0; @@ -47,7 +46,7 @@ Clip.prototype = { step: function (time) { var percent = (time - this._startTime) / this._life; - //还没开始 + // 还没开始 if (percent < 0) { return; } @@ -66,7 +65,6 @@ Clip.prototype = { // 重新开始周期 // 抛出而不是直接调用事件直到 stage.update 后再统一调用这些事件 return 'restart'; - } // 动画完成将这个控制器标识为待删除 @@ -81,6 +79,8 @@ Clip.prototype = { var time = new Date().getTime(); var remainder = (time - this._startTime) % this._life; this._startTime = new Date().getTime() - remainder + this.gap; + + this._needsRemove = false; }, fire: function (eventType, arg) { for (var i = 0, len = this._targetPool.length; i < len; i++) { diff --git a/src/zrender/animation/easing.js b/src/zrender/animation/easing.js index 0934ae0..9d9986c 100644 --- a/src/zrender/animation/easing.js +++ b/src/zrender/animation/easing.js @@ -1,21 +1,37 @@ /** * 缓动代码来自 https://github.com/sole/tween.js/blob/master/src/Tween.js - * author: lang(shenyi01@baidu.com) + * @see http://sole.github.io/tween.js/examples/03_graphs.html + * @exports zrender/animation/easing */ - -var Easing = { +var easing = { // 线性 + /** + * @param {number} k + * @return {number} + */ Linear: function (k) { return k; }, // 二次方的缓动(t^2) + /** + * @param {number} k + * @return {number} + */ QuadraticIn: function (k) { return k * k; }, + /** + * @param {number} k + * @return {number} + */ QuadraticOut: function (k) { return k * (2 - k); }, + /** + * @param {number} k + * @return {number} + */ QuadraticInOut: function (k) { if ((k *= 2) < 1) { return 0.5 * k * k; @@ -24,12 +40,24 @@ var Easing = { }, // 三次方的缓动(t^3) + /** + * @param {number} k + * @return {number} + */ CubicIn: function (k) { return k * k * k; }, + /** + * @param {number} k + * @return {number} + */ CubicOut: function (k) { return --k * k * k + 1; }, + /** + * @param {number} k + * @return {number} + */ CubicInOut: function (k) { if ((k *= 2) < 1) { return 0.5 * k * k * k; @@ -38,12 +66,24 @@ var Easing = { }, // 四次方的缓动(t^4) + /** + * @param {number} k + * @return {number} + */ QuarticIn: function (k) { return k * k * k * k; }, + /** + * @param {number} k + * @return {number} + */ QuarticOut: function (k) { return 1 - (--k * k * k * k); }, + /** + * @param {number} k + * @return {number} + */ QuarticInOut: function (k) { if ((k *= 2) < 1) { return 0.5 * k * k * k * k; @@ -52,13 +92,24 @@ var Easing = { }, // 五次方的缓动(t^5) + /** + * @param {number} k + * @return {number} + */ QuinticIn: function (k) { return k * k * k * k * k; }, - + /** + * @param {number} k + * @return {number} + */ QuinticOut: function (k) { return --k * k * k * k * k + 1; }, + /** + * @param {number} k + * @return {number} + */ QuinticInOut: function (k) { if ((k *= 2) < 1) { return 0.5 * k * k * k * k * k; @@ -67,23 +118,47 @@ var Easing = { }, // 正弦曲线的缓动(sin(t)) + /** + * @param {number} k + * @return {number} + */ SinusoidalIn: function (k) { return 1 - Math.cos(k * Math.PI / 2); }, + /** + * @param {number} k + * @return {number} + */ SinusoidalOut: function (k) { return Math.sin(k * Math.PI / 2); }, + /** + * @param {number} k + * @return {number} + */ SinusoidalInOut: function (k) { return 0.5 * (1 - Math.cos(Math.PI * k)); }, // 指数曲线的缓动(2^t) + /** + * @param {number} k + * @return {number} + */ ExponentialIn: function (k) { return k === 0 ? 0 : Math.pow(1024, k - 1); }, + /** + * @param {number} k + * @return {number} + */ ExponentialOut: function (k) { return k === 1 ? 1 : 1 - Math.pow(2, -10 * k); }, + /** + * @param {number} k + * @return {number} + */ ExponentialInOut: function (k) { if (k === 0) { return 0; @@ -98,12 +173,24 @@ var Easing = { }, // 圆形曲线的缓动(sqrt(1-t^2)) + /** + * @param {number} k + * @return {number} + */ CircularIn: function (k) { return 1 - Math.sqrt(1 - k * k); }, + /** + * @param {number} k + * @return {number} + */ CircularOut: function (k) { return Math.sqrt(1 - (--k * k)); }, + /** + * @param {number} k + * @return {number} + */ CircularInOut: function (k) { if ((k *= 2) < 1) { return -0.5 * (Math.sqrt(1 - k * k) - 1); @@ -112,9 +199,14 @@ var Easing = { }, // 创建类似于弹簧在停止前来回振荡的动画 + /** + * @param {number} k + * @return {number} + */ ElasticIn: function (k) { - var s, a = 0.1, - p = 0.4; + var s; + var a = 0.1; + var p = 0.4; if (k === 0) { return 0; } @@ -124,14 +216,20 @@ var Easing = { if (!a || a < 1) { a = 1; s = p / 4; - } else { + } + else { s = p * Math.asin(1 / a) / (2 * Math.PI); } return -(a * Math.pow(2, 10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p)); }, + /** + * @param {number} k + * @return {number} + */ ElasticOut: function (k) { - var s, a = 0.1, - p = 0.4; + var s; + var a = 0.1; + var p = 0.4; if (k === 0) { return 0; } @@ -147,9 +245,14 @@ var Easing = { } return (a * Math.pow(2, -10 * k) * Math.sin((k - s) * (2 * Math.PI) / p) + 1); }, + /** + * @param {number} k + * @return {number} + */ ElasticInOut: function (k) { - var s, a = 0.1, - p = 0.4; + var s; + var a = 0.1; + var p = 0.4; if (k === 0) { return 0; } @@ -171,14 +274,26 @@ var Easing = { }, // 在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动 + /** + * @param {number} k + * @return {number} + */ BackIn: function (k) { var s = 1.70158; return k * k * ((s + 1) * k - s); }, + /** + * @param {number} k + * @return {number} + */ BackOut: function (k) { var s = 1.70158; return --k * k * ((s + 1) * k + s) + 1; }, + /** + * @param {number} k + * @return {number} + */ BackInOut: function (k) { var s = 1.70158 * 1.525; if ((k *= 2) < 1) { @@ -188,27 +303,41 @@ var Easing = { }, // 创建弹跳效果 + /** + * @param {number} k + * @return {number} + */ BounceIn: function (k) { - return 1 - Easing.BounceOut(1 - k); + return 1 - easing.BounceOut(1 - k); }, + /** + * @param {number} k + * @return {number} + */ BounceOut: function (k) { if (k < (1 / 2.75)) { return 7.5625 * k * k; } else if (k < (2 / 2.75)) { return 7.5625 * (k -= (1.5 / 2.75)) * k + 0.75; - } else if (k < (2.5 / 2.75)) { + } + else if (k < (2.5 / 2.75)) { return 7.5625 * (k -= (2.25 / 2.75)) * k + 0.9375; - } else { + } + else { return 7.5625 * (k -= (2.625 / 2.75)) * k + 0.984375; } }, + /** + * @param {number} k + * @return {number} + */ BounceInOut: function (k) { if (k < 0.5) { - return Easing.BounceIn(k * 2) * 0.5; + return easing.BounceIn(k * 2) * 0.5; } - return Easing.BounceOut(k * 2 - 1) * 0.5 + 0.5; + return easing.BounceOut(k * 2 - 1) * 0.5 + 0.5; } }; -module.exports = Easing; \ No newline at end of file +module.exports = easing; \ No newline at end of file diff --git a/src/zrender/config.js b/src/zrender/config.js index fe4d95e..abb71e6 100644 --- a/src/zrender/config.js +++ b/src/zrender/config.js @@ -1,50 +1,101 @@ /** - * zrender: config默认配置项 - * - * @desc zrender是一个轻量级的Canvas类库,MVC封装,数据驱动,提供类Dom事件模型。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * + * config默认配置项 + * @exports zrender/config + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) */ -module.exports = { - EVENT: { // 支持事件列表 +var config = { + /** + * @namespace module:zrender/config.EVENT + */ + EVENT: { + /** + * 窗口大小变化 + * @type {string} + */ RESIZE: 'resize', - // 窗口大小变化 + /** + * 鼠标按钮被(手指)按下,事件对象是:目标图形元素或空 + * @type {string} + */ CLICK: 'click', - // 鼠标按钮被(手指)按下,事件对象是:目标图形元素或空 - + /** + * 双击事件 + * @type {string} + */ + DBLCLICK: 'dblclick', + /** + * 鼠标滚轮变化,事件对象是:目标图形元素或空 + * @type {string} + */ MOUSEWHEEL: 'mousewheel', - // 鼠标滚轮变化,事件对象是:目标图形元素或空 + /** + * 鼠标(手指)被移动,事件对象是:目标图形元素或空 + * @type {string} + */ MOUSEMOVE: 'mousemove', - // 鼠标(手指)被移动,事件对象是:目标图形元素或空 + /** + * 鼠标移到某图形元素之上,事件对象是:目标图形元素 + * @type {string} + */ MOUSEOVER: 'mouseover', - // 鼠标移到某图形元素之上,事件对象是:目标图形元素 + /** + * 鼠标从某图形元素移开,事件对象是:目标图形元素 + * @type {string} + */ MOUSEOUT: 'mouseout', - // 鼠标从某图形元素移开,事件对象是:目标图形元素 + /** + * 鼠标按钮(手指)被按下,事件对象是:目标图形元素或空 + * @type {string} + */ MOUSEDOWN: 'mousedown', - // 鼠标按钮(手指)被按下,事件对象是:目标图形元素或空 + /** + * 鼠标按键(手指)被松开,事件对象是:目标图形元素或空 + * @type {string} + */ MOUSEUP: 'mouseup', - // 鼠标按键(手指)被松开,事件对象是:目标图形元素或空 - - // + /** + * 全局离开,MOUSEOUT触发比较频繁,一次离开优化绑定 + * @type {string} + */ GLOBALOUT: 'globalout', - // 全局离开,MOUSEOUT触发比较频繁,一次离开优化绑定 - + // // 一次成功元素拖拽的行为事件过程是: // dragstart > dragenter > dragover [> dragleave] > drop > dragend + /** + * 开始拖拽时触发,事件对象是:被拖拽图形元素 + * @type {string} + */ DRAGSTART: 'dragstart', - // 开始拖拽时触发,事件对象是:被拖拽图形元素 + /** + * 拖拽完毕时触发(在drop之后触发),事件对象是:被拖拽图形元素 + * @type {string} + */ DRAGEND: 'dragend', - // 拖拽完毕时触发(在drop之后触发),事件对象是:被拖拽图形元素 + /** + * 拖拽图形元素进入目标图形元素时触发,事件对象是:目标图形元素 + * @type {string} + */ DRAGENTER: 'dragenter', - // 拖拽图形元素进入目标图形元素时触发,事件对象是:目标图形元素 + /** + * 拖拽图形元素在目标图形元素上移动时触发,事件对象是:目标图形元素 + * @type {string} + */ DRAGOVER: 'dragover', - // 拖拽图形元素在目标图形元素上移动时触发,事件对象是:目标图形元素 + /** + * 拖拽图形元素离开目标图形元素时触发,事件对象是:目标图形元素 + * @type {string} + */ DRAGLEAVE: 'dragleave', - // 拖拽图形元素离开目标图形元素时触发,事件对象是:目标图形元素 + /** + * 拖拽图形元素放在目标图形元素内时触发,事件对象是:目标图形元素 + * @type {string} + */ DROP: 'drop', - // 拖拽图形元素放在目标图形元素内时触发,事件对象是:目标图形元素 - - touchClickDelay: 300 // touch end - start < delay is click + /** + * touch end - start < delay is click + * @type {number} + */ + touchClickDelay: 300 }, // 是否异常捕获 @@ -56,5 +107,9 @@ module.exports = { * 1 : 异常抛出,调试用 * 2 : 控制台输出,调试用 */ - debugMode: 0 -} \ No newline at end of file + debugMode: 0, + + // retina 屏幕优化 + devicePixelRatio: Math.max(window.devicePixelRatio || 1, 1) +}; +module.exports = config; \ No newline at end of file diff --git a/src/zrender/lib/excanvas.js b/src/zrender/dep/excanvas.js similarity index 98% rename from src/zrender/lib/excanvas.js rename to src/zrender/dep/excanvas.js index f91950c..5c57434 100644 --- a/src/zrender/lib/excanvas.js +++ b/src/zrender/dep/excanvas.js @@ -247,8 +247,8 @@ if (!document.createElement('canvas').getContext) { o2.font = o1.font; o2.textAlign = o1.textAlign; o2.textBaseline = o1.textBaseline; - o2.arcScaleX_ = o1.arcScaleX_; - o2.arcScaleY_ = o1.arcScaleY_; + o2.scaleX_ = o1.scaleX_; + o2.scaleY_ = o1.scaleY_; o2.lineScale_ = o1.lineScale_; } @@ -594,8 +594,8 @@ if (!document.createElement('canvas').getContext) { canvasElement.appendChild(overlayEl); this.element_ = el; - this.arcScaleX_ = 1; - this.arcScaleY_ = 1; + this.scaleX_ = 1; + this.scaleY_ = 1; this.lineScale_ = 1; } @@ -834,9 +834,8 @@ if (!document.createElement('canvas').getContext) { if (this.m_[0][0] != 1 || this.m_[0][1] || this.m_[1][1] != 1 || this.m_[1][0]) { var filter = []; - scaleX = Math.sqrt(this.m_[0][0] * this.m_[0][0] + this.m_[0][1] * this.m_[0][1]); - scaleY = Math.sqrt(this.m_[1][0] * this.m_[1][0] + this.m_[1][1] * this.m_[1][1]); - + var scaleX = this.scaleX_; + var scaleY = this.scaleY_; // Note the 12/21 reversal filter.push('M11=', this.m_[0][0] / scaleX, ',', 'M12=', this.m_[1][0] / scaleY, ',', 'M21=', this.m_[0][1] / scaleX, ',', 'M22=', this.m_[1][1] / scaleY, ',', 'Dx=', mr(d.x / Z), ',', 'Dy=', mr(d.y / Z), ''); @@ -850,7 +849,7 @@ if (!document.createElement('canvas').getContext) { max.x = m.max(max.x, c2.x, c3.x, c4.x); max.y = m.max(max.y, c2.y, c3.y, c4.y); - vmlStr.push('padding:0 ', mr(max.x / Z), 'px ', mr(max.y / Z), 'px 0;filter:progid:DXImageTransform.Microsoft.Matrix(', filter.join(''), ", sizingmethod='clip');"); + vmlStr.push('padding:0 ', mr(max.x / Z), 'px ', mr(max.y / Z), 'px 0;filter:progid:DXImageTransform.Microsoft.Matrix(', filter.join(''), ", SizingMethod='clip');"); } else { vmlStr.push('top:', mr(d.y / Z), 'px;left:', mr(d.x / Z), 'px;'); @@ -923,7 +922,7 @@ if (!document.createElement('canvas').getContext) { break; case 'at': case 'wa': - lineStr.push(' ', p.type, ' ', mr(p.x - this.arcScaleX_ * p.radius), ',', mr(p.y - this.arcScaleY_ * p.radius), ' ', mr(p.x + this.arcScaleX_ * p.radius), ',', mr(p.y + this.arcScaleY_ * p.radius), ' ', mr(p.xStart), ',', mr(p.yStart), ' ', mr(p.xEnd), ',', mr(p.yEnd)); + lineStr.push(' ', p.type, ' ', mr(p.x - this.scaleX_ * p.radius), ',', mr(p.y - this.scaleY_ * p.radius), ' ', mr(p.x + this.scaleX_ * p.radius), ',', mr(p.y + this.scaleY_ * p.radius), ' ', mr(p.xStart), ',', mr(p.yStart), ' ', mr(p.xEnd), ',', mr(p.yEnd)); break; } @@ -977,8 +976,8 @@ if (!document.createElement('canvas').getContext) { function appendFill(ctx, lineStr, min, max) { var fillStyle = ctx.fillStyle; - var arcScaleX = ctx.arcScaleX_; - var arcScaleY = ctx.arcScaleY_; + var arcScaleX = ctx.scaleX_; + var arcScaleY = ctx.scaleY_; var width = max.x - min.x; var height = max.y - min.y; if (fillStyle instanceof CanvasGradient_) { @@ -1111,6 +1110,9 @@ if (!document.createElement('canvas').getContext) { } ctx.m_ = m; + ctx.scaleX_ = Math.sqrt(m[0][0] * m[0][0] + m[0][1] * m[0][1]); + ctx.scaleY_ = Math.sqrt(m[1][0] * m[1][0] + m[1][1] * m[1][1]); + if (updateLineScale) { // Get the line scale. // Determinant of this.m_ means how much the area is enlarged by the @@ -1145,8 +1147,6 @@ if (!document.createElement('canvas').getContext) { }; contextPrototype.scale = function (aX, aY) { - this.arcScaleX_ *= aX; - this.arcScaleY_ *= aY; var m1 = [ [aX, 0, 0], [0, aY, 0], @@ -1164,6 +1164,7 @@ if (!document.createElement('canvas').getContext) { ]; setM(this, matrixMultiply(m1, this.m_), true); + }; contextPrototype.setTransform = function (m11, m12, m21, m22, dx, dy) { @@ -1282,7 +1283,12 @@ if (!document.createElement('canvas').getContext) { } var doc = this.element_.ownerDocument; this.textMeasureEl_.innerHTML = ''; - this.textMeasureEl_.style.font = this.font; + try { + this.textMeasureEl_.style.font = this.font; + } catch (ex) { + // Ignore failures to set to invalid font. + } + // Don't use innerHTML or innerText because they allow markup/whitespace. this.textMeasureEl_.appendChild(doc.createTextNode(text)); return { diff --git a/src/zrender/dep/excanvas2.js b/src/zrender/dep/excanvas2.js new file mode 100644 index 0000000..77189b0 --- /dev/null +++ b/src/zrender/dep/excanvas2.js @@ -0,0 +1,2131 @@ +// Copyright 2006 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Known Issues: +// +// * Patterns only support repeat. +// * Radial gradient are not implemented. The VML version of these look very +// different from the canvas one. +// * Clipping paths are not implemented. +// * Coordsize. The width and height attribute have higher priority than the +// width and height style values which isn't correct. +// * Painting mode isn't implemented. +// * Canvas width/height should is using content-box by default. IE in +// Quirks mode will draw the canvas using border-box. Either change your +// doctype to HTML5 +// (http://www.whatwg.org/specs/web-apps/current-work/#the-doctype) +// or use Box Sizing Behavior from WebFX +// (http://webfx.eae.net/dhtml/boxsizing/boxsizing.html) +// * Non uniform scaling does not correctly scale strokes. +// * Optimize. There is always room for speed improvements. +// AMD by kener.linfeng@gmail.com +// Optimized by https://github.com/pissang +// +// NOTES http://jsperf.com/dom-attr-read-perf/2 +// http://jsperf.com/arr-vs-obj-in-ie + +// Only add this code if we do not already have a canvas implementation +if (!document.createElement('canvas').getContext) { + + (function () { + + // alias some functions to make (compiled) code shorter + var m = Math; + var mr = m.round; + var ms = m.sin; + var mc = m.cos; + var abs = m.abs; + var sqrt = m.sqrt; + + // this is used for sub pixel precision + var Z = 10; + var Z2 = Z / 2; + + var IE_VERSION = +navigator.userAgent.match(/MSIE ([\d.]+)?/)[1]; + + var EPSILON = 1e-5; + var isAroundZero = function (val) { + return val > -EPSILON && val < EPSILON; + } + + function isNotAroundZero(val) { + return val > EPSILON || val < -EPSILON; + } + + /** + * This funtion is assigned to the elements as element.getContext(). + * @this {HTMLElement} + * @return {CanvasRenderingContext2D_} + */ + + function getContext() { + return this.context_ || (this.context_ = new CanvasRenderingContext2D_(this)); + } + + var slice = Array.prototype.slice; + + /** + * Binds a function to an object. The returned function will always use the + * passed in {@code obj} as {@code this}. + * + * Example: + * + * g = bind(f, obj, a, b) + * g(c, d) // will do f.call(obj, a, b, c, d) + * + * @param {Function} f The function to bind the object to + * @param {Object} obj The object that should act as this when the function + * is called + * @param {*} var_args Rest arguments that will be used as the initial + * arguments when the function is called + * @return {Function} A new function that has bound this + */ + + function bind(f, obj, var_args) { + var a = slice.call(arguments, 2); + return function () { + return f.apply(obj, a.concat(slice.call(arguments))); + }; + } + + function encodeHtmlAttribute(s) { + return String(s).replace(/&/g, '&').replace(/"/g, '"'); + } + + function addNamespace(doc, prefix, urn) { + if (!doc.namespaces[prefix]) { + // NOTES, It will not work proply if add '#default#VML' + // When using appendChild to add dom + // doc.namespaces.add(prefix, urn, '#default#VML'); + doc.namespaces.add(prefix, urn); + } + } + + function addNamespacesAndStylesheet(doc) { + addNamespace(doc, 'g_vml_', 'urn:schemas-microsoft-com:vml'); + addNamespace(doc, 'g_o_', 'urn:schemas-microsoft-com:office:office'); + + // Setup default CSS. Only add one style sheet per document + if (!doc.styleSheets['ex_canvas_']) { + var ss = doc.createStyleSheet(); + ss.owningElement.id = 'ex_canvas_'; + ss.cssText = 'canvas{display:inline-block;overflow:hidden;' + + // default size is 300x150 in Gecko and Opera + 'text-align:left;width:300px;height:150px} .g_vml_ {behavior:url(#default#VML);}'; + } + } + + function createVMLElement(tagName) { + // NOTES Why using createElement needs to add behavior:url(#default#VML) in style + var dom = document.createElement(''); + return dom; + + } + + // Add namespaces and stylesheet at startup. + addNamespacesAndStylesheet(document); + + var G_vmlCanvasManager_ = { + init: function (opt_doc) { + var doc = opt_doc || document; + // Create a dummy element so that IE will allow canvas elements to be + // recognized. + doc.createElement('canvas'); + doc.attachEvent('onreadystatechange', bind(this.init_, this, doc)); + }, + + init_: function (doc) { + // find all canvas elements + var els = doc.getElementsByTagName('canvas'); + for (var i = 0; i < els.length; i++) { + this.initElement(els[i]); + } + }, + + /** + * Public initializes a canvas element so that it can be used as canvas + * element from now on. This is called automatically before the page is + * loaded but if you are creating elements using createElement you need to + * make sure this is called on the element. + * @param {HTMLElement} el The canvas element to initialize. + * @return {HTMLElement} the element that was created. + */ + initElement: function (el) { + if (!el.getContext) { + el.getContext = getContext; + + // Add namespaces and stylesheet to document of the element. + addNamespacesAndStylesheet(el.ownerDocument); + + // Remove fallback content. There is no way to hide text nodes so we + // just remove all childNodes. We could hide all elements and remove + // text nodes but who really cares about the fallback content. + el.innerHTML = ''; + + // do not use inline function because that will leak memory + el.attachEvent('onpropertychange', onPropertyChange); + el.attachEvent('onresize', onResize); + + var attrs = el.attributes; + if (attrs.width && attrs.width.specified) { + // TODO: use runtimeStyle and coordsize + // el.getContext().setWidth_(attrs.width.nodeValue); + el.style.width = attrs.width.nodeValue + 'px'; + } else { + el.width = el.clientWidth; + } + if (attrs.height && attrs.height.specified) { + // TODO: use runtimeStyle and coordsize + // el.getContext().setHeight_(attrs.height.nodeValue); + el.style.height = attrs.height.nodeValue + 'px'; + } else { + el.height = el.clientHeight; + } + //el.getContext().setCoordsize_() + } + return el; + } + }; + + function onPropertyChange(e) { + var el = e.srcElement; + + switch (e.propertyName) { + case 'width': + el.getContext().clearRect(); + el.style.width = el.attributes.width.nodeValue + 'px'; + // In IE8 this does not trigger onresize. + el.firstChild.style.width = el.clientWidth + 'px'; + break; + case 'height': + el.getContext().clearRect(); + el.style.height = el.attributes.height.nodeValue + 'px'; + el.firstChild.style.height = el.clientHeight + 'px'; + break; + } + } + + function onResize(e) { + var el = e.srcElement; + if (el.firstChild) { + el.firstChild.style.width = el.clientWidth + 'px'; + el.firstChild.style.height = el.clientHeight + 'px'; + } + } + + G_vmlCanvasManager_.init(); + + // precompute "00" to "FF" + var decToHex = []; + for (var i = 0; i < 16; i++) { + for (var j = 0; j < 16; j++) { + decToHex[i * 16 + j] = i.toString(16) + j.toString(16); + } + } + + function createMatrixIdentity() { + return [[1, 0, 0], [0, 1, 0], [0, 0, 1]]; + } + + function matrixMultiply(m1, m2) { + var result = createMatrixIdentity(); + + for (var x = 0; x < 3; x++) { + for (var y = 0; y < 3; y++) { + var sum = 0; + + for (var z = 0; z < 3; z++) { + sum += m1[x][z] * m2[z][y]; + } + + result[x][y] = sum; + } + } + return result; + } + + + function copyState(o1, o2) { + o2.fillStyle = o1.fillStyle; + o2.lineCap = o1.lineCap; + o2.lineJoin = o1.lineJoin; + o2.lineWidth = o1.lineWidth; + o2.miterLimit = o1.miterLimit; + o2.strokeStyle = o1.strokeStyle; + o2.globalAlpha = o1.globalAlpha; + o2.font = o1.font; + o2.textAlign = o1.textAlign; + o2.textBaseline = o1.textBaseline; + o2.scaleX_ = o1.scaleX_; + o2.scaleY_ = o1.scaleY_; + o2.x_ = o1.x_; + o2.y_ = o1.y_; + o2.lineScale_ = o1.lineScale_; + } + + var colorData = { + aliceblue: '#F0F8FF', + antiquewhite: '#FAEBD7', + aquamarine: '#7FFFD4', + azure: '#F0FFFF', + beige: '#F5F5DC', + bisque: '#FFE4C4', + black: '#000000', + blanchedalmond: '#FFEBCD', + blueviolet: '#8A2BE2', + brown: '#A52A2A', + burlywood: '#DEB887', + cadetblue: '#5F9EA0', + chartreuse: '#7FFF00', + chocolate: '#D2691E', + coral: '#FF7F50', + cornflowerblue: '#6495ED', + cornsilk: '#FFF8DC', + crimson: '#DC143C', + cyan: '#00FFFF', + darkblue: '#00008B', + darkcyan: '#008B8B', + darkgoldenrod: '#B8860B', + darkgray: '#A9A9A9', + darkgreen: '#006400', + darkgrey: '#A9A9A9', + darkkhaki: '#BDB76B', + darkmagenta: '#8B008B', + darkolivegreen: '#556B2F', + darkorange: '#FF8C00', + darkorchid: '#9932CC', + darkred: '#8B0000', + darksalmon: '#E9967A', + darkseagreen: '#8FBC8F', + darkslateblue: '#483D8B', + darkslategray: '#2F4F4F', + darkslategrey: '#2F4F4F', + darkturquoise: '#00CED1', + darkviolet: '#9400D3', + deeppink: '#FF1493', + deepskyblue: '#00BFFF', + dimgray: '#696969', + dimgrey: '#696969', + dodgerblue: '#1E90FF', + firebrick: '#B22222', + floralwhite: '#FFFAF0', + forestgreen: '#228B22', + gainsboro: '#DCDCDC', + ghostwhite: '#F8F8FF', + gold: '#FFD700', + goldenrod: '#DAA520', + grey: '#808080', + greenyellow: '#ADFF2F', + honeydew: '#F0FFF0', + hotpink: '#FF69B4', + indianred: '#CD5C5C', + indigo: '#4B0082', + ivory: '#FFFFF0', + khaki: '#F0E68C', + lavender: '#E6E6FA', + lavenderblush: '#FFF0F5', + lawngreen: '#7CFC00', + lemonchiffon: '#FFFACD', + lightblue: '#ADD8E6', + lightcoral: '#F08080', + lightcyan: '#E0FFFF', + lightgoldenrodyellow: '#FAFAD2', + lightgreen: '#90EE90', + lightgrey: '#D3D3D3', + lightpink: '#FFB6C1', + lightsalmon: '#FFA07A', + lightseagreen: '#20B2AA', + lightskyblue: '#87CEFA', + lightslategray: '#778899', + lightslategrey: '#778899', + lightsteelblue: '#B0C4DE', + lightyellow: '#FFFFE0', + limegreen: '#32CD32', + linen: '#FAF0E6', + magenta: '#FF00FF', + mediumaquamarine: '#66CDAA', + mediumblue: '#0000CD', + mediumorchid: '#BA55D3', + mediumpurple: '#9370DB', + mediumseagreen: '#3CB371', + mediumslateblue: '#7B68EE', + mediumspringgreen: '#00FA9A', + mediumturquoise: '#48D1CC', + mediumvioletred: '#C71585', + midnightblue: '#191970', + mintcream: '#F5FFFA', + mistyrose: '#FFE4E1', + moccasin: '#FFE4B5', + navajowhite: '#FFDEAD', + oldlace: '#FDF5E6', + olivedrab: '#6B8E23', + orange: '#FFA500', + orangered: '#FF4500', + orchid: '#DA70D6', + palegoldenrod: '#EEE8AA', + palegreen: '#98FB98', + paleturquoise: '#AFEEEE', + palevioletred: '#DB7093', + papayawhip: '#FFEFD5', + peachpuff: '#FFDAB9', + peru: '#CD853F', + pink: '#FFC0CB', + plum: '#DDA0DD', + powderblue: '#B0E0E6', + rosybrown: '#BC8F8F', + royalblue: '#4169E1', + saddlebrown: '#8B4513', + salmon: '#FA8072', + sandybrown: '#F4A460', + seagreen: '#2E8B57', + seashell: '#FFF5EE', + sienna: '#A0522D', + skyblue: '#87CEEB', + slateblue: '#6A5ACD', + slategray: '#708090', + slategrey: '#708090', + snow: '#FFFAFA', + springgreen: '#00FF7F', + steelblue: '#4682B4', + tan: '#D2B48C', + thistle: '#D8BFD8', + tomato: '#FF6347', + turquoise: '#40E0D0', + violet: '#EE82EE', + wheat: '#F5DEB3', + whitesmoke: '#F5F5F5', + yellowgreen: '#9ACD32' + }; + + function getRgbHslContent(styleString) { + var start = styleString.indexOf('(', 3); + var end = styleString.indexOf(')', start + 1); + var parts = styleString.substring(start + 1, end).split(','); + // add alpha if needed + if (parts.length != 4 || styleString.charAt(3) != 'a') { + parts[3] = 1; + } + return parts; + } + + function percent(s) { + return parseFloat(s) / 100; + } + + function clamp(v, min, max) { + return Math.min(max, Math.max(min, v)); + } + + function hslToRgb(parts) { + var r, g, b, h, s, l; + h = parseFloat(parts[0]) / 360 % 360; + if (h < 0) h++; + s = clamp(percent(parts[1]), 0, 1); + l = clamp(percent(parts[2]), 0, 1); + if (s == 0) { + r = g = b = l; // achromatic + } else { + var q = l < 0.5 ? l * (1 + s) : l + s - l * s; + var p = 2 * l - q; + r = hueToRgb(p, q, h + 1 / 3); + g = hueToRgb(p, q, h); + b = hueToRgb(p, q, h - 1 / 3); + } + + return '#' + decToHex[Math.floor(r * 255)] + decToHex[Math.floor(g * 255)] + decToHex[Math.floor(b * 255)]; + } + + function hueToRgb(m1, m2, h) { + if (h < 0) h++; + if (h > 1) h--; + + if (6 * h < 1) return m1 + (m2 - m1) * 6 * h; + else if (2 * h < 1) return m2; + else if (3 * h < 2) return m1 + (m2 - m1) * (2 / 3 - h) * 6; + else return m1; + } + + var processStyleCache = {}; + + function processStyle(styleString) { + if (styleString in processStyleCache) { + return processStyleCache[styleString]; + } + + var str, alpha = 1; + + styleString = String(styleString); + if (styleString.charAt(0) == '#') { + str = styleString; + } else if (/^rgb/.test(styleString)) { + var parts = getRgbHslContent(styleString); + var str = '#', + n; + for (var i = 0; i < 3; i++) { + if (parts[i].indexOf('%') != -1) { + n = Math.floor(percent(parts[i]) * 255); + } else { + n = +parts[i]; + } + str += decToHex[clamp(n, 0, 255)]; + } + alpha = +parts[3]; + } else if (/^hsl/.test(styleString)) { + var parts = getRgbHslContent(styleString); + str = hslToRgb(parts); + alpha = parts[3]; + } else { + str = colorData[styleString] || styleString; + } + return processStyleCache[styleString] = { + color: str, + alpha: alpha + }; + } + + var DEFAULT_STYLE = { + style: 'normal', + variant: 'normal', + weight: 'normal', + size: 12, + //10 + family: '微软雅黑' //'sans-serif' + }; + + // Internal text style cache + var fontStyleCache = {}; + + function processFontStyle(styleString) { + if (fontStyleCache[styleString]) { + return fontStyleCache[styleString]; + } + + var el = document.createElement('div'); + var style = el.style; + var fontFamily; + try { + style.font = styleString; + fontFamily = style.fontFamily.split(',')[0]; + } catch (ex) { + // Ignore failures to set to invalid font. + } + + return fontStyleCache[styleString] = { + style: style.fontStyle || DEFAULT_STYLE.style, + variant: style.fontVariant || DEFAULT_STYLE.variant, + weight: style.fontWeight || DEFAULT_STYLE.weight, + size: style.fontSize || DEFAULT_STYLE.size, + family: fontFamily || DEFAULT_STYLE.family + }; + } + + function getComputedStyle(style, element) { + var computedStyle = {}; + + for (var p in style) { + computedStyle[p] = style[p]; + } + + // Compute the size + var canvasFontSize = parseFloat(element.currentStyle.fontSize), + fontSize = parseFloat(style.size); + + if (typeof style.size == 'number') { + computedStyle.size = style.size; + } else if (style.size.indexOf('px') != -1) { + computedStyle.size = fontSize; + } else if (style.size.indexOf('em') != -1) { + computedStyle.size = canvasFontSize * fontSize; + } else if (style.size.indexOf('%') != -1) { + computedStyle.size = (canvasFontSize / 100) * fontSize; + } else if (style.size.indexOf('pt') != -1) { + computedStyle.size = fontSize / .75; + } else { + computedStyle.size = canvasFontSize; + } + + // Different scaling between normal text and VML text. This was found using + // trial and error to get the same size as non VML text. + //computedStyle.size *= 0.981; + return computedStyle; + } + + function buildStyle(style) { + return style.style + ' ' + style.variant + ' ' + style.weight + ' ' + style.size + "px '" + style.family + "'"; + } + + var lineCapMap = { + 'butt': 'flat', + 'round': 'round' + }; + + function processLineCap(lineCap) { + return lineCapMap[lineCap] || 'square'; + } + + function createShapeAttr() { + return { + filled: false, + stroked: false, + + path: '', + fillStyle: null, + strokeStyle: null, + + globalAlpha: 1, + lineCap: 'butt', + lineJoin: 'miter', + lineWidth: 1, + miterlimit: Z * 1, + + x: 0, + y: 0 + }; + } + + function copyShapeAttr(o1, o2) { + o1.path = o2.path; + + o1.fillStyle = o2.fillStyle; + + o1.globalAlpha = o2.globalAlpha; + + // PENDING When shape changed from not stroked to stroked + if (o2.stroked) { + o1.strokeStyle = o2.strokeStyle; + o1.lineCap = o2.lineCap; + o1.lineJoin = o2.lineJoin; + o1.lineWidth = o2.lineWidth; + o1.miterlimit = o2.miterlimit; + } + + o1.x = o2.x; + o1.y = o2.y; + + o1.filled = o2.filled; + o1.stroked = o2.stroked; + } + + function createTextAttr() { + var attr = createShapeAttr(); + attr.text = ''; + attr.font = '12px 微软雅黑'; + attr.textAlign = 'left'; + attr.textBaseline = 'alphabetic'; + attr.offX = 0; + attr.offY = 0; + attr.maxWidth = 0; + + return attr; + } + + function copyTextAttr(o1, o2) { + copyShapeAttr(o1, o2); + + o1.text = o2.text; + o1.font = o2.font; + o1.textAlign = o2.textAlign; + o1.textBaseline = o2.textBaseline; + o1.offX = o2.offX; + o1.offY = o2.offY; + o1.maxWidth = o2.maxWidth; + } + + function createImageAttr() { + return { + image: '', + // position after tranformed + x: 0, + y: 0, + padding: '', + skewM: '', + cropped: false, + width: 0, + height: 0, + globalAlpha: 1 + }; + } + + function copyImageAttr(o1, o2) { + o1.image = o2.image; + o1.x = o2.x; + o1.y = o2.y; + o1.width = o2.width; + o1.height = o2.height; + o1.globalAlpha = o2.globalAlpha; + + if (o2.skewed) { + o1.skewM = o2.skewM; + o1.padding = o2.padding; + } + + if (o2.cropped) { + o1.cropWidth = o2.cropWidth; + o1.cropHeight = o2.cropHeight; + o1.cropFilter = o2.cropFilter; + } + + o1.cropped = o2.cropped; + o1.skewed = o2.skewed; + } + + /** + * Virtual shape dom is created by stroke and fill operation. + * It will be cached in Context2D object. And created only if needed when redrawing + * @author https://github.com/pissang/ + */ + + function ShapeVirtualDom_() { + // this.rootEl_ = null; + // this.strokeEl_ = null; + // this.fillEl_ = null; + this.attr_ = createShapeAttr(); + + this.attrPrev_ = {}; + } + + ShapeVirtualDom_.prototype.attachTo = function (el) { + if (!this.attached_) { + var p = this.rootEl_.parentNode; + if (p !== el) { + el.appendChild(this.rootEl_); + } + } + this.attached_ = true; + } + + ShapeVirtualDom_.prototype.detach = function () { + if (this.attached_) { + var p = this.rootEl_.parentNode; + if (p) { + p.removeChild(this.rootEl_); + } + } + this.attached_ = false; + } + + ShapeVirtualDom_.prototype.getElement = function (path) { + if (!this.rootEl_) { + this.createShapeEl_(path); + } + var attr_ = this.attr_; + attr_.path = path; + attr_.filled = false; + attr_.stroked = false; + + return this.rootEl_; + }; + + ShapeVirtualDom_.prototype.createShapeEl_ = function (path) { + + var W = 10; + var H = 10; + + var rootEl_ = createVMLElement('shape'); + rootEl_.style.cssText = ['position:absolute;width:', W, 'px;height:', H, 'px'].join(''); + rootEl_.coordorigin = '0 0'; + rootEl_.coordsize = Z * W + ' ' + Z * H; + + rootEl_.filled = 'false'; + rootEl_.stroked = 'false'; + + this.rootEl_ = rootEl_; + }; + + ShapeVirtualDom_.prototype.isFilled = function () { + return this.attr_.filled; + }; + + ShapeVirtualDom_.prototype.isStroked = function () { + return this.attr_.stroked; + }; + + ShapeVirtualDom_.prototype.fill = function (ctx, min, max) { + var attr_ = this.attr_; + + attr_.filled = true; + attr_.fillStyle = ctx.fillStyle; + attr_.globalAlpha = ctx.globalAlpha; + + attr_.x = ctx.x_; + attr_.y = ctx.y_; + + if (ctx.fillStyle instanceof CanvasGradient_) { + attr_.m_ = ctx.m_; + attr_.scaleX = ctx.scaleX_; + attr_.scaleY = ctx.scaleY_; + attr_.min = min; + attr_.max = max; + } else if (ctx.fillStyle instanceof CanvasPattern_) { + attr_.scaleX = ctx.scaleX_; + attr_.scaleY = ctx.scaleY_; + attr_.min = min; + attr_.max = max; + } + }; + + ShapeVirtualDom_.prototype.stroke = function (ctx) { + var attr_ = this.attr_; + + attr_.stroked = true; + attr_.globalAlpha = ctx.globalAlpha; + attr_.lineCap = ctx.lineCap; + attr_.lineJoin = ctx.lineJoin; + attr_.lineWidth = ctx.lineWidth * ctx.lineScale_; + attr_.miterlimit = ctx.miterlimit; + attr_.strokeStyle = ctx.strokeStyle; + + attr_.x = ctx.x_; + attr_.y = ctx.y_; + } + + ShapeVirtualDom_.prototype.doFill_ = function () { + var attr_ = this.attr_; + var attrPrev_ = this.attrPrev_; + if (attr_.filled !== attrPrev_.filled) { + var rootEl_ = this.rootEl_; + if (attr_.filled) { + rootEl_.filled = 'true'; + if (!this.fillEl_) { + this.fillEl_ = createVMLElement('fill'); + // PENDING + // Set default attribute ? + } + rootEl_.appendChild(this.fillEl_); + } else { + rootEl_.filled = 'false'; + if (this.fillEl_) { + rootEl_.removeChild(this.fillEl_); + } + } + } + if (!attr_.filled) { + return; + } + + var fillEl_ = this.fillEl_; + + var fillStyle = attr_.fillStyle; + + if ( + fillStyle !== attrPrev_.fillStyle || attr_.globalAlpha !== attrPrev_.globalAlpha) { + // TODO Canvas gradient and pattern still not be optimized + // There problem when canvas gradient add color stop dynamically + // + // Text fill doesn't support Gradient or Pattern + if ((fillStyle instanceof CanvasGradient_) && attr_.min) { + // TODO: Gradients transformed with the transformation matrix. + var angle = 0; + var focus = { + x: 0, + y: 0 + }; + + // additional offset + var shift = 0; + // scale factor for offset + var expansion = 1; + + var scaleX = attr_.scaleX_; + var scaleY = attr_.scaleY_; + var min = attr_.min; + var max = attr_.max; + var width = max.x - min.x; + var height = max.y - min.y; + + if (fillStyle.type_ == 'gradient') { + var x0 = fillStyle.x0_ / scaleX; + var y0 = fillStyle.y0_ / scaleY; + var x1 = fillStyle.x1_ / scaleX; + var y1 = fillStyle.y1_ / scaleY; + var p0 = getCoords(ctx, x0, y0); + var p1 = getCoords(ctx, x1, y1); + var dx = p1.x - p0.x; + var dy = p1.y - p0.y; + angle = Math.atan2(dx, dy) * 180 / Math.PI; + + // The angle should be a non-negative number. + if (angle < 0) { + angle += 360; + } + + // Very small angles produce an unexpected result because they are + // converted to a scientific notation string. + if (angle < 1e-6) { + angle = 0; + } + } else { + var p0 = getCoords(ctx, fillStyle.x0_, fillStyle.y0_); + focus = { + x: (p0.x - min.x) / width, + y: (p0.y - min.y) / height + }; + + width /= scaleX * Z; + height /= scaleY * Z; + var dimension = m.max(width, height); + shift = 2 * fillStyle.r0_ / dimension; + expansion = 2 * fillStyle.r1_ / dimension - shift; + } + + // We need to sort the color stops in ascending order by offset, + // otherwise IE won't interpret it correctly. + var stops = fillStyle.colors_; + stops.sort(function (cs1, cs2) { + return cs1.offset - cs2.offset; + }); + + var length = stops.length; + var color1 = stops[0].color; + var color2 = stops[length - 1].color; + var opacity1 = stops[0].alpha * attr_.globalAlpha; + var opacity2 = stops[length - 1].alpha * attr_.globalAlpha; + + var colors = []; + for (var i = 0; i < length; i++) { + var stop = stops[i]; + colors.push(stop.offset * expansion + shift + ' ' + stop.color); + } + + fillEl_.type = fillStyle.type_; + fillEl_.method = 'none'; + fillEl_.focus = '100%'; + fillEl_.color = color1; + fillEl_.color2 = color2; + fillEl_.colors = colors.join(','); + fillEl_.opacity = opacity2; + fillEl_.setAttribute('g_o_:opacity2', opacity1); + fillEl_.angle = angle; + fillEl_.focusposition = focus.x + ',' + focus.y; + } + else if ((fillStyle instanceof CanvasPattern_) && attr_.min) { + if (width && height) { + var deltaLeft = -attr_.min.x; + var deltaTop = -attr_.min.y; + fillEl_.position = deltaLeft / width * scaleX * scaleX + ',' + deltaTop / height * scaleY * scaleY; + fillEl_.type = 'tile'; + fillEl_.src = fillStyle.src_; + } + } + else { + var a = processStyle(fillStyle); + var color = a.color; + var opacity = a.alpha * attr_.globalAlpha; + fillEl_.color = color; + if (opacity < 1) { + fillEl_.opacity = opacity; + } + } + } + }; + + ShapeVirtualDom_.prototype.doStroke_ = function () { + var attr_ = this.attr_; + var attrPrev_ = this.attrPrev_; + if (attr_.stroked !== attrPrev_.stroked) { + var rootEl_ = this.rootEl_; + if (attr_.stroked) { + if (!this.strokeEl_) { + this.strokeEl_ = createVMLElement('stroke'); + // PENDING + // Set default attribute ? + } + rootEl_.stroked = 'true'; + rootEl_.appendChild(this.strokeEl_); + } else { + rootEl_.stroked = 'false'; + if (this.strokeEl_) { + rootEl_.removeChild(this.strokeEl_); + } + } + } + + if (!attr_.stroked) { + return; + } + + if ( + attr_.strokeStyle !== attrPrev_.strokeStyle || attr_.globalAlpha !== attrPrev_.globalAlpha || attr_.lineWidth !== attrPrev_.lineWidth) { + var a = processStyle(attr_.strokeStyle); + var opacity = a.alpha * attr_.globalAlpha; + var lineWidth = attr_.lineWidth; + // VML cannot correctly render a line if the width is less than 1px. + // In that case, we dilute the color to make the line look thinner. + if (lineWidth < 1) { + opacity *= lineWidth; + } + if (opacity < 1) { + this.strokeEl_.opacity = opacity; + } + this.strokeEl_.color = a.color; + } + if (attr_.lineJoin !== attrPrev_.lineJoin) { + this.strokeEl_.joinstyle = attr_.lineJoin; + } + if (attr_.miterLimit !== attrPrev_.miterLimit) { + this.strokeEl_.miterlimit = attr_.miterLimit; + } + if (attr_.lineCap !== attrPrev_.lineCap) { + this.strokeEl_.endcap = processLineCap(attr_.lineCap); + } + if (lineWidth !== attrPrev_.lineWidth) { + this.strokeEl_.weight = lineWidth + 'px'; + } + }; + + ShapeVirtualDom_.prototype.flush = function (ctx) { + var attr_ = this.attr_; + var attrPrev_ = this.attrPrev_; + if (attr_.x !== attrPrev_.x) { + this.rootEl_.style.left = attr_.x + 'px'; + } + if (attr_.y !== attrPrev_.y) { + this.rootEl_.style.top = attr_.y + 'px'; + } + if (attr_.path !== attrPrev_.path) { + this.rootEl_.path = attr_.path; + } + this.doFill_(); + this.doStroke_(); + + copyShapeAttr(attrPrev_, attr_); + } + + /** + * Virtual text dom is created by fillText and strokeText operation. + * It will be cached in Context2D object. And created only if needed when redrawing + * @author https://github.com/pissang/ + */ + + function TextVirtualDom_() { + // this.rootEl_ = null; + // this.skewEl_ = null; + // this.textPathEl_ = null; + // this.simpleRootEl_ = null; + this.attr_ = createTextAttr(); + this.attrPrev_ = {}; + } + + TextVirtualDom_.prototype.getElement = function (ctx, text, x, y, maxWidth, stroke) { + if (!this.rootEl_) { + this.createEl_(); + } + var m_ = ctx.m_; + + var attr_ = this.attr_; + attr_.text = text; + + attr_.sx = x; + attr_.sy = y; + attr_.maxWidth = maxWidth; + attr_.textAlign = ctx.textAlign; + attr_.textBaseline = ctx.textBaseline; + + attr_.stroked = !! stroke; + attr_.filled = !stroke; + + var fontStyle = getComputedStyle(processFontStyle(ctx.font), ctx.element_); + var fontStyleString = buildStyle(fontStyle); + + attr_.font = fontStyleString; + + var offset = { + x: 0, + y: 0 + }; + // 1.75 is an arbitrary number, as there is no info about the text baseline + switch (ctx.textBaseline) { + case 'hanging': + case 'top': + offset.y = fontStyle.size / 1.75; + break; + case 'middle': + break; + default: + case null: + case 'alphabetic': + case 'ideographic': + case 'bottom': + offset.y = -fontStyle.size / 2.25; + break; + } + + var d = getCoords(ctx, x + offset.x, y + offset.y); + attr_.offX = d.x; + attr_.offY = d.y; + // attr_.skewed = isNotAroundZero(m_[0] - 1) || isNotAroundZero(m_[1]) || + // isNotAroundZero(m_[3] - 1) || isNotAroundZero(m_[2]) + attr_.skewM = m_[0][0].toFixed(3) + ',' + m_[1][0].toFixed(3) + ',' + m_[0][1].toFixed(3) + ',' + m_[1][1].toFixed(3); + + if (stroke) { + attr_.globalAlpha = ctx.globalAlpha; + attr_.lineCap = ctx.lineCap; + attr_.lineJoin = ctx.lineJoin; + attr_.lineWidth = ctx.lineWidth * ctx.lineScale_; + attr_.miterlimit = ctx.miterlimit; + attr_.strokeStyle = ctx.strokeStyle; + } else { + attr_.fillStyle = ctx.fillStyle; + attr_.globalAlpha = ctx.globalAlpha; + } + // TODO It is strange that flush after the rootEl has been appended to document + // SkewOffset like '10, 10'(which one item is not zero) will cause the shape disappeared. + this.flush(ctx); + + return this.rootEl_; + }; + + TextVirtualDom_.prototype.createEl_ = function () { + var W = 10; + var H = 10; + this.rootEl_ = createVMLElement('line'); + var rootEl_ = this.rootEl_; + rootEl_.coordsize = Z * W + ' ' + Z * H; + rootEl_.coordorigin = '0 0'; + rootEl_.style.cssText = 'position:absolute;width:1px;height:1px'; + rootEl_.stroked = 'false'; + rootEl_.filled = 'false'; + }; + + TextVirtualDom_.prototype.flush = function (ctx) { + var m_ = ctx.m_; + var delta = 1000; + var left = 0; + var right = delta; + var attr_ = this.attr_; + var attrPrev_ = this.attrPrev_; + var rootEl_ = this.rootEl_; + + if (!this.skewEl_) { + this.skewEl_ = createVMLElement('skew'); + this.skewEl_.on = 't'; + this.textPathEl_ = createVMLElement('textpath'); + this.pathEl_ = createVMLElement('path'); + this.pathEl_.textpathok = 'true'; + this.textPathEl_.on = 'true'; + + rootEl_.appendChild(this.skewEl_); + rootEl_.appendChild(this.pathEl_); + rootEl_.appendChild(this.textPathEl_); + } + + var fontStyle = getComputedStyle(processFontStyle(this.attr_.font), ctx.element_); + if ( + attr_.font !== attrPrev_.font || attr_.text !== attrPrev_.text) { + this.textPathEl_.string = encodeHtmlAttribute(attr_.text); + this.textPathEl_.style.font = encodeHtmlAttribute(attr_.font); + } + + if (attr_.textAlign !== attrPrev_.textAlign) { + var elementStyle = ctx.element_.currentStyle; + var textAlign = attr_.textAlign.toLowerCase(); + switch (textAlign) { + case 'left': + case 'center': + case 'right': + break; + case 'end': + textAlign = elementStyle.direction == 'ltr' ? 'right' : 'left'; + break; + case 'start': + textAlign = elementStyle.direction == 'rtl' ? 'right' : 'left'; + break; + default: + textAlign = 'left'; + } + switch (textAlign) { + case 'right': + left = delta; + right = 0.05; + break; + case 'center': + left = right = delta / 2; + break; + } + rootEl_.from = -left + ' 0'; + rootEl_.to = right + ' 0.05'; + this.skewEl_.origin = left + ' 0'; + this.textPathEl_.style['v-text-align'] = textAlign; + } + + // if (attr_.skewed || stroke) { + if (attr_.skewM !== attrPrev_.skewM) { + this.skewEl_.matrix = attr_.skewM + ',0,0'; + } + + if (attr_.offX !== attrPrev_.offX || attr_.offY !== attrPrev_.offY) { + var skewOffset = mr(attr_.offX / Z) + ',' + mr(attr_.offY / Z); + this.skewEl_.offset = skewOffset; + } + + if (attr_.stroked) { + this.doStroke_(); + } else { + this.doFill_(); + } + + copyTextAttr(attrPrev_, attr_); + + // } else { + // if (!this.simpleRootEl_) { + // this.simpleRootEl_ = document.createElement('div'); + // this.simpleRootEl_.style.position = 'absolute'; + // } + // this.simpleRootEl_.style.font = encodeHtmlAttribute(fontStyleString); + // var a = processStyle(ctx.fillStyle); + // var color = a.color; + // var opacity = a.alpha * ctx.globalAlpha; + // this.simpleRootEl_.style.color = color; + // if (opacity < 1) { + // this.simpleRootEl_.style.filter = 'alpha(opacity=' + mr(opacity * 100) +')'; + // } + // this.simpleRootEl_.innerHTML = text; + // switch (ctx.textBaseline) { + // case 'hanging': + // case 'top': + // this.simpleRootEl_.style.top = m_[2][1] + y + 'px'; + // break; + // case 'middle': + // // TODO + // this.simpleRootEl_.style.top = m_[2][1] + y - fontStyle.size / 2.25 + 'px'; + // break; + // default: + // case null: + // case 'alphabetic': + // case 'ideographic': + // case 'bottom': + // // + // this.simpleRootEl_.style.bottom = ctx.element_.clientHeight - m_[2][1] - y + 'px'; + // break; + // } + // switch(textAlign) { + // case 'right': + // this.simpleRootEl_.style.right = ctx.element_.clientWidth - m_[2][0] - x + 'px'; + // break; + // case 'center': + // // TODO + // this.simpleRootEl_.style.left = m_[2][0] + x - fontStyle.size / 4.5 * text.length + 'px'; + // break; + // case 'left': + // this.simpleRootEl_.style.left = m_[2][0] + x + 'px'; + // break; + // } + // return this.simpleRootEl_; + // } + } + + TextVirtualDom_.prototype.doFill_ = ShapeVirtualDom_.prototype.doFill_; + TextVirtualDom_.prototype.doStroke_ = ShapeVirtualDom_.prototype.doStroke_; + TextVirtualDom_.prototype.attachTo = ShapeVirtualDom_.prototype.attachTo; + TextVirtualDom_.prototype.detach = ShapeVirtualDom_.prototype.detach; + + /** + * Virtual image dom is created by drawImage operation. + * It will be cached in Context2D object. And created only if needed when redrawing + * @author https://github.com/pissang/ + * + * TODO Image cropping testing + */ + + function ImageVirtualDom_() { + // this.rootEl_ = null; + // this.cropEl_ = null; + // this.imageEl_ = null; + // this.groupEl_ = null; + this.attr_ = createImageAttr(); + + this.attrPrev_ = {}; + }; + + ImageVirtualDom_.prototype.getElement = function (ctx, image, var_args) { + var dx, dy, dw, dh, sx, sy, sw, sh; + + // to find the original width we overide the width and height + var oldRuntimeWidth = image.runtimeStyle.width; + var oldRuntimeHeight = image.runtimeStyle.height; + var m_ = ctx.m_; + image.runtimeStyle.width = 'auto'; + image.runtimeStyle.height = 'auto'; + + // get the original size + var w = image.width; + var h = image.height; + + // and remove overides + image.runtimeStyle.width = oldRuntimeWidth; + image.runtimeStyle.height = oldRuntimeHeight; + + var args = Array.prototype.slice.call(arguments, 1); + var attr_ = this.attr_; + attr_.globalAlpha = ctx.globalAlpha; + + var scaleX = ctx.scaleX_; + var scaleY = ctx.scaleY_; + if (args.length == 3) { + dx = args[1]; + dy = args[2]; + sx = sy = 0; + sw = dw = w; + sh = dh = h; + } else if (args.length == 5) { + dx = args[1]; + dy = args[2]; + dw = args[3]; + dh = args[4]; + sx = sy = 0; + sw = w; + sh = h; + } else if (args.length == 9) { + sx = args[1]; + sy = args[2]; + sw = args[3]; + sh = args[4]; + dx = args[5]; + dy = args[6]; + dw = args[7]; + dh = args[8]; + } else { + throw Error('Invalid number of arguments'); + } + + // Have rotation + attr_.skewed = m_[0][1] || m_[1][0]; + + if (attr_.skewed) { + var d = getCoords(ctx, dx, dy); + attr_.x = d.x; + attr_.y = d.y; + var filter = []; + filter.push('M11=', m_[0][0] / scaleX, ',', 'M12=', m_[1][0] / scaleY, ',', 'M21=', m_[0][1] / scaleX, ',', 'M22=', m_[1][1] / scaleY, ',', 'Dx=', d.x, ',', 'Dy=', d.y, ''); + attr_.skewM = filter.join(''); + + // Bounding box calculation (need to minimize displayed area so that + // filters don't waste time on unused pixels. + var max = d; + var c2 = getCoords(ctx, dx + dw, dy); + var c3 = getCoords(ctx, dx, dy + dh); + var c4 = getCoords(ctx, dx + dw, dy + dh); + + max.x = m.max(max.x, c2.x, c3.x, c4.x); + max.y = m.max(max.y, c2.y, c3.y, c4.y); + + attr_.padding = [0, Math.max(mr(max.x / Z), 0) + 'px', Math.max(mr(max.y / Z), 0) + 'px', 0].join(' '); + } else { + attr_.x = dx * scaleX + ctx.x_; + attr_.y = dy * scaleY + ctx.y_; + } + + attr_.cropped = sx || sy; + if (attr_.cropped) { + attr_.cropWidth = Math.ceil((dw + sx * dw / sw) * scaleX); + attr_.cropHeight = Math.ceil((dh + sy * dh / sh) * scaleY); + attr_.cropFilter = 'progid:DxImageTransform.Microsoft.Matrix(Dx=' + -dw / sw * scaleX * sx + ',Dy=' + -dh / sh * scaleY * sy + ')'; + } + + attr_.width = scaleX * dw / sw * w; + attr_.height = scaleY * dh / sh * h; + + attr_.image = image.src; + + if (!this.imageEl_) { + // NOTES + // Matrix of rootDom will not work if imageDom.style.position = 'absolute' + this.imageEl_ = document.createElement('img'); + } + + if (!(attr_.skewed || attr_.cropped)) { + this.rootEl_ = this.imageEl_; + } else if (attr_.skewed) { + if (!this.groupEl_) { + this.createGroupEl_(); + } + this.rootEl_ = this.groupEl_; + } else { + if (!this.cropEl_) { + this.cropEl_ = document.createElement('div'); + this.cropEl_.style.cssText = 'position:absolute; overflow:hidden;'; + } + this.rootEl_ = this.cropEl_; + } + + this.flush(ctx); + return this.rootEl_; + }; + + ImageVirtualDom_.prototype.createGroupEl_ = function () { + var W = 10; + var H = 10; + + // For some reason that I've now forgotten, using divs didn't work + this.groupEl_ = createVMLElement('group'); + this.groupEl_.coordsize = Z * W + ' ' + Z * H; + this.groupEl_.coordorigin = '0 0'; + + this.groupEl_.style.cssText = ['position:absolute;width:', W, 'px;height:', H, 'px'].join(''); + } + + ImageVirtualDom_.prototype.flush = function (ctx) { + var attr_ = this.attr_; + var attrPrev_ = this.attrPrev_; + var w2 = attr_.sw / 2; + var h2 = attr_.sh / 2; + + var imageEl_ = this.imageEl_; + + // If filters are necessary (rotation exists), create them + // filters are bog-slow, so only create them if abbsolutely necessary + // The following check doesn't account for skews (which don't exist + // in the canvas spec (yet) anyway. + if (!attr_.skewed && !attr_.cropped) { + if (attr_.x !== attrPrev_.x) { + imageEl_.style.left = attr_.x + 'px'; + } + if (attr_.y !== attrPrev_.y) { + imageEl_.style.top = attr_.y + 'px'; + } + if (!attrPrev_.skewed) { + imageEl_.style.position = 'absolute'; + } else { + imageEl_.style.position = 'static'; + } + } else if (attr_.skewed) { + var groupEl_ = this.groupEl_; + if (attr_.padding !== attrPrev_.padding) { + groupEl_.style.padding = attr_.padding; + } + + if (attr_.skewM !== attrPrev_.skewM) { + groupEl_.style.filter = 'progid:DXImageTransform.Microsoft.Matrix(' + attr_.skewM + ", SizingMethod='clip')"; + } + + if (attr_.cropped) { + if (!attrPrev_.cropped) { + groupEl_.appendChild(this.cropEl_); + this.cropEl_.appendChild(imageEl_); + } + } else { + if (!attrPrev_.skewed) { + groupEl_.appendChild(imageEl_); + } + } + } else if (attr_.cropped) { + if (!attrPrev_.cropped) { + this.cropEl_.appendChild(imageEl_); + } + } + + // Draw a special cropping div if needed + if (attr_.cropped) { + var groupEl_ = this.groupEl_; + if (attr_.cropWidth !== attrPrev_.cropWidth) { + this.cropEl_.style.width = attr_.cropWidth + 'px'; + } + if (attr_.cropHeight !== attrPrev_.cropHeight) { + this.cropEl_.style.height = attr_.cropHeight + 'px'; + } + if (attr_.filter !== attrPrev_.filter) { + this.cropEl_.style.filter = attr_.filter; + } + } + + if (attr_.width !== attrPrev_.width) { + imageEl_.style.width = attr_.width + 'px'; + } + if (attr_.height !== attrPrev_.height) { + imageEl_.style.height = attr_.height + 'px'; + } + + if (attr_.image !== attrPrev_.image) { + imageEl_.src = attr_.image; + } + if (attr_.globalAlpha !== attrPrev_.globalAlpha) { + if (imageEl_.style.globalAlpha < 1) { + imageEl_.style.filter = 'alpha(opacity=' + mr(attr_.globalAlpha * 100) + ')'; + } else { + imageEl_.style.filter = ''; + } + } + + copyImageAttr(this.attrPrev_, this.attr_); + } + + ImageVirtualDom_.prototype.attachTo = ShapeVirtualDom_.prototype.attachTo; + ImageVirtualDom_.prototype.detach = ShapeVirtualDom_.prototype.detach; + + /** + * This class implements CanvasRenderingContext2D interface as described by + * the WHATWG. + * @param {HTMLElement} canvasElement The element that the 2D context should + * be associated with + */ + + function CanvasRenderingContext2D_(canvasElement) { + this.m_ = createMatrixIdentity(); + + this.mStack_ = []; + this.aStack_ = []; + this.currentPath_ = []; + + // NOTES + // http://louisremi.com/2009/03/30/changes-in-vml-for-ie8-or-what-feature-can-the-ie-dev-team-break-for-you-today/ + // It is no longer possible to create a VML element outside of the DOM + // this.fragment_ = document.createDocumentFragment(); + // Keep current drawed dom. So we can merge fill and stroke in one shape dom + this.currentVirtualDom_ = null; + + // Cache the created dom + this.shapeVDomList_ = []; + this.textVDomList_ = []; + this.imageVDomList_ = []; + + this.nShapeVEl_ = 0; + this.nTextVEl_ = 0; + this.nImageVEl_ = 0; + + // Canvas context properties + this.strokeStyle = '#000'; + this.fillStyle = '#000'; + + this.lineWidth = 1; + this.lineJoin = 'miter'; + this.lineCap = 'butt'; + this.miterLimit = Z * 1; + this.globalAlpha = 1; + // this.font = '10px sans-serif'; + this.font = '12px 微软雅黑'; // 决定还是改这吧,影响代价最小 + this.textAlign = 'left'; + this.textBaseline = 'alphabetic'; + this.canvas = canvasElement; + + var cssText = 'width:' + canvasElement.clientWidth + 'px;height:' + canvasElement.clientHeight + 'px;overflow:hidden;position:absolute'; + var el = canvasElement.ownerDocument.createElement('div'); + el.style.cssText = cssText; + canvasElement.appendChild(el); + + var overlayEl = el.cloneNode(false); + // Use a non transparent background. + overlayEl.style.backgroundColor = '#fff'; //red, I don't know why, it work! + overlayEl.style.filter = 'alpha(opacity=0)'; + canvasElement.appendChild(overlayEl); + + this.element_ = el; + this.scaleX_ = 1; + this.scaleY_ = 1; + this.lineScale_ = 1; + + this.ghost_ = document.createElement('div'); + var cssText = 'position:absolute; left:0px; right: 0px; top: 0px; bottom: 0px;'; + this.ghost_.style.cssText = cssText; + + this.element_.appendChild(this.ghost_); + + this.x_ = 0; + this.y_ = 0; + } + + var contextPrototype = CanvasRenderingContext2D_.prototype; + contextPrototype.clearRect = function () { + if (this.textMeasureEl_) { + this.textMeasureEl_.removeNode(true); + this.textMeasureEl_ = null; + } + // var ghost_ = this.ghost_; + // Hide everything + this.ghost_.style.display = 'none'; + // NOTES: Using innerHTML = '' will cause all descendant elements detached + // while (ghost_.firstChild) { + // ghost_.removeChild(ghost_.firstChild); + // } + // NOTES: removeChild in IE8 will not set the parentNode to null + // + // TODO Remove ghost element before change the attributes of children each frame is even more slow + // if (ghost_.parentNode === this.element_) { + // this.element_.removeChild(ghost_); + // } + this.currentVirtualDom_ = null; + + this.nShapeVEl_ = 0; + this.nTextVEl_ = 0; + this.nImageVEl_ = 0; + }; + + contextPrototype.flush = function () { + for (var i = 0; i < this.nShapeVEl_; i++) { + this.shapeVDomList_[i].flush(this); + } + // Show everything + this.ghost_.style.display = 'block'; + + for (var i = this.nShapeVEl_, len = this.shapeVDomList_.length; i < len; i++) { + this.shapeVDomList_[i].detach(); + } + for (var i = this.nImageVEl_, len = this.imageVDomList_.length; i < len; i++) { + this.imageVDomList_[i].detach(); + } + for (var i = this.nTextVEl_, len = this.textVDomList_.length; i < len; i++) { + this.textVDomList_[i].detach(); + } + this.shapeVDomList_.length = this.nShapeVEl_; + this.imageVDomList_.length = this.nImageVEl_; + this.textVDomList_.length = this.nTextVEl_; + + // this.element_.appendChild(this.ghost_); + } + + contextPrototype.beginPath = function () { + // TODO: Branch current matrix so that save/restore has no effect + // as per safari docs. + this.currentPath_ = []; + + this.currentVirtualDom_ = null; + }; + + contextPrototype.moveTo = function (aX, aY) { + var p = getSkewedCoords(this, aX, aY); + p.type = 'moveTo'; + this.currentPath_.push(p); + this.currentX_ = p.x; + this.currentY_ = p.y; + }; + + contextPrototype.lineTo = function (aX, aY) { + var p = getSkewedCoords(this, aX, aY); + p.type = 'lineTo'; + this.currentPath_.push(p); + + this.currentX_ = p.x; + this.currentY_ = p.y; + + this.currentVirtualDom_ = null; + }; + + contextPrototype.bezierCurveTo = function (aCP1x, aCP1y, aCP2x, aCP2y, aX, aY) { + var p = getSkewedCoords(this, aX, aY); + var cp1 = getSkewedCoords(this, aCP1x, aCP1y); + var cp2 = getSkewedCoords(this, aCP2x, aCP2y); + bezierCurveTo(this, cp1, cp2, p); + + this.currentVirtualDom_ = null; + }; + + // Helper function that takes the already fixed cordinates. + + + function bezierCurveTo(self, cp1, cp2, p) { + self.currentPath_.push({ + type: 'bezierCurveTo', + cp1x: cp1.x, + cp1y: cp1.y, + cp2x: cp2.x, + cp2y: cp2.y, + x: p.x, + y: p.y + }); + self.currentX_ = p.x; + self.currentY_ = p.y; + + this.currentVirtualDom_ = null; + } + + contextPrototype.quadraticCurveTo = function (aCPx, aCPy, aX, aY) { + // the following is lifted almost directly from + // http://developer.mozilla.org/en/docs/Canvas_tutorial:Drawing_shapes + var cp = getSkewedCoords(this, aCPx, aCPy); + var p = getSkewedCoords(this, aX, aY); + + var cp1 = { + x: this.currentX_ + 2.0 / 3.0 * (cp.x - this.currentX_), + y: this.currentY_ + 2.0 / 3.0 * (cp.y - this.currentY_) + }; + var cp2 = { + x: cp1.x + (p.x - this.currentX_) / 3.0, + y: cp1.y + (p.y - this.currentY_) / 3.0 + }; + + bezierCurveTo(this, cp1, cp2, p); + + this.currentVirtualDom_ = null; + }; + + contextPrototype.arc = function (aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise) { + aRadius *= Z; + var arcType = aClockwise ? 'at' : 'wa'; + + var xStart = aX + mc(aStartAngle) * aRadius - Z2; + var yStart = aY + ms(aStartAngle) * aRadius - Z2; + + var xEnd = aX + mc(aEndAngle) * aRadius - Z2; + var yEnd = aY + ms(aEndAngle) * aRadius - Z2; + + // IE won't render arches drawn counter clockwise if xStart == xEnd. + if (xStart == xEnd && !aClockwise) { + xStart += 0.125; // Offset xStart by 1/80 of a pixel. Use something + // that can be represented in binary + } + + var p = getSkewedCoords(this, aX, aY); + var pStart = getSkewedCoords(this, xStart, yStart); + var pEnd = getSkewedCoords(this, xEnd, yEnd); + + this.currentPath_.push({ + type: arcType, + x: p.x, + y: p.y, + radius: aRadius, + xStart: pStart.x, + yStart: pStart.y, + xEnd: pEnd.x, + yEnd: pEnd.y + }); + + + this.currentVirtualDom_ = null; + }; + + contextPrototype.rect = function (aX, aY, aWidth, aHeight) { + this.moveTo(aX, aY); + this.lineTo(aX + aWidth, aY); + this.lineTo(aX + aWidth, aY + aHeight); + this.lineTo(aX, aY + aHeight); + this.closePath(); + + this.currentVirtualDom_ = null; + }; + + contextPrototype.strokeRect = function (aX, aY, aWidth, aHeight) { + var oldPath = this.currentPath_; + this.beginPath(); + + this.moveTo(aX, aY); + this.lineTo(aX + aWidth, aY); + this.lineTo(aX + aWidth, aY + aHeight); + this.lineTo(aX, aY + aHeight); + this.closePath(); + this.stroke(); + + this.currentPath_ = oldPath; + }; + + contextPrototype.fillRect = function (aX, aY, aWidth, aHeight) { + var oldPath = this.currentPath_; + this.beginPath(); + + this.moveTo(aX, aY); + this.lineTo(aX + aWidth, aY); + this.lineTo(aX + aWidth, aY + aHeight); + this.lineTo(aX, aY + aHeight); + this.closePath(); + this.fill(); + + this.currentPath_ = oldPath; + }; + + contextPrototype.createLinearGradient = function (aX0, aY0, aX1, aY1) { + var gradient = new CanvasGradient_('gradient'); + gradient.x0_ = aX0; + gradient.y0_ = aY0; + gradient.x1_ = aX1; + gradient.y1_ = aY1; + return gradient; + }; + + contextPrototype.createRadialGradient = function (aX0, aY0, aR0, aX1, aY1, aR1) { + var gradient = new CanvasGradient_('gradientradial'); + gradient.x0_ = aX0; + gradient.y0_ = aY0; + gradient.r0_ = aR0; + gradient.x1_ = aX1; + gradient.y1_ = aY1; + gradient.r1_ = aR1; + return gradient; + }; + contextPrototype.drawImage = function (image, var_args) { + + var vDom = this.imageVDomList_[this.nImageVEl_]; + if (!vDom) { + vDom = new ImageVirtualDom_(); + this.imageVDomList_[this.nImageVEl_] = vDom; + } + this.nImageVEl_++; + var args = Array.prototype.slice.call(arguments); + args.unshift(this); + var el = vDom.getElement.apply(vDom, args); + + vDom.attachTo(this.ghost_); + + this.currentVirtualDom_ = null; + }; + + contextPrototype.stroke = function (aFill) { + if (this.currentVirtualDom_) { + // Simply append fill or stroke dom + if (aFill && !this.currentVirtualDom_.isFilled()) { + this.currentVirtualDom_.fill(this); + } else if (!aFill && !this.currentVirtualDom_.isStroked()) { + this.currentVirtualDom_.stroke(this); + } + + return; + } + + var pathStr = []; + + var min = { + x: null, + y: null + }; + var max = { + x: null, + y: null + }; + + for (var i = 0; i < this.currentPath_.length; i++) { + var p = this.currentPath_[i]; + var c; + + switch (p.type) { + case 'moveTo': + c = p; + pathStr.push(' m ', mr(p.x), ',', mr(p.y)); + break; + case 'lineTo': + pathStr.push(' l ', mr(p.x), ',', mr(p.y)); + break; + case 'close': + pathStr.push(' x '); + p = null; + break; + case 'bezierCurveTo': + pathStr.push(' c ', mr(p.cp1x), ',', mr(p.cp1y), ',', mr(p.cp2x), ',', mr(p.cp2y), ',', mr(p.x), ',', mr(p.y)); + break; + case 'at': + case 'wa': + pathStr.push(' ', p.type, ' ', mr(p.x - this.scaleX_ * p.radius), ',', mr(p.y - this.scaleY_ * p.radius), ' ', mr(p.x + this.scaleX_ * p.radius), ',', mr(p.y + this.scaleY_ * p.radius), ' ', mr(p.xStart), ',', mr(p.yStart), ' ', mr(p.xEnd), ',', mr(p.yEnd)); + break; + } + + // TODO: Following is broken for curves due to + // move to proper paths. + // Figure out dimensions so we can do gradient fills + // properly + if (p) { + if (min.x == null || p.x < min.x) { + min.x = p.x; + } + if (max.x == null || p.x > max.x) { + max.x = p.x; + } + if (min.y == null || p.y < min.y) { + min.y = p.y; + } + if (max.y == null || p.y > max.y) { + max.y = p.y; + } + } + } + + pathStr = pathStr.join(''); + + var vDom = this.shapeVDomList_[this.nShapeVEl_]; + if (!vDom) { + vDom = new ShapeVirtualDom_(); + this.shapeVDomList_[this.nShapeVEl_] = vDom; + } + this.nShapeVEl_++; + + var shapeEl = vDom.getElement(pathStr, this.x_, this.y_); + aFill ? vDom.fill(this, min, max) : vDom.stroke(this); + + vDom.attachTo(this.ghost_); + + this.currentVirtualDom_ = vDom; + + return shapeEl; + }; + + contextPrototype.fill = function () { + return this.stroke(true); + }; + + contextPrototype.closePath = function () { + this.currentPath_.push({ + type: 'close' + }); + }; + + function getCoords(ctx, aX, aY) { + var m = ctx.m_; + return { + x: Z * (aX * m[0][0] + aY * m[1][0] + m[2][0]) - Z2, + y: Z * (aX * m[0][1] + aY * m[1][1] + m[2][1]) - Z2 + }; + }; + + function getSkewedCoords(ctx, aX, aY) { + var m = ctx.m_; + return { + x: Z * (aX * m[0][0] + aY * m[1][0]) - Z2, + y: Z * (aX * m[0][1] + aY * m[1][1]) - Z2 + }; + } + + contextPrototype.save = function () { + var o = {}; + copyState(this, o); + this.aStack_.push(o); + this.mStack_.push(this.m_); + this.m_ = matrixMultiply(createMatrixIdentity(), this.m_); + }; + + contextPrototype.restore = function () { + if (this.aStack_.length) { + copyState(this.aStack_.pop(), this); + this.m_ = this.mStack_.pop(); + } + }; + + function matrixIsFinite(m) { + return isFinite(m[0][0]) && isFinite(m[0][1]) && isFinite(m[1][0]) && isFinite(m[1][1]) && isFinite(m[2][0]) && isFinite(m[2][1]); + } + + function setM(ctx, m, updateLineScale) { + if (!matrixIsFinite(m)) { + return; + } + ctx.m_ = m; + + ctx.scaleX_ = Math.sqrt(m[0][0] * m[0][0] + m[0][1] * m[0][1]); + ctx.scaleY_ = Math.sqrt(m[1][0] * m[1][0] + m[1][1] * m[1][1]); + ctx.x_ = m[2][0]; + ctx.y_ = m[2][1]; + + if (updateLineScale) { + // Get the line scale. + // Determinant of this.m_ means how much the area is enlarged by the + // transformation. So its square root can be used as a scale factor + // for width. + var det = m[0][0] * m[1][1] - m[0][1] * m[1][0]; + ctx.lineScale_ = sqrt(abs(det)); + } + } + + + contextPrototype.translate = function (aX, aY) { + var m1 = [ + [1, 0, 0], + [0, 1, 0], + [aX, aY, 1] + ]; + + setM(this, matrixMultiply(m1, this.m_), false); + }; + + contextPrototype.rotate = function (aRot) { + var c = mc(aRot); + var s = ms(aRot); + + var m1 = [ + [c, s, 0], + [-s, c, 0], + [0, 0, 1] + ]; + + setM(this, matrixMultiply(m1, this.m_), false); + }; + + contextPrototype.scale = function (aX, aY) { + var m1 = [ + [aX, 0, 0], + [0, aY, 0], + [0, 0, 1] + ]; + + setM(this, matrixMultiply(m1, this.m_), true); + }; + + contextPrototype.transform = function (m11, m12, m21, m22, dx, dy) { + var m1 = [ + [m11, m12, 0], + [m21, m22, 0], + [dx, dy, 1] + ]; + + setM(this, matrixMultiply(m1, this.m_), true); + + }; + + contextPrototype.setTransform = function (m11, m12, m21, m22, dx, dy) { + + var m = [ + [m11, m12, 0], + [m21, m22, 0], + [dx, dy, 1] + ]; + + setM(this, m, true); + }; + + /** + * The text drawing function. + * The maxWidth argument isn't taken in account, since no browser supports + * it yet. + */ + contextPrototype.drawText_ = function (text, x, y, maxWidth, stroke) { + + var vDom = this.textVDomList_[this.nTextVEl_]; + if (!vDom) { + vDom = new TextVirtualDom_(); + this.textVDomList_[this.nTextVEl_] = vDom; + } + this.nTextVEl_++; + + var el = vDom.getElement(this, text, x, y, maxWidth, stroke); + + vDom.attachTo(this.ghost_); + + this.currentVirtualDom_ = null; + }; + + contextPrototype.fillText = function (text, x, y, maxWidth) { + this.drawText_(text, x, y, maxWidth, false); + }; + + contextPrototype.strokeText = function (text, x, y, maxWidth) { + this.drawText_(text, x, y, maxWidth, true); + }; + + contextPrototype.measureText = function (text) { + if (!this.textMeasureEl_) { + var s = ''; + this.element_.insertAdjacentHTML('beforeEnd', s); + this.textMeasureEl_ = this.element_.lastChild; + } + var doc = this.element_.ownerDocument; + this.textMeasureEl_.innerHTML = ''; + this.textMeasureEl_.style.font = this.font; + // Don't use innerHTML or innerText because they allow markup/whitespace. + this.textMeasureEl_.appendChild(doc.createTextNode(text)); + return { + width: this.textMeasureEl_.offsetWidth + }; + }; + + /******** STUBS ********/ + contextPrototype.clip = function () { + // TODO: Implement + }; + + contextPrototype.arcTo = function () { + // TODO: Implement + }; + + contextPrototype.createPattern = function (image, repetition) { + return new CanvasPattern_(image, repetition); + }; + + // Gradient / Pattern Stubs + + + function CanvasGradient_(aType) { + this.type_ = aType; + this.x0_ = 0; + this.y0_ = 0; + this.r0_ = 0; + this.x1_ = 0; + this.y1_ = 0; + this.r1_ = 0; + this.colors_ = []; + } + + CanvasGradient_.prototype.addColorStop = function (aOffset, aColor) { + aColor = processStyle(aColor); + this.colors_.push({ + offset: aOffset, + color: aColor.color, + alpha: aColor.alpha + }); + }; + + function CanvasPattern_(image, repetition) { + assertImageIsValid(image); + switch (repetition) { + case 'repeat': + case null: + case '': + this.repetition_ = 'repeat'; + break + case 'repeat-x': + case 'repeat-y': + case 'no-repeat': + this.repetition_ = repetition; + break; + default: + throwException('SYNTAX_ERR'); + } + + this.src_ = image.src; + this.width_ = image.width; + this.height_ = image.height; + } + + function throwException(s) { + throw new DOMException_(s); + } + + function assertImageIsValid(img) { + if (!img || img.nodeType != 1 || img.tagName != 'IMG') { + throwException('TYPE_MISMATCH_ERR'); + } + if (img.readyState != 'complete') { + throwException('INVALID_STATE_ERR'); + } + } + + function DOMException_(s) { + this.code = this[s]; + this.message = s + ': DOM Exception ' + this.code; + } + var p = DOMException_.prototype = new Error; + p.INDEX_SIZE_ERR = 1; + p.DOMSTRING_SIZE_ERR = 2; + p.HIERARCHY_REQUEST_ERR = 3; + p.WRONG_DOCUMENT_ERR = 4; + p.INVALID_CHARACTER_ERR = 5; + p.NO_DATA_ALLOWED_ERR = 6; + p.NO_MODIFICATION_ALLOWED_ERR = 7; + p.NOT_FOUND_ERR = 8; + p.NOT_SUPPORTED_ERR = 9; + p.INUSE_ATTRIBUTE_ERR = 10; + p.INVALID_STATE_ERR = 11; + p.SYNTAX_ERR = 12; + p.INVALID_MODIFICATION_ERR = 13; + p.NAMESPACE_ERR = 14; + p.INVALID_ACCESS_ERR = 15; + p.VALIDATION_ERR = 16; + p.TYPE_MISMATCH_ERR = 17; + + // set up externs + G_vmlCanvasManager = G_vmlCanvasManager_; + CanvasRenderingContext2D = CanvasRenderingContext2D_; + CanvasGradient = CanvasGradient_; + CanvasPattern = CanvasPattern_; + DOMException = DOMException_; + })(); + +} // if +else { // make the canvas test simple by kener.linfeng@gmail.com + G_vmlCanvasManager = false; +} +module.exports = G_vmlCanvasManager; +// define \ No newline at end of file diff --git a/src/zrender/dep/excanvas3.js b/src/zrender/dep/excanvas3.js new file mode 100644 index 0000000..4827717 --- /dev/null +++ b/src/zrender/dep/excanvas3.js @@ -0,0 +1,1430 @@ +// Copyright 2006 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Known Issues: +// +// * Patterns only support repeat. +// * Radial gradient are not implemented. The VML version of these look very +// different from the canvas one. +// * Clipping paths are not implemented. +// * Coordsize. The width and height attribute have higher priority than the +// width and height style values which isn't correct. +// * Painting mode isn't implemented. +// * Canvas width/height should is using content-box by default. IE in +// Quirks mode will draw the canvas using border-box. Either change your +// doctype to HTML5 +// (http://www.whatwg.org/specs/web-apps/current-work/#the-doctype) +// or use Box Sizing Behavior from WebFX +// (http://webfx.eae.net/dhtml/boxsizing/boxsizing.html) +// * Non uniform scaling does not correctly scale strokes. +// * Optimize. There is always room for speed improvements. +// AMD by kener.linfeng@gmail.com + +// Only add this code if we do not already have a canvas implementation +if (!document.createElement('canvas').getContext) { + + (function () { + + // alias some functions to make (compiled) code shorter + var m = Math; + var mr = m.round; + var ms = m.sin; + var mc = m.cos; + var abs = m.abs; + var sqrt = m.sqrt; + + // this is used for sub pixel precision + var Z = 10; + var Z2 = Z / 2; + + var IE_VERSION = +navigator.userAgent.match(/MSIE ([\d.]+)?/)[1]; + + /** + * This funtion is assigned to the elements as element.getContext(). + * @this {HTMLElement} + * @return {CanvasRenderingContext2D_} + */ + + function getContext() { + return this.context_ || (this.context_ = new CanvasRenderingContext2D_(this)); + } + + var slice = Array.prototype.slice; + + /** + * Binds a function to an object. The returned function will always use the + * passed in {@code obj} as {@code this}. + * + * Example: + * + * g = bind(f, obj, a, b) + * g(c, d) // will do f.call(obj, a, b, c, d) + * + * @param {Function} f The function to bind the object to + * @param {Object} obj The object that should act as this when the function + * is called + * @param {*} var_args Rest arguments that will be used as the initial + * arguments when the function is called + * @return {Function} A new function that has bound this + */ + + function bind(f, obj, var_args) { + var a = slice.call(arguments, 2); + return function () { + return f.apply(obj, a.concat(slice.call(arguments))); + }; + } + + function encodeHtmlAttribute(s) { + return String(s).replace(/&/g, '&').replace(/"/g, '"'); + } + + function addNamespace(doc, prefix, urn) { + if (!doc.namespaces[prefix]) { + doc.namespaces.add(prefix, urn, '#default#VML'); + } + } + + function addNamespacesAndStylesheet(doc) { + addNamespace(doc, 'g_vml_', 'urn:schemas-microsoft-com:vml'); + addNamespace(doc, 'g_o_', 'urn:schemas-microsoft-com:office:office'); + + // Setup default CSS. Only add one style sheet per document + if (!doc.styleSheets['ex_canvas_']) { + var ss = doc.createStyleSheet(); + ss.owningElement.id = 'ex_canvas_'; + ss.cssText = 'canvas{display:inline-block;overflow:hidden;' + + // default size is 300x150 in Gecko and Opera + 'text-align:left;width:300px;height:150px}'; + } + } + + // Add namespaces and stylesheet at startup. + addNamespacesAndStylesheet(document); + + var G_vmlCanvasManager_ = { + init: function (opt_doc) { + var doc = opt_doc || document; + // Create a dummy element so that IE will allow canvas elements to be + // recognized. + doc.createElement('canvas'); + doc.attachEvent('onreadystatechange', bind(this.init_, this, doc)); + }, + + init_: function (doc) { + // find all canvas elements + var els = doc.getElementsByTagName('canvas'); + for (var i = 0; i < els.length; i++) { + this.initElement(els[i]); + } + }, + + /** + * Public initializes a canvas element so that it can be used as canvas + * element from now on. This is called automatically before the page is + * loaded but if you are creating elements using createElement you need to + * make sure this is called on the element. + * @param {HTMLElement} el The canvas element to initialize. + * @return {HTMLElement} the element that was created. + */ + initElement: function (el) { + if (!el.getContext) { + el.getContext = getContext; + + // Add namespaces and stylesheet to document of the element. + addNamespacesAndStylesheet(el.ownerDocument); + + // Remove fallback content. There is no way to hide text nodes so we + // just remove all childNodes. We could hide all elements and remove + // text nodes but who really cares about the fallback content. + el.innerHTML = ''; + + // do not use inline function because that will leak memory + el.attachEvent('onpropertychange', onPropertyChange); + el.attachEvent('onresize', onResize); + + var attrs = el.attributes; + if (attrs.width && attrs.width.specified) { + // TODO: use runtimeStyle and coordsize + // el.getContext().setWidth_(attrs.width.nodeValue); + el.style.width = attrs.width.nodeValue + 'px'; + } else { + el.width = el.clientWidth; + } + if (attrs.height && attrs.height.specified) { + // TODO: use runtimeStyle and coordsize + // el.getContext().setHeight_(attrs.height.nodeValue); + el.style.height = attrs.height.nodeValue + 'px'; + } else { + el.height = el.clientHeight; + } + //el.getContext().setCoordsize_() + } + return el; + } + }; + + function onPropertyChange(e) { + var el = e.srcElement; + + switch (e.propertyName) { + case 'width': + el.getContext().clearRect(); + el.style.width = el.attributes.width.nodeValue + 'px'; + // In IE8 this does not trigger onresize. + el.firstChild.style.width = el.clientWidth + 'px'; + break; + case 'height': + el.getContext().clearRect(); + el.style.height = el.attributes.height.nodeValue + 'px'; + el.firstChild.style.height = el.clientHeight + 'px'; + break; + } + } + + function onResize(e) { + var el = e.srcElement; + if (el.firstChild) { + el.firstChild.style.width = el.clientWidth + 'px'; + el.firstChild.style.height = el.clientHeight + 'px'; + } + } + + G_vmlCanvasManager_.init(); + + // precompute "00" to "FF" + var decToHex = []; + for (var i = 0; i < 16; i++) { + for (var j = 0; j < 16; j++) { + decToHex[i * 16 + j] = i.toString(16) + j.toString(16); + } + } + + function createMatrixIdentity() { + return [[1, 0, 0], [0, 1, 0], [0, 0, 1]]; + } + + function matrixMultiply(m1, m2) { + var result = createMatrixIdentity(); + + for (var x = 0; x < 3; x++) { + for (var y = 0; y < 3; y++) { + var sum = 0; + + for (var z = 0; z < 3; z++) { + sum += m1[x][z] * m2[z][y]; + } + + result[x][y] = sum; + } + } + return result; + } + + function getCoords(ctx, aX, aY) { + var m = ctx.m_; + return { + x: Z * (aX * m[0][0] + aY * m[1][0] + m[2][0]) - Z2, + y: Z * (aX * m[0][1] + aY * m[1][1] + m[2][1]) - Z2 + }; + }; + + function getSkewedCoords(ctx, aX, aY) { + var m = ctx.m_; + return { + x: Z * (aX * m[0][0] + aY * m[1][0]) - Z2, + y: Z * (aX * m[0][1] + aY * m[1][1]) - Z2 + }; + } + + function copyState(o1, o2) { + o2.fillStyle = o1.fillStyle; + o2.lineCap = o1.lineCap; + o2.lineJoin = o1.lineJoin; + o2.lineWidth = o1.lineWidth; + o2.miterLimit = o1.miterLimit; + o2.shadowBlur = o1.shadowBlur; + o2.shadowColor = o1.shadowColor; + o2.shadowOffsetX = o1.shadowOffsetX; + o2.shadowOffsetY = o1.shadowOffsetY; + o2.strokeStyle = o1.strokeStyle; + o2.globalAlpha = o1.globalAlpha; + o2.font = o1.font; + o2.textAlign = o1.textAlign; + o2.textBaseline = o1.textBaseline; + o2.scaleX_ = o1.scaleX_; + o2.scaleY_ = o1.scaleY_; + o2.x_ = o1.x_; + o2.y_ = o1.y_; + o2.lineScale_ = o1.lineScale_; + } + + var colorData = { + aliceblue: '#F0F8FF', + antiquewhite: '#FAEBD7', + aquamarine: '#7FFFD4', + azure: '#F0FFFF', + beige: '#F5F5DC', + bisque: '#FFE4C4', + black: '#000000', + blanchedalmond: '#FFEBCD', + blueviolet: '#8A2BE2', + brown: '#A52A2A', + burlywood: '#DEB887', + cadetblue: '#5F9EA0', + chartreuse: '#7FFF00', + chocolate: '#D2691E', + coral: '#FF7F50', + cornflowerblue: '#6495ED', + cornsilk: '#FFF8DC', + crimson: '#DC143C', + cyan: '#00FFFF', + darkblue: '#00008B', + darkcyan: '#008B8B', + darkgoldenrod: '#B8860B', + darkgray: '#A9A9A9', + darkgreen: '#006400', + darkgrey: '#A9A9A9', + darkkhaki: '#BDB76B', + darkmagenta: '#8B008B', + darkolivegreen: '#556B2F', + darkorange: '#FF8C00', + darkorchid: '#9932CC', + darkred: '#8B0000', + darksalmon: '#E9967A', + darkseagreen: '#8FBC8F', + darkslateblue: '#483D8B', + darkslategray: '#2F4F4F', + darkslategrey: '#2F4F4F', + darkturquoise: '#00CED1', + darkviolet: '#9400D3', + deeppink: '#FF1493', + deepskyblue: '#00BFFF', + dimgray: '#696969', + dimgrey: '#696969', + dodgerblue: '#1E90FF', + firebrick: '#B22222', + floralwhite: '#FFFAF0', + forestgreen: '#228B22', + gainsboro: '#DCDCDC', + ghostwhite: '#F8F8FF', + gold: '#FFD700', + goldenrod: '#DAA520', + grey: '#808080', + greenyellow: '#ADFF2F', + honeydew: '#F0FFF0', + hotpink: '#FF69B4', + indianred: '#CD5C5C', + indigo: '#4B0082', + ivory: '#FFFFF0', + khaki: '#F0E68C', + lavender: '#E6E6FA', + lavenderblush: '#FFF0F5', + lawngreen: '#7CFC00', + lemonchiffon: '#FFFACD', + lightblue: '#ADD8E6', + lightcoral: '#F08080', + lightcyan: '#E0FFFF', + lightgoldenrodyellow: '#FAFAD2', + lightgreen: '#90EE90', + lightgrey: '#D3D3D3', + lightpink: '#FFB6C1', + lightsalmon: '#FFA07A', + lightseagreen: '#20B2AA', + lightskyblue: '#87CEFA', + lightslategray: '#778899', + lightslategrey: '#778899', + lightsteelblue: '#B0C4DE', + lightyellow: '#FFFFE0', + limegreen: '#32CD32', + linen: '#FAF0E6', + magenta: '#FF00FF', + mediumaquamarine: '#66CDAA', + mediumblue: '#0000CD', + mediumorchid: '#BA55D3', + mediumpurple: '#9370DB', + mediumseagreen: '#3CB371', + mediumslateblue: '#7B68EE', + mediumspringgreen: '#00FA9A', + mediumturquoise: '#48D1CC', + mediumvioletred: '#C71585', + midnightblue: '#191970', + mintcream: '#F5FFFA', + mistyrose: '#FFE4E1', + moccasin: '#FFE4B5', + navajowhite: '#FFDEAD', + oldlace: '#FDF5E6', + olivedrab: '#6B8E23', + orange: '#FFA500', + orangered: '#FF4500', + orchid: '#DA70D6', + palegoldenrod: '#EEE8AA', + palegreen: '#98FB98', + paleturquoise: '#AFEEEE', + palevioletred: '#DB7093', + papayawhip: '#FFEFD5', + peachpuff: '#FFDAB9', + peru: '#CD853F', + pink: '#FFC0CB', + plum: '#DDA0DD', + powderblue: '#B0E0E6', + rosybrown: '#BC8F8F', + royalblue: '#4169E1', + saddlebrown: '#8B4513', + salmon: '#FA8072', + sandybrown: '#F4A460', + seagreen: '#2E8B57', + seashell: '#FFF5EE', + sienna: '#A0522D', + skyblue: '#87CEEB', + slateblue: '#6A5ACD', + slategray: '#708090', + slategrey: '#708090', + snow: '#FFFAFA', + springgreen: '#00FF7F', + steelblue: '#4682B4', + tan: '#D2B48C', + thistle: '#D8BFD8', + tomato: '#FF6347', + turquoise: '#40E0D0', + violet: '#EE82EE', + wheat: '#F5DEB3', + whitesmoke: '#F5F5F5', + yellowgreen: '#9ACD32' + }; + + + function getRgbHslContent(styleString) { + var start = styleString.indexOf('(', 3); + var end = styleString.indexOf(')', start + 1); + var parts = styleString.substring(start + 1, end).split(','); + // add alpha if needed + if (parts.length != 4 || styleString.charAt(3) != 'a') { + parts[3] = 1; + } + return parts; + } + + function percent(s) { + return parseFloat(s) / 100; + } + + function clamp(v, min, max) { + return Math.min(max, Math.max(min, v)); + } + + function hslToRgb(parts) { + var r, g, b, h, s, l; + h = parseFloat(parts[0]) / 360 % 360; + if (h < 0) h++; + s = clamp(percent(parts[1]), 0, 1); + l = clamp(percent(parts[2]), 0, 1); + if (s == 0) { + r = g = b = l; // achromatic + } else { + var q = l < 0.5 ? l * (1 + s) : l + s - l * s; + var p = 2 * l - q; + r = hueToRgb(p, q, h + 1 / 3); + g = hueToRgb(p, q, h); + b = hueToRgb(p, q, h - 1 / 3); + } + + return '#' + decToHex[Math.floor(r * 255)] + decToHex[Math.floor(g * 255)] + decToHex[Math.floor(b * 255)]; + } + + function hueToRgb(m1, m2, h) { + if (h < 0) h++; + if (h > 1) h--; + + if (6 * h < 1) return m1 + (m2 - m1) * 6 * h; + else if (2 * h < 1) return m2; + else if (3 * h < 2) return m1 + (m2 - m1) * (2 / 3 - h) * 6; + else return m1; + } + + var processStyleCache = {}; + + function processStyle(styleString) { + if (styleString in processStyleCache) { + return processStyleCache[styleString]; + } + + var str, alpha = 1; + + styleString = String(styleString); + if (styleString.charAt(0) == '#') { + str = styleString; + } else if (/^rgb/.test(styleString)) { + var parts = getRgbHslContent(styleString); + var str = '#', + n; + for (var i = 0; i < 3; i++) { + if (parts[i].indexOf('%') != -1) { + n = Math.floor(percent(parts[i]) * 255); + } else { + n = +parts[i]; + } + str += decToHex[clamp(n, 0, 255)]; + } + alpha = +parts[3]; + } else if (/^hsl/.test(styleString)) { + var parts = getRgbHslContent(styleString); + str = hslToRgb(parts); + alpha = parts[3]; + } else { + str = colorData[styleString] || styleString; + } + return processStyleCache[styleString] = { + color: str, + alpha: alpha + }; + } + + var DEFAULT_STYLE = { + style: 'normal', + variant: 'normal', + weight: 'normal', + size: 12, + //10 + family: '微软雅黑' //'sans-serif' + }; + + // Internal text style cache + var fontStyleCache = {}; + + function processFontStyle(styleString) { + if (fontStyleCache[styleString]) { + return fontStyleCache[styleString]; + } + + var el = document.createElement('div'); + var style = el.style; + var fontFamily; + try { + style.font = styleString; + fontFamily = style.fontFamily.split(',')[0]; + } catch (ex) { + // Ignore failures to set to invalid font. + } + + return fontStyleCache[styleString] = { + style: style.fontStyle || DEFAULT_STYLE.style, + variant: style.fontVariant || DEFAULT_STYLE.variant, + weight: style.fontWeight || DEFAULT_STYLE.weight, + size: style.fontSize || DEFAULT_STYLE.size, + family: fontFamily || DEFAULT_STYLE.family + }; + } + + function getComputedStyle(style, element) { + var computedStyle = {}; + + for (var p in style) { + computedStyle[p] = style[p]; + } + + // Compute the size + var canvasFontSize = parseFloat(element.currentStyle.fontSize), + fontSize = parseFloat(style.size); + + if (typeof style.size == 'number') { + computedStyle.size = style.size; + } else if (style.size.indexOf('px') != -1) { + computedStyle.size = fontSize; + } else if (style.size.indexOf('em') != -1) { + computedStyle.size = canvasFontSize * fontSize; + } else if (style.size.indexOf('%') != -1) { + computedStyle.size = (canvasFontSize / 100) * fontSize; + } else if (style.size.indexOf('pt') != -1) { + computedStyle.size = fontSize / .75; + } else { + computedStyle.size = canvasFontSize; + } + + // Different scaling between normal text and VML text. This was found using + // trial and error to get the same size as non VML text. + //computedStyle.size *= 0.981; + return computedStyle; + } + + function buildStyle(style) { + return style.style + ' ' + style.variant + ' ' + style.weight + ' ' + style.size + "px '" + style.family + "'"; + } + + var lineCapMap = { + 'butt': 'flat', + 'round': 'round' + }; + + function processLineCap(lineCap) { + return lineCapMap[lineCap] || 'square'; + } + + /** + * This class implements CanvasRenderingContext2D interface as described by + * the WHATWG. + * @param {HTMLElement} canvasElement The element that the 2D context should + * be associated with + */ + + function CanvasRenderingContext2D_(canvasElement) { + this.m_ = createMatrixIdentity(); + + this.mStack_ = []; + this.aStack_ = []; + this.currentPath_ = []; + + // Canvas context properties + this.strokeStyle = '#000'; + this.fillStyle = '#000'; + + this.lineWidth = 1; + this.lineJoin = 'miter'; + this.lineCap = 'butt'; + this.miterLimit = Z * 1; + this.globalAlpha = 1; + // this.font = '10px sans-serif'; + this.font = '12px 微软雅黑'; // 决定还是改这吧,影响代价最小 + this.textAlign = 'left'; + this.textBaseline = 'alphabetic'; + this.canvas = canvasElement; + + var cssText = 'width:' + canvasElement.clientWidth + 'px;height:' + canvasElement.clientHeight + 'px;overflow:hidden;position:absolute'; + var el = canvasElement.ownerDocument.createElement('div'); + el.style.cssText = cssText; + canvasElement.appendChild(el); + + var overlayEl = el.cloneNode(false); + // Use a non transparent background. + overlayEl.style.backgroundColor = '#fff'; //red, I don't know why, it work! + overlayEl.style.filter = 'alpha(opacity=0)'; + canvasElement.appendChild(overlayEl); + + this.element_ = el; + this.scaleX_ = 1; + this.scaleY_ = 1; + this.x_ = 0; + this.y_ = 0; + this.lineScale_ = 1; + + this.html_ = ''; + } + + var contextPrototype = CanvasRenderingContext2D_.prototype; + contextPrototype.clearRect = function () { + if (this.textMeasureEl_) { + this.textMeasureEl_.removeNode(true); + this.textMeasureEl_ = null; + } + this.element_.innerHTML = ''; + }; + + contextPrototype.flush = function () { + this.element_.insertAdjacentHTML('beforeEnd', this.html_); + this.html_ = ''; + } + + contextPrototype.beginPath = function () { + // TODO: Branch current matrix so that save/restore has no effect + // as per safari docs. + this.currentPath_ = []; + }; + + contextPrototype.moveTo = function (aX, aY) { + var p = getSkewedCoords(this, aX, aY); + p.type = 'moveTo'; + this.currentPath_.push(p); + this.currentX_ = p.x; + this.currentY_ = p.y; + }; + + contextPrototype.lineTo = function (aX, aY) { + var p = getSkewedCoords(this, aX, aY); + p.type = 'lineTo'; + this.currentPath_.push(p); + + this.currentX_ = p.x; + this.currentY_ = p.y; + }; + + contextPrototype.bezierCurveTo = function (aCP1x, aCP1y, aCP2x, aCP2y, aX, aY) { + var p = getSkewedCoords(this, aX, aY); + var cp1 = getSkewedCoords(this, aCP1x, aCP1y); + var cp2 = getSkewedCoords(this, aCP2x, aCP2y); + bezierCurveTo(this, cp1, cp2, p); + }; + + // Helper function that takes the already fixed cordinates. + + + function bezierCurveTo(self, cp1, cp2, p) { + self.currentPath_.push({ + type: 'bezierCurveTo', + cp1x: cp1.x, + cp1y: cp1.y, + cp2x: cp2.x, + cp2y: cp2.y, + x: p.x, + y: p.y + }); + self.currentX_ = p.x; + self.currentY_ = p.y; + } + + contextPrototype.quadraticCurveTo = function (aCPx, aCPy, aX, aY) { + // the following is lifted almost directly from + // http://developer.mozilla.org/en/docs/Canvas_tutorial:Drawing_shapes + var cp = getSkewedCoords(this, aCPx, aCPy); + var p = getSkewedCoords(this, aX, aY); + + var cp1 = { + x: this.currentX_ + 2.0 / 3.0 * (cp.x - this.currentX_), + y: this.currentY_ + 2.0 / 3.0 * (cp.y - this.currentY_) + }; + var cp2 = { + x: cp1.x + (p.x - this.currentX_) / 3.0, + y: cp1.y + (p.y - this.currentY_) / 3.0 + }; + + bezierCurveTo(this, cp1, cp2, p); + }; + + contextPrototype.arc = function (aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise) { + aRadius *= Z; + var arcType = aClockwise ? 'at' : 'wa'; + + var xStart = aX + mc(aStartAngle) * aRadius - Z2; + var yStart = aY + ms(aStartAngle) * aRadius - Z2; + + var xEnd = aX + mc(aEndAngle) * aRadius - Z2; + var yEnd = aY + ms(aEndAngle) * aRadius - Z2; + + // IE won't render arches drawn counter clockwise if xStart == xEnd. + if (xStart == xEnd && !aClockwise) { + xStart += 0.125; // Offset xStart by 1/80 of a pixel. Use something + // that can be represented in binary + } + + var p = getSkewedCoords(this, aX, aY); + var pStart = getSkewedCoords(this, xStart, yStart); + var pEnd = getSkewedCoords(this, xEnd, yEnd); + + this.currentPath_.push({ + type: arcType, + x: p.x, + y: p.y, + radius: aRadius, + xStart: pStart.x, + yStart: pStart.y, + xEnd: pEnd.x, + yEnd: pEnd.y + }); + + }; + + contextPrototype.rect = function (aX, aY, aWidth, aHeight) { + this.moveTo(aX, aY); + this.lineTo(aX + aWidth, aY); + this.lineTo(aX + aWidth, aY + aHeight); + this.lineTo(aX, aY + aHeight); + this.closePath(); + }; + + contextPrototype.strokeRect = function (aX, aY, aWidth, aHeight) { + var oldPath = this.currentPath_; + this.beginPath(); + + this.moveTo(aX, aY); + this.lineTo(aX + aWidth, aY); + this.lineTo(aX + aWidth, aY + aHeight); + this.lineTo(aX, aY + aHeight); + this.closePath(); + this.stroke(); + + this.currentPath_ = oldPath; + }; + + contextPrototype.fillRect = function (aX, aY, aWidth, aHeight) { + var oldPath = this.currentPath_; + this.beginPath(); + + this.moveTo(aX, aY); + this.lineTo(aX + aWidth, aY); + this.lineTo(aX + aWidth, aY + aHeight); + this.lineTo(aX, aY + aHeight); + this.closePath(); + this.fill(); + + this.currentPath_ = oldPath; + }; + + contextPrototype.createLinearGradient = function (aX0, aY0, aX1, aY1) { + var gradient = new CanvasGradient_('gradient'); + gradient.x0_ = aX0; + gradient.y0_ = aY0; + gradient.x1_ = aX1; + gradient.y1_ = aY1; + return gradient; + }; + + contextPrototype.createRadialGradient = function (aX0, aY0, aR0, aX1, aY1, aR1) { + var gradient = new CanvasGradient_('gradientradial'); + gradient.x0_ = aX0; + gradient.y0_ = aY0; + gradient.r0_ = aR0; + gradient.x1_ = aX1; + gradient.y1_ = aY1; + gradient.r1_ = aR1; + return gradient; + }; + + contextPrototype.drawImage = function (image, var_args) { + var dx, dy, dw, dh, sx, sy, sw, sh; + + // to find the original width we overide the width and height + var oldRuntimeWidth = image.runtimeStyle.width; + var oldRuntimeHeight = image.runtimeStyle.height; + image.runtimeStyle.width = 'auto'; + image.runtimeStyle.height = 'auto'; + + // get the original size + var w = image.width; + var h = image.height; + var m_ = this.m_; + + // and remove overides + image.runtimeStyle.width = oldRuntimeWidth; + image.runtimeStyle.height = oldRuntimeHeight; + + if (arguments.length == 3) { + dx = arguments[1]; + dy = arguments[2]; + sx = sy = 0; + sw = dw = w; + sh = dh = h; + } else if (arguments.length == 5) { + dx = arguments[1]; + dy = arguments[2]; + dw = arguments[3]; + dh = arguments[4]; + sx = sy = 0; + sw = w; + sh = h; + } else if (arguments.length == 9) { + sx = arguments[1]; + sy = arguments[2]; + sw = arguments[3]; + sh = arguments[4]; + dx = arguments[5]; + dy = arguments[6]; + dw = arguments[7]; + dh = arguments[8]; + } else { + throw Error('Invalid number of arguments'); + } + + var w2 = sw / 2; + var h2 = sh / 2; + + var vmlStr = []; + + var W = 10; + var H = 10; + + var skewed = m_[1] || m_[2]; + var cropped = sx || sy; + + var scaleX = this.scaleX_; + var scaleY = this.scaleY_; + + var x = this.x_ + dx * scaleX; + var y = this.y_ + dy * scaleY; + // If filters are necessary (rotation exists), create them + // filters are bog-slow, so only create them if abbsolutely necessary + // The following check doesn't account for skews (which don't exist + // in the canvas spec (yet) anyway. + if (!skewed || !cropped) { + vmlStr.push(''); + } else if (skewed) { + // For some reason that I've now forgotten, using divs didn't work + vmlStr.push(' "); + + if (cropped) { + vmlStr.push('
'); + } + + vmlStr.push(''); + if (cropped) { + vmlStr.push('
'); + } + vmlStr.push('') + } else { + // Apply scales to width and height + vmlStr.push('
'); + + vmlStr.push('
'); + } + + this.html_ += vmlStr.join(''); + }; + + contextPrototype.stroke = function (aFill) { + var lineStr = []; + var lineOpen = false; + + var W = 10; + var H = 10; + + var x_ = this.x_; + var y_ = this.y_; + + lineStr.push(''); + + if (!aFill) { + appendStroke(this, lineStr); + } else { + appendFill(this, lineStr, min, max); + } + + lineStr.push(''); + + this.html_ += lineStr.join(''); + }; + + function appendStroke(ctx, lineStr) { + var a = processStyle(ctx.strokeStyle); + var color = a.color; + var opacity = a.alpha * ctx.globalAlpha; + var lineWidth = ctx.lineScale_ * ctx.lineWidth; + + // VML cannot correctly render a line if the width is less than 1px. + // In that case, we dilute the color to make the line look thinner. + if (lineWidth < 1) { + opacity *= lineWidth; + } + + lineStr.push(''); + } + + function appendFill(ctx, lineStr, min, max) { + var fillStyle = ctx.fillStyle; + var arcScaleX = ctx.scaleX_; + var arcScaleY = ctx.scaleY_; + var width = max.x - min.x; + var height = max.y - min.y; + if (fillStyle instanceof CanvasGradient_) { + // TODO: Gradients transformed with the transformation matrix. + var angle = 0; + var focus = { + x: 0, + y: 0 + }; + + // additional offset + var shift = 0; + // scale factor for offset + var expansion = 1; + + if (fillStyle.type_ == 'gradient') { + var x0 = fillStyle.x0_ / arcScaleX; + var y0 = fillStyle.y0_ / arcScaleY; + var x1 = fillStyle.x1_ / arcScaleX; + var y1 = fillStyle.y1_ / arcScaleY; + var p0 = getCoords(ctx, x0, y0); + var p1 = getCoords(ctx, x1, y1); + var dx = p1.x - p0.x; + var dy = p1.y - p0.y; + angle = Math.atan2(dx, dy) * 180 / Math.PI; + + // The angle should be a non-negative number. + if (angle < 0) { + angle += 360; + } + + // Very small angles produce an unexpected result because they are + // converted to a scientific notation string. + if (angle < 1e-6) { + angle = 0; + } + } else { + var p0 = getCoords(ctx, fillStyle.x0_, fillStyle.y0_); + focus = { + x: (p0.x - min.x) / width, + y: (p0.y - min.y) / height + }; + + width /= arcScaleX * Z; + height /= arcScaleY * Z; + var dimension = m.max(width, height); + shift = 2 * fillStyle.r0_ / dimension; + expansion = 2 * fillStyle.r1_ / dimension - shift; + } + + // We need to sort the color stops in ascending order by offset, + // otherwise IE won't interpret it correctly. + var stops = fillStyle.colors_; + stops.sort(function (cs1, cs2) { + return cs1.offset - cs2.offset; + }); + + var length = stops.length; + var color1 = stops[0].color; + var color2 = stops[length - 1].color; + var opacity1 = stops[0].alpha * ctx.globalAlpha; + var opacity2 = stops[length - 1].alpha * ctx.globalAlpha; + + var colors = []; + for (var i = 0; i < length; i++) { + var stop = stops[i]; + colors.push(stop.offset * expansion + shift + ' ' + stop.color); + } + + // When colors attribute is used, the meanings of opacity and o:opacity2 + // are reversed. + lineStr.push(''); + } else if (fillStyle instanceof CanvasPattern_) { + if (width && height) { + var deltaLeft = -min.x; + var deltaTop = -min.y; + lineStr.push(''); + } + } else { + var a = processStyle(ctx.fillStyle); + var color = a.color; + var opacity = a.alpha * ctx.globalAlpha; + lineStr.push(''); + } + } + + contextPrototype.fill = function () { + this.stroke(true); + }; + + contextPrototype.closePath = function () { + this.currentPath_.push({ + type: 'close' + }); + }; + + contextPrototype.save = function () { + var o = {}; + copyState(this, o); + this.aStack_.push(o); + this.mStack_.push(this.m_); + this.m_ = matrixMultiply(createMatrixIdentity(), this.m_); + }; + + contextPrototype.restore = function () { + if (this.aStack_.length) { + copyState(this.aStack_.pop(), this); + this.m_ = this.mStack_.pop(); + } + }; + + function matrixIsFinite(m) { + return isFinite(m[0][0]) && isFinite(m[0][1]) && isFinite(m[1][0]) && isFinite(m[1][1]) && isFinite(m[2][0]) && isFinite(m[2][1]); + } + + function setM(ctx, m, updateLineScale) { + if (!matrixIsFinite(m)) { + return; + } + ctx.m_ = m; + + ctx.scaleX_ = Math.sqrt(m[0][0] * m[0][0] + m[0][1] * m[0][1]); + ctx.scaleY_ = Math.sqrt(m[1][0] * m[1][0] + m[1][1] * m[1][1]); + ctx.x_ = m[2][0]; + ctx.y_ = m[2][1]; + + if (updateLineScale) { + // Get the line scale. + // Determinant of this.m_ means how much the area is enlarged by the + // transformation. So its square root can be used as a scale factor + // for width. + var det = m[0][0] * m[1][1] - m[0][1] * m[1][0]; + ctx.lineScale_ = sqrt(abs(det)); + } + } + + + contextPrototype.translate = function (aX, aY) { + var m1 = [ + [1, 0, 0], + [0, 1, 0], + [aX, aY, 1] + ]; + + setM(this, matrixMultiply(m1, this.m_), false); + }; + + contextPrototype.rotate = function (aRot) { + var c = mc(aRot); + var s = ms(aRot); + + var m1 = [ + [c, s, 0], + [-s, c, 0], + [0, 0, 1] + ]; + + setM(this, matrixMultiply(m1, this.m_), false); + }; + + + contextPrototype.scale = function (aX, aY) { + var m1 = [ + [aX, 0, 0], + [0, aY, 0], + [0, 0, 1] + ]; + + setM(this, matrixMultiply(m1, this.m_), true); + }; + + contextPrototype.transform = function (m11, m12, m21, m22, dx, dy) { + var m1 = [ + [m11, m12, 0], + [m21, m22, 0], + [dx, dy, 1] + ]; + + setM(this, matrixMultiply(m1, this.m_), true); + + }; + + contextPrototype.setTransform = function (m11, m12, m21, m22, dx, dy) { + + var m = [ + [m11, m12, 0], + [m21, m22, 0], + [dx, dy, 1] + ]; + + setM(this, m, true); + }; + /** + * The text drawing function. + * The maxWidth argument isn't taken in account, since no browser supports + * it yet. + */ + contextPrototype.drawText_ = function (text, x, y, maxWidth, stroke) { + var m = this.m_, + delta = 1000, + left = 0, + right = delta, + offset = { + x: 0, + y: 0 + }, + lineStr = []; + + var fontStyle = getComputedStyle(processFontStyle(this.font), this.element_); + + var fontStyleString = buildStyle(fontStyle); + + var elementStyle = this.element_.currentStyle; + var textAlign = this.textAlign.toLowerCase(); + switch (textAlign) { + case 'left': + case 'center': + case 'right': + break; + case 'end': + textAlign = elementStyle.direction == 'ltr' ? 'right' : 'left'; + break; + case 'start': + textAlign = elementStyle.direction == 'rtl' ? 'right' : 'left'; + break; + default: + textAlign = 'left'; + } + + // 1.75 is an arbitrary number, as there is no info about the text baseline + switch (this.textBaseline) { + case 'hanging': + case 'top': + offset.y = fontStyle.size / 1.75; + break; + case 'middle': + break; + default: + case null: + case 'alphabetic': + case 'ideographic': + case 'bottom': + offset.y = -fontStyle.size / 2.25; + break; + } + + switch (textAlign) { + case 'right': + left = delta; + right = 0.05; + break; + case 'center': + left = right = delta / 2; + break; + } + + var d = getCoords(this, x + offset.x, y + offset.y); + + lineStr.push(''); + + if (stroke) { + appendStroke(this, lineStr); + } else { + // TODO: Fix the min and max params. + appendFill(this, lineStr, { + x: -left, + y: 0 + }, { + x: right, + y: fontStyle.size + }); + } + + var skewM = m[0][0].toFixed(3) + ',' + m[1][0].toFixed(3) + ',' + m[0][1].toFixed(3) + ',' + m[1][1].toFixed(3) + ',0,0'; + + var skewOffset = mr(d.x / Z) + ',' + mr(d.y / Z); + + lineStr.push('', '', ''); + + this.html_ += lineStr.join(''); + }; + + contextPrototype.fillText = function (text, x, y, maxWidth) { + this.drawText_(text, x, y, maxWidth, false); + }; + + contextPrototype.strokeText = function (text, x, y, maxWidth) { + this.drawText_(text, x, y, maxWidth, true); + }; + + contextPrototype.measureText = function (text) { + if (!this.textMeasureEl_) { + var s = ''; + this.element_.insertAdjacentHTML('beforeEnd', s); + this.textMeasureEl_ = this.element_.lastChild; + } + var doc = this.element_.ownerDocument; + this.textMeasureEl_.innerHTML = ''; + this.textMeasureEl_.style.font = this.font; + // Don't use innerHTML or innerText because they allow markup/whitespace. + this.textMeasureEl_.appendChild(doc.createTextNode(text)); + return { + width: this.textMeasureEl_.offsetWidth + }; + }; + + /******** STUBS ********/ + contextPrototype.clip = function () { + // TODO: Implement + }; + + contextPrototype.arcTo = function () { + // TODO: Implement + }; + + contextPrototype.createPattern = function (image, repetition) { + return new CanvasPattern_(image, repetition); + }; + + // Gradient / Pattern Stubs + + + function CanvasGradient_(aType) { + this.type_ = aType; + this.x0_ = 0; + this.y0_ = 0; + this.r0_ = 0; + this.x1_ = 0; + this.y1_ = 0; + this.r1_ = 0; + this.colors_ = []; + } + + CanvasGradient_.prototype.addColorStop = function (aOffset, aColor) { + aColor = processStyle(aColor); + this.colors_.push({ + offset: aOffset, + color: aColor.color, + alpha: aColor.alpha + }); + }; + + function CanvasPattern_(image, repetition) { + assertImageIsValid(image); + switch (repetition) { + case 'repeat': + case null: + case '': + this.repetition_ = 'repeat'; + break + case 'repeat-x': + case 'repeat-y': + case 'no-repeat': + this.repetition_ = repetition; + break; + default: + throwException('SYNTAX_ERR'); + } + + this.src_ = image.src; + this.width_ = image.width; + this.height_ = image.height; + } + + function throwException(s) { + throw new DOMException_(s); + } + + function assertImageIsValid(img) { + if (!img || img.nodeType != 1 || img.tagName != 'IMG') { + throwException('TYPE_MISMATCH_ERR'); + } + if (img.readyState != 'complete') { + throwException('INVALID_STATE_ERR'); + } + } + + function DOMException_(s) { + this.code = this[s]; + this.message = s + ': DOM Exception ' + this.code; + } + var p = DOMException_.prototype = new Error; + p.INDEX_SIZE_ERR = 1; + p.DOMSTRING_SIZE_ERR = 2; + p.HIERARCHY_REQUEST_ERR = 3; + p.WRONG_DOCUMENT_ERR = 4; + p.INVALID_CHARACTER_ERR = 5; + p.NO_DATA_ALLOWED_ERR = 6; + p.NO_MODIFICATION_ALLOWED_ERR = 7; + p.NOT_FOUND_ERR = 8; + p.NOT_SUPPORTED_ERR = 9; + p.INUSE_ATTRIBUTE_ERR = 10; + p.INVALID_STATE_ERR = 11; + p.SYNTAX_ERR = 12; + p.INVALID_MODIFICATION_ERR = 13; + p.NAMESPACE_ERR = 14; + p.INVALID_ACCESS_ERR = 15; + p.VALIDATION_ERR = 16; + p.TYPE_MISMATCH_ERR = 17; + + // set up externs + G_vmlCanvasManager = G_vmlCanvasManager_; + CanvasRenderingContext2D = CanvasRenderingContext2D_; + CanvasGradient = CanvasGradient_; + CanvasPattern = CanvasPattern_; + DOMException = DOMException_; + })(); + +} // if +else { // make the canvas test simple by kener.linfeng@gmail.com + G_vmlCanvasManager = false; +} +module.exports = G_vmlCanvasManager; +// define \ No newline at end of file diff --git a/src/zrender/loadingEffect/Base.js b/src/zrender/loadingEffect/Base.js index 478de98..54e59bb 100644 --- a/src/zrender/loadingEffect/Base.js +++ b/src/zrender/loadingEffect/Base.js @@ -1,7 +1,7 @@ /** * zrender: loading特效类 * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * errorrik (errorrik@gmail.com) */ @@ -117,4 +117,37 @@ Base.prototype.adjust = function (value, region) { return value; }; +Base.prototype.getLocation = function (loc, totalWidth, totalHeight) { + var x = loc.x != null ? loc.x : 'center'; + switch (x) { + case 'center': + x = Math.floor((this.canvasWidth - totalWidth) / 2); + break; + case 'left': + x = 0; + break; + case 'right': + x = this.canvasWidth - totalWidth; + break; + } + var y = loc.y != null ? loc.y : 'center'; + switch (y) { + case 'center': + y = Math.floor((this.canvasHeight - totalHeight) / 2); + break; + case 'top': + y = 0; + break; + case 'bottom': + y = this.canvasHeight - totalHeight; + break; + } + return { + x: x, + y: y, + width: totalWidth, + height: totalHeight + }; +}; + module.exports = Base; \ No newline at end of file diff --git a/src/zrender/loadingEffect/Ring.js b/src/zrender/loadingEffect/Ring.js index 015cf0a..6d57d89 100644 --- a/src/zrender/loadingEffect/Ring.js +++ b/src/zrender/loadingEffect/Ring.js @@ -138,7 +138,7 @@ Ring.prototype._start = function (addShapeHandle, refreshHandle) { n += n >= 20 ? -20 : 1; - //shapeRing.highlightStyle.text = n * 5 + '%'; + // shapeRing.highlightStyle.text = n * 5 + '%'; addShapeHandle(shapeRing); for (var i = 0; i < 20; i++) { diff --git a/src/zrender/loadingEffect/Spin.js b/src/zrender/loadingEffect/Spin.js index 4307cc8..77788c4 100644 --- a/src/zrender/loadingEffect/Spin.js +++ b/src/zrender/loadingEffect/Spin.js @@ -1,6 +1,7 @@ var Base = require('./Base.js'); var util = require('../tool/util.js'); var zrColor = require('../tool/color.js'); +var zrArea = require('../tool/area.js'); var SectorShape = require('../shape/Sector.js'); function Spin(options) { @@ -15,11 +16,25 @@ util.inherits(Spin, Base); * @param {Object} refreshHandle */ Spin.prototype._start = function (addShapeHandle, refreshHandle) { + var options = util.merge( + this.options, { + textStyle: { + color: '#fff', + textAlign: 'start' + }, + backgroundColor: 'rgba(0, 0, 0, 0.8)' + }); + var textShape = this.createTextShape(options.textStyle); + + var textGap = 10; + var textWidth = zrArea.getTextWidth( + textShape.highlightStyle.text, textShape.highlightStyle.textFont); + var textHeight = zrArea.getTextHeight( + textShape.highlightStyle.text, textShape.highlightStyle.textFont); + // 特效默认配置 var effectOption = util.merge( this.options.effect || {}, { - x: this.canvasWidth / 2 - 80, - y: this.canvasHeight / 2, r0: 9, r: 15, n: 18, @@ -27,20 +42,13 @@ Spin.prototype._start = function (addShapeHandle, refreshHandle) { timeInterval: 100 }); - var options = util.merge( - this.options, { - textStyle: { - color: '#fff', - x: effectOption.x + effectOption.r + 10, - y: effectOption.y, - textAlign: 'start' - }, - backgroundColor: 'rgba(0, 0, 0, 0.8)' - }); + var location = this.getLocation( + this.options.textStyle, textWidth + textGap + effectOption.r * 2, Math.max(effectOption.r * 2, textHeight)); + effectOption.x = location.x + effectOption.r; + effectOption.y = textShape.highlightStyle.y = location.y + location.height / 2; + textShape.highlightStyle.x = effectOption.x + effectOption.r + textGap; - var textShape = this.createTextShape(options.textStyle); var background = this.createBackgroundShape(options.backgroundColor); - var n = effectOption.n; var x = effectOption.x; var y = effectOption.y; diff --git a/src/zrender/loadingEffect/Whirling.js b/src/zrender/loadingEffect/Whirling.js index ba5ec5b..c7e9fd0 100644 --- a/src/zrender/loadingEffect/Whirling.js +++ b/src/zrender/loadingEffect/Whirling.js @@ -1,5 +1,6 @@ var Base = require('./Base.js'); var util = require('../tool/util.js'); +var zrArea = require('../tool/area.js'); var RingShape = require('../shape/Ring.js'); var DropletShape = require('../shape/Droplet.js'); var CircleShape = require('../shape/Circle.js'); @@ -16,11 +17,25 @@ util.inherits(Whirling, Base); * @param {Object} refreshHandle */ Whirling.prototype._start = function (addShapeHandle, refreshHandle) { + var options = util.merge( + this.options, { + textStyle: { + color: '#888', + textAlign: 'start' + }, + backgroundColor: 'rgba(250, 250, 250, 0.8)' + }); + var textShape = this.createTextShape(options.textStyle); + + var textGap = 10; + var textWidth = zrArea.getTextWidth( + textShape.highlightStyle.text, textShape.highlightStyle.textFont); + var textHeight = zrArea.getTextHeight( + textShape.highlightStyle.text, textShape.highlightStyle.textFont); + // 特效默认配置 var effectOption = util.merge( this.options.effect || {}, { - x: this.canvasWidth / 2 - 80, - y: this.canvasHeight / 2, r: 18, colorIn: '#fff', colorOut: '#555', @@ -28,20 +43,13 @@ Whirling.prototype._start = function (addShapeHandle, refreshHandle) { timeInterval: 50 }); - var options = util.merge( - this.options, { - textStyle: { - color: '#888', - x: effectOption.x + effectOption.r + 10, - y: effectOption.y, - textAlign: 'start' - }, - backgroundColor: 'rgba(250, 250, 250, 0.8)' - }); + var location = this.getLocation( + this.options.textStyle, textWidth + textGap + effectOption.r * 2, Math.max(effectOption.r * 2, textHeight)); + effectOption.x = location.x + effectOption.r; + effectOption.y = textShape.highlightStyle.y = location.y + location.height / 2; + textShape.highlightStyle.x = effectOption.x + effectOption.r + textGap; - var textShape = this.createTextShape(options.textStyle); var background = this.createBackgroundShape(options.backgroundColor); - // 初始化动画元素 var droplet = new DropletShape({ highlightStyle: { diff --git a/src/zrender/mixin/Eventful.js b/src/zrender/mixin/Eventful.js new file mode 100644 index 0000000..76d07bd --- /dev/null +++ b/src/zrender/mixin/Eventful.js @@ -0,0 +1,266 @@ +/** + * 事件扩展 + * @module zrender/mixin/Eventful + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + * pissang (https://www.github.com/pissang) + */ + + +/** + * 事件分发器 + * @alias module:zrender/mixin/Eventful + * @constructor + */ +var Eventful = function () { + this._handlers = {}; +}; +/** + * 单次触发绑定,dispatch后销毁 + * + * @param {string} event 事件名 + * @param {Function} handler 响应函数 + * @param {Object} context + */ +Eventful.prototype.one = function (event, handler, context) { + var _h = this._handlers; + + if (!handler || !event) { + return this; + } + + if (!_h[event]) { + _h[event] = []; + } + + _h[event].push({ + h: handler, + one: true, + ctx: context || this + }); + + return this; +}; + +/** + * 绑定事件 + * @param {string} event 事件名 + * @param {Function} handler 事件处理函数 + * @param {Object} [context] + */ +Eventful.prototype.bind = function (event, handler, context) { + var _h = this._handlers; + + if (!handler || !event) { + return this; + } + + if (!_h[event]) { + _h[event] = []; + } + + _h[event].push({ + h: handler, + one: false, + ctx: context || this + }); + + return this; +}; + +/** + * 解绑事件 + * @param {string} event 事件名 + * @param {Function} [handler] 事件处理函数 + */ +Eventful.prototype.unbind = function (event, handler) { + var _h = this._handlers; + + if (!event) { + this._handlers = {}; + return this; + } + + if (handler) { + if (_h[event]) { + var newList = []; + for (var i = 0, l = _h[event].length; i < l; i++) { + if (_h[event][i]['h'] != handler) { + newList.push(_h[event][i]); + } + } + _h[event] = newList; + } + + if (_h[event] && _h[event].length === 0) { + delete _h[event]; + } + } + else { + delete _h[event]; + } + + return this; +}; + +/** + * 事件分发 + * + * @param {string} type 事件类型 + */ +Eventful.prototype.dispatch = function (type) { + if (this._handlers[type]) { + var args = arguments; + var argLen = args.length; + + if (argLen > 3) { + args = Array.prototype.slice.call(args, 1); + } + + var _h = this._handlers[type]; + var len = _h.length; + for (var i = 0; i < len;) { + // Optimize advise from backbone + switch (argLen) { + case 1: + _h[i]['h'].call(_h[i]['ctx']); + break; + case 2: + _h[i]['h'].call(_h[i]['ctx'], args[1]); + break; + case 3: + _h[i]['h'].call(_h[i]['ctx'], args[1], args[2]); + break; + default: + // have more than 2 given arguments + _h[i]['h'].apply(_h[i]['ctx'], args); + break; + } + + if (_h[i]['one']) { + _h.splice(i, 1); + len--; + } + else { + i++; + } + } + } + + return this; +}; + +/** + * 带有context的事件分发, 最后一个参数是事件回调的context + * @param {string} type 事件类型 + */ +Eventful.prototype.dispatchWithContext = function (type) { + if (this._handlers[type]) { + var args = arguments; + var argLen = args.length; + + if (argLen > 4) { + args = Array.prototype.slice.call(args, 1, args.length - 1); + } + var ctx = args[args.length - 1]; + + var _h = this._handlers[type]; + var len = _h.length; + for (var i = 0; i < len;) { + // Optimize advise from backbone + switch (argLen) { + case 1: + _h[i]['h'].call(ctx); + break; + case 2: + _h[i]['h'].call(ctx, args[1]); + break; + case 3: + _h[i]['h'].call(ctx, args[1], args[2]); + break; + default: + // have more than 2 given arguments + _h[i]['h'].apply(ctx, args); + break; + } + + if (_h[i]['one']) { + _h.splice(i, 1); + len--; + } + else { + i++; + } + } + } + + return this; +}; + +// 对象可以通过 onxxxx 绑定事件 +/** + * @event module:zrender/mixin/Eventful#onclick + * @type {Function} + * @default null + */ +/** + * @event module:zrender/mixin/Eventful#onmouseover + * @type {Function} + * @default null + */ +/** + * @event module:zrender/mixin/Eventful#onmouseout + * @type {Function} + * @default null + */ +/** + * @event module:zrender/mixin/Eventful#onmousemove + * @type {Function} + * @default null + */ +/** + * @event module:zrender/mixin/Eventful#onmousewheel + * @type {Function} + * @default null + */ +/** + * @event module:zrender/mixin/Eventful#onmousedown + * @type {Function} + * @default null + */ +/** + * @event module:zrender/mixin/Eventful#onmouseup + * @type {Function} + * @default null + */ +/** + * @event module:zrender/mixin/Eventful#ondragstart + * @type {Function} + * @default null + */ +/** + * @event module:zrender/mixin/Eventful#ondragend + * @type {Function} + * @default null + */ +/** + * @event module:zrender/mixin/Eventful#ondragenter + * @type {Function} + * @default null + */ +/** + * @event module:zrender/mixin/Eventful#ondragleave + * @type {Function} + * @default null + */ +/** + * @event module:zrender/mixin/Eventful#ondragover + * @type {Function} + * @default null + */ +/** + * @event module:zrender/mixin/Eventful#ondrop + * @type {Function} + * @default null + */ + +module.exports = Eventful; \ No newline at end of file diff --git a/src/zrender/mixin/Transformable.js b/src/zrender/mixin/Transformable.js new file mode 100644 index 0000000..1e628bf --- /dev/null +++ b/src/zrender/mixin/Transformable.js @@ -0,0 +1,227 @@ +'use strict'; +/** + * 提供变换扩展 + * @module zrender/mixin/Transformable + * @author pissang (https://www.github.com/pissang) + */ + + +var matrix = require('../tool/matrix.js'); +var vector = require('../tool/vector.js'); +var origin = [0, 0]; + +var EPSILON = 5e-5; + +function isAroundZero(val) { + return val > -EPSILON && val < EPSILON; +} + +function isNotAroundZero(val) { + return val > EPSILON || val < -EPSILON; +} + +/** + * @alias module:zrender/mixin/Transformable + * @constructor + */ +var Transformable = function () { + + if (!this.position) { + /** + * 平移 + * @type {Array.} + * @default [0, 0] + */ + this.position = [0, 0]; + } + if (typeof(this.rotation) == 'undefined') { + /** + * 旋转,可以通过数组二三项指定旋转的原点 + * @type {Array.} + * @default [0, 0, 0] + */ + this.rotation = [0, 0, 0]; + } + if (!this.scale) { + /** + * 缩放,可以通过数组三四项指定缩放的原点 + * @type {Array.} + * @default [1, 1, 0, 0] + */ + this.scale = [1, 1, 0, 0]; + } + + this.needLocalTransform = false; + + /** + * 是否有坐标变换 + * @type {boolean} + * @readOnly + */ + this.needTransform = false; +}; + +Transformable.prototype = { + + constructor: Transformable, + + updateNeedTransform: function () { + this.needLocalTransform = isNotAroundZero(this.rotation[0]) || isNotAroundZero(this.position[0]) || isNotAroundZero(this.position[1]) || isNotAroundZero(this.scale[0] - 1) || isNotAroundZero(this.scale[1] - 1); + }, + + /** + * 判断是否需要有坐标变换,更新needTransform属性。 + * 如果有坐标变换, 则从position, rotation, scale以及父节点的transform计算出自身的transform矩阵 + */ + updateTransform: function () { + + this.updateNeedTransform(); + + if (this.parent) { + this.needTransform = this.needLocalTransform || this.parent.needTransform; + } + else { + this.needTransform = this.needLocalTransform; + } + + if (!this.needTransform) { + return; + } + + var m = this.transform || matrix.create(); + matrix.identity(m); + + if (this.needLocalTransform) { + if ( + isNotAroundZero(this.scale[0]) || isNotAroundZero(this.scale[1])) { + origin[0] = -this.scale[2] || 0; + origin[1] = -this.scale[3] || 0; + var haveOrigin = isNotAroundZero(origin[0]) || isNotAroundZero(origin[1]); + if (haveOrigin) { + matrix.translate( + m, m, origin); + } + matrix.scale(m, m, this.scale); + if (haveOrigin) { + origin[0] = -origin[0]; + origin[1] = -origin[1]; + matrix.translate( + m, m, origin); + } + } + + if (this.rotation instanceof Array) { + if (this.rotation[0] !== 0) { + origin[0] = -this.rotation[1] || 0; + origin[1] = -this.rotation[2] || 0; + var haveOrigin = isNotAroundZero(origin[0]) || isNotAroundZero(origin[1]); + if (haveOrigin) { + matrix.translate( + m, m, origin); + } + matrix.rotate(m, m, this.rotation[0]); + if (haveOrigin) { + origin[0] = -origin[0]; + origin[1] = -origin[1]; + matrix.translate( + m, m, origin); + } + } + } + else { + if (this.rotation !== 0) { + matrix.rotate(m, m, this.rotation); + } + } + + if ( + isNotAroundZero(this.position[0]) || isNotAroundZero(this.position[1])) { + matrix.translate(m, m, this.position); + } + } + + // 保存这个变换矩阵 + this.transform = m; + + // 应用父节点变换 + if (this.parent && this.parent.needTransform) { + if (this.needLocalTransform) { + matrix.mul(this.transform, this.parent.transform, this.transform); + } + else { + matrix.copy(this.transform, this.parent.transform); + } + } + }, + /** + * 将自己的transform应用到context上 + * @param {Context2D} ctx + */ + setTransform: function (ctx) { + if (this.needTransform) { + var m = this.transform; + ctx.transform( + m[0], m[1], m[2], m[3], m[4], m[5]); + } + }, + /** + * 设置图形的朝向 + * @param {Array.|Float32Array} target + * @method + */ + lookAt: (function () { + var v = vector.create(); + return function (target) { + if (!this.transform) { + this.transform = matrix.create(); + } + var m = this.transform; + vector.sub(v, target, this.position); + if (isAroundZero(v[0]) && isAroundZero(v[1])) { + return; + } + vector.normalize(v, v); + // Y Axis + // TODO Scale origin ? + m[2] = v[0] * this.scale[1]; + m[3] = v[1] * this.scale[1]; + // X Axis + m[0] = v[1] * this.scale[0]; + m[1] = -v[0] * this.scale[0]; + // Position + m[4] = this.position[0]; + m[5] = this.position[1]; + + this.decomposeTransform(); + }; + })(), + /** + * 分解`transform`矩阵到`position`, `rotation`, `scale` + */ + decomposeTransform: function () { + if (!this.transform) { + return; + } + var m = this.transform; + var sx = m[0] * m[0] + m[1] * m[1]; + var position = this.position; + var scale = this.scale; + var rotation = this.rotation; + if (isNotAroundZero(sx - 1)) { + sx = Math.sqrt(sx); + } + var sy = m[2] * m[2] + m[3] * m[3]; + if (isNotAroundZero(sy - 1)) { + sy = Math.sqrt(sy); + } + position[0] = m[4]; + position[1] = m[5]; + scale[0] = sx; + scale[1] = sy; + scale[2] = scale[3] = 0; + rotation[0] = Math.atan2(-m[1] / sy, m[0] / sx); + rotation[1] = rotation[2] = 0; + } +}; + +module.exports = Transformable; \ No newline at end of file diff --git a/src/zrender/shape/Base.js b/src/zrender/shape/Base.js index f5b491f..ab058a2 100644 --- a/src/zrender/shape/Base.js +++ b/src/zrender/shape/Base.js @@ -1,126 +1,50 @@ /** - * zrender : shape基类 - * - * desc: zrender是一个轻量级的Canvas类库,MVC封装,数据驱动,提供类Dom事件模型。 - * author: Kener (@Kener-林峰, linzhifeng@baidu.com) + * shape基类 + * @module zrender/shape/Base + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * errorrik (errorrik@gmail.com) - * - * 可配图形属性: - { - // 基础属性,详见各shape - shape : {string}, // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 变换 - position : {array}, // 默认为[0, 0], shape的坐标 - rotation : {number|array}, // 默认为[0, 0, 0],shape绕自身旋转的角度,不被translate 影响 - // 后两个值为旋转的origin - scale : {array}, // 默认为[1, 1, 0, 0], shape纵横缩放比例,不被translate影响 - // 后两个值为缩放的origin - - // 样式属性,详见各shape,默认状态样式属性 - style : {Object}, - - // 样式属性,详见各shape,高亮样式属性,当不存在highlightStyle时使用默认样式扩展显示 - highlightStyle : {Object}, - - // 交互属性,zrender支持,非图形类实现 - hoverable : {boolean}, // 默认为true,可悬浮响应,默认悬浮响应为高亮显示 - // 可在onbrush中捕获并阻塞高亮绘画 - clickable : {boolean}, // 默认为false,可点击响应,影响鼠标hover时图标是否为可点击样式 - // 为false则阻断点击事件抛出,为true可在onclick中捕获 - draggable : {boolean}, // 默认为false,可拖拽响应,默认拖拽响应改变图形位置, - // 可在ondrift中捕获并阻塞默认拖拽行为 - - // 事件属性 - onbrush : {Function}, // 默认为null,当前图形被刷画时回调,可用于实现自定义绘画 - // 回传参数为: - // @param {2D Context} context 当前canvas context - // @param {Object} shape 当前shape - // @param {boolean} isHighlight 是否高亮 - // @return {boolean} 回调返回true则不执行默认绘画 - ondrift : {Function}, // 默认为null,当前图形被拖拽改变位置时回调,可用于限制拖拽范围 - // 回传参数为: - // @param {Object} shape 当前shape - // @param {number} dx x方向变化 - // @param {number} dy y方向变化 - onclick : {Function}, // 默认为null,当前图形点击响应,回传参数为: - // @param {Object} eventPacket 对象内容如下: - // @param {string} eventPacket.type 事件类型,EVENT.CLICK - // @param {event} eventPacket.event 原始dom事件对象 - // @param {Object} eventPacket.target 当前图形shape对象 - // @return {boolean} 回调返回true则阻止抛出全局事件 - - onmousewheel : {Function}, // 默认为null,当前图形上鼠标滚轮触发,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.MOUSEWHEEL - // @return {boolean} 回调返回true则阻止抛出全局事件 - - onmousemove : {Function}, // 默认为null,当前图上形鼠标(或手指)移动触发,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.MOUSEMOVE - // @return {boolean} 回调返回true则阻止抛出全局事件 - - onmouseover : {Function}, // 默认为null,鼠标(或手指)移动到当前图形上触发,回传参数格式同onclick: - // 事件类型为confit.EVENT.MOUSEOVER - // @return {boolean} 回调返回true则阻止抛出全局事件 - - onmouseout : {Function}, // 默认为null,鼠标(或手指)从当前图形移开,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.MOUSEOUT - // @return {boolean} 回调返回true则阻止抛出全局事件 - - onmousedown : {Function}, // 默认为null,鼠标按钮(或手指)按下,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.MOUSEDOWN - // @return {boolean} 回调返回true则阻止抛出全局事件 - - onmouseup : {Function}, // 默认为null,鼠标按钮(或手指)松开,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.MOUSEUP - // @return {boolean} 回调返回true则阻止抛出全局事件 - - ondragstart : {Function}, // 默认为null,开始拖拽时触发,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.DRAGSTART - // @return {boolean} 回调返回true则阻止抛出全局事件 - - ondragend : {Function}, // 默认为null,拖拽完毕时触发,回传参数格式同onclick,其中: - // 事件类型为confit.EVENT.DRAGEND - // @return {boolean} 回调返回true则阻止抛出全局事件 - - ondragenter : {Function}, // 默认为null,拖拽图形元素进入目标图形元素时触发 - // 回传参数格式同onclick,其中: - // @param {string} eventPacket.type 事件类型,EVENT.DRAGENTER - // @param {Object} eventPacket.target 目标图形元素shape对象 - // @param {Object} eventPacket.dragged 拖拽图形元素shape对象 - // @return {boolean} 回调返回true则阻止抛出全局事件 - - ondragover : {Function}, // 默认为null,拖拽图形元素在目标图形元素上移动时触发, - // 回传参数格式同onclick,其中: - // @param {string} eventPacket.type 事件类型,EVENT.DRAGOVER - // @param {Object} eventPacket.target 目标图形元素shape对象 - // @param {Object} eventPacket.dragged 拖拽图形元素shape对象 - // @return {boolean} 回调返回true则阻止抛出全局事件 - - ondragleave : {Function}, // 默认为null,拖拽图形元素离开目标图形元素时触发, - // 回传参数格式同onclick,其中: - // @param {string} eventPacket.type 事件类型,EVENT.DRAGLEAVE - // @param {Object} eventPacket.target 目标图形元素shape对象 - // @param {Object} eventPacket.dragged 拖拽图形元素shape对象 - // @return {boolean} 回调返回true则阻止抛出全局事件 - - ondrop : {Function}, // 默认为null,拖拽图形元素放在目标图形元素内时触发, - // 回传参数格式同onclick,其中: - // @param {string} eventPacket.type 事件类型,EVENT.DRAG - // @param {Object} eventPacket.target 目标图形元素shape对象 - // @param {Object} eventPacket.dragged 拖拽图形元素shape对象 - // @return {boolean} 回调返回true则阻止抛出全局事件 - } */ +/** + * @typedef {Object} IBaseShapeStyle + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ + +/** + * @typedef {Object} module:zrender/shape/Base~IBoundingRect + * @property {number} x 左上角顶点x轴坐标 + * @property {number} y 左上角顶点y轴坐标 + * @property {number} width 包围盒矩形宽度 + * @property {number} height 包围盒矩形高度 + */ + + +var vmlCanvasManager = window['G_vmlCanvasManager']; + var matrix = require('../tool/matrix.js'); var guid = require('../tool/guid.js'); var util = require('../tool/util.js'); +var log = require('../tool/log.js'); -var Transformable = require('./mixin/Transformable.js'); -var Dispatcher = require('../tool/event.js').Dispatcher; +var Transformable = require('../mixin/Transformable.js'); +var Eventful = require('../mixin/Eventful.js'); function _fillText(ctx, text, x, y, textFont, textAlign, textBaseline) { if (textFont) { @@ -153,9 +77,13 @@ function _fillText(ctx, text, x, y, textFont, textAlign, textBaseline) { /** * 返回矩形区域,用于局部刷新和文字定位 - * * @inner - * @param {Object} style + * @param {string} text + * @param {number} x + * @param {number} y + * @param {string} textFont + * @param {string} textAlign + * @param {string} textBaseline */ function _getTextRect(text, x, y, textFont, textAlign, textBaseline) { @@ -193,49 +121,150 @@ function _getTextRect(text, x, y, textFont, textAlign, textBaseline) { }; } -function Base(options) { +/** + * @alias module:zrender/shape/Base + * @constructor + * @extends module:zrender/mixin/Transformable + * @extends module:zrender/mixin/Eventful + * @param {Object} options 关于shape的配置项,可以是shape的自有属性,也可以是自定义的属性。 + */ +var Base = function (options) { options = options || {}; + /** + * Shape id, 全局唯一 + * @type {string} + */ this.id = options.id || guid(); for (var key in options) { this[key] = options[key]; } + /** + * 基础绘制样式 + * @type {module:zrender/shape/Base~IBaseShapeStyle} + */ this.style = this.style || {}; + /** + * 高亮样式 + * @type {module:zrender/shape/Base~IBaseShapeStyle} + */ + this.highlightStyle = this.highlightStyle || null; + + /** + * 父节点 + * @readonly + * @type {module:zrender/Group} + * @default null + */ this.parent = null; this.__dirty = true; - Transformable.call(this); - Dispatcher.call(this); -} + this.__clipShapes = []; + Transformable.call(this); + Eventful.call(this); +}; +/** + * 图形是否可见,为true时不绘制图形,但是仍能触发鼠标事件 + * @name module:zrender/shape/Base#invisible + * @type {boolean} + * @default false + */ Base.prototype.invisible = false; +/** + * 图形是否忽略,为true时忽略图形的绘制以及事件触发 + * @name module:zrender/shape/Base#ignore + * @type {boolean} + * @default false + */ Base.prototype.ignore = false; +/** + * z层level,决定绘画在哪层canvas中 + * @name module:zrender/shape/Base#zlevel + * @type {number} + * @default 0 + */ Base.prototype.zlevel = 0; +/** + * 是否可拖拽 + * @name module:zrender/shape/Base#draggable + * @type {boolean} + * @default false + */ Base.prototype.draggable = false; +/** + * 是否可点击 + * @name module:zrender/shape/Base#clickable + * @type {boolean} + * @default false + */ Base.prototype.clickable = false; +/** + * 是否可以hover + * @name module:zrender/shape/Base#hoverable + * @type {boolean} + * @default true + */ Base.prototype.hoverable = true; +/** + * z值,跟zlevel一样影响shape绘制的前后顺序,z值大的shape会覆盖在z值小的上面, + * 但是并不会创建新的canvas,所以优先级低于zlevel,而且频繁改动的开销比zlevel小很多。 + * + * @name module:zrender/shape/Base#z + * @type {number} + * @default 0 + */ Base.prototype.z = 0; /** - * 画刷 + * 绘制图形 * - * @param ctx 画布句柄 - * @param isHighlight 是否为高亮状态 - * @param updateCallback 需要异步加载资源的shape可以通过这个callback(e) - * 让painter更新视图,base.brush没用,需要的话重载brush + * @param {CanvasRenderingContext2D} ctx + * @param {boolean} [isHighlight=false] 是否使用高亮属性 + * @param {Function} [updateCallback] + * 需要异步加载资源的shape可以通过这个callback(e), + * 让painter更新视图,base.brush没用,需要的话重载brush */ Base.prototype.brush = function (ctx, isHighlight) { + + var style = this.beforeBrush(ctx, isHighlight); + + ctx.beginPath(); + this.buildPath(ctx, style); + + switch (style.brushType) { /* jshint ignore:start */ + case 'both': + ctx.fill(); + case 'stroke': + style.lineWidth > 0 && ctx.stroke(); + break; /* jshint ignore:end */ + default: + ctx.fill(); + } + + this.drawText(ctx, style, this.style); + + this.afterBrush(ctx); +}; + +/** + * 具体绘制操作前的一些公共操作 + * @param {CanvasRenderingContext2D} ctx + * @param {boolean} [isHighlight=false] 是否使用高亮属性 + * @return {Object} 处理后的样式 + */ +Base.prototype.beforeBrush = function (ctx, isHighlight) { var style = this.style; if (this.brushTypeOnly) { @@ -254,29 +283,21 @@ Base.prototype.brush = function (ctx, isHighlight) { ctx.save(); + this.doClip(ctx); + this.setContext(ctx, style); // 设置transform this.setTransform(ctx); - ctx.beginPath(); - this.buildPath(ctx, style); - if (this.brushTypeOnly != 'stroke') { - ctx.closePath(); - } - - switch (style.brushType) { - case 'both': - ctx.fill(); - case 'stroke': - style.lineWidth > 0 && ctx.stroke(); - break; - default: - ctx.fill(); - } - - this.drawText(ctx, style, this.style); + return style; +}; +/** + * 绘制后的处理 + * @param {CanvasRenderingContext2D} ctx + */ +Base.prototype.afterBrush = function (ctx) { ctx.restore(); }; @@ -295,12 +316,9 @@ var STYLE_CTX_MAP = [ ]; /** - * 画布通用设置 - * - * TODO Performance - * - * @param ctx 画布句柄 - * @param style 通用样式 + * 设置 fillStyle, strokeStyle, shadow 等通用绘制样式 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Base~IBaseShapeStyle} style */ Base.prototype.setContext = function (ctx, style) { for (var i = 0, len = STYLE_CTX_MAP.length; i < len; i++) { @@ -314,12 +332,36 @@ Base.prototype.setContext = function (ctx, style) { } }; +var clipShapeInvTransform = matrix.create(); +Base.prototype.doClip = function (ctx) { + if (this.__clipShapes && !vmlCanvasManager) { + for (var i = 0; i < this.__clipShapes.length; i++) { + var clipShape = this.__clipShapes[i]; + if (clipShape.needTransform) { + var m = clipShape.transform; + matrix.invert(clipShapeInvTransform, m); + ctx.transform( + m[0], m[1], m[2], m[3], m[4], m[5]); + } + ctx.beginPath(); + clipShape.buildPath(ctx, clipShape.style); + ctx.clip(); + // Transform back + if (clipShape.needTransform) { + var m = clipShapeInvTransform; + ctx.transform( + m[0], m[1], m[2], m[3], m[4], m[5]); + } + } + } +}; + /** * 根据默认样式扩展高亮样式 * - * @param ctx Canvas 2D上下文 - * @param {Object} style 默认样式 - * @param {Object} highlightStyle 高亮样式 + * @param {module:zrender/shape/Base~IBaseShapeStyle} style 默认样式 + * @param {module:zrender/shape/Base~IBaseShapeStyle} highlightStyle 高亮样式 + * @param {string} brushTypeOnly */ Base.prototype.getHighlightStyle = function (style, highlightStyle, brushTypeOnly) { var newStyle = {}; @@ -359,19 +401,16 @@ Base.prototype.getHighlightStyle = function (style, highlightStyle, brushTypeOnl return newStyle; }; -/** - * 高亮放大效果参数 - * 当前统一设置为6,如有需要差异设置,通过this.type判断实例类型 - */ +// 高亮放大效果参数 +// 当前统一设置为6,如有需要差异设置,通过this.type判断实例类型 Base.prototype.getHighlightZoom = function () { return this.type != 'text' ? 6 : 2; }; /** - * 默认漂移 - * - * @param dx 横坐标变化 - * @param dy 纵坐标变化 + * 移动位置 + * @param {number} dx 横坐标变化 + * @param {number} dy 纵坐标变化 */ Base.prototype.drift = function (dx, dy) { this.position[0] += dx; @@ -379,8 +418,11 @@ Base.prototype.drift = function (dx, dy) { }; /** - * 获取鼠标坐标变换 - * TODO Performance + * 变换鼠标位置到 shape 的局部坐标空间 + * @method + * @param {number} x + * @param {number} y + * @return {Array.} */ Base.prototype.getTansform = (function () { @@ -404,10 +446,28 @@ Base.prototype.getTansform = (function () { })(); /** - * 默认区域包含判断 - * - * @param x 横坐标 - * @param y 纵坐标 + * 构建绘制的Path + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Base~IBaseShapeStyle} style + */ +Base.prototype.buildPath = function (ctx, style) { + log('buildPath not implemented in ' + this.type); +}; + +/** + * 计算返回包围盒矩形 + * @param {module:zrender/shape/Base~IBaseShapeStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ +Base.prototype.getRect = function (style) { + log('getRect not implemented in ' + this.type); +}; + +/** + * 判断鼠标位置是否在图形内 + * @param {number} x + * @param {number} y + * @return {boolean} */ Base.prototype.isCover = function (x, y) { var originPos = this.getTansform(x, y); @@ -429,11 +489,10 @@ Base.prototype.isCover = function (x, y) { }; /** - * 附加文本 - * - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - * @param {Object} normalStyle 默认样式,用于定位文字显示 + * 绘制附加文本 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Base~IBaseShapeStyle} style 样式 + * @param {module:zrender/shape/Base~IBaseShapeStyle} normalStyle 默认样式,用于定位文字显示 */ Base.prototype.drawText = function (ctx, style, normalStyle) { if (typeof(style.text) == 'undefined' || style.text === false) { @@ -443,23 +502,15 @@ Base.prototype.drawText = function (ctx, style, normalStyle) { var textColor = style.textColor || style.color || style.strokeColor; ctx.fillStyle = textColor; -/* - if (style.textPosition == 'inside') { - ctx.shadowColor = 'rgba(0,0,0,0)'; // 内部文字不带shadowColor - } - */ - // 文本与图形间空白间隙 var dd = 10; var al; // 文本水平对齐 var bl; // 文本垂直对齐 var tx; // 文本横坐标 var ty; // 文本纵坐标 - var textPosition = style.textPosition // 用户定义 || this.textPosition // shape默认 || 'top'; // 全局默认 - switch (textPosition) { case 'inside': case 'top': @@ -508,66 +559,64 @@ Base.prototype.drawText = function (ctx, style, normalStyle) { break; case 'start': case 'end': + var pointList = style.pointList || [ + [style.xStart || 0, style.yStart || 0], + [style.xEnd || 0, style.yEnd || 0] + ]; + var length = pointList.length; + if (length < 2) { + // 少于2个点就不画了~ + return; + } var xStart; var xEnd; var yStart; var yEnd; - if (typeof style.pointList != 'undefined') { - var pointList = style.pointList; - if (pointList.length < 2) { - // 少于2个点就不画了~ - return; - } - var length = pointList.length; - switch (textPosition) { - case 'start': - xStart = pointList[0][0]; - xEnd = pointList[1][0]; - yStart = pointList[0][1]; - yEnd = pointList[1][1]; - break; - case 'end': - xStart = pointList[length - 2][0]; - xEnd = pointList[length - 1][0]; - yStart = pointList[length - 2][1]; - yEnd = pointList[length - 1][1]; - break; - } - } - else { - xStart = style.xStart || 0; - xEnd = style.xEnd || 0; - yStart = style.yStart || 0; - yEnd = style.yEnd || 0; - } - switch (textPosition) { case 'start': - al = xStart < xEnd ? 'end' : 'start'; - bl = yStart < yEnd ? 'bottom' : 'top'; - tx = xStart; - ty = yStart; + xStart = pointList[1][0]; + xEnd = pointList[0][0]; + yStart = pointList[1][1]; + yEnd = pointList[0][1]; break; case 'end': - al = xStart < xEnd ? 'start' : 'end'; - bl = yStart < yEnd ? 'top' : 'bottom'; - tx = xEnd; - ty = yEnd; + xStart = pointList[length - 2][0]; + xEnd = pointList[length - 1][0]; + yStart = pointList[length - 2][1]; + yEnd = pointList[length - 1][1]; break; } - dd -= 4; - if (xStart != xEnd) { - tx -= (al == 'end' ? dd : -dd); + tx = xEnd; + ty = yEnd; + + var angle = Math.atan((yStart - yEnd) / (xEnd - xStart)) / Math.PI * 180; + if ((xEnd - xStart) < 0) { + angle += 180; } - else { - al = 'center'; + else if ((yStart - yEnd) < 0) { + angle += 360; } - if (yStart != yEnd) { - ty -= (bl == 'bottom' ? dd : -dd); + dd = 5; + if (angle >= 30 && angle <= 150) { + al = 'center'; + bl = 'bottom'; + ty -= dd; + } + else if (angle > 150 && angle < 210) { + al = 'right'; + bl = 'middle'; + tx -= dd; + } + else if (angle >= 210 && angle <= 330) { + al = 'center'; + bl = 'top'; + ty += dd; } else { + al = 'left'; bl = 'middle'; + tx += dd; } break; case 'specific': @@ -583,13 +632,28 @@ Base.prototype.drawText = function (ctx, style, normalStyle) { ctx, style.text, tx, ty, style.textFont, style.textAlign || al, style.textBaseline || bl); } }; -// TODO + +Base.prototype.modSelf = function () { + this.__dirty = true; + if (this.style) { + this.style.__rect = null; + } + if (this.highlightStyle) { + this.highlightStyle.__rect = null; + } +}; + +/** + * 图形是否会触发事件 + * @return {boolean} + */ +// TODO, 通过 bind 绑定的事件 Base.prototype.isSilent = function () { return !( - this.hoverable || this.draggable || this.onmousemove || this.onmouseover || this.onmouseout || this.onmousedown || this.onmouseup || this.onclick || this.ondragenter || this.ondragover || this.ondragleave || this.ondrop); + this.hoverable || this.draggable || this.clickable || this.onmousemove || this.onmouseover || this.onmouseout || this.onmousedown || this.onmouseup || this.onclick || this.ondragenter || this.ondragover || this.ondragleave || this.ondrop); }; util.merge(Base.prototype, Transformable.prototype, true); -util.merge(Base.prototype, Dispatcher.prototype, true); +util.merge(Base.prototype, Eventful.prototype, true); module.exports = Base; \ No newline at end of file diff --git a/src/zrender/shape/BezierCurve.js b/src/zrender/shape/BezierCurve.js index 804708c..5501331 100644 --- a/src/zrender/shape/BezierCurve.js +++ b/src/zrender/shape/BezierCurve.js @@ -1,98 +1,87 @@ +'use strict'; /** - * zrender - * - * @author Neil (杨骥, yangji01@baidu.com) - * - * shape类:贝塞尔曲线 - * 可配图形属性: - { - // 基础属性 - shape : 'beziercurve', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - xStart : {number}, // 必须,起点横坐标 - yStart : {number}, // 必须,起点纵坐标 - cpX1 : {number}, // 必须,第一个关联点横坐标 - cpY1 : {number}, // 必须,第一个关联点纵坐标 - cpX2 : {number}, // 可选,第二个关联点横坐标 缺省即为二次贝塞尔曲线 - cpY2 : {number}, // 可选,第二个关联点纵坐标 - xEnd : {number}, // 必须,终点横坐标 - yEnd : {number}, // 必须,终点纵坐标 - strokeColor : {color}, // 默认为'#000',线条颜色(轮廓),支持rgba - - lineWidth : {number}, // 默认为1,线条宽度 - lineCap : {string}, // 默认为butt,线帽样式。butt | round | square - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为end,附加文本位置。 - // inside | start | end - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#000' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'beziercurve', - id : '123456', - zlevel : 1, - style : { - xStart : 100, - yStart : 100, - xEnd : 200, - yEnd : 200, - strokeColor : '#eee', - lineWidth : 20, - text : 'Baidu' - }, - myName : 'kener', //可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } + * 贝塞尔曲线 + * @module zrender/shape/BezierCurve + * @author Neil (杨骥, 511415343@qq.com) + * @example + * var BezierCurve = require('zrender/shape/BezierCurve.js'); + * var shape = new BezierCurve({ + * style: { + * xStart: 0, + * yStart: 0, + * cpX1: 100, + * cpY1: 0, + * cpX2: 0, + * cpY2: 100, + * xEnd: 100, + * yEnd: 100, + * strokeColor: 'red' + * } + * }); + * zr.addShape(shape); */ +/** + * @typedef {Object} IBezierCurveStyle + * @property {number} xStart 起点x坐标 + * @property {number} yStart 起点y坐标 + * @property {number} cpX1 第一个控制点x坐标 + * @property {number} cpY1 第一个控制点y坐标 + * @property {number} [cpX2] 第二个控制点x坐标,如果不给则为二次贝塞尔曲线 + * @property {number} [cpY2] 第二个控制点y坐标,如果不给则为二次贝塞尔曲线 + * @property {number} xEnd 终止点x坐标 + * @property {number} yEnd 终止点y坐标 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ + + + var Base = require('./Base.js'); -function BezierCurve(options) { - this.brushTypeOnly = 'stroke'; //线条只能描边,填充后果自负 +/** + * @alias module:zrender/shape/BezierCurve + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ +var BezierCurve = function (options) { + this.brushTypeOnly = 'stroke'; // 线条只能描边,填充后果自负 this.textPosition = 'end'; Base.call(this, options); -} + /** + * 贝赛尔曲线绘制样式 + * @name module:zrender/shape/BezierCurve#style + * @type {module:zrender/shape/BezierCurve~IBezierCurveStyle} + */ + /** + * 贝赛尔曲线高亮绘制样式 + * @name module:zrender/shape/BezierCurve#highlightStyle + * @type {module:zrender/shape/BezierCurve~IBezierCurveStyle} + */ +}; BezierCurve.prototype = { type: 'bezier-curve', /** - * 创建线条路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 + * 创建贝塞尔曲线路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/BezierCurve~IBezierCurveStyle} style */ buildPath: function (ctx, style) { ctx.moveTo(style.xStart, style.yStart); @@ -104,12 +93,13 @@ BezierCurve.prototype = { ctx.quadraticCurveTo( style.cpX1, style.cpY1, style.xEnd, style.yEnd); } - }, /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style + * 计算返回贝赛尔曲线包围盒矩形。 + * 该包围盒是直接从四个控制点计算,并非最小包围盒。 + * @param {module:zrender/shape/BezierCurve~IBezierCurveStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} */ getRect: function (style) { if (style.__rect) { diff --git a/src/zrender/shape/BrokenLine.js b/src/zrender/shape/BrokenLine.js deleted file mode 100644 index 7e5a07f..0000000 --- a/src/zrender/shape/BrokenLine.js +++ /dev/null @@ -1,153 +0,0 @@ -/** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:折线 - * 可配图形属性: - { - // 基础属性 - shape : 'brokenLine', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - pointList : {Array}, // 必须,各个顶角坐标 - smooth : {Number}, // 默认为0 - strokeColor : {color}, // 默认为'#000',线条颜色(轮廓),支持rgba - lineType : {string}, // 默认为solid,线条类型,solid | dashed | dotted - lineWidth : {number}, // 默认为1,线条宽度 - lineCap : {string}, // 默认为butt,线帽样式。butt | round | square - lineJoin : {string}, // 默认为miter,线段连接样式。miter | round | bevel - miterLimit : {number}, // 默认为10,最大斜接长度,仅当lineJoin为miter时生效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为end,附加文本位置。 - // start | end - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#000' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'brokenLine', - id : '123456', - zlevel : 1, - style : { - pointList : [[10, 10], [300, 20], [298, 400], [50, 450]], - strokeColor : '#eee', - lineWidth : 20, - text : 'Baidu' - }, - myName : 'kener', //可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } - */ - -var Base = require('./Base.js'); -var smoothSpline = require('./util/smoothSpline.js'); -var smoothBezier = require('./util/smoothBezier.js'); -var dashedLineTo = require('./util/dashedLineTo.js'); - -function BrokenLine(options) { - this.brushTypeOnly = 'stroke'; //线条只能描边,填充后果自负 - this.textPosition = 'end'; - Base.call(this, options); -} - -BrokenLine.prototype = { - type: 'broken-line', - - /** - * 创建多边形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath: function (ctx, style) { - var pointList = style.pointList; - if (pointList.length < 2) { - // 少于2个点就不画了~ - return; - } - - var len = Math.min( - style.pointList.length, Math.round(style.pointListLength || style.pointList.length)); - - if (style.smooth && style.smooth !== 'spline') { - var controlPoints = smoothBezier( - pointList, style.smooth); - - ctx.moveTo(pointList[0][0], pointList[0][1]); - var cp1; - var cp2; - var p; - for (var i = 0; i < len - 1; i++) { - cp1 = controlPoints[i * 2]; - cp2 = controlPoints[i * 2 + 1]; - p = pointList[i + 1]; - ctx.bezierCurveTo( - cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]); - } - } - else { - if (style.smooth === 'spline') { - pointList = smoothSpline(pointList); - len = pointList.length; - } - if (!style.lineType || style.lineType == 'solid') { - //默认为实线 - ctx.moveTo(pointList[0][0], pointList[0][1]); - for (var i = 1; i < len; i++) { - ctx.lineTo(pointList[i][0], pointList[i][1]); - } - } - else if (style.lineType == 'dashed' || style.lineType == 'dotted') { - var dashLength = (style.lineWidth || 1) * (style.lineType == 'dashed' ? 5 : 1); - ctx.moveTo(pointList[0][0], pointList[0][1]); - for (var i = 1; i < len; i++) { - dashedLineTo( - ctx, pointList[i - 1][0], pointList[i - 1][1], pointList[i][0], pointList[i][1], dashLength); - } - } - } - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style - */ - getRect: function (style) { - return require('./Polygon.js').prototype.getRect(style); - } -}; - -require('../tool/util.js').inherits(BrokenLine, Base); -module.exports = BrokenLine; \ No newline at end of file diff --git a/src/zrender/shape/Circle.js b/src/zrender/shape/Circle.js index 53dd85f..aadc863 100644 --- a/src/zrender/shape/Circle.js +++ b/src/zrender/shape/Circle.js @@ -1,89 +1,79 @@ +'use strict'; /** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:圆 - * 可配图形属性: - { - // 基础属性 - shape : 'circle', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,圆心横坐标 - y : {number}, // 必须,圆心纵坐标 - r : {number}, // 必须,圆半径 - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为top,附加文本位置。 - // inside | left | right | top | bottom - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'circle', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - r : 50, - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } + * 圆形 + * @module zrender/shape/Circle + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + * @example + * var Circle = require('zrender/shape/Circle.js'); + * var shape = new Circle({ + * style: { + * x: 100, + * y: 100, + * r: 40, + * brushType: 'both', + * color: 'blue', + * strokeColor: 'red', + * lineWidth: 3, + * text: 'Circle' + * } + * }); + * zr.addShape(shape); */ +/** + * @typedef {Object} ICircleStyle + * @property {number} x 圆心x坐标 + * @property {number} y 圆心y坐标 + * @property {number} r 半径 + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ + + var Base = require('./Base.js'); -function Circle(options) { +/** + * @alias module:zrender/shape/Circle + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ +var Circle = function (options) { Base.call(this, options); -} + /** + * 圆形绘制样式 + * @name module:zrender/shape/Circle#style + * @type {module:zrender/shape/Circle~ICircleStyle} + */ + /** + * 圆形高亮绘制样式 + * @name module:zrender/shape/Circle#highlightStyle + * @type {module:zrender/shape/Circle~ICircleStyle} + */ +}; Circle.prototype = { type: 'circle', /** * 创建圆形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Circle~ICircleStyle} style */ buildPath: function (ctx, style) { ctx.arc(style.x, style.y, style.r, 0, Math.PI * 2, true); @@ -91,8 +81,9 @@ Circle.prototype = { }, /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style + * 计算返回圆形的包围盒矩形 + * @param {module:zrender/shape/Circle~ICircleStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} */ getRect: function (style) { if (style.__rect) { diff --git a/src/zrender/shape/Droplet.js b/src/zrender/shape/Droplet.js index a03f8cb..cb065aa 100644 --- a/src/zrender/shape/Droplet.js +++ b/src/zrender/shape/Droplet.js @@ -1,124 +1,123 @@ +'use strict'; /** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:水滴 - * 可配图形属性: - { - // 基础属性 - shape : 'heart', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,水滴中心横坐标 - y : {number}, // 必须,水滴中心纵坐标 - a : {number}, // 必须,水滴横宽(中心到水平边缘最宽处距离) - b : {number}, // 必须,水滴纵高(中心到尖端距离) - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为outside,附加文本位置。 - // outside | inside - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'droplet', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - a : 50, - b : 80, - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } + * 水滴形状 + * @module zrender/shape/Droplet + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + * @example + * var Droplet = require('zrender/shape/Droplet.js'); + * var shape = new Droplet({ + * style: { + * x: 100, + * y: 100, + * a: 40, + * b: 40, + * brushType: 'both', + * color: 'blue', + * strokeColor: 'red', + * lineWidth: 3, + * text: 'Droplet' + * } + * }); + * zr.addShape(shape); */ +/** + * @typedef {Object} IDropletStyle + * @property {number} x 水滴中心x坐标 + * @property {number} y 水滴中心y坐标 + * @property {number} a 水滴横宽(中心到水平边缘最宽处距离) + * @property {number} b 水滴纵高(中心到尖端距离) + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ + + var Base = require('./Base.js'); +var PathProxy = require('./util/PathProxy.js'); +var area = require('../tool/area.js'); -function Droplet(options) { +/** + * @alias module:zrender/shape/Droplet + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ +var Droplet = function (options) { Base.call(this, options); -} + this._pathProxy = new PathProxy(); + /** + * 水滴绘制样式 + * @name module:zrender/shape/Droplet#style + * @type {module:zrender/shape/Droplet~IDropletStyle} + */ + /** + * 水滴高亮绘制样式 + * @name module:zrender/shape/Droplet#highlightStyle + * @type {module:zrender/shape/Droplet~IDropletStyle} + */ +}; Droplet.prototype = { type: 'droplet', /** - * 创建扇形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 + * 创建水滴路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Droplet~IDropletStyle} style */ buildPath: function (ctx, style) { - ctx.moveTo(style.x, style.y + style.a); - ctx.bezierCurveTo( + var path = this._pathProxy || new PathProxy(); + path.begin(ctx); + + path.moveTo(style.x, style.y + style.a); + path.bezierCurveTo( style.x + style.a, style.y + style.a, style.x + style.a * 3 / 2, style.y - style.a / 3, style.x, style.y - style.b); - ctx.bezierCurveTo( + path.bezierCurveTo( style.x - style.a * 3 / 2, style.y - style.a / 3, style.x - style.a, style.y + style.a, style.x, style.y + style.a); + path.closePath(); }, /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style + * 计算返回水滴的包围盒矩形 + * @param {module:zrender/shape/Droplet~IDropletStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} */ getRect: function (style) { if (style.__rect) { return style.__rect; } - - var lineWidth; - if (style.brushType == 'stroke' || style.brushType == 'fill') { - lineWidth = style.lineWidth || 1; - } - else { - lineWidth = 0; + if (!this._pathProxy.isEmpty()) { + this.buildPath(null, style); } - style.__rect = { - x: Math.round(style.x - style.a - lineWidth / 2), - y: Math.round(style.y - style.b - lineWidth / 2), - width: style.a * 2 + lineWidth, - height: style.a + style.b + lineWidth - }; + return this._pathProxy.fastBoundingRect(); + }, - return style.__rect; + isCover: function (x, y) { + var originPos = this.getTansform(x, y); + x = originPos[0]; + y = originPos[1]; + + var rect = this.getRect(this.style); + if (x >= rect.x && x <= (rect.x + rect.width) && y >= rect.y && y <= (rect.y + rect.height)) { + return area.isInsidePath( + this._pathProxy.pathCommands, this.style.lineWidth, this.style.brushType, x, y); + } } }; diff --git a/src/zrender/shape/Ellipse.js b/src/zrender/shape/Ellipse.js index ef313fd..a7e873b 100644 --- a/src/zrender/shape/Ellipse.js +++ b/src/zrender/shape/Ellipse.js @@ -1,93 +1,79 @@ /** - * zrender - * - * author: loutongbing@baidu.com - * - * shape类:椭圆 - * Todo:excanvas bug ~ 连续scale保持?? IE8下不建议使用 - * 可配图形属性: - { - // 基础属性 - shape : 'ellipse', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,椭圆心横坐标 - y : {number}, // 必须,椭圆心纵坐标 - a : {number}, // 必须,椭圆横轴半径 - b : {number}, // 必须,椭圆纵轴半径 - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为top,附加文本位置。 - // inside | left | right | top | bottom - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'ellipse', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - a : 100, - b : 50, - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } + * 水滴形状 + * @module zrender/shape/Ellipse + * @example + * var Ellipse = require('zrender/shape/Ellipse.js'); + * var shape = new Ellipse({ + * style: { + * x: 100, + * y: 100, + * a: 40, + * b: 20, + * brushType: 'both', + * color: 'blue', + * strokeColor: 'red', + * lineWidth: 3, + * text: 'Ellipse' + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} IEllipseStyle + * @property {number} x 圆心x坐标 + * @property {number} y 圆心y坐标 + * @property {number} a 横轴半径 + * @property {number} b 纵轴半径 + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic */ var Base = require('./Base.js'); -function Ellipse(options) { +/** + * @alias module:zrender/shape/Ellipse + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ +var Ellipse = function (options) { Base.call(this, options); -} + /** + * 椭圆绘制样式 + * @name module:zrender/shape/Ellipse#style + * @type {module:zrender/shape/Ellipse~IEllipseStyle} + */ + /** + * 椭圆高亮绘制样式 + * @name module:zrender/shape/Ellipse#highlightStyle + * @type {module:zrender/shape/Ellipse~IEllipseStyle} + */ +}; Ellipse.prototype = { type: 'ellipse', /** - * 创建圆形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 + * 构建椭圆的Path + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Ellipse~IEllipseStyle} style */ buildPath: function (ctx, style) { var k = 0.5522848; @@ -97,17 +83,20 @@ Ellipse.prototype = { var b = style.b; var ox = a * k; // 水平控制点偏移量 var oy = b * k; // 垂直控制点偏移量 - //从椭圆的左端点开始顺时针绘制四条三次贝塞尔曲线 + // 从椭圆的左端点开始顺时针绘制四条三次贝塞尔曲线 ctx.moveTo(x - a, y); ctx.bezierCurveTo(x - a, y - oy, x - ox, y - b, x, y - b); ctx.bezierCurveTo(x + ox, y - b, x + a, y - oy, x + a, y); ctx.bezierCurveTo(x + a, y + oy, x + ox, y + b, x, y + b); ctx.bezierCurveTo(x - ox, y + b, x - a, y + oy, x - a, y); + ctx.closePath(); }, /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style + /** + * 计算返回椭圆包围盒矩形。 + * @param {module:zrender/shape/Ellipse~IEllipseStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} */ getRect: function (style) { if (style.__rect) { diff --git a/src/zrender/shape/Group.js b/src/zrender/shape/Group.js deleted file mode 100644 index 68da342..0000000 --- a/src/zrender/shape/Group.js +++ /dev/null @@ -1,139 +0,0 @@ -var guid = require('../tool/guid.js'); -var util = require('../tool/util.js'); - -var Dispatcher = require('../tool/event.js').Dispatcher; -var Transformable = require('./mixin/Transformable.js'); - -/** - * @constructor zrender.shape.Group - */ - -function Group(options) { - - options = options || {}; - - this.id = options.id || guid(); - - for (var key in options) { - this[key] = options[key]; - } - - this.type = 'group'; - - this.clipShape = null; - - this._children = []; - - this._storage = null; - - this.__dirty = true; - - // Mixin - Transformable.call(this); - Dispatcher.call(this); -} - -Group.prototype.ignore = false; - -Group.prototype.children = function () { - return this._children.slice(); -}; - -Group.prototype.childAt = function (idx) { - return this._children[idx]; -}; - -Group.prototype.addChild = function (child) { - if (child == this) { - return; - } - - if (child.parent == this) { - return; - } - if (child.parent) { - child.parent.removeChild(child); - } - - this._children.push(child); - child.parent = this; - - if (this._storage && this._storage !== child._storage) { - - this._storage.addToMap(child); - - if (child instanceof Group) { - child.addChildrenToStorage(this._storage); - } - } -}; - -Group.prototype.removeChild = function (child) { - var idx = util.indexOf(this._children, child); - - this._children.splice(idx, 1); - child.parent = null; - - if (child._storage) { - - this._storage.delFromMap(child.id); - - if (child instanceof Group) { - child.delChildrenFromStorage(child._storage); - } - } -}; - -Group.prototype.each = function (cb, context) { - var haveContext = !! context; - for (var i = 0; i < this._children.length; i++) { - var child = this._children[i]; - if (haveContext) { - cb.call(context, child); - } else { - cb(child); - } - } -}; - -Group.prototype.iterate = function (cb, context) { - var haveContext = !! context; - - for (var i = 0; i < this._children.length; i++) { - var child = this._children[i]; - if (haveContext) { - cb.call(context, child); - } else { - cb(child); - } - - if (child.type === 'group') { - child.iterate(cb, context); - } - } -}; - -Group.prototype.addChildrenToStorage = function (storage) { - for (var i = 0; i < this._children.length; i++) { - var child = this._children[i]; - storage.addToMap(child); - if (child.type === 'group') { - child.addChildrenToStorage(storage); - } - } -}; - -Group.prototype.delChildrenFromStorage = function (storage) { - for (var i = 0; i < this._children.length; i++) { - var child = this._children[i]; - storage.delFromMap(child); - if (child.type === 'group') { - child.delChildrenFromStorage(storage); - } - } -}; - -util.merge(Group.prototype, Transformable.prototype, true); -util.merge(Group.prototype, Dispatcher.prototype, true); - -module.exports = Group; \ No newline at end of file diff --git a/src/zrender/shape/Heart.js b/src/zrender/shape/Heart.js index cfb8449..968b3b3 100644 --- a/src/zrender/shape/Heart.js +++ b/src/zrender/shape/Heart.js @@ -1,125 +1,124 @@ +'use strict'; /** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:心形 - * 可配图形属性: - { - // 基础属性 - shape : 'heart', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,心形内部尖端横坐标 - y : {number}, // 必须,心形内部尖端纵坐标 - a : {number}, // 必须,心形横宽(中轴线到水平边缘最宽处距离) - b : {number}, // 必须,心形纵高(内尖到外尖距离) - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为outside,附加文本位置。 - // outside | inside - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'heart', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - a : 50, - b : 80, - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } + * @module zrender/shape/Heart + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + * @example + * var Heart = require('zrender/shape/Heart.js'); + * var shape = new Heart({ + * style: { + * x: 100, + * y: 100, + * a: 40, + * b: 40, + * brushType: 'both', + * color: 'blue', + * strokeColor: 'red', + * lineWidth: 3, + * text: 'Heart' + * } + * }); + * zr.addShape(shape); */ +/** + * @typedef {Object} IHeartStyle + * @property {number} x 心形内部尖端横坐标 + * @property {number} y 心形内部尖端纵坐标 + * @property {number} a 心形横宽(中轴线到水平边缘最宽处距离) + * @property {number} b 心形纵高(内尖到外尖距离) + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ + + var Base = require('./Base.js'); +var PathProxy = require('./util/PathProxy.js'); +var area = require('../tool/area.js'); -function Heart(options) { +/** + * @alias module:zrender/shape/Heart + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ +var Heart = function (options) { Base.call(this, options); -} + + this._pathProxy = new PathProxy(); + /** + * 心形绘制样式 + * @name module:zrender/shape/Heart#style + * @type {module:zrender/shape/Heart~IHeartStyle} + */ + /** + * 心形高亮绘制样式 + * @name module:zrender/shape/Heart#highlightStyle + * @type {module:zrender/shape/Heart~IHeartStyle} + */ +}; Heart.prototype = { type: 'heart', /** * 创建扇形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Heart~IHeartStyle} style */ buildPath: function (ctx, style) { - ctx.moveTo(style.x, style.y); - ctx.bezierCurveTo( + var path = this._pathProxy || new PathProxy(); + path.begin(ctx); + + path.moveTo(style.x, style.y); + path.bezierCurveTo( style.x + style.a / 2, style.y - style.b * 2 / 3, style.x + style.a * 2, style.y + style.b / 3, style.x, style.y + style.b); - ctx.bezierCurveTo( + path.bezierCurveTo( style.x - style.a * 2, style.y + style.b / 3, style.x - style.a / 2, style.y - style.b * 2 / 3, style.x, style.y); + path.closePath(); return; }, /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style + * 计算返回心形的包围盒矩形 + * @param {module:zrender/shape/Heart~IHeartStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} */ getRect: function (style) { if (style.__rect) { return style.__rect; } - - var lineWidth; - if (style.brushType == 'stroke' || style.brushType == 'fill') { - lineWidth = style.lineWidth || 1; + if (!this._pathProxy.isEmpty()) { + this.buildPath(null, style); } - else { - lineWidth = 0; - } - style.__rect = { - x: Math.round(style.x - style.a - lineWidth / 2), - y: Math.round(style.y - style.b / 4 - lineWidth / 2), - width: style.a * 2 + lineWidth, - height: style.b * 5 / 4 + lineWidth - }; + return this._pathProxy.fastBoundingRect(); + }, - return style.__rect; + isCover: function (x, y) { + var originPos = this.getTansform(x, y); + x = originPos[0]; + y = originPos[1]; + + var rect = this.getRect(this.style); + if (x >= rect.x && x <= (rect.x + rect.width) && y >= rect.y && y <= (rect.y + rect.height)) { + return area.isInsidePath( + this._pathProxy.pathCommands, this.style.lineWidth, this.style.brushType, x, y); + } } }; diff --git a/src/zrender/shape/Image.js b/src/zrender/shape/Image.js index 3ed4932..2b58e26 100644 --- a/src/zrender/shape/Image.js +++ b/src/zrender/shape/Image.js @@ -1,93 +1,73 @@ /** - * zrender - * - * @author lang( shenyi01@baidu.com ) - * - * shape类:图片 - * 可配图形属性: - { - // 基础属性 - shape : 'image', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,左上角横坐标 - y : {number}, // 必须,左上角纵坐标 - width : {number}, // 可选,宽度 - height : {number}, // 可选,高度 - sx : {number}, // 可选, 从图片中裁剪的x - sy : {number}, // 可选, 从图片中裁剪的y - sWidth : {number}, // 可选, 从图片中裁剪的宽度 - sHeight : {number}, // 可选, 从图片中裁剪的高度 - image : {string|Image} // 必须,图片url或者图片对象 - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为top,附加文本位置。 - // inside | left | right | top | bottom - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'image', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - width : 150, - height : 50, - image : 'tests.jpg', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } + * 图片绘制 + * @module zrender/shape/Image + * @author pissang(https://www.github.com/pissang) + * @example + * var ImageShape = require('zrender/shape/Image.js'); + * var image = new ImageShape({ + * style: { + * image: 'test.jpg', + * x: 100, + * y: 100 + * } + * }); + * zr.addShape(image); + */ + +/** + * @typedef {Object} IImageStyle + * @property {string|HTMLImageElement|HTMLCanvasElement} image 图片url或者图片对象 + * @property {number} x 左上角横坐标 + * @property {number} y 左上角纵坐标 + * @property {number} [width] 绘制到画布上的宽度,默认为图片宽度 + * @property {number} [height] 绘制到画布上的高度,默认为图片高度 + * @property {number} [sx=0] 从图片中裁剪的左上角横坐标 + * @property {number} [sy=0] 从图片中裁剪的左上角纵坐标 + * @property {number} [sWidth] 从图片中裁剪的宽度,默认为图片高度 + * @property {number} [sHeight] 从图片中裁剪的高度,默认为图片高度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic */ -var _cache = {}; -var _needsRefresh = []; -var _refreshTimeout; var Base = require('./Base.js'); -function ZImage(options) { +/** + * @alias zrender/shape/Image + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ +var ZImage = function (options) { Base.call(this, options); -} + /** + * 图片绘制样式 + * @name module:zrender/shape/Image#style + * @type {module:zrender/shape/Image~IImageStyle} + */ + /** + * 图片高亮绘制样式 + * @name module:zrender/shape/Image#highlightStyle + * @type {module:zrender/shape/Image~IImageStyle} + */ +}; ZImage.prototype = { + type: 'image', - brush: function (ctx, isHighlight, refresh) { + + brush: function (ctx, isHighlight, refreshNextFrame) { var style = this.style || {}; if (isHighlight) { @@ -97,33 +77,29 @@ ZImage.prototype = { } var image = style.image; - var me = this; + var self = this; + if (!this._imageCache) { + this._imageCache = {}; + } if (typeof(image) === 'string') { var src = image; - if (_cache[src]) { - image = _cache[src]; - } - else { - image = new Image(); //document.createElement('image'); + if (this._imageCache[src]) { + image = this._imageCache[src]; + } else { + image = new Image(); image.onload = function () { image.onload = null; - clearTimeout(_refreshTimeout); - _needsRefresh.push(me); - // 防止因为缓存短时间内触发多次onload事件 - _refreshTimeout = setTimeout(function () { - refresh && refresh(_needsRefresh); - // 清空needsRefresh - _needsRefresh = []; - }, 10); + self.modSelf(); + refreshNextFrame(); }; - _cache[src] = image; image.src = src; + this._imageCache[src] = image; } } if (image) { - //图片已经加载完成 + // 图片已经加载完成 if (image.nodeName.toUpperCase() == 'IMG') { if (window.ActiveXObject) { if (image.readyState != 'complete') { @@ -137,18 +113,19 @@ ZImage.prototype = { } } // Else is canvas - var width = style.width || image.width; var height = style.height || image.height; var x = style.x; var y = style.y; - // 图片加载失败 if (!image.width || !image.height) { return; } ctx.save(); + + this.doClip(ctx); + this.setContext(ctx, style); // 设置transform @@ -172,11 +149,18 @@ ZImage.prototype = { ctx.drawImage(image, x, y, width, height); } // 如果没设置宽和高的话自动根据图片宽高设置 - style.width = width; - style.height = height; - this.style.width = width; - this.style.height = height; - + if (!style.width) { + style.width = width; + } + if (!style.height) { + style.height = height; + } + if (!this.style.width) { + this.style.width = width; + } + if (!this.style.height) { + this.style.height = height; + } this.drawText(ctx, style, this.style); @@ -185,18 +169,9 @@ ZImage.prototype = { }, /** - * 创建路径,用于判断hover时调用isPointInPath~ - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ - buildPath: function (ctx, style) { - ctx.rect(style.x, style.y, style.width, style.height); - return; - }, - - /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style + * 计算返回图片的包围盒矩形 + * @param {module:zrender/shape/Image~IImageStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} */ getRect: function (style) { return { @@ -205,6 +180,10 @@ ZImage.prototype = { width: style.width, height: style.height }; + }, + + clearCache: function () { + this._imageCache = {}; } }; diff --git a/src/zrender/shape/Isogon.js b/src/zrender/shape/Isogon.js index 52a6b89..7879ae8 100644 --- a/src/zrender/shape/Isogon.js +++ b/src/zrender/shape/Isogon.js @@ -1,76 +1,33 @@ /** - * zrender - * - * @author sushuang (宿爽, sushuang@baidu.com) - * - * shape类:正n边形(n>=3) - * 可配图形属性: - { - // 基础属性 - shape : 'isogon', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,正n边形外接圆心横坐标 - y : {number}, // 必须,正n边形外接圆心纵坐标 - r : {number}, // 必须,正n边形外接圆半径 - n : {number}, // 必须,指明正几边形 - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - lineJoin : {string}, // 默认为miter,线段连接样式。miter | round | bevel - - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为outside,附加文本位置。 - // outside | inside - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'isogon', - id : '123456', - zlevel : 1, - style : { - x : 400, - y : 100, - r : 150, - n : 7, - color : '#eee' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } + * 正多边形 + * @module zrender/shape/Isogon + * @author sushuang (宿爽, sushuang0322@gmail.com) + */ + +/** + * @typedef {Object} IIsogonStyle + * @property {number} x 正n边形外接圆心x坐标 + * @property {number} y 正n边形外接圆心y坐标 + * @property {number} r 正n边形外接圆半径 + * @property {number} n 指明正几边形 + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic */ var math = require('../tool/math.js'); @@ -80,8 +37,24 @@ var PI = Math.PI; var Base = require('./Base.js'); +/** + * @constructor + * @alias module:zrender/shape/Isogon + * @param {Object} options + */ + function Isogon(options) { Base.call(this, options); + /** + * 多边形绘制样式 + * @name module:zrender/shape/Isogon#style + * @type {module:zrender/shape/Isogon~IIsogonStyle} + */ + /** + * 多边形高亮绘制样式 + * @name module:zrender/shape/Isogon#highlightStyle + * @type {module:zrender/shape/Isogon~IIsogonStyle} + */ } Isogon.prototype = { @@ -89,8 +62,8 @@ Isogon.prototype = { /** * 创建n角星(n>=3)路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Isogon~IIsogonStyle} style */ buildPath: function (ctx, style) { var n = style.n; @@ -122,13 +95,15 @@ Isogon.prototype = { for (var i = 0; i < pointList.length; i++) { ctx.lineTo(pointList[i][0], pointList[i][1]); } + ctx.closePath(); return; }, /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style + * 计算返回正多边形的包围盒矩形 + * @param {module:zrender/shape/Isogon~IIsogonStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} */ getRect: function (style) { if (style.__rect) { diff --git a/src/zrender/shape/Line.js b/src/zrender/shape/Line.js index 81738ed..f981d23 100644 --- a/src/zrender/shape/Line.js +++ b/src/zrender/shape/Line.js @@ -1,99 +1,82 @@ /** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:直线 - * 可配图形属性: - { - // 基础属性 - shape : 'line', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - xStart : {number}, // 必须,起点横坐标 - yStart : {number}, // 必须,起点纵坐标 - xEnd : {number}, // 必须,终点横坐标 - yEnd : {number}, // 必须,终点纵坐标 - strokeColor : {color}, // 默认为'#000',线条颜色(轮廓),支持rgba - lineType : {string}, // 默认为solid,线条类型,solid | dashed | dotted - lineWidth : {number}, // 默认为1,线条宽度 - lineCap : {string}, // 默认为butt,线帽样式。butt | round | square - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为end,附加文本位置。 - // inside | start | end - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#000' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'line', - id : '123456', - zlevel : 1, - style : { - xStart : 100, - yStart : 100, - xEnd : 200, - yEnd : 200, - strokeColor : '#eee', - lineWidth : 20, - text : 'Baidu' - }, - myName : 'kener', //可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } + * 直线 + * @module zrender/shape/Line + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + * @example + * var Line = require('zrender/shape/Line.js'); + * var shape = new Line({ + * style: { + * xStart: 0, + * yStart: 0, + * xEnd: 100, + * yEnd: 100, + * strokeColor: '#000', + * lineWidth: 10 + * } + * }); + * zr.addShape(line); + */ +/** + * @typedef {Object} ILineStyle + * @property {number} xStart 起点x坐标 + * @property {number} yStart 起点y坐标 + * @property {number} xEnd 终止点x坐标 + * @property {number} yEnd 终止点y坐标 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic */ var Base = require('./Base.js'); var dashedLineTo = require('./util/dashedLineTo.js'); -function Line(options) { - this.brushTypeOnly = 'stroke'; //线条只能描边,填充后果自负 +/** + * @alias module:zrender/shape/Line + * @param {Object} options + * @constructor + * @extends module:zrender/shape/Base + */ +var Line = function (options) { + this.brushTypeOnly = 'stroke'; // 线条只能描边,填充后果自负 this.textPosition = 'end'; Base.call(this, options); -} + + /** + * 直线绘制样式 + * @name module:zrender/shape/Line#style + * @type {module:zrender/shape/Line~ILineStyle} + */ + /** + * 直线高亮绘制样式 + * @name module:zrender/shape/Line#highlightStyle + * @type {module:zrender/shape/Line~ILineStyle} + */ +}; Line.prototype = { type: 'line', /** * 创建线条路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Line~ILineStyle} style */ buildPath: function (ctx, style) { if (!style.lineType || style.lineType == 'solid') { - //默认为实线 + // 默认为实线 ctx.moveTo(style.xStart, style.yStart); ctx.lineTo(style.xEnd, style.yEnd); } @@ -105,8 +88,9 @@ Line.prototype = { }, /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style + * 计算返回线条的包围盒矩形 + * @param {module:zrender/shape/Line~ILineStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} */ getRect: function (style) { if (style.__rect) { diff --git a/src/zrender/shape/Path.js b/src/zrender/shape/Path.js index fb79eea..ca42b97 100644 --- a/src/zrender/shape/Path.js +++ b/src/zrender/shape/Path.js @@ -1,87 +1,80 @@ /** - * zrender - * - * author: CrossDo (chenhuaimu@baidu.com) - * - * shape类:路径 - * 可配图形属性: - { - // 基础属性 - shape : 'path', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - path : {string},// 必须,路径。例如:M 0 0 L 0 10 L 10 10 Z (一个三角形) - //M = moveto - //L = lineto - //H = horizontal lineto - //V = vertical lineto - //C = curveto - //S = smooth curveto - //Q = quadratic Belzier curve - //T = smooth quadratic Belzier curveto - //Z = closepath - - - x : {number}, // 必须,x轴坐标 - y : {number}, // 必须,y轴坐标 - - - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为top,附加文本位置。 - // inside | left | right | top | bottom - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - - **/ + * SVG Path + * @module zrender/shape/Path + * @see http://www.w3.org/TR/2011/REC-SVG11-20110816/paths.html#PathData + * @author: Pissang (shenyi.914@gmail.com) + */ + +/** + * @typedef {Object} IPathStyle + * @property {string} path path描述数据, 详见 {@link http://www.w3.org/TR/2011/REC-SVG11-20110816/paths.html#PathData} + * @property {number} x x轴位移 + * @property {number} y y轴位移 + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ var Base = require('./Base.js'); +var PathProxy = require('./util/PathProxy.js'); +var PathSegment = PathProxy.PathSegment; -function Path(options) { +var vMag = function (v) { + return Math.sqrt(v[0] * v[0] + v[1] * v[1]); +}; +var vRatio = function (u, v) { + return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v)); +}; +var vAngle = function (u, v) { + return (u[0] * v[1] < u[1] * v[0] ? -1 : 1) * Math.acos(vRatio(u, v)); +}; +/** + * @alias module:zrender/shape/Path + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ +var Path = function (options) { Base.call(this, options); -} + /** + * Path绘制样式 + * @name module:zrender/shape/Path#style + * @type {module:zrender/shape/Path~IPathStyle} + */ + /** + * Path高亮绘制样式 + * @name module:zrender/shape/Path#highlightStyle + * @type {module:zrender/shape/Path~IPathStyle} + */ +}; Path.prototype = { type: 'path', - _parsePathData: function (data) { + buildPathArray: function (data, x, y) { if (!data) { return []; } + // 平移 + x = x || 0; + y = y || 0; // command string var cs = data; @@ -93,7 +86,6 @@ Path.prototype = { cs = cs.replace(/ /g, ','); cs = cs.replace(/,,/g, ','); - var n; // create pipes so that we can split the data for (n = 0; n < cc.length; n++) { @@ -294,25 +286,23 @@ Path.prototype = { points = this._convertPoint( x1, y1, cpx, cpy, fa, fs, rx, ry, psi); break; - } - ca.push({ - command: cmd || c, - points: points - }); + // 平移变换 + for (var j = 0, l = points.length; j < l; j += 2) { + points[j] += x; + points[j + 1] += y; + } + ca.push(new PathSegment( + cmd || c, points)); } if (c === 'z' || c === 'Z') { - ca.push({ - command: 'z', - points: [] - }); + ca.push(new PathSegment('z', [])); } } return ca; - }, _convertPoint: function (x1, y1, x2, y2, fa, fs, rx, ry, psiDeg) { @@ -342,15 +332,6 @@ Path.prototype = { var cx = (x1 + x2) / 2.0 + Math.cos(psi) * cxp - Math.sin(psi) * cyp; var cy = (y1 + y2) / 2.0 + Math.sin(psi) * cxp + Math.cos(psi) * cyp; - var vMag = function (v) { - return Math.sqrt(v[0] * v[0] + v[1] * v[1]); - }; - var vRatio = function (u, v) { - return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v)); - }; - var vAngle = function (u, v) { - return (u[0] * v[1] < u[1] * v[0] ? -1 : 1) * Math.acos(vRatio(u, v)); - }; var theta = vAngle([1, 0], [(xp - cxp) / rx, (yp - cyp) / ry]); var u = [(xp - cxp) / rx, (yp - cyp) / ry]; var v = [(-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry]; @@ -373,19 +354,19 @@ Path.prototype = { /** * 创建路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Path~IPathStyle} style */ buildPath: function (ctx, style) { var path = style.path; - var pathArray = this.pathArray || this._parsePathData(path); - // 平移坐标 var x = style.x || 0; var y = style.y || 0; - var p; + style.pathArray = style.pathArray || this.buildPathArray(path, x, y); + var pathArray = style.pathArray; + // 记录边界点,用于判断inside var pointList = style.pointList = []; var singlePointList = []; @@ -394,25 +375,16 @@ Path.prototype = { singlePointList.length > 0 && pointList.push(singlePointList); singlePointList = []; } - p = pathArray[i].points; + var p = pathArray[i].points; for (var j = 0, k = p.length; j < k; j += 2) { - singlePointList.push([p[j] + x, p[j + 1] + y]); + singlePointList.push([p[j], p[j + 1]]); } } singlePointList.length > 0 && pointList.push(singlePointList); - var c; for (var i = 0, l = pathArray.length; i < l; i++) { - c = pathArray[i].command; - p = pathArray[i].points; - // 平移变换 - for (var j = 0, k = p.length; j < k; j++) { - if (j % 2 === 0) { - p[j] += x; - } else { - p[j] += y; - } - } + var c = pathArray[i].command; + var p = pathArray[i].points; switch (c) { case 'L': ctx.lineTo(p[0], p[1]); @@ -457,8 +429,9 @@ Path.prototype = { }, /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style 样式 + * 计算返回Path包围盒矩形。 + * @param {module:zrender/shape/Path~IPathStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} */ getRect: function (style) { if (style.__rect) { @@ -483,25 +456,25 @@ Path.prototype = { var x = style.x || 0; var y = style.y || 0; - var pathArray = this.pathArray || this._parsePathData(style.path); + var pathArray = style.pathArray || this.buildPathArray(style.path); for (var i = 0; i < pathArray.length; i++) { var p = pathArray[i].points; for (var j = 0; j < p.length; j++) { if (j % 2 === 0) { if (p[j] + x < minX) { - minX = p[j] + x; + minX = p[j]; } if (p[j] + x > maxX) { - maxX = p[j] + x; + maxX = p[j]; } } else { if (p[j] + y < minY) { - minY = p[j] + y; + minY = p[j]; } if (p[j] + y > maxY) { - maxY = p[j] + y; + maxY = p[j]; } } } diff --git a/src/zrender/shape/Polygon.js b/src/zrender/shape/Polygon.js index a1f2f8d..2590408 100644 --- a/src/zrender/shape/Polygon.js +++ b/src/zrender/shape/Polygon.js @@ -1,71 +1,42 @@ /** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:多边形 - * 可配图形属性: - { - // 基础属性 - shape : 'polygon', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - pointList : {Array}, // 必须,多边形各个顶角坐标 - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为top,附加文本位置。 - // inside | left | right | top | bottom - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'polygon', - id : '123456', - zlevel : 1, - style : { - pointList : [[10, 10], [300, 20], [298, 400], [50, 450]] - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } + * 多边形 + * @module zrender/shape/Polygon + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + * @example + * var Polygon = require('zrender/shape/Polygon.js'); + * var shape = new Polygon({ + * style: { + * // 100x100的正方形 + * pointList: [[0, 0], [100, 0], [100, 100], [0, 100]], + * color: 'blue' + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} IPolygonStyle + * @property {string} pointList 多边形顶点数组 + * @property {string} [smooth=''] 是否做平滑插值, 平滑算法可以选择 bezier, spline + * @property {number} [smoothConstraint] 平滑约束 + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic */ var Base = require('./Base.js'); @@ -73,78 +44,33 @@ var smoothSpline = require('./util/smoothSpline.js'); var smoothBezier = require('./util/smoothBezier.js'); var dashedLineTo = require('./util/dashedLineTo.js'); - -function Polygon(options) { +/** + * @alias module:zrender/shape/Polygon + * @param {Object} options + * @constructor + * @extends module:zrender/shape/Base + */ +var Polygon = function (options) { Base.call(this, options); -} - -Polygon.prototype = { - type: 'polygon', - /** - * 画刷 - * @param ctx 画布句柄 - * @param isHighlight 是否为高亮状态 - * @param updateCallback 需要异步加载资源的shape可以通过这个callback(e) - * 让painter更新视图,base.brush没用,需要的话重载brush + * 多边形绘制样式 + * @name module:zrender/shape/Polygon#style + * @type {module:zrender/shape/Polygon~IPolygonStyle} */ - brush: function (ctx, isHighlight) { - var style = this.style; - if (isHighlight) { - // 根据style扩展默认高亮样式 - style = this.getHighlightStyle( - style, this.highlightStyle || {}); - } - - ctx.save(); - this.setContext(ctx, style); - - // 设置transform - this.setTransform(ctx); - - // 先fill再stroke - var hasPath = false; - if (style.brushType == 'fill' || style.brushType == 'both' || typeof style.brushType == 'undefined' // 默认为fill - ) { - ctx.beginPath(); - if (style.lineType == 'dashed' || style.lineType == 'dotted') { - // 特殊处理,虚线围不成path,实线再build一次 - this.buildPath( - ctx, { - lineType: 'solid', - lineWidth: style.lineWidth, - pointList: style.pointList - }); - hasPath = false; // 这个path不能用 - } - else { - this.buildPath(ctx, style); - hasPath = true; // 这个path能用 - } - ctx.closePath(); - ctx.fill(); - } - - if (style.lineWidth > 0 && (style.brushType == 'stroke' || style.brushType == 'both')) { - if (!hasPath) { - ctx.beginPath(); - this.buildPath(ctx, style); - ctx.closePath(); - } - ctx.stroke(); - } - - this.drawText(ctx, style, this.style); - - ctx.restore(); + /** + * 多边形高亮绘制样式 + * @name module:zrender/shape/Polygon#highlightStyle + * @type {module:zrender/shape/Polygon~IPolygonStyle} + */ +}; - return; - }, +Polygon.prototype = { + type: 'polygon', /** * 创建多边形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Polygon~IPolygonStyle} style */ buildPath: function (ctx, style) { // 虽然能重用brokenLine,但底层图形基于性能考虑,重复代码减少调用吧 @@ -170,7 +96,7 @@ Polygon.prototype = { if (style.smooth && style.smooth !== 'spline') { var controlPoints = smoothBezier( - pointList, style.smooth, true); + pointList, style.smooth, true, style.smoothConstraint); ctx.moveTo(pointList[0][0], pointList[0][1]); var cp1; @@ -191,7 +117,7 @@ Polygon.prototype = { } if (!style.lineType || style.lineType == 'solid') { - //默认为实线 + // 默认为实线 ctx.moveTo(pointList[0][0], pointList[0][1]); for (var i = 1, l = pointList.length; i < l; i++) { ctx.lineTo(pointList[i][0], pointList[i][1]); @@ -211,12 +137,15 @@ Polygon.prototype = { ctx, pointList[pointList.length - 1][0], pointList[pointList.length - 1][1], pointList[0][0], pointList[0][1], dashLength); } } + + ctx.closePath(); return; }, /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style + * 计算返回多边形包围盒矩阵 + * @param {module:zrender/shape/Polygon~IPolygonStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} */ getRect: function (style) { if (style.__rect) { diff --git a/src/zrender/shape/Polyline.js b/src/zrender/shape/Polyline.js new file mode 100644 index 0000000..38508f3 --- /dev/null +++ b/src/zrender/shape/Polyline.js @@ -0,0 +1,137 @@ +/** + * 折线 + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + * @module zrender/shape/Polyline + * @example + * var Polyline = require('zrender/shape/Polyline.js'); + * var shape = new Polyline({ + * style: { + * pointList: [[0, 0], [100, 100], [100, 0]], + * smooth: 'bezier', + * strokeColor: 'purple' + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} IPolylineStyle + * @property {Array.} pointList 顶点坐标数组 + * @property {string} [smooth=''] 是否做平滑插值, 平滑算法可以选择 bezier, spline + * @property {number} [smoothConstraint] 平滑约束 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {string} [lineJoin='miter'] 线段连接样式,可以是 miter, round, bevel + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ + +var Base = require('./Base.js'); +var smoothSpline = require('./util/smoothSpline.js'); +var smoothBezier = require('./util/smoothBezier.js'); +var dashedLineTo = require('./util/dashedLineTo.js'); + +/** + * @alias module:zrender/shape/Polyline + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ +var Polyline = function (options) { + this.brushTypeOnly = 'stroke'; // 线条只能描边,填充后果自负 + this.textPosition = 'end'; + Base.call(this, options); + /** + * 贝赛尔曲线绘制样式 + * @name module:zrender/shape/Polyline#style + * @type {module:zrender/shape/Polyline~IPolylineStyle} + */ + /** + * 贝赛尔曲线高亮绘制样式 + * @name module:zrender/shape/Polyline#highlightStyle + * @type {module:zrender/shape/Polyline~IPolylineStyle} + */ +}; + +Polyline.prototype = { + type: 'polyline', + + /** + * 创建多边形路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Polyline~IPolylineStyle} style + */ + buildPath: function (ctx, style) { + var pointList = style.pointList; + if (pointList.length < 2) { + // 少于2个点就不画了~ + return; + } + + var len = Math.min( + style.pointList.length, Math.round(style.pointListLength || style.pointList.length)); + + if (style.smooth && style.smooth !== 'spline') { + var controlPoints = smoothBezier( + pointList, style.smooth, false, style.smoothConstraint); + + ctx.moveTo(pointList[0][0], pointList[0][1]); + var cp1; + var cp2; + var p; + for (var i = 0; i < len - 1; i++) { + cp1 = controlPoints[i * 2]; + cp2 = controlPoints[i * 2 + 1]; + p = pointList[i + 1]; + ctx.bezierCurveTo( + cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]); + } + } + else { + if (style.smooth === 'spline') { + pointList = smoothSpline(pointList); + len = pointList.length; + } + if (!style.lineType || style.lineType == 'solid') { + // 默认为实线 + ctx.moveTo(pointList[0][0], pointList[0][1]); + for (var i = 1; i < len; i++) { + ctx.lineTo(pointList[i][0], pointList[i][1]); + } + } + else if (style.lineType == 'dashed' || style.lineType == 'dotted') { + var dashLength = (style.lineWidth || 1) * (style.lineType == 'dashed' ? 5 : 1); + ctx.moveTo(pointList[0][0], pointList[0][1]); + for (var i = 1; i < len; i++) { + dashedLineTo( + ctx, pointList[i - 1][0], pointList[i - 1][1], pointList[i][0], pointList[i][1], dashLength); + } + } + } + return; + }, + + /** + * 计算返回折线包围盒矩形。 + * @param {IZRenderBezierCurveStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect: function (style) { + return require('./Polygon.js').prototype.getRect(style); + } +}; + +require('../tool/util.js').inherits(Polyline, Base); +module.exports = Polyline; \ No newline at end of file diff --git a/src/zrender/shape/Rectangle.js b/src/zrender/shape/Rectangle.js index 79653a5..ef5a398 100644 --- a/src/zrender/shape/Rectangle.js +++ b/src/zrender/shape/Rectangle.js @@ -1,101 +1,80 @@ /** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) , - * strwind (@劲风FEI, yaofeifei@baidu.com) - * - * shape类:矩形 - * 可配图形属性: - { - // 基础属性 - shape : 'rectangle', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,左上角横坐标 - y : {number}, // 必须,左上角纵坐标 - width : {number}, // 必须,宽度 - height : {number}, // 必须,高度 - radius : {array}, // 默认为[0],圆角 - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为top,附加文本位置。 - // inside | left | right | top | bottom - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'rectangle', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - width : 150, - height : 50, - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } + * 矩形 + * @module zrender/shape/Rectangle + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) , + * strwind (@劲风FEI) + * @example + * var Rectangle = require('zrender/shape/Rectangle.js'); + * var shape = new Rectangle({ + * style: { + * x: 0, + * y: 0, + * width: 100, + * height: 100, + * radius: 20 + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} IRectangleStyle + * @property {number} x 左上角x坐标 + * @property {number} y 左上角y坐标 + * @property {number} width 宽度 + * @property {number} height 高度 + * @property {number|Array.} radius 矩形圆角,可以用数组分别指定四个角的圆角 + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic */ var Base = require('./Base.js'); -function Rectangle(options) { +/** + * @alias module:zrender/shape/Rectangle + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ +var Rectangle = function (options) { Base.call(this, options); -} + /** + * 矩形绘制样式 + * @name module:zrender/shape/Rectangle#style + * @type {module:zrender/shape/Rectangle~IRectangleStyle} + */ + /** + * 矩形高亮绘制样式 + * @name module:zrender/shape/Rectangle#highlightStyle + * @type {module:zrender/shape/Rectangle~IRectangleStyle} + */ +}; Rectangle.prototype = { type: 'rectangle', - /** - * 绘制圆角矩形 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 - */ _buildRadiusPath: function (ctx, style) { - //左上、右上、右下、左下角的半径依次为r1、r2、r3、r4 - //r缩写为1 相当于 [1, 1, 1, 1] - //r缩写为[1] 相当于 [1, 1, 1, 1] - //r缩写为[1, 2] 相当于 [1, 2, 1, 2] - //r缩写为[1, 2, 3] 相当于 [1, 2, 3, 2] + // 左上、右上、右下、左下角的半径依次为r1、r2、r3、r4 + // r缩写为1 相当于 [1, 1, 1, 1] + // r缩写为[1] 相当于 [1, 1, 1, 1] + // r缩写为[1, 2] 相当于 [1, 2, 1, 2] + // r缩写为[1, 2, 3] 相当于 [1, 2, 3, 2] var x = style.x; var y = style.y; var width = style.width; @@ -121,15 +100,39 @@ Rectangle.prototype = { r1 = r[0]; r2 = r4 = r[1]; r3 = r[2]; - } else { + } + else { r1 = r[0]; r2 = r[1]; r3 = r[2]; r4 = r[3]; } - } else { + } + else { r1 = r2 = r3 = r4 = 0; } + + var total; + if (r1 + r2 > width) { + total = r1 + r2; + r1 *= width / total; + r2 *= width / total; + } + if (r3 + r4 > width) { + total = r3 + r4; + r3 *= width / total; + r4 *= width / total; + } + if (r2 + r3 > height) { + total = r2 + r3; + r2 *= height / total; + r3 *= height / total; + } + if (r1 + r4 > height) { + total = r1 + r4; + r1 *= height / total; + r4 *= height / total; + } ctx.moveTo(x + r1, y); ctx.lineTo(x + width - r2, y); r2 !== 0 && ctx.quadraticCurveTo( @@ -146,8 +149,8 @@ Rectangle.prototype = { /** * 创建矩形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 + * @param {CanvasRenderingContext2D} ctx + * @param {Object} style */ buildPath: function (ctx, style) { if (!style.radius) { @@ -156,16 +159,19 @@ Rectangle.prototype = { ctx.lineTo(style.x + style.width, style.y + style.height); ctx.lineTo(style.x, style.y + style.height); ctx.lineTo(style.x, style.y); - //ctx.rect(style.x, style.y, style.width, style.height); - } else { + // ctx.rect(style.x, style.y, style.width, style.height); + } + else { this._buildRadiusPath(ctx, style); } + ctx.closePath(); return; }, /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style + * 计算返回矩形包围盒矩阵 + * @param {module:zrender/shape/Rectangle~IRectangleStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} */ getRect: function (style) { if (style.__rect) { diff --git a/src/zrender/shape/Ring.js b/src/zrender/shape/Ring.js index 1466892..f33735e 100644 --- a/src/zrender/shape/Ring.js +++ b/src/zrender/shape/Ring.js @@ -1,91 +1,75 @@ /** - * zrender + * 圆环 + * @module zrender/shape/Ring + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:圆环 - * 可配图形属性: - { - // 基础属性 - shape : 'ring', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,圆心横坐标 - y : {number}, // 必须,圆心纵坐标 - r0 : {number}, // 必须,内圆半径 - r : {number}, // 必须,外圆半径 - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为outside,附加文本位置。 - // outside | inside - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'ring', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - r : 50, - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } + * @example + * var Ring = require('zrender/shape/Ring.js'); + * var shape = new Ring({ + * style: { + * x: 100, + * y: 100, + * r0: 30, + * r: 50 + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} IRingStyle + * @property {number} x 圆心x坐标 + * @property {number} y 圆心y坐标 + * @property {number} r0 内圆半径 + * @property {number} r 外圆半径 + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic */ var Base = require('./Base.js'); -function Ring(options) { +/** + * @alias module:zrender/shape/Ring + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ +var Ring = function (options) { Base.call(this, options); -} + /** + * 圆环绘制样式 + * @name module:zrender/shape/Ring#style + * @type {module:zrender/shape/Ring~IRingStyle} + */ + /** + * 圆环高亮绘制样式 + * @name module:zrender/shape/Ring#highlightStyle + * @type {module:zrender/shape/Ring~IRingStyle} + */ +}; Ring.prototype = { type: 'ring', /** - * 创建圆环路径,依赖扇形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 + * 创建圆环路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Ring~IRingStyle} style */ buildPath: function (ctx, style) { // 非零环绕填充优化 @@ -96,8 +80,9 @@ Ring.prototype = { }, /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style + * 计算返回圆环包围盒矩阵 + * @param {module:zrender/shape/Ring~IRingStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} */ getRect: function (style) { if (style.__rect) { diff --git a/src/zrender/shape/Rose.js b/src/zrender/shape/Rose.js index 8bf61ce..117a87e 100644 --- a/src/zrender/shape/Rose.js +++ b/src/zrender/shape/Rose.js @@ -1,94 +1,79 @@ /** - * zrender - * - * @author Neil (杨骥, yangji01@baidu.com) - * - * shape类:玫瑰线 - * 可配图形属性: - { - // 基础属性 - shape : 'rose', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 默认为0, 圆心的横坐标 - y : {number}, // 默认为0, 圆心的纵坐标 - r : {Array}, // 必须,每个线条的最大长度 - k : {number}, // 必须,决定花瓣数量,当n为1时,奇数即为花瓣数,偶数时花瓣数量翻倍 - n : {number=}, // 默认为1,必须为整数,与k共同决定花瓣的数量 - strokeColor : {color}, // 默认为'#000',线条颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度 - lineCap : {string}, // 默认为butt,线帽样式。butt | round | square - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为end,附加文本位置。 - // inside | start | end - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#000' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'rose', - id : '123456', - zlevel : 1, - style : { - x : 100, - y : 100, - r1 : 50, - r2 : 30, - d : 50, - strokeColor : '#eee', - lineWidth : 20, - text : 'Baidu' - }, - myName : 'kener', //可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } + * 玫瑰线 + * @module zrender/shape/Rose + * @author Neil (杨骥, 511415343@qq.com) + * @example + * var Rose = require('zrender/shape/Rose.js'); + * var shape = new Rose({ + * style: { + * x: 100, + * y: 100, + * r1: 50, + * r2: 30, + * d: 50, + * strokeColor: '#eee', + * lineWidth: 3 + * } + * }); + * zr.addShape(shape); */ +/** + * @typedef {Object} IRoseStyle + * @property {number} x 中心x坐标 + * @property {number} y 中心y坐标 + * @property {number} r 每个线条的最大长度 + * @property {number} k 花瓣数量,当n为1时,奇数即为花瓣数,偶数时花瓣数量翻倍 + * @property {number} [n=1] 必须为整数,与k共同决定花瓣的数量 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ + + var Base = require('./Base.js'); -function Rose(options) { - this.brushTypeOnly = 'stroke'; //线条只能描边,填充后果自负 +/** + * @alias module:zrender/shape/Rose + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ +var Rose = function (options) { + this.brushTypeOnly = 'stroke'; // 线条只能描边,填充后果自负 Base.call(this, options); -} + /** + * 玫瑰线绘制样式 + * @name module:zrender/shape/Rose#style + * @type {module:zrender/shape/Rose~IRoseStyle} + */ + /** + * 玫瑰线高亮绘制样式 + * @name module:zrender/shape/Rose#highlightStyle + * @type {module:zrender/shape/Rose~IRoseStyle} + */ +}; Rose.prototype = { type: 'rose', /** - * 创建线条路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 + * 创建玫瑰线路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Rose~IRoseStyle} style */ buildPath: function (ctx, style) { var _x; @@ -116,8 +101,9 @@ Rose.prototype = { }, /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style + * 返回玫瑰线包围盒矩形 + * @param {module:zrender/shape/Rose~IRoseStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} */ getRect: function (style) { if (style.__rect) { diff --git a/src/zrender/shape/Sector.js b/src/zrender/shape/Sector.js index 343c9d7..c5c44a3 100644 --- a/src/zrender/shape/Sector.js +++ b/src/zrender/shape/Sector.js @@ -1,141 +1,135 @@ /** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:扇形 - * 可配图形属性: - { - // 基础属性 - shape : 'sector', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,圆心横坐标 - y : {number}, // 必须,圆心纵坐标 - r0 : {number}, // 默认为0,内圆半径,指定后将出现内弧,同时扇边长度 = r - r0 - r : {number}, // 必须,外圆半径 - startAngle : {number}, // 必须,起始角度[0, 360) - endAngle : {number}, // 必须,结束角度(0, 360] - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为outside,附加文本位置。 - // outside | inside - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'sector', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - r : 50, - color : '#eee', - text : 'Baidu' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } + * 扇形 + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + * @module zrender/shape/Sector + * @example + * var Sector = require('zrender/shape/Sector.js'); + * var shape = new Sector({ + * style: { + * x: 100, + * y: 100, + * r: 60, + * r0: 30, + * startAngle: 0, + * endEngle: 180 + * } + * }); + * zr.addShape(shape); */ +/** + * @typedef {Object} ISectorStyle + * @property {number} x 圆心x坐标 + * @property {number} y 圆心y坐标 + * @property {number} r 外圆半径 + * @property {number} [r0=0] 内圆半径,指定后将出现内弧,同时扇边长度为`r - r0` + * @property {number} startAngle 起始角度,`[0, 360)` + * @property {number} endAngle 结束角度,`(0, 360]` + * @property {boolean} [clockWise=false] 是否是顺时针 + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ + + + var math = require('../tool/math.js'); +var computeBoundingBox = require('../tool/computeBoundingBox.js'); +var vec2 = require('../tool/vector.js'); var Base = require('./Base.js'); -function Sector(options) { +var min0 = vec2.create(); +var min1 = vec2.create(); +var max0 = vec2.create(); +var max1 = vec2.create(); +/** + * @alias module:zrender/shape/Sector + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ +var Sector = function (options) { Base.call(this, options); -} + /** + * 扇形绘制样式 + * @name module:zrender/shape/Sector#style + * @type {module:zrender/shape/Sector~ISectorStyle} + */ + /** + * 扇形高亮绘制样式 + * @name module:zrender/shape/Sector#highlightStyle + * @type {module:zrender/shape/Sector~ISectorStyle} + */ +}; Sector.prototype = { type: 'sector', /** * 创建扇形路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Sector~ISectorStyle} style */ buildPath: function (ctx, style) { var x = style.x; // 圆心x var y = style.y; // 圆心y - var r0 = typeof style.r0 == 'undefined' // 形内半径[0,r) - ? 0 : style.r0; + var r0 = style.r0 || 0; // 形内半径[0,r) var r = style.r; // 扇形外半径(0,r] var startAngle = style.startAngle; // 起始角度[0,360) var endAngle = style.endAngle; // 结束角度(0,360] - - if (Math.abs(endAngle - startAngle) >= 360) { - // 大于360度的扇形简化为圆环画法 - ctx.arc(x, y, r, 0, Math.PI * 2, false); - if (r0 !== 0) { - ctx.moveTo(x + r0, y); - ctx.arc(x, y, r0, 0, Math.PI * 2, true); - } - return; - } + var clockWise = style.clockWise || false; startAngle = math.degreeToRadian(startAngle); endAngle = math.degreeToRadian(endAngle); - var PI2 = Math.PI * 2; - var cosStartAngle = math.cos(startAngle); - var sinStartAngle = math.sin(startAngle); + if (!clockWise) { + // 扇形默认是逆时针方向,Y轴向上 + // 这个跟arc的标准不一样,为了兼容echarts + startAngle = -startAngle; + endAngle = -endAngle; + } + + var unitX = math.cos(startAngle); + var unitY = math.sin(startAngle); ctx.moveTo( - cosStartAngle * r0 + x, y - sinStartAngle * r0); + unitX * r0 + x, unitY * r0 + y); ctx.lineTo( - cosStartAngle * r + x, y - sinStartAngle * r); + unitX * r + x, unitY * r + y); - ctx.arc(x, y, r, PI2 - startAngle, PI2 - endAngle, true); + ctx.arc(x, y, r, startAngle, endAngle, !clockWise); ctx.lineTo( - math.cos(endAngle) * r0 + x, y - math.sin(endAngle) * r0); + math.cos(endAngle) * r0 + x, math.sin(endAngle) * r0 + y); if (r0 !== 0) { - ctx.arc(x, y, r0, PI2 - endAngle, PI2 - startAngle, false); + ctx.arc(x, y, r0, endAngle, startAngle, clockWise); } + ctx.closePath(); + return; }, /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style + * 返回扇形包围盒矩形 + * @param {module:zrender/shape/Sector~ISectorStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} */ getRect: function (style) { if (style.__rect) { @@ -144,63 +138,35 @@ Sector.prototype = { var x = style.x; // 圆心x var y = style.y; // 圆心y - var r0 = typeof style.r0 == 'undefined' // 形内半径[0,r) - ? 0 : style.r0; + var r0 = style.r0 || 0; // 形内半径[0,r) var r = style.r; // 扇形外半径(0,r] - var startAngle = style.startAngle; // 起始角度[0,360) - var endAngle = style.endAngle; // 结束角度(0,360] + var startAngle = math.degreeToRadian(style.startAngle); + var endAngle = math.degreeToRadian(style.endAngle); + var clockWise = style.clockWise; - if (Math.abs(endAngle - startAngle) >= 360) { - // 大于360度的扇形简化为圆环bbox - style.__rect = require('./Ring.js').prototype.getRect(style); - return style.__rect; + if (!clockWise) { + startAngle = -startAngle; + endAngle = -endAngle; } - startAngle = (720 + startAngle) % 360; - endAngle = (720 + endAngle) % 360; - if (endAngle <= startAngle) { - endAngle += 360; - } - var pointList = []; - if (startAngle <= 90 && endAngle >= 90) { - pointList.push([ - x, y - r]); - } - if (startAngle <= 180 && endAngle >= 180) { - pointList.push([ - x - r, y]); + if (r0 > 1) { + computeBoundingBox.arc( + x, y, r0, startAngle, endAngle, !clockWise, min0, max0); + } else { + min0[0] = max0[0] = x; + min0[1] = max0[1] = y; } - if (startAngle <= 270 && endAngle >= 270) { - pointList.push([ - x, y + r]); - } - if (startAngle <= 360 && endAngle >= 360) { - pointList.push([ - x + r, y]); - } - - startAngle = math.degreeToRadian(startAngle); - endAngle = math.degreeToRadian(endAngle); - - - pointList.push([ - math.cos(startAngle) * r0 + x, y - math.sin(startAngle) * r0]); - - pointList.push([ - math.cos(startAngle) * r + x, y - math.sin(startAngle) * r]); - - pointList.push([ - math.cos(endAngle) * r + x, y - math.sin(endAngle) * r]); - - pointList.push([ - math.cos(endAngle) * r0 + x, y - math.sin(endAngle) * r0]); - - style.__rect = require('./Polygon.js').prototype.getRect({ - brushType: style.brushType, - lineWidth: style.lineWidth, - pointList: pointList - }); - + computeBoundingBox.arc( + x, y, r, startAngle, endAngle, !clockWise, min1, max1); + + vec2.min(min0, min0, min1); + vec2.max(max0, max0, max1); + style.__rect = { + x: min0[0], + y: min0[1], + width: max0[0] - min0[0], + height: max0[1] - min0[1] + }; return style.__rect; } }; diff --git a/src/zrender/shape/ShapeBundle.js b/src/zrender/shape/ShapeBundle.js new file mode 100644 index 0000000..d7f5d22 --- /dev/null +++ b/src/zrender/shape/ShapeBundle.js @@ -0,0 +1,150 @@ +/** + * ShapeBundle 捆绑多个 shape 的 buildPath 方法,但是共用同一个样式 + * @author pissang (https://github.com/pissang) + * @module zrender/shape/ShapeBundle + * @example + * var poly1 = new PolygonShape(); + * var poly2 = new PolygonShape(); + * var poly3 = new PolygonShape(); + * var shapeBundle = new ShapeBundle({ + * style: { + * shapeList: [poly1, poly2, poly3], + * color: 'red' + * } + * }); + * zr.addShape(shapeBundle); + */ + +/** + * @typedef {Object} IShapeBundleStyle + * @property {string} shapeList shape列表 + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + */ + + +var Base = require('./Base.js'); + +var ShapeBundle = function (options) { + Base.call(this, options); + /** + * ShapeBundle绘制样式 + * @name module:zrender/shape/ShapeBundle#style + * @type {module:zrender/shape/ShapeBundle~IShapeBundleStyle} + */ + /** + * ShapeBundle高亮绘制样式 + * @name module:zrender/shape/ShapeBundle#highlightStyle + * @type {module:zrender/shape/ShapeBundle~IShapeBundleStyle} + */ +}; + +ShapeBundle.prototype = { + + constructor: ShapeBundle, + + type: 'shape-bundle', + + brush: function (ctx, isHighlight) { + var style = this.beforeBrush(ctx, isHighlight); + + ctx.beginPath(); + for (var i = 0; i < style.shapeList.length; i++) { + var subShape = style.shapeList[i]; + var subShapeStyle = subShape.style; + if (isHighlight) { + subShapeStyle = subShape.getHighlightStyle( + subShapeStyle, subShape.highlightStyle || {}, subShape.brushTypeOnly); + } + subShape.buildPath(ctx, subShapeStyle); + } + switch (style.brushType) { /* jshint ignore:start */ + case 'both': + ctx.fill(); + case 'stroke': + style.lineWidth > 0 && ctx.stroke(); + break; /* jshint ignore:end */ + default: + ctx.fill(); + } + + this.drawText(ctx, style, this.style); + + this.afterBrush(ctx); + }, + + /** + * 计算返回多边形包围盒矩阵 + * @param {module:zrender/shape/Polygon~IShapeBundleStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} + */ + getRect: function (style) { + if (style.__rect) { + return style.__rect; + } + var minX = Number.MAX_VALUE; + var maxX = Number.MIN_VALUE; + var minY = Number.MAX_VALUE; + var maxY = Number.MIN_VALUE; + for (var i = 0; i < style.shapeList.length; i++) { + var subShape = style.shapeList[i]; + // TODO Highlight style ? + var subRect = subShape.getRect(subShape.style); + + var minX = Math.min(subRect.x, minX); + var minY = Math.min(subRect.y, minY); + var maxX = Math.max(subRect.x + subRect.width, maxX); + var maxY = Math.max(subRect.y + subRect.height, maxY); + } + + style.__rect = { + x: minX, + y: minY, + width: maxX - minX, + height: maxY - minY + }; + + return style.__rect; + }, + + isCover: function (x, y) { + var originPos = this.getTansform(x, y); + x = originPos[0]; + y = originPos[1]; + + var rect = this.style.__rect; + if (!rect) { + rect = this.getRect(this.style); + } + + if (x >= rect.x && x <= (rect.x + rect.width) && y >= rect.y && y <= (rect.y + rect.height)) { + for (var i = 0; i < this.style.shapeList.length; i++) { + var subShape = this.style.shapeList[i]; + if (subShape.isCover(x, y)) { + return true; + } + } + } + + return false; + } +}; + +require('../tool/util.js').inherits(ShapeBundle, Base); +module.exports = ShapeBundle; \ No newline at end of file diff --git a/src/zrender/shape/Star.js b/src/zrender/shape/Star.js index bf6f55b..26a08fd 100644 --- a/src/zrender/shape/Star.js +++ b/src/zrender/shape/Star.js @@ -1,81 +1,51 @@ /** - * zrender - * - * @author sushuang (宿爽, sushuang@baidu.com) - * - * shape类:n角星(n>3) - * 可配图形属性: - { - // 基础属性 - shape : 'star', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,n角星外接圆心横坐标 - y : {number}, // 必须,n角星外接圆心纵坐标 - r : {number}, // 必须,n角星外接圆半径 - r0 : {number}, // n角星内部顶点(凹点)的外接圆半径, - // 如果不指定此参数,则自动计算:取相隔外部顶点连线的交点作内部顶点 - n : {number}, // 必须,指明几角星 - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',描边颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度,描边下有效 - lineJoin : {string}, // 默认为miter,线段连接样式。miter | round | bevel - - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为outside,附加文本位置。 - // outside | inside - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#fff' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'star', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - r : 150, - n : 5, - color : '#eee' - }, - myName : 'kener', // 可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } + * n角星(n>3) + * @module zrender/shape/Star + * @author sushuang (宿爽, sushuang0322@gmail.com) + * @example + * var Star = require('zrender/shape/Star.js'); + * var shape = new Star({ + * style: { + * x: 200, + * y: 100, + * r: 150, + * n: 5, + * text: '五角星' + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} IStarStyle + * @property {number} x n角星外接圆心x坐标 + * @property {number} y n角星外接圆心y坐标 + * @property {number} r n角星外接圆半径 + * @property {number} [r0] n角星内部顶点(凹点)的外接圆半径。 + * 如果不指定此参数,则自动计算:取相隔外部顶点连线的交点作内部顶点。 + * @property {number} n 指明几角星 + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic */ + var math = require('../tool/math.js'); var sin = math.sin; var cos = math.cos; @@ -83,17 +53,33 @@ var PI = Math.PI; var Base = require('./Base.js'); -function Star(options) { +/** + * @alias module:zrender/shape/Star + * @param {Object} options + * @constructor + * @extends module:zrender/shape/Base + */ +var Star = function (options) { Base.call(this, options); -} + /** + * n角星绘制样式 + * @name module:zrender/shape/Star#style + * @type {module:zrender/shape/Star~IStarStyle} + */ + /** + * n角星高亮绘制样式 + * @name module:zrender/shape/Star#highlightStyle + * @type {module:zrender/shape/Star~IStarStyle} + */ +}; Star.prototype = { type: 'star', /** * 创建n角星(n>3)路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Star~IStarStyle} style */ buildPath: function (ctx, style) { var n = style.n; @@ -138,12 +124,15 @@ Star.prototype = { ctx.lineTo(pointList[i][0], pointList[i][1]); } + ctx.closePath(); + return; }, /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style + * 返回n角星包围盒矩形 + * @param {module:zrender/shape/Star~IStarStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} */ getRect: function (style) { if (style.__rect) { diff --git a/src/zrender/shape/Text.js b/src/zrender/shape/Text.js index d9e4400..802735d 100644 --- a/src/zrender/shape/Text.js +++ b/src/zrender/shape/Text.js @@ -1,87 +1,67 @@ /** - * zrender - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * shape类:文字 - * 可配图形属性: - { - // 基础属性 - shape : 'text', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 必须,横坐标 - y : {number}, // 必须,纵坐标 - brushType : {string}, // 默认为fill,绘画方式 - // fill(填充) | stroke(描边) | both(填充+描边) - color : {color}, // 默认为'#000',填充颜色,支持rgba - strokeColor : {color}, // 默认为'#000',线条颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度 - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 必须,文本内容 - textFont : {string}, // 默认为null,文本文字样式,eg:'bold 18px verdana' - textAlign : {string}, // 默认为start,文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认为middle,文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - maxWidth : {number} // 默认为null,最大宽度 - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'text', - id : '123456', - zlevel : 1, - style : { - x : 200, - y : 100, - color : 'red', - text : 'Baidu' - }, - myName : 'kener', //可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } + * @module zrender/shape/Text + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + * @example + * var Text = require('zrender/shape/Text.js'); + * var shape = new Text({ + * style: { + * text: 'Label', + * x: 100, + * y: 100, + * textFont: '14px Arial' + * } + * }); + * zr.addShape(shape); */ +/** + * @typedef {Object} ITextStyle + * @property {number} x 横坐标 + * @property {number} y 纵坐标 + * @property {string} text 文本内容 + * @property {number} [maxWidth=null] 最大宽度限制 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textAlign] 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic + * @property {string} [brushType='fill'] + * @property {string} [color='#000000'] 填充颜色 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + */ + + var area = require('../tool/area.js'); var Base = require('./Base.js'); -function Text(options) { +/** + * @alias module:zrender/shape/Text + * @constructor + * @extends module:zrender/shape/Base + * @param {Object} options + */ +var Text = function (options) { Base.call(this, options); -} + /** + * 文字绘制样式 + * @name module:zrender/shape/Text#style + * @type {module:zrender/shape/Text~ITextStyle} + */ + /** + * 文字高亮绘制样式 + * @name module:zrender/shape/Text#highlightStyle + * @type {module:zrender/shape/Text~ITextStyle} + */ +}; Text.prototype = { type: 'text', - /** - * 画刷,重载基类方法 - * @param {Context2D} ctx Canvas 2D上下文 - * @param isHighlight 是否为高亮状态 - */ brush: function (ctx, isHighlight) { var style = this.style; if (isHighlight) { @@ -95,6 +75,8 @@ Text.prototype = { } ctx.save(); + this.doClip(ctx); + this.setContext(ctx, style); // 设置transform @@ -167,8 +149,9 @@ Text.prototype = { }, /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style + * 返回文字包围盒矩形 + * @param {module:zrender/shape/Text~ITextStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} */ getRect: function (style) { if (style.__rect) { @@ -178,7 +161,7 @@ Text.prototype = { var width = area.getTextWidth(style.text, style.textFont); var height = area.getTextHeight(style.text, style.textFont); - var textX = style.x; //默认start == left + var textX = style.x; // 默认start == left if (style.textAlign == 'end' || style.textAlign == 'right') { textX -= width; } diff --git a/src/zrender/shape/Trochoid.js b/src/zrender/shape/Trochoid.js index 5580e5a..31e36c3 100644 --- a/src/zrender/shape/Trochoid.js +++ b/src/zrender/shape/Trochoid.js @@ -1,95 +1,79 @@ /** - * zrender - * - * @author Neil (杨骥, yangji01@baidu.com) - * - * shape类:内外旋轮曲线 - * 可配图形属性: - { - // 基础属性 - shape : 'trochoid', // 必须,shape类标识,需要显式指定 - id : {string}, // 必须,图形唯一标识,可通过'zrender/tool/guid'方法生成 - zlevel : {number}, // 默认为0,z层level,决定绘画在哪层canvas中 - invisible : {boolean}, // 默认为false,是否可见 - - // 样式属性,默认状态样式样式属性 - style : { - x : {number}, // 默认为0, 圆心的横坐标 - y : {number}, // 默认为0, 圆心的纵坐标 - r : {number}, // 必须,固定圆半径 内旋曲线时必须大于转动圆半径 - r0 : {number}, // 必须,转动圆半径 - d : {number}, // 必须,点到内部转动圆的距离,等于r时曲线为摆线 - location : {string}, // 默认为‘in’ 内旋 out 外旋 - strokeColor : {color}, // 默认为'#000',线条颜色(轮廓),支持rgba - lineWidth : {number}, // 默认为1,线条宽度 - lineCap : {string}, // 默认为butt,线帽样式。butt | round | square - - opacity : {number}, // 默认为1,透明度设置,如果color为rgba,则最终透明度效果叠加 - shadowBlur : {number}, // 默认为0,阴影模糊度,大于0有效 - shadowColor : {color}, // 默认为'#000',阴影色彩,支持rgba - shadowOffsetX : {number}, // 默认为0,阴影横向偏移,正值往右,负值往左 - shadowOffsetY : {number}, // 默认为0,阴影纵向偏移,正值往下,负值往上 - - text : {string}, // 默认为null,附加文本 - textFont : {string}, // 默认为null,附加文本样式,eg:'bold 18px verdana' - textPosition : {string}, // 默认为end,附加文本位置。 - // inside | start | end - textAlign : {string}, // 默认根据textPosition自动设置,附加文本水平对齐。 - // start | end | left | right | center - textBaseline : {string}, // 默认根据textPosition自动设置,附加文本垂直对齐。 - // top | bottom | middle | - // alphabetic | hanging | ideographic - textColor : {color}, // 默认根据textPosition自动设置,默认策略如下,附加文本颜色 - // 'inside' ? '#000' : color - }, - - // 样式属性,高亮样式属性,当不存在highlightStyle时使用基于默认样式扩展显示 - highlightStyle : { - // 同style - } - - // 交互属性,详见shape.Base - - // 事件属性,详见shape.Base - } - 例子: - { - shape : 'hypotrochoid', - id : '123456', - zlevel : 1, - style : { - x : 100, - y : 100, - r : 50, - r0 : 30, - d : 50, - strokeColor : '#eee', - lineWidth : 20, - text : 'Baidu' - }, - myName : 'kener', //可自带任何有效自定义属性 - - clickable : true, - onClick : function(eventPacket) { - alert(eventPacket.target.myName); - } - } + * 内外旋轮曲线 + * @module zrender/shape/Trochold + * @author Neil (杨骥, 511415343@qq.com) + * @example + * var Trochold = require('zrender/shape/Trochold.js'); + * var shape = new Trochold({ + * style: { + * x: 100, + * y: 100, + * r: 50, + * r0: 30, + * d: 50, + * strokeColor: '#eee', + * text: 'trochold' + * } + * }); + * zr.addShape(shape); + */ + +/** + * @typedef {Object} ITrocholdStyle + * @property {number} x 中心x坐标 + * @property {number} y 中心y坐标 + * @property {number} r 固定圆半径 内旋曲线时必须大于转动圆半径 + * @property {number} r0 转动圆半径 + * @property {number} d 点到内部转动圆的距离,等于r时曲线为摆线 + * @property {string} [location='in'] 内旋 out 外旋 + * @property {string} [strokeColor='#000000'] 描边颜色 + * @property {string} [lineCape='butt'] 线帽样式,可以是 butt, round, square + * @property {number} [lineWidth=1] 描边宽度 + * @property {number} [opacity=1] 绘制透明度 + * @property {number} [shadowBlur=0] 阴影模糊度,大于0有效 + * @property {string} [shadowColor='#000000'] 阴影颜色 + * @property {number} [shadowOffsetX=0] 阴影横向偏移 + * @property {number} [shadowOffsetY=0] 阴影纵向偏移 + * @property {string} [text] 图形中的附加文本 + * @property {string} [textColor='#000000'] 文本颜色 + * @property {string} [textFont] 附加文本样式,eg:'bold 18px verdana' + * @property {string} [textPosition='end'] 附加文本位置, 可以是 inside, left, right, top, bottom + * @property {string} [textAlign] 默认根据textPosition自动设置,附加文本水平对齐。 + * 可以是start, end, left, right, center + * @property {string} [textBaseline] 默认根据textPosition自动设置,附加文本垂直对齐。 + * 可以是top, bottom, middle, alphabetic, hanging, ideographic */ var Base = require('./Base.js'); -function Trochoid(options) { - this.brushTypeOnly = 'stroke'; //线条只能描边,填充后果自负 +/** + * @alias module:zrender/shape/Trochold + * @param {Object} options + * @constructor + * @extends zrender/shape/Base + */ +var Trochoid = function (options) { + this.brushTypeOnly = 'stroke'; // 线条只能描边,填充后果自负 Base.call(this, options); -} + /** + * 内外旋轮曲线绘制样式 + * @name module:zrender/shape/Trochold#style + * @type {module:zrender/shape/Trochold~ITrocholdStyle} + */ + /** + * 内外旋轮曲线高亮绘制样式 + * @name module:zrender/shape/Trochold#highlightStyle + * @type {module:zrender/shape/Trochold~ITrocholdStyle} + */ +}; Trochoid.prototype = { type: 'trochoid', /** - * 创建线条路径 - * @param {Context2D} ctx Canvas 2D上下文 - * @param {Object} style 样式 + * 创建内外旋轮曲线路径 + * @param {CanvasRenderingContext2D} ctx + * @param {module:zrender/shape/Trochold~ITrocholdStyle} style */ buildPath: function (ctx, style) { var _x1; @@ -119,7 +103,7 @@ Trochoid.prototype = { ctx.moveTo(_x1, _y1); - //计算结束时的i + // 计算结束时的i do { _num++; } @@ -138,8 +122,9 @@ Trochoid.prototype = { }, /** - * 返回矩形区域,用于局部刷新和文字定位 - * @param {Object} style + * 返回内外旋轮曲线包围盒矩形 + * @param {module:zrender/shape/Trochold~ITrocholdStyle} style + * @return {module:zrender/shape/Base~IBoundingRect} */ getRect: function (style) { if (style.__rect) { diff --git a/src/zrender/shape/mixin/Transformable.js b/src/zrender/shape/mixin/Transformable.js deleted file mode 100644 index 8f2cc62..0000000 --- a/src/zrender/shape/mixin/Transformable.js +++ /dev/null @@ -1,114 +0,0 @@ -var matrix = require('../../tool/matrix.js'); -var origin = [0, 0]; - -var Transformable = function () { - - if (!this.position) { - this.position = [0, 0]; - } - if (typeof(this.rotation) == 'undefined') { - this.rotation = [0, 0, 0]; - } - if (!this.scale) { - this.scale = [1, 1, 0, 0]; - } - - this.needLocalTransform = false; - this.needTransform = false; -}; - -Transformable.prototype = { - - constructor: Transformable, - - updateNeedTransform: function () { - this.needLocalTransform = Math.abs(this.rotation[0]) > 0.0001 || Math.abs(this.position[0]) > 0.0001 || Math.abs(this.position[1]) > 0.0001 || Math.abs(this.scale[0] - 1) > 0.0001 || Math.abs(this.scale[1] - 1) > 0.0001; - }, - - updateTransform: function () { - - this.updateNeedTransform(); - - if (this.parent) { - this.needTransform = this.needLocalTransform || this.parent.needTransform; - } else { - this.needTransform = this.needLocalTransform; - } - - if (!this.needTransform) { - return; - } - - var m = this.transform || matrix.create(); - matrix.identity(m); - - if (this.needLocalTransform) { - if (this.scale && (this.scale[0] !== 1 || this.scale[1] !== 1)) { - origin[0] = -this.scale[2] || 0; - origin[1] = -this.scale[3] || 0; - if (origin[0] || origin[1]) { - matrix.translate( - m, m, origin); - } - matrix.scale(m, m, this.scale); - if (origin[0] || origin[1]) { - origin[0] = -origin[0]; - origin[1] = -origin[1]; - matrix.translate( - m, m, origin); - } - } - - if (this.rotation) { - if (this.rotation instanceof Array) { - if (this.rotation[0] !== 0) { - origin[0] = -this.rotation[1] || 0; - origin[1] = -this.rotation[2] || 0; - if (origin[0] || origin[1]) { - matrix.translate( - m, m, origin); - } - matrix.rotate(m, m, this.rotation[0]); - if (origin[0] || origin[1]) { - origin[0] = -origin[0]; - origin[1] = -origin[1]; - matrix.translate( - m, m, origin); - } - } - } - else { - if (this.rotation !== 0) { - matrix.rotate(m, m, this.rotation); - } - } - } - - if (this.position && (this.position[0] !== 0 || this.position[1] !== 0)) { - matrix.translate(m, m, this.position); - } - } - - // 保存这个变换矩阵 - this.transform = m; - - // 应用父节点变换 - if (this.parent && this.parent.needTransform) { - if (this.needLocalTransform) { - matrix.mul(this.transform, this.parent.transform, this.transform); - } else { - matrix.copy(this.transform, this.parent.transform); - } - } - }, - - setTransform: function (ctx) { - if (this.needTransform) { - var m = this.transform; - ctx.transform( - m[0], m[1], m[2], m[3], m[4], m[5]); - } - } -}; - -module.exports = Transformable; \ No newline at end of file diff --git a/src/zrender/shape/util/PathProxy.js b/src/zrender/shape/util/PathProxy.js new file mode 100644 index 0000000..061b3a1 --- /dev/null +++ b/src/zrender/shape/util/PathProxy.js @@ -0,0 +1,249 @@ +/** + * Path 代理,可以在`buildPath`中用于替代`ctx`, 会保存每个path操作的命令到pathCommands属性中 + * 可以用于 isInsidePath 判断以及获取boundingRect + * + * @module zrender/shape/tool/PathProxy + * @author pissang (http://www.github.com/pissang) + * + * @example + * var SomeShape = function() { + * this._pathProxy = new PathProxy(); + * ... + * } + * SomeShape.prototype.buildPath = function(ctx, style) { + * this._pathProxy.begin(ctx); + * .moveTo(style.x, style.y); + * .lineTo(style.x1, style.y1); + * ... + * .closePath(); + * }, + * SomeShape.prototype.getRect = function(style) { + * if (!style._rect) { + * // 这里必须要在 buildPath 之后才能调用 + * style._rect = this._pathProxy.fastBoundingRect(); + * } + * return this.style._rect; + * }, + * SomeShape.prototype.isCover = function(x, y) { + * var rect = this.getRect(this.style); + * if (x >= rect.x + * && x <= (rect.x + rect.width) + * && y >= rect.y + * && y <= (rect.y + rect.height) + * ) { + * return area.isInsidePath( + * this._pathProxy.pathCommands, 0, 'fill', x, y + * ); + * } + * } + */ + + +var vector = require('../../tool/vector.js'); +// var computeBoundingBox = require('../../tool/computeBoundingBox.js'); +var PathSegment = function (command, points) { + this.command = command; + this.points = points || null; +}; + +/** + * @alias module:zrender/shape/tool/PathProxy + * @constructor + */ +var PathProxy = function () { + + /** + * Path描述的数组,用于`isInsidePath`的判断 + * @type {Array.} + */ + this.pathCommands = []; + + this._ctx = null; + + this._min = []; + this._max = []; +}; + +/** + * 快速计算Path包围盒(并不是最小包围盒) + * @return {Object} + */ +PathProxy.prototype.fastBoundingRect = function () { + var min = this._min; + var max = this._max; + min[0] = min[1] = Infinity; + max[0] = max[1] = -Infinity; + for (var i = 0; i < this.pathCommands.length; i++) { + var seg = this.pathCommands[i]; + var p = seg.points; + switch (seg.command) { + case 'M': + vector.min(min, min, p); + vector.max(max, max, p); + break; + case 'L': + vector.min(min, min, p); + vector.max(max, max, p); + break; + case 'C': + for (var j = 0; j < 6; j += 2) { + min[0] = Math.min(min[0], min[0], p[j]); + min[1] = Math.min(min[1], min[1], p[j + 1]); + max[0] = Math.max(max[0], max[0], p[j]); + max[1] = Math.max(max[1], max[1], p[j + 1]); + } + break; + case 'Q': + for (var j = 0; j < 4; j += 2) { + min[0] = Math.min(min[0], min[0], p[j]); + min[1] = Math.min(min[1], min[1], p[j + 1]); + max[0] = Math.max(max[0], max[0], p[j]); + max[1] = Math.max(max[1], max[1], p[j + 1]); + } + break; + case 'A': + var cx = p[0]; + var cy = p[1]; + var rx = p[2]; + var ry = p[3]; + min[0] = Math.min(min[0], min[0], cx - rx); + min[1] = Math.min(min[1], min[1], cy - ry); + max[0] = Math.max(max[0], max[0], cx + rx); + max[1] = Math.max(max[1], max[1], cy + ry); + break; + } + } + + return { + x: min[0], + y: min[1], + width: max[0] - min[0], + height: max[1] - min[1] + }; +}; + +/** + * @param {CanvasRenderingContext2D} ctx + * @return {module:zrender/shape/util/PathProxy} + */ +PathProxy.prototype.begin = function (ctx) { + this._ctx = ctx || null; + // 清空pathCommands + this.pathCommands.length = 0; + + return this; +}; + +/** + * @param {number} x + * @param {number} y + * @return {module:zrender/shape/util/PathProxy} + */ +PathProxy.prototype.moveTo = function (x, y) { + this.pathCommands.push(new PathSegment('M', [x, y])); + if (this._ctx) { + this._ctx.moveTo(x, y); + } + return this; +}; + +/** + * @param {number} x + * @param {number} y + * @return {module:zrender/shape/util/PathProxy} + */ +PathProxy.prototype.lineTo = function (x, y) { + this.pathCommands.push(new PathSegment('L', [x, y])); + if (this._ctx) { + this._ctx.lineTo(x, y); + } + return this; +}; + +/** + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @param {number} x3 + * @param {number} y3 + * @return {module:zrender/shape/util/PathProxy} + */ +PathProxy.prototype.bezierCurveTo = function (x1, y1, x2, y2, x3, y3) { + this.pathCommands.push(new PathSegment('C', [x1, y1, x2, y2, x3, y3])); + if (this._ctx) { + this._ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3); + } + return this; +}; + +/** + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @return {module:zrender/shape/util/PathProxy} + */ +PathProxy.prototype.quadraticCurveTo = function (x1, y1, x2, y2) { + this.pathCommands.push(new PathSegment('Q', [x1, y1, x2, y2])); + if (this._ctx) { + this._ctx.quadraticCurveTo(x1, y1, x2, y2); + } + return this; +}; + +/** + * @param {number} cx + * @param {number} cy + * @param {number} r + * @param {number} startAngle + * @param {number} endAngle + * @param {boolean} anticlockwise + * @return {module:zrender/shape/util/PathProxy} + */ +PathProxy.prototype.arc = function (cx, cy, r, startAngle, endAngle, anticlockwise) { + this.pathCommands.push(new PathSegment('A', [cx, cy, r, r, startAngle, endAngle - startAngle, 0, anticlockwise ? 0 : 1])); + if (this._ctx) { + this._ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise); + } + return this; +}; + +// TODO +PathProxy.prototype.arcTo = function (x1, y1, x2, y2, radius) { + if (this._ctx) { + this._ctx.arcTo(x1, y1, x2, y2, radius); + } + return this; +}; + +// TODO +PathProxy.prototype.rect = function (x, y, w, h) { + if (this._ctx) { + this._ctx.rect(x, y, w, h); + } + return this; +}; + +/** + * @return {module:zrender/shape/util/PathProxy} + */ +PathProxy.prototype.closePath = function () { + this.pathCommands.push(new PathSegment('z')); + if (this._ctx) { + this._ctx.closePath(); + } + return this; +}; + +/** + * 是否没有Path命令 + * @return {boolean} + */ +PathProxy.prototype.isEmpty = function () { + return this.pathCommands.length === 0; +}; + +PathProxy.PathSegment = PathSegment; + +module.exports = PathProxy; \ No newline at end of file diff --git a/src/zrender/shape/util/dashedLineTo.js b/src/zrender/shape/util/dashedLineTo.js index d0b287d..02d95a0 100644 --- a/src/zrender/shape/util/dashedLineTo.js +++ b/src/zrender/shape/util/dashedLineTo.js @@ -1,12 +1,11 @@ /** * 虚线lineTo * - * author: Kener (@Kener-林峰, linzhifeng@baidu.com) + * author: Kener (@Kener-林峰, kener.linfeng@gmail.com) * errorrik (errorrik@gmail.com) */ - var dashPattern = [5, 5]; /** * 虚线lineTo @@ -33,7 +32,8 @@ module.exports = function (ctx, x1, y1, x2, y2, dashLength) { for (var i = 0; i < numDashes; ++i) { if (flag) { ctx.moveTo(x1, y1); - } else { + } + else { ctx.lineTo(x1, y1); } flag = !flag; diff --git a/src/zrender/shape/util/smoothBezier.js b/src/zrender/shape/util/smoothBezier.js index 71ac2a7..f0176b3 100644 --- a/src/zrender/shape/util/smoothBezier.js +++ b/src/zrender/shape/util/smoothBezier.js @@ -1,17 +1,25 @@ /** * 贝塞尔平滑曲线 - * - * author: Kener (@Kener-林峰, linzhifeng@baidu.com) - * errorrik (errorrik@gmail.com) + * @module zrender/shape/util/smoothBezier + * @author pissang (https://www.github.com/pissang) + * Kener (@Kener-林峰, kener.linfeng@gmail.com) + * errorrik (errorrik@gmail.com) */ - var vector = require('../../tool/vector.js'); /** - * 贝塞尔平滑曲线 + * 贝塞尔平滑曲线 + * @alias module:zrender/shape/util/smoothBezier + * @param {Array} points 线段顶点数组 + * @param {number} smooth 平滑等级, 0-1 + * @param {boolean} isLoop + * @param {Array} constraint 将计算出来的控制点约束在一个包围盒内 + * 比如 [[0, 0], [100, 100]], 这个包围盒会与 + * 整个折线的包围盒做一个并集用来约束控制点。 + * @param {Array} 计算出来的控制点数组 */ -module.exports = function (points, smooth, isLoop) { +module.exports = function (points, smooth, isLoop, constraint) { var cps = []; var v = []; @@ -20,6 +28,20 @@ module.exports = function (points, smooth, isLoop) { var prevPoint; var nextPoint; + var hasConstraint = !! constraint; + var min, max; + if (hasConstraint) { + min = [Infinity, Infinity]; + max = [-Infinity, -Infinity]; + for (var i = 0, len = points.length; i < len; i++) { + vector.min(min, min, points[i]); + vector.max(max, max, points[i]); + } + // 与指定的包围盒做并集 + vector.min(min, min, constraint[0]); + vector.max(max, max, constraint[1]); + } + for (var i = 0, len = points.length; i < len; i++) { var point = points[i]; var prevPoint; @@ -42,20 +64,29 @@ module.exports = function (points, smooth, isLoop) { vector.sub(v, nextPoint, prevPoint); - //use degree to scale the handle length + // use degree to scale the handle length vector.scale(v, v, smooth); var d0 = vector.distance(point, prevPoint); var d1 = vector.distance(point, nextPoint); var sum = d0 + d1; - d0 /= sum; - d1 /= sum; + if (sum !== 0) { + d0 /= sum; + d1 /= sum; + } vector.scale(v1, v, -d0); vector.scale(v2, v, d1); - - cps.push(vector.add([], point, v1)); - cps.push(vector.add([], point, v2)); + var cp0 = vector.add([], point, v1); + var cp1 = vector.add([], point, v2); + if (hasConstraint) { + vector.max(cp0, cp0, min); + vector.min(cp0, cp0, max); + vector.max(cp1, cp1, min); + vector.min(cp1, cp1, max); + } + cps.push(cp0); + cps.push(cp1); } if (isLoop) { diff --git a/src/zrender/shape/util/smoothSpline.js b/src/zrender/shape/util/smoothSpline.js index b56a53b..9284a55 100644 --- a/src/zrender/shape/util/smoothSpline.js +++ b/src/zrender/shape/util/smoothSpline.js @@ -1,12 +1,11 @@ /** - * 多线段平滑曲线 Catmull-Rom spline - * - * author: Kener (@Kener-林峰, linzhifeng@baidu.com) - * errorrik (errorrik@gmail.com) + * Catmull-Rom spline 插值折线 + * @module zrender/shape/util/smoothSpline + * @author pissang (https://www.github.com/pissang) + * Kener (@Kener-林峰, kener.linfeng@gmail.com) + * errorrik (errorrik@gmail.com) */ - - var vector = require('../../tool/vector.js'); /** @@ -20,9 +19,13 @@ function interpolate(p0, p1, p2, p3, t, t2, t3) { } /** - * 多线段平滑曲线 Catmull-Rom spline + * @alias module:zrender/shape/util/smoothSpline + * @param {Array} points 线段顶点数组 + * @param {boolean} isLoop + * @param {Array} constraint + * @return {Array} */ -module.exports = function (points, isLoop) { +module.exports = function (points, isLoop, constraint) { var len = points.length; var ret = []; @@ -47,7 +50,8 @@ module.exports = function (points, isLoop) { p0 = points[idx === 0 ? idx : idx - 1]; p2 = points[idx > len - 2 ? len - 1 : idx + 1]; p3 = points[idx > len - 3 ? len - 1 : idx + 2]; - } else { + } + else { p0 = points[(idx - 1 + len) % len]; p2 = points[(idx + 1) % len]; p3 = points[(idx + 2) % len]; diff --git a/src/zrender/tool/area.js b/src/zrender/tool/area.js index 8c1f332..99bd475 100644 --- a/src/zrender/tool/area.js +++ b/src/zrender/tool/area.js @@ -1,14 +1,18 @@ +'use strict'; /** * zrender: 图形空间辅助类 * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + * pissang (https://www.github.com/pissang) * * isInside:是否在区域内部 * isOutside:是否在区域外部 * getTextWidth:测算单行文本宽度 */ -var util = require('../tool/util.js'); + +var util = require('./util.js'); +var curve = require('./curve.js'); var _ctx; @@ -16,8 +20,17 @@ var _textWidthCache = {}; var _textHeightCache = {}; var _textWidthCacheCounter = 0; var _textHeightCacheCounter = 0; -var TEXT_CACHE_MAX = 20000; +var TEXT_CACHE_MAX = 5000; + +var PI2 = Math.PI * 2; +function normalizeRadian(angle) { + angle %= PI2; + if (angle < 0) { + angle += PI2; + } + return angle; +} /** * 包含判断 * @@ -36,41 +49,29 @@ function isInside(shape, area, x, y) { _ctx = _ctx || util.getContext(); - if (!_isInsideRectangle(area.__rect || shape.getRect(area), x, y)) { - // 不在矩形区域内直接返回false - return false; - } - - // 未实现或不可用时(excanvas不支持)则数学运算,主要是line,brokenLine,ring - var _mathReturn = _mathMethod(zoneType, area, x, y); + // 未实现或不可用时(excanvas不支持)则数学运算,主要是line,polyline,ring + var _mathReturn = _mathMethod(shape, area, x, y); if (typeof _mathReturn != 'undefined') { return _mathReturn; } - if (zoneType != 'bezier-curve' && shape.buildPath && _ctx.isPointInPath) { + if (shape.buildPath && _ctx.isPointInPath) { return _buildPathMethod(shape, _ctx, area, x, y); } - else if (_ctx.getImageData) { - return _pixelMethod(shape, area, x, y); - } // 上面的方法都行不通时 switch (zoneType) { - case 'heart': - //心形---------10 // Todo,不精确 - case 'droplet': - // 水滴----------11 // Todo,不精确 case 'ellipse': // Todo,不精确 return true; // 旋轮曲线 不准确 case 'trochoid': var _r = area.location == 'out' ? area.r1 + area.r2 + area.d : area.r1 - area.r2 + area.d; - return _isInsideCircle(area, x, y, _r); + return isInsideCircle(area, x, y, _r); // 玫瑰线 不准确 case 'rose': - return _isInsideCircle(area, x, y, area.maxr); - //路径,椭圆,曲线等-----------------13 + return isInsideCircle(area, x, y, area.maxr); + // 路径,椭圆,曲线等-----------------13 default: return false; // Todo,暂不支持 } @@ -79,47 +80,70 @@ function isInside(shape, area, x, y) { /** * 用数学方法判断,三个方法中最快,但是支持的shape少 * - * @param {string} zoneType : 图形类型 + * @param {Object} shape : 图形 * @param {Object} area :目标区域 * @param {number} x : 横坐标 * @param {number} y : 纵坐标 * @return {boolean=} true表示坐标处在图形中 */ -function _mathMethod(zoneType, area, x, y) { +function _mathMethod(shape, area, x, y) { + var zoneType = shape.type; // 在矩形内则部分图形需要进一步判断 switch (zoneType) { - //线-----------------------1 + // 贝塞尔曲线 + case 'bezier-curve': + if (typeof(area.cpX2) === 'undefined') { + return isInsideQuadraticStroke( + area.xStart, area.yStart, area.cpX1, area.cpY1, area.xEnd, area.yEnd, area.lineWidth, x, y); + } + return isInsideCubicStroke( + area.xStart, area.yStart, area.cpX1, area.cpY1, area.cpX2, area.cpY2, area.xEnd, area.yEnd, area.lineWidth, x, y); + // 线 case 'line': - return _isInsideLine(area, x, y); - //折线----------------------2 - case 'broken-line': - return _isInsideBrokenLine(area, x, y); - //文本----------------------3 - case 'text': - return true; - //圆环----------------------4 + return isInsideLine( + area.xStart, area.yStart, area.xEnd, area.yEnd, area.lineWidth, x, y); + // 折线 + case 'polyline': + return isInsidePolyline( + area.pointList, area.lineWidth, x, y); + // 圆环 case 'ring': - return _isInsideRing(area, x, y); - //矩形----------------------5 - case 'rectangle': - return true; - //圆形----------------------6 + return isInsideRing( + area.x, area.y, area.r0, area.r, x, y); + // 圆形 case 'circle': - return _isInsideCircle(area, x, y, area.r); - //扇形----------------------7 + return isInsideCircle( + area.x, area.y, area.r, x, y); + // 扇形 case 'sector': - return _isInsideSector(area, x, y); - //多边形---------------------8 + var startAngle = area.startAngle * Math.PI / 180; + var endAngle = area.endAngle * Math.PI / 180; + if (!area.clockWise) { + startAngle = -startAngle; + endAngle = -endAngle; + } + return isInsideSector( + area.x, area.y, area.r0, area.r, startAngle, endAngle, !area.clockWise, x, y); + // 多边形 case 'path': - return _isInsidePath(area, x, y); + return area.pathArray && isInsidePath( + area.pathArray, Math.max(area.lineWidth, 5), area.brushType, x, y); case 'polygon': case 'star': case 'isogon': - return _isInsidePolygon(area, x, y); - //图片----------------------9 + return isInsidePolygon(area.pointList, x, y); + // 文本 + case 'text': + var rect = area.__rect || shape.getRect(area); + return isInsideRect( + rect.x, rect.y, rect.width, rect.height, x, y); + // 矩形 + case 'rectangle': + // 图片 case 'image': - return true; + return isInsideRect( + area.x, area.y, area.width, area.height, x, y); } } @@ -144,135 +168,168 @@ function _buildPathMethod(shape, context, area, x, y) { } /** - * 通过像素值来判断,三个方法中最慢,但是支持广,不足之处是excanvas不支持像素处理 - * - * @param {Object} shape shape类 - * @param {Object} area 目标区域 - * @param {number} x 横坐标 - * @param {number} y 纵坐标 - * @return {boolean} true表示坐标处在图形中 + * !isInside */ -function _pixelMethod(shape, area, x, y) { - var _rect = area.__rect || shape.getRect(area); - var _context = util.getPixelContext(); - var _offset = util.getPixelOffset(); - - util.adjustCanvasSize(x, y); - _context.clearRect(_rect.x, _rect.y, _rect.width, _rect.height); - _context.beginPath(); - shape.brush(_context, { - style: area - }); - _context.closePath(); - - return _isPainted(_context, x + _offset.x, y + _offset.y); +function isOutside(shape, area, x, y) { + return !isInside(shape, area, x, y); } /** - * 坐标像素值,判断坐标是否被作色 - * - * @param {Object} context : 上下文 - * @param {number} x : 横坐标 - * @param {number} y : 纵坐标 - * @param {number=} unit : 触发的精度,越大越容易触发,可选,缺省是为1 - * @return {boolean} 已经被画过返回true + * 线段包含判断 + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @param {number} lineWidth + * @param {number} x + * @param {number} y + * @return {boolean} */ -function _isPainted(context, x, y, unit) { - var pixelsData; - - if (typeof unit != 'undefined') { - unit = (unit || 1) >> 1; - pixelsData = context.getImageData( - x - unit, y - unit, unit + unit, unit + unit).data; +function isInsideLine(x0, y0, x1, y1, lineWidth, x, y) { + if (lineWidth === 0) { + return false; } - else { - pixelsData = context.getImageData(x, y, 1, 1).data; + var _l = Math.max(lineWidth, 5); + var _a = 0; + var _b = x0; + // Quick reject + if ((y > y0 + _l && y > y1 + _l) || (y < y0 - _l && y < y1 - _l) || (x > x0 + _l && x > x1 + _l) || (x < x0 - _l && x < x1 - _l)) { + return false; } - var len = pixelsData.length; - while (len--) { - if (pixelsData[len] !== 0) { - return true; - } + if (x0 !== x1) { + _a = (y0 - y1) / (x0 - x1); + _b = (x0 * y1 - x1 * y0) / (x0 - x1); } - - return false; + else { + return Math.abs(x - x0) <= _l / 2; + } + var tmp = _a * x - y + _b; + var _s = tmp * tmp / (_a * _a + 1); + return _s <= _l / 2 * _l / 2; } /** - * !isInside + * 三次贝塞尔曲线描边包含判断 + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @param {number} x3 + * @param {number} y3 + * @param {number} lineWidth + * @param {number} x + * @param {number} y + * @return {boolean} */ -function isOutside(shape, area, x, y) { - return !isInside(shape, area, x, y); +function isInsideCubicStroke( +x0, y0, x1, y1, x2, y2, x3, y3, lineWidth, x, y) { + if (lineWidth === 0) { + return false; + } + var _l = Math.max(lineWidth, 5); + // Quick reject + if ((y > y0 + _l && y > y1 + _l && y > y2 + _l && y > y3 + _l) || (y < y0 - _l && y < y1 - _l && y < y2 - _l && y < y3 - _l) || (x > x0 + _l && x > x1 + _l && x > x2 + _l && x > x3 + _l) || (x < x0 - _l && x < x1 - _l && x < x2 - _l && x < x3 - _l)) { + return false; + } + var d = curve.cubicProjectPoint( + x0, y0, x1, y1, x2, y2, x3, y3, x, y, null); + return d <= _l / 2; } /** - * 线段包含判断 + * 二次贝塞尔曲线描边包含判断 + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @param {number} lineWidth + * @param {number} x + * @param {number} y + * @return {boolean} */ -function _isInsideLine(area, x, y) { - var _x1 = area.xStart; - var _y1 = area.yStart; - var _x2 = area.xEnd; - var _y2 = area.yEnd; - var _l = Math.max(area.lineWidth, 5); - var _a = 0; - var _b = _x1; - - var minX, maxX; - if (_x1 < _x2) { - minX = _x1 - _l; - maxX = _x2 + _l; - } else { - minX = _x2 - _l; - maxX = _x1 + _l; +function isInsideQuadraticStroke( +x0, y0, x1, y1, x2, y2, lineWidth, x, y) { + if (lineWidth === 0) { + return false; } - - var minY, maxY; - if (_y1 < _y2) { - minY = _y1 - _l; - maxY = _y2 + _l; - } else { - minY = _y2 - _l; - maxY = _y1 + _l; + var _l = Math.max(lineWidth, 5); + // Quick reject + if ((y > y0 + _l && y > y1 + _l && y > y2 + _l) || (y < y0 - _l && y < y1 - _l && y < y2 - _l) || (x > x0 + _l && x > x1 + _l && x > x2 + _l) || (x < x0 - _l && x < x1 - _l && x < x2 - _l)) { + return false; } + var d = curve.quadraticProjectPoint( + x0, y0, x1, y1, x2, y2, x, y, null); + return d <= _l / 2; +} - if (x < minX || x > maxX || y < minY || y > maxY) { +/** + * 圆弧描边包含判断 + * @param {number} cx + * @param {number} cy + * @param {number} r + * @param {number} startAngle + * @param {number} endAngle + * @param {boolean} anticlockwise + * @param {number} lineWidth + * @param {number} x + * @param {number} y + * @return {Boolean} + */ + +function isInsideArcStroke( +cx, cy, r, startAngle, endAngle, anticlockwise, lineWidth, x, y) { + if (lineWidth === 0) { return false; } + var _l = Math.max(lineWidth, 5); - if (_x1 !== _x2) { - _a = (_y1 - _y2) / (_x1 - _x2); - _b = (_x1 * _y2 - _x2 * _y1) / (_x1 - _x2); + x -= cx; + y -= cy; + var d = Math.sqrt(x * x + y * y); + if ((d - _l > r) || (d + _l < r)) { + return false; } - else { - return Math.abs(x - _x1) <= _l / 2; + if (Math.abs(startAngle - endAngle) >= PI2) { + // Is a circle + return true; + } + if (anticlockwise) { + var tmp = startAngle; + startAngle = normalizeRadian(endAngle); + endAngle = normalizeRadian(tmp); + } else { + startAngle = normalizeRadian(startAngle); + endAngle = normalizeRadian(endAngle); + } + if (startAngle > endAngle) { + endAngle += PI2; } - var _s = (_a * x - y + _b) * (_a * x - y + _b) / (_a * _a + 1); - return _s <= _l / 2 * _l / 2; + var angle = Math.atan2(y, x); + if (angle < 0) { + angle += PI2; + } + return (angle >= startAngle && angle <= endAngle) || (angle + PI2 >= startAngle && angle + PI2 <= endAngle); } -function _isInsideBrokenLine(area, x, y) { - var pointList = area.pointList; - var lineArea = { - xStart: 0, - yStart: 0, - xEnd: 0, - yEnd: 0, - lineWidth: 0 - }; - for (var i = 0, l = pointList.length - 1; i < l; i++) { - lineArea.xStart = pointList[i][0]; - lineArea.yStart = pointList[i][1]; - lineArea.xEnd = pointList[i + 1][0]; - lineArea.yEnd = pointList[i + 1][1]; - lineArea.lineWidth = Math.max(area.lineWidth, 10); - - if (_isInsideLine(lineArea, x, y)) { +function isInsidePolyline(points, lineWidth, x, y) { + var lineWidth = Math.max(lineWidth, 10); + for (var i = 0, l = points.length - 1; i < l; i++) { + var x0 = points[i][0]; + var y0 = points[i][1]; + var x1 = points[i + 1][0]; + var y1 = points[i + 1][1]; + + if (isInsideLine(x0, y0, x1, y1, lineWidth, x, y)) { return true; } } @@ -280,141 +337,374 @@ function _isInsideBrokenLine(area, x, y) { return false; } -function _isInsideRing(area, x, y) { - return _isInsideCircle(area, x, y, area.r) && !_isInsideCircle({ - x: area.x, - y: area.y - }, x, y, area.r0 || 0); +function isInsideRing(cx, cy, r0, r, x, y) { + var d = (x - cx) * (x - cx) + (y - cy) * (y - cy); + return (d < r * r) && (d > r0 * r0); } /** * 矩形包含判断 */ -function _isInsideRectangle(area, x, y) { - return x >= area.x && x <= (area.x + area.width) && y >= area.y && y <= (area.y + area.height); +function isInsideRect(x0, y0, width, height, x, y) { + return x >= x0 && x <= (x0 + width) && y >= y0 && y <= (y0 + height); } /** * 圆形包含判断 */ -function _isInsideCircle(area, x, y, r) { - return (x - area.x) * (x - area.x) + (y - area.y) * (y - area.y) < r * r; +function isInsideCircle(x0, y0, r, x, y) { + return (x - x0) * (x - x0) + (y - y0) * (y - y0) < r * r; } /** * 扇形包含判断 */ -function _isInsideSector(area, x, y) { - if (!_isInsideCircle(area, x, y, area.r) || (area.r0 > 0 && _isInsideCircle({ - x: area.x, - y: area.y - }, x, y, area.r0))) { - // 大圆外或者小圆内直接false - return false; - } +function isInsideSector( +cx, cy, r0, r, startAngle, endAngle, anticlockwise, x, y) { + return isInsideArcStroke( + cx, cy, (r0 + r) / 2, startAngle, endAngle, anticlockwise, r - r0, x, y); +} - // 判断夹角 - if (Math.abs(area.endAngle - area.startAngle) >= 360) { - // 大于360度的扇形,在环内就为true - return true; +/** + * 多边形包含判断 + * 与 canvas 一样采用 non-zero winding rule + */ + +function isInsidePolygon(points, x, y) { + var N = points.length; + var w = 0; + + for (var i = 0, j = N - 1; i < N; i++) { + var x0 = points[j][0]; + var y0 = points[j][1]; + var x1 = points[i][0]; + var y1 = points[i][1]; + w += windingLine(x0, y0, x1, y1, x, y); + j = i; } + return w !== 0; +} - var angle = (360 - Math.atan2(y - area.y, x - area.x) / Math.PI * 180) % 360; - var endA = (360 + area.endAngle) % 360; - var startA = (360 + area.startAngle) % 360; - if (endA > startA) { - return (angle >= startA && angle <= endA); +function windingLine(x0, y0, x1, y1, x, y) { + if ((y > y0 && y > y1) || (y < y0 && y < y1)) { + return 0; + } + if (y1 == y0) { + return 0; } + var dir = y1 < y0 ? 1 : -1; + var t = (y - y0) / (y1 - y0); + var x_ = t * (x1 - x0) + x0; - return !(angle >= endA && angle <= startA); + return x_ > x ? dir : 0; } -/** - * 多边形包含判断 - * 警告:下面这段代码会很难看,建议跳过~ - */ +// 临时数组 +var roots = [-1, -1, -1]; +var extrema = [-1, -1]; -function _isInsidePolygon(area, x, y) { - /** - * 射线判别法 - * 如果一个点在多边形内部,任意角度做射线肯定会与多边形要么有一个交点,要么有与多边形边界线重叠 - * 如果一个点在多边形外部,任意角度做射线要么与多边形有一个交点, - * 要么有两个交点,要么没有交点,要么有与多边形边界线重叠。 - */ - var i; - var j; - var polygon = area.pointList; - var N = polygon.length; - var inside = false; - var redo = true; - var v; - - for (i = 0; i < N; ++i) { - // 是否在顶点上 - if (polygon[i][0] == x && polygon[i][1] == y) { - redo = false; - inside = true; - break; +function swapExtrema() { + var tmp = extrema[0]; + extrema[0] = extrema[1]; + extrema[1] = tmp; +} + +function windingCubic(x0, y0, x1, y1, x2, y2, x3, y3, x, y) { + // Quick reject + if ((y > y0 && y > y1 && y > y2 && y > y3) || (y < y0 && y < y1 && y < y2 && y < y3)) { + return 0; + } + var nRoots = curve.cubicRootAt(y0, y1, y2, y3, y, roots); + if (nRoots === 0) { + return 0; + } + else { + var w = 0; + var nExtrema = -1; + var y0_, y1_; + for (var i = 0; i < nRoots; i++) { + var t = roots[i]; + var x_ = curve.cubicAt(x0, x1, x2, x3, t); + if (x_ < x) { // Quick reject + continue; + } + if (nExtrema < 0) { + nExtrema = curve.cubicExtrema(y0, y1, y2, y3, extrema); + if (extrema[1] < extrema[0] && nExtrema > 1) { + swapExtrema(); + } + y0_ = curve.cubicAt(y0, y1, y2, y3, extrema[0]); + if (nExtrema > 1) { + y1_ = curve.cubicAt(y0, y1, y2, y3, extrema[1]); + } + } + if (nExtrema == 2) { + // 分成三段单调函数 + if (t < extrema[0]) { + w += y0_ < y0 ? 1 : -1; + } + else if (t < extrema[1]) { + w += y1_ < y0_ ? 1 : -1; + } + else { + w += y3 < y1_ ? 1 : -1; + } + } + else { + // 分成两段单调函数 + if (t < extrema[0]) { + w += y0_ < y0 ? 1 : -1; + } + else { + w += y3 < y0_ ? 1 : -1; + } + } } + return w; } +} - if (redo) { - redo = false; - inside = false; - for (i = 0, j = N - 1; i < N; j = i++) { - if ((polygon[i][1] < y && y < polygon[j][1]) || (polygon[j][1] < y && y < polygon[i][1])) { - if (x <= polygon[i][0] || x <= polygon[j][0]) { - v = (y - polygon[i][1]) * (polygon[j][0] - polygon[i][0]) / (polygon[j][1] - polygon[i][1]) + polygon[i][0]; - if (x < v) { // 在线的左侧 - inside = !inside; - } - else if (x == v) { // 在线上 - inside = true; - break; - } +function windingQuadratic(x0, y0, x1, y1, x2, y2, x, y) { + // Quick reject + if ((y > y0 && y > y1 && y > y2) || (y < y0 && y < y1 && y < y2)) { + return 0; + } + var nRoots = curve.quadraticRootAt(y0, y1, y2, y, roots); + if (nRoots === 0) { + return 0; + } + else { + var t = curve.quadraticExtremum(y0, y1, y2); + if (t >= 0 && t <= 1) { + var w = 0; + var y_ = curve.quadraticAt(y0, y1, y2, t); + for (var i = 0; i < nRoots; i++) { + var x_ = curve.quadraticAt(x0, x1, x2, roots[i]); + if (x_ > x) { + continue; } - } - else if (y == polygon[i][1]) { - if (x < polygon[i][0]) { // 交点在顶点上 - polygon[i][1] > polygon[j][1] ? --y : ++y; - //redo = true; - break; + if (roots[i] < t) { + w += y_ < y0 ? 1 : -1; + } + else { + w += y2 < y_ ? 1 : -1; } } - else if (polygon[i][1] == polygon[j][1] // 在水平的边界线上 - && y == polygon[i][1] && ((polygon[i][0] < x && x < polygon[j][0]) || (polygon[j][0] < x && x < polygon[i][0]))) { - inside = true; - break; + return w; + } + else { + var x_ = curve.quadraticAt(x0, x1, x2, roots[0]); + if (x_ > x) { + return 0; } + return y2 < y0 ? 1 : -1; } } - return inside; } -/** - * 路径包含判断,依赖多边形判断 - */ +// TODO +// Arc 旋转 -function _isInsidePath(area, x, y) { - if (!area.pointList) { - require('../shape/Path.js').prototype.buildPath(_ctx, area); + +function windingArc( +cx, cy, r, startAngle, endAngle, anticlockwise, x, y) { + y -= cy; + if (y > r || y < -r) { + return 0; + } + var tmp = Math.sqrt(r * r - y * y); + roots[0] = -tmp; + roots[1] = tmp; + + if (Math.abs(startAngle - endAngle) >= PI2) { + // Is a circle + startAngle = 0; + endAngle = PI2; + var dir = anticlockwise ? 1 : -1; + if (x >= roots[0] + cx && x <= roots[1] + cx) { + return dir; + } else { + return 0; + } } - var pointList = area.pointList; - var insideCatch = false; - for (var i = 0, l = pointList.length; i < l; i++) { - insideCatch = _isInsidePolygon({ - pointList: pointList[i] - }, x, y); - if (insideCatch) { - break; + if (anticlockwise) { + var tmp = startAngle; + startAngle = normalizeRadian(endAngle); + endAngle = normalizeRadian(tmp); + } else { + startAngle = normalizeRadian(startAngle); + endAngle = normalizeRadian(endAngle); + } + if (startAngle > endAngle) { + endAngle += PI2; + } + + var w = 0; + for (var i = 0; i < 2; i++) { + var x_ = roots[i]; + if (x_ + cx > x) { + var angle = Math.atan2(y, x_); + var dir = anticlockwise ? 1 : -1; + if (angle < 0) { + angle = PI2 + angle; + } + if ((angle >= startAngle && angle <= endAngle) || (angle + PI2 >= startAngle && angle + PI2 <= endAngle)) { + if (angle > Math.PI / 2 && angle < Math.PI * 1.5) { + dir = -dir; + } + w += dir; + } } } + return w; +} - return insideCatch; +/** + * 路径包含判断 + * 与 canvas 一样采用 non-zero winding rule + */ + +function isInsidePath(pathArray, lineWidth, brushType, x, y) { + var w = 0; + var xi = 0; + var yi = 0; + var x0 = 0; + var y0 = 0; + var beginSubpath = true; + var firstCmd = true; + + brushType = brushType || 'fill'; + + var hasStroke = brushType === 'stroke' || brushType === 'both'; + var hasFill = brushType === 'fill' || brushType === 'both'; + + // var roots = [-1, -1, -1]; + for (var i = 0; i < pathArray.length; i++) { + var seg = pathArray[i]; + var p = seg.points; + // Begin a new subpath + if (beginSubpath || seg.command === 'M') { + if (i > 0) { + // Close previous subpath + if (hasFill) { + w += windingLine(xi, yi, x0, y0, x, y); + } + if (w !== 0) { + return true; + } + } + x0 = p[p.length - 2]; + y0 = p[p.length - 1]; + beginSubpath = false; + if (firstCmd && seg.command !== 'A') { + // 如果第一个命令不是M, 是lineTo, bezierCurveTo + // 等绘制命令的话,是会从该绘制的起点开始算的 + // Arc 会在之后做单独处理所以这里忽略 + firstCmd = false; + xi = x0; + yi = y0; + } + } + switch (seg.command) { + case 'M': + xi = p[0]; + yi = p[1]; + break; + case 'L': + if (hasStroke) { + if (isInsideLine( + xi, yi, p[0], p[1], lineWidth, x, y)) { + return true; + } + } + if (hasFill) { + w += windingLine(xi, yi, p[0], p[1], x, y); + } + xi = p[0]; + yi = p[1]; + break; + case 'C': + if (hasStroke) { + if (isInsideCubicStroke( + xi, yi, p[0], p[1], p[2], p[3], p[4], p[5], lineWidth, x, y)) { + return true; + } + } + if (hasFill) { + w += windingCubic( + xi, yi, p[0], p[1], p[2], p[3], p[4], p[5], x, y); + } + xi = p[4]; + yi = p[5]; + break; + case 'Q': + if (hasStroke) { + if (isInsideQuadraticStroke( + xi, yi, p[0], p[1], p[2], p[3], lineWidth, x, y)) { + return true; + } + } + if (hasFill) { + w += windingQuadratic( + xi, yi, p[0], p[1], p[2], p[3], x, y); + } + xi = p[2]; + yi = p[3]; + break; + case 'A': + // TODO Arc 旋转 + // TODO Arc 判断的开销比较大 + var cx = p[0]; + var cy = p[1]; + var rx = p[2]; + var ry = p[3]; + var theta = p[4]; + var dTheta = p[5]; + var x1 = Math.cos(theta) * rx + cx; + var y1 = Math.sin(theta) * ry + cy; + // 不是直接使用 arc 命令 + if (!firstCmd) { + w += windingLine(xi, yi, x1, y1); + } else { + firstCmd = false; + // 第一个命令起点还未定义 + x0 = x1; + y0 = y1; + } + // zr 使用scale来模拟椭圆, 这里也对x做一定的缩放 + var _x = (x - cx) * ry / rx + cx; + if (hasStroke) { + if (isInsideArcStroke( + cx, cy, ry, theta, theta + dTheta, 1 - p[7], lineWidth, _x, y)) { + return true; + } + } + if (hasFill) { + w += windingArc( + cx, cy, ry, theta, theta + dTheta, 1 - p[7], _x, y); + } + xi = Math.cos(theta + dTheta) * rx + cx; + yi = Math.sin(theta + dTheta) * ry + cy; + break; + case 'z': + if (hasStroke) { + if (isInsideLine( + xi, yi, x0, y0, lineWidth, x, y)) { + return true; + } + } + beginSubpath = true; + break; + } + } + if (hasFill) { + w += windingLine(xi, yi, x0, y0, x, y); + } + return w !== 0; } /** @@ -473,7 +763,7 @@ function getTextHeight(text, textFont) { } text = (text + '').split('\n'); - //比较粗暴 + // 比较粗暴 var height = (_ctx.measureText('国').width + 2) * text.length; _ctx.restore(); @@ -491,5 +781,16 @@ module.exports = { isInside: isInside, isOutside: isOutside, getTextWidth: getTextWidth, - getTextHeight: getTextHeight + getTextHeight: getTextHeight, + + isInsidePath: isInsidePath, + isInsidePolygon: isInsidePolygon, + isInsideSector: isInsideSector, + isInsideCircle: isInsideCircle, + isInsideLine: isInsideLine, + isInsideRect: isInsideRect, + isInsidePolyline: isInsidePolyline, + + isInsideCubicStroke: isInsideCubicStroke, + isInsideQuadraticStroke: isInsideQuadraticStroke }; \ No newline at end of file diff --git a/src/zrender/tool/color.js b/src/zrender/tool/color.js index e9fb9e4..93712e9 100644 --- a/src/zrender/tool/color.js +++ b/src/zrender/tool/color.js @@ -1,39 +1,7 @@ /** - * zrender : 颜色辅助类 - * - * author: CrossDo (chenhuaimu@baidu.com) - * - * getColor:获取色板颜色 - * customPalette : 自定义调色板 - * resetPalette : 重置调色板 - * - * getHighlightColor : 获取默认高亮颜色 - * customHighlight : 自定义默认高亮颜色 - * resetHighlight : 重置默认高亮颜色 - * - * getRadialGradient : 径向渐变 - * getLinearGradient : 线性渐变 - * getGradientColors : 获取颜色之间渐变颜色数组 - * getStepColors : 获取两种颜色之间渐变颜色数组 - * reverse : 颜色翻转 - * mix : 颜色混合 - * lift : 颜色升降 - * trim : 清除空格 - * random : 随机颜色 - * toRGB : 转为RGB格式 - * toRGBA : 转为RGBA格式 - * toHex : 转为#RRGGBB格式 - * toHSL : 转为HSL格式 - * toHSLA : 转为HSLA格式 - * toHSB : 转为HSB格式 - * toHSBA : 转为HSBA格式 - * toHSV : 转为HSV格式 - * toHSVA : 转为HSVA格式 - * toName : 转为颜色名字 - * toColor: 颜色值数组转为指定格式颜色 - * toArray: 返回颜色值数组 - * alpha : 设置颜色的透明度 - **/ + * 颜色辅助模块 + * @module zrender/tool/color + */ var util = require('../tool/util.js'); @@ -222,11 +190,10 @@ function resetPalette() { /** * 获取色板颜色 - * - * @param {number} idx : 色板位置 - * @param {array} [userPalete] : 自定义色板 - * - * @return {color} 颜色#000000~#ffffff + * @memberOf module:zrender/tool/color + * @param {number} idx 色板位置 + * @param {Array.} [userPalete] 自定义色板 + * @return {string} 颜色 */ function getColor(idx, userPalete) { @@ -261,7 +228,7 @@ function getHighlightColor() { /** * 径向渐变 - * + * @memberOf module:zrender/tool/color * @param {number} x0 渐变起点 * @param {number} y0 * @param {number} r0 @@ -269,6 +236,7 @@ function getHighlightColor() { * @param {number} y1 * @param {number} r1 * @param {Array} colorList 颜色列表 + * @return {CanvasGradient} */ function getRadialGradient(x0, y0, r0, x1, y1, r1, colorList) { @@ -322,27 +290,31 @@ function getStepColors(start, end, step) { var stepR = (end[0] - start[0]) / step; var stepG = (end[1] - start[1]) / step; var stepB = (end[2] - start[2]) / step; + var stepA = (end[3] - start[3]) / step; // 生成颜色集合 // fix by linfeng 颜色堆积 - for (var i = 0, r = start[0], g = start[1], b = start[2]; i < step; i++) { + for (var i = 0, r = start[0], g = start[1], b = start[2], a = start[3]; i < step; i++) { colors[i] = toColor([ - adjust(Math.floor(r), [0, 255]), adjust(Math.floor(g), [0, 255]), adjust(Math.floor(b), [0, 255])]); + adjust(Math.floor(r), [0, 255]), adjust(Math.floor(g), [0, 255]), adjust(Math.floor(b), [0, 255]), a.toFixed(4) - 0], 'rgba'); r += stepR; g += stepG; b += stepB; + a += stepA; } r = end[0]; g = end[1]; b = end[2]; - colors[i] = toColor([r, g, b]); + a = end[3]; + colors[i] = toColor([r, g, b, a], 'rgba'); return colors; } /** * 获取指定级数的渐变颜色数组 - * @param {Array} colors 颜色组 - * @param {number=20} step 渐变级数 - * @return {Array} 颜色数组 + * @memberOf module:zrender/tool/color + * @param {Array.} colors 颜色组 + * @param {number} [step=20] 渐变级数 + * @return {Array.} 颜色数组 */ function getGradientColors(colors, step) { @@ -353,7 +325,8 @@ function getGradientColors(colors, step) { } if (len === 1) { ret = getStepColors(colors[0], colors[0], step); - } else if (len > 1) { + } + else if (len > 1) { for (var i = 0, n = len - 1; i < n; i++) { var steps = getStepColors(colors[i], colors[i + 1], step); if (i < n - 1) { @@ -383,7 +356,8 @@ function toColor(data, format) { if (format.indexOf('hex') > -1) { return '#' + ((1 << 24) + (data[0] << 16) + (data[1] << 8) + (+data[2])).toString(16).slice(1); - } else if (format.indexOf('hs') > -1) { + } + else if (format.indexOf('hs') > -1) { var sx = map(data.slice(1, 3), function (c) { return c + '%'; }); @@ -404,10 +378,10 @@ function toColor(data, format) { } /** - * 返回颜色值数组 - * - * @param {color} color 颜色 - * @return {Array} 颜色值数组 + * 颜色字符串转换为rgba数组 + * @memberOf module:zrender/tool/color + * @param {string} color 颜色 + * @return {Array.} 颜色值数组 */ function toArray(color) { @@ -421,7 +395,8 @@ function toArray(color) { color.replace(/[\d.]+/g, function (n) { if (i < 3) { n = n | 0; - } else { + } + else { // Alpha n = +n; } @@ -433,12 +408,15 @@ function toArray(color) { /** * 颜色格式转化 * - * @param {Array} data 颜色值数组 + * @param {string} color 颜色值数组 * @param {string} format 格式,默认rgb * @return {string} 颜色 */ function convert(color, format) { + if (!isCalculableColor(color)) { + return color; + } var data = getData(color); var alpha = data[3]; if (typeof alpha === 'undefined') { @@ -447,13 +425,15 @@ function convert(color, format) { if (color.indexOf('hsb') > -1) { data = _HSV_2_RGB(data); - } else if (color.indexOf('hsl') > -1) { + } + else if (color.indexOf('hsl') > -1) { data = _HSL_2_RGB(data); } if (format.indexOf('hsb') > -1 || format.indexOf('hsv') > -1) { data = _RGB_2_HSB(data); - } else if (format.indexOf('hsl') > -1) { + } + else if (format.indexOf('hsl') > -1) { data = _RGB_2_HSL(data); } @@ -464,7 +444,7 @@ function convert(color, format) { /** * 转换为rgba格式的颜色 - * + * @memberOf module:zrender/tool/color * @param {string} color 颜色 * @return {string} rgba颜色,rgba(r,g,b,a) */ @@ -475,7 +455,7 @@ function toRGBA(color) { /** * 转换为rgb数字格式的颜色 - * + * @memberOf module:zrender/tool/color * @param {string} color 颜色 * @return {string} rgb颜色,rgb(0,0,0)格式 */ @@ -486,7 +466,7 @@ function toRGB(color) { /** * 转换为16进制颜色 - * + * @memberOf module:zrender/tool/color * @param {string} color 颜色 * @return {string} 16进制颜色,#rrggbb格式 */ @@ -497,7 +477,7 @@ function toHex(color) { /** * 转换为HSV颜色 - * + * @memberOf module:zrender/tool/color * @param {string} color 颜色 * @return {string} HSVA颜色,hsva(h,s,v,a) */ @@ -508,7 +488,7 @@ function toHSVA(color) { /** * 转换为HSV颜色 - * + * @memberOf module:zrender/tool/color * @param {string} color 颜色 * @return {string} HSV颜色,hsv(h,s,v) */ @@ -519,7 +499,7 @@ function toHSV(color) { /** * 转换为HSBA颜色 - * + * @memberOf module:zrender/tool/color * @param {string} color 颜色 * @return {string} HSBA颜色,hsba(h,s,b,a) */ @@ -530,7 +510,7 @@ function toHSBA(color) { /** * 转换为HSB颜色 - * + * @memberOf module:zrender/tool/color * @param {string} color 颜色 * @return {string} HSB颜色,hsb(h,s,b) */ @@ -541,7 +521,7 @@ function toHSB(color) { /** * 转换为HSLA颜色 - * + * @memberOf module:zrender/tool/color * @param {string} color 颜色 * @return {string} HSLA颜色,hsla(h,s,l,a) */ @@ -552,7 +532,7 @@ function toHSLA(color) { /** * 转换为HSL颜色 - * + * @memberOf module:zrender/tool/color * @param {string} color 颜色 * @return {string} HSL颜色,hsl(h,s,l) */ @@ -590,7 +570,7 @@ function trim(color) { /** * 颜色规范化 - * + * @memberOf module:zrender/tool/color * @param {string} color 颜色 * @return {string} 规范化后的颜色 */ @@ -620,13 +600,16 @@ function normalize(color) { /** * 颜色加深或减淡,当level>0加深,当level<0减淡 - * + * @memberOf module:zrender/tool/color * @param {string} color 颜色 * @param {number} level 升降程度,取值区间[-1,1] * @return {string} 加深或减淡后颜色值 */ function lift(color, level) { + if (!isCalculableColor(color)) { + return color; + } var direct = level > 0 ? 1 : -1; if (typeof level === 'undefined') { level = 0; @@ -637,7 +620,8 @@ function lift(color, level) { for (var i = 0; i < 3; i++) { if (direct === 1) { data[i] = data[i] * (1 - level) | 0; - } else { + } + else { data[i] = ((255 - data[i]) * level + data[i]) | 0; } } @@ -646,12 +630,15 @@ function lift(color, level) { /** * 颜色翻转,[255-r,255-g,255-b,1-a] - * + * @memberOf module:zrender/tool/color * @param {string} color 颜色 * @return {string} 翻转颜色 */ function reverse(color) { + if (!isCalculableColor(color)) { + return color; + } var data = getData(toRGBA(color)); data = map(data, function (c) { return 255 - c; @@ -661,14 +648,18 @@ function reverse(color) { /** * 简单两种颜色混合 - * + * @memberOf module:zrender/tool/color * @param {string} color1 第一种颜色 * @param {string} color2 第二种颜色 - * @param {string} weight 混合权重[0-1] + * @param {number} weight 混合权重[0-1] * @return {string} 结果色,rgb(r,g,b)或rgba(r,g,b,a) */ function mix(color1, color2, weight) { + if (!isCalculableColor(color1) || !isCalculableColor(color2)) { + return color1; + } + if (typeof weight === 'undefined') { weight = 0.5; } @@ -706,7 +697,7 @@ function mix(color1, color2, weight) { */ function random() { - return '#' + Math.random().toString(16).slice(2, 8); + return '#' + (Math.random().toString(16) + '0000').slice(2, 8); } /** @@ -728,7 +719,7 @@ function random() { * hsla(h,s,l,a) * * @param {string} color 颜色 - * @return {Array} 颜色值数组或null + * @return {Array.} 颜色值数组或null */ function getData(color) { @@ -787,12 +778,16 @@ function getData(color) { /** * 设置颜色透明度 + * @memberOf module:zrender/tool/color * @param {string} color 颜色 - * @param {number} alpha 透明度,区间[0,1] + * @param {number} a 透明度,区间[0,1] * @return {string} rgba颜色值 */ function alpha(color, a) { + if (!isCalculableColor(color)) { + return color; + } if (a === null) { a = 1; } @@ -804,6 +799,7 @@ function alpha(color, a) { // 数组映射 + function map(array, fun) { if (typeof fun !== 'function') { throw new TypeError(); @@ -817,6 +813,7 @@ function map(array, fun) { // 调整值区间 + function adjust(value, region) { // < to <= & > to >= // modify by linzhifeng 2014-05-25 because -0 == 0 @@ -829,19 +826,27 @@ function adjust(value, region) { return value; } +function isCalculableColor(color) { + return color instanceof Array || typeof color === 'string'; +} + // 参见 http:// www.easyrgb.com/index.php?X=MATH + function _HSV_2_RGB(data) { var H = data[0]; var S = data[1]; var V = data[2]; // HSV from 0 to 1 - var R, G, B; + var R; + var G; + var B; if (S === 0) { R = V * 255; G = V * 255; B = V * 255; - } else { + } + else { var h = H * 6; if (h === 6) { h = 0; @@ -858,23 +863,28 @@ function _HSV_2_RGB(data) { r = V; g = v3; b = v1; - } else if (i === 1) { + } + else if (i === 1) { r = v2; g = V; b = v1; - } else if (i === 2) { + } + else if (i === 2) { r = v1; g = V; b = v3; - } else if (i === 3) { + } + else if (i === 3) { r = v1; g = v2; b = V; - } else if (i === 4) { + } + else if (i === 4) { r = v3; g = v1; b = V; - } else { + } + else { r = V; g = v1; b = v2; @@ -893,16 +903,20 @@ function _HSL_2_RGB(data) { var S = data[1]; var L = data[2]; // HSL from 0 to 1 - var R, G, B; + var R; + var G; + var B; if (S === 0) { R = L * 255; G = L * 255; B = L * 255; - } else { + } + else { var v2; if (L < 0.5) { v2 = L * (1 + S); - } else { + } + else { v2 = (L + S) - (S * L); } @@ -951,7 +965,8 @@ function _RGB_2_HSB(data) { if (delta === 0) { H = 0; S = 0; - } else { + } + else { S = delta / vMax; var deltaR = (((vMax - R) / 6) + (delta / 2)) / delta; @@ -960,9 +975,11 @@ function _RGB_2_HSB(data) { if (R === vMax) { H = deltaB - deltaG; - } else if (G === vMax) { + } + else if (G === vMax) { H = (1 / 3) + deltaR - deltaB; - } else if (B === vMax) { + } + else if (B === vMax) { H = (2 / 3) + deltaG - deltaR; } @@ -988,7 +1005,6 @@ function _RGB_2_HSL(data) { var vMin = Math.min(R, G, B); // Min. value of RGB var vMax = Math.max(R, G, B); // Max. value of RGB var delta = vMax - vMin; // Delta RGB value - var L = (vMax + vMin) / 2; var H; var S; @@ -996,10 +1012,12 @@ function _RGB_2_HSL(data) { if (delta === 0) { H = 0; S = 0; - } else { + } + else { if (L < 0.5) { S = delta / (vMax + vMin); - } else { + } + else { S = delta / (2 - vMax - vMin); } @@ -1009,9 +1027,11 @@ function _RGB_2_HSL(data) { if (R === vMax) { H = deltaB - deltaG; - } else if (G === vMax) { + } + else if (G === vMax) { H = (1 / 3) + deltaR - deltaB; - } else if (B === vMax) { + } + else if (B === vMax) { H = (2 / 3) + deltaG - deltaR; } diff --git a/src/zrender/tool/computeBoundingBox.js b/src/zrender/tool/computeBoundingBox.js index 6c214c6..7b62095 100644 --- a/src/zrender/tool/computeBoundingBox.js +++ b/src/zrender/tool/computeBoundingBox.js @@ -1,16 +1,18 @@ /** - * zrender: 计算包围盒 - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * pissang(https://github.com/pissang) * errorrik (errorrik@gmail.com) */ - var vec2 = require('./vector.js'); +var curve = require('./curve.js'); /** - * 计算包围盒 + * 从顶点数组中计算出最小包围盒,写入`min`和`max`中 + * @module zrender/tool/computeBoundingBox + * @param {Array} points 顶点数组 + * @param {number} min + * @param {number} max */ function computeBoundingBox(points, min, max) { @@ -45,15 +47,27 @@ function computeBoundingBox(points, min, max) { } /** - * 计算三阶贝塞尔曲线的包围盒 - * http://pissang.net/blog/?p=91 + * 从三阶贝塞尔曲线(p0, p1, p2, p3)中计算出最小包围盒,写入`min`和`max`中 + * @memberOf module:zrender/tool/computeBoundingBox + * @param {Array.} p0 + * @param {Array.} p1 + * @param {Array.} p2 + * @param {Array.} p3 + * @param {Array.} min + * @param {Array.} max */ function computeCubeBezierBoundingBox(p0, p1, p2, p3, min, max) { - var xDim = _computeCubeBezierExtremitiesDim( - p0[0], p1[0], p2[0], p3[0]); - var yDim = _computeCubeBezierExtremitiesDim( - p0[1], p1[1], p2[1], p3[1]); + var xDim = []; + curve.cubicExtrema(p0[0], p1[0], p2[0], p3[0], xDim); + for (var i = 0; i < xDim.length; i++) { + xDim[i] = curve.cubicAt(p0[0], p1[0], p2[0], p3[0], xDim[i]); + } + var yDim = []; + curve.cubicExtrema(p0[1], p1[1], p2[1], p3[1], yDim); + for (var i = 0; i < yDim.length; i++) { + yDim[i] = curve.cubicAt(p0[1], p1[1], p2[1], p3[1], yDim[i]); + } xDim.push(p0[0], p3[0]); yDim.push(p0[1], p3[1]); @@ -69,62 +83,20 @@ function computeCubeBezierBoundingBox(p0, p1, p2, p3, min, max) { max[1] = bottom; } -function _computeCubeBezierExtremitiesDim(p0, p1, p2, p3) { - var extremities = []; - - var b = 6 * p2 - 12 * p1 + 6 * p0; - var a = 9 * p1 + 3 * p3 - 3 * p0 - 9 * p2; - var c = 3 * p1 - 3 * p0; - - var tmp = b * b - 4 * a * c; - if (tmp > 0) { - var tmpSqrt = Math.sqrt(tmp); - var t1 = (-b + tmpSqrt) / (2 * a); - var t2 = (-b - tmpSqrt) / (2 * a); - extremities.push(t1, t2); - } - else if (tmp === 0) { - extremities.push(-b / (2 * a)); - } - - var result = []; - for (var i = 0; i < extremities.length; i++) { - var t = extremities[i]; - if (Math.abs(2 * a * t + b) > 0.0001 && t < 1 && t > 0) { - var ct = 1 - t; - var val = ct * ct * ct * p0 + 3 * ct * ct * t * p1 + 3 * ct * t * t * p2 + t * t * t * p3; - - result.push(val); - } - } - - return result; -} - /** - * 计算二阶贝塞尔曲线的包围盒 - * http://pissang.net/blog/?p=91 + * 从二阶贝塞尔曲线(p0, p1, p2)中计算出最小包围盒,写入`min`和`max`中 + * @memberOf module:zrender/tool/computeBoundingBox + * @param {Array.} p0 + * @param {Array.} p1 + * @param {Array.} p2 + * @param {Array.} min + * @param {Array.} max */ function computeQuadraticBezierBoundingBox(p0, p1, p2, min, max) { // Find extremities, where derivative in x dim or y dim is zero - var tmp = (p0[0] + p2[0] - 2 * p1[0]); - // p1 is center of p0 and p2 in x dim - var t1; - if (tmp === 0) { - t1 = 0.5; - } else { - t1 = (p0[0] - p1[0]) / tmp; - } - - tmp = (p0[1] + p2[1] - 2 * p1[1]); - // p1 is center of p0 and p2 in y dim - var t2; - if (tmp === 0) { - t2 = 0.5; - } else { - t2 = (p0[1] - p1[1]) / tmp; - } + var t1 = curve.quadraticExtremum(p0[0], p1[0], p2[0]); + var t2 = curve.quadraticExtremum(p0[1], p1[1], p2[1]); t1 = Math.max(Math.min(t1, 1), 0); t2 = Math.max(Math.min(t2, 1), 0); @@ -137,66 +109,80 @@ function computeQuadraticBezierBoundingBox(p0, p1, p2, min, max) { var x2 = ct2 * ct2 * p0[0] + 2 * ct2 * t2 * p1[0] + t2 * t2 * p2[0]; var y2 = ct2 * ct2 * p0[1] + 2 * ct2 * t2 * p1[1] + t2 * t2 * p2[1]; - - return computeBoundingBox([p0.slice(), p2.slice(), [x1, y1], - [x2, y2] - ], min, max); + min[0] = Math.min(p0[0], p2[0], x1, x2); + min[1] = Math.min(p0[1], p2[1], y1, y2); + max[0] = Math.max(p0[0], p2[0], x1, x2); + max[1] = Math.max(p0[1], p2[1], y1, y2); } +var start = vec2.create(); +var end = vec2.create(); +var extremity = vec2.create(); /** - * 计算圆弧的包围盒 - * http://pissang.net/blog/?p=91 + * 从圆弧中计算出最小包围盒,写入`min`和`max`中 + * @method + * @memberOf module:zrender/tool/computeBoundingBox + * @param {Array.} center 圆弧中心点 + * @param {number} radius 圆弧半径 + * @param {number} startAngle 圆弧开始角度 + * @param {number} endAngle 圆弧结束角度 + * @param {number} anticlockwise 是否是顺时针 + * @param {Array.} min + * @param {Array.} max */ -var computeArcBoundingBox = (function () { - var start = []; - var end = []; - // At most 4 extremities - var extremities = [ - [], - [], - [], - [] - ]; - return function ( - center, radius, startAngle, endAngle, clockwise, min, max) { - clockwise = clockwise ? 1 : -1; - start[0] = Math.cos(startAngle); - start[1] = Math.sin(startAngle) * clockwise; - vec2.scale(start, start, radius); - vec2.add(start, start, center); - - end[0] = Math.cos(endAngle); - end[1] = Math.sin(endAngle) * clockwise; - vec2.scale(end, end, radius); - vec2.add(end, end, center); - - startAngle = startAngle % (Math.PI * 2); - if (startAngle < 0) { - startAngle = startAngle + Math.PI * 2; - } - endAngle = endAngle % (Math.PI * 2); - if (endAngle < 0) { - endAngle = endAngle + Math.PI * 2; - } +var computeArcBoundingBox = function ( +x, y, r, startAngle, endAngle, anticlockwise, min, max) { + if (Math.abs(startAngle - endAngle) >= Math.PI * 2) { + // Is a circle + min[0] = x - r; + min[1] = y - r; + max[0] = x + r; + max[1] = y + r; + return; + } - if (startAngle > endAngle) { - endAngle += Math.PI * 2; - } - var number = 0; - for (var angle = 0; angle < endAngle; angle += Math.PI / 2) { - if (angle > startAngle) { - var extremity = extremities[number++]; - extremity[0] = Math.cos(angle); - extremity[1] = Math.sin(angle) * clockwise; - vec2.scale(extremity, extremity, radius); - vec2.add(extremity, extremity, center); - } + start[0] = Math.cos(startAngle) * r + x; + start[1] = Math.sin(startAngle) * r + y; + + end[0] = Math.cos(endAngle) * r + x; + end[1] = Math.sin(endAngle) * r + y; + + vec2.min(min, start, end); + vec2.max(max, start, end); + + // Thresh to [0, Math.PI * 2] + startAngle = startAngle % (Math.PI * 2); + if (startAngle < 0) { + startAngle = startAngle + Math.PI * 2; + } + endAngle = endAngle % (Math.PI * 2); + if (endAngle < 0) { + endAngle = endAngle + Math.PI * 2; + } + + if (startAngle > endAngle && !anticlockwise) { + endAngle += Math.PI * 2; + } else if (startAngle < endAngle && anticlockwise) { + startAngle += Math.PI * 2; + } + if (anticlockwise) { + var tmp = endAngle; + endAngle = startAngle; + startAngle = tmp; + } + + // var number = 0; + // var step = (anticlockwise ? -Math.PI : Math.PI) / 2; + for (var angle = 0; angle < endAngle; angle += Math.PI / 2) { + if (angle > startAngle) { + extremity[0] = Math.cos(angle) * r + x; + extremity[1] = Math.sin(angle) * r + y; + + vec2.min(min, extremity, min); + vec2.max(max, extremity, max); } - var points = extremities.slice(0, number); - points.push(start, end); - computeBoundingBox(points, min, max); - }; -})(); + } +}; computeBoundingBox.cubeBezier = computeCubeBezierBoundingBox; computeBoundingBox.quadraticBezier = computeQuadraticBezierBoundingBox; diff --git a/src/zrender/tool/curve.js b/src/zrender/tool/curve.js new file mode 100644 index 0000000..5ec0fa4 --- /dev/null +++ b/src/zrender/tool/curve.js @@ -0,0 +1,512 @@ +'use strict'; +/** + * 曲线辅助模块 + * @module zrender/tool/curve + * @author pissang(https://www.github.com/pissang) + */ + +var vector = require('./vector.js'); +var EPSILON = 1e-4; + +var THREE_SQRT = Math.sqrt(3); +var ONE_THIRD = 1 / 3; + +// 临时变量 +var _v0 = vector.create(); +var _v1 = vector.create(); +var _v2 = vector.create(); +// var _v3 = vector.create(); + +function isAroundZero(val) { + return val > -EPSILON && val < EPSILON; +} + +function isNotAroundZero(val) { + return val > EPSILON || val < -EPSILON; +} +/* + function evalCubicCoeff(a, b, c, d, t) { + return ((a * t + b) * t + c) * t + d; + } + */ + +/** + * 计算三次贝塞尔值 + * @memberOf module:zrender/tool/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} p3 + * @param {number} t + * @return {number} + */ + +function cubicAt(p0, p1, p2, p3, t) { + var onet = 1 - t; + return onet * onet * (onet * p0 + 3 * t * p1) + t * t * (t * p3 + 3 * onet * p2); +} + +/** + * 计算三次贝塞尔导数值 + * @memberOf module:zrender/tool/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} p3 + * @param {number} t + * @return {number} + */ + +function cubicDerivativeAt(p0, p1, p2, p3, t) { + var onet = 1 - t; + return 3 * (((p1 - p0) * onet + 2 * (p2 - p1) * t) * onet + (p3 - p2) * t * t); +} + +/** + * 计算三次贝塞尔方程根,使用盛金公式 + * @memberOf module:zrender/tool/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} p3 + * @param {number} val + * @param {Array.} roots + * @return {number} 有效根数目 + */ + +function cubicRootAt(p0, p1, p2, p3, val, roots) { + // Evaluate roots of cubic functions + var a = p3 + 3 * (p1 - p2) - p0; + var b = 3 * (p2 - p1 * 2 + p0); + var c = 3 * (p1 - p0); + var d = p0 - val; + + var A = b * b - 3 * a * c; + var B = b * c - 9 * a * d; + var C = c * c - 3 * b * d; + + var n = 0; + + if (isAroundZero(A) && isAroundZero(B)) { + if (isAroundZero(b)) { + roots[0] = 0; + } + else { + var t1 = -c / b; //t1, t2, t3, b is not zero + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + } + } + else { + var disc = B * B - 4 * A * C; + + if (isAroundZero(disc)) { + var K = B / A; + var t1 = -b / a + K; // t1, a is not zero + var t2 = -K / 2; // t2, t3 + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + if (t2 >= 0 && t2 <= 1) { + roots[n++] = t2; + } + } + else if (disc > 0) { + var discSqrt = Math.sqrt(disc); + var Y1 = A * b + 1.5 * a * (-B + discSqrt); + var Y2 = A * b + 1.5 * a * (-B - discSqrt); + if (Y1 < 0) { + Y1 = -Math.pow(-Y1, ONE_THIRD); + } + else { + Y1 = Math.pow(Y1, ONE_THIRD); + } + if (Y2 < 0) { + Y2 = -Math.pow(-Y2, ONE_THIRD); + } + else { + Y2 = Math.pow(Y2, ONE_THIRD); + } + var t1 = (-b - (Y1 + Y2)) / (3 * a); + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + } + else { + var T = (2 * A * b - 3 * a * B) / (2 * Math.sqrt(A * A * A)); + var theta = Math.acos(T) / 3; + var ASqrt = Math.sqrt(A); + var tmp = Math.cos(theta); + + var t1 = (-b - 2 * ASqrt * tmp) / (3 * a); + var t2 = (-b + ASqrt * (tmp + THREE_SQRT * Math.sin(theta))) / (3 * a); + var t3 = (-b + ASqrt * (tmp - THREE_SQRT * Math.sin(theta))) / (3 * a); + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + if (t2 >= 0 && t2 <= 1) { + roots[n++] = t2; + } + if (t3 >= 0 && t3 <= 1) { + roots[n++] = t3; + } + } + } + return n; +} + +/** + * 计算三次贝塞尔方程极限值的位置 + * @memberOf module:zrender/tool/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} p3 + * @param {Array.} extrema + * @return {number} 有效数目 + */ + +function cubicExtrema(p0, p1, p2, p3, extrema) { + var b = 6 * p2 - 12 * p1 + 6 * p0; + var a = 9 * p1 + 3 * p3 - 3 * p0 - 9 * p2; + var c = 3 * p1 - 3 * p0; + + var n = 0; + if (isAroundZero(a)) { + if (isNotAroundZero(b)) { + var t1 = -c / b; + if (t1 >= 0 && t1 <= 1) { + extrema[n++] = t1; + } + } + } + else { + var disc = b * b - 4 * a * c; + if (isAroundZero(disc)) { + extrema[0] = -b / (2 * a); + } + else if (disc > 0) { + var discSqrt = Math.sqrt(disc); + var t1 = (-b + discSqrt) / (2 * a); + var t2 = (-b - discSqrt) / (2 * a); + if (t1 >= 0 && t1 <= 1) { + extrema[n++] = t1; + } + if (t2 >= 0 && t2 <= 1) { + extrema[n++] = t2; + } + } + } + return n; +} + +/** + * 细分三次贝塞尔曲线 + * @memberOf module:zrender/tool/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} p3 + * @param {number} t + * @param {Array.} out + */ + +function cubicSubdivide(p0, p1, p2, p3, t, out) { + var p01 = (p1 - p0) * t + p0; + var p12 = (p2 - p1) * t + p1; + var p23 = (p3 - p2) * t + p2; + + var p012 = (p12 - p01) * t + p01; + var p123 = (p23 - p12) * t + p12; + + var p0123 = (p123 - p012) * t + p012; + // Seg0 + out[0] = p0; + out[1] = p01; + out[2] = p012; + out[3] = p0123; + // Seg1 + out[4] = p0123; + out[5] = p123; + out[6] = p23; + out[7] = p3; +} + +/** + * 投射点到三次贝塞尔曲线上,返回投射距离。 + * 投射点有可能会有一个或者多个,这里只返回其中距离最短的一个。 + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @param {number} x3 + * @param {number} y3 + * @param {number} x + * @param {number} y + * @param {Array.} [out] 投射点 + * @return {number} + */ + +function cubicProjectPoint( +x0, y0, x1, y1, x2, y2, x3, y3, x, y, out) { + // http://pomax.github.io/bezierinfo/#projections + var t; + var interval = 0.005; + var d = Infinity; + + _v0[0] = x; + _v0[1] = y; + + // 先粗略估计一下可能的最小距离的 t 值 + // PENDING + for (var _t = 0; _t < 1; _t += 0.05) { + _v1[0] = cubicAt(x0, x1, x2, x3, _t); + _v1[1] = cubicAt(y0, y1, y2, y3, _t); + var d1 = vector.distSquare(_v0, _v1); + if (d1 < d) { + t = _t; + d = d1; + } + } + d = Infinity; + + // At most 32 iteration + for (var i = 0; i < 32; i++) { + if (interval < EPSILON) { + break; + } + var prev = t - interval; + var next = t + interval; + // t - interval + _v1[0] = cubicAt(x0, x1, x2, x3, prev); + _v1[1] = cubicAt(y0, y1, y2, y3, prev); + + var d1 = vector.distSquare(_v1, _v0); + + if (prev >= 0 && d1 < d) { + t = prev; + d = d1; + } + else { + // t + interval + _v2[0] = cubicAt(x0, x1, x2, x3, next); + _v2[1] = cubicAt(y0, y1, y2, y3, next); + var d2 = vector.distSquare(_v2, _v0); + + if (next <= 1 && d2 < d) { + t = next; + d = d2; + } + else { + interval *= 0.5; + } + } + } + // t + if (out) { + out[0] = cubicAt(x0, x1, x2, x3, t); + out[1] = cubicAt(y0, y1, y2, y3, t); + } + // console.log(interval, i); + return Math.sqrt(d); +} + +/** + * 计算二次方贝塞尔值 + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} t + * @return {number} + */ + +function quadraticAt(p0, p1, p2, t) { + var onet = 1 - t; + return onet * (onet * p0 + 2 * t * p1) + t * t * p2; +} + +/** + * 计算二次方贝塞尔导数值 + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} t + * @return {number} + */ + +function quadraticDerivativeAt(p0, p1, p2, t) { + return 2 * ((1 - t) * (p1 - p0) + t * (p2 - p1)); +} + +/** + * 计算二次方贝塞尔方程根 + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @param {number} t + * @param {Array.} roots + * @return {number} 有效根数目 + */ + +function quadraticRootAt(p0, p1, p2, val, roots) { + var a = p0 - 2 * p1 + p2; + var b = 2 * (p1 - p0); + var c = p0 - val; + + var n = 0; + if (isAroundZero(a)) { + if (isNotAroundZero(b)) { + var t1 = -c / b; + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + } + } + else { + var disc = b * b - 4 * a * c; + if (isAroundZero(disc)) { + var t1 = -b / (2 * a); + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + } + else if (disc > 0) { + var discSqrt = Math.sqrt(disc); + var t1 = (-b + discSqrt) / (2 * a); + var t2 = (-b - discSqrt) / (2 * a); + if (t1 >= 0 && t1 <= 1) { + roots[n++] = t1; + } + if (t2 >= 0 && t2 <= 1) { + roots[n++] = t2; + } + } + } + return n; +} + +/** + * 计算二次贝塞尔方程极限值 + * @memberOf module:zrender/tool/curve + * @param {number} p0 + * @param {number} p1 + * @param {number} p2 + * @return {number} + */ + +function quadraticExtremum(p0, p1, p2) { + var divider = p0 + p2 - 2 * p1; + if (divider === 0) { + // p1 is center of p0 and p2 + return 0.5; + } + else { + return (p0 - p1) / divider; + } +} + +/** + * 投射点到二次贝塞尔曲线上,返回投射距离。 + * 投射点有可能会有一个或者多个,这里只返回其中距离最短的一个。 + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @param {number} x + * @param {number} y + * @param {Array.} out 投射点 + * @return {number} + */ + +function quadraticProjectPoint( +x0, y0, x1, y1, x2, y2, x, y, out) { + // http://pomax.github.io/bezierinfo/#projections + var t; + var interval = 0.005; + var d = Infinity; + + _v0[0] = x; + _v0[1] = y; + + // 先粗略估计一下可能的最小距离的 t 值 + // PENDING + for (var _t = 0; _t < 1; _t += 0.05) { + _v1[0] = quadraticAt(x0, x1, x2, _t); + _v1[1] = quadraticAt(y0, y1, y2, _t); + var d1 = vector.distSquare(_v0, _v1); + if (d1 < d) { + t = _t; + d = d1; + } + } + d = Infinity; + + // At most 32 iteration + for (var i = 0; i < 32; i++) { + if (interval < EPSILON) { + break; + } + var prev = t - interval; + var next = t + interval; + // t - interval + _v1[0] = quadraticAt(x0, x1, x2, prev); + _v1[1] = quadraticAt(y0, y1, y2, prev); + + var d1 = vector.distSquare(_v1, _v0); + + if (prev >= 0 && d1 < d) { + t = prev; + d = d1; + } + else { + // t + interval + _v2[0] = quadraticAt(x0, x1, x2, next); + _v2[1] = quadraticAt(y0, y1, y2, next); + var d2 = vector.distSquare(_v2, _v0); + if (next <= 1 && d2 < d) { + t = next; + d = d2; + } + else { + interval *= 0.5; + } + } + } + // t + if (out) { + out[0] = quadraticAt(x0, x1, x2, t); + out[1] = quadraticAt(y0, y1, y2, t); + } + // console.log(interval, i); + return Math.sqrt(d); +} + +module.exports = { + + cubicAt: cubicAt, + + cubicDerivativeAt: cubicDerivativeAt, + + cubicRootAt: cubicRootAt, + + cubicExtrema: cubicExtrema, + + cubicSubdivide: cubicSubdivide, + + cubicProjectPoint: cubicProjectPoint, + + quadraticAt: quadraticAt, + + quadraticDerivativeAt: quadraticDerivativeAt, + + quadraticRootAt: quadraticRootAt, + + quadraticExtremum: quadraticExtremum, + + quadraticProjectPoint: quadraticProjectPoint +}; \ No newline at end of file diff --git a/src/zrender/tool/env.js b/src/zrender/tool/env.js index fe7f9f4..ada1ca8 100644 --- a/src/zrender/tool/env.js +++ b/src/zrender/tool/env.js @@ -66,9 +66,10 @@ function detect(ua) { return { browser: browser, os: os, - // 原生canvas支持 + // 原生canvas支持,改极端点了 + // canvasSupported : !(browser.ie && parseFloat(browser.version) < 9) canvasSupported: document.createElement('canvas').getContext ? true : false - } + }; } module.exports = detect(navigator.userAgent); \ No newline at end of file diff --git a/src/zrender/tool/event.js b/src/zrender/tool/event.js index a4edc05..d196520 100644 --- a/src/zrender/tool/event.js +++ b/src/zrender/tool/event.js @@ -1,20 +1,16 @@ 'use strict'; /** - * zrender: 事件辅助类 - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - * getX:获取事件横坐标 - * getY:或者事件纵坐标 - * getDelta:或者鼠标滚轮变化 - * stop:停止事件传播 - * Dispatcher:事件分发器 + * 事件辅助类 + * @module zrender/tool/event + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) */ +var Eventful = require('../mixin/Eventful.js'); + /** * 提取鼠标(手指)x坐标 - * + * @memberOf module:zrender/tool/event * @param {Event} e 事件. * @return {number} 鼠标(手指)x坐标. */ @@ -25,7 +21,7 @@ function getX(e) { /** * 提取鼠标y坐标 - * + * @memberOf module:zrender/tool/event * @param {Event} e 事件. * @return {number} 鼠标(手指)y坐标. */ @@ -36,227 +32,36 @@ function getY(e) { /** * 提取鼠标滚轮变化 - * + * @memberOf module:zrender/tool/event * @param {Event} e 事件. * @return {number} 滚轮变化,正值说明滚轮是向上滚动,如果是负值说明滚轮是向下滚动 */ function getDelta(e) { - return typeof e.wheelDelta != 'undefined' && e.wheelDelta || typeof e.detail != 'undefined' && -e.detail; + return typeof e.zrenderDelta != 'undefined' && e.zrenderDelta || typeof e.wheelDelta != 'undefined' && e.wheelDelta || typeof e.detail != 'undefined' && -e.detail; } /** * 停止冒泡和阻止默认行为 - * - * @type {Function} + * @memberOf module:zrender/tool/event + * @method * @param {Event} e : event对象 */ var stop = typeof window.addEventListener === 'function' ? function (e) { e.preventDefault(); e.stopPropagation(); + e.cancelBubble = true; } : function (e) { e.returnValue = false; e.cancelBubble = true; }; -/** - * 事件分发器 - */ - -function Dispatcher() { - this._handlers = {}; -} -/** - * 单次触发绑定,dispatch后销毁 - * - * @param {string} event 事件字符串 - * @param {Function} handler 响应函数 - * @param {Object} [context] - */ -Dispatcher.prototype.one = function (event, handler, context) { - - var _h = this._handlers; - - if (!handler || !event) { - return this; - } - - if (!_h[event]) { - _h[event] = []; - } - - _h[event].push({ - h: handler, - one: true, - ctx: context || this - }); - - return this; -}; - -/** - * 事件绑定 - * - * @param {string} event 事件字符串 - * @param {Function} handler : 响应函数 - * @param {Object} [context] - */ -Dispatcher.prototype.bind = function (event, handler, context) { - - var _h = this._handlers; - - if (!handler || !event) { - return this; - } - - if (!_h[event]) { - _h[event] = []; - } - - _h[event].push({ - h: handler, - one: false, - ctx: context || this - }); - - return this; -}; - -/** - * 事件解绑定 - * - * @param {string} event 事件字符串 - * @param {Function} handler : 响应函数 - */ -Dispatcher.prototype.unbind = function (event, handler) { - - var _h = this._handlers; - - if (!event) { - this._handlers = {}; - return this; - } - - if (handler) { - if (_h[event]) { - var newList = []; - for (var i = 0, l = _h[event].length; i < l; i++) { - if (_h[event][i]['h'] != handler) { - newList.push(_h[event][i]); - } - } - _h[event] = newList; - } - - if (_h[event] && _h[event].length === 0) { - delete _h[event]; - } - } - else { - delete _h[event]; - } - - return this; -}; - -/** - * 事件分发 - * - * @param {string} type : 事件类型 - */ -Dispatcher.prototype.dispatch = function (type) { - var args = arguments; - var argLen = args.length; - - if (argLen > 3) { - args = Array.prototype.slice.call(args, 1); - } - - if (this._handlers[type]) { - var _h = this._handlers[type]; - var len = _h.length; - for (var i = 0; i < len;) { - // Optimize advise from backbone - switch (argLen) { - case 1: - _h[i]['h'].call(_h[i]['ctx']); - break; - case 2: - _h[i]['h'].call(_h[i]['ctx'], args[1]); - break; - case 3: - _h[i]['h'].call(_h[i]['ctx'], args[1], args[2]); - break; - default: - // have more than 2 given arguments - _h[i]['h'].apply(_h[i]['ctx'], args); - break; - } - - if (_h[i]['one']) { - _h.splice(i, 1); - len--; - } else { - i++; - } - } - } - - return this; -}; - -/** - * 带有context的事件分发, 最后一个参数是事件回调的context - * - * @param {string} type : 事件类型 - */ -Dispatcher.prototype.dispatchWithContext = function (type) { - var args = arguments; - var argLen = args.length; - - if (argLen > 4) { - args = Array.prototype.slice.call(args, 1, args.length - 1); - } - var ctx = args[args.length - 1]; - - if (this._handlers[type]) { - var _h = this._handlers[type]; - var len = _h.length; - for (var i = 0; i < len;) { - // Optimize advise from backbone - switch (argLen) { - case 1: - _h[i]['h'].call(ctx); - break; - case 2: - _h[i]['h'].call(ctx, args[1]); - break; - case 3: - _h[i]['h'].call(ctx, args[1], args[2]); - break; - default: - // have more than 2 given arguments - _h[i]['h'].apply(ctx, args); - break; - } - - if (_h[i]['one']) { - _h.splice(i, 1); - len--; - } else { - i++; - } - } - } - - return this; -}; - module.exports = { getX: getX, getY: getY, getDelta: getDelta, stop: stop, - Dispatcher: Dispatcher + // 做向上兼容 + Dispatcher: Eventful }; \ No newline at end of file diff --git a/src/zrender/tool/http.js b/src/zrender/tool/http.js new file mode 100644 index 0000000..b6d8553 --- /dev/null +++ b/src/zrender/tool/http.js @@ -0,0 +1,51 @@ +/** + * @module zrender/tool/http + */ + +/** + * @typedef {Object} IHTTPGetOption + * @property {string} url + * @property {Function} onsuccess + * @property {Function} [onerror] + */ + +/** + * HTTP Get + * @param {string|IHTTPGetOption} url + * @param {Function} onsuccess + * @param {Function} [onerror] + * @param {Object} [opts] 额外参数 + */ + +function get(url, onsuccess, onerror, opts) { + if (typeof(url) === 'object') { + var obj = url; + url = obj.url; + onsuccess = obj.onsuccess; + onerror = obj.onerror; + opts = obj; + } else { + if (typeof(onerror) === 'object') { + opts = onerror; + } + } /* jshint ignore:start */ + var xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP'); + xhr.open('GET', url, true); + xhr.onreadystatechange = function () { + if (xhr.readyState == 4) { + if (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) { + onsuccess && onsuccess(xhr.responseText); + } else { + onerror && onerror(); + } + xhr.onreadystatechange = new Function(); + xhr = null; + } + }; + + xhr.send(null); /* jshint ignore:end */ +} + +module.exports = { + get: get +}; \ No newline at end of file diff --git a/src/zrender/tool/log.js b/src/zrender/tool/log.js index f5250d3..a600dbe 100644 --- a/src/zrender/tool/log.js +++ b/src/zrender/tool/log.js @@ -1,12 +1,9 @@ -/** - * zrender: 日志记录 - * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - */ - - var config = require('../config.js'); +/** + * @exports zrender/tool/log + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + */ module.exports = function () { if (config.debugMode === 0) { return; diff --git a/src/zrender/tool/math.js b/src/zrender/tool/math.js index 1d1a51c..c1469d4 100644 --- a/src/zrender/tool/math.js +++ b/src/zrender/tool/math.js @@ -1,51 +1,33 @@ /** * zrender: 数学辅助类 * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * - * sin:正弦函数,自动缓存 - * cos:余弦函数,自动缓存 + * sin:正弦函数 + * cos:余弦函数 * degreeToRadian:角度转弧度 * radianToDegree:弧度转角度 */ -/* - var _cache = { - sin : {}, //sin缓存 - cos : {} //cos缓存 - }; - */ + var _radians = Math.PI / 180; /** - * @param angle 弧度(角度)参数 - * @param isDegrees angle参数是否为角度计算,默认为false,angle为以弧度计量的角度 + * @param {number} angle 弧度(角度)参数 + * @param {boolean} isDegrees angle参数是否为角度计算,默认为false,angle为以弧度计量的角度 */ function sin(angle, isDegrees) { return Math.sin(isDegrees ? angle * _radians : angle); -/* - angle = (isDegrees ? angle * _radians : angle).toFixed(4); - if(typeof _cache.sin[angle] == 'undefined') { - _cache.sin[angle] = Math.sin(angle); - } - return _cache.sin[angle]; - */ } /** - * @param radians 弧度参数 + * @param {number} angle 弧度(角度)参数 + * @param {boolean} isDegrees angle参数是否为角度计算,默认为false,angle为以弧度计量的角度 */ function cos(angle, isDegrees) { return Math.cos(isDegrees ? angle * _radians : angle); -/* - angle = (isDegrees ? angle * _radians : angle).toFixed(4); - if(typeof _cache.cos[angle] == 'undefined') { - _cache.cos[angle] = Math.cos(angle); - } - return _cache.cos[angle]; - */ } /** diff --git a/src/zrender/tool/matrix.js b/src/zrender/tool/matrix.js index cac7a1a..d86aba0 100644 --- a/src/zrender/tool/matrix.js +++ b/src/zrender/tool/matrix.js @@ -1,20 +1,23 @@ +var ArrayCtor = typeof Float32Array === 'undefined' ? Array : Float32Array; /** - * zrender: 3x2矩阵操作类 - * - * author: https://github.com/pissang + * 3x2矩阵操作类 + * @exports zrender/tool/matrix */ - - - -var ArrayCtor = typeof Float32Array === 'undefined' ? Array : Float32Array; - var matrix = { + /** + * 创建一个单位矩阵 + * @return {Float32Array|Array.} + */ create: function () { var out = new ArrayCtor(6); matrix.identity(out); return out; }, + /** + * 设置矩阵为单位矩阵 + * @param {Float32Array|Array.} out + */ identity: function (out) { out[0] = 1; out[1] = 0; @@ -22,7 +25,13 @@ var matrix = { out[3] = 1; out[4] = 0; out[5] = 0; + return out; }, + /** + * 复制矩阵 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} m + */ copy: function (out, m) { out[0] = m[0]; out[1] = m[1]; @@ -30,7 +39,14 @@ var matrix = { out[3] = m[3]; out[4] = m[4]; out[5] = m[5]; + return out; }, + /** + * 矩阵相乘 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} m1 + * @param {Float32Array|Array.} m2 + */ mul: function (out, m1, m2) { out[0] = m1[0] * m2[0] + m1[2] * m2[1]; out[1] = m1[1] * m2[0] + m1[3] * m2[1]; @@ -40,6 +56,12 @@ var matrix = { out[5] = m1[1] * m2[4] + m1[3] * m2[5] + m1[5]; return out; }, + /** + * 平移变换 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} a + * @param {Float32Array|Array.} v + */ translate: function (out, a, v) { out[0] = a[0]; out[1] = a[1]; @@ -49,13 +71,19 @@ var matrix = { out[5] = a[5] + v[1]; return out; }, + /** + * 旋转变换 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} a + * @param {number} rad + */ rotate: function (out, a, rad) { - var aa = a[0], - ac = a[2], - atx = a[4]; - var ab = a[1], - ad = a[3], - aty = a[5]; + var aa = a[0]; + var ac = a[2]; + var atx = a[4]; + var ab = a[1]; + var ad = a[3]; + var aty = a[5]; var st = Math.sin(rad); var ct = Math.cos(rad); @@ -67,9 +95,15 @@ var matrix = { out[5] = ct * aty - st * atx; return out; }, + /** + * 缩放变换 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} a + * @param {Float32Array|Array.} v + */ scale: function (out, a, v) { - var vx = v[0], - vy = v[1]; + var vx = v[0]; + var vy = v[1]; out[0] = a[0] * vx; out[1] = a[1] * vy; out[2] = a[2] * vx; @@ -80,15 +114,17 @@ var matrix = { }, /** * 求逆矩阵 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} a */ invert: function (out, a) { - var aa = a[0], - ac = a[2], - atx = a[4]; - var ab = a[1], - ad = a[3], - aty = a[5]; + var aa = a[0]; + var ac = a[2]; + var atx = a[4]; + var ab = a[1]; + var ad = a[3]; + var aty = a[5]; var det = aa * ad - ab * ac; if (!det) { @@ -107,14 +143,17 @@ var matrix = { /** * 矩阵左乘向量 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} a + * @param {Float32Array|Array.} v */ mulVector: function (out, a, v) { - var aa = a[0], - ac = a[2], - atx = a[4]; - var ab = a[1], - ad = a[3], - aty = a[5]; + var aa = a[0]; + var ac = a[2]; + var atx = a[4]; + var ab = a[1]; + var ad = a[3]; + var aty = a[5]; out[0] = v[0] * aa + v[1] * ac + atx; out[1] = v[0] * ab + v[1] * ad + aty; diff --git a/src/zrender/tool/util.js b/src/zrender/tool/util.js index 91a11a7..6487d14 100644 --- a/src/zrender/tool/util.js +++ b/src/zrender/tool/util.js @@ -1,7 +1,7 @@ /** * zrender: 公共辅助函数 * - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) * * clone:深度克隆 * merge:合并源对象的属性到目标对象 @@ -17,6 +17,12 @@ var BUILTIN_OBJECT = { '[object CanvasGradient]': 1 }; +var objToString = Object.prototype.toString; + +function isDom(obj) { + return obj && obj.nodeType === 1 && typeof(obj.nodeName) == 'string'; +} + /** * 对一个object进行深度拷贝 * @@ -33,7 +39,9 @@ function clone(source) { result[i] = clone(source[i]); } } - else if (!BUILTIN_OBJECT[Object.prototype.toString.call(source)]) { + else if (!BUILTIN_OBJECT[objToString.call(source)] + // 是否为 dom 对象 + && !isDom(source)) { result = {}; for (var key in source) { if (source.hasOwnProperty(key)) { @@ -50,7 +58,10 @@ function clone(source) { function mergeItem(target, source, key, overwrite) { if (source.hasOwnProperty(key)) { - if (typeof target[key] == 'object' && !BUILTIN_OBJECT[Object.prototype.toString.call(target[key])]) { + var targetProp = target[key]; + if (typeof targetProp == 'object' && !BUILTIN_OBJECT[objToString.call(targetProp)] + // 是否为 dom 对象 + && !isDom(targetProp)) { // 如果需要递归覆盖,就递归调用merge merge( target[key], source[key], overwrite); @@ -82,8 +93,8 @@ var _ctx; function getContext() { if (!_ctx) { - require('../lib/excanvas.js'); - if (G_vmlCanvasManager) { + require('../dep/excanvas.js'); /* jshint ignore:start */ + if (window['G_vmlCanvasManager']) { var _div = document.createElement('div'); _div.style.position = 'absolute'; _div.style.top = '-1000px'; @@ -93,7 +104,7 @@ function getContext() { } else { _ctx = document.createElement('canvas').getContext('2d'); - } + } /* jshint ignore:end */ } return _ctx; } diff --git a/src/zrender/tool/vector.js b/src/zrender/tool/vector.js index c237334..2f215c1 100644 --- a/src/zrender/tool/vector.js +++ b/src/zrender/tool/vector.js @@ -1,93 +1,255 @@ -/** - * zrender: 向量操作类 - * - * author : https://github.com/pissang - */ - var ArrayCtor = typeof Float32Array === 'undefined' ? Array : Float32Array; +/** + * @typedef {Float32Array|Array.} Vector2 + */ +/** + * 二维向量类 + * @exports zrender/tool/vector + */ var vector = { + /** + * 创建一个向量 + * @param {number} [x=0] + * @param {number} [y=0] + * @return {Vector2} + */ create: function (x, y) { var out = new ArrayCtor(2); out[0] = x || 0; out[1] = y || 0; return out; }, + + /** + * 复制一个向量 + * @return {Vector2} out + * @return {Vector2} v + */ copy: function (out, v) { out[0] = v[0]; out[1] = v[1]; + return out; }, + + /** + * 设置向量的两个项 + * @param {Vector2} out + * @param {number} a + * @param {number} b + * @return {Vector2} 结果 + */ set: function (out, a, b) { out[0] = a; out[1] = b; + return out; }, + + /** + * 向量相加 + * @param {Vector2} out + * @param {Vector2} v1 + * @param {Vector2} v2 + */ add: function (out, v1, v2) { out[0] = v1[0] + v2[0]; out[1] = v1[1] + v2[1]; return out; }, + + /** + * 向量缩放后相加 + * @param {Vector2} out + * @param {Vector2} v1 + * @param {Vector2} v2 + * @param {number} a + */ scaleAndAdd: function (out, v1, v2, a) { out[0] = v1[0] + v2[0] * a; out[1] = v1[1] + v2[1] * a; return out; }, + + /** + * 向量相减 + * @param {Vector2} out + * @param {Vector2} v1 + * @param {Vector2} v2 + */ sub: function (out, v1, v2) { out[0] = v1[0] - v2[0]; out[1] = v1[1] - v2[1]; return out; }, - length: function (v) { - return Math.sqrt(this.lengthSquare(v)); + + /** + * 向量长度 + * @param {Vector2} v + * @return {number} + */ + len: function (v) { + return Math.sqrt(this.lenSquare(v)); }, - lengthSquare: function (v) { + + /** + * 向量长度平方 + * @param {Vector2} v + * @return {number} + */ + lenSquare: function (v) { return v[0] * v[0] + v[1] * v[1]; }, + + /** + * 向量乘法 + * @param {Vector2} out + * @param {Vector2} v1 + * @param {Vector2} v2 + */ mul: function (out, v1, v2) { out[0] = v1[0] * v2[0]; out[1] = v1[1] * v2[1]; return out; }, + + /** + * 向量除法 + * @param {Vector2} out + * @param {Vector2} v1 + * @param {Vector2} v2 + */ + div: function (out, v1, v2) { + out[0] = v1[0] / v2[0]; + out[1] = v1[1] / v2[1]; + return out; + }, + + /** + * 向量点乘 + * @param {Vector2} v1 + * @param {Vector2} v2 + * @return {number} + */ dot: function (v1, v2) { return v1[0] * v2[0] + v1[1] * v2[1]; }, + + /** + * 向量缩放 + * @param {Vector2} out + * @param {Vector2} v + * @param {number} s + */ scale: function (out, v, s) { out[0] = v[0] * s; out[1] = v[1] * s; return out; }, + + /** + * 向量归一化 + * @param {Vector2} out + * @param {Vector2} v + */ normalize: function (out, v) { - var d = vector.length(v); + var d = vector.len(v); if (d === 0) { out[0] = 0; out[1] = 0; - } else { + } + else { out[0] = v[0] / d; out[1] = v[1] / d; } return out; }, + + /** + * 计算向量间距离 + * @param {Vector2} v1 + * @param {Vector2} v2 + * @return {number} + */ distance: function (v1, v2) { return Math.sqrt((v1[0] - v2[0]) * (v1[0] - v2[0]) + (v1[1] - v2[1]) * (v1[1] - v2[1])); }, + + /** + * 向量距离平方 + * @param {Vector2} v1 + * @param {Vector2} v2 + * @return {number} + */ + distanceSquare: function (v1, v2) { + return (v1[0] - v2[0]) * (v1[0] - v2[0]) + (v1[1] - v2[1]) * (v1[1] - v2[1]); + }, + + /** + * 求负向量 + * @param {Vector2} out + * @param {Vector2} v + */ negate: function (out, v) { out[0] = -v[0]; out[1] = -v[1]; + return out; }, - middle: function (out, v1, v2) { - out[0] = (v1[0] + v2[0]) / 2; - out[1] = (v1[1] + v2[1]) / 2; + + /** + * 插值两个点 + * @param {Vector2} out + * @param {Vector2} v1 + * @param {Vector2} v2 + * @param {number} t + */ + lerp: function (out, v1, v2, t) { + // var ax = v1[0]; + // var ay = v1[1]; + out[0] = v1[0] + t * (v2[0] - v1[0]); + out[1] = v1[1] + t * (v2[1] - v1[1]); return out; }, + + /** + * 矩阵左乘向量 + * @param {Vector2} out + * @param {Vector2} v + * @param {Vector2} m + */ applyTransform: function (out, v, m) { var x = v[0]; var y = v[1]; out[0] = m[0] * x + m[2] * y + m[4]; out[1] = m[1] * x + m[3] * y + m[5]; return out; + }, + /** + * 求两个向量最小值 + * @param {Vector2} out + * @param {Vector2} v1 + * @param {Vector2} v2 + */ + min: function (out, v1, v2) { + out[0] = Math.min(v1[0], v2[0]); + out[1] = Math.min(v1[1], v2[1]); + return out; + }, + /** + * 求两个向量最大值 + * @param {Vector2} out + * @param {Vector2} v1 + * @param {Vector2} v2 + */ + max: function (out, v1, v2) { + out[0] = Math.max(v1[0], v2[0]); + out[1] = Math.max(v1[1], v2[1]); + return out; } }; -vector.len = vector.length; +vector.length = vector.len; +vector.lengthSquare = vector.lenSquare; vector.dist = vector.distance; +vector.distSquare = vector.distanceSquare; module.exports = vector; \ No newline at end of file diff --git a/src/zrender/zrender.js b/src/zrender/zrender.js index 2c880bc..49ad747 100644 --- a/src/zrender/zrender.js +++ b/src/zrender/zrender.js @@ -1,6 +1,5 @@ /*! - * ZRender, a lightweight canvas library with a MVC architecture, data-driven - * and provides an event model like DOM. + * ZRender, a high performance canvas library. * * Copyright (c) 2013, Baidu Inc. * All rights reserved. @@ -9,14 +8,6 @@ * https://github.com/ecomfe/zrender/blob/master/LICENSE.txt */ -/** - * zrender: core核心类 - * - * @desc zrender是一个轻量级的Canvas类库,MVC封装,数据驱动,提供类Dom事件模型。 - * @author Kener (@Kener-林峰, linzhifeng@baidu.com) - * - */ - /* * HTML5 Canvas for Internet Explorer! * Modern browsers like Firefox, Safari, Chrome and Opera support @@ -29,7 +20,7 @@ * http://explorercanvas.googlecode.com/svn/trunk/excanvas.js */ // 核心代码会生成一个全局变量 G_vmlCanvasManager,模块改造后借用于快速判断canvas支持 -require('./lib/excanvas.js'); +require('./dep/excanvas.js'); var util = require('./tool/util.js'); var log = require('./tool/log.js'); @@ -40,37 +31,42 @@ var Painter = require('./Painter.js'); var Storage = require('./Storage.js'); var Animation = require('./animation/Animation.js'); -var _instances = {}; //ZRender实例map索引 - +var _instances = {}; // ZRender实例map索引 +/** + * @exports zrender + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + * pissang (https://www.github.com/pissang) + */ var zrender = {}; -zrender.version = '2.0.2'; +/** + * @type {string} + */ +zrender.version = '2.0.7'; /** - * zrender初始化 - * 不让外部直接new ZRender实例,为啥? - * 不为啥,提供全局可控同时减少全局污染和降低命名冲突的风险! - * - * @param {HTMLElement} dom dom对象,不帮你做document.getElementById了 - * @param {Object=} params 个性化参数,如自定义shape集合,带进来就好 + * 创建zrender实例 * - * @return {ZRender} ZRender实例 + * @param {HTMLElement} dom 绘图容器 + * @return {module:zrender~ZRender} ZRender实例 */ -zrender.init = function (dom, params) { - var zi = new ZRender(guid(), dom, params || {}); - _instances[zi.id] = zi; - return zi; +// 不让外部直接new ZRender实例,为啥? +// 不为啥,提供全局可控同时减少全局污染和降低命名冲突的风险! +zrender.init = function (dom) { + var zr = new ZRender(guid(), dom); + _instances[zr.id] = zr; + return zr; }; /** - * zrender实例销毁,记在_instances里的索引也会删除了 - * 管生就得管死,可以通过zrender.dispose(zi)销毁指定ZRender实例 - * 当然也可以直接zi.dispose()自己销毁 - * - * @param {ZRender=} zi ZRender对象,不传则销毁全部 + * zrender实例销毁 + * @param {module:zrender~ZRender} zr ZRender对象,不传则销毁全部 */ -zrender.dispose = function (zi) { - if (zi) { - zi.dispose(); +// 在_instances里的索引也会删除了 +// 管生就得管死,可以通过zrender.dispose(zr)销毁指定ZRender实例 +// 当然也可以直接zr.dispose()自己销毁 +zrender.dispose = function (zr) { + if (zr) { + zr.dispose(); } else { for (var key in _instances) { @@ -84,8 +80,8 @@ zrender.dispose = function (zi) { /** * 获取zrender实例 - * * @param {string} id ZRender对象索引 + * @return {module:zrender~ZRender} */ zrender.getInstance = function (id) { return _instances[id]; @@ -107,29 +103,32 @@ zrender.delInstance = function (id) { function getFrameCallback(zrInstance) { return function () { - var animatingShapes = zrInstance.animatingShapes; - for (var i = 0, l = animatingShapes.length; i < l; i++) { - zrInstance.storage.mod(animatingShapes[i].id); + var animatingElements = zrInstance.animatingElements; + for (var i = 0, l = animatingElements.length; i < l; i++) { + zrInstance.storage.mod(animatingElements[i].id); } - if (animatingShapes.length || zrInstance._needsRefreshNextFrame) { + if (animatingElements.length || zrInstance._needsRefreshNextFrame) { zrInstance.refresh(); } }; } /** - * ZRender接口类,对外可用的所有接口都在这里!! - * storage(M)、painter(V)、handler(C)为内部私有类,外部接口不可见 - * 非get接口统一返回支持链式调用~ + * ZRender接口类,对外可用的所有接口都在这里 + * 非get接口统一返回支持链式调用 * + * @constructor + * @alias module:zrender~ZRender * @param {string} id 唯一标识 * @param {HTMLElement} dom dom对象,不帮你做document.getElementById - * * @return {ZRender} ZRender实例 */ - -function ZRender(id, dom) { +var ZRender = function (id, dom) { + /** + * 实例 id + * @type {string} + */ this.id = id; this.env = require('./tool/env.js'); @@ -138,7 +137,10 @@ function ZRender(id, dom) { this.handler = new Handler(dom, this.storage, this.painter); // 动画控制 - this.animatingShapes = []; + this.animatingElements = []; + /** + * @type {module:zrender/animation/Animation} + */ this.animation = new Animation({ stage: { update: getFrameCallback(this) @@ -146,11 +148,17 @@ function ZRender(id, dom) { }); this.animation.start(); + var self = this; + this.painter.refreshNextFrame = function () { + self.refreshNextFrame(); + }; + this._needsRefreshNextFrame = false; -} +}; /** * 获取实例唯一标识 + * @return {string} */ ZRender.prototype.getId = function () { return this.id; @@ -159,7 +167,7 @@ ZRender.prototype.getId = function () { /** * 添加图形形状到根节点 * - * @param {zrender.shape.Base} shape 形状对象,可用属性全集,详见各shape + * @param {module:zrender/shape/Base} shape 形状对象,可用属性全集,详见各shape */ ZRender.prototype.addShape = function (shape) { this.storage.addRoot(shape); @@ -169,7 +177,7 @@ ZRender.prototype.addShape = function (shape) { /** * 添加组到根节点 * - * @param {zrender.shape.Group} group + * @param {module:zrender/Group} group */ ZRender.prototype.addGroup = function (group) { this.storage.addRoot(group); @@ -210,7 +218,7 @@ ZRender.prototype.modShape = function (shapeId, shape) { /** * 修改组 * - * @param {string} shapeId + * @param {string} groupId * @param {Object} group */ ZRender.prototype.modGroup = function (groupId, group) { @@ -219,10 +227,19 @@ ZRender.prototype.modGroup = function (groupId, group) { }; /** - * 修改指定zlevel的绘制配置项,例如clearColor + * 修改指定zlevel的绘制配置项 * * @param {string} zLevel - * @param {Object} config 配置对象, 目前支持clearColor + * @param {Object} config 配置对象 + * @param {string} [config.clearColor=0] 每次清空画布的颜色 + * @param {string} [config.motionBlur=false] 是否开启动态模糊 + * @param {number} [config.lastFrameAlpha=0.7] + * 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显 + * @param {Array.} [config.position] 层的平移 + * @param {Array.} [config.rotation] 层的旋转 + * @param {Array.} [config.scale] 层的缩放 + * @param {boolean} [config.zoomable=false] 层是否支持鼠标缩放操作 + * @param {boolean} [config.panable=false] 层是否支持鼠标平移操作 */ ZRender.prototype.modLayer = function (zLevel, config) { this.painter.modLayer(zLevel, config); @@ -243,7 +260,6 @@ ZRender.prototype.addHoverShape = function (shape) { * 渲染 * * @param {Function} callback 渲染结束后回调函数 - * todo:增加缓动函数 */ ZRender.prototype.render = function (callback) { this.painter.render(callback); @@ -262,16 +278,16 @@ ZRender.prototype.refresh = function (callback) { return this; }; -// TODO -// 好像会有奇怪的问题 +/** + * 标记视图在浏览器下一帧需要绘制 + */ ZRender.prototype.refreshNextFrame = function () { this._needsRefreshNextFrame = true; return this; }; /** - * 高亮层更新 - * + * 绘制高亮层 * @param {Function} callback 视图更新后回调函数 */ ZRender.prototype.refreshHover = function (callback) { @@ -282,14 +298,17 @@ ZRender.prototype.refreshHover = function (callback) { /** * 视图更新 * - * @param {Array} shapeList 需要更新的图形元素列表 + * @param {Array.} shapeList 需要更新的图形列表 * @param {Function} callback 视图更新后回调函数 */ -ZRender.prototype.update = function (shapeList, callback) { - this.painter.update(shapeList, callback); +ZRender.prototype.refreshShapes = function (shapeList, callback) { + this.painter.refreshShapes(shapeList, callback); return this; }; +/** + * 调整视图大小 + */ ZRender.prototype.resize = function () { this.painter.resize(); return this; @@ -298,23 +317,25 @@ ZRender.prototype.resize = function () { /** * 动画 * - * @param {string} shapeId 形状对象唯一标识 + * @param {string|module:zrender/Group|module:zrender/shape/Base} el 动画对象 * @param {string} path 需要添加动画的属性获取路径,可以通过a.b.c来获取深层的属性 - * @param {boolean} loop 动画是否循环 - * @return {Object} 动画的Deferred对象 - * Example: - * zr.animate(circleId, 'style', false) - * .when(1000, { x: 10} ) - * .done(function(){ console.log('Animation done')}) - * .start() - */ -ZRender.prototype.animate = function (shapeId, path, loop) { - var shape = this.storage.get(shapeId); - if (shape) { + * @param {boolean} [loop] 动画是否循环 + * @return {module:zrender/animation/Animation~Animator} + * @example: + * zr.animate(circle.id, 'style', false) + * .when(1000, {x: 10} ) + * .done(function(){ // Animation done }) + * .start() + */ +ZRender.prototype.animate = function (el, path, loop) { + if (typeof(el) === 'string') { + el = this.storage.get(el); + } + if (el) { var target; if (path) { var pathSplitted = path.split('.'); - var prop = shape; + var prop = el; for (var i = 0, l = pathSplitted.length; i < l; i++) { if (!prop) { continue; @@ -326,37 +347,37 @@ ZRender.prototype.animate = function (shapeId, path, loop) { } } else { - target = shape; + target = el; } if (!target) { - log('Property "' + path + '" is not existed in shape ' + shapeId); + log('Property "' + path + '" is not existed in element ' + el.id); return; } - var animatingShapes = this.animatingShapes; - if (typeof shape.__aniCount === 'undefined') { + var animatingElements = this.animatingElements; + if (typeof el.__aniCount === 'undefined') { // 正在进行的动画记数 - shape.__aniCount = 0; + el.__aniCount = 0; } - if (shape.__aniCount === 0) { - animatingShapes.push(shape); + if (el.__aniCount === 0) { + animatingElements.push(el); } - shape.__aniCount++; + el.__aniCount++; return this.animation.animate(target, { loop: loop }).done(function () { - shape.__aniCount--; - if (shape.__aniCount === 0) { - // 从animatingShapes里移除 - var idx = util.indexOf(animatingShapes, shape); - animatingShapes.splice(idx, 1); + el.__aniCount--; + if (el.__aniCount === 0) { + // 从animatingElements里移除 + var idx = util.indexOf(animatingElements, el); + animatingElements.splice(idx, 1); } }); } else { - log('Shape "' + shapeId + '" not existed'); + log('Element not existed'); } }; @@ -400,7 +421,10 @@ ZRender.prototype.getHeight = function () { }; /** - * 图像导出 + * 图像导出 + * @param {string} type + * @param {string} [backgroundColor='#fff'] 背景色 + * @return {string} 图片的Base64 url */ ZRender.prototype.toDataURL = function (type, backgroundColor, args) { return this.painter.toDataURL(type, backgroundColor, args); @@ -408,6 +432,9 @@ ZRender.prototype.toDataURL = function (type, backgroundColor, args) { /** * 将常规shape转成image shape + * @param {module:zrender/shape/Base} e + * @param {number} width + * @param {number} height */ ZRender.prototype.shapeToImage = function (e, width, height) { var id = guid(); @@ -419,9 +446,10 @@ ZRender.prototype.shapeToImage = function (e, width, height) { * * @param {string} eventName 事件名称 * @param {Function} eventHandler 响应函数 + * @param {Object} [context] 响应函数 */ -ZRender.prototype.on = function (eventName, eventHandler) { - this.handler.on(eventName, eventHandler); +ZRender.prototype.on = function (eventName, eventHandler, context) { + this.handler.on(eventName, eventHandler, context); return this; }; @@ -439,7 +467,7 @@ ZRender.prototype.un = function (eventName, eventHandler) { /** * 事件触发 * - * @param {string} event 事件名称,resize,hover,drag,etc~ + * @param {string} eventName 事件名称,resize,hover,drag,etc * @param {event=} event event dom事件对象 */ ZRender.prototype.trigger = function (eventName, event) { @@ -469,12 +497,12 @@ ZRender.prototype.dispose = function () { this.handler.dispose(); this.animation = - this.animatingShapes = + this.animatingElements = this.storage = this.painter = this.handler = null; - //释放后告诉全局删除对自己的索引,没想到啥好方法 + // 释放后告诉全局删除对自己的索引,没想到啥好方法 zrender.delInstance(this.id); };